From: Cris Di Sclafani
Date: Fri, 30 Oct 2020 15:25:46 +0000 (+0100)
Subject: Built motion from commit (unavailable).|2.5.4
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22my-avatar.png/%22?a=commitdiff_plain;h=240e90870b99bca03ef70604d5f0faadc375decd;p=motion2.git
Built motion from commit (unavailable).|2.5.4
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 1f831af..9aad36a 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1 +1 @@
-define({
"name": "xCALLY Motion API",
"version": "2.5.4",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
"title": "Introduction",
"content": "The API \nThis is the documentation for the xCALLY MOTION API.
\nWe make changes to the APIs from time to time. For more information, see Changelog .
\nThe xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.
\nThe API is a JSON API. XML is not supported. To learn more, see [Working with JSON].
\nEndpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:
\nGET /api/users\n \nPrepend your xCALLY URL to the resource identifier to get the full endpoint URL:
\nhttps://motion.xcally.com/api/users\n \nCurly braces, {}
, indicate values you have to supply. Example:
\nGET /api/users/{id}\n \nThe examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].
\nThe examples use basic authentication requiring a xCALLY username and password.
\nSecurity and Authentication \nThis is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.
\nClient-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.
\nBasic authentication \nUse the following authentication format with your username and password:\n{username}:{password}
\nExample:
\ncurl -u admin:password https://motion.xcally.com/api/users\n \nOAuth access token \nThe xCALLY API supports OAuth authorization flows.
\nOAuth access tokens also permit client-side API requests.
\nIn your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}
\nExample:
\ncurl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n \nAPI Key \nIn your request, specify the API Key in apikey query parameter
\nExample:
\ncurl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n \nRequest Format \nThe xCALLY API is a JSON API. You must supply a Content-Type: application/json
header in PUT
and POST
requests. You must set an Accept: application/json
header on all requests. You may get a text/plain
response in case of an error like a bad request. You should treat this as an error you need to fix.
\nResponse Format \nThe xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.
\nResponses may have the status codes described in the following sections.
\n200 range \nThe request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.
\n400 range \nThe request was not successful. The content type of the response may be text/plain
for API-level error messages, such as when trying to call the API without SSL. The content type is application/json
for business-level error messages because the response includes a JSON object with information about the error.
\nIf you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.
\n500 range \nWhen building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.
\nIf submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.
\nData Types \nThe API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.
\nID integers \nMost xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.
\nThe default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.
\nTime stamps \nTime stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z
\n"
},
"template": {
"withGenerator": false,
"withCompare": false,
"forceLanguage": "en"
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2020-10-30T14:57:31.448Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
});
+define({
"name": "xCALLY Motion API",
"version": "2.5.4",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
"title": "Introduction",
"content": "The API \nThis is the documentation for the xCALLY MOTION API.
\nWe make changes to the APIs from time to time. For more information, see Changelog .
\nThe xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.
\nThe API is a JSON API. XML is not supported. To learn more, see [Working with JSON].
\nEndpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:
\nGET /api/users\n \nPrepend your xCALLY URL to the resource identifier to get the full endpoint URL:
\nhttps://motion.xcally.com/api/users\n \nCurly braces, {}
, indicate values you have to supply. Example:
\nGET /api/users/{id}\n \nThe examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].
\nThe examples use basic authentication requiring a xCALLY username and password.
\nSecurity and Authentication \nThis is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.
\nClient-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.
\nBasic authentication \nUse the following authentication format with your username and password:\n{username}:{password}
\nExample:
\ncurl -u admin:password https://motion.xcally.com/api/users\n \nOAuth access token \nThe xCALLY API supports OAuth authorization flows.
\nOAuth access tokens also permit client-side API requests.
\nIn your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}
\nExample:
\ncurl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n \nAPI Key \nIn your request, specify the API Key in apikey query parameter
\nExample:
\ncurl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n \nRequest Format \nThe xCALLY API is a JSON API. You must supply a Content-Type: application/json
header in PUT
and POST
requests. You must set an Accept: application/json
header on all requests. You may get a text/plain
response in case of an error like a bad request. You should treat this as an error you need to fix.
\nResponse Format \nThe xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.
\nResponses may have the status codes described in the following sections.
\n200 range \nThe request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.
\n400 range \nThe request was not successful. The content type of the response may be text/plain
for API-level error messages, such as when trying to call the API without SSL. The content type is application/json
for business-level error messages because the response includes a JSON object with information about the error.
\nIf you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.
\n500 range \nWhen building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.
\nIf submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.
\nData Types \nThe API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.
\nID integers \nMost xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.
\nThe default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.
\nTime stamps \nTime stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z
\n"
},
"template": {
"withGenerator": false,
"withCompare": false,
"forceLanguage": "en"
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2020-10-30T15:16:57.330Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
});
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 08dea75..09961f7 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1 +1 @@
-{
"name": "xCALLY Motion API",
"version": "2.5.4",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
"title": "Introduction",
"content": "The API \nThis is the documentation for the xCALLY MOTION API.
\nWe make changes to the APIs from time to time. For more information, see Changelog .
\nThe xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.
\nThe API is a JSON API. XML is not supported. To learn more, see [Working with JSON].
\nEndpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:
\nGET /api/users\n \nPrepend your xCALLY URL to the resource identifier to get the full endpoint URL:
\nhttps://motion.xcally.com/api/users\n \nCurly braces, {}
, indicate values you have to supply. Example:
\nGET /api/users/{id}\n \nThe examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].
\nThe examples use basic authentication requiring a xCALLY username and password.
\nSecurity and Authentication \nThis is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.
\nClient-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.
\nBasic authentication \nUse the following authentication format with your username and password:\n{username}:{password}
\nExample:
\ncurl -u admin:password https://motion.xcally.com/api/users\n \nOAuth access token \nThe xCALLY API supports OAuth authorization flows.
\nOAuth access tokens also permit client-side API requests.
\nIn your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}
\nExample:
\ncurl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n \nAPI Key \nIn your request, specify the API Key in apikey query parameter
\nExample:
\ncurl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n \nRequest Format \nThe xCALLY API is a JSON API. You must supply a Content-Type: application/json
header in PUT
and POST
requests. You must set an Accept: application/json
header on all requests. You may get a text/plain
response in case of an error like a bad request. You should treat this as an error you need to fix.
\nResponse Format \nThe xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.
\nResponses may have the status codes described in the following sections.
\n200 range \nThe request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.
\n400 range \nThe request was not successful. The content type of the response may be text/plain
for API-level error messages, such as when trying to call the API without SSL. The content type is application/json
for business-level error messages because the response includes a JSON object with information about the error.
\nIf you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.
\n500 range \nWhen building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.
\nIf submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.
\nData Types \nThe API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.
\nID integers \nMost xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.
\nThe default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.
\nTime stamps \nTime stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z
\n"
},
"template": {
"withGenerator": false,
"withCompare": false,
"forceLanguage": "en"
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2020-10-30T14:57:31.448Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
}
+{
"name": "xCALLY Motion API",
"version": "2.5.4",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
"title": "Introduction",
"content": "The API \nThis is the documentation for the xCALLY MOTION API.
\nWe make changes to the APIs from time to time. For more information, see Changelog .
\nThe xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.
\nThe API is a JSON API. XML is not supported. To learn more, see [Working with JSON].
\nEndpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:
\nGET /api/users\n \nPrepend your xCALLY URL to the resource identifier to get the full endpoint URL:
\nhttps://motion.xcally.com/api/users\n \nCurly braces, {}
, indicate values you have to supply. Example:
\nGET /api/users/{id}\n \nThe examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].
\nThe examples use basic authentication requiring a xCALLY username and password.
\nSecurity and Authentication \nThis is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.
\nClient-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.
\nBasic authentication \nUse the following authentication format with your username and password:\n{username}:{password}
\nExample:
\ncurl -u admin:password https://motion.xcally.com/api/users\n \nOAuth access token \nThe xCALLY API supports OAuth authorization flows.
\nOAuth access tokens also permit client-side API requests.
\nIn your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}
\nExample:
\ncurl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n \nAPI Key \nIn your request, specify the API Key in apikey query parameter
\nExample:
\ncurl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n \nRequest Format \nThe xCALLY API is a JSON API. You must supply a Content-Type: application/json
header in PUT
and POST
requests. You must set an Accept: application/json
header on all requests. You may get a text/plain
response in case of an error like a bad request. You should treat this as an error you need to fix.
\nResponse Format \nThe xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.
\nResponses may have the status codes described in the following sections.
\n200 range \nThe request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.
\n400 range \nThe request was not successful. The content type of the response may be text/plain
for API-level error messages, such as when trying to call the API without SSL. The content type is application/json
for business-level error messages because the response includes a JSON object with information about the error.
\nIf you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.
\n500 range \nWhen building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.
\nIf submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.
\nData Types \nThe API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.
\nID integers \nMost xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.
\nThe default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.
\nTime stamps \nTime stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z
\n"
},
"template": {
"withGenerator": false,
"withCompare": false,
"forceLanguage": "en"
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2020-10-30T15:16:57.330Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 6a8ae40..d5a0e07 100644
--- a/server/api/action/action.attributes.js
+++ b/server/api/action/action.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x43f3=['exports','VIRTUAL','action','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x22bfa0,_0xa20f92){var _0x388c6a=function(_0x498ec1){while(--_0x498ec1){_0x22bfa0['push'](_0x22bfa0['shift']());}};_0x388c6a(++_0xa20f92);}(_0x43f3,0x1df));var _0x343f=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x43f3[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0x343f('0x0'));module[_0x343f('0x1')]={'name':{'type':Sequelize[_0x343f('0x2')],'get':function(_0x4c77b4){return this['getDataValue'](_0x343f('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x343f('0x4'),_0x343f('0x5'),_0x343f('0x6'),'urlForward',_0x343f('0x7'),'bot',_0x343f('0x8')]],'msg':_0x343f('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x343f('0xa')](0x1000),'comment':_0x343f('0xb')},'data2':{'type':Sequelize[_0x343f('0xa')](0x1000),'comment':_0x343f('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x343f('0xd')},'data4':{'type':Sequelize[_0x343f('0xa')](0x1000)},'data5':{'type':Sequelize[_0x343f('0xa')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x343f('0xe')]}};
\ No newline at end of file
+var _0x8dcd=['exports','VIRTUAL','getDataValue','action','STRING','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT','sequelize'];(function(_0x13c31d,_0x115e74){var _0x5ac72d=function(_0x210d41){while(--_0x210d41){_0x13c31d['push'](_0x13c31d['shift']());}};_0x5ac72d(++_0x115e74);}(_0x8dcd,0x1d3));var _0xd8dc=function(_0x54efc6,_0x59097a){_0x54efc6=_0x54efc6-0x0;var _0x266fce=_0x8dcd[_0x54efc6];return _0x266fce;};'use strict';var Sequelize=require(_0xd8dc('0x0'));module[_0xd8dc('0x1')]={'name':{'type':Sequelize[_0xd8dc('0x2')],'get':function(_0x41811a){return this[_0xd8dc('0x3')](_0xd8dc('0x4'));}},'action':{'type':Sequelize[_0xd8dc('0x5')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration','motionbar','jscripty','urlForward',_0xd8dc('0x6'),_0xd8dc('0x7'),_0xd8dc('0x8')]],'msg':_0xd8dc('0x9')}},'comment':_0xd8dc('0x9')},'data1':{'type':Sequelize[_0xd8dc('0x5')](0x1000),'comment':_0xd8dc('0xa')},'data2':{'type':Sequelize[_0xd8dc('0x5')](0x1000),'comment':_0xd8dc('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xd8dc('0x5')](0x1000)},'data5':{'type':Sequelize[_0xd8dc('0x5')](0x1000)},'data6':{'type':Sequelize[_0xd8dc('0x5')]},'data7':{'type':Sequelize[_0xd8dc('0xc')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index c620a76..23b3ed8 100644
--- a/server/api/action/action.controller.js
+++ b/server/api/action/action.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8b67=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','body','Action','find','params','catch','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x475d67,_0x875fdb){var _0x4df2f1=function(_0x17a44c){while(--_0x17a44c){_0x475d67['push'](_0x475d67['shift']());}};_0x4df2f1(++_0x875fdb);}(_0x8b67,0x178));var _0x78b6=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x8b67[_0x11a55c];return _0x26c390;};'use strict';var pdf=require(_0x78b6('0x0'));var emlformat=require(_0x78b6('0x1'));var rimraf=require(_0x78b6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x78b6('0x3'));var moment=require(_0x78b6('0x4'));var BPromise=require(_0x78b6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x78b6('0x6'));var sox=require('sox');var csv=require(_0x78b6('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x78b6('0x8'));var squel=require(_0x78b6('0x9'));var crypto=require(_0x78b6('0xa'));var jsforce=require(_0x78b6('0xb'));var deskjs=require(_0x78b6('0xc'));var toCsv=require(_0x78b6('0x7'));var querystring=require(_0x78b6('0xd'));var Papa=require(_0x78b6('0xe'));var Redis=require(_0x78b6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x78b6('0x10'));var hardwareService=require(_0x78b6('0x11'));var logger=require(_0x78b6('0x12'))(_0x78b6('0x13'));var utils=require(_0x78b6('0x14'));var config=require(_0x78b6('0x15'));var db=require(_0x78b6('0x16'))['db'];function respondWithStatusCode(_0x2a5c59,_0x14c673){_0x14c673=_0x14c673||0xcc;return function(_0x25a1b4){if(_0x25a1b4){return _0x2a5c59[_0x78b6('0x17')](_0x14c673);}return _0x2a5c59[_0x78b6('0x18')](_0x14c673)[_0x78b6('0x19')]();};}function respondWithResult(_0x6c1a7,_0x39fa47){_0x39fa47=_0x39fa47||0xc8;return function(_0x33d752){if(_0x33d752){return _0x6c1a7[_0x78b6('0x18')](_0x39fa47)[_0x78b6('0x1a')](_0x33d752);}};}function respondWithFilteredResult(_0x15486a,_0x3c1a11){return function(_0x343109){if(_0x343109){var _0x33117b=_0x343109[_0x78b6('0x1b')],_0x2bd5a6=_0x3c1a11[_0x78b6('0x1c')],_0x531fa6=_0x3c1a11[_0x78b6('0x1c')]+_0x3c1a11[_0x78b6('0x1d')],_0x10a6bd;if(_0x531fa6>=_0x33117b){_0x531fa6=_0x33117b;_0x10a6bd=0xc8;}else{_0x10a6bd=0xce;}_0x15486a[_0x78b6('0x18')](_0x10a6bd);return _0x15486a['set'](_0x78b6('0x1e'),_0x2bd5a6+'-'+_0x531fa6+'/'+_0x33117b)[_0x78b6('0x1a')](_0x343109);}return null;};}function patchUpdates(_0x380416){return function(_0x407823){try{jsonpatch[_0x78b6('0x1f')](_0x407823,_0x380416,!![]);}catch(_0x597270){return BPromise['reject'](_0x597270);}return _0x407823[_0x78b6('0x20')]();};}function saveUpdates(_0x4b246e,_0x340942){return function(_0x297943){if(_0x297943){return _0x297943[_0x78b6('0x21')](_0x4b246e)[_0x78b6('0x22')](function(_0x48b72a){return _0x48b72a;});}return null;};}function removeEntity(_0x3863a5,_0x46f38c){return function(_0x3160d5){if(_0x3160d5){return _0x3160d5[_0x78b6('0x23')]()[_0x78b6('0x22')](function(){_0x3863a5[_0x78b6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb71996,_0x15eeee){return function(_0xc27580){if(!_0xc27580){_0xb71996[_0x78b6('0x17')](0x194);}return _0xc27580;};}function handleError(_0x39e5b4,_0x469f58){_0x469f58=_0x469f58||0x1f4;return function(_0x4776b0){logger['error'](_0x4776b0[_0x78b6('0x24')]);if(_0x4776b0[_0x78b6('0x25')]){delete _0x4776b0[_0x78b6('0x25')];}_0x39e5b4['status'](_0x469f58)[_0x78b6('0x26')](_0x4776b0);};}exports['update']=function(_0x19f13b,_0x258d51){if(_0x19f13b[_0x78b6('0x27')]['id']){delete _0x19f13b[_0x78b6('0x27')]['id'];}return db[_0x78b6('0x28')][_0x78b6('0x29')]({'where':{'id':_0x19f13b[_0x78b6('0x2a')]['id']}})['then'](handleEntityNotFound(_0x258d51,null))['then'](saveUpdates(_0x19f13b['body'],null))[_0x78b6('0x22')](respondWithResult(_0x258d51,null))[_0x78b6('0x2b')](handleError(_0x258d51,null));};exports['destroy']=function(_0x47278e,_0xd57d64){return db[_0x78b6('0x28')]['find']({'where':{'id':_0x47278e[_0x78b6('0x2a')]['id']}})['then'](handleEntityNotFound(_0xd57d64,null))[_0x78b6('0x22')](removeEntity(_0xd57d64,null))['catch'](handleError(_0xd57d64,null));};
\ No newline at end of file
+var _0x315e=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','body','Action','find','params','catch','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0xecab25,_0x3f6ba7){var _0xd53dc8=function(_0x4e7738){while(--_0x4e7738){_0xecab25['push'](_0xecab25['shift']());}};_0xd53dc8(++_0x3f6ba7);}(_0x315e,0x1cb));var _0xe315=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x315e[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe315('0x0'));var jsonpatch=require(_0xe315('0x1'));var rp=require(_0xe315('0x2'));var moment=require(_0xe315('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe315('0x4'));var util=require(_0xe315('0x5'));var path=require(_0xe315('0x6'));var sox=require('sox');var csv=require(_0xe315('0x7'));var ejs=require(_0xe315('0x8'));var fs=require('fs');var _=require(_0xe315('0x9'));var squel=require('squel');var crypto=require(_0xe315('0xa'));var jsforce=require(_0xe315('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe315('0x7'));var querystring=require(_0xe315('0xc'));var Papa=require(_0xe315('0xd'));var Redis=require(_0xe315('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe315('0xf'));var as=require(_0xe315('0x10'));var hardwareService=require(_0xe315('0x11'));var logger=require(_0xe315('0x12'))(_0xe315('0x13'));var utils=require(_0xe315('0x14'));var config=require(_0xe315('0x15'));var db=require(_0xe315('0x16'))['db'];function respondWithStatusCode(_0x21c272,_0x27462d){_0x27462d=_0x27462d||0xcc;return function(_0x305d56){if(_0x305d56){return _0x21c272['sendStatus'](_0x27462d);}return _0x21c272[_0xe315('0x17')](_0x27462d)[_0xe315('0x18')]();};}function respondWithResult(_0x4e7283,_0x449dff){_0x449dff=_0x449dff||0xc8;return function(_0x386270){if(_0x386270){return _0x4e7283[_0xe315('0x17')](_0x449dff)[_0xe315('0x19')](_0x386270);}};}function respondWithFilteredResult(_0x1da94c,_0x4983b8){return function(_0x539133){if(_0x539133){var _0x5e652d=_0x539133['count'],_0x306294=_0x4983b8[_0xe315('0x1a')],_0x13544c=_0x4983b8[_0xe315('0x1a')]+_0x4983b8[_0xe315('0x1b')],_0x3bce0b;if(_0x13544c>=_0x5e652d){_0x13544c=_0x5e652d;_0x3bce0b=0xc8;}else{_0x3bce0b=0xce;}_0x1da94c['status'](_0x3bce0b);return _0x1da94c[_0xe315('0x1c')](_0xe315('0x1d'),_0x306294+'-'+_0x13544c+'/'+_0x5e652d)[_0xe315('0x19')](_0x539133);}return null;};}function patchUpdates(_0x106941){return function(_0x578cf5){try{jsonpatch[_0xe315('0x1e')](_0x578cf5,_0x106941,!![]);}catch(_0xf276bb){return BPromise[_0xe315('0x1f')](_0xf276bb);}return _0x578cf5[_0xe315('0x20')]();};}function saveUpdates(_0x43f49d,_0x53f2fd){return function(_0x9c1972){if(_0x9c1972){return _0x9c1972[_0xe315('0x21')](_0x43f49d)[_0xe315('0x22')](function(_0x3a0960){return _0x3a0960;});}return null;};}function removeEntity(_0x368075,_0x39c15d){return function(_0x449878){if(_0x449878){return _0x449878['destroy']()[_0xe315('0x22')](function(){_0x368075['status'](0xcc)[_0xe315('0x18')]();});}};}function handleEntityNotFound(_0x467a44,_0x382ef8){return function(_0x579d00){if(!_0x579d00){_0x467a44[_0xe315('0x23')](0x194);}return _0x579d00;};}function handleError(_0x295319,_0x496955){_0x496955=_0x496955||0x1f4;return function(_0x2338ce){logger[_0xe315('0x24')](_0x2338ce['stack']);if(_0x2338ce[_0xe315('0x25')]){delete _0x2338ce[_0xe315('0x25')];}_0x295319[_0xe315('0x17')](_0x496955)['send'](_0x2338ce);};}exports[_0xe315('0x21')]=function(_0x1698fb,_0x3336d3){if(_0x1698fb['body']['id']){delete _0x1698fb[_0xe315('0x26')]['id'];}return db[_0xe315('0x27')][_0xe315('0x28')]({'where':{'id':_0x1698fb[_0xe315('0x29')]['id']}})['then'](handleEntityNotFound(_0x3336d3,null))[_0xe315('0x22')](saveUpdates(_0x1698fb['body'],null))[_0xe315('0x22')](respondWithResult(_0x3336d3,null))[_0xe315('0x2a')](handleError(_0x3336d3,null));};exports['destroy']=function(_0x45f318,_0x23cd84){return db[_0xe315('0x27')][_0xe315('0x28')]({'where':{'id':_0x45f318[_0xe315('0x29')]['id']}})['then'](handleEntityNotFound(_0x23cd84,null))['then'](removeEntity(_0x23cd84,null))[_0xe315('0x2a')](handleError(_0x23cd84,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 0410f5c..893e08e 100644
--- a/server/api/action/action.model.js
+++ b/server/api/action/action.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6e61=['exports','Action','tools_actions','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./action.attributes'];(function(_0x183aa3,_0x2388a1){var _0x5489dd=function(_0x1d88d0){while(--_0x1d88d0){_0x183aa3['push'](_0x183aa3['shift']());}};_0x5489dd(++_0x2388a1);}(_0x6e61,0x7b));var _0x16e6=function(_0x3ac151,_0x290a5f){_0x3ac151=_0x3ac151-0x0;var _0x2c2844=_0x6e61[_0x3ac151];return _0x2c2844;};'use strict';var _=require(_0x16e6('0x0'));var util=require(_0x16e6('0x1'));var logger=require(_0x16e6('0x2'))(_0x16e6('0x3'));var moment=require('moment');var BPromise=require(_0x16e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16e6('0x5'));var rimraf=require(_0x16e6('0x6'));var config=require(_0x16e6('0x7'));var attributes=require(_0x16e6('0x8'));module[_0x16e6('0x9')]=function(_0x311af8,_0x5461b8){return _0x311af8['define'](_0x16e6('0xa'),attributes,{'tableName':_0x16e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x88fa=['request-promise','path','rimraf','../../config/environment','exports','Action','tools_actions','lodash','util','moment','bluebird'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x88fa,0xcd));var _0xa88f=function(_0x38e717,_0x5b8bba){_0x38e717=_0x38e717-0x0;var _0x5bda01=_0x88fa[_0x38e717];return _0x5bda01;};'use strict';var _=require(_0xa88f('0x0'));var util=require(_0xa88f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa88f('0x2'));var BPromise=require(_0xa88f('0x3'));var rp=require(_0xa88f('0x4'));var fs=require('fs');var path=require(_0xa88f('0x5'));var rimraf=require(_0xa88f('0x6'));var config=require(_0xa88f('0x7'));var attributes=require('./action.attributes');module[_0xa88f('0x8')]=function(_0x563442,_0x3f4527){return _0x563442['define'](_0xa88f('0x9'),attributes,{'tableName':_0xa88f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 8dcb756..06323b3 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1678c8,_0x1c32f4){var _0x387aa9=function(_0x2803bd){while(--_0x2803bd){_0x1678c8['push'](_0x1678c8['shift']());}};_0x387aa9(++_0x1c32f4);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
+var _0xb7e7=['Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x444e2b,_0x1223bb){var _0x250f5f=function(_0x595d6d){while(--_0x595d6d){_0x444e2b['push'](_0x444e2b['shift']());}};_0x250f5f(++_0x1223bb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xb7e7[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('Action,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index c52da65..75785e6 100644
--- a/server/api/action/index.js
+++ b/server/api/action/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x440b=['isAuthenticated','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id'];(function(_0x58b3fc,_0x25274a){var _0x3dab63=function(_0x4c1128){while(--_0x4c1128){_0x58b3fc['push'](_0x58b3fc['shift']());}};_0x3dab63(++_0x25274a);}(_0x440b,0x149));var _0xb440=function(_0x5f12c9,_0x999e31){_0x5f12c9=_0x5f12c9-0x0;var _0x53cbaf=_0x440b[_0x5f12c9];return _0x53cbaf;};'use strict';var multer=require(_0xb440('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb440('0x1'));var express=require(_0xb440('0x2'));var router=express[_0xb440('0x3')]();var auth=require(_0xb440('0x4'));var interaction=require(_0xb440('0x5'));var config=require(_0xb440('0x6'));var controller=require('./action.controller');router[_0xb440('0x7')](_0xb440('0x8'),auth[_0xb440('0x9')](),controller['update']);router[_0xb440('0xa')]('/:id',auth[_0xb440('0x9')](),controller[_0xb440('0xb')]);module[_0xb440('0xc')]=router;
\ No newline at end of file
+var _0x818e=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','delete','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x818e,0x1d8));var _0xe818=function(_0x39b360,_0x528399){_0x39b360=_0x39b360-0x0;var _0x29c614=_0x818e[_0x39b360];return _0x29c614;};'use strict';var multer=require(_0xe818('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe818('0x1'));var express=require('express');var router=express[_0xe818('0x2')]();var auth=require(_0xe818('0x3'));var interaction=require(_0xe818('0x4'));var config=require(_0xe818('0x5'));var controller=require('./action.controller');router['put'](_0xe818('0x6'),auth[_0xe818('0x7')](),controller[_0xe818('0x8')]);router[_0xe818('0x9')](_0xe818('0x6'),auth[_0xe818('0x7')](),controller['destroy']);module[_0xe818('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 3e00290..ca5ea7b 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x998c=['sequelize','exports','STRING','TEXT'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x998c,0x1dc));var _0xc998=function(_0x435b2f,_0x4c44da){_0x435b2f=_0x435b2f-0x0;var _0x181648=_0x998c[_0x435b2f];return _0x181648;};'use strict';var Sequelize=require(_0xc998('0x0'));module[_0xc998('0x1')]={'name':{'type':Sequelize[_0xc998('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc998('0x2')]},'parent':{'type':Sequelize[_0xc998('0x2')]},'table':{'type':Sequelize[_0xc998('0x2')]},'conditions':{'type':Sequelize[_0xc998('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xebe7=['STRING','TEXT','sequelize','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xebe7,0x10e));var _0x7ebe=function(_0x5895f2,_0x20485d){_0x5895f2=_0x5895f2-0x0;var _0x180cc2=_0xebe7[_0x5895f2];return _0x180cc2;};'use strict';var Sequelize=require(_0x7ebe('0x0'));module[_0x7ebe('0x1')]={'name':{'type':Sequelize[_0x7ebe('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7ebe('0x2')]},'parent':{'type':Sequelize[_0x7ebe('0x2')]},'table':{'type':Sequelize[_0x7ebe('0x2')]},'conditions':{'type':Sequelize[_0x7ebe('0x3')]},'joins':{'type':Sequelize[_0x7ebe('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index b9386b2..da17ecd 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.controller.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa7dc=['CustomReports','UserProfileResource','sendStatus','stack','name','map','AnalyticCustomReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','count','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','MetricId','function','replace','format','groupBy','alias','parse','joins','includes','foreignTable','foreignKey','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','IS\x20NULL','IS\x20EMPTY','value','select','metric','order','orderBy','DESC','table','No\x20available\x20data','fullPath','randomstring','generate','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','run','runReport','AVG(%s)','HOUR(%s)','%s.%s\x20=\x20%s.%s','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','dbH','end','status','json','offset','limit','set','apply','save','update','then','destroy','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa7dc,0x11d));var _0xca7d=function(_0x2ff8ac,_0x34734f){_0x2ff8ac=_0x2ff8ac-0x0;var _0x37ebef=_0xa7dc[_0x2ff8ac];return _0x37ebef;};'use strict';var pdf=require(_0xca7d('0x0'));var emlformat=require(_0xca7d('0x1'));var rimraf=require(_0xca7d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca7d('0x3'));var rp=require('request-promise');var moment=require(_0xca7d('0x4'));var BPromise=require(_0xca7d('0x5'));var Mustache=require(_0xca7d('0x6'));var util=require(_0xca7d('0x7'));var path=require(_0xca7d('0x8'));var sox=require(_0xca7d('0x9'));var csv=require(_0xca7d('0xa'));var ejs=require(_0xca7d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca7d('0xc'));var crypto=require(_0xca7d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xca7d('0xe'));var toCsv=require(_0xca7d('0xa'));var querystring=require(_0xca7d('0xf'));var Papa=require('papaparse');var Redis=require(_0xca7d('0x10'));var authService=require(_0xca7d('0x11'));var qs=require(_0xca7d('0x12'));var as=require(_0xca7d('0x13'));var hardwareService=require(_0xca7d('0x14'));var logger=require('../../config/logger')(_0xca7d('0x15'));var utils=require('../../config/utils');var config=require(_0xca7d('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xca7d('0x17'))[_0xca7d('0x18')];function respondWithStatusCode(_0x3b8467,_0x2c3730){_0x2c3730=_0x2c3730||0xcc;return function(_0x4c1618){if(_0x4c1618){return _0x3b8467['sendStatus'](_0x2c3730);}return _0x3b8467['status'](_0x2c3730)[_0xca7d('0x19')]();};}function respondWithResult(_0x36f922,_0x3d8e7b){_0x3d8e7b=_0x3d8e7b||0xc8;return function(_0x39caec){if(_0x39caec){return _0x36f922[_0xca7d('0x1a')](_0x3d8e7b)[_0xca7d('0x1b')](_0x39caec);}};}function respondWithFilteredResult(_0x369923,_0x37bae3){return function(_0x254305){if(_0x254305){var _0x1a6cb7=_0x254305['count'],_0x2f6e8a=_0x37bae3[_0xca7d('0x1c')],_0x245c7c=_0x37bae3[_0xca7d('0x1c')]+_0x37bae3[_0xca7d('0x1d')],_0x51a6d0;if(_0x245c7c>=_0x1a6cb7){_0x245c7c=_0x1a6cb7;_0x51a6d0=0xc8;}else{_0x51a6d0=0xce;}_0x369923[_0xca7d('0x1a')](_0x51a6d0);return _0x369923[_0xca7d('0x1e')]('Content-Range',_0x2f6e8a+'-'+_0x245c7c+'/'+_0x1a6cb7)['json'](_0x254305);}return null;};}function patchUpdates(_0xcb2e83){return function(_0x4cb0d8){try{jsonpatch[_0xca7d('0x1f')](_0x4cb0d8,_0xcb2e83,!![]);}catch(_0x6a89a8){return BPromise['reject'](_0x6a89a8);}return _0x4cb0d8[_0xca7d('0x20')]();};}function saveUpdates(_0x5c106e,_0x583a24){return function(_0x408b07){if(_0x408b07){return _0x408b07[_0xca7d('0x21')](_0x5c106e)[_0xca7d('0x22')](function(_0x2fcf0b){return _0x2fcf0b;});}return null;};}function removeEntity(_0x5d049b,_0x4121ce){return function(_0x1cca8a){if(_0x1cca8a){return _0x1cca8a[_0xca7d('0x23')]()[_0xca7d('0x22')](function(){var _0x79fc7d=_0x1cca8a[_0xca7d('0x24')]({'plain':!![]});var _0xf4b873=_0xca7d('0x25');return db[_0xca7d('0x26')][_0xca7d('0x23')]({'where':{'type':_0xf4b873,'resourceId':_0x79fc7d['id']}})['then'](function(){return _0x1cca8a;});})[_0xca7d('0x22')](function(){_0x5d049b[_0xca7d('0x1a')](0xcc)[_0xca7d('0x19')]();});}};}function handleEntityNotFound(_0x59449f,_0x24cc8d){return function(_0xc2048d){if(!_0xc2048d){_0x59449f[_0xca7d('0x27')](0x194);}return _0xc2048d;};}function handleError(_0x162bf8,_0xb08cfd){_0xb08cfd=_0xb08cfd||0x1f4;return function(_0x254235){logger['error'](_0x254235[_0xca7d('0x28')]);if(_0x254235[_0xca7d('0x29')]){delete _0x254235['name'];}_0x162bf8[_0xca7d('0x1a')](_0xb08cfd)['send'](_0x254235);};}exports['index']=function(_0x13c1df,_0x5dfe5f){var _0x37c8a6={},_0x1c4e7d={},_0x53dc48={'count':0x0,'rows':[]};var _0x3071e5=_[_0xca7d('0x2a')](db[_0xca7d('0x2b')]['rawAttributes'],function(_0x86cfac){return{'name':_0x86cfac[_0xca7d('0x2c')],'type':_0x86cfac[_0xca7d('0x2d')]['key']};});_0x1c4e7d[_0xca7d('0x2e')]=_[_0xca7d('0x2a')](_0x3071e5,_0xca7d('0x29'));_0x1c4e7d[_0xca7d('0x2f')]=_[_0xca7d('0x30')](_0x13c1df[_0xca7d('0x2f')]);_0x1c4e7d[_0xca7d('0x31')]=_[_0xca7d('0x32')](_0x1c4e7d['model'],_0x1c4e7d['query']);_0x37c8a6[_0xca7d('0x33')]=_[_0xca7d('0x32')](_0x1c4e7d[_0xca7d('0x2e')],qs[_0xca7d('0x34')](_0x13c1df['query']['fields']));_0x37c8a6[_0xca7d('0x33')]=_0x37c8a6['attributes']['length']?_0x37c8a6['attributes']:_0x1c4e7d[_0xca7d('0x2e')];if(!_0x13c1df['query'][_0xca7d('0x35')](_0xca7d('0x36'))){_0x37c8a6[_0xca7d('0x1d')]=qs['limit'](_0x13c1df[_0xca7d('0x2f')][_0xca7d('0x1d')]);_0x37c8a6[_0xca7d('0x1c')]=qs['offset'](_0x13c1df[_0xca7d('0x2f')][_0xca7d('0x1c')]);}_0x37c8a6['order']=qs[_0xca7d('0x37')](_0x13c1df['query'][_0xca7d('0x37')]);_0x37c8a6['where']=qs['filters'](_[_0xca7d('0x38')](_0x13c1df[_0xca7d('0x2f')],_0x1c4e7d[_0xca7d('0x31')]),_0x3071e5);if(_0x13c1df['query'][_0xca7d('0x39')]){_0x37c8a6[_0xca7d('0x3a')]=_[_0xca7d('0x3b')](_0x37c8a6[_0xca7d('0x3a')],{'$or':_[_0xca7d('0x2a')](_0x3071e5,function(_0x1025bd){if(_0x1025bd[_0xca7d('0x2d')]!=='VIRTUAL'){var _0x5ee41d={};_0x5ee41d[_0x1025bd['name']]={'$like':'%'+_0x13c1df[_0xca7d('0x2f')]['filter']+'%'};return _0x5ee41d;}})});}_0x37c8a6=_[_0xca7d('0x3b')]({},_0x37c8a6,_0x13c1df['options']);var _0x33d7bf={'where':_0x37c8a6['where']};return db[_0xca7d('0x2b')]['count'](_0x33d7bf)[_0xca7d('0x22')](function(_0x164b57){_0x53dc48[_0xca7d('0x3c')]=_0x164b57;if(_0x13c1df[_0xca7d('0x2f')]['includeAll']){_0x37c8a6['include']=[{'all':!![]}];}return db[_0xca7d('0x2b')]['findAll'](_0x37c8a6);})[_0xca7d('0x22')](function(_0x3cb377){_0x53dc48[_0xca7d('0x3d')]=_0x3cb377;return _0x53dc48;})[_0xca7d('0x22')](respondWithFilteredResult(_0x5dfe5f,_0x37c8a6))[_0xca7d('0x3e')](handleError(_0x5dfe5f,null));};exports[_0xca7d('0x3f')]=function(_0x2f19a0,_0x4c9a38){var _0x31ec86={'raw':![],'where':{'id':_0x2f19a0[_0xca7d('0x40')]['id']}},_0x4b36dd={};_0x4b36dd['model']=_[_0xca7d('0x30')](db['AnalyticCustomReport'][_0xca7d('0x41')]);_0x4b36dd['query']=_['keys'](_0x2f19a0[_0xca7d('0x2f')]);_0x4b36dd['filters']=_[_0xca7d('0x32')](_0x4b36dd['model'],_0x4b36dd[_0xca7d('0x2f')]);_0x31ec86['attributes']=_['intersection'](_0x4b36dd[_0xca7d('0x2e')],qs[_0xca7d('0x34')](_0x2f19a0['query']['fields']));_0x31ec86[_0xca7d('0x33')]=_0x31ec86[_0xca7d('0x33')]['length']?_0x31ec86['attributes']:_0x4b36dd['model'];if(_0x2f19a0[_0xca7d('0x2f')][_0xca7d('0x42')]){_0x31ec86[_0xca7d('0x43')]=[{'all':!![]}];}_0x31ec86=_[_0xca7d('0x3b')]({},_0x31ec86,_0x2f19a0['options']);return db[_0xca7d('0x2b')][_0xca7d('0x44')](_0x31ec86)[_0xca7d('0x22')](handleEntityNotFound(_0x4c9a38,null))['then'](respondWithResult(_0x4c9a38,null))[_0xca7d('0x3e')](handleError(_0x4c9a38,null));};exports[_0xca7d('0x45')]=function(_0x3150ee,_0x163c09){return db[_0xca7d('0x2b')][_0xca7d('0x45')](_0x3150ee[_0xca7d('0x46')],{})[_0xca7d('0x22')](function(_0xc19132){var _0x263b1c=_0x3150ee[_0xca7d('0x47')]['get']({'plain':!![]});if(!_0x263b1c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x263b1c[_0xca7d('0x48')]===_0xca7d('0x47')){var _0x5f1b0a=_0xc19132[_0xca7d('0x24')]({'plain':!![]});var _0x3445fc='Reports';return db[_0xca7d('0x49')][_0xca7d('0x44')]({'where':{'name':_0x3445fc,'userProfileId':_0x263b1c['userProfileId']},'raw':!![]})[_0xca7d('0x22')](function(_0x5e640c){if(_0x5e640c&&_0x5e640c['autoAssociation']===0x0){return db[_0xca7d('0x26')][_0xca7d('0x45')]({'name':_0x5f1b0a['name'],'resourceId':_0x5f1b0a['id'],'type':_0xca7d('0x25'),'sectionId':_0x5e640c['id']},{})['then'](function(){return _0xc19132;});}else{return _0xc19132;}})['catch'](function(_0x1e8bdd){logger[_0xca7d('0x4a')](_0xca7d('0x4b'),_0x1e8bdd);throw _0x1e8bdd;});}return _0xc19132;})[_0xca7d('0x22')](respondWithResult(_0x163c09,0xc9))[_0xca7d('0x3e')](handleError(_0x163c09,null));};exports[_0xca7d('0x21')]=function(_0x3d32b5,_0x3fb1c7){if(_0x3d32b5[_0xca7d('0x46')]['id']){delete _0x3d32b5['body']['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x3d32b5['params']['id']}})[_0xca7d('0x22')](handleEntityNotFound(_0x3fb1c7,null))[_0xca7d('0x22')](saveUpdates(_0x3d32b5[_0xca7d('0x46')],null))[_0xca7d('0x22')](respondWithResult(_0x3fb1c7,null))['catch'](handleError(_0x3fb1c7,null));};exports[_0xca7d('0x23')]=function(_0x3d06b5,_0x264815){return db[_0xca7d('0x2b')][_0xca7d('0x44')]({'where':{'id':_0x3d06b5[_0xca7d('0x40')]['id']}})['then'](handleEntityNotFound(_0x264815,null))[_0xca7d('0x22')](removeEntity(_0x264815,null))['catch'](handleError(_0x264815,null));};exports['preview']=function(_0x2e7224,_0x2691c1){var _0x495683=0xa;var _0x5f244d=[_0xca7d('0x4c'),_0xca7d('0x4d'),'right_join',_0xca7d('0x4e')];var _0x2e23ca={'SUM':_0xca7d('0x4f'),'COUNT':_0xca7d('0x50'),'COUNT DISTINCT':_0xca7d('0x51'),'MAX':'MAX(%s)','MIN':_0xca7d('0x52'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xca7d('0x53'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52a671={'SEC_TO_TIME':_0xca7d('0x54'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xca7d('0x55')};var _0x56e4d5=function(_0x167c93){return!_['includes'](['IS\x20NULL',_0xca7d('0x56'),'IS\x20EMPTY',_0xca7d('0x57')],_0x167c93);};var _0x305a09=function(_0x569a11){if(!_0x569a11||!_0x569a11[_0xca7d('0x58')][_0xca7d('0x59')]){return'';}for(var _0x56e768='(',_0x33d240=0x0;_0x33d240<_0x569a11[_0xca7d('0x58')][_0xca7d('0x59')];_0x33d240+=0x1){_0x33d240>0x0&&(_0x56e768+='\x20'+_0x569a11[_0xca7d('0x5a')]+'\x20');_0x56e768+=_0x569a11[_0xca7d('0x58')][_0x33d240][_0xca7d('0x5b')]?_0x305a09(_0x569a11[_0xca7d('0x58')][_0x33d240][_0xca7d('0x5b')]):_0x569a11['rules'][_0x33d240][_0xca7d('0x5c')]+'\x20'+_0x569a11[_0xca7d('0x58')][_0x33d240][_0xca7d('0x5d')]+(_0x56e4d5(_0x569a11['rules'][_0x33d240][_0xca7d('0x5d')])?'\x20'+_0x569a11[_0xca7d('0x58')][_0x33d240]['value']:'');}return _0x56e768+')';};var _0x86392e={'where':{'id':_0x2e7224['params']['id']}},_0x46aa04,_0x55c938,_0x3d3ac4,_0x1ead8f,_0x313077;_0x86392e=_[_0xca7d('0x3b')]({},_0x86392e,_0x2e7224[_0xca7d('0x5e')]);return db[_0xca7d('0x2b')][_0xca7d('0x44')](_0x86392e)[_0xca7d('0x22')](function(_0xb11790){if(_0xb11790){_0x46aa04=_0xb11790;return _0xb11790[_0xca7d('0x5f')]();}return null;})[_0xca7d('0x22')](function(_0x594e6d){if(_0x594e6d){if(!_0x594e6d[_0xca7d('0x59')]){throw new db[(_0xca7d('0x60'))][(_0xca7d('0x61'))](_0xca7d('0x62'),0x193);}_0x55c938=_0x594e6d;return db[_0xca7d('0x63')][_0xca7d('0x64')]({'raw':!![]});}return null;})['then'](function(_0x4b7229){if(_0x4b7229){_0x3d3ac4=_[_0xca7d('0x65')](_0x4b7229,'id');var _0xa7aa9;var _0x42ab65=squel['select']();_0x42ab65[_0xca7d('0x66')](_0x46aa04['table']);for(var _0x4e7851=0x0;_0x4e7851<_0x55c938[_0xca7d('0x59')];_0x4e7851+=0x1){_0xa7aa9=_0x55c938[_0x4e7851][_0xca7d('0x67')]?_0x3d3ac4[_0x55c938[_0x4e7851]['MetricId']]['metric']:_0x55c938[_0x4e7851]['field'];_0xa7aa9=_0x55c938[_0x4e7851][_0xca7d('0x68')]?_[_0xca7d('0x69')](_0x2e23ca[_0x55c938[_0x4e7851][_0xca7d('0x68')]],'%s',_0xa7aa9):_0xa7aa9;_0xa7aa9=_0x55c938[_0x4e7851][_0xca7d('0x6a')]?_[_0xca7d('0x69')](_0x52a671[_0x55c938[_0x4e7851][_0xca7d('0x6a')]],'%s',_0xa7aa9):_0xa7aa9;if(_0x55c938[_0x4e7851][_0xca7d('0x6b')]){_0x42ab65['group'](_0xa7aa9);}_0x55c938[_0x4e7851]['orderBy']&&_0x42ab65['order'](_0xa7aa9,_0x55c938[_0x4e7851]['orderBy']==='DESC'?![]:!![]);_0x42ab65[_0xca7d('0x5c')](_0xa7aa9,_0x55c938[_0x4e7851][_0xca7d('0x6c')]||_0xa7aa9);}if(_0x46aa04['joins']){_0x46aa04['joins']=JSON[_0xca7d('0x6d')](_0x46aa04[_0xca7d('0x6e')]);for(var _0x4f656a=0x0;_0x4f656a<_0x46aa04[_0xca7d('0x6e')]['length'];_0x4f656a+=0x1){if(_0x46aa04[_0xca7d('0x6e')][_0x4f656a]['type']&&_[_0xca7d('0x6f')](_0x5f244d,_0x46aa04[_0xca7d('0x6e')][_0x4f656a][_0xca7d('0x2d')])&&_0x46aa04['joins'][_0x4f656a]['parentKey']&&_0x46aa04[_0xca7d('0x6e')][_0x4f656a][_0xca7d('0x70')]&&_0x46aa04[_0xca7d('0x6e')][_0x4f656a][_0xca7d('0x71')]){_0x42ab65[_0x46aa04['joins'][_0x4f656a][_0xca7d('0x2d')]](_0x46aa04['joins'][_0x4f656a]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x46aa04['table'],_0x46aa04['joins'][_0x4f656a][_0xca7d('0x72')],_0x46aa04['joins'][_0x4f656a][_0xca7d('0x70')],_0x46aa04[_0xca7d('0x6e')][_0x4f656a][_0xca7d('0x71')]));}}}if(_0x46aa04[_0xca7d('0x73')]){_0x46aa04[_0xca7d('0x73')]=JSON[_0xca7d('0x6d')](_0x46aa04[_0xca7d('0x73')]);_0x42ab65['where'](_0x305a09(_0x46aa04['conditions'][_0xca7d('0x5b')]));}_0x313077=_0x42ab65[_0xca7d('0x74')]();_0x42ab65[_0xca7d('0x1d')](_0x495683);_0x42ab65[_0xca7d('0x1c')](0x0);logger[_0xca7d('0x75')](_0xca7d('0x76'),_0x42ab65[_0xca7d('0x77')]());return db[_0xca7d('0x78')]['query'](_0x42ab65[_0xca7d('0x77')](),{'type':db[_0xca7d('0x78')][_0xca7d('0x79')][_0xca7d('0x7a')]});}})[_0xca7d('0x22')](respondWithResult(_0x2691c1,null))['catch'](handleError(_0x2691c1,null));};function runReport(_0x3fe1bd,_0x1b3cb5,_0x110b66){var _0x5d5af2=_0x1b3cb5[_0xca7d('0x29')];var _0x7a223=0xa;var _0x348a05=['join',_0xca7d('0x4d'),_0xca7d('0x7b'),_0xca7d('0x4e')];var _0x528c42={'SUM':_0xca7d('0x4f'),'COUNT':_0xca7d('0x50'),'COUNT DISTINCT':_0xca7d('0x51'),'MAX':_0xca7d('0x7c'),'MIN':_0xca7d('0x52'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xca7d('0x7d'),'GROUP_CONCAT ASC':_0xca7d('0x53'),'GROUP_CONCAT DESC':_0xca7d('0x7e')};var _0x1debb6={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xca7d('0x7f'),'HOUR':'HOUR(%s)','ROUND':_0xca7d('0x80'),'UNIX_TIMESTAMP':_0xca7d('0x55')};var _0x5a5dfa=function(_0x445a74){return!_[_0xca7d('0x6f')]([_0xca7d('0x81'),_0xca7d('0x56'),_0xca7d('0x82'),_0xca7d('0x57')],_0x445a74);};var _0x566a13=function(_0x1e00a4){if(!_0x1e00a4||!_0x1e00a4[_0xca7d('0x58')]['length']){return'';}for(var _0x33b6ab='(',_0x5106f0=0x0;_0x5106f0<_0x1e00a4['rules']['length'];_0x5106f0+=0x1){_0x5106f0>0x0&&(_0x33b6ab+='\x20'+_0x1e00a4['operator']+'\x20');_0x33b6ab+=_0x1e00a4[_0xca7d('0x58')][_0x5106f0][_0xca7d('0x5b')]?_0x566a13(_0x1e00a4['rules'][_0x5106f0]['group']):_0x1e00a4['rules'][_0x5106f0]['field']+'\x20'+_0x1e00a4[_0xca7d('0x58')][_0x5106f0][_0xca7d('0x5d')]+(_0x5a5dfa(_0x1e00a4[_0xca7d('0x58')][_0x5106f0][_0xca7d('0x5d')])?'\x20'+_0x1e00a4[_0xca7d('0x58')][_0x5106f0][_0xca7d('0x83')]:'');}return _0x33b6ab+')';};var _0x608759={'where':{'id':_0x3fe1bd['id']}},_0xbbf5ca,_0x3ac6c5,_0x254391,_0x5c80e4,_0x4f013c;_0x608759=_['merge']({},_0x608759,_0x110b66);return db['AnalyticCustomReport'][_0xca7d('0x44')](_0x608759)[_0xca7d('0x22')](function(_0xd3f7f1){if(_0xd3f7f1){_0xbbf5ca=_0xd3f7f1;return _0xd3f7f1[_0xca7d('0x5f')]();}return null;})[_0xca7d('0x22')](function(_0x316901){if(_0x316901){if(!_0x316901[_0xca7d('0x59')]){throw new db['Sequelize'][(_0xca7d('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3ac6c5=_0x316901;return db[_0xca7d('0x63')][_0xca7d('0x64')]({'raw':!![]});}return null;})[_0xca7d('0x22')](function(_0x1f6cd0){if(_0x1f6cd0){_0x254391=_[_0xca7d('0x65')](_0x1f6cd0,'id');var _0x270393;var _0xf45e6f=squel[_0xca7d('0x84')]();_0xf45e6f[_0xca7d('0x66')](_0xbbf5ca['table']);for(var _0xaef01f=0x0;_0xaef01f<_0x3ac6c5[_0xca7d('0x59')];_0xaef01f+=0x1){_0x270393=_0x3ac6c5[_0xaef01f][_0xca7d('0x67')]?_0x254391[_0x3ac6c5[_0xaef01f]['MetricId']][_0xca7d('0x85')]:_0x3ac6c5[_0xaef01f][_0xca7d('0x5c')];_0x270393=_0x3ac6c5[_0xaef01f]['function']?_[_0xca7d('0x69')](_0x528c42[_0x3ac6c5[_0xaef01f][_0xca7d('0x68')]],'%s',_0x270393):_0x270393;_0x270393=_0x3ac6c5[_0xaef01f][_0xca7d('0x6a')]?_['replace'](_0x1debb6[_0x3ac6c5[_0xaef01f]['format']],'%s',_0x270393):_0x270393;if(_0x3ac6c5[_0xaef01f][_0xca7d('0x6b')]){_0xf45e6f[_0xca7d('0x5b')](_0x270393);}_0x3ac6c5[_0xaef01f]['orderBy']&&_0xf45e6f[_0xca7d('0x86')](_0x270393,_0x3ac6c5[_0xaef01f][_0xca7d('0x87')]===_0xca7d('0x88')?![]:!![]);_0xf45e6f[_0xca7d('0x5c')](_0x270393,_0x3ac6c5[_0xaef01f][_0xca7d('0x6c')]||_0x270393);}if(_0xbbf5ca[_0xca7d('0x6e')]){_0xbbf5ca[_0xca7d('0x6e')]=JSON[_0xca7d('0x6d')](_0xbbf5ca[_0xca7d('0x6e')]);for(var _0x47c4e8=0x0;_0x47c4e8<_0xbbf5ca[_0xca7d('0x6e')][_0xca7d('0x59')];_0x47c4e8+=0x1){if(_0xbbf5ca[_0xca7d('0x6e')][_0x47c4e8][_0xca7d('0x2d')]&&_[_0xca7d('0x6f')](_0x348a05,_0xbbf5ca[_0xca7d('0x6e')][_0x47c4e8][_0xca7d('0x2d')])&&_0xbbf5ca['joins'][_0x47c4e8][_0xca7d('0x72')]&&_0xbbf5ca[_0xca7d('0x6e')][_0x47c4e8]['foreignTable']&&_0xbbf5ca[_0xca7d('0x6e')][_0x47c4e8]['foreignKey']){_0xf45e6f[_0xbbf5ca['joins'][_0x47c4e8][_0xca7d('0x2d')]](_0xbbf5ca['joins'][_0x47c4e8][_0xca7d('0x70')],null,util[_0xca7d('0x6a')]('%s.%s\x20=\x20%s.%s',_0xbbf5ca[_0xca7d('0x89')],_0xbbf5ca[_0xca7d('0x6e')][_0x47c4e8][_0xca7d('0x72')],_0xbbf5ca[_0xca7d('0x6e')][_0x47c4e8][_0xca7d('0x70')],_0xbbf5ca['joins'][_0x47c4e8]['foreignKey']));}}}if(_0xbbf5ca['conditions']){_0xbbf5ca[_0xca7d('0x73')]=JSON['parse'](_0xbbf5ca[_0xca7d('0x73')]);_0xf45e6f[_0xca7d('0x3a')](_0x566a13(_0xbbf5ca[_0xca7d('0x73')]['group']));}_0x4f013c=_0xf45e6f[_0xca7d('0x74')]();_0xf45e6f[_0xca7d('0x1d')](_0x7a223);_0xf45e6f[_0xca7d('0x1c')](0x0);logger[_0xca7d('0x75')]('Limited\x20Query:',_0xf45e6f['toString']());return db[_0xca7d('0x78')][_0xca7d('0x2f')](_0xf45e6f[_0xca7d('0x77')](),{'type':db[_0xca7d('0x78')]['QueryTypes'][_0xca7d('0x7a')]});}})[_0xca7d('0x22')](function(_0x3f6a20){if(!_0x3f6a20[_0xca7d('0x59')]){throw new db[(_0xca7d('0x60'))]['ValidationErrorItem'](_0xca7d('0x8a'),0xcc);}if(_0x1b3cb5['output']==='web'){return null;}var _0x5f5518=_[_0xca7d('0x3b')](_0x1b3cb5,{'name':_0x1b3cb5[_0xca7d('0x8b')]||_0x1b3cb5[_0xca7d('0x29')]||_0xbbf5ca[_0xca7d('0x29')],'basename':_0x5d5af2,'savename':util[_0xca7d('0x6a')]('%s-%s.%s',_0x1b3cb5[_0xca7d('0x29')]||_0xbbf5ca['name'],require(_0xca7d('0x8c'))[_0xca7d('0x8d')](0x4),_0x1b3cb5[_0xca7d('0x8e')]||'csv'),'reportId':_0xbbf5ca['id'],'reportType':_0xca7d('0x8f')});return db[_0xca7d('0x90')]['create'](_0x5f5518,{'raw':!![]});})[_0xca7d('0x22')](function(_0x554472){if(_0xbbf5ca[_0xca7d('0x89')]===_0xca7d('0x91')){_0x4f013c['where'](_0xbbf5ca[_0xca7d('0x89')]+_0xca7d('0x92'),_0x1b3cb5[_0xca7d('0x93')],_0x1b3cb5[_0xca7d('0x94')]);}else{_0x4f013c[_0xca7d('0x3a')](_0xbbf5ca[_0xca7d('0x89')]+_0xca7d('0x95'),_0x1b3cb5[_0xca7d('0x93')],_0x1b3cb5[_0xca7d('0x94')]);}if(_0x554472){logger['info'](_0xca7d('0x96'),_0x4f013c[_0xca7d('0x77')]());require(_0xca7d('0x97'))[_0xca7d('0x98')](path[_0xca7d('0x4c')](__dirname,_0xca7d('0x99'),_0x554472[_0xca7d('0x8e')]),[_0x554472['id'],_0x4f013c['toString'](),path[_0xca7d('0x4c')](__dirname,_0xca7d('0x9a'),_0x554472['savename']),_0x5d5af2]);return _0x554472;}else{var _0x549b56=squel['select']();_0x549b56['from']('('+_0x4f013c[_0xca7d('0x77')]()+')',_0xca7d('0x9b'));_0x549b56[_0xca7d('0x5c')]('COUNT(*)',_0xca7d('0x3c'));_0x4f013c[_0xca7d('0x1d')](_0x1b3cb5[_0xca7d('0x1d')]||_0x7a223);_0x4f013c[_0xca7d('0x1c')](_0x1b3cb5['offset']||0x0);return dbH[_0xca7d('0x78')][_0xca7d('0x2f')](_0x549b56[_0xca7d('0x77')](),{'type':dbH['sequelize'][_0xca7d('0x79')][_0xca7d('0x7a')]})[_0xca7d('0x22')](function(_0x18bca6){if(!_0x18bca6[_0xca7d('0x59')]){_0x5c80e4=0x0;}else{_0x5c80e4=_0x18bca6[0x0][_0xca7d('0x3c')]||0x0;}return dbH[_0xca7d('0x78')][_0xca7d('0x2f')](_0x4f013c[_0xca7d('0x77')](),{'type':dbH[_0xca7d('0x78')][_0xca7d('0x79')][_0xca7d('0x7a')]});})[_0xca7d('0x22')](function(_0x73bda){return{'rows':_0x73bda||[],'count':_0x5c80e4};});}});}exports[_0xca7d('0x9c')]=function(_0x85bbe7,_0x259740){return runReport(_0x85bbe7[_0xca7d('0x40')],_0x85bbe7['query'],_0x85bbe7[_0xca7d('0x5e')])[_0xca7d('0x22')](respondWithResult(_0x259740,null))[_0xca7d('0x3e')](handleError(_0x259740,null));};exports[_0xca7d('0x9d')]=runReport;exports[_0xca7d('0x2f')]=function(_0x3fb016,_0x23281f){var _0x400a88=0xa;var _0xbf4ea7=[_0xca7d('0x4c'),_0xca7d('0x4d'),'right_join','cross_join'];var _0x25dd65={'SUM':_0xca7d('0x4f'),'COUNT':_0xca7d('0x50'),'COUNT DISTINCT':_0xca7d('0x51'),'MAX':'MAX(%s)','MIN':_0xca7d('0x52'),'AVG':_0xca7d('0x9e'),'GROUP_CONCAT':_0xca7d('0x7d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3ed75a={'SEC_TO_TIME':_0xca7d('0x54'),'DATE':_0xca7d('0x7f'),'HOUR':_0xca7d('0x9f'),'ROUND':_0xca7d('0x80'),'UNIX_TIMESTAMP':_0xca7d('0x55')};var _0x3d418b=function(_0x342e2d){return!_['includes'](['IS\x20NULL',_0xca7d('0x56'),'IS\x20EMPTY',_0xca7d('0x57')],_0x342e2d);};var _0x378523=function(_0x1da843){if(!_0x1da843||!_0x1da843[_0xca7d('0x58')]['length']){return'';}for(var _0x157c56='(',_0x2c2c2d=0x0;_0x2c2c2d<_0x1da843[_0xca7d('0x58')][_0xca7d('0x59')];_0x2c2c2d+=0x1){_0x2c2c2d>0x0&&(_0x157c56+='\x20'+_0x1da843[_0xca7d('0x5a')]+'\x20');_0x157c56+=_0x1da843[_0xca7d('0x58')][_0x2c2c2d][_0xca7d('0x5b')]?_0x378523(_0x1da843[_0xca7d('0x58')][_0x2c2c2d]['group']):_0x1da843['rules'][_0x2c2c2d][_0xca7d('0x5c')]+'\x20'+_0x1da843[_0xca7d('0x58')][_0x2c2c2d]['condition']+(_0x3d418b(_0x1da843[_0xca7d('0x58')][_0x2c2c2d]['condition'])?'\x20'+_0x1da843[_0xca7d('0x58')][_0x2c2c2d][_0xca7d('0x83')]:'');}return _0x157c56+')';};var _0x398ed7={'where':{'id':_0x3fb016['params']['id']}},_0x408c9f,_0x5de5fe,_0x3bf5a8,_0x60ae8c,_0x54302d;_0x398ed7=_[_0xca7d('0x3b')]({},_0x398ed7,_0x3fb016[_0xca7d('0x5e')]);return db[_0xca7d('0x2b')][_0xca7d('0x44')](_0x398ed7)[_0xca7d('0x22')](function(_0x3cf3c1){if(_0x3cf3c1){_0x408c9f=_0x3cf3c1;return _0x3cf3c1[_0xca7d('0x5f')]();}return null;})[_0xca7d('0x22')](function(_0x3f077d){if(_0x3f077d){if(!_0x3f077d[_0xca7d('0x59')]){throw new db[(_0xca7d('0x60'))][(_0xca7d('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5de5fe=_0x3f077d;return db[_0xca7d('0x63')][_0xca7d('0x64')]({'raw':!![]});}return null;})[_0xca7d('0x22')](function(_0x2086f9){if(_0x2086f9){_0x3bf5a8=_[_0xca7d('0x65')](_0x2086f9,'id');var _0x2ddf22;var _0x380f3e=squel['select']();_0x380f3e['from'](_0x408c9f[_0xca7d('0x89')]);for(var _0x2ed532=0x0;_0x2ed532<_0x5de5fe[_0xca7d('0x59')];_0x2ed532+=0x1){_0x2ddf22=_0x5de5fe[_0x2ed532][_0xca7d('0x67')]?_0x3bf5a8[_0x5de5fe[_0x2ed532][_0xca7d('0x67')]]['metric']:_0x5de5fe[_0x2ed532]['field'];_0x2ddf22=_0x5de5fe[_0x2ed532]['function']?_['replace'](_0x25dd65[_0x5de5fe[_0x2ed532][_0xca7d('0x68')]],'%s',_0x2ddf22):_0x2ddf22;_0x2ddf22=_0x5de5fe[_0x2ed532][_0xca7d('0x6a')]?_[_0xca7d('0x69')](_0x3ed75a[_0x5de5fe[_0x2ed532][_0xca7d('0x6a')]],'%s',_0x2ddf22):_0x2ddf22;if(_0x5de5fe[_0x2ed532]['groupBy']){_0x380f3e[_0xca7d('0x5b')](_0x2ddf22);}_0x5de5fe[_0x2ed532][_0xca7d('0x87')]&&_0x380f3e['order'](_0x2ddf22,_0x5de5fe[_0x2ed532][_0xca7d('0x87')]==='DESC'?![]:!![]);_0x380f3e[_0xca7d('0x5c')](_0x2ddf22,_0x5de5fe[_0x2ed532][_0xca7d('0x6c')]||_0x2ddf22);}if(_0x408c9f['joins']){_0x408c9f[_0xca7d('0x6e')]=JSON[_0xca7d('0x6d')](_0x408c9f['joins']);for(var _0x16507d=0x0;_0x16507d<_0x408c9f[_0xca7d('0x6e')]['length'];_0x16507d+=0x1){if(_0x408c9f[_0xca7d('0x6e')][_0x16507d][_0xca7d('0x2d')]&&_[_0xca7d('0x6f')](_0xbf4ea7,_0x408c9f[_0xca7d('0x6e')][_0x16507d]['type'])&&_0x408c9f[_0xca7d('0x6e')][_0x16507d][_0xca7d('0x72')]&&_0x408c9f[_0xca7d('0x6e')][_0x16507d]['foreignTable']&&_0x408c9f[_0xca7d('0x6e')][_0x16507d][_0xca7d('0x71')]){_0x380f3e[_0x408c9f[_0xca7d('0x6e')][_0x16507d]['type']](_0x408c9f[_0xca7d('0x6e')][_0x16507d][_0xca7d('0x70')],null,util[_0xca7d('0x6a')](_0xca7d('0xa0'),_0x408c9f[_0xca7d('0x89')],_0x408c9f[_0xca7d('0x6e')][_0x16507d]['parentKey'],_0x408c9f[_0xca7d('0x6e')][_0x16507d][_0xca7d('0x70')],_0x408c9f[_0xca7d('0x6e')][_0x16507d]['foreignKey']));}}}if(_0x408c9f['conditions']){_0x408c9f[_0xca7d('0x73')]=JSON[_0xca7d('0x6d')](_0x408c9f['conditions']);_0x380f3e[_0xca7d('0x3a')](_0x378523(_0x408c9f[_0xca7d('0x73')][_0xca7d('0x5b')]));}_0x54302d=_0x380f3e['clone']();_0x380f3e[_0xca7d('0x1d')](_0x400a88);_0x380f3e[_0xca7d('0x1c')](0x0);logger[_0xca7d('0x75')]('Limited\x20Query:',_0x380f3e[_0xca7d('0x77')]());return db[_0xca7d('0x78')][_0xca7d('0x2f')](_0x380f3e[_0xca7d('0x77')](),{'type':db['sequelize'][_0xca7d('0x79')][_0xca7d('0x7a')]});}})[_0xca7d('0x22')](function(){return{'sql':_0x54302d[_0xca7d('0x77')]()};})[_0xca7d('0x22')](respondWithResult(_0x23281f,null))[_0xca7d('0x3e')](handleError(_0x23281f,null));};
\ No newline at end of file
+var _0x45ea=['child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','AVG(%s)','IS\x20NULL','%s.%s\x20=\x20%s.%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','CustomReports','then','end','error','name','send','map','AnalyticCustomReport','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','intersection','create','body','user','role','get','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','parse','joins','parentKey','foreignTable','table','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','ValidationErrorItem','debug','SELECT','output','web','randomstring','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x45ea,0x1f0));var _0xa45e=function(_0x2a7272,_0x10b6b8){_0x2a7272=_0x2a7272-0x0;var _0x261f78=_0x45ea[_0x2a7272];return _0x261f78;};'use strict';var pdf=require(_0xa45e('0x0'));var emlformat=require(_0xa45e('0x1'));var rimraf=require(_0xa45e('0x2'));var zipdir=require(_0xa45e('0x3'));var jsonpatch=require(_0xa45e('0x4'));var rp=require(_0xa45e('0x5'));var moment=require(_0xa45e('0x6'));var BPromise=require(_0xa45e('0x7'));var Mustache=require(_0xa45e('0x8'));var util=require(_0xa45e('0x9'));var path=require(_0xa45e('0xa'));var sox=require('sox');var csv=require(_0xa45e('0xb'));var ejs=require(_0xa45e('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa45e('0xd'));var deskjs=require(_0xa45e('0xe'));var toCsv=require(_0xa45e('0xb'));var querystring=require(_0xa45e('0xf'));var Papa=require(_0xa45e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa45e('0x11'));var as=require(_0xa45e('0x12'));var hardwareService=require(_0xa45e('0x13'));var logger=require(_0xa45e('0x14'))('api');var utils=require(_0xa45e('0x15'));var config=require('../../config/environment');var db=require(_0xa45e('0x16'))['db'];var dbH=require(_0xa45e('0x16'))['dbH'];function respondWithStatusCode(_0x4a1b17,_0x1f19f0){_0x1f19f0=_0x1f19f0||0xcc;return function(_0x5bfe00){if(_0x5bfe00){return _0x4a1b17[_0xa45e('0x17')](_0x1f19f0);}return _0x4a1b17['status'](_0x1f19f0)['end']();};}function respondWithResult(_0x4f36f8,_0x1d90ab){_0x1d90ab=_0x1d90ab||0xc8;return function(_0x4a428f){if(_0x4a428f){return _0x4f36f8[_0xa45e('0x18')](_0x1d90ab)[_0xa45e('0x19')](_0x4a428f);}};}function respondWithFilteredResult(_0x3cfc97,_0x330557){return function(_0x1201cd){if(_0x1201cd){var _0x5323d0=_0x1201cd[_0xa45e('0x1a')],_0x1fb00a=_0x330557[_0xa45e('0x1b')],_0x1eeb1d=_0x330557['offset']+_0x330557[_0xa45e('0x1c')],_0x29ec62;if(_0x1eeb1d>=_0x5323d0){_0x1eeb1d=_0x5323d0;_0x29ec62=0xc8;}else{_0x29ec62=0xce;}_0x3cfc97[_0xa45e('0x18')](_0x29ec62);return _0x3cfc97[_0xa45e('0x1d')](_0xa45e('0x1e'),_0x1fb00a+'-'+_0x1eeb1d+'/'+_0x5323d0)[_0xa45e('0x19')](_0x1201cd);}return null;};}function patchUpdates(_0x3901c9){return function(_0x1654db){try{jsonpatch[_0xa45e('0x1f')](_0x1654db,_0x3901c9,!![]);}catch(_0x49dae2){return BPromise[_0xa45e('0x20')](_0x49dae2);}return _0x1654db[_0xa45e('0x21')]();};}function saveUpdates(_0xc061d9,_0x54388e){return function(_0x50f7c4){if(_0x50f7c4){return _0x50f7c4[_0xa45e('0x22')](_0xc061d9)['then'](function(_0x11fa08){return _0x11fa08;});}return null;};}function removeEntity(_0x37907c,_0x26c7b1){return function(_0x3525c5){if(_0x3525c5){return _0x3525c5[_0xa45e('0x23')]()['then'](function(){var _0x107d9c=_0x3525c5['get']({'plain':!![]});var _0x2e4fed=_0xa45e('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x2e4fed,'resourceId':_0x107d9c['id']}})[_0xa45e('0x25')](function(){return _0x3525c5;});})['then'](function(){_0x37907c[_0xa45e('0x18')](0xcc)[_0xa45e('0x26')]();});}};}function handleEntityNotFound(_0x15bbc4,_0x5873bc){return function(_0x47cbe0){if(!_0x47cbe0){_0x15bbc4[_0xa45e('0x17')](0x194);}return _0x47cbe0;};}function handleError(_0x46bbb3,_0x228ec8){_0x228ec8=_0x228ec8||0x1f4;return function(_0x22cd4d){logger[_0xa45e('0x27')](_0x22cd4d['stack']);if(_0x22cd4d[_0xa45e('0x28')]){delete _0x22cd4d[_0xa45e('0x28')];}_0x46bbb3['status'](_0x228ec8)[_0xa45e('0x29')](_0x22cd4d);};}exports['index']=function(_0x552cb5,_0x1d4527){var _0xacc140={},_0x57a892={},_0x4ea618={'count':0x0,'rows':[]};var _0x203687=_[_0xa45e('0x2a')](db[_0xa45e('0x2b')]['rawAttributes'],function(_0x118a82){return{'name':_0x118a82[_0xa45e('0x2c')],'type':_0x118a82[_0xa45e('0x2d')][_0xa45e('0x2e')]};});_0x57a892['model']=_[_0xa45e('0x2a')](_0x203687,_0xa45e('0x28'));_0x57a892['query']=_['keys'](_0x552cb5[_0xa45e('0x2f')]);_0x57a892[_0xa45e('0x30')]=_['intersection'](_0x57a892[_0xa45e('0x31')],_0x57a892[_0xa45e('0x2f')]);_0xacc140[_0xa45e('0x32')]=_['intersection'](_0x57a892[_0xa45e('0x31')],qs[_0xa45e('0x33')](_0x552cb5[_0xa45e('0x2f')]['fields']));_0xacc140[_0xa45e('0x32')]=_0xacc140[_0xa45e('0x32')][_0xa45e('0x34')]?_0xacc140[_0xa45e('0x32')]:_0x57a892[_0xa45e('0x31')];if(!_0x552cb5[_0xa45e('0x2f')][_0xa45e('0x35')](_0xa45e('0x36'))){_0xacc140[_0xa45e('0x1c')]=qs[_0xa45e('0x1c')](_0x552cb5[_0xa45e('0x2f')][_0xa45e('0x1c')]);_0xacc140[_0xa45e('0x1b')]=qs['offset'](_0x552cb5['query'][_0xa45e('0x1b')]);}_0xacc140[_0xa45e('0x37')]=qs[_0xa45e('0x38')](_0x552cb5[_0xa45e('0x2f')][_0xa45e('0x38')]);_0xacc140[_0xa45e('0x39')]=qs['filters'](_[_0xa45e('0x3a')](_0x552cb5[_0xa45e('0x2f')],_0x57a892['filters']),_0x203687);if(_0x552cb5[_0xa45e('0x2f')]['filter']){_0xacc140[_0xa45e('0x39')]=_['merge'](_0xacc140[_0xa45e('0x39')],{'$or':_[_0xa45e('0x2a')](_0x203687,function(_0x27e7bb){if(_0x27e7bb[_0xa45e('0x2d')]!==_0xa45e('0x3b')){var _0x10810e={};_0x10810e[_0x27e7bb[_0xa45e('0x28')]]={'$like':'%'+_0x552cb5[_0xa45e('0x2f')][_0xa45e('0x3c')]+'%'};return _0x10810e;}})});}_0xacc140=_[_0xa45e('0x3d')]({},_0xacc140,_0x552cb5[_0xa45e('0x3e')]);var _0x32753b={'where':_0xacc140[_0xa45e('0x39')]};return db[_0xa45e('0x2b')][_0xa45e('0x1a')](_0x32753b)[_0xa45e('0x25')](function(_0x217bbb){_0x4ea618[_0xa45e('0x1a')]=_0x217bbb;if(_0x552cb5[_0xa45e('0x2f')][_0xa45e('0x3f')]){_0xacc140[_0xa45e('0x40')]=[{'all':!![]}];}return db[_0xa45e('0x2b')][_0xa45e('0x41')](_0xacc140);})[_0xa45e('0x25')](function(_0x4b2c3b){_0x4ea618[_0xa45e('0x42')]=_0x4b2c3b;return _0x4ea618;})[_0xa45e('0x25')](respondWithFilteredResult(_0x1d4527,_0xacc140))[_0xa45e('0x43')](handleError(_0x1d4527,null));};exports['show']=function(_0x2aa63a,_0x59dec5){var _0x24fd6b={'raw':![],'where':{'id':_0x2aa63a[_0xa45e('0x44')]['id']}},_0x5d139f={};_0x5d139f[_0xa45e('0x31')]=_[_0xa45e('0x45')](db['AnalyticCustomReport']['rawAttributes']);_0x5d139f[_0xa45e('0x2f')]=_[_0xa45e('0x45')](_0x2aa63a[_0xa45e('0x2f')]);_0x5d139f[_0xa45e('0x30')]=_[_0xa45e('0x46')](_0x5d139f['model'],_0x5d139f[_0xa45e('0x2f')]);_0x24fd6b[_0xa45e('0x32')]=_[_0xa45e('0x46')](_0x5d139f[_0xa45e('0x31')],qs[_0xa45e('0x33')](_0x2aa63a[_0xa45e('0x2f')][_0xa45e('0x33')]));_0x24fd6b['attributes']=_0x24fd6b[_0xa45e('0x32')][_0xa45e('0x34')]?_0x24fd6b[_0xa45e('0x32')]:_0x5d139f[_0xa45e('0x31')];if(_0x2aa63a[_0xa45e('0x2f')]['includeAll']){_0x24fd6b[_0xa45e('0x40')]=[{'all':!![]}];}_0x24fd6b=_['merge']({},_0x24fd6b,_0x2aa63a[_0xa45e('0x3e')]);return db[_0xa45e('0x2b')]['find'](_0x24fd6b)[_0xa45e('0x25')](handleEntityNotFound(_0x59dec5,null))['then'](respondWithResult(_0x59dec5,null))['catch'](handleError(_0x59dec5,null));};exports[_0xa45e('0x47')]=function(_0x37088b,_0x42b714){return db[_0xa45e('0x2b')][_0xa45e('0x47')](_0x37088b[_0xa45e('0x48')],{})[_0xa45e('0x25')](function(_0x4ffd22){var _0x395065=_0x37088b[_0xa45e('0x49')]['get']({'plain':!![]});if(!_0x395065)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x395065[_0xa45e('0x4a')]===_0xa45e('0x49')){var _0x260ede=_0x4ffd22[_0xa45e('0x4b')]({'plain':!![]});var _0x3dff9e=_0xa45e('0x4c');return db[_0xa45e('0x4d')][_0xa45e('0x4e')]({'where':{'name':_0x3dff9e,'userProfileId':_0x395065[_0xa45e('0x4f')]},'raw':!![]})[_0xa45e('0x25')](function(_0x4dced4){if(_0x4dced4&&_0x4dced4[_0xa45e('0x50')]===0x0){return db[_0xa45e('0x51')]['create']({'name':_0x260ede[_0xa45e('0x28')],'resourceId':_0x260ede['id'],'type':_0xa45e('0x24'),'sectionId':_0x4dced4['id']},{})['then'](function(){return _0x4ffd22;});}else{return _0x4ffd22;}})[_0xa45e('0x43')](function(_0x5b61ad){logger[_0xa45e('0x27')](_0xa45e('0x52'),_0x5b61ad);throw _0x5b61ad;});}return _0x4ffd22;})[_0xa45e('0x25')](respondWithResult(_0x42b714,0xc9))[_0xa45e('0x43')](handleError(_0x42b714,null));};exports[_0xa45e('0x22')]=function(_0x45271d,_0x455cd8){if(_0x45271d[_0xa45e('0x48')]['id']){delete _0x45271d['body']['id'];}return db[_0xa45e('0x2b')][_0xa45e('0x4e')]({'where':{'id':_0x45271d[_0xa45e('0x44')]['id']}})[_0xa45e('0x25')](handleEntityNotFound(_0x455cd8,null))[_0xa45e('0x25')](saveUpdates(_0x45271d[_0xa45e('0x48')],null))[_0xa45e('0x25')](respondWithResult(_0x455cd8,null))['catch'](handleError(_0x455cd8,null));};exports['destroy']=function(_0x1aeb58,_0x294e05){return db[_0xa45e('0x2b')][_0xa45e('0x4e')]({'where':{'id':_0x1aeb58[_0xa45e('0x44')]['id']}})[_0xa45e('0x25')](handleEntityNotFound(_0x294e05,null))[_0xa45e('0x25')](removeEntity(_0x294e05,null))[_0xa45e('0x43')](handleError(_0x294e05,null));};exports['preview']=function(_0x506ebc,_0x179e46){var _0x38b44f=0xa;var _0x4b105c=[_0xa45e('0x53'),_0xa45e('0x54'),'right_join',_0xa45e('0x55')];var _0x31b0d5={'SUM':_0xa45e('0x56'),'COUNT':_0xa45e('0x57'),'COUNT DISTINCT':_0xa45e('0x58'),'MAX':_0xa45e('0x59'),'MIN':_0xa45e('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa45e('0x5b'),'GROUP_CONCAT ASC':_0xa45e('0x5c'),'GROUP_CONCAT DESC':_0xa45e('0x5d')};var _0xb3270d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa45e('0x5e'),'HOUR':_0xa45e('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa45e('0x60')};var _0x1b261d=function(_0x25a35d){return!_[_0xa45e('0x61')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xa45e('0x62')],_0x25a35d);};var _0x30b724=function(_0x2b1350){if(!_0x2b1350||!_0x2b1350[_0xa45e('0x63')][_0xa45e('0x34')]){return'';}for(var _0x102cbd='(',_0xdb6c90=0x0;_0xdb6c90<_0x2b1350['rules'][_0xa45e('0x34')];_0xdb6c90+=0x1){_0xdb6c90>0x0&&(_0x102cbd+='\x20'+_0x2b1350[_0xa45e('0x64')]+'\x20');_0x102cbd+=_0x2b1350[_0xa45e('0x63')][_0xdb6c90][_0xa45e('0x65')]?_0x30b724(_0x2b1350['rules'][_0xdb6c90][_0xa45e('0x65')]):_0x2b1350[_0xa45e('0x63')][_0xdb6c90][_0xa45e('0x66')]+'\x20'+_0x2b1350[_0xa45e('0x63')][_0xdb6c90][_0xa45e('0x67')]+(_0x1b261d(_0x2b1350['rules'][_0xdb6c90][_0xa45e('0x67')])?'\x20'+_0x2b1350[_0xa45e('0x63')][_0xdb6c90][_0xa45e('0x68')]:'');}return _0x102cbd+')';};var _0x4df668={'where':{'id':_0x506ebc[_0xa45e('0x44')]['id']}},_0x30ec86,_0x27a739,_0x215135,_0x3221e7,_0x59443a;_0x4df668=_[_0xa45e('0x3d')]({},_0x4df668,_0x506ebc[_0xa45e('0x3e')]);return db[_0xa45e('0x2b')][_0xa45e('0x4e')](_0x4df668)[_0xa45e('0x25')](function(_0x3e5d18){if(_0x3e5d18){_0x30ec86=_0x3e5d18;return _0x3e5d18[_0xa45e('0x69')]();}return null;})[_0xa45e('0x25')](function(_0x350a34){if(_0x350a34){if(!_0x350a34['length']){throw new db[(_0xa45e('0x6a'))]['ValidationErrorItem'](_0xa45e('0x6b'),0x193);}_0x27a739=_0x350a34;return db[_0xa45e('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xa45e('0x25')](function(_0x23911b){if(_0x23911b){_0x215135=_[_0xa45e('0x6d')](_0x23911b,'id');var _0x5ad0bd;var _0xe9c00a=squel[_0xa45e('0x6e')]();_0xe9c00a[_0xa45e('0x6f')](_0x30ec86['table']);for(var _0x287871=0x0;_0x287871<_0x27a739[_0xa45e('0x34')];_0x287871+=0x1){_0x5ad0bd=_0x27a739[_0x287871]['MetricId']?_0x215135[_0x27a739[_0x287871][_0xa45e('0x70')]][_0xa45e('0x71')]:_0x27a739[_0x287871][_0xa45e('0x66')];_0x5ad0bd=_0x27a739[_0x287871][_0xa45e('0x72')]?_[_0xa45e('0x73')](_0x31b0d5[_0x27a739[_0x287871][_0xa45e('0x72')]],'%s',_0x5ad0bd):_0x5ad0bd;_0x5ad0bd=_0x27a739[_0x287871]['format']?_[_0xa45e('0x73')](_0xb3270d[_0x27a739[_0x287871][_0xa45e('0x74')]],'%s',_0x5ad0bd):_0x5ad0bd;if(_0x27a739[_0x287871][_0xa45e('0x75')]){_0xe9c00a[_0xa45e('0x65')](_0x5ad0bd);}_0x27a739[_0x287871][_0xa45e('0x76')]&&_0xe9c00a['order'](_0x5ad0bd,_0x27a739[_0x287871][_0xa45e('0x76')]===_0xa45e('0x77')?![]:!![]);_0xe9c00a[_0xa45e('0x66')](_0x5ad0bd,_0x27a739[_0x287871][_0xa45e('0x78')]||_0x5ad0bd);}if(_0x30ec86['joins']){_0x30ec86['joins']=JSON[_0xa45e('0x79')](_0x30ec86[_0xa45e('0x7a')]);for(var _0x2fe28c=0x0;_0x2fe28c<_0x30ec86[_0xa45e('0x7a')]['length'];_0x2fe28c+=0x1){if(_0x30ec86[_0xa45e('0x7a')][_0x2fe28c]['type']&&_['includes'](_0x4b105c,_0x30ec86['joins'][_0x2fe28c][_0xa45e('0x2d')])&&_0x30ec86['joins'][_0x2fe28c][_0xa45e('0x7b')]&&_0x30ec86['joins'][_0x2fe28c][_0xa45e('0x7c')]&&_0x30ec86[_0xa45e('0x7a')][_0x2fe28c]['foreignKey']){_0xe9c00a[_0x30ec86[_0xa45e('0x7a')][_0x2fe28c]['type']](_0x30ec86[_0xa45e('0x7a')][_0x2fe28c][_0xa45e('0x7c')],null,util[_0xa45e('0x74')]('%s.%s\x20=\x20%s.%s',_0x30ec86[_0xa45e('0x7d')],_0x30ec86[_0xa45e('0x7a')][_0x2fe28c][_0xa45e('0x7b')],_0x30ec86['joins'][_0x2fe28c][_0xa45e('0x7c')],_0x30ec86['joins'][_0x2fe28c][_0xa45e('0x7e')]));}}}if(_0x30ec86[_0xa45e('0x7f')]){_0x30ec86[_0xa45e('0x7f')]=JSON[_0xa45e('0x79')](_0x30ec86[_0xa45e('0x7f')]);_0xe9c00a[_0xa45e('0x39')](_0x30b724(_0x30ec86[_0xa45e('0x7f')][_0xa45e('0x65')]));}_0x59443a=_0xe9c00a[_0xa45e('0x80')]();_0xe9c00a[_0xa45e('0x1c')](_0x38b44f);_0xe9c00a['offset'](0x0);logger['debug'](_0xa45e('0x81'),_0xe9c00a[_0xa45e('0x82')]());return db['sequelize'][_0xa45e('0x2f')](_0xe9c00a[_0xa45e('0x82')](),{'type':db[_0xa45e('0x83')][_0xa45e('0x84')]['SELECT']});}})[_0xa45e('0x25')](respondWithResult(_0x179e46,null))[_0xa45e('0x43')](handleError(_0x179e46,null));};function runReport(_0x5a5e3f,_0x2f9f50,_0x1e8334){var _0x15c3e2=_0x2f9f50[_0xa45e('0x28')];var _0x1f0a74=0xa;var _0x33e381=[_0xa45e('0x53'),_0xa45e('0x54'),_0xa45e('0x85'),_0xa45e('0x55')];var _0x33242b={'SUM':_0xa45e('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa45e('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa45e('0x5c'),'GROUP_CONCAT DESC':_0xa45e('0x5d')};var _0x9c5c45={'SEC_TO_TIME':_0xa45e('0x86'),'DATE':'DATE(%s)','HOUR':_0xa45e('0x5f'),'ROUND':_0xa45e('0x87'),'UNIX_TIMESTAMP':_0xa45e('0x60')};var _0x27787a=function(_0x380524){return!_[_0xa45e('0x61')](['IS\x20NULL',_0xa45e('0x88'),_0xa45e('0x89'),'IS\x20NOT\x20EMPTY'],_0x380524);};var _0x1e1d7c=function(_0x4187a4){if(!_0x4187a4||!_0x4187a4[_0xa45e('0x63')]['length']){return'';}for(var _0x277c47='(',_0x3fa708=0x0;_0x3fa708<_0x4187a4[_0xa45e('0x63')][_0xa45e('0x34')];_0x3fa708+=0x1){_0x3fa708>0x0&&(_0x277c47+='\x20'+_0x4187a4['operator']+'\x20');_0x277c47+=_0x4187a4[_0xa45e('0x63')][_0x3fa708]['group']?_0x1e1d7c(_0x4187a4['rules'][_0x3fa708][_0xa45e('0x65')]):_0x4187a4[_0xa45e('0x63')][_0x3fa708]['field']+'\x20'+_0x4187a4[_0xa45e('0x63')][_0x3fa708][_0xa45e('0x67')]+(_0x27787a(_0x4187a4[_0xa45e('0x63')][_0x3fa708]['condition'])?'\x20'+_0x4187a4[_0xa45e('0x63')][_0x3fa708][_0xa45e('0x68')]:'');}return _0x277c47+')';};var _0x3cd4da={'where':{'id':_0x5a5e3f['id']}},_0x268243,_0x25c73f,_0x1af278,_0x5e8dd7,_0x548ce1;_0x3cd4da=_['merge']({},_0x3cd4da,_0x1e8334);return db['AnalyticCustomReport'][_0xa45e('0x4e')](_0x3cd4da)[_0xa45e('0x25')](function(_0x16a3eb){if(_0x16a3eb){_0x268243=_0x16a3eb;return _0x16a3eb[_0xa45e('0x69')]();}return null;})[_0xa45e('0x25')](function(_0x48c08d){if(_0x48c08d){if(!_0x48c08d[_0xa45e('0x34')]){throw new db[(_0xa45e('0x6a'))][(_0xa45e('0x8a'))](_0xa45e('0x6b'),0x193);}_0x25c73f=_0x48c08d;return db[_0xa45e('0x6c')][_0xa45e('0x41')]({'raw':!![]});}return null;})[_0xa45e('0x25')](function(_0x193be5){if(_0x193be5){_0x1af278=_[_0xa45e('0x6d')](_0x193be5,'id');var _0x4430ab;var _0x551973=squel[_0xa45e('0x6e')]();_0x551973[_0xa45e('0x6f')](_0x268243['table']);for(var _0x160031=0x0;_0x160031<_0x25c73f['length'];_0x160031+=0x1){_0x4430ab=_0x25c73f[_0x160031][_0xa45e('0x70')]?_0x1af278[_0x25c73f[_0x160031][_0xa45e('0x70')]][_0xa45e('0x71')]:_0x25c73f[_0x160031][_0xa45e('0x66')];_0x4430ab=_0x25c73f[_0x160031][_0xa45e('0x72')]?_[_0xa45e('0x73')](_0x33242b[_0x25c73f[_0x160031][_0xa45e('0x72')]],'%s',_0x4430ab):_0x4430ab;_0x4430ab=_0x25c73f[_0x160031][_0xa45e('0x74')]?_[_0xa45e('0x73')](_0x9c5c45[_0x25c73f[_0x160031][_0xa45e('0x74')]],'%s',_0x4430ab):_0x4430ab;if(_0x25c73f[_0x160031][_0xa45e('0x75')]){_0x551973[_0xa45e('0x65')](_0x4430ab);}_0x25c73f[_0x160031]['orderBy']&&_0x551973[_0xa45e('0x37')](_0x4430ab,_0x25c73f[_0x160031][_0xa45e('0x76')]===_0xa45e('0x77')?![]:!![]);_0x551973[_0xa45e('0x66')](_0x4430ab,_0x25c73f[_0x160031][_0xa45e('0x78')]||_0x4430ab);}if(_0x268243[_0xa45e('0x7a')]){_0x268243[_0xa45e('0x7a')]=JSON[_0xa45e('0x79')](_0x268243['joins']);for(var _0x5e964c=0x0;_0x5e964c<_0x268243[_0xa45e('0x7a')][_0xa45e('0x34')];_0x5e964c+=0x1){if(_0x268243[_0xa45e('0x7a')][_0x5e964c][_0xa45e('0x2d')]&&_['includes'](_0x33e381,_0x268243[_0xa45e('0x7a')][_0x5e964c]['type'])&&_0x268243['joins'][_0x5e964c][_0xa45e('0x7b')]&&_0x268243[_0xa45e('0x7a')][_0x5e964c]['foreignTable']&&_0x268243[_0xa45e('0x7a')][_0x5e964c][_0xa45e('0x7e')]){_0x551973[_0x268243[_0xa45e('0x7a')][_0x5e964c][_0xa45e('0x2d')]](_0x268243[_0xa45e('0x7a')][_0x5e964c][_0xa45e('0x7c')],null,util[_0xa45e('0x74')]('%s.%s\x20=\x20%s.%s',_0x268243[_0xa45e('0x7d')],_0x268243[_0xa45e('0x7a')][_0x5e964c][_0xa45e('0x7b')],_0x268243[_0xa45e('0x7a')][_0x5e964c][_0xa45e('0x7c')],_0x268243['joins'][_0x5e964c]['foreignKey']));}}}if(_0x268243[_0xa45e('0x7f')]){_0x268243[_0xa45e('0x7f')]=JSON[_0xa45e('0x79')](_0x268243[_0xa45e('0x7f')]);_0x551973[_0xa45e('0x39')](_0x1e1d7c(_0x268243[_0xa45e('0x7f')]['group']));}_0x548ce1=_0x551973[_0xa45e('0x80')]();_0x551973[_0xa45e('0x1c')](_0x1f0a74);_0x551973[_0xa45e('0x1b')](0x0);logger[_0xa45e('0x8b')](_0xa45e('0x81'),_0x551973[_0xa45e('0x82')]());return db[_0xa45e('0x83')][_0xa45e('0x2f')](_0x551973[_0xa45e('0x82')](),{'type':db[_0xa45e('0x83')]['QueryTypes'][_0xa45e('0x8c')]});}})['then'](function(_0x3e3cef){if(!_0x3e3cef['length']){throw new db[(_0xa45e('0x6a'))][(_0xa45e('0x8a'))]('No\x20available\x20data',0xcc);}if(_0x2f9f50[_0xa45e('0x8d')]===_0xa45e('0x8e')){return null;}var _0x16fe80=_[_0xa45e('0x3d')](_0x2f9f50,{'name':_0x2f9f50['fullPath']||_0x2f9f50[_0xa45e('0x28')]||_0x268243[_0xa45e('0x28')],'basename':_0x15c3e2,'savename':util[_0xa45e('0x74')]('%s-%s.%s',_0x2f9f50['name']||_0x268243[_0xa45e('0x28')],require(_0xa45e('0x8f'))['generate'](0x4),_0x2f9f50[_0xa45e('0x8d')]||_0xa45e('0x90')),'reportId':_0x268243['id'],'reportType':_0xa45e('0x91')});return db['AnalyticExtractedReport'][_0xa45e('0x47')](_0x16fe80,{'raw':!![]});})[_0xa45e('0x25')](function(_0x537ff8){if(_0x268243[_0xa45e('0x7d')]==='cdr'){_0x548ce1['where'](_0x268243[_0xa45e('0x7d')]+_0xa45e('0x92'),_0x2f9f50[_0xa45e('0x93')],_0x2f9f50[_0xa45e('0x94')]);}else{_0x548ce1[_0xa45e('0x39')](_0x268243[_0xa45e('0x7d')]+_0xa45e('0x95'),_0x2f9f50[_0xa45e('0x93')],_0x2f9f50[_0xa45e('0x94')]);}if(_0x537ff8){logger[_0xa45e('0x96')](_0xa45e('0x97'),_0x548ce1[_0xa45e('0x82')]());require(_0xa45e('0x98'))['fork'](path[_0xa45e('0x53')](__dirname,_0xa45e('0x99'),_0x537ff8[_0xa45e('0x8d')]),[_0x537ff8['id'],_0x548ce1[_0xa45e('0x82')](),path[_0xa45e('0x53')](__dirname,'../../files/reports',_0x537ff8[_0xa45e('0x9a')]),_0x15c3e2]);return _0x537ff8;}else{var _0x174bbd=squel[_0xa45e('0x6e')]();_0x174bbd[_0xa45e('0x6f')]('('+_0x548ce1[_0xa45e('0x82')]()+')',_0xa45e('0x9b'));_0x174bbd[_0xa45e('0x66')](_0xa45e('0x9c'),_0xa45e('0x1a'));_0x548ce1[_0xa45e('0x1c')](_0x2f9f50[_0xa45e('0x1c')]||_0x1f0a74);_0x548ce1[_0xa45e('0x1b')](_0x2f9f50['offset']||0x0);return dbH[_0xa45e('0x83')][_0xa45e('0x2f')](_0x174bbd[_0xa45e('0x82')](),{'type':dbH[_0xa45e('0x83')][_0xa45e('0x84')][_0xa45e('0x8c')]})[_0xa45e('0x25')](function(_0x57e24c){if(!_0x57e24c[_0xa45e('0x34')]){_0x5e8dd7=0x0;}else{_0x5e8dd7=_0x57e24c[0x0][_0xa45e('0x1a')]||0x0;}return dbH[_0xa45e('0x83')][_0xa45e('0x2f')](_0x548ce1['toString'](),{'type':dbH[_0xa45e('0x83')][_0xa45e('0x84')][_0xa45e('0x8c')]});})[_0xa45e('0x25')](function(_0x46b8b8){return{'rows':_0x46b8b8||[],'count':_0x5e8dd7};});}});}exports[_0xa45e('0x9d')]=function(_0x5b57d1,_0x517275){return runReport(_0x5b57d1['params'],_0x5b57d1['query'],_0x5b57d1[_0xa45e('0x3e')])['then'](respondWithResult(_0x517275,null))['catch'](handleError(_0x517275,null));};exports[_0xa45e('0x9e')]=runReport;exports[_0xa45e('0x2f')]=function(_0x1ec56f,_0x51e0f5){var _0x34d897=0xa;var _0xafcb6=[_0xa45e('0x53'),'left_join','right_join',_0xa45e('0x55')];var _0x186b2f={'SUM':'SUM(%s)','COUNT':_0xa45e('0x57'),'COUNT DISTINCT':_0xa45e('0x58'),'MAX':_0xa45e('0x59'),'MIN':'MIN(%s)','AVG':_0xa45e('0x9f'),'GROUP_CONCAT':_0xa45e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa45e('0x5d')};var _0x383c39={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa45e('0x5e'),'HOUR':_0xa45e('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa45e('0x60')};var _0x116634=function(_0x36e815){return!_['includes']([_0xa45e('0xa0'),_0xa45e('0x88'),_0xa45e('0x89'),'IS\x20NOT\x20EMPTY'],_0x36e815);};var _0x2c0de6=function(_0x4498c9){if(!_0x4498c9||!_0x4498c9[_0xa45e('0x63')][_0xa45e('0x34')]){return'';}for(var _0x1d5a57='(',_0xfb9289=0x0;_0xfb9289<_0x4498c9[_0xa45e('0x63')]['length'];_0xfb9289+=0x1){_0xfb9289>0x0&&(_0x1d5a57+='\x20'+_0x4498c9[_0xa45e('0x64')]+'\x20');_0x1d5a57+=_0x4498c9['rules'][_0xfb9289][_0xa45e('0x65')]?_0x2c0de6(_0x4498c9[_0xa45e('0x63')][_0xfb9289][_0xa45e('0x65')]):_0x4498c9[_0xa45e('0x63')][_0xfb9289][_0xa45e('0x66')]+'\x20'+_0x4498c9[_0xa45e('0x63')][_0xfb9289][_0xa45e('0x67')]+(_0x116634(_0x4498c9[_0xa45e('0x63')][_0xfb9289]['condition'])?'\x20'+_0x4498c9['rules'][_0xfb9289]['value']:'');}return _0x1d5a57+')';};var _0x5781e2={'where':{'id':_0x1ec56f[_0xa45e('0x44')]['id']}},_0x126daf,_0xbc320c,_0x4fc3cc,_0x921097,_0x211eb3;_0x5781e2=_[_0xa45e('0x3d')]({},_0x5781e2,_0x1ec56f[_0xa45e('0x3e')]);return db[_0xa45e('0x2b')]['find'](_0x5781e2)[_0xa45e('0x25')](function(_0x57524e){if(_0x57524e){_0x126daf=_0x57524e;return _0x57524e[_0xa45e('0x69')]();}return null;})[_0xa45e('0x25')](function(_0x411ae5){if(_0x411ae5){if(!_0x411ae5[_0xa45e('0x34')]){throw new db[(_0xa45e('0x6a'))][(_0xa45e('0x8a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xbc320c=_0x411ae5;return db[_0xa45e('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xd5a55e){if(_0xd5a55e){_0x4fc3cc=_[_0xa45e('0x6d')](_0xd5a55e,'id');var _0x1f1d41;var _0xf92cdd=squel[_0xa45e('0x6e')]();_0xf92cdd['from'](_0x126daf['table']);for(var _0x1f1cb8=0x0;_0x1f1cb8<_0xbc320c['length'];_0x1f1cb8+=0x1){_0x1f1d41=_0xbc320c[_0x1f1cb8]['MetricId']?_0x4fc3cc[_0xbc320c[_0x1f1cb8]['MetricId']][_0xa45e('0x71')]:_0xbc320c[_0x1f1cb8][_0xa45e('0x66')];_0x1f1d41=_0xbc320c[_0x1f1cb8][_0xa45e('0x72')]?_[_0xa45e('0x73')](_0x186b2f[_0xbc320c[_0x1f1cb8]['function']],'%s',_0x1f1d41):_0x1f1d41;_0x1f1d41=_0xbc320c[_0x1f1cb8][_0xa45e('0x74')]?_[_0xa45e('0x73')](_0x383c39[_0xbc320c[_0x1f1cb8]['format']],'%s',_0x1f1d41):_0x1f1d41;if(_0xbc320c[_0x1f1cb8][_0xa45e('0x75')]){_0xf92cdd[_0xa45e('0x65')](_0x1f1d41);}_0xbc320c[_0x1f1cb8][_0xa45e('0x76')]&&_0xf92cdd['order'](_0x1f1d41,_0xbc320c[_0x1f1cb8][_0xa45e('0x76')]==='DESC'?![]:!![]);_0xf92cdd[_0xa45e('0x66')](_0x1f1d41,_0xbc320c[_0x1f1cb8][_0xa45e('0x78')]||_0x1f1d41);}if(_0x126daf[_0xa45e('0x7a')]){_0x126daf[_0xa45e('0x7a')]=JSON[_0xa45e('0x79')](_0x126daf['joins']);for(var _0x27d8c4=0x0;_0x27d8c4<_0x126daf[_0xa45e('0x7a')][_0xa45e('0x34')];_0x27d8c4+=0x1){if(_0x126daf[_0xa45e('0x7a')][_0x27d8c4]['type']&&_[_0xa45e('0x61')](_0xafcb6,_0x126daf['joins'][_0x27d8c4][_0xa45e('0x2d')])&&_0x126daf[_0xa45e('0x7a')][_0x27d8c4][_0xa45e('0x7b')]&&_0x126daf['joins'][_0x27d8c4][_0xa45e('0x7c')]&&_0x126daf[_0xa45e('0x7a')][_0x27d8c4][_0xa45e('0x7e')]){_0xf92cdd[_0x126daf[_0xa45e('0x7a')][_0x27d8c4][_0xa45e('0x2d')]](_0x126daf[_0xa45e('0x7a')][_0x27d8c4]['foreignTable'],null,util[_0xa45e('0x74')](_0xa45e('0xa1'),_0x126daf[_0xa45e('0x7d')],_0x126daf['joins'][_0x27d8c4]['parentKey'],_0x126daf[_0xa45e('0x7a')][_0x27d8c4][_0xa45e('0x7c')],_0x126daf['joins'][_0x27d8c4][_0xa45e('0x7e')]));}}}if(_0x126daf[_0xa45e('0x7f')]){_0x126daf[_0xa45e('0x7f')]=JSON['parse'](_0x126daf[_0xa45e('0x7f')]);_0xf92cdd[_0xa45e('0x39')](_0x2c0de6(_0x126daf['conditions'][_0xa45e('0x65')]));}_0x211eb3=_0xf92cdd[_0xa45e('0x80')]();_0xf92cdd[_0xa45e('0x1c')](_0x34d897);_0xf92cdd[_0xa45e('0x1b')](0x0);logger[_0xa45e('0x8b')](_0xa45e('0x81'),_0xf92cdd[_0xa45e('0x82')]());return db[_0xa45e('0x83')]['query'](_0xf92cdd['toString'](),{'type':db[_0xa45e('0x83')][_0xa45e('0x84')][_0xa45e('0x8c')]});}})[_0xa45e('0x25')](function(){return{'sql':_0x211eb3[_0xa45e('0x82')]()};})[_0xa45e('0x25')](respondWithResult(_0x51e0f5,null))[_0xa45e('0x43')](handleError(_0x51e0f5,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 436047a..55e6091 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.model.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd29f=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xd29f,0xc6));var _0xfd29=function(_0x40a0a4,_0x4269e1){_0x40a0a4=_0x40a0a4-0x0;var _0x115c37=_0xd29f[_0x40a0a4];return _0x115c37;};'use strict';var _=require(_0xfd29('0x0'));var util=require(_0xfd29('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfd29('0x2'));var BPromise=require(_0xfd29('0x3'));var rp=require(_0xfd29('0x4'));var fs=require('fs');var path=require(_0xfd29('0x5'));var rimraf=require(_0xfd29('0x6'));var config=require(_0xfd29('0x7'));var attributes=require(_0xfd29('0x8'));module['exports']=function(_0x5aba23,_0x144ee3){return _0x5aba23[_0xfd29('0x9')](_0xfd29('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa006=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x444d2f,_0x2927b9){var _0x18ae46=function(_0x257e84){while(--_0x257e84){_0x444d2f['push'](_0x444d2f['shift']());}};_0x18ae46(++_0x2927b9);}(_0xa006,0x109));var _0x6a00=function(_0x2f3e65,_0xa077ac){_0x2f3e65=_0x2f3e65-0x0;var _0x3a8814=_0xa006[_0x2f3e65];return _0x3a8814;};'use strict';var _=require(_0x6a00('0x0'));var util=require(_0x6a00('0x1'));var logger=require(_0x6a00('0x2'))(_0x6a00('0x3'));var moment=require(_0x6a00('0x4'));var BPromise=require(_0x6a00('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a00('0x6'));var rimraf=require(_0x6a00('0x7'));var config=require(_0x6a00('0x8'));var attributes=require(_0x6a00('0x9'));module[_0x6a00('0xa')]=function(_0x554226,_0x292b4e){return _0x554226[_0x6a00('0xb')](_0x6a00('0xc'),attributes,{'tableName':_0x6a00('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index def6704..ad97736 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xceff=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x1fda44,_0x214d9b){var _0x1a9c87=function(_0xead71b){while(--_0xead71b){_0x1fda44['push'](_0x1fda44['shift']());}};_0x1a9c87(++_0x214d9b);}(_0xceff,0x11d));var _0xfcef=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xceff[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xfcef('0x0'));var util=require(_0xfcef('0x1'));var moment=require(_0xfcef('0x2'));var BPromise=require(_0xfcef('0x3'));var rs=require(_0xfcef('0x4'));var fs=require('fs');var Redis=require(_0xfcef('0x5'));var db=require(_0xfcef('0x6'))['db'];var utils=require(_0xfcef('0x7'));var logger=require(_0xfcef('0x8'))(_0xfcef('0x9'));var config=require('../../config/environment');var jayson=require(_0xfcef('0xa'));var client=jayson['client'][_0xfcef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2567b4,_0x2f5fa6,_0x39a316){return new BPromise(function(_0x3fbd2c,_0x116a5c){return client['request'](_0x2567b4,_0x39a316)[_0xfcef('0xc')](function(_0x33b5e1){logger[_0xfcef('0xd')](_0xfcef('0xe'),_0x2f5fa6,_0xfcef('0xf'));logger[_0xfcef('0x10')](_0xfcef('0x11'),_0x2f5fa6,_0xfcef('0xf'),JSON[_0xfcef('0x12')](_0x33b5e1));if(_0x33b5e1['error']){if(_0x33b5e1['error'][_0xfcef('0x13')]===0x1f4){logger[_0xfcef('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2f5fa6,_0x33b5e1['error'][_0xfcef('0x15')]);return _0x116a5c(_0x33b5e1[_0xfcef('0x14')][_0xfcef('0x15')]);}logger[_0xfcef('0x14')](_0xfcef('0xe'),_0x2f5fa6,_0x33b5e1[_0xfcef('0x14')][_0xfcef('0x15')]);return _0x3fbd2c(_0x33b5e1[_0xfcef('0x14')][_0xfcef('0x15')]);}else{logger[_0xfcef('0xd')](_0xfcef('0xe'),_0x2f5fa6,_0xfcef('0xf'));_0x3fbd2c(_0x33b5e1[_0xfcef('0x16')][_0xfcef('0x15')]);}})[_0xfcef('0x17')](function(_0x4dd2e3){logger[_0xfcef('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2f5fa6,_0x4dd2e3);_0x116a5c(_0x4dd2e3);});});}
\ No newline at end of file
+var _0x92f7=['client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x567cc6,_0x258f06){var _0x2104d9=function(_0x3c5b5c){while(--_0x3c5b5c){_0x567cc6['push'](_0x567cc6['shift']());}};_0x2104d9(++_0x258f06);}(_0x92f7,0xe8));var _0x792f=function(_0x180a87,_0x3c3463){_0x180a87=_0x180a87-0x0;var _0x281e81=_0x92f7[_0x180a87];return _0x281e81;};'use strict';var _=require(_0x792f('0x0'));var util=require(_0x792f('0x1'));var moment=require(_0x792f('0x2'));var BPromise=require(_0x792f('0x3'));var rs=require(_0x792f('0x4'));var fs=require('fs');var Redis=require(_0x792f('0x5'));var db=require(_0x792f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x792f('0x7'));var config=require(_0x792f('0x8'));var jayson=require(_0x792f('0x9'));var client=jayson[_0x792f('0xa')][_0x792f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c7a56,_0x5739b5,_0x5d698d){return new BPromise(function(_0x102b43,_0x3262c4){return client[_0x792f('0xc')](_0x1c7a56,_0x5d698d)['then'](function(_0x4a873b){logger[_0x792f('0xd')](_0x792f('0xe'),_0x5739b5,'request\x20sent');logger[_0x792f('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5739b5,'request\x20sent',JSON[_0x792f('0x10')](_0x4a873b));if(_0x4a873b[_0x792f('0x11')]){if(_0x4a873b[_0x792f('0x11')][_0x792f('0x12')]===0x1f4){logger['error'](_0x792f('0xe'),_0x5739b5,_0x4a873b[_0x792f('0x11')][_0x792f('0x13')]);return _0x3262c4(_0x4a873b[_0x792f('0x11')]['message']);}logger[_0x792f('0x11')](_0x792f('0xe'),_0x5739b5,_0x4a873b['error']['message']);return _0x102b43(_0x4a873b[_0x792f('0x11')][_0x792f('0x13')]);}else{logger[_0x792f('0xd')](_0x792f('0xe'),_0x5739b5,_0x792f('0x14'));_0x102b43(_0x4a873b['result'][_0x792f('0x13')]);}})[_0x792f('0x15')](function(_0x2ff66d){logger[_0x792f('0x11')](_0x792f('0xe'),_0x5739b5,_0x2ff66d);_0x3262c4(_0x2ff66d);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 7c6446e..93bb062 100644
--- a/server/api/analyticCustomReport/index.js
+++ b/server/api/analyticCustomReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4b1=['/:id/run','run','query','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview'];(function(_0x403ca6,_0x24e284){var _0x4e0e05=function(_0x3a76ba){while(--_0x3a76ba){_0x403ca6['push'](_0x403ca6['shift']());}};_0x4e0e05(++_0x24e284);}(_0xd4b1,0x134));var _0x1d4b=function(_0x1ddbef,_0x699b15){_0x1ddbef=_0x1ddbef-0x0;var _0x59d6f7=_0xd4b1[_0x1ddbef];return _0x59d6f7;};'use strict';var multer=require(_0x1d4b('0x0'));var util=require(_0x1d4b('0x1'));var path=require('path');var timeout=require(_0x1d4b('0x2'));var express=require('express');var router=express[_0x1d4b('0x3')]();var auth=require(_0x1d4b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1d4b('0x5'));router[_0x1d4b('0x6')]('/',auth[_0x1d4b('0x7')](),controller['index']);router[_0x1d4b('0x6')](_0x1d4b('0x8'),auth[_0x1d4b('0x7')](),controller[_0x1d4b('0x9')]);router[_0x1d4b('0x6')](_0x1d4b('0xa'),auth[_0x1d4b('0x7')](),controller[_0x1d4b('0xb')]);router[_0x1d4b('0x6')](_0x1d4b('0xc'),auth['isAuthenticated'](),controller[_0x1d4b('0xd')]);router['get']('/:id/query',auth[_0x1d4b('0x7')](),controller[_0x1d4b('0xe')]);router['post']('/',auth[_0x1d4b('0x7')](),controller[_0x1d4b('0xf')]);router[_0x1d4b('0x10')](_0x1d4b('0x8'),auth[_0x1d4b('0x7')](),controller['update']);router[_0x1d4b('0x11')](_0x1d4b('0x8'),auth[_0x1d4b('0x7')](),controller[_0x1d4b('0x12')]);module[_0x1d4b('0x13')]=router;
\ No newline at end of file
+var _0x975c=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x53e3fa,_0x50c5f2){var _0xe8584a=function(_0x1771a5){while(--_0x1771a5){_0x53e3fa['push'](_0x53e3fa['shift']());}};_0xe8584a(++_0x50c5f2);}(_0x975c,0x1cc));var _0xc975=function(_0x47913a,_0x58b711){_0x47913a=_0x47913a-0x0;var _0x567a9a=_0x975c[_0x47913a];return _0x567a9a;};'use strict';var multer=require(_0xc975('0x0'));var util=require(_0xc975('0x1'));var path=require(_0xc975('0x2'));var timeout=require(_0xc975('0x3'));var express=require(_0xc975('0x4'));var router=express[_0xc975('0x5')]();var auth=require(_0xc975('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xc975('0x7')]('/',auth[_0xc975('0x8')](),controller[_0xc975('0x9')]);router[_0xc975('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc975('0xa')]);router[_0xc975('0x7')](_0xc975('0xb'),auth[_0xc975('0x8')](),controller[_0xc975('0xc')]);router[_0xc975('0x7')](_0xc975('0xd'),auth[_0xc975('0x8')](),controller[_0xc975('0xe')]);router[_0xc975('0x7')](_0xc975('0xf'),auth['isAuthenticated'](),controller[_0xc975('0x10')]);router[_0xc975('0x11')]('/',auth['isAuthenticated'](),controller[_0xc975('0x12')]);router[_0xc975('0x13')](_0xc975('0x14'),auth[_0xc975('0x8')](),controller[_0xc975('0x15')]);router[_0xc975('0x16')]('/:id',auth[_0xc975('0x8')](),controller['destroy']);module[_0xc975('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index ead1b0f..41aece1 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x84bc=['TEXT','exports','STRING'];(function(_0x4c44be,_0x254527){var _0x45eb31=function(_0x16ddb8){while(--_0x16ddb8){_0x4c44be['push'](_0x4c44be['shift']());}};_0x45eb31(++_0x254527);}(_0x84bc,0x1d8));var _0xc84b=function(_0x1f819c,_0x269444){_0x1f819c=_0x1f819c-0x0;var _0x27c542=_0x84bc[_0x1f819c];return _0x27c542;};'use strict';var Sequelize=require('sequelize');module[_0xc84b('0x0')]={'name':{'type':Sequelize[_0xc84b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc84b('0x1')]},'parent':{'type':Sequelize[_0xc84b('0x1')]},'table':{'type':Sequelize[_0xc84b('0x1')]},'conditions':{'type':Sequelize[_0xc84b('0x2')]},'joins':{'type':Sequelize[_0xc84b('0x2')]}};
\ No newline at end of file
+var _0x99ce=['TEXT','sequelize','STRING'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x99ce,0x151));var _0xe99c=function(_0x2c32d5,_0x40e186){_0x2c32d5=_0x2c32d5-0x0;var _0x5df0f4=_0x99ce[_0x2c32d5];return _0x5df0f4;};'use strict';var Sequelize=require(_0xe99c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe99c('0x1')]},'parent':{'type':Sequelize[_0xe99c('0x1')]},'table':{'type':Sequelize[_0xe99c('0x1')]},'conditions':{'type':Sequelize[_0xe99c('0x2')]},'joins':{'type':Sequelize[_0xe99c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index fd467a7..2d11e31 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe8a2=['Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','left_join','right_join','cross_join','GROUP_CONCAT(%s)','DATE(%s)','IS\x20NOT\x20NULL','function','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','join','../../files/reports','countTable','run','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','DefaultReports','UserProfileResource','end','sendStatus','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug'];(function(_0x5dda62,_0x493273){var _0x311c30=function(_0x3a718e){while(--_0x3a718e){_0x5dda62['push'](_0x5dda62['shift']());}};_0x311c30(++_0x493273);}(_0xe8a2,0x15f));var _0x2e8a=function(_0x400667,_0x5e4a0c){_0x400667=_0x400667-0x0;var _0x2a2ac1=_0xe8a2[_0x400667];return _0x2a2ac1;};'use strict';var pdf=require(_0x2e8a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2e8a('0x1'));var zipdir=require(_0x2e8a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e8a('0x3'));var moment=require(_0x2e8a('0x4'));var BPromise=require(_0x2e8a('0x5'));var Mustache=require(_0x2e8a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2e8a('0x7'));var csv=require(_0x2e8a('0x8'));var ejs=require(_0x2e8a('0x9'));var fs=require('fs');var _=require(_0x2e8a('0xa'));var squel=require('squel');var crypto=require(_0x2e8a('0xb'));var jsforce=require(_0x2e8a('0xc'));var deskjs=require(_0x2e8a('0xd'));var toCsv=require(_0x2e8a('0x8'));var querystring=require(_0x2e8a('0xe'));var Papa=require('papaparse');var Redis=require(_0x2e8a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2e8a('0x10'));var as=require(_0x2e8a('0x11'));var hardwareService=require(_0x2e8a('0x12'));var logger=require(_0x2e8a('0x13'))('api');var utils=require(_0x2e8a('0x14'));var config=require('../../config/environment');var db=require(_0x2e8a('0x15'))['db'];var dbH=require(_0x2e8a('0x15'))['dbH'];function respondWithStatusCode(_0x394bfd,_0x48b3e4){_0x48b3e4=_0x48b3e4||0xcc;return function(_0x56d8af){if(_0x56d8af){return _0x394bfd['sendStatus'](_0x48b3e4);}return _0x394bfd[_0x2e8a('0x16')](_0x48b3e4)['end']();};}function respondWithResult(_0x13d5d9,_0x1b8f82){_0x1b8f82=_0x1b8f82||0xc8;return function(_0x2d2e72){if(_0x2d2e72){return _0x13d5d9[_0x2e8a('0x16')](_0x1b8f82)[_0x2e8a('0x17')](_0x2d2e72);}};}function respondWithFilteredResult(_0x40ae6a,_0x46e809){return function(_0xc98a34){if(_0xc98a34){var _0x2db346=_0xc98a34[_0x2e8a('0x18')],_0xf47300=_0x46e809[_0x2e8a('0x19')],_0x1b0ee4=_0x46e809[_0x2e8a('0x19')]+_0x46e809[_0x2e8a('0x1a')],_0x451f48;if(_0x1b0ee4>=_0x2db346){_0x1b0ee4=_0x2db346;_0x451f48=0xc8;}else{_0x451f48=0xce;}_0x40ae6a[_0x2e8a('0x16')](_0x451f48);return _0x40ae6a['set'](_0x2e8a('0x1b'),_0xf47300+'-'+_0x1b0ee4+'/'+_0x2db346)[_0x2e8a('0x17')](_0xc98a34);}return null;};}function patchUpdates(_0x5d2127){return function(_0x53666a){try{jsonpatch[_0x2e8a('0x1c')](_0x53666a,_0x5d2127,!![]);}catch(_0xc4878e){return BPromise[_0x2e8a('0x1d')](_0xc4878e);}return _0x53666a[_0x2e8a('0x1e')]();};}function saveUpdates(_0x3dc421,_0x32f5ce){return function(_0x3d1e2d){if(_0x3d1e2d){return _0x3d1e2d['update'](_0x3dc421)[_0x2e8a('0x1f')](function(_0x4acb96){return _0x4acb96;});}return null;};}function removeEntity(_0x3c68a7,_0x4c6379){return function(_0xa4f415){if(_0xa4f415){return _0xa4f415[_0x2e8a('0x20')]()[_0x2e8a('0x1f')](function(){var _0x31d86d=_0xa4f415['get']({'plain':!![]});var _0x14178a=_0x2e8a('0x21');return db[_0x2e8a('0x22')]['destroy']({'where':{'type':_0x14178a,'resourceId':_0x31d86d['id']}})[_0x2e8a('0x1f')](function(){return _0xa4f415;});})['then'](function(){_0x3c68a7[_0x2e8a('0x16')](0xcc)[_0x2e8a('0x23')]();});}};}function handleEntityNotFound(_0x240584,_0xc2d7af){return function(_0x4838d9){if(!_0x4838d9){_0x240584[_0x2e8a('0x24')](0x194);}return _0x4838d9;};}function handleError(_0x2680f7,_0x3d8baa){_0x3d8baa=_0x3d8baa||0x1f4;return function(_0x2a145e){logger['error'](_0x2a145e['stack']);if(_0x2a145e[_0x2e8a('0x25')]){delete _0x2a145e[_0x2e8a('0x25')];}_0x2680f7['status'](_0x3d8baa)[_0x2e8a('0x26')](_0x2a145e);};}exports[_0x2e8a('0x27')]=function(_0x3a6ee3,_0x2e6cdf){var _0x3b1840={},_0x2cdba1={},_0x2c5ffe={'count':0x0,'rows':[]};var _0x25c984=_[_0x2e8a('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x2c18ce){return{'name':_0x2c18ce[_0x2e8a('0x29')],'type':_0x2c18ce[_0x2e8a('0x2a')][_0x2e8a('0x2b')]};});_0x2cdba1[_0x2e8a('0x2c')]=_[_0x2e8a('0x28')](_0x25c984,_0x2e8a('0x25'));_0x2cdba1[_0x2e8a('0x2d')]=_[_0x2e8a('0x2e')](_0x3a6ee3[_0x2e8a('0x2d')]);_0x2cdba1[_0x2e8a('0x2f')]=_[_0x2e8a('0x30')](_0x2cdba1['model'],_0x2cdba1['query']);_0x3b1840[_0x2e8a('0x31')]=_[_0x2e8a('0x30')](_0x2cdba1[_0x2e8a('0x2c')],qs[_0x2e8a('0x32')](_0x3a6ee3['query'][_0x2e8a('0x32')]));_0x3b1840[_0x2e8a('0x31')]=_0x3b1840[_0x2e8a('0x31')]['length']?_0x3b1840[_0x2e8a('0x31')]:_0x2cdba1[_0x2e8a('0x2c')];if(!_0x3a6ee3[_0x2e8a('0x2d')][_0x2e8a('0x33')](_0x2e8a('0x34'))){_0x3b1840[_0x2e8a('0x1a')]=qs[_0x2e8a('0x1a')](_0x3a6ee3['query'][_0x2e8a('0x1a')]);_0x3b1840[_0x2e8a('0x19')]=qs[_0x2e8a('0x19')](_0x3a6ee3[_0x2e8a('0x2d')][_0x2e8a('0x19')]);}_0x3b1840[_0x2e8a('0x35')]=qs[_0x2e8a('0x36')](_0x3a6ee3[_0x2e8a('0x2d')]['sort']);_0x3b1840['where']=qs['filters'](_['pick'](_0x3a6ee3[_0x2e8a('0x2d')],_0x2cdba1[_0x2e8a('0x2f')]),_0x25c984);if(_0x3a6ee3['query'][_0x2e8a('0x37')]){_0x3b1840[_0x2e8a('0x38')]=_['merge'](_0x3b1840[_0x2e8a('0x38')],{'$or':_[_0x2e8a('0x28')](_0x25c984,function(_0x3ce39f){if(_0x3ce39f[_0x2e8a('0x2a')]!=='VIRTUAL'){var _0x3fff3b={};_0x3fff3b[_0x3ce39f[_0x2e8a('0x25')]]={'$like':'%'+_0x3a6ee3[_0x2e8a('0x2d')][_0x2e8a('0x37')]+'%'};return _0x3fff3b;}})});}_0x3b1840=_[_0x2e8a('0x39')]({},_0x3b1840,_0x3a6ee3['options']);var _0x2e67e6={'where':_0x3b1840['where']};return db[_0x2e8a('0x3a')][_0x2e8a('0x18')](_0x2e67e6)[_0x2e8a('0x1f')](function(_0x1181e7){_0x2c5ffe[_0x2e8a('0x18')]=_0x1181e7;if(_0x3a6ee3[_0x2e8a('0x2d')][_0x2e8a('0x3b')]){_0x3b1840[_0x2e8a('0x3c')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x2e8a('0x3d')](_0x3b1840);})[_0x2e8a('0x1f')](function(_0x403c99){_0x2c5ffe[_0x2e8a('0x3e')]=_0x403c99;return _0x2c5ffe;})[_0x2e8a('0x1f')](respondWithFilteredResult(_0x2e6cdf,_0x3b1840))['catch'](handleError(_0x2e6cdf,null));};exports[_0x2e8a('0x3f')]=function(_0x3c161a,_0x365273){var _0x4d39c4={'raw':!![],'where':{'id':_0x3c161a[_0x2e8a('0x40')]['id']}},_0x2672bb={};_0x2672bb[_0x2e8a('0x2c')]=_[_0x2e8a('0x2e')](db['AnalyticDefaultReport']['rawAttributes']);_0x2672bb[_0x2e8a('0x2d')]=_['keys'](_0x3c161a[_0x2e8a('0x2d')]);_0x2672bb[_0x2e8a('0x2f')]=_[_0x2e8a('0x30')](_0x2672bb[_0x2e8a('0x2c')],_0x2672bb[_0x2e8a('0x2d')]);_0x4d39c4[_0x2e8a('0x31')]=_[_0x2e8a('0x30')](_0x2672bb[_0x2e8a('0x2c')],qs['fields'](_0x3c161a[_0x2e8a('0x2d')][_0x2e8a('0x32')]));_0x4d39c4[_0x2e8a('0x31')]=_0x4d39c4[_0x2e8a('0x31')]['length']?_0x4d39c4[_0x2e8a('0x31')]:_0x2672bb[_0x2e8a('0x2c')];if(_0x3c161a[_0x2e8a('0x2d')]['includeAll']){_0x4d39c4[_0x2e8a('0x3c')]=[{'all':!![]}];}_0x4d39c4=_['merge']({},_0x4d39c4,_0x3c161a[_0x2e8a('0x41')]);return db['AnalyticDefaultReport'][_0x2e8a('0x42')](_0x4d39c4)[_0x2e8a('0x1f')](handleEntityNotFound(_0x365273,null))[_0x2e8a('0x1f')](respondWithResult(_0x365273,null))['catch'](handleError(_0x365273,null));};exports[_0x2e8a('0x43')]=function(_0x439e89,_0x5831cc){return db[_0x2e8a('0x3a')][_0x2e8a('0x43')](_0x439e89['body'],{})['then'](function(_0x24e79f){var _0x39bcaf=_0x439e89['user'][_0x2e8a('0x44')]({'plain':!![]});if(!_0x39bcaf)throw new Error(_0x2e8a('0x45'));if(_0x39bcaf[_0x2e8a('0x46')]===_0x2e8a('0x47')){var _0xd9f0eb=_0x24e79f[_0x2e8a('0x44')]({'plain':!![]});var _0x3fc2f1=_0x2e8a('0x48');return db['UserProfileSection'][_0x2e8a('0x42')]({'where':{'name':_0x3fc2f1,'userProfileId':_0x39bcaf['userProfileId']},'raw':!![]})['then'](function(_0xfa33d2){if(_0xfa33d2&&_0xfa33d2[_0x2e8a('0x49')]===0x0){return db[_0x2e8a('0x22')][_0x2e8a('0x43')]({'name':_0xd9f0eb[_0x2e8a('0x25')],'resourceId':_0xd9f0eb['id'],'type':_0x2e8a('0x21'),'sectionId':_0xfa33d2['id']},{})[_0x2e8a('0x1f')](function(){return _0x24e79f;});}else{return _0x24e79f;}})[_0x2e8a('0x4a')](function(_0x8d7c2){logger[_0x2e8a('0x4b')](_0x2e8a('0x4c'),_0x8d7c2);throw _0x8d7c2;});}return _0x24e79f;})[_0x2e8a('0x1f')](respondWithResult(_0x5831cc,0xc9))[_0x2e8a('0x4a')](handleError(_0x5831cc,null));};exports[_0x2e8a('0x4d')]=function(_0x293eee,_0x2718ed){if(_0x293eee[_0x2e8a('0x4e')]['id']){delete _0x293eee[_0x2e8a('0x4e')]['id'];}return db[_0x2e8a('0x3a')][_0x2e8a('0x42')]({'where':{'id':_0x293eee[_0x2e8a('0x40')]['id']}})['then'](handleEntityNotFound(_0x2718ed,null))[_0x2e8a('0x1f')](saveUpdates(_0x293eee[_0x2e8a('0x4e')],null))[_0x2e8a('0x1f')](respondWithResult(_0x2718ed,null))[_0x2e8a('0x4a')](handleError(_0x2718ed,null));};exports[_0x2e8a('0x20')]=function(_0x4e41ea,_0x1c6a3b){return db[_0x2e8a('0x3a')][_0x2e8a('0x42')]({'where':{'id':_0x4e41ea[_0x2e8a('0x40')]['id']}})[_0x2e8a('0x1f')](handleEntityNotFound(_0x1c6a3b,null))[_0x2e8a('0x1f')](removeEntity(_0x1c6a3b,null))[_0x2e8a('0x4a')](handleError(_0x1c6a3b,null));};exports[_0x2e8a('0x4f')]=function(_0x485bc4,_0x5a6217){var _0xa957ac=0xa;var _0xdf32e4=['join','left_join','right_join','cross_join'];var _0x4957ae={'SUM':_0x2e8a('0x50'),'COUNT':_0x2e8a('0x51'),'COUNT DISTINCT':_0x2e8a('0x52'),'MAX':_0x2e8a('0x53'),'MIN':_0x2e8a('0x54'),'AVG':_0x2e8a('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2e8a('0x56'),'GROUP_CONCAT DESC':_0x2e8a('0x57')};var _0x54f9d4={'SEC_TO_TIME':_0x2e8a('0x58'),'DATE':'DATE(%s)','HOUR':_0x2e8a('0x59'),'ROUND':_0x2e8a('0x5a'),'UNIX_TIMESTAMP':_0x2e8a('0x5b')};var _0x318e37=function(_0x4c423a){return!_[_0x2e8a('0x5c')]([_0x2e8a('0x5d'),'IS\x20NOT\x20NULL',_0x2e8a('0x5e'),_0x2e8a('0x5f')],_0x4c423a);};var _0x52d509=function(_0xb64a8){if(!_0xb64a8||!_0xb64a8[_0x2e8a('0x60')][_0x2e8a('0x61')]){return'';}for(var _0xe355a8='(',_0x16272b=0x0;_0x16272b<_0xb64a8[_0x2e8a('0x60')][_0x2e8a('0x61')];_0x16272b+=0x1){_0x16272b>0x0&&(_0xe355a8+='\x20'+_0xb64a8[_0x2e8a('0x62')]+'\x20');_0xe355a8+=_0xb64a8[_0x2e8a('0x60')][_0x16272b]['group']?_0x52d509(_0xb64a8[_0x2e8a('0x60')][_0x16272b]['group']):_0xb64a8[_0x2e8a('0x60')][_0x16272b]['field']+'\x20'+_0xb64a8[_0x2e8a('0x60')][_0x16272b]['condition']+(_0x318e37(_0xb64a8[_0x2e8a('0x60')][_0x16272b][_0x2e8a('0x63')])?'\x20'+_0xb64a8[_0x2e8a('0x60')][_0x16272b][_0x2e8a('0x64')]:'');}return _0xe355a8+')';};var _0x4b2d85={'where':{'id':_0x485bc4[_0x2e8a('0x40')]['id']}},_0x10ba64,_0x4462e0,_0x153a48,_0x53906b,_0x1abd7f;_0x4b2d85=_[_0x2e8a('0x39')]({},_0x4b2d85,_0x485bc4['options']);return db[_0x2e8a('0x3a')]['find'](_0x4b2d85)[_0x2e8a('0x1f')](function(_0x347bb1){if(_0x347bb1){_0x10ba64=_0x347bb1;return _0x347bb1[_0x2e8a('0x65')]();}return null;})['then'](function(_0x1d58e0){if(_0x1d58e0){if(!_0x1d58e0[_0x2e8a('0x61')]){throw new db[(_0x2e8a('0x66'))][(_0x2e8a('0x67'))](_0x2e8a('0x68'),0x193);}_0x4462e0=_0x1d58e0;return db[_0x2e8a('0x69')][_0x2e8a('0x3d')]({'raw':!![]});}return null;})[_0x2e8a('0x1f')](function(_0x4fe27a){if(_0x4fe27a){_0x153a48=_[_0x2e8a('0x6a')](_0x4fe27a,'id');var _0x153b48;var _0x177970=squel[_0x2e8a('0x6b')]();_0x177970[_0x2e8a('0x6c')](_0x10ba64[_0x2e8a('0x6d')]);for(var _0x304f2d=0x0;_0x304f2d<_0x4462e0[_0x2e8a('0x61')];_0x304f2d+=0x1){_0x153b48=_0x4462e0[_0x304f2d][_0x2e8a('0x6e')]?_0x153a48[_0x4462e0[_0x304f2d][_0x2e8a('0x6e')]][_0x2e8a('0x6f')]:_0x4462e0[_0x304f2d][_0x2e8a('0x70')];_0x153b48=_0x4462e0[_0x304f2d]['function']?_[_0x2e8a('0x71')](_0x4957ae[_0x4462e0[_0x304f2d]['function']],'%s',_0x153b48):_0x153b48;_0x153b48=_0x4462e0[_0x304f2d][_0x2e8a('0x72')]?_[_0x2e8a('0x71')](_0x54f9d4[_0x4462e0[_0x304f2d][_0x2e8a('0x72')]],'%s',_0x153b48):_0x153b48;if(_0x4462e0[_0x304f2d][_0x2e8a('0x73')]){_0x177970['group'](_0x153b48);}_0x4462e0[_0x304f2d]['orderBy']&&_0x177970[_0x2e8a('0x35')](_0x153b48,_0x4462e0[_0x304f2d][_0x2e8a('0x74')]===_0x2e8a('0x75')?![]:!![]);_0x177970['field'](_0x153b48,_0x4462e0[_0x304f2d][_0x2e8a('0x76')]||_0x153b48);}if(_0x10ba64[_0x2e8a('0x77')]){_0x10ba64[_0x2e8a('0x77')]=JSON[_0x2e8a('0x78')](_0x10ba64[_0x2e8a('0x77')]);for(var _0x4c2434=0x0;_0x4c2434<_0x10ba64[_0x2e8a('0x77')][_0x2e8a('0x61')];_0x4c2434+=0x1){if(_0x10ba64['joins'][_0x4c2434][_0x2e8a('0x2a')]&&_[_0x2e8a('0x5c')](_0xdf32e4,_0x10ba64[_0x2e8a('0x77')][_0x4c2434]['type'])&&_0x10ba64['joins'][_0x4c2434][_0x2e8a('0x79')]&&_0x10ba64[_0x2e8a('0x77')][_0x4c2434][_0x2e8a('0x7a')]&&_0x10ba64[_0x2e8a('0x77')][_0x4c2434][_0x2e8a('0x7b')]){_0x177970[_0x10ba64[_0x2e8a('0x77')][_0x4c2434][_0x2e8a('0x2a')]](_0x10ba64[_0x2e8a('0x77')][_0x4c2434][_0x2e8a('0x7a')],null,util[_0x2e8a('0x72')](_0x2e8a('0x7c'),_0x10ba64[_0x2e8a('0x6d')],_0x10ba64[_0x2e8a('0x77')][_0x4c2434]['parentKey'],_0x10ba64[_0x2e8a('0x77')][_0x4c2434]['foreignTable'],_0x10ba64[_0x2e8a('0x77')][_0x4c2434][_0x2e8a('0x7b')]));}}}if(_0x10ba64['conditions']){_0x10ba64[_0x2e8a('0x7d')]=JSON[_0x2e8a('0x78')](_0x10ba64[_0x2e8a('0x7d')]);_0x177970[_0x2e8a('0x38')](_0x52d509(_0x10ba64[_0x2e8a('0x7d')][_0x2e8a('0x7e')]));}_0x1abd7f=_0x177970[_0x2e8a('0x7f')]();_0x177970['limit'](_0xa957ac);_0x177970['offset'](0x0);logger[_0x2e8a('0x80')](_0x2e8a('0x81'),_0x177970['toString']());return db[_0x2e8a('0x82')]['query'](_0x177970[_0x2e8a('0x83')](),{'type':db[_0x2e8a('0x82')][_0x2e8a('0x84')][_0x2e8a('0x85')]});}})['then'](respondWithResult(_0x5a6217,null))[_0x2e8a('0x4a')](handleError(_0x5a6217,null));};function runReport(_0x2e93e4,_0x48b07f,_0x1db186){var _0x20c08f=_0x48b07f[_0x2e8a('0x25')];var _0x3ed7d4=0xa;var _0x28babd=['join',_0x2e8a('0x86'),_0x2e8a('0x87'),_0x2e8a('0x88')];var _0xd4ab9d={'SUM':_0x2e8a('0x50'),'COUNT':_0x2e8a('0x51'),'COUNT DISTINCT':_0x2e8a('0x52'),'MAX':_0x2e8a('0x53'),'MIN':_0x2e8a('0x54'),'AVG':_0x2e8a('0x55'),'GROUP_CONCAT':_0x2e8a('0x89'),'GROUP_CONCAT ASC':_0x2e8a('0x56'),'GROUP_CONCAT DESC':_0x2e8a('0x57')};var _0x2caf3f={'SEC_TO_TIME':_0x2e8a('0x58'),'DATE':_0x2e8a('0x8a'),'HOUR':_0x2e8a('0x59'),'ROUND':_0x2e8a('0x5a'),'UNIX_TIMESTAMP':_0x2e8a('0x5b')};var _0x548243=function(_0x49d93b){return!_[_0x2e8a('0x5c')]([_0x2e8a('0x5d'),_0x2e8a('0x8b'),_0x2e8a('0x5e'),_0x2e8a('0x5f')],_0x49d93b);};var _0x427378=function(_0x493002){if(!_0x493002||!_0x493002[_0x2e8a('0x60')]['length']){return'';}for(var _0x3255ee='(',_0x571177=0x0;_0x571177<_0x493002[_0x2e8a('0x60')][_0x2e8a('0x61')];_0x571177+=0x1){_0x571177>0x0&&(_0x3255ee+='\x20'+_0x493002[_0x2e8a('0x62')]+'\x20');_0x3255ee+=_0x493002['rules'][_0x571177][_0x2e8a('0x7e')]?_0x427378(_0x493002[_0x2e8a('0x60')][_0x571177][_0x2e8a('0x7e')]):_0x493002['rules'][_0x571177]['field']+'\x20'+_0x493002['rules'][_0x571177][_0x2e8a('0x63')]+(_0x548243(_0x493002[_0x2e8a('0x60')][_0x571177][_0x2e8a('0x63')])?'\x20'+_0x493002[_0x2e8a('0x60')][_0x571177][_0x2e8a('0x64')]:'');}return _0x3255ee+')';};var _0x34b195={'where':{'id':_0x2e93e4['id']}},_0x35a7ef,_0x4ea780,_0x9dd562,_0x2c4a9d,_0x533fc4;_0x34b195=_[_0x2e8a('0x39')]({},_0x34b195,_0x1db186);return db['AnalyticDefaultReport']['find'](_0x34b195)[_0x2e8a('0x1f')](function(_0x1b1513){if(_0x1b1513){_0x35a7ef=_0x1b1513;return _0x1b1513['getFields']();}return null;})[_0x2e8a('0x1f')](function(_0x48cf8a){if(_0x48cf8a){if(!_0x48cf8a[_0x2e8a('0x61')]){throw new db[(_0x2e8a('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ea780=_0x48cf8a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x2e8a('0x1f')](function(_0x1de3c9){if(_0x1de3c9){_0x9dd562=_[_0x2e8a('0x6a')](_0x1de3c9,'id');var _0x1ccc74;var _0x100835=squel[_0x2e8a('0x6b')]();_0x100835[_0x2e8a('0x6c')](_0x35a7ef[_0x2e8a('0x6d')]);for(var _0x3da5a2=0x0;_0x3da5a2<_0x4ea780[_0x2e8a('0x61')];_0x3da5a2+=0x1){_0x1ccc74=_0x4ea780[_0x3da5a2][_0x2e8a('0x6e')]?_0x9dd562[_0x4ea780[_0x3da5a2]['MetricId']][_0x2e8a('0x6f')]:_0x4ea780[_0x3da5a2][_0x2e8a('0x70')];_0x1ccc74=_0x4ea780[_0x3da5a2][_0x2e8a('0x8c')]?_[_0x2e8a('0x71')](_0xd4ab9d[_0x4ea780[_0x3da5a2][_0x2e8a('0x8c')]],'%s',_0x1ccc74):_0x1ccc74;_0x1ccc74=_0x4ea780[_0x3da5a2][_0x2e8a('0x72')]?_['replace'](_0x2caf3f[_0x4ea780[_0x3da5a2][_0x2e8a('0x72')]],'%s',_0x1ccc74):_0x1ccc74;if(_0x4ea780[_0x3da5a2][_0x2e8a('0x73')]){_0x100835[_0x2e8a('0x7e')](_0x1ccc74);}_0x4ea780[_0x3da5a2][_0x2e8a('0x74')]&&_0x100835[_0x2e8a('0x35')](_0x1ccc74,_0x4ea780[_0x3da5a2][_0x2e8a('0x74')]==='DESC'?![]:!![]);_0x100835[_0x2e8a('0x70')](_0x1ccc74,_0x4ea780[_0x3da5a2][_0x2e8a('0x76')]||_0x1ccc74);}if(_0x35a7ef[_0x2e8a('0x77')]){_0x35a7ef['joins']=JSON[_0x2e8a('0x78')](_0x35a7ef['joins']);for(var _0x3288fe=0x0;_0x3288fe<_0x35a7ef[_0x2e8a('0x77')][_0x2e8a('0x61')];_0x3288fe+=0x1){if(_0x35a7ef[_0x2e8a('0x77')][_0x3288fe]['type']&&_[_0x2e8a('0x5c')](_0x28babd,_0x35a7ef[_0x2e8a('0x77')][_0x3288fe]['type'])&&_0x35a7ef[_0x2e8a('0x77')][_0x3288fe]['parentKey']&&_0x35a7ef[_0x2e8a('0x77')][_0x3288fe][_0x2e8a('0x7a')]&&_0x35a7ef[_0x2e8a('0x77')][_0x3288fe]['foreignKey']){_0x100835[_0x35a7ef[_0x2e8a('0x77')][_0x3288fe]['type']](_0x35a7ef[_0x2e8a('0x77')][_0x3288fe][_0x2e8a('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x35a7ef[_0x2e8a('0x6d')],_0x35a7ef[_0x2e8a('0x77')][_0x3288fe][_0x2e8a('0x79')],_0x35a7ef[_0x2e8a('0x77')][_0x3288fe][_0x2e8a('0x7a')],_0x35a7ef[_0x2e8a('0x77')][_0x3288fe][_0x2e8a('0x7b')]));}}}if(_0x35a7ef[_0x2e8a('0x7d')]){_0x35a7ef[_0x2e8a('0x7d')]=JSON[_0x2e8a('0x78')](_0x35a7ef[_0x2e8a('0x7d')]);_0x100835['where'](_0x427378(_0x35a7ef['conditions'][_0x2e8a('0x7e')]));}_0x533fc4=_0x100835[_0x2e8a('0x7f')]();_0x100835[_0x2e8a('0x1a')](_0x3ed7d4);_0x100835[_0x2e8a('0x19')](0x0);logger['debug'](_0x2e8a('0x81'),_0x100835[_0x2e8a('0x83')]());return db[_0x2e8a('0x82')]['query'](_0x100835['toString'](),{'type':db[_0x2e8a('0x82')][_0x2e8a('0x84')]['SELECT']});}})[_0x2e8a('0x1f')](function(_0x163d94){if(!_0x163d94[_0x2e8a('0x61')]){throw new db['Sequelize']['ValidationErrorItem'](_0x2e8a('0x8d'),0xcc);}if(_0x48b07f[_0x2e8a('0x8e')]===_0x2e8a('0x8f')){return null;}var _0x5ccec8=_[_0x2e8a('0x39')](_0x48b07f,{'name':_0x48b07f[_0x2e8a('0x90')]||_0x48b07f['name']||_0x35a7ef[_0x2e8a('0x25')],'basename':_0x20c08f,'savename':util['format'](_0x2e8a('0x91'),_0x48b07f['name']||_0x35a7ef['name'],require(_0x2e8a('0x92'))[_0x2e8a('0x93')](0x4),_0x48b07f[_0x2e8a('0x8e')]||_0x2e8a('0x94')),'reportId':_0x35a7ef['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x2e8a('0x43')](_0x5ccec8,{'raw':!![]});})[_0x2e8a('0x1f')](function(_0x59a01){if(_0x35a7ef[_0x2e8a('0x6d')]===_0x2e8a('0x95')){_0x533fc4[_0x2e8a('0x38')](_0x35a7ef[_0x2e8a('0x6d')]+_0x2e8a('0x96'),_0x48b07f[_0x2e8a('0x97')],_0x48b07f['endDate']);}else{_0x533fc4[_0x2e8a('0x38')](_0x35a7ef[_0x2e8a('0x6d')]+_0x2e8a('0x98'),_0x48b07f['startDate'],_0x48b07f['endDate']);}if(_0x59a01){logger['info'](_0x2e8a('0x99'),_0x533fc4[_0x2e8a('0x83')]());require(_0x2e8a('0x9a'))[_0x2e8a('0x9b')](path[_0x2e8a('0x9c')](__dirname,'../../components/export/',_0x59a01[_0x2e8a('0x8e')]),[_0x59a01['id'],_0x533fc4[_0x2e8a('0x83')](),path['join'](__dirname,_0x2e8a('0x9d'),_0x59a01['savename']),_0x20c08f]);return _0x59a01;}else{var _0x13708f=squel['select']();_0x13708f[_0x2e8a('0x6c')]('('+_0x533fc4[_0x2e8a('0x83')]()+')',_0x2e8a('0x9e'));_0x13708f[_0x2e8a('0x70')]('COUNT(*)',_0x2e8a('0x18'));_0x533fc4[_0x2e8a('0x1a')](_0x48b07f['limit']||_0x3ed7d4);_0x533fc4[_0x2e8a('0x19')](_0x48b07f['offset']||0x0);return dbH[_0x2e8a('0x82')][_0x2e8a('0x2d')](_0x13708f[_0x2e8a('0x83')](),{'type':dbH[_0x2e8a('0x82')]['QueryTypes'][_0x2e8a('0x85')]})[_0x2e8a('0x1f')](function(_0x746773){if(!_0x746773[_0x2e8a('0x61')]){_0x2c4a9d=0x0;}else{_0x2c4a9d=_0x746773[0x0][_0x2e8a('0x18')]||0x0;}return dbH['sequelize'][_0x2e8a('0x2d')](_0x533fc4[_0x2e8a('0x83')](),{'type':dbH['sequelize']['QueryTypes'][_0x2e8a('0x85')]});})['then'](function(_0x596060){return{'rows':_0x596060||[],'count':_0x2c4a9d};});}});}exports[_0x2e8a('0x9f')]=function(_0xbbfd57,_0x2e2825){return runReport(_0xbbfd57['params'],_0xbbfd57[_0x2e8a('0x2d')],_0xbbfd57[_0x2e8a('0x41')])[_0x2e8a('0x1f')](respondWithResult(_0x2e2825,null))[_0x2e8a('0x4a')](handleError(_0x2e2825,null));};exports['runReport']=runReport;exports['query']=function(_0x50b759,_0x350601){var _0x40d625=0xa;var _0x19fe47=[_0x2e8a('0x9c'),'left_join',_0x2e8a('0x87'),'cross_join'];var _0x2d0288={'SUM':_0x2e8a('0x50'),'COUNT':_0x2e8a('0x51'),'COUNT DISTINCT':_0x2e8a('0x52'),'MAX':'MAX(%s)','MIN':_0x2e8a('0x54'),'AVG':_0x2e8a('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2e8a('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1a1a89={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2e8a('0x8a'),'HOUR':_0x2e8a('0x59'),'ROUND':_0x2e8a('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x330a91=function(_0xbe5633){return!_[_0x2e8a('0x5c')]([_0x2e8a('0x5d'),_0x2e8a('0x8b'),_0x2e8a('0x5e'),_0x2e8a('0x5f')],_0xbe5633);};var _0x19e738=function(_0xf45b1){if(!_0xf45b1||!_0xf45b1['rules'][_0x2e8a('0x61')]){return'';}for(var _0x5dec13='(',_0x514010=0x0;_0x514010<_0xf45b1['rules']['length'];_0x514010+=0x1){_0x514010>0x0&&(_0x5dec13+='\x20'+_0xf45b1[_0x2e8a('0x62')]+'\x20');_0x5dec13+=_0xf45b1[_0x2e8a('0x60')][_0x514010]['group']?_0x19e738(_0xf45b1[_0x2e8a('0x60')][_0x514010]['group']):_0xf45b1['rules'][_0x514010][_0x2e8a('0x70')]+'\x20'+_0xf45b1[_0x2e8a('0x60')][_0x514010]['condition']+(_0x330a91(_0xf45b1[_0x2e8a('0x60')][_0x514010][_0x2e8a('0x63')])?'\x20'+_0xf45b1[_0x2e8a('0x60')][_0x514010][_0x2e8a('0x64')]:'');}return _0x5dec13+')';};var _0x2a176a={'where':{'id':_0x50b759['params']['id']}},_0x22bcd3,_0x227f18,_0x12e2f0,_0x2354f7,_0x141a9d;_0x2a176a=_[_0x2e8a('0x39')]({},_0x2a176a,_0x50b759['options']);return db[_0x2e8a('0x3a')][_0x2e8a('0x42')](_0x2a176a)[_0x2e8a('0x1f')](function(_0x3069cd){if(_0x3069cd){_0x22bcd3=_0x3069cd;return _0x3069cd[_0x2e8a('0x65')]();}return null;})[_0x2e8a('0x1f')](function(_0x450b57){if(_0x450b57){if(!_0x450b57[_0x2e8a('0x61')]){throw new db[(_0x2e8a('0x66'))][(_0x2e8a('0x67'))](_0x2e8a('0x68'),0x193);}_0x227f18=_0x450b57;return db[_0x2e8a('0x69')][_0x2e8a('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x50bed9){if(_0x50bed9){_0x12e2f0=_[_0x2e8a('0x6a')](_0x50bed9,'id');var _0x1864a9;var _0x1ce9c7=squel[_0x2e8a('0x6b')]();_0x1ce9c7[_0x2e8a('0x6c')](_0x22bcd3['table']);for(var _0x60289f=0x0;_0x60289f<_0x227f18[_0x2e8a('0x61')];_0x60289f+=0x1){_0x1864a9=_0x227f18[_0x60289f][_0x2e8a('0x6e')]?_0x12e2f0[_0x227f18[_0x60289f][_0x2e8a('0x6e')]][_0x2e8a('0x6f')]:_0x227f18[_0x60289f][_0x2e8a('0x70')];_0x1864a9=_0x227f18[_0x60289f]['function']?_['replace'](_0x2d0288[_0x227f18[_0x60289f][_0x2e8a('0x8c')]],'%s',_0x1864a9):_0x1864a9;_0x1864a9=_0x227f18[_0x60289f]['format']?_['replace'](_0x1a1a89[_0x227f18[_0x60289f]['format']],'%s',_0x1864a9):_0x1864a9;if(_0x227f18[_0x60289f][_0x2e8a('0x73')]){_0x1ce9c7[_0x2e8a('0x7e')](_0x1864a9);}_0x227f18[_0x60289f][_0x2e8a('0x74')]&&_0x1ce9c7['order'](_0x1864a9,_0x227f18[_0x60289f][_0x2e8a('0x74')]===_0x2e8a('0x75')?![]:!![]);_0x1ce9c7[_0x2e8a('0x70')](_0x1864a9,_0x227f18[_0x60289f]['alias']||_0x1864a9);}if(_0x22bcd3[_0x2e8a('0x77')]){_0x22bcd3[_0x2e8a('0x77')]=JSON['parse'](_0x22bcd3[_0x2e8a('0x77')]);for(var _0x345ed0=0x0;_0x345ed0<_0x22bcd3[_0x2e8a('0x77')][_0x2e8a('0x61')];_0x345ed0+=0x1){if(_0x22bcd3['joins'][_0x345ed0][_0x2e8a('0x2a')]&&_['includes'](_0x19fe47,_0x22bcd3[_0x2e8a('0x77')][_0x345ed0]['type'])&&_0x22bcd3['joins'][_0x345ed0][_0x2e8a('0x79')]&&_0x22bcd3['joins'][_0x345ed0]['foreignTable']&&_0x22bcd3[_0x2e8a('0x77')][_0x345ed0][_0x2e8a('0x7b')]){_0x1ce9c7[_0x22bcd3[_0x2e8a('0x77')][_0x345ed0][_0x2e8a('0x2a')]](_0x22bcd3[_0x2e8a('0x77')][_0x345ed0][_0x2e8a('0x7a')],null,util[_0x2e8a('0x72')](_0x2e8a('0x7c'),_0x22bcd3[_0x2e8a('0x6d')],_0x22bcd3[_0x2e8a('0x77')][_0x345ed0]['parentKey'],_0x22bcd3[_0x2e8a('0x77')][_0x345ed0]['foreignTable'],_0x22bcd3['joins'][_0x345ed0][_0x2e8a('0x7b')]));}}}if(_0x22bcd3[_0x2e8a('0x7d')]){_0x22bcd3[_0x2e8a('0x7d')]=JSON[_0x2e8a('0x78')](_0x22bcd3[_0x2e8a('0x7d')]);_0x1ce9c7[_0x2e8a('0x38')](_0x19e738(_0x22bcd3[_0x2e8a('0x7d')]['group']));}_0x141a9d=_0x1ce9c7['clone']();_0x1ce9c7['limit'](_0x40d625);_0x1ce9c7[_0x2e8a('0x19')](0x0);logger['debug'](_0x2e8a('0x81'),_0x1ce9c7['toString']());return db['sequelize'][_0x2e8a('0x2d')](_0x1ce9c7[_0x2e8a('0x83')](),{'type':db['sequelize'][_0x2e8a('0x84')][_0x2e8a('0x85')]});}})['then'](function(){return{'sql':_0x141a9d[_0x2e8a('0x83')]()};})[_0x2e8a('0x1f')](respondWithResult(_0x350601,null))[_0x2e8a('0x4a')](handleError(_0x350601,null));};
\ No newline at end of file
+var _0x366c=['cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','IS\x20NULL','operator','keyBy','alias','fullPath','%s-%s.%s','randomstring','output','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','COUNT(DISTINCT\x20%s)','ROUND(%s)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','find','create','body','user','role','get','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join'];(function(_0xa8a20d,_0x2f781e){var _0x33cf7f=function(_0x397a53){while(--_0x397a53){_0xa8a20d['push'](_0xa8a20d['shift']());}};_0x33cf7f(++_0x2f781e);}(_0x366c,0x197));var _0xc366=function(_0x2ad37b,_0x496eba){_0x2ad37b=_0x2ad37b-0x0;var _0x127ea4=_0x366c[_0x2ad37b];return _0x127ea4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc366('0x0'));var rimraf=require(_0xc366('0x1'));var zipdir=require(_0xc366('0x2'));var jsonpatch=require(_0xc366('0x3'));var rp=require('request-promise');var moment=require(_0xc366('0x4'));var BPromise=require(_0xc366('0x5'));var Mustache=require(_0xc366('0x6'));var util=require(_0xc366('0x7'));var path=require(_0xc366('0x8'));var sox=require(_0xc366('0x9'));var csv=require(_0xc366('0xa'));var ejs=require(_0xc366('0xb'));var fs=require('fs');var _=require(_0xc366('0xc'));var squel=require('squel');var crypto=require(_0xc366('0xd'));var jsforce=require(_0xc366('0xe'));var deskjs=require(_0xc366('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc366('0x10'));var Papa=require(_0xc366('0x11'));var Redis=require(_0xc366('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc366('0x13'));var as=require(_0xc366('0x14'));var hardwareService=require(_0xc366('0x15'));var logger=require(_0xc366('0x16'))(_0xc366('0x17'));var utils=require(_0xc366('0x18'));var config=require(_0xc366('0x19'));var db=require(_0xc366('0x1a'))['db'];var dbH=require('../../mysqldb')[_0xc366('0x1b')];function respondWithStatusCode(_0x37718f,_0x1f7148){_0x1f7148=_0x1f7148||0xcc;return function(_0x385fe3){if(_0x385fe3){return _0x37718f[_0xc366('0x1c')](_0x1f7148);}return _0x37718f[_0xc366('0x1d')](_0x1f7148)[_0xc366('0x1e')]();};}function respondWithResult(_0x1cf05c,_0x4c353e){_0x4c353e=_0x4c353e||0xc8;return function(_0x5793e5){if(_0x5793e5){return _0x1cf05c[_0xc366('0x1d')](_0x4c353e)[_0xc366('0x1f')](_0x5793e5);}};}function respondWithFilteredResult(_0x253f80,_0x99ba1d){return function(_0x2b424a){if(_0x2b424a){var _0xe1d46c=_0x2b424a[_0xc366('0x20')],_0x114c57=_0x99ba1d[_0xc366('0x21')],_0x36d637=_0x99ba1d['offset']+_0x99ba1d['limit'],_0x117ba9;if(_0x36d637>=_0xe1d46c){_0x36d637=_0xe1d46c;_0x117ba9=0xc8;}else{_0x117ba9=0xce;}_0x253f80['status'](_0x117ba9);return _0x253f80[_0xc366('0x22')]('Content-Range',_0x114c57+'-'+_0x36d637+'/'+_0xe1d46c)[_0xc366('0x1f')](_0x2b424a);}return null;};}function patchUpdates(_0x529836){return function(_0x3eaf28){try{jsonpatch[_0xc366('0x23')](_0x3eaf28,_0x529836,!![]);}catch(_0x51b5b6){return BPromise['reject'](_0x51b5b6);}return _0x3eaf28[_0xc366('0x24')]();};}function saveUpdates(_0xbd0411,_0x2fda9f){return function(_0x21233e){if(_0x21233e){return _0x21233e[_0xc366('0x25')](_0xbd0411)[_0xc366('0x26')](function(_0x22c89d){return _0x22c89d;});}return null;};}function removeEntity(_0x4a6638,_0x4477ff){return function(_0x319d64){if(_0x319d64){return _0x319d64[_0xc366('0x27')]()['then'](function(){var _0x350638=_0x319d64['get']({'plain':!![]});var _0x876071=_0xc366('0x28');return db[_0xc366('0x29')][_0xc366('0x27')]({'where':{'type':_0x876071,'resourceId':_0x350638['id']}})['then'](function(){return _0x319d64;});})[_0xc366('0x26')](function(){_0x4a6638[_0xc366('0x1d')](0xcc)[_0xc366('0x1e')]();});}};}function handleEntityNotFound(_0x44e2ab,_0x4a84fb){return function(_0x2ede53){if(!_0x2ede53){_0x44e2ab[_0xc366('0x1c')](0x194);}return _0x2ede53;};}function handleError(_0xc9de54,_0x5e4113){_0x5e4113=_0x5e4113||0x1f4;return function(_0x2163bd){logger[_0xc366('0x2a')](_0x2163bd['stack']);if(_0x2163bd[_0xc366('0x2b')]){delete _0x2163bd[_0xc366('0x2b')];}_0xc9de54[_0xc366('0x1d')](_0x5e4113)['send'](_0x2163bd);};}exports[_0xc366('0x2c')]=function(_0x4e736e,_0x3c2b27){var _0x5dcda0={},_0x19716d={},_0x245940={'count':0x0,'rows':[]};var _0x264f39=_['map'](db[_0xc366('0x2d')]['rawAttributes'],function(_0x1b68df){return{'name':_0x1b68df[_0xc366('0x2e')],'type':_0x1b68df[_0xc366('0x2f')][_0xc366('0x30')]};});_0x19716d[_0xc366('0x31')]=_['map'](_0x264f39,'name');_0x19716d['query']=_[_0xc366('0x32')](_0x4e736e[_0xc366('0x33')]);_0x19716d[_0xc366('0x34')]=_['intersection'](_0x19716d[_0xc366('0x31')],_0x19716d[_0xc366('0x33')]);_0x5dcda0['attributes']=_[_0xc366('0x35')](_0x19716d[_0xc366('0x31')],qs[_0xc366('0x36')](_0x4e736e[_0xc366('0x33')][_0xc366('0x36')]));_0x5dcda0[_0xc366('0x37')]=_0x5dcda0['attributes'][_0xc366('0x38')]?_0x5dcda0[_0xc366('0x37')]:_0x19716d[_0xc366('0x31')];if(!_0x4e736e[_0xc366('0x33')][_0xc366('0x39')]('nolimit')){_0x5dcda0[_0xc366('0x3a')]=qs[_0xc366('0x3a')](_0x4e736e['query'][_0xc366('0x3a')]);_0x5dcda0[_0xc366('0x21')]=qs[_0xc366('0x21')](_0x4e736e['query'][_0xc366('0x21')]);}_0x5dcda0[_0xc366('0x3b')]=qs[_0xc366('0x3c')](_0x4e736e[_0xc366('0x33')][_0xc366('0x3c')]);_0x5dcda0[_0xc366('0x3d')]=qs[_0xc366('0x34')](_[_0xc366('0x3e')](_0x4e736e[_0xc366('0x33')],_0x19716d[_0xc366('0x34')]),_0x264f39);if(_0x4e736e[_0xc366('0x33')]['filter']){_0x5dcda0[_0xc366('0x3d')]=_[_0xc366('0x3f')](_0x5dcda0[_0xc366('0x3d')],{'$or':_['map'](_0x264f39,function(_0x208604){if(_0x208604[_0xc366('0x2f')]!==_0xc366('0x40')){var _0x5c74d7={};_0x5c74d7[_0x208604[_0xc366('0x2b')]]={'$like':'%'+_0x4e736e[_0xc366('0x33')][_0xc366('0x41')]+'%'};return _0x5c74d7;}})});}_0x5dcda0=_[_0xc366('0x3f')]({},_0x5dcda0,_0x4e736e[_0xc366('0x42')]);var _0x4704cf={'where':_0x5dcda0[_0xc366('0x3d')]};return db[_0xc366('0x2d')]['count'](_0x4704cf)['then'](function(_0x28fa19){_0x245940[_0xc366('0x20')]=_0x28fa19;if(_0x4e736e['query'][_0xc366('0x43')]){_0x5dcda0['include']=[{'all':!![]}];}return db[_0xc366('0x2d')][_0xc366('0x44')](_0x5dcda0);})['then'](function(_0x280dbc){_0x245940[_0xc366('0x45')]=_0x280dbc;return _0x245940;})[_0xc366('0x26')](respondWithFilteredResult(_0x3c2b27,_0x5dcda0))['catch'](handleError(_0x3c2b27,null));};exports[_0xc366('0x46')]=function(_0x2362e0,_0x54bf60){var _0x547682={'raw':!![],'where':{'id':_0x2362e0['params']['id']}},_0x2555c6={};_0x2555c6['model']=_[_0xc366('0x32')](db[_0xc366('0x2d')]['rawAttributes']);_0x2555c6[_0xc366('0x33')]=_[_0xc366('0x32')](_0x2362e0['query']);_0x2555c6[_0xc366('0x34')]=_[_0xc366('0x35')](_0x2555c6[_0xc366('0x31')],_0x2555c6[_0xc366('0x33')]);_0x547682[_0xc366('0x37')]=_[_0xc366('0x35')](_0x2555c6['model'],qs[_0xc366('0x36')](_0x2362e0[_0xc366('0x33')][_0xc366('0x36')]));_0x547682[_0xc366('0x37')]=_0x547682[_0xc366('0x37')][_0xc366('0x38')]?_0x547682[_0xc366('0x37')]:_0x2555c6['model'];if(_0x2362e0['query'][_0xc366('0x43')]){_0x547682['include']=[{'all':!![]}];}_0x547682=_[_0xc366('0x3f')]({},_0x547682,_0x2362e0['options']);return db['AnalyticDefaultReport'][_0xc366('0x47')](_0x547682)[_0xc366('0x26')](handleEntityNotFound(_0x54bf60,null))[_0xc366('0x26')](respondWithResult(_0x54bf60,null))['catch'](handleError(_0x54bf60,null));};exports[_0xc366('0x48')]=function(_0x195651,_0x3be14e){return db[_0xc366('0x2d')]['create'](_0x195651[_0xc366('0x49')],{})[_0xc366('0x26')](function(_0x1f5dee){var _0x468480=_0x195651[_0xc366('0x4a')]['get']({'plain':!![]});if(!_0x468480)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x468480[_0xc366('0x4b')]===_0xc366('0x4a')){var _0x2e83db=_0x1f5dee[_0xc366('0x4c')]({'plain':!![]});var _0x37eddf='Reports';return db[_0xc366('0x4d')][_0xc366('0x47')]({'where':{'name':_0x37eddf,'userProfileId':_0x468480[_0xc366('0x4e')]},'raw':!![]})[_0xc366('0x26')](function(_0x43c074){if(_0x43c074&&_0x43c074['autoAssociation']===0x0){return db[_0xc366('0x29')][_0xc366('0x48')]({'name':_0x2e83db[_0xc366('0x2b')],'resourceId':_0x2e83db['id'],'type':_0xc366('0x28'),'sectionId':_0x43c074['id']},{})[_0xc366('0x26')](function(){return _0x1f5dee;});}else{return _0x1f5dee;}})[_0xc366('0x4f')](function(_0x574202){logger[_0xc366('0x2a')](_0xc366('0x50'),_0x574202);throw _0x574202;});}return _0x1f5dee;})[_0xc366('0x26')](respondWithResult(_0x3be14e,0xc9))[_0xc366('0x4f')](handleError(_0x3be14e,null));};exports[_0xc366('0x25')]=function(_0x4be4df,_0x2b37dd){if(_0x4be4df[_0xc366('0x49')]['id']){delete _0x4be4df[_0xc366('0x49')]['id'];}return db[_0xc366('0x2d')][_0xc366('0x47')]({'where':{'id':_0x4be4df['params']['id']}})[_0xc366('0x26')](handleEntityNotFound(_0x2b37dd,null))['then'](saveUpdates(_0x4be4df[_0xc366('0x49')],null))[_0xc366('0x26')](respondWithResult(_0x2b37dd,null))[_0xc366('0x4f')](handleError(_0x2b37dd,null));};exports[_0xc366('0x27')]=function(_0x63bd38,_0x54bc75){return db[_0xc366('0x2d')][_0xc366('0x47')]({'where':{'id':_0x63bd38[_0xc366('0x51')]['id']}})[_0xc366('0x26')](handleEntityNotFound(_0x54bc75,null))[_0xc366('0x26')](removeEntity(_0x54bc75,null))[_0xc366('0x4f')](handleError(_0x54bc75,null));};exports[_0xc366('0x52')]=function(_0x574f13,_0x129ea4){var _0x3409f2=0xa;var _0x28b4eb=[_0xc366('0x53'),'left_join',_0xc366('0x54'),_0xc366('0x55')];var _0x4187a0={'SUM':_0xc366('0x56'),'COUNT':_0xc366('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc366('0x58'),'MIN':_0xc366('0x59'),'AVG':_0xc366('0x5a'),'GROUP_CONCAT':_0xc366('0x5b'),'GROUP_CONCAT ASC':_0xc366('0x5c'),'GROUP_CONCAT DESC':_0xc366('0x5d')};var _0x3a80a7={'SEC_TO_TIME':_0xc366('0x5e'),'DATE':_0xc366('0x5f'),'HOUR':_0xc366('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc366('0x61')};var _0xc75592=function(_0x140be5){return!_[_0xc366('0x62')](['IS\x20NULL',_0xc366('0x63'),_0xc366('0x64'),_0xc366('0x65')],_0x140be5);};var _0x4ad0de=function(_0x2a8e90){if(!_0x2a8e90||!_0x2a8e90['rules'][_0xc366('0x38')]){return'';}for(var _0xd8b64='(',_0x2b485a=0x0;_0x2b485a<_0x2a8e90[_0xc366('0x66')][_0xc366('0x38')];_0x2b485a+=0x1){_0x2b485a>0x0&&(_0xd8b64+='\x20'+_0x2a8e90['operator']+'\x20');_0xd8b64+=_0x2a8e90[_0xc366('0x66')][_0x2b485a]['group']?_0x4ad0de(_0x2a8e90[_0xc366('0x66')][_0x2b485a][_0xc366('0x67')]):_0x2a8e90[_0xc366('0x66')][_0x2b485a][_0xc366('0x68')]+'\x20'+_0x2a8e90[_0xc366('0x66')][_0x2b485a][_0xc366('0x69')]+(_0xc75592(_0x2a8e90[_0xc366('0x66')][_0x2b485a][_0xc366('0x69')])?'\x20'+_0x2a8e90[_0xc366('0x66')][_0x2b485a][_0xc366('0x6a')]:'');}return _0xd8b64+')';};var _0x31808f={'where':{'id':_0x574f13[_0xc366('0x51')]['id']}},_0x11ace8,_0x1a782e,_0xa48221,_0x1b580b,_0x1b8daa;_0x31808f=_['merge']({},_0x31808f,_0x574f13[_0xc366('0x42')]);return db[_0xc366('0x2d')][_0xc366('0x47')](_0x31808f)[_0xc366('0x26')](function(_0x29e43f){if(_0x29e43f){_0x11ace8=_0x29e43f;return _0x29e43f[_0xc366('0x6b')]();}return null;})[_0xc366('0x26')](function(_0x1352f4){if(_0x1352f4){if(!_0x1352f4[_0xc366('0x38')]){throw new db[(_0xc366('0x6c'))][(_0xc366('0x6d'))](_0xc366('0x6e'),0x193);}_0x1a782e=_0x1352f4;return db[_0xc366('0x6f')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1b68aa){if(_0x1b68aa){_0xa48221=_['keyBy'](_0x1b68aa,'id');var _0x402cac;var _0x445add=squel[_0xc366('0x70')]();_0x445add[_0xc366('0x71')](_0x11ace8[_0xc366('0x72')]);for(var _0x24ffac=0x0;_0x24ffac<_0x1a782e[_0xc366('0x38')];_0x24ffac+=0x1){_0x402cac=_0x1a782e[_0x24ffac][_0xc366('0x73')]?_0xa48221[_0x1a782e[_0x24ffac][_0xc366('0x73')]][_0xc366('0x74')]:_0x1a782e[_0x24ffac][_0xc366('0x68')];_0x402cac=_0x1a782e[_0x24ffac][_0xc366('0x75')]?_['replace'](_0x4187a0[_0x1a782e[_0x24ffac][_0xc366('0x75')]],'%s',_0x402cac):_0x402cac;_0x402cac=_0x1a782e[_0x24ffac][_0xc366('0x76')]?_[_0xc366('0x77')](_0x3a80a7[_0x1a782e[_0x24ffac][_0xc366('0x76')]],'%s',_0x402cac):_0x402cac;if(_0x1a782e[_0x24ffac][_0xc366('0x78')]){_0x445add[_0xc366('0x67')](_0x402cac);}_0x1a782e[_0x24ffac][_0xc366('0x79')]&&_0x445add[_0xc366('0x3b')](_0x402cac,_0x1a782e[_0x24ffac][_0xc366('0x79')]===_0xc366('0x7a')?![]:!![]);_0x445add['field'](_0x402cac,_0x1a782e[_0x24ffac]['alias']||_0x402cac);}if(_0x11ace8[_0xc366('0x7b')]){_0x11ace8[_0xc366('0x7b')]=JSON[_0xc366('0x7c')](_0x11ace8['joins']);for(var _0x2eb288=0x0;_0x2eb288<_0x11ace8[_0xc366('0x7b')]['length'];_0x2eb288+=0x1){if(_0x11ace8['joins'][_0x2eb288][_0xc366('0x2f')]&&_[_0xc366('0x62')](_0x28b4eb,_0x11ace8['joins'][_0x2eb288][_0xc366('0x2f')])&&_0x11ace8['joins'][_0x2eb288][_0xc366('0x7d')]&&_0x11ace8[_0xc366('0x7b')][_0x2eb288]['foreignTable']&&_0x11ace8['joins'][_0x2eb288][_0xc366('0x7e')]){_0x445add[_0x11ace8['joins'][_0x2eb288][_0xc366('0x2f')]](_0x11ace8[_0xc366('0x7b')][_0x2eb288]['foreignTable'],null,util[_0xc366('0x76')](_0xc366('0x7f'),_0x11ace8['table'],_0x11ace8[_0xc366('0x7b')][_0x2eb288]['parentKey'],_0x11ace8[_0xc366('0x7b')][_0x2eb288][_0xc366('0x80')],_0x11ace8[_0xc366('0x7b')][_0x2eb288][_0xc366('0x7e')]));}}}if(_0x11ace8[_0xc366('0x81')]){_0x11ace8[_0xc366('0x81')]=JSON[_0xc366('0x7c')](_0x11ace8[_0xc366('0x81')]);_0x445add[_0xc366('0x3d')](_0x4ad0de(_0x11ace8[_0xc366('0x81')]['group']));}_0x1b8daa=_0x445add[_0xc366('0x82')]();_0x445add['limit'](_0x3409f2);_0x445add[_0xc366('0x21')](0x0);logger[_0xc366('0x83')](_0xc366('0x84'),_0x445add[_0xc366('0x85')]());return db[_0xc366('0x86')][_0xc366('0x33')](_0x445add[_0xc366('0x85')](),{'type':db[_0xc366('0x86')][_0xc366('0x87')][_0xc366('0x88')]});}})[_0xc366('0x26')](respondWithResult(_0x129ea4,null))[_0xc366('0x4f')](handleError(_0x129ea4,null));};function runReport(_0xbf4900,_0xa9bbd4,_0xbb59af){var _0x39b521=_0xa9bbd4[_0xc366('0x2b')];var _0x2e1efc=0xa;var _0x55a790=['join',_0xc366('0x89'),'right_join','cross_join'];var _0x4e4fe8={'SUM':'SUM(%s)','COUNT':_0xc366('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xc366('0x59'),'AVG':_0xc366('0x5a'),'GROUP_CONCAT':_0xc366('0x5b'),'GROUP_CONCAT ASC':_0xc366('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5999a8={'SEC_TO_TIME':_0xc366('0x5e'),'DATE':'DATE(%s)','HOUR':_0xc366('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc366('0x61')};var _0x2921b3=function(_0x2123bd){return!_[_0xc366('0x62')]([_0xc366('0x8a'),'IS\x20NOT\x20NULL',_0xc366('0x64'),'IS\x20NOT\x20EMPTY'],_0x2123bd);};var _0xc0bbd=function(_0x770a37){if(!_0x770a37||!_0x770a37[_0xc366('0x66')][_0xc366('0x38')]){return'';}for(var _0x242b57='(',_0x18e75d=0x0;_0x18e75d<_0x770a37[_0xc366('0x66')][_0xc366('0x38')];_0x18e75d+=0x1){_0x18e75d>0x0&&(_0x242b57+='\x20'+_0x770a37[_0xc366('0x8b')]+'\x20');_0x242b57+=_0x770a37[_0xc366('0x66')][_0x18e75d][_0xc366('0x67')]?_0xc0bbd(_0x770a37[_0xc366('0x66')][_0x18e75d][_0xc366('0x67')]):_0x770a37['rules'][_0x18e75d][_0xc366('0x68')]+'\x20'+_0x770a37[_0xc366('0x66')][_0x18e75d][_0xc366('0x69')]+(_0x2921b3(_0x770a37[_0xc366('0x66')][_0x18e75d][_0xc366('0x69')])?'\x20'+_0x770a37['rules'][_0x18e75d]['value']:'');}return _0x242b57+')';};var _0x522910={'where':{'id':_0xbf4900['id']}},_0xd2c8ab,_0xa8c437,_0x4abb79,_0x114b14,_0xf5fccd;_0x522910=_[_0xc366('0x3f')]({},_0x522910,_0xbb59af);return db[_0xc366('0x2d')][_0xc366('0x47')](_0x522910)[_0xc366('0x26')](function(_0x185d15){if(_0x185d15){_0xd2c8ab=_0x185d15;return _0x185d15[_0xc366('0x6b')]();}return null;})[_0xc366('0x26')](function(_0x73be5c){if(_0x73be5c){if(!_0x73be5c[_0xc366('0x38')]){throw new db[(_0xc366('0x6c'))][(_0xc366('0x6d'))](_0xc366('0x6e'),0x193);}_0xa8c437=_0x73be5c;return db[_0xc366('0x6f')]['findAll']({'raw':!![]});}return null;})[_0xc366('0x26')](function(_0x3421d1){if(_0x3421d1){_0x4abb79=_[_0xc366('0x8c')](_0x3421d1,'id');var _0x69bdb7;var _0x272592=squel[_0xc366('0x70')]();_0x272592['from'](_0xd2c8ab['table']);for(var _0xe6b154=0x0;_0xe6b154<_0xa8c437[_0xc366('0x38')];_0xe6b154+=0x1){_0x69bdb7=_0xa8c437[_0xe6b154][_0xc366('0x73')]?_0x4abb79[_0xa8c437[_0xe6b154]['MetricId']]['metric']:_0xa8c437[_0xe6b154][_0xc366('0x68')];_0x69bdb7=_0xa8c437[_0xe6b154][_0xc366('0x75')]?_['replace'](_0x4e4fe8[_0xa8c437[_0xe6b154][_0xc366('0x75')]],'%s',_0x69bdb7):_0x69bdb7;_0x69bdb7=_0xa8c437[_0xe6b154][_0xc366('0x76')]?_[_0xc366('0x77')](_0x5999a8[_0xa8c437[_0xe6b154][_0xc366('0x76')]],'%s',_0x69bdb7):_0x69bdb7;if(_0xa8c437[_0xe6b154][_0xc366('0x78')]){_0x272592[_0xc366('0x67')](_0x69bdb7);}_0xa8c437[_0xe6b154]['orderBy']&&_0x272592[_0xc366('0x3b')](_0x69bdb7,_0xa8c437[_0xe6b154][_0xc366('0x79')]===_0xc366('0x7a')?![]:!![]);_0x272592[_0xc366('0x68')](_0x69bdb7,_0xa8c437[_0xe6b154][_0xc366('0x8d')]||_0x69bdb7);}if(_0xd2c8ab[_0xc366('0x7b')]){_0xd2c8ab[_0xc366('0x7b')]=JSON[_0xc366('0x7c')](_0xd2c8ab[_0xc366('0x7b')]);for(var _0x2bdd87=0x0;_0x2bdd87<_0xd2c8ab['joins']['length'];_0x2bdd87+=0x1){if(_0xd2c8ab[_0xc366('0x7b')][_0x2bdd87][_0xc366('0x2f')]&&_[_0xc366('0x62')](_0x55a790,_0xd2c8ab[_0xc366('0x7b')][_0x2bdd87][_0xc366('0x2f')])&&_0xd2c8ab[_0xc366('0x7b')][_0x2bdd87][_0xc366('0x7d')]&&_0xd2c8ab['joins'][_0x2bdd87][_0xc366('0x80')]&&_0xd2c8ab[_0xc366('0x7b')][_0x2bdd87][_0xc366('0x7e')]){_0x272592[_0xd2c8ab[_0xc366('0x7b')][_0x2bdd87][_0xc366('0x2f')]](_0xd2c8ab[_0xc366('0x7b')][_0x2bdd87][_0xc366('0x80')],null,util['format'](_0xc366('0x7f'),_0xd2c8ab[_0xc366('0x72')],_0xd2c8ab['joins'][_0x2bdd87][_0xc366('0x7d')],_0xd2c8ab[_0xc366('0x7b')][_0x2bdd87][_0xc366('0x80')],_0xd2c8ab[_0xc366('0x7b')][_0x2bdd87][_0xc366('0x7e')]));}}}if(_0xd2c8ab['conditions']){_0xd2c8ab[_0xc366('0x81')]=JSON[_0xc366('0x7c')](_0xd2c8ab[_0xc366('0x81')]);_0x272592[_0xc366('0x3d')](_0xc0bbd(_0xd2c8ab[_0xc366('0x81')][_0xc366('0x67')]));}_0xf5fccd=_0x272592[_0xc366('0x82')]();_0x272592['limit'](_0x2e1efc);_0x272592[_0xc366('0x21')](0x0);logger[_0xc366('0x83')](_0xc366('0x84'),_0x272592[_0xc366('0x85')]());return db['sequelize'][_0xc366('0x33')](_0x272592[_0xc366('0x85')](),{'type':db[_0xc366('0x86')][_0xc366('0x87')][_0xc366('0x88')]});}})[_0xc366('0x26')](function(_0xa4ffff){if(!_0xa4ffff[_0xc366('0x38')]){throw new db[(_0xc366('0x6c'))][(_0xc366('0x6d'))]('No\x20available\x20data',0xcc);}if(_0xa9bbd4['output']==='web'){return null;}var _0x1520d5=_[_0xc366('0x3f')](_0xa9bbd4,{'name':_0xa9bbd4[_0xc366('0x8e')]||_0xa9bbd4[_0xc366('0x2b')]||_0xd2c8ab[_0xc366('0x2b')],'basename':_0x39b521,'savename':util['format'](_0xc366('0x8f'),_0xa9bbd4[_0xc366('0x2b')]||_0xd2c8ab[_0xc366('0x2b')],require(_0xc366('0x90'))['generate'](0x4),_0xa9bbd4[_0xc366('0x91')]||_0xc366('0x92')),'reportId':_0xd2c8ab['id'],'reportType':_0xc366('0x93')});return db['AnalyticExtractedReport'][_0xc366('0x48')](_0x1520d5,{'raw':!![]});})[_0xc366('0x26')](function(_0xe07505){if(_0xd2c8ab[_0xc366('0x72')]===_0xc366('0x94')){_0xf5fccd[_0xc366('0x3d')](_0xd2c8ab[_0xc366('0x72')]+_0xc366('0x95'),_0xa9bbd4[_0xc366('0x96')],_0xa9bbd4[_0xc366('0x97')]);}else{_0xf5fccd[_0xc366('0x3d')](_0xd2c8ab['table']+_0xc366('0x98'),_0xa9bbd4['startDate'],_0xa9bbd4[_0xc366('0x97')]);}if(_0xe07505){logger[_0xc366('0x99')]('Run\x20Query:',_0xf5fccd[_0xc366('0x85')]());require(_0xc366('0x9a'))[_0xc366('0x9b')](path[_0xc366('0x53')](__dirname,_0xc366('0x9c'),_0xe07505[_0xc366('0x91')]),[_0xe07505['id'],_0xf5fccd[_0xc366('0x85')](),path['join'](__dirname,_0xc366('0x9d'),_0xe07505['savename']),_0x39b521]);return _0xe07505;}else{var _0x5f8a00=squel[_0xc366('0x70')]();_0x5f8a00[_0xc366('0x71')]('('+_0xf5fccd['toString']()+')',_0xc366('0x9e'));_0x5f8a00['field'](_0xc366('0x9f'),_0xc366('0x20'));_0xf5fccd[_0xc366('0x3a')](_0xa9bbd4[_0xc366('0x3a')]||_0x2e1efc);_0xf5fccd[_0xc366('0x21')](_0xa9bbd4[_0xc366('0x21')]||0x0);return dbH['sequelize']['query'](_0x5f8a00[_0xc366('0x85')](),{'type':dbH[_0xc366('0x86')]['QueryTypes']['SELECT']})[_0xc366('0x26')](function(_0x45ac45){if(!_0x45ac45['length']){_0x114b14=0x0;}else{_0x114b14=_0x45ac45[0x0]['count']||0x0;}return dbH[_0xc366('0x86')]['query'](_0xf5fccd[_0xc366('0x85')](),{'type':dbH['sequelize'][_0xc366('0x87')][_0xc366('0x88')]});})[_0xc366('0x26')](function(_0x346803){return{'rows':_0x346803||[],'count':_0x114b14};});}});}exports[_0xc366('0xa0')]=function(_0x132c7c,_0x526807){return runReport(_0x132c7c[_0xc366('0x51')],_0x132c7c[_0xc366('0x33')],_0x132c7c[_0xc366('0x42')])['then'](respondWithResult(_0x526807,null))['catch'](handleError(_0x526807,null));};exports[_0xc366('0xa1')]=runReport;exports[_0xc366('0x33')]=function(_0x2e0fdd,_0x197c54){var _0xfb247f=0xa;var _0x1a0c7d=['join',_0xc366('0x89'),_0xc366('0x54'),'cross_join'];var _0x3d7728={'SUM':_0xc366('0x56'),'COUNT':_0xc366('0x57'),'COUNT DISTINCT':_0xc366('0xa2'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xc366('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc366('0x5c'),'GROUP_CONCAT DESC':_0xc366('0x5d')};var _0x1a5b06={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc366('0x5f'),'HOUR':_0xc366('0x60'),'ROUND':_0xc366('0xa3'),'UNIX_TIMESTAMP':_0xc366('0x61')};var _0x4138d9=function(_0x559398){return!_['includes']([_0xc366('0x8a'),_0xc366('0x63'),_0xc366('0x64'),_0xc366('0x65')],_0x559398);};var _0x44b742=function(_0x22b515){if(!_0x22b515||!_0x22b515[_0xc366('0x66')][_0xc366('0x38')]){return'';}for(var _0x52bf57='(',_0xaeb69a=0x0;_0xaeb69a<_0x22b515['rules'][_0xc366('0x38')];_0xaeb69a+=0x1){_0xaeb69a>0x0&&(_0x52bf57+='\x20'+_0x22b515[_0xc366('0x8b')]+'\x20');_0x52bf57+=_0x22b515['rules'][_0xaeb69a][_0xc366('0x67')]?_0x44b742(_0x22b515[_0xc366('0x66')][_0xaeb69a][_0xc366('0x67')]):_0x22b515['rules'][_0xaeb69a][_0xc366('0x68')]+'\x20'+_0x22b515[_0xc366('0x66')][_0xaeb69a][_0xc366('0x69')]+(_0x4138d9(_0x22b515[_0xc366('0x66')][_0xaeb69a][_0xc366('0x69')])?'\x20'+_0x22b515[_0xc366('0x66')][_0xaeb69a][_0xc366('0x6a')]:'');}return _0x52bf57+')';};var _0x4bade6={'where':{'id':_0x2e0fdd[_0xc366('0x51')]['id']}},_0xed9b71,_0x2872fe,_0x3c06f8,_0x14c269,_0x32bb0d;_0x4bade6=_[_0xc366('0x3f')]({},_0x4bade6,_0x2e0fdd[_0xc366('0x42')]);return db[_0xc366('0x2d')][_0xc366('0x47')](_0x4bade6)[_0xc366('0x26')](function(_0x1270ea){if(_0x1270ea){_0xed9b71=_0x1270ea;return _0x1270ea[_0xc366('0x6b')]();}return null;})[_0xc366('0x26')](function(_0x53ebf3){if(_0x53ebf3){if(!_0x53ebf3[_0xc366('0x38')]){throw new db[(_0xc366('0x6c'))][(_0xc366('0x6d'))](_0xc366('0x6e'),0x193);}_0x2872fe=_0x53ebf3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x25ae33){if(_0x25ae33){_0x3c06f8=_[_0xc366('0x8c')](_0x25ae33,'id');var _0x5ccf02;var _0xd44b4b=squel[_0xc366('0x70')]();_0xd44b4b[_0xc366('0x71')](_0xed9b71[_0xc366('0x72')]);for(var _0x2d52c3=0x0;_0x2d52c3<_0x2872fe[_0xc366('0x38')];_0x2d52c3+=0x1){_0x5ccf02=_0x2872fe[_0x2d52c3][_0xc366('0x73')]?_0x3c06f8[_0x2872fe[_0x2d52c3]['MetricId']][_0xc366('0x74')]:_0x2872fe[_0x2d52c3][_0xc366('0x68')];_0x5ccf02=_0x2872fe[_0x2d52c3][_0xc366('0x75')]?_[_0xc366('0x77')](_0x3d7728[_0x2872fe[_0x2d52c3][_0xc366('0x75')]],'%s',_0x5ccf02):_0x5ccf02;_0x5ccf02=_0x2872fe[_0x2d52c3][_0xc366('0x76')]?_[_0xc366('0x77')](_0x1a5b06[_0x2872fe[_0x2d52c3][_0xc366('0x76')]],'%s',_0x5ccf02):_0x5ccf02;if(_0x2872fe[_0x2d52c3][_0xc366('0x78')]){_0xd44b4b[_0xc366('0x67')](_0x5ccf02);}_0x2872fe[_0x2d52c3][_0xc366('0x79')]&&_0xd44b4b['order'](_0x5ccf02,_0x2872fe[_0x2d52c3][_0xc366('0x79')]===_0xc366('0x7a')?![]:!![]);_0xd44b4b['field'](_0x5ccf02,_0x2872fe[_0x2d52c3][_0xc366('0x8d')]||_0x5ccf02);}if(_0xed9b71[_0xc366('0x7b')]){_0xed9b71[_0xc366('0x7b')]=JSON[_0xc366('0x7c')](_0xed9b71[_0xc366('0x7b')]);for(var _0x2c0f1f=0x0;_0x2c0f1f<_0xed9b71[_0xc366('0x7b')][_0xc366('0x38')];_0x2c0f1f+=0x1){if(_0xed9b71[_0xc366('0x7b')][_0x2c0f1f]['type']&&_[_0xc366('0x62')](_0x1a0c7d,_0xed9b71[_0xc366('0x7b')][_0x2c0f1f][_0xc366('0x2f')])&&_0xed9b71['joins'][_0x2c0f1f][_0xc366('0x7d')]&&_0xed9b71['joins'][_0x2c0f1f][_0xc366('0x80')]&&_0xed9b71[_0xc366('0x7b')][_0x2c0f1f][_0xc366('0x7e')]){_0xd44b4b[_0xed9b71['joins'][_0x2c0f1f]['type']](_0xed9b71[_0xc366('0x7b')][_0x2c0f1f][_0xc366('0x80')],null,util[_0xc366('0x76')](_0xc366('0x7f'),_0xed9b71[_0xc366('0x72')],_0xed9b71[_0xc366('0x7b')][_0x2c0f1f][_0xc366('0x7d')],_0xed9b71[_0xc366('0x7b')][_0x2c0f1f][_0xc366('0x80')],_0xed9b71[_0xc366('0x7b')][_0x2c0f1f]['foreignKey']));}}}if(_0xed9b71[_0xc366('0x81')]){_0xed9b71[_0xc366('0x81')]=JSON[_0xc366('0x7c')](_0xed9b71[_0xc366('0x81')]);_0xd44b4b['where'](_0x44b742(_0xed9b71[_0xc366('0x81')][_0xc366('0x67')]));}_0x32bb0d=_0xd44b4b[_0xc366('0x82')]();_0xd44b4b[_0xc366('0x3a')](_0xfb247f);_0xd44b4b[_0xc366('0x21')](0x0);logger['debug'](_0xc366('0x84'),_0xd44b4b[_0xc366('0x85')]());return db[_0xc366('0x86')][_0xc366('0x33')](_0xd44b4b[_0xc366('0x85')](),{'type':db[_0xc366('0x86')][_0xc366('0x87')]['SELECT']});}})[_0xc366('0x26')](function(){return{'sql':_0x32bb0d[_0xc366('0x85')]()};})['then'](respondWithResult(_0x197c54,null))[_0xc366('0x4f')](handleError(_0x197c54,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5fd3376..f7c0806 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0295=['define','lodash','api','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x4fccb1,_0x1cff52){var _0x47ef93=function(_0x33c90a){while(--_0x33c90a){_0x4fccb1['push'](_0x4fccb1['shift']());}};_0x47ef93(++_0x1cff52);}(_0x0295,0x1f0));var _0x5029=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0x0295[_0x595bd1];return _0xd0344f;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f2f=['bluebird','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment'];(function(_0x5744e4,_0x494ae2){var _0x3679c7=function(_0x46fd51){while(--_0x46fd51){_0x5744e4['push'](_0x5744e4['shift']());}};_0x3679c7(++_0x494ae2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x452ec3,_0x49e9a7){_0x452ec3=_0x452ec3-0x0;var _0x4bc86a=_0x5f2f[_0x452ec3];return _0x4bc86a;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 9ac40aa..9ccd5e7 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7427=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','catch','AnalyticDefaultReport,\x20%s,\x20%s','lodash','util','moment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x7427,0x111));var _0x7742=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0x7427[_0x5da0d9];return _0x4b6d2f;};'use strict';var _=require(_0x7742('0x0'));var util=require(_0x7742('0x1'));var moment=require(_0x7742('0x2'));var BPromise=require(_0x7742('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7742('0x4'));var db=require(_0x7742('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7742('0x6'))(_0x7742('0x7'));var config=require(_0x7742('0x8'));var jayson=require(_0x7742('0x9'));var client=jayson[_0x7742('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fe55f,_0x2634d5,_0xd21f94){return new BPromise(function(_0x3c6ceb,_0x1da94f){return client[_0x7742('0xb')](_0x4fe55f,_0xd21f94)[_0x7742('0xc')](function(_0x46696e){logger[_0x7742('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2634d5,'request\x20sent');logger[_0x7742('0xe')](_0x7742('0xf'),_0x2634d5,'request\x20sent',JSON[_0x7742('0x10')](_0x46696e));if(_0x46696e['error']){if(_0x46696e['error'][_0x7742('0x11')]===0x1f4){logger[_0x7742('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2634d5,_0x46696e[_0x7742('0x12')][_0x7742('0x13')]);return _0x1da94f(_0x46696e['error']['message']);}logger[_0x7742('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2634d5,_0x46696e['error']['message']);return _0x3c6ceb(_0x46696e['error'][_0x7742('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2634d5,_0x7742('0x14'));_0x3c6ceb(_0x46696e['result'][_0x7742('0x13')]);}})[_0x7742('0x15')](function(_0x1f3ffc){logger[_0x7742('0x12')](_0x7742('0x16'),_0x2634d5,_0x1f3ffc);_0x1da94f(_0x1f3ffc);});});}
\ No newline at end of file
+var _0xc901=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash'];(function(_0x2bf116,_0xb21da3){var _0x153a82=function(_0x2676ba){while(--_0x2676ba){_0x2bf116['push'](_0x2bf116['shift']());}};_0x153a82(++_0xb21da3);}(_0xc901,0x142));var _0x1c90=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc901[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 048ee6b..15793e2 100644
--- a/server/api/analyticDefaultReport/index.js
+++ b/server/api/analyticDefaultReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab72=['multer','util','path','connect-timeout','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','post','put','update','delete','destroy','exports'];(function(_0x4fef7a,_0x3cf474){var _0x21a36d=function(_0x162384){while(--_0x162384){_0x4fef7a['push'](_0x4fef7a['shift']());}};_0x21a36d(++_0x3cf474);}(_0xab72,0x6e));var _0x2ab7=function(_0x2e46df,_0x5b044b){_0x2e46df=_0x2e46df-0x0;var _0x1ef04d=_0xab72[_0x2e46df];return _0x1ef04d;};'use strict';var multer=require(_0x2ab7('0x0'));var util=require(_0x2ab7('0x1'));var path=require(_0x2ab7('0x2'));var timeout=require(_0x2ab7('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2ab7('0x4'));var controller=require(_0x2ab7('0x5'));router[_0x2ab7('0x6')]('/',auth['isAuthenticated'](),controller[_0x2ab7('0x7')]);router['get'](_0x2ab7('0x8'),auth['isAuthenticated'](),controller[_0x2ab7('0x9')]);router[_0x2ab7('0x6')](_0x2ab7('0xa'),auth[_0x2ab7('0xb')](),controller[_0x2ab7('0xc')]);router[_0x2ab7('0x6')](_0x2ab7('0xd'),auth[_0x2ab7('0xb')](),controller[_0x2ab7('0xe')]);router[_0x2ab7('0x6')](_0x2ab7('0xf'),auth[_0x2ab7('0xb')](),controller['query']);router[_0x2ab7('0x10')]('/',auth[_0x2ab7('0xb')](),controller['create']);router[_0x2ab7('0x11')](_0x2ab7('0x8'),auth[_0x2ab7('0xb')](),controller[_0x2ab7('0x12')]);router[_0x2ab7('0x13')](_0x2ab7('0x8'),auth[_0x2ab7('0xb')](),controller[_0x2ab7('0x14')]);module[_0x2ab7('0x15')]=router;
\ No newline at end of file
+var _0xe527=['/:id/run','run','/:id/query','query','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','preview'];(function(_0x3c04c2,_0x31c270){var _0x1c8878=function(_0x37c734){while(--_0x37c734){_0x3c04c2['push'](_0x3c04c2['shift']());}};_0x1c8878(++_0x31c270);}(_0xe527,0x98));var _0x7e52=function(_0x372e4a,_0x7c35a3){_0x372e4a=_0x372e4a-0x0;var _0x21054b=_0xe527[_0x372e4a];return _0x21054b;};'use strict';var multer=require(_0x7e52('0x0'));var util=require(_0x7e52('0x1'));var path=require(_0x7e52('0x2'));var timeout=require(_0x7e52('0x3'));var express=require(_0x7e52('0x4'));var router=express[_0x7e52('0x5')]();var auth=require(_0x7e52('0x6'));var interaction=require(_0x7e52('0x7'));var config=require(_0x7e52('0x8'));var controller=require(_0x7e52('0x9'));router['get']('/',auth[_0x7e52('0xa')](),controller[_0x7e52('0xb')]);router[_0x7e52('0xc')](_0x7e52('0xd'),auth[_0x7e52('0xa')](),controller[_0x7e52('0xe')]);router[_0x7e52('0xc')]('/:id/preview',auth[_0x7e52('0xa')](),controller[_0x7e52('0xf')]);router[_0x7e52('0xc')](_0x7e52('0x10'),auth['isAuthenticated'](),controller[_0x7e52('0x11')]);router[_0x7e52('0xc')](_0x7e52('0x12'),auth['isAuthenticated'](),controller[_0x7e52('0x13')]);router['post']('/',auth[_0x7e52('0xa')](),controller['create']);router[_0x7e52('0x14')](_0x7e52('0xd'),auth[_0x7e52('0xa')](),controller[_0x7e52('0x15')]);router[_0x7e52('0x16')](_0x7e52('0xd'),auth[_0x7e52('0xa')](),controller['destroy']);module[_0x7e52('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index aaa9604..c8849cf 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3cb3=['sequelize','exports','STRING','ENUM','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED'];(function(_0x1b3686,_0x479d23){var _0x13b5f9=function(_0x1a133c){while(--_0x1a133c){_0x1b3686['push'](_0x1b3686['shift']());}};_0x13b5f9(++_0x479d23);}(_0x3cb3,0x104));var _0x33cb=function(_0x4f34c3,_0x329318){_0x4f34c3=_0x4f34c3-0x0;var _0x125a00=_0x3cb3[_0x4f34c3];return _0x125a00;};'use strict';var Sequelize=require(_0x33cb('0x0'));var moment=require('moment');module[_0x33cb('0x1')]={'name':{'type':Sequelize[_0x33cb('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x33cb('0x3')]('csv','pdf',_0x33cb('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x33cb('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x33cb('0x5')]},'endDate':{'type':Sequelize[_0x33cb('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x33cb('0x6')},'type':{'type':Sequelize[_0x33cb('0x3')](_0x33cb('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x33cb('0x7')},'reportId':{'type':Sequelize[_0x33cb('0x8')](0xb)[_0x33cb('0x9')]},'reportType':{'type':Sequelize[_0x33cb('0x2')]}};
\ No newline at end of file
+var _0xb46e=['ENUM','scheduled','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','Loading'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0xb46e,0x75));var _0xeb46=function(_0x4a231f,_0x1989a6){_0x4a231f=_0x4a231f-0x0;var _0x7ea6bf=_0xb46e[_0x4a231f];return _0x7ea6bf;};'use strict';var Sequelize=require(_0xeb46('0x0'));var moment=require(_0xeb46('0x1'));module[_0xeb46('0x2')]={'name':{'type':Sequelize[_0xeb46('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xeb46('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xeb46('0x4'),_0xeb46('0x5'),_0xeb46('0x6')),'allowNull':![],'defaultValue':_0xeb46('0x4')},'savename':{'type':Sequelize[_0xeb46('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xeb46('0x7')]},'endDate':{'type':Sequelize[_0xeb46('0x7')]},'status':{'type':Sequelize[_0xeb46('0x3')],'defaultValue':_0xeb46('0x8')},'type':{'type':Sequelize[_0xeb46('0x9')]('manual',_0xeb46('0xa')),'allowNull':![],'defaultValue':_0xeb46('0xb')},'reportId':{'type':Sequelize[_0xeb46('0xc')](0xb)[_0xeb46('0xd')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 70a50d4..ed9711c 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1c43=['reject','save','then','get','destroy','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','output','join','root','server/files/reports','Sequelize','ValidationError','exists','sendStatus','savename','format','%s.%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','set','apply'];(function(_0x3082a4,_0x1a0e46){var _0x42cc2d=function(_0x1ef9d8){while(--_0x1ef9d8){_0x3082a4['push'](_0x3082a4['shift']());}};_0x42cc2d(++_0x1a0e46);}(_0x1c43,0x9c));var _0x31c4=function(_0x1f338f,_0x508d46){_0x1f338f=_0x1f338f-0x0;var _0x875ab5=_0x1c43[_0x1f338f];return _0x875ab5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x31c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31c4('0x2'));var moment=require(_0x31c4('0x3'));var BPromise=require(_0x31c4('0x4'));var Mustache=require(_0x31c4('0x5'));var util=require(_0x31c4('0x6'));var path=require(_0x31c4('0x7'));var sox=require('sox');var csv=require(_0x31c4('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x31c4('0x9'));var squel=require('squel');var crypto=require(_0x31c4('0xa'));var jsforce=require(_0x31c4('0xb'));var deskjs=require(_0x31c4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x31c4('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x31c4('0xe'));var qs=require(_0x31c4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31c4('0x10'));var logger=require(_0x31c4('0x11'))(_0x31c4('0x12'));var utils=require(_0x31c4('0x13'));var config=require(_0x31c4('0x14'));var db=require(_0x31c4('0x15'))['db'];function respondWithStatusCode(_0x18d59f,_0x4baea2){_0x4baea2=_0x4baea2||0xcc;return function(_0x506cfd){if(_0x506cfd){return _0x18d59f['sendStatus'](_0x4baea2);}return _0x18d59f[_0x31c4('0x16')](_0x4baea2)[_0x31c4('0x17')]();};}function respondWithResult(_0x5d5bae,_0xb99119){_0xb99119=_0xb99119||0xc8;return function(_0x17c9eb){if(_0x17c9eb){return _0x5d5bae['status'](_0xb99119)[_0x31c4('0x18')](_0x17c9eb);}};}function respondWithFilteredResult(_0x571775,_0x29b084){return function(_0x141507){if(_0x141507){var _0x5a9d04=_0x141507[_0x31c4('0x19')],_0x41b2ad=_0x29b084['offset'],_0x159a2b=_0x29b084['offset']+_0x29b084['limit'],_0x1494c0;if(_0x159a2b>=_0x5a9d04){_0x159a2b=_0x5a9d04;_0x1494c0=0xc8;}else{_0x1494c0=0xce;}_0x571775[_0x31c4('0x16')](_0x1494c0);return _0x571775[_0x31c4('0x1a')]('Content-Range',_0x41b2ad+'-'+_0x159a2b+'/'+_0x5a9d04)[_0x31c4('0x18')](_0x141507);}return null;};}function patchUpdates(_0x4abc95){return function(_0x4498b2){try{jsonpatch[_0x31c4('0x1b')](_0x4498b2,_0x4abc95,!![]);}catch(_0x3bc06f){return BPromise[_0x31c4('0x1c')](_0x3bc06f);}return _0x4498b2[_0x31c4('0x1d')]();};}function saveUpdates(_0x280a7e,_0x55ca57){return function(_0x1e1ed5){if(_0x1e1ed5){return _0x1e1ed5['update'](_0x280a7e)['then'](function(_0x41a166){return _0x41a166;});}return null;};}function removeEntity(_0x2cb54e,_0x407135){return function(_0x20ab17){if(_0x20ab17){return _0x20ab17['destroy']()[_0x31c4('0x1e')](function(){var _0x58980d=_0x20ab17[_0x31c4('0x1f')]({'plain':!![]});var _0x31915b='ExtractedReports';return db['UserProfileResource'][_0x31c4('0x20')]({'where':{'type':_0x31915b,'resourceId':_0x58980d['id']}})[_0x31c4('0x1e')](function(){return _0x20ab17;});})[_0x31c4('0x1e')](function(){_0x2cb54e[_0x31c4('0x16')](0xcc)[_0x31c4('0x17')]();});}};}function handleEntityNotFound(_0x419d41,_0x213023){return function(_0x55966f){if(!_0x55966f){_0x419d41['sendStatus'](0x194);}return _0x55966f;};}function handleError(_0x22f91c,_0xb7b58a){_0xb7b58a=_0xb7b58a||0x1f4;return function(_0x1aa9f6){logger['error'](_0x1aa9f6[_0x31c4('0x21')]);if(_0x1aa9f6[_0x31c4('0x22')]){delete _0x1aa9f6['name'];}_0x22f91c[_0x31c4('0x16')](_0xb7b58a)['send'](_0x1aa9f6);};}exports['index']=function(_0x115394,_0x20a14a){var _0x208af9={},_0x1a9dcb={},_0x438751={'count':0x0,'rows':[]};var _0x22b071=_[_0x31c4('0x23')](db[_0x31c4('0x24')][_0x31c4('0x25')],function(_0x18bdbd){return{'name':_0x18bdbd[_0x31c4('0x26')],'type':_0x18bdbd[_0x31c4('0x27')]['key']};});_0x1a9dcb[_0x31c4('0x28')]=_[_0x31c4('0x23')](_0x22b071,_0x31c4('0x22'));_0x1a9dcb['query']=_[_0x31c4('0x29')](_0x115394['query']);_0x1a9dcb[_0x31c4('0x2a')]=_[_0x31c4('0x2b')](_0x1a9dcb['model'],_0x1a9dcb[_0x31c4('0x2c')]);_0x208af9['attributes']=_[_0x31c4('0x2b')](_0x1a9dcb[_0x31c4('0x28')],qs[_0x31c4('0x2d')](_0x115394[_0x31c4('0x2c')][_0x31c4('0x2d')]));_0x208af9[_0x31c4('0x2e')]=_0x208af9['attributes'][_0x31c4('0x2f')]?_0x208af9[_0x31c4('0x2e')]:_0x1a9dcb[_0x31c4('0x28')];if(!_0x115394[_0x31c4('0x2c')][_0x31c4('0x30')](_0x31c4('0x31'))){_0x208af9[_0x31c4('0x32')]=qs[_0x31c4('0x32')](_0x115394[_0x31c4('0x2c')][_0x31c4('0x32')]);_0x208af9[_0x31c4('0x33')]=qs['offset'](_0x115394['query'][_0x31c4('0x33')]);}_0x208af9[_0x31c4('0x34')]=qs['sort'](_0x115394[_0x31c4('0x2c')]['sort']);_0x208af9['where']=qs[_0x31c4('0x2a')](_['pick'](_0x115394[_0x31c4('0x2c')],_0x1a9dcb[_0x31c4('0x2a')]),_0x22b071);if(_0x115394[_0x31c4('0x2c')][_0x31c4('0x35')]){_0x208af9['where']=_[_0x31c4('0x36')](_0x208af9[_0x31c4('0x37')],{'$or':_[_0x31c4('0x23')](_0x22b071,function(_0x2a534f){if(_0x2a534f[_0x31c4('0x27')]!==_0x31c4('0x38')){var _0x167d54={};_0x167d54[_0x2a534f[_0x31c4('0x22')]]={'$like':'%'+_0x115394[_0x31c4('0x2c')][_0x31c4('0x35')]+'%'};return _0x167d54;}})});}_0x208af9=_['merge']({},_0x208af9,_0x115394[_0x31c4('0x39')]);var _0x1e84e7={'where':_0x208af9['where']};return db[_0x31c4('0x24')]['count'](_0x1e84e7)[_0x31c4('0x1e')](function(_0x250077){_0x438751[_0x31c4('0x19')]=_0x250077;if(_0x115394['query'][_0x31c4('0x3a')]){_0x208af9['include']=[{'all':!![]}];}return db[_0x31c4('0x24')][_0x31c4('0x3b')](_0x208af9);})[_0x31c4('0x1e')](function(_0x11f1b1){_0x438751[_0x31c4('0x3c')]=_0x11f1b1;return _0x438751;})[_0x31c4('0x1e')](respondWithFilteredResult(_0x20a14a,_0x208af9))[_0x31c4('0x3d')](handleError(_0x20a14a,null));};exports[_0x31c4('0x3e')]=function(_0x1e4e5a,_0x256591){var _0x2b6999={'raw':!![],'where':{'id':_0x1e4e5a[_0x31c4('0x3f')]['id']}},_0x4839e5={};_0x4839e5[_0x31c4('0x28')]=_[_0x31c4('0x29')](db[_0x31c4('0x24')][_0x31c4('0x25')]);_0x4839e5[_0x31c4('0x2c')]=_[_0x31c4('0x29')](_0x1e4e5a[_0x31c4('0x2c')]);_0x4839e5['filters']=_[_0x31c4('0x2b')](_0x4839e5['model'],_0x4839e5[_0x31c4('0x2c')]);_0x2b6999['attributes']=_[_0x31c4('0x2b')](_0x4839e5['model'],qs[_0x31c4('0x2d')](_0x1e4e5a[_0x31c4('0x2c')][_0x31c4('0x2d')]));_0x2b6999['attributes']=_0x2b6999[_0x31c4('0x2e')][_0x31c4('0x2f')]?_0x2b6999[_0x31c4('0x2e')]:_0x4839e5[_0x31c4('0x28')];if(_0x1e4e5a['query']['includeAll']){_0x2b6999[_0x31c4('0x40')]=[{'all':!![]}];}_0x2b6999=_[_0x31c4('0x36')]({},_0x2b6999,_0x1e4e5a[_0x31c4('0x39')]);return db['AnalyticExtractedReport']['find'](_0x2b6999)[_0x31c4('0x1e')](handleEntityNotFound(_0x256591,null))[_0x31c4('0x1e')](respondWithResult(_0x256591,null))[_0x31c4('0x3d')](handleError(_0x256591,null));};exports[_0x31c4('0x41')]=function(_0x3ef341,_0x1b4319){return db['AnalyticExtractedReport']['create'](_0x3ef341[_0x31c4('0x42')],{})['then'](function(_0x1e1e09){var _0x10662a=_0x3ef341[_0x31c4('0x43')][_0x31c4('0x1f')]({'plain':!![]});if(!_0x10662a)throw new Error(_0x31c4('0x44'));if(_0x10662a[_0x31c4('0x45')]==='user'){var _0x177a5f=_0x1e1e09[_0x31c4('0x1f')]({'plain':!![]});var _0x27d90f=_0x31c4('0x46');return db[_0x31c4('0x47')][_0x31c4('0x48')]({'where':{'name':_0x27d90f,'userProfileId':_0x10662a[_0x31c4('0x49')]},'raw':!![]})[_0x31c4('0x1e')](function(_0x38c4d0){if(_0x38c4d0&&_0x38c4d0[_0x31c4('0x4a')]===0x0){return db[_0x31c4('0x4b')]['create']({'name':_0x177a5f['name'],'resourceId':_0x177a5f['id'],'type':_0x38c4d0[_0x31c4('0x22')],'sectionId':_0x38c4d0['id']},{})['then'](function(){return _0x1e1e09;});}else{return _0x1e1e09;}})[_0x31c4('0x3d')](function(_0x295daa){logger[_0x31c4('0x4c')](_0x31c4('0x4d'),_0x295daa);throw _0x295daa;});}return _0x1e1e09;})['then'](respondWithResult(_0x1b4319,0xc9))['catch'](handleError(_0x1b4319,null));};exports[_0x31c4('0x4e')]=function(_0x58f578,_0x53898f){if(_0x58f578[_0x31c4('0x42')]['id']){delete _0x58f578['body']['id'];}return db['AnalyticExtractedReport'][_0x31c4('0x48')]({'where':{'id':_0x58f578[_0x31c4('0x3f')]['id']}})[_0x31c4('0x1e')](handleEntityNotFound(_0x53898f,null))[_0x31c4('0x1e')](saveUpdates(_0x58f578[_0x31c4('0x42')],null))['then'](respondWithResult(_0x53898f,null))[_0x31c4('0x3d')](handleError(_0x53898f,null));};exports[_0x31c4('0x20')]=function(_0x58bbfa,_0x2360b1){return db[_0x31c4('0x24')][_0x31c4('0x48')]({'where':{'id':_0x58bbfa[_0x31c4('0x3f')]['id']}})[_0x31c4('0x1e')](handleEntityNotFound(_0x2360b1,null))[_0x31c4('0x1e')](removeEntity(_0x2360b1,null))['catch'](handleError(_0x2360b1,null));};exports[_0x31c4('0x4f')]=function(_0x100742,_0x2f792e,_0x4ab4b5){return db[_0x31c4('0x24')]['find']({'where':{'id':_0x100742['params']['id']},'attributes':[_0x31c4('0x22'),_0x31c4('0x50'),'savename',_0x31c4('0x51')],'raw':!![]})[_0x31c4('0x1e')](handleEntityNotFound(_0x2f792e,null))[_0x31c4('0x1e')](function(_0x25ad2c){if(_0x25ad2c){if(!fs['existsSync'](path[_0x31c4('0x52')](config[_0x31c4('0x53')],_0x31c4('0x54'),_0x25ad2c['savename']))){throw new db[(_0x31c4('0x55'))][(_0x31c4('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x100742[_0x31c4('0x2c')][_0x31c4('0x57')]){return _0x2f792e[_0x31c4('0x58')](0xc8);}return _0x2f792e[_0x31c4('0x4f')](path[_0x31c4('0x52')](config[_0x31c4('0x53')],_0x31c4('0x54'),_0x25ad2c[_0x31c4('0x59')]),util[_0x31c4('0x5a')](_0x31c4('0x5b'),_0x25ad2c['basename']||_0x25ad2c[_0x31c4('0x22')],_0x25ad2c[_0x31c4('0x51')]['toLowerCase']()));}})['catch'](handleError(_0x2f792e,null));};
\ No newline at end of file
+var _0x6b06=['rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','findAll','rows','catch','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','params','download','basename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','destroy','then','get','ExtractedReports','UserProfileResource','error','name','send','index','AnalyticExtractedReport'];(function(_0x2e382a,_0x539b14){var _0x32d987=function(_0x586d62){while(--_0x586d62){_0x2e382a['push'](_0x2e382a['shift']());}};_0x32d987(++_0x539b14);}(_0x6b06,0x1a6));var _0x66b0=function(_0x7c50e4,_0xf84f4){_0x7c50e4=_0x7c50e4-0x0;var _0x414711=_0x6b06[_0x7c50e4];return _0x414711;};'use strict';var pdf=require(_0x66b0('0x0'));var emlformat=require(_0x66b0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x66b0('0x2'));var jsonpatch=require(_0x66b0('0x3'));var rp=require(_0x66b0('0x4'));var moment=require('moment');var BPromise=require(_0x66b0('0x5'));var Mustache=require(_0x66b0('0x6'));var util=require('util');var path=require(_0x66b0('0x7'));var sox=require(_0x66b0('0x8'));var csv=require(_0x66b0('0x9'));var ejs=require(_0x66b0('0xa'));var fs=require('fs');var _=require(_0x66b0('0xb'));var squel=require(_0x66b0('0xc'));var crypto=require(_0x66b0('0xd'));var jsforce=require(_0x66b0('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x66b0('0xf'));var authService=require(_0x66b0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x66b0('0x11'));var hardwareService=require(_0x66b0('0x12'));var logger=require(_0x66b0('0x13'))('api');var utils=require(_0x66b0('0x14'));var config=require(_0x66b0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ae1ce,_0xded61f){_0xded61f=_0xded61f||0xcc;return function(_0xcaada5){if(_0xcaada5){return _0x5ae1ce[_0x66b0('0x16')](_0xded61f);}return _0x5ae1ce['status'](_0xded61f)[_0x66b0('0x17')]();};}function respondWithResult(_0x3a4da2,_0x3a9724){_0x3a9724=_0x3a9724||0xc8;return function(_0x1bff58){if(_0x1bff58){return _0x3a4da2[_0x66b0('0x18')](_0x3a9724)['json'](_0x1bff58);}};}function respondWithFilteredResult(_0x33b372,_0x33f394){return function(_0x4ff682){if(_0x4ff682){var _0x25fb60=_0x4ff682[_0x66b0('0x19')],_0x2b0d90=_0x33f394[_0x66b0('0x1a')],_0x381cca=_0x33f394[_0x66b0('0x1a')]+_0x33f394[_0x66b0('0x1b')],_0x19a445;if(_0x381cca>=_0x25fb60){_0x381cca=_0x25fb60;_0x19a445=0xc8;}else{_0x19a445=0xce;}_0x33b372[_0x66b0('0x18')](_0x19a445);return _0x33b372[_0x66b0('0x1c')](_0x66b0('0x1d'),_0x2b0d90+'-'+_0x381cca+'/'+_0x25fb60)[_0x66b0('0x1e')](_0x4ff682);}return null;};}function patchUpdates(_0x207d44){return function(_0x53ff35){try{jsonpatch[_0x66b0('0x1f')](_0x53ff35,_0x207d44,!![]);}catch(_0x5d15b2){return BPromise['reject'](_0x5d15b2);}return _0x53ff35[_0x66b0('0x20')]();};}function saveUpdates(_0x56db00,_0x590af0){return function(_0x50661a){if(_0x50661a){return _0x50661a['update'](_0x56db00)['then'](function(_0x6d780){return _0x6d780;});}return null;};}function removeEntity(_0x1745b7,_0x3712fb){return function(_0x474222){if(_0x474222){return _0x474222[_0x66b0('0x21')]()[_0x66b0('0x22')](function(){var _0x7ecb70=_0x474222[_0x66b0('0x23')]({'plain':!![]});var _0x2f069e=_0x66b0('0x24');return db[_0x66b0('0x25')]['destroy']({'where':{'type':_0x2f069e,'resourceId':_0x7ecb70['id']}})[_0x66b0('0x22')](function(){return _0x474222;});})[_0x66b0('0x22')](function(){_0x1745b7[_0x66b0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53d06d,_0x37ef58){return function(_0x3a6481){if(!_0x3a6481){_0x53d06d['sendStatus'](0x194);}return _0x3a6481;};}function handleError(_0x3210f0,_0x1d28cc){_0x1d28cc=_0x1d28cc||0x1f4;return function(_0x4cfde){logger[_0x66b0('0x26')](_0x4cfde['stack']);if(_0x4cfde['name']){delete _0x4cfde[_0x66b0('0x27')];}_0x3210f0[_0x66b0('0x18')](_0x1d28cc)[_0x66b0('0x28')](_0x4cfde);};}exports[_0x66b0('0x29')]=function(_0x52a226,_0x3ef813){var _0x265890={},_0x1543dc={},_0x512fb8={'count':0x0,'rows':[]};var _0x190502=_['map'](db[_0x66b0('0x2a')][_0x66b0('0x2b')],function(_0x28361c){return{'name':_0x28361c[_0x66b0('0x2c')],'type':_0x28361c[_0x66b0('0x2d')][_0x66b0('0x2e')]};});_0x1543dc[_0x66b0('0x2f')]=_['map'](_0x190502,'name');_0x1543dc[_0x66b0('0x30')]=_['keys'](_0x52a226[_0x66b0('0x30')]);_0x1543dc[_0x66b0('0x31')]=_[_0x66b0('0x32')](_0x1543dc[_0x66b0('0x2f')],_0x1543dc[_0x66b0('0x30')]);_0x265890['attributes']=_[_0x66b0('0x32')](_0x1543dc[_0x66b0('0x2f')],qs['fields'](_0x52a226[_0x66b0('0x30')][_0x66b0('0x33')]));_0x265890[_0x66b0('0x34')]=_0x265890[_0x66b0('0x34')][_0x66b0('0x35')]?_0x265890[_0x66b0('0x34')]:_0x1543dc[_0x66b0('0x2f')];if(!_0x52a226['query']['hasOwnProperty'](_0x66b0('0x36'))){_0x265890[_0x66b0('0x1b')]=qs[_0x66b0('0x1b')](_0x52a226[_0x66b0('0x30')][_0x66b0('0x1b')]);_0x265890[_0x66b0('0x1a')]=qs[_0x66b0('0x1a')](_0x52a226[_0x66b0('0x30')][_0x66b0('0x1a')]);}_0x265890[_0x66b0('0x37')]=qs[_0x66b0('0x38')](_0x52a226[_0x66b0('0x30')]['sort']);_0x265890[_0x66b0('0x39')]=qs[_0x66b0('0x31')](_[_0x66b0('0x3a')](_0x52a226[_0x66b0('0x30')],_0x1543dc[_0x66b0('0x31')]),_0x190502);if(_0x52a226[_0x66b0('0x30')]['filter']){_0x265890['where']=_[_0x66b0('0x3b')](_0x265890['where'],{'$or':_[_0x66b0('0x3c')](_0x190502,function(_0xac7621){if(_0xac7621[_0x66b0('0x2d')]!==_0x66b0('0x3d')){var _0x1ccc65={};_0x1ccc65[_0xac7621[_0x66b0('0x27')]]={'$like':'%'+_0x52a226[_0x66b0('0x30')][_0x66b0('0x3e')]+'%'};return _0x1ccc65;}})});}_0x265890=_[_0x66b0('0x3b')]({},_0x265890,_0x52a226[_0x66b0('0x3f')]);var _0x49e137={'where':_0x265890[_0x66b0('0x39')]};return db[_0x66b0('0x2a')][_0x66b0('0x19')](_0x49e137)[_0x66b0('0x22')](function(_0x41207a){_0x512fb8['count']=_0x41207a;if(_0x52a226[_0x66b0('0x30')]['includeAll']){_0x265890['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x66b0('0x40')](_0x265890);})[_0x66b0('0x22')](function(_0x3e9170){_0x512fb8[_0x66b0('0x41')]=_0x3e9170;return _0x512fb8;})[_0x66b0('0x22')](respondWithFilteredResult(_0x3ef813,_0x265890))[_0x66b0('0x42')](handleError(_0x3ef813,null));};exports['show']=function(_0x26aa13,_0x252fb1){var _0x5cf3d9={'raw':!![],'where':{'id':_0x26aa13['params']['id']}},_0x82bf68={};_0x82bf68[_0x66b0('0x2f')]=_[_0x66b0('0x43')](db[_0x66b0('0x2a')]['rawAttributes']);_0x82bf68['query']=_['keys'](_0x26aa13[_0x66b0('0x30')]);_0x82bf68[_0x66b0('0x31')]=_[_0x66b0('0x32')](_0x82bf68[_0x66b0('0x2f')],_0x82bf68[_0x66b0('0x30')]);_0x5cf3d9[_0x66b0('0x34')]=_[_0x66b0('0x32')](_0x82bf68['model'],qs[_0x66b0('0x33')](_0x26aa13['query'][_0x66b0('0x33')]));_0x5cf3d9[_0x66b0('0x34')]=_0x5cf3d9['attributes'][_0x66b0('0x35')]?_0x5cf3d9[_0x66b0('0x34')]:_0x82bf68[_0x66b0('0x2f')];if(_0x26aa13[_0x66b0('0x30')][_0x66b0('0x44')]){_0x5cf3d9[_0x66b0('0x45')]=[{'all':!![]}];}_0x5cf3d9=_[_0x66b0('0x3b')]({},_0x5cf3d9,_0x26aa13[_0x66b0('0x3f')]);return db[_0x66b0('0x2a')]['find'](_0x5cf3d9)[_0x66b0('0x22')](handleEntityNotFound(_0x252fb1,null))[_0x66b0('0x22')](respondWithResult(_0x252fb1,null))[_0x66b0('0x42')](handleError(_0x252fb1,null));};exports[_0x66b0('0x46')]=function(_0x1b9d7f,_0x338e8f){return db[_0x66b0('0x2a')][_0x66b0('0x46')](_0x1b9d7f[_0x66b0('0x47')],{})[_0x66b0('0x22')](function(_0x22caa6){var _0x4da0ac=_0x1b9d7f[_0x66b0('0x48')][_0x66b0('0x23')]({'plain':!![]});if(!_0x4da0ac)throw new Error(_0x66b0('0x49'));if(_0x4da0ac[_0x66b0('0x4a')]==='user'){var _0x49efb9=_0x22caa6[_0x66b0('0x23')]({'plain':!![]});var _0x56ed18='ExtractedReports';return db[_0x66b0('0x4b')][_0x66b0('0x4c')]({'where':{'name':_0x56ed18,'userProfileId':_0x4da0ac[_0x66b0('0x4d')]},'raw':!![]})[_0x66b0('0x22')](function(_0x243610){if(_0x243610&&_0x243610[_0x66b0('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x49efb9[_0x66b0('0x27')],'resourceId':_0x49efb9['id'],'type':_0x243610[_0x66b0('0x27')],'sectionId':_0x243610['id']},{})['then'](function(){return _0x22caa6;});}else{return _0x22caa6;}})['catch'](function(_0x37550c){logger[_0x66b0('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37550c);throw _0x37550c;});}return _0x22caa6;})[_0x66b0('0x22')](respondWithResult(_0x338e8f,0xc9))['catch'](handleError(_0x338e8f,null));};exports[_0x66b0('0x4f')]=function(_0x817670,_0xd9b963){if(_0x817670[_0x66b0('0x47')]['id']){delete _0x817670['body']['id'];}return db[_0x66b0('0x2a')][_0x66b0('0x4c')]({'where':{'id':_0x817670['params']['id']}})[_0x66b0('0x22')](handleEntityNotFound(_0xd9b963,null))[_0x66b0('0x22')](saveUpdates(_0x817670[_0x66b0('0x47')],null))[_0x66b0('0x22')](respondWithResult(_0xd9b963,null))[_0x66b0('0x42')](handleError(_0xd9b963,null));};exports[_0x66b0('0x21')]=function(_0x8840e5,_0x451b3d){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x8840e5[_0x66b0('0x50')]['id']}})['then'](handleEntityNotFound(_0x451b3d,null))[_0x66b0('0x22')](removeEntity(_0x451b3d,null))[_0x66b0('0x42')](handleError(_0x451b3d,null));};exports[_0x66b0('0x51')]=function(_0x5d3d7e,_0x2f48ce,_0x27bdb4){return db[_0x66b0('0x2a')][_0x66b0('0x4c')]({'where':{'id':_0x5d3d7e['params']['id']},'attributes':[_0x66b0('0x27'),_0x66b0('0x52'),'savename',_0x66b0('0x53')],'raw':!![]})[_0x66b0('0x22')](handleEntityNotFound(_0x2f48ce,null))[_0x66b0('0x22')](function(_0x73c6d8){if(_0x73c6d8){if(!fs[_0x66b0('0x54')](path[_0x66b0('0x55')](config[_0x66b0('0x56')],_0x66b0('0x57'),_0x73c6d8['savename']))){throw new db[(_0x66b0('0x58'))][(_0x66b0('0x59'))](_0x66b0('0x5a'));}if(_0x5d3d7e['query'][_0x66b0('0x5b')]){return _0x2f48ce[_0x66b0('0x16')](0xc8);}return _0x2f48ce[_0x66b0('0x51')](path[_0x66b0('0x55')](config[_0x66b0('0x56')],'server/files/reports',_0x73c6d8['savename']),util['format'](_0x66b0('0x5c'),_0x73c6d8[_0x66b0('0x52')]||_0x73c6d8['name'],_0x73c6d8[_0x66b0('0x53')]['toLowerCase']()));}})[_0x66b0('0x42')](handleError(_0x2f48ce,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 906f421..b4a6bf5 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1ab8=['rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1ab8,0x173));var _0x81ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1ab8[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x81ab('0x0'));var util=require(_0x81ab('0x1'));var logger=require(_0x81ab('0x2'))('api');var moment=require('moment');var BPromise=require(_0x81ab('0x3'));var rp=require(_0x81ab('0x4'));var fs=require('fs');var path=require(_0x81ab('0x5'));var rimraf=require(_0x81ab('0x6'));var config=require(_0x81ab('0x7'));var attributes=require(_0x81ab('0x8'));module[_0x81ab('0x9')]=function(_0x260d68,_0x5e96ab){return _0x260d68[_0x81ab('0xa')](_0x81ab('0xb'),attributes,{'tableName':_0x81ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8142=['request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x27ff49,_0x3779a3){var _0x1eccfe=function(_0x2961fb){while(--_0x2961fb){_0x27ff49['push'](_0x27ff49['shift']());}};_0x1eccfe(++_0x3779a3);}(_0x8142,0x174));var _0x2814=function(_0x9ba307,_0x570631){_0x9ba307=_0x9ba307-0x0;var _0x335d04=_0x8142[_0x9ba307];return _0x335d04;};'use strict';var _=require(_0x2814('0x0'));var util=require('util');var logger=require(_0x2814('0x1'))(_0x2814('0x2'));var moment=require(_0x2814('0x3'));var BPromise=require(_0x2814('0x4'));var rp=require(_0x2814('0x5'));var fs=require('fs');var path=require(_0x2814('0x6'));var rimraf=require('rimraf');var config=require(_0x2814('0x7'));var attributes=require(_0x2814('0x8'));module[_0x2814('0x9')]=function(_0x4fb8e9,_0x2eb969){return _0x4fb8e9[_0x2814('0xa')](_0x2814('0xb'),attributes,{'tableName':_0x2814('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 2260ac1..ffa5649 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe288=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x428800,_0x4ae1b5){var _0x2c614c=function(_0x324212){while(--_0x324212){_0x428800['push'](_0x428800['shift']());}};_0x2c614c(++_0x4ae1b5);}(_0xe288,0x1e9));var _0x8e28=function(_0x49b59f,_0x1f3a28){_0x49b59f=_0x49b59f-0x0;var _0x46f0de=_0xe288[_0x49b59f];return _0x46f0de;};'use strict';var _=require(_0x8e28('0x0'));var util=require(_0x8e28('0x1'));var moment=require(_0x8e28('0x2'));var BPromise=require(_0x8e28('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e28('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e28('0x5'));var logger=require(_0x8e28('0x6'))('rpc');var config=require(_0x8e28('0x7'));var jayson=require(_0x8e28('0x8'));var client=jayson[_0x8e28('0x9')][_0x8e28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5061d1,_0x65ec69,_0x2451fb){return new BPromise(function(_0xdb8bdf,_0x2c9a77){return client[_0x8e28('0xb')](_0x5061d1,_0x2451fb)[_0x8e28('0xc')](function(_0x10861f){logger[_0x8e28('0xd')](_0x8e28('0xe'),_0x65ec69,'request\x20sent');logger[_0x8e28('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x65ec69,_0x8e28('0x10'),JSON[_0x8e28('0x11')](_0x10861f));if(_0x10861f[_0x8e28('0x12')]){if(_0x10861f['error'][_0x8e28('0x13')]===0x1f4){logger[_0x8e28('0x12')](_0x8e28('0xe'),_0x65ec69,_0x10861f[_0x8e28('0x12')][_0x8e28('0x14')]);return _0x2c9a77(_0x10861f['error'][_0x8e28('0x14')]);}logger['error'](_0x8e28('0xe'),_0x65ec69,_0x10861f[_0x8e28('0x12')]['message']);return _0xdb8bdf(_0x10861f[_0x8e28('0x12')]['message']);}else{logger[_0x8e28('0xd')](_0x8e28('0xe'),_0x65ec69,_0x8e28('0x10'));_0xdb8bdf(_0x10861f[_0x8e28('0x15')][_0x8e28('0x14')]);}})[_0x8e28('0x16')](function(_0x1a7f75){logger[_0x8e28('0x12')](_0x8e28('0xe'),_0x65ec69,_0x1a7f75);_0x2c9a77(_0x1a7f75);});});}
\ No newline at end of file
+var _0x47d2=['jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4e04d5,_0x4db867){var _0x3e6db0=function(_0x3cc667){while(--_0x3cc667){_0x4e04d5['push'](_0x4e04d5['shift']());}};_0x3e6db0(++_0x4db867);}(_0x47d2,0x18f));var _0x247d=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0x47d2[_0x126f47];return _0x49508a;};'use strict';var _=require(_0x247d('0x0'));var util=require(_0x247d('0x1'));var moment=require(_0x247d('0x2'));var BPromise=require(_0x247d('0x3'));var rs=require(_0x247d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x247d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x247d('0x6'))(_0x247d('0x7'));var config=require(_0x247d('0x8'));var jayson=require(_0x247d('0x9'));var client=jayson[_0x247d('0xa')][_0x247d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x357a46,_0x48c088,_0x213820){return new BPromise(function(_0x57a1a9,_0x1002b7){return client[_0x247d('0xc')](_0x357a46,_0x213820)[_0x247d('0xd')](function(_0x22d9d9){logger['info'](_0x247d('0xe'),_0x48c088,_0x247d('0xf'));logger[_0x247d('0x10')](_0x247d('0x11'),_0x48c088,_0x247d('0xf'),JSON[_0x247d('0x12')](_0x22d9d9));if(_0x22d9d9[_0x247d('0x13')]){if(_0x22d9d9[_0x247d('0x13')]['code']===0x1f4){logger['error'](_0x247d('0xe'),_0x48c088,_0x22d9d9[_0x247d('0x13')][_0x247d('0x14')]);return _0x1002b7(_0x22d9d9[_0x247d('0x13')][_0x247d('0x14')]);}logger[_0x247d('0x13')](_0x247d('0xe'),_0x48c088,_0x22d9d9[_0x247d('0x13')]['message']);return _0x57a1a9(_0x22d9d9[_0x247d('0x13')]['message']);}else{logger[_0x247d('0x15')](_0x247d('0xe'),_0x48c088,'request\x20sent');_0x57a1a9(_0x22d9d9[_0x247d('0x16')][_0x247d('0x14')]);}})[_0x247d('0x17')](function(_0x325851){logger[_0x247d('0x13')](_0x247d('0xe'),_0x48c088,_0x325851);_0x1002b7(_0x325851);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index a60666b..2485dea 100644
--- a/server/api/analyticExtractedReport/index.js
+++ b/server/api/analyticExtractedReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7235=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x75ce5b,_0x3b582f){var _0x22195e=function(_0x166668){while(--_0x166668){_0x75ce5b['push'](_0x75ce5b['shift']());}};_0x22195e(++_0x3b582f);}(_0x7235,0x77));var _0x5723=function(_0x272b72,_0x263a86){_0x272b72=_0x272b72-0x0;var _0xdfda4d=_0x7235[_0x272b72];return _0xdfda4d;};'use strict';var multer=require(_0x5723('0x0'));var util=require(_0x5723('0x1'));var path=require(_0x5723('0x2'));var timeout=require(_0x5723('0x3'));var express=require('express');var router=express[_0x5723('0x4')]();var auth=require(_0x5723('0x5'));var interaction=require(_0x5723('0x6'));var config=require(_0x5723('0x7'));var controller=require(_0x5723('0x8'));router[_0x5723('0x9')]('/',auth[_0x5723('0xa')](),controller[_0x5723('0xb')]);router[_0x5723('0x9')](_0x5723('0xc'),auth[_0x5723('0xa')](),controller[_0x5723('0xd')]);router[_0x5723('0x9')](_0x5723('0xe'),auth[_0x5723('0xa')](),controller[_0x5723('0xf')]);router[_0x5723('0x10')]('/',auth['isAuthenticated'](),controller[_0x5723('0x11')]);router[_0x5723('0x12')](_0x5723('0xc'),auth['isAuthenticated'](),controller[_0x5723('0x13')]);router[_0x5723('0x14')](_0x5723('0xc'),auth[_0x5723('0xa')](),controller[_0x5723('0x15')]);module[_0x5723('0x16')]=router;
\ No newline at end of file
+var _0x09b7=['/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show'];(function(_0x2cc3c1,_0x4230e2){var _0x3f56b1=function(_0x5a1f25){while(--_0x5a1f25){_0x2cc3c1['push'](_0x2cc3c1['shift']());}};_0x3f56b1(++_0x4230e2);}(_0x09b7,0x6d));var _0x709b=function(_0x14a62c,_0x5c77e1){_0x14a62c=_0x14a62c-0x0;var _0x5bab14=_0x09b7[_0x14a62c];return _0x5bab14;};'use strict';var multer=require(_0x709b('0x0'));var util=require(_0x709b('0x1'));var path=require(_0x709b('0x2'));var timeout=require(_0x709b('0x3'));var express=require(_0x709b('0x4'));var router=express['Router']();var auth=require(_0x709b('0x5'));var interaction=require(_0x709b('0x6'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x709b('0x7')](),controller['index']);router[_0x709b('0x8')](_0x709b('0x9'),auth[_0x709b('0x7')](),controller[_0x709b('0xa')]);router[_0x709b('0x8')](_0x709b('0xb'),auth[_0x709b('0x7')](),controller[_0x709b('0xc')]);router[_0x709b('0xd')]('/',auth['isAuthenticated'](),controller[_0x709b('0xe')]);router[_0x709b('0xf')](_0x709b('0x9'),auth[_0x709b('0x7')](),controller[_0x709b('0x10')]);router[_0x709b('0x11')](_0x709b('0x9'),auth[_0x709b('0x7')](),controller[_0x709b('0x12')]);module[_0x709b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 6378bef..409365e 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x161fd2,_0x130510){var _0x164182=function(_0x505a92){while(--_0x505a92){_0x161fd2['push'](_0x161fd2['shift']());}};_0x164182(++_0x130510);}(_0x7a54,0x106));var _0x47a5=function(_0x31101e,_0x4368c3){_0x31101e=_0x31101e-0x0;var _0x20afa0=_0x7a54[_0x31101e];return _0x20afa0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'field':{'type':Sequelize[_0x47a5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x47a5('0x3')]},'format':{'type':Sequelize[_0x47a5('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x47a5('0x3')]},'custom':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5fc3=['sequelize','exports','STRING','BOOLEAN'];(function(_0x274f85,_0x80a1b9){var _0x39de7e=function(_0x5365c2){while(--_0x5365c2){_0x274f85['push'](_0x274f85['shift']());}};_0x39de7e(++_0x80a1b9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x5fc3[_0x4ca6a4];return _0x120555;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x35fc('0x2')]},'function':{'type':Sequelize[_0x35fc('0x2')]},'format':{'type':Sequelize[_0x35fc('0x2')]},'groupBy':{'type':Sequelize[_0x35fc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x35fc('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 1d84b2e..19266f3 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.controller.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5db6=['../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','AnalyticFieldReport','includeAll','rows','catch','show','fields','include','find','create','bulkCreate','body','update','params','destroy','bulkDestroy','findOne','sequelize','transaction','CustomReportId','findAll','html-pdf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x4b7fdc,_0x3e29ce){var _0x32a791=function(_0x387c32){while(--_0x387c32){_0x4b7fdc['push'](_0x4b7fdc['shift']());}};_0x32a791(++_0x3e29ce);}(_0x5db6,0x88));var _0x65db=function(_0xcf807,_0x4c736b){_0xcf807=_0xcf807-0x0;var _0x2ef9e9=_0x5db6[_0xcf807];return _0x2ef9e9;};'use strict';var pdf=require(_0x65db('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x65db('0x1'));var moment=require(_0x65db('0x2'));var BPromise=require(_0x65db('0x3'));var Mustache=require(_0x65db('0x4'));var util=require(_0x65db('0x5'));var path=require(_0x65db('0x6'));var sox=require(_0x65db('0x7'));var csv=require(_0x65db('0x8'));var ejs=require(_0x65db('0x9'));var fs=require('fs');var _=require(_0x65db('0xa'));var squel=require(_0x65db('0xb'));var crypto=require(_0x65db('0xc'));var jsforce=require(_0x65db('0xd'));var deskjs=require(_0x65db('0xe'));var toCsv=require(_0x65db('0x8'));var querystring=require(_0x65db('0xf'));var Papa=require(_0x65db('0x10'));var Redis=require(_0x65db('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x65db('0x12'));var as=require(_0x65db('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x65db('0x14'));var utils=require(_0x65db('0x15'));var config=require(_0x65db('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37a6f7,_0x3e994a){_0x3e994a=_0x3e994a||0xcc;return function(_0x17c929){if(_0x17c929){return _0x37a6f7['sendStatus'](_0x3e994a);}return _0x37a6f7[_0x65db('0x17')](_0x3e994a)['end']();};}function respondWithResult(_0x2ffc30,_0x419602){_0x419602=_0x419602||0xc8;return function(_0x488cf0){if(_0x488cf0){return _0x2ffc30[_0x65db('0x17')](_0x419602)[_0x65db('0x18')](_0x488cf0);}};}function respondWithFilteredResult(_0x472e28,_0x32c985){return function(_0x2c6c3f){if(_0x2c6c3f){var _0x424af1=_0x2c6c3f[_0x65db('0x19')],_0x22ab95=_0x32c985['offset'],_0x30fcf8=_0x32c985[_0x65db('0x1a')]+_0x32c985[_0x65db('0x1b')],_0x374f4d;if(_0x30fcf8>=_0x424af1){_0x30fcf8=_0x424af1;_0x374f4d=0xc8;}else{_0x374f4d=0xce;}_0x472e28[_0x65db('0x17')](_0x374f4d);return _0x472e28[_0x65db('0x1c')](_0x65db('0x1d'),_0x22ab95+'-'+_0x30fcf8+'/'+_0x424af1)[_0x65db('0x18')](_0x2c6c3f);}return null;};}function patchUpdates(_0x83c0d){return function(_0x2c4137){try{jsonpatch[_0x65db('0x1e')](_0x2c4137,_0x83c0d,!![]);}catch(_0x39fe17){return BPromise[_0x65db('0x1f')](_0x39fe17);}return _0x2c4137[_0x65db('0x20')]();};}function saveUpdates(_0x21142c,_0x16a635){return function(_0x4fb336){if(_0x4fb336){return _0x4fb336['update'](_0x21142c)[_0x65db('0x21')](function(_0x59cc7f){return _0x59cc7f;});}return null;};}function removeEntity(_0x35c0c4,_0x976d53){return function(_0x97ce7e){if(_0x97ce7e){return _0x97ce7e['destroy']()[_0x65db('0x21')](function(){_0x35c0c4[_0x65db('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x175733,_0x175da5){return function(_0x2d0dcb){if(!_0x2d0dcb){_0x175733[_0x65db('0x22')](0x194);}return _0x2d0dcb;};}function handleError(_0x19aff2,_0x2e2d1d){_0x2e2d1d=_0x2e2d1d||0x1f4;return function(_0x18a79b){logger['error'](_0x18a79b[_0x65db('0x23')]);if(_0x18a79b[_0x65db('0x24')]){delete _0x18a79b['name'];}_0x19aff2[_0x65db('0x17')](_0x2e2d1d)[_0x65db('0x25')](_0x18a79b);};}exports[_0x65db('0x26')]=function(_0x144268,_0x4416ef){var _0x4be47f={},_0x733e08={},_0x5a8277={'count':0x0,'rows':[]};var _0x5f34f2=_['map'](db['AnalyticFieldReport'][_0x65db('0x27')],function(_0x17482c){return{'name':_0x17482c[_0x65db('0x28')],'type':_0x17482c['type']['key']};});_0x733e08[_0x65db('0x29')]=_[_0x65db('0x2a')](_0x5f34f2,_0x65db('0x24'));_0x733e08[_0x65db('0x2b')]=_[_0x65db('0x2c')](_0x144268[_0x65db('0x2b')]);_0x733e08[_0x65db('0x2d')]=_[_0x65db('0x2e')](_0x733e08[_0x65db('0x29')],_0x733e08['query']);_0x4be47f['attributes']=_['intersection'](_0x733e08[_0x65db('0x29')],qs['fields'](_0x144268['query']['fields']));_0x4be47f['attributes']=_0x4be47f[_0x65db('0x2f')][_0x65db('0x30')]?_0x4be47f[_0x65db('0x2f')]:_0x733e08[_0x65db('0x29')];if(!_0x144268['query'][_0x65db('0x31')](_0x65db('0x32'))){_0x4be47f['limit']=qs[_0x65db('0x1b')](_0x144268[_0x65db('0x2b')][_0x65db('0x1b')]);_0x4be47f[_0x65db('0x1a')]=qs['offset'](_0x144268[_0x65db('0x2b')][_0x65db('0x1a')]);}_0x4be47f[_0x65db('0x33')]=qs[_0x65db('0x34')](_0x144268[_0x65db('0x2b')]['sort']);_0x4be47f[_0x65db('0x35')]=qs[_0x65db('0x2d')](_[_0x65db('0x36')](_0x144268[_0x65db('0x2b')],_0x733e08[_0x65db('0x2d')]),_0x5f34f2);if(_0x144268['query'][_0x65db('0x37')]){_0x4be47f[_0x65db('0x35')]=_['merge'](_0x4be47f[_0x65db('0x35')],{'$or':_['map'](_0x5f34f2,function(_0x110729){if(_0x110729[_0x65db('0x38')]!=='VIRTUAL'){var _0xfe7519={};_0xfe7519[_0x110729[_0x65db('0x24')]]={'$like':'%'+_0x144268[_0x65db('0x2b')][_0x65db('0x37')]+'%'};return _0xfe7519;}})});}_0x4be47f=_[_0x65db('0x39')]({},_0x4be47f,_0x144268[_0x65db('0x3a')]);var _0x5ee82f={'where':_0x4be47f[_0x65db('0x35')]};return db[_0x65db('0x3b')][_0x65db('0x19')](_0x5ee82f)[_0x65db('0x21')](function(_0x1ab691){_0x5a8277[_0x65db('0x19')]=_0x1ab691;if(_0x144268[_0x65db('0x2b')][_0x65db('0x3c')]){_0x4be47f['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x4be47f);})[_0x65db('0x21')](function(_0x368077){_0x5a8277[_0x65db('0x3d')]=_0x368077;return _0x5a8277;})[_0x65db('0x21')](respondWithFilteredResult(_0x4416ef,_0x4be47f))[_0x65db('0x3e')](handleError(_0x4416ef,null));};exports[_0x65db('0x3f')]=function(_0x386b07,_0x564591){var _0x5d9b25={'raw':![],'where':{'id':_0x386b07['params']['id']}},_0x2c8326={};_0x2c8326['model']=_[_0x65db('0x2c')](db[_0x65db('0x3b')][_0x65db('0x27')]);_0x2c8326[_0x65db('0x2b')]=_['keys'](_0x386b07['query']);_0x2c8326['filters']=_[_0x65db('0x2e')](_0x2c8326['model'],_0x2c8326[_0x65db('0x2b')]);_0x5d9b25[_0x65db('0x2f')]=_[_0x65db('0x2e')](_0x2c8326[_0x65db('0x29')],qs['fields'](_0x386b07['query'][_0x65db('0x40')]));_0x5d9b25['attributes']=_0x5d9b25[_0x65db('0x2f')][_0x65db('0x30')]?_0x5d9b25['attributes']:_0x2c8326[_0x65db('0x29')];if(_0x386b07['query'][_0x65db('0x3c')]){_0x5d9b25[_0x65db('0x41')]=[{'all':!![]}];}_0x5d9b25=_[_0x65db('0x39')]({},_0x5d9b25,_0x386b07['options']);return db[_0x65db('0x3b')][_0x65db('0x42')](_0x5d9b25)[_0x65db('0x21')](handleEntityNotFound(_0x564591,null))['then'](respondWithResult(_0x564591,null))['catch'](handleError(_0x564591,null));};exports['create']=function(_0x4a6e28,_0xa90472){return db['AnalyticFieldReport'][_0x65db('0x43')](_0x4a6e28['body'],{})[_0x65db('0x21')](respondWithResult(_0xa90472,0xc9))[_0x65db('0x3e')](handleError(_0xa90472,null));};exports[_0x65db('0x44')]=function(_0x74fd96,_0x3dedad){return db[_0x65db('0x3b')]['bulkCreate'](_0x74fd96[_0x65db('0x45')],{'raw':![],'individualHooks':!![]})[_0x65db('0x21')](respondWithResult(_0x3dedad,0xc9))[_0x65db('0x3e')](handleError(_0x3dedad,null));};exports[_0x65db('0x46')]=function(_0x5a27ec,_0x5a9608){if(_0x5a27ec[_0x65db('0x45')]['id']){delete _0x5a27ec[_0x65db('0x45')]['id'];}return db[_0x65db('0x3b')][_0x65db('0x42')]({'where':{'id':_0x5a27ec[_0x65db('0x47')]['id']}})[_0x65db('0x21')](handleEntityNotFound(_0x5a9608,null))[_0x65db('0x21')](saveUpdates(_0x5a27ec[_0x65db('0x45')],null))[_0x65db('0x21')](respondWithResult(_0x5a9608,null))[_0x65db('0x3e')](handleError(_0x5a9608,null));};exports[_0x65db('0x48')]=function(_0x19fb1d,_0x5813ce){return db[_0x65db('0x3b')]['find']({'where':{'id':_0x19fb1d[_0x65db('0x47')]['id']}})['then'](handleEntityNotFound(_0x5813ce,null))[_0x65db('0x21')](removeEntity(_0x5813ce,null))[_0x65db('0x3e')](handleError(_0x5813ce,null));};exports[_0x65db('0x49')]=function(_0x4c060d,_0x3f1c30){return db[_0x65db('0x3b')][_0x65db('0x48')]({'where':{'id':_0x4c060d[_0x65db('0x2b')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x65db('0x21')](respondWithResult(_0x3f1c30,0xcc))[_0x65db('0x3e')](handleError(_0x3f1c30,null));};exports['addFields']=function(_0x250226,_0x405d5a,_0x5be339){return db['AnalyticCustomReport'][_0x65db('0x4a')]({'where':{'id':_0x250226['params']['id']}})['then'](handleEntityNotFound(_0x405d5a,null))[_0x65db('0x21')](function(_0x5bd2f1){if(_0x5bd2f1){return db[_0x65db('0x4b')][_0x65db('0x4c')](function(_0x342ad6){return db[_0x65db('0x3b')][_0x65db('0x48')]({'where':{'CustomReportId':_0x250226[_0x65db('0x47')]['id']},'transaction':_0x342ad6})[_0x65db('0x21')](function(_0x3bff7f){var _0x145467=_[_0x65db('0x2a')](_0x250226[_0x65db('0x45')],function(_0x1d756d){delete _0x1d756d['id'];_0x1d756d[_0x65db('0x4d')]=_0x250226[_0x65db('0x47')]['id'];return _0x1d756d;});return db[_0x65db('0x3b')][_0x65db('0x44')](_0x145467,{'transaction':_0x342ad6});});})[_0x65db('0x21')](function(){return db[_0x65db('0x3b')][_0x65db('0x4e')]({'where':{'CustomReportId':_0x250226['params']['id']}});});}})[_0x65db('0x21')](respondWithResult(_0x405d5a,null))[_0x65db('0x3e')](handleError(_0x405d5a,null));};
\ No newline at end of file
+var _0xce0d=['sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','limit','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0xce0d,0x9e));var _0xdce0=function(_0x2f3b86,_0x1fffad){_0x2f3b86=_0x2f3b86-0x0;var _0x9741a0=_0xce0d[_0x2f3b86];return _0x9741a0;};'use strict';var pdf=require(_0xdce0('0x0'));var emlformat=require(_0xdce0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdce0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdce0('0x3'));var moment=require(_0xdce0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdce0('0x5'));var util=require(_0xdce0('0x6'));var path=require(_0xdce0('0x7'));var sox=require(_0xdce0('0x8'));var csv=require(_0xdce0('0x9'));var ejs=require(_0xdce0('0xa'));var fs=require('fs');var _=require(_0xdce0('0xb'));var squel=require('squel');var crypto=require(_0xdce0('0xc'));var jsforce=require(_0xdce0('0xd'));var deskjs=require(_0xdce0('0xe'));var toCsv=require(_0xdce0('0x9'));var querystring=require('querystring');var Papa=require(_0xdce0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdce0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdce0('0x11'));var logger=require(_0xdce0('0x12'))(_0xdce0('0x13'));var utils=require(_0xdce0('0x14'));var config=require(_0xdce0('0x15'));var db=require(_0xdce0('0x16'))['db'];function respondWithStatusCode(_0x3e83ab,_0x3ffb8d){_0x3ffb8d=_0x3ffb8d||0xcc;return function(_0x101d6d){if(_0x101d6d){return _0x3e83ab['sendStatus'](_0x3ffb8d);}return _0x3e83ab[_0xdce0('0x17')](_0x3ffb8d)[_0xdce0('0x18')]();};}function respondWithResult(_0x153235,_0x1f6137){_0x1f6137=_0x1f6137||0xc8;return function(_0x4f12d6){if(_0x4f12d6){return _0x153235[_0xdce0('0x17')](_0x1f6137)[_0xdce0('0x19')](_0x4f12d6);}};}function respondWithFilteredResult(_0x2fc277,_0x598f94){return function(_0xf6ae27){if(_0xf6ae27){var _0xdf56e1=_0xf6ae27[_0xdce0('0x1a')],_0x1a3cca=_0x598f94['offset'],_0xda42b4=_0x598f94['offset']+_0x598f94[_0xdce0('0x1b')],_0x3dbe56;if(_0xda42b4>=_0xdf56e1){_0xda42b4=_0xdf56e1;_0x3dbe56=0xc8;}else{_0x3dbe56=0xce;}_0x2fc277[_0xdce0('0x17')](_0x3dbe56);return _0x2fc277[_0xdce0('0x1c')](_0xdce0('0x1d'),_0x1a3cca+'-'+_0xda42b4+'/'+_0xdf56e1)['json'](_0xf6ae27);}return null;};}function patchUpdates(_0x394f9a){return function(_0x22ee61){try{jsonpatch['apply'](_0x22ee61,_0x394f9a,!![]);}catch(_0x5dec8){return BPromise['reject'](_0x5dec8);}return _0x22ee61[_0xdce0('0x1e')]();};}function saveUpdates(_0x5a1a4f,_0x3cd318){return function(_0x3fe316){if(_0x3fe316){return _0x3fe316[_0xdce0('0x1f')](_0x5a1a4f)['then'](function(_0x589ac2){return _0x589ac2;});}return null;};}function removeEntity(_0x483210,_0x3e5137){return function(_0xd220ad){if(_0xd220ad){return _0xd220ad[_0xdce0('0x20')]()[_0xdce0('0x21')](function(){_0x483210[_0xdce0('0x17')](0xcc)[_0xdce0('0x18')]();});}};}function handleEntityNotFound(_0x589af6,_0x988b15){return function(_0x5a3bbb){if(!_0x5a3bbb){_0x589af6[_0xdce0('0x22')](0x194);}return _0x5a3bbb;};}function handleError(_0x41f93b,_0x19718c){_0x19718c=_0x19718c||0x1f4;return function(_0x187d3f){logger[_0xdce0('0x23')](_0x187d3f[_0xdce0('0x24')]);if(_0x187d3f[_0xdce0('0x25')]){delete _0x187d3f[_0xdce0('0x25')];}_0x41f93b['status'](_0x19718c)['send'](_0x187d3f);};}exports[_0xdce0('0x26')]=function(_0x1d4d6b,_0x1d8d38){var _0x29ac72={},_0x34fbea={},_0x40ec25={'count':0x0,'rows':[]};var _0x3e0a11=_[_0xdce0('0x27')](db[_0xdce0('0x28')][_0xdce0('0x29')],function(_0x5989c7){return{'name':_0x5989c7[_0xdce0('0x2a')],'type':_0x5989c7[_0xdce0('0x2b')][_0xdce0('0x2c')]};});_0x34fbea['model']=_[_0xdce0('0x27')](_0x3e0a11,_0xdce0('0x25'));_0x34fbea[_0xdce0('0x2d')]=_[_0xdce0('0x2e')](_0x1d4d6b[_0xdce0('0x2d')]);_0x34fbea[_0xdce0('0x2f')]=_[_0xdce0('0x30')](_0x34fbea[_0xdce0('0x31')],_0x34fbea['query']);_0x29ac72[_0xdce0('0x32')]=_[_0xdce0('0x30')](_0x34fbea[_0xdce0('0x31')],qs['fields'](_0x1d4d6b['query']['fields']));_0x29ac72[_0xdce0('0x32')]=_0x29ac72[_0xdce0('0x32')][_0xdce0('0x33')]?_0x29ac72['attributes']:_0x34fbea[_0xdce0('0x31')];if(!_0x1d4d6b[_0xdce0('0x2d')][_0xdce0('0x34')](_0xdce0('0x35'))){_0x29ac72[_0xdce0('0x1b')]=qs[_0xdce0('0x1b')](_0x1d4d6b[_0xdce0('0x2d')][_0xdce0('0x1b')]);_0x29ac72[_0xdce0('0x36')]=qs['offset'](_0x1d4d6b[_0xdce0('0x2d')][_0xdce0('0x36')]);}_0x29ac72[_0xdce0('0x37')]=qs[_0xdce0('0x38')](_0x1d4d6b[_0xdce0('0x2d')]['sort']);_0x29ac72[_0xdce0('0x39')]=qs['filters'](_[_0xdce0('0x3a')](_0x1d4d6b[_0xdce0('0x2d')],_0x34fbea[_0xdce0('0x2f')]),_0x3e0a11);if(_0x1d4d6b['query'][_0xdce0('0x3b')]){_0x29ac72[_0xdce0('0x39')]=_['merge'](_0x29ac72['where'],{'$or':_[_0xdce0('0x27')](_0x3e0a11,function(_0x556985){if(_0x556985[_0xdce0('0x2b')]!==_0xdce0('0x3c')){var _0x263ea0={};_0x263ea0[_0x556985['name']]={'$like':'%'+_0x1d4d6b[_0xdce0('0x2d')][_0xdce0('0x3b')]+'%'};return _0x263ea0;}})});}_0x29ac72=_[_0xdce0('0x3d')]({},_0x29ac72,_0x1d4d6b[_0xdce0('0x3e')]);var _0x15af81={'where':_0x29ac72[_0xdce0('0x39')]};return db['AnalyticFieldReport'][_0xdce0('0x1a')](_0x15af81)['then'](function(_0x57be7f){_0x40ec25[_0xdce0('0x1a')]=_0x57be7f;if(_0x1d4d6b[_0xdce0('0x2d')][_0xdce0('0x3f')]){_0x29ac72['include']=[{'all':!![]}];}return db[_0xdce0('0x28')][_0xdce0('0x40')](_0x29ac72);})[_0xdce0('0x21')](function(_0x16acec){_0x40ec25[_0xdce0('0x41')]=_0x16acec;return _0x40ec25;})[_0xdce0('0x21')](respondWithFilteredResult(_0x1d8d38,_0x29ac72))[_0xdce0('0x42')](handleError(_0x1d8d38,null));};exports[_0xdce0('0x43')]=function(_0xd64e2f,_0x22ea1f){var _0x3e8ff7={'raw':![],'where':{'id':_0xd64e2f[_0xdce0('0x44')]['id']}},_0x2630cd={};_0x2630cd[_0xdce0('0x31')]=_[_0xdce0('0x2e')](db[_0xdce0('0x28')]['rawAttributes']);_0x2630cd[_0xdce0('0x2d')]=_[_0xdce0('0x2e')](_0xd64e2f[_0xdce0('0x2d')]);_0x2630cd[_0xdce0('0x2f')]=_[_0xdce0('0x30')](_0x2630cd[_0xdce0('0x31')],_0x2630cd[_0xdce0('0x2d')]);_0x3e8ff7[_0xdce0('0x32')]=_[_0xdce0('0x30')](_0x2630cd[_0xdce0('0x31')],qs[_0xdce0('0x45')](_0xd64e2f['query'][_0xdce0('0x45')]));_0x3e8ff7[_0xdce0('0x32')]=_0x3e8ff7[_0xdce0('0x32')][_0xdce0('0x33')]?_0x3e8ff7[_0xdce0('0x32')]:_0x2630cd['model'];if(_0xd64e2f[_0xdce0('0x2d')][_0xdce0('0x3f')]){_0x3e8ff7[_0xdce0('0x46')]=[{'all':!![]}];}_0x3e8ff7=_['merge']({},_0x3e8ff7,_0xd64e2f[_0xdce0('0x3e')]);return db[_0xdce0('0x28')][_0xdce0('0x47')](_0x3e8ff7)[_0xdce0('0x21')](handleEntityNotFound(_0x22ea1f,null))['then'](respondWithResult(_0x22ea1f,null))[_0xdce0('0x42')](handleError(_0x22ea1f,null));};exports[_0xdce0('0x48')]=function(_0x11e065,_0x50c9e5){return db[_0xdce0('0x28')][_0xdce0('0x48')](_0x11e065[_0xdce0('0x49')],{})['then'](respondWithResult(_0x50c9e5,0xc9))[_0xdce0('0x42')](handleError(_0x50c9e5,null));};exports['bulkCreate']=function(_0x9c672e,_0x491f1f){return db[_0xdce0('0x28')][_0xdce0('0x4a')](_0x9c672e[_0xdce0('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x491f1f,0xc9))[_0xdce0('0x42')](handleError(_0x491f1f,null));};exports['update']=function(_0x3ed7c,_0x18285c){if(_0x3ed7c[_0xdce0('0x49')]['id']){delete _0x3ed7c[_0xdce0('0x49')]['id'];}return db[_0xdce0('0x28')][_0xdce0('0x47')]({'where':{'id':_0x3ed7c['params']['id']}})['then'](handleEntityNotFound(_0x18285c,null))[_0xdce0('0x21')](saveUpdates(_0x3ed7c['body'],null))['then'](respondWithResult(_0x18285c,null))[_0xdce0('0x42')](handleError(_0x18285c,null));};exports[_0xdce0('0x20')]=function(_0x3a23ff,_0x473beb){return db['AnalyticFieldReport']['find']({'where':{'id':_0x3a23ff[_0xdce0('0x44')]['id']}})['then'](handleEntityNotFound(_0x473beb,null))[_0xdce0('0x21')](removeEntity(_0x473beb,null))[_0xdce0('0x42')](handleError(_0x473beb,null));};exports[_0xdce0('0x4b')]=function(_0x1d574f,_0x204a0d){return db[_0xdce0('0x28')]['destroy']({'where':{'id':_0x1d574f[_0xdce0('0x2d')][_0xdce0('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xdce0('0x21')](respondWithResult(_0x204a0d,0xcc))['catch'](handleError(_0x204a0d,null));};exports[_0xdce0('0x4d')]=function(_0x88e14e,_0x48a256,_0x10f4f3){return db[_0xdce0('0x4e')][_0xdce0('0x4f')]({'where':{'id':_0x88e14e[_0xdce0('0x44')]['id']}})[_0xdce0('0x21')](handleEntityNotFound(_0x48a256,null))['then'](function(_0x3802d8){if(_0x3802d8){return db[_0xdce0('0x50')][_0xdce0('0x51')](function(_0x4da406){return db[_0xdce0('0x28')][_0xdce0('0x20')]({'where':{'CustomReportId':_0x88e14e[_0xdce0('0x44')]['id']},'transaction':_0x4da406})['then'](function(_0xc7c965){var _0x390d6b=_['map'](_0x88e14e[_0xdce0('0x49')],function(_0x10aae7){delete _0x10aae7['id'];_0x10aae7[_0xdce0('0x52')]=_0x88e14e[_0xdce0('0x44')]['id'];return _0x10aae7;});return db[_0xdce0('0x28')][_0xdce0('0x4a')](_0x390d6b,{'transaction':_0x4da406});});})[_0xdce0('0x21')](function(){return db[_0xdce0('0x28')][_0xdce0('0x40')]({'where':{'CustomReportId':_0x88e14e['params']['id']}});});}})[_0xdce0('0x21')](respondWithResult(_0x48a256,null))[_0xdce0('0x42')](handleError(_0x48a256,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index d4114eb..e27ebe4 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.model.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c67=['analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','AnalyticFieldReport'];(function(_0x133cb5,_0x606cc2){var _0x415d1a=function(_0x1227d0){while(--_0x1227d0){_0x133cb5['push'](_0x133cb5['shift']());}};_0x415d1a(++_0x606cc2);}(_0x7c67,0x1b1));var _0x77c6=function(_0x2e3ebf,_0x1dbfff){_0x2e3ebf=_0x2e3ebf-0x0;var _0x529402=_0x7c67[_0x2e3ebf];return _0x529402;};'use strict';var _=require(_0x77c6('0x0'));var util=require(_0x77c6('0x1'));var logger=require(_0x77c6('0x2'))(_0x77c6('0x3'));var moment=require('moment');var BPromise=require(_0x77c6('0x4'));var rp=require(_0x77c6('0x5'));var fs=require('fs');var path=require(_0x77c6('0x6'));var rimraf=require(_0x77c6('0x7'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x77c6('0x8')]=function(_0x55917c,_0x21bdb9){return _0x55917c[_0x77c6('0x9')](_0x77c6('0xa'),attributes,{'tableName':_0x77c6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe4e9=['util','moment','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x436a53,_0x4adce7){var _0x1519b2=function(_0x29d00d){while(--_0x29d00d){_0x436a53['push'](_0x436a53['shift']());}};_0x1519b2(++_0x4adce7);}(_0xe4e9,0x107));var _0x9e4e=function(_0x385a3d,_0x54f54f){_0x385a3d=_0x385a3d-0x0;var _0x4aec93=_0xe4e9[_0x385a3d];return _0x4aec93;};'use strict';var _=require(_0x9e4e('0x0'));var util=require(_0x9e4e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9e4e('0x2'));var BPromise=require(_0x9e4e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9e4e('0x4'));var config=require(_0x9e4e('0x5'));var attributes=require(_0x9e4e('0x6'));module[_0x9e4e('0x7')]=function(_0x237ded,_0x48649a){return _0x237ded[_0x9e4e('0x8')](_0x9e4e('0x9'),attributes,{'tableName':_0x9e4e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 33e0aa4..d9f0461 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x97ce=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0x97ce,0x1b1));var _0xe97c=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x97ce[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var util=require(_0xe97c('0x0'));var moment=require('moment');var BPromise=require(_0xe97c('0x1'));var rs=require(_0xe97c('0x2'));var fs=require('fs');var Redis=require(_0xe97c('0x3'));var db=require(_0xe97c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe97c('0x5'))(_0xe97c('0x6'));var config=require(_0xe97c('0x7'));var jayson=require(_0xe97c('0x8'));var client=jayson[_0xe97c('0x9')][_0xe97c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f803e,_0x1e8e2a,_0x57e7c6){return new BPromise(function(_0x309406,_0x55f6ff){return client[_0xe97c('0xb')](_0x3f803e,_0x57e7c6)[_0xe97c('0xc')](function(_0x1b0fb6){logger[_0xe97c('0xd')](_0xe97c('0xe'),_0x1e8e2a,_0xe97c('0xf'));logger[_0xe97c('0x10')](_0xe97c('0x11'),_0x1e8e2a,_0xe97c('0xf'),JSON[_0xe97c('0x12')](_0x1b0fb6));if(_0x1b0fb6[_0xe97c('0x13')]){if(_0x1b0fb6[_0xe97c('0x13')]['code']===0x1f4){logger[_0xe97c('0x13')](_0xe97c('0xe'),_0x1e8e2a,_0x1b0fb6[_0xe97c('0x13')][_0xe97c('0x14')]);return _0x55f6ff(_0x1b0fb6[_0xe97c('0x13')][_0xe97c('0x14')]);}logger[_0xe97c('0x13')](_0xe97c('0xe'),_0x1e8e2a,_0x1b0fb6[_0xe97c('0x13')]['message']);return _0x309406(_0x1b0fb6[_0xe97c('0x13')][_0xe97c('0x14')]);}else{logger[_0xe97c('0xd')](_0xe97c('0xe'),_0x1e8e2a,_0xe97c('0xf'));_0x309406(_0x1b0fb6[_0xe97c('0x15')][_0xe97c('0x14')]);}})[_0xe97c('0x16')](function(_0x52076d){logger[_0xe97c('0x13')](_0xe97c('0xe'),_0x1e8e2a,_0x52076d);_0x55f6ff(_0x52076d);});});}
\ No newline at end of file
+var _0x0583=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x26b889,_0x217971){var _0xe0e1fd=function(_0x252a93){while(--_0x252a93){_0x26b889['push'](_0x26b889['shift']());}};_0xe0e1fd(++_0x217971);}(_0x0583,0x104));var _0x3058=function(_0x1568ad,_0x3167f7){_0x1568ad=_0x1568ad-0x0;var _0x2850f4=_0x0583[_0x1568ad];return _0x2850f4;};'use strict';var _=require(_0x3058('0x0'));var util=require('util');var moment=require(_0x3058('0x1'));var BPromise=require(_0x3058('0x2'));var rs=require(_0x3058('0x3'));var fs=require('fs');var Redis=require(_0x3058('0x4'));var db=require(_0x3058('0x5'))['db'];var utils=require(_0x3058('0x6'));var logger=require('../../config/logger')(_0x3058('0x7'));var config=require('../../config/environment');var jayson=require(_0x3058('0x8'));var client=jayson[_0x3058('0x9')][_0x3058('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39d25a,_0x3c8efc,_0x1ee4a9){return new BPromise(function(_0x35c7b6,_0x1d272c){return client['request'](_0x39d25a,_0x1ee4a9)[_0x3058('0xb')](function(_0x5ee076){logger[_0x3058('0xc')](_0x3058('0xd'),_0x3c8efc,_0x3058('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3c8efc,_0x3058('0xe'),JSON['stringify'](_0x5ee076));if(_0x5ee076[_0x3058('0xf')]){if(_0x5ee076['error'][_0x3058('0x10')]===0x1f4){logger[_0x3058('0xf')](_0x3058('0xd'),_0x3c8efc,_0x5ee076[_0x3058('0xf')][_0x3058('0x11')]);return _0x1d272c(_0x5ee076['error'][_0x3058('0x11')]);}logger[_0x3058('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3c8efc,_0x5ee076['error']['message']);return _0x35c7b6(_0x5ee076['error'][_0x3058('0x11')]);}else{logger[_0x3058('0xc')](_0x3058('0xd'),_0x3c8efc,_0x3058('0xe'));_0x35c7b6(_0x5ee076[_0x3058('0x12')][_0x3058('0x11')]);}})[_0x3058('0x13')](function(_0x2b29c4){logger[_0x3058('0xf')](_0x3058('0xd'),_0x3c8efc,_0x2b29c4);_0x1d272c(_0x2b29c4);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index bad524b..491289e 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','post','/create_many','bulkCreate','/:id/create_many','put','update','delete','/destroy_many','bulkDestroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./analyticFieldReport.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xc')](_0x7995('0xd'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xc')](_0x7995('0xf'),auth[_0x7995('0x9')](),controller['addFields']);router[_0x7995('0x10')](_0x7995('0xb'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x12')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router;
\ No newline at end of file
+var _0x55ca=['/:id/create_many','addFields','put','update','delete','bulkDestroy','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','bulkCreate'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x55ca,0x126));var _0xa55c=function(_0x4d121d,_0x3fe733){_0x4d121d=_0x4d121d-0x0;var _0xffa031=_0x55ca[_0x4d121d];return _0xffa031;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0xb')]('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xb')]('/create_many',auth['isAuthenticated'](),controller[_0xa55c('0xd')]);router[_0xa55c('0xb')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x10')](_0xa55c('0x9'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/destroy_many',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 3d5f48a..56c9986 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56fe=['sequelize','exports','STRING','TEXT'];(function(_0xe36641,_0x3fc318){var _0x1a5724=function(_0x3c7b8c){while(--_0x3c7b8c){_0xe36641['push'](_0xe36641['shift']());}};_0x1a5724(++_0x3fc318);}(_0x56fe,0xe4));var _0xe56f=function(_0x5a26d5,_0x317a00){_0x5a26d5=_0x5a26d5-0x0;var _0x1e6190=_0x56fe[_0x5a26d5];return _0x1e6190;};'use strict';var Sequelize=require(_0xe56f('0x0'));module[_0xe56f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xe56f('0x2')]},'metric':{'type':Sequelize[_0xe56f('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1cf6=['exports','STRING','name','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cf6,0x1a4));var _0x61cf=function(_0x597715,_0x38c49e){_0x597715=_0x597715-0x0;var _0x47db90=_0x1cf6[_0x597715];return _0x47db90;};'use strict';var Sequelize=require('sequelize');module[_0x61cf('0x0')]={'name':{'type':Sequelize[_0x61cf('0x1')],'allowNull':![],'unique':_0x61cf('0x2')},'table':{'type':Sequelize[_0x61cf('0x1')]},'metric':{'type':Sequelize[_0x61cf('0x3')]},'description':{'type':Sequelize[_0x61cf('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index ea7f88f..106c02f 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb03e=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','Metrics','destroy','error','stack','index','rawAttributes','map','name','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','AnalyticMetric','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash'];(function(_0x2be3b1,_0x58685a){var _0x54dc5b=function(_0x56e6f2){while(--_0x56e6f2){_0x2be3b1['push'](_0x2be3b1['shift']());}};_0x54dc5b(++_0x58685a);}(_0xb03e,0x1eb));var _0xeb03=function(_0x343d89,_0x15a898){_0x343d89=_0x343d89-0x0;var _0x2b8089=_0xb03e[_0x343d89];return _0x2b8089;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeb03('0x0'));var rimraf=require(_0xeb03('0x1'));var zipdir=require(_0xeb03('0x2'));var jsonpatch=require(_0xeb03('0x3'));var rp=require(_0xeb03('0x4'));var moment=require(_0xeb03('0x5'));var BPromise=require(_0xeb03('0x6'));var Mustache=require(_0xeb03('0x7'));var util=require(_0xeb03('0x8'));var path=require(_0xeb03('0x9'));var sox=require(_0xeb03('0xa'));var csv=require(_0xeb03('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xb'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var db=require(_0xeb03('0x19'))['db'];function respondWithStatusCode(_0x45481b,_0x367d36){_0x367d36=_0x367d36||0xcc;return function(_0x384cbe){if(_0x384cbe){return _0x45481b[_0xeb03('0x1a')](_0x367d36);}return _0x45481b[_0xeb03('0x1b')](_0x367d36)[_0xeb03('0x1c')]();};}function respondWithResult(_0x3bebc6,_0x4d9c8e){_0x4d9c8e=_0x4d9c8e||0xc8;return function(_0x212082){if(_0x212082){return _0x3bebc6[_0xeb03('0x1b')](_0x4d9c8e)[_0xeb03('0x1d')](_0x212082);}};}function respondWithFilteredResult(_0x33f9ba,_0x52be5b){return function(_0x15f4fe){if(_0x15f4fe){var _0x36f5d8=_0x15f4fe[_0xeb03('0x1e')],_0x3f26ef=_0x52be5b[_0xeb03('0x1f')],_0x478989=_0x52be5b[_0xeb03('0x1f')]+_0x52be5b[_0xeb03('0x20')],_0x7ce874;if(_0x478989>=_0x36f5d8){_0x478989=_0x36f5d8;_0x7ce874=0xc8;}else{_0x7ce874=0xce;}_0x33f9ba[_0xeb03('0x1b')](_0x7ce874);return _0x33f9ba[_0xeb03('0x21')](_0xeb03('0x22'),_0x3f26ef+'-'+_0x478989+'/'+_0x36f5d8)[_0xeb03('0x1d')](_0x15f4fe);}return null;};}function patchUpdates(_0x469d25){return function(_0x456fb3){try{jsonpatch[_0xeb03('0x23')](_0x456fb3,_0x469d25,!![]);}catch(_0x2443d9){return BPromise[_0xeb03('0x24')](_0x2443d9);}return _0x456fb3['save']();};}function saveUpdates(_0x1bea3f,_0x3855dd){return function(_0x413d3e){if(_0x413d3e){return _0x413d3e[_0xeb03('0x25')](_0x1bea3f)[_0xeb03('0x26')](function(_0x31e406){return _0x31e406;});}return null;};}function removeEntity(_0xb98dc1,_0x2c795b){return function(_0x3c3d09){if(_0x3c3d09){return _0x3c3d09['destroy']()[_0xeb03('0x26')](function(){var _0x1707ec=_0x3c3d09[_0xeb03('0x27')]({'plain':!![]});var _0x300dc0=_0xeb03('0x28');return db['UserProfileResource'][_0xeb03('0x29')]({'where':{'type':_0x300dc0,'resourceId':_0x1707ec['id']}})[_0xeb03('0x26')](function(){return _0x3c3d09;});})[_0xeb03('0x26')](function(){_0xb98dc1[_0xeb03('0x1b')](0xcc)[_0xeb03('0x1c')]();});}};}function handleEntityNotFound(_0x119697,_0xb04f34){return function(_0x3f68f3){if(!_0x3f68f3){_0x119697[_0xeb03('0x1a')](0x194);}return _0x3f68f3;};}function handleError(_0x4984f6,_0x832372){_0x832372=_0x832372||0x1f4;return function(_0x1b2c7b){logger[_0xeb03('0x2a')](_0x1b2c7b[_0xeb03('0x2b')]);if(_0x1b2c7b['name']){delete _0x1b2c7b['name'];}_0x4984f6[_0xeb03('0x1b')](_0x832372)['send'](_0x1b2c7b);};}exports[_0xeb03('0x2c')]=function(_0x8bd544,_0x160a37){var _0x5db8bb={},_0xd4c8ec={},_0x5de53a={'count':0x0,'rows':[]};var _0x5cb729=_['map'](db['AnalyticMetric'][_0xeb03('0x2d')],function(_0x433ce8){return{'name':_0x433ce8['fieldName'],'type':_0x433ce8['type']['key']};});_0xd4c8ec['model']=_[_0xeb03('0x2e')](_0x5cb729,_0xeb03('0x2f'));_0xd4c8ec[_0xeb03('0x30')]=_[_0xeb03('0x31')](_0x8bd544[_0xeb03('0x30')]);_0xd4c8ec['filters']=_[_0xeb03('0x32')](_0xd4c8ec['model'],_0xd4c8ec[_0xeb03('0x30')]);_0x5db8bb[_0xeb03('0x33')]=_[_0xeb03('0x32')](_0xd4c8ec[_0xeb03('0x34')],qs[_0xeb03('0x35')](_0x8bd544[_0xeb03('0x30')][_0xeb03('0x35')]));_0x5db8bb[_0xeb03('0x33')]=_0x5db8bb['attributes'][_0xeb03('0x36')]?_0x5db8bb['attributes']:_0xd4c8ec[_0xeb03('0x34')];if(!_0x8bd544[_0xeb03('0x30')][_0xeb03('0x37')](_0xeb03('0x38'))){_0x5db8bb[_0xeb03('0x20')]=qs[_0xeb03('0x20')](_0x8bd544['query'][_0xeb03('0x20')]);_0x5db8bb['offset']=qs['offset'](_0x8bd544['query'][_0xeb03('0x1f')]);}_0x5db8bb[_0xeb03('0x39')]=qs[_0xeb03('0x3a')](_0x8bd544[_0xeb03('0x30')][_0xeb03('0x3a')]);_0x5db8bb['where']=qs[_0xeb03('0x3b')](_[_0xeb03('0x3c')](_0x8bd544[_0xeb03('0x30')],_0xd4c8ec['filters']),_0x5cb729);if(_0x8bd544['query'][_0xeb03('0x3d')]){_0x5db8bb[_0xeb03('0x3e')]=_[_0xeb03('0x3f')](_0x5db8bb['where'],{'$or':_[_0xeb03('0x2e')](_0x5cb729,function(_0x392729){if(_0x392729['type']!=='VIRTUAL'){var _0x4621da={};_0x4621da[_0x392729[_0xeb03('0x2f')]]={'$like':'%'+_0x8bd544['query'][_0xeb03('0x3d')]+'%'};return _0x4621da;}})});}_0x5db8bb=_[_0xeb03('0x3f')]({},_0x5db8bb,_0x8bd544[_0xeb03('0x40')]);var _0x1d28ec={'where':_0x5db8bb[_0xeb03('0x3e')]};return db[_0xeb03('0x41')][_0xeb03('0x1e')](_0x1d28ec)[_0xeb03('0x26')](function(_0x20ebe8){_0x5de53a[_0xeb03('0x1e')]=_0x20ebe8;if(_0x8bd544[_0xeb03('0x30')][_0xeb03('0x42')]){_0x5db8bb[_0xeb03('0x43')]=[{'all':!![]}];}return db[_0xeb03('0x41')][_0xeb03('0x44')](_0x5db8bb);})[_0xeb03('0x26')](function(_0x407f0b){_0x5de53a[_0xeb03('0x45')]=_0x407f0b;return _0x5de53a;})[_0xeb03('0x26')](respondWithFilteredResult(_0x160a37,_0x5db8bb))[_0xeb03('0x46')](handleError(_0x160a37,null));};exports[_0xeb03('0x47')]=function(_0x2f83c3,_0x2879b0){var _0x5bb7d9={'raw':!![],'where':{'id':_0x2f83c3[_0xeb03('0x48')]['id']}},_0x53c406={};_0x53c406[_0xeb03('0x34')]=_[_0xeb03('0x31')](db[_0xeb03('0x41')][_0xeb03('0x2d')]);_0x53c406[_0xeb03('0x30')]=_[_0xeb03('0x31')](_0x2f83c3[_0xeb03('0x30')]);_0x53c406['filters']=_[_0xeb03('0x32')](_0x53c406[_0xeb03('0x34')],_0x53c406[_0xeb03('0x30')]);_0x5bb7d9[_0xeb03('0x33')]=_[_0xeb03('0x32')](_0x53c406['model'],qs['fields'](_0x2f83c3[_0xeb03('0x30')]['fields']));_0x5bb7d9['attributes']=_0x5bb7d9['attributes'][_0xeb03('0x36')]?_0x5bb7d9[_0xeb03('0x33')]:_0x53c406[_0xeb03('0x34')];if(_0x2f83c3[_0xeb03('0x30')][_0xeb03('0x42')]){_0x5bb7d9[_0xeb03('0x43')]=[{'all':!![]}];}_0x5bb7d9=_['merge']({},_0x5bb7d9,_0x2f83c3[_0xeb03('0x40')]);return db['AnalyticMetric']['find'](_0x5bb7d9)[_0xeb03('0x26')](handleEntityNotFound(_0x2879b0,null))[_0xeb03('0x26')](respondWithResult(_0x2879b0,null))[_0xeb03('0x46')](handleError(_0x2879b0,null));};exports['create']=function(_0x404191,_0x9c8073){return db[_0xeb03('0x41')][_0xeb03('0x49')](_0x404191[_0xeb03('0x4a')],{})['then'](function(_0x21a121){var _0x4dc1f6=_0x404191[_0xeb03('0x4b')][_0xeb03('0x27')]({'plain':!![]});if(!_0x4dc1f6)throw new Error(_0xeb03('0x4c'));if(_0x4dc1f6[_0xeb03('0x4d')]===_0xeb03('0x4b')){var _0x46f4a7=_0x21a121[_0xeb03('0x27')]({'plain':!![]});var _0x292319=_0xeb03('0x28');return db[_0xeb03('0x4e')][_0xeb03('0x4f')]({'where':{'name':_0x292319,'userProfileId':_0x4dc1f6[_0xeb03('0x50')]},'raw':!![]})[_0xeb03('0x26')](function(_0x345a98){if(_0x345a98&&_0x345a98[_0xeb03('0x51')]===0x0){return db[_0xeb03('0x52')][_0xeb03('0x49')]({'name':_0x46f4a7[_0xeb03('0x2f')],'resourceId':_0x46f4a7['id'],'type':_0x345a98[_0xeb03('0x2f')],'sectionId':_0x345a98['id']},{})[_0xeb03('0x26')](function(){return _0x21a121;});}else{return _0x21a121;}})[_0xeb03('0x46')](function(_0x333fba){logger[_0xeb03('0x2a')](_0xeb03('0x53'),_0x333fba);throw _0x333fba;});}return _0x21a121;})['then'](respondWithResult(_0x9c8073,0xc9))[_0xeb03('0x46')](handleError(_0x9c8073,null));};exports[_0xeb03('0x25')]=function(_0x415c18,_0x5405b4){if(_0x415c18[_0xeb03('0x4a')]['id']){delete _0x415c18[_0xeb03('0x4a')]['id'];}return db[_0xeb03('0x41')][_0xeb03('0x4f')]({'where':{'id':_0x415c18[_0xeb03('0x48')]['id']}})[_0xeb03('0x26')](handleEntityNotFound(_0x5405b4,null))[_0xeb03('0x26')](saveUpdates(_0x415c18[_0xeb03('0x4a')],null))[_0xeb03('0x26')](respondWithResult(_0x5405b4,null))[_0xeb03('0x46')](handleError(_0x5405b4,null));};exports[_0xeb03('0x29')]=function(_0x25de1f,_0xf9beaf){return db[_0xeb03('0x41')]['find']({'where':{'id':_0x25de1f[_0xeb03('0x48')]['id']}})[_0xeb03('0x26')](handleEntityNotFound(_0xf9beaf,null))[_0xeb03('0x26')](removeEntity(_0xf9beaf,null))[_0xeb03('0x46')](handleError(_0xf9beaf,null));};
\ No newline at end of file
+var _0x49f8=['order','sort','where','filters','pick','merge','filter','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','UserProfileSection','userProfileId','autoAssociation','html-pdf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','json','apply','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x2b4277,_0x3e72f2){var _0x16af13=function(_0xb2ada0){while(--_0xb2ada0){_0x2b4277['push'](_0x2b4277['shift']());}};_0x16af13(++_0x3e72f2);}(_0x49f8,0xff));var _0x849f=function(_0x18f82b,_0x3ea7a0){_0x18f82b=_0x18f82b-0x0;var _0x5d8128=_0x49f8[_0x18f82b];return _0x5d8128;};'use strict';var pdf=require(_0x849f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x849f('0x1'));var jsonpatch=require(_0x849f('0x2'));var rp=require('request-promise');var moment=require(_0x849f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x849f('0x4'));var util=require('util');var path=require(_0x849f('0x5'));var sox=require('sox');var csv=require(_0x849f('0x6'));var ejs=require(_0x849f('0x7'));var fs=require('fs');var _=require(_0x849f('0x8'));var squel=require(_0x849f('0x9'));var crypto=require(_0x849f('0xa'));var jsforce=require(_0x849f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x849f('0xc'));var Redis=require(_0x849f('0xd'));var authService=require(_0x849f('0xe'));var qs=require(_0x849f('0xf'));var as=require(_0x849f('0x10'));var hardwareService=require(_0x849f('0x11'));var logger=require(_0x849f('0x12'))('api');var utils=require(_0x849f('0x13'));var config=require('../../config/environment');var db=require(_0x849f('0x14'))['db'];function respondWithStatusCode(_0x25b276,_0x401480){_0x401480=_0x401480||0xcc;return function(_0x23c0ef){if(_0x23c0ef){return _0x25b276['sendStatus'](_0x401480);}return _0x25b276[_0x849f('0x15')](_0x401480)[_0x849f('0x16')]();};}function respondWithResult(_0x1155c7,_0x425d0c){_0x425d0c=_0x425d0c||0xc8;return function(_0x176936){if(_0x176936){return _0x1155c7['status'](_0x425d0c)['json'](_0x176936);}};}function respondWithFilteredResult(_0x448867,_0x5952d7){return function(_0x26845f){if(_0x26845f){var _0x204330=_0x26845f[_0x849f('0x17')],_0x45b940=_0x5952d7[_0x849f('0x18')],_0x252de4=_0x5952d7['offset']+_0x5952d7[_0x849f('0x19')],_0x3e721f;if(_0x252de4>=_0x204330){_0x252de4=_0x204330;_0x3e721f=0xc8;}else{_0x3e721f=0xce;}_0x448867[_0x849f('0x15')](_0x3e721f);return _0x448867[_0x849f('0x1a')]('Content-Range',_0x45b940+'-'+_0x252de4+'/'+_0x204330)[_0x849f('0x1b')](_0x26845f);}return null;};}function patchUpdates(_0x364c9b){return function(_0x5b84db){try{jsonpatch[_0x849f('0x1c')](_0x5b84db,_0x364c9b,!![]);}catch(_0x52beb7){return BPromise['reject'](_0x52beb7);}return _0x5b84db['save']();};}function saveUpdates(_0x240ea4,_0x11d183){return function(_0x1dc579){if(_0x1dc579){return _0x1dc579[_0x849f('0x1d')](_0x240ea4)[_0x849f('0x1e')](function(_0x383945){return _0x383945;});}return null;};}function removeEntity(_0x27ea23,_0x2af70d){return function(_0x4b29f1){if(_0x4b29f1){return _0x4b29f1[_0x849f('0x1f')]()[_0x849f('0x1e')](function(){var _0x10099a=_0x4b29f1[_0x849f('0x20')]({'plain':!![]});var _0x909e11='Metrics';return db[_0x849f('0x21')][_0x849f('0x1f')]({'where':{'type':_0x909e11,'resourceId':_0x10099a['id']}})[_0x849f('0x1e')](function(){return _0x4b29f1;});})[_0x849f('0x1e')](function(){_0x27ea23[_0x849f('0x15')](0xcc)[_0x849f('0x16')]();});}};}function handleEntityNotFound(_0x185678,_0x2e5371){return function(_0x28f180){if(!_0x28f180){_0x185678[_0x849f('0x22')](0x194);}return _0x28f180;};}function handleError(_0x21be89,_0x347f4a){_0x347f4a=_0x347f4a||0x1f4;return function(_0x3a8a38){logger['error'](_0x3a8a38[_0x849f('0x23')]);if(_0x3a8a38['name']){delete _0x3a8a38[_0x849f('0x24')];}_0x21be89[_0x849f('0x15')](_0x347f4a)[_0x849f('0x25')](_0x3a8a38);};}exports[_0x849f('0x26')]=function(_0xf0e21f,_0x3f1497){var _0x5c4234={},_0x20fa7f={},_0x9fbf48={'count':0x0,'rows':[]};var _0x12b756=_['map'](db[_0x849f('0x27')]['rawAttributes'],function(_0x2398a6){return{'name':_0x2398a6[_0x849f('0x28')],'type':_0x2398a6[_0x849f('0x29')][_0x849f('0x2a')]};});_0x20fa7f['model']=_[_0x849f('0x2b')](_0x12b756,'name');_0x20fa7f[_0x849f('0x2c')]=_[_0x849f('0x2d')](_0xf0e21f['query']);_0x20fa7f['filters']=_['intersection'](_0x20fa7f[_0x849f('0x2e')],_0x20fa7f[_0x849f('0x2c')]);_0x5c4234[_0x849f('0x2f')]=_[_0x849f('0x30')](_0x20fa7f[_0x849f('0x2e')],qs['fields'](_0xf0e21f[_0x849f('0x2c')][_0x849f('0x31')]));_0x5c4234[_0x849f('0x2f')]=_0x5c4234[_0x849f('0x2f')][_0x849f('0x32')]?_0x5c4234[_0x849f('0x2f')]:_0x20fa7f[_0x849f('0x2e')];if(!_0xf0e21f[_0x849f('0x2c')][_0x849f('0x33')](_0x849f('0x34'))){_0x5c4234['limit']=qs['limit'](_0xf0e21f[_0x849f('0x2c')][_0x849f('0x19')]);_0x5c4234[_0x849f('0x18')]=qs['offset'](_0xf0e21f[_0x849f('0x2c')][_0x849f('0x18')]);}_0x5c4234[_0x849f('0x35')]=qs[_0x849f('0x36')](_0xf0e21f['query'][_0x849f('0x36')]);_0x5c4234[_0x849f('0x37')]=qs[_0x849f('0x38')](_[_0x849f('0x39')](_0xf0e21f[_0x849f('0x2c')],_0x20fa7f[_0x849f('0x38')]),_0x12b756);if(_0xf0e21f[_0x849f('0x2c')]['filter']){_0x5c4234[_0x849f('0x37')]=_[_0x849f('0x3a')](_0x5c4234[_0x849f('0x37')],{'$or':_['map'](_0x12b756,function(_0x47adbc){if(_0x47adbc[_0x849f('0x29')]!=='VIRTUAL'){var _0x2ff719={};_0x2ff719[_0x47adbc['name']]={'$like':'%'+_0xf0e21f[_0x849f('0x2c')][_0x849f('0x3b')]+'%'};return _0x2ff719;}})});}_0x5c4234=_['merge']({},_0x5c4234,_0xf0e21f[_0x849f('0x3c')]);var _0x415d3d={'where':_0x5c4234[_0x849f('0x37')]};return db[_0x849f('0x27')]['count'](_0x415d3d)['then'](function(_0x100189){_0x9fbf48[_0x849f('0x17')]=_0x100189;if(_0xf0e21f['query'][_0x849f('0x3d')]){_0x5c4234[_0x849f('0x3e')]=[{'all':!![]}];}return db[_0x849f('0x27')]['findAll'](_0x5c4234);})[_0x849f('0x1e')](function(_0x2b3acf){_0x9fbf48[_0x849f('0x3f')]=_0x2b3acf;return _0x9fbf48;})[_0x849f('0x1e')](respondWithFilteredResult(_0x3f1497,_0x5c4234))[_0x849f('0x40')](handleError(_0x3f1497,null));};exports['show']=function(_0x49dd3c,_0x291f95){var _0x2a7ed9={'raw':!![],'where':{'id':_0x49dd3c[_0x849f('0x41')]['id']}},_0x5a6465={};_0x5a6465[_0x849f('0x2e')]=_['keys'](db[_0x849f('0x27')][_0x849f('0x42')]);_0x5a6465[_0x849f('0x2c')]=_[_0x849f('0x2d')](_0x49dd3c[_0x849f('0x2c')]);_0x5a6465[_0x849f('0x38')]=_[_0x849f('0x30')](_0x5a6465[_0x849f('0x2e')],_0x5a6465[_0x849f('0x2c')]);_0x2a7ed9[_0x849f('0x2f')]=_[_0x849f('0x30')](_0x5a6465[_0x849f('0x2e')],qs[_0x849f('0x31')](_0x49dd3c[_0x849f('0x2c')]['fields']));_0x2a7ed9[_0x849f('0x2f')]=_0x2a7ed9[_0x849f('0x2f')][_0x849f('0x32')]?_0x2a7ed9[_0x849f('0x2f')]:_0x5a6465[_0x849f('0x2e')];if(_0x49dd3c[_0x849f('0x2c')]['includeAll']){_0x2a7ed9[_0x849f('0x3e')]=[{'all':!![]}];}_0x2a7ed9=_[_0x849f('0x3a')]({},_0x2a7ed9,_0x49dd3c[_0x849f('0x3c')]);return db[_0x849f('0x27')][_0x849f('0x43')](_0x2a7ed9)['then'](handleEntityNotFound(_0x291f95,null))[_0x849f('0x1e')](respondWithResult(_0x291f95,null))['catch'](handleError(_0x291f95,null));};exports[_0x849f('0x44')]=function(_0x443373,_0x28c4e6){return db[_0x849f('0x27')][_0x849f('0x44')](_0x443373[_0x849f('0x45')],{})['then'](function(_0x103185){var _0x1d7be3=_0x443373[_0x849f('0x46')][_0x849f('0x20')]({'plain':!![]});if(!_0x1d7be3)throw new Error(_0x849f('0x47'));if(_0x1d7be3[_0x849f('0x48')]===_0x849f('0x46')){var _0x3eafbc=_0x103185[_0x849f('0x20')]({'plain':!![]});var _0x3fc401=_0x849f('0x49');return db[_0x849f('0x4a')][_0x849f('0x43')]({'where':{'name':_0x3fc401,'userProfileId':_0x1d7be3[_0x849f('0x4b')]},'raw':!![]})[_0x849f('0x1e')](function(_0x262702){if(_0x262702&&_0x262702[_0x849f('0x4c')]===0x0){return db['UserProfileResource'][_0x849f('0x44')]({'name':_0x3eafbc['name'],'resourceId':_0x3eafbc['id'],'type':_0x262702[_0x849f('0x24')],'sectionId':_0x262702['id']},{})[_0x849f('0x1e')](function(){return _0x103185;});}else{return _0x103185;}})[_0x849f('0x40')](function(_0x337532){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x337532);throw _0x337532;});}return _0x103185;})['then'](respondWithResult(_0x28c4e6,0xc9))['catch'](handleError(_0x28c4e6,null));};exports['update']=function(_0x5b7f37,_0x1f6117){if(_0x5b7f37[_0x849f('0x45')]['id']){delete _0x5b7f37[_0x849f('0x45')]['id'];}return db[_0x849f('0x27')][_0x849f('0x43')]({'where':{'id':_0x5b7f37[_0x849f('0x41')]['id']}})[_0x849f('0x1e')](handleEntityNotFound(_0x1f6117,null))[_0x849f('0x1e')](saveUpdates(_0x5b7f37[_0x849f('0x45')],null))[_0x849f('0x1e')](respondWithResult(_0x1f6117,null))[_0x849f('0x40')](handleError(_0x1f6117,null));};exports[_0x849f('0x1f')]=function(_0xd2af15,_0x2021b1){return db[_0x849f('0x27')][_0x849f('0x43')]({'where':{'id':_0xd2af15['params']['id']}})['then'](handleEntityNotFound(_0x2021b1,null))[_0x849f('0x1e')](removeEntity(_0x2021b1,null))[_0x849f('0x40')](handleError(_0x2021b1,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 617bcba..409e82f 100644
--- a/server/api/analyticMetric/analyticMetric.model.js
+++ b/server/api/analyticMetric/analyticMetric.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fcd=['exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x57fd6c,_0x5d048e){var _0x489f14=function(_0x5aba91){while(--_0x5aba91){_0x57fd6c['push'](_0x57fd6c['shift']());}};_0x489f14(++_0x5d048e);}(_0x5fcd,0x121));var _0xd5fc=function(_0x541adb,_0x258def){_0x541adb=_0x541adb-0x0;var _0x2ca2e4=_0x5fcd[_0x541adb];return _0x2ca2e4;};'use strict';var _=require(_0xd5fc('0x0'));var util=require(_0xd5fc('0x1'));var logger=require(_0xd5fc('0x2'))(_0xd5fc('0x3'));var moment=require(_0xd5fc('0x4'));var BPromise=require(_0xd5fc('0x5'));var rp=require(_0xd5fc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd5fc('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xd5fc('0x8')]=function(_0x359793,_0x354940){return _0x359793[_0xd5fc('0x9')]('AnalyticMetric',attributes,{'tableName':_0xd5fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a21=['AnalyticMetric','analytics_metrics','../../config/logger','api','bluebird','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x47c5bd,_0x7605da){var _0x2447dc=function(_0x1d4bff){while(--_0x1d4bff){_0x47c5bd['push'](_0x47c5bd['shift']());}};_0x2447dc(++_0x7605da);}(_0x0a21,0xc8));var _0x10a2=function(_0x52e1ab,_0x186c39){_0x52e1ab=_0x52e1ab-0x0;var _0x4cd9d4=_0x0a21[_0x52e1ab];return _0x4cd9d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x10a2('0x0'))(_0x10a2('0x1'));var moment=require('moment');var BPromise=require(_0x10a2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x10a2('0x3'));var attributes=require(_0x10a2('0x4'));module[_0x10a2('0x5')]=function(_0x16330e,_0xa8d4db){return _0x16330e[_0x10a2('0x6')](_0x10a2('0x7'),attributes,{'tableName':_0x10a2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index e228a43..172c1af 100644
--- a/server/api/analyticMetric/analyticMetric.rpc.js
+++ b/server/api/analyticMetric/analyticMetric.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7686=['http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x186085,_0x47dc06){var _0x158839=function(_0x11ce50){while(--_0x11ce50){_0x186085['push'](_0x186085['shift']());}};_0x158839(++_0x47dc06);}(_0x7686,0xcc));var _0x6768=function(_0x4ccc6e,_0x5664d2){_0x4ccc6e=_0x4ccc6e-0x0;var _0x234c7f=_0x7686[_0x4ccc6e];return _0x234c7f;};'use strict';var _=require(_0x6768('0x0'));var util=require(_0x6768('0x1'));var moment=require(_0x6768('0x2'));var BPromise=require(_0x6768('0x3'));var rs=require(_0x6768('0x4'));var fs=require('fs');var Redis=require(_0x6768('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6768('0x6'));var logger=require(_0x6768('0x7'))(_0x6768('0x8'));var config=require(_0x6768('0x9'));var jayson=require(_0x6768('0xa'));var client=jayson[_0x6768('0xb')][_0x6768('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f414e,_0x2e0fa1,_0x3dc360){return new BPromise(function(_0x296eea,_0x311169){return client[_0x6768('0xd')](_0x2f414e,_0x3dc360)[_0x6768('0xe')](function(_0x41f679){logger[_0x6768('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x2e0fa1,_0x6768('0x10'));logger[_0x6768('0x11')](_0x6768('0x12'),_0x2e0fa1,_0x6768('0x10'),JSON[_0x6768('0x13')](_0x41f679));if(_0x41f679[_0x6768('0x14')]){if(_0x41f679[_0x6768('0x14')]['code']===0x1f4){logger[_0x6768('0x14')](_0x6768('0x15'),_0x2e0fa1,_0x41f679[_0x6768('0x14')][_0x6768('0x16')]);return _0x311169(_0x41f679[_0x6768('0x14')]['message']);}logger[_0x6768('0x14')](_0x6768('0x15'),_0x2e0fa1,_0x41f679['error'][_0x6768('0x16')]);return _0x296eea(_0x41f679['error'][_0x6768('0x16')]);}else{logger['info'](_0x6768('0x15'),_0x2e0fa1,'request\x20sent');_0x296eea(_0x41f679[_0x6768('0x17')][_0x6768('0x16')]);}})['catch'](function(_0x12fbfc){logger['error'](_0x6768('0x15'),_0x2e0fa1,_0x12fbfc);_0x311169(_0x12fbfc);});});}
\ No newline at end of file
+var _0x3c23=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment'];(function(_0x4fd376,_0x35af73){var _0x47204f=function(_0x5a1ef3){while(--_0x5a1ef3){_0x4fd376['push'](_0x4fd376['shift']());}};_0x47204f(++_0x35af73);}(_0x3c23,0xf9));var _0x33c2=function(_0x30e804,_0x8d453b){_0x30e804=_0x30e804-0x0;var _0x529374=_0x3c23[_0x30e804];return _0x529374;};'use strict';var _=require(_0x33c2('0x0'));var util=require(_0x33c2('0x1'));var moment=require(_0x33c2('0x2'));var BPromise=require('bluebird');var rs=require(_0x33c2('0x3'));var fs=require('fs');var Redis=require(_0x33c2('0x4'));var db=require(_0x33c2('0x5'))['db'];var utils=require(_0x33c2('0x6'));var logger=require('../../config/logger')(_0x33c2('0x7'));var config=require(_0x33c2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x33c2('0x9')][_0x33c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x240f23,_0x37b74f,_0x17d4e3){return new BPromise(function(_0x19a610,_0x1983c5){return client['request'](_0x240f23,_0x17d4e3)[_0x33c2('0xb')](function(_0x2900a9){logger['info'](_0x33c2('0xc'),_0x37b74f,_0x33c2('0xd'));logger['debug'](_0x33c2('0xe'),_0x37b74f,_0x33c2('0xd'),JSON['stringify'](_0x2900a9));if(_0x2900a9['error']){if(_0x2900a9[_0x33c2('0xf')][_0x33c2('0x10')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x37b74f,_0x2900a9[_0x33c2('0xf')][_0x33c2('0x11')]);return _0x1983c5(_0x2900a9[_0x33c2('0xf')][_0x33c2('0x11')]);}logger[_0x33c2('0xf')](_0x33c2('0xc'),_0x37b74f,_0x2900a9['error'][_0x33c2('0x11')]);return _0x19a610(_0x2900a9[_0x33c2('0xf')][_0x33c2('0x11')]);}else{logger['info'](_0x33c2('0xc'),_0x37b74f,_0x33c2('0xd'));_0x19a610(_0x2900a9['result'][_0x33c2('0x11')]);}})['catch'](function(_0x154080){logger[_0x33c2('0xf')](_0x33c2('0xc'),_0x37b74f,_0x154080);_0x1983c5(_0x154080);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index fda345f..e013f85 100644
--- a/server/api/analyticMetric/index.js
+++ b/server/api/analyticMetric/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x593ed1,_0x4855c2){var _0x3ca30c=function(_0xc3714b){while(--_0xc3714b){_0x593ed1['push'](_0x593ed1['shift']());}};_0x3ca30c(++_0x4855c2);}(_0xadb5,0xad));var _0x5adb=function(_0x23d049,_0x4ad7a3){_0x23d049=_0x23d049-0x0;var _0x4de619=_0xadb5[_0x23d049];return _0x4de619;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0xc')]('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router[_0x5adb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x11')]);module[_0x5adb('0x12')]=router;
\ No newline at end of file
+var _0xadb5=['destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x24426c,_0x4c75e3){var _0xe97cff=function(_0x377981){while(--_0x377981){_0x24426c['push'](_0x24426c['shift']());}};_0xe97cff(++_0x4c75e3);}(_0xadb5,0xad));var _0x5adb=function(_0x56f92d,_0x48003e){_0x56f92d=_0x56f92d-0x0;var _0x442089=_0xadb5[_0x56f92d];return _0x442089;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0xc')]('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router[_0x5adb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x11')]);module[_0x5adb('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 0df8c63..2908e7f 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf4f=['sequelize','exports','TEXT'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xdf4f,0xde));var _0xfdf4=function(_0x45f4ed,_0x3b65ac){_0x45f4ed=_0x45f4ed-0x0;var _0x3279e6=_0xdf4f[_0x45f4ed];return _0x3279e6;};'use strict';var Sequelize=require(_0xfdf4('0x0'));module[_0xfdf4('0x1')]={'tree':{'type':Sequelize[_0xfdf4('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xabef=['exports'];(function(_0x572ca0,_0x2b069e){var _0x546023=function(_0x439587){while(--_0x439587){_0x572ca0['push'](_0x572ca0['shift']());}};_0x546023(++_0x2b069e);}(_0xabef,0xbb));var _0xfabe=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xabef[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require('sequelize');module[_0xfabe('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 6f83972..dcb4d80 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.controller.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7954=['order','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x2490b7,_0x1e042e){var _0x2ec8ad=function(_0x45e310){while(--_0x45e310){_0x2490b7['push'](_0x2490b7['shift']());}};_0x2ec8ad(++_0x1e042e);}(_0x7954,0xed));var _0x4795=function(_0x18239b,_0x1623a3){_0x18239b=_0x18239b-0x0;var _0xcfd404=_0x7954[_0x18239b];return _0xcfd404;};'use strict';var pdf=require(_0x4795('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4795('0x1'));var jsonpatch=require(_0x4795('0x2'));var rp=require(_0x4795('0x3'));var moment=require('moment');var BPromise=require(_0x4795('0x4'));var Mustache=require(_0x4795('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4795('0x6'));var csv=require(_0x4795('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4795('0x8'));var squel=require(_0x4795('0x9'));var crypto=require('crypto');var jsforce=require(_0x4795('0xa'));var deskjs=require(_0x4795('0xb'));var toCsv=require(_0x4795('0x7'));var querystring=require('querystring');var Papa=require(_0x4795('0xc'));var Redis=require(_0x4795('0xd'));var authService=require(_0x4795('0xe'));var qs=require(_0x4795('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4795('0x10'));var logger=require(_0x4795('0x11'))(_0x4795('0x12'));var utils=require(_0x4795('0x13'));var config=require(_0x4795('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42ffd2,_0x174c8d){_0x174c8d=_0x174c8d||0xcc;return function(_0x55e414){if(_0x55e414){return _0x42ffd2[_0x4795('0x15')](_0x174c8d);}return _0x42ffd2['status'](_0x174c8d)[_0x4795('0x16')]();};}function respondWithResult(_0x4f26ef,_0x567f64){_0x567f64=_0x567f64||0xc8;return function(_0xef38c6){if(_0xef38c6){return _0x4f26ef[_0x4795('0x17')](_0x567f64)[_0x4795('0x18')](_0xef38c6);}};}function respondWithFilteredResult(_0x2c1d2e,_0x12ba6b){return function(_0xb4ddc5){if(_0xb4ddc5){var _0x244a59=_0xb4ddc5[_0x4795('0x19')],_0x20ae72=_0x12ba6b[_0x4795('0x1a')],_0x395efb=_0x12ba6b['offset']+_0x12ba6b[_0x4795('0x1b')],_0x5da27f;if(_0x395efb>=_0x244a59){_0x395efb=_0x244a59;_0x5da27f=0xc8;}else{_0x5da27f=0xce;}_0x2c1d2e[_0x4795('0x17')](_0x5da27f);return _0x2c1d2e[_0x4795('0x1c')](_0x4795('0x1d'),_0x20ae72+'-'+_0x395efb+'/'+_0x244a59)[_0x4795('0x18')](_0xb4ddc5);}return null;};}function patchUpdates(_0x6ac79d){return function(_0x329c32){try{jsonpatch['apply'](_0x329c32,_0x6ac79d,!![]);}catch(_0x2b3e0c){return BPromise[_0x4795('0x1e')](_0x2b3e0c);}return _0x329c32[_0x4795('0x1f')]();};}function saveUpdates(_0x4d456c,_0x41f915){return function(_0x571c61){if(_0x571c61){return _0x571c61['update'](_0x4d456c)['then'](function(_0x33b183){return _0x33b183;});}return null;};}function removeEntity(_0x9320fb,_0x5eee6e){return function(_0x58ff27){if(_0x58ff27){return _0x58ff27[_0x4795('0x20')]()[_0x4795('0x21')](function(){_0x9320fb[_0x4795('0x17')](0xcc)[_0x4795('0x16')]();});}};}function handleEntityNotFound(_0x44a1b2,_0x8f678a){return function(_0x428a38){if(!_0x428a38){_0x44a1b2['sendStatus'](0x194);}return _0x428a38;};}function handleError(_0x1f1263,_0x221ff1){_0x221ff1=_0x221ff1||0x1f4;return function(_0x8c6cec){logger['error'](_0x8c6cec[_0x4795('0x22')]);if(_0x8c6cec[_0x4795('0x23')]){delete _0x8c6cec[_0x4795('0x23')];}_0x1f1263['status'](_0x221ff1)[_0x4795('0x24')](_0x8c6cec);};}exports[_0x4795('0x25')]=function(_0x2385d3,_0x5bdba0){var _0x503460={},_0x1dda70={},_0x338704={'count':0x0,'rows':[]};var _0x5bb789=_[_0x4795('0x26')](db['AnalyticTreeReport'][_0x4795('0x27')],function(_0x3cb899){return{'name':_0x3cb899[_0x4795('0x28')],'type':_0x3cb899[_0x4795('0x29')]['key']};});_0x1dda70[_0x4795('0x2a')]=_[_0x4795('0x26')](_0x5bb789,_0x4795('0x23'));_0x1dda70['query']=_[_0x4795('0x2b')](_0x2385d3[_0x4795('0x2c')]);_0x1dda70[_0x4795('0x2d')]=_[_0x4795('0x2e')](_0x1dda70[_0x4795('0x2a')],_0x1dda70[_0x4795('0x2c')]);_0x503460[_0x4795('0x2f')]=_['intersection'](_0x1dda70[_0x4795('0x2a')],qs[_0x4795('0x30')](_0x2385d3[_0x4795('0x2c')][_0x4795('0x30')]));_0x503460[_0x4795('0x2f')]=_0x503460['attributes']['length']?_0x503460['attributes']:_0x1dda70[_0x4795('0x2a')];if(!_0x2385d3[_0x4795('0x2c')][_0x4795('0x31')](_0x4795('0x32'))){_0x503460[_0x4795('0x1b')]=qs[_0x4795('0x1b')](_0x2385d3[_0x4795('0x2c')][_0x4795('0x1b')]);_0x503460[_0x4795('0x1a')]=qs['offset'](_0x2385d3[_0x4795('0x2c')]['offset']);}_0x503460[_0x4795('0x33')]=qs[_0x4795('0x34')](_0x2385d3['query'][_0x4795('0x34')]);_0x503460['where']=qs[_0x4795('0x2d')](_[_0x4795('0x35')](_0x2385d3[_0x4795('0x2c')],_0x1dda70[_0x4795('0x2d')]),_0x5bb789);if(_0x2385d3[_0x4795('0x2c')][_0x4795('0x36')]){_0x503460[_0x4795('0x37')]=_[_0x4795('0x38')](_0x503460[_0x4795('0x37')],{'$or':_[_0x4795('0x26')](_0x5bb789,function(_0x37c337){if(_0x37c337[_0x4795('0x29')]!==_0x4795('0x39')){var _0xb2287={};_0xb2287[_0x37c337[_0x4795('0x23')]]={'$like':'%'+_0x2385d3['query']['filter']+'%'};return _0xb2287;}})});}_0x503460=_['merge']({},_0x503460,_0x2385d3[_0x4795('0x3a')]);var _0x1590e1={'where':_0x503460[_0x4795('0x37')]};return db[_0x4795('0x3b')][_0x4795('0x19')](_0x1590e1)[_0x4795('0x21')](function(_0x4dd833){_0x338704['count']=_0x4dd833;if(_0x2385d3[_0x4795('0x2c')][_0x4795('0x3c')]){_0x503460[_0x4795('0x3d')]=[{'all':!![]}];}return db[_0x4795('0x3b')][_0x4795('0x3e')](_0x503460);})['then'](function(_0x34daaa){_0x338704[_0x4795('0x3f')]=_0x34daaa;return _0x338704;})[_0x4795('0x21')](respondWithFilteredResult(_0x5bdba0,_0x503460))[_0x4795('0x40')](handleError(_0x5bdba0,null));};exports[_0x4795('0x41')]=function(_0x2f1c3a,_0x1f2d98){var _0x4e3e0a={'raw':!![],'where':{'id':_0x2f1c3a[_0x4795('0x42')]['id']}},_0x1b2785={};_0x1b2785[_0x4795('0x2a')]=_['keys'](db['AnalyticTreeReport'][_0x4795('0x27')]);_0x1b2785[_0x4795('0x2c')]=_['keys'](_0x2f1c3a[_0x4795('0x2c')]);_0x1b2785[_0x4795('0x2d')]=_['intersection'](_0x1b2785[_0x4795('0x2a')],_0x1b2785[_0x4795('0x2c')]);_0x4e3e0a[_0x4795('0x2f')]=_['intersection'](_0x1b2785[_0x4795('0x2a')],qs[_0x4795('0x30')](_0x2f1c3a[_0x4795('0x2c')]['fields']));_0x4e3e0a['attributes']=_0x4e3e0a['attributes'][_0x4795('0x43')]?_0x4e3e0a[_0x4795('0x2f')]:_0x1b2785[_0x4795('0x2a')];if(_0x2f1c3a[_0x4795('0x2c')][_0x4795('0x3c')]){_0x4e3e0a[_0x4795('0x3d')]=[{'all':!![]}];}_0x4e3e0a=_['merge']({},_0x4e3e0a,_0x2f1c3a['options']);return db['AnalyticTreeReport'][_0x4795('0x44')](_0x4e3e0a)['then'](handleEntityNotFound(_0x1f2d98,null))[_0x4795('0x21')](respondWithResult(_0x1f2d98,null))['catch'](handleError(_0x1f2d98,null));};exports[_0x4795('0x45')]=function(_0x5736e6,_0x1dd11a){return db['AnalyticTreeReport'][_0x4795('0x45')](_0x5736e6[_0x4795('0x46')],{})[_0x4795('0x21')](respondWithResult(_0x1dd11a,0xc9))[_0x4795('0x40')](handleError(_0x1dd11a,null));};exports[_0x4795('0x47')]=function(_0x31bc4f,_0x2dd289){if(_0x31bc4f[_0x4795('0x46')]['id']){delete _0x31bc4f[_0x4795('0x46')]['id'];}return db[_0x4795('0x3b')][_0x4795('0x44')]({'where':{'id':_0x31bc4f['params']['id']}})[_0x4795('0x21')](handleEntityNotFound(_0x2dd289,null))[_0x4795('0x21')](saveUpdates(_0x31bc4f[_0x4795('0x46')],null))[_0x4795('0x21')](respondWithResult(_0x2dd289,null))[_0x4795('0x40')](handleError(_0x2dd289,null));};exports[_0x4795('0x20')]=function(_0x33732c,_0x3d597b){return db[_0x4795('0x3b')][_0x4795('0x44')]({'where':{'id':_0x33732c[_0x4795('0x42')]['id']}})[_0x4795('0x21')](handleEntityNotFound(_0x3d597b,null))[_0x4795('0x21')](removeEntity(_0x3d597b,null))['catch'](handleError(_0x3d597b,null));};
\ No newline at end of file
+var _0x56a4=['catch','show','keys','length','find','create','body','update','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x56a4,0xf0));var _0x456a=function(_0x5ec634,_0xa835b9){_0x5ec634=_0x5ec634-0x0;var _0x5b94a9=_0x56a4[_0x5ec634];return _0x5b94a9;};'use strict';var pdf=require(_0x456a('0x0'));var emlformat=require(_0x456a('0x1'));var rimraf=require(_0x456a('0x2'));var zipdir=require(_0x456a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x456a('0x4'));var moment=require('moment');var BPromise=require(_0x456a('0x5'));var Mustache=require(_0x456a('0x6'));var util=require(_0x456a('0x7'));var path=require(_0x456a('0x8'));var sox=require(_0x456a('0x9'));var csv=require(_0x456a('0xa'));var ejs=require(_0x456a('0xb'));var fs=require('fs');var _=require(_0x456a('0xc'));var squel=require(_0x456a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x456a('0xe'));var toCsv=require(_0x456a('0xa'));var querystring=require(_0x456a('0xf'));var Papa=require(_0x456a('0x10'));var Redis=require(_0x456a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x456a('0x12'));var as=require(_0x456a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x456a('0x14'))(_0x456a('0x15'));var utils=require(_0x456a('0x16'));var config=require(_0x456a('0x17'));var db=require(_0x456a('0x18'))['db'];function respondWithStatusCode(_0x3284c,_0xcc6b13){_0xcc6b13=_0xcc6b13||0xcc;return function(_0x52db79){if(_0x52db79){return _0x3284c[_0x456a('0x19')](_0xcc6b13);}return _0x3284c[_0x456a('0x1a')](_0xcc6b13)[_0x456a('0x1b')]();};}function respondWithResult(_0x1a0c7,_0x929425){_0x929425=_0x929425||0xc8;return function(_0x3fd176){if(_0x3fd176){return _0x1a0c7[_0x456a('0x1a')](_0x929425)[_0x456a('0x1c')](_0x3fd176);}};}function respondWithFilteredResult(_0x2dee9d,_0x2cea6c){return function(_0x4750d7){if(_0x4750d7){var _0x3a792b=_0x4750d7[_0x456a('0x1d')],_0x3021c8=_0x2cea6c['offset'],_0x58ccd5=_0x2cea6c[_0x456a('0x1e')]+_0x2cea6c['limit'],_0x3d08a7;if(_0x58ccd5>=_0x3a792b){_0x58ccd5=_0x3a792b;_0x3d08a7=0xc8;}else{_0x3d08a7=0xce;}_0x2dee9d[_0x456a('0x1a')](_0x3d08a7);return _0x2dee9d[_0x456a('0x1f')](_0x456a('0x20'),_0x3021c8+'-'+_0x58ccd5+'/'+_0x3a792b)[_0x456a('0x1c')](_0x4750d7);}return null;};}function patchUpdates(_0x191068){return function(_0x47374c){try{jsonpatch[_0x456a('0x21')](_0x47374c,_0x191068,!![]);}catch(_0x1534da){return BPromise[_0x456a('0x22')](_0x1534da);}return _0x47374c[_0x456a('0x23')]();};}function saveUpdates(_0x1a8804,_0x389023){return function(_0xbdd35d){if(_0xbdd35d){return _0xbdd35d['update'](_0x1a8804)[_0x456a('0x24')](function(_0x1d4903){return _0x1d4903;});}return null;};}function removeEntity(_0x40acad,_0x6e6235){return function(_0x4477e3){if(_0x4477e3){return _0x4477e3[_0x456a('0x25')]()[_0x456a('0x24')](function(){_0x40acad[_0x456a('0x1a')](0xcc)[_0x456a('0x1b')]();});}};}function handleEntityNotFound(_0x327480,_0x2b54c5){return function(_0x24d8c3){if(!_0x24d8c3){_0x327480[_0x456a('0x19')](0x194);}return _0x24d8c3;};}function handleError(_0x59674f,_0x521598){_0x521598=_0x521598||0x1f4;return function(_0x430422){logger[_0x456a('0x26')](_0x430422['stack']);if(_0x430422['name']){delete _0x430422[_0x456a('0x27')];}_0x59674f[_0x456a('0x1a')](_0x521598)[_0x456a('0x28')](_0x430422);};}exports[_0x456a('0x29')]=function(_0x25fd75,_0x44bd1e){var _0x515558={},_0x21dc15={},_0x40b045={'count':0x0,'rows':[]};var _0x92dfc1=_[_0x456a('0x2a')](db[_0x456a('0x2b')][_0x456a('0x2c')],function(_0x5cbf6f){return{'name':_0x5cbf6f[_0x456a('0x2d')],'type':_0x5cbf6f[_0x456a('0x2e')][_0x456a('0x2f')]};});_0x21dc15[_0x456a('0x30')]=_[_0x456a('0x2a')](_0x92dfc1,_0x456a('0x27'));_0x21dc15[_0x456a('0x31')]=_['keys'](_0x25fd75[_0x456a('0x31')]);_0x21dc15[_0x456a('0x32')]=_[_0x456a('0x33')](_0x21dc15[_0x456a('0x30')],_0x21dc15[_0x456a('0x31')]);_0x515558[_0x456a('0x34')]=_[_0x456a('0x33')](_0x21dc15['model'],qs[_0x456a('0x35')](_0x25fd75['query'][_0x456a('0x35')]));_0x515558['attributes']=_0x515558[_0x456a('0x34')]['length']?_0x515558[_0x456a('0x34')]:_0x21dc15[_0x456a('0x30')];if(!_0x25fd75[_0x456a('0x31')][_0x456a('0x36')](_0x456a('0x37'))){_0x515558[_0x456a('0x38')]=qs[_0x456a('0x38')](_0x25fd75[_0x456a('0x31')][_0x456a('0x38')]);_0x515558[_0x456a('0x1e')]=qs['offset'](_0x25fd75[_0x456a('0x31')][_0x456a('0x1e')]);}_0x515558[_0x456a('0x39')]=qs[_0x456a('0x3a')](_0x25fd75['query'][_0x456a('0x3a')]);_0x515558[_0x456a('0x3b')]=qs[_0x456a('0x32')](_[_0x456a('0x3c')](_0x25fd75[_0x456a('0x31')],_0x21dc15[_0x456a('0x32')]),_0x92dfc1);if(_0x25fd75['query'][_0x456a('0x3d')]){_0x515558[_0x456a('0x3b')]=_[_0x456a('0x3e')](_0x515558[_0x456a('0x3b')],{'$or':_['map'](_0x92dfc1,function(_0x4e0cc8){if(_0x4e0cc8[_0x456a('0x2e')]!==_0x456a('0x3f')){var _0x107b47={};_0x107b47[_0x4e0cc8[_0x456a('0x27')]]={'$like':'%'+_0x25fd75[_0x456a('0x31')][_0x456a('0x3d')]+'%'};return _0x107b47;}})});}_0x515558=_[_0x456a('0x3e')]({},_0x515558,_0x25fd75[_0x456a('0x40')]);var _0xf66744={'where':_0x515558[_0x456a('0x3b')]};return db[_0x456a('0x2b')][_0x456a('0x1d')](_0xf66744)[_0x456a('0x24')](function(_0x386034){_0x40b045[_0x456a('0x1d')]=_0x386034;if(_0x25fd75[_0x456a('0x31')][_0x456a('0x41')]){_0x515558[_0x456a('0x42')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x456a('0x43')](_0x515558);})[_0x456a('0x24')](function(_0x31e28f){_0x40b045['rows']=_0x31e28f;return _0x40b045;})[_0x456a('0x24')](respondWithFilteredResult(_0x44bd1e,_0x515558))[_0x456a('0x44')](handleError(_0x44bd1e,null));};exports[_0x456a('0x45')]=function(_0x1055c3,_0x190b39){var _0x526892={'raw':!![],'where':{'id':_0x1055c3['params']['id']}},_0x4dca50={};_0x4dca50[_0x456a('0x30')]=_['keys'](db[_0x456a('0x2b')]['rawAttributes']);_0x4dca50[_0x456a('0x31')]=_[_0x456a('0x46')](_0x1055c3[_0x456a('0x31')]);_0x4dca50[_0x456a('0x32')]=_[_0x456a('0x33')](_0x4dca50[_0x456a('0x30')],_0x4dca50[_0x456a('0x31')]);_0x526892['attributes']=_[_0x456a('0x33')](_0x4dca50['model'],qs['fields'](_0x1055c3[_0x456a('0x31')][_0x456a('0x35')]));_0x526892[_0x456a('0x34')]=_0x526892[_0x456a('0x34')][_0x456a('0x47')]?_0x526892[_0x456a('0x34')]:_0x4dca50['model'];if(_0x1055c3[_0x456a('0x31')][_0x456a('0x41')]){_0x526892[_0x456a('0x42')]=[{'all':!![]}];}_0x526892=_[_0x456a('0x3e')]({},_0x526892,_0x1055c3[_0x456a('0x40')]);return db['AnalyticTreeReport'][_0x456a('0x48')](_0x526892)['then'](handleEntityNotFound(_0x190b39,null))[_0x456a('0x24')](respondWithResult(_0x190b39,null))[_0x456a('0x44')](handleError(_0x190b39,null));};exports['create']=function(_0x5a4093,_0x3ae588){return db[_0x456a('0x2b')][_0x456a('0x49')](_0x5a4093[_0x456a('0x4a')],{})[_0x456a('0x24')](respondWithResult(_0x3ae588,0xc9))[_0x456a('0x44')](handleError(_0x3ae588,null));};exports[_0x456a('0x4b')]=function(_0x3215b5,_0x25c839){if(_0x3215b5[_0x456a('0x4a')]['id']){delete _0x3215b5[_0x456a('0x4a')]['id'];}return db['AnalyticTreeReport'][_0x456a('0x48')]({'where':{'id':_0x3215b5[_0x456a('0x4c')]['id']}})[_0x456a('0x24')](handleEntityNotFound(_0x25c839,null))[_0x456a('0x24')](saveUpdates(_0x3215b5[_0x456a('0x4a')],null))[_0x456a('0x24')](respondWithResult(_0x25c839,null))['catch'](handleError(_0x25c839,null));};exports[_0x456a('0x25')]=function(_0x50f804,_0x5d72fe){return db['AnalyticTreeReport'][_0x456a('0x48')]({'where':{'id':_0x50f804[_0x456a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5d72fe,null))[_0x456a('0x24')](removeEntity(_0x5d72fe,null))['catch'](handleError(_0x5d72fe,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 233acd9..c8f8b05 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.model.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c28=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','define'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x7c28,0x65));var _0x87c2=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x7c28[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x87c2('0x0'));var util=require(_0x87c2('0x1'));var logger=require(_0x87c2('0x2'))(_0x87c2('0x3'));var moment=require(_0x87c2('0x4'));var BPromise=require(_0x87c2('0x5'));var rp=require(_0x87c2('0x6'));var fs=require('fs');var path=require(_0x87c2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x36f031,_0x30a10e){return _0x36f031[_0x87c2('0x8')](_0x87c2('0x9'),attributes,{'tableName':_0x87c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe48a=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x2bdf62,_0x4166f7){var _0x3141c3=function(_0xa93a48){while(--_0xa93a48){_0x2bdf62['push'](_0x2bdf62['shift']());}};_0x3141c3(++_0x4166f7);}(_0xe48a,0xb4));var _0xae48=function(_0x30e4c0,_0x58fed1){_0x30e4c0=_0x30e4c0-0x0;var _0x30b6d0=_0xe48a[_0x30e4c0];return _0x30b6d0;};'use strict';var _=require(_0xae48('0x0'));var util=require(_0xae48('0x1'));var logger=require('../../config/logger')(_0xae48('0x2'));var moment=require('moment');var BPromise=require(_0xae48('0x3'));var rp=require(_0xae48('0x4'));var fs=require('fs');var path=require(_0xae48('0x5'));var rimraf=require(_0xae48('0x6'));var config=require(_0xae48('0x7'));var attributes=require(_0xae48('0x8'));module['exports']=function(_0x1105dd,_0x2e938a){return _0x1105dd[_0xae48('0x9')](_0xae48('0xa'),attributes,{'tableName':_0xae48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index abb96f4..63fd311 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x09d3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x159fb5,_0x580031){var _0xccb8d1=function(_0x41418b){while(--_0x41418b){_0x159fb5['push'](_0x159fb5['shift']());}};_0xccb8d1(++_0x580031);}(_0x09d3,0xf9));var _0x309d=function(_0x2844dc,_0xc5df39){_0x2844dc=_0x2844dc-0x0;var _0x4cc6d4=_0x09d3[_0x2844dc];return _0x4cc6d4;};'use strict';var _=require('lodash');var util=require(_0x309d('0x0'));var moment=require(_0x309d('0x1'));var BPromise=require(_0x309d('0x2'));var rs=require(_0x309d('0x3'));var fs=require('fs');var Redis=require(_0x309d('0x4'));var db=require(_0x309d('0x5'))['db'];var utils=require(_0x309d('0x6'));var logger=require(_0x309d('0x7'))(_0x309d('0x8'));var config=require('../../config/environment');var jayson=require(_0x309d('0x9'));var client=jayson[_0x309d('0xa')][_0x309d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46c6a8,_0x572ab6,_0x25c0a9){return new BPromise(function(_0x2f5ef9,_0x480d05){return client[_0x309d('0xc')](_0x46c6a8,_0x25c0a9)[_0x309d('0xd')](function(_0x34f3d0){logger[_0x309d('0xe')](_0x309d('0xf'),_0x572ab6,_0x309d('0x10'));logger[_0x309d('0x11')](_0x309d('0x12'),_0x572ab6,_0x309d('0x10'),JSON[_0x309d('0x13')](_0x34f3d0));if(_0x34f3d0['error']){if(_0x34f3d0[_0x309d('0x14')][_0x309d('0x15')]===0x1f4){logger[_0x309d('0x14')]('AnalyticTreeReport,\x20%s,\x20%s',_0x572ab6,_0x34f3d0[_0x309d('0x14')][_0x309d('0x16')]);return _0x480d05(_0x34f3d0[_0x309d('0x14')][_0x309d('0x16')]);}logger[_0x309d('0x14')](_0x309d('0xf'),_0x572ab6,_0x34f3d0[_0x309d('0x14')]['message']);return _0x2f5ef9(_0x34f3d0[_0x309d('0x14')]['message']);}else{logger[_0x309d('0xe')](_0x309d('0xf'),_0x572ab6,_0x309d('0x10'));_0x2f5ef9(_0x34f3d0[_0x309d('0x17')][_0x309d('0x16')]);}})[_0x309d('0x18')](function(_0x474db7){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x572ab6,_0x474db7);_0x480d05(_0x474db7);});});}
\ No newline at end of file
+var _0x3169=['request\x20sent','stringify','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s'];(function(_0x224c52,_0xee932d){var _0x1654bf=function(_0x1f6ba1){while(--_0x1f6ba1){_0x224c52['push'](_0x224c52['shift']());}};_0x1654bf(++_0xee932d);}(_0x3169,0x6b));var _0x9316=function(_0x115785,_0x4d16fa){_0x115785=_0x115785-0x0;var _0x35224b=_0x3169[_0x115785];return _0x35224b;};'use strict';var _=require(_0x9316('0x0'));var util=require('util');var moment=require(_0x9316('0x1'));var BPromise=require('bluebird');var rs=require(_0x9316('0x2'));var fs=require('fs');var Redis=require(_0x9316('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9316('0x4'))(_0x9316('0x5'));var config=require(_0x9316('0x6'));var jayson=require(_0x9316('0x7'));var client=jayson[_0x9316('0x8')][_0x9316('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d1220,_0x25f455,_0x1e9d4f){return new BPromise(function(_0x4ab113,_0x67a9cb){return client[_0x9316('0xa')](_0x1d1220,_0x1e9d4f)[_0x9316('0xb')](function(_0x5d9f3c){logger['info'](_0x9316('0xc'),_0x25f455,_0x9316('0xd'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x25f455,_0x9316('0xd'),JSON[_0x9316('0xe')](_0x5d9f3c));if(_0x5d9f3c[_0x9316('0xf')]){if(_0x5d9f3c[_0x9316('0xf')]['code']===0x1f4){logger[_0x9316('0xf')](_0x9316('0xc'),_0x25f455,_0x5d9f3c['error'][_0x9316('0x10')]);return _0x67a9cb(_0x5d9f3c[_0x9316('0xf')]['message']);}logger[_0x9316('0xf')](_0x9316('0xc'),_0x25f455,_0x5d9f3c['error'][_0x9316('0x10')]);return _0x4ab113(_0x5d9f3c[_0x9316('0xf')]['message']);}else{logger[_0x9316('0x11')](_0x9316('0xc'),_0x25f455,_0x9316('0xd'));_0x4ab113(_0x5d9f3c[_0x9316('0x12')][_0x9316('0x10')]);}})[_0x9316('0x13')](function(_0x57e453){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x25f455,_0x57e453);_0x67a9cb(_0x57e453);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index dad0a9a..64e2541 100644
--- a/server/api/analyticTreeReport/index.js
+++ b/server/api/analyticTreeReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6c6f=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x264cba,_0x490da5){var _0x1ee7b7=function(_0x5b2b3f){while(--_0x5b2b3f){_0x264cba['push'](_0x264cba['shift']());}};_0x1ee7b7(++_0x490da5);}(_0x6c6f,0xc0));var _0xf6c6=function(_0x1d90dc,_0xf7344d){_0x1d90dc=_0x1d90dc-0x0;var _0x34a86f=_0x6c6f[_0x1d90dc];return _0x34a86f;};'use strict';var multer=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var path=require(_0xf6c6('0x2'));var timeout=require(_0xf6c6('0x3'));var express=require(_0xf6c6('0x4'));var router=express[_0xf6c6('0x5')]();var auth=require(_0xf6c6('0x6'));var interaction=require(_0xf6c6('0x7'));var config=require(_0xf6c6('0x8'));var controller=require(_0xf6c6('0x9'));router[_0xf6c6('0xa')]('/',auth[_0xf6c6('0xb')](),controller['index']);router[_0xf6c6('0xa')](_0xf6c6('0xc'),auth[_0xf6c6('0xb')](),controller[_0xf6c6('0xd')]);router[_0xf6c6('0xe')]('/',auth[_0xf6c6('0xb')](),controller[_0xf6c6('0xf')]);router[_0xf6c6('0x10')](_0xf6c6('0xc'),auth[_0xf6c6('0xb')](),controller['update']);router[_0xf6c6('0x11')](_0xf6c6('0xc'),auth[_0xf6c6('0xb')](),controller[_0xf6c6('0x12')]);module[_0xf6c6('0x13')]=router;
\ No newline at end of file
+var _0xa7a9=['isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id'];(function(_0x934a0d,_0x17f4f9){var _0x129503=function(_0x42322d){while(--_0x42322d){_0x934a0d['push'](_0x934a0d['shift']());}};_0x129503(++_0x17f4f9);}(_0xa7a9,0x120));var _0x9a7a=function(_0x7f15ac,_0x508cbc){_0x7f15ac=_0x7f15ac-0x0;var _0x1dbd47=_0xa7a9[_0x7f15ac];return _0x1dbd47;};'use strict';var multer=require(_0x9a7a('0x0'));var util=require(_0x9a7a('0x1'));var path=require(_0x9a7a('0x2'));var timeout=require(_0x9a7a('0x3'));var express=require('express');var router=express[_0x9a7a('0x4')]();var auth=require(_0x9a7a('0x5'));var interaction=require(_0x9a7a('0x6'));var config=require(_0x9a7a('0x7'));var controller=require(_0x9a7a('0x8'));router[_0x9a7a('0x9')]('/',auth['isAuthenticated'](),controller[_0x9a7a('0xa')]);router['get'](_0x9a7a('0xb'),auth[_0x9a7a('0xc')](),controller[_0x9a7a('0xd')]);router[_0x9a7a('0xe')]('/',auth[_0x9a7a('0xc')](),controller[_0x9a7a('0xf')]);router[_0x9a7a('0x10')](_0x9a7a('0xb'),auth['isAuthenticated'](),controller[_0x9a7a('0x11')]);router[_0x9a7a('0x12')](_0x9a7a('0xb'),auth[_0x9a7a('0xc')](),controller[_0x9a7a('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 3b42a57..a00995c 100644
--- a/server/api/attachment/attachment.attributes.js
+++ b/server/api/attachment/attachment.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a61=['exports','STRING','sequelize'];(function(_0x52e68e,_0x309912){var _0x3211a4=function(_0x467c01){while(--_0x467c01){_0x52e68e['push'](_0x52e68e['shift']());}};_0x3211a4(++_0x309912);}(_0x7a61,0x92));var _0x17a6=function(_0x5859a4,_0x15df60){_0x5859a4=_0x5859a4-0x0;var _0x53d3ad=_0x7a61[_0x5859a4];return _0x53d3ad;};'use strict';var Sequelize=require(_0x17a6('0x0'));module[_0x17a6('0x1')]={'name':{'type':Sequelize[_0x17a6('0x2')]},'basename':{'type':Sequelize[_0x17a6('0x2')]},'type':{'type':Sequelize[_0x17a6('0x2')]}};
\ No newline at end of file
+var _0xf4d9=['STRING','sequelize'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0xf4d9,0x1a7));var _0x9f4d=function(_0x418349,_0x455c17){_0x418349=_0x418349-0x0;var _0x29686d=_0xf4d9[_0x418349];return _0x29686d;};'use strict';var Sequelize=require(_0x9f4d('0x0'));module['exports']={'name':{'type':Sequelize[_0x9f4d('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9f4d('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 5bae312..2afa58f 100644
--- a/server/api/attachment/attachment.controller.js
+++ b/server/api/attachment/attachment.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f1f=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','fields','find','clone','params','get','createdAt','body','updatedAt','create','update','file','originalname','filename','type','mimetype','download','findOne','root','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x4f1f,0x1d2));var _0xf4f1=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x4f1f[_0x24061a];return _0x82054e;};'use strict';var pdf=require(_0xf4f1('0x0'));var emlformat=require(_0xf4f1('0x1'));var rimraf=require(_0xf4f1('0x2'));var zipdir=require(_0xf4f1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4f1('0x4'));var moment=require(_0xf4f1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf4f1('0x6'));var path=require('path');var sox=require(_0xf4f1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf4f1('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf4f1('0x9'));var deskjs=require(_0xf4f1('0xa'));var toCsv=require(_0xf4f1('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf4f1('0xc'));var authService=require(_0xf4f1('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xf4f1('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4f1('0xf'))(_0xf4f1('0x10'));var utils=require(_0xf4f1('0x11'));var config=require(_0xf4f1('0x12'));var db=require(_0xf4f1('0x13'))['db'];function respondWithStatusCode(_0x1439dd,_0x230ad5){_0x230ad5=_0x230ad5||0xcc;return function(_0x490934){if(_0x490934){return _0x1439dd[_0xf4f1('0x14')](_0x230ad5);}return _0x1439dd[_0xf4f1('0x15')](_0x230ad5)['end']();};}function respondWithResult(_0x4effbb,_0x34b097){_0x34b097=_0x34b097||0xc8;return function(_0x2e16be){if(_0x2e16be){return _0x4effbb[_0xf4f1('0x15')](_0x34b097)[_0xf4f1('0x16')](_0x2e16be);}};}function respondWithFilteredResult(_0x1cf98f,_0x1eec51){return function(_0x19b283){if(_0x19b283){var _0x2cf5da=_0x19b283[_0xf4f1('0x17')],_0x1bde42=_0x1eec51[_0xf4f1('0x18')],_0x3357da=_0x1eec51[_0xf4f1('0x18')]+_0x1eec51[_0xf4f1('0x19')],_0x5f33b9;if(_0x3357da>=_0x2cf5da){_0x3357da=_0x2cf5da;_0x5f33b9=0xc8;}else{_0x5f33b9=0xce;}_0x1cf98f[_0xf4f1('0x15')](_0x5f33b9);return _0x1cf98f[_0xf4f1('0x1a')](_0xf4f1('0x1b'),_0x1bde42+'-'+_0x3357da+'/'+_0x2cf5da)[_0xf4f1('0x16')](_0x19b283);}return null;};}function patchUpdates(_0xfd27d0){return function(_0x3c135f){try{jsonpatch[_0xf4f1('0x1c')](_0x3c135f,_0xfd27d0,!![]);}catch(_0x3d9d93){return BPromise['reject'](_0x3d9d93);}return _0x3c135f[_0xf4f1('0x1d')]();};}function saveUpdates(_0x188e03,_0x5ec45a){return function(_0x7ec027){if(_0x7ec027){return _0x7ec027['update'](_0x188e03)[_0xf4f1('0x1e')](function(_0x53a813){return _0x53a813;});}return null;};}function removeEntity(_0x3e46cd,_0x1f63f4){return function(_0x36165c){if(_0x36165c){return _0x36165c[_0xf4f1('0x1f')]()[_0xf4f1('0x1e')](function(){_0x3e46cd[_0xf4f1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19b3ca,_0x5b5ae3){return function(_0x144f49){if(!_0x144f49){_0x19b3ca[_0xf4f1('0x14')](0x194);}return _0x144f49;};}function handleError(_0x15a14a,_0x5b5896){_0x5b5896=_0x5b5896||0x1f4;return function(_0x15b718){logger[_0xf4f1('0x20')](_0x15b718[_0xf4f1('0x21')]);if(_0x15b718['name']){delete _0x15b718[_0xf4f1('0x22')];}_0x15a14a[_0xf4f1('0x15')](_0x5b5896)['send'](_0x15b718);};}exports[_0xf4f1('0x23')]=function(_0x5e14b0,_0x56e2c3){var _0x119f3b={},_0x2889f3={},_0xfe6a97={'count':0x0,'rows':[]};var _0x243572=_[_0xf4f1('0x24')](db[_0xf4f1('0x25')][_0xf4f1('0x26')],function(_0x126366){return{'name':_0x126366[_0xf4f1('0x27')],'type':_0x126366['type']['key']};});_0x2889f3[_0xf4f1('0x28')]=_[_0xf4f1('0x24')](_0x243572,_0xf4f1('0x22'));_0x2889f3['query']=_[_0xf4f1('0x29')](_0x5e14b0[_0xf4f1('0x2a')]);_0x2889f3[_0xf4f1('0x2b')]=_[_0xf4f1('0x2c')](_0x2889f3[_0xf4f1('0x28')],_0x2889f3['query']);_0x119f3b[_0xf4f1('0x2d')]=_[_0xf4f1('0x2c')](_0x2889f3[_0xf4f1('0x28')],qs['fields'](_0x5e14b0[_0xf4f1('0x2a')]['fields']));_0x119f3b[_0xf4f1('0x2d')]=_0x119f3b[_0xf4f1('0x2d')][_0xf4f1('0x2e')]?_0x119f3b[_0xf4f1('0x2d')]:_0x2889f3[_0xf4f1('0x28')];if(!_0x5e14b0[_0xf4f1('0x2a')][_0xf4f1('0x2f')]('nolimit')){_0x119f3b[_0xf4f1('0x19')]=qs[_0xf4f1('0x19')](_0x5e14b0[_0xf4f1('0x2a')][_0xf4f1('0x19')]);_0x119f3b[_0xf4f1('0x18')]=qs[_0xf4f1('0x18')](_0x5e14b0['query'][_0xf4f1('0x18')]);}_0x119f3b[_0xf4f1('0x30')]=qs[_0xf4f1('0x31')](_0x5e14b0[_0xf4f1('0x2a')][_0xf4f1('0x31')]);_0x119f3b[_0xf4f1('0x32')]=qs[_0xf4f1('0x2b')](_[_0xf4f1('0x33')](_0x5e14b0[_0xf4f1('0x2a')],_0x2889f3[_0xf4f1('0x2b')]),_0x243572);if(_0x5e14b0['query'][_0xf4f1('0x34')]){_0x119f3b[_0xf4f1('0x32')]=_[_0xf4f1('0x35')](_0x119f3b[_0xf4f1('0x32')],{'$or':_[_0xf4f1('0x24')](_0x243572,function(_0x2e77d5){if(_0x2e77d5['type']!==_0xf4f1('0x36')){var _0x460849={};_0x460849[_0x2e77d5[_0xf4f1('0x22')]]={'$like':'%'+_0x5e14b0['query'][_0xf4f1('0x34')]+'%'};return _0x460849;}})});}_0x119f3b=_[_0xf4f1('0x35')]({},_0x119f3b,_0x5e14b0[_0xf4f1('0x37')]);var _0xc03e1f={'where':_0x119f3b[_0xf4f1('0x32')]};return db[_0xf4f1('0x25')][_0xf4f1('0x17')](_0xc03e1f)[_0xf4f1('0x1e')](function(_0x51602e){_0xfe6a97[_0xf4f1('0x17')]=_0x51602e;if(_0x5e14b0[_0xf4f1('0x2a')][_0xf4f1('0x38')]){_0x119f3b[_0xf4f1('0x39')]=[{'all':!![]}];}return db[_0xf4f1('0x25')][_0xf4f1('0x3a')](_0x119f3b);})[_0xf4f1('0x1e')](function(_0x22fcf5){_0xfe6a97['rows']=_0x22fcf5;return _0xfe6a97;})[_0xf4f1('0x1e')](respondWithFilteredResult(_0x56e2c3,_0x119f3b))[_0xf4f1('0x3b')](handleError(_0x56e2c3,null));};exports[_0xf4f1('0x3c')]=function(_0x3c1efc,_0x27e51b){var _0x21ff89={'raw':!![],'where':{'id':_0x3c1efc['params']['id']}},_0x52c0bd={};_0x52c0bd[_0xf4f1('0x28')]=_[_0xf4f1('0x29')](db['Attachment']['rawAttributes']);_0x52c0bd[_0xf4f1('0x2a')]=_[_0xf4f1('0x29')](_0x3c1efc['query']);_0x52c0bd[_0xf4f1('0x2b')]=_[_0xf4f1('0x2c')](_0x52c0bd[_0xf4f1('0x28')],_0x52c0bd[_0xf4f1('0x2a')]);_0x21ff89['attributes']=_[_0xf4f1('0x2c')](_0x52c0bd[_0xf4f1('0x28')],qs[_0xf4f1('0x3d')](_0x3c1efc['query']['fields']));_0x21ff89[_0xf4f1('0x2d')]=_0x21ff89[_0xf4f1('0x2d')][_0xf4f1('0x2e')]?_0x21ff89[_0xf4f1('0x2d')]:_0x52c0bd[_0xf4f1('0x28')];if(_0x3c1efc[_0xf4f1('0x2a')][_0xf4f1('0x38')]){_0x21ff89[_0xf4f1('0x39')]=[{'all':!![]}];}_0x21ff89=_[_0xf4f1('0x35')]({},_0x21ff89,_0x3c1efc[_0xf4f1('0x37')]);return db[_0xf4f1('0x25')][_0xf4f1('0x3e')](_0x21ff89)[_0xf4f1('0x1e')](handleEntityNotFound(_0x27e51b,null))[_0xf4f1('0x1e')](respondWithResult(_0x27e51b,null))['catch'](handleError(_0x27e51b,null));};exports[_0xf4f1('0x3f')]=function(_0x17cbca,_0x3a58c9){var _0x1e65b3={'where':{'id':_0x17cbca[_0xf4f1('0x40')]['id']}},_0x29cf8d={};_0x29cf8d['model']=_['keys'](db['Attachment'][_0xf4f1('0x26')]);_0x1e65b3[_0xf4f1('0x2d')]=_[_0xf4f1('0x2c')](_0x29cf8d[_0xf4f1('0x28')],qs[_0xf4f1('0x3d')](_0x17cbca['query'][_0xf4f1('0x3d')]));_0x1e65b3[_0xf4f1('0x2d')]=_0x1e65b3[_0xf4f1('0x2d')]['length']?_0x1e65b3['attributes']:_0x29cf8d['model'];if(_0x17cbca[_0xf4f1('0x2a')][_0xf4f1('0x38')]){_0x1e65b3[_0xf4f1('0x39')]=[{'all':!![]}];}_0x1e65b3=_[_0xf4f1('0x35')]({},_0x1e65b3,_0x17cbca[_0xf4f1('0x37')]);return db[_0xf4f1('0x25')][_0xf4f1('0x3e')](_0x1e65b3)['then'](handleEntityNotFound(_0x3a58c9,null))[_0xf4f1('0x1e')](function(_0x45f41d){if(_0x45f41d){var _0x143aeb=_0x45f41d[_0xf4f1('0x41')]({'plain':!![]});_0x143aeb=qs['omit'](_0x143aeb,['id',_0xf4f1('0x42'),'updatedAt']);_0x17cbca[_0xf4f1('0x43')]=_['omit'](_0x17cbca[_0xf4f1('0x43')],['id',_0xf4f1('0x42'),_0xf4f1('0x44')]);return db[_0xf4f1('0x25')][_0xf4f1('0x45')](_[_0xf4f1('0x35')](_0x143aeb,_0x17cbca[_0xf4f1('0x43')]),{'include':_0x17cbca['query'][_0xf4f1('0x38')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3a58c9,0xc9))[_0xf4f1('0x3b')](handleError(_0x3a58c9,null));};exports[_0xf4f1('0x46')]=function(_0x5047e1,_0x32a07b){if(_0x5047e1[_0xf4f1('0x43')]['id']){delete _0x5047e1[_0xf4f1('0x43')]['id'];}return db[_0xf4f1('0x25')][_0xf4f1('0x3e')]({'where':{'id':_0x5047e1[_0xf4f1('0x40')]['id']}})[_0xf4f1('0x1e')](handleEntityNotFound(_0x32a07b,null))[_0xf4f1('0x1e')](saveUpdates(_0x5047e1[_0xf4f1('0x43')],null))[_0xf4f1('0x1e')](respondWithResult(_0x32a07b,null))[_0xf4f1('0x3b')](handleError(_0x32a07b,null));};exports[_0xf4f1('0x1f')]=function(_0x3eac22,_0x4c37df){return db[_0xf4f1('0x25')]['find']({'where':{'id':_0x3eac22[_0xf4f1('0x40')]['id']}})[_0xf4f1('0x1e')](handleEntityNotFound(_0x4c37df,null))['then'](removeEntity(_0x4c37df,null))[_0xf4f1('0x3b')](handleError(_0x4c37df,null));};exports[_0xf4f1('0x45')]=function(_0x10936c,_0x5459ff,_0x2d1376){_0x10936c[_0xf4f1('0x43')][_0xf4f1('0x22')]=_0x10936c[_0xf4f1('0x47')][_0xf4f1('0x48')];_0x10936c[_0xf4f1('0x43')]['basename']=_0x10936c[_0xf4f1('0x47')][_0xf4f1('0x49')];_0x10936c[_0xf4f1('0x43')][_0xf4f1('0x4a')]=_0x10936c['file'][_0xf4f1('0x4b')];return db[_0xf4f1('0x25')][_0xf4f1('0x45')](_0x10936c[_0xf4f1('0x43')])[_0xf4f1('0x1e')](respondWithResult(_0x5459ff,0xc9))['catch'](handleError(_0x5459ff,null));};exports[_0xf4f1('0x4c')]=function(_0x557ada,_0x77500a,_0x339074){return db[_0xf4f1('0x25')][_0xf4f1('0x4d')]({'where':{'id':_0x557ada[_0xf4f1('0x40')]['id']},'raw':!![]})[_0xf4f1('0x1e')](handleEntityNotFound(_0x77500a,null))[_0xf4f1('0x1e')](function(_0x168dcb){if(_0x168dcb){return _0x77500a[_0xf4f1('0x4c')](path['join'](config[_0xf4f1('0x4e')],_0xf4f1('0x4f'),_0x168dcb['basename']));}})[_0xf4f1('0x3b')](handleError(_0x77500a,null));};
\ No newline at end of file
+var _0x5a16=['Attachment','includeAll','findAll','rows','show','params','fields','length','find','include','createdAt','updatedAt','body','omit','catch','file','originalname','basename','mimetype','create','download','join','root','server/files/attachments/','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x5a63e7,_0x4be03b){var _0x9eca76=function(_0x51ca04){while(--_0x51ca04){_0x5a63e7['push'](_0x5a63e7['shift']());}};_0x9eca76(++_0x4be03b);}(_0x5a16,0x1c6));var _0x65a1=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x5a16[_0x299784];return _0x5ab008;};'use strict';var pdf=require(_0x65a1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x65a1('0x1'));var jsonpatch=require(_0x65a1('0x2'));var rp=require(_0x65a1('0x3'));var moment=require(_0x65a1('0x4'));var BPromise=require(_0x65a1('0x5'));var Mustache=require(_0x65a1('0x6'));var util=require(_0x65a1('0x7'));var path=require(_0x65a1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x65a1('0x9'));var fs=require('fs');var _=require(_0x65a1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x65a1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x65a1('0xc'));var querystring=require('querystring');var Papa=require(_0x65a1('0xd'));var Redis=require(_0x65a1('0xe'));var authService=require(_0x65a1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x65a1('0x10'));var hardwareService=require(_0x65a1('0x11'));var logger=require(_0x65a1('0x12'))('api');var utils=require(_0x65a1('0x13'));var config=require(_0x65a1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f2223,_0x1e381d){_0x1e381d=_0x1e381d||0xcc;return function(_0x10c866){if(_0x10c866){return _0x2f2223[_0x65a1('0x15')](_0x1e381d);}return _0x2f2223[_0x65a1('0x16')](_0x1e381d)[_0x65a1('0x17')]();};}function respondWithResult(_0x17549e,_0x3b01fd){_0x3b01fd=_0x3b01fd||0xc8;return function(_0x2b61bf){if(_0x2b61bf){return _0x17549e[_0x65a1('0x16')](_0x3b01fd)['json'](_0x2b61bf);}};}function respondWithFilteredResult(_0x58d4c0,_0x568ae3){return function(_0x5eb564){if(_0x5eb564){var _0x2ad912=_0x5eb564[_0x65a1('0x18')],_0x44bb17=_0x568ae3[_0x65a1('0x19')],_0xd0e038=_0x568ae3[_0x65a1('0x19')]+_0x568ae3[_0x65a1('0x1a')],_0x545cea;if(_0xd0e038>=_0x2ad912){_0xd0e038=_0x2ad912;_0x545cea=0xc8;}else{_0x545cea=0xce;}_0x58d4c0[_0x65a1('0x16')](_0x545cea);return _0x58d4c0[_0x65a1('0x1b')](_0x65a1('0x1c'),_0x44bb17+'-'+_0xd0e038+'/'+_0x2ad912)[_0x65a1('0x1d')](_0x5eb564);}return null;};}function patchUpdates(_0x30ed40){return function(_0x180921){try{jsonpatch[_0x65a1('0x1e')](_0x180921,_0x30ed40,!![]);}catch(_0x3fe792){return BPromise[_0x65a1('0x1f')](_0x3fe792);}return _0x180921[_0x65a1('0x20')]();};}function saveUpdates(_0x490bce,_0x32f8db){return function(_0x48e9b0){if(_0x48e9b0){return _0x48e9b0[_0x65a1('0x21')](_0x490bce)['then'](function(_0x3606b6){return _0x3606b6;});}return null;};}function removeEntity(_0x1d8155,_0x3d2781){return function(_0x353532){if(_0x353532){return _0x353532[_0x65a1('0x22')]()[_0x65a1('0x23')](function(){_0x1d8155['status'](0xcc)[_0x65a1('0x17')]();});}};}function handleEntityNotFound(_0x1e265f,_0x450757){return function(_0xfa7fc8){if(!_0xfa7fc8){_0x1e265f['sendStatus'](0x194);}return _0xfa7fc8;};}function handleError(_0x15f432,_0x190209){_0x190209=_0x190209||0x1f4;return function(_0x453cdb){logger[_0x65a1('0x24')](_0x453cdb[_0x65a1('0x25')]);if(_0x453cdb[_0x65a1('0x26')]){delete _0x453cdb[_0x65a1('0x26')];}_0x15f432[_0x65a1('0x16')](_0x190209)[_0x65a1('0x27')](_0x453cdb);};}exports[_0x65a1('0x28')]=function(_0x2b2574,_0x4305d1){var _0x55ef11={},_0x2f7e37={},_0x714951={'count':0x0,'rows':[]};var _0x46bfba=_[_0x65a1('0x29')](db['Attachment'][_0x65a1('0x2a')],function(_0x32a440){return{'name':_0x32a440[_0x65a1('0x2b')],'type':_0x32a440[_0x65a1('0x2c')][_0x65a1('0x2d')]};});_0x2f7e37[_0x65a1('0x2e')]=_[_0x65a1('0x29')](_0x46bfba,_0x65a1('0x26'));_0x2f7e37[_0x65a1('0x2f')]=_[_0x65a1('0x30')](_0x2b2574['query']);_0x2f7e37[_0x65a1('0x31')]=_[_0x65a1('0x32')](_0x2f7e37[_0x65a1('0x2e')],_0x2f7e37[_0x65a1('0x2f')]);_0x55ef11[_0x65a1('0x33')]=_['intersection'](_0x2f7e37[_0x65a1('0x2e')],qs['fields'](_0x2b2574[_0x65a1('0x2f')]['fields']));_0x55ef11['attributes']=_0x55ef11[_0x65a1('0x33')]['length']?_0x55ef11['attributes']:_0x2f7e37['model'];if(!_0x2b2574['query'][_0x65a1('0x34')](_0x65a1('0x35'))){_0x55ef11[_0x65a1('0x1a')]=qs[_0x65a1('0x1a')](_0x2b2574['query'][_0x65a1('0x1a')]);_0x55ef11[_0x65a1('0x19')]=qs[_0x65a1('0x19')](_0x2b2574[_0x65a1('0x2f')]['offset']);}_0x55ef11[_0x65a1('0x36')]=qs[_0x65a1('0x37')](_0x2b2574[_0x65a1('0x2f')][_0x65a1('0x37')]);_0x55ef11[_0x65a1('0x38')]=qs[_0x65a1('0x31')](_[_0x65a1('0x39')](_0x2b2574[_0x65a1('0x2f')],_0x2f7e37[_0x65a1('0x31')]),_0x46bfba);if(_0x2b2574[_0x65a1('0x2f')][_0x65a1('0x3a')]){_0x55ef11[_0x65a1('0x38')]=_[_0x65a1('0x3b')](_0x55ef11[_0x65a1('0x38')],{'$or':_['map'](_0x46bfba,function(_0xbc8501){if(_0xbc8501[_0x65a1('0x2c')]!==_0x65a1('0x3c')){var _0x1c36c8={};_0x1c36c8[_0xbc8501[_0x65a1('0x26')]]={'$like':'%'+_0x2b2574[_0x65a1('0x2f')][_0x65a1('0x3a')]+'%'};return _0x1c36c8;}})});}_0x55ef11=_[_0x65a1('0x3b')]({},_0x55ef11,_0x2b2574[_0x65a1('0x3d')]);var _0x52d23a={'where':_0x55ef11[_0x65a1('0x38')]};return db[_0x65a1('0x3e')][_0x65a1('0x18')](_0x52d23a)[_0x65a1('0x23')](function(_0x12d190){_0x714951[_0x65a1('0x18')]=_0x12d190;if(_0x2b2574[_0x65a1('0x2f')][_0x65a1('0x3f')]){_0x55ef11['include']=[{'all':!![]}];}return db['Attachment'][_0x65a1('0x40')](_0x55ef11);})['then'](function(_0x43a9e1){_0x714951[_0x65a1('0x41')]=_0x43a9e1;return _0x714951;})[_0x65a1('0x23')](respondWithFilteredResult(_0x4305d1,_0x55ef11))['catch'](handleError(_0x4305d1,null));};exports[_0x65a1('0x42')]=function(_0x404191,_0x2b88d5){var _0x152a71={'raw':!![],'where':{'id':_0x404191[_0x65a1('0x43')]['id']}},_0x5ad30c={};_0x5ad30c['model']=_['keys'](db[_0x65a1('0x3e')][_0x65a1('0x2a')]);_0x5ad30c[_0x65a1('0x2f')]=_['keys'](_0x404191[_0x65a1('0x2f')]);_0x5ad30c[_0x65a1('0x31')]=_[_0x65a1('0x32')](_0x5ad30c['model'],_0x5ad30c[_0x65a1('0x2f')]);_0x152a71[_0x65a1('0x33')]=_[_0x65a1('0x32')](_0x5ad30c[_0x65a1('0x2e')],qs[_0x65a1('0x44')](_0x404191[_0x65a1('0x2f')][_0x65a1('0x44')]));_0x152a71[_0x65a1('0x33')]=_0x152a71['attributes'][_0x65a1('0x45')]?_0x152a71[_0x65a1('0x33')]:_0x5ad30c[_0x65a1('0x2e')];if(_0x404191[_0x65a1('0x2f')]['includeAll']){_0x152a71['include']=[{'all':!![]}];}_0x152a71=_['merge']({},_0x152a71,_0x404191[_0x65a1('0x3d')]);return db['Attachment'][_0x65a1('0x46')](_0x152a71)[_0x65a1('0x23')](handleEntityNotFound(_0x2b88d5,null))[_0x65a1('0x23')](respondWithResult(_0x2b88d5,null))['catch'](handleError(_0x2b88d5,null));};exports['clone']=function(_0x2e4f5d,_0x4b3ce1){var _0x4c2460={'where':{'id':_0x2e4f5d[_0x65a1('0x43')]['id']}},_0x4bdf04={};_0x4bdf04[_0x65a1('0x2e')]=_[_0x65a1('0x30')](db[_0x65a1('0x3e')]['rawAttributes']);_0x4c2460[_0x65a1('0x33')]=_[_0x65a1('0x32')](_0x4bdf04['model'],qs['fields'](_0x2e4f5d[_0x65a1('0x2f')][_0x65a1('0x44')]));_0x4c2460[_0x65a1('0x33')]=_0x4c2460['attributes'][_0x65a1('0x45')]?_0x4c2460[_0x65a1('0x33')]:_0x4bdf04['model'];if(_0x2e4f5d['query']['includeAll']){_0x4c2460[_0x65a1('0x47')]=[{'all':!![]}];}_0x4c2460=_[_0x65a1('0x3b')]({},_0x4c2460,_0x2e4f5d[_0x65a1('0x3d')]);return db[_0x65a1('0x3e')]['find'](_0x4c2460)[_0x65a1('0x23')](handleEntityNotFound(_0x4b3ce1,null))['then'](function(_0x4a3f15){if(_0x4a3f15){var _0xcc73f5=_0x4a3f15['get']({'plain':!![]});_0xcc73f5=qs['omit'](_0xcc73f5,['id',_0x65a1('0x48'),_0x65a1('0x49')]);_0x2e4f5d[_0x65a1('0x4a')]=_[_0x65a1('0x4b')](_0x2e4f5d[_0x65a1('0x4a')],['id',_0x65a1('0x48'),_0x65a1('0x49')]);return db[_0x65a1('0x3e')]['create'](_['merge'](_0xcc73f5,_0x2e4f5d['body']),{'include':_0x2e4f5d[_0x65a1('0x2f')][_0x65a1('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4b3ce1,0xc9))['catch'](handleError(_0x4b3ce1,null));};exports[_0x65a1('0x21')]=function(_0x1b2e04,_0x24cc6e){if(_0x1b2e04[_0x65a1('0x4a')]['id']){delete _0x1b2e04['body']['id'];}return db['Attachment'][_0x65a1('0x46')]({'where':{'id':_0x1b2e04[_0x65a1('0x43')]['id']}})[_0x65a1('0x23')](handleEntityNotFound(_0x24cc6e,null))[_0x65a1('0x23')](saveUpdates(_0x1b2e04[_0x65a1('0x4a')],null))[_0x65a1('0x23')](respondWithResult(_0x24cc6e,null))['catch'](handleError(_0x24cc6e,null));};exports[_0x65a1('0x22')]=function(_0x257728,_0x268479){return db[_0x65a1('0x3e')][_0x65a1('0x46')]({'where':{'id':_0x257728[_0x65a1('0x43')]['id']}})[_0x65a1('0x23')](handleEntityNotFound(_0x268479,null))[_0x65a1('0x23')](removeEntity(_0x268479,null))[_0x65a1('0x4c')](handleError(_0x268479,null));};exports['create']=function(_0x449b68,_0x3ae7a3,_0x588f58){_0x449b68[_0x65a1('0x4a')][_0x65a1('0x26')]=_0x449b68[_0x65a1('0x4d')][_0x65a1('0x4e')];_0x449b68[_0x65a1('0x4a')][_0x65a1('0x4f')]=_0x449b68['file']['filename'];_0x449b68[_0x65a1('0x4a')][_0x65a1('0x2c')]=_0x449b68[_0x65a1('0x4d')][_0x65a1('0x50')];return db[_0x65a1('0x3e')][_0x65a1('0x51')](_0x449b68['body'])[_0x65a1('0x23')](respondWithResult(_0x3ae7a3,0xc9))[_0x65a1('0x4c')](handleError(_0x3ae7a3,null));};exports[_0x65a1('0x52')]=function(_0x519a95,_0x3f00d6,_0x10eb16){return db['Attachment']['findOne']({'where':{'id':_0x519a95[_0x65a1('0x43')]['id']},'raw':!![]})[_0x65a1('0x23')](handleEntityNotFound(_0x3f00d6,null))[_0x65a1('0x23')](function(_0x3db7ef){if(_0x3db7ef){return _0x3f00d6[_0x65a1('0x52')](path[_0x65a1('0x53')](config[_0x65a1('0x54')],_0x65a1('0x55'),_0x3db7ef[_0x65a1('0x4f')]));}})[_0x65a1('0x4c')](handleError(_0x3f00d6,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 0babc27..fcf43a0 100644
--- a/server/api/attachment/attachment.model.js
+++ b/server/api/attachment/attachment.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7af2=['../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x104dca,_0x35f409){var _0x3f864e=function(_0x151646){while(--_0x151646){_0x104dca['push'](_0x104dca['shift']());}};_0x3f864e(++_0x35f409);}(_0x7af2,0x119));var _0x27af=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0x7af2[_0x20cb20];return _0x2fcf4b;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var logger=require(_0x27af('0x1'))(_0x27af('0x2'));var moment=require(_0x27af('0x3'));var BPromise=require('bluebird');var rp=require(_0x27af('0x4'));var fs=require('fs');var path=require(_0x27af('0x5'));var rimraf=require(_0x27af('0x6'));var config=require(_0x27af('0x7'));var attributes=require(_0x27af('0x8'));module[_0x27af('0x9')]=function(_0x350532,_0x184630){return _0x350532[_0x27af('0xa')]('Attachment',attributes,{'tableName':_0x27af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4c4e=['moment','request-promise','path','rimraf','./attachment.attributes','define','Attachment','attachments','lodash','../../config/logger','api'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4c4e,0x152));var _0xe4c4=function(_0xa27dcc,_0x1b193a){_0xa27dcc=_0xa27dcc-0x0;var _0x2fb8d3=_0x4c4e[_0xa27dcc];return _0x2fb8d3;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require(_0xe4c4('0x5'));var rimraf=require(_0xe4c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4c4('0x7'));module['exports']=function(_0x177732,_0x1a12a6){return _0x177732[_0xe4c4('0x8')](_0xe4c4('0x9'),attributes,{'tableName':_0xe4c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 2319323..392807c 100644
--- a/server/api/attachment/attachment.rpc.js
+++ b/server/api/attachment/attachment.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d10=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','create','body','options','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info'];(function(_0x37e11d,_0x262020){var _0xace894=function(_0x2774ac){while(--_0x2774ac){_0x37e11d['push'](_0x37e11d['shift']());}};_0xace894(++_0x262020);}(_0x6d10,0x1e2));var _0x06d1=function(_0x5c6ce2,_0x295913){_0x5c6ce2=_0x5c6ce2-0x0;var _0xf38ee5=_0x6d10[_0x5c6ce2];return _0xf38ee5;};'use strict';var _=require(_0x06d1('0x0'));var util=require(_0x06d1('0x1'));var moment=require(_0x06d1('0x2'));var BPromise=require(_0x06d1('0x3'));var rs=require(_0x06d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06d1('0x5'))['db'];var utils=require(_0x06d1('0x6'));var logger=require(_0x06d1('0x7'))('rpc');var config=require(_0x06d1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06d1('0x9')][_0x06d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53f37c,_0x2a9f8b,_0x5bbb65){return new BPromise(function(_0x536d7f,_0x205dd4){return client['request'](_0x53f37c,_0x5bbb65)['then'](function(_0x21deca){logger[_0x06d1('0xb')](_0x06d1('0xc'),_0x2a9f8b,_0x06d1('0xd'));logger[_0x06d1('0xe')](_0x06d1('0xf'),_0x2a9f8b,_0x06d1('0xd'),JSON['stringify'](_0x21deca));if(_0x21deca[_0x06d1('0x10')]){if(_0x21deca['error'][_0x06d1('0x11')]===0x1f4){logger['error'](_0x06d1('0xc'),_0x2a9f8b,_0x21deca[_0x06d1('0x10')][_0x06d1('0x12')]);return _0x205dd4(_0x21deca['error'][_0x06d1('0x12')]);}logger[_0x06d1('0x10')](_0x06d1('0xc'),_0x2a9f8b,_0x21deca[_0x06d1('0x10')][_0x06d1('0x12')]);return _0x536d7f(_0x21deca[_0x06d1('0x10')][_0x06d1('0x12')]);}else{logger[_0x06d1('0xb')](_0x06d1('0xc'),_0x2a9f8b,'request\x20sent');_0x536d7f(_0x21deca[_0x06d1('0x13')][_0x06d1('0x12')]);}})[_0x06d1('0x14')](function(_0x50673b){logger[_0x06d1('0x10')](_0x06d1('0xc'),_0x2a9f8b,_0x50673b);_0x205dd4(_0x50673b);});});}exports[_0x06d1('0x15')]=function(_0x44ee34){var _0x105597=this;return new Promise(function(_0x5d3925,_0x1a6822){return db['Attachment'][_0x06d1('0x16')](_0x44ee34[_0x06d1('0x17')],{'raw':_0x44ee34['options']?_0x44ee34[_0x06d1('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x12ebc0){logger[_0x06d1('0xb')](_0x06d1('0x15'),_0x44ee34);logger[_0x06d1('0xe')](_0x06d1('0x15'),_0x44ee34,JSON[_0x06d1('0x19')](_0x12ebc0));_0x5d3925(_0x12ebc0);})[_0x06d1('0x14')](function(_0xef3b7b){logger['error']('CreateAttachment',_0xef3b7b['message'],_0x44ee34);_0x1a6822(_0x105597[_0x06d1('0x10')](0x1f4,_0xef3b7b[_0x06d1('0x12')]));});});};
\ No newline at end of file
+var _0x619f=['message','info','result','catch','CreateAttachment','create','body','options','raw','then','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','Attachment,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x25f280,_0x78272f){var _0x291cc9=function(_0x2acb8f){while(--_0x2acb8f){_0x25f280['push'](_0x25f280['shift']());}};_0x291cc9(++_0x78272f);}(_0x619f,0x12a));var _0xf619=function(_0x161e88,_0x49ce5e){_0x161e88=_0x161e88-0x0;var _0x40ee62=_0x619f[_0x161e88];return _0x40ee62;};'use strict';var _=require(_0xf619('0x0'));var util=require('util');var moment=require(_0xf619('0x1'));var BPromise=require('bluebird');var rs=require(_0xf619('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf619('0x3'))['db'];var utils=require(_0xf619('0x4'));var logger=require(_0xf619('0x5'))(_0xf619('0x6'));var config=require(_0xf619('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf619('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3116ec,_0x540f66,_0x3d3e95){return new BPromise(function(_0xe98a1b,_0x37ade4){return client['request'](_0x3116ec,_0x3d3e95)['then'](function(_0x5e87d5){logger['info'](_0xf619('0x9'),_0x540f66,'request\x20sent');logger[_0xf619('0xa')]('Attachment,\x20%s,\x20%s,\x20%s',_0x540f66,_0xf619('0xb'),JSON[_0xf619('0xc')](_0x5e87d5));if(_0x5e87d5[_0xf619('0xd')]){if(_0x5e87d5[_0xf619('0xd')]['code']===0x1f4){logger[_0xf619('0xd')](_0xf619('0x9'),_0x540f66,_0x5e87d5[_0xf619('0xd')]['message']);return _0x37ade4(_0x5e87d5[_0xf619('0xd')][_0xf619('0xe')]);}logger[_0xf619('0xd')](_0xf619('0x9'),_0x540f66,_0x5e87d5[_0xf619('0xd')][_0xf619('0xe')]);return _0xe98a1b(_0x5e87d5[_0xf619('0xd')]['message']);}else{logger[_0xf619('0xf')](_0xf619('0x9'),_0x540f66,_0xf619('0xb'));_0xe98a1b(_0x5e87d5[_0xf619('0x10')][_0xf619('0xe')]);}})[_0xf619('0x11')](function(_0x3de9b9){logger[_0xf619('0xd')]('Attachment,\x20%s,\x20%s',_0x540f66,_0x3de9b9);_0x37ade4(_0x3de9b9);});});}exports[_0xf619('0x12')]=function(_0x3e3de7){var _0x5aed5e=this;return new Promise(function(_0x2c8fc6,_0x10ad7d){return db['Attachment'][_0xf619('0x13')](_0x3e3de7[_0xf619('0x14')],{'raw':_0x3e3de7[_0xf619('0x15')]?_0x3e3de7['options'][_0xf619('0x16')]===undefined?!![]:![]:!![]})[_0xf619('0x17')](function(_0x1966a0){logger['info'](_0xf619('0x12'),_0x3e3de7);logger[_0xf619('0xa')](_0xf619('0x12'),_0x3e3de7,JSON['stringify'](_0x1966a0));_0x2c8fc6(_0x1966a0);})[_0xf619('0x11')](function(_0x51f522){logger[_0xf619('0xd')](_0xf619('0x12'),_0x51f522['message'],_0x3e3de7);_0x10ad7d(_0x5aed5e['error'](0x1f4,_0x51f522[_0xf619('0xe')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 2d6333a..5baa6e7 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa4d=['/:id/download','download','post','clone','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4ac6f7,_0x3508c9){var _0x32cf5a=function(_0x658ab7){while(--_0x658ab7){_0x4ac6f7['push'](_0x4ac6f7['shift']());}};_0x32cf5a(++_0x3508c9);}(_0xfa4d,0x90));var _0xdfa4=function(_0x12a36b,_0xe759ad){_0x12a36b=_0x12a36b-0x0;var _0x405d87=_0xfa4d[_0x12a36b];return _0x405d87;};'use strict';var multer=require(_0xdfa4('0x0'));var util=require(_0xdfa4('0x1'));var path=require('path');var timeout=require(_0xdfa4('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdfa4('0x3'));var config=require(_0xdfa4('0x4'));var controller=require(_0xdfa4('0x5'));router[_0xdfa4('0x6')]('/',auth[_0xdfa4('0x7')](),controller[_0xdfa4('0x8')]);router[_0xdfa4('0x6')](_0xdfa4('0x9'),auth[_0xdfa4('0x7')](),controller[_0xdfa4('0xa')]);router[_0xdfa4('0x6')](_0xdfa4('0xb'),auth[_0xdfa4('0x7')](),controller[_0xdfa4('0xc')]);router[_0xdfa4('0xd')]('/:id/clone',auth['isAuthenticated'](),controller[_0xdfa4('0xe')]);var upload=multer({'storage':multer[_0xdfa4('0xf')]({'destination':function(_0x5c76a4,_0x13dc49,_0x48a3ef){_0x48a3ef(null,path[_0xdfa4('0x10')](config[_0xdfa4('0x11')],_0xdfa4('0x12')));},'filename':function(_0xfa1d4b,_0x1f45d6,_0x2c56ff){_0x2c56ff(null,util[_0xdfa4('0x13')](_0xdfa4('0x14'),Date[_0xdfa4('0x15')](),_0x1f45d6[_0xdfa4('0x16')][_0xdfa4('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdfa4('0xd')]('/',upload[_0xdfa4('0x18')]('file'),controller[_0xdfa4('0x19')]);router[_0xdfa4('0x1a')](_0xdfa4('0x9'),auth['isAuthenticated'](),controller[_0xdfa4('0x1b')]);router[_0xdfa4('0x1c')]('/:id',auth[_0xdfa4('0x7')](),controller[_0xdfa4('0x1d')]);module[_0xdfa4('0x1e')]=router;
\ No newline at end of file
+var _0xccbf=['originalname','single','file','create','put','update','delete','destroy','exports','path','connect-timeout','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccbf,0x1ef));var _0xfccb=function(_0x4f1dfd,_0xea3443){_0x4f1dfd=_0x4f1dfd-0x0;var _0x428192=_0xccbf[_0x4f1dfd];return _0x428192;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfccb('0x0'));var timeout=require(_0xfccb('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfccb('0x2'));var config=require(_0xfccb('0x3'));var controller=require(_0xfccb('0x4'));router[_0xfccb('0x5')]('/',auth[_0xfccb('0x6')](),controller[_0xfccb('0x7')]);router[_0xfccb('0x5')](_0xfccb('0x8'),auth[_0xfccb('0x6')](),controller[_0xfccb('0x9')]);router['get']('/:id/download',auth[_0xfccb('0x6')](),controller['download']);router[_0xfccb('0xa')](_0xfccb('0xb'),auth[_0xfccb('0x6')](),controller[_0xfccb('0xc')]);var upload=multer({'storage':multer[_0xfccb('0xd')]({'destination':function(_0x12bf65,_0x40d033,_0x596f5e){_0x596f5e(null,path[_0xfccb('0xe')](config['root'],_0xfccb('0xf')));},'filename':function(_0x33ac81,_0x294290,_0x6347e){_0x6347e(null,util[_0xfccb('0x10')]('%s-%s',Date[_0xfccb('0x11')](),_0x294290[_0xfccb('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xfccb('0xa')]('/',upload[_0xfccb('0x13')](_0xfccb('0x14')),controller[_0xfccb('0x15')]);router[_0xfccb('0x16')]('/:id',auth[_0xfccb('0x6')](),controller[_0xfccb('0x17')]);router[_0xfccb('0x18')](_0xfccb('0x8'),auth['isAuthenticated'](),controller[_0xfccb('0x19')]);module[_0xfccb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 7ad41c6..591b874 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd2b7=['passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','getLicense','lodash','passport'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd2b7,0x1ae));var _0x7d2b=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0xd2b7[_0x2b9e8a];return _0x520e67;};'use strict';var _=require(_0x7d2b('0x0'));var passport=require(_0x7d2b('0x1'));var GoogleStrategy=require(_0x7d2b('0x2'))['Strategy'];var moment=require(_0x7d2b('0x3'));var db=require(_0x7d2b('0x4'))['db'];var config=require(_0x7d2b('0x5'));var signToken=require(_0x7d2b('0x6'))[_0x7d2b('0x7')];var utils=require(_0x7d2b('0x8'));exports['login']=passport[_0x7d2b('0x9')](_0x7d2b('0xa'),{'failureRedirect':_0x7d2b('0xb'),'scope':[_0x7d2b('0xc'),_0x7d2b('0xd')],'session':![]});exports[_0x7d2b('0xe')]=passport[_0x7d2b('0x9')](_0x7d2b('0xa'),{'failureRedirect':_0x7d2b('0xb'),'session':![]});passport[_0x7d2b('0xf')](new GoogleStrategy({'clientID':config[_0x7d2b('0xa')]?config['google'][_0x7d2b('0x10')]:'id','clientSecret':config[_0x7d2b('0xa')]?config[_0x7d2b('0xa')][_0x7d2b('0x11')]:'secret','callbackURL':config[_0x7d2b('0xa')]?config[_0x7d2b('0xa')][_0x7d2b('0x12')]:''},function(_0x96ce84,_0x45d853,_0x46705d,_0x3f9411){var _0x3a277f,_0xd5c985;return db[_0x7d2b('0x13')][_0x7d2b('0x14')]({'where':{'id':0x1},'attributes':[_0x7d2b('0x15'),_0x7d2b('0x16')],'raw':!![]})[_0x7d2b('0x17')](function(_0x2e771f){_0x3a277f=_0x2e771f;return db[_0x7d2b('0x18')][_0x7d2b('0x19')]({'where':{'email':_[_0x7d2b('0x1a')](_0x46705d[_0x7d2b('0x1b')],_0x7d2b('0x1c')),'role':{'$or':[_0x7d2b('0x1d'),_0x7d2b('0x1e'),'agent']}}});})[_0x7d2b('0x17')](function(_0x2d3ed6){_0xd5c985=_0x2d3ed6;if(_0xd5c985){if(_0xd5c985[_0x7d2b('0x1f')]){return _0x3f9411(_0x7d2b('0x20'));}else if(_0x3a277f[_0x7d2b('0x16')]>0x0){if(_0xd5c985['blocked']){if(moment(_0xd5c985[_0x7d2b('0x21')])[_0x7d2b('0x22')](_0x3a277f[_0x7d2b('0x16')],'minutes')>moment()){return _0x3f9411(_0x7d2b('0x20'));}else{return utils['clearBlockUser'](_0xd5c985,0x0,![],null)[_0x7d2b('0x17')](function(){return utils[_0x7d2b('0x23')](_0xd5c985);})[_0x7d2b('0x17')](function(){return _0x3f9411(null,_0xd5c985);});}}else{return utils['getLicense'](_0xd5c985)['then'](function(){return _0x3f9411(null,_0xd5c985);});}}else{return utils[_0x7d2b('0x23')](_0xd5c985)[_0x7d2b('0x17')](function(){return _0x3f9411(null,_0xd5c985);});}}return _0x3f9411(_0x7d2b('0x20'));})['catch'](function(_0x59fdec){_0x3f9411(_0x59fdec);});}));
\ No newline at end of file
+var _0xf267=['user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','passport','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','secret','callbackURL','findOne','blockDuration','then','find','map','admin'];(function(_0x58a25c,_0x1c4470){var _0x2c4441=function(_0x4088be){while(--_0x4088be){_0x58a25c['push'](_0x58a25c['shift']());}};_0x2c4441(++_0x1c4470);}(_0xf267,0xe1));var _0x7f26=function(_0x184132,_0x35c646){_0x184132=_0x184132-0x0;var _0x1b3ff1=_0xf267[_0x184132];return _0x1b3ff1;};'use strict';var _=require('lodash');var passport=require(_0x7f26('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0x7f26('0x1')];var moment=require(_0x7f26('0x2'));var db=require(_0x7f26('0x3'))['db'];var config=require(_0x7f26('0x4'));var signToken=require('../../components/auth/service')[_0x7f26('0x5')];var utils=require(_0x7f26('0x6'));exports[_0x7f26('0x7')]=passport['authenticate'](_0x7f26('0x8'),{'failureRedirect':_0x7f26('0x9'),'scope':[_0x7f26('0xa'),_0x7f26('0xb')],'session':![]});exports[_0x7f26('0xc')]=passport[_0x7f26('0xd')](_0x7f26('0x8'),{'failureRedirect':_0x7f26('0x9'),'session':![]});passport[_0x7f26('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7f26('0x8')]['clientID']:'id','clientSecret':config['google']?config[_0x7f26('0x8')]['clientSecret']:_0x7f26('0xf'),'callbackURL':config[_0x7f26('0x8')]?config[_0x7f26('0x8')][_0x7f26('0x10')]:''},function(_0x15eac0,_0x5aa613,_0x5c4205,_0xf380b){var _0x1ba1ca,_0x3f478d;return db['Setting'][_0x7f26('0x11')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7f26('0x12')],'raw':!![]})[_0x7f26('0x13')](function(_0x527058){_0x1ba1ca=_0x527058;return db['User'][_0x7f26('0x14')]({'where':{'email':_[_0x7f26('0x15')](_0x5c4205['emails'],'value'),'role':{'$or':[_0x7f26('0x16'),_0x7f26('0x17'),'agent']}}});})[_0x7f26('0x13')](function(_0x1d7af0){_0x3f478d=_0x1d7af0;if(_0x3f478d){if(_0x3f478d['disabled']){return _0xf380b(_0x7f26('0x18'));}else if(_0x1ba1ca['blockDuration']>0x0){if(_0x3f478d[_0x7f26('0x19')]){if(moment(_0x3f478d[_0x7f26('0x1a')])[_0x7f26('0x1b')](_0x1ba1ca[_0x7f26('0x12')],_0x7f26('0x1c'))>moment()){return _0xf380b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x7f26('0x1d')](_0x3f478d,0x0,![],null)[_0x7f26('0x13')](function(){return utils['getLicense'](_0x3f478d);})['then'](function(){return _0xf380b(null,_0x3f478d);});}}else{return utils[_0x7f26('0x1e')](_0x3f478d)[_0x7f26('0x13')](function(){return _0xf380b(null,_0x3f478d);});}}else{return utils[_0x7f26('0x1e')](_0x3f478d)['then'](function(){return _0xf380b(null,_0x3f478d);});}}return _0xf380b(_0x7f26('0x18'));})['catch'](function(_0xb239f1){_0xf380b(_0xb239f1);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 7ed7ccf..38091fa 100644
--- a/server/api/authGoogle/index.js
+++ b/server/api/authGoogle/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b87=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express'];(function(_0x421d92,_0x1b8c8f){var _0x9c0b2b=function(_0x4b5ff1){while(--_0x4b5ff1){_0x421d92['push'](_0x421d92['shift']());}};_0x9c0b2b(++_0x1b8c8f);}(_0x9b87,0x8e));var _0x79b8=function(_0x5aee44,_0x444042){_0x5aee44=_0x5aee44-0x0;var _0x216686=_0x9b87[_0x5aee44];return _0x216686;};'use strict';var express=require(_0x79b8('0x0'));var passport=require(_0x79b8('0x1'));var router=express[_0x79b8('0x2')]();var controller=require(_0x79b8('0x3'));var userController=require(_0x79b8('0x4'));var authService=require(_0x79b8('0x5'));router[_0x79b8('0x6')]('/',controller[_0x79b8('0x7')]);router[_0x79b8('0x6')](_0x79b8('0x8'),controller[_0x79b8('0x9')],authService[_0x79b8('0xa')],userController[_0x79b8('0x7')],authService[_0x79b8('0xb')]);module[_0x79b8('0xc')]=router;
\ No newline at end of file
+var _0x7ee1=['exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','isMiddleware','login','setTokenCookie'];(function(_0x1f0802,_0x25db3e){var _0x2a4617=function(_0x3486a5){while(--_0x3486a5){_0x1f0802['push'](_0x1f0802['shift']());}};_0x2a4617(++_0x25db3e);}(_0x7ee1,0xab));var _0x17ee=function(_0x8598c7,_0x47aac9){_0x8598c7=_0x8598c7-0x0;var _0x1a30b6=_0x7ee1[_0x8598c7];return _0x1a30b6;};'use strict';var express=require(_0x17ee('0x0'));var passport=require('passport');var router=express[_0x17ee('0x1')]();var controller=require(_0x17ee('0x2'));var userController=require(_0x17ee('0x3'));var authService=require(_0x17ee('0x4'));router[_0x17ee('0x5')]('/',controller['login']);router[_0x17ee('0x5')]('/callback',controller['callback'],authService[_0x17ee('0x6')],userController[_0x17ee('0x7')],authService[_0x17ee('0x8')]);module[_0x17ee('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 4267ab9..eb56728 100644
--- a/server/api/authLocal/authLocal.controller.js
+++ b/server/api/authLocal/authLocal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5e91=['email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','find','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','minutes','getLicense','catch','MailAccount'];(function(_0x4e287d,_0x5cf55d){var _0x258870=function(_0x53b6b2){while(--_0x53b6b2){_0x4e287d['push'](_0x4e287d['shift']());}};_0x258870(++_0x5cf55d);}(_0x5e91,0x1d4));var _0x15e9=function(_0x10ec0f,_0x5ece09){_0x10ec0f=_0x10ec0f-0x0;var _0x1587ee=_0x5e91[_0x10ec0f];return _0x1587ee;};'use strict';var util=require(_0x15e9('0x0'));var passport=require(_0x15e9('0x1'));var LocalStrategy=require(_0x15e9('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x15e9('0x3'));var rs=require(_0x15e9('0x4'));var moment=require(_0x15e9('0x5'));var db=require(_0x15e9('0x6'))['db'];var authService=require(_0x15e9('0x7'));var utils=require('../../config/utils');var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x1e4695,_0x2eed98,_0x221cd2,_0x4c8d3a){var _0x2e1280,_0xdb571d;return db['Setting'][_0x15e9('0x8')]({'where':{'id':0x1},'attributes':[_0x15e9('0x9'),_0x15e9('0xa')],'raw':!![]})[_0x15e9('0xb')](function(_0xba9822){_0x2e1280=_0xba9822;return _0x1e4695[_0x15e9('0x8')]({'attributes':['id',_0x15e9('0xc'),'password',_0x15e9('0xd'),_0x15e9('0xe'),_0x15e9('0xf'),_0x15e9('0x10'),_0x15e9('0x11'),_0x15e9('0x12')],'where':{'name':_0x2eed98,'role':{'$or':[_0x15e9('0x13'),_0x15e9('0x14'),_0x15e9('0x15')]}}});})['then'](function(_0xb80070){if(!_0xb80070||_0xb80070&&_0xb80070[_0x15e9('0xc')]!==_0x2eed98){throw new Error(_0x15e9('0x16'));}else{_0xdb571d=_0xb80070;return _0xdb571d;}})[_0x15e9('0xb')](function(){_0xdb571d[_0x15e9('0x17')](_0x221cd2,function(_0x49c50c,_0x3c2174){var _0x51c09e=_0xdb571d[_0x15e9('0x12')]+0x1;if(_0x49c50c){return _0x4c8d3a(_0x49c50c);}else if(!_0x3c2174){if(_0xdb571d[_0x15e9('0xf')]){return _0x4c8d3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2e1280['allowedLoginAttempts']>0x0){if(_0xdb571d[_0x15e9('0x10')]){if(_0x2e1280[_0x15e9('0xa')]>0x0){if(moment(_0xdb571d[_0x15e9('0x11')])[_0x15e9('0x18')](_0x2e1280[_0x15e9('0xa')],'minutes')>moment()){return _0x4c8d3a(null,![],{'message':_0x15e9('0x16')});}else{return utils[_0x15e9('0x19')](_0xdb571d,_0x51c09e,![],null)['then'](function(){return _0x4c8d3a(null,![],{'message':_0x15e9('0x16')});});}}else{return _0x4c8d3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x51c09e>=_0x2e1280['allowedLoginAttempts']){return utils[_0x15e9('0x19')](_0xdb571d,0x0,!![],moment())[_0x15e9('0xb')](function(){return _0x4c8d3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x15e9('0x19')](_0xdb571d,_0x51c09e,![],null)['then'](function(){return _0x4c8d3a(null,![],{'message':_0x15e9('0x16')});});}}}else{return _0x4c8d3a(null,![],{'message':_0x15e9('0x16')});}}else{if(_0xdb571d[_0x15e9('0xf')]){return _0x4c8d3a(null,![],{'message':_0x15e9('0x16')});}else if(_0x2e1280[_0x15e9('0x9')]>0x0){if(_0xdb571d[_0x15e9('0x10')]){if(_0x2e1280[_0x15e9('0xa')]>0x0){if(moment(_0xdb571d[_0x15e9('0x11')])[_0x15e9('0x18')](_0x2e1280[_0x15e9('0xa')],_0x15e9('0x1a'))>moment()){return _0x4c8d3a(null,![],{'message':_0x15e9('0x16')});}else{return utils[_0x15e9('0x19')](_0xdb571d,0x0,![],null)[_0x15e9('0xb')](function(){return utils[_0x15e9('0x1b')](_0xdb571d);})[_0x15e9('0xb')](function(){return _0x4c8d3a(null,_0xdb571d);});}}else{return _0x4c8d3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x15e9('0x19')](_0xdb571d,0x0,![],null)[_0x15e9('0xb')](function(){return utils[_0x15e9('0x1b')](_0xdb571d);})[_0x15e9('0xb')](function(){return _0x4c8d3a(null,_0xdb571d);})[_0x15e9('0x1c')](function(_0x1a8d5b){return _0x4c8d3a(null,![],_0x1a8d5b);});}}else{if(_0xdb571d[_0x15e9('0x10')]){return _0x4c8d3a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x15e9('0x1b')](_0xdb571d)[_0x15e9('0xb')](function(){return _0x4c8d3a(null,_0xdb571d);});}}}});})[_0x15e9('0x1c')](function(_0x3c920d){return _0x4c8d3a(null,![],_0x3c920d);});}function sendServiceMail(_0x533807){return db[_0x15e9('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x15e9('0x1e')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x15e9('0xb')](function(_0x1e9e57){if(!_0x1e9e57){throw new Error(_0x15e9('0x1f'));}var _0x3c4844={'tls':{'rejectUnauthorized':![]}};if(_0x1e9e57[_0x15e9('0x20')][_0x15e9('0x21')]){_0x3c4844[_0x15e9('0x21')]=_0x1e9e57[_0x15e9('0x20')][_0x15e9('0x21')];}else{_0x3c4844[_0x15e9('0x22')]=_0x1e9e57[_0x15e9('0x20')][_0x15e9('0x22')];_0x3c4844[_0x15e9('0x23')]=_0x1e9e57[_0x15e9('0x20')][_0x15e9('0x23')];_0x3c4844[_0x15e9('0x24')]=_0x1e9e57[_0x15e9('0x20')][_0x15e9('0x24')];}if(_0x1e9e57[_0x15e9('0x20')][_0x15e9('0x25')]){_0x3c4844[_0x15e9('0x26')]={'user':_0x1e9e57[_0x15e9('0x20')][_0x15e9('0x14')],'pass':_0x1e9e57[_0x15e9('0x20')][_0x15e9('0x27')]};}var _0x1a5c29={'account':_0x3c4844,'message':_[_0x15e9('0x28')]({'from':util[_0x15e9('0x29')]('\x22%s\x22\x20<%s>',_0x1e9e57['name'],_0x1e9e57['email']||_0x1e9e57[_0x15e9('0x20')][_0x15e9('0x14')])},_0x533807)};return client['request'](_0x15e9('0x2a'),_0x1a5c29);})['then'](function(_0x1bed4c){if(_0x1bed4c[_0x15e9('0x2b')]){throw new Error(util['format'](_0x15e9('0x2c'),_0x1bed4c[_0x15e9('0x2b')]['message']||JSON[_0x15e9('0x2d')](_0x1bed4c['error'])));}return!![];});}function handleError(_0x114248,_0x110b07,_0x2d3d73){return _0x114248[_0x15e9('0x2e')](_0x110b07||0x1f4)[_0x15e9('0x2f')]({'message':_0x2d3d73?_0x2d3d73[_0x15e9('0x30')]||_0x2d3d73:''});}function checkPasswordPattern(_0x2d6587,_0x42575a,_0x3d1389){if(_0x3d1389){var _0x5d7471=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d7471[_0x15e9('0x31')](_0x42575a)){return _0x2d6587;}else{throw new Error(_0x15e9('0x32'));}}else{return _0x2d6587;}}exports['login']=function(_0x58bd97,_0x15bc8a,_0x41c751){passport[_0x15e9('0x17')](_0x15e9('0x33'),function(_0x52e6ac,_0x155fd7,_0x1ebd2e){var _0x20fc03=_0x52e6ac||_0x1ebd2e;if(_0x20fc03){return handleError(_0x15bc8a,0x191,_0x20fc03);}if(!_0x155fd7){return handleError(_0x15bc8a,0x194,{'message':_0x15e9('0x34')});}else{var _0x17d2f0={'payload':{'id':_0x155fd7['id'],'role':_0x155fd7[_0x15e9('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x15e9('0x35')](_0x17d2f0)[_0x15e9('0xb')](function(_0x86f7da){_0x15bc8a[_0x15e9('0x36')]({'id':_0x155fd7['id'],'token':_0x86f7da,'statusCall':'','isAlreadyLogged':_0x155fd7[_0x15e9('0x37')]});});}})(_0x58bd97,_0x15bc8a,_0x41c751);};exports[_0x15e9('0x38')]=function(_0x22c8bd,_0x12320a,_0x4a277e){if(!_0x22c8bd[_0x15e9('0x39')][_0x15e9('0x1e')]){return handleError(_0x12320a,0x1f4,{'message':_0x15e9('0x3a')});}var _0x3cc919=rs[_0x15e9('0x3b')]();_0x22c8bd[_0x15e9('0x39')][_0x15e9('0x1e')]=_0x22c8bd['body']['email'][_0x15e9('0x3c')]()[_0x15e9('0x3d')]();var _0x569e25;return db[_0x15e9('0x3e')][_0x15e9('0x8')]({'where':{'id':0x1},'attributes':[_0x15e9('0x9'),_0x15e9('0xa')],'raw':!![]})[_0x15e9('0xb')](function(_0xc30c5){_0x569e25=_0xc30c5;return db['User'][_0x15e9('0x3f')]({'where':{'email':_0x22c8bd[_0x15e9('0x39')][_0x15e9('0x1e')]}});})[_0x15e9('0xb')](function(_0x19a741){if(!_0x19a741){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x19a741['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x19a741[_0x15e9('0x10')]){if(moment(_0x19a741['blockedAt'])['add'](_0x569e25[_0x15e9('0xa')],_0x15e9('0x1a'))>moment()){throw new Error(_0x15e9('0x40'));}else{_0x19a741[_0x15e9('0x10')]=![];_0x19a741['blockedAt']=null;}}_0x19a741[_0x15e9('0x41')]=_0x3cc919;_0x19a741[_0x15e9('0x42')]=Date['now']()+0x36ee80;return _0x19a741[_0x15e9('0x43')]();})[_0x15e9('0xb')](function(){return sendServiceMail({'to':_0x22c8bd[_0x15e9('0x39')][_0x15e9('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x15e9('0x44')+_0x15e9('0x45')+_0x15e9('0x46')+_0x22c8bd['headers'][_0x15e9('0x22')]+'/reset/'+_0x3cc919+'\x0a\x0a'+_0x15e9('0x47')});})[_0x15e9('0xb')](function(){_0x12320a[_0x15e9('0x2e')](0xc8)[_0x15e9('0x2f')]({'message':_0x15e9('0x48')});})[_0x15e9('0x1c')](function(_0x68e394){return handleError(_0x12320a,0x1f4,_0x68e394);});};exports[_0x15e9('0x49')]=function(_0x1f5c0f,_0x32cb55,_0x34b9b9){var _0x5b2a4f;return db[_0x15e9('0x4a')]['find']({'where':{'resetPasswordToken':_0x1f5c0f[_0x15e9('0x4b')][_0x15e9('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x15e9('0x4d')]()}}})['then'](function(_0x8840a7){_0x5b2a4f=_0x8840a7;if(!_0x5b2a4f){throw new Error(_0x15e9('0x4e'));}return db['Setting'][_0x15e9('0x8')]({'attributes':['id',_0x15e9('0x4f')]});})[_0x15e9('0xb')](function(_0x1ed78e){return checkPasswordPattern(_0x1ed78e,_0x1f5c0f[_0x15e9('0x39')][_0x15e9('0x50')],_0x1ed78e[_0x15e9('0x4f')]);})[_0x15e9('0xb')](function(){_0x5b2a4f[_0x15e9('0x50')]=_0x1f5c0f['body'][_0x15e9('0x50')];_0x5b2a4f['resetPasswordToken']=null;_0x5b2a4f[_0x15e9('0x42')]=null;return _0x5b2a4f[_0x15e9('0x43')]();})[_0x15e9('0xb')](function(){_0x32cb55[_0x15e9('0x2e')](0xc8)[_0x15e9('0x2f')]({'message':_0x15e9('0x51')});})[_0x15e9('0x1c')](function(_0x1056cd){return handleError(_0x32cb55,0x1f4,_0x1056cd);});};passport[_0x15e9('0x52')](new LocalStrategy({'usernameField':_0x15e9('0xc'),'passwordField':'password'},function(_0x401300,_0x2fc7d2,_0x306c91){return localAuthenticate(db[_0x15e9('0x4a')],_0x401300,_0x2fc7d2,_0x306c91);}));
\ No newline at end of file
+var _0x1762=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','password','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','email','MailServerOut','Smtp','service','host','port','secure','authentication','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','status','send','test','login','authenticate','local'];(function(_0x1bbe79,_0x1707f5){var _0x4da933=function(_0x3fb5be){while(--_0x3fb5be){_0x1bbe79['push'](_0x1bbe79['shift']());}};_0x4da933(++_0x1707f5);}(_0x1762,0xc2));var _0x2176=function(_0x2e34cc,_0x41c060){_0x2e34cc=_0x2e34cc-0x0;var _0x2abce6=_0x1762[_0x2e34cc];return _0x2abce6;};'use strict';var util=require(_0x2176('0x0'));var passport=require(_0x2176('0x1'));var LocalStrategy=require('passport-local')[_0x2176('0x2')];var jayson=require(_0x2176('0x3'));var _=require(_0x2176('0x4'));var rs=require(_0x2176('0x5'));var moment=require(_0x2176('0x6'));var db=require(_0x2176('0x7'))['db'];var authService=require(_0x2176('0x8'));var utils=require(_0x2176('0x9'));var client=jayson[_0x2176('0xa')][_0x2176('0xb')]({'port':0x232b});function localAuthenticate(_0x52ff57,_0x4f80a7,_0x3d18e2,_0x5cb844){var _0x28e2c9,_0x2a6321;return db['Setting'][_0x2176('0xc')]({'where':{'id':0x1},'attributes':[_0x2176('0xd'),_0x2176('0xe')],'raw':!![]})[_0x2176('0xf')](function(_0x4c25f3){_0x28e2c9=_0x4c25f3;return _0x52ff57['findOne']({'attributes':['id',_0x2176('0x10'),'password',_0x2176('0x11'),_0x2176('0x12'),'disabled',_0x2176('0x13'),_0x2176('0x14'),_0x2176('0x15')],'where':{'name':_0x4f80a7,'role':{'$or':[_0x2176('0x16'),_0x2176('0x17'),_0x2176('0x18')]}}});})[_0x2176('0xf')](function(_0x349a8d){if(!_0x349a8d||_0x349a8d&&_0x349a8d[_0x2176('0x10')]!==_0x4f80a7){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2a6321=_0x349a8d;return _0x2a6321;}})['then'](function(){_0x2a6321['authenticate'](_0x3d18e2,function(_0x2b9c24,_0x11b210){var _0x1d29ff=_0x2a6321[_0x2176('0x15')]+0x1;if(_0x2b9c24){return _0x5cb844(_0x2b9c24);}else if(!_0x11b210){if(_0x2a6321['disabled']){return _0x5cb844(null,![],{'message':_0x2176('0x19')});}else if(_0x28e2c9[_0x2176('0xd')]>0x0){if(_0x2a6321[_0x2176('0x13')]){if(_0x28e2c9[_0x2176('0xe')]>0x0){if(moment(_0x2a6321['blockedAt'])[_0x2176('0x1a')](_0x28e2c9[_0x2176('0xe')],_0x2176('0x1b'))>moment()){return _0x5cb844(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x2176('0x1c')](_0x2a6321,_0x1d29ff,![],null)['then'](function(){return _0x5cb844(null,![],{'message':_0x2176('0x19')});});}}else{return _0x5cb844(null,![],{'message':_0x2176('0x19')});}}else{if(_0x1d29ff>=_0x28e2c9['allowedLoginAttempts']){return utils['clearBlockUser'](_0x2a6321,0x0,!![],moment())[_0x2176('0xf')](function(){return _0x5cb844(null,![],{'message':_0x2176('0x19')});});}else{return utils[_0x2176('0x1c')](_0x2a6321,_0x1d29ff,![],null)[_0x2176('0xf')](function(){return _0x5cb844(null,![],{'message':_0x2176('0x19')});});}}}else{return _0x5cb844(null,![],{'message':_0x2176('0x19')});}}else{if(_0x2a6321[_0x2176('0x1d')]){return _0x5cb844(null,![],{'message':_0x2176('0x19')});}else if(_0x28e2c9[_0x2176('0xd')]>0x0){if(_0x2a6321[_0x2176('0x13')]){if(_0x28e2c9[_0x2176('0xe')]>0x0){if(moment(_0x2a6321['blockedAt'])[_0x2176('0x1a')](_0x28e2c9['blockDuration'],'minutes')>moment()){return _0x5cb844(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x2176('0x1c')](_0x2a6321,0x0,![],null)[_0x2176('0xf')](function(){return utils[_0x2176('0x1e')](_0x2a6321);})[_0x2176('0xf')](function(){return _0x5cb844(null,_0x2a6321);});}}else{return _0x5cb844(null,![],{'message':_0x2176('0x19')});}}else{return utils[_0x2176('0x1c')](_0x2a6321,0x0,![],null)['then'](function(){return utils[_0x2176('0x1e')](_0x2a6321);})[_0x2176('0xf')](function(){return _0x5cb844(null,_0x2a6321);})['catch'](function(_0x2b9d47){return _0x5cb844(null,![],_0x2b9d47);});}}else{if(_0x2a6321['blocked']){return _0x5cb844(null,![],{'message':_0x2176('0x19')});}else{return utils[_0x2176('0x1e')](_0x2a6321)['then'](function(){return _0x5cb844(null,_0x2a6321);});}}}});})[_0x2176('0x1f')](function(_0x3ab4cb){return _0x5cb844(null,![],_0x3ab4cb);});}function sendServiceMail(_0x2b25c5){return db[_0x2176('0x20')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x2176('0x21')],'include':[{'model':db[_0x2176('0x22')],'as':'Smtp'}]})[_0x2176('0xf')](function(_0x3b4ca4){if(!_0x3b4ca4){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x26cf27={'tls':{'rejectUnauthorized':![]}};if(_0x3b4ca4[_0x2176('0x23')][_0x2176('0x24')]){_0x26cf27['service']=_0x3b4ca4[_0x2176('0x23')][_0x2176('0x24')];}else{_0x26cf27[_0x2176('0x25')]=_0x3b4ca4[_0x2176('0x23')][_0x2176('0x25')];_0x26cf27['port']=_0x3b4ca4['Smtp'][_0x2176('0x26')];_0x26cf27[_0x2176('0x27')]=_0x3b4ca4['Smtp'][_0x2176('0x27')];}if(_0x3b4ca4[_0x2176('0x23')][_0x2176('0x28')]){_0x26cf27['auth']={'user':_0x3b4ca4['Smtp'][_0x2176('0x17')],'pass':_0x3b4ca4[_0x2176('0x23')][_0x2176('0x29')]};}var _0x524d97={'account':_0x26cf27,'message':_[_0x2176('0x2a')]({'from':util[_0x2176('0x2b')](_0x2176('0x2c'),_0x3b4ca4[_0x2176('0x10')],_0x3b4ca4[_0x2176('0x21')]||_0x3b4ca4[_0x2176('0x23')][_0x2176('0x17')])},_0x2b25c5)};return client[_0x2176('0x2d')](_0x2176('0x2e'),_0x524d97);})[_0x2176('0xf')](function(_0x51fc4e){if(_0x51fc4e[_0x2176('0x2f')]){throw new Error(util[_0x2176('0x2b')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x51fc4e[_0x2176('0x2f')][_0x2176('0x30')]||JSON['stringify'](_0x51fc4e[_0x2176('0x2f')])));}return!![];});}function handleError(_0x34f7f5,_0x1cc4a1,_0x4048a5){return _0x34f7f5[_0x2176('0x31')](_0x1cc4a1||0x1f4)[_0x2176('0x32')]({'message':_0x4048a5?_0x4048a5[_0x2176('0x30')]||_0x4048a5:''});}function checkPasswordPattern(_0x401185,_0x4437b8,_0x44074b){if(_0x44074b){var _0x393d63=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x393d63[_0x2176('0x33')](_0x4437b8)){return _0x401185;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x401185;}}exports[_0x2176('0x34')]=function(_0x1930d6,_0x3d63a7,_0x1923b5){passport[_0x2176('0x35')](_0x2176('0x36'),function(_0x506d61,_0x58a9a3,_0x27337a){var _0x38bbfa=_0x506d61||_0x27337a;if(_0x38bbfa){return handleError(_0x3d63a7,0x191,_0x38bbfa);}if(!_0x58a9a3){return handleError(_0x3d63a7,0x194,{'message':_0x2176('0x37')});}else{var _0x21d97e={'payload':{'id':_0x58a9a3['id'],'role':_0x58a9a3[_0x2176('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x2176('0x38')](_0x21d97e)[_0x2176('0xf')](function(_0x544234){_0x3d63a7[_0x2176('0x39')]({'id':_0x58a9a3['id'],'token':_0x544234,'statusCall':'','isAlreadyLogged':_0x58a9a3['online']});});}})(_0x1930d6,_0x3d63a7,_0x1923b5);};exports[_0x2176('0x3a')]=function(_0x58d841,_0x42eac6,_0x3ffd7d){if(!_0x58d841['body']['email']){return handleError(_0x42eac6,0x1f4,{'message':_0x2176('0x3b')});}var _0x4d1b12=rs[_0x2176('0x3c')]();_0x58d841[_0x2176('0x3d')][_0x2176('0x21')]=_0x58d841['body'][_0x2176('0x21')]['trim']()[_0x2176('0x3e')]();var _0x3742dc;return db['Setting'][_0x2176('0xc')]({'where':{'id':0x1},'attributes':[_0x2176('0xd'),_0x2176('0xe')],'raw':!![]})[_0x2176('0xf')](function(_0x570765){_0x3742dc=_0x570765;return db[_0x2176('0x3f')][_0x2176('0x40')]({'where':{'email':_0x58d841['body'][_0x2176('0x21')]}});})[_0x2176('0xf')](function(_0x381652){if(!_0x381652){throw new Error(_0x2176('0x41'));}if(_0x381652[_0x2176('0x1d')]){throw new Error(_0x2176('0x42'));}if(_0x381652[_0x2176('0x13')]){if(moment(_0x381652['blockedAt'])[_0x2176('0x1a')](_0x3742dc[_0x2176('0xe')],_0x2176('0x1b'))>moment()){throw new Error(_0x2176('0x43'));}else{_0x381652['blocked']=![];_0x381652['blockedAt']=null;}}_0x381652[_0x2176('0x44')]=_0x4d1b12;_0x381652[_0x2176('0x45')]=Date[_0x2176('0x46')]()+0x36ee80;return _0x381652[_0x2176('0x47')]();})[_0x2176('0xf')](function(){return sendServiceMail({'to':_0x58d841[_0x2176('0x3d')][_0x2176('0x21')],'subject':_0x2176('0x48'),'text':_0x2176('0x49')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x2176('0x4a')+_0x58d841[_0x2176('0x4b')][_0x2176('0x25')]+'/reset/'+_0x4d1b12+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x2176('0xf')](function(){_0x42eac6[_0x2176('0x31')](0xc8)[_0x2176('0x32')]({'message':_0x2176('0x4c')});})[_0x2176('0x1f')](function(_0x584e11){return handleError(_0x42eac6,0x1f4,_0x584e11);});};exports['reset']=function(_0x3c29fb,_0x21398a,_0xd9fae){var _0x533bac;return db[_0x2176('0x3f')]['find']({'where':{'resetPasswordToken':_0x3c29fb['params'][_0x2176('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x2176('0x46')]()}}})[_0x2176('0xf')](function(_0x593820){_0x533bac=_0x593820;if(!_0x533bac){throw new Error(_0x2176('0x4e'));}return db[_0x2176('0x4f')][_0x2176('0xc')]({'attributes':['id','securePassword']});})[_0x2176('0xf')](function(_0x3c48e7){return checkPasswordPattern(_0x3c48e7,_0x3c29fb[_0x2176('0x3d')][_0x2176('0x50')],_0x3c48e7['securePassword']);})[_0x2176('0xf')](function(){_0x533bac[_0x2176('0x50')]=_0x3c29fb[_0x2176('0x3d')]['password'];_0x533bac[_0x2176('0x44')]=null;_0x533bac[_0x2176('0x45')]=null;return _0x533bac[_0x2176('0x47')]();})[_0x2176('0xf')](function(){_0x21398a[_0x2176('0x31')](0xc8)[_0x2176('0x32')]({'message':_0x2176('0x51')});})[_0x2176('0x1f')](function(_0x234da3){return handleError(_0x21398a,0x1f4,_0x234da3);});};passport[_0x2176('0x52')](new LocalStrategy({'usernameField':_0x2176('0x10'),'passwordField':_0x2176('0x50')},function(_0x50d9a2,_0x32bdc6,_0x5edc0d){return localAuthenticate(db[_0x2176('0x3f')],_0x50d9a2,_0x32bdc6,_0x5edc0d);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 976bd90..40fbf01 100644
--- a/server/api/authLocal/index.js
+++ b/server/api/authLocal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05f3=['./authLocal.controller','login','post','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x46f5dc,_0x8a99a9){var _0x441478=function(_0x5bea47){while(--_0x5bea47){_0x46f5dc['push'](_0x46f5dc['shift']());}};_0x441478(++_0x8a99a9);}(_0x05f3,0x18e));var _0x305f=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x05f3[_0x256d6a];return _0x460058;};'use strict';var express=require(_0x305f('0x0'));var router=express[_0x305f('0x1')]();var controller=require(_0x305f('0x2'));router['post']('/',controller[_0x305f('0x3')]);router[_0x305f('0x4')](_0x305f('0x5'),controller[_0x305f('0x6')]);router['post'](_0x305f('0x7'),controller[_0x305f('0x8')]);module[_0x305f('0x9')]=router;
\ No newline at end of file
+var _0x727a=['post','login','/forgot','/reset/:token','reset','exports','express'];(function(_0x3be355,_0x45fb32){var _0xf77ae1=function(_0x3392f0){while(--_0x3392f0){_0x3be355['push'](_0x3be355['shift']());}};_0xf77ae1(++_0x45fb32);}(_0x727a,0x125));var _0xa727=function(_0x1b3c51,_0x3d9de6){_0x1b3c51=_0x1b3c51-0x0;var _0x1a455f=_0x727a[_0x1b3c51];return _0x1a455f;};'use strict';var express=require(_0xa727('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xa727('0x1')]('/',controller[_0xa727('0x2')]);router[_0xa727('0x1')](_0xa727('0x3'),controller['forgot']);router[_0xa727('0x1')](_0xa727('0x4'),controller[_0xa727('0x5')]);module[_0xa727('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index aebed72..01170d0 100644
--- a/server/api/automation/automation.attributes.js
+++ b/server/api/automation/automation.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6499=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x5dfd07,_0x11f42e){var _0x10cd46=function(_0x16b929){while(--_0x16b929){_0x5dfd07['push'](_0x5dfd07['shift']());}};_0x10cd46(++_0x11f42e);}(_0x6499,0x64));var _0x9649=function(_0x28e998,_0xa9c9ca){_0x28e998=_0x28e998-0x0;var _0x133738=_0x6499[_0x28e998];return _0x133738;};'use strict';var Sequelize=require('sequelize');module[_0x9649('0x0')]={'name':{'type':Sequelize[_0x9649('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9649('0x1')]},'status':{'type':Sequelize[_0x9649('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9649('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x0df8=['exports','STRING','INTEGER','sequelize'];(function(_0x3226a0,_0xbe7aad){var _0x2b8e04=function(_0x354184){while(--_0x354184){_0x3226a0['push'](_0x3226a0['shift']());}};_0x2b8e04(++_0xbe7aad);}(_0x0df8,0x1cf));var _0x80df=function(_0x168b74,_0x46e067){_0x168b74=_0x168b74-0x0;var _0x4e6e7a=_0x0df8[_0x168b74];return _0x4e6e7a;};'use strict';var Sequelize=require(_0x80df('0x0'));module[_0x80df('0x1')]={'name':{'type':Sequelize[_0x80df('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x80df('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 0538097..7fa9f06 100644
--- a/server/api/automation/automation.controller.js
+++ b/server/api/automation/automation.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ca8=['find','addConditions','Condition','ids','omit','getConditions','findOne','length','order','sort','addActions','Action','pick','getActions','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','offset','limit','Content-Range','json','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','where','merge','VIRTUAL','filter','options','Automation','count','includeAll','include','findAll','rows','catch','params','create','body'];(function(_0x597bf3,_0x3a2bd8){var _0x4db0db=function(_0x4d5983){while(--_0x4d5983){_0x597bf3['push'](_0x597bf3['shift']());}};_0x4db0db(++_0x3a2bd8);}(_0x4ca8,0xa8));var _0x84ca=function(_0x14a48a,_0x45d4da){_0x14a48a=_0x14a48a-0x0;var _0x439ed9=_0x4ca8[_0x14a48a];return _0x439ed9;};'use strict';var pdf=require(_0x84ca('0x0'));var emlformat=require(_0x84ca('0x1'));var rimraf=require(_0x84ca('0x2'));var zipdir=require(_0x84ca('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x84ca('0x4'));var BPromise=require(_0x84ca('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x84ca('0x6'));var sox=require(_0x84ca('0x7'));var csv=require(_0x84ca('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x84ca('0x9'));var squel=require(_0x84ca('0xa'));var crypto=require('crypto');var jsforce=require(_0x84ca('0xb'));var deskjs=require(_0x84ca('0xc'));var toCsv=require(_0x84ca('0x8'));var querystring=require(_0x84ca('0xd'));var Papa=require(_0x84ca('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x84ca('0xf'));var hardwareService=require(_0x84ca('0x10'));var logger=require('../../config/logger')(_0x84ca('0x11'));var utils=require('../../config/utils');var config=require(_0x84ca('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2505a7,_0xe59910){_0xe59910=_0xe59910||0xcc;return function(_0x49d7bb){if(_0x49d7bb){return _0x2505a7[_0x84ca('0x13')](_0xe59910);}return _0x2505a7[_0x84ca('0x14')](_0xe59910)[_0x84ca('0x15')]();};}function respondWithResult(_0xcc635d,_0x5be88f){_0x5be88f=_0x5be88f||0xc8;return function(_0x12c2c8){if(_0x12c2c8){return _0xcc635d[_0x84ca('0x14')](_0x5be88f)['json'](_0x12c2c8);}};}function respondWithFilteredResult(_0x2efd5d,_0x5e00fd){return function(_0x92535b){if(_0x92535b){var _0x5dee34=_0x92535b['count'],_0x4b331b=_0x5e00fd['offset'],_0x2db82e=_0x5e00fd[_0x84ca('0x16')]+_0x5e00fd[_0x84ca('0x17')],_0x17b567;if(_0x2db82e>=_0x5dee34){_0x2db82e=_0x5dee34;_0x17b567=0xc8;}else{_0x17b567=0xce;}_0x2efd5d[_0x84ca('0x14')](_0x17b567);return _0x2efd5d['set'](_0x84ca('0x18'),_0x4b331b+'-'+_0x2db82e+'/'+_0x5dee34)[_0x84ca('0x19')](_0x92535b);}return null;};}function patchUpdates(_0x5e9203){return function(_0x36fee7){try{jsonpatch['apply'](_0x36fee7,_0x5e9203,!![]);}catch(_0x180a6c){return BPromise[_0x84ca('0x1a')](_0x180a6c);}return _0x36fee7['save']();};}function saveUpdates(_0xa07c73,_0x366dea){return function(_0xc9c707){if(_0xc9c707){return _0xc9c707[_0x84ca('0x1b')](_0xa07c73)[_0x84ca('0x1c')](function(_0xf61bc0){return _0xf61bc0;});}return null;};}function removeEntity(_0x5aa69f,_0x55224e){return function(_0x45701a){if(_0x45701a){return _0x45701a[_0x84ca('0x1d')]()[_0x84ca('0x1c')](function(){_0x5aa69f[_0x84ca('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x590192,_0x43731e){return function(_0x306dde){if(!_0x306dde){_0x590192[_0x84ca('0x13')](0x194);}return _0x306dde;};}function handleError(_0x1ac5c6,_0x3e9baf){_0x3e9baf=_0x3e9baf||0x1f4;return function(_0x14346a){logger[_0x84ca('0x1e')](_0x14346a['stack']);if(_0x14346a['name']){delete _0x14346a[_0x84ca('0x1f')];}_0x1ac5c6[_0x84ca('0x14')](_0x3e9baf)[_0x84ca('0x20')](_0x14346a);};}exports[_0x84ca('0x21')]=function(_0x23131c,_0x502a7a){var _0x4060c6={},_0x9ccc7b={},_0x2d1411={'count':0x0,'rows':[]};var _0x4a8fcf=_[_0x84ca('0x22')](db['Automation'][_0x84ca('0x23')],function(_0x4b1a32){return{'name':_0x4b1a32[_0x84ca('0x24')],'type':_0x4b1a32[_0x84ca('0x25')][_0x84ca('0x26')]};});_0x9ccc7b['model']=_[_0x84ca('0x22')](_0x4a8fcf,'name');_0x9ccc7b[_0x84ca('0x27')]=_[_0x84ca('0x28')](_0x23131c[_0x84ca('0x27')]);_0x9ccc7b[_0x84ca('0x29')]=_['intersection'](_0x9ccc7b[_0x84ca('0x2a')],_0x9ccc7b[_0x84ca('0x27')]);_0x4060c6[_0x84ca('0x2b')]=_[_0x84ca('0x2c')](_0x9ccc7b[_0x84ca('0x2a')],qs[_0x84ca('0x2d')](_0x23131c['query'][_0x84ca('0x2d')]));_0x4060c6[_0x84ca('0x2b')]=_0x4060c6[_0x84ca('0x2b')]['length']?_0x4060c6[_0x84ca('0x2b')]:_0x9ccc7b['model'];if(!_0x23131c[_0x84ca('0x27')][_0x84ca('0x2e')](_0x84ca('0x2f'))){_0x4060c6[_0x84ca('0x17')]=qs['limit'](_0x23131c[_0x84ca('0x27')][_0x84ca('0x17')]);_0x4060c6['offset']=qs['offset'](_0x23131c[_0x84ca('0x27')][_0x84ca('0x16')]);}_0x4060c6['order']=qs['sort'](_0x23131c['query']['sort']);_0x4060c6['where']=qs[_0x84ca('0x29')](_['pick'](_0x23131c[_0x84ca('0x27')],_0x9ccc7b[_0x84ca('0x29')]),_0x4a8fcf);if(_0x23131c[_0x84ca('0x27')]['filter']){_0x4060c6[_0x84ca('0x30')]=_[_0x84ca('0x31')](_0x4060c6['where'],{'$or':_['map'](_0x4a8fcf,function(_0x1c7ed2){if(_0x1c7ed2['type']!==_0x84ca('0x32')){var _0x5220b2={};_0x5220b2[_0x1c7ed2[_0x84ca('0x1f')]]={'$like':'%'+_0x23131c[_0x84ca('0x27')][_0x84ca('0x33')]+'%'};return _0x5220b2;}})});}_0x4060c6=_[_0x84ca('0x31')]({},_0x4060c6,_0x23131c[_0x84ca('0x34')]);var _0x1e5613={'where':_0x4060c6['where']};return db[_0x84ca('0x35')]['count'](_0x1e5613)[_0x84ca('0x1c')](function(_0x27580b){_0x2d1411[_0x84ca('0x36')]=_0x27580b;if(_0x23131c[_0x84ca('0x27')][_0x84ca('0x37')]){_0x4060c6[_0x84ca('0x38')]=[{'all':!![]}];}return db[_0x84ca('0x35')][_0x84ca('0x39')](_0x4060c6);})['then'](function(_0x35f2ac){_0x2d1411[_0x84ca('0x3a')]=_0x35f2ac;return _0x2d1411;})[_0x84ca('0x1c')](respondWithFilteredResult(_0x502a7a,_0x4060c6))[_0x84ca('0x3b')](handleError(_0x502a7a,null));};exports['show']=function(_0x1c440b,_0x1c07ed){var _0x4ed196={'raw':![],'where':{'id':_0x1c440b[_0x84ca('0x3c')]['id']}},_0x1d0bdd={};_0x1d0bdd['model']=_[_0x84ca('0x28')](db[_0x84ca('0x35')][_0x84ca('0x23')]);_0x1d0bdd[_0x84ca('0x27')]=_[_0x84ca('0x28')](_0x1c440b[_0x84ca('0x27')]);_0x1d0bdd[_0x84ca('0x29')]=_[_0x84ca('0x2c')](_0x1d0bdd[_0x84ca('0x2a')],_0x1d0bdd[_0x84ca('0x27')]);_0x4ed196[_0x84ca('0x2b')]=_[_0x84ca('0x2c')](_0x1d0bdd[_0x84ca('0x2a')],qs['fields'](_0x1c440b[_0x84ca('0x27')][_0x84ca('0x2d')]));_0x4ed196['attributes']=_0x4ed196['attributes']['length']?_0x4ed196[_0x84ca('0x2b')]:_0x1d0bdd[_0x84ca('0x2a')];if(_0x1c440b[_0x84ca('0x27')][_0x84ca('0x37')]){_0x4ed196[_0x84ca('0x38')]=[{'all':!![]}];}_0x4ed196=_[_0x84ca('0x31')]({},_0x4ed196,_0x1c440b[_0x84ca('0x34')]);return db[_0x84ca('0x35')]['find'](_0x4ed196)[_0x84ca('0x1c')](handleEntityNotFound(_0x1c07ed,null))['then'](respondWithResult(_0x1c07ed,null))[_0x84ca('0x3b')](handleError(_0x1c07ed,null));};exports[_0x84ca('0x3d')]=function(_0x2b1693,_0x2ab3bc){return db[_0x84ca('0x35')][_0x84ca('0x3d')](_0x2b1693[_0x84ca('0x3e')],{})[_0x84ca('0x1c')](respondWithResult(_0x2ab3bc,0xc9))['catch'](handleError(_0x2ab3bc,null));};exports[_0x84ca('0x1b')]=function(_0x1b8f49,_0x2888e1){if(_0x1b8f49[_0x84ca('0x3e')]['id']){delete _0x1b8f49[_0x84ca('0x3e')]['id'];}return db[_0x84ca('0x35')][_0x84ca('0x3f')]({'where':{'id':_0x1b8f49[_0x84ca('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2888e1,null))['then'](saveUpdates(_0x1b8f49[_0x84ca('0x3e')],null))['then'](respondWithResult(_0x2888e1,null))[_0x84ca('0x3b')](handleError(_0x2888e1,null));};exports[_0x84ca('0x1d')]=function(_0x569736,_0x40d498){return db[_0x84ca('0x35')]['find']({'where':{'id':_0x569736[_0x84ca('0x3c')]['id']}})[_0x84ca('0x1c')](handleEntityNotFound(_0x40d498,null))['then'](removeEntity(_0x40d498,null))[_0x84ca('0x3b')](handleError(_0x40d498,null));};exports[_0x84ca('0x40')]=function(_0x2f7b9b,_0x1f53b4,_0x8c6af1){return db[_0x84ca('0x41')]['find']({'where':{'id':_0x2f7b9b[_0x84ca('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1f53b4,null))['then'](function(_0x40e306){if(_0x40e306){return _0x40e306['addConditions'](_0x2f7b9b[_0x84ca('0x3e')][_0x84ca('0x42')],_[_0x84ca('0x43')](_0x2f7b9b[_0x84ca('0x3e')],['ids','id'])||{});}})['then'](respondWithResult(_0x1f53b4,null))[_0x84ca('0x3b')](handleError(_0x1f53b4,null));};exports[_0x84ca('0x44')]=function(_0x18713a,_0x17b2ba,_0x4dd71d){var _0x573337={};var _0x348e06={};var _0x330cbe;var _0x1211cd;return db[_0x84ca('0x35')][_0x84ca('0x45')]({'where':{'id':_0x18713a[_0x84ca('0x3c')]['id']}})[_0x84ca('0x1c')](handleEntityNotFound(_0x17b2ba,null))['then'](function(_0x4328e9){if(_0x4328e9){_0x330cbe=_0x4328e9;_0x348e06[_0x84ca('0x2a')]=_[_0x84ca('0x28')](db[_0x84ca('0x41')][_0x84ca('0x23')]);_0x348e06[_0x84ca('0x27')]=_[_0x84ca('0x28')](_0x18713a['query']);_0x348e06[_0x84ca('0x29')]=_['intersection'](_0x348e06[_0x84ca('0x2a')],_0x348e06[_0x84ca('0x27')]);_0x573337[_0x84ca('0x2b')]=_[_0x84ca('0x2c')](_0x348e06['model'],qs[_0x84ca('0x2d')](_0x18713a['query'][_0x84ca('0x2d')]));_0x573337[_0x84ca('0x2b')]=_0x573337['attributes'][_0x84ca('0x46')]?_0x573337[_0x84ca('0x2b')]:_0x348e06[_0x84ca('0x2a')];_0x573337[_0x84ca('0x47')]=qs[_0x84ca('0x48')](_0x18713a['query'][_0x84ca('0x48')]);_0x573337[_0x84ca('0x30')]=qs[_0x84ca('0x29')](_['pick'](_0x18713a[_0x84ca('0x27')],_0x348e06[_0x84ca('0x29')]));if(_0x18713a['query'][_0x84ca('0x33')]){_0x573337[_0x84ca('0x30')]=_[_0x84ca('0x31')](_0x573337[_0x84ca('0x30')],{'$or':_[_0x84ca('0x22')](_0x573337['attributes'],function(_0x1a89a9){var _0x5c2428={};_0x5c2428[_0x1a89a9]={'$like':'%'+_0x18713a[_0x84ca('0x27')]['filter']+'%'};return _0x5c2428;})});}_0x573337=_[_0x84ca('0x31')]({},_0x573337,_0x18713a[_0x84ca('0x34')]);return _0x330cbe[_0x84ca('0x44')](_0x573337);}})[_0x84ca('0x1c')](function(_0x4d946f){if(_0x4d946f){_0x1211cd=_0x4d946f[_0x84ca('0x46')];if(!_0x18713a['query'][_0x84ca('0x2e')](_0x84ca('0x2f'))){_0x573337['limit']=qs[_0x84ca('0x17')](_0x18713a[_0x84ca('0x27')]['limit']);_0x573337[_0x84ca('0x16')]=qs[_0x84ca('0x16')](_0x18713a['query'][_0x84ca('0x16')]);}return _0x330cbe['getConditions'](_0x573337);}})[_0x84ca('0x1c')](function(_0x44799a){if(_0x44799a){return _0x44799a?{'count':_0x1211cd,'rows':_0x44799a}:null;}})['then'](respondWithResult(_0x17b2ba,null))[_0x84ca('0x3b')](handleError(_0x17b2ba,null));};exports[_0x84ca('0x49')]=function(_0x222f59,_0x5a77b8,_0x9140c8){return db[_0x84ca('0x4a')]['find']({'where':{'id':_0x222f59[_0x84ca('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5a77b8,null))[_0x84ca('0x1c')](function(_0x308e92){if(_0x308e92){return _0x308e92[_0x84ca('0x49')](_0x222f59['body']['ids'],_[_0x84ca('0x43')](_0x222f59[_0x84ca('0x3e')],['ids','id'])||{});}})[_0x84ca('0x1c')](respondWithResult(_0x5a77b8,null))[_0x84ca('0x3b')](handleError(_0x5a77b8,null));};exports['getActions']=function(_0x5e147f,_0x39330a,_0x43a884){var _0x51075a={};var _0x13b09f={};var _0x371526;var _0x12da30;return db[_0x84ca('0x35')][_0x84ca('0x45')]({'where':{'id':_0x5e147f[_0x84ca('0x3c')]['id']}})[_0x84ca('0x1c')](handleEntityNotFound(_0x39330a,null))['then'](function(_0x40e2c9){if(_0x40e2c9){_0x371526=_0x40e2c9;_0x13b09f[_0x84ca('0x2a')]=_['keys'](db[_0x84ca('0x4a')][_0x84ca('0x23')]);_0x13b09f[_0x84ca('0x27')]=_[_0x84ca('0x28')](_0x5e147f[_0x84ca('0x27')]);_0x13b09f['filters']=_[_0x84ca('0x2c')](_0x13b09f[_0x84ca('0x2a')],_0x13b09f['query']);_0x51075a[_0x84ca('0x2b')]=_['intersection'](_0x13b09f[_0x84ca('0x2a')],qs[_0x84ca('0x2d')](_0x5e147f['query'][_0x84ca('0x2d')]));_0x51075a[_0x84ca('0x2b')]=_0x51075a[_0x84ca('0x2b')][_0x84ca('0x46')]?_0x51075a[_0x84ca('0x2b')]:_0x13b09f[_0x84ca('0x2a')];_0x51075a[_0x84ca('0x47')]=qs[_0x84ca('0x48')](_0x5e147f['query'][_0x84ca('0x48')]);_0x51075a[_0x84ca('0x30')]=qs[_0x84ca('0x29')](_[_0x84ca('0x4b')](_0x5e147f[_0x84ca('0x27')],_0x13b09f[_0x84ca('0x29')]));if(_0x5e147f[_0x84ca('0x27')][_0x84ca('0x33')]){_0x51075a[_0x84ca('0x30')]=_['merge'](_0x51075a['where'],{'$or':_[_0x84ca('0x22')](_0x51075a[_0x84ca('0x2b')],function(_0x4a1237){var _0x3365b7={};_0x3365b7[_0x4a1237]={'$like':'%'+_0x5e147f[_0x84ca('0x27')][_0x84ca('0x33')]+'%'};return _0x3365b7;})});}_0x51075a=_[_0x84ca('0x31')]({},_0x51075a,_0x5e147f[_0x84ca('0x34')]);return _0x371526[_0x84ca('0x4c')](_0x51075a);}})[_0x84ca('0x1c')](function(_0x4f80f2){if(_0x4f80f2){_0x12da30=_0x4f80f2[_0x84ca('0x46')];if(!_0x5e147f[_0x84ca('0x27')][_0x84ca('0x2e')](_0x84ca('0x2f'))){_0x51075a[_0x84ca('0x17')]=qs[_0x84ca('0x17')](_0x5e147f[_0x84ca('0x27')]['limit']);_0x51075a[_0x84ca('0x16')]=qs[_0x84ca('0x16')](_0x5e147f['query'][_0x84ca('0x16')]);}return _0x371526[_0x84ca('0x4c')](_0x51075a);}})[_0x84ca('0x1c')](function(_0x1816cf){if(_0x1816cf){return _0x1816cf?{'count':_0x12da30,'rows':_0x1816cf}:null;}})[_0x84ca('0x1c')](respondWithResult(_0x39330a,null))[_0x84ca('0x3b')](handleError(_0x39330a,null));};
\ No newline at end of file
+var _0xc81e=['filters','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','addConditions','Condition','ids','order','addActions','getActions','findOne','Action','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort'];(function(_0x3e24cd,_0x129588){var _0x58490f=function(_0x4e287d){while(--_0x4e287d){_0x3e24cd['push'](_0x3e24cd['shift']());}};_0x58490f(++_0x129588);}(_0xc81e,0x11a));var _0xec81=function(_0x4a96d2,_0x689504){_0x4a96d2=_0x4a96d2-0x0;var _0x38af04=_0xc81e[_0x4a96d2];return _0x38af04;};'use strict';var pdf=require(_0xec81('0x0'));var emlformat=require(_0xec81('0x1'));var rimraf=require(_0xec81('0x2'));var zipdir=require(_0xec81('0x3'));var jsonpatch=require(_0xec81('0x4'));var rp=require(_0xec81('0x5'));var moment=require('moment');var BPromise=require(_0xec81('0x6'));var Mustache=require('mustache');var util=require(_0xec81('0x7'));var path=require(_0xec81('0x8'));var sox=require(_0xec81('0x9'));var csv=require(_0xec81('0xa'));var ejs=require(_0xec81('0xb'));var fs=require('fs');var _=require(_0xec81('0xc'));var squel=require(_0xec81('0xd'));var crypto=require(_0xec81('0xe'));var jsforce=require(_0xec81('0xf'));var deskjs=require(_0xec81('0x10'));var toCsv=require('to-csv');var querystring=require(_0xec81('0x11'));var Papa=require('papaparse');var Redis=require(_0xec81('0x12'));var authService=require(_0xec81('0x13'));var qs=require(_0xec81('0x14'));var as=require(_0xec81('0x15'));var hardwareService=require(_0xec81('0x16'));var logger=require(_0xec81('0x17'))(_0xec81('0x18'));var utils=require(_0xec81('0x19'));var config=require(_0xec81('0x1a'));var db=require(_0xec81('0x1b'))['db'];function respondWithStatusCode(_0x28daab,_0x1d98e0){_0x1d98e0=_0x1d98e0||0xcc;return function(_0x5e40b5){if(_0x5e40b5){return _0x28daab[_0xec81('0x1c')](_0x1d98e0);}return _0x28daab[_0xec81('0x1d')](_0x1d98e0)[_0xec81('0x1e')]();};}function respondWithResult(_0x108e09,_0x493404){_0x493404=_0x493404||0xc8;return function(_0x2bbb8b){if(_0x2bbb8b){return _0x108e09[_0xec81('0x1d')](_0x493404)['json'](_0x2bbb8b);}};}function respondWithFilteredResult(_0x1c6ddb,_0x30af5d){return function(_0x18df8b){if(_0x18df8b){var _0x5c52d3=_0x18df8b[_0xec81('0x1f')],_0x3100f8=_0x30af5d[_0xec81('0x20')],_0x56936d=_0x30af5d[_0xec81('0x20')]+_0x30af5d['limit'],_0x4ab83f;if(_0x56936d>=_0x5c52d3){_0x56936d=_0x5c52d3;_0x4ab83f=0xc8;}else{_0x4ab83f=0xce;}_0x1c6ddb['status'](_0x4ab83f);return _0x1c6ddb[_0xec81('0x21')](_0xec81('0x22'),_0x3100f8+'-'+_0x56936d+'/'+_0x5c52d3)[_0xec81('0x23')](_0x18df8b);}return null;};}function patchUpdates(_0x41e847){return function(_0x492491){try{jsonpatch[_0xec81('0x24')](_0x492491,_0x41e847,!![]);}catch(_0x319681){return BPromise[_0xec81('0x25')](_0x319681);}return _0x492491['save']();};}function saveUpdates(_0x5219ec,_0x229dcf){return function(_0x283d54){if(_0x283d54){return _0x283d54[_0xec81('0x26')](_0x5219ec)[_0xec81('0x27')](function(_0x3f60bb){return _0x3f60bb;});}return null;};}function removeEntity(_0x51159d,_0x22d3cd){return function(_0x2499d0){if(_0x2499d0){return _0x2499d0[_0xec81('0x28')]()[_0xec81('0x27')](function(){_0x51159d['status'](0xcc)[_0xec81('0x1e')]();});}};}function handleEntityNotFound(_0x492802,_0x97dcf8){return function(_0x46436e){if(!_0x46436e){_0x492802['sendStatus'](0x194);}return _0x46436e;};}function handleError(_0x1b46fd,_0x5d7698){_0x5d7698=_0x5d7698||0x1f4;return function(_0x735b0e){logger[_0xec81('0x29')](_0x735b0e[_0xec81('0x2a')]);if(_0x735b0e[_0xec81('0x2b')]){delete _0x735b0e[_0xec81('0x2b')];}_0x1b46fd[_0xec81('0x1d')](_0x5d7698)[_0xec81('0x2c')](_0x735b0e);};}exports['index']=function(_0x3032b9,_0x504521){var _0x3a03ae={},_0x6e4e22={},_0x4dc65b={'count':0x0,'rows':[]};var _0x4a1019=_[_0xec81('0x2d')](db[_0xec81('0x2e')][_0xec81('0x2f')],function(_0xad628a){return{'name':_0xad628a[_0xec81('0x30')],'type':_0xad628a[_0xec81('0x31')][_0xec81('0x32')]};});_0x6e4e22[_0xec81('0x33')]=_[_0xec81('0x2d')](_0x4a1019,_0xec81('0x2b'));_0x6e4e22[_0xec81('0x34')]=_[_0xec81('0x35')](_0x3032b9[_0xec81('0x34')]);_0x6e4e22['filters']=_['intersection'](_0x6e4e22[_0xec81('0x33')],_0x6e4e22['query']);_0x3a03ae[_0xec81('0x36')]=_[_0xec81('0x37')](_0x6e4e22[_0xec81('0x33')],qs[_0xec81('0x38')](_0x3032b9[_0xec81('0x34')][_0xec81('0x38')]));_0x3a03ae[_0xec81('0x36')]=_0x3a03ae[_0xec81('0x36')][_0xec81('0x39')]?_0x3a03ae[_0xec81('0x36')]:_0x6e4e22[_0xec81('0x33')];if(!_0x3032b9['query'][_0xec81('0x3a')](_0xec81('0x3b'))){_0x3a03ae[_0xec81('0x3c')]=qs[_0xec81('0x3c')](_0x3032b9['query']['limit']);_0x3a03ae[_0xec81('0x20')]=qs[_0xec81('0x20')](_0x3032b9[_0xec81('0x34')][_0xec81('0x20')]);}_0x3a03ae['order']=qs[_0xec81('0x3d')](_0x3032b9[_0xec81('0x34')]['sort']);_0x3a03ae['where']=qs[_0xec81('0x3e')](_[_0xec81('0x3f')](_0x3032b9['query'],_0x6e4e22[_0xec81('0x3e')]),_0x4a1019);if(_0x3032b9[_0xec81('0x34')][_0xec81('0x40')]){_0x3a03ae[_0xec81('0x41')]=_[_0xec81('0x42')](_0x3a03ae[_0xec81('0x41')],{'$or':_[_0xec81('0x2d')](_0x4a1019,function(_0x4f5777){if(_0x4f5777[_0xec81('0x31')]!==_0xec81('0x43')){var _0xd22c02={};_0xd22c02[_0x4f5777[_0xec81('0x2b')]]={'$like':'%'+_0x3032b9['query'][_0xec81('0x40')]+'%'};return _0xd22c02;}})});}_0x3a03ae=_[_0xec81('0x42')]({},_0x3a03ae,_0x3032b9['options']);var _0x3c076f={'where':_0x3a03ae[_0xec81('0x41')]};return db['Automation'][_0xec81('0x1f')](_0x3c076f)[_0xec81('0x27')](function(_0x35da41){_0x4dc65b[_0xec81('0x1f')]=_0x35da41;if(_0x3032b9['query'][_0xec81('0x44')]){_0x3a03ae['include']=[{'all':!![]}];}return db[_0xec81('0x2e')][_0xec81('0x45')](_0x3a03ae);})[_0xec81('0x27')](function(_0x44b6a8){_0x4dc65b[_0xec81('0x46')]=_0x44b6a8;return _0x4dc65b;})[_0xec81('0x27')](respondWithFilteredResult(_0x504521,_0x3a03ae))[_0xec81('0x47')](handleError(_0x504521,null));};exports[_0xec81('0x48')]=function(_0x95033d,_0x337ef7){var _0x5f5618={'raw':![],'where':{'id':_0x95033d[_0xec81('0x49')]['id']}},_0x5ee2c8={};_0x5ee2c8[_0xec81('0x33')]=_[_0xec81('0x35')](db[_0xec81('0x2e')][_0xec81('0x2f')]);_0x5ee2c8[_0xec81('0x34')]=_[_0xec81('0x35')](_0x95033d[_0xec81('0x34')]);_0x5ee2c8[_0xec81('0x3e')]=_[_0xec81('0x37')](_0x5ee2c8[_0xec81('0x33')],_0x5ee2c8[_0xec81('0x34')]);_0x5f5618[_0xec81('0x36')]=_[_0xec81('0x37')](_0x5ee2c8[_0xec81('0x33')],qs[_0xec81('0x38')](_0x95033d[_0xec81('0x34')][_0xec81('0x38')]));_0x5f5618[_0xec81('0x36')]=_0x5f5618[_0xec81('0x36')]['length']?_0x5f5618['attributes']:_0x5ee2c8[_0xec81('0x33')];if(_0x95033d[_0xec81('0x34')][_0xec81('0x44')]){_0x5f5618['include']=[{'all':!![]}];}_0x5f5618=_[_0xec81('0x42')]({},_0x5f5618,_0x95033d[_0xec81('0x4a')]);return db[_0xec81('0x2e')][_0xec81('0x4b')](_0x5f5618)[_0xec81('0x27')](handleEntityNotFound(_0x337ef7,null))[_0xec81('0x27')](respondWithResult(_0x337ef7,null))[_0xec81('0x47')](handleError(_0x337ef7,null));};exports[_0xec81('0x4c')]=function(_0x4530cf,_0x4024ab){return db[_0xec81('0x2e')]['create'](_0x4530cf[_0xec81('0x4d')],{})[_0xec81('0x27')](respondWithResult(_0x4024ab,0xc9))['catch'](handleError(_0x4024ab,null));};exports[_0xec81('0x26')]=function(_0x459fa9,_0xa66cbd){if(_0x459fa9[_0xec81('0x4d')]['id']){delete _0x459fa9[_0xec81('0x4d')]['id'];}return db[_0xec81('0x2e')]['find']({'where':{'id':_0x459fa9[_0xec81('0x49')]['id']}})[_0xec81('0x27')](handleEntityNotFound(_0xa66cbd,null))[_0xec81('0x27')](saveUpdates(_0x459fa9[_0xec81('0x4d')],null))[_0xec81('0x27')](respondWithResult(_0xa66cbd,null))[_0xec81('0x47')](handleError(_0xa66cbd,null));};exports[_0xec81('0x28')]=function(_0x1752d7,_0x5357c){return db[_0xec81('0x2e')][_0xec81('0x4b')]({'where':{'id':_0x1752d7['params']['id']}})[_0xec81('0x27')](handleEntityNotFound(_0x5357c,null))[_0xec81('0x27')](removeEntity(_0x5357c,null))[_0xec81('0x47')](handleError(_0x5357c,null));};exports[_0xec81('0x4e')]=function(_0x587286,_0x5e418f,_0x44545d){return db[_0xec81('0x4f')]['find']({'where':{'id':_0x587286['params']['id']}})[_0xec81('0x27')](handleEntityNotFound(_0x5e418f,null))[_0xec81('0x27')](function(_0xd19d44){if(_0xd19d44){return _0xd19d44['addConditions'](_0x587286['body'][_0xec81('0x50')],_['omit'](_0x587286[_0xec81('0x4d')],[_0xec81('0x50'),'id'])||{});}})[_0xec81('0x27')](respondWithResult(_0x5e418f,null))[_0xec81('0x47')](handleError(_0x5e418f,null));};exports['getConditions']=function(_0x2cd8d7,_0x46ca8f,_0x495e0d){var _0x5859d3={};var _0x4de619={};var _0x52ded6;var _0x444845;return db[_0xec81('0x2e')]['findOne']({'where':{'id':_0x2cd8d7[_0xec81('0x49')]['id']}})[_0xec81('0x27')](handleEntityNotFound(_0x46ca8f,null))[_0xec81('0x27')](function(_0x24c479){if(_0x24c479){_0x52ded6=_0x24c479;_0x4de619['model']=_[_0xec81('0x35')](db[_0xec81('0x4f')]['rawAttributes']);_0x4de619[_0xec81('0x34')]=_[_0xec81('0x35')](_0x2cd8d7[_0xec81('0x34')]);_0x4de619[_0xec81('0x3e')]=_['intersection'](_0x4de619['model'],_0x4de619[_0xec81('0x34')]);_0x5859d3[_0xec81('0x36')]=_[_0xec81('0x37')](_0x4de619['model'],qs[_0xec81('0x38')](_0x2cd8d7[_0xec81('0x34')][_0xec81('0x38')]));_0x5859d3[_0xec81('0x36')]=_0x5859d3[_0xec81('0x36')]['length']?_0x5859d3['attributes']:_0x4de619[_0xec81('0x33')];_0x5859d3[_0xec81('0x51')]=qs[_0xec81('0x3d')](_0x2cd8d7[_0xec81('0x34')][_0xec81('0x3d')]);_0x5859d3[_0xec81('0x41')]=qs[_0xec81('0x3e')](_['pick'](_0x2cd8d7[_0xec81('0x34')],_0x4de619[_0xec81('0x3e')]));if(_0x2cd8d7[_0xec81('0x34')][_0xec81('0x40')]){_0x5859d3[_0xec81('0x41')]=_[_0xec81('0x42')](_0x5859d3[_0xec81('0x41')],{'$or':_[_0xec81('0x2d')](_0x5859d3[_0xec81('0x36')],function(_0x2e732d){var _0x4cdec7={};_0x4cdec7[_0x2e732d]={'$like':'%'+_0x2cd8d7[_0xec81('0x34')][_0xec81('0x40')]+'%'};return _0x4cdec7;})});}_0x5859d3=_['merge']({},_0x5859d3,_0x2cd8d7[_0xec81('0x4a')]);return _0x52ded6['getConditions'](_0x5859d3);}})['then'](function(_0x1147e9){if(_0x1147e9){_0x444845=_0x1147e9[_0xec81('0x39')];if(!_0x2cd8d7[_0xec81('0x34')][_0xec81('0x3a')](_0xec81('0x3b'))){_0x5859d3['limit']=qs[_0xec81('0x3c')](_0x2cd8d7['query'][_0xec81('0x3c')]);_0x5859d3[_0xec81('0x20')]=qs[_0xec81('0x20')](_0x2cd8d7[_0xec81('0x34')][_0xec81('0x20')]);}return _0x52ded6['getConditions'](_0x5859d3);}})[_0xec81('0x27')](function(_0x53c27c){if(_0x53c27c){return _0x53c27c?{'count':_0x444845,'rows':_0x53c27c}:null;}})['then'](respondWithResult(_0x46ca8f,null))[_0xec81('0x47')](handleError(_0x46ca8f,null));};exports[_0xec81('0x52')]=function(_0x3f497d,_0x2af5c0,_0x10f936){return db['Action'][_0xec81('0x4b')]({'where':{'id':_0x3f497d[_0xec81('0x49')]['id']}})[_0xec81('0x27')](handleEntityNotFound(_0x2af5c0,null))[_0xec81('0x27')](function(_0x167880){if(_0x167880){return _0x167880[_0xec81('0x52')](_0x3f497d[_0xec81('0x4d')][_0xec81('0x50')],_['omit'](_0x3f497d[_0xec81('0x4d')],['ids','id'])||{});}})[_0xec81('0x27')](respondWithResult(_0x2af5c0,null))[_0xec81('0x47')](handleError(_0x2af5c0,null));};exports[_0xec81('0x53')]=function(_0x3133dc,_0x3e73b4,_0x4f4933){var _0x184a51={};var _0xb2ca72={};var _0x5e6120;var _0xd9f3c5;return db['Automation'][_0xec81('0x54')]({'where':{'id':_0x3133dc[_0xec81('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e73b4,null))[_0xec81('0x27')](function(_0x3761a9){if(_0x3761a9){_0x5e6120=_0x3761a9;_0xb2ca72[_0xec81('0x33')]=_[_0xec81('0x35')](db[_0xec81('0x55')][_0xec81('0x2f')]);_0xb2ca72[_0xec81('0x34')]=_['keys'](_0x3133dc[_0xec81('0x34')]);_0xb2ca72[_0xec81('0x3e')]=_[_0xec81('0x37')](_0xb2ca72[_0xec81('0x33')],_0xb2ca72[_0xec81('0x34')]);_0x184a51[_0xec81('0x36')]=_['intersection'](_0xb2ca72['model'],qs[_0xec81('0x38')](_0x3133dc[_0xec81('0x34')][_0xec81('0x38')]));_0x184a51[_0xec81('0x36')]=_0x184a51['attributes'][_0xec81('0x39')]?_0x184a51['attributes']:_0xb2ca72[_0xec81('0x33')];_0x184a51[_0xec81('0x51')]=qs['sort'](_0x3133dc[_0xec81('0x34')][_0xec81('0x3d')]);_0x184a51[_0xec81('0x41')]=qs['filters'](_[_0xec81('0x3f')](_0x3133dc['query'],_0xb2ca72[_0xec81('0x3e')]));if(_0x3133dc[_0xec81('0x34')][_0xec81('0x40')]){_0x184a51[_0xec81('0x41')]=_[_0xec81('0x42')](_0x184a51[_0xec81('0x41')],{'$or':_[_0xec81('0x2d')](_0x184a51['attributes'],function(_0x356bbb){var _0x389713={};_0x389713[_0x356bbb]={'$like':'%'+_0x3133dc[_0xec81('0x34')][_0xec81('0x40')]+'%'};return _0x389713;})});}_0x184a51=_[_0xec81('0x42')]({},_0x184a51,_0x3133dc[_0xec81('0x4a')]);return _0x5e6120[_0xec81('0x53')](_0x184a51);}})['then'](function(_0x390edf){if(_0x390edf){_0xd9f3c5=_0x390edf[_0xec81('0x39')];if(!_0x3133dc[_0xec81('0x34')][_0xec81('0x3a')]('nolimit')){_0x184a51[_0xec81('0x3c')]=qs[_0xec81('0x3c')](_0x3133dc[_0xec81('0x34')][_0xec81('0x3c')]);_0x184a51[_0xec81('0x20')]=qs[_0xec81('0x20')](_0x3133dc[_0xec81('0x34')][_0xec81('0x20')]);}return _0x5e6120[_0xec81('0x53')](_0x184a51);}})[_0xec81('0x27')](function(_0x5b7e6e){if(_0x5b7e6e){return _0x5b7e6e?{'count':_0xd9f3c5,'rows':_0x5b7e6e}:null;}})[_0xec81('0x27')](respondWithResult(_0x3e73b4,null))[_0xec81('0x47')](handleError(_0x3e73b4,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 7e58a64..d5a0e29 100644
--- a/server/api/automation/automation.model.js
+++ b/server/api/automation/automation.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x24ca=['Automation','tools_automations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x53a529,_0x2c6481){var _0x3fe0bc=function(_0x384780){while(--_0x384780){_0x53a529['push'](_0x53a529['shift']());}};_0x3fe0bc(++_0x2c6481);}(_0x24ca,0x1bc));var _0xa24c=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x24ca[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require(_0xa24c('0x1'))(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa24c('0x4'));var fs=require('fs');var path=require(_0xa24c('0x5'));var rimraf=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var attributes=require(_0xa24c('0x8'));module[_0xa24c('0x9')]=function(_0xf0511,_0x3c0aaa){return _0xf0511[_0xa24c('0xa')](_0xa24c('0xb'),attributes,{'tableName':_0xa24c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4c4e=['moment','request-promise','path','rimraf','./automation.attributes','define','Automation','tools_automations','lodash','../../config/logger','api'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4a93d4,_0xa7b8b1){_0x4a93d4=_0x4a93d4-0x0;var _0x20bd44=_0x4c4e[_0x4a93d4];return _0x20bd44;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require(_0xe4c4('0x5'));var rimraf=require(_0xe4c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4c4('0x7'));module['exports']=function(_0x177732,_0x1a12a6){return _0x177732[_0xe4c4('0x8')](_0xe4c4('0x9'),attributes,{'tableName':_0xe4c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 2962475..f068979 100644
--- a/server/api/automation/automation.rpc.js
+++ b/server/api/automation/automation.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa6d1=['http','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1767ae,_0x34b692){var _0x445227=function(_0x2f51ce){while(--_0x2f51ce){_0x1767ae['push'](_0x1767ae['shift']());}};_0x445227(++_0x34b692);}(_0xa6d1,0x1ae));var _0x1a6d=function(_0x27a6a2,_0x20a8a4){_0x27a6a2=_0x27a6a2-0x0;var _0x1b10dc=_0xa6d1[_0x27a6a2];return _0x1b10dc;};'use strict';var _=require(_0x1a6d('0x0'));var util=require(_0x1a6d('0x1'));var moment=require('moment');var BPromise=require(_0x1a6d('0x2'));var rs=require(_0x1a6d('0x3'));var fs=require('fs');var Redis=require(_0x1a6d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a6d('0x5'));var logger=require('../../config/logger')(_0x1a6d('0x6'));var config=require(_0x1a6d('0x7'));var jayson=require(_0x1a6d('0x8'));var client=jayson[_0x1a6d('0x9')][_0x1a6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27e41c,_0x875f08,_0x8d5080){return new BPromise(function(_0x37a9d2,_0x14d1ff){return client['request'](_0x27e41c,_0x8d5080)[_0x1a6d('0xb')](function(_0x4dd616){logger['info']('Automation,\x20%s,\x20%s',_0x875f08,_0x1a6d('0xc'));logger[_0x1a6d('0xd')](_0x1a6d('0xe'),_0x875f08,_0x1a6d('0xc'),JSON[_0x1a6d('0xf')](_0x4dd616));if(_0x4dd616['error']){if(_0x4dd616[_0x1a6d('0x10')][_0x1a6d('0x11')]===0x1f4){logger[_0x1a6d('0x10')](_0x1a6d('0x12'),_0x875f08,_0x4dd616['error']['message']);return _0x14d1ff(_0x4dd616[_0x1a6d('0x10')][_0x1a6d('0x13')]);}logger[_0x1a6d('0x10')](_0x1a6d('0x12'),_0x875f08,_0x4dd616[_0x1a6d('0x10')]['message']);return _0x37a9d2(_0x4dd616[_0x1a6d('0x10')][_0x1a6d('0x13')]);}else{logger[_0x1a6d('0x14')]('Automation,\x20%s,\x20%s',_0x875f08,_0x1a6d('0xc'));_0x37a9d2(_0x4dd616['result'][_0x1a6d('0x13')]);}})[_0x1a6d('0x15')](function(_0x4f7b6b){logger[_0x1a6d('0x10')](_0x1a6d('0x12'),_0x875f08,_0x4f7b6b);_0x14d1ff(_0x4f7b6b);});});}
\ No newline at end of file
+var _0x7c17=['Automation,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info'];(function(_0x1b53aa,_0x1effa6){var _0x5c0727=function(_0x36c8bb){while(--_0x36c8bb){_0x1b53aa['push'](_0x1b53aa['shift']());}};_0x5c0727(++_0x1effa6);}(_0x7c17,0x149));var _0x77c1=function(_0x52dcf6,_0x579413){_0x52dcf6=_0x52dcf6-0x0;var _0x2fb3f4=_0x7c17[_0x52dcf6];return _0x2fb3f4;};'use strict';var _=require(_0x77c1('0x0'));var util=require(_0x77c1('0x1'));var moment=require(_0x77c1('0x2'));var BPromise=require(_0x77c1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77c1('0x4'))['db'];var utils=require(_0x77c1('0x5'));var logger=require('../../config/logger')(_0x77c1('0x6'));var config=require(_0x77c1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x77c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3146e8,_0x3e8a03,_0x135ea3){return new BPromise(function(_0x1c31c0,_0x53a84a){return client[_0x77c1('0x9')](_0x3146e8,_0x135ea3)['then'](function(_0x4ec1fd){logger[_0x77c1('0xa')](_0x77c1('0xb'),_0x3e8a03,_0x77c1('0xc'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3e8a03,'request\x20sent',JSON['stringify'](_0x4ec1fd));if(_0x4ec1fd['error']){if(_0x4ec1fd[_0x77c1('0xd')]['code']===0x1f4){logger[_0x77c1('0xd')](_0x77c1('0xb'),_0x3e8a03,_0x4ec1fd[_0x77c1('0xd')]['message']);return _0x53a84a(_0x4ec1fd[_0x77c1('0xd')]['message']);}logger[_0x77c1('0xd')]('Automation,\x20%s,\x20%s',_0x3e8a03,_0x4ec1fd[_0x77c1('0xd')]['message']);return _0x1c31c0(_0x4ec1fd[_0x77c1('0xd')][_0x77c1('0xe')]);}else{logger['info'](_0x77c1('0xb'),_0x3e8a03,_0x77c1('0xc'));_0x1c31c0(_0x4ec1fd[_0x77c1('0xf')][_0x77c1('0xe')]);}})[_0x77c1('0x10')](function(_0x15cbbd){logger[_0x77c1('0xd')]('Automation,\x20%s,\x20%s',_0x3e8a03,_0x15cbbd);_0x53a84a(_0x15cbbd);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 7577c58..5a36d52 100644
--- a/server/api/automation/index.js
+++ b/server/api/automation/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b84=['/:id','show','getConditions','/:id/actions','getActions','create','post','/:id/conditions','addConditions','addActions','update','delete','exports','multer','util','path','express','Router','../../config/environment','./automation.controller','get','isAuthenticated','index'];(function(_0x1587cd,_0x4f8b40){var _0x5c74da=function(_0x1ade27){while(--_0x1ade27){_0x1587cd['push'](_0x1587cd['shift']());}};_0x5c74da(++_0x4f8b40);}(_0x7b84,0x80));var _0x47b8=function(_0x2bb742,_0x530b7a){_0x2bb742=_0x2bb742-0x0;var _0x80d16c=_0x7b84[_0x2bb742];return _0x80d16c;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require('connect-timeout');var express=require(_0x47b8('0x3'));var router=express[_0x47b8('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x47b8('0x5'));var controller=require(_0x47b8('0x6'));router[_0x47b8('0x7')]('/',auth[_0x47b8('0x8')](),controller[_0x47b8('0x9')]);router[_0x47b8('0x7')](_0x47b8('0xa'),auth[_0x47b8('0x8')](),controller[_0x47b8('0xb')]);router[_0x47b8('0x7')]('/:id/conditions',auth[_0x47b8('0x8')](),controller[_0x47b8('0xc')]);router[_0x47b8('0x7')](_0x47b8('0xd'),auth['isAuthenticated'](),controller[_0x47b8('0xe')]);router['post']('/',auth[_0x47b8('0x8')](),controller[_0x47b8('0xf')]);router[_0x47b8('0x10')](_0x47b8('0x11'),auth[_0x47b8('0x8')](),controller[_0x47b8('0x12')]);router[_0x47b8('0x10')](_0x47b8('0xd'),auth[_0x47b8('0x8')](),controller[_0x47b8('0x13')]);router['put'](_0x47b8('0xa'),auth[_0x47b8('0x8')](),controller[_0x47b8('0x14')]);router[_0x47b8('0x15')]('/:id',auth[_0x47b8('0x8')](),controller['destroy']);module[_0x47b8('0x16')]=router;
\ No newline at end of file
+var _0x77b0=['addActions','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions'];(function(_0x139b63,_0x389ca8){var _0x2493f2=function(_0x137a08){while(--_0x137a08){_0x139b63['push'](_0x139b63['shift']());}};_0x2493f2(++_0x389ca8);}(_0x77b0,0xd4));var _0x077b=function(_0x5e7e22,_0x5a91e0){_0x5e7e22=_0x5e7e22-0x0;var _0x2168ad=_0x77b0[_0x5e7e22];return _0x2168ad;};'use strict';var multer=require('multer');var util=require(_0x077b('0x0'));var path=require(_0x077b('0x1'));var timeout=require('connect-timeout');var express=require(_0x077b('0x2'));var router=express[_0x077b('0x3')]();var auth=require(_0x077b('0x4'));var interaction=require(_0x077b('0x5'));var config=require(_0x077b('0x6'));var controller=require('./automation.controller');router[_0x077b('0x7')]('/',auth[_0x077b('0x8')](),controller[_0x077b('0x9')]);router[_0x077b('0x7')](_0x077b('0xa'),auth[_0x077b('0x8')](),controller['show']);router['get'](_0x077b('0xb'),auth['isAuthenticated'](),controller[_0x077b('0xc')]);router[_0x077b('0x7')](_0x077b('0xd'),auth[_0x077b('0x8')](),controller[_0x077b('0xe')]);router[_0x077b('0xf')]('/',auth[_0x077b('0x8')](),controller[_0x077b('0x10')]);router[_0x077b('0xf')](_0x077b('0xb'),auth['isAuthenticated'](),controller[_0x077b('0x11')]);router[_0x077b('0xf')]('/:id/actions',auth[_0x077b('0x8')](),controller[_0x077b('0x12')]);router['put']('/:id',auth[_0x077b('0x8')](),controller[_0x077b('0x13')]);router[_0x077b('0x14')](_0x077b('0xa'),auth[_0x077b('0x8')](),controller[_0x077b('0x15')]);module[_0x077b('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index d66d24a..e245d24 100644
--- a/server/api/campaign/campaign.attributes.js
+++ b/server/api/campaign/campaign.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8315=['never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x8315,0x1d2));var _0x5831=function(_0x186415,_0x54fc1f){_0x186415=_0x186415-0x0;var _0x4da132=_0x8315[_0x186415];return _0x4da132;};'use strict';var Sequelize=require('sequelize');module[_0x5831('0x0')]={'name':{'type':Sequelize[_0x5831('0x1')],'unique':_0x5831('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5831('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x5831('0x4')},'description':{'type':Sequelize[_0x5831('0x1')]},'active':{'type':Sequelize[_0x5831('0x5')],'defaultValue':0x0,'comment':_0x5831('0x6')},'limitCalls':{'type':Sequelize[_0x5831('0x7')](0x4)[_0x5831('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5831('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5831('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5831('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x5831('0x7')](0x3)[_0x5831('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5831('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5831('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x5831('0x7')](0x3)[_0x5831('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5831('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5831('0x7')](0x3)[_0x5831('0x8')],'defaultValue':0x3,'comment':_0x5831('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5831('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5831('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5831('0x7')](0x3)[_0x5831('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5831('0xd')},'dialTimezone':{'type':Sequelize[_0x5831('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5831('0x1')],'defaultValue':_0x5831('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x5831('0x3')]('always',_0x5831('0xf'),'onlyIfOpen'),'defaultValue':_0x5831('0x10')},'dialAMDActive':{'type':Sequelize[_0x5831('0x5')],'defaultValue':0x0,'comment':_0x5831('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x5831('0x7')](0x9)[_0x5831('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5831('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x5831('0x7')](0x9)[_0x5831('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5831('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5831('0x7')](0x9)[_0x5831('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x5831('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5831('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5831('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5831('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5831('0x7')](0x9)[_0x5831('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5831('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5831('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5831('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5831('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5831('0x3')]('DESC',_0x5831('0x19')),'defaultValue':_0x5831('0x1a')},'dialPrefix':{'type':Sequelize[_0x5831('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5831('0x7')](0x3)[_0x5831('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x5831('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5831('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5831('0x7')](0x3)[_0x5831('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5831('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5831('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5831('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x5831('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5831('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x5831('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5831('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5831('0x7')](0x3)[_0x5831('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5831('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5831('0x7')](0x5)[_0x5831('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5831('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x5831('0x7')](0x3)[_0x5831('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5831('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5831('0x7')](0x5)[_0x5831('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5831('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5831('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5831('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5831('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x1bb8=['onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never'];(function(_0x5ac03a,_0x973ca7){var _0x6ab71=function(_0x27a298){while(--_0x27a298){_0x5ac03a['push'](_0x5ac03a['shift']());}};_0x6ab71(++_0x973ca7);}(_0x1bb8,0x160));var _0x81bb=function(_0x4d9d68,_0x3e73c2){_0x4d9d68=_0x4d9d68-0x0;var _0x672f03=_0x1bb8[_0x4d9d68];return _0x672f03;};'use strict';var Sequelize=require(_0x81bb('0x0'));module[_0x81bb('0x1')]={'name':{'type':Sequelize[_0x81bb('0x2')],'unique':_0x81bb('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x81bb('0x4')),'allowNull':![],'defaultValue':_0x81bb('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x81bb('0x5')],'defaultValue':0x0,'comment':_0x81bb('0x6')},'limitCalls':{'type':Sequelize[_0x81bb('0x7')](0x4)[_0x81bb('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x81bb('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x81bb('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x81bb('0x7')](0x3)[_0x81bb('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x81bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81bb('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x81bb('0x7')](0x5)[_0x81bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81bb('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x81bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81bb('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x81bb('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x81bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81bb('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x81bb('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x81bb('0xe')},'dialTimezone':{'type':Sequelize[_0x81bb('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x81bb('0x2')],'defaultValue':_0x81bb('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x81bb('0x10')]('always',_0x81bb('0x11'),_0x81bb('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x81bb('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x81bb('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x81bb('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x81bb('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x81bb('0x7')](0x9)[_0x81bb('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x81bb('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x81bb('0x7')](0x9)[_0x81bb('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81bb('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x81bb('0x7')](0x9)[_0x81bb('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x81bb('0x7')](0x9)[_0x81bb('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x81bb('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x81bb('0x7')](0x9)[_0x81bb('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x81bb('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x81bb('0x7')](0x5)[_0x81bb('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x81bb('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81bb('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x81bb('0x1a'),_0x81bb('0x1b')),'defaultValue':_0x81bb('0x1a')},'dialPrefix':{'type':Sequelize[_0x81bb('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x81bb('0x7')](0x3)[_0x81bb('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81bb('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x81bb('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81bb('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x81bb('0x7')](0x3)[_0x81bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81bb('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x81bb('0x7')](0x5)[_0x81bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81bb('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x81bb('0x7')](0x3)[_0x81bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x81bb('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81bb('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x81bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81bb('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x81bb('0x7')](0x5)[_0x81bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81bb('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x81bb('0x7')](0x3)[_0x81bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x81bb('0x7')](0x5)[_0x81bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x81bb('0x7')](0x3)[_0x81bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81bb('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81bb('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 59dfa72..72e87e0 100644
--- a/server/api/campaign/campaign.controller.js
+++ b/server/api/campaign/campaign.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x936c=['sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','includeAll','include','Campaign','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','omit','updatedAt','createdAt','role','UserProfileSection','update','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','nolimit','getHopperFinals','CmHopperBlack','hasOwnProperty','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','scheduledAt','ContactId','ListId','select','field','phone','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','push','sequelize','removeLists','getBlackLists','addBlackLists','all','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x33f1cb,_0x36f40a){var _0x1cbe6d=function(_0x48560d){while(--_0x48560d){_0x33f1cb['push'](_0x33f1cb['shift']());}};_0x1cbe6d(++_0x36f40a);}(_0x936c,0x176));var _0xc936=function(_0x3723fa,_0x46357e){_0x3723fa=_0x3723fa-0x0;var _0x8e2a49=_0x936c[_0x3723fa];return _0x8e2a49;};'use strict';var pdf=require(_0xc936('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc936('0x1'));var zipdir=require(_0xc936('0x2'));var jsonpatch=require(_0xc936('0x3'));var rp=require(_0xc936('0x4'));var moment=require(_0xc936('0x5'));var BPromise=require(_0xc936('0x6'));var Mustache=require(_0xc936('0x7'));var util=require(_0xc936('0x8'));var path=require(_0xc936('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc936('0xa'));var fs=require('fs');var _=require(_0xc936('0xb'));var squel=require('squel');var crypto=require(_0xc936('0xc'));var jsforce=require(_0xc936('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc936('0xe'));var querystring=require('querystring');var Papa=require(_0xc936('0xf'));var Redis=require(_0xc936('0x10'));var authService=require(_0xc936('0x11'));var qs=require(_0xc936('0x12'));var as=require(_0xc936('0x13'));var hardwareService=require(_0xc936('0x14'));var logger=require('../../config/logger')(_0xc936('0x15'));var utils=require(_0xc936('0x16'));var config=require(_0xc936('0x17'));var db=require(_0xc936('0x18'))['db'];function respondWithStatusCode(_0x4c3266,_0x1e293e){_0x1e293e=_0x1e293e||0xcc;return function(_0x5ef1a8){if(_0x5ef1a8){return _0x4c3266[_0xc936('0x19')](_0x1e293e);}return _0x4c3266['status'](_0x1e293e)[_0xc936('0x1a')]();};}function respondWithResult(_0x34aa6d,_0x422d01){_0x422d01=_0x422d01||0xc8;return function(_0x152b9e){if(_0x152b9e){return _0x34aa6d['status'](_0x422d01)[_0xc936('0x1b')](_0x152b9e);}};}function respondWithFilteredResult(_0x1ce3f9,_0x45250e){return function(_0x4b71be){if(_0x4b71be){var _0x3e6cd5=_0x4b71be[_0xc936('0x1c')],_0x449c81=_0x45250e[_0xc936('0x1d')],_0x379414=_0x45250e['offset']+_0x45250e[_0xc936('0x1e')],_0x22b7e0;if(_0x379414>=_0x3e6cd5){_0x379414=_0x3e6cd5;_0x22b7e0=0xc8;}else{_0x22b7e0=0xce;}_0x1ce3f9[_0xc936('0x1f')](_0x22b7e0);return _0x1ce3f9[_0xc936('0x20')](_0xc936('0x21'),_0x449c81+'-'+_0x379414+'/'+_0x3e6cd5)['json'](_0x4b71be);}return null;};}function patchUpdates(_0x29ca45){return function(_0x33ae15){try{jsonpatch['apply'](_0x33ae15,_0x29ca45,!![]);}catch(_0x1b8442){return BPromise[_0xc936('0x22')](_0x1b8442);}return _0x33ae15[_0xc936('0x23')]();};}function saveUpdates(_0x2ce50a,_0x4c8391){return function(_0x3811ad){if(_0x3811ad){return _0x3811ad['update'](_0x2ce50a)[_0xc936('0x24')](function(_0x49d3cc){return _0x49d3cc;});}return null;};}function removeEntity(_0x33468b,_0x6386a){return function(_0x30ebc8){if(_0x30ebc8){return _0x30ebc8[_0xc936('0x25')]()[_0xc936('0x24')](function(){var _0x1aac08=_0x30ebc8[_0xc936('0x26')]({'plain':!![]});var _0x19a0e1=_0xc936('0x27');return db[_0xc936('0x28')][_0xc936('0x25')]({'where':{'type':_0x19a0e1,'resourceId':_0x1aac08['id']}})[_0xc936('0x24')](function(){return _0x30ebc8;});})[_0xc936('0x24')](function(){_0x33468b[_0xc936('0x1f')](0xcc)[_0xc936('0x1a')]();});}};}function handleEntityNotFound(_0x51e28d,_0x40a4c4){return function(_0x253a0a){if(!_0x253a0a){_0x51e28d[_0xc936('0x19')](0x194);}return _0x253a0a;};}function handleError(_0x55153c,_0x25734e){_0x25734e=_0x25734e||0x1f4;return function(_0x2d0116){logger['error'](_0x2d0116[_0xc936('0x29')]);if(_0x2d0116[_0xc936('0x2a')]){delete _0x2d0116[_0xc936('0x2a')];}_0x55153c[_0xc936('0x1f')](_0x25734e)[_0xc936('0x2b')](_0x2d0116);};}exports['index']=function(_0x3f8c1a,_0x34092c){var _0x3b27d9={},_0x1e8a0f={},_0x312f61={'count':0x0,'rows':[]};var _0xf924e=_[_0xc936('0x2c')](db['Campaign'][_0xc936('0x2d')],function(_0x211ded){return{'name':_0x211ded['fieldName'],'type':_0x211ded[_0xc936('0x2e')][_0xc936('0x2f')]};});_0x1e8a0f['model']=_[_0xc936('0x2c')](_0xf924e,'name');_0x1e8a0f[_0xc936('0x30')]=_[_0xc936('0x31')](_0x3f8c1a['query']);_0x1e8a0f[_0xc936('0x32')]=_[_0xc936('0x33')](_0x1e8a0f[_0xc936('0x34')],_0x1e8a0f['query']);_0x3b27d9[_0xc936('0x35')]=_[_0xc936('0x33')](_0x1e8a0f[_0xc936('0x34')],qs['fields'](_0x3f8c1a[_0xc936('0x30')][_0xc936('0x36')]));_0x3b27d9[_0xc936('0x35')]=_0x3b27d9[_0xc936('0x35')][_0xc936('0x37')]?_0x3b27d9[_0xc936('0x35')]:_0x1e8a0f['model'];if(!_0x3f8c1a[_0xc936('0x30')]['hasOwnProperty']('nolimit')){_0x3b27d9[_0xc936('0x1e')]=qs[_0xc936('0x1e')](_0x3f8c1a['query'][_0xc936('0x1e')]);_0x3b27d9[_0xc936('0x1d')]=qs[_0xc936('0x1d')](_0x3f8c1a['query'][_0xc936('0x1d')]);}_0x3b27d9[_0xc936('0x38')]=qs[_0xc936('0x39')](_0x3f8c1a[_0xc936('0x30')][_0xc936('0x39')]);_0x3b27d9[_0xc936('0x3a')]=qs[_0xc936('0x32')](_['pick'](_0x3f8c1a[_0xc936('0x30')],_0x1e8a0f[_0xc936('0x32')]),_0xf924e);if(_0x3f8c1a[_0xc936('0x30')]['filter']){_0x3b27d9[_0xc936('0x3a')]=_[_0xc936('0x3b')](_0x3b27d9[_0xc936('0x3a')],{'$or':_['map'](_0xf924e,function(_0x5aabca){if(_0x5aabca['type']!==_0xc936('0x3c')){var _0x1e98fb={};_0x1e98fb[_0x5aabca[_0xc936('0x2a')]]={'$like':'%'+_0x3f8c1a[_0xc936('0x30')][_0xc936('0x3d')]+'%'};return _0x1e98fb;}})});}_0x3b27d9=_[_0xc936('0x3b')]({},_0x3b27d9,_0x3f8c1a['options']);var _0x311503={'where':_0x3b27d9[_0xc936('0x3a')]};return db['Campaign'][_0xc936('0x1c')](_0x311503)[_0xc936('0x24')](function(_0x249b90){_0x312f61[_0xc936('0x1c')]=_0x249b90;if(_0x3f8c1a[_0xc936('0x30')][_0xc936('0x3e')]){_0x3b27d9[_0xc936('0x3f')]=[{'all':!![]}];}return db[_0xc936('0x40')][_0xc936('0x41')](_0x3b27d9);})[_0xc936('0x24')](function(_0x18271c){_0x312f61[_0xc936('0x42')]=_0x18271c;return _0x312f61;})[_0xc936('0x24')](respondWithFilteredResult(_0x34092c,_0x3b27d9))[_0xc936('0x43')](handleError(_0x34092c,null));};exports[_0xc936('0x44')]=function(_0x56a654,_0x22aa3f){var _0x4a4ec0={'raw':![],'where':{'id':_0x56a654[_0xc936('0x45')]['id']}},_0x17eabf={};_0x17eabf[_0xc936('0x34')]=_['keys'](db['Campaign'][_0xc936('0x2d')]);_0x17eabf[_0xc936('0x30')]=_[_0xc936('0x31')](_0x56a654[_0xc936('0x30')]);_0x17eabf[_0xc936('0x32')]=_['intersection'](_0x17eabf['model'],_0x17eabf[_0xc936('0x30')]);_0x4a4ec0['attributes']=_['intersection'](_0x17eabf[_0xc936('0x34')],qs['fields'](_0x56a654[_0xc936('0x30')][_0xc936('0x36')]));_0x4a4ec0[_0xc936('0x35')]=_0x4a4ec0[_0xc936('0x35')][_0xc936('0x37')]?_0x4a4ec0[_0xc936('0x35')]:_0x17eabf[_0xc936('0x34')];if(_0x56a654[_0xc936('0x30')][_0xc936('0x3e')]){_0x4a4ec0[_0xc936('0x3f')]=[{'all':!![]}];}_0x4a4ec0=_[_0xc936('0x3b')]({},_0x4a4ec0,_0x56a654[_0xc936('0x46')]);return db['Campaign'][_0xc936('0x47')](_0x4a4ec0)[_0xc936('0x24')](handleEntityNotFound(_0x22aa3f,null))[_0xc936('0x24')](respondWithResult(_0x22aa3f,null))['catch'](handleError(_0x22aa3f,null));};exports['create']=function(_0x31555e,_0x1fc76f){return db[_0xc936('0x40')][_0xc936('0x48')](_0x31555e[_0xc936('0x49')],{})['then'](function(_0x2a9f8b){var _0x253e87=_0x31555e[_0xc936('0x4a')]['get']({'plain':!![]});if(!_0x253e87)throw new Error(_0xc936('0x4b'));if(_0x253e87['role']==='user'){var _0x150f30=_0x2a9f8b[_0xc936('0x26')]({'plain':!![]});var _0xdb7c0='IvrCampaigns';return db['UserProfileSection'][_0xc936('0x47')]({'where':{'name':_0xdb7c0,'userProfileId':_0x253e87[_0xc936('0x4c')]},'raw':!![]})[_0xc936('0x24')](function(_0x18f3da){if(_0x18f3da&&_0x18f3da[_0xc936('0x4d')]===0x0){return db[_0xc936('0x28')][_0xc936('0x48')]({'name':_0x150f30[_0xc936('0x2a')],'resourceId':_0x150f30['id'],'type':_0x18f3da[_0xc936('0x2a')],'sectionId':_0x18f3da['id']},{})[_0xc936('0x24')](function(){return _0x2a9f8b;});}else{return _0x2a9f8b;}})[_0xc936('0x43')](function(_0x5ed5a1){logger[_0xc936('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ed5a1);throw _0x5ed5a1;});}return _0x2a9f8b;})[_0xc936('0x24')](respondWithResult(_0x1fc76f,0xc9))[_0xc936('0x43')](handleError(_0x1fc76f,null));};exports['clone']=function(_0x1fb433,_0x1b7ce7){var _0x13e642={'where':{'id':_0x1fb433['params']['id']}},_0x2eb5e1={};_0x2eb5e1[_0xc936('0x34')]=_[_0xc936('0x31')](db[_0xc936('0x40')]['rawAttributes']);_0x13e642[_0xc936('0x35')]=_[_0xc936('0x33')](_0x2eb5e1[_0xc936('0x34')],qs[_0xc936('0x36')](_0x1fb433[_0xc936('0x30')][_0xc936('0x36')]));_0x13e642[_0xc936('0x35')]=_0x13e642[_0xc936('0x35')][_0xc936('0x37')]?_0x13e642[_0xc936('0x35')]:_0x2eb5e1['model'];if(_0x1fb433[_0xc936('0x30')]['includeAll']){_0x13e642[_0xc936('0x3f')]=[{'all':!![]}];}_0x13e642=_[_0xc936('0x3b')]({},_0x13e642,_0x1fb433[_0xc936('0x46')]);return db[_0xc936('0x40')]['find'](_0x13e642)['then'](handleEntityNotFound(_0x1b7ce7,null))[_0xc936('0x24')](function(_0x1f9c68){if(_0x1f9c68){var _0x53e42c=_0x1f9c68[_0xc936('0x26')]({'plain':!![]});_0x53e42c=qs[_0xc936('0x4f')](_0x53e42c,['id','createdAt',_0xc936('0x50')]);_0x1fb433[_0xc936('0x49')]=_[_0xc936('0x4f')](_0x1fb433[_0xc936('0x49')],['id',_0xc936('0x51'),'updatedAt']);return db[_0xc936('0x40')]['create'](_[_0xc936('0x3b')](_0x53e42c,_0x1fb433['body']),{'include':_0x1fb433[_0xc936('0x30')][_0xc936('0x3e')]?[{'all':!![]}]:undefined})[_0xc936('0x24')](function(_0x35c3f3){var _0x25a652=_0x1fb433[_0xc936('0x4a')][_0xc936('0x26')]({'plain':!![]});if(!_0x25a652)throw new Error(_0xc936('0x4b'));if(_0x25a652[_0xc936('0x52')]==='user'){var _0x1455df=_0x35c3f3[_0xc936('0x26')]({'plain':!![]});var _0x2bc4f1='IvrCampaigns';return db[_0xc936('0x53')][_0xc936('0x47')]({'where':{'name':_0x2bc4f1,'userProfileId':_0x25a652['userProfileId']},'raw':!![]})[_0xc936('0x24')](function(_0x3a29cd){if(_0x3a29cd&&_0x3a29cd[_0xc936('0x4d')]===0x0){return db[_0xc936('0x28')][_0xc936('0x48')]({'name':_0x1455df['name'],'resourceId':_0x1455df['id'],'type':_0x3a29cd[_0xc936('0x2a')],'sectionId':_0x3a29cd['id']},{})[_0xc936('0x24')](function(){return _0x35c3f3;});}else{return _0x35c3f3;}})[_0xc936('0x43')](function(_0x5ae667){logger[_0xc936('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ae667);throw _0x5ae667;});}return _0x35c3f3;});}})[_0xc936('0x24')](respondWithResult(_0x1b7ce7,0xc9))[_0xc936('0x43')](handleError(_0x1b7ce7,null));};exports[_0xc936('0x54')]=function(_0x474c36,_0x46700d){if(_0x474c36[_0xc936('0x49')]['id']){delete _0x474c36[_0xc936('0x49')]['id'];}return db[_0xc936('0x40')]['find']({'where':{'id':_0x474c36[_0xc936('0x45')]['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x46700d,null))[_0xc936('0x24')](saveUpdates(_0x474c36[_0xc936('0x49')],null))['then'](respondWithResult(_0x46700d,null))['catch'](handleError(_0x46700d,null));};exports['destroy']=function(_0xf5fc7a,_0x23f153){return db[_0xc936('0x40')][_0xc936('0x47')]({'where':{'id':_0xf5fc7a[_0xc936('0x45')]['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x23f153,null))[_0xc936('0x24')](removeEntity(_0x23f153,null))['catch'](handleError(_0x23f153,null));};exports[_0xc936('0x55')]=function(_0x335b1f,_0x3078ec,_0x14bdb4){var _0x2d85c8={'raw':!![],'where':{}};var _0x322e94={};var _0x188c35={'count':0x0,'rows':[]};return db[_0xc936('0x40')][_0xc936('0x56')]({'where':{'id':_0x335b1f['params']['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x3078ec,null))[_0xc936('0x24')](function(_0x4b9b4c){if(_0x4b9b4c){_0x322e94[_0xc936('0x34')]=_[_0xc936('0x31')](db[_0xc936('0x57')]['rawAttributes']);_0x322e94['query']=_['keys'](_0x335b1f[_0xc936('0x30')]);_0x322e94[_0xc936('0x32')]=_[_0xc936('0x33')](_0x322e94[_0xc936('0x34')],_0x322e94[_0xc936('0x30')]);_0x2d85c8[_0xc936('0x35')]=_['intersection'](_0x322e94[_0xc936('0x34')],qs['fields'](_0x335b1f[_0xc936('0x30')][_0xc936('0x36')]));_0x2d85c8['attributes']=_0x2d85c8[_0xc936('0x35')][_0xc936('0x37')]?_0x2d85c8['attributes']:_0x322e94[_0xc936('0x34')];if(!_0x335b1f[_0xc936('0x30')]['hasOwnProperty']('nolimit')){_0x2d85c8[_0xc936('0x1e')]=qs[_0xc936('0x1e')](_0x335b1f[_0xc936('0x30')]['limit']);_0x2d85c8[_0xc936('0x1d')]=qs['offset'](_0x335b1f[_0xc936('0x30')][_0xc936('0x1d')]);}_0x2d85c8[_0xc936('0x38')]=qs[_0xc936('0x39')](_0x335b1f[_0xc936('0x30')][_0xc936('0x39')]);_0x2d85c8[_0xc936('0x3a')]=qs['filters'](_[_0xc936('0x58')](_0x335b1f['query'],_0x322e94[_0xc936('0x32')]));_0x2d85c8['where'][_0xc936('0x59')]=_0x4b9b4c['id'];if(_0x335b1f['query']['filter']){_0x2d85c8[_0xc936('0x3a')]=_['merge'](_0x2d85c8[_0xc936('0x3a')],{'$or':_[_0xc936('0x2c')](_0x2d85c8[_0xc936('0x35')],function(_0x534ed5){var _0x3ae7ae={};_0x3ae7ae[_0x534ed5]={'$like':'%'+_0x335b1f[_0xc936('0x30')][_0xc936('0x3d')]+'%'};return _0x3ae7ae;})});}_0x2d85c8=_['merge']({},_0x2d85c8,_0x335b1f[_0xc936('0x46')]);return db[_0xc936('0x57')][_0xc936('0x1c')]({'where':_0x2d85c8[_0xc936('0x3a')]})[_0xc936('0x24')](function(_0x4010b6){_0x188c35[_0xc936('0x1c')]=_0x4010b6;if(_0x335b1f[_0xc936('0x30')][_0xc936('0x3e')]){_0x2d85c8[_0xc936('0x3f')]=[{'all':!![]}];}return db[_0xc936('0x57')][_0xc936('0x41')](_0x2d85c8);})[_0xc936('0x24')](function(_0x1492a9){_0x188c35[_0xc936('0x42')]=_0x1492a9;return _0x188c35;});}})[_0xc936('0x24')](respondWithFilteredResult(_0x3078ec,_0x2d85c8))[_0xc936('0x43')](handleError(_0x3078ec,null));};exports[_0xc936('0x5a')]=function(_0x5f2c7a,_0x4f3163,_0x1b52fe){var _0x23f32f={'raw':!![],'where':{}};var _0x223f75={};var _0x3146e2={'count':0x0,'rows':[]};return db[_0xc936('0x40')][_0xc936('0x56')]({'where':{'id':_0x5f2c7a[_0xc936('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f3163,null))['then'](function(_0x114d97){if(_0x114d97){_0x223f75[_0xc936('0x34')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x223f75[_0xc936('0x30')]=_[_0xc936('0x31')](_0x5f2c7a['query']);_0x223f75[_0xc936('0x32')]=_[_0xc936('0x33')](_0x223f75[_0xc936('0x34')],_0x223f75[_0xc936('0x30')]);_0x23f32f[_0xc936('0x35')]=_[_0xc936('0x33')](_0x223f75['model'],qs[_0xc936('0x36')](_0x5f2c7a['query'][_0xc936('0x36')]));_0x23f32f[_0xc936('0x35')]=_0x23f32f[_0xc936('0x35')][_0xc936('0x37')]?_0x23f32f[_0xc936('0x35')]:_0x223f75[_0xc936('0x34')];if(!_0x5f2c7a['query']['hasOwnProperty'](_0xc936('0x5b'))){_0x23f32f[_0xc936('0x1e')]=qs[_0xc936('0x1e')](_0x5f2c7a[_0xc936('0x30')][_0xc936('0x1e')]);_0x23f32f['offset']=qs['offset'](_0x5f2c7a[_0xc936('0x30')][_0xc936('0x1d')]);}_0x23f32f[_0xc936('0x38')]=qs[_0xc936('0x39')](_0x5f2c7a[_0xc936('0x30')]['sort']);_0x23f32f['where']=qs['filters'](_[_0xc936('0x58')](_0x5f2c7a[_0xc936('0x30')],_0x223f75[_0xc936('0x32')]));_0x23f32f[_0xc936('0x3a')]['CampaignId']=_0x114d97['id'];if(_0x5f2c7a[_0xc936('0x30')][_0xc936('0x3d')]){_0x23f32f[_0xc936('0x3a')]=_[_0xc936('0x3b')](_0x23f32f[_0xc936('0x3a')],{'$or':_[_0xc936('0x2c')](_0x23f32f[_0xc936('0x35')],function(_0x460c12){var _0x7e3a7f={};_0x7e3a7f[_0x460c12]={'$like':'%'+_0x5f2c7a['query'][_0xc936('0x3d')]+'%'};return _0x7e3a7f;})});}_0x23f32f=_[_0xc936('0x3b')]({},_0x23f32f,_0x5f2c7a[_0xc936('0x46')]);return db['CmHopperHistory']['count']({'where':_0x23f32f[_0xc936('0x3a')]})['then'](function(_0x5bae87){_0x3146e2[_0xc936('0x1c')]=_0x5bae87;if(_0x5f2c7a[_0xc936('0x30')]['includeAll']){_0x23f32f['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xc936('0x41')](_0x23f32f);})[_0xc936('0x24')](function(_0xae43c3){_0x3146e2['rows']=_0xae43c3;return _0x3146e2;});}})['then'](respondWithFilteredResult(_0x4f3163,_0x23f32f))[_0xc936('0x43')](handleError(_0x4f3163,null));};exports[_0xc936('0x5c')]=function(_0x3a9dcd,_0x572512,_0x231fdc){var _0x5b1ce1={'raw':!![],'where':{}};var _0x39d1eb={};var _0x55b919={'count':0x0,'rows':[]};return db[_0xc936('0x40')]['findOne']({'where':{'id':_0x3a9dcd[_0xc936('0x45')]['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x572512,null))[_0xc936('0x24')](function(_0x21df81){if(_0x21df81){_0x39d1eb[_0xc936('0x34')]=_[_0xc936('0x31')](db['CmHopperFinal']['rawAttributes']);_0x39d1eb[_0xc936('0x30')]=_[_0xc936('0x31')](_0x3a9dcd[_0xc936('0x30')]);_0x39d1eb[_0xc936('0x32')]=_['intersection'](_0x39d1eb['model'],_0x39d1eb[_0xc936('0x30')]);_0x5b1ce1[_0xc936('0x35')]=_[_0xc936('0x33')](_0x39d1eb['model'],qs[_0xc936('0x36')](_0x3a9dcd['query'][_0xc936('0x36')]));_0x5b1ce1[_0xc936('0x35')]=_0x5b1ce1[_0xc936('0x35')][_0xc936('0x37')]?_0x5b1ce1[_0xc936('0x35')]:_0x39d1eb[_0xc936('0x34')];if(!_0x3a9dcd['query']['hasOwnProperty'](_0xc936('0x5b'))){_0x5b1ce1['limit']=qs['limit'](_0x3a9dcd['query'][_0xc936('0x1e')]);_0x5b1ce1[_0xc936('0x1d')]=qs['offset'](_0x3a9dcd['query']['offset']);}_0x5b1ce1[_0xc936('0x38')]=qs[_0xc936('0x39')](_0x3a9dcd['query'][_0xc936('0x39')]);_0x5b1ce1[_0xc936('0x3a')]=qs[_0xc936('0x32')](_['pick'](_0x3a9dcd[_0xc936('0x30')],_0x39d1eb['filters']));_0x5b1ce1[_0xc936('0x3a')][_0xc936('0x59')]=_0x21df81['id'];if(_0x3a9dcd[_0xc936('0x30')][_0xc936('0x3d')]){_0x5b1ce1[_0xc936('0x3a')]=_[_0xc936('0x3b')](_0x5b1ce1[_0xc936('0x3a')],{'$or':_[_0xc936('0x2c')](_0x5b1ce1[_0xc936('0x35')],function(_0x3e0ee4){var _0x11df14={};_0x11df14[_0x3e0ee4]={'$like':'%'+_0x3a9dcd[_0xc936('0x30')][_0xc936('0x3d')]+'%'};return _0x11df14;})});}_0x5b1ce1=_[_0xc936('0x3b')]({},_0x5b1ce1,_0x3a9dcd['options']);return db['CmHopperFinal'][_0xc936('0x1c')]({'where':_0x5b1ce1[_0xc936('0x3a')]})[_0xc936('0x24')](function(_0x816697){_0x55b919['count']=_0x816697;if(_0x3a9dcd['query']['includeAll']){_0x5b1ce1['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xc936('0x41')](_0x5b1ce1);})[_0xc936('0x24')](function(_0x590240){_0x55b919[_0xc936('0x42')]=_0x590240;return _0x55b919;});}})['then'](respondWithFilteredResult(_0x572512,_0x5b1ce1))[_0xc936('0x43')](handleError(_0x572512,null));};exports['getHopperBlacks']=function(_0x3920e7,_0x1a2f7b,_0x3c2984){var _0x3d4663={'raw':!![],'where':{}};var _0xf57a38={};var _0x378298={'count':0x0,'rows':[]};return db[_0xc936('0x40')][_0xc936('0x56')]({'where':{'id':_0x3920e7[_0xc936('0x45')]['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x1a2f7b,null))['then'](function(_0x5ace74){if(_0x5ace74){_0xf57a38[_0xc936('0x34')]=_[_0xc936('0x31')](db[_0xc936('0x5d')][_0xc936('0x2d')]);_0xf57a38[_0xc936('0x30')]=_[_0xc936('0x31')](_0x3920e7[_0xc936('0x30')]);_0xf57a38[_0xc936('0x32')]=_['intersection'](_0xf57a38[_0xc936('0x34')],_0xf57a38[_0xc936('0x30')]);_0x3d4663[_0xc936('0x35')]=_[_0xc936('0x33')](_0xf57a38[_0xc936('0x34')],qs[_0xc936('0x36')](_0x3920e7[_0xc936('0x30')][_0xc936('0x36')]));_0x3d4663[_0xc936('0x35')]=_0x3d4663[_0xc936('0x35')][_0xc936('0x37')]?_0x3d4663[_0xc936('0x35')]:_0xf57a38['model'];if(!_0x3920e7[_0xc936('0x30')][_0xc936('0x5e')](_0xc936('0x5b'))){_0x3d4663[_0xc936('0x1e')]=qs['limit'](_0x3920e7[_0xc936('0x30')][_0xc936('0x1e')]);_0x3d4663[_0xc936('0x1d')]=qs[_0xc936('0x1d')](_0x3920e7[_0xc936('0x30')][_0xc936('0x1d')]);}_0x3d4663[_0xc936('0x38')]=qs[_0xc936('0x39')](_0x3920e7['query'][_0xc936('0x39')]);_0x3d4663[_0xc936('0x3a')]=qs[_0xc936('0x32')](_[_0xc936('0x58')](_0x3920e7[_0xc936('0x30')],_0xf57a38[_0xc936('0x32')]));_0x3d4663['where'][_0xc936('0x59')]=_0x5ace74['id'];if(_0x3920e7[_0xc936('0x30')][_0xc936('0x3d')]){_0x3d4663['where']=_[_0xc936('0x3b')](_0x3d4663[_0xc936('0x3a')],{'$or':_['map'](_0x3d4663[_0xc936('0x35')],function(_0x42527c){var _0x162d61={};_0x162d61[_0x42527c]={'$like':'%'+_0x3920e7[_0xc936('0x30')]['filter']+'%'};return _0x162d61;})});}_0x3d4663=_['merge']({},_0x3d4663,_0x3920e7[_0xc936('0x46')]);return db[_0xc936('0x5d')]['count']({'where':_0x3d4663[_0xc936('0x3a')]})[_0xc936('0x24')](function(_0x41e659){_0x378298[_0xc936('0x1c')]=_0x41e659;if(_0x3920e7[_0xc936('0x30')][_0xc936('0x3e')]){_0x3d4663[_0xc936('0x3f')]=[{'all':!![]}];}return db[_0xc936('0x5d')][_0xc936('0x41')](_0x3d4663);})['then'](function(_0x4a4db6){_0x378298[_0xc936('0x42')]=_0x4a4db6;return _0x378298;});}})[_0xc936('0x24')](respondWithFilteredResult(_0x1a2f7b,_0x3d4663))['catch'](handleError(_0x1a2f7b,null));};exports[_0xc936('0x5f')]=function(_0x29f662,_0x1eeb42,_0x1eb26e){var _0x391d31={};var _0x937e5c={};var _0x25e34f;var _0x3ba1ce;return db[_0xc936('0x40')]['findOne']({'where':{'id':_0x29f662[_0xc936('0x45')]['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x1eeb42,null))[_0xc936('0x24')](function(_0x3ab550){if(_0x3ab550){_0x25e34f=_0x3ab550;_0x937e5c[_0xc936('0x34')]=_[_0xc936('0x31')](db[_0xc936('0x60')][_0xc936('0x2d')]);_0x937e5c['query']=_[_0xc936('0x31')](_0x29f662[_0xc936('0x30')]);_0x937e5c['filters']=_[_0xc936('0x33')](_0x937e5c[_0xc936('0x34')],_0x937e5c[_0xc936('0x30')]);_0x391d31[_0xc936('0x35')]=_[_0xc936('0x33')](_0x937e5c['model'],qs['fields'](_0x29f662[_0xc936('0x30')][_0xc936('0x36')]));_0x391d31['attributes']=_0x391d31[_0xc936('0x35')][_0xc936('0x37')]?_0x391d31[_0xc936('0x35')]:_0x937e5c['model'];_0x391d31[_0xc936('0x38')]=qs[_0xc936('0x39')](_0x29f662[_0xc936('0x30')][_0xc936('0x39')]);_0x391d31[_0xc936('0x3a')]=qs[_0xc936('0x32')](_[_0xc936('0x58')](_0x29f662[_0xc936('0x30')],_0x937e5c[_0xc936('0x32')]));if(_0x29f662[_0xc936('0x30')][_0xc936('0x3d')]){_0x391d31[_0xc936('0x3a')]=_['merge'](_0x391d31[_0xc936('0x3a')],{'$or':_[_0xc936('0x2c')](_0x391d31[_0xc936('0x35')],function(_0x4deb6f){var _0x412c72={};_0x412c72[_0x4deb6f]={'$like':'%'+_0x29f662[_0xc936('0x30')][_0xc936('0x3d')]+'%'};return _0x412c72;})});}_0x391d31=_['merge']({},_0x391d31,_0x29f662['options']);return _0x25e34f[_0xc936('0x5f')](_0x391d31);}})[_0xc936('0x24')](function(_0xe8d194){if(_0xe8d194){_0x3ba1ce=_0xe8d194['length'];if(!_0x29f662[_0xc936('0x30')][_0xc936('0x5e')](_0xc936('0x5b'))){_0x391d31[_0xc936('0x1e')]=qs[_0xc936('0x1e')](_0x29f662['query']['limit']);_0x391d31['offset']=qs[_0xc936('0x1d')](_0x29f662[_0xc936('0x30')]['offset']);}return _0x25e34f[_0xc936('0x5f')](_0x391d31);}})['then'](function(_0x3d322b){if(_0x3d322b){return _0x3d322b?{'count':_0x3ba1ce,'rows':_0x3d322b}:null;}})['then'](respondWithResult(_0x1eeb42,null))[_0xc936('0x43')](handleError(_0x1eeb42,null));};exports['addLists']=function(_0x2c038f,_0x5c2eb1,_0x136720){var _0x59986b,_0x48aaaa;return db[_0xc936('0x40')][_0xc936('0x47')]({'where':{'id':_0x2c038f[_0xc936('0x45')]['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x5c2eb1,null))[_0xc936('0x24')](function(_0x541a88){if(_0x541a88){_0x48aaaa=_0x541a88;return _0x541a88[_0xc936('0x61')](_0x2c038f[_0xc936('0x49')]['ids'],_[_0xc936('0x4f')](_0x2c038f[_0xc936('0x49')],[_0xc936('0x62'),'id'])||{});}return null;})[_0xc936('0x63')](function(_0x55f7c4){var _0x222fda;_0x59986b=_0x55f7c4||[];var _0x5f1938=[];if(_0x55f7c4){for(var _0x1233f6=0x0;_0x1233f6<_0x55f7c4[_0xc936('0x37')];_0x1233f6+=0x1){var _0x2fb058=_0x55f7c4[_0x1233f6]['get']({'plain':!![]});_0x48aaaa['dialCheckDuplicateType']=_0x2c038f['body']['dialCheckDuplicateType']?_0x2c038f[_0xc936('0x49')][_0xc936('0x64')]:_0x48aaaa[_0xc936('0x64')];switch(_0x48aaaa[_0xc936('0x64')]){case _0xc936('0x65'):_0x222fda=squel[_0xc936('0x66')]()['into'](_0xc936('0x67'))['fromQuery'](['phone',_0xc936('0x68'),_0xc936('0x69'),_0xc936('0x6a'),_0xc936('0x59'),_0xc936('0x51'),_0xc936('0x50')],squel[_0xc936('0x6b')]()[_0xc936('0x6c')](_0xc936('0x6d'),_0xc936('0x6d'))['field']('NOW()','scheduledAt')[_0xc936('0x6c')]('id',_0xc936('0x69'))[_0xc936('0x6c')](_0x2fb058['CmListId'][_0xc936('0x6e')](),'ListId')[_0xc936('0x6c')](_0x2c038f[_0xc936('0x45')]['id'][_0xc936('0x6e')](),_0xc936('0x59'))[_0xc936('0x6c')](_0xc936('0x6f'),'createdAt')[_0xc936('0x6c')](_0xc936('0x6f'),_0xc936('0x50'))[_0xc936('0x70')](_0xc936('0x71'))[_0xc936('0x3a')](_0xc936('0x72'))[_0xc936('0x3a')]('ListId\x20=\x20?',_0x2fb058[_0xc936('0x73')][_0xc936('0x6e')]())[_0xc936('0x3a')](_0xc936('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xc936('0x6b')]()[_0xc936('0x6c')](_0xc936('0x75'))[_0xc936('0x70')](_0xc936('0x76'))[_0xc936('0x3a')](_0xc936('0x77'),_0x2c038f[_0xc936('0x45')]['id'][_0xc936('0x6e')]()))[_0xc936('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc936('0x6b')]()[_0xc936('0x6c')](_0xc936('0x78'))[_0xc936('0x70')](_0xc936('0x67'))[_0xc936('0x3a')](_0xc936('0x77'),_0x2c038f[_0xc936('0x45')]['id'][_0xc936('0x6e')]())))[_0xc936('0x6e')]();break;case _0xc936('0x79'):_0x222fda=squel[_0xc936('0x66')]()[_0xc936('0x7a')]('cm_hopper')[_0xc936('0x7b')](['phone','scheduledAt',_0xc936('0x69'),_0xc936('0x6a'),_0xc936('0x59'),_0xc936('0x51'),_0xc936('0x50')],squel[_0xc936('0x6b')]()[_0xc936('0x6c')](_0xc936('0x6d'),_0xc936('0x6d'))[_0xc936('0x6c')](_0xc936('0x6f'),_0xc936('0x68'))[_0xc936('0x6c')]('id',_0xc936('0x69'))[_0xc936('0x6c')](_0x2fb058[_0xc936('0x73')]['toString'](),_0xc936('0x6a'))[_0xc936('0x6c')](_0x2c038f['params']['id'][_0xc936('0x6e')](),_0xc936('0x59'))[_0xc936('0x6c')](_0xc936('0x6f'),_0xc936('0x51'))[_0xc936('0x6c')](_0xc936('0x6f'),'updatedAt')['from'](_0xc936('0x71'))['where']('deletedAt\x20IS\x20NULL')[_0xc936('0x3a')](_0xc936('0x7c'),_0x2fb058[_0xc936('0x73')][_0xc936('0x6e')]())[_0xc936('0x3a')](_0xc936('0x74'))[_0xc936('0x3a')](_0xc936('0x7d'),squel[_0xc936('0x6b')]()[_0xc936('0x6c')](_0xc936('0x78'))['from'](_0xc936('0x67'))['where'](_0xc936('0x77'),_0x2c038f[_0xc936('0x45')]['id']['toString']())))[_0xc936('0x6e')]();break;default:_0x222fda=squel['insert']()[_0xc936('0x7a')](_0xc936('0x67'))[_0xc936('0x7b')](['phone',_0xc936('0x68'),'ContactId',_0xc936('0x6a'),_0xc936('0x59'),'createdAt',_0xc936('0x50')],squel['select']()[_0xc936('0x6c')](_0xc936('0x6d'),_0xc936('0x6d'))['field'](_0xc936('0x6f'),_0xc936('0x68'))[_0xc936('0x6c')]('id','ContactId')[_0xc936('0x6c')](_0x2fb058['CmListId'][_0xc936('0x6e')](),_0xc936('0x6a'))['field'](_0x2c038f[_0xc936('0x45')]['id'][_0xc936('0x6e')](),_0xc936('0x59'))[_0xc936('0x6c')](_0xc936('0x6f'),_0xc936('0x51'))[_0xc936('0x6c')](_0xc936('0x6f'),_0xc936('0x50'))[_0xc936('0x70')](_0xc936('0x71'))[_0xc936('0x3a')](_0xc936('0x72'))[_0xc936('0x3a')](_0xc936('0x7c'),_0x2fb058[_0xc936('0x73')]['toString']())[_0xc936('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xc936('0x6e')]();}_0x5f1938[_0xc936('0x7e')](db[_0xc936('0x7f')][_0xc936('0x30')](_0x222fda));}return BPromise['all'](_0x5f1938);}})['then'](function(){return _0x59986b;})[_0xc936('0x24')](respondWithResult(_0x5c2eb1,null))[_0xc936('0x43')](handleError(_0x5c2eb1,null));};exports[_0xc936('0x80')]=function(_0x296784,_0x592060,_0x1b3a27){return db[_0xc936('0x40')][_0xc936('0x47')]({'where':{'id':_0x296784[_0xc936('0x45')]['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x592060,null))[_0xc936('0x24')](function(_0x35b48a){if(_0x35b48a){return _0x35b48a[_0xc936('0x80')](_0x296784[_0xc936('0x30')]['ids']);}})[_0xc936('0x24')](function(_0x51176d){if(_0x51176d){return db[_0xc936('0x57')]['destroy']({'where':{'ListId':_0x296784[_0xc936('0x30')][_0xc936('0x62')],'CampaignId':_0x296784['params']['id']}})[_0xc936('0x24')](function(){return _0x51176d;});}})[_0xc936('0x24')](respondWithStatusCode(_0x592060,null))[_0xc936('0x43')](handleError(_0x592060,null));};exports[_0xc936('0x81')]=function(_0x170f3a,_0x1fa5fe,_0x386f47){var _0x537f77={'raw':!![],'where':{}};var _0x272bd2={};var _0xeabb4b={'count':0x0,'rows':[]};return db['Campaign'][_0xc936('0x56')]({'where':{'id':_0x170f3a['params']['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x1fa5fe,null))[_0xc936('0x24')](function(_0x4ccd64){if(_0x4ccd64){_0x272bd2[_0xc936('0x34')]=_['keys'](db['CmList']['rawAttributes']);_0x272bd2[_0xc936('0x30')]=_[_0xc936('0x31')](_0x170f3a['query']);_0x272bd2[_0xc936('0x32')]=_[_0xc936('0x33')](_0x272bd2[_0xc936('0x34')],_0x272bd2[_0xc936('0x30')]);_0x537f77['attributes']=_[_0xc936('0x33')](_0x272bd2[_0xc936('0x34')],qs[_0xc936('0x36')](_0x170f3a[_0xc936('0x30')][_0xc936('0x36')]));_0x537f77[_0xc936('0x35')]=_0x537f77[_0xc936('0x35')][_0xc936('0x37')]?_0x537f77['attributes']:_0x272bd2['model'];if(!_0x170f3a[_0xc936('0x30')][_0xc936('0x5e')](_0xc936('0x5b'))){_0x537f77[_0xc936('0x1e')]=qs[_0xc936('0x1e')](_0x170f3a[_0xc936('0x30')][_0xc936('0x1e')]);_0x537f77[_0xc936('0x1d')]=qs[_0xc936('0x1d')](_0x170f3a[_0xc936('0x30')]['offset']);}_0x537f77['order']=qs['sort'](_0x170f3a['query'][_0xc936('0x39')]);_0x537f77[_0xc936('0x3a')]=qs[_0xc936('0x32')](_[_0xc936('0x58')](_0x170f3a['query'],_0x272bd2[_0xc936('0x32')]));_0x537f77[_0xc936('0x3a')][_0xc936('0x59')]=_0x4ccd64['id'];if(_0x170f3a['query']['filter']){_0x537f77[_0xc936('0x3a')]=_['merge'](_0x537f77[_0xc936('0x3a')],{'$or':_[_0xc936('0x2c')](_0x537f77[_0xc936('0x35')],function(_0x15e907){var _0x33c872={};_0x33c872[_0x15e907]={'$like':'%'+_0x170f3a['query'][_0xc936('0x3d')]+'%'};return _0x33c872;})});}_0x537f77=_[_0xc936('0x3b')]({},_0x537f77,_0x170f3a[_0xc936('0x46')]);return db[_0xc936('0x60')][_0xc936('0x1c')]({'where':_0x537f77[_0xc936('0x3a')]})['then'](function(_0x7e1498){_0xeabb4b[_0xc936('0x1c')]=_0x7e1498;if(_0x170f3a['query'][_0xc936('0x3e')]){_0x537f77['include']=[{'all':!![]}];}return db[_0xc936('0x60')][_0xc936('0x41')](_0x537f77);})[_0xc936('0x24')](function(_0x48e161){_0xeabb4b[_0xc936('0x42')]=_0x48e161;return _0xeabb4b;});}})[_0xc936('0x24')](respondWithFilteredResult(_0x1fa5fe,_0x537f77))[_0xc936('0x43')](handleError(_0x1fa5fe,null));};exports['addBlackLists']=function(_0x35833c,_0x463065,_0x454ee2){var _0x6bb508,_0x165b22;return db[_0xc936('0x40')][_0xc936('0x47')]({'where':{'id':_0x35833c[_0xc936('0x45')]['id']}})['then'](handleEntityNotFound(_0x463065,null))[_0xc936('0x24')](function(_0x15a146){if(_0x15a146){_0x165b22=_0x15a146;return _0x15a146[_0xc936('0x82')](_0x35833c[_0xc936('0x49')][_0xc936('0x62')],_[_0xc936('0x4f')](_0x35833c[_0xc936('0x49')],[_0xc936('0x62'),'id'])||{});}return null;})[_0xc936('0x63')](function(_0x2184e8){var _0x1cfc06;_0x6bb508=_0x2184e8||[];var _0x504fd6=[];if(_0x2184e8){for(var _0x484f8a=0x0;_0x484f8a<_0x2184e8['length'];_0x484f8a+=0x1){var _0x799eda=_0x2184e8[_0x484f8a]['get']({'plain':!![]});_0x1cfc06=squel[_0xc936('0x66')]()['into']('cm_hopper_black')['fromQuery']([_0xc936('0x6d'),_0xc936('0x69'),_0xc936('0x6a'),'CampaignId',_0xc936('0x51'),_0xc936('0x50')],squel[_0xc936('0x6b')]()[_0xc936('0x6c')]('phone','phone')[_0xc936('0x6c')]('id',_0xc936('0x69'))[_0xc936('0x6c')](_0x799eda['CmListId'][_0xc936('0x6e')](),_0xc936('0x6a'))[_0xc936('0x6c')](_0x35833c[_0xc936('0x45')]['id'][_0xc936('0x6e')](),'CampaignId')[_0xc936('0x6c')](_0xc936('0x6f'),_0xc936('0x51'))['field'](_0xc936('0x6f'),'updatedAt')['from']('cm_contacts')[_0xc936('0x3a')]('deletedAt\x20IS\x20NULL')[_0xc936('0x3a')](_0xc936('0x7c'),_0x799eda[_0xc936('0x73')][_0xc936('0x6e')]())['where'](_0xc936('0x74')))[_0xc936('0x6e')]();_0x504fd6[_0xc936('0x7e')](db[_0xc936('0x7f')][_0xc936('0x30')](_0x1cfc06));}return BPromise[_0xc936('0x83')](_0x504fd6);}})[_0xc936('0x24')](function(){return _0x6bb508;})[_0xc936('0x24')](respondWithResult(_0x463065,null))[_0xc936('0x43')](handleError(_0x463065,null));};exports[_0xc936('0x84')]=function(_0x5a87e0,_0x452d8b,_0x24871f){return db[_0xc936('0x40')][_0xc936('0x47')]({'where':{'id':_0x5a87e0[_0xc936('0x45')]['id']}})[_0xc936('0x24')](handleEntityNotFound(_0x452d8b,null))[_0xc936('0x24')](function(_0x3bf63e){if(_0x3bf63e){return _0x3bf63e['removeBlackLists'](_0x5a87e0[_0xc936('0x30')][_0xc936('0x62')]);}})[_0xc936('0x24')](function(_0x13fb9c){if(_0x13fb9c){return db[_0xc936('0x5d')][_0xc936('0x25')]({'where':{'ListId':_0x5a87e0[_0xc936('0x30')][_0xc936('0x62')],'CampaignId':_0x5a87e0[_0xc936('0x45')]['id']}})[_0xc936('0x24')](function(){return _0x13fb9c;});}})[_0xc936('0x24')](respondWithStatusCode(_0x452d8b,null))['catch'](handleError(_0x452d8b,null));};
\ No newline at end of file
+var _0xecae=['Campaign','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','clone','omit','createdAt','updatedAt','role','UserProfileSection','userProfileId','findOne','CmHopper','nolimit','pick','CampaignId','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','COALESCE(phone,\x27\x27)','NOW()','ListId\x20=\x20?','CampaignId\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map'];(function(_0x2708c3,_0x2149c4){var _0x803a64=function(_0x23ed71){while(--_0x23ed71){_0x2708c3['push'](_0x2708c3['shift']());}};_0x803a64(++_0x2149c4);}(_0xecae,0x163));var _0xeeca=function(_0x5eb2c9,_0x478b41){_0x5eb2c9=_0x5eb2c9-0x0;var _0x1c001c=_0xecae[_0x5eb2c9];return _0x1c001c;};'use strict';var pdf=require(_0xeeca('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xeeca('0x1'));var zipdir=require(_0xeeca('0x2'));var jsonpatch=require(_0xeeca('0x3'));var rp=require(_0xeeca('0x4'));var moment=require(_0xeeca('0x5'));var BPromise=require(_0xeeca('0x6'));var Mustache=require(_0xeeca('0x7'));var util=require(_0xeeca('0x8'));var path=require(_0xeeca('0x9'));var sox=require(_0xeeca('0xa'));var csv=require(_0xeeca('0xb'));var ejs=require(_0xeeca('0xc'));var fs=require('fs');var _=require(_0xeeca('0xd'));var squel=require('squel');var crypto=require(_0xeeca('0xe'));var jsforce=require(_0xeeca('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xeeca('0xb'));var querystring=require(_0xeeca('0x10'));var Papa=require(_0xeeca('0x11'));var Redis=require(_0xeeca('0x12'));var authService=require(_0xeeca('0x13'));var qs=require(_0xeeca('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeeca('0x15'));var logger=require(_0xeeca('0x16'))(_0xeeca('0x17'));var utils=require(_0xeeca('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x338c76,_0x363e9a){_0x363e9a=_0x363e9a||0xcc;return function(_0x101e24){if(_0x101e24){return _0x338c76['sendStatus'](_0x363e9a);}return _0x338c76[_0xeeca('0x19')](_0x363e9a)['end']();};}function respondWithResult(_0x170134,_0x157853){_0x157853=_0x157853||0xc8;return function(_0x53b3c4){if(_0x53b3c4){return _0x170134[_0xeeca('0x19')](_0x157853)[_0xeeca('0x1a')](_0x53b3c4);}};}function respondWithFilteredResult(_0x3ee5d2,_0x557eba){return function(_0x2fcb98){if(_0x2fcb98){var _0xc5acab=_0x2fcb98[_0xeeca('0x1b')],_0x31ddc0=_0x557eba[_0xeeca('0x1c')],_0x3faed5=_0x557eba[_0xeeca('0x1c')]+_0x557eba[_0xeeca('0x1d')],_0x2fd2ca;if(_0x3faed5>=_0xc5acab){_0x3faed5=_0xc5acab;_0x2fd2ca=0xc8;}else{_0x2fd2ca=0xce;}_0x3ee5d2[_0xeeca('0x19')](_0x2fd2ca);return _0x3ee5d2[_0xeeca('0x1e')]('Content-Range',_0x31ddc0+'-'+_0x3faed5+'/'+_0xc5acab)['json'](_0x2fcb98);}return null;};}function patchUpdates(_0x369da6){return function(_0x5ad2d2){try{jsonpatch[_0xeeca('0x1f')](_0x5ad2d2,_0x369da6,!![]);}catch(_0x14f028){return BPromise[_0xeeca('0x20')](_0x14f028);}return _0x5ad2d2[_0xeeca('0x21')]();};}function saveUpdates(_0x105293,_0x1a538d){return function(_0x3dca63){if(_0x3dca63){return _0x3dca63[_0xeeca('0x22')](_0x105293)[_0xeeca('0x23')](function(_0x587e4d){return _0x587e4d;});}return null;};}function removeEntity(_0x11bc27,_0x2dcf2e){return function(_0x5249cc){if(_0x5249cc){return _0x5249cc[_0xeeca('0x24')]()[_0xeeca('0x23')](function(){var _0x40c192=_0x5249cc[_0xeeca('0x25')]({'plain':!![]});var _0x3e1c68=_0xeeca('0x26');return db[_0xeeca('0x27')]['destroy']({'where':{'type':_0x3e1c68,'resourceId':_0x40c192['id']}})[_0xeeca('0x23')](function(){return _0x5249cc;});})[_0xeeca('0x23')](function(){_0x11bc27[_0xeeca('0x19')](0xcc)[_0xeeca('0x28')]();});}};}function handleEntityNotFound(_0x275c49,_0xaaf6d){return function(_0x21bc50){if(!_0x21bc50){_0x275c49['sendStatus'](0x194);}return _0x21bc50;};}function handleError(_0x41ac2e,_0x35cc3d){_0x35cc3d=_0x35cc3d||0x1f4;return function(_0x2e8748){logger[_0xeeca('0x29')](_0x2e8748[_0xeeca('0x2a')]);if(_0x2e8748[_0xeeca('0x2b')]){delete _0x2e8748[_0xeeca('0x2b')];}_0x41ac2e['status'](_0x35cc3d)[_0xeeca('0x2c')](_0x2e8748);};}exports[_0xeeca('0x2d')]=function(_0x5b5986,_0x4903ff){var _0x285f9c={},_0x3debf6={},_0x43775d={'count':0x0,'rows':[]};var _0x3a44b0=_[_0xeeca('0x2e')](db[_0xeeca('0x2f')]['rawAttributes'],function(_0x2fdbdb){return{'name':_0x2fdbdb[_0xeeca('0x30')],'type':_0x2fdbdb[_0xeeca('0x31')][_0xeeca('0x32')]};});_0x3debf6[_0xeeca('0x33')]=_[_0xeeca('0x2e')](_0x3a44b0,_0xeeca('0x2b'));_0x3debf6[_0xeeca('0x34')]=_[_0xeeca('0x35')](_0x5b5986[_0xeeca('0x34')]);_0x3debf6[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x3debf6[_0xeeca('0x33')],_0x3debf6[_0xeeca('0x34')]);_0x285f9c[_0xeeca('0x38')]=_['intersection'](_0x3debf6[_0xeeca('0x33')],qs[_0xeeca('0x39')](_0x5b5986['query']['fields']));_0x285f9c[_0xeeca('0x38')]=_0x285f9c[_0xeeca('0x38')][_0xeeca('0x3a')]?_0x285f9c[_0xeeca('0x38')]:_0x3debf6[_0xeeca('0x33')];if(!_0x5b5986[_0xeeca('0x34')][_0xeeca('0x3b')]('nolimit')){_0x285f9c['limit']=qs[_0xeeca('0x1d')](_0x5b5986[_0xeeca('0x34')][_0xeeca('0x1d')]);_0x285f9c[_0xeeca('0x1c')]=qs['offset'](_0x5b5986[_0xeeca('0x34')]['offset']);}_0x285f9c[_0xeeca('0x3c')]=qs[_0xeeca('0x3d')](_0x5b5986[_0xeeca('0x34')][_0xeeca('0x3d')]);_0x285f9c[_0xeeca('0x3e')]=qs[_0xeeca('0x36')](_['pick'](_0x5b5986['query'],_0x3debf6[_0xeeca('0x36')]),_0x3a44b0);if(_0x5b5986[_0xeeca('0x34')][_0xeeca('0x3f')]){_0x285f9c['where']=_[_0xeeca('0x40')](_0x285f9c[_0xeeca('0x3e')],{'$or':_['map'](_0x3a44b0,function(_0x453076){if(_0x453076[_0xeeca('0x31')]!==_0xeeca('0x41')){var _0x2f3835={};_0x2f3835[_0x453076[_0xeeca('0x2b')]]={'$like':'%'+_0x5b5986[_0xeeca('0x34')][_0xeeca('0x3f')]+'%'};return _0x2f3835;}})});}_0x285f9c=_[_0xeeca('0x40')]({},_0x285f9c,_0x5b5986[_0xeeca('0x42')]);var _0x9b2ee2={'where':_0x285f9c[_0xeeca('0x3e')]};return db['Campaign'][_0xeeca('0x1b')](_0x9b2ee2)[_0xeeca('0x23')](function(_0x2d3b86){_0x43775d[_0xeeca('0x1b')]=_0x2d3b86;if(_0x5b5986['query'][_0xeeca('0x43')]){_0x285f9c[_0xeeca('0x44')]=[{'all':!![]}];}return db[_0xeeca('0x2f')]['findAll'](_0x285f9c);})[_0xeeca('0x23')](function(_0x2ec3d7){_0x43775d[_0xeeca('0x45')]=_0x2ec3d7;return _0x43775d;})[_0xeeca('0x23')](respondWithFilteredResult(_0x4903ff,_0x285f9c))[_0xeeca('0x46')](handleError(_0x4903ff,null));};exports['show']=function(_0x175a97,_0x692238){var _0x2453ca={'raw':![],'where':{'id':_0x175a97[_0xeeca('0x47')]['id']}},_0x2185d8={};_0x2185d8[_0xeeca('0x33')]=_[_0xeeca('0x35')](db[_0xeeca('0x2f')][_0xeeca('0x48')]);_0x2185d8[_0xeeca('0x34')]=_['keys'](_0x175a97[_0xeeca('0x34')]);_0x2185d8[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x2185d8[_0xeeca('0x33')],_0x2185d8[_0xeeca('0x34')]);_0x2453ca['attributes']=_[_0xeeca('0x37')](_0x2185d8[_0xeeca('0x33')],qs[_0xeeca('0x39')](_0x175a97['query'][_0xeeca('0x39')]));_0x2453ca[_0xeeca('0x38')]=_0x2453ca['attributes'][_0xeeca('0x3a')]?_0x2453ca[_0xeeca('0x38')]:_0x2185d8[_0xeeca('0x33')];if(_0x175a97[_0xeeca('0x34')][_0xeeca('0x43')]){_0x2453ca[_0xeeca('0x44')]=[{'all':!![]}];}_0x2453ca=_[_0xeeca('0x40')]({},_0x2453ca,_0x175a97[_0xeeca('0x42')]);return db['Campaign'][_0xeeca('0x49')](_0x2453ca)[_0xeeca('0x23')](handleEntityNotFound(_0x692238,null))[_0xeeca('0x23')](respondWithResult(_0x692238,null))[_0xeeca('0x46')](handleError(_0x692238,null));};exports[_0xeeca('0x4a')]=function(_0xa7344e,_0x1ab895){return db[_0xeeca('0x2f')]['create'](_0xa7344e[_0xeeca('0x4b')],{})['then'](function(_0x50f66e){var _0x45e3b7=_0xa7344e[_0xeeca('0x4c')]['get']({'plain':!![]});if(!_0x45e3b7)throw new Error(_0xeeca('0x4d'));if(_0x45e3b7['role']===_0xeeca('0x4c')){var _0x46a3b6=_0x50f66e[_0xeeca('0x25')]({'plain':!![]});var _0x4cfeb5=_0xeeca('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x4cfeb5,'userProfileId':_0x45e3b7['userProfileId']},'raw':!![]})['then'](function(_0x2056ca){if(_0x2056ca&&_0x2056ca[_0xeeca('0x4e')]===0x0){return db['UserProfileResource'][_0xeeca('0x4a')]({'name':_0x46a3b6[_0xeeca('0x2b')],'resourceId':_0x46a3b6['id'],'type':_0x2056ca[_0xeeca('0x2b')],'sectionId':_0x2056ca['id']},{})[_0xeeca('0x23')](function(){return _0x50f66e;});}else{return _0x50f66e;}})[_0xeeca('0x46')](function(_0x46d0ca){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46d0ca);throw _0x46d0ca;});}return _0x50f66e;})[_0xeeca('0x23')](respondWithResult(_0x1ab895,0xc9))['catch'](handleError(_0x1ab895,null));};exports[_0xeeca('0x4f')]=function(_0x4e63ca,_0x3047f8){var _0x3f7f99={'where':{'id':_0x4e63ca['params']['id']}},_0x2e0179={};_0x2e0179['model']=_['keys'](db[_0xeeca('0x2f')]['rawAttributes']);_0x3f7f99[_0xeeca('0x38')]=_['intersection'](_0x2e0179[_0xeeca('0x33')],qs['fields'](_0x4e63ca[_0xeeca('0x34')]['fields']));_0x3f7f99[_0xeeca('0x38')]=_0x3f7f99[_0xeeca('0x38')][_0xeeca('0x3a')]?_0x3f7f99['attributes']:_0x2e0179[_0xeeca('0x33')];if(_0x4e63ca['query']['includeAll']){_0x3f7f99[_0xeeca('0x44')]=[{'all':!![]}];}_0x3f7f99=_['merge']({},_0x3f7f99,_0x4e63ca[_0xeeca('0x42')]);return db[_0xeeca('0x2f')][_0xeeca('0x49')](_0x3f7f99)[_0xeeca('0x23')](handleEntityNotFound(_0x3047f8,null))[_0xeeca('0x23')](function(_0x52ea1d){if(_0x52ea1d){var _0x1a6095=_0x52ea1d[_0xeeca('0x25')]({'plain':!![]});_0x1a6095=qs[_0xeeca('0x50')](_0x1a6095,['id',_0xeeca('0x51'),_0xeeca('0x52')]);_0x4e63ca[_0xeeca('0x4b')]=_[_0xeeca('0x50')](_0x4e63ca[_0xeeca('0x4b')],['id',_0xeeca('0x51'),_0xeeca('0x52')]);return db[_0xeeca('0x2f')][_0xeeca('0x4a')](_['merge'](_0x1a6095,_0x4e63ca[_0xeeca('0x4b')]),{'include':_0x4e63ca[_0xeeca('0x34')][_0xeeca('0x43')]?[{'all':!![]}]:undefined})[_0xeeca('0x23')](function(_0x1faf94){var _0x50e302=_0x4e63ca[_0xeeca('0x4c')][_0xeeca('0x25')]({'plain':!![]});if(!_0x50e302)throw new Error(_0xeeca('0x4d'));if(_0x50e302[_0xeeca('0x53')]===_0xeeca('0x4c')){var _0x299147=_0x1faf94[_0xeeca('0x25')]({'plain':!![]});var _0x594b97=_0xeeca('0x26');return db[_0xeeca('0x54')][_0xeeca('0x49')]({'where':{'name':_0x594b97,'userProfileId':_0x50e302[_0xeeca('0x55')]},'raw':!![]})['then'](function(_0x3b4184){if(_0x3b4184&&_0x3b4184[_0xeeca('0x4e')]===0x0){return db[_0xeeca('0x27')][_0xeeca('0x4a')]({'name':_0x299147['name'],'resourceId':_0x299147['id'],'type':_0x3b4184[_0xeeca('0x2b')],'sectionId':_0x3b4184['id']},{})[_0xeeca('0x23')](function(){return _0x1faf94;});}else{return _0x1faf94;}})[_0xeeca('0x46')](function(_0x514328){logger[_0xeeca('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x514328);throw _0x514328;});}return _0x1faf94;});}})['then'](respondWithResult(_0x3047f8,0xc9))['catch'](handleError(_0x3047f8,null));};exports[_0xeeca('0x22')]=function(_0x567b5e,_0x3a1ed5){if(_0x567b5e[_0xeeca('0x4b')]['id']){delete _0x567b5e[_0xeeca('0x4b')]['id'];}return db[_0xeeca('0x2f')]['find']({'where':{'id':_0x567b5e[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x3a1ed5,null))['then'](saveUpdates(_0x567b5e[_0xeeca('0x4b')],null))['then'](respondWithResult(_0x3a1ed5,null))['catch'](handleError(_0x3a1ed5,null));};exports[_0xeeca('0x24')]=function(_0x4f8a59,_0x491748){return db[_0xeeca('0x2f')][_0xeeca('0x49')]({'where':{'id':_0x4f8a59[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x491748,null))[_0xeeca('0x23')](removeEntity(_0x491748,null))[_0xeeca('0x46')](handleError(_0x491748,null));};exports['getHoppers']=function(_0x362377,_0x8e4354,_0x463237){var _0x4bf146={'raw':!![],'where':{}};var _0x1e0ede={};var _0x5988a9={'count':0x0,'rows':[]};return db[_0xeeca('0x2f')][_0xeeca('0x56')]({'where':{'id':_0x362377[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x8e4354,null))['then'](function(_0x54f800){if(_0x54f800){_0x1e0ede[_0xeeca('0x33')]=_['keys'](db[_0xeeca('0x57')][_0xeeca('0x48')]);_0x1e0ede[_0xeeca('0x34')]=_[_0xeeca('0x35')](_0x362377[_0xeeca('0x34')]);_0x1e0ede[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x1e0ede['model'],_0x1e0ede[_0xeeca('0x34')]);_0x4bf146[_0xeeca('0x38')]=_[_0xeeca('0x37')](_0x1e0ede[_0xeeca('0x33')],qs[_0xeeca('0x39')](_0x362377[_0xeeca('0x34')]['fields']));_0x4bf146['attributes']=_0x4bf146[_0xeeca('0x38')][_0xeeca('0x3a')]?_0x4bf146[_0xeeca('0x38')]:_0x1e0ede['model'];if(!_0x362377[_0xeeca('0x34')]['hasOwnProperty'](_0xeeca('0x58'))){_0x4bf146[_0xeeca('0x1d')]=qs['limit'](_0x362377[_0xeeca('0x34')]['limit']);_0x4bf146[_0xeeca('0x1c')]=qs[_0xeeca('0x1c')](_0x362377['query'][_0xeeca('0x1c')]);}_0x4bf146[_0xeeca('0x3c')]=qs[_0xeeca('0x3d')](_0x362377['query'][_0xeeca('0x3d')]);_0x4bf146[_0xeeca('0x3e')]=qs[_0xeeca('0x36')](_[_0xeeca('0x59')](_0x362377['query'],_0x1e0ede[_0xeeca('0x36')]));_0x4bf146[_0xeeca('0x3e')][_0xeeca('0x5a')]=_0x54f800['id'];if(_0x362377[_0xeeca('0x34')][_0xeeca('0x3f')]){_0x4bf146[_0xeeca('0x3e')]=_[_0xeeca('0x40')](_0x4bf146['where'],{'$or':_[_0xeeca('0x2e')](_0x4bf146[_0xeeca('0x38')],function(_0x25781c){var _0x18c108={};_0x18c108[_0x25781c]={'$like':'%'+_0x362377['query'][_0xeeca('0x3f')]+'%'};return _0x18c108;})});}_0x4bf146=_[_0xeeca('0x40')]({},_0x4bf146,_0x362377[_0xeeca('0x42')]);return db[_0xeeca('0x57')][_0xeeca('0x1b')]({'where':_0x4bf146[_0xeeca('0x3e')]})[_0xeeca('0x23')](function(_0x18c0d1){_0x5988a9[_0xeeca('0x1b')]=_0x18c0d1;if(_0x362377['query']['includeAll']){_0x4bf146[_0xeeca('0x44')]=[{'all':!![]}];}return db[_0xeeca('0x57')][_0xeeca('0x5b')](_0x4bf146);})[_0xeeca('0x23')](function(_0x2a4349){_0x5988a9['rows']=_0x2a4349;return _0x5988a9;});}})[_0xeeca('0x23')](respondWithFilteredResult(_0x8e4354,_0x4bf146))['catch'](handleError(_0x8e4354,null));};exports[_0xeeca('0x5c')]=function(_0x1840fa,_0x27c1a0,_0x32330b){var _0x569a43={'raw':!![],'where':{}};var _0x1e24b1={};var _0x2aedc9={'count':0x0,'rows':[]};return db['Campaign'][_0xeeca('0x56')]({'where':{'id':_0x1840fa[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x27c1a0,null))['then'](function(_0x14b885){if(_0x14b885){_0x1e24b1[_0xeeca('0x33')]=_[_0xeeca('0x35')](db[_0xeeca('0x5d')][_0xeeca('0x48')]);_0x1e24b1[_0xeeca('0x34')]=_[_0xeeca('0x35')](_0x1840fa[_0xeeca('0x34')]);_0x1e24b1['filters']=_[_0xeeca('0x37')](_0x1e24b1[_0xeeca('0x33')],_0x1e24b1[_0xeeca('0x34')]);_0x569a43[_0xeeca('0x38')]=_[_0xeeca('0x37')](_0x1e24b1[_0xeeca('0x33')],qs['fields'](_0x1840fa[_0xeeca('0x34')][_0xeeca('0x39')]));_0x569a43[_0xeeca('0x38')]=_0x569a43['attributes'][_0xeeca('0x3a')]?_0x569a43['attributes']:_0x1e24b1[_0xeeca('0x33')];if(!_0x1840fa[_0xeeca('0x34')][_0xeeca('0x3b')](_0xeeca('0x58'))){_0x569a43[_0xeeca('0x1d')]=qs[_0xeeca('0x1d')](_0x1840fa['query'][_0xeeca('0x1d')]);_0x569a43[_0xeeca('0x1c')]=qs[_0xeeca('0x1c')](_0x1840fa[_0xeeca('0x34')]['offset']);}_0x569a43['order']=qs['sort'](_0x1840fa[_0xeeca('0x34')]['sort']);_0x569a43['where']=qs[_0xeeca('0x36')](_['pick'](_0x1840fa[_0xeeca('0x34')],_0x1e24b1['filters']));_0x569a43[_0xeeca('0x3e')][_0xeeca('0x5a')]=_0x14b885['id'];if(_0x1840fa[_0xeeca('0x34')][_0xeeca('0x3f')]){_0x569a43[_0xeeca('0x3e')]=_[_0xeeca('0x40')](_0x569a43[_0xeeca('0x3e')],{'$or':_[_0xeeca('0x2e')](_0x569a43[_0xeeca('0x38')],function(_0x3a62d1){var _0x1b7028={};_0x1b7028[_0x3a62d1]={'$like':'%'+_0x1840fa['query'][_0xeeca('0x3f')]+'%'};return _0x1b7028;})});}_0x569a43=_[_0xeeca('0x40')]({},_0x569a43,_0x1840fa[_0xeeca('0x42')]);return db[_0xeeca('0x5d')][_0xeeca('0x1b')]({'where':_0x569a43[_0xeeca('0x3e')]})[_0xeeca('0x23')](function(_0x399376){_0x2aedc9[_0xeeca('0x1b')]=_0x399376;if(_0x1840fa[_0xeeca('0x34')][_0xeeca('0x43')]){_0x569a43[_0xeeca('0x44')]=[{'all':!![]}];}return db[_0xeeca('0x5d')]['findAll'](_0x569a43);})[_0xeeca('0x23')](function(_0xf026b1){_0x2aedc9[_0xeeca('0x45')]=_0xf026b1;return _0x2aedc9;});}})[_0xeeca('0x23')](respondWithFilteredResult(_0x27c1a0,_0x569a43))[_0xeeca('0x46')](handleError(_0x27c1a0,null));};exports['getHopperFinals']=function(_0x2e7c0c,_0x50d9d5,_0x5e0cdb){var _0x5af6ec={'raw':!![],'where':{}};var _0x2476eb={};var _0x385efa={'count':0x0,'rows':[]};return db[_0xeeca('0x2f')][_0xeeca('0x56')]({'where':{'id':_0x2e7c0c[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x50d9d5,null))['then'](function(_0x2303fe){if(_0x2303fe){_0x2476eb[_0xeeca('0x33')]=_[_0xeeca('0x35')](db[_0xeeca('0x5e')][_0xeeca('0x48')]);_0x2476eb[_0xeeca('0x34')]=_[_0xeeca('0x35')](_0x2e7c0c['query']);_0x2476eb[_0xeeca('0x36')]=_['intersection'](_0x2476eb[_0xeeca('0x33')],_0x2476eb[_0xeeca('0x34')]);_0x5af6ec['attributes']=_[_0xeeca('0x37')](_0x2476eb[_0xeeca('0x33')],qs[_0xeeca('0x39')](_0x2e7c0c['query'][_0xeeca('0x39')]));_0x5af6ec[_0xeeca('0x38')]=_0x5af6ec[_0xeeca('0x38')][_0xeeca('0x3a')]?_0x5af6ec[_0xeeca('0x38')]:_0x2476eb[_0xeeca('0x33')];if(!_0x2e7c0c[_0xeeca('0x34')]['hasOwnProperty'](_0xeeca('0x58'))){_0x5af6ec[_0xeeca('0x1d')]=qs[_0xeeca('0x1d')](_0x2e7c0c[_0xeeca('0x34')][_0xeeca('0x1d')]);_0x5af6ec[_0xeeca('0x1c')]=qs[_0xeeca('0x1c')](_0x2e7c0c['query'][_0xeeca('0x1c')]);}_0x5af6ec['order']=qs['sort'](_0x2e7c0c['query'][_0xeeca('0x3d')]);_0x5af6ec[_0xeeca('0x3e')]=qs[_0xeeca('0x36')](_[_0xeeca('0x59')](_0x2e7c0c[_0xeeca('0x34')],_0x2476eb[_0xeeca('0x36')]));_0x5af6ec[_0xeeca('0x3e')][_0xeeca('0x5a')]=_0x2303fe['id'];if(_0x2e7c0c['query'][_0xeeca('0x3f')]){_0x5af6ec[_0xeeca('0x3e')]=_[_0xeeca('0x40')](_0x5af6ec['where'],{'$or':_[_0xeeca('0x2e')](_0x5af6ec[_0xeeca('0x38')],function(_0xdf6e31){var _0x5585e1={};_0x5585e1[_0xdf6e31]={'$like':'%'+_0x2e7c0c[_0xeeca('0x34')][_0xeeca('0x3f')]+'%'};return _0x5585e1;})});}_0x5af6ec=_[_0xeeca('0x40')]({},_0x5af6ec,_0x2e7c0c[_0xeeca('0x42')]);return db['CmHopperFinal'][_0xeeca('0x1b')]({'where':_0x5af6ec['where']})[_0xeeca('0x23')](function(_0x3d0a19){_0x385efa['count']=_0x3d0a19;if(_0x2e7c0c[_0xeeca('0x34')]['includeAll']){_0x5af6ec[_0xeeca('0x44')]=[{'all':!![]}];}return db[_0xeeca('0x5e')][_0xeeca('0x5b')](_0x5af6ec);})['then'](function(_0x3e9231){_0x385efa[_0xeeca('0x45')]=_0x3e9231;return _0x385efa;});}})[_0xeeca('0x23')](respondWithFilteredResult(_0x50d9d5,_0x5af6ec))['catch'](handleError(_0x50d9d5,null));};exports[_0xeeca('0x5f')]=function(_0x2263c8,_0x93dec4,_0x49f6e8){var _0x48a0ea={'raw':!![],'where':{}};var _0x278264={};var _0x31bfb6={'count':0x0,'rows':[]};return db[_0xeeca('0x2f')]['findOne']({'where':{'id':_0x2263c8[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x93dec4,null))['then'](function(_0x375f4d){if(_0x375f4d){_0x278264[_0xeeca('0x33')]=_[_0xeeca('0x35')](db['CmHopperBlack'][_0xeeca('0x48')]);_0x278264[_0xeeca('0x34')]=_[_0xeeca('0x35')](_0x2263c8[_0xeeca('0x34')]);_0x278264[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x278264[_0xeeca('0x33')],_0x278264[_0xeeca('0x34')]);_0x48a0ea[_0xeeca('0x38')]=_[_0xeeca('0x37')](_0x278264[_0xeeca('0x33')],qs['fields'](_0x2263c8[_0xeeca('0x34')][_0xeeca('0x39')]));_0x48a0ea[_0xeeca('0x38')]=_0x48a0ea[_0xeeca('0x38')]['length']?_0x48a0ea[_0xeeca('0x38')]:_0x278264[_0xeeca('0x33')];if(!_0x2263c8['query'][_0xeeca('0x3b')](_0xeeca('0x58'))){_0x48a0ea[_0xeeca('0x1d')]=qs['limit'](_0x2263c8[_0xeeca('0x34')][_0xeeca('0x1d')]);_0x48a0ea[_0xeeca('0x1c')]=qs[_0xeeca('0x1c')](_0x2263c8[_0xeeca('0x34')][_0xeeca('0x1c')]);}_0x48a0ea[_0xeeca('0x3c')]=qs[_0xeeca('0x3d')](_0x2263c8[_0xeeca('0x34')][_0xeeca('0x3d')]);_0x48a0ea[_0xeeca('0x3e')]=qs[_0xeeca('0x36')](_[_0xeeca('0x59')](_0x2263c8[_0xeeca('0x34')],_0x278264[_0xeeca('0x36')]));_0x48a0ea[_0xeeca('0x3e')][_0xeeca('0x5a')]=_0x375f4d['id'];if(_0x2263c8[_0xeeca('0x34')][_0xeeca('0x3f')]){_0x48a0ea['where']=_[_0xeeca('0x40')](_0x48a0ea[_0xeeca('0x3e')],{'$or':_[_0xeeca('0x2e')](_0x48a0ea[_0xeeca('0x38')],function(_0x1a8a8f){var _0x49448e={};_0x49448e[_0x1a8a8f]={'$like':'%'+_0x2263c8[_0xeeca('0x34')]['filter']+'%'};return _0x49448e;})});}_0x48a0ea=_[_0xeeca('0x40')]({},_0x48a0ea,_0x2263c8['options']);return db[_0xeeca('0x60')][_0xeeca('0x1b')]({'where':_0x48a0ea[_0xeeca('0x3e')]})[_0xeeca('0x23')](function(_0x906185){_0x31bfb6[_0xeeca('0x1b')]=_0x906185;if(_0x2263c8[_0xeeca('0x34')][_0xeeca('0x43')]){_0x48a0ea[_0xeeca('0x44')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x48a0ea);})[_0xeeca('0x23')](function(_0x117a3f){_0x31bfb6['rows']=_0x117a3f;return _0x31bfb6;});}})['then'](respondWithFilteredResult(_0x93dec4,_0x48a0ea))[_0xeeca('0x46')](handleError(_0x93dec4,null));};exports[_0xeeca('0x61')]=function(_0x20f40c,_0x4eb0e5,_0x56a9ff){var _0x1a1af9={};var _0x3b0808={};var _0x35ad08;var _0x3aac15;return db[_0xeeca('0x2f')]['findOne']({'where':{'id':_0x20f40c[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x4eb0e5,null))['then'](function(_0x471815){if(_0x471815){_0x35ad08=_0x471815;_0x3b0808['model']=_[_0xeeca('0x35')](db[_0xeeca('0x62')][_0xeeca('0x48')]);_0x3b0808['query']=_['keys'](_0x20f40c[_0xeeca('0x34')]);_0x3b0808[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x3b0808[_0xeeca('0x33')],_0x3b0808[_0xeeca('0x34')]);_0x1a1af9[_0xeeca('0x38')]=_['intersection'](_0x3b0808[_0xeeca('0x33')],qs[_0xeeca('0x39')](_0x20f40c[_0xeeca('0x34')][_0xeeca('0x39')]));_0x1a1af9['attributes']=_0x1a1af9['attributes'][_0xeeca('0x3a')]?_0x1a1af9[_0xeeca('0x38')]:_0x3b0808[_0xeeca('0x33')];_0x1a1af9[_0xeeca('0x3c')]=qs[_0xeeca('0x3d')](_0x20f40c[_0xeeca('0x34')][_0xeeca('0x3d')]);_0x1a1af9[_0xeeca('0x3e')]=qs[_0xeeca('0x36')](_[_0xeeca('0x59')](_0x20f40c[_0xeeca('0x34')],_0x3b0808[_0xeeca('0x36')]));if(_0x20f40c[_0xeeca('0x34')][_0xeeca('0x3f')]){_0x1a1af9['where']=_[_0xeeca('0x40')](_0x1a1af9[_0xeeca('0x3e')],{'$or':_[_0xeeca('0x2e')](_0x1a1af9[_0xeeca('0x38')],function(_0x119f89){var _0x1437f9={};_0x1437f9[_0x119f89]={'$like':'%'+_0x20f40c[_0xeeca('0x34')][_0xeeca('0x3f')]+'%'};return _0x1437f9;})});}_0x1a1af9=_['merge']({},_0x1a1af9,_0x20f40c['options']);return _0x35ad08[_0xeeca('0x61')](_0x1a1af9);}})[_0xeeca('0x23')](function(_0x58c9c2){if(_0x58c9c2){_0x3aac15=_0x58c9c2['length'];if(!_0x20f40c['query'][_0xeeca('0x3b')](_0xeeca('0x58'))){_0x1a1af9[_0xeeca('0x1d')]=qs[_0xeeca('0x1d')](_0x20f40c['query'][_0xeeca('0x1d')]);_0x1a1af9[_0xeeca('0x1c')]=qs[_0xeeca('0x1c')](_0x20f40c[_0xeeca('0x34')][_0xeeca('0x1c')]);}return _0x35ad08[_0xeeca('0x61')](_0x1a1af9);}})['then'](function(_0x2c3925){if(_0x2c3925){return _0x2c3925?{'count':_0x3aac15,'rows':_0x2c3925}:null;}})[_0xeeca('0x23')](respondWithResult(_0x4eb0e5,null))[_0xeeca('0x46')](handleError(_0x4eb0e5,null));};exports['addLists']=function(_0x56a0a1,_0x12e174,_0x4e9965){var _0x4f6bf2,_0x38ebae;return db['Campaign']['find']({'where':{'id':_0x56a0a1[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x12e174,null))['then'](function(_0x2256d8){if(_0x2256d8){_0x38ebae=_0x2256d8;return _0x2256d8[_0xeeca('0x63')](_0x56a0a1[_0xeeca('0x4b')]['ids'],_[_0xeeca('0x50')](_0x56a0a1[_0xeeca('0x4b')],[_0xeeca('0x64'),'id'])||{});}return null;})[_0xeeca('0x65')](function(_0x563361){var _0x1c5c83;_0x4f6bf2=_0x563361||[];var _0x60d468=[];if(_0x563361){for(var _0x523723=0x0;_0x523723<_0x563361[_0xeeca('0x3a')];_0x523723+=0x1){var _0x38d6a4=_0x563361[_0x523723][_0xeeca('0x25')]({'plain':!![]});_0x38ebae[_0xeeca('0x66')]=_0x56a0a1['body'][_0xeeca('0x66')]?_0x56a0a1['body'][_0xeeca('0x66')]:_0x38ebae[_0xeeca('0x66')];switch(_0x38ebae[_0xeeca('0x66')]){case _0xeeca('0x67'):_0x1c5c83=squel[_0xeeca('0x68')]()[_0xeeca('0x69')](_0xeeca('0x6a'))[_0xeeca('0x6b')]([_0xeeca('0x6c'),_0xeeca('0x6d'),_0xeeca('0x6e'),_0xeeca('0x6f'),'CampaignId',_0xeeca('0x51'),_0xeeca('0x52')],squel['select']()['field']('phone','phone')[_0xeeca('0x70')]('NOW()','scheduledAt')['field']('id',_0xeeca('0x6e'))['field'](_0x38d6a4[_0xeeca('0x71')][_0xeeca('0x72')](),_0xeeca('0x6f'))[_0xeeca('0x70')](_0x56a0a1[_0xeeca('0x47')]['id'][_0xeeca('0x72')](),'CampaignId')[_0xeeca('0x70')]('NOW()',_0xeeca('0x51'))[_0xeeca('0x70')]('NOW()',_0xeeca('0x52'))['from'](_0xeeca('0x73'))[_0xeeca('0x3e')](_0xeeca('0x74'))[_0xeeca('0x3e')]('ListId\x20=\x20?',_0x38d6a4[_0xeeca('0x71')][_0xeeca('0x72')]())[_0xeeca('0x3e')](_0xeeca('0x75'))['where'](_0xeeca('0x76'),squel[_0xeeca('0x77')]()[_0xeeca('0x70')](_0xeeca('0x78'))[_0xeeca('0x79')]('cm_hopper_final')[_0xeeca('0x3e')]('CampaignId\x20=\x20?',_0x56a0a1['params']['id'][_0xeeca('0x72')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xeeca('0x77')]()[_0xeeca('0x70')](_0xeeca('0x7a'))[_0xeeca('0x79')](_0xeeca('0x6a'))[_0xeeca('0x3e')]('CampaignId\x20=\x20?',_0x56a0a1[_0xeeca('0x47')]['id'][_0xeeca('0x72')]())))['toString']();break;case'onlyIfOpen':_0x1c5c83=squel[_0xeeca('0x68')]()[_0xeeca('0x69')](_0xeeca('0x6a'))[_0xeeca('0x6b')](['phone',_0xeeca('0x6d'),_0xeeca('0x6e'),_0xeeca('0x6f'),_0xeeca('0x5a'),_0xeeca('0x51'),_0xeeca('0x52')],squel[_0xeeca('0x77')]()[_0xeeca('0x70')](_0xeeca('0x6c'),_0xeeca('0x6c'))[_0xeeca('0x70')](_0xeeca('0x7b'),_0xeeca('0x6d'))[_0xeeca('0x70')]('id','ContactId')[_0xeeca('0x70')](_0x38d6a4[_0xeeca('0x71')][_0xeeca('0x72')](),_0xeeca('0x6f'))[_0xeeca('0x70')](_0x56a0a1['params']['id'][_0xeeca('0x72')](),_0xeeca('0x5a'))[_0xeeca('0x70')]('NOW()',_0xeeca('0x51'))['field'](_0xeeca('0x7b'),'updatedAt')[_0xeeca('0x79')](_0xeeca('0x73'))[_0xeeca('0x3e')]('deletedAt\x20IS\x20NULL')[_0xeeca('0x3e')](_0xeeca('0x7c'),_0x38d6a4[_0xeeca('0x71')][_0xeeca('0x72')]())[_0xeeca('0x3e')](_0xeeca('0x75'))[_0xeeca('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xeeca('0x77')]()[_0xeeca('0x70')](_0xeeca('0x7a'))[_0xeeca('0x79')](_0xeeca('0x6a'))[_0xeeca('0x3e')](_0xeeca('0x7d'),_0x56a0a1[_0xeeca('0x47')]['id']['toString']())))[_0xeeca('0x72')]();break;default:_0x1c5c83=squel[_0xeeca('0x68')]()[_0xeeca('0x69')](_0xeeca('0x6a'))['fromQuery'](['phone',_0xeeca('0x6d'),_0xeeca('0x6e'),'ListId',_0xeeca('0x5a'),'createdAt',_0xeeca('0x52')],squel[_0xeeca('0x77')]()[_0xeeca('0x70')](_0xeeca('0x6c'),_0xeeca('0x6c'))[_0xeeca('0x70')](_0xeeca('0x7b'),_0xeeca('0x6d'))[_0xeeca('0x70')]('id',_0xeeca('0x6e'))[_0xeeca('0x70')](_0x38d6a4['CmListId']['toString'](),_0xeeca('0x6f'))['field'](_0x56a0a1[_0xeeca('0x47')]['id'][_0xeeca('0x72')](),_0xeeca('0x5a'))[_0xeeca('0x70')](_0xeeca('0x7b'),_0xeeca('0x51'))[_0xeeca('0x70')](_0xeeca('0x7b'),_0xeeca('0x52'))[_0xeeca('0x79')](_0xeeca('0x73'))[_0xeeca('0x3e')](_0xeeca('0x74'))[_0xeeca('0x3e')]('ListId\x20=\x20?',_0x38d6a4['CmListId'][_0xeeca('0x72')]())[_0xeeca('0x3e')](_0xeeca('0x75')))['toString']();}_0x60d468['push'](db[_0xeeca('0x7e')][_0xeeca('0x34')](_0x1c5c83));}return BPromise[_0xeeca('0x7f')](_0x60d468);}})[_0xeeca('0x23')](function(){return _0x4f6bf2;})[_0xeeca('0x23')](respondWithResult(_0x12e174,null))['catch'](handleError(_0x12e174,null));};exports['removeLists']=function(_0x336df9,_0x3b8597,_0x35346f){return db[_0xeeca('0x2f')][_0xeeca('0x49')]({'where':{'id':_0x336df9['params']['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x3b8597,null))[_0xeeca('0x23')](function(_0x1b7ff0){if(_0x1b7ff0){return _0x1b7ff0[_0xeeca('0x80')](_0x336df9[_0xeeca('0x34')][_0xeeca('0x64')]);}})[_0xeeca('0x23')](function(_0x4e4f28){if(_0x4e4f28){return db['CmHopper'][_0xeeca('0x24')]({'where':{'ListId':_0x336df9['query'][_0xeeca('0x64')],'CampaignId':_0x336df9[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](function(){return _0x4e4f28;});}})[_0xeeca('0x23')](respondWithStatusCode(_0x3b8597,null))[_0xeeca('0x46')](handleError(_0x3b8597,null));};exports[_0xeeca('0x81')]=function(_0x424673,_0x3c3461,_0x3e8695){var _0x20e2bb={'raw':!![],'where':{}};var _0x4cb607={};var _0x416ec4={'count':0x0,'rows':[]};return db[_0xeeca('0x2f')][_0xeeca('0x56')]({'where':{'id':_0x424673[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x3c3461,null))['then'](function(_0x8f1f02){if(_0x8f1f02){_0x4cb607['model']=_['keys'](db[_0xeeca('0x62')][_0xeeca('0x48')]);_0x4cb607[_0xeeca('0x34')]=_[_0xeeca('0x35')](_0x424673[_0xeeca('0x34')]);_0x4cb607[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x4cb607[_0xeeca('0x33')],_0x4cb607[_0xeeca('0x34')]);_0x20e2bb['attributes']=_[_0xeeca('0x37')](_0x4cb607[_0xeeca('0x33')],qs[_0xeeca('0x39')](_0x424673[_0xeeca('0x34')]['fields']));_0x20e2bb[_0xeeca('0x38')]=_0x20e2bb[_0xeeca('0x38')][_0xeeca('0x3a')]?_0x20e2bb[_0xeeca('0x38')]:_0x4cb607['model'];if(!_0x424673['query'][_0xeeca('0x3b')](_0xeeca('0x58'))){_0x20e2bb[_0xeeca('0x1d')]=qs[_0xeeca('0x1d')](_0x424673['query'][_0xeeca('0x1d')]);_0x20e2bb['offset']=qs[_0xeeca('0x1c')](_0x424673['query'][_0xeeca('0x1c')]);}_0x20e2bb[_0xeeca('0x3c')]=qs[_0xeeca('0x3d')](_0x424673['query'][_0xeeca('0x3d')]);_0x20e2bb[_0xeeca('0x3e')]=qs[_0xeeca('0x36')](_[_0xeeca('0x59')](_0x424673[_0xeeca('0x34')],_0x4cb607[_0xeeca('0x36')]));_0x20e2bb['where'][_0xeeca('0x5a')]=_0x8f1f02['id'];if(_0x424673[_0xeeca('0x34')][_0xeeca('0x3f')]){_0x20e2bb[_0xeeca('0x3e')]=_[_0xeeca('0x40')](_0x20e2bb[_0xeeca('0x3e')],{'$or':_['map'](_0x20e2bb[_0xeeca('0x38')],function(_0x45b955){var _0x345582={};_0x345582[_0x45b955]={'$like':'%'+_0x424673[_0xeeca('0x34')][_0xeeca('0x3f')]+'%'};return _0x345582;})});}_0x20e2bb=_[_0xeeca('0x40')]({},_0x20e2bb,_0x424673['options']);return db[_0xeeca('0x62')][_0xeeca('0x1b')]({'where':_0x20e2bb[_0xeeca('0x3e')]})[_0xeeca('0x23')](function(_0x8ce93){_0x416ec4[_0xeeca('0x1b')]=_0x8ce93;if(_0x424673['query'][_0xeeca('0x43')]){_0x20e2bb[_0xeeca('0x44')]=[{'all':!![]}];}return db[_0xeeca('0x62')][_0xeeca('0x5b')](_0x20e2bb);})[_0xeeca('0x23')](function(_0x5ed7db){_0x416ec4[_0xeeca('0x45')]=_0x5ed7db;return _0x416ec4;});}})[_0xeeca('0x23')](respondWithFilteredResult(_0x3c3461,_0x20e2bb))[_0xeeca('0x46')](handleError(_0x3c3461,null));};exports[_0xeeca('0x82')]=function(_0x55a6d3,_0x1c7fe3,_0x3bdcf6){var _0x2f2b34,_0x38a026;return db[_0xeeca('0x2f')][_0xeeca('0x49')]({'where':{'id':_0x55a6d3[_0xeeca('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c7fe3,null))[_0xeeca('0x23')](function(_0x13932f){if(_0x13932f){_0x38a026=_0x13932f;return _0x13932f[_0xeeca('0x82')](_0x55a6d3[_0xeeca('0x4b')][_0xeeca('0x64')],_[_0xeeca('0x50')](_0x55a6d3[_0xeeca('0x4b')],['ids','id'])||{});}return null;})[_0xeeca('0x65')](function(_0x429b3c){var _0x53e04d;_0x2f2b34=_0x429b3c||[];var _0x3da560=[];if(_0x429b3c){for(var _0x5690b4=0x0;_0x5690b4<_0x429b3c[_0xeeca('0x3a')];_0x5690b4+=0x1){var _0x7c1556=_0x429b3c[_0x5690b4]['get']({'plain':!![]});_0x53e04d=squel[_0xeeca('0x68')]()[_0xeeca('0x69')](_0xeeca('0x83'))['fromQuery']([_0xeeca('0x6c'),_0xeeca('0x6e'),_0xeeca('0x6f'),_0xeeca('0x5a'),'createdAt','updatedAt'],squel[_0xeeca('0x77')]()['field']('phone',_0xeeca('0x6c'))[_0xeeca('0x70')]('id','ContactId')[_0xeeca('0x70')](_0x7c1556[_0xeeca('0x71')][_0xeeca('0x72')](),'ListId')[_0xeeca('0x70')](_0x55a6d3['params']['id']['toString'](),_0xeeca('0x5a'))[_0xeeca('0x70')]('NOW()',_0xeeca('0x51'))[_0xeeca('0x70')]('NOW()','updatedAt')[_0xeeca('0x79')](_0xeeca('0x73'))[_0xeeca('0x3e')](_0xeeca('0x74'))[_0xeeca('0x3e')](_0xeeca('0x7c'),_0x7c1556[_0xeeca('0x71')][_0xeeca('0x72')]())['where'](_0xeeca('0x75')))['toString']();_0x3da560[_0xeeca('0x84')](db[_0xeeca('0x7e')][_0xeeca('0x34')](_0x53e04d));}return BPromise[_0xeeca('0x7f')](_0x3da560);}})['then'](function(){return _0x2f2b34;})[_0xeeca('0x23')](respondWithResult(_0x1c7fe3,null))['catch'](handleError(_0x1c7fe3,null));};exports[_0xeeca('0x85')]=function(_0x306574,_0x798191,_0x5c68c2){return db[_0xeeca('0x2f')][_0xeeca('0x49')]({'where':{'id':_0x306574[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](handleEntityNotFound(_0x798191,null))[_0xeeca('0x23')](function(_0x41712f){if(_0x41712f){return _0x41712f[_0xeeca('0x85')](_0x306574[_0xeeca('0x34')][_0xeeca('0x64')]);}})[_0xeeca('0x23')](function(_0x2a2073){if(_0x2a2073){return db['CmHopperBlack'][_0xeeca('0x24')]({'where':{'ListId':_0x306574['query']['ids'],'CampaignId':_0x306574[_0xeeca('0x47')]['id']}})[_0xeeca('0x23')](function(){return _0x2a2073;});}})[_0xeeca('0x23')](respondWithStatusCode(_0x798191,null))[_0xeeca('0x46')](handleError(_0x798191,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 4bf0e94..8a3cfcf 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/environment','./campaign.attributes','exports','define','Campaign','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x167309,_0x41d03f){var _0x56b59f=function(_0x1aa868){while(--_0x1aa868){_0x167309['push'](_0x167309['shift']());}};_0x56b59f(++_0x41d03f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./campaign.attributes','exports','define','Campaign','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1ca0c6,_0x4f5396){var _0x2a150a=function(_0x4a6016){while(--_0x4a6016){_0x1ca0c6['push'](_0x1ca0c6['shift']());}};_0x2a150a(++_0x4f5396);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index c7d7be1..f45a816 100644
--- a/server/api/campaign/campaign.rpc.js
+++ b/server/api/campaign/campaign.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x941115,_0x2954e9){var _0x80a241=function(_0x3a8655){while(--_0x3a8655){_0x941115['push'](_0x941115['shift']());}};_0x80a241(++_0x2954e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x53fa5b,_0x44c62c){var _0x1151a3=function(_0x2403b1){while(--_0x2403b1){_0x53fa5b['push'](_0x53fa5b['shift']());}};_0x1151a3(++_0x44c62c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index f00f144..c935947 100644
--- a/server/api/campaign/index.js
+++ b/server/api/campaign/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc779=['/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','destroy','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','isAuthenticated','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x455e82,_0x522f6f){var _0x2d0520=function(_0x11556e){while(--_0x11556e){_0x455e82['push'](_0x455e82['shift']());}};_0x2d0520(++_0x522f6f);}(_0xc779,0x1b5));var _0x9c77=function(_0x59ff7c,_0x1a5263){_0x59ff7c=_0x59ff7c-0x0;var _0x23a3b7=_0xc779[_0x59ff7c];return _0x23a3b7;};'use strict';var multer=require('multer');var util=require(_0x9c77('0x0'));var path=require(_0x9c77('0x1'));var timeout=require(_0x9c77('0x2'));var express=require(_0x9c77('0x3'));var router=express[_0x9c77('0x4')]();var auth=require(_0x9c77('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c77('0x6'));var controller=require(_0x9c77('0x7'));router['get']('/',auth[_0x9c77('0x8')](),controller['index']);router[_0x9c77('0x9')](_0x9c77('0xa'),auth['isAuthenticated'](),controller[_0x9c77('0xb')]);router[_0x9c77('0x9')](_0x9c77('0xc'),auth[_0x9c77('0x8')](),controller[_0x9c77('0xd')]);router[_0x9c77('0x9')](_0x9c77('0xe'),auth['isAuthenticated'](),controller[_0x9c77('0xf')]);router[_0x9c77('0x9')](_0x9c77('0x10'),auth['isAuthenticated'](),controller[_0x9c77('0x11')]);router[_0x9c77('0x9')](_0x9c77('0x12'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x13')]);router['get']('/:id/lists',auth[_0x9c77('0x8')](),controller[_0x9c77('0x14')]);router[_0x9c77('0x9')](_0x9c77('0x15'),auth[_0x9c77('0x8')](),controller['getBlackLists']);router[_0x9c77('0x16')]('/',auth[_0x9c77('0x8')](),controller[_0x9c77('0x17')]);router[_0x9c77('0x16')](_0x9c77('0x18'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x19')]);router[_0x9c77('0x16')](_0x9c77('0x1a'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x1b')]);router['post'](_0x9c77('0x15'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x1c')]);router['put'](_0x9c77('0xa'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x1d')]);router['delete'](_0x9c77('0xa'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x1e')]);router[_0x9c77('0x1f')](_0x9c77('0x1a'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x20')]);router['delete'](_0x9c77('0x15'),auth[_0x9c77('0x8')](),controller[_0x9c77('0x21')]);module[_0x9c77('0x22')]=router;
\ No newline at end of file
+var _0x4089=['post','create','/:id/clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists'];(function(_0xf1b354,_0x32048c){var _0x405d3a=function(_0x2e1dbc){while(--_0x2e1dbc){_0xf1b354['push'](_0xf1b354['shift']());}};_0x405d3a(++_0x32048c);}(_0x4089,0x180));var _0x9408=function(_0x20895b,_0x198888){_0x20895b=_0x20895b-0x0;var _0x4147ab=_0x4089[_0x20895b];return _0x4147ab;};'use strict';var multer=require(_0x9408('0x0'));var util=require('util');var path=require(_0x9408('0x1'));var timeout=require('connect-timeout');var express=require(_0x9408('0x2'));var router=express[_0x9408('0x3')]();var auth=require(_0x9408('0x4'));var interaction=require(_0x9408('0x5'));var config=require('../../config/environment');var controller=require(_0x9408('0x6'));router[_0x9408('0x7')]('/',auth[_0x9408('0x8')](),controller['index']);router[_0x9408('0x7')](_0x9408('0x9'),auth[_0x9408('0x8')](),controller['show']);router[_0x9408('0x7')](_0x9408('0xa'),auth[_0x9408('0x8')](),controller[_0x9408('0xb')]);router[_0x9408('0x7')](_0x9408('0xc'),auth[_0x9408('0x8')](),controller[_0x9408('0xd')]);router[_0x9408('0x7')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x9408('0xe')]);router[_0x9408('0x7')]('/:id/hopper_black',auth[_0x9408('0x8')](),controller[_0x9408('0xf')]);router[_0x9408('0x7')](_0x9408('0x10'),auth[_0x9408('0x8')](),controller[_0x9408('0x11')]);router[_0x9408('0x7')](_0x9408('0x12'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x9408('0x13')]('/',auth['isAuthenticated'](),controller[_0x9408('0x14')]);router[_0x9408('0x13')](_0x9408('0x15'),auth[_0x9408('0x8')](),controller['clone']);router[_0x9408('0x13')](_0x9408('0x10'),auth[_0x9408('0x8')](),controller[_0x9408('0x16')]);router['post'](_0x9408('0x12'),auth['isAuthenticated'](),controller[_0x9408('0x17')]);router[_0x9408('0x18')](_0x9408('0x9'),auth[_0x9408('0x8')](),controller[_0x9408('0x19')]);router[_0x9408('0x1a')](_0x9408('0x9'),auth[_0x9408('0x8')](),controller[_0x9408('0x1b')]);router[_0x9408('0x1a')](_0x9408('0x10'),auth[_0x9408('0x8')](),controller[_0x9408('0x1c')]);router[_0x9408('0x1a')](_0x9408('0x12'),auth[_0x9408('0x8')](),controller[_0x9408('0x1d')]);module[_0x9408('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index ff3f415..4eb8f5d 100644
--- a/server/api/cannedAnswer/cannedAnswer.attributes.js
+++ b/server/api/cannedAnswer/cannedAnswer.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4664=['STRING','TEXT','VIRTUAL','key','exports'];(function(_0x21993f,_0xa34a1b){var _0x3cb4f0=function(_0x47138f){while(--_0x47138f){_0x21993f['push'](_0x21993f['shift']());}};_0x3cb4f0(++_0xa34a1b);}(_0x4664,0x77));var _0x4466=function(_0x4dac30,_0x3b1e61){_0x4dac30=_0x4dac30-0x0;var _0x4ae741=_0x4664[_0x4dac30];return _0x4ae741;};'use strict';var Sequelize=require('sequelize');module[_0x4466('0x0')]={'key':{'type':Sequelize[_0x4466('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x4466('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4466('0x1')]},'name':{'type':Sequelize[_0x4466('0x3')],'get':function(){return this['getDataValue'](_0x4466('0x4'));}}};
\ No newline at end of file
+var _0xa576=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x335f37,_0x37302b){var _0x1768f4=function(_0x3ce316){while(--_0x3ce316){_0x335f37['push'](_0x335f37['shift']());}};_0x1768f4(++_0x37302b);}(_0xa576,0x1e3));var _0x6a57=function(_0x428c92,_0x36ba49){_0x428c92=_0x428c92-0x0;var _0x527ce2=_0xa576[_0x428c92];return _0x527ce2;};'use strict';var Sequelize=require(_0x6a57('0x0'));module[_0x6a57('0x1')]={'key':{'type':Sequelize[_0x6a57('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x6a57('0x3')],'get':function(){return this[_0x6a57('0x4')](_0x6a57('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index d41d863..6d9c149 100644
--- a/server/api/cannedAnswer/cannedAnswer.controller.js
+++ b/server/api/cannedAnswer/cannedAnswer.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2cc5=['keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','intersection','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','get','CannedAnswers','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','model','query'];(function(_0x129bdf,_0x185544){var _0xe2deed=function(_0x1fb556){while(--_0x1fb556){_0x129bdf['push'](_0x129bdf['shift']());}};_0xe2deed(++_0x185544);}(_0x2cc5,0x132));var _0x52cc=function(_0x261a74,_0x4a9a78){_0x261a74=_0x261a74-0x0;var _0x3f15a4=_0x2cc5[_0x261a74];return _0x3f15a4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x52cc('0x0'));var rimraf=require(_0x52cc('0x1'));var zipdir=require(_0x52cc('0x2'));var jsonpatch=require(_0x52cc('0x3'));var rp=require(_0x52cc('0x4'));var moment=require(_0x52cc('0x5'));var BPromise=require(_0x52cc('0x6'));var Mustache=require(_0x52cc('0x7'));var util=require(_0x52cc('0x8'));var path=require(_0x52cc('0x9'));var sox=require(_0x52cc('0xa'));var csv=require(_0x52cc('0xb'));var ejs=require(_0x52cc('0xc'));var fs=require('fs');var _=require(_0x52cc('0xd'));var squel=require(_0x52cc('0xe'));var crypto=require(_0x52cc('0xf'));var jsforce=require(_0x52cc('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x52cc('0xb'));var querystring=require('querystring');var Papa=require(_0x52cc('0x11'));var Redis=require(_0x52cc('0x12'));var authService=require(_0x52cc('0x13'));var qs=require(_0x52cc('0x14'));var as=require(_0x52cc('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x52cc('0x16'))(_0x52cc('0x17'));var utils=require(_0x52cc('0x18'));var config=require(_0x52cc('0x19'));var db=require(_0x52cc('0x1a'))['db'];function respondWithStatusCode(_0x341fae,_0x203673){_0x203673=_0x203673||0xcc;return function(_0xa84d56){if(_0xa84d56){return _0x341fae[_0x52cc('0x1b')](_0x203673);}return _0x341fae[_0x52cc('0x1c')](_0x203673)[_0x52cc('0x1d')]();};}function respondWithResult(_0x5bf83e,_0x2f2ce1){_0x2f2ce1=_0x2f2ce1||0xc8;return function(_0x54b313){if(_0x54b313){return _0x5bf83e[_0x52cc('0x1c')](_0x2f2ce1)[_0x52cc('0x1e')](_0x54b313);}};}function respondWithFilteredResult(_0x297304,_0x124465){return function(_0x5a224f){if(_0x5a224f){var _0x20017e=_0x5a224f[_0x52cc('0x1f')],_0xe30617=_0x124465['offset'],_0x4fcb65=_0x124465[_0x52cc('0x20')]+_0x124465[_0x52cc('0x21')],_0x54be29;if(_0x4fcb65>=_0x20017e){_0x4fcb65=_0x20017e;_0x54be29=0xc8;}else{_0x54be29=0xce;}_0x297304[_0x52cc('0x1c')](_0x54be29);return _0x297304['set'](_0x52cc('0x22'),_0xe30617+'-'+_0x4fcb65+'/'+_0x20017e)['json'](_0x5a224f);}return null;};}function patchUpdates(_0x1c3917){return function(_0x2cdfde){try{jsonpatch[_0x52cc('0x23')](_0x2cdfde,_0x1c3917,!![]);}catch(_0x534f74){return BPromise['reject'](_0x534f74);}return _0x2cdfde['save']();};}function saveUpdates(_0xe773b7,_0x3d8894){return function(_0x598fb3){if(_0x598fb3){return _0x598fb3[_0x52cc('0x24')](_0xe773b7)[_0x52cc('0x25')](function(_0x2a9bef){return _0x2a9bef;});}return null;};}function removeEntity(_0x20333c,_0x33a95e){return function(_0x16bf2a){if(_0x16bf2a){return _0x16bf2a[_0x52cc('0x26')]()[_0x52cc('0x25')](function(){var _0x1689cc=_0x16bf2a[_0x52cc('0x27')]({'plain':!![]});var _0x591f42=_0x52cc('0x28');return db['UserProfileResource'][_0x52cc('0x26')]({'where':{'type':_0x591f42,'resourceId':_0x1689cc['id']}})[_0x52cc('0x25')](function(){return _0x16bf2a;});})[_0x52cc('0x25')](function(){_0x20333c[_0x52cc('0x1c')](0xcc)[_0x52cc('0x1d')]();});}};}function handleEntityNotFound(_0x28a78d,_0x47a5b2){return function(_0x2fed2e){if(!_0x2fed2e){_0x28a78d[_0x52cc('0x1b')](0x194);}return _0x2fed2e;};}function handleError(_0x4dcbd1,_0x58b44a){_0x58b44a=_0x58b44a||0x1f4;return function(_0x5fe733){logger['error'](_0x5fe733[_0x52cc('0x29')]);if(_0x5fe733[_0x52cc('0x2a')]){delete _0x5fe733[_0x52cc('0x2a')];}_0x4dcbd1[_0x52cc('0x1c')](_0x58b44a)['send'](_0x5fe733);};}exports['index']=function(_0x4114dc,_0x15d094){var _0x83a06f={},_0x3ed187={},_0x22a3b0={'count':0x0,'rows':[]};var _0x2c0387=_[_0x52cc('0x2b')](db[_0x52cc('0x2c')][_0x52cc('0x2d')],function(_0x391b49){return{'name':_0x391b49[_0x52cc('0x2e')],'type':_0x391b49[_0x52cc('0x2f')]['key']};});_0x3ed187[_0x52cc('0x30')]=_[_0x52cc('0x2b')](_0x2c0387,_0x52cc('0x2a'));_0x3ed187[_0x52cc('0x31')]=_[_0x52cc('0x32')](_0x4114dc['query']);_0x3ed187[_0x52cc('0x33')]=_['intersection'](_0x3ed187[_0x52cc('0x30')],_0x3ed187[_0x52cc('0x31')]);_0x83a06f[_0x52cc('0x34')]=_['intersection'](_0x3ed187['model'],qs['fields'](_0x4114dc[_0x52cc('0x31')][_0x52cc('0x35')]));_0x83a06f['attributes']=_0x83a06f['attributes'][_0x52cc('0x36')]?_0x83a06f[_0x52cc('0x34')]:_0x3ed187[_0x52cc('0x30')];if(!_0x4114dc[_0x52cc('0x31')][_0x52cc('0x37')]('nolimit')){_0x83a06f[_0x52cc('0x21')]=qs[_0x52cc('0x21')](_0x4114dc[_0x52cc('0x31')][_0x52cc('0x21')]);_0x83a06f[_0x52cc('0x20')]=qs[_0x52cc('0x20')](_0x4114dc['query'][_0x52cc('0x20')]);}_0x83a06f[_0x52cc('0x38')]=qs['sort'](_0x4114dc['query'][_0x52cc('0x39')]);_0x83a06f[_0x52cc('0x3a')]=qs[_0x52cc('0x33')](_['pick'](_0x4114dc['query'],_0x3ed187[_0x52cc('0x33')]),_0x2c0387);if(_0x4114dc[_0x52cc('0x31')][_0x52cc('0x3b')]){_0x83a06f[_0x52cc('0x3a')]=_[_0x52cc('0x3c')](_0x83a06f[_0x52cc('0x3a')],{'$or':_[_0x52cc('0x2b')](_0x2c0387,function(_0x331834){if(_0x331834[_0x52cc('0x2f')]!==_0x52cc('0x3d')){var _0x117914={};_0x117914[_0x331834[_0x52cc('0x2a')]]={'$like':'%'+_0x4114dc[_0x52cc('0x31')][_0x52cc('0x3b')]+'%'};return _0x117914;}})});}_0x83a06f=_[_0x52cc('0x3c')]({},_0x83a06f,_0x4114dc['options']);var _0x4163d5={'where':_0x83a06f['where']};return db['CannedAnswer'][_0x52cc('0x1f')](_0x4163d5)['then'](function(_0x5afd65){_0x22a3b0[_0x52cc('0x1f')]=_0x5afd65;if(_0x4114dc[_0x52cc('0x31')][_0x52cc('0x3e')]){_0x83a06f[_0x52cc('0x3f')]=[{'all':!![]}];}return db[_0x52cc('0x2c')][_0x52cc('0x40')](_0x83a06f);})[_0x52cc('0x25')](function(_0x30400f){_0x22a3b0[_0x52cc('0x41')]=_0x30400f;return _0x22a3b0;})[_0x52cc('0x25')](respondWithFilteredResult(_0x15d094,_0x83a06f))[_0x52cc('0x42')](handleError(_0x15d094,null));};exports[_0x52cc('0x43')]=function(_0x403006,_0x3ead48){var _0x2bb113={'raw':!![],'where':{'id':_0x403006['params']['id']}},_0x5f87c7={};_0x5f87c7['model']=_[_0x52cc('0x32')](db[_0x52cc('0x2c')]['rawAttributes']);_0x5f87c7[_0x52cc('0x31')]=_['keys'](_0x403006[_0x52cc('0x31')]);_0x5f87c7[_0x52cc('0x33')]=_[_0x52cc('0x44')](_0x5f87c7[_0x52cc('0x30')],_0x5f87c7[_0x52cc('0x31')]);_0x2bb113[_0x52cc('0x34')]=_['intersection'](_0x5f87c7[_0x52cc('0x30')],qs[_0x52cc('0x35')](_0x403006[_0x52cc('0x31')]['fields']));_0x2bb113['attributes']=_0x2bb113[_0x52cc('0x34')][_0x52cc('0x36')]?_0x2bb113[_0x52cc('0x34')]:_0x5f87c7[_0x52cc('0x30')];if(_0x403006[_0x52cc('0x31')][_0x52cc('0x3e')]){_0x2bb113[_0x52cc('0x3f')]=[{'all':!![]}];}_0x2bb113=_[_0x52cc('0x3c')]({},_0x2bb113,_0x403006[_0x52cc('0x45')]);return db[_0x52cc('0x2c')][_0x52cc('0x46')](_0x2bb113)[_0x52cc('0x25')](handleEntityNotFound(_0x3ead48,null))[_0x52cc('0x25')](respondWithResult(_0x3ead48,null))[_0x52cc('0x42')](handleError(_0x3ead48,null));};exports['update']=function(_0x14a859,_0x15ecad){if(_0x14a859[_0x52cc('0x47')]['id']){delete _0x14a859[_0x52cc('0x47')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x14a859[_0x52cc('0x48')]['id']}})[_0x52cc('0x25')](handleEntityNotFound(_0x15ecad,null))['then'](saveUpdates(_0x14a859[_0x52cc('0x47')],null))['then'](respondWithResult(_0x15ecad,null))[_0x52cc('0x42')](handleError(_0x15ecad,null));};exports['destroy']=function(_0xb99bde,_0x6f9508){return db[_0x52cc('0x2c')][_0x52cc('0x46')]({'where':{'id':_0xb99bde['params']['id']}})[_0x52cc('0x25')](handleEntityNotFound(_0x6f9508,null))['then'](removeEntity(_0x6f9508,null))['catch'](handleError(_0x6f9508,null));};exports[_0x52cc('0x49')]=function(_0x262c38,_0x21f434){var _0x5e232e={'key':_0x262c38[_0x52cc('0x47')]['key']};if(_0x262c38[_0x52cc('0x47')][_0x52cc('0x4a')]){_0x5e232e[_0x52cc('0x4a')]=_0x262c38[_0x52cc('0x47')][_0x52cc('0x4a')];}else if(_0x262c38[_0x52cc('0x47')][_0x52cc('0x4b')]){_0x5e232e[_0x52cc('0x4b')]=_0x262c38[_0x52cc('0x47')][_0x52cc('0x4b')];}else if(_0x262c38[_0x52cc('0x47')]['OpenchannelAccountId']){_0x5e232e[_0x52cc('0x4c')]=_0x262c38[_0x52cc('0x47')][_0x52cc('0x4c')];}else if(_0x262c38[_0x52cc('0x47')][_0x52cc('0x4d')]){_0x5e232e[_0x52cc('0x4d')]=_0x262c38[_0x52cc('0x47')]['ChatWebsiteId'];}return db[_0x52cc('0x2c')][_0x52cc('0x46')]({'where':_0x5e232e})[_0x52cc('0x25')](function(_0x1f7ac4){if(_0x1f7ac4){throw new db[(_0x52cc('0x4e'))]['ValidationError'](_0x52cc('0x4f'));}return db['CannedAnswer'][_0x52cc('0x49')](_0x262c38[_0x52cc('0x47')]);})['then'](function(_0x257346){var _0xf6c382=_0x262c38[_0x52cc('0x50')]['get']({'plain':!![]});if(!_0xf6c382)throw new Error(_0x52cc('0x51'));if(_0xf6c382[_0x52cc('0x52')]===_0x52cc('0x50')){var _0x5bc465=_0x257346[_0x52cc('0x27')]({'plain':!![]});return db[_0x52cc('0x53')]['find']({'where':{'name':_0x52cc('0x28'),'userProfileId':_0xf6c382[_0x52cc('0x54')]},'raw':!![]})[_0x52cc('0x25')](function(_0x5c6034){if(_0x5c6034&&_0x5c6034[_0x52cc('0x55')]===0x0){return db[_0x52cc('0x56')][_0x52cc('0x49')]({'name':_0x5bc465[_0x52cc('0x2a')],'resourceId':_0x5bc465['id'],'type':_0x5c6034[_0x52cc('0x2a')],'sectionId':_0x5c6034['id']},{})[_0x52cc('0x25')](function(){return _0x257346;});}else{return _0x257346;}})[_0x52cc('0x42')](function(_0x2aefbd){logger[_0x52cc('0x57')](_0x52cc('0x58'),_0x2aefbd);throw _0x2aefbd;});}return _0x257346;})['then'](respondWithResult(_0x21f434,0xc9))[_0x52cc('0x42')](handleError(_0x21f434,null));};
\ No newline at end of file
+var _0x3dcc=['ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','limit','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','CannedAnswers','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x3dcc,0x1aa));var _0xc3dc=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0x3dcc[_0x231a47];return _0x48d7c9;};'use strict';var pdf=require(_0xc3dc('0x0'));var emlformat=require(_0xc3dc('0x1'));var rimraf=require(_0xc3dc('0x2'));var zipdir=require(_0xc3dc('0x3'));var jsonpatch=require(_0xc3dc('0x4'));var rp=require(_0xc3dc('0x5'));var moment=require(_0xc3dc('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc3dc('0x7'));var sox=require(_0xc3dc('0x8'));var csv=require('to-csv');var ejs=require(_0xc3dc('0x9'));var fs=require('fs');var _=require(_0xc3dc('0xa'));var squel=require(_0xc3dc('0xb'));var crypto=require('crypto');var jsforce=require(_0xc3dc('0xc'));var deskjs=require(_0xc3dc('0xd'));var toCsv=require(_0xc3dc('0xe'));var querystring=require(_0xc3dc('0xf'));var Papa=require('papaparse');var Redis=require(_0xc3dc('0x10'));var authService=require(_0xc3dc('0x11'));var qs=require(_0xc3dc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3dc('0x13'));var logger=require(_0xc3dc('0x14'))(_0xc3dc('0x15'));var utils=require('../../config/utils');var config=require(_0xc3dc('0x16'));var db=require(_0xc3dc('0x17'))['db'];function respondWithStatusCode(_0x5749ec,_0x2cb8c2){_0x2cb8c2=_0x2cb8c2||0xcc;return function(_0x4d236a){if(_0x4d236a){return _0x5749ec[_0xc3dc('0x18')](_0x2cb8c2);}return _0x5749ec[_0xc3dc('0x19')](_0x2cb8c2)['end']();};}function respondWithResult(_0x282d7c,_0x205ba9){_0x205ba9=_0x205ba9||0xc8;return function(_0xd73847){if(_0xd73847){return _0x282d7c['status'](_0x205ba9)[_0xc3dc('0x1a')](_0xd73847);}};}function respondWithFilteredResult(_0x547db6,_0x19a0d2){return function(_0x510317){if(_0x510317){var _0x41726a=_0x510317[_0xc3dc('0x1b')],_0x38f971=_0x19a0d2[_0xc3dc('0x1c')],_0x2741f0=_0x19a0d2[_0xc3dc('0x1c')]+_0x19a0d2['limit'],_0x57a3b3;if(_0x2741f0>=_0x41726a){_0x2741f0=_0x41726a;_0x57a3b3=0xc8;}else{_0x57a3b3=0xce;}_0x547db6[_0xc3dc('0x19')](_0x57a3b3);return _0x547db6[_0xc3dc('0x1d')](_0xc3dc('0x1e'),_0x38f971+'-'+_0x2741f0+'/'+_0x41726a)[_0xc3dc('0x1a')](_0x510317);}return null;};}function patchUpdates(_0x5312e7){return function(_0x334d92){try{jsonpatch[_0xc3dc('0x1f')](_0x334d92,_0x5312e7,!![]);}catch(_0x4d52f5){return BPromise['reject'](_0x4d52f5);}return _0x334d92[_0xc3dc('0x20')]();};}function saveUpdates(_0xdbff65,_0x8974ca){return function(_0x1b4047){if(_0x1b4047){return _0x1b4047[_0xc3dc('0x21')](_0xdbff65)[_0xc3dc('0x22')](function(_0x7f9f5a){return _0x7f9f5a;});}return null;};}function removeEntity(_0xa9c95e,_0x513c51){return function(_0x411788){if(_0x411788){return _0x411788[_0xc3dc('0x23')]()[_0xc3dc('0x22')](function(){var _0x538418=_0x411788[_0xc3dc('0x24')]({'plain':!![]});var _0x49147d='CannedAnswers';return db[_0xc3dc('0x25')][_0xc3dc('0x23')]({'where':{'type':_0x49147d,'resourceId':_0x538418['id']}})['then'](function(){return _0x411788;});})[_0xc3dc('0x22')](function(){_0xa9c95e['status'](0xcc)[_0xc3dc('0x26')]();});}};}function handleEntityNotFound(_0x322ec9,_0x3c1aa6){return function(_0x101dec){if(!_0x101dec){_0x322ec9['sendStatus'](0x194);}return _0x101dec;};}function handleError(_0x4b6262,_0x1172d8){_0x1172d8=_0x1172d8||0x1f4;return function(_0x241b91){logger['error'](_0x241b91[_0xc3dc('0x27')]);if(_0x241b91[_0xc3dc('0x28')]){delete _0x241b91['name'];}_0x4b6262[_0xc3dc('0x19')](_0x1172d8)[_0xc3dc('0x29')](_0x241b91);};}exports[_0xc3dc('0x2a')]=function(_0x5502d2,_0x20c54a){var _0x593edd={},_0x3197c1={},_0x1bad41={'count':0x0,'rows':[]};var _0x46fef1=_[_0xc3dc('0x2b')](db[_0xc3dc('0x2c')][_0xc3dc('0x2d')],function(_0x2da7be){return{'name':_0x2da7be[_0xc3dc('0x2e')],'type':_0x2da7be['type'][_0xc3dc('0x2f')]};});_0x3197c1[_0xc3dc('0x30')]=_['map'](_0x46fef1,'name');_0x3197c1[_0xc3dc('0x31')]=_[_0xc3dc('0x32')](_0x5502d2[_0xc3dc('0x31')]);_0x3197c1[_0xc3dc('0x33')]=_['intersection'](_0x3197c1[_0xc3dc('0x30')],_0x3197c1['query']);_0x593edd[_0xc3dc('0x34')]=_[_0xc3dc('0x35')](_0x3197c1[_0xc3dc('0x30')],qs[_0xc3dc('0x36')](_0x5502d2[_0xc3dc('0x31')][_0xc3dc('0x36')]));_0x593edd[_0xc3dc('0x34')]=_0x593edd['attributes'][_0xc3dc('0x37')]?_0x593edd[_0xc3dc('0x34')]:_0x3197c1['model'];if(!_0x5502d2[_0xc3dc('0x31')]['hasOwnProperty']('nolimit')){_0x593edd[_0xc3dc('0x38')]=qs[_0xc3dc('0x38')](_0x5502d2[_0xc3dc('0x31')][_0xc3dc('0x38')]);_0x593edd['offset']=qs[_0xc3dc('0x1c')](_0x5502d2[_0xc3dc('0x31')][_0xc3dc('0x1c')]);}_0x593edd[_0xc3dc('0x39')]=qs['sort'](_0x5502d2[_0xc3dc('0x31')]['sort']);_0x593edd[_0xc3dc('0x3a')]=qs['filters'](_['pick'](_0x5502d2[_0xc3dc('0x31')],_0x3197c1[_0xc3dc('0x33')]),_0x46fef1);if(_0x5502d2[_0xc3dc('0x31')][_0xc3dc('0x3b')]){_0x593edd['where']=_[_0xc3dc('0x3c')](_0x593edd['where'],{'$or':_[_0xc3dc('0x2b')](_0x46fef1,function(_0x196b9a){if(_0x196b9a[_0xc3dc('0x3d')]!==_0xc3dc('0x3e')){var _0x5c9ec5={};_0x5c9ec5[_0x196b9a[_0xc3dc('0x28')]]={'$like':'%'+_0x5502d2[_0xc3dc('0x31')][_0xc3dc('0x3b')]+'%'};return _0x5c9ec5;}})});}_0x593edd=_['merge']({},_0x593edd,_0x5502d2[_0xc3dc('0x3f')]);var _0x5ae91a={'where':_0x593edd[_0xc3dc('0x3a')]};return db[_0xc3dc('0x2c')][_0xc3dc('0x1b')](_0x5ae91a)[_0xc3dc('0x22')](function(_0x172fe9){_0x1bad41[_0xc3dc('0x1b')]=_0x172fe9;if(_0x5502d2[_0xc3dc('0x31')][_0xc3dc('0x40')]){_0x593edd[_0xc3dc('0x41')]=[{'all':!![]}];}return db[_0xc3dc('0x2c')]['findAll'](_0x593edd);})['then'](function(_0x974a01){_0x1bad41[_0xc3dc('0x42')]=_0x974a01;return _0x1bad41;})[_0xc3dc('0x22')](respondWithFilteredResult(_0x20c54a,_0x593edd))[_0xc3dc('0x43')](handleError(_0x20c54a,null));};exports[_0xc3dc('0x44')]=function(_0x339916,_0x2c85d9){var _0x41deca={'raw':!![],'where':{'id':_0x339916[_0xc3dc('0x45')]['id']}},_0x3e94eb={};_0x3e94eb[_0xc3dc('0x30')]=_[_0xc3dc('0x32')](db['CannedAnswer'][_0xc3dc('0x2d')]);_0x3e94eb[_0xc3dc('0x31')]=_[_0xc3dc('0x32')](_0x339916[_0xc3dc('0x31')]);_0x3e94eb[_0xc3dc('0x33')]=_['intersection'](_0x3e94eb[_0xc3dc('0x30')],_0x3e94eb[_0xc3dc('0x31')]);_0x41deca[_0xc3dc('0x34')]=_[_0xc3dc('0x35')](_0x3e94eb[_0xc3dc('0x30')],qs[_0xc3dc('0x36')](_0x339916[_0xc3dc('0x31')][_0xc3dc('0x36')]));_0x41deca[_0xc3dc('0x34')]=_0x41deca[_0xc3dc('0x34')][_0xc3dc('0x37')]?_0x41deca['attributes']:_0x3e94eb['model'];if(_0x339916[_0xc3dc('0x31')][_0xc3dc('0x40')]){_0x41deca[_0xc3dc('0x41')]=[{'all':!![]}];}_0x41deca=_['merge']({},_0x41deca,_0x339916['options']);return db[_0xc3dc('0x2c')][_0xc3dc('0x46')](_0x41deca)[_0xc3dc('0x22')](handleEntityNotFound(_0x2c85d9,null))[_0xc3dc('0x22')](respondWithResult(_0x2c85d9,null))[_0xc3dc('0x43')](handleError(_0x2c85d9,null));};exports[_0xc3dc('0x21')]=function(_0x5d777b,_0x48a15f){if(_0x5d777b['body']['id']){delete _0x5d777b['body']['id'];}return db[_0xc3dc('0x2c')][_0xc3dc('0x46')]({'where':{'id':_0x5d777b['params']['id']}})['then'](handleEntityNotFound(_0x48a15f,null))['then'](saveUpdates(_0x5d777b[_0xc3dc('0x47')],null))[_0xc3dc('0x22')](respondWithResult(_0x48a15f,null))[_0xc3dc('0x43')](handleError(_0x48a15f,null));};exports[_0xc3dc('0x23')]=function(_0x5b07ef,_0x5d9f29){return db[_0xc3dc('0x2c')][_0xc3dc('0x46')]({'where':{'id':_0x5b07ef[_0xc3dc('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d9f29,null))['then'](removeEntity(_0x5d9f29,null))[_0xc3dc('0x43')](handleError(_0x5d9f29,null));};exports[_0xc3dc('0x48')]=function(_0x29e170,_0xc82177){var _0x19a288={'key':_0x29e170[_0xc3dc('0x47')][_0xc3dc('0x2f')]};if(_0x29e170[_0xc3dc('0x47')][_0xc3dc('0x49')]){_0x19a288[_0xc3dc('0x49')]=_0x29e170['body'][_0xc3dc('0x49')];}else if(_0x29e170['body']['SmsAccountId']){_0x19a288[_0xc3dc('0x4a')]=_0x29e170['body'][_0xc3dc('0x4a')];}else if(_0x29e170[_0xc3dc('0x47')][_0xc3dc('0x4b')]){_0x19a288[_0xc3dc('0x4b')]=_0x29e170[_0xc3dc('0x47')][_0xc3dc('0x4b')];}else if(_0x29e170['body']['ChatWebsiteId']){_0x19a288[_0xc3dc('0x4c')]=_0x29e170[_0xc3dc('0x47')][_0xc3dc('0x4c')];}return db[_0xc3dc('0x2c')][_0xc3dc('0x46')]({'where':_0x19a288})[_0xc3dc('0x22')](function(_0x5682b9){if(_0x5682b9){throw new db[(_0xc3dc('0x4d'))][(_0xc3dc('0x4e'))](_0xc3dc('0x4f'));}return db['CannedAnswer'][_0xc3dc('0x48')](_0x29e170[_0xc3dc('0x47')]);})[_0xc3dc('0x22')](function(_0x363c0d){var _0x1137c7=_0x29e170[_0xc3dc('0x50')][_0xc3dc('0x24')]({'plain':!![]});if(!_0x1137c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1137c7[_0xc3dc('0x51')]==='user'){var _0x2a389a=_0x363c0d['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xc3dc('0x52'),'userProfileId':_0x1137c7[_0xc3dc('0x53')]},'raw':!![]})['then'](function(_0xe55819){if(_0xe55819&&_0xe55819[_0xc3dc('0x54')]===0x0){return db[_0xc3dc('0x25')]['create']({'name':_0x2a389a['name'],'resourceId':_0x2a389a['id'],'type':_0xe55819['name'],'sectionId':_0xe55819['id']},{})[_0xc3dc('0x22')](function(){return _0x363c0d;});}else{return _0x363c0d;}})[_0xc3dc('0x43')](function(_0x1f8f2f){logger[_0xc3dc('0x55')](_0xc3dc('0x56'),_0x1f8f2f);throw _0x1f8f2f;});}return _0x363c0d;})['then'](respondWithResult(_0xc82177,0xc9))[_0xc3dc('0x43')](handleError(_0xc82177,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 2b8bda6..c16d015 100644
--- a/server/api/cannedAnswer/cannedAnswer.model.js
+++ b/server/api/cannedAnswer/cannedAnswer.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x16cc=['path','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2472b8,_0x5522fc){var _0x25c946=function(_0x374909){while(--_0x374909){_0x2472b8['push'](_0x2472b8['shift']());}};_0x25c946(++_0x5522fc);}(_0x16cc,0x120));var _0xc16c=function(_0x113e87,_0x4a543f){_0x113e87=_0x113e87-0x0;var _0x257a68=_0x16cc[_0x113e87];return _0x257a68;};'use strict';var _=require('lodash');var util=require(_0xc16c('0x0'));var logger=require(_0xc16c('0x1'))(_0xc16c('0x2'));var moment=require(_0xc16c('0x3'));var BPromise=require(_0xc16c('0x4'));var rp=require(_0xc16c('0x5'));var fs=require('fs');var path=require(_0xc16c('0x6'));var rimraf=require('rimraf');var config=require(_0xc16c('0x7'));var attributes=require(_0xc16c('0x8'));module[_0xc16c('0x9')]=function(_0x1019ec,_0x5ea82b){return _0x1019ec[_0xc16c('0xa')]('CannedAnswer',attributes,{'tableName':_0xc16c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc16c('0xc'),'collate':_0xc16c('0xd')});};
\ No newline at end of file
+var _0xff3c=['exports','CannedAnswer','utf8mb4','lodash','util','api','moment','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x35b205,_0x24e696){var _0x20ecb2=function(_0xead3ac){while(--_0xead3ac){_0x35b205['push'](_0x35b205['shift']());}};_0x20ecb2(++_0x24e696);}(_0xff3c,0x179));var _0xcff3=function(_0x5a6df0,_0x3e4fcd){_0x5a6df0=_0x5a6df0-0x0;var _0x124ced=_0xff3c[_0x5a6df0];return _0x124ced;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var logger=require('../../config/logger')(_0xcff3('0x2'));var moment=require(_0xcff3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcff3('0x4'));var rimraf=require(_0xcff3('0x5'));var config=require(_0xcff3('0x6'));var attributes=require(_0xcff3('0x7'));module[_0xcff3('0x8')]=function(_0x308a82,_0x47b899){return _0x308a82['define'](_0xcff3('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcff3('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index fb19b07..8ba1dc2 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8aae=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0xe421be,_0x5a1386){var _0x100c6a=function(_0x2055ee){while(--_0x2055ee){_0xe421be['push'](_0xe421be['shift']());}};_0x100c6a(++_0x5a1386);}(_0x8aae,0xdb));var _0xe8aa=function(_0x5b3115,_0x4a989c){_0x5b3115=_0x5b3115-0x0;var _0x2f6cfc=_0x8aae[_0x5b3115];return _0x2f6cfc;};'use strict';var _=require(_0xe8aa('0x0'));var util=require(_0xe8aa('0x1'));var moment=require(_0xe8aa('0x2'));var BPromise=require(_0xe8aa('0x3'));var rs=require(_0xe8aa('0x4'));var fs=require('fs');var Redis=require(_0xe8aa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8aa('0x6'));var logger=require('../../config/logger')(_0xe8aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe8aa('0x8')][_0xe8aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5417bc,_0x36cd24,_0x555560){return new BPromise(function(_0x37092a,_0x3a6f22){return client['request'](_0x5417bc,_0x555560)[_0xe8aa('0xa')](function(_0x544f00){logger[_0xe8aa('0xb')](_0xe8aa('0xc'),_0x36cd24,_0xe8aa('0xd'));logger[_0xe8aa('0xe')](_0xe8aa('0xf'),_0x36cd24,_0xe8aa('0xd'),JSON['stringify'](_0x544f00));if(_0x544f00[_0xe8aa('0x10')]){if(_0x544f00[_0xe8aa('0x10')]['code']===0x1f4){logger[_0xe8aa('0x10')](_0xe8aa('0xc'),_0x36cd24,_0x544f00[_0xe8aa('0x10')]['message']);return _0x3a6f22(_0x544f00[_0xe8aa('0x10')]['message']);}logger[_0xe8aa('0x10')](_0xe8aa('0xc'),_0x36cd24,_0x544f00[_0xe8aa('0x10')][_0xe8aa('0x11')]);return _0x37092a(_0x544f00['error']['message']);}else{logger[_0xe8aa('0xb')]('CannedAnswer,\x20%s,\x20%s',_0x36cd24,'request\x20sent');_0x37092a(_0x544f00[_0xe8aa('0x12')][_0xe8aa('0x11')]);}})[_0xe8aa('0x13')](function(_0x24aeb8){logger[_0xe8aa('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x36cd24,_0x24aeb8);_0x3a6f22(_0x24aeb8);});});}
\ No newline at end of file
+var _0x0c6b=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0xacacf5,_0x587182){var _0x44d214=function(_0x2f3315){while(--_0x2f3315){_0xacacf5['push'](_0xacacf5['shift']());}};_0x44d214(++_0x587182);}(_0x0c6b,0x8c));var _0xb0c6=function(_0x395c39,_0x10945a){_0x395c39=_0x395c39-0x0;var _0x2a81ea=_0x0c6b[_0x395c39];return _0x2a81ea;};'use strict';var _=require(_0xb0c6('0x0'));var util=require(_0xb0c6('0x1'));var moment=require(_0xb0c6('0x2'));var BPromise=require(_0xb0c6('0x3'));var rs=require(_0xb0c6('0x4'));var fs=require('fs');var Redis=require(_0xb0c6('0x5'));var db=require(_0xb0c6('0x6'))['db'];var utils=require(_0xb0c6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xb0c6('0x8'));var jayson=require(_0xb0c6('0x9'));var client=jayson[_0xb0c6('0xa')][_0xb0c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe9cb75,_0x3170c2,_0x295e63){return new BPromise(function(_0x21f383,_0x19748c){return client[_0xb0c6('0xc')](_0xe9cb75,_0x295e63)['then'](function(_0x48a459){logger['info'](_0xb0c6('0xd'),_0x3170c2,'request\x20sent');logger[_0xb0c6('0xe')](_0xb0c6('0xf'),_0x3170c2,_0xb0c6('0x10'),JSON['stringify'](_0x48a459));if(_0x48a459['error']){if(_0x48a459[_0xb0c6('0x11')][_0xb0c6('0x12')]===0x1f4){logger[_0xb0c6('0x11')](_0xb0c6('0xd'),_0x3170c2,_0x48a459[_0xb0c6('0x11')]['message']);return _0x19748c(_0x48a459['error'][_0xb0c6('0x13')]);}logger[_0xb0c6('0x11')](_0xb0c6('0xd'),_0x3170c2,_0x48a459[_0xb0c6('0x11')]['message']);return _0x21f383(_0x48a459[_0xb0c6('0x11')]['message']);}else{logger[_0xb0c6('0x14')]('CannedAnswer,\x20%s,\x20%s',_0x3170c2,_0xb0c6('0x10'));_0x21f383(_0x48a459[_0xb0c6('0x15')][_0xb0c6('0x13')]);}})[_0xb0c6('0x16')](function(_0x172e96){logger[_0xb0c6('0x11')](_0xb0c6('0xd'),_0x3170c2,_0x172e96);_0x19748c(_0x172e96);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 089a3d5..f44e3aa 100644
--- a/server/api/cannedAnswer/index.js
+++ b/server/api/cannedAnswer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3981=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x36023f,_0x3463c5){var _0x2c2e24=function(_0x3672b8){while(--_0x3672b8){_0x36023f['push'](_0x36023f['shift']());}};_0x2c2e24(++_0x3463c5);}(_0x3981,0x144));var _0x1398=function(_0x2f3e77,_0xa2d68c){_0x2f3e77=_0x2f3e77-0x0;var _0xe6d7bd=_0x3981[_0x2f3e77];return _0xe6d7bd;};'use strict';var multer=require(_0x1398('0x0'));var util=require('util');var path=require(_0x1398('0x1'));var timeout=require(_0x1398('0x2'));var express=require(_0x1398('0x3'));var router=express[_0x1398('0x4')]();var auth=require(_0x1398('0x5'));var interaction=require(_0x1398('0x6'));var config=require(_0x1398('0x7'));var controller=require(_0x1398('0x8'));router[_0x1398('0x9')]('/',auth[_0x1398('0xa')](),controller[_0x1398('0xb')]);router['get'](_0x1398('0xc'),auth[_0x1398('0xa')](),controller[_0x1398('0xd')]);router['post']('/',auth[_0x1398('0xa')](),controller[_0x1398('0xe')]);router[_0x1398('0xf')](_0x1398('0xc'),auth[_0x1398('0xa')](),controller[_0x1398('0x10')]);router['delete'](_0x1398('0xc'),auth[_0x1398('0xa')](),controller[_0x1398('0x11')]);module[_0x1398('0x12')]=router;
\ No newline at end of file
+var _0x6d67=['create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x406696,_0x39f9b1){var _0x10e35c=function(_0x108de3){while(--_0x108de3){_0x406696['push'](_0x406696['shift']());}};_0x10e35c(++_0x39f9b1);}(_0x6d67,0xb5));var _0x76d6=function(_0x169124,_0x2d98b5){_0x169124=_0x169124-0x0;var _0x3ee0d3=_0x6d67[_0x169124];return _0x3ee0d3;};'use strict';var multer=require(_0x76d6('0x0'));var util=require(_0x76d6('0x1'));var path=require(_0x76d6('0x2'));var timeout=require(_0x76d6('0x3'));var express=require('express');var router=express[_0x76d6('0x4')]();var auth=require(_0x76d6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x76d6('0x6'));var controller=require('./cannedAnswer.controller');router[_0x76d6('0x7')]('/',auth[_0x76d6('0x8')](),controller[_0x76d6('0x9')]);router[_0x76d6('0x7')]('/:id',auth[_0x76d6('0x8')](),controller[_0x76d6('0xa')]);router['post']('/',auth[_0x76d6('0x8')](),controller[_0x76d6('0xb')]);router[_0x76d6('0xc')]('/:id',auth[_0x76d6('0x8')](),controller[_0x76d6('0xd')]);router[_0x76d6('0xe')]('/:id',auth[_0x76d6('0x8')](),controller[_0x76d6('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 63e3875..fe2f8ac 100644
--- a/server/api/cdr/cdr.attributes.js
+++ b/server/api/cdr/cdr.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1383=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x229132,_0x3115c9){var _0x272ab1=function(_0x387a51){while(--_0x387a51){_0x229132['push'](_0x229132['shift']());}};_0x272ab1(++_0x3115c9);}(_0x1383,0xef));var _0x3138=function(_0x33a880,_0x153ebf){_0x33a880=_0x33a880-0x0;var _0x35174c=_0x1383[_0x33a880];return _0x35174c;};'use strict';var Sequelize=require(_0x3138('0x0'));module[_0x3138('0x1')]={'calldate':{'type':Sequelize[_0x3138('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x3138('0x3')]},'src':{'type':Sequelize[_0x3138('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x3138('0x3')]},'channel':{'type':Sequelize[_0x3138('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x3138('0x3')]},'lastdata':{'type':Sequelize[_0x3138('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3138('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3138('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x3138('0x3')]},'uniqueid':{'type':Sequelize[_0x3138('0x3')]},'linkedid':{'type':Sequelize[_0x3138('0x3')]},'sequence':{'type':Sequelize[_0x3138('0x3')]},'peeraccount':{'type':Sequelize[_0x3138('0x3')]},'type':{'type':Sequelize[_0x3138('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x502b=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x502b,0x1ee));var _0xb502=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0x502b[_0x544099];return _0x20ab09;};'use strict';var Sequelize=require(_0xb502('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xb502('0x1')],'allowNull':![],'defaultValue':_0xb502('0x2')},'clid':{'type':Sequelize[_0xb502('0x3')]},'src':{'type':Sequelize[_0xb502('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xb502('0x3')]},'channel':{'type':Sequelize[_0xb502('0x3')]},'dstchannel':{'type':Sequelize[_0xb502('0x3')]},'lastapp':{'type':Sequelize[_0xb502('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb502('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb502('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb502('0x3')]},'amaflags':{'type':Sequelize[_0xb502('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb502('0x3')]},'userfield':{'type':Sequelize[_0xb502('0x3')]},'uniqueid':{'type':Sequelize[_0xb502('0x3')]},'linkedid':{'type':Sequelize[_0xb502('0x3')]},'sequence':{'type':Sequelize[_0xb502('0x3')]},'peeraccount':{'type':Sequelize[_0xb502('0x3')]},'type':{'type':Sequelize[_0xb502('0x3')]},'tag':{'type':Sequelize[_0xb502('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 825d4be..4ae90db 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8764=['set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','Cdr','fieldName','type','query','keys','filters','intersection','model','fields','attributes','limit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset'];(function(_0x15ecaa,_0x391114){var _0x3ea750=function(_0x394cc6){while(--_0x394cc6){_0x15ecaa['push'](_0x15ecaa['shift']());}};_0x3ea750(++_0x391114);}(_0x8764,0x76));var _0x4876=function(_0x4f296d,_0x8e9ec8){_0x4f296d=_0x4f296d-0x0;var _0x11b339=_0x8764[_0x4f296d];return _0x11b339;};'use strict';var pdf=require(_0x4876('0x0'));var emlformat=require(_0x4876('0x1'));var rimraf=require(_0x4876('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4876('0x3'));var rp=require(_0x4876('0x4'));var moment=require(_0x4876('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4876('0x6'));var path=require(_0x4876('0x7'));var sox=require(_0x4876('0x8'));var csv=require('to-csv');var ejs=require(_0x4876('0x9'));var fs=require('fs');var _=require(_0x4876('0xa'));var squel=require('squel');var crypto=require(_0x4876('0xb'));var jsforce=require(_0x4876('0xc'));var deskjs=require(_0x4876('0xd'));var toCsv=require(_0x4876('0xe'));var querystring=require(_0x4876('0xf'));var Papa=require(_0x4876('0x10'));var Redis=require(_0x4876('0x11'));var authService=require(_0x4876('0x12'));var qs=require(_0x4876('0x13'));var as=require(_0x4876('0x14'));var hardwareService=require(_0x4876('0x15'));var logger=require(_0x4876('0x16'))(_0x4876('0x17'));var utils=require(_0x4876('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c378d,_0x13f2b6){_0x13f2b6=_0x13f2b6||0xcc;return function(_0xca4591){if(_0xca4591){return _0x3c378d[_0x4876('0x19')](_0x13f2b6);}return _0x3c378d[_0x4876('0x1a')](_0x13f2b6)[_0x4876('0x1b')]();};}function respondWithResult(_0x27bb9b,_0x9dc509){_0x9dc509=_0x9dc509||0xc8;return function(_0x4be279){if(_0x4be279){return _0x27bb9b[_0x4876('0x1a')](_0x9dc509)['json'](_0x4be279);}};}function respondWithFilteredResult(_0x56e2e9,_0x458c14){return function(_0x2ad8e8){if(_0x2ad8e8){var _0x22353f=_0x2ad8e8[_0x4876('0x1c')],_0x27810f=_0x458c14[_0x4876('0x1d')],_0x37218b=_0x458c14[_0x4876('0x1d')]+_0x458c14['limit'],_0x48e65a;if(_0x37218b>=_0x22353f){_0x37218b=_0x22353f;_0x48e65a=0xc8;}else{_0x48e65a=0xce;}_0x56e2e9[_0x4876('0x1a')](_0x48e65a);return _0x56e2e9[_0x4876('0x1e')](_0x4876('0x1f'),_0x27810f+'-'+_0x37218b+'/'+_0x22353f)[_0x4876('0x20')](_0x2ad8e8);}return null;};}function patchUpdates(_0x5d9bb2){return function(_0x413cb0){try{jsonpatch['apply'](_0x413cb0,_0x5d9bb2,!![]);}catch(_0x25de41){return BPromise[_0x4876('0x21')](_0x25de41);}return _0x413cb0[_0x4876('0x22')]();};}function saveUpdates(_0x113903,_0x3e9fb2){return function(_0x5570c3){if(_0x5570c3){return _0x5570c3[_0x4876('0x23')](_0x113903)[_0x4876('0x24')](function(_0x1dbc5a){return _0x1dbc5a;});}return null;};}function removeEntity(_0x201202,_0x4d5089){return function(_0x520109){if(_0x520109){return _0x520109[_0x4876('0x25')]()[_0x4876('0x24')](function(){_0x201202[_0x4876('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6ec8,_0x3b3741){return function(_0x39e02e){if(!_0x39e02e){_0x2d6ec8[_0x4876('0x19')](0x194);}return _0x39e02e;};}function handleError(_0x3c6242,_0x4f2c46){_0x4f2c46=_0x4f2c46||0x1f4;return function(_0x59d865){logger[_0x4876('0x26')](_0x59d865[_0x4876('0x27')]);if(_0x59d865[_0x4876('0x28')]){delete _0x59d865['name'];}_0x3c6242[_0x4876('0x1a')](_0x4f2c46)['send'](_0x59d865);};}exports[_0x4876('0x29')]=function(_0x47c706,_0x4694e7){var _0x533c16={},_0x24c216={},_0x1737f8={'count':0x0,'rows':[]};var _0x2d8781=_[_0x4876('0x2a')](db[_0x4876('0x2b')]['rawAttributes'],function(_0x275fa1){return{'name':_0x275fa1[_0x4876('0x2c')],'type':_0x275fa1[_0x4876('0x2d')]['key']};});_0x24c216['model']=_[_0x4876('0x2a')](_0x2d8781,_0x4876('0x28'));_0x24c216[_0x4876('0x2e')]=_[_0x4876('0x2f')](_0x47c706[_0x4876('0x2e')]);_0x24c216[_0x4876('0x30')]=_[_0x4876('0x31')](_0x24c216[_0x4876('0x32')],_0x24c216[_0x4876('0x2e')]);_0x533c16['attributes']=_[_0x4876('0x31')](_0x24c216[_0x4876('0x32')],qs[_0x4876('0x33')](_0x47c706['query'][_0x4876('0x33')]));_0x533c16['attributes']=_0x533c16[_0x4876('0x34')]['length']?_0x533c16[_0x4876('0x34')]:_0x24c216['model'];if(!_0x47c706[_0x4876('0x2e')]['hasOwnProperty']('nolimit')){_0x533c16[_0x4876('0x35')]=qs[_0x4876('0x35')](_0x47c706[_0x4876('0x2e')][_0x4876('0x35')]);_0x533c16[_0x4876('0x1d')]=qs['offset'](_0x47c706[_0x4876('0x2e')]['offset']);}_0x533c16[_0x4876('0x36')]=qs[_0x4876('0x37')](_0x47c706[_0x4876('0x2e')]['sort']);_0x533c16[_0x4876('0x38')]=qs['filters'](_[_0x4876('0x39')](_0x47c706[_0x4876('0x2e')],_0x24c216[_0x4876('0x30')]),_0x2d8781);if(_0x47c706[_0x4876('0x2e')][_0x4876('0x3a')]){_0x533c16[_0x4876('0x38')]=_[_0x4876('0x3b')](_0x533c16[_0x4876('0x38')],{'$or':_[_0x4876('0x2a')](_0x2d8781,function(_0x503366){if(_0x503366['type']!=='VIRTUAL'){var _0x1bf40c={};_0x1bf40c[_0x503366[_0x4876('0x28')]]={'$like':'%'+_0x47c706['query']['filter']+'%'};return _0x1bf40c;}})});}_0x533c16=_[_0x4876('0x3b')]({},_0x533c16,_0x47c706['options']);var _0x132df6={'where':_0x533c16['where']};return db[_0x4876('0x2b')]['count'](_0x132df6)[_0x4876('0x24')](function(_0x385de9){_0x1737f8['count']=_0x385de9;if(_0x47c706[_0x4876('0x2e')][_0x4876('0x3c')]){_0x533c16[_0x4876('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x4876('0x3e')](_0x533c16);})[_0x4876('0x24')](function(_0x1d6056){_0x1737f8[_0x4876('0x3f')]=_0x1d6056;return _0x1737f8;})[_0x4876('0x24')](respondWithFilteredResult(_0x4694e7,_0x533c16))[_0x4876('0x40')](handleError(_0x4694e7,null));};exports[_0x4876('0x41')]=function(_0x44af88,_0x91f2e4){var _0x389fdd={'raw':!![],'where':{'id':_0x44af88[_0x4876('0x42')]['id']}},_0x2fb995={};_0x2fb995[_0x4876('0x32')]=_[_0x4876('0x2f')](db['Cdr'][_0x4876('0x43')]);_0x2fb995['query']=_[_0x4876('0x2f')](_0x44af88[_0x4876('0x2e')]);_0x2fb995[_0x4876('0x30')]=_[_0x4876('0x31')](_0x2fb995[_0x4876('0x32')],_0x2fb995['query']);_0x389fdd['attributes']=_[_0x4876('0x31')](_0x2fb995['model'],qs[_0x4876('0x33')](_0x44af88[_0x4876('0x2e')][_0x4876('0x33')]));_0x389fdd[_0x4876('0x34')]=_0x389fdd[_0x4876('0x34')][_0x4876('0x44')]?_0x389fdd['attributes']:_0x2fb995[_0x4876('0x32')];if(_0x44af88[_0x4876('0x2e')][_0x4876('0x3c')]){_0x389fdd[_0x4876('0x3d')]=[{'all':!![]}];}_0x389fdd=_['merge']({},_0x389fdd,_0x44af88[_0x4876('0x45')]);return db[_0x4876('0x2b')][_0x4876('0x46')](_0x389fdd)[_0x4876('0x24')](handleEntityNotFound(_0x91f2e4,null))[_0x4876('0x24')](respondWithResult(_0x91f2e4,null))[_0x4876('0x40')](handleError(_0x91f2e4,null));};exports[_0x4876('0x47')]=function(_0x19fd1b,_0x2f53a9){return db['Cdr']['create'](_0x19fd1b[_0x4876('0x48')],{})['then'](respondWithResult(_0x2f53a9,0xc9))[_0x4876('0x40')](handleError(_0x2f53a9,null));};exports[_0x4876('0x23')]=function(_0x4424ec,_0x4e8f56){if(_0x4424ec[_0x4876('0x48')]['id']){delete _0x4424ec[_0x4876('0x48')]['id'];}return db[_0x4876('0x2b')][_0x4876('0x46')]({'where':{'id':_0x4424ec[_0x4876('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e8f56,null))[_0x4876('0x24')](saveUpdates(_0x4424ec[_0x4876('0x48')],null))[_0x4876('0x24')](respondWithResult(_0x4e8f56,null))[_0x4876('0x40')](handleError(_0x4e8f56,null));};exports[_0x4876('0x25')]=function(_0x4242d9,_0x331c98){return db[_0x4876('0x2b')][_0x4876('0x46')]({'where':{'id':_0x4242d9['params']['id']}})[_0x4876('0x24')](handleEntityNotFound(_0x331c98,null))[_0x4876('0x24')](removeEntity(_0x331c98,null))['catch'](handleError(_0x331c98,null));};exports['describe']=function(_0x1a8e15,_0x464a5d){return db['Cdr'][_0x4876('0x49')]()[_0x4876('0x24')](respondWithResult(_0x464a5d,null))[_0x4876('0x40')](handleError(_0x464a5d,null));};
\ No newline at end of file
+var _0xd6a4=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','update','then','error','stack','name','send','map','Cdr','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','show','rawAttributes','body','catch','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel'];(function(_0x27bcb2,_0x412da4){var _0xef0f33=function(_0x248910){while(--_0x248910){_0x27bcb2['push'](_0x27bcb2['shift']());}};_0xef0f33(++_0x412da4);}(_0xd6a4,0xce));var _0x4d6a=function(_0xd1f056,_0x47938b){_0xd1f056=_0xd1f056-0x0;var _0x359346=_0xd6a4[_0xd1f056];return _0x359346;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4d6a('0x0'));var rimraf=require(_0x4d6a('0x1'));var zipdir=require(_0x4d6a('0x2'));var jsonpatch=require(_0x4d6a('0x3'));var rp=require(_0x4d6a('0x4'));var moment=require(_0x4d6a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4d6a('0x6'));var util=require(_0x4d6a('0x7'));var path=require(_0x4d6a('0x8'));var sox=require('sox');var csv=require(_0x4d6a('0x9'));var ejs=require(_0x4d6a('0xa'));var fs=require('fs');var _=require(_0x4d6a('0xb'));var squel=require(_0x4d6a('0xc'));var crypto=require('crypto');var jsforce=require(_0x4d6a('0xd'));var deskjs=require(_0x4d6a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4d6a('0xf'));var Papa=require(_0x4d6a('0x10'));var Redis=require('ioredis');var authService=require(_0x4d6a('0x11'));var qs=require(_0x4d6a('0x12'));var as=require(_0x4d6a('0x13'));var hardwareService=require(_0x4d6a('0x14'));var logger=require(_0x4d6a('0x15'))(_0x4d6a('0x16'));var utils=require('../../config/utils');var config=require(_0x4d6a('0x17'));var db=require(_0x4d6a('0x18'))['db'];function respondWithStatusCode(_0x3af16d,_0x39ee02){_0x39ee02=_0x39ee02||0xcc;return function(_0x20e114){if(_0x20e114){return _0x3af16d[_0x4d6a('0x19')](_0x39ee02);}return _0x3af16d[_0x4d6a('0x1a')](_0x39ee02)[_0x4d6a('0x1b')]();};}function respondWithResult(_0x596a78,_0x5a4ca4){_0x5a4ca4=_0x5a4ca4||0xc8;return function(_0x574e0c){if(_0x574e0c){return _0x596a78[_0x4d6a('0x1a')](_0x5a4ca4)[_0x4d6a('0x1c')](_0x574e0c);}};}function respondWithFilteredResult(_0x2f2559,_0x3b6c1e){return function(_0xbf36ff){if(_0xbf36ff){var _0x48e1ae=_0xbf36ff['count'],_0x4dabfb=_0x3b6c1e[_0x4d6a('0x1d')],_0x339b78=_0x3b6c1e['offset']+_0x3b6c1e[_0x4d6a('0x1e')],_0x2c8e50;if(_0x339b78>=_0x48e1ae){_0x339b78=_0x48e1ae;_0x2c8e50=0xc8;}else{_0x2c8e50=0xce;}_0x2f2559[_0x4d6a('0x1a')](_0x2c8e50);return _0x2f2559[_0x4d6a('0x1f')](_0x4d6a('0x20'),_0x4dabfb+'-'+_0x339b78+'/'+_0x48e1ae)['json'](_0xbf36ff);}return null;};}function patchUpdates(_0x3cc6a4){return function(_0x16ec5f){try{jsonpatch['apply'](_0x16ec5f,_0x3cc6a4,!![]);}catch(_0x3246e6){return BPromise['reject'](_0x3246e6);}return _0x16ec5f['save']();};}function saveUpdates(_0x24c23f,_0x31725b){return function(_0x48683c){if(_0x48683c){return _0x48683c[_0x4d6a('0x21')](_0x24c23f)[_0x4d6a('0x22')](function(_0x11431b){return _0x11431b;});}return null;};}function removeEntity(_0x49366a,_0x3c3505){return function(_0x58877a){if(_0x58877a){return _0x58877a['destroy']()[_0x4d6a('0x22')](function(){_0x49366a[_0x4d6a('0x1a')](0xcc)[_0x4d6a('0x1b')]();});}};}function handleEntityNotFound(_0x5db834,_0x85fe16){return function(_0x3d2873){if(!_0x3d2873){_0x5db834[_0x4d6a('0x19')](0x194);}return _0x3d2873;};}function handleError(_0x4d8351,_0x1a8ed9){_0x1a8ed9=_0x1a8ed9||0x1f4;return function(_0x1636c9){logger[_0x4d6a('0x23')](_0x1636c9[_0x4d6a('0x24')]);if(_0x1636c9[_0x4d6a('0x25')]){delete _0x1636c9[_0x4d6a('0x25')];}_0x4d8351[_0x4d6a('0x1a')](_0x1a8ed9)[_0x4d6a('0x26')](_0x1636c9);};}exports['index']=function(_0x5346fb,_0x2953b3){var _0x2f809e={},_0x12c930={},_0x165023={'count':0x0,'rows':[]};var _0xd1381d=_[_0x4d6a('0x27')](db[_0x4d6a('0x28')]['rawAttributes'],function(_0xc5eafc){return{'name':_0xc5eafc[_0x4d6a('0x29')],'type':_0xc5eafc['type'][_0x4d6a('0x2a')]};});_0x12c930[_0x4d6a('0x2b')]=_[_0x4d6a('0x27')](_0xd1381d,_0x4d6a('0x25'));_0x12c930[_0x4d6a('0x2c')]=_[_0x4d6a('0x2d')](_0x5346fb[_0x4d6a('0x2c')]);_0x12c930['filters']=_[_0x4d6a('0x2e')](_0x12c930[_0x4d6a('0x2b')],_0x12c930[_0x4d6a('0x2c')]);_0x2f809e[_0x4d6a('0x2f')]=_[_0x4d6a('0x2e')](_0x12c930[_0x4d6a('0x2b')],qs[_0x4d6a('0x30')](_0x5346fb['query']['fields']));_0x2f809e[_0x4d6a('0x2f')]=_0x2f809e[_0x4d6a('0x2f')][_0x4d6a('0x31')]?_0x2f809e['attributes']:_0x12c930[_0x4d6a('0x2b')];if(!_0x5346fb[_0x4d6a('0x2c')][_0x4d6a('0x32')]('nolimit')){_0x2f809e[_0x4d6a('0x1e')]=qs['limit'](_0x5346fb[_0x4d6a('0x2c')][_0x4d6a('0x1e')]);_0x2f809e['offset']=qs[_0x4d6a('0x1d')](_0x5346fb[_0x4d6a('0x2c')]['offset']);}_0x2f809e[_0x4d6a('0x33')]=qs['sort'](_0x5346fb[_0x4d6a('0x2c')][_0x4d6a('0x34')]);_0x2f809e[_0x4d6a('0x35')]=qs[_0x4d6a('0x36')](_[_0x4d6a('0x37')](_0x5346fb[_0x4d6a('0x2c')],_0x12c930[_0x4d6a('0x36')]),_0xd1381d);if(_0x5346fb[_0x4d6a('0x2c')]['filter']){_0x2f809e[_0x4d6a('0x35')]=_[_0x4d6a('0x38')](_0x2f809e[_0x4d6a('0x35')],{'$or':_[_0x4d6a('0x27')](_0xd1381d,function(_0x321ce6){if(_0x321ce6[_0x4d6a('0x39')]!==_0x4d6a('0x3a')){var _0x52d181={};_0x52d181[_0x321ce6[_0x4d6a('0x25')]]={'$like':'%'+_0x5346fb[_0x4d6a('0x2c')][_0x4d6a('0x3b')]+'%'};return _0x52d181;}})});}_0x2f809e=_[_0x4d6a('0x38')]({},_0x2f809e,_0x5346fb[_0x4d6a('0x3c')]);var _0x499659={'where':_0x2f809e[_0x4d6a('0x35')]};return db[_0x4d6a('0x28')][_0x4d6a('0x3d')](_0x499659)[_0x4d6a('0x22')](function(_0x18632a){_0x165023[_0x4d6a('0x3d')]=_0x18632a;if(_0x5346fb[_0x4d6a('0x2c')][_0x4d6a('0x3e')]){_0x2f809e[_0x4d6a('0x3f')]=[{'all':!![]}];}return db[_0x4d6a('0x28')][_0x4d6a('0x40')](_0x2f809e);})[_0x4d6a('0x22')](function(_0x5c0750){_0x165023['rows']=_0x5c0750;return _0x165023;})[_0x4d6a('0x22')](respondWithFilteredResult(_0x2953b3,_0x2f809e))['catch'](handleError(_0x2953b3,null));};exports[_0x4d6a('0x41')]=function(_0x580b96,_0x40fa02){var _0x77b4e0={'raw':!![],'where':{'id':_0x580b96['params']['id']}},_0x16c421={};_0x16c421[_0x4d6a('0x2b')]=_[_0x4d6a('0x2d')](db[_0x4d6a('0x28')][_0x4d6a('0x42')]);_0x16c421[_0x4d6a('0x2c')]=_[_0x4d6a('0x2d')](_0x580b96[_0x4d6a('0x2c')]);_0x16c421['filters']=_[_0x4d6a('0x2e')](_0x16c421['model'],_0x16c421[_0x4d6a('0x2c')]);_0x77b4e0[_0x4d6a('0x2f')]=_[_0x4d6a('0x2e')](_0x16c421[_0x4d6a('0x2b')],qs[_0x4d6a('0x30')](_0x580b96['query'][_0x4d6a('0x30')]));_0x77b4e0['attributes']=_0x77b4e0['attributes'][_0x4d6a('0x31')]?_0x77b4e0[_0x4d6a('0x2f')]:_0x16c421[_0x4d6a('0x2b')];if(_0x580b96[_0x4d6a('0x2c')][_0x4d6a('0x3e')]){_0x77b4e0['include']=[{'all':!![]}];}_0x77b4e0=_[_0x4d6a('0x38')]({},_0x77b4e0,_0x580b96['options']);return db['Cdr']['find'](_0x77b4e0)[_0x4d6a('0x22')](handleEntityNotFound(_0x40fa02,null))[_0x4d6a('0x22')](respondWithResult(_0x40fa02,null))['catch'](handleError(_0x40fa02,null));};exports['create']=function(_0xfcfa14,_0x493424){return db['Cdr']['create'](_0xfcfa14[_0x4d6a('0x43')],{})[_0x4d6a('0x22')](respondWithResult(_0x493424,0xc9))[_0x4d6a('0x44')](handleError(_0x493424,null));};exports[_0x4d6a('0x21')]=function(_0x53230b,_0x202e5c){if(_0x53230b['body']['id']){delete _0x53230b[_0x4d6a('0x43')]['id'];}return db[_0x4d6a('0x28')][_0x4d6a('0x45')]({'where':{'id':_0x53230b[_0x4d6a('0x46')]['id']}})[_0x4d6a('0x22')](handleEntityNotFound(_0x202e5c,null))[_0x4d6a('0x22')](saveUpdates(_0x53230b[_0x4d6a('0x43')],null))[_0x4d6a('0x22')](respondWithResult(_0x202e5c,null))['catch'](handleError(_0x202e5c,null));};exports[_0x4d6a('0x47')]=function(_0xf0f6c1,_0x1fa6f4){return db[_0x4d6a('0x28')][_0x4d6a('0x45')]({'where':{'id':_0xf0f6c1['params']['id']}})[_0x4d6a('0x22')](handleEntityNotFound(_0x1fa6f4,null))[_0x4d6a('0x22')](removeEntity(_0x1fa6f4,null))[_0x4d6a('0x44')](handleError(_0x1fa6f4,null));};exports[_0x4d6a('0x48')]=function(_0x4f4722,_0x280e49){return db['Cdr'][_0x4d6a('0x48')]()[_0x4d6a('0x22')](respondWithResult(_0x280e49,null))[_0x4d6a('0x44')](handleError(_0x280e49,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 7140b53..f439045 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2d8=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','Cdr','cdr','accountcode','calldate','dst','src','uniqueid'];(function(_0x346d53,_0x477cbe){var _0x110a72=function(_0x3f6693){while(--_0x3f6693){_0x346d53['push'](_0x346d53['shift']());}};_0x110a72(++_0x477cbe);}(_0xc2d8,0x1ef));var _0x8c2d=function(_0x524ba7,_0x1856f){_0x524ba7=_0x524ba7-0x0;var _0xd6b359=_0xc2d8[_0x524ba7];return _0xd6b359;};'use strict';var _=require('lodash');var util=require(_0x8c2d('0x0'));var logger=require('../../config/logger')(_0x8c2d('0x1'));var moment=require(_0x8c2d('0x2'));var BPromise=require(_0x8c2d('0x3'));var rp=require(_0x8c2d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c2d('0x5'));var config=require(_0x8c2d('0x6'));var attributes=require('./cdr.attributes');module[_0x8c2d('0x7')]=function(_0x134ac8,_0x20f0d3){return _0x134ac8['define'](_0x8c2d('0x8'),attributes,{'tableName':_0x8c2d('0x9'),'paranoid':![],'indexes':[{'name':_0x8c2d('0xa'),'fields':['accountcode']},{'name':_0x8c2d('0xb'),'fields':[_0x8c2d('0xb')]},{'name':'disposition','fields':['disposition']},{'name':_0x8c2d('0xc'),'fields':[_0x8c2d('0xc')]},{'name':_0x8c2d('0xd'),'fields':[_0x8c2d('0xd')]},{'name':_0x8c2d('0xe'),'fields':[_0x8c2d('0xe')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x4f68=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4f68,0x1a9));var _0x84f6=function(_0x289995,_0x1a6768){_0x289995=_0x289995-0x0;var _0x253542=_0x4f68[_0x289995];return _0x253542;};'use strict';var _=require(_0x84f6('0x0'));var util=require('util');var logger=require(_0x84f6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x84f6('0x2'));var rp=require(_0x84f6('0x3'));var fs=require('fs');var path=require(_0x84f6('0x4'));var rimraf=require(_0x84f6('0x5'));var config=require(_0x84f6('0x6'));var attributes=require(_0x84f6('0x7'));module['exports']=function(_0x46af53,_0x2fb9df){return _0x46af53[_0x84f6('0x8')](_0x84f6('0x9'),attributes,{'tableName':_0x84f6('0xa'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x84f6('0xb')]},{'name':_0x84f6('0xc'),'fields':['calldate']},{'name':_0x84f6('0xd'),'fields':['disposition']},{'name':_0x84f6('0xe'),'fields':[_0x84f6('0xe')]},{'name':_0x84f6('0xf'),'fields':[_0x84f6('0xf')]},{'name':_0x84f6('0x10'),'fields':[_0x84f6('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 7a2b935..109ae4c 100644
--- a/server/api/cdr/cdr.rpc.js
+++ b/server/api/cdr/cdr.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a7e=['../../config/logger','jayson/promise','client','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8a7e,0x177));var _0xe8a7=function(_0x5aaa74,_0xaacac7){_0x5aaa74=_0x5aaa74-0x0;var _0x2a5d16=_0x8a7e[_0x5aaa74];return _0x2a5d16;};'use strict';var _=require(_0xe8a7('0x0'));var util=require(_0xe8a7('0x1'));var moment=require(_0xe8a7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8a7('0x3'))['db'];var utils=require(_0xe8a7('0x4'));var logger=require(_0xe8a7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe8a7('0x6'));var client=jayson[_0xe8a7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59bc5e,_0x405f2e,_0x48f922){return new BPromise(function(_0x2d8d52,_0x2c056b){return client[_0xe8a7('0x8')](_0x59bc5e,_0x48f922)[_0xe8a7('0x9')](function(_0xc2f2b4){logger['info'](_0xe8a7('0xa'),_0x405f2e,_0xe8a7('0xb'));logger[_0xe8a7('0xc')](_0xe8a7('0xd'),_0x405f2e,_0xe8a7('0xb'),JSON[_0xe8a7('0xe')](_0xc2f2b4));if(_0xc2f2b4[_0xe8a7('0xf')]){if(_0xc2f2b4['error']['code']===0x1f4){logger[_0xe8a7('0xf')](_0xe8a7('0xa'),_0x405f2e,_0xc2f2b4[_0xe8a7('0xf')][_0xe8a7('0x10')]);return _0x2c056b(_0xc2f2b4[_0xe8a7('0xf')][_0xe8a7('0x10')]);}logger[_0xe8a7('0xf')]('Cdr,\x20%s,\x20%s',_0x405f2e,_0xc2f2b4[_0xe8a7('0xf')]['message']);return _0x2d8d52(_0xc2f2b4['error']['message']);}else{logger[_0xe8a7('0x11')](_0xe8a7('0xa'),_0x405f2e,_0xe8a7('0xb'));_0x2d8d52(_0xc2f2b4[_0xe8a7('0x12')]['message']);}})[_0xe8a7('0x13')](function(_0x4e3d16){logger[_0xe8a7('0xf')]('Cdr,\x20%s,\x20%s',_0x405f2e,_0x4e3d16);_0x2c056b(_0x4e3d16);});});}
\ No newline at end of file
+var _0xe394=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe394,0x163));var _0x4e39=function(_0x49bd8a,_0x172298){_0x49bd8a=_0x49bd8a-0x0;var _0x4bef0c=_0xe394[_0x49bd8a];return _0x4bef0c;};'use strict';var _=require(_0x4e39('0x0'));var util=require(_0x4e39('0x1'));var moment=require(_0x4e39('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e39('0x3'));var fs=require('fs');var Redis=require(_0x4e39('0x4'));var db=require(_0x4e39('0x5'))['db'];var utils=require(_0x4e39('0x6'));var logger=require('../../config/logger')(_0x4e39('0x7'));var config=require(_0x4e39('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4e39('0x9')][_0x4e39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a49b8,_0x2c5613,_0x2ed697){return new BPromise(function(_0x40ca68,_0x13ad59){return client['request'](_0x4a49b8,_0x2ed697)[_0x4e39('0xb')](function(_0x5c3794){logger[_0x4e39('0xc')](_0x4e39('0xd'),_0x2c5613,_0x4e39('0xe'));logger['debug'](_0x4e39('0xf'),_0x2c5613,'request\x20sent',JSON[_0x4e39('0x10')](_0x5c3794));if(_0x5c3794[_0x4e39('0x11')]){if(_0x5c3794[_0x4e39('0x11')][_0x4e39('0x12')]===0x1f4){logger[_0x4e39('0x11')](_0x4e39('0xd'),_0x2c5613,_0x5c3794[_0x4e39('0x11')][_0x4e39('0x13')]);return _0x13ad59(_0x5c3794[_0x4e39('0x11')][_0x4e39('0x13')]);}logger[_0x4e39('0x11')]('Cdr,\x20%s,\x20%s',_0x2c5613,_0x5c3794['error']['message']);return _0x40ca68(_0x5c3794[_0x4e39('0x11')][_0x4e39('0x13')]);}else{logger['info'](_0x4e39('0xd'),_0x2c5613,_0x4e39('0xe'));_0x40ca68(_0x5c3794['result'][_0x4e39('0x13')]);}})['catch'](function(_0x2cfb15){logger[_0x4e39('0x11')]('Cdr,\x20%s,\x20%s',_0x2c5613,_0x2cfb15);_0x13ad59(_0x2cfb15);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 0408755..c511615 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf8b1=['create','put','update','delete','destroy','exports','multer','path','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','describe','/:id','show','post'];(function(_0x175ca4,_0x3a74c4){var _0x8c846d=function(_0x21d0e7){while(--_0x21d0e7){_0x175ca4['push'](_0x175ca4['shift']());}};_0x8c846d(++_0x3a74c4);}(_0xf8b1,0x1e2));var _0x1f8b=function(_0x332864,_0x27c971){_0x332864=_0x332864-0x0;var _0x6ebf8b=_0xf8b1[_0x332864];return _0x6ebf8b;};'use strict';var multer=require(_0x1f8b('0x0'));var util=require('util');var path=require(_0x1f8b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1f8b('0x2'));var config=require(_0x1f8b('0x3'));var controller=require(_0x1f8b('0x4'));router[_0x1f8b('0x5')]('/',auth[_0x1f8b('0x6')](),controller['index']);router[_0x1f8b('0x5')]('/describe',auth[_0x1f8b('0x6')](),controller[_0x1f8b('0x7')]);router[_0x1f8b('0x5')](_0x1f8b('0x8'),auth[_0x1f8b('0x6')](),controller[_0x1f8b('0x9')]);router[_0x1f8b('0xa')]('/',auth[_0x1f8b('0x6')](),controller[_0x1f8b('0xb')]);router[_0x1f8b('0xc')](_0x1f8b('0x8'),auth[_0x1f8b('0x6')](),controller[_0x1f8b('0xd')]);router[_0x1f8b('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1f8b('0xf')]);module[_0x1f8b('0x10')]=router;
\ No newline at end of file
+var _0xf936=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','put'];(function(_0xaf3ef,_0x57a8ad){var _0x57ae74=function(_0x547f65){while(--_0x547f65){_0xaf3ef['push'](_0xaf3ef['shift']());}};_0x57ae74(++_0x57a8ad);}(_0xf936,0x1d1));var _0x6f93=function(_0x4d487d,_0x376209){_0x4d487d=_0x4d487d-0x0;var _0x578708=_0xf936[_0x4d487d];return _0x578708;};'use strict';var multer=require(_0x6f93('0x0'));var util=require(_0x6f93('0x1'));var path=require(_0x6f93('0x2'));var timeout=require(_0x6f93('0x3'));var express=require(_0x6f93('0x4'));var router=express[_0x6f93('0x5')]();var auth=require(_0x6f93('0x6'));var interaction=require(_0x6f93('0x7'));var config=require(_0x6f93('0x8'));var controller=require('./cdr.controller');router['get']('/',auth[_0x6f93('0x9')](),controller['index']);router[_0x6f93('0xa')](_0x6f93('0xb'),auth[_0x6f93('0x9')](),controller[_0x6f93('0xc')]);router[_0x6f93('0xa')](_0x6f93('0xd'),auth['isAuthenticated'](),controller[_0x6f93('0xe')]);router[_0x6f93('0xf')]('/',auth[_0x6f93('0x9')](),controller[_0x6f93('0x10')]);router[_0x6f93('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6f93('0x12')]);router[_0x6f93('0x13')]('/:id',auth[_0x6f93('0x9')](),controller[_0x6f93('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2c1dbba..1b35881 100644
--- a/server/api/chatApplication/chatApplication.attributes.js
+++ b/server/api/chatApplication/chatApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2198=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x46a3ee,_0x1ae0e0){var _0x46e610=function(_0x4adcfc){while(--_0x4adcfc){_0x46a3ee['push'](_0x46a3ee['shift']());}};_0x46e610(++_0x1ae0e0);}(_0x2198,0x188));var _0x8219=function(_0xb0fd83,_0x2e8db2){_0xb0fd83=_0xb0fd83-0x0;var _0x1a38a4=_0x2198[_0xb0fd83];return _0x1a38a4;};'use strict';var Sequelize=require(_0x8219('0x0'));module[_0x8219('0x1')]={'priority':{'type':Sequelize[_0x8219('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8219('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8219('0x4')]()},'description':{'type':Sequelize[_0x8219('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8219('0x5')}};
\ No newline at end of file
+var _0x9d42=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x43d00a,_0x4e87e8){var _0x38b552=function(_0x15752d){while(--_0x15752d){_0x43d00a['push'](_0x43d00a['shift']());}};_0x38b552(++_0x4e87e8);}(_0x9d42,0xe6));var _0x29d4=function(_0x5d3f8d,_0x2e5fef){_0x5d3f8d=_0x5d3f8d-0x0;var _0x3a3e38=_0x9d42[_0x5d3f8d];return _0x3a3e38;};'use strict';var Sequelize=require('sequelize');module[_0x29d4('0x0')]={'priority':{'type':Sequelize[_0x29d4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x29d4('0x2')],'allowNull':![],'defaultValue':_0x29d4('0x3')},'appdata':{'type':Sequelize[_0x29d4('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x29d4('0x2')],'defaultValue':_0x29d4('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index dfb96ed..2abb047 100644
--- a/server/api/chatApplication/chatApplication.controller.js
+++ b/server/api/chatApplication/chatApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad67=['body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','model','keys','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll','include','merge'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xad67,0x147));var _0x7ad6=function(_0x1793e7,_0x4cba8a){_0x1793e7=_0x1793e7-0x0;var _0x3b5854=_0xad67[_0x1793e7];return _0x3b5854;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7ad6('0x0'));var rimraf=require(_0x7ad6('0x1'));var zipdir=require(_0x7ad6('0x2'));var jsonpatch=require(_0x7ad6('0x3'));var rp=require(_0x7ad6('0x4'));var moment=require(_0x7ad6('0x5'));var BPromise=require(_0x7ad6('0x6'));var Mustache=require('mustache');var util=require(_0x7ad6('0x7'));var path=require('path');var sox=require(_0x7ad6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7ad6('0x9'));var squel=require(_0x7ad6('0xa'));var crypto=require(_0x7ad6('0xb'));var jsforce=require(_0x7ad6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7ad6('0xd'));var Papa=require(_0x7ad6('0xe'));var Redis=require(_0x7ad6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7ad6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ad6('0x11'));var logger=require('../../config/logger')(_0x7ad6('0x12'));var utils=require(_0x7ad6('0x13'));var config=require(_0x7ad6('0x14'));var db=require(_0x7ad6('0x15'))['db'];function respondWithStatusCode(_0x2961de,_0x42aeb6){_0x42aeb6=_0x42aeb6||0xcc;return function(_0x57a3ea){if(_0x57a3ea){return _0x2961de[_0x7ad6('0x16')](_0x42aeb6);}return _0x2961de[_0x7ad6('0x17')](_0x42aeb6)['end']();};}function respondWithResult(_0x1e9c93,_0x169714){_0x169714=_0x169714||0xc8;return function(_0x48f1c5){if(_0x48f1c5){return _0x1e9c93[_0x7ad6('0x17')](_0x169714)[_0x7ad6('0x18')](_0x48f1c5);}};}function respondWithFilteredResult(_0x2721ce,_0x3db9bc){return function(_0x5e3c1a){if(_0x5e3c1a){var _0x32073a=_0x5e3c1a[_0x7ad6('0x19')],_0x588753=_0x3db9bc['offset'],_0x127b41=_0x3db9bc['offset']+_0x3db9bc[_0x7ad6('0x1a')],_0x2f2c6c;if(_0x127b41>=_0x32073a){_0x127b41=_0x32073a;_0x2f2c6c=0xc8;}else{_0x2f2c6c=0xce;}_0x2721ce[_0x7ad6('0x17')](_0x2f2c6c);return _0x2721ce[_0x7ad6('0x1b')](_0x7ad6('0x1c'),_0x588753+'-'+_0x127b41+'/'+_0x32073a)[_0x7ad6('0x18')](_0x5e3c1a);}return null;};}function patchUpdates(_0x10d6ee){return function(_0x34ad6d){try{jsonpatch[_0x7ad6('0x1d')](_0x34ad6d,_0x10d6ee,!![]);}catch(_0x2c3a65){return BPromise['reject'](_0x2c3a65);}return _0x34ad6d[_0x7ad6('0x1e')]();};}function saveUpdates(_0x237614,_0x5c7fc2){return function(_0x1e0e7b){if(_0x1e0e7b){return _0x1e0e7b[_0x7ad6('0x1f')](_0x237614)[_0x7ad6('0x20')](function(_0x4870f0){return _0x4870f0;});}return null;};}function removeEntity(_0x3a6b4b,_0x3705a7){return function(_0x20f90d){if(_0x20f90d){return _0x20f90d[_0x7ad6('0x21')]()[_0x7ad6('0x20')](function(){_0x3a6b4b[_0x7ad6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f7601,_0x5d116d){return function(_0x3491a4){if(!_0x3491a4){_0x3f7601[_0x7ad6('0x16')](0x194);}return _0x3491a4;};}function handleError(_0x31bb62,_0xb4ab5b){_0xb4ab5b=_0xb4ab5b||0x1f4;return function(_0x2f7496){logger[_0x7ad6('0x22')](_0x2f7496[_0x7ad6('0x23')]);if(_0x2f7496[_0x7ad6('0x24')]){delete _0x2f7496['name'];}_0x31bb62[_0x7ad6('0x17')](_0xb4ab5b)[_0x7ad6('0x25')](_0x2f7496);};}exports[_0x7ad6('0x26')]=function(_0x4bc147,_0x266b0f){var _0x1d50c7={'raw':!![],'where':{'id':_0x4bc147['params']['id']}},_0x57bf96={};_0x57bf96[_0x7ad6('0x27')]=_[_0x7ad6('0x28')](db[_0x7ad6('0x29')]['rawAttributes']);_0x57bf96[_0x7ad6('0x2a')]=_[_0x7ad6('0x28')](_0x4bc147[_0x7ad6('0x2a')]);_0x57bf96[_0x7ad6('0x2b')]=_[_0x7ad6('0x2c')](_0x57bf96[_0x7ad6('0x27')],_0x57bf96[_0x7ad6('0x2a')]);_0x1d50c7[_0x7ad6('0x2d')]=_[_0x7ad6('0x2c')](_0x57bf96[_0x7ad6('0x27')],qs[_0x7ad6('0x2e')](_0x4bc147[_0x7ad6('0x2a')]['fields']));_0x1d50c7[_0x7ad6('0x2d')]=_0x1d50c7[_0x7ad6('0x2d')][_0x7ad6('0x2f')]?_0x1d50c7[_0x7ad6('0x2d')]:_0x57bf96[_0x7ad6('0x27')];if(_0x4bc147[_0x7ad6('0x2a')][_0x7ad6('0x30')]){_0x1d50c7[_0x7ad6('0x31')]=[{'all':!![]}];}_0x1d50c7=_[_0x7ad6('0x32')]({},_0x1d50c7,_0x4bc147['options']);return db[_0x7ad6('0x29')]['find'](_0x1d50c7)[_0x7ad6('0x20')](handleEntityNotFound(_0x266b0f,null))[_0x7ad6('0x20')](respondWithResult(_0x266b0f,null))['catch'](handleError(_0x266b0f,null));};exports[_0x7ad6('0x1f')]=function(_0x34def2,_0x1d933f){if(_0x34def2[_0x7ad6('0x33')]['id']){delete _0x34def2[_0x7ad6('0x33')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x34def2['params']['id']}})['then'](handleEntityNotFound(_0x1d933f,null))[_0x7ad6('0x20')](saveUpdates(_0x34def2[_0x7ad6('0x33')],null))[_0x7ad6('0x20')](respondWithResult(_0x1d933f,null))['catch'](handleError(_0x1d933f,null));};exports[_0x7ad6('0x21')]=function(_0x33bcdb,_0x374b46){return db['ChatApplication'][_0x7ad6('0x34')]({'where':{'id':_0x33bcdb['params']['id']}})['then'](handleEntityNotFound(_0x374b46,null))['then'](removeEntity(_0x374b46,null))[_0x7ad6('0x35')](handleError(_0x374b46,null));};
\ No newline at end of file
+var _0x8dc5=['end','count','offset','set','json','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x37a0bc,_0x3712c6){var _0x1951c2=function(_0x3482a6){while(--_0x3482a6){_0x37a0bc['push'](_0x37a0bc['shift']());}};_0x1951c2(++_0x3712c6);}(_0x8dc5,0x181));var _0x58dc=function(_0x578a25,_0x368f7a){_0x578a25=_0x578a25-0x0;var _0x2a6ec0=_0x8dc5[_0x578a25];return _0x2a6ec0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x58dc('0x0'));var rimraf=require(_0x58dc('0x1'));var zipdir=require(_0x58dc('0x2'));var jsonpatch=require(_0x58dc('0x3'));var rp=require(_0x58dc('0x4'));var moment=require(_0x58dc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x58dc('0x6'));var util=require(_0x58dc('0x7'));var path=require(_0x58dc('0x8'));var sox=require(_0x58dc('0x9'));var csv=require(_0x58dc('0xa'));var ejs=require(_0x58dc('0xb'));var fs=require('fs');var _=require(_0x58dc('0xc'));var squel=require(_0x58dc('0xd'));var crypto=require(_0x58dc('0xe'));var jsforce=require(_0x58dc('0xf'));var deskjs=require(_0x58dc('0x10'));var toCsv=require('to-csv');var querystring=require(_0x58dc('0x11'));var Papa=require('papaparse');var Redis=require(_0x58dc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x58dc('0x13'));var as=require(_0x58dc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x58dc('0x15'))(_0x58dc('0x16'));var utils=require(_0x58dc('0x17'));var config=require(_0x58dc('0x18'));var db=require(_0x58dc('0x19'))['db'];function respondWithStatusCode(_0x32864e,_0x1fce68){_0x1fce68=_0x1fce68||0xcc;return function(_0x31811b){if(_0x31811b){return _0x32864e[_0x58dc('0x1a')](_0x1fce68);}return _0x32864e[_0x58dc('0x1b')](_0x1fce68)[_0x58dc('0x1c')]();};}function respondWithResult(_0x567a0f,_0x338154){_0x338154=_0x338154||0xc8;return function(_0x17ac3d){if(_0x17ac3d){return _0x567a0f[_0x58dc('0x1b')](_0x338154)['json'](_0x17ac3d);}};}function respondWithFilteredResult(_0x24f39d,_0x364022){return function(_0x5d5f9b){if(_0x5d5f9b){var _0x1f78c2=_0x5d5f9b[_0x58dc('0x1d')],_0x3c90dc=_0x364022[_0x58dc('0x1e')],_0x37d4c2=_0x364022[_0x58dc('0x1e')]+_0x364022['limit'],_0x35bf4c;if(_0x37d4c2>=_0x1f78c2){_0x37d4c2=_0x1f78c2;_0x35bf4c=0xc8;}else{_0x35bf4c=0xce;}_0x24f39d['status'](_0x35bf4c);return _0x24f39d[_0x58dc('0x1f')]('Content-Range',_0x3c90dc+'-'+_0x37d4c2+'/'+_0x1f78c2)[_0x58dc('0x20')](_0x5d5f9b);}return null;};}function patchUpdates(_0x42e3b3){return function(_0x140b51){try{jsonpatch['apply'](_0x140b51,_0x42e3b3,!![]);}catch(_0x2fe56a){return BPromise[_0x58dc('0x21')](_0x2fe56a);}return _0x140b51[_0x58dc('0x22')]();};}function saveUpdates(_0x2f3171,_0x2bc0d1){return function(_0x2e752b){if(_0x2e752b){return _0x2e752b[_0x58dc('0x23')](_0x2f3171)[_0x58dc('0x24')](function(_0x2cd5d4){return _0x2cd5d4;});}return null;};}function removeEntity(_0x9d022d,_0x49c144){return function(_0x3a4bd6){if(_0x3a4bd6){return _0x3a4bd6[_0x58dc('0x25')]()[_0x58dc('0x24')](function(){_0x9d022d[_0x58dc('0x1b')](0xcc)[_0x58dc('0x1c')]();});}};}function handleEntityNotFound(_0x38e0d6,_0x15baeb){return function(_0x33d813){if(!_0x33d813){_0x38e0d6[_0x58dc('0x1a')](0x194);}return _0x33d813;};}function handleError(_0x439de5,_0x2126a4){_0x2126a4=_0x2126a4||0x1f4;return function(_0x3c79e1){logger[_0x58dc('0x26')](_0x3c79e1[_0x58dc('0x27')]);if(_0x3c79e1[_0x58dc('0x28')]){delete _0x3c79e1[_0x58dc('0x28')];}_0x439de5[_0x58dc('0x1b')](_0x2126a4)[_0x58dc('0x29')](_0x3c79e1);};}exports[_0x58dc('0x2a')]=function(_0x107db9,_0x4d622f){var _0x21319f={'raw':!![],'where':{'id':_0x107db9[_0x58dc('0x2b')]['id']}},_0x1d4377={};_0x1d4377[_0x58dc('0x2c')]=_[_0x58dc('0x2d')](db[_0x58dc('0x2e')]['rawAttributes']);_0x1d4377[_0x58dc('0x2f')]=_[_0x58dc('0x2d')](_0x107db9[_0x58dc('0x2f')]);_0x1d4377['filters']=_['intersection'](_0x1d4377[_0x58dc('0x2c')],_0x1d4377[_0x58dc('0x2f')]);_0x21319f[_0x58dc('0x30')]=_[_0x58dc('0x31')](_0x1d4377['model'],qs[_0x58dc('0x32')](_0x107db9[_0x58dc('0x2f')][_0x58dc('0x32')]));_0x21319f[_0x58dc('0x30')]=_0x21319f[_0x58dc('0x30')][_0x58dc('0x33')]?_0x21319f[_0x58dc('0x30')]:_0x1d4377[_0x58dc('0x2c')];if(_0x107db9['query'][_0x58dc('0x34')]){_0x21319f[_0x58dc('0x35')]=[{'all':!![]}];}_0x21319f=_[_0x58dc('0x36')]({},_0x21319f,_0x107db9[_0x58dc('0x37')]);return db[_0x58dc('0x2e')][_0x58dc('0x38')](_0x21319f)['then'](handleEntityNotFound(_0x4d622f,null))[_0x58dc('0x24')](respondWithResult(_0x4d622f,null))[_0x58dc('0x39')](handleError(_0x4d622f,null));};exports['update']=function(_0xa4334d,_0x521f45){if(_0xa4334d[_0x58dc('0x3a')]['id']){delete _0xa4334d[_0x58dc('0x3a')]['id'];}return db[_0x58dc('0x2e')][_0x58dc('0x38')]({'where':{'id':_0xa4334d[_0x58dc('0x2b')]['id']}})['then'](handleEntityNotFound(_0x521f45,null))[_0x58dc('0x24')](saveUpdates(_0xa4334d[_0x58dc('0x3a')],null))[_0x58dc('0x24')](respondWithResult(_0x521f45,null))[_0x58dc('0x39')](handleError(_0x521f45,null));};exports['destroy']=function(_0x6d3bbc,_0x5fd9cf){return db[_0x58dc('0x2e')]['find']({'where':{'id':_0x6d3bbc[_0x58dc('0x2b')]['id']}})[_0x58dc('0x24')](handleEntityNotFound(_0x5fd9cf,null))['then'](removeEntity(_0x5fd9cf,null))[_0x58dc('0x39')](handleError(_0x5fd9cf,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 5de0f04..f5b0bd8 100644
--- a/server/api/chatApplication/chatApplication.model.js
+++ b/server/api/chatApplication/chatApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdd0=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatApplication.attributes','exports','chat_applications'];(function(_0x53e8c1,_0x1a6586){var _0x416748=function(_0x37e018){while(--_0x37e018){_0x53e8c1['push'](_0x53e8c1['shift']());}};_0x416748(++_0x1a6586);}(_0xbdd0,0x1a6));var _0x0bdd=function(_0x1e8071,_0x54cb69){_0x1e8071=_0x1e8071-0x0;var _0x191472=_0xbdd0[_0x1e8071];return _0x191472;};'use strict';var _=require(_0x0bdd('0x0'));var util=require(_0x0bdd('0x1'));var logger=require(_0x0bdd('0x2'))('api');var moment=require(_0x0bdd('0x3'));var BPromise=require(_0x0bdd('0x4'));var rp=require(_0x0bdd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0bdd('0x6'));var attributes=require(_0x0bdd('0x7'));module[_0x0bdd('0x8')]=function(_0x4ff739,_0x16bffb){return _0x4ff739['define']('ChatApplication',attributes,{'tableName':_0x0bdd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0bdd('0xa'),'collate':_0x0bdd('0xb')});};
\ No newline at end of file
+var _0xe33e=['path','rimraf','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xe33e,0x13f));var _0xee33=function(_0x2e0499,_0x4afdb2){_0x2e0499=_0x2e0499-0x0;var _0x4acb3d=_0xe33e[_0x2e0499];return _0x4acb3d;};'use strict';var _=require(_0xee33('0x0'));var util=require(_0xee33('0x1'));var logger=require('../../config/logger')(_0xee33('0x2'));var moment=require(_0xee33('0x3'));var BPromise=require('bluebird');var rp=require(_0xee33('0x4'));var fs=require('fs');var path=require(_0xee33('0x5'));var rimraf=require(_0xee33('0x6'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0xee33('0x7')]=function(_0x10b389,_0x254084){return _0x10b389[_0xee33('0x8')]('ChatApplication',attributes,{'tableName':_0xee33('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee33('0xa'),'collate':_0xee33('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index e4380c7..85d9ffa 100644
--- a/server/api/chatApplication/chatApplication.rpc.js
+++ b/server/api/chatApplication/chatApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0197=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2f7aee,_0x3f5ecb){var _0x872ff8=function(_0x500efe){while(--_0x500efe){_0x2f7aee['push'](_0x2f7aee['shift']());}};_0x872ff8(++_0x3f5ecb);}(_0x0197,0x1a9));var _0x7019=function(_0x132eb1,_0x468eec){_0x132eb1=_0x132eb1-0x0;var _0x7ca294=_0x0197[_0x132eb1];return _0x7ca294;};'use strict';var _=require(_0x7019('0x0'));var util=require(_0x7019('0x1'));var moment=require('moment');var BPromise=require(_0x7019('0x2'));var rs=require(_0x7019('0x3'));var fs=require('fs');var Redis=require(_0x7019('0x4'));var db=require(_0x7019('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7019('0x6'));var config=require(_0x7019('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7019('0x8')][_0x7019('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3643c0,_0x457100,_0x56c27d){return new BPromise(function(_0x1ed834,_0x6b65c5){return client[_0x7019('0xa')](_0x3643c0,_0x56c27d)['then'](function(_0x23350f){logger[_0x7019('0xb')](_0x7019('0xc'),_0x457100,_0x7019('0xd'));logger[_0x7019('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x457100,'request\x20sent',JSON[_0x7019('0xf')](_0x23350f));if(_0x23350f[_0x7019('0x10')]){if(_0x23350f[_0x7019('0x10')][_0x7019('0x11')]===0x1f4){logger['error'](_0x7019('0xc'),_0x457100,_0x23350f[_0x7019('0x10')][_0x7019('0x12')]);return _0x6b65c5(_0x23350f[_0x7019('0x10')][_0x7019('0x12')]);}logger[_0x7019('0x10')](_0x7019('0xc'),_0x457100,_0x23350f[_0x7019('0x10')]['message']);return _0x1ed834(_0x23350f[_0x7019('0x10')][_0x7019('0x12')]);}else{logger[_0x7019('0xb')](_0x7019('0xc'),_0x457100,'request\x20sent');_0x1ed834(_0x23350f[_0x7019('0x13')]['message']);}})[_0x7019('0x14')](function(_0x3fbdc){logger[_0x7019('0x10')](_0x7019('0xc'),_0x457100,_0x3fbdc);_0x6b65c5(_0x3fbdc);});});}
\ No newline at end of file
+var _0x51c0=['rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0x51c0,0x173));var _0x051c=function(_0x34442a,_0xac5a36){_0x34442a=_0x34442a-0x0;var _0x225e95=_0x51c0[_0x34442a];return _0x225e95;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x051c('0x0'));var BPromise=require(_0x051c('0x1'));var rs=require(_0x051c('0x2'));var fs=require('fs');var Redis=require(_0x051c('0x3'));var db=require(_0x051c('0x4'))['db'];var utils=require(_0x051c('0x5'));var logger=require(_0x051c('0x6'))(_0x051c('0x7'));var config=require(_0x051c('0x8'));var jayson=require(_0x051c('0x9'));var client=jayson[_0x051c('0xa')][_0x051c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x426371,_0x285256,_0xab0a22){return new BPromise(function(_0x2ddb6f,_0x1b2759){return client['request'](_0x426371,_0xab0a22)[_0x051c('0xc')](function(_0x1c89ba){logger['info']('ChatApplication,\x20%s,\x20%s',_0x285256,_0x051c('0xd'));logger['debug'](_0x051c('0xe'),_0x285256,_0x051c('0xd'),JSON['stringify'](_0x1c89ba));if(_0x1c89ba[_0x051c('0xf')]){if(_0x1c89ba[_0x051c('0xf')][_0x051c('0x10')]===0x1f4){logger[_0x051c('0xf')](_0x051c('0x11'),_0x285256,_0x1c89ba[_0x051c('0xf')][_0x051c('0x12')]);return _0x1b2759(_0x1c89ba['error'][_0x051c('0x12')]);}logger[_0x051c('0xf')](_0x051c('0x11'),_0x285256,_0x1c89ba[_0x051c('0xf')][_0x051c('0x12')]);return _0x2ddb6f(_0x1c89ba[_0x051c('0xf')]['message']);}else{logger['info'](_0x051c('0x11'),_0x285256,_0x051c('0xd'));_0x2ddb6f(_0x1c89ba[_0x051c('0x13')][_0x051c('0x12')]);}})[_0x051c('0x14')](function(_0x3c5c24){logger[_0x051c('0xf')]('ChatApplication,\x20%s,\x20%s',_0x285256,_0x3c5c24);_0x1b2759(_0x3c5c24);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 9ea7eec..6b80533 100644
--- a/server/api/chatApplication/index.js
+++ b/server/api/chatApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b13=['exports','multer','util','connect-timeout','express','Router','./chatApplication.controller','get','/:id','isAuthenticated','update','delete','destroy'];(function(_0x25da2d,_0x24d542){var _0x2ca8cc=function(_0x2839b0){while(--_0x2839b0){_0x25da2d['push'](_0x25da2d['shift']());}};_0x2ca8cc(++_0x24d542);}(_0x9b13,0x187));var _0x39b1=function(_0x53c982,_0x22655d){_0x53c982=_0x53c982-0x0;var _0x1cb3c0=_0x9b13[_0x53c982];return _0x1cb3c0;};'use strict';var multer=require(_0x39b1('0x0'));var util=require(_0x39b1('0x1'));var path=require('path');var timeout=require(_0x39b1('0x2'));var express=require(_0x39b1('0x3'));var router=express[_0x39b1('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x39b1('0x5'));router[_0x39b1('0x6')](_0x39b1('0x7'),auth[_0x39b1('0x8')](),controller['show']);router['put'](_0x39b1('0x7'),auth[_0x39b1('0x8')](),controller[_0x39b1('0x9')]);router[_0x39b1('0xa')](_0x39b1('0x7'),auth[_0x39b1('0x8')](),controller[_0x39b1('0xb')]);module[_0x39b1('0xc')]=router;
\ No newline at end of file
+var _0xa317=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','delete','isAuthenticated','exports','util'];(function(_0x3d248b,_0x5b0626){var _0xb26cd0=function(_0x3ba78d){while(--_0x3ba78d){_0x3d248b['push'](_0x3d248b['shift']());}};_0xb26cd0(++_0x5b0626);}(_0xa317,0xb5));var _0x7a31=function(_0x24867b,_0xe1706){_0x24867b=_0x24867b-0x0;var _0x3400a5=_0xa317[_0x24867b];return _0x3400a5;};'use strict';var multer=require('multer');var util=require(_0x7a31('0x0'));var path=require('path');var timeout=require(_0x7a31('0x1'));var express=require(_0x7a31('0x2'));var router=express[_0x7a31('0x3')]();var auth=require(_0x7a31('0x4'));var interaction=require(_0x7a31('0x5'));var config=require(_0x7a31('0x6'));var controller=require(_0x7a31('0x7'));router[_0x7a31('0x8')](_0x7a31('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x7a31('0xa')](_0x7a31('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x7a31('0xb')](_0x7a31('0x9'),auth[_0x7a31('0xc')](),controller['destroy']);module[_0x7a31('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 2bd82f1..27b710b 100644
--- a/server/api/chatGroup/chatGroup.attributes.js
+++ b/server/api/chatGroup/chatGroup.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce28=['sequelize','exports','STRING','BOOLEAN'];(function(_0x583c99,_0x30f9c3){var _0x43f572=function(_0x5804a7){while(--_0x5804a7){_0x583c99['push'](_0x583c99['shift']());}};_0x43f572(++_0x30f9c3);}(_0xce28,0x148));var _0x8ce2=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xce28[_0x26f702];return _0x11417d;};'use strict';var Sequelize=require(_0x8ce2('0x0'));module[_0x8ce2('0x1')]={'name':{'type':Sequelize[_0x8ce2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8ce2('0x2')]},'write':{'type':Sequelize[_0x8ce2('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6798=['exports','STRING','sequelize'];(function(_0x2f464f,_0x25f647){var _0x4f407b=function(_0x3ce91f){while(--_0x3ce91f){_0x2f464f['push'](_0x2f464f['shift']());}};_0x4f407b(++_0x25f647);}(_0x6798,0x92));var _0x8679=function(_0x13bdb8,_0x288e1d){_0x13bdb8=_0x13bdb8-0x0;var _0x1c5ad5=_0x6798[_0x13bdb8];return _0x1c5ad5;};'use strict';var Sequelize=require(_0x8679('0x0'));module[_0x8679('0x1')]={'name':{'type':Sequelize[_0x8679('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8679('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 04d3426..f360155 100644
--- a/server/api/chatGroup/chatGroup.controller.js
+++ b/server/api/chatGroup/chatGroup.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f52=['ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','removeMembers','ChatGroupId','getMessages','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0x45ce4e,_0x3a367c){var _0x4a105a=function(_0x52f8bb){while(--_0x52f8bb){_0x45ce4e['push'](_0x45ce4e['shift']());}};_0x4a105a(++_0x3a367c);}(_0x9f52,0xd2));var _0x29f5=function(_0x37c46b,_0x211aee){_0x37c46b=_0x37c46b-0x0;var _0x1ae8f7=_0x9f52[_0x37c46b];return _0x1ae8f7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x29f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29f5('0x2'));var moment=require(_0x29f5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x29f5('0x4'));var util=require(_0x29f5('0x5'));var path=require(_0x29f5('0x6'));var sox=require(_0x29f5('0x7'));var csv=require('to-csv');var ejs=require(_0x29f5('0x8'));var fs=require('fs');var _=require(_0x29f5('0x9'));var squel=require(_0x29f5('0xa'));var crypto=require(_0x29f5('0xb'));var jsforce=require(_0x29f5('0xc'));var deskjs=require(_0x29f5('0xd'));var toCsv=require(_0x29f5('0xe'));var querystring=require(_0x29f5('0xf'));var Papa=require(_0x29f5('0x10'));var Redis=require(_0x29f5('0x11'));var authService=require(_0x29f5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x29f5('0x13'));var hardwareService=require(_0x29f5('0x14'));var logger=require(_0x29f5('0x15'))(_0x29f5('0x16'));var utils=require(_0x29f5('0x17'));var config=require(_0x29f5('0x18'));var db=require(_0x29f5('0x19'))['db'];config[_0x29f5('0x1a')]=_['defaults'](config[_0x29f5('0x1a')],{'host':_0x29f5('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x29f5('0x1a')]));require('./chatGroup.socket')[_0x29f5('0x1c')](socket);var jayson=require(_0x29f5('0x1d'));var client=jayson[_0x29f5('0x1e')][_0x29f5('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x3804ad,_0x5d38a8,_0xfcf267){if(_0xfcf267){var _0x5768f2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5768f2[_0x29f5('0x20')](_0x5d38a8)){return _0x3804ad;}else{throw new db[(_0x29f5('0x21'))][(_0x29f5('0x22'))](_0x29f5('0x23'));}}else{return _0x3804ad;}}function respondWithRpcPromise(_0xa2f536,_0x2effab,_0x41d1dc,_0x4096f4){return new BPromise(function(_0x149279,_0x459b3c){var _0x19ad07=_0x4096f4||client;return _0x19ad07[_0x29f5('0x24')](_0xa2f536,_0x41d1dc)[_0x29f5('0x25')](function(_0x2e59d3){logger['info'](_0x29f5('0x26'),_0x2effab,_0x29f5('0x27'));logger[_0x29f5('0x28')](_0x29f5('0x29'),_0x2effab,_0x29f5('0x27'),JSON[_0x29f5('0x2a')](_0x2e59d3));if(_0x2e59d3[_0x29f5('0x2b')]){if(_0x2e59d3['error'][_0x29f5('0x2c')]===0x1f4){logger[_0x29f5('0x2b')](_0x29f5('0x26'),_0x2effab,_0x2e59d3['error'][_0x29f5('0x2d')]);return _0x459b3c(_0x2e59d3['error']['message']);}logger[_0x29f5('0x2b')](_0x29f5('0x26'),_0x2effab,_0x2e59d3[_0x29f5('0x2b')][_0x29f5('0x2d')]);return _0x149279(_0x2e59d3[_0x29f5('0x2b')][_0x29f5('0x2d')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x2effab,'request\x20sent');_0x149279(_0x2e59d3['result'][_0x29f5('0x2d')]);}})[_0x29f5('0x2e')](function(_0x229236){logger[_0x29f5('0x2b')](_0x29f5('0x26'),_0x2effab,_0x229236);_0x459b3c(_0x229236);});});}function respondWithStatusCode(_0x30bc6a,_0x405b9a){_0x405b9a=_0x405b9a||0xcc;return function(_0x5a8b75){if(_0x5a8b75){return _0x30bc6a['sendStatus'](_0x405b9a);}return _0x30bc6a[_0x29f5('0x2f')](_0x405b9a)['end']();};}function respondWithResult(_0x5ad4ab,_0xd7d216){_0xd7d216=_0xd7d216||0xc8;return function(_0x5d6f37){if(_0x5d6f37){return _0x5ad4ab[_0x29f5('0x2f')](_0xd7d216)['json'](_0x5d6f37);}};}function respondWithFilteredResult(_0x3e241c,_0x3b25f2){return function(_0x34d46d){if(_0x34d46d){var _0x218c20=_0x34d46d[_0x29f5('0x30')],_0x35548c=_0x3b25f2[_0x29f5('0x31')],_0x32a655=_0x3b25f2[_0x29f5('0x31')]+_0x3b25f2['limit'],_0x254444;if(_0x32a655>=_0x218c20){_0x32a655=_0x218c20;_0x254444=0xc8;}else{_0x254444=0xce;}_0x3e241c[_0x29f5('0x2f')](_0x254444);return _0x3e241c[_0x29f5('0x32')](_0x29f5('0x33'),_0x35548c+'-'+_0x32a655+'/'+_0x218c20)[_0x29f5('0x34')](_0x34d46d);}return null;};}function patchUpdates(_0x5b67ea){return function(_0x5800fb){try{jsonpatch[_0x29f5('0x35')](_0x5800fb,_0x5b67ea,!![]);}catch(_0x394069){return BPromise[_0x29f5('0x36')](_0x394069);}return _0x5800fb[_0x29f5('0x37')]();};}function saveUpdates(_0x566746,_0xc193ef){return function(_0x3cfb46){if(_0x3cfb46){return _0x3cfb46[_0x29f5('0x38')](_0x566746)[_0x29f5('0x25')](function(_0x1451a7){return _0x1451a7;});}return null;};}function removeEntity(_0x557e6e,_0x2d3f33){return function(_0x2f5d62){if(_0x2f5d62){return _0x2f5d62[_0x29f5('0x39')]()[_0x29f5('0x25')](function(){_0x557e6e[_0x29f5('0x2f')](0xcc)[_0x29f5('0x3a')]();});}};}function handleEntityNotFound(_0x174905,_0x3ea822){return function(_0xc3e4a7){if(!_0xc3e4a7){_0x174905['sendStatus'](0x194);}return _0xc3e4a7;};}function handleError(_0x3db514,_0x3d066a){_0x3d066a=_0x3d066a||0x1f4;return function(_0x2f5c7b){logger[_0x29f5('0x2b')](_0x2f5c7b[_0x29f5('0x3b')]);if(_0x2f5c7b['name']){delete _0x2f5c7b[_0x29f5('0x3c')];}_0x3db514[_0x29f5('0x2f')](_0x3d066a)[_0x29f5('0x3d')](_0x2f5c7b);};}exports[_0x29f5('0x3e')]=function(_0xc6939b,_0x17d77f){var _0x303e3c={},_0x30cb26={},_0x13956f={'count':0x0,'rows':[]};var _0x1d7d58=_[_0x29f5('0x3f')](db[_0x29f5('0x40')][_0x29f5('0x41')],function(_0x42a790){return{'name':_0x42a790['fieldName'],'type':_0x42a790[_0x29f5('0x42')][_0x29f5('0x43')]};});_0x30cb26[_0x29f5('0x44')]=_[_0x29f5('0x3f')](_0x1d7d58,'name');_0x30cb26[_0x29f5('0x45')]=_[_0x29f5('0x46')](_0xc6939b[_0x29f5('0x45')]);_0x30cb26['filters']=_[_0x29f5('0x47')](_0x30cb26[_0x29f5('0x44')],_0x30cb26['query']);_0x303e3c['attributes']=_[_0x29f5('0x47')](_0x30cb26['model'],qs[_0x29f5('0x48')](_0xc6939b[_0x29f5('0x45')][_0x29f5('0x48')]));_0x303e3c[_0x29f5('0x49')]=_0x303e3c[_0x29f5('0x49')][_0x29f5('0x4a')]?_0x303e3c[_0x29f5('0x49')]:_0x30cb26[_0x29f5('0x44')];if(!_0xc6939b['query'][_0x29f5('0x4b')](_0x29f5('0x4c'))){_0x303e3c[_0x29f5('0x4d')]=qs['limit'](_0xc6939b['query'][_0x29f5('0x4d')]);_0x303e3c['offset']=qs[_0x29f5('0x31')](_0xc6939b['query'][_0x29f5('0x31')]);}_0x303e3c[_0x29f5('0x4e')]=qs[_0x29f5('0x4f')](_0xc6939b[_0x29f5('0x45')][_0x29f5('0x4f')]);_0x303e3c[_0x29f5('0x50')]=qs[_0x29f5('0x51')](_['pick'](_0xc6939b[_0x29f5('0x45')],_0x30cb26[_0x29f5('0x51')]),_0x1d7d58);if(_0xc6939b[_0x29f5('0x45')][_0x29f5('0x52')]){_0x303e3c[_0x29f5('0x50')]=_[_0x29f5('0x53')](_0x303e3c['where'],{'$or':_[_0x29f5('0x3f')](_0x1d7d58,function(_0x554fad){if(_0x554fad[_0x29f5('0x42')]!==_0x29f5('0x54')){var _0x2c4717={};_0x2c4717[_0x554fad['name']]={'$like':'%'+_0xc6939b[_0x29f5('0x45')][_0x29f5('0x52')]+'%'};return _0x2c4717;}})});}_0x303e3c=_[_0x29f5('0x53')]({},_0x303e3c,_0xc6939b[_0x29f5('0x55')]);var _0x427023={'where':_0x303e3c[_0x29f5('0x50')]};return db[_0x29f5('0x40')][_0x29f5('0x30')](_0x427023)[_0x29f5('0x25')](function(_0x5ad2ca){_0x13956f['count']=_0x5ad2ca;if(_0xc6939b['query'][_0x29f5('0x56')]){_0x303e3c['include']=[{'all':!![]}];}return db[_0x29f5('0x40')][_0x29f5('0x57')](_0x303e3c);})[_0x29f5('0x25')](function(_0x4e0139){_0x13956f[_0x29f5('0x58')]=_0x4e0139;return _0x13956f;})[_0x29f5('0x25')](respondWithFilteredResult(_0x17d77f,_0x303e3c))[_0x29f5('0x2e')](handleError(_0x17d77f,null));};exports['show']=function(_0x3457cd,_0x43bb6a){var _0xd4108b={'raw':!![],'where':{'id':_0x3457cd[_0x29f5('0x59')]['id']}},_0x4b50af={};_0x4b50af[_0x29f5('0x44')]=_['keys'](db[_0x29f5('0x40')][_0x29f5('0x41')]);_0x4b50af[_0x29f5('0x45')]=_[_0x29f5('0x46')](_0x3457cd['query']);_0x4b50af[_0x29f5('0x51')]=_[_0x29f5('0x47')](_0x4b50af[_0x29f5('0x44')],_0x4b50af[_0x29f5('0x45')]);_0xd4108b['attributes']=_[_0x29f5('0x47')](_0x4b50af[_0x29f5('0x44')],qs[_0x29f5('0x48')](_0x3457cd[_0x29f5('0x45')][_0x29f5('0x48')]));_0xd4108b['attributes']=_0xd4108b[_0x29f5('0x49')][_0x29f5('0x4a')]?_0xd4108b[_0x29f5('0x49')]:_0x4b50af[_0x29f5('0x44')];if(_0x3457cd[_0x29f5('0x45')]['includeAll']){_0xd4108b[_0x29f5('0x5a')]=[{'all':!![]}];}_0xd4108b=_[_0x29f5('0x53')]({},_0xd4108b,_0x3457cd[_0x29f5('0x55')]);return db[_0x29f5('0x40')][_0x29f5('0x5b')](_0xd4108b)[_0x29f5('0x25')](handleEntityNotFound(_0x43bb6a,null))[_0x29f5('0x25')](respondWithResult(_0x43bb6a,null))[_0x29f5('0x2e')](handleError(_0x43bb6a,null));};exports[_0x29f5('0x5c')]=function(_0x54547e,_0x57b36b){return db[_0x29f5('0x40')][_0x29f5('0x5c')](_0x54547e[_0x29f5('0x5d')],{})[_0x29f5('0x25')](respondWithResult(_0x57b36b,0xc9))[_0x29f5('0x2e')](handleError(_0x57b36b,null));};exports[_0x29f5('0x38')]=function(_0x51c3ef,_0x559a42){if(_0x51c3ef[_0x29f5('0x5d')]['id']){delete _0x51c3ef[_0x29f5('0x5d')]['id'];}return db['ChatGroup'][_0x29f5('0x5b')]({'where':{'id':_0x51c3ef['params']['id']}})[_0x29f5('0x25')](handleEntityNotFound(_0x559a42,null))['then'](saveUpdates(_0x51c3ef[_0x29f5('0x5d')],null))[_0x29f5('0x25')](respondWithResult(_0x559a42,null))[_0x29f5('0x2e')](handleError(_0x559a42,null));};exports[_0x29f5('0x39')]=function(_0x1ce41a,_0x861c22){return db['ChatGroup'][_0x29f5('0x5b')]({'where':{'id':_0x1ce41a[_0x29f5('0x59')]['id']}})['then'](handleEntityNotFound(_0x861c22,null))[_0x29f5('0x25')](removeEntity(_0x861c22,null))[_0x29f5('0x2e')](handleError(_0x861c22,null));};exports[_0x29f5('0x5e')]=function(_0x4a2a23,_0x2b5830){return db[_0x29f5('0x40')][_0x29f5('0x5e')]()[_0x29f5('0x25')](respondWithResult(_0x2b5830,null))[_0x29f5('0x2e')](handleError(_0x2b5830,null));};exports[_0x29f5('0x5f')]=function(_0x38da23,_0x4c2edc,_0x5c51ce){return db[_0x29f5('0x60')][_0x29f5('0x30')]({'where':{'ChatGroupId':_0x38da23['params']['id'],'ToId':_0x38da23[_0x29f5('0x61')]['id'],'read':![]}})[_0x29f5('0x25')](function(_0x4eaaa9){return{'id':_[_0x29f5('0x62')](_0x38da23[_0x29f5('0x59')]['id']),'count':_0x4eaaa9};})['then'](respondWithResult(_0x4c2edc,null))[_0x29f5('0x2e')](handleError(_0x4c2edc,null));};exports[_0x29f5('0x63')]=function(_0x7a42b8,_0x150b1d,_0x26827c){return db[_0x29f5('0x40')][_0x29f5('0x5b')]({'where':{'id':_0x7a42b8[_0x29f5('0x59')]['id']}})[_0x29f5('0x25')](handleEntityNotFound(_0x150b1d,null))['then'](function(_0x413e0b){if(_0x413e0b){return _0x413e0b[_0x29f5('0x63')](_0x7a42b8[_0x29f5('0x5d')][_0x29f5('0x64')],_['omit'](_0x7a42b8[_0x29f5('0x5d')],['ids','id'])||{});}})['then'](respondWithResult(_0x150b1d,null))[_0x29f5('0x2e')](handleError(_0x150b1d,null));};exports[_0x29f5('0x65')]=function(_0x7cc38c,_0x334e32,_0x533c91){var _0x5cac14={};var _0x1aab30={};var _0x10cb12;var _0x4ad750;return db[_0x29f5('0x40')][_0x29f5('0x66')]({'where':{'id':_0x7cc38c[_0x29f5('0x59')]['id']}})[_0x29f5('0x25')](handleEntityNotFound(_0x334e32,null))[_0x29f5('0x25')](function(_0x26231c){if(_0x26231c){_0x10cb12=_0x26231c;_0x1aab30[_0x29f5('0x44')]=_['keys'](db['User']['rawAttributes']);_0x1aab30[_0x29f5('0x45')]=_['keys'](_0x7cc38c[_0x29f5('0x45')]);_0x1aab30[_0x29f5('0x51')]=_[_0x29f5('0x47')](_0x1aab30[_0x29f5('0x44')],_0x1aab30[_0x29f5('0x45')]);_0x5cac14[_0x29f5('0x49')]=_[_0x29f5('0x47')](_0x1aab30[_0x29f5('0x44')],qs[_0x29f5('0x48')](_0x7cc38c[_0x29f5('0x45')]['fields']));_0x5cac14[_0x29f5('0x49')]=_0x5cac14[_0x29f5('0x49')][_0x29f5('0x4a')]?_0x5cac14[_0x29f5('0x49')]:_0x1aab30[_0x29f5('0x44')];_0x5cac14[_0x29f5('0x4e')]=qs[_0x29f5('0x4f')](_0x7cc38c[_0x29f5('0x45')][_0x29f5('0x4f')]);_0x5cac14[_0x29f5('0x50')]=qs[_0x29f5('0x51')](_['pick'](_0x7cc38c[_0x29f5('0x45')],_0x1aab30[_0x29f5('0x51')]));if(_0x7cc38c[_0x29f5('0x45')][_0x29f5('0x52')]){_0x5cac14['where']=_[_0x29f5('0x53')](_0x5cac14['where'],{'$or':_[_0x29f5('0x3f')](_0x5cac14['attributes'],function(_0x2b3103){var _0x411642={};_0x411642[_0x2b3103]={'$like':'%'+_0x7cc38c[_0x29f5('0x45')][_0x29f5('0x52')]+'%'};return _0x411642;})});}_0x5cac14=_[_0x29f5('0x53')]({},_0x5cac14,_0x7cc38c[_0x29f5('0x55')]);return _0x10cb12[_0x29f5('0x65')](_0x5cac14);}})['then'](function(_0x19fd6b){if(_0x19fd6b){_0x4ad750=_0x19fd6b[_0x29f5('0x4a')];if(!_0x7cc38c[_0x29f5('0x45')][_0x29f5('0x4b')](_0x29f5('0x4c'))){_0x5cac14[_0x29f5('0x4d')]=qs[_0x29f5('0x4d')](_0x7cc38c[_0x29f5('0x45')]['limit']);_0x5cac14[_0x29f5('0x31')]=qs[_0x29f5('0x31')](_0x7cc38c[_0x29f5('0x45')]['offset']);}return _0x10cb12[_0x29f5('0x65')](_0x5cac14);}})[_0x29f5('0x25')](function(_0x3ebd60){if(_0x3ebd60){return _0x3ebd60?{'count':_0x4ad750,'rows':_0x3ebd60}:null;}})[_0x29f5('0x25')](respondWithResult(_0x334e32,null))[_0x29f5('0x2e')](handleError(_0x334e32,null));};exports['removeMembers']=function(_0x4270b1,_0x50eaee,_0x3e9eec){return db[_0x29f5('0x40')][_0x29f5('0x5b')]({'where':{'id':_0x4270b1[_0x29f5('0x59')]['id']}})[_0x29f5('0x25')](handleEntityNotFound(_0x50eaee,null))[_0x29f5('0x25')](function(_0x57f68d){if(_0x57f68d){return _0x57f68d[_0x29f5('0x67')](_0x4270b1['query'][_0x29f5('0x64')]);}})['then'](respondWithStatusCode(_0x50eaee,null))[_0x29f5('0x2e')](handleError(_0x50eaee,null));};exports['addMessage']=function(_0x7c05e9,_0x5853c8,_0x25d013){if(_0x7c05e9[_0x29f5('0x5d')]['id']){delete _0x7c05e9[_0x29f5('0x5d')]['id'];}return db[_0x29f5('0x40')]['find']({'where':{'id':_0x7c05e9[_0x29f5('0x59')]['id']}})[_0x29f5('0x25')](handleEntityNotFound(_0x5853c8,null))[_0x29f5('0x25')](function(_0x4a6916){if(_0x4a6916){_0x7c05e9[_0x29f5('0x5d')][_0x29f5('0x68')]=_0x4a6916['id'];return db[_0x29f5('0x60')][_0x29f5('0x5c')](_0x7c05e9['body']);}})['then'](respondWithResult(_0x5853c8,null))[_0x29f5('0x2e')](handleError(_0x5853c8,null));};exports[_0x29f5('0x69')]=function(_0x519a52,_0x28c58e,_0x21de2a){var _0x25c630={};var _0x25a890={};var _0x358446;var _0x5d7dce;return db[_0x29f5('0x40')][_0x29f5('0x66')]({'where':{'id':_0x519a52['params']['id']}})['then'](handleEntityNotFound(_0x28c58e,null))[_0x29f5('0x25')](function(_0x228994){if(_0x228994){_0x358446=_0x228994;_0x25a890[_0x29f5('0x44')]=_['keys'](db[_0x29f5('0x60')][_0x29f5('0x41')]);_0x25a890[_0x29f5('0x45')]=_[_0x29f5('0x46')](_0x519a52['query']);_0x25a890[_0x29f5('0x51')]=_['intersection'](_0x25a890[_0x29f5('0x44')],_0x25a890[_0x29f5('0x45')]);_0x25c630['attributes']=_[_0x29f5('0x47')](_0x25a890['model'],qs['fields'](_0x519a52[_0x29f5('0x45')][_0x29f5('0x48')]));_0x25c630[_0x29f5('0x49')]=_0x25c630[_0x29f5('0x49')]['length']?_0x25c630[_0x29f5('0x49')]:_0x25a890[_0x29f5('0x44')];_0x25c630[_0x29f5('0x4e')]=qs[_0x29f5('0x4f')](_0x519a52[_0x29f5('0x45')][_0x29f5('0x4f')]);_0x25c630[_0x29f5('0x50')]=qs['filters'](_[_0x29f5('0x6a')](_0x519a52[_0x29f5('0x45')],_0x25a890[_0x29f5('0x51')]));if(_0x519a52['query'][_0x29f5('0x52')]){_0x25c630[_0x29f5('0x50')]=_['merge'](_0x25c630[_0x29f5('0x50')],{'$or':_['map'](_0x25c630[_0x29f5('0x49')],function(_0x441293){var _0x408a8a={};_0x408a8a[_0x441293]={'$like':'%'+_0x519a52['query'][_0x29f5('0x52')]+'%'};return _0x408a8a;})});}if(_0x519a52[_0x29f5('0x45')]['$gte']){var _0x5b82b5=_0x519a52['query'][_0x29f5('0x6b')]['split'](',');var _0x2ccf63={};_0x2ccf63[_0x5b82b5[0x0]]={'$gte':moment(_0x5b82b5[0x1])['format'](_0x29f5('0x6c'))};_0x25c630[_0x29f5('0x50')]=_[_0x29f5('0x53')](_0x25c630[_0x29f5('0x50')],_0x2ccf63);}_0x25c630=_['merge']({},_0x25c630,_0x519a52[_0x29f5('0x55')]);return _0x358446['getMessages'](_0x25c630);}})[_0x29f5('0x25')](function(_0x45eb62){if(_0x45eb62){_0x5d7dce=_0x45eb62['length'];if(!_0x519a52[_0x29f5('0x45')][_0x29f5('0x4b')](_0x29f5('0x4c'))){_0x25c630[_0x29f5('0x4d')]=qs['limit'](_0x519a52['query'][_0x29f5('0x4d')]);_0x25c630[_0x29f5('0x31')]=qs['offset'](_0x519a52[_0x29f5('0x45')][_0x29f5('0x31')]);}return _0x358446['getMessages'](_0x25c630);}})[_0x29f5('0x25')](function(_0x49f18e){if(_0x49f18e){return _0x49f18e?{'count':_0x5d7dce,'rows':_0x49f18e}:null;}})[_0x29f5('0x25')](respondWithResult(_0x28c58e,null))[_0x29f5('0x2e')](handleError(_0x28c58e,null));};
\ No newline at end of file
+var _0xeeab=['ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','rimraf','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','offset','set','json','apply','reject','save','update','destroy','stack','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','name','options','count','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','ids','omit','getMembers','findOne','pick','addMessage'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xeeab,0x1b1));var _0xbeea=function(_0x30a0bf,_0x2815fa){_0x30a0bf=_0x30a0bf-0x0;var _0x34f403=_0xeeab[_0x30a0bf];return _0x34f403;};'use strict';var pdf=require(_0xbeea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbeea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbeea('0x2'));var Mustache=require(_0xbeea('0x3'));var util=require(_0xbeea('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xbeea('0x5'));var ejs=require(_0xbeea('0x6'));var fs=require('fs');var _=require(_0xbeea('0x7'));var squel=require(_0xbeea('0x8'));var crypto=require('crypto');var jsforce=require(_0xbeea('0x9'));var deskjs=require(_0xbeea('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbeea('0xb'));var Papa=require(_0xbeea('0xc'));var Redis=require(_0xbeea('0xd'));var authService=require(_0xbeea('0xe'));var qs=require(_0xbeea('0xf'));var as=require(_0xbeea('0x10'));var hardwareService=require(_0xbeea('0x11'));var logger=require(_0xbeea('0x12'))(_0xbeea('0x13'));var utils=require('../../config/utils');var config=require(_0xbeea('0x14'));var db=require(_0xbeea('0x15'))['db'];config[_0xbeea('0x16')]=_[_0xbeea('0x17')](config[_0xbeea('0x16')],{'host':_0xbeea('0x18'),'port':0x18eb});var socket=require(_0xbeea('0x19'))(new Redis(config[_0xbeea('0x16')]));require(_0xbeea('0x1a'))[_0xbeea('0x1b')](socket);var jayson=require(_0xbeea('0x1c'));var client=jayson['client'][_0xbeea('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1de161,_0x26b696,_0x10757d){if(_0x10757d){var _0x464b05=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x464b05['test'](_0x26b696)){return _0x1de161;}else{throw new db[(_0xbeea('0x1e'))][(_0xbeea('0x1f'))](_0xbeea('0x20'));}}else{return _0x1de161;}}function respondWithRpcPromise(_0x2769fe,_0x24aff7,_0x5ab598,_0x57cfea){return new BPromise(function(_0x48a1ff,_0x331205){var _0x4f8e79=_0x57cfea||client;return _0x4f8e79[_0xbeea('0x21')](_0x2769fe,_0x5ab598)[_0xbeea('0x22')](function(_0x3b14cf){logger['info'](_0xbeea('0x23'),_0x24aff7,_0xbeea('0x24'));logger[_0xbeea('0x25')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x24aff7,'request\x20sent',JSON[_0xbeea('0x26')](_0x3b14cf));if(_0x3b14cf[_0xbeea('0x27')]){if(_0x3b14cf[_0xbeea('0x27')][_0xbeea('0x28')]===0x1f4){logger[_0xbeea('0x27')]('ChatGroup,\x20%s,\x20%s',_0x24aff7,_0x3b14cf[_0xbeea('0x27')][_0xbeea('0x29')]);return _0x331205(_0x3b14cf['error'][_0xbeea('0x29')]);}logger[_0xbeea('0x27')](_0xbeea('0x23'),_0x24aff7,_0x3b14cf[_0xbeea('0x27')][_0xbeea('0x29')]);return _0x48a1ff(_0x3b14cf['error'][_0xbeea('0x29')]);}else{logger['info'](_0xbeea('0x23'),_0x24aff7,_0xbeea('0x24'));_0x48a1ff(_0x3b14cf[_0xbeea('0x2a')][_0xbeea('0x29')]);}})['catch'](function(_0x285e1a){logger[_0xbeea('0x27')](_0xbeea('0x23'),_0x24aff7,_0x285e1a);_0x331205(_0x285e1a);});});}function respondWithStatusCode(_0x44f85c,_0x16f994){_0x16f994=_0x16f994||0xcc;return function(_0x373b26){if(_0x373b26){return _0x44f85c[_0xbeea('0x2b')](_0x16f994);}return _0x44f85c[_0xbeea('0x2c')](_0x16f994)[_0xbeea('0x2d')]();};}function respondWithResult(_0x3bd4f8,_0x1e38c4){_0x1e38c4=_0x1e38c4||0xc8;return function(_0x334e3f){if(_0x334e3f){return _0x3bd4f8[_0xbeea('0x2c')](_0x1e38c4)['json'](_0x334e3f);}};}function respondWithFilteredResult(_0xad8258,_0xaf248c){return function(_0x1bb8e6){if(_0x1bb8e6){var _0x15b21e=_0x1bb8e6['count'],_0x5d0662=_0xaf248c[_0xbeea('0x2e')],_0x4ebb72=_0xaf248c[_0xbeea('0x2e')]+_0xaf248c['limit'],_0x488dc6;if(_0x4ebb72>=_0x15b21e){_0x4ebb72=_0x15b21e;_0x488dc6=0xc8;}else{_0x488dc6=0xce;}_0xad8258['status'](_0x488dc6);return _0xad8258[_0xbeea('0x2f')]('Content-Range',_0x5d0662+'-'+_0x4ebb72+'/'+_0x15b21e)[_0xbeea('0x30')](_0x1bb8e6);}return null;};}function patchUpdates(_0x289ed8){return function(_0x1eff5c){try{jsonpatch[_0xbeea('0x31')](_0x1eff5c,_0x289ed8,!![]);}catch(_0x5d17a6){return BPromise[_0xbeea('0x32')](_0x5d17a6);}return _0x1eff5c[_0xbeea('0x33')]();};}function saveUpdates(_0x1c1746,_0x555590){return function(_0x25ae08){if(_0x25ae08){return _0x25ae08[_0xbeea('0x34')](_0x1c1746)['then'](function(_0x52ba43){return _0x52ba43;});}return null;};}function removeEntity(_0x59bea1,_0x967528){return function(_0x19d9a2){if(_0x19d9a2){return _0x19d9a2[_0xbeea('0x35')]()[_0xbeea('0x22')](function(){_0x59bea1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x822179,_0x56109a){return function(_0x22cb30){if(!_0x22cb30){_0x822179[_0xbeea('0x2b')](0x194);}return _0x22cb30;};}function handleError(_0x1cdd07,_0x58e6bd){_0x58e6bd=_0x58e6bd||0x1f4;return function(_0x348a56){logger[_0xbeea('0x27')](_0x348a56[_0xbeea('0x36')]);if(_0x348a56['name']){delete _0x348a56['name'];}_0x1cdd07[_0xbeea('0x2c')](_0x58e6bd)['send'](_0x348a56);};}exports[_0xbeea('0x37')]=function(_0x200be3,_0x5946dd){var _0x5310e4={},_0x305882={},_0x451472={'count':0x0,'rows':[]};var _0x4fe154=_[_0xbeea('0x38')](db[_0xbeea('0x39')][_0xbeea('0x3a')],function(_0x366dc6){return{'name':_0x366dc6[_0xbeea('0x3b')],'type':_0x366dc6[_0xbeea('0x3c')]['key']};});_0x305882[_0xbeea('0x3d')]=_[_0xbeea('0x38')](_0x4fe154,'name');_0x305882[_0xbeea('0x3e')]=_[_0xbeea('0x3f')](_0x200be3['query']);_0x305882[_0xbeea('0x40')]=_[_0xbeea('0x41')](_0x305882[_0xbeea('0x3d')],_0x305882[_0xbeea('0x3e')]);_0x5310e4[_0xbeea('0x42')]=_[_0xbeea('0x41')](_0x305882[_0xbeea('0x3d')],qs[_0xbeea('0x43')](_0x200be3[_0xbeea('0x3e')]['fields']));_0x5310e4[_0xbeea('0x42')]=_0x5310e4['attributes']['length']?_0x5310e4['attributes']:_0x305882['model'];if(!_0x200be3[_0xbeea('0x3e')][_0xbeea('0x44')](_0xbeea('0x45'))){_0x5310e4[_0xbeea('0x46')]=qs[_0xbeea('0x46')](_0x200be3['query'][_0xbeea('0x46')]);_0x5310e4[_0xbeea('0x2e')]=qs[_0xbeea('0x2e')](_0x200be3[_0xbeea('0x3e')][_0xbeea('0x2e')]);}_0x5310e4[_0xbeea('0x47')]=qs[_0xbeea('0x48')](_0x200be3[_0xbeea('0x3e')]['sort']);_0x5310e4[_0xbeea('0x49')]=qs['filters'](_['pick'](_0x200be3[_0xbeea('0x3e')],_0x305882[_0xbeea('0x40')]),_0x4fe154);if(_0x200be3[_0xbeea('0x3e')][_0xbeea('0x4a')]){_0x5310e4[_0xbeea('0x49')]=_[_0xbeea('0x4b')](_0x5310e4[_0xbeea('0x49')],{'$or':_['map'](_0x4fe154,function(_0x30a8d0){if(_0x30a8d0['type']!==_0xbeea('0x4c')){var _0x19023e={};_0x19023e[_0x30a8d0[_0xbeea('0x4d')]]={'$like':'%'+_0x200be3['query']['filter']+'%'};return _0x19023e;}})});}_0x5310e4=_[_0xbeea('0x4b')]({},_0x5310e4,_0x200be3[_0xbeea('0x4e')]);var _0xd9c69c={'where':_0x5310e4[_0xbeea('0x49')]};return db[_0xbeea('0x39')][_0xbeea('0x4f')](_0xd9c69c)[_0xbeea('0x22')](function(_0x2b5f55){_0x451472[_0xbeea('0x4f')]=_0x2b5f55;if(_0x200be3[_0xbeea('0x3e')][_0xbeea('0x50')]){_0x5310e4[_0xbeea('0x51')]=[{'all':!![]}];}return db[_0xbeea('0x39')][_0xbeea('0x52')](_0x5310e4);})['then'](function(_0x291b5f){_0x451472[_0xbeea('0x53')]=_0x291b5f;return _0x451472;})['then'](respondWithFilteredResult(_0x5946dd,_0x5310e4))['catch'](handleError(_0x5946dd,null));};exports[_0xbeea('0x54')]=function(_0x198b1b,_0x4880b1){var _0x20dd20={'raw':!![],'where':{'id':_0x198b1b['params']['id']}},_0x843400={};_0x843400[_0xbeea('0x3d')]=_['keys'](db['ChatGroup'][_0xbeea('0x3a')]);_0x843400['query']=_[_0xbeea('0x3f')](_0x198b1b[_0xbeea('0x3e')]);_0x843400[_0xbeea('0x40')]=_[_0xbeea('0x41')](_0x843400['model'],_0x843400[_0xbeea('0x3e')]);_0x20dd20[_0xbeea('0x42')]=_[_0xbeea('0x41')](_0x843400[_0xbeea('0x3d')],qs[_0xbeea('0x43')](_0x198b1b[_0xbeea('0x3e')][_0xbeea('0x43')]));_0x20dd20[_0xbeea('0x42')]=_0x20dd20[_0xbeea('0x42')][_0xbeea('0x55')]?_0x20dd20[_0xbeea('0x42')]:_0x843400[_0xbeea('0x3d')];if(_0x198b1b[_0xbeea('0x3e')][_0xbeea('0x50')]){_0x20dd20[_0xbeea('0x51')]=[{'all':!![]}];}_0x20dd20=_[_0xbeea('0x4b')]({},_0x20dd20,_0x198b1b[_0xbeea('0x4e')]);return db[_0xbeea('0x39')][_0xbeea('0x56')](_0x20dd20)[_0xbeea('0x22')](handleEntityNotFound(_0x4880b1,null))['then'](respondWithResult(_0x4880b1,null))[_0xbeea('0x57')](handleError(_0x4880b1,null));};exports['create']=function(_0x13bc72,_0x561a03){return db[_0xbeea('0x39')][_0xbeea('0x58')](_0x13bc72[_0xbeea('0x59')],{})[_0xbeea('0x22')](respondWithResult(_0x561a03,0xc9))[_0xbeea('0x57')](handleError(_0x561a03,null));};exports[_0xbeea('0x34')]=function(_0x455cf7,_0x346ca0){if(_0x455cf7['body']['id']){delete _0x455cf7[_0xbeea('0x59')]['id'];}return db[_0xbeea('0x39')][_0xbeea('0x56')]({'where':{'id':_0x455cf7[_0xbeea('0x5a')]['id']}})[_0xbeea('0x22')](handleEntityNotFound(_0x346ca0,null))[_0xbeea('0x22')](saveUpdates(_0x455cf7[_0xbeea('0x59')],null))[_0xbeea('0x22')](respondWithResult(_0x346ca0,null))['catch'](handleError(_0x346ca0,null));};exports['destroy']=function(_0x5d8f18,_0xf10d3){return db[_0xbeea('0x39')][_0xbeea('0x56')]({'where':{'id':_0x5d8f18[_0xbeea('0x5a')]['id']}})[_0xbeea('0x22')](handleEntityNotFound(_0xf10d3,null))['then'](removeEntity(_0xf10d3,null))[_0xbeea('0x57')](handleError(_0xf10d3,null));};exports['describe']=function(_0x28507a,_0x4f499f){return db[_0xbeea('0x39')][_0xbeea('0x5b')]()[_0xbeea('0x22')](respondWithResult(_0x4f499f,null))['catch'](handleError(_0x4f499f,null));};exports[_0xbeea('0x5c')]=function(_0x363de7,_0x12d20c,_0x3908f5){return db[_0xbeea('0x5d')][_0xbeea('0x4f')]({'where':{'ChatGroupId':_0x363de7[_0xbeea('0x5a')]['id'],'ToId':_0x363de7[_0xbeea('0x5e')]['id'],'read':![]}})[_0xbeea('0x22')](function(_0x3effc3){return{'id':_[_0xbeea('0x5f')](_0x363de7[_0xbeea('0x5a')]['id']),'count':_0x3effc3};})[_0xbeea('0x22')](respondWithResult(_0x12d20c,null))['catch'](handleError(_0x12d20c,null));};exports['addMembers']=function(_0x4938db,_0x173943,_0xf77d29){return db['ChatGroup'][_0xbeea('0x56')]({'where':{'id':_0x4938db[_0xbeea('0x5a')]['id']}})[_0xbeea('0x22')](handleEntityNotFound(_0x173943,null))['then'](function(_0x49793d){if(_0x49793d){return _0x49793d['addMembers'](_0x4938db[_0xbeea('0x59')][_0xbeea('0x60')],_[_0xbeea('0x61')](_0x4938db[_0xbeea('0x59')],[_0xbeea('0x60'),'id'])||{});}})['then'](respondWithResult(_0x173943,null))[_0xbeea('0x57')](handleError(_0x173943,null));};exports[_0xbeea('0x62')]=function(_0x55d3d2,_0x79c9cd,_0x3375fa){var _0xe05491={};var _0x3b705e={};var _0x1d214b;var _0x5e940b;return db['ChatGroup'][_0xbeea('0x63')]({'where':{'id':_0x55d3d2[_0xbeea('0x5a')]['id']}})[_0xbeea('0x22')](handleEntityNotFound(_0x79c9cd,null))[_0xbeea('0x22')](function(_0x1c3399){if(_0x1c3399){_0x1d214b=_0x1c3399;_0x3b705e['model']=_['keys'](db['User']['rawAttributes']);_0x3b705e['query']=_[_0xbeea('0x3f')](_0x55d3d2[_0xbeea('0x3e')]);_0x3b705e[_0xbeea('0x40')]=_[_0xbeea('0x41')](_0x3b705e['model'],_0x3b705e[_0xbeea('0x3e')]);_0xe05491[_0xbeea('0x42')]=_['intersection'](_0x3b705e[_0xbeea('0x3d')],qs[_0xbeea('0x43')](_0x55d3d2[_0xbeea('0x3e')][_0xbeea('0x43')]));_0xe05491['attributes']=_0xe05491[_0xbeea('0x42')]['length']?_0xe05491['attributes']:_0x3b705e[_0xbeea('0x3d')];_0xe05491[_0xbeea('0x47')]=qs[_0xbeea('0x48')](_0x55d3d2[_0xbeea('0x3e')][_0xbeea('0x48')]);_0xe05491[_0xbeea('0x49')]=qs[_0xbeea('0x40')](_[_0xbeea('0x64')](_0x55d3d2[_0xbeea('0x3e')],_0x3b705e[_0xbeea('0x40')]));if(_0x55d3d2[_0xbeea('0x3e')][_0xbeea('0x4a')]){_0xe05491[_0xbeea('0x49')]=_[_0xbeea('0x4b')](_0xe05491[_0xbeea('0x49')],{'$or':_[_0xbeea('0x38')](_0xe05491[_0xbeea('0x42')],function(_0x562c0b){var _0x590b4f={};_0x590b4f[_0x562c0b]={'$like':'%'+_0x55d3d2['query'][_0xbeea('0x4a')]+'%'};return _0x590b4f;})});}_0xe05491=_[_0xbeea('0x4b')]({},_0xe05491,_0x55d3d2[_0xbeea('0x4e')]);return _0x1d214b[_0xbeea('0x62')](_0xe05491);}})[_0xbeea('0x22')](function(_0xda6c4d){if(_0xda6c4d){_0x5e940b=_0xda6c4d['length'];if(!_0x55d3d2['query'][_0xbeea('0x44')]('nolimit')){_0xe05491[_0xbeea('0x46')]=qs[_0xbeea('0x46')](_0x55d3d2[_0xbeea('0x3e')][_0xbeea('0x46')]);_0xe05491[_0xbeea('0x2e')]=qs[_0xbeea('0x2e')](_0x55d3d2[_0xbeea('0x3e')][_0xbeea('0x2e')]);}return _0x1d214b[_0xbeea('0x62')](_0xe05491);}})[_0xbeea('0x22')](function(_0x39ac9a){if(_0x39ac9a){return _0x39ac9a?{'count':_0x5e940b,'rows':_0x39ac9a}:null;}})[_0xbeea('0x22')](respondWithResult(_0x79c9cd,null))['catch'](handleError(_0x79c9cd,null));};exports['removeMembers']=function(_0x5f94d4,_0x3e100e,_0x4f7058){return db['ChatGroup']['find']({'where':{'id':_0x5f94d4['params']['id']}})[_0xbeea('0x22')](handleEntityNotFound(_0x3e100e,null))[_0xbeea('0x22')](function(_0xd9954e){if(_0xd9954e){return _0xd9954e['removeMembers'](_0x5f94d4[_0xbeea('0x3e')][_0xbeea('0x60')]);}})[_0xbeea('0x22')](respondWithStatusCode(_0x3e100e,null))[_0xbeea('0x57')](handleError(_0x3e100e,null));};exports[_0xbeea('0x65')]=function(_0xd2923b,_0x2716aa,_0x1f8f91){if(_0xd2923b[_0xbeea('0x59')]['id']){delete _0xd2923b['body']['id'];}return db[_0xbeea('0x39')][_0xbeea('0x56')]({'where':{'id':_0xd2923b[_0xbeea('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2716aa,null))[_0xbeea('0x22')](function(_0x14a7f6){if(_0x14a7f6){_0xd2923b[_0xbeea('0x59')][_0xbeea('0x66')]=_0x14a7f6['id'];return db[_0xbeea('0x5d')][_0xbeea('0x58')](_0xd2923b[_0xbeea('0x59')]);}})[_0xbeea('0x22')](respondWithResult(_0x2716aa,null))[_0xbeea('0x57')](handleError(_0x2716aa,null));};exports[_0xbeea('0x67')]=function(_0x2a68bf,_0x448547,_0x2181f3){var _0x2fd336={};var _0x4ca62e={};var _0x1273c0;var _0x319e28;return db[_0xbeea('0x39')][_0xbeea('0x63')]({'where':{'id':_0x2a68bf[_0xbeea('0x5a')]['id']}})[_0xbeea('0x22')](handleEntityNotFound(_0x448547,null))[_0xbeea('0x22')](function(_0x1a3139){if(_0x1a3139){_0x1273c0=_0x1a3139;_0x4ca62e['model']=_[_0xbeea('0x3f')](db[_0xbeea('0x5d')][_0xbeea('0x3a')]);_0x4ca62e[_0xbeea('0x3e')]=_['keys'](_0x2a68bf[_0xbeea('0x3e')]);_0x4ca62e[_0xbeea('0x40')]=_[_0xbeea('0x41')](_0x4ca62e['model'],_0x4ca62e[_0xbeea('0x3e')]);_0x2fd336['attributes']=_[_0xbeea('0x41')](_0x4ca62e[_0xbeea('0x3d')],qs[_0xbeea('0x43')](_0x2a68bf['query'][_0xbeea('0x43')]));_0x2fd336[_0xbeea('0x42')]=_0x2fd336[_0xbeea('0x42')][_0xbeea('0x55')]?_0x2fd336[_0xbeea('0x42')]:_0x4ca62e[_0xbeea('0x3d')];_0x2fd336[_0xbeea('0x47')]=qs[_0xbeea('0x48')](_0x2a68bf[_0xbeea('0x3e')][_0xbeea('0x48')]);_0x2fd336[_0xbeea('0x49')]=qs[_0xbeea('0x40')](_[_0xbeea('0x64')](_0x2a68bf[_0xbeea('0x3e')],_0x4ca62e[_0xbeea('0x40')]));if(_0x2a68bf[_0xbeea('0x3e')]['filter']){_0x2fd336['where']=_[_0xbeea('0x4b')](_0x2fd336[_0xbeea('0x49')],{'$or':_['map'](_0x2fd336['attributes'],function(_0x1c87b2){var _0x5ad0f1={};_0x5ad0f1[_0x1c87b2]={'$like':'%'+_0x2a68bf[_0xbeea('0x3e')][_0xbeea('0x4a')]+'%'};return _0x5ad0f1;})});}if(_0x2a68bf[_0xbeea('0x3e')][_0xbeea('0x68')]){var _0x2442a4=_0x2a68bf[_0xbeea('0x3e')][_0xbeea('0x68')]['split'](',');var _0x56ebd8={};_0x56ebd8[_0x2442a4[0x0]]={'$gte':moment(_0x2442a4[0x1])[_0xbeea('0x69')](_0xbeea('0x6a'))};_0x2fd336[_0xbeea('0x49')]=_[_0xbeea('0x4b')](_0x2fd336[_0xbeea('0x49')],_0x56ebd8);}_0x2fd336=_['merge']({},_0x2fd336,_0x2a68bf['options']);return _0x1273c0[_0xbeea('0x67')](_0x2fd336);}})[_0xbeea('0x22')](function(_0x1b384d){if(_0x1b384d){_0x319e28=_0x1b384d[_0xbeea('0x55')];if(!_0x2a68bf[_0xbeea('0x3e')][_0xbeea('0x44')]('nolimit')){_0x2fd336[_0xbeea('0x46')]=qs['limit'](_0x2a68bf[_0xbeea('0x3e')][_0xbeea('0x46')]);_0x2fd336[_0xbeea('0x2e')]=qs[_0xbeea('0x2e')](_0x2a68bf[_0xbeea('0x3e')][_0xbeea('0x2e')]);}return _0x1273c0[_0xbeea('0x67')](_0x2fd336);}})[_0xbeea('0x22')](function(_0x3a5eef){if(_0x3a5eef){return _0x3a5eef?{'count':_0x319e28,'rows':_0x3a5eef}:null;}})[_0xbeea('0x22')](respondWithResult(_0x448547,null))[_0xbeea('0x57')](handleError(_0x448547,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index b31c41b..33feed4 100644
--- a/server/api/chatGroup/chatGroup.events.js
+++ b/server/api/chatGroup/chatGroup.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['hasOwnProperty','hook','events','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x43c4ed,_0x68e4ef){var _0x86b993=function(_0xf143e4){while(--_0xf143e4){_0x43c4ed['push'](_0x43c4ed['shift']());}};_0x86b993(++_0x68e4ef);}(_0xb10b,0x12a));var _0xbb10=function(_0x312b2b,_0x2174f3){_0x312b2b=_0x312b2b-0x0;var _0x1d6a18=_0xb10b[_0x312b2b];return _0x1d6a18;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatGroupEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatGroupEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatGroup[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x39880e,_0xd551c8){var _0x33f879=function(_0x238be0){while(--_0x238be0){_0x39880e['push'](_0x39880e['shift']());}};_0x33f879(++_0xd551c8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x65f6('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){ChatGroupEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);ChatGroupEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index ca9d487..aa58d4b 100644
--- a/server/api/chatGroup/chatGroup.model.js
+++ b/server/api/chatGroup/chatGroup.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb46f=['request-promise','path','../../config/environment','exports','define','ChatGroup','lodash','util','api','moment','bluebird'];(function(_0x2881b0,_0x29b363){var _0x4203be=function(_0x3ba891){while(--_0x3ba891){_0x2881b0['push'](_0x2881b0['shift']());}};_0x4203be(++_0x29b363);}(_0xb46f,0xb6));var _0xfb46=function(_0x4f655b,_0x26c859){_0x4f655b=_0x4f655b-0x0;var _0x30ef13=_0xb46f[_0x4f655b];return _0x30ef13;};'use strict';var _=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var logger=require('../../config/logger')(_0xfb46('0x2'));var moment=require(_0xfb46('0x3'));var BPromise=require(_0xfb46('0x4'));var rp=require(_0xfb46('0x5'));var fs=require('fs');var path=require(_0xfb46('0x6'));var rimraf=require('rimraf');var config=require(_0xfb46('0x7'));var attributes=require('./chatGroup.attributes');module[_0xfb46('0x8')]=function(_0x3a5255,_0x186da6){return _0x3a5255[_0xfb46('0x9')](_0xfb46('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7278=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x20e8f9,_0x532adb){var _0x1224c0=function(_0xb2b5e9){while(--_0xb2b5e9){_0x20e8f9['push'](_0x20e8f9['shift']());}};_0x1224c0(++_0x532adb);}(_0x7278,0x161));var _0x8727=function(_0x6d6bea,_0x1e0dd5){_0x6d6bea=_0x6d6bea-0x0;var _0x3d2c2a=_0x7278[_0x6d6bea];return _0x3d2c2a;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));module[_0x8727('0xa')]=function(_0x180b71,_0x5549d5){return _0x180b71[_0x8727('0xb')](_0x8727('0xc'),attributes,{'tableName':_0x8727('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index e8d9296..f730e41 100644
--- a/server/api/chatGroup/chatGroup.rpc.js
+++ b/server/api/chatGroup/chatGroup.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf025=['../../config/utils','rpc','jayson/promise','client','http','defaults','localhost','redis','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1a6f23,_0x160f21){var _0x407a1d=function(_0x147587){while(--_0x147587){_0x1a6f23['push'](_0x1a6f23['shift']());}};_0x407a1d(++_0x160f21);}(_0xf025,0x1ba));var _0x5f02=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0xf025[_0x5f4cd7];return _0x47c93f;};'use strict';var _=require(_0x5f02('0x0'));var util=require(_0x5f02('0x1'));var moment=require(_0x5f02('0x2'));var BPromise=require(_0x5f02('0x3'));var rs=require(_0x5f02('0x4'));var fs=require('fs');var Redis=require(_0x5f02('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f02('0x6'));var logger=require('../../config/logger')(_0x5f02('0x7'));var config=require('../../config/environment');var jayson=require(_0x5f02('0x8'));var client=jayson[_0x5f02('0x9')][_0x5f02('0xa')]({'port':0x232a});config['redis']=_[_0x5f02('0xb')](config['redis'],{'host':_0x5f02('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5f02('0xd')]));require(_0x5f02('0xe'))[_0x5f02('0xf')](socket);function respondWithRpcPromise(_0x661047,_0x2541cc,_0xc2e2e0){return new BPromise(function(_0x1f4e41,_0x5581c6){return client[_0x5f02('0x10')](_0x661047,_0xc2e2e0)[_0x5f02('0x11')](function(_0x328e9c){logger[_0x5f02('0x12')](_0x5f02('0x13'),_0x2541cc,_0x5f02('0x14'));logger[_0x5f02('0x15')](_0x5f02('0x16'),_0x2541cc,_0x5f02('0x14'),JSON[_0x5f02('0x17')](_0x328e9c));if(_0x328e9c[_0x5f02('0x18')]){if(_0x328e9c[_0x5f02('0x18')]['code']===0x1f4){logger['error'](_0x5f02('0x13'),_0x2541cc,_0x328e9c['error']['message']);return _0x5581c6(_0x328e9c[_0x5f02('0x18')][_0x5f02('0x19')]);}logger['error'](_0x5f02('0x13'),_0x2541cc,_0x328e9c[_0x5f02('0x18')]['message']);return _0x1f4e41(_0x328e9c[_0x5f02('0x18')][_0x5f02('0x19')]);}else{logger[_0x5f02('0x12')](_0x5f02('0x13'),_0x2541cc,_0x5f02('0x14'));_0x1f4e41(_0x328e9c[_0x5f02('0x1a')][_0x5f02('0x19')]);}})[_0x5f02('0x1b')](function(_0x3d6efd){logger['error']('ChatGroup,\x20%s,\x20%s',_0x2541cc,_0x3d6efd);_0x5581c6(_0x3d6efd);});});}
\ No newline at end of file
+var _0x4b8b=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch'];(function(_0x3e7df3,_0x2e57fb){var _0x48804f=function(_0x27bbb2){while(--_0x27bbb2){_0x3e7df3['push'](_0x3e7df3['shift']());}};_0x48804f(++_0x2e57fb);}(_0x4b8b,0x16c));var _0xb4b8=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x4b8b[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0xb4b8('0x0'));var util=require(_0xb4b8('0x1'));var moment=require('moment');var BPromise=require(_0xb4b8('0x2'));var rs=require(_0xb4b8('0x3'));var fs=require('fs');var Redis=require(_0xb4b8('0x4'));var db=require(_0xb4b8('0x5'))['db'];var utils=require(_0xb4b8('0x6'));var logger=require('../../config/logger')(_0xb4b8('0x7'));var config=require('../../config/environment');var jayson=require(_0xb4b8('0x8'));var client=jayson[_0xb4b8('0x9')][_0xb4b8('0xa')]({'port':0x232a});config[_0xb4b8('0xb')]=_[_0xb4b8('0xc')](config[_0xb4b8('0xb')],{'host':_0xb4b8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4b8('0xb')]));require(_0xb4b8('0xe'))['register'](socket);function respondWithRpcPromise(_0x21dd9a,_0x4c9ef6,_0x2cbb88){return new BPromise(function(_0x3b34f1,_0x47dd76){return client[_0xb4b8('0xf')](_0x21dd9a,_0x2cbb88)[_0xb4b8('0x10')](function(_0x217e23){logger[_0xb4b8('0x11')]('ChatGroup,\x20%s,\x20%s',_0x4c9ef6,_0xb4b8('0x12'));logger[_0xb4b8('0x13')](_0xb4b8('0x14'),_0x4c9ef6,_0xb4b8('0x12'),JSON[_0xb4b8('0x15')](_0x217e23));if(_0x217e23[_0xb4b8('0x16')]){if(_0x217e23[_0xb4b8('0x16')][_0xb4b8('0x17')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4c9ef6,_0x217e23[_0xb4b8('0x16')][_0xb4b8('0x18')]);return _0x47dd76(_0x217e23['error'][_0xb4b8('0x18')]);}logger[_0xb4b8('0x16')]('ChatGroup,\x20%s,\x20%s',_0x4c9ef6,_0x217e23[_0xb4b8('0x16')]['message']);return _0x3b34f1(_0x217e23[_0xb4b8('0x16')]['message']);}else{logger[_0xb4b8('0x11')](_0xb4b8('0x19'),_0x4c9ef6,_0xb4b8('0x12'));_0x3b34f1(_0x217e23[_0xb4b8('0x1a')][_0xb4b8('0x18')]);}})[_0xb4b8('0x1b')](function(_0x8905c2){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4c9ef6,_0x8905c2);_0x47dd76(_0x8905c2);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 7606fed..8554007 100644
--- a/server/api/chatGroup/chatGroup.socket.js
+++ b/server/api/chatGroup/chatGroup.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1032=['./chatGroup.events','save','remove','update','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1032,0xf6));var _0x2103=function(_0x57dd61,_0x5af549){_0x57dd61=_0x57dd61-0x0;var _0x402ca8=_0x1032[_0x57dd61];return _0x402ca8;};'use strict';var ChatGroupEvents=require(_0x2103('0x0'));var events=[_0x2103('0x1'),_0x2103('0x2'),_0x2103('0x3')];function createListener(_0x579cc1,_0x17742d){return function(_0x206971){_0x17742d['emit'](_0x579cc1,_0x206971);};}function removeListener(_0x1a7bd8,_0x464ae8){return function(){ChatGroupEvents[_0x2103('0x4')](_0x1a7bd8,_0x464ae8);};}exports[_0x2103('0x5')]=function(_0x156995){for(var _0x60f36c=0x0,_0x541bd7=events['length'];_0x60f36c<_0x541bd7;_0x60f36c++){var _0x3dcfe9=events[_0x60f36c];var _0x7c4d3a=createListener('chatGroup:'+_0x3dcfe9,_0x156995);ChatGroupEvents['on'](_0x3dcfe9,_0x7c4d3a);}};
\ No newline at end of file
+var _0x3730=['update','emit','register','length','./chatGroup.events','save','remove'];(function(_0x2bef51,_0x3549d3){var _0x29097d=function(_0x29ca79){while(--_0x29ca79){_0x2bef51['push'](_0x2bef51['shift']());}};_0x29097d(++_0x3549d3);}(_0x3730,0x1bd));var _0x0373=function(_0x45a206,_0x7577b6){_0x45a206=_0x45a206-0x0;var _0x841e6f=_0x3730[_0x45a206];return _0x841e6f;};'use strict';var ChatGroupEvents=require(_0x0373('0x0'));var events=[_0x0373('0x1'),_0x0373('0x2'),_0x0373('0x3')];function createListener(_0x13c8b1,_0x3ca5bc){return function(_0x516bda){_0x3ca5bc[_0x0373('0x4')](_0x13c8b1,_0x516bda);};}function removeListener(_0x58b8b8,_0x5a77cd){return function(){ChatGroupEvents['removeListener'](_0x58b8b8,_0x5a77cd);};}exports[_0x0373('0x5')]=function(_0x582f79){for(var _0x41ca81=0x0,_0x1439a7=events[_0x0373('0x6')];_0x41ca81<_0x1439a7;_0x41ca81++){var _0x120b54=events[_0x41ca81];var _0xd5fee=createListener('chatGroup:'+_0x120b54,_0x582f79);ChatGroupEvents['on'](_0x120b54,_0xd5fee);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index f8bc431..9370af8 100644
--- a/server/api/chatGroup/index.js
+++ b/server/api/chatGroup/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa51a=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','addMessage','put'];(function(_0x56f213,_0x1f1e98){var _0x4da0f0=function(_0xe78e1){while(--_0xe78e1){_0x56f213['push'](_0x56f213['shift']());}};_0x4da0f0(++_0x1f1e98);}(_0xa51a,0x162));var _0xaa51=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xa51a[_0x45f951];return _0x24756c;};'use strict';var multer=require(_0xaa51('0x0'));var util=require(_0xaa51('0x1'));var path=require(_0xaa51('0x2'));var timeout=require(_0xaa51('0x3'));var express=require('express');var router=express[_0xaa51('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xaa51('0x5'));var config=require('../../config/environment');var controller=require(_0xaa51('0x6'));router[_0xaa51('0x7')]('/',auth[_0xaa51('0x8')](),controller[_0xaa51('0x9')]);router['get'](_0xaa51('0xa'),auth[_0xaa51('0x8')](),controller['describe']);router['get'](_0xaa51('0xb'),auth[_0xaa51('0x8')](),controller['show']);router[_0xaa51('0x7')]('/:id/unread',auth[_0xaa51('0x8')](),controller['getUnread']);router[_0xaa51('0x7')](_0xaa51('0xc'),auth[_0xaa51('0x8')](),controller[_0xaa51('0xd')]);router[_0xaa51('0x7')]('/:id/messages',auth[_0xaa51('0x8')](),controller[_0xaa51('0xe')]);router[_0xaa51('0xf')]('/',auth['isAuthenticated'](),controller[_0xaa51('0x10')]);router['post'](_0xaa51('0xc'),auth[_0xaa51('0x8')](),controller[_0xaa51('0x11')]);router['post'](_0xaa51('0x12'),auth[_0xaa51('0x8')](),controller[_0xaa51('0x13')]);router[_0xaa51('0x14')](_0xaa51('0xb'),auth[_0xaa51('0x8')](),controller[_0xaa51('0x15')]);router[_0xaa51('0x16')](_0xaa51('0xb'),auth[_0xaa51('0x8')](),controller[_0xaa51('0x17')]);router[_0xaa51('0x16')](_0xaa51('0xc'),auth['isAuthenticated'](),controller['removeMembers']);module[_0xaa51('0x18')]=router;
\ No newline at end of file
+var _0xad9d=['getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','/:id/unread','getUnread'];(function(_0x51b49e,_0x2e0659){var _0x1ae2a3=function(_0x5a76d2){while(--_0x5a76d2){_0x51b49e['push'](_0x51b49e['shift']());}};_0x1ae2a3(++_0x2e0659);}(_0xad9d,0x11a));var _0xdad9=function(_0x2d6a09,_0xb85e17){_0x2d6a09=_0x2d6a09-0x0;var _0x2c5761=_0xad9d[_0x2d6a09];return _0x2c5761;};'use strict';var multer=require(_0xdad9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdad9('0x1'));var express=require(_0xdad9('0x2'));var router=express[_0xdad9('0x3')]();var auth=require(_0xdad9('0x4'));var interaction=require(_0xdad9('0x5'));var config=require(_0xdad9('0x6'));var controller=require(_0xdad9('0x7'));router[_0xdad9('0x8')]('/',auth[_0xdad9('0x9')](),controller['index']);router[_0xdad9('0x8')](_0xdad9('0xa'),auth[_0xdad9('0x9')](),controller[_0xdad9('0xb')]);router['get'](_0xdad9('0xc'),auth[_0xdad9('0x9')](),controller['show']);router[_0xdad9('0x8')](_0xdad9('0xd'),auth['isAuthenticated'](),controller[_0xdad9('0xe')]);router['get']('/:id/members',auth[_0xdad9('0x9')](),controller[_0xdad9('0xf')]);router[_0xdad9('0x8')](_0xdad9('0x10'),auth[_0xdad9('0x9')](),controller[_0xdad9('0x11')]);router[_0xdad9('0x12')]('/',auth[_0xdad9('0x9')](),controller[_0xdad9('0x13')]);router[_0xdad9('0x12')](_0xdad9('0x14'),auth['isAuthenticated'](),controller[_0xdad9('0x15')]);router[_0xdad9('0x12')](_0xdad9('0x10'),auth[_0xdad9('0x9')](),controller['addMessage']);router[_0xdad9('0x16')](_0xdad9('0xc'),auth[_0xdad9('0x9')](),controller[_0xdad9('0x17')]);router[_0xdad9('0x18')]('/:id',auth[_0xdad9('0x9')](),controller[_0xdad9('0x19')]);router[_0xdad9('0x18')](_0xdad9('0x14'),auth[_0xdad9('0x9')](),controller['removeMembers']);module[_0xdad9('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 7283654..bc911ea 100644
--- a/server/api/chatInteraction/chatInteraction.attributes.js
+++ b/server/api/chatInteraction/chatInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ba3=['out','sequelize','exports','BOOLEAN','thumb','star','TEXT','STRING','DATE','ENUM'];(function(_0x398147,_0x2484aa){var _0x38014a=function(_0x1f6826){while(--_0x1f6826){_0x398147['push'](_0x398147['shift']());}};_0x38014a(++_0x2484aa);}(_0x6ba3,0x10f));var _0x36ba=function(_0x47c53e,_0x4e03ba){_0x47c53e=_0x47c53e-0x0;var _0x30cc26=_0x6ba3[_0x47c53e];return _0x30cc26;};'use strict';var Sequelize=require(_0x36ba('0x0'));module[_0x36ba('0x1')]={'closed':{'type':Sequelize[_0x36ba('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0x36ba('0x3')),'defaultValue':_0x36ba('0x4')},'ratingMessage':{'type':Sequelize[_0x36ba('0x5')]},'pathTranscript':{'type':Sequelize[_0x36ba('0x5')]},'mailTranscript':{'type':Sequelize[_0x36ba('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x36ba('0x7')]},'disposition':{'type':Sequelize[_0x36ba('0x6')]},'note':{'type':Sequelize[_0x36ba('0x6')]},'browserName':{'type':Sequelize[_0x36ba('0x6')]},'browserVersion':{'type':Sequelize[_0x36ba('0x6')]},'osName':{'type':Sequelize[_0x36ba('0x6')]},'osVersion':{'type':Sequelize[_0x36ba('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x36ba('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x36ba('0x5')]},'customerIp':{'type':Sequelize[_0x36ba('0x6')]},'formData':{'type':Sequelize[_0x36ba('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x36ba('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x36ba('0x8')]('in',_0x36ba('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x36ba('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x36ba('0x5')]}};
\ No newline at end of file
+var _0x4d42=['TEXT','STRING','DATE','out','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4d42,0x199));var _0x24d4=function(_0x5408f5,_0x4cb8cd){_0x5408f5=_0x5408f5-0x0;var _0x200334=_0x4d42[_0x5408f5];return _0x200334;};'use strict';var Sequelize=require('sequelize');module[_0x24d4('0x0')]={'closed':{'type':Sequelize[_0x24d4('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x24d4('0x2')]},'ratingType':{'type':Sequelize[_0x24d4('0x3')](_0x24d4('0x4'),'thumb'),'defaultValue':_0x24d4('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x24d4('0x5')]},'mailTranscript':{'type':Sequelize[_0x24d4('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x24d4('0x7')]},'disposition':{'type':Sequelize[_0x24d4('0x6')]},'note':{'type':Sequelize[_0x24d4('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x24d4('0x6')]},'osName':{'type':Sequelize[_0x24d4('0x6')]},'osVersion':{'type':Sequelize[_0x24d4('0x6')]},'deviceModel':{'type':Sequelize[_0x24d4('0x6')]},'deviceVendor':{'type':Sequelize[_0x24d4('0x6')]},'deviceType':{'type':Sequelize[_0x24d4('0x6')]},'referer':{'type':Sequelize[_0x24d4('0x5')]},'customerIp':{'type':Sequelize[_0x24d4('0x6')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x24d4('0x7')]},'lastMsgAt':{'type':Sequelize[_0x24d4('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x24d4('0x3')]('in',_0x24d4('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x24d4('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x24d4('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index d0f71af..f882798 100644
--- a/server/api/chatInteraction/chatInteraction.controller.js
+++ b/server/api/chatInteraction/chatInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x90b1=['c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','keys','includeAll','include','create','body','describe','findOne','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','vidaooApiKey','Error\x20in\x20Vidaoo\x20configuration','join_url','out','user','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','closed','disposition','AbandonInteraction','file','originalname','filename','mimetype','Attachment','attachmentDownload','attachId','download','join','root','server/files/attachments/','basename','server/files/chat/upload/','now','pathTranscript','Messages','ChatWebsite','CmContact','format','%s%d','customer','Visitor','agentIdentifier','agentAlias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','Smtp','service','host','port','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','pick','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','secret','options','includeAgent','findAll','addTags','spread','emit','chatInteractionTags:save','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Chat','YYYY-MM-DD','Account','Owner','N.A.','browserName','osName','referer','customerIp','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','test','ValidationError','request','then','info','request\x20sent','debug','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','end','name','send','Users','fullname','Tags','split','forEach','push','TagIds','ChatInteraction','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','text','some','compact','isEmpty','ChatWebsiteId','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x90b1,0x1bb));var _0x190b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x90b1[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0x190b('0x0'));var emlformat=require(_0x190b('0x1'));var rimraf=require(_0x190b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x190b('0x3'));var moment=require(_0x190b('0x4'));var BPromise=require(_0x190b('0x5'));var Mustache=require(_0x190b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x190b('0x7'));var fs=require('fs');var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var db=require(_0x190b('0x17'))['db'];config['redis']=_[_0x190b('0x18')](config[_0x190b('0x19')],{'host':_0x190b('0x1a'),'port':0x18eb});var socket=require(_0x190b('0x1b'))(new Redis(config[_0x190b('0x19')]));require(_0x190b('0x1c'))[_0x190b('0x1d')](socket);var jayson=require(_0x190b('0x1e'));var client=jayson[_0x190b('0x1f')][_0x190b('0x20')]({'port':0x232b});var client9004=jayson[_0x190b('0x1f')][_0x190b('0x20')]({'port':0x232c});function checkPasswordPattern(_0xab346,_0x3e8781,_0x3fbfc3){if(_0x3fbfc3){var _0x121867=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x121867[_0x190b('0x21')](_0x3e8781)){return _0xab346;}else{throw new db['Sequelize'][(_0x190b('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xab346;}}function respondWithRpcPromise(_0x2a9323,_0x21e458,_0x56d07a,_0x16c009){return new BPromise(function(_0x50a3c4,_0x298343){var _0x22d946=_0x16c009||client;return _0x22d946[_0x190b('0x23')](_0x2a9323,_0x56d07a)[_0x190b('0x24')](function(_0x1b5427){logger[_0x190b('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x21e458,_0x190b('0x26'));logger[_0x190b('0x27')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x21e458,_0x190b('0x26'),JSON['stringify'](_0x1b5427));if(_0x1b5427['error']){if(_0x1b5427[_0x190b('0x28')][_0x190b('0x29')]===0x1f4){logger[_0x190b('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x21e458,_0x1b5427[_0x190b('0x28')][_0x190b('0x2a')]);return _0x298343(_0x1b5427[_0x190b('0x28')][_0x190b('0x2a')]);}logger[_0x190b('0x28')](_0x190b('0x2b'),_0x21e458,_0x1b5427[_0x190b('0x28')]['message']);return _0x50a3c4(_0x1b5427['error'][_0x190b('0x2a')]);}else{logger[_0x190b('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x21e458,'request\x20sent');_0x50a3c4(_0x1b5427[_0x190b('0x2c')]['message']);}})[_0x190b('0x2d')](function(_0x3b6aaf){logger['error'](_0x190b('0x2b'),_0x21e458,_0x3b6aaf);_0x298343(_0x3b6aaf);});});}function respondWithStatusCode(_0x1deea6,_0x5c89ab){_0x5c89ab=_0x5c89ab||0xcc;return function(_0xa9d6f7){if(_0xa9d6f7){return _0x1deea6[_0x190b('0x2e')](_0x5c89ab);}return _0x1deea6[_0x190b('0x2f')](_0x5c89ab)['end']();};}function respondWithResult(_0x536d7b,_0x3730cc){_0x3730cc=_0x3730cc||0xc8;return function(_0x4d5f3f){if(_0x4d5f3f){return _0x536d7b[_0x190b('0x2f')](_0x3730cc)[_0x190b('0x30')](_0x4d5f3f);}};}function respondWithFilteredResult(_0x5b9cb6,_0x29775f){return function(_0x580b92){if(_0x580b92){var _0x40d060=_0x580b92[_0x190b('0x31')],_0x4ff5a6=_0x29775f[_0x190b('0x32')],_0x19600d=_0x29775f['offset']+_0x29775f[_0x190b('0x33')],_0x5650e1;if(_0x19600d>=_0x40d060){_0x19600d=_0x40d060;_0x5650e1=0xc8;}else{_0x5650e1=0xce;}_0x5b9cb6[_0x190b('0x2f')](_0x5650e1);return _0x5b9cb6[_0x190b('0x34')](_0x190b('0x35'),_0x4ff5a6+'-'+_0x19600d+'/'+_0x40d060)[_0x190b('0x30')](_0x580b92);}return null;};}function patchUpdates(_0x360d04){return function(_0x309065){try{jsonpatch[_0x190b('0x36')](_0x309065,_0x360d04,!![]);}catch(_0x599da4){return BPromise['reject'](_0x599da4);}return _0x309065[_0x190b('0x37')]();};}function saveUpdates(_0x2e44ed,_0x58113b){return function(_0x51dea7){if(_0x51dea7){return _0x51dea7[_0x190b('0x38')](_0x2e44ed)[_0x190b('0x24')](function(_0x3fbba1){return _0x3fbba1;});}return null;};}function removeEntity(_0x3b6f3f,_0x228c73){return function(_0x5bda80){if(_0x5bda80){return _0x5bda80['destroy']()['then'](function(){_0x3b6f3f[_0x190b('0x2f')](0xcc)[_0x190b('0x39')]();});}};}function handleEntityNotFound(_0x1a950d,_0x5e55ab){return function(_0x33e9db){if(!_0x33e9db){_0x1a950d[_0x190b('0x2e')](0x194);}return _0x33e9db;};}function handleError(_0x2e468b,_0x5a9669){_0x5a9669=_0x5a9669||0x1f4;return function(_0x2a8260){logger['error'](_0x2a8260['stack']);if(_0x2a8260[_0x190b('0x3a')]){delete _0x2a8260[_0x190b('0x3a')];}_0x2e468b['status'](_0x5a9669)[_0x190b('0x3b')](_0x2a8260);};}function getInteractionUsers(_0xfd0d62,_0x161756){return new BPromise(function(_0x5a9cba,_0xde2b0b){try{if(_0x161756[_0xfd0d62['id']]){_0xfd0d62[_0x190b('0x3c')]=_['map'](_0x161756[_0xfd0d62['id']],function(_0x5d006d){return{'id':_0x5d006d['id'],'fullname':_0x5d006d[_0x190b('0x3d')]};});}}catch(_0x4ab72d){_0xde2b0b(_0x4ab72d);}_0x5a9cba(_0xfd0d62);});}function getInteractionTags(_0x46bdba,_0x741e94){return new BPromise(function(_0x43f168,_0xad955a){try{if(_0x46bdba['TagIds']){_0x46bdba[_0x190b('0x3e')]=[];_0x46bdba['TagIds'][_0x190b('0x3f')](',')[_0x190b('0x40')](function(_0x47c488){_0x46bdba[_0x190b('0x3e')][_0x190b('0x41')](_0x741e94[_0x47c488]);});}delete _0x46bdba[_0x190b('0x42')];}catch(_0x5d9548){_0xad955a(_0x5d9548);}_0x43f168(_0x46bdba);});}function updateChatInteraction(_0x2c7c0e,_0x598a46,_0x550717){return new BPromise(function(_0x554486,_0x2cfff0){return getInteractionUsers(_0x2c7c0e,_0x550717)[_0x190b('0x24')](function(_0x411cb5){return getInteractionTags(_0x411cb5,_0x598a46);})[_0x190b('0x24')](function(_0x48b2fa){_0x554486(_0x48b2fa);})['catch'](function(_0x4045b7){_0x2cfff0(_0x4045b7);});});}exports['index']=function(_0x110891,_0x3d67f0){var _0x497c5e={},_0x2e25e3={},_0x36db47={'count':0x0,'rows':[]};var _0x457c14=_['map'](db[_0x190b('0x43')][_0x190b('0x44')],function(_0x49512e){return{'name':_0x49512e[_0x190b('0x45')],'type':_0x49512e['type'][_0x190b('0x46')]};});_0x2e25e3[_0x190b('0x47')]=_[_0x190b('0x48')](_0x457c14,'name');_0x2e25e3[_0x190b('0x49')]=_['keys'](_0x110891[_0x190b('0x49')]);_0x2e25e3[_0x190b('0x4a')]=_[_0x190b('0x4b')](_0x2e25e3[_0x190b('0x47')],_0x2e25e3[_0x190b('0x49')]);_0x497c5e[_0x190b('0x4c')]=_[_0x190b('0x4b')](_0x2e25e3['model'],qs[_0x190b('0x4d')](_0x110891[_0x190b('0x49')][_0x190b('0x4d')]));_0x497c5e['attributes']=_0x497c5e[_0x190b('0x4c')][_0x190b('0x4e')]?_0x497c5e[_0x190b('0x4c')]:_0x2e25e3[_0x190b('0x47')];if(!_0x110891[_0x190b('0x49')]['hasOwnProperty'](_0x190b('0x4f'))){_0x497c5e[_0x190b('0x33')]=qs[_0x190b('0x33')](_0x110891['query'][_0x190b('0x33')]);_0x497c5e[_0x190b('0x32')]=qs[_0x190b('0x32')](_0x110891['query']['offset']);}_0x497c5e[_0x190b('0x50')]=qs[_0x190b('0x51')](_0x110891[_0x190b('0x49')][_0x190b('0x51')]);_0x497c5e[_0x190b('0x52')]=qs[_0x190b('0x4a')](_['pick'](_0x110891[_0x190b('0x49')],_0x2e25e3[_0x190b('0x4a')]),_0x457c14);var _0x30b23b=[];var _0x5bb07a=squel[_0x190b('0x53')]()[_0x190b('0x54')]('id')[_0x190b('0x54')]('name')[_0x190b('0x54')](_0x190b('0x55'))[_0x190b('0x56')](_0x190b('0x57'));var _0x416533=squel[_0x190b('0x53')]()[_0x190b('0x54')](_0x190b('0x58'))[_0x190b('0x54')](_0x190b('0x59'))[_0x190b('0x54')]('ui.ChatInteractionId')[_0x190b('0x56')]('user_has_chat_interactions','ui')[_0x190b('0x5a')](_0x190b('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x2a5045=squel[_0x190b('0x53')]()[_0x190b('0x56')](_0x190b('0x5c'),'i')[_0x190b('0x5a')](_0x190b('0x5d'),'c',_0x190b('0x5e'))[_0x190b('0x5a')]('users','o',_0x190b('0x5f'))[_0x190b('0x5a')](_0x190b('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x190b('0x5a')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x190b('0x5a')](_0x190b('0x61'),'it',_0x190b('0x62'))[_0x190b('0x5a')](_0x190b('0x57'),'t',_0x190b('0x63'));var _0x1383e5=squel[_0x190b('0x64')]();var _0x3e9851=[];var _0x119ed7=squel[_0x190b('0x64')]();var _0x149902;if(_0x110891[_0x190b('0x49')][_0x190b('0x65')]){_0x149902=as['parseSearch'](_0x110891[_0x190b('0x49')][_0x190b('0x65')]);var _0x286355=_0x149902[_0x190b('0x66')];for(var _0x53d740=0x0;_0x53d740<_0x149902['conditions'][_0x190b('0x4e')];_0x53d740++){var _0x2083dc=_0x149902['conditions'][_0x53d740];var _0x1195f9='i';var _0x53cb6f=_[_0x190b('0x67')](_0x457c14,[_0x190b('0x3a'),_0x2083dc[_0x190b('0x54')]]);if(!_0x53cb6f){switch(_0x2083dc['field']){case _0x190b('0x68'):if(_0x2083dc[_0x190b('0x69')]==0x1){_0x2a5045[_0x190b('0x6a')]('`'+_0x2083dc[_0x190b('0x54')]+_0x190b('0x6b'));}else{_0x2a5045[_0x190b('0x6a')]('`'+_0x2083dc[_0x190b('0x54')]+_0x190b('0x6c'));}break;case _0x190b('0x6d'):if(_0x2083dc['operator']==='$substring'){if(_0x2083dc[_0x190b('0x69')][_0x190b('0x3f')]('\x20')[_0x190b('0x4e')]>0x1){_0x1383e5[_0x286355](_0x190b('0x6e'),qs['getFullTextValue'](_0x2083dc[_0x190b('0x69')]),null);}else{var _0x43003f='%'+_0x2083dc['value']+'%';_0x1383e5[_0x286355](_0x190b('0x6f'),_0x43003f,_0x43003f,_0x43003f);}}else{_0x53cb6f=_[_0x190b('0x67')](_0x457c14,[_0x190b('0x3a'),_0x190b('0x70')]);_0x2083dc[_0x190b('0x54')]=_0x190b('0x70');_0x5c2afd=as[_0x190b('0x71')](_0x1195f9,_0x53cb6f[_0x190b('0x72')],_0x2083dc);_0x1383e5[_0x286355](_0x5c2afd['text'],_0x5c2afd[_0x190b('0x69')]['start'],_0x5c2afd['value'][_0x190b('0x39')]);}break;case _0x190b('0x73'):var _0x2c4164=_0x2083dc['value']['split'](',')[_0x190b('0x48')](function(_0xdc7579){return Number(_0xdc7579);});_0x2c4164[_0x190b('0x40')](function(_0x126748){_0x119ed7['or'](_0x190b('0x74'),'%,'+_0x126748+',%');});_0x3e9851=_[_0x190b('0x75')](_0x3e9851,_0x2c4164);break;case _0x190b('0x76'):if(_0x2083dc[_0x190b('0x77')]==='$substring'){_0x1383e5[_0x286355](_0x190b('0x78'),'%'+_0x2083dc[_0x190b('0x69')]+'%',null);}else{_0x53cb6f=_[_0x190b('0x67')](_0x457c14,[_0x190b('0x3a'),_0x190b('0x79')]);_0x2083dc['field']=_0x190b('0x79');_0x5c2afd=as[_0x190b('0x71')](_0x1195f9,_0x53cb6f[_0x190b('0x72')],_0x2083dc);_0x1383e5[_0x286355](_0x5c2afd['text'],_0x5c2afd[_0x190b('0x69')][_0x190b('0x7a')],_0x5c2afd[_0x190b('0x69')][_0x190b('0x39')]);}break;case'body':_0x5c2afd=as[_0x190b('0x71')]('me',null,_0x2083dc);_0x1383e5[_0x286355](_0x5c2afd[_0x190b('0x7b')],_0x5c2afd[_0x190b('0x69')][_0x190b('0x7a')],_0x5c2afd['value'][_0x190b('0x39')]);break;}}else{var _0x5c2afd=as[_0x190b('0x71')](_0x1195f9,_0x53cb6f[_0x190b('0x72')],_0x2083dc);_0x1383e5[_0x286355](_0x5c2afd[_0x190b('0x7b')],_0x5c2afd[_0x190b('0x69')]['start'],_0x5c2afd[_0x190b('0x69')]['end']);}}}else{var _0x194eb5=_(_0x110891['query'])['keys']()[_0x190b('0x48')](function(_0x58bf93){return _[_0x190b('0x7c')](_0x457c14,[_0x190b('0x3a'),_0x58bf93])?_0x58bf93:undefined;})[_0x190b('0x7d')]()[_0x190b('0x69')]();if(!_[_0x190b('0x7e')](_0x194eb5)){_0x194eb5['forEach'](function(_0x2f9922){if(_0x2f9922===_0x190b('0x7f')){_0x2a5045[_0x190b('0x52')]('i.ChatWebsiteId\x20IN\x20?',[][_0x190b('0x80')](_0x110891[_0x190b('0x49')][_0x2f9922]));}else if(_0x2f9922==='createdAt'){var _0x3b1835=JSON[_0x190b('0x81')](_0x110891[_0x190b('0x49')][_0x2f9922])['$gte'];var _0x1446a4=JSON[_0x190b('0x81')](_0x110891[_0x190b('0x49')][_0x2f9922])[_0x190b('0x82')];_0x2a5045['where'](_0x190b('0x83'),_0x3b1835,_0x1446a4);}else{if(_0x110891[_0x190b('0x49')][_0x2f9922]===_0x190b('0x84')){_0x2a5045['where']('i.'+_0x2f9922+_0x190b('0x85'));}else{_0x2a5045[_0x190b('0x52')]('i.'+_0x2f9922+_0x190b('0x86'),_0x110891['query'][_0x2f9922]);}}});}if(_0x110891[_0x190b('0x49')][_0x190b('0x87')]){if(_0x110891[_0x190b('0x49')][_0x190b('0x87')]==0x1){_0x2a5045[_0x190b('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x2a5045['having'](_0x190b('0x88'));}}if(_0x110891[_0x190b('0x49')]['tag']){_0x3e9851=_[_0x190b('0x89')](_0x110891[_0x190b('0x49')]['tag'])?_0x110891['query'][_0x190b('0x8a')]:new Array(_0x110891[_0x190b('0x49')]['tag']);_0x3e9851['forEach'](function(_0x2d3811){_0x119ed7['or'](_0x190b('0x74'),'%,'+_0x2d3811+',%');});}if(_0x110891[_0x190b('0x49')][_0x190b('0x8b')]){var _0x172dbf=_0x110891['query']['filter'][_0x190b('0x8c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x190b('0x8d'));if(qs[_0x190b('0x8e')](_0x172dbf)){_0x1383e5['or'](_0x190b('0x8f'),_0x172dbf+'%');}else{_0x1383e5['or'](_0x190b('0x90'),qs[_0x190b('0x91')](_0x172dbf))['or'](_0x190b('0x92'),_0x172dbf+'%');}}}_0x2a5045[_0x190b('0x52')](_0x1383e5);_0x2a5045[_0x190b('0x93')](_0x190b('0x94'));var _0x1500a9={'type':db[_0x190b('0x95')]['QueryTypes'][_0x190b('0x96')],'raw':!![]};var _0x261cb2=_0x2a5045[_0x190b('0x97')]();_0x261cb2['field']('i.id');_0x261cb2[_0x190b('0x54')](_0x190b('0x98'),'unreadMessages');if(_0x497c5e[_0x190b('0x50')]){_0x497c5e[_0x190b('0x50')][_0x190b('0x40')](function(_0x591638){_0x2a5045[_0x190b('0x50')]('i.'+_0x591638[0x0],_0x591638[0x1]===_0x190b('0x99')?![]:!![]);});}if(!_['isEmpty'](_0x3e9851)){_0x2a5045[_0x190b('0x6a')](_0x119ed7);_0x261cb2[_0x190b('0x52')]('t.id\x20IN\x20?',_0x3e9851);}BPromise[_0x190b('0x9a')]()['then'](function(){if(!_0x149902){if(_0x110891['query']['ChatWebsiteId']||_0x110891['query'][_0x190b('0x9b')])return;_0x261cb2[_0x190b('0x52')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2a5045[_0x190b('0x52')](_0x190b('0x9c'));return;}return _0x110891['user'][_0x190b('0x9d')]({'attributes':['id'],'raw':!![]})[_0x190b('0x24')](function(_0x3b55da){if(_[_0x190b('0x7e')](_0x3b55da)){_0x261cb2[_0x190b('0x52')](_0x190b('0x9e'));_0x2a5045[_0x190b('0x52')](_0x190b('0x9e'));}else{_0x261cb2[_0x190b('0x52')]('i.ChatWebsiteId\x20IN\x20?',_[_0x190b('0x48')](_0x3b55da,'id'));_0x2a5045['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x190b('0x48')](_0x3b55da,'id'));}});})[_0x190b('0x24')](function(){db[_0x190b('0x9f')][_0x190b('0x49')](_0x261cb2[_0x190b('0xa0')](),_0x1500a9)[_0x190b('0x24')](function(_0x3c5c11){_0x36db47[_0x190b('0x31')]=_0x3c5c11[_0x190b('0x4e')];if(_0x36db47[_0x190b('0x31')]===0x0)return[];return db[_0x190b('0x9f')][_0x190b('0x49')](_0x5bb07a['toString'](),_0x1500a9)[_0x190b('0x24')](function(_0x18ddf9){_0x30b23b=_[_0x190b('0xa1')](_0x18ddf9,'id');_0x1500a9=_[_0x190b('0xa2')](_0x1500a9,{'model':db[_0x190b('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x110891[_0x190b('0x49')][_0x190b('0x4d')]){_0x497c5e[_0x190b('0x4c')][_0x190b('0x40')](function(_0x4e35a4){_0x2a5045[_0x190b('0x54')]('i.'+_0x4e35a4);});}else{_0x2a5045[_0x190b('0x54')](_0x190b('0x98'),'unreadMessages');_0x2a5045[_0x190b('0x54')](_0x190b('0xa3'),'Account.key');_0x2a5045['field'](_0x190b('0xa4'),_0x190b('0xa5'));_0x2a5045[_0x190b('0x54')](_0x190b('0xa6'));_0x2a5045[_0x190b('0x54')](_0x190b('0xa7'),_0x190b('0xa8'));_0x2a5045[_0x190b('0x54')](_0x190b('0xa9'),_0x190b('0xaa'));_0x2a5045['field'](_0x190b('0xab'),_0x190b('0xac'));_0x2a5045[_0x190b('0x54')]('c.phone',_0x190b('0xad'));_0x2a5045[_0x190b('0x54')](_0x190b('0xae'),_0x190b('0xaf'));_0x2a5045[_0x190b('0x54')](_0x190b('0xb0'),'Contact.fax');_0x2a5045[_0x190b('0x54')](_0x190b('0xb1'),'Owner.fullname');_0x2a5045[_0x190b('0x54')](_0x190b('0xb2'),_0x190b('0xb3'));_0x2a5045[_0x190b('0x54')](_0x190b('0xb4'),_0x190b('0x42'));}if(_0x497c5e[_0x190b('0x33')])_0x2a5045[_0x190b('0x33')](_0x497c5e['limit']);if(_0x497c5e[_0x190b('0x32')])_0x2a5045[_0x190b('0x32')](_0x497c5e[_0x190b('0x32')]);return db[_0x190b('0x9f')]['query'](_0x2a5045[_0x190b('0xa0')](),_0x1500a9);})[_0x190b('0x24')](function(_0x5f3b98){_0x416533[_0x190b('0x52')](_0x190b('0xb5'),_[_0x190b('0x48')](_0x5f3b98,'id'));return db[_0x190b('0x9f')][_0x190b('0x49')](_0x416533[_0x190b('0xa0')](),_0x1500a9)[_0x190b('0x24')](function(_0x496c32){var _0x46f330=_[_0x190b('0xb6')](_0x496c32,_0x190b('0xb7'));var _0x4a320c=[];_0x5f3b98[_0x190b('0x40')](function(_0x48372b){_0x4a320c[_0x190b('0x41')](updateChatInteraction(_0x48372b,_0x30b23b,_0x46f330));});return BPromise[_0x190b('0xb8')](_0x4a320c);});});})[_0x190b('0x24')](function(_0x262bce){_0x36db47[_0x190b('0xb9')]=_0x262bce;return _0x36db47;})[_0x190b('0x24')](respondWithFilteredResult(_0x3d67f0,_0x497c5e));})[_0x190b('0x2d')](handleError(_0x3d67f0,null));};exports['show']=function(_0x231278,_0x4f54b9){var _0x56851d={'raw':![],'where':{'id':_0x231278[_0x190b('0xba')]['id']}},_0x5e9465={};_0x5e9465[_0x190b('0x47')]=_['keys'](db[_0x190b('0x43')][_0x190b('0x44')]);_0x5e9465[_0x190b('0x49')]=_[_0x190b('0xbb')](_0x231278[_0x190b('0x49')]);_0x5e9465['filters']=_['intersection'](_0x5e9465['model'],_0x5e9465[_0x190b('0x49')]);_0x56851d[_0x190b('0x4c')]=_[_0x190b('0x4b')](_0x5e9465['model'],qs[_0x190b('0x4d')](_0x231278[_0x190b('0x49')][_0x190b('0x4d')]));_0x56851d[_0x190b('0x4c')]=_0x56851d[_0x190b('0x4c')]['length']?_0x56851d[_0x190b('0x4c')]:_0x5e9465['model'];if(_0x231278[_0x190b('0x49')][_0x190b('0xbc')]){_0x56851d[_0x190b('0xbd')]=[{'all':!![]}];}_0x56851d=_['merge']({},_0x56851d,_0x231278['options']);return db[_0x190b('0x43')]['find'](_0x56851d)[_0x190b('0x24')](handleEntityNotFound(_0x4f54b9,null))[_0x190b('0x24')](respondWithResult(_0x4f54b9,null))[_0x190b('0x2d')](handleError(_0x4f54b9,null));};exports[_0x190b('0xbe')]=function(_0x14f086,_0x3b6792){return db[_0x190b('0x43')][_0x190b('0xbe')](_0x14f086[_0x190b('0xbf')],{})[_0x190b('0x24')](respondWithResult(_0x3b6792,0xc9))[_0x190b('0x2d')](handleError(_0x3b6792,null));};exports[_0x190b('0x38')]=function(_0x174ef1,_0x1fdf64){if(_0x174ef1[_0x190b('0xbf')]['id']){delete _0x174ef1[_0x190b('0xbf')]['id'];}return db['ChatInteraction'][_0x190b('0x67')]({'where':{'id':_0x174ef1[_0x190b('0xba')]['id']}})['then'](handleEntityNotFound(_0x1fdf64,null))[_0x190b('0x24')](saveUpdates(_0x174ef1[_0x190b('0xbf')],null))['then'](respondWithResult(_0x1fdf64,null))['catch'](handleError(_0x1fdf64,null));};exports['destroy']=function(_0x2f3ba9,_0x192765){return db[_0x190b('0x43')][_0x190b('0x67')]({'where':{'id':_0x2f3ba9['params']['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x192765,null))[_0x190b('0x24')](removeEntity(_0x192765,null))[_0x190b('0x2d')](handleError(_0x192765,null));};exports[_0x190b('0xc0')]=function(_0x4b9292,_0xf22ff7){return db[_0x190b('0x43')][_0x190b('0xc0')]()[_0x190b('0x24')](respondWithResult(_0xf22ff7,null))['catch'](handleError(_0xf22ff7,null));};exports['createVidaooSession']=function(_0x1f9701,_0x3983b9){var _0x16d1eb=_0x1f9701[_0x190b('0xba')]['id'];var _0x741024;var _0x4b17fe;var _0x2f215c;return db[_0x190b('0x43')][_0x190b('0xc1')]({'where':{'id':_0x16d1eb}})[_0x190b('0x24')](function(_0x5b10e8){_0x741024=_0x5b10e8;return db['ChatWebsite']['findOne']({'where':{'id':_0x5b10e8[_0x190b('0x7f')]},'attributes':['id','vidaooApiKey',_0x190b('0xc2')],'raw':!![]});})[_0x190b('0x24')](function(_0x7fefcb){if(_0x7fefcb&&_0x7fefcb['vidaooApiKey']&&_0x7fefcb[_0x190b('0xc2')]){_0x4b17fe=_0x7fefcb;var _0x483cdd={'rejectUnauthorized':![],'method':_0x190b('0xc3'),'uri':_0x190b('0xc4'),'headers':{'X-APIKEY':_0x7fefcb[_0x190b('0xc5')]},'body':{'name':'MotionCWB:'+_0x16d1eb},'redirect':'follow','json':!![]};return rp(_0x483cdd);}else{throw new db[(_0x190b('0x95'))][(_0x190b('0x22'))](_0x190b('0xc6'));}})[_0x190b('0x24')](function(_0x529964){_0x2f215c=_0x529964;if(_0x2f215c['id']){var _0x16b937={'body':_0x2f215c[_0x190b('0xc7')],'ChatWebsiteId':_0x4b17fe['id'],'ChatInteractionId':_0x741024['id'],'direction':_0x190b('0xc8'),'UserId':_0x1f9701[_0x190b('0xc9')]['id']};return db[_0x190b('0xca')]['create'](_0x16b937,{});}else{throw new db['Sequelize'][(_0x190b('0x22'))](_0x190b('0xcb'));}})[_0x190b('0x24')](function(){return _0x741024[_0x190b('0xcc')]({'vidaooSessionId':_0x2f215c['id']});})[_0x190b('0x24')](respondWithResult(_0x3983b9,null))[_0x190b('0x2d')](handleError(_0x3983b9,null));};exports[_0x190b('0xcd')]=function(_0x4eeff4,_0x4df93d){if(_0x4eeff4[_0x190b('0xbf')]['id']){delete _0x4eeff4[_0x190b('0xbf')]['id'];}return db[_0x190b('0x43')][_0x190b('0x67')]({'where':{'id':_0x4eeff4[_0x190b('0xba')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x4df93d,null))[_0x190b('0x24')](saveUpdates(_0x4eeff4[_0x190b('0xbf')],null))[_0x190b('0x24')](respondWithResult(_0x4df93d,null))[_0x190b('0x2d')](handleError(_0x4df93d,null));};exports[_0x190b('0xce')]=function(_0x34fec7,_0xd5faf2,_0x1f2a65){if(_0x34fec7['body']['id']){delete _0x34fec7['body']['id'];}return db[_0x190b('0x43')][_0x190b('0x67')]({'where':{'id':_0x34fec7[_0x190b('0xba')]['id']}})[_0x190b('0x24')](function(_0x1345a0){if(!_0x1345a0){logger[_0x190b('0x28')](_0x190b('0xcf'),_0x190b('0xce'),0x194,_0x190b('0xd0'));_0xd5faf2[_0x190b('0x2e')](0x194);}else{if(_0x1345a0['UserId']){throw new db[(_0x190b('0x95'))][(_0x190b('0x22'))]('Interaction\x20already\x20assigned');}}return _0x1345a0;})[_0x190b('0x24')](function(_0x5d10ec){if(_0x5d10ec){return _0x5d10ec['update']({'closed':_0x34fec7[_0x190b('0xbf')][_0x190b('0xd1')],'disposition':_0x34fec7[_0x190b('0xbf')][_0x190b('0xd2')]})[_0x190b('0x24')](function(_0x4c11d4){return _0x4c11d4;});}})[_0x190b('0x24')](function(_0x6e3a1a){return respondWithRpcPromise(_0x190b('0xd3'),'abandon',_0x34fec7[_0x190b('0xbf')],client9004);})[_0x190b('0x24')](respondWithResult(_0xd5faf2,null))[_0x190b('0x2d')](handleError(_0xd5faf2,null));};exports['attachmentUpload']=function(_0x3bfb08,_0x35a0c6,_0x3d6a24){_0x3bfb08[_0x190b('0xbf')][_0x190b('0x3a')]=_0x3bfb08[_0x190b('0xd4')][_0x190b('0xd5')];_0x3bfb08['body']['basename']=_0x3bfb08[_0x190b('0xd4')][_0x190b('0xd6')];_0x3bfb08[_0x190b('0xbf')][_0x190b('0x72')]=_0x3bfb08[_0x190b('0xd4')][_0x190b('0xd7')];return db[_0x190b('0xd8')][_0x190b('0xbe')](_0x3bfb08['body'])[_0x190b('0x24')](respondWithResult(_0x35a0c6,0xc9))[_0x190b('0x2d')](handleError(_0x35a0c6,null));};exports[_0x190b('0xd9')]=function(_0x355860,_0x6a8c46,_0x21cec1){return db['ChatInteraction']['findOne']({'where':{'id':_0x355860[_0x190b('0xba')]['id']},'raw':!![]})[_0x190b('0x24')](handleEntityNotFound(_0x6a8c46,null))[_0x190b('0x24')](function(_0x4a7f1a){if(_0x4a7f1a){if(_0x4a7f1a[_0x190b('0xd1')]){return _0x6a8c46[_0x190b('0x2f')](0x193)[_0x190b('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0x190b('0xd8')][_0x190b('0xc1')]({'where':{'id':_0x355860['query'][_0x190b('0xda')]},'raw':!![]})[_0x190b('0x24')](handleEntityNotFound(_0x6a8c46,null));}})[_0x190b('0x24')](function(_0x338380){if(_0x338380){return _0x6a8c46[_0x190b('0xdb')](path[_0x190b('0xdc')](config[_0x190b('0xdd')],_0x190b('0xde'),_0x338380[_0x190b('0xdf')]));}})[_0x190b('0x2d')](handleError(_0x6a8c46,null));};exports['close']=function(_0x43a16b,_0x1f735d){var _0x38b864=null;var _0x30a546=null;var _0x39f7b9=null;var _0x22aa8f=null;if(_0x43a16b[_0x190b('0xbf')]['id']){delete _0x43a16b[_0x190b('0xbf')]['id'];}if(_0x43a16b[_0x190b('0xbf')]['mailTranscript']){_0x22aa8f=path['join'](config[_0x190b('0xdd')],_0x190b('0xe0'),util['format']('transcript-%s.txt',Date[_0x190b('0xe1')]()));_0x43a16b[_0x190b('0xbf')][_0x190b('0xe2')]=_0x22aa8f;}return db[_0x190b('0x43')][_0x190b('0x67')]({'where':{'id':_0x43a16b[_0x190b('0xba')]['id']},'include':[{'model':db[_0x190b('0xca')],'as':_0x190b('0xe3'),'include':[{'model':db[_0x190b('0x76')],'as':_0x190b('0x76')}]}]})[_0x190b('0x24')](handleEntityNotFound(_0x1f735d,null))['then'](saveUpdates(_0x43a16b['body'],null))[_0x190b('0x24')](function(_0x19503f){if(_0x19503f){_0x38b864=_0x19503f;return db[_0x190b('0xe4')]['find']({'where':{'id':_0x38b864[_0x190b('0x7f')]}});}})['then'](function(_0x184392){if(_0x184392){_0x39f7b9=_0x184392;return db[_0x190b('0xe5')][_0x190b('0x67')]({'where':{'id':_0x38b864[_0x190b('0x70')]}});}})['then'](function(_0x1daa73){if(_0x1daa73){_0x30a546=_0x1daa73;if(_0x22aa8f){var _0x547673=null;for(var _0x3c7c01=0x1;_0x3c7c01<_0x38b864['Messages'][_0x190b('0x4e')];++_0x3c7c01){_0x547673=_0x38b864[_0x190b('0xe3')][_0x3c7c01];var _0xf06bf1=_0x547673['UserId']?util[_0x190b('0xe6')](_0x190b('0xe7'),_0x39f7b9['agentAlias'],_0x547673[_0x190b('0x79')]):'System';var _0x377e7b=_0x43a16b[_0x190b('0xbf')][_0x190b('0xe8')]||util[_0x190b('0xe6')](_0x190b('0xe7'),_0x190b('0xe9'),_0x547673[_0x190b('0x70')]);switch(_0x39f7b9[_0x190b('0xea')]){case'website_alias':_0xf06bf1=_0x547673[_0x190b('0x79')]?util[_0x190b('0xe6')](_0x190b('0xe7'),_0x39f7b9[_0x190b('0xeb')],_0x547673[_0x190b('0x79')]):_0x190b('0xec');break;case _0x190b('0xed'):_0xf06bf1=_0x547673[_0x190b('0x79')]?_0x547673[_0x190b('0x76')][_0x190b('0xee')]||_0x547673[_0x190b('0x76')][_0x190b('0x3d')]:_0x190b('0xec');break;case _0x190b('0xef'):_0xf06bf1=_0x547673[_0x190b('0x79')]?_0x547673[_0x190b('0x76')][_0x190b('0x3d')]:_0x190b('0xec');break;default:_0xf06bf1=_0x547673[_0x190b('0x79')]?util[_0x190b('0xe6')](_0x190b('0xe7'),_0x39f7b9[_0x190b('0xeb')],_0x547673['UserId']):_0x190b('0xec');}var _0x5a898c=util[_0x190b('0xe6')](_0x190b('0xf0'),moment(_0x547673[_0x190b('0xf1')])[_0x190b('0xe6')](_0x190b('0xf2')),_0x547673[_0x190b('0xf3')]==='in'?_0x377e7b:_0xf06bf1,_0x547673[_0x190b('0xbf')]);if(!_0x547673['secret']){fs[_0x190b('0xf4')](_0x22aa8f,_0x5a898c);}}return db['MailAccount'][_0x190b('0xc1')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x190b('0xf5'),'raw':!![]}]});}}})[_0x190b('0x24')](function(_0x53757a){if(_0x53757a&&_0x53757a['Smtp']&&_0x43a16b[_0x190b('0xbf')]){var _0x460e5e={'tls':{'rejectUnauthorized':![]}};if(_0x53757a['Smtp'][_0x190b('0xf6')]){_0x460e5e[_0x190b('0xf6')]=_0x53757a[_0x190b('0xf5')]['service'];}else{_0x460e5e[_0x190b('0xf7')]=_0x53757a[_0x190b('0xf5')][_0x190b('0xf7')];_0x460e5e['port']=_0x53757a[_0x190b('0xf5')][_0x190b('0xf8')];_0x460e5e['secure']=_0x53757a[_0x190b('0xf5')]['secure'];}if(_0x53757a[_0x190b('0xf5')][_0x190b('0xf9')]){_0x460e5e['auth']={'user':_0x53757a['Smtp']['user'],'pass':_0x53757a['Smtp'][_0x190b('0xfa')]};}return respondWithRpcPromise(_0x190b('0xfb'),_0x190b('0xfc'),{'account':_0x460e5e,'message':{'from':util['format'](_0x190b('0xfd'),_0x53757a[_0x190b('0x3a')],_0x53757a[_0x190b('0xfe')]||_0x53757a[_0x190b('0xf5')]['user']),'to':_0x43a16b[_0x190b('0xbf')]['mailTranscript'],'subject':_0x190b('0xff'),'text':util['format'](_0x190b('0x100'),_0x43a16b['body']['mailTranscript']),'attachments':[{'path':_0x22aa8f}]}})['then'](function(){return _0x38b864;})[_0x190b('0x2d')](function(_0x5678d6){console[_0x190b('0x28')](_0x5678d6);});}else{return _0x38b864;}})[_0x190b('0x24')](respondWithStatusCode(_0x1f735d,0xc8))[_0x190b('0x2d')](handleError(_0x1f735d,null));};exports[_0x190b('0x101')]=function(_0x2c12ca,_0x14050e,_0xee7a47){return db[_0x190b('0xca')][_0x190b('0x67')]({'where':{'id':_0x2c12ca[_0x190b('0xba')]['id']}})['then'](handleEntityNotFound(_0x14050e,null))[_0x190b('0x24')](function(_0x31f9e5){if(_0x31f9e5){return _0x31f9e5[_0x190b('0x101')](_0x2c12ca['body'][_0x190b('0x102')],_[_0x190b('0x103')](_0x2c12ca[_0x190b('0xbf')],[_0x190b('0x102'),'id'])||{});}})[_0x190b('0x24')](respondWithResult(_0x14050e,null))[_0x190b('0x2d')](handleError(_0x14050e,null));};exports[_0x190b('0x104')]=function(_0x7d4b94,_0x5a0347,_0x203400){var _0x81d6a8={'raw':![],'where':{}};var _0x35f578={};var _0x4a48ee={'count':0x0,'rows':[]};return db[_0x190b('0x43')]['findOne']({'where':{'id':_0x7d4b94[_0x190b('0xba')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x5a0347,null))[_0x190b('0x24')](function(_0x1a3369){if(_0x1a3369){_0x35f578[_0x190b('0x47')]=_[_0x190b('0xbb')](db[_0x190b('0xca')][_0x190b('0x44')]);_0x35f578[_0x190b('0x49')]=_['keys'](_0x7d4b94[_0x190b('0x49')]);_0x35f578[_0x190b('0x4a')]=_[_0x190b('0x4b')](_0x35f578['model'],_0x35f578[_0x190b('0x49')]);_0x81d6a8[_0x190b('0x4c')]=_[_0x190b('0x4b')](_0x35f578[_0x190b('0x47')],qs['fields'](_0x7d4b94[_0x190b('0x49')][_0x190b('0x4d')]));_0x81d6a8[_0x190b('0x4c')]=_0x81d6a8['attributes'][_0x190b('0x4e')]?_0x81d6a8[_0x190b('0x4c')]:_0x35f578[_0x190b('0x47')];if(!_0x7d4b94[_0x190b('0x49')][_0x190b('0x105')](_0x190b('0x4f'))){_0x81d6a8['limit']=qs[_0x190b('0x33')](_0x7d4b94[_0x190b('0x49')][_0x190b('0x33')]);_0x81d6a8[_0x190b('0x32')]=qs[_0x190b('0x32')](_0x7d4b94[_0x190b('0x49')][_0x190b('0x32')]);}_0x81d6a8[_0x190b('0x50')]=qs[_0x190b('0x51')](_0x7d4b94[_0x190b('0x49')][_0x190b('0x51')]);_0x81d6a8[_0x190b('0x52')]=qs[_0x190b('0x4a')](_[_0x190b('0x106')](_0x7d4b94[_0x190b('0x49')],_0x35f578['filters']));_0x81d6a8[_0x190b('0x52')][_0x190b('0xb7')]=_0x1a3369['id'];if(_0x7d4b94['query']['filter']){_0x81d6a8[_0x190b('0x52')]=_[_0x190b('0xa2')](_0x81d6a8[_0x190b('0x52')],{'$or':_[_0x190b('0x48')](_0x81d6a8[_0x190b('0x4c')],function(_0x4e7195){var _0x55b875={};_0x55b875[_0x4e7195]={'$like':'%'+_0x7d4b94[_0x190b('0x49')]['filter']+'%'};return _0x55b875;})});}if(_0x7d4b94[_0x190b('0x49')]['$gte']){var _0x39bfcf=_0x7d4b94[_0x190b('0x49')]['$gte'][_0x190b('0x3f')](',');var _0x2ccb0a={};_0x2ccb0a[_0x39bfcf[0x0]]={'$gte':moment(_0x39bfcf[0x1])[_0x190b('0xe6')](_0x190b('0x107'))};_0x81d6a8[_0x190b('0x52')]=_['merge'](_0x81d6a8[_0x190b('0x52')],_0x2ccb0a);}_0x81d6a8=_['merge']({},_0x81d6a8,_0x7d4b94['options']);return db['ChatMessage']['count']({'where':_0x81d6a8[_0x190b('0x52')]})[_0x190b('0x24')](function(_0x1ad936){_0x4a48ee[_0x190b('0x31')]=_0x1ad936;if(_0x7d4b94[_0x190b('0x49')]['includeAll']){_0x81d6a8[_0x190b('0xbd')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x81d6a8);})[_0x190b('0x24')](function(_0xce262c){_0x4a48ee[_0x190b('0xb9')]=_0xce262c;return _0x4a48ee;});}})[_0x190b('0x24')](respondWithFilteredResult(_0x5a0347,_0x81d6a8))[_0x190b('0x2d')](handleError(_0x5a0347,null));};exports[_0x190b('0x108')]=function(_0x30aff0,_0x3941a5,_0x1cbdd5){var _0x53b978={'where':{}},_0x4f7870={},_0x15368b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x190b('0xc1')]({'where':{'id':_0x30aff0['params']['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x3941a5,null))[_0x190b('0x24')](function(_0x912e45){if(_0x912e45){_0x4f7870[_0x190b('0x47')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x4f7870['query']=_['keys'](_0x30aff0[_0x190b('0x49')]);_0x4f7870[_0x190b('0x4a')]=_[_0x190b('0x4b')](_0x4f7870['model'],_0x4f7870[_0x190b('0x49')]);_0x53b978[_0x190b('0x4c')]=_['intersection'](_0x4f7870[_0x190b('0x47')],qs[_0x190b('0x4d')](_0x30aff0[_0x190b('0x49')][_0x190b('0x4d')]));_0x53b978[_0x190b('0x4c')]=_0x53b978['attributes'][_0x190b('0x4e')]?_0x53b978[_0x190b('0x4c')]:_0x4f7870[_0x190b('0x47')];if(!_0x30aff0[_0x190b('0x49')][_0x190b('0x105')](_0x190b('0x4f'))){_0x53b978[_0x190b('0x33')]=qs[_0x190b('0x33')](_0x30aff0[_0x190b('0x49')][_0x190b('0x33')]);_0x53b978[_0x190b('0x32')]=qs['offset'](_0x30aff0[_0x190b('0x49')][_0x190b('0x32')]);}_0x53b978[_0x190b('0x50')]=qs[_0x190b('0x51')](_0x30aff0[_0x190b('0x49')][_0x190b('0x51')]);_0x53b978[_0x190b('0x52')]=qs[_0x190b('0x4a')](_[_0x190b('0x106')](_0x30aff0['query'],_0x4f7870[_0x190b('0x4a')]));_0x53b978['where'][_0x190b('0xb7')]=_0x912e45['id'];if(_0x30aff0['query'][_0x190b('0x8b')]){_0x53b978['where']=_['merge'](_0x53b978[_0x190b('0x52')],{'$or':_[_0x190b('0x48')](_0x53b978['attributes'],function(_0x273d08){var _0x50b27f={};_0x50b27f[_0x273d08]={'$like':'%'+_0x30aff0['query'][_0x190b('0x8b')]+'%'};return _0x50b27f;})});}_0x53b978[_0x190b('0x52')][_0x190b('0x109')]=![];if(_0x30aff0[_0x190b('0x49')]['id']){_0x53b978['where']['id']={'$gt':_0x30aff0[_0x190b('0x49')]['id']};}_0x53b978=_[_0x190b('0xa2')]({},_0x53b978,_0x30aff0[_0x190b('0x10a')]);return db[_0x190b('0xca')][_0x190b('0x31')]({'where':_0x53b978[_0x190b('0x52')]})[_0x190b('0x24')](function(_0x231741){_0x15368b[_0x190b('0x31')]=_0x231741;_0x53b978[_0x190b('0xbd')]=[];if(_0x30aff0[_0x190b('0x49')][_0x190b('0x10b')]){_0x53b978['include']['push']({'model':db['User'],'as':_0x190b('0x76'),'attributes':['id',_0x190b('0x3d'),_0x190b('0xee')]});}if(_0x30aff0[_0x190b('0x49')][_0x190b('0xbc')]){_0x53b978[_0x190b('0xbd')]=[{'all':!![]}];}return db[_0x190b('0xca')][_0x190b('0x10c')](_0x53b978);})[_0x190b('0x24')](function(_0x1ef815){_0x15368b[_0x190b('0xb9')]=_0x1ef815;return _0x15368b;});}})['then'](respondWithFilteredResult(_0x3941a5,_0x53b978))[_0x190b('0x2d')](handleError(_0x3941a5,null));};exports[_0x190b('0x10d')]=function(_0x2a0434,_0x6b4608,_0x2f6a03){return db[_0x190b('0x43')][_0x190b('0x67')]({'where':{'id':_0x2a0434[_0x190b('0xba')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x6b4608,null))[_0x190b('0x24')](function(_0x5a210c){if(_0x5a210c){return _0x5a210c['setTags'](_0x2a0434['body'][_0x190b('0x102')],_[_0x190b('0x103')](_0x2a0434['body'],[_0x190b('0x102'),'id'])||{})[_0x190b('0x10e')](function(){return db[_0x190b('0x73')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x2a0434[_0x190b('0xbf')][_0x190b('0x102')]}});})['then'](function(_0xbaaa1c){socket[_0x190b('0x10f')](_0x190b('0x110'),{'id':Number(_0x2a0434[_0x190b('0xba')]['id']),'tags':_0xbaaa1c||[]});return{'id':Number(_0x2a0434[_0x190b('0xba')]['id']),'tags':_0xbaaa1c||[]};});}})[_0x190b('0x24')](respondWithResult(_0x6b4608,null))[_0x190b('0x2d')](handleError(_0x6b4608,null));};exports['removeTags']=function(_0x2a5541,_0x379828,_0xd919af){return db[_0x190b('0x43')][_0x190b('0x67')]({'where':{'id':_0x2a5541[_0x190b('0xba')]['id']}})[_0x190b('0x24')](handleEntityNotFound(_0x379828,null))['then'](function(_0x6ffaa8){if(_0x6ffaa8){return _0x6ffaa8['removeTags'](_0x2a5541['query']['ids']);}})[_0x190b('0x24')](respondWithStatusCode(_0x379828,null))[_0x190b('0x2d')](handleError(_0x379828,null));};exports[_0x190b('0xdb')]=function(_0x1a62d0,_0x2eb729){var _0x24e48f=moment()[_0x190b('0x111')]()['toString']();var _0x25fc8a=path[_0x190b('0xdc')](config[_0x190b('0xdd')],_0x190b('0x112'),_0x190b('0x113'),_0x190b('0x114'));var _0x29609a=path[_0x190b('0xdc')](config[_0x190b('0xdd')],_0x190b('0x112'),_0x190b('0x113'),_0x190b('0x115'));var _0x1453b1=path['join'](_0x25fc8a,_0x24e48f);var _0x417a42=util[_0x190b('0xe6')](_0x190b('0x116'),_0x1a62d0[_0x190b('0xba')]['id'],_0x24e48f);var _0x303049=path[_0x190b('0xdc')](_0x25fc8a,_0x417a42);var _0x79ce80=[];_0x79ce80[_0x190b('0x41')]({'model':db['User'],'as':_0x190b('0x76'),'attributes':['id',_0x190b('0x3d')],'raw':!![]});_0x79ce80[_0x190b('0x41')]({'model':db[_0x190b('0xe5')],'as':_0x190b('0x6d'),'attributes':['id',_0x190b('0x117'),_0x190b('0x118')],'raw':!![]});if(_0x1a62d0[_0x190b('0x49')][_0x190b('0x115')]){_0x79ce80[_0x190b('0x41')]({'model':db[_0x190b('0xd8')],'as':_0x190b('0xd8'),'raw':!![]});}var _0x4df287=[{'model':db[_0x190b('0xca')],'as':_0x190b('0xe3'),'attributes':['id',_0x190b('0xbf'),_0x190b('0xf1'),'direction',_0x190b('0x109'),'read'],'include':_0x79ce80}];_0x4df287['push']({'model':db[_0x190b('0xe4')],'as':'Account','attributes':['id','name']});_0x4df287['push']({'model':db[_0x190b('0x76')],'as':'Owner','attributes':['id',_0x190b('0x3d')]});return db[_0x190b('0x43')][_0x190b('0x67')]({'where':{'id':_0x1a62d0[_0x190b('0xba')]['id']},'include':_0x4df287})[_0x190b('0x24')](handleEntityNotFound(_0x2eb729,null))[_0x190b('0x24')](function(_0x1d9be4){if(_0x1d9be4){var _0x5c7890=_0x1d9be4[_0x190b('0x119')]({'plain':!![]});fs['mkdirSync'](_0x1453b1);var _0x29b2d1={'format':'A4','border':_0x190b('0x11a'),'header':{'height':_0x190b('0x11b'),'contents':{'first':_0x190b('0x11c')}},'footer':{'height':'30px','contents':{'default':util[_0x190b('0xe6')](_0x190b('0x11d'),util[_0x190b('0xe6')](_0x190b('0x11e'),_0x190b('0x11f'),_0x5c7890['id']),moment()[_0x190b('0xe6')](_0x190b('0x120'))[_0x190b('0xa0')]())}}};var _0x2d6db8={'channel':'Chat','account':_0x5c7890[_0x190b('0x121')]['name'],'agent':_0x5c7890[_0x190b('0x122')]?_0x5c7890[_0x190b('0x122')][_0x190b('0x3d')]:_0x190b('0x123'),'createdAt':moment(_0x5c7890[_0x190b('0xf1')])[_0x190b('0xe6')](_0x190b('0x107'))[_0x190b('0xa0')](),'closedAt':_0x5c7890[_0x190b('0xd1')]?moment(_0x5c7890['closedAt'])[_0x190b('0xe6')](_0x190b('0x107'))[_0x190b('0xa0')]():'','disposition':_0x5c7890['disposition'],'chatInfo':{'browser':_0x5c7890[_0x190b('0x124')],'os':_0x5c7890[_0x190b('0x125')],'referer':_0x5c7890[_0x190b('0x126')],'customerIp':_0x5c7890[_0x190b('0x127')],'customerPort':_0x5c7890['customerPort']?_0x5c7890['customerPort']:_0x190b('0x123')},'messages':_(_0x5c7890['Messages'])['tail']()[_0x190b('0x8b')]({'secret':![]})['map'](function(_0x569762){if(_0x569762[_0x190b('0xd8')]){var _0x1fdda7=path[_0x190b('0xdc')](_0x29609a,_0x569762[_0x190b('0xd8')][_0x190b('0xdf')]);if(fs[_0x190b('0x128')](_0x1fdda7)){fs[_0x190b('0x129')](_0x1fdda7)[_0x190b('0x12a')](fs['createWriteStream'](path[_0x190b('0xdc')](_0x1453b1,_0x569762[_0x190b('0xd8')][_0x190b('0xdf')])));}}return{'date':moment(_0x569762[_0x190b('0xf1')])[_0x190b('0xe6')](_0x190b('0x107'))[_0x190b('0xa0')](),'sender':_0x569762[_0x190b('0xf3')]==='out'?_0x569762[_0x190b('0x76')]?_0x569762[_0x190b('0x76')][_0x190b('0x3d')]:'System':_0x569762['Contact'][_0x190b('0x117')]+(_0x569762['Contact'][_0x190b('0x118')]?'\x20'+_0x569762[_0x190b('0x6d')][_0x190b('0x118')]:''),'body':_0x569762[_0x190b('0xd8')]?_0x569762[_0x190b('0xd8')][_0x190b('0xdf')]:_0x569762[_0x190b('0xbf')],'direction':_0x569762['direction']===_0x190b('0xc8')?'A':'C','secret':_0x569762[_0x190b('0x109')],'read':_0x569762[_0x190b('0x87')],'attachment':_0x569762['Attachment']};})[_0x190b('0x69')]()};return ejs[_0x190b('0x12b')](path['join'](config[_0x190b('0xdd')],_0x190b('0x112'),_0x190b('0x12c'),_0x190b('0x12d')),{'interaction':_0x2d6db8})[_0x190b('0x24')](function(_0x21724c){return new BPromise(function(_0x4a846d,_0x2b5c3a){pdf[_0x190b('0xbe')](_0x21724c,_0x29b2d1)[_0x190b('0x12e')](path['join'](_0x1453b1,_0x190b('0x12f')+_0x5c7890['id']+'-'+_0x24e48f+_0x190b('0x130')),function(_0x2b6794,_0x1e8422){if(_0x2b6794)return _0x2b5c3a(_0x2b6794);_0x4a846d(_0x1e8422);});});})['then'](function(){return new BPromise(function(_0x26e8c7,_0x558fdd){zipdir(_0x1453b1,{'saveTo':_0x303049},function(_0x3d5657,_0x7b6620){if(_0x3d5657)return _0x558fdd(_0x3d5657);return _0x26e8c7(_0x7b6620);});})[_0x190b('0x24')](function(){return new BPromise(function(_0x581951,_0x7f4ab5){rimraf(_0x1453b1,function(_0x515e01){if(_0x515e01)_0x7f4ab5(_0x515e01);return _0x581951();});});})[_0x190b('0x24')](function(){return _0x2eb729[_0x190b('0xdb')](_0x303049,_0x417a42,function(_0x5dd87f){if(_0x5dd87f){console['log'](_0x190b('0x131'),_0x5dd87f);}else{fs[_0x190b('0x132')](_0x303049);}});});});}else{return _0x2eb729[_0x190b('0x2e')](0xc8);}})[_0x190b('0x2d')](handleError(_0x2eb729,null));};
\ No newline at end of file
+var _0xf2e3=['clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','ChatInteraction','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ChatInteractionId','all','rows','includeAll','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','join','root','server/files/attachments/','close','mailTranscript','pathTranscript','CmContact','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','addMessage','omit','ids','getMessages','include','findAll','getMyMessages','includeAgent','alias','addTags','setTags','spread','removeTags','download','server','files','attachments','transcript-%d-%s.zip','firstName','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Chat','YYYY-MM-DD','Account','Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','lastName','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','Users','map','fullname','TagIds','split','Tags','push','index','rawAttributes','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filters','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','type','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes'];(function(_0x1101cd,_0x471f02){var _0x48085c=function(_0x2451d6){while(--_0x2451d6){_0x1101cd['push'](_0x1101cd['shift']());}};_0x48085c(++_0x471f02);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xf2e3[_0x2c7618];return _0x5ce3f0;};'use strict';var pdf=require(_0x3f2e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3f2e('0x1'));var zipdir=require(_0x3f2e('0x2'));var jsonpatch=require(_0x3f2e('0x3'));var rp=require(_0x3f2e('0x4'));var moment=require(_0x3f2e('0x5'));var BPromise=require(_0x3f2e('0x6'));var Mustache=require(_0x3f2e('0x7'));var util=require(_0x3f2e('0x8'));var path=require(_0x3f2e('0x9'));var sox=require('sox');var csv=require(_0x3f2e('0xa'));var ejs=require(_0x3f2e('0xb'));var fs=require('fs');var _=require(_0x3f2e('0xc'));var squel=require(_0x3f2e('0xd'));var crypto=require(_0x3f2e('0xe'));var jsforce=require(_0x3f2e('0xf'));var deskjs=require(_0x3f2e('0x10'));var toCsv=require(_0x3f2e('0xa'));var querystring=require(_0x3f2e('0x11'));var Papa=require(_0x3f2e('0x12'));var Redis=require(_0x3f2e('0x13'));var authService=require(_0x3f2e('0x14'));var qs=require(_0x3f2e('0x15'));var as=require(_0x3f2e('0x16'));var hardwareService=require(_0x3f2e('0x17'));var logger=require(_0x3f2e('0x18'))(_0x3f2e('0x19'));var utils=require(_0x3f2e('0x1a'));var config=require(_0x3f2e('0x1b'));var db=require('../../mysqldb')['db'];config[_0x3f2e('0x1c')]=_[_0x3f2e('0x1d')](config['redis'],{'host':_0x3f2e('0x1e'),'port':0x18eb});var socket=require(_0x3f2e('0x1f'))(new Redis(config[_0x3f2e('0x1c')]));require(_0x3f2e('0x20'))[_0x3f2e('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3f2e('0x22')][_0x3f2e('0x23')]({'port':0x232b});var client9004=jayson[_0x3f2e('0x22')]['http']({'port':0x232c});function checkPasswordPattern(_0x43f69e,_0x218b44,_0x17ef58){if(_0x17ef58){var _0x2c4feb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c4feb[_0x3f2e('0x24')](_0x218b44)){return _0x43f69e;}else{throw new db[(_0x3f2e('0x25'))][(_0x3f2e('0x26'))](_0x3f2e('0x27'));}}else{return _0x43f69e;}}function respondWithRpcPromise(_0x178283,_0xc00add,_0x107876,_0x5b9989){return new BPromise(function(_0x40e28f,_0x243822){var _0x38925f=_0x5b9989||client;return _0x38925f[_0x3f2e('0x28')](_0x178283,_0x107876)[_0x3f2e('0x29')](function(_0x4eb1e7){logger['info'](_0x3f2e('0x2a'),_0xc00add,_0x3f2e('0x2b'));logger[_0x3f2e('0x2c')](_0x3f2e('0x2d'),_0xc00add,_0x3f2e('0x2b'),JSON[_0x3f2e('0x2e')](_0x4eb1e7));if(_0x4eb1e7['error']){if(_0x4eb1e7['error'][_0x3f2e('0x2f')]===0x1f4){logger[_0x3f2e('0x30')]('ChatInteraction,\x20%s,\x20%s',_0xc00add,_0x4eb1e7['error'][_0x3f2e('0x31')]);return _0x243822(_0x4eb1e7['error'][_0x3f2e('0x31')]);}logger[_0x3f2e('0x30')]('ChatInteraction,\x20%s,\x20%s',_0xc00add,_0x4eb1e7['error']['message']);return _0x40e28f(_0x4eb1e7[_0x3f2e('0x30')][_0x3f2e('0x31')]);}else{logger['info'](_0x3f2e('0x2a'),_0xc00add,'request\x20sent');_0x40e28f(_0x4eb1e7[_0x3f2e('0x32')]['message']);}})[_0x3f2e('0x33')](function(_0x8247fa){logger[_0x3f2e('0x30')](_0x3f2e('0x2a'),_0xc00add,_0x8247fa);_0x243822(_0x8247fa);});});}function respondWithStatusCode(_0x11bad1,_0x4799d3){_0x4799d3=_0x4799d3||0xcc;return function(_0x426d68){if(_0x426d68){return _0x11bad1[_0x3f2e('0x34')](_0x4799d3);}return _0x11bad1['status'](_0x4799d3)['end']();};}function respondWithResult(_0x2b9fda,_0x1e5db4){_0x1e5db4=_0x1e5db4||0xc8;return function(_0x35f421){if(_0x35f421){return _0x2b9fda[_0x3f2e('0x35')](_0x1e5db4)['json'](_0x35f421);}};}function respondWithFilteredResult(_0x3eaaeb,_0x465a94){return function(_0x37ddfe){if(_0x37ddfe){var _0x4d9b8c=_0x37ddfe['count'],_0x349ed4=_0x465a94[_0x3f2e('0x36')],_0x2741d0=_0x465a94[_0x3f2e('0x36')]+_0x465a94[_0x3f2e('0x37')],_0xa6a8ab;if(_0x2741d0>=_0x4d9b8c){_0x2741d0=_0x4d9b8c;_0xa6a8ab=0xc8;}else{_0xa6a8ab=0xce;}_0x3eaaeb[_0x3f2e('0x35')](_0xa6a8ab);return _0x3eaaeb[_0x3f2e('0x38')](_0x3f2e('0x39'),_0x349ed4+'-'+_0x2741d0+'/'+_0x4d9b8c)['json'](_0x37ddfe);}return null;};}function patchUpdates(_0x2f5a2a){return function(_0x3481f2){try{jsonpatch[_0x3f2e('0x3a')](_0x3481f2,_0x2f5a2a,!![]);}catch(_0x46953f){return BPromise[_0x3f2e('0x3b')](_0x46953f);}return _0x3481f2[_0x3f2e('0x3c')]();};}function saveUpdates(_0x19fbd9,_0x5660bd){return function(_0x53a671){if(_0x53a671){return _0x53a671[_0x3f2e('0x3d')](_0x19fbd9)[_0x3f2e('0x29')](function(_0x239af7){return _0x239af7;});}return null;};}function removeEntity(_0x4e6161,_0x5da5c3){return function(_0x5349d0){if(_0x5349d0){return _0x5349d0[_0x3f2e('0x3e')]()[_0x3f2e('0x29')](function(){_0x4e6161[_0x3f2e('0x35')](0xcc)[_0x3f2e('0x3f')]();});}};}function handleEntityNotFound(_0x10fbc3,_0x39ba6f){return function(_0x35937a){if(!_0x35937a){_0x10fbc3[_0x3f2e('0x34')](0x194);}return _0x35937a;};}function handleError(_0x44e7b9,_0x556b38){_0x556b38=_0x556b38||0x1f4;return function(_0x1ff764){logger[_0x3f2e('0x30')](_0x1ff764[_0x3f2e('0x40')]);if(_0x1ff764[_0x3f2e('0x41')]){delete _0x1ff764['name'];}_0x44e7b9[_0x3f2e('0x35')](_0x556b38)[_0x3f2e('0x42')](_0x1ff764);};}function getInteractionUsers(_0x3f41af,_0x120abe){return new BPromise(function(_0x44da09,_0x69f940){try{if(_0x120abe[_0x3f41af['id']]){_0x3f41af[_0x3f2e('0x43')]=_[_0x3f2e('0x44')](_0x120abe[_0x3f41af['id']],function(_0x4c5ac2){return{'id':_0x4c5ac2['id'],'fullname':_0x4c5ac2[_0x3f2e('0x45')]};});}}catch(_0x408fd1){_0x69f940(_0x408fd1);}_0x44da09(_0x3f41af);});}function getInteractionTags(_0x238b6b,_0x17dda3){return new BPromise(function(_0x5abaca,_0x2cc95c){try{if(_0x238b6b[_0x3f2e('0x46')]){_0x238b6b['Tags']=[];_0x238b6b[_0x3f2e('0x46')][_0x3f2e('0x47')](',')['forEach'](function(_0x30c796){_0x238b6b[_0x3f2e('0x48')][_0x3f2e('0x49')](_0x17dda3[_0x30c796]);});}delete _0x238b6b[_0x3f2e('0x46')];}catch(_0x59e383){_0x2cc95c(_0x59e383);}_0x5abaca(_0x238b6b);});}function updateChatInteraction(_0x39d324,_0x31283b,_0x4cec56){return new BPromise(function(_0x5a6cbe,_0x2be69f){return getInteractionUsers(_0x39d324,_0x4cec56)[_0x3f2e('0x29')](function(_0xe67d03){return getInteractionTags(_0xe67d03,_0x31283b);})['then'](function(_0x1ed05d){_0x5a6cbe(_0x1ed05d);})[_0x3f2e('0x33')](function(_0x43b35a){_0x2be69f(_0x43b35a);});});}exports[_0x3f2e('0x4a')]=function(_0x24df56,_0x3668dc){var _0x19e2ae={},_0x913778={},_0x375484={'count':0x0,'rows':[]};var _0x1f7d6e=_['map'](db['ChatInteraction'][_0x3f2e('0x4b')],function(_0x38900c){return{'name':_0x38900c['fieldName'],'type':_0x38900c['type'][_0x3f2e('0x4c')]};});_0x913778[_0x3f2e('0x4d')]=_[_0x3f2e('0x44')](_0x1f7d6e,'name');_0x913778[_0x3f2e('0x4e')]=_[_0x3f2e('0x4f')](_0x24df56[_0x3f2e('0x4e')]);_0x913778['filters']=_[_0x3f2e('0x50')](_0x913778[_0x3f2e('0x4d')],_0x913778[_0x3f2e('0x4e')]);_0x19e2ae['attributes']=_[_0x3f2e('0x50')](_0x913778[_0x3f2e('0x4d')],qs[_0x3f2e('0x51')](_0x24df56['query'][_0x3f2e('0x51')]));_0x19e2ae['attributes']=_0x19e2ae[_0x3f2e('0x52')]['length']?_0x19e2ae['attributes']:_0x913778[_0x3f2e('0x4d')];if(!_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x53')](_0x3f2e('0x54'))){_0x19e2ae[_0x3f2e('0x37')]=qs['limit'](_0x24df56['query'][_0x3f2e('0x37')]);_0x19e2ae[_0x3f2e('0x36')]=qs[_0x3f2e('0x36')](_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x36')]);}_0x19e2ae[_0x3f2e('0x55')]=qs[_0x3f2e('0x56')](_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x56')]);_0x19e2ae['where']=qs['filters'](_[_0x3f2e('0x57')](_0x24df56['query'],_0x913778[_0x3f2e('0x58')]),_0x1f7d6e);var _0x453197=[];var _0x3b7984=squel[_0x3f2e('0x59')]()['field']('id')[_0x3f2e('0x5a')]('name')[_0x3f2e('0x5a')](_0x3f2e('0x5b'))['from'](_0x3f2e('0x5c'));var _0x4bf310=squel[_0x3f2e('0x59')]()[_0x3f2e('0x5a')](_0x3f2e('0x5d'))['field'](_0x3f2e('0x5e'))[_0x3f2e('0x5a')](_0x3f2e('0x5f'))[_0x3f2e('0x60')](_0x3f2e('0x61'),'ui')[_0x3f2e('0x62')](_0x3f2e('0x63'),'u',_0x3f2e('0x64'));var _0x9c5a91=squel[_0x3f2e('0x59')]()['from'](_0x3f2e('0x65'),'i')[_0x3f2e('0x62')](_0x3f2e('0x66'),'c',_0x3f2e('0x67'))[_0x3f2e('0x62')](_0x3f2e('0x63'),'o',_0x3f2e('0x68'))[_0x3f2e('0x62')]('chat_websites','a',_0x3f2e('0x69'))[_0x3f2e('0x62')](_0x3f2e('0x6a'),'me',_0x3f2e('0x6b'))[_0x3f2e('0x62')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0x3f2e('0x62')](_0x3f2e('0x5c'),'t',_0x3f2e('0x6c'));var _0x5c639f=squel['expr']();var _0x49c144=[];var _0x2e2e53=squel[_0x3f2e('0x6d')]();var _0xd3471f;if(_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x6e')]){_0xd3471f=as['parseSearch'](_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x6e')]);var _0x5520d2=_0xd3471f[_0x3f2e('0x6f')];for(var _0x3c0f04=0x0;_0x3c0f04<_0xd3471f[_0x3f2e('0x70')][_0x3f2e('0x71')];_0x3c0f04++){var _0x567e9d=_0xd3471f[_0x3f2e('0x70')][_0x3c0f04];var _0x5da1f3='i';var _0x4dc239=_[_0x3f2e('0x72')](_0x1f7d6e,['name',_0x567e9d['field']]);if(!_0x4dc239){switch(_0x567e9d[_0x3f2e('0x5a')]){case'unreadMessages':if(_0x567e9d[_0x3f2e('0x73')]==0x1){_0x9c5a91[_0x3f2e('0x74')]('`'+_0x567e9d[_0x3f2e('0x5a')]+_0x3f2e('0x75'));}else{_0x9c5a91['having']('`'+_0x567e9d[_0x3f2e('0x5a')]+_0x3f2e('0x76'));}break;case _0x3f2e('0x77'):if(_0x567e9d[_0x3f2e('0x78')]==='$substring'){if(_0x567e9d[_0x3f2e('0x73')]['split']('\x20')['length']>0x1){_0x5c639f[_0x5520d2](_0x3f2e('0x79'),qs[_0x3f2e('0x7a')](_0x567e9d['value']),null);}else{var _0x496964='%'+_0x567e9d[_0x3f2e('0x73')]+'%';_0x5c639f[_0x5520d2](_0x3f2e('0x7b'),_0x496964,_0x496964,_0x496964);}}else{_0x4dc239=_[_0x3f2e('0x72')](_0x1f7d6e,[_0x3f2e('0x41'),_0x3f2e('0x7c')]);_0x567e9d[_0x3f2e('0x5a')]=_0x3f2e('0x7c');_0x342d59=as[_0x3f2e('0x7d')](_0x5da1f3,_0x4dc239['type'],_0x567e9d);_0x5c639f[_0x5520d2](_0x342d59[_0x3f2e('0x7e')],_0x342d59['value'][_0x3f2e('0x7f')],_0x342d59[_0x3f2e('0x73')][_0x3f2e('0x3f')]);}break;case _0x3f2e('0x80'):var _0xf92a73=_0x567e9d[_0x3f2e('0x73')][_0x3f2e('0x47')](',')[_0x3f2e('0x44')](function(_0x4f42be){return Number(_0x4f42be);});_0xf92a73[_0x3f2e('0x81')](function(_0x5a93e5){_0x2e2e53['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5a93e5+',%');});_0x49c144=_[_0x3f2e('0x82')](_0x49c144,_0xf92a73);break;case _0x3f2e('0x83'):if(_0x567e9d['operator']===_0x3f2e('0x84')){_0x5c639f[_0x5520d2](_0x3f2e('0x85'),'%'+_0x567e9d['value']+'%',null);}else{_0x4dc239=_[_0x3f2e('0x72')](_0x1f7d6e,['name','UserId']);_0x567e9d[_0x3f2e('0x5a')]=_0x3f2e('0x86');_0x342d59=as[_0x3f2e('0x7d')](_0x5da1f3,_0x4dc239['type'],_0x567e9d);_0x5c639f[_0x5520d2](_0x342d59['text'],_0x342d59[_0x3f2e('0x73')][_0x3f2e('0x7f')],_0x342d59[_0x3f2e('0x73')][_0x3f2e('0x3f')]);}break;case _0x3f2e('0x87'):_0x342d59=as[_0x3f2e('0x7d')]('me',null,_0x567e9d);_0x5c639f[_0x5520d2](_0x342d59[_0x3f2e('0x7e')],_0x342d59[_0x3f2e('0x73')][_0x3f2e('0x7f')],_0x342d59[_0x3f2e('0x73')][_0x3f2e('0x3f')]);break;}}else{var _0x342d59=as[_0x3f2e('0x7d')](_0x5da1f3,_0x4dc239[_0x3f2e('0x88')],_0x567e9d);_0x5c639f[_0x5520d2](_0x342d59[_0x3f2e('0x7e')],_0x342d59[_0x3f2e('0x73')][_0x3f2e('0x7f')],_0x342d59[_0x3f2e('0x73')][_0x3f2e('0x3f')]);}}}else{var _0x1871f5=_(_0x24df56['query'])[_0x3f2e('0x4f')]()[_0x3f2e('0x44')](function(_0x103ba7){return _[_0x3f2e('0x89')](_0x1f7d6e,[_0x3f2e('0x41'),_0x103ba7])?_0x103ba7:undefined;})[_0x3f2e('0x8a')]()[_0x3f2e('0x73')]();if(!_[_0x3f2e('0x8b')](_0x1871f5)){_0x1871f5[_0x3f2e('0x81')](function(_0x4ab9c9){if(_0x4ab9c9===_0x3f2e('0x8c')){_0x9c5a91['where'](_0x3f2e('0x8d'),[][_0x3f2e('0x8e')](_0x24df56['query'][_0x4ab9c9]));}else if(_0x4ab9c9===_0x3f2e('0x8f')){var _0x31588b=JSON['parse'](_0x24df56[_0x3f2e('0x4e')][_0x4ab9c9])[_0x3f2e('0x90')];var _0x2cebc8=JSON[_0x3f2e('0x91')](_0x24df56[_0x3f2e('0x4e')][_0x4ab9c9])[_0x3f2e('0x92')];_0x9c5a91[_0x3f2e('0x93')](_0x3f2e('0x94'),_0x31588b,_0x2cebc8);}else{if(_0x24df56['query'][_0x4ab9c9]===_0x3f2e('0x95')){_0x9c5a91['where']('i.'+_0x4ab9c9+_0x3f2e('0x96'));}else{_0x9c5a91[_0x3f2e('0x93')]('i.'+_0x4ab9c9+_0x3f2e('0x97'),_0x24df56[_0x3f2e('0x4e')][_0x4ab9c9]);}}});}if(_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x98')]){if(_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x98')]==0x1){_0x9c5a91[_0x3f2e('0x74')](_0x3f2e('0x99'));}else{_0x9c5a91[_0x3f2e('0x74')](_0x3f2e('0x9a'));}}if(_0x24df56['query'][_0x3f2e('0x9b')]){_0x49c144=_[_0x3f2e('0x9c')](_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x9b')])?_0x24df56[_0x3f2e('0x4e')]['tag']:new Array(_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x9b')]);_0x49c144['forEach'](function(_0x1ae434){_0x2e2e53['or'](_0x3f2e('0x9d'),'%,'+_0x1ae434+',%');});}if(_0x24df56['query']['filter']){var _0x48cedb=_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x9e')][_0x3f2e('0x9f')]('\x5c','\x5c\x5c')[_0x3f2e('0x9f')]('\x27\x27',_0x3f2e('0xa0'));if(qs[_0x3f2e('0xa1')](_0x48cedb)){_0x5c639f['or'](_0x3f2e('0xa2'),_0x48cedb+'%');}else{_0x5c639f['or'](_0x3f2e('0xa3'),qs[_0x3f2e('0x7a')](_0x48cedb))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x48cedb+'%');}}}_0x9c5a91[_0x3f2e('0x93')](_0x5c639f);_0x9c5a91['group'](_0x3f2e('0xa4'));var _0x53503f={'type':db[_0x3f2e('0x25')][_0x3f2e('0xa5')]['SELECT'],'raw':!![]};var _0x357a89=_0x9c5a91[_0x3f2e('0xa6')]();_0x357a89[_0x3f2e('0x5a')](_0x3f2e('0xa4'));_0x357a89['field'](_0x3f2e('0xa7'),'unreadMessages');if(_0x19e2ae[_0x3f2e('0x55')]){_0x19e2ae[_0x3f2e('0x55')][_0x3f2e('0x81')](function(_0xe31dd3){_0x9c5a91[_0x3f2e('0x55')]('i.'+_0xe31dd3[0x0],_0xe31dd3[0x1]===_0x3f2e('0xa8')?![]:!![]);});}if(!_['isEmpty'](_0x49c144)){_0x9c5a91[_0x3f2e('0x74')](_0x2e2e53);_0x357a89[_0x3f2e('0x93')](_0x3f2e('0xa9'),_0x49c144);}BPromise[_0x3f2e('0xaa')]()[_0x3f2e('0x29')](function(){if(!_0xd3471f){if(_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x8c')]||_0x24df56['query']['journey'])return;_0x357a89['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x9c5a91[_0x3f2e('0x93')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0x24df56[_0x3f2e('0xab')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x3f2e('0x29')](function(_0x31625a){if(_[_0x3f2e('0x8b')](_0x31625a)){_0x357a89[_0x3f2e('0x93')](_0x3f2e('0xac'));_0x9c5a91[_0x3f2e('0x93')](_0x3f2e('0xac'));}else{_0x357a89['where'](_0x3f2e('0x8d'),_[_0x3f2e('0x44')](_0x31625a,'id'));_0x9c5a91[_0x3f2e('0x93')](_0x3f2e('0x8d'),_['map'](_0x31625a,'id'));}});})['then'](function(){db[_0x3f2e('0xad')][_0x3f2e('0x4e')](_0x357a89[_0x3f2e('0xae')](),_0x53503f)['then'](function(_0x43fa17){_0x375484[_0x3f2e('0xaf')]=_0x43fa17['length'];if(_0x375484[_0x3f2e('0xaf')]===0x0)return[];return db[_0x3f2e('0xad')][_0x3f2e('0x4e')](_0x3b7984[_0x3f2e('0xae')](),_0x53503f)['then'](function(_0xba7b2e){_0x453197=_[_0x3f2e('0xb0')](_0xba7b2e,'id');_0x53503f=_[_0x3f2e('0xb1')](_0x53503f,{'model':db[_0x3f2e('0xb2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x24df56[_0x3f2e('0x4e')][_0x3f2e('0x51')]){_0x19e2ae[_0x3f2e('0x52')][_0x3f2e('0x81')](function(_0x380407){_0x9c5a91['field']('i.'+_0x380407);});}else{_0x9c5a91[_0x3f2e('0x5a')](_0x3f2e('0xa7'),_0x3f2e('0xb3'));_0x9c5a91[_0x3f2e('0x5a')](_0x3f2e('0xb4'),_0x3f2e('0xb5'));_0x9c5a91['field'](_0x3f2e('0xb6'),_0x3f2e('0xb7'));_0x9c5a91[_0x3f2e('0x5a')](_0x3f2e('0xb8'));_0x9c5a91['field'](_0x3f2e('0xb9'),_0x3f2e('0xba'));_0x9c5a91[_0x3f2e('0x5a')](_0x3f2e('0xbb'),'Contact.lastName');_0x9c5a91[_0x3f2e('0x5a')](_0x3f2e('0xbc'),_0x3f2e('0xbd'));_0x9c5a91[_0x3f2e('0x5a')](_0x3f2e('0xbe'),_0x3f2e('0xbf'));_0x9c5a91[_0x3f2e('0x5a')](_0x3f2e('0xc0'),'Contact.mobile');_0x9c5a91['field'](_0x3f2e('0xc1'),_0x3f2e('0xc2'));_0x9c5a91[_0x3f2e('0x5a')]('o.fullname','Owner.fullname');_0x9c5a91[_0x3f2e('0x5a')](_0x3f2e('0xc3'),_0x3f2e('0xc4'));_0x9c5a91[_0x3f2e('0x5a')](_0x3f2e('0xc5'),_0x3f2e('0x46'));}if(_0x19e2ae[_0x3f2e('0x37')])_0x9c5a91['limit'](_0x19e2ae[_0x3f2e('0x37')]);if(_0x19e2ae['offset'])_0x9c5a91[_0x3f2e('0x36')](_0x19e2ae[_0x3f2e('0x36')]);return db[_0x3f2e('0xad')][_0x3f2e('0x4e')](_0x9c5a91['toString'](),_0x53503f);})['then'](function(_0x47e661){_0x4bf310[_0x3f2e('0x93')]('ui.ChatInteractionId\x20IN\x20?',_[_0x3f2e('0x44')](_0x47e661,'id'));return db['sequelize'][_0x3f2e('0x4e')](_0x4bf310[_0x3f2e('0xae')](),_0x53503f)[_0x3f2e('0x29')](function(_0x2183d8){var _0x29c174=_['groupBy'](_0x2183d8,_0x3f2e('0xc6'));var _0x7fa4cf=[];_0x47e661[_0x3f2e('0x81')](function(_0x5a72f0){_0x7fa4cf[_0x3f2e('0x49')](updateChatInteraction(_0x5a72f0,_0x453197,_0x29c174));});return BPromise[_0x3f2e('0xc7')](_0x7fa4cf);});});})[_0x3f2e('0x29')](function(_0x5595e4){_0x375484[_0x3f2e('0xc8')]=_0x5595e4;return _0x375484;})[_0x3f2e('0x29')](respondWithFilteredResult(_0x3668dc,_0x19e2ae));})[_0x3f2e('0x33')](handleError(_0x3668dc,null));};exports['show']=function(_0x94a3b9,_0x1e15d6){var _0xe77568={'raw':![],'where':{'id':_0x94a3b9['params']['id']}},_0x482e0d={};_0x482e0d['model']=_['keys'](db[_0x3f2e('0xb2')][_0x3f2e('0x4b')]);_0x482e0d[_0x3f2e('0x4e')]=_['keys'](_0x94a3b9[_0x3f2e('0x4e')]);_0x482e0d[_0x3f2e('0x58')]=_[_0x3f2e('0x50')](_0x482e0d[_0x3f2e('0x4d')],_0x482e0d[_0x3f2e('0x4e')]);_0xe77568[_0x3f2e('0x52')]=_[_0x3f2e('0x50')](_0x482e0d[_0x3f2e('0x4d')],qs[_0x3f2e('0x51')](_0x94a3b9['query']['fields']));_0xe77568['attributes']=_0xe77568[_0x3f2e('0x52')]['length']?_0xe77568['attributes']:_0x482e0d[_0x3f2e('0x4d')];if(_0x94a3b9['query'][_0x3f2e('0xc9')]){_0xe77568['include']=[{'all':!![]}];}_0xe77568=_['merge']({},_0xe77568,_0x94a3b9[_0x3f2e('0xca')]);return db[_0x3f2e('0xb2')][_0x3f2e('0x72')](_0xe77568)[_0x3f2e('0x29')](handleEntityNotFound(_0x1e15d6,null))[_0x3f2e('0x29')](respondWithResult(_0x1e15d6,null))['catch'](handleError(_0x1e15d6,null));};exports[_0x3f2e('0xcb')]=function(_0x13d8c8,_0x14b531){return db[_0x3f2e('0xb2')][_0x3f2e('0xcb')](_0x13d8c8[_0x3f2e('0x87')],{})['then'](respondWithResult(_0x14b531,0xc9))[_0x3f2e('0x33')](handleError(_0x14b531,null));};exports[_0x3f2e('0x3d')]=function(_0x4b1776,_0x56ce3c){if(_0x4b1776[_0x3f2e('0x87')]['id']){delete _0x4b1776[_0x3f2e('0x87')]['id'];}return db[_0x3f2e('0xb2')]['find']({'where':{'id':_0x4b1776[_0x3f2e('0xcc')]['id']}})[_0x3f2e('0x29')](handleEntityNotFound(_0x56ce3c,null))[_0x3f2e('0x29')](saveUpdates(_0x4b1776[_0x3f2e('0x87')],null))[_0x3f2e('0x29')](respondWithResult(_0x56ce3c,null))['catch'](handleError(_0x56ce3c,null));};exports[_0x3f2e('0x3e')]=function(_0x168b65,_0x264b47){return db[_0x3f2e('0xb2')][_0x3f2e('0x72')]({'where':{'id':_0x168b65['params']['id']}})[_0x3f2e('0x29')](handleEntityNotFound(_0x264b47,null))[_0x3f2e('0x29')](removeEntity(_0x264b47,null))[_0x3f2e('0x33')](handleError(_0x264b47,null));};exports[_0x3f2e('0xcd')]=function(_0x227a33,_0x5b828e){return db[_0x3f2e('0xb2')][_0x3f2e('0xcd')]()['then'](respondWithResult(_0x5b828e,null))[_0x3f2e('0x33')](handleError(_0x5b828e,null));};exports[_0x3f2e('0xce')]=function(_0x4530b6,_0x42d72f){var _0x1de64a=_0x4530b6[_0x3f2e('0xcc')]['id'];var _0x5b6a37;var _0x20f23d;var _0x2f2ed1;return db[_0x3f2e('0xb2')][_0x3f2e('0xcf')]({'where':{'id':_0x1de64a}})['then'](function(_0x40108a){_0x5b6a37=_0x40108a;return db[_0x3f2e('0xd0')][_0x3f2e('0xcf')]({'where':{'id':_0x40108a[_0x3f2e('0x8c')]},'attributes':['id',_0x3f2e('0xd1'),_0x3f2e('0xd2')],'raw':!![]});})[_0x3f2e('0x29')](function(_0x1bb488){if(_0x1bb488&&_0x1bb488[_0x3f2e('0xd1')]&&_0x1bb488[_0x3f2e('0xd2')]){_0x20f23d=_0x1bb488;var _0x18167a={'rejectUnauthorized':![],'method':_0x3f2e('0xd3'),'uri':_0x3f2e('0xd4'),'headers':{'X-APIKEY':_0x1bb488[_0x3f2e('0xd1')]},'body':{'name':_0x3f2e('0xd5')+_0x1de64a},'redirect':_0x3f2e('0xd6'),'json':!![]};return rp(_0x18167a);}else{throw new db['Sequelize'][(_0x3f2e('0x26'))](_0x3f2e('0xd7'));}})[_0x3f2e('0x29')](function(_0x34bf73){_0x2f2ed1=_0x34bf73;if(_0x2f2ed1['id']){var _0x31b113={'body':_0x2f2ed1[_0x3f2e('0xd8')],'ChatWebsiteId':_0x20f23d['id'],'ChatInteractionId':_0x5b6a37['id'],'direction':'out','UserId':_0x4530b6[_0x3f2e('0xab')]['id']};return db[_0x3f2e('0xd9')][_0x3f2e('0xcb')](_0x31b113,{});}else{throw new db[(_0x3f2e('0x25'))]['ValidationError'](_0x3f2e('0xda'));}})[_0x3f2e('0x29')](function(){return _0x5b6a37['updateAttributes']({'vidaooSessionId':_0x2f2ed1['id']});})['then'](respondWithResult(_0x42d72f,null))['catch'](handleError(_0x42d72f,null));};exports['customUpdate']=function(_0x4d8b6e,_0x4289f9){if(_0x4d8b6e[_0x3f2e('0x87')]['id']){delete _0x4d8b6e[_0x3f2e('0x87')]['id'];}return db[_0x3f2e('0xb2')][_0x3f2e('0x72')]({'where':{'id':_0x4d8b6e[_0x3f2e('0xcc')]['id']}})[_0x3f2e('0x29')](handleEntityNotFound(_0x4289f9,null))['then'](saveUpdates(_0x4d8b6e[_0x3f2e('0x87')],null))[_0x3f2e('0x29')](respondWithResult(_0x4289f9,null))['catch'](handleError(_0x4289f9,null));};exports['abandon']=function(_0x4cbb18,_0x3a88e6,_0x4999f5){if(_0x4cbb18[_0x3f2e('0x87')]['id']){delete _0x4cbb18[_0x3f2e('0x87')]['id'];}return db[_0x3f2e('0xb2')][_0x3f2e('0x72')]({'where':{'id':_0x4cbb18[_0x3f2e('0xcc')]['id']}})[_0x3f2e('0x29')](function(_0xa8f0f5){if(!_0xa8f0f5){logger[_0x3f2e('0x30')](_0x3f2e('0xdb'),_0x3f2e('0xdc'),0x194,'entity\x20not\x20found');_0x3a88e6[_0x3f2e('0x34')](0x194);}else{if(_0xa8f0f5['UserId']){throw new db[(_0x3f2e('0x25'))][(_0x3f2e('0x26'))](_0x3f2e('0xdd'));}}return _0xa8f0f5;})[_0x3f2e('0x29')](function(_0x135b33){if(_0x135b33){return _0x135b33[_0x3f2e('0x3d')]({'closed':_0x4cbb18['body'][_0x3f2e('0xde')],'disposition':_0x4cbb18[_0x3f2e('0x87')][_0x3f2e('0xdf')]})[_0x3f2e('0x29')](function(_0x51445a){return _0x51445a;});}})[_0x3f2e('0x29')](function(_0xf2f5f1){return respondWithRpcPromise(_0x3f2e('0xe0'),_0x3f2e('0xdc'),_0x4cbb18[_0x3f2e('0x87')],client9004);})[_0x3f2e('0x29')](respondWithResult(_0x3a88e6,null))[_0x3f2e('0x33')](handleError(_0x3a88e6,null));};exports[_0x3f2e('0xe1')]=function(_0x1d56af,_0x48b1ca,_0x3a9e66){_0x1d56af['body'][_0x3f2e('0x41')]=_0x1d56af[_0x3f2e('0xe2')][_0x3f2e('0xe3')];_0x1d56af[_0x3f2e('0x87')][_0x3f2e('0xe4')]=_0x1d56af[_0x3f2e('0xe2')][_0x3f2e('0xe5')];_0x1d56af['body'][_0x3f2e('0x88')]=_0x1d56af['file']['mimetype'];return db[_0x3f2e('0xe6')][_0x3f2e('0xcb')](_0x1d56af[_0x3f2e('0x87')])[_0x3f2e('0x29')](respondWithResult(_0x48b1ca,0xc9))[_0x3f2e('0x33')](handleError(_0x48b1ca,null));};exports[_0x3f2e('0xe7')]=function(_0x33d469,_0x354844,_0xa2e7a){return db[_0x3f2e('0xb2')][_0x3f2e('0xcf')]({'where':{'id':_0x33d469[_0x3f2e('0xcc')]['id']},'raw':!![]})[_0x3f2e('0x29')](handleEntityNotFound(_0x354844,null))[_0x3f2e('0x29')](function(_0x4f684a){if(_0x4f684a){if(_0x4f684a[_0x3f2e('0xde')]){return _0x354844[_0x3f2e('0x35')](0x193)['json']({'status':0x193,'message':_0x3f2e('0xe8')});}return db[_0x3f2e('0xe6')][_0x3f2e('0xcf')]({'where':{'id':_0x33d469['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x354844,null));}})['then'](function(_0x2e13a9){if(_0x2e13a9){return _0x354844['download'](path[_0x3f2e('0xe9')](config[_0x3f2e('0xea')],_0x3f2e('0xeb'),_0x2e13a9[_0x3f2e('0xe4')]));}})['catch'](handleError(_0x354844,null));};exports[_0x3f2e('0xec')]=function(_0x3e76a1,_0x5077b9){var _0x37cd72=null;var _0x2e1b8f=null;var _0x4c7841=null;var _0x2d1326=null;if(_0x3e76a1[_0x3f2e('0x87')]['id']){delete _0x3e76a1[_0x3f2e('0x87')]['id'];}if(_0x3e76a1[_0x3f2e('0x87')][_0x3f2e('0xed')]){_0x2d1326=path[_0x3f2e('0xe9')](config[_0x3f2e('0xea')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date['now']()));_0x3e76a1[_0x3f2e('0x87')][_0x3f2e('0xee')]=_0x2d1326;}return db['ChatInteraction'][_0x3f2e('0x72')]({'where':{'id':_0x3e76a1[_0x3f2e('0xcc')]['id']},'include':[{'model':db[_0x3f2e('0xd9')],'as':'Messages','include':[{'model':db[_0x3f2e('0x83')],'as':_0x3f2e('0x83')}]}]})[_0x3f2e('0x29')](handleEntityNotFound(_0x5077b9,null))['then'](saveUpdates(_0x3e76a1['body'],null))[_0x3f2e('0x29')](function(_0x10aa4b){if(_0x10aa4b){_0x37cd72=_0x10aa4b;return db[_0x3f2e('0xd0')][_0x3f2e('0x72')]({'where':{'id':_0x37cd72['ChatWebsiteId']}});}})[_0x3f2e('0x29')](function(_0x3978fd){if(_0x3978fd){_0x4c7841=_0x3978fd;return db[_0x3f2e('0xef')][_0x3f2e('0x72')]({'where':{'id':_0x37cd72[_0x3f2e('0x7c')]}});}})[_0x3f2e('0x29')](function(_0x360fe7){if(_0x360fe7){_0x2e1b8f=_0x360fe7;if(_0x2d1326){var _0xb70408=null;for(var _0x4112f5=0x1;_0x4112f5<_0x37cd72[_0x3f2e('0xf0')]['length'];++_0x4112f5){_0xb70408=_0x37cd72['Messages'][_0x4112f5];var _0x3f48f2=_0xb70408[_0x3f2e('0x86')]?util[_0x3f2e('0xf1')](_0x3f2e('0xf2'),_0x4c7841[_0x3f2e('0xf3')],_0xb70408[_0x3f2e('0x86')]):_0x3f2e('0xf4');var _0x2c0d50=_0x3e76a1[_0x3f2e('0x87')][_0x3f2e('0xf5')]||util[_0x3f2e('0xf1')](_0x3f2e('0xf2'),_0x3f2e('0xf6'),_0xb70408['ContactId']);switch(_0x4c7841[_0x3f2e('0xf7')]){case _0x3f2e('0xf8'):_0x3f48f2=_0xb70408['UserId']?util[_0x3f2e('0xf1')](_0x3f2e('0xf2'),_0x4c7841[_0x3f2e('0xf3')],_0xb70408[_0x3f2e('0x86')]):_0x3f2e('0xf4');break;case _0x3f2e('0xf9'):_0x3f48f2=_0xb70408[_0x3f2e('0x86')]?_0xb70408[_0x3f2e('0x83')]['alias']||_0xb70408[_0x3f2e('0x83')][_0x3f2e('0x45')]:'System';break;case _0x3f2e('0xfa'):_0x3f48f2=_0xb70408[_0x3f2e('0x86')]?_0xb70408[_0x3f2e('0x83')][_0x3f2e('0x45')]:'System';break;default:_0x3f48f2=_0xb70408[_0x3f2e('0x86')]?util['format'](_0x3f2e('0xf2'),_0x4c7841['agentAlias'],_0xb70408[_0x3f2e('0x86')]):_0x3f2e('0xf4');}var _0x22c819=util[_0x3f2e('0xf1')]('[%s]\x20%s:\x20%s\x0a',moment(_0xb70408[_0x3f2e('0x8f')])[_0x3f2e('0xf1')](_0x3f2e('0xfb')),_0xb70408[_0x3f2e('0xfc')]==='in'?_0x2c0d50:_0x3f48f2,_0xb70408[_0x3f2e('0x87')]);if(!_0xb70408[_0x3f2e('0xfd')]){fs[_0x3f2e('0xfe')](_0x2d1326,_0x22c819);}}return db[_0x3f2e('0xff')][_0x3f2e('0xcf')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3f2e('0x29')](function(_0x4e2777){if(_0x4e2777&&_0x4e2777[_0x3f2e('0x100')]&&_0x3e76a1[_0x3f2e('0x87')]){var _0x3869a9={'tls':{'rejectUnauthorized':![]}};if(_0x4e2777[_0x3f2e('0x100')]['service']){_0x3869a9['service']=_0x4e2777[_0x3f2e('0x100')][_0x3f2e('0x101')];}else{_0x3869a9[_0x3f2e('0x102')]=_0x4e2777[_0x3f2e('0x100')]['host'];_0x3869a9[_0x3f2e('0x103')]=_0x4e2777[_0x3f2e('0x100')]['port'];_0x3869a9[_0x3f2e('0x104')]=_0x4e2777['Smtp']['secure'];}if(_0x4e2777[_0x3f2e('0x100')][_0x3f2e('0x105')]){_0x3869a9[_0x3f2e('0x106')]={'user':_0x4e2777['Smtp'][_0x3f2e('0xab')],'pass':_0x4e2777[_0x3f2e('0x100')][_0x3f2e('0x107')]};}return respondWithRpcPromise(_0x3f2e('0x108'),_0x3f2e('0x109'),{'account':_0x3869a9,'message':{'from':util[_0x3f2e('0xf1')](_0x3f2e('0x10a'),_0x4e2777[_0x3f2e('0x41')],_0x4e2777[_0x3f2e('0x10b')]||_0x4e2777[_0x3f2e('0x100')]['user']),'to':_0x3e76a1[_0x3f2e('0x87')][_0x3f2e('0xed')],'subject':_0x3f2e('0x10c'),'text':util[_0x3f2e('0xf1')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x3e76a1[_0x3f2e('0x87')]['mailTranscript']),'attachments':[{'path':_0x2d1326}]}})[_0x3f2e('0x29')](function(){return _0x37cd72;})[_0x3f2e('0x33')](function(_0x9b88ed){console[_0x3f2e('0x30')](_0x9b88ed);});}else{return _0x37cd72;}})[_0x3f2e('0x29')](respondWithStatusCode(_0x5077b9,0xc8))[_0x3f2e('0x33')](handleError(_0x5077b9,null));};exports[_0x3f2e('0x10d')]=function(_0x294650,_0x1672cf,_0x457203){return db[_0x3f2e('0xd9')][_0x3f2e('0x72')]({'where':{'id':_0x294650[_0x3f2e('0xcc')]['id']}})[_0x3f2e('0x29')](handleEntityNotFound(_0x1672cf,null))[_0x3f2e('0x29')](function(_0xe4a6ec){if(_0xe4a6ec){return _0xe4a6ec['addMessage'](_0x294650[_0x3f2e('0x87')]['ids'],_[_0x3f2e('0x10e')](_0x294650['body'],[_0x3f2e('0x10f'),'id'])||{});}})[_0x3f2e('0x29')](respondWithResult(_0x1672cf,null))[_0x3f2e('0x33')](handleError(_0x1672cf,null));};exports[_0x3f2e('0x110')]=function(_0xc94bbf,_0x26f3e8,_0x598cbf){var _0x13b736={'raw':![],'where':{}};var _0x38812c={};var _0x127eb1={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3f2e('0xcf')]({'where':{'id':_0xc94bbf['params']['id']}})[_0x3f2e('0x29')](handleEntityNotFound(_0x26f3e8,null))[_0x3f2e('0x29')](function(_0x1ade74){if(_0x1ade74){_0x38812c[_0x3f2e('0x4d')]=_[_0x3f2e('0x4f')](db['ChatMessage'][_0x3f2e('0x4b')]);_0x38812c['query']=_[_0x3f2e('0x4f')](_0xc94bbf['query']);_0x38812c[_0x3f2e('0x58')]=_[_0x3f2e('0x50')](_0x38812c['model'],_0x38812c[_0x3f2e('0x4e')]);_0x13b736['attributes']=_[_0x3f2e('0x50')](_0x38812c[_0x3f2e('0x4d')],qs['fields'](_0xc94bbf[_0x3f2e('0x4e')]['fields']));_0x13b736[_0x3f2e('0x52')]=_0x13b736[_0x3f2e('0x52')]['length']?_0x13b736['attributes']:_0x38812c[_0x3f2e('0x4d')];if(!_0xc94bbf[_0x3f2e('0x4e')][_0x3f2e('0x53')](_0x3f2e('0x54'))){_0x13b736[_0x3f2e('0x37')]=qs[_0x3f2e('0x37')](_0xc94bbf[_0x3f2e('0x4e')]['limit']);_0x13b736[_0x3f2e('0x36')]=qs[_0x3f2e('0x36')](_0xc94bbf['query'][_0x3f2e('0x36')]);}_0x13b736[_0x3f2e('0x55')]=qs[_0x3f2e('0x56')](_0xc94bbf['query'][_0x3f2e('0x56')]);_0x13b736[_0x3f2e('0x93')]=qs[_0x3f2e('0x58')](_['pick'](_0xc94bbf['query'],_0x38812c[_0x3f2e('0x58')]));_0x13b736[_0x3f2e('0x93')][_0x3f2e('0xc6')]=_0x1ade74['id'];if(_0xc94bbf[_0x3f2e('0x4e')][_0x3f2e('0x9e')]){_0x13b736[_0x3f2e('0x93')]=_[_0x3f2e('0xb1')](_0x13b736[_0x3f2e('0x93')],{'$or':_['map'](_0x13b736[_0x3f2e('0x52')],function(_0x22f82a){var _0x97866={};_0x97866[_0x22f82a]={'$like':'%'+_0xc94bbf[_0x3f2e('0x4e')][_0x3f2e('0x9e')]+'%'};return _0x97866;})});}if(_0xc94bbf['query']['$gte']){var _0x41965a=_0xc94bbf[_0x3f2e('0x4e')]['$gte'][_0x3f2e('0x47')](',');var _0xc8868c={};_0xc8868c[_0x41965a[0x0]]={'$gte':moment(_0x41965a[0x1])[_0x3f2e('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x13b736['where']=_['merge'](_0x13b736[_0x3f2e('0x93')],_0xc8868c);}_0x13b736=_[_0x3f2e('0xb1')]({},_0x13b736,_0xc94bbf[_0x3f2e('0xca')]);return db[_0x3f2e('0xd9')][_0x3f2e('0xaf')]({'where':_0x13b736[_0x3f2e('0x93')]})['then'](function(_0x4917cb){_0x127eb1[_0x3f2e('0xaf')]=_0x4917cb;if(_0xc94bbf[_0x3f2e('0x4e')][_0x3f2e('0xc9')]){_0x13b736[_0x3f2e('0x111')]=[{'all':!![]}];}return db[_0x3f2e('0xd9')][_0x3f2e('0x112')](_0x13b736);})[_0x3f2e('0x29')](function(_0xeba617){_0x127eb1[_0x3f2e('0xc8')]=_0xeba617;return _0x127eb1;});}})[_0x3f2e('0x29')](respondWithFilteredResult(_0x26f3e8,_0x13b736))['catch'](handleError(_0x26f3e8,null));};exports[_0x3f2e('0x113')]=function(_0x192a23,_0x97b7d4,_0x48144f){var _0x89a499={'where':{}},_0x5afd1a={},_0x2fceee={'count':0x0,'rows':[]};return db[_0x3f2e('0xb2')]['findOne']({'where':{'id':_0x192a23[_0x3f2e('0xcc')]['id']}})[_0x3f2e('0x29')](handleEntityNotFound(_0x97b7d4,null))[_0x3f2e('0x29')](function(_0x223601){if(_0x223601){_0x5afd1a['model']=_['keys'](db[_0x3f2e('0xd9')][_0x3f2e('0x4b')]);_0x5afd1a['query']=_[_0x3f2e('0x4f')](_0x192a23[_0x3f2e('0x4e')]);_0x5afd1a[_0x3f2e('0x58')]=_['intersection'](_0x5afd1a[_0x3f2e('0x4d')],_0x5afd1a[_0x3f2e('0x4e')]);_0x89a499[_0x3f2e('0x52')]=_[_0x3f2e('0x50')](_0x5afd1a[_0x3f2e('0x4d')],qs[_0x3f2e('0x51')](_0x192a23[_0x3f2e('0x4e')][_0x3f2e('0x51')]));_0x89a499[_0x3f2e('0x52')]=_0x89a499[_0x3f2e('0x52')][_0x3f2e('0x71')]?_0x89a499[_0x3f2e('0x52')]:_0x5afd1a[_0x3f2e('0x4d')];if(!_0x192a23[_0x3f2e('0x4e')][_0x3f2e('0x53')](_0x3f2e('0x54'))){_0x89a499[_0x3f2e('0x37')]=qs['limit'](_0x192a23[_0x3f2e('0x4e')][_0x3f2e('0x37')]);_0x89a499[_0x3f2e('0x36')]=qs['offset'](_0x192a23[_0x3f2e('0x4e')][_0x3f2e('0x36')]);}_0x89a499[_0x3f2e('0x55')]=qs[_0x3f2e('0x56')](_0x192a23[_0x3f2e('0x4e')][_0x3f2e('0x56')]);_0x89a499['where']=qs[_0x3f2e('0x58')](_[_0x3f2e('0x57')](_0x192a23[_0x3f2e('0x4e')],_0x5afd1a['filters']));_0x89a499[_0x3f2e('0x93')]['ChatInteractionId']=_0x223601['id'];if(_0x192a23[_0x3f2e('0x4e')][_0x3f2e('0x9e')]){_0x89a499[_0x3f2e('0x93')]=_[_0x3f2e('0xb1')](_0x89a499['where'],{'$or':_[_0x3f2e('0x44')](_0x89a499[_0x3f2e('0x52')],function(_0x1af8d0){var _0x3b6ab2={};_0x3b6ab2[_0x1af8d0]={'$like':'%'+_0x192a23['query'][_0x3f2e('0x9e')]+'%'};return _0x3b6ab2;})});}_0x89a499[_0x3f2e('0x93')][_0x3f2e('0xfd')]=![];if(_0x192a23[_0x3f2e('0x4e')]['id']){_0x89a499[_0x3f2e('0x93')]['id']={'$gt':_0x192a23[_0x3f2e('0x4e')]['id']};}_0x89a499=_[_0x3f2e('0xb1')]({},_0x89a499,_0x192a23[_0x3f2e('0xca')]);return db['ChatMessage'][_0x3f2e('0xaf')]({'where':_0x89a499[_0x3f2e('0x93')]})[_0x3f2e('0x29')](function(_0x5a2798){_0x2fceee[_0x3f2e('0xaf')]=_0x5a2798;_0x89a499[_0x3f2e('0x111')]=[];if(_0x192a23['query'][_0x3f2e('0x114')]){_0x89a499[_0x3f2e('0x111')]['push']({'model':db[_0x3f2e('0x83')],'as':'User','attributes':['id',_0x3f2e('0x45'),_0x3f2e('0x115')]});}if(_0x192a23['query'][_0x3f2e('0xc9')]){_0x89a499[_0x3f2e('0x111')]=[{'all':!![]}];}return db[_0x3f2e('0xd9')][_0x3f2e('0x112')](_0x89a499);})[_0x3f2e('0x29')](function(_0x4e0de8){_0x2fceee['rows']=_0x4e0de8;return _0x2fceee;});}})[_0x3f2e('0x29')](respondWithFilteredResult(_0x97b7d4,_0x89a499))['catch'](handleError(_0x97b7d4,null));};exports[_0x3f2e('0x116')]=function(_0x37e420,_0x26f8c5,_0x38fe08){return db[_0x3f2e('0xb2')][_0x3f2e('0x72')]({'where':{'id':_0x37e420[_0x3f2e('0xcc')]['id']}})['then'](handleEntityNotFound(_0x26f8c5,null))[_0x3f2e('0x29')](function(_0x2eca74){if(_0x2eca74){return _0x2eca74[_0x3f2e('0x117')](_0x37e420[_0x3f2e('0x87')][_0x3f2e('0x10f')],_[_0x3f2e('0x10e')](_0x37e420[_0x3f2e('0x87')],[_0x3f2e('0x10f'),'id'])||{})[_0x3f2e('0x118')](function(){return db[_0x3f2e('0x80')][_0x3f2e('0x112')]({'attributes':['id','name',_0x3f2e('0x5b')],'where':{'id':_0x37e420['body'][_0x3f2e('0x10f')]}});})[_0x3f2e('0x29')](function(_0x1d9b6e){socket['emit']('chatInteractionTags:save',{'id':Number(_0x37e420[_0x3f2e('0xcc')]['id']),'tags':_0x1d9b6e||[]});return{'id':Number(_0x37e420['params']['id']),'tags':_0x1d9b6e||[]};});}})['then'](respondWithResult(_0x26f8c5,null))[_0x3f2e('0x33')](handleError(_0x26f8c5,null));};exports[_0x3f2e('0x119')]=function(_0x51558d,_0x17d476,_0x2760e8){return db[_0x3f2e('0xb2')]['find']({'where':{'id':_0x51558d[_0x3f2e('0xcc')]['id']}})[_0x3f2e('0x29')](handleEntityNotFound(_0x17d476,null))['then'](function(_0x5f1be1){if(_0x5f1be1){return _0x5f1be1[_0x3f2e('0x119')](_0x51558d[_0x3f2e('0x4e')]['ids']);}})['then'](respondWithStatusCode(_0x17d476,null))[_0x3f2e('0x33')](handleError(_0x17d476,null));};exports[_0x3f2e('0x11a')]=function(_0x175349,_0x78307e){var _0x4c748d=moment()['unix']()[_0x3f2e('0xae')]();var _0x4a735d=path[_0x3f2e('0xe9')](config[_0x3f2e('0xea')],'server','files','tmp');var _0x7336e7=path['join'](config[_0x3f2e('0xea')],_0x3f2e('0x11b'),_0x3f2e('0x11c'),_0x3f2e('0x11d'));var _0x22e432=path[_0x3f2e('0xe9')](_0x4a735d,_0x4c748d);var _0x562664=util['format'](_0x3f2e('0x11e'),_0x175349[_0x3f2e('0xcc')]['id'],_0x4c748d);var _0xda9277=path[_0x3f2e('0xe9')](_0x4a735d,_0x562664);var _0x2a2e64=[];_0x2a2e64[_0x3f2e('0x49')]({'model':db[_0x3f2e('0x83')],'as':'User','attributes':['id',_0x3f2e('0x45')],'raw':!![]});_0x2a2e64[_0x3f2e('0x49')]({'model':db['CmContact'],'as':_0x3f2e('0x77'),'attributes':['id',_0x3f2e('0x11f'),'lastName'],'raw':!![]});if(_0x175349[_0x3f2e('0x4e')][_0x3f2e('0x11d')]){_0x2a2e64[_0x3f2e('0x49')]({'model':db[_0x3f2e('0xe6')],'as':_0x3f2e('0xe6'),'raw':!![]});}var _0x3b6fd5=[{'model':db[_0x3f2e('0xd9')],'as':'Messages','attributes':['id',_0x3f2e('0x87'),_0x3f2e('0x8f'),_0x3f2e('0xfc'),_0x3f2e('0xfd'),_0x3f2e('0x98')],'include':_0x2a2e64}];_0x3b6fd5['push']({'model':db[_0x3f2e('0xd0')],'as':'Account','attributes':['id',_0x3f2e('0x41')]});_0x3b6fd5['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x3f2e('0x45')]});return db[_0x3f2e('0xb2')][_0x3f2e('0x72')]({'where':{'id':_0x175349[_0x3f2e('0xcc')]['id']},'include':_0x3b6fd5})[_0x3f2e('0x29')](handleEntityNotFound(_0x78307e,null))['then'](function(_0x4c2a53){if(_0x4c2a53){var _0x2fdb5d=_0x4c2a53[_0x3f2e('0x120')]({'plain':!![]});fs['mkdirSync'](_0x22e432);var _0x1bcc33={'format':'A4','border':_0x3f2e('0x121'),'header':{'height':_0x3f2e('0x122'),'contents':{'first':_0x3f2e('0x123')}},'footer':{'height':_0x3f2e('0x124'),'contents':{'default':util[_0x3f2e('0xf1')](_0x3f2e('0x125'),util['format'](_0x3f2e('0x126'),_0x3f2e('0x127'),_0x2fdb5d['id']),moment()['format'](_0x3f2e('0x128'))[_0x3f2e('0xae')]())}}};var _0x2d629e={'channel':_0x3f2e('0x127'),'account':_0x2fdb5d[_0x3f2e('0x129')][_0x3f2e('0x41')],'agent':_0x2fdb5d[_0x3f2e('0x12a')]?_0x2fdb5d['Owner'][_0x3f2e('0x45')]:_0x3f2e('0x12b'),'createdAt':moment(_0x2fdb5d[_0x3f2e('0x8f')])[_0x3f2e('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3f2e('0xae')](),'closedAt':_0x2fdb5d[_0x3f2e('0xde')]?moment(_0x2fdb5d[_0x3f2e('0x12c')])[_0x3f2e('0xf1')](_0x3f2e('0x12d'))[_0x3f2e('0xae')]():'','disposition':_0x2fdb5d['disposition'],'chatInfo':{'browser':_0x2fdb5d[_0x3f2e('0x12e')],'os':_0x2fdb5d['osName'],'referer':_0x2fdb5d[_0x3f2e('0x12f')],'customerIp':_0x2fdb5d[_0x3f2e('0x130')],'customerPort':_0x2fdb5d[_0x3f2e('0x131')]?_0x2fdb5d[_0x3f2e('0x131')]:_0x3f2e('0x12b')},'messages':_(_0x2fdb5d[_0x3f2e('0xf0')])[_0x3f2e('0x132')]()['filter']({'secret':![]})['map'](function(_0x46f2b8){if(_0x46f2b8[_0x3f2e('0xe6')]){var _0x34ac98=path['join'](_0x7336e7,_0x46f2b8[_0x3f2e('0xe6')][_0x3f2e('0xe4')]);if(fs['existsSync'](_0x34ac98)){fs[_0x3f2e('0x133')](_0x34ac98)[_0x3f2e('0x134')](fs[_0x3f2e('0x135')](path[_0x3f2e('0xe9')](_0x22e432,_0x46f2b8[_0x3f2e('0xe6')][_0x3f2e('0xe4')])));}}return{'date':moment(_0x46f2b8[_0x3f2e('0x8f')])[_0x3f2e('0xf1')](_0x3f2e('0x12d'))[_0x3f2e('0xae')](),'sender':_0x46f2b8[_0x3f2e('0xfc')]==='out'?_0x46f2b8[_0x3f2e('0x83')]?_0x46f2b8[_0x3f2e('0x83')][_0x3f2e('0x45')]:_0x3f2e('0xf4'):_0x46f2b8[_0x3f2e('0x77')]['firstName']+(_0x46f2b8['Contact'][_0x3f2e('0x136')]?'\x20'+_0x46f2b8[_0x3f2e('0x77')]['lastName']:''),'body':_0x46f2b8[_0x3f2e('0xe6')]?_0x46f2b8['Attachment'][_0x3f2e('0xe4')]:_0x46f2b8[_0x3f2e('0x87')],'direction':_0x46f2b8[_0x3f2e('0xfc')]===_0x3f2e('0x137')?'A':'C','secret':_0x46f2b8[_0x3f2e('0xfd')],'read':_0x46f2b8[_0x3f2e('0x98')],'attachment':_0x46f2b8[_0x3f2e('0xe6')]};})['value']()};return ejs[_0x3f2e('0x138')](path[_0x3f2e('0xe9')](config['root'],_0x3f2e('0x11b'),_0x3f2e('0x139'),_0x3f2e('0x13a')),{'interaction':_0x2d629e})[_0x3f2e('0x29')](function(_0xedb153){return new BPromise(function(_0x3029d1,_0x585fd4){pdf['create'](_0xedb153,_0x1bcc33)[_0x3f2e('0x13b')](path['join'](_0x22e432,_0x3f2e('0x13c')+_0x2fdb5d['id']+'-'+_0x4c748d+_0x3f2e('0x13d')),function(_0x670124,_0xf7eedf){if(_0x670124)return _0x585fd4(_0x670124);_0x3029d1(_0xf7eedf);});});})[_0x3f2e('0x29')](function(){return new BPromise(function(_0x28d877,_0x4823ba){zipdir(_0x22e432,{'saveTo':_0xda9277},function(_0x1d21bd,_0x533dda){if(_0x1d21bd)return _0x4823ba(_0x1d21bd);return _0x28d877(_0x533dda);});})[_0x3f2e('0x29')](function(){return new BPromise(function(_0x5b1f60,_0x2500de){rimraf(_0x22e432,function(_0x19a97e){if(_0x19a97e)_0x2500de(_0x19a97e);return _0x5b1f60();});});})['then'](function(){return _0x78307e[_0x3f2e('0x11a')](_0xda9277,_0x562664,function(_0x252c08){if(_0x252c08){console[_0x3f2e('0x13e')](_0x3f2e('0x13f'),_0x252c08);}else{fs[_0x3f2e('0x140')](_0xda9277);}});});});}else{return _0x78307e[_0x3f2e('0x34')](0xc8);}})[_0x3f2e('0x33')](handleError(_0x78307e,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index ccd32f9..9f43929 100644
--- a/server/api/chatInteraction/chatInteraction.events.js
+++ b/server/api/chatInteraction/chatInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2971=['then','Users','map','findAll','emit','catch','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2971,0x1db));var _0x1297=function(_0x4568b7,_0x2f8c0b){_0x4568b7=_0x4568b7-0x0;var _0x1fd2c8=_0x2971[_0x4568b7];return _0x1fd2c8;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x1297('0x0'))['db'][_0x1297('0x1')];var ChatMessage=require(_0x1297('0x0'))['db'][_0x1297('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1297('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1297('0x4'),'afterDestroy':'remove'};function emitEvent(_0x484fc5){return function(_0x53c847,_0x393041,_0x2c0c41){_0x53c847['getUsers']({'attributes':['id'],'raw':!![]})[_0x1297('0x5')](function(_0x41d3f8){_0x53c847['setDataValue'](_0x1297('0x6'),_0x41d3f8[_0x1297('0x7')](function(_0x51f591){return{'id':_0x51f591['id']};}));return ChatMessage[_0x1297('0x8')]({'where':{'ChatInteractionId':_0x53c847['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1297('0x5')](function(_0x21929f){_0x53c847['setDataValue']('unreadMessages',_0x21929f['length']);ChatInteractionEvents[_0x1297('0x9')](_0x484fc5+':'+_0x53c847['id'],_0x53c847);ChatInteractionEvents[_0x1297('0x9')](_0x484fc5,_0x53c847);_0x2c0c41(null);})[_0x1297('0xa')](_0x2c0c41(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x1297('0xb')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x5aac=['setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','save','remove','getUsers','then'];(function(_0x2b8e2c,_0x39fbd4){var _0x3124c6=function(_0x3e3f3c){while(--_0x3e3f3c){_0x2b8e2c['push'](_0x2b8e2c['shift']());}};_0x3124c6(++_0x39fbd4);}(_0x5aac,0x72));var _0xc5aa=function(_0x4a458e,_0x193b8e){_0x4a458e=_0x4a458e-0x0;var _0x34aed8=_0x5aac[_0x4a458e];return _0x34aed8;};'use strict';var EventEmitter=require(_0xc5aa('0x0'));var ChatInteraction=require(_0xc5aa('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xc5aa('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc5aa('0x2'),'afterUpdate':'update','afterDestroy':_0xc5aa('0x3')};function emitEvent(_0xcb8ff){return function(_0x2c5b0a,_0x260d25,_0x163e2c){_0x2c5b0a[_0xc5aa('0x4')]({'attributes':['id'],'raw':!![]})[_0xc5aa('0x5')](function(_0x4c743d){_0x2c5b0a[_0xc5aa('0x6')](_0xc5aa('0x7'),_0x4c743d[_0xc5aa('0x8')](function(_0x1407c6){return{'id':_0x1407c6['id']};}));return ChatMessage[_0xc5aa('0x9')]({'where':{'ChatInteractionId':_0x2c5b0a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5aa('0x5')](function(_0x1062de){_0x2c5b0a[_0xc5aa('0x6')](_0xc5aa('0xa'),_0x1062de['length']);ChatInteractionEvents[_0xc5aa('0xb')](_0xcb8ff+':'+_0x2c5b0a['id'],_0x2c5b0a);ChatInteractionEvents['emit'](_0xcb8ff,_0x2c5b0a);_0x163e2c(null);})[_0xc5aa('0xc')](_0x163e2c(null));};}for(var e in events){if(events[_0xc5aa('0xd')](e)){var event=events[e];ChatInteraction[_0xc5aa('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 19395df..72020bd 100644
--- a/server/api/chatInteraction/chatInteraction.model.js
+++ b/server/api/chatInteraction/chatInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x77e2=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x1dd712,_0x5064a6){var _0x1af645=function(_0x1667ef){while(--_0x1667ef){_0x1dd712['push'](_0x1dd712['shift']());}};_0x1af645(++_0x5064a6);}(_0x77e2,0x1cf));var _0x277e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x77e2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x277e('0x0'));var logger=require('../../config/logger')(_0x277e('0x1'));var moment=require('moment');var BPromise=require(_0x277e('0x2'));var rp=require(_0x277e('0x3'));var fs=require('fs');var path=require(_0x277e('0x4'));var rimraf=require(_0x277e('0x5'));var config=require('../../config/environment');var attributes=require(_0x277e('0x6'));module['exports']=function(_0x4c159b,_0x150694){return _0x4c159b[_0x277e('0x7')](_0x277e('0x8'),attributes,{'tableName':_0x277e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x160b8c,_0x4926b4,_0xe86a33){if(_0x160b8c[_0x277e('0xa')](_0x277e('0xb'))){_0x160b8c[_0x277e('0xc')]=moment()[_0x277e('0xd')](_0x277e('0xe'));}_0xe86a33(null,_0x160b8c);}},'charset':_0x277e('0xf'),'collate':_0x277e('0x10')});};
\ No newline at end of file
+var _0x7fe6=['api','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','chat_interactions','changed','closed','closedAt','utf8mb4','lodash','util'];(function(_0x4a7ed1,_0x3d79be){var _0x2fdbf8=function(_0x11c4c5){while(--_0x11c4c5){_0x4a7ed1['push'](_0x4a7ed1['shift']());}};_0x2fdbf8(++_0x3d79be);}(_0x7fe6,0x140));var _0x67fe=function(_0xa7d8c3,_0x46ff3a){_0xa7d8c3=_0xa7d8c3-0x0;var _0xb38061=_0x7fe6[_0xa7d8c3];return _0xb38061;};'use strict';var _=require(_0x67fe('0x0'));var util=require(_0x67fe('0x1'));var logger=require('../../config/logger')(_0x67fe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x67fe('0x3'));var fs=require('fs');var path=require(_0x67fe('0x4'));var rimraf=require(_0x67fe('0x5'));var config=require(_0x67fe('0x6'));var attributes=require(_0x67fe('0x7'));module['exports']=function(_0x75a4f6,_0x45c9d8){return _0x75a4f6[_0x67fe('0x8')]('ChatInteraction',attributes,{'tableName':_0x67fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e2b56,_0x682904,_0x4fde9c){if(_0x4e2b56[_0x67fe('0xa')](_0x67fe('0xb'))){_0x4e2b56[_0x67fe('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4fde9c(null,_0x4e2b56);}},'charset':_0x67fe('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d344fb5..e549b25 100644
--- a/server/api/chatInteraction/chatInteraction.rpc.js
+++ b/server/api/chatInteraction/chatInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf492=['stringify','error','code','message','info','result','catch','ChatInteraction','update','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x1fbaad,_0x5a155a){var _0x3be85e=function(_0x2d7b17){while(--_0x2d7b17){_0x1fbaad['push'](_0x1fbaad['shift']());}};_0x3be85e(++_0x5a155a);}(_0xf492,0xbf));var _0x2f49=function(_0x275030,_0x2acc02){_0x275030=_0x275030-0x0;var _0xedf0ea=_0xf492[_0x275030];return _0xedf0ea;};'use strict';var _=require('lodash');var util=require(_0x2f49('0x0'));var moment=require(_0x2f49('0x1'));var BPromise=require(_0x2f49('0x2'));var rs=require(_0x2f49('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f49('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f49('0x5'))('rpc');var config=require(_0x2f49('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2f49('0x7')][_0x2f49('0x8')]({'port':0x232a});config[_0x2f49('0x9')]=_['defaults'](config[_0x2f49('0x9')],{'host':_0x2f49('0xa'),'port':0x18eb});var socket=require(_0x2f49('0xb'))(new Redis(config[_0x2f49('0x9')]));require(_0x2f49('0xc'))['register'](socket);function respondWithRpcPromise(_0x34bcba,_0x851525,_0x7625e3){return new BPromise(function(_0x19ad1f,_0x152974){return client[_0x2f49('0xd')](_0x34bcba,_0x7625e3)[_0x2f49('0xe')](function(_0x1ee6f0){logger['info'](_0x2f49('0xf'),_0x851525,_0x2f49('0x10'));logger[_0x2f49('0x11')](_0x2f49('0x12'),_0x851525,_0x2f49('0x10'),JSON[_0x2f49('0x13')](_0x1ee6f0));if(_0x1ee6f0[_0x2f49('0x14')]){if(_0x1ee6f0[_0x2f49('0x14')][_0x2f49('0x15')]===0x1f4){logger[_0x2f49('0x14')](_0x2f49('0xf'),_0x851525,_0x1ee6f0[_0x2f49('0x14')][_0x2f49('0x16')]);return _0x152974(_0x1ee6f0[_0x2f49('0x14')]['message']);}logger[_0x2f49('0x14')](_0x2f49('0xf'),_0x851525,_0x1ee6f0[_0x2f49('0x14')][_0x2f49('0x16')]);return _0x19ad1f(_0x1ee6f0[_0x2f49('0x14')][_0x2f49('0x16')]);}else{logger[_0x2f49('0x17')](_0x2f49('0xf'),_0x851525,_0x2f49('0x10'));_0x19ad1f(_0x1ee6f0[_0x2f49('0x18')]['message']);}})[_0x2f49('0x19')](function(_0x1bee35){logger[_0x2f49('0x14')](_0x2f49('0xf'),_0x851525,_0x1bee35);_0x152974(_0x1bee35);});});}exports['UpdateChatInteraction']=function(_0x17c2f7){var _0x27673b=this;return new Promise(function(_0xcdb155,_0x79fa3){return db[_0x2f49('0x1a')][_0x2f49('0x1b')](_0x17c2f7['body'],{'raw':_0x17c2f7[_0x2f49('0x1c')]?_0x17c2f7[_0x2f49('0x1c')][_0x2f49('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17c2f7[_0x2f49('0x1c')]?_0x17c2f7[_0x2f49('0x1c')][_0x2f49('0x1e')]||null:null,'attributes':_0x17c2f7['options']?_0x17c2f7[_0x2f49('0x1c')][_0x2f49('0x1f')]||null:null,'limit':_0x17c2f7[_0x2f49('0x1c')]?_0x17c2f7[_0x2f49('0x1c')][_0x2f49('0x20')]||null:null})[_0x2f49('0xe')](function(_0x15baa4){logger['info'](_0x2f49('0x21'),_0x17c2f7);logger['debug']('UpdateChatInteraction',_0x17c2f7,JSON[_0x2f49('0x13')](_0x15baa4));_0xcdb155(_0x15baa4);})[_0x2f49('0x19')](function(_0x481b60){logger[_0x2f49('0x14')](_0x2f49('0x21'),_0x481b60[_0x2f49('0x16')],_0x17c2f7);_0x79fa3(_0x27673b[_0x2f49('0x14')](0x1f4,_0x481b60[_0x2f49('0x16')]));});});};exports[_0x2f49('0x22')]=function(_0x2cfb1d){return new Promise(function(_0x5ea7ec,_0x4bec74){return db[_0x2f49('0x1a')][_0x2f49('0x23')]({'where':_0x2cfb1d[_0x2f49('0x1c')]?_0x2cfb1d[_0x2f49('0x1c')][_0x2f49('0x1e')]||null:null})['then'](function(_0x591e54){if(_0x591e54){return _0x591e54[_0x2f49('0x24')](_0x2cfb1d[_0x2f49('0x25')][_0x2f49('0x26')],_[_0x2f49('0x27')](_0x2cfb1d[_0x2f49('0x25')],[_0x2f49('0x26'),'id'])||{});}})[_0x2f49('0x28')](function(_0x36aedc){logger[_0x2f49('0x17')](_0x2f49('0x29'),_0x2cfb1d);logger[_0x2f49('0x11')]('AddTags',_0x2cfb1d,JSON[_0x2f49('0x13')](_0x36aedc));_0x5ea7ec(_0x36aedc);})[_0x2f49('0x19')](function(_0x30e811){logger['error'](_0x2f49('0x29'),_0x30e811[_0x2f49('0x16')],_0x2cfb1d);_0x4bec74(_this[_0x2f49('0x14')](0x1f4,_0x30e811[_0x2f49('0x16')]));});});};
\ No newline at end of file
+var _0x8ba0=['message','info','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','body','options','attributes','limit','AddTagsToChatInteraction','where','addTags','ids','omit','spread','AddTags','lodash','bluebird','../../mysqldb','../../config/logger','rpc','client','http','redis','socket.io-emitter','./chatInteraction.socket','request','then','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0x8ba0,0x9e));var _0x08ba=function(_0x5c5899,_0x130bbb){_0x5c5899=_0x5c5899-0x0;var _0x2582d8=_0x8ba0[_0x5c5899];return _0x2582d8;};'use strict';var _=require(_0x08ba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x08ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08ba('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x08ba('0x3'))(_0x08ba('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x08ba('0x5')][_0x08ba('0x6')]({'port':0x232a});config[_0x08ba('0x7')]=_['defaults'](config[_0x08ba('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x08ba('0x8'))(new Redis(config[_0x08ba('0x7')]));require(_0x08ba('0x9'))['register'](socket);function respondWithRpcPromise(_0x4f5bc8,_0x5a9113,_0x4f6ae8){return new BPromise(function(_0x5cf47d,_0x2b8479){return client[_0x08ba('0xa')](_0x4f5bc8,_0x4f6ae8)[_0x08ba('0xb')](function(_0x40824b){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5a9113,'request\x20sent');logger[_0x08ba('0xc')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5a9113,'request\x20sent',JSON[_0x08ba('0xd')](_0x40824b));if(_0x40824b[_0x08ba('0xe')]){if(_0x40824b['error'][_0x08ba('0xf')]===0x1f4){logger[_0x08ba('0xe')](_0x08ba('0x10'),_0x5a9113,_0x40824b['error']['message']);return _0x2b8479(_0x40824b[_0x08ba('0xe')][_0x08ba('0x11')]);}logger[_0x08ba('0xe')](_0x08ba('0x10'),_0x5a9113,_0x40824b[_0x08ba('0xe')][_0x08ba('0x11')]);return _0x5cf47d(_0x40824b[_0x08ba('0xe')][_0x08ba('0x11')]);}else{logger[_0x08ba('0x12')](_0x08ba('0x10'),_0x5a9113,_0x08ba('0x13'));_0x5cf47d(_0x40824b[_0x08ba('0x14')][_0x08ba('0x11')]);}})[_0x08ba('0x15')](function(_0x1934fa){logger[_0x08ba('0xe')](_0x08ba('0x10'),_0x5a9113,_0x1934fa);_0x2b8479(_0x1934fa);});});}exports[_0x08ba('0x16')]=function(_0x10620d){var _0x3a87ad=this;return new Promise(function(_0x1b69b5,_0x19a28e){return db[_0x08ba('0x17')]['update'](_0x10620d[_0x08ba('0x18')],{'raw':_0x10620d[_0x08ba('0x19')]?_0x10620d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10620d[_0x08ba('0x19')]?_0x10620d[_0x08ba('0x19')]['where']||null:null,'attributes':_0x10620d[_0x08ba('0x19')]?_0x10620d[_0x08ba('0x19')][_0x08ba('0x1a')]||null:null,'limit':_0x10620d[_0x08ba('0x19')]?_0x10620d[_0x08ba('0x19')][_0x08ba('0x1b')]||null:null})[_0x08ba('0xb')](function(_0x73a362){logger['info'](_0x08ba('0x16'),_0x10620d);logger[_0x08ba('0xc')](_0x08ba('0x16'),_0x10620d,JSON[_0x08ba('0xd')](_0x73a362));_0x1b69b5(_0x73a362);})[_0x08ba('0x15')](function(_0x3c1609){logger[_0x08ba('0xe')](_0x08ba('0x16'),_0x3c1609['message'],_0x10620d);_0x19a28e(_0x3a87ad[_0x08ba('0xe')](0x1f4,_0x3c1609['message']));});});};exports[_0x08ba('0x1c')]=function(_0x3c993a){return new Promise(function(_0x5cb819,_0x338933){return db['ChatInteraction']['find']({'where':_0x3c993a[_0x08ba('0x19')]?_0x3c993a[_0x08ba('0x19')][_0x08ba('0x1d')]||null:null})[_0x08ba('0xb')](function(_0x551cff){if(_0x551cff){return _0x551cff[_0x08ba('0x1e')](_0x3c993a[_0x08ba('0x18')][_0x08ba('0x1f')],_[_0x08ba('0x20')](_0x3c993a['body'],[_0x08ba('0x1f'),'id'])||{});}})[_0x08ba('0x21')](function(_0x187e72){logger[_0x08ba('0x12')]('AddTags',_0x3c993a);logger[_0x08ba('0xc')](_0x08ba('0x22'),_0x3c993a,JSON['stringify'](_0x187e72));_0x5cb819(_0x187e72);})[_0x08ba('0x15')](function(_0x5469e4){logger[_0x08ba('0xe')](_0x08ba('0x22'),_0x5469e4[_0x08ba('0x11')],_0x3c993a);_0x338933(_this[_0x08ba('0xe')](0x1f4,_0x5469e4[_0x08ba('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 56e6321..cffa2ed 100644
--- a/server/api/chatInteraction/chatInteraction.socket.js
+++ b/server/api/chatInteraction/chatInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7c2=['./chatInteraction.events','remove','update','length','chatInteraction:'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0xb7c2,0x1cc));var _0x2b7c=function(_0x3b6aee,_0x169464){_0x3b6aee=_0x3b6aee-0x0;var _0x24a607=_0xb7c2[_0x3b6aee];return _0x24a607;};'use strict';var ChatInteractionEvents=require(_0x2b7c('0x0'));var events=['save',_0x2b7c('0x1'),_0x2b7c('0x2')];function createListener(_0x2f4f65,_0xeb4db8){return function(_0x235830){_0xeb4db8['emit'](_0x2f4f65,_0x235830);};}function removeListener(_0x2469df,_0x509ad8){return function(){ChatInteractionEvents['removeListener'](_0x2469df,_0x509ad8);};}exports['register']=function(_0x322ce0){for(var _0x376dc5=0x0,_0x4ae558=events[_0x2b7c('0x3')];_0x376dc5<_0x4ae558;_0x376dc5++){var _0x1cf970=events[_0x376dc5];var _0x3450c6=createListener(_0x2b7c('0x4')+_0x1cf970,_0x322ce0);ChatInteractionEvents['on'](_0x1cf970,_0x3450c6);}};
\ No newline at end of file
+var _0x1869=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x297bb4,_0x27c4d4){var _0x159a88=function(_0x28cfce){while(--_0x28cfce){_0x297bb4['push'](_0x297bb4['shift']());}};_0x159a88(++_0x27c4d4);}(_0x1869,0x1c3));var _0x9186=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x1869[_0x1d1779];return _0x2377e9;};'use strict';var ChatInteractionEvents=require(_0x9186('0x0'));var events=[_0x9186('0x1'),_0x9186('0x2'),_0x9186('0x3')];function createListener(_0x8c1e7f,_0x31612a){return function(_0x4e0546){_0x31612a[_0x9186('0x4')](_0x8c1e7f,_0x4e0546);};}function removeListener(_0x1d162d,_0x2c7cd4){return function(){ChatInteractionEvents[_0x9186('0x5')](_0x1d162d,_0x2c7cd4);};}exports[_0x9186('0x6')]=function(_0x319cc3){for(var _0x7db6=0x0,_0x15949d=events[_0x9186('0x7')];_0x7db6<_0x15949d;_0x7db6++){var _0x2b881=events[_0x7db6];var _0xacb782=createListener(_0x9186('0x8')+_0x2b881,_0x319cc3);ChatInteractionEvents['on'](_0x2b881,_0xacb782);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 4a9b443..dd31430 100644
--- a/server/api/chatInteraction/index.js
+++ b/server/api/chatInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88c7=['customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','update'];(function(_0x3528d6,_0x282dda){var _0x478e89=function(_0x4490f2){while(--_0x4490f2){_0x3528d6['push'](_0x3528d6['shift']());}};_0x478e89(++_0x282dda);}(_0x88c7,0x6f));var _0x788c=function(_0x1d5e2f,_0x3fc31e){_0x1d5e2f=_0x1d5e2f-0x0;var _0x3c36e8=_0x88c7[_0x1d5e2f];return _0x3c36e8;};'use strict';var multer=require(_0x788c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x788c('0x1'));var express=require(_0x788c('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x788c('0x3'));var config=require(_0x788c('0x4'));var controller=require('./chatInteraction.controller');router[_0x788c('0x5')]('/',auth[_0x788c('0x6')](),controller['index']);router[_0x788c('0x5')](_0x788c('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x788c('0x5')](_0x788c('0x8'),auth[_0x788c('0x9')](),controller[_0x788c('0xa')]);router[_0x788c('0x5')]('/:id/attachment_download',auth[_0x788c('0x9')](),controller[_0x788c('0xb')]);router[_0x788c('0x5')]('/:id/messages',auth[_0x788c('0x6')](),controller[_0x788c('0xc')]);router[_0x788c('0x5')](_0x788c('0xd'),auth[_0x788c('0x9')](),controller[_0x788c('0xe')]);router['get'](_0x788c('0xf'),auth['isAuthenticated'](),controller[_0x788c('0x10')]);router['post']('/',auth[_0x788c('0x6')](),controller[_0x788c('0x11')]);router[_0x788c('0x12')](_0x788c('0x13'),auth[_0x788c('0x6')](),controller[_0x788c('0x14')]);var upload=multer({'storage':multer[_0x788c('0x15')]({'destination':function(_0x3d837d,_0x2b6e32,_0x41d920){_0x41d920(null,path[_0x788c('0x16')](config[_0x788c('0x17')],_0x788c('0x18')));},'filename':function(_0x5c942e,_0x2f3b41,_0xe0fea5){_0xe0fea5(null,util[_0x788c('0x19')](_0x788c('0x1a'),Date[_0x788c('0x1b')](),_0x2f3b41[_0x788c('0x1c')][_0x788c('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x788c('0x12')](_0x788c('0x1e'),upload[_0x788c('0x1f')]('file'),controller[_0x788c('0x20')]);router[_0x788c('0x12')](_0x788c('0x21'),auth[_0x788c('0x9')](),controller[_0x788c('0x22')]);router[_0x788c('0x12')](_0x788c('0x23'),auth[_0x788c('0x6')](),interaction['tracked'](_0x788c('0x24'),_0x788c('0x25')),controller[_0x788c('0x26')]);router[_0x788c('0x27')](_0x788c('0x8'),auth[_0x788c('0x6')](),interaction[_0x788c('0x28')](_0x788c('0x24'),'chatinteraction:update'),controller[_0x788c('0x29')]);router[_0x788c('0x27')]('/:id/custom_update',controller[_0x788c('0x2a')]);router[_0x788c('0x27')](_0x788c('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x788c('0x2c')]);router[_0x788c('0x27')](_0x788c('0x2d'),controller[_0x788c('0x2e')]);router[_0x788c('0x2f')](_0x788c('0x8'),auth[_0x788c('0x6')](),interaction[_0x788c('0x28')](_0x788c('0x24'),'chatinteraction:destroy'),controller[_0x788c('0x30')]);router[_0x788c('0x2f')](_0x788c('0x23'),auth[_0x788c('0x6')](),controller[_0x788c('0x31')]);module[_0x788c('0x32')]=router;
\ No newline at end of file
+var _0xf53d=['exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./chatInteraction.controller','index','/describe','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','replace','/:id/attachment_upload','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy'];(function(_0x340d08,_0x4f7d3c){var _0x53d8d9=function(_0x2f36dd){while(--_0x2f36dd){_0x340d08['push'](_0x340d08['shift']());}};_0x53d8d9(++_0x4f7d3c);}(_0xf53d,0x199));var _0xdf53=function(_0x2511cd,_0x439c7b){_0x2511cd=_0x2511cd-0x0;var _0x54b19b=_0xf53d[_0x2511cd];return _0x54b19b;};'use strict';var multer=require(_0xdf53('0x0'));var util=require(_0xdf53('0x1'));var path=require('path');var timeout=require(_0xdf53('0x2'));var express=require(_0xdf53('0x3'));var router=express[_0xdf53('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf53('0x5'));var config=require('../../config/environment');var controller=require(_0xdf53('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xdf53('0x7')]);router['get'](_0xdf53('0x8'),auth[_0xdf53('0x9')](),controller[_0xdf53('0xa')]);router[_0xdf53('0xb')](_0xdf53('0xc'),auth[_0xdf53('0xd')](),controller[_0xdf53('0xe')]);router[_0xdf53('0xb')]('/:id/attachment_download',auth[_0xdf53('0xd')](),controller[_0xdf53('0xf')]);router['get'](_0xdf53('0x10'),auth['isAuthenticated'](),controller[_0xdf53('0x11')]);router[_0xdf53('0xb')](_0xdf53('0x12'),auth[_0xdf53('0xd')](),controller[_0xdf53('0x13')]);router[_0xdf53('0xb')]('/:id/download',auth[_0xdf53('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xdf53('0x14')]);router[_0xdf53('0x15')](_0xdf53('0x16'),auth['isAuthenticated'](),controller[_0xdf53('0x17')]);var upload=multer({'storage':multer[_0xdf53('0x18')]({'destination':function(_0x2476ee,_0x174b19,_0x22deb2){_0x22deb2(null,path[_0xdf53('0x19')](config[_0xdf53('0x1a')],_0xdf53('0x1b')));},'filename':function(_0x3af2fa,_0x5965a3,_0x24f9b2){_0x24f9b2(null,util[_0xdf53('0x1c')]('%s-%s',Date[_0xdf53('0x1d')](),_0x5965a3['originalname'][_0xdf53('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdf53('0x15')](_0xdf53('0x1f'),upload['single'](_0xdf53('0x20')),controller[_0xdf53('0x21')]);router[_0xdf53('0x15')]('/:id/messages',auth[_0xdf53('0xd')](),controller['addMessage']);router['post'](_0xdf53('0x22'),auth['isAuthenticated'](),interaction[_0xdf53('0x23')](_0xdf53('0x24'),_0xdf53('0x25')),controller[_0xdf53('0x26')]);router[_0xdf53('0x27')](_0xdf53('0xc'),auth[_0xdf53('0x9')](),interaction['tracked'](_0xdf53('0x24'),_0xdf53('0x28')),controller[_0xdf53('0x29')]);router[_0xdf53('0x27')]('/:id/custom_update',controller[_0xdf53('0x2a')]);router[_0xdf53('0x27')](_0xdf53('0x2b'),auth[_0xdf53('0xd')](),controller[_0xdf53('0x2c')]);router[_0xdf53('0x27')](_0xdf53('0x2d'),controller[_0xdf53('0x2e')]);router[_0xdf53('0x2f')](_0xdf53('0xc'),auth[_0xdf53('0x9')](),interaction[_0xdf53('0x23')](_0xdf53('0x24'),_0xdf53('0x30')),controller[_0xdf53('0x31')]);router['delete'](_0xdf53('0x22'),auth['isAuthenticated'](),controller['removeTags']);module[_0xdf53('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 34120f2..63037b8 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x3f5b8a,_0x1a04e4){var _0x29a549=function(_0xe05474){while(--_0xe05474){_0x3f5b8a['push'](_0x3f5b8a['shift']());}};_0x29a549(++_0x1a04e4);}(_0xdb28,0x106));var _0x8db2=function(_0x82ed59,_0x4151d2){_0x82ed59=_0x82ed59-0x0;var _0x1aa339=_0xdb28[_0x82ed59];return _0x1aa339;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8db2('0x4')]}};
\ No newline at end of file
+var _0x2ef3=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x294273,_0x4659e9){var _0x9b6c55=function(_0x5b837a){while(--_0x5b837a){_0x294273['push'](_0x294273['shift']());}};_0x9b6c55(++_0x4659e9);}(_0x2ef3,0xba));var _0x32ef=function(_0x2abc7b,_0x84cc6a){_0x2abc7b=_0x2abc7b-0x0;var _0x6b111e=_0x2ef3[_0x2abc7b];return _0x6b111e;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'body':{'type':Sequelize[_0x32ef('0x2')](_0x32ef('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x32ef('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x32ef('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 17eff35..f579820 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.controller.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3c0=['index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params','find','create','body','destroy','describe','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','end','error','stack','name'];(function(_0x496158,_0x798a8){var _0x3ae809=function(_0x6fa2ad){while(--_0x6fa2ad){_0x496158['push'](_0x496158['shift']());}};_0x3ae809(++_0x798a8);}(_0xf3c0,0xb8));var _0x0f3c=function(_0x466f46,_0x53cb02){_0x466f46=_0x466f46-0x0;var _0x3fad5d=_0xf3c0[_0x466f46];return _0x3fad5d;};'use strict';var pdf=require(_0x0f3c('0x0'));var emlformat=require(_0x0f3c('0x1'));var rimraf=require(_0x0f3c('0x2'));var zipdir=require(_0x0f3c('0x3'));var jsonpatch=require(_0x0f3c('0x4'));var rp=require(_0x0f3c('0x5'));var moment=require(_0x0f3c('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0f3c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0f3c('0x8'));var ejs=require(_0x0f3c('0x9'));var fs=require('fs');var _=require(_0x0f3c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f3c('0xb'));var deskjs=require(_0x0f3c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0f3c('0xd'));var Papa=require('papaparse');var Redis=require(_0x0f3c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0f3c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f3c('0x10'));var logger=require('../../config/logger')(_0x0f3c('0x11'));var utils=require(_0x0f3c('0x12'));var config=require(_0x0f3c('0x13'));var db=require(_0x0f3c('0x14'))['db'];config[_0x0f3c('0x15')]=_[_0x0f3c('0x16')](config[_0x0f3c('0x15')],{'host':_0x0f3c('0x17'),'port':0x18eb});var socket=require(_0x0f3c('0x18'))(new Redis(config[_0x0f3c('0x15')]));require(_0x0f3c('0x19'))[_0x0f3c('0x1a')](socket);function respondWithStatusCode(_0x3e6905,_0x234dc4){_0x234dc4=_0x234dc4||0xcc;return function(_0x1c29d2){if(_0x1c29d2){return _0x3e6905[_0x0f3c('0x1b')](_0x234dc4);}return _0x3e6905[_0x0f3c('0x1c')](_0x234dc4)['end']();};}function respondWithResult(_0x2d2c9f,_0x165c91){_0x165c91=_0x165c91||0xc8;return function(_0x4f3bd0){if(_0x4f3bd0){return _0x2d2c9f[_0x0f3c('0x1c')](_0x165c91)[_0x0f3c('0x1d')](_0x4f3bd0);}};}function respondWithFilteredResult(_0x5345e7,_0x6567cc){return function(_0x2e07ce){if(_0x2e07ce){var _0x24ca2e=_0x2e07ce[_0x0f3c('0x1e')],_0x3fdad9=_0x6567cc[_0x0f3c('0x1f')],_0x2b9b73=_0x6567cc[_0x0f3c('0x1f')]+_0x6567cc[_0x0f3c('0x20')],_0x2672bf;if(_0x2b9b73>=_0x24ca2e){_0x2b9b73=_0x24ca2e;_0x2672bf=0xc8;}else{_0x2672bf=0xce;}_0x5345e7['status'](_0x2672bf);return _0x5345e7['set'](_0x0f3c('0x21'),_0x3fdad9+'-'+_0x2b9b73+'/'+_0x24ca2e)[_0x0f3c('0x1d')](_0x2e07ce);}return null;};}function patchUpdates(_0x149ba7){return function(_0x2a8181){try{jsonpatch[_0x0f3c('0x22')](_0x2a8181,_0x149ba7,!![]);}catch(_0x265fa7){return BPromise[_0x0f3c('0x23')](_0x265fa7);}return _0x2a8181[_0x0f3c('0x24')]();};}function saveUpdates(_0x587610,_0x25c73f){return function(_0x599ba8){if(_0x599ba8){return _0x599ba8[_0x0f3c('0x25')](_0x587610)['then'](function(_0x2239a7){return _0x2239a7;});}return null;};}function removeEntity(_0x2f22b1,_0x513668){return function(_0x5c027e){if(_0x5c027e){return _0x5c027e['destroy']()['then'](function(){_0x2f22b1[_0x0f3c('0x1c')](0xcc)[_0x0f3c('0x26')]();});}};}function handleEntityNotFound(_0x502ba2,_0x1a3a68){return function(_0x502994){if(!_0x502994){_0x502ba2['sendStatus'](0x194);}return _0x502994;};}function handleError(_0x319f59,_0x38b23a){_0x38b23a=_0x38b23a||0x1f4;return function(_0x22fc80){logger[_0x0f3c('0x27')](_0x22fc80[_0x0f3c('0x28')]);if(_0x22fc80['name']){delete _0x22fc80[_0x0f3c('0x29')];}_0x319f59[_0x0f3c('0x1c')](_0x38b23a)['send'](_0x22fc80);};}exports[_0x0f3c('0x2a')]=function(_0x31ae61,_0x342901){var _0xade6cb={},_0x33998b={},_0xdb198b={'count':0x0,'rows':[]};var _0x31aee4=_[_0x0f3c('0x2b')](db[_0x0f3c('0x2c')][_0x0f3c('0x2d')],function(_0x2de340){return{'name':_0x2de340[_0x0f3c('0x2e')],'type':_0x2de340['type'][_0x0f3c('0x2f')]};});_0x33998b[_0x0f3c('0x30')]=_[_0x0f3c('0x2b')](_0x31aee4,_0x0f3c('0x29'));_0x33998b[_0x0f3c('0x31')]=_[_0x0f3c('0x32')](_0x31ae61['query']);_0x33998b[_0x0f3c('0x33')]=_[_0x0f3c('0x34')](_0x33998b['model'],_0x33998b[_0x0f3c('0x31')]);_0xade6cb[_0x0f3c('0x35')]=_[_0x0f3c('0x34')](_0x33998b[_0x0f3c('0x30')],qs[_0x0f3c('0x36')](_0x31ae61['query'][_0x0f3c('0x36')]));_0xade6cb['attributes']=_0xade6cb[_0x0f3c('0x35')][_0x0f3c('0x37')]?_0xade6cb[_0x0f3c('0x35')]:_0x33998b[_0x0f3c('0x30')];if(!_0x31ae61[_0x0f3c('0x31')][_0x0f3c('0x38')](_0x0f3c('0x39'))){_0xade6cb[_0x0f3c('0x20')]=qs[_0x0f3c('0x20')](_0x31ae61[_0x0f3c('0x31')]['limit']);_0xade6cb[_0x0f3c('0x1f')]=qs[_0x0f3c('0x1f')](_0x31ae61[_0x0f3c('0x31')]['offset']);}_0xade6cb[_0x0f3c('0x3a')]=qs[_0x0f3c('0x3b')](_0x31ae61[_0x0f3c('0x31')][_0x0f3c('0x3b')]);_0xade6cb[_0x0f3c('0x3c')]=qs[_0x0f3c('0x33')](_[_0x0f3c('0x3d')](_0x31ae61[_0x0f3c('0x31')],_0x33998b[_0x0f3c('0x33')]),_0x31aee4);if(_0x31ae61['query'][_0x0f3c('0x3e')]){_0xade6cb['where']=_[_0x0f3c('0x3f')](_0xade6cb[_0x0f3c('0x3c')],{'$or':_[_0x0f3c('0x2b')](_0x31aee4,function(_0x210b37){if(_0x210b37['type']!==_0x0f3c('0x40')){var _0x2b520c={};_0x2b520c[_0x210b37[_0x0f3c('0x29')]]={'$like':'%'+_0x31ae61[_0x0f3c('0x31')][_0x0f3c('0x3e')]+'%'};return _0x2b520c;}})});}_0xade6cb=_[_0x0f3c('0x3f')]({},_0xade6cb,_0x31ae61[_0x0f3c('0x41')]);var _0x1dffa7={'where':_0xade6cb[_0x0f3c('0x3c')]};return db['ChatInternalMessage'][_0x0f3c('0x1e')](_0x1dffa7)['then'](function(_0x420674){_0xdb198b[_0x0f3c('0x1e')]=_0x420674;if(_0x31ae61[_0x0f3c('0x31')][_0x0f3c('0x42')]){_0xade6cb[_0x0f3c('0x43')]=[{'all':!![]}];}return db[_0x0f3c('0x2c')][_0x0f3c('0x44')](_0xade6cb);})[_0x0f3c('0x45')](function(_0x1ba771){_0xdb198b['rows']=_0x1ba771;return _0xdb198b;})['then'](respondWithFilteredResult(_0x342901,_0xade6cb))[_0x0f3c('0x46')](handleError(_0x342901,null));};exports[_0x0f3c('0x47')]=function(_0x237915,_0x6e209c){var _0x457011={'raw':!![],'where':{'id':_0x237915[_0x0f3c('0x48')]['id']}},_0x1dac99={};_0x1dac99[_0x0f3c('0x30')]=_['keys'](db['ChatInternalMessage'][_0x0f3c('0x2d')]);_0x1dac99['query']=_['keys'](_0x237915[_0x0f3c('0x31')]);_0x1dac99['filters']=_['intersection'](_0x1dac99['model'],_0x1dac99['query']);_0x457011[_0x0f3c('0x35')]=_[_0x0f3c('0x34')](_0x1dac99['model'],qs['fields'](_0x237915[_0x0f3c('0x31')][_0x0f3c('0x36')]));_0x457011['attributes']=_0x457011[_0x0f3c('0x35')][_0x0f3c('0x37')]?_0x457011[_0x0f3c('0x35')]:_0x1dac99['model'];if(_0x237915[_0x0f3c('0x31')][_0x0f3c('0x42')]){_0x457011[_0x0f3c('0x43')]=[{'all':!![]}];}_0x457011=_[_0x0f3c('0x3f')]({},_0x457011,_0x237915[_0x0f3c('0x41')]);return db[_0x0f3c('0x2c')][_0x0f3c('0x49')](_0x457011)['then'](handleEntityNotFound(_0x6e209c,null))[_0x0f3c('0x45')](respondWithResult(_0x6e209c,null))[_0x0f3c('0x46')](handleError(_0x6e209c,null));};exports[_0x0f3c('0x4a')]=function(_0x1be961,_0x4002c2){return db['ChatInternalMessage'][_0x0f3c('0x4a')](_0x1be961[_0x0f3c('0x4b')],{})[_0x0f3c('0x45')](respondWithResult(_0x4002c2,0xc9))['catch'](handleError(_0x4002c2,null));};exports[_0x0f3c('0x25')]=function(_0x517a32,_0x1a6b2b){if(_0x517a32['body']['id']){delete _0x517a32['body']['id'];}return db['ChatInternalMessage'][_0x0f3c('0x49')]({'where':{'id':_0x517a32[_0x0f3c('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a6b2b,null))[_0x0f3c('0x45')](saveUpdates(_0x517a32[_0x0f3c('0x4b')],null))['then'](respondWithResult(_0x1a6b2b,null))[_0x0f3c('0x46')](handleError(_0x1a6b2b,null));};exports[_0x0f3c('0x4c')]=function(_0x2009bb,_0x32bffc){return db[_0x0f3c('0x2c')][_0x0f3c('0x49')]({'where':{'id':_0x2009bb[_0x0f3c('0x48')]['id']}})['then'](handleEntityNotFound(_0x32bffc,null))['then'](removeEntity(_0x32bffc,null))[_0x0f3c('0x46')](handleError(_0x32bffc,null));};exports['describe']=function(_0x202d07,_0x1c07b6){return db[_0x0f3c('0x2c')][_0x0f3c('0x4d')]()[_0x0f3c('0x45')](respondWithResult(_0x1c07b6,null))[_0x0f3c('0x46')](handleError(_0x1c07b6,null));};function wrapUser(_0x330520){return function(_0x37c19c){var _0x539221=_0x330520[_0x0f3c('0x4e')]({'plain':!![]});_0x539221[_0x0f3c('0x4f')]=[];if(_0x37c19c){_0x539221[_0x0f3c('0x50')]=_0x37c19c['createdAt'];_0x539221['lastMessage']=_0x37c19c;}else{_0x539221[_0x0f3c('0x50')]=moment(0x0)[_0x0f3c('0x51')](_0x0f3c('0x52'));_0x539221['lastMessage']={};}return _0x539221;};}exports[_0x0f3c('0x53')]=function(_0x1698d8,_0x2d232e,_0x4e6e5f){var _0x5346bd=[];return db[_0x0f3c('0x54')][_0x0f3c('0x44')]({'where':{'role':['agent',_0x0f3c('0x55'),_0x0f3c('0x56')]},'attributes':['id',_0x0f3c('0x57'),_0x0f3c('0x29'),_0x0f3c('0x58'),_0x0f3c('0x59'),_0x0f3c('0x5a'),_0x0f3c('0x5b'),_0x0f3c('0x5c'),_0x0f3c('0x5d'),_0x0f3c('0x5e')],'order':qs['sort']('-online'),'include':[{'model':db[_0x0f3c('0x5f')],'as':_0x0f3c('0x60'),'attributes':['id',_0x0f3c('0x29'),_0x0f3c('0x61')],'through':{'attributes':[]}}]})[_0x0f3c('0x45')](function(_0x23eef1){if(_0x23eef1){var _0x14b79c=_0x1698d8[_0x0f3c('0x56')][_0x0f3c('0x4e')]({'plain':!![]});if(!_0x14b79c)throw new Error(_0x0f3c('0x62'));if(_0x14b79c[_0x0f3c('0x58')]==='user'){return db[_0x0f3c('0x63')][_0x0f3c('0x49')]({'where':{'name':_0x0f3c('0x64'),'userProfileId':_0x14b79c[_0x0f3c('0x65')]},'raw':!![]})[_0x0f3c('0x45')](function(_0x40bf8f){if(_0x40bf8f){if(_0x40bf8f[_0x0f3c('0x66')]===0x0){return db[_0x0f3c('0x67')][_0x0f3c('0x44')]({'where':{'sectionId':_0x40bf8f['id']},'raw':!![]})[_0x0f3c('0x45')](function(_0x39c0dc){var _0x45a88d=[];if(_['isEmpty'](_0x39c0dc)){_0x45a88d=_[_0x0f3c('0x3e')](_0x23eef1,function(_0x535f20){if(_0x535f20[_0x0f3c('0x58')]!=='agent'){return _0x535f20;}});return _0x45a88d;}else{for(var _0x56be33=0x0;_0x56be33<_0x23eef1[_0x0f3c('0x37')];_0x56be33++){var _0x281ac=_0x23eef1[_0x56be33];if(_0x281ac[_0x0f3c('0x58')]===_0x0f3c('0x68')){var _0x3c96dc=_['find'](_0x39c0dc,function(_0x1e90a3){return _0x1e90a3[_0x0f3c('0x69')]===_0x281ac['id'];});if(_0x3c96dc)_0x45a88d[_0x0f3c('0x6a')](_0x281ac);}else{_0x45a88d[_0x0f3c('0x6a')](_0x281ac);}}return _0x45a88d;}});}else{return _0x23eef1;}}else{var _0x48991c=_['filter'](_0x23eef1,function(_0x41a2e8){if(_0x41a2e8['role']!==_0x0f3c('0x68')){return _0x41a2e8;}});return _0x48991c;}});}else{return _0x23eef1;}}})[_0x0f3c('0x45')](function(_0x44c1ea){var _0x48a371=[];if(_0x44c1ea){_0x5346bd=_0x44c1ea;for(var _0x1b480c=0x0;_0x1b480c<_0x44c1ea[_0x0f3c('0x37')];_0x1b480c+=0x1){_0x5346bd[_0x1b480c][_0x0f3c('0x4f')]=[];_0x48a371[_0x0f3c('0x6a')](db[_0x0f3c('0x2c')][_0x0f3c('0x49')]({'where':{'FromId':[_0x1698d8[_0x0f3c('0x56')]['id'],_0x44c1ea[_0x1b480c]['id']],'ToId':[_0x1698d8['user']['id'],_0x44c1ea[_0x1b480c]['id']],'ChatGroupId':null},'attributes':['id',_0x0f3c('0x6b'),_0x0f3c('0x6c'),_0x0f3c('0x6d'),_0x0f3c('0x6e'),_0x0f3c('0x4b')],'order':qs['sort'](_0x0f3c('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0f3c('0x45')](wrapUser(_0x44c1ea[_0x1b480c])));}return BPromise[_0x0f3c('0x70')](_0x48a371);}return[];})[_0x0f3c('0x45')](function(_0x572e8e){return{'rows':_0x572e8e,'count':_0x572e8e[_0x0f3c('0x37')]};})[_0x0f3c('0x45')](respondWithResult(_0x2d232e,null))[_0x0f3c('0x46')](handleError(_0x2d232e,null));};
\ No newline at end of file
+var _0xb1ce=['mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','count','limit','set','Content-Range','apply','reject','save','then','end','sendStatus','stack','name','index','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','ChatInternalMessage','rows','catch','show','params','length','find','create','update','body','destroy','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','read','-createdAt','all','eml-format','fast-json-patch','request-promise','moment'];(function(_0x4232a8,_0x295a1e){var _0x26c6ca=function(_0x4513ed){while(--_0x4513ed){_0x4232a8['push'](_0x4232a8['shift']());}};_0x26c6ca(++_0x295a1e);}(_0xb1ce,0xda));var _0xeb1c=function(_0x5cac79,_0x5f272d){_0x5cac79=_0x5cac79-0x0;var _0x4dba8c=_0xb1ce[_0x5cac79];return _0x4dba8c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeb1c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeb1c('0x1'));var rp=require(_0xeb1c('0x2'));var moment=require(_0xeb1c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xeb1c('0x4'));var util=require(_0xeb1c('0x5'));var path=require(_0xeb1c('0x6'));var sox=require(_0xeb1c('0x7'));var csv=require(_0xeb1c('0x8'));var ejs=require(_0xeb1c('0x9'));var fs=require('fs');var _=require(_0xeb1c('0xa'));var squel=require('squel');var crypto=require(_0xeb1c('0xb'));var jsforce=require(_0xeb1c('0xc'));var deskjs=require(_0xeb1c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeb1c('0xe'));var authService=require(_0xeb1c('0xf'));var qs=require(_0xeb1c('0x10'));var as=require(_0xeb1c('0x11'));var hardwareService=require(_0xeb1c('0x12'));var logger=require(_0xeb1c('0x13'))('api');var utils=require(_0xeb1c('0x14'));var config=require(_0xeb1c('0x15'));var db=require(_0xeb1c('0x16'))['db'];config[_0xeb1c('0x17')]=_[_0xeb1c('0x18')](config[_0xeb1c('0x17')],{'host':_0xeb1c('0x19'),'port':0x18eb});var socket=require(_0xeb1c('0x1a'))(new Redis(config['redis']));require(_0xeb1c('0x1b'))[_0xeb1c('0x1c')](socket);function respondWithStatusCode(_0x2b3a91,_0x439c6d){_0x439c6d=_0x439c6d||0xcc;return function(_0x23036c){if(_0x23036c){return _0x2b3a91['sendStatus'](_0x439c6d);}return _0x2b3a91[_0xeb1c('0x1d')](_0x439c6d)['end']();};}function respondWithResult(_0x2ba7dd,_0x28d6b7){_0x28d6b7=_0x28d6b7||0xc8;return function(_0x243baa){if(_0x243baa){return _0x2ba7dd[_0xeb1c('0x1d')](_0x28d6b7)[_0xeb1c('0x1e')](_0x243baa);}};}function respondWithFilteredResult(_0x42f210,_0x1b27d8){return function(_0x548daa){if(_0x548daa){var _0xa34946=_0x548daa[_0xeb1c('0x1f')],_0x592adf=_0x1b27d8['offset'],_0x244d13=_0x1b27d8['offset']+_0x1b27d8[_0xeb1c('0x20')],_0x4e685e;if(_0x244d13>=_0xa34946){_0x244d13=_0xa34946;_0x4e685e=0xc8;}else{_0x4e685e=0xce;}_0x42f210[_0xeb1c('0x1d')](_0x4e685e);return _0x42f210[_0xeb1c('0x21')](_0xeb1c('0x22'),_0x592adf+'-'+_0x244d13+'/'+_0xa34946)['json'](_0x548daa);}return null;};}function patchUpdates(_0x265cd3){return function(_0x67f29a){try{jsonpatch[_0xeb1c('0x23')](_0x67f29a,_0x265cd3,!![]);}catch(_0x330466){return BPromise[_0xeb1c('0x24')](_0x330466);}return _0x67f29a[_0xeb1c('0x25')]();};}function saveUpdates(_0x59ccf8,_0x62a481){return function(_0x31670d){if(_0x31670d){return _0x31670d['update'](_0x59ccf8)[_0xeb1c('0x26')](function(_0x21375c){return _0x21375c;});}return null;};}function removeEntity(_0x57bacd,_0x2a7d2e){return function(_0x3481f8){if(_0x3481f8){return _0x3481f8['destroy']()[_0xeb1c('0x26')](function(){_0x57bacd[_0xeb1c('0x1d')](0xcc)[_0xeb1c('0x27')]();});}};}function handleEntityNotFound(_0x56ff00,_0x101cf5){return function(_0xe6c4d4){if(!_0xe6c4d4){_0x56ff00[_0xeb1c('0x28')](0x194);}return _0xe6c4d4;};}function handleError(_0x50e8fd,_0x39cbda){_0x39cbda=_0x39cbda||0x1f4;return function(_0x14fd06){logger['error'](_0x14fd06[_0xeb1c('0x29')]);if(_0x14fd06[_0xeb1c('0x2a')]){delete _0x14fd06[_0xeb1c('0x2a')];}_0x50e8fd[_0xeb1c('0x1d')](_0x39cbda)['send'](_0x14fd06);};}exports[_0xeb1c('0x2b')]=function(_0x26c6a0,_0x313742){var _0x354dbd={},_0x2246d5={},_0x2c05f5={'count':0x0,'rows':[]};var _0x28be06=_[_0xeb1c('0x2c')](db['ChatInternalMessage'][_0xeb1c('0x2d')],function(_0x3d3a00){return{'name':_0x3d3a00['fieldName'],'type':_0x3d3a00[_0xeb1c('0x2e')]['key']};});_0x2246d5[_0xeb1c('0x2f')]=_[_0xeb1c('0x2c')](_0x28be06,_0xeb1c('0x2a'));_0x2246d5['query']=_[_0xeb1c('0x30')](_0x26c6a0[_0xeb1c('0x31')]);_0x2246d5[_0xeb1c('0x32')]=_[_0xeb1c('0x33')](_0x2246d5['model'],_0x2246d5[_0xeb1c('0x31')]);_0x354dbd[_0xeb1c('0x34')]=_[_0xeb1c('0x33')](_0x2246d5[_0xeb1c('0x2f')],qs['fields'](_0x26c6a0[_0xeb1c('0x31')][_0xeb1c('0x35')]));_0x354dbd['attributes']=_0x354dbd[_0xeb1c('0x34')]['length']?_0x354dbd[_0xeb1c('0x34')]:_0x2246d5[_0xeb1c('0x2f')];if(!_0x26c6a0[_0xeb1c('0x31')][_0xeb1c('0x36')](_0xeb1c('0x37'))){_0x354dbd[_0xeb1c('0x20')]=qs[_0xeb1c('0x20')](_0x26c6a0[_0xeb1c('0x31')][_0xeb1c('0x20')]);_0x354dbd[_0xeb1c('0x38')]=qs['offset'](_0x26c6a0[_0xeb1c('0x31')][_0xeb1c('0x38')]);}_0x354dbd[_0xeb1c('0x39')]=qs[_0xeb1c('0x3a')](_0x26c6a0[_0xeb1c('0x31')][_0xeb1c('0x3a')]);_0x354dbd[_0xeb1c('0x3b')]=qs[_0xeb1c('0x32')](_['pick'](_0x26c6a0[_0xeb1c('0x31')],_0x2246d5['filters']),_0x28be06);if(_0x26c6a0[_0xeb1c('0x31')]['filter']){_0x354dbd[_0xeb1c('0x3b')]=_['merge'](_0x354dbd[_0xeb1c('0x3b')],{'$or':_[_0xeb1c('0x2c')](_0x28be06,function(_0x2281e9){if(_0x2281e9[_0xeb1c('0x2e')]!==_0xeb1c('0x3c')){var _0x5585b8={};_0x5585b8[_0x2281e9[_0xeb1c('0x2a')]]={'$like':'%'+_0x26c6a0[_0xeb1c('0x31')][_0xeb1c('0x3d')]+'%'};return _0x5585b8;}})});}_0x354dbd=_[_0xeb1c('0x3e')]({},_0x354dbd,_0x26c6a0[_0xeb1c('0x3f')]);var _0x4d341c={'where':_0x354dbd[_0xeb1c('0x3b')]};return db['ChatInternalMessage'][_0xeb1c('0x1f')](_0x4d341c)['then'](function(_0x5f43e6){_0x2c05f5[_0xeb1c('0x1f')]=_0x5f43e6;if(_0x26c6a0[_0xeb1c('0x31')][_0xeb1c('0x40')]){_0x354dbd[_0xeb1c('0x41')]=[{'all':!![]}];}return db[_0xeb1c('0x42')]['findAll'](_0x354dbd);})['then'](function(_0x178a2b){_0x2c05f5[_0xeb1c('0x43')]=_0x178a2b;return _0x2c05f5;})[_0xeb1c('0x26')](respondWithFilteredResult(_0x313742,_0x354dbd))[_0xeb1c('0x44')](handleError(_0x313742,null));};exports[_0xeb1c('0x45')]=function(_0x32b61f,_0xdc6615){var _0x53b8bb={'raw':!![],'where':{'id':_0x32b61f[_0xeb1c('0x46')]['id']}},_0x1c2de3={};_0x1c2de3[_0xeb1c('0x2f')]=_[_0xeb1c('0x30')](db[_0xeb1c('0x42')][_0xeb1c('0x2d')]);_0x1c2de3[_0xeb1c('0x31')]=_[_0xeb1c('0x30')](_0x32b61f[_0xeb1c('0x31')]);_0x1c2de3['filters']=_[_0xeb1c('0x33')](_0x1c2de3[_0xeb1c('0x2f')],_0x1c2de3['query']);_0x53b8bb[_0xeb1c('0x34')]=_[_0xeb1c('0x33')](_0x1c2de3[_0xeb1c('0x2f')],qs[_0xeb1c('0x35')](_0x32b61f[_0xeb1c('0x31')]['fields']));_0x53b8bb[_0xeb1c('0x34')]=_0x53b8bb[_0xeb1c('0x34')][_0xeb1c('0x47')]?_0x53b8bb[_0xeb1c('0x34')]:_0x1c2de3[_0xeb1c('0x2f')];if(_0x32b61f[_0xeb1c('0x31')][_0xeb1c('0x40')]){_0x53b8bb['include']=[{'all':!![]}];}_0x53b8bb=_[_0xeb1c('0x3e')]({},_0x53b8bb,_0x32b61f[_0xeb1c('0x3f')]);return db[_0xeb1c('0x42')][_0xeb1c('0x48')](_0x53b8bb)[_0xeb1c('0x26')](handleEntityNotFound(_0xdc6615,null))['then'](respondWithResult(_0xdc6615,null))[_0xeb1c('0x44')](handleError(_0xdc6615,null));};exports['create']=function(_0x397d9c,_0x379279){return db[_0xeb1c('0x42')][_0xeb1c('0x49')](_0x397d9c['body'],{})[_0xeb1c('0x26')](respondWithResult(_0x379279,0xc9))[_0xeb1c('0x44')](handleError(_0x379279,null));};exports[_0xeb1c('0x4a')]=function(_0x5e0af3,_0x9516f9){if(_0x5e0af3[_0xeb1c('0x4b')]['id']){delete _0x5e0af3[_0xeb1c('0x4b')]['id'];}return db[_0xeb1c('0x42')][_0xeb1c('0x48')]({'where':{'id':_0x5e0af3[_0xeb1c('0x46')]['id']}})[_0xeb1c('0x26')](handleEntityNotFound(_0x9516f9,null))[_0xeb1c('0x26')](saveUpdates(_0x5e0af3['body'],null))[_0xeb1c('0x26')](respondWithResult(_0x9516f9,null))['catch'](handleError(_0x9516f9,null));};exports[_0xeb1c('0x4c')]=function(_0x235350,_0x482be7){return db[_0xeb1c('0x42')][_0xeb1c('0x48')]({'where':{'id':_0x235350['params']['id']}})['then'](handleEntityNotFound(_0x482be7,null))[_0xeb1c('0x26')](removeEntity(_0x482be7,null))[_0xeb1c('0x44')](handleError(_0x482be7,null));};exports[_0xeb1c('0x4d')]=function(_0xb396ed,_0x4a3abf){return db[_0xeb1c('0x42')][_0xeb1c('0x4d')]()[_0xeb1c('0x26')](respondWithResult(_0x4a3abf,null))[_0xeb1c('0x44')](handleError(_0x4a3abf,null));};function wrapUser(_0x319362){return function(_0x3404c2){var _0x571991=_0x319362[_0xeb1c('0x4e')]({'plain':!![]});_0x571991[_0xeb1c('0x4f')]=[];if(_0x3404c2){_0x571991['lastMessageAt']=_0x3404c2[_0xeb1c('0x50')];_0x571991[_0xeb1c('0x51')]=_0x3404c2;}else{_0x571991[_0xeb1c('0x52')]=moment(0x0)[_0xeb1c('0x53')](_0xeb1c('0x54'));_0x571991['lastMessage']={};}return _0x571991;};}exports[_0xeb1c('0x55')]=function(_0x454dc3,_0x2896a9,_0x3da477){var _0x3c5c43=[];return db[_0xeb1c('0x56')][_0xeb1c('0x57')]({'where':{'role':[_0xeb1c('0x58'),_0xeb1c('0x59'),_0xeb1c('0x5a')]},'attributes':['id','fullname',_0xeb1c('0x2a'),_0xeb1c('0x5b'),_0xeb1c('0x5c'),_0xeb1c('0x5d'),'online',_0xeb1c('0x5e'),_0xeb1c('0x5f'),_0xeb1c('0x60')],'order':qs['sort'](_0xeb1c('0x61')),'include':[{'model':db[_0xeb1c('0x62')],'as':_0xeb1c('0x63'),'attributes':['id','name',_0xeb1c('0x2e')],'through':{'attributes':[]}}]})[_0xeb1c('0x26')](function(_0x20a7da){if(_0x20a7da){var _0x3bce6b=_0x454dc3[_0xeb1c('0x5a')][_0xeb1c('0x4e')]({'plain':!![]});if(!_0x3bce6b)throw new Error(_0xeb1c('0x64'));if(_0x3bce6b[_0xeb1c('0x5b')]==='user'){return db[_0xeb1c('0x65')][_0xeb1c('0x48')]({'where':{'name':'Agents','userProfileId':_0x3bce6b[_0xeb1c('0x66')]},'raw':!![]})[_0xeb1c('0x26')](function(_0x107b64){if(_0x107b64){if(_0x107b64[_0xeb1c('0x67')]===0x0){return db[_0xeb1c('0x68')][_0xeb1c('0x57')]({'where':{'sectionId':_0x107b64['id']},'raw':!![]})['then'](function(_0x28ad66){var _0x176c93=[];if(_[_0xeb1c('0x69')](_0x28ad66)){_0x176c93=_[_0xeb1c('0x3d')](_0x20a7da,function(_0x49a540){if(_0x49a540[_0xeb1c('0x5b')]!==_0xeb1c('0x58')){return _0x49a540;}});return _0x176c93;}else{for(var _0x2e3fce=0x0;_0x2e3fce<_0x20a7da[_0xeb1c('0x47')];_0x2e3fce++){var _0x2dc1d4=_0x20a7da[_0x2e3fce];if(_0x2dc1d4[_0xeb1c('0x5b')]==='agent'){var _0x50cbc0=_[_0xeb1c('0x48')](_0x28ad66,function(_0x41685b){return _0x41685b[_0xeb1c('0x6a')]===_0x2dc1d4['id'];});if(_0x50cbc0)_0x176c93[_0xeb1c('0x6b')](_0x2dc1d4);}else{_0x176c93[_0xeb1c('0x6b')](_0x2dc1d4);}}return _0x176c93;}});}else{return _0x20a7da;}}else{var _0x1dd592=_[_0xeb1c('0x3d')](_0x20a7da,function(_0x4e5b6b){if(_0x4e5b6b['role']!==_0xeb1c('0x58')){return _0x4e5b6b;}});return _0x1dd592;}});}else{return _0x20a7da;}}})[_0xeb1c('0x26')](function(_0x2e577d){var _0x16ddee=[];if(_0x2e577d){_0x3c5c43=_0x2e577d;for(var _0x35834c=0x0;_0x35834c<_0x2e577d[_0xeb1c('0x47')];_0x35834c+=0x1){_0x3c5c43[_0x35834c][_0xeb1c('0x4f')]=[];_0x16ddee[_0xeb1c('0x6b')](db[_0xeb1c('0x42')][_0xeb1c('0x48')]({'where':{'FromId':[_0x454dc3[_0xeb1c('0x5a')]['id'],_0x2e577d[_0x35834c]['id']],'ToId':[_0x454dc3[_0xeb1c('0x5a')]['id'],_0x2e577d[_0x35834c]['id']],'ChatGroupId':null},'attributes':['id',_0xeb1c('0x50'),'FromId','ToId',_0xeb1c('0x6c'),_0xeb1c('0x4b')],'order':qs['sort'](_0xeb1c('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xeb1c('0x26')](wrapUser(_0x2e577d[_0x35834c])));}return BPromise[_0xeb1c('0x6e')](_0x16ddee);}return[];})['then'](function(_0x310fb3){return{'rows':_0x310fb3,'count':_0x310fb3[_0xeb1c('0x47')]};})[_0xeb1c('0x26')](respondWithResult(_0x2896a9,null))[_0xeb1c('0x44')](handleError(_0x2896a9,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 6f3ec9e..8eba9ab 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.events.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc903=['emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','update'];(function(_0x4e4818,_0x4e6615){var _0x52d174=function(_0x1c08a9){while(--_0x1c08a9){_0x4e4818['push'](_0x4e4818['shift']());}};_0x52d174(++_0x4e6615);}(_0xc903,0x177));var _0x3c90=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xc903[_0x149ca0];return _0x56b6b9;};'use strict';var EventEmitter=require(_0x3c90('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x3c90('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3c90('0x2'),'afterDestroy':'remove'};function emitEvent(_0x426091){return function(_0x54545a,_0x1e9e2b,_0x2ecb71){ChatInternalMessageEvents['emit'](_0x426091+':'+_0x54545a['id'],_0x54545a);ChatInternalMessageEvents[_0x3c90('0x3')](_0x426091,_0x54545a);_0x2ecb71(null);};}for(var e in events){if(events[_0x3c90('0x4')](e)){var event=events[e];ChatInternalMessage[_0x3c90('0x5')](e,emitEvent(event));}}module[_0x3c90('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x2cde=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x4c627b,_0x497898){var _0x3a0a0d=function(_0x5912f4){while(--_0x5912f4){_0x4c627b['push'](_0x4c627b['shift']());}};_0x3a0a0d(++_0x497898);}(_0x2cde,0x1ed));var _0xe2cd=function(_0x23d743,_0x482154){_0x23d743=_0x23d743-0x0;var _0x3ffbb7=_0x2cde[_0x23d743];return _0x3ffbb7;};'use strict';var EventEmitter=require(_0xe2cd('0x0'));var ChatInternalMessage=require(_0xe2cd('0x1'))['db'][_0xe2cd('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe2cd('0x3')](0x0);var events={'afterCreate':_0xe2cd('0x4'),'afterUpdate':_0xe2cd('0x5'),'afterDestroy':_0xe2cd('0x6')};function emitEvent(_0x414a50){return function(_0x21475e,_0xae6ee3,_0x4ff5ce){ChatInternalMessageEvents[_0xe2cd('0x7')](_0x414a50+':'+_0x21475e['id'],_0x21475e);ChatInternalMessageEvents[_0xe2cd('0x7')](_0x414a50,_0x21475e);_0x4ff5ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xe2cd('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 4e50089..ea5682c 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.model.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe617=['define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x2af79a,_0x5c5d1a){var _0x8df446=function(_0x2138fd){while(--_0x2138fd){_0x2af79a['push'](_0x2af79a['shift']());}};_0x8df446(++_0x5c5d1a);}(_0xe617,0x1c6));var _0x7e61=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe617[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7e61('0x0'));var util=require(_0x7e61('0x1'));var logger=require(_0x7e61('0x2'))(_0x7e61('0x3'));var moment=require(_0x7e61('0x4'));var BPromise=require(_0x7e61('0x5'));var rp=require(_0x7e61('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e61('0x7'));var config=require(_0x7e61('0x8'));var attributes=require(_0x7e61('0x9'));module[_0x7e61('0xa')]=function(_0xb60742,_0x45110b){return _0xb60742[_0x7e61('0xb')](_0x7e61('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e61('0xd'),'collate':_0x7e61('0xe')});};
\ No newline at end of file
+var _0xf296=['moment','bluebird','path','rimraf','./chatInternalMessage.attributes','exports','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x5d31ee,_0x183e43){var _0x21c2e6=function(_0x176343){while(--_0x176343){_0x5d31ee['push'](_0x5d31ee['shift']());}};_0x21c2e6(++_0x183e43);}(_0xf296,0x172));var _0x6f29=function(_0x36610a,_0x5954f0){_0x36610a=_0x36610a-0x0;var _0x56e2ad=_0xf296[_0x36610a];return _0x56e2ad;};'use strict';var _=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var logger=require(_0x6f29('0x2'))(_0x6f29('0x3'));var moment=require(_0x6f29('0x4'));var BPromise=require(_0x6f29('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f29('0x6'));var rimraf=require(_0x6f29('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f29('0x8'));module[_0x6f29('0x9')]=function(_0x2d5c31,_0x36e65c){return _0x2d5c31['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f29('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index a24b662..24a6b5c 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3023=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x3023,0x1c4));var _0x3302=function(_0x347c13,_0x5c4c6f){_0x347c13=_0x347c13-0x0;var _0x2011a5=_0x3023[_0x347c13];return _0x2011a5;};'use strict';var _=require(_0x3302('0x0'));var util=require(_0x3302('0x1'));var moment=require('moment');var BPromise=require(_0x3302('0x2'));var rs=require(_0x3302('0x3'));var fs=require('fs');var Redis=require(_0x3302('0x4'));var db=require(_0x3302('0x5'))['db'];var utils=require(_0x3302('0x6'));var logger=require(_0x3302('0x7'))(_0x3302('0x8'));var config=require(_0x3302('0x9'));var jayson=require(_0x3302('0xa'));var client=jayson[_0x3302('0xb')][_0x3302('0xc')]({'port':0x232a});config['redis']=_[_0x3302('0xd')](config[_0x3302('0xe')],{'host':_0x3302('0xf'),'port':0x18eb});var socket=require(_0x3302('0x10'))(new Redis(config['redis']));require(_0x3302('0x11'))[_0x3302('0x12')](socket);function respondWithRpcPromise(_0x11acc0,_0x32340d,_0x350eba){return new BPromise(function(_0x4793bc,_0x4fcb4a){return client[_0x3302('0x13')](_0x11acc0,_0x350eba)['then'](function(_0x318a41){logger[_0x3302('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x32340d,_0x3302('0x15'));logger[_0x3302('0x16')](_0x3302('0x17'),_0x32340d,'request\x20sent',JSON['stringify'](_0x318a41));if(_0x318a41[_0x3302('0x18')]){if(_0x318a41[_0x3302('0x18')][_0x3302('0x19')]===0x1f4){logger[_0x3302('0x18')](_0x3302('0x1a'),_0x32340d,_0x318a41['error'][_0x3302('0x1b')]);return _0x4fcb4a(_0x318a41[_0x3302('0x18')]['message']);}logger[_0x3302('0x18')](_0x3302('0x1a'),_0x32340d,_0x318a41[_0x3302('0x18')][_0x3302('0x1b')]);return _0x4793bc(_0x318a41['error'][_0x3302('0x1b')]);}else{logger[_0x3302('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x32340d,_0x3302('0x15'));_0x4793bc(_0x318a41[_0x3302('0x1c')][_0x3302('0x1b')]);}})[_0x3302('0x1d')](function(_0x67560a){logger[_0x3302('0x18')](_0x3302('0x1a'),_0x32340d,_0x67560a);_0x4fcb4a(_0x67560a);});});}
\ No newline at end of file
+var _0xb4fe=['../../mysqldb','../../config/utils','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','util','moment','bluebird','randomstring'];(function(_0x4e05aa,_0x32f1d7){var _0x3f2eca=function(_0x4d4ea8){while(--_0x4d4ea8){_0x4e05aa['push'](_0x4e05aa['shift']());}};_0x3f2eca(++_0x32f1d7);}(_0xb4fe,0x122));var _0xeb4f=function(_0x52212f,_0x45e7fd){_0x52212f=_0x52212f-0x0;var _0x335c3f=_0xb4fe[_0x52212f];return _0x335c3f;};'use strict';var _=require('lodash');var util=require(_0xeb4f('0x0'));var moment=require(_0xeb4f('0x1'));var BPromise=require(_0xeb4f('0x2'));var rs=require(_0xeb4f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb4f('0x4'))['db'];var utils=require(_0xeb4f('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeb4f('0x6')][_0xeb4f('0x7')]({'port':0x232a});config[_0xeb4f('0x8')]=_['defaults'](config['redis'],{'host':_0xeb4f('0x9'),'port':0x18eb});var socket=require(_0xeb4f('0xa'))(new Redis(config[_0xeb4f('0x8')]));require(_0xeb4f('0xb'))[_0xeb4f('0xc')](socket);function respondWithRpcPromise(_0x56a344,_0x1c7ed2,_0x1cd1f0){return new BPromise(function(_0x13f9f4,_0x39f2e5){return client[_0xeb4f('0xd')](_0x56a344,_0x1cd1f0)[_0xeb4f('0xe')](function(_0x37a0bc){logger[_0xeb4f('0xf')](_0xeb4f('0x10'),_0x1c7ed2,_0xeb4f('0x11'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1c7ed2,_0xeb4f('0x11'),JSON[_0xeb4f('0x12')](_0x37a0bc));if(_0x37a0bc['error']){if(_0x37a0bc[_0xeb4f('0x13')]['code']===0x1f4){logger[_0xeb4f('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x1c7ed2,_0x37a0bc['error'][_0xeb4f('0x14')]);return _0x39f2e5(_0x37a0bc['error'][_0xeb4f('0x14')]);}logger[_0xeb4f('0x13')](_0xeb4f('0x10'),_0x1c7ed2,_0x37a0bc[_0xeb4f('0x13')][_0xeb4f('0x14')]);return _0x13f9f4(_0x37a0bc['error'][_0xeb4f('0x14')]);}else{logger[_0xeb4f('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x1c7ed2,'request\x20sent');_0x13f9f4(_0x37a0bc['result'][_0xeb4f('0x14')]);}})['catch'](function(_0x53ebfa){logger[_0xeb4f('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x1c7ed2,_0x53ebfa);_0x39f2e5(_0x53ebfa);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index b302a15..7067360 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.socket.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0506=['emit','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x469c01,_0x10c93c){var _0x534c6f=function(_0x7de94f){while(--_0x7de94f){_0x469c01['push'](_0x469c01['shift']());}};_0x534c6f(++_0x10c93c);}(_0x0506,0x1d1));var _0x6050=function(_0x10700e,_0x4c1777){_0x10700e=_0x10700e-0x0;var _0x317991=_0x0506[_0x10700e];return _0x317991;};'use strict';var ChatInternalMessageEvents=require(_0x6050('0x0'));var events=[_0x6050('0x1'),_0x6050('0x2'),'update'];function createListener(_0x52f82b,_0x5139c7){return function(_0x49a1ca){_0x5139c7[_0x6050('0x3')](_0x52f82b,_0x49a1ca);};}function removeListener(_0x58e2a9,_0x3cbb1f){return function(){ChatInternalMessageEvents['removeListener'](_0x58e2a9,_0x3cbb1f);};}exports['register']=function(_0xfd44cc){for(var _0x269be3=0x0,_0x2a3644=events[_0x6050('0x4')];_0x269be3<_0x2a3644;_0x269be3++){var _0x3512ba=events[_0x269be3];var _0xf64de5=createListener(_0x6050('0x5')+_0x3512ba,_0xfd44cc);ChatInternalMessageEvents['on'](_0x3512ba,_0xf64de5);}};
\ No newline at end of file
+var _0x5089=['length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','register'];(function(_0x45127d,_0x156e28){var _0x3b6bc5=function(_0x444369){while(--_0x444369){_0x45127d['push'](_0x45127d['shift']());}};_0x3b6bc5(++_0x156e28);}(_0x5089,0x1bb));var _0x9508=function(_0x405dc0,_0x5f2898){_0x405dc0=_0x405dc0-0x0;var _0x1ed46d=_0x5089[_0x405dc0];return _0x1ed46d;};'use strict';var ChatInternalMessageEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatInternalMessageEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatInternalMessageEvents['on'](_0x42d13a,_0x55a5de);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 78ba941..2fbdbaa 100644
--- a/server/api/chatInternalMessage/index.js
+++ b/server/api/chatInternalMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x42fbcd,_0x4b1bb0){var _0x1dc2b7=function(_0x43b072){while(--_0x43b072){_0x42fbcd['push'](_0x42fbcd['shift']());}};_0x1dc2b7(++_0x4b1bb0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xcb91[_0x576266];return _0x18234f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./chatInternalMessage.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/users',auth[_0x1cb9('0x7')](),controller['getUsers']);router['get'](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x7')](),controller['create']);router[_0x1cb9('0xd')](_0x1cb9('0xa'),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')](_0x1cb9('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x75df67,_0xdddf9a){var _0x3d053f=function(_0x2a2696){while(--_0x2a2696){_0x75df67['push'](_0x75df67['shift']());}};_0x3d053f(++_0xdddf9a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb7e7[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 37ca5ff..b196270 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xed03=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x51a81c,_0x52e60f){var _0x56827a=function(_0x1cf3d3){while(--_0x1cf3d3){_0x51a81c['push'](_0x51a81c['shift']());}};_0x56827a(++_0x52e60f);}(_0xed03,0xf0));var _0x3ed0=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xed03[_0x34021d];return _0x16597b;};'use strict';var Sequelize=require(_0x3ed0('0x0'));module[_0x3ed0('0x1')]={'body':{'type':Sequelize[_0x3ed0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3ed0('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3ed0('0x4')]('in',_0x3ed0('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3ed0('0x6')]}};
\ No newline at end of file
+var _0x0d02=['exports','TEXT','medium','BOOLEAN','out','DATE','sequelize'];(function(_0xdb876c,_0x31d68f){var _0x3db517=function(_0x53dbc7){while(--_0x53dbc7){_0xdb876c['push'](_0xdb876c['shift']());}};_0x3db517(++_0x31d68f);}(_0x0d02,0x1aa));var _0x20d0=function(_0x12f6e3,_0x3e2090){_0x12f6e3=_0x12f6e3-0x0;var _0x25d543=_0x0d02[_0x12f6e3];return _0x25d543;};'use strict';var Sequelize=require(_0x20d0('0x0'));module[_0x20d0('0x1')]={'body':{'type':Sequelize[_0x20d0('0x2')](_0x20d0('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x20d0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x20d0('0x5')),'defaultValue':_0x20d0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x20d0('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index d64d03a..fad458e 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6b26=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','catch','create','body','find','params','destroy','describe','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','ChatInteraction','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','parse','chat','ChatInteractionId','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x776414,_0x10d2de){var _0x7ec5f6=function(_0x33e112){while(--_0x33e112){_0x776414['push'](_0x776414['shift']());}};_0x7ec5f6(++_0x10d2de);}(_0x6b26,0x159));var _0x66b2=function(_0x799a35,_0xca4f88){_0x799a35=_0x799a35-0x0;var _0xf492a6=_0x6b26[_0x799a35];return _0xf492a6;};'use strict';var pdf=require(_0x66b2('0x0'));var emlformat=require(_0x66b2('0x1'));var rimraf=require(_0x66b2('0x2'));var zipdir=require(_0x66b2('0x3'));var jsonpatch=require(_0x66b2('0x4'));var rp=require(_0x66b2('0x5'));var moment=require(_0x66b2('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x66b2('0x7'));var sox=require(_0x66b2('0x8'));var csv=require(_0x66b2('0x9'));var ejs=require(_0x66b2('0xa'));var fs=require('fs');var _=require(_0x66b2('0xb'));var squel=require(_0x66b2('0xc'));var crypto=require(_0x66b2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x66b2('0x9'));var querystring=require(_0x66b2('0xe'));var Papa=require('papaparse');var Redis=require(_0x66b2('0xf'));var authService=require(_0x66b2('0x10'));var qs=require(_0x66b2('0x11'));var as=require(_0x66b2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x66b2('0x13'))('api');var utils=require(_0x66b2('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x66b2('0x15')]=_['defaults'](config['redis'],{'host':_0x66b2('0x16'),'port':0x18eb});var socket=require(_0x66b2('0x17'))(new Redis(config[_0x66b2('0x15')]));require(_0x66b2('0x18'))['register'](socket);var jayson=require(_0x66b2('0x19'));var client=jayson[_0x66b2('0x1a')][_0x66b2('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x66b2('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3af61c,_0x2b831f,_0x5b8739){if(_0x5b8739){var _0x28800d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28800d['test'](_0x2b831f)){return _0x3af61c;}else{throw new db[(_0x66b2('0x1c'))][(_0x66b2('0x1d'))](_0x66b2('0x1e'));}}else{return _0x3af61c;}}function respondWithRpcPromise(_0x45b954,_0x5662ff,_0x25a85a,_0xf9357f){return new BPromise(function(_0x41fde3,_0x536601){var _0x456a4d=_0xf9357f||client;return _0x456a4d[_0x66b2('0x1f')](_0x45b954,_0x25a85a)[_0x66b2('0x20')](function(_0x3add5c){logger['info'](_0x66b2('0x21'),_0x5662ff,'request\x20sent');logger[_0x66b2('0x22')](_0x66b2('0x23'),_0x5662ff,_0x66b2('0x24'),JSON[_0x66b2('0x25')](_0x3add5c));if(_0x3add5c[_0x66b2('0x26')]){if(_0x3add5c['error'][_0x66b2('0x27')]===0x1f4){logger['error'](_0x66b2('0x21'),_0x5662ff,_0x3add5c[_0x66b2('0x26')]['message']);return _0x536601(_0x3add5c[_0x66b2('0x26')][_0x66b2('0x28')]);}logger[_0x66b2('0x26')](_0x66b2('0x21'),_0x5662ff,_0x3add5c[_0x66b2('0x26')][_0x66b2('0x28')]);return _0x41fde3(_0x3add5c[_0x66b2('0x26')][_0x66b2('0x28')]);}else{logger[_0x66b2('0x29')]('ChatMessage,\x20%s,\x20%s',_0x5662ff,_0x66b2('0x24'));_0x41fde3(_0x3add5c[_0x66b2('0x2a')][_0x66b2('0x28')]);}})['catch'](function(_0x13b087){logger[_0x66b2('0x26')](_0x66b2('0x21'),_0x5662ff,_0x13b087);_0x536601(_0x13b087);});});}function respondWithStatusCode(_0x19ce40,_0x29401e){_0x29401e=_0x29401e||0xcc;return function(_0x1209c6){if(_0x1209c6){return _0x19ce40[_0x66b2('0x2b')](_0x29401e);}return _0x19ce40['status'](_0x29401e)[_0x66b2('0x2c')]();};}function respondWithResult(_0x37a1cc,_0x823a32){_0x823a32=_0x823a32||0xc8;return function(_0x5ae1d7){if(_0x5ae1d7){return _0x37a1cc[_0x66b2('0x2d')](_0x823a32)[_0x66b2('0x2e')](_0x5ae1d7);}};}function respondWithFilteredResult(_0x37a5f5,_0x30331c){return function(_0x550704){if(_0x550704){var _0x102ee3=_0x550704[_0x66b2('0x2f')],_0x1e5fa2=_0x30331c[_0x66b2('0x30')],_0x317b12=_0x30331c['offset']+_0x30331c[_0x66b2('0x31')],_0xbde730;if(_0x317b12>=_0x102ee3){_0x317b12=_0x102ee3;_0xbde730=0xc8;}else{_0xbde730=0xce;}_0x37a5f5[_0x66b2('0x2d')](_0xbde730);return _0x37a5f5[_0x66b2('0x32')](_0x66b2('0x33'),_0x1e5fa2+'-'+_0x317b12+'/'+_0x102ee3)[_0x66b2('0x2e')](_0x550704);}return null;};}function patchUpdates(_0x58bf2c){return function(_0x4fc79b){try{jsonpatch[_0x66b2('0x34')](_0x4fc79b,_0x58bf2c,!![]);}catch(_0x393973){return BPromise[_0x66b2('0x35')](_0x393973);}return _0x4fc79b[_0x66b2('0x36')]();};}function saveUpdates(_0x4c2f64,_0x3acccd){return function(_0x3eb213){if(_0x3eb213){return _0x3eb213[_0x66b2('0x37')](_0x4c2f64)[_0x66b2('0x20')](function(_0x2b1f77){return _0x2b1f77;});}return null;};}function removeEntity(_0x3330c0,_0x39d11f){return function(_0x556cbb){if(_0x556cbb){return _0x556cbb['destroy']()[_0x66b2('0x20')](function(){_0x3330c0[_0x66b2('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19286d,_0x1f977b){return function(_0x29afc5){if(!_0x29afc5){_0x19286d['sendStatus'](0x194);}return _0x29afc5;};}function handleError(_0x22b398,_0x68cfce){_0x68cfce=_0x68cfce||0x1f4;return function(_0xfde2ed){logger[_0x66b2('0x26')](_0xfde2ed['stack']);if(_0xfde2ed[_0x66b2('0x38')]){delete _0xfde2ed[_0x66b2('0x38')];}_0x22b398[_0x66b2('0x2d')](_0x68cfce)[_0x66b2('0x39')](_0xfde2ed);};}exports[_0x66b2('0x3a')]=function(_0x191d59,_0x1e397b){var _0x54e7cf={},_0x9b3171={},_0x2c0a1d={'count':0x0,'rows':[]};var _0x2afd1f=_[_0x66b2('0x3b')](db[_0x66b2('0x3c')][_0x66b2('0x3d')],function(_0x39b434){return{'name':_0x39b434[_0x66b2('0x3e')],'type':_0x39b434[_0x66b2('0x3f')][_0x66b2('0x40')]};});_0x9b3171['model']=_[_0x66b2('0x3b')](_0x2afd1f,_0x66b2('0x38'));_0x9b3171[_0x66b2('0x41')]=_[_0x66b2('0x42')](_0x191d59[_0x66b2('0x41')]);_0x9b3171[_0x66b2('0x43')]=_[_0x66b2('0x44')](_0x9b3171[_0x66b2('0x45')],_0x9b3171[_0x66b2('0x41')]);_0x54e7cf['attributes']=_[_0x66b2('0x44')](_0x9b3171['model'],qs[_0x66b2('0x46')](_0x191d59[_0x66b2('0x41')][_0x66b2('0x46')]));_0x54e7cf[_0x66b2('0x47')]=_0x54e7cf[_0x66b2('0x47')][_0x66b2('0x48')]?_0x54e7cf[_0x66b2('0x47')]:_0x9b3171[_0x66b2('0x45')];if(!_0x191d59['query'][_0x66b2('0x49')](_0x66b2('0x4a'))){_0x54e7cf[_0x66b2('0x31')]=qs[_0x66b2('0x31')](_0x191d59['query'][_0x66b2('0x31')]);_0x54e7cf[_0x66b2('0x30')]=qs[_0x66b2('0x30')](_0x191d59['query'][_0x66b2('0x30')]);}_0x54e7cf[_0x66b2('0x4b')]=qs[_0x66b2('0x4c')](_0x191d59['query']['sort']);_0x54e7cf[_0x66b2('0x4d')]=qs['filters'](_['pick'](_0x191d59[_0x66b2('0x41')],_0x9b3171[_0x66b2('0x43')]),_0x2afd1f);if(_0x191d59[_0x66b2('0x41')]['filter']){_0x54e7cf['where']=_[_0x66b2('0x4e')](_0x54e7cf['where'],{'$or':_[_0x66b2('0x3b')](_0x2afd1f,function(_0x6b3720){if(_0x6b3720[_0x66b2('0x3f')]!==_0x66b2('0x4f')){var _0x4259e9={};_0x4259e9[_0x6b3720[_0x66b2('0x38')]]={'$like':'%'+_0x191d59[_0x66b2('0x41')][_0x66b2('0x50')]+'%'};return _0x4259e9;}})});}_0x54e7cf=_[_0x66b2('0x4e')]({},_0x54e7cf,_0x191d59['options']);var _0x302340={'where':_0x54e7cf['where']};return db[_0x66b2('0x3c')][_0x66b2('0x2f')](_0x302340)[_0x66b2('0x20')](function(_0x5cc3d1){_0x2c0a1d[_0x66b2('0x2f')]=_0x5cc3d1;if(_0x191d59[_0x66b2('0x41')][_0x66b2('0x51')]){_0x54e7cf[_0x66b2('0x52')]=[{'all':!![]}];}return db['ChatMessage'][_0x66b2('0x53')](_0x54e7cf);})['then'](function(_0x558865){_0x2c0a1d[_0x66b2('0x54')]=_0x558865;return _0x2c0a1d;})[_0x66b2('0x20')](respondWithFilteredResult(_0x1e397b,_0x54e7cf))['catch'](handleError(_0x1e397b,null));};exports[_0x66b2('0x55')]=function(_0x4fb4ac,_0x500dee){var _0x10cfc9={'raw':!![],'where':{'id':_0x4fb4ac['params']['id']}},_0x32126f={};_0x32126f['model']=_[_0x66b2('0x42')](db['ChatMessage'][_0x66b2('0x3d')]);_0x32126f['query']=_[_0x66b2('0x42')](_0x4fb4ac['query']);_0x32126f[_0x66b2('0x43')]=_['intersection'](_0x32126f[_0x66b2('0x45')],_0x32126f[_0x66b2('0x41')]);_0x10cfc9[_0x66b2('0x47')]=_['intersection'](_0x32126f['model'],qs['fields'](_0x4fb4ac[_0x66b2('0x41')][_0x66b2('0x46')]));_0x10cfc9['attributes']=_0x10cfc9[_0x66b2('0x47')][_0x66b2('0x48')]?_0x10cfc9['attributes']:_0x32126f['model'];if(_0x4fb4ac['query'][_0x66b2('0x51')]){_0x10cfc9[_0x66b2('0x52')]=[{'all':!![]}];}_0x10cfc9=_[_0x66b2('0x4e')]({},_0x10cfc9,_0x4fb4ac['options']);return db[_0x66b2('0x3c')]['find'](_0x10cfc9)[_0x66b2('0x20')](handleEntityNotFound(_0x500dee,null))[_0x66b2('0x20')](respondWithResult(_0x500dee,null))[_0x66b2('0x56')](handleError(_0x500dee,null));};exports[_0x66b2('0x57')]=function(_0x2e62d3,_0x28ea6f){return db[_0x66b2('0x3c')][_0x66b2('0x57')](_0x2e62d3[_0x66b2('0x58')],{})['then'](respondWithResult(_0x28ea6f,0xc9))[_0x66b2('0x56')](handleError(_0x28ea6f,null));};exports[_0x66b2('0x37')]=function(_0x33a75c,_0x1c81dd){if(_0x33a75c[_0x66b2('0x58')]['id']){delete _0x33a75c[_0x66b2('0x58')]['id'];}return db['ChatMessage'][_0x66b2('0x59')]({'where':{'id':_0x33a75c[_0x66b2('0x5a')]['id']}})[_0x66b2('0x20')](handleEntityNotFound(_0x1c81dd,null))[_0x66b2('0x20')](saveUpdates(_0x33a75c[_0x66b2('0x58')],null))[_0x66b2('0x20')](respondWithResult(_0x1c81dd,null))['catch'](handleError(_0x1c81dd,null));};exports[_0x66b2('0x5b')]=function(_0x18d5cf,_0x46af25){return db[_0x66b2('0x3c')]['find']({'where':{'id':_0x18d5cf[_0x66b2('0x5a')]['id']}})[_0x66b2('0x20')](handleEntityNotFound(_0x46af25,null))['then'](removeEntity(_0x46af25,null))[_0x66b2('0x56')](handleError(_0x46af25,null));};exports['describe']=function(_0xb27cc4,_0x31d807){return db[_0x66b2('0x3c')][_0x66b2('0x5c')]()[_0x66b2('0x20')](respondWithResult(_0x31d807,null))['catch'](handleError(_0x31d807,null));};var interaction_log=require('../../config/logger')(_0x66b2('0x5d'));exports[_0x66b2('0x5e')]=function(_0x415521,_0x19e359,_0x4399bc){var _0x20a85b={'channel':'chat'};if(_0x415521[_0x66b2('0x58')]['id']){delete _0x415521[_0x66b2('0x58')]['id'];}_0x415521[_0x66b2('0x58')]['read']=!![];_0x415521[_0x66b2('0x58')][_0x66b2('0x5f')]=moment()['format'](_0x66b2('0x60'));_0x415521['body'][_0x66b2('0x61')]=_0x415521[_0x66b2('0x58')][_0x66b2('0x61')]||_0x415521['user']['id'];return db[_0x66b2('0x3c')][_0x66b2('0x59')]({'where':{'id':_0x415521[_0x66b2('0x5a')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x66b2('0x62')}]})[_0x66b2('0x20')](handleEntityNotFound(_0x19e359,null))[_0x66b2('0x20')](saveUpdates(_0x415521[_0x66b2('0x58')],null))[_0x66b2('0x20')](function(_0xb8c017){if(_0xb8c017){_0x20a85b[_0x66b2('0x28')]=_0xb8c017[_0x66b2('0x63')]({'plain':!![]});return db[_0x66b2('0x64')][_0x66b2('0x59')]({'where':{'id':_0xb8c017['ChatInteractionId']}});}return null;})[_0x66b2('0x20')](handleEntityNotFound(_0x19e359,null))[_0x66b2('0x20')](function(_0x4d0e36){if(_0x4d0e36){return _0x4d0e36['update']({'UserId':_0x415521[_0x66b2('0x58')]['UserId'],'read1stAt':_[_0x66b2('0x65')](_0x4d0e36[_0x66b2('0x66')])?moment()[_0x66b2('0x67')](_0x66b2('0x60')):undefined});}return null;})['then'](function(_0x277dc1){if(_0x277dc1){_0x20a85b[_0x66b2('0x68')]=_0x277dc1['get']({'plain':!![]});interaction_log[_0x66b2('0x29')](_0x66b2('0x69'),_0x415521[_0x66b2('0x6a')]['id'],_0x415521['user'][_0x66b2('0x38')],_0x415521[_0x66b2('0x6a')][_0x66b2('0x6b')],_0x20a85b[_0x66b2('0x68')]['id'],_0x415521[_0x66b2('0x58')]?JSON[_0x66b2('0x25')](_0x415521[_0x66b2('0x58')]):_0x66b2('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x66b2('0x6d'),_0x20a85b);}return null;})[_0x66b2('0x20')](function(_0x2d1928){if(_0x2d1928){if(_0x415521[_0x66b2('0x58')][_0x66b2('0x6e')]){_0x20a85b[_0x66b2('0x28')][_0x66b2('0x6f')]=util[_0x66b2('0x67')](_0x66b2('0x70'),_0x415521[_0x66b2('0x6a')][_0x66b2('0x38')]);_0x20a85b[_0x66b2('0x28')]['channel']=_0x20a85b[_0x66b2('0x71')];_0x20a85b['message']['event']=_0x66b2('0x5e');return respondWithRpcPromise(_0x66b2('0x72'),_0x66b2('0x72'),{'event':_0x66b2('0x73'),'message':_[_0x66b2('0x4e')](_0x20a85b['message'],JSON[_0x66b2('0x74')](_0x20a85b[_0x66b2('0x68')]['formData']))},client9002)[_0x66b2('0x20')](function(){return _0x20a85b;});}return _0x20a85b;}return null;})['then'](respondWithResult(_0x19e359,null))[_0x66b2('0x56')](handleError(_0x19e359,null));};var interaction_log=require(_0x66b2('0x13'))('chat-interactions');exports[_0x66b2('0x35')]=function(_0x53f86d,_0x3ae2b9,_0x5d380a){var _0x3c69b1={'agent':{},'channel':_0x66b2('0x75')};if(_0x53f86d['body']['id']){delete _0x53f86d[_0x66b2('0x58')]['id'];}_0x53f86d[_0x66b2('0x58')][_0x66b2('0x61')]=_0x53f86d['body'][_0x66b2('0x61')]||_0x53f86d[_0x66b2('0x6a')]['id'];_0x3c69b1['agent']['id']=_0x53f86d[_0x66b2('0x58')][_0x66b2('0x61')];return db[_0x66b2('0x3c')][_0x66b2('0x59')]({'where':{'id':_0x53f86d[_0x66b2('0x5a')]['id'],'UserId':null}})[_0x66b2('0x20')](handleEntityNotFound(_0x3ae2b9,null))[_0x66b2('0x20')](function(_0x41c6a7){if(_0x41c6a7){_0x3c69b1[_0x66b2('0x28')]=_0x41c6a7['get']({'plain':!![]});return db[_0x66b2('0x64')][_0x66b2('0x59')]({'where':{'id':_0x41c6a7[_0x66b2('0x76')]}});}return null;})['then'](handleEntityNotFound(_0x3ae2b9,null))[_0x66b2('0x20')](function(_0xf1027e){if(_0xf1027e){_0x3c69b1['interaction']=_0xf1027e[_0x66b2('0x63')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x53f86d[_0x66b2('0x6a')]['id'],_0x53f86d[_0x66b2('0x6a')][_0x66b2('0x38')],_0x53f86d[_0x66b2('0x6a')]['role'],_0x3c69b1[_0x66b2('0x68')]['id'],_0x53f86d['body']?JSON[_0x66b2('0x25')](_0x53f86d[_0x66b2('0x58')]):'null');return respondWithRpcPromise('RejectMessage',_0x66b2('0x77'),_0x3c69b1);}return null;})[_0x66b2('0x20')](function(_0x5f0672){if(_0x5f0672){_0x5f0672['message'][_0x66b2('0x6f')]=util['format'](_0x66b2('0x70'),_0x53f86d[_0x66b2('0x6a')][_0x66b2('0x38')]);_0x5f0672['message'][_0x66b2('0x71')]=_0x3c69b1[_0x66b2('0x71')];_0x5f0672['message']['event']=_0x66b2('0x35');respondWithRpcPromise('EventManager',_0x66b2('0x72'),{'event':_0x66b2('0x78'),'message':_0x5f0672[_0x66b2('0x28')]},client9002);return _0x3c69b1;}return null;})[_0x66b2('0x20')](respondWithResult(_0x3ae2b9,null))[_0x66b2('0x56')](handleError(_0x3ae2b9,null));};
\ No newline at end of file
+var _0x8e52=['Contact','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','manual','SIP/%s','acceptmessage','parse','formData','chat','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','interface','channel','event','EventManager','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','keys','length','find','create','body','describe','chat-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x8e52,0x98));var _0x28e5=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0x8e52[_0x17bb31];return _0x505c71;};'use strict';var pdf=require(_0x28e5('0x0'));var emlformat=require(_0x28e5('0x1'));var rimraf=require(_0x28e5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28e5('0x3'));var rp=require(_0x28e5('0x4'));var moment=require(_0x28e5('0x5'));var BPromise=require(_0x28e5('0x6'));var Mustache=require('mustache');var util=require(_0x28e5('0x7'));var path=require(_0x28e5('0x8'));var sox=require(_0x28e5('0x9'));var csv=require(_0x28e5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x28e5('0xb'));var jsforce=require(_0x28e5('0xc'));var deskjs=require(_0x28e5('0xd'));var toCsv=require(_0x28e5('0xa'));var querystring=require(_0x28e5('0xe'));var Papa=require(_0x28e5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x28e5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28e5('0x11'));var logger=require(_0x28e5('0x12'))(_0x28e5('0x13'));var utils=require(_0x28e5('0x14'));var config=require(_0x28e5('0x15'));var db=require('../../mysqldb')['db'];config[_0x28e5('0x16')]=_['defaults'](config[_0x28e5('0x16')],{'host':_0x28e5('0x17'),'port':0x18eb});var socket=require(_0x28e5('0x18'))(new Redis(config[_0x28e5('0x16')]));require(_0x28e5('0x19'))[_0x28e5('0x1a')](socket);var jayson=require(_0x28e5('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x9807f6,_0x45acd1,_0x2b08f5){if(_0x2b08f5){var _0x5c6718=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c6718[_0x28e5('0x1c')](_0x45acd1)){return _0x9807f6;}else{throw new db[(_0x28e5('0x1d'))][(_0x28e5('0x1e'))](_0x28e5('0x1f'));}}else{return _0x9807f6;}}function respondWithRpcPromise(_0x440558,_0x547892,_0x577ff7,_0x400d70){return new BPromise(function(_0x5f0995,_0x2556b0){var _0x5a9c68=_0x400d70||client;return _0x5a9c68[_0x28e5('0x20')](_0x440558,_0x577ff7)[_0x28e5('0x21')](function(_0x327e43){logger[_0x28e5('0x22')](_0x28e5('0x23'),_0x547892,_0x28e5('0x24'));logger[_0x28e5('0x25')](_0x28e5('0x26'),_0x547892,_0x28e5('0x24'),JSON[_0x28e5('0x27')](_0x327e43));if(_0x327e43[_0x28e5('0x28')]){if(_0x327e43[_0x28e5('0x28')][_0x28e5('0x29')]===0x1f4){logger[_0x28e5('0x28')](_0x28e5('0x23'),_0x547892,_0x327e43[_0x28e5('0x28')][_0x28e5('0x2a')]);return _0x2556b0(_0x327e43[_0x28e5('0x28')][_0x28e5('0x2a')]);}logger[_0x28e5('0x28')]('ChatMessage,\x20%s,\x20%s',_0x547892,_0x327e43[_0x28e5('0x28')]['message']);return _0x5f0995(_0x327e43[_0x28e5('0x28')][_0x28e5('0x2a')]);}else{logger['info'](_0x28e5('0x23'),_0x547892,'request\x20sent');_0x5f0995(_0x327e43[_0x28e5('0x2b')][_0x28e5('0x2a')]);}})[_0x28e5('0x2c')](function(_0x5bb516){logger['error']('ChatMessage,\x20%s,\x20%s',_0x547892,_0x5bb516);_0x2556b0(_0x5bb516);});});}function respondWithStatusCode(_0x49e5f7,_0x2e69f7){_0x2e69f7=_0x2e69f7||0xcc;return function(_0x3afe41){if(_0x3afe41){return _0x49e5f7[_0x28e5('0x2d')](_0x2e69f7);}return _0x49e5f7['status'](_0x2e69f7)[_0x28e5('0x2e')]();};}function respondWithResult(_0x40c479,_0x47b4c0){_0x47b4c0=_0x47b4c0||0xc8;return function(_0x2b236b){if(_0x2b236b){return _0x40c479[_0x28e5('0x2f')](_0x47b4c0)[_0x28e5('0x30')](_0x2b236b);}};}function respondWithFilteredResult(_0x1290c1,_0x19f651){return function(_0x1e644d){if(_0x1e644d){var _0x45b3ec=_0x1e644d[_0x28e5('0x31')],_0x381998=_0x19f651[_0x28e5('0x32')],_0x19f1a7=_0x19f651[_0x28e5('0x32')]+_0x19f651[_0x28e5('0x33')],_0x5d65a3;if(_0x19f1a7>=_0x45b3ec){_0x19f1a7=_0x45b3ec;_0x5d65a3=0xc8;}else{_0x5d65a3=0xce;}_0x1290c1[_0x28e5('0x2f')](_0x5d65a3);return _0x1290c1[_0x28e5('0x34')](_0x28e5('0x35'),_0x381998+'-'+_0x19f1a7+'/'+_0x45b3ec)['json'](_0x1e644d);}return null;};}function patchUpdates(_0x34b5e7){return function(_0x28169f){try{jsonpatch[_0x28e5('0x36')](_0x28169f,_0x34b5e7,!![]);}catch(_0x186d9a){return BPromise[_0x28e5('0x37')](_0x186d9a);}return _0x28169f[_0x28e5('0x38')]();};}function saveUpdates(_0x282945,_0x37cc17){return function(_0x406424){if(_0x406424){return _0x406424[_0x28e5('0x39')](_0x282945)[_0x28e5('0x21')](function(_0x57b15e){return _0x57b15e;});}return null;};}function removeEntity(_0x3a38e1,_0x4bd071){return function(_0x4cb8db){if(_0x4cb8db){return _0x4cb8db[_0x28e5('0x3a')]()['then'](function(){_0x3a38e1[_0x28e5('0x2f')](0xcc)[_0x28e5('0x2e')]();});}};}function handleEntityNotFound(_0x293604,_0xe6e77b){return function(_0x291a15){if(!_0x291a15){_0x293604[_0x28e5('0x2d')](0x194);}return _0x291a15;};}function handleError(_0x1da54c,_0x4ed249){_0x4ed249=_0x4ed249||0x1f4;return function(_0x2d2006){logger[_0x28e5('0x28')](_0x2d2006[_0x28e5('0x3b')]);if(_0x2d2006[_0x28e5('0x3c')]){delete _0x2d2006[_0x28e5('0x3c')];}_0x1da54c[_0x28e5('0x2f')](_0x4ed249)[_0x28e5('0x3d')](_0x2d2006);};}exports[_0x28e5('0x3e')]=function(_0x291a47,_0xd7ad14){var _0x4aa5a6={},_0x5744ae={},_0x5798f3={'count':0x0,'rows':[]};var _0x4c5200=_[_0x28e5('0x3f')](db[_0x28e5('0x40')][_0x28e5('0x41')],function(_0x44dbc8){return{'name':_0x44dbc8[_0x28e5('0x42')],'type':_0x44dbc8[_0x28e5('0x43')][_0x28e5('0x44')]};});_0x5744ae['model']=_[_0x28e5('0x3f')](_0x4c5200,_0x28e5('0x3c'));_0x5744ae[_0x28e5('0x45')]=_['keys'](_0x291a47[_0x28e5('0x45')]);_0x5744ae[_0x28e5('0x46')]=_['intersection'](_0x5744ae[_0x28e5('0x47')],_0x5744ae[_0x28e5('0x45')]);_0x4aa5a6[_0x28e5('0x48')]=_[_0x28e5('0x49')](_0x5744ae[_0x28e5('0x47')],qs[_0x28e5('0x4a')](_0x291a47[_0x28e5('0x45')][_0x28e5('0x4a')]));_0x4aa5a6['attributes']=_0x4aa5a6[_0x28e5('0x48')]['length']?_0x4aa5a6['attributes']:_0x5744ae[_0x28e5('0x47')];if(!_0x291a47[_0x28e5('0x45')][_0x28e5('0x4b')](_0x28e5('0x4c'))){_0x4aa5a6[_0x28e5('0x33')]=qs[_0x28e5('0x33')](_0x291a47[_0x28e5('0x45')][_0x28e5('0x33')]);_0x4aa5a6[_0x28e5('0x32')]=qs['offset'](_0x291a47[_0x28e5('0x45')]['offset']);}_0x4aa5a6[_0x28e5('0x4d')]=qs[_0x28e5('0x4e')](_0x291a47[_0x28e5('0x45')][_0x28e5('0x4e')]);_0x4aa5a6[_0x28e5('0x4f')]=qs['filters'](_[_0x28e5('0x50')](_0x291a47[_0x28e5('0x45')],_0x5744ae[_0x28e5('0x46')]),_0x4c5200);if(_0x291a47[_0x28e5('0x45')][_0x28e5('0x51')]){_0x4aa5a6[_0x28e5('0x4f')]=_['merge'](_0x4aa5a6[_0x28e5('0x4f')],{'$or':_['map'](_0x4c5200,function(_0x37c0fe){if(_0x37c0fe['type']!=='VIRTUAL'){var _0x1134e5={};_0x1134e5[_0x37c0fe['name']]={'$like':'%'+_0x291a47['query'][_0x28e5('0x51')]+'%'};return _0x1134e5;}})});}_0x4aa5a6=_[_0x28e5('0x52')]({},_0x4aa5a6,_0x291a47[_0x28e5('0x53')]);var _0x215737={'where':_0x4aa5a6[_0x28e5('0x4f')]};return db['ChatMessage'][_0x28e5('0x31')](_0x215737)[_0x28e5('0x21')](function(_0x1d4581){_0x5798f3['count']=_0x1d4581;if(_0x291a47[_0x28e5('0x45')][_0x28e5('0x54')]){_0x4aa5a6[_0x28e5('0x55')]=[{'all':!![]}];}return db[_0x28e5('0x40')][_0x28e5('0x56')](_0x4aa5a6);})[_0x28e5('0x21')](function(_0x359e78){_0x5798f3[_0x28e5('0x57')]=_0x359e78;return _0x5798f3;})[_0x28e5('0x21')](respondWithFilteredResult(_0xd7ad14,_0x4aa5a6))[_0x28e5('0x2c')](handleError(_0xd7ad14,null));};exports['show']=function(_0x341415,_0x1599e5){var _0x4e17af={'raw':!![],'where':{'id':_0x341415[_0x28e5('0x58')]['id']}},_0x5bef86={};_0x5bef86[_0x28e5('0x47')]=_[_0x28e5('0x59')](db['ChatMessage'][_0x28e5('0x41')]);_0x5bef86['query']=_[_0x28e5('0x59')](_0x341415[_0x28e5('0x45')]);_0x5bef86[_0x28e5('0x46')]=_[_0x28e5('0x49')](_0x5bef86[_0x28e5('0x47')],_0x5bef86[_0x28e5('0x45')]);_0x4e17af[_0x28e5('0x48')]=_[_0x28e5('0x49')](_0x5bef86[_0x28e5('0x47')],qs[_0x28e5('0x4a')](_0x341415['query'][_0x28e5('0x4a')]));_0x4e17af[_0x28e5('0x48')]=_0x4e17af[_0x28e5('0x48')][_0x28e5('0x5a')]?_0x4e17af['attributes']:_0x5bef86[_0x28e5('0x47')];if(_0x341415['query']['includeAll']){_0x4e17af[_0x28e5('0x55')]=[{'all':!![]}];}_0x4e17af=_['merge']({},_0x4e17af,_0x341415[_0x28e5('0x53')]);return db[_0x28e5('0x40')][_0x28e5('0x5b')](_0x4e17af)[_0x28e5('0x21')](handleEntityNotFound(_0x1599e5,null))[_0x28e5('0x21')](respondWithResult(_0x1599e5,null))[_0x28e5('0x2c')](handleError(_0x1599e5,null));};exports[_0x28e5('0x5c')]=function(_0x159f5d,_0x36f308){return db[_0x28e5('0x40')][_0x28e5('0x5c')](_0x159f5d[_0x28e5('0x5d')],{})[_0x28e5('0x21')](respondWithResult(_0x36f308,0xc9))[_0x28e5('0x2c')](handleError(_0x36f308,null));};exports[_0x28e5('0x39')]=function(_0x1c73f3,_0x1451b2){if(_0x1c73f3[_0x28e5('0x5d')]['id']){delete _0x1c73f3['body']['id'];}return db['ChatMessage'][_0x28e5('0x5b')]({'where':{'id':_0x1c73f3[_0x28e5('0x58')]['id']}})[_0x28e5('0x21')](handleEntityNotFound(_0x1451b2,null))['then'](saveUpdates(_0x1c73f3['body'],null))[_0x28e5('0x21')](respondWithResult(_0x1451b2,null))['catch'](handleError(_0x1451b2,null));};exports[_0x28e5('0x3a')]=function(_0x2f2af2,_0x3e017b){return db[_0x28e5('0x40')][_0x28e5('0x5b')]({'where':{'id':_0x2f2af2[_0x28e5('0x58')]['id']}})[_0x28e5('0x21')](handleEntityNotFound(_0x3e017b,null))['then'](removeEntity(_0x3e017b,null))[_0x28e5('0x2c')](handleError(_0x3e017b,null));};exports[_0x28e5('0x5e')]=function(_0xd1447c,_0x2c221c){return db['ChatMessage']['describe']()[_0x28e5('0x21')](respondWithResult(_0x2c221c,null))['catch'](handleError(_0x2c221c,null));};var interaction_log=require(_0x28e5('0x12'))(_0x28e5('0x5f'));exports[_0x28e5('0x60')]=function(_0x45d206,_0x43dbe3,_0x565248){var _0xfcf13d={'channel':'chat'};if(_0x45d206[_0x28e5('0x5d')]['id']){delete _0x45d206[_0x28e5('0x5d')]['id'];}_0x45d206[_0x28e5('0x5d')][_0x28e5('0x61')]=!![];_0x45d206[_0x28e5('0x5d')]['readAt']=moment()[_0x28e5('0x62')](_0x28e5('0x63'));_0x45d206[_0x28e5('0x5d')][_0x28e5('0x64')]=_0x45d206['body'][_0x28e5('0x64')]||_0x45d206['user']['id'];return db[_0x28e5('0x40')][_0x28e5('0x5b')]({'where':{'id':_0x45d206[_0x28e5('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x28e5('0x65')],'as':_0x28e5('0x66')}]})['then'](handleEntityNotFound(_0x43dbe3,null))[_0x28e5('0x21')](saveUpdates(_0x45d206['body'],null))[_0x28e5('0x21')](function(_0x4113af){if(_0x4113af){_0xfcf13d[_0x28e5('0x2a')]=_0x4113af[_0x28e5('0x67')]({'plain':!![]});return db[_0x28e5('0x68')]['find']({'where':{'id':_0x4113af['ChatInteractionId']}});}return null;})[_0x28e5('0x21')](handleEntityNotFound(_0x43dbe3,null))[_0x28e5('0x21')](function(_0x5c8892){if(_0x5c8892){return _0x5c8892[_0x28e5('0x39')]({'UserId':_0x45d206[_0x28e5('0x5d')][_0x28e5('0x64')],'read1stAt':_[_0x28e5('0x69')](_0x5c8892[_0x28e5('0x6a')])?moment()[_0x28e5('0x62')](_0x28e5('0x63')):undefined});}return null;})[_0x28e5('0x21')](function(_0x415535){if(_0x415535){_0xfcf13d[_0x28e5('0x6b')]=_0x415535[_0x28e5('0x67')]({'plain':!![]});interaction_log[_0x28e5('0x22')](_0x28e5('0x6c'),_0x45d206[_0x28e5('0x6d')]['id'],_0x45d206[_0x28e5('0x6d')][_0x28e5('0x3c')],_0x45d206['user']['role'],_0xfcf13d[_0x28e5('0x6b')]['id'],_0x45d206[_0x28e5('0x5d')]?JSON[_0x28e5('0x27')](_0x45d206[_0x28e5('0x5d')]):_0x28e5('0x6e'));return respondWithRpcPromise(_0x28e5('0x6f'),_0x28e5('0x70'),_0xfcf13d);}return null;})[_0x28e5('0x21')](function(_0xc1681f){if(_0xc1681f){if(_0x45d206[_0x28e5('0x5d')][_0x28e5('0x71')]){_0xfcf13d[_0x28e5('0x2a')]['interface']=util[_0x28e5('0x62')](_0x28e5('0x72'),_0x45d206[_0x28e5('0x6d')][_0x28e5('0x3c')]);_0xfcf13d[_0x28e5('0x2a')]['channel']=_0xfcf13d['channel'];_0xfcf13d[_0x28e5('0x2a')]['event']=_0x28e5('0x60');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x28e5('0x73'),'message':_['merge'](_0xfcf13d[_0x28e5('0x2a')],JSON[_0x28e5('0x74')](_0xfcf13d[_0x28e5('0x6b')][_0x28e5('0x75')]))},client9002)[_0x28e5('0x21')](function(){return _0xfcf13d;});}return _0xfcf13d;}return null;})['then'](respondWithResult(_0x43dbe3,null))['catch'](handleError(_0x43dbe3,null));};var interaction_log=require('../../config/logger')(_0x28e5('0x5f'));exports[_0x28e5('0x37')]=function(_0x2dcb6f,_0x113fd0,_0x86f15b){var _0xf6b6ce={'agent':{},'channel':_0x28e5('0x76')};if(_0x2dcb6f['body']['id']){delete _0x2dcb6f[_0x28e5('0x5d')]['id'];}_0x2dcb6f['body'][_0x28e5('0x64')]=_0x2dcb6f[_0x28e5('0x5d')][_0x28e5('0x64')]||_0x2dcb6f[_0x28e5('0x6d')]['id'];_0xf6b6ce[_0x28e5('0x77')]['id']=_0x2dcb6f[_0x28e5('0x5d')][_0x28e5('0x64')];return db[_0x28e5('0x40')]['find']({'where':{'id':_0x2dcb6f[_0x28e5('0x58')]['id'],'UserId':null}})[_0x28e5('0x21')](handleEntityNotFound(_0x113fd0,null))[_0x28e5('0x21')](function(_0x58e0a3){if(_0x58e0a3){_0xf6b6ce['message']=_0x58e0a3[_0x28e5('0x67')]({'plain':!![]});return db[_0x28e5('0x68')][_0x28e5('0x5b')]({'where':{'id':_0x58e0a3['ChatInteractionId']}});}return null;})[_0x28e5('0x21')](handleEntityNotFound(_0x113fd0,null))[_0x28e5('0x21')](function(_0x1f432a){if(_0x1f432a){_0xf6b6ce[_0x28e5('0x6b')]=_0x1f432a[_0x28e5('0x67')]({'plain':!![]});interaction_log[_0x28e5('0x22')](_0x28e5('0x78'),_0x2dcb6f[_0x28e5('0x6d')]['id'],_0x2dcb6f[_0x28e5('0x6d')]['name'],_0x2dcb6f[_0x28e5('0x6d')][_0x28e5('0x79')],_0xf6b6ce[_0x28e5('0x6b')]['id'],_0x2dcb6f[_0x28e5('0x5d')]?JSON[_0x28e5('0x27')](_0x2dcb6f['body']):'null');return respondWithRpcPromise('RejectMessage',_0x28e5('0x7a'),_0xf6b6ce);}return null;})[_0x28e5('0x21')](function(_0x59a20f){if(_0x59a20f){_0x59a20f[_0x28e5('0x2a')][_0x28e5('0x7b')]=util[_0x28e5('0x62')](_0x28e5('0x72'),_0x2dcb6f[_0x28e5('0x6d')][_0x28e5('0x3c')]);_0x59a20f[_0x28e5('0x2a')][_0x28e5('0x7c')]=_0xf6b6ce[_0x28e5('0x7c')];_0x59a20f[_0x28e5('0x2a')][_0x28e5('0x7d')]='reject';respondWithRpcPromise(_0x28e5('0x7e'),_0x28e5('0x7e'),{'event':'rejectmessage','message':_0x59a20f['message']},client9002);return _0xf6b6ce;}return null;})[_0x28e5('0x21')](respondWithResult(_0x113fd0,null))[_0x28e5('0x2c')](handleError(_0x113fd0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 6232d76..422cffd 100644
--- a/server/api/chatMessage/chatMessage.events.js
+++ b/server/api/chatMessage/chatMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd07=['../../mysqldb','ChatMessage','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x55a984,_0x385c27){var _0x1b40ca=function(_0x4a87e0){while(--_0x4a87e0){_0x55a984['push'](_0x55a984['shift']());}};_0x1b40ca(++_0x385c27);}(_0xdd07,0x194));var _0x7dd0=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xdd07[_0x11ce46];return _0x368a1e;};'use strict';var EventEmitter=require(_0x7dd0('0x0'));var ChatMessage=require(_0x7dd0('0x1'))['db'][_0x7dd0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7dd0('0x3'),'afterUpdate':'update','afterDestroy':_0x7dd0('0x4')};function emitEvent(_0x1ed937){return function(_0x4450da,_0x39b2a6,_0x34ee2d){ChatMessageEvents[_0x7dd0('0x5')](_0x1ed937+':'+_0x4450da['id'],_0x4450da);ChatMessageEvents[_0x7dd0('0x5')](_0x1ed937,_0x4450da);_0x34ee2d(null);};}for(var e in events){if(events[_0x7dd0('0x6')](e)){var event=events[e];ChatMessage[_0x7dd0('0x7')](e,emitEvent(event));}}module[_0x7dd0('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x3ad4=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4767a2,_0x322e92){var _0x2d3d28=function(_0x156f22){while(--_0x156f22){_0x4767a2['push'](_0x4767a2['shift']());}};_0x2d3d28(++_0x322e92);}(_0x3ad4,0x1c4));var _0x43ad=function(_0x51ec85,_0x46832c){_0x51ec85=_0x51ec85-0x0;var _0x59f6e8=_0x3ad4[_0x51ec85];return _0x59f6e8;};'use strict';var EventEmitter=require(_0x43ad('0x0'));var ChatMessage=require(_0x43ad('0x1'))['db'][_0x43ad('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x43ad('0x3')](0x0);var events={'afterCreate':_0x43ad('0x4'),'afterUpdate':_0x43ad('0x5'),'afterDestroy':_0x43ad('0x6')};function emitEvent(_0x183b17){return function(_0x2584b2,_0x2879e0,_0x2af6ae){ChatMessageEvents[_0x43ad('0x7')](_0x183b17+':'+_0x2584b2['id'],_0x2584b2);ChatMessageEvents[_0x43ad('0x7')](_0x183b17,_0x2584b2);_0x2af6ae(null);};}for(var e in events){if(events[_0x43ad('0x8')](e)){var event=events[e];ChatMessage[_0x43ad('0x9')](e,emitEvent(event));}}module[_0x43ad('0xa')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 44199b4..2eff45c 100644
--- a/server/api/chatMessage/chatMessage.model.js
+++ b/server/api/chatMessage/chatMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x40c6=['utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','error','utf8mb4'];(function(_0x2cffb9,_0x349d16){var _0x35eb4f=function(_0x5daa96){while(--_0x5daa96){_0x2cffb9['push'](_0x2cffb9['shift']());}};_0x35eb4f(++_0x349d16);}(_0x40c6,0x135));var _0x640c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x40c6[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x640c('0x0'))(_0x640c('0x1'));var moment=require(_0x640c('0x2'));var BPromise=require('bluebird');var rp=require(_0x640c('0x3'));var fs=require('fs');var path=require(_0x640c('0x4'));var rimraf=require(_0x640c('0x5'));var config=require(_0x640c('0x6'));var attributes=require(_0x640c('0x7'));module[_0x640c('0x8')]=function(_0x1cff57,_0x4d1e87){return _0x1cff57['define'](_0x640c('0x9'),attributes,{'tableName':_0x640c('0xa'),'paranoid':![],'indexes':[{'name':_0x640c('0xb'),'fields':[_0x640c('0xc')],'type':_0x640c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f70a8,_0x1689da,_0x5a7584){var _0x652dc8=_0x1cff57[_0x640c('0xe')];var _0x5eee37=_0x2f70a8[_0x640c('0xf')]({'plain':!![]});if(_0x5eee37[_0x640c('0x10')][_0x640c('0x11')]()==='in'||_0x5eee37['direction'][_0x640c('0x11')]()==='out'&&!_0x5eee37[_0x640c('0x12')]&&!_['isNil'](_0x5eee37[_0x640c('0x13')])){_0x652dc8[_0x640c('0x14')][_0x640c('0x15')]({'where':{'id':_0x5eee37[_0x640c('0x16')]}})[_0x640c('0x17')](function(_0x2963d8){if(_0x2963d8){_0x2963d8['update']({'lastMsgAt':_0x5eee37[_0x640c('0x18')],'lastMsgDirection':_0x5eee37['direction'][_0x640c('0x11')]()});}})['catch'](function(_0x3146d8){console[_0x640c('0x19')](_0x3146d8);});}_0x5a7584();}},'charset':_0x640c('0x1a'),'collate':_0x640c('0x1b')});};
\ No newline at end of file
+var _0x2f51=['models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','../../config/environment','exports','ChatMessage','fti_chat_messages','body','FULLTEXT'];(function(_0x4595c7,_0x1dfd25){var _0x506697=function(_0x1c8196){while(--_0x1c8196){_0x4595c7['push'](_0x4595c7['shift']());}};_0x506697(++_0x1dfd25);}(_0x2f51,0xe7));var _0x12f5=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x2f51[_0x810e4d];return _0x13f01c;};'use strict';var _=require(_0x12f5('0x0'));var util=require(_0x12f5('0x1'));var logger=require(_0x12f5('0x2'))(_0x12f5('0x3'));var moment=require(_0x12f5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x12f5('0x5'));var rimraf=require('rimraf');var config=require(_0x12f5('0x6'));var attributes=require('./chatMessage.attributes');module[_0x12f5('0x7')]=function(_0x11d65b,_0x15b6eb){return _0x11d65b['define'](_0x12f5('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x12f5('0x9'),'fields':[_0x12f5('0xa')],'type':_0x12f5('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xed3923,_0x3f00a6,_0x305f28){var _0x3196a2=_0x11d65b[_0x12f5('0xc')];var _0x2987fb=_0xed3923[_0x12f5('0xd')]({'plain':!![]});if(_0x2987fb[_0x12f5('0xe')][_0x12f5('0xf')]()==='in'||_0x2987fb['direction'][_0x12f5('0xf')]()==='out'&&!_0x2987fb[_0x12f5('0x10')]&&!_[_0x12f5('0x11')](_0x2987fb[_0x12f5('0x12')])){_0x3196a2[_0x12f5('0x13')][_0x12f5('0x14')]({'where':{'id':_0x2987fb[_0x12f5('0x15')]}})['then'](function(_0x32f11a){if(_0x32f11a){_0x32f11a['update']({'lastMsgAt':_0x2987fb[_0x12f5('0x16')],'lastMsgDirection':_0x2987fb[_0x12f5('0xe')]['toLowerCase']()});}})[_0x12f5('0x17')](function(_0x4d21a9){console[_0x12f5('0x18')](_0x4d21a9);});}_0x305f28();}},'charset':_0x12f5('0x19'),'collate':_0x12f5('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 4f10e4d..4be50bc 100644
--- a/server/api/chatMessage/chatMessage.rpc.js
+++ b/server/api/chatMessage/chatMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x606c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','raw'];(function(_0x5954e2,_0x10ff8b){var _0x11542f=function(_0x10336f){while(--_0x10336f){_0x5954e2['push'](_0x5954e2['shift']());}};_0x11542f(++_0x10ff8b);}(_0x606c,0x1e1));var _0xc606=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x606c[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0xc606('0x0'));var util=require(_0xc606('0x1'));var moment=require(_0xc606('0x2'));var BPromise=require(_0xc606('0x3'));var rs=require(_0xc606('0x4'));var fs=require('fs');var Redis=require(_0xc606('0x5'));var db=require(_0xc606('0x6'))['db'];var utils=require(_0xc606('0x7'));var logger=require(_0xc606('0x8'))(_0xc606('0x9'));var config=require(_0xc606('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc606('0xb')][_0xc606('0xc')]({'port':0x232a});config[_0xc606('0xd')]=_[_0xc606('0xe')](config[_0xc606('0xd')],{'host':_0xc606('0xf'),'port':0x18eb});var socket=require(_0xc606('0x10'))(new Redis(config[_0xc606('0xd')]));require(_0xc606('0x11'))[_0xc606('0x12')](socket);function respondWithRpcPromise(_0x3039b6,_0x42d325,_0x52c359){return new BPromise(function(_0x1be31c,_0x512135){return client[_0xc606('0x13')](_0x3039b6,_0x52c359)[_0xc606('0x14')](function(_0x53c101){logger[_0xc606('0x15')](_0xc606('0x16'),_0x42d325,_0xc606('0x17'));logger[_0xc606('0x18')](_0xc606('0x19'),_0x42d325,_0xc606('0x17'),JSON[_0xc606('0x1a')](_0x53c101));if(_0x53c101[_0xc606('0x1b')]){if(_0x53c101[_0xc606('0x1b')][_0xc606('0x1c')]===0x1f4){logger['error'](_0xc606('0x16'),_0x42d325,_0x53c101[_0xc606('0x1b')][_0xc606('0x1d')]);return _0x512135(_0x53c101[_0xc606('0x1b')][_0xc606('0x1d')]);}logger['error'](_0xc606('0x16'),_0x42d325,_0x53c101['error'][_0xc606('0x1d')]);return _0x1be31c(_0x53c101[_0xc606('0x1b')]['message']);}else{logger[_0xc606('0x15')]('ChatMessage,\x20%s,\x20%s',_0x42d325,'request\x20sent');_0x1be31c(_0x53c101[_0xc606('0x1e')][_0xc606('0x1d')]);}})[_0xc606('0x1f')](function(_0x1ef2e2){logger[_0xc606('0x1b')](_0xc606('0x16'),_0x42d325,_0x1ef2e2);_0x512135(_0x1ef2e2);});});}exports[_0xc606('0x20')]=function(_0x267592){var _0x47adff=this;return new Promise(function(_0x4accaf,_0x1b824e){return db[_0xc606('0x21')][_0xc606('0x22')](_0x267592[_0xc606('0x23')],{'raw':_0x267592['options']?_0x267592['options'][_0xc606('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x5269a3){logger[_0xc606('0x15')]('CreateChatMessage',_0x267592);logger[_0xc606('0x18')](_0xc606('0x20'),_0x267592,JSON[_0xc606('0x1a')](_0x5269a3));_0x4accaf(_0x5269a3);})[_0xc606('0x1f')](function(_0x3e0fe5){logger[_0xc606('0x1b')](_0xc606('0x20'),_0x3e0fe5[_0xc606('0x1d')],_0x267592);_0x1b824e(_0x47adff['error'](0x1f4,_0x3e0fe5[_0xc606('0x1d')]));});});};
\ No newline at end of file
+var _0x386a=['request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','bluebird','ioredis','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','info'];(function(_0x417dfe,_0x1dd567){var _0x81da6e=function(_0x378cb3){while(--_0x378cb3){_0x417dfe['push'](_0x417dfe['shift']());}};_0x81da6e(++_0x1dd567);}(_0x386a,0x1f0));var _0xa386=function(_0x47800b,_0x4dd58d){_0x47800b=_0x47800b-0x0;var _0x219d3d=_0x386a[_0x47800b];return _0x219d3d;};'use strict';var _=require(_0xa386('0x0'));var util=require(_0xa386('0x1'));var moment=require('moment');var BPromise=require(_0xa386('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa386('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa386('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa386('0x5')][_0xa386('0x6')]({'port':0x232a});config[_0xa386('0x7')]=_[_0xa386('0x8')](config[_0xa386('0x7')],{'host':_0xa386('0x9'),'port':0x18eb});var socket=require(_0xa386('0xa'))(new Redis(config[_0xa386('0x7')]));require(_0xa386('0xb'))['register'](socket);function respondWithRpcPromise(_0x156e03,_0x1a778c,_0x22e28e){return new BPromise(function(_0x1848c6,_0x2daba6){return client[_0xa386('0xc')](_0x156e03,_0x22e28e)['then'](function(_0x5ce3e9){logger[_0xa386('0xd')]('ChatMessage,\x20%s,\x20%s',_0x1a778c,_0xa386('0xe'));logger[_0xa386('0xf')](_0xa386('0x10'),_0x1a778c,_0xa386('0xe'),JSON[_0xa386('0x11')](_0x5ce3e9));if(_0x5ce3e9[_0xa386('0x12')]){if(_0x5ce3e9[_0xa386('0x12')][_0xa386('0x13')]===0x1f4){logger[_0xa386('0x12')](_0xa386('0x14'),_0x1a778c,_0x5ce3e9[_0xa386('0x12')]['message']);return _0x2daba6(_0x5ce3e9[_0xa386('0x12')][_0xa386('0x15')]);}logger[_0xa386('0x12')]('ChatMessage,\x20%s,\x20%s',_0x1a778c,_0x5ce3e9['error']['message']);return _0x1848c6(_0x5ce3e9[_0xa386('0x12')][_0xa386('0x15')]);}else{logger[_0xa386('0xd')](_0xa386('0x14'),_0x1a778c,'request\x20sent');_0x1848c6(_0x5ce3e9[_0xa386('0x16')][_0xa386('0x15')]);}})[_0xa386('0x17')](function(_0xe00062){logger[_0xa386('0x12')](_0xa386('0x14'),_0x1a778c,_0xe00062);_0x2daba6(_0xe00062);});});}exports['CreateChatMessage']=function(_0x137a91){var _0x293b43=this;return new Promise(function(_0x3ec2ea,_0x4dc50c){return db[_0xa386('0x18')][_0xa386('0x19')](_0x137a91[_0xa386('0x1a')],{'raw':_0x137a91[_0xa386('0x1b')]?_0x137a91[_0xa386('0x1b')][_0xa386('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x228ede){logger[_0xa386('0xd')](_0xa386('0x1d'),_0x137a91);logger[_0xa386('0xf')]('CreateChatMessage',_0x137a91,JSON[_0xa386('0x11')](_0x228ede));_0x3ec2ea(_0x228ede);})['catch'](function(_0x491490){logger[_0xa386('0x12')](_0xa386('0x1d'),_0x491490[_0xa386('0x15')],_0x137a91);_0x4dc50c(_0x293b43[_0xa386('0x12')](0x1f4,_0x491490['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 3573ab2..4b1f549 100644
--- a/server/api/chatMessage/chatMessage.socket.js
+++ b/server/api/chatMessage/chatMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['save','remove','update','emit','removeListener','chatMessage:'];(function(_0x44fca,_0x18cff9){var _0x14c352=function(_0x551d5d){while(--_0x551d5d){_0x44fca['push'](_0x44fca['shift']());}};_0x14c352(++_0x18cff9);}(_0x1261,0x144));var _0x1126=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0x1261[_0x154940];return _0x401409;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){ChatMessageEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);ChatMessageEvents['on'](_0x17e5f0,_0x28772d);}};
\ No newline at end of file
+var _0x53ec=['length','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0x144633,_0x40b131){var _0x1c6cd7=function(_0x554746){while(--_0x554746){_0x144633['push'](_0x144633['shift']());}};_0x1c6cd7(++_0x40b131);}(_0x53ec,0x192));var _0xc53e=function(_0x34533,_0x531aeb){_0x34533=_0x34533-0x0;var _0x5810ff=_0x53ec[_0x34533];return _0x5810ff;};'use strict';var ChatMessageEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){ChatMessageEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);ChatMessageEvents['on'](_0x5d3b28,_0x1616ac);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 72766f9..0d8caed 100644
--- a/server/api/chatMessage/index.js
+++ b/server/api/chatMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b54=['chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','tracked'];(function(_0x3ff091,_0x2b0f1c){var _0x141fd7=function(_0x4f8554){while(--_0x4f8554){_0x3ff091['push'](_0x3ff091['shift']());}};_0x141fd7(++_0x2b0f1c);}(_0x9b54,0x19b));var _0x49b5=function(_0x18f898,_0x448fc3){_0x18f898=_0x18f898-0x0;var _0x4ca3c0=_0x9b54[_0x18f898];return _0x4ca3c0;};'use strict';var multer=require(_0x49b5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x49b5('0x1'));var router=express[_0x49b5('0x2')]();var auth=require(_0x49b5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x49b5('0x4'));var controller=require(_0x49b5('0x5'));router['get']('/',auth[_0x49b5('0x6')](),controller[_0x49b5('0x7')]);router[_0x49b5('0x8')](_0x49b5('0x9'),auth[_0x49b5('0x6')](),controller[_0x49b5('0xa')]);router[_0x49b5('0x8')]('/:id',auth[_0x49b5('0x6')](),controller[_0x49b5('0xb')]);router[_0x49b5('0xc')]('/',auth[_0x49b5('0x6')](),interaction[_0x49b5('0xd')](_0x49b5('0xe'),_0x49b5('0xf')),controller[_0x49b5('0x10')]);router['put']('/:id',controller[_0x49b5('0x11')]);router[_0x49b5('0x12')](_0x49b5('0x13'),auth[_0x49b5('0x6')](),controller[_0x49b5('0x14')]);router[_0x49b5('0x12')](_0x49b5('0x15'),auth[_0x49b5('0x6')](),controller[_0x49b5('0x16')]);router[_0x49b5('0x17')]('/:id',auth[_0x49b5('0x6')](),controller[_0x49b5('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x66c9=['isAuthenticated','index','get','describe','/:id','show','post','chatmessage:create','create','put','update','/:id/accept','accept','reject','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x10efea,_0x1c39f8){var _0x3f362d=function(_0x10b8f3){while(--_0x10b8f3){_0x10efea['push'](_0x10efea['shift']());}};_0x3f362d(++_0x1c39f8);}(_0x66c9,0x1dd));var _0x966c=function(_0x136c44,_0x2fc9da){_0x136c44=_0x136c44-0x0;var _0x5c82c=_0x66c9[_0x136c44];return _0x5c82c;};'use strict';var multer=require(_0x966c('0x0'));var util=require(_0x966c('0x1'));var path=require(_0x966c('0x2'));var timeout=require(_0x966c('0x3'));var express=require(_0x966c('0x4'));var router=express[_0x966c('0x5')]();var auth=require(_0x966c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatMessage.controller');router['get']('/',auth[_0x966c('0x7')](),controller[_0x966c('0x8')]);router[_0x966c('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x966c('0xa')]);router['get'](_0x966c('0xb'),auth[_0x966c('0x7')](),controller[_0x966c('0xc')]);router[_0x966c('0xd')]('/',auth[_0x966c('0x7')](),interaction['tracked']('chat',_0x966c('0xe')),controller[_0x966c('0xf')]);router[_0x966c('0x10')](_0x966c('0xb'),controller[_0x966c('0x11')]);router[_0x966c('0x10')](_0x966c('0x12'),auth[_0x966c('0x7')](),controller[_0x966c('0x13')]);router[_0x966c('0x10')]('/:id/reject',auth['isAuthenticated'](),controller[_0x966c('0x14')]);router['delete'](_0x966c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x966c('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index ef25353..defa6ba 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f67=['medium','sequelize','TEXT'];(function(_0x2b1012,_0x40dd79){var _0xf064b5=function(_0x20917a){while(--_0x20917a){_0x2b1012['push'](_0x2b1012['shift']());}};_0xf064b5(++_0x40dd79);}(_0x3f67,0x115));var _0x73f6=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0x3f67[_0x1d30a3];return _0x32bba1;};'use strict';var Sequelize=require(_0x73f6('0x0'));module['exports']={'body':{'type':Sequelize[_0x73f6('0x1')](_0x73f6('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xb71a=['TEXT','medium','exports'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0xb71a,0x8c));var _0xab71=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0xb71a[_0x3c6ae2];return _0x4edda;};'use strict';var Sequelize=require('sequelize');module[_0xab71('0x0')]={'body':{'type':Sequelize[_0xab71('0x1')](_0xab71('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index ca5bec5..fbb8d4e 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf072=['order','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','catch','show','create','body','update','find','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','destroy','then','stack','name','index','map','ChatOfflineMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1c626d,_0x16c040){var _0x321ad5=function(_0x4ea390){while(--_0x4ea390){_0x1c626d['push'](_0x1c626d['shift']());}};_0x321ad5(++_0x16c040);}(_0xf072,0x1cf));var _0x2f07=function(_0x4fcadb,_0x293a79){_0x4fcadb=_0x4fcadb-0x0;var _0x488e9e=_0xf072[_0x4fcadb];return _0x488e9e;};'use strict';var pdf=require(_0x2f07('0x0'));var emlformat=require(_0x2f07('0x1'));var rimraf=require(_0x2f07('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f07('0x3'));var rp=require('request-promise');var moment=require(_0x2f07('0x4'));var BPromise=require(_0x2f07('0x5'));var Mustache=require(_0x2f07('0x6'));var util=require('util');var path=require(_0x2f07('0x7'));var sox=require(_0x2f07('0x8'));var csv=require(_0x2f07('0x9'));var ejs=require(_0x2f07('0xa'));var fs=require('fs');var _=require(_0x2f07('0xb'));var squel=require(_0x2f07('0xc'));var crypto=require(_0x2f07('0xd'));var jsforce=require(_0x2f07('0xe'));var deskjs=require(_0x2f07('0xf'));var toCsv=require(_0x2f07('0x9'));var querystring=require(_0x2f07('0x10'));var Papa=require(_0x2f07('0x11'));var Redis=require(_0x2f07('0x12'));var authService=require(_0x2f07('0x13'));var qs=require(_0x2f07('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f07('0x15'));var logger=require(_0x2f07('0x16'))(_0x2f07('0x17'));var utils=require(_0x2f07('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dd0cf,_0x1e291d){_0x1e291d=_0x1e291d||0xcc;return function(_0x58549c){if(_0x58549c){return _0x3dd0cf[_0x2f07('0x19')](_0x1e291d);}return _0x3dd0cf[_0x2f07('0x1a')](_0x1e291d)[_0x2f07('0x1b')]();};}function respondWithResult(_0x4dceb1,_0x211514){_0x211514=_0x211514||0xc8;return function(_0x443fdc){if(_0x443fdc){return _0x4dceb1[_0x2f07('0x1a')](_0x211514)[_0x2f07('0x1c')](_0x443fdc);}};}function respondWithFilteredResult(_0x254dbb,_0x309908){return function(_0x5d32d6){if(_0x5d32d6){var _0x8475cf=_0x5d32d6[_0x2f07('0x1d')],_0x5a7b5c=_0x309908[_0x2f07('0x1e')],_0x2232a4=_0x309908[_0x2f07('0x1e')]+_0x309908[_0x2f07('0x1f')],_0xe8cf4d;if(_0x2232a4>=_0x8475cf){_0x2232a4=_0x8475cf;_0xe8cf4d=0xc8;}else{_0xe8cf4d=0xce;}_0x254dbb[_0x2f07('0x1a')](_0xe8cf4d);return _0x254dbb[_0x2f07('0x20')]('Content-Range',_0x5a7b5c+'-'+_0x2232a4+'/'+_0x8475cf)[_0x2f07('0x1c')](_0x5d32d6);}return null;};}function patchUpdates(_0x4e35fd){return function(_0x3cd3c0){try{jsonpatch[_0x2f07('0x21')](_0x3cd3c0,_0x4e35fd,!![]);}catch(_0x119b68){return BPromise[_0x2f07('0x22')](_0x119b68);}return _0x3cd3c0[_0x2f07('0x23')]();};}function saveUpdates(_0x5267e1,_0x45df73){return function(_0x5a0146){if(_0x5a0146){return _0x5a0146['update'](_0x5267e1)['then'](function(_0x1d93c2){return _0x1d93c2;});}return null;};}function removeEntity(_0x51c285,_0xb0c978){return function(_0x5e6ac6){if(_0x5e6ac6){return _0x5e6ac6[_0x2f07('0x24')]()[_0x2f07('0x25')](function(){_0x51c285[_0x2f07('0x1a')](0xcc)[_0x2f07('0x1b')]();});}};}function handleEntityNotFound(_0x49521b,_0x31be77){return function(_0x428d8c){if(!_0x428d8c){_0x49521b[_0x2f07('0x19')](0x194);}return _0x428d8c;};}function handleError(_0x5cfa32,_0x111376){_0x111376=_0x111376||0x1f4;return function(_0x113916){logger['error'](_0x113916[_0x2f07('0x26')]);if(_0x113916[_0x2f07('0x27')]){delete _0x113916['name'];}_0x5cfa32[_0x2f07('0x1a')](_0x111376)['send'](_0x113916);};}exports[_0x2f07('0x28')]=function(_0x17a43a,_0x27bd72){var _0x18f599={},_0x20e4f8={},_0x139ea8={'count':0x0,'rows':[]};var _0x787aad=_[_0x2f07('0x29')](db[_0x2f07('0x2a')][_0x2f07('0x2b')],function(_0x3b4e2f){return{'name':_0x3b4e2f[_0x2f07('0x2c')],'type':_0x3b4e2f['type'][_0x2f07('0x2d')]};});_0x20e4f8[_0x2f07('0x2e')]=_[_0x2f07('0x29')](_0x787aad,'name');_0x20e4f8[_0x2f07('0x2f')]=_[_0x2f07('0x30')](_0x17a43a[_0x2f07('0x2f')]);_0x20e4f8['filters']=_[_0x2f07('0x31')](_0x20e4f8[_0x2f07('0x2e')],_0x20e4f8[_0x2f07('0x2f')]);_0x18f599[_0x2f07('0x32')]=_[_0x2f07('0x31')](_0x20e4f8[_0x2f07('0x2e')],qs[_0x2f07('0x33')](_0x17a43a['query'][_0x2f07('0x33')]));_0x18f599['attributes']=_0x18f599[_0x2f07('0x32')][_0x2f07('0x34')]?_0x18f599[_0x2f07('0x32')]:_0x20e4f8[_0x2f07('0x2e')];if(!_0x17a43a[_0x2f07('0x2f')][_0x2f07('0x35')](_0x2f07('0x36'))){_0x18f599[_0x2f07('0x1f')]=qs[_0x2f07('0x1f')](_0x17a43a[_0x2f07('0x2f')][_0x2f07('0x1f')]);_0x18f599[_0x2f07('0x1e')]=qs[_0x2f07('0x1e')](_0x17a43a[_0x2f07('0x2f')][_0x2f07('0x1e')]);}_0x18f599[_0x2f07('0x37')]=qs['sort'](_0x17a43a['query'][_0x2f07('0x38')]);_0x18f599[_0x2f07('0x39')]=qs[_0x2f07('0x3a')](_['pick'](_0x17a43a['query'],_0x20e4f8[_0x2f07('0x3a')]),_0x787aad);if(_0x17a43a['query'][_0x2f07('0x3b')]){_0x18f599[_0x2f07('0x39')]=_[_0x2f07('0x3c')](_0x18f599[_0x2f07('0x39')],{'$or':_[_0x2f07('0x29')](_0x787aad,function(_0x52ead8){if(_0x52ead8[_0x2f07('0x3d')]!=='VIRTUAL'){var _0x3664eb={};_0x3664eb[_0x52ead8['name']]={'$like':'%'+_0x17a43a[_0x2f07('0x2f')]['filter']+'%'};return _0x3664eb;}})});}_0x18f599=_['merge']({},_0x18f599,_0x17a43a[_0x2f07('0x3e')]);var _0x256de1={'where':_0x18f599['where']};return db[_0x2f07('0x2a')][_0x2f07('0x1d')](_0x256de1)[_0x2f07('0x25')](function(_0x4e4997){_0x139ea8[_0x2f07('0x1d')]=_0x4e4997;if(_0x17a43a[_0x2f07('0x2f')][_0x2f07('0x3f')]){_0x18f599[_0x2f07('0x40')]=[{'all':!![]}];}return db[_0x2f07('0x2a')][_0x2f07('0x41')](_0x18f599);})[_0x2f07('0x25')](function(_0x1a9645){_0x139ea8['rows']=_0x1a9645;return _0x139ea8;})[_0x2f07('0x25')](respondWithFilteredResult(_0x27bd72,_0x18f599))[_0x2f07('0x42')](handleError(_0x27bd72,null));};exports[_0x2f07('0x43')]=function(_0x3f1b6b,_0x46c665){var _0x2ded2e={'raw':!![],'where':{'id':_0x3f1b6b['params']['id']}},_0x5129c={};_0x5129c[_0x2f07('0x2e')]=_[_0x2f07('0x30')](db[_0x2f07('0x2a')][_0x2f07('0x2b')]);_0x5129c[_0x2f07('0x2f')]=_[_0x2f07('0x30')](_0x3f1b6b['query']);_0x5129c[_0x2f07('0x3a')]=_[_0x2f07('0x31')](_0x5129c[_0x2f07('0x2e')],_0x5129c[_0x2f07('0x2f')]);_0x2ded2e['attributes']=_['intersection'](_0x5129c[_0x2f07('0x2e')],qs[_0x2f07('0x33')](_0x3f1b6b[_0x2f07('0x2f')][_0x2f07('0x33')]));_0x2ded2e['attributes']=_0x2ded2e[_0x2f07('0x32')][_0x2f07('0x34')]?_0x2ded2e[_0x2f07('0x32')]:_0x5129c[_0x2f07('0x2e')];if(_0x3f1b6b[_0x2f07('0x2f')][_0x2f07('0x3f')]){_0x2ded2e[_0x2f07('0x40')]=[{'all':!![]}];}_0x2ded2e=_[_0x2f07('0x3c')]({},_0x2ded2e,_0x3f1b6b[_0x2f07('0x3e')]);return db[_0x2f07('0x2a')]['find'](_0x2ded2e)['then'](handleEntityNotFound(_0x46c665,null))['then'](respondWithResult(_0x46c665,null))[_0x2f07('0x42')](handleError(_0x46c665,null));};exports[_0x2f07('0x44')]=function(_0x5a4963,_0x97c166){return db['ChatOfflineMessage'][_0x2f07('0x44')](_0x5a4963[_0x2f07('0x45')],{})[_0x2f07('0x25')](respondWithResult(_0x97c166,0xc9))['catch'](handleError(_0x97c166,null));};exports[_0x2f07('0x46')]=function(_0x350ace,_0x47b17f){if(_0x350ace['body']['id']){delete _0x350ace[_0x2f07('0x45')]['id'];}return db[_0x2f07('0x2a')][_0x2f07('0x47')]({'where':{'id':_0x350ace[_0x2f07('0x48')]['id']}})[_0x2f07('0x25')](handleEntityNotFound(_0x47b17f,null))[_0x2f07('0x25')](saveUpdates(_0x350ace[_0x2f07('0x45')],null))[_0x2f07('0x25')](respondWithResult(_0x47b17f,null))[_0x2f07('0x42')](handleError(_0x47b17f,null));};exports[_0x2f07('0x24')]=function(_0x31dea5,_0x9a94c8){return db[_0x2f07('0x2a')][_0x2f07('0x47')]({'where':{'id':_0x31dea5[_0x2f07('0x48')]['id']}})[_0x2f07('0x25')](handleEntityNotFound(_0x9a94c8,null))['then'](removeEntity(_0x9a94c8,null))[_0x2f07('0x42')](handleError(_0x9a94c8,null));};exports[_0x2f07('0x49')]=function(_0x38083a,_0x1aca39){return db[_0x2f07('0x2a')][_0x2f07('0x49')]()[_0x2f07('0x25')](respondWithResult(_0x1aca39,null))[_0x2f07('0x42')](handleError(_0x1aca39,null));};
\ No newline at end of file
+var _0xcb66=['error','stack','name','send','index','map','ChatOfflineMessage','rawAttributes','fieldName','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','show','params','keys','merge','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','update','destroy'];(function(_0x338a98,_0x440382){var _0x173083=function(_0x6e7931){while(--_0x6e7931){_0x338a98['push'](_0x338a98['shift']());}};_0x173083(++_0x440382);}(_0xcb66,0x19f));var _0x6cb6=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xcb66[_0x47fd36];return _0x21a0fc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6cb6('0x0'));var rimraf=require(_0x6cb6('0x1'));var zipdir=require(_0x6cb6('0x2'));var jsonpatch=require(_0x6cb6('0x3'));var rp=require(_0x6cb6('0x4'));var moment=require('moment');var BPromise=require(_0x6cb6('0x5'));var Mustache=require(_0x6cb6('0x6'));var util=require(_0x6cb6('0x7'));var path=require(_0x6cb6('0x8'));var sox=require(_0x6cb6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6cb6('0xa'));var squel=require(_0x6cb6('0xb'));var crypto=require(_0x6cb6('0xc'));var jsforce=require(_0x6cb6('0xd'));var deskjs=require(_0x6cb6('0xe'));var toCsv=require(_0x6cb6('0xf'));var querystring=require(_0x6cb6('0x10'));var Papa=require(_0x6cb6('0x11'));var Redis=require(_0x6cb6('0x12'));var authService=require(_0x6cb6('0x13'));var qs=require(_0x6cb6('0x14'));var as=require(_0x6cb6('0x15'));var hardwareService=require(_0x6cb6('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6cb6('0x17'))['db'];function respondWithStatusCode(_0x2b49d9,_0xad49d9){_0xad49d9=_0xad49d9||0xcc;return function(_0x2604e7){if(_0x2604e7){return _0x2b49d9['sendStatus'](_0xad49d9);}return _0x2b49d9[_0x6cb6('0x18')](_0xad49d9)[_0x6cb6('0x19')]();};}function respondWithResult(_0x57ee3b,_0x1e5468){_0x1e5468=_0x1e5468||0xc8;return function(_0x14a581){if(_0x14a581){return _0x57ee3b['status'](_0x1e5468)[_0x6cb6('0x1a')](_0x14a581);}};}function respondWithFilteredResult(_0x26b46b,_0x492629){return function(_0x5ab865){if(_0x5ab865){var _0x505b4d=_0x5ab865[_0x6cb6('0x1b')],_0x5dd4cd=_0x492629[_0x6cb6('0x1c')],_0x380edc=_0x492629[_0x6cb6('0x1c')]+_0x492629[_0x6cb6('0x1d')],_0x298daa;if(_0x380edc>=_0x505b4d){_0x380edc=_0x505b4d;_0x298daa=0xc8;}else{_0x298daa=0xce;}_0x26b46b['status'](_0x298daa);return _0x26b46b[_0x6cb6('0x1e')](_0x6cb6('0x1f'),_0x5dd4cd+'-'+_0x380edc+'/'+_0x505b4d)['json'](_0x5ab865);}return null;};}function patchUpdates(_0x4b9da5){return function(_0x5ef3d2){try{jsonpatch['apply'](_0x5ef3d2,_0x4b9da5,!![]);}catch(_0x57157f){return BPromise['reject'](_0x57157f);}return _0x5ef3d2[_0x6cb6('0x20')]();};}function saveUpdates(_0xcd1afa,_0x407455){return function(_0x2d41c4){if(_0x2d41c4){return _0x2d41c4[_0x6cb6('0x21')](_0xcd1afa)['then'](function(_0x520c9e){return _0x520c9e;});}return null;};}function removeEntity(_0x2dffa4,_0x1d35d1){return function(_0x1c4bcd){if(_0x1c4bcd){return _0x1c4bcd[_0x6cb6('0x22')]()['then'](function(){_0x2dffa4[_0x6cb6('0x18')](0xcc)[_0x6cb6('0x19')]();});}};}function handleEntityNotFound(_0x58a6ed,_0x5ad4f2){return function(_0xea5ee5){if(!_0xea5ee5){_0x58a6ed['sendStatus'](0x194);}return _0xea5ee5;};}function handleError(_0x5c91a2,_0x457865){_0x457865=_0x457865||0x1f4;return function(_0x90bac1){logger[_0x6cb6('0x23')](_0x90bac1[_0x6cb6('0x24')]);if(_0x90bac1[_0x6cb6('0x25')]){delete _0x90bac1[_0x6cb6('0x25')];}_0x5c91a2[_0x6cb6('0x18')](_0x457865)[_0x6cb6('0x26')](_0x90bac1);};}exports[_0x6cb6('0x27')]=function(_0x47a81b,_0x5c525b){var _0x4ea573={},_0x2dc6c9={},_0x462dbf={'count':0x0,'rows':[]};var _0xf07150=_[_0x6cb6('0x28')](db[_0x6cb6('0x29')][_0x6cb6('0x2a')],function(_0x57cd74){return{'name':_0x57cd74[_0x6cb6('0x2b')],'type':_0x57cd74['type'][_0x6cb6('0x2c')]};});_0x2dc6c9['model']=_[_0x6cb6('0x28')](_0xf07150,_0x6cb6('0x25'));_0x2dc6c9[_0x6cb6('0x2d')]=_['keys'](_0x47a81b[_0x6cb6('0x2d')]);_0x2dc6c9[_0x6cb6('0x2e')]=_[_0x6cb6('0x2f')](_0x2dc6c9['model'],_0x2dc6c9[_0x6cb6('0x2d')]);_0x4ea573[_0x6cb6('0x30')]=_[_0x6cb6('0x2f')](_0x2dc6c9['model'],qs[_0x6cb6('0x31')](_0x47a81b[_0x6cb6('0x2d')]['fields']));_0x4ea573[_0x6cb6('0x30')]=_0x4ea573[_0x6cb6('0x30')][_0x6cb6('0x32')]?_0x4ea573[_0x6cb6('0x30')]:_0x2dc6c9[_0x6cb6('0x33')];if(!_0x47a81b[_0x6cb6('0x2d')][_0x6cb6('0x34')](_0x6cb6('0x35'))){_0x4ea573[_0x6cb6('0x1d')]=qs[_0x6cb6('0x1d')](_0x47a81b['query'][_0x6cb6('0x1d')]);_0x4ea573[_0x6cb6('0x1c')]=qs[_0x6cb6('0x1c')](_0x47a81b[_0x6cb6('0x2d')]['offset']);}_0x4ea573['order']=qs['sort'](_0x47a81b[_0x6cb6('0x2d')][_0x6cb6('0x36')]);_0x4ea573[_0x6cb6('0x37')]=qs[_0x6cb6('0x2e')](_[_0x6cb6('0x38')](_0x47a81b[_0x6cb6('0x2d')],_0x2dc6c9[_0x6cb6('0x2e')]),_0xf07150);if(_0x47a81b[_0x6cb6('0x2d')]['filter']){_0x4ea573[_0x6cb6('0x37')]=_['merge'](_0x4ea573[_0x6cb6('0x37')],{'$or':_[_0x6cb6('0x28')](_0xf07150,function(_0x240935){if(_0x240935[_0x6cb6('0x39')]!==_0x6cb6('0x3a')){var _0x3bd60c={};_0x3bd60c[_0x240935[_0x6cb6('0x25')]]={'$like':'%'+_0x47a81b['query'][_0x6cb6('0x3b')]+'%'};return _0x3bd60c;}})});}_0x4ea573=_['merge']({},_0x4ea573,_0x47a81b[_0x6cb6('0x3c')]);var _0x18a4a1={'where':_0x4ea573[_0x6cb6('0x37')]};return db['ChatOfflineMessage']['count'](_0x18a4a1)[_0x6cb6('0x3d')](function(_0x55c9c4){_0x462dbf[_0x6cb6('0x1b')]=_0x55c9c4;if(_0x47a81b[_0x6cb6('0x2d')][_0x6cb6('0x3e')]){_0x4ea573[_0x6cb6('0x3f')]=[{'all':!![]}];}return db[_0x6cb6('0x29')][_0x6cb6('0x40')](_0x4ea573);})[_0x6cb6('0x3d')](function(_0x4ef633){_0x462dbf[_0x6cb6('0x41')]=_0x4ef633;return _0x462dbf;})[_0x6cb6('0x3d')](respondWithFilteredResult(_0x5c525b,_0x4ea573))['catch'](handleError(_0x5c525b,null));};exports[_0x6cb6('0x42')]=function(_0x4c6b9f,_0x81b536){var _0x31a391={'raw':!![],'where':{'id':_0x4c6b9f[_0x6cb6('0x43')]['id']}},_0x15a0a8={};_0x15a0a8['model']=_['keys'](db[_0x6cb6('0x29')]['rawAttributes']);_0x15a0a8['query']=_[_0x6cb6('0x44')](_0x4c6b9f['query']);_0x15a0a8[_0x6cb6('0x2e')]=_[_0x6cb6('0x2f')](_0x15a0a8['model'],_0x15a0a8['query']);_0x31a391[_0x6cb6('0x30')]=_['intersection'](_0x15a0a8[_0x6cb6('0x33')],qs[_0x6cb6('0x31')](_0x4c6b9f['query'][_0x6cb6('0x31')]));_0x31a391[_0x6cb6('0x30')]=_0x31a391['attributes'][_0x6cb6('0x32')]?_0x31a391['attributes']:_0x15a0a8[_0x6cb6('0x33')];if(_0x4c6b9f[_0x6cb6('0x2d')]['includeAll']){_0x31a391[_0x6cb6('0x3f')]=[{'all':!![]}];}_0x31a391=_[_0x6cb6('0x45')]({},_0x31a391,_0x4c6b9f['options']);return db['ChatOfflineMessage'][_0x6cb6('0x46')](_0x31a391)[_0x6cb6('0x3d')](handleEntityNotFound(_0x81b536,null))[_0x6cb6('0x3d')](respondWithResult(_0x81b536,null))['catch'](handleError(_0x81b536,null));};exports[_0x6cb6('0x47')]=function(_0x331bc8,_0x4f4d59){return db[_0x6cb6('0x29')][_0x6cb6('0x47')](_0x331bc8[_0x6cb6('0x48')],{})['then'](respondWithResult(_0x4f4d59,0xc9))[_0x6cb6('0x49')](handleError(_0x4f4d59,null));};exports[_0x6cb6('0x21')]=function(_0x42dc72,_0x12bd7f){if(_0x42dc72[_0x6cb6('0x48')]['id']){delete _0x42dc72[_0x6cb6('0x48')]['id'];}return db['ChatOfflineMessage'][_0x6cb6('0x46')]({'where':{'id':_0x42dc72['params']['id']}})['then'](handleEntityNotFound(_0x12bd7f,null))[_0x6cb6('0x3d')](saveUpdates(_0x42dc72[_0x6cb6('0x48')],null))['then'](respondWithResult(_0x12bd7f,null))[_0x6cb6('0x49')](handleError(_0x12bd7f,null));};exports['destroy']=function(_0x17b229,_0x2ae4ed){return db[_0x6cb6('0x29')]['find']({'where':{'id':_0x17b229[_0x6cb6('0x43')]['id']}})[_0x6cb6('0x3d')](handleEntityNotFound(_0x2ae4ed,null))[_0x6cb6('0x3d')](removeEntity(_0x2ae4ed,null))['catch'](handleError(_0x2ae4ed,null));};exports[_0x6cb6('0x4a')]=function(_0x5b9a06,_0x7e4104){return db[_0x6cb6('0x29')][_0x6cb6('0x4a')]()['then'](respondWithResult(_0x7e4104,null))['catch'](handleError(_0x7e4104,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 46cc547..1c61368 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a77=['define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports'];(function(_0x16bea7,_0x4b8e74){var _0x185b0f=function(_0x216e7a){while(--_0x216e7a){_0x16bea7['push'](_0x16bea7['shift']());}};_0x185b0f(++_0x4b8e74);}(_0x7a77,0x1cb));var _0x77a7=function(_0xf3388b,_0x275401){_0xf3388b=_0xf3388b-0x0;var _0x14a9ee=_0x7a77[_0xf3388b];return _0x14a9ee;};'use strict';var _=require(_0x77a7('0x0'));var util=require(_0x77a7('0x1'));var logger=require(_0x77a7('0x2'))('api');var moment=require(_0x77a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x77a7('0x4'));var fs=require('fs');var path=require(_0x77a7('0x5'));var rimraf=require('rimraf');var config=require(_0x77a7('0x6'));var attributes=require(_0x77a7('0x7'));module[_0x77a7('0x8')]=function(_0x18bb23,_0x1228fe){return _0x18bb23[_0x77a7('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0x77a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x77a7('0xb'),'collate':_0x77a7('0xc')});};
\ No newline at end of file
+var _0x6de7=['util','../../config/logger','moment','path','rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x6de7,0x1af));var _0x76de=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0x6de7[_0x533528];return _0x3189f1;};'use strict';var _=require(_0x76de('0x0'));var util=require(_0x76de('0x1'));var logger=require(_0x76de('0x2'))('api');var moment=require(_0x76de('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x76de('0x4'));var rimraf=require(_0x76de('0x5'));var config=require('../../config/environment');var attributes=require(_0x76de('0x6'));module['exports']=function(_0x1156ba,_0x4e17aa){return _0x1156ba[_0x76de('0x7')](_0x76de('0x8'),attributes,{'tableName':_0x76de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x76de('0xa'),'collate':_0x76de('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index b2603c7..bb258a5 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe67=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment'];(function(_0x458edc,_0x9baf98){var _0x44af29=function(_0x41929c){while(--_0x41929c){_0x458edc['push'](_0x458edc['shift']());}};_0x44af29(++_0x9baf98);}(_0xbe67,0x82));var _0x7be6=function(_0x478de9,_0x26f592){_0x478de9=_0x478de9-0x0;var _0x35060b=_0xbe67[_0x478de9];return _0x35060b;};'use strict';var _=require(_0x7be6('0x0'));var util=require('util');var moment=require(_0x7be6('0x1'));var BPromise=require(_0x7be6('0x2'));var rs=require(_0x7be6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7be6('0x4'))['db'];var utils=require(_0x7be6('0x5'));var logger=require(_0x7be6('0x6'))(_0x7be6('0x7'));var config=require(_0x7be6('0x8'));var jayson=require(_0x7be6('0x9'));var client=jayson[_0x7be6('0xa')][_0x7be6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x101d0e,_0x66f5a8,_0x1f6244){return new BPromise(function(_0x5eda68,_0x29ce23){return client[_0x7be6('0xc')](_0x101d0e,_0x1f6244)[_0x7be6('0xd')](function(_0x52acfe){logger[_0x7be6('0xe')](_0x7be6('0xf'),_0x66f5a8,_0x7be6('0x10'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x66f5a8,_0x7be6('0x10'),JSON[_0x7be6('0x11')](_0x52acfe));if(_0x52acfe[_0x7be6('0x12')]){if(_0x52acfe[_0x7be6('0x12')][_0x7be6('0x13')]===0x1f4){logger['error'](_0x7be6('0xf'),_0x66f5a8,_0x52acfe[_0x7be6('0x12')]['message']);return _0x29ce23(_0x52acfe[_0x7be6('0x12')][_0x7be6('0x14')]);}logger[_0x7be6('0x12')](_0x7be6('0xf'),_0x66f5a8,_0x52acfe[_0x7be6('0x12')][_0x7be6('0x14')]);return _0x5eda68(_0x52acfe[_0x7be6('0x12')][_0x7be6('0x14')]);}else{logger[_0x7be6('0xe')](_0x7be6('0xf'),_0x66f5a8,'request\x20sent');_0x5eda68(_0x52acfe['result']['message']);}})[_0x7be6('0x15')](function(_0x921cf3){logger[_0x7be6('0x12')](_0x7be6('0xf'),_0x66f5a8,_0x921cf3);_0x29ce23(_0x921cf3);});});}
\ No newline at end of file
+var _0xad36=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','info','result','lodash','util','moment','randomstring'];(function(_0x3eec99,_0x3719d9){var _0x58c9cb=function(_0x39389a){while(--_0x39389a){_0x3eec99['push'](_0x3eec99['shift']());}};_0x58c9cb(++_0x3719d9);}(_0xad36,0x18b));var _0x6ad3=function(_0x16abd8,_0x5c44a0){_0x16abd8=_0x16abd8-0x0;var _0x7eb337=_0xad36[_0x16abd8];return _0x7eb337;};'use strict';var _=require(_0x6ad3('0x0'));var util=require(_0x6ad3('0x1'));var moment=require(_0x6ad3('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ad3('0x3'));var fs=require('fs');var Redis=require(_0x6ad3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ad3('0x5'));var logger=require('../../config/logger')(_0x6ad3('0x6'));var config=require(_0x6ad3('0x7'));var jayson=require(_0x6ad3('0x8'));var client=jayson[_0x6ad3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7db804,_0x5f04bb,_0x2ceaf2){return new BPromise(function(_0x4e52ae,_0x27d1cf){return client[_0x6ad3('0xa')](_0x7db804,_0x2ceaf2)[_0x6ad3('0xb')](function(_0x49d6b0){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5f04bb,_0x6ad3('0xc'));logger[_0x6ad3('0xd')](_0x6ad3('0xe'),_0x5f04bb,_0x6ad3('0xc'),JSON['stringify'](_0x49d6b0));if(_0x49d6b0[_0x6ad3('0xf')]){if(_0x49d6b0['error'][_0x6ad3('0x10')]===0x1f4){logger[_0x6ad3('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5f04bb,_0x49d6b0['error'][_0x6ad3('0x11')]);return _0x27d1cf(_0x49d6b0['error'][_0x6ad3('0x11')]);}logger['error'](_0x6ad3('0x12'),_0x5f04bb,_0x49d6b0['error'][_0x6ad3('0x11')]);return _0x4e52ae(_0x49d6b0[_0x6ad3('0xf')][_0x6ad3('0x11')]);}else{logger[_0x6ad3('0x13')](_0x6ad3('0x12'),_0x5f04bb,_0x6ad3('0xc'));_0x4e52ae(_0x49d6b0[_0x6ad3('0x14')][_0x6ad3('0x11')]);}})['catch'](function(_0x1d92a8){logger[_0x6ad3('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5f04bb,_0x1d92a8);_0x27d1cf(_0x1d92a8);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 270df40..d36d213 100644
--- a/server/api/chatOfflineMessage/index.js
+++ b/server/api/chatOfflineMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc765=['destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','/describe','get','show','post','put','/:id','delete'];(function(_0x20fc38,_0x131f62){var _0x162d06=function(_0x1c2794){while(--_0x1c2794){_0x20fc38['push'](_0x20fc38['shift']());}};_0x162d06(++_0x131f62);}(_0xc765,0xb5));var _0x5c76=function(_0x39f42f,_0x1866e4){_0x39f42f=_0x39f42f-0x0;var _0x36df42=_0xc765[_0x39f42f];return _0x36df42;};'use strict';var multer=require(_0x5c76('0x0'));var util=require(_0x5c76('0x1'));var path=require('path');var timeout=require(_0x5c76('0x2'));var express=require(_0x5c76('0x3'));var router=express[_0x5c76('0x4')]();var auth=require(_0x5c76('0x5'));var interaction=require(_0x5c76('0x6'));var config=require(_0x5c76('0x7'));var controller=require(_0x5c76('0x8'));router['get']('/',auth[_0x5c76('0x9')](),controller['index']);router['get'](_0x5c76('0xa'),auth[_0x5c76('0x9')](),controller['describe']);router[_0x5c76('0xb')]('/:id',auth[_0x5c76('0x9')](),controller[_0x5c76('0xc')]);router[_0x5c76('0xd')]('/',auth[_0x5c76('0x9')](),controller['create']);router[_0x5c76('0xe')](_0x5c76('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x5c76('0x10')](_0x5c76('0xf'),auth[_0x5c76('0x9')](),controller[_0x5c76('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x087d=['put','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x087d,0xd4));var _0xd087=function(_0x9117bb,_0x3cc3d9){_0x9117bb=_0x9117bb-0x0;var _0x4df1ad=_0x087d[_0x9117bb];return _0x4df1ad;};'use strict';var multer=require('multer');var util=require(_0xd087('0x0'));var path=require(_0xd087('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd087('0x2')]();var auth=require(_0xd087('0x3'));var interaction=require(_0xd087('0x4'));var config=require(_0xd087('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0xd087('0x6')]('/',auth[_0xd087('0x7')](),controller['index']);router[_0xd087('0x6')]('/describe',auth[_0xd087('0x7')](),controller[_0xd087('0x8')]);router[_0xd087('0x6')](_0xd087('0x9'),auth[_0xd087('0x7')](),controller[_0xd087('0xa')]);router[_0xd087('0xb')]('/',auth[_0xd087('0x7')](),controller['create']);router[_0xd087('0xc')](_0xd087('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd087('0x9'),auth[_0xd087('0x7')](),controller['destroy']);module[_0xd087('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 059d283..390eb09 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8ed=['STRING','mouseOver','timeout','sequelize','exports'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xd8ed,0x19d));var _0xdd8e=function(_0x124e8f,_0x25c34a){_0x124e8f=_0x124e8f-0x0;var _0x3a7859=_0xd8ed[_0x124e8f];return _0x3a7859;};'use strict';var Sequelize=require(_0xdd8e('0x0'));module[_0xdd8e('0x1')]={'name':{'type':Sequelize[_0xdd8e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xdd8e('0x3'),_0xdd8e('0x4')),'defaultValue':_0xdd8e('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x6f53=['mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6f53,0x170));var _0x36f5=function(_0x5a5b8a,_0x2f937b){_0x5a5b8a=_0x5a5b8a-0x0;var _0x2ddb9b=_0x6f53[_0x5a5b8a];return _0x2ddb9b;};'use strict';var Sequelize=require(_0x36f5('0x0'));module['exports']={'name':{'type':Sequelize[_0x36f5('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x36f5('0x2'),_0x36f5('0x3')),'defaultValue':_0x36f5('0x2')},'selector':{'type':Sequelize[_0x36f5('0x1')]},'timeout':{'type':Sequelize[_0x36f5('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index ec89e76..6a18b30 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body'];(function(_0x2ec43b,_0x3b2585){var _0x178e13=function(_0x386ec8){while(--_0x386ec8){_0x2ec43b['push'](_0x2ec43b['shift']());}};_0x178e13(++_0x3b2585);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={'raw':!![],'where':{'id':_0x4d5c4b[_0x3071('0x2d')]['id']}},_0x163604={};_0x163604[_0x3071('0x2e')]=_[_0x3071('0x2f')](db[_0x3071('0x30')][_0x3071('0x31')]);_0x163604[_0x3071('0x32')]=_[_0x3071('0x2f')](_0x4d5c4b[_0x3071('0x32')]);_0x163604['filters']=_['intersection'](_0x163604[_0x3071('0x2e')],_0x163604[_0x3071('0x32')]);_0x28792d[_0x3071('0x33')]=_[_0x3071('0x34')](_0x163604[_0x3071('0x2e')],qs[_0x3071('0x35')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x35')]));_0x28792d['attributes']=_0x28792d['attributes']['length']?_0x28792d[_0x3071('0x33')]:_0x163604[_0x3071('0x2e')];if(_0x4d5c4b['query'][_0x3071('0x36')]){_0x28792d[_0x3071('0x37')]=[{'all':!![]}];}_0x28792d=_[_0x3071('0x38')]({},_0x28792d,_0x4d5c4b[_0x3071('0x39')]);return db['ChatProactiveAction'][_0x3071('0x3a')](_0x28792d)[_0x3071('0x26')](handleEntityNotFound(_0x4fb1ca,null))[_0x3071('0x26')](respondWithResult(_0x4fb1ca,null))[_0x3071('0x3b')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x3c')]=function(_0x2068ce,_0x3c55c){return db[_0x3071('0x30')]['create'](_0x2068ce[_0x3071('0x3d')],{})['then'](respondWithResult(_0x3c55c,0xc9))['catch'](handleError(_0x3c55c,null));};exports[_0x3071('0x3e')]=function(_0xa3a7ae,_0x54d9c3){if(_0xa3a7ae[_0x3071('0x3d')]['id']){delete _0xa3a7ae[_0x3071('0x3d')]['id'];}return db[_0x3071('0x30')][_0x3071('0x3a')]({'where':{'id':_0xa3a7ae[_0x3071('0x2d')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x54d9c3,null))['then'](saveUpdates(_0xa3a7ae[_0x3071('0x3d')],null))[_0x3071('0x26')](respondWithResult(_0x54d9c3,null))['catch'](handleError(_0x54d9c3,null));};exports[_0x3071('0x27')]=function(_0x5b1392,_0x28f855){return db[_0x3071('0x30')]['find']({'where':{'id':_0x5b1392['params']['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x28f855,null))[_0x3071('0x26')](removeEntity(_0x28f855,null))[_0x3071('0x3b')](handleError(_0x28f855,null));};
\ No newline at end of file
+var _0xcb91=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','length','includeAll','merge','options','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xcb91[_0x80f51a];return _0x327148;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var as=require(_0x1cb9('0x10'));var hardwareService=require(_0x1cb9('0x11'));var logger=require('../../config/logger')(_0x1cb9('0x12'));var utils=require(_0x1cb9('0x13'));var config=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x46af58,_0x5445e1){_0x5445e1=_0x5445e1||0xcc;return function(_0x5e3c19){if(_0x5e3c19){return _0x46af58['sendStatus'](_0x5445e1);}return _0x46af58[_0x1cb9('0x16')](_0x5445e1)[_0x1cb9('0x17')]();};}function respondWithResult(_0x384496,_0x1c714f){_0x1c714f=_0x1c714f||0xc8;return function(_0x56884d){if(_0x56884d){return _0x384496[_0x1cb9('0x16')](_0x1c714f)[_0x1cb9('0x18')](_0x56884d);}};}function respondWithFilteredResult(_0x1b3cd7,_0x8dfa55){return function(_0x3e2d11){if(_0x3e2d11){var _0x5806d8=_0x3e2d11[_0x1cb9('0x19')],_0x5572cb=_0x8dfa55[_0x1cb9('0x1a')],_0xd446a3=_0x8dfa55[_0x1cb9('0x1a')]+_0x8dfa55[_0x1cb9('0x1b')],_0x3cc765;if(_0xd446a3>=_0x5806d8){_0xd446a3=_0x5806d8;_0x3cc765=0xc8;}else{_0x3cc765=0xce;}_0x1b3cd7[_0x1cb9('0x16')](_0x3cc765);return _0x1b3cd7['set']('Content-Range',_0x5572cb+'-'+_0xd446a3+'/'+_0x5806d8)[_0x1cb9('0x18')](_0x3e2d11);}return null;};}function patchUpdates(_0x41ac41){return function(_0x2b2669){try{jsonpatch[_0x1cb9('0x1c')](_0x2b2669,_0x41ac41,!![]);}catch(_0x280a84){return BPromise[_0x1cb9('0x1d')](_0x280a84);}return _0x2b2669[_0x1cb9('0x1e')]();};}function saveUpdates(_0x4ac422,_0x559bcc){return function(_0x1a5a72){if(_0x1a5a72){return _0x1a5a72['update'](_0x4ac422)[_0x1cb9('0x1f')](function(_0x2265ea){return _0x2265ea;});}return null;};}function removeEntity(_0x523b26,_0x599275){return function(_0x2e3854){if(_0x2e3854){return _0x2e3854[_0x1cb9('0x20')]()[_0x1cb9('0x1f')](function(){_0x523b26[_0x1cb9('0x16')](0xcc)[_0x1cb9('0x17')]();});}};}function handleEntityNotFound(_0x27db16,_0x59ebea){return function(_0x55b232){if(!_0x55b232){_0x27db16[_0x1cb9('0x21')](0x194);}return _0x55b232;};}function handleError(_0x557199,_0x10a419){_0x10a419=_0x10a419||0x1f4;return function(_0x2b1275){logger[_0x1cb9('0x22')](_0x2b1275[_0x1cb9('0x23')]);if(_0x2b1275[_0x1cb9('0x24')]){delete _0x2b1275['name'];}_0x557199[_0x1cb9('0x16')](_0x10a419)[_0x1cb9('0x25')](_0x2b1275);};}exports['show']=function(_0xd6891c,_0x21effa){var _0x41a9a0={'raw':!![],'where':{'id':_0xd6891c[_0x1cb9('0x26')]['id']}},_0x1804fd={};_0x1804fd[_0x1cb9('0x27')]=_[_0x1cb9('0x28')](db[_0x1cb9('0x29')][_0x1cb9('0x2a')]);_0x1804fd[_0x1cb9('0x2b')]=_['keys'](_0xd6891c[_0x1cb9('0x2b')]);_0x1804fd['filters']=_[_0x1cb9('0x2c')](_0x1804fd['model'],_0x1804fd[_0x1cb9('0x2b')]);_0x41a9a0[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0x1804fd[_0x1cb9('0x27')],qs['fields'](_0xd6891c[_0x1cb9('0x2b')]['fields']));_0x41a9a0[_0x1cb9('0x2d')]=_0x41a9a0[_0x1cb9('0x2d')][_0x1cb9('0x2e')]?_0x41a9a0['attributes']:_0x1804fd[_0x1cb9('0x27')];if(_0xd6891c['query'][_0x1cb9('0x2f')]){_0x41a9a0['include']=[{'all':!![]}];}_0x41a9a0=_[_0x1cb9('0x30')]({},_0x41a9a0,_0xd6891c[_0x1cb9('0x31')]);return db[_0x1cb9('0x29')][_0x1cb9('0x32')](_0x41a9a0)['then'](handleEntityNotFound(_0x21effa,null))[_0x1cb9('0x1f')](respondWithResult(_0x21effa,null))[_0x1cb9('0x33')](handleError(_0x21effa,null));};exports[_0x1cb9('0x34')]=function(_0x91a1db,_0xc6784c){return db[_0x1cb9('0x29')][_0x1cb9('0x34')](_0x91a1db[_0x1cb9('0x35')],{})[_0x1cb9('0x1f')](respondWithResult(_0xc6784c,0xc9))[_0x1cb9('0x33')](handleError(_0xc6784c,null));};exports[_0x1cb9('0x36')]=function(_0x26b950,_0x29f149){if(_0x26b950['body']['id']){delete _0x26b950['body']['id'];}return db[_0x1cb9('0x29')][_0x1cb9('0x32')]({'where':{'id':_0x26b950[_0x1cb9('0x26')]['id']}})[_0x1cb9('0x1f')](handleEntityNotFound(_0x29f149,null))[_0x1cb9('0x1f')](saveUpdates(_0x26b950[_0x1cb9('0x35')],null))[_0x1cb9('0x1f')](respondWithResult(_0x29f149,null))[_0x1cb9('0x33')](handleError(_0x29f149,null));};exports['destroy']=function(_0x2aa59b,_0x1482c4){return db[_0x1cb9('0x29')]['find']({'where':{'id':_0x2aa59b[_0x1cb9('0x26')]['id']}})['then'](handleEntityNotFound(_0x1482c4,null))[_0x1cb9('0x1f')](removeEntity(_0x1482c4,null))['catch'](handleError(_0x1482c4,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 590cc0f..25c9a2d 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.model.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc39f=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x451f22,_0xcf2393){var _0x3bd251=function(_0x5c7386){while(--_0x5c7386){_0x451f22['push'](_0x451f22['shift']());}};_0x3bd251(++_0xcf2393);}(_0xc39f,0x189));var _0xfc39=function(_0x52492e,_0x51ef14){_0x52492e=_0x52492e-0x0;var _0x470378=_0xc39f[_0x52492e];return _0x470378;};'use strict';var _=require(_0xfc39('0x0'));var util=require(_0xfc39('0x1'));var logger=require('../../config/logger')(_0xfc39('0x2'));var moment=require(_0xfc39('0x3'));var BPromise=require(_0xfc39('0x4'));var rp=require(_0xfc39('0x5'));var fs=require('fs');var path=require(_0xfc39('0x6'));var rimraf=require(_0xfc39('0x7'));var config=require(_0xfc39('0x8'));var attributes=require(_0xfc39('0x9'));module['exports']=function(_0x2a58eb,_0x250596){return _0x2a58eb[_0xfc39('0xa')](_0xfc39('0xb'),attributes,{'tableName':_0xfc39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x181a=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','util'];(function(_0x43f7d0,_0x57d3c){var _0x33d2f7=function(_0x4c7671){while(--_0x4c7671){_0x43f7d0['push'](_0x43f7d0['shift']());}};_0x33d2f7(++_0x57d3c);}(_0x181a,0xdb));var _0xa181=function(_0x5328a2,_0x234671){_0x5328a2=_0x5328a2-0x0;var _0x4b40c5=_0x181a[_0x5328a2];return _0x4b40c5;};'use strict';var _=require('lodash');var util=require(_0xa181('0x0'));var logger=require(_0xa181('0x1'))(_0xa181('0x2'));var moment=require(_0xa181('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa181('0x4'));var rimraf=require(_0xa181('0x5'));var config=require(_0xa181('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0xa181('0x7')]=function(_0x2f0005,_0x2c8d44){return _0x2f0005[_0xa181('0x8')](_0xa181('0x9'),attributes,{'tableName':_0xa181('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index a749aef..962d101 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9146=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4d378e,_0x193221){var _0x1c34b8=function(_0x29317c){while(--_0x29317c){_0x4d378e['push'](_0x4d378e['shift']());}};_0x1c34b8(++_0x193221);}(_0x9146,0x170));var _0x6914=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x9146[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x6914('0x0'));var util=require(_0x6914('0x1'));var moment=require(_0x6914('0x2'));var BPromise=require(_0x6914('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6914('0x4'));var db=require(_0x6914('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6914('0x6'))(_0x6914('0x7'));var config=require(_0x6914('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6914('0x9')][_0x6914('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4db082,_0x37503d,_0x14b546){return new BPromise(function(_0x4c52f3,_0x431c93){return client[_0x6914('0xb')](_0x4db082,_0x14b546)[_0x6914('0xc')](function(_0x42a253){logger[_0x6914('0xd')](_0x6914('0xe'),_0x37503d,'request\x20sent');logger[_0x6914('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x37503d,_0x6914('0x10'),JSON[_0x6914('0x11')](_0x42a253));if(_0x42a253['error']){if(_0x42a253[_0x6914('0x12')][_0x6914('0x13')]===0x1f4){logger['error'](_0x6914('0xe'),_0x37503d,_0x42a253['error'][_0x6914('0x14')]);return _0x431c93(_0x42a253[_0x6914('0x12')][_0x6914('0x14')]);}logger[_0x6914('0x12')](_0x6914('0xe'),_0x37503d,_0x42a253[_0x6914('0x12')][_0x6914('0x14')]);return _0x4c52f3(_0x42a253[_0x6914('0x12')][_0x6914('0x14')]);}else{logger['info'](_0x6914('0xe'),_0x37503d,_0x6914('0x10'));_0x4c52f3(_0x42a253[_0x6914('0x15')][_0x6914('0x14')]);}})[_0x6914('0x16')](function(_0x16c5b1){logger[_0x6914('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x37503d,_0x16c5b1);_0x431c93(_0x16c5b1);});});}
\ No newline at end of file
+var _0xa208=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa208,0x8d));var _0x8a20=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa208[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require('lodash');var util=require(_0x8a20('0x0'));var moment=require('moment');var BPromise=require(_0x8a20('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a20('0x2'));var db=require(_0x8a20('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a20('0x4'))('rpc');var config=require(_0x8a20('0x5'));var jayson=require(_0x8a20('0x6'));var client=jayson[_0x8a20('0x7')][_0x8a20('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x529be1,_0x47888a,_0x3e7101){return new BPromise(function(_0x5bf77e,_0x467505){return client[_0x8a20('0x9')](_0x529be1,_0x3e7101)[_0x8a20('0xa')](function(_0x197b0c){logger[_0x8a20('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x47888a,_0x8a20('0xc'));logger[_0x8a20('0xd')](_0x8a20('0xe'),_0x47888a,_0x8a20('0xc'),JSON['stringify'](_0x197b0c));if(_0x197b0c['error']){if(_0x197b0c['error'][_0x8a20('0xf')]===0x1f4){logger[_0x8a20('0x10')](_0x8a20('0x11'),_0x47888a,_0x197b0c[_0x8a20('0x10')][_0x8a20('0x12')]);return _0x467505(_0x197b0c['error']['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x47888a,_0x197b0c[_0x8a20('0x10')][_0x8a20('0x12')]);return _0x5bf77e(_0x197b0c['error'][_0x8a20('0x12')]);}else{logger[_0x8a20('0xb')](_0x8a20('0x11'),_0x47888a,_0x8a20('0xc'));_0x5bf77e(_0x197b0c[_0x8a20('0x13')][_0x8a20('0x12')]);}})[_0x8a20('0x14')](function(_0x179b47){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x47888a,_0x179b47);_0x467505(_0x179b47);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index e50986f..7181d8c 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd6bb=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x16ed87,_0x1be1a2){var _0xc1a1d8=function(_0x3c0fcf){while(--_0x3c0fcf){_0x16ed87['push'](_0x16ed87['shift']());}};_0xc1a1d8(++_0x1be1a2);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xd6bb[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0xbd6b('0x0'));var util=require('util');var path=require(_0xbd6b('0x1'));var timeout=require(_0xbd6b('0x2'));var express=require(_0xbd6b('0x3'));var router=express[_0xbd6b('0x4')]();var auth=require(_0xbd6b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd6b('0x6'));var controller=require(_0xbd6b('0x7'));router[_0xbd6b('0x8')]('/:id',auth[_0xbd6b('0x9')](),controller[_0xbd6b('0xa')]);router[_0xbd6b('0xb')]('/',auth[_0xbd6b('0x9')](),controller[_0xbd6b('0xc')]);router[_0xbd6b('0xd')](_0xbd6b('0xe'),auth[_0xbd6b('0x9')](),controller[_0xbd6b('0xf')]);router[_0xbd6b('0x10')](_0xbd6b('0xe'),auth['isAuthenticated'](),controller[_0xbd6b('0x11')]);module[_0xbd6b('0x12')]=router;
\ No newline at end of file
+var _0x63b7=['../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x63b7,0x1e2));var _0x763b=function(_0x315aea,_0x318a80){_0x315aea=_0x315aea-0x0;var _0x4a4bdb=_0x63b7[_0x315aea];return _0x4a4bdb;};'use strict';var multer=require('multer');var util=require(_0x763b('0x0'));var path=require('path');var timeout=require(_0x763b('0x1'));var express=require(_0x763b('0x2'));var router=express[_0x763b('0x3')]();var auth=require(_0x763b('0x4'));var interaction=require(_0x763b('0x5'));var config=require('../../config/environment');var controller=require(_0x763b('0x6'));router[_0x763b('0x7')](_0x763b('0x8'),auth['isAuthenticated'](),controller[_0x763b('0x9')]);router[_0x763b('0xa')]('/',auth[_0x763b('0xb')](),controller[_0x763b('0xc')]);router[_0x763b('0xd')](_0x763b('0x8'),auth[_0x763b('0xb')](),controller[_0x763b('0xe')]);router[_0x763b('0xf')]('/:id',auth[_0x763b('0xb')](),controller[_0x763b('0x10')]);module[_0x763b('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 6b4c5e6..93b1d64 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x568e=['STRING','name','ENUM','beepall','roundrobin','exports'];(function(_0x179b68,_0x339d82){var _0x5e6d69=function(_0x69ff9){while(--_0x69ff9){_0x179b68['push'](_0x179b68['shift']());}};_0x5e6d69(++_0x339d82);}(_0x568e,0x161));var _0xe568=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x568e[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require('sequelize');module[_0xe568('0x0')]={'name':{'type':Sequelize[_0xe568('0x1')],'unique':_0xe568('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe568('0x3')]('rrmemory',_0xe568('0x4'),_0xe568('0x5'))}};
\ No newline at end of file
+var _0x2373=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x58b02c,_0x233682){var _0x33cd95=function(_0xfa78){while(--_0xfa78){_0x58b02c['push'](_0x58b02c['shift']());}};_0x33cd95(++_0x233682);}(_0x2373,0x1c0));var _0x3237=function(_0x3e001f,_0x314f9f){_0x3e001f=_0x3e001f-0x0;var _0x1bdb64=_0x2373[_0x3e001f];return _0x1bdb64;};'use strict';var Sequelize=require(_0x3237('0x0'));module[_0x3237('0x1')]={'name':{'type':Sequelize[_0x3237('0x2')],'unique':_0x3237('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3237('0x2')]},'timeout':{'type':Sequelize[_0x3237('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3237('0x5'),_0x3237('0x6'),_0x3237('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index c83c99a..1a71d96 100644
--- a/server/api/chatQueue/chatQueue.controller.js
+++ b/server/api/chatQueue/chatQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9487=['getAgents','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','get','ChatQueues','destroy','stack','index','ChatQueue','rawAttributes','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','include','rows','show','params','keys','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','pick','findAll','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','Team','getTeams','ids','User','Agents','online','voicePause','flatMap','transaction','addTeams','each','UserChatQueue','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','sequelize','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x9487,0x1bd));var _0x7948=function(_0x44d89e,_0x26dcdb){_0x44d89e=_0x44d89e-0x0;var _0x234ce4=_0x9487[_0x44d89e];return _0x234ce4;};'use strict';var pdf=require(_0x7948('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7948('0x2'));var rp=require(_0x7948('0x3'));var moment=require(_0x7948('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7948('0x5'));var util=require(_0x7948('0x6'));var path=require(_0x7948('0x7'));var sox=require(_0x7948('0x8'));var csv=require(_0x7948('0x9'));var ejs=require(_0x7948('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7948('0xb'));var crypto=require(_0x7948('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7948('0xd'));var toCsv=require(_0x7948('0x9'));var querystring=require('querystring');var Papa=require(_0x7948('0xe'));var Redis=require(_0x7948('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7948('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7948('0x11'));var logger=require(_0x7948('0x12'))('api');var utils=require(_0x7948('0x13'));var config=require('../../config/environment');var db=require(_0x7948('0x14'))['db'];config['redis']=_[_0x7948('0x15')](config[_0x7948('0x16')],{'host':_0x7948('0x17'),'port':0x18eb});var socket=require(_0x7948('0x18'))(new Redis(config[_0x7948('0x16')]));require('./chatQueue.socket')[_0x7948('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7948('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x181ca1,_0x31a57c,_0x32de42){if(_0x32de42){var _0x5907b4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5907b4[_0x7948('0x1b')](_0x31a57c)){return _0x181ca1;}else{throw new db['Sequelize'][(_0x7948('0x1c'))](_0x7948('0x1d'));}}else{return _0x181ca1;}}function respondWithRpcPromise(_0x3287e4,_0xe21f5a,_0x33a3ea,_0x282c5e){return new BPromise(function(_0x1d1dc2,_0x367e18){var _0x5a6b56=_0x282c5e||client;return _0x5a6b56[_0x7948('0x1e')](_0x3287e4,_0x33a3ea)[_0x7948('0x1f')](function(_0xb5a131){logger[_0x7948('0x20')](_0x7948('0x21'),_0xe21f5a,'request\x20sent');logger[_0x7948('0x22')](_0x7948('0x23'),_0xe21f5a,'request\x20sent',JSON[_0x7948('0x24')](_0xb5a131));if(_0xb5a131[_0x7948('0x25')]){if(_0xb5a131[_0x7948('0x25')][_0x7948('0x26')]===0x1f4){logger[_0x7948('0x25')](_0x7948('0x21'),_0xe21f5a,_0xb5a131['error'][_0x7948('0x27')]);return _0x367e18(_0xb5a131['error'][_0x7948('0x27')]);}logger[_0x7948('0x25')](_0x7948('0x21'),_0xe21f5a,_0xb5a131['error']['message']);return _0x1d1dc2(_0xb5a131[_0x7948('0x25')]['message']);}else{logger[_0x7948('0x20')]('ChatQueue,\x20%s,\x20%s',_0xe21f5a,_0x7948('0x28'));_0x1d1dc2(_0xb5a131[_0x7948('0x29')]['message']);}})[_0x7948('0x2a')](function(_0x4b48c6){logger[_0x7948('0x25')](_0x7948('0x21'),_0xe21f5a,_0x4b48c6);_0x367e18(_0x4b48c6);});});}function respondWithStatusCode(_0x4ef806,_0x2b4c20){_0x2b4c20=_0x2b4c20||0xcc;return function(_0x4a99de){if(_0x4a99de){return _0x4ef806[_0x7948('0x2b')](_0x2b4c20);}return _0x4ef806[_0x7948('0x2c')](_0x2b4c20)[_0x7948('0x2d')]();};}function respondWithResult(_0x1a3945,_0x5ba8e1){_0x5ba8e1=_0x5ba8e1||0xc8;return function(_0x990f07){if(_0x990f07){return _0x1a3945['status'](_0x5ba8e1)[_0x7948('0x2e')](_0x990f07);}};}function respondWithFilteredResult(_0xa31d36,_0x81155f){return function(_0x523377){if(_0x523377){var _0x3d5c53=_0x523377[_0x7948('0x2f')],_0x5c53d9=_0x81155f[_0x7948('0x30')],_0x21fd6b=_0x81155f[_0x7948('0x30')]+_0x81155f[_0x7948('0x31')],_0x179472;if(_0x21fd6b>=_0x3d5c53){_0x21fd6b=_0x3d5c53;_0x179472=0xc8;}else{_0x179472=0xce;}_0xa31d36[_0x7948('0x2c')](_0x179472);return _0xa31d36[_0x7948('0x32')](_0x7948('0x33'),_0x5c53d9+'-'+_0x21fd6b+'/'+_0x3d5c53)['json'](_0x523377);}return null;};}function patchUpdates(_0x40748a){return function(_0x5c89ad){try{jsonpatch[_0x7948('0x34')](_0x5c89ad,_0x40748a,!![]);}catch(_0x65f009){return BPromise[_0x7948('0x35')](_0x65f009);}return _0x5c89ad[_0x7948('0x36')]();};}function saveUpdates(_0x2e03ab,_0x2b96e5){return function(_0x259e17){if(_0x259e17){return _0x259e17[_0x7948('0x37')](_0x2e03ab)[_0x7948('0x1f')](function(_0x2d56fc){return _0x2d56fc;});}return null;};}function removeEntity(_0x5efdca,_0x411c26){return function(_0x1de33b){if(_0x1de33b){return _0x1de33b['destroy']()['then'](function(){var _0x4efe24=_0x1de33b[_0x7948('0x38')]({'plain':!![]});var _0x33ab6=_0x7948('0x39');return db['UserProfileResource'][_0x7948('0x3a')]({'where':{'type':_0x33ab6,'resourceId':_0x4efe24['id']}})[_0x7948('0x1f')](function(){return _0x1de33b;});})[_0x7948('0x1f')](function(){_0x5efdca[_0x7948('0x2c')](0xcc)[_0x7948('0x2d')]();});}};}function handleEntityNotFound(_0xc5b1e6,_0x5de339){return function(_0x53b696){if(!_0x53b696){_0xc5b1e6[_0x7948('0x2b')](0x194);}return _0x53b696;};}function handleError(_0x40884e,_0x4d1ad2){_0x4d1ad2=_0x4d1ad2||0x1f4;return function(_0x168507){logger[_0x7948('0x25')](_0x168507[_0x7948('0x3b')]);if(_0x168507['name']){delete _0x168507['name'];}_0x40884e[_0x7948('0x2c')](_0x4d1ad2)['send'](_0x168507);};}exports[_0x7948('0x3c')]=function(_0x3af957,_0x249408){var _0x48fb2a={},_0x310385={},_0x364f2e={'count':0x0,'rows':[]};var _0x18fca1=_['map'](db[_0x7948('0x3d')][_0x7948('0x3e')],function(_0x22f6d7){return{'name':_0x22f6d7['fieldName'],'type':_0x22f6d7[_0x7948('0x3f')][_0x7948('0x40')]};});_0x310385[_0x7948('0x41')]=_['map'](_0x18fca1,_0x7948('0x42'));_0x310385['query']=_['keys'](_0x3af957[_0x7948('0x43')]);_0x310385['filters']=_['intersection'](_0x310385[_0x7948('0x41')],_0x310385[_0x7948('0x43')]);_0x48fb2a['attributes']=_[_0x7948('0x44')](_0x310385[_0x7948('0x41')],qs[_0x7948('0x45')](_0x3af957[_0x7948('0x43')][_0x7948('0x45')]));_0x48fb2a[_0x7948('0x46')]=_0x48fb2a['attributes'][_0x7948('0x47')]?_0x48fb2a['attributes']:_0x310385[_0x7948('0x41')];if(!_0x3af957[_0x7948('0x43')][_0x7948('0x48')](_0x7948('0x49'))){_0x48fb2a['limit']=qs[_0x7948('0x31')](_0x3af957[_0x7948('0x43')][_0x7948('0x31')]);_0x48fb2a[_0x7948('0x30')]=qs[_0x7948('0x30')](_0x3af957[_0x7948('0x43')][_0x7948('0x30')]);}_0x48fb2a[_0x7948('0x4a')]=qs[_0x7948('0x4b')](_0x3af957[_0x7948('0x43')]['sort']);_0x48fb2a[_0x7948('0x4c')]=qs[_0x7948('0x4d')](_['pick'](_0x3af957[_0x7948('0x43')],_0x310385[_0x7948('0x4d')]),_0x18fca1);if(_0x3af957[_0x7948('0x43')][_0x7948('0x4e')]){_0x48fb2a['where']=_[_0x7948('0x4f')](_0x48fb2a[_0x7948('0x4c')],{'$or':_[_0x7948('0x50')](_0x18fca1,function(_0x3b29d1){if(_0x3b29d1[_0x7948('0x3f')]!==_0x7948('0x51')){var _0x1ec990={};_0x1ec990[_0x3b29d1[_0x7948('0x42')]]={'$like':'%'+_0x3af957[_0x7948('0x43')]['filter']+'%'};return _0x1ec990;}})});}_0x48fb2a=_[_0x7948('0x4f')]({},_0x48fb2a,_0x3af957[_0x7948('0x52')]);var _0x34d54c={'where':_0x48fb2a[_0x7948('0x4c')]};return db[_0x7948('0x3d')]['count'](_0x34d54c)['then'](function(_0x5c4c58){_0x364f2e['count']=_0x5c4c58;if(_0x3af957[_0x7948('0x43')]['includeAll']){_0x48fb2a[_0x7948('0x53')]=[{'all':!![]}];}return db[_0x7948('0x3d')]['findAll'](_0x48fb2a);})[_0x7948('0x1f')](function(_0x244d6e){_0x364f2e[_0x7948('0x54')]=_0x244d6e;return _0x364f2e;})['then'](respondWithFilteredResult(_0x249408,_0x48fb2a))['catch'](handleError(_0x249408,null));};exports[_0x7948('0x55')]=function(_0x5bb1be,_0x3e5230){var _0x3e9c36={'raw':!![],'where':{'id':_0x5bb1be[_0x7948('0x56')]['id']}},_0x5bc5f1={};_0x5bc5f1['model']=_[_0x7948('0x57')](db[_0x7948('0x3d')][_0x7948('0x3e')]);_0x5bc5f1[_0x7948('0x43')]=_[_0x7948('0x57')](_0x5bb1be[_0x7948('0x43')]);_0x5bc5f1['filters']=_[_0x7948('0x44')](_0x5bc5f1['model'],_0x5bc5f1[_0x7948('0x43')]);_0x3e9c36[_0x7948('0x46')]=_[_0x7948('0x44')](_0x5bc5f1['model'],qs[_0x7948('0x45')](_0x5bb1be[_0x7948('0x43')][_0x7948('0x45')]));_0x3e9c36['attributes']=_0x3e9c36[_0x7948('0x46')][_0x7948('0x47')]?_0x3e9c36['attributes']:_0x5bc5f1[_0x7948('0x41')];if(_0x5bb1be['query']['includeAll']){_0x3e9c36[_0x7948('0x53')]=[{'all':!![]}];}_0x3e9c36=_[_0x7948('0x4f')]({},_0x3e9c36,_0x5bb1be[_0x7948('0x52')]);return db[_0x7948('0x3d')][_0x7948('0x58')](_0x3e9c36)[_0x7948('0x1f')](handleEntityNotFound(_0x3e5230,null))[_0x7948('0x1f')](respondWithResult(_0x3e5230,null))[_0x7948('0x2a')](handleError(_0x3e5230,null));};exports[_0x7948('0x59')]=function(_0x2b9e4e,_0x3927b6){return db[_0x7948('0x3d')][_0x7948('0x59')](_0x2b9e4e[_0x7948('0x5a')],{})['then'](function(_0x34419f){var _0x1ed47f=_0x2b9e4e[_0x7948('0x5b')]['get']({'plain':!![]});if(!_0x1ed47f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ed47f[_0x7948('0x5c')]==='user'){var _0x1f3b3f=_0x34419f[_0x7948('0x38')]({'plain':!![]});var _0x67bbed=_0x7948('0x39');return db['UserProfileSection'][_0x7948('0x58')]({'where':{'name':_0x67bbed,'userProfileId':_0x1ed47f[_0x7948('0x5d')]},'raw':!![]})['then'](function(_0x332c5d){if(_0x332c5d&&_0x332c5d[_0x7948('0x5e')]===0x0){return db[_0x7948('0x5f')][_0x7948('0x59')]({'name':_0x1f3b3f[_0x7948('0x42')],'resourceId':_0x1f3b3f['id'],'type':_0x332c5d[_0x7948('0x42')],'sectionId':_0x332c5d['id']},{})[_0x7948('0x1f')](function(){return _0x34419f;});}else{return _0x34419f;}})['catch'](function(_0x3b7fdf){logger[_0x7948('0x25')](_0x7948('0x60'),_0x3b7fdf);throw _0x3b7fdf;});}return _0x34419f;})['then'](respondWithResult(_0x3927b6,0xc9))['catch'](handleError(_0x3927b6,null));};exports[_0x7948('0x37')]=function(_0x36faf5,_0x37eaa7){if(_0x36faf5[_0x7948('0x5a')]['id']){delete _0x36faf5[_0x7948('0x5a')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x36faf5[_0x7948('0x56')]['id']}})[_0x7948('0x1f')](handleEntityNotFound(_0x37eaa7,null))[_0x7948('0x1f')](saveUpdates(_0x36faf5[_0x7948('0x5a')],null))[_0x7948('0x1f')](respondWithResult(_0x37eaa7,null))[_0x7948('0x2a')](handleError(_0x37eaa7,null));};exports[_0x7948('0x3a')]=function(_0x576680,_0x267e6e){return db['ChatQueue'][_0x7948('0x58')]({'where':{'id':_0x576680['params']['id']}})[_0x7948('0x1f')](handleEntityNotFound(_0x267e6e,null))[_0x7948('0x1f')](removeEntity(_0x267e6e,null))['catch'](handleError(_0x267e6e,null));};exports[_0x7948('0x61')]=function(_0x59eb84,_0xea7d25){return db[_0x7948('0x3d')][_0x7948('0x61')]()[_0x7948('0x1f')](respondWithResult(_0xea7d25,null))[_0x7948('0x2a')](handleError(_0xea7d25,null));};exports['getMembers']=function(_0xaab1a0,_0x4b2d7d,_0x421103){var _0x47280b={'raw':!![],'where':{}},_0xe05a36={},_0x5b05ce;return db['ChatQueue'][_0x7948('0x62')]({'where':{'id':_0xaab1a0[_0x7948('0x56')]['id']}})[_0x7948('0x1f')](handleEntityNotFound(_0x4b2d7d,null))[_0x7948('0x1f')](function(_0x52f4e0){if(_0x52f4e0){_0x5b05ce=_0x52f4e0[_0x7948('0x38')]({'plain':!![]});_0xe05a36[_0x7948('0x41')]=_[_0x7948('0x57')](db['UserChatQueue'][_0x7948('0x3e')]);_0xe05a36[_0x7948('0x43')]=_[_0x7948('0x57')](_0xaab1a0[_0x7948('0x43')]);_0xe05a36[_0x7948('0x4d')]=_[_0x7948('0x44')](_0xe05a36[_0x7948('0x41')],_0xe05a36['query']);_0x47280b[_0x7948('0x46')]=_['intersection'](_0xe05a36[_0x7948('0x41')],qs[_0x7948('0x45')](_0xaab1a0[_0x7948('0x43')]['fields']));_0x47280b[_0x7948('0x46')]=_0x47280b['attributes'][_0x7948('0x47')]?_0x47280b[_0x7948('0x46')]:_0xe05a36[_0x7948('0x41')];if(!_0xaab1a0['query'][_0x7948('0x48')]('nolimit')){_0x47280b[_0x7948('0x31')]=qs[_0x7948('0x31')](_0xaab1a0[_0x7948('0x43')][_0x7948('0x31')]);_0x47280b[_0x7948('0x30')]=qs[_0x7948('0x30')](_0xaab1a0[_0x7948('0x43')][_0x7948('0x30')]);}_0x47280b[_0x7948('0x4a')]=qs[_0x7948('0x4b')](_0xaab1a0['query'][_0x7948('0x4b')]);_0x47280b[_0x7948('0x4c')]=qs[_0x7948('0x4d')](_[_0x7948('0x63')](_0xaab1a0['query'],_0xe05a36[_0x7948('0x4d')]));_0x47280b[_0x7948('0x4c')]['ChatQueueId']=_0x52f4e0['id'];if(_0xaab1a0['query'][_0x7948('0x4e')]){_0x47280b[_0x7948('0x4c')]=_[_0x7948('0x4f')](_0x47280b[_0x7948('0x4c')],{'$or':_[_0x7948('0x50')](_0x47280b[_0x7948('0x46')],function(_0x2daff8){var _0x1a253f={};_0x1a253f[_0x2daff8]={'$like':'%'+_0xaab1a0[_0x7948('0x43')][_0x7948('0x4e')]+'%'};return _0x1a253f;})});}_0x47280b=_[_0x7948('0x4f')]({},_0x47280b,_0xaab1a0['options']);return db['UserChatQueue'][_0x7948('0x64')](_0x47280b);}})[_0x7948('0x1f')](function(_0x262e1d){if(_0x262e1d){return db['User'][_0x7948('0x65')]({'where':{'id':_[_0x7948('0x50')](_0x262e1d,'UserId'),'role':_0x7948('0x66')},'attributes':['id',_0x7948('0x42'),_0x7948('0x67'),_0x7948('0x68'),_0x7948('0x69')]});}})['then'](function(_0x4135ab){if(_0x4135ab){return{'count':_0x4135ab[_0x7948('0x2f')],'rows':_[_0x7948('0x50')](_0x4135ab[_0x7948('0x54')],function(_0x280a0c){return{'membername':_0x280a0c[_0x7948('0x42')],'UserId':_0x280a0c['id'],'queue_name':_0x5b05ce['name'],'ChatQueueId':_0x5b05ce['id'],'interface':util[_0x7948('0x6a')]('%s/%s','SIP',_0x280a0c['name']),'penalty':0x0,'paused':_0x280a0c[_0x7948('0x67')],'createdAt':_0x280a0c['createdAt'],'updatedAt':_0x280a0c[_0x7948('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4b2d7d,_0x47280b))[_0x7948('0x2a')](handleError(_0x4b2d7d,null));};exports['getTeams']=function(_0x3b0af3,_0x1c2796,_0x293b6a){var _0x442e8e={};var _0x624e62={};var _0x3f8a49;var _0x1575db;return db[_0x7948('0x3d')][_0x7948('0x62')]({'where':{'id':_0x3b0af3[_0x7948('0x56')]['id']}})['then'](handleEntityNotFound(_0x1c2796,null))[_0x7948('0x1f')](function(_0x2269ac){if(_0x2269ac){_0x3f8a49=_0x2269ac;_0x624e62[_0x7948('0x41')]=_[_0x7948('0x57')](db[_0x7948('0x6b')][_0x7948('0x3e')]);_0x624e62[_0x7948('0x43')]=_['keys'](_0x3b0af3[_0x7948('0x43')]);_0x624e62[_0x7948('0x4d')]=_[_0x7948('0x44')](_0x624e62[_0x7948('0x41')],_0x624e62[_0x7948('0x43')]);_0x442e8e[_0x7948('0x46')]=_[_0x7948('0x44')](_0x624e62[_0x7948('0x41')],qs['fields'](_0x3b0af3[_0x7948('0x43')][_0x7948('0x45')]));_0x442e8e['attributes']=_0x442e8e[_0x7948('0x46')][_0x7948('0x47')]?_0x442e8e['attributes']:_0x624e62['model'];_0x442e8e[_0x7948('0x4a')]=qs[_0x7948('0x4b')](_0x3b0af3['query'][_0x7948('0x4b')]);_0x442e8e[_0x7948('0x4c')]=qs[_0x7948('0x4d')](_[_0x7948('0x63')](_0x3b0af3[_0x7948('0x43')],_0x624e62[_0x7948('0x4d')]));if(_0x3b0af3['query'][_0x7948('0x4e')]){_0x442e8e[_0x7948('0x4c')]=_[_0x7948('0x4f')](_0x442e8e['where'],{'$or':_['map'](_0x442e8e[_0x7948('0x46')],function(_0x2828c1){var _0x1e9d1f={};_0x1e9d1f[_0x2828c1]={'$like':'%'+_0x3b0af3[_0x7948('0x43')][_0x7948('0x4e')]+'%'};return _0x1e9d1f;})});}_0x442e8e=_[_0x7948('0x4f')]({},_0x442e8e,_0x3b0af3[_0x7948('0x52')]);return _0x3f8a49[_0x7948('0x6c')](_0x442e8e);}})['then'](function(_0x4629f4){if(_0x4629f4){_0x1575db=_0x4629f4['length'];if(!_0x3b0af3[_0x7948('0x43')][_0x7948('0x48')](_0x7948('0x49'))){_0x442e8e['limit']=qs['limit'](_0x3b0af3[_0x7948('0x43')][_0x7948('0x31')]);_0x442e8e[_0x7948('0x30')]=qs[_0x7948('0x30')](_0x3b0af3[_0x7948('0x43')][_0x7948('0x30')]);}return _0x3f8a49['getTeams'](_0x442e8e);}})['then'](function(_0x83e940){if(_0x83e940){return _0x83e940?{'count':_0x1575db,'rows':_0x83e940}:null;}})[_0x7948('0x1f')](respondWithResult(_0x1c2796,null))[_0x7948('0x2a')](handleError(_0x1c2796,null));};exports['addTeams']=function(_0x4ad5d5,_0x3dc1e6,_0x40892c){var _0x3187de=_0x4ad5d5[_0x7948('0x5a')][_0x7948('0x6d')];return db[_0x7948('0x6b')][_0x7948('0x64')]({'where':{'id':_0x3187de},'attributes':['id'],'include':[{'model':db[_0x7948('0x6e')],'as':_0x7948('0x6f'),'attributes':['id','name',_0x7948('0x70'),_0x7948('0x71'),'interface'],'raw':!![]}]})[_0x7948('0x1f')](function(_0x126089){if(_0x126089){var _0x293a66=_[_0x7948('0x72')](_0x126089,function(_0x5c02ca){var _0x596828=_0x5c02ca['get']({'plain':!![]});return _0x596828[_0x7948('0x6f')];});return db[_0x7948('0x3d')][_0x7948('0x58')]({'where':{'id':_0x4ad5d5[_0x7948('0x56')]['id']}})[_0x7948('0x1f')](function(_0x1fa22f){return db['sequelize'][_0x7948('0x73')](function(_0x47f1ee){return _0x1fa22f[_0x7948('0x74')](_0x3187de,{'transaction':_0x47f1ee})[_0x7948('0x1f')](function(){return BPromise[_0x7948('0x75')](_0x293a66,function(_0xc76cd1){return db[_0x7948('0x76')][_0x7948('0x77')]({'where':{'UserId':_0xc76cd1['id'],'ChatQueueId':_0x4ad5d5[_0x7948('0x56')]['id']},'transaction':_0x47f1ee});});})['then'](function(){_0x293a66[_0x7948('0x78')](function(_0x3086af){socket[_0x7948('0x79')]('userChatQueue:save',{'UserId':_0x3086af['id'],'ChatQueueId':_0x1fa22f['id']});});});});});}})[_0x7948('0x1f')](respondWithStatusCode(_0x3dc1e6,null))[_0x7948('0x2a')](handleError(_0x3dc1e6,null));};exports[_0x7948('0x7a')]=function(_0x5cfd89,_0x3f4ff2,_0x3b0ed4){return db['Team'][_0x7948('0x64')]({'where':{'id':_0x5cfd89[_0x7948('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7948('0x6e')],'as':_0x7948('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x7948('0x1f')](handleEntityNotFound(_0x3f4ff2,null))['then'](function(_0x28ab13){var _0x484e02=_['map'](_0x28ab13,'id');var _0x43c66d=[];var _0x28fa22=[];var _0x52acdc=squel[_0x7948('0x7b')]();_0x52acdc[_0x7948('0x7c')](_0x7948('0x7d'))[_0x7948('0x7e')]('team_has_chat_queues','tq')[_0x7948('0x7f')](_0x7948('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7948('0x4c')](_0x7948('0x81'),_0x5cfd89[_0x7948('0x56')]['id']);for(var _0x4dac5f=0x0;_0x4dac5f<_0x28ab13[_0x7948('0x47')];_0x4dac5f+=0x1){let _0x537d28=_0x28ab13[_0x4dac5f];for(var _0xd0f61=0x0;_0xd0f61<_0x537d28[_0x7948('0x6f')][_0x7948('0x47')];_0xd0f61+=0x1){let _0x9326c4=_0x537d28[_0x7948('0x6f')][_0xd0f61];var _0x56f57a=_0x52acdc[_0x7948('0x82')]();_0x56f57a['where'](_0x7948('0x83'),_0x9326c4['id']);_0x28fa22[_0x7948('0x84')](db['sequelize']['query'](_0x56f57a[_0x7948('0x85')](),{'type':db['sequelize'][_0x7948('0x86')]['SELECT']})[_0x7948('0x1f')](function(_0x274acc){if(_0x274acc[_0x7948('0x47')]===0x1){return _0x9326c4['id'];}else{var _0x95f107=_['every'](_[_0x7948('0x50')](_0x274acc,'TeamId'),function(_0x57961d){return _[_0x7948('0x87')](_0x484e02,_0x57961d);});if(_0x95f107){return _0x9326c4['id'];}}}));}}return BPromise[_0x7948('0x88')](_0x28fa22)['then'](function(_0x5de866){_0x43c66d=_(_0x43c66d)[_0x7948('0x89')](_0x5de866)[_0x7948('0x8a')]()['value']();return db[_0x7948('0x3d')][_0x7948('0x58')]({'where':{'id':_0x5cfd89['params']['id']}})[_0x7948('0x1f')](function(_0x4a1f5b){return db[_0x7948('0x8b')][_0x7948('0x73')](function(_0x7d6230){return _0x4a1f5b[_0x7948('0x7a')](_0x5cfd89[_0x7948('0x43')]['ids'],{'transaction':_0x7d6230})[_0x7948('0x1f')](function(){if(!_[_0x7948('0x8c')](_0x43c66d)){return _0x4a1f5b[_0x7948('0x8d')](_0x43c66d,{'transaction':_0x7d6230});}})[_0x7948('0x1f')](function(){_0x43c66d[_0x7948('0x78')](function(_0xb64c12){socket[_0x7948('0x79')](_0x7948('0x8e'),{'UserId':_0xb64c12,'ChatQueueId':_0x4a1f5b['id']});});});});});});})[_0x7948('0x1f')](respondWithStatusCode(_0x3f4ff2,null))[_0x7948('0x2a')](handleError(_0x3f4ff2,null));};exports[_0x7948('0x8f')]=function(_0x2bdd16,_0x402cda,_0x1b1a2f){return db[_0x7948('0x3d')][_0x7948('0x58')]({'where':{'id':_0x2bdd16[_0x7948('0x56')]['id']}})[_0x7948('0x1f')](handleEntityNotFound(_0x402cda,null))[_0x7948('0x1f')](function(_0x5be970){if(_0x5be970){return _0x5be970[_0x7948('0x8f')](_0x2bdd16[_0x7948('0x5a')][_0x7948('0x6d')],_[_0x7948('0x90')](_0x2bdd16[_0x7948('0x5a')],[_0x7948('0x6d'),'id'])||{})[_0x7948('0x91')](function(_0x28b1c2){for(var _0x1821d0=0x0;_0x1821d0<_0x2bdd16[_0x7948('0x5a')][_0x7948('0x6d')][_0x7948('0x47')];_0x1821d0+=0x1){socket[_0x7948('0x79')]('userChatQueue:save',{'UserId':_0x2bdd16[_0x7948('0x5a')][_0x7948('0x6d')][_0x1821d0],'ChatQueueId':_0x2bdd16[_0x7948('0x56')]['id']});}return _0x28b1c2;});}})[_0x7948('0x1f')](respondWithResult(_0x402cda,null))[_0x7948('0x2a')](handleError(_0x402cda,null));};exports[_0x7948('0x8d')]=function(_0x13f862,_0x40f16b,_0x4fc92e){return db['ChatQueue'][_0x7948('0x58')]({'where':{'id':_0x13f862['params']['id']}})[_0x7948('0x1f')](handleEntityNotFound(_0x40f16b,null))[_0x7948('0x1f')](function(_0x1f1bf3){if(_0x1f1bf3){return _0x1f1bf3[_0x7948('0x8d')](_0x13f862[_0x7948('0x43')][_0x7948('0x6d')])[_0x7948('0x1f')](function(){if(_[_0x7948('0x92')](_0x13f862[_0x7948('0x43')][_0x7948('0x6d')])){for(var _0x46fab6=0x0;_0x46fab6<_0x13f862['query'][_0x7948('0x6d')]['length'];_0x46fab6+=0x1){socket[_0x7948('0x79')](_0x7948('0x8e'),{'UserId':Number(_0x13f862[_0x7948('0x43')][_0x7948('0x6d')][_0x46fab6]),'ChatQueueId':Number(_0x13f862[_0x7948('0x56')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x13f862[_0x7948('0x43')][_0x7948('0x6d')]),'ChatQueueId':Number(_0x13f862['params']['id'])});}});}})[_0x7948('0x1f')](respondWithStatusCode(_0x40f16b,null))[_0x7948('0x2a')](handleError(_0x40f16b,null));};exports[_0x7948('0x93')]=function(_0x156508,_0xde5617,_0x22f727){var _0xf63c13={};var _0x4bfcb3={};var _0x11ad23;var _0x927a65;return db[_0x7948('0x3d')][_0x7948('0x62')]({'where':{'id':_0x156508[_0x7948('0x56')]['id']}})[_0x7948('0x1f')](handleEntityNotFound(_0xde5617,null))['then'](function(_0x1eb0a9){if(_0x1eb0a9){_0x11ad23=_0x1eb0a9;_0x4bfcb3[_0x7948('0x41')]=_[_0x7948('0x57')](db[_0x7948('0x6e')][_0x7948('0x3e')]);_0x4bfcb3[_0x7948('0x43')]=_[_0x7948('0x57')](_0x156508[_0x7948('0x43')]);_0x4bfcb3[_0x7948('0x4d')]=_[_0x7948('0x44')](_0x4bfcb3[_0x7948('0x41')],_0x4bfcb3[_0x7948('0x43')]);_0xf63c13['attributes']=_['intersection'](_0x4bfcb3[_0x7948('0x41')],qs[_0x7948('0x45')](_0x156508[_0x7948('0x43')][_0x7948('0x45')]));_0xf63c13['attributes']=_0xf63c13['attributes'][_0x7948('0x47')]?_0xf63c13['attributes']:_0x4bfcb3['model'];_0xf63c13[_0x7948('0x4a')]=qs['sort'](_0x156508[_0x7948('0x43')]['sort']);_0xf63c13[_0x7948('0x4c')]=qs[_0x7948('0x4d')](_[_0x7948('0x63')](_0x156508['query'],_0x4bfcb3[_0x7948('0x4d')]));if(_0x156508[_0x7948('0x43')][_0x7948('0x4e')]){_0xf63c13['where']=_[_0x7948('0x4f')](_0xf63c13[_0x7948('0x4c')],{'$or':_[_0x7948('0x50')](_0xf63c13[_0x7948('0x46')],function(_0x404795){var _0x40487f={};_0x40487f[_0x404795]={'$like':'%'+_0x156508['query'][_0x7948('0x4e')]+'%'};return _0x40487f;})});}_0xf63c13=_[_0x7948('0x4f')]({},_0xf63c13,_0x156508['options']);return _0x11ad23[_0x7948('0x93')](_0xf63c13);}})['then'](function(_0x1c07d6){if(_0x1c07d6){_0x927a65=_0x1c07d6[_0x7948('0x47')];if(!_0x156508[_0x7948('0x43')][_0x7948('0x48')](_0x7948('0x49'))){_0xf63c13['limit']=qs[_0x7948('0x31')](_0x156508['query'][_0x7948('0x31')]);_0xf63c13[_0x7948('0x30')]=qs[_0x7948('0x30')](_0x156508[_0x7948('0x43')][_0x7948('0x30')]);}return _0x11ad23[_0x7948('0x93')](_0xf63c13);}})[_0x7948('0x1f')](function(_0x442224){if(_0x442224){return _0x442224?{'count':_0x927a65,'rows':_0x442224}:null;}})[_0x7948('0x1f')](respondWithResult(_0xde5617,null))[_0x7948('0x2a')](handleError(_0xde5617,null));};
\ No newline at end of file
+var _0x60b3=['params','keys','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','order','sort','ChatQueueId','findAll','User','findAndCountAll','UserId','chatPause','format','SIP','updatedAt','Team','getTeams','addTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','all','union','value','isEmpty','forEach','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','./chatQueue.socket','register','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','stack','name','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','rows'];(function(_0x1e1ad3,_0x11ae45){var _0x16aacf=function(_0x5eedd1){while(--_0x5eedd1){_0x1e1ad3['push'](_0x1e1ad3['shift']());}};_0x16aacf(++_0x11ae45);}(_0x60b3,0xd5));var _0x360b=function(_0x56ab7e,_0x3d47af){_0x56ab7e=_0x56ab7e-0x0;var _0x4205b9=_0x60b3[_0x56ab7e];return _0x4205b9;};'use strict';var pdf=require(_0x360b('0x0'));var emlformat=require(_0x360b('0x1'));var rimraf=require(_0x360b('0x2'));var zipdir=require(_0x360b('0x3'));var jsonpatch=require(_0x360b('0x4'));var rp=require(_0x360b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x360b('0x6'));var path=require(_0x360b('0x7'));var sox=require(_0x360b('0x8'));var csv=require(_0x360b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x360b('0xa'));var squel=require(_0x360b('0xb'));var crypto=require(_0x360b('0xc'));var jsforce=require(_0x360b('0xd'));var deskjs=require(_0x360b('0xe'));var toCsv=require(_0x360b('0x9'));var querystring=require(_0x360b('0xf'));var Papa=require(_0x360b('0x10'));var Redis=require(_0x360b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x360b('0x12'));var hardwareService=require(_0x360b('0x13'));var logger=require('../../config/logger')(_0x360b('0x14'));var utils=require(_0x360b('0x15'));var config=require(_0x360b('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x360b('0x17')](config[_0x360b('0x18')],{'host':_0x360b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x360b('0x18')]));require(_0x360b('0x1a'))[_0x360b('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x360b('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x10bc72,_0x58e0d4,_0x26cde2){if(_0x26cde2){var _0x15331a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15331a[_0x360b('0x1d')](_0x58e0d4)){return _0x10bc72;}else{throw new db[(_0x360b('0x1e'))][(_0x360b('0x1f'))](_0x360b('0x20'));}}else{return _0x10bc72;}}function respondWithRpcPromise(_0x30ae7d,_0x4e0203,_0x479386,_0x5b743c){return new BPromise(function(_0x2c2bfe,_0x5343cb){var _0x2bf71f=_0x5b743c||client;return _0x2bf71f[_0x360b('0x21')](_0x30ae7d,_0x479386)[_0x360b('0x22')](function(_0x63e37e){logger[_0x360b('0x23')](_0x360b('0x24'),_0x4e0203,'request\x20sent');logger['debug'](_0x360b('0x25'),_0x4e0203,_0x360b('0x26'),JSON[_0x360b('0x27')](_0x63e37e));if(_0x63e37e[_0x360b('0x28')]){if(_0x63e37e[_0x360b('0x28')]['code']===0x1f4){logger[_0x360b('0x28')]('ChatQueue,\x20%s,\x20%s',_0x4e0203,_0x63e37e[_0x360b('0x28')][_0x360b('0x29')]);return _0x5343cb(_0x63e37e[_0x360b('0x28')][_0x360b('0x29')]);}logger['error'](_0x360b('0x24'),_0x4e0203,_0x63e37e[_0x360b('0x28')][_0x360b('0x29')]);return _0x2c2bfe(_0x63e37e[_0x360b('0x28')]['message']);}else{logger[_0x360b('0x23')](_0x360b('0x24'),_0x4e0203,_0x360b('0x26'));_0x2c2bfe(_0x63e37e['result'][_0x360b('0x29')]);}})[_0x360b('0x2a')](function(_0x6f12bf){logger[_0x360b('0x28')](_0x360b('0x24'),_0x4e0203,_0x6f12bf);_0x5343cb(_0x6f12bf);});});}function respondWithStatusCode(_0x2e8f03,_0x88c039){_0x88c039=_0x88c039||0xcc;return function(_0x37430f){if(_0x37430f){return _0x2e8f03[_0x360b('0x2b')](_0x88c039);}return _0x2e8f03[_0x360b('0x2c')](_0x88c039)[_0x360b('0x2d')]();};}function respondWithResult(_0x1928e3,_0x2faf00){_0x2faf00=_0x2faf00||0xc8;return function(_0x1c5710){if(_0x1c5710){return _0x1928e3[_0x360b('0x2c')](_0x2faf00)[_0x360b('0x2e')](_0x1c5710);}};}function respondWithFilteredResult(_0x31cd9e,_0x5d9fbd){return function(_0xbabd90){if(_0xbabd90){var _0x2fc31d=_0xbabd90[_0x360b('0x2f')],_0x3a29d4=_0x5d9fbd[_0x360b('0x30')],_0x4b092d=_0x5d9fbd['offset']+_0x5d9fbd[_0x360b('0x31')],_0x3fe618;if(_0x4b092d>=_0x2fc31d){_0x4b092d=_0x2fc31d;_0x3fe618=0xc8;}else{_0x3fe618=0xce;}_0x31cd9e['status'](_0x3fe618);return _0x31cd9e['set'](_0x360b('0x32'),_0x3a29d4+'-'+_0x4b092d+'/'+_0x2fc31d)[_0x360b('0x2e')](_0xbabd90);}return null;};}function patchUpdates(_0x1c4cb9){return function(_0x11116d){try{jsonpatch[_0x360b('0x33')](_0x11116d,_0x1c4cb9,!![]);}catch(_0x5951e2){return BPromise[_0x360b('0x34')](_0x5951e2);}return _0x11116d['save']();};}function saveUpdates(_0x19604a,_0x9865e4){return function(_0x4a033d){if(_0x4a033d){return _0x4a033d[_0x360b('0x35')](_0x19604a)[_0x360b('0x22')](function(_0x21b474){return _0x21b474;});}return null;};}function removeEntity(_0x41c304,_0x2f6fbe){return function(_0x3b60be){if(_0x3b60be){return _0x3b60be[_0x360b('0x36')]()['then'](function(){var _0x3ff9d8=_0x3b60be[_0x360b('0x37')]({'plain':!![]});var _0x5737cf=_0x360b('0x38');return db[_0x360b('0x39')][_0x360b('0x36')]({'where':{'type':_0x5737cf,'resourceId':_0x3ff9d8['id']}})[_0x360b('0x22')](function(){return _0x3b60be;});})[_0x360b('0x22')](function(){_0x41c304[_0x360b('0x2c')](0xcc)[_0x360b('0x2d')]();});}};}function handleEntityNotFound(_0x18e086,_0x45cf39){return function(_0x1e5e47){if(!_0x1e5e47){_0x18e086[_0x360b('0x2b')](0x194);}return _0x1e5e47;};}function handleError(_0x4c32cc,_0x27d7ed){_0x27d7ed=_0x27d7ed||0x1f4;return function(_0x56361a){logger[_0x360b('0x28')](_0x56361a[_0x360b('0x3a')]);if(_0x56361a[_0x360b('0x3b')]){delete _0x56361a[_0x360b('0x3b')];}_0x4c32cc[_0x360b('0x2c')](_0x27d7ed)['send'](_0x56361a);};}exports[_0x360b('0x3c')]=function(_0x5b5b5d,_0x329c46){var _0x3a0f9c={},_0x45d39c={},_0x235f47={'count':0x0,'rows':[]};var _0x1002ad=_['map'](db[_0x360b('0x3d')][_0x360b('0x3e')],function(_0x19a8d2){return{'name':_0x19a8d2[_0x360b('0x3f')],'type':_0x19a8d2[_0x360b('0x40')][_0x360b('0x41')]};});_0x45d39c[_0x360b('0x42')]=_[_0x360b('0x43')](_0x1002ad,_0x360b('0x3b'));_0x45d39c[_0x360b('0x44')]=_['keys'](_0x5b5b5d['query']);_0x45d39c[_0x360b('0x45')]=_[_0x360b('0x46')](_0x45d39c[_0x360b('0x42')],_0x45d39c[_0x360b('0x44')]);_0x3a0f9c['attributes']=_[_0x360b('0x46')](_0x45d39c[_0x360b('0x42')],qs['fields'](_0x5b5b5d[_0x360b('0x44')][_0x360b('0x47')]));_0x3a0f9c[_0x360b('0x48')]=_0x3a0f9c[_0x360b('0x48')][_0x360b('0x49')]?_0x3a0f9c[_0x360b('0x48')]:_0x45d39c['model'];if(!_0x5b5b5d['query'][_0x360b('0x4a')](_0x360b('0x4b'))){_0x3a0f9c['limit']=qs[_0x360b('0x31')](_0x5b5b5d['query'][_0x360b('0x31')]);_0x3a0f9c[_0x360b('0x30')]=qs[_0x360b('0x30')](_0x5b5b5d[_0x360b('0x44')]['offset']);}_0x3a0f9c['order']=qs['sort'](_0x5b5b5d['query']['sort']);_0x3a0f9c[_0x360b('0x4c')]=qs['filters'](_[_0x360b('0x4d')](_0x5b5b5d[_0x360b('0x44')],_0x45d39c['filters']),_0x1002ad);if(_0x5b5b5d['query'][_0x360b('0x4e')]){_0x3a0f9c['where']=_['merge'](_0x3a0f9c['where'],{'$or':_[_0x360b('0x43')](_0x1002ad,function(_0x4a66ca){if(_0x4a66ca[_0x360b('0x40')]!=='VIRTUAL'){var _0x240f78={};_0x240f78[_0x4a66ca[_0x360b('0x3b')]]={'$like':'%'+_0x5b5b5d['query'][_0x360b('0x4e')]+'%'};return _0x240f78;}})});}_0x3a0f9c=_[_0x360b('0x4f')]({},_0x3a0f9c,_0x5b5b5d[_0x360b('0x50')]);var _0x1d698c={'where':_0x3a0f9c['where']};return db[_0x360b('0x3d')]['count'](_0x1d698c)[_0x360b('0x22')](function(_0x485575){_0x235f47[_0x360b('0x2f')]=_0x485575;if(_0x5b5b5d[_0x360b('0x44')][_0x360b('0x51')]){_0x3a0f9c['include']=[{'all':!![]}];}return db[_0x360b('0x3d')]['findAll'](_0x3a0f9c);})[_0x360b('0x22')](function(_0x316367){_0x235f47[_0x360b('0x52')]=_0x316367;return _0x235f47;})[_0x360b('0x22')](respondWithFilteredResult(_0x329c46,_0x3a0f9c))['catch'](handleError(_0x329c46,null));};exports['show']=function(_0x33d013,_0x35a668){var _0x242874={'raw':!![],'where':{'id':_0x33d013[_0x360b('0x53')]['id']}},_0x26f95a={};_0x26f95a[_0x360b('0x42')]=_[_0x360b('0x54')](db[_0x360b('0x3d')][_0x360b('0x3e')]);_0x26f95a[_0x360b('0x44')]=_[_0x360b('0x54')](_0x33d013[_0x360b('0x44')]);_0x26f95a[_0x360b('0x45')]=_[_0x360b('0x46')](_0x26f95a[_0x360b('0x42')],_0x26f95a['query']);_0x242874['attributes']=_[_0x360b('0x46')](_0x26f95a[_0x360b('0x42')],qs[_0x360b('0x47')](_0x33d013[_0x360b('0x44')][_0x360b('0x47')]));_0x242874[_0x360b('0x48')]=_0x242874[_0x360b('0x48')][_0x360b('0x49')]?_0x242874[_0x360b('0x48')]:_0x26f95a[_0x360b('0x42')];if(_0x33d013[_0x360b('0x44')][_0x360b('0x51')]){_0x242874[_0x360b('0x55')]=[{'all':!![]}];}_0x242874=_[_0x360b('0x4f')]({},_0x242874,_0x33d013[_0x360b('0x50')]);return db[_0x360b('0x3d')]['find'](_0x242874)[_0x360b('0x22')](handleEntityNotFound(_0x35a668,null))[_0x360b('0x22')](respondWithResult(_0x35a668,null))[_0x360b('0x2a')](handleError(_0x35a668,null));};exports[_0x360b('0x56')]=function(_0x49cef1,_0x50c83a){return db[_0x360b('0x3d')][_0x360b('0x56')](_0x49cef1['body'],{})[_0x360b('0x22')](function(_0x4ac6d3){var _0x49ebfa=_0x49cef1[_0x360b('0x57')][_0x360b('0x37')]({'plain':!![]});if(!_0x49ebfa)throw new Error(_0x360b('0x58'));if(_0x49ebfa['role']===_0x360b('0x57')){var _0x57ad85=_0x4ac6d3[_0x360b('0x37')]({'plain':!![]});var _0x23fc53=_0x360b('0x38');return db[_0x360b('0x59')][_0x360b('0x5a')]({'where':{'name':_0x23fc53,'userProfileId':_0x49ebfa[_0x360b('0x5b')]},'raw':!![]})[_0x360b('0x22')](function(_0x2d6877){if(_0x2d6877&&_0x2d6877[_0x360b('0x5c')]===0x0){return db[_0x360b('0x39')][_0x360b('0x56')]({'name':_0x57ad85['name'],'resourceId':_0x57ad85['id'],'type':_0x2d6877['name'],'sectionId':_0x2d6877['id']},{})[_0x360b('0x22')](function(){return _0x4ac6d3;});}else{return _0x4ac6d3;}})[_0x360b('0x2a')](function(_0x376778){logger[_0x360b('0x28')](_0x360b('0x5d'),_0x376778);throw _0x376778;});}return _0x4ac6d3;})[_0x360b('0x22')](respondWithResult(_0x50c83a,0xc9))[_0x360b('0x2a')](handleError(_0x50c83a,null));};exports[_0x360b('0x35')]=function(_0x10c583,_0x4d8aa4){if(_0x10c583[_0x360b('0x5e')]['id']){delete _0x10c583['body']['id'];}return db[_0x360b('0x3d')][_0x360b('0x5a')]({'where':{'id':_0x10c583[_0x360b('0x53')]['id']}})['then'](handleEntityNotFound(_0x4d8aa4,null))[_0x360b('0x22')](saveUpdates(_0x10c583[_0x360b('0x5e')],null))[_0x360b('0x22')](respondWithResult(_0x4d8aa4,null))[_0x360b('0x2a')](handleError(_0x4d8aa4,null));};exports['destroy']=function(_0x5e9390,_0xd2b0a8){return db['ChatQueue'][_0x360b('0x5a')]({'where':{'id':_0x5e9390['params']['id']}})[_0x360b('0x22')](handleEntityNotFound(_0xd2b0a8,null))['then'](removeEntity(_0xd2b0a8,null))['catch'](handleError(_0xd2b0a8,null));};exports['describe']=function(_0x15152c,_0x1a0092){return db[_0x360b('0x3d')][_0x360b('0x5f')]()[_0x360b('0x22')](respondWithResult(_0x1a0092,null))[_0x360b('0x2a')](handleError(_0x1a0092,null));};exports['getMembers']=function(_0x58b25d,_0x3d6b03,_0x1cc15c){var _0x271765={'raw':!![],'where':{}},_0x4bd768={},_0x5167de;return db[_0x360b('0x3d')][_0x360b('0x60')]({'where':{'id':_0x58b25d['params']['id']}})['then'](handleEntityNotFound(_0x3d6b03,null))[_0x360b('0x22')](function(_0xfc668e){if(_0xfc668e){_0x5167de=_0xfc668e['get']({'plain':!![]});_0x4bd768['model']=_[_0x360b('0x54')](db[_0x360b('0x61')][_0x360b('0x3e')]);_0x4bd768[_0x360b('0x44')]=_['keys'](_0x58b25d[_0x360b('0x44')]);_0x4bd768[_0x360b('0x45')]=_[_0x360b('0x46')](_0x4bd768[_0x360b('0x42')],_0x4bd768['query']);_0x271765[_0x360b('0x48')]=_['intersection'](_0x4bd768[_0x360b('0x42')],qs[_0x360b('0x47')](_0x58b25d['query'][_0x360b('0x47')]));_0x271765[_0x360b('0x48')]=_0x271765[_0x360b('0x48')][_0x360b('0x49')]?_0x271765[_0x360b('0x48')]:_0x4bd768[_0x360b('0x42')];if(!_0x58b25d['query']['hasOwnProperty'](_0x360b('0x4b'))){_0x271765[_0x360b('0x31')]=qs[_0x360b('0x31')](_0x58b25d['query'][_0x360b('0x31')]);_0x271765['offset']=qs[_0x360b('0x30')](_0x58b25d[_0x360b('0x44')]['offset']);}_0x271765[_0x360b('0x62')]=qs[_0x360b('0x63')](_0x58b25d[_0x360b('0x44')]['sort']);_0x271765[_0x360b('0x4c')]=qs[_0x360b('0x45')](_[_0x360b('0x4d')](_0x58b25d['query'],_0x4bd768[_0x360b('0x45')]));_0x271765[_0x360b('0x4c')][_0x360b('0x64')]=_0xfc668e['id'];if(_0x58b25d[_0x360b('0x44')]['filter']){_0x271765[_0x360b('0x4c')]=_[_0x360b('0x4f')](_0x271765['where'],{'$or':_[_0x360b('0x43')](_0x271765[_0x360b('0x48')],function(_0x427d6f){var _0x20b8ea={};_0x20b8ea[_0x427d6f]={'$like':'%'+_0x58b25d[_0x360b('0x44')][_0x360b('0x4e')]+'%'};return _0x20b8ea;})});}_0x271765=_['merge']({},_0x271765,_0x58b25d[_0x360b('0x50')]);return db[_0x360b('0x61')][_0x360b('0x65')](_0x271765);}})[_0x360b('0x22')](function(_0x1bd5b1){if(_0x1bd5b1){return db[_0x360b('0x66')][_0x360b('0x67')]({'where':{'id':_[_0x360b('0x43')](_0x1bd5b1,_0x360b('0x68')),'role':'agent'},'attributes':['id',_0x360b('0x3b'),_0x360b('0x69'),'updatedAt','createdAt']});}})['then'](function(_0x1fecb1){if(_0x1fecb1){return{'count':_0x1fecb1[_0x360b('0x2f')],'rows':_['map'](_0x1fecb1[_0x360b('0x52')],function(_0x39efbb){return{'membername':_0x39efbb[_0x360b('0x3b')],'UserId':_0x39efbb['id'],'queue_name':_0x5167de['name'],'ChatQueueId':_0x5167de['id'],'interface':util[_0x360b('0x6a')]('%s/%s',_0x360b('0x6b'),_0x39efbb[_0x360b('0x3b')]),'penalty':0x0,'paused':_0x39efbb[_0x360b('0x69')],'createdAt':_0x39efbb['createdAt'],'updatedAt':_0x39efbb[_0x360b('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x360b('0x22')](respondWithFilteredResult(_0x3d6b03,_0x271765))['catch'](handleError(_0x3d6b03,null));};exports['getTeams']=function(_0x581d32,_0x1fb6f7,_0x4653ae){var _0x53776d={};var _0x5ac6b5={};var _0x448427;var _0x4a4be7;return db[_0x360b('0x3d')][_0x360b('0x60')]({'where':{'id':_0x581d32[_0x360b('0x53')]['id']}})[_0x360b('0x22')](handleEntityNotFound(_0x1fb6f7,null))['then'](function(_0x426a59){if(_0x426a59){_0x448427=_0x426a59;_0x5ac6b5[_0x360b('0x42')]=_[_0x360b('0x54')](db[_0x360b('0x6d')][_0x360b('0x3e')]);_0x5ac6b5['query']=_['keys'](_0x581d32[_0x360b('0x44')]);_0x5ac6b5[_0x360b('0x45')]=_['intersection'](_0x5ac6b5['model'],_0x5ac6b5['query']);_0x53776d[_0x360b('0x48')]=_[_0x360b('0x46')](_0x5ac6b5[_0x360b('0x42')],qs[_0x360b('0x47')](_0x581d32['query'][_0x360b('0x47')]));_0x53776d[_0x360b('0x48')]=_0x53776d['attributes'][_0x360b('0x49')]?_0x53776d[_0x360b('0x48')]:_0x5ac6b5[_0x360b('0x42')];_0x53776d[_0x360b('0x62')]=qs[_0x360b('0x63')](_0x581d32[_0x360b('0x44')][_0x360b('0x63')]);_0x53776d[_0x360b('0x4c')]=qs[_0x360b('0x45')](_[_0x360b('0x4d')](_0x581d32[_0x360b('0x44')],_0x5ac6b5[_0x360b('0x45')]));if(_0x581d32[_0x360b('0x44')][_0x360b('0x4e')]){_0x53776d[_0x360b('0x4c')]=_[_0x360b('0x4f')](_0x53776d[_0x360b('0x4c')],{'$or':_[_0x360b('0x43')](_0x53776d[_0x360b('0x48')],function(_0x39c4ab){var _0x75a658={};_0x75a658[_0x39c4ab]={'$like':'%'+_0x581d32['query']['filter']+'%'};return _0x75a658;})});}_0x53776d=_['merge']({},_0x53776d,_0x581d32[_0x360b('0x50')]);return _0x448427['getTeams'](_0x53776d);}})['then'](function(_0x502c90){if(_0x502c90){_0x4a4be7=_0x502c90['length'];if(!_0x581d32[_0x360b('0x44')][_0x360b('0x4a')]('nolimit')){_0x53776d[_0x360b('0x31')]=qs['limit'](_0x581d32[_0x360b('0x44')][_0x360b('0x31')]);_0x53776d[_0x360b('0x30')]=qs[_0x360b('0x30')](_0x581d32[_0x360b('0x44')][_0x360b('0x30')]);}return _0x448427[_0x360b('0x6e')](_0x53776d);}})[_0x360b('0x22')](function(_0x1187bc){if(_0x1187bc){return _0x1187bc?{'count':_0x4a4be7,'rows':_0x1187bc}:null;}})[_0x360b('0x22')](respondWithResult(_0x1fb6f7,null))['catch'](handleError(_0x1fb6f7,null));};exports[_0x360b('0x6f')]=function(_0x229aba,_0x293350,_0x13a2f3){var _0x5aafaa=_0x229aba[_0x360b('0x5e')][_0x360b('0x70')];return db['Team'][_0x360b('0x65')]({'where':{'id':_0x5aafaa},'attributes':['id'],'include':[{'model':db[_0x360b('0x66')],'as':'Agents','attributes':['id',_0x360b('0x3b'),_0x360b('0x71'),'voicePause',_0x360b('0x72')],'raw':!![]}]})['then'](function(_0x3b8285){if(_0x3b8285){var _0x2aa919=_[_0x360b('0x73')](_0x3b8285,function(_0x498307){var _0x598ff0=_0x498307[_0x360b('0x37')]({'plain':!![]});return _0x598ff0[_0x360b('0x74')];});return db[_0x360b('0x3d')][_0x360b('0x5a')]({'where':{'id':_0x229aba['params']['id']}})[_0x360b('0x22')](function(_0xfd5323){return db[_0x360b('0x75')][_0x360b('0x76')](function(_0x585df3){return _0xfd5323[_0x360b('0x6f')](_0x5aafaa,{'transaction':_0x585df3})[_0x360b('0x22')](function(){return BPromise[_0x360b('0x77')](_0x2aa919,function(_0x50787e){return db[_0x360b('0x61')][_0x360b('0x78')]({'where':{'UserId':_0x50787e['id'],'ChatQueueId':_0x229aba[_0x360b('0x53')]['id']},'transaction':_0x585df3});});})[_0x360b('0x22')](function(){_0x2aa919['forEach'](function(_0x186158){socket[_0x360b('0x79')](_0x360b('0x7a'),{'UserId':_0x186158['id'],'ChatQueueId':_0xfd5323['id']});});});});});}})[_0x360b('0x22')](respondWithStatusCode(_0x293350,null))[_0x360b('0x2a')](handleError(_0x293350,null));};exports[_0x360b('0x7b')]=function(_0x539c03,_0x497a64,_0x547149){return db[_0x360b('0x6d')][_0x360b('0x65')]({'where':{'id':_0x539c03[_0x360b('0x44')][_0x360b('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x360b('0x22')](handleEntityNotFound(_0x497a64,null))[_0x360b('0x22')](function(_0x46a4d8){var _0x10196a=_[_0x360b('0x43')](_0x46a4d8,'id');var _0x8775f8=[];var _0x57b5d6=[];var _0x1fae7b=squel[_0x360b('0x7c')]();_0x1fae7b['field'](_0x360b('0x7d'))[_0x360b('0x7e')](_0x360b('0x7f'),'tq')[_0x360b('0x80')]('user_has_teams','ut',_0x360b('0x81'))[_0x360b('0x4c')](_0x360b('0x82'),_0x539c03[_0x360b('0x53')]['id']);for(var _0x8cf0e=0x0;_0x8cf0e<_0x46a4d8[_0x360b('0x49')];_0x8cf0e+=0x1){let _0x5bdedd=_0x46a4d8[_0x8cf0e];for(var _0x8c7ff4=0x0;_0x8c7ff4<_0x5bdedd['Agents'][_0x360b('0x49')];_0x8c7ff4+=0x1){let _0x2b6ff1=_0x5bdedd[_0x360b('0x74')][_0x8c7ff4];var _0x11b1a4=_0x1fae7b[_0x360b('0x83')]();_0x11b1a4['where'](_0x360b('0x84'),_0x2b6ff1['id']);_0x57b5d6['push'](db[_0x360b('0x75')]['query'](_0x11b1a4[_0x360b('0x85')](),{'type':db[_0x360b('0x75')][_0x360b('0x86')][_0x360b('0x87')]})['then'](function(_0x233939){if(_0x233939['length']===0x1){return _0x2b6ff1['id'];}else{var _0x21cbaf=_['every'](_[_0x360b('0x43')](_0x233939,'TeamId'),function(_0x17be57){return _['includes'](_0x10196a,_0x17be57);});if(_0x21cbaf){return _0x2b6ff1['id'];}}}));}}return BPromise[_0x360b('0x88')](_0x57b5d6)[_0x360b('0x22')](function(_0x3319a9){_0x8775f8=_(_0x8775f8)[_0x360b('0x89')](_0x3319a9)['compact']()[_0x360b('0x8a')]();return db[_0x360b('0x3d')][_0x360b('0x5a')]({'where':{'id':_0x539c03['params']['id']}})[_0x360b('0x22')](function(_0xdad72b){return db['sequelize'][_0x360b('0x76')](function(_0xef71b7){return _0xdad72b[_0x360b('0x7b')](_0x539c03[_0x360b('0x44')]['ids'],{'transaction':_0xef71b7})[_0x360b('0x22')](function(){if(!_[_0x360b('0x8b')](_0x8775f8)){return _0xdad72b['removeAgents'](_0x8775f8,{'transaction':_0xef71b7});}})[_0x360b('0x22')](function(){_0x8775f8[_0x360b('0x8c')](function(_0x2bab89){socket['emit'](_0x360b('0x8d'),{'UserId':_0x2bab89,'ChatQueueId':_0xdad72b['id']});});});});});});})[_0x360b('0x22')](respondWithStatusCode(_0x497a64,null))['catch'](handleError(_0x497a64,null));};exports[_0x360b('0x8e')]=function(_0xb7b322,_0x5a362c,_0x2e9f65){return db[_0x360b('0x3d')][_0x360b('0x5a')]({'where':{'id':_0xb7b322[_0x360b('0x53')]['id']}})[_0x360b('0x22')](handleEntityNotFound(_0x5a362c,null))[_0x360b('0x22')](function(_0x597d51){if(_0x597d51){return _0x597d51[_0x360b('0x8e')](_0xb7b322[_0x360b('0x5e')][_0x360b('0x70')],_[_0x360b('0x8f')](_0xb7b322[_0x360b('0x5e')],[_0x360b('0x70'),'id'])||{})[_0x360b('0x90')](function(_0x3c5361){for(var _0x3b0062=0x0;_0x3b0062<_0xb7b322[_0x360b('0x5e')][_0x360b('0x70')]['length'];_0x3b0062+=0x1){socket[_0x360b('0x79')]('userChatQueue:save',{'UserId':_0xb7b322[_0x360b('0x5e')][_0x360b('0x70')][_0x3b0062],'ChatQueueId':_0xb7b322[_0x360b('0x53')]['id']});}return _0x3c5361;});}})[_0x360b('0x22')](respondWithResult(_0x5a362c,null))[_0x360b('0x2a')](handleError(_0x5a362c,null));};exports[_0x360b('0x91')]=function(_0x24a71a,_0x4b2027,_0x59e3d7){return db['ChatQueue'][_0x360b('0x5a')]({'where':{'id':_0x24a71a[_0x360b('0x53')]['id']}})[_0x360b('0x22')](handleEntityNotFound(_0x4b2027,null))['then'](function(_0x40b8ef){if(_0x40b8ef){return _0x40b8ef[_0x360b('0x91')](_0x24a71a[_0x360b('0x44')][_0x360b('0x70')])[_0x360b('0x22')](function(){if(_[_0x360b('0x92')](_0x24a71a['query']['ids'])){for(var _0x5ad39e=0x0;_0x5ad39e<_0x24a71a[_0x360b('0x44')][_0x360b('0x70')][_0x360b('0x49')];_0x5ad39e+=0x1){socket['emit'](_0x360b('0x8d'),{'UserId':Number(_0x24a71a[_0x360b('0x44')][_0x360b('0x70')][_0x5ad39e]),'ChatQueueId':Number(_0x24a71a[_0x360b('0x53')]['id'])});}}else{socket[_0x360b('0x79')](_0x360b('0x8d'),{'UserId':Number(_0x24a71a[_0x360b('0x44')][_0x360b('0x70')]),'ChatQueueId':Number(_0x24a71a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4b2027,null))[_0x360b('0x2a')](handleError(_0x4b2027,null));};exports[_0x360b('0x93')]=function(_0x3137dd,_0x49ac9e,_0x32cd07){var _0x3765ed={};var _0x37560b={};var _0x2b939d;var _0x5da300;return db[_0x360b('0x3d')][_0x360b('0x60')]({'where':{'id':_0x3137dd['params']['id']}})[_0x360b('0x22')](handleEntityNotFound(_0x49ac9e,null))['then'](function(_0x45a4a9){if(_0x45a4a9){_0x2b939d=_0x45a4a9;_0x37560b[_0x360b('0x42')]=_[_0x360b('0x54')](db[_0x360b('0x66')][_0x360b('0x3e')]);_0x37560b[_0x360b('0x44')]=_[_0x360b('0x54')](_0x3137dd[_0x360b('0x44')]);_0x37560b[_0x360b('0x45')]=_[_0x360b('0x46')](_0x37560b['model'],_0x37560b[_0x360b('0x44')]);_0x3765ed[_0x360b('0x48')]=_[_0x360b('0x46')](_0x37560b[_0x360b('0x42')],qs[_0x360b('0x47')](_0x3137dd[_0x360b('0x44')][_0x360b('0x47')]));_0x3765ed[_0x360b('0x48')]=_0x3765ed[_0x360b('0x48')]['length']?_0x3765ed[_0x360b('0x48')]:_0x37560b['model'];_0x3765ed['order']=qs['sort'](_0x3137dd['query'][_0x360b('0x63')]);_0x3765ed[_0x360b('0x4c')]=qs['filters'](_['pick'](_0x3137dd[_0x360b('0x44')],_0x37560b[_0x360b('0x45')]));if(_0x3137dd[_0x360b('0x44')]['filter']){_0x3765ed[_0x360b('0x4c')]=_['merge'](_0x3765ed[_0x360b('0x4c')],{'$or':_['map'](_0x3765ed['attributes'],function(_0x422748){var _0x2d64bc={};_0x2d64bc[_0x422748]={'$like':'%'+_0x3137dd['query']['filter']+'%'};return _0x2d64bc;})});}_0x3765ed=_[_0x360b('0x4f')]({},_0x3765ed,_0x3137dd[_0x360b('0x50')]);return _0x2b939d[_0x360b('0x93')](_0x3765ed);}})['then'](function(_0x3f63b3){if(_0x3f63b3){_0x5da300=_0x3f63b3[_0x360b('0x49')];if(!_0x3137dd[_0x360b('0x44')][_0x360b('0x4a')](_0x360b('0x4b'))){_0x3765ed[_0x360b('0x31')]=qs['limit'](_0x3137dd[_0x360b('0x44')][_0x360b('0x31')]);_0x3765ed[_0x360b('0x30')]=qs[_0x360b('0x30')](_0x3137dd[_0x360b('0x44')][_0x360b('0x30')]);}return _0x2b939d[_0x360b('0x93')](_0x3765ed);}})[_0x360b('0x22')](function(_0x40a67e){if(_0x40a67e){return _0x40a67e?{'count':_0x5da300,'rows':_0x40a67e}:null;}})[_0x360b('0x22')](respondWithResult(_0x49ac9e,null))[_0x360b('0x2a')](handleError(_0x49ac9e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 37bf59f..7dfaecd 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x272db5,_0xb37c13){var _0x5417a1=function(_0x7f9ec1){while(--_0x7f9ec1){_0x272db5['push'](_0x272db5['shift']());}};_0x5417a1(++_0xb37c13);}(_0x5f2f,0x73));var _0xf5f2=function(_0x461c74,_0x1fd38e){_0x461c74=_0x461c74-0x0;var _0x58442b=_0x5f2f[_0x461c74];return _0x58442b;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents;
\ No newline at end of file
+var _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x4923ad,_0x1d11b3){var _0x4203ca=function(_0x2a3245){while(--_0x2a3245){_0x4923ad['push'](_0x4923ad['shift']());}};_0x4203ca(++_0x1d11b3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2ddb6d,_0x25d45b){_0x2ddb6d=_0x2ddb6d-0x0;var _0x56c103=_0x0b0e[_0x2ddb6d];return _0x56c103;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatQueueEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatQueueEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatQueue[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 4871a7c..48d7afc 100644
--- a/server/api/chatQueue/chatQueue.model.js
+++ b/server/api/chatQueue/chatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb77=['bluebird','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','util','../../config/logger','api','moment'];(function(_0x123626,_0x800505){var _0x1cc6c2=function(_0x3257f4){while(--_0x3257f4){_0x123626['push'](_0x123626['shift']());}};_0x1cc6c2(++_0x800505);}(_0xfb77,0x1ca));var _0x7fb7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfb77[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x7fb7('0x0'));var logger=require(_0x7fb7('0x1'))(_0x7fb7('0x2'));var moment=require(_0x7fb7('0x3'));var BPromise=require(_0x7fb7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7fb7('0x5'));var config=require(_0x7fb7('0x6'));var attributes=require(_0x7fb7('0x7'));module[_0x7fb7('0x8')]=function(_0x4252c2,_0x129a2f){return _0x4252c2['define'](_0x7fb7('0x9'),attributes,{'tableName':_0x7fb7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea9e=['./chatQueue.attributes','define','ChatQueue','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x1d2ef2,_0x1a7599){var _0x345183=function(_0x21384d){while(--_0x21384d){_0x1d2ef2['push'](_0x1d2ef2['shift']());}};_0x345183(++_0x1a7599);}(_0xea9e,0xe4));var _0xeea9=function(_0x1af40b,_0x15791c){_0x1af40b=_0x1af40b-0x0;var _0x1b819a=_0xea9e[_0x1af40b];return _0x1b819a;};'use strict';var _=require('lodash');var util=require(_0xeea9('0x0'));var logger=require(_0xeea9('0x1'))(_0xeea9('0x2'));var moment=require(_0xeea9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeea9('0x4'));var rimraf=require('rimraf');var config=require(_0xeea9('0x5'));var attributes=require(_0xeea9('0x6'));module['exports']=function(_0x1cd69e,_0x5249b6){return _0x1cd69e[_0xeea9('0x7')](_0xeea9('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 4c6799c..e410279 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd7a4=['raw','limit','include','map','model','attributes','where','ShowChatQueue','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd7a4,0x7e));var _0x4d7a=function(_0x2f072f,_0x6ffa01){_0x2f072f=_0x2f072f-0x0;var _0x12dd28=_0xd7a4[_0x2f072f];return _0x12dd28;};'use strict';var _=require(_0x4d7a('0x0'));var util=require(_0x4d7a('0x1'));var moment=require('moment');var BPromise=require(_0x4d7a('0x2'));var rs=require(_0x4d7a('0x3'));var fs=require('fs');var Redis=require(_0x4d7a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d7a('0x5'));var logger=require('../../config/logger')(_0x4d7a('0x6'));var config=require('../../config/environment');var jayson=require(_0x4d7a('0x7'));var client=jayson[_0x4d7a('0x8')][_0x4d7a('0x9')]({'port':0x232a});config[_0x4d7a('0xa')]=_[_0x4d7a('0xb')](config[_0x4d7a('0xa')],{'host':_0x4d7a('0xc'),'port':0x18eb});var socket=require(_0x4d7a('0xd'))(new Redis(config[_0x4d7a('0xa')]));require('./chatQueue.socket')[_0x4d7a('0xe')](socket);function respondWithRpcPromise(_0x55e6a1,_0xbfdbbf,_0xddb648){return new BPromise(function(_0x5badc5,_0x555c3a){return client['request'](_0x55e6a1,_0xddb648)[_0x4d7a('0xf')](function(_0x1e4684){logger[_0x4d7a('0x10')](_0x4d7a('0x11'),_0xbfdbbf,_0x4d7a('0x12'));logger[_0x4d7a('0x13')](_0x4d7a('0x14'),_0xbfdbbf,_0x4d7a('0x12'),JSON[_0x4d7a('0x15')](_0x1e4684));if(_0x1e4684[_0x4d7a('0x16')]){if(_0x1e4684[_0x4d7a('0x16')][_0x4d7a('0x17')]===0x1f4){logger[_0x4d7a('0x16')](_0x4d7a('0x11'),_0xbfdbbf,_0x1e4684[_0x4d7a('0x16')]['message']);return _0x555c3a(_0x1e4684[_0x4d7a('0x16')][_0x4d7a('0x18')]);}logger[_0x4d7a('0x16')]('ChatQueue,\x20%s,\x20%s',_0xbfdbbf,_0x1e4684[_0x4d7a('0x16')][_0x4d7a('0x18')]);return _0x5badc5(_0x1e4684[_0x4d7a('0x16')][_0x4d7a('0x18')]);}else{logger[_0x4d7a('0x10')](_0x4d7a('0x11'),_0xbfdbbf,_0x4d7a('0x12'));_0x5badc5(_0x1e4684[_0x4d7a('0x19')][_0x4d7a('0x18')]);}})['catch'](function(_0x12275a){logger['error'](_0x4d7a('0x11'),_0xbfdbbf,_0x12275a);_0x555c3a(_0x12275a);});});}exports[_0x4d7a('0x1a')]=function(_0x450f36){var _0x1a9ab8=this;return new Promise(function(_0x49db88,_0x369389){return db[_0x4d7a('0x1b')][_0x4d7a('0x1c')]({'raw':_0x450f36[_0x4d7a('0x1d')]?_0x450f36[_0x4d7a('0x1d')][_0x4d7a('0x1e')]===undefined?!![]:![]:!![],'where':_0x450f36[_0x4d7a('0x1d')]?_0x450f36[_0x4d7a('0x1d')]['where']||null:null,'attributes':_0x450f36[_0x4d7a('0x1d')]?_0x450f36['options']['attributes']||null:null,'limit':_0x450f36[_0x4d7a('0x1d')]?_0x450f36[_0x4d7a('0x1d')][_0x4d7a('0x1f')]||null:null,'include':_0x450f36[_0x4d7a('0x1d')]?_0x450f36[_0x4d7a('0x1d')][_0x4d7a('0x20')]?_[_0x4d7a('0x21')](_0x450f36[_0x4d7a('0x1d')][_0x4d7a('0x20')],function(_0x558813){return{'model':db[_0x558813[_0x4d7a('0x22')]],'as':_0x558813['as'],'attributes':_0x558813[_0x4d7a('0x23')],'include':_0x558813[_0x4d7a('0x20')]?_[_0x4d7a('0x21')](_0x558813[_0x4d7a('0x20')],function(_0x38c381){return{'model':db[_0x38c381[_0x4d7a('0x22')]],'as':_0x38c381['as'],'attributes':_0x38c381[_0x4d7a('0x23')],'include':_0x38c381[_0x4d7a('0x20')]?_[_0x4d7a('0x21')](_0x38c381[_0x4d7a('0x20')],function(_0x4cc274){return{'model':db[_0x4cc274[_0x4d7a('0x22')]],'as':_0x4cc274['as'],'attributes':_0x4cc274[_0x4d7a('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x464595){logger[_0x4d7a('0x10')](_0x4d7a('0x1a'),_0x450f36);logger[_0x4d7a('0x13')]('GetChatQueue',_0x450f36,JSON[_0x4d7a('0x15')](_0x464595));_0x49db88(_0x464595);})['catch'](function(_0x4a4ac5){logger['error'](_0x4d7a('0x1a'),_0x4a4ac5[_0x4d7a('0x18')],_0x450f36);_0x369389(_0x1a9ab8['error'](0x1f4,_0x4a4ac5[_0x4d7a('0x18')]));});});};exports['ShowChatQueue']=function(_0xd1eb12){var _0xd2264f=this;return new Promise(function(_0x247dc1,_0x3e4f5f){return db[_0x4d7a('0x1b')]['find']({'raw':_0xd1eb12['options']?_0xd1eb12[_0x4d7a('0x1d')][_0x4d7a('0x1e')]===undefined?!![]:![]:!![],'where':_0xd1eb12[_0x4d7a('0x1d')]?_0xd1eb12[_0x4d7a('0x1d')][_0x4d7a('0x24')]||null:null,'attributes':_0xd1eb12[_0x4d7a('0x1d')]?_0xd1eb12[_0x4d7a('0x1d')]['attributes']||null:null,'include':_0xd1eb12[_0x4d7a('0x1d')]?_0xd1eb12['options'][_0x4d7a('0x20')]?_[_0x4d7a('0x21')](_0xd1eb12[_0x4d7a('0x1d')][_0x4d7a('0x20')],function(_0x144c34){return{'model':db[_0x144c34[_0x4d7a('0x22')]],'as':_0x144c34['as'],'attributes':_0x144c34['attributes'],'include':_0x144c34[_0x4d7a('0x20')]?_[_0x4d7a('0x21')](_0x144c34[_0x4d7a('0x20')],function(_0x54c64c){return{'model':db[_0x54c64c[_0x4d7a('0x22')]],'as':_0x54c64c['as'],'attributes':_0x54c64c[_0x4d7a('0x23')],'include':_0x54c64c[_0x4d7a('0x20')]?_[_0x4d7a('0x21')](_0x54c64c['include'],function(_0x1736cc){return{'model':db[_0x1736cc[_0x4d7a('0x22')]],'as':_0x1736cc['as'],'attributes':_0x1736cc['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d7a('0xf')](function(_0x46b3dd){logger[_0x4d7a('0x10')](_0x4d7a('0x25'),_0xd1eb12);logger[_0x4d7a('0x13')](_0x4d7a('0x25'),_0xd1eb12,JSON[_0x4d7a('0x15')](_0x46b3dd));_0x247dc1(_0x46b3dd);})[_0x4d7a('0x26')](function(_0x45dc23){logger['error'](_0x4d7a('0x25'),_0x45dc23[_0x4d7a('0x18')],_0xd1eb12);_0x3e4f5f(_0xd2264f[_0x4d7a('0x16')](0x1f4,_0x45dc23[_0x4d7a('0x18')]));});});};
\ No newline at end of file
+var _0xe75a=['GetChatQueue','catch','find','ShowChatQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ChatQueue','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x4d9f20,_0x444480){var _0x46e414=function(_0x14842d){while(--_0x14842d){_0x4d9f20['push'](_0x4d9f20['shift']());}};_0x46e414(++_0x444480);}(_0xe75a,0x115));var _0xae75=function(_0x5eca50,_0xc1e3f8){_0x5eca50=_0x5eca50-0x0;var _0x41fb84=_0xe75a[_0x5eca50];return _0x41fb84;};'use strict';var _=require('lodash');var util=require(_0xae75('0x0'));var moment=require(_0xae75('0x1'));var BPromise=require(_0xae75('0x2'));var rs=require(_0xae75('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae75('0x4'))['db'];var utils=require(_0xae75('0x5'));var logger=require(_0xae75('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae75('0x7')][_0xae75('0x8')]({'port':0x232a});config[_0xae75('0x9')]=_[_0xae75('0xa')](config['redis'],{'host':_0xae75('0xb'),'port':0x18eb});var socket=require(_0xae75('0xc'))(new Redis(config[_0xae75('0x9')]));require(_0xae75('0xd'))['register'](socket);function respondWithRpcPromise(_0x3f3412,_0xfe558e,_0xa5a5ce){return new BPromise(function(_0xf924a6,_0x196972){return client[_0xae75('0xe')](_0x3f3412,_0xa5a5ce)[_0xae75('0xf')](function(_0x5f3c49){logger['info'](_0xae75('0x10'),_0xfe558e,_0xae75('0x11'));logger[_0xae75('0x12')](_0xae75('0x13'),_0xfe558e,'request\x20sent',JSON[_0xae75('0x14')](_0x5f3c49));if(_0x5f3c49['error']){if(_0x5f3c49[_0xae75('0x15')][_0xae75('0x16')]===0x1f4){logger[_0xae75('0x15')](_0xae75('0x10'),_0xfe558e,_0x5f3c49[_0xae75('0x15')]['message']);return _0x196972(_0x5f3c49[_0xae75('0x15')][_0xae75('0x17')]);}logger[_0xae75('0x15')](_0xae75('0x10'),_0xfe558e,_0x5f3c49['error'][_0xae75('0x17')]);return _0xf924a6(_0x5f3c49[_0xae75('0x15')][_0xae75('0x17')]);}else{logger[_0xae75('0x18')]('ChatQueue,\x20%s,\x20%s',_0xfe558e,'request\x20sent');_0xf924a6(_0x5f3c49[_0xae75('0x19')]['message']);}})['catch'](function(_0x5e415d){logger['error'](_0xae75('0x10'),_0xfe558e,_0x5e415d);_0x196972(_0x5e415d);});});}exports['GetChatQueue']=function(_0x155454){var _0x2bdb10=this;return new Promise(function(_0x43c06b,_0x5b8df1){return db[_0xae75('0x1a')][_0xae75('0x1b')]({'raw':_0x155454[_0xae75('0x1c')]?_0x155454['options'][_0xae75('0x1d')]===undefined?!![]:![]:!![],'where':_0x155454[_0xae75('0x1c')]?_0x155454['options']['where']||null:null,'attributes':_0x155454[_0xae75('0x1c')]?_0x155454['options'][_0xae75('0x1e')]||null:null,'limit':_0x155454[_0xae75('0x1c')]?_0x155454[_0xae75('0x1c')][_0xae75('0x1f')]||null:null,'include':_0x155454[_0xae75('0x1c')]?_0x155454[_0xae75('0x1c')][_0xae75('0x20')]?_[_0xae75('0x21')](_0x155454[_0xae75('0x1c')][_0xae75('0x20')],function(_0x2ac86c){return{'model':db[_0x2ac86c[_0xae75('0x22')]],'as':_0x2ac86c['as'],'attributes':_0x2ac86c[_0xae75('0x1e')],'include':_0x2ac86c['include']?_[_0xae75('0x21')](_0x2ac86c[_0xae75('0x20')],function(_0x33eb2a){return{'model':db[_0x33eb2a[_0xae75('0x22')]],'as':_0x33eb2a['as'],'attributes':_0x33eb2a['attributes'],'include':_0x33eb2a['include']?_['map'](_0x33eb2a[_0xae75('0x20')],function(_0x4f5de0){return{'model':db[_0x4f5de0[_0xae75('0x22')]],'as':_0x4f5de0['as'],'attributes':_0x4f5de0[_0xae75('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae75('0xf')](function(_0x256993){logger['info']('GetChatQueue',_0x155454);logger[_0xae75('0x12')](_0xae75('0x23'),_0x155454,JSON[_0xae75('0x14')](_0x256993));_0x43c06b(_0x256993);})[_0xae75('0x24')](function(_0x42f7cb){logger[_0xae75('0x15')]('GetChatQueue',_0x42f7cb[_0xae75('0x17')],_0x155454);_0x5b8df1(_0x2bdb10[_0xae75('0x15')](0x1f4,_0x42f7cb[_0xae75('0x17')]));});});};exports['ShowChatQueue']=function(_0x136014){var _0x23c43e=this;return new Promise(function(_0x238928,_0x2042ae){return db['ChatQueue'][_0xae75('0x25')]({'raw':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')][_0xae75('0x1d')]===undefined?!![]:![]:!![],'where':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')]['where']||null:null,'attributes':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')][_0xae75('0x1e')]||null:null,'include':_0x136014[_0xae75('0x1c')]?_0x136014['options'][_0xae75('0x20')]?_['map'](_0x136014[_0xae75('0x1c')]['include'],function(_0x478525){return{'model':db[_0x478525[_0xae75('0x22')]],'as':_0x478525['as'],'attributes':_0x478525[_0xae75('0x1e')],'include':_0x478525[_0xae75('0x20')]?_[_0xae75('0x21')](_0x478525[_0xae75('0x20')],function(_0x25aa62){return{'model':db[_0x25aa62[_0xae75('0x22')]],'as':_0x25aa62['as'],'attributes':_0x25aa62[_0xae75('0x1e')],'include':_0x25aa62[_0xae75('0x20')]?_[_0xae75('0x21')](_0x25aa62[_0xae75('0x20')],function(_0x4f418f){return{'model':db[_0x4f418f[_0xae75('0x22')]],'as':_0x4f418f['as'],'attributes':_0x4f418f[_0xae75('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae75('0xf')](function(_0x5a0134){logger[_0xae75('0x18')](_0xae75('0x26'),_0x136014);logger[_0xae75('0x12')]('ShowChatQueue',_0x136014,JSON[_0xae75('0x14')](_0x5a0134));_0x238928(_0x5a0134);})[_0xae75('0x24')](function(_0x3463b8){logger[_0xae75('0x15')](_0xae75('0x26'),_0x3463b8['message'],_0x136014);_0x2042ae(_0x23c43e[_0xae75('0x15')](0x1f4,_0x3463b8[_0xae75('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 741417c..d08ecae 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x459963,_0x5a366a){var _0xbe84e3=function(_0x358999){while(--_0x358999){_0x459963['push'](_0x459963['shift']());}};_0xbe84e3(++_0x5a366a);}(_0x5f2f,0x73));var _0xf5f2=function(_0xcf7834,_0x24a774){_0xcf7834=_0xcf7834-0x0;var _0x25aca0=_0x5f2f[_0xcf7834];return _0x25aca0;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x56bde6,_0x33d137){var _0x45d480=function(_0x47e225){while(--_0x47e225){_0x56bde6['push'](_0x56bde6['shift']());}};_0x45d480(++_0x33d137);}(_0x0b0e,0x187));var _0xe0b0=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x0b0e[_0x53c256];return _0x25feb6;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 42365ad..1742462 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08f0=['addAgents','update','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','index','/:id','show','/:id/members','isAuthenticated','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams'];(function(_0x119c85,_0x268175){var _0x41d288=function(_0x52c0b2){while(--_0x52c0b2){_0x119c85['push'](_0x119c85['shift']());}};_0x41d288(++_0x268175);}(_0x08f0,0x128));var _0x008f=function(_0x267362,_0x265812){_0x267362=_0x267362-0x0;var _0x5171f0=_0x08f0[_0x267362];return _0x5171f0;};'use strict';var multer=require(_0x008f('0x0'));var util=require('util');var path=require(_0x008f('0x1'));var timeout=require(_0x008f('0x2'));var express=require(_0x008f('0x3'));var router=express[_0x008f('0x4')]();var auth=require(_0x008f('0x5'));var interaction=require(_0x008f('0x6'));var config=require(_0x008f('0x7'));var controller=require(_0x008f('0x8'));router[_0x008f('0x9')]('/',auth['isAuthenticated'](),controller[_0x008f('0xa')]);router[_0x008f('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x008f('0x9')](_0x008f('0xb'),auth['isAuthenticated'](),controller[_0x008f('0xc')]);router['get'](_0x008f('0xd'),auth[_0x008f('0xe')](),controller[_0x008f('0xf')]);router['get']('/:id/teams',auth[_0x008f('0xe')](),controller[_0x008f('0x10')]);router['get'](_0x008f('0x11'),auth[_0x008f('0xe')](),controller[_0x008f('0x12')]);router[_0x008f('0x13')]('/',auth['isAuthenticated'](),controller[_0x008f('0x14')]);router[_0x008f('0x13')](_0x008f('0x15'),auth[_0x008f('0xe')](),controller[_0x008f('0x16')]);router[_0x008f('0x13')]('/:id/users',auth[_0x008f('0xe')](),controller[_0x008f('0x17')]);router['put'](_0x008f('0xb'),auth[_0x008f('0xe')](),controller[_0x008f('0x18')]);router[_0x008f('0x19')](_0x008f('0xb'),auth['isAuthenticated'](),controller[_0x008f('0x1a')]);router[_0x008f('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x008f('0x1b')]);router[_0x008f('0x19')](_0x008f('0x11'),auth[_0x008f('0xe')](),controller['removeAgents']);module[_0x008f('0x1c')]=router;
\ No newline at end of file
+var _0x24a5=['../../config/environment','get','isAuthenticated','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','express','Router','../../components/auth/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x24a5,0x128));var _0x524a=function(_0x4da661,_0x34fbe0){_0x4da661=_0x4da661-0x0;var _0x25d6dc=_0x24a5[_0x4da661];return _0x25d6dc;};'use strict';var multer=require(_0x524a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x524a('0x1'));var router=express[_0x524a('0x2')]();var auth=require(_0x524a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x524a('0x4'));var controller=require('./chatQueue.controller');router[_0x524a('0x5')]('/',auth[_0x524a('0x6')](),controller['index']);router[_0x524a('0x5')](_0x524a('0x7'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x524a('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x524a('0x5')](_0x524a('0x9'),auth['isAuthenticated'](),controller[_0x524a('0xa')]);router[_0x524a('0x5')](_0x524a('0xb'),auth[_0x524a('0x6')](),controller[_0x524a('0xc')]);router[_0x524a('0x5')](_0x524a('0xd'),auth[_0x524a('0x6')](),controller[_0x524a('0xe')]);router[_0x524a('0xf')]('/',auth[_0x524a('0x6')](),controller[_0x524a('0x10')]);router[_0x524a('0xf')](_0x524a('0xb'),auth[_0x524a('0x6')](),controller[_0x524a('0x11')]);router['post'](_0x524a('0xd'),auth[_0x524a('0x6')](),controller[_0x524a('0x12')]);router[_0x524a('0x13')](_0x524a('0x8'),auth[_0x524a('0x6')](),controller[_0x524a('0x14')]);router[_0x524a('0x15')]('/:id',auth[_0x524a('0x6')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x524a('0x16')]);router['delete']('/:id/users',auth[_0x524a('0x6')](),controller[_0x524a('0x17')]);module[_0x524a('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index c7b70ab..9755047 100644
--- a/server/api/chatQueueReport/chatQueueReport.attributes.js
+++ b/server/api/chatQueueReport/chatQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3281=['DATE','moment','sequelize','exports','STRING'];(function(_0x4db9cc,_0x4e178a){var _0x5018d9=function(_0x54983a){while(--_0x54983a){_0x4db9cc['push'](_0x4db9cc['shift']());}};_0x5018d9(++_0x4e178a);}(_0x3281,0x155));var _0x1328=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x3281[_0x5e36d1];return _0x950b9e;};'use strict';var moment=require(_0x1328('0x0'));var Sequelize=require(_0x1328('0x1'));module[_0x1328('0x2')]={'uniqueid':{'type':Sequelize[_0x1328('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1328('0x4')]},'leaveAt':{'type':Sequelize[_0x1328('0x4')]},'acceptAt':{'type':Sequelize[_0x1328('0x4')]},'exitAt':{'type':Sequelize[_0x1328('0x4')]},'reason':{'type':Sequelize[_0x1328('0x3')]}};
\ No newline at end of file
+var _0x3596=['DATE','moment','exports','STRING'];(function(_0x26c643,_0x2c784a){var _0xb49398=function(_0x4ea624){while(--_0x4ea624){_0x26c643['push'](_0x26c643['shift']());}};_0xb49398(++_0x2c784a);}(_0x3596,0x69));var _0x6359=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x3596[_0x164eca];return _0x2ce562;};'use strict';var moment=require(_0x6359('0x0'));var Sequelize=require('sequelize');module[_0x6359('0x1')]={'uniqueid':{'type':Sequelize[_0x6359('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6359('0x3')]},'leaveAt':{'type':Sequelize[_0x6359('0x3')]},'acceptAt':{'type':Sequelize[_0x6359('0x3')]},'exitAt':{'type':Sequelize[_0x6359('0x3')]},'reason':{'type':Sequelize[_0x6359('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 7a974f7..9a1d19b 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x135b0a,_0x446c26){var _0x34bd43=function(_0x3f7a88){while(--_0x3f7a88){_0x135b0a['push'](_0x135b0a['shift']());}};_0x34bd43(++_0x446c26);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0baf('0x0'));var rimraf=require(_0x0baf('0x1'));var zipdir=require(_0x0baf('0x2'));var jsonpatch=require(_0x0baf('0x3'));var rp=require(_0x0baf('0x4'));var moment=require(_0x0baf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x6'));var util=require(_0x0baf('0x7'));var path=require(_0x0baf('0x8'));var sox=require(_0x0baf('0x9'));var csv=require(_0x0baf('0xa'));var ejs=require(_0x0baf('0xb'));var fs=require('fs');var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a53e2,_0x465dd7){_0x465dd7=_0x465dd7||0xcc;return function(_0xe4378c){if(_0xe4378c){return _0x5a53e2[_0x0baf('0x1b')](_0x465dd7);}return _0x5a53e2[_0x0baf('0x1c')](_0x465dd7)['end']();};}function respondWithResult(_0x2ab33e,_0x49e44b){_0x49e44b=_0x49e44b||0xc8;return function(_0x1c76a8){if(_0x1c76a8){return _0x2ab33e[_0x0baf('0x1c')](_0x49e44b)[_0x0baf('0x1d')](_0x1c76a8);}};}function respondWithFilteredResult(_0x2bc381,_0xb8339e){return function(_0x469599){if(_0x469599){var _0x4f80a8=_0x469599[_0x0baf('0x1e')],_0x4cd79d=_0xb8339e[_0x0baf('0x1f')],_0x2312c7=_0xb8339e[_0x0baf('0x1f')]+_0xb8339e[_0x0baf('0x20')],_0x38395b;if(_0x2312c7>=_0x4f80a8){_0x2312c7=_0x4f80a8;_0x38395b=0xc8;}else{_0x38395b=0xce;}_0x2bc381['status'](_0x38395b);return _0x2bc381[_0x0baf('0x21')](_0x0baf('0x22'),_0x4cd79d+'-'+_0x2312c7+'/'+_0x4f80a8)[_0x0baf('0x1d')](_0x469599);}return null;};}function patchUpdates(_0x3e9cb4){return function(_0x47070d){try{jsonpatch[_0x0baf('0x23')](_0x47070d,_0x3e9cb4,!![]);}catch(_0x4ff793){return BPromise['reject'](_0x4ff793);}return _0x47070d[_0x0baf('0x24')]();};}function saveUpdates(_0x154f48,_0x32e839){return function(_0x1848e8){if(_0x1848e8){return _0x1848e8[_0x0baf('0x25')](_0x154f48)[_0x0baf('0x26')](function(_0x210cd8){return _0x210cd8;});}return null;};}function removeEntity(_0x636a13,_0x2c42e2){return function(_0x15a2c3){if(_0x15a2c3){return _0x15a2c3['destroy']()[_0x0baf('0x26')](function(){_0x636a13['status'](0xcc)[_0x0baf('0x27')]();});}};}function handleEntityNotFound(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(!_0x2ef0aa){_0x5dbf00['sendStatus'](0x194);}return _0x2ef0aa;};}function handleError(_0x4be1b9,_0x47c4b){_0x47c4b=_0x47c4b||0x1f4;return function(_0x27b59c){logger[_0x0baf('0x28')](_0x27b59c[_0x0baf('0x29')]);if(_0x27b59c[_0x0baf('0x2a')]){delete _0x27b59c['name'];}_0x4be1b9[_0x0baf('0x1c')](_0x47c4b)[_0x0baf('0x2b')](_0x27b59c);};}exports[_0x0baf('0x2c')]=function(_0x366e71,_0x3843b8){var _0x3b9b31={},_0x453525={},_0x549fd0={'count':0x0,'rows':[]};var _0x1590b4=_[_0x0baf('0x2d')](db[_0x0baf('0x2e')][_0x0baf('0x2f')],function(_0x55c715){return{'name':_0x55c715[_0x0baf('0x30')],'type':_0x55c715[_0x0baf('0x31')]['key']};});_0x453525[_0x0baf('0x32')]=_[_0x0baf('0x2d')](_0x1590b4,_0x0baf('0x2a'));_0x453525[_0x0baf('0x33')]=_[_0x0baf('0x34')](_0x366e71[_0x0baf('0x33')]);_0x453525[_0x0baf('0x35')]=_['intersection'](_0x453525[_0x0baf('0x32')],_0x453525[_0x0baf('0x33')]);_0x3b9b31[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x453525[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x38')]));_0x3b9b31[_0x0baf('0x36')]=_0x3b9b31[_0x0baf('0x36')][_0x0baf('0x39')]?_0x3b9b31[_0x0baf('0x36')]:_0x453525[_0x0baf('0x32')];if(!_0x366e71[_0x0baf('0x33')]['hasOwnProperty'](_0x0baf('0x3a'))){_0x3b9b31['limit']=qs[_0x0baf('0x20')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x20')]);_0x3b9b31[_0x0baf('0x1f')]=qs['offset'](_0x366e71[_0x0baf('0x33')][_0x0baf('0x1f')]);}_0x3b9b31['order']=qs[_0x0baf('0x3b')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x3b')]);_0x3b9b31[_0x0baf('0x3c')]=qs[_0x0baf('0x35')](_[_0x0baf('0x3d')](_0x366e71[_0x0baf('0x33')],_0x453525[_0x0baf('0x35')]),_0x1590b4);if(_0x366e71['query'][_0x0baf('0x3e')]){_0x3b9b31[_0x0baf('0x3c')]=_['merge'](_0x3b9b31[_0x0baf('0x3c')],{'$or':_['map'](_0x1590b4,function(_0x5c545f){if(_0x5c545f[_0x0baf('0x31')]!==_0x0baf('0x3f')){var _0x5d3ad1={};_0x5d3ad1[_0x5c545f['name']]={'$like':'%'+_0x366e71[_0x0baf('0x33')][_0x0baf('0x3e')]+'%'};return _0x5d3ad1;}})});}_0x3b9b31=_[_0x0baf('0x40')]({},_0x3b9b31,_0x366e71[_0x0baf('0x41')]);var _0x15eb5c={'where':_0x3b9b31[_0x0baf('0x3c')]};return db[_0x0baf('0x2e')][_0x0baf('0x1e')](_0x15eb5c)[_0x0baf('0x26')](function(_0x36c6d2){_0x549fd0[_0x0baf('0x1e')]=_0x36c6d2;if(_0x366e71[_0x0baf('0x33')][_0x0baf('0x42')]){_0x3b9b31[_0x0baf('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0baf('0x44')](_0x3b9b31);})[_0x0baf('0x26')](function(_0x4f1de9){_0x549fd0[_0x0baf('0x45')]=_0x4f1de9;return _0x549fd0;})[_0x0baf('0x26')](respondWithFilteredResult(_0x3843b8,_0x3b9b31))[_0x0baf('0x46')](handleError(_0x3843b8,null));};exports[_0x0baf('0x47')]=function(_0x2e20c8,_0x456d0b){var _0x57b581={'raw':!![],'where':{'id':_0x2e20c8[_0x0baf('0x48')]['id']}},_0x23ad34={};_0x23ad34['model']=_[_0x0baf('0x34')](db[_0x0baf('0x2e')][_0x0baf('0x2f')]);_0x23ad34[_0x0baf('0x33')]=_['keys'](_0x2e20c8[_0x0baf('0x33')]);_0x23ad34[_0x0baf('0x35')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],_0x23ad34[_0x0baf('0x33')]);_0x57b581[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x2e20c8[_0x0baf('0x33')]['fields']));_0x57b581[_0x0baf('0x36')]=_0x57b581[_0x0baf('0x36')][_0x0baf('0x39')]?_0x57b581[_0x0baf('0x36')]:_0x23ad34[_0x0baf('0x32')];if(_0x2e20c8['query'][_0x0baf('0x42')]){_0x57b581[_0x0baf('0x43')]=[{'all':!![]}];}_0x57b581=_[_0x0baf('0x40')]({},_0x57b581,_0x2e20c8[_0x0baf('0x41')]);return db[_0x0baf('0x2e')]['find'](_0x57b581)[_0x0baf('0x26')](handleEntityNotFound(_0x456d0b,null))[_0x0baf('0x26')](respondWithResult(_0x456d0b,null))[_0x0baf('0x46')](handleError(_0x456d0b,null));};exports[_0x0baf('0x49')]=function(_0x41599f,_0x22d10f){return db[_0x0baf('0x2e')]['create'](_0x41599f[_0x0baf('0x4a')],{})[_0x0baf('0x26')](respondWithResult(_0x22d10f,0xc9))[_0x0baf('0x46')](handleError(_0x22d10f,null));};exports['update']=function(_0x3c9de3,_0x2222b6){if(_0x3c9de3[_0x0baf('0x4a')]['id']){delete _0x3c9de3[_0x0baf('0x4a')]['id'];}return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0x3c9de3[_0x0baf('0x48')]['id']}})['then'](handleEntityNotFound(_0x2222b6,null))[_0x0baf('0x26')](saveUpdates(_0x3c9de3[_0x0baf('0x4a')],null))[_0x0baf('0x26')](respondWithResult(_0x2222b6,null))[_0x0baf('0x46')](handleError(_0x2222b6,null));};exports[_0x0baf('0x4c')]=function(_0xc427b2,_0x40d4a6){return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0xc427b2[_0x0baf('0x48')]['id']}})[_0x0baf('0x26')](handleEntityNotFound(_0x40d4a6,null))['then'](removeEntity(_0x40d4a6,null))['catch'](handleError(_0x40d4a6,null));};exports[_0x0baf('0x4d')]=function(_0x3d6b19,_0x1cd114){return db[_0x0baf('0x2e')][_0x0baf('0x4d')]()[_0x0baf('0x26')](respondWithResult(_0x1cd114,null))[_0x0baf('0x46')](handleError(_0x1cd114,null));};
\ No newline at end of file
+var _0x757a=['count','findAll','rows','catch','params','keys','includeAll','include','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','options','ChatQueueReport'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x757a,0xde));var _0xa757=function(_0x1944ae,_0x58a48f){_0x1944ae=_0x1944ae-0x0;var _0xbe7cb7=_0x757a[_0x1944ae];return _0xbe7cb7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var Redis=require(_0xa757('0xf'));var authService=require(_0xa757('0x10'));var qs=require(_0xa757('0x11'));var as=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))(_0xa757('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56acfb,_0x4db68e){_0x4db68e=_0x4db68e||0xcc;return function(_0x421040){if(_0x421040){return _0x56acfb['sendStatus'](_0x4db68e);}return _0x56acfb['status'](_0x4db68e)[_0xa757('0x16')]();};}function respondWithResult(_0x513b1f,_0x481508){_0x481508=_0x481508||0xc8;return function(_0x32112b){if(_0x32112b){return _0x513b1f[_0xa757('0x17')](_0x481508)[_0xa757('0x18')](_0x32112b);}};}function respondWithFilteredResult(_0x4a0c38,_0x86abd){return function(_0x31cfd2){if(_0x31cfd2){var _0xf12b68=_0x31cfd2['count'],_0x2f7947=_0x86abd[_0xa757('0x19')],_0x185011=_0x86abd[_0xa757('0x19')]+_0x86abd[_0xa757('0x1a')],_0x3df1f9;if(_0x185011>=_0xf12b68){_0x185011=_0xf12b68;_0x3df1f9=0xc8;}else{_0x3df1f9=0xce;}_0x4a0c38['status'](_0x3df1f9);return _0x4a0c38['set'](_0xa757('0x1b'),_0x2f7947+'-'+_0x185011+'/'+_0xf12b68)[_0xa757('0x18')](_0x31cfd2);}return null;};}function patchUpdates(_0x1bd14c){return function(_0x340599){try{jsonpatch[_0xa757('0x1c')](_0x340599,_0x1bd14c,!![]);}catch(_0xe2d567){return BPromise['reject'](_0xe2d567);}return _0x340599[_0xa757('0x1d')]();};}function saveUpdates(_0x4fec52,_0x32c2a1){return function(_0x167640){if(_0x167640){return _0x167640[_0xa757('0x1e')](_0x4fec52)[_0xa757('0x1f')](function(_0x4d598c){return _0x4d598c;});}return null;};}function removeEntity(_0x5638c7,_0x40ec48){return function(_0x2159cf){if(_0x2159cf){return _0x2159cf[_0xa757('0x20')]()[_0xa757('0x1f')](function(){_0x5638c7[_0xa757('0x17')](0xcc)[_0xa757('0x16')]();});}};}function handleEntityNotFound(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(!_0x2bf276){_0x2ca10d['sendStatus'](0x194);}return _0x2bf276;};}function handleError(_0x3707c1,_0x59e9d4){_0x59e9d4=_0x59e9d4||0x1f4;return function(_0x422e9e){logger['error'](_0x422e9e[_0xa757('0x21')]);if(_0x422e9e[_0xa757('0x22')]){delete _0x422e9e[_0xa757('0x22')];}_0x3707c1['status'](_0x59e9d4)[_0xa757('0x23')](_0x422e9e);};}exports[_0xa757('0x24')]=function(_0x471e84,_0x3bf7f3){var _0x5b4779={},_0x449a7d={},_0x54263b={'count':0x0,'rows':[]};var _0x5a5664=_['map'](db['ChatQueueReport'][_0xa757('0x25')],function(_0x596ae2){return{'name':_0x596ae2[_0xa757('0x26')],'type':_0x596ae2[_0xa757('0x27')]['key']};});_0x449a7d[_0xa757('0x28')]=_['map'](_0x5a5664,_0xa757('0x22'));_0x449a7d[_0xa757('0x29')]=_['keys'](_0x471e84[_0xa757('0x29')]);_0x449a7d['filters']=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],_0x449a7d[_0xa757('0x29')]);_0x5b4779[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x471e84[_0xa757('0x29')][_0xa757('0x2c')]));_0x5b4779[_0xa757('0x2b')]=_0x5b4779[_0xa757('0x2b')][_0xa757('0x2d')]?_0x5b4779[_0xa757('0x2b')]:_0x449a7d[_0xa757('0x28')];if(!_0x471e84[_0xa757('0x29')][_0xa757('0x2e')](_0xa757('0x2f'))){_0x5b4779[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x471e84[_0xa757('0x29')][_0xa757('0x1a')]);_0x5b4779[_0xa757('0x19')]=qs[_0xa757('0x19')](_0x471e84[_0xa757('0x29')]['offset']);}_0x5b4779[_0xa757('0x30')]=qs[_0xa757('0x31')](_0x471e84[_0xa757('0x29')][_0xa757('0x31')]);_0x5b4779[_0xa757('0x32')]=qs['filters'](_[_0xa757('0x33')](_0x471e84[_0xa757('0x29')],_0x449a7d[_0xa757('0x34')]),_0x5a5664);if(_0x471e84[_0xa757('0x29')][_0xa757('0x35')]){_0x5b4779[_0xa757('0x32')]=_['merge'](_0x5b4779[_0xa757('0x32')],{'$or':_[_0xa757('0x36')](_0x5a5664,function(_0x2cade7){if(_0x2cade7[_0xa757('0x27')]!==_0xa757('0x37')){var _0x111cfe={};_0x111cfe[_0x2cade7[_0xa757('0x22')]]={'$like':'%'+_0x471e84[_0xa757('0x29')][_0xa757('0x35')]+'%'};return _0x111cfe;}})});}_0x5b4779=_['merge']({},_0x5b4779,_0x471e84[_0xa757('0x38')]);var _0x34fba8={'where':_0x5b4779[_0xa757('0x32')]};return db[_0xa757('0x39')][_0xa757('0x3a')](_0x34fba8)[_0xa757('0x1f')](function(_0x501e26){_0x54263b[_0xa757('0x3a')]=_0x501e26;if(_0x471e84[_0xa757('0x29')]['includeAll']){_0x5b4779['include']=[{'all':!![]}];}return db[_0xa757('0x39')][_0xa757('0x3b')](_0x5b4779);})['then'](function(_0x51c3d1){_0x54263b[_0xa757('0x3c')]=_0x51c3d1;return _0x54263b;})[_0xa757('0x1f')](respondWithFilteredResult(_0x3bf7f3,_0x5b4779))[_0xa757('0x3d')](handleError(_0x3bf7f3,null));};exports['show']=function(_0x830dc4,_0x13a8f4){var _0x26802c={'raw':!![],'where':{'id':_0x830dc4[_0xa757('0x3e')]['id']}},_0x1ba399={};_0x1ba399['model']=_[_0xa757('0x3f')](db['ChatQueueReport']['rawAttributes']);_0x1ba399[_0xa757('0x29')]=_[_0xa757('0x3f')](_0x830dc4[_0xa757('0x29')]);_0x1ba399[_0xa757('0x34')]=_[_0xa757('0x2a')](_0x1ba399['model'],_0x1ba399['query']);_0x26802c[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x1ba399[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x830dc4[_0xa757('0x29')][_0xa757('0x2c')]));_0x26802c['attributes']=_0x26802c[_0xa757('0x2b')][_0xa757('0x2d')]?_0x26802c['attributes']:_0x1ba399[_0xa757('0x28')];if(_0x830dc4['query'][_0xa757('0x40')]){_0x26802c[_0xa757('0x41')]=[{'all':!![]}];}_0x26802c=_['merge']({},_0x26802c,_0x830dc4[_0xa757('0x38')]);return db[_0xa757('0x39')]['find'](_0x26802c)[_0xa757('0x1f')](handleEntityNotFound(_0x13a8f4,null))[_0xa757('0x1f')](respondWithResult(_0x13a8f4,null))[_0xa757('0x3d')](handleError(_0x13a8f4,null));};exports[_0xa757('0x42')]=function(_0x543b5b,_0x199dc9){return db[_0xa757('0x39')][_0xa757('0x42')](_0x543b5b[_0xa757('0x43')],{})['then'](respondWithResult(_0x199dc9,0xc9))[_0xa757('0x3d')](handleError(_0x199dc9,null));};exports['update']=function(_0x50c131,_0x2acf88){if(_0x50c131[_0xa757('0x43')]['id']){delete _0x50c131[_0xa757('0x43')]['id'];}return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x50c131['params']['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x2acf88,null))[_0xa757('0x1f')](saveUpdates(_0x50c131[_0xa757('0x43')],null))[_0xa757('0x1f')](respondWithResult(_0x2acf88,null))[_0xa757('0x3d')](handleError(_0x2acf88,null));};exports[_0xa757('0x20')]=function(_0x57bf73,_0x505cd){return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x57bf73[_0xa757('0x3e')]['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x505cd,null))[_0xa757('0x1f')](removeEntity(_0x505cd,null))[_0xa757('0x3d')](handleError(_0x505cd,null));};exports[_0xa757('0x45')]=function(_0x15bad7,_0x2c5b3c){return db[_0xa757('0x39')][_0xa757('0x45')]()[_0xa757('0x1f')](respondWithResult(_0x2c5b3c,null))[_0xa757('0x3d')](handleError(_0x2c5b3c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 9b097fa..e270026 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x39be=['../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x47fd45,_0x40dd67){var _0x363313=function(_0xb92163){while(--_0xb92163){_0x47fd45['push'](_0x47fd45['shift']());}};_0x363313(++_0x40dd67);}(_0x39be,0xbb));var _0xe39b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x39be[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xe39b('0x0'));var util=require(_0xe39b('0x1'));var logger=require(_0xe39b('0x2'))(_0xe39b('0x3'));var moment=require(_0xe39b('0x4'));var BPromise=require(_0xe39b('0x5'));var rp=require(_0xe39b('0x6'));var fs=require('fs');var path=require(_0xe39b('0x7'));var rimraf=require('rimraf');var config=require(_0xe39b('0x8'));var attributes=require(_0xe39b('0x9'));module[_0xe39b('0xa')]=function(_0x4617b3,_0x4a09dc){return _0x4617b3[_0xe39b('0xb')](_0xe39b('0xc'),attributes,{'tableName':_0xe39b('0xd'),'paranoid':![],'indexes':[{'name':_0xe39b('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x24d9=['uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue'];(function(_0x4e8286,_0x4eaeb4){var _0x44a440=function(_0x5e0907){while(--_0x5e0907){_0x4e8286['push'](_0x4e8286['shift']());}};_0x44a440(++_0x4eaeb4);}(_0x24d9,0x8d));var _0x924d=function(_0x31e319,_0x1924c7){_0x31e319=_0x31e319-0x0;var _0x49e0f3=_0x24d9[_0x31e319];return _0x49e0f3;};'use strict';var _=require('lodash');var util=require(_0x924d('0x0'));var logger=require(_0x924d('0x1'))(_0x924d('0x2'));var moment=require(_0x924d('0x3'));var BPromise=require('bluebird');var rp=require(_0x924d('0x4'));var fs=require('fs');var path=require(_0x924d('0x5'));var rimraf=require(_0x924d('0x6'));var config=require(_0x924d('0x7'));var attributes=require(_0x924d('0x8'));module[_0x924d('0x9')]=function(_0xd2fe2b,_0x33df68){return _0xd2fe2b[_0x924d('0xa')](_0x924d('0xb'),attributes,{'tableName':_0x924d('0xc'),'paranoid':![],'indexes':[{'name':_0x924d('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 0dd479c..56bc70d 100644
--- a/server/api/chatQueueReport/chatQueueReport.rpc.js
+++ b/server/api/chatQueueReport/chatQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2852=['info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','CreateChatQueueReport','create','body','raw','then','catch','update','options','where','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2852,0x147));var _0x2285=function(_0xe40094,_0x21b55d){_0xe40094=_0xe40094-0x0;var _0x19b531=_0x2852[_0xe40094];return _0x19b531;};'use strict';var _=require(_0x2285('0x0'));var util=require('util');var moment=require(_0x2285('0x1'));var BPromise=require(_0x2285('0x2'));var rs=require(_0x2285('0x3'));var fs=require('fs');var Redis=require(_0x2285('0x4'));var db=require(_0x2285('0x5'))['db'];var utils=require(_0x2285('0x6'));var logger=require(_0x2285('0x7'))(_0x2285('0x8'));var config=require(_0x2285('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2285('0xa')][_0x2285('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d4759,_0x5f5129,_0x622730){return new BPromise(function(_0x44b8b2,_0x23fb30){return client[_0x2285('0xc')](_0x3d4759,_0x622730)['then'](function(_0x7da642){logger[_0x2285('0xd')](_0x2285('0xe'),_0x5f5129,'request\x20sent');logger[_0x2285('0xf')](_0x2285('0x10'),_0x5f5129,'request\x20sent',JSON[_0x2285('0x11')](_0x7da642));if(_0x7da642[_0x2285('0x12')]){if(_0x7da642[_0x2285('0x12')][_0x2285('0x13')]===0x1f4){logger['error'](_0x2285('0xe'),_0x5f5129,_0x7da642[_0x2285('0x12')]['message']);return _0x23fb30(_0x7da642['error'][_0x2285('0x14')]);}logger[_0x2285('0x12')](_0x2285('0xe'),_0x5f5129,_0x7da642['error'][_0x2285('0x14')]);return _0x44b8b2(_0x7da642[_0x2285('0x12')][_0x2285('0x14')]);}else{logger[_0x2285('0xd')](_0x2285('0xe'),_0x5f5129,_0x2285('0x15'));_0x44b8b2(_0x7da642[_0x2285('0x16')][_0x2285('0x14')]);}})['catch'](function(_0x1eb1c1){logger[_0x2285('0x12')](_0x2285('0xe'),_0x5f5129,_0x1eb1c1);_0x23fb30(_0x1eb1c1);});});}exports[_0x2285('0x17')]=function(_0x59b432){var _0x327269=this;return new Promise(function(_0x56c80a,_0x356833){return db['ChatQueueReport'][_0x2285('0x18')](_0x59b432[_0x2285('0x19')],{'raw':_0x59b432['options']?_0x59b432['options'][_0x2285('0x1a')]===undefined?!![]:![]:!![]})[_0x2285('0x1b')](function(_0x9bafec){logger[_0x2285('0xd')](_0x2285('0x17'),_0x59b432);logger[_0x2285('0xf')](_0x2285('0x17'),_0x59b432,JSON['stringify'](_0x9bafec));_0x56c80a(_0x9bafec);})[_0x2285('0x1c')](function(_0x4d6e02){logger['error']('CreateChatQueueReport',_0x4d6e02['message'],_0x59b432);_0x356833(_0x327269[_0x2285('0x12')](0x1f4,_0x4d6e02['message']));});});};exports['UpdateChatQueueReport']=function(_0x882963){var _0x380efc=this;return new Promise(function(_0x258229,_0x310bf8){return db['ChatQueueReport'][_0x2285('0x1d')](_0x882963[_0x2285('0x19')],{'raw':_0x882963['options']?_0x882963[_0x2285('0x1e')][_0x2285('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x882963[_0x2285('0x1e')]?_0x882963[_0x2285('0x1e')][_0x2285('0x1f')]||null:null,'attributes':_0x882963[_0x2285('0x1e')]?_0x882963[_0x2285('0x1e')]['attributes']||null:null,'limit':_0x882963[_0x2285('0x1e')]?_0x882963[_0x2285('0x1e')][_0x2285('0x20')]||null:null})[_0x2285('0x1b')](function(_0x2b0abc){logger[_0x2285('0xd')](_0x2285('0x21'),_0x882963);logger[_0x2285('0xf')](_0x2285('0x21'),_0x882963,JSON['stringify'](_0x2b0abc));_0x258229(_0x2b0abc);})[_0x2285('0x1c')](function(_0x4178c1){logger[_0x2285('0x12')](_0x2285('0x21'),_0x4178c1['message'],_0x882963);_0x310bf8(_0x380efc[_0x2285('0x12')](0x1f4,_0x4178c1[_0x2285('0x14')]));});});};
\ No newline at end of file
+var _0x470a=['attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x470a,0x11a));var _0xa470=function(_0x4f7b81,_0x55674f){_0x4f7b81=_0x4f7b81-0x0;var _0x4a98f0=_0x470a[_0x4f7b81];return _0x4a98f0;};'use strict';var _=require(_0xa470('0x0'));var util=require(_0xa470('0x1'));var moment=require(_0xa470('0x2'));var BPromise=require(_0xa470('0x3'));var rs=require(_0xa470('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa470('0x5'))['db'];var utils=require(_0xa470('0x6'));var logger=require(_0xa470('0x7'))(_0xa470('0x8'));var config=require(_0xa470('0x9'));var jayson=require(_0xa470('0xa'));var client=jayson[_0xa470('0xb')][_0xa470('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x350b6d,_0x48a1d1,_0x3d6e42){return new BPromise(function(_0xbbc755,_0x11865d){return client[_0xa470('0xd')](_0x350b6d,_0x3d6e42)[_0xa470('0xe')](function(_0x5c4852){logger[_0xa470('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x48a1d1,'request\x20sent');logger[_0xa470('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x48a1d1,'request\x20sent',JSON[_0xa470('0x11')](_0x5c4852));if(_0x5c4852[_0xa470('0x12')]){if(_0x5c4852[_0xa470('0x12')][_0xa470('0x13')]===0x1f4){logger[_0xa470('0x12')](_0xa470('0x14'),_0x48a1d1,_0x5c4852['error'][_0xa470('0x15')]);return _0x11865d(_0x5c4852[_0xa470('0x12')][_0xa470('0x15')]);}logger[_0xa470('0x12')](_0xa470('0x14'),_0x48a1d1,_0x5c4852[_0xa470('0x12')]['message']);return _0xbbc755(_0x5c4852['error'][_0xa470('0x15')]);}else{logger[_0xa470('0xf')](_0xa470('0x14'),_0x48a1d1,_0xa470('0x16'));_0xbbc755(_0x5c4852[_0xa470('0x17')][_0xa470('0x15')]);}})[_0xa470('0x18')](function(_0x39d5d4){logger[_0xa470('0x12')](_0xa470('0x14'),_0x48a1d1,_0x39d5d4);_0x11865d(_0x39d5d4);});});}exports[_0xa470('0x19')]=function(_0x53a241){var _0x105052=this;return new Promise(function(_0x1c8b14,_0x3b98e1){return db[_0xa470('0x1a')][_0xa470('0x1b')](_0x53a241[_0xa470('0x1c')],{'raw':_0x53a241[_0xa470('0x1d')]?_0x53a241[_0xa470('0x1d')][_0xa470('0x1e')]===undefined?!![]:![]:!![]})[_0xa470('0xe')](function(_0x2806eb){logger[_0xa470('0xf')]('CreateChatQueueReport',_0x53a241);logger['debug']('CreateChatQueueReport',_0x53a241,JSON[_0xa470('0x11')](_0x2806eb));_0x1c8b14(_0x2806eb);})[_0xa470('0x18')](function(_0x5166fd){logger['error']('CreateChatQueueReport',_0x5166fd[_0xa470('0x15')],_0x53a241);_0x3b98e1(_0x105052[_0xa470('0x12')](0x1f4,_0x5166fd[_0xa470('0x15')]));});});};exports[_0xa470('0x1f')]=function(_0x4a5c44){var _0x2f6f22=this;return new Promise(function(_0x38af42,_0x5bd87a){return db[_0xa470('0x1a')]['update'](_0x4a5c44['body'],{'raw':_0x4a5c44[_0xa470('0x1d')]?_0x4a5c44[_0xa470('0x1d')][_0xa470('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a5c44[_0xa470('0x1d')]?_0x4a5c44[_0xa470('0x1d')][_0xa470('0x20')]||null:null,'attributes':_0x4a5c44['options']?_0x4a5c44[_0xa470('0x1d')][_0xa470('0x21')]||null:null,'limit':_0x4a5c44['options']?_0x4a5c44[_0xa470('0x1d')][_0xa470('0x22')]||null:null})[_0xa470('0xe')](function(_0x112d85){logger[_0xa470('0xf')](_0xa470('0x1f'),_0x4a5c44);logger[_0xa470('0x10')](_0xa470('0x1f'),_0x4a5c44,JSON[_0xa470('0x11')](_0x112d85));_0x38af42(_0x112d85);})[_0xa470('0x18')](function(_0x167048){logger[_0xa470('0x12')](_0xa470('0x1f'),_0x167048[_0xa470('0x15')],_0x4a5c44);_0x5bd87a(_0x2f6f22['error'](0x1f4,_0x167048[_0xa470('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 486f639..c706cb0 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f6e=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','show','put','/:id','delete'];(function(_0x3bcf4c,_0x381452){var _0x16d05a=function(_0x265ff8){while(--_0x265ff8){_0x3bcf4c['push'](_0x3bcf4c['shift']());}};_0x16d05a(++_0x381452);}(_0x1f6e,0x1a0));var _0xe1f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f6e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe1f6('0x0'));var util=require(_0xe1f6('0x1'));var path=require('path');var timeout=require(_0xe1f6('0x2'));var express=require(_0xe1f6('0x3'));var router=express[_0xe1f6('0x4')]();var auth=require(_0xe1f6('0x5'));var interaction=require(_0xe1f6('0x6'));var config=require(_0xe1f6('0x7'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xe1f6('0x8')](),controller[_0xe1f6('0x9')]);router[_0xe1f6('0xa')]('/describe',auth[_0xe1f6('0x8')](),controller[_0xe1f6('0xb')]);router[_0xe1f6('0xa')]('/:id',auth[_0xe1f6('0x8')](),controller[_0xe1f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe1f6('0xd')](_0xe1f6('0xe'),auth[_0xe1f6('0x8')](),controller['update']);router[_0xe1f6('0xf')](_0xe1f6('0xe'),auth[_0xe1f6('0x8')](),controller[_0xe1f6('0x10')]);module[_0xe1f6('0x11')]=router;
\ No newline at end of file
+var _0xde94=['multer','connect-timeout','Router','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports'];(function(_0x35155b,_0x16398b){var _0x560845=function(_0x468db0){while(--_0x468db0){_0x35155b['push'](_0x35155b['shift']());}};_0x560845(++_0x16398b);}(_0xde94,0x1cb));var _0x4de9=function(_0x1618c8,_0x25022b){_0x1618c8=_0x1618c8-0x0;var _0x44723e=_0xde94[_0x1618c8];return _0x44723e;};'use strict';var multer=require(_0x4de9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4de9('0x1'));var express=require('express');var router=express[_0x4de9('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x4de9('0x3'));var config=require('../../config/environment');var controller=require(_0x4de9('0x4'));router[_0x4de9('0x5')]('/',auth[_0x4de9('0x6')](),controller[_0x4de9('0x7')]);router['get'](_0x4de9('0x8'),auth['isAuthenticated'](),controller[_0x4de9('0x9')]);router[_0x4de9('0x5')](_0x4de9('0xa'),auth[_0x4de9('0x6')](),controller[_0x4de9('0xb')]);router['post']('/',auth[_0x4de9('0x6')](),controller['create']);router[_0x4de9('0xc')]('/:id',auth[_0x4de9('0x6')](),controller[_0x4de9('0xd')]);router[_0x4de9('0xe')](_0x4de9('0xa'),auth[_0x4de9('0x6')](),controller[_0x4de9('0xf')]);module[_0x4de9('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index aae4b87..78846f7 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b76=['queue','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2b76,0x19a));var _0x62b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2b76[_0x42cae2];return _0x5f256f;};'use strict';var moment=require(_0x62b7('0x0'));var Sequelize=require(_0x62b7('0x1'));module[_0x62b7('0x2')]={'uniqueid':{'type':Sequelize[_0x62b7('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x62b7('0x4'),_0x62b7('0x5'),_0x62b7('0x6')),'allowNull':![],'defaultValue':_0x62b7('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x62b7('0x7')]}};
\ No newline at end of file
+var _0x5e11=['moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x2cb6e2,_0x1cd621){var _0x29cf20=function(_0x158c7d){while(--_0x158c7d){_0x2cb6e2['push'](_0x2cb6e2['shift']());}};_0x29cf20(++_0x1cd621);}(_0x5e11,0x8c));var _0x15e1=function(_0x4fda88,_0x1a4d19){_0x4fda88=_0x4fda88-0x0;var _0xe37511=_0x5e11[_0x4fda88];return _0xe37511;};'use strict';var moment=require(_0x15e1('0x0'));var Sequelize=require(_0x15e1('0x1'));module[_0x15e1('0x2')]={'uniqueid':{'type':Sequelize[_0x15e1('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x15e1('0x4')](_0x15e1('0x5'),_0x15e1('0x6'),'queue'),'allowNull':![],'defaultValue':_0x15e1('0x7')},'transferredAt':{'type':Sequelize[_0x15e1('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x15e1('0x9')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 2867ddb..98749f6 100644
--- a/server/api/chatTransferReport/chatTransferReport.controller.js
+++ b/server/api/chatTransferReport/chatTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x28cc=['attributes','fields','length','query','nolimit','order','sort','filters','pick','filter','where','ChatTransferReport','includeAll','include','findAll','show','intersection','merge','options','catch','create','body','update','find','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','then','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','map','keys'];(function(_0x37d9b3,_0x370f99){var _0x435f66=function(_0x14c62b){while(--_0x14c62b){_0x37d9b3['push'](_0x37d9b3['shift']());}};_0x435f66(++_0x370f99);}(_0x28cc,0x17d));var _0xc28c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x28cc[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xc28c('0x0'));var emlformat=require(_0xc28c('0x1'));var rimraf=require(_0xc28c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc28c('0x3'));var rp=require(_0xc28c('0x4'));var moment=require('moment');var BPromise=require(_0xc28c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc28c('0x6'));var csv=require('to-csv');var ejs=require(_0xc28c('0x7'));var fs=require('fs');var _=require(_0xc28c('0x8'));var squel=require(_0xc28c('0x9'));var crypto=require(_0xc28c('0xa'));var jsforce=require(_0xc28c('0xb'));var deskjs=require(_0xc28c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc28c('0xd'));var Papa=require(_0xc28c('0xe'));var Redis=require(_0xc28c('0xf'));var authService=require(_0xc28c('0x10'));var qs=require(_0xc28c('0x11'));var as=require(_0xc28c('0x12'));var hardwareService=require(_0xc28c('0x13'));var logger=require('../../config/logger')(_0xc28c('0x14'));var utils=require(_0xc28c('0x15'));var config=require(_0xc28c('0x16'));var db=require(_0xc28c('0x17'))['db'];function respondWithStatusCode(_0x262cdd,_0x52faf7){_0x52faf7=_0x52faf7||0xcc;return function(_0x3ccb1c){if(_0x3ccb1c){return _0x262cdd[_0xc28c('0x18')](_0x52faf7);}return _0x262cdd['status'](_0x52faf7)[_0xc28c('0x19')]();};}function respondWithResult(_0x4f4820,_0x36389c){_0x36389c=_0x36389c||0xc8;return function(_0x4d9103){if(_0x4d9103){return _0x4f4820[_0xc28c('0x1a')](_0x36389c)[_0xc28c('0x1b')](_0x4d9103);}};}function respondWithFilteredResult(_0x293139,_0x24a4e2){return function(_0xacb8cb){if(_0xacb8cb){var _0x23bdbd=_0xacb8cb[_0xc28c('0x1c')],_0x1cbf31=_0x24a4e2[_0xc28c('0x1d')],_0x1a4d3c=_0x24a4e2[_0xc28c('0x1d')]+_0x24a4e2[_0xc28c('0x1e')],_0x3dd199;if(_0x1a4d3c>=_0x23bdbd){_0x1a4d3c=_0x23bdbd;_0x3dd199=0xc8;}else{_0x3dd199=0xce;}_0x293139[_0xc28c('0x1a')](_0x3dd199);return _0x293139[_0xc28c('0x1f')](_0xc28c('0x20'),_0x1cbf31+'-'+_0x1a4d3c+'/'+_0x23bdbd)[_0xc28c('0x1b')](_0xacb8cb);}return null;};}function patchUpdates(_0x4af4e0){return function(_0x5aa8d8){try{jsonpatch['apply'](_0x5aa8d8,_0x4af4e0,!![]);}catch(_0x151e02){return BPromise['reject'](_0x151e02);}return _0x5aa8d8['save']();};}function saveUpdates(_0x5ca826,_0x33f7e7){return function(_0x2b97c7){if(_0x2b97c7){return _0x2b97c7['update'](_0x5ca826)[_0xc28c('0x21')](function(_0x49b884){return _0x49b884;});}return null;};}function removeEntity(_0x12d48f,_0x2f33a6){return function(_0x4998af){if(_0x4998af){return _0x4998af[_0xc28c('0x22')]()[_0xc28c('0x21')](function(){_0x12d48f[_0xc28c('0x1a')](0xcc)[_0xc28c('0x19')]();});}};}function handleEntityNotFound(_0x3134d1,_0x15cc35){return function(_0x40ab0d){if(!_0x40ab0d){_0x3134d1[_0xc28c('0x18')](0x194);}return _0x40ab0d;};}function handleError(_0xec532b,_0x4f1793){_0x4f1793=_0x4f1793||0x1f4;return function(_0x142ebe){logger[_0xc28c('0x23')](_0x142ebe[_0xc28c('0x24')]);if(_0x142ebe[_0xc28c('0x25')]){delete _0x142ebe[_0xc28c('0x25')];}_0xec532b[_0xc28c('0x1a')](_0x4f1793)['send'](_0x142ebe);};}exports['index']=function(_0x4f749c,_0x4dbb81){var _0x1ba3d4={},_0x18e55c={},_0x27d6dd={'count':0x0,'rows':[]};var _0xd35539=_['map'](db['ChatTransferReport'][_0xc28c('0x26')],function(_0xa79607){return{'name':_0xa79607[_0xc28c('0x27')],'type':_0xa79607[_0xc28c('0x28')][_0xc28c('0x29')]};});_0x18e55c[_0xc28c('0x2a')]=_[_0xc28c('0x2b')](_0xd35539,_0xc28c('0x25'));_0x18e55c['query']=_[_0xc28c('0x2c')](_0x4f749c['query']);_0x18e55c['filters']=_['intersection'](_0x18e55c[_0xc28c('0x2a')],_0x18e55c['query']);_0x1ba3d4[_0xc28c('0x2d')]=_['intersection'](_0x18e55c[_0xc28c('0x2a')],qs[_0xc28c('0x2e')](_0x4f749c['query']['fields']));_0x1ba3d4[_0xc28c('0x2d')]=_0x1ba3d4['attributes'][_0xc28c('0x2f')]?_0x1ba3d4['attributes']:_0x18e55c[_0xc28c('0x2a')];if(!_0x4f749c[_0xc28c('0x30')]['hasOwnProperty'](_0xc28c('0x31'))){_0x1ba3d4['limit']=qs[_0xc28c('0x1e')](_0x4f749c[_0xc28c('0x30')][_0xc28c('0x1e')]);_0x1ba3d4[_0xc28c('0x1d')]=qs['offset'](_0x4f749c['query'][_0xc28c('0x1d')]);}_0x1ba3d4[_0xc28c('0x32')]=qs[_0xc28c('0x33')](_0x4f749c[_0xc28c('0x30')][_0xc28c('0x33')]);_0x1ba3d4['where']=qs[_0xc28c('0x34')](_[_0xc28c('0x35')](_0x4f749c[_0xc28c('0x30')],_0x18e55c[_0xc28c('0x34')]),_0xd35539);if(_0x4f749c[_0xc28c('0x30')][_0xc28c('0x36')]){_0x1ba3d4['where']=_['merge'](_0x1ba3d4[_0xc28c('0x37')],{'$or':_[_0xc28c('0x2b')](_0xd35539,function(_0x2beff1){if(_0x2beff1[_0xc28c('0x28')]!=='VIRTUAL'){var _0x3869be={};_0x3869be[_0x2beff1['name']]={'$like':'%'+_0x4f749c['query'][_0xc28c('0x36')]+'%'};return _0x3869be;}})});}_0x1ba3d4=_['merge']({},_0x1ba3d4,_0x4f749c['options']);var _0x3a00d8={'where':_0x1ba3d4[_0xc28c('0x37')]};return db[_0xc28c('0x38')]['count'](_0x3a00d8)[_0xc28c('0x21')](function(_0x418f33){_0x27d6dd[_0xc28c('0x1c')]=_0x418f33;if(_0x4f749c[_0xc28c('0x30')][_0xc28c('0x39')]){_0x1ba3d4[_0xc28c('0x3a')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xc28c('0x3b')](_0x1ba3d4);})['then'](function(_0x34d928){_0x27d6dd['rows']=_0x34d928;return _0x27d6dd;})['then'](respondWithFilteredResult(_0x4dbb81,_0x1ba3d4))['catch'](handleError(_0x4dbb81,null));};exports[_0xc28c('0x3c')]=function(_0x3457e5,_0x19bfbb){var _0x28b007={'raw':!![],'where':{'id':_0x3457e5['params']['id']}},_0x52ce04={};_0x52ce04[_0xc28c('0x2a')]=_[_0xc28c('0x2c')](db[_0xc28c('0x38')][_0xc28c('0x26')]);_0x52ce04[_0xc28c('0x30')]=_[_0xc28c('0x2c')](_0x3457e5[_0xc28c('0x30')]);_0x52ce04[_0xc28c('0x34')]=_[_0xc28c('0x3d')](_0x52ce04[_0xc28c('0x2a')],_0x52ce04[_0xc28c('0x30')]);_0x28b007[_0xc28c('0x2d')]=_[_0xc28c('0x3d')](_0x52ce04[_0xc28c('0x2a')],qs[_0xc28c('0x2e')](_0x3457e5[_0xc28c('0x30')][_0xc28c('0x2e')]));_0x28b007['attributes']=_0x28b007[_0xc28c('0x2d')]['length']?_0x28b007['attributes']:_0x52ce04[_0xc28c('0x2a')];if(_0x3457e5['query'][_0xc28c('0x39')]){_0x28b007[_0xc28c('0x3a')]=[{'all':!![]}];}_0x28b007=_[_0xc28c('0x3e')]({},_0x28b007,_0x3457e5[_0xc28c('0x3f')]);return db[_0xc28c('0x38')]['find'](_0x28b007)[_0xc28c('0x21')](handleEntityNotFound(_0x19bfbb,null))[_0xc28c('0x21')](respondWithResult(_0x19bfbb,null))[_0xc28c('0x40')](handleError(_0x19bfbb,null));};exports[_0xc28c('0x41')]=function(_0x46c7c1,_0x2809af){return db['ChatTransferReport'][_0xc28c('0x41')](_0x46c7c1[_0xc28c('0x42')],{})[_0xc28c('0x21')](respondWithResult(_0x2809af,0xc9))[_0xc28c('0x40')](handleError(_0x2809af,null));};exports[_0xc28c('0x43')]=function(_0x3dd417,_0x21cb4c){if(_0x3dd417[_0xc28c('0x42')]['id']){delete _0x3dd417[_0xc28c('0x42')]['id'];}return db['ChatTransferReport'][_0xc28c('0x44')]({'where':{'id':_0x3dd417['params']['id']}})[_0xc28c('0x21')](handleEntityNotFound(_0x21cb4c,null))[_0xc28c('0x21')](saveUpdates(_0x3dd417['body'],null))[_0xc28c('0x21')](respondWithResult(_0x21cb4c,null))[_0xc28c('0x40')](handleError(_0x21cb4c,null));};exports[_0xc28c('0x22')]=function(_0x55aff2,_0x18b73b){return db[_0xc28c('0x38')]['find']({'where':{'id':_0x55aff2[_0xc28c('0x45')]['id']}})[_0xc28c('0x21')](handleEntityNotFound(_0x18b73b,null))[_0xc28c('0x21')](removeEntity(_0x18b73b,null))[_0xc28c('0x40')](handleError(_0x18b73b,null));};exports[_0xc28c('0x46')]=function(_0x17435d,_0x1cd510){return db[_0xc28c('0x38')][_0xc28c('0x46')]()[_0xc28c('0x21')](respondWithResult(_0x1cd510,null))[_0xc28c('0x40')](handleError(_0x1cd510,null));};
\ No newline at end of file
+var _0xb09b=['map','ChatTransferReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index'];(function(_0x4bacd8,_0x605aa){var _0xb8b27c=function(_0x3391fb){while(--_0x3391fb){_0x4bacd8['push'](_0x4bacd8['shift']());}};_0xb8b27c(++_0x605aa);}(_0xb09b,0x1d0));var _0xbb09=function(_0x2deac4,_0xc27a2b){_0x2deac4=_0x2deac4-0x0;var _0x1c0bda=_0xb09b[_0x2deac4];return _0x1c0bda;};'use strict';var pdf=require(_0xbb09('0x0'));var emlformat=require(_0xbb09('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbb09('0x2'));var jsonpatch=require(_0xbb09('0x3'));var rp=require(_0xbb09('0x4'));var moment=require(_0xbb09('0x5'));var BPromise=require(_0xbb09('0x6'));var Mustache=require(_0xbb09('0x7'));var util=require(_0xbb09('0x8'));var path=require(_0xbb09('0x9'));var sox=require(_0xbb09('0xa'));var csv=require(_0xbb09('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb09('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb09('0xd'));var deskjs=require(_0xbb09('0xe'));var toCsv=require(_0xbb09('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbb09('0xf'));var authService=require(_0xbb09('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb09('0x11'));var logger=require(_0xbb09('0x12'))(_0xbb09('0x13'));var utils=require('../../config/utils');var config=require(_0xbb09('0x14'));var db=require(_0xbb09('0x15'))['db'];function respondWithStatusCode(_0x1682d8,_0x573e62){_0x573e62=_0x573e62||0xcc;return function(_0x4138c6){if(_0x4138c6){return _0x1682d8['sendStatus'](_0x573e62);}return _0x1682d8[_0xbb09('0x16')](_0x573e62)['end']();};}function respondWithResult(_0x2e1a3a,_0x17b2ba){_0x17b2ba=_0x17b2ba||0xc8;return function(_0xeb67bb){if(_0xeb67bb){return _0x2e1a3a[_0xbb09('0x16')](_0x17b2ba)[_0xbb09('0x17')](_0xeb67bb);}};}function respondWithFilteredResult(_0x2af8be,_0x308a83){return function(_0x29dcf6){if(_0x29dcf6){var _0x3aeb4a=_0x29dcf6['count'],_0x26344b=_0x308a83[_0xbb09('0x18')],_0x56528a=_0x308a83[_0xbb09('0x18')]+_0x308a83[_0xbb09('0x19')],_0x142ffd;if(_0x56528a>=_0x3aeb4a){_0x56528a=_0x3aeb4a;_0x142ffd=0xc8;}else{_0x142ffd=0xce;}_0x2af8be[_0xbb09('0x16')](_0x142ffd);return _0x2af8be[_0xbb09('0x1a')](_0xbb09('0x1b'),_0x26344b+'-'+_0x56528a+'/'+_0x3aeb4a)[_0xbb09('0x17')](_0x29dcf6);}return null;};}function patchUpdates(_0x3547a0){return function(_0x477124){try{jsonpatch[_0xbb09('0x1c')](_0x477124,_0x3547a0,!![]);}catch(_0x489b91){return BPromise[_0xbb09('0x1d')](_0x489b91);}return _0x477124['save']();};}function saveUpdates(_0x4cf7f8,_0x5930d3){return function(_0x349b84){if(_0x349b84){return _0x349b84[_0xbb09('0x1e')](_0x4cf7f8)[_0xbb09('0x1f')](function(_0x104532){return _0x104532;});}return null;};}function removeEntity(_0x5b9ec7,_0x3777ab){return function(_0x1b6e2c){if(_0x1b6e2c){return _0x1b6e2c[_0xbb09('0x20')]()[_0xbb09('0x1f')](function(){_0x5b9ec7[_0xbb09('0x16')](0xcc)[_0xbb09('0x21')]();});}};}function handleEntityNotFound(_0x56dbe2,_0x1def59){return function(_0x1b7705){if(!_0x1b7705){_0x56dbe2[_0xbb09('0x22')](0x194);}return _0x1b7705;};}function handleError(_0x159ced,_0x49b9a1){_0x49b9a1=_0x49b9a1||0x1f4;return function(_0x108383){logger[_0xbb09('0x23')](_0x108383[_0xbb09('0x24')]);if(_0x108383[_0xbb09('0x25')]){delete _0x108383['name'];}_0x159ced[_0xbb09('0x16')](_0x49b9a1)[_0xbb09('0x26')](_0x108383);};}exports[_0xbb09('0x27')]=function(_0x2cde86,_0x14cc8c){var _0x220811={},_0x142965={},_0x9e3b7a={'count':0x0,'rows':[]};var _0x541799=_[_0xbb09('0x28')](db[_0xbb09('0x29')][_0xbb09('0x2a')],function(_0x52523e){return{'name':_0x52523e['fieldName'],'type':_0x52523e[_0xbb09('0x2b')][_0xbb09('0x2c')]};});_0x142965[_0xbb09('0x2d')]=_['map'](_0x541799,'name');_0x142965[_0xbb09('0x2e')]=_[_0xbb09('0x2f')](_0x2cde86[_0xbb09('0x2e')]);_0x142965[_0xbb09('0x30')]=_['intersection'](_0x142965[_0xbb09('0x2d')],_0x142965['query']);_0x220811[_0xbb09('0x31')]=_[_0xbb09('0x32')](_0x142965[_0xbb09('0x2d')],qs[_0xbb09('0x33')](_0x2cde86[_0xbb09('0x2e')][_0xbb09('0x33')]));_0x220811[_0xbb09('0x31')]=_0x220811[_0xbb09('0x31')][_0xbb09('0x34')]?_0x220811[_0xbb09('0x31')]:_0x142965[_0xbb09('0x2d')];if(!_0x2cde86[_0xbb09('0x2e')][_0xbb09('0x35')]('nolimit')){_0x220811[_0xbb09('0x19')]=qs['limit'](_0x2cde86['query'][_0xbb09('0x19')]);_0x220811[_0xbb09('0x18')]=qs[_0xbb09('0x18')](_0x2cde86[_0xbb09('0x2e')]['offset']);}_0x220811[_0xbb09('0x36')]=qs['sort'](_0x2cde86['query']['sort']);_0x220811[_0xbb09('0x37')]=qs[_0xbb09('0x30')](_[_0xbb09('0x38')](_0x2cde86['query'],_0x142965[_0xbb09('0x30')]),_0x541799);if(_0x2cde86['query'][_0xbb09('0x39')]){_0x220811[_0xbb09('0x37')]=_['merge'](_0x220811[_0xbb09('0x37')],{'$or':_[_0xbb09('0x28')](_0x541799,function(_0x5de99e){if(_0x5de99e['type']!=='VIRTUAL'){var _0xe1cd4b={};_0xe1cd4b[_0x5de99e[_0xbb09('0x25')]]={'$like':'%'+_0x2cde86[_0xbb09('0x2e')][_0xbb09('0x39')]+'%'};return _0xe1cd4b;}})});}_0x220811=_[_0xbb09('0x3a')]({},_0x220811,_0x2cde86[_0xbb09('0x3b')]);var _0x13646c={'where':_0x220811[_0xbb09('0x37')]};return db['ChatTransferReport'][_0xbb09('0x3c')](_0x13646c)[_0xbb09('0x1f')](function(_0x440f09){_0x9e3b7a[_0xbb09('0x3c')]=_0x440f09;if(_0x2cde86[_0xbb09('0x2e')][_0xbb09('0x3d')]){_0x220811[_0xbb09('0x3e')]=[{'all':!![]}];}return db[_0xbb09('0x29')][_0xbb09('0x3f')](_0x220811);})[_0xbb09('0x1f')](function(_0x47c7af){_0x9e3b7a[_0xbb09('0x40')]=_0x47c7af;return _0x9e3b7a;})[_0xbb09('0x1f')](respondWithFilteredResult(_0x14cc8c,_0x220811))[_0xbb09('0x41')](handleError(_0x14cc8c,null));};exports[_0xbb09('0x42')]=function(_0x1403ef,_0x3fdffd){var _0x587399={'raw':!![],'where':{'id':_0x1403ef[_0xbb09('0x43')]['id']}},_0x2f4e4a={};_0x2f4e4a[_0xbb09('0x2d')]=_['keys'](db[_0xbb09('0x29')][_0xbb09('0x2a')]);_0x2f4e4a[_0xbb09('0x2e')]=_[_0xbb09('0x2f')](_0x1403ef[_0xbb09('0x2e')]);_0x2f4e4a[_0xbb09('0x30')]=_[_0xbb09('0x32')](_0x2f4e4a[_0xbb09('0x2d')],_0x2f4e4a[_0xbb09('0x2e')]);_0x587399[_0xbb09('0x31')]=_[_0xbb09('0x32')](_0x2f4e4a['model'],qs[_0xbb09('0x33')](_0x1403ef[_0xbb09('0x2e')]['fields']));_0x587399[_0xbb09('0x31')]=_0x587399[_0xbb09('0x31')][_0xbb09('0x34')]?_0x587399[_0xbb09('0x31')]:_0x2f4e4a['model'];if(_0x1403ef[_0xbb09('0x2e')]['includeAll']){_0x587399[_0xbb09('0x3e')]=[{'all':!![]}];}_0x587399=_[_0xbb09('0x3a')]({},_0x587399,_0x1403ef[_0xbb09('0x3b')]);return db[_0xbb09('0x29')]['find'](_0x587399)[_0xbb09('0x1f')](handleEntityNotFound(_0x3fdffd,null))[_0xbb09('0x1f')](respondWithResult(_0x3fdffd,null))[_0xbb09('0x41')](handleError(_0x3fdffd,null));};exports[_0xbb09('0x44')]=function(_0x5824fb,_0x4e6c09){return db[_0xbb09('0x29')][_0xbb09('0x44')](_0x5824fb['body'],{})[_0xbb09('0x1f')](respondWithResult(_0x4e6c09,0xc9))[_0xbb09('0x41')](handleError(_0x4e6c09,null));};exports[_0xbb09('0x1e')]=function(_0x329c8b,_0x59119f){if(_0x329c8b[_0xbb09('0x45')]['id']){delete _0x329c8b['body']['id'];}return db['ChatTransferReport'][_0xbb09('0x46')]({'where':{'id':_0x329c8b[_0xbb09('0x43')]['id']}})[_0xbb09('0x1f')](handleEntityNotFound(_0x59119f,null))[_0xbb09('0x1f')](saveUpdates(_0x329c8b[_0xbb09('0x45')],null))[_0xbb09('0x1f')](respondWithResult(_0x59119f,null))[_0xbb09('0x41')](handleError(_0x59119f,null));};exports[_0xbb09('0x20')]=function(_0x917ab7,_0x34471f){return db[_0xbb09('0x29')]['find']({'where':{'id':_0x917ab7[_0xbb09('0x43')]['id']}})[_0xbb09('0x1f')](handleEntityNotFound(_0x34471f,null))['then'](removeEntity(_0x34471f,null))['catch'](handleError(_0x34471f,null));};exports[_0xbb09('0x47')]=function(_0x3e7bd,_0x1cdfd2){return db[_0xbb09('0x29')][_0xbb09('0x47')]()['then'](respondWithResult(_0x1cdfd2,null))['catch'](handleError(_0x1cdfd2,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index bc814ff..784da34 100644
--- a/server/api/chatTransferReport/chatTransferReport.model.js
+++ b/server/api/chatTransferReport/chatTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x15fc7a,_0xd21741){var _0x3aa9f4=function(_0x313108){while(--_0x313108){_0x15fc7a['push'](_0x15fc7a['shift']());}};_0x3aa9f4(++_0xd21741);}(_0x34e8,0x12c));var _0x834e=function(_0x3fc056,_0x41564d){_0x3fc056=_0x3fc056-0x0;var _0x78310c=_0x34e8[_0x3fc056];return _0x78310c;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[{'name':_0x834e('0xd'),'fields':[_0x834e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','bluebird'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x55ca,0x126));var _0xa55c=function(_0x1e2372,_0x2ea876){_0x1e2372=_0x1e2372-0x0;var _0x4cd59b=_0x55ca[_0x1e2372];return _0x4cd59b;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('ChatTransferReport',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[{'name':_0xa55c('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index a7d4996..fc60db6 100644
--- a/server/api/chatTransferReport/chatTransferReport.rpc.js
+++ b/server/api/chatTransferReport/chatTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ec4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird'];(function(_0x492397,_0xea5f96){var _0x4679f7=function(_0x5d44c0){while(--_0x5d44c0){_0x492397['push'](_0x492397['shift']());}};_0x4679f7(++_0xea5f96);}(_0x2ec4,0x1b1));var _0x42ec=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2ec4[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x42ec('0x0'));var util=require(_0x42ec('0x1'));var moment=require(_0x42ec('0x2'));var BPromise=require(_0x42ec('0x3'));var rs=require(_0x42ec('0x4'));var fs=require('fs');var Redis=require(_0x42ec('0x5'));var db=require(_0x42ec('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x42ec('0x7'))(_0x42ec('0x8'));var config=require(_0x42ec('0x9'));var jayson=require(_0x42ec('0xa'));var client=jayson['client'][_0x42ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56adac,_0x46ef07,_0x375600){return new BPromise(function(_0x4dfe48,_0x218d90){return client[_0x42ec('0xc')](_0x56adac,_0x375600)[_0x42ec('0xd')](function(_0x7746b4){logger['info'](_0x42ec('0xe'),_0x46ef07,_0x42ec('0xf'));logger[_0x42ec('0x10')](_0x42ec('0x11'),_0x46ef07,'request\x20sent',JSON[_0x42ec('0x12')](_0x7746b4));if(_0x7746b4[_0x42ec('0x13')]){if(_0x7746b4[_0x42ec('0x13')]['code']===0x1f4){logger[_0x42ec('0x13')](_0x42ec('0xe'),_0x46ef07,_0x7746b4['error']['message']);return _0x218d90(_0x7746b4['error']['message']);}logger[_0x42ec('0x13')](_0x42ec('0xe'),_0x46ef07,_0x7746b4['error'][_0x42ec('0x14')]);return _0x4dfe48(_0x7746b4[_0x42ec('0x13')][_0x42ec('0x14')]);}else{logger[_0x42ec('0x15')](_0x42ec('0xe'),_0x46ef07,_0x42ec('0xf'));_0x4dfe48(_0x7746b4['result'][_0x42ec('0x14')]);}})[_0x42ec('0x16')](function(_0x49d863){logger[_0x42ec('0x13')](_0x42ec('0xe'),_0x46ef07,_0x49d863);_0x218d90(_0x49d863);});});}
\ No newline at end of file
+var _0x7134=['info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7134,0x78));var _0x4713=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7134[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4713('0x0'));var util=require(_0x4713('0x1'));var moment=require(_0x4713('0x2'));var BPromise=require(_0x4713('0x3'));var rs=require(_0x4713('0x4'));var fs=require('fs');var Redis=require(_0x4713('0x5'));var db=require(_0x4713('0x6'))['db'];var utils=require(_0x4713('0x7'));var logger=require(_0x4713('0x8'))(_0x4713('0x9'));var config=require(_0x4713('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4713('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x313d10,_0x13a61d,_0x24afc7){return new BPromise(function(_0x20ad13,_0x34fdaa){return client['request'](_0x313d10,_0x24afc7)['then'](function(_0x59da0f){logger[_0x4713('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x13a61d,_0x4713('0xd'));logger[_0x4713('0xe')](_0x4713('0xf'),_0x13a61d,'request\x20sent',JSON['stringify'](_0x59da0f));if(_0x59da0f[_0x4713('0x10')]){if(_0x59da0f['error'][_0x4713('0x11')]===0x1f4){logger['error'](_0x4713('0x12'),_0x13a61d,_0x59da0f[_0x4713('0x10')][_0x4713('0x13')]);return _0x34fdaa(_0x59da0f[_0x4713('0x10')][_0x4713('0x13')]);}logger[_0x4713('0x10')](_0x4713('0x12'),_0x13a61d,_0x59da0f['error'][_0x4713('0x13')]);return _0x20ad13(_0x59da0f[_0x4713('0x10')][_0x4713('0x13')]);}else{logger['info'](_0x4713('0x12'),_0x13a61d,_0x4713('0xd'));_0x20ad13(_0x59da0f[_0x4713('0x14')][_0x4713('0x13')]);}})[_0x4713('0x15')](function(_0x289a08){logger['error'](_0x4713('0x12'),_0x13a61d,_0x289a08);_0x34fdaa(_0x289a08);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 258469e..35fb5ac 100644
--- a/server/api/chatTransferReport/index.js
+++ b/server/api/chatTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','exports'];(function(_0x123647,_0x4b16de){var _0x3af80d=function(_0x4b77b0){while(--_0x4b77b0){_0x123647['push'](_0x123647['shift']());}};_0x3af80d(++_0x4b16de);}(_0x0b0e,0x187));var _0xe0b0=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x0b0e[_0x246115];return _0x385878;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router;
\ No newline at end of file
+var _0x757a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','util','path'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0x757a,0xde));var _0xa757=function(_0x5c1669,_0x3d18c1){_0x5c1669=_0x5c1669-0x0;var _0x2d5fc4=_0x757a[_0x5c1669];return _0x2d5fc4;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xa757('0x2'));var interaction=require(_0xa757('0x3'));var config=require(_0xa757('0x4'));var controller=require(_0xa757('0x5'));router[_0xa757('0x6')]('/',auth[_0xa757('0x7')](),controller['index']);router[_0xa757('0x6')](_0xa757('0x8'),auth['isAuthenticated'](),controller[_0xa757('0x9')]);router[_0xa757('0x6')](_0xa757('0xa'),auth[_0xa757('0x7')](),controller[_0xa757('0xb')]);router['post']('/',auth[_0xa757('0x7')](),controller[_0xa757('0xc')]);router[_0xa757('0xd')](_0xa757('0xa'),auth[_0xa757('0x7')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 2cd1479..83747bc 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49df=['Skip','BOOLEAN','Feedback','ENUM','star','thumb','name','text','onlineForm','getDataValue','setDataValue','stringify','input','textarea','Comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports','STRING','address','email','Agent','#011F6A','rounded','squared','We\x20are\x20here!','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send'];(function(_0x5d0eb8,_0x40c598){var _0x32d89b=function(_0x31fdf8){while(--_0x31fdf8){_0x5d0eb8['push'](_0x5d0eb8['shift']());}};_0x32d89b(++_0x40c598);}(_0x49df,0xad));var _0xf49d=function(_0x49fffd,_0x534844){_0x49fffd=_0x49fffd-0x0;var _0x4c90ed=_0x49df[_0x49fffd];return _0x4c90ed;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xf49d('0x0')]={'name':{'type':Sequelize[_0xf49d('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xf49d('0x1')],'allowNull':![],'unique':_0xf49d('0x2')},'description':{'type':Sequelize[_0xf49d('0x1')]},'mapKey':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xf49d('0x3')},'key':{'type':Sequelize[_0xf49d('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x4')},'customerAlias':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf49d('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf49d('0x1')],'allowNull':![],'defaultValue':_0xf49d('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf49d('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf49d('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xf49d('0x6'),_0xf49d('0x7')),'defaultValue':_0xf49d('0x6')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xf49d('0x8')},'start_chat_button':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xf49d('0x9')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf49d('0xa')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0xb')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf49d('0xc')]},'closingQuestion':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0xd')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf49d('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0xf')},'noteTitle':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x10')},'closingMessage':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x11')},'closingMessageButton':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x12')},'skipMessageButton':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x15')},'ratingType':{'type':Sequelize[_0xf49d('0x16')](_0xf49d('0x17'),_0xf49d('0x18')),'defaultValue':_0xf49d('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xf49d('0xa')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf49d('0xc')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xf49d('0x19'),'type':_0xf49d('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xf49d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf49d('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xf49d('0x1b'))?JSON['parse'](this[_0xf49d('0x1c')](_0xf49d('0x1b'))):{};},'set':function(_0xb8dcf8){return this[_0xf49d('0x1d')]('onlineForm',JSON[_0xf49d('0x1e')](_0xb8dcf8));}},'offlineForm':{'type':Sequelize[_0xf49d('0xc')],'defaultValue':function(){return JSON[_0xf49d('0x1e')]({'items':[{'type':_0xf49d('0x1f'),'props':{'title':_0xf49d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf49d('0x3'),'type':_0xf49d('0x3')},'variable':null},{'type':_0xf49d('0x20'),'config':{'placeholder':_0xf49d('0x21')},'props':{'title':_0xf49d('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xf49d('0x22'))?JSON[_0xf49d('0x23')](this[_0xf49d('0x1c')](_0xf49d('0x22'))):{};},'set':function(_0x43e868){return this[_0xf49d('0x1d')](_0xf49d('0x22'),JSON['stringify'](_0x43e868));}},'token':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':function(){return rs[_0xf49d('0x24')]();}},'autoclose':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf49d('0x1')]},'forwardOffline':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf49d('0x1')]},'waitingTitle':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xf49d('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x13')},'sendUnmanaged':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x12')},'enableCustomerAttachment':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf49d('0xc')]},'showAgentAvatar':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf49d('0xc')],'defaultValue':function(){return _0xf49d('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xf49d('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf49d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xf49d('0x2a')},'verticalAlignment':{'type':Sequelize[_0xf49d('0xa')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':_0xf49d('0x2b')},'defaultTitle':{'type':Sequelize[_0xf49d('0x1')]},'customerAvatar':{'type':Sequelize[_0xf49d('0xc')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf49d('0xa')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf49d('0x1')],'allowNull':![],'defaultValue':_0xf49d('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf49d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf49d('0x2d')},'systemAvatar':{'type':Sequelize[_0xf49d('0xc')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf49d('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf49d('0x14')],'defaultValue':![],'comment':_0xf49d('0x2e'),'set':function(_0x5ebb01){if(!_0x5ebb01)this[_0xf49d('0x1d')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xf49d('0x2f'),_0x5ebb01);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6d4f=['We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','#ffffff','INTEGER','BOOLEAN','ENUM','squared'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x6d4f,0x121));var _0xf6d4=function(_0x45c9f4,_0x2eec90){_0x45c9f4=_0x45c9f4-0x0;var _0x1f9be9=_0x6d4f[_0x45c9f4];return _0x1f9be9;};'use strict';var Sequelize=require(_0xf6d4('0x0'));var rs=require(_0xf6d4('0x1'));module[_0xf6d4('0x2')]={'name':{'type':Sequelize[_0xf6d4('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xf6d4('0x3')],'allowNull':![],'unique':_0xf6d4('0x4')},'description':{'type':Sequelize[_0xf6d4('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf6d4('0x5')},'mapKeyOffline':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x5')},'key':{'type':Sequelize[_0xf6d4('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf6d4('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf6d4('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf6d4('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf6d4('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf6d4('0x3')]},'animation':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf6d4('0x9')]('rounded',_0xf6d4('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf6d4('0xc')},'offline_chat_button':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0xd')},'header_offline':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0xe')},'download_transcript':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf6d4('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf6d4('0x10')]},'closingQuestion':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x13')},'noteTitle':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x14')},'placeholderMessage':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x15')},'closingMessageButton':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0xd')},'skipMessageButton':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x16')},'conditionAgreement':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x17')},'ratingType':{'type':Sequelize[_0xf6d4('0x9')](_0xf6d4('0x18'),_0xf6d4('0x19')),'defaultValue':_0xf6d4('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xf6d4('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf6d4('0x1a')]({'items':[{'type':_0xf6d4('0x1b'),'variable':null,'config':{'placeholder':_0xf6d4('0x1c'),'type':'text','required':!![]},'props':{'title':_0xf6d4('0x1c'),'helpText':''}},{'type':_0xf6d4('0x1b'),'props':{'title':_0xf6d4('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xf6d4('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf6d4('0x1d')](_0xf6d4('0x1e'))?JSON[_0xf6d4('0x1f')](this['getDataValue']('onlineForm')):{};},'set':function(_0x8c67fc){return this['setDataValue'](_0xf6d4('0x1e'),JSON[_0xf6d4('0x1a')](_0x8c67fc));}},'offlineForm':{'type':Sequelize[_0xf6d4('0x10')],'defaultValue':function(){return JSON[_0xf6d4('0x1a')]({'items':[{'type':_0xf6d4('0x1b'),'props':{'title':_0xf6d4('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xf6d4('0x5'),'type':_0xf6d4('0x5')},'variable':null},{'type':_0xf6d4('0x20'),'config':{'placeholder':_0xf6d4('0x21')},'props':{'title':'Comments','helpText':_0xf6d4('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xf6d4('0x1d')](_0xf6d4('0x23'))?JSON[_0xf6d4('0x1f')](this[_0xf6d4('0x1d')](_0xf6d4('0x23'))):{};},'set':function(_0x1f55e5){return this[_0xf6d4('0x24')]('offlineForm',JSON[_0xf6d4('0x1a')](_0x1f55e5));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf6d4('0x25')]();}},'autoclose':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf6d4('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf6d4('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf6d4('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xf6d4('0x28')},'offlineMessageBody':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf6d4('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xf6d4('0x2c')},'verticalAlignment':{'type':Sequelize[_0xf6d4('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x2d')},'defaultTitle':{'type':Sequelize[_0xf6d4('0x3')]},'customerAvatar':{'type':Sequelize[_0xf6d4('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf6d4('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf6d4('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf6d4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf6d4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf6d4('0x3')],'defaultValue':_0xf6d4('0x2e')},'systemAvatar':{'type':Sequelize[_0xf6d4('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf6d4('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf6d4('0x2f'),'set':function(_0x3af8f9){if(!_0x3af8f9)this[_0xf6d4('0x24')](_0xf6d4('0x30'),null);this[_0xf6d4('0x24')](_0xf6d4('0x31'),_0x3af8f9);}},'vidaooEscalation':{'type':Sequelize[_0xf6d4('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 9a88631..8661598 100644
--- a/server/api/chatWebsite/chatWebsite.controller.js
+++ b/server/api/chatWebsite/chatWebsite.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7d5=['List','Contacts','DESC','Applications','account','applications','list','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','format','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','increment','chatLicenseExceeded','server/files/chat/iframe.js','remote','connection','replace','alignment','verticalAlignment','textColor','addApplications','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','./chatWebsite.socket','register','http','client','Sequelize','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','destroy','get','UserProfileResource','end','name','send','index','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','filter','options','ChatWebsite','includeAll','include','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','rows','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','join','sitepic','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList'];(function(_0xe453c7,_0x44f45f){var _0x593204=function(_0x43ecfc){while(--_0x43ecfc){_0xe453c7['push'](_0xe453c7['shift']());}};_0x593204(++_0x44f45f);}(_0xf7d5,0x19b));var _0x5f7d=function(_0x2ea680,_0x99a563){_0x2ea680=_0x2ea680-0x0;var _0x317396=_0xf7d5[_0x2ea680];return _0x317396;};'use strict';var pdf=require(_0x5f7d('0x0'));var emlformat=require(_0x5f7d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5f7d('0x2'));var jsonpatch=require(_0x5f7d('0x3'));var rp=require(_0x5f7d('0x4'));var moment=require(_0x5f7d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5f7d('0x6'));var util=require(_0x5f7d('0x7'));var path=require(_0x5f7d('0x8'));var sox=require(_0x5f7d('0x9'));var csv=require(_0x5f7d('0xa'));var ejs=require(_0x5f7d('0xb'));var fs=require('fs');var _=require(_0x5f7d('0xc'));var squel=require(_0x5f7d('0xd'));var crypto=require(_0x5f7d('0xe'));var jsforce=require(_0x5f7d('0xf'));var deskjs=require(_0x5f7d('0x10'));var toCsv=require(_0x5f7d('0xa'));var querystring=require(_0x5f7d('0x11'));var Papa=require(_0x5f7d('0x12'));var Redis=require(_0x5f7d('0x13'));var authService=require(_0x5f7d('0x14'));var qs=require(_0x5f7d('0x15'));var as=require(_0x5f7d('0x16'));var hardwareService=require(_0x5f7d('0x17'));var logger=require('../../config/logger')(_0x5f7d('0x18'));var utils=require(_0x5f7d('0x19'));var config=require(_0x5f7d('0x1a'));var db=require(_0x5f7d('0x1b'))['db'];config['redis']=_[_0x5f7d('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5f7d('0x1d'))(new Redis(config['redis']));require(_0x5f7d('0x1e'))[_0x5f7d('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5f7d('0x20')]({'port':0x232c});var client9002=jayson[_0x5f7d('0x21')][_0x5f7d('0x20')]({'port':0x232a});var client9003=jayson[_0x5f7d('0x21')]['http']({'port':0x232b});function checkPasswordPattern(_0xbf6ea4,_0x5353a5,_0x1907af){if(_0x1907af){var _0x4f1802=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f1802['test'](_0x5353a5)){return _0xbf6ea4;}else{throw new db[(_0x5f7d('0x22'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xbf6ea4;}}function respondWithRpcPromise(_0x4e80b9,_0x50da96,_0x25be6f,_0x2c7325){return new BPromise(function(_0x5e542a,_0x2f7629){var _0x25e863=_0x2c7325||client;return _0x25e863[_0x5f7d('0x23')](_0x4e80b9,_0x25be6f)['then'](function(_0x5c0bd6){logger[_0x5f7d('0x24')](_0x5f7d('0x25'),_0x50da96,_0x5f7d('0x26'));logger[_0x5f7d('0x27')](_0x5f7d('0x28'),_0x50da96,_0x5f7d('0x26'),JSON[_0x5f7d('0x29')](_0x5c0bd6));if(_0x5c0bd6[_0x5f7d('0x2a')]){if(_0x5c0bd6[_0x5f7d('0x2a')][_0x5f7d('0x2b')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x50da96,_0x5c0bd6[_0x5f7d('0x2a')][_0x5f7d('0x2c')]);return _0x2f7629(_0x5c0bd6[_0x5f7d('0x2a')]['message']);}logger[_0x5f7d('0x2a')](_0x5f7d('0x25'),_0x50da96,_0x5c0bd6[_0x5f7d('0x2a')]['message']);return _0x5e542a(_0x5c0bd6['error'][_0x5f7d('0x2c')]);}else{logger[_0x5f7d('0x24')](_0x5f7d('0x25'),_0x50da96,_0x5f7d('0x26'));_0x5e542a(_0x5c0bd6[_0x5f7d('0x2d')][_0x5f7d('0x2c')]);}})[_0x5f7d('0x2e')](function(_0xf79be0){logger[_0x5f7d('0x2a')](_0x5f7d('0x25'),_0x50da96,_0xf79be0);_0x2f7629(_0xf79be0);});});}function respondWithStatusCode(_0x2f07f2,_0x229d10){_0x229d10=_0x229d10||0xcc;return function(_0x970b22){if(_0x970b22){return _0x2f07f2[_0x5f7d('0x2f')](_0x229d10);}return _0x2f07f2[_0x5f7d('0x30')](_0x229d10)['end']();};}function respondWithResult(_0x33ef1f,_0x49f01e){_0x49f01e=_0x49f01e||0xc8;return function(_0x509a76){if(_0x509a76){return _0x33ef1f['status'](_0x49f01e)[_0x5f7d('0x31')](_0x509a76);}};}function respondWithFilteredResult(_0x3121c5,_0x3616e6){return function(_0x476e69){if(_0x476e69){var _0x7afee8=_0x476e69[_0x5f7d('0x32')],_0x5d4d57=_0x3616e6[_0x5f7d('0x33')],_0x1cc5f8=_0x3616e6['offset']+_0x3616e6[_0x5f7d('0x34')],_0x3bb840;if(_0x1cc5f8>=_0x7afee8){_0x1cc5f8=_0x7afee8;_0x3bb840=0xc8;}else{_0x3bb840=0xce;}_0x3121c5[_0x5f7d('0x30')](_0x3bb840);return _0x3121c5[_0x5f7d('0x35')]('Content-Range',_0x5d4d57+'-'+_0x1cc5f8+'/'+_0x7afee8)[_0x5f7d('0x31')](_0x476e69);}return null;};}function patchUpdates(_0x437dc2){return function(_0x34401c){try{jsonpatch[_0x5f7d('0x36')](_0x34401c,_0x437dc2,!![]);}catch(_0x59eaf4){return BPromise['reject'](_0x59eaf4);}return _0x34401c[_0x5f7d('0x37')]();};}function saveUpdates(_0x334b5f,_0x3b89d8){return function(_0x11476f){if(_0x11476f){return _0x11476f[_0x5f7d('0x38')](_0x334b5f)[_0x5f7d('0x39')](function(_0x1bb3c7){return _0x1bb3c7;});}return null;};}function removeEntity(_0x34276d,_0x3db2e9){return function(_0x5c3eed){if(_0x5c3eed){return _0x5c3eed[_0x5f7d('0x3a')]()['then'](function(){var _0x53fc6c=_0x5c3eed[_0x5f7d('0x3b')]({'plain':!![]});var _0x2ce96b='ChatWebsites';return db[_0x5f7d('0x3c')]['destroy']({'where':{'type':_0x2ce96b,'resourceId':_0x53fc6c['id']}})[_0x5f7d('0x39')](function(){return _0x5c3eed;});})[_0x5f7d('0x39')](function(){_0x34276d[_0x5f7d('0x30')](0xcc)[_0x5f7d('0x3d')]();});}};}function handleEntityNotFound(_0x5c6199,_0x58765b){return function(_0x245e4f){if(!_0x245e4f){_0x5c6199[_0x5f7d('0x2f')](0x194);}return _0x245e4f;};}function handleError(_0x483467,_0x450abb){_0x450abb=_0x450abb||0x1f4;return function(_0x124d35){logger[_0x5f7d('0x2a')](_0x124d35['stack']);if(_0x124d35[_0x5f7d('0x3e')]){delete _0x124d35[_0x5f7d('0x3e')];}_0x483467[_0x5f7d('0x30')](_0x450abb)[_0x5f7d('0x3f')](_0x124d35);};}exports[_0x5f7d('0x40')]=function(_0x5d8649,_0x529f7a){var _0x12e561={'include':[{'model':db['Pause'],'as':_0x5f7d('0x41')}]},_0x4344bc={},_0x10fd55={'count':0x0,'rows':[]};var _0x4bfa41=_['map'](db['ChatWebsite'][_0x5f7d('0x42')],function(_0x3f0a1d){return{'name':_0x3f0a1d[_0x5f7d('0x43')],'type':_0x3f0a1d[_0x5f7d('0x44')][_0x5f7d('0x45')]};});_0x4344bc[_0x5f7d('0x46')]=_['map'](_0x4bfa41,_0x5f7d('0x3e'));_0x4344bc[_0x5f7d('0x47')]=_[_0x5f7d('0x48')](_0x5d8649[_0x5f7d('0x47')]);_0x4344bc[_0x5f7d('0x49')]=_[_0x5f7d('0x4a')](_0x4344bc[_0x5f7d('0x46')],_0x4344bc[_0x5f7d('0x47')]);_0x12e561[_0x5f7d('0x4b')]=_[_0x5f7d('0x4a')](_0x4344bc[_0x5f7d('0x46')],qs[_0x5f7d('0x4c')](_0x5d8649[_0x5f7d('0x47')][_0x5f7d('0x4c')]));_0x12e561[_0x5f7d('0x4b')]=_0x12e561[_0x5f7d('0x4b')][_0x5f7d('0x4d')]?_0x12e561['attributes']:_0x4344bc['model'];if(!_0x5d8649['query'][_0x5f7d('0x4e')]('nolimit')){_0x12e561[_0x5f7d('0x34')]=qs['limit'](_0x5d8649[_0x5f7d('0x47')][_0x5f7d('0x34')]);_0x12e561['offset']=qs[_0x5f7d('0x33')](_0x5d8649[_0x5f7d('0x47')]['offset']);}_0x12e561[_0x5f7d('0x4f')]=qs[_0x5f7d('0x50')](_0x5d8649[_0x5f7d('0x47')][_0x5f7d('0x50')]);_0x12e561[_0x5f7d('0x51')]=qs[_0x5f7d('0x49')](_[_0x5f7d('0x52')](_0x5d8649['query'],_0x4344bc[_0x5f7d('0x49')]),_0x4bfa41);if(_0x5d8649[_0x5f7d('0x47')]['filter']){_0x12e561['where']=_[_0x5f7d('0x53')](_0x12e561[_0x5f7d('0x51')],{'$or':_[_0x5f7d('0x54')](_0x4bfa41,function(_0x286b4e){if(_0x286b4e['type']!==_0x5f7d('0x55')){var _0x584e0a={};_0x584e0a[_0x286b4e[_0x5f7d('0x3e')]]={'$like':'%'+_0x5d8649[_0x5f7d('0x47')][_0x5f7d('0x56')]+'%'};return _0x584e0a;}})});}_0x12e561=_[_0x5f7d('0x53')]({},_0x12e561,_0x5d8649[_0x5f7d('0x57')]);var _0x55151b={'where':_0x12e561[_0x5f7d('0x51')]};return db[_0x5f7d('0x58')][_0x5f7d('0x32')](_0x55151b)[_0x5f7d('0x39')](function(_0x14e83e){_0x10fd55[_0x5f7d('0x32')]=_0x14e83e;if(_0x5d8649[_0x5f7d('0x47')][_0x5f7d('0x59')]){_0x12e561[_0x5f7d('0x5a')]=[{'all':!![]}];}return db[_0x5f7d('0x58')]['findAll'](_0x12e561);})[_0x5f7d('0x39')](function(_0x40e3fb){_0x10fd55['rows']=_0x40e3fb;return _0x10fd55;})['then'](respondWithFilteredResult(_0x529f7a,_0x12e561))[_0x5f7d('0x2e')](handleError(_0x529f7a,null));};exports[_0x5f7d('0x5b')]=function(_0x3f2bab,_0x1dfc70){var _0x19130e={'raw':![],'where':{'id':_0x3f2bab[_0x5f7d('0x5c')]['id']},'include':[{'model':db[_0x5f7d('0x5d')],'as':_0x5f7d('0x41')}]},_0x1ba9ee={};_0x1ba9ee[_0x5f7d('0x46')]=_[_0x5f7d('0x48')](db['ChatWebsite'][_0x5f7d('0x42')]);_0x1ba9ee[_0x5f7d('0x47')]=_[_0x5f7d('0x48')](_0x3f2bab[_0x5f7d('0x47')]);_0x1ba9ee[_0x5f7d('0x49')]=_['intersection'](_0x1ba9ee[_0x5f7d('0x46')],_0x1ba9ee[_0x5f7d('0x47')]);_0x19130e[_0x5f7d('0x4b')]=_[_0x5f7d('0x4a')](_0x1ba9ee['model'],qs['fields'](_0x3f2bab[_0x5f7d('0x47')][_0x5f7d('0x4c')]));_0x19130e[_0x5f7d('0x4b')]=_0x19130e[_0x5f7d('0x4b')]['length']?_0x19130e[_0x5f7d('0x4b')]:_0x1ba9ee[_0x5f7d('0x46')];if(_0x3f2bab[_0x5f7d('0x47')][_0x5f7d('0x59')]){_0x19130e[_0x5f7d('0x5a')]=[{'all':!![]}];}_0x19130e=_['merge']({},_0x19130e,_0x3f2bab[_0x5f7d('0x57')]);return db[_0x5f7d('0x58')][_0x5f7d('0x5e')](_0x19130e)[_0x5f7d('0x39')](handleEntityNotFound(_0x1dfc70,null))[_0x5f7d('0x39')](respondWithResult(_0x1dfc70,null))['catch'](handleError(_0x1dfc70,null));};exports[_0x5f7d('0x5f')]=function(_0x3ca99f,_0x34c33f){return db[_0x5f7d('0x58')][_0x5f7d('0x5f')](_0x3ca99f[_0x5f7d('0x60')],{})[_0x5f7d('0x39')](function(_0x280195){var _0x1003cf=_0x3ca99f[_0x5f7d('0x61')][_0x5f7d('0x3b')]({'plain':!![]});if(!_0x1003cf)throw new Error(_0x5f7d('0x62'));if(_0x1003cf[_0x5f7d('0x63')]===_0x5f7d('0x61')){var _0x3c93c6=_0x280195[_0x5f7d('0x3b')]({'plain':!![]});var _0x59bb93=_0x5f7d('0x64');return db[_0x5f7d('0x65')]['find']({'where':{'name':_0x59bb93,'userProfileId':_0x1003cf[_0x5f7d('0x66')]},'raw':!![]})['then'](function(_0x5455cb){if(_0x5455cb&&_0x5455cb['autoAssociation']===0x0){return db[_0x5f7d('0x3c')][_0x5f7d('0x5f')]({'name':_0x3c93c6[_0x5f7d('0x3e')],'resourceId':_0x3c93c6['id'],'type':_0x5455cb[_0x5f7d('0x3e')],'sectionId':_0x5455cb['id']},{})[_0x5f7d('0x39')](function(){return _0x280195;});}else{return _0x280195;}})[_0x5f7d('0x2e')](function(_0x4b2dfd){logger[_0x5f7d('0x2a')](_0x5f7d('0x67'),_0x4b2dfd);throw _0x4b2dfd;});}return _0x280195;})[_0x5f7d('0x39')](respondWithResult(_0x34c33f,0xc9))[_0x5f7d('0x2e')](handleError(_0x34c33f,null));};exports[_0x5f7d('0x38')]=function(_0x518927,_0x25bc1e){if(_0x518927[_0x5f7d('0x60')]['id']){delete _0x518927[_0x5f7d('0x60')]['id'];}return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x518927[_0x5f7d('0x5c')]['id']},'include':[{'model':db[_0x5f7d('0x5d')],'as':_0x5f7d('0x41')}]})[_0x5f7d('0x39')](handleEntityNotFound(_0x25bc1e,null))['then'](saveUpdates(_0x518927['body'],null))[_0x5f7d('0x39')](respondWithResult(_0x25bc1e,null))['catch'](handleError(_0x25bc1e,null));};exports[_0x5f7d('0x3a')]=function(_0x27f7fa,_0x3c97ca){return db[_0x5f7d('0x58')]['find']({'where':{'id':_0x27f7fa[_0x5f7d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3c97ca,null))[_0x5f7d('0x39')](removeEntity(_0x3c97ca,null))['catch'](handleError(_0x3c97ca,null));};exports[_0x5f7d('0x68')]=function(_0x4b6113,_0x2651e6){return db[_0x5f7d('0x58')][_0x5f7d('0x68')]()[_0x5f7d('0x39')](respondWithResult(_0x2651e6,null))['catch'](handleError(_0x2651e6,null));};exports[_0x5f7d('0x69')]=function(_0x10dad2,_0x92cd25,_0x33eee9){if(_0x10dad2[_0x5f7d('0x60')]['id']){delete _0x10dad2['body']['id'];}return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x10dad2[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x92cd25,null))['then'](function(_0x6f56e5){if(_0x6f56e5){_0x10dad2[_0x5f7d('0x60')]['ChatWebsiteId']=_0x6f56e5['id'];return db[_0x5f7d('0x6a')][_0x5f7d('0x5f')](_0x10dad2[_0x5f7d('0x60')]);}})[_0x5f7d('0x39')](respondWithResult(_0x92cd25,null))['catch'](handleError(_0x92cd25,null));};exports[_0x5f7d('0x6b')]=function(_0xedf58,_0x4d7c46,_0x2c3d78){var _0x4a321a={'raw':![],'where':{}};var _0x390764={};var _0x452801={'count':0x0,'rows':[]};return db[_0x5f7d('0x58')][_0x5f7d('0x6c')]({'where':{'id':_0xedf58[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x4d7c46,null))[_0x5f7d('0x39')](function(_0x7d82a4){if(_0x7d82a4){_0x390764[_0x5f7d('0x46')]=_[_0x5f7d('0x48')](db['Disposition'][_0x5f7d('0x42')]);_0x390764[_0x5f7d('0x47')]=_[_0x5f7d('0x48')](_0xedf58['query']);_0x390764[_0x5f7d('0x49')]=_['intersection'](_0x390764[_0x5f7d('0x46')],_0x390764['query']);_0x4a321a[_0x5f7d('0x4b')]=_[_0x5f7d('0x4a')](_0x390764['model'],qs[_0x5f7d('0x4c')](_0xedf58['query'][_0x5f7d('0x4c')]));_0x4a321a[_0x5f7d('0x4b')]=_0x4a321a['attributes'][_0x5f7d('0x4d')]?_0x4a321a['attributes']:_0x390764[_0x5f7d('0x46')];if(!_0xedf58['query'][_0x5f7d('0x4e')](_0x5f7d('0x6d'))){_0x4a321a[_0x5f7d('0x34')]=qs[_0x5f7d('0x34')](_0xedf58[_0x5f7d('0x47')]['limit']);_0x4a321a[_0x5f7d('0x33')]=qs[_0x5f7d('0x33')](_0xedf58['query'][_0x5f7d('0x33')]);}_0x4a321a[_0x5f7d('0x4f')]=qs[_0x5f7d('0x50')](_0xedf58[_0x5f7d('0x47')][_0x5f7d('0x50')]);_0x4a321a['where']=qs['filters'](_['pick'](_0xedf58[_0x5f7d('0x47')],_0x390764[_0x5f7d('0x49')]));_0x4a321a[_0x5f7d('0x51')][_0x5f7d('0x6e')]=_0x7d82a4['id'];if(_0xedf58[_0x5f7d('0x47')][_0x5f7d('0x56')]){_0x4a321a[_0x5f7d('0x51')]=_[_0x5f7d('0x53')](_0x4a321a[_0x5f7d('0x51')],{'$or':_['map'](_0x4a321a[_0x5f7d('0x4b')],function(_0x57fd59){var _0x25da1e={};_0x25da1e[_0x57fd59]={'$like':'%'+_0xedf58['query']['filter']+'%'};return _0x25da1e;})});}_0x4a321a=_[_0x5f7d('0x53')]({},_0x4a321a,_0xedf58[_0x5f7d('0x57')]);return db['Disposition']['count']({'where':_0x4a321a[_0x5f7d('0x51')]})[_0x5f7d('0x39')](function(_0x55309a){_0x452801[_0x5f7d('0x32')]=_0x55309a;if(_0xedf58['query'][_0x5f7d('0x59')]){_0x4a321a[_0x5f7d('0x5a')]=[{'all':!![]}];}return db[_0x5f7d('0x6a')]['findAll'](_0x4a321a);})['then'](function(_0x44bb16){_0x452801['rows']=_0x44bb16;return _0x452801;});}})['then'](respondWithFilteredResult(_0x4d7c46,_0x4a321a))['catch'](handleError(_0x4d7c46,null));};exports[_0x5f7d('0x6f')]=function(_0x4d93c6,_0x38cc89,_0x4e23d9){return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x4d93c6[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x38cc89,null))['then'](function(_0x5232e7){if(_0x5232e7){return _0x5232e7[_0x5f7d('0x6f')](_0x4d93c6[_0x5f7d('0x47')][_0x5f7d('0x70')]);}})[_0x5f7d('0x39')](respondWithStatusCode(_0x38cc89,null))[_0x5f7d('0x2e')](handleError(_0x38cc89,null));};exports[_0x5f7d('0x71')]=function(_0xf51d56,_0x21136e,_0x501523){if(_0xf51d56[_0x5f7d('0x60')]['id']){delete _0xf51d56[_0x5f7d('0x60')]['id'];}return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0xf51d56[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x21136e,null))[_0x5f7d('0x39')](function(_0x293e3d){if(_0x293e3d){_0xf51d56[_0x5f7d('0x60')][_0x5f7d('0x6e')]=_0x293e3d['id'];return db[_0x5f7d('0x72')]['create'](_0xf51d56[_0x5f7d('0x60')]);}})[_0x5f7d('0x39')](respondWithResult(_0x21136e,null))['catch'](handleError(_0x21136e,null));};exports[_0x5f7d('0x73')]=function(_0x34fc72,_0x2f17b5,_0xd3b3f0){var _0x1bd7f6={'raw':![],'where':{}};var _0x28e048={};var _0x14610b={'count':0x0,'rows':[]};return db[_0x5f7d('0x58')][_0x5f7d('0x6c')]({'where':{'id':_0x34fc72[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x2f17b5,null))[_0x5f7d('0x39')](function(_0x55b118){if(_0x55b118){_0x28e048[_0x5f7d('0x46')]=_[_0x5f7d('0x48')](db[_0x5f7d('0x72')]['rawAttributes']);_0x28e048[_0x5f7d('0x47')]=_[_0x5f7d('0x48')](_0x34fc72[_0x5f7d('0x47')]);_0x28e048[_0x5f7d('0x49')]=_[_0x5f7d('0x4a')](_0x28e048['model'],_0x28e048[_0x5f7d('0x47')]);_0x1bd7f6[_0x5f7d('0x4b')]=_[_0x5f7d('0x4a')](_0x28e048[_0x5f7d('0x46')],qs['fields'](_0x34fc72[_0x5f7d('0x47')][_0x5f7d('0x4c')]));_0x1bd7f6[_0x5f7d('0x4b')]=_0x1bd7f6['attributes'][_0x5f7d('0x4d')]?_0x1bd7f6[_0x5f7d('0x4b')]:_0x28e048[_0x5f7d('0x46')];if(!_0x34fc72['query'][_0x5f7d('0x4e')](_0x5f7d('0x6d'))){_0x1bd7f6[_0x5f7d('0x34')]=qs[_0x5f7d('0x34')](_0x34fc72[_0x5f7d('0x47')]['limit']);_0x1bd7f6[_0x5f7d('0x33')]=qs[_0x5f7d('0x33')](_0x34fc72[_0x5f7d('0x47')]['offset']);}_0x1bd7f6[_0x5f7d('0x4f')]=qs[_0x5f7d('0x50')](_0x34fc72[_0x5f7d('0x47')]['sort']);_0x1bd7f6[_0x5f7d('0x51')]=qs[_0x5f7d('0x49')](_[_0x5f7d('0x52')](_0x34fc72[_0x5f7d('0x47')],_0x28e048[_0x5f7d('0x49')]));_0x1bd7f6['where'][_0x5f7d('0x6e')]=_0x55b118['id'];if(_0x34fc72[_0x5f7d('0x47')]['filter']){_0x1bd7f6['where']=_[_0x5f7d('0x53')](_0x1bd7f6[_0x5f7d('0x51')],{'$or':_[_0x5f7d('0x54')](_0x1bd7f6[_0x5f7d('0x4b')],function(_0x674f61){var _0x14d644={};_0x14d644[_0x674f61]={'$like':'%'+_0x34fc72[_0x5f7d('0x47')]['filter']+'%'};return _0x14d644;})});}_0x1bd7f6=_[_0x5f7d('0x53')]({},_0x1bd7f6,_0x34fc72['options']);return db[_0x5f7d('0x72')]['count']({'where':_0x1bd7f6['where']})['then'](function(_0x3d6890){_0x14610b[_0x5f7d('0x32')]=_0x3d6890;if(_0x34fc72[_0x5f7d('0x47')][_0x5f7d('0x59')]){_0x1bd7f6['include']=[{'all':!![]}];}return db[_0x5f7d('0x72')][_0x5f7d('0x74')](_0x1bd7f6);})['then'](function(_0x1818d9){_0x14610b[_0x5f7d('0x75')]=_0x1818d9;return _0x14610b;});}})[_0x5f7d('0x39')](respondWithFilteredResult(_0x2f17b5,_0x1bd7f6))['catch'](handleError(_0x2f17b5,null));};exports[_0x5f7d('0x76')]=function(_0x4beab4,_0x499a62,_0x4c97d4){return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x4beab4[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x499a62,null))[_0x5f7d('0x39')](function(_0xcb3456){if(_0xcb3456){return _0xcb3456[_0x5f7d('0x76')](_0x4beab4[_0x5f7d('0x47')][_0x5f7d('0x70')]);}})['then'](respondWithStatusCode(_0x499a62,null))[_0x5f7d('0x2e')](handleError(_0x499a62,null));};exports[_0x5f7d('0x77')]=function(_0x28347e,_0x16ad64,_0x483ee5){_0x28347e[_0x5f7d('0x60')]['sitepic']=_0x28347e[_0x5f7d('0x78')][_0x5f7d('0x79')];return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x28347e[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x16ad64,null))[_0x5f7d('0x39')](saveUpdates(_0x28347e[_0x5f7d('0x60')],null))[_0x5f7d('0x39')](respondWithResult(_0x16ad64,null))['catch'](handleError(_0x16ad64,null));};exports[_0x5f7d('0x7a')]=function(_0x24c1b4,_0x313c0b,_0x5ee68f){_0x24c1b4['body']['agentAvatar']=_0x24c1b4[_0x5f7d('0x78')][_0x5f7d('0x79')];return db[_0x5f7d('0x58')]['find']({'where':{'id':_0x24c1b4[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x313c0b,null))[_0x5f7d('0x39')](saveUpdates(_0x24c1b4[_0x5f7d('0x60')],null))[_0x5f7d('0x39')](respondWithResult(_0x313c0b,null))['catch'](handleError(_0x313c0b,null));};exports[_0x5f7d('0x7b')]=function(_0x5c294f,_0x369b6e,_0x543da7){_0x5c294f[_0x5f7d('0x60')][_0x5f7d('0x7c')]=_0x5c294f[_0x5f7d('0x78')][_0x5f7d('0x79')];return db[_0x5f7d('0x58')]['find']({'where':{'id':_0x5c294f[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x369b6e,null))[_0x5f7d('0x39')](saveUpdates(_0x5c294f[_0x5f7d('0x60')],null))[_0x5f7d('0x39')](respondWithResult(_0x369b6e,null))[_0x5f7d('0x2e')](handleError(_0x369b6e,null));};exports[_0x5f7d('0x7d')]=function(_0x41ed44,_0x5b8eab,_0x2d093b){_0x41ed44['body']['systemAvatar']=_0x41ed44['file'][_0x5f7d('0x79')];return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x41ed44['params']['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x5b8eab,null))[_0x5f7d('0x39')](saveUpdates(_0x41ed44[_0x5f7d('0x60')],null))[_0x5f7d('0x39')](respondWithResult(_0x5b8eab,null))[_0x5f7d('0x2e')](handleError(_0x5b8eab,null));};exports['getLogo']=function(_0x4fe7ce,_0x3496b6,_0x4c9dc0){var _0x492147=path['join'](config[_0x5f7d('0x7e')],_0x5f7d('0x7f'));var _0x16becc={'where':{'id':_0x4fe7ce[_0x5f7d('0x5c')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x3b93ff=![];return require(_0x5f7d('0x80'))[_0x5f7d('0x81')]()[_0x5f7d('0x39')](function(_0x1c7c72){if(_0x1c7c72){_0x3b93ff=_0x1c7c72[_0x5f7d('0x82')];}})['then'](function(){return db[_0x5f7d('0x58')][_0x5f7d('0x5e')](_0x16becc);})[_0x5f7d('0x39')](handleEntityNotFound(_0x3496b6,null))[_0x5f7d('0x39')](function(_0xf8e467){if(_0xf8e467){if(!_[_0x5f7d('0x83')](_0xf8e467['sitepic'])){if(fs[_0x5f7d('0x84')](path['join'](config[_0x5f7d('0x7e')],_0x5f7d('0x85'),_0xf8e467['sitepic']))&&_0x3b93ff){_0x492147=path[_0x5f7d('0x86')](config[_0x5f7d('0x7e')],'server/files/images/logos/',_0xf8e467[_0x5f7d('0x87')]);}}return _0x3496b6[_0x5f7d('0x88')](_0x492147);}})['catch'](handleError(_0x3496b6,null));};exports[_0x5f7d('0x89')]=function(_0x2d5058,_0x236e8b,_0x55d6fa){var _0x4d86aa=path[_0x5f7d('0x86')](config[_0x5f7d('0x7e')],_0x5f7d('0x8a'));var _0x1db73e={'where':{'id':_0x2d5058[_0x5f7d('0x5c')]['id']},'attributes':['id',_0x5f7d('0x8b')],'raw':!![]};return db[_0x5f7d('0x58')][_0x5f7d('0x5e')](_0x1db73e)['then'](handleEntityNotFound(_0x236e8b,null))['then'](function(_0x463abc){if(_0x463abc){if(!_[_0x5f7d('0x83')](_0x463abc[_0x5f7d('0x8b')])){if(fs[_0x5f7d('0x84')](path[_0x5f7d('0x86')](config[_0x5f7d('0x7e')],'server/files/images/avatars/',_0x463abc['agentAvatar']))){_0x4d86aa=path[_0x5f7d('0x86')](config[_0x5f7d('0x7e')],_0x5f7d('0x8c'),_0x463abc[_0x5f7d('0x8b')]);}}return _0x236e8b[_0x5f7d('0x88')](_0x4d86aa);}})[_0x5f7d('0x2e')](handleError(_0x236e8b,null));};exports[_0x5f7d('0x8d')]=function(_0x1d8970,_0x336fb2,_0x3e5a0c){var _0x2d75c6=path[_0x5f7d('0x86')](config[_0x5f7d('0x7e')],_0x5f7d('0x8e'));var _0x482b6a={'where':{'id':_0x1d8970['params']['id']},'attributes':['id',_0x5f7d('0x7c'),_0x5f7d('0x8f')],'raw':!![]};return db[_0x5f7d('0x58')][_0x5f7d('0x5e')](_0x482b6a)[_0x5f7d('0x39')](handleEntityNotFound(_0x336fb2,null))[_0x5f7d('0x39')](function(_0x35608c){if(_0x35608c){if(!_['isNil'](_0x35608c[_0x5f7d('0x7c')])){if(fs[_0x5f7d('0x84')](path[_0x5f7d('0x86')](config['root'],_0x5f7d('0x8c'),_0x35608c['customerAvatar']))&&_0x35608c[_0x5f7d('0x8f')]){_0x2d75c6=path[_0x5f7d('0x86')](config[_0x5f7d('0x7e')],_0x5f7d('0x8c'),_0x35608c[_0x5f7d('0x7c')]);}}return _0x336fb2[_0x5f7d('0x88')](_0x2d75c6);}})[_0x5f7d('0x2e')](handleError(_0x336fb2,null));};exports[_0x5f7d('0x90')]=function(_0x4868fa,_0xf7523b,_0x318234){var _0x552e11=path[_0x5f7d('0x86')](config[_0x5f7d('0x7e')],_0x5f7d('0x91'));var _0x104d60={'where':{'id':_0x4868fa[_0x5f7d('0x5c')]['id']},'attributes':['id',_0x5f7d('0x92')],'raw':!![]};return db[_0x5f7d('0x58')][_0x5f7d('0x5e')](_0x104d60)[_0x5f7d('0x39')](handleEntityNotFound(_0xf7523b,null))[_0x5f7d('0x39')](function(_0x161255){if(_0x161255){if(!_[_0x5f7d('0x83')](_0x161255[_0x5f7d('0x92')])){if(fs[_0x5f7d('0x84')](path[_0x5f7d('0x86')](config[_0x5f7d('0x7e')],_0x5f7d('0x8c'),_0x161255[_0x5f7d('0x92')]))){_0x552e11=path['join'](config[_0x5f7d('0x7e')],'server/files/images/avatars/',_0x161255['systemAvatar']);}}return _0xf7523b[_0x5f7d('0x88')](_0x552e11);}})[_0x5f7d('0x2e')](handleError(_0xf7523b,null));};exports['notify']=function(_0x42de26,_0x157bf1,_0x53e6cd){var _0x21b426=require(_0x5f7d('0x93'));var _0x398c7e=new _0x21b426();var _0xce077c=_0x398c7e[_0x5f7d('0x94')](_0x42de26[_0x5f7d('0x95')][_0x5f7d('0x96')])[_0x5f7d('0x97')]();var _0x34153e={'body':_0x42de26['body'],'channel':_0x5f7d('0x98')};var _0x30b168=[];var _0x2ae317=[];var _0x3db643={};var _0x591671=![];return db[_0x5f7d('0x99')][_0x5f7d('0x68')]()[_0x5f7d('0x39')](function(_0x4154d0){if(!_0x4154d0){throw new db['Sequelize']['ValidationError'](_0x5f7d('0x9a'));}_0x30b168=_['difference'](_[_0x5f7d('0x48')](_0x4154d0),[_0x5f7d('0x9b'),'updatedAt']);_0x2ae317=_[_0x5f7d('0x9c')](_['keys'](_0x4154d0),[_0x5f7d('0x9b'),_0x5f7d('0x9d'),_0x5f7d('0x9e'),_0x5f7d('0x9f')]);if(_0x42de26['body']['id']){delete _0x42de26[_0x5f7d('0x60')]['id'];}if(_[_0x5f7d('0x83')](_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xa0')])){throw new db[(_0x5f7d('0x22'))][(_0x5f7d('0xa1'))](_0x5f7d('0xa2'));}if(_[_0x5f7d('0x83')](_0x42de26[_0x5f7d('0x60')]['body'])||_0x42de26['body'][_0x5f7d('0x60')]===''){throw new db['Sequelize'][(_0x5f7d('0xa1'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5f7d('0x83')](_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xa3')])){throw new db[(_0x5f7d('0x22'))][(_0x5f7d('0xa1'))](_0x5f7d('0xa4')+_0x2ae317);}if(!_[_0x5f7d('0xa5')](_0x2ae317,_0x42de26[_0x5f7d('0x60')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2ae317);}_0x3db643[_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xa3')]]=_0x42de26['body']['from'];})[_0x5f7d('0x39')](function(){return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x42de26[_0x5f7d('0x5c')]['id']},'include':[{'model':db[_0x5f7d('0xa6')],'as':_0x5f7d('0xa7'),'include':[{'model':db[_0x5f7d('0x99')],'as':_0x5f7d('0xa8'),'where':_0x3db643,'limit':0x1,'order':[['updatedAt',_0x5f7d('0xa9')]]}]},{'model':db['ChatApplication'],'as':_0x5f7d('0xaa')}]});})[_0x5f7d('0x39')](handleEntityNotFound(_0x157bf1,null))[_0x5f7d('0x39')](function(_0x33cff6){if(_0x33cff6&&_0x33cff6['List']){_0x34153e[_0x5f7d('0xab')]=_0x33cff6;_0x34153e[_0x5f7d('0xac')]=_0x33cff6['Applications'];_0x34153e[_0x5f7d('0xad')]=_0x33cff6['List'];_0x34153e[_0x5f7d('0xac')]=_['orderBy'](_0x34153e[_0x5f7d('0xac')],[_0x5f7d('0xae')],[_0x5f7d('0xaf')]);if(_0x34153e[_0x5f7d('0xab')][_0x5f7d('0xaa')]){delete _0x34153e[_0x5f7d('0xab')][_0x5f7d('0xaa')];}if(_0x34153e['account'][_0x5f7d('0xa7')]&&_0x34153e[_0x5f7d('0xab')][_0x5f7d('0xa7')]['Contacts']['length']){return _0x34153e[_0x5f7d('0xab')][_0x5f7d('0xa7')][_0x5f7d('0xa8')][0x0];}var _0x4812ec=_['defaults'](_0x42de26[_0x5f7d('0x60')],{'firstName':_0x42de26[_0x5f7d('0x60')]['from'],'ListId':_0x33cff6[_0x5f7d('0x9f')]});_0x4812ec[_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xa3')]]=_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xa0')];return db[_0x5f7d('0x99')][_0x5f7d('0x5f')](_0x4812ec,{'fields':_0x30b168,'raw':!![]});}})[_0x5f7d('0x39')](handleEntityNotFound(_0x157bf1,null))[_0x5f7d('0x39')](function(_0x9926b5){_0x34153e[_0x5f7d('0xb0')]=_0x9926b5;var _0x199ff0=_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xb1')];if(_0x42de26[_0x5f7d('0x95')]['cf-connecting-ip']){_0x199ff0=_0x42de26[_0x5f7d('0x95')][_0x5f7d('0xb2')];}else if(_0x42de26[_0x5f7d('0x95')][_0x5f7d('0xb3')]){_0x199ff0=_[_0x5f7d('0xb4')](_0x42de26[_0x5f7d('0x95')][_0x5f7d('0xb3')]['split'](','));}if(_0x9926b5){var _0x43d6fc={'ContactId':_0x9926b5['id'],'ChatWebsiteId':_0x42de26[_0x5f7d('0x5c')]['id'],'from':(_0x9926b5[_0x5f7d('0xb5')]||'')+'\x20'+(_0x9926b5[_0x5f7d('0xb6')]||''),'customerIp':_0x199ff0,'customerPort':_0x42de26[_0x5f7d('0x95')]['x-real-port']?_0x42de26['headers'][_0x5f7d('0xb7')]:null,'referer':_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xb8')],'browserName':_0xce077c[_0x5f7d('0xb9')]['name']&&_0xce077c[_0x5f7d('0xb9')][_0x5f7d('0xba')]?util['format'](_0x5f7d('0xbb'),_0xce077c[_0x5f7d('0xb9')][_0x5f7d('0x3e')],_0xce077c[_0x5f7d('0xb9')][_0x5f7d('0xba')]):_0x5f7d('0xbc'),'browserVersion':_0xce077c['browser'][_0x5f7d('0xba')]||_0x5f7d('0xbc'),'osName':util['format'](_0x5f7d('0xbb'),_0xce077c['os'][_0x5f7d('0x3e')],_0xce077c['os'][_0x5f7d('0xba')]),'osVersion':_0xce077c['os'][_0x5f7d('0xba')],'deviceModel':_0xce077c[_0x5f7d('0xbd')]['model']&&_0xce077c[_0x5f7d('0xbd')][_0x5f7d('0xbe')]?util['format'](_0x5f7d('0xbf'),_0xce077c['device']['model'],_0xce077c[_0x5f7d('0xbd')]['vendor'],_0xce077c[_0x5f7d('0xbd')]['type']):null,'deviceVendor':_0xce077c[_0x5f7d('0xbd')]['vendor'],'deviceType':_0xce077c[_0x5f7d('0xbd')][_0x5f7d('0x44')],'formData':JSON[_0x5f7d('0x29')](_0x42de26['body'])};var _0x2719cd={'ChatWebsiteId':_0x42de26[_0x5f7d('0x5c')]['id'],'closed':![]};if(_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xc0')]){_0x2719cd[_0x5f7d('0xc0')]=_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xc0')];return db[_0x5f7d('0xc1')][_0x5f7d('0x5e')]({'where':_0x2719cd})[_0x5f7d('0x39')](function(_0x2d6ff4){if(_0x2d6ff4){return[_0x2d6ff4,![]];}_0x43d6fc[_0x5f7d('0xc0')]=_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xc0')];_0x43d6fc['externalUrl']=_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xc2')];return db[_0x5f7d('0xc1')][_0x5f7d('0x5f')](_0x43d6fc)['then'](function(_0xd8d17a){return[_0xd8d17a,!![]];});});}_0x2719cd[_0x5f7d('0xc3')]=_0x9926b5['id'];if(_0x42de26[_0x5f7d('0x60')]['interaction']&&_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xc4')]['id']){_0x2719cd['id']=_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xc4')]['id'];return db[_0x5f7d('0xc1')][_0x5f7d('0x5e')]({'where':_0x2719cd})[_0x5f7d('0x39')](function(_0x4fcdc5){if(_0x4fcdc5){return[_0x4fcdc5,![]];}return db[_0x5f7d('0xc1')][_0x5f7d('0x5f')](_0x43d6fc)[_0x5f7d('0x39')](function(_0x3419ea){return[_0x3419ea,!![]];});});}return db[_0x5f7d('0xc1')][_0x5f7d('0x5f')](_0x43d6fc)['then'](function(_0x2c0ddd){return[_0x2c0ddd,!![]];});}})['spread'](function(_0x21ff12,_0x145932){if(_0x21ff12){_0x591671=_0x145932;if(!_0x145932){var _0x51d03a={'from':(_0x34153e[_0x5f7d('0xb0')][_0x5f7d('0xb5')]||'')+'\x20'+(_0x34153e[_0x5f7d('0xb0')][_0x5f7d('0xb6')]||'')};if(_0x42de26[_0x5f7d('0x60')][_0x5f7d('0xc0')]&&_0x42de26['body'][_0x5f7d('0xc5')]&&_0x42de26['body'][_0x5f7d('0xc0')]!=_0x42de26[_0x5f7d('0x60')]['messageId']){_0x51d03a[_0x5f7d('0xc0')]=_0x42de26[_0x5f7d('0x60')]['messageId'];}return _0x21ff12[_0x5f7d('0x38')](_0x51d03a);}else{return _0x21ff12;}}})[_0x5f7d('0x39')](function(_0x2d885e){_0x34153e[_0x5f7d('0xc4')]=_0x2d885e[_0x5f7d('0x3b')]({'plain':!![]});_0x34153e[_0x5f7d('0xc4')][_0x5f7d('0xc6')]=_0x591671;if(_0x34153e['interaction'][_0x5f7d('0xc6')]){if(_0x34153e['account'][_0x5f7d('0xc7')]){_0x34153e[_0x5f7d('0xac')][_0x5f7d('0xc8')]({'id':0x0,'priority':_0x34153e[_0x5f7d('0xac')][_0x5f7d('0x4d')]+0x1,'app':_0x5f7d('0xc9'),'appdata':'unmanaged','interval':_0x5f7d('0xca')});}}return db['ChatMessage'][_0x5f7d('0x5f')]({'body':_0x42de26[_0x5f7d('0x60')][_0x5f7d('0x60')],'ChatWebsiteId':_0x42de26[_0x5f7d('0x5c')]['id'],'ChatInteractionId':_0x2d885e['id'],'direction':'in','ContactId':_0x34153e[_0x5f7d('0xb0')]['id'],'AttachmentId':_0x42de26['body'][_0x5f7d('0xcb')]});})[_0x5f7d('0x39')](function(_0x2256d5){_0x34153e[_0x5f7d('0x2c')]=_0x2256d5;if(_0x34153e[_0x5f7d('0xc4')][_0x5f7d('0xcc')]){return db[_0x5f7d('0xcd')]['find']({'attributes':['id',_0x5f7d('0x3e')],'where':{'id':_0x34153e[_0x5f7d('0xc4')][_0x5f7d('0xcc')]}})['then'](function(_0x72c9ad){if(_0x72c9ad){_0x34153e['applications'][_0x5f7d('0xce')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x72c9ad[_0x5f7d('0x3e')]+','+(_0x34153e[_0x5f7d('0xab')][_0x5f7d('0xcf')]||0xa),'interval':_0x5f7d('0xca')});_0x34153e[_0x5f7d('0xd0')]=!![];}return respondWithRpcPromise(_0x5f7d('0xd1'),_0x5f7d('0xd2'),_0x34153e);});}return respondWithRpcPromise(_0x5f7d('0xd1'),'startRouting',_0x34153e);})[_0x5f7d('0x39')](function(_0x1f7875){respondWithRpcPromise(_0x5f7d('0xd3'),'EventManager',{'event':'notify','message':_0x1f7875},client9002);return _0x1f7875;})[_0x5f7d('0x39')](respondWithResult(_0x157bf1,null))['catch'](handleError(_0x157bf1,null));};exports[_0x5f7d('0xd4')]=function(_0x10de85,_0x5c12d7,_0x1be3af){var _0x4590ca,_0x445345,_0xaba87f;var _0x4f226b=[];var _0x21b0b2=[];var _0x267190={};return db[_0x5f7d('0x99')]['describe']()['then'](function(_0x277026){if(!_0x277026){throw new db[(_0x5f7d('0x22'))]['ValidationError'](_0x5f7d('0x9a'));}_0x21b0b2=_[_0x5f7d('0x9c')](_[_0x5f7d('0x48')](_0x277026),[_0x5f7d('0x9b'),'updatedAt']);_0x4f226b=_['difference'](_[_0x5f7d('0x48')](_0x277026),['createdAt',_0x5f7d('0x9d'),_0x5f7d('0x9e'),_0x5f7d('0x9f')]);if(_0x10de85[_0x5f7d('0x60')]['id']){delete _0x10de85[_0x5f7d('0x60')]['id'];}if(_['isNil'](_0x10de85[_0x5f7d('0x60')][_0x5f7d('0xa0')])){throw _0x5c12d7[_0x5f7d('0x30')](0x1f4)['send'](new db[(_0x5f7d('0x22'))][(_0x5f7d('0xa1'))](_0x5f7d('0xa2')));}if(_[_0x5f7d('0x83')](_0x10de85[_0x5f7d('0x60')][_0x5f7d('0x60')])||_0x10de85[_0x5f7d('0x60')]['body']===''){throw _0x5c12d7['status'](0x1f4)[_0x5f7d('0x3f')](new db['Sequelize']['ValidationError'](_0x5f7d('0xd5')));}if(_[_0x5f7d('0x83')](_0x10de85['body']['mapKeyOffline'])){throw _0x5c12d7[_0x5f7d('0x30')](0x1f4)[_0x5f7d('0x3f')](new db['Sequelize'][(_0x5f7d('0xa1'))](_0x5f7d('0xd6')+_0x4f226b));}if(!_['includes'](_0x4f226b,_0x10de85['body'][_0x5f7d('0xd7')])){throw _0x5c12d7['status'](0x1f4)[_0x5f7d('0x3f')](new db[(_0x5f7d('0x22'))][(_0x5f7d('0xa1'))](_0x5f7d('0xd8')+_0x4f226b));}_0x267190[_0x10de85[_0x5f7d('0x60')][_0x5f7d('0xd7')]]=_0x10de85[_0x5f7d('0x60')][_0x5f7d('0xa0')];})[_0x5f7d('0x39')](function(){return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x10de85[_0x5f7d('0x5c')]['id']},'include':[{'model':db[_0x5f7d('0xa6')],'as':_0x5f7d('0xa7')}]});})['then'](handleEntityNotFound(_0x5c12d7,null))[_0x5f7d('0x39')](function(_0x45e5b2){if(_0x45e5b2&&_0x45e5b2[_0x5f7d('0xa7')]){_0x445345=_0x45e5b2;var _0x366486=_['defaults'](_0x10de85[_0x5f7d('0x60')],{'firstName':_0x10de85[_0x5f7d('0x60')][_0x5f7d('0xa0')],'phone':_0x10de85[_0x5f7d('0x60')]['from'],'ListId':_0x45e5b2[_0x5f7d('0x9f')]});_0x366486[_0x10de85[_0x5f7d('0x60')]['mapKeyOffline']]=_0x10de85[_0x5f7d('0x60')][_0x5f7d('0xa0')];return db[_0x5f7d('0x99')][_0x5f7d('0xd9')]({'where':_0x267190,'defaults':_0x366486});}})['spread'](function(_0xee166){if(_0xee166){_0xaba87f=_0xee166;var _0x48d7fa=fs[_0x5f7d('0xda')](path[_0x5f7d('0x86')](config['root'],_0x5f7d('0xdb')),'utf8');var _0x25a5fc=ejs[_0x5f7d('0xdc')](_0x48d7fa,{'body':_[_0x5f7d('0xdd')](_0x10de85[_0x5f7d('0x60')][_0x5f7d('0x60')]),'bodyTitle':_0x445345[_0x5f7d('0xde')]});return db['ChatOfflineMessage'][_0x5f7d('0x5f')]({'body':_0x25a5fc,'ContactId':_0xee166['id'],'ChatWebsiteId':_0x445345['id']});}})[_0x5f7d('0x39')](function(_0xcc13a0){if(_0xcc13a0){_0x4590ca=_0xcc13a0;return db[_0x5f7d('0xdf')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x5f7d('0xe0')],'as':_0x5f7d('0xe1'),'raw':!![]}]});}})[_0x5f7d('0x39')](function(_0x532e35){if(_0x532e35&&_0x532e35[_0x5f7d('0xe1')]&&_0x445345[_0x5f7d('0xe2')]){var _0x46050b={'tls':{'rejectUnauthorized':![]}};if(_0x532e35[_0x5f7d('0xe1')]['service']){_0x46050b[_0x5f7d('0xe3')]=_0x532e35['Smtp'][_0x5f7d('0xe3')];}else{_0x46050b[_0x5f7d('0xe4')]=_0x532e35['Smtp'][_0x5f7d('0xe4')];_0x46050b[_0x5f7d('0xe5')]=_0x532e35['Smtp'][_0x5f7d('0xe5')];_0x46050b[_0x5f7d('0xe6')]=_0x532e35[_0x5f7d('0xe1')][_0x5f7d('0xe6')];}if(_0x532e35[_0x5f7d('0xe1')]['authentication']){_0x46050b[_0x5f7d('0xe7')]={'user':_0x532e35[_0x5f7d('0xe1')][_0x5f7d('0x61')],'pass':_0x532e35['Smtp'][_0x5f7d('0xe8')]};}return respondWithRpcPromise(_0x5f7d('0xe9'),_0x5f7d('0xea'),{'account':_0x46050b,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x532e35['name'],_0x532e35['email']||_0x532e35[_0x5f7d('0xe1')][_0x5f7d('0x61')]),'to':_0x445345[_0x5f7d('0xe2')],'subject':_0x445345['offlineMessageSubject'],'text':_0x4590ca[_0x5f7d('0x60')]}},client9003)[_0x5f7d('0x39')](function(){return _0x4590ca;})[_0x5f7d('0x2e')](function(_0x1da33b){console[_0x5f7d('0x2a')](_0x1da33b);});}})[_0x5f7d('0x39')](function(){if(_0x4590ca){return _0x4590ca;}})[_0x5f7d('0x39')](respondWithResult(_0x5c12d7,null))[_0x5f7d('0x2e')](handleError(_0x5c12d7,null));};exports['addInteraction']=function(_0x4f57de,_0x515cb5,_0x4980b0){return db['ChatInteraction'][_0x5f7d('0x5e')]({'where':{'id':_0x4f57de['params']['id']}})['then'](handleEntityNotFound(_0x515cb5,null))[_0x5f7d('0x39')](function(_0x17b7a1){if(_0x17b7a1){return _0x17b7a1['addInteraction'](_0x4f57de[_0x5f7d('0x60')]['ids'],_[_0x5f7d('0xeb')](_0x4f57de[_0x5f7d('0x60')],[_0x5f7d('0x70'),'id'])||{});}})[_0x5f7d('0x39')](respondWithResult(_0x515cb5,null))[_0x5f7d('0x2e')](handleError(_0x515cb5,null));};exports['getInteractions']=function(_0xcb1778,_0x8ee5aa,_0x3bd2a5){var _0x3d6fc6={'raw':![],'where':{}};var _0x497963={};var _0x3f8503={'count':0x0,'rows':[]};return db[_0x5f7d('0x58')][_0x5f7d('0x6c')]({'where':{'id':_0xcb1778[_0x5f7d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x8ee5aa,null))[_0x5f7d('0x39')](function(_0x5922e9){if(_0x5922e9){_0x497963[_0x5f7d('0x46')]=_[_0x5f7d('0x48')](db['ChatInteraction'][_0x5f7d('0x42')]);_0x497963['query']=_[_0x5f7d('0x48')](_0xcb1778['query']);_0x497963[_0x5f7d('0x49')]=_[_0x5f7d('0x4a')](_0x497963[_0x5f7d('0x46')],_0x497963[_0x5f7d('0x47')]);_0x3d6fc6[_0x5f7d('0x4b')]=_['intersection'](_0x497963[_0x5f7d('0x46')],qs['fields'](_0xcb1778[_0x5f7d('0x47')][_0x5f7d('0x4c')]));_0x3d6fc6[_0x5f7d('0x4b')]=_0x3d6fc6[_0x5f7d('0x4b')][_0x5f7d('0x4d')]?_0x3d6fc6[_0x5f7d('0x4b')]:_0x497963[_0x5f7d('0x46')];if(!_0xcb1778[_0x5f7d('0x47')][_0x5f7d('0x4e')](_0x5f7d('0x6d'))){_0x3d6fc6[_0x5f7d('0x34')]=qs[_0x5f7d('0x34')](_0xcb1778[_0x5f7d('0x47')][_0x5f7d('0x34')]);_0x3d6fc6['offset']=qs[_0x5f7d('0x33')](_0xcb1778[_0x5f7d('0x47')][_0x5f7d('0x33')]);}_0x3d6fc6['order']=qs[_0x5f7d('0x50')](_0xcb1778['query'][_0x5f7d('0x50')]);_0x3d6fc6[_0x5f7d('0x51')]=qs['filters'](_[_0x5f7d('0x52')](_0xcb1778[_0x5f7d('0x47')],_0x497963[_0x5f7d('0x49')]));_0x3d6fc6[_0x5f7d('0x51')][_0x5f7d('0x6e')]=_0x5922e9['id'];if(_0xcb1778[_0x5f7d('0x47')][_0x5f7d('0x56')]){_0x3d6fc6[_0x5f7d('0x51')]=_[_0x5f7d('0x53')](_0x3d6fc6[_0x5f7d('0x51')],{'$or':_[_0x5f7d('0x54')](_0x3d6fc6['attributes'],function(_0x39cdc5){var _0x495dd9={};_0x495dd9[_0x39cdc5]={'$like':'%'+_0xcb1778['query'][_0x5f7d('0x56')]+'%'};return _0x495dd9;})});}_0x3d6fc6=_['merge']({},_0x3d6fc6,_0xcb1778[_0x5f7d('0x57')]);return db[_0x5f7d('0xc1')][_0x5f7d('0x32')]({'where':_0x3d6fc6[_0x5f7d('0x51')]})['then'](function(_0x475bdb){_0x3f8503['count']=_0x475bdb;if(_0xcb1778[_0x5f7d('0x47')][_0x5f7d('0x59')]){_0x3d6fc6[_0x5f7d('0x5a')]=[{'model':db[_0x5f7d('0x99')],'as':_0x5f7d('0xec'),'required':![]},{'model':db[_0x5f7d('0xcd')],'as':_0x5f7d('0xed'),'attributes':['name',_0x5f7d('0xee'),_0x5f7d('0xef')],'required':![]},{'model':db[_0x5f7d('0xf0')],'as':_0x5f7d('0xf1'),'attributes':['id',_0x5f7d('0x3e'),_0x5f7d('0xf2')],'where':_0xcb1778['query']['tag']?{'id':_0xcb1778[_0x5f7d('0x47')][_0x5f7d('0xf3')]}:undefined,'required':_0xcb1778[_0x5f7d('0x47')][_0x5f7d('0xf3')]?!![]:![]}];}return db[_0x5f7d('0xc1')]['findAll'](_0x3d6fc6);})['then'](function(_0x4c3be5){_0x3f8503[_0x5f7d('0x75')]=_0x4c3be5;return _0x3f8503;});}})[_0x5f7d('0x39')](respondWithFilteredResult(_0x8ee5aa,_0x3d6fc6))[_0x5f7d('0x2e')](handleError(_0x8ee5aa,null));};function iftimePromise(_0x4b34c5,_0x16cd64){return respondWithRpcPromise(_0x5f7d('0xf4'),_0x5f7d('0xf5'),{'command':_0x16cd64[_0x5f7d('0xf6')]?util[_0x5f7d('0xf7')]('iftime\x20%s,%s',_0x4b34c5[_0x5f7d('0xf8')],_0x16cd64[_0x5f7d('0xf6')]):util['format']('iftime\x20%s',_0x4b34c5[_0x5f7d('0xf8')])},client9002)[_0x5f7d('0x39')](function(_0x41fae8){var _0x58f641=_0x41fae8&&_0x41fae8[_0x5f7d('0xf9')](_0x5f7d('0xfa'))>=0x0?!![]:![];logger[_0x5f7d('0x24')](_0x5f7d('0xfb'),_0x16cd64['id'],_0x4b34c5['id'],_0x4b34c5[_0x5f7d('0xf8')],_0x58f641?_0x5f7d('0xfc'):_0x5f7d('0xfd'),_0x16cd64[_0x5f7d('0xf6')]?_0x16cd64[_0x5f7d('0xf6')]:'No\x20timezone');return _0x58f641;})['catch'](function(_0x3e7912){logger[_0x5f7d('0x2a')](_0x5f7d('0xfb'),_0x16cd64['id'],_0x4b34c5['id'],_0x4b34c5[_0x5f7d('0xf8')],util['inspect'](_0x3e7912,{'showHidden':![],'depth':null}),_0x16cd64['timezone']?_0x16cd64[_0x5f7d('0xf6')]:_0x5f7d('0xfe'));return![];});}exports[_0x5f7d('0xf5')]=function(_0x4a273e,_0x286ef5,_0x2ca1c6){var _0x3d2c47=0x0;var _0x1b7744=0x0;var _0x51dc6c=![];var _0x15d611;var _0x426615;return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x4a273e[_0x5f7d('0x5c')]['id']},'include':[{'model':db['Interval'],'as':_0x5f7d('0xff'),'include':[{'model':db[_0x5f7d('0xff')],'as':_0x5f7d('0x100'),'attributes':['id',_0x5f7d('0xf8')],'raw':!![]}]}]})[_0x5f7d('0x39')](handleEntityNotFound(_0x286ef5,null))[_0x5f7d('0x39')](function(_0x4db77b){if(_0x4db77b){_0x15d611=_0x4db77b;return _0x4db77b[_0x5f7d('0x101')]({'raw':!![]});}})[_0x5f7d('0x39')](function(_0x479467){if(_0x15d611){if(_0x479467){_0x426615=_0x479467;}}return require(_0x5f7d('0x80'))['getLicense']();})[_0x5f7d('0x39')](function(_0xf453d7){if(_0xf453d7){_0x1b7744=_0xf453d7['virtual'];_0x51dc6c=_0xf453d7['custom'];}})[_0x5f7d('0x39')](function(){return db[_0x5f7d('0xc1')][_0x5f7d('0x32')]({'where':{'closed':![]}});})[_0x5f7d('0x39')](function(_0x5bc971){_0x3d2c47=_0x5bc971;if(_0x1b7744&&_0x5bc971>_0x1b7744){return db['License'][_0x5f7d('0x6c')]({'where':{'id':0x1}})[_0x5f7d('0x39')](function(_0x166ac4){if(_0x166ac4){_0x166ac4[_0x5f7d('0x102')](_0x5f7d('0x103'));}});}})[_0x5f7d('0x39')](function(){if(_0x15d611[_0x5f7d('0xff')]&&_0x15d611[_0x5f7d('0xff')]['Intervals']){var _0x27624c=[];for(var _0x113367=0x0;_0x113367<_0x15d611[_0x5f7d('0xff')][_0x5f7d('0x100')][_0x5f7d('0x4d')];_0x113367++){var _0x5e47cc=_0x15d611[_0x5f7d('0xff')][_0x5f7d('0x100')][_0x113367][_0x5f7d('0x3b')]({'plain':!![]});_0x27624c[_0x5f7d('0xc8')](iftimePromise(_0x5e47cc,_0x15d611));}return BPromise['all'](_0x27624c)[_0x5f7d('0x39')](function(_0x5e6d34){return _['some'](_0x5e6d34);});}else{return!![];}})['then'](function(_0xe86118){var _0x3d2145=fs['readFileSync'](path[_0x5f7d('0x86')](config[_0x5f7d('0x7e')],_0x5f7d('0x104')),'utf8');var _0x4d3b9f={'remote':_0x15d611[_0x5f7d('0x105')],'query':querystring['stringify'](_[_0x5f7d('0x53')](_0x15d611['get']({'plain':!![]}),{'customerIp':_0x4a273e['headers']['x-forwarded-for']||_0x4a273e[_0x5f7d('0x95')]['x-real-ip']||_0x4a273e[_0x5f7d('0x106')]['remoteAddress']||_0x4a273e['ip'],'referer':_0x4a273e['headers']['referer'],'openedInteractions':_0x3d2c47,'maxInteractions':_0x1b7744,'virtual':_0x51dc6c['virtual'],'online':_0xe86118,'custom':_0x51dc6c}))[_0x5f7d('0x107')](/'/g,'\x5c\x27')};_0x286ef5[_0x5f7d('0x3f')](ejs[_0x5f7d('0xdc')](Mustache[_0x5f7d('0xdc')](_0x3d2145,_0x4d3b9f),{'proactiveActions':_0x426615,'alignment':_0x15d611[_0x5f7d('0x108')],'verticalAlignment':_0x15d611[_0x5f7d('0x109')],'div_color':_0x15d611[_0x5f7d('0xf2')],'text_color':_0x15d611[_0x5f7d('0x10a')]}));})[_0x5f7d('0x2e')](handleError(_0x286ef5,null));};exports[_0x5f7d('0x10b')]=function(_0xaac5d9,_0x6d5694,_0x4df574){return db['ChatWebsite'][_0x5f7d('0x6c')]({'where':{'id':_0xaac5d9['params']['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x6d5694,null))[_0x5f7d('0x39')](function(_0x293a4d){if(_0x293a4d){return db['sequelize']['transaction'](function(_0x43dfe7){return db['ChatApplication'][_0x5f7d('0x3a')]({'where':{'ChatWebsiteId':_0xaac5d9[_0x5f7d('0x5c')]['id']},'transaction':_0x43dfe7})[_0x5f7d('0x39')](function(_0x2ea8db){var _0x18bfa9=_[_0x5f7d('0x54')](_0xaac5d9[_0x5f7d('0x60')],function(_0x1333ee){_0x1333ee[_0x5f7d('0x6e')]=_0xaac5d9[_0x5f7d('0x5c')]['id'];return _0x1333ee;});return db[_0x5f7d('0x10c')][_0x5f7d('0x10d')](_0x18bfa9,{'transaction':_0x43dfe7});});})['then'](function(){return db['ChatApplication'][_0x5f7d('0x10e')]({'where':{'ChatWebsiteId':_0xaac5d9[_0x5f7d('0x5c')]['id']},'order':_0x5f7d('0xae')});});}})['then'](respondWithResult(_0x6d5694,null))['catch'](handleError(_0x6d5694,null));};exports[_0x5f7d('0x10f')]=function(_0x3c6318,_0x329c24,_0x39c1b7){var _0x139fee={};var _0xc87696={};var _0x220c73;var _0x3460ee;return db['ChatWebsite'][_0x5f7d('0x6c')]({'where':{'id':_0x3c6318[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x329c24,null))[_0x5f7d('0x39')](function(_0xde4315){if(_0xde4315){_0x220c73=_0xde4315;_0xc87696[_0x5f7d('0x46')]=_['keys'](db[_0x5f7d('0x10c')]['rawAttributes']);_0xc87696[_0x5f7d('0x47')]=_[_0x5f7d('0x48')](_0x3c6318[_0x5f7d('0x47')]);_0xc87696[_0x5f7d('0x49')]=_[_0x5f7d('0x4a')](_0xc87696[_0x5f7d('0x46')],_0xc87696['query']);_0x139fee['attributes']=_[_0x5f7d('0x4a')](_0xc87696[_0x5f7d('0x46')],qs['fields'](_0x3c6318[_0x5f7d('0x47')][_0x5f7d('0x4c')]));_0x139fee[_0x5f7d('0x4b')]=_0x139fee['attributes'][_0x5f7d('0x4d')]?_0x139fee[_0x5f7d('0x4b')]:_0xc87696['model'];_0x139fee[_0x5f7d('0x4f')]=qs[_0x5f7d('0x50')](_0x3c6318[_0x5f7d('0x47')][_0x5f7d('0x50')]);_0x139fee[_0x5f7d('0x51')]=qs[_0x5f7d('0x49')](_[_0x5f7d('0x52')](_0x3c6318[_0x5f7d('0x47')],_0xc87696['filters']));if(_0x3c6318['query'][_0x5f7d('0x56')]){_0x139fee[_0x5f7d('0x51')]=_['merge'](_0x139fee[_0x5f7d('0x51')],{'$or':_[_0x5f7d('0x54')](_0x139fee[_0x5f7d('0x4b')],function(_0x1c6ab5){var _0x3ae7ee={};_0x3ae7ee[_0x1c6ab5]={'$like':'%'+_0x3c6318[_0x5f7d('0x47')][_0x5f7d('0x56')]+'%'};return _0x3ae7ee;})});}_0x139fee=_[_0x5f7d('0x53')]({},_0x139fee,_0x3c6318[_0x5f7d('0x57')]);return _0x220c73[_0x5f7d('0x10f')](_0x139fee);}})['then'](function(_0x9688c0){if(_0x9688c0){_0x3460ee=_0x9688c0[_0x5f7d('0x4d')];if(!_0x3c6318[_0x5f7d('0x47')]['hasOwnProperty'](_0x5f7d('0x6d'))){_0x139fee[_0x5f7d('0x34')]=qs['limit'](_0x3c6318[_0x5f7d('0x47')][_0x5f7d('0x34')]);_0x139fee[_0x5f7d('0x33')]=qs[_0x5f7d('0x33')](_0x3c6318[_0x5f7d('0x47')]['offset']);}return _0x220c73[_0x5f7d('0x10f')](_0x139fee);}})[_0x5f7d('0x39')](function(_0x56bf9b){if(_0x56bf9b){return _0x56bf9b?{'count':_0x3460ee,'rows':_0x56bf9b}:null;}})['then'](respondWithResult(_0x329c24,null))[_0x5f7d('0x2e')](handleError(_0x329c24,null));};exports['addProactiveActions']=function(_0x47209a,_0x53e1a2,_0x49610b){return db['chatProactiveAction'][_0x5f7d('0x5e')]({'where':{'id':_0x47209a[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x53e1a2,null))[_0x5f7d('0x39')](function(_0x55a21d){if(_0x55a21d){return _0x55a21d[_0x5f7d('0x110')](_0x47209a[_0x5f7d('0x60')]['ids'],_[_0x5f7d('0xeb')](_0x47209a['body'],[_0x5f7d('0x70'),'id'])||{});}})[_0x5f7d('0x39')](respondWithResult(_0x53e1a2,null))['catch'](handleError(_0x53e1a2,null));};exports[_0x5f7d('0x101')]=function(_0x55a7f2,_0x17bf6b,_0x5cda1e){var _0x369f35={};var _0x56c265={};var _0x486c4b;var _0x273c55;return db[_0x5f7d('0x58')][_0x5f7d('0x6c')]({'where':{'id':_0x55a7f2['params']['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x17bf6b,null))[_0x5f7d('0x39')](function(_0x1ab39e){if(_0x1ab39e){_0x486c4b=_0x1ab39e;_0x56c265[_0x5f7d('0x46')]=_['keys'](db[_0x5f7d('0x111')]['rawAttributes']);_0x56c265['query']=_[_0x5f7d('0x48')](_0x55a7f2['query']);_0x56c265[_0x5f7d('0x49')]=_[_0x5f7d('0x4a')](_0x56c265[_0x5f7d('0x46')],_0x56c265['query']);_0x369f35[_0x5f7d('0x4b')]=_[_0x5f7d('0x4a')](_0x56c265[_0x5f7d('0x46')],qs[_0x5f7d('0x4c')](_0x55a7f2[_0x5f7d('0x47')][_0x5f7d('0x4c')]));_0x369f35['attributes']=_0x369f35[_0x5f7d('0x4b')][_0x5f7d('0x4d')]?_0x369f35[_0x5f7d('0x4b')]:_0x56c265[_0x5f7d('0x46')];_0x369f35[_0x5f7d('0x4f')]=qs[_0x5f7d('0x50')](_0x55a7f2[_0x5f7d('0x47')][_0x5f7d('0x50')]);_0x369f35[_0x5f7d('0x51')]=qs['filters'](_['pick'](_0x55a7f2['query'],_0x56c265[_0x5f7d('0x49')]));if(_0x55a7f2['query'][_0x5f7d('0x56')]){_0x369f35[_0x5f7d('0x51')]=_['merge'](_0x369f35[_0x5f7d('0x51')],{'$or':_['map'](_0x369f35[_0x5f7d('0x4b')],function(_0x400101){var _0xd45e48={};_0xd45e48[_0x400101]={'$like':'%'+_0x55a7f2['query'][_0x5f7d('0x56')]+'%'};return _0xd45e48;})});}_0x369f35=_[_0x5f7d('0x53')]({},_0x369f35,_0x55a7f2[_0x5f7d('0x57')]);return _0x486c4b[_0x5f7d('0x101')](_0x369f35);}})[_0x5f7d('0x39')](function(_0x59515f){if(_0x59515f){_0x273c55=_0x59515f[_0x5f7d('0x4d')];if(!_0x55a7f2[_0x5f7d('0x47')]['hasOwnProperty']('nolimit')){_0x369f35[_0x5f7d('0x34')]=qs[_0x5f7d('0x34')](_0x55a7f2[_0x5f7d('0x47')][_0x5f7d('0x34')]);_0x369f35[_0x5f7d('0x33')]=qs['offset'](_0x55a7f2['query'][_0x5f7d('0x33')]);}return _0x486c4b['getProactiveActions'](_0x369f35);}})[_0x5f7d('0x39')](function(_0x474925){if(_0x474925){return _0x474925?{'count':_0x273c55,'rows':_0x474925}:null;}})[_0x5f7d('0x39')](respondWithResult(_0x17bf6b,null))['catch'](handleError(_0x17bf6b,null));};exports[_0x5f7d('0x112')]=function(_0x3daee2,_0xca51c3,_0x4d822f){var _0x29ae62=_0x3daee2[_0x5f7d('0x47')]['online']===_0x5f7d('0x113')?_0x5f7d('0x114'):_0x5f7d('0x115');return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'attributes':['id',_0x29ae62],'where':{'id':_0x3daee2[_0x5f7d('0x5c')]['id']}})['then'](handleEntityNotFound(_0xca51c3,null))[_0x5f7d('0x39')](function(_0x1bddba){if(_0x1bddba){var _0x260f27=_0x1bddba[_0x29ae62];var _0x4df756=_0x260f27&&_0x260f27[_0x5f7d('0x116')]?_0x260f27[_0x5f7d('0x116')]:[];_0xca51c3[_0x5f7d('0x3f')]({'fromKey':_['isNil'](_0x260f27[_0x5f7d('0x117')])?undefined:_0x260f27[_0x5f7d('0x117')],'count':_0x4df756[_0x5f7d('0x4d')],'rows':_0x4df756});}})[_0x5f7d('0x2e')](handleError(_0xca51c3,null));};exports['getOfflineMessages']=function(_0x5ac5a0,_0x4d0dc7,_0x3aa1b3){var _0x199eff={'raw':![],'where':{}};var _0xcebcf0={};var _0x262da6={'count':0x0,'rows':[]};return db[_0x5f7d('0x58')][_0x5f7d('0x6c')]({'where':{'id':_0x5ac5a0[_0x5f7d('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4d0dc7,null))[_0x5f7d('0x39')](function(_0x13c4c0){if(_0x13c4c0){_0xcebcf0['model']=_[_0x5f7d('0x48')](db[_0x5f7d('0x118')][_0x5f7d('0x42')]);_0xcebcf0[_0x5f7d('0x47')]=_['keys'](_0x5ac5a0['query']);_0xcebcf0['filters']=_['intersection'](_0xcebcf0[_0x5f7d('0x46')],_0xcebcf0[_0x5f7d('0x47')]);_0x199eff[_0x5f7d('0x4b')]=_['intersection'](_0xcebcf0[_0x5f7d('0x46')],qs[_0x5f7d('0x4c')](_0x5ac5a0[_0x5f7d('0x47')][_0x5f7d('0x4c')]));_0x199eff[_0x5f7d('0x4b')]=_0x199eff[_0x5f7d('0x4b')][_0x5f7d('0x4d')]?_0x199eff[_0x5f7d('0x4b')]:_0xcebcf0[_0x5f7d('0x46')];if(!_0x5ac5a0[_0x5f7d('0x47')]['hasOwnProperty'](_0x5f7d('0x6d'))){_0x199eff[_0x5f7d('0x34')]=qs[_0x5f7d('0x34')](_0x5ac5a0['query'][_0x5f7d('0x34')]);_0x199eff[_0x5f7d('0x33')]=qs[_0x5f7d('0x33')](_0x5ac5a0[_0x5f7d('0x47')][_0x5f7d('0x33')]);}_0x199eff[_0x5f7d('0x4f')]=qs[_0x5f7d('0x50')](_0x5ac5a0[_0x5f7d('0x47')]['sort']);_0x199eff[_0x5f7d('0x51')]=qs[_0x5f7d('0x49')](_[_0x5f7d('0x52')](_0x5ac5a0[_0x5f7d('0x47')],_0xcebcf0[_0x5f7d('0x49')]));_0x199eff[_0x5f7d('0x51')][_0x5f7d('0x6e')]=_0x13c4c0['id'];if(_0x5ac5a0[_0x5f7d('0x47')][_0x5f7d('0x56')]){_0x199eff[_0x5f7d('0x51')]=_[_0x5f7d('0x53')](_0x199eff[_0x5f7d('0x51')],{'$or':_['map'](_0x199eff[_0x5f7d('0x4b')],function(_0x18fd42){var _0x30e77c={};_0x30e77c[_0x18fd42]={'$like':'%'+_0x5ac5a0[_0x5f7d('0x47')][_0x5f7d('0x56')]+'%'};return _0x30e77c;})});}_0x199eff=_['merge']({},_0x199eff,_0x5ac5a0[_0x5f7d('0x57')]);return db[_0x5f7d('0x118')][_0x5f7d('0x32')]({'where':_0x199eff[_0x5f7d('0x51')]})['then'](function(_0x1c0695){_0x262da6[_0x5f7d('0x32')]=_0x1c0695;if(_0x5ac5a0['query'][_0x5f7d('0x59')]){_0x199eff[_0x5f7d('0x5a')]=[{'all':!![]}];}else{_0x199eff[_0x5f7d('0x5a')]=[{'model':db[_0x5f7d('0x99')],'as':_0x5f7d('0xec'),'required':![]}];}return db[_0x5f7d('0x118')][_0x5f7d('0x74')](_0x199eff);})[_0x5f7d('0x39')](function(_0x39e143){_0x262da6[_0x5f7d('0x75')]=_0x39e143;return _0x262da6;});}})[_0x5f7d('0x39')](respondWithFilteredResult(_0x4d0dc7,_0x199eff))[_0x5f7d('0x2e')](handleError(_0x4d0dc7,null));};exports[_0x5f7d('0x119')]=function(_0x26c118,_0x582871,_0x1e59c5){return db[_0x5f7d('0x58')][_0x5f7d('0x5e')]({'where':{'id':_0x26c118[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x582871,null))[_0x5f7d('0x39')](function(_0x529899){if(_0x529899){return _0x529899[_0x5f7d('0x119')](_0x26c118['body'][_0x5f7d('0x70')],_[_0x5f7d('0xeb')](_0x26c118[_0x5f7d('0x60')],[_0x5f7d('0x70'),'id'])||{})[_0x5f7d('0x11a')](function(_0x57fe1c){for(var _0x4d9088=0x0;_0x4d9088<_0x26c118[_0x5f7d('0x60')]['ids'][_0x5f7d('0x4d')];_0x4d9088+=0x1){socket[_0x5f7d('0x11b')](_0x5f7d('0x11c'),{'UserId':_0x26c118['body'][_0x5f7d('0x70')][_0x4d9088],'ChatWebsiteId':_0x26c118[_0x5f7d('0x5c')]['id']});}return _0x57fe1c;});}})[_0x5f7d('0x39')](respondWithResult(_0x582871,null))[_0x5f7d('0x2e')](handleError(_0x582871,null));};exports[_0x5f7d('0x11d')]=function(_0x5432fe,_0x586924,_0x2ed3e0){return db[_0x5f7d('0x58')]['find']({'where':{'id':_0x5432fe[_0x5f7d('0x5c')]['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x586924,null))[_0x5f7d('0x39')](function(_0x2f1eda){if(_0x2f1eda){return _0x2f1eda[_0x5f7d('0x11d')](_0x5432fe['query'][_0x5f7d('0x70')])['then'](function(){if(_[_0x5f7d('0x11e')](_0x5432fe[_0x5f7d('0x47')]['ids'])){for(var _0x14138d=0x0;_0x14138d<_0x5432fe[_0x5f7d('0x47')]['ids'][_0x5f7d('0x4d')];_0x14138d+=0x1){socket['emit'](_0x5f7d('0x11f'),{'UserId':Number(_0x5432fe['query'][_0x5f7d('0x70')][_0x14138d]),'ChatWebsiteId':Number(_0x5432fe[_0x5f7d('0x5c')]['id'])});}}else{socket[_0x5f7d('0x11b')](_0x5f7d('0x11f'),{'UserId':Number(_0x5432fe[_0x5f7d('0x47')]['ids']),'ChatWebsiteId':Number(_0x5432fe['params']['id'])});}});}})[_0x5f7d('0x39')](respondWithStatusCode(_0x586924,null))['catch'](handleError(_0x586924,null));};exports[_0x5f7d('0x120')]=function(_0x3f51f2,_0x549c01,_0x386482){var _0x2f00fc={};var _0x38af61={};var _0x367901;var _0x12486b;return db[_0x5f7d('0x58')]['findOne']({'where':{'id':_0x3f51f2['params']['id']}})[_0x5f7d('0x39')](handleEntityNotFound(_0x549c01,null))[_0x5f7d('0x39')](function(_0x1994bc){if(_0x1994bc){_0x367901=_0x1994bc;_0x38af61[_0x5f7d('0x46')]=_['keys'](db['User']['rawAttributes']);_0x38af61[_0x5f7d('0x47')]=_['keys'](_0x3f51f2[_0x5f7d('0x47')]);_0x38af61[_0x5f7d('0x49')]=_['intersection'](_0x38af61[_0x5f7d('0x46')],_0x38af61[_0x5f7d('0x47')]);_0x2f00fc[_0x5f7d('0x4b')]=_[_0x5f7d('0x4a')](_0x38af61[_0x5f7d('0x46')],qs[_0x5f7d('0x4c')](_0x3f51f2[_0x5f7d('0x47')]['fields']));_0x2f00fc[_0x5f7d('0x4b')]=_0x2f00fc['attributes']['length']?_0x2f00fc['attributes']:_0x38af61['model'];_0x2f00fc[_0x5f7d('0x4f')]=qs[_0x5f7d('0x50')](_0x3f51f2[_0x5f7d('0x47')]['sort']);_0x2f00fc[_0x5f7d('0x51')]=qs[_0x5f7d('0x49')](_[_0x5f7d('0x52')](_0x3f51f2['query'],_0x38af61['filters']));if(_0x3f51f2['query'][_0x5f7d('0x56')]){_0x2f00fc[_0x5f7d('0x51')]=_[_0x5f7d('0x53')](_0x2f00fc[_0x5f7d('0x51')],{'$or':_[_0x5f7d('0x54')](_0x2f00fc[_0x5f7d('0x4b')],function(_0x4e1ee3){var _0x40d6ff={};_0x40d6ff[_0x4e1ee3]={'$like':'%'+_0x3f51f2['query'][_0x5f7d('0x56')]+'%'};return _0x40d6ff;})});}_0x2f00fc=_[_0x5f7d('0x53')]({},_0x2f00fc,_0x3f51f2[_0x5f7d('0x57')]);return _0x367901[_0x5f7d('0x120')](_0x2f00fc);}})[_0x5f7d('0x39')](function(_0x494ca8){if(_0x494ca8){_0x12486b=_0x494ca8['length'];if(!_0x3f51f2[_0x5f7d('0x47')][_0x5f7d('0x4e')]('nolimit')){_0x2f00fc['limit']=qs[_0x5f7d('0x34')](_0x3f51f2[_0x5f7d('0x47')]['limit']);_0x2f00fc['offset']=qs[_0x5f7d('0x33')](_0x3f51f2[_0x5f7d('0x47')][_0x5f7d('0x33')]);}return _0x367901[_0x5f7d('0x120')](_0x2f00fc);}})[_0x5f7d('0x39')](function(_0x584e8b){if(_0x584e8b){return _0x584e8b?{'count':_0x12486b,'rows':_0x584e8b}:null;}})['then'](respondWithResult(_0x549c01,null))[_0x5f7d('0x2e')](handleError(_0x549c01,null));};
\ No newline at end of file
+var _0x9b5a=['root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','getAvatar','server/files/images/avatars/','agentAvatar','showCustomerAvatar','existsSync','download','notify','user-agent-parser','headers','user-agent','getResult','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','account','applications','list','orderBy','priority','asc','Applications','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','Smtp','forwardOfflineAddress','service','host','secure','auth','sendMail','\x22%s\x22\x20<%s>','email','addInteraction','omit','getInteractions','Owner','fullname','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','../../config/license/util','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.js','remoteAddress','virtual','alignment','addApplications','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','model','query','keys','intersection','attributes','fields','length','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','hasOwnProperty','nolimit','removeDispositions','ids','CannedAnswer','create','findOne','order','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join'];(function(_0xdab455,_0x3d8665){var _0x74aa26=function(_0x5999fb){while(--_0x5999fb){_0xdab455['push'](_0xdab455['shift']());}};_0x74aa26(++_0x3d8665);}(_0x9b5a,0x98));var _0xa9b5=function(_0xc10244,_0x34a968){_0xc10244=_0xc10244-0x0;var _0x22917f=_0x9b5a[_0xc10244];return _0x22917f;};'use strict';var pdf=require(_0xa9b5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa9b5('0x1'));var zipdir=require(_0xa9b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9b5('0x3'));var moment=require(_0xa9b5('0x4'));var BPromise=require(_0xa9b5('0x5'));var Mustache=require(_0xa9b5('0x6'));var util=require(_0xa9b5('0x7'));var path=require('path');var sox=require(_0xa9b5('0x8'));var csv=require('to-csv');var ejs=require(_0xa9b5('0x9'));var fs=require('fs');var _=require(_0xa9b5('0xa'));var squel=require(_0xa9b5('0xb'));var crypto=require(_0xa9b5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa9b5('0xd'));var toCsv=require(_0xa9b5('0xe'));var querystring=require(_0xa9b5('0xf'));var Papa=require(_0xa9b5('0x10'));var Redis=require(_0xa9b5('0x11'));var authService=require(_0xa9b5('0x12'));var qs=require(_0xa9b5('0x13'));var as=require(_0xa9b5('0x14'));var hardwareService=require(_0xa9b5('0x15'));var logger=require(_0xa9b5('0x16'))('api');var utils=require(_0xa9b5('0x17'));var config=require(_0xa9b5('0x18'));var db=require('../../mysqldb')['db'];config[_0xa9b5('0x19')]=_[_0xa9b5('0x1a')](config[_0xa9b5('0x19')],{'host':_0xa9b5('0x1b'),'port':0x18eb});var socket=require(_0xa9b5('0x1c'))(new Redis(config[_0xa9b5('0x19')]));require(_0xa9b5('0x1d'))['register'](socket);var jayson=require(_0xa9b5('0x1e'));var client=jayson[_0xa9b5('0x1f')][_0xa9b5('0x20')]({'port':0x232c});var client9002=jayson[_0xa9b5('0x1f')][_0xa9b5('0x20')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});function checkPasswordPattern(_0x439568,_0x3f4e39,_0x3520c3){if(_0x3520c3){var _0x59a365=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59a365[_0xa9b5('0x21')](_0x3f4e39)){return _0x439568;}else{throw new db[(_0xa9b5('0x22'))][(_0xa9b5('0x23'))](_0xa9b5('0x24'));}}else{return _0x439568;}}function respondWithRpcPromise(_0x2978ed,_0x43bda2,_0xe04636,_0x3528a5){return new BPromise(function(_0xa84c9a,_0x1895d7){var _0x2a2170=_0x3528a5||client;return _0x2a2170[_0xa9b5('0x25')](_0x2978ed,_0xe04636)[_0xa9b5('0x26')](function(_0x42de2d){logger[_0xa9b5('0x27')](_0xa9b5('0x28'),_0x43bda2,_0xa9b5('0x29'));logger['debug'](_0xa9b5('0x2a'),_0x43bda2,_0xa9b5('0x29'),JSON[_0xa9b5('0x2b')](_0x42de2d));if(_0x42de2d[_0xa9b5('0x2c')]){if(_0x42de2d[_0xa9b5('0x2c')]['code']===0x1f4){logger[_0xa9b5('0x2c')](_0xa9b5('0x28'),_0x43bda2,_0x42de2d[_0xa9b5('0x2c')]['message']);return _0x1895d7(_0x42de2d[_0xa9b5('0x2c')]['message']);}logger[_0xa9b5('0x2c')](_0xa9b5('0x28'),_0x43bda2,_0x42de2d[_0xa9b5('0x2c')][_0xa9b5('0x2d')]);return _0xa84c9a(_0x42de2d['error'][_0xa9b5('0x2d')]);}else{logger['info'](_0xa9b5('0x28'),_0x43bda2,'request\x20sent');_0xa84c9a(_0x42de2d['result'][_0xa9b5('0x2d')]);}})['catch'](function(_0x3ffa9b){logger[_0xa9b5('0x2c')](_0xa9b5('0x28'),_0x43bda2,_0x3ffa9b);_0x1895d7(_0x3ffa9b);});});}function respondWithStatusCode(_0x40f0c4,_0x23d0b8){_0x23d0b8=_0x23d0b8||0xcc;return function(_0x4984e5){if(_0x4984e5){return _0x40f0c4[_0xa9b5('0x2e')](_0x23d0b8);}return _0x40f0c4[_0xa9b5('0x2f')](_0x23d0b8)[_0xa9b5('0x30')]();};}function respondWithResult(_0x21f345,_0xd2a391){_0xd2a391=_0xd2a391||0xc8;return function(_0x54aa92){if(_0x54aa92){return _0x21f345[_0xa9b5('0x2f')](_0xd2a391)['json'](_0x54aa92);}};}function respondWithFilteredResult(_0x452434,_0x59a0b0){return function(_0x3c7d58){if(_0x3c7d58){var _0x2d51bb=_0x3c7d58[_0xa9b5('0x31')],_0x29d33f=_0x59a0b0[_0xa9b5('0x32')],_0x323c47=_0x59a0b0['offset']+_0x59a0b0[_0xa9b5('0x33')],_0x44d8a2;if(_0x323c47>=_0x2d51bb){_0x323c47=_0x2d51bb;_0x44d8a2=0xc8;}else{_0x44d8a2=0xce;}_0x452434[_0xa9b5('0x2f')](_0x44d8a2);return _0x452434[_0xa9b5('0x34')](_0xa9b5('0x35'),_0x29d33f+'-'+_0x323c47+'/'+_0x2d51bb)[_0xa9b5('0x36')](_0x3c7d58);}return null;};}function patchUpdates(_0x1663ff){return function(_0x12ed63){try{jsonpatch[_0xa9b5('0x37')](_0x12ed63,_0x1663ff,!![]);}catch(_0x22682c){return BPromise[_0xa9b5('0x38')](_0x22682c);}return _0x12ed63[_0xa9b5('0x39')]();};}function saveUpdates(_0x36245a,_0x1fb109){return function(_0x12b804){if(_0x12b804){return _0x12b804[_0xa9b5('0x3a')](_0x36245a)[_0xa9b5('0x26')](function(_0x4ee93d){return _0x4ee93d;});}return null;};}function removeEntity(_0x500836,_0x274b6c){return function(_0x122700){if(_0x122700){return _0x122700[_0xa9b5('0x3b')]()['then'](function(){var _0x42cfe6=_0x122700[_0xa9b5('0x3c')]({'plain':!![]});var _0x33d03e='ChatWebsites';return db[_0xa9b5('0x3d')][_0xa9b5('0x3b')]({'where':{'type':_0x33d03e,'resourceId':_0x42cfe6['id']}})[_0xa9b5('0x26')](function(){return _0x122700;});})['then'](function(){_0x500836[_0xa9b5('0x2f')](0xcc)[_0xa9b5('0x30')]();});}};}function handleEntityNotFound(_0x1e4b89,_0x395350){return function(_0x65e35b){if(!_0x65e35b){_0x1e4b89[_0xa9b5('0x2e')](0x194);}return _0x65e35b;};}function handleError(_0x5e6a83,_0x21c9f9){_0x21c9f9=_0x21c9f9||0x1f4;return function(_0x13ab09){logger[_0xa9b5('0x2c')](_0x13ab09[_0xa9b5('0x3e')]);if(_0x13ab09[_0xa9b5('0x3f')]){delete _0x13ab09[_0xa9b5('0x3f')];}_0x5e6a83[_0xa9b5('0x2f')](_0x21c9f9)[_0xa9b5('0x40')](_0x13ab09);};}exports[_0xa9b5('0x41')]=function(_0x30454d,_0x4063d9){var _0x176b40={'include':[{'model':db[_0xa9b5('0x42')],'as':_0xa9b5('0x43')}]},_0x550072={},_0x427e0c={'count':0x0,'rows':[]};var _0x2952ee=_[_0xa9b5('0x44')](db[_0xa9b5('0x45')]['rawAttributes'],function(_0x3b367a){return{'name':_0x3b367a['fieldName'],'type':_0x3b367a['type']['key']};});_0x550072[_0xa9b5('0x46')]=_['map'](_0x2952ee,_0xa9b5('0x3f'));_0x550072[_0xa9b5('0x47')]=_[_0xa9b5('0x48')](_0x30454d[_0xa9b5('0x47')]);_0x550072['filters']=_[_0xa9b5('0x49')](_0x550072[_0xa9b5('0x46')],_0x550072[_0xa9b5('0x47')]);_0x176b40[_0xa9b5('0x4a')]=_[_0xa9b5('0x49')](_0x550072[_0xa9b5('0x46')],qs[_0xa9b5('0x4b')](_0x30454d[_0xa9b5('0x47')][_0xa9b5('0x4b')]));_0x176b40[_0xa9b5('0x4a')]=_0x176b40[_0xa9b5('0x4a')][_0xa9b5('0x4c')]?_0x176b40['attributes']:_0x550072[_0xa9b5('0x46')];if(!_0x30454d[_0xa9b5('0x47')]['hasOwnProperty']('nolimit')){_0x176b40['limit']=qs[_0xa9b5('0x33')](_0x30454d[_0xa9b5('0x47')]['limit']);_0x176b40[_0xa9b5('0x32')]=qs['offset'](_0x30454d[_0xa9b5('0x47')][_0xa9b5('0x32')]);}_0x176b40['order']=qs[_0xa9b5('0x4d')](_0x30454d[_0xa9b5('0x47')][_0xa9b5('0x4d')]);_0x176b40['where']=qs[_0xa9b5('0x4e')](_[_0xa9b5('0x4f')](_0x30454d['query'],_0x550072['filters']),_0x2952ee);if(_0x30454d[_0xa9b5('0x47')][_0xa9b5('0x50')]){_0x176b40['where']=_['merge'](_0x176b40[_0xa9b5('0x51')],{'$or':_[_0xa9b5('0x44')](_0x2952ee,function(_0x380990){if(_0x380990['type']!==_0xa9b5('0x52')){var _0x1acf05={};_0x1acf05[_0x380990['name']]={'$like':'%'+_0x30454d[_0xa9b5('0x47')][_0xa9b5('0x50')]+'%'};return _0x1acf05;}})});}_0x176b40=_['merge']({},_0x176b40,_0x30454d[_0xa9b5('0x53')]);var _0x26641d={'where':_0x176b40['where']};return db[_0xa9b5('0x45')][_0xa9b5('0x31')](_0x26641d)[_0xa9b5('0x26')](function(_0x2ce3b9){_0x427e0c['count']=_0x2ce3b9;if(_0x30454d[_0xa9b5('0x47')][_0xa9b5('0x54')]){_0x176b40[_0xa9b5('0x55')]=[{'all':!![]}];}return db[_0xa9b5('0x45')][_0xa9b5('0x56')](_0x176b40);})[_0xa9b5('0x26')](function(_0x45f6aa){_0x427e0c[_0xa9b5('0x57')]=_0x45f6aa;return _0x427e0c;})[_0xa9b5('0x26')](respondWithFilteredResult(_0x4063d9,_0x176b40))[_0xa9b5('0x58')](handleError(_0x4063d9,null));};exports[_0xa9b5('0x59')]=function(_0x2d736b,_0x404f1d){var _0x1b7ef4={'raw':![],'where':{'id':_0x2d736b['params']['id']},'include':[{'model':db[_0xa9b5('0x42')],'as':_0xa9b5('0x43')}]},_0x2f51af={};_0x2f51af[_0xa9b5('0x46')]=_['keys'](db[_0xa9b5('0x45')][_0xa9b5('0x5a')]);_0x2f51af[_0xa9b5('0x47')]=_[_0xa9b5('0x48')](_0x2d736b['query']);_0x2f51af['filters']=_[_0xa9b5('0x49')](_0x2f51af[_0xa9b5('0x46')],_0x2f51af['query']);_0x1b7ef4['attributes']=_[_0xa9b5('0x49')](_0x2f51af[_0xa9b5('0x46')],qs[_0xa9b5('0x4b')](_0x2d736b[_0xa9b5('0x47')][_0xa9b5('0x4b')]));_0x1b7ef4[_0xa9b5('0x4a')]=_0x1b7ef4[_0xa9b5('0x4a')]['length']?_0x1b7ef4['attributes']:_0x2f51af['model'];if(_0x2d736b[_0xa9b5('0x47')]['includeAll']){_0x1b7ef4[_0xa9b5('0x55')]=[{'all':!![]}];}_0x1b7ef4=_[_0xa9b5('0x5b')]({},_0x1b7ef4,_0x2d736b['options']);return db[_0xa9b5('0x45')][_0xa9b5('0x5c')](_0x1b7ef4)[_0xa9b5('0x26')](handleEntityNotFound(_0x404f1d,null))[_0xa9b5('0x26')](respondWithResult(_0x404f1d,null))[_0xa9b5('0x58')](handleError(_0x404f1d,null));};exports['create']=function(_0x2ba05e,_0x4b2ed6){return db[_0xa9b5('0x45')]['create'](_0x2ba05e[_0xa9b5('0x5d')],{})['then'](function(_0x1c56af){var _0x23c29d=_0x2ba05e[_0xa9b5('0x5e')]['get']({'plain':!![]});if(!_0x23c29d)throw new Error(_0xa9b5('0x5f'));if(_0x23c29d['role']===_0xa9b5('0x5e')){var _0x424905=_0x1c56af[_0xa9b5('0x3c')]({'plain':!![]});var _0x3ab8ff='ChatWebsites';return db[_0xa9b5('0x60')][_0xa9b5('0x5c')]({'where':{'name':_0x3ab8ff,'userProfileId':_0x23c29d['userProfileId']},'raw':!![]})[_0xa9b5('0x26')](function(_0x10f0d1){if(_0x10f0d1&&_0x10f0d1[_0xa9b5('0x61')]===0x0){return db[_0xa9b5('0x3d')]['create']({'name':_0x424905[_0xa9b5('0x3f')],'resourceId':_0x424905['id'],'type':_0x10f0d1[_0xa9b5('0x3f')],'sectionId':_0x10f0d1['id']},{})[_0xa9b5('0x26')](function(){return _0x1c56af;});}else{return _0x1c56af;}})[_0xa9b5('0x58')](function(_0xc67231){logger[_0xa9b5('0x2c')](_0xa9b5('0x62'),_0xc67231);throw _0xc67231;});}return _0x1c56af;})[_0xa9b5('0x26')](respondWithResult(_0x4b2ed6,0xc9))[_0xa9b5('0x58')](handleError(_0x4b2ed6,null));};exports[_0xa9b5('0x3a')]=function(_0xea3526,_0x179dcb){if(_0xea3526[_0xa9b5('0x5d')]['id']){delete _0xea3526['body']['id'];}return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0xea3526['params']['id']},'include':[{'model':db[_0xa9b5('0x42')],'as':_0xa9b5('0x43')}]})[_0xa9b5('0x26')](handleEntityNotFound(_0x179dcb,null))[_0xa9b5('0x26')](saveUpdates(_0xea3526[_0xa9b5('0x5d')],null))['then'](respondWithResult(_0x179dcb,null))[_0xa9b5('0x58')](handleError(_0x179dcb,null));};exports['destroy']=function(_0x2a5b63,_0x81a970){return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x2a5b63[_0xa9b5('0x63')]['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x81a970,null))[_0xa9b5('0x26')](removeEntity(_0x81a970,null))[_0xa9b5('0x58')](handleError(_0x81a970,null));};exports['describe']=function(_0x515bb9,_0x8f5ac8){return db['ChatWebsite'][_0xa9b5('0x64')]()[_0xa9b5('0x26')](respondWithResult(_0x8f5ac8,null))[_0xa9b5('0x58')](handleError(_0x8f5ac8,null));};exports[_0xa9b5('0x65')]=function(_0x3cf637,_0x4dcb6a,_0x5bafcf){if(_0x3cf637[_0xa9b5('0x5d')]['id']){delete _0x3cf637['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x3cf637['params']['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x4dcb6a,null))['then'](function(_0x53f542){if(_0x53f542){_0x3cf637[_0xa9b5('0x5d')][_0xa9b5('0x66')]=_0x53f542['id'];return db['Disposition']['create'](_0x3cf637[_0xa9b5('0x5d')]);}})[_0xa9b5('0x26')](respondWithResult(_0x4dcb6a,null))[_0xa9b5('0x58')](handleError(_0x4dcb6a,null));};exports[_0xa9b5('0x67')]=function(_0x58d357,_0x35dca7,_0x2ed8b9){var _0x18be6c={'raw':![],'where':{}};var _0x4fd07a={};var _0x47bef6={'count':0x0,'rows':[]};return db[_0xa9b5('0x45')]['findOne']({'where':{'id':_0x58d357[_0xa9b5('0x63')]['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x35dca7,null))[_0xa9b5('0x26')](function(_0x449870){if(_0x449870){_0x4fd07a[_0xa9b5('0x46')]=_[_0xa9b5('0x48')](db[_0xa9b5('0x68')][_0xa9b5('0x5a')]);_0x4fd07a['query']=_[_0xa9b5('0x48')](_0x58d357['query']);_0x4fd07a[_0xa9b5('0x4e')]=_[_0xa9b5('0x49')](_0x4fd07a[_0xa9b5('0x46')],_0x4fd07a[_0xa9b5('0x47')]);_0x18be6c['attributes']=_[_0xa9b5('0x49')](_0x4fd07a[_0xa9b5('0x46')],qs[_0xa9b5('0x4b')](_0x58d357[_0xa9b5('0x47')][_0xa9b5('0x4b')]));_0x18be6c[_0xa9b5('0x4a')]=_0x18be6c[_0xa9b5('0x4a')]['length']?_0x18be6c[_0xa9b5('0x4a')]:_0x4fd07a[_0xa9b5('0x46')];if(!_0x58d357[_0xa9b5('0x47')][_0xa9b5('0x69')](_0xa9b5('0x6a'))){_0x18be6c[_0xa9b5('0x33')]=qs['limit'](_0x58d357[_0xa9b5('0x47')][_0xa9b5('0x33')]);_0x18be6c[_0xa9b5('0x32')]=qs[_0xa9b5('0x32')](_0x58d357[_0xa9b5('0x47')]['offset']);}_0x18be6c['order']=qs[_0xa9b5('0x4d')](_0x58d357[_0xa9b5('0x47')][_0xa9b5('0x4d')]);_0x18be6c['where']=qs[_0xa9b5('0x4e')](_['pick'](_0x58d357[_0xa9b5('0x47')],_0x4fd07a[_0xa9b5('0x4e')]));_0x18be6c[_0xa9b5('0x51')]['ChatWebsiteId']=_0x449870['id'];if(_0x58d357[_0xa9b5('0x47')][_0xa9b5('0x50')]){_0x18be6c['where']=_[_0xa9b5('0x5b')](_0x18be6c[_0xa9b5('0x51')],{'$or':_[_0xa9b5('0x44')](_0x18be6c[_0xa9b5('0x4a')],function(_0x342b0a){var _0x4271a4={};_0x4271a4[_0x342b0a]={'$like':'%'+_0x58d357[_0xa9b5('0x47')][_0xa9b5('0x50')]+'%'};return _0x4271a4;})});}_0x18be6c=_['merge']({},_0x18be6c,_0x58d357[_0xa9b5('0x53')]);return db['Disposition'][_0xa9b5('0x31')]({'where':_0x18be6c[_0xa9b5('0x51')]})[_0xa9b5('0x26')](function(_0x65c3f2){_0x47bef6[_0xa9b5('0x31')]=_0x65c3f2;if(_0x58d357[_0xa9b5('0x47')][_0xa9b5('0x54')]){_0x18be6c[_0xa9b5('0x55')]=[{'all':!![]}];}return db[_0xa9b5('0x68')][_0xa9b5('0x56')](_0x18be6c);})[_0xa9b5('0x26')](function(_0x39efe7){_0x47bef6[_0xa9b5('0x57')]=_0x39efe7;return _0x47bef6;});}})[_0xa9b5('0x26')](respondWithFilteredResult(_0x35dca7,_0x18be6c))['catch'](handleError(_0x35dca7,null));};exports[_0xa9b5('0x6b')]=function(_0x4234a6,_0x2f5de7,_0x5141e3){return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x4234a6[_0xa9b5('0x63')]['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x2f5de7,null))[_0xa9b5('0x26')](function(_0x5e45ef){if(_0x5e45ef){return _0x5e45ef[_0xa9b5('0x6b')](_0x4234a6[_0xa9b5('0x47')][_0xa9b5('0x6c')]);}})['then'](respondWithStatusCode(_0x2f5de7,null))[_0xa9b5('0x58')](handleError(_0x2f5de7,null));};exports['addAnswer']=function(_0x2c7bb3,_0x2c9ca1,_0x13c3a3){if(_0x2c7bb3[_0xa9b5('0x5d')]['id']){delete _0x2c7bb3[_0xa9b5('0x5d')]['id'];}return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x2c7bb3[_0xa9b5('0x63')]['id']}})['then'](handleEntityNotFound(_0x2c9ca1,null))['then'](function(_0x19ed5f){if(_0x19ed5f){_0x2c7bb3['body'][_0xa9b5('0x66')]=_0x19ed5f['id'];return db[_0xa9b5('0x6d')][_0xa9b5('0x6e')](_0x2c7bb3[_0xa9b5('0x5d')]);}})[_0xa9b5('0x26')](respondWithResult(_0x2c9ca1,null))[_0xa9b5('0x58')](handleError(_0x2c9ca1,null));};exports['getAnswers']=function(_0xd0bbbe,_0x51b898,_0x145280){var _0x312e3e={'raw':![],'where':{}};var _0x1fafc5={};var _0x36d8cc={'count':0x0,'rows':[]};return db[_0xa9b5('0x45')][_0xa9b5('0x6f')]({'where':{'id':_0xd0bbbe[_0xa9b5('0x63')]['id']}})['then'](handleEntityNotFound(_0x51b898,null))[_0xa9b5('0x26')](function(_0x1358df){if(_0x1358df){_0x1fafc5[_0xa9b5('0x46')]=_[_0xa9b5('0x48')](db[_0xa9b5('0x6d')][_0xa9b5('0x5a')]);_0x1fafc5[_0xa9b5('0x47')]=_[_0xa9b5('0x48')](_0xd0bbbe[_0xa9b5('0x47')]);_0x1fafc5[_0xa9b5('0x4e')]=_['intersection'](_0x1fafc5['model'],_0x1fafc5[_0xa9b5('0x47')]);_0x312e3e[_0xa9b5('0x4a')]=_[_0xa9b5('0x49')](_0x1fafc5[_0xa9b5('0x46')],qs[_0xa9b5('0x4b')](_0xd0bbbe[_0xa9b5('0x47')][_0xa9b5('0x4b')]));_0x312e3e[_0xa9b5('0x4a')]=_0x312e3e[_0xa9b5('0x4a')]['length']?_0x312e3e[_0xa9b5('0x4a')]:_0x1fafc5['model'];if(!_0xd0bbbe['query']['hasOwnProperty'](_0xa9b5('0x6a'))){_0x312e3e[_0xa9b5('0x33')]=qs['limit'](_0xd0bbbe[_0xa9b5('0x47')][_0xa9b5('0x33')]);_0x312e3e['offset']=qs[_0xa9b5('0x32')](_0xd0bbbe[_0xa9b5('0x47')][_0xa9b5('0x32')]);}_0x312e3e[_0xa9b5('0x70')]=qs[_0xa9b5('0x4d')](_0xd0bbbe[_0xa9b5('0x47')][_0xa9b5('0x4d')]);_0x312e3e[_0xa9b5('0x51')]=qs['filters'](_[_0xa9b5('0x4f')](_0xd0bbbe['query'],_0x1fafc5['filters']));_0x312e3e[_0xa9b5('0x51')][_0xa9b5('0x66')]=_0x1358df['id'];if(_0xd0bbbe[_0xa9b5('0x47')][_0xa9b5('0x50')]){_0x312e3e['where']=_[_0xa9b5('0x5b')](_0x312e3e[_0xa9b5('0x51')],{'$or':_[_0xa9b5('0x44')](_0x312e3e['attributes'],function(_0x542e7b){var _0x3351d7={};_0x3351d7[_0x542e7b]={'$like':'%'+_0xd0bbbe[_0xa9b5('0x47')][_0xa9b5('0x50')]+'%'};return _0x3351d7;})});}_0x312e3e=_[_0xa9b5('0x5b')]({},_0x312e3e,_0xd0bbbe['options']);return db[_0xa9b5('0x6d')]['count']({'where':_0x312e3e[_0xa9b5('0x51')]})[_0xa9b5('0x26')](function(_0x3c67bf){_0x36d8cc[_0xa9b5('0x31')]=_0x3c67bf;if(_0xd0bbbe[_0xa9b5('0x47')][_0xa9b5('0x54')]){_0x312e3e[_0xa9b5('0x55')]=[{'all':!![]}];}return db[_0xa9b5('0x6d')][_0xa9b5('0x56')](_0x312e3e);})[_0xa9b5('0x26')](function(_0x3aa470){_0x36d8cc[_0xa9b5('0x57')]=_0x3aa470;return _0x36d8cc;});}})[_0xa9b5('0x26')](respondWithFilteredResult(_0x51b898,_0x312e3e))[_0xa9b5('0x58')](handleError(_0x51b898,null));};exports['removeAnswers']=function(_0x45eeab,_0x16ffbb,_0x41afd8){return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x45eeab[_0xa9b5('0x63')]['id']}})['then'](handleEntityNotFound(_0x16ffbb,null))['then'](function(_0x4b1ece){if(_0x4b1ece){return _0x4b1ece[_0xa9b5('0x71')](_0x45eeab[_0xa9b5('0x47')][_0xa9b5('0x6c')]);}})['then'](respondWithStatusCode(_0x16ffbb,null))[_0xa9b5('0x58')](handleError(_0x16ffbb,null));};exports[_0xa9b5('0x72')]=function(_0x55877c,_0x4bf436,_0x442b47){_0x55877c[_0xa9b5('0x5d')][_0xa9b5('0x73')]=_0x55877c[_0xa9b5('0x74')][_0xa9b5('0x75')];return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x55877c['params']['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x4bf436,null))['then'](saveUpdates(_0x55877c[_0xa9b5('0x5d')],null))[_0xa9b5('0x26')](respondWithResult(_0x4bf436,null))[_0xa9b5('0x58')](handleError(_0x4bf436,null));};exports['addAvatar']=function(_0x7b4a49,_0x520751,_0x1290e4){_0x7b4a49[_0xa9b5('0x5d')]['agentAvatar']=_0x7b4a49['file'][_0xa9b5('0x75')];return db[_0xa9b5('0x45')]['find']({'where':{'id':_0x7b4a49[_0xa9b5('0x63')]['id']}})['then'](handleEntityNotFound(_0x520751,null))[_0xa9b5('0x26')](saveUpdates(_0x7b4a49[_0xa9b5('0x5d')],null))[_0xa9b5('0x26')](respondWithResult(_0x520751,null))[_0xa9b5('0x58')](handleError(_0x520751,null));};exports[_0xa9b5('0x76')]=function(_0x5a9265,_0x5f1af8,_0x235b3a){_0x5a9265['body'][_0xa9b5('0x77')]=_0x5a9265[_0xa9b5('0x74')][_0xa9b5('0x75')];return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x5a9265[_0xa9b5('0x63')]['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x5f1af8,null))[_0xa9b5('0x26')](saveUpdates(_0x5a9265[_0xa9b5('0x5d')],null))[_0xa9b5('0x26')](respondWithResult(_0x5f1af8,null))[_0xa9b5('0x58')](handleError(_0x5f1af8,null));};exports[_0xa9b5('0x78')]=function(_0x1c8526,_0x1306f2,_0x3d05f5){_0x1c8526[_0xa9b5('0x5d')][_0xa9b5('0x79')]=_0x1c8526[_0xa9b5('0x74')][_0xa9b5('0x75')];return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x1c8526[_0xa9b5('0x63')]['id']}})['then'](handleEntityNotFound(_0x1306f2,null))[_0xa9b5('0x26')](saveUpdates(_0x1c8526[_0xa9b5('0x5d')],null))[_0xa9b5('0x26')](respondWithResult(_0x1306f2,null))[_0xa9b5('0x58')](handleError(_0x1306f2,null));};exports['getLogo']=function(_0x26dd33,_0x3a6cdf,_0x3a7e8e){var _0x13693e=path[_0xa9b5('0x7a')](config[_0xa9b5('0x7b')],_0xa9b5('0x7c'));var _0xabeba0={'where':{'id':_0x26dd33[_0xa9b5('0x63')]['id']},'attributes':['id',_0xa9b5('0x73')],'raw':!![]};var _0x216a43=![];return require('../../config/license/util')[_0xa9b5('0x7d')]()[_0xa9b5('0x26')](function(_0x561461){if(_0x561461){_0x216a43=_0x561461[_0xa9b5('0x7e')];}})[_0xa9b5('0x26')](function(){return db[_0xa9b5('0x45')][_0xa9b5('0x5c')](_0xabeba0);})[_0xa9b5('0x26')](handleEntityNotFound(_0x3a6cdf,null))['then'](function(_0x573625){if(_0x573625){if(!_[_0xa9b5('0x7f')](_0x573625[_0xa9b5('0x73')])){if(fs['existsSync'](path[_0xa9b5('0x7a')](config[_0xa9b5('0x7b')],_0xa9b5('0x80'),_0x573625[_0xa9b5('0x73')]))&&_0x216a43){_0x13693e=path['join'](config[_0xa9b5('0x7b')],_0xa9b5('0x80'),_0x573625[_0xa9b5('0x73')]);}}return _0x3a6cdf['download'](_0x13693e);}})[_0xa9b5('0x58')](handleError(_0x3a6cdf,null));};exports[_0xa9b5('0x81')]=function(_0x318953,_0x26bbed,_0x4d4468){var _0x18ff9c=path[_0xa9b5('0x7a')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x2f652c={'where':{'id':_0x318953[_0xa9b5('0x63')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0xa9b5('0x5c')](_0x2f652c)[_0xa9b5('0x26')](handleEntityNotFound(_0x26bbed,null))[_0xa9b5('0x26')](function(_0xf54410){if(_0xf54410){if(!_[_0xa9b5('0x7f')](_0xf54410['agentAvatar'])){if(fs['existsSync'](path[_0xa9b5('0x7a')](config[_0xa9b5('0x7b')],_0xa9b5('0x82'),_0xf54410[_0xa9b5('0x83')]))){_0x18ff9c=path[_0xa9b5('0x7a')](config[_0xa9b5('0x7b')],'server/files/images/avatars/',_0xf54410[_0xa9b5('0x83')]);}}return _0x26bbed['download'](_0x18ff9c);}})[_0xa9b5('0x58')](handleError(_0x26bbed,null));};exports['getCustomerAvatar']=function(_0x25c88d,_0x56fa4e,_0x45c731){var _0xefa046=path['join'](config[_0xa9b5('0x7b')],'server/files/images/avatars/customer_avatar.png');var _0x19a0ff={'where':{'id':_0x25c88d[_0xa9b5('0x63')]['id']},'attributes':['id',_0xa9b5('0x77'),_0xa9b5('0x84')],'raw':!![]};return db[_0xa9b5('0x45')][_0xa9b5('0x5c')](_0x19a0ff)[_0xa9b5('0x26')](handleEntityNotFound(_0x56fa4e,null))[_0xa9b5('0x26')](function(_0x12a93d){if(_0x12a93d){if(!_[_0xa9b5('0x7f')](_0x12a93d[_0xa9b5('0x77')])){if(fs['existsSync'](path[_0xa9b5('0x7a')](config[_0xa9b5('0x7b')],'server/files/images/avatars/',_0x12a93d[_0xa9b5('0x77')]))&&_0x12a93d[_0xa9b5('0x84')]){_0xefa046=path['join'](config[_0xa9b5('0x7b')],'server/files/images/avatars/',_0x12a93d[_0xa9b5('0x77')]);}}return _0x56fa4e['download'](_0xefa046);}})[_0xa9b5('0x58')](handleError(_0x56fa4e,null));};exports['getSystemAvatar']=function(_0x2708e1,_0x1f0ae5,_0x40cefc){var _0x2d293e=path[_0xa9b5('0x7a')](config[_0xa9b5('0x7b')],'server/files/images/avatars/system_avatar.png');var _0x414353={'where':{'id':_0x2708e1[_0xa9b5('0x63')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xa9b5('0x45')][_0xa9b5('0x5c')](_0x414353)[_0xa9b5('0x26')](handleEntityNotFound(_0x1f0ae5,null))[_0xa9b5('0x26')](function(_0x386f82){if(_0x386f82){if(!_[_0xa9b5('0x7f')](_0x386f82[_0xa9b5('0x79')])){if(fs[_0xa9b5('0x85')](path['join'](config['root'],_0xa9b5('0x82'),_0x386f82[_0xa9b5('0x79')]))){_0x2d293e=path[_0xa9b5('0x7a')](config[_0xa9b5('0x7b')],_0xa9b5('0x82'),_0x386f82[_0xa9b5('0x79')]);}}return _0x1f0ae5[_0xa9b5('0x86')](_0x2d293e);}})[_0xa9b5('0x58')](handleError(_0x1f0ae5,null));};exports[_0xa9b5('0x87')]=function(_0x2e9cd2,_0x4d2d5f,_0x4d22e6){var _0x654792=require(_0xa9b5('0x88'));var _0x5b26a4=new _0x654792();var _0x32160c=_0x5b26a4['setUA'](_0x2e9cd2[_0xa9b5('0x89')][_0xa9b5('0x8a')])[_0xa9b5('0x8b')]();var _0x350337={'body':_0x2e9cd2[_0xa9b5('0x5d')],'channel':'chat'};var _0x44d39c=[];var _0x348898=[];var _0x334745={};var _0x2d3df1=![];return db[_0xa9b5('0x8c')]['describe']()[_0xa9b5('0x26')](function(_0x4b42b7){if(!_0x4b42b7){throw new db[(_0xa9b5('0x22'))][(_0xa9b5('0x23'))](_0xa9b5('0x8d'));}_0x44d39c=_[_0xa9b5('0x8e')](_['keys'](_0x4b42b7),[_0xa9b5('0x8f'),_0xa9b5('0x90')]);_0x348898=_[_0xa9b5('0x8e')](_[_0xa9b5('0x48')](_0x4b42b7),['createdAt',_0xa9b5('0x90'),_0xa9b5('0x91'),_0xa9b5('0x92')]);if(_0x2e9cd2[_0xa9b5('0x5d')]['id']){delete _0x2e9cd2['body']['id'];}if(_[_0xa9b5('0x7f')](_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0x93')])){throw new db[(_0xa9b5('0x22'))]['ValidationError'](_0xa9b5('0x94'));}if(_['isNil'](_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0x5d')])||_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0x5d')]===''){throw new db[(_0xa9b5('0x22'))][(_0xa9b5('0x23'))](_0xa9b5('0x95'));}if(_[_0xa9b5('0x7f')](_0x2e9cd2['body'][_0xa9b5('0x96')])){throw new db[(_0xa9b5('0x22'))][(_0xa9b5('0x23'))](_0xa9b5('0x97')+_0x348898);}if(!_[_0xa9b5('0x98')](_0x348898,_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0x96')])){throw new db[(_0xa9b5('0x22'))][(_0xa9b5('0x23'))](_0xa9b5('0x99')+_0x348898);}_0x334745[_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0x96')]]=_0x2e9cd2[_0xa9b5('0x5d')]['from'];})['then'](function(){return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x2e9cd2['params']['id']},'include':[{'model':db[_0xa9b5('0x9a')],'as':_0xa9b5('0x9b'),'include':[{'model':db[_0xa9b5('0x8c')],'as':_0xa9b5('0x9c'),'where':_0x334745,'limit':0x1,'order':[[_0xa9b5('0x90'),'DESC']]}]},{'model':db[_0xa9b5('0x9d')],'as':'Applications'}]});})[_0xa9b5('0x26')](handleEntityNotFound(_0x4d2d5f,null))[_0xa9b5('0x26')](function(_0x5e6dec){if(_0x5e6dec&&_0x5e6dec[_0xa9b5('0x9b')]){_0x350337[_0xa9b5('0x9e')]=_0x5e6dec;_0x350337[_0xa9b5('0x9f')]=_0x5e6dec['Applications'];_0x350337[_0xa9b5('0xa0')]=_0x5e6dec[_0xa9b5('0x9b')];_0x350337[_0xa9b5('0x9f')]=_[_0xa9b5('0xa1')](_0x350337[_0xa9b5('0x9f')],[_0xa9b5('0xa2')],[_0xa9b5('0xa3')]);if(_0x350337['account'][_0xa9b5('0xa4')]){delete _0x350337[_0xa9b5('0x9e')]['Applications'];}if(_0x350337[_0xa9b5('0x9e')]['List']&&_0x350337[_0xa9b5('0x9e')][_0xa9b5('0x9b')][_0xa9b5('0x9c')][_0xa9b5('0x4c')]){return _0x350337[_0xa9b5('0x9e')][_0xa9b5('0x9b')][_0xa9b5('0x9c')][0x0];}var _0x727c6b=_[_0xa9b5('0x1a')](_0x2e9cd2[_0xa9b5('0x5d')],{'firstName':_0x2e9cd2[_0xa9b5('0x5d')]['from'],'ListId':_0x5e6dec[_0xa9b5('0x92')]});_0x727c6b[_0x2e9cd2['body']['mapKey']]=_0x2e9cd2[_0xa9b5('0x5d')]['from'];return db['CmContact']['create'](_0x727c6b,{'fields':_0x44d39c,'raw':!![]});}})[_0xa9b5('0x26')](handleEntityNotFound(_0x4d2d5f,null))[_0xa9b5('0x26')](function(_0x380f1a){_0x350337['contact']=_0x380f1a;var _0x2ccaae=_0x2e9cd2['body'][_0xa9b5('0xa5')];if(_0x2e9cd2['headers'][_0xa9b5('0xa6')]){_0x2ccaae=_0x2e9cd2[_0xa9b5('0x89')][_0xa9b5('0xa6')];}else if(_0x2e9cd2[_0xa9b5('0x89')]['x-forwarded-for']){_0x2ccaae=_[_0xa9b5('0xa7')](_0x2e9cd2['headers'][_0xa9b5('0xa8')][_0xa9b5('0xa9')](','));}if(_0x380f1a){var _0x12805e={'ContactId':_0x380f1a['id'],'ChatWebsiteId':_0x2e9cd2[_0xa9b5('0x63')]['id'],'from':(_0x380f1a[_0xa9b5('0xaa')]||'')+'\x20'+(_0x380f1a[_0xa9b5('0xab')]||''),'customerIp':_0x2ccaae,'customerPort':_0x2e9cd2[_0xa9b5('0x89')][_0xa9b5('0xac')]?_0x2e9cd2['headers'][_0xa9b5('0xac')]:null,'referer':_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0xad')],'browserName':_0x32160c[_0xa9b5('0xae')][_0xa9b5('0x3f')]&&_0x32160c[_0xa9b5('0xae')][_0xa9b5('0xaf')]?util[_0xa9b5('0xb0')](_0xa9b5('0xb1'),_0x32160c[_0xa9b5('0xae')][_0xa9b5('0x3f')],_0x32160c[_0xa9b5('0xae')]['version']):_0xa9b5('0xb2'),'browserVersion':_0x32160c[_0xa9b5('0xae')]['version']||'unknown','osName':util[_0xa9b5('0xb0')](_0xa9b5('0xb1'),_0x32160c['os'][_0xa9b5('0x3f')],_0x32160c['os']['version']),'osVersion':_0x32160c['os'][_0xa9b5('0xaf')],'deviceModel':_0x32160c[_0xa9b5('0xb3')][_0xa9b5('0x46')]&&_0x32160c['device'][_0xa9b5('0xb4')]?util[_0xa9b5('0xb0')](_0xa9b5('0xb5'),_0x32160c[_0xa9b5('0xb3')][_0xa9b5('0x46')],_0x32160c['device'][_0xa9b5('0xb4')],_0x32160c['device'][_0xa9b5('0xb6')]):null,'deviceVendor':_0x32160c[_0xa9b5('0xb3')][_0xa9b5('0xb4')],'deviceType':_0x32160c[_0xa9b5('0xb3')][_0xa9b5('0xb6')],'formData':JSON[_0xa9b5('0x2b')](_0x2e9cd2['body'])};var _0xa5ed78={'ChatWebsiteId':_0x2e9cd2['params']['id'],'closed':![]};if(_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0xb7')]){_0xa5ed78[_0xa9b5('0xb7')]=_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0xb7')];return db[_0xa9b5('0xb8')][_0xa9b5('0x5c')]({'where':_0xa5ed78})[_0xa9b5('0x26')](function(_0x451702){if(_0x451702){return[_0x451702,![]];}_0x12805e[_0xa9b5('0xb7')]=_0x2e9cd2[_0xa9b5('0x5d')]['threadId'];_0x12805e[_0xa9b5('0xb9')]=_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0xb9')];return db[_0xa9b5('0xb8')][_0xa9b5('0x6e')](_0x12805e)[_0xa9b5('0x26')](function(_0x5b9265){return[_0x5b9265,!![]];});});}_0xa5ed78[_0xa9b5('0xba')]=_0x380f1a['id'];if(_0x2e9cd2[_0xa9b5('0x5d')]['interaction']&&_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0xbb')]['id']){_0xa5ed78['id']=_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0xbb')]['id'];return db[_0xa9b5('0xb8')][_0xa9b5('0x5c')]({'where':_0xa5ed78})[_0xa9b5('0x26')](function(_0x303ce1){if(_0x303ce1){return[_0x303ce1,![]];}return db[_0xa9b5('0xb8')][_0xa9b5('0x6e')](_0x12805e)[_0xa9b5('0x26')](function(_0x4a2399){return[_0x4a2399,!![]];});});}return db[_0xa9b5('0xb8')][_0xa9b5('0x6e')](_0x12805e)[_0xa9b5('0x26')](function(_0x14d857){return[_0x14d857,!![]];});}})[_0xa9b5('0xbc')](function(_0x49a04f,_0x4ffbc8){if(_0x49a04f){_0x2d3df1=_0x4ffbc8;if(!_0x4ffbc8){var _0x203166={'from':(_0x350337[_0xa9b5('0xbd')]['firstName']||'')+'\x20'+(_0x350337[_0xa9b5('0xbd')][_0xa9b5('0xab')]||'')};if(_0x2e9cd2[_0xa9b5('0x5d')]['threadId']&&_0x2e9cd2['body'][_0xa9b5('0xbe')]&&_0x2e9cd2['body'][_0xa9b5('0xb7')]!=_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0xbe')]){_0x203166[_0xa9b5('0xb7')]=_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0xbe')];}return _0x49a04f['update'](_0x203166);}else{return _0x49a04f;}}})[_0xa9b5('0x26')](function(_0x3edbe9){_0x350337[_0xa9b5('0xbb')]=_0x3edbe9[_0xa9b5('0x3c')]({'plain':!![]});_0x350337[_0xa9b5('0xbb')][_0xa9b5('0xbf')]=_0x2d3df1;if(_0x350337[_0xa9b5('0xbb')]['created']){if(_0x350337[_0xa9b5('0x9e')][_0xa9b5('0xc0')]){_0x350337[_0xa9b5('0x9f')][_0xa9b5('0xc1')]({'id':0x0,'priority':_0x350337[_0xa9b5('0x9f')]['length']+0x1,'app':_0xa9b5('0xc2'),'appdata':_0xa9b5('0xc3'),'interval':'*,*,*,*'});}}return db[_0xa9b5('0xc4')]['create']({'body':_0x2e9cd2[_0xa9b5('0x5d')][_0xa9b5('0x5d')],'ChatWebsiteId':_0x2e9cd2[_0xa9b5('0x63')]['id'],'ChatInteractionId':_0x3edbe9['id'],'direction':'in','ContactId':_0x350337[_0xa9b5('0xbd')]['id'],'AttachmentId':_0x2e9cd2[_0xa9b5('0x5d')]['AttachmentId']});})[_0xa9b5('0x26')](function(_0x51c5dd){_0x350337[_0xa9b5('0x2d')]=_0x51c5dd;if(_0x350337[_0xa9b5('0xbb')][_0xa9b5('0xc5')]){return db[_0xa9b5('0xc6')][_0xa9b5('0x5c')]({'attributes':['id',_0xa9b5('0x3f')],'where':{'id':_0x350337['interaction'][_0xa9b5('0xc5')]}})[_0xa9b5('0x26')](function(_0x22488c){if(_0x22488c){_0x350337[_0xa9b5('0x9f')][_0xa9b5('0xc7')]({'id':0x0,'priority':0x0,'app':_0xa9b5('0xc8'),'appdata':_0x22488c[_0xa9b5('0x3f')]+','+(_0x350337[_0xa9b5('0x9e')][_0xa9b5('0xc9')]||0xa),'interval':'*,*,*,*'});_0x350337[_0xa9b5('0xca')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x350337);});}return respondWithRpcPromise('Start',_0xa9b5('0xcb'),_0x350337);})[_0xa9b5('0x26')](function(_0x4f4621){respondWithRpcPromise(_0xa9b5('0xcc'),_0xa9b5('0xcc'),{'event':_0xa9b5('0x87'),'message':_0x4f4621},client9002);return _0x4f4621;})[_0xa9b5('0x26')](respondWithResult(_0x4d2d5f,null))[_0xa9b5('0x58')](handleError(_0x4d2d5f,null));};exports['offline']=function(_0x25c86e,_0x190784,_0x3c8da4){var _0x519b0c,_0x2ef4fc,_0x2f77d4;var _0x50ac23=[];var _0x47cf68=[];var _0x2ac0f6={};return db[_0xa9b5('0x8c')]['describe']()['then'](function(_0x27a43b){if(!_0x27a43b){throw new db[(_0xa9b5('0x22'))]['ValidationError'](_0xa9b5('0x8d'));}_0x47cf68=_['difference'](_['keys'](_0x27a43b),[_0xa9b5('0x8f'),_0xa9b5('0x90')]);_0x50ac23=_[_0xa9b5('0x8e')](_[_0xa9b5('0x48')](_0x27a43b),[_0xa9b5('0x8f'),_0xa9b5('0x90'),_0xa9b5('0x91'),_0xa9b5('0x92')]);if(_0x25c86e[_0xa9b5('0x5d')]['id']){delete _0x25c86e['body']['id'];}if(_['isNil'](_0x25c86e[_0xa9b5('0x5d')][_0xa9b5('0x93')])){throw _0x190784[_0xa9b5('0x2f')](0x1f4)[_0xa9b5('0x40')](new db['Sequelize'][(_0xa9b5('0x23'))](_0xa9b5('0x94')));}if(_[_0xa9b5('0x7f')](_0x25c86e[_0xa9b5('0x5d')]['body'])||_0x25c86e[_0xa9b5('0x5d')][_0xa9b5('0x5d')]===''){throw _0x190784[_0xa9b5('0x2f')](0x1f4)[_0xa9b5('0x40')](new db[(_0xa9b5('0x22'))][(_0xa9b5('0x23'))](_0xa9b5('0x95')));}if(_[_0xa9b5('0x7f')](_0x25c86e[_0xa9b5('0x5d')][_0xa9b5('0xcd')])){throw _0x190784[_0xa9b5('0x2f')](0x1f4)['send'](new db[(_0xa9b5('0x22'))][(_0xa9b5('0x23'))](_0xa9b5('0xce')+_0x50ac23));}if(!_[_0xa9b5('0x98')](_0x50ac23,_0x25c86e[_0xa9b5('0x5d')]['mapKeyOffline'])){throw _0x190784[_0xa9b5('0x2f')](0x1f4)[_0xa9b5('0x40')](new db[(_0xa9b5('0x22'))][(_0xa9b5('0x23'))](_0xa9b5('0xcf')+_0x50ac23));}_0x2ac0f6[_0x25c86e[_0xa9b5('0x5d')][_0xa9b5('0xcd')]]=_0x25c86e[_0xa9b5('0x5d')]['from'];})['then'](function(){return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x25c86e[_0xa9b5('0x63')]['id']},'include':[{'model':db[_0xa9b5('0x9a')],'as':_0xa9b5('0x9b')}]});})['then'](handleEntityNotFound(_0x190784,null))['then'](function(_0x24f618){if(_0x24f618&&_0x24f618['List']){_0x2ef4fc=_0x24f618;var _0x19a676=_[_0xa9b5('0x1a')](_0x25c86e[_0xa9b5('0x5d')],{'firstName':_0x25c86e[_0xa9b5('0x5d')][_0xa9b5('0x93')],'phone':_0x25c86e[_0xa9b5('0x5d')]['from'],'ListId':_0x24f618[_0xa9b5('0x92')]});_0x19a676[_0x25c86e['body'][_0xa9b5('0xcd')]]=_0x25c86e[_0xa9b5('0x5d')][_0xa9b5('0x93')];return db[_0xa9b5('0x8c')][_0xa9b5('0xd0')]({'where':_0x2ac0f6,'defaults':_0x19a676});}})[_0xa9b5('0xbc')](function(_0x44b416){if(_0x44b416){_0x2f77d4=_0x44b416;var _0x1b1353=fs[_0xa9b5('0xd1')](path['join'](config['root'],_0xa9b5('0xd2')),_0xa9b5('0xd3'));var _0x3daa36=ejs[_0xa9b5('0xd4')](_0x1b1353,{'body':_['toPairs'](_0x25c86e[_0xa9b5('0x5d')][_0xa9b5('0x5d')]),'bodyTitle':_0x2ef4fc[_0xa9b5('0xd5')]});return db[_0xa9b5('0xd6')][_0xa9b5('0x6e')]({'body':_0x3daa36,'ContactId':_0x44b416['id'],'ChatWebsiteId':_0x2ef4fc['id']});}})['then'](function(_0x3c6193){if(_0x3c6193){_0x519b0c=_0x3c6193;return db['MailAccount'][_0xa9b5('0x6f')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xa9b5('0xd7'),'raw':!![]}]});}})[_0xa9b5('0x26')](function(_0x3720b4){if(_0x3720b4&&_0x3720b4[_0xa9b5('0xd7')]&&_0x2ef4fc[_0xa9b5('0xd8')]){var _0x290b3e={'tls':{'rejectUnauthorized':![]}};if(_0x3720b4[_0xa9b5('0xd7')][_0xa9b5('0xd9')]){_0x290b3e[_0xa9b5('0xd9')]=_0x3720b4[_0xa9b5('0xd7')][_0xa9b5('0xd9')];}else{_0x290b3e[_0xa9b5('0xda')]=_0x3720b4[_0xa9b5('0xd7')][_0xa9b5('0xda')];_0x290b3e['port']=_0x3720b4[_0xa9b5('0xd7')]['port'];_0x290b3e['secure']=_0x3720b4[_0xa9b5('0xd7')][_0xa9b5('0xdb')];}if(_0x3720b4[_0xa9b5('0xd7')]['authentication']){_0x290b3e[_0xa9b5('0xdc')]={'user':_0x3720b4[_0xa9b5('0xd7')]['user'],'pass':_0x3720b4[_0xa9b5('0xd7')]['pass']};}return respondWithRpcPromise('SendMail',_0xa9b5('0xdd'),{'account':_0x290b3e,'message':{'from':util['format'](_0xa9b5('0xde'),_0x3720b4[_0xa9b5('0x3f')],_0x3720b4[_0xa9b5('0xdf')]||_0x3720b4['Smtp'][_0xa9b5('0x5e')]),'to':_0x2ef4fc[_0xa9b5('0xd8')],'subject':_0x2ef4fc['offlineMessageSubject'],'text':_0x519b0c[_0xa9b5('0x5d')]}},client9003)[_0xa9b5('0x26')](function(){return _0x519b0c;})[_0xa9b5('0x58')](function(_0x9c5962){console[_0xa9b5('0x2c')](_0x9c5962);});}})[_0xa9b5('0x26')](function(){if(_0x519b0c){return _0x519b0c;}})['then'](respondWithResult(_0x190784,null))[_0xa9b5('0x58')](handleError(_0x190784,null));};exports[_0xa9b5('0xe0')]=function(_0x29f1bd,_0x5c41be,_0x4024c6){return db[_0xa9b5('0xb8')][_0xa9b5('0x5c')]({'where':{'id':_0x29f1bd['params']['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x5c41be,null))[_0xa9b5('0x26')](function(_0x432e80){if(_0x432e80){return _0x432e80[_0xa9b5('0xe0')](_0x29f1bd[_0xa9b5('0x5d')][_0xa9b5('0x6c')],_[_0xa9b5('0xe1')](_0x29f1bd[_0xa9b5('0x5d')],[_0xa9b5('0x6c'),'id'])||{});}})[_0xa9b5('0x26')](respondWithResult(_0x5c41be,null))['catch'](handleError(_0x5c41be,null));};exports[_0xa9b5('0xe2')]=function(_0x2527e6,_0x386234,_0x183184){var _0xd7d2a5={'raw':![],'where':{}};var _0x3eb162={};var _0x5f0594={'count':0x0,'rows':[]};return db[_0xa9b5('0x45')][_0xa9b5('0x6f')]({'where':{'id':_0x2527e6[_0xa9b5('0x63')]['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x386234,null))[_0xa9b5('0x26')](function(_0x2172fb){if(_0x2172fb){_0x3eb162[_0xa9b5('0x46')]=_[_0xa9b5('0x48')](db['ChatInteraction'][_0xa9b5('0x5a')]);_0x3eb162['query']=_['keys'](_0x2527e6[_0xa9b5('0x47')]);_0x3eb162[_0xa9b5('0x4e')]=_[_0xa9b5('0x49')](_0x3eb162[_0xa9b5('0x46')],_0x3eb162[_0xa9b5('0x47')]);_0xd7d2a5['attributes']=_[_0xa9b5('0x49')](_0x3eb162['model'],qs[_0xa9b5('0x4b')](_0x2527e6[_0xa9b5('0x47')]['fields']));_0xd7d2a5[_0xa9b5('0x4a')]=_0xd7d2a5[_0xa9b5('0x4a')][_0xa9b5('0x4c')]?_0xd7d2a5[_0xa9b5('0x4a')]:_0x3eb162[_0xa9b5('0x46')];if(!_0x2527e6[_0xa9b5('0x47')][_0xa9b5('0x69')](_0xa9b5('0x6a'))){_0xd7d2a5['limit']=qs[_0xa9b5('0x33')](_0x2527e6[_0xa9b5('0x47')][_0xa9b5('0x33')]);_0xd7d2a5[_0xa9b5('0x32')]=qs['offset'](_0x2527e6[_0xa9b5('0x47')]['offset']);}_0xd7d2a5['order']=qs[_0xa9b5('0x4d')](_0x2527e6[_0xa9b5('0x47')][_0xa9b5('0x4d')]);_0xd7d2a5['where']=qs[_0xa9b5('0x4e')](_['pick'](_0x2527e6[_0xa9b5('0x47')],_0x3eb162[_0xa9b5('0x4e')]));_0xd7d2a5[_0xa9b5('0x51')]['ChatWebsiteId']=_0x2172fb['id'];if(_0x2527e6[_0xa9b5('0x47')][_0xa9b5('0x50')]){_0xd7d2a5[_0xa9b5('0x51')]=_[_0xa9b5('0x5b')](_0xd7d2a5[_0xa9b5('0x51')],{'$or':_['map'](_0xd7d2a5[_0xa9b5('0x4a')],function(_0x50eb5e){var _0xda8486={};_0xda8486[_0x50eb5e]={'$like':'%'+_0x2527e6['query'][_0xa9b5('0x50')]+'%'};return _0xda8486;})});}_0xd7d2a5=_[_0xa9b5('0x5b')]({},_0xd7d2a5,_0x2527e6[_0xa9b5('0x53')]);return db[_0xa9b5('0xb8')][_0xa9b5('0x31')]({'where':_0xd7d2a5[_0xa9b5('0x51')]})[_0xa9b5('0x26')](function(_0x30d261){_0x5f0594[_0xa9b5('0x31')]=_0x30d261;if(_0x2527e6[_0xa9b5('0x47')][_0xa9b5('0x54')]){_0xd7d2a5[_0xa9b5('0x55')]=[{'model':db[_0xa9b5('0x8c')],'as':'Contact','required':![]},{'model':db[_0xa9b5('0xc6')],'as':_0xa9b5('0xe3'),'attributes':['name',_0xa9b5('0xe4'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xa9b5('0xe5'),'attributes':['id',_0xa9b5('0x3f'),_0xa9b5('0xe6')],'where':_0x2527e6[_0xa9b5('0x47')][_0xa9b5('0xe7')]?{'id':_0x2527e6['query']['tag']}:undefined,'required':_0x2527e6['query'][_0xa9b5('0xe7')]?!![]:![]}];}return db[_0xa9b5('0xb8')][_0xa9b5('0x56')](_0xd7d2a5);})['then'](function(_0x4a72dd){_0x5f0594[_0xa9b5('0x57')]=_0x4a72dd;return _0x5f0594;});}})[_0xa9b5('0x26')](respondWithFilteredResult(_0x386234,_0xd7d2a5))['catch'](handleError(_0x386234,null));};function iftimePromise(_0x495718,_0x575855){return respondWithRpcPromise(_0xa9b5('0xe8'),_0xa9b5('0xe9'),{'command':_0x575855[_0xa9b5('0xea')]?util[_0xa9b5('0xb0')](_0xa9b5('0xeb'),_0x495718[_0xa9b5('0xec')],_0x575855[_0xa9b5('0xea')]):util[_0xa9b5('0xb0')](_0xa9b5('0xed'),_0x495718[_0xa9b5('0xec')])},client9002)[_0xa9b5('0x26')](function(_0x59c20f){var _0x3682b1=_0x59c20f&&_0x59c20f['indexOf'](_0xa9b5('0xee'))>=0x0?!![]:![];logger[_0xa9b5('0x27')](_0xa9b5('0xef'),_0x575855['id'],_0x495718['id'],_0x495718[_0xa9b5('0xec')],_0x3682b1?_0xa9b5('0xf0'):_0xa9b5('0xf1'),_0x575855[_0xa9b5('0xea')]?_0x575855[_0xa9b5('0xea')]:_0xa9b5('0xf2'));return _0x3682b1;})[_0xa9b5('0x58')](function(_0x4ab411){logger[_0xa9b5('0x2c')](_0xa9b5('0xef'),_0x575855['id'],_0x495718['id'],_0x495718[_0xa9b5('0xec')],util['inspect'](_0x4ab411,{'showHidden':![],'depth':null}),_0x575855['timezone']?_0x575855['timezone']:_0xa9b5('0xf2'));return![];});}exports[_0xa9b5('0xe9')]=function(_0x516682,_0x1ed937,_0x4964d2){var _0x48ea4b=0x0;var _0x47451b=0x0;var _0x21329f=![];var _0x48db60;var _0x4adcbd;return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x516682[_0xa9b5('0x63')]['id']},'include':[{'model':db['Interval'],'as':_0xa9b5('0xf3'),'include':[{'model':db[_0xa9b5('0xf3')],'as':'Intervals','attributes':['id',_0xa9b5('0xec')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1ed937,null))[_0xa9b5('0x26')](function(_0x3d2bbd){if(_0x3d2bbd){_0x48db60=_0x3d2bbd;return _0x3d2bbd[_0xa9b5('0xf4')]({'raw':!![]});}})[_0xa9b5('0x26')](function(_0x370491){if(_0x48db60){if(_0x370491){_0x4adcbd=_0x370491;}}return require(_0xa9b5('0xf5'))[_0xa9b5('0x7d')]();})['then'](function(_0x404e22){if(_0x404e22){_0x47451b=_0x404e22['virtual'];_0x21329f=_0x404e22[_0xa9b5('0x7e')];}})['then'](function(){return db[_0xa9b5('0xb8')][_0xa9b5('0x31')]({'where':{'closed':![]}});})[_0xa9b5('0x26')](function(_0x25cf22){_0x48ea4b=_0x25cf22;if(_0x47451b&&_0x25cf22>_0x47451b){return db['License'][_0xa9b5('0x6f')]({'where':{'id':0x1}})[_0xa9b5('0x26')](function(_0x4134e9){if(_0x4134e9){_0x4134e9['increment'](_0xa9b5('0xf6'));}});}})[_0xa9b5('0x26')](function(){if(_0x48db60[_0xa9b5('0xf3')]&&_0x48db60[_0xa9b5('0xf3')][_0xa9b5('0xf7')]){var _0xadb2f=[];for(var _0x15f702=0x0;_0x15f702<_0x48db60[_0xa9b5('0xf3')][_0xa9b5('0xf7')][_0xa9b5('0x4c')];_0x15f702++){var _0x41c4c9=_0x48db60[_0xa9b5('0xf3')][_0xa9b5('0xf7')][_0x15f702][_0xa9b5('0x3c')]({'plain':!![]});_0xadb2f[_0xa9b5('0xc1')](iftimePromise(_0x41c4c9,_0x48db60));}return BPromise[_0xa9b5('0xf8')](_0xadb2f)['then'](function(_0x28f8be){return _[_0xa9b5('0xf9')](_0x28f8be);});}else{return!![];}})[_0xa9b5('0x26')](function(_0x3d51e8){var _0x1152d9=fs[_0xa9b5('0xd1')](path[_0xa9b5('0x7a')](config[_0xa9b5('0x7b')],_0xa9b5('0xfa')),_0xa9b5('0xd3'));var _0x3d8a42={'remote':_0x48db60['remote'],'query':querystring[_0xa9b5('0x2b')](_['merge'](_0x48db60[_0xa9b5('0x3c')]({'plain':!![]}),{'customerIp':_0x516682[_0xa9b5('0x89')][_0xa9b5('0xa8')]||_0x516682[_0xa9b5('0x89')]['x-real-ip']||_0x516682['connection'][_0xa9b5('0xfb')]||_0x516682['ip'],'referer':_0x516682[_0xa9b5('0x89')][_0xa9b5('0xad')],'openedInteractions':_0x48ea4b,'maxInteractions':_0x47451b,'virtual':_0x21329f[_0xa9b5('0xfc')],'online':_0x3d51e8,'custom':_0x21329f}))['replace'](/'/g,'\x5c\x27')};_0x1ed937[_0xa9b5('0x40')](ejs['render'](Mustache[_0xa9b5('0xd4')](_0x1152d9,_0x3d8a42),{'proactiveActions':_0x4adcbd,'alignment':_0x48db60[_0xa9b5('0xfd')],'verticalAlignment':_0x48db60['verticalAlignment'],'div_color':_0x48db60['color'],'text_color':_0x48db60['textColor']}));})[_0xa9b5('0x58')](handleError(_0x1ed937,null));};exports[_0xa9b5('0xfe')]=function(_0x5c6d7c,_0x57ddd8,_0x55a5a1){return db['ChatWebsite'][_0xa9b5('0x6f')]({'where':{'id':_0x5c6d7c[_0xa9b5('0x63')]['id']}})['then'](handleEntityNotFound(_0x57ddd8,null))[_0xa9b5('0x26')](function(_0x249ef2){if(_0x249ef2){return db['sequelize']['transaction'](function(_0x40ddf1){return db[_0xa9b5('0x9d')][_0xa9b5('0x3b')]({'where':{'ChatWebsiteId':_0x5c6d7c['params']['id']},'transaction':_0x40ddf1})[_0xa9b5('0x26')](function(_0x3aef1d){var _0x3fc7f5=_[_0xa9b5('0x44')](_0x5c6d7c['body'],function(_0x32b61c){_0x32b61c['ChatWebsiteId']=_0x5c6d7c[_0xa9b5('0x63')]['id'];return _0x32b61c;});return db['ChatApplication'][_0xa9b5('0xff')](_0x3fc7f5,{'transaction':_0x40ddf1});});})[_0xa9b5('0x26')](function(){return db[_0xa9b5('0x9d')][_0xa9b5('0x100')]({'where':{'ChatWebsiteId':_0x5c6d7c[_0xa9b5('0x63')]['id']},'order':_0xa9b5('0xa2')});});}})[_0xa9b5('0x26')](respondWithResult(_0x57ddd8,null))['catch'](handleError(_0x57ddd8,null));};exports[_0xa9b5('0x101')]=function(_0x578de8,_0x459f29,_0xd7faf8){var _0x3c0ee1={};var _0x47edfe={};var _0x27c7f2;var _0x3dbc39;return db[_0xa9b5('0x45')][_0xa9b5('0x6f')]({'where':{'id':_0x578de8[_0xa9b5('0x63')]['id']}})['then'](handleEntityNotFound(_0x459f29,null))[_0xa9b5('0x26')](function(_0x4380a4){if(_0x4380a4){_0x27c7f2=_0x4380a4;_0x47edfe[_0xa9b5('0x46')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x47edfe[_0xa9b5('0x47')]=_[_0xa9b5('0x48')](_0x578de8[_0xa9b5('0x47')]);_0x47edfe[_0xa9b5('0x4e')]=_[_0xa9b5('0x49')](_0x47edfe[_0xa9b5('0x46')],_0x47edfe[_0xa9b5('0x47')]);_0x3c0ee1[_0xa9b5('0x4a')]=_[_0xa9b5('0x49')](_0x47edfe['model'],qs[_0xa9b5('0x4b')](_0x578de8[_0xa9b5('0x47')][_0xa9b5('0x4b')]));_0x3c0ee1[_0xa9b5('0x4a')]=_0x3c0ee1[_0xa9b5('0x4a')][_0xa9b5('0x4c')]?_0x3c0ee1[_0xa9b5('0x4a')]:_0x47edfe[_0xa9b5('0x46')];_0x3c0ee1[_0xa9b5('0x70')]=qs[_0xa9b5('0x4d')](_0x578de8['query'][_0xa9b5('0x4d')]);_0x3c0ee1[_0xa9b5('0x51')]=qs['filters'](_['pick'](_0x578de8[_0xa9b5('0x47')],_0x47edfe[_0xa9b5('0x4e')]));if(_0x578de8['query'][_0xa9b5('0x50')]){_0x3c0ee1['where']=_[_0xa9b5('0x5b')](_0x3c0ee1[_0xa9b5('0x51')],{'$or':_['map'](_0x3c0ee1[_0xa9b5('0x4a')],function(_0x11988d){var _0x5721a3={};_0x5721a3[_0x11988d]={'$like':'%'+_0x578de8[_0xa9b5('0x47')][_0xa9b5('0x50')]+'%'};return _0x5721a3;})});}_0x3c0ee1=_[_0xa9b5('0x5b')]({},_0x3c0ee1,_0x578de8[_0xa9b5('0x53')]);return _0x27c7f2['getApplications'](_0x3c0ee1);}})[_0xa9b5('0x26')](function(_0x25e5ed){if(_0x25e5ed){_0x3dbc39=_0x25e5ed[_0xa9b5('0x4c')];if(!_0x578de8[_0xa9b5('0x47')][_0xa9b5('0x69')](_0xa9b5('0x6a'))){_0x3c0ee1['limit']=qs[_0xa9b5('0x33')](_0x578de8[_0xa9b5('0x47')]['limit']);_0x3c0ee1[_0xa9b5('0x32')]=qs[_0xa9b5('0x32')](_0x578de8['query'][_0xa9b5('0x32')]);}return _0x27c7f2[_0xa9b5('0x101')](_0x3c0ee1);}})[_0xa9b5('0x26')](function(_0x1f4edb){if(_0x1f4edb){return _0x1f4edb?{'count':_0x3dbc39,'rows':_0x1f4edb}:null;}})[_0xa9b5('0x26')](respondWithResult(_0x459f29,null))[_0xa9b5('0x58')](handleError(_0x459f29,null));};exports['addProactiveActions']=function(_0xb897a8,_0x402188,_0x5c23bf){return db[_0xa9b5('0x102')][_0xa9b5('0x5c')]({'where':{'id':_0xb897a8[_0xa9b5('0x63')]['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x402188,null))[_0xa9b5('0x26')](function(_0x9d65bf){if(_0x9d65bf){return _0x9d65bf[_0xa9b5('0x103')](_0xb897a8['body'][_0xa9b5('0x6c')],_['omit'](_0xb897a8[_0xa9b5('0x5d')],[_0xa9b5('0x6c'),'id'])||{});}})[_0xa9b5('0x26')](respondWithResult(_0x402188,null))['catch'](handleError(_0x402188,null));};exports[_0xa9b5('0xf4')]=function(_0x4f6cd9,_0x334d40,_0x3ca37d){var _0x11589e={};var _0x36be17={};var _0x5c6930;var _0x549214;return db[_0xa9b5('0x45')][_0xa9b5('0x6f')]({'where':{'id':_0x4f6cd9[_0xa9b5('0x63')]['id']}})['then'](handleEntityNotFound(_0x334d40,null))[_0xa9b5('0x26')](function(_0x7cb6c6){if(_0x7cb6c6){_0x5c6930=_0x7cb6c6;_0x36be17[_0xa9b5('0x46')]=_[_0xa9b5('0x48')](db[_0xa9b5('0x104')]['rawAttributes']);_0x36be17['query']=_[_0xa9b5('0x48')](_0x4f6cd9['query']);_0x36be17[_0xa9b5('0x4e')]=_[_0xa9b5('0x49')](_0x36be17['model'],_0x36be17[_0xa9b5('0x47')]);_0x11589e[_0xa9b5('0x4a')]=_['intersection'](_0x36be17['model'],qs['fields'](_0x4f6cd9['query']['fields']));_0x11589e[_0xa9b5('0x4a')]=_0x11589e[_0xa9b5('0x4a')]['length']?_0x11589e['attributes']:_0x36be17[_0xa9b5('0x46')];_0x11589e[_0xa9b5('0x70')]=qs[_0xa9b5('0x4d')](_0x4f6cd9[_0xa9b5('0x47')]['sort']);_0x11589e[_0xa9b5('0x51')]=qs[_0xa9b5('0x4e')](_[_0xa9b5('0x4f')](_0x4f6cd9[_0xa9b5('0x47')],_0x36be17['filters']));if(_0x4f6cd9[_0xa9b5('0x47')][_0xa9b5('0x50')]){_0x11589e[_0xa9b5('0x51')]=_[_0xa9b5('0x5b')](_0x11589e[_0xa9b5('0x51')],{'$or':_[_0xa9b5('0x44')](_0x11589e[_0xa9b5('0x4a')],function(_0xae35ca){var _0x112207={};_0x112207[_0xae35ca]={'$like':'%'+_0x4f6cd9['query'][_0xa9b5('0x50')]+'%'};return _0x112207;})});}_0x11589e=_[_0xa9b5('0x5b')]({},_0x11589e,_0x4f6cd9[_0xa9b5('0x53')]);return _0x5c6930[_0xa9b5('0xf4')](_0x11589e);}})[_0xa9b5('0x26')](function(_0xab9734){if(_0xab9734){_0x549214=_0xab9734['length'];if(!_0x4f6cd9[_0xa9b5('0x47')][_0xa9b5('0x69')](_0xa9b5('0x6a'))){_0x11589e[_0xa9b5('0x33')]=qs['limit'](_0x4f6cd9[_0xa9b5('0x47')][_0xa9b5('0x33')]);_0x11589e[_0xa9b5('0x32')]=qs[_0xa9b5('0x32')](_0x4f6cd9['query'][_0xa9b5('0x32')]);}return _0x5c6930[_0xa9b5('0xf4')](_0x11589e);}})[_0xa9b5('0x26')](function(_0x18a212){if(_0x18a212){return _0x18a212?{'count':_0x549214,'rows':_0x18a212}:null;}})[_0xa9b5('0x26')](respondWithResult(_0x334d40,null))[_0xa9b5('0x58')](handleError(_0x334d40,null));};exports[_0xa9b5('0x105')]=function(_0x584a1d,_0x5e4678,_0x98f34){var _0xd62344=_0x584a1d[_0xa9b5('0x47')][_0xa9b5('0x106')]===_0xa9b5('0x107')?'offlineForm':_0xa9b5('0x108');return db[_0xa9b5('0x45')]['find']({'attributes':['id',_0xd62344],'where':{'id':_0x584a1d['params']['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x5e4678,null))[_0xa9b5('0x26')](function(_0x78fcda){if(_0x78fcda){var _0x2768d6=_0x78fcda[_0xd62344];var _0x4a0baf=_0x2768d6&&_0x2768d6[_0xa9b5('0x109')]?_0x2768d6['items']:[];_0x5e4678[_0xa9b5('0x40')]({'fromKey':_[_0xa9b5('0x7f')](_0x2768d6[_0xa9b5('0x10a')])?undefined:_0x2768d6[_0xa9b5('0x10a')],'count':_0x4a0baf[_0xa9b5('0x4c')],'rows':_0x4a0baf});}})[_0xa9b5('0x58')](handleError(_0x5e4678,null));};exports[_0xa9b5('0x10b')]=function(_0x296725,_0xf1d5f0,_0xe61805){var _0x2988a0={'raw':![],'where':{}};var _0x22d0d4={};var _0x436a0e={'count':0x0,'rows':[]};return db[_0xa9b5('0x45')][_0xa9b5('0x6f')]({'where':{'id':_0x296725[_0xa9b5('0x63')]['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0xf1d5f0,null))['then'](function(_0x32cac3){if(_0x32cac3){_0x22d0d4[_0xa9b5('0x46')]=_[_0xa9b5('0x48')](db[_0xa9b5('0xd6')][_0xa9b5('0x5a')]);_0x22d0d4['query']=_[_0xa9b5('0x48')](_0x296725['query']);_0x22d0d4[_0xa9b5('0x4e')]=_[_0xa9b5('0x49')](_0x22d0d4[_0xa9b5('0x46')],_0x22d0d4[_0xa9b5('0x47')]);_0x2988a0[_0xa9b5('0x4a')]=_[_0xa9b5('0x49')](_0x22d0d4['model'],qs['fields'](_0x296725['query']['fields']));_0x2988a0[_0xa9b5('0x4a')]=_0x2988a0[_0xa9b5('0x4a')][_0xa9b5('0x4c')]?_0x2988a0[_0xa9b5('0x4a')]:_0x22d0d4[_0xa9b5('0x46')];if(!_0x296725['query']['hasOwnProperty'](_0xa9b5('0x6a'))){_0x2988a0['limit']=qs[_0xa9b5('0x33')](_0x296725[_0xa9b5('0x47')][_0xa9b5('0x33')]);_0x2988a0[_0xa9b5('0x32')]=qs[_0xa9b5('0x32')](_0x296725['query']['offset']);}_0x2988a0[_0xa9b5('0x70')]=qs[_0xa9b5('0x4d')](_0x296725[_0xa9b5('0x47')][_0xa9b5('0x4d')]);_0x2988a0[_0xa9b5('0x51')]=qs[_0xa9b5('0x4e')](_[_0xa9b5('0x4f')](_0x296725[_0xa9b5('0x47')],_0x22d0d4[_0xa9b5('0x4e')]));_0x2988a0['where'][_0xa9b5('0x66')]=_0x32cac3['id'];if(_0x296725[_0xa9b5('0x47')][_0xa9b5('0x50')]){_0x2988a0[_0xa9b5('0x51')]=_[_0xa9b5('0x5b')](_0x2988a0['where'],{'$or':_[_0xa9b5('0x44')](_0x2988a0[_0xa9b5('0x4a')],function(_0x4f9348){var _0x2cec1c={};_0x2cec1c[_0x4f9348]={'$like':'%'+_0x296725[_0xa9b5('0x47')]['filter']+'%'};return _0x2cec1c;})});}_0x2988a0=_[_0xa9b5('0x5b')]({},_0x2988a0,_0x296725[_0xa9b5('0x53')]);return db[_0xa9b5('0xd6')][_0xa9b5('0x31')]({'where':_0x2988a0[_0xa9b5('0x51')]})[_0xa9b5('0x26')](function(_0x58f96f){_0x436a0e[_0xa9b5('0x31')]=_0x58f96f;if(_0x296725[_0xa9b5('0x47')][_0xa9b5('0x54')]){_0x2988a0[_0xa9b5('0x55')]=[{'all':!![]}];}else{_0x2988a0[_0xa9b5('0x55')]=[{'model':db['CmContact'],'as':_0xa9b5('0x10c'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x2988a0);})[_0xa9b5('0x26')](function(_0x28f012){_0x436a0e[_0xa9b5('0x57')]=_0x28f012;return _0x436a0e;});}})[_0xa9b5('0x26')](respondWithFilteredResult(_0xf1d5f0,_0x2988a0))[_0xa9b5('0x58')](handleError(_0xf1d5f0,null));};exports[_0xa9b5('0x10d')]=function(_0xb408b9,_0xec5e46,_0x2cbd8f){return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0xb408b9[_0xa9b5('0x63')]['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0xec5e46,null))[_0xa9b5('0x26')](function(_0x50b64a){if(_0x50b64a){return _0x50b64a['addAgents'](_0xb408b9[_0xa9b5('0x5d')][_0xa9b5('0x6c')],_[_0xa9b5('0xe1')](_0xb408b9['body'],[_0xa9b5('0x6c'),'id'])||{})[_0xa9b5('0xbc')](function(_0xa7af2a){for(var _0xb40650=0x0;_0xb40650<_0xb408b9['body'][_0xa9b5('0x6c')][_0xa9b5('0x4c')];_0xb40650+=0x1){socket['emit']('userChatWebsite:save',{'UserId':_0xb408b9[_0xa9b5('0x5d')]['ids'][_0xb40650],'ChatWebsiteId':_0xb408b9['params']['id']});}return _0xa7af2a;});}})[_0xa9b5('0x26')](respondWithResult(_0xec5e46,null))[_0xa9b5('0x58')](handleError(_0xec5e46,null));};exports[_0xa9b5('0x10e')]=function(_0x3915fb,_0x31917f,_0x2b1b1b){return db[_0xa9b5('0x45')][_0xa9b5('0x5c')]({'where':{'id':_0x3915fb[_0xa9b5('0x63')]['id']}})['then'](handleEntityNotFound(_0x31917f,null))['then'](function(_0x3be6ac){if(_0x3be6ac){return _0x3be6ac[_0xa9b5('0x10e')](_0x3915fb[_0xa9b5('0x47')]['ids'])[_0xa9b5('0x26')](function(){if(_[_0xa9b5('0x10f')](_0x3915fb['query']['ids'])){for(var _0x2fd2a5=0x0;_0x2fd2a5<_0x3915fb[_0xa9b5('0x47')][_0xa9b5('0x6c')]['length'];_0x2fd2a5+=0x1){socket[_0xa9b5('0x110')]('userChatWebsite:remove',{'UserId':Number(_0x3915fb[_0xa9b5('0x47')][_0xa9b5('0x6c')][_0x2fd2a5]),'ChatWebsiteId':Number(_0x3915fb[_0xa9b5('0x63')]['id'])});}}else{socket[_0xa9b5('0x110')](_0xa9b5('0x111'),{'UserId':Number(_0x3915fb[_0xa9b5('0x47')]['ids']),'ChatWebsiteId':Number(_0x3915fb['params']['id'])});}});}})[_0xa9b5('0x26')](respondWithStatusCode(_0x31917f,null))['catch'](handleError(_0x31917f,null));};exports[_0xa9b5('0x112')]=function(_0x1ca70f,_0x7de4ea,_0x54ca3b){var _0xe12cbe={};var _0x636d84={};var _0x4cb5bb;var _0x5af63c;return db[_0xa9b5('0x45')][_0xa9b5('0x6f')]({'where':{'id':_0x1ca70f['params']['id']}})[_0xa9b5('0x26')](handleEntityNotFound(_0x7de4ea,null))[_0xa9b5('0x26')](function(_0x34f027){if(_0x34f027){_0x4cb5bb=_0x34f027;_0x636d84[_0xa9b5('0x46')]=_[_0xa9b5('0x48')](db[_0xa9b5('0xc6')][_0xa9b5('0x5a')]);_0x636d84[_0xa9b5('0x47')]=_[_0xa9b5('0x48')](_0x1ca70f[_0xa9b5('0x47')]);_0x636d84[_0xa9b5('0x4e')]=_['intersection'](_0x636d84[_0xa9b5('0x46')],_0x636d84[_0xa9b5('0x47')]);_0xe12cbe['attributes']=_[_0xa9b5('0x49')](_0x636d84[_0xa9b5('0x46')],qs[_0xa9b5('0x4b')](_0x1ca70f[_0xa9b5('0x47')][_0xa9b5('0x4b')]));_0xe12cbe[_0xa9b5('0x4a')]=_0xe12cbe['attributes'][_0xa9b5('0x4c')]?_0xe12cbe[_0xa9b5('0x4a')]:_0x636d84[_0xa9b5('0x46')];_0xe12cbe[_0xa9b5('0x70')]=qs[_0xa9b5('0x4d')](_0x1ca70f[_0xa9b5('0x47')][_0xa9b5('0x4d')]);_0xe12cbe[_0xa9b5('0x51')]=qs['filters'](_['pick'](_0x1ca70f['query'],_0x636d84[_0xa9b5('0x4e')]));if(_0x1ca70f[_0xa9b5('0x47')][_0xa9b5('0x50')]){_0xe12cbe[_0xa9b5('0x51')]=_[_0xa9b5('0x5b')](_0xe12cbe[_0xa9b5('0x51')],{'$or':_[_0xa9b5('0x44')](_0xe12cbe[_0xa9b5('0x4a')],function(_0x1bb903){var _0x290366={};_0x290366[_0x1bb903]={'$like':'%'+_0x1ca70f['query'][_0xa9b5('0x50')]+'%'};return _0x290366;})});}_0xe12cbe=_[_0xa9b5('0x5b')]({},_0xe12cbe,_0x1ca70f[_0xa9b5('0x53')]);return _0x4cb5bb['getAgents'](_0xe12cbe);}})['then'](function(_0x51910a){if(_0x51910a){_0x5af63c=_0x51910a['length'];if(!_0x1ca70f[_0xa9b5('0x47')][_0xa9b5('0x69')](_0xa9b5('0x6a'))){_0xe12cbe['limit']=qs[_0xa9b5('0x33')](_0x1ca70f[_0xa9b5('0x47')][_0xa9b5('0x33')]);_0xe12cbe[_0xa9b5('0x32')]=qs[_0xa9b5('0x32')](_0x1ca70f[_0xa9b5('0x47')]['offset']);}return _0x4cb5bb[_0xa9b5('0x112')](_0xe12cbe);}})['then'](function(_0x29ec70){if(_0x29ec70){return _0x29ec70?{'count':_0x5af63c,'rows':_0x29ec70}:null;}})[_0xa9b5('0x26')](respondWithResult(_0x7de4ea,null))[_0xa9b5('0x58')](handleError(_0x7de4ea,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 5f259a7..f73b11b 100644
--- a/server/api/chatWebsite/chatWebsite.events.js
+++ b/server/api/chatWebsite/chatWebsite.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc0c2=['setMaxListeners','save','remove','emit','hasOwnProperty','../../mysqldb','ChatWebsite'];(function(_0xcbbd03,_0x67588f){var _0x1ae6f0=function(_0x5d55c7){while(--_0x5d55c7){_0xcbbd03['push'](_0xcbbd03['shift']());}};_0x1ae6f0(++_0x67588f);}(_0xc0c2,0x1b7));var _0x2c0c=function(_0x3ddb4e,_0x5d9ecf){_0x3ddb4e=_0x3ddb4e-0x0;var _0x16202e=_0xc0c2[_0x3ddb4e];return _0x16202e;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x2c0c('0x0'))['db'][_0x2c0c('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2c0c('0x2')](0x0);var events={'afterCreate':_0x2c0c('0x3'),'afterUpdate':'update','afterDestroy':_0x2c0c('0x4')};function emitEvent(_0x33e994){return function(_0x362d03,_0x276285,_0x34d550){ChatWebsiteEvents[_0x2c0c('0x5')](_0x33e994+':'+_0x362d03['id'],_0x362d03);ChatWebsiteEvents[_0x2c0c('0x5')](_0x33e994,_0x362d03);_0x34d550(null);};}for(var e in events){if(events[_0x2c0c('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xabed=['remove','emit','hook','exports','events','../../mysqldb','save','update'];(function(_0x17cd2b,_0x509b69){var _0x4b1596=function(_0x58e124){while(--_0x58e124){_0x17cd2b['push'](_0x17cd2b['shift']());}};_0x4b1596(++_0x509b69);}(_0xabed,0xa4));var _0xdabe=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xabed[_0xe45118];return _0x15e15d;};'use strict';var EventEmitter=require(_0xdabe('0x0'));var ChatWebsite=require(_0xdabe('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdabe('0x2'),'afterUpdate':_0xdabe('0x3'),'afterDestroy':_0xdabe('0x4')};function emitEvent(_0x84cce2){return function(_0x48c708,_0x4ed902,_0x3f6b9d){ChatWebsiteEvents[_0xdabe('0x5')](_0x84cce2+':'+_0x48c708['id'],_0x48c708);ChatWebsiteEvents['emit'](_0x84cce2,_0x48c708);_0x3f6b9d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xdabe('0x6')](e,emitEvent(event));}}module[_0xdabe('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index a082155..75615ed 100644
--- a/server/api/chatWebsite/chatWebsite.model.js
+++ b/server/api/chatWebsite/chatWebsite.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f72=['request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x181112,_0x266057){var _0x259948=function(_0x4e82c3){while(--_0x4e82c3){_0x181112['push'](_0x181112['shift']());}};_0x259948(++_0x266057);}(_0x2f72,0x166));var _0x22f7=function(_0x525904,_0x5b7a9c){_0x525904=_0x525904-0x0;var _0xb7b736=_0x2f72[_0x525904];return _0xb7b736;};'use strict';var _=require(_0x22f7('0x0'));var util=require(_0x22f7('0x1'));var logger=require(_0x22f7('0x2'))(_0x22f7('0x3'));var moment=require(_0x22f7('0x4'));var BPromise=require(_0x22f7('0x5'));var rp=require(_0x22f7('0x6'));var fs=require('fs');var path=require(_0x22f7('0x7'));var rimraf=require('rimraf');var config=require(_0x22f7('0x8'));var attributes=require(_0x22f7('0x9'));module[_0x22f7('0xa')]=function(_0x216f96,_0xd85654){return _0x216f96[_0x22f7('0xb')](_0x22f7('0xc'),attributes,{'tableName':_0x22f7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa73a=['util','../../config/logger','api','moment','bluebird','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x5cdea7,_0x495ed4){var _0x5b2572=function(_0x15f28b){while(--_0x15f28b){_0x5cdea7['push'](_0x5cdea7['shift']());}};_0x5b2572(++_0x495ed4);}(_0xa73a,0x82));var _0xaa73=function(_0x19bf5f,_0x1ca6b9){_0x19bf5f=_0x19bf5f-0x0;var _0x237efa=_0xa73a[_0x19bf5f];return _0x237efa;};'use strict';var _=require('lodash');var util=require(_0xaa73('0x0'));var logger=require(_0xaa73('0x1'))(_0xaa73('0x2'));var moment=require(_0xaa73('0x3'));var BPromise=require(_0xaa73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa73('0x5'));var attributes=require(_0xaa73('0x6'));module[_0xaa73('0x7')]=function(_0x15d1c6,_0xf84c2e){return _0x15d1c6[_0xaa73('0x8')](_0xaa73('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 7a34db7..46ec30f 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d38=['catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result'];(function(_0x1156e9,_0x2977c8){var _0x4f428d=function(_0x16e588){while(--_0x16e588){_0x1156e9['push'](_0x1156e9['shift']());}};_0x4f428d(++_0x2977c8);}(_0x6d38,0x1ef));var _0x86d3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6d38[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});config[_0x86d3('0x9')]=_[_0x86d3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x86d3('0xb'))(new Redis(config[_0x86d3('0x9')]));require(_0x86d3('0xc'))['register'](socket);function respondWithRpcPromise(_0x4a277e,_0x3ed317,_0x555e6d){return new BPromise(function(_0x49b436,_0x5606eb){return client[_0x86d3('0xd')](_0x4a277e,_0x555e6d)[_0x86d3('0xe')](function(_0x4f216c){logger[_0x86d3('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x3ed317,_0x86d3('0x10'));logger[_0x86d3('0x11')](_0x86d3('0x12'),_0x3ed317,_0x86d3('0x10'),JSON[_0x86d3('0x13')](_0x4f216c));if(_0x4f216c[_0x86d3('0x14')]){if(_0x4f216c[_0x86d3('0x14')][_0x86d3('0x15')]===0x1f4){logger['error'](_0x86d3('0x16'),_0x3ed317,_0x4f216c[_0x86d3('0x14')][_0x86d3('0x17')]);return _0x5606eb(_0x4f216c[_0x86d3('0x14')][_0x86d3('0x17')]);}logger[_0x86d3('0x14')](_0x86d3('0x16'),_0x3ed317,_0x4f216c[_0x86d3('0x14')]['message']);return _0x49b436(_0x4f216c[_0x86d3('0x14')][_0x86d3('0x17')]);}else{logger[_0x86d3('0xf')](_0x86d3('0x16'),_0x3ed317,_0x86d3('0x10'));_0x49b436(_0x4f216c[_0x86d3('0x18')][_0x86d3('0x17')]);}})[_0x86d3('0x19')](function(_0x9b76f2){logger['error'](_0x86d3('0x16'),_0x3ed317,_0x9b76f2);_0x5606eb(_0x9b76f2);});});}
\ No newline at end of file
+var _0x01d9=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x222a14,_0x36b68d){var _0x38a8ac=function(_0x1531e7){while(--_0x1531e7){_0x222a14['push'](_0x222a14['shift']());}};_0x38a8ac(++_0x36b68d);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});config[_0x901d('0xc')]=_[_0x901d('0xd')](config[_0x901d('0xc')],{'host':_0x901d('0xe'),'port':0x18eb});var socket=require(_0x901d('0xf'))(new Redis(config[_0x901d('0xc')]));require(_0x901d('0x10'))[_0x901d('0x11')](socket);function respondWithRpcPromise(_0xacff40,_0x440fb0,_0xd819f0){return new BPromise(function(_0x1d3137,_0x5d74e2){return client[_0x901d('0x12')](_0xacff40,_0xd819f0)['then'](function(_0x220153){logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));logger[_0x901d('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x440fb0,_0x901d('0x15'),JSON[_0x901d('0x17')](_0x220153));if(_0x220153[_0x901d('0x18')]){if(_0x220153[_0x901d('0x18')][_0x901d('0x19')]===0x1f4){logger[_0x901d('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x5d74e2(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}logger[_0x901d('0x18')](_0x901d('0x14'),_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x1d3137(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}else{logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));_0x1d3137(_0x220153[_0x901d('0x1b')][_0x901d('0x1a')]);}})[_0x901d('0x1c')](function(_0xf3c66a){logger[_0x901d('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x440fb0,_0xf3c66a);_0x5d74e2(_0xf3c66a);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 6ab73bb..fa1d533 100644
--- a/server/api/chatWebsite/chatWebsite.socket.js
+++ b/server/api/chatWebsite/chatWebsite.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x253141,_0x396c1e){var _0x4472f3=function(_0x28b591){while(--_0x28b591){_0x253141['push'](_0x253141['shift']());}};_0x4472f3(++_0x396c1e);}(_0x5f2f,0x73));var _0xf5f2=function(_0xdc1176,_0x55c094){_0xdc1176=_0xdc1176-0x0;var _0x4d7c39=_0x5f2f[_0xdc1176];return _0x4d7c39;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x1c8c2f,_0x1d99fe){var _0x24fa67=function(_0x15fd50){while(--_0x15fd50){_0x1c8c2f['push'](_0x1c8c2f['shift']());}};_0x24fa67(++_0x1d99fe);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4598ef,_0x4af544){_0x4598ef=_0x4598ef-0x0;var _0x1185a4=_0x5f2f[_0x4598ef];return _0x1185a4;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7a72444..dbed8d0 100644
--- a/server/api/chatWebsite/index.js
+++ b/server/api/chatWebsite/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x14ec=['addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/fields','getFields','/:id/offline_messages','post','/:id/canned_answers','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x14ec,0x193));var _0xc14e=function(_0x2dbf61,_0x368497){_0x2dbf61=_0x2dbf61-0x0;var _0x5cbf49=_0x14ec[_0x2dbf61];return _0x5cbf49;};'use strict';var multer=require(_0xc14e('0x0'));var util=require(_0xc14e('0x1'));var path=require(_0xc14e('0x2'));var timeout=require(_0xc14e('0x3'));var express=require(_0xc14e('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc14e('0x5'));var config=require(_0xc14e('0x6'));var controller=require(_0xc14e('0x7'));router[_0xc14e('0x8')]('/',auth['isAuthenticated'](),controller[_0xc14e('0x9')]);router['get'](_0xc14e('0xa'),auth[_0xc14e('0xb')](),controller[_0xc14e('0xc')]);router[_0xc14e('0x8')]('/:id',auth[_0xc14e('0xb')](),controller[_0xc14e('0xd')]);router[_0xc14e('0x8')](_0xc14e('0xe'),auth['isAuthenticated'](),controller[_0xc14e('0xf')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xc14e('0x8')](_0xc14e('0x10'),controller['getLogo']);router[_0xc14e('0x8')](_0xc14e('0x11'),controller[_0xc14e('0x12')]);router[_0xc14e('0x8')](_0xc14e('0x13'),controller['getCustomerAvatar']);router['get'](_0xc14e('0x14'),controller[_0xc14e('0x15')]);router[_0xc14e('0x8')](_0xc14e('0x16'),auth[_0xc14e('0xb')](),controller[_0xc14e('0x17')]);router[_0xc14e('0x8')](_0xc14e('0x18'),controller[_0xc14e('0x19')]);router[_0xc14e('0x8')](_0xc14e('0x1a'),auth[_0xc14e('0xb')](),controller[_0xc14e('0x1b')]);router[_0xc14e('0x8')]('/:id/proactive_actions',auth[_0xc14e('0xb')](),controller['getProactiveActions']);router[_0xc14e('0x8')](_0xc14e('0x1c'),controller[_0xc14e('0x1d')]);router['get'](_0xc14e('0x1e'),auth['isAuthenticated'](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0xc14e('0xb')](),controller['getAgents']);router[_0xc14e('0x1f')]('/',auth[_0xc14e('0xb')](),controller['create']);router[_0xc14e('0x1f')]('/:id/dispositions',auth[_0xc14e('0xb')](),controller['addDisposition']);router[_0xc14e('0x1f')](_0xc14e('0x20'),auth[_0xc14e('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xc14e('0x21')]({'destination':function(_0x18b6d2,_0x52507f,_0x451057){_0x451057(null,path[_0xc14e('0x22')](config[_0xc14e('0x23')],'server/files/images/logos/'));},'filename':function(_0x274a87,_0x4ead7d,_0x650a48){_0x650a48(null,util[_0xc14e('0x24')](_0xc14e('0x25'),Date[_0xc14e('0x26')](),_0x4ead7d[_0xc14e('0x27')]));}})});router['post'](_0xc14e('0x10'),upload[_0xc14e('0x28')](_0xc14e('0x29')),controller[_0xc14e('0x2a')]);var upload=multer({'storage':multer[_0xc14e('0x21')]({'destination':function(_0x356556,_0x47430d,_0x305538){_0x305538(null,path[_0xc14e('0x22')](config['root'],_0xc14e('0x2b')));},'filename':function(_0x15598b,_0x365276,_0xec251a){_0xec251a(null,util['format']('%s-%s',Date[_0xc14e('0x26')](),_0x365276[_0xc14e('0x27')]));}})});router['post'](_0xc14e('0x11'),upload[_0xc14e('0x28')](_0xc14e('0x29')),controller[_0xc14e('0x2c')]);var upload=multer({'storage':multer[_0xc14e('0x21')]({'destination':function(_0x40775a,_0x593f09,_0x88155b){_0x88155b(null,path[_0xc14e('0x22')](config['root'],_0xc14e('0x2b')));},'filename':function(_0x5c30f2,_0x32d5f6,_0x4c9af0){_0x4c9af0(null,util['format'](_0xc14e('0x25'),Date[_0xc14e('0x26')](),_0x32d5f6[_0xc14e('0x27')]));}})});router[_0xc14e('0x1f')](_0xc14e('0x13'),upload[_0xc14e('0x28')](_0xc14e('0x29')),controller[_0xc14e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x229bab,_0x3c041a,_0x5b453d){_0x5b453d(null,path[_0xc14e('0x22')](config['root'],_0xc14e('0x2b')));},'filename':function(_0x1768c8,_0x53697d,_0x559ee2){_0x559ee2(null,util[_0xc14e('0x24')](_0xc14e('0x25'),Date[_0xc14e('0x26')](),_0x53697d[_0xc14e('0x27')]));}})});router[_0xc14e('0x1f')](_0xc14e('0x14'),upload['single'](_0xc14e('0x29')),controller[_0xc14e('0x2e')]);router[_0xc14e('0x1f')](_0xc14e('0x2f'),controller[_0xc14e('0x30')]);router[_0xc14e('0x1f')]('/:id/offline',controller[_0xc14e('0x31')]);router[_0xc14e('0x1f')](_0xc14e('0x16'),auth['isAuthenticated'](),controller[_0xc14e('0x32')]);router[_0xc14e('0x1f')](_0xc14e('0x1a'),auth['isAuthenticated'](),controller[_0xc14e('0x33')]);router[_0xc14e('0x1f')](_0xc14e('0x34'),auth['isAuthenticated'](),controller[_0xc14e('0x35')]);router[_0xc14e('0x1f')](_0xc14e('0x36'),auth[_0xc14e('0xb')](),controller[_0xc14e('0x37')]);router[_0xc14e('0x38')](_0xc14e('0x39'),auth[_0xc14e('0xb')](),controller[_0xc14e('0x3a')]);router[_0xc14e('0x3b')](_0xc14e('0x39'),auth[_0xc14e('0xb')](),controller[_0xc14e('0x3c')]);router[_0xc14e('0x3b')](_0xc14e('0xe'),auth[_0xc14e('0xb')](),controller['removeDispositions']);router[_0xc14e('0x3b')](_0xc14e('0x20'),auth['isAuthenticated'](),controller[_0xc14e('0x3d')]);router[_0xc14e('0x3b')](_0xc14e('0x36'),auth['isAuthenticated'](),controller[_0xc14e('0x3e')]);module[_0xc14e('0x3f')]=router;
\ No newline at end of file
+var _0x7583=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','now','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','format','%s-%s','addAvatar','join','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/offline','offline','addApplications','/:id/proactive_actions','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x3d0198,_0x94b95c){var _0x3488b2=function(_0x1483ba){while(--_0x1483ba){_0x3d0198['push'](_0x3d0198['shift']());}};_0x3488b2(++_0x94b95c);}(_0x7583,0x8c));var _0x3758=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0x7583[_0xf48cce];return _0x2a5c38;};'use strict';var multer=require(_0x3758('0x0'));var util=require(_0x3758('0x1'));var path=require(_0x3758('0x2'));var timeout=require(_0x3758('0x3'));var express=require(_0x3758('0x4'));var router=express[_0x3758('0x5')]();var auth=require(_0x3758('0x6'));var interaction=require(_0x3758('0x7'));var config=require(_0x3758('0x8'));var controller=require(_0x3758('0x9'));router[_0x3758('0xa')]('/',auth[_0x3758('0xb')](),controller[_0x3758('0xc')]);router[_0x3758('0xa')](_0x3758('0xd'),auth['isAuthenticated'](),controller[_0x3758('0xe')]);router['get'](_0x3758('0xf'),auth['isAuthenticated'](),controller[_0x3758('0x10')]);router['get'](_0x3758('0x11'),auth[_0x3758('0xb')](),controller[_0x3758('0x12')]);router[_0x3758('0xa')](_0x3758('0x13'),auth[_0x3758('0xb')](),controller[_0x3758('0x14')]);router['get']('/:id/logo',controller[_0x3758('0x15')]);router[_0x3758('0xa')](_0x3758('0x16'),controller[_0x3758('0x17')]);router[_0x3758('0xa')]('/:id/customer_avatar',controller[_0x3758('0x18')]);router[_0x3758('0xa')]('/:id/system_avatar',controller[_0x3758('0x19')]);router['get'](_0x3758('0x1a'),auth[_0x3758('0xb')](),controller[_0x3758('0x1b')]);router[_0x3758('0xa')](_0x3758('0x1c'),controller['getSnippet']);router[_0x3758('0xa')](_0x3758('0x1d'),auth[_0x3758('0xb')](),controller[_0x3758('0x1e')]);router[_0x3758('0xa')]('/:id/proactive_actions',auth[_0x3758('0xb')](),controller[_0x3758('0x1f')]);router[_0x3758('0xa')](_0x3758('0x20'),controller[_0x3758('0x21')]);router[_0x3758('0xa')](_0x3758('0x22'),auth[_0x3758('0xb')](),controller[_0x3758('0x23')]);router['get'](_0x3758('0x24'),auth[_0x3758('0xb')](),controller['getAgents']);router['post']('/',auth[_0x3758('0xb')](),controller[_0x3758('0x25')]);router[_0x3758('0x26')](_0x3758('0x11'),auth['isAuthenticated'](),controller[_0x3758('0x27')]);router[_0x3758('0x26')](_0x3758('0x13'),auth[_0x3758('0xb')](),controller[_0x3758('0x28')]);var upload=multer({'storage':multer[_0x3758('0x29')]({'destination':function(_0x27eac1,_0x5dee81,_0x4b7c12){_0x4b7c12(null,path['join'](config[_0x3758('0x2a')],_0x3758('0x2b')));},'filename':function(_0x15b249,_0x56c869,_0x16fa6d){_0x16fa6d(null,util['format']('%s-%s',Date[_0x3758('0x2c')](),_0x56c869[_0x3758('0x2d')]));}})});router['post'](_0x3758('0x2e'),upload[_0x3758('0x2f')](_0x3758('0x30')),controller[_0x3758('0x31')]);var upload=multer({'storage':multer[_0x3758('0x29')]({'destination':function(_0x54406c,_0xc0614f,_0x4ea916){_0x4ea916(null,path['join'](config['root'],_0x3758('0x32')));},'filename':function(_0x5e2bd6,_0x91572a,_0x342b79){_0x342b79(null,util[_0x3758('0x33')](_0x3758('0x34'),Date[_0x3758('0x2c')](),_0x91572a[_0x3758('0x2d')]));}})});router['post'](_0x3758('0x16'),upload[_0x3758('0x2f')]('file'),controller[_0x3758('0x35')]);var upload=multer({'storage':multer[_0x3758('0x29')]({'destination':function(_0x1a1ecd,_0x1028c1,_0x304a75){_0x304a75(null,path[_0x3758('0x36')](config[_0x3758('0x2a')],_0x3758('0x32')));},'filename':function(_0x39cb52,_0x13fe26,_0x5f25ea){_0x5f25ea(null,util[_0x3758('0x33')](_0x3758('0x34'),Date[_0x3758('0x2c')](),_0x13fe26[_0x3758('0x2d')]));}})});router['post'](_0x3758('0x37'),upload['single'](_0x3758('0x30')),controller[_0x3758('0x38')]);var upload=multer({'storage':multer[_0x3758('0x29')]({'destination':function(_0x1a40aa,_0x564bda,_0x598567){_0x598567(null,path['join'](config[_0x3758('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x52610c,_0x1c942d,_0x13e773){_0x13e773(null,util[_0x3758('0x33')](_0x3758('0x34'),Date['now'](),_0x1c942d['originalname']));}})});router[_0x3758('0x26')]('/:id/system_avatar',upload[_0x3758('0x2f')](_0x3758('0x30')),controller[_0x3758('0x39')]);router[_0x3758('0x26')](_0x3758('0x3a'),controller['notify']);router[_0x3758('0x26')](_0x3758('0x3b'),controller[_0x3758('0x3c')]);router[_0x3758('0x26')](_0x3758('0x1a'),auth[_0x3758('0xb')](),controller['addInteraction']);router[_0x3758('0x26')](_0x3758('0x1d'),auth[_0x3758('0xb')](),controller[_0x3758('0x3d')]);router['post'](_0x3758('0x3e'),auth[_0x3758('0xb')](),controller['addProactiveActions']);router[_0x3758('0x26')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x3758('0x3f')](_0x3758('0xf'),auth['isAuthenticated'](),controller[_0x3758('0x40')]);router[_0x3758('0x41')](_0x3758('0xf'),auth[_0x3758('0xb')](),controller[_0x3758('0x42')]);router[_0x3758('0x41')]('/:id/dispositions',auth[_0x3758('0xb')](),controller[_0x3758('0x43')]);router[_0x3758('0x41')]('/:id/canned_answers',auth[_0x3758('0xb')](),controller[_0x3758('0x44')]);router[_0x3758('0x41')](_0x3758('0x24'),auth[_0x3758('0xb')](),controller[_0x3758('0x45')]);module[_0x3758('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 55b7a1a..8bc39e3 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x644f=['exports','AmazonAWS','Google','STRING','sequelize'];(function(_0x4a5f80,_0x2c17db){var _0x11501c=function(_0x25f997){while(--_0x25f997){_0x4a5f80['push'](_0x4a5f80['shift']());}};_0x11501c(++_0x2c17db);}(_0x644f,0xc2));var _0xf644=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x644f[_0x5b7788];return _0x573871;};'use strict';var Sequelize=require(_0xf644('0x0'));module[_0xf644('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xf644('0x2'),_0xf644('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf644('0x4')]},'data2':{'type':Sequelize[_0xf644('0x4')]}};
\ No newline at end of file
+var _0x5f6f=['sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x431344,_0x1840f8){_0x431344=_0x431344-0x0;var _0x3a6bf6=_0x5f6f[_0x431344];return _0x3a6bf6;};'use strict';var Sequelize=require(_0xf5f6('0x0'));module[_0xf5f6('0x1')]={'name':{'type':Sequelize[_0xf5f6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf5f6('0x3')](_0xf5f6('0x4'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf5f6('0x2')]},'data2':{'type':Sequelize[_0xf5f6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 1c719c3..b38ceb1 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0321=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','then','destroy','end','error','name','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','sox'];(function(_0x4a0b3c,_0x5f151b){var _0x51190b=function(_0x222efd){while(--_0x222efd){_0x4a0b3c['push'](_0x4a0b3c['shift']());}};_0x51190b(++_0x5f151b);}(_0x0321,0x86));var _0x1032=function(_0x475d5f,_0x34abc4){_0x475d5f=_0x475d5f-0x0;var _0x27e851=_0x0321[_0x475d5f];return _0x27e851;};'use strict';var pdf=require(_0x1032('0x0'));var emlformat=require(_0x1032('0x1'));var rimraf=require(_0x1032('0x2'));var zipdir=require(_0x1032('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1032('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1032('0x5'));var util=require(_0x1032('0x6'));var path=require('path');var sox=require(_0x1032('0x7'));var csv=require(_0x1032('0x8'));var ejs=require(_0x1032('0x9'));var fs=require('fs');var _=require(_0x1032('0xa'));var squel=require(_0x1032('0xb'));var crypto=require(_0x1032('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1032('0xd'));var toCsv=require(_0x1032('0x8'));var querystring=require(_0x1032('0xe'));var Papa=require(_0x1032('0xf'));var Redis=require('ioredis');var authService=require(_0x1032('0x10'));var qs=require(_0x1032('0x11'));var as=require(_0x1032('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1032('0x13'))(_0x1032('0x14'));var utils=require(_0x1032('0x15'));var config=require(_0x1032('0x16'));var db=require(_0x1032('0x17'))['db'];function respondWithStatusCode(_0x220d3c,_0x1d359e){_0x1d359e=_0x1d359e||0xcc;return function(_0x229736){if(_0x229736){return _0x220d3c[_0x1032('0x18')](_0x1d359e);}return _0x220d3c[_0x1032('0x19')](_0x1d359e)['end']();};}function respondWithResult(_0x1798d7,_0x42e967){_0x42e967=_0x42e967||0xc8;return function(_0x358461){if(_0x358461){return _0x1798d7[_0x1032('0x19')](_0x42e967)['json'](_0x358461);}};}function respondWithFilteredResult(_0x5f5859,_0x32dd3b){return function(_0x5a5539){if(_0x5a5539){var _0x505e92=_0x5a5539[_0x1032('0x1a')],_0x2ce499=_0x32dd3b[_0x1032('0x1b')],_0x2ed85a=_0x32dd3b['offset']+_0x32dd3b[_0x1032('0x1c')],_0x14d7b0;if(_0x2ed85a>=_0x505e92){_0x2ed85a=_0x505e92;_0x14d7b0=0xc8;}else{_0x14d7b0=0xce;}_0x5f5859['status'](_0x14d7b0);return _0x5f5859[_0x1032('0x1d')]('Content-Range',_0x2ce499+'-'+_0x2ed85a+'/'+_0x505e92)[_0x1032('0x1e')](_0x5a5539);}return null;};}function patchUpdates(_0x2c0334){return function(_0x3fd5e8){try{jsonpatch['apply'](_0x3fd5e8,_0x2c0334,!![]);}catch(_0x4e1d3e){return BPromise['reject'](_0x4e1d3e);}return _0x3fd5e8['save']();};}function saveUpdates(_0x5c3153,_0x20af37){return function(_0x5a759e){if(_0x5a759e){return _0x5a759e['update'](_0x5c3153)[_0x1032('0x1f')](function(_0x2a5a36){return _0x2a5a36;});}return null;};}function removeEntity(_0x5b00b4,_0x310d73){return function(_0x253397){if(_0x253397){return _0x253397[_0x1032('0x20')]()[_0x1032('0x1f')](function(){_0x5b00b4[_0x1032('0x19')](0xcc)[_0x1032('0x21')]();});}};}function handleEntityNotFound(_0x35a336,_0x4d5024){return function(_0x4e60c9){if(!_0x4e60c9){_0x35a336['sendStatus'](0x194);}return _0x4e60c9;};}function handleError(_0x5467ec,_0x2b0d49){_0x2b0d49=_0x2b0d49||0x1f4;return function(_0x392dd8){logger[_0x1032('0x22')](_0x392dd8['stack']);if(_0x392dd8[_0x1032('0x23')]){delete _0x392dd8['name'];}_0x5467ec[_0x1032('0x19')](_0x2b0d49)['send'](_0x392dd8);};}exports[_0x1032('0x24')]=function(_0x173590,_0x40c6dd){var _0x2c3ed2={},_0x4bf8b6={},_0x564320={'count':0x0,'rows':[]};var _0x5cf4e0=_[_0x1032('0x25')](db[_0x1032('0x26')][_0x1032('0x27')],function(_0xd10a26){return{'name':_0xd10a26[_0x1032('0x28')],'type':_0xd10a26[_0x1032('0x29')][_0x1032('0x2a')]};});_0x4bf8b6[_0x1032('0x2b')]=_[_0x1032('0x25')](_0x5cf4e0,_0x1032('0x23'));_0x4bf8b6['query']=_[_0x1032('0x2c')](_0x173590[_0x1032('0x2d')]);_0x4bf8b6['filters']=_[_0x1032('0x2e')](_0x4bf8b6[_0x1032('0x2b')],_0x4bf8b6[_0x1032('0x2d')]);_0x2c3ed2[_0x1032('0x2f')]=_[_0x1032('0x2e')](_0x4bf8b6[_0x1032('0x2b')],qs[_0x1032('0x30')](_0x173590[_0x1032('0x2d')][_0x1032('0x30')]));_0x2c3ed2[_0x1032('0x2f')]=_0x2c3ed2['attributes'][_0x1032('0x31')]?_0x2c3ed2[_0x1032('0x2f')]:_0x4bf8b6[_0x1032('0x2b')];if(!_0x173590[_0x1032('0x2d')][_0x1032('0x32')](_0x1032('0x33'))){_0x2c3ed2[_0x1032('0x1c')]=qs[_0x1032('0x1c')](_0x173590['query'][_0x1032('0x1c')]);_0x2c3ed2[_0x1032('0x1b')]=qs[_0x1032('0x1b')](_0x173590[_0x1032('0x2d')][_0x1032('0x1b')]);}_0x2c3ed2[_0x1032('0x34')]=qs[_0x1032('0x35')](_0x173590[_0x1032('0x2d')][_0x1032('0x35')]);_0x2c3ed2[_0x1032('0x36')]=qs[_0x1032('0x37')](_[_0x1032('0x38')](_0x173590[_0x1032('0x2d')],_0x4bf8b6['filters']),_0x5cf4e0);if(_0x173590[_0x1032('0x2d')][_0x1032('0x39')]){_0x2c3ed2[_0x1032('0x36')]=_[_0x1032('0x3a')](_0x2c3ed2[_0x1032('0x36')],{'$or':_[_0x1032('0x25')](_0x5cf4e0,function(_0xaa6510){if(_0xaa6510[_0x1032('0x29')]!==_0x1032('0x3b')){var _0x5883c5={};_0x5883c5[_0xaa6510[_0x1032('0x23')]]={'$like':'%'+_0x173590[_0x1032('0x2d')]['filter']+'%'};return _0x5883c5;}})});}_0x2c3ed2=_['merge']({},_0x2c3ed2,_0x173590[_0x1032('0x3c')]);var _0x2d20b4={'where':_0x2c3ed2[_0x1032('0x36')]};return db[_0x1032('0x26')][_0x1032('0x1a')](_0x2d20b4)[_0x1032('0x1f')](function(_0x232781){_0x564320[_0x1032('0x1a')]=_0x232781;if(_0x173590['query'][_0x1032('0x3d')]){_0x2c3ed2[_0x1032('0x3e')]=[{'all':!![]}];}return db[_0x1032('0x26')][_0x1032('0x3f')](_0x2c3ed2);})[_0x1032('0x1f')](function(_0xbd4369){_0x564320[_0x1032('0x40')]=_0xbd4369;return _0x564320;})[_0x1032('0x1f')](respondWithFilteredResult(_0x40c6dd,_0x2c3ed2))[_0x1032('0x41')](handleError(_0x40c6dd,null));};exports[_0x1032('0x42')]=function(_0x380331,_0x498771){var _0x250395={'raw':!![],'where':{'id':_0x380331[_0x1032('0x43')]['id']}},_0x321323={};_0x321323[_0x1032('0x2b')]=_[_0x1032('0x2c')](db[_0x1032('0x26')]['rawAttributes']);_0x321323[_0x1032('0x2d')]=_[_0x1032('0x2c')](_0x380331[_0x1032('0x2d')]);_0x321323['filters']=_['intersection'](_0x321323[_0x1032('0x2b')],_0x321323[_0x1032('0x2d')]);_0x250395['attributes']=_[_0x1032('0x2e')](_0x321323['model'],qs[_0x1032('0x30')](_0x380331[_0x1032('0x2d')][_0x1032('0x30')]));_0x250395[_0x1032('0x2f')]=_0x250395[_0x1032('0x2f')][_0x1032('0x31')]?_0x250395[_0x1032('0x2f')]:_0x321323[_0x1032('0x2b')];if(_0x380331[_0x1032('0x2d')][_0x1032('0x3d')]){_0x250395[_0x1032('0x3e')]=[{'all':!![]}];}_0x250395=_[_0x1032('0x3a')]({},_0x250395,_0x380331['options']);return db[_0x1032('0x26')][_0x1032('0x44')](_0x250395)[_0x1032('0x1f')](handleEntityNotFound(_0x498771,null))[_0x1032('0x1f')](respondWithResult(_0x498771,null))[_0x1032('0x41')](handleError(_0x498771,null));};exports[_0x1032('0x45')]=function(_0x3253b4,_0x1adabb){return db[_0x1032('0x26')][_0x1032('0x45')](_0x3253b4[_0x1032('0x46')],{})['then'](respondWithResult(_0x1adabb,0xc9))[_0x1032('0x41')](handleError(_0x1adabb,null));};exports['update']=function(_0x436549,_0x2156d7){if(_0x436549[_0x1032('0x46')]['id']){delete _0x436549[_0x1032('0x46')]['id'];}return db[_0x1032('0x26')][_0x1032('0x44')]({'where':{'id':_0x436549[_0x1032('0x43')]['id']}})[_0x1032('0x1f')](handleEntityNotFound(_0x2156d7,null))[_0x1032('0x1f')](saveUpdates(_0x436549[_0x1032('0x46')],null))[_0x1032('0x1f')](respondWithResult(_0x2156d7,null))[_0x1032('0x41')](handleError(_0x2156d7,null));};exports['destroy']=function(_0xc032ef,_0x283fdc){return db[_0x1032('0x26')][_0x1032('0x44')]({'where':{'id':_0xc032ef[_0x1032('0x43')]['id']}})[_0x1032('0x1f')](handleEntityNotFound(_0x283fdc,null))['then'](removeEntity(_0x283fdc,null))[_0x1032('0x41')](handleError(_0x283fdc,null));};
\ No newline at end of file
+var _0x20fa=['query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','type','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','CloudProvider','rawAttributes','fieldName','model','map'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x20fa,0xf8));var _0xa20f=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x20fa[_0x4017b0];return _0x5ed4f7;};'use strict';var pdf=require(_0xa20f('0x0'));var emlformat=require(_0xa20f('0x1'));var rimraf=require(_0xa20f('0x2'));var zipdir=require(_0xa20f('0x3'));var jsonpatch=require(_0xa20f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa20f('0x5'));var util=require(_0xa20f('0x6'));var path=require(_0xa20f('0x7'));var sox=require(_0xa20f('0x8'));var csv=require(_0xa20f('0x9'));var ejs=require(_0xa20f('0xa'));var fs=require('fs');var _=require(_0xa20f('0xb'));var squel=require(_0xa20f('0xc'));var crypto=require(_0xa20f('0xd'));var jsforce=require(_0xa20f('0xe'));var deskjs=require(_0xa20f('0xf'));var toCsv=require(_0xa20f('0x9'));var querystring=require(_0xa20f('0x10'));var Papa=require(_0xa20f('0x11'));var Redis=require('ioredis');var authService=require(_0xa20f('0x12'));var qs=require(_0xa20f('0x13'));var as=require(_0xa20f('0x14'));var hardwareService=require(_0xa20f('0x15'));var logger=require('../../config/logger')(_0xa20f('0x16'));var utils=require(_0xa20f('0x17'));var config=require(_0xa20f('0x18'));var db=require(_0xa20f('0x19'))['db'];function respondWithStatusCode(_0x1d398e,_0x6267f9){_0x6267f9=_0x6267f9||0xcc;return function(_0x5d7321){if(_0x5d7321){return _0x1d398e[_0xa20f('0x1a')](_0x6267f9);}return _0x1d398e['status'](_0x6267f9)[_0xa20f('0x1b')]();};}function respondWithResult(_0x3aac98,_0x80383e){_0x80383e=_0x80383e||0xc8;return function(_0x33d347){if(_0x33d347){return _0x3aac98[_0xa20f('0x1c')](_0x80383e)[_0xa20f('0x1d')](_0x33d347);}};}function respondWithFilteredResult(_0x40eccc,_0xb2b95){return function(_0x48c6b6){if(_0x48c6b6){var _0x5e4630=_0x48c6b6[_0xa20f('0x1e')],_0x57e430=_0xb2b95[_0xa20f('0x1f')],_0x308523=_0xb2b95[_0xa20f('0x1f')]+_0xb2b95['limit'],_0x3b10d4;if(_0x308523>=_0x5e4630){_0x308523=_0x5e4630;_0x3b10d4=0xc8;}else{_0x3b10d4=0xce;}_0x40eccc[_0xa20f('0x1c')](_0x3b10d4);return _0x40eccc[_0xa20f('0x20')](_0xa20f('0x21'),_0x57e430+'-'+_0x308523+'/'+_0x5e4630)[_0xa20f('0x1d')](_0x48c6b6);}return null;};}function patchUpdates(_0x1a0272){return function(_0xeb9108){try{jsonpatch[_0xa20f('0x22')](_0xeb9108,_0x1a0272,!![]);}catch(_0x56141e){return BPromise['reject'](_0x56141e);}return _0xeb9108[_0xa20f('0x23')]();};}function saveUpdates(_0x14bd77,_0xfd2ba0){return function(_0x1ca806){if(_0x1ca806){return _0x1ca806['update'](_0x14bd77)['then'](function(_0x1cdaf6){return _0x1cdaf6;});}return null;};}function removeEntity(_0x239b55,_0xa1846f){return function(_0x3894a2){if(_0x3894a2){return _0x3894a2[_0xa20f('0x24')]()[_0xa20f('0x25')](function(){_0x239b55['status'](0xcc)[_0xa20f('0x1b')]();});}};}function handleEntityNotFound(_0x20bcb9,_0x6cf705){return function(_0x7dfa3d){if(!_0x7dfa3d){_0x20bcb9['sendStatus'](0x194);}return _0x7dfa3d;};}function handleError(_0x3b764e,_0x4ca502){_0x4ca502=_0x4ca502||0x1f4;return function(_0x3c68db){logger[_0xa20f('0x26')](_0x3c68db[_0xa20f('0x27')]);if(_0x3c68db['name']){delete _0x3c68db[_0xa20f('0x28')];}_0x3b764e[_0xa20f('0x1c')](_0x4ca502)[_0xa20f('0x29')](_0x3c68db);};}exports[_0xa20f('0x2a')]=function(_0x34aa3a,_0x456624){var _0xe30408={},_0x37b84e={},_0x5ac463={'count':0x0,'rows':[]};var _0x1590fb=_['map'](db[_0xa20f('0x2b')][_0xa20f('0x2c')],function(_0x512a58){return{'name':_0x512a58[_0xa20f('0x2d')],'type':_0x512a58['type']['key']};});_0x37b84e[_0xa20f('0x2e')]=_[_0xa20f('0x2f')](_0x1590fb,_0xa20f('0x28'));_0x37b84e[_0xa20f('0x30')]=_[_0xa20f('0x31')](_0x34aa3a[_0xa20f('0x30')]);_0x37b84e[_0xa20f('0x32')]=_[_0xa20f('0x33')](_0x37b84e[_0xa20f('0x2e')],_0x37b84e[_0xa20f('0x30')]);_0xe30408[_0xa20f('0x34')]=_['intersection'](_0x37b84e[_0xa20f('0x2e')],qs[_0xa20f('0x35')](_0x34aa3a[_0xa20f('0x30')][_0xa20f('0x35')]));_0xe30408[_0xa20f('0x34')]=_0xe30408[_0xa20f('0x34')][_0xa20f('0x36')]?_0xe30408['attributes']:_0x37b84e[_0xa20f('0x2e')];if(!_0x34aa3a[_0xa20f('0x30')]['hasOwnProperty'](_0xa20f('0x37'))){_0xe30408[_0xa20f('0x38')]=qs[_0xa20f('0x38')](_0x34aa3a['query'][_0xa20f('0x38')]);_0xe30408['offset']=qs[_0xa20f('0x1f')](_0x34aa3a[_0xa20f('0x30')][_0xa20f('0x1f')]);}_0xe30408[_0xa20f('0x39')]=qs['sort'](_0x34aa3a['query'][_0xa20f('0x3a')]);_0xe30408[_0xa20f('0x3b')]=qs[_0xa20f('0x32')](_[_0xa20f('0x3c')](_0x34aa3a['query'],_0x37b84e[_0xa20f('0x32')]),_0x1590fb);if(_0x34aa3a['query']['filter']){_0xe30408['where']=_['merge'](_0xe30408[_0xa20f('0x3b')],{'$or':_[_0xa20f('0x2f')](_0x1590fb,function(_0x3c8eaf){if(_0x3c8eaf[_0xa20f('0x3d')]!=='VIRTUAL'){var _0xc52dde={};_0xc52dde[_0x3c8eaf[_0xa20f('0x28')]]={'$like':'%'+_0x34aa3a[_0xa20f('0x30')]['filter']+'%'};return _0xc52dde;}})});}_0xe30408=_[_0xa20f('0x3e')]({},_0xe30408,_0x34aa3a['options']);var _0x2e569c={'where':_0xe30408[_0xa20f('0x3b')]};return db[_0xa20f('0x2b')][_0xa20f('0x1e')](_0x2e569c)['then'](function(_0x1bc208){_0x5ac463[_0xa20f('0x1e')]=_0x1bc208;if(_0x34aa3a[_0xa20f('0x30')][_0xa20f('0x3f')]){_0xe30408[_0xa20f('0x40')]=[{'all':!![]}];}return db[_0xa20f('0x2b')][_0xa20f('0x41')](_0xe30408);})[_0xa20f('0x25')](function(_0x12da6b){_0x5ac463[_0xa20f('0x42')]=_0x12da6b;return _0x5ac463;})[_0xa20f('0x25')](respondWithFilteredResult(_0x456624,_0xe30408))[_0xa20f('0x43')](handleError(_0x456624,null));};exports['show']=function(_0x218b2c,_0x76f2d4){var _0x4cc853={'raw':!![],'where':{'id':_0x218b2c[_0xa20f('0x44')]['id']}},_0x16bbea={};_0x16bbea['model']=_[_0xa20f('0x31')](db[_0xa20f('0x2b')][_0xa20f('0x2c')]);_0x16bbea[_0xa20f('0x30')]=_['keys'](_0x218b2c[_0xa20f('0x30')]);_0x16bbea[_0xa20f('0x32')]=_[_0xa20f('0x33')](_0x16bbea['model'],_0x16bbea[_0xa20f('0x30')]);_0x4cc853['attributes']=_['intersection'](_0x16bbea['model'],qs[_0xa20f('0x35')](_0x218b2c['query'][_0xa20f('0x35')]));_0x4cc853[_0xa20f('0x34')]=_0x4cc853[_0xa20f('0x34')]['length']?_0x4cc853[_0xa20f('0x34')]:_0x16bbea[_0xa20f('0x2e')];if(_0x218b2c[_0xa20f('0x30')]['includeAll']){_0x4cc853['include']=[{'all':!![]}];}_0x4cc853=_[_0xa20f('0x3e')]({},_0x4cc853,_0x218b2c[_0xa20f('0x45')]);return db[_0xa20f('0x2b')][_0xa20f('0x46')](_0x4cc853)[_0xa20f('0x25')](handleEntityNotFound(_0x76f2d4,null))[_0xa20f('0x25')](respondWithResult(_0x76f2d4,null))['catch'](handleError(_0x76f2d4,null));};exports[_0xa20f('0x47')]=function(_0x30fce6,_0x3c3443){return db[_0xa20f('0x2b')][_0xa20f('0x47')](_0x30fce6[_0xa20f('0x48')],{})[_0xa20f('0x25')](respondWithResult(_0x3c3443,0xc9))['catch'](handleError(_0x3c3443,null));};exports[_0xa20f('0x49')]=function(_0x2016f6,_0x102417){if(_0x2016f6[_0xa20f('0x48')]['id']){delete _0x2016f6[_0xa20f('0x48')]['id'];}return db[_0xa20f('0x2b')][_0xa20f('0x46')]({'where':{'id':_0x2016f6['params']['id']}})[_0xa20f('0x25')](handleEntityNotFound(_0x102417,null))[_0xa20f('0x25')](saveUpdates(_0x2016f6[_0xa20f('0x48')],null))['then'](respondWithResult(_0x102417,null))[_0xa20f('0x43')](handleError(_0x102417,null));};exports['destroy']=function(_0x269604,_0x512e46){return db['CloudProvider'][_0xa20f('0x46')]({'where':{'id':_0x269604[_0xa20f('0x44')]['id']}})[_0xa20f('0x25')](handleEntityNotFound(_0x512e46,null))['then'](removeEntity(_0x512e46,null))[_0xa20f('0x43')](handleError(_0x512e46,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 18d5755..1ff6a5e 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x610a=['cloud_providers','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x610a,0x12d));var _0xa610=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x610a[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa610('0x0'));var logger=require('../../config/logger')(_0xa610('0x1'));var moment=require(_0xa610('0x2'));var BPromise=require(_0xa610('0x3'));var rp=require(_0xa610('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa610('0x5'));var config=require(_0xa610('0x6'));var attributes=require(_0xa610('0x7'));module[_0xa610('0x8')]=function(_0x5e3adf,_0x1ff69a){return _0x5e3adf[_0xa610('0x9')](_0xa610('0xa'),attributes,{'tableName':_0xa610('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fae=['request-promise','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','util','../../config/logger','api','bluebird'];(function(_0x4729e5,_0x1187e8){var _0x4419bb=function(_0x2e471c){while(--_0x2e471c){_0x4729e5['push'](_0x4729e5['shift']());}};_0x4419bb(++_0x1187e8);}(_0x0fae,0xf8));var _0xe0fa=function(_0x2b3f29,_0x2be57d){_0x2b3f29=_0x2b3f29-0x0;var _0x2c1597=_0x0fae[_0x2b3f29];return _0x2c1597;};'use strict';var _=require('lodash');var util=require(_0xe0fa('0x0'));var logger=require(_0xe0fa('0x1'))(_0xe0fa('0x2'));var moment=require('moment');var BPromise=require(_0xe0fa('0x3'));var rp=require(_0xe0fa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0fa('0x5'));var config=require(_0xe0fa('0x6'));var attributes=require(_0xe0fa('0x7'));module['exports']=function(_0x4393b5,_0x21a55d){return _0x4393b5['define'](_0xe0fa('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 34e20ad..13d33c8 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7394=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x34a0a2,_0x6ab44b){var _0x51c94d=function(_0x372466){while(--_0x372466){_0x34a0a2['push'](_0x34a0a2['shift']());}};_0x51c94d(++_0x6ab44b);}(_0x7394,0xb9));var _0x4739=function(_0x9bfb45,_0x3f3c49){_0x9bfb45=_0x9bfb45-0x0;var _0x4cd01f=_0x7394[_0x9bfb45];return _0x4cd01f;};'use strict';var _=require(_0x4739('0x0'));var util=require(_0x4739('0x1'));var moment=require(_0x4739('0x2'));var BPromise=require(_0x4739('0x3'));var rs=require(_0x4739('0x4'));var fs=require('fs');var Redis=require(_0x4739('0x5'));var db=require(_0x4739('0x6'))['db'];var utils=require(_0x4739('0x7'));var logger=require(_0x4739('0x8'))('rpc');var config=require(_0x4739('0x9'));var jayson=require(_0x4739('0xa'));var client=jayson[_0x4739('0xb')][_0x4739('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c91ea,_0x276bd5,_0x589ed6){return new BPromise(function(_0x3f327e,_0x3eb6ca){return client['request'](_0x4c91ea,_0x589ed6)['then'](function(_0x1ccad4){logger[_0x4739('0xd')](_0x4739('0xe'),_0x276bd5,_0x4739('0xf'));logger[_0x4739('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x276bd5,_0x4739('0xf'),JSON[_0x4739('0x11')](_0x1ccad4));if(_0x1ccad4[_0x4739('0x12')]){if(_0x1ccad4[_0x4739('0x12')][_0x4739('0x13')]===0x1f4){logger[_0x4739('0x12')]('CloudProvider,\x20%s,\x20%s',_0x276bd5,_0x1ccad4[_0x4739('0x12')][_0x4739('0x14')]);return _0x3eb6ca(_0x1ccad4['error'][_0x4739('0x14')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x276bd5,_0x1ccad4[_0x4739('0x12')][_0x4739('0x14')]);return _0x3f327e(_0x1ccad4[_0x4739('0x12')][_0x4739('0x14')]);}else{logger[_0x4739('0xd')](_0x4739('0xe'),_0x276bd5,_0x4739('0xf'));_0x3f327e(_0x1ccad4['result'][_0x4739('0x14')]);}})[_0x4739('0x15')](function(_0x158d78){logger[_0x4739('0x12')]('CloudProvider,\x20%s,\x20%s',_0x276bd5,_0x158d78);_0x3eb6ca(_0x158d78);});});}
\ No newline at end of file
+var _0xcc3f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird'];(function(_0xafcc7b,_0x1f79e4){var _0x2de1c5=function(_0x564026){while(--_0x564026){_0xafcc7b['push'](_0xafcc7b['shift']());}};_0x2de1c5(++_0x1f79e4);}(_0xcc3f,0x18c));var _0xfcc3=function(_0x557d8d,_0x58fa41){_0x557d8d=_0x557d8d-0x0;var _0x456430=_0xcc3f[_0x557d8d];return _0x456430;};'use strict';var _=require(_0xfcc3('0x0'));var util=require(_0xfcc3('0x1'));var moment=require('moment');var BPromise=require(_0xfcc3('0x2'));var rs=require(_0xfcc3('0x3'));var fs=require('fs');var Redis=require(_0xfcc3('0x4'));var db=require(_0xfcc3('0x5'))['db'];var utils=require(_0xfcc3('0x6'));var logger=require(_0xfcc3('0x7'))(_0xfcc3('0x8'));var config=require('../../config/environment');var jayson=require(_0xfcc3('0x9'));var client=jayson[_0xfcc3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd966c8,_0xeaec02,_0x121370){return new BPromise(function(_0xd70b7d,_0x5ef157){return client['request'](_0xd966c8,_0x121370)['then'](function(_0x306917){logger[_0xfcc3('0xb')](_0xfcc3('0xc'),_0xeaec02,_0xfcc3('0xd'));logger['debug'](_0xfcc3('0xe'),_0xeaec02,'request\x20sent',JSON[_0xfcc3('0xf')](_0x306917));if(_0x306917[_0xfcc3('0x10')]){if(_0x306917[_0xfcc3('0x10')]['code']===0x1f4){logger[_0xfcc3('0x10')](_0xfcc3('0xc'),_0xeaec02,_0x306917[_0xfcc3('0x10')][_0xfcc3('0x11')]);return _0x5ef157(_0x306917[_0xfcc3('0x10')][_0xfcc3('0x11')]);}logger[_0xfcc3('0x10')]('CloudProvider,\x20%s,\x20%s',_0xeaec02,_0x306917[_0xfcc3('0x10')][_0xfcc3('0x11')]);return _0xd70b7d(_0x306917[_0xfcc3('0x10')]['message']);}else{logger[_0xfcc3('0xb')](_0xfcc3('0xc'),_0xeaec02,_0xfcc3('0xd'));_0xd70b7d(_0x306917[_0xfcc3('0x12')]['message']);}})['catch'](function(_0x2fdd48){logger[_0xfcc3('0x10')](_0xfcc3('0xc'),_0xeaec02,_0x2fdd48);_0x5ef157(_0x2fdd48);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index e253451..c8df668 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc81=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','index','/:id','isAuthenticated','show','create','put'];(function(_0x1f404a,_0x5088b2){var _0x2cdcd5=function(_0xe30d8c){while(--_0xe30d8c){_0x1f404a['push'](_0x1f404a['shift']());}};_0x2cdcd5(++_0x5088b2);}(_0xfc81,0x1df));var _0x1fc8=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xfc81[_0x49052b];return _0x48c045;};'use strict';var multer=require(_0x1fc8('0x0'));var util=require(_0x1fc8('0x1'));var path=require(_0x1fc8('0x2'));var timeout=require(_0x1fc8('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x1fc8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1fc8('0x5'));var controller=require(_0x1fc8('0x6'));router[_0x1fc8('0x7')]('/',auth['isAuthenticated'](),controller[_0x1fc8('0x8')]);router[_0x1fc8('0x7')](_0x1fc8('0x9'),auth[_0x1fc8('0xa')](),controller[_0x1fc8('0xb')]);router['post']('/',auth[_0x1fc8('0xa')](),controller[_0x1fc8('0xc')]);router[_0x1fc8('0xd')](_0x1fc8('0x9'),auth[_0x1fc8('0xa')](),controller['update']);router[_0x1fc8('0xe')](_0x1fc8('0x9'),auth[_0x1fc8('0xa')](),controller[_0x1fc8('0xf')]);module[_0x1fc8('0x10')]=router;
\ No newline at end of file
+var _0x8c6d=['exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','destroy'];(function(_0x58c9c8,_0x21090f){var _0x4c5e97=function(_0x43a556){while(--_0x43a556){_0x58c9c8['push'](_0x58c9c8['shift']());}};_0x4c5e97(++_0x21090f);}(_0x8c6d,0x1e1));var _0xd8c6=function(_0x2a234a,_0x1471b9){_0x2a234a=_0x2a234a-0x0;var _0x2fba34=_0x8c6d[_0x2a234a];return _0x2fba34;};'use strict';var multer=require(_0xd8c6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd8c6('0x1'));var express=require(_0xd8c6('0x2'));var router=express[_0xd8c6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd8c6('0x4'));var config=require(_0xd8c6('0x5'));var controller=require(_0xd8c6('0x6'));router[_0xd8c6('0x7')]('/',auth[_0xd8c6('0x8')](),controller[_0xd8c6('0x9')]);router['get'](_0xd8c6('0xa'),auth[_0xd8c6('0x8')](),controller[_0xd8c6('0xb')]);router[_0xd8c6('0xc')]('/',auth['isAuthenticated'](),controller[_0xd8c6('0xd')]);router['put']('/:id',auth[_0xd8c6('0x8')](),controller['update']);router['delete'](_0xd8c6('0xa'),auth[_0xd8c6('0x8')](),controller[_0xd8c6('0xe')]);module[_0xd8c6('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 839cb8f..ed59986 100644
--- a/server/api/cmCompany/cmCompany.attributes.js
+++ b/server/api/cmCompany/cmCompany.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1fda=['STRING','name','sequelize','exports'];(function(_0x554579,_0x342b8d){var _0x214575=function(_0x506fd1){while(--_0x506fd1){_0x554579['push'](_0x554579['shift']());}};_0x214575(++_0x342b8d);}(_0x1fda,0x1d2));var _0xa1fd=function(_0x1f8eb8,_0xfc4345){_0x1f8eb8=_0x1f8eb8-0x0;var _0x37ca05=_0x1fda[_0x1f8eb8];return _0x37ca05;};'use strict';var Sequelize=require(_0xa1fd('0x0'));module[_0xa1fd('0x1')]={'name':{'type':Sequelize[_0xa1fd('0x2')],'unique':_0xa1fd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa1fd('0x2')]},'companyId':{'type':Sequelize[_0xa1fd('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa1fd('0x2')]},'fax':{'type':Sequelize[_0xa1fd('0x2')]},'type':{'type':Sequelize[_0xa1fd('0x2')]},'street':{'type':Sequelize[_0xa1fd('0x2')]},'postalCode':{'type':Sequelize[_0xa1fd('0x2')]},'city':{'type':Sequelize[_0xa1fd('0x2')]},'country':{'type':Sequelize[_0xa1fd('0x2')]},'email':{'type':Sequelize[_0xa1fd('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xa1fd('0x2')]},'sPostalCode':{'type':Sequelize[_0xa1fd('0x2')]},'sCity':{'type':Sequelize[_0xa1fd('0x2')]},'sCountry':{'type':Sequelize[_0xa1fd('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa0b5=['sequelize','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa0b5,0xa2));var _0x5a0b=function(_0x2c7144,_0x1869e8){_0x2c7144=_0x2c7144-0x0;var _0x382698=_0xa0b5[_0x2c7144];return _0x382698;};'use strict';var Sequelize=require(_0x5a0b('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a0b('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x5a0b('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x5a0b('0x1')]},'type':{'type':Sequelize[_0x5a0b('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5a0b('0x1')]},'city':{'type':Sequelize[_0x5a0b('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5a0b('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5a0b('0x1')]},'sStreet':{'type':Sequelize[_0x5a0b('0x1')]},'sPostalCode':{'type':Sequelize[_0x5a0b('0x1')]},'sCity':{'type':Sequelize[_0x5a0b('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5a0b('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index e548b68..f74cccf 100644
--- a/server/api/cmCompany/cmCompany.controller.js
+++ b/server/api/cmCompany/cmCompany.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a0c=['findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','map','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','end','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll'];(function(_0x9e3d8c,_0x463816){var _0x2ad47e=function(_0x129f7f){while(--_0x129f7f){_0x9e3d8c['push'](_0x9e3d8c['shift']());}};_0x2ad47e(++_0x463816);}(_0x4a0c,0x1cc));var _0xc4a0=function(_0xbd6a7f,_0x2a4a6a){_0xbd6a7f=_0xbd6a7f-0x0;var _0xd66166=_0x4a0c[_0xbd6a7f];return _0xd66166;};'use strict';var pdf=require(_0xc4a0('0x0'));var emlformat=require(_0xc4a0('0x1'));var rimraf=require(_0xc4a0('0x2'));var zipdir=require(_0xc4a0('0x3'));var jsonpatch=require(_0xc4a0('0x4'));var rp=require(_0xc4a0('0x5'));var moment=require(_0xc4a0('0x6'));var BPromise=require(_0xc4a0('0x7'));var Mustache=require(_0xc4a0('0x8'));var util=require(_0xc4a0('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xc4a0('0xa'));var ejs=require(_0xc4a0('0xb'));var fs=require('fs');var _=require(_0xc4a0('0xc'));var squel=require(_0xc4a0('0xd'));var crypto=require('crypto');var jsforce=require(_0xc4a0('0xe'));var deskjs=require(_0xc4a0('0xf'));var toCsv=require(_0xc4a0('0xa'));var querystring=require(_0xc4a0('0x10'));var Papa=require(_0xc4a0('0x11'));var Redis=require(_0xc4a0('0x12'));var authService=require(_0xc4a0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc4a0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc4a0('0x15'))(_0xc4a0('0x16'));var utils=require('../../config/utils');var config=require(_0xc4a0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x239a75,_0x381d61){_0x381d61=_0x381d61||0xcc;return function(_0x18df22){if(_0x18df22){return _0x239a75['sendStatus'](_0x381d61);}return _0x239a75['status'](_0x381d61)[_0xc4a0('0x18')]();};}function respondWithResult(_0x5ef7ad,_0x5f5877){_0x5f5877=_0x5f5877||0xc8;return function(_0x433cb5){if(_0x433cb5){return _0x5ef7ad[_0xc4a0('0x19')](_0x5f5877)[_0xc4a0('0x1a')](_0x433cb5);}};}function respondWithFilteredResult(_0xce9705,_0x582aa3){return function(_0x38a14b){if(_0x38a14b){var _0x4d9aab=_0x38a14b[_0xc4a0('0x1b')],_0x3a2ee4=_0x582aa3[_0xc4a0('0x1c')],_0x1942b5=_0x582aa3['offset']+_0x582aa3[_0xc4a0('0x1d')],_0x520f92;if(_0x1942b5>=_0x4d9aab){_0x1942b5=_0x4d9aab;_0x520f92=0xc8;}else{_0x520f92=0xce;}_0xce9705[_0xc4a0('0x19')](_0x520f92);return _0xce9705['set'](_0xc4a0('0x1e'),_0x3a2ee4+'-'+_0x1942b5+'/'+_0x4d9aab)[_0xc4a0('0x1a')](_0x38a14b);}return null;};}function patchUpdates(_0x50fd07){return function(_0x1bba3b){try{jsonpatch[_0xc4a0('0x1f')](_0x1bba3b,_0x50fd07,!![]);}catch(_0x2b37ca){return BPromise['reject'](_0x2b37ca);}return _0x1bba3b['save']();};}function saveUpdates(_0x301c41,_0x4085a0){return function(_0x2d7260){if(_0x2d7260){return _0x2d7260[_0xc4a0('0x20')](_0x301c41)[_0xc4a0('0x21')](function(_0x5ad01c){return _0x5ad01c;});}return null;};}function removeEntity(_0xcbd1ba,_0x56b4e5){return function(_0x3d008f){if(_0x3d008f){return _0x3d008f[_0xc4a0('0x22')]()[_0xc4a0('0x21')](function(){var _0x3e9436=_0x3d008f[_0xc4a0('0x23')]({'plain':!![]});var _0x16b13c='Companies';return db[_0xc4a0('0x24')][_0xc4a0('0x22')]({'where':{'type':_0x16b13c,'resourceId':_0x3e9436['id']}})['then'](function(){return _0x3d008f;});})['then'](function(){_0xcbd1ba[_0xc4a0('0x19')](0xcc)[_0xc4a0('0x18')]();});}};}function handleEntityNotFound(_0x4177c9,_0x280836){return function(_0x33aa87){if(!_0x33aa87){_0x4177c9[_0xc4a0('0x25')](0x194);}return _0x33aa87;};}function handleError(_0x4a5d0a,_0x4dd2a3){_0x4dd2a3=_0x4dd2a3||0x1f4;return function(_0x22dd72){logger[_0xc4a0('0x26')](_0x22dd72[_0xc4a0('0x27')]);if(_0x22dd72[_0xc4a0('0x28')]){delete _0x22dd72[_0xc4a0('0x28')];}_0x4a5d0a[_0xc4a0('0x19')](_0x4dd2a3)[_0xc4a0('0x29')](_0x22dd72);};}exports[_0xc4a0('0x2a')]=function(_0x5cea1d,_0x4a0b5c){var _0xf6ac70={},_0x2bd692={},_0x3d59c1={'count':0x0,'rows':[]};return db[_0xc4a0('0x2b')][_0xc4a0('0x2c')]()[_0xc4a0('0x21')](function(_0x4f62c3){_0x2bd692[_0xc4a0('0x2d')]=_[_0xc4a0('0x2e')](_0x4f62c3);_0x2bd692[_0xc4a0('0x2f')]=_[_0xc4a0('0x2e')](_0x5cea1d[_0xc4a0('0x2f')]);_0x2bd692[_0xc4a0('0x30')]=_[_0xc4a0('0x31')](_0x2bd692[_0xc4a0('0x2d')],_0x2bd692[_0xc4a0('0x2f')]);_0xf6ac70[_0xc4a0('0x32')]=_[_0xc4a0('0x31')](_0x2bd692[_0xc4a0('0x2d')],qs[_0xc4a0('0x33')](_0x5cea1d[_0xc4a0('0x2f')]['fields']));_0xf6ac70[_0xc4a0('0x32')]=_0xf6ac70[_0xc4a0('0x32')][_0xc4a0('0x34')]?_0xf6ac70['attributes']:_0x2bd692[_0xc4a0('0x2d')];if(!_0x5cea1d['query'][_0xc4a0('0x35')](_0xc4a0('0x36'))){_0xf6ac70[_0xc4a0('0x1d')]=qs['limit'](_0x5cea1d[_0xc4a0('0x2f')]['limit']);_0xf6ac70['offset']=qs[_0xc4a0('0x1c')](_0x5cea1d[_0xc4a0('0x2f')][_0xc4a0('0x1c')]);}_0xf6ac70['order']=qs['sort'](_0x5cea1d[_0xc4a0('0x2f')][_0xc4a0('0x37')]);_0xf6ac70[_0xc4a0('0x38')]=qs[_0xc4a0('0x30')](_[_0xc4a0('0x39')](_0x5cea1d[_0xc4a0('0x2f')],_0x2bd692[_0xc4a0('0x30')]),_0x4f62c3);if(_0x5cea1d[_0xc4a0('0x2f')][_0xc4a0('0x3a')]){_0xf6ac70[_0xc4a0('0x38')]=_[_0xc4a0('0x3b')](_0xf6ac70[_0xc4a0('0x38')],{'$or':_['map'](_0xf6ac70['attributes'],function(_0xae913e){var _0x5999eb={};_0x5999eb[_0xae913e]={'$like':'%'+_0x5cea1d[_0xc4a0('0x2f')][_0xc4a0('0x3a')]+'%'};return _0x5999eb;})});}_0xf6ac70=_['merge']({},_0xf6ac70,_0x5cea1d[_0xc4a0('0x3c')]);var _0xf9397b={'where':_0xf6ac70[_0xc4a0('0x38')]};return db['CmCompany'][_0xc4a0('0x1b')](_0xf9397b)[_0xc4a0('0x21')](function(_0x1a3f22){_0x3d59c1[_0xc4a0('0x1b')]=_0x1a3f22;if(_0x5cea1d[_0xc4a0('0x2f')][_0xc4a0('0x3d')]){_0xf6ac70['include']=[{'all':!![]}];}return db[_0xc4a0('0x2b')][_0xc4a0('0x3e')](_0xf6ac70);})[_0xc4a0('0x21')](function(_0x3d4a13){_0x3d59c1[_0xc4a0('0x3f')]=_0x3d4a13;return _0x3d59c1;})[_0xc4a0('0x21')](respondWithFilteredResult(_0x4a0b5c,_0xf6ac70))[_0xc4a0('0x40')](handleError(_0x4a0b5c,null));})['catch'](handleError(_0x4a0b5c,null));};exports[_0xc4a0('0x41')]=function(_0x4fb8db,_0x2b97fd){var _0x5b4331={'raw':![],'where':{'id':_0x4fb8db[_0xc4a0('0x42')]['id']}},_0x865f24={};_0x865f24[_0xc4a0('0x2d')]=_[_0xc4a0('0x2e')](db['CmCompany'][_0xc4a0('0x43')]);_0x865f24['query']=_[_0xc4a0('0x2e')](_0x4fb8db['query']);_0x865f24[_0xc4a0('0x30')]=_[_0xc4a0('0x31')](_0x865f24[_0xc4a0('0x2d')],_0x865f24['query']);_0x5b4331[_0xc4a0('0x32')]=_['intersection'](_0x865f24[_0xc4a0('0x2d')],qs['fields'](_0x4fb8db['query']['fields']));_0x5b4331['attributes']=_0x5b4331[_0xc4a0('0x32')][_0xc4a0('0x34')]?_0x5b4331[_0xc4a0('0x32')]:_0x865f24[_0xc4a0('0x2d')];if(_0x4fb8db['query'][_0xc4a0('0x3d')]){_0x5b4331[_0xc4a0('0x44')]=[{'all':!![]}];}_0x5b4331=_[_0xc4a0('0x3b')]({},_0x5b4331,_0x4fb8db[_0xc4a0('0x3c')]);return db[_0xc4a0('0x2b')][_0xc4a0('0x45')](_0x5b4331)[_0xc4a0('0x21')](handleEntityNotFound(_0x2b97fd,null))[_0xc4a0('0x21')](respondWithResult(_0x2b97fd,null))[_0xc4a0('0x40')](handleError(_0x2b97fd,null));};exports['create']=function(_0x356b17,_0x2547d6){return db[_0xc4a0('0x2b')][_0xc4a0('0x46')](_0x356b17[_0xc4a0('0x47')],{})[_0xc4a0('0x21')](function(_0x550a5a){var _0x3ec15c=_0x356b17[_0xc4a0('0x48')][_0xc4a0('0x23')]({'plain':!![]});if(!_0x3ec15c)throw new Error(_0xc4a0('0x49'));if(_0x3ec15c[_0xc4a0('0x4a')]===_0xc4a0('0x48')){var _0x530001=_0x550a5a[_0xc4a0('0x23')]({'plain':!![]});var _0x5e9ec6=_0xc4a0('0x4b');return db[_0xc4a0('0x4c')]['find']({'where':{'name':_0x5e9ec6,'userProfileId':_0x3ec15c[_0xc4a0('0x4d')]},'raw':!![]})['then'](function(_0xa7da3d){if(_0xa7da3d&&_0xa7da3d[_0xc4a0('0x4e')]===0x0){return db['UserProfileResource'][_0xc4a0('0x46')]({'name':_0x530001['name'],'resourceId':_0x530001['id'],'type':_0xa7da3d[_0xc4a0('0x28')],'sectionId':_0xa7da3d['id']},{})['then'](function(){return _0x550a5a;});}else{return _0x550a5a;}})[_0xc4a0('0x40')](function(_0x334abf){logger[_0xc4a0('0x26')](_0xc4a0('0x4f'),_0x334abf);throw _0x334abf;});}return _0x550a5a;})[_0xc4a0('0x21')](respondWithResult(_0x2547d6,0xc9))[_0xc4a0('0x40')](handleError(_0x2547d6,null));};exports[_0xc4a0('0x20')]=function(_0x135698,_0x16f4b3){if(_0x135698[_0xc4a0('0x47')]['id']){delete _0x135698[_0xc4a0('0x47')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x135698[_0xc4a0('0x42')]['id']}})[_0xc4a0('0x21')](handleEntityNotFound(_0x16f4b3,null))['then'](saveUpdates(_0x135698[_0xc4a0('0x47')],null))[_0xc4a0('0x21')](respondWithResult(_0x16f4b3,null))['catch'](handleError(_0x16f4b3,null));};exports[_0xc4a0('0x22')]=function(_0xba8075,_0x510fb0){return db[_0xc4a0('0x2b')][_0xc4a0('0x45')]({'where':{'id':_0xba8075[_0xc4a0('0x42')]['id']}})[_0xc4a0('0x21')](handleEntityNotFound(_0x510fb0,null))['then'](removeEntity(_0x510fb0,null))[_0xc4a0('0x40')](handleError(_0x510fb0,null));};exports[_0xc4a0('0x2c')]=function(_0xf23e49,_0x570f4f){return db[_0xc4a0('0x2b')]['describe']()[_0xc4a0('0x21')](respondWithResult(_0x570f4f,null))[_0xc4a0('0x40')](handleError(_0x570f4f,null));};exports[_0xc4a0('0x50')]=function(_0x429f9a,_0x4740bc,_0x498696){return db['CmContact']['find']({'where':{'id':_0x429f9a[_0xc4a0('0x42')]['id']}})[_0xc4a0('0x21')](handleEntityNotFound(_0x4740bc,null))[_0xc4a0('0x21')](function(_0x22b1f6){if(_0x22b1f6){return _0x22b1f6[_0xc4a0('0x50')](_0x429f9a['body'][_0xc4a0('0x51')],_[_0xc4a0('0x52')](_0x429f9a[_0xc4a0('0x47')],[_0xc4a0('0x51'),'id'])||{});}})[_0xc4a0('0x21')](respondWithResult(_0x4740bc,null))[_0xc4a0('0x40')](handleError(_0x4740bc,null));};exports[_0xc4a0('0x53')]=function(_0x3216cf,_0x4f9e48,_0x56032a){var _0x2bc569={};var _0x59d0f0={};var _0x5b14ad;var _0x4f49dd;return db[_0xc4a0('0x2b')][_0xc4a0('0x54')]({'where':{'id':_0x3216cf[_0xc4a0('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f9e48,null))[_0xc4a0('0x21')](function(_0x5d8a64){if(_0x5d8a64){_0x5b14ad=_0x5d8a64;_0x59d0f0['model']=_[_0xc4a0('0x2e')](db[_0xc4a0('0x55')][_0xc4a0('0x43')]);_0x59d0f0[_0xc4a0('0x2f')]=_['keys'](_0x3216cf[_0xc4a0('0x2f')]);_0x59d0f0[_0xc4a0('0x30')]=_[_0xc4a0('0x31')](_0x59d0f0['model'],_0x59d0f0[_0xc4a0('0x2f')]);_0x2bc569[_0xc4a0('0x32')]=_[_0xc4a0('0x31')](_0x59d0f0[_0xc4a0('0x2d')],qs[_0xc4a0('0x33')](_0x3216cf['query']['fields']));_0x2bc569[_0xc4a0('0x32')]=_0x2bc569[_0xc4a0('0x32')][_0xc4a0('0x34')]?_0x2bc569[_0xc4a0('0x32')]:_0x59d0f0[_0xc4a0('0x2d')];_0x2bc569['order']=qs[_0xc4a0('0x37')](_0x3216cf[_0xc4a0('0x2f')][_0xc4a0('0x37')]);_0x2bc569['where']=qs[_0xc4a0('0x30')](_[_0xc4a0('0x39')](_0x3216cf[_0xc4a0('0x2f')],_0x59d0f0[_0xc4a0('0x30')]));if(_0x3216cf['query']['filter']){_0x2bc569[_0xc4a0('0x38')]=_[_0xc4a0('0x3b')](_0x2bc569[_0xc4a0('0x38')],{'$or':_[_0xc4a0('0x56')](_0x2bc569[_0xc4a0('0x32')],function(_0x210d6a){var _0xf6f949={};_0xf6f949[_0x210d6a]={'$like':'%'+_0x3216cf[_0xc4a0('0x2f')][_0xc4a0('0x3a')]+'%'};return _0xf6f949;})});}_0x2bc569=_[_0xc4a0('0x3b')]({},_0x2bc569,_0x3216cf[_0xc4a0('0x3c')]);return _0x5b14ad[_0xc4a0('0x53')](_0x2bc569);}})[_0xc4a0('0x21')](function(_0x53312d){if(_0x53312d){_0x4f49dd=_0x53312d[_0xc4a0('0x34')];if(!_0x3216cf[_0xc4a0('0x2f')][_0xc4a0('0x35')](_0xc4a0('0x36'))){_0x2bc569[_0xc4a0('0x1d')]=qs['limit'](_0x3216cf[_0xc4a0('0x2f')][_0xc4a0('0x1d')]);_0x2bc569[_0xc4a0('0x1c')]=qs['offset'](_0x3216cf[_0xc4a0('0x2f')]['offset']);}return _0x5b14ad[_0xc4a0('0x53')](_0x2bc569);}})['then'](function(_0x54ab0d){if(_0x54ab0d){return _0x54ab0d?{'count':_0x4f49dd,'rows':_0x54ab0d}:null;}})[_0xc4a0('0x21')](respondWithResult(_0x4f9e48,null))[_0xc4a0('0x40')](handleError(_0x4f9e48,null));};
\ No newline at end of file
+var _0xd571=['nolimit','limit','order','pick','filter','where','merge','map','includeAll','include','findAll','catch','show','rawAttributes','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','params','addContacts','ids','getContacts','findOne','sort','hasOwnProperty','html-pdf','eml-format','rimraf','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','then','get','Companies','UserProfileResource','destroy','error','stack','name','send','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields'];(function(_0x196d3d,_0x4a6bc6){var _0x1129cc=function(_0x3d79df){while(--_0x3d79df){_0x196d3d['push'](_0x196d3d['shift']());}};_0x1129cc(++_0x4a6bc6);}(_0xd571,0xc0));var _0x1d57=function(_0x2a04cb,_0x27a583){_0x2a04cb=_0x2a04cb-0x0;var _0x5c8c94=_0xd571[_0x2a04cb];return _0x5c8c94;};'use strict';var pdf=require(_0x1d57('0x0'));var emlformat=require(_0x1d57('0x1'));var rimraf=require(_0x1d57('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d57('0x3'));var BPromise=require(_0x1d57('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1d57('0x5'));var sox=require(_0x1d57('0x6'));var csv=require('to-csv');var ejs=require(_0x1d57('0x7'));var fs=require('fs');var _=require(_0x1d57('0x8'));var squel=require(_0x1d57('0x9'));var crypto=require(_0x1d57('0xa'));var jsforce=require(_0x1d57('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1d57('0xc'));var querystring=require(_0x1d57('0xd'));var Papa=require(_0x1d57('0xe'));var Redis=require('ioredis');var authService=require(_0x1d57('0xf'));var qs=require(_0x1d57('0x10'));var as=require(_0x1d57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1d57('0x12'));var utils=require(_0x1d57('0x13'));var config=require(_0x1d57('0x14'));var db=require(_0x1d57('0x15'))['db'];function respondWithStatusCode(_0x5c21c5,_0x1f27aa){_0x1f27aa=_0x1f27aa||0xcc;return function(_0x5e8aac){if(_0x5e8aac){return _0x5c21c5[_0x1d57('0x16')](_0x1f27aa);}return _0x5c21c5[_0x1d57('0x17')](_0x1f27aa)[_0x1d57('0x18')]();};}function respondWithResult(_0x1569c1,_0x298710){_0x298710=_0x298710||0xc8;return function(_0x161891){if(_0x161891){return _0x1569c1['status'](_0x298710)['json'](_0x161891);}};}function respondWithFilteredResult(_0x7be5c3,_0x143531){return function(_0x390f33){if(_0x390f33){var _0x33ba06=_0x390f33[_0x1d57('0x19')],_0x33badf=_0x143531[_0x1d57('0x1a')],_0x199c00=_0x143531[_0x1d57('0x1a')]+_0x143531['limit'],_0x318c06;if(_0x199c00>=_0x33ba06){_0x199c00=_0x33ba06;_0x318c06=0xc8;}else{_0x318c06=0xce;}_0x7be5c3[_0x1d57('0x17')](_0x318c06);return _0x7be5c3[_0x1d57('0x1b')](_0x1d57('0x1c'),_0x33badf+'-'+_0x199c00+'/'+_0x33ba06)[_0x1d57('0x1d')](_0x390f33);}return null;};}function patchUpdates(_0x2c2d21){return function(_0x69d4dd){try{jsonpatch['apply'](_0x69d4dd,_0x2c2d21,!![]);}catch(_0x22993d){return BPromise[_0x1d57('0x1e')](_0x22993d);}return _0x69d4dd[_0x1d57('0x1f')]();};}function saveUpdates(_0x351b73,_0x410cc7){return function(_0x18b958){if(_0x18b958){return _0x18b958[_0x1d57('0x20')](_0x351b73)[_0x1d57('0x21')](function(_0xcbaccb){return _0xcbaccb;});}return null;};}function removeEntity(_0x30592d,_0x24713a){return function(_0x22e114){if(_0x22e114){return _0x22e114['destroy']()[_0x1d57('0x21')](function(){var _0xdee75e=_0x22e114[_0x1d57('0x22')]({'plain':!![]});var _0x2c1d5b=_0x1d57('0x23');return db[_0x1d57('0x24')][_0x1d57('0x25')]({'where':{'type':_0x2c1d5b,'resourceId':_0xdee75e['id']}})[_0x1d57('0x21')](function(){return _0x22e114;});})[_0x1d57('0x21')](function(){_0x30592d[_0x1d57('0x17')](0xcc)[_0x1d57('0x18')]();});}};}function handleEntityNotFound(_0x5ec0af,_0x46aa48){return function(_0x554616){if(!_0x554616){_0x5ec0af[_0x1d57('0x16')](0x194);}return _0x554616;};}function handleError(_0x19a140,_0xa428f7){_0xa428f7=_0xa428f7||0x1f4;return function(_0x195793){logger[_0x1d57('0x26')](_0x195793[_0x1d57('0x27')]);if(_0x195793[_0x1d57('0x28')]){delete _0x195793[_0x1d57('0x28')];}_0x19a140[_0x1d57('0x17')](_0xa428f7)[_0x1d57('0x29')](_0x195793);};}exports['index']=function(_0x3ab255,_0x2e3c37){var _0x26a85b={},_0x49d0db={},_0x4298e0={'count':0x0,'rows':[]};return db[_0x1d57('0x2a')][_0x1d57('0x2b')]()[_0x1d57('0x21')](function(_0x1122a8){_0x49d0db[_0x1d57('0x2c')]=_[_0x1d57('0x2d')](_0x1122a8);_0x49d0db['query']=_[_0x1d57('0x2d')](_0x3ab255[_0x1d57('0x2e')]);_0x49d0db[_0x1d57('0x2f')]=_[_0x1d57('0x30')](_0x49d0db[_0x1d57('0x2c')],_0x49d0db[_0x1d57('0x2e')]);_0x26a85b[_0x1d57('0x31')]=_['intersection'](_0x49d0db['model'],qs[_0x1d57('0x32')](_0x3ab255['query']['fields']));_0x26a85b[_0x1d57('0x31')]=_0x26a85b[_0x1d57('0x31')]['length']?_0x26a85b[_0x1d57('0x31')]:_0x49d0db[_0x1d57('0x2c')];if(!_0x3ab255[_0x1d57('0x2e')]['hasOwnProperty'](_0x1d57('0x33'))){_0x26a85b[_0x1d57('0x34')]=qs[_0x1d57('0x34')](_0x3ab255['query']['limit']);_0x26a85b[_0x1d57('0x1a')]=qs[_0x1d57('0x1a')](_0x3ab255['query'][_0x1d57('0x1a')]);}_0x26a85b[_0x1d57('0x35')]=qs['sort'](_0x3ab255[_0x1d57('0x2e')]['sort']);_0x26a85b['where']=qs['filters'](_[_0x1d57('0x36')](_0x3ab255['query'],_0x49d0db[_0x1d57('0x2f')]),_0x1122a8);if(_0x3ab255[_0x1d57('0x2e')][_0x1d57('0x37')]){_0x26a85b[_0x1d57('0x38')]=_[_0x1d57('0x39')](_0x26a85b[_0x1d57('0x38')],{'$or':_[_0x1d57('0x3a')](_0x26a85b['attributes'],function(_0x2c5170){var _0x254c66={};_0x254c66[_0x2c5170]={'$like':'%'+_0x3ab255[_0x1d57('0x2e')][_0x1d57('0x37')]+'%'};return _0x254c66;})});}_0x26a85b=_['merge']({},_0x26a85b,_0x3ab255['options']);var _0xfcd2a7={'where':_0x26a85b[_0x1d57('0x38')]};return db[_0x1d57('0x2a')][_0x1d57('0x19')](_0xfcd2a7)['then'](function(_0x5f0596){_0x4298e0[_0x1d57('0x19')]=_0x5f0596;if(_0x3ab255[_0x1d57('0x2e')][_0x1d57('0x3b')]){_0x26a85b[_0x1d57('0x3c')]=[{'all':!![]}];}return db[_0x1d57('0x2a')][_0x1d57('0x3d')](_0x26a85b);})[_0x1d57('0x21')](function(_0x172644){_0x4298e0['rows']=_0x172644;return _0x4298e0;})[_0x1d57('0x21')](respondWithFilteredResult(_0x2e3c37,_0x26a85b))['catch'](handleError(_0x2e3c37,null));})[_0x1d57('0x3e')](handleError(_0x2e3c37,null));};exports[_0x1d57('0x3f')]=function(_0x54f3de,_0x4a7cc){var _0x43606e={'raw':![],'where':{'id':_0x54f3de['params']['id']}},_0x539714={};_0x539714[_0x1d57('0x2c')]=_['keys'](db[_0x1d57('0x2a')][_0x1d57('0x40')]);_0x539714[_0x1d57('0x2e')]=_[_0x1d57('0x2d')](_0x54f3de['query']);_0x539714[_0x1d57('0x2f')]=_['intersection'](_0x539714['model'],_0x539714[_0x1d57('0x2e')]);_0x43606e['attributes']=_['intersection'](_0x539714[_0x1d57('0x2c')],qs[_0x1d57('0x32')](_0x54f3de[_0x1d57('0x2e')]['fields']));_0x43606e[_0x1d57('0x31')]=_0x43606e[_0x1d57('0x31')][_0x1d57('0x41')]?_0x43606e[_0x1d57('0x31')]:_0x539714[_0x1d57('0x2c')];if(_0x54f3de[_0x1d57('0x2e')][_0x1d57('0x3b')]){_0x43606e[_0x1d57('0x3c')]=[{'all':!![]}];}_0x43606e=_[_0x1d57('0x39')]({},_0x43606e,_0x54f3de[_0x1d57('0x42')]);return db[_0x1d57('0x2a')][_0x1d57('0x43')](_0x43606e)[_0x1d57('0x21')](handleEntityNotFound(_0x4a7cc,null))[_0x1d57('0x21')](respondWithResult(_0x4a7cc,null))['catch'](handleError(_0x4a7cc,null));};exports['create']=function(_0x2e4873,_0x1da85c){return db[_0x1d57('0x2a')][_0x1d57('0x44')](_0x2e4873[_0x1d57('0x45')],{})[_0x1d57('0x21')](function(_0x582677){var _0x4b40f0=_0x2e4873[_0x1d57('0x46')][_0x1d57('0x22')]({'plain':!![]});if(!_0x4b40f0)throw new Error(_0x1d57('0x47'));if(_0x4b40f0['role']==='user'){var _0x43190c=_0x582677[_0x1d57('0x22')]({'plain':!![]});var _0x4f2762='Companies';return db['UserProfileSection'][_0x1d57('0x43')]({'where':{'name':_0x4f2762,'userProfileId':_0x4b40f0[_0x1d57('0x48')]},'raw':!![]})[_0x1d57('0x21')](function(_0x575629){if(_0x575629&&_0x575629[_0x1d57('0x49')]===0x0){return db['UserProfileResource'][_0x1d57('0x44')]({'name':_0x43190c[_0x1d57('0x28')],'resourceId':_0x43190c['id'],'type':_0x575629['name'],'sectionId':_0x575629['id']},{})[_0x1d57('0x21')](function(){return _0x582677;});}else{return _0x582677;}})['catch'](function(_0x1331c3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1331c3);throw _0x1331c3;});}return _0x582677;})[_0x1d57('0x21')](respondWithResult(_0x1da85c,0xc9))[_0x1d57('0x3e')](handleError(_0x1da85c,null));};exports['update']=function(_0x5e66e3,_0x497dc2){if(_0x5e66e3[_0x1d57('0x45')]['id']){delete _0x5e66e3['body']['id'];}return db['CmCompany'][_0x1d57('0x43')]({'where':{'id':_0x5e66e3[_0x1d57('0x4a')]['id']}})[_0x1d57('0x21')](handleEntityNotFound(_0x497dc2,null))[_0x1d57('0x21')](saveUpdates(_0x5e66e3['body'],null))[_0x1d57('0x21')](respondWithResult(_0x497dc2,null))[_0x1d57('0x3e')](handleError(_0x497dc2,null));};exports[_0x1d57('0x25')]=function(_0x4f8f07,_0x1dddc7){return db[_0x1d57('0x2a')]['find']({'where':{'id':_0x4f8f07['params']['id']}})[_0x1d57('0x21')](handleEntityNotFound(_0x1dddc7,null))['then'](removeEntity(_0x1dddc7,null))[_0x1d57('0x3e')](handleError(_0x1dddc7,null));};exports[_0x1d57('0x2b')]=function(_0x22bc56,_0x599b9b){return db[_0x1d57('0x2a')][_0x1d57('0x2b')]()[_0x1d57('0x21')](respondWithResult(_0x599b9b,null))['catch'](handleError(_0x599b9b,null));};exports[_0x1d57('0x4b')]=function(_0x4a0e26,_0x6b55ed,_0x14e4c7){return db['CmContact']['find']({'where':{'id':_0x4a0e26[_0x1d57('0x4a')]['id']}})[_0x1d57('0x21')](handleEntityNotFound(_0x6b55ed,null))[_0x1d57('0x21')](function(_0x3915b9){if(_0x3915b9){return _0x3915b9[_0x1d57('0x4b')](_0x4a0e26[_0x1d57('0x45')]['ids'],_['omit'](_0x4a0e26[_0x1d57('0x45')],[_0x1d57('0x4c'),'id'])||{});}})[_0x1d57('0x21')](respondWithResult(_0x6b55ed,null))['catch'](handleError(_0x6b55ed,null));};exports[_0x1d57('0x4d')]=function(_0x58eae5,_0xf5fbc3,_0x533918){var _0x11dd99={};var _0x2adf1a={};var _0x1ef07a;var _0x3b5251;return db[_0x1d57('0x2a')][_0x1d57('0x4e')]({'where':{'id':_0x58eae5[_0x1d57('0x4a')]['id']}})[_0x1d57('0x21')](handleEntityNotFound(_0xf5fbc3,null))['then'](function(_0x4d3296){if(_0x4d3296){_0x1ef07a=_0x4d3296;_0x2adf1a[_0x1d57('0x2c')]=_[_0x1d57('0x2d')](db['CmContact'][_0x1d57('0x40')]);_0x2adf1a[_0x1d57('0x2e')]=_['keys'](_0x58eae5[_0x1d57('0x2e')]);_0x2adf1a[_0x1d57('0x2f')]=_[_0x1d57('0x30')](_0x2adf1a[_0x1d57('0x2c')],_0x2adf1a[_0x1d57('0x2e')]);_0x11dd99['attributes']=_[_0x1d57('0x30')](_0x2adf1a['model'],qs[_0x1d57('0x32')](_0x58eae5[_0x1d57('0x2e')][_0x1d57('0x32')]));_0x11dd99[_0x1d57('0x31')]=_0x11dd99[_0x1d57('0x31')][_0x1d57('0x41')]?_0x11dd99['attributes']:_0x2adf1a[_0x1d57('0x2c')];_0x11dd99['order']=qs[_0x1d57('0x4f')](_0x58eae5[_0x1d57('0x2e')][_0x1d57('0x4f')]);_0x11dd99[_0x1d57('0x38')]=qs[_0x1d57('0x2f')](_[_0x1d57('0x36')](_0x58eae5[_0x1d57('0x2e')],_0x2adf1a[_0x1d57('0x2f')]));if(_0x58eae5['query']['filter']){_0x11dd99[_0x1d57('0x38')]=_[_0x1d57('0x39')](_0x11dd99[_0x1d57('0x38')],{'$or':_[_0x1d57('0x3a')](_0x11dd99[_0x1d57('0x31')],function(_0x139d26){var _0x40c4b2={};_0x40c4b2[_0x139d26]={'$like':'%'+_0x58eae5[_0x1d57('0x2e')][_0x1d57('0x37')]+'%'};return _0x40c4b2;})});}_0x11dd99=_['merge']({},_0x11dd99,_0x58eae5[_0x1d57('0x42')]);return _0x1ef07a['getContacts'](_0x11dd99);}})[_0x1d57('0x21')](function(_0xc87d45){if(_0xc87d45){_0x3b5251=_0xc87d45[_0x1d57('0x41')];if(!_0x58eae5['query'][_0x1d57('0x50')](_0x1d57('0x33'))){_0x11dd99[_0x1d57('0x34')]=qs[_0x1d57('0x34')](_0x58eae5[_0x1d57('0x2e')][_0x1d57('0x34')]);_0x11dd99[_0x1d57('0x1a')]=qs[_0x1d57('0x1a')](_0x58eae5[_0x1d57('0x2e')][_0x1d57('0x1a')]);}return _0x1ef07a[_0x1d57('0x4d')](_0x11dd99);}})[_0x1d57('0x21')](function(_0xa35a85){if(_0xa35a85){return _0xa35a85?{'count':_0x3b5251,'rows':_0xa35a85}:null;}})[_0x1d57('0x21')](respondWithResult(_0xf5fbc3,null))[_0x1d57('0x3e')](handleError(_0xf5fbc3,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 387b8f7..8e5bcd9 100644
--- a/server/api/cmCompany/cmCompany.model.js
+++ b/server/api/cmCompany/cmCompany.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08a0=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x59dc86,_0x34812a){var _0x37c79c=function(_0x2e838c){while(--_0x2e838c){_0x59dc86['push'](_0x59dc86['shift']());}};_0x37c79c(++_0x34812a);}(_0x08a0,0x9a));var _0x008a=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x08a0[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x008a('0x0'));var util=require(_0x008a('0x1'));var logger=require(_0x008a('0x2'))(_0x008a('0x3'));var moment=require(_0x008a('0x4'));var BPromise=require(_0x008a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x008a('0x6'));var rimraf=require(_0x008a('0x7'));var config=require(_0x008a('0x8'));var attributes=require('./cmCompany.attributes');module[_0x008a('0x9')]=function(_0x288789,_0x203736){return _0x288789[_0x008a('0xa')](_0x008a('0xb'),attributes,{'tableName':_0x008a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fd4=['../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x33fa9f,_0x2c0cd0){var _0x5e8496=function(_0x4a4185){while(--_0x4a4185){_0x33fa9f['push'](_0x33fa9f['shift']());}};_0x5e8496(++_0x2c0cd0);}(_0x0fd4,0x123));var _0x40fd=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x0fd4[_0x2dc96f];return _0xd012da;};'use strict';var _=require('lodash');var util=require(_0x40fd('0x0'));var logger=require(_0x40fd('0x1'))('api');var moment=require(_0x40fd('0x2'));var BPromise=require(_0x40fd('0x3'));var rp=require(_0x40fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x40fd('0x5'));var config=require(_0x40fd('0x6'));var attributes=require(_0x40fd('0x7'));module[_0x40fd('0x8')]=function(_0x1f36da,_0x18d5e0){return _0x1f36da['define'](_0x40fd('0x9'),attributes,{'tableName':_0x40fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 339518f..7e94abc 100644
--- a/server/api/cmCompany/cmCompany.rpc.js
+++ b/server/api/cmCompany/cmCompany.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x901d=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','error','code','CmCompany,\x20%s,\x20%s','message','result','catch'];(function(_0x56a756,_0xd33ea2){var _0x475344=function(_0x2c1419){while(--_0x2c1419){_0x56a756['push'](_0x56a756['shift']());}};_0x475344(++_0xd33ea2);}(_0x901d,0xb0));var _0xd901=function(_0x2311b1,_0x2ec25d){_0x2311b1=_0x2311b1-0x0;var _0x1ae21c=_0x901d[_0x2311b1];return _0x1ae21c;};'use strict';var _=require(_0xd901('0x0'));var util=require(_0xd901('0x1'));var moment=require(_0xd901('0x2'));var BPromise=require(_0xd901('0x3'));var rs=require(_0xd901('0x4'));var fs=require('fs');var Redis=require(_0xd901('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd901('0x6'));var logger=require(_0xd901('0x7'))(_0xd901('0x8'));var config=require(_0xd901('0x9'));var jayson=require(_0xd901('0xa'));var client=jayson[_0xd901('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a2b18,_0x3a228b,_0x52e7c8){return new BPromise(function(_0x536580,_0x36778c){return client['request'](_0x5a2b18,_0x52e7c8)[_0xd901('0xc')](function(_0x2e1741){logger[_0xd901('0xd')]('CmCompany,\x20%s,\x20%s',_0x3a228b,_0xd901('0xe'));logger[_0xd901('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3a228b,_0xd901('0xe'),JSON['stringify'](_0x2e1741));if(_0x2e1741[_0xd901('0x10')]){if(_0x2e1741[_0xd901('0x10')][_0xd901('0x11')]===0x1f4){logger['error'](_0xd901('0x12'),_0x3a228b,_0x2e1741[_0xd901('0x10')]['message']);return _0x36778c(_0x2e1741[_0xd901('0x10')][_0xd901('0x13')]);}logger[_0xd901('0x10')]('CmCompany,\x20%s,\x20%s',_0x3a228b,_0x2e1741['error'][_0xd901('0x13')]);return _0x536580(_0x2e1741[_0xd901('0x10')][_0xd901('0x13')]);}else{logger[_0xd901('0xd')]('CmCompany,\x20%s,\x20%s',_0x3a228b,'request\x20sent');_0x536580(_0x2e1741[_0xd901('0x14')][_0xd901('0x13')]);}})[_0xd901('0x15')](function(_0xf96f9c){logger[_0xd901('0x10')](_0xd901('0x12'),_0x3a228b,_0xf96f9c);_0x36778c(_0xf96f9c);});});}
\ No newline at end of file
+var _0x7222=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','lodash'];(function(_0xb38a96,_0xfeb8f0){var _0x1a362a=function(_0x57d24a){while(--_0x57d24a){_0xb38a96['push'](_0xb38a96['shift']());}};_0x1a362a(++_0xfeb8f0);}(_0x7222,0xdb));var _0x2722=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x7222[_0x1ed116];return _0x574066;};'use strict';var _=require(_0x2722('0x0'));var util=require(_0x2722('0x1'));var moment=require('moment');var BPromise=require(_0x2722('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2722('0x3'));var db=require(_0x2722('0x4'))['db'];var utils=require(_0x2722('0x5'));var logger=require(_0x2722('0x6'))('rpc');var config=require(_0x2722('0x7'));var jayson=require(_0x2722('0x8'));var client=jayson[_0x2722('0x9')][_0x2722('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a79f0,_0x7b610f,_0xba51c2){return new BPromise(function(_0x175324,_0x3c94c9){return client[_0x2722('0xb')](_0x2a79f0,_0xba51c2)[_0x2722('0xc')](function(_0x39c283){logger[_0x2722('0xd')]('CmCompany,\x20%s,\x20%s',_0x7b610f,_0x2722('0xe'));logger['debug'](_0x2722('0xf'),_0x7b610f,_0x2722('0xe'),JSON[_0x2722('0x10')](_0x39c283));if(_0x39c283[_0x2722('0x11')]){if(_0x39c283[_0x2722('0x11')][_0x2722('0x12')]===0x1f4){logger[_0x2722('0x11')](_0x2722('0x13'),_0x7b610f,_0x39c283[_0x2722('0x11')]['message']);return _0x3c94c9(_0x39c283[_0x2722('0x11')][_0x2722('0x14')]);}logger[_0x2722('0x11')](_0x2722('0x13'),_0x7b610f,_0x39c283[_0x2722('0x11')][_0x2722('0x14')]);return _0x175324(_0x39c283['error']['message']);}else{logger[_0x2722('0xd')](_0x2722('0x13'),_0x7b610f,_0x2722('0xe'));_0x175324(_0x39c283[_0x2722('0x15')]['message']);}})['catch'](function(_0x510ad3){logger['error'](_0x2722('0x13'),_0x7b610f,_0x510ad3);_0x3c94c9(_0x510ad3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index b6c9db0..74a968b 100644
--- a/server/api/cmCompany/index.js
+++ b/server/api/cmCompany/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','create','addContacts','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x177f2f,_0x1b814e){var _0x28a5c3=function(_0x3a3333){while(--_0x3a3333){_0x177f2f['push'](_0x177f2f['shift']());}};_0x28a5c3(++_0x1b814e);}(_0x008c,0x188));var _0xc008=function(_0x7b8a87,_0x2f2523){_0x7b8a87=_0x7b8a87-0x0;var _0x2131a1=_0x008c[_0x7b8a87];return _0x2131a1;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0x9')](_0xc008('0xf'),auth['isAuthenticated'](),controller['getContacts']);router['post']('/',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0xf'),auth[_0xc008('0xa')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')](_0xc008('0xe'),auth[_0xc008('0xa')](),controller[_0xc008('0x13')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x14')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','create','addContacts','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x485987,_0x270562){var _0xd95fd=function(_0x453cf3){while(--_0x453cf3){_0x485987['push'](_0x485987['shift']());}};_0xd95fd(++_0x270562);}(_0x008c,0x188));var _0xc008=function(_0x1fe8be,_0x5e7860){_0x1fe8be=_0x1fe8be-0x0;var _0x1449bb=_0x008c[_0x1fe8be];return _0x1449bb;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0x9')](_0xc008('0xf'),auth['isAuthenticated'](),controller['getContacts']);router['post']('/',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0xf'),auth[_0xc008('0xa')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')](_0xc008('0xe'),auth[_0xc008('0xa')](),controller[_0xc008('0x13')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 656858b..fb23582 100644
--- a/server/api/cmContact/cmContact.attributes.js
+++ b/server/api/cmContact/cmContact.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd84=['NOW','sequelize','exports','STRING','INTEGER','UNSIGNED'];(function(_0x1dd19f,_0x2648e6){var _0x437ac2=function(_0x37accd){while(--_0x37accd){_0x1dd19f['push'](_0x1dd19f['shift']());}};_0x437ac2(++_0x2648e6);}(_0xbd84,0xb5));var _0x4bd8=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xbd84[_0x243b59];return _0x3e1676;};'use strict';var _=require('lodash');var Sequelize=require(_0x4bd8('0x0'));module[_0x4bd8('0x1')]={'firstName':{'type':Sequelize[_0x4bd8('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4bd8('0x2')]},'street':{'type':Sequelize[_0x4bd8('0x2')]},'postalCode':{'type':Sequelize[_0x4bd8('0x2')]},'city':{'type':Sequelize[_0x4bd8('0x2')]},'country':{'type':Sequelize[_0x4bd8('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4bd8('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4bd8('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x4bd8('0x2')]},'facebook':{'type':Sequelize[_0x4bd8('0x2')]},'fb_data':{'type':Sequelize[_0x4bd8('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x4bd8('0x2')]},'viber':{'type':Sequelize[_0x4bd8('0x2')]},'line':{'type':Sequelize[_0x4bd8('0x2')]},'wechat':{'type':Sequelize[_0x4bd8('0x2')]},'telegram':{'type':Sequelize[_0x4bd8('0x2')]},'UserId':{'type':Sequelize[_0x4bd8('0x3')]},'priority':{'type':Sequelize[_0x4bd8('0x3')](0x2)[_0x4bd8('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x4bd8('0x5')]},'dialTimezone':{'type':Sequelize[_0x4bd8('0x2')]},'utcOffset':{'type':Sequelize[_0x4bd8('0x3')]}};
\ No newline at end of file
+var _0xba88=['STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize','exports'];(function(_0x26a44e,_0x18c43f){var _0x566fc4=function(_0x1fd0cb){while(--_0x1fd0cb){_0x26a44e['push'](_0x26a44e['shift']());}};_0x566fc4(++_0x18c43f);}(_0xba88,0xed));var _0x8ba8=function(_0x1e8ff2,_0x3d761b){_0x1e8ff2=_0x1e8ff2-0x0;var _0x2e1513=_0xba88[_0x1e8ff2];return _0x2e1513;};'use strict';var _=require(_0x8ba8('0x0'));var Sequelize=require(_0x8ba8('0x1'));module[_0x8ba8('0x2')]={'firstName':{'type':Sequelize[_0x8ba8('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8ba8('0x3')]},'postalCode':{'type':Sequelize[_0x8ba8('0x3')]},'city':{'type':Sequelize[_0x8ba8('0x3')]},'country':{'type':Sequelize[_0x8ba8('0x3')]},'dateOfBirth':{'type':Sequelize[_0x8ba8('0x3')]},'description':{'type':Sequelize[_0x8ba8('0x4')]},'phone':{'type':Sequelize[_0x8ba8('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8ba8('0x3')]},'email':{'type':Sequelize[_0x8ba8('0x3')]},'url':{'type':Sequelize[_0x8ba8('0x3')]},'facebook':{'type':Sequelize[_0x8ba8('0x3')]},'fb_data':{'type':Sequelize[_0x8ba8('0x3')]},'twitter':{'type':Sequelize[_0x8ba8('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x8ba8('0x3')]},'viber':{'type':Sequelize[_0x8ba8('0x3')]},'line':{'type':Sequelize[_0x8ba8('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x8ba8('0x3')]},'UserId':{'type':Sequelize[_0x8ba8('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8ba8('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8ba8('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x8ba8('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index cda53e4..40a4e20 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4bb=['parse','meta','import','binding','No\x20phone\x20column\x20specified','../../components/import/cm/csv2','stringify','message','error\x20child\x20process','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','name','send','index','CmContact','length','keys','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','type','query','intersection','attributes','model','nolimit','sort','where','pick','filters','select','field','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','buildExpression','text','hasOwnProperty','filter','isNil','Contact','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','isEmpty','having','resolve','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','merge','fields','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','TagIds','Tags','rows','catch','describe','tags','columnName','findAll','displayName','alias','values','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','destroy','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','bulkCreate','each','duplicates','$or','ListId','error','params','cf_%d','$and','omit','pickBy','format','table','setFields','id\x20=\x20?','toParam','phone','getTags','Tag','options','setTags','ids','rawAttributes','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','binding_keys','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file'];(function(_0x109685,_0x444ba7){var _0x4c8b3c=function(_0x479393){while(--_0x479393){_0x109685['push'](_0x109685['shift']());}};_0x4c8b3c(++_0x444ba7);}(_0xd4bb,0xf5));var _0xbd4b=function(_0x21365c,_0x5403d1){_0x21365c=_0x21365c-0x0;var _0x1ce0a8=_0xd4bb[_0x21365c];return _0x1ce0a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd4b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd4b('0x2'));var moment=require(_0xbd4b('0x3'));var BPromise=require(_0xbd4b('0x4'));var Mustache=require(_0xbd4b('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbd4b('0x6'));var csv=require(_0xbd4b('0x7'));var ejs=require(_0xbd4b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbd4b('0x9'));var crypto=require(_0xbd4b('0xa'));var jsforce=require(_0xbd4b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbd4b('0x7'));var querystring=require(_0xbd4b('0xc'));var Papa=require('papaparse');var Redis=require(_0xbd4b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbd4b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd4b('0xf'))(_0xbd4b('0x10'));var utils=require('../../config/utils');var config=require(_0xbd4b('0x11'));var db=require(_0xbd4b('0x12'))['db'];config[_0xbd4b('0x13')]=_['defaults'](config[_0xbd4b('0x13')],{'host':_0xbd4b('0x14'),'port':0x18eb});var socket=require(_0xbd4b('0x15'))(new Redis(config[_0xbd4b('0x13')]));require(_0xbd4b('0x16'))[_0xbd4b('0x17')](socket);function respondWithStatusCode(_0x2485f1,_0x2fb022){_0x2fb022=_0x2fb022||0xcc;return function(_0x4fe294){if(_0x4fe294){return _0x2485f1['sendStatus'](_0x2fb022);}return _0x2485f1[_0xbd4b('0x18')](_0x2fb022)['end']();};}function respondWithResult(_0x1bcb4b,_0x3a436a){_0x3a436a=_0x3a436a||0xc8;return function(_0x2c8923){if(_0x2c8923){return _0x1bcb4b[_0xbd4b('0x18')](_0x3a436a)[_0xbd4b('0x19')](_0x2c8923);}};}function respondWithFilteredResult(_0xd6b84d,_0x4dc53c){return function(_0x18f498){if(_0x18f498){var _0x2611f4=_0x18f498[_0xbd4b('0x1a')],_0x225101=_0x4dc53c[_0xbd4b('0x1b')],_0x27bf3b=_0x4dc53c['offset']+_0x4dc53c[_0xbd4b('0x1c')],_0x53d1bc;if(_0x27bf3b>=_0x2611f4){_0x27bf3b=_0x2611f4;_0x53d1bc=0xc8;}else{_0x53d1bc=0xce;}_0xd6b84d[_0xbd4b('0x18')](_0x53d1bc);return _0xd6b84d[_0xbd4b('0x1d')](_0xbd4b('0x1e'),_0x225101+'-'+_0x27bf3b+'/'+_0x2611f4)['json'](_0x18f498);}return null;};}function patchUpdates(_0x4bf2af){return function(_0x324c8a){try{jsonpatch[_0xbd4b('0x1f')](_0x324c8a,_0x4bf2af,!![]);}catch(_0x37b2a2){return BPromise[_0xbd4b('0x20')](_0x37b2a2);}return _0x324c8a[_0xbd4b('0x21')]();};}function saveUpdates(_0x120212,_0x18e299){return function(_0x1aa0f5){if(_0x1aa0f5){return _0x1aa0f5[_0xbd4b('0x22')](_0x120212)[_0xbd4b('0x23')](function(_0x6ee0d9){return _0x6ee0d9;});}return null;};}function removeEntity(_0x1eb8ad,_0x2fbfe3){return function(_0x5e14cb){if(_0x5e14cb){return _0x5e14cb['destroy']()[_0xbd4b('0x23')](function(){_0x1eb8ad[_0xbd4b('0x18')](0xcc)[_0xbd4b('0x24')]();});}};}function handleEntityNotFound(_0x3e7fc3,_0x256a8b){return function(_0x42af66){if(!_0x42af66){_0x3e7fc3['sendStatus'](0x194);}return _0x42af66;};}function handleError(_0x20ccbb,_0x5237c2){_0x5237c2=_0x5237c2||0x1f4;return function(_0x1f4d53){logger['error'](_0x1f4d53['stack']);if(_0x1f4d53[_0xbd4b('0x25')]){delete _0x1f4d53['name'];}_0x20ccbb[_0xbd4b('0x18')](_0x5237c2)[_0xbd4b('0x26')](_0x1f4d53);};}exports[_0xbd4b('0x27')]=function(_0x42d5bd,_0x5b7d12){var _0x217101={},_0x285796={},_0x5d261a={'count':0x0,'rows':[]};return db[_0xbd4b('0x28')]['describe']()[_0xbd4b('0x23')](function(_0x1cf937){var _0x5c3b3c=[];for(var _0x2c5403=0x0;_0x2c54030x1){_0x1ca3b0['or'](_0xbd4b('0x65'),qs[_0xbd4b('0x66')](_0x5c8872),null);}else{if(qs[_0xbd4b('0x67')](_0x5c8872)){_0x1ca3b0['or']('c.id\x20LIKE\x20?',_0x5c8872+'%');_0x1ca3b0['or']('c.phone\x20LIKE\x20?',_0x5c8872+'%');_0x1ca3b0['or'](_0xbd4b('0x68'),_0x5c8872+'%');_0x1ca3b0['or'](_0xbd4b('0x69'),_0x5c8872+'%');}else if(qs[_0xbd4b('0x6a')](_0x5c8872)){_0x1ca3b0['or']('c.email\x20LIKE\x20?',_0x5c8872+'%');}else{_0x1ca3b0['or'](_0xbd4b('0x6b'),'%'+_0x5c8872+'%');_0x1ca3b0['or'](_0xbd4b('0x6c'),'%'+_0x5c8872+'%');_0x1ca3b0['or'](_0xbd4b('0x6d'),'%'+_0x5c8872+'%');}}}}_0x3a1da0['where'](_0x1ca3b0);_0x3a1da0[_0xbd4b('0x6e')](_0xbd4b('0x6f'));var _0x56d2c9={'type':db[_0xbd4b('0x70')][_0xbd4b('0x71')][_0xbd4b('0x72')],'raw':!![]};var _0xaf4769=_0x3a1da0[_0xbd4b('0x73')]()['field'](_0xbd4b('0x6f'));if(_0x217101[_0xbd4b('0x74')]){_0x217101[_0xbd4b('0x74')]['forEach'](function(_0xc3efb4){_0x3a1da0[_0xbd4b('0x74')]('c.'+_0xc3efb4[0x0],_0xc3efb4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xbd4b('0x75')](_0x398cb1)){_0x3a1da0[_0xbd4b('0x76')](_0x55b7e0);_0xaf4769[_0xbd4b('0x3a')]('t.id\x20IN\x20?',_0x398cb1);}BPromise[_0xbd4b('0x77')]()[_0xbd4b('0x23')](function(){if(_0x46205e&&!_['some'](_0x46205e[_0xbd4b('0x4c')],[_0xbd4b('0x3e'),_0xbd4b('0x54')])){return _0x42d5bd['user']['getLists']({'attributes':['id'],'raw':!![]})[_0xbd4b('0x23')](function(_0x5bec7c){if(_[_0xbd4b('0x75')](_0x5bec7c)){_0xaf4769[_0xbd4b('0x3a')](_0xbd4b('0x78'));_0x3a1da0[_0xbd4b('0x3a')](_0xbd4b('0x78'));}else{_0xaf4769[_0xbd4b('0x3a')](_0xbd4b('0x79'),_[_0xbd4b('0x50')](_0x5bec7c,'id'));_0x3a1da0[_0xbd4b('0x3a')]('c.ListId\x20IN\x20?',_[_0xbd4b('0x50')](_0x5bec7c,'id'));}});}else{return;}})['then'](function(){db[_0xbd4b('0x7a')][_0xbd4b('0x34')](_0xaf4769['toString'](),_0x56d2c9)[_0xbd4b('0x23')](function(_0x14607d){_0x5d261a[_0xbd4b('0x1a')]=_0x14607d[_0xbd4b('0x29')];if(_0x5d261a[_0xbd4b('0x1a')]===0x0)return[];return db['sequelize'][_0xbd4b('0x34')](_0x373e90[_0xbd4b('0x7b')](),_0x56d2c9);})['then'](function(_0x3ccfb7){_0x228a0f=_['keyBy'](_0x3ccfb7,'id');_0x56d2c9=_[_0xbd4b('0x7c')](_0x56d2c9,{'model':db[_0xbd4b('0x28')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x42d5bd[_0xbd4b('0x34')][_0xbd4b('0x7d')]){_0x217101[_0xbd4b('0x36')][_0xbd4b('0x51')](function(_0x242294){_0x3a1da0[_0xbd4b('0x3e')]('c.'+_0x242294);});}else{_0x3a1da0['field'](_0xbd4b('0x6f'));_0x3a1da0[_0xbd4b('0x3e')](_0xbd4b('0x7e'));_0x3a1da0['field'](_0xbd4b('0x7f'));_0x3a1da0[_0xbd4b('0x3e')](_0xbd4b('0x80'));_0x3a1da0[_0xbd4b('0x3e')](_0xbd4b('0x81'));_0x3a1da0[_0xbd4b('0x3e')](_0xbd4b('0x82'));_0x3a1da0[_0xbd4b('0x3e')](_0xbd4b('0x83'));_0x3a1da0[_0xbd4b('0x3e')](_0xbd4b('0x84'));_0x3a1da0[_0xbd4b('0x3e')](_0xbd4b('0x85'));_0x3a1da0[_0xbd4b('0x3e')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x217101[_0xbd4b('0x1c')])_0x3a1da0[_0xbd4b('0x1c')](_0x217101['limit']);if(_0x217101['offset'])_0x3a1da0[_0xbd4b('0x1b')](_0x217101['offset']);return db['sequelize']['query'](_0x3a1da0['toString'](),_0x56d2c9);})[_0xbd4b('0x23')](function(_0x353e45){_0x353e45[_0xbd4b('0x51')](function(_0x17b72e){if(_0x17b72e[_0xbd4b('0x86')]){_0x17b72e[_0xbd4b('0x87')]=[];_0x17b72e[_0xbd4b('0x86')][_0xbd4b('0x4f')](',')['forEach'](function(_0x28d299){_0x17b72e['Tags'][_0xbd4b('0x2d')](_0x228a0f[_0x28d299]);});}delete _0x17b72e[_0xbd4b('0x86')];});_0x5d261a[_0xbd4b('0x88')]=_0x353e45;return _0x5d261a;})[_0xbd4b('0x23')](respondWithFilteredResult(_0x5b7d12,_0x217101));});})[_0xbd4b('0x89')](handleError(_0x5b7d12,null));};exports['destroy']=function(_0x45bf4c,_0x1554bd){return db[_0xbd4b('0x28')][_0xbd4b('0x4d')]({'where':{'id':_0x45bf4c['params']['id']}})[_0xbd4b('0x23')](handleEntityNotFound(_0x1554bd,null))['then'](removeEntity(_0x1554bd,null))[_0xbd4b('0x89')](handleError(_0x1554bd,null));};exports[_0xbd4b('0x8a')]=function(_0x158953,_0x487d66){return db[_0xbd4b('0x28')][_0xbd4b('0x8a')]()[_0xbd4b('0x23')](function(_0x3ff56a){delete _0x3ff56a[_0xbd4b('0x8b')];for(var _0x5c91e2=0x0;_0x5c91e2=_0x223790){_0x5c8428=_0x223790;_0x2bb0fd=0xc8;}else{_0x2bb0fd=0xce;}_0x2932f4[_0x6c4a('0x17')](_0x2bb0fd);return _0x2932f4[_0x6c4a('0x1c')](_0x6c4a('0x1d'),_0x1a539a+'-'+_0x5c8428+'/'+_0x223790)[_0x6c4a('0x19')](_0x398b95);}return null;};}function patchUpdates(_0x59f29e){return function(_0xb26b3d){try{jsonpatch['apply'](_0xb26b3d,_0x59f29e,!![]);}catch(_0x43442f){return BPromise[_0x6c4a('0x1e')](_0x43442f);}return _0xb26b3d[_0x6c4a('0x1f')]();};}function saveUpdates(_0x5902fd,_0x2c472b){return function(_0x4573c8){if(_0x4573c8){return _0x4573c8[_0x6c4a('0x20')](_0x5902fd)[_0x6c4a('0x21')](function(_0x3024c6){return _0x3024c6;});}return null;};}function removeEntity(_0x174847,_0x6f4925){return function(_0x13341c){if(_0x13341c){return _0x13341c[_0x6c4a('0x22')]()[_0x6c4a('0x21')](function(){_0x174847[_0x6c4a('0x17')](0xcc)[_0x6c4a('0x18')]();});}};}function handleEntityNotFound(_0x4d7795,_0x44b8a2){return function(_0x27f7b5){if(!_0x27f7b5){_0x4d7795[_0x6c4a('0x16')](0x194);}return _0x27f7b5;};}function handleError(_0x17b908,_0x59b2ae){_0x59b2ae=_0x59b2ae||0x1f4;return function(_0x254fcf){logger[_0x6c4a('0x23')](_0x254fcf[_0x6c4a('0x24')]);if(_0x254fcf[_0x6c4a('0x25')]){delete _0x254fcf[_0x6c4a('0x25')];}_0x17b908['status'](_0x59b2ae)['send'](_0x254fcf);};}exports[_0x6c4a('0x26')]=function(_0xf00191,_0x4a1374){var _0xa4254f={},_0x22990b={},_0x557b6d={'count':0x0,'rows':[]};return db['CmContact'][_0x6c4a('0x27')]()[_0x6c4a('0x21')](function(_0x13d884){var _0xd98de8=[];for(var _0xe61dad=0x0;_0xe61dad0x1){_0x58459c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6c4a('0x5f')](_0x346990),null);}else{if(qs[_0x6c4a('0x60')](_0x346990)){_0x58459c['or'](_0x6c4a('0x61'),_0x346990+'%');_0x58459c['or']('c.phone\x20LIKE\x20?',_0x346990+'%');_0x58459c['or'](_0x6c4a('0x62'),_0x346990+'%');_0x58459c['or'](_0x6c4a('0x63'),_0x346990+'%');}else if(qs[_0x6c4a('0x64')](_0x346990)){_0x58459c['or']('c.email\x20LIKE\x20?',_0x346990+'%');}else{_0x58459c['or']('c.firstName\x20LIKE\x20?','%'+_0x346990+'%');_0x58459c['or']('c.lastName\x20LIKE\x20?','%'+_0x346990+'%');_0x58459c['or'](_0x6c4a('0x65'),'%'+_0x346990+'%');}}}}_0x163e62['where'](_0x58459c);_0x163e62[_0x6c4a('0x66')](_0x6c4a('0x67'));var _0x63eef8={'type':db[_0x6c4a('0x68')][_0x6c4a('0x69')]['SELECT'],'raw':!![]};var _0x214a61=_0x163e62[_0x6c4a('0x6a')]()[_0x6c4a('0x3c')](_0x6c4a('0x67'));if(_0xa4254f[_0x6c4a('0x38')]){_0xa4254f[_0x6c4a('0x38')][_0x6c4a('0x4a')](function(_0x37c654){_0x163e62[_0x6c4a('0x38')]('c.'+_0x37c654[0x0],_0x37c654[0x1]===_0x6c4a('0x6b')?![]:!![]);});}if(!_[_0x6c4a('0x6c')](_0x5ba3b8)){_0x163e62['having'](_0x4ef6a3);_0x214a61[_0x6c4a('0x3a')](_0x6c4a('0x6d'),_0x5ba3b8);}BPromise[_0x6c4a('0x6e')]()['then'](function(){if(_0x5f0a3b&&!_[_0x6c4a('0x6f')](_0x5f0a3b['conditions'],[_0x6c4a('0x3c'),'User'])){return _0xf00191[_0x6c4a('0x70')][_0x6c4a('0x71')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1c5977){if(_[_0x6c4a('0x6c')](_0x1c5977)){_0x214a61[_0x6c4a('0x3a')](_0x6c4a('0x72'));_0x163e62[_0x6c4a('0x3a')](_0x6c4a('0x72'));}else{_0x214a61[_0x6c4a('0x3a')](_0x6c4a('0x73'),_['map'](_0x1c5977,'id'));_0x163e62[_0x6c4a('0x3a')](_0x6c4a('0x73'),_['map'](_0x1c5977,'id'));}});}else{return;}})[_0x6c4a('0x21')](function(){db[_0x6c4a('0x74')][_0x6c4a('0x30')](_0x214a61[_0x6c4a('0x75')](),_0x63eef8)[_0x6c4a('0x21')](function(_0x24d750){_0x557b6d[_0x6c4a('0x1a')]=_0x24d750['length'];if(_0x557b6d[_0x6c4a('0x1a')]===0x0)return[];return db[_0x6c4a('0x74')][_0x6c4a('0x30')](_0x24d18d[_0x6c4a('0x75')](),_0x63eef8);})['then'](function(_0x146e50){_0xa336f5=_[_0x6c4a('0x76')](_0x146e50,'id');_0x63eef8=_[_0x6c4a('0x77')](_0x63eef8,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf00191[_0x6c4a('0x30')]['fields']){_0xa4254f[_0x6c4a('0x33')][_0x6c4a('0x4a')](function(_0xc068c2){_0x163e62[_0x6c4a('0x3c')]('c.'+_0xc068c2);});}else{_0x163e62['field'](_0x6c4a('0x67'));_0x163e62[_0x6c4a('0x3c')](_0x6c4a('0x78'));_0x163e62[_0x6c4a('0x3c')]('c.lastName');_0x163e62['field'](_0x6c4a('0x79'));_0x163e62[_0x6c4a('0x3c')](_0x6c4a('0x7a'));_0x163e62[_0x6c4a('0x3c')](_0x6c4a('0x7b'));_0x163e62[_0x6c4a('0x3c')](_0x6c4a('0x7c'));_0x163e62[_0x6c4a('0x3c')](_0x6c4a('0x7d'));_0x163e62[_0x6c4a('0x3c')](_0x6c4a('0x7e'));_0x163e62[_0x6c4a('0x3c')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xa4254f[_0x6c4a('0x37')])_0x163e62['limit'](_0xa4254f[_0x6c4a('0x37')]);if(_0xa4254f[_0x6c4a('0x1b')])_0x163e62[_0x6c4a('0x1b')](_0xa4254f[_0x6c4a('0x1b')]);return db['sequelize']['query'](_0x163e62[_0x6c4a('0x75')](),_0x63eef8);})[_0x6c4a('0x21')](function(_0x2f7908){_0x2f7908[_0x6c4a('0x4a')](function(_0x4e46cd){if(_0x4e46cd[_0x6c4a('0x7f')]){_0x4e46cd[_0x6c4a('0x80')]=[];_0x4e46cd[_0x6c4a('0x7f')][_0x6c4a('0x5e')](',')[_0x6c4a('0x4a')](function(_0x35a23f){_0x4e46cd[_0x6c4a('0x80')][_0x6c4a('0x57')](_0xa336f5[_0x35a23f]);});}delete _0x4e46cd[_0x6c4a('0x7f')];});_0x557b6d['rows']=_0x2f7908;return _0x557b6d;})[_0x6c4a('0x21')](respondWithFilteredResult(_0x4a1374,_0xa4254f));});})[_0x6c4a('0x81')](handleError(_0x4a1374,null));};exports[_0x6c4a('0x22')]=function(_0x27bdad,_0xd8f0e4){return db['CmContact']['find']({'where':{'id':_0x27bdad[_0x6c4a('0x82')]['id']}})[_0x6c4a('0x21')](handleEntityNotFound(_0xd8f0e4,null))[_0x6c4a('0x21')](removeEntity(_0xd8f0e4,null))[_0x6c4a('0x81')](handleError(_0xd8f0e4,null));};exports[_0x6c4a('0x27')]=function(_0x13c13a,_0x35062d){return db[_0x6c4a('0x83')][_0x6c4a('0x27')]()['then'](function(_0x13e553){delete _0x13e553['tags'];for(var _0x1b6ce4=0x0;_0x1b6ce4{}\s\\|]/g,'-');_0x2fc87c(null,util[_0x0a63('0x1d')](_0x0a63('0x1e'),path['basename'](_0x586190[_0x0a63('0x1b')],path['extname'](_0x586190[_0x0a63('0x1b')])),Date[_0x0a63('0x1f')](),path[_0x0a63('0x20')](_0x586190[_0x0a63('0x1b')])));}})});router[_0x0a63('0x14')](_0x0a63('0x21'),upload[_0x0a63('0x22')](_0x0a63('0x23')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55fb70,_0x4c8637,_0xeacfc9){_0xeacfc9(null,path['join'](config['root'],_0x0a63('0x24')));},'filename':function(_0x1d5448,_0x362d6a,_0x2e2526){_0x362d6a['originalname']=_0x362d6a[_0x0a63('0x1b')][_0x0a63('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2e2526(null,util[_0x0a63('0x1d')]('%s-%s%s',path[_0x0a63('0x25')](_0x362d6a[_0x0a63('0x1b')],path[_0x0a63('0x20')](_0x362d6a[_0x0a63('0x1b')])),Date[_0x0a63('0x1f')](),path[_0x0a63('0x20')](_0x362d6a[_0x0a63('0x1b')])));}})});router[_0x0a63('0x14')]('/upload',upload[_0x0a63('0x22')]('file'),controller[_0x0a63('0x26')]);router[_0x0a63('0x14')](_0x0a63('0x27'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x28')]);router['put'](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x29')]);router[_0x0a63('0x2a')]('/:id',auth[_0x0a63('0x7')](),controller[_0x0a63('0x2b')]);module['exports']=router;
\ No newline at end of file
+var _0xe14b=['/upload/:id','import','put','/:id','update','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/tags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','merge','create','/create_many','bulkCreate','setTags','join','root','server/files/tmp','originalname','replace','%s-%s%s','extname','/csv','file','diskStorage','format','basename','now','/upload','single','upload'];(function(_0x49776f,_0x24836b){var _0x2c48f4=function(_0x508cae){while(--_0x508cae){_0x49776f['push'](_0x49776f['shift']());}};_0x2c48f4(++_0x24836b);}(_0xe14b,0x93));var _0xbe14=function(_0x2115bd,_0x2d6047){_0x2115bd=_0x2115bd-0x0;var _0x3d36cd=_0xe14b[_0x2115bd];return _0x3d36cd;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./cmContact.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0x5')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller['getTags']);router['get'](_0xbe14('0xc'),auth[_0xbe14('0x6')](),controller['getHoppers']);router[_0xbe14('0x5')](_0xbe14('0xd'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0x5')](_0xbe14('0xf'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x10')]);router[_0xbe14('0x5')](_0xbe14('0x11'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x13')]('/merge',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x13')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x15')]);router['post'](_0xbe14('0x16'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x13')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x137ee5,_0x456ca8,_0x329588){_0x329588(null,path[_0xbe14('0x19')](config[_0xbe14('0x1a')],_0xbe14('0x1b')));},'filename':function(_0x59a9e3,_0x24f820,_0x4a1bbd){_0x24f820[_0xbe14('0x1c')]=_0x24f820[_0xbe14('0x1c')][_0xbe14('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4a1bbd(null,util['format'](_0xbe14('0x1e'),path['basename'](_0x24f820[_0xbe14('0x1c')],path['extname'](_0x24f820[_0xbe14('0x1c')])),Date['now'](),path[_0xbe14('0x1f')](_0x24f820[_0xbe14('0x1c')])));}})});router['post'](_0xbe14('0x20'),upload['single'](_0xbe14('0x21')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xbe14('0x22')]({'destination':function(_0x5fa043,_0x1ee9c1,_0x39cc81){_0x39cc81(null,path[_0xbe14('0x19')](config[_0xbe14('0x1a')],'server/files/tmp'));},'filename':function(_0x1822e0,_0x1ba46a,_0x391556){_0x1ba46a[_0xbe14('0x1c')]=_0x1ba46a['originalname'][_0xbe14('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x391556(null,util[_0xbe14('0x23')]('%s-%s%s',path[_0xbe14('0x24')](_0x1ba46a[_0xbe14('0x1c')],path[_0xbe14('0x1f')](_0x1ba46a[_0xbe14('0x1c')])),Date[_0xbe14('0x25')](),path[_0xbe14('0x1f')](_0x1ba46a[_0xbe14('0x1c')])));}})});router[_0xbe14('0x13')](_0xbe14('0x26'),upload[_0xbe14('0x27')](_0xbe14('0x21')),controller[_0xbe14('0x28')]);router[_0xbe14('0x13')](_0xbe14('0x29'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x2a')]);router[_0xbe14('0x2b')](_0xbe14('0x2c'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x2d')]);router['delete'](_0xbe14('0x2c'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe14('0x2e')]=router;
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js
index 94c5449..3a56e37 100644
--- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js
+++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf5a7=['INTEGER','PHONE','sequelize','exports','STRING'];(function(_0x2bfd0d,_0x367709){var _0x578620=function(_0x28c630){while(--_0x28c630){_0x2bfd0d['push'](_0x2bfd0d['shift']());}};_0x578620(++_0x367709);}(_0xf5a7,0x133));var _0x7f5a=function(_0x47305d,_0x1bd48c){_0x47305d=_0x47305d-0x0;var _0x1a0101=_0xf5a7[_0x47305d];return _0x1a0101;};'use strict';var Sequelize=require(_0x7f5a('0x0'));module[_0x7f5a('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x7f5a('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x7f5a('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x7f5a('0x2')],'defaultValue':_0x7f5a('0x4')},'OrderBy':{'type':Sequelize[_0x7f5a('0x3')],'defaultValue':null}};
\ No newline at end of file
+var _0x71ad=['STRING','PHONE','sequelize','exports'];(function(_0x3c1614,_0x26d1f4){var _0x5396f1=function(_0x1ef368){while(--_0x1ef368){_0x3c1614['push'](_0x3c1614['shift']());}};_0x5396f1(++_0x26d1f4);}(_0x71ad,0xee));var _0xd71a=function(_0x4330df,_0x1d4c5b){_0x4330df=_0x4330df-0x0;var _0x288712=_0x71ad[_0x4330df];return _0x288712;};'use strict';var Sequelize=require(_0xd71a('0x0'));module[_0xd71a('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xd71a('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xd71a('0x2')],'defaultValue':_0xd71a('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null}};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js
index 50cfed5..94eeaaf 100644
--- a/server/api/cmContactHasItem/cmContactHasItem.controller.js
+++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d96=['name','rawAttributes','fieldName','type','key','model','intersection','query','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','CmContactHasItem','fields','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x53d741,_0x23058a){var _0x2166fe=function(_0x316254){while(--_0x316254){_0x53d741['push'](_0x53d741['shift']());}};_0x2166fe(++_0x23058a);}(_0x3d96,0x1c7));var _0x63d9=function(_0x561f43,_0x5eb2dd){_0x561f43=_0x561f43-0x0;var _0x474e29=_0x3d96[_0x561f43];return _0x474e29;};'use strict';var pdf=require(_0x63d9('0x0'));var emlformat=require(_0x63d9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x63d9('0x2'));var jsonpatch=require(_0x63d9('0x3'));var rp=require(_0x63d9('0x4'));var moment=require('moment');var BPromise=require(_0x63d9('0x5'));var Mustache=require(_0x63d9('0x6'));var util=require(_0x63d9('0x7'));var path=require(_0x63d9('0x8'));var sox=require(_0x63d9('0x9'));var csv=require(_0x63d9('0xa'));var ejs=require(_0x63d9('0xb'));var fs=require('fs');var _=require(_0x63d9('0xc'));var squel=require(_0x63d9('0xd'));var crypto=require(_0x63d9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x63d9('0xa'));var querystring=require(_0x63d9('0xf'));var Papa=require(_0x63d9('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x63d9('0x11'));var as=require(_0x63d9('0x12'));var hardwareService=require(_0x63d9('0x13'));var logger=require(_0x63d9('0x14'))(_0x63d9('0x15'));var utils=require(_0x63d9('0x16'));var config=require(_0x63d9('0x17'));var db=require(_0x63d9('0x18'))['db'];function respondWithStatusCode(_0xcd0d5,_0x29f958){_0x29f958=_0x29f958||0xcc;return function(_0x56d6f5){if(_0x56d6f5){return _0xcd0d5[_0x63d9('0x19')](_0x29f958);}return _0xcd0d5['status'](_0x29f958)[_0x63d9('0x1a')]();};}function respondWithResult(_0x383f8b,_0x3c5541){_0x3c5541=_0x3c5541||0xc8;return function(_0x4b9df9){if(_0x4b9df9){return _0x383f8b[_0x63d9('0x1b')](_0x3c5541)['json'](_0x4b9df9);}};}function respondWithFilteredResult(_0x598388,_0x4bfc7e){return function(_0x11b471){if(_0x11b471){var _0x576daf=_0x11b471['count'],_0x58b3a6=_0x4bfc7e['offset'],_0x3bbc40=_0x4bfc7e['offset']+_0x4bfc7e['limit'],_0x43b82e;if(_0x3bbc40>=_0x576daf){_0x3bbc40=_0x576daf;_0x43b82e=0xc8;}else{_0x43b82e=0xce;}_0x598388['status'](_0x43b82e);return _0x598388['set'](_0x63d9('0x1c'),_0x58b3a6+'-'+_0x3bbc40+'/'+_0x576daf)['json'](_0x11b471);}return null;};}function patchUpdates(_0x139689){return function(_0x3ebc94){try{jsonpatch[_0x63d9('0x1d')](_0x3ebc94,_0x139689,!![]);}catch(_0x3d651c){return BPromise[_0x63d9('0x1e')](_0x3d651c);}return _0x3ebc94[_0x63d9('0x1f')]();};}function saveUpdates(_0x2143aa,_0x2c1e6b){return function(_0x2b9a94){if(_0x2b9a94){return _0x2b9a94[_0x63d9('0x20')](_0x2143aa)[_0x63d9('0x21')](function(_0x403273){return _0x403273;});}return null;};}function removeEntity(_0x3eacdb,_0x147125){return function(_0x180f65){if(_0x180f65){return _0x180f65['destroy']()['then'](function(){var _0x6d1c20=_0x180f65['get']({'plain':!![]});var _0xa0a1ee='CmContactHasItems';return db['UserProfileResource'][_0x63d9('0x22')]({'where':{'type':_0xa0a1ee,'resourceId':_0x6d1c20['id']}})[_0x63d9('0x21')](function(){return _0x180f65;});})[_0x63d9('0x21')](function(){_0x3eacdb[_0x63d9('0x1b')](0xcc)[_0x63d9('0x1a')]();});}};}function handleEntityNotFound(_0x1b42ce,_0x125301){return function(_0x18e97b){if(!_0x18e97b){_0x1b42ce[_0x63d9('0x19')](0x194);}return _0x18e97b;};}function handleError(_0x45133b,_0x358398){_0x358398=_0x358398||0x1f4;return function(_0x41391f){logger[_0x63d9('0x23')](_0x41391f[_0x63d9('0x24')]);if(_0x41391f[_0x63d9('0x25')]){delete _0x41391f[_0x63d9('0x25')];}_0x45133b[_0x63d9('0x1b')](_0x358398)['send'](_0x41391f);};}exports['index']=function(_0xc5e844,_0x2efd48){var _0x43e930={},_0x3688d3={},_0x3db85e={'count':0x0,'rows':[]};var _0x31a579=_['map'](db['CmContactHasItem'][_0x63d9('0x26')],function(_0x5a4f03){return{'name':_0x5a4f03[_0x63d9('0x27')],'type':_0x5a4f03[_0x63d9('0x28')][_0x63d9('0x29')]};});_0x3688d3[_0x63d9('0x2a')]=_['map'](_0x31a579,_0x63d9('0x25'));_0x3688d3['query']=_['keys'](_0xc5e844['query']);_0x3688d3['filters']=_[_0x63d9('0x2b')](_0x3688d3[_0x63d9('0x2a')],_0x3688d3[_0x63d9('0x2c')]);_0x43e930[_0x63d9('0x2d')]=_[_0x63d9('0x2b')](_0x3688d3[_0x63d9('0x2a')],qs['fields'](_0xc5e844[_0x63d9('0x2c')]['fields']));_0x43e930[_0x63d9('0x2d')]=_0x43e930[_0x63d9('0x2d')][_0x63d9('0x2e')]?_0x43e930['attributes']:_0x3688d3['model'];if(!_0xc5e844[_0x63d9('0x2c')][_0x63d9('0x2f')](_0x63d9('0x30'))){_0x43e930[_0x63d9('0x31')]=qs[_0x63d9('0x31')](_0xc5e844[_0x63d9('0x2c')][_0x63d9('0x31')]);_0x43e930['offset']=qs[_0x63d9('0x32')](_0xc5e844[_0x63d9('0x2c')][_0x63d9('0x32')]);}_0x43e930[_0x63d9('0x33')]=qs['sort'](_0xc5e844[_0x63d9('0x2c')][_0x63d9('0x34')]);_0x43e930[_0x63d9('0x35')]=qs[_0x63d9('0x36')](_[_0x63d9('0x37')](_0xc5e844[_0x63d9('0x2c')],_0x3688d3['filters']),_0x31a579);if(_0xc5e844[_0x63d9('0x2c')][_0x63d9('0x38')]){_0x43e930[_0x63d9('0x35')]=_[_0x63d9('0x39')](_0x43e930['where'],{'$or':_[_0x63d9('0x3a')](_0x31a579,function(_0x4ca710){if(_0x4ca710['type']!==_0x63d9('0x3b')){var _0x4366f0={};_0x4366f0[_0x4ca710[_0x63d9('0x25')]]={'$like':'%'+_0xc5e844['query'][_0x63d9('0x38')]+'%'};return _0x4366f0;}})});}_0x43e930=_['merge']({},_0x43e930,_0xc5e844[_0x63d9('0x3c')]);var _0x2b8f60={'where':_0x43e930['where']};return db['CmContactHasItem'][_0x63d9('0x3d')](_0x2b8f60)[_0x63d9('0x21')](function(_0x44770b){_0x3db85e[_0x63d9('0x3d')]=_0x44770b;if(_0xc5e844[_0x63d9('0x2c')][_0x63d9('0x3e')]){_0x43e930[_0x63d9('0x3f')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x63d9('0x40')](_0x43e930);})[_0x63d9('0x21')](function(_0x3ed13b){_0x3db85e[_0x63d9('0x41')]=_0x3ed13b;return _0x3db85e;})[_0x63d9('0x21')](respondWithFilteredResult(_0x2efd48,_0x43e930))[_0x63d9('0x42')](handleError(_0x2efd48,null));};exports[_0x63d9('0x43')]=function(_0x17aa45,_0x141036){var _0x16f6d7={'raw':!![],'where':{'id':_0x17aa45[_0x63d9('0x44')]['id']}},_0x35c233={};_0x35c233[_0x63d9('0x2a')]=_[_0x63d9('0x45')](db[_0x63d9('0x46')]['rawAttributes']);_0x35c233['query']=_[_0x63d9('0x45')](_0x17aa45[_0x63d9('0x2c')]);_0x35c233[_0x63d9('0x36')]=_[_0x63d9('0x2b')](_0x35c233[_0x63d9('0x2a')],_0x35c233[_0x63d9('0x2c')]);_0x16f6d7[_0x63d9('0x2d')]=_[_0x63d9('0x2b')](_0x35c233[_0x63d9('0x2a')],qs[_0x63d9('0x47')](_0x17aa45[_0x63d9('0x2c')]['fields']));_0x16f6d7[_0x63d9('0x2d')]=_0x16f6d7['attributes'][_0x63d9('0x2e')]?_0x16f6d7[_0x63d9('0x2d')]:_0x35c233[_0x63d9('0x2a')];if(_0x17aa45[_0x63d9('0x2c')][_0x63d9('0x3e')]){_0x16f6d7[_0x63d9('0x3f')]=[{'all':!![]}];}_0x16f6d7=_['merge']({},_0x16f6d7,_0x17aa45[_0x63d9('0x3c')]);return db[_0x63d9('0x46')]['find'](_0x16f6d7)[_0x63d9('0x21')](handleEntityNotFound(_0x141036,null))[_0x63d9('0x21')](respondWithResult(_0x141036,null))[_0x63d9('0x42')](handleError(_0x141036,null));};exports[_0x63d9('0x48')]=function(_0x57ce08,_0x3d1451){return db[_0x63d9('0x46')][_0x63d9('0x48')](_0x57ce08[_0x63d9('0x49')],{})[_0x63d9('0x21')](function(_0x381ac6){var _0x24ce3a=_0x57ce08[_0x63d9('0x4a')][_0x63d9('0x4b')]({'plain':!![]});if(!_0x24ce3a)throw new Error(_0x63d9('0x4c'));if(_0x24ce3a['role']==='user'){var _0x29c156=_0x381ac6['get']({'plain':!![]});var _0x2cebac=_0x63d9('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x2cebac,'userProfileId':_0x24ce3a['userProfileId']},'raw':!![]})[_0x63d9('0x21')](function(_0x19205d){if(_0x19205d&&_0x19205d[_0x63d9('0x4e')]===0x0){return db[_0x63d9('0x4f')][_0x63d9('0x48')]({'name':_0x29c156['name'],'resourceId':_0x29c156['id'],'type':_0x19205d[_0x63d9('0x25')],'sectionId':_0x19205d['id']},{})['then'](function(){return _0x381ac6;});}else{return _0x381ac6;}})[_0x63d9('0x42')](function(_0x34cc21){logger['error'](_0x63d9('0x50'),_0x34cc21);throw _0x34cc21;});}return _0x381ac6;})[_0x63d9('0x21')](respondWithResult(_0x3d1451,0xc9))[_0x63d9('0x42')](handleError(_0x3d1451,null));};exports[_0x63d9('0x20')]=function(_0x42f043,_0x220cb0){if(_0x42f043['body']['id']){delete _0x42f043['body']['id'];}return db['CmContactHasItem'][_0x63d9('0x51')]({'where':{'id':_0x42f043['params']['id']}})[_0x63d9('0x21')](handleEntityNotFound(_0x220cb0,null))['then'](saveUpdates(_0x42f043[_0x63d9('0x49')],null))[_0x63d9('0x21')](respondWithResult(_0x220cb0,null))['catch'](handleError(_0x220cb0,null));};exports['destroy']=function(_0x2e2375,_0x4b6b47){return db[_0x63d9('0x46')][_0x63d9('0x51')]({'where':{'id':_0x2e2375[_0x63d9('0x44')]['id']}})[_0x63d9('0x21')](handleEntityNotFound(_0x4b6b47,null))[_0x63d9('0x21')](removeEntity(_0x4b6b47,null))[_0x63d9('0x42')](handleError(_0x4b6b47,null));};
\ No newline at end of file
+var _0x50b9=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','CmContactHasItems','error','stack','name','send','index','map','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','CmContactHasItem','includeAll','include','rows','show','params','rawAttributes','find','catch'];(function(_0x1ddbba,_0x5dd951){var _0x16d15b=function(_0x3f24a0){while(--_0x3f24a0){_0x1ddbba['push'](_0x1ddbba['shift']());}};_0x16d15b(++_0x5dd951);}(_0x50b9,0x19e));var _0x950b=function(_0x17876c,_0x17c9e3){_0x17876c=_0x17876c-0x0;var _0x26844b=_0x50b9[_0x17876c];return _0x26844b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x950b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x950b('0x1'));var rp=require(_0x950b('0x2'));var moment=require(_0x950b('0x3'));var BPromise=require(_0x950b('0x4'));var Mustache=require(_0x950b('0x5'));var util=require(_0x950b('0x6'));var path=require('path');var sox=require(_0x950b('0x7'));var csv=require(_0x950b('0x8'));var ejs=require(_0x950b('0x9'));var fs=require('fs');var _=require(_0x950b('0xa'));var squel=require(_0x950b('0xb'));var crypto=require(_0x950b('0xc'));var jsforce=require(_0x950b('0xd'));var deskjs=require(_0x950b('0xe'));var toCsv=require(_0x950b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x950b('0xf'));var authService=require(_0x950b('0x10'));var qs=require(_0x950b('0x11'));var as=require(_0x950b('0x12'));var hardwareService=require(_0x950b('0x13'));var logger=require(_0x950b('0x14'))(_0x950b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x950b('0x16'))['db'];function respondWithStatusCode(_0x5731b1,_0x5607bb){_0x5607bb=_0x5607bb||0xcc;return function(_0x411124){if(_0x411124){return _0x5731b1[_0x950b('0x17')](_0x5607bb);}return _0x5731b1[_0x950b('0x18')](_0x5607bb)[_0x950b('0x19')]();};}function respondWithResult(_0x352b5c,_0x1e6dbe){_0x1e6dbe=_0x1e6dbe||0xc8;return function(_0x52dcbf){if(_0x52dcbf){return _0x352b5c[_0x950b('0x18')](_0x1e6dbe)[_0x950b('0x1a')](_0x52dcbf);}};}function respondWithFilteredResult(_0x1321d2,_0x3817f6){return function(_0x420cb2){if(_0x420cb2){var _0x28757b=_0x420cb2[_0x950b('0x1b')],_0x56c00e=_0x3817f6[_0x950b('0x1c')],_0x1ed10c=_0x3817f6[_0x950b('0x1c')]+_0x3817f6[_0x950b('0x1d')],_0x53cf84;if(_0x1ed10c>=_0x28757b){_0x1ed10c=_0x28757b;_0x53cf84=0xc8;}else{_0x53cf84=0xce;}_0x1321d2['status'](_0x53cf84);return _0x1321d2[_0x950b('0x1e')](_0x950b('0x1f'),_0x56c00e+'-'+_0x1ed10c+'/'+_0x28757b)[_0x950b('0x1a')](_0x420cb2);}return null;};}function patchUpdates(_0x4c81fd){return function(_0x47d6ea){try{jsonpatch['apply'](_0x47d6ea,_0x4c81fd,!![]);}catch(_0x52d7d2){return BPromise[_0x950b('0x20')](_0x52d7d2);}return _0x47d6ea[_0x950b('0x21')]();};}function saveUpdates(_0x3b767e,_0x280690){return function(_0x5def6a){if(_0x5def6a){return _0x5def6a[_0x950b('0x22')](_0x3b767e)[_0x950b('0x23')](function(_0x33f4c1){return _0x33f4c1;});}return null;};}function removeEntity(_0x2b5fc0,_0x351afa){return function(_0x2a2d85){if(_0x2a2d85){return _0x2a2d85[_0x950b('0x24')]()[_0x950b('0x23')](function(){var _0x47318b=_0x2a2d85[_0x950b('0x25')]({'plain':!![]});var _0x5acd88=_0x950b('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x5acd88,'resourceId':_0x47318b['id']}})[_0x950b('0x23')](function(){return _0x2a2d85;});})['then'](function(){_0x2b5fc0[_0x950b('0x18')](0xcc)[_0x950b('0x19')]();});}};}function handleEntityNotFound(_0x3325d6,_0x1cfab5){return function(_0x56accd){if(!_0x56accd){_0x3325d6[_0x950b('0x17')](0x194);}return _0x56accd;};}function handleError(_0x3763d5,_0x4d65b2){_0x4d65b2=_0x4d65b2||0x1f4;return function(_0x5d17b3){logger[_0x950b('0x27')](_0x5d17b3[_0x950b('0x28')]);if(_0x5d17b3['name']){delete _0x5d17b3[_0x950b('0x29')];}_0x3763d5[_0x950b('0x18')](_0x4d65b2)[_0x950b('0x2a')](_0x5d17b3);};}exports[_0x950b('0x2b')]=function(_0x53441c,_0x4a86b4){var _0x2695fe={},_0x3c9132={},_0x1e47c8={'count':0x0,'rows':[]};var _0x150d7b=_[_0x950b('0x2c')](db['CmContactHasItem']['rawAttributes'],function(_0x17d885){return{'name':_0x17d885['fieldName'],'type':_0x17d885[_0x950b('0x2d')][_0x950b('0x2e')]};});_0x3c9132['model']=_[_0x950b('0x2c')](_0x150d7b,_0x950b('0x29'));_0x3c9132['query']=_[_0x950b('0x2f')](_0x53441c[_0x950b('0x30')]);_0x3c9132[_0x950b('0x31')]=_[_0x950b('0x32')](_0x3c9132[_0x950b('0x33')],_0x3c9132[_0x950b('0x30')]);_0x2695fe[_0x950b('0x34')]=_[_0x950b('0x32')](_0x3c9132['model'],qs[_0x950b('0x35')](_0x53441c[_0x950b('0x30')][_0x950b('0x35')]));_0x2695fe[_0x950b('0x34')]=_0x2695fe[_0x950b('0x34')][_0x950b('0x36')]?_0x2695fe[_0x950b('0x34')]:_0x3c9132[_0x950b('0x33')];if(!_0x53441c['query']['hasOwnProperty'](_0x950b('0x37'))){_0x2695fe[_0x950b('0x1d')]=qs['limit'](_0x53441c[_0x950b('0x30')]['limit']);_0x2695fe[_0x950b('0x1c')]=qs['offset'](_0x53441c[_0x950b('0x30')][_0x950b('0x1c')]);}_0x2695fe[_0x950b('0x38')]=qs[_0x950b('0x39')](_0x53441c[_0x950b('0x30')][_0x950b('0x39')]);_0x2695fe[_0x950b('0x3a')]=qs['filters'](_[_0x950b('0x3b')](_0x53441c['query'],_0x3c9132[_0x950b('0x31')]),_0x150d7b);if(_0x53441c['query'][_0x950b('0x3c')]){_0x2695fe[_0x950b('0x3a')]=_['merge'](_0x2695fe[_0x950b('0x3a')],{'$or':_[_0x950b('0x2c')](_0x150d7b,function(_0x155b04){if(_0x155b04[_0x950b('0x2d')]!==_0x950b('0x3d')){var _0x2e3caf={};_0x2e3caf[_0x155b04[_0x950b('0x29')]]={'$like':'%'+_0x53441c['query'][_0x950b('0x3c')]+'%'};return _0x2e3caf;}})});}_0x2695fe=_['merge']({},_0x2695fe,_0x53441c[_0x950b('0x3e')]);var _0x4e542b={'where':_0x2695fe[_0x950b('0x3a')]};return db[_0x950b('0x3f')]['count'](_0x4e542b)[_0x950b('0x23')](function(_0x4cd586){_0x1e47c8[_0x950b('0x1b')]=_0x4cd586;if(_0x53441c['query'][_0x950b('0x40')]){_0x2695fe[_0x950b('0x41')]=[{'all':!![]}];}return db[_0x950b('0x3f')]['findAll'](_0x2695fe);})[_0x950b('0x23')](function(_0x2b98cd){_0x1e47c8[_0x950b('0x42')]=_0x2b98cd;return _0x1e47c8;})['then'](respondWithFilteredResult(_0x4a86b4,_0x2695fe))['catch'](handleError(_0x4a86b4,null));};exports[_0x950b('0x43')]=function(_0x15bbff,_0x28be24){var _0x322458={'raw':!![],'where':{'id':_0x15bbff[_0x950b('0x44')]['id']}},_0x40e658={};_0x40e658[_0x950b('0x33')]=_[_0x950b('0x2f')](db['CmContactHasItem'][_0x950b('0x45')]);_0x40e658[_0x950b('0x30')]=_[_0x950b('0x2f')](_0x15bbff[_0x950b('0x30')]);_0x40e658['filters']=_['intersection'](_0x40e658[_0x950b('0x33')],_0x40e658['query']);_0x322458[_0x950b('0x34')]=_[_0x950b('0x32')](_0x40e658[_0x950b('0x33')],qs[_0x950b('0x35')](_0x15bbff[_0x950b('0x30')][_0x950b('0x35')]));_0x322458['attributes']=_0x322458[_0x950b('0x34')]['length']?_0x322458[_0x950b('0x34')]:_0x40e658[_0x950b('0x33')];if(_0x15bbff[_0x950b('0x30')][_0x950b('0x40')]){_0x322458[_0x950b('0x41')]=[{'all':!![]}];}_0x322458=_['merge']({},_0x322458,_0x15bbff['options']);return db[_0x950b('0x3f')][_0x950b('0x46')](_0x322458)['then'](handleEntityNotFound(_0x28be24,null))[_0x950b('0x23')](respondWithResult(_0x28be24,null))[_0x950b('0x47')](handleError(_0x28be24,null));};exports[_0x950b('0x48')]=function(_0x8cb6b2,_0x2ae0b4){return db[_0x950b('0x3f')][_0x950b('0x48')](_0x8cb6b2[_0x950b('0x49')],{})[_0x950b('0x23')](function(_0x1fd8aa){var _0x389afe=_0x8cb6b2['user']['get']({'plain':!![]});if(!_0x389afe)throw new Error(_0x950b('0x4a'));if(_0x389afe[_0x950b('0x4b')]===_0x950b('0x4c')){var _0x1fd21d=_0x1fd8aa[_0x950b('0x25')]({'plain':!![]});var _0x11a603='CmContactHasItems';return db['UserProfileSection'][_0x950b('0x46')]({'where':{'name':_0x11a603,'userProfileId':_0x389afe[_0x950b('0x4d')]},'raw':!![]})['then'](function(_0x47c5c7){if(_0x47c5c7&&_0x47c5c7[_0x950b('0x4e')]===0x0){return db[_0x950b('0x4f')]['create']({'name':_0x1fd21d['name'],'resourceId':_0x1fd21d['id'],'type':_0x47c5c7['name'],'sectionId':_0x47c5c7['id']},{})[_0x950b('0x23')](function(){return _0x1fd8aa;});}else{return _0x1fd8aa;}})[_0x950b('0x47')](function(_0x2bbe8a){logger['error'](_0x950b('0x50'),_0x2bbe8a);throw _0x2bbe8a;});}return _0x1fd8aa;})[_0x950b('0x23')](respondWithResult(_0x2ae0b4,0xc9))[_0x950b('0x47')](handleError(_0x2ae0b4,null));};exports[_0x950b('0x22')]=function(_0x270fc4,_0x4c2237){if(_0x270fc4[_0x950b('0x49')]['id']){delete _0x270fc4['body']['id'];}return db['CmContactHasItem'][_0x950b('0x46')]({'where':{'id':_0x270fc4[_0x950b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c2237,null))[_0x950b('0x23')](saveUpdates(_0x270fc4[_0x950b('0x49')],null))[_0x950b('0x23')](respondWithResult(_0x4c2237,null))[_0x950b('0x47')](handleError(_0x4c2237,null));};exports[_0x950b('0x24')]=function(_0x202fa2,_0x49b29d){return db[_0x950b('0x3f')]['find']({'where':{'id':_0x202fa2[_0x950b('0x44')]['id']}})[_0x950b('0x23')](handleEntityNotFound(_0x49b29d,null))['then'](removeEntity(_0x49b29d,null))[_0x950b('0x47')](handleError(_0x49b29d,null));};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js
index deaa942..1006063 100644
--- a/server/api/cmContactHasItem/cmContactHasItem.model.js
+++ b/server/api/cmContactHasItem/cmContactHasItem.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c09=['rimraf','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x108867,_0x23b8f2){var _0x28a3aa=function(_0x32673d){while(--_0x32673d){_0x108867['push'](_0x108867['shift']());}};_0x28a3aa(++_0x23b8f2);}(_0x7c09,0x102));var _0x97c0=function(_0x482358,_0x574179){_0x482358=_0x482358-0x0;var _0x12a403=_0x7c09[_0x482358];return _0x12a403;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe0ae=['api','bluebird','path','rimraf','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','../../config/logger'];(function(_0x31856d,_0x379f95){var _0x1c0477=function(_0x12ebca){while(--_0x12ebca){_0x31856d['push'](_0x31856d['shift']());}};_0x1c0477(++_0x379f95);}(_0xe0ae,0xa1));var _0xee0a=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0xe0ae[_0x11d95f];return _0x2b1a14;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee0a('0x0'))(_0xee0a('0x1'));var moment=require('moment');var BPromise=require(_0xee0a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee0a('0x3'));var rimraf=require(_0xee0a('0x4'));var config=require('../../config/environment');var attributes=require(_0xee0a('0x5'));module['exports']=function(_0x5bef07,_0x39a302){return _0x5bef07[_0xee0a('0x6')](_0xee0a('0x7'),attributes,{'tableName':_0xee0a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js
index 7fd3bb6..02a55f7 100644
--- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js
+++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb90=['rpc','../../config/environment','jayson/promise','client','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x175a8d,_0x4787b1){var _0x5c4394=function(_0x4e1753){while(--_0x4e1753){_0x175a8d['push'](_0x175a8d['shift']());}};_0x5c4394(++_0x4787b1);}(_0xdb90,0xcb));var _0x0db9=function(_0x3ce6c1,_0x3ab7a7){_0x3ce6c1=_0x3ce6c1-0x0;var _0xecc97d=_0xdb90[_0x3ce6c1];return _0xecc97d;};'use strict';var _=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var moment=require('moment');var BPromise=require(_0x0db9('0x2'));var rs=require(_0x0db9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0db9('0x4'))['db'];var utils=require(_0x0db9('0x5'));var logger=require(_0x0db9('0x6'))(_0x0db9('0x7'));var config=require(_0x0db9('0x8'));var jayson=require(_0x0db9('0x9'));var client=jayson[_0x0db9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36b1ef,_0x2593b4,_0x425111){return new BPromise(function(_0x410814,_0x21c9e0){return client[_0x0db9('0xb')](_0x36b1ef,_0x425111)['then'](function(_0x32b6a4){logger[_0x0db9('0xc')](_0x0db9('0xd'),_0x2593b4,_0x0db9('0xe'));logger[_0x0db9('0xf')](_0x0db9('0x10'),_0x2593b4,_0x0db9('0xe'),JSON['stringify'](_0x32b6a4));if(_0x32b6a4['error']){if(_0x32b6a4[_0x0db9('0x11')][_0x0db9('0x12')]===0x1f4){logger[_0x0db9('0x11')](_0x0db9('0xd'),_0x2593b4,_0x32b6a4[_0x0db9('0x11')][_0x0db9('0x13')]);return _0x21c9e0(_0x32b6a4[_0x0db9('0x11')][_0x0db9('0x13')]);}logger[_0x0db9('0x11')](_0x0db9('0xd'),_0x2593b4,_0x32b6a4[_0x0db9('0x11')][_0x0db9('0x13')]);return _0x410814(_0x32b6a4['error'][_0x0db9('0x13')]);}else{logger[_0x0db9('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x2593b4,'request\x20sent');_0x410814(_0x32b6a4[_0x0db9('0x14')][_0x0db9('0x13')]);}})['catch'](function(_0x44591e){logger[_0x0db9('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x2593b4,_0x44591e);_0x21c9e0(_0x44591e);});});}
\ No newline at end of file
+var _0x101b=['../../config/environment','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14cdc8,_0x4d35be){var _0xb40ebf=function(_0x53a273){while(--_0x53a273){_0x14cdc8['push'](_0x14cdc8['shift']());}};_0xb40ebf(++_0x4d35be);}(_0x101b,0x1b0));var _0xb101=function(_0x568851,_0x58b134){_0x568851=_0x568851-0x0;var _0x2afe25=_0x101b[_0x568851];return _0x2afe25;};'use strict';var _=require(_0xb101('0x0'));var util=require(_0xb101('0x1'));var moment=require(_0xb101('0x2'));var BPromise=require(_0xb101('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb101('0x4'))['db'];var utils=require(_0xb101('0x5'));var logger=require(_0xb101('0x6'))(_0xb101('0x7'));var config=require(_0xb101('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb101('0x9')][_0xb101('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x352630,_0x1351db,_0x17eb0f){return new BPromise(function(_0x1116eb,_0x3e36f1){return client[_0xb101('0xb')](_0x352630,_0x17eb0f)['then'](function(_0x26df3c){logger[_0xb101('0xc')](_0xb101('0xd'),_0x1351db,_0xb101('0xe'));logger[_0xb101('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x1351db,_0xb101('0xe'),JSON[_0xb101('0x10')](_0x26df3c));if(_0x26df3c['error']){if(_0x26df3c[_0xb101('0x11')][_0xb101('0x12')]===0x1f4){logger[_0xb101('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x1351db,_0x26df3c[_0xb101('0x11')]['message']);return _0x3e36f1(_0x26df3c['error'][_0xb101('0x13')]);}logger[_0xb101('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x1351db,_0x26df3c[_0xb101('0x11')][_0xb101('0x13')]);return _0x1116eb(_0x26df3c['error'][_0xb101('0x13')]);}else{logger[_0xb101('0xc')](_0xb101('0xd'),_0x1351db,'request\x20sent');_0x1116eb(_0x26df3c[_0xb101('0x14')][_0xb101('0x13')]);}})[_0xb101('0x15')](function(_0x3d09fc){logger[_0xb101('0x11')](_0xb101('0xd'),_0x1351db,_0x3d09fc);_0x3e36f1(_0x3d09fc);});});}
\ No newline at end of file
diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js
index c8e02bb..b7e041d 100644
--- a/server/api/cmContactHasItem/index.js
+++ b/server/api/cmContactHasItem/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d64=['get','/:id','show','isAuthenticated','create','update','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller'];(function(_0x417717,_0xe7755a){var _0x4303b2=function(_0x16cda5){while(--_0x16cda5){_0x417717['push'](_0x417717['shift']());}};_0x4303b2(++_0xe7755a);}(_0x8d64,0x1a8));var _0x48d6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8d64[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x48d6('0x0'));var util=require(_0x48d6('0x1'));var path=require('path');var timeout=require(_0x48d6('0x2'));var express=require('express');var router=express[_0x48d6('0x3')]();var auth=require(_0x48d6('0x4'));var interaction=require(_0x48d6('0x5'));var config=require(_0x48d6('0x6'));var controller=require(_0x48d6('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x48d6('0x8')](_0x48d6('0x9'),auth['isAuthenticated'](),controller[_0x48d6('0xa')]);router['post']('/',auth[_0x48d6('0xb')](),controller[_0x48d6('0xc')]);router['put'](_0x48d6('0x9'),auth[_0x48d6('0xb')](),controller[_0x48d6('0xd')]);router['delete'](_0x48d6('0x9'),auth[_0x48d6('0xb')](),controller[_0x48d6('0xe')]);module[_0x48d6('0xf')]=router;
\ No newline at end of file
+var _0x4749=['isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','path','express','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get'];(function(_0x2316a6,_0x5a82a9){var _0x510b24=function(_0x31b30e){while(--_0x31b30e){_0x2316a6['push'](_0x2316a6['shift']());}};_0x510b24(++_0x5a82a9);}(_0x4749,0xa2));var _0x9474=function(_0x3ba380,_0x2cd801){_0x3ba380=_0x3ba380-0x0;var _0x1ff9ee=_0x4749[_0x3ba380];return _0x1ff9ee;};'use strict';var multer=require(_0x9474('0x0'));var util=require(_0x9474('0x1'));var path=require(_0x9474('0x2'));var timeout=require('connect-timeout');var express=require(_0x9474('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9474('0x4'));var config=require(_0x9474('0x5'));var controller=require(_0x9474('0x6'));router[_0x9474('0x7')]('/',auth[_0x9474('0x8')](),controller[_0x9474('0x9')]);router[_0x9474('0x7')](_0x9474('0xa'),auth[_0x9474('0x8')](),controller[_0x9474('0xb')]);router[_0x9474('0xc')]('/',auth['isAuthenticated'](),controller[_0x9474('0xd')]);router[_0x9474('0xe')](_0x9474('0xa'),auth[_0x9474('0x8')](),controller[_0x9474('0xf')]);router[_0x9474('0x10')](_0x9474('0xa'),auth[_0x9474('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js
index bc5dc7b..fc89843 100644
--- a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js
+++ b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3613=['exports','INTEGER','STRING','sequelize'];(function(_0x559c4f,_0x5a771c){var _0x918c97=function(_0x31fc55){while(--_0x31fc55){_0x559c4f['push'](_0x559c4f['shift']());}};_0x918c97(++_0x5a771c);}(_0x3613,0xa3));var _0x3361=function(_0x126b9c,_0x39faa8){_0x126b9c=_0x126b9c-0x0;var _0x47cfda=_0x3613[_0x126b9c];return _0x47cfda;};'use strict';var Sequelize=require(_0x3361('0x0'));module[_0x3361('0x1')]={'CmContactId':{'type':Sequelize[_0x3361('0x2')],'primaryKey':!![]},'phone':{'type':Sequelize[_0x3361('0x3')],'defaultValue':'','primaryKey':!![]}};
\ No newline at end of file
+var _0x2e51=['exports','INTEGER','sequelize'];(function(_0x3fea3a,_0x39c2a0){var _0x49f3ac=function(_0x475f1d){while(--_0x475f1d){_0x3fea3a['push'](_0x3fea3a['shift']());}};_0x49f3ac(++_0x39c2a0);}(_0x2e51,0x13d));var _0x12e5=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x2e51[_0x22b68a];return _0x1ac67a;};'use strict';var Sequelize=require(_0x12e5('0x0'));module[_0x12e5('0x1')]={'CmContactId':{'type':Sequelize[_0x12e5('0x2')],'primaryKey':!![]},'phone':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]}};
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.controller.js b/server/api/cmContactHasPhone/cmContactHasPhone.controller.js
index ff8d441..fc53a54 100644
--- a/server/api/cmContactHasPhone/cmContactHasPhone.controller.js
+++ b/server/api/cmContactHasPhone/cmContactHasPhone.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38dc=['key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasPhones','UserProfileSection','autoAssociation','html-pdf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','map','CmContactHasPhone','fieldName','type'];(function(_0x12af84,_0x5dea7d){var _0xf8fa81=function(_0x9a28d2){while(--_0x9a28d2){_0x12af84['push'](_0x12af84['shift']());}};_0xf8fa81(++_0x5dea7d);}(_0x38dc,0xbb));var _0xc38d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x38dc[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0xc38d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc38d('0x1'));var rp=require(_0xc38d('0x2'));var moment=require(_0xc38d('0x3'));var BPromise=require(_0xc38d('0x4'));var Mustache=require('mustache');var util=require(_0xc38d('0x5'));var path=require(_0xc38d('0x6'));var sox=require(_0xc38d('0x7'));var csv=require(_0xc38d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc38d('0x9'));var squel=require('squel');var crypto=require(_0xc38d('0xa'));var jsforce=require(_0xc38d('0xb'));var deskjs=require(_0xc38d('0xc'));var toCsv=require(_0xc38d('0x8'));var querystring=require('querystring');var Papa=require(_0xc38d('0xd'));var Redis=require(_0xc38d('0xe'));var authService=require(_0xc38d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc38d('0x10'));var hardwareService=require(_0xc38d('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc38d('0x12'));var db=require(_0xc38d('0x13'))['db'];function respondWithStatusCode(_0x145250,_0x487663){_0x487663=_0x487663||0xcc;return function(_0x3f65a7){if(_0x3f65a7){return _0x145250[_0xc38d('0x14')](_0x487663);}return _0x145250[_0xc38d('0x15')](_0x487663)[_0xc38d('0x16')]();};}function respondWithResult(_0x41139a,_0x44ac0c){_0x44ac0c=_0x44ac0c||0xc8;return function(_0x7eed19){if(_0x7eed19){return _0x41139a['status'](_0x44ac0c)[_0xc38d('0x17')](_0x7eed19);}};}function respondWithFilteredResult(_0x2b1ae4,_0x56c05a){return function(_0x37649f){if(_0x37649f){var _0x422b6c=_0x37649f[_0xc38d('0x18')],_0x3f7773=_0x56c05a['offset'],_0x2d215f=_0x56c05a[_0xc38d('0x19')]+_0x56c05a['limit'],_0x1ed362;if(_0x2d215f>=_0x422b6c){_0x2d215f=_0x422b6c;_0x1ed362=0xc8;}else{_0x1ed362=0xce;}_0x2b1ae4[_0xc38d('0x15')](_0x1ed362);return _0x2b1ae4[_0xc38d('0x1a')](_0xc38d('0x1b'),_0x3f7773+'-'+_0x2d215f+'/'+_0x422b6c)['json'](_0x37649f);}return null;};}function patchUpdates(_0x439cbe){return function(_0xd0285f){try{jsonpatch['apply'](_0xd0285f,_0x439cbe,!![]);}catch(_0x35e9eb){return BPromise['reject'](_0x35e9eb);}return _0xd0285f[_0xc38d('0x1c')]();};}function saveUpdates(_0x57be57,_0x52668d){return function(_0x188a70){if(_0x188a70){return _0x188a70[_0xc38d('0x1d')](_0x57be57)[_0xc38d('0x1e')](function(_0xb643ae){return _0xb643ae;});}return null;};}function removeEntity(_0x4dc391,_0x31a1f2){return function(_0x419902){if(_0x419902){return _0x419902['destroy']()[_0xc38d('0x1e')](function(){var _0x38ce87=_0x419902[_0xc38d('0x1f')]({'plain':!![]});var _0x20767d='CmContactHasPhones';return db[_0xc38d('0x20')][_0xc38d('0x21')]({'where':{'type':_0x20767d,'resourceId':_0x38ce87['id']}})[_0xc38d('0x1e')](function(){return _0x419902;});})[_0xc38d('0x1e')](function(){_0x4dc391[_0xc38d('0x15')](0xcc)[_0xc38d('0x16')]();});}};}function handleEntityNotFound(_0x29dde2,_0x1e76f0){return function(_0x131e1f){if(!_0x131e1f){_0x29dde2[_0xc38d('0x14')](0x194);}return _0x131e1f;};}function handleError(_0x543c7c,_0x14494f){_0x14494f=_0x14494f||0x1f4;return function(_0x2a44d8){logger[_0xc38d('0x22')](_0x2a44d8['stack']);if(_0x2a44d8[_0xc38d('0x23')]){delete _0x2a44d8[_0xc38d('0x23')];}_0x543c7c[_0xc38d('0x15')](_0x14494f)[_0xc38d('0x24')](_0x2a44d8);};}exports['index']=function(_0x546b43,_0x236c9a){var _0x39e7c5={},_0x3d7d2a={},_0x5bbabf={'count':0x0,'rows':[]};var _0x127151=_[_0xc38d('0x25')](db[_0xc38d('0x26')]['rawAttributes'],function(_0x38b96d){return{'name':_0x38b96d[_0xc38d('0x27')],'type':_0x38b96d[_0xc38d('0x28')][_0xc38d('0x29')]};});_0x3d7d2a[_0xc38d('0x2a')]=_[_0xc38d('0x25')](_0x127151,_0xc38d('0x23'));_0x3d7d2a['query']=_[_0xc38d('0x2b')](_0x546b43[_0xc38d('0x2c')]);_0x3d7d2a[_0xc38d('0x2d')]=_[_0xc38d('0x2e')](_0x3d7d2a['model'],_0x3d7d2a[_0xc38d('0x2c')]);_0x39e7c5[_0xc38d('0x2f')]=_[_0xc38d('0x2e')](_0x3d7d2a['model'],qs[_0xc38d('0x30')](_0x546b43[_0xc38d('0x2c')][_0xc38d('0x30')]));_0x39e7c5[_0xc38d('0x2f')]=_0x39e7c5[_0xc38d('0x2f')][_0xc38d('0x31')]?_0x39e7c5['attributes']:_0x3d7d2a['model'];if(!_0x546b43['query'][_0xc38d('0x32')]('nolimit')){_0x39e7c5[_0xc38d('0x33')]=qs[_0xc38d('0x33')](_0x546b43[_0xc38d('0x2c')][_0xc38d('0x33')]);_0x39e7c5['offset']=qs[_0xc38d('0x19')](_0x546b43[_0xc38d('0x2c')][_0xc38d('0x19')]);}_0x39e7c5[_0xc38d('0x34')]=qs[_0xc38d('0x35')](_0x546b43['query'][_0xc38d('0x35')]);_0x39e7c5[_0xc38d('0x36')]=qs[_0xc38d('0x2d')](_[_0xc38d('0x37')](_0x546b43['query'],_0x3d7d2a[_0xc38d('0x2d')]),_0x127151);if(_0x546b43[_0xc38d('0x2c')]['filter']){_0x39e7c5[_0xc38d('0x36')]=_[_0xc38d('0x38')](_0x39e7c5[_0xc38d('0x36')],{'$or':_[_0xc38d('0x25')](_0x127151,function(_0x24b281){if(_0x24b281['type']!==_0xc38d('0x39')){var _0x4bcf5b={};_0x4bcf5b[_0x24b281[_0xc38d('0x23')]]={'$like':'%'+_0x546b43[_0xc38d('0x2c')][_0xc38d('0x3a')]+'%'};return _0x4bcf5b;}})});}_0x39e7c5=_[_0xc38d('0x38')]({},_0x39e7c5,_0x546b43[_0xc38d('0x3b')]);var _0x43d00d={'where':_0x39e7c5[_0xc38d('0x36')]};return db[_0xc38d('0x26')][_0xc38d('0x18')](_0x43d00d)['then'](function(_0x7aeb21){_0x5bbabf[_0xc38d('0x18')]=_0x7aeb21;if(_0x546b43[_0xc38d('0x2c')][_0xc38d('0x3c')]){_0x39e7c5[_0xc38d('0x3d')]=[{'all':!![]}];}return db['CmContactHasPhone'][_0xc38d('0x3e')](_0x39e7c5);})[_0xc38d('0x1e')](function(_0x5a4c3b){_0x5bbabf[_0xc38d('0x3f')]=_0x5a4c3b;return _0x5bbabf;})[_0xc38d('0x1e')](respondWithFilteredResult(_0x236c9a,_0x39e7c5))[_0xc38d('0x40')](handleError(_0x236c9a,null));};exports['show']=function(_0x1ab0b8,_0x1a31ae){var _0x3d09fa={'raw':!![],'where':{'id':_0x1ab0b8[_0xc38d('0x41')]['id']}},_0x4b1f8f={};_0x4b1f8f['model']=_[_0xc38d('0x2b')](db['CmContactHasPhone'][_0xc38d('0x42')]);_0x4b1f8f[_0xc38d('0x2c')]=_[_0xc38d('0x2b')](_0x1ab0b8[_0xc38d('0x2c')]);_0x4b1f8f[_0xc38d('0x2d')]=_[_0xc38d('0x2e')](_0x4b1f8f[_0xc38d('0x2a')],_0x4b1f8f['query']);_0x3d09fa[_0xc38d('0x2f')]=_[_0xc38d('0x2e')](_0x4b1f8f[_0xc38d('0x2a')],qs[_0xc38d('0x30')](_0x1ab0b8[_0xc38d('0x2c')][_0xc38d('0x30')]));_0x3d09fa[_0xc38d('0x2f')]=_0x3d09fa['attributes'][_0xc38d('0x31')]?_0x3d09fa[_0xc38d('0x2f')]:_0x4b1f8f['model'];if(_0x1ab0b8[_0xc38d('0x2c')][_0xc38d('0x3c')]){_0x3d09fa['include']=[{'all':!![]}];}_0x3d09fa=_[_0xc38d('0x38')]({},_0x3d09fa,_0x1ab0b8[_0xc38d('0x3b')]);return db['CmContactHasPhone'][_0xc38d('0x43')](_0x3d09fa)[_0xc38d('0x1e')](handleEntityNotFound(_0x1a31ae,null))[_0xc38d('0x1e')](respondWithResult(_0x1a31ae,null))[_0xc38d('0x40')](handleError(_0x1a31ae,null));};exports[_0xc38d('0x44')]=function(_0x3622dc,_0x2abd78){return db[_0xc38d('0x26')][_0xc38d('0x44')](_0x3622dc[_0xc38d('0x45')],{})[_0xc38d('0x1e')](function(_0xb3ce98){var _0x245fc1=_0x3622dc[_0xc38d('0x46')]['get']({'plain':!![]});if(!_0x245fc1)throw new Error(_0xc38d('0x47'));if(_0x245fc1[_0xc38d('0x48')]===_0xc38d('0x46')){var _0x4d5445=_0xb3ce98[_0xc38d('0x1f')]({'plain':!![]});var _0x54e5b2=_0xc38d('0x49');return db[_0xc38d('0x4a')][_0xc38d('0x43')]({'where':{'name':_0x54e5b2,'userProfileId':_0x245fc1['userProfileId']},'raw':!![]})[_0xc38d('0x1e')](function(_0xbb151d){if(_0xbb151d&&_0xbb151d[_0xc38d('0x4b')]===0x0){return db[_0xc38d('0x20')]['create']({'name':_0x4d5445[_0xc38d('0x23')],'resourceId':_0x4d5445['id'],'type':_0xbb151d[_0xc38d('0x23')],'sectionId':_0xbb151d['id']},{})[_0xc38d('0x1e')](function(){return _0xb3ce98;});}else{return _0xb3ce98;}})[_0xc38d('0x40')](function(_0x2f64b1){logger[_0xc38d('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f64b1);throw _0x2f64b1;});}return _0xb3ce98;})['then'](respondWithResult(_0x2abd78,0xc9))[_0xc38d('0x40')](handleError(_0x2abd78,null));};exports[_0xc38d('0x1d')]=function(_0x444642,_0x4f52f3){if(_0x444642[_0xc38d('0x45')]['id']){delete _0x444642[_0xc38d('0x45')]['id'];}return db['CmContactHasPhone'][_0xc38d('0x43')]({'where':{'id':_0x444642[_0xc38d('0x41')]['id']}})[_0xc38d('0x1e')](handleEntityNotFound(_0x4f52f3,null))[_0xc38d('0x1e')](saveUpdates(_0x444642[_0xc38d('0x45')],null))[_0xc38d('0x1e')](respondWithResult(_0x4f52f3,null))[_0xc38d('0x40')](handleError(_0x4f52f3,null));};exports[_0xc38d('0x21')]=function(_0x36d5f0,_0x2a3dea){return db['CmContactHasPhone'][_0xc38d('0x43')]({'where':{'id':_0x36d5f0[_0xc38d('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a3dea,null))[_0xc38d('0x1e')](removeEntity(_0x2a3dea,null))[_0xc38d('0x40')](handleError(_0x2a3dea,null));};
\ No newline at end of file
+var _0x4c09=['eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CmContactHasPhones','UserProfileResource','error','stack','name','send','index','CmContactHasPhone','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x2e6964,_0x76fdb3){var _0x473f99=function(_0x1789ac){while(--_0x1789ac){_0x2e6964['push'](_0x2e6964['shift']());}};_0x473f99(++_0x76fdb3);}(_0x4c09,0x19f));var _0x94c0=function(_0x5837b1,_0x54229a){_0x5837b1=_0x5837b1-0x0;var _0x490d8b=_0x4c09[_0x5837b1];return _0x490d8b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x94c0('0x0'));var rimraf=require(_0x94c0('0x1'));var zipdir=require(_0x94c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x94c0('0x3'));var BPromise=require(_0x94c0('0x4'));var Mustache=require(_0x94c0('0x5'));var util=require(_0x94c0('0x6'));var path=require('path');var sox=require(_0x94c0('0x7'));var csv=require(_0x94c0('0x8'));var ejs=require(_0x94c0('0x9'));var fs=require('fs');var _=require(_0x94c0('0xa'));var squel=require(_0x94c0('0xb'));var crypto=require(_0x94c0('0xc'));var jsforce=require(_0x94c0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x94c0('0x8'));var querystring=require(_0x94c0('0xe'));var Papa=require(_0x94c0('0xf'));var Redis=require('ioredis');var authService=require(_0x94c0('0x10'));var qs=require(_0x94c0('0x11'));var as=require(_0x94c0('0x12'));var hardwareService=require(_0x94c0('0x13'));var logger=require(_0x94c0('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x94c0('0x15'))['db'];function respondWithStatusCode(_0x28a042,_0x384121){_0x384121=_0x384121||0xcc;return function(_0x213a64){if(_0x213a64){return _0x28a042[_0x94c0('0x16')](_0x384121);}return _0x28a042[_0x94c0('0x17')](_0x384121)[_0x94c0('0x18')]();};}function respondWithResult(_0x53f663,_0x21510e){_0x21510e=_0x21510e||0xc8;return function(_0x557ff4){if(_0x557ff4){return _0x53f663[_0x94c0('0x17')](_0x21510e)['json'](_0x557ff4);}};}function respondWithFilteredResult(_0x580ca8,_0x5c1f87){return function(_0x45c00d){if(_0x45c00d){var _0x56c3e9=_0x45c00d[_0x94c0('0x19')],_0x51ef7d=_0x5c1f87[_0x94c0('0x1a')],_0x237f78=_0x5c1f87['offset']+_0x5c1f87['limit'],_0x75685b;if(_0x237f78>=_0x56c3e9){_0x237f78=_0x56c3e9;_0x75685b=0xc8;}else{_0x75685b=0xce;}_0x580ca8['status'](_0x75685b);return _0x580ca8[_0x94c0('0x1b')](_0x94c0('0x1c'),_0x51ef7d+'-'+_0x237f78+'/'+_0x56c3e9)[_0x94c0('0x1d')](_0x45c00d);}return null;};}function patchUpdates(_0x46a83c){return function(_0x416f21){try{jsonpatch[_0x94c0('0x1e')](_0x416f21,_0x46a83c,!![]);}catch(_0x333eb2){return BPromise[_0x94c0('0x1f')](_0x333eb2);}return _0x416f21[_0x94c0('0x20')]();};}function saveUpdates(_0x296a77,_0x2f90b8){return function(_0x2c9ecc){if(_0x2c9ecc){return _0x2c9ecc[_0x94c0('0x21')](_0x296a77)[_0x94c0('0x22')](function(_0x3b8e54){return _0x3b8e54;});}return null;};}function removeEntity(_0x5a3577,_0x1ac7cc){return function(_0xd6ef0f){if(_0xd6ef0f){return _0xd6ef0f[_0x94c0('0x23')]()['then'](function(){var _0x35443c=_0xd6ef0f[_0x94c0('0x24')]({'plain':!![]});var _0x1f8f15=_0x94c0('0x25');return db[_0x94c0('0x26')][_0x94c0('0x23')]({'where':{'type':_0x1f8f15,'resourceId':_0x35443c['id']}})[_0x94c0('0x22')](function(){return _0xd6ef0f;});})[_0x94c0('0x22')](function(){_0x5a3577[_0x94c0('0x17')](0xcc)[_0x94c0('0x18')]();});}};}function handleEntityNotFound(_0x1b83b7,_0x167525){return function(_0x3d6d5d){if(!_0x3d6d5d){_0x1b83b7['sendStatus'](0x194);}return _0x3d6d5d;};}function handleError(_0x4622e3,_0x3527f8){_0x3527f8=_0x3527f8||0x1f4;return function(_0x9bbddc){logger[_0x94c0('0x27')](_0x9bbddc[_0x94c0('0x28')]);if(_0x9bbddc['name']){delete _0x9bbddc[_0x94c0('0x29')];}_0x4622e3[_0x94c0('0x17')](_0x3527f8)[_0x94c0('0x2a')](_0x9bbddc);};}exports[_0x94c0('0x2b')]=function(_0x103473,_0x46fd66){var _0x5130d9={},_0x4793d7={},_0x32569a={'count':0x0,'rows':[]};var _0x728584=_['map'](db[_0x94c0('0x2c')][_0x94c0('0x2d')],function(_0x57d0be){return{'name':_0x57d0be[_0x94c0('0x2e')],'type':_0x57d0be['type'][_0x94c0('0x2f')]};});_0x4793d7[_0x94c0('0x30')]=_['map'](_0x728584,_0x94c0('0x29'));_0x4793d7['query']=_[_0x94c0('0x31')](_0x103473[_0x94c0('0x32')]);_0x4793d7['filters']=_[_0x94c0('0x33')](_0x4793d7[_0x94c0('0x30')],_0x4793d7[_0x94c0('0x32')]);_0x5130d9[_0x94c0('0x34')]=_[_0x94c0('0x33')](_0x4793d7[_0x94c0('0x30')],qs[_0x94c0('0x35')](_0x103473['query'][_0x94c0('0x35')]));_0x5130d9[_0x94c0('0x34')]=_0x5130d9[_0x94c0('0x34')]['length']?_0x5130d9['attributes']:_0x4793d7[_0x94c0('0x30')];if(!_0x103473[_0x94c0('0x32')][_0x94c0('0x36')](_0x94c0('0x37'))){_0x5130d9['limit']=qs[_0x94c0('0x38')](_0x103473[_0x94c0('0x32')]['limit']);_0x5130d9['offset']=qs[_0x94c0('0x1a')](_0x103473[_0x94c0('0x32')][_0x94c0('0x1a')]);}_0x5130d9[_0x94c0('0x39')]=qs[_0x94c0('0x3a')](_0x103473[_0x94c0('0x32')][_0x94c0('0x3a')]);_0x5130d9[_0x94c0('0x3b')]=qs[_0x94c0('0x3c')](_[_0x94c0('0x3d')](_0x103473[_0x94c0('0x32')],_0x4793d7[_0x94c0('0x3c')]),_0x728584);if(_0x103473[_0x94c0('0x32')][_0x94c0('0x3e')]){_0x5130d9[_0x94c0('0x3b')]=_[_0x94c0('0x3f')](_0x5130d9[_0x94c0('0x3b')],{'$or':_[_0x94c0('0x40')](_0x728584,function(_0x35ca19){if(_0x35ca19[_0x94c0('0x41')]!=='VIRTUAL'){var _0x41043e={};_0x41043e[_0x35ca19['name']]={'$like':'%'+_0x103473[_0x94c0('0x32')]['filter']+'%'};return _0x41043e;}})});}_0x5130d9=_[_0x94c0('0x3f')]({},_0x5130d9,_0x103473[_0x94c0('0x42')]);var _0x2f35a5={'where':_0x5130d9[_0x94c0('0x3b')]};return db[_0x94c0('0x2c')][_0x94c0('0x19')](_0x2f35a5)[_0x94c0('0x22')](function(_0xe4d0fe){_0x32569a['count']=_0xe4d0fe;if(_0x103473[_0x94c0('0x32')][_0x94c0('0x43')]){_0x5130d9[_0x94c0('0x44')]=[{'all':!![]}];}return db[_0x94c0('0x2c')][_0x94c0('0x45')](_0x5130d9);})[_0x94c0('0x22')](function(_0xe3c51d){_0x32569a[_0x94c0('0x46')]=_0xe3c51d;return _0x32569a;})[_0x94c0('0x22')](respondWithFilteredResult(_0x46fd66,_0x5130d9))[_0x94c0('0x47')](handleError(_0x46fd66,null));};exports[_0x94c0('0x48')]=function(_0x42b1b4,_0x1ce910){var _0x11a707={'raw':!![],'where':{'id':_0x42b1b4[_0x94c0('0x49')]['id']}},_0x2198e2={};_0x2198e2[_0x94c0('0x30')]=_['keys'](db['CmContactHasPhone']['rawAttributes']);_0x2198e2[_0x94c0('0x32')]=_['keys'](_0x42b1b4[_0x94c0('0x32')]);_0x2198e2['filters']=_[_0x94c0('0x33')](_0x2198e2['model'],_0x2198e2[_0x94c0('0x32')]);_0x11a707[_0x94c0('0x34')]=_[_0x94c0('0x33')](_0x2198e2['model'],qs[_0x94c0('0x35')](_0x42b1b4[_0x94c0('0x32')][_0x94c0('0x35')]));_0x11a707[_0x94c0('0x34')]=_0x11a707[_0x94c0('0x34')][_0x94c0('0x4a')]?_0x11a707[_0x94c0('0x34')]:_0x2198e2['model'];if(_0x42b1b4[_0x94c0('0x32')]['includeAll']){_0x11a707['include']=[{'all':!![]}];}_0x11a707=_[_0x94c0('0x3f')]({},_0x11a707,_0x42b1b4[_0x94c0('0x42')]);return db[_0x94c0('0x2c')][_0x94c0('0x4b')](_0x11a707)['then'](handleEntityNotFound(_0x1ce910,null))[_0x94c0('0x22')](respondWithResult(_0x1ce910,null))[_0x94c0('0x47')](handleError(_0x1ce910,null));};exports['create']=function(_0x280912,_0x3fc519){return db[_0x94c0('0x2c')][_0x94c0('0x4c')](_0x280912[_0x94c0('0x4d')],{})[_0x94c0('0x22')](function(_0x449abd){var _0x325e46=_0x280912[_0x94c0('0x4e')][_0x94c0('0x24')]({'plain':!![]});if(!_0x325e46)throw new Error(_0x94c0('0x4f'));if(_0x325e46['role']===_0x94c0('0x4e')){var _0x9d5a8d=_0x449abd[_0x94c0('0x24')]({'plain':!![]});var _0x32b253=_0x94c0('0x25');return db[_0x94c0('0x50')][_0x94c0('0x4b')]({'where':{'name':_0x32b253,'userProfileId':_0x325e46['userProfileId']},'raw':!![]})[_0x94c0('0x22')](function(_0x138572){if(_0x138572&&_0x138572[_0x94c0('0x51')]===0x0){return db[_0x94c0('0x26')][_0x94c0('0x4c')]({'name':_0x9d5a8d['name'],'resourceId':_0x9d5a8d['id'],'type':_0x138572['name'],'sectionId':_0x138572['id']},{})[_0x94c0('0x22')](function(){return _0x449abd;});}else{return _0x449abd;}})[_0x94c0('0x47')](function(_0x3f38fd){logger[_0x94c0('0x27')](_0x94c0('0x52'),_0x3f38fd);throw _0x3f38fd;});}return _0x449abd;})['then'](respondWithResult(_0x3fc519,0xc9))['catch'](handleError(_0x3fc519,null));};exports[_0x94c0('0x21')]=function(_0x33ce35,_0x421352){if(_0x33ce35['body']['id']){delete _0x33ce35['body']['id'];}return db[_0x94c0('0x2c')][_0x94c0('0x4b')]({'where':{'id':_0x33ce35[_0x94c0('0x49')]['id']}})[_0x94c0('0x22')](handleEntityNotFound(_0x421352,null))[_0x94c0('0x22')](saveUpdates(_0x33ce35[_0x94c0('0x4d')],null))[_0x94c0('0x22')](respondWithResult(_0x421352,null))[_0x94c0('0x47')](handleError(_0x421352,null));};exports['destroy']=function(_0x38d3c3,_0x4f92dd){return db['CmContactHasPhone'][_0x94c0('0x4b')]({'where':{'id':_0x38d3c3[_0x94c0('0x49')]['id']}})[_0x94c0('0x22')](handleEntityNotFound(_0x4f92dd,null))[_0x94c0('0x22')](removeEntity(_0x4f92dd,null))[_0x94c0('0x47')](handleError(_0x4f92dd,null));};
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.model.js b/server/api/cmContactHasPhone/cmContactHasPhone.model.js
index 509e155..17d801d 100644
--- a/server/api/cmContactHasPhone/cmContactHasPhone.model.js
+++ b/server/api/cmContactHasPhone/cmContactHasPhone.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ec7=['../../config/environment','CmContactHasPhone','cm_contact_has_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x264a0d,_0xfa9aac){var _0x8d4f6f=function(_0x25c1f7){while(--_0x25c1f7){_0x264a0d['push'](_0x264a0d['shift']());}};_0x8d4f6f(++_0xfa9aac);}(_0x0ec7,0x1dc));var _0x70ec=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0ec7[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x70ec('0x0'));var util=require(_0x70ec('0x1'));var logger=require(_0x70ec('0x2'))(_0x70ec('0x3'));var moment=require(_0x70ec('0x4'));var BPromise=require(_0x70ec('0x5'));var rp=require(_0x70ec('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x70ec('0x7'));var config=require(_0x70ec('0x8'));var attributes=require('./cmContactHasPhone.attributes');module['exports']=function(_0x225c64,_0x25500a){return _0x225c64['define'](_0x70ec('0x9'),attributes,{'tableName':_0x70ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa57a=['path','../../config/environment','./cmContactHasPhone.attributes','exports','define','CmContactHasPhone','cm_contact_has_phones','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa57a,0x173));var _0xaa57=function(_0x59e1f7,_0x48e1fe){_0x59e1f7=_0x59e1f7-0x0;var _0x5b8ec4=_0xa57a[_0x59e1f7];return _0x5b8ec4;};'use strict';var _=require('lodash');var util=require(_0xaa57('0x0'));var logger=require(_0xaa57('0x1'))(_0xaa57('0x2'));var moment=require(_0xaa57('0x3'));var BPromise=require(_0xaa57('0x4'));var rp=require(_0xaa57('0x5'));var fs=require('fs');var path=require(_0xaa57('0x6'));var rimraf=require('rimraf');var config=require(_0xaa57('0x7'));var attributes=require(_0xaa57('0x8'));module[_0xaa57('0x9')]=function(_0xdfabc8,_0x69441d){return _0xdfabc8[_0xaa57('0xa')](_0xaa57('0xb'),attributes,{'tableName':_0xaa57('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js b/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js
index de31a7c..f998db9 100644
--- a/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js
+++ b/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8cb8=['client','info','CmContactHasPhone,\x20%s,\x20%s','request\x20sent','CmContactHasPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x4d1948,_0x3a9b30){var _0x433a2a=function(_0xda07d3){while(--_0xda07d3){_0x4d1948['push'](_0x4d1948['shift']());}};_0x433a2a(++_0x3a9b30);}(_0x8cb8,0x1da));var _0x88cb=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0x8cb8[_0x44039a];return _0x525de5;};'use strict';var _=require('lodash');var util=require(_0x88cb('0x0'));var moment=require('moment');var BPromise=require(_0x88cb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88cb('0x2'))['db'];var utils=require(_0x88cb('0x3'));var logger=require(_0x88cb('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x88cb('0x5'));var client=jayson[_0x88cb('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47a263,_0x202c6a,_0x5e23e1){return new BPromise(function(_0x549b92,_0x163174){return client['request'](_0x47a263,_0x5e23e1)['then'](function(_0x261d83){logger[_0x88cb('0x7')](_0x88cb('0x8'),_0x202c6a,_0x88cb('0x9'));logger['debug'](_0x88cb('0xa'),_0x202c6a,_0x88cb('0x9'),JSON[_0x88cb('0xb')](_0x261d83));if(_0x261d83[_0x88cb('0xc')]){if(_0x261d83[_0x88cb('0xc')]['code']===0x1f4){logger['error'](_0x88cb('0x8'),_0x202c6a,_0x261d83[_0x88cb('0xc')][_0x88cb('0xd')]);return _0x163174(_0x261d83[_0x88cb('0xc')][_0x88cb('0xd')]);}logger[_0x88cb('0xc')](_0x88cb('0x8'),_0x202c6a,_0x261d83[_0x88cb('0xc')][_0x88cb('0xd')]);return _0x549b92(_0x261d83['error'][_0x88cb('0xd')]);}else{logger[_0x88cb('0x7')](_0x88cb('0x8'),_0x202c6a,_0x88cb('0x9'));_0x549b92(_0x261d83[_0x88cb('0xe')][_0x88cb('0xd')]);}})[_0x88cb('0xf')](function(_0xbe8e9d){logger['error'](_0x88cb('0x8'),_0x202c6a,_0xbe8e9d);_0x163174(_0xbe8e9d);});});}
\ No newline at end of file
+var _0x5353=['CmContactHasPhone,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmContactHasPhone,\x20%s,\x20%s','request\x20sent'];(function(_0x4a258c,_0x39c6a7){var _0x2803a5=function(_0x15e3f3){while(--_0x15e3f3){_0x4a258c['push'](_0x4a258c['shift']());}};_0x2803a5(++_0x39c6a7);}(_0x5353,0x12f));var _0x3535=function(_0x31c9d9,_0x3808b8){_0x31c9d9=_0x31c9d9-0x0;var _0x19e73c=_0x5353[_0x31c9d9];return _0x19e73c;};'use strict';var _=require(_0x3535('0x0'));var util=require('util');var moment=require(_0x3535('0x1'));var BPromise=require(_0x3535('0x2'));var rs=require(_0x3535('0x3'));var fs=require('fs');var Redis=require(_0x3535('0x4'));var db=require(_0x3535('0x5'))['db'];var utils=require(_0x3535('0x6'));var logger=require(_0x3535('0x7'))(_0x3535('0x8'));var config=require(_0x3535('0x9'));var jayson=require(_0x3535('0xa'));var client=jayson['client'][_0x3535('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x498868,_0x1c92fd,_0x268873){return new BPromise(function(_0x3e3500,_0x5437a2){return client[_0x3535('0xc')](_0x498868,_0x268873)[_0x3535('0xd')](function(_0x2da555){logger[_0x3535('0xe')](_0x3535('0xf'),_0x1c92fd,_0x3535('0x10'));logger['debug'](_0x3535('0x11'),_0x1c92fd,_0x3535('0x10'),JSON['stringify'](_0x2da555));if(_0x2da555[_0x3535('0x12')]){if(_0x2da555['error']['code']===0x1f4){logger[_0x3535('0x12')](_0x3535('0xf'),_0x1c92fd,_0x2da555[_0x3535('0x12')][_0x3535('0x13')]);return _0x5437a2(_0x2da555[_0x3535('0x12')][_0x3535('0x13')]);}logger[_0x3535('0x12')]('CmContactHasPhone,\x20%s,\x20%s',_0x1c92fd,_0x2da555[_0x3535('0x12')]['message']);return _0x3e3500(_0x2da555[_0x3535('0x12')][_0x3535('0x13')]);}else{logger[_0x3535('0xe')]('CmContactHasPhone,\x20%s,\x20%s',_0x1c92fd,_0x3535('0x10'));_0x3e3500(_0x2da555['result'][_0x3535('0x13')]);}})['catch'](function(_0x519c33){logger[_0x3535('0x12')](_0x3535('0xf'),_0x1c92fd,_0x519c33);_0x5437a2(_0x519c33);});});}
\ No newline at end of file
diff --git a/server/api/cmContactHasPhone/index.js b/server/api/cmContactHasPhone/index.js
index ff2da3f..f5fa541 100644
--- a/server/api/cmContactHasPhone/index.js
+++ b/server/api/cmContactHasPhone/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc1c=['Router','../../components/auth/service','../../components/interaction/service','./cmContactHasPhone.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x24fcf3,_0x87a2c4){var _0x4b6ed6=function(_0x59717d){while(--_0x59717d){_0x24fcf3['push'](_0x24fcf3['shift']());}};_0x4b6ed6(++_0x87a2c4);}(_0xfc1c,0x119));var _0xcfc1=function(_0x45f0ab,_0x166cd2){_0x45f0ab=_0x45f0ab-0x0;var _0x53e0ee=_0xfc1c[_0x45f0ab];return _0x53e0ee;};'use strict';var multer=require('multer');var util=require(_0xcfc1('0x0'));var path=require(_0xcfc1('0x1'));var timeout=require(_0xcfc1('0x2'));var express=require(_0xcfc1('0x3'));var router=express[_0xcfc1('0x4')]();var auth=require(_0xcfc1('0x5'));var interaction=require(_0xcfc1('0x6'));var config=require('../../config/environment');var controller=require(_0xcfc1('0x7'));router['get']('/',auth[_0xcfc1('0x8')](),controller[_0xcfc1('0x9')]);router[_0xcfc1('0xa')](_0xcfc1('0xb'),auth[_0xcfc1('0x8')](),controller['show']);router[_0xcfc1('0xc')]('/',auth[_0xcfc1('0x8')](),controller[_0xcfc1('0xd')]);router[_0xcfc1('0xe')](_0xcfc1('0xb'),auth[_0xcfc1('0x8')](),controller[_0xcfc1('0xf')]);router[_0xcfc1('0x10')](_0xcfc1('0xb'),auth[_0xcfc1('0x8')](),controller[_0xcfc1('0x11')]);module[_0xcfc1('0x12')]=router;
\ No newline at end of file
+var _0xfb1f=['index','get','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmContactHasPhone.controller','isAuthenticated'];(function(_0x20f356,_0x2c1aed){var _0x38f523=function(_0x298c84){while(--_0x298c84){_0x20f356['push'](_0x20f356['shift']());}};_0x38f523(++_0x2c1aed);}(_0xfb1f,0xe1));var _0xffb1=function(_0x4cda36,_0x4e6758){_0x4cda36=_0x4cda36-0x0;var _0x20fcc4=_0xfb1f[_0x4cda36];return _0x20fcc4;};'use strict';var multer=require(_0xffb1('0x0'));var util=require(_0xffb1('0x1'));var path=require('path');var timeout=require(_0xffb1('0x2'));var express=require(_0xffb1('0x3'));var router=express[_0xffb1('0x4')]();var auth=require(_0xffb1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffb1('0x6'));var controller=require(_0xffb1('0x7'));router['get']('/',auth[_0xffb1('0x8')](),controller[_0xffb1('0x9')]);router[_0xffb1('0xa')](_0xffb1('0xb'),auth[_0xffb1('0x8')](),controller[_0xffb1('0xc')]);router[_0xffb1('0xd')]('/',auth[_0xffb1('0x8')](),controller[_0xffb1('0xe')]);router[_0xffb1('0xf')](_0xffb1('0xb'),auth[_0xffb1('0x8')](),controller['update']);router['delete'](_0xffb1('0xb'),auth[_0xffb1('0x8')](),controller[_0xffb1('0x10')]);module[_0xffb1('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js
index 53b6075..876e8d1 100644
--- a/server/api/cmCustomField/cmCustomField.attributes.js
+++ b/server/api/cmCustomField/cmCustomField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x30c9=['setDataValue','alias','name','STRING','TEXT','long','type','select','parse','values','isArray','sequelize','lodash','exports','VIRTUAL','getDataValue'];(function(_0x264d9e,_0x11bf26){var _0x45a214=function(_0x2ecf95){while(--_0x2ecf95){_0x264d9e['push'](_0x264d9e['shift']());}};_0x45a214(++_0x11bf26);}(_0x30c9,0x1db));var _0x930c=function(_0x57b02f,_0x58db5a){_0x57b02f=_0x57b02f-0x0;var _0x5d301d=_0x30c9[_0x57b02f];return _0x5d301d;};'use strict';var Sequelize=require(_0x930c('0x0'));var _=require(_0x930c('0x1'));module[_0x930c('0x2')]={'name':{'type':Sequelize[_0x930c('0x3')],'get':function(_0x8982ff){return this[_0x930c('0x4')]('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x45fcc6){this[_0x930c('0x5')](_0x930c('0x6'),_0x45fcc6?_0x45fcc6:this['getDataValue'](_0x930c('0x7')));}},'type':{'type':Sequelize[_0x930c('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0x930c('0x9')](_0x930c('0xa')),'get':function(){if(this[_0x930c('0x4')](_0x930c('0xb'))===_0x930c('0xc')){return JSON[_0x930c('0xd')](this['getDataValue'](_0x930c('0xe')));}else{return this[_0x930c('0x4')](_0x930c('0xe'));}},'set':function(_0x232540){if(Array[_0x930c('0xf')](_0x232540)){this[_0x930c('0x5')]('values',JSON['stringify'](_0x232540));}else{this[_0x930c('0x5')]('values',_0x232540);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x89ff=['STRING','TEXT','type','select','values','stringify','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','name'];(function(_0x39a04c,_0x2b4002){var _0x580cb0=function(_0x138902){while(--_0x138902){_0x39a04c['push'](_0x39a04c['shift']());}};_0x580cb0(++_0x2b4002);}(_0x89ff,0x165));var _0xf89f=function(_0x2e3ebb,_0x5afc59){_0x2e3ebb=_0x2e3ebb-0x0;var _0x8f027f=_0x89ff[_0x2e3ebb];return _0x8f027f;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf89f('0x0'));module[_0xf89f('0x1')]={'name':{'type':Sequelize[_0xf89f('0x2')],'get':function(_0x58b439){return this[_0xf89f('0x3')](_0xf89f('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x21afa1){this[_0xf89f('0x5')]('alias',_0x21afa1?_0x21afa1:this[_0xf89f('0x3')](_0xf89f('0x6')));}},'type':{'type':Sequelize[_0xf89f('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xf89f('0x8')]('long'),'get':function(){if(this[_0xf89f('0x3')](_0xf89f('0x9'))===_0xf89f('0xa')){return JSON['parse'](this['getDataValue'](_0xf89f('0xb')));}else{return this[_0xf89f('0x3')](_0xf89f('0xb'));}},'set':function(_0x268e7b){if(Array['isArray'](_0x268e7b)){this[_0xf89f('0x5')](_0xf89f('0xb'),JSON[_0xf89f('0xc')](_0x268e7b));}else{this[_0xf89f('0x5')]('values',_0x268e7b);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js
index 6078b56..3024823 100644
--- a/server/api/cmCustomField/cmCustomField.controller.js
+++ b/server/api/cmCustomField/cmCustomField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd2eb=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','index','CmCustomField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','map','VIRTUAL','name','options','count','includeAll','include','findAll','catch','show','params','body','find','create','sequelize','transaction','text','Sequelize','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x59f4c2,_0x87202){var _0xe3dfd1=function(_0x236c6f){while(--_0x236c6f){_0x59f4c2['push'](_0x59f4c2['shift']());}};_0xe3dfd1(++_0x87202);}(_0xd2eb,0x1d4));var _0xbd2e=function(_0x2d46ab,_0x4c8990){_0x2d46ab=_0x2d46ab-0x0;var _0x446733=_0xd2eb[_0x2d46ab];return _0x446733;};'use strict';var pdf=require(_0xbd2e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbd2e('0x1'));var zipdir=require(_0xbd2e('0x2'));var jsonpatch=require(_0xbd2e('0x3'));var rp=require(_0xbd2e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd2e('0x5'));var util=require('util');var path=require(_0xbd2e('0x6'));var sox=require(_0xbd2e('0x7'));var csv=require('to-csv');var ejs=require(_0xbd2e('0x8'));var fs=require('fs');var _=require(_0xbd2e('0x9'));var squel=require(_0xbd2e('0xa'));var crypto=require(_0xbd2e('0xb'));var jsforce=require(_0xbd2e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbd2e('0xd'));var querystring=require(_0xbd2e('0xe'));var Papa=require(_0xbd2e('0xf'));var Redis=require(_0xbd2e('0x10'));var authService=require(_0xbd2e('0x11'));var qs=require(_0xbd2e('0x12'));var as=require(_0xbd2e('0x13'));var hardwareService=require(_0xbd2e('0x14'));var logger=require(_0xbd2e('0x15'))(_0xbd2e('0x16'));var utils=require(_0xbd2e('0x17'));var config=require(_0xbd2e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe70cd8,_0x1e02f1){_0x1e02f1=_0x1e02f1||0xcc;return function(_0x1b56f6){if(_0x1b56f6){return _0xe70cd8['sendStatus'](_0x1e02f1);}return _0xe70cd8[_0xbd2e('0x19')](_0x1e02f1)['end']();};}function respondWithResult(_0x35c71,_0x30b84b){_0x30b84b=_0x30b84b||0xc8;return function(_0x8ec13d){if(_0x8ec13d){return _0x35c71[_0xbd2e('0x19')](_0x30b84b)[_0xbd2e('0x1a')](_0x8ec13d);}};}function respondWithFilteredResult(_0x115147,_0x2b4ad0){return function(_0x4e9932){if(_0x4e9932){var _0x50ba8d=_0x4e9932['count'],_0x2e47c7=_0x2b4ad0[_0xbd2e('0x1b')],_0x2b04c8=_0x2b4ad0[_0xbd2e('0x1b')]+_0x2b4ad0[_0xbd2e('0x1c')],_0x4e921c;if(_0x2b04c8>=_0x50ba8d){_0x2b04c8=_0x50ba8d;_0x4e921c=0xc8;}else{_0x4e921c=0xce;}_0x115147['status'](_0x4e921c);return _0x115147[_0xbd2e('0x1d')](_0xbd2e('0x1e'),_0x2e47c7+'-'+_0x2b04c8+'/'+_0x50ba8d)[_0xbd2e('0x1a')](_0x4e9932);}return null;};}function patchUpdates(_0x42ed25){return function(_0x1b8335){try{jsonpatch[_0xbd2e('0x1f')](_0x1b8335,_0x42ed25,!![]);}catch(_0x12d125){return BPromise[_0xbd2e('0x20')](_0x12d125);}return _0x1b8335['save']();};}function saveUpdates(_0xefb658,_0x1ace2a){return function(_0x277d38){if(_0x277d38){return _0x277d38[_0xbd2e('0x21')](_0xefb658)[_0xbd2e('0x22')](function(_0x14cb39){return _0x14cb39;});}return null;};}function removeEntity(_0x2952a5,_0x10bf56){return function(_0x37bb8d){if(_0x37bb8d){return _0x37bb8d[_0xbd2e('0x23')]()[_0xbd2e('0x22')](function(){_0x2952a5[_0xbd2e('0x19')](0xcc)[_0xbd2e('0x24')]();});}};}function handleEntityNotFound(_0x50a736,_0x3d73bb){return function(_0x26cae8){if(!_0x26cae8){_0x50a736[_0xbd2e('0x25')](0x194);}return _0x26cae8;};}function handleError(_0x53aa4,_0x299770){_0x299770=_0x299770||0x1f4;return function(_0x3900cf){logger['error'](_0x3900cf['stack']);if(_0x3900cf['name']){delete _0x3900cf['name'];}_0x53aa4['status'](_0x299770)['send'](_0x3900cf);};}exports[_0xbd2e('0x26')]=function(_0x24295a,_0x528d89){var _0x14e305={},_0x46e2d4={},_0x173e9a={'count':0x0,'rows':[]};var _0x43dd49=_['map'](db[_0xbd2e('0x27')][_0xbd2e('0x28')],function(_0x2a44d6){return{'name':_0x2a44d6[_0xbd2e('0x29')],'type':_0x2a44d6[_0xbd2e('0x2a')][_0xbd2e('0x2b')]};});_0x46e2d4[_0xbd2e('0x2c')]=_['differenceBy'](_['map'](_0x43dd49,'name'),['name']);_0x46e2d4['query']=_[_0xbd2e('0x2d')](_0x24295a[_0xbd2e('0x2e')]);_0x46e2d4[_0xbd2e('0x2f')]=_[_0xbd2e('0x30')](_0x46e2d4[_0xbd2e('0x2c')],_0x46e2d4[_0xbd2e('0x2e')]);_0x14e305[_0xbd2e('0x31')]=_[_0xbd2e('0x30')](_0x46e2d4[_0xbd2e('0x2c')],qs['fields'](_0x24295a['query'][_0xbd2e('0x32')]));_0x14e305[_0xbd2e('0x31')]=_0x14e305[_0xbd2e('0x31')][_0xbd2e('0x33')]?_0x14e305[_0xbd2e('0x31')]:_0x46e2d4['model'];if(!_0x24295a[_0xbd2e('0x2e')][_0xbd2e('0x34')](_0xbd2e('0x35'))){_0x14e305[_0xbd2e('0x1c')]=qs[_0xbd2e('0x1c')](_0x24295a['query'][_0xbd2e('0x1c')]);_0x14e305[_0xbd2e('0x1b')]=qs[_0xbd2e('0x1b')](_0x24295a['query'][_0xbd2e('0x1b')]);}_0x14e305['order']=qs['sort'](_0x24295a['query'][_0xbd2e('0x36')]);_0x14e305['where']=qs[_0xbd2e('0x2f')](_[_0xbd2e('0x37')](_0x24295a[_0xbd2e('0x2e')],_0x46e2d4[_0xbd2e('0x2f')]),_0x43dd49);if(_0x24295a['query']['filter']){_0x14e305[_0xbd2e('0x38')]=_[_0xbd2e('0x39')](_0x14e305['where'],{'$or':_[_0xbd2e('0x3a')](_0x43dd49,function(_0x369ea2){if(_0x369ea2[_0xbd2e('0x2a')]!==_0xbd2e('0x3b')){var _0x101fc2={};_0x101fc2[_0x369ea2[_0xbd2e('0x3c')]]={'$like':'%'+_0x24295a['query']['filter']+'%'};return _0x101fc2;}})});}_0x14e305=_[_0xbd2e('0x39')]({},_0x14e305,_0x24295a[_0xbd2e('0x3d')]);var _0x445bad={'where':_0x14e305['where']};return db[_0xbd2e('0x27')][_0xbd2e('0x3e')](_0x445bad)[_0xbd2e('0x22')](function(_0x6b811a){_0x173e9a[_0xbd2e('0x3e')]=_0x6b811a;if(_0x24295a['query'][_0xbd2e('0x3f')]){_0x14e305[_0xbd2e('0x40')]=[{'all':!![]}];}return db['CmCustomField'][_0xbd2e('0x41')](_0x14e305);})['then'](function(_0x2eaf4f){_0x173e9a['rows']=_0x2eaf4f;return _0x173e9a;})[_0xbd2e('0x22')](respondWithFilteredResult(_0x528d89,_0x14e305))[_0xbd2e('0x42')](handleError(_0x528d89,null));};exports[_0xbd2e('0x43')]=function(_0x3dd613,_0x39049){var _0x16c32b={'raw':!![],'where':{'id':_0x3dd613[_0xbd2e('0x44')]['id']}},_0x56bc2e={};_0x56bc2e[_0xbd2e('0x2c')]=_['keys'](db[_0xbd2e('0x27')]['rawAttributes']);_0x56bc2e[_0xbd2e('0x2e')]=_[_0xbd2e('0x2d')](_0x3dd613[_0xbd2e('0x2e')]);_0x56bc2e[_0xbd2e('0x2f')]=_['intersection'](_0x56bc2e[_0xbd2e('0x2c')],_0x56bc2e['query']);_0x16c32b[_0xbd2e('0x31')]=_['intersection'](_0x56bc2e['model'],qs[_0xbd2e('0x32')](_0x3dd613[_0xbd2e('0x2e')]['fields']));_0x16c32b['attributes']=_0x16c32b['attributes']['length']?_0x16c32b['attributes']:_0x56bc2e[_0xbd2e('0x2c')];if(_0x3dd613['query'][_0xbd2e('0x3f')]){_0x16c32b[_0xbd2e('0x40')]=[{'all':!![]}];}_0x16c32b=_[_0xbd2e('0x39')]({},_0x16c32b,_0x3dd613[_0xbd2e('0x3d')]);return db[_0xbd2e('0x27')]['find'](_0x16c32b)[_0xbd2e('0x22')](handleEntityNotFound(_0x39049,null))[_0xbd2e('0x22')](respondWithResult(_0x39049,null))[_0xbd2e('0x42')](handleError(_0x39049,null));};exports['update']=function(_0x551e8d,_0x47da76){if(_0x551e8d[_0xbd2e('0x45')]['id']){delete _0x551e8d['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x551e8d['params']['id']}})[_0xbd2e('0x22')](handleEntityNotFound(_0x47da76,null))['then'](saveUpdates(_0x551e8d[_0xbd2e('0x45')],null))[_0xbd2e('0x22')](respondWithResult(_0x47da76,null))[_0xbd2e('0x42')](handleError(_0x47da76,null));};exports[_0xbd2e('0x23')]=function(_0x3f7dc8,_0x134c4f){return db[_0xbd2e('0x27')][_0xbd2e('0x46')]({'where':{'id':_0x3f7dc8[_0xbd2e('0x44')]['id']}})[_0xbd2e('0x22')](handleEntityNotFound(_0x134c4f,null))[_0xbd2e('0x22')](removeEntity(_0x134c4f,null))[_0xbd2e('0x42')](handleError(_0x134c4f,null));};exports[_0xbd2e('0x47')]=function(_0x22cb59,_0x1b48b4){var _0x4d980c;return db[_0xbd2e('0x48')][_0xbd2e('0x49')](function(_0x4f9591){return db[_0xbd2e('0x27')][_0xbd2e('0x47')](_0x22cb59[_0xbd2e('0x45')],{'transaction':_0x4f9591})[_0xbd2e('0x22')](function(_0x247f43){_0x4d980c=_0x247f43;var _0x2b8e84={'type':db['Sequelize']['TEXT'],'transaction':_0x4f9591};switch(_0x22cb59[_0xbd2e('0x45')][_0xbd2e('0x2a')]){case _0xbd2e('0x4a'):_0x2b8e84[_0xbd2e('0x2a')]=db[_0xbd2e('0x4b')]['TEXT'];break;case'number':_0x2b8e84[_0xbd2e('0x2a')]=db['Sequelize']['INTEGER'];break;case _0xbd2e('0x4c'):_0x2b8e84[_0xbd2e('0x2a')]=db[_0xbd2e('0x4b')][_0xbd2e('0x4d')];_0x2b8e84[_0xbd2e('0x4e')]=![];break;default:}return db[_0xbd2e('0x48')]['queryInterface'][_0xbd2e('0x4f')](_0xbd2e('0x50'),util['format']('cf_%d',_0x4d980c['id']),_0x2b8e84);})[_0xbd2e('0x22')](function(){return _0x4d980c;});})['then'](respondWithResult(_0x1b48b4,0xc9))[_0xbd2e('0x42')](handleError(_0x1b48b4,null));};
\ No newline at end of file
+var _0x82f0=['fieldName','differenceBy','name','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','count','include','findAll','rows','catch','show','rawAttributes','includeAll','options','body','find','params','create','sequelize','transaction','TEXT','type','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','destroy','then','error','stack','send','index','map','CmCustomField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82f0,0x19c));var _0x082f=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x82f0[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x082f('0x0'));var emlformat=require(_0x082f('0x1'));var rimraf=require(_0x082f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x082f('0x3'));var rp=require('request-promise');var moment=require(_0x082f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x082f('0x5'));var util=require(_0x082f('0x6'));var path=require(_0x082f('0x7'));var sox=require(_0x082f('0x8'));var csv=require('to-csv');var ejs=require(_0x082f('0x9'));var fs=require('fs');var _=require(_0x082f('0xa'));var squel=require(_0x082f('0xb'));var crypto=require(_0x082f('0xc'));var jsforce=require(_0x082f('0xd'));var deskjs=require(_0x082f('0xe'));var toCsv=require(_0x082f('0xf'));var querystring=require(_0x082f('0x10'));var Papa=require(_0x082f('0x11'));var Redis=require('ioredis');var authService=require(_0x082f('0x12'));var qs=require(_0x082f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x082f('0x14'));var logger=require(_0x082f('0x15'))(_0x082f('0x16'));var utils=require(_0x082f('0x17'));var config=require(_0x082f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3be392,_0x2bf416){_0x2bf416=_0x2bf416||0xcc;return function(_0x2024c5){if(_0x2024c5){return _0x3be392[_0x082f('0x19')](_0x2bf416);}return _0x3be392[_0x082f('0x1a')](_0x2bf416)[_0x082f('0x1b')]();};}function respondWithResult(_0x409f90,_0x409677){_0x409677=_0x409677||0xc8;return function(_0x404090){if(_0x404090){return _0x409f90['status'](_0x409677)[_0x082f('0x1c')](_0x404090);}};}function respondWithFilteredResult(_0x2a00b6,_0x26f3ad){return function(_0xed424){if(_0xed424){var _0x12a99b=_0xed424['count'],_0x2d32d6=_0x26f3ad[_0x082f('0x1d')],_0x1fe7ca=_0x26f3ad[_0x082f('0x1d')]+_0x26f3ad[_0x082f('0x1e')],_0x2dae85;if(_0x1fe7ca>=_0x12a99b){_0x1fe7ca=_0x12a99b;_0x2dae85=0xc8;}else{_0x2dae85=0xce;}_0x2a00b6['status'](_0x2dae85);return _0x2a00b6[_0x082f('0x1f')](_0x082f('0x20'),_0x2d32d6+'-'+_0x1fe7ca+'/'+_0x12a99b)['json'](_0xed424);}return null;};}function patchUpdates(_0x3ab259){return function(_0x125282){try{jsonpatch['apply'](_0x125282,_0x3ab259,!![]);}catch(_0x2406a7){return BPromise[_0x082f('0x21')](_0x2406a7);}return _0x125282['save']();};}function saveUpdates(_0x2205fc,_0x4d97d0){return function(_0x55a6a3){if(_0x55a6a3){return _0x55a6a3[_0x082f('0x22')](_0x2205fc)['then'](function(_0x2fd2e9){return _0x2fd2e9;});}return null;};}function removeEntity(_0x184e20,_0x1d69bd){return function(_0x172fd4){if(_0x172fd4){return _0x172fd4[_0x082f('0x23')]()[_0x082f('0x24')](function(){_0x184e20[_0x082f('0x1a')](0xcc)[_0x082f('0x1b')]();});}};}function handleEntityNotFound(_0x71300c,_0x36e7f6){return function(_0x413e96){if(!_0x413e96){_0x71300c[_0x082f('0x19')](0x194);}return _0x413e96;};}function handleError(_0x2018ac,_0x3914bd){_0x3914bd=_0x3914bd||0x1f4;return function(_0x5c8c7b){logger[_0x082f('0x25')](_0x5c8c7b[_0x082f('0x26')]);if(_0x5c8c7b['name']){delete _0x5c8c7b['name'];}_0x2018ac[_0x082f('0x1a')](_0x3914bd)[_0x082f('0x27')](_0x5c8c7b);};}exports[_0x082f('0x28')]=function(_0x10a6f7,_0x7fe000){var _0x198acc={},_0x2697d5={},_0x10b067={'count':0x0,'rows':[]};var _0x370e26=_[_0x082f('0x29')](db[_0x082f('0x2a')]['rawAttributes'],function(_0x231e97){return{'name':_0x231e97[_0x082f('0x2b')],'type':_0x231e97['type']['key']};});_0x2697d5['model']=_[_0x082f('0x2c')](_['map'](_0x370e26,_0x082f('0x2d')),['name']);_0x2697d5['query']=_[_0x082f('0x2e')](_0x10a6f7[_0x082f('0x2f')]);_0x2697d5['filters']=_[_0x082f('0x30')](_0x2697d5[_0x082f('0x31')],_0x2697d5[_0x082f('0x2f')]);_0x198acc[_0x082f('0x32')]=_[_0x082f('0x30')](_0x2697d5[_0x082f('0x31')],qs[_0x082f('0x33')](_0x10a6f7[_0x082f('0x2f')]['fields']));_0x198acc[_0x082f('0x32')]=_0x198acc[_0x082f('0x32')][_0x082f('0x34')]?_0x198acc[_0x082f('0x32')]:_0x2697d5['model'];if(!_0x10a6f7['query'][_0x082f('0x35')](_0x082f('0x36'))){_0x198acc[_0x082f('0x1e')]=qs[_0x082f('0x1e')](_0x10a6f7['query'][_0x082f('0x1e')]);_0x198acc[_0x082f('0x1d')]=qs[_0x082f('0x1d')](_0x10a6f7[_0x082f('0x2f')][_0x082f('0x1d')]);}_0x198acc[_0x082f('0x37')]=qs[_0x082f('0x38')](_0x10a6f7[_0x082f('0x2f')]['sort']);_0x198acc[_0x082f('0x39')]=qs[_0x082f('0x3a')](_[_0x082f('0x3b')](_0x10a6f7[_0x082f('0x2f')],_0x2697d5[_0x082f('0x3a')]),_0x370e26);if(_0x10a6f7['query']['filter']){_0x198acc[_0x082f('0x39')]=_['merge'](_0x198acc[_0x082f('0x39')],{'$or':_[_0x082f('0x29')](_0x370e26,function(_0x5af707){if(_0x5af707['type']!==_0x082f('0x3c')){var _0x3abd35={};_0x3abd35[_0x5af707[_0x082f('0x2d')]]={'$like':'%'+_0x10a6f7[_0x082f('0x2f')]['filter']+'%'};return _0x3abd35;}})});}_0x198acc=_[_0x082f('0x3d')]({},_0x198acc,_0x10a6f7['options']);var _0x401c22={'where':_0x198acc[_0x082f('0x39')]};return db[_0x082f('0x2a')]['count'](_0x401c22)[_0x082f('0x24')](function(_0x5bab4d){_0x10b067[_0x082f('0x3e')]=_0x5bab4d;if(_0x10a6f7[_0x082f('0x2f')]['includeAll']){_0x198acc[_0x082f('0x3f')]=[{'all':!![]}];}return db[_0x082f('0x2a')][_0x082f('0x40')](_0x198acc);})[_0x082f('0x24')](function(_0x3fcb07){_0x10b067[_0x082f('0x41')]=_0x3fcb07;return _0x10b067;})['then'](respondWithFilteredResult(_0x7fe000,_0x198acc))[_0x082f('0x42')](handleError(_0x7fe000,null));};exports[_0x082f('0x43')]=function(_0x3bf5c8,_0x46e893){var _0x14564b={'raw':!![],'where':{'id':_0x3bf5c8['params']['id']}},_0x3515cd={};_0x3515cd[_0x082f('0x31')]=_[_0x082f('0x2e')](db[_0x082f('0x2a')][_0x082f('0x44')]);_0x3515cd[_0x082f('0x2f')]=_[_0x082f('0x2e')](_0x3bf5c8['query']);_0x3515cd['filters']=_[_0x082f('0x30')](_0x3515cd[_0x082f('0x31')],_0x3515cd[_0x082f('0x2f')]);_0x14564b[_0x082f('0x32')]=_['intersection'](_0x3515cd['model'],qs[_0x082f('0x33')](_0x3bf5c8[_0x082f('0x2f')][_0x082f('0x33')]));_0x14564b[_0x082f('0x32')]=_0x14564b[_0x082f('0x32')]['length']?_0x14564b[_0x082f('0x32')]:_0x3515cd[_0x082f('0x31')];if(_0x3bf5c8[_0x082f('0x2f')][_0x082f('0x45')]){_0x14564b[_0x082f('0x3f')]=[{'all':!![]}];}_0x14564b=_['merge']({},_0x14564b,_0x3bf5c8[_0x082f('0x46')]);return db[_0x082f('0x2a')]['find'](_0x14564b)[_0x082f('0x24')](handleEntityNotFound(_0x46e893,null))[_0x082f('0x24')](respondWithResult(_0x46e893,null))[_0x082f('0x42')](handleError(_0x46e893,null));};exports['update']=function(_0xfc1ac5,_0x3daaa0){if(_0xfc1ac5['body']['id']){delete _0xfc1ac5[_0x082f('0x47')]['id'];}return db[_0x082f('0x2a')][_0x082f('0x48')]({'where':{'id':_0xfc1ac5[_0x082f('0x49')]['id']}})[_0x082f('0x24')](handleEntityNotFound(_0x3daaa0,null))[_0x082f('0x24')](saveUpdates(_0xfc1ac5[_0x082f('0x47')],null))[_0x082f('0x24')](respondWithResult(_0x3daaa0,null))[_0x082f('0x42')](handleError(_0x3daaa0,null));};exports[_0x082f('0x23')]=function(_0x539220,_0x5d2291){return db['CmCustomField'][_0x082f('0x48')]({'where':{'id':_0x539220['params']['id']}})[_0x082f('0x24')](handleEntityNotFound(_0x5d2291,null))['then'](removeEntity(_0x5d2291,null))[_0x082f('0x42')](handleError(_0x5d2291,null));};exports[_0x082f('0x4a')]=function(_0x1a17d8,_0x4fb5e0){var _0x3ea3ba;return db[_0x082f('0x4b')][_0x082f('0x4c')](function(_0x54d5b4){return db['CmCustomField'][_0x082f('0x4a')](_0x1a17d8[_0x082f('0x47')],{'transaction':_0x54d5b4})['then'](function(_0x39f0f1){_0x3ea3ba=_0x39f0f1;var _0x473290={'type':db['Sequelize'][_0x082f('0x4d')],'transaction':_0x54d5b4};switch(_0x1a17d8[_0x082f('0x47')][_0x082f('0x4e')]){case _0x082f('0x4f'):_0x473290[_0x082f('0x4e')]=db[_0x082f('0x50')][_0x082f('0x4d')];break;case _0x082f('0x51'):_0x473290[_0x082f('0x4e')]=db['Sequelize'][_0x082f('0x52')];break;case _0x082f('0x53'):_0x473290['type']=db[_0x082f('0x50')][_0x082f('0x54')];_0x473290[_0x082f('0x55')]=![];break;default:}return db[_0x082f('0x4b')][_0x082f('0x56')][_0x082f('0x57')](_0x082f('0x58'),util[_0x082f('0x59')](_0x082f('0x5a'),_0x3ea3ba['id']),_0x473290);})[_0x082f('0x24')](function(){return _0x3ea3ba;});})[_0x082f('0x24')](respondWithResult(_0x4fb5e0,0xc9))[_0x082f('0x42')](handleError(_0x4fb5e0,null));};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js
index 7451e73..7c6f9cf 100644
--- a/server/api/cmCustomField/cmCustomField.model.js
+++ b/server/api/cmCustomField/cmCustomField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x27c8=['path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','util','../../config/logger','bluebird','request-promise'];(function(_0x38495b,_0x11e1e2){var _0x529cd6=function(_0x4a48c8){while(--_0x4a48c8){_0x38495b['push'](_0x38495b['shift']());}};_0x529cd6(++_0x11e1e2);}(_0x27c8,0x6a));var _0x827c=function(_0x3be8ec,_0x5309fb){_0x3be8ec=_0x3be8ec-0x0;var _0x14c30e=_0x27c8[_0x3be8ec];return _0x14c30e;};'use strict';var _=require('lodash');var util=require(_0x827c('0x0'));var logger=require(_0x827c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x827c('0x2'));var rp=require(_0x827c('0x3'));var fs=require('fs');var path=require(_0x827c('0x4'));var rimraf=require(_0x827c('0x5'));var config=require(_0x827c('0x6'));var attributes=require(_0x827c('0x7'));module['exports']=function(_0x56b4eb,_0x390119){return _0x56b4eb[_0x827c('0x8')](_0x827c('0x9'),attributes,{'tableName':_0x827c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c7a=['path','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','api','bluebird','request-promise'];(function(_0x485bad,_0x21c418){var _0x523c91=function(_0x7393a4){while(--_0x7393a4){_0x485bad['push'](_0x485bad['shift']());}};_0x523c91(++_0x21c418);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x585a26,_0x24193b){_0x585a26=_0x585a26-0x0;var _0x579e13=_0x8c7a[_0x585a26];return _0x579e13;};'use strict';var _=require(_0xa8c7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa8c7('0x1'));var moment=require('moment');var BPromise=require(_0xa8c7('0x2'));var rp=require(_0xa8c7('0x3'));var fs=require('fs');var path=require(_0xa8c7('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8c7('0x5'));module[_0xa8c7('0x6')]=function(_0x1afbe0,_0x2ecdf1){return _0x1afbe0[_0xa8c7('0x7')]('CmCustomField',attributes,{'tableName':_0xa8c7('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js
index 8128cd1..3ab9a8e 100644
--- a/server/api/cmCustomField/cmCustomField.rpc.js
+++ b/server/api/cmCustomField/cmCustomField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5089=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4dca4f,_0x3d3989){var _0xb1f24e=function(_0x125f21){while(--_0x125f21){_0x4dca4f['push'](_0x4dca4f['shift']());}};_0xb1f24e(++_0x3d3989);}(_0x5089,0x1bb));var _0x9508=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0x5089[_0x34e14d];return _0x3d8e08;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var moment=require('moment');var BPromise=require(_0x9508('0x2'));var rs=require(_0x9508('0x3'));var fs=require('fs');var Redis=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];var utils=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var jayson=require(_0x9508('0x8'));var client=jayson[_0x9508('0x9')][_0x9508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab3c6,_0x1dc04c,_0x42d13a){return new BPromise(function(_0x55a5de,_0x14dae7){return client[_0x9508('0xb')](_0x4ab3c6,_0x42d13a)['then'](function(_0x342ddd){logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));logger[_0x9508('0xe')](_0x9508('0xf'),_0x1dc04c,_0x9508('0xd'),JSON[_0x9508('0x10')](_0x342ddd));if(_0x342ddd['error']){if(_0x342ddd[_0x9508('0x11')]['code']===0x1f4){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x342ddd['error'][_0x9508('0x12')]);return _0x14dae7(_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);}logger[_0x9508('0x11')]('CmCustomField,\x20%s,\x20%s',_0x1dc04c,_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);return _0x55a5de(_0x342ddd['error'][_0x9508('0x12')]);}else{logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));_0x55a5de(_0x342ddd[_0x9508('0x13')][_0x9508('0x12')]);}})[_0x9508('0x14')](function(_0x343802){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x343802);_0x14dae7(_0x343802);});});}
\ No newline at end of file
+var _0x04de=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCustomField,\x20%s,\x20%s','result','catch','lodash'];(function(_0x1a7c6d,_0x1006d4){var _0x1293d9=function(_0x5ad0a3){while(--_0x5ad0a3){_0x1a7c6d['push'](_0x1a7c6d['shift']());}};_0x1293d9(++_0x1006d4);}(_0x04de,0x107));var _0xe04d=function(_0x1ed073,_0x1478bf){_0x1ed073=_0x1ed073-0x0;var _0x349116=_0x04de[_0x1ed073];return _0x349116;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));var BPromise=require(_0xe04d('0x3'));var rs=require(_0xe04d('0x4'));var fs=require('fs');var Redis=require(_0xe04d('0x5'));var db=require(_0xe04d('0x6'))['db'];var utils=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var config=require(_0xe04d('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x531688,_0x55efb5,_0x210e93){return new BPromise(function(_0x72b1ce,_0x1be121){return client[_0xe04d('0xb')](_0x531688,_0x210e93)[_0xe04d('0xc')](function(_0x2ae3c9){logger[_0xe04d('0xd')]('CmCustomField,\x20%s,\x20%s',_0x55efb5,_0xe04d('0xe'));logger[_0xe04d('0xf')](_0xe04d('0x10'),_0x55efb5,_0xe04d('0xe'),JSON[_0xe04d('0x11')](_0x2ae3c9));if(_0x2ae3c9[_0xe04d('0x12')]){if(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x13')]===0x1f4){logger[_0xe04d('0x12')]('CmCustomField,\x20%s,\x20%s',_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x1be121(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);return _0x72b1ce(_0x2ae3c9[_0xe04d('0x12')][_0xe04d('0x14')]);}else{logger[_0xe04d('0xd')](_0xe04d('0x15'),_0x55efb5,'request\x20sent');_0x72b1ce(_0x2ae3c9[_0xe04d('0x16')]['message']);}})[_0xe04d('0x17')](function(_0x49c063){logger[_0xe04d('0x12')](_0xe04d('0x15'),_0x55efb5,_0x49c063);_0x1be121(_0x49c063);});});}
\ No newline at end of file
diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js
index 0df42c3..ba99ab6 100644
--- a/server/api/cmCustomField/index.js
+++ b/server/api/cmCustomField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8fe9=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x523adf,_0x4decc8){var _0x11be1b=function(_0x38b975){while(--_0x38b975){_0x523adf['push'](_0x523adf['shift']());}};_0x11be1b(++_0x4decc8);}(_0x8fe9,0x17b));var _0x98fe=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0x8fe9[_0x11d95f];return _0x2b1a14;};'use strict';var multer=require(_0x98fe('0x0'));var util=require(_0x98fe('0x1'));var path=require(_0x98fe('0x2'));var timeout=require(_0x98fe('0x3'));var express=require(_0x98fe('0x4'));var router=express[_0x98fe('0x5')]();var auth=require(_0x98fe('0x6'));var interaction=require(_0x98fe('0x7'));var config=require(_0x98fe('0x8'));var controller=require(_0x98fe('0x9'));router[_0x98fe('0xa')]('/',auth[_0x98fe('0xb')](),controller[_0x98fe('0xc')]);router[_0x98fe('0xa')](_0x98fe('0xd'),auth[_0x98fe('0xb')](),controller[_0x98fe('0xe')]);router[_0x98fe('0xf')]('/',auth[_0x98fe('0xb')](),controller[_0x98fe('0x10')]);router[_0x98fe('0x11')]('/:id',auth[_0x98fe('0xb')](),controller[_0x98fe('0x12')]);router[_0x98fe('0x13')](_0x98fe('0xd'),auth[_0x98fe('0xb')](),controller[_0x98fe('0x14')]);module[_0x98fe('0x15')]=router;
\ No newline at end of file
+var _0xdbd7=['./cmCustomField.controller','get','isAuthenticated','index','create','/:id','delete','destroy','multer','util','path','express','Router','../../config/environment'];(function(_0x3bb372,_0x4daf01){var _0x67028f=function(_0x3fe5d9){while(--_0x3fe5d9){_0x3bb372['push'](_0x3bb372['shift']());}};_0x67028f(++_0x4daf01);}(_0xdbd7,0x1e4));var _0x7dbd=function(_0x5124cf,_0x418a11){_0x5124cf=_0x5124cf-0x0;var _0x5313b6=_0xdbd7[_0x5124cf];return _0x5313b6;};'use strict';var multer=require(_0x7dbd('0x0'));var util=require(_0x7dbd('0x1'));var path=require(_0x7dbd('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dbd('0x3'));var router=express[_0x7dbd('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7dbd('0x5'));var controller=require(_0x7dbd('0x6'));router[_0x7dbd('0x7')]('/',auth[_0x7dbd('0x8')](),controller[_0x7dbd('0x9')]);router[_0x7dbd('0x7')]('/:id',auth[_0x7dbd('0x8')](),controller['show']);router['post']('/',auth[_0x7dbd('0x8')](),controller[_0x7dbd('0xa')]);router['put'](_0x7dbd('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7dbd('0xc')](_0x7dbd('0xb'),auth[_0x7dbd('0x8')](),controller[_0x7dbd('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js
index 4500bd8..87ed86e 100644
--- a/server/api/cmHopper/cmHopper.attributes.js
+++ b/server/api/cmHopper/cmHopper.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x31f0=['INTEGER','contactListQueue','STRING','moment','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x31f0,0xb7));var _0x031f=function(_0x28e687,_0x59df47){_0x28e687=_0x28e687-0x0;var _0x3754bf=_0x31f0[_0x28e687];return _0x3754bf;};'use strict';var moment=require(_0x031f('0x0'));var Sequelize=require('sequelize');module[_0x031f('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x031f('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x031f('0x3')],'defaultValue':moment()[_0x031f('0x4')](_0x031f('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x031f('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x031f('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x031f('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x031f('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x031f('0x6')],'unique':_0x031f('0x7')},'ListId':{'type':Sequelize[_0x031f('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x031f('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x031f('0x6')],'unique':_0x031f('0x7')},'CampaignId':{'type':Sequelize[_0x031f('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x031f('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x031f('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x031f('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x031f('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x031f('0x8')]}};
\ No newline at end of file
+var _0x7a54=['contactListQueue','STRING','moment','sequelize','exports','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED'];(function(_0x30381e,_0x1cd097){var _0x284d09=function(_0x3ffdb6){while(--_0x3ffdb6){_0x30381e['push'](_0x30381e['shift']());}};_0x284d09(++_0x1cd097);}(_0x7a54,0x106));var _0x47a5=function(_0x463e08,_0x4171af){_0x463e08=_0x463e08-0x0;var _0xc09836=_0x7a54[_0x463e08];return _0xc09836;};'use strict';var moment=require(_0x47a5('0x0'));var Sequelize=require(_0x47a5('0x1'));module[_0x47a5('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x47a5('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':moment()['format'](_0x47a5('0x5'))},'countbusyretry':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x47a5('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x47a5('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x47a5('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x47a5('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x47a5('0x6')],'unique':_0x47a5('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x47a5('0x9')]}};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js
index 0150805..1ae0daa 100644
--- a/server/api/cmHopper/cmHopper.controller.js
+++ b/server/api/cmHopper/cmHopper.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x79ae=['map','CmHopper','rawAttributes','fieldName','type','key','model','query','filters','intersection','concat','$and','$or','$gt','$lt','$lte','$eq','$between','$notBetween','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','createdAt','updatedAt','state','deleted','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','getPreview','CmContact','user','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','transaction','format','direction','prev','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','priority','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','outbound','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../config/environment','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send'];(function(_0x46ed3a,_0x35b0b3){var _0x3caeb8=function(_0x46d704){while(--_0x46d704){_0x46ed3a['push'](_0x46ed3a['shift']());}};_0x3caeb8(++_0x35b0b3);}(_0x79ae,0x18b));var _0xe79a=function(_0x331c48,_0x51e0e3){_0x331c48=_0x331c48-0x0;var _0x882358=_0x79ae[_0x331c48];return _0x882358;};'use strict';var pdf=require(_0xe79a('0x0'));var emlformat=require(_0xe79a('0x1'));var rimraf=require(_0xe79a('0x2'));var zipdir=require(_0xe79a('0x3'));var jsonpatch=require(_0xe79a('0x4'));var rp=require('request-promise');var moment=require(_0xe79a('0x5'));var BPromise=require(_0xe79a('0x6'));var Mustache=require('mustache');var util=require(_0xe79a('0x7'));var path=require(_0xe79a('0x8'));var sox=require(_0xe79a('0x9'));var csv=require(_0xe79a('0xa'));var ejs=require(_0xe79a('0xb'));var fs=require('fs');var _=require(_0xe79a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe79a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe79a('0xa'));var querystring=require(_0xe79a('0xe'));var Papa=require('papaparse');var Redis=require(_0xe79a('0xf'));var shared=require(_0xe79a('0x10'));var authService=require(_0xe79a('0x11'));var qs=require(_0xe79a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe79a('0x13'))(_0xe79a('0x14'));var utils=require(_0xe79a('0x15'));var config=require(_0xe79a('0x10'));var db=require(_0xe79a('0x16'))['db'];function respondWithStatusCode(_0xfc502,_0x3c9ac0){_0x3c9ac0=_0x3c9ac0||0xcc;return function(_0x5f448b){if(_0x5f448b){return _0xfc502[_0xe79a('0x17')](_0x3c9ac0);}return _0xfc502[_0xe79a('0x18')](_0x3c9ac0)['end']();};}function respondWithResult(_0x4a95d5,_0x2f0b2f){_0x2f0b2f=_0x2f0b2f||0xc8;return function(_0xd2f91d){if(_0xd2f91d){return _0x4a95d5['status'](_0x2f0b2f)['json'](_0xd2f91d);}};}function respondWithFilteredResult(_0x4dbfb9,_0x3d5e75){return function(_0x58f780){if(_0x58f780){var _0x4783d5=_0x58f780[_0xe79a('0x19')],_0x20b1fa=_0x3d5e75['offset'],_0x3676a4=_0x3d5e75[_0xe79a('0x1a')]+_0x3d5e75['limit'],_0x3003a1;if(_0x3676a4>=_0x4783d5){_0x3676a4=_0x4783d5;_0x3003a1=0xc8;}else{_0x3003a1=0xce;}_0x4dbfb9['status'](_0x3003a1);return _0x4dbfb9[_0xe79a('0x1b')](_0xe79a('0x1c'),_0x20b1fa+'-'+_0x3676a4+'/'+_0x4783d5)[_0xe79a('0x1d')](_0x58f780);}return null;};}function patchUpdates(_0x36eeb8){return function(_0x5230ac){try{jsonpatch[_0xe79a('0x1e')](_0x5230ac,_0x36eeb8,!![]);}catch(_0x223c0f){return BPromise[_0xe79a('0x1f')](_0x223c0f);}return _0x5230ac[_0xe79a('0x20')]();};}function saveUpdates(_0x59d6d1,_0x2acbe6){return function(_0x1768ee){if(_0x1768ee){return _0x1768ee[_0xe79a('0x21')](_0x59d6d1)[_0xe79a('0x22')](function(_0x367911){return _0x367911;});}return null;};}function removeEntity(_0x5b9a70,_0x3dbd5d){return function(_0x38b2fb){if(_0x38b2fb){return _0x38b2fb[_0xe79a('0x23')]()[_0xe79a('0x22')](function(){_0x5b9a70[_0xe79a('0x18')](0xcc)[_0xe79a('0x24')]();});}};}function handleEntityNotFound(_0x322fe4,_0x2d7d8d){return function(_0x4f0c24){if(!_0x4f0c24){_0x322fe4[_0xe79a('0x17')](0x194);}return _0x4f0c24;};}function handleError(_0x419082,_0x5271a9){_0x5271a9=_0x5271a9||0x1f4;return function(_0x1059b9){logger[_0xe79a('0x25')](_0x1059b9['stack']);if(_0x1059b9[_0xe79a('0x26')]){delete _0x1059b9[_0xe79a('0x26')];}_0x419082[_0xe79a('0x18')](_0x5271a9)[_0xe79a('0x27')](_0x1059b9);};}exports['index']=function(_0x4710e5,_0x3c56b9){var _0x4ec913={},_0x55e285={},_0x5af6c3={'count':0x0,'rows':[]};var _0x4c34e3=_[_0xe79a('0x28')](db[_0xe79a('0x29')][_0xe79a('0x2a')],function(_0x90caa1){return{'name':_0x90caa1[_0xe79a('0x2b')],'type':_0x90caa1[_0xe79a('0x2c')][_0xe79a('0x2d')]};});_0x55e285[_0xe79a('0x2e')]=_[_0xe79a('0x28')](_0x4c34e3,_0xe79a('0x26'));_0x55e285['query']=_['keys'](_0x4710e5[_0xe79a('0x2f')]);_0x55e285[_0xe79a('0x30')]=_[_0xe79a('0x31')](_0x55e285[_0xe79a('0x2e')],_0x55e285['query']);_0x55e285[_0xe79a('0x30')]=_[_0xe79a('0x32')](_0x55e285[_0xe79a('0x30')],[_0xe79a('0x33'),_0xe79a('0x34'),_0xe79a('0x35'),'$gte',_0xe79a('0x36'),_0xe79a('0x37'),'$ne',_0xe79a('0x38'),'$not',_0xe79a('0x39'),_0xe79a('0x3a'),'$in','$notIn',_0xe79a('0x3b'),_0xe79a('0x3c'),'$iLike',_0xe79a('0x3d'),_0xe79a('0x3b'),_0xe79a('0x3e'),_0xe79a('0x3f'),_0xe79a('0x40'),_0xe79a('0x41')]);_0x4ec913[_0xe79a('0x42')]=_[_0xe79a('0x31')](_0x55e285[_0xe79a('0x2e')],qs['fields'](_0x4710e5[_0xe79a('0x2f')][_0xe79a('0x43')]));_0x4ec913[_0xe79a('0x42')]=_0x4ec913['attributes'][_0xe79a('0x44')]?_0x4ec913[_0xe79a('0x42')]:_0x55e285[_0xe79a('0x2e')];if(!_0x4710e5[_0xe79a('0x2f')][_0xe79a('0x45')](_0xe79a('0x46'))){_0x4ec913[_0xe79a('0x47')]=qs[_0xe79a('0x47')](_0x4710e5[_0xe79a('0x2f')][_0xe79a('0x47')]);_0x4ec913[_0xe79a('0x1a')]=qs['offset'](_0x4710e5[_0xe79a('0x2f')]['offset']);}_0x4ec913[_0xe79a('0x48')]=qs[_0xe79a('0x49')](_0x4710e5['query']['sort']);_0x4ec913[_0xe79a('0x4a')]=qs['filters'](_['pick'](_0x4710e5[_0xe79a('0x2f')],_0x55e285[_0xe79a('0x30')]),_0x4c34e3);if(_0x4710e5[_0xe79a('0x2f')]['filter']){_0x4ec913[_0xe79a('0x4a')]=_[_0xe79a('0x4b')](_0x4ec913['where'],{'$or':_[_0xe79a('0x28')](_0x4c34e3,function(_0x988efd){if(_0x988efd[_0xe79a('0x2c')]!==_0xe79a('0x4c')){var _0x1b4fb0={};_0x1b4fb0[_0x988efd[_0xe79a('0x26')]]={'$like':'%'+_0x4710e5[_0xe79a('0x2f')]['filter']+'%'};return _0x1b4fb0;}})});}_0x4ec913=_['merge']({},_0x4ec913,_0x4710e5[_0xe79a('0x4d')]);var _0xeb549b={'where':_0x4ec913[_0xe79a('0x4a')]};return db[_0xe79a('0x29')][_0xe79a('0x19')](_0xeb549b)[_0xe79a('0x22')](function(_0x359c83){_0x5af6c3['count']=_0x359c83;if(_0x4710e5[_0xe79a('0x2f')][_0xe79a('0x4e')]){_0x4ec913['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x4ec913);})[_0xe79a('0x22')](function(_0x830780){_0x5af6c3[_0xe79a('0x4f')]=_0x830780;return _0x5af6c3;})[_0xe79a('0x22')](respondWithFilteredResult(_0x3c56b9,_0x4ec913))[_0xe79a('0x50')](handleError(_0x3c56b9,null));};exports[_0xe79a('0x51')]=function(_0x1df955,_0x477c97){var _0x423256={'raw':!![],'where':{'id':_0x1df955[_0xe79a('0x52')]['id']}},_0x210250={};_0x210250[_0xe79a('0x2e')]=_[_0xe79a('0x53')](db['CmHopper'][_0xe79a('0x2a')]);_0x210250[_0xe79a('0x2f')]=_[_0xe79a('0x53')](_0x1df955[_0xe79a('0x2f')]);_0x210250[_0xe79a('0x30')]=_[_0xe79a('0x31')](_0x210250['model'],_0x210250['query']);_0x423256['attributes']=_[_0xe79a('0x31')](_0x210250['model'],qs[_0xe79a('0x43')](_0x1df955[_0xe79a('0x2f')][_0xe79a('0x43')]));_0x423256[_0xe79a('0x42')]=_0x423256[_0xe79a('0x42')][_0xe79a('0x44')]?_0x423256[_0xe79a('0x42')]:_0x210250[_0xe79a('0x2e')];if(_0x1df955[_0xe79a('0x2f')][_0xe79a('0x4e')]){_0x423256[_0xe79a('0x54')]=[{'all':!![]}];}_0x423256=_[_0xe79a('0x4b')]({},_0x423256,_0x1df955['options']);return db['CmHopper'][_0xe79a('0x55')](_0x423256)['then'](handleEntityNotFound(_0x477c97,null))['then'](respondWithResult(_0x477c97,null))[_0xe79a('0x50')](handleError(_0x477c97,null));};exports['create']=function(_0x5b9402,_0x56cf71){return db['CmHopper'][_0xe79a('0x56')](_0x5b9402[_0xe79a('0x57')],{})['then'](respondWithResult(_0x56cf71,0xc9))[_0xe79a('0x50')](handleError(_0x56cf71,null));};exports[_0xe79a('0x21')]=function(_0x6f5ff2,_0x148395){if(_0x6f5ff2[_0xe79a('0x57')]['id']){delete _0x6f5ff2[_0xe79a('0x57')]['id'];}return db['CmHopper'][_0xe79a('0x55')]({'where':{'id':_0x6f5ff2[_0xe79a('0x52')]['id']}})[_0xe79a('0x22')](handleEntityNotFound(_0x148395,null))[_0xe79a('0x22')](saveUpdates(_0x6f5ff2[_0xe79a('0x57')],null))[_0xe79a('0x22')](respondWithResult(_0x148395,null))['catch'](handleError(_0x148395,null));};exports[_0xe79a('0x58')]=function(_0x4ccd19,_0x430168){return db[_0xe79a('0x29')]['describe']()[_0xe79a('0x22')](respondWithResult(_0x430168,null))[_0xe79a('0x50')](handleError(_0x430168,null));};exports[_0xe79a('0x23')]=function(_0x38b08a,_0x1151e3){var _0x531cf7;return db[_0xe79a('0x29')]['find']({'where':{'id':_0x38b08a['params']['id']}})[_0xe79a('0x22')](handleEntityNotFound(_0x1151e3,null))[_0xe79a('0x22')](function(_0x1183dc){if(_0x1183dc){return _0x1183dc['destroy']()[_0xe79a('0x22')](function(_0xfe3451){return _0xfe3451;});}})[_0xe79a('0x22')](function(_0x558282){_0x531cf7=_0x558282;if(_0x558282){if(_0x558282[_0xe79a('0x59')]||_0x558282[_0xe79a('0x5a')]){return db[_0x558282[_0xe79a('0x59')]?_0xe79a('0x5b'):'Campaign'][_0xe79a('0x55')]({'where':{'id':_0x558282[_0xe79a('0x59')]?_0x558282[_0xe79a('0x59')]:_0x558282['CampaignId']},'attributes':['id',_0xe79a('0x26')],'raw':!![]});}}})['then'](function(_0x2e9f60){var _0x1c0f29={};if(_0x2e9f60){_[_0xe79a('0x4b')](_0x1c0f29,_[_0xe79a('0x5c')](_0x531cf7['dataValues'],[_0xe79a('0x5d'),_0xe79a('0x5e'),'id']));_0x1c0f29[_0xe79a('0x5f')]=0x15;_0x1c0f29['statedesc']=_0xe79a('0x60');_0x1c0f29['campaign']=_0x2e9f60[_0xe79a('0x26')];_0x1c0f29['membername']=_0x38b08a['user'][_0xe79a('0x26')];_0x1c0f29[_0xe79a('0x61')]=_0x38b08a['user']['id'];_0x1c0f29[_0xe79a('0x60')]=!![];_0x1c0f29[_0xe79a('0x62')]=moment()['format'](_0xe79a('0x63'));_0x1c0f29[_0xe79a('0x64')]=_0x531cf7['phone'];_0x1c0f29['campaigntype']=_0x531cf7[_0xe79a('0x59')]?_0xe79a('0x65'):_0xe79a('0x66');return db['CmContact']['find']({'where':{'id':_0x1c0f29[_0xe79a('0x67')]},'attributes':[_0xe79a('0x68'),_0xe79a('0x69')]})[_0xe79a('0x22')](function(_0x15875d){if(!_[_0xe79a('0x6a')](_0x1151e3)&&!_[_0xe79a('0x6a')](_0x15875d[_0xe79a('0x68')])){_0x1c0f29[_0xe79a('0x6b')]=_0x15875d[_0xe79a('0x68')];if(!_[_0xe79a('0x6a')](_0x15875d['lastName'])){_0x1c0f29[_0xe79a('0x6b')]+='\x20'+_0x15875d[_0xe79a('0x69')];}}})['finally'](function(){return db['CmHopperFinal']['create'](_0x1c0f29);});}})[_0xe79a('0x22')](function(){return _0x1151e3['status'](0xcc)[_0xe79a('0x24')]();})['catch'](handleError(_0x1151e3,null));};exports[_0xe79a('0x6c')]=function(_0x90da9f,_0x241ac9,_0x5d4b4e){var _0x4bb744=[];return db[_0xe79a('0x6d')][_0xe79a('0x58')]()[_0xe79a('0x22')](function(_0x11e13f){_0x4bb744=_['keys'](_0x11e13f);return _0x90da9f[_0xe79a('0x6e')][_0xe79a('0x6f')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xe79a('0x70')},'attributes':['id',_0xe79a('0x71')],'raw':!![]});})[_0xe79a('0x22')](function(_0xc5f5ac){if(_0xc5f5ac&&_0xc5f5ac[_0xe79a('0x44')]){return db[_0xe79a('0x72')][_0xe79a('0x73')](function(_0x24c881){var _0x54fdfb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe79a('0x74')](_0xe79a('0x63'))},'VoiceQueueId':{'$in':_[_0xe79a('0x28')](_0xc5f5ac,'id')},'$or':[{'UserId':null},{'UserId':_0x90da9f[_0xe79a('0x6e')]['id']}]};var _0x361f43=[];if(_0x90da9f['body']['direction']&&_0x90da9f['body'][_0xe79a('0x75')]===_0xe79a('0x76')){if(!_['isEmpty'](_0x90da9f['body'][_0xe79a('0x77')])){_0x54fdfb['id']={'$in':_0x90da9f[_0xe79a('0x57')]['hopperIds']};}_0x361f43=[['priority',_0xe79a('0x78')],[_0xe79a('0x79'),_0xc5f5ac[0x0][_0xe79a('0x71')]===_0xe79a('0x78')?_0xe79a('0x7a'):_0xe79a('0x78')],db[_0xe79a('0x72')][_0xe79a('0x7b')](_0xe79a('0x7c')),['id',_0xe79a('0x7a')]];}else{if(!_[_0xe79a('0x7d')](_0x90da9f[_0xe79a('0x57')]['hopperIds'])){_0x54fdfb['id']={'$notIn':_0x90da9f['body']['hopperIds']};}_0x361f43=[[_0xe79a('0x7e'),_0xe79a('0x7a')],[_0xe79a('0x79'),_0xc5f5ac[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xe79a('0x7b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xe79a('0x29')][_0xe79a('0x7f')]({'attributes':['id',_0xe79a('0x80')],'where':_0x54fdfb,'order':_0x361f43,'transaction':_0x24c881,'lock':_0x24c881[_0xe79a('0x81')][_0xe79a('0x82')],'include':[{'model':db['CmContact'],'as':_0xe79a('0x83'),'attributes':_0x4bb744,'include':[{'model':db[_0xe79a('0x84')],'as':_0xe79a('0x85'),'attributes':['id',_0xe79a('0x26')]}]},{'model':db[_0xe79a('0x86')],'as':_0xe79a('0x87'),'attributes':['id',_0xe79a('0x26')]},{'model':db[_0xe79a('0x5b')],'as':_0xe79a('0x88'),'attributes':['id',_0xe79a('0x26'),_0xe79a('0x89')]}]})[_0xe79a('0x22')](function(_0x41c759){if(_0x41c759){return _0x41c759[_0xe79a('0x21')]({'UserId':_0x90da9f['user']['id']},{'transaction':_0x24c881});}});});}})['then'](handleEntityNotFound(_0x241ac9,null))['then'](respondWithResult(_0x241ac9,null))[_0xe79a('0x50')](handleError(_0x241ac9,null));};exports[_0xe79a('0x8a')]=function(_0x1f53b7,_0x4f984b,_0x5a9263){return _0x1f53b7[_0xe79a('0x6e')][_0xe79a('0x6f')]({'where':{'type':_0xe79a('0x8b'),'dialActive':!![],'dialMethod':_0xe79a('0x70')},'attributes':['id'],'raw':!![]})[_0xe79a('0x22')](function(_0x1cf2db){if(_0x1cf2db&&_0x1cf2db[_0xe79a('0x44')]){return db[_0xe79a('0x29')][_0xe79a('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe79a('0x74')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe79a('0x28')](_0x1cf2db,'id')},'$or':[{'UserId':null},{'UserId':_0x1f53b7[_0xe79a('0x6e')]['id']}]}});}return 0x0;})[_0xe79a('0x22')](function(_0x41b970){if(!_['isNil'](_0x41b970)&&_['isNumber'](_0x41b970)){return _0x4f984b[_0xe79a('0x18')](0xc8)[_0xe79a('0x1d')]({'contacts':_0x41b970});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0xe79a('0x8a'),0x194,_0xe79a('0x8c'));_0x4f984b[_0xe79a('0x17')](0x194);}})[_0xe79a('0x50')](handleError(_0x4f984b,null));};exports[_0xe79a('0x8d')]=function(_0x3b7b89,_0x2fcd7d,_0x1ba898){var _0x11a0a6=shared[_0xe79a('0x8e')];var _0xf36b7c=[];_[_0xe79a('0x28')](_0x11a0a6,function(_0x5355b4){_0xf36b7c['push']({'id':_0x5355b4['name'],'name':_0x5355b4[_0xe79a('0x26')],'utcOffset':_0x5355b4[_0xe79a('0x8f')]});});return _0x2fcd7d[_0xe79a('0x18')](0xc8)[_0xe79a('0x1d')]({'tz':_0xf36b7c});};exports[_0xe79a('0x90')]=function(_0x2edf9e,_0x5a7063,_0x17206d){var _0x24a95e=shared[_0xe79a('0x8e')];var _0x515a00={};if(!_[_0xe79a('0x6a')](_0x24a95e[_0x2edf9e[_0xe79a('0x57')]['id']]))_0x515a00=_0x24a95e[_0x2edf9e[_0xe79a('0x57')]['id']];return _0x5a7063[_0xe79a('0x18')](0xc8)[_0xe79a('0x1d')](_0x515a00);};
\ No newline at end of file
+var _0xd633=['send','index','map','CmHopper','rawAttributes','key','model','keys','query','filters','concat','$and','$or','$gt','$ne','$between','$in','$notIn','$like','$iLike','$overlap','$contained','attributes','intersection','fields','nolimit','order','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','length','options','find','create','update','body','params','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','CmContact','firstName','lastName','isNil','calleridname','finally','getPreview','describe','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','dialActive','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../config/environment','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name'];(function(_0x193039,_0x1f684e){var _0x5942af=function(_0x50a7a5){while(--_0x50a7a5){_0x193039['push'](_0x193039['shift']());}};_0x5942af(++_0x1f684e);}(_0xd633,0x67));var _0x3d63=function(_0x257071,_0x44cd3e){_0x257071=_0x257071-0x0;var _0x2d0579=_0xd633[_0x257071];return _0x2d0579;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3d63('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d63('0x1'));var rp=require(_0x3d63('0x2'));var moment=require(_0x3d63('0x3'));var BPromise=require(_0x3d63('0x4'));var Mustache=require(_0x3d63('0x5'));var util=require(_0x3d63('0x6'));var path=require(_0x3d63('0x7'));var sox=require(_0x3d63('0x8'));var csv=require(_0x3d63('0x9'));var ejs=require(_0x3d63('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3d63('0xb'));var crypto=require('crypto');var jsforce=require(_0x3d63('0xc'));var deskjs=require(_0x3d63('0xd'));var toCsv=require(_0x3d63('0x9'));var querystring=require('querystring');var Papa=require(_0x3d63('0xe'));var Redis=require('ioredis');var shared=require(_0x3d63('0xf'));var authService=require(_0x3d63('0x10'));var qs=require(_0x3d63('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d63('0x12'));var logger=require(_0x3d63('0x13'))(_0x3d63('0x14'));var utils=require(_0x3d63('0x15'));var config=require(_0x3d63('0xf'));var db=require(_0x3d63('0x16'))['db'];function respondWithStatusCode(_0x215833,_0x2aad15){_0x2aad15=_0x2aad15||0xcc;return function(_0x4925b9){if(_0x4925b9){return _0x215833[_0x3d63('0x17')](_0x2aad15);}return _0x215833[_0x3d63('0x18')](_0x2aad15)[_0x3d63('0x19')]();};}function respondWithResult(_0x1911d5,_0x4833d2){_0x4833d2=_0x4833d2||0xc8;return function(_0x3ae51a){if(_0x3ae51a){return _0x1911d5[_0x3d63('0x18')](_0x4833d2)['json'](_0x3ae51a);}};}function respondWithFilteredResult(_0x35fd37,_0x4067be){return function(_0x471014){if(_0x471014){var _0x42795c=_0x471014['count'],_0x1010d3=_0x4067be['offset'],_0x84fb12=_0x4067be[_0x3d63('0x1a')]+_0x4067be[_0x3d63('0x1b')],_0x3f5b52;if(_0x84fb12>=_0x42795c){_0x84fb12=_0x42795c;_0x3f5b52=0xc8;}else{_0x3f5b52=0xce;}_0x35fd37[_0x3d63('0x18')](_0x3f5b52);return _0x35fd37[_0x3d63('0x1c')]('Content-Range',_0x1010d3+'-'+_0x84fb12+'/'+_0x42795c)[_0x3d63('0x1d')](_0x471014);}return null;};}function patchUpdates(_0xf55773){return function(_0x4911af){try{jsonpatch[_0x3d63('0x1e')](_0x4911af,_0xf55773,!![]);}catch(_0x57687a){return BPromise[_0x3d63('0x1f')](_0x57687a);}return _0x4911af[_0x3d63('0x20')]();};}function saveUpdates(_0xc41349,_0x2cc4f9){return function(_0x106e9c){if(_0x106e9c){return _0x106e9c['update'](_0xc41349)[_0x3d63('0x21')](function(_0x300348){return _0x300348;});}return null;};}function removeEntity(_0x1a21d1,_0x38ec71){return function(_0x5cfe3f){if(_0x5cfe3f){return _0x5cfe3f[_0x3d63('0x22')]()[_0x3d63('0x21')](function(){_0x1a21d1[_0x3d63('0x18')](0xcc)[_0x3d63('0x19')]();});}};}function handleEntityNotFound(_0x17dd1a,_0x1f867f){return function(_0x51c192){if(!_0x51c192){_0x17dd1a[_0x3d63('0x17')](0x194);}return _0x51c192;};}function handleError(_0x31a153,_0x43b19f){_0x43b19f=_0x43b19f||0x1f4;return function(_0x295a38){logger[_0x3d63('0x23')](_0x295a38[_0x3d63('0x24')]);if(_0x295a38['name']){delete _0x295a38[_0x3d63('0x25')];}_0x31a153[_0x3d63('0x18')](_0x43b19f)[_0x3d63('0x26')](_0x295a38);};}exports[_0x3d63('0x27')]=function(_0x1a0c0d,_0xce8ada){var _0x126866={},_0x480f7d={},_0x330591={'count':0x0,'rows':[]};var _0x55a216=_[_0x3d63('0x28')](db[_0x3d63('0x29')][_0x3d63('0x2a')],function(_0xd0ffa5){return{'name':_0xd0ffa5['fieldName'],'type':_0xd0ffa5['type'][_0x3d63('0x2b')]};});_0x480f7d[_0x3d63('0x2c')]=_[_0x3d63('0x28')](_0x55a216,_0x3d63('0x25'));_0x480f7d['query']=_[_0x3d63('0x2d')](_0x1a0c0d[_0x3d63('0x2e')]);_0x480f7d[_0x3d63('0x2f')]=_['intersection'](_0x480f7d[_0x3d63('0x2c')],_0x480f7d[_0x3d63('0x2e')]);_0x480f7d[_0x3d63('0x2f')]=_[_0x3d63('0x30')](_0x480f7d[_0x3d63('0x2f')],[_0x3d63('0x31'),_0x3d63('0x32'),_0x3d63('0x33'),'$gte','$lt','$lte',_0x3d63('0x34'),'$eq','$not',_0x3d63('0x35'),'$notBetween',_0x3d63('0x36'),_0x3d63('0x37'),_0x3d63('0x38'),'$notLike',_0x3d63('0x39'),'$notILike',_0x3d63('0x38'),_0x3d63('0x3a'),'$contains',_0x3d63('0x3b'),'$any']);_0x126866[_0x3d63('0x3c')]=_[_0x3d63('0x3d')](_0x480f7d[_0x3d63('0x2c')],qs[_0x3d63('0x3e')](_0x1a0c0d[_0x3d63('0x2e')][_0x3d63('0x3e')]));_0x126866[_0x3d63('0x3c')]=_0x126866['attributes']['length']?_0x126866[_0x3d63('0x3c')]:_0x480f7d['model'];if(!_0x1a0c0d[_0x3d63('0x2e')]['hasOwnProperty'](_0x3d63('0x3f'))){_0x126866[_0x3d63('0x1b')]=qs[_0x3d63('0x1b')](_0x1a0c0d['query']['limit']);_0x126866[_0x3d63('0x1a')]=qs[_0x3d63('0x1a')](_0x1a0c0d['query'][_0x3d63('0x1a')]);}_0x126866[_0x3d63('0x40')]=qs['sort'](_0x1a0c0d[_0x3d63('0x2e')]['sort']);_0x126866[_0x3d63('0x41')]=qs['filters'](_['pick'](_0x1a0c0d[_0x3d63('0x2e')],_0x480f7d[_0x3d63('0x2f')]),_0x55a216);if(_0x1a0c0d[_0x3d63('0x2e')][_0x3d63('0x42')]){_0x126866[_0x3d63('0x41')]=_[_0x3d63('0x43')](_0x126866[_0x3d63('0x41')],{'$or':_[_0x3d63('0x28')](_0x55a216,function(_0x3fe28f){if(_0x3fe28f['type']!==_0x3d63('0x44')){var _0x3dd564={};_0x3dd564[_0x3fe28f[_0x3d63('0x25')]]={'$like':'%'+_0x1a0c0d[_0x3d63('0x2e')][_0x3d63('0x42')]+'%'};return _0x3dd564;}})});}_0x126866=_[_0x3d63('0x43')]({},_0x126866,_0x1a0c0d['options']);var _0x214352={'where':_0x126866['where']};return db[_0x3d63('0x29')]['count'](_0x214352)[_0x3d63('0x21')](function(_0x438db9){_0x330591[_0x3d63('0x45')]=_0x438db9;if(_0x1a0c0d[_0x3d63('0x2e')][_0x3d63('0x46')]){_0x126866[_0x3d63('0x47')]=[{'all':!![]}];}return db[_0x3d63('0x29')][_0x3d63('0x48')](_0x126866);})[_0x3d63('0x21')](function(_0x1b3df4){_0x330591[_0x3d63('0x49')]=_0x1b3df4;return _0x330591;})['then'](respondWithFilteredResult(_0xce8ada,_0x126866))[_0x3d63('0x4a')](handleError(_0xce8ada,null));};exports['show']=function(_0x27c862,_0x35f061){var _0xeadefe={'raw':!![],'where':{'id':_0x27c862['params']['id']}},_0x483de1={};_0x483de1[_0x3d63('0x2c')]=_[_0x3d63('0x2d')](db['CmHopper'][_0x3d63('0x2a')]);_0x483de1[_0x3d63('0x2e')]=_[_0x3d63('0x2d')](_0x27c862[_0x3d63('0x2e')]);_0x483de1['filters']=_['intersection'](_0x483de1[_0x3d63('0x2c')],_0x483de1[_0x3d63('0x2e')]);_0xeadefe[_0x3d63('0x3c')]=_[_0x3d63('0x3d')](_0x483de1[_0x3d63('0x2c')],qs[_0x3d63('0x3e')](_0x27c862[_0x3d63('0x2e')]['fields']));_0xeadefe['attributes']=_0xeadefe['attributes'][_0x3d63('0x4b')]?_0xeadefe['attributes']:_0x483de1[_0x3d63('0x2c')];if(_0x27c862[_0x3d63('0x2e')][_0x3d63('0x46')]){_0xeadefe[_0x3d63('0x47')]=[{'all':!![]}];}_0xeadefe=_['merge']({},_0xeadefe,_0x27c862[_0x3d63('0x4c')]);return db[_0x3d63('0x29')][_0x3d63('0x4d')](_0xeadefe)[_0x3d63('0x21')](handleEntityNotFound(_0x35f061,null))[_0x3d63('0x21')](respondWithResult(_0x35f061,null))['catch'](handleError(_0x35f061,null));};exports[_0x3d63('0x4e')]=function(_0x141986,_0x1623d6){return db[_0x3d63('0x29')][_0x3d63('0x4e')](_0x141986['body'],{})[_0x3d63('0x21')](respondWithResult(_0x1623d6,0xc9))[_0x3d63('0x4a')](handleError(_0x1623d6,null));};exports[_0x3d63('0x4f')]=function(_0x4a90e0,_0x452dd9){if(_0x4a90e0['body']['id']){delete _0x4a90e0[_0x3d63('0x50')]['id'];}return db[_0x3d63('0x29')][_0x3d63('0x4d')]({'where':{'id':_0x4a90e0[_0x3d63('0x51')]['id']}})[_0x3d63('0x21')](handleEntityNotFound(_0x452dd9,null))[_0x3d63('0x21')](saveUpdates(_0x4a90e0['body'],null))[_0x3d63('0x21')](respondWithResult(_0x452dd9,null))[_0x3d63('0x4a')](handleError(_0x452dd9,null));};exports['describe']=function(_0x3e1dc0,_0x1519e8){return db['CmHopper']['describe']()[_0x3d63('0x21')](respondWithResult(_0x1519e8,null))[_0x3d63('0x4a')](handleError(_0x1519e8,null));};exports[_0x3d63('0x22')]=function(_0x508cb7,_0x2f0d9c){var _0x4405f8;return db[_0x3d63('0x29')][_0x3d63('0x4d')]({'where':{'id':_0x508cb7[_0x3d63('0x51')]['id']}})[_0x3d63('0x21')](handleEntityNotFound(_0x2f0d9c,null))[_0x3d63('0x21')](function(_0x2773ba){if(_0x2773ba){return _0x2773ba[_0x3d63('0x22')]()['then'](function(_0x2b41c8){return _0x2b41c8;});}})[_0x3d63('0x21')](function(_0x4cb5dd){_0x4405f8=_0x4cb5dd;if(_0x4cb5dd){if(_0x4cb5dd[_0x3d63('0x52')]||_0x4cb5dd[_0x3d63('0x53')]){return db[_0x4cb5dd[_0x3d63('0x52')]?'VoiceQueue':_0x3d63('0x54')]['find']({'where':{'id':_0x4cb5dd['VoiceQueueId']?_0x4cb5dd[_0x3d63('0x52')]:_0x4cb5dd[_0x3d63('0x53')]},'attributes':['id',_0x3d63('0x25')],'raw':!![]});}}})[_0x3d63('0x21')](function(_0x29a782){var _0x161a8d={};if(_0x29a782){_[_0x3d63('0x43')](_0x161a8d,_[_0x3d63('0x55')](_0x4405f8[_0x3d63('0x56')],[_0x3d63('0x57'),_0x3d63('0x58'),'id']));_0x161a8d[_0x3d63('0x59')]=0x15;_0x161a8d[_0x3d63('0x5a')]=_0x3d63('0x5b');_0x161a8d[_0x3d63('0x5c')]=_0x29a782[_0x3d63('0x25')];_0x161a8d[_0x3d63('0x5d')]=_0x508cb7[_0x3d63('0x5e')][_0x3d63('0x25')];_0x161a8d[_0x3d63('0x5f')]=_0x508cb7[_0x3d63('0x5e')]['id'];_0x161a8d['deleted']=!![];_0x161a8d[_0x3d63('0x60')]=moment()[_0x3d63('0x61')](_0x3d63('0x62'));_0x161a8d[_0x3d63('0x63')]=_0x4405f8['phone'];_0x161a8d[_0x3d63('0x64')]=_0x4405f8[_0x3d63('0x52')]?_0x3d63('0x65'):'ivr';return db[_0x3d63('0x66')][_0x3d63('0x4d')]({'where':{'id':_0x161a8d['ContactId']},'attributes':[_0x3d63('0x67'),_0x3d63('0x68')]})[_0x3d63('0x21')](function(_0x42ddcf){if(!_[_0x3d63('0x69')](_0x2f0d9c)&&!_[_0x3d63('0x69')](_0x42ddcf[_0x3d63('0x67')])){_0x161a8d[_0x3d63('0x6a')]=_0x42ddcf['firstName'];if(!_[_0x3d63('0x69')](_0x42ddcf[_0x3d63('0x68')])){_0x161a8d[_0x3d63('0x6a')]+='\x20'+_0x42ddcf[_0x3d63('0x68')];}}})[_0x3d63('0x6b')](function(){return db['CmHopperFinal'][_0x3d63('0x4e')](_0x161a8d);});}})[_0x3d63('0x21')](function(){return _0x2f0d9c[_0x3d63('0x18')](0xcc)[_0x3d63('0x19')]();})['catch'](handleError(_0x2f0d9c,null));};exports[_0x3d63('0x6c')]=function(_0x14450a,_0x172cd4,_0x30f7eb){var _0xd7ab3e=[];return db['CmContact'][_0x3d63('0x6d')]()[_0x3d63('0x21')](function(_0x470e28){_0xd7ab3e=_[_0x3d63('0x2d')](_0x470e28);return _0x14450a[_0x3d63('0x5e')][_0x3d63('0x6e')]({'where':{'type':_0x3d63('0x6f'),'dialActive':!![],'dialMethod':_0x3d63('0x70')},'attributes':['id',_0x3d63('0x71')],'raw':!![]});})['then'](function(_0x4bcf95){if(_0x4bcf95&&_0x4bcf95[_0x3d63('0x4b')]){return db[_0x3d63('0x72')][_0x3d63('0x73')](function(_0x24fe09){var _0x27d00d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x4bcf95,'id')},'$or':[{'UserId':null},{'UserId':_0x14450a['user']['id']}]};var _0x198be0=[];if(_0x14450a[_0x3d63('0x50')][_0x3d63('0x74')]&&_0x14450a[_0x3d63('0x50')][_0x3d63('0x74')]===_0x3d63('0x75')){if(!_['isEmpty'](_0x14450a['body']['hopperIds'])){_0x27d00d['id']={'$in':_0x14450a['body'][_0x3d63('0x76')]};}_0x198be0=[[_0x3d63('0x77'),_0x3d63('0x78')],['scheduledAt',_0x4bcf95[0x0]['dialOrderByScheduledAt']===_0x3d63('0x78')?_0x3d63('0x79'):_0x3d63('0x78')],db[_0x3d63('0x72')][_0x3d63('0x7a')](_0x3d63('0x7b')),['id','DESC']];}else{if(!_['isEmpty'](_0x14450a['body'][_0x3d63('0x76')])){_0x27d00d['id']={'$notIn':_0x14450a[_0x3d63('0x50')][_0x3d63('0x76')]};}_0x198be0=[[_0x3d63('0x77'),_0x3d63('0x79')],[_0x3d63('0x7c'),_0x4bcf95[0x0]['dialOrderByScheduledAt']],db[_0x3d63('0x72')][_0x3d63('0x7a')](_0x3d63('0x7d')),['id',_0x3d63('0x78')]];}return db['CmHopper'][_0x3d63('0x7e')]({'attributes':['id',_0x3d63('0x7f')],'where':_0x27d00d,'order':_0x198be0,'transaction':_0x24fe09,'lock':_0x24fe09[_0x3d63('0x80')][_0x3d63('0x81')],'include':[{'model':db[_0x3d63('0x66')],'as':'Contact','attributes':_0xd7ab3e,'include':[{'model':db[_0x3d63('0x82')],'as':'Company','attributes':['id',_0x3d63('0x25')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x3d63('0x25')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x3d63('0x83')]}]})[_0x3d63('0x21')](function(_0x589302){if(_0x589302){return _0x589302['update']({'UserId':_0x14450a[_0x3d63('0x5e')]['id']},{'transaction':_0x24fe09});}});});}})[_0x3d63('0x21')](handleEntityNotFound(_0x172cd4,null))[_0x3d63('0x21')](respondWithResult(_0x172cd4,null))[_0x3d63('0x4a')](handleError(_0x172cd4,null));};exports['getOpenContacts']=function(_0x68c581,_0x4f024b,_0x84ffe8){return _0x68c581[_0x3d63('0x5e')]['getVoiceQueues']({'where':{'type':_0x3d63('0x6f'),'dialActive':!![],'dialMethod':_0x3d63('0x70')},'attributes':['id'],'raw':!![]})[_0x3d63('0x21')](function(_0x1e6ef6){if(_0x1e6ef6&&_0x1e6ef6[_0x3d63('0x4b')]){return db[_0x3d63('0x29')][_0x3d63('0x45')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3d63('0x61')](_0x3d63('0x62'))},'VoiceQueueId':{'$in':_['map'](_0x1e6ef6,'id')},'$or':[{'UserId':null},{'UserId':_0x68c581[_0x3d63('0x5e')]['id']}]}});}return 0x0;})[_0x3d63('0x21')](function(_0x2f8556){if(!_[_0x3d63('0x69')](_0x2f8556)&&_[_0x3d63('0x84')](_0x2f8556)){return _0x4f024b[_0x3d63('0x18')](0xc8)[_0x3d63('0x1d')]({'contacts':_0x2f8556});}else{logger[_0x3d63('0x23')](_0x3d63('0x85'),_0x3d63('0x86'),0x194,_0x3d63('0x87'));_0x4f024b[_0x3d63('0x17')](0x194);}})[_0x3d63('0x4a')](handleError(_0x4f024b,null));};exports[_0x3d63('0x88')]=function(_0x2e870a,_0x347563,_0x316ddd){var _0x1f990e=shared[_0x3d63('0x89')];var _0x4a3382=[];_[_0x3d63('0x28')](_0x1f990e,function(_0x5550a2){_0x4a3382[_0x3d63('0x8a')]({'id':_0x5550a2[_0x3d63('0x25')],'name':_0x5550a2[_0x3d63('0x25')],'utcOffset':_0x5550a2[_0x3d63('0x8b')]});});return _0x347563[_0x3d63('0x18')](0xc8)[_0x3d63('0x1d')]({'tz':_0x4a3382});};exports[_0x3d63('0x8c')]=function(_0x35062e,_0xc94047,_0x415128){var _0xeb051d=shared[_0x3d63('0x89')];var _0x4b470c={};if(!_['isNil'](_0xeb051d[_0x35062e['body']['id']]))_0x4b470c=_0xeb051d[_0x35062e[_0x3d63('0x50')]['id']];return _0xc94047[_0x3d63('0x18')](0xc8)[_0x3d63('0x1d')](_0x4b470c);};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js
index 29f0ee4..8c6e23a 100644
--- a/server/api/cmHopper/cmHopper.model.js
+++ b/server/api/cmHopper/cmHopper.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd266=['exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xd266,0xe8));var _0x6d26=function(_0x5a06f8,_0x1ca6ae){_0x5a06f8=_0x5a06f8-0x0;var _0x5695ae=_0xd266[_0x5a06f8];return _0x5695ae;};'use strict';var _=require('lodash');var util=require(_0x6d26('0x0'));var logger=require('../../config/logger')(_0x6d26('0x1'));var moment=require('moment');var BPromise=require(_0x6d26('0x2'));var rp=require(_0x6d26('0x3'));var fs=require('fs');var path=require(_0x6d26('0x4'));var rimraf=require(_0x6d26('0x5'));var config=require(_0x6d26('0x6'));var attributes=require(_0x6d26('0x7'));module[_0x6d26('0x8')]=function(_0x5452e8,_0x153202){return _0x5452e8[_0x6d26('0x9')](_0x6d26('0xa'),attributes,{'tableName':_0x6d26('0xb'),'paranoid':![],'indexes':[{'name':_0x6d26('0xc'),'fields':['scheduledat']},{'name':_0x6d26('0xd'),'fields':[_0x6d26('0xd')]},{'name':_0x6d26('0xe'),'fields':[_0x6d26('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3711=['phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat'];(function(_0x298d18,_0x2364a1){var _0x3ecf4a=function(_0x30eb9f){while(--_0x30eb9f){_0x298d18['push'](_0x298d18['shift']());}};_0x3ecf4a(++_0x2364a1);}(_0x3711,0x18e));var _0x1371=function(_0x4f5f66,_0xef05e6){_0x4f5f66=_0x4f5f66-0x0;var _0x34c34b=_0x3711[_0x4f5f66];return _0x34c34b;};'use strict';var _=require(_0x1371('0x0'));var util=require(_0x1371('0x1'));var logger=require(_0x1371('0x2'))(_0x1371('0x3'));var moment=require(_0x1371('0x4'));var BPromise=require(_0x1371('0x5'));var rp=require(_0x1371('0x6'));var fs=require('fs');var path=require(_0x1371('0x7'));var rimraf=require(_0x1371('0x8'));var config=require(_0x1371('0x9'));var attributes=require(_0x1371('0xa'));module[_0x1371('0xb')]=function(_0x149c87,_0x9ec4f){return _0x149c87[_0x1371('0xc')](_0x1371('0xd'),attributes,{'tableName':_0x1371('0xe'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x1371('0xf')]},{'name':_0x1371('0x10'),'fields':['phone']},{'name':_0x1371('0x11'),'fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js
index 9bbe32f..c988381 100644
--- a/server/api/cmHopper/cmHopper.rpc.js
+++ b/server/api/cmHopper/cmHopper.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2b4=['UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','findAll','order','LOCK','UPDATE','Contact','keys','User','voicePause','includes','UserId','push','all','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','GetContactRecallMe','describe','length','GetCmHopperPreview','GetContactByPhone','log','req\x20value','phone\x20value','phone','findOne','dialTimezone','DESC','getcontactbyohone','getContactByPhone','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetCmHopper','options','raw','where','limit','include','map','model','attributes','info','ShowCmHopper','CmHopper','find','create','CreateCmHopper','update','body'];(function(_0x295d44,_0x339fad){var _0x189d2b=function(_0x1a1c41){while(--_0x1a1c41){_0x295d44['push'](_0x295d44['shift']());}};_0x189d2b(++_0x339fad);}(_0xc2b4,0xc5));var _0x4c2b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc2b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c2b('0x0'));var util=require(_0x4c2b('0x1'));var moment=require(_0x4c2b('0x2'));var BPromise=require(_0x4c2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c2b('0x4'))['db'];var utils=require(_0x4c2b('0x5'));var logger=require(_0x4c2b('0x6'))('rpc');var config=require(_0x4c2b('0x7'));var jayson=require(_0x4c2b('0x8'));var client=jayson['client'][_0x4c2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x539c7e,_0x12c96e,_0xa5c76b){return new BPromise(function(_0x427f07,_0x9a40c8){return client[_0x4c2b('0xa')](_0x539c7e,_0xa5c76b)[_0x4c2b('0xb')](function(_0x251cd7){logger['info'](_0x4c2b('0xc'),_0x12c96e,_0x4c2b('0xd'));logger[_0x4c2b('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x12c96e,_0x4c2b('0xd'),JSON[_0x4c2b('0xf')](_0x251cd7));if(_0x251cd7[_0x4c2b('0x10')]){if(_0x251cd7['error']['code']===0x1f4){logger['error'](_0x4c2b('0xc'),_0x12c96e,_0x251cd7[_0x4c2b('0x10')][_0x4c2b('0x11')]);return _0x9a40c8(_0x251cd7[_0x4c2b('0x10')][_0x4c2b('0x11')]);}logger[_0x4c2b('0x10')](_0x4c2b('0xc'),_0x12c96e,_0x251cd7[_0x4c2b('0x10')][_0x4c2b('0x11')]);return _0x427f07(_0x251cd7['error']['message']);}else{logger['info'](_0x4c2b('0xc'),_0x12c96e,_0x4c2b('0xd'));_0x427f07(_0x251cd7[_0x4c2b('0x12')][_0x4c2b('0x11')]);}})[_0x4c2b('0x13')](function(_0x3e5a3b){logger[_0x4c2b('0x10')](_0x4c2b('0xc'),_0x12c96e,_0x3e5a3b);_0x9a40c8(_0x3e5a3b);});});}exports[_0x4c2b('0x14')]=function(_0x551a15){var _0x14dd86=this;return new Promise(function(_0x401dca,_0x28ac26){return db['CmHopper']['findAll']({'raw':_0x551a15['options']?_0x551a15[_0x4c2b('0x15')][_0x4c2b('0x16')]===undefined?!![]:![]:!![],'where':_0x551a15[_0x4c2b('0x15')]?_0x551a15[_0x4c2b('0x15')][_0x4c2b('0x17')]||null:null,'attributes':_0x551a15[_0x4c2b('0x15')]?_0x551a15[_0x4c2b('0x15')]['attributes']||null:null,'limit':_0x551a15['options']?_0x551a15[_0x4c2b('0x15')][_0x4c2b('0x18')]||null:null,'include':_0x551a15[_0x4c2b('0x15')]?_0x551a15['options'][_0x4c2b('0x19')]?_[_0x4c2b('0x1a')](_0x551a15['options'][_0x4c2b('0x19')],function(_0x3eb4fb){return{'model':db[_0x3eb4fb[_0x4c2b('0x1b')]],'as':_0x3eb4fb['as'],'attributes':_0x3eb4fb[_0x4c2b('0x1c')],'include':_0x3eb4fb[_0x4c2b('0x19')]?_[_0x4c2b('0x1a')](_0x3eb4fb['include'],function(_0x393428){return{'model':db[_0x393428['model']],'as':_0x393428['as'],'attributes':_0x393428[_0x4c2b('0x1c')],'include':_0x393428[_0x4c2b('0x19')]?_[_0x4c2b('0x1a')](_0x393428[_0x4c2b('0x19')],function(_0x38773e){return{'model':db[_0x38773e[_0x4c2b('0x1b')]],'as':_0x38773e['as'],'attributes':_0x38773e[_0x4c2b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a0698){logger[_0x4c2b('0x1d')]('GetCmHopper',_0x551a15);logger['debug'](_0x4c2b('0x14'),_0x551a15,JSON[_0x4c2b('0xf')](_0x1a0698));_0x401dca(_0x1a0698);})['catch'](function(_0xc42e5d){logger['error'](_0x4c2b('0x14'),_0xc42e5d['message'],_0x551a15);_0x28ac26(_0x14dd86[_0x4c2b('0x10')](0x1f4,_0xc42e5d[_0x4c2b('0x11')]));});});};exports[_0x4c2b('0x1e')]=function(_0x46bc2d){var _0x54fb81=this;return new Promise(function(_0x3afb6d,_0x3bc581){return db[_0x4c2b('0x1f')][_0x4c2b('0x20')]({'raw':_0x46bc2d[_0x4c2b('0x15')]?_0x46bc2d[_0x4c2b('0x15')][_0x4c2b('0x16')]===undefined?!![]:![]:!![],'where':_0x46bc2d['options']?_0x46bc2d[_0x4c2b('0x15')][_0x4c2b('0x17')]||null:null,'attributes':_0x46bc2d[_0x4c2b('0x15')]?_0x46bc2d[_0x4c2b('0x15')]['attributes']||null:null,'include':_0x46bc2d[_0x4c2b('0x15')]?_0x46bc2d['options']['include']?_['map'](_0x46bc2d[_0x4c2b('0x15')]['include'],function(_0x3927a2){return{'model':db[_0x3927a2[_0x4c2b('0x1b')]],'as':_0x3927a2['as'],'attributes':_0x3927a2[_0x4c2b('0x1c')],'include':_0x3927a2['include']?_[_0x4c2b('0x1a')](_0x3927a2[_0x4c2b('0x19')],function(_0x22dc15){return{'model':db[_0x22dc15[_0x4c2b('0x1b')]],'as':_0x22dc15['as'],'attributes':_0x22dc15[_0x4c2b('0x1c')],'include':_0x22dc15[_0x4c2b('0x19')]?_[_0x4c2b('0x1a')](_0x22dc15[_0x4c2b('0x19')],function(_0x21de83){return{'model':db[_0x21de83[_0x4c2b('0x1b')]],'as':_0x21de83['as'],'attributes':_0x21de83[_0x4c2b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4c2b('0xb')](function(_0x3bd440){logger['info'](_0x4c2b('0x1e'),_0x46bc2d);logger[_0x4c2b('0xe')](_0x4c2b('0x1e'),_0x46bc2d,JSON[_0x4c2b('0xf')](_0x3bd440));_0x3afb6d(_0x3bd440);})['catch'](function(_0x5a06a6){logger['error'](_0x4c2b('0x1e'),_0x5a06a6[_0x4c2b('0x11')],_0x46bc2d);_0x3bc581(_0x54fb81[_0x4c2b('0x10')](0x1f4,_0x5a06a6[_0x4c2b('0x11')]));});});};exports['CreateCmHopper']=function(_0x9e998f){var _0x4e5e8b=this;return new Promise(function(_0x453c62,_0x3cf19d){return db[_0x4c2b('0x1f')][_0x4c2b('0x21')](_0x9e998f['body'],{'raw':_0x9e998f[_0x4c2b('0x15')]?_0x9e998f[_0x4c2b('0x15')][_0x4c2b('0x16')]===undefined?!![]:![]:!![]})[_0x4c2b('0xb')](function(_0x5b63a0){logger[_0x4c2b('0x1d')](_0x4c2b('0x22'),_0x9e998f);logger['debug'](_0x4c2b('0x22'),_0x9e998f,JSON[_0x4c2b('0xf')](_0x5b63a0));_0x453c62(_0x5b63a0);})['catch'](function(_0x5e7b1a){logger[_0x4c2b('0x10')](_0x4c2b('0x22'),_0x5e7b1a[_0x4c2b('0x11')],_0x9e998f);_0x3cf19d(_0x4e5e8b['error'](0x1f4,_0x5e7b1a[_0x4c2b('0x11')]));});});};exports['UpdateCmHopper']=function(_0x5322ef){var _0x2fb9da=this;return new Promise(function(_0x4a5ec4,_0x17ec89){return db[_0x4c2b('0x1f')][_0x4c2b('0x23')](_0x5322ef[_0x4c2b('0x24')],{'raw':_0x5322ef[_0x4c2b('0x15')]?_0x5322ef['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5322ef[_0x4c2b('0x15')]?_0x5322ef['options'][_0x4c2b('0x17')]||null:null,'attributes':_0x5322ef[_0x4c2b('0x15')]?_0x5322ef[_0x4c2b('0x15')][_0x4c2b('0x1c')]||null:null,'limit':_0x5322ef[_0x4c2b('0x15')]?_0x5322ef['options'][_0x4c2b('0x18')]||null:null})['then'](function(_0x472b55){logger['info'](_0x4c2b('0x25'),_0x5322ef);logger[_0x4c2b('0xe')]('UpdateCmHopper',_0x5322ef,JSON[_0x4c2b('0xf')](_0x472b55));_0x4a5ec4(_0x472b55);})[_0x4c2b('0x13')](function(_0x47ed9d){logger['error'](_0x4c2b('0x25'),_0x47ed9d[_0x4c2b('0x11')],_0x5322ef);_0x17ec89(_0x2fb9da[_0x4c2b('0x10')](0x1f4,_0x47ed9d[_0x4c2b('0x11')]));});});};exports[_0x4c2b('0x26')]=function(_0x4419fd){var _0x259099=this;return new Promise(function(_0x4cb2eb,_0x4abf7e){return db[_0x4c2b('0x1f')][_0x4c2b('0x27')]({'where':_0x4419fd[_0x4c2b('0x15')]?_0x4419fd[_0x4c2b('0x15')][_0x4c2b('0x17')]||null:null})[_0x4c2b('0xb')](function(_0x53e4fc){logger[_0x4c2b('0x1d')](_0x4c2b('0x26'),_0x4419fd);logger[_0x4c2b('0xe')]('DestroyCmHopper',_0x4419fd,JSON[_0x4c2b('0xf')](_0x53e4fc));_0x4cb2eb(_0x53e4fc);})['catch'](function(_0x148542){logger[_0x4c2b('0x10')](_0x4c2b('0x26'),_0x148542[_0x4c2b('0x11')],_0x4419fd);_0x4abf7e(_0x259099[_0x4c2b('0x10')](0x1f4,_0x148542[_0x4c2b('0x11')]));});});};exports[_0x4c2b('0x28')]=function(_0x1644ef){var _0x8eb396=this;return new Promise(function(_0xa42b6e,_0xcd9280){return db[_0x4c2b('0x29')]['describe']()[_0x4c2b('0xb')](function(_0x214bd9){return db[_0x4c2b('0x2a')][_0x4c2b('0x2b')](function(_0x43cb38){return db[_0x4c2b('0x1f')][_0x4c2b('0x2c')]({'where':_0x1644ef['options']?_0x1644ef[_0x4c2b('0x15')][_0x4c2b('0x17')]||null:null,'attributes':_0x1644ef[_0x4c2b('0x15')]?_0x1644ef['options'][_0x4c2b('0x1c')]||null:null,'limit':_0x1644ef[_0x4c2b('0x15')]?_0x1644ef[_0x4c2b('0x15')]['limit']||null:null,'order':_0x1644ef[_0x4c2b('0x15')]?_0x1644ef[_0x4c2b('0x15')][_0x4c2b('0x2d')]||null:null,'transaction':_0x43cb38,'lock':_0x43cb38[_0x4c2b('0x2e')][_0x4c2b('0x2f')],'include':[{'model':db['CmContact'],'as':_0x4c2b('0x30'),'attributes':_[_0x4c2b('0x31')](_0x214bd9)},{'model':db[_0x4c2b('0x32')],'as':'Agent','attributes':['id','name',_0x4c2b('0x33')]}]})['then'](function(_0x345880){var _0x1813da=[];var _0x58c23a=[];for(var _0xd36cb=0x0;_0xd36cb<_0x345880['length'];_0xd36cb+=0x1){if(!_0x58c23a[_0x4c2b('0x34')](_0x345880[_0xd36cb][_0x4c2b('0x35')])){_0x58c23a['push'](_0x345880[_0xd36cb][_0x4c2b('0x35')]);_0x1813da[_0x4c2b('0x36')](_0x345880[_0xd36cb]['update'](_0x1644ef[_0x4c2b('0x24')],{'transaction':_0x43cb38}));}}return BPromise[_0x4c2b('0x37')](_0x1813da);});})['then'](function(_0x1767ff){logger[_0x4c2b('0x1d')](_0x4c2b('0x28'),_0x1644ef);logger['debug']('GetContactDialer',_0x1644ef,JSON[_0x4c2b('0xf')](_0x1767ff));_0xa42b6e(_0x1767ff);})[_0x4c2b('0x13')](function(_0x36e1c3){logger[_0x4c2b('0x10')]('GetContactDialer',_0x36e1c3[_0x4c2b('0x11')],_0x1644ef);_0xcd9280(_0x8eb396[_0x4c2b('0x10')](0x1f4,_0x36e1c3[_0x4c2b('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x5b1cb9){var _0x125658=this;return new Promise(function(_0xa0e0f2,_0x1eb685){return db['sequelize'][_0x4c2b('0x2b')](function(_0x3712bd){return db[_0x4c2b('0x38')]['create'](_0x5b1cb9[_0x4c2b('0x24')],{'raw':_0x5b1cb9[_0x4c2b('0x15')]?_0x5b1cb9['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x3712bd})[_0x4c2b('0xb')](function(){return db['CmHopper'][_0x4c2b('0x27')]({'where':_0x5b1cb9[_0x4c2b('0x15')]?_0x5b1cb9[_0x4c2b('0x15')][_0x4c2b('0x17')]||null:null,'transaction':_0x3712bd});});})['then'](function(_0x75d814){logger[_0x4c2b('0x1d')](_0x4c2b('0x39'),_0x5b1cb9);logger[_0x4c2b('0xe')]('MoveContactManagedDialer',_0x5b1cb9,JSON[_0x4c2b('0xf')](_0x75d814));_0xa0e0f2(_0x75d814);})[_0x4c2b('0x13')](function(_0x3053ac){logger[_0x4c2b('0x10')]('MoveContactManagedDialer',_0x3053ac[_0x4c2b('0x11')],_0x5b1cb9);_0x1eb685(_0x125658[_0x4c2b('0x10')](0x1f4,_0x3053ac[_0x4c2b('0x11')]));});});};exports[_0x4c2b('0x3a')]=function(_0x3937bc){var _0x3072d3=this;return new Promise(function(_0x14f4a1,_0x541410){return db['CmHopper'][_0x4c2b('0x2c')]({'raw':_0x3937bc[_0x4c2b('0x15')]?_0x3937bc['options'][_0x4c2b('0x16')]===undefined?!![]:![]:!![],'where':_0x3937bc['options']?_0x3937bc[_0x4c2b('0x15')][_0x4c2b('0x17')]||null:null,'attributes':[[db[_0x4c2b('0x2a')]['fn'](_0x4c2b('0x3b'),db[_0x4c2b('0x2a')]['fn']('IF',db[_0x4c2b('0x2a')]['literal'](_0x4c2b('0x3c')+util['format'](_0x4c2b('0x3d'),moment()[_0x4c2b('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x4c2b('0x3f')))),'contactsRescheduled']]})[_0x4c2b('0xb')](function(_0x65f8ec){logger[_0x4c2b('0x1d')](_0x4c2b('0x3a'),_0x3937bc);logger[_0x4c2b('0xe')](_0x4c2b('0x3a'),_0x3937bc,JSON['stringify'](_0x65f8ec));_0x14f4a1(_0x65f8ec);})[_0x4c2b('0x13')](function(_0x4374d8){logger[_0x4c2b('0x10')]('CountReScheduled',_0x4374d8[_0x4c2b('0x11')],_0x3937bc);_0x541410(_0x3072d3['error'](0x1f4,_0x4374d8[_0x4c2b('0x11')]));});});};exports[_0x4c2b('0x40')]=function(_0x4f05d7){var _0x16e15f=this;return new Promise(function(_0x879682,_0x2df403){return db[_0x4c2b('0x29')][_0x4c2b('0x41')]()[_0x4c2b('0xb')](function(_0xa291bb){return db[_0x4c2b('0x2a')][_0x4c2b('0x2b')](function(_0x4748fa){return db[_0x4c2b('0x1f')][_0x4c2b('0x2c')]({'where':_0x4f05d7[_0x4c2b('0x15')]?_0x4f05d7[_0x4c2b('0x15')][_0x4c2b('0x17')]||null:null,'attributes':_0x4f05d7['options']?_0x4f05d7[_0x4c2b('0x15')][_0x4c2b('0x1c')]||null:null,'limit':0x1,'order':_0x4f05d7[_0x4c2b('0x15')]?_0x4f05d7[_0x4c2b('0x15')][_0x4c2b('0x2d')]||null:null,'group':db[_0x4c2b('0x1f')][_0x4c2b('0x35')],'transaction':_0x4748fa,'lock':_0x4748fa[_0x4c2b('0x2e')]['UPDATE'],'include':_0x4f05d7[_0x4c2b('0x15')]?_0x4f05d7[_0x4c2b('0x15')][_0x4c2b('0x19')]?_[_0x4c2b('0x1a')](_0x4f05d7[_0x4c2b('0x15')][_0x4c2b('0x19')],function(_0x3f0ea0){return{'model':db[_0x3f0ea0['model']],'as':_0x3f0ea0['as'],'attributes':_0x3f0ea0[_0x4c2b('0x1c')],'include':_0x3f0ea0[_0x4c2b('0x19')]?_['map'](_0x3f0ea0[_0x4c2b('0x19')],function(_0x3eff3e){return{'model':db[_0x3eff3e[_0x4c2b('0x1b')]],'as':_0x3eff3e['as'],'attributes':_0x3eff3e[_0x4c2b('0x1c')],'include':_0x3eff3e['include']?_[_0x4c2b('0x1a')](_0x3eff3e[_0x4c2b('0x19')],function(_0x167108){return{'model':db[_0x167108[_0x4c2b('0x1b')]],'as':_0x167108['as'],'attributes':_0x167108['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c2b('0xb')](function(_0x36ba48){var _0x42f442=[];for(var _0x37937a=0x0;_0x37937a<_0x36ba48[_0x4c2b('0x42')];_0x37937a+=0x1){_0x42f442[_0x4c2b('0x36')](_0x36ba48[_0x37937a]['update'](_0x4f05d7[_0x4c2b('0x24')],{'transaction':_0x4748fa}));}return BPromise[_0x4c2b('0x37')](_0x42f442);});})['then'](function(_0x5f37d0){logger['info'](_0x4c2b('0x40'),_0x4f05d7);logger[_0x4c2b('0xe')](_0x4c2b('0x40'),_0x4f05d7,JSON[_0x4c2b('0xf')](_0x5f37d0));_0x879682(_0x5f37d0);})[_0x4c2b('0x13')](function(_0x4da485){logger[_0x4c2b('0x10')](_0x4c2b('0x40'),_0x4da485[_0x4c2b('0x11')],_0x4f05d7);_0x2df403(_0x16e15f[_0x4c2b('0x10')](0x1f4,_0x4da485[_0x4c2b('0x11')]));});});});};exports[_0x4c2b('0x43')]=function(_0x2dcb12){var _0x268292=this;return new Promise(function(_0x563c60,_0x1c3702){db[_0x4c2b('0x29')][_0x4c2b('0x41')]()[_0x4c2b('0xb')](function(_0x8a3c3d){return db[_0x4c2b('0x1f')][_0x4c2b('0x2c')]({'raw':_0x2dcb12[_0x4c2b('0x15')]?_0x2dcb12['options'][_0x4c2b('0x16')]===undefined?!![]:![]:!![],'where':_0x2dcb12[_0x4c2b('0x15')]?_0x2dcb12['options'][_0x4c2b('0x17')]||null:null,'attributes':_0x2dcb12[_0x4c2b('0x15')]?_0x2dcb12['options']['attributes']||null:null,'limit':_0x2dcb12[_0x4c2b('0x15')]?_0x2dcb12[_0x4c2b('0x15')][_0x4c2b('0x18')]||null:null,'include':_0x2dcb12['options']?_0x2dcb12[_0x4c2b('0x15')][_0x4c2b('0x19')]?_[_0x4c2b('0x1a')](_0x2dcb12['options'][_0x4c2b('0x19')],function(_0x47dc00){return{'model':db[_0x47dc00[_0x4c2b('0x1b')]],'as':_0x47dc00['as'],'attributes':_0x47dc00['as']===_0x4c2b('0x30')?_[_0x4c2b('0x31')](_0x8a3c3d):_0x47dc00[_0x4c2b('0x1c')],'include':_0x47dc00['include']?_[_0x4c2b('0x1a')](_0x47dc00[_0x4c2b('0x19')],function(_0x2ffc35){return{'model':db[_0x2ffc35[_0x4c2b('0x1b')]],'as':_0x2ffc35['as'],'attributes':_0x2ffc35[_0x4c2b('0x1c')],'include':_0x2ffc35[_0x4c2b('0x19')]?_[_0x4c2b('0x1a')](_0x2ffc35[_0x4c2b('0x19')],function(_0x4f0252){return{'model':db[_0x4f0252['model']],'as':_0x4f0252['as'],'attributes':_0x4f0252[_0x4c2b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5084fd){logger['info']('GetCmHopper',_0x2dcb12);logger[_0x4c2b('0xe')]('GetCmHopper',_0x2dcb12,JSON[_0x4c2b('0xf')](_0x5084fd));_0x563c60(_0x5084fd);})[_0x4c2b('0x13')](function(_0x1bfe52){logger[_0x4c2b('0x10')](_0x4c2b('0x14'),_0x1bfe52[_0x4c2b('0x11')],_0x2dcb12);_0x1c3702(_0x268292[_0x4c2b('0x10')](0x1f4,_0x1bfe52['message']));});});});};exports[_0x4c2b('0x44')]=function(_0x40a058){console[_0x4c2b('0x45')](_0x4c2b('0x46'),_0x40a058);console[_0x4c2b('0x45')](_0x4c2b('0x47'),_0x40a058['options'][_0x4c2b('0x17')][_0x4c2b('0x48')]);_this=this;return new Promise(function(_0x402c3c,_0x233ddf){return db[_0x4c2b('0x29')][_0x4c2b('0x49')]({'raw':!![],'where':{'phone':_0x40a058['options'][_0x4c2b('0x17')][_0x4c2b('0x48')]},'attributes':['id',_0x4c2b('0x4a')],'order':[['id',_0x4c2b('0x4b')]]})[_0x4c2b('0xb')](function(_0x2f9414){console['log'](_0x4c2b('0x4c'),_0x2f9414);logger[_0x4c2b('0x1d')](_0x4c2b('0x4d'),_0x40a058);logger[_0x4c2b('0xe')](_0x4c2b('0x4d'),_0x40a058,JSON['stringify'](_0x2f9414));_0x402c3c(_0x2f9414);})[_0x4c2b('0x13')](function(_0x9bdaf0){logger[_0x4c2b('0x10')](_0x4c2b('0x4d'),_0x9bdaf0[_0x4c2b('0x11')],_0x40a058);_0x233ddf(_this[_0x4c2b('0x10')](0x1f4,_0x9bdaf0['message']));});});};
\ No newline at end of file
+var _0xb8f0=['describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','length','UserId','update','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','push','GetContactRecallMe','findAll','GetContactByPhone','log','phone\x20value','findOne','phone','dialTimezone','getContactByPhone','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','CmHopper,\x20%s,\x20%s','message','result','GetCmHopper','CmHopper','options','raw','where','limit','include','model','attributes','map','stringify','catch','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','body','destroy','DestroyCmHopper','GetContactDialer','CmContact'];(function(_0x129b51,_0x5374e1){var _0x4914c5=function(_0xdd154c){while(--_0xdd154c){_0x129b51['push'](_0x129b51['shift']());}};_0x4914c5(++_0x5374e1);}(_0xb8f0,0x6d));var _0x0b8f=function(_0x3f40c1,_0x4397f6){_0x3f40c1=_0x3f40c1-0x0;var _0x1aa2a2=_0xb8f0[_0x3f40c1];return _0x1aa2a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b8f('0x0'));var BPromise=require(_0x0b8f('0x1'));var rs=require(_0x0b8f('0x2'));var fs=require('fs');var Redis=require(_0x0b8f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0b8f('0x4'));var config=require(_0x0b8f('0x5'));var jayson=require(_0x0b8f('0x6'));var client=jayson['client'][_0x0b8f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45d201,_0x2fbc42,_0x5e2ce4){return new BPromise(function(_0x1ea34b,_0x525701){return client[_0x0b8f('0x8')](_0x45d201,_0x5e2ce4)[_0x0b8f('0x9')](function(_0x1f5e95){logger[_0x0b8f('0xa')]('CmHopper,\x20%s,\x20%s',_0x2fbc42,_0x0b8f('0xb'));logger[_0x0b8f('0xc')](_0x0b8f('0xd'),_0x2fbc42,_0x0b8f('0xb'),JSON['stringify'](_0x1f5e95));if(_0x1f5e95[_0x0b8f('0xe')]){if(_0x1f5e95[_0x0b8f('0xe')][_0x0b8f('0xf')]===0x1f4){logger[_0x0b8f('0xe')](_0x0b8f('0x10'),_0x2fbc42,_0x1f5e95[_0x0b8f('0xe')][_0x0b8f('0x11')]);return _0x525701(_0x1f5e95[_0x0b8f('0xe')]['message']);}logger[_0x0b8f('0xe')](_0x0b8f('0x10'),_0x2fbc42,_0x1f5e95[_0x0b8f('0xe')][_0x0b8f('0x11')]);return _0x1ea34b(_0x1f5e95[_0x0b8f('0xe')][_0x0b8f('0x11')]);}else{logger[_0x0b8f('0xa')](_0x0b8f('0x10'),_0x2fbc42,_0x0b8f('0xb'));_0x1ea34b(_0x1f5e95[_0x0b8f('0x12')][_0x0b8f('0x11')]);}})['catch'](function(_0x304146){logger[_0x0b8f('0xe')](_0x0b8f('0x10'),_0x2fbc42,_0x304146);_0x525701(_0x304146);});});}exports[_0x0b8f('0x13')]=function(_0x250a42){var _0x10faa1=this;return new Promise(function(_0x4a42ec,_0x532137){return db[_0x0b8f('0x14')]['findAll']({'raw':_0x250a42[_0x0b8f('0x15')]?_0x250a42['options'][_0x0b8f('0x16')]===undefined?!![]:![]:!![],'where':_0x250a42[_0x0b8f('0x15')]?_0x250a42[_0x0b8f('0x15')][_0x0b8f('0x17')]||null:null,'attributes':_0x250a42['options']?_0x250a42[_0x0b8f('0x15')]['attributes']||null:null,'limit':_0x250a42[_0x0b8f('0x15')]?_0x250a42['options'][_0x0b8f('0x18')]||null:null,'include':_0x250a42[_0x0b8f('0x15')]?_0x250a42[_0x0b8f('0x15')]['include']?_['map'](_0x250a42[_0x0b8f('0x15')][_0x0b8f('0x19')],function(_0x31af88){return{'model':db[_0x31af88[_0x0b8f('0x1a')]],'as':_0x31af88['as'],'attributes':_0x31af88[_0x0b8f('0x1b')],'include':_0x31af88[_0x0b8f('0x19')]?_[_0x0b8f('0x1c')](_0x31af88[_0x0b8f('0x19')],function(_0x5b47d1){return{'model':db[_0x5b47d1[_0x0b8f('0x1a')]],'as':_0x5b47d1['as'],'attributes':_0x5b47d1[_0x0b8f('0x1b')],'include':_0x5b47d1[_0x0b8f('0x19')]?_[_0x0b8f('0x1c')](_0x5b47d1[_0x0b8f('0x19')],function(_0x1c2800){return{'model':db[_0x1c2800[_0x0b8f('0x1a')]],'as':_0x1c2800['as'],'attributes':_0x1c2800['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1035bf){logger['info'](_0x0b8f('0x13'),_0x250a42);logger[_0x0b8f('0xc')](_0x0b8f('0x13'),_0x250a42,JSON[_0x0b8f('0x1d')](_0x1035bf));_0x4a42ec(_0x1035bf);})[_0x0b8f('0x1e')](function(_0x54649b){logger[_0x0b8f('0xe')](_0x0b8f('0x13'),_0x54649b[_0x0b8f('0x11')],_0x250a42);_0x532137(_0x10faa1['error'](0x1f4,_0x54649b[_0x0b8f('0x11')]));});});};exports[_0x0b8f('0x1f')]=function(_0x31094e){var _0x58ed78=this;return new Promise(function(_0x323fca,_0x1a675c){return db['CmHopper'][_0x0b8f('0x20')]({'raw':_0x31094e[_0x0b8f('0x15')]?_0x31094e[_0x0b8f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x31094e['options']?_0x31094e[_0x0b8f('0x15')][_0x0b8f('0x17')]||null:null,'attributes':_0x31094e[_0x0b8f('0x15')]?_0x31094e[_0x0b8f('0x15')][_0x0b8f('0x1b')]||null:null,'include':_0x31094e[_0x0b8f('0x15')]?_0x31094e[_0x0b8f('0x15')]['include']?_['map'](_0x31094e['options'][_0x0b8f('0x19')],function(_0x548c7b){return{'model':db[_0x548c7b[_0x0b8f('0x1a')]],'as':_0x548c7b['as'],'attributes':_0x548c7b[_0x0b8f('0x1b')],'include':_0x548c7b['include']?_[_0x0b8f('0x1c')](_0x548c7b[_0x0b8f('0x19')],function(_0x37dd97){return{'model':db[_0x37dd97['model']],'as':_0x37dd97['as'],'attributes':_0x37dd97[_0x0b8f('0x1b')],'include':_0x37dd97[_0x0b8f('0x19')]?_[_0x0b8f('0x1c')](_0x37dd97[_0x0b8f('0x19')],function(_0x5da22c){return{'model':db[_0x5da22c[_0x0b8f('0x1a')]],'as':_0x5da22c['as'],'attributes':_0x5da22c[_0x0b8f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0b8f('0x9')](function(_0xa9d39a){logger[_0x0b8f('0xa')](_0x0b8f('0x1f'),_0x31094e);logger[_0x0b8f('0xc')]('ShowCmHopper',_0x31094e,JSON[_0x0b8f('0x1d')](_0xa9d39a));_0x323fca(_0xa9d39a);})[_0x0b8f('0x1e')](function(_0x538c75){logger[_0x0b8f('0xe')](_0x0b8f('0x1f'),_0x538c75[_0x0b8f('0x11')],_0x31094e);_0x1a675c(_0x58ed78['error'](0x1f4,_0x538c75[_0x0b8f('0x11')]));});});};exports[_0x0b8f('0x21')]=function(_0x708dbe){var _0x26d664=this;return new Promise(function(_0x67af49,_0x44d363){return db[_0x0b8f('0x14')][_0x0b8f('0x22')](_0x708dbe['body'],{'raw':_0x708dbe[_0x0b8f('0x15')]?_0x708dbe[_0x0b8f('0x15')][_0x0b8f('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x4c8e4d){logger[_0x0b8f('0xa')](_0x0b8f('0x21'),_0x708dbe);logger[_0x0b8f('0xc')](_0x0b8f('0x21'),_0x708dbe,JSON[_0x0b8f('0x1d')](_0x4c8e4d));_0x67af49(_0x4c8e4d);})[_0x0b8f('0x1e')](function(_0x40ca71){logger[_0x0b8f('0xe')](_0x0b8f('0x21'),_0x40ca71[_0x0b8f('0x11')],_0x708dbe);_0x44d363(_0x26d664['error'](0x1f4,_0x40ca71['message']));});});};exports[_0x0b8f('0x23')]=function(_0x3b31c3){var _0x27b598=this;return new Promise(function(_0x4a2f8b,_0xfb3f8e){return db[_0x0b8f('0x14')]['update'](_0x3b31c3[_0x0b8f('0x24')],{'raw':_0x3b31c3[_0x0b8f('0x15')]?_0x3b31c3[_0x0b8f('0x15')][_0x0b8f('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b31c3[_0x0b8f('0x15')]?_0x3b31c3['options'][_0x0b8f('0x17')]||null:null,'attributes':_0x3b31c3[_0x0b8f('0x15')]?_0x3b31c3[_0x0b8f('0x15')][_0x0b8f('0x1b')]||null:null,'limit':_0x3b31c3[_0x0b8f('0x15')]?_0x3b31c3['options'][_0x0b8f('0x18')]||null:null})[_0x0b8f('0x9')](function(_0x562056){logger[_0x0b8f('0xa')](_0x0b8f('0x23'),_0x3b31c3);logger[_0x0b8f('0xc')](_0x0b8f('0x23'),_0x3b31c3,JSON['stringify'](_0x562056));_0x4a2f8b(_0x562056);})['catch'](function(_0x283bd3){logger[_0x0b8f('0xe')](_0x0b8f('0x23'),_0x283bd3[_0x0b8f('0x11')],_0x3b31c3);_0xfb3f8e(_0x27b598[_0x0b8f('0xe')](0x1f4,_0x283bd3[_0x0b8f('0x11')]));});});};exports['DestroyCmHopper']=function(_0x11370b){var _0x3f8a8b=this;return new Promise(function(_0x50ffc2,_0x5ec2a0){return db[_0x0b8f('0x14')][_0x0b8f('0x25')]({'where':_0x11370b[_0x0b8f('0x15')]?_0x11370b[_0x0b8f('0x15')][_0x0b8f('0x17')]||null:null})[_0x0b8f('0x9')](function(_0x422f5d){logger['info'](_0x0b8f('0x26'),_0x11370b);logger[_0x0b8f('0xc')](_0x0b8f('0x26'),_0x11370b,JSON['stringify'](_0x422f5d));_0x50ffc2(_0x422f5d);})[_0x0b8f('0x1e')](function(_0x3ef42c){logger[_0x0b8f('0xe')](_0x0b8f('0x26'),_0x3ef42c[_0x0b8f('0x11')],_0x11370b);_0x5ec2a0(_0x3f8a8b[_0x0b8f('0xe')](0x1f4,_0x3ef42c['message']));});});};exports[_0x0b8f('0x27')]=function(_0x427294){var _0x229dee=this;return new Promise(function(_0x3525ce,_0x520459){return db[_0x0b8f('0x28')][_0x0b8f('0x29')]()['then'](function(_0x54aa95){return db[_0x0b8f('0x2a')][_0x0b8f('0x2b')](function(_0x164ec7){return db[_0x0b8f('0x14')]['findAll']({'where':_0x427294[_0x0b8f('0x15')]?_0x427294['options']['where']||null:null,'attributes':_0x427294[_0x0b8f('0x15')]?_0x427294[_0x0b8f('0x15')][_0x0b8f('0x1b')]||null:null,'limit':_0x427294[_0x0b8f('0x15')]?_0x427294['options']['limit']||null:null,'order':_0x427294['options']?_0x427294[_0x0b8f('0x15')][_0x0b8f('0x2c')]||null:null,'transaction':_0x164ec7,'lock':_0x164ec7[_0x0b8f('0x2d')][_0x0b8f('0x2e')],'include':[{'model':db[_0x0b8f('0x28')],'as':_0x0b8f('0x2f'),'attributes':_[_0x0b8f('0x30')](_0x54aa95)},{'model':db[_0x0b8f('0x31')],'as':_0x0b8f('0x32'),'attributes':['id',_0x0b8f('0x33'),'voicePause']}]})[_0x0b8f('0x9')](function(_0x2c0627){var _0x44640e=[];var _0x5eb44c=[];for(var _0x23b3f5=0x0;_0x23b3f5<_0x2c0627[_0x0b8f('0x34')];_0x23b3f5+=0x1){if(!_0x5eb44c['includes'](_0x2c0627[_0x23b3f5][_0x0b8f('0x35')])){_0x5eb44c['push'](_0x2c0627[_0x23b3f5]['UserId']);_0x44640e['push'](_0x2c0627[_0x23b3f5][_0x0b8f('0x36')](_0x427294['body'],{'transaction':_0x164ec7}));}}return BPromise[_0x0b8f('0x37')](_0x44640e);});})['then'](function(_0x2c3a71){logger[_0x0b8f('0xa')]('GetContactDialer',_0x427294);logger[_0x0b8f('0xc')](_0x0b8f('0x27'),_0x427294,JSON['stringify'](_0x2c3a71));_0x3525ce(_0x2c3a71);})[_0x0b8f('0x1e')](function(_0x51115e){logger[_0x0b8f('0xe')](_0x0b8f('0x27'),_0x51115e['message'],_0x427294);_0x520459(_0x229dee[_0x0b8f('0xe')](0x1f4,_0x51115e['message']));});});});};exports[_0x0b8f('0x38')]=function(_0x4a1918){var _0x15dd53=this;return new Promise(function(_0x3a0ca0,_0x4728c6){return db[_0x0b8f('0x2a')][_0x0b8f('0x2b')](function(_0x29b6aa){return db[_0x0b8f('0x39')][_0x0b8f('0x22')](_0x4a1918['body'],{'raw':_0x4a1918['options']?_0x4a1918['options'][_0x0b8f('0x16')]===undefined?!![]:![]:!![],'transaction':_0x29b6aa})[_0x0b8f('0x9')](function(){return db[_0x0b8f('0x14')]['destroy']({'where':_0x4a1918['options']?_0x4a1918[_0x0b8f('0x15')][_0x0b8f('0x17')]||null:null,'transaction':_0x29b6aa});});})['then'](function(_0x118621){logger['info'](_0x0b8f('0x38'),_0x4a1918);logger[_0x0b8f('0xc')](_0x0b8f('0x38'),_0x4a1918,JSON[_0x0b8f('0x1d')](_0x118621));_0x3a0ca0(_0x118621);})[_0x0b8f('0x1e')](function(_0x2c78b8){logger[_0x0b8f('0xe')](_0x0b8f('0x38'),_0x2c78b8[_0x0b8f('0x11')],_0x4a1918);_0x4728c6(_0x15dd53[_0x0b8f('0xe')](0x1f4,_0x2c78b8[_0x0b8f('0x11')]));});});};exports[_0x0b8f('0x3a')]=function(_0x4f98fa){var _0x26f894=this;return new Promise(function(_0x1b8dd6,_0x1dff98){return db[_0x0b8f('0x14')]['findAll']({'raw':_0x4f98fa[_0x0b8f('0x15')]?_0x4f98fa[_0x0b8f('0x15')][_0x0b8f('0x16')]===undefined?!![]:![]:!![],'where':_0x4f98fa['options']?_0x4f98fa[_0x0b8f('0x15')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x0b8f('0x2a')]['fn']('IF',db[_0x0b8f('0x2a')]['literal'](_0x0b8f('0x3b')+util[_0x0b8f('0x3c')](_0x0b8f('0x3d'),moment()[_0x0b8f('0x3c')](_0x0b8f('0x3e')))+_0x0b8f('0x3f')))),_0x0b8f('0x40')]]})[_0x0b8f('0x9')](function(_0x13a707){logger['info']('CountReScheduled',_0x4f98fa);logger[_0x0b8f('0xc')](_0x0b8f('0x3a'),_0x4f98fa,JSON['stringify'](_0x13a707));_0x1b8dd6(_0x13a707);})[_0x0b8f('0x1e')](function(_0x319b67){logger[_0x0b8f('0xe')](_0x0b8f('0x3a'),_0x319b67[_0x0b8f('0x11')],_0x4f98fa);_0x1dff98(_0x26f894[_0x0b8f('0xe')](0x1f4,_0x319b67[_0x0b8f('0x11')]));});});};exports['GetContactRecallMe']=function(_0x1acb89){var _0x43b8f0=this;return new Promise(function(_0x146b2c,_0x2d25f2){return db[_0x0b8f('0x28')]['describe']()[_0x0b8f('0x9')](function(_0xbde666){return db[_0x0b8f('0x2a')]['transaction'](function(_0x448328){return db[_0x0b8f('0x14')]['findAll']({'where':_0x1acb89[_0x0b8f('0x15')]?_0x1acb89[_0x0b8f('0x15')][_0x0b8f('0x17')]||null:null,'attributes':_0x1acb89[_0x0b8f('0x15')]?_0x1acb89[_0x0b8f('0x15')][_0x0b8f('0x1b')]||null:null,'limit':0x1,'order':_0x1acb89['options']?_0x1acb89['options'][_0x0b8f('0x2c')]||null:null,'group':db[_0x0b8f('0x14')][_0x0b8f('0x35')],'transaction':_0x448328,'lock':_0x448328['LOCK'][_0x0b8f('0x2e')],'include':_0x1acb89['options']?_0x1acb89[_0x0b8f('0x15')][_0x0b8f('0x19')]?_[_0x0b8f('0x1c')](_0x1acb89[_0x0b8f('0x15')][_0x0b8f('0x19')],function(_0x445343){return{'model':db[_0x445343[_0x0b8f('0x1a')]],'as':_0x445343['as'],'attributes':_0x445343[_0x0b8f('0x1b')],'include':_0x445343[_0x0b8f('0x19')]?_['map'](_0x445343[_0x0b8f('0x19')],function(_0x4a0de7){return{'model':db[_0x4a0de7['model']],'as':_0x4a0de7['as'],'attributes':_0x4a0de7[_0x0b8f('0x1b')],'include':_0x4a0de7['include']?_[_0x0b8f('0x1c')](_0x4a0de7[_0x0b8f('0x19')],function(_0x31226b){return{'model':db[_0x31226b[_0x0b8f('0x1a')]],'as':_0x31226b['as'],'attributes':_0x31226b[_0x0b8f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0b8f('0x9')](function(_0x485e7a){var _0x171648=[];for(var _0x33069e=0x0;_0x33069e<_0x485e7a[_0x0b8f('0x34')];_0x33069e+=0x1){_0x171648[_0x0b8f('0x41')](_0x485e7a[_0x33069e][_0x0b8f('0x36')](_0x1acb89[_0x0b8f('0x24')],{'transaction':_0x448328}));}return BPromise[_0x0b8f('0x37')](_0x171648);});})[_0x0b8f('0x9')](function(_0x10135a){logger['info'](_0x0b8f('0x42'),_0x1acb89);logger['debug'](_0x0b8f('0x42'),_0x1acb89,JSON[_0x0b8f('0x1d')](_0x10135a));_0x146b2c(_0x10135a);})[_0x0b8f('0x1e')](function(_0x32bc7c){logger[_0x0b8f('0xe')](_0x0b8f('0x42'),_0x32bc7c[_0x0b8f('0x11')],_0x1acb89);_0x2d25f2(_0x43b8f0['error'](0x1f4,_0x32bc7c[_0x0b8f('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0xff520e){var _0xa4ba42=this;return new Promise(function(_0x53fddb,_0x4a10){db[_0x0b8f('0x28')][_0x0b8f('0x29')]()['then'](function(_0x245715){return db['CmHopper'][_0x0b8f('0x43')]({'raw':_0xff520e[_0x0b8f('0x15')]?_0xff520e[_0x0b8f('0x15')][_0x0b8f('0x16')]===undefined?!![]:![]:!![],'where':_0xff520e['options']?_0xff520e['options'][_0x0b8f('0x17')]||null:null,'attributes':_0xff520e[_0x0b8f('0x15')]?_0xff520e[_0x0b8f('0x15')]['attributes']||null:null,'limit':_0xff520e[_0x0b8f('0x15')]?_0xff520e[_0x0b8f('0x15')][_0x0b8f('0x18')]||null:null,'include':_0xff520e[_0x0b8f('0x15')]?_0xff520e[_0x0b8f('0x15')][_0x0b8f('0x19')]?_['map'](_0xff520e[_0x0b8f('0x15')]['include'],function(_0x1346d9){return{'model':db[_0x1346d9[_0x0b8f('0x1a')]],'as':_0x1346d9['as'],'attributes':_0x1346d9['as']==='Contact'?_[_0x0b8f('0x30')](_0x245715):_0x1346d9[_0x0b8f('0x1b')],'include':_0x1346d9['include']?_['map'](_0x1346d9['include'],function(_0xe00aa){return{'model':db[_0xe00aa[_0x0b8f('0x1a')]],'as':_0xe00aa['as'],'attributes':_0xe00aa['attributes'],'include':_0xe00aa[_0x0b8f('0x19')]?_[_0x0b8f('0x1c')](_0xe00aa[_0x0b8f('0x19')],function(_0x2c6d62){return{'model':db[_0x2c6d62[_0x0b8f('0x1a')]],'as':_0x2c6d62['as'],'attributes':_0x2c6d62[_0x0b8f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0b8f('0x9')](function(_0xe5f7cf){logger[_0x0b8f('0xa')]('GetCmHopper',_0xff520e);logger[_0x0b8f('0xc')](_0x0b8f('0x13'),_0xff520e,JSON[_0x0b8f('0x1d')](_0xe5f7cf));_0x53fddb(_0xe5f7cf);})['catch'](function(_0x528756){logger[_0x0b8f('0xe')](_0x0b8f('0x13'),_0x528756[_0x0b8f('0x11')],_0xff520e);_0x4a10(_0xa4ba42[_0x0b8f('0xe')](0x1f4,_0x528756[_0x0b8f('0x11')]));});});});};exports[_0x0b8f('0x44')]=function(_0x4ae663){console[_0x0b8f('0x45')]('req\x20value',_0x4ae663);console['log'](_0x0b8f('0x46'),_0x4ae663[_0x0b8f('0x15')][_0x0b8f('0x17')]['phone']);_this=this;return new Promise(function(_0x58e074,_0x10cd97){return db['CmContact'][_0x0b8f('0x47')]({'raw':!![],'where':{'phone':_0x4ae663[_0x0b8f('0x15')][_0x0b8f('0x17')][_0x0b8f('0x48')]},'attributes':['id',_0x0b8f('0x49')],'order':[['id','DESC']]})[_0x0b8f('0x9')](function(_0x24e267){console['log']('getcontactbyohone',_0x24e267);logger[_0x0b8f('0xa')](_0x0b8f('0x4a'),_0x4ae663);logger[_0x0b8f('0xc')]('getContactByPhone',_0x4ae663,JSON[_0x0b8f('0x1d')](_0x24e267));_0x58e074(_0x24e267);})['catch'](function(_0x5030fe){logger[_0x0b8f('0xe')](_0x0b8f('0x4a'),_0x5030fe[_0x0b8f('0x11')],_0x4ae663);_0x10cd97(_this[_0x0b8f('0xe')](0x1f4,_0x5030fe[_0x0b8f('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js
index d2a1b7f..3083816 100644
--- a/server/api/cmHopper/index.js
+++ b/server/api/cmHopper/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d0e=['/timezones','getTimezones','show','post','create','getPreview','/timezone','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts'];(function(_0x39e2e1,_0x300418){var _0x208522=function(_0x136bb1){while(--_0x136bb1){_0x39e2e1['push'](_0x39e2e1['shift']());}};_0x208522(++_0x300418);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0xae2f74,_0x26c85b){_0xae2f74=_0xae2f74-0x0;var _0x35210e=_0x8d0e[_0xae2f74];return _0x35210e;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var auth=require(_0xe8d0('0x6'));var interaction=require(_0xe8d0('0x7'));var config=require(_0xe8d0('0x8'));var controller=require('./cmHopper.controller');router[_0xe8d0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe8d0('0x9')](_0xe8d0('0xa'),auth[_0xe8d0('0xb')](),controller[_0xe8d0('0xc')]);router[_0xe8d0('0x9')](_0xe8d0('0xd'),auth[_0xe8d0('0xb')](),controller[_0xe8d0('0xe')]);router['get'](_0xe8d0('0xf'),auth[_0xe8d0('0xb')](),controller[_0xe8d0('0x10')]);router['get']('/:id',auth[_0xe8d0('0xb')](),controller[_0xe8d0('0x11')]);router[_0xe8d0('0x12')]('/',auth[_0xe8d0('0xb')](),controller[_0xe8d0('0x13')]);router[_0xe8d0('0x12')]('/preview',auth[_0xe8d0('0xb')](),controller[_0xe8d0('0x14')]);router['post'](_0xe8d0('0x15'),auth['isAuthenticated'](),controller['getTimezone']);router[_0xe8d0('0x16')](_0xe8d0('0x17'),auth[_0xe8d0('0xb')](),controller[_0xe8d0('0x18')]);router[_0xe8d0('0x19')](_0xe8d0('0x17'),auth['isAuthenticated'](),controller[_0xe8d0('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x038b=['/:id','show','post','create','/preview','getPreview','/timezone','getTimezone','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','getOpenContacts','getTimezones'];(function(_0x5b3fdf,_0x576e4b){var _0x262786=function(_0x19cfcc){while(--_0x19cfcc){_0x5b3fdf['push'](_0x5b3fdf['shift']());}};_0x262786(++_0x576e4b);}(_0x038b,0x114));var _0xb038=function(_0x8c5eee,_0x4ed7d5){_0x8c5eee=_0x8c5eee-0x0;var _0x18b29d=_0x038b[_0x8c5eee];return _0x18b29d;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb038('0x4'));var config=require(_0xb038('0x5'));var controller=require('./cmHopper.controller');router[_0xb038('0x6')]('/',auth[_0xb038('0x7')](),controller['index']);router['get'](_0xb038('0x8'),auth[_0xb038('0x7')](),controller[_0xb038('0x9')]);router['get']('/opencontacts',auth[_0xb038('0x7')](),controller[_0xb038('0xa')]);router['get']('/timezones',auth[_0xb038('0x7')](),controller[_0xb038('0xb')]);router['get'](_0xb038('0xc'),auth[_0xb038('0x7')](),controller[_0xb038('0xd')]);router[_0xb038('0xe')]('/',auth[_0xb038('0x7')](),controller[_0xb038('0xf')]);router[_0xb038('0xe')](_0xb038('0x10'),auth[_0xb038('0x7')](),controller[_0xb038('0x11')]);router[_0xb038('0xe')](_0xb038('0x12'),auth[_0xb038('0x7')](),controller[_0xb038('0x13')]);router[_0xb038('0x14')](_0xb038('0xc'),auth[_0xb038('0x7')](),controller['update']);router[_0xb038('0x15')](_0xb038('0xc'),auth[_0xb038('0x7')](),controller[_0xb038('0x16')]);module[_0xb038('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
index fbc187d..91761cb 100644
--- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
+++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7ec6=['exports','INTEGER','STRING','DATE','moment','sequelize'];(function(_0x45e647,_0x4a1d96){var _0x47422c=function(_0x32722c){while(--_0x32722c){_0x45e647['push'](_0x45e647['shift']());}};_0x47422c(++_0x4a1d96);}(_0x7ec6,0x184));var _0x67ec=function(_0xd3a823,_0x4ad32e){_0xd3a823=_0xd3a823-0x0;var _0x54b98a=_0x7ec6[_0xd3a823];return _0x54b98a;};'use strict';var moment=require(_0x67ec('0x0'));var Sequelize=require(_0x67ec('0x1'));module[_0x67ec('0x2')]={'CmHopperId':{'type':Sequelize[_0x67ec('0x3')]},'phone':{'type':Sequelize[_0x67ec('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x67ec('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x67ec('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x67ec('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x67ec('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x67ec('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x67ec('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x67ec('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x67ec('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x67ec('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x78ea=['INTEGER','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','STRING'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x78ea,0x1a7));var _0xa78e=function(_0x48b3fb,_0x4b07bf){_0x48b3fb=_0x48b3fb-0x0;var _0x458604=_0x78ea[_0x48b3fb];return _0x458604;};'use strict';var moment=require(_0xa78e('0x0'));var Sequelize=require(_0xa78e('0x1'));module[_0xa78e('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0xa78e('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xa78e('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xa78e('0x5')](_0xa78e('0x6'))},'countbusyretry':{'type':Sequelize[_0xa78e('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa78e('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa78e('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xa78e('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa78e('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa78e('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa78e('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
index 121ed5c..7cf0bf2 100644
--- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
+++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa637=['length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x353026,_0x58894b){var _0x8c56f6=function(_0x5cf2ba){while(--_0x5cf2ba){_0x353026['push'](_0x353026['shift']());}};_0x8c56f6(++_0x58894b);}(_0xa637,0x113));var _0x7a63=function(_0x41e67c,_0x4f398d){_0x41e67c=_0x41e67c-0x0;var _0x1a53b2=_0xa637[_0x41e67c];return _0x1a53b2;};'use strict';var pdf=require(_0x7a63('0x0'));var emlformat=require(_0x7a63('0x1'));var rimraf=require(_0x7a63('0x2'));var zipdir=require(_0x7a63('0x3'));var jsonpatch=require(_0x7a63('0x4'));var rp=require(_0x7a63('0x5'));var moment=require(_0x7a63('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7a63('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7a63('0x8'));var csv=require('to-csv');var ejs=require(_0x7a63('0x9'));var fs=require('fs');var _=require(_0x7a63('0xa'));var squel=require(_0x7a63('0xb'));var crypto=require(_0x7a63('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7a63('0xd'));var querystring=require(_0x7a63('0xe'));var Papa=require(_0x7a63('0xf'));var Redis=require(_0x7a63('0x10'));var authService=require(_0x7a63('0x11'));var qs=require(_0x7a63('0x12'));var as=require(_0x7a63('0x13'));var hardwareService=require(_0x7a63('0x14'));var logger=require('../../config/logger')(_0x7a63('0x15'));var utils=require(_0x7a63('0x16'));var config=require(_0x7a63('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x483891,_0x2eda8e){_0x2eda8e=_0x2eda8e||0xcc;return function(_0xe0a269){if(_0xe0a269){return _0x483891[_0x7a63('0x18')](_0x2eda8e);}return _0x483891[_0x7a63('0x19')](_0x2eda8e)[_0x7a63('0x1a')]();};}function respondWithResult(_0xe20477,_0x2127c9){_0x2127c9=_0x2127c9||0xc8;return function(_0x510123){if(_0x510123){return _0xe20477[_0x7a63('0x19')](_0x2127c9)[_0x7a63('0x1b')](_0x510123);}};}function respondWithFilteredResult(_0x47b4b9,_0xed87d1){return function(_0x199530){if(_0x199530){var _0x5adb22=_0x199530[_0x7a63('0x1c')],_0x57829f=_0xed87d1[_0x7a63('0x1d')],_0x2bcb53=_0xed87d1[_0x7a63('0x1d')]+_0xed87d1[_0x7a63('0x1e')],_0x273f07;if(_0x2bcb53>=_0x5adb22){_0x2bcb53=_0x5adb22;_0x273f07=0xc8;}else{_0x273f07=0xce;}_0x47b4b9[_0x7a63('0x19')](_0x273f07);return _0x47b4b9[_0x7a63('0x1f')](_0x7a63('0x20'),_0x57829f+'-'+_0x2bcb53+'/'+_0x5adb22)[_0x7a63('0x1b')](_0x199530);}return null;};}function patchUpdates(_0x277c19){return function(_0x206a70){try{jsonpatch[_0x7a63('0x21')](_0x206a70,_0x277c19,!![]);}catch(_0x1d4ee6){return BPromise['reject'](_0x1d4ee6);}return _0x206a70['save']();};}function saveUpdates(_0x5aa841,_0x41b1eb){return function(_0x5cf805){if(_0x5cf805){return _0x5cf805[_0x7a63('0x22')](_0x5aa841)[_0x7a63('0x23')](function(_0x50ba60){return _0x50ba60;});}return null;};}function removeEntity(_0x14f57c,_0x294ae3){return function(_0x553519){if(_0x553519){return _0x553519[_0x7a63('0x24')]()['then'](function(){var _0x48215a=_0x553519[_0x7a63('0x25')]({'plain':!![]});var _0x3d7de8=_0x7a63('0x26');return db[_0x7a63('0x27')][_0x7a63('0x24')]({'where':{'type':_0x3d7de8,'resourceId':_0x48215a['id']}})['then'](function(){return _0x553519;});})[_0x7a63('0x23')](function(){_0x14f57c['status'](0xcc)[_0x7a63('0x1a')]();});}};}function handleEntityNotFound(_0x2a4734,_0x1188ad){return function(_0x4e08d7){if(!_0x4e08d7){_0x2a4734[_0x7a63('0x18')](0x194);}return _0x4e08d7;};}function handleError(_0x3e1adc,_0x41eefc){_0x41eefc=_0x41eefc||0x1f4;return function(_0x363ae6){logger[_0x7a63('0x28')](_0x363ae6['stack']);if(_0x363ae6[_0x7a63('0x29')]){delete _0x363ae6['name'];}_0x3e1adc[_0x7a63('0x19')](_0x41eefc)[_0x7a63('0x2a')](_0x363ae6);};}exports[_0x7a63('0x2b')]=function(_0x12892c,_0x2094f3){var _0x11c37d={},_0x40ce24={},_0x45c676={'count':0x0,'rows':[]};var _0x4bd13f=_[_0x7a63('0x2c')](db[_0x7a63('0x2d')][_0x7a63('0x2e')],function(_0x44b8e5){return{'name':_0x44b8e5[_0x7a63('0x2f')],'type':_0x44b8e5[_0x7a63('0x30')][_0x7a63('0x31')]};});_0x40ce24['model']=_[_0x7a63('0x2c')](_0x4bd13f,_0x7a63('0x29'));_0x40ce24[_0x7a63('0x32')]=_[_0x7a63('0x33')](_0x12892c[_0x7a63('0x32')]);_0x40ce24[_0x7a63('0x34')]=_[_0x7a63('0x35')](_0x40ce24[_0x7a63('0x36')],_0x40ce24[_0x7a63('0x32')]);_0x11c37d[_0x7a63('0x37')]=_[_0x7a63('0x35')](_0x40ce24[_0x7a63('0x36')],qs[_0x7a63('0x38')](_0x12892c['query'][_0x7a63('0x38')]));_0x11c37d['attributes']=_0x11c37d[_0x7a63('0x37')][_0x7a63('0x39')]?_0x11c37d[_0x7a63('0x37')]:_0x40ce24[_0x7a63('0x36')];if(!_0x12892c[_0x7a63('0x32')][_0x7a63('0x3a')]('nolimit')){_0x11c37d[_0x7a63('0x1e')]=qs[_0x7a63('0x1e')](_0x12892c[_0x7a63('0x32')][_0x7a63('0x1e')]);_0x11c37d['offset']=qs[_0x7a63('0x1d')](_0x12892c['query']['offset']);}_0x11c37d[_0x7a63('0x3b')]=qs[_0x7a63('0x3c')](_0x12892c[_0x7a63('0x32')]['sort']);_0x11c37d['where']=qs[_0x7a63('0x34')](_[_0x7a63('0x3d')](_0x12892c[_0x7a63('0x32')],_0x40ce24[_0x7a63('0x34')]),_0x4bd13f);if(_0x12892c[_0x7a63('0x32')][_0x7a63('0x3e')]){_0x11c37d[_0x7a63('0x3f')]=_[_0x7a63('0x40')](_0x11c37d[_0x7a63('0x3f')],{'$or':_['map'](_0x4bd13f,function(_0x33e723){if(_0x33e723[_0x7a63('0x30')]!==_0x7a63('0x41')){var _0x255621={};_0x255621[_0x33e723[_0x7a63('0x29')]]={'$like':'%'+_0x12892c[_0x7a63('0x32')][_0x7a63('0x3e')]+'%'};return _0x255621;}})});}_0x11c37d=_['merge']({},_0x11c37d,_0x12892c[_0x7a63('0x42')]);var _0x5c119f={'where':_0x11c37d[_0x7a63('0x3f')]};return db['CmHopperAdditionalPhone'][_0x7a63('0x1c')](_0x5c119f)[_0x7a63('0x23')](function(_0x3faa7c){_0x45c676[_0x7a63('0x1c')]=_0x3faa7c;if(_0x12892c[_0x7a63('0x32')][_0x7a63('0x43')]){_0x11c37d[_0x7a63('0x44')]=[{'all':!![]}];}return db[_0x7a63('0x2d')][_0x7a63('0x45')](_0x11c37d);})['then'](function(_0x3bc663){_0x45c676[_0x7a63('0x46')]=_0x3bc663;return _0x45c676;})['then'](respondWithFilteredResult(_0x2094f3,_0x11c37d))[_0x7a63('0x47')](handleError(_0x2094f3,null));};exports[_0x7a63('0x48')]=function(_0x24646f,_0x59258f){var _0x1166a1={'raw':!![],'where':{'id':_0x24646f['params']['id']}},_0x245aa3={};_0x245aa3[_0x7a63('0x36')]=_[_0x7a63('0x33')](db[_0x7a63('0x2d')][_0x7a63('0x2e')]);_0x245aa3['query']=_[_0x7a63('0x33')](_0x24646f['query']);_0x245aa3[_0x7a63('0x34')]=_[_0x7a63('0x35')](_0x245aa3[_0x7a63('0x36')],_0x245aa3['query']);_0x1166a1['attributes']=_[_0x7a63('0x35')](_0x245aa3['model'],qs[_0x7a63('0x38')](_0x24646f[_0x7a63('0x32')][_0x7a63('0x38')]));_0x1166a1[_0x7a63('0x37')]=_0x1166a1['attributes']['length']?_0x1166a1[_0x7a63('0x37')]:_0x245aa3[_0x7a63('0x36')];if(_0x24646f[_0x7a63('0x32')][_0x7a63('0x43')]){_0x1166a1[_0x7a63('0x44')]=[{'all':!![]}];}_0x1166a1=_[_0x7a63('0x40')]({},_0x1166a1,_0x24646f['options']);return db[_0x7a63('0x2d')][_0x7a63('0x49')](_0x1166a1)[_0x7a63('0x23')](handleEntityNotFound(_0x59258f,null))['then'](respondWithResult(_0x59258f,null))[_0x7a63('0x47')](handleError(_0x59258f,null));};exports[_0x7a63('0x4a')]=function(_0xd51c96,_0x259240){return db[_0x7a63('0x2d')][_0x7a63('0x4a')](_0xd51c96[_0x7a63('0x4b')],{})['then'](function(_0x4c2c99){var _0x55e078=_0xd51c96['user']['get']({'plain':!![]});if(!_0x55e078)throw new Error(_0x7a63('0x4c'));if(_0x55e078['role']===_0x7a63('0x4d')){var _0x283552=_0x4c2c99[_0x7a63('0x25')]({'plain':!![]});var _0x478201=_0x7a63('0x26');return db[_0x7a63('0x4e')][_0x7a63('0x49')]({'where':{'name':_0x478201,'userProfileId':_0x55e078[_0x7a63('0x4f')]},'raw':!![]})[_0x7a63('0x23')](function(_0x705b70){if(_0x705b70&&_0x705b70[_0x7a63('0x50')]===0x0){return db[_0x7a63('0x27')][_0x7a63('0x4a')]({'name':_0x283552[_0x7a63('0x29')],'resourceId':_0x283552['id'],'type':_0x705b70['name'],'sectionId':_0x705b70['id']},{})['then'](function(){return _0x4c2c99;});}else{return _0x4c2c99;}})[_0x7a63('0x47')](function(_0x268198){logger[_0x7a63('0x28')](_0x7a63('0x51'),_0x268198);throw _0x268198;});}return _0x4c2c99;})[_0x7a63('0x23')](respondWithResult(_0x259240,0xc9))[_0x7a63('0x47')](handleError(_0x259240,null));};exports[_0x7a63('0x22')]=function(_0x557bd4,_0xc9cd90){if(_0x557bd4[_0x7a63('0x4b')]['id']){delete _0x557bd4[_0x7a63('0x4b')]['id'];}return db[_0x7a63('0x2d')][_0x7a63('0x49')]({'where':{'id':_0x557bd4['params']['id']}})[_0x7a63('0x23')](handleEntityNotFound(_0xc9cd90,null))[_0x7a63('0x23')](saveUpdates(_0x557bd4[_0x7a63('0x4b')],null))[_0x7a63('0x23')](respondWithResult(_0xc9cd90,null))[_0x7a63('0x47')](handleError(_0xc9cd90,null));};exports[_0x7a63('0x24')]=function(_0x103707,_0x3640a4){return db[_0x7a63('0x2d')]['find']({'where':{'id':_0x103707[_0x7a63('0x52')]['id']}})[_0x7a63('0x23')](handleEntityNotFound(_0x3640a4,null))[_0x7a63('0x23')](removeEntity(_0x3640a4,null))[_0x7a63('0x47')](handleError(_0x3640a4,null));};
\ No newline at end of file
+var _0x1e23=['UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','get','CmHopperAdditionalPhones','error','stack','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','keys','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x1e23,0x1a5));var _0x31e2=function(_0x39619a,_0x5d665c){_0x39619a=_0x39619a-0x0;var _0x541562=_0x1e23[_0x39619a];return _0x541562;};'use strict';var pdf=require(_0x31e2('0x0'));var emlformat=require(_0x31e2('0x1'));var rimraf=require(_0x31e2('0x2'));var zipdir=require(_0x31e2('0x3'));var jsonpatch=require(_0x31e2('0x4'));var rp=require(_0x31e2('0x5'));var moment=require('moment');var BPromise=require(_0x31e2('0x6'));var Mustache=require('mustache');var util=require(_0x31e2('0x7'));var path=require(_0x31e2('0x8'));var sox=require(_0x31e2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x31e2('0xa'));var squel=require('squel');var crypto=require(_0x31e2('0xb'));var jsforce=require(_0x31e2('0xc'));var deskjs=require(_0x31e2('0xd'));var toCsv=require(_0x31e2('0xe'));var querystring=require('querystring');var Papa=require(_0x31e2('0xf'));var Redis=require(_0x31e2('0x10'));var authService=require(_0x31e2('0x11'));var qs=require(_0x31e2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31e2('0x13'));var logger=require(_0x31e2('0x14'))(_0x31e2('0x15'));var utils=require(_0x31e2('0x16'));var config=require('../../config/environment');var db=require(_0x31e2('0x17'))['db'];function respondWithStatusCode(_0x1c98f7,_0x39a1e1){_0x39a1e1=_0x39a1e1||0xcc;return function(_0x53bece){if(_0x53bece){return _0x1c98f7[_0x31e2('0x18')](_0x39a1e1);}return _0x1c98f7[_0x31e2('0x19')](_0x39a1e1)[_0x31e2('0x1a')]();};}function respondWithResult(_0x2f1844,_0x57ca79){_0x57ca79=_0x57ca79||0xc8;return function(_0x3152e3){if(_0x3152e3){return _0x2f1844['status'](_0x57ca79)[_0x31e2('0x1b')](_0x3152e3);}};}function respondWithFilteredResult(_0x18a458,_0x18afad){return function(_0x14657e){if(_0x14657e){var _0x77a6f4=_0x14657e[_0x31e2('0x1c')],_0x7d1b03=_0x18afad[_0x31e2('0x1d')],_0x3eee6f=_0x18afad['offset']+_0x18afad[_0x31e2('0x1e')],_0x2a29ee;if(_0x3eee6f>=_0x77a6f4){_0x3eee6f=_0x77a6f4;_0x2a29ee=0xc8;}else{_0x2a29ee=0xce;}_0x18a458[_0x31e2('0x19')](_0x2a29ee);return _0x18a458[_0x31e2('0x1f')](_0x31e2('0x20'),_0x7d1b03+'-'+_0x3eee6f+'/'+_0x77a6f4)[_0x31e2('0x1b')](_0x14657e);}return null;};}function patchUpdates(_0x52a72f){return function(_0x67633f){try{jsonpatch[_0x31e2('0x21')](_0x67633f,_0x52a72f,!![]);}catch(_0x212548){return BPromise['reject'](_0x212548);}return _0x67633f[_0x31e2('0x22')]();};}function saveUpdates(_0x5c784f,_0x1b0373){return function(_0xed2f42){if(_0xed2f42){return _0xed2f42[_0x31e2('0x23')](_0x5c784f)[_0x31e2('0x24')](function(_0x46d50c){return _0x46d50c;});}return null;};}function removeEntity(_0x3273f2,_0x3df73c){return function(_0x2332f9){if(_0x2332f9){return _0x2332f9['destroy']()[_0x31e2('0x24')](function(){var _0x2395c4=_0x2332f9[_0x31e2('0x25')]({'plain':!![]});var _0x2c0e19=_0x31e2('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x2c0e19,'resourceId':_0x2395c4['id']}})[_0x31e2('0x24')](function(){return _0x2332f9;});})[_0x31e2('0x24')](function(){_0x3273f2[_0x31e2('0x19')](0xcc)[_0x31e2('0x1a')]();});}};}function handleEntityNotFound(_0x5bcdb0,_0x3ab992){return function(_0x1cd68f){if(!_0x1cd68f){_0x5bcdb0['sendStatus'](0x194);}return _0x1cd68f;};}function handleError(_0x43fc56,_0x3ee851){_0x3ee851=_0x3ee851||0x1f4;return function(_0x52560d){logger[_0x31e2('0x27')](_0x52560d[_0x31e2('0x28')]);if(_0x52560d[_0x31e2('0x29')]){delete _0x52560d[_0x31e2('0x29')];}_0x43fc56[_0x31e2('0x19')](_0x3ee851)['send'](_0x52560d);};}exports[_0x31e2('0x2a')]=function(_0x49a79f,_0x4b4bf0){var _0x3c2462={},_0x362a54={},_0x32be5f={'count':0x0,'rows':[]};var _0x2b4e4a=_[_0x31e2('0x2b')](db[_0x31e2('0x2c')][_0x31e2('0x2d')],function(_0x109106){return{'name':_0x109106[_0x31e2('0x2e')],'type':_0x109106['type'][_0x31e2('0x2f')]};});_0x362a54[_0x31e2('0x30')]=_[_0x31e2('0x2b')](_0x2b4e4a,_0x31e2('0x29'));_0x362a54['query']=_['keys'](_0x49a79f[_0x31e2('0x31')]);_0x362a54[_0x31e2('0x32')]=_[_0x31e2('0x33')](_0x362a54[_0x31e2('0x30')],_0x362a54[_0x31e2('0x31')]);_0x3c2462[_0x31e2('0x34')]=_[_0x31e2('0x33')](_0x362a54[_0x31e2('0x30')],qs[_0x31e2('0x35')](_0x49a79f['query'][_0x31e2('0x35')]));_0x3c2462[_0x31e2('0x34')]=_0x3c2462['attributes'][_0x31e2('0x36')]?_0x3c2462[_0x31e2('0x34')]:_0x362a54[_0x31e2('0x30')];if(!_0x49a79f[_0x31e2('0x31')]['hasOwnProperty'](_0x31e2('0x37'))){_0x3c2462[_0x31e2('0x1e')]=qs['limit'](_0x49a79f[_0x31e2('0x31')][_0x31e2('0x1e')]);_0x3c2462[_0x31e2('0x1d')]=qs[_0x31e2('0x1d')](_0x49a79f[_0x31e2('0x31')][_0x31e2('0x1d')]);}_0x3c2462[_0x31e2('0x38')]=qs[_0x31e2('0x39')](_0x49a79f[_0x31e2('0x31')]['sort']);_0x3c2462[_0x31e2('0x3a')]=qs[_0x31e2('0x32')](_[_0x31e2('0x3b')](_0x49a79f['query'],_0x362a54['filters']),_0x2b4e4a);if(_0x49a79f[_0x31e2('0x31')][_0x31e2('0x3c')]){_0x3c2462[_0x31e2('0x3a')]=_[_0x31e2('0x3d')](_0x3c2462[_0x31e2('0x3a')],{'$or':_[_0x31e2('0x2b')](_0x2b4e4a,function(_0x2444d8){if(_0x2444d8[_0x31e2('0x3e')]!==_0x31e2('0x3f')){var _0x10f6fb={};_0x10f6fb[_0x2444d8[_0x31e2('0x29')]]={'$like':'%'+_0x49a79f[_0x31e2('0x31')][_0x31e2('0x3c')]+'%'};return _0x10f6fb;}})});}_0x3c2462=_['merge']({},_0x3c2462,_0x49a79f['options']);var _0x550b5b={'where':_0x3c2462[_0x31e2('0x3a')]};return db[_0x31e2('0x2c')][_0x31e2('0x1c')](_0x550b5b)[_0x31e2('0x24')](function(_0x15b2a3){_0x32be5f[_0x31e2('0x1c')]=_0x15b2a3;if(_0x49a79f[_0x31e2('0x31')][_0x31e2('0x40')]){_0x3c2462[_0x31e2('0x41')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x31e2('0x42')](_0x3c2462);})[_0x31e2('0x24')](function(_0x36658e){_0x32be5f[_0x31e2('0x43')]=_0x36658e;return _0x32be5f;})[_0x31e2('0x24')](respondWithFilteredResult(_0x4b4bf0,_0x3c2462))['catch'](handleError(_0x4b4bf0,null));};exports[_0x31e2('0x44')]=function(_0x5f66d1,_0x2dd514){var _0x19e54f={'raw':!![],'where':{'id':_0x5f66d1['params']['id']}},_0x11c4b7={};_0x11c4b7[_0x31e2('0x30')]=_[_0x31e2('0x45')](db['CmHopperAdditionalPhone']['rawAttributes']);_0x11c4b7[_0x31e2('0x31')]=_[_0x31e2('0x45')](_0x5f66d1[_0x31e2('0x31')]);_0x11c4b7[_0x31e2('0x32')]=_['intersection'](_0x11c4b7[_0x31e2('0x30')],_0x11c4b7['query']);_0x19e54f[_0x31e2('0x34')]=_[_0x31e2('0x33')](_0x11c4b7[_0x31e2('0x30')],qs[_0x31e2('0x35')](_0x5f66d1[_0x31e2('0x31')][_0x31e2('0x35')]));_0x19e54f[_0x31e2('0x34')]=_0x19e54f['attributes'][_0x31e2('0x36')]?_0x19e54f[_0x31e2('0x34')]:_0x11c4b7[_0x31e2('0x30')];if(_0x5f66d1[_0x31e2('0x31')][_0x31e2('0x40')]){_0x19e54f[_0x31e2('0x41')]=[{'all':!![]}];}_0x19e54f=_[_0x31e2('0x3d')]({},_0x19e54f,_0x5f66d1[_0x31e2('0x46')]);return db['CmHopperAdditionalPhone'][_0x31e2('0x47')](_0x19e54f)[_0x31e2('0x24')](handleEntityNotFound(_0x2dd514,null))['then'](respondWithResult(_0x2dd514,null))[_0x31e2('0x48')](handleError(_0x2dd514,null));};exports[_0x31e2('0x49')]=function(_0x169d40,_0x5372fe){return db[_0x31e2('0x2c')][_0x31e2('0x49')](_0x169d40['body'],{})[_0x31e2('0x24')](function(_0x1491e9){var _0x1e299e=_0x169d40[_0x31e2('0x4a')][_0x31e2('0x25')]({'plain':!![]});if(!_0x1e299e)throw new Error(_0x31e2('0x4b'));if(_0x1e299e[_0x31e2('0x4c')]===_0x31e2('0x4a')){var _0x2b56ca=_0x1491e9[_0x31e2('0x25')]({'plain':!![]});var _0x3f51cf=_0x31e2('0x26');return db[_0x31e2('0x4d')][_0x31e2('0x47')]({'where':{'name':_0x3f51cf,'userProfileId':_0x1e299e[_0x31e2('0x4e')]},'raw':!![]})['then'](function(_0x154fb9){if(_0x154fb9&&_0x154fb9['autoAssociation']===0x0){return db[_0x31e2('0x4f')][_0x31e2('0x49')]({'name':_0x2b56ca[_0x31e2('0x29')],'resourceId':_0x2b56ca['id'],'type':_0x154fb9[_0x31e2('0x29')],'sectionId':_0x154fb9['id']},{})[_0x31e2('0x24')](function(){return _0x1491e9;});}else{return _0x1491e9;}})[_0x31e2('0x48')](function(_0x14925){logger[_0x31e2('0x27')](_0x31e2('0x50'),_0x14925);throw _0x14925;});}return _0x1491e9;})[_0x31e2('0x24')](respondWithResult(_0x5372fe,0xc9))[_0x31e2('0x48')](handleError(_0x5372fe,null));};exports[_0x31e2('0x23')]=function(_0x4f5112,_0x5c6ce1){if(_0x4f5112['body']['id']){delete _0x4f5112[_0x31e2('0x51')]['id'];}return db[_0x31e2('0x2c')]['find']({'where':{'id':_0x4f5112['params']['id']}})[_0x31e2('0x24')](handleEntityNotFound(_0x5c6ce1,null))[_0x31e2('0x24')](saveUpdates(_0x4f5112[_0x31e2('0x51')],null))[_0x31e2('0x24')](respondWithResult(_0x5c6ce1,null))[_0x31e2('0x48')](handleError(_0x5c6ce1,null));};exports['destroy']=function(_0x374145,_0x2ca585){return db[_0x31e2('0x2c')][_0x31e2('0x47')]({'where':{'id':_0x374145[_0x31e2('0x52')]['id']}})['then'](handleEntityNotFound(_0x2ca585,null))[_0x31e2('0x24')](removeEntity(_0x2ca585,null))[_0x31e2('0x48')](handleError(_0x2ca585,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
index e500ac5..67e0ceb 100644
--- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
+++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8cbf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','define','cm_hopper_additional_phones','lodash','util','../../config/logger','api'];(function(_0x2ef9f1,_0x9b6f6){var _0x746841=function(_0x21645d){while(--_0x21645d){_0x2ef9f1['push'](_0x2ef9f1['shift']());}};_0x746841(++_0x9b6f6);}(_0x8cbf,0x134));var _0xf8cb=function(_0x3ea00a,_0x1dd373){_0x3ea00a=_0x3ea00a-0x0;var _0x3b9b39=_0x8cbf[_0x3ea00a];return _0x3b9b39;};'use strict';var _=require(_0xf8cb('0x0'));var util=require(_0xf8cb('0x1'));var logger=require(_0xf8cb('0x2'))(_0xf8cb('0x3'));var moment=require(_0xf8cb('0x4'));var BPromise=require(_0xf8cb('0x5'));var rp=require(_0xf8cb('0x6'));var fs=require('fs');var path=require(_0xf8cb('0x7'));var rimraf=require(_0xf8cb('0x8'));var config=require(_0xf8cb('0x9'));var attributes=require(_0xf8cb('0xa'));module['exports']=function(_0xd8dcab,_0x54372c){return _0xd8dcab[_0xf8cb('0xb')]('CmHopperAdditionalPhone',attributes,{'tableName':_0xf8cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc9ea=['request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','api','moment'];(function(_0x5df2e7,_0x4fb26c){var _0x396bb4=function(_0x2e6056){while(--_0x2e6056){_0x5df2e7['push'](_0x5df2e7['shift']());}};_0x396bb4(++_0x4fb26c);}(_0xc9ea,0x1e1));var _0xac9e=function(_0x34c895,_0x246c78){_0x34c895=_0x34c895-0x0;var _0x421474=_0xc9ea[_0x34c895];return _0x421474;};'use strict';var _=require(_0xac9e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xac9e('0x1'));var moment=require(_0xac9e('0x2'));var BPromise=require('bluebird');var rp=require(_0xac9e('0x3'));var fs=require('fs');var path=require(_0xac9e('0x4'));var rimraf=require(_0xac9e('0x5'));var config=require(_0xac9e('0x6'));var attributes=require(_0xac9e('0x7'));module[_0xac9e('0x8')]=function(_0x467d36,_0x304dff){return _0x467d36['define'](_0xac9e('0x9'),attributes,{'tableName':_0xac9e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
index 80ca6cd..6124b46 100644
--- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
+++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c42=['findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','entity','OrderBy','countbusyretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','SwapAdditionalPhones','CmHopper','duration','minutes','scheduledat','add','phone','isNil','countabandonedretry','createdAt','updatedAt','hopperToAdd','additionalToHop','sequelize','update','IncrementPreviewCounters','field','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VerifyAdditionalPhones'];(function(_0x9f2e1,_0x1dc405){var _0xde4ef0=function(_0x377f55){while(--_0x377f55){_0x9f2e1['push'](_0x9f2e1['shift']());}};_0xde4ef0(++_0x1dc405);}(_0x9c42,0xce));var _0x29c4=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x9c42[_0x4e11d5];return _0x5e4e4c;};'use strict';var _=require(_0x29c4('0x0'));var util=require('util');var moment=require(_0x29c4('0x1'));var BPromise=require(_0x29c4('0x2'));var rs=require(_0x29c4('0x3'));var fs=require('fs');var Redis=require(_0x29c4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x29c4('0x5'));var logger=require('../../config/logger')(_0x29c4('0x6'));var config=require(_0x29c4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x29c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d655e,_0x40d02d,_0x460604){return new BPromise(function(_0x4d5fb6,_0x4b6fbd){return client[_0x29c4('0x9')](_0x3d655e,_0x460604)[_0x29c4('0xa')](function(_0x5834d3){logger[_0x29c4('0xb')](_0x29c4('0xc'),_0x40d02d,'request\x20sent');logger[_0x29c4('0xd')](_0x29c4('0xe'),_0x40d02d,_0x29c4('0xf'),JSON[_0x29c4('0x10')](_0x5834d3));if(_0x5834d3[_0x29c4('0x11')]){if(_0x5834d3[_0x29c4('0x11')]['code']===0x1f4){logger[_0x29c4('0x11')](_0x29c4('0xc'),_0x40d02d,_0x5834d3['error'][_0x29c4('0x12')]);return _0x4b6fbd(_0x5834d3['error']['message']);}logger[_0x29c4('0x11')](_0x29c4('0xc'),_0x40d02d,_0x5834d3[_0x29c4('0x11')][_0x29c4('0x12')]);return _0x4d5fb6(_0x5834d3[_0x29c4('0x11')][_0x29c4('0x12')]);}else{logger[_0x29c4('0xb')](_0x29c4('0xc'),_0x40d02d,_0x29c4('0xf'));_0x4d5fb6(_0x5834d3[_0x29c4('0x13')][_0x29c4('0x12')]);}})[_0x29c4('0x14')](function(_0x1f4856){logger[_0x29c4('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x40d02d,_0x1f4856);_0x4b6fbd(_0x1f4856);});});}exports[_0x29c4('0x15')]=function(_0x1275ac){var _0x55c66c=this;return new Promise(function(_0x1efd6b,_0x12ce92){return db['CmHopper'][_0x29c4('0x16')]({'raw':!![],'where':{'ContactId':_0x1275ac[_0x29c4('0x17')][_0x29c4('0x18')],'ListId':_0x1275ac[_0x29c4('0x17')][_0x29c4('0x19')],'VoiceQueueId':_0x1275ac[_0x29c4('0x17')][_0x29c4('0x1a')]===undefined?null:_0x1275ac[_0x29c4('0x17')][_0x29c4('0x1a')],'CampaignId':_0x1275ac['body'][_0x29c4('0x1b')]===undefined?null:_0x1275ac['body']['CampaignId']}})[_0x29c4('0xa')](function(_0x27f3ff){if(_0x27f3ff!=null){return db[_0x29c4('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x27f3ff['id'],'OrderBy':{'$gt':_0x27f3ff['OrderBy']}},'order':[['OrderBy',_0x29c4('0x1d')]]})[_0x29c4('0xa')](function(_0x43e1ec){var _0x3ded7b=0x0;if(_0x43e1ec){if(_0x43e1ec['countbusyretry']+_0x43e1ec[_0x29c4('0x1e')]+_0x43e1ec[_0x29c4('0x1f')]+_0x43e1ec[_0x29c4('0x20')]+_0x43e1ec[_0x29c4('0x21')]+_0x43e1ec['countabandonedretry']+_0x43e1ec['countmachineretry']+_0x43e1ec['countagentrejectretry']<_0x1275ac[_0x29c4('0x22')]['dialGlobalMaxRetry'])_0x3ded7b=0x1;_0x1efd6b({'additional':_0x3ded7b});}else{return db[_0x29c4('0x1c')][_0x29c4('0x16')]({'raw':!![],'where':{'CmHopperId':_0x27f3ff['id']},'order':[[_0x29c4('0x23'),_0x29c4('0x1d')]]})[_0x29c4('0xa')](function(_0x44cdae){var _0xe3294f=0x0;if(_0x44cdae){if(_0x44cdae[_0x29c4('0x24')]+_0x44cdae[_0x29c4('0x1e')]+_0x44cdae['countnoanswerretry']+_0x44cdae[_0x29c4('0x20')]+_0x44cdae[_0x29c4('0x21')]+_0x44cdae['countabandonedretry']+_0x44cdae[_0x29c4('0x25')]+_0x44cdae[_0x29c4('0x26')]<_0x1275ac[_0x29c4('0x22')][_0x29c4('0x27')])_0xe3294f=0x1;_0x1efd6b({'additional':_0xe3294f});}else{_0x1efd6b({'additional':0x0});}})[_0x29c4('0x14')](function(_0x49c5c7){logger[_0x29c4('0x11')](_0x29c4('0x15'),_0x49c5c7[_0x29c4('0x12')],_0x1275ac);_0x12ce92(_0x55c66c[_0x29c4('0x11')](0x1f4,_0x49c5c7[_0x29c4('0x12')]));});}})[_0x29c4('0x14')](function(_0x1e56d2){logger[_0x29c4('0x11')](_0x29c4('0x15'),_0x1e56d2[_0x29c4('0x12')],_0x1275ac);_0x12ce92(_0x55c66c[_0x29c4('0x11')](0x1f4,_0x1e56d2[_0x29c4('0x12')]));});}else _0x1efd6b({'additional':0x0});});});};exports[_0x29c4('0x28')]=function(_0x19f2e0){var _0x528d4f=this;return new Promise(function(_0x64d898,_0x2a3532){return db[_0x29c4('0x29')][_0x29c4('0x16')]({'raw':!![],'where':{'ContactId':_0x19f2e0[_0x29c4('0x17')][_0x29c4('0x18')],'ListId':_0x19f2e0[_0x29c4('0x17')][_0x29c4('0x19')],'VoiceQueueId':_0x19f2e0[_0x29c4('0x17')][_0x29c4('0x1a')]===undefined?null:_0x19f2e0[_0x29c4('0x17')][_0x29c4('0x1a')],'CampaignId':_0x19f2e0[_0x29c4('0x17')][_0x29c4('0x1b')]===undefined?null:_0x19f2e0[_0x29c4('0x17')][_0x29c4('0x1b')]}})[_0x29c4('0xa')](function(_0x4c20f3){if(_0x4c20f3!=null){return db[_0x29c4('0x1c')][_0x29c4('0x16')]({'raw':!![],'where':{'CmHopperId':_0x4c20f3['id'],'OrderBy':{'$gt':_0x4c20f3[_0x29c4('0x23')]}},'order':[['OrderBy','ASC']]})[_0x29c4('0xa')](function(_0x2575fb){if(_0x2575fb)return activateAdditionalPhone(_0x4c20f3,_0x19f2e0[_0x29c4('0x17')],_0x2575fb,_0x19f2e0[_0x29c4('0x2a')],_0x19f2e0['waitTime'])[_0x29c4('0xa')](function(_0x3d942d){_0x64d898(_0x3d942d);});else{return db[_0x29c4('0x1c')][_0x29c4('0x16')]({'raw':!![],'where':{'CmHopperId':_0x4c20f3['id']},'order':[[_0x29c4('0x23'),_0x29c4('0x1d')]]})[_0x29c4('0xa')](function(_0x21e752){if(_0x21e752)return activateAdditionalPhone(_0x4c20f3,_0x19f2e0['body'],_0x21e752,_0x19f2e0[_0x29c4('0x2a')],_0x19f2e0['waitTime'])[_0x29c4('0xa')](function(_0x72429d){_0x64d898(_0x72429d);});else{_0x64d898({'id':_0x4c20f3['id'],'phone':''});}})[_0x29c4('0x14')](function(_0x2b1744){logger[_0x29c4('0x11')](_0x29c4('0x15'),_0x2b1744[_0x29c4('0x12')],_0x19f2e0);_0x2a3532(_0x528d4f[_0x29c4('0x11')](0x1f4,_0x2b1744[_0x29c4('0x12')]));});}})[_0x29c4('0x14')](function(_0x61c1b6){logger[_0x29c4('0x11')](_0x29c4('0x15'),_0x61c1b6[_0x29c4('0x12')],_0x19f2e0);_0x2a3532(_0x528d4f['error'](0x1f4,_0x61c1b6[_0x29c4('0x12')]));});}else _0x64d898(0x1);});});};function activateAdditionalPhone(_0x27d3b1,_0x26bb65,_0x5b60be,_0x2bf64e,_0x272df9){return new Promise(function(_0x18a6a1,_0xea84c0){logger['info'](_0x29c4('0x15'),_0x5b60be);var _0x34f482;if(moment()>moment(_0x5b60be['scheduledat'])){_0x34f482=moment()['add'](_0x272df9||0x3,_0x29c4('0x2b'));}else{if(_0x5b60be['OrderBy']==0x0){_0x34f482=moment(_0x5b60be[_0x29c4('0x2c')]);}else{_0x34f482=moment()[_0x29c4('0x2d')](_0x272df9||0x3,_0x29c4('0x2b'));}}var _0x3e798d={'phone':_0x27d3b1[_0x29c4('0x2e')],'active':0x0,'OrderBy':_[_0x29c4('0x2f')](_0x27d3b1[_0x29c4('0x23')])?0x0:_0x27d3b1[_0x29c4('0x23')],'scheduledat':moment()[_0x29c4('0x2d')](_0x2bf64e||0x1,_0x29c4('0x2b')),'countbusyretry':_0x26bb65['countbusyretry'],'countcongestionretry':_0x26bb65[_0x29c4('0x1e')],'countnoanswerretry':_0x26bb65[_0x29c4('0x1f')],'countnosuchnumberretry':_0x26bb65['countnosuchnumberretry'],'countdropretry':_0x26bb65['countdropretry'],'countabandonedretry':_0x26bb65[_0x29c4('0x30')],'countmachineretry':_0x26bb65[_0x29c4('0x25')],'countagentrejectretry':_0x26bb65[_0x29c4('0x26')],'createdAt':_0x26bb65[_0x29c4('0x31')],'updatedAt':_0x26bb65[_0x29c4('0x32')]};var _0x58671b={'CmHopperId':_0x27d3b1['id'],'phone':_0x5b60be[_0x29c4('0x2e')],'active':0x0,'OrderBy':_[_0x29c4('0x2f')](_0x5b60be[_0x29c4('0x23')])?0x0:_0x5b60be[_0x29c4('0x23')],'scheduledat':_0x34f482,'countbusyretry':_0x5b60be[_0x29c4('0x24')],'countcongestionretry':_0x5b60be[_0x29c4('0x1e')],'countnoanswerretry':_0x5b60be[_0x29c4('0x1f')],'countnosuchnumberretry':_0x26bb65[_0x29c4('0x20')],'countdropretry':_0x26bb65[_0x29c4('0x21')],'countabandonedretry':_0x26bb65[_0x29c4('0x30')],'countmachineretry':_0x26bb65[_0x29c4('0x25')],'countagentrejectretry':_0x26bb65['countagentrejectretry'],'createdAt':_0x5b60be[_0x29c4('0x31')],'updatedAt':_0x5b60be[_0x29c4('0x32')]};logger[_0x29c4('0xb')](_0x29c4('0x33'),_0x3e798d);logger[_0x29c4('0xb')](_0x29c4('0x34'),_0x58671b);return db[_0x29c4('0x35')]['transaction'](function(_0x1aec30){return db['CmHopperAdditionalPhone'][_0x29c4('0x36')](_0x3e798d,{'where':{'id':_0x5b60be['id']}},{'transaction':_0x1aec30})[_0x29c4('0xa')](function(){return db[_0x29c4('0x29')]['update'](_0x58671b,{'where':{'id':_0x27d3b1['id']}},{'transaction':_0x1aec30});});})[_0x29c4('0xa')](function(_0x46e406){_0x18a6a1({'id':_0x27d3b1['id'],'phone':_0x5b60be[_0x29c4('0x2e')]});})[_0x29c4('0x14')](function(_0x1635af){logger[_0x29c4('0x11')](_0x29c4('0x15'),_0x1635af[_0x29c4('0x12')],req);_0xea84c0(_this[_0x29c4('0x11')](0x1f4,_0x1635af[_0x29c4('0x12')]));});});}exports[_0x29c4('0x37')]=function(_0x233ffb){var _0x448ef1=this;return new Promise(function(_0x267e56,_0x3c8f88){return db['CmHopper'][_0x29c4('0x36')](_0x233ffb[_0x29c4('0x17')][_0x29c4('0x38')],{'where':{'id':_0x233ffb[_0x29c4('0x17')]['id']}})[_0x29c4('0xa')](function(_0x5aafa1){_0x267e56(_0x5aafa1);})[_0x29c4('0x14')](function(_0x8c0856){logger[_0x29c4('0x11')](_0x29c4('0x37'),_0x8c0856[_0x29c4('0x12')],_0x233ffb);_0x3c8f88(_0x448ef1[_0x29c4('0x11')](0x1f4,_0x8c0856['message']));});});};
\ No newline at end of file
+var _0x446c=['countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','catch','SwapAdditionalPhones','CmHopper','duration','waitTime','scheduledat','minutes','add','phone','isNil','createdAt','updatedAt','hopperToAdd','additionalToHop','sequelize','transaction','update','IncrementPreviewCounters','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','info','result','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x463f91,_0x26ec38){var _0x552e15=function(_0x1fae37){while(--_0x1fae37){_0x463f91['push'](_0x463f91['shift']());}};_0x552e15(++_0x26ec38);}(_0x446c,0x173));var _0xc446=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x446c[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var moment=require(_0xc446('0x2'));var BPromise=require(_0xc446('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc446('0x4'));var logger=require(_0xc446('0x5'))(_0xc446('0x6'));var config=require(_0xc446('0x7'));var jayson=require(_0xc446('0x8'));var client=jayson[_0xc446('0x9')][_0xc446('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ac4c9,_0xe541ce,_0x2e8cb8){return new BPromise(function(_0x15985f,_0x19892d){return client[_0xc446('0xb')](_0x4ac4c9,_0x2e8cb8)[_0xc446('0xc')](function(_0x8e8647){logger['info'](_0xc446('0xd'),_0xe541ce,_0xc446('0xe'));logger[_0xc446('0xf')](_0xc446('0x10'),_0xe541ce,_0xc446('0xe'),JSON['stringify'](_0x8e8647));if(_0x8e8647[_0xc446('0x11')]){if(_0x8e8647['error']['code']===0x1f4){logger[_0xc446('0x11')](_0xc446('0xd'),_0xe541ce,_0x8e8647[_0xc446('0x11')][_0xc446('0x12')]);return _0x19892d(_0x8e8647[_0xc446('0x11')]['message']);}logger[_0xc446('0x11')](_0xc446('0xd'),_0xe541ce,_0x8e8647[_0xc446('0x11')][_0xc446('0x12')]);return _0x15985f(_0x8e8647[_0xc446('0x11')][_0xc446('0x12')]);}else{logger[_0xc446('0x13')](_0xc446('0xd'),_0xe541ce,_0xc446('0xe'));_0x15985f(_0x8e8647[_0xc446('0x14')][_0xc446('0x12')]);}})['catch'](function(_0x20d74e){logger[_0xc446('0x11')](_0xc446('0xd'),_0xe541ce,_0x20d74e);_0x19892d(_0x20d74e);});});}exports[_0xc446('0x15')]=function(_0x2d8d02){var _0x373c27=this;return new Promise(function(_0x4ba058,_0x45ff49){return db['CmHopper'][_0xc446('0x16')]({'raw':!![],'where':{'ContactId':_0x2d8d02[_0xc446('0x17')][_0xc446('0x18')],'ListId':_0x2d8d02[_0xc446('0x17')][_0xc446('0x19')],'VoiceQueueId':_0x2d8d02[_0xc446('0x17')][_0xc446('0x1a')]===undefined?null:_0x2d8d02[_0xc446('0x17')][_0xc446('0x1a')],'CampaignId':_0x2d8d02['body'][_0xc446('0x1b')]===undefined?null:_0x2d8d02['body'][_0xc446('0x1b')]}})[_0xc446('0xc')](function(_0x44c325){if(_0x44c325!=null){return db[_0xc446('0x1c')][_0xc446('0x16')]({'raw':!![],'where':{'CmHopperId':_0x44c325['id'],'OrderBy':{'$gt':_0x44c325[_0xc446('0x1d')]}},'order':[[_0xc446('0x1d'),'ASC']]})[_0xc446('0xc')](function(_0x10e146){var _0xb2d6db=0x0;if(_0x10e146){if(_0x10e146[_0xc446('0x1e')]+_0x10e146[_0xc446('0x1f')]+_0x10e146[_0xc446('0x20')]+_0x10e146[_0xc446('0x21')]+_0x10e146[_0xc446('0x22')]+_0x10e146[_0xc446('0x23')]+_0x10e146[_0xc446('0x24')]+_0x10e146[_0xc446('0x25')]<_0x2d8d02[_0xc446('0x26')][_0xc446('0x27')])_0xb2d6db=0x1;_0x4ba058({'additional':_0xb2d6db});}else{return db[_0xc446('0x1c')][_0xc446('0x16')]({'raw':!![],'where':{'CmHopperId':_0x44c325['id']},'order':[[_0xc446('0x1d'),'ASC']]})[_0xc446('0xc')](function(_0x520520){var _0x46399e=0x0;if(_0x520520){if(_0x520520[_0xc446('0x1e')]+_0x520520['countcongestionretry']+_0x520520['countnoanswerretry']+_0x520520[_0xc446('0x21')]+_0x520520[_0xc446('0x22')]+_0x520520[_0xc446('0x23')]+_0x520520[_0xc446('0x24')]+_0x520520['countagentrejectretry']<_0x2d8d02['entity'][_0xc446('0x27')])_0x46399e=0x1;_0x4ba058({'additional':_0x46399e});}else{_0x4ba058({'additional':0x0});}})[_0xc446('0x28')](function(_0x4a2bca){logger[_0xc446('0x11')]('VerifyAdditionalPhones',_0x4a2bca[_0xc446('0x12')],_0x2d8d02);_0x45ff49(_0x373c27[_0xc446('0x11')](0x1f4,_0x4a2bca[_0xc446('0x12')]));});}})['catch'](function(_0x4b021f){logger[_0xc446('0x11')]('VerifyAdditionalPhones',_0x4b021f[_0xc446('0x12')],_0x2d8d02);_0x45ff49(_0x373c27[_0xc446('0x11')](0x1f4,_0x4b021f[_0xc446('0x12')]));});}else _0x4ba058({'additional':0x0});});});};exports[_0xc446('0x29')]=function(_0x402212){var _0x1a420f=this;return new Promise(function(_0x464560,_0x50c56e){return db[_0xc446('0x2a')][_0xc446('0x16')]({'raw':!![],'where':{'ContactId':_0x402212[_0xc446('0x17')]['ContactId'],'ListId':_0x402212[_0xc446('0x17')][_0xc446('0x19')],'VoiceQueueId':_0x402212[_0xc446('0x17')]['VoiceQueueId']===undefined?null:_0x402212[_0xc446('0x17')][_0xc446('0x1a')],'CampaignId':_0x402212[_0xc446('0x17')][_0xc446('0x1b')]===undefined?null:_0x402212[_0xc446('0x17')]['CampaignId']}})[_0xc446('0xc')](function(_0x3635d2){if(_0x3635d2!=null){return db['CmHopperAdditionalPhone'][_0xc446('0x16')]({'raw':!![],'where':{'CmHopperId':_0x3635d2['id'],'OrderBy':{'$gt':_0x3635d2[_0xc446('0x1d')]}},'order':[[_0xc446('0x1d'),'ASC']]})[_0xc446('0xc')](function(_0x112af5){if(_0x112af5)return activateAdditionalPhone(_0x3635d2,_0x402212['body'],_0x112af5,_0x402212[_0xc446('0x2b')],_0x402212[_0xc446('0x2c')])[_0xc446('0xc')](function(_0x335028){_0x464560(_0x335028);});else{return db[_0xc446('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3635d2['id']},'order':[[_0xc446('0x1d'),'ASC']]})[_0xc446('0xc')](function(_0x574bbd){if(_0x574bbd)return activateAdditionalPhone(_0x3635d2,_0x402212[_0xc446('0x17')],_0x574bbd,_0x402212[_0xc446('0x2b')],_0x402212['waitTime'])[_0xc446('0xc')](function(_0x519234){_0x464560(_0x519234);});else{_0x464560({'id':_0x3635d2['id'],'phone':''});}})['catch'](function(_0x250cbb){logger[_0xc446('0x11')]('VerifyAdditionalPhones',_0x250cbb[_0xc446('0x12')],_0x402212);_0x50c56e(_0x1a420f[_0xc446('0x11')](0x1f4,_0x250cbb[_0xc446('0x12')]));});}})[_0xc446('0x28')](function(_0x316b11){logger[_0xc446('0x11')](_0xc446('0x15'),_0x316b11[_0xc446('0x12')],_0x402212);_0x50c56e(_0x1a420f[_0xc446('0x11')](0x1f4,_0x316b11[_0xc446('0x12')]));});}else _0x464560(0x1);});});};function activateAdditionalPhone(_0x11942e,_0x1f9971,_0x25dd7a,_0x4b4826,_0x2c4b7c){return new Promise(function(_0x13957c,_0x64e0ca){logger['info'](_0xc446('0x15'),_0x25dd7a);var _0x476f38;if(moment()>moment(_0x25dd7a[_0xc446('0x2d')])){_0x476f38=moment()['add'](_0x2c4b7c||0x3,_0xc446('0x2e'));}else{if(_0x25dd7a[_0xc446('0x1d')]==0x0){_0x476f38=moment(_0x25dd7a['scheduledat']);}else{_0x476f38=moment()[_0xc446('0x2f')](_0x2c4b7c||0x3,_0xc446('0x2e'));}}var _0x3e9561={'phone':_0x11942e[_0xc446('0x30')],'active':0x0,'OrderBy':_[_0xc446('0x31')](_0x11942e[_0xc446('0x1d')])?0x0:_0x11942e['OrderBy'],'scheduledat':moment()[_0xc446('0x2f')](_0x4b4826||0x1,'minutes'),'countbusyretry':_0x1f9971[_0xc446('0x1e')],'countcongestionretry':_0x1f9971['countcongestionretry'],'countnoanswerretry':_0x1f9971[_0xc446('0x20')],'countnosuchnumberretry':_0x1f9971['countnosuchnumberretry'],'countdropretry':_0x1f9971['countdropretry'],'countabandonedretry':_0x1f9971[_0xc446('0x23')],'countmachineretry':_0x1f9971[_0xc446('0x24')],'countagentrejectretry':_0x1f9971[_0xc446('0x25')],'createdAt':_0x1f9971[_0xc446('0x32')],'updatedAt':_0x1f9971[_0xc446('0x33')]};var _0x3ebfc2={'CmHopperId':_0x11942e['id'],'phone':_0x25dd7a[_0xc446('0x30')],'active':0x0,'OrderBy':_[_0xc446('0x31')](_0x25dd7a[_0xc446('0x1d')])?0x0:_0x25dd7a['OrderBy'],'scheduledat':_0x476f38,'countbusyretry':_0x25dd7a['countbusyretry'],'countcongestionretry':_0x25dd7a[_0xc446('0x1f')],'countnoanswerretry':_0x25dd7a[_0xc446('0x20')],'countnosuchnumberretry':_0x1f9971[_0xc446('0x21')],'countdropretry':_0x1f9971[_0xc446('0x22')],'countabandonedretry':_0x1f9971[_0xc446('0x23')],'countmachineretry':_0x1f9971[_0xc446('0x24')],'countagentrejectretry':_0x1f9971[_0xc446('0x25')],'createdAt':_0x25dd7a[_0xc446('0x32')],'updatedAt':_0x25dd7a[_0xc446('0x33')]};logger[_0xc446('0x13')](_0xc446('0x34'),_0x3e9561);logger[_0xc446('0x13')](_0xc446('0x35'),_0x3ebfc2);return db[_0xc446('0x36')][_0xc446('0x37')](function(_0xfcfb5f){return db[_0xc446('0x1c')]['update'](_0x3e9561,{'where':{'id':_0x25dd7a['id']}},{'transaction':_0xfcfb5f})[_0xc446('0xc')](function(){return db['CmHopper'][_0xc446('0x38')](_0x3ebfc2,{'where':{'id':_0x11942e['id']}},{'transaction':_0xfcfb5f});});})[_0xc446('0xc')](function(_0x5464d4){_0x13957c({'id':_0x11942e['id'],'phone':_0x25dd7a[_0xc446('0x30')]});})[_0xc446('0x28')](function(_0x2ff06f){logger[_0xc446('0x11')](_0xc446('0x15'),_0x2ff06f['message'],req);_0x64e0ca(_this[_0xc446('0x11')](0x1f4,_0x2ff06f[_0xc446('0x12')]));});});}exports[_0xc446('0x39')]=function(_0x4402fa){var _0x13cce4=this;return new Promise(function(_0x35d6e7,_0xddfe5b){return db['CmHopper'][_0xc446('0x38')](_0x4402fa[_0xc446('0x17')]['field'],{'where':{'id':_0x4402fa[_0xc446('0x17')]['id']}})[_0xc446('0xc')](function(_0x449e75){_0x35d6e7(_0x449e75);})[_0xc446('0x28')](function(_0x7ded57){logger[_0xc446('0x11')](_0xc446('0x39'),_0x7ded57['message'],_0x4402fa);_0xddfe5b(_0x13cce4[_0xc446('0x11')](0x1f4,_0x7ded57[_0xc446('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js
index 75c6e7d..8ced8a8 100644
--- a/server/api/cmHopperAdditionalPhone/index.js
+++ b/server/api/cmHopperAdditionalPhone/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa72d=['index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get'];(function(_0x3bba37,_0xf0dc15){var _0x534df2=function(_0xefcf0){while(--_0xefcf0){_0x3bba37['push'](_0x3bba37['shift']());}};_0x534df2(++_0xf0dc15);}(_0xa72d,0x1bf));var _0xda72=function(_0x5e582b,_0xc495ff){_0x5e582b=_0x5e582b-0x0;var _0xbea2e2=_0xa72d[_0x5e582b];return _0xbea2e2;};'use strict';var multer=require(_0xda72('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda72('0x1'));var express=require(_0xda72('0x2'));var router=express[_0xda72('0x3')]();var auth=require(_0xda72('0x4'));var interaction=require(_0xda72('0x5'));var config=require(_0xda72('0x6'));var controller=require(_0xda72('0x7'));router[_0xda72('0x8')]('/',auth['isAuthenticated'](),controller[_0xda72('0x9')]);router[_0xda72('0x8')](_0xda72('0xa'),auth['isAuthenticated'](),controller[_0xda72('0xb')]);router[_0xda72('0xc')]('/',auth[_0xda72('0xd')](),controller[_0xda72('0xe')]);router[_0xda72('0xf')](_0xda72('0xa'),auth[_0xda72('0xd')](),controller[_0xda72('0x10')]);router[_0xda72('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xda72('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x4fc6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','multer','util','connect-timeout'];(function(_0x1ab3e5,_0x1eb700){var _0x470d20=function(_0x80cd66){while(--_0x80cd66){_0x1ab3e5['push'](_0x1ab3e5['shift']());}};_0x470d20(++_0x1eb700);}(_0x4fc6,0x184));var _0x64fc=function(_0x5e15f5,_0x5fdcc5){_0x5e15f5=_0x5e15f5-0x0;var _0x3905e3=_0x4fc6[_0x5e15f5];return _0x3905e3;};'use strict';var multer=require(_0x64fc('0x0'));var util=require(_0x64fc('0x1'));var path=require('path');var timeout=require(_0x64fc('0x2'));var express=require('express');var router=express[_0x64fc('0x3')]();var auth=require(_0x64fc('0x4'));var interaction=require(_0x64fc('0x5'));var config=require(_0x64fc('0x6'));var controller=require(_0x64fc('0x7'));router[_0x64fc('0x8')]('/',auth[_0x64fc('0x9')](),controller[_0x64fc('0xa')]);router[_0x64fc('0x8')](_0x64fc('0xb'),auth[_0x64fc('0x9')](),controller['show']);router[_0x64fc('0xc')]('/',auth[_0x64fc('0x9')](),controller[_0x64fc('0xd')]);router[_0x64fc('0xe')](_0x64fc('0xb'),auth[_0x64fc('0x9')](),controller['update']);router['delete'](_0x64fc('0xb'),auth[_0x64fc('0x9')](),controller[_0x64fc('0xf')]);module[_0x64fc('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js
index e6e0e2f..e566327 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.attributes.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdeca=['contactListQueue','INTEGER','sequelize','exports','STRING'];(function(_0x363643,_0x33f7af){var _0x48b910=function(_0x1da513){while(--_0x1da513){_0x363643['push'](_0x363643['shift']());}};_0x48b910(++_0x33f7af);}(_0xdeca,0x1c9));var _0xadec=function(_0x1298fc,_0x272e7f){_0x1298fc=_0x1298fc-0x0;var _0x3ab15b=_0xdeca[_0x1298fc];return _0x3ab15b;};'use strict';var moment=require('moment');var Sequelize=require(_0xadec('0x0'));module[_0xadec('0x1')]={'phone':{'type':Sequelize[_0xadec('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xadec('0x3')},'ListId':{'type':Sequelize[_0xadec('0x4')],'unique':_0xadec('0x3')},'VoiceQueueId':{'type':Sequelize[_0xadec('0x4')],'unique':_0xadec('0x3')}};
\ No newline at end of file
+var _0xb1d6=['STRING','INTEGER','contactListQueue'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0xb1d6,0x162));var _0x6b1d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb1d6[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x6b1d('0x0')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6b1d('0x1')],'unique':_0x6b1d('0x2')},'ListId':{'type':Sequelize[_0x6b1d('0x1')],'unique':_0x6b1d('0x2')},'VoiceQueueId':{'type':Sequelize[_0x6b1d('0x1')],'unique':_0x6b1d('0x2')}};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js
index 43c0b65..cb70332 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.controller.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x4d3b2e,_0x2ae87c){var _0x395f9a=function(_0x2f765c){while(--_0x2f765c){_0x4d3b2e['push'](_0x4d3b2e['shift']());}};_0x395f9a(++_0x2ae87c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x459a0e,_0x457cba){var _0x31deeb=function(_0x154065){while(--_0x154065){_0x459a0e['push'](_0x459a0e['shift']());}};_0x31deeb(++_0x457cba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js
index 55c1e64..870373d 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.model.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','../../config/logger','api'];(function(_0x33f481,_0x900262){var _0x6aa784=function(_0x18d946){while(--_0x18d946){_0x33f481['push'](_0x33f481['shift']());}};_0x6aa784(++_0x900262);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','../../config/logger','api'];(function(_0x5c8172,_0x38bc28){var _0x53cafc=function(_0x52b26a){while(--_0x52b26a){_0x5c8172['push'](_0x5c8172['shift']());}};_0x53cafc(++_0x38bc28);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js
index 79bce08..5d87405 100644
--- a/server/api/cmHopperBlack/cmHopperBlack.rpc.js
+++ b/server/api/cmHopperBlack/cmHopperBlack.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1520=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','limit','map','model','attributes','include','update','body','where','UpdateCmHopperBlack','catch','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xd07059,_0x145119){var _0x514f49=function(_0x87abec){while(--_0x87abec){_0xd07059['push'](_0xd07059['shift']());}};_0x514f49(++_0x145119);}(_0x1520,0x16b));var _0x0152=function(_0x43f3e8,_0x3a35cd){_0x43f3e8=_0x43f3e8-0x0;var _0x107890=_0x1520[_0x43f3e8];return _0x107890;};'use strict';var _=require(_0x0152('0x0'));var util=require(_0x0152('0x1'));var moment=require(_0x0152('0x2'));var BPromise=require(_0x0152('0x3'));var rs=require(_0x0152('0x4'));var fs=require('fs');var Redis=require(_0x0152('0x5'));var db=require(_0x0152('0x6'))['db'];var utils=require(_0x0152('0x7'));var logger=require(_0x0152('0x8'))(_0x0152('0x9'));var config=require(_0x0152('0xa'));var jayson=require(_0x0152('0xb'));var client=jayson[_0x0152('0xc')][_0x0152('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x481383,_0x56b436,_0x3b6ced){return new BPromise(function(_0x533fdc,_0x5b8167){return client[_0x0152('0xe')](_0x481383,_0x3b6ced)[_0x0152('0xf')](function(_0xc1b25b){logger[_0x0152('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x56b436,_0x0152('0x11'));logger[_0x0152('0x12')](_0x0152('0x13'),_0x56b436,_0x0152('0x11'),JSON[_0x0152('0x14')](_0xc1b25b));if(_0xc1b25b[_0x0152('0x15')]){if(_0xc1b25b['error'][_0x0152('0x16')]===0x1f4){logger[_0x0152('0x15')](_0x0152('0x17'),_0x56b436,_0xc1b25b[_0x0152('0x15')][_0x0152('0x18')]);return _0x5b8167(_0xc1b25b[_0x0152('0x15')][_0x0152('0x18')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x56b436,_0xc1b25b[_0x0152('0x15')][_0x0152('0x18')]);return _0x533fdc(_0xc1b25b['error'][_0x0152('0x18')]);}else{logger[_0x0152('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x56b436,_0x0152('0x11'));_0x533fdc(_0xc1b25b[_0x0152('0x19')][_0x0152('0x18')]);}})['catch'](function(_0x309db4){logger[_0x0152('0x15')]('CmHopperBlack,\x20%s,\x20%s',_0x56b436,_0x309db4);_0x5b8167(_0x309db4);});});}exports[_0x0152('0x1a')]=function(_0x4349da){var _0x5bd133=this;return new Promise(function(_0x6b480e,_0x36b2bb){return db[_0x0152('0x1b')][_0x0152('0x1c')]({'raw':_0x4349da[_0x0152('0x1d')]?_0x4349da[_0x0152('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4349da['options']?_0x4349da['options']['where']||null:null,'attributes':_0x4349da[_0x0152('0x1d')]?_0x4349da[_0x0152('0x1d')]['attributes']||null:null,'limit':_0x4349da['options']?_0x4349da[_0x0152('0x1d')][_0x0152('0x1e')]||null:null,'include':_0x4349da[_0x0152('0x1d')]?_0x4349da['options']['include']?_[_0x0152('0x1f')](_0x4349da['options']['include'],function(_0x56e686){return{'model':db[_0x56e686[_0x0152('0x20')]],'as':_0x56e686['as'],'attributes':_0x56e686[_0x0152('0x21')],'include':_0x56e686[_0x0152('0x22')]?_[_0x0152('0x1f')](_0x56e686[_0x0152('0x22')],function(_0x8cd026){return{'model':db[_0x8cd026[_0x0152('0x20')]],'as':_0x8cd026['as'],'attributes':_0x8cd026[_0x0152('0x21')],'include':_0x8cd026[_0x0152('0x22')]?_[_0x0152('0x1f')](_0x8cd026[_0x0152('0x22')],function(_0x1bcdfe){return{'model':db[_0x1bcdfe[_0x0152('0x20')]],'as':_0x1bcdfe['as'],'attributes':_0x1bcdfe[_0x0152('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0152('0xf')](function(_0x1f3758){logger[_0x0152('0x10')](_0x0152('0x1a'),_0x4349da);logger['debug']('GetCmHopperBlack',_0x4349da,JSON[_0x0152('0x14')](_0x1f3758));_0x6b480e(_0x1f3758);})['catch'](function(_0x17b8cf){logger[_0x0152('0x15')](_0x0152('0x1a'),_0x17b8cf[_0x0152('0x18')],_0x4349da);_0x36b2bb(_0x5bd133[_0x0152('0x15')](0x1f4,_0x17b8cf[_0x0152('0x18')]));});});};exports['UpdateCmHopperBlack']=function(_0x47784b){var _0x32510d=this;return new Promise(function(_0x19dbd7,_0x1e4326){return db[_0x0152('0x1b')][_0x0152('0x23')](_0x47784b[_0x0152('0x24')],{'raw':_0x47784b[_0x0152('0x1d')]?_0x47784b[_0x0152('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47784b[_0x0152('0x1d')]?_0x47784b[_0x0152('0x1d')][_0x0152('0x25')]||null:null,'attributes':_0x47784b[_0x0152('0x1d')]?_0x47784b[_0x0152('0x1d')][_0x0152('0x21')]||null:null,'limit':_0x47784b['options']?_0x47784b[_0x0152('0x1d')][_0x0152('0x1e')]||null:null})[_0x0152('0xf')](function(_0x32d576){logger[_0x0152('0x10')](_0x0152('0x26'),_0x47784b);logger['debug']('UpdateCmHopperBlack',_0x47784b,JSON[_0x0152('0x14')](_0x32d576));_0x19dbd7(_0x32d576);})[_0x0152('0x27')](function(_0x3d5a5f){logger[_0x0152('0x15')](_0x0152('0x26'),_0x3d5a5f[_0x0152('0x18')],_0x47784b);_0x1e4326(_0x32510d[_0x0152('0x15')](0x1f4,_0x3d5a5f[_0x0152('0x18')]));});});};exports[_0x0152('0x28')]=function(_0x234f2a){var _0x48f6b9=this;return new Promise(function(_0x13ceb9,_0x48b20b){return db[_0x0152('0x1b')]['destroy']({'where':_0x234f2a[_0x0152('0x1d')]?_0x234f2a[_0x0152('0x1d')][_0x0152('0x25')]||null:null})['then'](function(_0x28ae0a){logger['info'](_0x0152('0x28'),_0x234f2a);logger[_0x0152('0x12')](_0x0152('0x28'),_0x234f2a,JSON['stringify'](_0x28ae0a));_0x13ceb9(_0x28ae0a);})[_0x0152('0x27')](function(_0x1d4791){logger['error'](_0x0152('0x28'),_0x1d4791[_0x0152('0x18')],_0x234f2a);_0x48b20b(_0x48f6b9['error'](0x1f4,_0x1d4791[_0x0152('0x18')]));});});};
\ No newline at end of file
+var _0xc64a=['CmHopperBlack','options','where','limit','include','map','attributes','model','UpdateCmHopperBlack','body','raw','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack'];(function(_0x5cd33f,_0x4e14ba){var _0x2cc17c=function(_0x24555b){while(--_0x24555b){_0x5cd33f['push'](_0x5cd33f['shift']());}};_0x2cc17c(++_0x4e14ba);}(_0xc64a,0x162));var _0xac64=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc64a[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xac64('0x0'));var util=require(_0xac64('0x1'));var moment=require('moment');var BPromise=require(_0xac64('0x2'));var rs=require(_0xac64('0x3'));var fs=require('fs');var Redis=require(_0xac64('0x4'));var db=require(_0xac64('0x5'))['db'];var utils=require(_0xac64('0x6'));var logger=require(_0xac64('0x7'))(_0xac64('0x8'));var config=require(_0xac64('0x9'));var jayson=require(_0xac64('0xa'));var client=jayson['client'][_0xac64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x554556,_0x38c3ec,_0x36d1be){return new BPromise(function(_0x16162a,_0x3cd9bf){return client[_0xac64('0xc')](_0x554556,_0x36d1be)[_0xac64('0xd')](function(_0x4dfe90){logger[_0xac64('0xe')](_0xac64('0xf'),_0x38c3ec,_0xac64('0x10'));logger[_0xac64('0x11')](_0xac64('0x12'),_0x38c3ec,_0xac64('0x10'),JSON[_0xac64('0x13')](_0x4dfe90));if(_0x4dfe90['error']){if(_0x4dfe90[_0xac64('0x14')][_0xac64('0x15')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x38c3ec,_0x4dfe90[_0xac64('0x14')][_0xac64('0x16')]);return _0x3cd9bf(_0x4dfe90[_0xac64('0x14')]['message']);}logger[_0xac64('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x38c3ec,_0x4dfe90[_0xac64('0x14')][_0xac64('0x16')]);return _0x16162a(_0x4dfe90[_0xac64('0x14')][_0xac64('0x16')]);}else{logger[_0xac64('0xe')](_0xac64('0xf'),_0x38c3ec,_0xac64('0x10'));_0x16162a(_0x4dfe90[_0xac64('0x17')]['message']);}})[_0xac64('0x18')](function(_0x6edd4){logger[_0xac64('0x14')](_0xac64('0xf'),_0x38c3ec,_0x6edd4);_0x3cd9bf(_0x6edd4);});});}exports[_0xac64('0x19')]=function(_0xbd0699){var _0xea2267=this;return new Promise(function(_0x21317b,_0x35c863){return db[_0xac64('0x1a')]['findAll']({'raw':_0xbd0699[_0xac64('0x1b')]?_0xbd0699[_0xac64('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xbd0699['options']?_0xbd0699[_0xac64('0x1b')][_0xac64('0x1c')]||null:null,'attributes':_0xbd0699[_0xac64('0x1b')]?_0xbd0699[_0xac64('0x1b')]['attributes']||null:null,'limit':_0xbd0699['options']?_0xbd0699[_0xac64('0x1b')][_0xac64('0x1d')]||null:null,'include':_0xbd0699[_0xac64('0x1b')]?_0xbd0699[_0xac64('0x1b')][_0xac64('0x1e')]?_[_0xac64('0x1f')](_0xbd0699[_0xac64('0x1b')]['include'],function(_0x1941fd){return{'model':db[_0x1941fd['model']],'as':_0x1941fd['as'],'attributes':_0x1941fd[_0xac64('0x20')],'include':_0x1941fd[_0xac64('0x1e')]?_['map'](_0x1941fd[_0xac64('0x1e')],function(_0x2fdebd){return{'model':db[_0x2fdebd[_0xac64('0x21')]],'as':_0x2fdebd['as'],'attributes':_0x2fdebd['attributes'],'include':_0x2fdebd[_0xac64('0x1e')]?_[_0xac64('0x1f')](_0x2fdebd[_0xac64('0x1e')],function(_0x1efb89){return{'model':db[_0x1efb89[_0xac64('0x21')]],'as':_0x1efb89['as'],'attributes':_0x1efb89[_0xac64('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26042b){logger[_0xac64('0xe')](_0xac64('0x19'),_0xbd0699);logger[_0xac64('0x11')](_0xac64('0x19'),_0xbd0699,JSON['stringify'](_0x26042b));_0x21317b(_0x26042b);})['catch'](function(_0x5a26fb){logger[_0xac64('0x14')](_0xac64('0x19'),_0x5a26fb[_0xac64('0x16')],_0xbd0699);_0x35c863(_0xea2267[_0xac64('0x14')](0x1f4,_0x5a26fb['message']));});});};exports[_0xac64('0x22')]=function(_0x15f30a){var _0x40d827=this;return new Promise(function(_0x3db286,_0x1f7bcc){return db[_0xac64('0x1a')]['update'](_0x15f30a[_0xac64('0x23')],{'raw':_0x15f30a['options']?_0x15f30a[_0xac64('0x1b')][_0xac64('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15f30a[_0xac64('0x1b')]?_0x15f30a[_0xac64('0x1b')][_0xac64('0x1c')]||null:null,'attributes':_0x15f30a[_0xac64('0x1b')]?_0x15f30a['options'][_0xac64('0x20')]||null:null,'limit':_0x15f30a['options']?_0x15f30a[_0xac64('0x1b')][_0xac64('0x1d')]||null:null})[_0xac64('0xd')](function(_0xc380a1){logger[_0xac64('0xe')](_0xac64('0x22'),_0x15f30a);logger['debug']('UpdateCmHopperBlack',_0x15f30a,JSON[_0xac64('0x13')](_0xc380a1));_0x3db286(_0xc380a1);})['catch'](function(_0x373012){logger['error'](_0xac64('0x22'),_0x373012[_0xac64('0x16')],_0x15f30a);_0x1f7bcc(_0x40d827[_0xac64('0x14')](0x1f4,_0x373012['message']));});});};exports[_0xac64('0x25')]=function(_0x52f8b2){var _0x217820=this;return new Promise(function(_0x2914c9,_0x9719f9){return db[_0xac64('0x1a')]['destroy']({'where':_0x52f8b2[_0xac64('0x1b')]?_0x52f8b2[_0xac64('0x1b')][_0xac64('0x1c')]||null:null})[_0xac64('0xd')](function(_0x4a95ed){logger['info'](_0xac64('0x25'),_0x52f8b2);logger['debug'](_0xac64('0x25'),_0x52f8b2,JSON[_0xac64('0x13')](_0x4a95ed));_0x2914c9(_0x4a95ed);})[_0xac64('0x18')](function(_0x46a28e){logger[_0xac64('0x14')](_0xac64('0x25'),_0x46a28e['message'],_0x52f8b2);_0x9719f9(_0x217820[_0xac64('0x14')](0x1f4,_0x46a28e['message']));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js
index 2997599..9649d84 100644
--- a/server/api/cmHopperBlack/index.js
+++ b/server/api/cmHopperBlack/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f0d=['update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','show','put','/:id'];(function(_0x5ec314,_0x4cebd9){var _0x18e9a6=function(_0x5281d4){while(--_0x5281d4){_0x5ec314['push'](_0x5ec314['shift']());}};_0x18e9a6(++_0x4cebd9);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x18b563,_0x15e9a2){_0x18b563=_0x18b563-0x0;var _0x3d6984=_0x6f0d[_0x18b563];return _0x3d6984;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var auth=require(_0xd6f0('0x4'));var interaction=require(_0xd6f0('0x5'));var config=require(_0xd6f0('0x6'));var controller=require(_0xd6f0('0x7'));router[_0xd6f0('0x8')]('/',auth['isAuthenticated'](),controller[_0xd6f0('0x9')]);router['get'](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xc')]);router[_0xd6f0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd6f0('0xd')]);router[_0xd6f0('0xe')](_0xd6f0('0xf'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0x10')]);router['delete'](_0xd6f0('0xf'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0x11')]);module[_0xd6f0('0x12')]=router;
\ No newline at end of file
+var _0x207c=['./cmHopperBlack.controller','get','/describe','isAuthenticated','/:id','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x17823f,_0xffd807){var _0x51fc21=function(_0x5e4921){while(--_0x5e4921){_0x17823f['push'](_0x17823f['shift']());}};_0x51fc21(++_0xffd807);}(_0x207c,0x1e8));var _0xc207=function(_0x5bc158,_0x20ba90){_0x5bc158=_0x5bc158-0x0;var _0x288d43=_0x207c[_0x5bc158];return _0x288d43;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var auth=require(_0xc207('0x5'));var interaction=require(_0xc207('0x6'));var config=require('../../config/environment');var controller=require(_0xc207('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc207('0x8')](_0xc207('0x9'),auth[_0xc207('0xa')](),controller['describe']);router[_0xc207('0x8')](_0xc207('0xb'),auth[_0xc207('0xa')](),controller['show']);router[_0xc207('0xc')](_0xc207('0xb'),auth[_0xc207('0xa')](),controller[_0xc207('0xd')]);router[_0xc207('0xe')](_0xc207('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js
index 50dde4b..157cca5 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.attributes.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3987=['diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','followuptime'];(function(_0x1630b0,_0x5e0863){var _0x1d6a56=function(_0x3ccc7f){while(--_0x3ccc7f){_0x1630b0['push'](_0x1630b0['shift']());}};_0x1d6a56(++_0x5e0863);}(_0x3987,0x1d8));var _0x7398=function(_0x1543a2,_0x5970a0){_0x1543a2=_0x1543a2-0x0;var _0x4d6cda=_0x3987[_0x1543a2];return _0x4d6cda;};'use strict';var Sequelize=require(_0x7398('0x0'));var moment=require(_0x7398('0x1'));module[_0x7398('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x7398('0x3')]},'scheduledat':{'type':Sequelize[_0x7398('0x4')]},'countbusyretry':{'type':Sequelize[_0x7398('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7398('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7398('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7398('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7398('0x3')]},'calleridname':{'type':Sequelize[_0x7398('0x3')]},'starttime':{'type':Sequelize[_0x7398('0x4')]},'responsetime':{'type':Sequelize[_0x7398('0x4')]},'answertime':{'type':Sequelize[_0x7398('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x7398('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7398('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7398('0x3')]},'campaign':{'type':Sequelize[_0x7398('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7398('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x7398('0x3')]},'dispositionat':{'type':Sequelize[_0x7398('0x4')],'set':function(_0x564d7d){var _0x462221=this[_0x7398('0x6')](_0x7398('0x7'));if(_0x462221&&_0x564d7d){this['setDataValue'](_0x7398('0x8'),moment(_0x564d7d)[_0x7398('0x9')](moment(_0x462221),_0x7398('0xa')));}return this['setDataValue'](_0x7398('0xb'),_0x564d7d);}},'amd':{'type':Sequelize[_0x7398('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x7398('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x7398('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x7398('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x7398('0x4')]},'callback':{'type':Sequelize[_0x7398('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7398('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7398('0x4')]},'deleted':{'type':Sequelize[_0x7398('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x7398('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7398('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7398('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7398('0x5')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x65b5=['BOOLEAN','sequelize','moment','STRING','DATE','INTEGER','getDataValue','diff','seconds'];(function(_0x5a1a51,_0x144c79){var _0x47edd7=function(_0x2259bb){while(--_0x2259bb){_0x5a1a51['push'](_0x5a1a51['shift']());}};_0x47edd7(++_0x144c79);}(_0x65b5,0x19f));var _0x565b=function(_0x33d2cf,_0xab4150){_0x33d2cf=_0x33d2cf-0x0;var _0x2e6368=_0x65b5[_0x33d2cf];return _0x2e6368;};'use strict';var Sequelize=require(_0x565b('0x0'));var moment=require(_0x565b('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x565b('0x2')]},'scheduledat':{'type':Sequelize[_0x565b('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x565b('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x565b('0x2')]},'calleridnum':{'type':Sequelize[_0x565b('0x2')]},'calleridname':{'type':Sequelize[_0x565b('0x2')]},'starttime':{'type':Sequelize[_0x565b('0x3')]},'responsetime':{'type':Sequelize[_0x565b('0x3')]},'answertime':{'type':Sequelize[_0x565b('0x3')]},'droptime':{'type':Sequelize[_0x565b('0x3')]},'endtime':{'type':Sequelize[_0x565b('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x565b('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x565b('0x2')]},'campaign':{'type':Sequelize[_0x565b('0x2')]},'campaigntype':{'type':Sequelize[_0x565b('0x2')]},'membername':{'type':Sequelize[_0x565b('0x2')]},'reason':{'type':Sequelize[_0x565b('0x2')]},'disposition':{'type':Sequelize[_0x565b('0x2')]},'dispositionat':{'type':Sequelize[_0x565b('0x3')],'set':function(_0xe0afa9){var _0x35436a=this[_0x565b('0x5')]('endtime');if(_0x35436a&&_0xe0afa9){this['setDataValue']('followuptime',moment(_0xe0afa9)[_0x565b('0x6')](moment(_0x35436a),_0x565b('0x7')));}return this['setDataValue']('dispositionat',_0xe0afa9);}},'amd':{'type':Sequelize[_0x565b('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x565b('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x565b('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x565b('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x565b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x565b('0x3')]},'deleted':{'type':Sequelize[_0x565b('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x565b('0x3')]},'recallme':{'type':Sequelize[_0x565b('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x565b('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x565b('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x565b('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x565b('0x4')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js
index d0d2359..a529a9b 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.controller.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa5d7=['keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','length','include','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','findAll','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','group','moveContactsIvrCampaignHopperFinal','createdAt','updatedAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query'];(function(_0xaeb2ce,_0x58d408){var _0x373618=function(_0x21bf8d){while(--_0x21bf8d){_0xaeb2ce['push'](_0xaeb2ce['shift']());}};_0x373618(++_0x58d408);}(_0xa5d7,0x1c3));var _0x7a5d=function(_0x252cf9,_0x5221f9){_0x252cf9=_0x252cf9-0x0;var _0x1eb966=_0xa5d7[_0x252cf9];return _0x1eb966;};'use strict';var pdf=require(_0x7a5d('0x0'));var emlformat=require(_0x7a5d('0x1'));var rimraf=require(_0x7a5d('0x2'));var zipdir=require(_0x7a5d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a5d('0x4'));var moment=require('moment');var BPromise=require(_0x7a5d('0x5'));var Mustache=require('mustache');var util=require(_0x7a5d('0x6'));var path=require('path');var sox=require(_0x7a5d('0x7'));var csv=require(_0x7a5d('0x8'));var ejs=require(_0x7a5d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7a5d('0xa'));var crypto=require(_0x7a5d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7a5d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7a5d('0xd'));var Papa=require(_0x7a5d('0xe'));var Redis=require(_0x7a5d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7a5d('0x10'));var as=require(_0x7a5d('0x11'));var hardwareService=require(_0x7a5d('0x12'));var logger=require(_0x7a5d('0x13'))(_0x7a5d('0x14'));var utils=require(_0x7a5d('0x15'));var config=require(_0x7a5d('0x16'));var db=require(_0x7a5d('0x17'))['db'];function respondWithStatusCode(_0x196db3,_0xc4d232){_0xc4d232=_0xc4d232||0xcc;return function(_0x3a3344){if(_0x3a3344){return _0x196db3[_0x7a5d('0x18')](_0xc4d232);}return _0x196db3['status'](_0xc4d232)['end']();};}function respondWithResult(_0x34d400,_0x5335f6){_0x5335f6=_0x5335f6||0xc8;return function(_0x1e6179){if(_0x1e6179){return _0x34d400[_0x7a5d('0x19')](_0x5335f6)[_0x7a5d('0x1a')](_0x1e6179);}};}function respondWithFilteredResult(_0x1650c7,_0xd9d560){return function(_0x342f63){if(_0x342f63){var _0x50070a=_0x342f63[_0x7a5d('0x1b')],_0x35c72e=_0xd9d560[_0x7a5d('0x1c')],_0x288ffa=_0xd9d560['offset']+_0xd9d560[_0x7a5d('0x1d')],_0xaca430;if(_0x288ffa>=_0x50070a){_0x288ffa=_0x50070a;_0xaca430=0xc8;}else{_0xaca430=0xce;}_0x1650c7[_0x7a5d('0x19')](_0xaca430);return _0x1650c7['set']('Content-Range',_0x35c72e+'-'+_0x288ffa+'/'+_0x50070a)[_0x7a5d('0x1a')](_0x342f63);}return null;};}function patchUpdates(_0x4229f6){return function(_0x55fac7){try{jsonpatch[_0x7a5d('0x1e')](_0x55fac7,_0x4229f6,!![]);}catch(_0x4a02f2){return BPromise[_0x7a5d('0x1f')](_0x4a02f2);}return _0x55fac7['save']();};}function saveUpdates(_0x436bef,_0x334d3d){return function(_0x5bedc5){if(_0x5bedc5){return _0x5bedc5[_0x7a5d('0x20')](_0x436bef)['then'](function(_0x3ed941){return _0x3ed941;});}return null;};}function removeEntity(_0x58a09b,_0x56183a){return function(_0x1a0282){if(_0x1a0282){return _0x1a0282[_0x7a5d('0x21')]()[_0x7a5d('0x22')](function(){_0x58a09b['status'](0xcc)[_0x7a5d('0x23')]();});}};}function handleEntityNotFound(_0x45377a,_0x1bd069){return function(_0x4d1af5){if(!_0x4d1af5){_0x45377a[_0x7a5d('0x18')](0x194);}return _0x4d1af5;};}function handleError(_0x512831,_0x476cd2){_0x476cd2=_0x476cd2||0x1f4;return function(_0x393069){logger[_0x7a5d('0x24')](_0x393069[_0x7a5d('0x25')]);if(_0x393069[_0x7a5d('0x26')]){delete _0x393069[_0x7a5d('0x26')];}_0x512831['status'](_0x476cd2)[_0x7a5d('0x27')](_0x393069);};}exports[_0x7a5d('0x28')]=function(_0x4bd5fd,_0x1c33f5){var _0x431fe9={},_0x2b1f0b={},_0x72bedd={'count':0x0,'rows':[]};var _0x5c89c8=_[_0x7a5d('0x29')](db[_0x7a5d('0x2a')][_0x7a5d('0x2b')],function(_0x2931ef){return{'name':_0x2931ef[_0x7a5d('0x2c')],'type':_0x2931ef[_0x7a5d('0x2d')][_0x7a5d('0x2e')]};});_0x2b1f0b[_0x7a5d('0x2f')]=_['map'](_0x5c89c8,_0x7a5d('0x26'));_0x2b1f0b[_0x7a5d('0x30')]=_[_0x7a5d('0x31')](_0x4bd5fd[_0x7a5d('0x30')]);_0x2b1f0b[_0x7a5d('0x32')]=_[_0x7a5d('0x33')](_0x2b1f0b[_0x7a5d('0x2f')],_0x2b1f0b[_0x7a5d('0x30')]);_0x431fe9[_0x7a5d('0x34')]=_[_0x7a5d('0x33')](_0x2b1f0b[_0x7a5d('0x2f')],qs[_0x7a5d('0x35')](_0x4bd5fd[_0x7a5d('0x30')][_0x7a5d('0x35')]));_0x431fe9['attributes']=_0x431fe9[_0x7a5d('0x34')]['length']?_0x431fe9[_0x7a5d('0x34')]:_0x2b1f0b[_0x7a5d('0x2f')];if(!_0x4bd5fd[_0x7a5d('0x30')]['hasOwnProperty'](_0x7a5d('0x36'))){_0x431fe9[_0x7a5d('0x1d')]=qs[_0x7a5d('0x1d')](_0x4bd5fd[_0x7a5d('0x30')]['limit']);_0x431fe9[_0x7a5d('0x1c')]=qs[_0x7a5d('0x1c')](_0x4bd5fd[_0x7a5d('0x30')][_0x7a5d('0x1c')]);}_0x431fe9[_0x7a5d('0x37')]=qs[_0x7a5d('0x38')](_0x4bd5fd['query'][_0x7a5d('0x38')]);_0x431fe9[_0x7a5d('0x39')]=qs[_0x7a5d('0x32')](_['pick'](_0x4bd5fd[_0x7a5d('0x30')],_0x2b1f0b[_0x7a5d('0x32')]),_0x5c89c8);if(_0x4bd5fd[_0x7a5d('0x30')][_0x7a5d('0x3a')]){_0x431fe9[_0x7a5d('0x39')]=_[_0x7a5d('0x3b')](_0x431fe9[_0x7a5d('0x39')],{'$or':_[_0x7a5d('0x29')](_0x5c89c8,function(_0x356840){if(_0x356840[_0x7a5d('0x2d')]!==_0x7a5d('0x3c')){var _0x20d5f4={};_0x20d5f4[_0x356840[_0x7a5d('0x26')]]={'$like':'%'+_0x4bd5fd[_0x7a5d('0x30')]['filter']+'%'};return _0x20d5f4;}})});}_0x431fe9=_[_0x7a5d('0x3b')]({},_0x431fe9,_0x4bd5fd[_0x7a5d('0x3d')]);var _0x24c8e1={'where':_0x431fe9[_0x7a5d('0x39')]};return db[_0x7a5d('0x2a')][_0x7a5d('0x1b')](_0x24c8e1)[_0x7a5d('0x22')](function(_0x143156){_0x72bedd[_0x7a5d('0x1b')]=_0x143156;if(_0x4bd5fd['query'][_0x7a5d('0x3e')]){_0x431fe9['include']=[{'all':!![]}];}return db[_0x7a5d('0x2a')]['findAll'](_0x431fe9);})[_0x7a5d('0x22')](function(_0x1c54eb){_0x72bedd[_0x7a5d('0x3f')]=_0x1c54eb;return _0x72bedd;})['then'](respondWithFilteredResult(_0x1c33f5,_0x431fe9))[_0x7a5d('0x40')](handleError(_0x1c33f5,null));};exports['show']=function(_0x5b669f,_0x12adbf){var _0x824f98={'raw':!![],'where':{'id':_0x5b669f[_0x7a5d('0x41')]['id']}},_0x563d2a={};_0x563d2a[_0x7a5d('0x2f')]=_[_0x7a5d('0x31')](db['CmHopperFinal'][_0x7a5d('0x2b')]);_0x563d2a[_0x7a5d('0x30')]=_['keys'](_0x5b669f[_0x7a5d('0x30')]);_0x563d2a[_0x7a5d('0x32')]=_[_0x7a5d('0x33')](_0x563d2a[_0x7a5d('0x2f')],_0x563d2a[_0x7a5d('0x30')]);_0x824f98[_0x7a5d('0x34')]=_[_0x7a5d('0x33')](_0x563d2a['model'],qs[_0x7a5d('0x35')](_0x5b669f[_0x7a5d('0x30')][_0x7a5d('0x35')]));_0x824f98[_0x7a5d('0x34')]=_0x824f98[_0x7a5d('0x34')][_0x7a5d('0x42')]?_0x824f98[_0x7a5d('0x34')]:_0x563d2a[_0x7a5d('0x2f')];if(_0x5b669f[_0x7a5d('0x30')]['includeAll']){_0x824f98[_0x7a5d('0x43')]=[{'all':!![]}];}_0x824f98=_[_0x7a5d('0x3b')]({},_0x824f98,_0x5b669f[_0x7a5d('0x3d')]);return db[_0x7a5d('0x2a')][_0x7a5d('0x44')](_0x824f98)[_0x7a5d('0x22')](handleEntityNotFound(_0x12adbf,null))['then'](respondWithResult(_0x12adbf,null))[_0x7a5d('0x40')](handleError(_0x12adbf,null));};exports[_0x7a5d('0x45')]=function(_0x28ca5f,_0x5231ef){return db[_0x7a5d('0x2a')][_0x7a5d('0x45')]()['then'](respondWithResult(_0x5231ef,null))[_0x7a5d('0x40')](handleError(_0x5231ef,null));};exports[_0x7a5d('0x20')]=function(_0x496193,_0x4584bc){if(_0x496193['body'][_0x7a5d('0x46')]){delete _0x496193[_0x7a5d('0x47')]['uniqueid'];}return db[_0x7a5d('0x2a')]['find']({'where':{'uniqueid':_0x496193[_0x7a5d('0x41')]['id']}})[_0x7a5d('0x22')](handleEntityNotFound(_0x4584bc,null))[_0x7a5d('0x22')](saveUpdates(_0x496193[_0x7a5d('0x47')],null))[_0x7a5d('0x22')](respondWithResult(_0x4584bc,null))[_0x7a5d('0x40')](handleError(_0x4584bc,null));};exports[_0x7a5d('0x48')]=function(_0x2da745,_0x5af327,_0x260b01){return db[_0x7a5d('0x2a')][_0x7a5d('0x49')]({'raw':![],'where':{'VoiceQueueId':_0x2da745[_0x7a5d('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db[_0x7a5d('0x4b')][_0x7a5d('0x4c')]('`state`\x20=\x200,\x201,\x20null'))),_0x7a5d('0x4d')],[db['sequelize']['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x7a5d('0x4e')))),_0x7a5d('0x4f')],[db[_0x7a5d('0x4b')]['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db['sequelize'][_0x7a5d('0x4c')](_0x7a5d('0x50')))),_0x7a5d('0x51')],[db[_0x7a5d('0x4b')]['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db[_0x7a5d('0x4b')][_0x7a5d('0x4c')](_0x7a5d('0x52')))),_0x7a5d('0x53')],[db['sequelize']['fn']('COUNT',db[_0x7a5d('0x4b')]['fn']('IF',db[_0x7a5d('0x4b')]['literal'](_0x7a5d('0x54')))),_0x7a5d('0x55')],[db[_0x7a5d('0x4b')]['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db[_0x7a5d('0x4b')]['literal'](_0x7a5d('0x56')))),_0x7a5d('0x57')],[db['sequelize']['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db['sequelize'][_0x7a5d('0x4c')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db['sequelize']['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db[_0x7a5d('0x4b')]['literal'](_0x7a5d('0x58')))),_0x7a5d('0x59')]]})[_0x7a5d('0x22')](handleEntityNotFound(_0x5af327,null))[_0x7a5d('0x22')](respondWithResult(_0x5af327,null))['catch'](handleError(_0x5af327,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x57fcf3,_0x272704,_0x246148){return db[_0x7a5d('0x2a')][_0x7a5d('0x49')]({'raw':![],'where':{'CampaignId':_0x57fcf3[_0x7a5d('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db[_0x7a5d('0x4b')][_0x7a5d('0x4c')](_0x7a5d('0x5a')))),'noSuchContacts'],[db[_0x7a5d('0x4b')]['fn']('COUNT',db[_0x7a5d('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x7a5d('0x4e')))),_0x7a5d('0x4f')],[db[_0x7a5d('0x4b')]['fn'](_0x7a5d('0x4a'),db['sequelize']['fn']('IF',db[_0x7a5d('0x4b')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x7a5d('0x51')],[db[_0x7a5d('0x4b')]['fn']('COUNT',db[_0x7a5d('0x4b')]['fn']('IF',db['sequelize'][_0x7a5d('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn'](_0x7a5d('0x4a'),db['sequelize']['fn']('IF',db[_0x7a5d('0x4b')][_0x7a5d('0x4c')](_0x7a5d('0x54')))),'dropContacts'],[db[_0x7a5d('0x4b')]['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db[_0x7a5d('0x4b')]['literal'](_0x7a5d('0x56')))),_0x7a5d('0x57')],[db[_0x7a5d('0x4b')]['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db[_0x7a5d('0x4b')][_0x7a5d('0x4c')](_0x7a5d('0x5b')))),_0x7a5d('0x5c')],[db[_0x7a5d('0x4b')]['fn'](_0x7a5d('0x4a'),db[_0x7a5d('0x4b')]['fn']('IF',db[_0x7a5d('0x4b')][_0x7a5d('0x4c')](_0x7a5d('0x58')))),_0x7a5d('0x59')]]})[_0x7a5d('0x22')](handleEntityNotFound(_0x272704,null))[_0x7a5d('0x22')](respondWithResult(_0x272704,null))[_0x7a5d('0x40')](handleError(_0x272704,null));};exports[_0x7a5d('0x5d')]=function(_0x59f50d,_0x3ecece,_0x26c3e2){return db['VoiceQueue'][_0x7a5d('0x44')]({'where':{'id':_0x59f50d[_0x7a5d('0x41')]['id']}})[_0x7a5d('0x22')](handleEntityNotFound(_0x3ecece,null))[_0x7a5d('0x22')](function(_0x21a28c){var _0x388273;if(_0x21a28c){_0x388273=squel[_0x7a5d('0x5e')]()['into'](_0x7a5d('0x5f'))[_0x7a5d('0x60')]([_0x7a5d('0x61'),_0x7a5d('0x62'),_0x7a5d('0x63'),_0x7a5d('0x64'),_0x7a5d('0x65'),'createdAt','updatedAt'],squel[_0x7a5d('0x66')]()[_0x7a5d('0x67')](_0x7a5d('0x68'),_0x7a5d('0x61'))['field'](_0x7a5d('0x69'),'scheduledAt')['field'](_0x7a5d('0x6a'),_0x7a5d('0x63'))['field'](_0x7a5d('0x6b'),'ListId')[_0x7a5d('0x67')](_0x7a5d('0x6c'),_0x7a5d('0x65'))[_0x7a5d('0x67')](_0x7a5d('0x69'),'createdAt')['field'](_0x7a5d('0x69'),'updatedAt')[_0x7a5d('0x6d')](_0x7a5d('0x6e'))['where'](_0x7a5d('0x6f'),_0x59f50d[_0x7a5d('0x41')]['id'][_0x7a5d('0x70')]())['where']('state\x20=\x20?',_0x59f50d['body']['state'][_0x7a5d('0x70')]())[_0x7a5d('0x39')](_0x7a5d('0x71'))['where'](_0x7a5d('0x72'),squel[_0x7a5d('0x66')]()[_0x7a5d('0x67')](_0x7a5d('0x61'))[_0x7a5d('0x6d')]('cm_hopper')[_0x7a5d('0x39')](_0x7a5d('0x6f'),_0x59f50d[_0x7a5d('0x41')]['id'][_0x7a5d('0x70')]()))[_0x7a5d('0x39')](_0x7a5d('0x72'),squel['select']()[_0x7a5d('0x67')]('calleridnum')['from'](_0x7a5d('0x6e'))[_0x7a5d('0x39')](_0x7a5d('0x6f'),_0x59f50d['params']['id'][_0x7a5d('0x70')]())[_0x7a5d('0x39')]('state\x20=\x204'))[_0x7a5d('0x73')](_0x7a5d('0x63')))['toString']();return db['sequelize'][_0x7a5d('0x30')](_0x388273);}return[];})[_0x7a5d('0x22')](respondWithResult(_0x3ecece,null))[_0x7a5d('0x40')](handleError(_0x3ecece,null));};exports[_0x7a5d('0x74')]=function(_0x549454,_0x53324b,_0x11fb74){return db['Campaign'][_0x7a5d('0x44')]({'where':{'id':_0x549454['params']['id']}})['then'](handleEntityNotFound(_0x53324b,null))[_0x7a5d('0x22')](function(_0x5ee489){var _0x879b0c;if(_0x5ee489){_0x879b0c=squel['insert']()['into'](_0x7a5d('0x5f'))[_0x7a5d('0x60')]([_0x7a5d('0x61'),'scheduledAt','ContactId','ListId','CampaignId',_0x7a5d('0x75'),_0x7a5d('0x76')],squel[_0x7a5d('0x66')]()[_0x7a5d('0x67')](_0x7a5d('0x68'),'phone')[_0x7a5d('0x67')]('NOW()',_0x7a5d('0x62'))['field'](_0x7a5d('0x6a'),_0x7a5d('0x63'))[_0x7a5d('0x67')]('ANY_VALUE(ListId)','ListId')['field'](_0x7a5d('0x77'),'CampaignId')[_0x7a5d('0x67')](_0x7a5d('0x69'),_0x7a5d('0x75'))[_0x7a5d('0x67')](_0x7a5d('0x69'),_0x7a5d('0x76'))[_0x7a5d('0x6d')](_0x7a5d('0x6e'))[_0x7a5d('0x39')](_0x7a5d('0x78'),_0x549454['params']['id']['toString']())[_0x7a5d('0x39')]('state\x20=\x20?',_0x549454[_0x7a5d('0x47')]['state'][_0x7a5d('0x70')]())['where'](_0x7a5d('0x71'))[_0x7a5d('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7a5d('0x66')]()[_0x7a5d('0x67')](_0x7a5d('0x61'))[_0x7a5d('0x6d')]('cm_hopper')[_0x7a5d('0x39')]('CampaignId\x20=\x20?',_0x549454['params']['id']['toString']()))[_0x7a5d('0x39')](_0x7a5d('0x72'),squel[_0x7a5d('0x66')]()['field'](_0x7a5d('0x79'))[_0x7a5d('0x6d')](_0x7a5d('0x6e'))['where'](_0x7a5d('0x78'),_0x549454[_0x7a5d('0x41')]['id']['toString']())[_0x7a5d('0x39')]('state\x20=\x204'))['group'](_0x7a5d('0x63')))['toString']();return db['sequelize'][_0x7a5d('0x30')](_0x879b0c);}return[];})['then'](respondWithResult(_0x53324b,null))[_0x7a5d('0x40')](handleError(_0x53324b,null));};exports[_0x7a5d('0x7a')]=function(_0x2b3fe2,_0x5e4fa7,_0x1efcc2){return db[_0x7a5d('0x7b')][_0x7a5d('0x7c')]({'where':{'VoiceQueueId':_0x2b3fe2[_0x7a5d('0x47')][_0x7a5d('0x65')],'CampaignId':_0x2b3fe2['body']['CampaignId'],'ContactId':_0x2b3fe2[_0x7a5d('0x47')]['ContactId']}})['then'](handleEntityNotFound(_0x5e4fa7,null))[_0x7a5d('0x22')](function(_0x5cc344){if(_0x5cc344){return _0x5cc344;}return null;})[_0x7a5d('0x22')](respondWithResult(_0x5e4fa7,null))['catch'](handleError(_0x5e4fa7,null));};
\ No newline at end of file
+var _0xa6ce=['intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','name','options','include','findAll','rows','catch','show','params','includeAll','describe','update','body','uniqueid','find','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','scheduledAt','ContactId','createdAt','select','field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','fromQuery','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','VoiceQueueId','html-pdf','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','end','stack','index','map','CmHopperFinal','rawAttributes','fieldName','key','model','keys','query','filters'];(function(_0x11b237,_0x39a1dd){var _0x1cb7bf=function(_0x287d22){while(--_0x287d22){_0x11b237['push'](_0x11b237['shift']());}};_0x1cb7bf(++_0x39a1dd);}(_0xa6ce,0x15e));var _0xea6c=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0xa6ce[_0x188d31];return _0x30ed33;};'use strict';var pdf=require(_0xea6c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xea6c('0x1'));var zipdir=require(_0xea6c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea6c('0x3'));var moment=require(_0xea6c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea6c('0x5'));var path=require(_0xea6c('0x6'));var sox=require(_0xea6c('0x7'));var csv=require(_0xea6c('0x8'));var ejs=require(_0xea6c('0x9'));var fs=require('fs');var _=require(_0xea6c('0xa'));var squel=require('squel');var crypto=require(_0xea6c('0xb'));var jsforce=require(_0xea6c('0xc'));var deskjs=require(_0xea6c('0xd'));var toCsv=require(_0xea6c('0x8'));var querystring=require(_0xea6c('0xe'));var Papa=require(_0xea6c('0xf'));var Redis=require(_0xea6c('0x10'));var authService=require(_0xea6c('0x11'));var qs=require(_0xea6c('0x12'));var as=require(_0xea6c('0x13'));var hardwareService=require(_0xea6c('0x14'));var logger=require(_0xea6c('0x15'))(_0xea6c('0x16'));var utils=require(_0xea6c('0x17'));var config=require('../../config/environment');var db=require(_0xea6c('0x18'))['db'];function respondWithStatusCode(_0x1b28ac,_0x36c0a8){_0x36c0a8=_0x36c0a8||0xcc;return function(_0x5a7dcd){if(_0x5a7dcd){return _0x1b28ac[_0xea6c('0x19')](_0x36c0a8);}return _0x1b28ac[_0xea6c('0x1a')](_0x36c0a8)['end']();};}function respondWithResult(_0x3dba01,_0x3a0a37){_0x3a0a37=_0x3a0a37||0xc8;return function(_0x13fd94){if(_0x13fd94){return _0x3dba01[_0xea6c('0x1a')](_0x3a0a37)[_0xea6c('0x1b')](_0x13fd94);}};}function respondWithFilteredResult(_0x748e7,_0x5a51f9){return function(_0x43cf5b){if(_0x43cf5b){var _0x4f9c92=_0x43cf5b[_0xea6c('0x1c')],_0x25b150=_0x5a51f9[_0xea6c('0x1d')],_0x6499ed=_0x5a51f9['offset']+_0x5a51f9[_0xea6c('0x1e')],_0x12768a;if(_0x6499ed>=_0x4f9c92){_0x6499ed=_0x4f9c92;_0x12768a=0xc8;}else{_0x12768a=0xce;}_0x748e7[_0xea6c('0x1a')](_0x12768a);return _0x748e7[_0xea6c('0x1f')](_0xea6c('0x20'),_0x25b150+'-'+_0x6499ed+'/'+_0x4f9c92)[_0xea6c('0x1b')](_0x43cf5b);}return null;};}function patchUpdates(_0x257707){return function(_0x43a03a){try{jsonpatch[_0xea6c('0x21')](_0x43a03a,_0x257707,!![]);}catch(_0x14eec5){return BPromise[_0xea6c('0x22')](_0x14eec5);}return _0x43a03a['save']();};}function saveUpdates(_0x4043c8,_0x490ad5){return function(_0x34bf0c){if(_0x34bf0c){return _0x34bf0c['update'](_0x4043c8)[_0xea6c('0x23')](function(_0x341139){return _0x341139;});}return null;};}function removeEntity(_0x1d3eca,_0x539b63){return function(_0x417cfa){if(_0x417cfa){return _0x417cfa[_0xea6c('0x24')]()['then'](function(){_0x1d3eca['status'](0xcc)[_0xea6c('0x25')]();});}};}function handleEntityNotFound(_0x53d94c,_0x540406){return function(_0x270ce7){if(!_0x270ce7){_0x53d94c[_0xea6c('0x19')](0x194);}return _0x270ce7;};}function handleError(_0x3e0864,_0x10a229){_0x10a229=_0x10a229||0x1f4;return function(_0x303303){logger['error'](_0x303303[_0xea6c('0x26')]);if(_0x303303['name']){delete _0x303303['name'];}_0x3e0864[_0xea6c('0x1a')](_0x10a229)['send'](_0x303303);};}exports[_0xea6c('0x27')]=function(_0x43ca90,_0x4dcd26){var _0x269b48={},_0x156832={},_0x110d56={'count':0x0,'rows':[]};var _0xcdb1a=_[_0xea6c('0x28')](db[_0xea6c('0x29')][_0xea6c('0x2a')],function(_0x15327f){return{'name':_0x15327f[_0xea6c('0x2b')],'type':_0x15327f['type'][_0xea6c('0x2c')]};});_0x156832[_0xea6c('0x2d')]=_['map'](_0xcdb1a,'name');_0x156832['query']=_[_0xea6c('0x2e')](_0x43ca90[_0xea6c('0x2f')]);_0x156832[_0xea6c('0x30')]=_[_0xea6c('0x31')](_0x156832[_0xea6c('0x2d')],_0x156832[_0xea6c('0x2f')]);_0x269b48[_0xea6c('0x32')]=_[_0xea6c('0x31')](_0x156832[_0xea6c('0x2d')],qs['fields'](_0x43ca90[_0xea6c('0x2f')][_0xea6c('0x33')]));_0x269b48[_0xea6c('0x32')]=_0x269b48[_0xea6c('0x32')][_0xea6c('0x34')]?_0x269b48[_0xea6c('0x32')]:_0x156832['model'];if(!_0x43ca90[_0xea6c('0x2f')][_0xea6c('0x35')]('nolimit')){_0x269b48[_0xea6c('0x1e')]=qs[_0xea6c('0x1e')](_0x43ca90[_0xea6c('0x2f')]['limit']);_0x269b48['offset']=qs['offset'](_0x43ca90['query']['offset']);}_0x269b48[_0xea6c('0x36')]=qs[_0xea6c('0x37')](_0x43ca90[_0xea6c('0x2f')][_0xea6c('0x37')]);_0x269b48['where']=qs[_0xea6c('0x30')](_[_0xea6c('0x38')](_0x43ca90[_0xea6c('0x2f')],_0x156832['filters']),_0xcdb1a);if(_0x43ca90[_0xea6c('0x2f')][_0xea6c('0x39')]){_0x269b48['where']=_[_0xea6c('0x3a')](_0x269b48[_0xea6c('0x3b')],{'$or':_[_0xea6c('0x28')](_0xcdb1a,function(_0x261082){if(_0x261082[_0xea6c('0x3c')]!==_0xea6c('0x3d')){var _0x1fbb3d={};_0x1fbb3d[_0x261082[_0xea6c('0x3e')]]={'$like':'%'+_0x43ca90[_0xea6c('0x2f')][_0xea6c('0x39')]+'%'};return _0x1fbb3d;}})});}_0x269b48=_[_0xea6c('0x3a')]({},_0x269b48,_0x43ca90[_0xea6c('0x3f')]);var _0x50e171={'where':_0x269b48[_0xea6c('0x3b')]};return db['CmHopperFinal'][_0xea6c('0x1c')](_0x50e171)[_0xea6c('0x23')](function(_0x328934){_0x110d56[_0xea6c('0x1c')]=_0x328934;if(_0x43ca90[_0xea6c('0x2f')]['includeAll']){_0x269b48[_0xea6c('0x40')]=[{'all':!![]}];}return db[_0xea6c('0x29')][_0xea6c('0x41')](_0x269b48);})['then'](function(_0x50a1df){_0x110d56[_0xea6c('0x42')]=_0x50a1df;return _0x110d56;})['then'](respondWithFilteredResult(_0x4dcd26,_0x269b48))[_0xea6c('0x43')](handleError(_0x4dcd26,null));};exports[_0xea6c('0x44')]=function(_0x2b74db,_0x2eda5b){var _0x595195={'raw':!![],'where':{'id':_0x2b74db[_0xea6c('0x45')]['id']}},_0x7440eb={};_0x7440eb[_0xea6c('0x2d')]=_['keys'](db[_0xea6c('0x29')]['rawAttributes']);_0x7440eb[_0xea6c('0x2f')]=_[_0xea6c('0x2e')](_0x2b74db['query']);_0x7440eb[_0xea6c('0x30')]=_[_0xea6c('0x31')](_0x7440eb[_0xea6c('0x2d')],_0x7440eb[_0xea6c('0x2f')]);_0x595195[_0xea6c('0x32')]=_[_0xea6c('0x31')](_0x7440eb['model'],qs[_0xea6c('0x33')](_0x2b74db[_0xea6c('0x2f')][_0xea6c('0x33')]));_0x595195[_0xea6c('0x32')]=_0x595195[_0xea6c('0x32')][_0xea6c('0x34')]?_0x595195[_0xea6c('0x32')]:_0x7440eb[_0xea6c('0x2d')];if(_0x2b74db[_0xea6c('0x2f')][_0xea6c('0x46')]){_0x595195[_0xea6c('0x40')]=[{'all':!![]}];}_0x595195=_[_0xea6c('0x3a')]({},_0x595195,_0x2b74db[_0xea6c('0x3f')]);return db[_0xea6c('0x29')]['find'](_0x595195)[_0xea6c('0x23')](handleEntityNotFound(_0x2eda5b,null))[_0xea6c('0x23')](respondWithResult(_0x2eda5b,null))['catch'](handleError(_0x2eda5b,null));};exports['describe']=function(_0x280107,_0x9b1a2e){return db[_0xea6c('0x29')][_0xea6c('0x47')]()[_0xea6c('0x23')](respondWithResult(_0x9b1a2e,null))[_0xea6c('0x43')](handleError(_0x9b1a2e,null));};exports[_0xea6c('0x48')]=function(_0x2ad357,_0x228828){if(_0x2ad357[_0xea6c('0x49')]['uniqueid']){delete _0x2ad357['body'][_0xea6c('0x4a')];}return db[_0xea6c('0x29')][_0xea6c('0x4b')]({'where':{'uniqueid':_0x2ad357['params']['id']}})[_0xea6c('0x23')](handleEntityNotFound(_0x228828,null))['then'](saveUpdates(_0x2ad357[_0xea6c('0x49')],null))[_0xea6c('0x23')](respondWithResult(_0x228828,null))[_0xea6c('0x43')](handleError(_0x228828,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x2ca3fb,_0x4c146a,_0x128dc8){return db[_0xea6c('0x29')][_0xea6c('0x41')]({'raw':![],'where':{'VoiceQueueId':_0x2ca3fb[_0xea6c('0x45')]['id']},'attributes':[[db[_0xea6c('0x4c')]['fn'](_0xea6c('0x4d'),db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')][_0xea6c('0x4e')](_0xea6c('0x4f')))),_0xea6c('0x50')],[db[_0xea6c('0x4c')]['fn'](_0xea6c('0x4d'),db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')][_0xea6c('0x4e')](_0xea6c('0x51')))),_0xea6c('0x52')],[db[_0xea6c('0x4c')]['fn'](_0xea6c('0x4d'),db[_0xea6c('0x4c')]['fn']('IF',db['sequelize'][_0xea6c('0x4e')](_0xea6c('0x53')))),_0xea6c('0x54')],[db[_0xea6c('0x4c')]['fn'](_0xea6c('0x4d'),db[_0xea6c('0x4c')]['fn']('IF',db['sequelize'][_0xea6c('0x4e')](_0xea6c('0x55')))),_0xea6c('0x56')],[db[_0xea6c('0x4c')]['fn'](_0xea6c('0x4d'),db[_0xea6c('0x4c')]['fn']('IF',db['sequelize'][_0xea6c('0x4e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xea6c('0x57')],[db[_0xea6c('0x4c')]['fn']('COUNT',db[_0xea6c('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xea6c('0x58')))),_0xea6c('0x59')],[db[_0xea6c('0x4c')]['fn'](_0xea6c('0x4d'),db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')][_0xea6c('0x4e')](_0xea6c('0x5a')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')][_0xea6c('0x4e')](_0xea6c('0x5b')))),_0xea6c('0x5c')]]})[_0xea6c('0x23')](handleEntityNotFound(_0x4c146a,null))['then'](respondWithResult(_0x4c146a,null))[_0xea6c('0x43')](handleError(_0x4c146a,null));};exports[_0xea6c('0x5d')]=function(_0xfe9ba8,_0x2bb0f4,_0x4fc9f3){return db[_0xea6c('0x29')][_0xea6c('0x41')]({'raw':![],'where':{'CampaignId':_0xfe9ba8['params']['id']},'attributes':[[db['sequelize']['fn'](_0xea6c('0x4d'),db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')][_0xea6c('0x4e')](_0xea6c('0x4f')))),_0xea6c('0x50')],[db[_0xea6c('0x4c')]['fn'](_0xea6c('0x4d'),db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')][_0xea6c('0x4e')](_0xea6c('0x51')))),_0xea6c('0x52')],[db[_0xea6c('0x4c')]['fn']('COUNT',db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')]['literal'](_0xea6c('0x53')))),'busyContacts'],[db[_0xea6c('0x4c')]['fn']('COUNT',db[_0xea6c('0x4c')]['fn']('IF',db['sequelize'][_0xea6c('0x4e')](_0xea6c('0x55')))),'congestionContacts'],[db[_0xea6c('0x4c')]['fn']('COUNT',db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')]['literal'](_0xea6c('0x5e')))),_0xea6c('0x57')],[db[_0xea6c('0x4c')]['fn'](_0xea6c('0x4d'),db['sequelize']['fn']('IF',db[_0xea6c('0x4c')][_0xea6c('0x4e')](_0xea6c('0x58')))),_0xea6c('0x59')],[db[_0xea6c('0x4c')]['fn']('COUNT',db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')][_0xea6c('0x4e')](_0xea6c('0x5a')))),_0xea6c('0x5f')],[db[_0xea6c('0x4c')]['fn']('COUNT',db[_0xea6c('0x4c')]['fn']('IF',db[_0xea6c('0x4c')][_0xea6c('0x4e')](_0xea6c('0x5b')))),_0xea6c('0x5c')]]})[_0xea6c('0x23')](handleEntityNotFound(_0x2bb0f4,null))['then'](respondWithResult(_0x2bb0f4,null))['catch'](handleError(_0x2bb0f4,null));};exports[_0xea6c('0x60')]=function(_0x451f43,_0x23bfbf,_0x383425){return db[_0xea6c('0x61')][_0xea6c('0x4b')]({'where':{'id':_0x451f43['params']['id']}})[_0xea6c('0x23')](handleEntityNotFound(_0x23bfbf,null))[_0xea6c('0x23')](function(_0x1f0b5f){var _0x3f066a;if(_0x1f0b5f){_0x3f066a=squel[_0xea6c('0x62')]()['into'](_0xea6c('0x63'))['fromQuery'](['phone',_0xea6c('0x64'),_0xea6c('0x65'),'ListId','VoiceQueueId',_0xea6c('0x66'),'updatedAt'],squel[_0xea6c('0x67')]()[_0xea6c('0x68')]('ANY_VALUE(calleridnum)',_0xea6c('0x69'))[_0xea6c('0x68')](_0xea6c('0x6a'),'scheduledAt')[_0xea6c('0x68')](_0xea6c('0x6b'),'ContactId')[_0xea6c('0x68')](_0xea6c('0x6c'),_0xea6c('0x6d'))[_0xea6c('0x68')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0xea6c('0x68')](_0xea6c('0x6a'),_0xea6c('0x66'))[_0xea6c('0x68')](_0xea6c('0x6a'),_0xea6c('0x6e'))[_0xea6c('0x6f')](_0xea6c('0x70'))['where'](_0xea6c('0x71'),_0x451f43[_0xea6c('0x45')]['id']['toString']())['where'](_0xea6c('0x72'),_0x451f43['body'][_0xea6c('0x73')][_0xea6c('0x74')]())[_0xea6c('0x3b')](_0xea6c('0x75'))[_0xea6c('0x3b')](_0xea6c('0x76'),squel['select']()[_0xea6c('0x68')](_0xea6c('0x69'))[_0xea6c('0x6f')](_0xea6c('0x63'))[_0xea6c('0x3b')](_0xea6c('0x71'),_0x451f43[_0xea6c('0x45')]['id'][_0xea6c('0x74')]()))[_0xea6c('0x3b')](_0xea6c('0x76'),squel[_0xea6c('0x67')]()[_0xea6c('0x68')](_0xea6c('0x77'))['from'](_0xea6c('0x70'))[_0xea6c('0x3b')](_0xea6c('0x71'),_0x451f43[_0xea6c('0x45')]['id']['toString']())[_0xea6c('0x3b')](_0xea6c('0x78')))[_0xea6c('0x79')]('ContactId'))['toString']();return db[_0xea6c('0x4c')][_0xea6c('0x2f')](_0x3f066a);}return[];})[_0xea6c('0x23')](respondWithResult(_0x23bfbf,null))[_0xea6c('0x43')](handleError(_0x23bfbf,null));};exports[_0xea6c('0x7a')]=function(_0x38bc2d,_0x561a91,_0x129028){return db[_0xea6c('0x7b')][_0xea6c('0x4b')]({'where':{'id':_0x38bc2d[_0xea6c('0x45')]['id']}})[_0xea6c('0x23')](handleEntityNotFound(_0x561a91,null))[_0xea6c('0x23')](function(_0x4d16b4){var _0x44aef6;if(_0x4d16b4){_0x44aef6=squel[_0xea6c('0x62')]()[_0xea6c('0x7c')](_0xea6c('0x63'))[_0xea6c('0x7d')]([_0xea6c('0x69'),'scheduledAt',_0xea6c('0x65'),_0xea6c('0x6d'),_0xea6c('0x7e'),'createdAt',_0xea6c('0x6e')],squel[_0xea6c('0x67')]()[_0xea6c('0x68')](_0xea6c('0x7f'),_0xea6c('0x69'))[_0xea6c('0x68')](_0xea6c('0x6a'),_0xea6c('0x64'))['field'](_0xea6c('0x6b'),'ContactId')[_0xea6c('0x68')](_0xea6c('0x6c'),_0xea6c('0x6d'))[_0xea6c('0x68')](_0xea6c('0x80'),_0xea6c('0x7e'))[_0xea6c('0x68')](_0xea6c('0x6a'),_0xea6c('0x66'))['field'](_0xea6c('0x6a'),'updatedAt')[_0xea6c('0x6f')]('cm_hopper_final')['where'](_0xea6c('0x81'),_0x38bc2d[_0xea6c('0x45')]['id'][_0xea6c('0x74')]())[_0xea6c('0x3b')](_0xea6c('0x72'),_0x38bc2d[_0xea6c('0x49')]['state']['toString']())[_0xea6c('0x3b')](_0xea6c('0x75'))[_0xea6c('0x3b')](_0xea6c('0x76'),squel[_0xea6c('0x67')]()[_0xea6c('0x68')](_0xea6c('0x69'))[_0xea6c('0x6f')](_0xea6c('0x63'))['where'](_0xea6c('0x81'),_0x38bc2d[_0xea6c('0x45')]['id'][_0xea6c('0x74')]()))[_0xea6c('0x3b')](_0xea6c('0x76'),squel[_0xea6c('0x67')]()['field'](_0xea6c('0x77'))[_0xea6c('0x6f')](_0xea6c('0x70'))[_0xea6c('0x3b')](_0xea6c('0x81'),_0x38bc2d[_0xea6c('0x45')]['id'][_0xea6c('0x74')]())[_0xea6c('0x3b')](_0xea6c('0x78')))[_0xea6c('0x79')](_0xea6c('0x65')))[_0xea6c('0x74')]();return db[_0xea6c('0x4c')][_0xea6c('0x2f')](_0x44aef6);}return[];})[_0xea6c('0x23')](respondWithResult(_0x561a91,null))[_0xea6c('0x43')](handleError(_0x561a91,null));};exports[_0xea6c('0x82')]=function(_0x181a08,_0x42018e,_0x34b903){return db['CmHopper'][_0xea6c('0x83')]({'where':{'VoiceQueueId':_0x181a08[_0xea6c('0x49')][_0xea6c('0x84')],'CampaignId':_0x181a08[_0xea6c('0x49')]['CampaignId'],'ContactId':_0x181a08[_0xea6c('0x49')][_0xea6c('0x65')]}})[_0xea6c('0x23')](handleEntityNotFound(_0x42018e,null))['then'](function(_0x52d9fe){if(_0x52d9fe){return _0x52d9fe;}return null;})['then'](respondWithResult(_0x42018e,null))[_0xea6c('0x43')](handleError(_0x42018e,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js
index b9df721..f9870c2 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.model.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d4a=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x48cd72,_0x1f32e1){var _0x5832b7=function(_0x5f0f80){while(--_0x5f0f80){_0x48cd72['push'](_0x48cd72['shift']());}};_0x5832b7(++_0x1f32e1);}(_0x6d4a,0x117));var _0xa6d4=function(_0x1a45ae,_0x9b429f){_0x1a45ae=_0x1a45ae-0x0;var _0x5162c0=_0x6d4a[_0x1a45ae];return _0x5162c0;};'use strict';var _=require(_0xa6d4('0x0'));var util=require('util');var logger=require(_0xa6d4('0x1'))(_0xa6d4('0x2'));var moment=require(_0xa6d4('0x3'));var BPromise=require(_0xa6d4('0x4'));var rp=require(_0xa6d4('0x5'));var fs=require('fs');var path=require(_0xa6d4('0x6'));var rimraf=require(_0xa6d4('0x7'));var config=require(_0xa6d4('0x8'));var attributes=require(_0xa6d4('0x9'));module[_0xa6d4('0xa')]=function(_0x25a720,_0xe6dda6){return _0x25a720[_0xa6d4('0xb')](_0xa6d4('0xc'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xa6d4('0xd'),'fields':[_0xa6d4('0xd')]},{'name':'uniqueid','fields':[_0xa6d4('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6921=['request-promise','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','api','bluebird'];(function(_0x1eacfb,_0x2c3a86){var _0x2ce0a6=function(_0x285955){while(--_0x285955){_0x1eacfb['push'](_0x1eacfb['shift']());}};_0x2ce0a6(++_0x2c3a86);}(_0x6921,0x1d1));var _0x1692=function(_0x25aa6a,_0x2eb4cc){_0x25aa6a=_0x25aa6a-0x0;var _0x370f60=_0x6921[_0x25aa6a];return _0x370f60;};'use strict';var _=require('lodash');var util=require(_0x1692('0x0'));var logger=require('../../config/logger')(_0x1692('0x1'));var moment=require('moment');var BPromise=require(_0x1692('0x2'));var rp=require(_0x1692('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1692('0x4'));var config=require('../../config/environment');var attributes=require(_0x1692('0x5'));module[_0x1692('0x6')]=function(_0x15f20e,_0x14fbfe){return _0x15f20e[_0x1692('0x7')](_0x1692('0x8'),attributes,{'tableName':_0x1692('0x9'),'paranoid':![],'indexes':[{'name':_0x1692('0xa'),'fields':[_0x1692('0xa')]},{'name':_0x1692('0xb'),'fields':[_0x1692('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js
index a21e302..f3b8d9f 100644
--- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js
+++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd2af=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperFinal','create','body','options','raw','stringify','lodash'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd2af,0x185));var _0xfd2a=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xd2af[_0x1d8119];return _0x3e30f6;};'use strict';var _=require(_0xfd2a('0x0'));var util=require(_0xfd2a('0x1'));var moment=require(_0xfd2a('0x2'));var BPromise=require(_0xfd2a('0x3'));var rs=require(_0xfd2a('0x4'));var fs=require('fs');var Redis=require(_0xfd2a('0x5'));var db=require(_0xfd2a('0x6'))['db'];var utils=require(_0xfd2a('0x7'));var logger=require(_0xfd2a('0x8'))('rpc');var config=require(_0xfd2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfd2a('0xa')][_0xfd2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x587018,_0x5e3cad,_0x39c4f9){return new BPromise(function(_0x216ef4,_0x2cbbe3){return client[_0xfd2a('0xc')](_0x587018,_0x39c4f9)[_0xfd2a('0xd')](function(_0x226807){logger[_0xfd2a('0xe')](_0xfd2a('0xf'),_0x5e3cad,_0xfd2a('0x10'));logger[_0xfd2a('0x11')](_0xfd2a('0x12'),_0x5e3cad,_0xfd2a('0x10'),JSON['stringify'](_0x226807));if(_0x226807['error']){if(_0x226807[_0xfd2a('0x13')][_0xfd2a('0x14')]===0x1f4){logger[_0xfd2a('0x13')](_0xfd2a('0xf'),_0x5e3cad,_0x226807[_0xfd2a('0x13')][_0xfd2a('0x15')]);return _0x2cbbe3(_0x226807['error'][_0xfd2a('0x15')]);}logger['error'](_0xfd2a('0xf'),_0x5e3cad,_0x226807['error'][_0xfd2a('0x15')]);return _0x216ef4(_0x226807[_0xfd2a('0x13')]['message']);}else{logger[_0xfd2a('0xe')](_0xfd2a('0xf'),_0x5e3cad,_0xfd2a('0x10'));_0x216ef4(_0x226807[_0xfd2a('0x16')][_0xfd2a('0x15')]);}})[_0xfd2a('0x17')](function(_0x4ed743){logger[_0xfd2a('0x13')](_0xfd2a('0xf'),_0x5e3cad,_0x4ed743);_0x2cbbe3(_0x4ed743);});});}exports[_0xfd2a('0x18')]=function(_0x324dba){var _0x480dbc=this;return new Promise(function(_0x342e0f,_0x4bcbc6){return db['CmHopperFinal'][_0xfd2a('0x19')](_0x324dba[_0xfd2a('0x1a')],{'raw':_0x324dba[_0xfd2a('0x1b')]?_0x324dba[_0xfd2a('0x1b')][_0xfd2a('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x20bbb3){logger[_0xfd2a('0xe')]('CreateCmHopperFinal',_0x324dba);logger['debug'](_0xfd2a('0x18'),_0x324dba,JSON[_0xfd2a('0x1d')](_0x20bbb3));_0x342e0f(_0x20bbb3);})[_0xfd2a('0x17')](function(_0x5554ca){logger[_0xfd2a('0x13')]('CreateCmHopperFinal',_0x5554ca['message'],_0x324dba);_0x4bcbc6(_0x480dbc[_0xfd2a('0x13')](0x1f4,_0x5554ca[_0xfd2a('0x15')]));});});};
\ No newline at end of file
+var _0x52fa=['moment','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateCmHopperFinal','create','raw','lodash','util'];(function(_0x438fa9,_0x1ed4b2){var _0x84b22=function(_0x22c433){while(--_0x22c433){_0x438fa9['push'](_0x438fa9['shift']());}};_0x84b22(++_0x1ed4b2);}(_0x52fa,0x82));var _0xa52f=function(_0x5a9a7e,_0x316413){_0x5a9a7e=_0x5a9a7e-0x0;var _0x34dd51=_0x52fa[_0x5a9a7e];return _0x34dd51;};'use strict';var _=require(_0xa52f('0x0'));var util=require(_0xa52f('0x1'));var moment=require(_0xa52f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa52f('0x3'));var db=require(_0xa52f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa52f('0x5'));var config=require(_0xa52f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa52f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x449efd,_0x22be8c,_0xc5d6bd){return new BPromise(function(_0x30e7ab,_0x4e739b){return client[_0xa52f('0x8')](_0x449efd,_0xc5d6bd)[_0xa52f('0x9')](function(_0x42e0f5){logger[_0xa52f('0xa')](_0xa52f('0xb'),_0x22be8c,_0xa52f('0xc'));logger[_0xa52f('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x22be8c,_0xa52f('0xc'),JSON[_0xa52f('0xe')](_0x42e0f5));if(_0x42e0f5[_0xa52f('0xf')]){if(_0x42e0f5[_0xa52f('0xf')]['code']===0x1f4){logger['error'](_0xa52f('0xb'),_0x22be8c,_0x42e0f5[_0xa52f('0xf')][_0xa52f('0x10')]);return _0x4e739b(_0x42e0f5[_0xa52f('0xf')][_0xa52f('0x10')]);}logger[_0xa52f('0xf')](_0xa52f('0xb'),_0x22be8c,_0x42e0f5[_0xa52f('0xf')][_0xa52f('0x10')]);return _0x30e7ab(_0x42e0f5['error'][_0xa52f('0x10')]);}else{logger['info'](_0xa52f('0xb'),_0x22be8c,_0xa52f('0xc'));_0x30e7ab(_0x42e0f5[_0xa52f('0x11')][_0xa52f('0x10')]);}})[_0xa52f('0x12')](function(_0x88aefb){logger['error'](_0xa52f('0xb'),_0x22be8c,_0x88aefb);_0x4e739b(_0x88aefb);});});}exports[_0xa52f('0x13')]=function(_0x2b5bce){var _0x531669=this;return new Promise(function(_0x56b723,_0x55803b){return db['CmHopperFinal'][_0xa52f('0x14')](_0x2b5bce['body'],{'raw':_0x2b5bce['options']?_0x2b5bce['options'][_0xa52f('0x15')]===undefined?!![]:![]:!![]})[_0xa52f('0x9')](function(_0x5cd49e){logger[_0xa52f('0xa')](_0xa52f('0x13'),_0x2b5bce);logger[_0xa52f('0xd')]('CreateCmHopperFinal',_0x2b5bce,JSON[_0xa52f('0xe')](_0x5cd49e));_0x56b723(_0x5cd49e);})['catch'](function(_0x10ab0a){logger[_0xa52f('0xf')]('CreateCmHopperFinal',_0x10ab0a['message'],_0x2b5bce);_0x55803b(_0x531669[_0xa52f('0xf')](0x1f4,_0x10ab0a[_0xa52f('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js
index 02dfb4c..bfe4762 100644
--- a/server/api/cmHopperFinal/index.js
+++ b/server/api/cmHopperFinal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00b7=['../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/:id','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','exports','multer','express','Router'];(function(_0x3c46fc,_0x54d0e9){var _0x36a6e1=function(_0x44cafb){while(--_0x44cafb){_0x3c46fc['push'](_0x3c46fc['shift']());}};_0x36a6e1(++_0x54d0e9);}(_0x00b7,0x10e));var _0x700b=function(_0x170831,_0x510b7b){_0x170831=_0x170831-0x0;var _0x50ec6e=_0x00b7[_0x170831];return _0x50ec6e;};'use strict';var multer=require(_0x700b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x700b('0x1'));var router=express[_0x700b('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x700b('0x3'));var config=require(_0x700b('0x4'));var controller=require(_0x700b('0x5'));router[_0x700b('0x6')]('/',auth[_0x700b('0x7')](),controller[_0x700b('0x8')]);router[_0x700b('0x6')]('/describe',auth[_0x700b('0x7')](),controller['describe']);router[_0x700b('0x6')](_0x700b('0x9'),auth[_0x700b('0x7')](),controller['show']);router[_0x700b('0x6')](_0x700b('0xa'),auth[_0x700b('0x7')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x700b('0x6')](_0x700b('0xb'),auth[_0x700b('0x7')](),controller[_0x700b('0xc')]);router[_0x700b('0xd')](_0x700b('0xe'),auth[_0x700b('0x7')](),controller[_0x700b('0xf')]);router[_0x700b('0xd')](_0x700b('0x10'),auth['isAuthenticated'](),controller[_0x700b('0x11')]);router[_0x700b('0xd')](_0x700b('0x12'),auth[_0x700b('0x7')](),controller['checkContactHopper']);router[_0x700b('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0x700b('0x14')]=router;
\ No newline at end of file
+var _0x73d1=['/voice/queue/countAttributes/:id','isAuthenticated','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','connect-timeout','Router','../../config/environment','./cmHopperFinal.controller','get','/describe','/:id','show'];(function(_0x27567e,_0x2f60b0){var _0xb71bfe=function(_0x3929d5){while(--_0x3929d5){_0x27567e['push'](_0x27567e['shift']());}};_0xb71bfe(++_0x2f60b0);}(_0x73d1,0x1c4));var _0x173d=function(_0x477bcb,_0x3ef4d5){_0x477bcb=_0x477bcb-0x0;var _0x341946=_0x73d1[_0x477bcb];return _0x341946;};'use strict';var multer=require(_0x173d('0x0'));var util=require(_0x173d('0x1'));var path=require('path');var timeout=require(_0x173d('0x2'));var express=require('express');var router=express[_0x173d('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x173d('0x4'));var controller=require(_0x173d('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x173d('0x6')](_0x173d('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x173d('0x6')](_0x173d('0x8'),auth['isAuthenticated'](),controller[_0x173d('0x9')]);router[_0x173d('0x6')](_0x173d('0xa'),auth[_0x173d('0xb')](),controller[_0x173d('0xc')]);router[_0x173d('0x6')](_0x173d('0xd'),auth[_0x173d('0xb')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x173d('0xe')](_0x173d('0xf'),auth[_0x173d('0xb')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x173d('0xe')]('/voice/campaign/moveContacts/:id',auth[_0x173d('0xb')](),controller[_0x173d('0x10')]);router[_0x173d('0xe')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x173d('0x11')]);router[_0x173d('0x12')](_0x173d('0x8'),auth[_0x173d('0xb')](),controller[_0x173d('0x13')]);module[_0x173d('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js
index d880e92..99ac2fd 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.attributes.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde4d=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x14ee69,_0x436a8a){var _0x4d5664=function(_0x3e69bc){while(--_0x3e69bc){_0x14ee69['push'](_0x14ee69['shift']());}};_0x4d5664(++_0x436a8a);}(_0xde4d,0xe7));var _0xdde4=function(_0x20e74a,_0x12523e){_0x20e74a=_0x20e74a-0x0;var _0x358679=_0xde4d[_0x20e74a];return _0x358679;};'use strict';var Sequelize=require(_0xdde4('0x0'));module[_0xdde4('0x1')]={'state':{'type':Sequelize[_0xdde4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xdde4('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdde4('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdde4('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdde4('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdde4('0x3')]},'starttime':{'type':Sequelize[_0xdde4('0x4')]},'responsetime':{'type':Sequelize[_0xdde4('0x4')]},'answertime':{'type':Sequelize[_0xdde4('0x4')]},'droptime':{'type':Sequelize[_0xdde4('0x4')]},'endtime':{'type':Sequelize[_0xdde4('0x4')]},'ringtime':{'type':Sequelize[_0xdde4('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdde4('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdde4('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdde4('0x3')]},'campaign':{'type':Sequelize[_0xdde4('0x3')]},'campaigntype':{'type':Sequelize[_0xdde4('0x3')]},'membername':{'type':Sequelize[_0xdde4('0x3')]},'reason':{'type':Sequelize[_0xdde4('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xdde4('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xdde4('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdde4('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xdde4('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdde4('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdde4('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdde4('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdde4('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xdde4('0x3')]}};
\ No newline at end of file
+var _0x5e07=['INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x20ea89,_0x1bfce6){var _0x1f06a8=function(_0xc541ce){while(--_0xc541ce){_0x20ea89['push'](_0x20ea89['shift']());}};_0x1f06a8(++_0x1bfce6);}(_0x5e07,0x149));var _0x75e0=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5e07[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0x75e0('0x0'));module['exports']={'state':{'type':Sequelize[_0x75e0('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x75e0('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x75e0('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x75e0('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x75e0('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x75e0('0x2')]},'originatecalleridname':{'type':Sequelize[_0x75e0('0x2')]},'calleridnum':{'type':Sequelize[_0x75e0('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x75e0('0x3')]},'responsetime':{'type':Sequelize[_0x75e0('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x75e0('0x3')]},'endtime':{'type':Sequelize[_0x75e0('0x3')]},'ringtime':{'type':Sequelize[_0x75e0('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x75e0('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x75e0('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x75e0('0x2')]},'campaign':{'type':Sequelize[_0x75e0('0x2')]},'campaigntype':{'type':Sequelize[_0x75e0('0x2')]},'membername':{'type':Sequelize[_0x75e0('0x2')]},'reason':{'type':Sequelize[_0x75e0('0x2')]},'amd':{'type':Sequelize[_0x75e0('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x75e0('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x75e0('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x75e0('0x3')]},'recallme':{'type':Sequelize[_0x75e0('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x75e0('0x3')]},'edited':{'type':Sequelize[_0x75e0('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x75e0('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x75e0('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x75e0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js
index aebc425..5b8ff24 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.controller.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x37ae=['json','offset','limit','status','set','Content-Range','apply','update','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','query','filters','attributes','intersection','model','fields','nolimit','order','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create','describe','body','uniqueid','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x549837,_0x55d66c){var _0x41621e=function(_0x2c6d17){while(--_0x2c6d17){_0x549837['push'](_0x549837['shift']());}};_0x41621e(++_0x55d66c);}(_0x37ae,0xfd));var _0xe37a=function(_0x2a276d,_0x482b0c){_0x2a276d=_0x2a276d-0x0;var _0x2914cd=_0x37ae[_0x2a276d];return _0x2914cd;};'use strict';var pdf=require(_0xe37a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe37a('0x1'));var zipdir=require(_0xe37a('0x2'));var jsonpatch=require(_0xe37a('0x3'));var rp=require(_0xe37a('0x4'));var moment=require('moment');var BPromise=require(_0xe37a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe37a('0x6'));var sox=require('sox');var csv=require(_0xe37a('0x7'));var ejs=require(_0xe37a('0x8'));var fs=require('fs');var _=require(_0xe37a('0x9'));var squel=require(_0xe37a('0xa'));var crypto=require('crypto');var jsforce=require(_0xe37a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe37a('0x7'));var querystring=require(_0xe37a('0xc'));var Papa=require(_0xe37a('0xd'));var Redis=require(_0xe37a('0xe'));var authService=require(_0xe37a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe37a('0x10'));var logger=require(_0xe37a('0x11'))('api');var utils=require(_0xe37a('0x12'));var config=require(_0xe37a('0x13'));var db=require(_0xe37a('0x14'))['db'];function respondWithStatusCode(_0x30ccf3,_0xe89dfc){_0xe89dfc=_0xe89dfc||0xcc;return function(_0x2f3a2b){if(_0x2f3a2b){return _0x30ccf3[_0xe37a('0x15')](_0xe89dfc);}return _0x30ccf3['status'](_0xe89dfc)[_0xe37a('0x16')]();};}function respondWithResult(_0x52944f,_0x2faa91){_0x2faa91=_0x2faa91||0xc8;return function(_0x4a7e18){if(_0x4a7e18){return _0x52944f['status'](_0x2faa91)[_0xe37a('0x17')](_0x4a7e18);}};}function respondWithFilteredResult(_0x2204b7,_0x2d66a5){return function(_0x320f6b){if(_0x320f6b){var _0x1dd7b3=_0x320f6b['count'],_0x2a36ff=_0x2d66a5['offset'],_0xedc446=_0x2d66a5[_0xe37a('0x18')]+_0x2d66a5[_0xe37a('0x19')],_0x257f4e;if(_0xedc446>=_0x1dd7b3){_0xedc446=_0x1dd7b3;_0x257f4e=0xc8;}else{_0x257f4e=0xce;}_0x2204b7[_0xe37a('0x1a')](_0x257f4e);return _0x2204b7[_0xe37a('0x1b')](_0xe37a('0x1c'),_0x2a36ff+'-'+_0xedc446+'/'+_0x1dd7b3)[_0xe37a('0x17')](_0x320f6b);}return null;};}function patchUpdates(_0x50e6be){return function(_0x49418b){try{jsonpatch[_0xe37a('0x1d')](_0x49418b,_0x50e6be,!![]);}catch(_0x5d4e8c){return BPromise['reject'](_0x5d4e8c);}return _0x49418b['save']();};}function saveUpdates(_0x2f5861,_0x1b2fe4){return function(_0x140a27){if(_0x140a27){return _0x140a27[_0xe37a('0x1e')](_0x2f5861)[_0xe37a('0x1f')](function(_0x1c7ae7){return _0x1c7ae7;});}return null;};}function removeEntity(_0x22e302,_0x5ab368){return function(_0x2d3bde){if(_0x2d3bde){return _0x2d3bde['destroy']()[_0xe37a('0x1f')](function(){_0x22e302[_0xe37a('0x1a')](0xcc)[_0xe37a('0x16')]();});}};}function handleEntityNotFound(_0x11b6bf,_0x29c929){return function(_0x551993){if(!_0x551993){_0x11b6bf[_0xe37a('0x15')](0x194);}return _0x551993;};}function handleError(_0x46ec33,_0x5e043a){_0x5e043a=_0x5e043a||0x1f4;return function(_0x15b00d){logger[_0xe37a('0x20')](_0x15b00d[_0xe37a('0x21')]);if(_0x15b00d[_0xe37a('0x22')]){delete _0x15b00d[_0xe37a('0x22')];}_0x46ec33['status'](_0x5e043a)[_0xe37a('0x23')](_0x15b00d);};}exports[_0xe37a('0x24')]=function(_0x5bbf16,_0x2f9855){var _0x17cd16={},_0x4f0dd3={},_0x12a58e={'count':0x0,'rows':[]};var _0x1b4aef=_[_0xe37a('0x25')](db[_0xe37a('0x26')][_0xe37a('0x27')],function(_0x513d87){return{'name':_0x513d87[_0xe37a('0x28')],'type':_0x513d87['type'][_0xe37a('0x29')]};});_0x4f0dd3['model']=_[_0xe37a('0x25')](_0x1b4aef,_0xe37a('0x22'));_0x4f0dd3['query']=_['keys'](_0x5bbf16[_0xe37a('0x2a')]);_0x4f0dd3[_0xe37a('0x2b')]=_['intersection'](_0x4f0dd3['model'],_0x4f0dd3[_0xe37a('0x2a')]);_0x17cd16[_0xe37a('0x2c')]=_[_0xe37a('0x2d')](_0x4f0dd3[_0xe37a('0x2e')],qs[_0xe37a('0x2f')](_0x5bbf16[_0xe37a('0x2a')][_0xe37a('0x2f')]));_0x17cd16[_0xe37a('0x2c')]=_0x17cd16[_0xe37a('0x2c')]['length']?_0x17cd16[_0xe37a('0x2c')]:_0x4f0dd3[_0xe37a('0x2e')];if(!_0x5bbf16['query']['hasOwnProperty'](_0xe37a('0x30'))){_0x17cd16[_0xe37a('0x19')]=qs[_0xe37a('0x19')](_0x5bbf16['query']['limit']);_0x17cd16['offset']=qs[_0xe37a('0x18')](_0x5bbf16['query'][_0xe37a('0x18')]);}_0x17cd16[_0xe37a('0x31')]=qs['sort'](_0x5bbf16[_0xe37a('0x2a')]['sort']);_0x17cd16['where']=qs['filters'](_[_0xe37a('0x32')](_0x5bbf16[_0xe37a('0x2a')],_0x4f0dd3['filters']),_0x1b4aef);if(_0x5bbf16[_0xe37a('0x2a')][_0xe37a('0x33')]){_0x17cd16[_0xe37a('0x34')]=_[_0xe37a('0x35')](_0x17cd16[_0xe37a('0x34')],{'$or':_[_0xe37a('0x25')](_0x1b4aef,function(_0x43fc10){if(_0x43fc10[_0xe37a('0x36')]!==_0xe37a('0x37')){var _0xd568d1={};_0xd568d1[_0x43fc10[_0xe37a('0x22')]]={'$like':'%'+_0x5bbf16[_0xe37a('0x2a')][_0xe37a('0x33')]+'%'};return _0xd568d1;}})});}_0x17cd16=_[_0xe37a('0x35')]({},_0x17cd16,_0x5bbf16[_0xe37a('0x38')]);var _0x904440={'where':_0x17cd16[_0xe37a('0x34')]};return db[_0xe37a('0x26')]['count'](_0x904440)[_0xe37a('0x1f')](function(_0x377244){_0x12a58e['count']=_0x377244;if(_0x5bbf16[_0xe37a('0x2a')][_0xe37a('0x39')]){_0x17cd16[_0xe37a('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xe37a('0x3b')](_0x17cd16);})[_0xe37a('0x1f')](function(_0x2c445d){_0x12a58e['rows']=_0x2c445d;return _0x12a58e;})[_0xe37a('0x1f')](respondWithFilteredResult(_0x2f9855,_0x17cd16))['catch'](handleError(_0x2f9855,null));};exports[_0xe37a('0x3c')]=function(_0x58d5c1,_0x213958){var _0x7e9ccb={'raw':!![],'where':{'id':_0x58d5c1[_0xe37a('0x3d')]['id']}},_0x5402fe={};_0x5402fe[_0xe37a('0x2e')]=_[_0xe37a('0x3e')](db[_0xe37a('0x26')][_0xe37a('0x27')]);_0x5402fe[_0xe37a('0x2a')]=_[_0xe37a('0x3e')](_0x58d5c1['query']);_0x5402fe['filters']=_[_0xe37a('0x2d')](_0x5402fe['model'],_0x5402fe[_0xe37a('0x2a')]);_0x7e9ccb[_0xe37a('0x2c')]=_[_0xe37a('0x2d')](_0x5402fe['model'],qs[_0xe37a('0x2f')](_0x58d5c1[_0xe37a('0x2a')][_0xe37a('0x2f')]));_0x7e9ccb[_0xe37a('0x2c')]=_0x7e9ccb[_0xe37a('0x2c')]['length']?_0x7e9ccb[_0xe37a('0x2c')]:_0x5402fe['model'];if(_0x58d5c1[_0xe37a('0x2a')][_0xe37a('0x39')]){_0x7e9ccb[_0xe37a('0x3a')]=[{'all':!![]}];}_0x7e9ccb=_[_0xe37a('0x35')]({},_0x7e9ccb,_0x58d5c1[_0xe37a('0x38')]);return db['CmHopperHistory'][_0xe37a('0x3f')](_0x7e9ccb)[_0xe37a('0x1f')](handleEntityNotFound(_0x213958,null))['then'](respondWithResult(_0x213958,null))[_0xe37a('0x40')](handleError(_0x213958,null));};exports['create']=function(_0x5f67ff,_0x2f9a9d){return db[_0xe37a('0x26')][_0xe37a('0x41')](_0x5f67ff['body'],{})[_0xe37a('0x1f')](respondWithResult(_0x2f9a9d,0xc9))[_0xe37a('0x40')](handleError(_0x2f9a9d,null));};exports[_0xe37a('0x42')]=function(_0x1bdf0f,_0x4b07f3){return db['CmHopperHistory'][_0xe37a('0x42')]()[_0xe37a('0x1f')](respondWithResult(_0x4b07f3,null))[_0xe37a('0x40')](handleError(_0x4b07f3,null));};exports[_0xe37a('0x1e')]=function(_0x131eff,_0x2968fb){if(_0x131eff[_0xe37a('0x43')][_0xe37a('0x44')]){delete _0x131eff['body']['uniqueid'];}return db[_0xe37a('0x26')][_0xe37a('0x3f')]({'where':{'uniqueid':_0x131eff['params']['id']}})[_0xe37a('0x1f')](handleEntityNotFound(_0x2968fb,null))[_0xe37a('0x1f')](saveUpdates(_0x131eff[_0xe37a('0x43')],null))[_0xe37a('0x1f')](respondWithResult(_0x2968fb,null))['catch'](handleError(_0x2968fb,null));};
\ No newline at end of file
+var _0x8152=['zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','CmHopperHistory','includeAll','include','findAll','catch','show','params','create','body','describe','uniqueid','find','html-pdf'];(function(_0x551be0,_0x3372c1){var _0x112d08=function(_0x4c82b9){while(--_0x4c82b9){_0x551be0['push'](_0x551be0['shift']());}};_0x112d08(++_0x3372c1);}(_0x8152,0xda));var _0x2815=function(_0x2c9eae,_0x53588b){_0x2c9eae=_0x2c9eae-0x0;var _0x388033=_0x8152[_0x2c9eae];return _0x388033;};'use strict';var pdf=require(_0x2815('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2815('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2815('0x2'));var moment=require(_0x2815('0x3'));var BPromise=require(_0x2815('0x4'));var Mustache=require(_0x2815('0x5'));var util=require('util');var path=require(_0x2815('0x6'));var sox=require('sox');var csv=require(_0x2815('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2815('0x8'));var crypto=require(_0x2815('0x9'));var jsforce=require(_0x2815('0xa'));var deskjs=require(_0x2815('0xb'));var toCsv=require(_0x2815('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2815('0xc'));var authService=require(_0x2815('0xd'));var qs=require(_0x2815('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2815('0xf'));var logger=require(_0x2815('0x10'))(_0x2815('0x11'));var utils=require(_0x2815('0x12'));var config=require(_0x2815('0x13'));var db=require(_0x2815('0x14'))['db'];function respondWithStatusCode(_0x1e9302,_0x3884b4){_0x3884b4=_0x3884b4||0xcc;return function(_0x131212){if(_0x131212){return _0x1e9302[_0x2815('0x15')](_0x3884b4);}return _0x1e9302['status'](_0x3884b4)[_0x2815('0x16')]();};}function respondWithResult(_0x2a5623,_0x304cbe){_0x304cbe=_0x304cbe||0xc8;return function(_0x3fa62a){if(_0x3fa62a){return _0x2a5623[_0x2815('0x17')](_0x304cbe)[_0x2815('0x18')](_0x3fa62a);}};}function respondWithFilteredResult(_0x51e42c,_0x3e5dcc){return function(_0xd8cfb2){if(_0xd8cfb2){var _0x384017=_0xd8cfb2[_0x2815('0x19')],_0x5c20ad=_0x3e5dcc[_0x2815('0x1a')],_0x22f8c8=_0x3e5dcc[_0x2815('0x1a')]+_0x3e5dcc['limit'],_0xc05d35;if(_0x22f8c8>=_0x384017){_0x22f8c8=_0x384017;_0xc05d35=0xc8;}else{_0xc05d35=0xce;}_0x51e42c[_0x2815('0x17')](_0xc05d35);return _0x51e42c[_0x2815('0x1b')](_0x2815('0x1c'),_0x5c20ad+'-'+_0x22f8c8+'/'+_0x384017)['json'](_0xd8cfb2);}return null;};}function patchUpdates(_0x2c7ce2){return function(_0x50778f){try{jsonpatch[_0x2815('0x1d')](_0x50778f,_0x2c7ce2,!![]);}catch(_0x32e2e9){return BPromise[_0x2815('0x1e')](_0x32e2e9);}return _0x50778f[_0x2815('0x1f')]();};}function saveUpdates(_0x24c620,_0x245c94){return function(_0x53485a){if(_0x53485a){return _0x53485a[_0x2815('0x20')](_0x24c620)['then'](function(_0x1ba94e){return _0x1ba94e;});}return null;};}function removeEntity(_0x3a174c,_0x2e1b61){return function(_0x1b891f){if(_0x1b891f){return _0x1b891f['destroy']()[_0x2815('0x21')](function(){_0x3a174c[_0x2815('0x17')](0xcc)[_0x2815('0x16')]();});}};}function handleEntityNotFound(_0x532b9f,_0x20bde5){return function(_0x318e3d){if(!_0x318e3d){_0x532b9f[_0x2815('0x15')](0x194);}return _0x318e3d;};}function handleError(_0x226973,_0x3fcac4){_0x3fcac4=_0x3fcac4||0x1f4;return function(_0x554f3d){logger[_0x2815('0x22')](_0x554f3d['stack']);if(_0x554f3d[_0x2815('0x23')]){delete _0x554f3d[_0x2815('0x23')];}_0x226973['status'](_0x3fcac4)[_0x2815('0x24')](_0x554f3d);};}exports[_0x2815('0x25')]=function(_0x37614a,_0x11a153){var _0x2d51fe={},_0x3cd493={},_0x40b293={'count':0x0,'rows':[]};var _0x489ed8=_[_0x2815('0x26')](db['CmHopperHistory'][_0x2815('0x27')],function(_0x2aa425){return{'name':_0x2aa425[_0x2815('0x28')],'type':_0x2aa425[_0x2815('0x29')][_0x2815('0x2a')]};});_0x3cd493[_0x2815('0x2b')]=_['map'](_0x489ed8,_0x2815('0x23'));_0x3cd493[_0x2815('0x2c')]=_[_0x2815('0x2d')](_0x37614a[_0x2815('0x2c')]);_0x3cd493[_0x2815('0x2e')]=_['intersection'](_0x3cd493[_0x2815('0x2b')],_0x3cd493[_0x2815('0x2c')]);_0x2d51fe[_0x2815('0x2f')]=_[_0x2815('0x30')](_0x3cd493[_0x2815('0x2b')],qs[_0x2815('0x31')](_0x37614a[_0x2815('0x2c')]['fields']));_0x2d51fe[_0x2815('0x2f')]=_0x2d51fe[_0x2815('0x2f')][_0x2815('0x32')]?_0x2d51fe[_0x2815('0x2f')]:_0x3cd493[_0x2815('0x2b')];if(!_0x37614a[_0x2815('0x2c')][_0x2815('0x33')](_0x2815('0x34'))){_0x2d51fe['limit']=qs[_0x2815('0x35')](_0x37614a[_0x2815('0x2c')][_0x2815('0x35')]);_0x2d51fe[_0x2815('0x1a')]=qs[_0x2815('0x1a')](_0x37614a[_0x2815('0x2c')][_0x2815('0x1a')]);}_0x2d51fe[_0x2815('0x36')]=qs[_0x2815('0x37')](_0x37614a[_0x2815('0x2c')][_0x2815('0x37')]);_0x2d51fe[_0x2815('0x38')]=qs['filters'](_[_0x2815('0x39')](_0x37614a[_0x2815('0x2c')],_0x3cd493['filters']),_0x489ed8);if(_0x37614a[_0x2815('0x2c')][_0x2815('0x3a')]){_0x2d51fe[_0x2815('0x38')]=_['merge'](_0x2d51fe[_0x2815('0x38')],{'$or':_[_0x2815('0x26')](_0x489ed8,function(_0x1c74f3){if(_0x1c74f3[_0x2815('0x29')]!=='VIRTUAL'){var _0x3fe017={};_0x3fe017[_0x1c74f3[_0x2815('0x23')]]={'$like':'%'+_0x37614a['query']['filter']+'%'};return _0x3fe017;}})});}_0x2d51fe=_[_0x2815('0x3b')]({},_0x2d51fe,_0x37614a[_0x2815('0x3c')]);var _0x1fd226={'where':_0x2d51fe[_0x2815('0x38')]};return db[_0x2815('0x3d')][_0x2815('0x19')](_0x1fd226)[_0x2815('0x21')](function(_0x1d471d){_0x40b293[_0x2815('0x19')]=_0x1d471d;if(_0x37614a['query'][_0x2815('0x3e')]){_0x2d51fe[_0x2815('0x3f')]=[{'all':!![]}];}return db[_0x2815('0x3d')][_0x2815('0x40')](_0x2d51fe);})[_0x2815('0x21')](function(_0x404f0b){_0x40b293['rows']=_0x404f0b;return _0x40b293;})[_0x2815('0x21')](respondWithFilteredResult(_0x11a153,_0x2d51fe))[_0x2815('0x41')](handleError(_0x11a153,null));};exports[_0x2815('0x42')]=function(_0x8a5071,_0xf6f54e){var _0x3cb599={'raw':!![],'where':{'id':_0x8a5071[_0x2815('0x43')]['id']}},_0x1b7a3c={};_0x1b7a3c[_0x2815('0x2b')]=_[_0x2815('0x2d')](db[_0x2815('0x3d')][_0x2815('0x27')]);_0x1b7a3c[_0x2815('0x2c')]=_['keys'](_0x8a5071['query']);_0x1b7a3c[_0x2815('0x2e')]=_[_0x2815('0x30')](_0x1b7a3c[_0x2815('0x2b')],_0x1b7a3c[_0x2815('0x2c')]);_0x3cb599[_0x2815('0x2f')]=_[_0x2815('0x30')](_0x1b7a3c['model'],qs[_0x2815('0x31')](_0x8a5071[_0x2815('0x2c')][_0x2815('0x31')]));_0x3cb599['attributes']=_0x3cb599['attributes'][_0x2815('0x32')]?_0x3cb599[_0x2815('0x2f')]:_0x1b7a3c[_0x2815('0x2b')];if(_0x8a5071[_0x2815('0x2c')][_0x2815('0x3e')]){_0x3cb599['include']=[{'all':!![]}];}_0x3cb599=_[_0x2815('0x3b')]({},_0x3cb599,_0x8a5071[_0x2815('0x3c')]);return db['CmHopperHistory']['find'](_0x3cb599)[_0x2815('0x21')](handleEntityNotFound(_0xf6f54e,null))[_0x2815('0x21')](respondWithResult(_0xf6f54e,null))[_0x2815('0x41')](handleError(_0xf6f54e,null));};exports['create']=function(_0x1ac9eb,_0x19b2a3){return db[_0x2815('0x3d')][_0x2815('0x44')](_0x1ac9eb[_0x2815('0x45')],{})[_0x2815('0x21')](respondWithResult(_0x19b2a3,0xc9))[_0x2815('0x41')](handleError(_0x19b2a3,null));};exports[_0x2815('0x46')]=function(_0x3b6df6,_0x51d55){return db['CmHopperHistory'][_0x2815('0x46')]()[_0x2815('0x21')](respondWithResult(_0x51d55,null))[_0x2815('0x41')](handleError(_0x51d55,null));};exports[_0x2815('0x20')]=function(_0x10cc5b,_0x152c46){if(_0x10cc5b[_0x2815('0x45')][_0x2815('0x47')]){delete _0x10cc5b[_0x2815('0x45')][_0x2815('0x47')];}return db['CmHopperHistory'][_0x2815('0x48')]({'where':{'uniqueid':_0x10cc5b[_0x2815('0x43')]['id']}})['then'](handleEntityNotFound(_0x152c46,null))[_0x2815('0x21')](saveUpdates(_0x10cc5b[_0x2815('0x45')],null))[_0x2815('0x21')](respondWithResult(_0x152c46,null))['catch'](handleError(_0x152c46,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js
index 219eecb..c0b2006 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.model.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf21=['api','moment','bluebird','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger'];(function(_0x18a240,_0x2ce6b1){var _0x48bf53=function(_0x2e3eaa){while(--_0x2e3eaa){_0x18a240['push'](_0x18a240['shift']());}};_0x48bf53(++_0x2ce6b1);}(_0xdf21,0x101));var _0x1df2=function(_0xb6dae7,_0x2e19f){_0xb6dae7=_0xb6dae7-0x0;var _0x4811a5=_0xdf21[_0xb6dae7];return _0x4811a5;};'use strict';var _=require(_0x1df2('0x0'));var util=require(_0x1df2('0x1'));var logger=require(_0x1df2('0x2'))(_0x1df2('0x3'));var moment=require(_0x1df2('0x4'));var BPromise=require(_0x1df2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1df2('0x6'));module[_0x1df2('0x7')]=function(_0x1bc9b9,_0x5b0667){return _0x1bc9b9[_0x1df2('0x8')](_0x1df2('0x9'),attributes,{'tableName':_0x1df2('0xa'),'paranoid':![],'indexes':[{'name':_0x1df2('0xb'),'fields':['endtime']},{'name':_0x1df2('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0af8=['endtime','uniqueid','lodash','../../config/logger','moment','bluebird','path','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history'];(function(_0x46a64c,_0x10bece){var _0x55a9d2=function(_0x2199e2){while(--_0x2199e2){_0x46a64c['push'](_0x46a64c['shift']());}};_0x55a9d2(++_0x10bece);}(_0x0af8,0xec));var _0x80af=function(_0x159ad5,_0x4ac868){_0x159ad5=_0x159ad5-0x0;var _0x282c7b=_0x0af8[_0x159ad5];return _0x282c7b;};'use strict';var _=require(_0x80af('0x0'));var util=require('util');var logger=require(_0x80af('0x1'))('api');var moment=require(_0x80af('0x2'));var BPromise=require(_0x80af('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80af('0x4'));var rimraf=require(_0x80af('0x5'));var config=require('../../config/environment');var attributes=require(_0x80af('0x6'));module[_0x80af('0x7')]=function(_0x3c7c3f,_0x198a24){return _0x3c7c3f[_0x80af('0x8')](_0x80af('0x9'),attributes,{'tableName':_0x80af('0xa'),'paranoid':![],'indexes':[{'name':_0x80af('0xb'),'fields':['endtime']},{'name':_0x80af('0xc'),'fields':[_0x80af('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js
index 2d3cf2b..cd42754 100644
--- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js
+++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7b4=['request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CmHopperHistory','create','body','options','then','CreateCmHopperHistory','AvgHandleTime','findAll','raw','where','COUNT','sequelize','col','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0xf7b4,0x152));var _0x4f7b=function(_0x3315ab,_0x134bff){_0x3315ab=_0x3315ab-0x0;var _0x54725f=_0xf7b4[_0x3315ab];return _0x54725f;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ad135,_0x173784,_0x351036){return new BPromise(function(_0x36ea9c,_0x3ef6e1){return client[_0x4f7b('0xa')](_0x3ad135,_0x351036)['then'](function(_0x433563){logger[_0x4f7b('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x173784,_0x4f7b('0xc'));logger[_0x4f7b('0xd')](_0x4f7b('0xe'),_0x173784,_0x4f7b('0xc'),JSON[_0x4f7b('0xf')](_0x433563));if(_0x433563['error']){if(_0x433563[_0x4f7b('0x10')]['code']===0x1f4){logger['error'](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x3ef6e1(_0x433563[_0x4f7b('0x10')]['message']);}logger[_0x4f7b('0x10')](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x36ea9c(_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);}else{logger[_0x4f7b('0xb')](_0x4f7b('0x11'),_0x173784,_0x4f7b('0xc'));_0x36ea9c(_0x433563[_0x4f7b('0x13')][_0x4f7b('0x12')]);}})[_0x4f7b('0x14')](function(_0x50a161){logger[_0x4f7b('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x173784,_0x50a161);_0x3ef6e1(_0x50a161);});});}exports['CreateCmHopperHistory']=function(_0x24e5cf){var _0x3813da=this;return new Promise(function(_0x519d90,_0x2b34c9){return db[_0x4f7b('0x15')][_0x4f7b('0x16')](_0x24e5cf[_0x4f7b('0x17')],{'raw':_0x24e5cf['options']?_0x24e5cf[_0x4f7b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4f7b('0x19')](function(_0x12374b){logger[_0x4f7b('0xb')](_0x4f7b('0x1a'),_0x24e5cf);logger[_0x4f7b('0xd')](_0x4f7b('0x1a'),_0x24e5cf,JSON[_0x4f7b('0xf')](_0x12374b));_0x519d90(_0x12374b);})[_0x4f7b('0x14')](function(_0x2a8b50){logger['error'](_0x4f7b('0x1a'),_0x2a8b50[_0x4f7b('0x12')],_0x24e5cf);_0x2b34c9(_0x3813da[_0x4f7b('0x10')](0x1f4,_0x2a8b50['message']));});});};exports[_0x4f7b('0x1b')]=function(_0x4610a4){var _0x5d22f4=this;return new Promise(function(_0x15dbec,_0x59ec24){return db[_0x4f7b('0x15')][_0x4f7b('0x1c')]({'raw':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1d')]===undefined?!![]:![]:!![],'where':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')][_0x4f7b('0x21')]('id')),'predictiveIntervalTotalCalls'],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x4f7b('0x23')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db['sequelize']['fn']('IF',db[_0x4f7b('0x20')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x4f7b('0x24')],[db['sequelize']['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')](_0x4f7b('0x25')))),_0x4f7b('0x26')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x27'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')](_0x4f7b('0x28')))),_0x4f7b('0x29')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x27'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')](_0x4f7b('0x2a')))),_0x4f7b('0x2b')]]})[_0x4f7b('0x19')](function(_0x172235){logger['info'](_0x4f7b('0x1b'),_0x4610a4);logger['debug'](_0x4f7b('0x1b'),_0x4610a4,JSON[_0x4f7b('0xf')](_0x172235));_0x15dbec(_0x172235);})['catch'](function(_0xa28dab){logger[_0x4f7b('0x10')](_0x4f7b('0x1b'),_0xa28dab['message'],_0x4610a4);_0x59ec24(_0x5d22f4[_0x4f7b('0x10')](0x1f4,_0xa28dab[_0x4f7b('0x12')]));});});};exports[_0x4f7b('0x2c')]=function(_0x347ef1){var _0x244b99=this;return new Promise(function(_0x42ff48,_0xd42b30){return db['CmHopperHistory'][_0x4f7b('0x1c')]({'raw':_0x347ef1['options']?_0x347ef1[_0x4f7b('0x18')][_0x4f7b('0x1d')]===undefined?!![]:![]:!![],'where':_0x347ef1[_0x4f7b('0x18')]?_0x347ef1['options'][_0x4f7b('0x1e')]||null:null,'attributes':[['campaign',_0x4f7b('0x2d')],[db[_0x4f7b('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f7b('0x20')]['literal'](_0x4f7b('0x2e')))),_0x4f7b('0x2f')],[db['sequelize']['fn'](_0x4f7b('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4f7b('0x30')))),_0x4f7b('0x31')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db['sequelize']['fn']('IF',db[_0x4f7b('0x20')]['literal'](_0x4f7b('0x32')))),'outboundAnswerCallsDay'],[db[_0x4f7b('0x20')]['fn']('COUNT',db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')](_0x4f7b('0x33')))),_0x4f7b('0x34')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')](_0x4f7b('0x35')))),_0x4f7b('0x36')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')](_0x4f7b('0x37')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x4f7b('0x38')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')]['literal'](_0x4f7b('0x39')))),_0x4f7b('0x3a')],[db[_0x4f7b('0x20')]['fn']('COUNT',db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')](_0x4f7b('0x3b')))),_0x4f7b('0x3c')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0x4f7b('0x3d')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db['sequelize']['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')](_0x4f7b('0x3e')))),_0x4f7b('0x3f')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')][_0x4f7b('0x22')](_0x4f7b('0x40')))),'outboundRejectCallsDay'],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db['sequelize'][_0x4f7b('0x22')](_0x4f7b('0x41')))),_0x4f7b('0x42')]],'group':[_0x4f7b('0x43')]})[_0x4f7b('0x19')](function(_0x819fb3){logger['info'](_0x4f7b('0x2c'),_0x347ef1);logger[_0x4f7b('0xd')](_0x4f7b('0x2c'),_0x347ef1,JSON['stringify'](_0x819fb3));_0x42ff48(_0x819fb3);})[_0x4f7b('0x14')](function(_0x1906ad){logger[_0x4f7b('0x10')](_0x4f7b('0x2c'),_0x1906ad[_0x4f7b('0x12')],_0x347ef1);_0xd42b30(_0x244b99[_0x4f7b('0x10')](0x1f4,_0x1906ad['message']));});});};exports[_0x4f7b('0x44')]=function(_0x4eb5c0){var _0x52fa40=this;return new Promise(function(_0x5aef6e,_0x21e852){return db[_0x4f7b('0x15')][_0x4f7b('0x1c')]({'raw':_0x4eb5c0['options']?_0x4eb5c0['options'][_0x4f7b('0x1d')]===undefined?!![]:![]:!![],'where':_0x4eb5c0[_0x4f7b('0x18')]?_0x4eb5c0['options'][_0x4f7b('0x1e')]||null:null,'attributes':[[_0x4f7b('0x43'),_0x4f7b('0x2d')],[db[_0x4f7b('0x20')]['fn']('COUNT',db[_0x4f7b('0x20')][_0x4f7b('0x21')]('id')),_0x4f7b('0x45')],[db[_0x4f7b('0x20')]['fn'](_0x4f7b('0x1f'),db[_0x4f7b('0x20')]['fn']('IF',db[_0x4f7b('0x20')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x4f7b('0x43')]})['then'](function(_0x4e8de8){logger['info']('GetCampaignHopperHistory',_0x4eb5c0);logger[_0x4f7b('0xd')](_0x4f7b('0x44'),_0x4eb5c0,JSON[_0x4f7b('0xf')](_0x4e8de8));_0x5aef6e(_0x4e8de8);})[_0x4f7b('0x14')](function(_0x25da52){logger[_0x4f7b('0x10')](_0x4f7b('0x44'),_0x25da52[_0x4f7b('0x12')],_0x4eb5c0);_0x21e852(_0x52fa40[_0x4f7b('0x10')](0x1f4,_0x25da52[_0x4f7b('0x12')]));});});};
\ No newline at end of file
+var _0x2547=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','findAll','sequelize','col','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','ivrTotalCallsDays','ivrAnswerCallsDay','util'];(function(_0xab31bc,_0x10c22c){var _0x29dbad=function(_0x846117){while(--_0x846117){_0xab31bc['push'](_0xab31bc['shift']());}};_0x29dbad(++_0x10c22c);}(_0x2547,0x1cd));var _0x7254=function(_0x55f2ac,_0x38b5aa){_0x55f2ac=_0x55f2ac-0x0;var _0x33b207=_0x2547[_0x55f2ac];return _0x33b207;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});}exports[_0x7254('0x16')]=function(_0x2737e0){var _0x5dd23b=this;return new Promise(function(_0x1f48f6,_0x2283b7){return db[_0x7254('0x17')][_0x7254('0x18')](_0x2737e0[_0x7254('0x19')],{'raw':_0x2737e0[_0x7254('0x1a')]?_0x2737e0[_0x7254('0x1a')][_0x7254('0x1b')]===undefined?!![]:![]:!![]})[_0x7254('0x1c')](function(_0x3b6cb6){logger[_0x7254('0x14')](_0x7254('0x16'),_0x2737e0);logger[_0x7254('0xf')](_0x7254('0x16'),_0x2737e0,JSON[_0x7254('0x11')](_0x3b6cb6));_0x1f48f6(_0x3b6cb6);})[_0x7254('0x15')](function(_0x2bb2fe){logger[_0x7254('0x12')](_0x7254('0x16'),_0x2bb2fe[_0x7254('0x13')],_0x2737e0);_0x2283b7(_0x5dd23b[_0x7254('0x12')](0x1f4,_0x2bb2fe['message']));});});};exports['AvgHandleTime']=function(_0x136ea3){var _0xd91c1f=this;return new Promise(function(_0x1c24ea,_0x54dace){return db[_0x7254('0x17')][_0x7254('0x1d')]({'raw':_0x136ea3[_0x7254('0x1a')]?_0x136ea3['options'][_0x7254('0x1b')]===undefined?!![]:![]:!![],'where':_0x136ea3[_0x7254('0x1a')]?_0x136ea3[_0x7254('0x1a')]['where']||null:null,'attributes':[[db[_0x7254('0x1e')]['fn']('COUNT',db[_0x7254('0x1e')][_0x7254('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x22')))),_0x7254('0x23')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),_0x7254('0x24')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x25')))),_0x7254('0x26')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x27'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize'][_0x7254('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x27'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x28')))),_0x7254('0x29')]]})[_0x7254('0x1c')](function(_0x447515){logger[_0x7254('0x14')](_0x7254('0x2a'),_0x136ea3);logger[_0x7254('0xf')](_0x7254('0x2a'),_0x136ea3,JSON[_0x7254('0x11')](_0x447515));_0x1c24ea(_0x447515);})['catch'](function(_0x1fd417){logger[_0x7254('0x12')](_0x7254('0x2a'),_0x1fd417[_0x7254('0x13')],_0x136ea3);_0x54dace(_0xd91c1f[_0x7254('0x12')](0x1f4,_0x1fd417['message']));});});};exports[_0x7254('0x2b')]=function(_0x5e36b0){var _0x64067b=this;return new Promise(function(_0xb7716a,_0x3bb517){return db[_0x7254('0x17')][_0x7254('0x1d')]({'raw':_0x5e36b0['options']?_0x5e36b0[_0x7254('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5e36b0[_0x7254('0x1a')]?_0x5e36b0[_0x7254('0x1a')]['where']||null:null,'attributes':[[_0x7254('0x2c'),_0x7254('0x2d')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')]['literal'](_0x7254('0x2e')))),_0x7254('0x2f')],[db[_0x7254('0x1e')]['fn']('COUNT',db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0x7254('0x30')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x7254('0x31')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x7254('0x32')))),'outboundBusyCallsDay'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x7254('0x33')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x7254('0x34')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7254('0x35')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize'][_0x7254('0x21')](_0x7254('0x36')))),'outboundUnknownCallsDay'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize'][_0x7254('0x21')](_0x7254('0x37')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x38')))),'outboundRejectCallsDay'],[db[_0x7254('0x1e')]['fn']('COUNT',db[_0x7254('0x1e')]['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x7254('0x39')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x3a')))),_0x7254('0x3b')],[db[_0x7254('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7254('0x1e')][_0x7254('0x21')](_0x7254('0x3c')))),_0x7254('0x3d')]],'group':[_0x7254('0x2c')]})['then'](function(_0x5a44fb){logger[_0x7254('0x14')](_0x7254('0x2b'),_0x5e36b0);logger[_0x7254('0xf')](_0x7254('0x2b'),_0x5e36b0,JSON['stringify'](_0x5a44fb));_0xb7716a(_0x5a44fb);})[_0x7254('0x15')](function(_0x3e3d09){logger['error'](_0x7254('0x2b'),_0x3e3d09['message'],_0x5e36b0);_0x3bb517(_0x64067b[_0x7254('0x12')](0x1f4,_0x3e3d09['message']));});});};exports[_0x7254('0x3e')]=function(_0x5cd945){var _0x55119e=this;return new Promise(function(_0x302ffc,_0x2ef688){return db[_0x7254('0x17')][_0x7254('0x1d')]({'raw':_0x5cd945['options']?_0x5cd945[_0x7254('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5cd945[_0x7254('0x1a')]?_0x5cd945[_0x7254('0x1a')][_0x7254('0x3f')]||null:null,'attributes':[[_0x7254('0x2c'),_0x7254('0x2d')],[db[_0x7254('0x1e')]['fn']('COUNT',db[_0x7254('0x1e')][_0x7254('0x1f')]('id')),_0x7254('0x40')],[db[_0x7254('0x1e')]['fn'](_0x7254('0x20'),db[_0x7254('0x1e')]['fn']('IF',db['sequelize'][_0x7254('0x21')](_0x7254('0x22')))),_0x7254('0x41')]],'group':[_0x7254('0x2c')]})[_0x7254('0x1c')](function(_0x2396ce){logger[_0x7254('0x14')]('GetCampaignHopperHistory',_0x5cd945);logger['debug'](_0x7254('0x3e'),_0x5cd945,JSON['stringify'](_0x2396ce));_0x302ffc(_0x2396ce);})['catch'](function(_0xbd4dbf){logger[_0x7254('0x12')](_0x7254('0x3e'),_0xbd4dbf['message'],_0x5cd945);_0x2ef688(_0x55119e[_0x7254('0x12')](0x1f4,_0xbd4dbf['message']));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js
index 8762a57..2317088 100644
--- a/server/api/cmHopperHistory/index.js
+++ b/server/api/cmHopperHistory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd461=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','exports','util','connect-timeout','express','Router'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xd461,0x13f));var _0x1d46=function(_0x220430,_0x4ce08b){_0x220430=_0x220430-0x0;var _0xec1263=_0xd461[_0x220430];return _0xec1263;};'use strict';var multer=require('multer');var util=require(_0x1d46('0x0'));var path=require('path');var timeout=require(_0x1d46('0x1'));var express=require(_0x1d46('0x2'));var router=express[_0x1d46('0x3')]();var auth=require(_0x1d46('0x4'));var interaction=require(_0x1d46('0x5'));var config=require(_0x1d46('0x6'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x1d46('0x7')](),controller['index']);router[_0x1d46('0x8')](_0x1d46('0x9'),auth[_0x1d46('0x7')](),controller[_0x1d46('0xa')]);router['get'](_0x1d46('0xb'),auth['isAuthenticated'](),controller[_0x1d46('0xc')]);router[_0x1d46('0xd')]('/',auth[_0x1d46('0x7')](),controller[_0x1d46('0xe')]);router[_0x1d46('0xf')](_0x1d46('0xb'),auth[_0x1d46('0x7')](),controller['update']);module[_0x1d46('0x10')]=router;
\ No newline at end of file
+var _0x7546=['update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x3fc674,_0x113ee0){var _0x169240=function(_0x26a5c9){while(--_0x26a5c9){_0x3fc674['push'](_0x3fc674['shift']());}};_0x169240(++_0x113ee0);}(_0x7546,0x1d0));var _0x6754=function(_0x2e289e,_0x5a69d7){_0x2e289e=_0x2e289e-0x0;var _0x2a3187=_0x7546[_0x2e289e];return _0x2a3187;};'use strict';var multer=require(_0x6754('0x0'));var util=require(_0x6754('0x1'));var path=require(_0x6754('0x2'));var timeout=require(_0x6754('0x3'));var express=require(_0x6754('0x4'));var router=express[_0x6754('0x5')]();var auth=require(_0x6754('0x6'));var interaction=require(_0x6754('0x7'));var config=require(_0x6754('0x8'));var controller=require(_0x6754('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x6754('0xa')]);router[_0x6754('0xb')](_0x6754('0xc'),auth[_0x6754('0xd')](),controller[_0x6754('0xe')]);router['get'](_0x6754('0xf'),auth[_0x6754('0xd')](),controller[_0x6754('0x10')]);router[_0x6754('0x11')]('/',auth['isAuthenticated'](),controller[_0x6754('0x12')]);router[_0x6754('0x13')](_0x6754('0xf'),auth[_0x6754('0xd')](),controller[_0x6754('0x14')]);module[_0x6754('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js
index 0df3747..43ba458 100644
--- a/server/api/cmList/cmList.attributes.js
+++ b/server/api/cmList/cmList.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa85=['sequelize','exports','STRING','name'];(function(_0x236df8,_0x103d28){var _0x34da1b=function(_0x5941d3){while(--_0x5941d3){_0x236df8['push'](_0x236df8['shift']());}};_0x34da1b(++_0x103d28);}(_0xaa85,0x94));var _0x5aa8=function(_0x26cd68,_0x264df0){_0x26cd68=_0x26cd68-0x0;var _0x388a80=_0xaa85[_0x26cd68];return _0x388a80;};'use strict';var Sequelize=require(_0x5aa8('0x0'));module[_0x5aa8('0x1')]={'name':{'type':Sequelize[_0x5aa8('0x2')],'unique':_0x5aa8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x5aa8('0x2')]}};
\ No newline at end of file
+var _0xc5bf=['exports','STRING','name','sequelize'];(function(_0x2ecf03,_0x2adccf){var _0x4418ab=function(_0x201f87){while(--_0x201f87){_0x2ecf03['push'](_0x2ecf03['shift']());}};_0x4418ab(++_0x2adccf);}(_0xc5bf,0x1a7));var _0xfc5b=function(_0x2f4115,_0x1f98e7){_0x2f4115=_0x2f4115-0x0;var _0x581dd5=_0xc5bf[_0x2f4115];return _0x581dd5;};'use strict';var Sequelize=require(_0xfc5b('0x0'));module[_0xfc5b('0x1')]={'name':{'type':Sequelize[_0xfc5b('0x2')],'unique':_0xfc5b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfc5b('0x2')]},'dialPrefix':{'type':Sequelize[_0xfc5b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js
index aef08bc..7f60ac6 100644
--- a/server/api/cmList/cmList.controller.js
+++ b/server/api/cmList/cmList.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ff8=['setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','switch','cm_contacts','cf_%s','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','Lists','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','CmList','includeAll','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','ids','CmContact','describe','tags','isArray','join','push','each','omit','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','options','now','writeFileSync','/tmp/list_%d_%s.csv'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5ff8,0x138));var _0x85ff=function(_0x523fd6,_0xc7eb78){_0x523fd6=_0x523fd6-0x0;var _0x57ffc1=_0x5ff8[_0x523fd6];return _0x57ffc1;};'use strict';var pdf=require(_0x85ff('0x0'));var emlformat=require(_0x85ff('0x1'));var rimraf=require(_0x85ff('0x2'));var zipdir=require(_0x85ff('0x3'));var jsonpatch=require(_0x85ff('0x4'));var rp=require('request-promise');var moment=require(_0x85ff('0x5'));var BPromise=require(_0x85ff('0x6'));var Mustache=require(_0x85ff('0x7'));var util=require(_0x85ff('0x8'));var path=require(_0x85ff('0x9'));var sox=require(_0x85ff('0xa'));var csv=require(_0x85ff('0xb'));var ejs=require(_0x85ff('0xc'));var fs=require('fs');var _=require(_0x85ff('0xd'));var squel=require(_0x85ff('0xe'));var crypto=require(_0x85ff('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x85ff('0x10'));var toCsv=require(_0x85ff('0xb'));var querystring=require(_0x85ff('0x11'));var Papa=require(_0x85ff('0x12'));var Redis=require(_0x85ff('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x85ff('0x14'));var as=require(_0x85ff('0x15'));var hardwareService=require(_0x85ff('0x16'));var logger=require(_0x85ff('0x17'))(_0x85ff('0x18'));var utils=require(_0x85ff('0x19'));var config=require(_0x85ff('0x1a'));var db=require(_0x85ff('0x1b'))['db'];config[_0x85ff('0x1c')]=_[_0x85ff('0x1d')](config[_0x85ff('0x1c')],{'host':_0x85ff('0x1e'),'port':0x18eb});var socket=require(_0x85ff('0x1f'))(new Redis(config[_0x85ff('0x1c')]));require(_0x85ff('0x20'))[_0x85ff('0x21')](socket);function respondWithStatusCode(_0x2d5752,_0x179f73){_0x179f73=_0x179f73||0xcc;return function(_0x28c818){if(_0x28c818){return _0x2d5752[_0x85ff('0x22')](_0x179f73);}return _0x2d5752[_0x85ff('0x23')](_0x179f73)['end']();};}function respondWithResult(_0x40203a,_0x3ae7d7){_0x3ae7d7=_0x3ae7d7||0xc8;return function(_0x40859d){if(_0x40859d){return _0x40203a[_0x85ff('0x23')](_0x3ae7d7)[_0x85ff('0x24')](_0x40859d);}};}function respondWithFilteredResult(_0x3bd395,_0x34f7c2){return function(_0x55634d){if(_0x55634d){var _0x383988=_0x55634d[_0x85ff('0x25')],_0x3e54dc=_0x34f7c2['offset'],_0x4366be=_0x34f7c2[_0x85ff('0x26')]+_0x34f7c2['limit'],_0x24b864;if(_0x4366be>=_0x383988){_0x4366be=_0x383988;_0x24b864=0xc8;}else{_0x24b864=0xce;}_0x3bd395[_0x85ff('0x23')](_0x24b864);return _0x3bd395[_0x85ff('0x27')](_0x85ff('0x28'),_0x3e54dc+'-'+_0x4366be+'/'+_0x383988)['json'](_0x55634d);}return null;};}function patchUpdates(_0x1468e3){return function(_0x4dfd2b){try{jsonpatch['apply'](_0x4dfd2b,_0x1468e3,!![]);}catch(_0xe4156a){return BPromise[_0x85ff('0x29')](_0xe4156a);}return _0x4dfd2b[_0x85ff('0x2a')]();};}function saveUpdates(_0x479f38,_0x2f3f1f){return function(_0x2b65cb){if(_0x2b65cb){return _0x2b65cb[_0x85ff('0x2b')](_0x479f38)[_0x85ff('0x2c')](function(_0x169063){return _0x169063;});}return null;};}function removeEntity(_0x55a361,_0xdbdaba){return function(_0x440350){if(_0x440350){return _0x440350[_0x85ff('0x2d')]()[_0x85ff('0x2c')](function(){var _0x1f5934=_0x440350['get']({'plain':!![]});var _0x1fe0c0=_0x85ff('0x2e');return db[_0x85ff('0x2f')][_0x85ff('0x2d')]({'where':{'type':_0x1fe0c0,'resourceId':_0x1f5934['id']}})[_0x85ff('0x2c')](function(){return _0x440350;});})[_0x85ff('0x2c')](function(){_0x55a361[_0x85ff('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x419057,_0x22362e){return function(_0x327a17){if(!_0x327a17){_0x419057[_0x85ff('0x22')](0x194);}return _0x327a17;};}function handleError(_0x3d2899,_0x341b04){_0x341b04=_0x341b04||0x1f4;return function(_0x1d04ca){logger[_0x85ff('0x30')](_0x1d04ca['stack']);if(_0x1d04ca[_0x85ff('0x31')]){delete _0x1d04ca[_0x85ff('0x31')];}_0x3d2899[_0x85ff('0x23')](_0x341b04)[_0x85ff('0x32')](_0x1d04ca);};}exports[_0x85ff('0x33')]=function(_0x43f972,_0x30cd54){var _0x4021be={},_0x4ba99e={},_0x87e3db={'count':0x0,'rows':[]};var _0x457483=_[_0x85ff('0x34')](db['CmList'][_0x85ff('0x35')],function(_0x5460c7){return{'name':_0x5460c7[_0x85ff('0x36')],'type':_0x5460c7[_0x85ff('0x37')]['key']};});_0x4ba99e[_0x85ff('0x38')]=_[_0x85ff('0x34')](_0x457483,_0x85ff('0x31'));_0x4ba99e['query']=_[_0x85ff('0x39')](_0x43f972[_0x85ff('0x3a')]);_0x4ba99e[_0x85ff('0x3b')]=_[_0x85ff('0x3c')](_0x4ba99e['model'],_0x4ba99e[_0x85ff('0x3a')]);_0x4021be[_0x85ff('0x3d')]=_[_0x85ff('0x3c')](_0x4ba99e[_0x85ff('0x38')],qs[_0x85ff('0x3e')](_0x43f972[_0x85ff('0x3a')]['fields']));_0x4021be[_0x85ff('0x3d')]=_0x4021be[_0x85ff('0x3d')][_0x85ff('0x3f')]?_0x4021be[_0x85ff('0x3d')]:_0x4ba99e['model'];if(!_0x43f972['query']['hasOwnProperty'](_0x85ff('0x40'))){_0x4021be[_0x85ff('0x41')]=qs['limit'](_0x43f972[_0x85ff('0x3a')][_0x85ff('0x41')]);_0x4021be['offset']=qs[_0x85ff('0x26')](_0x43f972[_0x85ff('0x3a')][_0x85ff('0x26')]);}_0x4021be[_0x85ff('0x42')]=qs[_0x85ff('0x43')](_0x43f972[_0x85ff('0x3a')][_0x85ff('0x43')]);_0x4021be['where']=qs[_0x85ff('0x3b')](_[_0x85ff('0x44')](_0x43f972[_0x85ff('0x3a')],_0x4ba99e['filters']),_0x457483);if(_0x43f972[_0x85ff('0x3a')][_0x85ff('0x45')]){_0x4021be[_0x85ff('0x46')]=_['merge'](_0x4021be['where'],{'$or':_[_0x85ff('0x34')](_0x457483,function(_0x2b4092){if(_0x2b4092[_0x85ff('0x37')]!==_0x85ff('0x47')){var _0x1d24a9={};_0x1d24a9[_0x2b4092[_0x85ff('0x31')]]={'$like':'%'+_0x43f972[_0x85ff('0x3a')][_0x85ff('0x45')]+'%'};return _0x1d24a9;}})});}_0x4021be=_[_0x85ff('0x48')]({},_0x4021be,_0x43f972['options']);var _0x70e351={'where':_0x4021be[_0x85ff('0x46')]};return db[_0x85ff('0x49')]['count'](_0x70e351)[_0x85ff('0x2c')](function(_0x5e057b){_0x87e3db[_0x85ff('0x25')]=_0x5e057b;if(_0x43f972[_0x85ff('0x3a')][_0x85ff('0x4a')]){_0x4021be['include']=[{'all':!![]}];}return db[_0x85ff('0x49')]['findAll'](_0x4021be);})[_0x85ff('0x2c')](function(_0x5a6bc8){_0x87e3db['rows']=_0x5a6bc8;return _0x87e3db;})[_0x85ff('0x2c')](respondWithFilteredResult(_0x30cd54,_0x4021be))[_0x85ff('0x4b')](handleError(_0x30cd54,null));};exports[_0x85ff('0x4c')]=function(_0x50fcbd,_0x4660c0){var _0xd612bd={'raw':![],'where':{'id':_0x50fcbd[_0x85ff('0x4d')]['id']}},_0x5360ae={};_0x5360ae[_0x85ff('0x38')]=_[_0x85ff('0x39')](db[_0x85ff('0x49')]['rawAttributes']);_0x5360ae[_0x85ff('0x3a')]=_[_0x85ff('0x39')](_0x50fcbd[_0x85ff('0x3a')]);_0x5360ae['filters']=_[_0x85ff('0x3c')](_0x5360ae[_0x85ff('0x38')],_0x5360ae[_0x85ff('0x3a')]);_0xd612bd[_0x85ff('0x3d')]=_[_0x85ff('0x3c')](_0x5360ae[_0x85ff('0x38')],qs[_0x85ff('0x3e')](_0x50fcbd[_0x85ff('0x3a')]['fields']));_0xd612bd['attributes']=_0xd612bd['attributes'][_0x85ff('0x3f')]?_0xd612bd[_0x85ff('0x3d')]:_0x5360ae['model'];if(_0x50fcbd[_0x85ff('0x3a')][_0x85ff('0x4a')]){_0xd612bd[_0x85ff('0x4e')]=[{'all':!![]}];}_0xd612bd=_[_0x85ff('0x48')]({},_0xd612bd,_0x50fcbd['options']);return db[_0x85ff('0x49')][_0x85ff('0x4f')](_0xd612bd)[_0x85ff('0x2c')](handleEntityNotFound(_0x4660c0,null))[_0x85ff('0x2c')](respondWithResult(_0x4660c0,null))[_0x85ff('0x4b')](handleError(_0x4660c0,null));};exports[_0x85ff('0x50')]=function(_0x583c1a,_0x176f4c){return db['CmList'][_0x85ff('0x50')](_0x583c1a[_0x85ff('0x51')],{})[_0x85ff('0x2c')](function(_0x39c2af){var _0x386ef1=_0x583c1a['user']['get']({'plain':!![]});if(!_0x386ef1)throw new Error(_0x85ff('0x52'));if(_0x386ef1[_0x85ff('0x53')]==='user'){var _0x4f3d84=_0x39c2af[_0x85ff('0x54')]({'plain':!![]});var _0x1f8580=_0x85ff('0x2e');return db[_0x85ff('0x55')]['find']({'where':{'name':_0x1f8580,'userProfileId':_0x386ef1['userProfileId']},'raw':!![]})[_0x85ff('0x2c')](function(_0x1256c2){if(_0x1256c2&&_0x1256c2[_0x85ff('0x56')]===0x0){return db[_0x85ff('0x2f')][_0x85ff('0x50')]({'name':_0x4f3d84['name'],'resourceId':_0x4f3d84['id'],'type':_0x1256c2[_0x85ff('0x31')],'sectionId':_0x1256c2['id']},{})[_0x85ff('0x2c')](function(){return _0x39c2af;});}else{return _0x39c2af;}})['catch'](function(_0x2e2472){logger['error'](_0x85ff('0x57'),_0x2e2472);throw _0x2e2472;});}return _0x39c2af;})[_0x85ff('0x2c')](respondWithResult(_0x176f4c,0xc9))[_0x85ff('0x4b')](handleError(_0x176f4c,null));};exports[_0x85ff('0x2b')]=function(_0x1e8152,_0x4fd08a){if(_0x1e8152[_0x85ff('0x51')]['id']){delete _0x1e8152[_0x85ff('0x51')]['id'];}return db[_0x85ff('0x49')]['find']({'where':{'id':_0x1e8152[_0x85ff('0x4d')]['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x4fd08a,null))[_0x85ff('0x2c')](saveUpdates(_0x1e8152[_0x85ff('0x51')],null))[_0x85ff('0x2c')](respondWithResult(_0x4fd08a,null))[_0x85ff('0x4b')](handleError(_0x4fd08a,null));};exports[_0x85ff('0x2d')]=function(_0x3fbe15,_0x3fe04f){return db[_0x85ff('0x49')][_0x85ff('0x4f')]({'where':{'id':_0x3fbe15[_0x85ff('0x4d')]['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x3fe04f,null))[_0x85ff('0x2c')](removeEntity(_0x3fe04f,null))[_0x85ff('0x4b')](handleError(_0x3fe04f,null));};exports['describe']=function(_0x119660,_0x142f20){return db[_0x85ff('0x49')]['describe']()[_0x85ff('0x2c')](respondWithResult(_0x142f20,null))['catch'](handleError(_0x142f20,null));};exports[_0x85ff('0x58')]=function(_0x469428,_0x57e0cb,_0x22cee3){if(_0x469428[_0x85ff('0x51')]['id']){delete _0x469428[_0x85ff('0x51')]['id'];}return db['CmList']['find']({'where':{'id':_0x469428[_0x85ff('0x4d')]['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x57e0cb,null))[_0x85ff('0x2c')](function(_0x71dfa0){if(_0x71dfa0){_0x469428[_0x85ff('0x51')][_0x85ff('0x59')]=_0x71dfa0['id'];return db[_0x85ff('0x5a')][_0x85ff('0x50')](_0x469428[_0x85ff('0x51')]);}})[_0x85ff('0x2c')](respondWithResult(_0x57e0cb,null))['catch'](handleError(_0x57e0cb,null));};exports[_0x85ff('0x5b')]=function(_0x5913ae,_0x12b768,_0x1ae02e){var _0xe85ed2={'raw':![],'where':{}};var _0x190b01={};var _0x3e036c={'count':0x0,'rows':[]};return db[_0x85ff('0x49')][_0x85ff('0x5c')]({'where':{'id':_0x5913ae[_0x85ff('0x4d')]['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x12b768,null))['then'](function(_0x4c7c6e){if(_0x4c7c6e){_0x190b01[_0x85ff('0x38')]=_['keys'](db['Disposition'][_0x85ff('0x35')]);_0x190b01['query']=_[_0x85ff('0x39')](_0x5913ae['query']);_0x190b01[_0x85ff('0x3b')]=_[_0x85ff('0x3c')](_0x190b01['model'],_0x190b01[_0x85ff('0x3a')]);_0xe85ed2[_0x85ff('0x3d')]=_[_0x85ff('0x3c')](_0x190b01[_0x85ff('0x38')],qs['fields'](_0x5913ae[_0x85ff('0x3a')][_0x85ff('0x3e')]));_0xe85ed2[_0x85ff('0x3d')]=_0xe85ed2[_0x85ff('0x3d')][_0x85ff('0x3f')]?_0xe85ed2[_0x85ff('0x3d')]:_0x190b01[_0x85ff('0x38')];if(!_0x5913ae['query'][_0x85ff('0x5d')](_0x85ff('0x40'))){_0xe85ed2[_0x85ff('0x41')]=qs['limit'](_0x5913ae[_0x85ff('0x3a')][_0x85ff('0x41')]);_0xe85ed2[_0x85ff('0x26')]=qs['offset'](_0x5913ae[_0x85ff('0x3a')][_0x85ff('0x26')]);}_0xe85ed2['order']=qs[_0x85ff('0x43')](_0x5913ae[_0x85ff('0x3a')][_0x85ff('0x43')]);_0xe85ed2[_0x85ff('0x46')]=qs['filters'](_['pick'](_0x5913ae[_0x85ff('0x3a')],_0x190b01[_0x85ff('0x3b')]));_0xe85ed2['where'][_0x85ff('0x59')]=_0x4c7c6e['id'];if(_0x5913ae[_0x85ff('0x3a')][_0x85ff('0x45')]){_0xe85ed2[_0x85ff('0x46')]=_[_0x85ff('0x48')](_0xe85ed2['where'],{'$or':_[_0x85ff('0x34')](_0xe85ed2[_0x85ff('0x3d')],function(_0x467d2e){var _0x34c5ca={};_0x34c5ca[_0x467d2e]={'$like':'%'+_0x5913ae['query'][_0x85ff('0x45')]+'%'};return _0x34c5ca;})});}_0xe85ed2=_['merge']({},_0xe85ed2,_0x5913ae['options']);return db['Disposition']['count']({'where':_0xe85ed2[_0x85ff('0x46')]})[_0x85ff('0x2c')](function(_0x6e4187){_0x3e036c[_0x85ff('0x25')]=_0x6e4187;if(_0x5913ae[_0x85ff('0x3a')]['includeAll']){_0xe85ed2[_0x85ff('0x4e')]=[{'all':!![]}];}return db[_0x85ff('0x5a')]['findAll'](_0xe85ed2);})[_0x85ff('0x2c')](function(_0x260321){_0x3e036c[_0x85ff('0x5e')]=_0x260321;return _0x3e036c;});}})[_0x85ff('0x2c')](respondWithFilteredResult(_0x12b768,_0xe85ed2))[_0x85ff('0x4b')](handleError(_0x12b768,null));};exports[_0x85ff('0x5f')]=function(_0x1fe4aa,_0x367159,_0x297007){return db[_0x85ff('0x49')][_0x85ff('0x4f')]({'where':{'id':_0x1fe4aa[_0x85ff('0x4d')]['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x367159,null))[_0x85ff('0x2c')](function(_0x7144f8){if(_0x7144f8){return _0x7144f8[_0x85ff('0x5f')](_0x1fe4aa['query'][_0x85ff('0x60')]);}})[_0x85ff('0x2c')](respondWithStatusCode(_0x367159,null))[_0x85ff('0x4b')](handleError(_0x367159,null));};exports['addContacts']=function(_0x75f4e2,_0x123991,_0x1fc23a){return db['CmList'][_0x85ff('0x4f')]({'where':{'id':_0x75f4e2['params']['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x123991,null))[_0x85ff('0x2c')](function(_0x5c7155){if(_0x5c7155){var _0x6b2c19=[];var _0x3e6d69={'success':[],'errors':[]};return db[_0x85ff('0x61')][_0x85ff('0x62')]()[_0x85ff('0x2c')](function(_0xfcce80){if(_0x75f4e2[_0x85ff('0x51')][_0x85ff('0x63')]&&_[_0x85ff('0x64')](_0x75f4e2['body']['tags'])){if(_0x75f4e2['body'][_0x85ff('0x63')][_0x85ff('0x3f')]){_0x75f4e2[_0x85ff('0x51')][_0x85ff('0x63')]=_0x75f4e2[_0x85ff('0x51')][_0x85ff('0x63')][_0x85ff('0x65')](';')+';';}else{_0x75f4e2[_0x85ff('0x51')][_0x85ff('0x63')]=null;}}else{_0x75f4e2[_0x85ff('0x51')][_0x85ff('0x63')]=null;}if(_0x75f4e2[_0x85ff('0x51')]&&_[_0x85ff('0x64')](_0x75f4e2[_0x85ff('0x51')])){for(var _0x28a7d6=0x0;_0x28a7d6<_0x75f4e2[_0x85ff('0x51')]['length'];_0x28a7d6+=0x1){_0x75f4e2[_0x85ff('0x51')][_0x28a7d6][_0x85ff('0x59')]=_0x75f4e2[_0x85ff('0x4d')]['id'];_0x6b2c19[_0x85ff('0x66')](_0x75f4e2['body'][_0x28a7d6]);}return BPromise[_0x85ff('0x67')](_0x6b2c19,function(_0x1d8856){return db['CmContact'][_0x85ff('0x50')](_[_0x85ff('0x68')](_0x1d8856,[_0x85ff('0x60'),'id'])||{},{'fields':_[_0x85ff('0x39')](_0xfcce80),'raw':!![]})[_0x85ff('0x2c')](function(_0x418730){_0x3e6d69['success']['push'](_0x418730[_0x85ff('0x69')]);})[_0x85ff('0x4b')](function(_0x6add19){_0x3e6d69['errors']['push']({'data':_0x1d8856,'error':_0x6add19[_0x85ff('0x6a')]});});})['then'](function(_0xd2ec2f){return _0x3e6d69;})[_0x85ff('0x4b')](function(_0xf9214a){return _0xf9214a;});}else{_0x123991[_0x85ff('0x23')](0x190)[_0x85ff('0x24')]({'message':_0x85ff('0x6b')});}});}})[_0x85ff('0x2c')](respondWithResult(_0x123991,null))[_0x85ff('0x4b')](handleError(_0x123991,null));};exports[_0x85ff('0x6c')]=function(_0x4331a2,_0x5b94d3,_0x4a3e2e){var _0x10294a;return db[_0x85ff('0x49')][_0x85ff('0x4f')]({'where':{'id':_0x4331a2[_0x85ff('0x4d')]['id']},'include':[{'model':db[_0x85ff('0x6d')],'as':_0x85ff('0x6e')}]})[_0x85ff('0x2c')](handleEntityNotFound(_0x5b94d3,null))[_0x85ff('0x2c')](function(_0x4e9c8f){if(_0x4e9c8f){_0x10294a=_0x4e9c8f;return db[_0x85ff('0x61')][_0x85ff('0x35')];}})[_0x85ff('0x2c')](function(_0x352764){if(_0x352764){var _0x15870f={};var _0x33210d={};_0x33210d[_0x85ff('0x38')]=_[_0x85ff('0x6f')](_['keys'](_0x352764),_[_0x85ff('0x34')](_0x10294a[_0x85ff('0x6e')],function(_0xcd72f5){return util[_0x85ff('0x70')](_0x85ff('0x71'),_0xcd72f5['id']);}));_0x33210d['query']=_[_0x85ff('0x39')](_0x4331a2[_0x85ff('0x3a')]);_0x33210d[_0x85ff('0x3b')]=_[_0x85ff('0x3c')](_0x33210d[_0x85ff('0x38')],_0x33210d[_0x85ff('0x3a')]);_0x15870f[_0x85ff('0x3d')]=_[_0x85ff('0x3c')](_0x33210d[_0x85ff('0x38')],qs[_0x85ff('0x3e')](_0x4331a2[_0x85ff('0x3a')][_0x85ff('0x3e')]));_0x15870f['attributes']=_0x15870f[_0x85ff('0x3d')][_0x85ff('0x3f')]?_0x15870f[_0x85ff('0x3d')]:_0x33210d[_0x85ff('0x38')];if(!_0x4331a2[_0x85ff('0x3a')]['hasOwnProperty']('nolimit')){_0x15870f[_0x85ff('0x41')]=qs['limit'](_0x4331a2[_0x85ff('0x3a')][_0x85ff('0x41')]);_0x15870f['offset']=qs['offset'](_0x4331a2[_0x85ff('0x3a')]['offset']);}_0x15870f[_0x85ff('0x42')]=qs['sort'](_0x4331a2[_0x85ff('0x3a')][_0x85ff('0x43')]);_0x15870f['where']=qs[_0x85ff('0x3b')](_[_0x85ff('0x44')](_0x4331a2[_0x85ff('0x3a')],_0x33210d[_0x85ff('0x3b')]));_0x15870f[_0x85ff('0x72')]=!![];if(_0x4331a2[_0x85ff('0x3a')][_0x85ff('0x45')]){_0x15870f[_0x85ff('0x46')]=_[_0x85ff('0x48')](_0x15870f[_0x85ff('0x46')],{'$or':_[_0x85ff('0x34')](_0x15870f[_0x85ff('0x3d')],function(_0x3ae4c8){var _0x26ba1b={};_0x26ba1b[_0x3ae4c8]={'$like':'%'+_0x4331a2['query'][_0x85ff('0x45')]+'%'};return _0x26ba1b;})});}_0x15870f=_[_0x85ff('0x48')]({},_0x15870f,_0x4331a2['options']);return _0x10294a['getContacts'](_0x15870f);}})['then'](respondWithResult(_0x5b94d3,null))[_0x85ff('0x4b')](handleError(_0x5b94d3,null));};exports[_0x85ff('0x73')]=function(_0x29ed6b,_0x560bdd,_0x4193ff){var _0x2a58af;return db[_0x85ff('0x49')][_0x85ff('0x4f')]({'where':{'id':_0x29ed6b['params']['id']},'include':[{'model':db[_0x85ff('0x6d')],'as':_0x85ff('0x6e')}]})['then'](handleEntityNotFound(_0x560bdd,null))[_0x85ff('0x2c')](function(_0x19fd7a){if(_0x19fd7a){_0x2a58af=_0x19fd7a;return db['CmContact'][_0x85ff('0x35')];}})[_0x85ff('0x2c')](function(_0x5e212b){if(_0x5e212b){var _0x253b53={};var _0x521e1b={};_0x521e1b[_0x85ff('0x38')]=_[_0x85ff('0x6f')](_[_0x85ff('0x39')](_0x5e212b),_['map'](_0x2a58af['CustomFields'],function(_0x491108){return util[_0x85ff('0x70')]('cf_%d',_0x491108['id']);}));_0x521e1b['query']=_[_0x85ff('0x39')](_0x29ed6b[_0x85ff('0x3a')]);_0x521e1b[_0x85ff('0x3b')]=_['intersection'](_0x521e1b[_0x85ff('0x38')],_0x521e1b[_0x85ff('0x3a')]);_0x253b53['attributes']=_[_0x85ff('0x3c')](_0x521e1b[_0x85ff('0x38')],qs[_0x85ff('0x3e')](_0x29ed6b[_0x85ff('0x3a')][_0x85ff('0x3e')]));_0x253b53[_0x85ff('0x3d')]=_0x253b53['attributes'][_0x85ff('0x3f')]?_0x253b53[_0x85ff('0x3d')]:_0x521e1b[_0x85ff('0x38')];if(!_0x29ed6b[_0x85ff('0x3a')]['hasOwnProperty'](_0x85ff('0x40'))){_0x253b53[_0x85ff('0x41')]=qs[_0x85ff('0x41')](_0x29ed6b[_0x85ff('0x3a')][_0x85ff('0x41')]);_0x253b53[_0x85ff('0x26')]=qs[_0x85ff('0x26')](_0x29ed6b[_0x85ff('0x3a')]['offset']);}_0x253b53[_0x85ff('0x42')]=qs[_0x85ff('0x43')](_0x29ed6b[_0x85ff('0x3a')]['sort']);_0x253b53[_0x85ff('0x46')]=qs[_0x85ff('0x3b')](_['pick'](_0x29ed6b[_0x85ff('0x3a')],_0x521e1b[_0x85ff('0x3b')]));_0x253b53[_0x85ff('0x72')]=!![];if(_0x29ed6b[_0x85ff('0x3a')][_0x85ff('0x45')]){_0x253b53['where']=_[_0x85ff('0x48')](_0x253b53[_0x85ff('0x46')],{'$or':_['map'](_0x253b53[_0x85ff('0x3d')],function(_0x4c56ff){var _0x5abea4={};_0x5abea4[_0x4c56ff]={'$like':'%'+_0x29ed6b['query'][_0x85ff('0x45')]+'%'};return _0x5abea4;})});}_0x253b53=_['merge']({},_0x253b53,_0x29ed6b[_0x85ff('0x74')]);return _0x2a58af[_0x85ff('0x6c')](_0x253b53);}})[_0x85ff('0x2c')](function(_0x566a8c){if(!_['isEmpty'](_0x566a8c)){var _0x592715=toCsv(_0x566a8c);var _0x2513c5=Date[_0x85ff('0x75')]();fs[_0x85ff('0x76')](util['format'](_0x85ff('0x77'),_0x2a58af['id'],_0x2513c5),_0x592715);_0x560bdd[_0x85ff('0x78')](_0x85ff('0x79'),_0x85ff('0x7a')+util[_0x85ff('0x70')](_0x85ff('0x7b'),_0x2a58af['id'],_0x2513c5));_0x560bdd['setHeader'](_0x85ff('0x7c'),'text/csv');return _0x560bdd[_0x85ff('0x7d')](util[_0x85ff('0x70')]('/tmp/list_%d_%s.csv',_0x2a58af['id'],_0x2513c5));}else{return _0x560bdd[_0x85ff('0x22')](0xcc);}})[_0x85ff('0x4b')](handleError(_0x560bdd,null));};exports[_0x85ff('0x7e')]=function(_0x583ec5,_0x334668,_0x4f3236){var _0x5e9b3f;delete _0x583ec5[_0x85ff('0x51')]['id'];return db[_0x85ff('0x49')][_0x85ff('0x5c')]({'where':{'id':_0x583ec5['params']['id']}})['then'](handleEntityNotFound(_0x334668,null))[_0x85ff('0x2c')](function(_0x2652a6){if(_0x2652a6){return db[_0x85ff('0x7f')][_0x85ff('0x80')](function(_0x3cd70d){return db['CmCustomField'][_0x85ff('0x50')](_0x583ec5[_0x85ff('0x51')],{'transaction':_0x3cd70d})[_0x85ff('0x2c')](function(_0x4ebc67){_0x5e9b3f=_0x4ebc67;return _0x2652a6[_0x85ff('0x81')](_0x4ebc67,{'transaction':_0x3cd70d});})['then'](function(){var _0x4c4a49={'type':db[_0x85ff('0x82')][_0x85ff('0x83')],'transaction':_0x3cd70d};switch(_0x583ec5['body'][_0x85ff('0x37')]){case _0x85ff('0x84'):_0x4c4a49['type']=db[_0x85ff('0x82')][_0x85ff('0x83')];break;case'number':_0x4c4a49[_0x85ff('0x37')]=db[_0x85ff('0x82')]['INTEGER'];break;case _0x85ff('0x85'):_0x4c4a49['type']=db['Sequelize']['BOOLEAN'];_0x4c4a49['defaultValue']=![];break;default:}return db[_0x85ff('0x7f')]['queryInterface']['addColumn'](_0x85ff('0x86'),util[_0x85ff('0x70')](_0x85ff('0x87'),_0x5e9b3f['id']),_0x4c4a49);})[_0x85ff('0x2c')](function(){return _0x5e9b3f;});});}})['then'](respondWithResult(_0x334668,null))['catch'](handleError(_0x334668,null));};exports['getCustomFields']=function(_0x3a87ad,_0x189ce8,_0x3b1bf4){var _0x9ee804={};var _0x15ca43={};var _0x525416;var _0x884358;return db['CmList'][_0x85ff('0x5c')]({'where':{'id':_0x3a87ad[_0x85ff('0x4d')]['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x189ce8,null))[_0x85ff('0x2c')](function(_0x19c6e4){if(_0x19c6e4){_0x525416=_0x19c6e4;_0x15ca43[_0x85ff('0x38')]=_[_0x85ff('0x39')](db[_0x85ff('0x6d')][_0x85ff('0x35')]);_0x15ca43[_0x85ff('0x3a')]=_[_0x85ff('0x39')](_0x3a87ad[_0x85ff('0x3a')]);_0x15ca43[_0x85ff('0x3b')]=_[_0x85ff('0x3c')](_0x15ca43[_0x85ff('0x38')],_0x15ca43[_0x85ff('0x3a')]);_0x9ee804[_0x85ff('0x3d')]=_[_0x85ff('0x3c')](_0x15ca43[_0x85ff('0x38')],qs[_0x85ff('0x3e')](_0x3a87ad[_0x85ff('0x3a')][_0x85ff('0x3e')]));_0x9ee804[_0x85ff('0x3d')]=_0x9ee804['attributes'][_0x85ff('0x3f')]?_0x9ee804['attributes']:_0x15ca43[_0x85ff('0x38')];_0x9ee804[_0x85ff('0x42')]=qs[_0x85ff('0x43')](_0x3a87ad[_0x85ff('0x3a')][_0x85ff('0x43')]);_0x9ee804[_0x85ff('0x46')]=qs['filters'](_[_0x85ff('0x44')](_0x3a87ad[_0x85ff('0x3a')],_0x15ca43[_0x85ff('0x3b')]));_0x9ee804['where']=_['merge'](_0x9ee804[_0x85ff('0x46')],{'$or':[{'ListId':_0x19c6e4['id']},{'ListId':null}]});if(_0x3a87ad[_0x85ff('0x3a')]['filter']){_0x9ee804[_0x85ff('0x46')]=_['merge'](_0x9ee804[_0x85ff('0x46')],{'$or':_['map'](_0x9ee804['attributes'],function(_0x33d528){var _0x281fa6={};_0x281fa6[_0x33d528]={'$like':'%'+_0x3a87ad[_0x85ff('0x3a')][_0x85ff('0x45')]+'%'};return _0x281fa6;})});}_0x9ee804=_[_0x85ff('0x48')]({},_0x9ee804,_0x3a87ad['options']);return db[_0x85ff('0x6d')][_0x85ff('0x88')](_0x9ee804);}})['then'](respondWithResult(_0x189ce8,null))[_0x85ff('0x4b')](handleError(_0x189ce8,null));};exports['addAgents']=function(_0x52bd77,_0x22b18a,_0x525c5a){return db[_0x85ff('0x49')]['find']({'where':{'id':_0x52bd77[_0x85ff('0x4d')]['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x22b18a,null))[_0x85ff('0x2c')](function(_0x3df4d5){if(_0x3df4d5){return _0x3df4d5[_0x85ff('0x89')](_0x52bd77[_0x85ff('0x51')][_0x85ff('0x60')],_[_0x85ff('0x68')](_0x52bd77['body'],[_0x85ff('0x60'),'id'])||{})['spread'](function(_0x58cba8){for(var _0x1bbec9=0x0;_0x1bbec9<_0x52bd77[_0x85ff('0x51')][_0x85ff('0x60')][_0x85ff('0x3f')];_0x1bbec9+=0x1){socket[_0x85ff('0x8a')](_0x85ff('0x8b'),{'UserId':_0x52bd77[_0x85ff('0x51')]['ids'][_0x1bbec9],'CmListId':_0x52bd77[_0x85ff('0x4d')]['id']});}return _0x58cba8;});}})[_0x85ff('0x2c')](respondWithResult(_0x22b18a,null))[_0x85ff('0x4b')](handleError(_0x22b18a,null));};exports[_0x85ff('0x8c')]=function(_0x143c3d,_0x4e7e93,_0x1e5094){return db[_0x85ff('0x49')][_0x85ff('0x4f')]({'where':{'id':_0x143c3d[_0x85ff('0x4d')]['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x4e7e93,null))[_0x85ff('0x2c')](function(_0xa5e249){if(_0xa5e249){return _0xa5e249[_0x85ff('0x8c')](_0x143c3d[_0x85ff('0x3a')][_0x85ff('0x60')])[_0x85ff('0x2c')](function(){if(_[_0x85ff('0x64')](_0x143c3d[_0x85ff('0x3a')][_0x85ff('0x60')])){for(var _0x49a824=0x0;_0x49a824<_0x143c3d[_0x85ff('0x3a')]['ids'][_0x85ff('0x3f')];_0x49a824+=0x1){socket[_0x85ff('0x8a')]('userCmList:remove',{'UserId':Number(_0x143c3d[_0x85ff('0x3a')]['ids'][_0x49a824]),'CmListId':Number(_0x143c3d['params']['id'])});}}else{socket[_0x85ff('0x8a')](_0x85ff('0x8d'),{'UserId':Number(_0x143c3d['query'][_0x85ff('0x60')]),'CmListId':Number(_0x143c3d[_0x85ff('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x4e7e93,null))['catch'](handleError(_0x4e7e93,null));};exports[_0x85ff('0x8e')]=function(_0x4f89ea,_0x13784a,_0x3e3946){var _0x2adc8a={};var _0xd54bba={};var _0x5903ab;var _0x3ef69d;return db[_0x85ff('0x49')][_0x85ff('0x5c')]({'where':{'id':_0x4f89ea[_0x85ff('0x4d')]['id']}})[_0x85ff('0x2c')](handleEntityNotFound(_0x13784a,null))[_0x85ff('0x2c')](function(_0x48afa6){if(_0x48afa6){_0x5903ab=_0x48afa6;_0xd54bba[_0x85ff('0x38')]=_[_0x85ff('0x39')](db[_0x85ff('0x8f')][_0x85ff('0x35')]);_0xd54bba[_0x85ff('0x3a')]=_['keys'](_0x4f89ea['query']);_0xd54bba[_0x85ff('0x3b')]=_[_0x85ff('0x3c')](_0xd54bba[_0x85ff('0x38')],_0xd54bba[_0x85ff('0x3a')]);_0x2adc8a['attributes']=_[_0x85ff('0x3c')](_0xd54bba[_0x85ff('0x38')],qs['fields'](_0x4f89ea[_0x85ff('0x3a')]['fields']));_0x2adc8a[_0x85ff('0x3d')]=_0x2adc8a[_0x85ff('0x3d')][_0x85ff('0x3f')]?_0x2adc8a[_0x85ff('0x3d')]:_0xd54bba[_0x85ff('0x38')];_0x2adc8a['order']=qs['sort'](_0x4f89ea[_0x85ff('0x3a')][_0x85ff('0x43')]);_0x2adc8a[_0x85ff('0x46')]=qs['filters'](_[_0x85ff('0x44')](_0x4f89ea[_0x85ff('0x3a')],_0xd54bba['filters']));if(_0x4f89ea['query']['filter']){_0x2adc8a[_0x85ff('0x46')]=_[_0x85ff('0x48')](_0x2adc8a[_0x85ff('0x46')],{'$or':_['map'](_0x2adc8a['attributes'],function(_0x109498){var _0x22afc0={};_0x22afc0[_0x109498]={'$like':'%'+_0x4f89ea['query'][_0x85ff('0x45')]+'%'};return _0x22afc0;})});}_0x2adc8a=_[_0x85ff('0x48')]({},_0x2adc8a,_0x4f89ea[_0x85ff('0x74')]);return _0x5903ab[_0x85ff('0x8e')](_0x2adc8a);}})['then'](function(_0x27325f){if(_0x27325f){_0x3ef69d=_0x27325f[_0x85ff('0x3f')];if(!_0x4f89ea['query']['hasOwnProperty'](_0x85ff('0x40'))){_0x2adc8a['limit']=qs[_0x85ff('0x41')](_0x4f89ea[_0x85ff('0x3a')][_0x85ff('0x41')]);_0x2adc8a[_0x85ff('0x26')]=qs[_0x85ff('0x26')](_0x4f89ea['query'][_0x85ff('0x26')]);}return _0x5903ab['getAgents'](_0x2adc8a);}})[_0x85ff('0x2c')](function(_0x149cdb){if(_0x149cdb){return _0x149cdb?{'count':_0x3ef69d,'rows':_0x149cdb}:null;}})[_0x85ff('0x2c')](respondWithResult(_0x13784a,null))['catch'](handleError(_0x13784a,null));};
\ No newline at end of file
+var _0xd9aa=['redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','get','Lists','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','CmList','includeAll','include','rows','show','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','message','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','getContacts','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','addCustomField','sequelize','transaction','Sequelize','text','TEXT','number','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x27e026,_0xeaf6c7){var _0xf2f3e4=function(_0x361e86){while(--_0x361e86){_0x27e026['push'](_0x27e026['shift']());}};_0xf2f3e4(++_0xeaf6c7);}(_0xd9aa,0x1a4));var _0xad9a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xd9aa[_0x2d2c16];return _0x53f2fb;};'use strict';var pdf=require(_0xad9a('0x0'));var emlformat=require(_0xad9a('0x1'));var rimraf=require(_0xad9a('0x2'));var zipdir=require(_0xad9a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad9a('0x4'));var moment=require(_0xad9a('0x5'));var BPromise=require(_0xad9a('0x6'));var Mustache=require('mustache');var util=require(_0xad9a('0x7'));var path=require('path');var sox=require(_0xad9a('0x8'));var csv=require(_0xad9a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xad9a('0xa'));var squel=require(_0xad9a('0xb'));var crypto=require(_0xad9a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xad9a('0xd'));var toCsv=require(_0xad9a('0x9'));var querystring=require(_0xad9a('0xe'));var Papa=require(_0xad9a('0xf'));var Redis=require('ioredis');var authService=require(_0xad9a('0x10'));var qs=require(_0xad9a('0x11'));var as=require(_0xad9a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad9a('0x13'))(_0xad9a('0x14'));var utils=require(_0xad9a('0x15'));var config=require(_0xad9a('0x16'));var db=require(_0xad9a('0x17'))['db'];config[_0xad9a('0x18')]=_[_0xad9a('0x19')](config[_0xad9a('0x18')],{'host':_0xad9a('0x1a'),'port':0x18eb});var socket=require(_0xad9a('0x1b'))(new Redis(config[_0xad9a('0x18')]));require(_0xad9a('0x1c'))[_0xad9a('0x1d')](socket);function respondWithStatusCode(_0x1ee6f1,_0x32e974){_0x32e974=_0x32e974||0xcc;return function(_0x3fd7f2){if(_0x3fd7f2){return _0x1ee6f1[_0xad9a('0x1e')](_0x32e974);}return _0x1ee6f1[_0xad9a('0x1f')](_0x32e974)[_0xad9a('0x20')]();};}function respondWithResult(_0x55c631,_0x4cedb1){_0x4cedb1=_0x4cedb1||0xc8;return function(_0x3dd5bb){if(_0x3dd5bb){return _0x55c631[_0xad9a('0x1f')](_0x4cedb1)[_0xad9a('0x21')](_0x3dd5bb);}};}function respondWithFilteredResult(_0x53639d,_0x175146){return function(_0x37e821){if(_0x37e821){var _0x4b7385=_0x37e821[_0xad9a('0x22')],_0x52467e=_0x175146[_0xad9a('0x23')],_0x21c727=_0x175146[_0xad9a('0x23')]+_0x175146['limit'],_0x5a3d89;if(_0x21c727>=_0x4b7385){_0x21c727=_0x4b7385;_0x5a3d89=0xc8;}else{_0x5a3d89=0xce;}_0x53639d['status'](_0x5a3d89);return _0x53639d[_0xad9a('0x24')](_0xad9a('0x25'),_0x52467e+'-'+_0x21c727+'/'+_0x4b7385)['json'](_0x37e821);}return null;};}function patchUpdates(_0x2fc491){return function(_0x33630d){try{jsonpatch[_0xad9a('0x26')](_0x33630d,_0x2fc491,!![]);}catch(_0x7b4e8c){return BPromise['reject'](_0x7b4e8c);}return _0x33630d[_0xad9a('0x27')]();};}function saveUpdates(_0x2e3b99,_0x550c00){return function(_0xe3f23e){if(_0xe3f23e){return _0xe3f23e[_0xad9a('0x28')](_0x2e3b99)['then'](function(_0x4204fb){return _0x4204fb;});}return null;};}function removeEntity(_0x405af1,_0x998f54){return function(_0x4f44ec){if(_0x4f44ec){return _0x4f44ec['destroy']()[_0xad9a('0x29')](function(){var _0x45b9e6=_0x4f44ec[_0xad9a('0x2a')]({'plain':!![]});var _0x3c009b=_0xad9a('0x2b');return db[_0xad9a('0x2c')]['destroy']({'where':{'type':_0x3c009b,'resourceId':_0x45b9e6['id']}})[_0xad9a('0x29')](function(){return _0x4f44ec;});})[_0xad9a('0x29')](function(){_0x405af1['status'](0xcc)[_0xad9a('0x20')]();});}};}function handleEntityNotFound(_0x12615c,_0x339a05){return function(_0xdea1f4){if(!_0xdea1f4){_0x12615c[_0xad9a('0x1e')](0x194);}return _0xdea1f4;};}function handleError(_0x1b0215,_0x877774){_0x877774=_0x877774||0x1f4;return function(_0xa6c35b){logger[_0xad9a('0x2d')](_0xa6c35b[_0xad9a('0x2e')]);if(_0xa6c35b[_0xad9a('0x2f')]){delete _0xa6c35b[_0xad9a('0x2f')];}_0x1b0215['status'](_0x877774)['send'](_0xa6c35b);};}exports[_0xad9a('0x30')]=function(_0x251b19,_0x50304a){var _0x34811d={},_0x5ee7cf={},_0x1a243a={'count':0x0,'rows':[]};var _0x1ff83b=_[_0xad9a('0x31')](db['CmList'][_0xad9a('0x32')],function(_0x5e214a){return{'name':_0x5e214a[_0xad9a('0x33')],'type':_0x5e214a[_0xad9a('0x34')][_0xad9a('0x35')]};});_0x5ee7cf['model']=_[_0xad9a('0x31')](_0x1ff83b,_0xad9a('0x2f'));_0x5ee7cf[_0xad9a('0x36')]=_[_0xad9a('0x37')](_0x251b19['query']);_0x5ee7cf[_0xad9a('0x38')]=_['intersection'](_0x5ee7cf['model'],_0x5ee7cf[_0xad9a('0x36')]);_0x34811d[_0xad9a('0x39')]=_[_0xad9a('0x3a')](_0x5ee7cf['model'],qs[_0xad9a('0x3b')](_0x251b19[_0xad9a('0x36')][_0xad9a('0x3b')]));_0x34811d[_0xad9a('0x39')]=_0x34811d['attributes']['length']?_0x34811d[_0xad9a('0x39')]:_0x5ee7cf[_0xad9a('0x3c')];if(!_0x251b19[_0xad9a('0x36')][_0xad9a('0x3d')]('nolimit')){_0x34811d[_0xad9a('0x3e')]=qs[_0xad9a('0x3e')](_0x251b19[_0xad9a('0x36')][_0xad9a('0x3e')]);_0x34811d['offset']=qs[_0xad9a('0x23')](_0x251b19[_0xad9a('0x36')][_0xad9a('0x23')]);}_0x34811d[_0xad9a('0x3f')]=qs[_0xad9a('0x40')](_0x251b19[_0xad9a('0x36')][_0xad9a('0x40')]);_0x34811d['where']=qs[_0xad9a('0x38')](_[_0xad9a('0x41')](_0x251b19[_0xad9a('0x36')],_0x5ee7cf[_0xad9a('0x38')]),_0x1ff83b);if(_0x251b19[_0xad9a('0x36')][_0xad9a('0x42')]){_0x34811d[_0xad9a('0x43')]=_[_0xad9a('0x44')](_0x34811d[_0xad9a('0x43')],{'$or':_['map'](_0x1ff83b,function(_0x8bb1e5){if(_0x8bb1e5[_0xad9a('0x34')]!==_0xad9a('0x45')){var _0x3c2f5c={};_0x3c2f5c[_0x8bb1e5[_0xad9a('0x2f')]]={'$like':'%'+_0x251b19[_0xad9a('0x36')][_0xad9a('0x42')]+'%'};return _0x3c2f5c;}})});}_0x34811d=_[_0xad9a('0x44')]({},_0x34811d,_0x251b19[_0xad9a('0x46')]);var _0x52f68b={'where':_0x34811d['where']};return db[_0xad9a('0x47')][_0xad9a('0x22')](_0x52f68b)['then'](function(_0x1182a1){_0x1a243a[_0xad9a('0x22')]=_0x1182a1;if(_0x251b19[_0xad9a('0x36')][_0xad9a('0x48')]){_0x34811d[_0xad9a('0x49')]=[{'all':!![]}];}return db[_0xad9a('0x47')]['findAll'](_0x34811d);})['then'](function(_0x247f9e){_0x1a243a[_0xad9a('0x4a')]=_0x247f9e;return _0x1a243a;})['then'](respondWithFilteredResult(_0x50304a,_0x34811d))['catch'](handleError(_0x50304a,null));};exports[_0xad9a('0x4b')]=function(_0x2309a5,_0x1fe849){var _0x363a2c={'raw':![],'where':{'id':_0x2309a5['params']['id']}},_0x2b68b2={};_0x2b68b2[_0xad9a('0x3c')]=_[_0xad9a('0x37')](db['CmList'][_0xad9a('0x32')]);_0x2b68b2[_0xad9a('0x36')]=_[_0xad9a('0x37')](_0x2309a5['query']);_0x2b68b2[_0xad9a('0x38')]=_[_0xad9a('0x3a')](_0x2b68b2[_0xad9a('0x3c')],_0x2b68b2[_0xad9a('0x36')]);_0x363a2c[_0xad9a('0x39')]=_[_0xad9a('0x3a')](_0x2b68b2[_0xad9a('0x3c')],qs[_0xad9a('0x3b')](_0x2309a5['query'][_0xad9a('0x3b')]));_0x363a2c['attributes']=_0x363a2c[_0xad9a('0x39')][_0xad9a('0x4c')]?_0x363a2c[_0xad9a('0x39')]:_0x2b68b2[_0xad9a('0x3c')];if(_0x2309a5['query'][_0xad9a('0x48')]){_0x363a2c['include']=[{'all':!![]}];}_0x363a2c=_[_0xad9a('0x44')]({},_0x363a2c,_0x2309a5[_0xad9a('0x46')]);return db[_0xad9a('0x47')][_0xad9a('0x4d')](_0x363a2c)[_0xad9a('0x29')](handleEntityNotFound(_0x1fe849,null))[_0xad9a('0x29')](respondWithResult(_0x1fe849,null))[_0xad9a('0x4e')](handleError(_0x1fe849,null));};exports[_0xad9a('0x4f')]=function(_0x2f9e06,_0x4c3cea){return db[_0xad9a('0x47')][_0xad9a('0x4f')](_0x2f9e06[_0xad9a('0x50')],{})[_0xad9a('0x29')](function(_0x524ae7){var _0x2e3e4e=_0x2f9e06[_0xad9a('0x51')][_0xad9a('0x2a')]({'plain':!![]});if(!_0x2e3e4e)throw new Error(_0xad9a('0x52'));if(_0x2e3e4e[_0xad9a('0x53')]==='user'){var _0x577898=_0x524ae7[_0xad9a('0x2a')]({'plain':!![]});var _0x3e5947='Lists';return db[_0xad9a('0x54')][_0xad9a('0x4d')]({'where':{'name':_0x3e5947,'userProfileId':_0x2e3e4e[_0xad9a('0x55')]},'raw':!![]})['then'](function(_0x1e0d2f){if(_0x1e0d2f&&_0x1e0d2f['autoAssociation']===0x0){return db[_0xad9a('0x2c')][_0xad9a('0x4f')]({'name':_0x577898[_0xad9a('0x2f')],'resourceId':_0x577898['id'],'type':_0x1e0d2f[_0xad9a('0x2f')],'sectionId':_0x1e0d2f['id']},{})['then'](function(){return _0x524ae7;});}else{return _0x524ae7;}})[_0xad9a('0x4e')](function(_0x4893ca){logger[_0xad9a('0x2d')](_0xad9a('0x56'),_0x4893ca);throw _0x4893ca;});}return _0x524ae7;})[_0xad9a('0x29')](respondWithResult(_0x4c3cea,0xc9))[_0xad9a('0x4e')](handleError(_0x4c3cea,null));};exports[_0xad9a('0x28')]=function(_0x95307d,_0x34749a){if(_0x95307d[_0xad9a('0x50')]['id']){delete _0x95307d[_0xad9a('0x50')]['id'];}return db[_0xad9a('0x47')][_0xad9a('0x4d')]({'where':{'id':_0x95307d['params']['id']}})['then'](handleEntityNotFound(_0x34749a,null))[_0xad9a('0x29')](saveUpdates(_0x95307d[_0xad9a('0x50')],null))[_0xad9a('0x29')](respondWithResult(_0x34749a,null))[_0xad9a('0x4e')](handleError(_0x34749a,null));};exports[_0xad9a('0x57')]=function(_0x473bca,_0x2bda3f){return db[_0xad9a('0x47')][_0xad9a('0x4d')]({'where':{'id':_0x473bca[_0xad9a('0x58')]['id']}})[_0xad9a('0x29')](handleEntityNotFound(_0x2bda3f,null))[_0xad9a('0x29')](removeEntity(_0x2bda3f,null))[_0xad9a('0x4e')](handleError(_0x2bda3f,null));};exports[_0xad9a('0x59')]=function(_0x581a5b,_0x57ffea){return db[_0xad9a('0x47')][_0xad9a('0x59')]()[_0xad9a('0x29')](respondWithResult(_0x57ffea,null))[_0xad9a('0x4e')](handleError(_0x57ffea,null));};exports[_0xad9a('0x5a')]=function(_0x443cfb,_0x49a590,_0x4d78f0){if(_0x443cfb[_0xad9a('0x50')]['id']){delete _0x443cfb[_0xad9a('0x50')]['id'];}return db['CmList'][_0xad9a('0x4d')]({'where':{'id':_0x443cfb['params']['id']}})['then'](handleEntityNotFound(_0x49a590,null))[_0xad9a('0x29')](function(_0x561145){if(_0x561145){_0x443cfb[_0xad9a('0x50')][_0xad9a('0x5b')]=_0x561145['id'];return db[_0xad9a('0x5c')][_0xad9a('0x4f')](_0x443cfb['body']);}})[_0xad9a('0x29')](respondWithResult(_0x49a590,null))['catch'](handleError(_0x49a590,null));};exports[_0xad9a('0x5d')]=function(_0xcf33d3,_0x3d2b37,_0x4121d4){var _0x132eff={'raw':![],'where':{}};var _0x1f9fdf={};var _0x1502bc={'count':0x0,'rows':[]};return db['CmList'][_0xad9a('0x5e')]({'where':{'id':_0xcf33d3[_0xad9a('0x58')]['id']}})[_0xad9a('0x29')](handleEntityNotFound(_0x3d2b37,null))[_0xad9a('0x29')](function(_0x2b0521){if(_0x2b0521){_0x1f9fdf['model']=_[_0xad9a('0x37')](db[_0xad9a('0x5c')][_0xad9a('0x32')]);_0x1f9fdf['query']=_[_0xad9a('0x37')](_0xcf33d3[_0xad9a('0x36')]);_0x1f9fdf[_0xad9a('0x38')]=_['intersection'](_0x1f9fdf[_0xad9a('0x3c')],_0x1f9fdf[_0xad9a('0x36')]);_0x132eff[_0xad9a('0x39')]=_[_0xad9a('0x3a')](_0x1f9fdf[_0xad9a('0x3c')],qs[_0xad9a('0x3b')](_0xcf33d3[_0xad9a('0x36')][_0xad9a('0x3b')]));_0x132eff[_0xad9a('0x39')]=_0x132eff[_0xad9a('0x39')][_0xad9a('0x4c')]?_0x132eff[_0xad9a('0x39')]:_0x1f9fdf[_0xad9a('0x3c')];if(!_0xcf33d3[_0xad9a('0x36')][_0xad9a('0x3d')](_0xad9a('0x5f'))){_0x132eff['limit']=qs[_0xad9a('0x3e')](_0xcf33d3[_0xad9a('0x36')]['limit']);_0x132eff['offset']=qs[_0xad9a('0x23')](_0xcf33d3[_0xad9a('0x36')][_0xad9a('0x23')]);}_0x132eff[_0xad9a('0x3f')]=qs[_0xad9a('0x40')](_0xcf33d3[_0xad9a('0x36')][_0xad9a('0x40')]);_0x132eff['where']=qs[_0xad9a('0x38')](_[_0xad9a('0x41')](_0xcf33d3[_0xad9a('0x36')],_0x1f9fdf[_0xad9a('0x38')]));_0x132eff['where'][_0xad9a('0x5b')]=_0x2b0521['id'];if(_0xcf33d3[_0xad9a('0x36')]['filter']){_0x132eff['where']=_['merge'](_0x132eff[_0xad9a('0x43')],{'$or':_[_0xad9a('0x31')](_0x132eff[_0xad9a('0x39')],function(_0xc9df0d){var _0x25bc24={};_0x25bc24[_0xc9df0d]={'$like':'%'+_0xcf33d3[_0xad9a('0x36')][_0xad9a('0x42')]+'%'};return _0x25bc24;})});}_0x132eff=_[_0xad9a('0x44')]({},_0x132eff,_0xcf33d3[_0xad9a('0x46')]);return db['Disposition'][_0xad9a('0x22')]({'where':_0x132eff[_0xad9a('0x43')]})[_0xad9a('0x29')](function(_0x148df6){_0x1502bc['count']=_0x148df6;if(_0xcf33d3[_0xad9a('0x36')][_0xad9a('0x48')]){_0x132eff[_0xad9a('0x49')]=[{'all':!![]}];}return db[_0xad9a('0x5c')][_0xad9a('0x60')](_0x132eff);})[_0xad9a('0x29')](function(_0x192ead){_0x1502bc[_0xad9a('0x4a')]=_0x192ead;return _0x1502bc;});}})[_0xad9a('0x29')](respondWithFilteredResult(_0x3d2b37,_0x132eff))[_0xad9a('0x4e')](handleError(_0x3d2b37,null));};exports[_0xad9a('0x61')]=function(_0x52368a,_0x12ea73,_0x145eca){return db[_0xad9a('0x47')]['find']({'where':{'id':_0x52368a[_0xad9a('0x58')]['id']}})['then'](handleEntityNotFound(_0x12ea73,null))[_0xad9a('0x29')](function(_0x36d524){if(_0x36d524){return _0x36d524[_0xad9a('0x61')](_0x52368a['query'][_0xad9a('0x62')]);}})[_0xad9a('0x29')](respondWithStatusCode(_0x12ea73,null))[_0xad9a('0x4e')](handleError(_0x12ea73,null));};exports[_0xad9a('0x63')]=function(_0x4a851f,_0x58616c,_0x1e7d16){return db[_0xad9a('0x47')][_0xad9a('0x4d')]({'where':{'id':_0x4a851f[_0xad9a('0x58')]['id']}})[_0xad9a('0x29')](handleEntityNotFound(_0x58616c,null))[_0xad9a('0x29')](function(_0x230958){if(_0x230958){var _0x3cd5a=[];var _0x2c3d8a={'success':[],'errors':[]};return db[_0xad9a('0x64')]['describe']()[_0xad9a('0x29')](function(_0x1892b2){if(_0x4a851f['body'][_0xad9a('0x65')]&&_[_0xad9a('0x66')](_0x4a851f[_0xad9a('0x50')]['tags'])){if(_0x4a851f[_0xad9a('0x50')][_0xad9a('0x65')][_0xad9a('0x4c')]){_0x4a851f[_0xad9a('0x50')][_0xad9a('0x65')]=_0x4a851f['body'][_0xad9a('0x65')][_0xad9a('0x67')](';')+';';}else{_0x4a851f['body']['tags']=null;}}else{_0x4a851f[_0xad9a('0x50')][_0xad9a('0x65')]=null;}if(_0x4a851f[_0xad9a('0x50')]&&_['isArray'](_0x4a851f[_0xad9a('0x50')])){for(var _0x22a440=0x0;_0x22a440<_0x4a851f[_0xad9a('0x50')][_0xad9a('0x4c')];_0x22a440+=0x1){_0x4a851f['body'][_0x22a440][_0xad9a('0x5b')]=_0x4a851f['params']['id'];_0x3cd5a[_0xad9a('0x68')](_0x4a851f['body'][_0x22a440]);}return BPromise[_0xad9a('0x69')](_0x3cd5a,function(_0x319695){return db['CmContact'][_0xad9a('0x4f')](_[_0xad9a('0x6a')](_0x319695,[_0xad9a('0x62'),'id'])||{},{'fields':_[_0xad9a('0x37')](_0x1892b2),'raw':!![]})[_0xad9a('0x29')](function(_0x45f4a9){_0x2c3d8a[_0xad9a('0x6b')][_0xad9a('0x68')](_0x45f4a9[_0xad9a('0x6c')]);})[_0xad9a('0x4e')](function(_0x346389){_0x2c3d8a['errors']['push']({'data':_0x319695,'error':_0x346389[_0xad9a('0x6d')]});});})[_0xad9a('0x29')](function(_0x2b6f6f){return _0x2c3d8a;})['catch'](function(_0x453851){return _0x453851;});}else{_0x58616c[_0xad9a('0x1f')](0x190)[_0xad9a('0x21')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x58616c,null))[_0xad9a('0x4e')](handleError(_0x58616c,null));};exports['getContacts']=function(_0x1b70cf,_0x12be6a,_0x567474){var _0x18beef;return db[_0xad9a('0x47')][_0xad9a('0x4d')]({'where':{'id':_0x1b70cf[_0xad9a('0x58')]['id']},'include':[{'model':db[_0xad9a('0x6e')],'as':_0xad9a('0x6f')}]})[_0xad9a('0x29')](handleEntityNotFound(_0x12be6a,null))[_0xad9a('0x29')](function(_0x221b80){if(_0x221b80){_0x18beef=_0x221b80;return db['CmContact'][_0xad9a('0x32')];}})['then'](function(_0xaaa685){if(_0xaaa685){var _0x571640={};var _0x5e5c58={};_0x5e5c58[_0xad9a('0x3c')]=_[_0xad9a('0x70')](_[_0xad9a('0x37')](_0xaaa685),_[_0xad9a('0x31')](_0x18beef[_0xad9a('0x6f')],function(_0x428835){return util[_0xad9a('0x71')](_0xad9a('0x72'),_0x428835['id']);}));_0x5e5c58[_0xad9a('0x36')]=_[_0xad9a('0x37')](_0x1b70cf[_0xad9a('0x36')]);_0x5e5c58['filters']=_[_0xad9a('0x3a')](_0x5e5c58[_0xad9a('0x3c')],_0x5e5c58[_0xad9a('0x36')]);_0x571640[_0xad9a('0x39')]=_['intersection'](_0x5e5c58['model'],qs[_0xad9a('0x3b')](_0x1b70cf['query']['fields']));_0x571640['attributes']=_0x571640[_0xad9a('0x39')]['length']?_0x571640[_0xad9a('0x39')]:_0x5e5c58[_0xad9a('0x3c')];if(!_0x1b70cf[_0xad9a('0x36')][_0xad9a('0x3d')]('nolimit')){_0x571640[_0xad9a('0x3e')]=qs['limit'](_0x1b70cf[_0xad9a('0x36')][_0xad9a('0x3e')]);_0x571640[_0xad9a('0x23')]=qs['offset'](_0x1b70cf['query'][_0xad9a('0x23')]);}_0x571640[_0xad9a('0x3f')]=qs['sort'](_0x1b70cf['query'][_0xad9a('0x40')]);_0x571640[_0xad9a('0x43')]=qs[_0xad9a('0x38')](_['pick'](_0x1b70cf[_0xad9a('0x36')],_0x5e5c58['filters']));_0x571640[_0xad9a('0x73')]=!![];if(_0x1b70cf[_0xad9a('0x36')][_0xad9a('0x42')]){_0x571640[_0xad9a('0x43')]=_[_0xad9a('0x44')](_0x571640[_0xad9a('0x43')],{'$or':_[_0xad9a('0x31')](_0x571640[_0xad9a('0x39')],function(_0xacc3b4){var _0x2fa0e9={};_0x2fa0e9[_0xacc3b4]={'$like':'%'+_0x1b70cf['query'][_0xad9a('0x42')]+'%'};return _0x2fa0e9;})});}_0x571640=_['merge']({},_0x571640,_0x1b70cf[_0xad9a('0x46')]);return _0x18beef['getContacts'](_0x571640);}})[_0xad9a('0x29')](respondWithResult(_0x12be6a,null))['catch'](handleError(_0x12be6a,null));};exports[_0xad9a('0x74')]=function(_0x513b83,_0x4f7f50,_0x5f2d19){var _0x43d0a6;return db[_0xad9a('0x47')][_0xad9a('0x4d')]({'where':{'id':_0x513b83[_0xad9a('0x58')]['id']},'include':[{'model':db[_0xad9a('0x6e')],'as':_0xad9a('0x6f')}]})[_0xad9a('0x29')](handleEntityNotFound(_0x4f7f50,null))[_0xad9a('0x29')](function(_0x48acfe){if(_0x48acfe){_0x43d0a6=_0x48acfe;return db[_0xad9a('0x64')][_0xad9a('0x32')];}})[_0xad9a('0x29')](function(_0x7d9a9e){if(_0x7d9a9e){var _0x263f08={};var _0x2c7d54={};_0x2c7d54[_0xad9a('0x3c')]=_[_0xad9a('0x70')](_['keys'](_0x7d9a9e),_[_0xad9a('0x31')](_0x43d0a6[_0xad9a('0x6f')],function(_0x4ffd45){return util['format'](_0xad9a('0x72'),_0x4ffd45['id']);}));_0x2c7d54['query']=_['keys'](_0x513b83[_0xad9a('0x36')]);_0x2c7d54[_0xad9a('0x38')]=_['intersection'](_0x2c7d54[_0xad9a('0x3c')],_0x2c7d54[_0xad9a('0x36')]);_0x263f08['attributes']=_[_0xad9a('0x3a')](_0x2c7d54['model'],qs[_0xad9a('0x3b')](_0x513b83[_0xad9a('0x36')][_0xad9a('0x3b')]));_0x263f08[_0xad9a('0x39')]=_0x263f08[_0xad9a('0x39')][_0xad9a('0x4c')]?_0x263f08[_0xad9a('0x39')]:_0x2c7d54[_0xad9a('0x3c')];if(!_0x513b83[_0xad9a('0x36')][_0xad9a('0x3d')](_0xad9a('0x5f'))){_0x263f08['limit']=qs['limit'](_0x513b83[_0xad9a('0x36')][_0xad9a('0x3e')]);_0x263f08[_0xad9a('0x23')]=qs[_0xad9a('0x23')](_0x513b83[_0xad9a('0x36')][_0xad9a('0x23')]);}_0x263f08[_0xad9a('0x3f')]=qs[_0xad9a('0x40')](_0x513b83['query'][_0xad9a('0x40')]);_0x263f08[_0xad9a('0x43')]=qs[_0xad9a('0x38')](_['pick'](_0x513b83[_0xad9a('0x36')],_0x2c7d54[_0xad9a('0x38')]));_0x263f08['raw']=!![];if(_0x513b83['query'][_0xad9a('0x42')]){_0x263f08[_0xad9a('0x43')]=_[_0xad9a('0x44')](_0x263f08[_0xad9a('0x43')],{'$or':_['map'](_0x263f08[_0xad9a('0x39')],function(_0x19ade4){var _0x5a3011={};_0x5a3011[_0x19ade4]={'$like':'%'+_0x513b83['query'][_0xad9a('0x42')]+'%'};return _0x5a3011;})});}_0x263f08=_[_0xad9a('0x44')]({},_0x263f08,_0x513b83['options']);return _0x43d0a6[_0xad9a('0x75')](_0x263f08);}})[_0xad9a('0x29')](function(_0x11be12){if(!_['isEmpty'](_0x11be12)){var _0x2303e2=toCsv(_0x11be12);var _0x82a856=Date[_0xad9a('0x76')]();fs[_0xad9a('0x77')](util[_0xad9a('0x71')](_0xad9a('0x78'),_0x43d0a6['id'],_0x82a856),_0x2303e2);_0x4f7f50[_0xad9a('0x79')](_0xad9a('0x7a'),_0xad9a('0x7b')+util[_0xad9a('0x71')](_0xad9a('0x7c'),_0x43d0a6['id'],_0x82a856));_0x4f7f50[_0xad9a('0x79')](_0xad9a('0x7d'),'text/csv');return _0x4f7f50['download'](util[_0xad9a('0x71')](_0xad9a('0x78'),_0x43d0a6['id'],_0x82a856));}else{return _0x4f7f50['sendStatus'](0xcc);}})[_0xad9a('0x4e')](handleError(_0x4f7f50,null));};exports[_0xad9a('0x7e')]=function(_0x5b5dc6,_0x46c64b,_0x22a0a7){var _0x2eac2f;delete _0x5b5dc6[_0xad9a('0x50')]['id'];return db[_0xad9a('0x47')][_0xad9a('0x5e')]({'where':{'id':_0x5b5dc6[_0xad9a('0x58')]['id']}})[_0xad9a('0x29')](handleEntityNotFound(_0x46c64b,null))['then'](function(_0x34b404){if(_0x34b404){return db[_0xad9a('0x7f')][_0xad9a('0x80')](function(_0x39767f){return db[_0xad9a('0x6e')][_0xad9a('0x4f')](_0x5b5dc6['body'],{'transaction':_0x39767f})[_0xad9a('0x29')](function(_0x1d9453){_0x2eac2f=_0x1d9453;return _0x34b404['addCustomFields'](_0x1d9453,{'transaction':_0x39767f});})[_0xad9a('0x29')](function(){var _0x57f5a0={'type':db[_0xad9a('0x81')]['TEXT'],'transaction':_0x39767f};switch(_0x5b5dc6[_0xad9a('0x50')]['type']){case _0xad9a('0x82'):_0x57f5a0[_0xad9a('0x34')]=db[_0xad9a('0x81')][_0xad9a('0x83')];break;case _0xad9a('0x84'):_0x57f5a0[_0xad9a('0x34')]=db['Sequelize']['INTEGER'];break;case _0xad9a('0x85'):_0x57f5a0[_0xad9a('0x34')]=db['Sequelize'][_0xad9a('0x86')];_0x57f5a0[_0xad9a('0x87')]=![];break;default:}return db[_0xad9a('0x7f')]['queryInterface'][_0xad9a('0x88')](_0xad9a('0x89'),util[_0xad9a('0x71')](_0xad9a('0x8a'),_0x2eac2f['id']),_0x57f5a0);})['then'](function(){return _0x2eac2f;});});}})['then'](respondWithResult(_0x46c64b,null))[_0xad9a('0x4e')](handleError(_0x46c64b,null));};exports[_0xad9a('0x8b')]=function(_0x39d297,_0x305757,_0x4d81a6){var _0x147dd4={};var _0x38e5a1={};var _0x2172a3;var _0x3fae31;return db['CmList'][_0xad9a('0x5e')]({'where':{'id':_0x39d297['params']['id']}})[_0xad9a('0x29')](handleEntityNotFound(_0x305757,null))[_0xad9a('0x29')](function(_0x42b112){if(_0x42b112){_0x2172a3=_0x42b112;_0x38e5a1[_0xad9a('0x3c')]=_[_0xad9a('0x37')](db[_0xad9a('0x6e')][_0xad9a('0x32')]);_0x38e5a1[_0xad9a('0x36')]=_[_0xad9a('0x37')](_0x39d297[_0xad9a('0x36')]);_0x38e5a1[_0xad9a('0x38')]=_[_0xad9a('0x3a')](_0x38e5a1['model'],_0x38e5a1[_0xad9a('0x36')]);_0x147dd4['attributes']=_[_0xad9a('0x3a')](_0x38e5a1[_0xad9a('0x3c')],qs[_0xad9a('0x3b')](_0x39d297[_0xad9a('0x36')][_0xad9a('0x3b')]));_0x147dd4['attributes']=_0x147dd4['attributes']['length']?_0x147dd4['attributes']:_0x38e5a1['model'];_0x147dd4['order']=qs['sort'](_0x39d297['query'][_0xad9a('0x40')]);_0x147dd4['where']=qs[_0xad9a('0x38')](_['pick'](_0x39d297[_0xad9a('0x36')],_0x38e5a1[_0xad9a('0x38')]));_0x147dd4[_0xad9a('0x43')]=_['merge'](_0x147dd4[_0xad9a('0x43')],{'$or':[{'ListId':_0x42b112['id']},{'ListId':null}]});if(_0x39d297[_0xad9a('0x36')][_0xad9a('0x42')]){_0x147dd4[_0xad9a('0x43')]=_[_0xad9a('0x44')](_0x147dd4[_0xad9a('0x43')],{'$or':_[_0xad9a('0x31')](_0x147dd4[_0xad9a('0x39')],function(_0x2bd3f9){var _0x1a2049={};_0x1a2049[_0x2bd3f9]={'$like':'%'+_0x39d297[_0xad9a('0x36')][_0xad9a('0x42')]+'%'};return _0x1a2049;})});}_0x147dd4=_[_0xad9a('0x44')]({},_0x147dd4,_0x39d297[_0xad9a('0x46')]);return db[_0xad9a('0x6e')][_0xad9a('0x8c')](_0x147dd4);}})[_0xad9a('0x29')](respondWithResult(_0x305757,null))[_0xad9a('0x4e')](handleError(_0x305757,null));};exports[_0xad9a('0x8d')]=function(_0x39045d,_0x450c09,_0x2f3f00){return db['CmList'][_0xad9a('0x4d')]({'where':{'id':_0x39045d['params']['id']}})[_0xad9a('0x29')](handleEntityNotFound(_0x450c09,null))[_0xad9a('0x29')](function(_0x30229a){if(_0x30229a){return _0x30229a[_0xad9a('0x8d')](_0x39045d[_0xad9a('0x50')]['ids'],_['omit'](_0x39045d[_0xad9a('0x50')],[_0xad9a('0x62'),'id'])||{})['spread'](function(_0x5dc382){for(var _0x2bbe51=0x0;_0x2bbe51<_0x39045d['body'][_0xad9a('0x62')][_0xad9a('0x4c')];_0x2bbe51+=0x1){socket[_0xad9a('0x8e')](_0xad9a('0x8f'),{'UserId':_0x39045d[_0xad9a('0x50')][_0xad9a('0x62')][_0x2bbe51],'CmListId':_0x39045d[_0xad9a('0x58')]['id']});}return _0x5dc382;});}})[_0xad9a('0x29')](respondWithResult(_0x450c09,null))[_0xad9a('0x4e')](handleError(_0x450c09,null));};exports['removeAgents']=function(_0x16763b,_0x5d7017,_0x25b41e){return db[_0xad9a('0x47')]['find']({'where':{'id':_0x16763b[_0xad9a('0x58')]['id']}})[_0xad9a('0x29')](handleEntityNotFound(_0x5d7017,null))[_0xad9a('0x29')](function(_0x2c4600){if(_0x2c4600){return _0x2c4600[_0xad9a('0x90')](_0x16763b[_0xad9a('0x36')][_0xad9a('0x62')])[_0xad9a('0x29')](function(){if(_[_0xad9a('0x66')](_0x16763b[_0xad9a('0x36')][_0xad9a('0x62')])){for(var _0x339f36=0x0;_0x339f36<_0x16763b[_0xad9a('0x36')]['ids'][_0xad9a('0x4c')];_0x339f36+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x16763b['query'][_0xad9a('0x62')][_0x339f36]),'CmListId':Number(_0x16763b[_0xad9a('0x58')]['id'])});}}else{socket['emit'](_0xad9a('0x91'),{'UserId':Number(_0x16763b['query'][_0xad9a('0x62')]),'CmListId':Number(_0x16763b['params']['id'])});}});}})[_0xad9a('0x29')](respondWithStatusCode(_0x5d7017,null))[_0xad9a('0x4e')](handleError(_0x5d7017,null));};exports['getAgents']=function(_0x1cbe24,_0x2c57ee,_0x3710e4){var _0x43c337={};var _0xa2ac5a={};var _0x19f755;var _0x52de5d;return db[_0xad9a('0x47')][_0xad9a('0x5e')]({'where':{'id':_0x1cbe24[_0xad9a('0x58')]['id']}})[_0xad9a('0x29')](handleEntityNotFound(_0x2c57ee,null))[_0xad9a('0x29')](function(_0x3c6cab){if(_0x3c6cab){_0x19f755=_0x3c6cab;_0xa2ac5a[_0xad9a('0x3c')]=_['keys'](db[_0xad9a('0x92')][_0xad9a('0x32')]);_0xa2ac5a[_0xad9a('0x36')]=_['keys'](_0x1cbe24[_0xad9a('0x36')]);_0xa2ac5a[_0xad9a('0x38')]=_[_0xad9a('0x3a')](_0xa2ac5a[_0xad9a('0x3c')],_0xa2ac5a[_0xad9a('0x36')]);_0x43c337[_0xad9a('0x39')]=_[_0xad9a('0x3a')](_0xa2ac5a['model'],qs[_0xad9a('0x3b')](_0x1cbe24[_0xad9a('0x36')][_0xad9a('0x3b')]));_0x43c337[_0xad9a('0x39')]=_0x43c337[_0xad9a('0x39')][_0xad9a('0x4c')]?_0x43c337[_0xad9a('0x39')]:_0xa2ac5a[_0xad9a('0x3c')];_0x43c337[_0xad9a('0x3f')]=qs['sort'](_0x1cbe24['query'][_0xad9a('0x40')]);_0x43c337[_0xad9a('0x43')]=qs[_0xad9a('0x38')](_['pick'](_0x1cbe24[_0xad9a('0x36')],_0xa2ac5a[_0xad9a('0x38')]));if(_0x1cbe24[_0xad9a('0x36')][_0xad9a('0x42')]){_0x43c337[_0xad9a('0x43')]=_['merge'](_0x43c337[_0xad9a('0x43')],{'$or':_[_0xad9a('0x31')](_0x43c337[_0xad9a('0x39')],function(_0x214b99){var _0x1aab9b={};_0x1aab9b[_0x214b99]={'$like':'%'+_0x1cbe24[_0xad9a('0x36')][_0xad9a('0x42')]+'%'};return _0x1aab9b;})});}_0x43c337=_['merge']({},_0x43c337,_0x1cbe24[_0xad9a('0x46')]);return _0x19f755[_0xad9a('0x93')](_0x43c337);}})[_0xad9a('0x29')](function(_0x1458ce){if(_0x1458ce){_0x52de5d=_0x1458ce['length'];if(!_0x1cbe24[_0xad9a('0x36')][_0xad9a('0x3d')]('nolimit')){_0x43c337[_0xad9a('0x3e')]=qs[_0xad9a('0x3e')](_0x1cbe24[_0xad9a('0x36')][_0xad9a('0x3e')]);_0x43c337[_0xad9a('0x23')]=qs[_0xad9a('0x23')](_0x1cbe24['query'][_0xad9a('0x23')]);}return _0x19f755[_0xad9a('0x93')](_0x43c337);}})[_0xad9a('0x29')](function(_0x43a32d){if(_0x43a32d){return _0x43a32d?{'count':_0x52de5d,'rows':_0x43a32d}:null;}})['then'](respondWithResult(_0x2c57ee,null))[_0xad9a('0x4e')](handleError(_0x2c57ee,null));};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js
index b8c973c..70382b0 100644
--- a/server/api/cmList/cmList.events.js
+++ b/server/api/cmList/cmList.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x04d0=['../../mysqldb','CmList','setMaxListeners','save','emit','hasOwnProperty','events'];(function(_0x3a22bd,_0x5cafa5){var _0x5a6411=function(_0x3a36b3){while(--_0x3a36b3){_0x3a22bd['push'](_0x3a22bd['shift']());}};_0x5a6411(++_0x5cafa5);}(_0x04d0,0x164));var _0x004d=function(_0x47915d,_0x28cc67){_0x47915d=_0x47915d-0x0;var _0x438851=_0x04d0[_0x47915d];return _0x438851;};'use strict';var EventEmitter=require(_0x004d('0x0'));var CmList=require(_0x004d('0x1'))['db'][_0x004d('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x004d('0x3')](0x0);var events={'afterCreate':_0x004d('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a61f8){return function(_0x5ea76e,_0x50ce33,_0x3172e6){CmListEvents[_0x004d('0x5')](_0x5a61f8+':'+_0x5ea76e['id'],_0x5ea76e);CmListEvents[_0x004d('0x5')](_0x5a61f8,_0x5ea76e);_0x3172e6(null);};}for(var e in events){if(events[_0x004d('0x6')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
+var _0xd402=['exports','events','../../mysqldb','CmList','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x34967e,_0x11f483){var _0x406971=function(_0xc805e3){while(--_0xc805e3){_0x34967e['push'](_0x34967e['shift']());}};_0x406971(++_0x11f483);}(_0xd402,0x1d5));var _0x2d40=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0xd402[_0x5ce3c8];return _0xa76867;};'use strict';var EventEmitter=require(_0x2d40('0x0'));var CmList=require(_0x2d40('0x1'))['db'][_0x2d40('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x2d40('0x3')](0x0);var events={'afterCreate':_0x2d40('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x36b51e){return function(_0x17e9c0,_0x54616f,_0x167762){CmListEvents['emit'](_0x36b51e+':'+_0x17e9c0['id'],_0x17e9c0);CmListEvents[_0x2d40('0x5')](_0x36b51e,_0x17e9c0);_0x167762(null);};}for(var e in events){if(events[_0x2d40('0x6')](e)){var event=events[e];CmList[_0x2d40('0x7')](e,emitEvent(event));}}module[_0x2d40('0x8')]=CmListEvents;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js
index 39d2977..8f47da0 100644
--- a/server/api/cmList/cmList.model.js
+++ b/server/api/cmList/cmList.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7da6=['exports','define','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmList.attributes'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7da6,0x124));var _0x67da=function(_0x30bd66,_0x36a93d){_0x30bd66=_0x30bd66-0x0;var _0x74c9dd=_0x7da6[_0x30bd66];return _0x74c9dd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x67da('0x0'))(_0x67da('0x1'));var moment=require(_0x67da('0x2'));var BPromise=require(_0x67da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67da('0x4'));var rimraf=require(_0x67da('0x5'));var config=require(_0x67da('0x6'));var attributes=require(_0x67da('0x7'));module[_0x67da('0x8')]=function(_0x40d5f8,_0x59af9a){return _0x40d5f8[_0x67da('0x9')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a4c=['bluebird','request-promise','path','../../config/environment','./cmList.attributes','define','CmList','cm_lists','lodash','util','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0a4c,0xd4));var _0xc0a4=function(_0x5a8fc3,_0x6292ea){_0x5a8fc3=_0x5a8fc3-0x0;var _0x3dd1e5=_0x0a4c[_0x5a8fc3];return _0x3dd1e5;};'use strict';var _=require(_0xc0a4('0x0'));var util=require(_0xc0a4('0x1'));var logger=require(_0xc0a4('0x2'))(_0xc0a4('0x3'));var moment=require('moment');var BPromise=require(_0xc0a4('0x4'));var rp=require(_0xc0a4('0x5'));var fs=require('fs');var path=require(_0xc0a4('0x6'));var rimraf=require('rimraf');var config=require(_0xc0a4('0x7'));var attributes=require(_0xc0a4('0x8'));module['exports']=function(_0x3ff55f,_0x4cb892){return _0x3ff55f[_0xc0a4('0x9')](_0xc0a4('0xa'),attributes,{'tableName':_0xc0a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js
index 1a2f1db..b37d0a7 100644
--- a/server/api/cmList/cmList.rpc.js
+++ b/server/api/cmList/cmList.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd874=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','CmList,\x20%s,\x20%s','message','result','lodash'];(function(_0x220f7d,_0x6be322){var _0x2dbe6a=function(_0x35e6d7){while(--_0x35e6d7){_0x220f7d['push'](_0x220f7d['shift']());}};_0x2dbe6a(++_0x6be322);}(_0xd874,0x7c));var _0x4d87=function(_0x52a7f0,_0x163c8e){_0x52a7f0=_0x52a7f0-0x0;var _0x178e32=_0xd874[_0x52a7f0];return _0x178e32;};'use strict';var _=require(_0x4d87('0x0'));var util=require('util');var moment=require(_0x4d87('0x1'));var BPromise=require(_0x4d87('0x2'));var rs=require(_0x4d87('0x3'));var fs=require('fs');var Redis=require(_0x4d87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d87('0x5'));var logger=require(_0x4d87('0x6'))(_0x4d87('0x7'));var config=require(_0x4d87('0x8'));var jayson=require(_0x4d87('0x9'));var client=jayson['client'][_0x4d87('0xa')]({'port':0x232a});config[_0x4d87('0xb')]=_[_0x4d87('0xc')](config[_0x4d87('0xb')],{'host':_0x4d87('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d87('0xb')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x95d67f,_0x4c8fb8,_0x545b2f){return new BPromise(function(_0x23dacb,_0x3b8475){return client[_0x4d87('0xe')](_0x95d67f,_0x545b2f)[_0x4d87('0xf')](function(_0x5b5355){logger[_0x4d87('0x10')]('CmList,\x20%s,\x20%s',_0x4c8fb8,_0x4d87('0x11'));logger[_0x4d87('0x12')](_0x4d87('0x13'),_0x4c8fb8,_0x4d87('0x11'),JSON['stringify'](_0x5b5355));if(_0x5b5355[_0x4d87('0x14')]){if(_0x5b5355[_0x4d87('0x14')][_0x4d87('0x15')]===0x1f4){logger['error'](_0x4d87('0x16'),_0x4c8fb8,_0x5b5355['error'][_0x4d87('0x17')]);return _0x3b8475(_0x5b5355[_0x4d87('0x14')][_0x4d87('0x17')]);}logger['error'](_0x4d87('0x16'),_0x4c8fb8,_0x5b5355[_0x4d87('0x14')][_0x4d87('0x17')]);return _0x23dacb(_0x5b5355[_0x4d87('0x14')][_0x4d87('0x17')]);}else{logger[_0x4d87('0x10')](_0x4d87('0x16'),_0x4c8fb8,'request\x20sent');_0x23dacb(_0x5b5355[_0x4d87('0x18')][_0x4d87('0x17')]);}})['catch'](function(_0x6f9632){logger[_0x4d87('0x14')](_0x4d87('0x16'),_0x4c8fb8,_0x6f9632);_0x3b8475(_0x6f9632);});});}
\ No newline at end of file
+var _0x07ee=['../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x322c07,_0xaae292){var _0x424aaa=function(_0x521cb0){while(--_0x521cb0){_0x322c07['push'](_0x322c07['shift']());}};_0x424aaa(++_0xaae292);}(_0x07ee,0x14c));var _0xe07e=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x07ee[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xe07e('0x0'));var util=require('util');var moment=require(_0xe07e('0x1'));var BPromise=require(_0xe07e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe07e('0x3'));var db=require(_0xe07e('0x4'))['db'];var utils=require(_0xe07e('0x5'));var logger=require(_0xe07e('0x6'))('rpc');var config=require(_0xe07e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe07e('0x8')][_0xe07e('0x9')]({'port':0x232a});config[_0xe07e('0xa')]=_[_0xe07e('0xb')](config['redis'],{'host':_0xe07e('0xc'),'port':0x18eb});var socket=require(_0xe07e('0xd'))(new Redis(config['redis']));require(_0xe07e('0xe'))[_0xe07e('0xf')](socket);function respondWithRpcPromise(_0x160b25,_0x5ddca3,_0x11c9c4){return new BPromise(function(_0x15f43c,_0x3e2fe6){return client[_0xe07e('0x10')](_0x160b25,_0x11c9c4)[_0xe07e('0x11')](function(_0x538ccc){logger['info'](_0xe07e('0x12'),_0x5ddca3,_0xe07e('0x13'));logger[_0xe07e('0x14')](_0xe07e('0x15'),_0x5ddca3,_0xe07e('0x13'),JSON['stringify'](_0x538ccc));if(_0x538ccc[_0xe07e('0x16')]){if(_0x538ccc['error'][_0xe07e('0x17')]===0x1f4){logger[_0xe07e('0x16')](_0xe07e('0x12'),_0x5ddca3,_0x538ccc['error']['message']);return _0x3e2fe6(_0x538ccc[_0xe07e('0x16')][_0xe07e('0x18')]);}logger[_0xe07e('0x16')](_0xe07e('0x12'),_0x5ddca3,_0x538ccc['error'][_0xe07e('0x18')]);return _0x15f43c(_0x538ccc['error']['message']);}else{logger[_0xe07e('0x19')]('CmList,\x20%s,\x20%s',_0x5ddca3,_0xe07e('0x13'));_0x15f43c(_0x538ccc['result'][_0xe07e('0x18')]);}})['catch'](function(_0x4878dc){logger[_0xe07e('0x16')](_0xe07e('0x12'),_0x5ddca3,_0x4878dc);_0x3e2fe6(_0x4878dc);});});}
\ No newline at end of file
diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js
index 4ecbf15..9af537d 100644
--- a/server/api/cmList/cmList.socket.js
+++ b/server/api/cmList/cmList.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1939=['register','length','cmList:','./cmList.events','remove','update','emit'];(function(_0x244eb3,_0x9a28e7){var _0x755636=function(_0x31f2ce){while(--_0x31f2ce){_0x244eb3['push'](_0x244eb3['shift']());}};_0x755636(++_0x9a28e7);}(_0x1939,0x1d1));var _0x9193=function(_0x5ebf85,_0x598413){_0x5ebf85=_0x5ebf85-0x0;var _0x5b175a=_0x1939[_0x5ebf85];return _0x5b175a;};'use strict';var CmListEvents=require(_0x9193('0x0'));var events=['save',_0x9193('0x1'),_0x9193('0x2')];function createListener(_0x3628d4,_0x538b4c){return function(_0x12643a){_0x538b4c[_0x9193('0x3')](_0x3628d4,_0x12643a);};}function removeListener(_0x31aa3c,_0x35b1c4){return function(){CmListEvents['removeListener'](_0x31aa3c,_0x35b1c4);};}exports[_0x9193('0x4')]=function(_0x20ab2b){for(var _0x5186dc=0x0,_0x5f7087=events[_0x9193('0x5')];_0x5186dc<_0x5f7087;_0x5186dc++){var _0x488d01=events[_0x5186dc];var _0x327de5=createListener(_0x9193('0x6')+_0x488d01,_0x20ab2b);CmListEvents['on'](_0x488d01,_0x327de5);}};
\ No newline at end of file
+var _0x6b8f=['save','update','emit','removeListener','register','length'];(function(_0x3d4672,_0x298336){var _0x544a88=function(_0x4b3f13){while(--_0x4b3f13){_0x3d4672['push'](_0x3d4672['shift']());}};_0x544a88(++_0x298336);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x55173f,_0xf6405){_0x55173f=_0x55173f-0x0;var _0x52469b=_0x6b8f[_0x55173f];return _0x52469b;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xf6b8('0x0'),'remove',_0xf6b8('0x1')];function createListener(_0x4e006e,_0x5443a1){return function(_0x362c27){_0x5443a1[_0xf6b8('0x2')](_0x4e006e,_0x362c27);};}function removeListener(_0x4d0ee5,_0x2b5ca9){return function(){CmListEvents[_0xf6b8('0x3')](_0x4d0ee5,_0x2b5ca9);};}exports[_0xf6b8('0x4')]=function(_0x549eac){for(var _0x2d035e=0x0,_0x79c66d=events[_0xf6b8('0x5')];_0x2d035e<_0x79c66d;_0x2d035e++){var _0x3c3430=events[_0x2d035e];var _0x557910=createListener('cmList:'+_0x3c3430,_0x549eac);CmListEvents['on'](_0x3c3430,_0x557910);}};
\ No newline at end of file
diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js
index 7367a22..5d9f652 100644
--- a/server/api/cmList/index.js
+++ b/server/api/cmList/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x350f=['update','delete','destroy','removeDispositions','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addAgents'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x350f,0x159));var _0xf350=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x350f[_0x567bcb];return _0x4eebc2;};'use strict';var multer=require(_0xf350('0x0'));var util=require('util');var path=require(_0xf350('0x1'));var timeout=require(_0xf350('0x2'));var express=require('express');var router=express[_0xf350('0x3')]();var auth=require(_0xf350('0x4'));var interaction=require(_0xf350('0x5'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0xf350('0x6')]('/',auth[_0xf350('0x7')](),controller[_0xf350('0x8')]);router[_0xf350('0x6')](_0xf350('0x9'),auth[_0xf350('0x7')](),controller[_0xf350('0xa')]);router[_0xf350('0x6')](_0xf350('0xb'),auth[_0xf350('0x7')](),controller[_0xf350('0xc')]);router['get']('/:id/dispositions',auth[_0xf350('0x7')](),controller[_0xf350('0xd')]);router['get'](_0xf350('0xe'),auth['isAuthenticated'](),controller[_0xf350('0xf')]);router[_0xf350('0x6')](_0xf350('0x10'),auth['isAuthenticated'](),controller['getContactsCsv']);router['get'](_0xf350('0x11'),auth[_0xf350('0x7')](),controller[_0xf350('0x12')]);router[_0xf350('0x6')](_0xf350('0x13'),auth[_0xf350('0x7')](),controller[_0xf350('0x14')]);router[_0xf350('0x15')]('/',auth[_0xf350('0x7')](),controller[_0xf350('0x16')]);router[_0xf350('0x15')](_0xf350('0x17'),auth[_0xf350('0x7')](),controller[_0xf350('0x18')]);router[_0xf350('0x15')](_0xf350('0xe'),auth['isAuthenticated'](),controller[_0xf350('0x19')]);router[_0xf350('0x15')](_0xf350('0x11'),auth['isAuthenticated'](),controller['addCustomField']);router[_0xf350('0x15')](_0xf350('0x13'),auth[_0xf350('0x7')](),controller[_0xf350('0x1a')]);router['put'](_0xf350('0xb'),auth[_0xf350('0x7')](),controller[_0xf350('0x1b')]);router[_0xf350('0x1c')]('/:id',auth[_0xf350('0x7')](),controller[_0xf350('0x1d')]);router['delete'](_0xf350('0x17'),auth[_0xf350('0x7')](),controller[_0xf350('0x1e')]);router[_0xf350('0x1c')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x244d=['multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/fields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addCustomField','addAgents','put','delete','destroy','removeDispositions','exports'];(function(_0x4018f6,_0x11023a){var _0x12b739=function(_0x353e5d){while(--_0x353e5d){_0x4018f6['push'](_0x4018f6['shift']());}};_0x12b739(++_0x11023a);}(_0x244d,0x168));var _0xd244=function(_0x1256ba,_0x2a5bd3){_0x1256ba=_0x1256ba-0x0;var _0xcf2e2e=_0x244d[_0x1256ba];return _0xcf2e2e;};'use strict';var multer=require(_0xd244('0x0'));var util=require(_0xd244('0x1'));var path=require(_0xd244('0x2'));var timeout=require(_0xd244('0x3'));var express=require(_0xd244('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd244('0x5'));var config=require(_0xd244('0x6'));var controller=require('./cmList.controller');router[_0xd244('0x7')]('/',auth[_0xd244('0x8')](),controller[_0xd244('0x9')]);router[_0xd244('0x7')](_0xd244('0xa'),auth[_0xd244('0x8')](),controller[_0xd244('0xb')]);router[_0xd244('0x7')](_0xd244('0xc'),auth['isAuthenticated'](),controller[_0xd244('0xd')]);router[_0xd244('0x7')](_0xd244('0xe'),auth['isAuthenticated'](),controller[_0xd244('0xf')]);router['get']('/:id/contacts',auth[_0xd244('0x8')](),controller['getContacts']);router[_0xd244('0x7')]('/:id/contacts/csv',auth['isAuthenticated'](),controller['getContactsCsv']);router['get'](_0xd244('0x10'),auth[_0xd244('0x8')](),controller['getCustomFields']);router[_0xd244('0x7')](_0xd244('0x11'),auth[_0xd244('0x8')](),controller[_0xd244('0x12')]);router[_0xd244('0x13')]('/',auth['isAuthenticated'](),controller[_0xd244('0x14')]);router[_0xd244('0x13')](_0xd244('0xe'),auth[_0xd244('0x8')](),controller[_0xd244('0x15')]);router[_0xd244('0x13')](_0xd244('0x16'),auth['isAuthenticated'](),controller['addContacts']);router[_0xd244('0x13')](_0xd244('0x10'),auth[_0xd244('0x8')](),controller[_0xd244('0x17')]);router[_0xd244('0x13')](_0xd244('0x11'),auth[_0xd244('0x8')](),controller[_0xd244('0x18')]);router[_0xd244('0x19')]('/:id',auth[_0xd244('0x8')](),controller['update']);router[_0xd244('0x1a')](_0xd244('0xc'),auth['isAuthenticated'](),controller[_0xd244('0x1b')]);router[_0xd244('0x1a')](_0xd244('0xe'),auth[_0xd244('0x8')](),controller[_0xd244('0x1c')]);router[_0xd244('0x1a')](_0xd244('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xd244('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js
index 5af094a..0ff8d87 100644
--- a/server/api/condition/condition.attributes.js
+++ b/server/api/condition/condition.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x5a2ba7,_0x544a7a){var _0x1804a3=function(_0x4869db){while(--_0x4869db){_0x5a2ba7['push'](_0x5a2ba7['shift']());}};_0x1804a3(++_0x544a7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x7579cd,_0x5af01c){var _0x287bb5=function(_0x4d146b){while(--_0x4d146b){_0x7579cd['push'](_0x7579cd['shift']());}};_0x287bb5(++_0x5af01c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js
index bc4dafe..f709c6f 100644
--- a/server/api/condition/condition.controller.js
+++ b/server/api/condition/condition.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b50=['apply','reject','save','destroy','then','error','name','send','update','body','Condition','find','catch','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range'];(function(_0x149190,_0x2d7d5b){var _0x1fb59d=function(_0x4a62e4){while(--_0x4a62e4){_0x149190['push'](_0x149190['shift']());}};_0x1fb59d(++_0x2d7d5b);}(_0x9b50,0x11b));var _0x09b5=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9b50[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0x09b5('0x0'));var emlformat=require(_0x09b5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x09b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09b5('0x3'));var moment=require(_0x09b5('0x4'));var BPromise=require(_0x09b5('0x5'));var Mustache=require(_0x09b5('0x6'));var util=require(_0x09b5('0x7'));var path=require(_0x09b5('0x8'));var sox=require(_0x09b5('0x9'));var csv=require(_0x09b5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x09b5('0xb'));var crypto=require('crypto');var jsforce=require(_0x09b5('0xc'));var deskjs=require(_0x09b5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09b5('0xe'));var Papa=require('papaparse');var Redis=require(_0x09b5('0xf'));var authService=require(_0x09b5('0x10'));var qs=require(_0x09b5('0x11'));var as=require(_0x09b5('0x12'));var hardwareService=require(_0x09b5('0x13'));var logger=require(_0x09b5('0x14'))(_0x09b5('0x15'));var utils=require(_0x09b5('0x16'));var config=require(_0x09b5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa378c4,_0x7543ac){_0x7543ac=_0x7543ac||0xcc;return function(_0x1401fd){if(_0x1401fd){return _0xa378c4[_0x09b5('0x18')](_0x7543ac);}return _0xa378c4[_0x09b5('0x19')](_0x7543ac)[_0x09b5('0x1a')]();};}function respondWithResult(_0x39e2a4,_0x30ea86){_0x30ea86=_0x30ea86||0xc8;return function(_0x586f00){if(_0x586f00){return _0x39e2a4[_0x09b5('0x19')](_0x30ea86)[_0x09b5('0x1b')](_0x586f00);}};}function respondWithFilteredResult(_0x2ed9a2,_0x31e1b7){return function(_0x1ea09c){if(_0x1ea09c){var _0x4c916c=_0x1ea09c['count'],_0xb00b9b=_0x31e1b7[_0x09b5('0x1c')],_0xd7d55b=_0x31e1b7[_0x09b5('0x1c')]+_0x31e1b7[_0x09b5('0x1d')],_0xed4dbb;if(_0xd7d55b>=_0x4c916c){_0xd7d55b=_0x4c916c;_0xed4dbb=0xc8;}else{_0xed4dbb=0xce;}_0x2ed9a2[_0x09b5('0x19')](_0xed4dbb);return _0x2ed9a2[_0x09b5('0x1e')](_0x09b5('0x1f'),_0xb00b9b+'-'+_0xd7d55b+'/'+_0x4c916c)[_0x09b5('0x1b')](_0x1ea09c);}return null;};}function patchUpdates(_0x74f417){return function(_0xa13410){try{jsonpatch[_0x09b5('0x20')](_0xa13410,_0x74f417,!![]);}catch(_0x4ad20c){return BPromise[_0x09b5('0x21')](_0x4ad20c);}return _0xa13410[_0x09b5('0x22')]();};}function saveUpdates(_0x4dd137,_0x4ab5a3){return function(_0xfa67b3){if(_0xfa67b3){return _0xfa67b3['update'](_0x4dd137)['then'](function(_0x1c5625){return _0x1c5625;});}return null;};}function removeEntity(_0x53589a,_0x1e1c9e){return function(_0x2bf0cb){if(_0x2bf0cb){return _0x2bf0cb[_0x09b5('0x23')]()[_0x09b5('0x24')](function(){_0x53589a[_0x09b5('0x19')](0xcc)[_0x09b5('0x1a')]();});}};}function handleEntityNotFound(_0x49db1d,_0x5945dc){return function(_0x373352){if(!_0x373352){_0x49db1d[_0x09b5('0x18')](0x194);}return _0x373352;};}function handleError(_0x4eeb78,_0x12ab1f){_0x12ab1f=_0x12ab1f||0x1f4;return function(_0x4a4fa4){logger[_0x09b5('0x25')](_0x4a4fa4['stack']);if(_0x4a4fa4[_0x09b5('0x26')]){delete _0x4a4fa4['name'];}_0x4eeb78[_0x09b5('0x19')](_0x12ab1f)[_0x09b5('0x27')](_0x4a4fa4);};}exports[_0x09b5('0x28')]=function(_0x289018,_0x4182bf){if(_0x289018[_0x09b5('0x29')]['id']){delete _0x289018[_0x09b5('0x29')]['id'];}return db[_0x09b5('0x2a')][_0x09b5('0x2b')]({'where':{'id':_0x289018['params']['id']}})[_0x09b5('0x24')](handleEntityNotFound(_0x4182bf,null))[_0x09b5('0x24')](saveUpdates(_0x289018['body'],null))[_0x09b5('0x24')](respondWithResult(_0x4182bf,null))['catch'](handleError(_0x4182bf,null));};exports[_0x09b5('0x23')]=function(_0x27ab33,_0x3e6c41){return db[_0x09b5('0x2a')][_0x09b5('0x2b')]({'where':{'id':_0x27ab33['params']['id']}})[_0x09b5('0x24')](handleEntityNotFound(_0x3e6c41,null))['then'](removeEntity(_0x3e6c41,null))[_0x09b5('0x2c')](handleError(_0x3e6c41,null));};
\ No newline at end of file
+var _0x8ed9=['update','then','destroy','end','stack','name','send','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x1a9ed0,_0x1085fc){var _0x47bbd6=function(_0x27bd1c){while(--_0x27bd1c){_0x1a9ed0['push'](_0x1a9ed0['shift']());}};_0x47bbd6(++_0x1085fc);}(_0x8ed9,0x16a));var _0x98ed=function(_0x53d816,_0x1d1594){_0x53d816=_0x53d816-0x0;var _0x17c9ed=_0x8ed9[_0x53d816];return _0x17c9ed;};'use strict';var pdf=require(_0x98ed('0x0'));var emlformat=require(_0x98ed('0x1'));var rimraf=require(_0x98ed('0x2'));var zipdir=require(_0x98ed('0x3'));var jsonpatch=require(_0x98ed('0x4'));var rp=require(_0x98ed('0x5'));var moment=require(_0x98ed('0x6'));var BPromise=require(_0x98ed('0x7'));var Mustache=require(_0x98ed('0x8'));var util=require(_0x98ed('0x9'));var path=require(_0x98ed('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x98ed('0xb'));var fs=require('fs');var _=require(_0x98ed('0xc'));var squel=require(_0x98ed('0xd'));var crypto=require(_0x98ed('0xe'));var jsforce=require(_0x98ed('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x98ed('0x10'));var querystring=require(_0x98ed('0x11'));var Papa=require(_0x98ed('0x12'));var Redis=require(_0x98ed('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x98ed('0x14'));var as=require(_0x98ed('0x15'));var hardwareService=require(_0x98ed('0x16'));var logger=require(_0x98ed('0x17'))(_0x98ed('0x18'));var utils=require(_0x98ed('0x19'));var config=require('../../config/environment');var db=require(_0x98ed('0x1a'))['db'];function respondWithStatusCode(_0x5dba73,_0x631501){_0x631501=_0x631501||0xcc;return function(_0x5cf6ea){if(_0x5cf6ea){return _0x5dba73[_0x98ed('0x1b')](_0x631501);}return _0x5dba73[_0x98ed('0x1c')](_0x631501)['end']();};}function respondWithResult(_0x46c7ff,_0x58417d){_0x58417d=_0x58417d||0xc8;return function(_0x37e26e){if(_0x37e26e){return _0x46c7ff[_0x98ed('0x1c')](_0x58417d)[_0x98ed('0x1d')](_0x37e26e);}};}function respondWithFilteredResult(_0x247e0f,_0x7d296d){return function(_0x333663){if(_0x333663){var _0x5a7c06=_0x333663[_0x98ed('0x1e')],_0x245843=_0x7d296d['offset'],_0x2e5990=_0x7d296d[_0x98ed('0x1f')]+_0x7d296d[_0x98ed('0x20')],_0x27527f;if(_0x2e5990>=_0x5a7c06){_0x2e5990=_0x5a7c06;_0x27527f=0xc8;}else{_0x27527f=0xce;}_0x247e0f[_0x98ed('0x1c')](_0x27527f);return _0x247e0f[_0x98ed('0x21')](_0x98ed('0x22'),_0x245843+'-'+_0x2e5990+'/'+_0x5a7c06)[_0x98ed('0x1d')](_0x333663);}return null;};}function patchUpdates(_0x325357){return function(_0x2939cd){try{jsonpatch[_0x98ed('0x23')](_0x2939cd,_0x325357,!![]);}catch(_0x5c72e3){return BPromise[_0x98ed('0x24')](_0x5c72e3);}return _0x2939cd[_0x98ed('0x25')]();};}function saveUpdates(_0x2846b5,_0x75cf84){return function(_0x12e95c){if(_0x12e95c){return _0x12e95c[_0x98ed('0x26')](_0x2846b5)[_0x98ed('0x27')](function(_0x397a02){return _0x397a02;});}return null;};}function removeEntity(_0x19afe0,_0x48ad17){return function(_0x1ab0db){if(_0x1ab0db){return _0x1ab0db[_0x98ed('0x28')]()['then'](function(){_0x19afe0[_0x98ed('0x1c')](0xcc)[_0x98ed('0x29')]();});}};}function handleEntityNotFound(_0x560e8e,_0x1c2395){return function(_0xf020df){if(!_0xf020df){_0x560e8e[_0x98ed('0x1b')](0x194);}return _0xf020df;};}function handleError(_0x346b99,_0x5ccef9){_0x5ccef9=_0x5ccef9||0x1f4;return function(_0x4c91c7){logger['error'](_0x4c91c7[_0x98ed('0x2a')]);if(_0x4c91c7[_0x98ed('0x2b')]){delete _0x4c91c7[_0x98ed('0x2b')];}_0x346b99[_0x98ed('0x1c')](_0x5ccef9)[_0x98ed('0x2c')](_0x4c91c7);};}exports[_0x98ed('0x26')]=function(_0x50ff00,_0x42dc1a){if(_0x50ff00['body']['id']){delete _0x50ff00[_0x98ed('0x2d')]['id'];}return db[_0x98ed('0x2e')][_0x98ed('0x2f')]({'where':{'id':_0x50ff00[_0x98ed('0x30')]['id']}})[_0x98ed('0x27')](handleEntityNotFound(_0x42dc1a,null))[_0x98ed('0x27')](saveUpdates(_0x50ff00[_0x98ed('0x2d')],null))[_0x98ed('0x27')](respondWithResult(_0x42dc1a,null))[_0x98ed('0x31')](handleError(_0x42dc1a,null));};exports[_0x98ed('0x28')]=function(_0x5a62eb,_0x387d01){return db[_0x98ed('0x2e')]['find']({'where':{'id':_0x5a62eb[_0x98ed('0x30')]['id']}})[_0x98ed('0x27')](handleEntityNotFound(_0x387d01,null))['then'](removeEntity(_0x387d01,null))[_0x98ed('0x31')](handleError(_0x387d01,null));};
\ No newline at end of file
diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js
index 7e50eb5..9b8d1b6 100644
--- a/server/api/condition/condition.model.js
+++ b/server/api/condition/condition.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x95d2=['define','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports'];(function(_0x8d7c55,_0x4ec151){var _0x1e6602=function(_0x253d5){while(--_0x253d5){_0x8d7c55['push'](_0x8d7c55['shift']());}};_0x1e6602(++_0x4ec151);}(_0x95d2,0x6b));var _0x295d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x95d2[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x295d('0x0'));var util=require('util');var logger=require(_0x295d('0x1'))(_0x295d('0x2'));var moment=require(_0x295d('0x3'));var BPromise=require(_0x295d('0x4'));var rp=require(_0x295d('0x5'));var fs=require('fs');var path=require(_0x295d('0x6'));var rimraf=require('rimraf');var config=require(_0x295d('0x7'));var attributes=require(_0x295d('0x8'));module[_0x295d('0x9')]=function(_0x1e216f,_0x4fbae2){return _0x1e216f[_0x295d('0xa')](_0x295d('0xb'),attributes,{'tableName':_0x295d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9012=['rimraf','../../config/environment','./condition.attributes','Condition','tools_conditions','api','bluebird','request-promise','path'];(function(_0x425088,_0x14330d){var _0x26e736=function(_0x42219f){while(--_0x42219f){_0x425088['push'](_0x425088['shift']());}};_0x26e736(++_0x14330d);}(_0x9012,0x191));var _0x2901=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x9012[_0x671369];return _0x33f2b4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2901('0x0'));var moment=require('moment');var BPromise=require(_0x2901('0x1'));var rp=require(_0x2901('0x2'));var fs=require('fs');var path=require(_0x2901('0x3'));var rimraf=require(_0x2901('0x4'));var config=require(_0x2901('0x5'));var attributes=require(_0x2901('0x6'));module['exports']=function(_0x3310c8,_0xf262e9){return _0x3310c8['define'](_0x2901('0x7'),attributes,{'tableName':_0x2901('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js
index 999fb47..fca6ae2 100644
--- a/server/api/condition/condition.rpc.js
+++ b/server/api/condition/condition.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcae4=['stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x130fa6,_0x15c5de){var _0x41e1c9=function(_0x3977e9){while(--_0x3977e9){_0x130fa6['push'](_0x130fa6['shift']());}};_0x41e1c9(++_0x15c5de);}(_0xcae4,0x1d3));var _0x4cae=function(_0x37cbb8,_0x180ad2){_0x37cbb8=_0x37cbb8-0x0;var _0x50378f=_0xcae4[_0x37cbb8];return _0x50378f;};'use strict';var _=require(_0x4cae('0x0'));var util=require(_0x4cae('0x1'));var moment=require(_0x4cae('0x2'));var BPromise=require(_0x4cae('0x3'));var rs=require(_0x4cae('0x4'));var fs=require('fs');var Redis=require(_0x4cae('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4cae('0x6'));var logger=require('../../config/logger')(_0x4cae('0x7'));var config=require('../../config/environment');var jayson=require(_0x4cae('0x8'));var client=jayson[_0x4cae('0x9')][_0x4cae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x61d40b,_0x9aee77,_0x26dc4f){return new BPromise(function(_0x1f81e6,_0x4e4ceb){return client[_0x4cae('0xb')](_0x61d40b,_0x26dc4f)[_0x4cae('0xc')](function(_0x148b19){logger['info']('Condition,\x20%s,\x20%s',_0x9aee77,_0x4cae('0xd'));logger[_0x4cae('0xe')](_0x4cae('0xf'),_0x9aee77,_0x4cae('0xd'),JSON[_0x4cae('0x10')](_0x148b19));if(_0x148b19['error']){if(_0x148b19[_0x4cae('0x11')][_0x4cae('0x12')]===0x1f4){logger[_0x4cae('0x11')](_0x4cae('0x13'),_0x9aee77,_0x148b19['error'][_0x4cae('0x14')]);return _0x4e4ceb(_0x148b19[_0x4cae('0x11')][_0x4cae('0x14')]);}logger['error'](_0x4cae('0x13'),_0x9aee77,_0x148b19[_0x4cae('0x11')][_0x4cae('0x14')]);return _0x1f81e6(_0x148b19['error'][_0x4cae('0x14')]);}else{logger['info'](_0x4cae('0x13'),_0x9aee77,_0x4cae('0xd'));_0x1f81e6(_0x148b19[_0x4cae('0x15')][_0x4cae('0x14')]);}})[_0x4cae('0x16')](function(_0x396813){logger[_0x4cae('0x11')](_0x4cae('0x13'),_0x9aee77,_0x396813);_0x4e4ceb(_0x396813);});});}
\ No newline at end of file
+var _0x3bf6=['request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s'];(function(_0x4205cb,_0x1c1ef7){var _0x494a6b=function(_0x131860){while(--_0x131860){_0x4205cb['push'](_0x4205cb['shift']());}};_0x494a6b(++_0x1c1ef7);}(_0x3bf6,0x142));var _0x63bf=function(_0x2f7e01,_0x52881b){_0x2f7e01=_0x2f7e01-0x0;var _0x52d5fc=_0x3bf6[_0x2f7e01];return _0x52d5fc;};'use strict';var _=require(_0x63bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x63bf('0x1'));var rs=require(_0x63bf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63bf('0x3'))['db'];var utils=require(_0x63bf('0x4'));var logger=require(_0x63bf('0x5'))(_0x63bf('0x6'));var config=require(_0x63bf('0x7'));var jayson=require(_0x63bf('0x8'));var client=jayson['client'][_0x63bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e5858,_0x1ac316,_0x27dc89){return new BPromise(function(_0x184e2b,_0x51515a){return client[_0x63bf('0xa')](_0x1e5858,_0x27dc89)[_0x63bf('0xb')](function(_0x2a9e86){logger[_0x63bf('0xc')](_0x63bf('0xd'),_0x1ac316,_0x63bf('0xe'));logger[_0x63bf('0xf')](_0x63bf('0x10'),_0x1ac316,_0x63bf('0xe'),JSON['stringify'](_0x2a9e86));if(_0x2a9e86[_0x63bf('0x11')]){if(_0x2a9e86['error']['code']===0x1f4){logger[_0x63bf('0x11')](_0x63bf('0xd'),_0x1ac316,_0x2a9e86[_0x63bf('0x11')][_0x63bf('0x12')]);return _0x51515a(_0x2a9e86[_0x63bf('0x11')][_0x63bf('0x12')]);}logger[_0x63bf('0x11')](_0x63bf('0xd'),_0x1ac316,_0x2a9e86[_0x63bf('0x11')][_0x63bf('0x12')]);return _0x184e2b(_0x2a9e86[_0x63bf('0x11')][_0x63bf('0x12')]);}else{logger['info'](_0x63bf('0xd'),_0x1ac316,_0x63bf('0xe'));_0x184e2b(_0x2a9e86[_0x63bf('0x13')][_0x63bf('0x12')]);}})[_0x63bf('0x14')](function(_0x45fc5f){logger[_0x63bf('0x11')](_0x63bf('0xd'),_0x1ac316,_0x45fc5f);_0x51515a(_0x45fc5f);});});}
\ No newline at end of file
diff --git a/server/api/condition/index.js b/server/api/condition/index.js
index 7eec4ed..4168f61 100644
--- a/server/api/condition/index.js
+++ b/server/api/condition/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1631=['destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update'];(function(_0x26bebe,_0x52a17c){var _0x1b285f=function(_0x47981c){while(--_0x47981c){_0x26bebe['push'](_0x26bebe['shift']());}};_0x1b285f(++_0x52a17c);}(_0x1631,0x12e));var _0x1163=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x1631[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require(_0x1163('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1163('0x1'));var router=express[_0x1163('0x2')]();var auth=require(_0x1163('0x3'));var interaction=require(_0x1163('0x4'));var config=require(_0x1163('0x5'));var controller=require('./condition.controller');router[_0x1163('0x6')](_0x1163('0x7'),auth[_0x1163('0x8')](),controller[_0x1163('0x9')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1163('0xa')]);module[_0x1163('0xb')]=router;
\ No newline at end of file
+var _0xe8ff=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xe8ff,0xa4));var _0xfe8f=function(_0xa3fa3,_0x328285){_0xa3fa3=_0xa3fa3-0x0;var _0x488dd4=_0xe8ff[_0xa3fa3];return _0x488dd4;};'use strict';var multer=require(_0xfe8f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfe8f('0x1'));var express=require(_0xfe8f('0x2'));var router=express[_0xfe8f('0x3')]();var auth=require(_0xfe8f('0x4'));var interaction=require(_0xfe8f('0x5'));var config=require(_0xfe8f('0x6'));var controller=require(_0xfe8f('0x7'));router[_0xfe8f('0x8')](_0xfe8f('0x9'),auth['isAuthenticated'](),controller[_0xfe8f('0xa')]);router[_0xfe8f('0xb')](_0xfe8f('0x9'),auth[_0xfe8f('0xc')](),controller[_0xfe8f('0xd')]);module[_0xfe8f('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js
index 8484871..e0576df 100644
--- a/server/api/contactItemType/contactItemType.attributes.js
+++ b/server/api/contactItemType/contactItemType.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x975f=['STRING','sequelize','exports','INTEGER'];(function(_0x296601,_0x25c2de){var _0x4397aa=function(_0xc4e70e){while(--_0xc4e70e){_0x296601['push'](_0x296601['shift']());}};_0x4397aa(++_0x25c2de);}(_0x975f,0x109));var _0xf975=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x975f[_0x292f93];return _0x5a94b1;};'use strict';var Sequelize=require(_0xf975('0x0'));module[_0xf975('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0xf975('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xf975('0x3')],'allowNull':!![]}};
\ No newline at end of file
+var _0x0eaa=['STRING','sequelize','exports','INTEGER'];(function(_0x39a86d,_0x10287a){var _0x960fdf=function(_0x209ad0){while(--_0x209ad0){_0x39a86d['push'](_0x39a86d['shift']());}};_0x960fdf(++_0x10287a);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x44f236,_0x4bd601){_0x44f236=_0x44f236-0x0;var _0x28085c=_0x0eaa[_0x44f236];return _0x28085c;};'use strict';var Sequelize=require(_0xa0ea('0x0'));module[_0xa0ea('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0xa0ea('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xa0ea('0x3')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js
index b087f9e..db6fe1a 100644
--- a/server/api/contactItemType/contactItemType.controller.js
+++ b/server/api/contactItemType/contactItemType.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3cd=['findAll','rows','catch','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','ContactItemTypes','UserProfileResource','end','name','map','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','ContactItemType','includeAll'];(function(_0x2f1758,_0x3f37d1){var _0x4d5c65=function(_0x3117f9){while(--_0x3117f9){_0x2f1758['push'](_0x2f1758['shift']());}};_0x4d5c65(++_0x3f37d1);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0xf3cd[_0x408e38];return _0x426b0e;};'use strict';var pdf=require(_0xdf3c('0x0'));var emlformat=require(_0xdf3c('0x1'));var rimraf=require(_0xdf3c('0x2'));var zipdir=require(_0xdf3c('0x3'));var jsonpatch=require(_0xdf3c('0x4'));var rp=require(_0xdf3c('0x5'));var moment=require('moment');var BPromise=require(_0xdf3c('0x6'));var Mustache=require(_0xdf3c('0x7'));var util=require(_0xdf3c('0x8'));var path=require('path');var sox=require(_0xdf3c('0x9'));var csv=require(_0xdf3c('0xa'));var ejs=require(_0xdf3c('0xb'));var fs=require('fs');var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var db=require(_0xdf3c('0x19'))['db'];function respondWithStatusCode(_0x5e8925,_0x1d483c){_0x1d483c=_0x1d483c||0xcc;return function(_0x166ae5){if(_0x166ae5){return _0x5e8925[_0xdf3c('0x1a')](_0x1d483c);}return _0x5e8925[_0xdf3c('0x1b')](_0x1d483c)['end']();};}function respondWithResult(_0x2ae4ad,_0x461079){_0x461079=_0x461079||0xc8;return function(_0x13ea5f){if(_0x13ea5f){return _0x2ae4ad['status'](_0x461079)[_0xdf3c('0x1c')](_0x13ea5f);}};}function respondWithFilteredResult(_0x38b01d,_0x173041){return function(_0x4274fd){if(_0x4274fd){var _0x21e587=_0x4274fd[_0xdf3c('0x1d')],_0x1a7a5a=_0x173041[_0xdf3c('0x1e')],_0x305ea5=_0x173041['offset']+_0x173041[_0xdf3c('0x1f')],_0x92008b;if(_0x305ea5>=_0x21e587){_0x305ea5=_0x21e587;_0x92008b=0xc8;}else{_0x92008b=0xce;}_0x38b01d[_0xdf3c('0x1b')](_0x92008b);return _0x38b01d[_0xdf3c('0x20')](_0xdf3c('0x21'),_0x1a7a5a+'-'+_0x305ea5+'/'+_0x21e587)[_0xdf3c('0x1c')](_0x4274fd);}return null;};}function patchUpdates(_0x113b56){return function(_0x16b02b){try{jsonpatch[_0xdf3c('0x22')](_0x16b02b,_0x113b56,!![]);}catch(_0x426f3a){return BPromise[_0xdf3c('0x23')](_0x426f3a);}return _0x16b02b[_0xdf3c('0x24')]();};}function saveUpdates(_0x3d14cc,_0x25487c){return function(_0x5d2390){if(_0x5d2390){return _0x5d2390['update'](_0x3d14cc)[_0xdf3c('0x25')](function(_0x583ce4){return _0x583ce4;});}return null;};}function removeEntity(_0x15776c,_0x40e7ec){return function(_0x36552e){if(_0x36552e){return _0x36552e[_0xdf3c('0x26')]()[_0xdf3c('0x25')](function(){var _0x36ba1c=_0x36552e['get']({'plain':!![]});var _0x22a164=_0xdf3c('0x27');return db[_0xdf3c('0x28')][_0xdf3c('0x26')]({'where':{'type':_0x22a164,'resourceId':_0x36ba1c['id']}})[_0xdf3c('0x25')](function(){return _0x36552e;});})[_0xdf3c('0x25')](function(){_0x15776c[_0xdf3c('0x1b')](0xcc)[_0xdf3c('0x29')]();});}};}function handleEntityNotFound(_0x18cb46,_0x1adee4){return function(_0x4c076c){if(!_0x4c076c){_0x18cb46[_0xdf3c('0x1a')](0x194);}return _0x4c076c;};}function handleError(_0x153daa,_0x4b57a4){_0x4b57a4=_0x4b57a4||0x1f4;return function(_0xdc8962){logger['error'](_0xdc8962['stack']);if(_0xdc8962['name']){delete _0xdc8962[_0xdf3c('0x2a')];}_0x153daa[_0xdf3c('0x1b')](_0x4b57a4)['send'](_0xdc8962);};}exports['index']=function(_0x37ecfd,_0x1f2ce4){var _0xd3cfcb={},_0x1ccdd4={},_0x5c98a2={'count':0x0,'rows':[]};var _0x43ce06=_[_0xdf3c('0x2b')](db['ContactItemType']['rawAttributes'],function(_0x1f1d8a){return{'name':_0x1f1d8a[_0xdf3c('0x2c')],'type':_0x1f1d8a[_0xdf3c('0x2d')]['key']};});_0x1ccdd4[_0xdf3c('0x2e')]=_[_0xdf3c('0x2b')](_0x43ce06,_0xdf3c('0x2a'));_0x1ccdd4[_0xdf3c('0x2f')]=_['keys'](_0x37ecfd[_0xdf3c('0x2f')]);_0x1ccdd4[_0xdf3c('0x30')]=_['intersection'](_0x1ccdd4[_0xdf3c('0x2e')],_0x1ccdd4[_0xdf3c('0x2f')]);_0xd3cfcb[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x1ccdd4['model'],qs[_0xdf3c('0x33')](_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x33')]));_0xd3cfcb[_0xdf3c('0x31')]=_0xd3cfcb['attributes'][_0xdf3c('0x34')]?_0xd3cfcb[_0xdf3c('0x31')]:_0x1ccdd4['model'];if(!_0x37ecfd['query'][_0xdf3c('0x35')]('nolimit')){_0xd3cfcb[_0xdf3c('0x1f')]=qs['limit'](_0x37ecfd['query']['limit']);_0xd3cfcb[_0xdf3c('0x1e')]=qs[_0xdf3c('0x1e')](_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x1e')]);}_0xd3cfcb['order']=qs['sort'](_0x37ecfd[_0xdf3c('0x2f')]['sort']);_0xd3cfcb[_0xdf3c('0x36')]=qs[_0xdf3c('0x30')](_[_0xdf3c('0x37')](_0x37ecfd[_0xdf3c('0x2f')],_0x1ccdd4[_0xdf3c('0x30')]),_0x43ce06);if(_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x38')]){_0xd3cfcb[_0xdf3c('0x36')]=_[_0xdf3c('0x39')](_0xd3cfcb['where'],{'$or':_[_0xdf3c('0x2b')](_0x43ce06,function(_0x54e689){if(_0x54e689['type']!==_0xdf3c('0x3a')){var _0x47f760={};_0x47f760[_0x54e689[_0xdf3c('0x2a')]]={'$like':'%'+_0x37ecfd['query'][_0xdf3c('0x38')]+'%'};return _0x47f760;}})});}_0xd3cfcb=_[_0xdf3c('0x39')]({},_0xd3cfcb,_0x37ecfd[_0xdf3c('0x3b')]);var _0x1349a4={'where':_0xd3cfcb[_0xdf3c('0x36')]};return db[_0xdf3c('0x3c')][_0xdf3c('0x1d')](_0x1349a4)[_0xdf3c('0x25')](function(_0x3cf131){_0x5c98a2[_0xdf3c('0x1d')]=_0x3cf131;if(_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x3d')]){_0xd3cfcb['include']=[{'all':!![]}];}return db['ContactItemType'][_0xdf3c('0x3e')](_0xd3cfcb);})['then'](function(_0x3a6527){_0x5c98a2[_0xdf3c('0x3f')]=_0x3a6527;return _0x5c98a2;})[_0xdf3c('0x25')](respondWithFilteredResult(_0x1f2ce4,_0xd3cfcb))[_0xdf3c('0x40')](handleError(_0x1f2ce4,null));};exports['show']=function(_0x563d31,_0x335c1b){var _0x33edab={'raw':!![],'where':{'id':_0x563d31['params']['id']}},_0x106975={};_0x106975[_0xdf3c('0x2e')]=_[_0xdf3c('0x41')](db[_0xdf3c('0x3c')][_0xdf3c('0x42')]);_0x106975['query']=_[_0xdf3c('0x41')](_0x563d31[_0xdf3c('0x2f')]);_0x106975[_0xdf3c('0x30')]=_[_0xdf3c('0x32')](_0x106975[_0xdf3c('0x2e')],_0x106975['query']);_0x33edab[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x106975[_0xdf3c('0x2e')],qs[_0xdf3c('0x33')](_0x563d31[_0xdf3c('0x2f')][_0xdf3c('0x33')]));_0x33edab['attributes']=_0x33edab['attributes'][_0xdf3c('0x34')]?_0x33edab[_0xdf3c('0x31')]:_0x106975['model'];if(_0x563d31['query'][_0xdf3c('0x3d')]){_0x33edab[_0xdf3c('0x43')]=[{'all':!![]}];}_0x33edab=_[_0xdf3c('0x39')]({},_0x33edab,_0x563d31[_0xdf3c('0x3b')]);return db[_0xdf3c('0x3c')][_0xdf3c('0x44')](_0x33edab)[_0xdf3c('0x25')](handleEntityNotFound(_0x335c1b,null))[_0xdf3c('0x25')](respondWithResult(_0x335c1b,null))[_0xdf3c('0x40')](handleError(_0x335c1b,null));};exports['create']=function(_0x129c2a,_0x2cfdb2){return db[_0xdf3c('0x3c')][_0xdf3c('0x45')](_0x129c2a[_0xdf3c('0x46')],{})[_0xdf3c('0x25')](function(_0x28a468){var _0x553f70=_0x129c2a[_0xdf3c('0x47')]['get']({'plain':!![]});if(!_0x553f70)throw new Error(_0xdf3c('0x48'));if(_0x553f70['role']===_0xdf3c('0x47')){var _0x28144f=_0x28a468[_0xdf3c('0x49')]({'plain':!![]});var _0x94c5b9='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x94c5b9,'userProfileId':_0x553f70[_0xdf3c('0x4a')]},'raw':!![]})['then'](function(_0x31c600){if(_0x31c600&&_0x31c600[_0xdf3c('0x4b')]===0x0){return db[_0xdf3c('0x28')][_0xdf3c('0x45')]({'name':_0x28144f[_0xdf3c('0x2a')],'resourceId':_0x28144f['id'],'type':_0x31c600['name'],'sectionId':_0x31c600['id']},{})['then'](function(){return _0x28a468;});}else{return _0x28a468;}})[_0xdf3c('0x40')](function(_0x27a541){logger['error'](_0xdf3c('0x4c'),_0x27a541);throw _0x27a541;});}return _0x28a468;})[_0xdf3c('0x25')](respondWithResult(_0x2cfdb2,0xc9))[_0xdf3c('0x40')](handleError(_0x2cfdb2,null));};exports[_0xdf3c('0x4d')]=function(_0x38de63,_0x46dfb1){if(_0x38de63[_0xdf3c('0x46')]['id']){delete _0x38de63['body']['id'];}return db['ContactItemType'][_0xdf3c('0x44')]({'where':{'id':_0x38de63[_0xdf3c('0x4e')]['id']}})[_0xdf3c('0x25')](handleEntityNotFound(_0x46dfb1,null))[_0xdf3c('0x25')](saveUpdates(_0x38de63[_0xdf3c('0x46')],null))[_0xdf3c('0x25')](respondWithResult(_0x46dfb1,null))[_0xdf3c('0x40')](handleError(_0x46dfb1,null));};exports[_0xdf3c('0x26')]=function(_0x143d01,_0x31624a){return db[_0xdf3c('0x3c')]['find']({'where':{'id':_0x143d01[_0xdf3c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x31624a,null))['then'](removeEntity(_0x31624a,null))['catch'](handleError(_0x31624a,null));};
\ No newline at end of file
+var _0x55ca=['apply','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','ContactItemType','includeAll','include','findAll','rows','show','merge','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range'];(function(_0x1be276,_0xe790f9){var _0x5e6931=function(_0x2e0307){while(--_0x2e0307){_0x1be276['push'](_0x1be276['shift']());}};_0x5e6931(++_0xe790f9);}(_0x55ca,0x126));var _0xa55c=function(_0xa9671b,_0x11378d){_0xa9671b=_0xa9671b-0x0;var _0x205591=_0x55ca[_0xa9671b];return _0x205591;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var db=require(_0xa55c('0x16'))['db'];function respondWithStatusCode(_0x15eec8,_0x5d47ff){_0x5d47ff=_0x5d47ff||0xcc;return function(_0x59d84a){if(_0x59d84a){return _0x15eec8[_0xa55c('0x17')](_0x5d47ff);}return _0x15eec8['status'](_0x5d47ff)['end']();};}function respondWithResult(_0x59ea8d,_0x18ee85){_0x18ee85=_0x18ee85||0xc8;return function(_0x3930e4){if(_0x3930e4){return _0x59ea8d[_0xa55c('0x18')](_0x18ee85)[_0xa55c('0x19')](_0x3930e4);}};}function respondWithFilteredResult(_0x458480,_0x247e77){return function(_0x4e0b2f){if(_0x4e0b2f){var _0x3ccf65=_0x4e0b2f[_0xa55c('0x1a')],_0x3dcf4f=_0x247e77[_0xa55c('0x1b')],_0x25934f=_0x247e77[_0xa55c('0x1b')]+_0x247e77[_0xa55c('0x1c')],_0x31e10d;if(_0x25934f>=_0x3ccf65){_0x25934f=_0x3ccf65;_0x31e10d=0xc8;}else{_0x31e10d=0xce;}_0x458480[_0xa55c('0x18')](_0x31e10d);return _0x458480['set'](_0xa55c('0x1d'),_0x3dcf4f+'-'+_0x25934f+'/'+_0x3ccf65)[_0xa55c('0x19')](_0x4e0b2f);}return null;};}function patchUpdates(_0x461284){return function(_0x358b61){try{jsonpatch[_0xa55c('0x1e')](_0x358b61,_0x461284,!![]);}catch(_0x5426e5){return BPromise['reject'](_0x5426e5);}return _0x358b61['save']();};}function saveUpdates(_0xd643cc,_0x3776ac){return function(_0xade4c4){if(_0xade4c4){return _0xade4c4['update'](_0xd643cc)[_0xa55c('0x1f')](function(_0x2fcb90){return _0x2fcb90;});}return null;};}function removeEntity(_0x54945a,_0x187a87){return function(_0x133096){if(_0x133096){return _0x133096[_0xa55c('0x20')]()[_0xa55c('0x1f')](function(){var _0x234372=_0x133096['get']({'plain':!![]});var _0x1fc828='ContactItemTypes';return db['UserProfileResource']['destroy']({'where':{'type':_0x1fc828,'resourceId':_0x234372['id']}})[_0xa55c('0x1f')](function(){return _0x133096;});})['then'](function(){_0x54945a[_0xa55c('0x18')](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x3f64de,_0xf0e574){return function(_0x2313a9){if(!_0x2313a9){_0x3f64de[_0xa55c('0x17')](0x194);}return _0x2313a9;};}function handleError(_0x1da633,_0x11e7f7){_0x11e7f7=_0x11e7f7||0x1f4;return function(_0x192df2){logger[_0xa55c('0x22')](_0x192df2[_0xa55c('0x23')]);if(_0x192df2['name']){delete _0x192df2[_0xa55c('0x24')];}_0x1da633[_0xa55c('0x18')](_0x11e7f7)[_0xa55c('0x25')](_0x192df2);};}exports[_0xa55c('0x26')]=function(_0x5d940d,_0x1377b0){var _0x22f6b6={},_0x1b8388={},_0x201941={'count':0x0,'rows':[]};var _0x45ee8d=_[_0xa55c('0x27')](db['ContactItemType'][_0xa55c('0x28')],function(_0x490b7d){return{'name':_0x490b7d[_0xa55c('0x29')],'type':_0x490b7d[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x1b8388[_0xa55c('0x2c')]=_['map'](_0x45ee8d,_0xa55c('0x24'));_0x1b8388[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x5d940d[_0xa55c('0x2d')]);_0x1b8388[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x1b8388[_0xa55c('0x2c')],_0x1b8388[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x1b8388[_0xa55c('0x2c')],qs['fields'](_0x5d940d['query'][_0xa55c('0x32')]));_0x22f6b6[_0xa55c('0x31')]=_0x22f6b6['attributes'][_0xa55c('0x33')]?_0x22f6b6[_0xa55c('0x31')]:_0x1b8388[_0xa55c('0x2c')];if(!_0x5d940d[_0xa55c('0x2d')][_0xa55c('0x34')](_0xa55c('0x35'))){_0x22f6b6[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x5d940d[_0xa55c('0x2d')]['limit']);_0x22f6b6['offset']=qs['offset'](_0x5d940d[_0xa55c('0x2d')][_0xa55c('0x1b')]);}_0x22f6b6[_0xa55c('0x36')]=qs['sort'](_0x5d940d[_0xa55c('0x2d')]['sort']);_0x22f6b6[_0xa55c('0x37')]=qs['filters'](_[_0xa55c('0x38')](_0x5d940d[_0xa55c('0x2d')],_0x1b8388[_0xa55c('0x2f')]),_0x45ee8d);if(_0x5d940d['query'][_0xa55c('0x39')]){_0x22f6b6[_0xa55c('0x37')]=_['merge'](_0x22f6b6[_0xa55c('0x37')],{'$or':_[_0xa55c('0x27')](_0x45ee8d,function(_0x4d9083){if(_0x4d9083['type']!==_0xa55c('0x3a')){var _0x5d3960={};_0x5d3960[_0x4d9083[_0xa55c('0x24')]]={'$like':'%'+_0x5d940d[_0xa55c('0x2d')]['filter']+'%'};return _0x5d3960;}})});}_0x22f6b6=_['merge']({},_0x22f6b6,_0x5d940d['options']);var _0x4de781={'where':_0x22f6b6[_0xa55c('0x37')]};return db[_0xa55c('0x3b')][_0xa55c('0x1a')](_0x4de781)[_0xa55c('0x1f')](function(_0x2d8cbf){_0x201941['count']=_0x2d8cbf;if(_0x5d940d[_0xa55c('0x2d')][_0xa55c('0x3c')]){_0x22f6b6[_0xa55c('0x3d')]=[{'all':!![]}];}return db[_0xa55c('0x3b')][_0xa55c('0x3e')](_0x22f6b6);})[_0xa55c('0x1f')](function(_0x554620){_0x201941[_0xa55c('0x3f')]=_0x554620;return _0x201941;})['then'](respondWithFilteredResult(_0x1377b0,_0x22f6b6))['catch'](handleError(_0x1377b0,null));};exports[_0xa55c('0x40')]=function(_0x1f63d8,_0x496920){var _0x2bd98b={'raw':!![],'where':{'id':_0x1f63d8['params']['id']}},_0x508bd3={};_0x508bd3[_0xa55c('0x2c')]=_[_0xa55c('0x2e')](db[_0xa55c('0x3b')]['rawAttributes']);_0x508bd3[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x1f63d8['query']);_0x508bd3[_0xa55c('0x2f')]=_['intersection'](_0x508bd3[_0xa55c('0x2c')],_0x508bd3[_0xa55c('0x2d')]);_0x2bd98b['attributes']=_[_0xa55c('0x30')](_0x508bd3[_0xa55c('0x2c')],qs['fields'](_0x1f63d8[_0xa55c('0x2d')][_0xa55c('0x32')]));_0x2bd98b[_0xa55c('0x31')]=_0x2bd98b['attributes'][_0xa55c('0x33')]?_0x2bd98b['attributes']:_0x508bd3[_0xa55c('0x2c')];if(_0x1f63d8[_0xa55c('0x2d')][_0xa55c('0x3c')]){_0x2bd98b['include']=[{'all':!![]}];}_0x2bd98b=_[_0xa55c('0x41')]({},_0x2bd98b,_0x1f63d8[_0xa55c('0x42')]);return db['ContactItemType'][_0xa55c('0x43')](_0x2bd98b)[_0xa55c('0x1f')](handleEntityNotFound(_0x496920,null))['then'](respondWithResult(_0x496920,null))[_0xa55c('0x44')](handleError(_0x496920,null));};exports[_0xa55c('0x45')]=function(_0x52f9a7,_0x46f839){return db[_0xa55c('0x3b')][_0xa55c('0x45')](_0x52f9a7[_0xa55c('0x46')],{})['then'](function(_0x143989){var _0x58a7ea=_0x52f9a7[_0xa55c('0x47')][_0xa55c('0x48')]({'plain':!![]});if(!_0x58a7ea)throw new Error(_0xa55c('0x49'));if(_0x58a7ea['role']===_0xa55c('0x47')){var _0x250b00=_0x143989['get']({'plain':!![]});var _0x5be06=_0xa55c('0x4a');return db[_0xa55c('0x4b')][_0xa55c('0x43')]({'where':{'name':_0x5be06,'userProfileId':_0x58a7ea[_0xa55c('0x4c')]},'raw':!![]})[_0xa55c('0x1f')](function(_0x1e1293){if(_0x1e1293&&_0x1e1293[_0xa55c('0x4d')]===0x0){return db[_0xa55c('0x4e')][_0xa55c('0x45')]({'name':_0x250b00['name'],'resourceId':_0x250b00['id'],'type':_0x1e1293[_0xa55c('0x24')],'sectionId':_0x1e1293['id']},{})[_0xa55c('0x1f')](function(){return _0x143989;});}else{return _0x143989;}})[_0xa55c('0x44')](function(_0x4f73b6){logger[_0xa55c('0x22')](_0xa55c('0x4f'),_0x4f73b6);throw _0x4f73b6;});}return _0x143989;})['then'](respondWithResult(_0x46f839,0xc9))[_0xa55c('0x44')](handleError(_0x46f839,null));};exports['update']=function(_0x2b6a0e,_0x228df4){if(_0x2b6a0e[_0xa55c('0x46')]['id']){delete _0x2b6a0e[_0xa55c('0x46')]['id'];}return db[_0xa55c('0x3b')]['find']({'where':{'id':_0x2b6a0e[_0xa55c('0x50')]['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0x228df4,null))['then'](saveUpdates(_0x2b6a0e[_0xa55c('0x46')],null))[_0xa55c('0x1f')](respondWithResult(_0x228df4,null))[_0xa55c('0x44')](handleError(_0x228df4,null));};exports[_0xa55c('0x20')]=function(_0x50176b,_0x4def35){return db[_0xa55c('0x3b')][_0xa55c('0x43')]({'where':{'id':_0x50176b[_0xa55c('0x50')]['id']}})[_0xa55c('0x1f')](handleEntityNotFound(_0x4def35,null))['then'](removeEntity(_0x4def35,null))[_0xa55c('0x44')](handleError(_0x4def35,null));};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js
index 5dba8eb..abc0791 100644
--- a/server/api/contactItemType/contactItemType.model.js
+++ b/server/api/contactItemType/contactItemType.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ca9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','ContactItemType','tools_contact_item_types'];(function(_0x45ca66,_0x47f5d2){var _0x329bdc=function(_0x48225c){while(--_0x48225c){_0x45ca66['push'](_0x45ca66['shift']());}};_0x329bdc(++_0x47f5d2);}(_0x8ca9,0x9c));var _0x98ca=function(_0x55957e,_0x2d1769){_0x55957e=_0x55957e-0x0;var _0x37b31b=_0x8ca9[_0x55957e];return _0x37b31b;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var logger=require(_0x98ca('0x2'))(_0x98ca('0x3'));var moment=require(_0x98ca('0x4'));var BPromise=require(_0x98ca('0x5'));var rp=require(_0x98ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98ca('0x7'));var attributes=require('./contactItemType.attributes');module[_0x98ca('0x8')]=function(_0x48415d,_0x219619){return _0x48415d[_0x98ca('0x9')](_0x98ca('0xa'),attributes,{'tableName':_0x98ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39c7=['../../config/environment','./contactItemType.attributes','define','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x375db3,_0xf2438f){var _0x10a602=function(_0x570eb2){while(--_0x570eb2){_0x375db3['push'](_0x375db3['shift']());}};_0x10a602(++_0xf2438f);}(_0x39c7,0x85));var _0x739c=function(_0x5eb9c1,_0x477c4b){_0x5eb9c1=_0x5eb9c1-0x0;var _0x371df6=_0x39c7[_0x5eb9c1];return _0x371df6;};'use strict';var _=require('lodash');var util=require(_0x739c('0x0'));var logger=require(_0x739c('0x1'))(_0x739c('0x2'));var moment=require(_0x739c('0x3'));var BPromise=require(_0x739c('0x4'));var rp=require(_0x739c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x739c('0x6'));var config=require(_0x739c('0x7'));var attributes=require(_0x739c('0x8'));module['exports']=function(_0x4c5030,_0x1923d9){return _0x4c5030[_0x739c('0x9')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js
index bf209c0..48d599f 100644
--- a/server/api/contactItemType/contactItemType.rpc.js
+++ b/server/api/contactItemType/contactItemType.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd3d1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x3d1046,_0x154af3){var _0x37d799=function(_0x31f2e0){while(--_0x31f2e0){_0x3d1046['push'](_0x3d1046['shift']());}};_0x37d799(++_0x154af3);}(_0xd3d1,0x172));var _0x1d3d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd3d1[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d3d('0x2'));var fs=require('fs');var Redis=require(_0x1d3d('0x3'));var db=require(_0x1d3d('0x4'))['db'];var utils=require(_0x1d3d('0x5'));var logger=require(_0x1d3d('0x6'))(_0x1d3d('0x7'));var config=require(_0x1d3d('0x8'));var jayson=require(_0x1d3d('0x9'));var client=jayson[_0x1d3d('0xa')][_0x1d3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3831ce,_0xb1b3c6,_0xe10bca){return new BPromise(function(_0x2c377c,_0xbea61e){return client[_0x1d3d('0xc')](_0x3831ce,_0xe10bca)[_0x1d3d('0xd')](function(_0x510a37){logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));logger[_0x1d3d('0x11')](_0x1d3d('0x12'),_0xb1b3c6,_0x1d3d('0x10'),JSON[_0x1d3d('0x13')](_0x510a37));if(_0x510a37[_0x1d3d('0x14')]){if(_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x15')]===0x1f4){logger[_0x1d3d('0x14')]('ContactItemType,\x20%s,\x20%s',_0xb1b3c6,_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x16')]);return _0xbea61e(_0x510a37['error']['message']);}logger[_0x1d3d('0x14')](_0x1d3d('0xf'),_0xb1b3c6,_0x510a37[_0x1d3d('0x14')]['message']);return _0x2c377c(_0x510a37[_0x1d3d('0x14')]['message']);}else{logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));_0x2c377c(_0x510a37[_0x1d3d('0x17')][_0x1d3d('0x16')]);}})[_0x1d3d('0x18')](function(_0x3dcb67){logger['error']('ContactItemType,\x20%s,\x20%s',_0xb1b3c6,_0x3dcb67);_0xbea61e(_0x3dcb67);});});}
\ No newline at end of file
+var _0x9221=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x31f433,_0x3026f4){var _0x185f84=function(_0x4dba9f){while(--_0x4dba9f){_0x31f433['push'](_0x31f433['shift']());}};_0x185f84(++_0x3026f4);}(_0x9221,0x64));var _0x1922=function(_0x582df7,_0x3d02cf){_0x582df7=_0x582df7-0x0;var _0x5081fd=_0x9221[_0x582df7];return _0x5081fd;};'use strict';var _=require('lodash');var util=require(_0x1922('0x0'));var moment=require(_0x1922('0x1'));var BPromise=require('bluebird');var rs=require(_0x1922('0x2'));var fs=require('fs');var Redis=require(_0x1922('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1922('0x4'));var logger=require(_0x1922('0x5'))(_0x1922('0x6'));var config=require(_0x1922('0x7'));var jayson=require(_0x1922('0x8'));var client=jayson[_0x1922('0x9')][_0x1922('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa05c,_0x116227,_0x3cfd98){return new BPromise(function(_0x195fa4,_0x47c225){return client[_0x1922('0xb')](_0x5aa05c,_0x3cfd98)['then'](function(_0x2b6c51){logger[_0x1922('0xc')](_0x1922('0xd'),_0x116227,'request\x20sent');logger[_0x1922('0xe')](_0x1922('0xf'),_0x116227,'request\x20sent',JSON[_0x1922('0x10')](_0x2b6c51));if(_0x2b6c51['error']){if(_0x2b6c51[_0x1922('0x11')]['code']===0x1f4){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')]['message']);return _0x47c225(_0x2b6c51['error'][_0x1922('0x12')]);}logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')][_0x1922('0x12')]);return _0x195fa4(_0x2b6c51['error'][_0x1922('0x12')]);}else{logger['info'](_0x1922('0xd'),_0x116227,_0x1922('0x13'));_0x195fa4(_0x2b6c51[_0x1922('0x14')][_0x1922('0x12')]);}})['catch'](function(_0x459511){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x459511);_0x47c225(_0x459511);});});}
\ No newline at end of file
diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js
index e0bcc07..51ff74a 100644
--- a/server/api/contactItemType/index.js
+++ b/server/api/contactItemType/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebaf=['isAuthenticated','index','/:id','show','put','update','delete','exports','util','connect-timeout','express','Router','../../config/environment','./contactItemType.controller','get'];(function(_0x4ad072,_0x2582f1){var _0x4f7ae5=function(_0x5abb9e){while(--_0x5abb9e){_0x4ad072['push'](_0x4ad072['shift']());}};_0x4f7ae5(++_0x2582f1);}(_0xebaf,0xcb));var _0xfeba=function(_0x223ca6,_0x30001f){_0x223ca6=_0x223ca6-0x0;var _0x3ca28f=_0xebaf[_0x223ca6];return _0x3ca28f;};'use strict';var multer=require('multer');var util=require(_0xfeba('0x0'));var path=require('path');var timeout=require(_0xfeba('0x1'));var express=require(_0xfeba('0x2'));var router=express[_0xfeba('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfeba('0x4'));var controller=require(_0xfeba('0x5'));router[_0xfeba('0x6')]('/',auth[_0xfeba('0x7')](),controller[_0xfeba('0x8')]);router[_0xfeba('0x6')](_0xfeba('0x9'),auth[_0xfeba('0x7')](),controller[_0xfeba('0xa')]);router['post']('/',auth[_0xfeba('0x7')](),controller['create']);router[_0xfeba('0xb')]('/:id',auth[_0xfeba('0x7')](),controller[_0xfeba('0xc')]);router[_0xfeba('0xd')](_0xfeba('0x9'),auth[_0xfeba('0x7')](),controller['destroy']);module[_0xfeba('0xe')]=router;
\ No newline at end of file
+var _0x13cb=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x3b2421,_0xf30f91){var _0x288bde=function(_0x1d1db6){while(--_0x1d1db6){_0x3b2421['push'](_0x3b2421['shift']());}};_0x288bde(++_0xf30f91);}(_0x13cb,0x16c));var _0xb13c=function(_0x294cf1,_0x5d6a40){_0x294cf1=_0x294cf1-0x0;var _0x334402=_0x13cb[_0x294cf1];return _0x334402;};'use strict';var multer=require('multer');var util=require(_0xb13c('0x0'));var path=require(_0xb13c('0x1'));var timeout=require(_0xb13c('0x2'));var express=require(_0xb13c('0x3'));var router=express[_0xb13c('0x4')]();var auth=require(_0xb13c('0x5'));var interaction=require(_0xb13c('0x6'));var config=require('../../config/environment');var controller=require(_0xb13c('0x7'));router[_0xb13c('0x8')]('/',auth[_0xb13c('0x9')](),controller[_0xb13c('0xa')]);router[_0xb13c('0x8')](_0xb13c('0xb'),auth['isAuthenticated'](),controller[_0xb13c('0xc')]);router[_0xb13c('0xd')]('/',auth[_0xb13c('0x9')](),controller[_0xb13c('0xe')]);router[_0xb13c('0xf')](_0xb13c('0xb'),auth[_0xb13c('0x9')](),controller['update']);router[_0xb13c('0x10')](_0xb13c('0xb'),auth[_0xb13c('0x9')](),controller[_0xb13c('0x11')]);module[_0xb13c('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js
index 8888082..39bbd58 100644
--- a/server/api/dashboard/dashboard.attributes.js
+++ b/server/api/dashboard/dashboard.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf1c6=['sequelize','exports','STRING','name'];(function(_0x454af0,_0xfe1e7d){var _0x1abcef=function(_0x21d7c8){while(--_0x21d7c8){_0x454af0['push'](_0x454af0['shift']());}};_0x1abcef(++_0xfe1e7d);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x20e814,_0x42f1d4){_0x20e814=_0x20e814-0x0;var _0x50c359=_0xf1c6[_0x20e814];return _0x50c359;};'use strict';var Sequelize=require(_0x6f1c('0x0'));module[_0x6f1c('0x1')]={'name':{'type':Sequelize[_0x6f1c('0x2')],'allowNull':![],'unique':_0x6f1c('0x3')},'description':{'type':Sequelize[_0x6f1c('0x2')]}};
\ No newline at end of file
+var _0x5cd7=['sequelize','STRING','name'];(function(_0x1b2748,_0x4b3ad2){var _0x18fe11=function(_0x561c11){while(--_0x561c11){_0x1b2748['push'](_0x1b2748['shift']());}};_0x18fe11(++_0x4b3ad2);}(_0x5cd7,0x102));var _0x75cd=function(_0x33e93d,_0x1a8423){_0x33e93d=_0x33e93d-0x0;var _0x19e99d=_0x5cd7[_0x33e93d];return _0x19e99d;};'use strict';var Sequelize=require(_0x75cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x75cd('0x1')],'allowNull':![],'unique':_0x75cd('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js
index f60a592..405968c 100644
--- a/server/api/dashboard/dashboard.controller.js
+++ b/server/api/dashboard/dashboard.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf89f=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','end','json','count','offset','limit','set','apply','reject','save','update','then','get','CustomDashboards','sendStatus','error','name','status','send','index','Dashboard','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','create','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','destroy','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf89f,0x158));var _0xff89=function(_0x17a2b5,_0x239133){_0x17a2b5=_0x17a2b5-0x0;var _0x1be2a0=_0xf89f[_0x17a2b5];return _0x1be2a0;};'use strict';var pdf=require(_0xff89('0x0'));var emlformat=require(_0xff89('0x1'));var rimraf=require(_0xff89('0x2'));var zipdir=require(_0xff89('0x3'));var jsonpatch=require(_0xff89('0x4'));var rp=require(_0xff89('0x5'));var moment=require(_0xff89('0x6'));var BPromise=require(_0xff89('0x7'));var Mustache=require(_0xff89('0x8'));var util=require(_0xff89('0x9'));var path=require(_0xff89('0xa'));var sox=require(_0xff89('0xb'));var csv=require(_0xff89('0xc'));var ejs=require(_0xff89('0xd'));var fs=require('fs');var _=require(_0xff89('0xe'));var squel=require(_0xff89('0xf'));var crypto=require(_0xff89('0x10'));var jsforce=require(_0xff89('0x11'));var deskjs=require(_0xff89('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff89('0x13'));var Redis=require(_0xff89('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xff89('0x15'));var as=require(_0xff89('0x16'));var hardwareService=require(_0xff89('0x17'));var logger=require('../../config/logger')(_0xff89('0x18'));var utils=require(_0xff89('0x19'));var config=require('../../config/environment');var db=require(_0xff89('0x1a'))['db'];config[_0xff89('0x1b')]=_[_0xff89('0x1c')](config['redis'],{'host':_0xff89('0x1d'),'port':0x18eb});var socket=require(_0xff89('0x1e'))(new Redis(config[_0xff89('0x1b')]));require(_0xff89('0x1f'))[_0xff89('0x20')](socket);function respondWithStatusCode(_0x2a57c4,_0x4ab415){_0x4ab415=_0x4ab415||0xcc;return function(_0x368a97){if(_0x368a97){return _0x2a57c4['sendStatus'](_0x4ab415);}return _0x2a57c4['status'](_0x4ab415)[_0xff89('0x21')]();};}function respondWithResult(_0x253919,_0x1246e2){_0x1246e2=_0x1246e2||0xc8;return function(_0x52f554){if(_0x52f554){return _0x253919['status'](_0x1246e2)[_0xff89('0x22')](_0x52f554);}};}function respondWithFilteredResult(_0x466213,_0x3988ee){return function(_0x168586){if(_0x168586){var _0x43450b=_0x168586[_0xff89('0x23')],_0x274a00=_0x3988ee[_0xff89('0x24')],_0x21533b=_0x3988ee[_0xff89('0x24')]+_0x3988ee[_0xff89('0x25')],_0x211e63;if(_0x21533b>=_0x43450b){_0x21533b=_0x43450b;_0x211e63=0xc8;}else{_0x211e63=0xce;}_0x466213['status'](_0x211e63);return _0x466213[_0xff89('0x26')]('Content-Range',_0x274a00+'-'+_0x21533b+'/'+_0x43450b)[_0xff89('0x22')](_0x168586);}return null;};}function patchUpdates(_0x126f83){return function(_0xd08dcb){try{jsonpatch[_0xff89('0x27')](_0xd08dcb,_0x126f83,!![]);}catch(_0x1abcb8){return BPromise[_0xff89('0x28')](_0x1abcb8);}return _0xd08dcb[_0xff89('0x29')]();};}function saveUpdates(_0x41b676,_0x151b47){return function(_0x5cfbd6){if(_0x5cfbd6){return _0x5cfbd6[_0xff89('0x2a')](_0x41b676)[_0xff89('0x2b')](function(_0xe0f92e){return _0xe0f92e;});}return null;};}function removeEntity(_0x5e8725,_0xa1355c){return function(_0x3f549f){if(_0x3f549f){return _0x3f549f['destroy']()[_0xff89('0x2b')](function(){var _0x36e852=_0x3f549f[_0xff89('0x2c')]({'plain':!![]});var _0x1395eb=_0xff89('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x1395eb,'resourceId':_0x36e852['id']}})[_0xff89('0x2b')](function(){return _0x3f549f;});})[_0xff89('0x2b')](function(){_0x5e8725['status'](0xcc)[_0xff89('0x21')]();});}};}function handleEntityNotFound(_0x5b3221,_0x802333){return function(_0x15a807){if(!_0x15a807){_0x5b3221[_0xff89('0x2e')](0x194);}return _0x15a807;};}function handleError(_0x543cd3,_0x208d4b){_0x208d4b=_0x208d4b||0x1f4;return function(_0x1bd64f){logger[_0xff89('0x2f')](_0x1bd64f['stack']);if(_0x1bd64f[_0xff89('0x30')]){delete _0x1bd64f[_0xff89('0x30')];}_0x543cd3[_0xff89('0x31')](_0x208d4b)[_0xff89('0x32')](_0x1bd64f);};}exports[_0xff89('0x33')]=function(_0x203161,_0x2e5751){var _0x56bf28={},_0x3389b8={},_0x5f28ca={'count':0x0,'rows':[]};var _0x3d0f01=_['map'](db[_0xff89('0x34')][_0xff89('0x35')],function(_0xbc4aa6){return{'name':_0xbc4aa6[_0xff89('0x36')],'type':_0xbc4aa6[_0xff89('0x37')]['key']};});_0x3389b8[_0xff89('0x38')]=_[_0xff89('0x39')](_0x3d0f01,_0xff89('0x30'));_0x3389b8[_0xff89('0x3a')]=_[_0xff89('0x3b')](_0x203161[_0xff89('0x3a')]);_0x3389b8[_0xff89('0x3c')]=_[_0xff89('0x3d')](_0x3389b8[_0xff89('0x38')],_0x3389b8[_0xff89('0x3a')]);_0x56bf28[_0xff89('0x3e')]=_['intersection'](_0x3389b8[_0xff89('0x38')],qs['fields'](_0x203161[_0xff89('0x3a')][_0xff89('0x3f')]));_0x56bf28[_0xff89('0x3e')]=_0x56bf28[_0xff89('0x3e')][_0xff89('0x40')]?_0x56bf28['attributes']:_0x3389b8['model'];if(!_0x203161[_0xff89('0x3a')][_0xff89('0x41')](_0xff89('0x42'))){_0x56bf28[_0xff89('0x25')]=qs[_0xff89('0x25')](_0x203161[_0xff89('0x3a')][_0xff89('0x25')]);_0x56bf28[_0xff89('0x24')]=qs[_0xff89('0x24')](_0x203161['query'][_0xff89('0x24')]);}_0x56bf28[_0xff89('0x43')]=qs[_0xff89('0x44')](_0x203161[_0xff89('0x3a')][_0xff89('0x44')]);_0x56bf28[_0xff89('0x45')]=qs[_0xff89('0x3c')](_[_0xff89('0x46')](_0x203161['query'],_0x3389b8[_0xff89('0x3c')]),_0x3d0f01);if(_0x203161[_0xff89('0x3a')][_0xff89('0x47')]){_0x56bf28['where']=_['merge'](_0x56bf28['where'],{'$or':_['map'](_0x3d0f01,function(_0x16f50d){if(_0x16f50d['type']!==_0xff89('0x48')){var _0x5605c2={};_0x5605c2[_0x16f50d[_0xff89('0x30')]]={'$like':'%'+_0x203161[_0xff89('0x3a')]['filter']+'%'};return _0x5605c2;}})});}_0x56bf28=_[_0xff89('0x49')]({},_0x56bf28,_0x203161[_0xff89('0x4a')]);var _0x2c18e8={'where':_0x56bf28['where']};return db[_0xff89('0x34')][_0xff89('0x23')](_0x2c18e8)[_0xff89('0x2b')](function(_0xc4b51e){_0x5f28ca[_0xff89('0x23')]=_0xc4b51e;if(_0x203161[_0xff89('0x3a')][_0xff89('0x4b')]){_0x56bf28['include']=[{'all':!![]}];}return db[_0xff89('0x34')][_0xff89('0x4c')](_0x56bf28);})[_0xff89('0x2b')](function(_0x324a4b){_0x5f28ca[_0xff89('0x4d')]=_0x324a4b;return _0x5f28ca;})[_0xff89('0x2b')](respondWithFilteredResult(_0x2e5751,_0x56bf28))[_0xff89('0x4e')](handleError(_0x2e5751,null));};exports[_0xff89('0x4f')]=function(_0x2a2ef4,_0x4445f9){var _0x5edf5e={'raw':![],'where':{'id':_0x2a2ef4[_0xff89('0x50')]['id']}},_0x49d536={};_0x49d536[_0xff89('0x38')]=_[_0xff89('0x3b')](db[_0xff89('0x34')][_0xff89('0x35')]);_0x49d536[_0xff89('0x3a')]=_[_0xff89('0x3b')](_0x2a2ef4['query']);_0x49d536[_0xff89('0x3c')]=_[_0xff89('0x3d')](_0x49d536[_0xff89('0x38')],_0x49d536['query']);_0x5edf5e[_0xff89('0x3e')]=_[_0xff89('0x3d')](_0x49d536[_0xff89('0x38')],qs['fields'](_0x2a2ef4[_0xff89('0x3a')]['fields']));_0x5edf5e[_0xff89('0x3e')]=_0x5edf5e[_0xff89('0x3e')][_0xff89('0x40')]?_0x5edf5e[_0xff89('0x3e')]:_0x49d536['model'];if(_0x2a2ef4[_0xff89('0x3a')]['includeAll']){_0x5edf5e[_0xff89('0x51')]=[{'all':!![]}];}_0x5edf5e=_[_0xff89('0x49')]({},_0x5edf5e,_0x2a2ef4[_0xff89('0x4a')]);return db[_0xff89('0x34')]['find'](_0x5edf5e)[_0xff89('0x2b')](handleEntityNotFound(_0x4445f9,null))[_0xff89('0x2b')](respondWithResult(_0x4445f9,null))[_0xff89('0x4e')](handleError(_0x4445f9,null));};exports[_0xff89('0x52')]=function(_0x2a8f65,_0x14d104){return db[_0xff89('0x34')][_0xff89('0x52')](_0x2a8f65['body'],{})[_0xff89('0x2b')](function(_0x5e3847){var _0x2a40c6=_0x2a8f65['user'][_0xff89('0x2c')]({'plain':!![]});if(!_0x2a40c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a40c6['role']==='user'){var _0x145e3a=_0x5e3847[_0xff89('0x2c')]({'plain':!![]});var _0x3e4339='CustomDashboards';return db[_0xff89('0x53')][_0xff89('0x54')]({'where':{'name':_0x3e4339,'userProfileId':_0x2a40c6[_0xff89('0x55')]},'raw':!![]})['then'](function(_0x18ce52){if(_0x18ce52&&_0x18ce52[_0xff89('0x56')]===0x0){return db[_0xff89('0x57')][_0xff89('0x52')]({'name':_0x145e3a[_0xff89('0x30')],'resourceId':_0x145e3a['id'],'type':_0x18ce52[_0xff89('0x30')],'sectionId':_0x18ce52['id']},{})[_0xff89('0x2b')](function(){return _0x5e3847;});}else{return _0x5e3847;}})[_0xff89('0x4e')](function(_0x170f27){logger[_0xff89('0x2f')](_0xff89('0x58'),_0x170f27);throw _0x170f27;});}return _0x5e3847;})[_0xff89('0x2b')](respondWithResult(_0x14d104,0xc9))[_0xff89('0x4e')](handleError(_0x14d104,null));};exports[_0xff89('0x59')]=function(_0x295bae,_0x53b245){var _0x15255e={'where':{'id':_0x295bae[_0xff89('0x50')]['id']}},_0x17d840={};_0x17d840[_0xff89('0x38')]=_[_0xff89('0x3b')](db[_0xff89('0x34')][_0xff89('0x35')]);_0x15255e['attributes']=_[_0xff89('0x3d')](_0x17d840[_0xff89('0x38')],qs[_0xff89('0x3f')](_0x295bae['query'][_0xff89('0x3f')]));_0x15255e[_0xff89('0x3e')]=_0x15255e[_0xff89('0x3e')]['length']?_0x15255e[_0xff89('0x3e')]:_0x17d840['model'];if(_0x295bae[_0xff89('0x3a')][_0xff89('0x4b')]){_0x15255e[_0xff89('0x51')]=[{'all':!![]}];}_0x15255e=_['merge']({},_0x15255e,_0x295bae[_0xff89('0x4a')]);return db[_0xff89('0x34')][_0xff89('0x54')](_0x15255e)[_0xff89('0x2b')](handleEntityNotFound(_0x53b245,null))[_0xff89('0x2b')](function(_0x50a8bf){if(_0x50a8bf){var _0xa8fd8a=_0x50a8bf['get']({'plain':!![]});_0xa8fd8a=qs[_0xff89('0x5a')](_0xa8fd8a,['id',_0xff89('0x5b'),_0xff89('0x5c')]);_0x295bae[_0xff89('0x5d')]=_[_0xff89('0x5a')](_0x295bae[_0xff89('0x5d')],['id','createdAt',_0xff89('0x5c')]);return db['Dashboard'][_0xff89('0x52')](_[_0xff89('0x49')](_0xa8fd8a,_0x295bae['body']),{'include':_0x295bae[_0xff89('0x3a')][_0xff89('0x4b')]?[{'all':!![]}]:undefined})[_0xff89('0x2b')](function(_0x4b4ceb){var _0x3f9c43=_0x295bae[_0xff89('0x5e')][_0xff89('0x2c')]({'plain':!![]});if(!_0x3f9c43)throw new Error(_0xff89('0x5f'));if(_0x3f9c43['role']==='user'){var _0x58ba2=_0x4b4ceb[_0xff89('0x2c')]({'plain':!![]});var _0x5d18a3=_0xff89('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x5d18a3,'userProfileId':_0x3f9c43['userProfileId']},'raw':!![]})[_0xff89('0x2b')](function(_0x16ef2a){if(_0x16ef2a&&_0x16ef2a[_0xff89('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x58ba2['name'],'resourceId':_0x58ba2['id'],'type':_0x16ef2a[_0xff89('0x30')],'sectionId':_0x16ef2a['id']},{})[_0xff89('0x2b')](function(){return _0x4b4ceb;});}else{return _0x4b4ceb;}})['catch'](function(_0x143a26){logger[_0xff89('0x2f')](_0xff89('0x58'),_0x143a26);throw _0x143a26;});}return _0x4b4ceb;});}})['then'](respondWithResult(_0x53b245,0xc9))[_0xff89('0x4e')](handleError(_0x53b245,null));};exports[_0xff89('0x2a')]=function(_0xa456d0,_0x440ebe){if(_0xa456d0[_0xff89('0x5d')]['id']){delete _0xa456d0[_0xff89('0x5d')]['id'];}return db['Dashboard'][_0xff89('0x54')]({'where':{'id':_0xa456d0[_0xff89('0x50')]['id']}})[_0xff89('0x2b')](handleEntityNotFound(_0x440ebe,null))[_0xff89('0x2b')](saveUpdates(_0xa456d0[_0xff89('0x5d')],null))[_0xff89('0x2b')](respondWithResult(_0x440ebe,null))[_0xff89('0x4e')](handleError(_0x440ebe,null));};exports[_0xff89('0x60')]=function(_0x580bed,_0x1fab20){return db[_0xff89('0x34')][_0xff89('0x54')]({'where':{'id':_0x580bed[_0xff89('0x50')]['id']}})['then'](handleEntityNotFound(_0x1fab20,null))['then'](removeEntity(_0x1fab20,null))[_0xff89('0x4e')](handleError(_0x1fab20,null));};function widgetAttributes(_0x4a7b61){try{switch(_0x4a7b61[_0xff89('0x37')]){case _0xff89('0x61'):return[{'name':_0xff89('0x62'),'value':_0x4a7b61[_0xff89('0x62')]||(_0x4a7b61['attrs']&&_0x4a7b61[_0xff89('0x63')][0x0]?_0x4a7b61[_0xff89('0x63')][0x0][_0xff89('0x64')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x4a7b61[_0xff89('0x65')]||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61[_0xff89('0x63')][0x0]?_0x4a7b61[_0xff89('0x63')][0x0][_0xff89('0x64')]:undefined)||''}];case _0xff89('0x66'):return[{'name':_0xff89('0x67'),'value':_0x4a7b61['attrHourFormat']||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61[_0xff89('0x63')][0x0]?_0x4a7b61['attrs'][0x0][_0xff89('0x64')]:undefined)||'HH:mm:ss'},{'name':_0xff89('0x68'),'value':_0x4a7b61[_0xff89('0x68')]||(_0x4a7b61['attrs']&&_0x4a7b61[_0xff89('0x63')][0x1]?_0x4a7b61[_0xff89('0x63')][0x1][_0xff89('0x64')]:undefined)||'0.00'},{'name':_0xff89('0x69'),'value':_0x4a7b61[_0xff89('0x69')]||(_0x4a7b61['attrs']&&_0x4a7b61[_0xff89('0x63')][0x2]?_0x4a7b61[_0xff89('0x63')][0x2][_0xff89('0x64')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x4a7b61[_0xff89('0x6a')]||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61['attrs'][0x0]?_0x4a7b61[_0xff89('0x63')][0x0][_0xff89('0x64')]:undefined)||_0xff89('0x6b')},{'name':_0xff89('0x6c'),'value':_0x4a7b61[_0xff89('0x6c')]||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61[_0xff89('0x63')][0x1]?_0x4a7b61[_0xff89('0x63')][0x1][_0xff89('0x64')]:undefined)||[]},{'name':_0xff89('0x69'),'value':_0x4a7b61[_0xff89('0x69')]||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61[_0xff89('0x63')][0x2]?_0x4a7b61['attrs'][0x2][_0xff89('0x64')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0xff89('0x6d'),'value':_0x4a7b61['attrSerie1']||(_0x4a7b61['attrs']&&_0x4a7b61[_0xff89('0x63')][0x0]?_0x4a7b61['attrs'][0x0][_0xff89('0x64')]:undefined)||_0xff89('0x6b')},{'name':_0xff89('0x6e'),'value':_0x4a7b61[_0xff89('0x6e')]||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61[_0xff89('0x63')][0x1]?_0x4a7b61[_0xff89('0x63')][0x1][_0xff89('0x64')]:undefined)||null},{'name':'attrSerie3','value':_0x4a7b61[_0xff89('0x6f')]||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61[_0xff89('0x63')][0x2]?_0x4a7b61['attrs'][0x2][_0xff89('0x64')]:undefined)||null},{'name':_0xff89('0x6c'),'value':_0x4a7b61[_0xff89('0x6c')]||(_0x4a7b61['attrs']&&_0x4a7b61[_0xff89('0x63')][0x3]?_0x4a7b61[_0xff89('0x63')][0x3][_0xff89('0x64')]:undefined)||[]}];case _0xff89('0x70'):return[{'name':_0xff89('0x71'),'type':_0x4a7b61[_0xff89('0x72')]||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61['attrs'][0x0]?_0x4a7b61[_0xff89('0x63')][0x0][_0xff89('0x37')]:undefined)||null,'value':_0x4a7b61[_0xff89('0x71')]||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61[_0xff89('0x63')][0x0]?_0x4a7b61[_0xff89('0x63')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x4a7b61['attrRefresh']||(_0x4a7b61[_0xff89('0x63')]&&_0x4a7b61[_0xff89('0x63')][0x1]?_0x4a7b61[_0xff89('0x63')][0x1][_0xff89('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x49b1fc){logger[_0xff89('0x2f')]('widgetAttributes:\x20%s',JSON[_0xff89('0x73')](_0x49b1fc));return[];}}exports[_0xff89('0x74')]=function(_0x5e0fcb,_0x2d6e8b,_0x3af718){if(_0x5e0fcb[_0xff89('0x5d')]['id']){delete _0x5e0fcb[_0xff89('0x5d')]['id'];}return db[_0xff89('0x34')][_0xff89('0x54')]({'where':{'id':_0x5e0fcb[_0xff89('0x50')]['id']}})[_0xff89('0x2b')](handleEntityNotFound(_0x2d6e8b,null))[_0xff89('0x2b')](function(_0x1862b8){if(_0x1862b8){_0x5e0fcb[_0xff89('0x5d')][_0xff89('0x75')]=_0x1862b8['id'];_0x5e0fcb[_0xff89('0x5d')][_0xff89('0x63')]=widgetAttributes(_0x5e0fcb[_0xff89('0x5d')]);return db[_0xff89('0x76')]['create'](_0x5e0fcb[_0xff89('0x5d')]);}})[_0xff89('0x2b')](respondWithResult(_0x2d6e8b,null))[_0xff89('0x4e')](handleError(_0x2d6e8b,null));};exports[_0xff89('0x77')]=function(_0x3c7b23,_0x38f4ec,_0x14ff23){var _0x3c6f99={};var _0x2a6397={};var _0x46313c;var _0x3099bf;return db['Dashboard'][_0xff89('0x78')]({'where':{'id':_0x3c7b23[_0xff89('0x50')]['id']}})[_0xff89('0x2b')](handleEntityNotFound(_0x38f4ec,null))[_0xff89('0x2b')](function(_0x355bd5){if(_0x355bd5){_0x46313c=_0x355bd5;_0x2a6397['model']=_['keys'](db[_0xff89('0x76')][_0xff89('0x35')]);_0x2a6397['query']=_[_0xff89('0x3b')](_0x3c7b23[_0xff89('0x3a')]);_0x2a6397['filters']=_['intersection'](_0x2a6397['model'],_0x2a6397[_0xff89('0x3a')]);_0x3c6f99[_0xff89('0x3e')]=_[_0xff89('0x3d')](_0x2a6397[_0xff89('0x38')],qs[_0xff89('0x3f')](_0x3c7b23[_0xff89('0x3a')][_0xff89('0x3f')]));_0x3c6f99[_0xff89('0x3e')]=_0x3c6f99[_0xff89('0x3e')][_0xff89('0x40')]?_0x3c6f99[_0xff89('0x3e')]:_0x2a6397[_0xff89('0x38')];_0x3c6f99[_0xff89('0x43')]=qs[_0xff89('0x44')](_0x3c7b23['query'][_0xff89('0x44')]);_0x3c6f99[_0xff89('0x45')]=qs[_0xff89('0x3c')](_[_0xff89('0x46')](_0x3c7b23[_0xff89('0x3a')],_0x2a6397[_0xff89('0x3c')]));if(_0x3c7b23[_0xff89('0x3a')][_0xff89('0x47')]){_0x3c6f99[_0xff89('0x45')]=_['merge'](_0x3c6f99[_0xff89('0x45')],{'$or':_['map'](_0x3c6f99[_0xff89('0x3e')],function(_0x42b3bf){var _0x17ee38={};_0x17ee38[_0x42b3bf]={'$like':'%'+_0x3c7b23[_0xff89('0x3a')][_0xff89('0x47')]+'%'};return _0x17ee38;})});}_0x3c6f99=_[_0xff89('0x49')]({},_0x3c6f99,_0x3c7b23['options']);return _0x46313c[_0xff89('0x77')](_0x3c6f99);}})[_0xff89('0x2b')](function(_0x2152a7){if(_0x2152a7){_0x3099bf=_0x2152a7[_0xff89('0x40')];if(!_0x3c7b23[_0xff89('0x3a')][_0xff89('0x41')](_0xff89('0x42'))){_0x3c6f99[_0xff89('0x25')]=qs[_0xff89('0x25')](_0x3c7b23['query'][_0xff89('0x25')]);_0x3c6f99[_0xff89('0x24')]=qs['offset'](_0x3c7b23[_0xff89('0x3a')][_0xff89('0x24')]);}return _0x46313c['getItems'](_0x3c6f99);}})[_0xff89('0x2b')](function(_0x306a8c){if(_0x306a8c){return _0x306a8c?{'count':_0x3099bf,'rows':_0x306a8c}:null;}})[_0xff89('0x2b')](respondWithResult(_0x38f4ec,null))[_0xff89('0x4e')](handleError(_0x38f4ec,null));};
\ No newline at end of file
+var _0xfdb5=['sort','where','pick','filter','VIRTUAL','options','count','includeAll','rows','catch','params','intersection','length','include','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','findOne','rawAttributes','getItems','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','destroy','CustomDashboards','UserProfileResource','then','stack','send','index','Dashboard','fieldName','type','map','name','query','keys','filters','model','fields','attributes','hasOwnProperty','nolimit','order'];(function(_0x4f5121,_0x2435f3){var _0x306a79=function(_0x3adde6){while(--_0x3adde6){_0x4f5121['push'](_0x4f5121['shift']());}};_0x306a79(++_0x2435f3);}(_0xfdb5,0x1a6));var _0x5fdb=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xfdb5[_0x46d0c9];return _0x174506;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5fdb('0x0'));var zipdir=require(_0x5fdb('0x1'));var jsonpatch=require(_0x5fdb('0x2'));var rp=require(_0x5fdb('0x3'));var moment=require(_0x5fdb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5fdb('0x5'));var util=require(_0x5fdb('0x6'));var path=require('path');var sox=require(_0x5fdb('0x7'));var csv=require('to-csv');var ejs=require(_0x5fdb('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5fdb('0x9'));var crypto=require(_0x5fdb('0xa'));var jsforce=require(_0x5fdb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5fdb('0xc'));var querystring=require('querystring');var Papa=require(_0x5fdb('0xd'));var Redis=require(_0x5fdb('0xe'));var authService=require(_0x5fdb('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fdb('0x10'));var logger=require(_0x5fdb('0x11'))('api');var utils=require(_0x5fdb('0x12'));var config=require('../../config/environment');var db=require(_0x5fdb('0x13'))['db'];config['redis']=_[_0x5fdb('0x14')](config[_0x5fdb('0x15')],{'host':_0x5fdb('0x16'),'port':0x18eb});var socket=require(_0x5fdb('0x17'))(new Redis(config[_0x5fdb('0x15')]));require(_0x5fdb('0x18'))[_0x5fdb('0x19')](socket);function respondWithStatusCode(_0x240539,_0x42769a){_0x42769a=_0x42769a||0xcc;return function(_0x369bcb){if(_0x369bcb){return _0x240539[_0x5fdb('0x1a')](_0x42769a);}return _0x240539[_0x5fdb('0x1b')](_0x42769a)[_0x5fdb('0x1c')]();};}function respondWithResult(_0x180719,_0x2e58e9){_0x2e58e9=_0x2e58e9||0xc8;return function(_0x9e4335){if(_0x9e4335){return _0x180719[_0x5fdb('0x1b')](_0x2e58e9)['json'](_0x9e4335);}};}function respondWithFilteredResult(_0x5341e4,_0x4ded08){return function(_0x552984){if(_0x552984){var _0x10c98f=_0x552984['count'],_0x4b16af=_0x4ded08[_0x5fdb('0x1d')],_0x3f8281=_0x4ded08['offset']+_0x4ded08[_0x5fdb('0x1e')],_0x1c8036;if(_0x3f8281>=_0x10c98f){_0x3f8281=_0x10c98f;_0x1c8036=0xc8;}else{_0x1c8036=0xce;}_0x5341e4[_0x5fdb('0x1b')](_0x1c8036);return _0x5341e4[_0x5fdb('0x1f')](_0x5fdb('0x20'),_0x4b16af+'-'+_0x3f8281+'/'+_0x10c98f)[_0x5fdb('0x21')](_0x552984);}return null;};}function patchUpdates(_0x400a46){return function(_0x8fbd39){try{jsonpatch[_0x5fdb('0x22')](_0x8fbd39,_0x400a46,!![]);}catch(_0x442e28){return BPromise[_0x5fdb('0x23')](_0x442e28);}return _0x8fbd39[_0x5fdb('0x24')]();};}function saveUpdates(_0x504141,_0x46b84e){return function(_0x2a9b9e){if(_0x2a9b9e){return _0x2a9b9e['update'](_0x504141)['then'](function(_0xd89d16){return _0xd89d16;});}return null;};}function removeEntity(_0x495726,_0x24fcb7){return function(_0x14ad34){if(_0x14ad34){return _0x14ad34[_0x5fdb('0x25')]()['then'](function(){var _0x1d8dee=_0x14ad34['get']({'plain':!![]});var _0x588656=_0x5fdb('0x26');return db[_0x5fdb('0x27')][_0x5fdb('0x25')]({'where':{'type':_0x588656,'resourceId':_0x1d8dee['id']}})[_0x5fdb('0x28')](function(){return _0x14ad34;});})[_0x5fdb('0x28')](function(){_0x495726[_0x5fdb('0x1b')](0xcc)[_0x5fdb('0x1c')]();});}};}function handleEntityNotFound(_0x283e40,_0x3c3491){return function(_0x19616b){if(!_0x19616b){_0x283e40[_0x5fdb('0x1a')](0x194);}return _0x19616b;};}function handleError(_0x46409b,_0x205c51){_0x205c51=_0x205c51||0x1f4;return function(_0x19f308){logger['error'](_0x19f308[_0x5fdb('0x29')]);if(_0x19f308['name']){delete _0x19f308['name'];}_0x46409b[_0x5fdb('0x1b')](_0x205c51)[_0x5fdb('0x2a')](_0x19f308);};}exports[_0x5fdb('0x2b')]=function(_0x1576ce,_0x5905cf){var _0x23a8cf={},_0x142ce6={},_0x2603df={'count':0x0,'rows':[]};var _0xa27311=_['map'](db[_0x5fdb('0x2c')]['rawAttributes'],function(_0x22b00c){return{'name':_0x22b00c[_0x5fdb('0x2d')],'type':_0x22b00c[_0x5fdb('0x2e')]['key']};});_0x142ce6['model']=_[_0x5fdb('0x2f')](_0xa27311,_0x5fdb('0x30'));_0x142ce6[_0x5fdb('0x31')]=_[_0x5fdb('0x32')](_0x1576ce[_0x5fdb('0x31')]);_0x142ce6[_0x5fdb('0x33')]=_['intersection'](_0x142ce6[_0x5fdb('0x34')],_0x142ce6[_0x5fdb('0x31')]);_0x23a8cf['attributes']=_['intersection'](_0x142ce6[_0x5fdb('0x34')],qs[_0x5fdb('0x35')](_0x1576ce[_0x5fdb('0x31')]['fields']));_0x23a8cf[_0x5fdb('0x36')]=_0x23a8cf[_0x5fdb('0x36')]['length']?_0x23a8cf[_0x5fdb('0x36')]:_0x142ce6[_0x5fdb('0x34')];if(!_0x1576ce['query'][_0x5fdb('0x37')](_0x5fdb('0x38'))){_0x23a8cf[_0x5fdb('0x1e')]=qs[_0x5fdb('0x1e')](_0x1576ce[_0x5fdb('0x31')][_0x5fdb('0x1e')]);_0x23a8cf['offset']=qs[_0x5fdb('0x1d')](_0x1576ce[_0x5fdb('0x31')][_0x5fdb('0x1d')]);}_0x23a8cf[_0x5fdb('0x39')]=qs['sort'](_0x1576ce['query'][_0x5fdb('0x3a')]);_0x23a8cf[_0x5fdb('0x3b')]=qs[_0x5fdb('0x33')](_[_0x5fdb('0x3c')](_0x1576ce[_0x5fdb('0x31')],_0x142ce6[_0x5fdb('0x33')]),_0xa27311);if(_0x1576ce[_0x5fdb('0x31')][_0x5fdb('0x3d')]){_0x23a8cf[_0x5fdb('0x3b')]=_['merge'](_0x23a8cf[_0x5fdb('0x3b')],{'$or':_[_0x5fdb('0x2f')](_0xa27311,function(_0x29e081){if(_0x29e081[_0x5fdb('0x2e')]!==_0x5fdb('0x3e')){var _0x46a294={};_0x46a294[_0x29e081[_0x5fdb('0x30')]]={'$like':'%'+_0x1576ce[_0x5fdb('0x31')][_0x5fdb('0x3d')]+'%'};return _0x46a294;}})});}_0x23a8cf=_['merge']({},_0x23a8cf,_0x1576ce[_0x5fdb('0x3f')]);var _0x103a49={'where':_0x23a8cf[_0x5fdb('0x3b')]};return db[_0x5fdb('0x2c')][_0x5fdb('0x40')](_0x103a49)[_0x5fdb('0x28')](function(_0x5d14b8){_0x2603df[_0x5fdb('0x40')]=_0x5d14b8;if(_0x1576ce[_0x5fdb('0x31')][_0x5fdb('0x41')]){_0x23a8cf['include']=[{'all':!![]}];}return db[_0x5fdb('0x2c')]['findAll'](_0x23a8cf);})[_0x5fdb('0x28')](function(_0x305c57){_0x2603df[_0x5fdb('0x42')]=_0x305c57;return _0x2603df;})[_0x5fdb('0x28')](respondWithFilteredResult(_0x5905cf,_0x23a8cf))[_0x5fdb('0x43')](handleError(_0x5905cf,null));};exports['show']=function(_0x2e801a,_0x180f30){var _0x23b9f1={'raw':![],'where':{'id':_0x2e801a[_0x5fdb('0x44')]['id']}},_0x1589d7={};_0x1589d7[_0x5fdb('0x34')]=_['keys'](db[_0x5fdb('0x2c')]['rawAttributes']);_0x1589d7[_0x5fdb('0x31')]=_[_0x5fdb('0x32')](_0x2e801a['query']);_0x1589d7[_0x5fdb('0x33')]=_['intersection'](_0x1589d7[_0x5fdb('0x34')],_0x1589d7[_0x5fdb('0x31')]);_0x23b9f1[_0x5fdb('0x36')]=_[_0x5fdb('0x45')](_0x1589d7['model'],qs[_0x5fdb('0x35')](_0x2e801a[_0x5fdb('0x31')]['fields']));_0x23b9f1[_0x5fdb('0x36')]=_0x23b9f1[_0x5fdb('0x36')][_0x5fdb('0x46')]?_0x23b9f1[_0x5fdb('0x36')]:_0x1589d7['model'];if(_0x2e801a[_0x5fdb('0x31')][_0x5fdb('0x41')]){_0x23b9f1[_0x5fdb('0x47')]=[{'all':!![]}];}_0x23b9f1=_[_0x5fdb('0x48')]({},_0x23b9f1,_0x2e801a[_0x5fdb('0x3f')]);return db['Dashboard']['find'](_0x23b9f1)[_0x5fdb('0x28')](handleEntityNotFound(_0x180f30,null))['then'](respondWithResult(_0x180f30,null))[_0x5fdb('0x43')](handleError(_0x180f30,null));};exports[_0x5fdb('0x49')]=function(_0x5def21,_0x2d8f1f){return db[_0x5fdb('0x2c')][_0x5fdb('0x49')](_0x5def21[_0x5fdb('0x4a')],{})[_0x5fdb('0x28')](function(_0x184a4b){var _0x26507f=_0x5def21['user']['get']({'plain':!![]});if(!_0x26507f)throw new Error(_0x5fdb('0x4b'));if(_0x26507f['role']===_0x5fdb('0x4c')){var _0x31c2e1=_0x184a4b[_0x5fdb('0x4d')]({'plain':!![]});var _0x48ebb2=_0x5fdb('0x26');return db['UserProfileSection'][_0x5fdb('0x4e')]({'where':{'name':_0x48ebb2,'userProfileId':_0x26507f[_0x5fdb('0x4f')]},'raw':!![]})[_0x5fdb('0x28')](function(_0x26e886){if(_0x26e886&&_0x26e886[_0x5fdb('0x50')]===0x0){return db[_0x5fdb('0x27')][_0x5fdb('0x49')]({'name':_0x31c2e1[_0x5fdb('0x30')],'resourceId':_0x31c2e1['id'],'type':_0x26e886['name'],'sectionId':_0x26e886['id']},{})[_0x5fdb('0x28')](function(){return _0x184a4b;});}else{return _0x184a4b;}})['catch'](function(_0x1cc975){logger[_0x5fdb('0x51')](_0x5fdb('0x52'),_0x1cc975);throw _0x1cc975;});}return _0x184a4b;})[_0x5fdb('0x28')](respondWithResult(_0x2d8f1f,0xc9))[_0x5fdb('0x43')](handleError(_0x2d8f1f,null));};exports[_0x5fdb('0x53')]=function(_0x162d98,_0x1e093b){var _0x159212={'where':{'id':_0x162d98[_0x5fdb('0x44')]['id']}},_0x851380={};_0x851380['model']=_['keys'](db[_0x5fdb('0x2c')]['rawAttributes']);_0x159212[_0x5fdb('0x36')]=_[_0x5fdb('0x45')](_0x851380[_0x5fdb('0x34')],qs[_0x5fdb('0x35')](_0x162d98[_0x5fdb('0x31')]['fields']));_0x159212['attributes']=_0x159212[_0x5fdb('0x36')]['length']?_0x159212[_0x5fdb('0x36')]:_0x851380[_0x5fdb('0x34')];if(_0x162d98['query'][_0x5fdb('0x41')]){_0x159212['include']=[{'all':!![]}];}_0x159212=_[_0x5fdb('0x48')]({},_0x159212,_0x162d98['options']);return db[_0x5fdb('0x2c')]['find'](_0x159212)[_0x5fdb('0x28')](handleEntityNotFound(_0x1e093b,null))[_0x5fdb('0x28')](function(_0x4e5dda){if(_0x4e5dda){var _0xcb0595=_0x4e5dda[_0x5fdb('0x4d')]({'plain':!![]});_0xcb0595=qs[_0x5fdb('0x54')](_0xcb0595,['id',_0x5fdb('0x55'),_0x5fdb('0x56')]);_0x162d98[_0x5fdb('0x4a')]=_[_0x5fdb('0x54')](_0x162d98[_0x5fdb('0x4a')],['id',_0x5fdb('0x55'),'updatedAt']);return db[_0x5fdb('0x2c')][_0x5fdb('0x49')](_['merge'](_0xcb0595,_0x162d98['body']),{'include':_0x162d98[_0x5fdb('0x31')][_0x5fdb('0x41')]?[{'all':!![]}]:undefined})[_0x5fdb('0x28')](function(_0x25c73b){var _0x5b72ec=_0x162d98[_0x5fdb('0x4c')][_0x5fdb('0x4d')]({'plain':!![]});if(!_0x5b72ec)throw new Error(_0x5fdb('0x4b'));if(_0x5b72ec[_0x5fdb('0x57')]===_0x5fdb('0x4c')){var _0x1c4dd4=_0x25c73b['get']({'plain':!![]});var _0x55795a=_0x5fdb('0x26');return db[_0x5fdb('0x58')][_0x5fdb('0x4e')]({'where':{'name':_0x55795a,'userProfileId':_0x5b72ec[_0x5fdb('0x4f')]},'raw':!![]})['then'](function(_0x4ec97f){if(_0x4ec97f&&_0x4ec97f[_0x5fdb('0x50')]===0x0){return db[_0x5fdb('0x27')]['create']({'name':_0x1c4dd4['name'],'resourceId':_0x1c4dd4['id'],'type':_0x4ec97f[_0x5fdb('0x30')],'sectionId':_0x4ec97f['id']},{})[_0x5fdb('0x28')](function(){return _0x25c73b;});}else{return _0x25c73b;}})[_0x5fdb('0x43')](function(_0x2b51cc){logger['error'](_0x5fdb('0x52'),_0x2b51cc);throw _0x2b51cc;});}return _0x25c73b;});}})[_0x5fdb('0x28')](respondWithResult(_0x1e093b,0xc9))[_0x5fdb('0x43')](handleError(_0x1e093b,null));};exports['update']=function(_0x357e1e,_0xab3756){if(_0x357e1e['body']['id']){delete _0x357e1e[_0x5fdb('0x4a')]['id'];}return db[_0x5fdb('0x2c')][_0x5fdb('0x4e')]({'where':{'id':_0x357e1e['params']['id']}})[_0x5fdb('0x28')](handleEntityNotFound(_0xab3756,null))[_0x5fdb('0x28')](saveUpdates(_0x357e1e[_0x5fdb('0x4a')],null))['then'](respondWithResult(_0xab3756,null))[_0x5fdb('0x43')](handleError(_0xab3756,null));};exports[_0x5fdb('0x25')]=function(_0x4cf796,_0x5e791b){return db[_0x5fdb('0x2c')][_0x5fdb('0x4e')]({'where':{'id':_0x4cf796['params']['id']}})[_0x5fdb('0x28')](handleEntityNotFound(_0x5e791b,null))[_0x5fdb('0x28')](removeEntity(_0x5e791b,null))['catch'](handleError(_0x5e791b,null));};function widgetAttributes(_0x3bf012){try{switch(_0x3bf012['type']){case'iframe':return[{'name':_0x5fdb('0x59'),'value':_0x3bf012['attrUrl']||(_0x3bf012[_0x5fdb('0x5a')]&&_0x3bf012['attrs'][0x0]?_0x3bf012[_0x5fdb('0x5a')][0x0]['value']:undefined)||_0x5fdb('0x5b')}];case _0x5fdb('0x5c'):return[{'name':_0x5fdb('0x5d'),'value':_0x3bf012[_0x5fdb('0x5d')]||(_0x3bf012['attrs']&&_0x3bf012[_0x5fdb('0x5a')][0x0]?_0x3bf012[_0x5fdb('0x5a')][0x0][_0x5fdb('0x5e')]:undefined)||''}];case _0x5fdb('0x5f'):return[{'name':_0x5fdb('0x60'),'value':_0x3bf012['attrHourFormat']||(_0x3bf012['attrs']&&_0x3bf012['attrs'][0x0]?_0x3bf012[_0x5fdb('0x5a')][0x0][_0x5fdb('0x5e')]:undefined)||_0x5fdb('0x61')},{'name':_0x5fdb('0x62'),'value':_0x3bf012['attrTimezone']||(_0x3bf012['attrs']&&_0x3bf012[_0x5fdb('0x5a')][0x1]?_0x3bf012[_0x5fdb('0x5a')][0x1][_0x5fdb('0x5e')]:undefined)||_0x5fdb('0x63')},{'name':_0x5fdb('0x64'),'value':_0x3bf012[_0x5fdb('0x64')]||(_0x3bf012[_0x5fdb('0x5a')]&&_0x3bf012[_0x5fdb('0x5a')][0x2]?_0x3bf012[_0x5fdb('0x5a')][0x2][_0x5fdb('0x5e')]:undefined)||0xc}];case'counter':return[{'name':_0x5fdb('0x65'),'value':_0x3bf012['attrMetric']||(_0x3bf012[_0x5fdb('0x5a')]&&_0x3bf012['attrs'][0x0]?_0x3bf012[_0x5fdb('0x5a')][0x0]['value']:undefined)||_0x5fdb('0x66')},{'name':'attrVoiceQueues','value':_0x3bf012[_0x5fdb('0x67')]||(_0x3bf012[_0x5fdb('0x5a')]&&_0x3bf012[_0x5fdb('0x5a')][0x1]?_0x3bf012[_0x5fdb('0x5a')][0x1]['value']:undefined)||[]},{'name':_0x5fdb('0x64'),'value':_0x3bf012[_0x5fdb('0x64')]||(_0x3bf012['attrs']&&_0x3bf012['attrs'][0x2]?_0x3bf012[_0x5fdb('0x5a')][0x2][_0x5fdb('0x5e')]:undefined)||0x14}];case _0x5fdb('0x68'):case _0x5fdb('0x69'):return[{'name':'attrSerie1','value':_0x3bf012[_0x5fdb('0x6a')]||(_0x3bf012[_0x5fdb('0x5a')]&&_0x3bf012[_0x5fdb('0x5a')][0x0]?_0x3bf012['attrs'][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x3bf012[_0x5fdb('0x6b')]||(_0x3bf012[_0x5fdb('0x5a')]&&_0x3bf012[_0x5fdb('0x5a')][0x1]?_0x3bf012['attrs'][0x1][_0x5fdb('0x5e')]:undefined)||null},{'name':_0x5fdb('0x6c'),'value':_0x3bf012['attrSerie3']||(_0x3bf012['attrs']&&_0x3bf012[_0x5fdb('0x5a')][0x2]?_0x3bf012[_0x5fdb('0x5a')][0x2][_0x5fdb('0x5e')]:undefined)||null},{'name':_0x5fdb('0x67'),'value':_0x3bf012['attrVoiceQueues']||(_0x3bf012[_0x5fdb('0x5a')]&&_0x3bf012['attrs'][0x3]?_0x3bf012[_0x5fdb('0x5a')][0x3][_0x5fdb('0x5e')]:undefined)||[]}];case _0x5fdb('0x6d'):return[{'name':_0x5fdb('0x6e'),'type':_0x3bf012[_0x5fdb('0x6f')]||(_0x3bf012[_0x5fdb('0x5a')]&&_0x3bf012[_0x5fdb('0x5a')][0x0]?_0x3bf012[_0x5fdb('0x5a')][0x0][_0x5fdb('0x2e')]:undefined)||null,'value':_0x3bf012[_0x5fdb('0x6e')]||(_0x3bf012['attrs']&&_0x3bf012[_0x5fdb('0x5a')][0x0]?_0x3bf012[_0x5fdb('0x5a')][0x0][_0x5fdb('0x5e')]:undefined)||null},{'name':_0x5fdb('0x70'),'value':_0x3bf012[_0x5fdb('0x70')]||(_0x3bf012[_0x5fdb('0x5a')]&&_0x3bf012['attrs'][0x1]?_0x3bf012[_0x5fdb('0x5a')][0x1][_0x5fdb('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x5ce577){logger[_0x5fdb('0x51')](_0x5fdb('0x71'),JSON['stringify'](_0x5ce577));return[];}}exports[_0x5fdb('0x72')]=function(_0x2e70fa,_0x428589,_0x554ff6){if(_0x2e70fa[_0x5fdb('0x4a')]['id']){delete _0x2e70fa[_0x5fdb('0x4a')]['id'];}return db[_0x5fdb('0x2c')][_0x5fdb('0x4e')]({'where':{'id':_0x2e70fa['params']['id']}})[_0x5fdb('0x28')](handleEntityNotFound(_0x428589,null))[_0x5fdb('0x28')](function(_0x36827c){if(_0x36827c){_0x2e70fa[_0x5fdb('0x4a')][_0x5fdb('0x73')]=_0x36827c['id'];_0x2e70fa['body'][_0x5fdb('0x5a')]=widgetAttributes(_0x2e70fa[_0x5fdb('0x4a')]);return db[_0x5fdb('0x74')][_0x5fdb('0x49')](_0x2e70fa['body']);}})[_0x5fdb('0x28')](respondWithResult(_0x428589,null))[_0x5fdb('0x43')](handleError(_0x428589,null));};exports['getItems']=function(_0x2fcf37,_0x50863e,_0x4e2302){var _0x2df46b={};var _0x1d209a={};var _0x267e3f;var _0x21e7ee;return db[_0x5fdb('0x2c')][_0x5fdb('0x75')]({'where':{'id':_0x2fcf37[_0x5fdb('0x44')]['id']}})[_0x5fdb('0x28')](handleEntityNotFound(_0x50863e,null))[_0x5fdb('0x28')](function(_0x158aa5){if(_0x158aa5){_0x267e3f=_0x158aa5;_0x1d209a[_0x5fdb('0x34')]=_['keys'](db[_0x5fdb('0x74')][_0x5fdb('0x76')]);_0x1d209a['query']=_[_0x5fdb('0x32')](_0x2fcf37[_0x5fdb('0x31')]);_0x1d209a[_0x5fdb('0x33')]=_[_0x5fdb('0x45')](_0x1d209a[_0x5fdb('0x34')],_0x1d209a['query']);_0x2df46b[_0x5fdb('0x36')]=_['intersection'](_0x1d209a[_0x5fdb('0x34')],qs[_0x5fdb('0x35')](_0x2fcf37[_0x5fdb('0x31')][_0x5fdb('0x35')]));_0x2df46b[_0x5fdb('0x36')]=_0x2df46b[_0x5fdb('0x36')][_0x5fdb('0x46')]?_0x2df46b[_0x5fdb('0x36')]:_0x1d209a['model'];_0x2df46b[_0x5fdb('0x39')]=qs[_0x5fdb('0x3a')](_0x2fcf37[_0x5fdb('0x31')][_0x5fdb('0x3a')]);_0x2df46b[_0x5fdb('0x3b')]=qs['filters'](_[_0x5fdb('0x3c')](_0x2fcf37[_0x5fdb('0x31')],_0x1d209a[_0x5fdb('0x33')]));if(_0x2fcf37['query'][_0x5fdb('0x3d')]){_0x2df46b[_0x5fdb('0x3b')]=_['merge'](_0x2df46b[_0x5fdb('0x3b')],{'$or':_[_0x5fdb('0x2f')](_0x2df46b['attributes'],function(_0x582ef1){var _0x389ff2={};_0x389ff2[_0x582ef1]={'$like':'%'+_0x2fcf37['query']['filter']+'%'};return _0x389ff2;})});}_0x2df46b=_[_0x5fdb('0x48')]({},_0x2df46b,_0x2fcf37[_0x5fdb('0x3f')]);return _0x267e3f['getItems'](_0x2df46b);}})[_0x5fdb('0x28')](function(_0x408e42){if(_0x408e42){_0x21e7ee=_0x408e42[_0x5fdb('0x46')];if(!_0x2fcf37[_0x5fdb('0x31')][_0x5fdb('0x37')]('nolimit')){_0x2df46b[_0x5fdb('0x1e')]=qs[_0x5fdb('0x1e')](_0x2fcf37[_0x5fdb('0x31')][_0x5fdb('0x1e')]);_0x2df46b[_0x5fdb('0x1d')]=qs['offset'](_0x2fcf37[_0x5fdb('0x31')]['offset']);}return _0x267e3f[_0x5fdb('0x77')](_0x2df46b);}})[_0x5fdb('0x28')](function(_0x3742e3){if(_0x3742e3){return _0x3742e3?{'count':_0x21e7ee,'rows':_0x3742e3}:null;}})[_0x5fdb('0x28')](respondWithResult(_0x50863e,null))[_0x5fdb('0x43')](handleError(_0x50863e,null));};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js
index 967bb2a..911e344 100644
--- a/server/api/dashboard/dashboard.events.js
+++ b/server/api/dashboard/dashboard.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x97cd=['save','update','remove','emit','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x41dde4,_0x3d4473){var _0x758f9b=function(_0x1fe8e2){while(--_0x1fe8e2){_0x41dde4['push'](_0x41dde4['shift']());}};_0x758f9b(++_0x3d4473);}(_0x97cd,0x68));var _0xd97c=function(_0x4c8815,_0xa6523c){_0x4c8815=_0x4c8815-0x0;var _0x4c9f93=_0x97cd[_0x4c8815];return _0x4c9f93;};'use strict';var EventEmitter=require(_0xd97c('0x0'));var Dashboard=require(_0xd97c('0x1'))['db'][_0xd97c('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd97c('0x3')](0x0);var events={'afterCreate':_0xd97c('0x4'),'afterUpdate':_0xd97c('0x5'),'afterDestroy':_0xd97c('0x6')};function emitEvent(_0x379381){return function(_0x187816,_0xae7710,_0x1be818){DashboardEvents[_0xd97c('0x7')](_0x379381+':'+_0x187816['id'],_0x187816);DashboardEvents['emit'](_0x379381,_0x187816);_0x1be818(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xd97c('0x8')]=DashboardEvents;
\ No newline at end of file
+var _0x5447=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2f2fc4,_0x4a6f1f){var _0x3cfcb3=function(_0xad9ec7){while(--_0xad9ec7){_0x2f2fc4['push'](_0x2f2fc4['shift']());}};_0x3cfcb3(++_0x4a6f1f);}(_0x5447,0xbf));var _0x7544=function(_0x4d1f51,_0x319caa){_0x4d1f51=_0x4d1f51-0x0;var _0x45d66a=_0x5447[_0x4d1f51];return _0x45d66a;};'use strict';var EventEmitter=require(_0x7544('0x0'));var Dashboard=require(_0x7544('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7544('0x2')](0x0);var events={'afterCreate':_0x7544('0x3'),'afterUpdate':_0x7544('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5856cb){return function(_0x1a8a7c,_0x38c405,_0x36566c){DashboardEvents[_0x7544('0x5')](_0x5856cb+':'+_0x1a8a7c['id'],_0x1a8a7c);DashboardEvents[_0x7544('0x5')](_0x5856cb,_0x1a8a7c);_0x36566c(null);};}for(var e in events){if(events[_0x7544('0x6')](e)){var event=events[e];Dashboard[_0x7544('0x7')](e,emitEvent(event));}}module[_0x7544('0x8')]=DashboardEvents;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js
index a6c7f48..05ce707 100644
--- a/server/api/dashboard/dashboard.model.js
+++ b/server/api/dashboard/dashboard.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbb1=['lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define','Dashboard','dashboards'];(function(_0x1d90c2,_0x18ccb6){var _0x552549=function(_0x2c7a35){while(--_0x2c7a35){_0x1d90c2['push'](_0x1d90c2['shift']());}};_0x552549(++_0x18ccb6);}(_0xdbb1,0xe7));var _0x1dbb=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xdbb1[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0x1dbb('0x0'));var util=require(_0x1dbb('0x1'));var logger=require(_0x1dbb('0x2'))('api');var moment=require(_0x1dbb('0x3'));var BPromise=require('bluebird');var rp=require(_0x1dbb('0x4'));var fs=require('fs');var path=require(_0x1dbb('0x5'));var rimraf=require('rimraf');var config=require(_0x1dbb('0x6'));var attributes=require('./dashboard.attributes');module[_0x1dbb('0x7')]=function(_0x12976d,_0x49beeb){return _0x12976d[_0x1dbb('0x8')](_0x1dbb('0x9'),attributes,{'tableName':_0x1dbb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x633a=['moment','bluebird','request-promise','path','rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','../../config/logger'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x633a,0x76));var _0xa633=function(_0x5dafc5,_0x2738f9){_0x5dafc5=_0x5dafc5-0x0;var _0x31fe78=_0x633a[_0x5dafc5];return _0x31fe78;};'use strict';var _=require(_0xa633('0x0'));var util=require('util');var logger=require(_0xa633('0x1'))('api');var moment=require(_0xa633('0x2'));var BPromise=require(_0xa633('0x3'));var rp=require(_0xa633('0x4'));var fs=require('fs');var path=require(_0xa633('0x5'));var rimraf=require(_0xa633('0x6'));var config=require('../../config/environment');var attributes=require(_0xa633('0x7'));module[_0xa633('0x8')]=function(_0x318cbf,_0xdf7876){return _0x318cbf[_0xa633('0x9')](_0xa633('0xa'),attributes,{'tableName':_0xa633('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js
index 708e451..640dd8f 100644
--- a/server/api/dashboard/dashboard.rpc.js
+++ b/server/api/dashboard/dashboard.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc3e0=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x2f3471,_0x4041be){var _0x1afe02=function(_0x108e47){while(--_0x108e47){_0x2f3471['push'](_0x2f3471['shift']());}};_0x1afe02(++_0x4041be);}(_0xc3e0,0x103));var _0x0c3e=function(_0x499d16,_0x2d6547){_0x499d16=_0x499d16-0x0;var _0x2ab38a=_0xc3e0[_0x499d16];return _0x2ab38a;};'use strict';var _=require(_0x0c3e('0x0'));var util=require(_0x0c3e('0x1'));var moment=require('moment');var BPromise=require(_0x0c3e('0x2'));var rs=require(_0x0c3e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c3e('0x4'))['db'];var utils=require(_0x0c3e('0x5'));var logger=require(_0x0c3e('0x6'))(_0x0c3e('0x7'));var config=require(_0x0c3e('0x8'));var jayson=require(_0x0c3e('0x9'));var client=jayson[_0x0c3e('0xa')][_0x0c3e('0xb')]({'port':0x232a});config[_0x0c3e('0xc')]=_[_0x0c3e('0xd')](config[_0x0c3e('0xc')],{'host':_0x0c3e('0xe'),'port':0x18eb});var socket=require(_0x0c3e('0xf'))(new Redis(config[_0x0c3e('0xc')]));require(_0x0c3e('0x10'))[_0x0c3e('0x11')](socket);function respondWithRpcPromise(_0x8e0014,_0x1c9d0b,_0x36ed38){return new BPromise(function(_0x352e55,_0x111930){return client[_0x0c3e('0x12')](_0x8e0014,_0x36ed38)[_0x0c3e('0x13')](function(_0x42b6b4){logger[_0x0c3e('0x14')]('Dashboard,\x20%s,\x20%s',_0x1c9d0b,_0x0c3e('0x15'));logger[_0x0c3e('0x16')](_0x0c3e('0x17'),_0x1c9d0b,_0x0c3e('0x15'),JSON['stringify'](_0x42b6b4));if(_0x42b6b4[_0x0c3e('0x18')]){if(_0x42b6b4[_0x0c3e('0x18')][_0x0c3e('0x19')]===0x1f4){logger[_0x0c3e('0x18')](_0x0c3e('0x1a'),_0x1c9d0b,_0x42b6b4[_0x0c3e('0x18')][_0x0c3e('0x1b')]);return _0x111930(_0x42b6b4['error'][_0x0c3e('0x1b')]);}logger[_0x0c3e('0x18')](_0x0c3e('0x1a'),_0x1c9d0b,_0x42b6b4['error'][_0x0c3e('0x1b')]);return _0x352e55(_0x42b6b4[_0x0c3e('0x18')]['message']);}else{logger[_0x0c3e('0x14')](_0x0c3e('0x1a'),_0x1c9d0b,_0x0c3e('0x15'));_0x352e55(_0x42b6b4[_0x0c3e('0x1c')][_0x0c3e('0x1b')]);}})['catch'](function(_0x48ef93){logger[_0x0c3e('0x18')](_0x0c3e('0x1a'),_0x1c9d0b,_0x48ef93);_0x111930(_0x48ef93);});});}
\ No newline at end of file
+var _0x1bc3=['request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./dashboard.socket','register'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x1bc3,0x8d));var _0x31bc=function(_0x40b7f9,_0x28cd65){_0x40b7f9=_0x40b7f9-0x0;var _0x3430e7=_0x1bc3[_0x40b7f9];return _0x3430e7;};'use strict';var _=require(_0x31bc('0x0'));var util=require(_0x31bc('0x1'));var moment=require('moment');var BPromise=require(_0x31bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31bc('0x3'))['db'];var utils=require(_0x31bc('0x4'));var logger=require(_0x31bc('0x5'))(_0x31bc('0x6'));var config=require(_0x31bc('0x7'));var jayson=require(_0x31bc('0x8'));var client=jayson[_0x31bc('0x9')]['http']({'port':0x232a});config[_0x31bc('0xa')]=_[_0x31bc('0xb')](config[_0x31bc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x31bc('0xc'))(new Redis(config[_0x31bc('0xa')]));require(_0x31bc('0xd'))[_0x31bc('0xe')](socket);function respondWithRpcPromise(_0x5e888d,_0x586d98,_0x7dd52c){return new BPromise(function(_0x6b15dc,_0x1a6c6e){return client[_0x31bc('0xf')](_0x5e888d,_0x7dd52c)[_0x31bc('0x10')](function(_0x3b77ca){logger[_0x31bc('0x11')](_0x31bc('0x12'),_0x586d98,_0x31bc('0x13'));logger[_0x31bc('0x14')](_0x31bc('0x15'),_0x586d98,_0x31bc('0x13'),JSON['stringify'](_0x3b77ca));if(_0x3b77ca[_0x31bc('0x16')]){if(_0x3b77ca[_0x31bc('0x16')][_0x31bc('0x17')]===0x1f4){logger['error'](_0x31bc('0x12'),_0x586d98,_0x3b77ca['error'][_0x31bc('0x18')]);return _0x1a6c6e(_0x3b77ca[_0x31bc('0x16')][_0x31bc('0x18')]);}logger[_0x31bc('0x16')](_0x31bc('0x12'),_0x586d98,_0x3b77ca[_0x31bc('0x16')]['message']);return _0x6b15dc(_0x3b77ca[_0x31bc('0x16')][_0x31bc('0x18')]);}else{logger[_0x31bc('0x11')]('Dashboard,\x20%s,\x20%s',_0x586d98,_0x31bc('0x13'));_0x6b15dc(_0x3b77ca['result'][_0x31bc('0x18')]);}})[_0x31bc('0x19')](function(_0x250260){logger[_0x31bc('0x16')](_0x31bc('0x12'),_0x586d98,_0x250260);_0x1a6c6e(_0x250260);});});}
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js
index fa69836..75c48b0 100644
--- a/server/api/dashboard/dashboard.socket.js
+++ b/server/api/dashboard/dashboard.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce13=['remove','emit','removeListener','register','length','./dashboard.events','save'];(function(_0x2f98f3,_0x59655d){var _0x3e24fd=function(_0x5251ae){while(--_0x5251ae){_0x2f98f3['push'](_0x2f98f3['shift']());}};_0x3e24fd(++_0x59655d);}(_0xce13,0x147));var _0x3ce1=function(_0x3da81c,_0x51f8ae){_0x3da81c=_0x3da81c-0x0;var _0x3d2a8d=_0xce13[_0x3da81c];return _0x3d2a8d;};'use strict';var DashboardEvents=require(_0x3ce1('0x0'));var events=[_0x3ce1('0x1'),_0x3ce1('0x2'),'update'];function createListener(_0x30c1f7,_0x43d2f3){return function(_0x1e1f8b){_0x43d2f3[_0x3ce1('0x3')](_0x30c1f7,_0x1e1f8b);};}function removeListener(_0x3b02c6,_0x5de7c9){return function(){DashboardEvents[_0x3ce1('0x4')](_0x3b02c6,_0x5de7c9);};}exports[_0x3ce1('0x5')]=function(_0x1d47d3){for(var _0x45b8b8=0x0,_0x17879e=events[_0x3ce1('0x6')];_0x45b8b8<_0x17879e;_0x45b8b8++){var _0x3f25cb=events[_0x45b8b8];var _0x4746a8=createListener('dashboard:'+_0x3f25cb,_0x1d47d3);DashboardEvents['on'](_0x3f25cb,_0x4746a8);}};
\ No newline at end of file
+var _0xe2bd=['remove','update','emit','removeListener'];(function(_0x35f3c9,_0x1aaafe){var _0x483f61=function(_0x4022f3){while(--_0x4022f3){_0x35f3c9['push'](_0x35f3c9['shift']());}};_0x483f61(++_0x1aaafe);}(_0xe2bd,0xf4));var _0xde2b=function(_0x17966c,_0x403dfd){_0x17966c=_0x17966c-0x0;var _0x32c185=_0xe2bd[_0x17966c];return _0x32c185;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0xde2b('0x0'),_0xde2b('0x1')];function createListener(_0x1ae5b9,_0x7d2507){return function(_0x5b522a){_0x7d2507[_0xde2b('0x2')](_0x1ae5b9,_0x5b522a);};}function removeListener(_0x37745e,_0x581267){return function(){DashboardEvents[_0xde2b('0x3')](_0x37745e,_0x581267);};}exports['register']=function(_0x55b435){for(var _0x28b7aa=0x0,_0x50fc7e=events['length'];_0x28b7aa<_0x50fc7e;_0x28b7aa++){var _0x56c4a4=events[_0x28b7aa];var _0x48e127=createListener('dashboard:'+_0x56c4a4,_0x55b435);DashboardEvents['on'](_0x56c4a4,_0x48e127);}};
\ No newline at end of file
diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js
index 51db177..1d3085b 100644
--- a/server/api/dashboard/index.js
+++ b/server/api/dashboard/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['isAuthenticated','/:id','show','create','post','/:id/clone','/:id/items','addItem','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x49cb71,_0x2f0149){_0x49cb71=_0x49cb71-0x0;var _0x3a50fd=_0xcb91[_0x49cb71];return _0x3a50fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./dashboard.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/:id/items',auth[_0x1cb9('0x7')](),controller['getItems']);router['post']('/',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xa')]);router[_0x1cb9('0xb')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),controller['clone']);router[_0x1cb9('0xb')](_0x1cb9('0xd'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x10')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x70e0=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/items','isAuthenticated','getItems','post','/:id/clone','clone','addItem','put','/:id','update','multer'];(function(_0x239d5c,_0x1a109e){var _0x171bb2=function(_0x4eb84b){while(--_0x4eb84b){_0x239d5c['push'](_0x239d5c['shift']());}};_0x171bb2(++_0x1a109e);}(_0x70e0,0x17b));var _0x070e=function(_0x4f534d,_0x4ad122){_0x4f534d=_0x4f534d-0x0;var _0x43a45b=_0x70e0[_0x4f534d];return _0x43a45b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./dashboard.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth[_0x070e('0xb')](),controller['create']);router['post'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0xd')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0x12'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);router['delete']('/:id',auth[_0x070e('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js
index b58cfa0..9f1b130 100644
--- a/server/api/dashboardItem/dashboardItem.attributes.js
+++ b/server/api/dashboardItem/dashboardItem.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x02fe=['squel','lodash','exports','STRING','TEXT','parse','getDataValue','setDataValue','stringify','INTEGER','#2196f3','sequelize'];(function(_0x2efa96,_0x4e2825){var _0x37160d=function(_0x531eb5){while(--_0x531eb5){_0x2efa96['push'](_0x2efa96['shift']());}};_0x37160d(++_0x4e2825);}(_0x02fe,0x143));var _0xe02f=function(_0x48e7e5,_0x1d7c7f){_0x48e7e5=_0x48e7e5-0x0;var _0x50a962=_0x02fe[_0x48e7e5];return _0x50a962;};'use strict';var Sequelize=require(_0xe02f('0x0'));var squel=require(_0xe02f('0x1'));var _=require(_0xe02f('0x2'));module[_0xe02f('0x3')]={'title':{'type':Sequelize[_0xe02f('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xe02f('0x5')]('long'),'get':function(){try{return JSON[_0xe02f('0x6')](this[_0xe02f('0x7')]('attrs'));}catch(_0x231bd1){return[];}},'set':function(_0x206588){try{this[_0xe02f('0x8')]('attrs',JSON[_0xe02f('0x9')](_0x206588));}catch(_0x256fe6){this[_0xe02f('0x8')]('attrs',JSON[_0xe02f('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe02f('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xe02f('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xe02f('0x4')],'allowNull':![],'defaultValue':_0xe02f('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe02f('0x4')]}};
\ No newline at end of file
+var _0x859e=['getDataValue','attrs','setDataValue','stringify','INTEGER','sequelize','squel','lodash','exports','STRING','long','parse'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x859e,0xad));var _0xe859=function(_0x1f94c4,_0x5d1920){_0x1f94c4=_0x1f94c4-0x0;var _0x18b823=_0x859e[_0x1f94c4];return _0x18b823;};'use strict';var Sequelize=require(_0xe859('0x0'));var squel=require(_0xe859('0x1'));var _=require(_0xe859('0x2'));module[_0xe859('0x3')]={'title':{'type':Sequelize[_0xe859('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xe859('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xe859('0x5')),'get':function(){try{return JSON[_0xe859('0x6')](this[_0xe859('0x7')](_0xe859('0x8')));}catch(_0x5b43da){return[];}},'set':function(_0x31db13){try{this['setDataValue'](_0xe859('0x8'),JSON['stringify'](_0x31db13));}catch(_0x5c4b3d){this[_0xe859('0x9')]('attrs',JSON[_0xe859('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0xe859('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xe859('0xb')]},'col':{'type':Sequelize[_0xe859('0xb')]},'background':{'type':Sequelize[_0xe859('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xe859('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe859('0x4')]}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js
index 6e18711..20610c2 100644
--- a/server/api/dashboardItem/dashboardItem.controller.js
+++ b/server/api/dashboardItem/dashboardItem.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9007=['attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','html-pdf','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','destroy','end','stack','name','send','show','params','model','DashboardItem','rawAttributes','keys','query','intersection','attributes','fields','length','include','merge','find','catch','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat'];(function(_0x3bd2c2,_0x53b6e0){var _0x14dae5=function(_0x3b4122){while(--_0x3b4122){_0x3bd2c2['push'](_0x3bd2c2['shift']());}};_0x14dae5(++_0x53b6e0);}(_0x9007,0x1b8));var _0x7900=function(_0x1308ec,_0x32c99e){_0x1308ec=_0x1308ec-0x0;var _0x1a43c8=_0x9007[_0x1308ec];return _0x1a43c8;};'use strict';var pdf=require(_0x7900('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7900('0x2'));var rp=require('request-promise');var moment=require(_0x7900('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7900('0x4'));var util=require('util');var path=require(_0x7900('0x5'));var sox=require('sox');var csv=require(_0x7900('0x6'));var ejs=require(_0x7900('0x7'));var fs=require('fs');var _=require(_0x7900('0x8'));var squel=require('squel');var crypto=require(_0x7900('0x9'));var jsforce=require(_0x7900('0xa'));var deskjs=require(_0x7900('0xb'));var toCsv=require(_0x7900('0x6'));var querystring=require(_0x7900('0xc'));var Papa=require(_0x7900('0xd'));var Redis=require('ioredis');var authService=require(_0x7900('0xe'));var qs=require(_0x7900('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7900('0x10'));var utils=require('../../config/utils');var config=require(_0x7900('0x11'));var db=require(_0x7900('0x12'))['db'];config[_0x7900('0x13')]=_[_0x7900('0x14')](config[_0x7900('0x13')],{'host':_0x7900('0x15'),'port':0x18eb});var socket=require(_0x7900('0x16'))(new Redis(config[_0x7900('0x13')]));require(_0x7900('0x17'))[_0x7900('0x18')](socket);function respondWithStatusCode(_0x42f55d,_0x5a9673){_0x5a9673=_0x5a9673||0xcc;return function(_0x15a0c6){if(_0x15a0c6){return _0x42f55d[_0x7900('0x19')](_0x5a9673);}return _0x42f55d[_0x7900('0x1a')](_0x5a9673)['end']();};}function respondWithResult(_0x16d104,_0x244c74){_0x244c74=_0x244c74||0xc8;return function(_0x433670){if(_0x433670){return _0x16d104[_0x7900('0x1a')](_0x244c74)[_0x7900('0x1b')](_0x433670);}};}function respondWithFilteredResult(_0x1084db,_0xfabe6c){return function(_0x12d8d9){if(_0x12d8d9){var _0xf2b963=_0x12d8d9[_0x7900('0x1c')],_0x1da92b=_0xfabe6c[_0x7900('0x1d')],_0x582d8a=_0xfabe6c[_0x7900('0x1d')]+_0xfabe6c[_0x7900('0x1e')],_0x4cd2cc;if(_0x582d8a>=_0xf2b963){_0x582d8a=_0xf2b963;_0x4cd2cc=0xc8;}else{_0x4cd2cc=0xce;}_0x1084db[_0x7900('0x1a')](_0x4cd2cc);return _0x1084db[_0x7900('0x1f')]('Content-Range',_0x1da92b+'-'+_0x582d8a+'/'+_0xf2b963)[_0x7900('0x1b')](_0x12d8d9);}return null;};}function patchUpdates(_0x4d75c0){return function(_0x20793c){try{jsonpatch[_0x7900('0x20')](_0x20793c,_0x4d75c0,!![]);}catch(_0xb3a57b){return BPromise['reject'](_0xb3a57b);}return _0x20793c[_0x7900('0x21')]();};}function saveUpdates(_0x15cb1e,_0x12b766){return function(_0x552708){if(_0x552708){return _0x552708[_0x7900('0x22')](_0x15cb1e)[_0x7900('0x23')](function(_0x1d85a5){return _0x1d85a5;});}return null;};}function removeEntity(_0x4bff9c,_0x5eeecc){return function(_0x1824ee){if(_0x1824ee){return _0x1824ee[_0x7900('0x24')]()[_0x7900('0x23')](function(){_0x4bff9c['status'](0xcc)[_0x7900('0x25')]();});}};}function handleEntityNotFound(_0x4f4113,_0x186c84){return function(_0x4ea5a2){if(!_0x4ea5a2){_0x4f4113[_0x7900('0x19')](0x194);}return _0x4ea5a2;};}function handleError(_0x277d08,_0x47fc5c){_0x47fc5c=_0x47fc5c||0x1f4;return function(_0x590321){logger['error'](_0x590321[_0x7900('0x26')]);if(_0x590321[_0x7900('0x27')]){delete _0x590321[_0x7900('0x27')];}_0x277d08[_0x7900('0x1a')](_0x47fc5c)[_0x7900('0x28')](_0x590321);};}exports[_0x7900('0x29')]=function(_0x832e88,_0x3d584f){var _0x5a9b99={'raw':![],'where':{'id':_0x832e88[_0x7900('0x2a')]['id']}},_0x4a8a77={};_0x4a8a77[_0x7900('0x2b')]=_['keys'](db[_0x7900('0x2c')][_0x7900('0x2d')]);_0x4a8a77['query']=_[_0x7900('0x2e')](_0x832e88[_0x7900('0x2f')]);_0x4a8a77['filters']=_[_0x7900('0x30')](_0x4a8a77[_0x7900('0x2b')],_0x4a8a77['query']);_0x5a9b99[_0x7900('0x31')]=_[_0x7900('0x30')](_0x4a8a77[_0x7900('0x2b')],qs['fields'](_0x832e88[_0x7900('0x2f')][_0x7900('0x32')]));_0x5a9b99['attributes']=_0x5a9b99[_0x7900('0x31')][_0x7900('0x33')]?_0x5a9b99[_0x7900('0x31')]:_0x4a8a77['model'];if(_0x832e88[_0x7900('0x2f')]['includeAll']){_0x5a9b99[_0x7900('0x34')]=[{'all':!![]}];}_0x5a9b99=_[_0x7900('0x35')]({},_0x5a9b99,_0x832e88['options']);return db[_0x7900('0x2c')][_0x7900('0x36')](_0x5a9b99)['then'](handleEntityNotFound(_0x3d584f,null))[_0x7900('0x23')](respondWithResult(_0x3d584f,null))[_0x7900('0x37')](handleError(_0x3d584f,null));};exports[_0x7900('0x24')]=function(_0x1fe436,_0x1d484e){return db['DashboardItem'][_0x7900('0x36')]({'where':{'id':_0x1fe436[_0x7900('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1d484e,null))[_0x7900('0x23')](removeEntity(_0x1d484e,null))[_0x7900('0x37')](handleError(_0x1d484e,null));};function widgetAttributes(_0x7e3076){try{switch(_0x7e3076['type']){case'iframe':return[{'name':_0x7900('0x38'),'value':_0x7e3076[_0x7900('0x38')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076[_0x7900('0x39')][0x0]?_0x7e3076[_0x7900('0x39')][0x0][_0x7900('0x3a')]:undefined)||_0x7900('0x3b')}];case _0x7900('0x3c'):return[{'name':_0x7900('0x3d'),'value':_0x7e3076[_0x7900('0x3d')]||(_0x7e3076['attrs']&&_0x7e3076[_0x7900('0x39')][0x0]?_0x7e3076['attrs'][0x0][_0x7900('0x3a')]:undefined)||''}];case _0x7900('0x3e'):return[{'name':_0x7900('0x3f'),'value':_0x7e3076[_0x7900('0x3f')]||(_0x7e3076['attrs']&&_0x7e3076['attrs'][0x0]?_0x7e3076[_0x7900('0x39')][0x0][_0x7900('0x3a')]:undefined)||'HH:mm:ss'},{'name':_0x7900('0x40'),'value':_0x7e3076[_0x7900('0x40')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076[_0x7900('0x39')][0x1]?_0x7e3076[_0x7900('0x39')][0x1][_0x7900('0x3a')]:undefined)||_0x7900('0x41')},{'name':'attrFontSize','value':_0x7e3076[_0x7900('0x42')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076['attrs'][0x2]?_0x7e3076['attrs'][0x2][_0x7900('0x3a')]:undefined)||0xc}];case _0x7900('0x43'):return[{'name':'attrMetric','value':_0x7e3076[_0x7900('0x44')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076[_0x7900('0x39')][0x0]?_0x7e3076[_0x7900('0x39')][0x0]['value']:undefined)||_0x7900('0x45')},{'name':_0x7900('0x46'),'value':_0x7e3076[_0x7900('0x46')]||(_0x7e3076['attrs']&&_0x7e3076['attrs'][0x1]?_0x7e3076['attrs'][0x1][_0x7900('0x3a')]:undefined)||[]},{'name':_0x7900('0x42'),'value':_0x7e3076[_0x7900('0x42')]||(_0x7e3076['attrs']&&_0x7e3076[_0x7900('0x39')][0x2]?_0x7e3076[_0x7900('0x39')][0x2][_0x7900('0x3a')]:undefined)||0x14}];case _0x7900('0x47'):case _0x7900('0x48'):return[{'name':'attrSerie1','value':_0x7e3076[_0x7900('0x49')]||(_0x7e3076['attrs']&&_0x7e3076[_0x7900('0x39')][0x0]?_0x7e3076[_0x7900('0x39')][0x0][_0x7900('0x3a')]:undefined)||_0x7900('0x45')},{'name':'attrSerie2','value':_0x7e3076[_0x7900('0x4a')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076[_0x7900('0x39')][0x1]?_0x7e3076[_0x7900('0x39')][0x1][_0x7900('0x3a')]:undefined)||null},{'name':_0x7900('0x4b'),'value':_0x7e3076[_0x7900('0x4b')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076['attrs'][0x2]?_0x7e3076[_0x7900('0x39')][0x2][_0x7900('0x3a')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x7e3076[_0x7900('0x46')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076[_0x7900('0x39')][0x3]?_0x7e3076[_0x7900('0x39')][0x3]['value']:undefined)||[]}];case _0x7900('0x4c'):return[{'name':_0x7900('0x4d'),'type':_0x7e3076[_0x7900('0x4e')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076[_0x7900('0x39')][0x0]?_0x7e3076[_0x7900('0x39')][0x0]['type']:undefined)||null,'value':_0x7e3076[_0x7900('0x4d')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076[_0x7900('0x39')][0x0]?_0x7e3076[_0x7900('0x39')][0x0][_0x7900('0x3a')]:undefined)||null},{'name':_0x7900('0x4f'),'value':_0x7e3076[_0x7900('0x4f')]||(_0x7e3076[_0x7900('0x39')]&&_0x7e3076['attrs'][0x1]?_0x7e3076['attrs'][0x1][_0x7900('0x3a')]:undefined)||0x0}];default:return[];}}catch(_0x46a899){logger['error'](_0x7900('0x50'),JSON[_0x7900('0x51')](_0x46a899));return[];}}exports[_0x7900('0x52')]=function(_0x3b6f52,_0x5d0832){if(_0x3b6f52['body']){_0x3b6f52[_0x7900('0x53')]['attrs']=widgetAttributes(_0x3b6f52['body']);}return db[_0x7900('0x2c')][_0x7900('0x52')](_0x3b6f52[_0x7900('0x53')],{})[_0x7900('0x23')](respondWithResult(_0x5d0832,0xc9))['catch'](handleError(_0x5d0832,null));};exports[_0x7900('0x22')]=function(_0x44c725,_0x540255){if(_0x44c725[_0x7900('0x53')]['id']){delete _0x44c725[_0x7900('0x53')]['id'];}_0x44c725[_0x7900('0x53')][_0x7900('0x39')]=widgetAttributes(_0x44c725['body']);return db[_0x7900('0x2c')][_0x7900('0x36')]({'where':{'id':_0x44c725[_0x7900('0x2a')]['id']}})[_0x7900('0x23')](handleEntityNotFound(_0x540255,null))[_0x7900('0x23')](saveUpdates(_0x44c725[_0x7900('0x53')],null))[_0x7900('0x23')](respondWithResult(_0x540255,null))[_0x7900('0x37')](handleError(_0x540255,null));};
\ No newline at end of file
+var _0x6810=['value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','update','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','set','Content-Range','then','destroy','error','stack','name','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','type','attrUrl','attrs'];(function(_0x1f707f,_0x5585a6){var _0x5e7735=function(_0x52e9e1){while(--_0x52e9e1){_0x1f707f['push'](_0x1f707f['shift']());}};_0x5e7735(++_0x5585a6);}(_0x6810,0xbc));var _0x0681=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6810[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x0681('0x0'));var emlformat=require(_0x0681('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0681('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0681('0x3'));var Mustache=require(_0x0681('0x4'));var util=require(_0x0681('0x5'));var path=require(_0x0681('0x6'));var sox=require(_0x0681('0x7'));var csv=require(_0x0681('0x8'));var ejs=require(_0x0681('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0681('0xa'));var crypto=require('crypto');var jsforce=require(_0x0681('0xb'));var deskjs=require(_0x0681('0xc'));var toCsv=require(_0x0681('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0681('0xd'));var as=require(_0x0681('0xe'));var hardwareService=require(_0x0681('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x0681('0x10'));var config=require('../../config/environment');var db=require(_0x0681('0x11'))['db'];config[_0x0681('0x12')]=_[_0x0681('0x13')](config['redis'],{'host':_0x0681('0x14'),'port':0x18eb});var socket=require(_0x0681('0x15'))(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x3488d2,_0x3eb132){_0x3eb132=_0x3eb132||0xcc;return function(_0x213442){if(_0x213442){return _0x3488d2[_0x0681('0x16')](_0x3eb132);}return _0x3488d2[_0x0681('0x17')](_0x3eb132)[_0x0681('0x18')]();};}function respondWithResult(_0x11361f,_0xeb2ac4){_0xeb2ac4=_0xeb2ac4||0xc8;return function(_0xef2610){if(_0xef2610){return _0x11361f[_0x0681('0x17')](_0xeb2ac4)[_0x0681('0x19')](_0xef2610);}};}function respondWithFilteredResult(_0x591b4e,_0x57a9ca){return function(_0x2d29a3){if(_0x2d29a3){var _0xd67657=_0x2d29a3[_0x0681('0x1a')],_0x587ac3=_0x57a9ca[_0x0681('0x1b')],_0x3c5a33=_0x57a9ca[_0x0681('0x1b')]+_0x57a9ca[_0x0681('0x1c')],_0x307061;if(_0x3c5a33>=_0xd67657){_0x3c5a33=_0xd67657;_0x307061=0xc8;}else{_0x307061=0xce;}_0x591b4e[_0x0681('0x17')](_0x307061);return _0x591b4e[_0x0681('0x1d')](_0x0681('0x1e'),_0x587ac3+'-'+_0x3c5a33+'/'+_0xd67657)[_0x0681('0x19')](_0x2d29a3);}return null;};}function patchUpdates(_0x8148f8){return function(_0x1d1878){try{jsonpatch['apply'](_0x1d1878,_0x8148f8,!![]);}catch(_0x9893da){return BPromise['reject'](_0x9893da);}return _0x1d1878['save']();};}function saveUpdates(_0x277f77,_0x16b1ca){return function(_0x1f4591){if(_0x1f4591){return _0x1f4591['update'](_0x277f77)[_0x0681('0x1f')](function(_0x49dbf5){return _0x49dbf5;});}return null;};}function removeEntity(_0x3a608d,_0x1cda77){return function(_0x349044){if(_0x349044){return _0x349044[_0x0681('0x20')]()['then'](function(){_0x3a608d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x380a83,_0x2e00cb){return function(_0x142743){if(!_0x142743){_0x380a83[_0x0681('0x16')](0x194);}return _0x142743;};}function handleError(_0x3fc82d,_0x1a5b7a){_0x1a5b7a=_0x1a5b7a||0x1f4;return function(_0x5ade29){logger[_0x0681('0x21')](_0x5ade29[_0x0681('0x22')]);if(_0x5ade29[_0x0681('0x23')]){delete _0x5ade29[_0x0681('0x23')];}_0x3fc82d[_0x0681('0x17')](_0x1a5b7a)['send'](_0x5ade29);};}exports['show']=function(_0x19f099,_0x4a240c){var _0x29012c={'raw':![],'where':{'id':_0x19f099[_0x0681('0x24')]['id']}},_0x2510ec={};_0x2510ec[_0x0681('0x25')]=_[_0x0681('0x26')](db[_0x0681('0x27')][_0x0681('0x28')]);_0x2510ec['query']=_[_0x0681('0x26')](_0x19f099[_0x0681('0x29')]);_0x2510ec[_0x0681('0x2a')]=_[_0x0681('0x2b')](_0x2510ec[_0x0681('0x25')],_0x2510ec[_0x0681('0x29')]);_0x29012c[_0x0681('0x2c')]=_[_0x0681('0x2b')](_0x2510ec[_0x0681('0x25')],qs['fields'](_0x19f099[_0x0681('0x29')][_0x0681('0x2d')]));_0x29012c[_0x0681('0x2c')]=_0x29012c[_0x0681('0x2c')][_0x0681('0x2e')]?_0x29012c['attributes']:_0x2510ec[_0x0681('0x25')];if(_0x19f099[_0x0681('0x29')]['includeAll']){_0x29012c[_0x0681('0x2f')]=[{'all':!![]}];}_0x29012c=_[_0x0681('0x30')]({},_0x29012c,_0x19f099[_0x0681('0x31')]);return db[_0x0681('0x27')][_0x0681('0x32')](_0x29012c)['then'](handleEntityNotFound(_0x4a240c,null))[_0x0681('0x1f')](respondWithResult(_0x4a240c,null))[_0x0681('0x33')](handleError(_0x4a240c,null));};exports['destroy']=function(_0x4413af,_0x9393cb){return db[_0x0681('0x27')][_0x0681('0x32')]({'where':{'id':_0x4413af['params']['id']}})['then'](handleEntityNotFound(_0x9393cb,null))[_0x0681('0x1f')](removeEntity(_0x9393cb,null))[_0x0681('0x33')](handleError(_0x9393cb,null));};function widgetAttributes(_0x24af78){try{switch(_0x24af78[_0x0681('0x34')]){case'iframe':return[{'name':_0x0681('0x35'),'value':_0x24af78[_0x0681('0x35')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x0]?_0x24af78['attrs'][0x0][_0x0681('0x37')]:undefined)||_0x0681('0x38')}];case _0x0681('0x39'):return[{'name':_0x0681('0x3a'),'value':_0x24af78[_0x0681('0x3a')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x0]?_0x24af78[_0x0681('0x36')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x0681('0x3b'),'value':_0x24af78[_0x0681('0x3b')]||(_0x24af78['attrs']&&_0x24af78['attrs'][0x0]?_0x24af78['attrs'][0x0][_0x0681('0x37')]:undefined)||_0x0681('0x3c')},{'name':'attrTimezone','value':_0x24af78[_0x0681('0x3d')]||(_0x24af78['attrs']&&_0x24af78[_0x0681('0x36')][0x1]?_0x24af78[_0x0681('0x36')][0x1][_0x0681('0x37')]:undefined)||_0x0681('0x3e')},{'name':_0x0681('0x3f'),'value':_0x24af78[_0x0681('0x3f')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x2]?_0x24af78[_0x0681('0x36')][0x2][_0x0681('0x37')]:undefined)||0xc}];case _0x0681('0x40'):return[{'name':_0x0681('0x41'),'value':_0x24af78[_0x0681('0x41')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x0]?_0x24af78[_0x0681('0x36')][0x0][_0x0681('0x37')]:undefined)||_0x0681('0x42')},{'name':_0x0681('0x43'),'value':_0x24af78[_0x0681('0x43')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x1]?_0x24af78['attrs'][0x1][_0x0681('0x37')]:undefined)||[]},{'name':'attrFontSize','value':_0x24af78[_0x0681('0x3f')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x2]?_0x24af78['attrs'][0x2]['value']:undefined)||0x14}];case _0x0681('0x44'):case'pie-chart':return[{'name':_0x0681('0x45'),'value':_0x24af78[_0x0681('0x45')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x0]?_0x24af78[_0x0681('0x36')][0x0]['value']:undefined)||'total'},{'name':_0x0681('0x46'),'value':_0x24af78[_0x0681('0x46')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x1]?_0x24af78['attrs'][0x1]['value']:undefined)||null},{'name':_0x0681('0x47'),'value':_0x24af78[_0x0681('0x47')]||(_0x24af78['attrs']&&_0x24af78[_0x0681('0x36')][0x2]?_0x24af78[_0x0681('0x36')][0x2][_0x0681('0x37')]:undefined)||null},{'name':_0x0681('0x43'),'value':_0x24af78['attrVoiceQueues']||(_0x24af78[_0x0681('0x36')]&&_0x24af78['attrs'][0x3]?_0x24af78[_0x0681('0x36')][0x3][_0x0681('0x37')]:undefined)||[]}];case _0x0681('0x48'):return[{'name':'attrReport','type':_0x24af78[_0x0681('0x49')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x0]?_0x24af78['attrs'][0x0][_0x0681('0x34')]:undefined)||null,'value':_0x24af78[_0x0681('0x4a')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78[_0x0681('0x36')][0x0]?_0x24af78['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x24af78[_0x0681('0x4b')]||(_0x24af78[_0x0681('0x36')]&&_0x24af78['attrs'][0x1]?_0x24af78[_0x0681('0x36')][0x1][_0x0681('0x37')]:undefined)||0x0}];default:return[];}}catch(_0xfd3e8c){logger['error'](_0x0681('0x4c'),JSON[_0x0681('0x4d')](_0xfd3e8c));return[];}}exports['create']=function(_0x48f88b,_0x1b1529){if(_0x48f88b[_0x0681('0x4e')]){_0x48f88b[_0x0681('0x4e')][_0x0681('0x36')]=widgetAttributes(_0x48f88b[_0x0681('0x4e')]);}return db[_0x0681('0x27')][_0x0681('0x4f')](_0x48f88b['body'],{})[_0x0681('0x1f')](respondWithResult(_0x1b1529,0xc9))['catch'](handleError(_0x1b1529,null));};exports[_0x0681('0x50')]=function(_0x552678,_0xb026b0){if(_0x552678['body']['id']){delete _0x552678[_0x0681('0x4e')]['id'];}_0x552678[_0x0681('0x4e')][_0x0681('0x36')]=widgetAttributes(_0x552678[_0x0681('0x4e')]);return db['DashboardItem'][_0x0681('0x32')]({'where':{'id':_0x552678[_0x0681('0x24')]['id']}})[_0x0681('0x1f')](handleEntityNotFound(_0xb026b0,null))[_0x0681('0x1f')](saveUpdates(_0x552678['body'],null))[_0x0681('0x1f')](respondWithResult(_0xb026b0,null))[_0x0681('0x33')](handleError(_0xb026b0,null));};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js
index c006e7a..923956b 100644
--- a/server/api/dashboardItem/dashboardItem.events.js
+++ b/server/api/dashboardItem/dashboardItem.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3b0d=['hasOwnProperty','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x370f67,_0x1495aa){var _0x4506af=function(_0x4c1b67){while(--_0x4c1b67){_0x370f67['push'](_0x370f67['shift']());}};_0x4506af(++_0x1495aa);}(_0x3b0d,0x1db));var _0xd3b0=function(_0x4c941f,_0x13e01d){_0x4c941f=_0x4c941f-0x0;var _0x59f360=_0x3b0d[_0x4c941f];return _0x59f360;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xd3b0('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd3b0('0x1')](0x0);var events={'afterCreate':_0xd3b0('0x2'),'afterUpdate':'update','afterDestroy':_0xd3b0('0x3')};function emitEvent(_0x4af7b8){return function(_0x6ca1da,_0x3d07ea,_0x2a78d4){DashboardItemEvents[_0xd3b0('0x4')](_0x4af7b8+':'+_0x6ca1da['id'],_0x6ca1da);DashboardItemEvents[_0xd3b0('0x4')](_0x4af7b8,_0x6ca1da);_0x2a78d4(null);};}for(var e in events){if(events[_0xd3b0('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0xedc4=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','hasOwnProperty','hook','events'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xedc4,0x13a));var _0x4edc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xedc4[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0x4edc('0x0'));var DashboardItem=require(_0x4edc('0x1'))['db'][_0x4edc('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4edc('0x3')](0x0);var events={'afterCreate':_0x4edc('0x4'),'afterUpdate':_0x4edc('0x5'),'afterDestroy':_0x4edc('0x6')};function emitEvent(_0x43eeb2){return function(_0x697d02,_0x165edf,_0x336bf2){DashboardItemEvents['emit'](_0x43eeb2+':'+_0x697d02['id'],_0x697d02);DashboardItemEvents['emit'](_0x43eeb2,_0x697d02);_0x336bf2(null);};}for(var e in events){if(events[_0x4edc('0x7')](e)){var event=events[e];DashboardItem[_0x4edc('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js
index e22ceb3..9b410ce 100644
--- a/server/api/dashboardItem/dashboardItem.model.js
+++ b/server/api/dashboardItem/dashboardItem.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f64=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','define','dashboard_items'];(function(_0x1c31d0,_0x26ccda){var _0x28a4a2=function(_0x1d9510){while(--_0x1d9510){_0x1c31d0['push'](_0x1c31d0['shift']());}};_0x28a4a2(++_0x26ccda);}(_0x1f64,0x13f));var _0x41f6=function(_0x33f7f7,_0x117932){_0x33f7f7=_0x33f7f7-0x0;var _0x2d4bb1=_0x1f64[_0x33f7f7];return _0x2d4bb1;};'use strict';var _=require(_0x41f6('0x0'));var util=require(_0x41f6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x41f6('0x2'));var BPromise=require(_0x41f6('0x3'));var rp=require(_0x41f6('0x4'));var fs=require('fs');var path=require(_0x41f6('0x5'));var rimraf=require(_0x41f6('0x6'));var config=require(_0x41f6('0x7'));var attributes=require(_0x41f6('0x8'));module['exports']=function(_0x272d50,_0x187237){return _0x272d50[_0x41f6('0x9')]('DashboardItem',attributes,{'tableName':_0x41f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3f2=['dashboard_items','lodash','api','request-promise','path','rimraf','define','DashboardItem'];(function(_0x35e9f8,_0x13aeb7){var _0x298e12=function(_0x54db18){while(--_0x54db18){_0x35e9f8['push'](_0x35e9f8['shift']());}};_0x298e12(++_0x13aeb7);}(_0xc3f2,0x139));var _0x2c3f=function(_0xd5b35e,_0x4c8bee){_0xd5b35e=_0xd5b35e-0x0;var _0xdc9835=_0xc3f2[_0xd5b35e];return _0xdc9835;};'use strict';var _=require(_0x2c3f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2c3f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2c3f('0x2'));var fs=require('fs');var path=require(_0x2c3f('0x3'));var rimraf=require(_0x2c3f('0x4'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x10508d,_0x12f650){return _0x10508d[_0x2c3f('0x5')](_0x2c3f('0x6'),attributes,{'tableName':_0x2c3f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js
index 350d11c..655e3e5 100644
--- a/server/api/dashboardItem/dashboardItem.rpc.js
+++ b/server/api/dashboardItem/dashboardItem.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc59=['rpc','jayson/promise','client','http','defaults','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x38fbeb,_0x213cbd){var _0x271378=function(_0x51aac9){while(--_0x51aac9){_0x38fbeb['push'](_0x38fbeb['shift']());}};_0x271378(++_0x213cbd);}(_0xfc59,0x1a4));var _0x9fc5=function(_0x3409a7,_0x8dfb01){_0x3409a7=_0x3409a7-0x0;var _0x23d800=_0xfc59[_0x3409a7];return _0x23d800;};'use strict';var _=require('lodash');var util=require(_0x9fc5('0x0'));var moment=require(_0x9fc5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fc5('0x2'));var db=require(_0x9fc5('0x3'))['db'];var utils=require(_0x9fc5('0x4'));var logger=require('../../config/logger')(_0x9fc5('0x5'));var config=require('../../config/environment');var jayson=require(_0x9fc5('0x6'));var client=jayson[_0x9fc5('0x7')][_0x9fc5('0x8')]({'port':0x232a});config['redis']=_[_0x9fc5('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9fc5('0xa'))[_0x9fc5('0xb')](socket);function respondWithRpcPromise(_0x48cff4,_0x3027d8,_0x3e92e9){return new BPromise(function(_0x116dc8,_0x19e4b4){return client[_0x9fc5('0xc')](_0x48cff4,_0x3e92e9)[_0x9fc5('0xd')](function(_0x556367){logger[_0x9fc5('0xe')](_0x9fc5('0xf'),_0x3027d8,_0x9fc5('0x10'));logger[_0x9fc5('0x11')](_0x9fc5('0x12'),_0x3027d8,'request\x20sent',JSON[_0x9fc5('0x13')](_0x556367));if(_0x556367['error']){if(_0x556367[_0x9fc5('0x14')][_0x9fc5('0x15')]===0x1f4){logger['error'](_0x9fc5('0xf'),_0x3027d8,_0x556367[_0x9fc5('0x14')][_0x9fc5('0x16')]);return _0x19e4b4(_0x556367['error'][_0x9fc5('0x16')]);}logger[_0x9fc5('0x14')](_0x9fc5('0xf'),_0x3027d8,_0x556367[_0x9fc5('0x14')][_0x9fc5('0x16')]);return _0x116dc8(_0x556367['error'][_0x9fc5('0x16')]);}else{logger[_0x9fc5('0xe')](_0x9fc5('0xf'),_0x3027d8,_0x9fc5('0x10'));_0x116dc8(_0x556367[_0x9fc5('0x17')][_0x9fc5('0x16')]);}})[_0x9fc5('0x18')](function(_0x5428ac){logger[_0x9fc5('0x14')](_0x9fc5('0xf'),_0x3027d8,_0x5428ac);_0x19e4b4(_0x5428ac);});});}
\ No newline at end of file
+var _0x4021=['message','request\x20sent','result','lodash','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4021,0x12e));var _0x1402=function(_0xab2afb,_0x546bfb){_0xab2afb=_0xab2afb-0x0;var _0x25262b=_0x4021[_0xab2afb];return _0x25262b;};'use strict';var _=require(_0x1402('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1402('0x1'));var rs=require(_0x1402('0x2'));var fs=require('fs');var Redis=require(_0x1402('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1402('0x4'))('rpc');var config=require(_0x1402('0x5'));var jayson=require(_0x1402('0x6'));var client=jayson[_0x1402('0x7')][_0x1402('0x8')]({'port':0x232a});config[_0x1402('0x9')]=_['defaults'](config['redis'],{'host':_0x1402('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1402('0x9')]));require('./dashboardItem.socket')[_0x1402('0xb')](socket);function respondWithRpcPromise(_0x16f17f,_0x2f9e50,_0x543e75){return new BPromise(function(_0x3c039f,_0xd51d8){return client[_0x1402('0xc')](_0x16f17f,_0x543e75)[_0x1402('0xd')](function(_0x7a9171){logger[_0x1402('0xe')](_0x1402('0xf'),_0x2f9e50,'request\x20sent');logger[_0x1402('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x2f9e50,'request\x20sent',JSON[_0x1402('0x11')](_0x7a9171));if(_0x7a9171[_0x1402('0x12')]){if(_0x7a9171['error'][_0x1402('0x13')]===0x1f4){logger[_0x1402('0x12')](_0x1402('0xf'),_0x2f9e50,_0x7a9171['error'][_0x1402('0x14')]);return _0xd51d8(_0x7a9171[_0x1402('0x12')]['message']);}logger[_0x1402('0x12')](_0x1402('0xf'),_0x2f9e50,_0x7a9171['error'][_0x1402('0x14')]);return _0x3c039f(_0x7a9171[_0x1402('0x12')][_0x1402('0x14')]);}else{logger[_0x1402('0xe')](_0x1402('0xf'),_0x2f9e50,_0x1402('0x15'));_0x3c039f(_0x7a9171[_0x1402('0x16')][_0x1402('0x14')]);}})['catch'](function(_0x41dd96){logger[_0x1402('0x12')](_0x1402('0xf'),_0x2f9e50,_0x41dd96);_0xd51d8(_0x41dd96);});});}
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js
index b72d5e5..c788d4d 100644
--- a/server/api/dashboardItem/dashboardItem.socket.js
+++ b/server/api/dashboardItem/dashboardItem.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9552=['removeListener','register','dashboardItem:','./dashboardItem.events','save','remove','update'];(function(_0x1c8697,_0x47bb41){var _0x289968=function(_0x40c835){while(--_0x40c835){_0x1c8697['push'](_0x1c8697['shift']());}};_0x289968(++_0x47bb41);}(_0x9552,0x161));var _0x2955=function(_0x3778c2,_0x420d89){_0x3778c2=_0x3778c2-0x0;var _0x582181=_0x9552[_0x3778c2];return _0x582181;};'use strict';var DashboardItemEvents=require(_0x2955('0x0'));var events=[_0x2955('0x1'),_0x2955('0x2'),_0x2955('0x3')];function createListener(_0x49439a,_0x21c4b0){return function(_0x1456f8){_0x21c4b0['emit'](_0x49439a,_0x1456f8);};}function removeListener(_0x244c7c,_0x35579d){return function(){DashboardItemEvents[_0x2955('0x4')](_0x244c7c,_0x35579d);};}exports[_0x2955('0x5')]=function(_0x5924bb){for(var _0x1cd672=0x0,_0x4a5f83=events['length'];_0x1cd672<_0x4a5f83;_0x1cd672++){var _0x2dc5d4=events[_0x1cd672];var _0x2f520d=createListener(_0x2955('0x6')+_0x2dc5d4,_0x5924bb);DashboardItemEvents['on'](_0x2dc5d4,_0x2f520d);}};
\ No newline at end of file
+var _0x0ed3=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','register','length'];(function(_0x3c6509,_0x267536){var _0x1e4f0d=function(_0x13393f){while(--_0x13393f){_0x3c6509['push'](_0x3c6509['shift']());}};_0x1e4f0d(++_0x267536);}(_0x0ed3,0xd1));var _0x30ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ed3[_0x20a584];return _0x4b41a8;};'use strict';var DashboardItemEvents=require(_0x30ed('0x0'));var events=[_0x30ed('0x1'),_0x30ed('0x2'),_0x30ed('0x3')];function createListener(_0x3e750,_0x3c78c7){return function(_0x6a619d){_0x3c78c7[_0x30ed('0x4')](_0x3e750,_0x6a619d);};}function removeListener(_0x5d7322,_0x4ed077){return function(){DashboardItemEvents['removeListener'](_0x5d7322,_0x4ed077);};}exports[_0x30ed('0x5')]=function(_0x405de5){for(var _0x57bc68=0x0,_0x3f9089=events[_0x30ed('0x6')];_0x57bc68<_0x3f9089;_0x57bc68++){var _0x531cae=events[_0x57bc68];var _0x86e46b=createListener(_0x30ed('0x7')+_0x531cae,_0x405de5);DashboardItemEvents['on'](_0x531cae,_0x86e46b);}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js
index 4d57c7e..aaeb8ed 100644
--- a/server/api/dashboardItem/index.js
+++ b/server/api/dashboardItem/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2ca=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','put','delete'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x4e2861,_0x199be0){_0x4e2861=_0x4e2861-0x0;var _0x2265e3=_0xf2ca[_0x4e2861];return _0x2265e3;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var auth=require(_0xaf2c('0x5'));var interaction=require(_0xaf2c('0x6'));var config=require(_0xaf2c('0x7'));var controller=require(_0xaf2c('0x8'));router['get'](_0xaf2c('0x9'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0xc')]('/',auth['isAuthenticated'](),controller[_0xaf2c('0xd')]);router[_0xaf2c('0xe')]('/:id',auth[_0xaf2c('0xa')](),controller['update']);router[_0xaf2c('0xf')]('/:id',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x10')]);module[_0xaf2c('0x11')]=router;
\ No newline at end of file
+var _0x4975=['/:id','show','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x4975,0x86));var _0x5497=function(_0x1e2b08,_0x43f46e){_0x1e2b08=_0x1e2b08-0x0;var _0x173321=_0x4975[_0x1e2b08];return _0x173321;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var auth=require(_0x5497('0x5'));var interaction=require(_0x5497('0x6'));var config=require(_0x5497('0x7'));var controller=require(_0x5497('0x8'));router[_0x5497('0x9')](_0x5497('0xa'),auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['post']('/',auth[_0x5497('0xc')](),controller[_0x5497('0xd')]);router[_0x5497('0xe')]('/:id',auth[_0x5497('0xc')](),controller['update']);router[_0x5497('0xf')](_0x5497('0xa'),auth[_0x5497('0xc')](),controller[_0x5497('0x10')]);module[_0x5497('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js
index 4be231a..9a44f80 100644
--- a/server/api/disposition/disposition.attributes.js
+++ b/server/api/disposition/disposition.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf46d=['STRING','sequelize','exports'];(function(_0x2e4bdf,_0x3a24be){var _0x57ccc2=function(_0xc09468){while(--_0xc09468){_0x2e4bdf['push'](_0x2e4bdf['shift']());}};_0x57ccc2(++_0x3a24be);}(_0xf46d,0x1de));var _0xdf46=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xf46d[_0x80d733];return _0x435868;};'use strict';var Sequelize=require(_0xdf46('0x0'));module[_0xdf46('0x1')]={'name':{'type':Sequelize[_0xdf46('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x56d0=['sequelize','STRING'];(function(_0x5f43b3,_0x3e64d7){var _0xbc3960=function(_0x4efdf8){while(--_0x4efdf8){_0x5f43b3['push'](_0x5f43b3['shift']());}};_0xbc3960(++_0x3e64d7);}(_0x56d0,0x1f2));var _0x056d=function(_0x16e0c8,_0x4861eb){_0x16e0c8=_0x16e0c8-0x0;var _0xe4b5af=_0x56d0[_0x16e0c8];return _0xe4b5af;};'use strict';var Sequelize=require(_0x056d('0x0'));module['exports']={'name':{'type':Sequelize[_0x056d('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js
index 07b3c45..941aaa6 100644
--- a/server/api/disposition/disposition.controller.js
+++ b/server/api/disposition/disposition.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa291=['ejs','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv'];(function(_0x528f85,_0x377582){var _0x3511c3=function(_0x35e84b){while(--_0x35e84b){_0x528f85['push'](_0x528f85['shift']());}};_0x3511c3(++_0x377582);}(_0xa291,0xe1));var _0x1a29=function(_0x466e57,_0x21b819){_0x466e57=_0x466e57-0x0;var _0x34df42=_0xa291[_0x466e57];return _0x34df42;};'use strict';var pdf=require(_0x1a29('0x0'));var emlformat=require(_0x1a29('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1a29('0x2'));var jsonpatch=require(_0x1a29('0x3'));var rp=require('request-promise');var moment=require(_0x1a29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a29('0x5'));var util=require(_0x1a29('0x6'));var path=require('path');var sox=require(_0x1a29('0x7'));var csv=require(_0x1a29('0x8'));var ejs=require(_0x1a29('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1a29('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1a29('0xb'));var toCsv=require(_0x1a29('0x8'));var querystring=require(_0x1a29('0xc'));var Papa=require('papaparse');var Redis=require(_0x1a29('0xd'));var authService=require(_0x1a29('0xe'));var qs=require(_0x1a29('0xf'));var as=require(_0x1a29('0x10'));var hardwareService=require(_0x1a29('0x11'));var logger=require(_0x1a29('0x12'))(_0x1a29('0x13'));var utils=require('../../config/utils');var config=require(_0x1a29('0x14'));var db=require(_0x1a29('0x15'))['db'];function respondWithStatusCode(_0x5165de,_0x4e4c55){_0x4e4c55=_0x4e4c55||0xcc;return function(_0x57a74b){if(_0x57a74b){return _0x5165de[_0x1a29('0x16')](_0x4e4c55);}return _0x5165de[_0x1a29('0x17')](_0x4e4c55)['end']();};}function respondWithResult(_0x37b9af,_0x1d599b){_0x1d599b=_0x1d599b||0xc8;return function(_0x49372f){if(_0x49372f){return _0x37b9af[_0x1a29('0x17')](_0x1d599b)[_0x1a29('0x18')](_0x49372f);}};}function respondWithFilteredResult(_0x504d3b,_0x3f79ed){return function(_0x1c3b1b){if(_0x1c3b1b){var _0x148fc3=_0x1c3b1b[_0x1a29('0x19')],_0x4e7d3a=_0x3f79ed['offset'],_0x5a2034=_0x3f79ed[_0x1a29('0x1a')]+_0x3f79ed[_0x1a29('0x1b')],_0x43eae9;if(_0x5a2034>=_0x148fc3){_0x5a2034=_0x148fc3;_0x43eae9=0xc8;}else{_0x43eae9=0xce;}_0x504d3b['status'](_0x43eae9);return _0x504d3b['set']('Content-Range',_0x4e7d3a+'-'+_0x5a2034+'/'+_0x148fc3)[_0x1a29('0x18')](_0x1c3b1b);}return null;};}function patchUpdates(_0x29bdee){return function(_0x3cf2dd){try{jsonpatch[_0x1a29('0x1c')](_0x3cf2dd,_0x29bdee,!![]);}catch(_0x1a8363){return BPromise['reject'](_0x1a8363);}return _0x3cf2dd['save']();};}function saveUpdates(_0x37b8ae,_0x16dc2e){return function(_0x74eedf){if(_0x74eedf){return _0x74eedf['update'](_0x37b8ae)['then'](function(_0x220314){return _0x220314;});}return null;};}function removeEntity(_0x198950,_0x35b9f7){return function(_0x11fe3a){if(_0x11fe3a){return _0x11fe3a[_0x1a29('0x1d')]()[_0x1a29('0x1e')](function(){var _0x429ede=_0x11fe3a[_0x1a29('0x1f')]({'plain':!![]});var _0x1cb3dc='Dispositions';return db[_0x1a29('0x20')][_0x1a29('0x1d')]({'where':{'type':_0x1cb3dc,'resourceId':_0x429ede['id']}})[_0x1a29('0x1e')](function(){return _0x11fe3a;});})['then'](function(){_0x198950['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b4f6,_0x3d532e){return function(_0x37be31){if(!_0x37be31){_0x5b4f6[_0x1a29('0x16')](0x194);}return _0x37be31;};}function handleError(_0x4d68c4,_0x19c4ef){_0x19c4ef=_0x19c4ef||0x1f4;return function(_0x3e4f5d){logger[_0x1a29('0x21')](_0x3e4f5d[_0x1a29('0x22')]);if(_0x3e4f5d[_0x1a29('0x23')]){delete _0x3e4f5d[_0x1a29('0x23')];}_0x4d68c4[_0x1a29('0x17')](_0x19c4ef)[_0x1a29('0x24')](_0x3e4f5d);};}exports[_0x1a29('0x25')]=function(_0x474bda,_0xae7bee){var _0x3739cb={},_0x72cdcf={},_0x888fa2={'count':0x0,'rows':[]};var _0x268fe7=_[_0x1a29('0x26')](db[_0x1a29('0x27')][_0x1a29('0x28')],function(_0x2b7ded){return{'name':_0x2b7ded[_0x1a29('0x29')],'type':_0x2b7ded[_0x1a29('0x2a')][_0x1a29('0x2b')]};});_0x72cdcf[_0x1a29('0x2c')]=_[_0x1a29('0x26')](_0x268fe7,_0x1a29('0x23'));_0x72cdcf['query']=_['keys'](_0x474bda[_0x1a29('0x2d')]);_0x72cdcf[_0x1a29('0x2e')]=_[_0x1a29('0x2f')](_0x72cdcf[_0x1a29('0x2c')],_0x72cdcf[_0x1a29('0x2d')]);_0x3739cb['attributes']=_[_0x1a29('0x2f')](_0x72cdcf[_0x1a29('0x2c')],qs[_0x1a29('0x30')](_0x474bda[_0x1a29('0x2d')][_0x1a29('0x30')]));_0x3739cb[_0x1a29('0x31')]=_0x3739cb['attributes'][_0x1a29('0x32')]?_0x3739cb['attributes']:_0x72cdcf[_0x1a29('0x2c')];if(!_0x474bda['query'][_0x1a29('0x33')](_0x1a29('0x34'))){_0x3739cb[_0x1a29('0x1b')]=qs[_0x1a29('0x1b')](_0x474bda[_0x1a29('0x2d')][_0x1a29('0x1b')]);_0x3739cb[_0x1a29('0x1a')]=qs['offset'](_0x474bda[_0x1a29('0x2d')][_0x1a29('0x1a')]);}_0x3739cb[_0x1a29('0x35')]=qs[_0x1a29('0x36')](_0x474bda[_0x1a29('0x2d')][_0x1a29('0x36')]);_0x3739cb[_0x1a29('0x37')]=qs[_0x1a29('0x2e')](_['pick'](_0x474bda[_0x1a29('0x2d')],_0x72cdcf[_0x1a29('0x2e')]),_0x268fe7);if(_0x474bda['query'][_0x1a29('0x38')]){_0x3739cb[_0x1a29('0x37')]=_['merge'](_0x3739cb[_0x1a29('0x37')],{'$or':_[_0x1a29('0x26')](_0x268fe7,function(_0x21a044){if(_0x21a044[_0x1a29('0x2a')]!==_0x1a29('0x39')){var _0xed5927={};_0xed5927[_0x21a044[_0x1a29('0x23')]]={'$like':'%'+_0x474bda[_0x1a29('0x2d')]['filter']+'%'};return _0xed5927;}})});}_0x3739cb=_[_0x1a29('0x3a')]({},_0x3739cb,_0x474bda[_0x1a29('0x3b')]);var _0x58cfb4={'where':_0x3739cb[_0x1a29('0x37')]};return db[_0x1a29('0x27')][_0x1a29('0x19')](_0x58cfb4)[_0x1a29('0x1e')](function(_0x55237e){_0x888fa2[_0x1a29('0x19')]=_0x55237e;if(_0x474bda[_0x1a29('0x2d')][_0x1a29('0x3c')]){_0x3739cb['include']=[{'all':!![]}];}return db[_0x1a29('0x27')][_0x1a29('0x3d')](_0x3739cb);})['then'](function(_0x7bfbfe){_0x888fa2['rows']=_0x7bfbfe;return _0x888fa2;})[_0x1a29('0x1e')](respondWithFilteredResult(_0xae7bee,_0x3739cb))[_0x1a29('0x3e')](handleError(_0xae7bee,null));};exports[_0x1a29('0x3f')]=function(_0x336ed2,_0x59a6d3){var _0x2172aa={'raw':!![],'where':{'id':_0x336ed2[_0x1a29('0x40')]['id']}},_0x10a8da={};_0x10a8da[_0x1a29('0x2c')]=_['keys'](db[_0x1a29('0x27')][_0x1a29('0x28')]);_0x10a8da[_0x1a29('0x2d')]=_['keys'](_0x336ed2[_0x1a29('0x2d')]);_0x10a8da[_0x1a29('0x2e')]=_[_0x1a29('0x2f')](_0x10a8da['model'],_0x10a8da[_0x1a29('0x2d')]);_0x2172aa[_0x1a29('0x31')]=_[_0x1a29('0x2f')](_0x10a8da[_0x1a29('0x2c')],qs[_0x1a29('0x30')](_0x336ed2['query'][_0x1a29('0x30')]));_0x2172aa[_0x1a29('0x31')]=_0x2172aa['attributes'][_0x1a29('0x32')]?_0x2172aa[_0x1a29('0x31')]:_0x10a8da[_0x1a29('0x2c')];if(_0x336ed2[_0x1a29('0x2d')][_0x1a29('0x3c')]){_0x2172aa[_0x1a29('0x41')]=[{'all':!![]}];}_0x2172aa=_[_0x1a29('0x3a')]({},_0x2172aa,_0x336ed2['options']);return db[_0x1a29('0x27')][_0x1a29('0x42')](_0x2172aa)[_0x1a29('0x1e')](handleEntityNotFound(_0x59a6d3,null))['then'](respondWithResult(_0x59a6d3,null))[_0x1a29('0x3e')](handleError(_0x59a6d3,null));};exports[_0x1a29('0x43')]=function(_0x2c4e23,_0x17b16d){return db[_0x1a29('0x27')][_0x1a29('0x43')](_0x2c4e23[_0x1a29('0x44')],{})['then'](function(_0x49aa1e){var _0x241a74=_0x2c4e23[_0x1a29('0x45')][_0x1a29('0x1f')]({'plain':!![]});if(!_0x241a74)throw new Error(_0x1a29('0x46'));if(_0x241a74[_0x1a29('0x47')]===_0x1a29('0x45')){var _0x4c9282=_0x49aa1e[_0x1a29('0x1f')]({'plain':!![]});var _0x256fed=_0x1a29('0x48');return db[_0x1a29('0x49')][_0x1a29('0x42')]({'where':{'name':_0x256fed,'userProfileId':_0x241a74[_0x1a29('0x4a')]},'raw':!![]})[_0x1a29('0x1e')](function(_0x48efe9){if(_0x48efe9&&_0x48efe9[_0x1a29('0x4b')]===0x0){return db[_0x1a29('0x20')][_0x1a29('0x43')]({'name':_0x4c9282['name'],'resourceId':_0x4c9282['id'],'type':_0x48efe9['name'],'sectionId':_0x48efe9['id']},{})[_0x1a29('0x1e')](function(){return _0x49aa1e;});}else{return _0x49aa1e;}})[_0x1a29('0x3e')](function(_0x43d0f6){logger[_0x1a29('0x21')](_0x1a29('0x4c'),_0x43d0f6);throw _0x43d0f6;});}return _0x49aa1e;})[_0x1a29('0x1e')](respondWithResult(_0x17b16d,0xc9))[_0x1a29('0x3e')](handleError(_0x17b16d,null));};exports[_0x1a29('0x4d')]=function(_0x5953ff,_0x1dcf6c){if(_0x5953ff[_0x1a29('0x44')]['id']){delete _0x5953ff[_0x1a29('0x44')]['id'];}return db['Disposition']['find']({'where':{'id':_0x5953ff['params']['id']}})['then'](handleEntityNotFound(_0x1dcf6c,null))[_0x1a29('0x1e')](saveUpdates(_0x5953ff[_0x1a29('0x44')],null))[_0x1a29('0x1e')](respondWithResult(_0x1dcf6c,null))['catch'](handleError(_0x1dcf6c,null));};exports[_0x1a29('0x1d')]=function(_0x2dba8a,_0xd69021){return db[_0x1a29('0x27')][_0x1a29('0x42')]({'where':{'id':_0x2dba8a[_0x1a29('0x40')]['id']}})['then'](handleEntityNotFound(_0xd69021,null))[_0x1a29('0x1e')](removeEntity(_0xd69021,null))[_0x1a29('0x3e')](handleError(_0xd69021,null));};
\ No newline at end of file
+var _0x9742=['end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','Dispositions','destroy','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x4be338,_0x390655){var _0x568f6a=function(_0x128636){while(--_0x128636){_0x4be338['push'](_0x4be338['shift']());}};_0x568f6a(++_0x390655);}(_0x9742,0x194));var _0x2974=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9742[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x2974('0x0'));var emlformat=require(_0x2974('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2974('0x2'));var jsonpatch=require(_0x2974('0x3'));var rp=require(_0x2974('0x4'));var moment=require(_0x2974('0x5'));var BPromise=require(_0x2974('0x6'));var Mustache=require(_0x2974('0x7'));var util=require(_0x2974('0x8'));var path=require(_0x2974('0x9'));var sox=require(_0x2974('0xa'));var csv=require(_0x2974('0xb'));var ejs=require(_0x2974('0xc'));var fs=require('fs');var _=require(_0x2974('0xd'));var squel=require(_0x2974('0xe'));var crypto=require(_0x2974('0xf'));var jsforce=require(_0x2974('0x10'));var deskjs=require(_0x2974('0x11'));var toCsv=require(_0x2974('0xb'));var querystring=require(_0x2974('0x12'));var Papa=require(_0x2974('0x13'));var Redis=require(_0x2974('0x14'));var authService=require(_0x2974('0x15'));var qs=require(_0x2974('0x16'));var as=require(_0x2974('0x17'));var hardwareService=require(_0x2974('0x18'));var logger=require(_0x2974('0x19'))(_0x2974('0x1a'));var utils=require(_0x2974('0x1b'));var config=require(_0x2974('0x1c'));var db=require(_0x2974('0x1d'))['db'];function respondWithStatusCode(_0x3f2cc4,_0x2bc935){_0x2bc935=_0x2bc935||0xcc;return function(_0x2edf5e){if(_0x2edf5e){return _0x3f2cc4[_0x2974('0x1e')](_0x2bc935);}return _0x3f2cc4['status'](_0x2bc935)[_0x2974('0x1f')]();};}function respondWithResult(_0x9cd338,_0x4eb680){_0x4eb680=_0x4eb680||0xc8;return function(_0x43557d){if(_0x43557d){return _0x9cd338[_0x2974('0x20')](_0x4eb680)[_0x2974('0x21')](_0x43557d);}};}function respondWithFilteredResult(_0x4f54c2,_0x3dd289){return function(_0x360dae){if(_0x360dae){var _0x58fd97=_0x360dae[_0x2974('0x22')],_0x4c0bd1=_0x3dd289[_0x2974('0x23')],_0x297d31=_0x3dd289['offset']+_0x3dd289[_0x2974('0x24')],_0x3bb6e6;if(_0x297d31>=_0x58fd97){_0x297d31=_0x58fd97;_0x3bb6e6=0xc8;}else{_0x3bb6e6=0xce;}_0x4f54c2[_0x2974('0x20')](_0x3bb6e6);return _0x4f54c2[_0x2974('0x25')](_0x2974('0x26'),_0x4c0bd1+'-'+_0x297d31+'/'+_0x58fd97)[_0x2974('0x21')](_0x360dae);}return null;};}function patchUpdates(_0x2f1eb6){return function(_0x34b7cc){try{jsonpatch['apply'](_0x34b7cc,_0x2f1eb6,!![]);}catch(_0x418f20){return BPromise[_0x2974('0x27')](_0x418f20);}return _0x34b7cc[_0x2974('0x28')]();};}function saveUpdates(_0x2e4154,_0x811a7a){return function(_0x46c9cb){if(_0x46c9cb){return _0x46c9cb[_0x2974('0x29')](_0x2e4154)[_0x2974('0x2a')](function(_0x4038c1){return _0x4038c1;});}return null;};}function removeEntity(_0x40a227,_0x1d86e3){return function(_0x19c761){if(_0x19c761){return _0x19c761['destroy']()[_0x2974('0x2a')](function(){var _0x5106c0=_0x19c761['get']({'plain':!![]});var _0x1f921e=_0x2974('0x2b');return db['UserProfileResource'][_0x2974('0x2c')]({'where':{'type':_0x1f921e,'resourceId':_0x5106c0['id']}})[_0x2974('0x2a')](function(){return _0x19c761;});})[_0x2974('0x2a')](function(){_0x40a227[_0x2974('0x20')](0xcc)[_0x2974('0x1f')]();});}};}function handleEntityNotFound(_0x4004d5,_0x5e55d9){return function(_0x459a54){if(!_0x459a54){_0x4004d5['sendStatus'](0x194);}return _0x459a54;};}function handleError(_0x4c37a4,_0x57bf79){_0x57bf79=_0x57bf79||0x1f4;return function(_0x6e5b00){logger[_0x2974('0x2d')](_0x6e5b00[_0x2974('0x2e')]);if(_0x6e5b00[_0x2974('0x2f')]){delete _0x6e5b00['name'];}_0x4c37a4['status'](_0x57bf79)[_0x2974('0x30')](_0x6e5b00);};}exports[_0x2974('0x31')]=function(_0xf40d5e,_0xb653fb){var _0x55ba91={},_0x41df8e={},_0x42f5dd={'count':0x0,'rows':[]};var _0x2f2c16=_[_0x2974('0x32')](db[_0x2974('0x33')][_0x2974('0x34')],function(_0x942c7a){return{'name':_0x942c7a[_0x2974('0x35')],'type':_0x942c7a[_0x2974('0x36')][_0x2974('0x37')]};});_0x41df8e[_0x2974('0x38')]=_['map'](_0x2f2c16,_0x2974('0x2f'));_0x41df8e[_0x2974('0x39')]=_['keys'](_0xf40d5e['query']);_0x41df8e[_0x2974('0x3a')]=_[_0x2974('0x3b')](_0x41df8e[_0x2974('0x38')],_0x41df8e[_0x2974('0x39')]);_0x55ba91[_0x2974('0x3c')]=_[_0x2974('0x3b')](_0x41df8e[_0x2974('0x38')],qs[_0x2974('0x3d')](_0xf40d5e[_0x2974('0x39')][_0x2974('0x3d')]));_0x55ba91[_0x2974('0x3c')]=_0x55ba91[_0x2974('0x3c')][_0x2974('0x3e')]?_0x55ba91[_0x2974('0x3c')]:_0x41df8e[_0x2974('0x38')];if(!_0xf40d5e[_0x2974('0x39')][_0x2974('0x3f')](_0x2974('0x40'))){_0x55ba91['limit']=qs[_0x2974('0x24')](_0xf40d5e['query'][_0x2974('0x24')]);_0x55ba91[_0x2974('0x23')]=qs[_0x2974('0x23')](_0xf40d5e[_0x2974('0x39')][_0x2974('0x23')]);}_0x55ba91['order']=qs[_0x2974('0x41')](_0xf40d5e[_0x2974('0x39')][_0x2974('0x41')]);_0x55ba91[_0x2974('0x42')]=qs[_0x2974('0x3a')](_[_0x2974('0x43')](_0xf40d5e[_0x2974('0x39')],_0x41df8e[_0x2974('0x3a')]),_0x2f2c16);if(_0xf40d5e[_0x2974('0x39')]['filter']){_0x55ba91[_0x2974('0x42')]=_['merge'](_0x55ba91[_0x2974('0x42')],{'$or':_[_0x2974('0x32')](_0x2f2c16,function(_0x4bccfd){if(_0x4bccfd[_0x2974('0x36')]!==_0x2974('0x44')){var _0x237ba3={};_0x237ba3[_0x4bccfd[_0x2974('0x2f')]]={'$like':'%'+_0xf40d5e['query']['filter']+'%'};return _0x237ba3;}})});}_0x55ba91=_['merge']({},_0x55ba91,_0xf40d5e[_0x2974('0x45')]);var _0x1a5325={'where':_0x55ba91['where']};return db['Disposition'][_0x2974('0x22')](_0x1a5325)[_0x2974('0x2a')](function(_0x6a7667){_0x42f5dd[_0x2974('0x22')]=_0x6a7667;if(_0xf40d5e[_0x2974('0x39')][_0x2974('0x46')]){_0x55ba91[_0x2974('0x47')]=[{'all':!![]}];}return db[_0x2974('0x33')]['findAll'](_0x55ba91);})['then'](function(_0x2c3e87){_0x42f5dd[_0x2974('0x48')]=_0x2c3e87;return _0x42f5dd;})[_0x2974('0x2a')](respondWithFilteredResult(_0xb653fb,_0x55ba91))[_0x2974('0x49')](handleError(_0xb653fb,null));};exports[_0x2974('0x4a')]=function(_0x4aebe9,_0x29b0fa){var _0x34f904={'raw':!![],'where':{'id':_0x4aebe9[_0x2974('0x4b')]['id']}},_0x41ad7b={};_0x41ad7b[_0x2974('0x38')]=_['keys'](db[_0x2974('0x33')]['rawAttributes']);_0x41ad7b[_0x2974('0x39')]=_[_0x2974('0x4c')](_0x4aebe9[_0x2974('0x39')]);_0x41ad7b[_0x2974('0x3a')]=_[_0x2974('0x3b')](_0x41ad7b[_0x2974('0x38')],_0x41ad7b[_0x2974('0x39')]);_0x34f904[_0x2974('0x3c')]=_[_0x2974('0x3b')](_0x41ad7b[_0x2974('0x38')],qs[_0x2974('0x3d')](_0x4aebe9[_0x2974('0x39')]['fields']));_0x34f904[_0x2974('0x3c')]=_0x34f904['attributes']['length']?_0x34f904['attributes']:_0x41ad7b[_0x2974('0x38')];if(_0x4aebe9[_0x2974('0x39')][_0x2974('0x46')]){_0x34f904[_0x2974('0x47')]=[{'all':!![]}];}_0x34f904=_[_0x2974('0x4d')]({},_0x34f904,_0x4aebe9['options']);return db[_0x2974('0x33')][_0x2974('0x4e')](_0x34f904)[_0x2974('0x2a')](handleEntityNotFound(_0x29b0fa,null))[_0x2974('0x2a')](respondWithResult(_0x29b0fa,null))[_0x2974('0x49')](handleError(_0x29b0fa,null));};exports[_0x2974('0x4f')]=function(_0x24232a,_0x5d779d){return db[_0x2974('0x33')]['create'](_0x24232a[_0x2974('0x50')],{})[_0x2974('0x2a')](function(_0x6dc64e){var _0x18667d=_0x24232a[_0x2974('0x51')][_0x2974('0x52')]({'plain':!![]});if(!_0x18667d)throw new Error(_0x2974('0x53'));if(_0x18667d[_0x2974('0x54')]===_0x2974('0x51')){var _0x45b459=_0x6dc64e[_0x2974('0x52')]({'plain':!![]});var _0x2be9c4=_0x2974('0x2b');return db[_0x2974('0x55')][_0x2974('0x4e')]({'where':{'name':_0x2be9c4,'userProfileId':_0x18667d[_0x2974('0x56')]},'raw':!![]})[_0x2974('0x2a')](function(_0x10c582){if(_0x10c582&&_0x10c582['autoAssociation']===0x0){return db['UserProfileResource'][_0x2974('0x4f')]({'name':_0x45b459[_0x2974('0x2f')],'resourceId':_0x45b459['id'],'type':_0x10c582[_0x2974('0x2f')],'sectionId':_0x10c582['id']},{})['then'](function(){return _0x6dc64e;});}else{return _0x6dc64e;}})[_0x2974('0x49')](function(_0x4371df){logger[_0x2974('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4371df);throw _0x4371df;});}return _0x6dc64e;})[_0x2974('0x2a')](respondWithResult(_0x5d779d,0xc9))[_0x2974('0x49')](handleError(_0x5d779d,null));};exports[_0x2974('0x29')]=function(_0x1a4b4f,_0x56e243){if(_0x1a4b4f['body']['id']){delete _0x1a4b4f['body']['id'];}return db[_0x2974('0x33')]['find']({'where':{'id':_0x1a4b4f[_0x2974('0x4b')]['id']}})[_0x2974('0x2a')](handleEntityNotFound(_0x56e243,null))[_0x2974('0x2a')](saveUpdates(_0x1a4b4f[_0x2974('0x50')],null))['then'](respondWithResult(_0x56e243,null))[_0x2974('0x49')](handleError(_0x56e243,null));};exports['destroy']=function(_0x204927,_0x3a841b){return db[_0x2974('0x33')]['find']({'where':{'id':_0x204927[_0x2974('0x4b')]['id']}})[_0x2974('0x2a')](handleEntityNotFound(_0x3a841b,null))[_0x2974('0x2a')](removeEntity(_0x3a841b,null))['catch'](handleError(_0x3a841b,null));};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js
index 7f7ada9..0a6ef3d 100644
--- a/server/api/disposition/disposition.model.js
+++ b/server/api/disposition/disposition.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2315=['WhatsappAccountId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp'];(function(_0x43c1a9,_0x272bfd){var _0x5de5b7=function(_0x132e7b){while(--_0x132e7b){_0x43c1a9['push'](_0x43c1a9['shift']());}};_0x5de5b7(++_0x272bfd);}(_0x2315,0xc7));var _0x5231=function(_0x2d437e,_0x4a72c0){_0x2d437e=_0x2d437e-0x0;var _0x23cb23=_0x2315[_0x2d437e];return _0x23cb23;};'use strict';var _=require(_0x5231('0x0'));var util=require(_0x5231('0x1'));var logger=require(_0x5231('0x2'))('api');var moment=require(_0x5231('0x3'));var BPromise=require('bluebird');var rp=require(_0x5231('0x4'));var fs=require('fs');var path=require(_0x5231('0x5'));var rimraf=require(_0x5231('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x5231('0x7')]=function(_0x223506,_0x482085){return _0x223506['define'](_0x5231('0x8'),attributes,{'tableName':_0x5231('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5231('0xa'),'fields':[_0x5231('0xb'),_0x5231('0xc')]},{'unique':!![],'name':_0x5231('0xd'),'fields':[_0x5231('0xb'),_0x5231('0xe')]},{'unique':!![],'name':'name_mail','fields':['name',_0x5231('0xf')]},{'unique':!![],'name':_0x5231('0x10'),'fields':[_0x5231('0xb'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x5231('0xb'),_0x5231('0x11')]},{'unique':!![],'name':_0x5231('0x12'),'fields':[_0x5231('0xb'),_0x5231('0x13')]},{'unique':!![],'name':_0x5231('0x14'),'fields':[_0x5231('0xb'),_0x5231('0x15')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd313=['rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','ListId','name_chat','name','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x16a44d,_0x5bb797){var _0x396513=function(_0x237ea7){while(--_0x237ea7){_0x16a44d['push'](_0x16a44d['shift']());}};_0x396513(++_0x5bb797);}(_0xd313,0xb1));var _0x3d31=function(_0x24ba7c,_0x47c888){_0x24ba7c=_0x24ba7c-0x0;var _0x14afb4=_0xd313[_0x24ba7c];return _0x14afb4;};'use strict';var _=require(_0x3d31('0x0'));var util=require('util');var logger=require(_0x3d31('0x1'))(_0x3d31('0x2'));var moment=require(_0x3d31('0x3'));var BPromise=require(_0x3d31('0x4'));var rp=require(_0x3d31('0x5'));var fs=require('fs');var path=require(_0x3d31('0x6'));var rimraf=require(_0x3d31('0x7'));var config=require(_0x3d31('0x8'));var attributes=require(_0x3d31('0x9'));module[_0x3d31('0xa')]=function(_0x197b67,_0x12ad86){return _0x197b67['define'](_0x3d31('0xb'),attributes,{'tableName':_0x3d31('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x3d31('0xd')]},{'unique':!![],'name':_0x3d31('0xe'),'fields':[_0x3d31('0xf'),'ChatWebsiteId']},{'unique':!![],'name':_0x3d31('0x10'),'fields':[_0x3d31('0xf'),_0x3d31('0x11')]},{'unique':!![],'name':_0x3d31('0x12'),'fields':[_0x3d31('0xf'),_0x3d31('0x13')]},{'unique':!![],'name':_0x3d31('0x14'),'fields':[_0x3d31('0xf'),_0x3d31('0x15')]},{'unique':!![],'name':'name_openchannel','fields':[_0x3d31('0xf'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x3d31('0xf'),_0x3d31('0x16')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js
index 4d362ab..19577d8 100644
--- a/server/api/disposition/disposition.rpc.js
+++ b/server/api/disposition/disposition.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x574c=['then','info','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0x574c,0xdd));var _0xc574=function(_0x363f42,_0x4e20bf){_0x363f42=_0x363f42-0x0;var _0x1e96ba=_0x574c[_0x363f42];return _0x1e96ba;};'use strict';var _=require('lodash');var util=require(_0xc574('0x0'));var moment=require('moment');var BPromise=require(_0xc574('0x1'));var rs=require(_0xc574('0x2'));var fs=require('fs');var Redis=require(_0xc574('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc574('0x4'));var logger=require('../../config/logger')(_0xc574('0x5'));var config=require(_0xc574('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc574('0x7')][_0xc574('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb36459,_0x3903e5,_0x1d332b){return new BPromise(function(_0x200a10,_0x5e7d01){return client[_0xc574('0x9')](_0xb36459,_0x1d332b)[_0xc574('0xa')](function(_0x6565f9){logger[_0xc574('0xb')](_0xc574('0xc'),_0x3903e5,_0xc574('0xd'));logger['debug'](_0xc574('0xe'),_0x3903e5,_0xc574('0xd'),JSON[_0xc574('0xf')](_0x6565f9));if(_0x6565f9[_0xc574('0x10')]){if(_0x6565f9[_0xc574('0x10')][_0xc574('0x11')]===0x1f4){logger[_0xc574('0x10')](_0xc574('0xc'),_0x3903e5,_0x6565f9[_0xc574('0x10')][_0xc574('0x12')]);return _0x5e7d01(_0x6565f9[_0xc574('0x10')]['message']);}logger[_0xc574('0x10')](_0xc574('0xc'),_0x3903e5,_0x6565f9[_0xc574('0x10')][_0xc574('0x12')]);return _0x200a10(_0x6565f9[_0xc574('0x10')][_0xc574('0x12')]);}else{logger[_0xc574('0xb')](_0xc574('0xc'),_0x3903e5,_0xc574('0xd'));_0x200a10(_0x6565f9[_0xc574('0x13')][_0xc574('0x12')]);}})[_0xc574('0x14')](function(_0x766e4d){logger[_0xc574('0x10')]('Disposition,\x20%s,\x20%s',_0x3903e5,_0x766e4d);_0x5e7d01(_0x766e4d);});});}
\ No newline at end of file
+var _0x2251=['http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x50ec96,_0x4a86e4){var _0x2b6b39=function(_0x5944c5){while(--_0x5944c5){_0x50ec96['push'](_0x50ec96['shift']());}};_0x2b6b39(++_0x4a86e4);}(_0x2251,0x1c4));var _0x1225=function(_0x40373b,_0x14cac6){_0x40373b=_0x40373b-0x0;var _0x3efdf3=_0x2251[_0x40373b];return _0x3efdf3;};'use strict';var _=require('lodash');var util=require(_0x1225('0x0'));var moment=require(_0x1225('0x1'));var BPromise=require(_0x1225('0x2'));var rs=require(_0x1225('0x3'));var fs=require('fs');var Redis=require(_0x1225('0x4'));var db=require(_0x1225('0x5'))['db'];var utils=require(_0x1225('0x6'));var logger=require('../../config/logger')(_0x1225('0x7'));var config=require(_0x1225('0x8'));var jayson=require(_0x1225('0x9'));var client=jayson['client'][_0x1225('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3415d0,_0x53444b,_0x3dbccc){return new BPromise(function(_0x4ec504,_0x2023af){return client[_0x1225('0xb')](_0x3415d0,_0x3dbccc)[_0x1225('0xc')](function(_0x2b1275){logger[_0x1225('0xd')](_0x1225('0xe'),_0x53444b,_0x1225('0xf'));logger['debug'](_0x1225('0x10'),_0x53444b,_0x1225('0xf'),JSON['stringify'](_0x2b1275));if(_0x2b1275['error']){if(_0x2b1275[_0x1225('0x11')][_0x1225('0x12')]===0x1f4){logger[_0x1225('0x11')](_0x1225('0xe'),_0x53444b,_0x2b1275[_0x1225('0x11')]['message']);return _0x2023af(_0x2b1275['error'][_0x1225('0x13')]);}logger[_0x1225('0x11')](_0x1225('0xe'),_0x53444b,_0x2b1275[_0x1225('0x11')][_0x1225('0x13')]);return _0x4ec504(_0x2b1275['error'][_0x1225('0x13')]);}else{logger['info'](_0x1225('0xe'),_0x53444b,_0x1225('0xf'));_0x4ec504(_0x2b1275[_0x1225('0x14')][_0x1225('0x13')]);}})[_0x1225('0x15')](function(_0x4085c3){logger[_0x1225('0x11')]('Disposition,\x20%s,\x20%s',_0x53444b,_0x4085c3);_0x2023af(_0x4085c3);});});}
\ No newline at end of file
diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js
index 23eb339..a7f7fd8 100644
--- a/server/api/disposition/index.js
+++ b/server/api/disposition/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9db7=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2fbcf6,_0x2e7155){var _0x3e7265=function(_0x15a3c3){while(--_0x15a3c3){_0x2fbcf6['push'](_0x2fbcf6['shift']());}};_0x3e7265(++_0x2e7155);}(_0x9db7,0x1bf));var _0x79db=function(_0x5b11f5,_0xee2429){_0x5b11f5=_0x5b11f5-0x0;var _0x3e0c58=_0x9db7[_0x5b11f5];return _0x3e0c58;};'use strict';var multer=require(_0x79db('0x0'));var util=require(_0x79db('0x1'));var path=require(_0x79db('0x2'));var timeout=require(_0x79db('0x3'));var express=require('express');var router=express[_0x79db('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x79db('0x5'));var config=require(_0x79db('0x6'));var controller=require('./disposition.controller');router[_0x79db('0x7')]('/',auth[_0x79db('0x8')](),controller[_0x79db('0x9')]);router[_0x79db('0x7')](_0x79db('0xa'),auth[_0x79db('0x8')](),controller[_0x79db('0xb')]);router[_0x79db('0xc')]('/',auth[_0x79db('0x8')](),controller[_0x79db('0xd')]);router[_0x79db('0xe')](_0x79db('0xa'),auth['isAuthenticated'](),controller[_0x79db('0xf')]);router[_0x79db('0x10')](_0x79db('0xa'),auth[_0x79db('0x8')](),controller[_0x79db('0x11')]);module[_0x79db('0x12')]=router;
\ No newline at end of file
+var _0xd7ab=['express','Router','../../components/auth/service','get','/:id','isAuthenticated','post','put','exports','multer','util','path','connect-timeout'];(function(_0x1fb038,_0xc3f69b){var _0x1600dc=function(_0x2a040e){while(--_0x2a040e){_0x1fb038['push'](_0x1fb038['shift']());}};_0x1600dc(++_0xc3f69b);}(_0xd7ab,0x14e));var _0xbd7a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd7ab[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xbd7a('0x0'));var util=require(_0xbd7a('0x1'));var path=require(_0xbd7a('0x2'));var timeout=require(_0xbd7a('0x3'));var express=require(_0xbd7a('0x4'));var router=express[_0xbd7a('0x5')]();var auth=require(_0xbd7a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xbd7a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbd7a('0x7')](_0xbd7a('0x8'),auth[_0xbd7a('0x9')](),controller['show']);router[_0xbd7a('0xa')]('/',auth[_0xbd7a('0x9')](),controller['create']);router[_0xbd7a('0xb')]('/:id',auth[_0xbd7a('0x9')](),controller['update']);router['delete'](_0xbd7a('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xbd7a('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js
index 97f3e08..dae4a99 100644
--- a/server/api/faxAccount/faxAccount.attributes.js
+++ b/server/api/faxAccount/faxAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7094=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','4800','7200','9600','12000','14400','2400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0xf92e83,_0x5b8ed8){var _0x4ff150=function(_0x29a960){while(--_0x29a960){_0xf92e83['push'](_0xf92e83['shift']());}};_0x4ff150(++_0x5b8ed8);}(_0x7094,0xb4));var _0x4709=function(_0x3e5ba2,_0x57cc22){_0x3e5ba2=_0x3e5ba2-0x0;var _0x10b6c1=_0x7094[_0x3e5ba2];return _0x10b6c1;};'use strict';var Sequelize=require(_0x4709('0x0'));module[_0x4709('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4709('0x2')]},'ecm':{'type':Sequelize[_0x4709('0x3')](_0x4709('0x4'),'no'),'defaultValue':_0x4709('0x4')},'headerinfo':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x4709('0x3')]('2400',_0x4709('0x5'),_0x4709('0x6'),_0x4709('0x7'),_0x4709('0x8'),_0x4709('0x9')),'defaultValue':_0x4709('0x5')},'maxrate':{'type':Sequelize[_0x4709('0x3')](_0x4709('0xa'),_0x4709('0x5'),_0x4709('0x6'),_0x4709('0x7'),_0x4709('0x8'),_0x4709('0x9')),'defaultValue':_0x4709('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x4709('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4709('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x4709('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4709('0x3')]('SIP',_0x4709('0xd'),_0x4709('0xe'),_0x4709('0xf')),'defaultValue':_0x4709('0x10')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4709('0x11')],'defaultValue':function(){return _0x4709('0x12');}},'notificationSound':{'type':Sequelize[_0x4709('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4709('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4709('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4709('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4709('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4709('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x4709('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4709('0x15'),'set':function(_0x182bc7){if(!_0x182bc7)this[_0x4709('0x16')](_0x4709('0x17'),null);this[_0x4709('0x16')](_0x4709('0x18'),_0x182bc7);}}};
\ No newline at end of file
+var _0x6c31=['Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','14400','INTEGER','SIP','DADHI','KHOMP','TEXT'];(function(_0x42b676,_0x3a3f9f){var _0x36e874=function(_0x3ed00e){while(--_0x3ed00e){_0x42b676['push'](_0x42b676['shift']());}};_0x36e874(++_0x3a3f9f);}(_0x6c31,0x1d3));var _0x16c3=function(_0x4d9947,_0x12e363){_0x4d9947=_0x4d9947-0x0;var _0x264ae9=_0x6c31[_0x4d9947];return _0x264ae9;};'use strict';var Sequelize=require(_0x16c3('0x0'));module[_0x16c3('0x1')]={'name':{'type':Sequelize[_0x16c3('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x16c3('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x16c3('0x3')},'headerinfo':{'type':Sequelize[_0x16c3('0x2')],'defaultValue':_0x16c3('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x16c3('0x5')},'minrate':{'type':Sequelize[_0x16c3('0x6')](_0x16c3('0x7'),_0x16c3('0x8'),_0x16c3('0x9'),'9600','12000',_0x16c3('0xa')),'defaultValue':_0x16c3('0x8')},'maxrate':{'type':Sequelize[_0x16c3('0x6')]('2400',_0x16c3('0x8'),_0x16c3('0x9'),'9600','12000',_0x16c3('0xa')),'defaultValue':_0x16c3('0xa')},'modem':{'type':Sequelize[_0x16c3('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x16c3('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x16c3('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x16c3('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x16c3('0x6')](_0x16c3('0xc'),'IAX',_0x16c3('0xd'),_0x16c3('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x16c3('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x16c3('0xf')],'defaultValue':function(){return _0x16c3('0x10');}},'notificationSound':{'type':Sequelize[_0x16c3('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x16c3('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x16c3('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x16c3('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x16c3('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x16c3('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x16c3('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x16c3('0x11')],'defaultValue':![],'comment':_0x16c3('0x13'),'set':function(_0x225e93){if(!_0x225e93)this[_0x16c3('0x14')](_0x16c3('0x15'),null);this[_0x16c3('0x14')](_0x16c3('0x16'),_0x225e93);}}};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js
index c865af6..3656c80 100644
--- a/server/api/faxAccount/faxAccount.controller.js
+++ b/server/api/faxAccount/faxAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x972a=['Content-Range','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','status','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','FaxAccount','findAll','rows','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','bulkCreate','FaxApplication','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','priority','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','Send\x20Fax\x20failed','filename','Messages','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','register','jayson/promise','client','http','test','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','json','offset','set'];(function(_0x520bba,_0x1a7969){var _0x26cbc4=function(_0x315c8e){while(--_0x315c8e){_0x520bba['push'](_0x520bba['shift']());}};_0x26cbc4(++_0x1a7969);}(_0x972a,0x157));var _0xa972=function(_0xc8db78,_0x58b5a7){_0xc8db78=_0xc8db78-0x0;var _0x3483f3=_0x972a[_0xc8db78];return _0x3483f3;};'use strict';var pdf=require(_0xa972('0x0'));var emlformat=require(_0xa972('0x1'));var rimraf=require(_0xa972('0x2'));var zipdir=require(_0xa972('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa972('0x4'));var moment=require(_0xa972('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa972('0x6'));var path=require(_0xa972('0x7'));var sox=require('sox');var csv=require(_0xa972('0x8'));var ejs=require(_0xa972('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa972('0xa'));var crypto=require('crypto');var jsforce=require(_0xa972('0xb'));var deskjs=require(_0xa972('0xc'));var toCsv=require(_0xa972('0x8'));var querystring=require(_0xa972('0xd'));var Papa=require(_0xa972('0xe'));var Redis=require(_0xa972('0xf'));var authService=require(_0xa972('0x10'));var qs=require(_0xa972('0x11'));var as=require(_0xa972('0x12'));var hardwareService=require(_0xa972('0x13'));var logger=require(_0xa972('0x14'))(_0xa972('0x15'));var utils=require(_0xa972('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa972('0x17')]=_[_0xa972('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa972('0x17')]));require('./faxAccount.socket')[_0xa972('0x19')](socket);var jayson=require(_0xa972('0x1a'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xa972('0x1b')][_0xa972('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5cac88,_0x9411cc,_0x11a958){if(_0x11a958){var _0x446f89=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x446f89[_0xa972('0x1d')](_0x9411cc)){return _0x5cac88;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5cac88;}}function respondWithRpcPromise(_0x3843fa,_0x185b31,_0x1d5b36,_0x526d30){return new BPromise(function(_0x3b5d98,_0x19a566){var _0x22e7f1=_0x526d30||client;return _0x22e7f1[_0xa972('0x1e')](_0x3843fa,_0x1d5b36)[_0xa972('0x1f')](function(_0x3098d4){logger[_0xa972('0x20')](_0xa972('0x21'),_0x185b31,_0xa972('0x22'));logger[_0xa972('0x23')](_0xa972('0x24'),_0x185b31,_0xa972('0x22'),JSON[_0xa972('0x25')](_0x3098d4));if(_0x3098d4[_0xa972('0x26')]){if(_0x3098d4[_0xa972('0x26')]['code']===0x1f4){logger[_0xa972('0x26')](_0xa972('0x21'),_0x185b31,_0x3098d4[_0xa972('0x26')][_0xa972('0x27')]);return _0x19a566(_0x3098d4[_0xa972('0x26')][_0xa972('0x27')]);}logger[_0xa972('0x26')](_0xa972('0x21'),_0x185b31,_0x3098d4[_0xa972('0x26')][_0xa972('0x27')]);return _0x3b5d98(_0x3098d4['error'][_0xa972('0x27')]);}else{logger[_0xa972('0x20')]('FaxAccount,\x20%s,\x20%s',_0x185b31,_0xa972('0x22'));_0x3b5d98(_0x3098d4[_0xa972('0x28')][_0xa972('0x27')]);}})[_0xa972('0x29')](function(_0x44196d){logger[_0xa972('0x26')]('FaxAccount,\x20%s,\x20%s',_0x185b31,_0x44196d);_0x19a566(_0x44196d);});});}function respondWithStatusCode(_0x55ab82,_0x52cf86){_0x52cf86=_0x52cf86||0xcc;return function(_0xdefc09){if(_0xdefc09){return _0x55ab82[_0xa972('0x2a')](_0x52cf86);}return _0x55ab82['status'](_0x52cf86)[_0xa972('0x2b')]();};}function respondWithResult(_0x34882e,_0x1d1e90){_0x1d1e90=_0x1d1e90||0xc8;return function(_0x42a0cd){if(_0x42a0cd){return _0x34882e['status'](_0x1d1e90)[_0xa972('0x2c')](_0x42a0cd);}};}function respondWithFilteredResult(_0x1ec909,_0x2608ef){return function(_0x1cc40a){if(_0x1cc40a){var _0x5bc51e=_0x1cc40a['count'],_0x4296c2=_0x2608ef[_0xa972('0x2d')],_0x4c2a8c=_0x2608ef[_0xa972('0x2d')]+_0x2608ef['limit'],_0x57588e;if(_0x4c2a8c>=_0x5bc51e){_0x4c2a8c=_0x5bc51e;_0x57588e=0xc8;}else{_0x57588e=0xce;}_0x1ec909['status'](_0x57588e);return _0x1ec909[_0xa972('0x2e')](_0xa972('0x2f'),_0x4296c2+'-'+_0x4c2a8c+'/'+_0x5bc51e)[_0xa972('0x2c')](_0x1cc40a);}return null;};}function patchUpdates(_0x1d218e){return function(_0xbc7351){try{jsonpatch[_0xa972('0x30')](_0xbc7351,_0x1d218e,!![]);}catch(_0x5cbe67){return BPromise['reject'](_0x5cbe67);}return _0xbc7351[_0xa972('0x31')]();};}function saveUpdates(_0x336f38,_0x29ec8e){return function(_0x128579){if(_0x128579){return _0x128579[_0xa972('0x32')](_0x336f38)[_0xa972('0x1f')](function(_0x40f25d){return _0x40f25d;});}return null;};}function removeEntity(_0x591e84,_0x36b224){return function(_0x6232f9){if(_0x6232f9){return _0x6232f9[_0xa972('0x33')]()[_0xa972('0x1f')](function(){var _0x810551=_0x6232f9[_0xa972('0x34')]({'plain':!![]});var _0x377387=_0xa972('0x35');return db[_0xa972('0x36')][_0xa972('0x33')]({'where':{'type':_0x377387,'resourceId':_0x810551['id']}})[_0xa972('0x1f')](function(){return _0x6232f9;});})[_0xa972('0x1f')](function(){_0x591e84[_0xa972('0x37')](0xcc)[_0xa972('0x2b')]();});}};}function handleEntityNotFound(_0x598160,_0x4741ec){return function(_0xd55ee1){if(!_0xd55ee1){_0x598160['sendStatus'](0x194);}return _0xd55ee1;};}function handleError(_0x31cc4,_0x70d739){_0x70d739=_0x70d739||0x1f4;return function(_0x1acd54){logger[_0xa972('0x26')](_0x1acd54[_0xa972('0x38')]);if(_0x1acd54[_0xa972('0x39')]){delete _0x1acd54[_0xa972('0x39')];}_0x31cc4[_0xa972('0x37')](_0x70d739)[_0xa972('0x3a')](_0x1acd54);};}exports[_0xa972('0x3b')]=function(_0x15b3c8,_0x36b5a8){var _0x483c4d={'include':[{'model':db[_0xa972('0x3c')],'as':_0xa972('0x3d')}]},_0x400fe3={},_0x18d6c3={'count':0x0,'rows':[]};var _0x255445=_[_0xa972('0x3e')](db['FaxAccount'][_0xa972('0x3f')],function(_0x3995f8){return{'name':_0x3995f8[_0xa972('0x40')],'type':_0x3995f8[_0xa972('0x41')][_0xa972('0x42')]};});_0x400fe3[_0xa972('0x43')]=_[_0xa972('0x3e')](_0x255445,_0xa972('0x39'));_0x400fe3[_0xa972('0x44')]=_['keys'](_0x15b3c8[_0xa972('0x44')]);_0x400fe3[_0xa972('0x45')]=_[_0xa972('0x46')](_0x400fe3[_0xa972('0x43')],_0x400fe3[_0xa972('0x44')]);_0x483c4d[_0xa972('0x47')]=_['intersection'](_0x400fe3[_0xa972('0x43')],qs[_0xa972('0x48')](_0x15b3c8[_0xa972('0x44')]['fields']));_0x483c4d[_0xa972('0x47')]=_0x483c4d['attributes'][_0xa972('0x49')]?_0x483c4d[_0xa972('0x47')]:_0x400fe3[_0xa972('0x43')];if(!_0x15b3c8[_0xa972('0x44')][_0xa972('0x4a')]('nolimit')){_0x483c4d['limit']=qs['limit'](_0x15b3c8['query'][_0xa972('0x4b')]);_0x483c4d[_0xa972('0x2d')]=qs[_0xa972('0x2d')](_0x15b3c8['query']['offset']);}_0x483c4d[_0xa972('0x4c')]=qs[_0xa972('0x4d')](_0x15b3c8['query'][_0xa972('0x4d')]);_0x483c4d[_0xa972('0x4e')]=qs['filters'](_[_0xa972('0x4f')](_0x15b3c8[_0xa972('0x44')],_0x400fe3[_0xa972('0x45')]),_0x255445);if(_0x15b3c8[_0xa972('0x44')]['filter']){_0x483c4d[_0xa972('0x4e')]=_[_0xa972('0x50')](_0x483c4d[_0xa972('0x4e')],{'$or':_['map'](_0x255445,function(_0x1ed8d7){if(_0x1ed8d7['type']!==_0xa972('0x51')){var _0x1ea5a3={};_0x1ea5a3[_0x1ed8d7[_0xa972('0x39')]]={'$like':'%'+_0x15b3c8[_0xa972('0x44')][_0xa972('0x52')]+'%'};return _0x1ea5a3;}})});}_0x483c4d=_[_0xa972('0x50')]({},_0x483c4d,_0x15b3c8['options']);var _0x26abd3={'where':_0x483c4d[_0xa972('0x4e')]};return db['FaxAccount'][_0xa972('0x53')](_0x26abd3)[_0xa972('0x1f')](function(_0x2155ad){_0x18d6c3[_0xa972('0x53')]=_0x2155ad;if(_0x15b3c8['query'][_0xa972('0x54')]){_0x483c4d[_0xa972('0x55')]=[{'all':!![]}];}return db[_0xa972('0x56')][_0xa972('0x57')](_0x483c4d);})[_0xa972('0x1f')](function(_0x35642b){_0x18d6c3[_0xa972('0x58')]=_0x35642b;return _0x18d6c3;})[_0xa972('0x1f')](respondWithFilteredResult(_0x36b5a8,_0x483c4d))[_0xa972('0x29')](handleError(_0x36b5a8,null));};exports['show']=function(_0x2ca040,_0x5ab76a){var _0x2adda2={'raw':![],'where':{'id':_0x2ca040['params']['id']},'include':[{'model':db[_0xa972('0x3c')],'as':_0xa972('0x3d')}]},_0x2f6742={};_0x2f6742[_0xa972('0x43')]=_[_0xa972('0x59')](db[_0xa972('0x56')][_0xa972('0x3f')]);_0x2f6742[_0xa972('0x44')]=_[_0xa972('0x59')](_0x2ca040[_0xa972('0x44')]);_0x2f6742['filters']=_[_0xa972('0x46')](_0x2f6742[_0xa972('0x43')],_0x2f6742[_0xa972('0x44')]);_0x2adda2[_0xa972('0x47')]=_[_0xa972('0x46')](_0x2f6742['model'],qs[_0xa972('0x48')](_0x2ca040[_0xa972('0x44')][_0xa972('0x48')]));_0x2adda2[_0xa972('0x47')]=_0x2adda2[_0xa972('0x47')][_0xa972('0x49')]?_0x2adda2[_0xa972('0x47')]:_0x2f6742[_0xa972('0x43')];if(_0x2ca040[_0xa972('0x44')][_0xa972('0x54')]){_0x2adda2[_0xa972('0x55')]=[{'all':!![]}];}_0x2adda2=_['merge']({},_0x2adda2,_0x2ca040[_0xa972('0x5a')]);return db[_0xa972('0x56')][_0xa972('0x5b')](_0x2adda2)['then'](handleEntityNotFound(_0x5ab76a,null))[_0xa972('0x1f')](respondWithResult(_0x5ab76a,null))['catch'](handleError(_0x5ab76a,null));};exports[_0xa972('0x5c')]=function(_0x5d9ed9,_0x550056){return db[_0xa972('0x56')][_0xa972('0x5c')](_0x5d9ed9[_0xa972('0x5d')],{})[_0xa972('0x1f')](function(_0x34c0fd){var _0x517647=_0x5d9ed9[_0xa972('0x5e')]['get']({'plain':!![]});if(!_0x517647)throw new Error(_0xa972('0x5f'));if(_0x517647[_0xa972('0x60')]===_0xa972('0x5e')){var _0x1c3d35=_0x34c0fd[_0xa972('0x34')]({'plain':!![]});var _0x3420ba=_0xa972('0x35');return db[_0xa972('0x61')]['find']({'where':{'name':_0x3420ba,'userProfileId':_0x517647['userProfileId']},'raw':!![]})[_0xa972('0x1f')](function(_0x1bbfca){if(_0x1bbfca&&_0x1bbfca[_0xa972('0x62')]===0x0){return db['UserProfileResource'][_0xa972('0x5c')]({'name':_0x1c3d35[_0xa972('0x39')],'resourceId':_0x1c3d35['id'],'type':_0x1bbfca[_0xa972('0x39')],'sectionId':_0x1bbfca['id']},{})[_0xa972('0x1f')](function(){return _0x34c0fd;});}else{return _0x34c0fd;}})['catch'](function(_0x9901d1){logger[_0xa972('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9901d1);throw _0x9901d1;});}return _0x34c0fd;})['then'](respondWithResult(_0x550056,0xc9))[_0xa972('0x29')](handleError(_0x550056,null));};exports['update']=function(_0x565291,_0x132e4c){if(_0x565291[_0xa972('0x5d')]['id']){delete _0x565291[_0xa972('0x5d')]['id'];}return db[_0xa972('0x56')][_0xa972('0x5b')]({'where':{'id':_0x565291[_0xa972('0x63')]['id']},'include':[{'model':db[_0xa972('0x3c')],'as':_0xa972('0x3d')}]})[_0xa972('0x1f')](handleEntityNotFound(_0x132e4c,null))[_0xa972('0x1f')](saveUpdates(_0x565291['body'],null))['then'](respondWithResult(_0x132e4c,null))['catch'](handleError(_0x132e4c,null));};exports[_0xa972('0x33')]=function(_0xcd8ff6,_0x5a3ad8){return db[_0xa972('0x56')][_0xa972('0x5b')]({'where':{'id':_0xcd8ff6['params']['id']}})['then'](handleEntityNotFound(_0x5a3ad8,null))[_0xa972('0x1f')](removeEntity(_0x5a3ad8,null))['catch'](handleError(_0x5a3ad8,null));};exports[_0xa972('0x64')]=function(_0x47e52a,_0x2505de){return db[_0xa972('0x56')]['describe']()[_0xa972('0x1f')](respondWithResult(_0x2505de,null))['catch'](handleError(_0x2505de,null));};exports[_0xa972('0x65')]=function(_0x123c5e,_0x4a587a,_0x53beb8){if(_0x123c5e['body']['id']){delete _0x123c5e[_0xa972('0x5d')]['id'];}return db[_0xa972('0x56')][_0xa972('0x5b')]({'where':{'id':_0x123c5e[_0xa972('0x63')]['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x4a587a,null))['then'](function(_0x5a956a){if(_0x5a956a){_0x123c5e[_0xa972('0x5d')]['FaxAccountId']=_0x5a956a['id'];return db[_0xa972('0x66')][_0xa972('0x5c')](_0x123c5e['body']);}})[_0xa972('0x1f')](respondWithResult(_0x4a587a,null))['catch'](handleError(_0x4a587a,null));};exports[_0xa972('0x67')]=function(_0x3405c0,_0x800d67,_0x33dfe8){var _0x2044ba={'raw':![],'where':{}};var _0x55764b={};var _0x3d3e99={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa972('0x68')]({'where':{'id':_0x3405c0['params']['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x800d67,null))['then'](function(_0x58891d){if(_0x58891d){_0x55764b[_0xa972('0x43')]=_[_0xa972('0x59')](db[_0xa972('0x66')][_0xa972('0x3f')]);_0x55764b[_0xa972('0x44')]=_[_0xa972('0x59')](_0x3405c0['query']);_0x55764b[_0xa972('0x45')]=_[_0xa972('0x46')](_0x55764b['model'],_0x55764b['query']);_0x2044ba[_0xa972('0x47')]=_[_0xa972('0x46')](_0x55764b[_0xa972('0x43')],qs['fields'](_0x3405c0[_0xa972('0x44')][_0xa972('0x48')]));_0x2044ba[_0xa972('0x47')]=_0x2044ba[_0xa972('0x47')][_0xa972('0x49')]?_0x2044ba[_0xa972('0x47')]:_0x55764b[_0xa972('0x43')];if(!_0x3405c0[_0xa972('0x44')]['hasOwnProperty'](_0xa972('0x69'))){_0x2044ba['limit']=qs[_0xa972('0x4b')](_0x3405c0['query'][_0xa972('0x4b')]);_0x2044ba[_0xa972('0x2d')]=qs[_0xa972('0x2d')](_0x3405c0['query'][_0xa972('0x2d')]);}_0x2044ba[_0xa972('0x4c')]=qs[_0xa972('0x4d')](_0x3405c0[_0xa972('0x44')][_0xa972('0x4d')]);_0x2044ba['where']=qs[_0xa972('0x45')](_[_0xa972('0x4f')](_0x3405c0[_0xa972('0x44')],_0x55764b['filters']));_0x2044ba[_0xa972('0x4e')][_0xa972('0x6a')]=_0x58891d['id'];if(_0x3405c0[_0xa972('0x44')]['filter']){_0x2044ba[_0xa972('0x4e')]=_['merge'](_0x2044ba[_0xa972('0x4e')],{'$or':_[_0xa972('0x3e')](_0x2044ba[_0xa972('0x47')],function(_0x5a08f4){var _0x20dc13={};_0x20dc13[_0x5a08f4]={'$like':'%'+_0x3405c0['query'][_0xa972('0x52')]+'%'};return _0x20dc13;})});}_0x2044ba=_[_0xa972('0x50')]({},_0x2044ba,_0x3405c0[_0xa972('0x5a')]);return db[_0xa972('0x66')][_0xa972('0x53')]({'where':_0x2044ba['where']})[_0xa972('0x1f')](function(_0x15e503){_0x3d3e99[_0xa972('0x53')]=_0x15e503;if(_0x3405c0['query']['includeAll']){_0x2044ba[_0xa972('0x55')]=[{'all':!![]}];}return db[_0xa972('0x66')]['findAll'](_0x2044ba);})[_0xa972('0x1f')](function(_0x2a0471){_0x3d3e99[_0xa972('0x58')]=_0x2a0471;return _0x3d3e99;});}})[_0xa972('0x1f')](respondWithFilteredResult(_0x800d67,_0x2044ba))[_0xa972('0x29')](handleError(_0x800d67,null));};exports[_0xa972('0x6b')]=function(_0x4280c5,_0x5365f4,_0x5ebae2){return db[_0xa972('0x56')]['find']({'where':{'id':_0x4280c5[_0xa972('0x63')]['id']}})['then'](handleEntityNotFound(_0x5365f4,null))[_0xa972('0x1f')](function(_0x1e383b){if(_0x1e383b){return _0x1e383b[_0xa972('0x6b')](_0x4280c5[_0xa972('0x44')][_0xa972('0x6c')]);}})[_0xa972('0x1f')](respondWithStatusCode(_0x5365f4,null))['catch'](handleError(_0x5365f4,null));};exports[_0xa972('0x6d')]=function(_0x5d2aaf,_0x33b68b,_0x1c135d){if(_0x5d2aaf[_0xa972('0x5d')]['id']){delete _0x5d2aaf['body']['id'];}return db[_0xa972('0x56')][_0xa972('0x5b')]({'where':{'id':_0x5d2aaf[_0xa972('0x63')]['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x33b68b,null))[_0xa972('0x1f')](function(_0x5742b9){if(_0x5742b9){_0x5d2aaf[_0xa972('0x5d')][_0xa972('0x6a')]=_0x5742b9['id'];return db[_0xa972('0x6e')][_0xa972('0x5c')](_0x5d2aaf[_0xa972('0x5d')]);}})['then'](respondWithResult(_0x33b68b,null))[_0xa972('0x29')](handleError(_0x33b68b,null));};exports['getAnswers']=function(_0x19b65b,_0x498618,_0x9170e6){var _0x254b96={'raw':![],'where':{}};var _0x39f1a0={};var _0x532ba2={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa972('0x68')]({'where':{'id':_0x19b65b[_0xa972('0x63')]['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x498618,null))['then'](function(_0xdc291d){if(_0xdc291d){_0x39f1a0['model']=_['keys'](db['CannedAnswer'][_0xa972('0x3f')]);_0x39f1a0[_0xa972('0x44')]=_[_0xa972('0x59')](_0x19b65b[_0xa972('0x44')]);_0x39f1a0[_0xa972('0x45')]=_[_0xa972('0x46')](_0x39f1a0[_0xa972('0x43')],_0x39f1a0[_0xa972('0x44')]);_0x254b96[_0xa972('0x47')]=_['intersection'](_0x39f1a0['model'],qs[_0xa972('0x48')](_0x19b65b[_0xa972('0x44')][_0xa972('0x48')]));_0x254b96[_0xa972('0x47')]=_0x254b96[_0xa972('0x47')][_0xa972('0x49')]?_0x254b96[_0xa972('0x47')]:_0x39f1a0[_0xa972('0x43')];if(!_0x19b65b['query']['hasOwnProperty']('nolimit')){_0x254b96[_0xa972('0x4b')]=qs[_0xa972('0x4b')](_0x19b65b[_0xa972('0x44')][_0xa972('0x4b')]);_0x254b96[_0xa972('0x2d')]=qs[_0xa972('0x2d')](_0x19b65b[_0xa972('0x44')][_0xa972('0x2d')]);}_0x254b96[_0xa972('0x4c')]=qs[_0xa972('0x4d')](_0x19b65b[_0xa972('0x44')]['sort']);_0x254b96[_0xa972('0x4e')]=qs['filters'](_[_0xa972('0x4f')](_0x19b65b[_0xa972('0x44')],_0x39f1a0[_0xa972('0x45')]));_0x254b96[_0xa972('0x4e')][_0xa972('0x6a')]=_0xdc291d['id'];if(_0x19b65b['query'][_0xa972('0x52')]){_0x254b96[_0xa972('0x4e')]=_[_0xa972('0x50')](_0x254b96['where'],{'$or':_[_0xa972('0x3e')](_0x254b96[_0xa972('0x47')],function(_0x215efb){var _0x4baade={};_0x4baade[_0x215efb]={'$like':'%'+_0x19b65b[_0xa972('0x44')][_0xa972('0x52')]+'%'};return _0x4baade;})});}_0x254b96=_[_0xa972('0x50')]({},_0x254b96,_0x19b65b[_0xa972('0x5a')]);return db[_0xa972('0x6e')][_0xa972('0x53')]({'where':_0x254b96[_0xa972('0x4e')]})['then'](function(_0x4bd9c7){_0x532ba2['count']=_0x4bd9c7;if(_0x19b65b[_0xa972('0x44')]['includeAll']){_0x254b96[_0xa972('0x55')]=[{'all':!![]}];}return db[_0xa972('0x6e')]['findAll'](_0x254b96);})[_0xa972('0x1f')](function(_0x290821){_0x532ba2[_0xa972('0x58')]=_0x290821;return _0x532ba2;});}})[_0xa972('0x1f')](respondWithFilteredResult(_0x498618,_0x254b96))[_0xa972('0x29')](handleError(_0x498618,null));};exports[_0xa972('0x6f')]=function(_0x673b24,_0x458172,_0x5ae029){return db[_0xa972('0x56')][_0xa972('0x5b')]({'where':{'id':_0x673b24['params']['id']}})['then'](handleEntityNotFound(_0x458172,null))[_0xa972('0x1f')](function(_0x95de2e){if(_0x95de2e){return _0x95de2e[_0xa972('0x6f')](_0x673b24[_0xa972('0x44')][_0xa972('0x6c')]);}})[_0xa972('0x1f')](respondWithStatusCode(_0x458172,null))['catch'](handleError(_0x458172,null));};exports['addInteraction']=function(_0x41a82d,_0x380a7b,_0xadf2a7){return db[_0xa972('0x70')][_0xa972('0x5b')]({'where':{'id':_0x41a82d[_0xa972('0x63')]['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x380a7b,null))[_0xa972('0x1f')](function(_0x2da1f7){if(_0x2da1f7){return _0x2da1f7[_0xa972('0x71')](_0x41a82d[_0xa972('0x5d')][_0xa972('0x6c')],_[_0xa972('0x72')](_0x41a82d[_0xa972('0x5d')],['ids','id'])||{});}})[_0xa972('0x1f')](respondWithResult(_0x380a7b,null))[_0xa972('0x29')](handleError(_0x380a7b,null));};exports[_0xa972('0x73')]=function(_0x1aeb1d,_0x3883d0,_0x2942e5){var _0x30881e={'raw':![],'where':{}};var _0x18d963={};var _0x406098={'count':0x0,'rows':[]};return db[_0xa972('0x56')][_0xa972('0x68')]({'where':{'id':_0x1aeb1d[_0xa972('0x63')]['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x3883d0,null))[_0xa972('0x1f')](function(_0x28f3c3){if(_0x28f3c3){_0x18d963[_0xa972('0x43')]=_[_0xa972('0x59')](db[_0xa972('0x70')]['rawAttributes']);_0x18d963['query']=_[_0xa972('0x59')](_0x1aeb1d[_0xa972('0x44')]);_0x18d963['filters']=_[_0xa972('0x46')](_0x18d963[_0xa972('0x43')],_0x18d963[_0xa972('0x44')]);_0x30881e[_0xa972('0x47')]=_[_0xa972('0x46')](_0x18d963[_0xa972('0x43')],qs[_0xa972('0x48')](_0x1aeb1d['query'][_0xa972('0x48')]));_0x30881e[_0xa972('0x47')]=_0x30881e['attributes'][_0xa972('0x49')]?_0x30881e[_0xa972('0x47')]:_0x18d963[_0xa972('0x43')];if(!_0x1aeb1d[_0xa972('0x44')][_0xa972('0x4a')](_0xa972('0x69'))){_0x30881e[_0xa972('0x4b')]=qs['limit'](_0x1aeb1d[_0xa972('0x44')][_0xa972('0x4b')]);_0x30881e[_0xa972('0x2d')]=qs[_0xa972('0x2d')](_0x1aeb1d[_0xa972('0x44')][_0xa972('0x2d')]);}_0x30881e[_0xa972('0x4c')]=qs['sort'](_0x1aeb1d[_0xa972('0x44')][_0xa972('0x4d')]);_0x30881e[_0xa972('0x4e')]=qs['filters'](_[_0xa972('0x4f')](_0x1aeb1d[_0xa972('0x44')],_0x18d963[_0xa972('0x45')]));_0x30881e[_0xa972('0x4e')][_0xa972('0x6a')]=_0x28f3c3['id'];if(_0x1aeb1d[_0xa972('0x44')]['filter']){_0x30881e[_0xa972('0x4e')]=_[_0xa972('0x50')](_0x30881e[_0xa972('0x4e')],{'$or':_[_0xa972('0x3e')](_0x30881e[_0xa972('0x47')],function(_0xfebb8c){var _0x510b03={};_0x510b03[_0xfebb8c]={'$like':'%'+_0x1aeb1d[_0xa972('0x44')][_0xa972('0x52')]+'%'};return _0x510b03;})});}_0x30881e=_[_0xa972('0x50')]({},_0x30881e,_0x1aeb1d['options']);return db[_0xa972('0x70')][_0xa972('0x53')]({'where':_0x30881e[_0xa972('0x4e')]})[_0xa972('0x1f')](function(_0x3b97c0){_0x406098[_0xa972('0x53')]=_0x3b97c0;if(_0x1aeb1d['query']['includeAll']){_0x30881e[_0xa972('0x55')]=[{'model':db[_0xa972('0x74')],'as':_0xa972('0x75'),'required':![]},{'model':db[_0xa972('0x76')],'as':_0xa972('0x77'),'attributes':['name',_0xa972('0x78'),_0xa972('0x79')],'required':![]},{'model':db['Tag'],'as':_0xa972('0x7a'),'attributes':['id',_0xa972('0x39'),_0xa972('0x7b')],'where':_0x1aeb1d[_0xa972('0x44')]['tag']?{'id':_0x1aeb1d[_0xa972('0x44')][_0xa972('0x7c')]}:undefined,'required':_0x1aeb1d['query']['tag']?!![]:![]}];}return db[_0xa972('0x70')][_0xa972('0x57')](_0x30881e);})[_0xa972('0x1f')](function(_0x528e47){_0x406098['rows']=_0x528e47;return _0x406098;});}})['then'](respondWithFilteredResult(_0x3883d0,_0x30881e))[_0xa972('0x29')](handleError(_0x3883d0,null));};exports[_0xa972('0x7d')]=function(_0x151f7e,_0x4e2476,_0x1751a4){return db[_0xa972('0x56')][_0xa972('0x68')]({'where':{'id':_0x151f7e[_0xa972('0x63')]['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x4e2476,null))[_0xa972('0x1f')](function(_0x55908c){if(_0x55908c){return db[_0xa972('0x7e')][_0xa972('0x7f')](function(_0x155802){return db['FaxApplication'][_0xa972('0x33')]({'where':{'FaxAccountId':_0x151f7e['params']['id']},'transaction':_0x155802})[_0xa972('0x1f')](function(_0x59fc39){var _0x41f2ee=_['map'](_0x151f7e[_0xa972('0x5d')],function(_0x33144d){_0x33144d[_0xa972('0x6a')]=_0x151f7e['params']['id'];return _0x33144d;});return db['FaxApplication'][_0xa972('0x80')](_0x41f2ee,{'transaction':_0x155802});});})[_0xa972('0x1f')](function(){return db[_0xa972('0x81')]['findAndCountAll']({'where':{'FaxAccountId':_0x151f7e['params']['id']},'order':'priority'});});}})[_0xa972('0x1f')](respondWithResult(_0x4e2476,null))[_0xa972('0x29')](handleError(_0x4e2476,null));};exports[_0xa972('0x82')]=function(_0x221cca,_0x34908c,_0x663b6e){var _0x4c935d={};var _0xb1dd8c={};var _0x466b14;var _0x309b3b;return db['FaxAccount']['findOne']({'where':{'id':_0x221cca['params']['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x34908c,null))[_0xa972('0x1f')](function(_0xf44dce){if(_0xf44dce){_0x466b14=_0xf44dce;_0xb1dd8c[_0xa972('0x43')]=_['keys'](db[_0xa972('0x81')][_0xa972('0x3f')]);_0xb1dd8c[_0xa972('0x44')]=_[_0xa972('0x59')](_0x221cca[_0xa972('0x44')]);_0xb1dd8c[_0xa972('0x45')]=_[_0xa972('0x46')](_0xb1dd8c[_0xa972('0x43')],_0xb1dd8c[_0xa972('0x44')]);_0x4c935d[_0xa972('0x47')]=_[_0xa972('0x46')](_0xb1dd8c['model'],qs['fields'](_0x221cca[_0xa972('0x44')][_0xa972('0x48')]));_0x4c935d[_0xa972('0x47')]=_0x4c935d['attributes']['length']?_0x4c935d['attributes']:_0xb1dd8c[_0xa972('0x43')];_0x4c935d[_0xa972('0x4c')]=qs[_0xa972('0x4d')](_0x221cca[_0xa972('0x44')][_0xa972('0x4d')]);_0x4c935d[_0xa972('0x4e')]=qs[_0xa972('0x45')](_[_0xa972('0x4f')](_0x221cca[_0xa972('0x44')],_0xb1dd8c[_0xa972('0x45')]));if(_0x221cca['query']['filter']){_0x4c935d[_0xa972('0x4e')]=_[_0xa972('0x50')](_0x4c935d[_0xa972('0x4e')],{'$or':_['map'](_0x4c935d['attributes'],function(_0x3060ba){var _0x431f91={};_0x431f91[_0x3060ba]={'$like':'%'+_0x221cca[_0xa972('0x44')]['filter']+'%'};return _0x431f91;})});}_0x4c935d=_[_0xa972('0x50')]({},_0x4c935d,_0x221cca[_0xa972('0x5a')]);return _0x466b14[_0xa972('0x82')](_0x4c935d);}})[_0xa972('0x1f')](function(_0x1ac21d){if(_0x1ac21d){_0x309b3b=_0x1ac21d[_0xa972('0x49')];if(!_0x221cca[_0xa972('0x44')][_0xa972('0x4a')](_0xa972('0x69'))){_0x4c935d[_0xa972('0x4b')]=qs[_0xa972('0x4b')](_0x221cca[_0xa972('0x44')]['limit']);_0x4c935d['offset']=qs['offset'](_0x221cca[_0xa972('0x44')][_0xa972('0x2d')]);}return _0x466b14['getApplications'](_0x4c935d);}})[_0xa972('0x1f')](function(_0x206221){if(_0x206221){return _0x206221?{'count':_0x309b3b,'rows':_0x206221}:null;}})[_0xa972('0x1f')](respondWithResult(_0x34908c,null))[_0xa972('0x29')](handleError(_0x34908c,null));};function Extension(_0x484f09,_0x444427,_0x181e05,_0x182669){this[_0xa972('0x83')]=_0xa972('0x84');this[_0xa972('0x85')]=_0x484f09[_0xa972('0x86')];this[_0xa972('0x87')]=_0x182669;this[_0xa972('0x41')]=_0xa972('0x88');this[_0xa972('0x89')]=_0xa972('0x8a');this['FaxAccountId']=_0x484f09['id'];this[_0xa972('0x8b')]=_0x444427;this['appdata']=_0x181e05;}function createExtensionsReciveFax(_0x18f875){var _0x3878cd=0x1;var _0x28f7d2=[];_0x28f7d2[_0xa972('0x8c')](new Extension(_0x18f875,_0x3878cd,'','Answer'));_0x3878cd+=0x1;_0x28f7d2['push'](new Extension(_0x18f875,_0x3878cd,_0xa972('0x8d'),_0xa972('0x8e')));_0x3878cd+=0x1;for(var _0x5add65 in _0x18f875){if(_0x18f875[_0xa972('0x4a')](_0x5add65)&&(_0x5add65==='ecm'||_0x5add65===_0xa972('0x86')||_0x5add65===_0xa972('0x8f')||_0x5add65===_0xa972('0x90')||_0x5add65===_0xa972('0x91')||_0x5add65===_0xa972('0x92')||_0x5add65===_0xa972('0x93')||_0x5add65==='modem'||_0x5add65===_0xa972('0x94'))){_0x28f7d2[_0xa972('0x8c')](new Extension(_0x18f875,_0x3878cd,_0xa972('0x95')+_0x5add65+')='+_0x18f875[_0x5add65],'Set'));_0x3878cd+=0x1;}}_0x28f7d2['push'](new Extension(_0x18f875,_0x3878cd,'6',_0xa972('0x96')));_0x3878cd+=0x1;_0x28f7d2['push'](new Extension(_0x18f875,_0x3878cd,_0xa972('0x97'),_0xa972('0x98')));_0x3878cd=0x0;return _0x28f7d2;}exports[_0xa972('0x99')]=function(_0x58509d,_0x47cbdc,_0x42411f){var _0x4aa025;return db['sequelize'][_0xa972('0x7f')](function(_0x545ef6){return db['FaxAccount'][_0xa972('0x5c')](_0x58509d[_0xa972('0x5d')],{'transaction':_0x545ef6})[_0xa972('0x1f')](function(_0x8457ff){_0x4aa025=_0x8457ff[_0xa972('0x34')]({'plain':!![]});return db[_0xa972('0x9a')][_0xa972('0x80')](createExtensionsReciveFax(_0x4aa025),{'transaction':_0x545ef6});});})['then'](function(){return _0x4aa025;})[_0xa972('0x1f')](respondWithResult(_0x47cbdc,null))[_0xa972('0x29')](handleError(_0x47cbdc,null));};exports[_0xa972('0x9b')]=function(_0x247389,_0x255899,_0x1917da){var _0x507beb;return db[_0xa972('0x7e')][_0xa972('0x7f')](function(_0x1017e8){return db[_0xa972('0x56')][_0xa972('0x32')](_0x247389[_0xa972('0x5d')],{'where':{'id':_0x247389[_0xa972('0x5d')]['id']},'transaction':_0x1017e8})['then'](function(_0x2f01e1){return db[_0xa972('0x9a')][_0xa972('0x33')]({'where':{'FaxAccountId':_0x247389[_0xa972('0x5d')]['id']},'transaction':_0x1017e8})['then'](function(_0x486a12){return db[_0xa972('0x9a')][_0xa972('0x80')](createExtensionsReciveFax(_[_0xa972('0x72')](_0x247389[_0xa972('0x5d')],['tech',_0xa972('0x42'),_0xa972('0x9c'),_0xa972('0x9d'),_0xa972('0x9e'),'ListId'])),{'transaction':_0x1017e8});});});})[_0xa972('0x1f')](function(){return db[_0xa972('0x56')]['findById'](_0x247389['body']['id']);})[_0xa972('0x1f')](respondWithResult(_0x255899,null))[_0xa972('0x29')](handleError(_0x255899,null));};exports[_0xa972('0x9f')]=function(_0x40b196,_0x4783bc,_0x5500b5){var _0xe58ad2={'raw':!![],'where':{}};var _0x81bbe9={};var _0x3c1e3a={'count':0x0,'rows':[]};return db[_0xa972('0x56')][_0xa972('0x68')]({'where':{'id':_0x40b196['params']['id']}})['then'](handleEntityNotFound(_0x4783bc,null))[_0xa972('0x1f')](function(_0x122614){if(_0x122614){_0x81bbe9['model']=_[_0xa972('0x59')](db[_0xa972('0xa0')]['rawAttributes']);_0x81bbe9['query']=_[_0xa972('0x59')](_0x40b196[_0xa972('0x44')]);_0x81bbe9[_0xa972('0x45')]=_[_0xa972('0x46')](_0x81bbe9['model'],_0x81bbe9[_0xa972('0x44')]);_0xe58ad2[_0xa972('0x47')]=_[_0xa972('0x46')](_0x81bbe9[_0xa972('0x43')],qs[_0xa972('0x48')](_0x40b196[_0xa972('0x44')][_0xa972('0x48')]));_0xe58ad2[_0xa972('0x47')]=_0xe58ad2[_0xa972('0x47')][_0xa972('0x49')]?_0xe58ad2[_0xa972('0x47')]:_0x81bbe9[_0xa972('0x43')];if(!_0x40b196['query'][_0xa972('0x4a')](_0xa972('0x69'))){_0xe58ad2[_0xa972('0x4b')]=qs[_0xa972('0x4b')](_0x40b196[_0xa972('0x44')][_0xa972('0x4b')]);_0xe58ad2[_0xa972('0x2d')]=qs[_0xa972('0x2d')](_0x40b196[_0xa972('0x44')]['offset']);}_0xe58ad2[_0xa972('0x4c')]=qs[_0xa972('0x4d')](_0x40b196['query'][_0xa972('0x4d')]);_0xe58ad2[_0xa972('0x4e')]=qs[_0xa972('0x45')](_[_0xa972('0x4f')](_0x40b196['query'],_0x81bbe9[_0xa972('0x45')]));_0xe58ad2[_0xa972('0x4e')][_0xa972('0x6a')]=_0x122614['id'];if(_0x40b196['query']['filter']){_0xe58ad2[_0xa972('0x4e')]=_[_0xa972('0x50')](_0xe58ad2[_0xa972('0x4e')],{'$or':_['map'](_0xe58ad2[_0xa972('0x47')],function(_0x15b9fe){var _0x5d7e87={};_0x5d7e87[_0x15b9fe]={'$like':'%'+_0x40b196[_0xa972('0x44')][_0xa972('0x52')]+'%'};return _0x5d7e87;})});}if(_0x40b196[_0xa972('0x44')]['$gte']){var _0x55af82=_0x40b196['query'][_0xa972('0xa1')][_0xa972('0xa2')](',');var _0x26e8fe={};_0x26e8fe[_0x55af82[0x0]]={'$gte':moment(_0x55af82[0x1])[_0xa972('0xa3')](_0xa972('0xa4'))};_0xe58ad2['where']=_[_0xa972('0x50')](_0xe58ad2[_0xa972('0x4e')],_0x26e8fe);}_0xe58ad2=_[_0xa972('0x50')]({},_0xe58ad2,_0x40b196[_0xa972('0x5a')]);return db[_0xa972('0xa0')]['count']({'where':_0xe58ad2[_0xa972('0x4e')]})[_0xa972('0x1f')](function(_0x496936){_0x3c1e3a['count']=_0x496936;if(_0x40b196[_0xa972('0x44')]['includeAll']){_0xe58ad2[_0xa972('0x55')]=[{'all':!![]}];}return db[_0xa972('0xa0')][_0xa972('0x57')](_0xe58ad2);})[_0xa972('0x1f')](function(_0x8fdd93){_0x3c1e3a[_0xa972('0x58')]=_0x8fdd93;return _0x3c1e3a;});}})[_0xa972('0x1f')](respondWithFilteredResult(_0x4783bc,_0xe58ad2))['catch'](handleError(_0x4783bc,null));};exports[_0xa972('0x3a')]=function(_0x5bbb37,_0x335800,_0x648f7d){var _0xb62f46,_0x38f64d={},_0x2d5e00;if(_0x5bbb37[_0xa972('0x5d')]['to']){_0x2d5e00=_0x5bbb37['body']['to'][0x0];}return db[_0xa972('0x56')][_0xa972('0x5b')]({'where':{'id':_0x5bbb37[_0xa972('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0xa972('0xa5'),'include':[{'model':db['CmContact'],'as':_0xa972('0xa6'),'where':{'fax':_0x2d5e00},'limit':0x1,'order':[[_0xa972('0x9d'),_0xa972('0xa7')]]}]}]})[_0xa972('0x1f')](handleEntityNotFound(_0x335800,null))[_0xa972('0x1f')](function(_0x29b78c){_0xb62f46=_0x29b78c;if(_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')]&&_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][_0xa972('0x49')]){for(var _0x4f67a1=0x0;_0x4f67a1<_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')]['length'];_0x4f67a1+=0x1){_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][_0x4f67a1]={'filename':_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][_0x4f67a1][_0xa972('0x39')],'id':_0x5bbb37['body'][_0xa972('0xa8')][_0x4f67a1]['id'],'path':path[_0xa972('0xa9')](config[_0xa972('0xaa')],_0xa972('0xab'),_0x5bbb37[_0xa972('0x5d')]['attachments'][_0x4f67a1][_0xa972('0xac')])};}}return respondWithRpcPromise(_0xa972('0xad'),_0xa972('0xad'),{'FaxAccountId':_[_0xa972('0xae')](_0x5bbb37[_0xa972('0x63')]['id'])?undefined:_0x5bbb37[_0xa972('0x63')]['id'],'path':_['isNil'](_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][0x0]['path'])?undefined:_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][0x0][_0xa972('0x7')],'fax':_['isNil'](_0x5bbb37[_0xa972('0x5d')]['to'][0x0])?undefined:_0x5bbb37[_0xa972('0x5d')]['to'][0x0]},client9002);})[_0xa972('0x1f')](function(){if(_0xb62f46){if(_[_0xa972('0xae')](_0x5bbb37[_0xa972('0x5d')][_0xa972('0xaf')])){_0x5bbb37['body'][_0xa972('0xaf')]=util[_0xa972('0xa3')](_0xa972('0xb0'),_0xb62f46[_0xa972('0x39')],_0xb62f46[_0xa972('0xb1')]);}if(_0xb62f46['List']){if(_0xb62f46[_0xa972('0xa5')]['Contacts'][_0xa972('0x49')]){return _0xb62f46[_0xa972('0xa5')][_0xa972('0xa6')][0x0];}else{return db[_0xa972('0x74')]['create'](_[_0xa972('0x18')](_0x5bbb37['body'],{'firstName':_0x5bbb37[_0xa972('0x5d')]['to'][0x0],'phone':_0x5bbb37[_0xa972('0x5d')]['to'][0x0],'fax':_0x5bbb37[_0xa972('0x5d')]['to'][0x0],'ListId':_0xb62f46[_0xa972('0xb2')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xa972('0xb3'));}})[_0xa972('0x1f')](function(_0x15daf7){if(_0x15daf7){return db[_0xa972('0x70')][_0xa972('0x5b')]({'where':{'ContactId':_0x15daf7['id'],'closed':![],'FaxAccountId':_0xb62f46['id']}})[_0xa972('0x1f')](function(_0x3881f1){if(_0x3881f1){return[_0x3881f1,![]];}return db[_0xa972('0x70')]['create']({'UserId':_0x5bbb37['user']['id'],'ContactId':_0x15daf7['id'],'FaxAccountId':_0xb62f46['id'],'fax':_0x5bbb37['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x5bbb37['body'],{'read':![],'body':_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][0x0][_0xa972('0xb4')],'FaxAccountId':_0xb62f46['id'],'UserId':_0x5bbb37['user']['id'],'ContactId':_0x15daf7['id'],'AttachmentId':_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0xa972('0xa0')],'as':_0xa972('0xb5')}]})[_0xa972('0x1f')](function(_0x48e7e1){return[_0x48e7e1,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xa972('0xb6')](function(_0x1bd0ec,_0x322e11){if(_0x322e11){return _0x1bd0ec;}return db[_0xa972('0xa0')][_0xa972('0x5c')]({'direction':_0xa972('0xb7'),'read':![],'body':_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][0x0][_0xa972('0xb4')],'FaxAccountId':_0xb62f46['id'],'FaxInteractionId':_0x1bd0ec['id'],'UserId':_0x5bbb37[_0xa972('0x5e')]['id'],'ContactId':_0x1bd0ec[_0xa972('0xb8')],'AttachmentId':_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][0x0]['id']})[_0xa972('0x1f')](function(_0x5a3f38){_0x1bd0ec[_0xa972('0xb9')]['Messages']=[];_0x1bd0ec[_0xa972('0xb9')][_0xa972('0xb5')]['push'](_0x5a3f38[_0xa972('0xb9')]);return _0x1bd0ec;});})['then'](function(_0x5950cb){respondWithRpcPromise(_0xa972('0xba'),_0xa972('0xba'),{'FaxAccountId':_[_0xa972('0xae')](_0x5bbb37[_0xa972('0x63')]['id'])?undefined:_0x5bbb37['params']['id'],'path':_[_0xa972('0xae')](_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][0x0][_0xa972('0x7')])?undefined:_0x5bbb37[_0xa972('0x5d')][_0xa972('0xa8')][0x0][_0xa972('0x7')],'fax':_['isNil'](_0x5bbb37['body']['to'][0x0])?undefined:_0x5bbb37['body']['to'][0x0],'AttachmentId':_0x5bbb37[_0xa972('0x5d')]['attachments'][0x0]['id']},client9002)['then'](function(_0x52f319){logger[_0xa972('0x20')](_0xa972('0xbb'),_0x52f319);})['catch'](function(_0xd0989c){logger[_0xa972('0x20')](_0xa972('0xbb'),_0xd0989c);});return _0x5950cb;})[_0xa972('0x1f')](respondWithResult(_0x335800,null))[_0xa972('0x29')](handleError(_0x335800,null));};exports[_0xa972('0xbc')]=function(_0x225804,_0x10f5bd,_0x2591fa){return db['FaxAccount'][_0xa972('0x5b')]({'where':{'id':_0x225804[_0xa972('0x63')]['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x10f5bd,null))[_0xa972('0x1f')](function(_0x8005d6){if(_0x8005d6){return _0x8005d6[_0xa972('0xbc')](_0x225804[_0xa972('0x5d')][_0xa972('0x6c')],_[_0xa972('0x72')](_0x225804[_0xa972('0x5d')],['ids','id'])||{})[_0xa972('0xb6')](function(_0x160f41){for(var _0x356cec=0x0;_0x356cec<_0x225804['body']['ids'][_0xa972('0x49')];_0x356cec+=0x1){socket[_0xa972('0xbd')](_0xa972('0xbe'),{'UserId':_0x225804['body'][_0xa972('0x6c')][_0x356cec],'FaxAccountId':_0x225804[_0xa972('0x63')]['id']});}return _0x160f41;});}})[_0xa972('0x1f')](respondWithResult(_0x10f5bd,null))[_0xa972('0x29')](handleError(_0x10f5bd,null));};exports[_0xa972('0xbf')]=function(_0x3b577c,_0x433eb0,_0x1ca4f8){return db[_0xa972('0x56')][_0xa972('0x5b')]({'where':{'id':_0x3b577c[_0xa972('0x63')]['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x433eb0,null))[_0xa972('0x1f')](function(_0x5e1186){if(_0x5e1186){return _0x5e1186[_0xa972('0xbf')](_0x3b577c['query'][_0xa972('0x6c')])[_0xa972('0x1f')](function(){if(_[_0xa972('0xc0')](_0x3b577c[_0xa972('0x44')][_0xa972('0x6c')])){for(var _0x1fc85a=0x0;_0x1fc85a<_0x3b577c[_0xa972('0x44')][_0xa972('0x6c')][_0xa972('0x49')];_0x1fc85a+=0x1){socket[_0xa972('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x3b577c[_0xa972('0x44')]['ids'][_0x1fc85a]),'FaxAccountId':Number(_0x3b577c[_0xa972('0x63')]['id'])});}}else{socket[_0xa972('0xbd')](_0xa972('0xc1'),{'UserId':Number(_0x3b577c[_0xa972('0x44')][_0xa972('0x6c')]),'FaxAccountId':Number(_0x3b577c[_0xa972('0x63')]['id'])});}});}})[_0xa972('0x1f')](respondWithStatusCode(_0x433eb0,null))['catch'](handleError(_0x433eb0,null));};exports[_0xa972('0xc2')]=function(_0x33ee31,_0x44eaf7,_0x103b67){var _0x53a748={};var _0x3de826={};var _0x161b03;var _0x68b4c4;return db['FaxAccount'][_0xa972('0x68')]({'where':{'id':_0x33ee31['params']['id']}})[_0xa972('0x1f')](handleEntityNotFound(_0x44eaf7,null))[_0xa972('0x1f')](function(_0x107305){if(_0x107305){_0x161b03=_0x107305;_0x3de826[_0xa972('0x43')]=_[_0xa972('0x59')](db[_0xa972('0x76')][_0xa972('0x3f')]);_0x3de826[_0xa972('0x44')]=_[_0xa972('0x59')](_0x33ee31[_0xa972('0x44')]);_0x3de826[_0xa972('0x45')]=_[_0xa972('0x46')](_0x3de826[_0xa972('0x43')],_0x3de826[_0xa972('0x44')]);_0x53a748[_0xa972('0x47')]=_[_0xa972('0x46')](_0x3de826[_0xa972('0x43')],qs[_0xa972('0x48')](_0x33ee31[_0xa972('0x44')][_0xa972('0x48')]));_0x53a748[_0xa972('0x47')]=_0x53a748['attributes'][_0xa972('0x49')]?_0x53a748[_0xa972('0x47')]:_0x3de826[_0xa972('0x43')];_0x53a748[_0xa972('0x4c')]=qs[_0xa972('0x4d')](_0x33ee31[_0xa972('0x44')][_0xa972('0x4d')]);_0x53a748['where']=qs[_0xa972('0x45')](_[_0xa972('0x4f')](_0x33ee31[_0xa972('0x44')],_0x3de826[_0xa972('0x45')]));if(_0x33ee31['query'][_0xa972('0x52')]){_0x53a748[_0xa972('0x4e')]=_[_0xa972('0x50')](_0x53a748[_0xa972('0x4e')],{'$or':_['map'](_0x53a748['attributes'],function(_0xbbb900){var _0x3a68a1={};_0x3a68a1[_0xbbb900]={'$like':'%'+_0x33ee31['query'][_0xa972('0x52')]+'%'};return _0x3a68a1;})});}_0x53a748=_[_0xa972('0x50')]({},_0x53a748,_0x33ee31['options']);return _0x161b03[_0xa972('0xc2')](_0x53a748);}})[_0xa972('0x1f')](function(_0x3bb8ef){if(_0x3bb8ef){_0x68b4c4=_0x3bb8ef['length'];if(!_0x33ee31[_0xa972('0x44')]['hasOwnProperty'](_0xa972('0x69'))){_0x53a748['limit']=qs[_0xa972('0x4b')](_0x33ee31['query'][_0xa972('0x4b')]);_0x53a748[_0xa972('0x2d')]=qs[_0xa972('0x2d')](_0x33ee31[_0xa972('0x44')][_0xa972('0x2d')]);}return _0x161b03[_0xa972('0xc2')](_0x53a748);}})[_0xa972('0x1f')](function(_0x131831){if(_0x131831){return _0x131831?{'count':_0x68b4c4,'rows':_0x131831}:null;}})[_0xa972('0x1f')](respondWithResult(_0x44eaf7,null))[_0xa972('0x29')](handleError(_0x44eaf7,null));};
\ No newline at end of file
+var _0xbd15=['headerinfo','maxrate','minrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','bulkCreate','updateAccountApplications','createdAt','updatedAt','TrunkId','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','send','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxAccount.socket','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','count','offset','limit','set','apply','save','update','then','get','FaxAccounts','UserProfileResource','destroy','sendStatus','stack','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','FaxAccount','includeAll','include','rows','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','nolimit','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','FaxApplication','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','priority','appdata','push','Answer','Set','ecm','gateway'];(function(_0x1ae7af,_0x186788){var _0x39a119=function(_0xaf4ed3){while(--_0xaf4ed3){_0x1ae7af['push'](_0x1ae7af['shift']());}};_0x39a119(++_0x186788);}(_0xbd15,0xfc));var _0x5bd1=function(_0x45505a,_0x59368a){_0x45505a=_0x45505a-0x0;var _0x36a1f6=_0xbd15[_0x45505a];return _0x36a1f6;};'use strict';var pdf=require(_0x5bd1('0x0'));var emlformat=require(_0x5bd1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5bd1('0x2'));var jsonpatch=require(_0x5bd1('0x3'));var rp=require(_0x5bd1('0x4'));var moment=require(_0x5bd1('0x5'));var BPromise=require(_0x5bd1('0x6'));var Mustache=require(_0x5bd1('0x7'));var util=require(_0x5bd1('0x8'));var path=require(_0x5bd1('0x9'));var sox=require('sox');var csv=require(_0x5bd1('0xa'));var ejs=require(_0x5bd1('0xb'));var fs=require('fs');var _=require(_0x5bd1('0xc'));var squel=require(_0x5bd1('0xd'));var crypto=require(_0x5bd1('0xe'));var jsforce=require(_0x5bd1('0xf'));var deskjs=require(_0x5bd1('0x10'));var toCsv=require(_0x5bd1('0xa'));var querystring=require(_0x5bd1('0x11'));var Papa=require(_0x5bd1('0x12'));var Redis=require('ioredis');var authService=require(_0x5bd1('0x13'));var qs=require(_0x5bd1('0x14'));var as=require(_0x5bd1('0x15'));var hardwareService=require(_0x5bd1('0x16'));var logger=require(_0x5bd1('0x17'))(_0x5bd1('0x18'));var utils=require(_0x5bd1('0x19'));var config=require(_0x5bd1('0x1a'));var db=require(_0x5bd1('0x1b'))['db'];config[_0x5bd1('0x1c')]=_[_0x5bd1('0x1d')](config[_0x5bd1('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5bd1('0x1c')]));require(_0x5bd1('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5bd1('0x1f')][_0x5bd1('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2ef650,_0x3a6986,_0xa64cf){if(_0xa64cf){var _0x3cb18e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3cb18e['test'](_0x3a6986)){return _0x2ef650;}else{throw new db[(_0x5bd1('0x21'))][(_0x5bd1('0x22'))](_0x5bd1('0x23'));}}else{return _0x2ef650;}}function respondWithRpcPromise(_0x55a0aa,_0x4808eb,_0x196585,_0x3e8fec){return new BPromise(function(_0x3f4090,_0x2aa6d0){var _0x52c696=_0x3e8fec||client;return _0x52c696['request'](_0x55a0aa,_0x196585)['then'](function(_0x3f646b){logger[_0x5bd1('0x24')](_0x5bd1('0x25'),_0x4808eb,_0x5bd1('0x26'));logger['debug'](_0x5bd1('0x27'),_0x4808eb,_0x5bd1('0x26'),JSON[_0x5bd1('0x28')](_0x3f646b));if(_0x3f646b[_0x5bd1('0x29')]){if(_0x3f646b[_0x5bd1('0x29')][_0x5bd1('0x2a')]===0x1f4){logger[_0x5bd1('0x29')](_0x5bd1('0x25'),_0x4808eb,_0x3f646b[_0x5bd1('0x29')][_0x5bd1('0x2b')]);return _0x2aa6d0(_0x3f646b[_0x5bd1('0x29')][_0x5bd1('0x2b')]);}logger[_0x5bd1('0x29')]('FaxAccount,\x20%s,\x20%s',_0x4808eb,_0x3f646b[_0x5bd1('0x29')][_0x5bd1('0x2b')]);return _0x3f4090(_0x3f646b[_0x5bd1('0x29')]['message']);}else{logger[_0x5bd1('0x24')](_0x5bd1('0x25'),_0x4808eb,_0x5bd1('0x26'));_0x3f4090(_0x3f646b[_0x5bd1('0x2c')][_0x5bd1('0x2b')]);}})['catch'](function(_0x50bf6a){logger[_0x5bd1('0x29')](_0x5bd1('0x25'),_0x4808eb,_0x50bf6a);_0x2aa6d0(_0x50bf6a);});});}function respondWithStatusCode(_0x399ba5,_0x17e1e2){_0x17e1e2=_0x17e1e2||0xcc;return function(_0x2a35b1){if(_0x2a35b1){return _0x399ba5['sendStatus'](_0x17e1e2);}return _0x399ba5[_0x5bd1('0x2d')](_0x17e1e2)[_0x5bd1('0x2e')]();};}function respondWithResult(_0x241d91,_0x48aaaf){_0x48aaaf=_0x48aaaf||0xc8;return function(_0x1baaa8){if(_0x1baaa8){return _0x241d91[_0x5bd1('0x2d')](_0x48aaaf)[_0x5bd1('0x2f')](_0x1baaa8);}};}function respondWithFilteredResult(_0x16564e,_0x434d33){return function(_0x347f59){if(_0x347f59){var _0x1ffcd6=_0x347f59[_0x5bd1('0x30')],_0x25fbd4=_0x434d33['offset'],_0x530bc8=_0x434d33[_0x5bd1('0x31')]+_0x434d33[_0x5bd1('0x32')],_0x5710da;if(_0x530bc8>=_0x1ffcd6){_0x530bc8=_0x1ffcd6;_0x5710da=0xc8;}else{_0x5710da=0xce;}_0x16564e[_0x5bd1('0x2d')](_0x5710da);return _0x16564e[_0x5bd1('0x33')]('Content-Range',_0x25fbd4+'-'+_0x530bc8+'/'+_0x1ffcd6)[_0x5bd1('0x2f')](_0x347f59);}return null;};}function patchUpdates(_0x2bc49e){return function(_0x59f273){try{jsonpatch[_0x5bd1('0x34')](_0x59f273,_0x2bc49e,!![]);}catch(_0x9ba60c){return BPromise['reject'](_0x9ba60c);}return _0x59f273[_0x5bd1('0x35')]();};}function saveUpdates(_0x58f8ec,_0xeaffe7){return function(_0x2b96fa){if(_0x2b96fa){return _0x2b96fa[_0x5bd1('0x36')](_0x58f8ec)[_0x5bd1('0x37')](function(_0x28fb63){return _0x28fb63;});}return null;};}function removeEntity(_0x17d135,_0x5d1e3f){return function(_0xc6b995){if(_0xc6b995){return _0xc6b995['destroy']()[_0x5bd1('0x37')](function(){var _0x554631=_0xc6b995[_0x5bd1('0x38')]({'plain':!![]});var _0x162707=_0x5bd1('0x39');return db[_0x5bd1('0x3a')][_0x5bd1('0x3b')]({'where':{'type':_0x162707,'resourceId':_0x554631['id']}})['then'](function(){return _0xc6b995;});})[_0x5bd1('0x37')](function(){_0x17d135[_0x5bd1('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a2dec,_0x423985){return function(_0x120916){if(!_0x120916){_0x2a2dec[_0x5bd1('0x3c')](0x194);}return _0x120916;};}function handleError(_0x40d1f6,_0x20b35d){_0x20b35d=_0x20b35d||0x1f4;return function(_0x2fd6ed){logger[_0x5bd1('0x29')](_0x2fd6ed[_0x5bd1('0x3d')]);if(_0x2fd6ed['name']){delete _0x2fd6ed['name'];}_0x40d1f6[_0x5bd1('0x2d')](_0x20b35d)['send'](_0x2fd6ed);};}exports[_0x5bd1('0x3e')]=function(_0x46e2cb,_0x33799a){var _0x2d607d={'include':[{'model':db[_0x5bd1('0x3f')],'as':_0x5bd1('0x40')}]},_0x148f94={},_0x58b6c0={'count':0x0,'rows':[]};var _0x2fbb50=_[_0x5bd1('0x41')](db['FaxAccount'][_0x5bd1('0x42')],function(_0x174492){return{'name':_0x174492[_0x5bd1('0x43')],'type':_0x174492['type'][_0x5bd1('0x44')]};});_0x148f94[_0x5bd1('0x45')]=_[_0x5bd1('0x41')](_0x2fbb50,_0x5bd1('0x46'));_0x148f94[_0x5bd1('0x47')]=_[_0x5bd1('0x48')](_0x46e2cb[_0x5bd1('0x47')]);_0x148f94[_0x5bd1('0x49')]=_[_0x5bd1('0x4a')](_0x148f94[_0x5bd1('0x45')],_0x148f94[_0x5bd1('0x47')]);_0x2d607d[_0x5bd1('0x4b')]=_[_0x5bd1('0x4a')](_0x148f94[_0x5bd1('0x45')],qs[_0x5bd1('0x4c')](_0x46e2cb[_0x5bd1('0x47')][_0x5bd1('0x4c')]));_0x2d607d['attributes']=_0x2d607d[_0x5bd1('0x4b')]['length']?_0x2d607d[_0x5bd1('0x4b')]:_0x148f94[_0x5bd1('0x45')];if(!_0x46e2cb[_0x5bd1('0x47')][_0x5bd1('0x4d')]('nolimit')){_0x2d607d[_0x5bd1('0x32')]=qs[_0x5bd1('0x32')](_0x46e2cb[_0x5bd1('0x47')]['limit']);_0x2d607d[_0x5bd1('0x31')]=qs[_0x5bd1('0x31')](_0x46e2cb[_0x5bd1('0x47')]['offset']);}_0x2d607d[_0x5bd1('0x4e')]=qs['sort'](_0x46e2cb[_0x5bd1('0x47')][_0x5bd1('0x4f')]);_0x2d607d[_0x5bd1('0x50')]=qs[_0x5bd1('0x49')](_[_0x5bd1('0x51')](_0x46e2cb[_0x5bd1('0x47')],_0x148f94[_0x5bd1('0x49')]),_0x2fbb50);if(_0x46e2cb[_0x5bd1('0x47')]['filter']){_0x2d607d[_0x5bd1('0x50')]=_[_0x5bd1('0x52')](_0x2d607d[_0x5bd1('0x50')],{'$or':_[_0x5bd1('0x41')](_0x2fbb50,function(_0x2969d8){if(_0x2969d8[_0x5bd1('0x53')]!==_0x5bd1('0x54')){var _0x5e6361={};_0x5e6361[_0x2969d8[_0x5bd1('0x46')]]={'$like':'%'+_0x46e2cb[_0x5bd1('0x47')][_0x5bd1('0x55')]+'%'};return _0x5e6361;}})});}_0x2d607d=_[_0x5bd1('0x52')]({},_0x2d607d,_0x46e2cb[_0x5bd1('0x56')]);var _0x343297={'where':_0x2d607d['where']};return db[_0x5bd1('0x57')]['count'](_0x343297)[_0x5bd1('0x37')](function(_0x251a5a){_0x58b6c0['count']=_0x251a5a;if(_0x46e2cb[_0x5bd1('0x47')][_0x5bd1('0x58')]){_0x2d607d[_0x5bd1('0x59')]=[{'all':!![]}];}return db[_0x5bd1('0x57')]['findAll'](_0x2d607d);})[_0x5bd1('0x37')](function(_0x5bbb58){_0x58b6c0[_0x5bd1('0x5a')]=_0x5bbb58;return _0x58b6c0;})['then'](respondWithFilteredResult(_0x33799a,_0x2d607d))['catch'](handleError(_0x33799a,null));};exports[_0x5bd1('0x5b')]=function(_0x82f198,_0x3d16a2){var _0x32c961={'raw':![],'where':{'id':_0x82f198[_0x5bd1('0x5c')]['id']},'include':[{'model':db[_0x5bd1('0x3f')],'as':_0x5bd1('0x40')}]},_0x19755c={};_0x19755c[_0x5bd1('0x45')]=_[_0x5bd1('0x48')](db['FaxAccount'][_0x5bd1('0x42')]);_0x19755c[_0x5bd1('0x47')]=_[_0x5bd1('0x48')](_0x82f198[_0x5bd1('0x47')]);_0x19755c[_0x5bd1('0x49')]=_['intersection'](_0x19755c[_0x5bd1('0x45')],_0x19755c[_0x5bd1('0x47')]);_0x32c961[_0x5bd1('0x4b')]=_[_0x5bd1('0x4a')](_0x19755c[_0x5bd1('0x45')],qs['fields'](_0x82f198['query'][_0x5bd1('0x4c')]));_0x32c961[_0x5bd1('0x4b')]=_0x32c961['attributes']['length']?_0x32c961[_0x5bd1('0x4b')]:_0x19755c['model'];if(_0x82f198[_0x5bd1('0x47')][_0x5bd1('0x58')]){_0x32c961['include']=[{'all':!![]}];}_0x32c961=_[_0x5bd1('0x52')]({},_0x32c961,_0x82f198[_0x5bd1('0x56')]);return db[_0x5bd1('0x57')][_0x5bd1('0x5d')](_0x32c961)[_0x5bd1('0x37')](handleEntityNotFound(_0x3d16a2,null))[_0x5bd1('0x37')](respondWithResult(_0x3d16a2,null))['catch'](handleError(_0x3d16a2,null));};exports['create']=function(_0x9a3af1,_0x45f53c){return db[_0x5bd1('0x57')]['create'](_0x9a3af1[_0x5bd1('0x5e')],{})['then'](function(_0x57e536){var _0x48b647=_0x9a3af1[_0x5bd1('0x5f')]['get']({'plain':!![]});if(!_0x48b647)throw new Error(_0x5bd1('0x60'));if(_0x48b647[_0x5bd1('0x61')]===_0x5bd1('0x5f')){var _0x4d0cba=_0x57e536[_0x5bd1('0x38')]({'plain':!![]});var _0x3de6f3=_0x5bd1('0x39');return db['UserProfileSection'][_0x5bd1('0x5d')]({'where':{'name':_0x3de6f3,'userProfileId':_0x48b647[_0x5bd1('0x62')]},'raw':!![]})['then'](function(_0x4689e3){if(_0x4689e3&&_0x4689e3[_0x5bd1('0x63')]===0x0){return db[_0x5bd1('0x3a')][_0x5bd1('0x64')]({'name':_0x4d0cba[_0x5bd1('0x46')],'resourceId':_0x4d0cba['id'],'type':_0x4689e3[_0x5bd1('0x46')],'sectionId':_0x4689e3['id']},{})[_0x5bd1('0x37')](function(){return _0x57e536;});}else{return _0x57e536;}})[_0x5bd1('0x65')](function(_0x175f38){logger['error'](_0x5bd1('0x66'),_0x175f38);throw _0x175f38;});}return _0x57e536;})['then'](respondWithResult(_0x45f53c,0xc9))['catch'](handleError(_0x45f53c,null));};exports[_0x5bd1('0x36')]=function(_0x3322d7,_0x42a390){if(_0x3322d7[_0x5bd1('0x5e')]['id']){delete _0x3322d7['body']['id'];}return db[_0x5bd1('0x57')][_0x5bd1('0x5d')]({'where':{'id':_0x3322d7[_0x5bd1('0x5c')]['id']},'include':[{'model':db[_0x5bd1('0x3f')],'as':_0x5bd1('0x40')}]})['then'](handleEntityNotFound(_0x42a390,null))[_0x5bd1('0x37')](saveUpdates(_0x3322d7['body'],null))[_0x5bd1('0x37')](respondWithResult(_0x42a390,null))[_0x5bd1('0x65')](handleError(_0x42a390,null));};exports['destroy']=function(_0x2c950f,_0xb0c534){return db['FaxAccount'][_0x5bd1('0x5d')]({'where':{'id':_0x2c950f[_0x5bd1('0x5c')]['id']}})['then'](handleEntityNotFound(_0xb0c534,null))['then'](removeEntity(_0xb0c534,null))[_0x5bd1('0x65')](handleError(_0xb0c534,null));};exports['describe']=function(_0x4781d1,_0x273dc3){return db[_0x5bd1('0x57')][_0x5bd1('0x67')]()[_0x5bd1('0x37')](respondWithResult(_0x273dc3,null))[_0x5bd1('0x65')](handleError(_0x273dc3,null));};exports[_0x5bd1('0x68')]=function(_0x2e8a74,_0x5b6785,_0x48fc3c){if(_0x2e8a74['body']['id']){delete _0x2e8a74['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x2e8a74[_0x5bd1('0x5c')]['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x5b6785,null))[_0x5bd1('0x37')](function(_0x3a3285){if(_0x3a3285){_0x2e8a74[_0x5bd1('0x5e')][_0x5bd1('0x69')]=_0x3a3285['id'];return db[_0x5bd1('0x6a')][_0x5bd1('0x64')](_0x2e8a74['body']);}})[_0x5bd1('0x37')](respondWithResult(_0x5b6785,null))[_0x5bd1('0x65')](handleError(_0x5b6785,null));};exports[_0x5bd1('0x6b')]=function(_0x49469b,_0x51c297,_0x211be5){var _0x1e266d={'raw':![],'where':{}};var _0x391461={};var _0x2b17b5={'count':0x0,'rows':[]};return db[_0x5bd1('0x57')][_0x5bd1('0x6c')]({'where':{'id':_0x49469b[_0x5bd1('0x5c')]['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x51c297,null))[_0x5bd1('0x37')](function(_0x1bf892){if(_0x1bf892){_0x391461[_0x5bd1('0x45')]=_[_0x5bd1('0x48')](db[_0x5bd1('0x6a')][_0x5bd1('0x42')]);_0x391461['query']=_[_0x5bd1('0x48')](_0x49469b[_0x5bd1('0x47')]);_0x391461[_0x5bd1('0x49')]=_[_0x5bd1('0x4a')](_0x391461['model'],_0x391461[_0x5bd1('0x47')]);_0x1e266d[_0x5bd1('0x4b')]=_[_0x5bd1('0x4a')](_0x391461[_0x5bd1('0x45')],qs[_0x5bd1('0x4c')](_0x49469b['query'][_0x5bd1('0x4c')]));_0x1e266d[_0x5bd1('0x4b')]=_0x1e266d['attributes'][_0x5bd1('0x6d')]?_0x1e266d[_0x5bd1('0x4b')]:_0x391461[_0x5bd1('0x45')];if(!_0x49469b[_0x5bd1('0x47')]['hasOwnProperty'](_0x5bd1('0x6e'))){_0x1e266d[_0x5bd1('0x32')]=qs[_0x5bd1('0x32')](_0x49469b[_0x5bd1('0x47')][_0x5bd1('0x32')]);_0x1e266d['offset']=qs[_0x5bd1('0x31')](_0x49469b[_0x5bd1('0x47')]['offset']);}_0x1e266d[_0x5bd1('0x4e')]=qs[_0x5bd1('0x4f')](_0x49469b[_0x5bd1('0x47')][_0x5bd1('0x4f')]);_0x1e266d[_0x5bd1('0x50')]=qs[_0x5bd1('0x49')](_[_0x5bd1('0x51')](_0x49469b['query'],_0x391461[_0x5bd1('0x49')]));_0x1e266d[_0x5bd1('0x50')][_0x5bd1('0x69')]=_0x1bf892['id'];if(_0x49469b[_0x5bd1('0x47')][_0x5bd1('0x55')]){_0x1e266d[_0x5bd1('0x50')]=_[_0x5bd1('0x52')](_0x1e266d[_0x5bd1('0x50')],{'$or':_[_0x5bd1('0x41')](_0x1e266d[_0x5bd1('0x4b')],function(_0x3d977a){var _0x2698be={};_0x2698be[_0x3d977a]={'$like':'%'+_0x49469b[_0x5bd1('0x47')][_0x5bd1('0x55')]+'%'};return _0x2698be;})});}_0x1e266d=_[_0x5bd1('0x52')]({},_0x1e266d,_0x49469b['options']);return db[_0x5bd1('0x6a')][_0x5bd1('0x30')]({'where':_0x1e266d[_0x5bd1('0x50')]})[_0x5bd1('0x37')](function(_0x5a64ae){_0x2b17b5['count']=_0x5a64ae;if(_0x49469b[_0x5bd1('0x47')][_0x5bd1('0x58')]){_0x1e266d[_0x5bd1('0x59')]=[{'all':!![]}];}return db[_0x5bd1('0x6a')][_0x5bd1('0x6f')](_0x1e266d);})[_0x5bd1('0x37')](function(_0x282e5f){_0x2b17b5[_0x5bd1('0x5a')]=_0x282e5f;return _0x2b17b5;});}})[_0x5bd1('0x37')](respondWithFilteredResult(_0x51c297,_0x1e266d))[_0x5bd1('0x65')](handleError(_0x51c297,null));};exports[_0x5bd1('0x70')]=function(_0x331a9f,_0x1c7279,_0x1e7c19){return db[_0x5bd1('0x57')][_0x5bd1('0x5d')]({'where':{'id':_0x331a9f[_0x5bd1('0x5c')]['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x1c7279,null))[_0x5bd1('0x37')](function(_0x1e6812){if(_0x1e6812){return _0x1e6812[_0x5bd1('0x70')](_0x331a9f[_0x5bd1('0x47')][_0x5bd1('0x71')]);}})[_0x5bd1('0x37')](respondWithStatusCode(_0x1c7279,null))[_0x5bd1('0x65')](handleError(_0x1c7279,null));};exports[_0x5bd1('0x72')]=function(_0x50c193,_0x2f3a6e,_0x7bee70){if(_0x50c193[_0x5bd1('0x5e')]['id']){delete _0x50c193[_0x5bd1('0x5e')]['id'];}return db[_0x5bd1('0x57')][_0x5bd1('0x5d')]({'where':{'id':_0x50c193[_0x5bd1('0x5c')]['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x2f3a6e,null))[_0x5bd1('0x37')](function(_0x185948){if(_0x185948){_0x50c193['body'][_0x5bd1('0x69')]=_0x185948['id'];return db['CannedAnswer'][_0x5bd1('0x64')](_0x50c193[_0x5bd1('0x5e')]);}})['then'](respondWithResult(_0x2f3a6e,null))[_0x5bd1('0x65')](handleError(_0x2f3a6e,null));};exports[_0x5bd1('0x73')]=function(_0x3ac518,_0x4b9a59,_0x1576ad){var _0xe0318={'raw':![],'where':{}};var _0xf7a277={};var _0x53d669={'count':0x0,'rows':[]};return db[_0x5bd1('0x57')][_0x5bd1('0x6c')]({'where':{'id':_0x3ac518['params']['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x4b9a59,null))['then'](function(_0x3ee62c){if(_0x3ee62c){_0xf7a277[_0x5bd1('0x45')]=_[_0x5bd1('0x48')](db[_0x5bd1('0x74')][_0x5bd1('0x42')]);_0xf7a277['query']=_['keys'](_0x3ac518[_0x5bd1('0x47')]);_0xf7a277[_0x5bd1('0x49')]=_[_0x5bd1('0x4a')](_0xf7a277[_0x5bd1('0x45')],_0xf7a277['query']);_0xe0318[_0x5bd1('0x4b')]=_[_0x5bd1('0x4a')](_0xf7a277[_0x5bd1('0x45')],qs[_0x5bd1('0x4c')](_0x3ac518['query']['fields']));_0xe0318[_0x5bd1('0x4b')]=_0xe0318['attributes'][_0x5bd1('0x6d')]?_0xe0318[_0x5bd1('0x4b')]:_0xf7a277['model'];if(!_0x3ac518[_0x5bd1('0x47')]['hasOwnProperty'](_0x5bd1('0x6e'))){_0xe0318[_0x5bd1('0x32')]=qs[_0x5bd1('0x32')](_0x3ac518[_0x5bd1('0x47')][_0x5bd1('0x32')]);_0xe0318[_0x5bd1('0x31')]=qs[_0x5bd1('0x31')](_0x3ac518[_0x5bd1('0x47')]['offset']);}_0xe0318[_0x5bd1('0x4e')]=qs[_0x5bd1('0x4f')](_0x3ac518[_0x5bd1('0x47')]['sort']);_0xe0318[_0x5bd1('0x50')]=qs[_0x5bd1('0x49')](_[_0x5bd1('0x51')](_0x3ac518[_0x5bd1('0x47')],_0xf7a277['filters']));_0xe0318['where'][_0x5bd1('0x69')]=_0x3ee62c['id'];if(_0x3ac518[_0x5bd1('0x47')]['filter']){_0xe0318[_0x5bd1('0x50')]=_[_0x5bd1('0x52')](_0xe0318[_0x5bd1('0x50')],{'$or':_[_0x5bd1('0x41')](_0xe0318[_0x5bd1('0x4b')],function(_0x42fb95){var _0x27b4df={};_0x27b4df[_0x42fb95]={'$like':'%'+_0x3ac518['query'][_0x5bd1('0x55')]+'%'};return _0x27b4df;})});}_0xe0318=_['merge']({},_0xe0318,_0x3ac518[_0x5bd1('0x56')]);return db[_0x5bd1('0x74')][_0x5bd1('0x30')]({'where':_0xe0318['where']})[_0x5bd1('0x37')](function(_0x5986f7){_0x53d669[_0x5bd1('0x30')]=_0x5986f7;if(_0x3ac518['query'][_0x5bd1('0x58')]){_0xe0318[_0x5bd1('0x59')]=[{'all':!![]}];}return db[_0x5bd1('0x74')][_0x5bd1('0x6f')](_0xe0318);})[_0x5bd1('0x37')](function(_0x276848){_0x53d669[_0x5bd1('0x5a')]=_0x276848;return _0x53d669;});}})[_0x5bd1('0x37')](respondWithFilteredResult(_0x4b9a59,_0xe0318))[_0x5bd1('0x65')](handleError(_0x4b9a59,null));};exports[_0x5bd1('0x75')]=function(_0x7c44bc,_0x10f955,_0x5b55d3){return db[_0x5bd1('0x57')][_0x5bd1('0x5d')]({'where':{'id':_0x7c44bc['params']['id']}})['then'](handleEntityNotFound(_0x10f955,null))[_0x5bd1('0x37')](function(_0x393237){if(_0x393237){return _0x393237['removeAnswers'](_0x7c44bc[_0x5bd1('0x47')][_0x5bd1('0x71')]);}})['then'](respondWithStatusCode(_0x10f955,null))['catch'](handleError(_0x10f955,null));};exports[_0x5bd1('0x76')]=function(_0x161130,_0xdeea9a,_0x19a3d6){return db[_0x5bd1('0x77')]['find']({'where':{'id':_0x161130[_0x5bd1('0x5c')]['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0xdeea9a,null))[_0x5bd1('0x37')](function(_0x36a927){if(_0x36a927){return _0x36a927['addInteraction'](_0x161130[_0x5bd1('0x5e')][_0x5bd1('0x71')],_[_0x5bd1('0x78')](_0x161130[_0x5bd1('0x5e')],[_0x5bd1('0x71'),'id'])||{});}})[_0x5bd1('0x37')](respondWithResult(_0xdeea9a,null))[_0x5bd1('0x65')](handleError(_0xdeea9a,null));};exports[_0x5bd1('0x79')]=function(_0x13687e,_0x1d1815,_0x15c5ea){var _0x9d1d08={'raw':![],'where':{}};var _0x289fb={};var _0x1271b0={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x13687e[_0x5bd1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1d1815,null))['then'](function(_0x1ab006){if(_0x1ab006){_0x289fb[_0x5bd1('0x45')]=_['keys'](db[_0x5bd1('0x77')]['rawAttributes']);_0x289fb[_0x5bd1('0x47')]=_[_0x5bd1('0x48')](_0x13687e[_0x5bd1('0x47')]);_0x289fb['filters']=_[_0x5bd1('0x4a')](_0x289fb[_0x5bd1('0x45')],_0x289fb['query']);_0x9d1d08[_0x5bd1('0x4b')]=_[_0x5bd1('0x4a')](_0x289fb[_0x5bd1('0x45')],qs['fields'](_0x13687e[_0x5bd1('0x47')][_0x5bd1('0x4c')]));_0x9d1d08['attributes']=_0x9d1d08['attributes'][_0x5bd1('0x6d')]?_0x9d1d08[_0x5bd1('0x4b')]:_0x289fb[_0x5bd1('0x45')];if(!_0x13687e[_0x5bd1('0x47')][_0x5bd1('0x4d')](_0x5bd1('0x6e'))){_0x9d1d08[_0x5bd1('0x32')]=qs[_0x5bd1('0x32')](_0x13687e['query']['limit']);_0x9d1d08[_0x5bd1('0x31')]=qs['offset'](_0x13687e[_0x5bd1('0x47')][_0x5bd1('0x31')]);}_0x9d1d08['order']=qs[_0x5bd1('0x4f')](_0x13687e[_0x5bd1('0x47')][_0x5bd1('0x4f')]);_0x9d1d08[_0x5bd1('0x50')]=qs[_0x5bd1('0x49')](_[_0x5bd1('0x51')](_0x13687e[_0x5bd1('0x47')],_0x289fb['filters']));_0x9d1d08['where']['FaxAccountId']=_0x1ab006['id'];if(_0x13687e[_0x5bd1('0x47')]['filter']){_0x9d1d08[_0x5bd1('0x50')]=_[_0x5bd1('0x52')](_0x9d1d08['where'],{'$or':_[_0x5bd1('0x41')](_0x9d1d08[_0x5bd1('0x4b')],function(_0x84426a){var _0x3fef9b={};_0x3fef9b[_0x84426a]={'$like':'%'+_0x13687e[_0x5bd1('0x47')]['filter']+'%'};return _0x3fef9b;})});}_0x9d1d08=_[_0x5bd1('0x52')]({},_0x9d1d08,_0x13687e[_0x5bd1('0x56')]);return db[_0x5bd1('0x77')]['count']({'where':_0x9d1d08[_0x5bd1('0x50')]})['then'](function(_0x5fda4c){_0x1271b0['count']=_0x5fda4c;if(_0x13687e[_0x5bd1('0x47')]['includeAll']){_0x9d1d08['include']=[{'model':db[_0x5bd1('0x7a')],'as':_0x5bd1('0x7b'),'required':![]},{'model':db[_0x5bd1('0x7c')],'as':_0x5bd1('0x7d'),'attributes':[_0x5bd1('0x46'),_0x5bd1('0x7e'),_0x5bd1('0x7f')],'required':![]},{'model':db[_0x5bd1('0x80')],'as':_0x5bd1('0x81'),'attributes':['id',_0x5bd1('0x46'),_0x5bd1('0x82')],'where':_0x13687e[_0x5bd1('0x47')][_0x5bd1('0x83')]?{'id':_0x13687e[_0x5bd1('0x47')]['tag']}:undefined,'required':_0x13687e[_0x5bd1('0x47')]['tag']?!![]:![]}];}return db[_0x5bd1('0x77')][_0x5bd1('0x6f')](_0x9d1d08);})[_0x5bd1('0x37')](function(_0x48640f){_0x1271b0[_0x5bd1('0x5a')]=_0x48640f;return _0x1271b0;});}})[_0x5bd1('0x37')](respondWithFilteredResult(_0x1d1815,_0x9d1d08))[_0x5bd1('0x65')](handleError(_0x1d1815,null));};exports[_0x5bd1('0x84')]=function(_0x3279d2,_0x51a666,_0x807b6f){return db[_0x5bd1('0x57')][_0x5bd1('0x6c')]({'where':{'id':_0x3279d2[_0x5bd1('0x5c')]['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x51a666,null))['then'](function(_0x572cfa){if(_0x572cfa){return db[_0x5bd1('0x85')]['transaction'](function(_0xfcdd09){return db[_0x5bd1('0x86')][_0x5bd1('0x3b')]({'where':{'FaxAccountId':_0x3279d2['params']['id']},'transaction':_0xfcdd09})[_0x5bd1('0x37')](function(_0x38b044){var _0x29c0c9=_['map'](_0x3279d2[_0x5bd1('0x5e')],function(_0x47913d){_0x47913d[_0x5bd1('0x69')]=_0x3279d2[_0x5bd1('0x5c')]['id'];return _0x47913d;});return db[_0x5bd1('0x86')]['bulkCreate'](_0x29c0c9,{'transaction':_0xfcdd09});});})[_0x5bd1('0x37')](function(){return db[_0x5bd1('0x86')]['findAndCountAll']({'where':{'FaxAccountId':_0x3279d2[_0x5bd1('0x5c')]['id']},'order':'priority'});});}})[_0x5bd1('0x37')](respondWithResult(_0x51a666,null))['catch'](handleError(_0x51a666,null));};exports[_0x5bd1('0x87')]=function(_0x4dabfe,_0x3f13ed,_0x554f3a){var _0x7b86d1={};var _0x550bdb={};var _0x261036;var _0x3f8996;return db[_0x5bd1('0x57')][_0x5bd1('0x6c')]({'where':{'id':_0x4dabfe['params']['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x3f13ed,null))[_0x5bd1('0x37')](function(_0x5b6256){if(_0x5b6256){_0x261036=_0x5b6256;_0x550bdb['model']=_['keys'](db[_0x5bd1('0x86')][_0x5bd1('0x42')]);_0x550bdb[_0x5bd1('0x47')]=_[_0x5bd1('0x48')](_0x4dabfe[_0x5bd1('0x47')]);_0x550bdb[_0x5bd1('0x49')]=_[_0x5bd1('0x4a')](_0x550bdb[_0x5bd1('0x45')],_0x550bdb[_0x5bd1('0x47')]);_0x7b86d1[_0x5bd1('0x4b')]=_['intersection'](_0x550bdb[_0x5bd1('0x45')],qs[_0x5bd1('0x4c')](_0x4dabfe[_0x5bd1('0x47')]['fields']));_0x7b86d1[_0x5bd1('0x4b')]=_0x7b86d1[_0x5bd1('0x4b')][_0x5bd1('0x6d')]?_0x7b86d1['attributes']:_0x550bdb[_0x5bd1('0x45')];_0x7b86d1[_0x5bd1('0x4e')]=qs[_0x5bd1('0x4f')](_0x4dabfe[_0x5bd1('0x47')][_0x5bd1('0x4f')]);_0x7b86d1[_0x5bd1('0x50')]=qs[_0x5bd1('0x49')](_[_0x5bd1('0x51')](_0x4dabfe[_0x5bd1('0x47')],_0x550bdb[_0x5bd1('0x49')]));if(_0x4dabfe[_0x5bd1('0x47')][_0x5bd1('0x55')]){_0x7b86d1[_0x5bd1('0x50')]=_[_0x5bd1('0x52')](_0x7b86d1[_0x5bd1('0x50')],{'$or':_['map'](_0x7b86d1[_0x5bd1('0x4b')],function(_0x3d1d94){var _0x2cc43d={};_0x2cc43d[_0x3d1d94]={'$like':'%'+_0x4dabfe[_0x5bd1('0x47')][_0x5bd1('0x55')]+'%'};return _0x2cc43d;})});}_0x7b86d1=_[_0x5bd1('0x52')]({},_0x7b86d1,_0x4dabfe[_0x5bd1('0x56')]);return _0x261036[_0x5bd1('0x87')](_0x7b86d1);}})[_0x5bd1('0x37')](function(_0x29f15b){if(_0x29f15b){_0x3f8996=_0x29f15b[_0x5bd1('0x6d')];if(!_0x4dabfe['query'][_0x5bd1('0x4d')](_0x5bd1('0x6e'))){_0x7b86d1[_0x5bd1('0x32')]=qs[_0x5bd1('0x32')](_0x4dabfe[_0x5bd1('0x47')][_0x5bd1('0x32')]);_0x7b86d1['offset']=qs['offset'](_0x4dabfe[_0x5bd1('0x47')][_0x5bd1('0x31')]);}return _0x261036[_0x5bd1('0x87')](_0x7b86d1);}})['then'](function(_0x35fd85){if(_0x35fd85){return _0x35fd85?{'count':_0x3f8996,'rows':_0x35fd85}:null;}})[_0x5bd1('0x37')](respondWithResult(_0x3f13ed,null))['catch'](handleError(_0x3f13ed,null));};function Extension(_0x16c9fb,_0x8c17b5,_0x57283a,_0x32b585){this[_0x5bd1('0x88')]=_0x5bd1('0x89');this[_0x5bd1('0x8a')]=_0x16c9fb[_0x5bd1('0x8b')];this[_0x5bd1('0x8c')]=_0x32b585;this['type']=_0x5bd1('0x8d');this['description']=_0x5bd1('0x8e');this[_0x5bd1('0x69')]=_0x16c9fb['id'];this[_0x5bd1('0x8f')]=_0x8c17b5;this[_0x5bd1('0x90')]=_0x57283a;}function createExtensionsReciveFax(_0x297e71){var _0xd98f54=0x1;var _0x23013f=[];_0x23013f[_0x5bd1('0x91')](new Extension(_0x297e71,_0xd98f54,'',_0x5bd1('0x92')));_0xd98f54+=0x1;_0x23013f['push'](new Extension(_0x297e71,_0xd98f54,'CDR(type)=inbound-fax',_0x5bd1('0x93')));_0xd98f54+=0x1;for(var _0x97a970 in _0x297e71){if(_0x297e71[_0x5bd1('0x4d')](_0x97a970)&&(_0x97a970===_0x5bd1('0x94')||_0x97a970==='localstationid'||_0x97a970===_0x5bd1('0x95')||_0x97a970==='faxdetect'||_0x97a970===_0x5bd1('0x96')||_0x97a970===_0x5bd1('0x97')||_0x97a970===_0x5bd1('0x98')||_0x97a970==='modem'||_0x97a970===_0x5bd1('0x99'))){_0x23013f[_0x5bd1('0x91')](new Extension(_0x297e71,_0xd98f54,_0x5bd1('0x9a')+_0x97a970+')='+_0x297e71[_0x97a970],_0x5bd1('0x93')));_0xd98f54+=0x1;}}_0x23013f[_0x5bd1('0x91')](new Extension(_0x297e71,_0xd98f54,'6','Wait'));_0xd98f54+=0x1;_0x23013f[_0x5bd1('0x91')](new Extension(_0x297e71,_0xd98f54,_0x5bd1('0x9b'),'ReceiveFax'));_0xd98f54=0x0;return _0x23013f;}exports[_0x5bd1('0x9c')]=function(_0x370e36,_0xdcce88,_0x1abeac){var _0x40f59d;return db[_0x5bd1('0x85')][_0x5bd1('0x9d')](function(_0x36b2f9){return db[_0x5bd1('0x57')][_0x5bd1('0x64')](_0x370e36['body'],{'transaction':_0x36b2f9})[_0x5bd1('0x37')](function(_0x2ad66a){_0x40f59d=_0x2ad66a[_0x5bd1('0x38')]({'plain':!![]});return db[_0x5bd1('0x9e')][_0x5bd1('0x9f')](createExtensionsReciveFax(_0x40f59d),{'transaction':_0x36b2f9});});})[_0x5bd1('0x37')](function(){return _0x40f59d;})[_0x5bd1('0x37')](respondWithResult(_0xdcce88,null))[_0x5bd1('0x65')](handleError(_0xdcce88,null));};exports[_0x5bd1('0xa0')]=function(_0x4bcaa9,_0x5e0811,_0x4f900b){var _0xa17220;return db[_0x5bd1('0x85')][_0x5bd1('0x9d')](function(_0x1db84f){return db['FaxAccount'][_0x5bd1('0x36')](_0x4bcaa9[_0x5bd1('0x5e')],{'where':{'id':_0x4bcaa9[_0x5bd1('0x5e')]['id']},'transaction':_0x1db84f})[_0x5bd1('0x37')](function(_0x1883c9){return db['VoiceExtension'][_0x5bd1('0x3b')]({'where':{'FaxAccountId':_0x4bcaa9[_0x5bd1('0x5e')]['id']},'transaction':_0x1db84f})[_0x5bd1('0x37')](function(_0x30864b){return db[_0x5bd1('0x9e')]['bulkCreate'](createExtensionsReciveFax(_[_0x5bd1('0x78')](_0x4bcaa9[_0x5bd1('0x5e')],['tech',_0x5bd1('0x44'),_0x5bd1('0xa1'),_0x5bd1('0xa2'),_0x5bd1('0xa3'),'ListId'])),{'transaction':_0x1db84f});});});})['then'](function(){return db[_0x5bd1('0x57')]['findById'](_0x4bcaa9['body']['id']);})['then'](respondWithResult(_0x5e0811,null))[_0x5bd1('0x65')](handleError(_0x5e0811,null));};exports[_0x5bd1('0xa4')]=function(_0x5995b5,_0x195e0c,_0xa3e131){var _0x15f2d0={'raw':!![],'where':{}};var _0x88db38={};var _0x142ff5={'count':0x0,'rows':[]};return db[_0x5bd1('0x57')][_0x5bd1('0x6c')]({'where':{'id':_0x5995b5['params']['id']}})['then'](handleEntityNotFound(_0x195e0c,null))[_0x5bd1('0x37')](function(_0x191223){if(_0x191223){_0x88db38[_0x5bd1('0x45')]=_[_0x5bd1('0x48')](db['FaxMessage'][_0x5bd1('0x42')]);_0x88db38[_0x5bd1('0x47')]=_['keys'](_0x5995b5[_0x5bd1('0x47')]);_0x88db38[_0x5bd1('0x49')]=_[_0x5bd1('0x4a')](_0x88db38['model'],_0x88db38[_0x5bd1('0x47')]);_0x15f2d0[_0x5bd1('0x4b')]=_[_0x5bd1('0x4a')](_0x88db38[_0x5bd1('0x45')],qs[_0x5bd1('0x4c')](_0x5995b5[_0x5bd1('0x47')][_0x5bd1('0x4c')]));_0x15f2d0[_0x5bd1('0x4b')]=_0x15f2d0['attributes']['length']?_0x15f2d0[_0x5bd1('0x4b')]:_0x88db38[_0x5bd1('0x45')];if(!_0x5995b5[_0x5bd1('0x47')]['hasOwnProperty'](_0x5bd1('0x6e'))){_0x15f2d0[_0x5bd1('0x32')]=qs['limit'](_0x5995b5['query'][_0x5bd1('0x32')]);_0x15f2d0['offset']=qs['offset'](_0x5995b5[_0x5bd1('0x47')]['offset']);}_0x15f2d0[_0x5bd1('0x4e')]=qs['sort'](_0x5995b5[_0x5bd1('0x47')][_0x5bd1('0x4f')]);_0x15f2d0[_0x5bd1('0x50')]=qs[_0x5bd1('0x49')](_[_0x5bd1('0x51')](_0x5995b5[_0x5bd1('0x47')],_0x88db38[_0x5bd1('0x49')]));_0x15f2d0[_0x5bd1('0x50')][_0x5bd1('0x69')]=_0x191223['id'];if(_0x5995b5[_0x5bd1('0x47')]['filter']){_0x15f2d0[_0x5bd1('0x50')]=_[_0x5bd1('0x52')](_0x15f2d0['where'],{'$or':_['map'](_0x15f2d0[_0x5bd1('0x4b')],function(_0x559e90){var _0x53343d={};_0x53343d[_0x559e90]={'$like':'%'+_0x5995b5[_0x5bd1('0x47')][_0x5bd1('0x55')]+'%'};return _0x53343d;})});}if(_0x5995b5[_0x5bd1('0x47')][_0x5bd1('0xa5')]){var _0x1078ab=_0x5995b5[_0x5bd1('0x47')]['$gte']['split'](',');var _0x213cfb={};_0x213cfb[_0x1078ab[0x0]]={'$gte':moment(_0x1078ab[0x1])['format'](_0x5bd1('0xa6'))};_0x15f2d0[_0x5bd1('0x50')]=_[_0x5bd1('0x52')](_0x15f2d0[_0x5bd1('0x50')],_0x213cfb);}_0x15f2d0=_[_0x5bd1('0x52')]({},_0x15f2d0,_0x5995b5[_0x5bd1('0x56')]);return db[_0x5bd1('0xa7')]['count']({'where':_0x15f2d0[_0x5bd1('0x50')]})[_0x5bd1('0x37')](function(_0x1628f4){_0x142ff5[_0x5bd1('0x30')]=_0x1628f4;if(_0x5995b5['query'][_0x5bd1('0x58')]){_0x15f2d0[_0x5bd1('0x59')]=[{'all':!![]}];}return db[_0x5bd1('0xa7')]['findAll'](_0x15f2d0);})[_0x5bd1('0x37')](function(_0x3387bc){_0x142ff5[_0x5bd1('0x5a')]=_0x3387bc;return _0x142ff5;});}})[_0x5bd1('0x37')](respondWithFilteredResult(_0x195e0c,_0x15f2d0))['catch'](handleError(_0x195e0c,null));};exports[_0x5bd1('0xa8')]=function(_0x195f2f,_0x37bf22,_0x3b71dd){var _0x4f1fea,_0x385f3a={},_0x13b996;if(_0x195f2f['body']['to']){_0x13b996=_0x195f2f[_0x5bd1('0x5e')]['to'][0x0];}return db[_0x5bd1('0x57')]['find']({'where':{'id':_0x195f2f[_0x5bd1('0x5c')]['id']},'include':[{'model':db[_0x5bd1('0xa9')],'as':_0x5bd1('0xaa'),'include':[{'model':db['CmContact'],'as':_0x5bd1('0xab'),'where':{'fax':_0x13b996},'limit':0x1,'order':[[_0x5bd1('0xa2'),'DESC']]}]}]})[_0x5bd1('0x37')](handleEntityNotFound(_0x37bf22,null))[_0x5bd1('0x37')](function(_0x319628){_0x4f1fea=_0x319628;if(_0x195f2f[_0x5bd1('0x5e')]['attachments']&&_0x195f2f[_0x5bd1('0x5e')][_0x5bd1('0xac')][_0x5bd1('0x6d')]){for(var _0x55a1bf=0x0;_0x55a1bf<_0x195f2f['body'][_0x5bd1('0xac')][_0x5bd1('0x6d')];_0x55a1bf+=0x1){_0x195f2f[_0x5bd1('0x5e')][_0x5bd1('0xac')][_0x55a1bf]={'filename':_0x195f2f[_0x5bd1('0x5e')][_0x5bd1('0xac')][_0x55a1bf][_0x5bd1('0x46')],'id':_0x195f2f[_0x5bd1('0x5e')][_0x5bd1('0xac')][_0x55a1bf]['id'],'path':path[_0x5bd1('0xad')](config[_0x5bd1('0xae')],_0x5bd1('0xaf'),_0x195f2f[_0x5bd1('0x5e')]['attachments'][_0x55a1bf][_0x5bd1('0xb0')])};}}return respondWithRpcPromise(_0x5bd1('0xb1'),_0x5bd1('0xb1'),{'FaxAccountId':_[_0x5bd1('0xb2')](_0x195f2f[_0x5bd1('0x5c')]['id'])?undefined:_0x195f2f['params']['id'],'path':_['isNil'](_0x195f2f[_0x5bd1('0x5e')][_0x5bd1('0xac')][0x0][_0x5bd1('0x9')])?undefined:_0x195f2f[_0x5bd1('0x5e')]['attachments'][0x0][_0x5bd1('0x9')],'fax':_[_0x5bd1('0xb2')](_0x195f2f[_0x5bd1('0x5e')]['to'][0x0])?undefined:_0x195f2f[_0x5bd1('0x5e')]['to'][0x0]},client9002);})['then'](function(){if(_0x4f1fea){if(_[_0x5bd1('0xb2')](_0x195f2f['body']['from'])){_0x195f2f['body'][_0x5bd1('0xb3')]=util[_0x5bd1('0xb4')](_0x5bd1('0xb5'),_0x4f1fea[_0x5bd1('0x46')],_0x4f1fea[_0x5bd1('0xb6')]);}if(_0x4f1fea[_0x5bd1('0xaa')]){if(_0x4f1fea[_0x5bd1('0xaa')][_0x5bd1('0xab')][_0x5bd1('0x6d')]){return _0x4f1fea[_0x5bd1('0xaa')][_0x5bd1('0xab')][0x0];}else{return db[_0x5bd1('0x7a')][_0x5bd1('0x64')](_['defaults'](_0x195f2f[_0x5bd1('0x5e')],{'firstName':_0x195f2f[_0x5bd1('0x5e')]['to'][0x0],'phone':_0x195f2f['body']['to'][0x0],'fax':_0x195f2f[_0x5bd1('0x5e')]['to'][0x0],'ListId':_0x4f1fea[_0x5bd1('0xb7')]}));}}else{throw new Error(_0x5bd1('0xb8'));}}else{throw new Error(_0x5bd1('0xb9'));}})[_0x5bd1('0x37')](function(_0x80ce9e){if(_0x80ce9e){return db['FaxInteraction'][_0x5bd1('0x5d')]({'where':{'ContactId':_0x80ce9e['id'],'closed':![],'FaxAccountId':_0x4f1fea['id']}})[_0x5bd1('0x37')](function(_0xd8fb66){if(_0xd8fb66){return[_0xd8fb66,![]];}return db[_0x5bd1('0x77')][_0x5bd1('0x64')]({'UserId':_0x195f2f[_0x5bd1('0x5f')]['id'],'ContactId':_0x80ce9e['id'],'FaxAccountId':_0x4f1fea['id'],'fax':_0x195f2f[_0x5bd1('0x5e')]['to'][0x0],'firstMsgDirection':_0x5bd1('0xba'),'Messages':[_[_0x5bd1('0x52')](_0x195f2f[_0x5bd1('0x5e')],{'read':![],'body':_0x195f2f['body'][_0x5bd1('0xac')][0x0][_0x5bd1('0xbb')],'FaxAccountId':_0x4f1fea['id'],'UserId':_0x195f2f['user']['id'],'ContactId':_0x80ce9e['id'],'AttachmentId':_0x195f2f[_0x5bd1('0x5e')][_0x5bd1('0xac')][0x0]['id']})]},{'include':[{'model':db[_0x5bd1('0xa7')],'as':_0x5bd1('0xbc')}]})[_0x5bd1('0x37')](function(_0x389729){return[_0x389729,!![]];});});}else{throw new Error(_0x5bd1('0xbd'));}})[_0x5bd1('0xbe')](function(_0x1c4e0b,_0x5d9967){if(_0x5d9967){return _0x1c4e0b;}return db[_0x5bd1('0xa7')][_0x5bd1('0x64')]({'direction':_0x5bd1('0xba'),'read':![],'body':_0x195f2f[_0x5bd1('0x5e')][_0x5bd1('0xac')][0x0][_0x5bd1('0xbb')],'FaxAccountId':_0x4f1fea['id'],'FaxInteractionId':_0x1c4e0b['id'],'UserId':_0x195f2f[_0x5bd1('0x5f')]['id'],'ContactId':_0x1c4e0b[_0x5bd1('0xbf')],'AttachmentId':_0x195f2f[_0x5bd1('0x5e')][_0x5bd1('0xac')][0x0]['id']})[_0x5bd1('0x37')](function(_0x25e3b6){_0x1c4e0b['dataValues'][_0x5bd1('0xbc')]=[];_0x1c4e0b['dataValues'][_0x5bd1('0xbc')][_0x5bd1('0x91')](_0x25e3b6[_0x5bd1('0xc0')]);return _0x1c4e0b;});})[_0x5bd1('0x37')](function(_0x59f686){respondWithRpcPromise(_0x5bd1('0xc1'),_0x5bd1('0xc1'),{'FaxAccountId':_[_0x5bd1('0xb2')](_0x195f2f[_0x5bd1('0x5c')]['id'])?undefined:_0x195f2f[_0x5bd1('0x5c')]['id'],'path':_['isNil'](_0x195f2f['body']['attachments'][0x0][_0x5bd1('0x9')])?undefined:_0x195f2f[_0x5bd1('0x5e')]['attachments'][0x0][_0x5bd1('0x9')],'fax':_[_0x5bd1('0xb2')](_0x195f2f['body']['to'][0x0])?undefined:_0x195f2f[_0x5bd1('0x5e')]['to'][0x0],'AttachmentId':_0x195f2f[_0x5bd1('0x5e')][_0x5bd1('0xac')][0x0]['id']},client9002)['then'](function(_0x5f380f){logger['info'](_0x5bd1('0xc2'),_0x5f380f);})[_0x5bd1('0x65')](function(_0x5692cc){logger['info'](_0x5bd1('0xc2'),_0x5692cc);});return _0x59f686;})[_0x5bd1('0x37')](respondWithResult(_0x37bf22,null))[_0x5bd1('0x65')](handleError(_0x37bf22,null));};exports[_0x5bd1('0xc3')]=function(_0x424962,_0x4f768a,_0x4c17d9){return db[_0x5bd1('0x57')][_0x5bd1('0x5d')]({'where':{'id':_0x424962['params']['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x4f768a,null))[_0x5bd1('0x37')](function(_0xf229f4){if(_0xf229f4){return _0xf229f4[_0x5bd1('0xc3')](_0x424962[_0x5bd1('0x5e')][_0x5bd1('0x71')],_[_0x5bd1('0x78')](_0x424962[_0x5bd1('0x5e')],[_0x5bd1('0x71'),'id'])||{})['spread'](function(_0x40badf){for(var _0x1775f1=0x0;_0x1775f1<_0x424962[_0x5bd1('0x5e')][_0x5bd1('0x71')][_0x5bd1('0x6d')];_0x1775f1+=0x1){socket[_0x5bd1('0xc4')]('userFaxAccount:save',{'UserId':_0x424962[_0x5bd1('0x5e')][_0x5bd1('0x71')][_0x1775f1],'FaxAccountId':_0x424962[_0x5bd1('0x5c')]['id']});}return _0x40badf;});}})[_0x5bd1('0x37')](respondWithResult(_0x4f768a,null))[_0x5bd1('0x65')](handleError(_0x4f768a,null));};exports[_0x5bd1('0xc5')]=function(_0x1589a8,_0x1ef337,_0xe179a4){return db[_0x5bd1('0x57')][_0x5bd1('0x5d')]({'where':{'id':_0x1589a8['params']['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x1ef337,null))[_0x5bd1('0x37')](function(_0x51d1c6){if(_0x51d1c6){return _0x51d1c6[_0x5bd1('0xc5')](_0x1589a8[_0x5bd1('0x47')][_0x5bd1('0x71')])['then'](function(){if(_[_0x5bd1('0xc6')](_0x1589a8[_0x5bd1('0x47')]['ids'])){for(var _0x59fd30=0x0;_0x59fd30<_0x1589a8[_0x5bd1('0x47')][_0x5bd1('0x71')][_0x5bd1('0x6d')];_0x59fd30+=0x1){socket[_0x5bd1('0xc4')](_0x5bd1('0xc7'),{'UserId':Number(_0x1589a8[_0x5bd1('0x47')][_0x5bd1('0x71')][_0x59fd30]),'FaxAccountId':Number(_0x1589a8[_0x5bd1('0x5c')]['id'])});}}else{socket[_0x5bd1('0xc4')](_0x5bd1('0xc7'),{'UserId':Number(_0x1589a8['query'][_0x5bd1('0x71')]),'FaxAccountId':Number(_0x1589a8[_0x5bd1('0x5c')]['id'])});}});}})[_0x5bd1('0x37')](respondWithStatusCode(_0x1ef337,null))[_0x5bd1('0x65')](handleError(_0x1ef337,null));};exports[_0x5bd1('0xc8')]=function(_0x14670f,_0x557720,_0x375a39){var _0x2c889c={};var _0xc75efe={};var _0x1e49c6;var _0x54b9f6;return db[_0x5bd1('0x57')][_0x5bd1('0x6c')]({'where':{'id':_0x14670f[_0x5bd1('0x5c')]['id']}})[_0x5bd1('0x37')](handleEntityNotFound(_0x557720,null))[_0x5bd1('0x37')](function(_0x14b513){if(_0x14b513){_0x1e49c6=_0x14b513;_0xc75efe['model']=_['keys'](db[_0x5bd1('0x7c')][_0x5bd1('0x42')]);_0xc75efe[_0x5bd1('0x47')]=_[_0x5bd1('0x48')](_0x14670f['query']);_0xc75efe[_0x5bd1('0x49')]=_[_0x5bd1('0x4a')](_0xc75efe[_0x5bd1('0x45')],_0xc75efe['query']);_0x2c889c['attributes']=_[_0x5bd1('0x4a')](_0xc75efe[_0x5bd1('0x45')],qs[_0x5bd1('0x4c')](_0x14670f[_0x5bd1('0x47')][_0x5bd1('0x4c')]));_0x2c889c[_0x5bd1('0x4b')]=_0x2c889c['attributes'][_0x5bd1('0x6d')]?_0x2c889c['attributes']:_0xc75efe[_0x5bd1('0x45')];_0x2c889c[_0x5bd1('0x4e')]=qs[_0x5bd1('0x4f')](_0x14670f['query']['sort']);_0x2c889c['where']=qs[_0x5bd1('0x49')](_[_0x5bd1('0x51')](_0x14670f[_0x5bd1('0x47')],_0xc75efe[_0x5bd1('0x49')]));if(_0x14670f['query'][_0x5bd1('0x55')]){_0x2c889c[_0x5bd1('0x50')]=_[_0x5bd1('0x52')](_0x2c889c['where'],{'$or':_[_0x5bd1('0x41')](_0x2c889c[_0x5bd1('0x4b')],function(_0x3a9987){var _0x491b48={};_0x491b48[_0x3a9987]={'$like':'%'+_0x14670f['query']['filter']+'%'};return _0x491b48;})});}_0x2c889c=_[_0x5bd1('0x52')]({},_0x2c889c,_0x14670f[_0x5bd1('0x56')]);return _0x1e49c6[_0x5bd1('0xc8')](_0x2c889c);}})[_0x5bd1('0x37')](function(_0x44aad7){if(_0x44aad7){_0x54b9f6=_0x44aad7[_0x5bd1('0x6d')];if(!_0x14670f[_0x5bd1('0x47')]['hasOwnProperty']('nolimit')){_0x2c889c[_0x5bd1('0x32')]=qs['limit'](_0x14670f[_0x5bd1('0x47')]['limit']);_0x2c889c[_0x5bd1('0x31')]=qs[_0x5bd1('0x31')](_0x14670f['query'][_0x5bd1('0x31')]);}return _0x1e49c6[_0x5bd1('0xc8')](_0x2c889c);}})[_0x5bd1('0x37')](function(_0x49b146){if(_0x49b146){return _0x49b146?{'count':_0x54b9f6,'rows':_0x49b146}:null;}})[_0x5bd1('0x37')](respondWithResult(_0x557720,null))[_0x5bd1('0x65')](handleError(_0x557720,null));};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js
index ed444f3..c9fadfa 100644
--- a/server/api/faxAccount/faxAccount.events.js
+++ b/server/api/faxAccount/faxAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd55b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x16b0d4,_0x103f31){var _0x810c45=function(_0x1a725a){while(--_0x1a725a){_0x16b0d4['push'](_0x16b0d4['shift']());}};_0x810c45(++_0x103f31);}(_0xd55b,0x119));var _0xbd55=function(_0x172012,_0x5f3400){_0x172012=_0x172012-0x0;var _0x284f99=_0xd55b[_0x172012];return _0x284f99;};'use strict';var EventEmitter=require(_0xbd55('0x0'));var FaxAccount=require(_0xbd55('0x1'))['db'][_0xbd55('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xbd55('0x3')](0x0);var events={'afterCreate':_0xbd55('0x4'),'afterUpdate':_0xbd55('0x5'),'afterDestroy':_0xbd55('0x6')};function emitEvent(_0x4c3fd1){return function(_0x6b8002,_0x38da4b,_0x578967){FaxAccountEvents[_0xbd55('0x7')](_0x4c3fd1+':'+_0x6b8002['id'],_0x6b8002);FaxAccountEvents[_0xbd55('0x7')](_0x4c3fd1,_0x6b8002);_0x578967(null);};}for(var e in events){if(events[_0xbd55('0x8')](e)){var event=events[e];FaxAccount[_0xbd55('0x9')](e,emitEvent(event));}}module[_0xbd55('0xa')]=FaxAccountEvents;
\ No newline at end of file
+var _0xc518=['emit','hasOwnProperty','hook','exports','FaxAccount','save','update','remove'];(function(_0x594510,_0x31145e){var _0x101cd3=function(_0x1a9a9e){while(--_0x1a9a9e){_0x594510['push'](_0x594510['shift']());}};_0x101cd3(++_0x31145e);}(_0xc518,0x94));var _0x8c51=function(_0x47dff0,_0x19c0f1){_0x47dff0=_0x47dff0-0x0;var _0x4cbdcd=_0xc518[_0x47dff0];return _0x4cbdcd;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x8c51('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8c51('0x1'),'afterUpdate':_0x8c51('0x2'),'afterDestroy':_0x8c51('0x3')};function emitEvent(_0x109ecd){return function(_0x509235,_0x51b5d9,_0x28d2eb){FaxAccountEvents[_0x8c51('0x4')](_0x109ecd+':'+_0x509235['id'],_0x509235);FaxAccountEvents[_0x8c51('0x4')](_0x109ecd,_0x509235);_0x28d2eb(null);};}for(var e in events){if(events[_0x8c51('0x5')](e)){var event=events[e];FaxAccount[_0x8c51('0x6')](e,emitEvent(event));}}module[_0x8c51('0x7')]=FaxAccountEvents;
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js
index 683a7e3..42728b6 100644
--- a/server/api/faxAccount/faxAccount.model.js
+++ b/server/api/faxAccount/faxAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7bb8=['path','rimraf','../../config/environment','./faxAccount.attributes','exports','fax_accounts','util','../../config/logger','moment','request-promise'];(function(_0x3ea128,_0x298f3d){var _0x5c46bf=function(_0x278d52){while(--_0x278d52){_0x3ea128['push'](_0x3ea128['shift']());}};_0x5c46bf(++_0x298f3d);}(_0x7bb8,0x1dc));var _0x87bb=function(_0x153c3a,_0x34b730){_0x153c3a=_0x153c3a-0x0;var _0x5a1f7a=_0x7bb8[_0x153c3a];return _0x5a1f7a;};'use strict';var _=require('lodash');var util=require(_0x87bb('0x0'));var logger=require(_0x87bb('0x1'))('api');var moment=require(_0x87bb('0x2'));var BPromise=require('bluebird');var rp=require(_0x87bb('0x3'));var fs=require('fs');var path=require(_0x87bb('0x4'));var rimraf=require(_0x87bb('0x5'));var config=require(_0x87bb('0x6'));var attributes=require(_0x87bb('0x7'));module[_0x87bb('0x8')]=function(_0x131193,_0x2cdb55){return _0x131193['define']('FaxAccount',attributes,{'tableName':_0x87bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf55=['FaxAccount','fax_accounts','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0xaf55,0xa7));var _0x5af5=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xaf55[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x5af5('0x0'));var util=require(_0x5af5('0x1'));var logger=require('../../config/logger')(_0x5af5('0x2'));var moment=require(_0x5af5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5af5('0x4'));var fs=require('fs');var path=require(_0x5af5('0x5'));var rimraf=require(_0x5af5('0x6'));var config=require(_0x5af5('0x7'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x17b485,_0x58e6eb){return _0x17b485[_0x5af5('0x8')](_0x5af5('0x9'),attributes,{'tableName':_0x5af5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js
index a2e9322..959069c 100644
--- a/server/api/faxAccount/faxAccount.rpc.js
+++ b/server/api/faxAccount/faxAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc38=['redis','defaults','localhost','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','model','map','then','catch','NotifyFaxAccount','body','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmContact','Contacts','DESC','Applications','List','get','applications','priority','asc','length','ListId','contact','fax','find','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','create','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xbc38,0x157));var _0x8bc3=function(_0x4cb618,_0x3226c8){_0x4cb618=_0x4cb618-0x0;var _0x49570a=_0xbc38[_0x4cb618];return _0x49570a;};'use strict';var _=require('lodash');var util=require(_0x8bc3('0x0'));var moment=require(_0x8bc3('0x1'));var BPromise=require(_0x8bc3('0x2'));var rs=require(_0x8bc3('0x3'));var fs=require('fs');var Redis=require(_0x8bc3('0x4'));var db=require(_0x8bc3('0x5'))['db'];var utils=require(_0x8bc3('0x6'));var logger=require(_0x8bc3('0x7'))(_0x8bc3('0x8'));var config=require(_0x8bc3('0x9'));var jayson=require(_0x8bc3('0xa'));var client=jayson[_0x8bc3('0xb')][_0x8bc3('0xc')]({'port':0x232c});config[_0x8bc3('0xd')]=_[_0x8bc3('0xe')](config[_0x8bc3('0xd')],{'host':_0x8bc3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8bc3('0xd')]));require('./faxAccount.socket')[_0x8bc3('0x10')](socket);function respondWithRpcPromise(_0x1b8647,_0x57db17,_0x1dbae3){return new BPromise(function(_0x5e6995,_0x1ef966){return client[_0x8bc3('0x11')](_0x1b8647,_0x1dbae3)['then'](function(_0x503088){logger[_0x8bc3('0x12')](_0x8bc3('0x13'),_0x57db17,_0x8bc3('0x14'));logger[_0x8bc3('0x15')](_0x8bc3('0x16'),_0x57db17,_0x8bc3('0x14'),JSON[_0x8bc3('0x17')](_0x503088));if(_0x503088[_0x8bc3('0x18')]){if(_0x503088[_0x8bc3('0x18')]['code']===0x1f4){logger['error'](_0x8bc3('0x13'),_0x57db17,_0x503088[_0x8bc3('0x18')][_0x8bc3('0x19')]);return _0x1ef966(_0x503088['error']['message']);}logger[_0x8bc3('0x18')]('FaxAccount,\x20%s,\x20%s',_0x57db17,_0x503088[_0x8bc3('0x18')][_0x8bc3('0x19')]);return _0x5e6995(_0x503088[_0x8bc3('0x18')][_0x8bc3('0x19')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x57db17,'request\x20sent');_0x5e6995(_0x503088[_0x8bc3('0x1a')][_0x8bc3('0x19')]);}})['catch'](function(_0x226a56){logger[_0x8bc3('0x18')]('FaxAccount,\x20%s,\x20%s',_0x57db17,_0x226a56);_0x1ef966(_0x226a56);});});}exports[_0x8bc3('0x1b')]=function(_0x1de049){var _0x4701f1=this;return new Promise(function(_0x3ddc06,_0xc70210){return db[_0x8bc3('0x1c')]['findAll']({'raw':_0x1de049[_0x8bc3('0x1d')]?_0x1de049[_0x8bc3('0x1d')][_0x8bc3('0x1e')]===undefined?!![]:![]:!![],'where':_0x1de049[_0x8bc3('0x1d')]?_0x1de049['options'][_0x8bc3('0x1f')]||null:null,'attributes':_0x1de049[_0x8bc3('0x1d')]?_0x1de049[_0x8bc3('0x1d')][_0x8bc3('0x20')]||null:null,'limit':_0x1de049[_0x8bc3('0x1d')]?_0x1de049[_0x8bc3('0x1d')][_0x8bc3('0x21')]||null:null,'include':_0x1de049['options']?_0x1de049['options'][_0x8bc3('0x22')]?_['map'](_0x1de049['options'][_0x8bc3('0x22')],function(_0x3aadb9){return{'model':db[_0x3aadb9[_0x8bc3('0x23')]],'as':_0x3aadb9['as'],'attributes':_0x3aadb9[_0x8bc3('0x20')],'include':_0x3aadb9['include']?_['map'](_0x3aadb9['include'],function(_0x39fdbb){return{'model':db[_0x39fdbb[_0x8bc3('0x23')]],'as':_0x39fdbb['as'],'attributes':_0x39fdbb[_0x8bc3('0x20')],'include':_0x39fdbb[_0x8bc3('0x22')]?_[_0x8bc3('0x24')](_0x39fdbb['include'],function(_0x2c4387){return{'model':db[_0x2c4387[_0x8bc3('0x23')]],'as':_0x2c4387['as'],'attributes':_0x2c4387[_0x8bc3('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8bc3('0x25')](function(_0x47d468){logger[_0x8bc3('0x12')](_0x8bc3('0x1b'),_0x1de049);logger[_0x8bc3('0x15')](_0x8bc3('0x1b'),_0x1de049,JSON['stringify'](_0x47d468));_0x3ddc06(_0x47d468);})[_0x8bc3('0x26')](function(_0xdaa6b1){logger['error']('GetFaxAccount',_0xdaa6b1[_0x8bc3('0x19')],_0x1de049);_0xc70210(_0x4701f1[_0x8bc3('0x18')](0x1f4,_0xdaa6b1[_0x8bc3('0x19')]));});});};exports[_0x8bc3('0x27')]=function(_0x1e16de,_0x2631d9,_0x508bbc){var _0x494221=this;return new Promise(function(_0x14f0a2,_0x2baa44){var _0x37d8d3={'body':_0x1e16de[_0x8bc3('0x28')],'channel':'fax'};var _0x4f882d=[];var _0x4b2068=[];var _0x29085f={};return db['CmContact'][_0x8bc3('0x29')]()[_0x8bc3('0x25')](function(_0x5ab618){if(!_0x5ab618){throw new db[(_0x8bc3('0x2a'))][(_0x8bc3('0x2b'))](_0x8bc3('0x2c'));}_0x4f882d=_[_0x8bc3('0x2d')](_[_0x8bc3('0x2e')](_0x5ab618),[_0x8bc3('0x2f'),_0x8bc3('0x30')]);_0x4b2068=_[_0x8bc3('0x2d')](_['keys'](_0x5ab618),['createdAt',_0x8bc3('0x30'),_0x8bc3('0x31'),'ListId']);if(_0x1e16de[_0x8bc3('0x28')]['id']){delete _0x1e16de[_0x8bc3('0x28')]['id'];}if(_[_0x8bc3('0x32')](_0x1e16de[_0x8bc3('0x28')][_0x8bc3('0x33')])){throw new db[(_0x8bc3('0x2a'))][(_0x8bc3('0x2b'))]('from\x20is\x20mandatory');}if(_[_0x8bc3('0x32')](_0x1e16de['body'][_0x8bc3('0x28')])||_0x1e16de['body']['body']===''){throw new db['Sequelize']['ValidationError'](_0x8bc3('0x34'));}if(_[_0x8bc3('0x32')](_0x1e16de['body'][_0x8bc3('0x35')])){throw new db[(_0x8bc3('0x2a'))][(_0x8bc3('0x2b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b2068);}if(!_[_0x8bc3('0x36')](_0x4b2068,_0x1e16de[_0x8bc3('0x28')][_0x8bc3('0x35')])){throw new db['Sequelize'][(_0x8bc3('0x2b'))](_0x8bc3('0x37')+_0x4b2068);}_0x29085f[_0x1e16de[_0x8bc3('0x28')][_0x8bc3('0x35')]]=_0x1e16de['body'][_0x8bc3('0x33')];})['then'](function(){return db[_0x8bc3('0x1c')]['find']({'where':{'id':_0x1e16de[_0x8bc3('0x38')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8bc3('0x39')],'as':_0x8bc3('0x3a'),'where':_0x29085f,'limit':0x1,'order':[[_0x8bc3('0x30'),_0x8bc3('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0x8bc3('0x3c')}]});})[_0x8bc3('0x25')](function(_0x5ecfeb){if(_0x5ecfeb&&_0x5ecfeb[_0x8bc3('0x3d')]){var _0x5d8464=_0x5ecfeb[_0x8bc3('0x3e')]({'plain':!![]});_0x37d8d3[_0x8bc3('0x38')]=_0x5d8464;_0x37d8d3['applications']=_0x5d8464[_0x8bc3('0x3c')];_0x37d8d3['list']=_0x5d8464[_0x8bc3('0x3d')];_0x37d8d3['applications']=_['orderBy'](_0x37d8d3[_0x8bc3('0x3f')],[_0x8bc3('0x40')],[_0x8bc3('0x41')]);if(_0x37d8d3['account'][_0x8bc3('0x3c')]){delete _0x37d8d3[_0x8bc3('0x38')]['Applications'];}if(_0x37d8d3[_0x8bc3('0x38')][_0x8bc3('0x3d')]&&_0x37d8d3[_0x8bc3('0x38')][_0x8bc3('0x3d')][_0x8bc3('0x3a')][_0x8bc3('0x42')]){return _0x37d8d3[_0x8bc3('0x38')][_0x8bc3('0x3d')][_0x8bc3('0x3a')][0x0];}var _0x369976=_[_0x8bc3('0xe')](_0x1e16de['body'],{'firstName':_0x1e16de[_0x8bc3('0x28')][_0x8bc3('0x33')],'ListId':_0x5d8464[_0x8bc3('0x43')]});_0x369976[_0x1e16de[_0x8bc3('0x28')][_0x8bc3('0x35')]]=_0x1e16de['body'][_0x8bc3('0x33')];return db[_0x8bc3('0x39')]['create'](_0x369976,{'fields':_0x4f882d,'raw':!![]});}})[_0x8bc3('0x25')](function(_0x416ab1){_0x37d8d3[_0x8bc3('0x44')]=_0x416ab1;if(_0x416ab1){var _0x25d0d1={'ContactId':_0x416ab1['id'],'FaxAccountId':_0x1e16de['account']['id'],'fax':_0x416ab1[_0x8bc3('0x45')]};return db['FaxInteraction'][_0x8bc3('0x46')]({'where':{'ContactId':_0x416ab1['id'],'closed':![],'FaxAccountId':_0x1e16de['account']['id']}})[_0x8bc3('0x25')](function(_0x31c707){if(_0x31c707){return[_0x31c707,![]];}return db[_0x8bc3('0x47')]['create'](_0x25d0d1)['then'](function(_0x525368){return[_0x525368,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8bc3('0x48')](function(_0x862754,_0x209f36){var _0x4f71a0=_0x862754[_0x8bc3('0x3e')]({'plain':!![]});if(_0x209f36){if(_0x37d8d3[_0x8bc3('0x38')][_0x8bc3('0x49')]){_0x37d8d3[_0x8bc3('0x3f')][_0x8bc3('0x4a')]({'id':0x0,'priority':_0x37d8d3[_0x8bc3('0x3f')][_0x8bc3('0x42')]+0x1,'app':_0x8bc3('0x4b'),'appdata':_0x8bc3('0x4c'),'interval':_0x8bc3('0x4d')});}_0x4f71a0['created']=!![];}else{_0x4f71a0[_0x8bc3('0x4e')]=![];}_0x37d8d3[_0x8bc3('0x4f')]=_0x4f71a0;return db['FaxMessage'][_0x8bc3('0x50')]({'body':_0x1e16de[_0x8bc3('0x28')][_0x8bc3('0x28')],'FaxAccountId':_0x1e16de['account']['id'],'FaxInteractionId':_0x862754['id'],'direction':'in','ContactId':_0x862754['ContactId'],'AttachmentId':_0x1e16de[_0x8bc3('0x28')][_0x8bc3('0x51')]});})[_0x8bc3('0x25')](function(_0x1d6cc2){_0x37d8d3[_0x8bc3('0x19')]=_0x1d6cc2;if(_0x37d8d3[_0x8bc3('0x4f')]['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x37d8d3[_0x8bc3('0x4f')][_0x8bc3('0x52')]}})[_0x8bc3('0x25')](function(_0x78d7bd){if(_0x78d7bd){_0x37d8d3['applications'][_0x8bc3('0x53')]({'id':0x0,'priority':0x0,'app':_0x8bc3('0x54'),'appdata':_0x78d7bd[_0x8bc3('0x55')]+','+(_0x37d8d3[_0x8bc3('0x38')][_0x8bc3('0x56')]||0xa),'interval':_0x8bc3('0x4d')});}return respondWithRpcPromise(_0x8bc3('0x57'),_0x8bc3('0x58'),_0x37d8d3);});}return respondWithRpcPromise(_0x8bc3('0x57'),_0x8bc3('0x58'),_0x37d8d3);})[_0x8bc3('0x25')](function(_0x33d360){_0x14f0a2(_0x33d360);})[_0x8bc3('0x26')](function(_0x21d280){_0x2baa44(_0x494221[_0x8bc3('0x18')](0x1f4,_0x21d280[_0x8bc3('0x19')]));});});};
\ No newline at end of file
+var _0x6e43=['CmList','List','Contacts','DESC','FaxApplication','get','account','applications','Applications','list','priority','asc','length','contact','FaxInteraction','Contact\x20not\x20found','spread','close','unmanaged','created','interaction','create','ContactId','UserId','User','name','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxAccount','options','raw','where','attributes','include','map','model','GetFaxAccount','NotifyFaxAccount','body','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find'];(function(_0x81f98c,_0x424e02){var _0x54894f=function(_0x4e56f4){while(--_0x4e56f4){_0x81f98c['push'](_0x81f98c['shift']());}};_0x54894f(++_0x424e02);}(_0x6e43,0x127));var _0x36e4=function(_0x5d4d25,_0x33fb5d){_0x5d4d25=_0x5d4d25-0x0;var _0x29f346=_0x6e43[_0x5d4d25];return _0x29f346;};'use strict';var _=require(_0x36e4('0x0'));var util=require(_0x36e4('0x1'));var moment=require('moment');var BPromise=require(_0x36e4('0x2'));var rs=require(_0x36e4('0x3'));var fs=require('fs');var Redis=require(_0x36e4('0x4'));var db=require(_0x36e4('0x5'))['db'];var utils=require(_0x36e4('0x6'));var logger=require(_0x36e4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x36e4('0x8'));var client=jayson[_0x36e4('0x9')]['http']({'port':0x232c});config[_0x36e4('0xa')]=_[_0x36e4('0xb')](config[_0x36e4('0xa')],{'host':_0x36e4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x36e4('0xa')]));require('./faxAccount.socket')[_0x36e4('0xd')](socket);function respondWithRpcPromise(_0x445dc4,_0x455cd3,_0x35dfa5){return new BPromise(function(_0xa676aa,_0x8b2e6){return client[_0x36e4('0xe')](_0x445dc4,_0x35dfa5)[_0x36e4('0xf')](function(_0x4b8a08){logger[_0x36e4('0x10')](_0x36e4('0x11'),_0x455cd3,'request\x20sent');logger[_0x36e4('0x12')](_0x36e4('0x13'),_0x455cd3,_0x36e4('0x14'),JSON[_0x36e4('0x15')](_0x4b8a08));if(_0x4b8a08['error']){if(_0x4b8a08[_0x36e4('0x16')][_0x36e4('0x17')]===0x1f4){logger[_0x36e4('0x16')](_0x36e4('0x11'),_0x455cd3,_0x4b8a08[_0x36e4('0x16')]['message']);return _0x8b2e6(_0x4b8a08[_0x36e4('0x16')][_0x36e4('0x18')]);}logger[_0x36e4('0x16')]('FaxAccount,\x20%s,\x20%s',_0x455cd3,_0x4b8a08['error']['message']);return _0xa676aa(_0x4b8a08[_0x36e4('0x16')]['message']);}else{logger[_0x36e4('0x10')](_0x36e4('0x11'),_0x455cd3,_0x36e4('0x14'));_0xa676aa(_0x4b8a08[_0x36e4('0x19')][_0x36e4('0x18')]);}})[_0x36e4('0x1a')](function(_0x64f803){logger[_0x36e4('0x16')](_0x36e4('0x11'),_0x455cd3,_0x64f803);_0x8b2e6(_0x64f803);});});}exports['GetFaxAccount']=function(_0x4fa6f8){var _0x535e23=this;return new Promise(function(_0x2387cf,_0x1df8df){return db[_0x36e4('0x1b')]['findAll']({'raw':_0x4fa6f8[_0x36e4('0x1c')]?_0x4fa6f8[_0x36e4('0x1c')][_0x36e4('0x1d')]===undefined?!![]:![]:!![],'where':_0x4fa6f8[_0x36e4('0x1c')]?_0x4fa6f8[_0x36e4('0x1c')][_0x36e4('0x1e')]||null:null,'attributes':_0x4fa6f8['options']?_0x4fa6f8[_0x36e4('0x1c')][_0x36e4('0x1f')]||null:null,'limit':_0x4fa6f8['options']?_0x4fa6f8[_0x36e4('0x1c')]['limit']||null:null,'include':_0x4fa6f8[_0x36e4('0x1c')]?_0x4fa6f8['options']['include']?_['map'](_0x4fa6f8[_0x36e4('0x1c')][_0x36e4('0x20')],function(_0x4913ac){return{'model':db[_0x4913ac['model']],'as':_0x4913ac['as'],'attributes':_0x4913ac[_0x36e4('0x1f')],'include':_0x4913ac['include']?_[_0x36e4('0x21')](_0x4913ac[_0x36e4('0x20')],function(_0x4f8070){return{'model':db[_0x4f8070[_0x36e4('0x22')]],'as':_0x4f8070['as'],'attributes':_0x4f8070[_0x36e4('0x1f')],'include':_0x4f8070[_0x36e4('0x20')]?_[_0x36e4('0x21')](_0x4f8070[_0x36e4('0x20')],function(_0x4cdc43){return{'model':db[_0x4cdc43['model']],'as':_0x4cdc43['as'],'attributes':_0x4cdc43[_0x36e4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x36e4('0xf')](function(_0x500c6e){logger['info'](_0x36e4('0x23'),_0x4fa6f8);logger[_0x36e4('0x12')](_0x36e4('0x23'),_0x4fa6f8,JSON[_0x36e4('0x15')](_0x500c6e));_0x2387cf(_0x500c6e);})[_0x36e4('0x1a')](function(_0x34d4b2){logger[_0x36e4('0x16')]('GetFaxAccount',_0x34d4b2['message'],_0x4fa6f8);_0x1df8df(_0x535e23[_0x36e4('0x16')](0x1f4,_0x34d4b2[_0x36e4('0x18')]));});});};exports[_0x36e4('0x24')]=function(_0x25dc05,_0x58e8e2,_0x78561a){var _0x2e539d=this;return new Promise(function(_0x153c00,_0x57c0bd){var _0x1910b6={'body':_0x25dc05[_0x36e4('0x25')],'channel':'fax'};var _0x1978b3=[];var _0x4f6255=[];var _0x2eec35={};return db[_0x36e4('0x26')][_0x36e4('0x27')]()[_0x36e4('0xf')](function(_0x13aa62){if(!_0x13aa62){throw new db['Sequelize'][(_0x36e4('0x28'))](_0x36e4('0x29'));}_0x1978b3=_[_0x36e4('0x2a')](_['keys'](_0x13aa62),[_0x36e4('0x2b'),_0x36e4('0x2c')]);_0x4f6255=_['difference'](_['keys'](_0x13aa62),[_0x36e4('0x2b'),_0x36e4('0x2c'),_0x36e4('0x2d'),_0x36e4('0x2e')]);if(_0x25dc05[_0x36e4('0x25')]['id']){delete _0x25dc05[_0x36e4('0x25')]['id'];}if(_[_0x36e4('0x2f')](_0x25dc05['body'][_0x36e4('0x30')])){throw new db[(_0x36e4('0x31'))][(_0x36e4('0x28'))](_0x36e4('0x32'));}if(_['isNil'](_0x25dc05[_0x36e4('0x25')][_0x36e4('0x25')])||_0x25dc05[_0x36e4('0x25')][_0x36e4('0x25')]===''){throw new db['Sequelize'][(_0x36e4('0x28'))](_0x36e4('0x33'));}if(_[_0x36e4('0x2f')](_0x25dc05[_0x36e4('0x25')]['mapKey'])){throw new db[(_0x36e4('0x31'))][(_0x36e4('0x28'))](_0x36e4('0x34')+_0x4f6255);}if(!_[_0x36e4('0x35')](_0x4f6255,_0x25dc05[_0x36e4('0x25')][_0x36e4('0x36')])){throw new db[(_0x36e4('0x31'))][(_0x36e4('0x28'))](_0x36e4('0x37')+_0x4f6255);}_0x2eec35[_0x25dc05[_0x36e4('0x25')]['mapKey']]=_0x25dc05['body'][_0x36e4('0x30')];})['then'](function(){return db[_0x36e4('0x1b')][_0x36e4('0x38')]({'where':{'id':_0x25dc05['account']['id']},'include':[{'model':db[_0x36e4('0x39')],'as':_0x36e4('0x3a'),'include':[{'model':db[_0x36e4('0x26')],'as':_0x36e4('0x3b'),'where':_0x2eec35,'limit':0x1,'order':[[_0x36e4('0x2c'),_0x36e4('0x3c')]]}]},{'model':db[_0x36e4('0x3d')],'as':'Applications'}]});})['then'](function(_0x58f20a){if(_0x58f20a&&_0x58f20a[_0x36e4('0x3a')]){var _0x219a76=_0x58f20a[_0x36e4('0x3e')]({'plain':!![]});_0x1910b6[_0x36e4('0x3f')]=_0x219a76;_0x1910b6[_0x36e4('0x40')]=_0x219a76[_0x36e4('0x41')];_0x1910b6[_0x36e4('0x42')]=_0x219a76['List'];_0x1910b6[_0x36e4('0x40')]=_['orderBy'](_0x1910b6[_0x36e4('0x40')],[_0x36e4('0x43')],[_0x36e4('0x44')]);if(_0x1910b6[_0x36e4('0x3f')]['Applications']){delete _0x1910b6[_0x36e4('0x3f')][_0x36e4('0x41')];}if(_0x1910b6[_0x36e4('0x3f')][_0x36e4('0x3a')]&&_0x1910b6['account']['List'][_0x36e4('0x3b')][_0x36e4('0x45')]){return _0x1910b6[_0x36e4('0x3f')]['List'][_0x36e4('0x3b')][0x0];}var _0x4cc0de=_[_0x36e4('0xb')](_0x25dc05[_0x36e4('0x25')],{'firstName':_0x25dc05[_0x36e4('0x25')]['from'],'ListId':_0x219a76[_0x36e4('0x2e')]});_0x4cc0de[_0x25dc05['body'][_0x36e4('0x36')]]=_0x25dc05['body'][_0x36e4('0x30')];return db['CmContact']['create'](_0x4cc0de,{'fields':_0x1978b3,'raw':!![]});}})[_0x36e4('0xf')](function(_0x5adab3){_0x1910b6[_0x36e4('0x46')]=_0x5adab3;if(_0x5adab3){var _0x19e361={'ContactId':_0x5adab3['id'],'FaxAccountId':_0x25dc05[_0x36e4('0x3f')]['id'],'fax':_0x5adab3['fax']};return db[_0x36e4('0x47')][_0x36e4('0x38')]({'where':{'ContactId':_0x5adab3['id'],'closed':![],'FaxAccountId':_0x25dc05['account']['id']}})[_0x36e4('0xf')](function(_0xd7e9f6){if(_0xd7e9f6){return[_0xd7e9f6,![]];}return db[_0x36e4('0x47')]['create'](_0x19e361)[_0x36e4('0xf')](function(_0x320e43){return[_0x320e43,!![]];});});}else{throw new Error(_0x36e4('0x48'));}})[_0x36e4('0x49')](function(_0x389207,_0x3dab2d){var _0xafc90a=_0x389207['get']({'plain':!![]});if(_0x3dab2d){if(_0x1910b6['account']['autoclose']){_0x1910b6[_0x36e4('0x40')]['push']({'id':0x0,'priority':_0x1910b6[_0x36e4('0x40')][_0x36e4('0x45')]+0x1,'app':_0x36e4('0x4a'),'appdata':_0x36e4('0x4b'),'interval':'*,*,*,*'});}_0xafc90a[_0x36e4('0x4c')]=!![];}else{_0xafc90a[_0x36e4('0x4c')]=![];}_0x1910b6[_0x36e4('0x4d')]=_0xafc90a;return db['FaxMessage'][_0x36e4('0x4e')]({'body':_0x25dc05[_0x36e4('0x25')][_0x36e4('0x25')],'FaxAccountId':_0x25dc05[_0x36e4('0x3f')]['id'],'FaxInteractionId':_0x389207['id'],'direction':'in','ContactId':_0x389207[_0x36e4('0x4f')],'AttachmentId':_0x25dc05[_0x36e4('0x25')]['AttachmentId']});})[_0x36e4('0xf')](function(_0x5ef540){_0x1910b6['message']=_0x5ef540;if(_0x1910b6[_0x36e4('0x4d')][_0x36e4('0x50')]){return db[_0x36e4('0x51')][_0x36e4('0x38')]({'attributes':['id',_0x36e4('0x52')],'where':{'id':_0x1910b6[_0x36e4('0x4d')][_0x36e4('0x50')]}})[_0x36e4('0xf')](function(_0x27a1e0){if(_0x27a1e0){_0x1910b6['applications'][_0x36e4('0x53')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x27a1e0[_0x36e4('0x52')]+','+(_0x1910b6[_0x36e4('0x3f')][_0x36e4('0x54')]||0xa),'interval':_0x36e4('0x55')});}return respondWithRpcPromise(_0x36e4('0x56'),_0x36e4('0x57'),_0x1910b6);});}return respondWithRpcPromise(_0x36e4('0x56'),'startRouting',_0x1910b6);})[_0x36e4('0xf')](function(_0x5dffa8){_0x153c00(_0x5dffa8);})[_0x36e4('0x1a')](function(_0x1b8a6e){_0x57c0bd(_0x2e539d[_0x36e4('0x16')](0x1f4,_0x1b8a6e[_0x36e4('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js
index 0ef0bff..0f115b5 100644
--- a/server/api/faxAccount/faxAccount.socket.js
+++ b/server/api/faxAccount/faxAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb145=['register','length','faxAccount:','save','remove','update','emit','removeListener'];(function(_0x593467,_0x14e615){var _0x67a71b=function(_0x32799e){while(--_0x32799e){_0x593467['push'](_0x593467['shift']());}};_0x67a71b(++_0x14e615);}(_0xb145,0xa3));var _0x5b14=function(_0x1518f1,_0x45d7e6){_0x1518f1=_0x1518f1-0x0;var _0x95f148=_0xb145[_0x1518f1];return _0x95f148;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x5b14('0x0'),_0x5b14('0x1'),_0x5b14('0x2')];function createListener(_0x1298e7,_0x40609d){return function(_0x3defa8){_0x40609d[_0x5b14('0x3')](_0x1298e7,_0x3defa8);};}function removeListener(_0x34b4cd,_0x5111cd){return function(){FaxAccountEvents[_0x5b14('0x4')](_0x34b4cd,_0x5111cd);};}exports[_0x5b14('0x5')]=function(_0x392425){for(var _0x4d82ad=0x0,_0x50fd91=events[_0x5b14('0x6')];_0x4d82ad<_0x50fd91;_0x4d82ad++){var _0x2a3921=events[_0x4d82ad];var _0x34530a=createListener(_0x5b14('0x7')+_0x2a3921,_0x392425);FaxAccountEvents['on'](_0x2a3921,_0x34530a);}};
\ No newline at end of file
+var _0x33af=['emit','removeListener','register','length','faxAccount:','save','update'];(function(_0x1b6df4,_0x3fefb7){var _0x245412=function(_0x45f1e3){while(--_0x45f1e3){_0x1b6df4['push'](_0x1b6df4['shift']());}};_0x245412(++_0x3fefb7);}(_0x33af,0xec));var _0xf33a=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0x33af[_0x1a0600];return _0x734670;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xf33a('0x0'),'remove',_0xf33a('0x1')];function createListener(_0x1111c6,_0x267057){return function(_0x4303f1){_0x267057[_0xf33a('0x2')](_0x1111c6,_0x4303f1);};}function removeListener(_0x25f156,_0x4c734e){return function(){FaxAccountEvents[_0xf33a('0x3')](_0x25f156,_0x4c734e);};}exports[_0xf33a('0x4')]=function(_0x583e54){for(var _0xc0dd13=0x0,_0x384b14=events[_0xf33a('0x5')];_0xc0dd13<_0x384b14;_0xc0dd13++){var _0x2f3730=events[_0xc0dd13];var _0x2baabb=createListener(_0xf33a('0x6')+_0x2f3730,_0x583e54);FaxAccountEvents['on'](_0x2f3730,_0x2baabb);}};
\ No newline at end of file
diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js
index 340db83..9483f77 100644
--- a/server/api/faxAccount/index.js
+++ b/server/api/faxAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x641b=['addDisposition','addAnswer','addInteraction','addApplications','/updateaccountapplications','/:id/send','send','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create'];(function(_0xf1ed6,_0x5b967f){var _0x43037a=function(_0x24919e){while(--_0x24919e){_0xf1ed6['push'](_0xf1ed6['shift']());}};_0x43037a(++_0x5b967f);}(_0x641b,0x1d2));var _0xb641=function(_0x4c6c78,_0x1cea34){_0x4c6c78=_0x4c6c78-0x0;var _0x403a48=_0x641b[_0x4c6c78];return _0x403a48;};'use strict';var multer=require('multer');var util=require(_0xb641('0x0'));var path=require(_0xb641('0x1'));var timeout=require(_0xb641('0x2'));var express=require(_0xb641('0x3'));var router=express['Router']();var auth=require(_0xb641('0x4'));var interaction=require(_0xb641('0x5'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0xb641('0x6')]('/',auth[_0xb641('0x7')](),controller[_0xb641('0x8')]);router[_0xb641('0x6')](_0xb641('0x9'),auth[_0xb641('0x7')](),controller[_0xb641('0xa')]);router[_0xb641('0x6')](_0xb641('0xb'),auth[_0xb641('0x7')](),controller[_0xb641('0xc')]);router[_0xb641('0x6')](_0xb641('0xd'),auth[_0xb641('0x7')](),controller[_0xb641('0xe')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb641('0xf')]);router[_0xb641('0x6')](_0xb641('0x10'),auth[_0xb641('0x7')](),controller[_0xb641('0x11')]);router[_0xb641('0x6')](_0xb641('0x12'),auth[_0xb641('0x7')](),controller[_0xb641('0x13')]);router[_0xb641('0x6')](_0xb641('0x14'),auth[_0xb641('0x7')](),controller[_0xb641('0x15')]);router[_0xb641('0x6')](_0xb641('0x16'),auth[_0xb641('0x7')](),controller[_0xb641('0x17')]);router[_0xb641('0x18')]('/',auth['isAuthenticated'](),controller[_0xb641('0x19')]);router['post']('/:id/dispositions',auth[_0xb641('0x7')](),controller[_0xb641('0x1a')]);router[_0xb641('0x18')]('/:id/canned_answers',auth[_0xb641('0x7')](),controller[_0xb641('0x1b')]);router[_0xb641('0x18')](_0xb641('0x10'),auth[_0xb641('0x7')](),controller[_0xb641('0x1c')]);router[_0xb641('0x18')](_0xb641('0x12'),auth[_0xb641('0x7')](),controller[_0xb641('0x1d')]);router[_0xb641('0x18')]('/addaccountapplications',auth[_0xb641('0x7')](),controller['addAccountApplications']);router['post'](_0xb641('0x1e'),auth[_0xb641('0x7')](),controller['updateAccountApplications']);router['post'](_0xb641('0x1f'),auth[_0xb641('0x7')](),controller[_0xb641('0x20')]);router['post'](_0xb641('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0xb641('0x21')](_0xb641('0xb'),auth[_0xb641('0x7')](),controller[_0xb641('0x22')]);router[_0xb641('0x23')](_0xb641('0xb'),auth[_0xb641('0x7')](),controller[_0xb641('0x24')]);router[_0xb641('0x23')](_0xb641('0xd'),auth['isAuthenticated'](),controller[_0xb641('0x25')]);router[_0xb641('0x23')](_0xb641('0x26'),auth[_0xb641('0x7')](),controller[_0xb641('0x27')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb641('0x28')]);module['exports']=router;
\ No newline at end of file
+var _0xc7b5=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getApplications','/:id/messages','getMessages','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/users','update','destroy','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','get'];(function(_0x567703,_0x4b1cfa){var _0x1cd94a=function(_0x25dcfe){while(--_0x25dcfe){_0x567703['push'](_0x567703['shift']());}};_0x1cd94a(++_0x4b1cfa);}(_0xc7b5,0x66));var _0x5c7b=function(_0x51fdc3,_0x1867c0){_0x51fdc3=_0x51fdc3-0x0;var _0x367c24=_0xc7b5[_0x51fdc3];return _0x367c24;};'use strict';var multer=require(_0x5c7b('0x0'));var util=require('util');var path=require(_0x5c7b('0x1'));var timeout=require(_0x5c7b('0x2'));var express=require(_0x5c7b('0x3'));var router=express[_0x5c7b('0x4')]();var auth=require(_0x5c7b('0x5'));var interaction=require(_0x5c7b('0x6'));var config=require('../../config/environment');var controller=require(_0x5c7b('0x7'));router[_0x5c7b('0x8')]('/',auth[_0x5c7b('0x9')](),controller[_0x5c7b('0xa')]);router[_0x5c7b('0x8')](_0x5c7b('0xb'),auth[_0x5c7b('0x9')](),controller[_0x5c7b('0xc')]);router['get'](_0x5c7b('0xd'),auth['isAuthenticated'](),controller[_0x5c7b('0xe')]);router['get'](_0x5c7b('0xf'),auth[_0x5c7b('0x9')](),controller['getDispositions']);router[_0x5c7b('0x8')](_0x5c7b('0x10'),auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x11')]);router[_0x5c7b('0x8')](_0x5c7b('0x12'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x5c7b('0x8')]('/:id/applications',auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x13')]);router[_0x5c7b('0x8')](_0x5c7b('0x14'),auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x15')]);router[_0x5c7b('0x8')]('/:id/users',auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x16')]);router[_0x5c7b('0x17')]('/',auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x18')]);router[_0x5c7b('0x17')](_0x5c7b('0xf'),auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x19')]);router['post'](_0x5c7b('0x10'),auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x1a')]);router[_0x5c7b('0x17')](_0x5c7b('0x12'),auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x1b')]);router[_0x5c7b('0x17')]('/:id/applications',auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x1c')]);router[_0x5c7b('0x17')]('/addaccountapplications',auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x1d')]);router[_0x5c7b('0x17')](_0x5c7b('0x1e'),auth['isAuthenticated'](),controller[_0x5c7b('0x1f')]);router[_0x5c7b('0x17')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x5c7b('0x17')](_0x5c7b('0x20'),auth[_0x5c7b('0x9')](),controller['addAgents']);router['put'](_0x5c7b('0xd'),auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x21')]);router['delete'](_0x5c7b('0xd'),auth[_0x5c7b('0x9')](),controller[_0x5c7b('0x22')]);router[_0x5c7b('0x23')](_0x5c7b('0xf'),auth[_0x5c7b('0x9')](),controller['removeDispositions']);router[_0x5c7b('0x23')]('/:id/canned_answers',auth[_0x5c7b('0x9')](),controller['removeAnswers']);router['delete'](_0x5c7b('0x20'),auth[_0x5c7b('0x9')](),controller['removeAgents']);module[_0x5c7b('0x24')]=router;
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js
index 3d1d1a5..67563cf 100644
--- a/server/api/faxApplication/faxApplication.attributes.js
+++ b/server/api/faxApplication/faxApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee65=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x5eea0c,_0x1a9c89){var _0x3cd6e0=function(_0x174b4f){while(--_0x174b4f){_0x5eea0c['push'](_0x5eea0c['shift']());}};_0x3cd6e0(++_0x1a9c89);}(_0xee65,0x138));var _0x5ee6=function(_0x3696c9,_0x27cc18){_0x3696c9=_0x3696c9-0x0;var _0x3a9c7f=_0xee65[_0x3696c9];return _0x3a9c7f;};'use strict';var Sequelize=require(_0x5ee6('0x0'));module[_0x5ee6('0x1')]={'priority':{'type':Sequelize[_0x5ee6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5ee6('0x3')],'allowNull':![],'defaultValue':_0x5ee6('0x4')},'appdata':{'type':Sequelize[_0x5ee6('0x5')]()},'description':{'type':Sequelize[_0x5ee6('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5ee6('0x6')}};
\ No newline at end of file
+var _0x77e6=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x77e6,0x1a6));var _0x677e=function(_0x3217a8,_0x1cbbc0){_0x3217a8=_0x3217a8-0x0;var _0x22bea3=_0x77e6[_0x3217a8];return _0x22bea3;};'use strict';var Sequelize=require(_0x677e('0x0'));module[_0x677e('0x1')]={'priority':{'type':Sequelize[_0x677e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x677e('0x3')],'allowNull':![],'defaultValue':_0x677e('0x4')},'appdata':{'type':Sequelize[_0x677e('0x5')]()},'description':{'type':Sequelize[_0x677e('0x3')]},'interval':{'type':Sequelize[_0x677e('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js
index 87dbbac..547a52b 100644
--- a/server/api/faxApplication/faxApplication.controller.js
+++ b/server/api/faxApplication/faxApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','FaxApplication','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=_[_0xac4a('0x28')](db[_0xac4a('0x29')][_0xac4a('0x2a')],function(_0x116700){return{'name':_0x116700['fieldName'],'type':_0x116700['type'][_0xac4a('0x2b')]};});_0x20202c[_0xac4a('0x2c')]=_[_0xac4a('0x28')](_0x23b061,'name');_0x20202c['query']=_[_0xac4a('0x2d')](_0x14832b[_0xac4a('0x2e')]);_0x20202c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x20202c[_0xac4a('0x2c')],_0x20202c['query']);_0x1c13dc[_0xac4a('0x31')]=_['intersection'](_0x20202c[_0xac4a('0x2c')],qs['fields'](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x1c13dc[_0xac4a('0x31')]=_0x1c13dc[_0xac4a('0x31')][_0xac4a('0x33')]?_0x1c13dc[_0xac4a('0x31')]:_0x20202c[_0xac4a('0x2c')];if(!_0x14832b[_0xac4a('0x2e')][_0xac4a('0x34')](_0xac4a('0x35'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x1c')]);_0x1c13dc['offset']=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2e')]['offset']);}_0x1c13dc[_0xac4a('0x36')]=qs[_0xac4a('0x37')](_0x14832b['query']['sort']);_0x1c13dc[_0xac4a('0x38')]=qs[_0xac4a('0x2f')](_[_0xac4a('0x39')](_0x14832b[_0xac4a('0x2e')],_0x20202c['filters']),_0x23b061);if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]){_0x1c13dc['where']=_[_0xac4a('0x3b')](_0x1c13dc[_0xac4a('0x38')],{'$or':_[_0xac4a('0x28')](_0x23b061,function(_0x5f0eb8){if(_0x5f0eb8[_0xac4a('0x3c')]!==_0xac4a('0x3d')){var _0x1b5427={};_0x1b5427[_0x5f0eb8['name']]={'$like':'%'+_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]+'%'};return _0x1b5427;}})});}_0x1c13dc=_['merge']({},_0x1c13dc,_0x14832b['options']);var _0x4319a1={'where':_0x1c13dc['where']};return db['FaxApplication']['count'](_0x4319a1)['then'](function(_0x41b757){_0x4e17ce[_0xac4a('0x1a')]=_0x41b757;if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1c13dc[_0xac4a('0x3f')]=[{'all':!![]}];}return db[_0xac4a('0x29')][_0xac4a('0x40')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x28292c){_0x4e17ce[_0xac4a('0x41')]=_0x28292c;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x42')](handleError(_0x472c57,null));};exports['show']=function(_0x5086ff,_0x5cd24f){var _0x1e1cc5={'raw':!![],'where':{'id':_0x5086ff[_0xac4a('0x43')]['id']}},_0x5c46a={};_0x5c46a[_0xac4a('0x2c')]=_[_0xac4a('0x2d')](db[_0xac4a('0x29')][_0xac4a('0x2a')]);_0x5c46a[_0xac4a('0x2e')]=_[_0xac4a('0x2d')](_0x5086ff[_0xac4a('0x2e')]);_0x5c46a['filters']=_[_0xac4a('0x30')](_0x5c46a[_0xac4a('0x2c')],_0x5c46a[_0xac4a('0x2e')]);_0x1e1cc5[_0xac4a('0x31')]=_[_0xac4a('0x30')](_0x5c46a['model'],qs[_0xac4a('0x32')](_0x5086ff[_0xac4a('0x2e')]['fields']));_0x1e1cc5[_0xac4a('0x31')]=_0x1e1cc5['attributes'][_0xac4a('0x33')]?_0x1e1cc5[_0xac4a('0x31')]:_0x5c46a[_0xac4a('0x2c')];if(_0x5086ff[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1e1cc5[_0xac4a('0x3f')]=[{'all':!![]}];}_0x1e1cc5=_[_0xac4a('0x3b')]({},_0x1e1cc5,_0x5086ff[_0xac4a('0x44')]);return db[_0xac4a('0x29')][_0xac4a('0x45')](_0x1e1cc5)[_0xac4a('0x22')](handleEntityNotFound(_0x5cd24f,null))[_0xac4a('0x22')](respondWithResult(_0x5cd24f,null))['catch'](handleError(_0x5cd24f,null));};exports[_0xac4a('0x46')]=function(_0x41d11d,_0xeca4e9){return db['FaxApplication'][_0xac4a('0x46')](_0x41d11d[_0xac4a('0x47')],{})['then'](respondWithResult(_0xeca4e9,0xc9))[_0xac4a('0x42')](handleError(_0xeca4e9,null));};exports['update']=function(_0x244950,_0xe620f6){if(_0x244950[_0xac4a('0x47')]['id']){delete _0x244950['body']['id'];}return db['FaxApplication'][_0xac4a('0x45')]({'where':{'id':_0x244950['params']['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0xe620f6,null))['then'](saveUpdates(_0x244950[_0xac4a('0x47')],null))['then'](respondWithResult(_0xe620f6,null))[_0xac4a('0x42')](handleError(_0xe620f6,null));};exports[_0xac4a('0x48')]=function(_0x424f9b,_0x1c8c39){return db['FaxApplication'][_0xac4a('0x45')]({'where':{'id':_0x424f9b[_0xac4a('0x43')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x22')](removeEntity(_0x1c8c39,null))[_0xac4a('0x42')](handleError(_0x1c8c39,null));};
\ No newline at end of file
+var _0xe14b=['options','includeAll','include','findAll','rows','catch','find','create','body','params','destroy','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','update','then','error','stack','name','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL'];(function(_0x5a552a,_0x48583d){var _0x6af1ce=function(_0x5c8bc6){while(--_0x5c8bc6){_0x5a552a['push'](_0x5a552a['shift']());}};_0x6af1ce(++_0x48583d);}(_0xe14b,0x93));var _0xbe14=function(_0x20c180,_0x115684){_0x20c180=_0x20c180-0x0;var _0x4c8ae9=_0xe14b[_0x20c180];return _0x4c8ae9;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];function respondWithStatusCode(_0x3d38c2,_0x27792f){_0x27792f=_0x27792f||0xcc;return function(_0x3b898d){if(_0x3b898d){return _0x3d38c2[_0xbe14('0x15')](_0x27792f);}return _0x3d38c2[_0xbe14('0x16')](_0x27792f)[_0xbe14('0x17')]();};}function respondWithResult(_0xa2cf72,_0x1e4826){_0x1e4826=_0x1e4826||0xc8;return function(_0x33fd54){if(_0x33fd54){return _0xa2cf72[_0xbe14('0x16')](_0x1e4826)['json'](_0x33fd54);}};}function respondWithFilteredResult(_0x55b3a7,_0x3f58f5){return function(_0x3dc4a9){if(_0x3dc4a9){var _0xf4ac9=_0x3dc4a9[_0xbe14('0x18')],_0x37ce4e=_0x3f58f5[_0xbe14('0x19')],_0x4e8f34=_0x3f58f5[_0xbe14('0x19')]+_0x3f58f5[_0xbe14('0x1a')],_0x21c789;if(_0x4e8f34>=_0xf4ac9){_0x4e8f34=_0xf4ac9;_0x21c789=0xc8;}else{_0x21c789=0xce;}_0x55b3a7[_0xbe14('0x16')](_0x21c789);return _0x55b3a7[_0xbe14('0x1b')]('Content-Range',_0x37ce4e+'-'+_0x4e8f34+'/'+_0xf4ac9)[_0xbe14('0x1c')](_0x3dc4a9);}return null;};}function patchUpdates(_0x456ca8){return function(_0x329588){try{jsonpatch[_0xbe14('0x1d')](_0x329588,_0x456ca8,!![]);}catch(_0x3249da){return BPromise[_0xbe14('0x1e')](_0x3249da);}return _0x329588['save']();};}function saveUpdates(_0x24f820,_0x4a1bbd){return function(_0x417c8d){if(_0x417c8d){return _0x417c8d[_0xbe14('0x1f')](_0x24f820)[_0xbe14('0x20')](function(_0x51dc0b){return _0x51dc0b;});}return null;};}function removeEntity(_0xe60f42,_0x56d845){return function(_0x3c1c85){if(_0x3c1c85){return _0x3c1c85['destroy']()[_0xbe14('0x20')](function(){_0xe60f42['status'](0xcc)[_0xbe14('0x17')]();});}};}function handleEntityNotFound(_0x3d3608,_0x505dbd){return function(_0x2da350){if(!_0x2da350){_0x3d3608['sendStatus'](0x194);}return _0x2da350;};}function handleError(_0x4587a8,_0x4851f8){_0x4851f8=_0x4851f8||0x1f4;return function(_0x36a21e){logger[_0xbe14('0x21')](_0x36a21e[_0xbe14('0x22')]);if(_0x36a21e[_0xbe14('0x23')]){delete _0x36a21e[_0xbe14('0x23')];}_0x4587a8[_0xbe14('0x16')](_0x4851f8)['send'](_0x36a21e);};}exports[_0xbe14('0x24')]=function(_0x1ba46a,_0x391556){var _0x169369={},_0x5dd475={},_0x16f884={'count':0x0,'rows':[]};var _0x29fc64=_['map'](db[_0xbe14('0x25')][_0xbe14('0x26')],function(_0x1c7cc7){return{'name':_0x1c7cc7[_0xbe14('0x27')],'type':_0x1c7cc7[_0xbe14('0x28')][_0xbe14('0x29')]};});_0x5dd475[_0xbe14('0x2a')]=_[_0xbe14('0x2b')](_0x29fc64,_0xbe14('0x23'));_0x5dd475[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](_0x1ba46a[_0xbe14('0x2c')]);_0x5dd475[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],_0x5dd475[_0xbe14('0x2c')]);_0x169369[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],qs[_0xbe14('0x31')](_0x1ba46a['query'][_0xbe14('0x31')]));_0x169369['attributes']=_0x169369['attributes'][_0xbe14('0x32')]?_0x169369['attributes']:_0x5dd475[_0xbe14('0x2a')];if(!_0x1ba46a[_0xbe14('0x2c')]['hasOwnProperty']('nolimit')){_0x169369['limit']=qs[_0xbe14('0x1a')](_0x1ba46a[_0xbe14('0x2c')]['limit']);_0x169369[_0xbe14('0x19')]=qs[_0xbe14('0x19')](_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x19')]);}_0x169369[_0xbe14('0x33')]=qs['sort'](_0x1ba46a['query'][_0xbe14('0x34')]);_0x169369['where']=qs['filters'](_['pick'](_0x1ba46a[_0xbe14('0x2c')],_0x5dd475[_0xbe14('0x2e')]),_0x29fc64);if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x35')]){_0x169369[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x169369[_0xbe14('0x36')],{'$or':_[_0xbe14('0x2b')](_0x29fc64,function(_0x2d9c12){if(_0x2d9c12[_0xbe14('0x28')]!==_0xbe14('0x38')){var _0x32c59d={};_0x32c59d[_0x2d9c12['name']]={'$like':'%'+_0x1ba46a['query'][_0xbe14('0x35')]+'%'};return _0x32c59d;}})});}_0x169369=_[_0xbe14('0x37')]({},_0x169369,_0x1ba46a[_0xbe14('0x39')]);var _0x520e09={'where':_0x169369[_0xbe14('0x36')]};return db[_0xbe14('0x25')][_0xbe14('0x18')](_0x520e09)[_0xbe14('0x20')](function(_0x3bd454){_0x16f884[_0xbe14('0x18')]=_0x3bd454;if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x3a')]){_0x169369[_0xbe14('0x3b')]=[{'all':!![]}];}return db['FaxApplication'][_0xbe14('0x3c')](_0x169369);})[_0xbe14('0x20')](function(_0x3463c4){_0x16f884[_0xbe14('0x3d')]=_0x3463c4;return _0x16f884;})[_0xbe14('0x20')](respondWithFilteredResult(_0x391556,_0x169369))[_0xbe14('0x3e')](handleError(_0x391556,null));};exports['show']=function(_0xb0f143,_0x1974a4){var _0x1220c9={'raw':!![],'where':{'id':_0xb0f143['params']['id']}},_0x36263c={};_0x36263c['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x25')][_0xbe14('0x26')]);_0x36263c['query']=_['keys'](_0xb0f143[_0xbe14('0x2c')]);_0x36263c['filters']=_['intersection'](_0x36263c[_0xbe14('0x2a')],_0x36263c[_0xbe14('0x2c')]);_0x1220c9[_0xbe14('0x30')]=_['intersection'](_0x36263c['model'],qs['fields'](_0xb0f143[_0xbe14('0x2c')][_0xbe14('0x31')]));_0x1220c9[_0xbe14('0x30')]=_0x1220c9['attributes'][_0xbe14('0x32')]?_0x1220c9[_0xbe14('0x30')]:_0x36263c[_0xbe14('0x2a')];if(_0xb0f143[_0xbe14('0x2c')]['includeAll']){_0x1220c9['include']=[{'all':!![]}];}_0x1220c9=_[_0xbe14('0x37')]({},_0x1220c9,_0xb0f143[_0xbe14('0x39')]);return db[_0xbe14('0x25')][_0xbe14('0x3f')](_0x1220c9)[_0xbe14('0x20')](handleEntityNotFound(_0x1974a4,null))['then'](respondWithResult(_0x1974a4,null))['catch'](handleError(_0x1974a4,null));};exports[_0xbe14('0x40')]=function(_0x2a3623,_0x238c60){return db[_0xbe14('0x25')]['create'](_0x2a3623[_0xbe14('0x41')],{})[_0xbe14('0x20')](respondWithResult(_0x238c60,0xc9))['catch'](handleError(_0x238c60,null));};exports[_0xbe14('0x1f')]=function(_0x2a35e5,_0x2d6ee8){if(_0x2a35e5[_0xbe14('0x41')]['id']){delete _0x2a35e5['body']['id'];}return db['FaxApplication'][_0xbe14('0x3f')]({'where':{'id':_0x2a35e5[_0xbe14('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d6ee8,null))['then'](saveUpdates(_0x2a35e5[_0xbe14('0x41')],null))[_0xbe14('0x20')](respondWithResult(_0x2d6ee8,null))[_0xbe14('0x3e')](handleError(_0x2d6ee8,null));};exports[_0xbe14('0x43')]=function(_0xdbc6e1,_0xd04fd5){return db[_0xbe14('0x25')]['find']({'where':{'id':_0xdbc6e1[_0xbe14('0x42')]['id']}})[_0xbe14('0x20')](handleEntityNotFound(_0xd04fd5,null))[_0xbe14('0x20')](removeEntity(_0xd04fd5,null))[_0xbe14('0x3e')](handleError(_0xd04fd5,null));};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js
index 929c3ea..dbe0f75 100644
--- a/server/api/faxApplication/faxApplication.model.js
+++ b/server/api/faxApplication/faxApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70d4=['fax_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','./faxApplication.attributes','define'];(function(_0x1424f9,_0x1f9921){var _0x5c5a14=function(_0x6040ac){while(--_0x6040ac){_0x1424f9['push'](_0x1424f9['shift']());}};_0x5c5a14(++_0x1f9921);}(_0x70d4,0x1e7));var _0x470d=function(_0x8b631b,_0x386724){_0x8b631b=_0x8b631b-0x0;var _0x3e6832=_0x70d4[_0x8b631b];return _0x3e6832;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x470d('0x0'))(_0x470d('0x1'));var moment=require(_0x470d('0x2'));var BPromise=require('bluebird');var rp=require(_0x470d('0x3'));var fs=require('fs');var path=require(_0x470d('0x4'));var rimraf=require(_0x470d('0x5'));var config=require('../../config/environment');var attributes=require(_0x470d('0x6'));module['exports']=function(_0x42f659,_0x1cf914){return _0x42f659[_0x470d('0x7')]('FaxApplication',attributes,{'tableName':_0x470d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x470d('0x9'),'collate':_0x470d('0xa')});};
\ No newline at end of file
+var _0x1d99=['moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','lodash','../../config/logger','api'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0x1d99,0x131));var _0x91d9=function(_0xfedd2e,_0x45a255){_0xfedd2e=_0xfedd2e-0x0;var _0x1d8791=_0x1d99[_0xfedd2e];return _0x1d8791;};'use strict';var _=require(_0x91d9('0x0'));var util=require('util');var logger=require(_0x91d9('0x1'))(_0x91d9('0x2'));var moment=require(_0x91d9('0x3'));var BPromise=require(_0x91d9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91d9('0x5'));var rimraf=require(_0x91d9('0x6'));var config=require(_0x91d9('0x7'));var attributes=require(_0x91d9('0x8'));module[_0x91d9('0x9')]=function(_0x539149,_0x8a0f1e){return _0x539149[_0x91d9('0xa')](_0x91d9('0xb'),attributes,{'tableName':_0x91d9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x91d9('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js
index c7ec845..bdedbfc 100644
--- a/server/api/faxApplication/faxApplication.rpc.js
+++ b/server/api/faxApplication/faxApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x255c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','request\x20sent','stringify','code','FaxApplication,\x20%s,\x20%s','message','error','result','catch','update','options','where','attributes','limit','then','UpdateFaxApplication','debug','util'];(function(_0x3e224a,_0x536946){var _0x4e4806=function(_0x20eee0){while(--_0x20eee0){_0x3e224a['push'](_0x3e224a['shift']());}};_0x4e4806(++_0x536946);}(_0x255c,0x15e));var _0xc255=function(_0x3f9130,_0xc0246f){_0x3f9130=_0x3f9130-0x0;var _0x568e1e=_0x255c[_0x3f9130];return _0x568e1e;};'use strict';var _=require('lodash');var util=require(_0xc255('0x0'));var moment=require(_0xc255('0x1'));var BPromise=require(_0xc255('0x2'));var rs=require(_0xc255('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc255('0x4'))['db'];var utils=require(_0xc255('0x5'));var logger=require(_0xc255('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc255('0x7'));var client=jayson[_0xc255('0x8')][_0xc255('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a080e,_0x1f30c8,_0x372817){return new BPromise(function(_0xaf4657,_0x42ff6d){return client['request'](_0x5a080e,_0x372817)['then'](function(_0x2506f8){logger[_0xc255('0xa')]('FaxApplication,\x20%s,\x20%s',_0x1f30c8,_0xc255('0xb'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1f30c8,_0xc255('0xb'),JSON[_0xc255('0xc')](_0x2506f8));if(_0x2506f8['error']){if(_0x2506f8['error'][_0xc255('0xd')]===0x1f4){logger['error'](_0xc255('0xe'),_0x1f30c8,_0x2506f8['error'][_0xc255('0xf')]);return _0x42ff6d(_0x2506f8[_0xc255('0x10')][_0xc255('0xf')]);}logger[_0xc255('0x10')](_0xc255('0xe'),_0x1f30c8,_0x2506f8[_0xc255('0x10')]['message']);return _0xaf4657(_0x2506f8['error'][_0xc255('0xf')]);}else{logger['info'](_0xc255('0xe'),_0x1f30c8,_0xc255('0xb'));_0xaf4657(_0x2506f8[_0xc255('0x11')]['message']);}})[_0xc255('0x12')](function(_0x247da5){logger[_0xc255('0x10')](_0xc255('0xe'),_0x1f30c8,_0x247da5);_0x42ff6d(_0x247da5);});});}exports['UpdateFaxApplication']=function(_0x5a889){var _0x5d5216=this;return new Promise(function(_0x3af920,_0x4c5c7c){return db['FaxApplication'][_0xc255('0x13')](_0x5a889['body'],{'raw':_0x5a889[_0xc255('0x14')]?_0x5a889['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a889['options']?_0x5a889['options'][_0xc255('0x15')]||null:null,'attributes':_0x5a889[_0xc255('0x14')]?_0x5a889['options'][_0xc255('0x16')]||null:null,'limit':_0x5a889['options']?_0x5a889[_0xc255('0x14')][_0xc255('0x17')]||null:null})[_0xc255('0x18')](function(_0x271264){logger[_0xc255('0xa')](_0xc255('0x19'),_0x5a889);logger[_0xc255('0x1a')](_0xc255('0x19'),_0x5a889,JSON['stringify'](_0x271264));_0x3af920(_0x271264);})[_0xc255('0x12')](function(_0x449fc4){logger['error'](_0xc255('0x19'),_0x449fc4[_0xc255('0xf')],_0x5a889);_0x4c5c7c(_0x5d5216[_0xc255('0x10')](0x1f4,_0x449fc4[_0xc255('0xf')]));});});};
\ No newline at end of file
+var _0x6adb=['body','options','raw','where','attributes','limit','then','UpdateFaxApplication','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication'];(function(_0x55ec31,_0x3f1d64){var _0x47a20e=function(_0x312d99){while(--_0x312d99){_0x55ec31['push'](_0x55ec31['shift']());}};_0x47a20e(++_0x3f1d64);}(_0x6adb,0x88));var _0xb6ad=function(_0x565567,_0x3fc90e){_0x565567=_0x565567-0x0;var _0x3aef55=_0x6adb[_0x565567];return _0x3aef55;};'use strict';var _=require('lodash');var util=require(_0xb6ad('0x0'));var moment=require(_0xb6ad('0x1'));var BPromise=require(_0xb6ad('0x2'));var rs=require(_0xb6ad('0x3'));var fs=require('fs');var Redis=require(_0xb6ad('0x4'));var db=require(_0xb6ad('0x5'))['db'];var utils=require(_0xb6ad('0x6'));var logger=require(_0xb6ad('0x7'))('rpc');var config=require(_0xb6ad('0x8'));var jayson=require(_0xb6ad('0x9'));var client=jayson[_0xb6ad('0xa')][_0xb6ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17eae8,_0x3dd0ac,_0x104b6f){return new BPromise(function(_0x376c1b,_0xca8b45){return client['request'](_0x17eae8,_0x104b6f)['then'](function(_0x13972a){logger[_0xb6ad('0xc')]('FaxApplication,\x20%s,\x20%s',_0x3dd0ac,_0xb6ad('0xd'));logger[_0xb6ad('0xe')](_0xb6ad('0xf'),_0x3dd0ac,_0xb6ad('0xd'),JSON[_0xb6ad('0x10')](_0x13972a));if(_0x13972a[_0xb6ad('0x11')]){if(_0x13972a[_0xb6ad('0x11')][_0xb6ad('0x12')]===0x1f4){logger[_0xb6ad('0x11')](_0xb6ad('0x13'),_0x3dd0ac,_0x13972a[_0xb6ad('0x11')][_0xb6ad('0x14')]);return _0xca8b45(_0x13972a[_0xb6ad('0x11')][_0xb6ad('0x14')]);}logger[_0xb6ad('0x11')](_0xb6ad('0x13'),_0x3dd0ac,_0x13972a['error'][_0xb6ad('0x14')]);return _0x376c1b(_0x13972a['error'][_0xb6ad('0x14')]);}else{logger['info'](_0xb6ad('0x13'),_0x3dd0ac,'request\x20sent');_0x376c1b(_0x13972a[_0xb6ad('0x15')][_0xb6ad('0x14')]);}})[_0xb6ad('0x16')](function(_0x1c24f0){logger[_0xb6ad('0x11')]('FaxApplication,\x20%s,\x20%s',_0x3dd0ac,_0x1c24f0);_0xca8b45(_0x1c24f0);});});}exports['UpdateFaxApplication']=function(_0x5eba72){var _0x3202f2=this;return new Promise(function(_0x2b7aa5,_0x4b4b5b){return db[_0xb6ad('0x17')]['update'](_0x5eba72[_0xb6ad('0x18')],{'raw':_0x5eba72[_0xb6ad('0x19')]?_0x5eba72[_0xb6ad('0x19')][_0xb6ad('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eba72[_0xb6ad('0x19')]?_0x5eba72[_0xb6ad('0x19')][_0xb6ad('0x1b')]||null:null,'attributes':_0x5eba72[_0xb6ad('0x19')]?_0x5eba72[_0xb6ad('0x19')][_0xb6ad('0x1c')]||null:null,'limit':_0x5eba72['options']?_0x5eba72[_0xb6ad('0x19')][_0xb6ad('0x1d')]||null:null})[_0xb6ad('0x1e')](function(_0x14a5f3){logger[_0xb6ad('0xc')](_0xb6ad('0x1f'),_0x5eba72);logger[_0xb6ad('0xe')](_0xb6ad('0x1f'),_0x5eba72,JSON['stringify'](_0x14a5f3));_0x2b7aa5(_0x14a5f3);})[_0xb6ad('0x16')](function(_0x1775a4){logger[_0xb6ad('0x11')]('UpdateFaxApplication',_0x1775a4['message'],_0x5eba72);_0x4b4b5b(_0x3202f2['error'](0x1f4,_0x1775a4[_0xb6ad('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js
index 912cc03..691095d 100644
--- a/server/api/faxApplication/index.js
+++ b/server/api/faxApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f8a=['index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated'];(function(_0x34bb12,_0x4e9455){var _0x39be5b=function(_0x25970c){while(--_0x25970c){_0x34bb12['push'](_0x34bb12['shift']());}};_0x39be5b(++_0x4e9455);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x51667b,_0x4409ec){_0x51667b=_0x51667b-0x0;var _0x3ec7ff=_0x3f8a[_0x51667b];return _0x3ec7ff;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0xe')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')](_0xa3f8('0xc'),auth['isAuthenticated'](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller['destroy']);module[_0xa3f8('0x13')]=router;
\ No newline at end of file
+var _0x6aa7=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxApplication.controller','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','path'];(function(_0x4d3209,_0x2fbd89){var _0x233ad7=function(_0x21e2ee){while(--_0x21e2ee){_0x4d3209['push'](_0x4d3209['shift']());}};_0x233ad7(++_0x2fbd89);}(_0x6aa7,0x178));var _0x76aa=function(_0x31bf10,_0x503f9d){_0x31bf10=_0x31bf10-0x0;var _0x476bd8=_0x6aa7[_0x31bf10];return _0x476bd8;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x76aa('0x5'));var config=require(_0x76aa('0x6'));var controller=require(_0x76aa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x76aa('0x8')]);router['get'](_0x76aa('0x9'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xb')]);router['post']('/',auth[_0x76aa('0xa')](),controller[_0x76aa('0xc')]);router[_0x76aa('0xd')]('/:id',auth[_0x76aa('0xa')](),controller[_0x76aa('0xe')]);router[_0x76aa('0xf')](_0x76aa('0x9'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x10')]);module[_0x76aa('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js
index 386d6bc..5f86454 100644
--- a/server/api/faxInteraction/faxInteraction.attributes.js
+++ b/server/api/faxInteraction/faxInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa0d2=['out','ENUM','sequelize','BOOLEAN','STRING','DATE'];(function(_0x419498,_0x32fc7a){var _0x57d3b0=function(_0x318a23){while(--_0x318a23){_0x419498['push'](_0x419498['shift']());}};_0x57d3b0(++_0x32fc7a);}(_0xa0d2,0x6e));var _0x2a0d=function(_0x37aa44,_0x3f6b91){_0x37aa44=_0x37aa44-0x0;var _0x5c535e=_0xa0d2[_0x37aa44];return _0x5c535e;};'use strict';var Sequelize=require(_0x2a0d('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2a0d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2a0d('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2a0d('0x3')]},'fax':{'type':Sequelize[_0x2a0d('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2a0d('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2a0d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2a0d('0x5')]('in',_0x2a0d('0x4')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xb73d=['DATE','out','sequelize','STRING'];(function(_0x45577f,_0x24889f){var _0x2c0140=function(_0x336012){while(--_0x336012){_0x45577f['push'](_0x45577f['shift']());}};_0x2c0140(++_0x24889f);}(_0xb73d,0xe2));var _0xdb73=function(_0x12ec65,_0x5bd7c9){_0x12ec65=_0x12ec65-0x0;var _0x28502f=_0xb73d[_0x12ec65];return _0x28502f;};'use strict';var Sequelize=require(_0xdb73('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xdb73('0x1')]},'note':{'type':Sequelize[_0xdb73('0x1')]},'read1stAt':{'type':Sequelize[_0xdb73('0x2')]},'fax':{'type':Sequelize[_0xdb73('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xdb73('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js
index db46f03..da2de74 100644
--- a/server/api/faxInteraction/faxInteraction.controller.js
+++ b/server/api/faxInteraction/faxInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd844=['conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','UserId','buildExpression','some','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','SELECT','i.id','DESC','isEmpty','t.id\x20IN\x20?','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','sequelize','count','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','catch','params','rawAttributes','includeAll','options','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','Attachment','Messages','get','mkdirSync','basename','existsSync','log','err','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','FaxInteraction','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator'];(function(_0x1246af,_0x477bc9){var _0x5d9762=function(_0x259c6c){while(--_0x259c6c){_0x1246af['push'](_0x1246af['shift']());}};_0x5d9762(++_0x477bc9);}(_0xd844,0x6d));var _0x4d84=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd844[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x4d84('0x0'));var emlformat=require(_0x4d84('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4d84('0x2'));var jsonpatch=require(_0x4d84('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d84('0x4'));var Mustache=require(_0x4d84('0x5'));var util=require(_0x4d84('0x6'));var path=require(_0x4d84('0x7'));var sox=require('sox');var csv=require(_0x4d84('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4d84('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4d84('0xa'));var toCsv=require(_0x4d84('0x8'));var querystring=require('querystring');var Papa=require(_0x4d84('0xb'));var Redis=require('ioredis');var authService=require(_0x4d84('0xc'));var qs=require(_0x4d84('0xd'));var as=require(_0x4d84('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d84('0xf'))(_0x4d84('0x10'));var utils=require(_0x4d84('0x11'));var config=require(_0x4d84('0x12'));var db=require(_0x4d84('0x13'))['db'];config[_0x4d84('0x14')]=_[_0x4d84('0x15')](config[_0x4d84('0x14')],{'host':_0x4d84('0x16'),'port':0x18eb});var socket=require(_0x4d84('0x17'))(new Redis(config[_0x4d84('0x14')]));require('./faxInteraction.socket')[_0x4d84('0x18')](socket);function respondWithStatusCode(_0x50f820,_0x34765d){_0x34765d=_0x34765d||0xcc;return function(_0x1e37e3){if(_0x1e37e3){return _0x50f820[_0x4d84('0x19')](_0x34765d);}return _0x50f820[_0x4d84('0x1a')](_0x34765d)['end']();};}function respondWithResult(_0x1df099,_0x4ee2fe){_0x4ee2fe=_0x4ee2fe||0xc8;return function(_0x2fc8db){if(_0x2fc8db){return _0x1df099[_0x4d84('0x1a')](_0x4ee2fe)['json'](_0x2fc8db);}};}function respondWithFilteredResult(_0x4f2a5c,_0x47076e){return function(_0x5f3a8d){if(_0x5f3a8d){var _0x4128d1=_0x5f3a8d['count'],_0x42ef73=_0x47076e[_0x4d84('0x1b')],_0x12349a=_0x47076e[_0x4d84('0x1b')]+_0x47076e[_0x4d84('0x1c')],_0xb99083;if(_0x12349a>=_0x4128d1){_0x12349a=_0x4128d1;_0xb99083=0xc8;}else{_0xb99083=0xce;}_0x4f2a5c['status'](_0xb99083);return _0x4f2a5c[_0x4d84('0x1d')](_0x4d84('0x1e'),_0x42ef73+'-'+_0x12349a+'/'+_0x4128d1)[_0x4d84('0x1f')](_0x5f3a8d);}return null;};}function patchUpdates(_0x27fdf2){return function(_0x41e946){try{jsonpatch[_0x4d84('0x20')](_0x41e946,_0x27fdf2,!![]);}catch(_0x542791){return BPromise[_0x4d84('0x21')](_0x542791);}return _0x41e946[_0x4d84('0x22')]();};}function saveUpdates(_0x29928e,_0x2fc7dd){return function(_0x5a2608){if(_0x5a2608){return _0x5a2608[_0x4d84('0x23')](_0x29928e)['then'](function(_0x229c8d){return _0x229c8d;});}return null;};}function removeEntity(_0x5ebe25,_0x48794f){return function(_0x5c616b){if(_0x5c616b){return _0x5c616b[_0x4d84('0x24')]()[_0x4d84('0x25')](function(){_0x5ebe25[_0x4d84('0x1a')](0xcc)[_0x4d84('0x26')]();});}};}function handleEntityNotFound(_0x49f921,_0x41a802){return function(_0x487ef9){if(!_0x487ef9){_0x49f921[_0x4d84('0x19')](0x194);}return _0x487ef9;};}function handleError(_0x35276a,_0x55c3b4){_0x55c3b4=_0x55c3b4||0x1f4;return function(_0x407371){logger[_0x4d84('0x27')](_0x407371[_0x4d84('0x28')]);if(_0x407371[_0x4d84('0x29')]){delete _0x407371[_0x4d84('0x29')];}_0x35276a['status'](_0x55c3b4)[_0x4d84('0x2a')](_0x407371);};}function getInteractionUsers(_0x2014a6,_0x353bf2){return new BPromise(function(_0x539e8c,_0x5ec750){try{if(_0x353bf2[_0x2014a6['id']]){_0x2014a6[_0x4d84('0x2b')]=_[_0x4d84('0x2c')](_0x353bf2[_0x2014a6['id']],function(_0x57e3b5){return{'id':_0x57e3b5['id'],'fullname':_0x57e3b5[_0x4d84('0x2d')]};});}}catch(_0x5b447b){_0x5ec750(_0x5b447b);}_0x539e8c(_0x2014a6);});}function getInteractionTags(_0x492e61,_0x37f532){return new BPromise(function(_0x5c3dc9,_0x1d7866){try{if(_0x492e61[_0x4d84('0x2e')]){_0x492e61[_0x4d84('0x2f')]=[];_0x492e61['TagIds'][_0x4d84('0x30')](',')[_0x4d84('0x31')](function(_0x465fc4){_0x492e61[_0x4d84('0x2f')][_0x4d84('0x32')](_0x37f532[_0x465fc4]);});}delete _0x492e61['TagIds'];}catch(_0x3c466b){_0x1d7866(_0x3c466b);}_0x5c3dc9(_0x492e61);});}function updateFaxInteraction(_0xc98921,_0xb5f765,_0x3cc286){return new BPromise(function(_0x313cb4,_0x589491){return getInteractionUsers(_0xc98921,_0x3cc286)['then'](function(_0x4b494e){return getInteractionTags(_0x4b494e,_0xb5f765);})['then'](function(_0x4d3247){_0x313cb4(_0x4d3247);})['catch'](function(_0x38450f){_0x589491(_0x38450f);});});}exports['index']=function(_0x3d2eee,_0x19904a){var _0x51f377={},_0x115a20={},_0x5c3fca={'count':0x0,'rows':[]};var _0x47ac06=_[_0x4d84('0x2c')](db[_0x4d84('0x33')]['rawAttributes'],function(_0x379266){return{'name':_0x379266[_0x4d84('0x34')],'type':_0x379266[_0x4d84('0x35')][_0x4d84('0x36')]};});_0x115a20[_0x4d84('0x37')]=_[_0x4d84('0x2c')](_0x47ac06,_0x4d84('0x29'));_0x115a20['query']=_[_0x4d84('0x38')](_0x3d2eee[_0x4d84('0x39')]);_0x115a20[_0x4d84('0x3a')]=_['intersection'](_0x115a20[_0x4d84('0x37')],_0x115a20[_0x4d84('0x39')]);_0x51f377['attributes']=_[_0x4d84('0x3b')](_0x115a20['model'],qs[_0x4d84('0x3c')](_0x3d2eee['query'][_0x4d84('0x3c')]));_0x51f377[_0x4d84('0x3d')]=_0x51f377[_0x4d84('0x3d')][_0x4d84('0x3e')]?_0x51f377[_0x4d84('0x3d')]:_0x115a20[_0x4d84('0x37')];if(!_0x3d2eee['query'][_0x4d84('0x3f')](_0x4d84('0x40'))){_0x51f377[_0x4d84('0x1c')]=qs['limit'](_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x1c')]);_0x51f377['offset']=qs[_0x4d84('0x1b')](_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x1b')]);}_0x51f377[_0x4d84('0x41')]=qs[_0x4d84('0x42')](_0x3d2eee[_0x4d84('0x39')]['sort']);_0x51f377[_0x4d84('0x43')]=qs[_0x4d84('0x3a')](_[_0x4d84('0x44')](_0x3d2eee[_0x4d84('0x39')],_0x115a20[_0x4d84('0x3a')]),_0x47ac06);var _0x4affef=[];var _0xbf42c1=squel[_0x4d84('0x45')]()[_0x4d84('0x46')]('id')['field'](_0x4d84('0x29'))[_0x4d84('0x46')](_0x4d84('0x47'))['from'](_0x4d84('0x48'));var _0x52c0d8=squel[_0x4d84('0x45')]()[_0x4d84('0x46')](_0x4d84('0x49'))['field']('u.fullname')[_0x4d84('0x46')](_0x4d84('0x4a'))[_0x4d84('0x4b')](_0x4d84('0x4c'),'ui')[_0x4d84('0x4d')]('users','u',_0x4d84('0x4e'));var _0x4785a1=squel[_0x4d84('0x45')]()[_0x4d84('0x4b')](_0x4d84('0x4f'),'i')[_0x4d84('0x4d')](_0x4d84('0x50'),'c',_0x4d84('0x51'))[_0x4d84('0x4d')](_0x4d84('0x52'),'o',_0x4d84('0x53'))[_0x4d84('0x4d')]('fax_accounts','a',_0x4d84('0x54'))[_0x4d84('0x4d')](_0x4d84('0x55'),'me',_0x4d84('0x56'))['left_join'](_0x4d84('0x57'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x4d84('0x4d')](_0x4d84('0x48'),'t',_0x4d84('0x58'));var _0x58e2d5=squel[_0x4d84('0x59')]();var _0x429c1b=[];var _0x3dc101=squel[_0x4d84('0x59')]();var _0x26c8ce;if(_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x5a')]){_0x26c8ce=as[_0x4d84('0x5b')](_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x5a')]);var _0x3eada9=_0x26c8ce[_0x4d84('0x5c')];for(var _0x10861f=0x0;_0x10861f<_0x26c8ce[_0x4d84('0x5d')]['length'];_0x10861f++){var _0x47f859=_0x26c8ce['conditions'][_0x10861f];var _0x2ba3db='i';var _0x1a385e=_[_0x4d84('0x5e')](_0x47ac06,['name',_0x47f859[_0x4d84('0x46')]]);if(!_0x1a385e){switch(_0x47f859[_0x4d84('0x46')]){case _0x4d84('0x5f'):if(_0x47f859[_0x4d84('0x60')]==0x1){_0x4785a1[_0x4d84('0x61')]('`'+_0x47f859[_0x4d84('0x46')]+_0x4d84('0x62'));}else{_0x4785a1[_0x4d84('0x61')]('`'+_0x47f859[_0x4d84('0x46')]+_0x4d84('0x63'));}break;case'Contact':if(_0x47f859[_0x4d84('0x64')]==='$substring'){if(_0x47f859[_0x4d84('0x60')][_0x4d84('0x30')]('\x20')[_0x4d84('0x3e')]>0x1){_0x58e2d5[_0x3eada9](_0x4d84('0x65'),qs[_0x4d84('0x66')](_0x47f859[_0x4d84('0x60')]),null);}else{var _0x374478='%'+_0x47f859['value']+'%';_0x58e2d5[_0x3eada9](_0x4d84('0x67'),_0x374478,_0x374478,_0x374478);}}else{_0x1a385e=_[_0x4d84('0x5e')](_0x47ac06,['name',_0x4d84('0x68')]);_0x47f859[_0x4d84('0x46')]=_0x4d84('0x68');_0x373c50=as['buildExpression'](_0x2ba3db,_0x1a385e[_0x4d84('0x35')],_0x47f859);_0x58e2d5[_0x3eada9](_0x373c50[_0x4d84('0x69')],_0x373c50['value'][_0x4d84('0x6a')],_0x373c50['value'][_0x4d84('0x26')]);}break;case _0x4d84('0x6b'):var _0x4a8caa=_0x47f859[_0x4d84('0x60')][_0x4d84('0x30')](',')[_0x4d84('0x2c')](function(_0x2bd90f){return Number(_0x2bd90f);});_0x4a8caa[_0x4d84('0x31')](function(_0xf28e1b){_0x3dc101['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xf28e1b+',%');});_0x429c1b=_[_0x4d84('0x6c')](_0x429c1b,_0x4a8caa);break;case _0x4d84('0x6d'):if(_0x47f859[_0x4d84('0x64')]==='$substring'){_0x58e2d5[_0x3eada9]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x47f859[_0x4d84('0x60')]+'%',null);}else{_0x1a385e=_[_0x4d84('0x5e')](_0x47ac06,[_0x4d84('0x29'),_0x4d84('0x6e')]);_0x47f859[_0x4d84('0x46')]=_0x4d84('0x6e');_0x373c50=as[_0x4d84('0x6f')](_0x2ba3db,_0x1a385e[_0x4d84('0x35')],_0x47f859);_0x58e2d5[_0x3eada9](_0x373c50[_0x4d84('0x69')],_0x373c50[_0x4d84('0x60')]['start'],_0x373c50[_0x4d84('0x60')][_0x4d84('0x26')]);}break;case'body':_0x373c50=as[_0x4d84('0x6f')]('me',null,_0x47f859);_0x58e2d5[_0x3eada9](_0x373c50['text'],_0x373c50[_0x4d84('0x60')]['start'],_0x373c50[_0x4d84('0x60')][_0x4d84('0x26')]);break;}}else{var _0x373c50=as[_0x4d84('0x6f')](_0x2ba3db,_0x1a385e[_0x4d84('0x35')],_0x47f859);_0x58e2d5[_0x3eada9](_0x373c50[_0x4d84('0x69')],_0x373c50[_0x4d84('0x60')][_0x4d84('0x6a')],_0x373c50[_0x4d84('0x60')]['end']);}}}else{var _0x1fcf1d=_(_0x3d2eee['query'])['keys']()[_0x4d84('0x2c')](function(_0x1c1193){return _[_0x4d84('0x70')](_0x47ac06,[_0x4d84('0x29'),_0x1c1193])?_0x1c1193:undefined;})['compact']()[_0x4d84('0x60')]();if(!_['isEmpty'](_0x1fcf1d)){_0x1fcf1d[_0x4d84('0x31')](function(_0x10a9ef){if(_0x10a9ef==='FaxAccountId'){_0x4785a1[_0x4d84('0x43')](_0x4d84('0x71'),[]['concat'](_0x3d2eee['query'][_0x10a9ef]));}else if(_0x10a9ef===_0x4d84('0x72')){var _0x24c07d=JSON[_0x4d84('0x73')](_0x3d2eee[_0x4d84('0x39')][_0x10a9ef])[_0x4d84('0x74')];var _0xb28f7c=JSON[_0x4d84('0x73')](_0x3d2eee['query'][_0x10a9ef])['$lte'];_0x4785a1[_0x4d84('0x43')](_0x4d84('0x75'),_0x24c07d,_0xb28f7c);}else{if(_0x3d2eee[_0x4d84('0x39')][_0x10a9ef]==='null'){_0x4785a1[_0x4d84('0x43')]('i.'+_0x10a9ef+'\x20IS\x20NULL');}else{_0x4785a1['where']('i.'+_0x10a9ef+'\x20=\x20?',_0x3d2eee[_0x4d84('0x39')][_0x10a9ef]);}}});}if(_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x76')]){if(_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x76')]==0x1){_0x4785a1['having'](_0x4d84('0x77'));}else{_0x4785a1[_0x4d84('0x61')](_0x4d84('0x78'));}}if(_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x79')]){_0x429c1b=_[_0x4d84('0x7a')](_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x79')])?_0x3d2eee[_0x4d84('0x39')]['tag']:new Array(_0x3d2eee['query']['tag']);_0x429c1b[_0x4d84('0x31')](function(_0x48996a){_0x3dc101['or'](_0x4d84('0x7b'),'%,'+_0x48996a+',%');});}if(_0x3d2eee['query']['filter']){var _0x16efc7=_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x7c')][_0x4d84('0x7d')]('\x5c','\x5c\x5c')[_0x4d84('0x7d')]('\x27\x27',_0x4d84('0x7e'));if(qs[_0x4d84('0x7f')](_0x16efc7)){_0x58e2d5['or'](_0x4d84('0x80'),_0x16efc7+'%')['or'](_0x4d84('0x81'),_0x16efc7+'%');}_0x58e2d5['or'](_0x4d84('0x82'),_0x16efc7+'%');}}_0x4785a1['where'](_0x58e2d5);_0x4785a1['group']('i.id');var _0x151659={'type':db['Sequelize'][_0x4d84('0x83')][_0x4d84('0x84')],'raw':!![]};var _0x4270cb=_0x4785a1['clone']();_0x4270cb[_0x4d84('0x46')](_0x4d84('0x85'));_0x4270cb['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x51f377['order']){_0x51f377[_0x4d84('0x41')]['forEach'](function(_0x12f65e){_0x4785a1[_0x4d84('0x41')]('i.'+_0x12f65e[0x0],_0x12f65e[0x1]===_0x4d84('0x86')?![]:!![]);});}if(!_[_0x4d84('0x87')](_0x429c1b)){_0x4785a1['having'](_0x3dc101);_0x4270cb[_0x4d84('0x43')](_0x4d84('0x88'),_0x429c1b);}BPromise['resolve']()[_0x4d84('0x25')](function(){if(!_0x26c8ce){if(_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x89')]||_0x3d2eee[_0x4d84('0x39')]['journey'])return;_0x4270cb[_0x4d84('0x43')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4785a1[_0x4d84('0x43')](_0x4d84('0x8a'));return;}return _0x3d2eee[_0x4d84('0x8b')][_0x4d84('0x8c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38b0c1){if(_['isEmpty'](_0x38b0c1)){_0x4270cb[_0x4d84('0x43')]('i.FaxAccountId\x20IS\x20NULL');_0x4785a1[_0x4d84('0x43')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x4270cb[_0x4d84('0x43')]('i.FaxAccountId\x20IN\x20?',_[_0x4d84('0x2c')](_0x38b0c1,'id'));_0x4785a1[_0x4d84('0x43')](_0x4d84('0x71'),_[_0x4d84('0x2c')](_0x38b0c1,'id'));}});})[_0x4d84('0x25')](function(){db[_0x4d84('0x8d')][_0x4d84('0x39')](_0x4270cb['toString'](),_0x151659)[_0x4d84('0x25')](function(_0x4fd348){_0x5c3fca[_0x4d84('0x8e')]=_0x4fd348[_0x4d84('0x3e')];if(_0x5c3fca[_0x4d84('0x8e')]===0x0)return[];return db[_0x4d84('0x8d')][_0x4d84('0x39')](_0xbf42c1[_0x4d84('0x8f')](),_0x151659)['then'](function(_0x5f382c){_0x4affef=_['keyBy'](_0x5f382c,'id');_0x151659=_[_0x4d84('0x90')](_0x151659,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d2eee[_0x4d84('0x39')][_0x4d84('0x3c')]){_0x51f377['attributes'][_0x4d84('0x31')](function(_0x5cfb82){_0x4785a1[_0x4d84('0x46')]('i.'+_0x5cfb82);});}else{_0x4785a1[_0x4d84('0x46')](_0x4d84('0x91'),_0x4d84('0x5f'));_0x4785a1[_0x4d84('0x46')](_0x4d84('0x92'),_0x4d84('0x93'));_0x4785a1[_0x4d84('0x46')](_0x4d84('0x94'),'Account.mandatoryDisposition');_0x4785a1[_0x4d84('0x46')]('i.*');_0x4785a1[_0x4d84('0x46')](_0x4d84('0x95'),_0x4d84('0x96'));_0x4785a1[_0x4d84('0x46')]('c.lastName','Contact.lastName');_0x4785a1[_0x4d84('0x46')]('c.email',_0x4d84('0x97'));_0x4785a1[_0x4d84('0x46')](_0x4d84('0x98'),_0x4d84('0x99'));_0x4785a1[_0x4d84('0x46')](_0x4d84('0x9a'),_0x4d84('0x9b'));_0x4785a1[_0x4d84('0x46')]('c.fax','Contact.fax');_0x4785a1[_0x4d84('0x46')](_0x4d84('0x9c'),_0x4d84('0x9d'));_0x4785a1[_0x4d84('0x46')](_0x4d84('0x9e'),'Owner.internal');_0x4785a1[_0x4d84('0x46')](_0x4d84('0x9f'),_0x4d84('0x2e'));}if(_0x51f377[_0x4d84('0x1c')])_0x4785a1['limit'](_0x51f377['limit']);if(_0x51f377[_0x4d84('0x1b')])_0x4785a1[_0x4d84('0x1b')](_0x51f377[_0x4d84('0x1b')]);return db['sequelize'][_0x4d84('0x39')](_0x4785a1['toString'](),_0x151659);})['then'](function(_0x4ed7fe){_0x52c0d8[_0x4d84('0x43')](_0x4d84('0xa0'),_[_0x4d84('0x2c')](_0x4ed7fe,'id'));return db[_0x4d84('0x8d')][_0x4d84('0x39')](_0x52c0d8[_0x4d84('0x8f')](),_0x151659)['then'](function(_0x2ff689){var _0x1bb7c7=_[_0x4d84('0xa1')](_0x2ff689,_0x4d84('0xa2'));var _0x52c61e=[];_0x4ed7fe[_0x4d84('0x31')](function(_0x24bc7d){_0x52c61e[_0x4d84('0x32')](updateFaxInteraction(_0x24bc7d,_0x4affef,_0x1bb7c7));});return BPromise[_0x4d84('0xa3')](_0x52c61e);});});})[_0x4d84('0x25')](function(_0x54c5f6){_0x5c3fca[_0x4d84('0xa4')]=_0x54c5f6;return _0x5c3fca;})[_0x4d84('0x25')](respondWithFilteredResult(_0x19904a,_0x51f377));})[_0x4d84('0xa5')](handleError(_0x19904a,null));};exports['show']=function(_0x5859d8,_0x14ba60){var _0x3fd219={'raw':![],'where':{'id':_0x5859d8[_0x4d84('0xa6')]['id']}},_0x4407ec={};_0x4407ec[_0x4d84('0x37')]=_[_0x4d84('0x38')](db[_0x4d84('0x33')][_0x4d84('0xa7')]);_0x4407ec['query']=_['keys'](_0x5859d8[_0x4d84('0x39')]);_0x4407ec[_0x4d84('0x3a')]=_[_0x4d84('0x3b')](_0x4407ec['model'],_0x4407ec[_0x4d84('0x39')]);_0x3fd219[_0x4d84('0x3d')]=_['intersection'](_0x4407ec['model'],qs['fields'](_0x5859d8[_0x4d84('0x39')][_0x4d84('0x3c')]));_0x3fd219[_0x4d84('0x3d')]=_0x3fd219[_0x4d84('0x3d')][_0x4d84('0x3e')]?_0x3fd219[_0x4d84('0x3d')]:_0x4407ec[_0x4d84('0x37')];if(_0x5859d8['query'][_0x4d84('0xa8')]){_0x3fd219['include']=[{'all':!![]}];}_0x3fd219=_[_0x4d84('0x90')]({},_0x3fd219,_0x5859d8[_0x4d84('0xa9')]);return db['FaxInteraction'][_0x4d84('0x5e')](_0x3fd219)[_0x4d84('0x25')](handleEntityNotFound(_0x14ba60,null))[_0x4d84('0x25')](respondWithResult(_0x14ba60,null))[_0x4d84('0xa5')](handleError(_0x14ba60,null));};exports['create']=function(_0x53bcb2,_0x351f94){return db['FaxInteraction']['create'](_0x53bcb2[_0x4d84('0xaa')],{})['then'](respondWithResult(_0x351f94,0xc9))[_0x4d84('0xa5')](handleError(_0x351f94,null));};exports[_0x4d84('0x23')]=function(_0x3bd624,_0x365b0e){if(_0x3bd624[_0x4d84('0xaa')]['id']){delete _0x3bd624[_0x4d84('0xaa')]['id'];}return db[_0x4d84('0x33')][_0x4d84('0x5e')]({'where':{'id':_0x3bd624['params']['id']}})[_0x4d84('0x25')](handleEntityNotFound(_0x365b0e,null))[_0x4d84('0x25')](saveUpdates(_0x3bd624[_0x4d84('0xaa')],null))[_0x4d84('0x25')](respondWithResult(_0x365b0e,null))[_0x4d84('0xa5')](handleError(_0x365b0e,null));};exports['destroy']=function(_0x4eb494,_0x3df3da){return db['FaxInteraction'][_0x4d84('0x5e')]({'where':{'id':_0x4eb494[_0x4d84('0xa6')]['id']}})[_0x4d84('0x25')](handleEntityNotFound(_0x3df3da,null))[_0x4d84('0x25')](removeEntity(_0x3df3da,null))[_0x4d84('0xa5')](handleError(_0x3df3da,null));};exports[_0x4d84('0xab')]=function(_0xb6b968,_0x262f59){return db[_0x4d84('0x33')]['describe']()['then'](respondWithResult(_0x262f59,null))['catch'](handleError(_0x262f59,null));};exports['addMessage']=function(_0x365653,_0x43ecae,_0x5147ad){return db[_0x4d84('0xac')]['find']({'where':{'id':_0x365653[_0x4d84('0xa6')]['id']}})[_0x4d84('0x25')](handleEntityNotFound(_0x43ecae,null))['then'](function(_0x23a589){if(_0x23a589){return _0x23a589[_0x4d84('0xad')](_0x365653[_0x4d84('0xaa')][_0x4d84('0xae')],_[_0x4d84('0xaf')](_0x365653[_0x4d84('0xaa')],[_0x4d84('0xae'),'id'])||{});}})['then'](respondWithResult(_0x43ecae,null))['catch'](handleError(_0x43ecae,null));};exports[_0x4d84('0xb0')]=function(_0x5f2c04,_0x1114de,_0x575980){var _0x516b65={'raw':![],'where':{}};var _0x2b1e54={};var _0x16acd1={'count':0x0,'rows':[]};return db[_0x4d84('0x33')][_0x4d84('0xb1')]({'where':{'id':_0x5f2c04[_0x4d84('0xa6')]['id']}})[_0x4d84('0x25')](handleEntityNotFound(_0x1114de,null))[_0x4d84('0x25')](function(_0x22310b){if(_0x22310b){_0x2b1e54[_0x4d84('0x37')]=_['keys'](db[_0x4d84('0xac')][_0x4d84('0xa7')]);_0x2b1e54[_0x4d84('0x39')]=_['keys'](_0x5f2c04[_0x4d84('0x39')]);_0x2b1e54[_0x4d84('0x3a')]=_[_0x4d84('0x3b')](_0x2b1e54[_0x4d84('0x37')],_0x2b1e54[_0x4d84('0x39')]);_0x516b65[_0x4d84('0x3d')]=_['intersection'](_0x2b1e54[_0x4d84('0x37')],qs['fields'](_0x5f2c04['query']['fields']));_0x516b65[_0x4d84('0x3d')]=_0x516b65[_0x4d84('0x3d')][_0x4d84('0x3e')]?_0x516b65['attributes']:_0x2b1e54[_0x4d84('0x37')];if(!_0x5f2c04[_0x4d84('0x39')]['hasOwnProperty'](_0x4d84('0x40'))){_0x516b65[_0x4d84('0x1c')]=qs['limit'](_0x5f2c04[_0x4d84('0x39')][_0x4d84('0x1c')]);_0x516b65['offset']=qs[_0x4d84('0x1b')](_0x5f2c04[_0x4d84('0x39')][_0x4d84('0x1b')]);}_0x516b65[_0x4d84('0x41')]=qs[_0x4d84('0x42')](_0x5f2c04[_0x4d84('0x39')][_0x4d84('0x42')]);_0x516b65[_0x4d84('0x43')]=qs[_0x4d84('0x3a')](_[_0x4d84('0x44')](_0x5f2c04[_0x4d84('0x39')],_0x2b1e54['filters']));_0x516b65[_0x4d84('0x43')][_0x4d84('0xa2')]=_0x22310b['id'];if(_0x5f2c04[_0x4d84('0x39')][_0x4d84('0x7c')]){_0x516b65[_0x4d84('0x43')]=_[_0x4d84('0x90')](_0x516b65[_0x4d84('0x43')],{'$or':_[_0x4d84('0x2c')](_0x516b65[_0x4d84('0x3d')],function(_0x31c709){var _0x1bb2a6={};_0x1bb2a6[_0x31c709]={'$like':'%'+_0x5f2c04[_0x4d84('0x39')][_0x4d84('0x7c')]+'%'};return _0x1bb2a6;})});}if(_0x5f2c04[_0x4d84('0x39')][_0x4d84('0x74')]){var _0x52af4d=_0x5f2c04[_0x4d84('0x39')][_0x4d84('0x74')][_0x4d84('0x30')](',');var _0x4657b1={};_0x4657b1[_0x52af4d[0x0]]={'$gte':moment(_0x52af4d[0x1])[_0x4d84('0xb2')](_0x4d84('0xb3'))};_0x516b65['where']=_[_0x4d84('0x90')](_0x516b65['where'],_0x4657b1);}_0x516b65=_[_0x4d84('0x90')]({},_0x516b65,_0x5f2c04[_0x4d84('0xa9')]);return db['FaxMessage']['count']({'where':_0x516b65['where']})[_0x4d84('0x25')](function(_0x2b91be){_0x16acd1[_0x4d84('0x8e')]=_0x2b91be;if(_0x5f2c04[_0x4d84('0x39')][_0x4d84('0xa8')]){_0x516b65['include']=[{'all':!![]}];}return db['FaxMessage'][_0x4d84('0xb4')](_0x516b65);})['then'](function(_0x43bd70){_0x16acd1[_0x4d84('0xa4')]=_0x43bd70;return _0x16acd1;});}})[_0x4d84('0x25')](respondWithFilteredResult(_0x1114de,_0x516b65))[_0x4d84('0xa5')](handleError(_0x1114de,null));};exports[_0x4d84('0xb5')]=function(_0x273442,_0x112498,_0x252603){return db['FaxInteraction'][_0x4d84('0x5e')]({'where':{'id':_0x273442[_0x4d84('0xa6')]['id']}})[_0x4d84('0x25')](handleEntityNotFound(_0x112498,null))[_0x4d84('0x25')](function(_0x444d4e){if(_0x444d4e){return _0x444d4e[_0x4d84('0xb6')](_0x273442[_0x4d84('0xaa')][_0x4d84('0xae')],_['omit'](_0x273442[_0x4d84('0xaa')],[_0x4d84('0xae'),'id'])||{})['spread'](function(){return db[_0x4d84('0x6b')][_0x4d84('0xb4')]({'attributes':['id',_0x4d84('0x29'),_0x4d84('0x47')],'where':{'id':_0x273442[_0x4d84('0xaa')]['ids']}});})[_0x4d84('0x25')](function(_0x4b4870){socket[_0x4d84('0xb7')](_0x4d84('0xb8'),{'id':Number(_0x273442['params']['id']),'tags':_0x4b4870||[]});return{'id':Number(_0x273442[_0x4d84('0xa6')]['id']),'tags':_0x4b4870||[]};});}})[_0x4d84('0x25')](respondWithResult(_0x112498,null))[_0x4d84('0xa5')](handleError(_0x112498,null));};exports[_0x4d84('0xb9')]=function(_0x57090f,_0xfebaed,_0xc5bcbb){return db[_0x4d84('0x33')]['find']({'where':{'id':_0x57090f[_0x4d84('0xa6')]['id']}})[_0x4d84('0x25')](handleEntityNotFound(_0xfebaed,null))[_0x4d84('0x25')](function(_0x59845e){if(_0x59845e){return _0x59845e[_0x4d84('0xb9')](_0x57090f[_0x4d84('0x39')]['ids']);}})[_0x4d84('0x25')](respondWithStatusCode(_0xfebaed,null))[_0x4d84('0xa5')](handleError(_0xfebaed,null));};exports[_0x4d84('0xba')]=function(_0x22479d,_0x13ca33){var _0x4690b4=moment()[_0x4d84('0xbb')]()[_0x4d84('0x8f')]();var _0x23bcde=path[_0x4d84('0xbc')](config[_0x4d84('0xbd')],'server',_0x4d84('0xbe'),_0x4d84('0xbf'));var _0x581f9b=path['join'](config[_0x4d84('0xbd')],_0x4d84('0xc0'),'files',_0x4d84('0xc1'));var _0x134850=path[_0x4d84('0xbc')](_0x23bcde,_0x4690b4);var _0x1a3e24=util['format']('transcript-%d-%s.zip',_0x22479d[_0x4d84('0xa6')]['id'],_0x4690b4);var _0x35aabe=path[_0x4d84('0xbc')](_0x23bcde,_0x1a3e24);var _0x1b74b6=[];_0x1b74b6[_0x4d84('0x32')]({'model':db[_0x4d84('0xc2')],'as':_0x4d84('0xc2'),'raw':!![]});var _0x512342=[{'model':db[_0x4d84('0xac')],'as':_0x4d84('0xc3'),'attributes':['id',_0x4d84('0xaa'),_0x4d84('0x72')],'include':_0x1b74b6}];return db[_0x4d84('0x33')][_0x4d84('0x5e')]({'where':{'id':_0x22479d[_0x4d84('0xa6')]['id']},'include':_0x512342})[_0x4d84('0x25')](handleEntityNotFound(_0x13ca33,null))[_0x4d84('0x25')](function(_0x3f7637){if(_0x3f7637&&_0x3f7637['Messages']){var _0x4016c2=_0x3f7637[_0x4d84('0xc4')]({'plain':!![]});fs[_0x4d84('0xc5')](_0x134850);for(var _0x34d596=0x0;_0x34d596<_0x4016c2[_0x4d84('0xc3')][_0x4d84('0x3e')];_0x34d596++){var _0x24b7a1=_0x4016c2[_0x4d84('0xc3')][_0x34d596]['Attachment'];if(_0x24b7a1){var _0x391b9e=path[_0x4d84('0xbc')](_0x581f9b,_0x24b7a1[_0x4d84('0xc6')]);if(fs[_0x4d84('0xc7')](_0x391b9e)){fs['createReadStream'](_0x391b9e)['pipe'](fs['createWriteStream'](path[_0x4d84('0xbc')](_0x134850,_0x24b7a1[_0x4d84('0xc6')])));}}}return BPromise['resolve']()[_0x4d84('0x25')](function(){return new BPromise(function(_0x164474,_0x57a281){zipdir(_0x134850,{'saveTo':_0x35aabe},function(_0x4547f2,_0x29f46c){if(_0x4547f2)return _0x57a281(_0x4547f2);return _0x164474(_0x29f46c);});})[_0x4d84('0x25')](function(){return new BPromise(function(_0x5491a6,_0x5ae3cd){rimraf(_0x134850,function(_0xbb0ba0){if(_0xbb0ba0)_0x5ae3cd(_0xbb0ba0);return _0x5491a6();});});})[_0x4d84('0x25')](function(){return _0x13ca33[_0x4d84('0xba')](_0x35aabe,_0x1a3e24,function(_0x1f6b3c){if(_0x1f6b3c){console[_0x4d84('0xc8')](_0x4d84('0xc9'),_0x1f6b3c);}else{fs['unlinkSync'](_0x35aabe);}});});});}else{return _0x13ca33[_0x4d84('0x19')](0xc8);}})[_0x4d84('0xa5')](handleError(_0x13ca33,null));};
\ No newline at end of file
+var _0x4ca7=['FaxInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','show','params','keys','includeAll','include','options','create','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','sort','findAll','rows','addTags','setTags','spread','emit','removeTags','download','unix','join','files','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','error','stack','name','send','map','fullname','Tags','TagIds','forEach','push','catch','index','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','select','field','color','u.id','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge'];(function(_0x5296c3,_0x41894f){var _0x2cf7b0=function(_0x4b6954){while(--_0x4b6954){_0x5296c3['push'](_0x5296c3['shift']());}};_0x2cf7b0(++_0x41894f);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x5a354c,_0xa8b91f){_0x5a354c=_0x5a354c-0x0;var _0xea1271=_0x4ca7[_0x5a354c];return _0xea1271;};'use strict';var pdf=require(_0x74ca('0x0'));var emlformat=require(_0x74ca('0x1'));var rimraf=require(_0x74ca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74ca('0x3'));var rp=require(_0x74ca('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x74ca('0x5'));var util=require('util');var path=require(_0x74ca('0x6'));var sox=require(_0x74ca('0x7'));var csv=require('to-csv');var ejs=require(_0x74ca('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x74ca('0x9'));var crypto=require(_0x74ca('0xa'));var jsforce=require(_0x74ca('0xb'));var deskjs=require(_0x74ca('0xc'));var toCsv=require(_0x74ca('0xd'));var querystring=require(_0x74ca('0xe'));var Papa=require(_0x74ca('0xf'));var Redis=require('ioredis');var authService=require(_0x74ca('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x74ca('0x11'));var hardwareService=require(_0x74ca('0x12'));var logger=require('../../config/logger')(_0x74ca('0x13'));var utils=require(_0x74ca('0x14'));var config=require(_0x74ca('0x15'));var db=require(_0x74ca('0x16'))['db'];config[_0x74ca('0x17')]=_[_0x74ca('0x18')](config[_0x74ca('0x17')],{'host':_0x74ca('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74ca('0x17')]));require(_0x74ca('0x1a'))[_0x74ca('0x1b')](socket);function respondWithStatusCode(_0x223a9d,_0x248a33){_0x248a33=_0x248a33||0xcc;return function(_0x276ea6){if(_0x276ea6){return _0x223a9d[_0x74ca('0x1c')](_0x248a33);}return _0x223a9d[_0x74ca('0x1d')](_0x248a33)[_0x74ca('0x1e')]();};}function respondWithResult(_0x196b51,_0x440310){_0x440310=_0x440310||0xc8;return function(_0x4606fe){if(_0x4606fe){return _0x196b51[_0x74ca('0x1d')](_0x440310)[_0x74ca('0x1f')](_0x4606fe);}};}function respondWithFilteredResult(_0x5464be,_0x22010a){return function(_0xa4f361){if(_0xa4f361){var _0xdc8fc7=_0xa4f361['count'],_0x392d58=_0x22010a[_0x74ca('0x20')],_0x42ab02=_0x22010a[_0x74ca('0x20')]+_0x22010a[_0x74ca('0x21')],_0x5769e1;if(_0x42ab02>=_0xdc8fc7){_0x42ab02=_0xdc8fc7;_0x5769e1=0xc8;}else{_0x5769e1=0xce;}_0x5464be[_0x74ca('0x1d')](_0x5769e1);return _0x5464be[_0x74ca('0x22')](_0x74ca('0x23'),_0x392d58+'-'+_0x42ab02+'/'+_0xdc8fc7)['json'](_0xa4f361);}return null;};}function patchUpdates(_0x37ac3e){return function(_0x3a3a6c){try{jsonpatch['apply'](_0x3a3a6c,_0x37ac3e,!![]);}catch(_0x5a77f4){return BPromise['reject'](_0x5a77f4);}return _0x3a3a6c[_0x74ca('0x24')]();};}function saveUpdates(_0x2f7bb1,_0x2ba9f2){return function(_0x6c2ba2){if(_0x6c2ba2){return _0x6c2ba2[_0x74ca('0x25')](_0x2f7bb1)[_0x74ca('0x26')](function(_0x1a48cf){return _0x1a48cf;});}return null;};}function removeEntity(_0x1c527b,_0x1ceb6c){return function(_0x25ca30){if(_0x25ca30){return _0x25ca30['destroy']()['then'](function(){_0x1c527b[_0x74ca('0x1d')](0xcc)[_0x74ca('0x1e')]();});}};}function handleEntityNotFound(_0x2eaef6,_0x1fe3ee){return function(_0x3ef087){if(!_0x3ef087){_0x2eaef6['sendStatus'](0x194);}return _0x3ef087;};}function handleError(_0x422dad,_0x13ef53){_0x13ef53=_0x13ef53||0x1f4;return function(_0xc6e885){logger[_0x74ca('0x27')](_0xc6e885[_0x74ca('0x28')]);if(_0xc6e885[_0x74ca('0x29')]){delete _0xc6e885[_0x74ca('0x29')];}_0x422dad[_0x74ca('0x1d')](_0x13ef53)[_0x74ca('0x2a')](_0xc6e885);};}function getInteractionUsers(_0x31d9b2,_0x3491ef){return new BPromise(function(_0x473f50,_0x4fff65){try{if(_0x3491ef[_0x31d9b2['id']]){_0x31d9b2['Users']=_[_0x74ca('0x2b')](_0x3491ef[_0x31d9b2['id']],function(_0x4ca38c){return{'id':_0x4ca38c['id'],'fullname':_0x4ca38c[_0x74ca('0x2c')]};});}}catch(_0x27da17){_0x4fff65(_0x27da17);}_0x473f50(_0x31d9b2);});}function getInteractionTags(_0x92cc29,_0x5edbd6){return new BPromise(function(_0xdee066,_0x425cd5){try{if(_0x92cc29['TagIds']){_0x92cc29[_0x74ca('0x2d')]=[];_0x92cc29[_0x74ca('0x2e')]['split'](',')[_0x74ca('0x2f')](function(_0x761513){_0x92cc29[_0x74ca('0x2d')][_0x74ca('0x30')](_0x5edbd6[_0x761513]);});}delete _0x92cc29[_0x74ca('0x2e')];}catch(_0x44a042){_0x425cd5(_0x44a042);}_0xdee066(_0x92cc29);});}function updateFaxInteraction(_0x3bd22b,_0x4f90d3,_0x4d3f62){return new BPromise(function(_0x14b8c,_0x25433c){return getInteractionUsers(_0x3bd22b,_0x4d3f62)[_0x74ca('0x26')](function(_0x1881a0){return getInteractionTags(_0x1881a0,_0x4f90d3);})[_0x74ca('0x26')](function(_0x24ff8e){_0x14b8c(_0x24ff8e);})[_0x74ca('0x31')](function(_0x5466e3){_0x25433c(_0x5466e3);});});}exports[_0x74ca('0x32')]=function(_0x3ffe1f,_0x391b44){var _0x349c5b={},_0x9a10c8={},_0x46da3e={'count':0x0,'rows':[]};var _0x3eacf8=_[_0x74ca('0x2b')](db['FaxInteraction'][_0x74ca('0x33')],function(_0x48bfc9){return{'name':_0x48bfc9[_0x74ca('0x34')],'type':_0x48bfc9['type'][_0x74ca('0x35')]};});_0x9a10c8[_0x74ca('0x36')]=_[_0x74ca('0x2b')](_0x3eacf8,_0x74ca('0x29'));_0x9a10c8[_0x74ca('0x37')]=_['keys'](_0x3ffe1f[_0x74ca('0x37')]);_0x9a10c8[_0x74ca('0x38')]=_['intersection'](_0x9a10c8[_0x74ca('0x36')],_0x9a10c8['query']);_0x349c5b[_0x74ca('0x39')]=_[_0x74ca('0x3a')](_0x9a10c8[_0x74ca('0x36')],qs[_0x74ca('0x3b')](_0x3ffe1f[_0x74ca('0x37')][_0x74ca('0x3b')]));_0x349c5b[_0x74ca('0x39')]=_0x349c5b['attributes'][_0x74ca('0x3c')]?_0x349c5b[_0x74ca('0x39')]:_0x9a10c8[_0x74ca('0x36')];if(!_0x3ffe1f[_0x74ca('0x37')][_0x74ca('0x3d')](_0x74ca('0x3e'))){_0x349c5b[_0x74ca('0x21')]=qs[_0x74ca('0x21')](_0x3ffe1f[_0x74ca('0x37')][_0x74ca('0x21')]);_0x349c5b[_0x74ca('0x20')]=qs['offset'](_0x3ffe1f['query'][_0x74ca('0x20')]);}_0x349c5b[_0x74ca('0x3f')]=qs['sort'](_0x3ffe1f[_0x74ca('0x37')]['sort']);_0x349c5b[_0x74ca('0x40')]=qs[_0x74ca('0x38')](_[_0x74ca('0x41')](_0x3ffe1f[_0x74ca('0x37')],_0x9a10c8['filters']),_0x3eacf8);var _0x10111e=[];var _0x15a093=squel[_0x74ca('0x42')]()[_0x74ca('0x43')]('id')['field']('name')[_0x74ca('0x43')](_0x74ca('0x44'))['from']('tools_tags');var _0x356e96=squel[_0x74ca('0x42')]()[_0x74ca('0x43')](_0x74ca('0x45'))['field']('u.fullname')['field'](_0x74ca('0x46'))[_0x74ca('0x47')](_0x74ca('0x48'),'ui')[_0x74ca('0x49')]('users','u','u.id\x20=\x20ui.UserId');var _0xa75116=squel[_0x74ca('0x42')]()[_0x74ca('0x47')](_0x74ca('0x4a'),'i')[_0x74ca('0x49')](_0x74ca('0x4b'),'c',_0x74ca('0x4c'))[_0x74ca('0x49')]('users','o',_0x74ca('0x4d'))['left_join'](_0x74ca('0x4e'),'a',_0x74ca('0x4f'))[_0x74ca('0x49')](_0x74ca('0x50'),'me',_0x74ca('0x51'))[_0x74ca('0x49')](_0x74ca('0x52'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x74ca('0x49')](_0x74ca('0x53'),'t',_0x74ca('0x54'));var _0x29711a=squel['expr']();var _0x1cc850=[];var _0x337b97=squel[_0x74ca('0x55')]();var _0x5f44e8;if(_0x3ffe1f['query'][_0x74ca('0x56')]){_0x5f44e8=as[_0x74ca('0x57')](_0x3ffe1f[_0x74ca('0x37')]['search']);var _0x1d490e=_0x5f44e8['sqlOperator'];for(var _0x3e2859=0x0;_0x3e2859<_0x5f44e8[_0x74ca('0x58')][_0x74ca('0x3c')];_0x3e2859++){var _0x74d6a0=_0x5f44e8['conditions'][_0x3e2859];var _0x3c4ef6='i';var _0x1a0711=_[_0x74ca('0x59')](_0x3eacf8,[_0x74ca('0x29'),_0x74d6a0[_0x74ca('0x43')]]);if(!_0x1a0711){switch(_0x74d6a0['field']){case _0x74ca('0x5a'):if(_0x74d6a0[_0x74ca('0x5b')]==0x1){_0xa75116[_0x74ca('0x5c')]('`'+_0x74d6a0['field']+_0x74ca('0x5d'));}else{_0xa75116['having']('`'+_0x74d6a0[_0x74ca('0x43')]+_0x74ca('0x5e'));}break;case _0x74ca('0x5f'):if(_0x74d6a0[_0x74ca('0x60')]===_0x74ca('0x61')){if(_0x74d6a0[_0x74ca('0x5b')][_0x74ca('0x62')]('\x20')[_0x74ca('0x3c')]>0x1){_0x29711a[_0x1d490e](_0x74ca('0x63'),qs[_0x74ca('0x64')](_0x74d6a0['value']),null);}else{var _0x2570cb='%'+_0x74d6a0[_0x74ca('0x5b')]+'%';_0x29711a[_0x1d490e](_0x74ca('0x65'),_0x2570cb,_0x2570cb,_0x2570cb);}}else{_0x1a0711=_[_0x74ca('0x59')](_0x3eacf8,[_0x74ca('0x29'),_0x74ca('0x66')]);_0x74d6a0[_0x74ca('0x43')]=_0x74ca('0x66');_0x5572d9=as[_0x74ca('0x67')](_0x3c4ef6,_0x1a0711[_0x74ca('0x68')],_0x74d6a0);_0x29711a[_0x1d490e](_0x5572d9[_0x74ca('0x69')],_0x5572d9[_0x74ca('0x5b')][_0x74ca('0x6a')],_0x5572d9[_0x74ca('0x5b')][_0x74ca('0x1e')]);}break;case _0x74ca('0x6b'):var _0x4a9553=_0x74d6a0[_0x74ca('0x5b')][_0x74ca('0x62')](',')['map'](function(_0x55139e){return Number(_0x55139e);});_0x4a9553[_0x74ca('0x2f')](function(_0x27d389){_0x337b97['or'](_0x74ca('0x6c'),'%,'+_0x27d389+',%');});_0x1cc850=_[_0x74ca('0x6d')](_0x1cc850,_0x4a9553);break;case'User':if(_0x74d6a0[_0x74ca('0x60')]===_0x74ca('0x61')){_0x29711a[_0x1d490e](_0x74ca('0x6e'),'%'+_0x74d6a0[_0x74ca('0x5b')]+'%',null);}else{_0x1a0711=_[_0x74ca('0x59')](_0x3eacf8,[_0x74ca('0x29'),'UserId']);_0x74d6a0['field']=_0x74ca('0x6f');_0x5572d9=as[_0x74ca('0x67')](_0x3c4ef6,_0x1a0711[_0x74ca('0x68')],_0x74d6a0);_0x29711a[_0x1d490e](_0x5572d9[_0x74ca('0x69')],_0x5572d9[_0x74ca('0x5b')][_0x74ca('0x6a')],_0x5572d9[_0x74ca('0x5b')][_0x74ca('0x1e')]);}break;case _0x74ca('0x70'):_0x5572d9=as[_0x74ca('0x67')]('me',null,_0x74d6a0);_0x29711a[_0x1d490e](_0x5572d9['text'],_0x5572d9['value'][_0x74ca('0x6a')],_0x5572d9[_0x74ca('0x5b')][_0x74ca('0x1e')]);break;}}else{var _0x5572d9=as[_0x74ca('0x67')](_0x3c4ef6,_0x1a0711[_0x74ca('0x68')],_0x74d6a0);_0x29711a[_0x1d490e](_0x5572d9[_0x74ca('0x69')],_0x5572d9['value'][_0x74ca('0x6a')],_0x5572d9[_0x74ca('0x5b')]['end']);}}}else{var _0x29cc1e=_(_0x3ffe1f[_0x74ca('0x37')])['keys']()[_0x74ca('0x2b')](function(_0x357711){return _['some'](_0x3eacf8,[_0x74ca('0x29'),_0x357711])?_0x357711:undefined;})[_0x74ca('0x71')]()[_0x74ca('0x5b')]();if(!_[_0x74ca('0x72')](_0x29cc1e)){_0x29cc1e[_0x74ca('0x2f')](function(_0x3a43c3){if(_0x3a43c3===_0x74ca('0x73')){_0xa75116[_0x74ca('0x40')](_0x74ca('0x74'),[][_0x74ca('0x75')](_0x3ffe1f[_0x74ca('0x37')][_0x3a43c3]));}else if(_0x3a43c3===_0x74ca('0x76')){var _0xa709fa=JSON[_0x74ca('0x77')](_0x3ffe1f[_0x74ca('0x37')][_0x3a43c3])[_0x74ca('0x78')];var _0x234081=JSON[_0x74ca('0x77')](_0x3ffe1f['query'][_0x3a43c3])[_0x74ca('0x79')];_0xa75116[_0x74ca('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xa709fa,_0x234081);}else{if(_0x3ffe1f[_0x74ca('0x37')][_0x3a43c3]===_0x74ca('0x7a')){_0xa75116[_0x74ca('0x40')]('i.'+_0x3a43c3+'\x20IS\x20NULL');}else{_0xa75116['where']('i.'+_0x3a43c3+'\x20=\x20?',_0x3ffe1f['query'][_0x3a43c3]);}}});}if(_0x3ffe1f['query'][_0x74ca('0x7b')]){if(_0x3ffe1f[_0x74ca('0x37')][_0x74ca('0x7b')]==0x1){_0xa75116[_0x74ca('0x5c')](_0x74ca('0x7c'));}else{_0xa75116[_0x74ca('0x5c')](_0x74ca('0x7d'));}}if(_0x3ffe1f[_0x74ca('0x37')]['tag']){_0x1cc850=_['isArray'](_0x3ffe1f[_0x74ca('0x37')][_0x74ca('0x7e')])?_0x3ffe1f[_0x74ca('0x37')]['tag']:new Array(_0x3ffe1f['query']['tag']);_0x1cc850[_0x74ca('0x2f')](function(_0x465ecc){_0x337b97['or'](_0x74ca('0x6c'),'%,'+_0x465ecc+',%');});}if(_0x3ffe1f['query'][_0x74ca('0x7f')]){var _0xb81ba0=_0x3ffe1f['query'][_0x74ca('0x7f')][_0x74ca('0x80')]('\x5c','\x5c\x5c')[_0x74ca('0x80')]('\x27\x27',_0x74ca('0x81'));if(qs[_0x74ca('0x82')](_0xb81ba0)){_0x29711a['or']('i.id\x20LIKE\x20?',_0xb81ba0+'%')['or'](_0x74ca('0x83'),_0xb81ba0+'%');}_0x29711a['or'](_0x74ca('0x84'),_0xb81ba0+'%');}}_0xa75116['where'](_0x29711a);_0xa75116[_0x74ca('0x85')](_0x74ca('0x86'));var _0x429efd={'type':db[_0x74ca('0x87')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3acca8=_0xa75116['clone']();_0x3acca8[_0x74ca('0x43')](_0x74ca('0x86'));_0x3acca8['field'](_0x74ca('0x88'),_0x74ca('0x5a'));if(_0x349c5b[_0x74ca('0x3f')]){_0x349c5b[_0x74ca('0x3f')][_0x74ca('0x2f')](function(_0x51623a){_0xa75116[_0x74ca('0x3f')]('i.'+_0x51623a[0x0],_0x51623a[0x1]===_0x74ca('0x89')?![]:!![]);});}if(!_[_0x74ca('0x72')](_0x1cc850)){_0xa75116[_0x74ca('0x5c')](_0x337b97);_0x3acca8[_0x74ca('0x40')](_0x74ca('0x8a'),_0x1cc850);}BPromise[_0x74ca('0x8b')]()[_0x74ca('0x26')](function(){if(!_0x5f44e8){if(_0x3ffe1f[_0x74ca('0x37')][_0x74ca('0x73')]||_0x3ffe1f[_0x74ca('0x37')][_0x74ca('0x8c')])return;_0x3acca8['where'](_0x74ca('0x8d'));_0xa75116[_0x74ca('0x40')](_0x74ca('0x8d'));return;}return _0x3ffe1f[_0x74ca('0x8e')][_0x74ca('0x8f')]({'attributes':['id'],'raw':!![]})[_0x74ca('0x26')](function(_0x422128){if(_[_0x74ca('0x72')](_0x422128)){_0x3acca8[_0x74ca('0x40')](_0x74ca('0x90'));_0xa75116[_0x74ca('0x40')](_0x74ca('0x90'));}else{_0x3acca8[_0x74ca('0x40')](_0x74ca('0x74'),_[_0x74ca('0x2b')](_0x422128,'id'));_0xa75116['where']('i.FaxAccountId\x20IN\x20?',_['map'](_0x422128,'id'));}});})[_0x74ca('0x26')](function(){db['sequelize'][_0x74ca('0x37')](_0x3acca8[_0x74ca('0x91')](),_0x429efd)['then'](function(_0x1b7437){_0x46da3e[_0x74ca('0x92')]=_0x1b7437[_0x74ca('0x3c')];if(_0x46da3e[_0x74ca('0x92')]===0x0)return[];return db[_0x74ca('0x93')][_0x74ca('0x37')](_0x15a093[_0x74ca('0x91')](),_0x429efd)[_0x74ca('0x26')](function(_0xd9fcff){_0x10111e=_[_0x74ca('0x94')](_0xd9fcff,'id');_0x429efd=_[_0x74ca('0x95')](_0x429efd,{'model':db[_0x74ca('0x96')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ffe1f[_0x74ca('0x37')][_0x74ca('0x3b')]){_0x349c5b[_0x74ca('0x39')][_0x74ca('0x2f')](function(_0x5c86c5){_0xa75116[_0x74ca('0x43')]('i.'+_0x5c86c5);});}else{_0xa75116[_0x74ca('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x74ca('0x5a'));_0xa75116[_0x74ca('0x43')](_0x74ca('0x97'),'Account.key');_0xa75116[_0x74ca('0x43')](_0x74ca('0x98'),_0x74ca('0x99'));_0xa75116[_0x74ca('0x43')]('i.*');_0xa75116[_0x74ca('0x43')](_0x74ca('0x9a'),_0x74ca('0x9b'));_0xa75116['field'](_0x74ca('0x9c'),_0x74ca('0x9d'));_0xa75116['field'](_0x74ca('0x9e'),_0x74ca('0x9f'));_0xa75116[_0x74ca('0x43')](_0x74ca('0xa0'),_0x74ca('0xa1'));_0xa75116['field']('c.mobile',_0x74ca('0xa2'));_0xa75116[_0x74ca('0x43')](_0x74ca('0xa3'),'Contact.fax');_0xa75116[_0x74ca('0x43')](_0x74ca('0xa4'),_0x74ca('0xa5'));_0xa75116[_0x74ca('0x43')](_0x74ca('0xa6'),_0x74ca('0xa7'));_0xa75116[_0x74ca('0x43')](_0x74ca('0xa8'),_0x74ca('0x2e'));}if(_0x349c5b[_0x74ca('0x21')])_0xa75116[_0x74ca('0x21')](_0x349c5b['limit']);if(_0x349c5b[_0x74ca('0x20')])_0xa75116['offset'](_0x349c5b['offset']);return db[_0x74ca('0x93')][_0x74ca('0x37')](_0xa75116[_0x74ca('0x91')](),_0x429efd);})[_0x74ca('0x26')](function(_0x3bbcae){_0x356e96[_0x74ca('0x40')]('ui.FaxInteractionId\x20IN\x20?',_[_0x74ca('0x2b')](_0x3bbcae,'id'));return db[_0x74ca('0x93')]['query'](_0x356e96[_0x74ca('0x91')](),_0x429efd)[_0x74ca('0x26')](function(_0x5a3523){var _0xdd5cbf=_[_0x74ca('0xa9')](_0x5a3523,_0x74ca('0xaa'));var _0x2f887c=[];_0x3bbcae[_0x74ca('0x2f')](function(_0x43369d){_0x2f887c[_0x74ca('0x30')](updateFaxInteraction(_0x43369d,_0x10111e,_0xdd5cbf));});return BPromise[_0x74ca('0xab')](_0x2f887c);});});})[_0x74ca('0x26')](function(_0x1fc629){_0x46da3e['rows']=_0x1fc629;return _0x46da3e;})[_0x74ca('0x26')](respondWithFilteredResult(_0x391b44,_0x349c5b));})[_0x74ca('0x31')](handleError(_0x391b44,null));};exports[_0x74ca('0xac')]=function(_0x3f8c78,_0x3e1607){var _0x59fbb7={'raw':![],'where':{'id':_0x3f8c78[_0x74ca('0xad')]['id']}},_0x5515e6={};_0x5515e6[_0x74ca('0x36')]=_['keys'](db['FaxInteraction'][_0x74ca('0x33')]);_0x5515e6[_0x74ca('0x37')]=_[_0x74ca('0xae')](_0x3f8c78['query']);_0x5515e6['filters']=_[_0x74ca('0x3a')](_0x5515e6[_0x74ca('0x36')],_0x5515e6['query']);_0x59fbb7['attributes']=_[_0x74ca('0x3a')](_0x5515e6['model'],qs[_0x74ca('0x3b')](_0x3f8c78[_0x74ca('0x37')][_0x74ca('0x3b')]));_0x59fbb7[_0x74ca('0x39')]=_0x59fbb7[_0x74ca('0x39')][_0x74ca('0x3c')]?_0x59fbb7[_0x74ca('0x39')]:_0x5515e6[_0x74ca('0x36')];if(_0x3f8c78[_0x74ca('0x37')][_0x74ca('0xaf')]){_0x59fbb7[_0x74ca('0xb0')]=[{'all':!![]}];}_0x59fbb7=_['merge']({},_0x59fbb7,_0x3f8c78[_0x74ca('0xb1')]);return db[_0x74ca('0x96')][_0x74ca('0x59')](_0x59fbb7)[_0x74ca('0x26')](handleEntityNotFound(_0x3e1607,null))[_0x74ca('0x26')](respondWithResult(_0x3e1607,null))[_0x74ca('0x31')](handleError(_0x3e1607,null));};exports[_0x74ca('0xb2')]=function(_0x27cc16,_0xf635ac){return db['FaxInteraction'][_0x74ca('0xb2')](_0x27cc16[_0x74ca('0x70')],{})[_0x74ca('0x26')](respondWithResult(_0xf635ac,0xc9))[_0x74ca('0x31')](handleError(_0xf635ac,null));};exports['update']=function(_0x14ba48,_0x2cf7d9){if(_0x14ba48[_0x74ca('0x70')]['id']){delete _0x14ba48[_0x74ca('0x70')]['id'];}return db['FaxInteraction'][_0x74ca('0x59')]({'where':{'id':_0x14ba48[_0x74ca('0xad')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x2cf7d9,null))[_0x74ca('0x26')](saveUpdates(_0x14ba48[_0x74ca('0x70')],null))[_0x74ca('0x26')](respondWithResult(_0x2cf7d9,null))[_0x74ca('0x31')](handleError(_0x2cf7d9,null));};exports[_0x74ca('0xb3')]=function(_0x213c08,_0x17a316){return db['FaxInteraction'][_0x74ca('0x59')]({'where':{'id':_0x213c08[_0x74ca('0xad')]['id']}})['then'](handleEntityNotFound(_0x17a316,null))[_0x74ca('0x26')](removeEntity(_0x17a316,null))[_0x74ca('0x31')](handleError(_0x17a316,null));};exports[_0x74ca('0xb4')]=function(_0x44ad1a,_0x26cfd0){return db[_0x74ca('0x96')]['describe']()[_0x74ca('0x26')](respondWithResult(_0x26cfd0,null))['catch'](handleError(_0x26cfd0,null));};exports[_0x74ca('0xb5')]=function(_0x2b6073,_0x248453,_0x37932f){return db[_0x74ca('0xb6')]['find']({'where':{'id':_0x2b6073[_0x74ca('0xad')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x248453,null))[_0x74ca('0x26')](function(_0x11f9a9){if(_0x11f9a9){return _0x11f9a9['addMessage'](_0x2b6073['body'][_0x74ca('0xb7')],_[_0x74ca('0xb8')](_0x2b6073[_0x74ca('0x70')],[_0x74ca('0xb7'),'id'])||{});}})[_0x74ca('0x26')](respondWithResult(_0x248453,null))[_0x74ca('0x31')](handleError(_0x248453,null));};exports[_0x74ca('0xb9')]=function(_0x1992f4,_0x5389f8,_0x24c633){var _0x1cc8bc={'raw':![],'where':{}};var _0x7fe7a1={};var _0x1c23bc={'count':0x0,'rows':[]};return db[_0x74ca('0x96')][_0x74ca('0xba')]({'where':{'id':_0x1992f4[_0x74ca('0xad')]['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x5389f8,null))[_0x74ca('0x26')](function(_0x353eca){if(_0x353eca){_0x7fe7a1[_0x74ca('0x36')]=_[_0x74ca('0xae')](db['FaxMessage'][_0x74ca('0x33')]);_0x7fe7a1[_0x74ca('0x37')]=_['keys'](_0x1992f4[_0x74ca('0x37')]);_0x7fe7a1[_0x74ca('0x38')]=_['intersection'](_0x7fe7a1[_0x74ca('0x36')],_0x7fe7a1[_0x74ca('0x37')]);_0x1cc8bc[_0x74ca('0x39')]=_[_0x74ca('0x3a')](_0x7fe7a1['model'],qs['fields'](_0x1992f4[_0x74ca('0x37')][_0x74ca('0x3b')]));_0x1cc8bc[_0x74ca('0x39')]=_0x1cc8bc[_0x74ca('0x39')]['length']?_0x1cc8bc[_0x74ca('0x39')]:_0x7fe7a1[_0x74ca('0x36')];if(!_0x1992f4[_0x74ca('0x37')][_0x74ca('0x3d')](_0x74ca('0x3e'))){_0x1cc8bc[_0x74ca('0x21')]=qs['limit'](_0x1992f4['query']['limit']);_0x1cc8bc[_0x74ca('0x20')]=qs[_0x74ca('0x20')](_0x1992f4[_0x74ca('0x37')][_0x74ca('0x20')]);}_0x1cc8bc[_0x74ca('0x3f')]=qs[_0x74ca('0xbb')](_0x1992f4[_0x74ca('0x37')][_0x74ca('0xbb')]);_0x1cc8bc[_0x74ca('0x40')]=qs['filters'](_[_0x74ca('0x41')](_0x1992f4[_0x74ca('0x37')],_0x7fe7a1[_0x74ca('0x38')]));_0x1cc8bc['where'][_0x74ca('0xaa')]=_0x353eca['id'];if(_0x1992f4[_0x74ca('0x37')][_0x74ca('0x7f')]){_0x1cc8bc[_0x74ca('0x40')]=_['merge'](_0x1cc8bc[_0x74ca('0x40')],{'$or':_[_0x74ca('0x2b')](_0x1cc8bc[_0x74ca('0x39')],function(_0x4a737f){var _0xb2e0d2={};_0xb2e0d2[_0x4a737f]={'$like':'%'+_0x1992f4[_0x74ca('0x37')][_0x74ca('0x7f')]+'%'};return _0xb2e0d2;})});}if(_0x1992f4[_0x74ca('0x37')][_0x74ca('0x78')]){var _0x54709b=_0x1992f4[_0x74ca('0x37')]['$gte'][_0x74ca('0x62')](',');var _0x4946a8={};_0x4946a8[_0x54709b[0x0]]={'$gte':moment(_0x54709b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1cc8bc[_0x74ca('0x40')]=_['merge'](_0x1cc8bc[_0x74ca('0x40')],_0x4946a8);}_0x1cc8bc=_[_0x74ca('0x95')]({},_0x1cc8bc,_0x1992f4[_0x74ca('0xb1')]);return db[_0x74ca('0xb6')]['count']({'where':_0x1cc8bc[_0x74ca('0x40')]})['then'](function(_0x574457){_0x1c23bc[_0x74ca('0x92')]=_0x574457;if(_0x1992f4[_0x74ca('0x37')][_0x74ca('0xaf')]){_0x1cc8bc[_0x74ca('0xb0')]=[{'all':!![]}];}return db[_0x74ca('0xb6')][_0x74ca('0xbc')](_0x1cc8bc);})[_0x74ca('0x26')](function(_0x300930){_0x1c23bc[_0x74ca('0xbd')]=_0x300930;return _0x1c23bc;});}})[_0x74ca('0x26')](respondWithFilteredResult(_0x5389f8,_0x1cc8bc))[_0x74ca('0x31')](handleError(_0x5389f8,null));};exports[_0x74ca('0xbe')]=function(_0x40fe88,_0x4f5ac8,_0x4d973c){return db[_0x74ca('0x96')][_0x74ca('0x59')]({'where':{'id':_0x40fe88[_0x74ca('0xad')]['id']}})['then'](handleEntityNotFound(_0x4f5ac8,null))[_0x74ca('0x26')](function(_0x5e110a){if(_0x5e110a){return _0x5e110a[_0x74ca('0xbf')](_0x40fe88[_0x74ca('0x70')][_0x74ca('0xb7')],_[_0x74ca('0xb8')](_0x40fe88['body'],[_0x74ca('0xb7'),'id'])||{})[_0x74ca('0xc0')](function(){return db[_0x74ca('0x6b')][_0x74ca('0xbc')]({'attributes':['id',_0x74ca('0x29'),_0x74ca('0x44')],'where':{'id':_0x40fe88[_0x74ca('0x70')][_0x74ca('0xb7')]}});})[_0x74ca('0x26')](function(_0x24956b){socket[_0x74ca('0xc1')]('faxInteractionTags:save',{'id':Number(_0x40fe88[_0x74ca('0xad')]['id']),'tags':_0x24956b||[]});return{'id':Number(_0x40fe88[_0x74ca('0xad')]['id']),'tags':_0x24956b||[]};});}})[_0x74ca('0x26')](respondWithResult(_0x4f5ac8,null))[_0x74ca('0x31')](handleError(_0x4f5ac8,null));};exports['removeTags']=function(_0x3478cb,_0x5ece14,_0x5cbc22){return db[_0x74ca('0x96')][_0x74ca('0x59')]({'where':{'id':_0x3478cb['params']['id']}})[_0x74ca('0x26')](handleEntityNotFound(_0x5ece14,null))[_0x74ca('0x26')](function(_0x18d11a){if(_0x18d11a){return _0x18d11a[_0x74ca('0xc2')](_0x3478cb['query'][_0x74ca('0xb7')]);}})['then'](respondWithStatusCode(_0x5ece14,null))[_0x74ca('0x31')](handleError(_0x5ece14,null));};exports[_0x74ca('0xc3')]=function(_0x343d35,_0x58cff9){var _0x244f83=moment()[_0x74ca('0xc4')]()['toString']();var _0x5543bb=path[_0x74ca('0xc5')](config['root'],'server',_0x74ca('0xc6'),_0x74ca('0xc7'));var _0x5ce90f=path[_0x74ca('0xc5')](config['root'],'server',_0x74ca('0xc6'),_0x74ca('0xc8'));var _0x41dea7=path[_0x74ca('0xc5')](_0x5543bb,_0x244f83);var _0x4a4107=util[_0x74ca('0xc9')](_0x74ca('0xca'),_0x343d35[_0x74ca('0xad')]['id'],_0x244f83);var _0xdf65d8=path[_0x74ca('0xc5')](_0x5543bb,_0x4a4107);var _0x2bb0a7=[];_0x2bb0a7[_0x74ca('0x30')]({'model':db[_0x74ca('0xcb')],'as':_0x74ca('0xcb'),'raw':!![]});var _0xf1eff7=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x74ca('0x70'),_0x74ca('0x76')],'include':_0x2bb0a7}];return db[_0x74ca('0x96')][_0x74ca('0x59')]({'where':{'id':_0x343d35['params']['id']},'include':_0xf1eff7})[_0x74ca('0x26')](handleEntityNotFound(_0x58cff9,null))[_0x74ca('0x26')](function(_0x33f29b){if(_0x33f29b&&_0x33f29b[_0x74ca('0xcc')]){var _0x5d2f6a=_0x33f29b['get']({'plain':!![]});fs[_0x74ca('0xcd')](_0x41dea7);for(var _0x1a325a=0x0;_0x1a325a<_0x5d2f6a[_0x74ca('0xcc')]['length'];_0x1a325a++){var _0x293e51=_0x5d2f6a[_0x74ca('0xcc')][_0x1a325a][_0x74ca('0xcb')];if(_0x293e51){var _0x4234ea=path[_0x74ca('0xc5')](_0x5ce90f,_0x293e51[_0x74ca('0xce')]);if(fs[_0x74ca('0xcf')](_0x4234ea)){fs[_0x74ca('0xd0')](_0x4234ea)[_0x74ca('0xd1')](fs['createWriteStream'](path[_0x74ca('0xc5')](_0x41dea7,_0x293e51['basename'])));}}}return BPromise['resolve']()[_0x74ca('0x26')](function(){return new BPromise(function(_0x3f5085,_0x207a72){zipdir(_0x41dea7,{'saveTo':_0xdf65d8},function(_0x2c7eaa,_0x2ee5b2){if(_0x2c7eaa)return _0x207a72(_0x2c7eaa);return _0x3f5085(_0x2ee5b2);});})[_0x74ca('0x26')](function(){return new BPromise(function(_0x49a261,_0x4da994){rimraf(_0x41dea7,function(_0x8082ec){if(_0x8082ec)_0x4da994(_0x8082ec);return _0x49a261();});});})[_0x74ca('0x26')](function(){return _0x58cff9[_0x74ca('0xc3')](_0xdf65d8,_0x4a4107,function(_0x224abb){if(_0x224abb){console['log'](_0x74ca('0xd2'),_0x224abb);}else{fs['unlinkSync'](_0xdf65d8);}});});});}else{return _0x58cff9[_0x74ca('0x1c')](0xc8);}})[_0x74ca('0x31')](handleError(_0x58cff9,null));};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js
index 70e4da5..fdbdab8 100644
--- a/server/api/faxInteraction/faxInteraction.events.js
+++ b/server/api/faxInteraction/faxInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','getUsers','then','setDataValue','findAll'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc4aa[_0x1e4360];return _0x31e6b4;};'use strict';var EventEmitter=require(_0xac4a('0x0'));var FaxInteraction=require(_0xac4a('0x1'))['db'][_0xac4a('0x2')];var FaxMessage=require(_0xac4a('0x1'))['db'][_0xac4a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xac4a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f48ed){return function(_0x15b967,_0x730a38,_0x215f39){_0x15b967[_0xac4a('0x5')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x6')](function(_0x3ef77c){_0x15b967[_0xac4a('0x7')]('Users',_0x3ef77c['map'](function(_0x1aba6d){return{'id':_0x1aba6d['id']};}));return FaxMessage[_0xac4a('0x8')]({'where':{'FaxInteractionId':_0x15b967['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac4a('0x6')](function(_0x4f4146){_0x15b967[_0xac4a('0x7')](_0xac4a('0x9'),_0x4f4146[_0xac4a('0xa')]);FaxInteractionEvents['emit'](_0x2f48ed+':'+_0x15b967['id'],_0x15b967);FaxInteractionEvents[_0xac4a('0xb')](_0x2f48ed,_0x15b967);_0x215f39(null);})['catch'](_0x215f39(null));};}for(var e in events){if(events[_0xac4a('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xac4a('0xd')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x2ef3=['remove','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ef3,0xba));var _0x32ef=function(_0x3403f9,_0x477527){_0x3403f9=_0x3403f9-0x0;var _0x6d0cd=_0x2ef3[_0x3403f9];return _0x6d0cd;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var FaxInteraction=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var FaxMessage=require(_0x32ef('0x1'))['db'][_0x32ef('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x32ef('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32ef('0x5'),'afterDestroy':_0x32ef('0x6')};function emitEvent(_0x524ab6){return function(_0x402857,_0x37dd1d,_0x4c8104){_0x402857['getUsers']({'attributes':['id'],'raw':!![]})[_0x32ef('0x7')](function(_0x4bfcf8){_0x402857[_0x32ef('0x8')](_0x32ef('0x9'),_0x4bfcf8[_0x32ef('0xa')](function(_0x298066){return{'id':_0x298066['id']};}));return FaxMessage[_0x32ef('0xb')]({'where':{'FaxInteractionId':_0x402857['id'],'direction':'in','read':![]},'raw':!![]});})[_0x32ef('0x7')](function(_0x28275c){_0x402857[_0x32ef('0x8')]('unreadMessages',_0x28275c['length']);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6+':'+_0x402857['id'],_0x402857);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6,_0x402857);_0x4c8104(null);})[_0x32ef('0xd')](_0x4c8104(null));};}for(var e in events){if(events[_0x32ef('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x32ef('0xf')]=FaxInteractionEvents;
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js
index a6ceda2..378addc 100644
--- a/server/api/faxInteraction/faxInteraction.model.js
+++ b/server/api/faxInteraction/faxInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4483=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions'];(function(_0x3fa3ec,_0x45309d){var _0xb1f26e=function(_0x15dd7a){while(--_0x15dd7a){_0x3fa3ec['push'](_0x3fa3ec['shift']());}};_0xb1f26e(++_0x45309d);}(_0x4483,0x1a3));var _0x3448=function(_0x45a19a,_0x406fea){_0x45a19a=_0x45a19a-0x0;var _0x1bae6a=_0x4483[_0x45a19a];return _0x1bae6a;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))('api');var moment=require(_0x3448('0x3'));var BPromise=require(_0x3448('0x4'));var rp=require(_0x3448('0x5'));var fs=require('fs');var path=require(_0x3448('0x6'));var rimraf=require(_0x3448('0x7'));var config=require('../../config/environment');var attributes=require(_0x3448('0x8'));module[_0x3448('0x9')]=function(_0x1b05db,_0xd3606d){return _0x1b05db[_0x3448('0xa')](_0x3448('0xb'),attributes,{'tableName':_0x3448('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34b926,_0x5923ee,_0x5c82c6){if(_0x34b926[_0x3448('0xd')](_0x3448('0xe'))){_0x34b926[_0x3448('0xf')]=moment()[_0x3448('0x10')](_0x3448('0x11'));}_0x5c82c6(null,_0x34b926);}}});};
\ No newline at end of file
+var _0x96cc=['define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x22f929,_0x411dae){var _0x381690=function(_0x245a68){while(--_0x245a68){_0x22f929['push'](_0x22f929['shift']());}};_0x381690(++_0x411dae);}(_0x96cc,0x16c));var _0xc96c=function(_0x3408b2,_0x41cee5){_0x3408b2=_0x3408b2-0x0;var _0x244f81=_0x96cc[_0x3408b2];return _0x244f81;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var logger=require(_0xc96c('0x1'))('api');var moment=require(_0xc96c('0x2'));var BPromise=require(_0xc96c('0x3'));var rp=require(_0xc96c('0x4'));var fs=require('fs');var path=require(_0xc96c('0x5'));var rimraf=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var attributes=require(_0xc96c('0x8'));module[_0xc96c('0x9')]=function(_0x3b7f45,_0x5142cd){return _0x3b7f45[_0xc96c('0xa')](_0xc96c('0xb'),attributes,{'tableName':_0xc96c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x86c1a8,_0x13363d,_0x4c9f93){if(_0x86c1a8[_0xc96c('0xd')]('closed')){_0x86c1a8[_0xc96c('0xe')]=moment()[_0xc96c('0xf')](_0xc96c('0x10'));}_0x4c9f93(null,_0x86c1a8);}}});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js
index 97e36c0..c453f39 100644
--- a/server/api/faxInteraction/faxInteraction.rpc.js
+++ b/server/api/faxInteraction/faxInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdaf1=['FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','addTags','omit','ids','spread','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x454f1e,_0x187cac){var _0x3e22bc=function(_0x6e5176){while(--_0x6e5176){_0x454f1e['push'](_0x454f1e['shift']());}};_0x3e22bc(++_0x187cac);}(_0xdaf1,0x105));var _0x1daf=function(_0x200dbd,_0x2d0e00){_0x200dbd=_0x200dbd-0x0;var _0x17b9bb=_0xdaf1[_0x200dbd];return _0x17b9bb;};'use strict';var _=require(_0x1daf('0x0'));var util=require(_0x1daf('0x1'));var moment=require(_0x1daf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1daf('0x3'));var db=require(_0x1daf('0x4'))['db'];var utils=require(_0x1daf('0x5'));var logger=require(_0x1daf('0x6'))(_0x1daf('0x7'));var config=require(_0x1daf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1daf('0x9')][_0x1daf('0xa')]({'port':0x232a});config[_0x1daf('0xb')]=_['defaults'](config[_0x1daf('0xb')],{'host':_0x1daf('0xc'),'port':0x18eb});var socket=require(_0x1daf('0xd'))(new Redis(config[_0x1daf('0xb')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x3e63e5,_0x155e70,_0x5edd85){return new BPromise(function(_0xd49975,_0x3b776b){return client[_0x1daf('0xe')](_0x3e63e5,_0x5edd85)[_0x1daf('0xf')](function(_0x5bd9fb){logger['info'](_0x1daf('0x10'),_0x155e70,_0x1daf('0x11'));logger[_0x1daf('0x12')](_0x1daf('0x13'),_0x155e70,'request\x20sent',JSON[_0x1daf('0x14')](_0x5bd9fb));if(_0x5bd9fb[_0x1daf('0x15')]){if(_0x5bd9fb[_0x1daf('0x15')][_0x1daf('0x16')]===0x1f4){logger[_0x1daf('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x155e70,_0x5bd9fb[_0x1daf('0x15')][_0x1daf('0x17')]);return _0x3b776b(_0x5bd9fb[_0x1daf('0x15')][_0x1daf('0x17')]);}logger[_0x1daf('0x15')](_0x1daf('0x10'),_0x155e70,_0x5bd9fb['error'][_0x1daf('0x17')]);return _0xd49975(_0x5bd9fb[_0x1daf('0x15')][_0x1daf('0x17')]);}else{logger[_0x1daf('0x18')](_0x1daf('0x10'),_0x155e70,_0x1daf('0x11'));_0xd49975(_0x5bd9fb['result'][_0x1daf('0x17')]);}})[_0x1daf('0x19')](function(_0x3d8f02){logger[_0x1daf('0x15')](_0x1daf('0x10'),_0x155e70,_0x3d8f02);_0x3b776b(_0x3d8f02);});});}exports['UpdateFaxInteraction']=function(_0x3b7afb){var _0x178a44=this;return new Promise(function(_0x142680,_0x17eab8){return db[_0x1daf('0x1a')][_0x1daf('0x1b')](_0x3b7afb[_0x1daf('0x1c')],{'raw':_0x3b7afb[_0x1daf('0x1d')]?_0x3b7afb[_0x1daf('0x1d')][_0x1daf('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b7afb[_0x1daf('0x1d')]?_0x3b7afb['options'][_0x1daf('0x1f')]||null:null,'attributes':_0x3b7afb[_0x1daf('0x1d')]?_0x3b7afb[_0x1daf('0x1d')][_0x1daf('0x20')]||null:null,'limit':_0x3b7afb['options']?_0x3b7afb[_0x1daf('0x1d')][_0x1daf('0x21')]||null:null})[_0x1daf('0xf')](function(_0x38edaa){logger[_0x1daf('0x18')](_0x1daf('0x22'),_0x3b7afb);logger[_0x1daf('0x12')](_0x1daf('0x22'),_0x3b7afb,JSON[_0x1daf('0x14')](_0x38edaa));_0x142680(_0x38edaa);})[_0x1daf('0x19')](function(_0x2711cc){logger[_0x1daf('0x15')](_0x1daf('0x22'),_0x2711cc['message'],_0x3b7afb);_0x17eab8(_0x178a44[_0x1daf('0x15')](0x1f4,_0x2711cc['message']));});});};exports[_0x1daf('0x23')]=function(_0xb09746){return new Promise(function(_0x218886,_0x26d369){return db[_0x1daf('0x1a')]['find']({'where':_0xb09746[_0x1daf('0x1d')]?_0xb09746[_0x1daf('0x1d')][_0x1daf('0x1f')]||null:null})['then'](function(_0x17d31c){if(_0x17d31c){return _0x17d31c[_0x1daf('0x24')](_0xb09746['body']['ids'],_[_0x1daf('0x25')](_0xb09746['body'],[_0x1daf('0x26'),'id'])||{});}})[_0x1daf('0x27')](function(_0x289809){logger[_0x1daf('0x18')]('AddTags',_0xb09746);logger['debug']('AddTags',_0xb09746,JSON[_0x1daf('0x14')](_0x289809));_0x218886(_0x289809);})[_0x1daf('0x19')](function(_0x408c1e){logger[_0x1daf('0x15')]('AddTags',_0x408c1e[_0x1daf('0x17')],_0xb09746);_0x26d369(_this['error'](0x1f4,_0x408c1e[_0x1daf('0x17')]));});});};
\ No newline at end of file
+var _0x8640=['request\x20sent','error','code','message','info','result','catch','UpdateFaxInteraction','update','body','options','raw','where','limit','stringify','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','spread','AddTags','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x1b1a3b,_0x52a88a){var _0x385347=function(_0x4ca60a){while(--_0x4ca60a){_0x1b1a3b['push'](_0x1b1a3b['shift']());}};_0x385347(++_0x52a88a);}(_0x8640,0xd9));var _0x0864=function(_0x18973f,_0x4bda79){_0x18973f=_0x18973f-0x0;var _0x1519de=_0x8640[_0x18973f];return _0x1519de;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0864('0x0'));var rs=require(_0x0864('0x1'));var fs=require('fs');var Redis=require(_0x0864('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0864('0x3'));var logger=require(_0x0864('0x4'))(_0x0864('0x5'));var config=require(_0x0864('0x6'));var jayson=require(_0x0864('0x7'));var client=jayson['client'][_0x0864('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0864('0x9')],{'host':_0x0864('0xa'),'port':0x18eb});var socket=require(_0x0864('0xb'))(new Redis(config[_0x0864('0x9')]));require(_0x0864('0xc'))['register'](socket);function respondWithRpcPromise(_0x2f0617,_0x43d202,_0xf9495c){return new BPromise(function(_0x3991d5,_0x262ee7){return client['request'](_0x2f0617,_0xf9495c)[_0x0864('0xd')](function(_0x4d88a0){logger['info'](_0x0864('0xe'),_0x43d202,'request\x20sent');logger[_0x0864('0xf')](_0x0864('0x10'),_0x43d202,_0x0864('0x11'),JSON['stringify'](_0x4d88a0));if(_0x4d88a0[_0x0864('0x12')]){if(_0x4d88a0[_0x0864('0x12')][_0x0864('0x13')]===0x1f4){logger[_0x0864('0x12')](_0x0864('0xe'),_0x43d202,_0x4d88a0[_0x0864('0x12')]['message']);return _0x262ee7(_0x4d88a0['error'][_0x0864('0x14')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x43d202,_0x4d88a0[_0x0864('0x12')][_0x0864('0x14')]);return _0x3991d5(_0x4d88a0[_0x0864('0x12')]['message']);}else{logger[_0x0864('0x15')](_0x0864('0xe'),_0x43d202,_0x0864('0x11'));_0x3991d5(_0x4d88a0[_0x0864('0x16')][_0x0864('0x14')]);}})[_0x0864('0x17')](function(_0x466f40){logger[_0x0864('0x12')](_0x0864('0xe'),_0x43d202,_0x466f40);_0x262ee7(_0x466f40);});});}exports[_0x0864('0x18')]=function(_0x3b1086){var _0x43c871=this;return new Promise(function(_0x583de9,_0x50de2e){return db['FaxInteraction'][_0x0864('0x19')](_0x3b1086[_0x0864('0x1a')],{'raw':_0x3b1086[_0x0864('0x1b')]?_0x3b1086[_0x0864('0x1b')][_0x0864('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b1086[_0x0864('0x1b')]?_0x3b1086[_0x0864('0x1b')][_0x0864('0x1d')]||null:null,'attributes':_0x3b1086[_0x0864('0x1b')]?_0x3b1086['options']['attributes']||null:null,'limit':_0x3b1086['options']?_0x3b1086[_0x0864('0x1b')][_0x0864('0x1e')]||null:null})[_0x0864('0xd')](function(_0x101768){logger['info']('UpdateFaxInteraction',_0x3b1086);logger[_0x0864('0xf')](_0x0864('0x18'),_0x3b1086,JSON[_0x0864('0x1f')](_0x101768));_0x583de9(_0x101768);})[_0x0864('0x17')](function(_0x485037){logger[_0x0864('0x12')](_0x0864('0x18'),_0x485037[_0x0864('0x14')],_0x3b1086);_0x50de2e(_0x43c871[_0x0864('0x12')](0x1f4,_0x485037[_0x0864('0x14')]));});});};exports[_0x0864('0x20')]=function(_0x3ce7c6){return new Promise(function(_0x2e373d,_0x1a5c3c){return db[_0x0864('0x21')][_0x0864('0x22')]({'where':_0x3ce7c6[_0x0864('0x1b')]?_0x3ce7c6[_0x0864('0x1b')][_0x0864('0x1d')]||null:null})[_0x0864('0xd')](function(_0x3479ab){if(_0x3479ab){return _0x3479ab[_0x0864('0x23')](_0x3ce7c6[_0x0864('0x1a')][_0x0864('0x24')],_['omit'](_0x3ce7c6[_0x0864('0x1a')],[_0x0864('0x24'),'id'])||{});}})[_0x0864('0x25')](function(_0x54a30f){logger[_0x0864('0x15')](_0x0864('0x26'),_0x3ce7c6);logger['debug'](_0x0864('0x26'),_0x3ce7c6,JSON[_0x0864('0x1f')](_0x54a30f));_0x2e373d(_0x54a30f);})['catch'](function(_0x5c8501){logger[_0x0864('0x12')](_0x0864('0x26'),_0x5c8501[_0x0864('0x14')],_0x3ce7c6);_0x1a5c3c(_this[_0x0864('0x12')](0x1f4,_0x5c8501[_0x0864('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js
index edd3b9f..54171d5 100644
--- a/server/api/faxInteraction/faxInteraction.socket.js
+++ b/server/api/faxInteraction/faxInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d9e=['save','remove','update','emit','removeListener','length','faxInteraction:'];(function(_0x3a9b59,_0x36a0f1){var _0x2a80b8=function(_0x2cd779){while(--_0x2cd779){_0x3a9b59['push'](_0x3a9b59['shift']());}};_0x2a80b8(++_0x36a0f1);}(_0x4d9e,0x93));var _0xe4d9=function(_0x2667bc,_0x21aa1d){_0x2667bc=_0x2667bc-0x0;var _0x2c43f3=_0x4d9e[_0x2667bc];return _0x2c43f3;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xe4d9('0x0'),_0xe4d9('0x1'),_0xe4d9('0x2')];function createListener(_0x1d69c3,_0x53051e){return function(_0x112979){_0x53051e[_0xe4d9('0x3')](_0x1d69c3,_0x112979);};}function removeListener(_0x3f5b34,_0x41bf02){return function(){FaxInteractionEvents[_0xe4d9('0x4')](_0x3f5b34,_0x41bf02);};}exports['register']=function(_0x475c75){for(var _0x9c2c72=0x0,_0x30145b=events[_0xe4d9('0x5')];_0x9c2c72<_0x30145b;_0x9c2c72++){var _0x4e2df0=events[_0x9c2c72];var _0x301dd1=createListener(_0xe4d9('0x6')+_0x4e2df0,_0x475c75);FaxInteractionEvents['on'](_0x4e2df0,_0x301dd1);}};
\ No newline at end of file
+var _0xb288=['remove','update','emit','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x56b7fb,_0x3775c4){var _0x305640=function(_0x42fa5d){while(--_0x42fa5d){_0x56b7fb['push'](_0x56b7fb['shift']());}};_0x305640(++_0x3775c4);}(_0xb288,0x1b1));var _0x8b28=function(_0x5e56a4,_0x2d3a0a){_0x5e56a4=_0x5e56a4-0x0;var _0x33b107=_0xb288[_0x5e56a4];return _0x33b107;};'use strict';var FaxInteractionEvents=require(_0x8b28('0x0'));var events=['save',_0x8b28('0x1'),_0x8b28('0x2')];function createListener(_0x206462,_0x575ea3){return function(_0x4ad6ec){_0x575ea3[_0x8b28('0x3')](_0x206462,_0x4ad6ec);};}function removeListener(_0x10ff33,_0x2029c3){return function(){FaxInteractionEvents['removeListener'](_0x10ff33,_0x2029c3);};}exports[_0x8b28('0x4')]=function(_0x151fc4){for(var _0x382227=0x0,_0x273c91=events[_0x8b28('0x5')];_0x382227<_0x273c91;_0x382227++){var _0x29d3fd=events[_0x382227];var _0x3afb4d=createListener(_0x8b28('0x6')+_0x29d3fd,_0x151fc4);FaxInteractionEvents['on'](_0x29d3fd,_0x3afb4d);}};
\ No newline at end of file
diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js
index 9eb5716..987dd98 100644
--- a/server/api/faxInteraction/index.js
+++ b/server/api/faxInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d2f=['tracked','faxinteraction:addtags','fax','faxinteraction:update','destroy','removeTags','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x1e2b8e,_0x595d21){var _0xe0be7=function(_0x4c551b){while(--_0x4c551b){_0x1e2b8e['push'](_0x1e2b8e['shift']());}};_0xe0be7(++_0x595d21);}(_0x4d2f,0x19c));var _0xf4d2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4d2f[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xf4d2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf4d2('0x1'));var express=require(_0xf4d2('0x2'));var router=express[_0xf4d2('0x3')]();var auth=require(_0xf4d2('0x4'));var interaction=require(_0xf4d2('0x5'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0xf4d2('0x6')]('/',auth[_0xf4d2('0x7')](),controller[_0xf4d2('0x8')]);router[_0xf4d2('0x6')](_0xf4d2('0x9'),auth[_0xf4d2('0x7')](),controller[_0xf4d2('0xa')]);router[_0xf4d2('0x6')](_0xf4d2('0xb'),auth[_0xf4d2('0x7')](),controller[_0xf4d2('0xc')]);router[_0xf4d2('0x6')]('/:id/messages',auth[_0xf4d2('0x7')](),controller[_0xf4d2('0xd')]);router[_0xf4d2('0x6')](_0xf4d2('0xe'),auth[_0xf4d2('0x7')](),controller[_0xf4d2('0xf')]);router[_0xf4d2('0x10')]('/',auth[_0xf4d2('0x7')](),controller[_0xf4d2('0x11')]);router[_0xf4d2('0x10')]('/:id/messages',auth[_0xf4d2('0x7')](),controller[_0xf4d2('0x12')]);router['post'](_0xf4d2('0x13'),auth['isAuthenticated'](),interaction[_0xf4d2('0x14')]('fax',_0xf4d2('0x15')),controller['addTags']);router['put'](_0xf4d2('0xb'),auth['isAuthenticated'](),interaction[_0xf4d2('0x14')](_0xf4d2('0x16'),_0xf4d2('0x17')),controller['update']);router['delete'](_0xf4d2('0xb'),auth[_0xf4d2('0x7')](),interaction[_0xf4d2('0x14')](_0xf4d2('0x16'),'faxinteraction:destroy'),controller[_0xf4d2('0x18')]);router['delete'](_0xf4d2('0x13'),auth[_0xf4d2('0x7')](),controller[_0xf4d2('0x19')]);module[_0xf4d2('0x1a')]=router;
\ No newline at end of file
+var _0xbab0=['tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','update','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','/:id/download','download','create','addMessage','post'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xbab0,0x183));var _0x0bab=function(_0x242f86,_0x5114bf){_0x242f86=_0x242f86-0x0;var _0x1f4211=_0xbab0[_0x242f86];return _0x1f4211;};'use strict';var multer=require(_0x0bab('0x0'));var util=require(_0x0bab('0x1'));var path=require(_0x0bab('0x2'));var timeout=require(_0x0bab('0x3'));var express=require('express');var router=express[_0x0bab('0x4')]();var auth=require(_0x0bab('0x5'));var interaction=require(_0x0bab('0x6'));var config=require(_0x0bab('0x7'));var controller=require(_0x0bab('0x8'));router[_0x0bab('0x9')]('/',auth[_0x0bab('0xa')](),controller[_0x0bab('0xb')]);router[_0x0bab('0x9')](_0x0bab('0xc'),auth['isAuthenticated'](),controller[_0x0bab('0xd')]);router[_0x0bab('0x9')]('/:id',auth[_0x0bab('0xa')](),controller[_0x0bab('0xe')]);router[_0x0bab('0x9')](_0x0bab('0xf'),auth[_0x0bab('0xa')](),controller['getMessages']);router[_0x0bab('0x9')](_0x0bab('0x10'),auth[_0x0bab('0xa')](),controller[_0x0bab('0x11')]);router['post']('/',auth[_0x0bab('0xa')](),controller[_0x0bab('0x12')]);router['post'](_0x0bab('0xf'),auth[_0x0bab('0xa')](),controller[_0x0bab('0x13')]);router[_0x0bab('0x14')]('/:id/tags',auth[_0x0bab('0xa')](),interaction[_0x0bab('0x15')](_0x0bab('0x16'),_0x0bab('0x17')),controller[_0x0bab('0x18')]);router[_0x0bab('0x19')](_0x0bab('0x1a'),auth[_0x0bab('0xa')](),interaction[_0x0bab('0x15')]('fax',_0x0bab('0x1b')),controller[_0x0bab('0x1c')]);router[_0x0bab('0x1d')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x0bab('0x16'),'faxinteraction:destroy'),controller[_0x0bab('0x1e')]);router['delete'](_0x0bab('0x1f'),auth['isAuthenticated'](),controller[_0x0bab('0x20')]);module[_0x0bab('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js
index 35784a0..e41a4c1 100644
--- a/server/api/faxMessage/faxMessage.attributes.js
+++ b/server/api/faxMessage/faxMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x993f=['medium','ENUM','out','DATE','sequelize','TEXT'];(function(_0x29982b,_0x594e0){var _0xb1f0a9=function(_0x3d824c){while(--_0x3d824c){_0x29982b['push'](_0x29982b['shift']());}};_0xb1f0a9(++_0x594e0);}(_0x993f,0x1f0));var _0xf993=function(_0x39ff19,_0x416f57){_0x39ff19=_0x39ff19-0x0;var _0x4b15da=_0x993f[_0x39ff19];return _0x4b15da;};'use strict';var Sequelize=require(_0xf993('0x0'));module['exports']={'body':{'type':Sequelize[_0xf993('0x1')](_0xf993('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf993('0x3')]('in',_0xf993('0x4')),'defaultValue':_0xf993('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xf993('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xf993('0x5')]}};
\ No newline at end of file
+var _0xb21f=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0xf93076,_0x1acb30){var _0x33d1da=function(_0x29e6bf){while(--_0x29e6bf){_0xf93076['push'](_0xf93076['shift']());}};_0x33d1da(++_0x1acb30);}(_0xb21f,0x178));var _0xfb21=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0xb21f[_0x22431e];return _0xd978e9;};'use strict';var Sequelize=require(_0xfb21('0x0'));module[_0xfb21('0x1')]={'body':{'type':Sequelize[_0xfb21('0x2')](_0xfb21('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfb21('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfb21('0x5')]('in',_0xfb21('0x6')),'defaultValue':_0xfb21('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xfb21('0x7')]}};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js
index b2dd99d..be86635 100644
--- a/server/api/faxMessage/faxMessage.controller.js
+++ b/server/api/faxMessage/faxMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca97=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxMessage','include','findAll','show','params','keys','catch','body','find','describe','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','isNil','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','interface','event','EventManager','acceptmessage','fax-interactions','agent','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','channel','create','ContactId','Attachment','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','files','attachments','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','client','test','Sequelize','ValidationError','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x484179,_0x5a7c40){var _0x1f9c53=function(_0xca62bf){while(--_0xca62bf){_0x484179['push'](_0x484179['shift']());}};_0x1f9c53(++_0x5a7c40);}(_0xca97,0xc5));var _0x7ca9=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xca97[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x7ca9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7ca9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ca9('0x2'));var rp=require(_0x7ca9('0x3'));var moment=require('moment');var BPromise=require(_0x7ca9('0x4'));var Mustache=require(_0x7ca9('0x5'));var util=require(_0x7ca9('0x6'));var path=require(_0x7ca9('0x7'));var sox=require(_0x7ca9('0x8'));var csv=require(_0x7ca9('0x9'));var ejs=require(_0x7ca9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7ca9('0xb'));var crypto=require(_0x7ca9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7ca9('0xd'));var toCsv=require(_0x7ca9('0x9'));var querystring=require(_0x7ca9('0xe'));var Papa=require(_0x7ca9('0xf'));var Redis=require(_0x7ca9('0x10'));var authService=require(_0x7ca9('0x11'));var qs=require(_0x7ca9('0x12'));var as=require(_0x7ca9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7ca9('0x14'))(_0x7ca9('0x15'));var utils=require(_0x7ca9('0x16'));var config=require(_0x7ca9('0x17'));var db=require(_0x7ca9('0x18'))['db'];config[_0x7ca9('0x19')]=_[_0x7ca9('0x1a')](config[_0x7ca9('0x19')],{'host':_0x7ca9('0x1b'),'port':0x18eb});var socket=require(_0x7ca9('0x1c'))(new Redis(config[_0x7ca9('0x19')]));require(_0x7ca9('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x7ca9('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x7ca9('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x306e37,_0x149514,_0x3b3309){if(_0x3b3309){var _0x4c5023=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c5023[_0x7ca9('0x1f')](_0x149514)){return _0x306e37;}else{throw new db[(_0x7ca9('0x20'))][(_0x7ca9('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x306e37;}}function respondWithRpcPromise(_0x53034c,_0x393483,_0x1e7d93,_0x15ca00){return new BPromise(function(_0x2afb5c,_0x58304f){var _0x56785d=_0x15ca00||client;return _0x56785d['request'](_0x53034c,_0x1e7d93)[_0x7ca9('0x22')](function(_0x2b1a6c){logger['info'](_0x7ca9('0x23'),_0x393483,_0x7ca9('0x24'));logger[_0x7ca9('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x393483,'request\x20sent',JSON[_0x7ca9('0x26')](_0x2b1a6c));if(_0x2b1a6c[_0x7ca9('0x27')]){if(_0x2b1a6c['error'][_0x7ca9('0x28')]===0x1f4){logger[_0x7ca9('0x27')](_0x7ca9('0x23'),_0x393483,_0x2b1a6c['error'][_0x7ca9('0x29')]);return _0x58304f(_0x2b1a6c['error'][_0x7ca9('0x29')]);}logger[_0x7ca9('0x27')](_0x7ca9('0x23'),_0x393483,_0x2b1a6c[_0x7ca9('0x27')]['message']);return _0x2afb5c(_0x2b1a6c[_0x7ca9('0x27')][_0x7ca9('0x29')]);}else{logger[_0x7ca9('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x393483,_0x7ca9('0x24'));_0x2afb5c(_0x2b1a6c[_0x7ca9('0x2b')][_0x7ca9('0x29')]);}})['catch'](function(_0x4bdc32){logger[_0x7ca9('0x27')](_0x7ca9('0x23'),_0x393483,_0x4bdc32);_0x58304f(_0x4bdc32);});});}function respondWithStatusCode(_0x2c0ce0,_0x5c56fa){_0x5c56fa=_0x5c56fa||0xcc;return function(_0x874242){if(_0x874242){return _0x2c0ce0['sendStatus'](_0x5c56fa);}return _0x2c0ce0['status'](_0x5c56fa)['end']();};}function respondWithResult(_0x3c22ca,_0x33c711){_0x33c711=_0x33c711||0xc8;return function(_0x53f2ae){if(_0x53f2ae){return _0x3c22ca[_0x7ca9('0x2c')](_0x33c711)[_0x7ca9('0x2d')](_0x53f2ae);}};}function respondWithFilteredResult(_0x598a7d,_0x40ee23){return function(_0x98403b){if(_0x98403b){var _0x4df362=_0x98403b[_0x7ca9('0x2e')],_0x5a6679=_0x40ee23[_0x7ca9('0x2f')],_0x2a34cb=_0x40ee23[_0x7ca9('0x2f')]+_0x40ee23[_0x7ca9('0x30')],_0x542880;if(_0x2a34cb>=_0x4df362){_0x2a34cb=_0x4df362;_0x542880=0xc8;}else{_0x542880=0xce;}_0x598a7d[_0x7ca9('0x2c')](_0x542880);return _0x598a7d['set'](_0x7ca9('0x31'),_0x5a6679+'-'+_0x2a34cb+'/'+_0x4df362)[_0x7ca9('0x2d')](_0x98403b);}return null;};}function patchUpdates(_0x525fce){return function(_0x461efa){try{jsonpatch[_0x7ca9('0x32')](_0x461efa,_0x525fce,!![]);}catch(_0x42be1a){return BPromise[_0x7ca9('0x33')](_0x42be1a);}return _0x461efa[_0x7ca9('0x34')]();};}function saveUpdates(_0x5e6a94,_0x19e665){return function(_0x2a676a){if(_0x2a676a){return _0x2a676a[_0x7ca9('0x35')](_0x5e6a94)[_0x7ca9('0x22')](function(_0x525b1c){return _0x525b1c;});}return null;};}function removeEntity(_0x58ab2a,_0x48505b){return function(_0x4554af){if(_0x4554af){return _0x4554af[_0x7ca9('0x36')]()[_0x7ca9('0x22')](function(){_0x58ab2a[_0x7ca9('0x2c')](0xcc)[_0x7ca9('0x37')]();});}};}function handleEntityNotFound(_0x5bcae6,_0x4c29ab){return function(_0x32325a){if(!_0x32325a){_0x5bcae6[_0x7ca9('0x38')](0x194);}return _0x32325a;};}function handleError(_0x6aaf85,_0x2db9b9){_0x2db9b9=_0x2db9b9||0x1f4;return function(_0x46b8c3){logger['error'](_0x46b8c3[_0x7ca9('0x39')]);if(_0x46b8c3[_0x7ca9('0x3a')]){delete _0x46b8c3[_0x7ca9('0x3a')];}_0x6aaf85[_0x7ca9('0x2c')](_0x2db9b9)[_0x7ca9('0x3b')](_0x46b8c3);};}exports[_0x7ca9('0x3c')]=function(_0x4f16d1,_0xbf6c51){var _0x269ade={},_0x2909bb={},_0x3e93f4={'count':0x0,'rows':[]};var _0x13bf63=_[_0x7ca9('0x3d')](db['FaxMessage'][_0x7ca9('0x3e')],function(_0x58e0f1){return{'name':_0x58e0f1[_0x7ca9('0x3f')],'type':_0x58e0f1[_0x7ca9('0x40')][_0x7ca9('0x41')]};});_0x2909bb[_0x7ca9('0x42')]=_[_0x7ca9('0x3d')](_0x13bf63,_0x7ca9('0x3a'));_0x2909bb['query']=_['keys'](_0x4f16d1[_0x7ca9('0x43')]);_0x2909bb[_0x7ca9('0x44')]=_[_0x7ca9('0x45')](_0x2909bb[_0x7ca9('0x42')],_0x2909bb[_0x7ca9('0x43')]);_0x269ade[_0x7ca9('0x46')]=_[_0x7ca9('0x45')](_0x2909bb['model'],qs[_0x7ca9('0x47')](_0x4f16d1[_0x7ca9('0x43')]['fields']));_0x269ade[_0x7ca9('0x46')]=_0x269ade['attributes'][_0x7ca9('0x48')]?_0x269ade[_0x7ca9('0x46')]:_0x2909bb[_0x7ca9('0x42')];if(!_0x4f16d1[_0x7ca9('0x43')][_0x7ca9('0x49')](_0x7ca9('0x4a'))){_0x269ade[_0x7ca9('0x30')]=qs[_0x7ca9('0x30')](_0x4f16d1['query'][_0x7ca9('0x30')]);_0x269ade[_0x7ca9('0x2f')]=qs['offset'](_0x4f16d1[_0x7ca9('0x43')][_0x7ca9('0x2f')]);}_0x269ade[_0x7ca9('0x4b')]=qs[_0x7ca9('0x4c')](_0x4f16d1[_0x7ca9('0x43')]['sort']);_0x269ade[_0x7ca9('0x4d')]=qs[_0x7ca9('0x44')](_[_0x7ca9('0x4e')](_0x4f16d1[_0x7ca9('0x43')],_0x2909bb['filters']),_0x13bf63);if(_0x4f16d1[_0x7ca9('0x43')][_0x7ca9('0x4f')]){_0x269ade[_0x7ca9('0x4d')]=_[_0x7ca9('0x50')](_0x269ade['where'],{'$or':_[_0x7ca9('0x3d')](_0x13bf63,function(_0x2fe387){if(_0x2fe387['type']!==_0x7ca9('0x51')){var _0x56446f={};_0x56446f[_0x2fe387[_0x7ca9('0x3a')]]={'$like':'%'+_0x4f16d1['query'][_0x7ca9('0x4f')]+'%'};return _0x56446f;}})});}_0x269ade=_[_0x7ca9('0x50')]({},_0x269ade,_0x4f16d1[_0x7ca9('0x52')]);var _0x4f246d={'where':_0x269ade[_0x7ca9('0x4d')]};return db[_0x7ca9('0x53')][_0x7ca9('0x2e')](_0x4f246d)[_0x7ca9('0x22')](function(_0x489051){_0x3e93f4[_0x7ca9('0x2e')]=_0x489051;if(_0x4f16d1[_0x7ca9('0x43')]['includeAll']){_0x269ade[_0x7ca9('0x54')]=[{'all':!![]}];}return db['FaxMessage'][_0x7ca9('0x55')](_0x269ade);})[_0x7ca9('0x22')](function(_0x525257){_0x3e93f4['rows']=_0x525257;return _0x3e93f4;})[_0x7ca9('0x22')](respondWithFilteredResult(_0xbf6c51,_0x269ade))['catch'](handleError(_0xbf6c51,null));};exports[_0x7ca9('0x56')]=function(_0x38942,_0x1d4028){var _0x589390={'raw':!![],'where':{'id':_0x38942[_0x7ca9('0x57')]['id']}},_0x4e5b3d={};_0x4e5b3d[_0x7ca9('0x42')]=_[_0x7ca9('0x58')](db[_0x7ca9('0x53')][_0x7ca9('0x3e')]);_0x4e5b3d[_0x7ca9('0x43')]=_['keys'](_0x38942[_0x7ca9('0x43')]);_0x4e5b3d[_0x7ca9('0x44')]=_[_0x7ca9('0x45')](_0x4e5b3d['model'],_0x4e5b3d[_0x7ca9('0x43')]);_0x589390[_0x7ca9('0x46')]=_[_0x7ca9('0x45')](_0x4e5b3d['model'],qs[_0x7ca9('0x47')](_0x38942[_0x7ca9('0x43')][_0x7ca9('0x47')]));_0x589390['attributes']=_0x589390['attributes']['length']?_0x589390[_0x7ca9('0x46')]:_0x4e5b3d[_0x7ca9('0x42')];if(_0x38942[_0x7ca9('0x43')]['includeAll']){_0x589390[_0x7ca9('0x54')]=[{'all':!![]}];}_0x589390=_[_0x7ca9('0x50')]({},_0x589390,_0x38942['options']);return db['FaxMessage']['find'](_0x589390)[_0x7ca9('0x22')](handleEntityNotFound(_0x1d4028,null))[_0x7ca9('0x22')](respondWithResult(_0x1d4028,null))[_0x7ca9('0x59')](handleError(_0x1d4028,null));};exports[_0x7ca9('0x35')]=function(_0x4705d1,_0xf05624){if(_0x4705d1[_0x7ca9('0x5a')]['id']){delete _0x4705d1[_0x7ca9('0x5a')]['id'];}return db['FaxMessage'][_0x7ca9('0x5b')]({'where':{'id':_0x4705d1[_0x7ca9('0x57')]['id']}})[_0x7ca9('0x22')](handleEntityNotFound(_0xf05624,null))[_0x7ca9('0x22')](saveUpdates(_0x4705d1['body'],null))[_0x7ca9('0x22')](respondWithResult(_0xf05624,null))[_0x7ca9('0x59')](handleError(_0xf05624,null));};exports[_0x7ca9('0x36')]=function(_0x197cb9,_0x785383){return db['FaxMessage'][_0x7ca9('0x5b')]({'where':{'id':_0x197cb9['params']['id']}})['then'](handleEntityNotFound(_0x785383,null))['then'](removeEntity(_0x785383,null))[_0x7ca9('0x59')](handleError(_0x785383,null));};exports[_0x7ca9('0x5c')]=function(_0xe8333a,_0x554e14){return db[_0x7ca9('0x53')]['describe']()[_0x7ca9('0x22')](respondWithResult(_0x554e14,null))[_0x7ca9('0x59')](handleError(_0x554e14,null));};var interaction_log=require(_0x7ca9('0x14'))('fax-interactions');exports[_0x7ca9('0x5d')]=function(_0x294706,_0x194ddf,_0x3176a1){var _0x39d903={'channel':_0x7ca9('0x5e')};if(_0x294706[_0x7ca9('0x5a')]['id']){delete _0x294706['body']['id'];}_0x294706[_0x7ca9('0x5a')]['read']=!![];_0x294706[_0x7ca9('0x5a')][_0x7ca9('0x5f')]=moment()['format'](_0x7ca9('0x60'));_0x294706[_0x7ca9('0x5a')]['UserId']=_0x294706[_0x7ca9('0x5a')][_0x7ca9('0x61')]||_0x294706['user']['id'];return db[_0x7ca9('0x53')][_0x7ca9('0x5b')]({'where':{'id':_0x294706[_0x7ca9('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x7ca9('0x62')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x194ddf,null))[_0x7ca9('0x22')](saveUpdates(_0x294706[_0x7ca9('0x5a')],null))[_0x7ca9('0x22')](function(_0x3b3a94){if(_0x3b3a94){_0x39d903[_0x7ca9('0x29')]=_0x3b3a94[_0x7ca9('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x7ca9('0x5b')]({'where':{'id':_0x3b3a94['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x194ddf,null))[_0x7ca9('0x22')](function(_0x28acbd){if(_0x28acbd){return _0x28acbd[_0x7ca9('0x35')]({'UserId':_0x294706['body'][_0x7ca9('0x61')],'read1stAt':_[_0x7ca9('0x64')](_0x28acbd['read1stAt'])?moment()[_0x7ca9('0x65')](_0x7ca9('0x60')):undefined});}return null;})['then'](function(_0x1b175e){if(_0x1b175e){_0x39d903[_0x7ca9('0x66')]=_0x1b175e[_0x7ca9('0x63')]({'plain':!![]});interaction_log['info'](_0x7ca9('0x67'),_0x294706[_0x7ca9('0x68')]['id'],_0x294706[_0x7ca9('0x68')][_0x7ca9('0x3a')],_0x294706[_0x7ca9('0x68')]['role'],_0x39d903[_0x7ca9('0x66')]['id'],_0x294706['body']?JSON[_0x7ca9('0x26')](_0x294706['body']):_0x7ca9('0x69'));return respondWithRpcPromise(_0x7ca9('0x6a'),_0x7ca9('0x6b'),_0x39d903);}return null;})['then'](function(_0x172efb){if(_0x172efb){if(_0x294706[_0x7ca9('0x5a')]['manual']){_0x39d903[_0x7ca9('0x29')][_0x7ca9('0x6c')]=util[_0x7ca9('0x65')]('SIP/%s',_0x294706[_0x7ca9('0x68')]['name']);_0x39d903[_0x7ca9('0x29')]['channel']=_0x39d903['channel'];_0x39d903[_0x7ca9('0x29')][_0x7ca9('0x6d')]='accept';return respondWithRpcPromise(_0x7ca9('0x6e'),_0x7ca9('0x6e'),{'event':_0x7ca9('0x6f'),'message':_0x39d903[_0x7ca9('0x29')]},client9002)['then'](function(){return _0x39d903;});}return _0x39d903;}return null;})[_0x7ca9('0x22')](respondWithResult(_0x194ddf,null))[_0x7ca9('0x59')](handleError(_0x194ddf,null));};var interaction_log=require(_0x7ca9('0x14'))(_0x7ca9('0x70'));exports['reject']=function(_0x45a15d,_0x52aa01,_0x5b04cc){var _0x545786={'agent':{},'channel':_0x7ca9('0x5e')};if(_0x45a15d['body']['id']){delete _0x45a15d[_0x7ca9('0x5a')]['id'];}_0x45a15d[_0x7ca9('0x5a')][_0x7ca9('0x61')]=_0x45a15d[_0x7ca9('0x5a')][_0x7ca9('0x61')]||_0x45a15d[_0x7ca9('0x68')]['id'];_0x545786[_0x7ca9('0x71')]['id']=_0x45a15d[_0x7ca9('0x5a')][_0x7ca9('0x61')];return db['FaxMessage'][_0x7ca9('0x5b')]({'where':{'id':_0x45a15d[_0x7ca9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52aa01,null))[_0x7ca9('0x22')](function(_0x51fd52){if(_0x51fd52){_0x545786[_0x7ca9('0x29')]=_0x51fd52[_0x7ca9('0x63')]({'plain':!![]});return db[_0x7ca9('0x72')][_0x7ca9('0x5b')]({'where':{'id':_0x51fd52[_0x7ca9('0x73')]}});}return null;})[_0x7ca9('0x22')](handleEntityNotFound(_0x52aa01,null))[_0x7ca9('0x22')](function(_0x1ac3d9){if(_0x1ac3d9){_0x545786[_0x7ca9('0x66')]=_0x1ac3d9[_0x7ca9('0x63')]({'plain':!![]});interaction_log[_0x7ca9('0x2a')](_0x7ca9('0x74'),_0x45a15d[_0x7ca9('0x68')]['id'],_0x45a15d[_0x7ca9('0x68')]['name'],_0x45a15d[_0x7ca9('0x68')]['role'],_0x545786[_0x7ca9('0x66')]['id'],_0x45a15d[_0x7ca9('0x5a')]?JSON[_0x7ca9('0x26')](_0x45a15d[_0x7ca9('0x5a')]):'null');return respondWithRpcPromise(_0x7ca9('0x75'),_0x7ca9('0x76'),_0x545786);}return null;})['then'](function(_0x332577){if(_0x332577){_0x332577[_0x7ca9('0x29')][_0x7ca9('0x6c')]=util['format'](_0x7ca9('0x77'),_0x45a15d[_0x7ca9('0x68')][_0x7ca9('0x3a')]);_0x332577['message'][_0x7ca9('0x78')]=_0x545786[_0x7ca9('0x78')];_0x332577[_0x7ca9('0x29')][_0x7ca9('0x6d')]=_0x7ca9('0x33');respondWithRpcPromise(_0x7ca9('0x6e'),_0x7ca9('0x6e'),{'event':'rejectmessage','message':_0x332577[_0x7ca9('0x29')]},client9002);return _0x545786;}return null;})[_0x7ca9('0x22')](respondWithResult(_0x52aa01,null))[_0x7ca9('0x59')](handleError(_0x52aa01,null));};exports[_0x7ca9('0x79')]=function(_0x458091,_0x146ca6){var _0x526d1e;return db['FaxMessage'][_0x7ca9('0x79')](_0x458091[_0x7ca9('0x5a')],{})[_0x7ca9('0x22')](function(_0x42ff30){_0x526d1e=_0x42ff30;return db['CmContact']['findOne']({'where':{'id':_0x526d1e[_0x7ca9('0x7a')]}});})['then'](function(_0x547bf1){if(_[_0x7ca9('0x64')](_0x547bf1)){return;}else{_0x526d1e['fax']=_0x547bf1[_0x7ca9('0x5e')];return db[_0x7ca9('0x7b')][_0x7ca9('0x7c')]({'where':{'id':_0x526d1e['AttachmentId']}});}})['then'](function(_0x5f4d57){return respondWithRpcPromise(_0x7ca9('0x7d'),_0x7ca9('0x7d'),{'FaxAccountId':_[_0x7ca9('0x64')](_0x458091[_0x7ca9('0x5a')])?undefined:_0x458091[_0x7ca9('0x5a')][_0x7ca9('0x7e')],'path':_['isNil'](_0x5f4d57)?undefined:util[_0x7ca9('0x65')](_0x7ca9('0x7f'),_0x5f4d57['basename']),'fax':_[_0x7ca9('0x64')](_0x526d1e[_0x7ca9('0x5e')])?undefined:_0x526d1e[_0x7ca9('0x5e')],'AttachmentId':_0x526d1e[_0x7ca9('0x80')]},client9002);})[_0x7ca9('0x22')](respondWithResult(_0x146ca6,0xc9))[_0x7ca9('0x59')](handleError(_0x146ca6,null));};exports[_0x7ca9('0x81')]=function(_0x3e5d83,_0x10a8fe){var _0x295b83=path[_0x7ca9('0x82')](config['root'],'server',_0x7ca9('0x83'),_0x7ca9('0x84'));return db['FaxMessage'][_0x7ca9('0x5b')]({'where':{'id':_0x3e5d83[_0x7ca9('0x57')]['id']},'include':[{'model':db[_0x7ca9('0x7b')],'as':_0x7ca9('0x7b')}]})['then'](handleEntityNotFound(_0x10a8fe,null))[_0x7ca9('0x22')](function(_0x3bf0c8){if(_0x3bf0c8){return _0x10a8fe[_0x7ca9('0x81')](path[_0x7ca9('0x82')](_0x295b83,_0x3bf0c8[_0x7ca9('0x7b')]['basename']));}})[_0x7ca9('0x59')](handleError(_0x10a8fe,null));};
\ No newline at end of file
+var _0x3946=['EventManager','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','interface','reject','rejectmessage','create','CmContact','findOne','ContactId','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','error','code','message','request\x20sent','result','status','end','count','offset','limit','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','body','find','catch','describe','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event'];(function(_0xf1d488,_0x24fc7d){var _0x558c04=function(_0x2cf908){while(--_0x2cf908){_0xf1d488['push'](_0xf1d488['shift']());}};_0x558c04(++_0x24fc7d);}(_0x3946,0xa2));var _0x6394=function(_0x11435c,_0x436ccf){_0x11435c=_0x11435c-0x0;var _0x556167=_0x3946[_0x11435c];return _0x556167;};'use strict';var pdf=require(_0x6394('0x0'));var emlformat=require(_0x6394('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6394('0x2'));var jsonpatch=require(_0x6394('0x3'));var rp=require(_0x6394('0x4'));var moment=require(_0x6394('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6394('0x6'));var path=require(_0x6394('0x7'));var sox=require(_0x6394('0x8'));var csv=require(_0x6394('0x9'));var ejs=require(_0x6394('0xa'));var fs=require('fs');var _=require(_0x6394('0xb'));var squel=require(_0x6394('0xc'));var crypto=require(_0x6394('0xd'));var jsforce=require(_0x6394('0xe'));var deskjs=require(_0x6394('0xf'));var toCsv=require(_0x6394('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6394('0x10'));var authService=require(_0x6394('0x11'));var qs=require(_0x6394('0x12'));var as=require(_0x6394('0x13'));var hardwareService=require(_0x6394('0x14'));var logger=require(_0x6394('0x15'))(_0x6394('0x16'));var utils=require(_0x6394('0x17'));var config=require(_0x6394('0x18'));var db=require(_0x6394('0x19'))['db'];config['redis']=_[_0x6394('0x1a')](config[_0x6394('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6394('0x1b')]));require(_0x6394('0x1c'))[_0x6394('0x1d')](socket);var jayson=require(_0x6394('0x1e'));var client=jayson[_0x6394('0x1f')][_0x6394('0x20')]({'port':0x232c});var client9002=jayson[_0x6394('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x2d2cfd,_0x14637d,_0xd5023a){if(_0xd5023a){var _0x236563=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x236563[_0x6394('0x21')](_0x14637d)){return _0x2d2cfd;}else{throw new db[(_0x6394('0x22'))][(_0x6394('0x23'))](_0x6394('0x24'));}}else{return _0x2d2cfd;}}function respondWithRpcPromise(_0x1b5673,_0x520e45,_0x4cd7a9,_0x137b2b){return new BPromise(function(_0x3fb4e3,_0x469e6a){var _0x3f2e3a=_0x137b2b||client;return _0x3f2e3a[_0x6394('0x25')](_0x1b5673,_0x4cd7a9)[_0x6394('0x26')](function(_0x1fa4dd){logger[_0x6394('0x27')](_0x6394('0x28'),_0x520e45,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x520e45,'request\x20sent',JSON['stringify'](_0x1fa4dd));if(_0x1fa4dd[_0x6394('0x29')]){if(_0x1fa4dd['error'][_0x6394('0x2a')]===0x1f4){logger[_0x6394('0x29')](_0x6394('0x28'),_0x520e45,_0x1fa4dd['error'][_0x6394('0x2b')]);return _0x469e6a(_0x1fa4dd[_0x6394('0x29')][_0x6394('0x2b')]);}logger[_0x6394('0x29')](_0x6394('0x28'),_0x520e45,_0x1fa4dd['error']['message']);return _0x3fb4e3(_0x1fa4dd['error'][_0x6394('0x2b')]);}else{logger[_0x6394('0x27')](_0x6394('0x28'),_0x520e45,_0x6394('0x2c'));_0x3fb4e3(_0x1fa4dd[_0x6394('0x2d')][_0x6394('0x2b')]);}})['catch'](function(_0x48afe){logger[_0x6394('0x29')](_0x6394('0x28'),_0x520e45,_0x48afe);_0x469e6a(_0x48afe);});});}function respondWithStatusCode(_0x3efd1c,_0x5d2f45){_0x5d2f45=_0x5d2f45||0xcc;return function(_0x34a281){if(_0x34a281){return _0x3efd1c['sendStatus'](_0x5d2f45);}return _0x3efd1c[_0x6394('0x2e')](_0x5d2f45)[_0x6394('0x2f')]();};}function respondWithResult(_0x165619,_0x2ff57b){_0x2ff57b=_0x2ff57b||0xc8;return function(_0x5c2bda){if(_0x5c2bda){return _0x165619[_0x6394('0x2e')](_0x2ff57b)['json'](_0x5c2bda);}};}function respondWithFilteredResult(_0x34cb02,_0x1eeb56){return function(_0x13ab15){if(_0x13ab15){var _0x7447ca=_0x13ab15[_0x6394('0x30')],_0x409c1b=_0x1eeb56[_0x6394('0x31')],_0x53c130=_0x1eeb56[_0x6394('0x31')]+_0x1eeb56[_0x6394('0x32')],_0x3089ba;if(_0x53c130>=_0x7447ca){_0x53c130=_0x7447ca;_0x3089ba=0xc8;}else{_0x3089ba=0xce;}_0x34cb02[_0x6394('0x2e')](_0x3089ba);return _0x34cb02['set'](_0x6394('0x33'),_0x409c1b+'-'+_0x53c130+'/'+_0x7447ca)['json'](_0x13ab15);}return null;};}function patchUpdates(_0x4a324b){return function(_0x3cff18){try{jsonpatch[_0x6394('0x34')](_0x3cff18,_0x4a324b,!![]);}catch(_0x130736){return BPromise['reject'](_0x130736);}return _0x3cff18[_0x6394('0x35')]();};}function saveUpdates(_0xb089d1,_0x5472a8){return function(_0x58fe60){if(_0x58fe60){return _0x58fe60[_0x6394('0x36')](_0xb089d1)['then'](function(_0x4339a2){return _0x4339a2;});}return null;};}function removeEntity(_0x3a58ff,_0x52735c){return function(_0x5d8269){if(_0x5d8269){return _0x5d8269[_0x6394('0x37')]()[_0x6394('0x26')](function(){_0x3a58ff['status'](0xcc)[_0x6394('0x2f')]();});}};}function handleEntityNotFound(_0x889496,_0xd34470){return function(_0x3c7c60){if(!_0x3c7c60){_0x889496[_0x6394('0x38')](0x194);}return _0x3c7c60;};}function handleError(_0x15af51,_0x1a9dc1){_0x1a9dc1=_0x1a9dc1||0x1f4;return function(_0x2ded73){logger[_0x6394('0x29')](_0x2ded73[_0x6394('0x39')]);if(_0x2ded73['name']){delete _0x2ded73[_0x6394('0x3a')];}_0x15af51[_0x6394('0x2e')](_0x1a9dc1)[_0x6394('0x3b')](_0x2ded73);};}exports['index']=function(_0x5654c2,_0x196123){var _0x251ffa={},_0x5c2177={},_0x2bdba1={'count':0x0,'rows':[]};var _0x495a33=_[_0x6394('0x3c')](db[_0x6394('0x3d')][_0x6394('0x3e')],function(_0x4d8274){return{'name':_0x4d8274[_0x6394('0x3f')],'type':_0x4d8274[_0x6394('0x40')][_0x6394('0x41')]};});_0x5c2177[_0x6394('0x42')]=_[_0x6394('0x3c')](_0x495a33,_0x6394('0x3a'));_0x5c2177[_0x6394('0x43')]=_[_0x6394('0x44')](_0x5654c2['query']);_0x5c2177[_0x6394('0x45')]=_[_0x6394('0x46')](_0x5c2177[_0x6394('0x42')],_0x5c2177[_0x6394('0x43')]);_0x251ffa['attributes']=_['intersection'](_0x5c2177[_0x6394('0x42')],qs[_0x6394('0x47')](_0x5654c2[_0x6394('0x43')]['fields']));_0x251ffa['attributes']=_0x251ffa[_0x6394('0x48')][_0x6394('0x49')]?_0x251ffa[_0x6394('0x48')]:_0x5c2177[_0x6394('0x42')];if(!_0x5654c2[_0x6394('0x43')]['hasOwnProperty'](_0x6394('0x4a'))){_0x251ffa['limit']=qs['limit'](_0x5654c2[_0x6394('0x43')][_0x6394('0x32')]);_0x251ffa[_0x6394('0x31')]=qs['offset'](_0x5654c2[_0x6394('0x43')][_0x6394('0x31')]);}_0x251ffa[_0x6394('0x4b')]=qs[_0x6394('0x4c')](_0x5654c2['query']['sort']);_0x251ffa[_0x6394('0x4d')]=qs[_0x6394('0x45')](_[_0x6394('0x4e')](_0x5654c2['query'],_0x5c2177[_0x6394('0x45')]),_0x495a33);if(_0x5654c2[_0x6394('0x43')]['filter']){_0x251ffa['where']=_[_0x6394('0x4f')](_0x251ffa[_0x6394('0x4d')],{'$or':_['map'](_0x495a33,function(_0x4e0a3e){if(_0x4e0a3e[_0x6394('0x40')]!==_0x6394('0x50')){var _0x177bb5={};_0x177bb5[_0x4e0a3e[_0x6394('0x3a')]]={'$like':'%'+_0x5654c2[_0x6394('0x43')][_0x6394('0x51')]+'%'};return _0x177bb5;}})});}_0x251ffa=_['merge']({},_0x251ffa,_0x5654c2[_0x6394('0x52')]);var _0x205665={'where':_0x251ffa[_0x6394('0x4d')]};return db[_0x6394('0x3d')]['count'](_0x205665)[_0x6394('0x26')](function(_0x3edb31){_0x2bdba1[_0x6394('0x30')]=_0x3edb31;if(_0x5654c2[_0x6394('0x43')][_0x6394('0x53')]){_0x251ffa[_0x6394('0x54')]=[{'all':!![]}];}return db[_0x6394('0x3d')][_0x6394('0x55')](_0x251ffa);})[_0x6394('0x26')](function(_0x12f8b5){_0x2bdba1['rows']=_0x12f8b5;return _0x2bdba1;})['then'](respondWithFilteredResult(_0x196123,_0x251ffa))['catch'](handleError(_0x196123,null));};exports[_0x6394('0x56')]=function(_0x30d253,_0x22c5d4){var _0x50a0d1={'raw':!![],'where':{'id':_0x30d253[_0x6394('0x57')]['id']}},_0x2ec437={};_0x2ec437[_0x6394('0x42')]=_[_0x6394('0x44')](db[_0x6394('0x3d')][_0x6394('0x3e')]);_0x2ec437[_0x6394('0x43')]=_['keys'](_0x30d253['query']);_0x2ec437[_0x6394('0x45')]=_[_0x6394('0x46')](_0x2ec437[_0x6394('0x42')],_0x2ec437[_0x6394('0x43')]);_0x50a0d1[_0x6394('0x48')]=_[_0x6394('0x46')](_0x2ec437['model'],qs[_0x6394('0x47')](_0x30d253[_0x6394('0x43')][_0x6394('0x47')]));_0x50a0d1[_0x6394('0x48')]=_0x50a0d1[_0x6394('0x48')]['length']?_0x50a0d1[_0x6394('0x48')]:_0x2ec437['model'];if(_0x30d253[_0x6394('0x43')][_0x6394('0x53')]){_0x50a0d1[_0x6394('0x54')]=[{'all':!![]}];}_0x50a0d1=_[_0x6394('0x4f')]({},_0x50a0d1,_0x30d253[_0x6394('0x52')]);return db[_0x6394('0x3d')]['find'](_0x50a0d1)['then'](handleEntityNotFound(_0x22c5d4,null))[_0x6394('0x26')](respondWithResult(_0x22c5d4,null))['catch'](handleError(_0x22c5d4,null));};exports[_0x6394('0x36')]=function(_0x1b6120,_0x3bcd97){if(_0x1b6120[_0x6394('0x58')]['id']){delete _0x1b6120[_0x6394('0x58')]['id'];}return db[_0x6394('0x3d')][_0x6394('0x59')]({'where':{'id':_0x1b6120['params']['id']}})[_0x6394('0x26')](handleEntityNotFound(_0x3bcd97,null))[_0x6394('0x26')](saveUpdates(_0x1b6120[_0x6394('0x58')],null))[_0x6394('0x26')](respondWithResult(_0x3bcd97,null))[_0x6394('0x5a')](handleError(_0x3bcd97,null));};exports[_0x6394('0x37')]=function(_0x233673,_0x3154f8){return db[_0x6394('0x3d')][_0x6394('0x59')]({'where':{'id':_0x233673[_0x6394('0x57')]['id']}})[_0x6394('0x26')](handleEntityNotFound(_0x3154f8,null))[_0x6394('0x26')](removeEntity(_0x3154f8,null))['catch'](handleError(_0x3154f8,null));};exports[_0x6394('0x5b')]=function(_0x8eb158,_0x187cc0){return db['FaxMessage']['describe']()['then'](respondWithResult(_0x187cc0,null))[_0x6394('0x5a')](handleError(_0x187cc0,null));};var interaction_log=require('../../config/logger')(_0x6394('0x5c'));exports[_0x6394('0x5d')]=function(_0x1ea33c,_0x463b94,_0x32bd9d){var _0x10cd99={'channel':_0x6394('0x5e')};if(_0x1ea33c[_0x6394('0x58')]['id']){delete _0x1ea33c[_0x6394('0x58')]['id'];}_0x1ea33c[_0x6394('0x58')][_0x6394('0x5f')]=!![];_0x1ea33c['body'][_0x6394('0x60')]=moment()['format'](_0x6394('0x61'));_0x1ea33c[_0x6394('0x58')][_0x6394('0x62')]=_0x1ea33c[_0x6394('0x58')]['UserId']||_0x1ea33c[_0x6394('0x63')]['id'];return db[_0x6394('0x3d')][_0x6394('0x59')]({'where':{'id':_0x1ea33c[_0x6394('0x57')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x6394('0x26')](handleEntityNotFound(_0x463b94,null))['then'](saveUpdates(_0x1ea33c[_0x6394('0x58')],null))[_0x6394('0x26')](function(_0x5b63af){if(_0x5b63af){_0x10cd99[_0x6394('0x2b')]=_0x5b63af[_0x6394('0x64')]({'plain':!![]});return db[_0x6394('0x65')][_0x6394('0x59')]({'where':{'id':_0x5b63af[_0x6394('0x66')]}});}return null;})[_0x6394('0x26')](handleEntityNotFound(_0x463b94,null))[_0x6394('0x26')](function(_0x5d539a){if(_0x5d539a){return _0x5d539a[_0x6394('0x36')]({'UserId':_0x1ea33c[_0x6394('0x58')][_0x6394('0x62')],'read1stAt':_[_0x6394('0x67')](_0x5d539a[_0x6394('0x68')])?moment()[_0x6394('0x69')](_0x6394('0x61')):undefined});}return null;})[_0x6394('0x26')](function(_0x427fff){if(_0x427fff){_0x10cd99[_0x6394('0x6a')]=_0x427fff[_0x6394('0x64')]({'plain':!![]});interaction_log['info'](_0x6394('0x6b'),_0x1ea33c[_0x6394('0x63')]['id'],_0x1ea33c[_0x6394('0x63')][_0x6394('0x3a')],_0x1ea33c[_0x6394('0x63')]['role'],_0x10cd99[_0x6394('0x6a')]['id'],_0x1ea33c[_0x6394('0x58')]?JSON[_0x6394('0x6c')](_0x1ea33c[_0x6394('0x58')]):_0x6394('0x6d'));return respondWithRpcPromise(_0x6394('0x6e'),_0x6394('0x6f'),_0x10cd99);}return null;})[_0x6394('0x26')](function(_0x2ccf45){if(_0x2ccf45){if(_0x1ea33c['body'][_0x6394('0x70')]){_0x10cd99[_0x6394('0x2b')]['interface']=util[_0x6394('0x69')](_0x6394('0x71'),_0x1ea33c['user'][_0x6394('0x3a')]);_0x10cd99[_0x6394('0x2b')][_0x6394('0x72')]=_0x10cd99[_0x6394('0x72')];_0x10cd99['message'][_0x6394('0x73')]='accept';return respondWithRpcPromise('EventManager',_0x6394('0x74'),{'event':'acceptmessage','message':_0x10cd99[_0x6394('0x2b')]},client9002)['then'](function(){return _0x10cd99;});}return _0x10cd99;}return null;})['then'](respondWithResult(_0x463b94,null))[_0x6394('0x5a')](handleError(_0x463b94,null));};var interaction_log=require(_0x6394('0x15'))(_0x6394('0x5c'));exports['reject']=function(_0x481092,_0x2f4d5c,_0x4bc869){var _0x272760={'agent':{},'channel':_0x6394('0x5e')};if(_0x481092[_0x6394('0x58')]['id']){delete _0x481092[_0x6394('0x58')]['id'];}_0x481092['body'][_0x6394('0x62')]=_0x481092[_0x6394('0x58')]['UserId']||_0x481092[_0x6394('0x63')]['id'];_0x272760[_0x6394('0x75')]['id']=_0x481092[_0x6394('0x58')]['UserId'];return db[_0x6394('0x3d')][_0x6394('0x59')]({'where':{'id':_0x481092[_0x6394('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f4d5c,null))[_0x6394('0x26')](function(_0x3f20cc){if(_0x3f20cc){_0x272760[_0x6394('0x2b')]=_0x3f20cc[_0x6394('0x64')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x3f20cc[_0x6394('0x66')]}});}return null;})[_0x6394('0x26')](handleEntityNotFound(_0x2f4d5c,null))[_0x6394('0x26')](function(_0x37fa6a){if(_0x37fa6a){_0x272760[_0x6394('0x6a')]=_0x37fa6a['get']({'plain':!![]});interaction_log['info'](_0x6394('0x76'),_0x481092[_0x6394('0x63')]['id'],_0x481092[_0x6394('0x63')][_0x6394('0x3a')],_0x481092[_0x6394('0x63')][_0x6394('0x77')],_0x272760[_0x6394('0x6a')]['id'],_0x481092[_0x6394('0x58')]?JSON[_0x6394('0x6c')](_0x481092['body']):'null');return respondWithRpcPromise(_0x6394('0x78'),'rejectMessage',_0x272760);}return null;})[_0x6394('0x26')](function(_0x18194a){if(_0x18194a){_0x18194a[_0x6394('0x2b')][_0x6394('0x79')]=util['format'](_0x6394('0x71'),_0x481092[_0x6394('0x63')][_0x6394('0x3a')]);_0x18194a[_0x6394('0x2b')][_0x6394('0x72')]=_0x272760['channel'];_0x18194a['message'][_0x6394('0x73')]=_0x6394('0x7a');respondWithRpcPromise('EventManager',_0x6394('0x74'),{'event':_0x6394('0x7b'),'message':_0x18194a[_0x6394('0x2b')]},client9002);return _0x272760;}return null;})[_0x6394('0x26')](respondWithResult(_0x2f4d5c,null))[_0x6394('0x5a')](handleError(_0x2f4d5c,null));};exports[_0x6394('0x7c')]=function(_0x228757,_0x3c3689){var _0x3a80da;return db['FaxMessage'][_0x6394('0x7c')](_0x228757[_0x6394('0x58')],{})[_0x6394('0x26')](function(_0x2cd218){_0x3a80da=_0x2cd218;return db[_0x6394('0x7d')][_0x6394('0x7e')]({'where':{'id':_0x3a80da[_0x6394('0x7f')]}});})[_0x6394('0x26')](function(_0x523470){if(_['isNil'](_0x523470)){return;}else{_0x3a80da[_0x6394('0x5e')]=_0x523470['fax'];return db[_0x6394('0x80')][_0x6394('0x7e')]({'where':{'id':_0x3a80da[_0x6394('0x81')]}});}})[_0x6394('0x26')](function(_0x44542d){return respondWithRpcPromise('SendFax',_0x6394('0x82'),{'FaxAccountId':_['isNil'](_0x228757['body'])?undefined:_0x228757['body']['FaxAccountId'],'path':_[_0x6394('0x67')](_0x44542d)?undefined:util['format'](_0x6394('0x83'),_0x44542d[_0x6394('0x84')]),'fax':_[_0x6394('0x67')](_0x3a80da[_0x6394('0x5e')])?undefined:_0x3a80da['fax'],'AttachmentId':_0x3a80da[_0x6394('0x81')]},client9002);})[_0x6394('0x26')](respondWithResult(_0x3c3689,0xc9))[_0x6394('0x5a')](handleError(_0x3c3689,null));};exports[_0x6394('0x85')]=function(_0x1a698a,_0x228da1){var _0x594889=path[_0x6394('0x86')](config[_0x6394('0x87')],_0x6394('0x88'),_0x6394('0x89'),_0x6394('0x8a'));return db[_0x6394('0x3d')][_0x6394('0x59')]({'where':{'id':_0x1a698a[_0x6394('0x57')]['id']},'include':[{'model':db[_0x6394('0x80')],'as':_0x6394('0x80')}]})['then'](handleEntityNotFound(_0x228da1,null))['then'](function(_0x1aafc3){if(_0x1aafc3){return _0x228da1[_0x6394('0x85')](path[_0x6394('0x86')](_0x594889,_0x1aafc3[_0x6394('0x80')]['basename']));}})[_0x6394('0x5a')](handleError(_0x228da1,null));};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js
index d47d764..e02c12c 100644
--- a/server/api/faxMessage/faxMessage.events.js
+++ b/server/api/faxMessage/faxMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0x5fc3,0xa8));var _0x35fc=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0x5fc3[_0x328534];return _0x2796c0;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var FaxMessage=require(_0x35fc('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){FaxMessageEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);FaxMessageEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
+var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x34e8,0x12c));var _0x834e=function(_0x440219,_0x27babe){_0x440219=_0x440219-0x0;var _0x56332a=_0x34e8[_0x440219];return _0x56332a;};'use strict';var EventEmitter=require(_0x834e('0x0'));var FaxMessage=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){FaxMessageEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);FaxMessageEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=FaxMessageEvents;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js
index 8680758..abfb7d6 100644
--- a/server/api/faxMessage/faxMessage.model.js
+++ b/server/api/faxMessage/faxMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f41=['direction','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path','rimraf','./faxMessage.attributes','exports','FaxMessage','fti_fax_messages','FULLTEXT','models','get','toLowerCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f41,0x151));var _0x14f4=function(_0x5d84d6,_0x1a4671){_0x5d84d6=_0x5d84d6-0x0;var _0x2cd0f5=_0x4f41[_0x5d84d6];return _0x2cd0f5;};'use strict';var _=require(_0x14f4('0x0'));var util=require(_0x14f4('0x1'));var logger=require(_0x14f4('0x2'))(_0x14f4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x14f4('0x4'));var rimraf=require(_0x14f4('0x5'));var config=require('../../config/environment');var attributes=require(_0x14f4('0x6'));module[_0x14f4('0x7')]=function(_0xb5ff81,_0x4a6dc1){return _0xb5ff81['define'](_0x14f4('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x14f4('0x9'),'fields':['body'],'type':_0x14f4('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3113b4,_0x234cc2,_0x164c3f){var _0x23259d=_0xb5ff81[_0x14f4('0xb')];var _0x2fc36c=_0x3113b4[_0x14f4('0xc')]({'plain':!![]});if(_0x2fc36c['direction'][_0x14f4('0xd')]()==='in'||_0x2fc36c[_0x14f4('0xe')][_0x14f4('0xd')]()===_0x14f4('0xf')&&!_0x2fc36c[_0x14f4('0x10')]&&!_[_0x14f4('0x11')](_0x2fc36c[_0x14f4('0x12')])){_0x23259d[_0x14f4('0x13')][_0x14f4('0x14')]({'where':{'id':_0x2fc36c[_0x14f4('0x15')]}})[_0x14f4('0x16')](function(_0x4763df){if(_0x4763df){_0x4763df['update']({'lastMsgAt':_0x2fc36c['createdAt'],'lastMsgDirection':_0x2fc36c['direction'][_0x14f4('0xd')]()});}})[_0x14f4('0x17')](function(_0x12d006){console[_0x14f4('0x18')](_0x12d006);});}_0x164c3f();}},'charset':_0x14f4('0x19'),'collate':_0x14f4('0x1a')});};
\ No newline at end of file
+var _0xab02=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fti_fax_messages','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','error'];(function(_0x1c9aa0,_0x2ec0f5){var _0x1419f2=function(_0x194acf){while(--_0x194acf){_0x1c9aa0['push'](_0x1c9aa0['shift']());}};_0x1419f2(++_0x2ec0f5);}(_0xab02,0x18a));var _0x2ab0=function(_0x2db7f6,_0x44831c){_0x2db7f6=_0x2db7f6-0x0;var _0x2c1d45=_0xab02[_0x2db7f6];return _0x2c1d45;};'use strict';var _=require(_0x2ab0('0x0'));var util=require('util');var logger=require(_0x2ab0('0x1'))(_0x2ab0('0x2'));var moment=require(_0x2ab0('0x3'));var BPromise=require(_0x2ab0('0x4'));var rp=require(_0x2ab0('0x5'));var fs=require('fs');var path=require(_0x2ab0('0x6'));var rimraf=require(_0x2ab0('0x7'));var config=require(_0x2ab0('0x8'));var attributes=require(_0x2ab0('0x9'));module['exports']=function(_0x59bf51,_0x3b5be9){return _0x59bf51[_0x2ab0('0xa')](_0x2ab0('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x2ab0('0xc'),'fields':['body'],'type':_0x2ab0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ae494,_0x186075,_0x87545b){var _0x5e27c5=_0x59bf51[_0x2ab0('0xe')];var _0x4afcb8=_0x4ae494['get']({'plain':!![]});if(_0x4afcb8[_0x2ab0('0xf')][_0x2ab0('0x10')]()==='in'||_0x4afcb8[_0x2ab0('0xf')][_0x2ab0('0x10')]()===_0x2ab0('0x11')&&!_0x4afcb8['secret']&&!_[_0x2ab0('0x12')](_0x4afcb8[_0x2ab0('0x13')])){_0x5e27c5[_0x2ab0('0x14')][_0x2ab0('0x15')]({'where':{'id':_0x4afcb8[_0x2ab0('0x16')]}})[_0x2ab0('0x17')](function(_0x8d9781){if(_0x8d9781){_0x8d9781['update']({'lastMsgAt':_0x4afcb8[_0x2ab0('0x18')],'lastMsgDirection':_0x4afcb8['direction'][_0x2ab0('0x10')]()});}})['catch'](function(_0x3628c7){console[_0x2ab0('0x19')](_0x3628c7);});}_0x87545b();}},'charset':_0x2ab0('0x1a'),'collate':_0x2ab0('0x1b')});};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js
index 4eff4f4..54fcd79 100644
--- a/server/api/faxMessage/faxMessage.rpc.js
+++ b/server/api/faxMessage/faxMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x12dc=['../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','FaxMessage','body','then','CreateFaxMessage','stringify','UpdateFaxMessage','update','options','raw','where','attributes','limit','lodash','util','bluebird','ioredis'];(function(_0x6d17e3,_0x372715){var _0x163e6c=function(_0x40d0d6){while(--_0x40d0d6){_0x6d17e3['push'](_0x6d17e3['shift']());}};_0x163e6c(++_0x372715);}(_0x12dc,0xab));var _0xc12d=function(_0x1f0495,_0x44dabc){_0x1f0495=_0x1f0495-0x0;var _0x310b64=_0x12dc[_0x1f0495];return _0x310b64;};'use strict';var _=require(_0xc12d('0x0'));var util=require(_0xc12d('0x1'));var moment=require('moment');var BPromise=require(_0xc12d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc12d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc12d('0x4'));var logger=require(_0xc12d('0x5'))('rpc');var config=require(_0xc12d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc12d('0x7')]({'port':0x232a});config['redis']=_[_0xc12d('0x8')](config[_0xc12d('0x9')],{'host':_0xc12d('0xa'),'port':0x18eb});var socket=require(_0xc12d('0xb'))(new Redis(config['redis']));require(_0xc12d('0xc'))['register'](socket);function respondWithRpcPromise(_0x293202,_0x126ea2,_0x1ba497){return new BPromise(function(_0x2d0371,_0x4f48b4){return client[_0xc12d('0xd')](_0x293202,_0x1ba497)['then'](function(_0x15ea4e){logger[_0xc12d('0xe')](_0xc12d('0xf'),_0x126ea2,_0xc12d('0x10'));logger[_0xc12d('0x11')](_0xc12d('0x12'),_0x126ea2,_0xc12d('0x10'),JSON['stringify'](_0x15ea4e));if(_0x15ea4e[_0xc12d('0x13')]){if(_0x15ea4e[_0xc12d('0x13')][_0xc12d('0x14')]===0x1f4){logger[_0xc12d('0x13')](_0xc12d('0xf'),_0x126ea2,_0x15ea4e['error'][_0xc12d('0x15')]);return _0x4f48b4(_0x15ea4e['error'][_0xc12d('0x15')]);}logger[_0xc12d('0x13')]('FaxMessage,\x20%s,\x20%s',_0x126ea2,_0x15ea4e[_0xc12d('0x13')]['message']);return _0x2d0371(_0x15ea4e[_0xc12d('0x13')][_0xc12d('0x15')]);}else{logger[_0xc12d('0xe')](_0xc12d('0xf'),_0x126ea2,'request\x20sent');_0x2d0371(_0x15ea4e['result'][_0xc12d('0x15')]);}})[_0xc12d('0x16')](function(_0x208e8f){logger[_0xc12d('0x13')](_0xc12d('0xf'),_0x126ea2,_0x208e8f);_0x4f48b4(_0x208e8f);});});}exports['CreateFaxMessage']=function(_0x5c9a90){var _0x40a3da=this;return new Promise(function(_0x4adbc3,_0xd3171){return db[_0xc12d('0x17')]['create'](_0x5c9a90[_0xc12d('0x18')],{'raw':_0x5c9a90['options']?_0x5c9a90['options']['raw']===undefined?!![]:![]:!![]})[_0xc12d('0x19')](function(_0xd8b4c7){logger[_0xc12d('0xe')](_0xc12d('0x1a'),_0x5c9a90);logger['debug']('CreateFaxMessage',_0x5c9a90,JSON[_0xc12d('0x1b')](_0xd8b4c7));_0x4adbc3(_0xd8b4c7);})['catch'](function(_0x806313){logger[_0xc12d('0x13')]('CreateFaxMessage',_0x806313[_0xc12d('0x15')],_0x5c9a90);_0xd3171(_0x40a3da[_0xc12d('0x13')](0x1f4,_0x806313[_0xc12d('0x15')]));});});};exports[_0xc12d('0x1c')]=function(_0x245a30){var _0x2cd0fb=this;return new Promise(function(_0x50f501,_0x4e64ed){return db[_0xc12d('0x17')][_0xc12d('0x1d')](_0x245a30['body'],{'raw':_0x245a30[_0xc12d('0x1e')]?_0x245a30['options'][_0xc12d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x245a30[_0xc12d('0x1e')]?_0x245a30['options'][_0xc12d('0x20')]||null:null,'attributes':_0x245a30['options']?_0x245a30[_0xc12d('0x1e')][_0xc12d('0x21')]||null:null,'limit':_0x245a30[_0xc12d('0x1e')]?_0x245a30[_0xc12d('0x1e')][_0xc12d('0x22')]||null:null})[_0xc12d('0x19')](function(_0x13c2ed){logger[_0xc12d('0xe')](_0xc12d('0x1c'),_0x245a30);logger[_0xc12d('0x11')]('UpdateFaxMessage',_0x245a30,JSON['stringify'](_0x13c2ed));_0x50f501(_0x13c2ed);})['catch'](function(_0x1d7203){logger[_0xc12d('0x13')](_0xc12d('0x1c'),_0x1d7203['message'],_0x245a30);_0x4e64ed(_0x2cd0fb[_0xc12d('0x13')](0x1f4,_0x1d7203[_0xc12d('0x15')]));});});};
\ No newline at end of file
+var _0x2a4e=['message','catch','CreateFaxMessage','options','raw','UpdateFaxMessage','FaxMessage','update','body','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a4e,0x1df));var _0xe2a4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2a4e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe2a4('0x0'));var util=require('util');var moment=require(_0xe2a4('0x1'));var BPromise=require(_0xe2a4('0x2'));var rs=require(_0xe2a4('0x3'));var fs=require('fs');var Redis=require(_0xe2a4('0x4'));var db=require(_0xe2a4('0x5'))['db'];var utils=require(_0xe2a4('0x6'));var logger=require(_0xe2a4('0x7'))(_0xe2a4('0x8'));var config=require(_0xe2a4('0x9'));var jayson=require(_0xe2a4('0xa'));var client=jayson[_0xe2a4('0xb')][_0xe2a4('0xc')]({'port':0x232a});config[_0xe2a4('0xd')]=_[_0xe2a4('0xe')](config[_0xe2a4('0xd')],{'host':_0xe2a4('0xf'),'port':0x18eb});var socket=require(_0xe2a4('0x10'))(new Redis(config[_0xe2a4('0xd')]));require(_0xe2a4('0x11'))['register'](socket);function respondWithRpcPromise(_0x2bcfbd,_0x5ac6d5,_0x12a3de){return new BPromise(function(_0x524a46,_0x37b3ad){return client[_0xe2a4('0x12')](_0x2bcfbd,_0x12a3de)[_0xe2a4('0x13')](function(_0x220cc3){logger[_0xe2a4('0x14')](_0xe2a4('0x15'),_0x5ac6d5,_0xe2a4('0x16'));logger[_0xe2a4('0x17')](_0xe2a4('0x18'),_0x5ac6d5,'request\x20sent',JSON[_0xe2a4('0x19')](_0x220cc3));if(_0x220cc3[_0xe2a4('0x1a')]){if(_0x220cc3[_0xe2a4('0x1a')][_0xe2a4('0x1b')]===0x1f4){logger[_0xe2a4('0x1a')](_0xe2a4('0x15'),_0x5ac6d5,_0x220cc3['error'][_0xe2a4('0x1c')]);return _0x37b3ad(_0x220cc3[_0xe2a4('0x1a')][_0xe2a4('0x1c')]);}logger[_0xe2a4('0x1a')](_0xe2a4('0x15'),_0x5ac6d5,_0x220cc3[_0xe2a4('0x1a')]['message']);return _0x524a46(_0x220cc3['error']['message']);}else{logger[_0xe2a4('0x14')](_0xe2a4('0x15'),_0x5ac6d5,_0xe2a4('0x16'));_0x524a46(_0x220cc3['result']['message']);}})[_0xe2a4('0x1d')](function(_0x5ab14b){logger['error'](_0xe2a4('0x15'),_0x5ac6d5,_0x5ab14b);_0x37b3ad(_0x5ab14b);});});}exports[_0xe2a4('0x1e')]=function(_0x123658){var _0x30b75b=this;return new Promise(function(_0x1ac839,_0x13dc98){return db['FaxMessage']['create'](_0x123658['body'],{'raw':_0x123658['options']?_0x123658[_0xe2a4('0x1f')][_0xe2a4('0x20')]===undefined?!![]:![]:!![]})[_0xe2a4('0x13')](function(_0x42bed1){logger[_0xe2a4('0x14')]('CreateFaxMessage',_0x123658);logger[_0xe2a4('0x17')](_0xe2a4('0x1e'),_0x123658,JSON[_0xe2a4('0x19')](_0x42bed1));_0x1ac839(_0x42bed1);})[_0xe2a4('0x1d')](function(_0xfdb3a0){logger[_0xe2a4('0x1a')]('CreateFaxMessage',_0xfdb3a0['message'],_0x123658);_0x13dc98(_0x30b75b[_0xe2a4('0x1a')](0x1f4,_0xfdb3a0[_0xe2a4('0x1c')]));});});};exports[_0xe2a4('0x21')]=function(_0x518c26){var _0x4cc88d=this;return new Promise(function(_0x1b8848,_0xc733cc){return db[_0xe2a4('0x22')][_0xe2a4('0x23')](_0x518c26[_0xe2a4('0x24')],{'raw':_0x518c26['options']?_0x518c26[_0xe2a4('0x1f')][_0xe2a4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x518c26[_0xe2a4('0x1f')]?_0x518c26[_0xe2a4('0x1f')]['where']||null:null,'attributes':_0x518c26[_0xe2a4('0x1f')]?_0x518c26[_0xe2a4('0x1f')][_0xe2a4('0x25')]||null:null,'limit':_0x518c26[_0xe2a4('0x1f')]?_0x518c26['options'][_0xe2a4('0x26')]||null:null})[_0xe2a4('0x13')](function(_0x575f5b){logger[_0xe2a4('0x14')](_0xe2a4('0x21'),_0x518c26);logger[_0xe2a4('0x17')]('UpdateFaxMessage',_0x518c26,JSON[_0xe2a4('0x19')](_0x575f5b));_0x1b8848(_0x575f5b);})['catch'](function(_0x1413fc){logger['error'](_0xe2a4('0x21'),_0x1413fc[_0xe2a4('0x1c')],_0x518c26);_0xc733cc(_0x4cc88d[_0xe2a4('0x1a')](0x1f4,_0x1413fc[_0xe2a4('0x1c')]));});});};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js
index 9d7f3d9..26e4bdf 100644
--- a/server/api/faxMessage/faxMessage.socket.js
+++ b/server/api/faxMessage/faxMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}};
\ No newline at end of file
+var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}};
\ No newline at end of file
diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js
index 91d73f5..e2cf8ca 100644
--- a/server/api/faxMessage/index.js
+++ b/server/api/faxMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x58a4=['post','fax','faxmessage:create','put','update','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','/:id','/:id/download','download'];(function(_0x1d4670,_0x4f3055){var _0x1cf4d8=function(_0x1133ad){while(--_0x1133ad){_0x1d4670['push'](_0x1d4670['shift']());}};_0x1cf4d8(++_0x4f3055);}(_0x58a4,0xbf));var _0x458a=function(_0x29db14,_0x4fcd9f){_0x29db14=_0x29db14-0x0;var _0x5cfc55=_0x58a4[_0x29db14];return _0x5cfc55;};'use strict';var multer=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var path=require(_0x458a('0x2'));var timeout=require(_0x458a('0x3'));var express=require(_0x458a('0x4'));var router=express[_0x458a('0x5')]();var auth=require(_0x458a('0x6'));var interaction=require(_0x458a('0x7'));var config=require(_0x458a('0x8'));var controller=require(_0x458a('0x9'));router[_0x458a('0xa')]('/',auth[_0x458a('0xb')](),controller[_0x458a('0xc')]);router['get']('/describe',auth[_0x458a('0xb')](),controller[_0x458a('0xd')]);router[_0x458a('0xa')](_0x458a('0xe'),auth[_0x458a('0xb')](),controller['show']);router['get'](_0x458a('0xf'),auth[_0x458a('0xb')](),controller[_0x458a('0x10')]);router[_0x458a('0x11')]('/',auth[_0x458a('0xb')](),interaction['tracked'](_0x458a('0x12'),_0x458a('0x13')),controller['create']);router[_0x458a('0x14')](_0x458a('0xe'),auth[_0x458a('0xb')](),controller[_0x458a('0x15')]);router[_0x458a('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0x458a('0x16')]);router['put'](_0x458a('0x17'),auth[_0x458a('0xb')](),controller[_0x458a('0x18')]);router[_0x458a('0x19')](_0x458a('0xe'),auth[_0x458a('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8fdb=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','download','post','tracked','fax','create','put','update','/:id/accept','accept','destroy','exports','multer'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8fdb,0xe9));var _0xb8fd=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x8fdb[_0x101e7b];return _0x4995c0;};'use strict';var multer=require(_0xb8fd('0x0'));var util=require(_0xb8fd('0x1'));var path=require(_0xb8fd('0x2'));var timeout=require(_0xb8fd('0x3'));var express=require(_0xb8fd('0x4'));var router=express[_0xb8fd('0x5')]();var auth=require(_0xb8fd('0x6'));var interaction=require(_0xb8fd('0x7'));var config=require(_0xb8fd('0x8'));var controller=require('./faxMessage.controller');router[_0xb8fd('0x9')]('/',auth[_0xb8fd('0xa')](),controller[_0xb8fd('0xb')]);router[_0xb8fd('0x9')]('/describe',auth[_0xb8fd('0xa')](),controller[_0xb8fd('0xc')]);router[_0xb8fd('0x9')](_0xb8fd('0xd'),auth[_0xb8fd('0xa')](),controller[_0xb8fd('0xe')]);router['get']('/:id/download',auth[_0xb8fd('0xa')](),controller[_0xb8fd('0xf')]);router[_0xb8fd('0x10')]('/',auth[_0xb8fd('0xa')](),interaction[_0xb8fd('0x11')](_0xb8fd('0x12'),'faxmessage:create'),controller[_0xb8fd('0x13')]);router[_0xb8fd('0x14')](_0xb8fd('0xd'),auth[_0xb8fd('0xa')](),controller[_0xb8fd('0x15')]);router[_0xb8fd('0x14')](_0xb8fd('0x16'),auth['isAuthenticated'](),controller[_0xb8fd('0x17')]);router['put']('/:id/reject',auth[_0xb8fd('0xa')](),controller['reject']);router['delete'](_0xb8fd('0xd'),auth[_0xb8fd('0xa')](),controller[_0xb8fd('0x18')]);module[_0xb8fd('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js
index 73c81ba..5f09b96 100644
--- a/server/api/faxQueue/faxQueue.attributes.js
+++ b/server/api/faxQueue/faxQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc570=['INTEGER','ENUM','rrmemory','beepall','exports','STRING'];(function(_0x4318b0,_0x620eff){var _0x3fb711=function(_0x198cac){while(--_0x198cac){_0x4318b0['push'](_0x4318b0['shift']());}};_0x3fb711(++_0x620eff);}(_0xc570,0x142));var _0x0c57=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xc570[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require('sequelize');module[_0x0c57('0x0')]={'name':{'type':Sequelize[_0x0c57('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0c57('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0c57('0x3')](_0x0c57('0x4'),_0x0c57('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4db2=['roundrobin','INTEGER','sequelize','exports','STRING','beepall'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x4db2,0x158));var _0x24db=function(_0x1c2aeb,_0x48433c){_0x1c2aeb=_0x1c2aeb-0x0;var _0x783379=_0x4db2[_0x1c2aeb];return _0x783379;};'use strict';var Sequelize=require(_0x24db('0x0'));module[_0x24db('0x1')]={'name':{'type':Sequelize[_0x24db('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x24db('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x24db('0x3'),_0x24db('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x24db('0x5')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js
index e2ff78d..0a4ce7c 100644
--- a/server/api/faxQueue/faxQueue.controller.js
+++ b/server/api/faxQueue/faxQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x94e6=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','FaxQueue','include','rows','catch','show','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','order','FaxQueueId','findAll','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','desk.js'];(function(_0x2a8957,_0x5418f2){var _0x5b1960=function(_0xeff538){while(--_0xeff538){_0x2a8957['push'](_0x2a8957['shift']());}};_0x5b1960(++_0x5418f2);}(_0x94e6,0x194));var _0x694e=function(_0x544b80,_0x428ab0){_0x544b80=_0x544b80-0x0;var _0x22cbe7=_0x94e6[_0x544b80];return _0x22cbe7;};'use strict';var pdf=require(_0x694e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x694e('0x1'));var zipdir=require(_0x694e('0x2'));var jsonpatch=require(_0x694e('0x3'));var rp=require(_0x694e('0x4'));var moment=require(_0x694e('0x5'));var BPromise=require(_0x694e('0x6'));var Mustache=require('mustache');var util=require(_0x694e('0x7'));var path=require(_0x694e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x694e('0x9'));var fs=require('fs');var _=require(_0x694e('0xa'));var squel=require(_0x694e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x694e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x694e('0xd'));var authService=require(_0x694e('0xe'));var qs=require(_0x694e('0xf'));var as=require(_0x694e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x694e('0x11'))(_0x694e('0x12'));var utils=require('../../config/utils');var config=require(_0x694e('0x13'));var db=require(_0x694e('0x14'))['db'];config[_0x694e('0x15')]=_[_0x694e('0x16')](config['redis'],{'host':_0x694e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x694e('0x15')]));require(_0x694e('0x18'))[_0x694e('0x19')](socket);function respondWithStatusCode(_0x3a4a60,_0x1532f6){_0x1532f6=_0x1532f6||0xcc;return function(_0x310a08){if(_0x310a08){return _0x3a4a60[_0x694e('0x1a')](_0x1532f6);}return _0x3a4a60[_0x694e('0x1b')](_0x1532f6)[_0x694e('0x1c')]();};}function respondWithResult(_0x1f4df1,_0x327f83){_0x327f83=_0x327f83||0xc8;return function(_0x46d46c){if(_0x46d46c){return _0x1f4df1[_0x694e('0x1b')](_0x327f83)['json'](_0x46d46c);}};}function respondWithFilteredResult(_0x45abd6,_0x414a6c){return function(_0x40b5bd){if(_0x40b5bd){var _0x38966f=_0x40b5bd[_0x694e('0x1d')],_0x2a332b=_0x414a6c[_0x694e('0x1e')],_0x3cd7b9=_0x414a6c[_0x694e('0x1e')]+_0x414a6c[_0x694e('0x1f')],_0x165125;if(_0x3cd7b9>=_0x38966f){_0x3cd7b9=_0x38966f;_0x165125=0xc8;}else{_0x165125=0xce;}_0x45abd6['status'](_0x165125);return _0x45abd6[_0x694e('0x20')]('Content-Range',_0x2a332b+'-'+_0x3cd7b9+'/'+_0x38966f)[_0x694e('0x21')](_0x40b5bd);}return null;};}function patchUpdates(_0x46868d){return function(_0x4b191b){try{jsonpatch[_0x694e('0x22')](_0x4b191b,_0x46868d,!![]);}catch(_0x443614){return BPromise[_0x694e('0x23')](_0x443614);}return _0x4b191b[_0x694e('0x24')]();};}function saveUpdates(_0x22d614,_0x308e24){return function(_0x2bb6dc){if(_0x2bb6dc){return _0x2bb6dc[_0x694e('0x25')](_0x22d614)[_0x694e('0x26')](function(_0x40b126){return _0x40b126;});}return null;};}function removeEntity(_0x415eb0,_0x508b9b){return function(_0x5e2332){if(_0x5e2332){return _0x5e2332[_0x694e('0x27')]()[_0x694e('0x26')](function(){var _0x4ea16c=_0x5e2332[_0x694e('0x28')]({'plain':!![]});var _0x2f6984=_0x694e('0x29');return db[_0x694e('0x2a')][_0x694e('0x27')]({'where':{'type':_0x2f6984,'resourceId':_0x4ea16c['id']}})[_0x694e('0x26')](function(){return _0x5e2332;});})[_0x694e('0x26')](function(){_0x415eb0[_0x694e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x315ef3,_0x3ef315){return function(_0xe34d77){if(!_0xe34d77){_0x315ef3[_0x694e('0x1a')](0x194);}return _0xe34d77;};}function handleError(_0xbce4e7,_0x3fe22a){_0x3fe22a=_0x3fe22a||0x1f4;return function(_0x482209){logger[_0x694e('0x2b')](_0x482209['stack']);if(_0x482209[_0x694e('0x2c')]){delete _0x482209[_0x694e('0x2c')];}_0xbce4e7[_0x694e('0x1b')](_0x3fe22a)['send'](_0x482209);};}exports[_0x694e('0x2d')]=function(_0x5a59cf,_0x548094){var _0x3771f4={},_0x44c8d1={},_0xd0a3ff={'count':0x0,'rows':[]};var _0x53c38d=_[_0x694e('0x2e')](db['FaxQueue'][_0x694e('0x2f')],function(_0x21a1d6){return{'name':_0x21a1d6['fieldName'],'type':_0x21a1d6[_0x694e('0x30')][_0x694e('0x31')]};});_0x44c8d1[_0x694e('0x32')]=_[_0x694e('0x2e')](_0x53c38d,'name');_0x44c8d1[_0x694e('0x33')]=_['keys'](_0x5a59cf[_0x694e('0x33')]);_0x44c8d1[_0x694e('0x34')]=_[_0x694e('0x35')](_0x44c8d1['model'],_0x44c8d1[_0x694e('0x33')]);_0x3771f4[_0x694e('0x36')]=_[_0x694e('0x35')](_0x44c8d1[_0x694e('0x32')],qs[_0x694e('0x37')](_0x5a59cf[_0x694e('0x33')][_0x694e('0x37')]));_0x3771f4[_0x694e('0x36')]=_0x3771f4['attributes'][_0x694e('0x38')]?_0x3771f4[_0x694e('0x36')]:_0x44c8d1[_0x694e('0x32')];if(!_0x5a59cf[_0x694e('0x33')]['hasOwnProperty'](_0x694e('0x39'))){_0x3771f4[_0x694e('0x1f')]=qs[_0x694e('0x1f')](_0x5a59cf[_0x694e('0x33')][_0x694e('0x1f')]);_0x3771f4[_0x694e('0x1e')]=qs[_0x694e('0x1e')](_0x5a59cf[_0x694e('0x33')][_0x694e('0x1e')]);}_0x3771f4['order']=qs['sort'](_0x5a59cf[_0x694e('0x33')][_0x694e('0x3a')]);_0x3771f4[_0x694e('0x3b')]=qs[_0x694e('0x34')](_[_0x694e('0x3c')](_0x5a59cf['query'],_0x44c8d1[_0x694e('0x34')]),_0x53c38d);if(_0x5a59cf[_0x694e('0x33')][_0x694e('0x3d')]){_0x3771f4[_0x694e('0x3b')]=_[_0x694e('0x3e')](_0x3771f4[_0x694e('0x3b')],{'$or':_[_0x694e('0x2e')](_0x53c38d,function(_0x196c9a){if(_0x196c9a[_0x694e('0x30')]!=='VIRTUAL'){var _0x345dbc={};_0x345dbc[_0x196c9a['name']]={'$like':'%'+_0x5a59cf[_0x694e('0x33')]['filter']+'%'};return _0x345dbc;}})});}_0x3771f4=_[_0x694e('0x3e')]({},_0x3771f4,_0x5a59cf[_0x694e('0x3f')]);var _0x331839={'where':_0x3771f4['where']};return db[_0x694e('0x40')][_0x694e('0x1d')](_0x331839)[_0x694e('0x26')](function(_0x3dd5a5){_0xd0a3ff[_0x694e('0x1d')]=_0x3dd5a5;if(_0x5a59cf[_0x694e('0x33')]['includeAll']){_0x3771f4[_0x694e('0x41')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x3771f4);})['then'](function(_0x2559cd){_0xd0a3ff[_0x694e('0x42')]=_0x2559cd;return _0xd0a3ff;})[_0x694e('0x26')](respondWithFilteredResult(_0x548094,_0x3771f4))[_0x694e('0x43')](handleError(_0x548094,null));};exports[_0x694e('0x44')]=function(_0x5e9fbc,_0x357599){var _0x29ecce={'raw':!![],'where':{'id':_0x5e9fbc[_0x694e('0x45')]['id']}},_0x10d041={};_0x10d041[_0x694e('0x32')]=_[_0x694e('0x46')](db[_0x694e('0x40')][_0x694e('0x2f')]);_0x10d041['query']=_['keys'](_0x5e9fbc[_0x694e('0x33')]);_0x10d041[_0x694e('0x34')]=_[_0x694e('0x35')](_0x10d041['model'],_0x10d041[_0x694e('0x33')]);_0x29ecce[_0x694e('0x36')]=_[_0x694e('0x35')](_0x10d041[_0x694e('0x32')],qs[_0x694e('0x37')](_0x5e9fbc[_0x694e('0x33')][_0x694e('0x37')]));_0x29ecce[_0x694e('0x36')]=_0x29ecce['attributes'][_0x694e('0x38')]?_0x29ecce[_0x694e('0x36')]:_0x10d041[_0x694e('0x32')];if(_0x5e9fbc['query'][_0x694e('0x47')]){_0x29ecce[_0x694e('0x41')]=[{'all':!![]}];}_0x29ecce=_[_0x694e('0x3e')]({},_0x29ecce,_0x5e9fbc[_0x694e('0x3f')]);return db['FaxQueue'][_0x694e('0x48')](_0x29ecce)[_0x694e('0x26')](handleEntityNotFound(_0x357599,null))[_0x694e('0x26')](respondWithResult(_0x357599,null))['catch'](handleError(_0x357599,null));};exports[_0x694e('0x49')]=function(_0xdfa0dd,_0xfc62b5){return db['FaxQueue'][_0x694e('0x49')](_0xdfa0dd[_0x694e('0x4a')],{})[_0x694e('0x26')](function(_0x30ccc4){var _0x537e23=_0xdfa0dd['user'][_0x694e('0x28')]({'plain':!![]});if(!_0x537e23)throw new Error(_0x694e('0x4b'));if(_0x537e23[_0x694e('0x4c')]===_0x694e('0x4d')){var _0x449675=_0x30ccc4[_0x694e('0x28')]({'plain':!![]});var _0x10a402=_0x694e('0x29');return db[_0x694e('0x4e')][_0x694e('0x48')]({'where':{'name':_0x10a402,'userProfileId':_0x537e23[_0x694e('0x4f')]},'raw':!![]})[_0x694e('0x26')](function(_0x350641){if(_0x350641&&_0x350641[_0x694e('0x50')]===0x0){return db['UserProfileResource'][_0x694e('0x49')]({'name':_0x449675[_0x694e('0x2c')],'resourceId':_0x449675['id'],'type':_0x350641[_0x694e('0x2c')],'sectionId':_0x350641['id']},{})[_0x694e('0x26')](function(){return _0x30ccc4;});}else{return _0x30ccc4;}})[_0x694e('0x43')](function(_0x27ad8b){logger[_0x694e('0x2b')](_0x694e('0x51'),_0x27ad8b);throw _0x27ad8b;});}return _0x30ccc4;})[_0x694e('0x26')](respondWithResult(_0xfc62b5,0xc9))[_0x694e('0x43')](handleError(_0xfc62b5,null));};exports[_0x694e('0x25')]=function(_0x12c014,_0x28d4f6){if(_0x12c014[_0x694e('0x4a')]['id']){delete _0x12c014[_0x694e('0x4a')]['id'];}return db[_0x694e('0x40')][_0x694e('0x48')]({'where':{'id':_0x12c014['params']['id']}})[_0x694e('0x26')](handleEntityNotFound(_0x28d4f6,null))[_0x694e('0x26')](saveUpdates(_0x12c014[_0x694e('0x4a')],null))[_0x694e('0x26')](respondWithResult(_0x28d4f6,null))[_0x694e('0x43')](handleError(_0x28d4f6,null));};exports['destroy']=function(_0x1fe3ed,_0x30b173){return db['FaxQueue']['find']({'where':{'id':_0x1fe3ed['params']['id']}})['then'](handleEntityNotFound(_0x30b173,null))[_0x694e('0x26')](removeEntity(_0x30b173,null))['catch'](handleError(_0x30b173,null));};exports[_0x694e('0x52')]=function(_0x277844,_0x497d2c){return db[_0x694e('0x40')][_0x694e('0x52')]()['then'](respondWithResult(_0x497d2c,null))['catch'](handleError(_0x497d2c,null));};exports[_0x694e('0x53')]=function(_0x498a7c,_0x5a171c,_0x5eea31){var _0x208973={'raw':!![],'where':{}},_0x54ca88={},_0x813b94;return db[_0x694e('0x40')][_0x694e('0x54')]({'where':{'id':_0x498a7c['params']['id']}})[_0x694e('0x26')](handleEntityNotFound(_0x5a171c,null))[_0x694e('0x26')](function(_0x1cba5f){if(_0x1cba5f){_0x813b94=_0x1cba5f[_0x694e('0x28')]({'plain':!![]});_0x54ca88[_0x694e('0x32')]=_[_0x694e('0x46')](db[_0x694e('0x55')][_0x694e('0x2f')]);_0x54ca88[_0x694e('0x33')]=_['keys'](_0x498a7c[_0x694e('0x33')]);_0x54ca88[_0x694e('0x34')]=_[_0x694e('0x35')](_0x54ca88[_0x694e('0x32')],_0x54ca88[_0x694e('0x33')]);_0x208973[_0x694e('0x36')]=_['intersection'](_0x54ca88[_0x694e('0x32')],qs[_0x694e('0x37')](_0x498a7c[_0x694e('0x33')]['fields']));_0x208973[_0x694e('0x36')]=_0x208973[_0x694e('0x36')]['length']?_0x208973[_0x694e('0x36')]:_0x54ca88['model'];if(!_0x498a7c['query'][_0x694e('0x56')]('nolimit')){_0x208973[_0x694e('0x1f')]=qs['limit'](_0x498a7c[_0x694e('0x33')]['limit']);_0x208973['offset']=qs['offset'](_0x498a7c[_0x694e('0x33')][_0x694e('0x1e')]);}_0x208973[_0x694e('0x57')]=qs['sort'](_0x498a7c['query'][_0x694e('0x3a')]);_0x208973[_0x694e('0x3b')]=qs[_0x694e('0x34')](_['pick'](_0x498a7c[_0x694e('0x33')],_0x54ca88[_0x694e('0x34')]));_0x208973[_0x694e('0x3b')][_0x694e('0x58')]=_0x1cba5f['id'];if(_0x498a7c[_0x694e('0x33')][_0x694e('0x3d')]){_0x208973[_0x694e('0x3b')]=_['merge'](_0x208973[_0x694e('0x3b')],{'$or':_[_0x694e('0x2e')](_0x208973[_0x694e('0x36')],function(_0x3577ad){var _0x5e47c5={};_0x5e47c5[_0x3577ad]={'$like':'%'+_0x498a7c[_0x694e('0x33')][_0x694e('0x3d')]+'%'};return _0x5e47c5;})});}_0x208973=_['merge']({},_0x208973,_0x498a7c['options']);return db[_0x694e('0x55')][_0x694e('0x59')](_0x208973);}})[_0x694e('0x26')](function(_0x577e81){if(_0x577e81){return db[_0x694e('0x5a')][_0x694e('0x5b')]({'where':{'id':_[_0x694e('0x2e')](_0x577e81,'UserId'),'role':_0x694e('0x5c')},'attributes':['id',_0x694e('0x2c'),_0x694e('0x5d'),_0x694e('0x5e'),_0x694e('0x5f')]});}})[_0x694e('0x26')](function(_0x450251){if(_0x450251){return{'count':_0x450251['count'],'rows':_[_0x694e('0x2e')](_0x450251['rows'],function(_0x55217b){return{'membername':_0x55217b[_0x694e('0x2c')],'UserId':_0x55217b['id'],'queue_name':_0x813b94['name'],'FaxQueueId':_0x813b94['id'],'interface':util[_0x694e('0x60')]('%s/%s',_0x694e('0x61'),_0x55217b[_0x694e('0x2c')]),'penalty':0x0,'paused':_0x55217b['faxPause'],'createdAt':_0x55217b[_0x694e('0x5f')],'updatedAt':_0x55217b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x694e('0x26')](respondWithFilteredResult(_0x5a171c,_0x208973))[_0x694e('0x43')](handleError(_0x5a171c,null));};exports[_0x694e('0x62')]=function(_0x3860ce,_0x33e369,_0x51ea34){var _0x39faab={};var _0x1bd40c={};var _0x48cc11;var _0x2dcc27;return db['FaxQueue'][_0x694e('0x54')]({'where':{'id':_0x3860ce[_0x694e('0x45')]['id']}})[_0x694e('0x26')](handleEntityNotFound(_0x33e369,null))[_0x694e('0x26')](function(_0x575290){if(_0x575290){_0x48cc11=_0x575290;_0x1bd40c['model']=_[_0x694e('0x46')](db[_0x694e('0x63')][_0x694e('0x2f')]);_0x1bd40c[_0x694e('0x33')]=_['keys'](_0x3860ce[_0x694e('0x33')]);_0x1bd40c['filters']=_[_0x694e('0x35')](_0x1bd40c[_0x694e('0x32')],_0x1bd40c['query']);_0x39faab['attributes']=_[_0x694e('0x35')](_0x1bd40c['model'],qs['fields'](_0x3860ce[_0x694e('0x33')][_0x694e('0x37')]));_0x39faab[_0x694e('0x36')]=_0x39faab[_0x694e('0x36')]['length']?_0x39faab[_0x694e('0x36')]:_0x1bd40c[_0x694e('0x32')];_0x39faab[_0x694e('0x57')]=qs[_0x694e('0x3a')](_0x3860ce['query'][_0x694e('0x3a')]);_0x39faab[_0x694e('0x3b')]=qs[_0x694e('0x34')](_['pick'](_0x3860ce[_0x694e('0x33')],_0x1bd40c[_0x694e('0x34')]));if(_0x3860ce['query'][_0x694e('0x3d')]){_0x39faab['where']=_['merge'](_0x39faab[_0x694e('0x3b')],{'$or':_[_0x694e('0x2e')](_0x39faab[_0x694e('0x36')],function(_0x421278){var _0x3df96e={};_0x3df96e[_0x421278]={'$like':'%'+_0x3860ce[_0x694e('0x33')][_0x694e('0x3d')]+'%'};return _0x3df96e;})});}_0x39faab=_['merge']({},_0x39faab,_0x3860ce[_0x694e('0x3f')]);return _0x48cc11[_0x694e('0x62')](_0x39faab);}})[_0x694e('0x26')](function(_0x5e4260){if(_0x5e4260){_0x2dcc27=_0x5e4260[_0x694e('0x38')];if(!_0x3860ce[_0x694e('0x33')][_0x694e('0x56')]('nolimit')){_0x39faab[_0x694e('0x1f')]=qs['limit'](_0x3860ce[_0x694e('0x33')][_0x694e('0x1f')]);_0x39faab[_0x694e('0x1e')]=qs[_0x694e('0x1e')](_0x3860ce['query'][_0x694e('0x1e')]);}return _0x48cc11[_0x694e('0x62')](_0x39faab);}})[_0x694e('0x26')](function(_0x433916){if(_0x433916){return _0x433916?{'count':_0x2dcc27,'rows':_0x433916}:null;}})['then'](respondWithResult(_0x33e369,null))['catch'](handleError(_0x33e369,null));};exports[_0x694e('0x64')]=function(_0x34ee4c,_0x177b82,_0xcba0c5){var _0x4b057f=_0x34ee4c[_0x694e('0x4a')][_0x694e('0x65')];return db['Team'][_0x694e('0x59')]({'where':{'id':_0x4b057f},'attributes':['id'],'include':[{'model':db[_0x694e('0x5a')],'as':_0x694e('0x66'),'attributes':['id',_0x694e('0x2c'),'online','voicePause',_0x694e('0x67')],'raw':!![]}]})[_0x694e('0x26')](function(_0x53f2f8){if(_0x53f2f8){var _0x4bd7f9=_[_0x694e('0x68')](_0x53f2f8,function(_0x4be9bf){var _0x2ba3c0=_0x4be9bf[_0x694e('0x28')]({'plain':!![]});return _0x2ba3c0[_0x694e('0x66')];});return db[_0x694e('0x40')][_0x694e('0x48')]({'where':{'id':_0x34ee4c[_0x694e('0x45')]['id']}})[_0x694e('0x26')](function(_0x150f81){return db[_0x694e('0x69')][_0x694e('0x6a')](function(_0x593834){return _0x150f81['addTeams'](_0x4b057f,{'transaction':_0x593834})[_0x694e('0x26')](function(){return BPromise[_0x694e('0x6b')](_0x4bd7f9,function(_0x57bca2){return db[_0x694e('0x55')][_0x694e('0x6c')]({'where':{'UserId':_0x57bca2['id'],'FaxQueueId':_0x34ee4c['params']['id']},'transaction':_0x593834});});})[_0x694e('0x26')](function(){_0x4bd7f9['forEach'](function(_0x1486bf){socket[_0x694e('0x6d')](_0x694e('0x6e'),{'UserId':_0x1486bf['id'],'FaxQueueId':_0x150f81['id']});});});});});}})[_0x694e('0x26')](respondWithStatusCode(_0x177b82,null))['catch'](handleError(_0x177b82,null));};exports[_0x694e('0x6f')]=function(_0xb1967,_0x32a9ab,_0x183e52){return db[_0x694e('0x63')][_0x694e('0x59')]({'where':{'id':_0xb1967[_0x694e('0x33')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x32a9ab,null))[_0x694e('0x26')](function(_0x2211d8){var _0x5a5bc8=_[_0x694e('0x2e')](_0x2211d8,'id');var _0x40445a=[];var _0x2dc2e6=[];var _0x441225=squel['select']();_0x441225[_0x694e('0x70')](_0x694e('0x71'))[_0x694e('0x72')]('team_has_fax_queues','tq')[_0x694e('0x73')](_0x694e('0x74'),'ut',_0x694e('0x75'))[_0x694e('0x3b')](_0x694e('0x76'),_0xb1967[_0x694e('0x45')]['id']);for(var _0xe0907e=0x0;_0xe0907e<_0x2211d8[_0x694e('0x38')];_0xe0907e+=0x1){let _0x37740c=_0x2211d8[_0xe0907e];for(var _0x201ade=0x0;_0x201ade<_0x37740c['Agents'][_0x694e('0x38')];_0x201ade+=0x1){let _0x6c82ba=_0x37740c[_0x694e('0x66')][_0x201ade];var _0x153a37=_0x441225[_0x694e('0x77')]();_0x153a37[_0x694e('0x3b')](_0x694e('0x78'),_0x6c82ba['id']);_0x2dc2e6[_0x694e('0x79')](db[_0x694e('0x69')]['query'](_0x153a37[_0x694e('0x7a')](),{'type':db[_0x694e('0x69')][_0x694e('0x7b')][_0x694e('0x7c')]})[_0x694e('0x26')](function(_0x31d7bd){if(_0x31d7bd[_0x694e('0x38')]===0x1){return _0x6c82ba['id'];}else{var _0x54bff3=_[_0x694e('0x7d')](_[_0x694e('0x2e')](_0x31d7bd,_0x694e('0x7e')),function(_0x1664d1){return _[_0x694e('0x7f')](_0x5a5bc8,_0x1664d1);});if(_0x54bff3){return _0x6c82ba['id'];}}}));}}return BPromise['all'](_0x2dc2e6)[_0x694e('0x26')](function(_0x5ddad0){_0x40445a=_(_0x40445a)[_0x694e('0x80')](_0x5ddad0)['compact']()[_0x694e('0x81')]();return db[_0x694e('0x40')]['find']({'where':{'id':_0xb1967[_0x694e('0x45')]['id']}})[_0x694e('0x26')](function(_0x59dc4f){return db[_0x694e('0x69')]['transaction'](function(_0x2e8b0c){return _0x59dc4f[_0x694e('0x6f')](_0xb1967['query'][_0x694e('0x65')],{'transaction':_0x2e8b0c})[_0x694e('0x26')](function(){if(!_[_0x694e('0x82')](_0x40445a)){return _0x59dc4f[_0x694e('0x83')](_0x40445a,{'transaction':_0x2e8b0c});}})[_0x694e('0x26')](function(){_0x40445a[_0x694e('0x84')](function(_0x2beed6){socket[_0x694e('0x6d')]('userFaxQueue:remove',{'UserId':_0x2beed6,'FaxQueueId':_0x59dc4f['id']});});});});});});})[_0x694e('0x26')](respondWithStatusCode(_0x32a9ab,null))[_0x694e('0x43')](handleError(_0x32a9ab,null));};exports[_0x694e('0x85')]=function(_0x38a612,_0x4ad6eb,_0x583314){return db['FaxQueue'][_0x694e('0x48')]({'where':{'id':_0x38a612['params']['id']}})[_0x694e('0x26')](handleEntityNotFound(_0x4ad6eb,null))[_0x694e('0x26')](function(_0xf62807){if(_0xf62807){return _0xf62807[_0x694e('0x85')](_0x38a612[_0x694e('0x4a')]['ids'],_[_0x694e('0x86')](_0x38a612['body'],[_0x694e('0x65'),'id'])||{})[_0x694e('0x87')](function(_0x358522){for(var _0x4fb674=0x0;_0x4fb674<_0x38a612[_0x694e('0x4a')]['ids'][_0x694e('0x38')];_0x4fb674+=0x1){socket[_0x694e('0x6d')](_0x694e('0x6e'),{'UserId':_0x38a612[_0x694e('0x4a')][_0x694e('0x65')][_0x4fb674],'FaxQueueId':_0x38a612[_0x694e('0x45')]['id']});}return _0x358522;});}})[_0x694e('0x26')](respondWithResult(_0x4ad6eb,null))[_0x694e('0x43')](handleError(_0x4ad6eb,null));};exports[_0x694e('0x83')]=function(_0x569495,_0x10ebab,_0x49070c){return db['FaxQueue'][_0x694e('0x48')]({'where':{'id':_0x569495[_0x694e('0x45')]['id']}})['then'](handleEntityNotFound(_0x10ebab,null))['then'](function(_0x543477){if(_0x543477){return _0x543477['removeAgents'](_0x569495[_0x694e('0x33')][_0x694e('0x65')])[_0x694e('0x26')](function(){if(_[_0x694e('0x88')](_0x569495[_0x694e('0x33')][_0x694e('0x65')])){for(var _0x347c1a=0x0;_0x347c1a<_0x569495['query'][_0x694e('0x65')][_0x694e('0x38')];_0x347c1a+=0x1){socket[_0x694e('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0x569495[_0x694e('0x33')][_0x694e('0x65')][_0x347c1a]),'FaxQueueId':Number(_0x569495[_0x694e('0x45')]['id'])});}}else{socket['emit'](_0x694e('0x89'),{'UserId':Number(_0x569495[_0x694e('0x33')][_0x694e('0x65')]),'FaxQueueId':Number(_0x569495['params']['id'])});}});}})[_0x694e('0x26')](respondWithStatusCode(_0x10ebab,null))[_0x694e('0x43')](handleError(_0x10ebab,null));};exports[_0x694e('0x8a')]=function(_0x14fefb,_0x656be2,_0x39c0ac){var _0x51c4e9={};var _0x1d6ada={};var _0x16a38a;var _0x29cdd9;return db[_0x694e('0x40')][_0x694e('0x54')]({'where':{'id':_0x14fefb['params']['id']}})[_0x694e('0x26')](handleEntityNotFound(_0x656be2,null))[_0x694e('0x26')](function(_0x256898){if(_0x256898){_0x16a38a=_0x256898;_0x1d6ada[_0x694e('0x32')]=_[_0x694e('0x46')](db['User'][_0x694e('0x2f')]);_0x1d6ada[_0x694e('0x33')]=_[_0x694e('0x46')](_0x14fefb['query']);_0x1d6ada[_0x694e('0x34')]=_[_0x694e('0x35')](_0x1d6ada[_0x694e('0x32')],_0x1d6ada['query']);_0x51c4e9['attributes']=_[_0x694e('0x35')](_0x1d6ada[_0x694e('0x32')],qs['fields'](_0x14fefb[_0x694e('0x33')][_0x694e('0x37')]));_0x51c4e9[_0x694e('0x36')]=_0x51c4e9[_0x694e('0x36')][_0x694e('0x38')]?_0x51c4e9[_0x694e('0x36')]:_0x1d6ada['model'];_0x51c4e9[_0x694e('0x57')]=qs[_0x694e('0x3a')](_0x14fefb['query'][_0x694e('0x3a')]);_0x51c4e9[_0x694e('0x3b')]=qs[_0x694e('0x34')](_[_0x694e('0x3c')](_0x14fefb[_0x694e('0x33')],_0x1d6ada['filters']));if(_0x14fefb[_0x694e('0x33')]['filter']){_0x51c4e9[_0x694e('0x3b')]=_[_0x694e('0x3e')](_0x51c4e9[_0x694e('0x3b')],{'$or':_[_0x694e('0x2e')](_0x51c4e9[_0x694e('0x36')],function(_0x582aaa){var _0xd036aa={};_0xd036aa[_0x582aaa]={'$like':'%'+_0x14fefb[_0x694e('0x33')][_0x694e('0x3d')]+'%'};return _0xd036aa;})});}_0x51c4e9=_[_0x694e('0x3e')]({},_0x51c4e9,_0x14fefb[_0x694e('0x3f')]);return _0x16a38a['getAgents'](_0x51c4e9);}})[_0x694e('0x26')](function(_0x5b096a){if(_0x5b096a){_0x29cdd9=_0x5b096a[_0x694e('0x38')];if(!_0x14fefb['query'][_0x694e('0x56')](_0x694e('0x39'))){_0x51c4e9[_0x694e('0x1f')]=qs[_0x694e('0x1f')](_0x14fefb['query'][_0x694e('0x1f')]);_0x51c4e9[_0x694e('0x1e')]=qs[_0x694e('0x1e')](_0x14fefb[_0x694e('0x33')]['offset']);}return _0x16a38a[_0x694e('0x8a')](_0x51c4e9);}})[_0x694e('0x26')](function(_0x416948){if(_0x416948){return _0x416948?{'count':_0x29cdd9,'rows':_0x416948}:null;}})[_0x694e('0x26')](respondWithResult(_0x656be2,null))[_0x694e('0x43')](handleError(_0x656be2,null));};
\ No newline at end of file
+var _0x83cd=['register','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','FaxQueue','rawAttributes','type','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','nolimit','FaxQueueId','User','findAndCountAll','faxPause','updatedAt','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','Team','select','tq.TeamId','from','team_has_fax_queues','join','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','socket.io-emitter','./faxQueue.socket'];(function(_0x95aa0b,_0x45782d){var _0x363e8e=function(_0x16a76c){while(--_0x16a76c){_0x95aa0b['push'](_0x95aa0b['shift']());}};_0x363e8e(++_0x45782d);}(_0x83cd,0x17b));var _0xd83c=function(_0x59a7b3,_0x3ed547){_0x59a7b3=_0x59a7b3-0x0;var _0x581c87=_0x83cd[_0x59a7b3];return _0x581c87;};'use strict';var pdf=require(_0xd83c('0x0'));var emlformat=require(_0xd83c('0x1'));var rimraf=require(_0xd83c('0x2'));var zipdir=require(_0xd83c('0x3'));var jsonpatch=require(_0xd83c('0x4'));var rp=require('request-promise');var moment=require(_0xd83c('0x5'));var BPromise=require(_0xd83c('0x6'));var Mustache=require(_0xd83c('0x7'));var util=require(_0xd83c('0x8'));var path=require('path');var sox=require(_0xd83c('0x9'));var csv=require(_0xd83c('0xa'));var ejs=require(_0xd83c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd83c('0xc'));var crypto=require('crypto');var jsforce=require(_0xd83c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd83c('0xa'));var querystring=require('querystring');var Papa=require(_0xd83c('0xe'));var Redis=require(_0xd83c('0xf'));var authService=require(_0xd83c('0x10'));var qs=require(_0xd83c('0x11'));var as=require(_0xd83c('0x12'));var hardwareService=require(_0xd83c('0x13'));var logger=require(_0xd83c('0x14'))('api');var utils=require(_0xd83c('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd83c('0x16')]=_[_0xd83c('0x17')](config[_0xd83c('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xd83c('0x18'))(new Redis(config[_0xd83c('0x16')]));require(_0xd83c('0x19'))[_0xd83c('0x1a')](socket);function respondWithStatusCode(_0x405078,_0x23099c){_0x23099c=_0x23099c||0xcc;return function(_0x1bbddd){if(_0x1bbddd){return _0x405078['sendStatus'](_0x23099c);}return _0x405078[_0xd83c('0x1b')](_0x23099c)['end']();};}function respondWithResult(_0x1271d4,_0x276b19){_0x276b19=_0x276b19||0xc8;return function(_0x381d35){if(_0x381d35){return _0x1271d4[_0xd83c('0x1b')](_0x276b19)['json'](_0x381d35);}};}function respondWithFilteredResult(_0x1088e9,_0x5eef2f){return function(_0x58b3b1){if(_0x58b3b1){var _0xbd63d9=_0x58b3b1[_0xd83c('0x1c')],_0x292b6a=_0x5eef2f[_0xd83c('0x1d')],_0x1bf410=_0x5eef2f[_0xd83c('0x1d')]+_0x5eef2f[_0xd83c('0x1e')],_0x214f27;if(_0x1bf410>=_0xbd63d9){_0x1bf410=_0xbd63d9;_0x214f27=0xc8;}else{_0x214f27=0xce;}_0x1088e9[_0xd83c('0x1b')](_0x214f27);return _0x1088e9[_0xd83c('0x1f')](_0xd83c('0x20'),_0x292b6a+'-'+_0x1bf410+'/'+_0xbd63d9)[_0xd83c('0x21')](_0x58b3b1);}return null;};}function patchUpdates(_0x24452f){return function(_0x5d4da4){try{jsonpatch[_0xd83c('0x22')](_0x5d4da4,_0x24452f,!![]);}catch(_0x379cbf){return BPromise[_0xd83c('0x23')](_0x379cbf);}return _0x5d4da4[_0xd83c('0x24')]();};}function saveUpdates(_0x3ee772,_0x1b7d89){return function(_0x15ef09){if(_0x15ef09){return _0x15ef09[_0xd83c('0x25')](_0x3ee772)[_0xd83c('0x26')](function(_0x312f2c){return _0x312f2c;});}return null;};}function removeEntity(_0x35142f,_0xeafa7e){return function(_0x328aea){if(_0x328aea){return _0x328aea[_0xd83c('0x27')]()[_0xd83c('0x26')](function(){var _0x112508=_0x328aea['get']({'plain':!![]});var _0x42e593='FaxQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x42e593,'resourceId':_0x112508['id']}})[_0xd83c('0x26')](function(){return _0x328aea;});})['then'](function(){_0x35142f[_0xd83c('0x1b')](0xcc)[_0xd83c('0x28')]();});}};}function handleEntityNotFound(_0x539a6a,_0x142e8f){return function(_0x417938){if(!_0x417938){_0x539a6a[_0xd83c('0x29')](0x194);}return _0x417938;};}function handleError(_0x56c281,_0x1e3f30){_0x1e3f30=_0x1e3f30||0x1f4;return function(_0x17261d){logger[_0xd83c('0x2a')](_0x17261d['stack']);if(_0x17261d[_0xd83c('0x2b')]){delete _0x17261d[_0xd83c('0x2b')];}_0x56c281[_0xd83c('0x1b')](_0x1e3f30)['send'](_0x17261d);};}exports[_0xd83c('0x2c')]=function(_0x25493e,_0x2130a6){var _0xe04b9a={},_0x35bdec={},_0x1fd8c1={'count':0x0,'rows':[]};var _0x1e62ea=_['map'](db[_0xd83c('0x2d')][_0xd83c('0x2e')],function(_0x173201){return{'name':_0x173201['fieldName'],'type':_0x173201[_0xd83c('0x2f')]['key']};});_0x35bdec['model']=_[_0xd83c('0x30')](_0x1e62ea,_0xd83c('0x2b'));_0x35bdec[_0xd83c('0x31')]=_[_0xd83c('0x32')](_0x25493e[_0xd83c('0x31')]);_0x35bdec[_0xd83c('0x33')]=_[_0xd83c('0x34')](_0x35bdec[_0xd83c('0x35')],_0x35bdec[_0xd83c('0x31')]);_0xe04b9a[_0xd83c('0x36')]=_[_0xd83c('0x34')](_0x35bdec['model'],qs['fields'](_0x25493e['query'][_0xd83c('0x37')]));_0xe04b9a['attributes']=_0xe04b9a[_0xd83c('0x36')][_0xd83c('0x38')]?_0xe04b9a['attributes']:_0x35bdec[_0xd83c('0x35')];if(!_0x25493e[_0xd83c('0x31')]['hasOwnProperty']('nolimit')){_0xe04b9a[_0xd83c('0x1e')]=qs[_0xd83c('0x1e')](_0x25493e['query']['limit']);_0xe04b9a['offset']=qs[_0xd83c('0x1d')](_0x25493e[_0xd83c('0x31')][_0xd83c('0x1d')]);}_0xe04b9a[_0xd83c('0x39')]=qs[_0xd83c('0x3a')](_0x25493e[_0xd83c('0x31')][_0xd83c('0x3a')]);_0xe04b9a['where']=qs['filters'](_[_0xd83c('0x3b')](_0x25493e[_0xd83c('0x31')],_0x35bdec['filters']),_0x1e62ea);if(_0x25493e['query'][_0xd83c('0x3c')]){_0xe04b9a[_0xd83c('0x3d')]=_[_0xd83c('0x3e')](_0xe04b9a[_0xd83c('0x3d')],{'$or':_[_0xd83c('0x30')](_0x1e62ea,function(_0x19113e){if(_0x19113e[_0xd83c('0x2f')]!==_0xd83c('0x3f')){var _0x107877={};_0x107877[_0x19113e['name']]={'$like':'%'+_0x25493e[_0xd83c('0x31')][_0xd83c('0x3c')]+'%'};return _0x107877;}})});}_0xe04b9a=_[_0xd83c('0x3e')]({},_0xe04b9a,_0x25493e['options']);var _0x21eba5={'where':_0xe04b9a[_0xd83c('0x3d')]};return db['FaxQueue'][_0xd83c('0x1c')](_0x21eba5)[_0xd83c('0x26')](function(_0x3ecce6){_0x1fd8c1['count']=_0x3ecce6;if(_0x25493e[_0xd83c('0x31')][_0xd83c('0x40')]){_0xe04b9a[_0xd83c('0x41')]=[{'all':!![]}];}return db['FaxQueue'][_0xd83c('0x42')](_0xe04b9a);})[_0xd83c('0x26')](function(_0x11521b){_0x1fd8c1[_0xd83c('0x43')]=_0x11521b;return _0x1fd8c1;})[_0xd83c('0x26')](respondWithFilteredResult(_0x2130a6,_0xe04b9a))[_0xd83c('0x44')](handleError(_0x2130a6,null));};exports[_0xd83c('0x45')]=function(_0x3eb29a,_0x1d6f93){var _0x5ece5d={'raw':!![],'where':{'id':_0x3eb29a[_0xd83c('0x46')]['id']}},_0x2daa83={};_0x2daa83['model']=_[_0xd83c('0x32')](db[_0xd83c('0x2d')][_0xd83c('0x2e')]);_0x2daa83[_0xd83c('0x31')]=_['keys'](_0x3eb29a[_0xd83c('0x31')]);_0x2daa83[_0xd83c('0x33')]=_[_0xd83c('0x34')](_0x2daa83[_0xd83c('0x35')],_0x2daa83[_0xd83c('0x31')]);_0x5ece5d[_0xd83c('0x36')]=_[_0xd83c('0x34')](_0x2daa83['model'],qs['fields'](_0x3eb29a[_0xd83c('0x31')][_0xd83c('0x37')]));_0x5ece5d[_0xd83c('0x36')]=_0x5ece5d[_0xd83c('0x36')][_0xd83c('0x38')]?_0x5ece5d[_0xd83c('0x36')]:_0x2daa83[_0xd83c('0x35')];if(_0x3eb29a[_0xd83c('0x31')][_0xd83c('0x40')]){_0x5ece5d['include']=[{'all':!![]}];}_0x5ece5d=_[_0xd83c('0x3e')]({},_0x5ece5d,_0x3eb29a[_0xd83c('0x47')]);return db[_0xd83c('0x2d')][_0xd83c('0x48')](_0x5ece5d)[_0xd83c('0x26')](handleEntityNotFound(_0x1d6f93,null))['then'](respondWithResult(_0x1d6f93,null))[_0xd83c('0x44')](handleError(_0x1d6f93,null));};exports[_0xd83c('0x49')]=function(_0x18e2bc,_0xbec930){return db['FaxQueue']['create'](_0x18e2bc[_0xd83c('0x4a')],{})['then'](function(_0xf6ee83){var _0x4bf438=_0x18e2bc[_0xd83c('0x4b')][_0xd83c('0x4c')]({'plain':!![]});if(!_0x4bf438)throw new Error(_0xd83c('0x4d'));if(_0x4bf438['role']===_0xd83c('0x4b')){var _0xbc7eb3=_0xf6ee83['get']({'plain':!![]});var _0x10be61=_0xd83c('0x4e');return db['UserProfileSection'][_0xd83c('0x48')]({'where':{'name':_0x10be61,'userProfileId':_0x4bf438[_0xd83c('0x4f')]},'raw':!![]})[_0xd83c('0x26')](function(_0x53992c){if(_0x53992c&&_0x53992c[_0xd83c('0x50')]===0x0){return db[_0xd83c('0x51')]['create']({'name':_0xbc7eb3[_0xd83c('0x2b')],'resourceId':_0xbc7eb3['id'],'type':_0x53992c['name'],'sectionId':_0x53992c['id']},{})['then'](function(){return _0xf6ee83;});}else{return _0xf6ee83;}})['catch'](function(_0x3cc7ad){logger[_0xd83c('0x2a')](_0xd83c('0x52'),_0x3cc7ad);throw _0x3cc7ad;});}return _0xf6ee83;})[_0xd83c('0x26')](respondWithResult(_0xbec930,0xc9))[_0xd83c('0x44')](handleError(_0xbec930,null));};exports['update']=function(_0x1749ed,_0x29bf30){if(_0x1749ed[_0xd83c('0x4a')]['id']){delete _0x1749ed[_0xd83c('0x4a')]['id'];}return db[_0xd83c('0x2d')][_0xd83c('0x48')]({'where':{'id':_0x1749ed[_0xd83c('0x46')]['id']}})[_0xd83c('0x26')](handleEntityNotFound(_0x29bf30,null))['then'](saveUpdates(_0x1749ed['body'],null))[_0xd83c('0x26')](respondWithResult(_0x29bf30,null))['catch'](handleError(_0x29bf30,null));};exports[_0xd83c('0x27')]=function(_0xc2c059,_0x38dcd4){return db[_0xd83c('0x2d')][_0xd83c('0x48')]({'where':{'id':_0xc2c059[_0xd83c('0x46')]['id']}})[_0xd83c('0x26')](handleEntityNotFound(_0x38dcd4,null))['then'](removeEntity(_0x38dcd4,null))['catch'](handleError(_0x38dcd4,null));};exports[_0xd83c('0x53')]=function(_0x5f455e,_0x183203){return db[_0xd83c('0x2d')]['describe']()[_0xd83c('0x26')](respondWithResult(_0x183203,null))[_0xd83c('0x44')](handleError(_0x183203,null));};exports[_0xd83c('0x54')]=function(_0x4ffc45,_0x3d4a4d,_0x135b33){var _0x1830d6={'raw':!![],'where':{}},_0x6f72f8={},_0x53683b;return db['FaxQueue'][_0xd83c('0x55')]({'where':{'id':_0x4ffc45[_0xd83c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d4a4d,null))[_0xd83c('0x26')](function(_0xd54b86){if(_0xd54b86){_0x53683b=_0xd54b86[_0xd83c('0x4c')]({'plain':!![]});_0x6f72f8['model']=_[_0xd83c('0x32')](db[_0xd83c('0x56')][_0xd83c('0x2e')]);_0x6f72f8[_0xd83c('0x31')]=_[_0xd83c('0x32')](_0x4ffc45[_0xd83c('0x31')]);_0x6f72f8[_0xd83c('0x33')]=_[_0xd83c('0x34')](_0x6f72f8[_0xd83c('0x35')],_0x6f72f8['query']);_0x1830d6[_0xd83c('0x36')]=_[_0xd83c('0x34')](_0x6f72f8[_0xd83c('0x35')],qs['fields'](_0x4ffc45['query']['fields']));_0x1830d6[_0xd83c('0x36')]=_0x1830d6[_0xd83c('0x36')]['length']?_0x1830d6['attributes']:_0x6f72f8['model'];if(!_0x4ffc45[_0xd83c('0x31')]['hasOwnProperty'](_0xd83c('0x57'))){_0x1830d6['limit']=qs['limit'](_0x4ffc45[_0xd83c('0x31')][_0xd83c('0x1e')]);_0x1830d6['offset']=qs[_0xd83c('0x1d')](_0x4ffc45[_0xd83c('0x31')][_0xd83c('0x1d')]);}_0x1830d6[_0xd83c('0x39')]=qs['sort'](_0x4ffc45[_0xd83c('0x31')][_0xd83c('0x3a')]);_0x1830d6[_0xd83c('0x3d')]=qs[_0xd83c('0x33')](_['pick'](_0x4ffc45['query'],_0x6f72f8[_0xd83c('0x33')]));_0x1830d6['where'][_0xd83c('0x58')]=_0xd54b86['id'];if(_0x4ffc45[_0xd83c('0x31')][_0xd83c('0x3c')]){_0x1830d6[_0xd83c('0x3d')]=_[_0xd83c('0x3e')](_0x1830d6[_0xd83c('0x3d')],{'$or':_[_0xd83c('0x30')](_0x1830d6[_0xd83c('0x36')],function(_0x5138be){var _0x1963c7={};_0x1963c7[_0x5138be]={'$like':'%'+_0x4ffc45[_0xd83c('0x31')][_0xd83c('0x3c')]+'%'};return _0x1963c7;})});}_0x1830d6=_[_0xd83c('0x3e')]({},_0x1830d6,_0x4ffc45[_0xd83c('0x47')]);return db['UserFaxQueue'][_0xd83c('0x42')](_0x1830d6);}})[_0xd83c('0x26')](function(_0x403c75){if(_0x403c75){return db[_0xd83c('0x59')][_0xd83c('0x5a')]({'where':{'id':_[_0xd83c('0x30')](_0x403c75,'UserId'),'role':'agent'},'attributes':['id','name',_0xd83c('0x5b'),_0xd83c('0x5c'),'createdAt']});}})[_0xd83c('0x26')](function(_0x21ed0c){if(_0x21ed0c){return{'count':_0x21ed0c[_0xd83c('0x1c')],'rows':_['map'](_0x21ed0c[_0xd83c('0x43')],function(_0x424acc){return{'membername':_0x424acc[_0xd83c('0x2b')],'UserId':_0x424acc['id'],'queue_name':_0x53683b[_0xd83c('0x2b')],'FaxQueueId':_0x53683b['id'],'interface':util['format'](_0xd83c('0x5d'),_0xd83c('0x5e'),_0x424acc[_0xd83c('0x2b')]),'penalty':0x0,'paused':_0x424acc['faxPause'],'createdAt':_0x424acc[_0xd83c('0x5f')],'updatedAt':_0x424acc[_0xd83c('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd83c('0x26')](respondWithFilteredResult(_0x3d4a4d,_0x1830d6))[_0xd83c('0x44')](handleError(_0x3d4a4d,null));};exports[_0xd83c('0x60')]=function(_0x3df1e5,_0x21a5b8,_0x1a6fe7){var _0x509dd1={};var _0x128e41={};var _0x37d7c9;var _0xaca159;return db['FaxQueue'][_0xd83c('0x55')]({'where':{'id':_0x3df1e5['params']['id']}})[_0xd83c('0x26')](handleEntityNotFound(_0x21a5b8,null))[_0xd83c('0x26')](function(_0x119dd8){if(_0x119dd8){_0x37d7c9=_0x119dd8;_0x128e41['model']=_[_0xd83c('0x32')](db['Team']['rawAttributes']);_0x128e41[_0xd83c('0x31')]=_[_0xd83c('0x32')](_0x3df1e5[_0xd83c('0x31')]);_0x128e41[_0xd83c('0x33')]=_[_0xd83c('0x34')](_0x128e41[_0xd83c('0x35')],_0x128e41[_0xd83c('0x31')]);_0x509dd1['attributes']=_[_0xd83c('0x34')](_0x128e41['model'],qs['fields'](_0x3df1e5[_0xd83c('0x31')]['fields']));_0x509dd1[_0xd83c('0x36')]=_0x509dd1[_0xd83c('0x36')][_0xd83c('0x38')]?_0x509dd1['attributes']:_0x128e41[_0xd83c('0x35')];_0x509dd1[_0xd83c('0x39')]=qs['sort'](_0x3df1e5[_0xd83c('0x31')][_0xd83c('0x3a')]);_0x509dd1[_0xd83c('0x3d')]=qs[_0xd83c('0x33')](_[_0xd83c('0x3b')](_0x3df1e5[_0xd83c('0x31')],_0x128e41[_0xd83c('0x33')]));if(_0x3df1e5[_0xd83c('0x31')][_0xd83c('0x3c')]){_0x509dd1[_0xd83c('0x3d')]=_[_0xd83c('0x3e')](_0x509dd1[_0xd83c('0x3d')],{'$or':_[_0xd83c('0x30')](_0x509dd1[_0xd83c('0x36')],function(_0x4a808a){var _0xb7f8d6={};_0xb7f8d6[_0x4a808a]={'$like':'%'+_0x3df1e5['query'][_0xd83c('0x3c')]+'%'};return _0xb7f8d6;})});}_0x509dd1=_[_0xd83c('0x3e')]({},_0x509dd1,_0x3df1e5[_0xd83c('0x47')]);return _0x37d7c9[_0xd83c('0x60')](_0x509dd1);}})['then'](function(_0x414ffe){if(_0x414ffe){_0xaca159=_0x414ffe['length'];if(!_0x3df1e5['query']['hasOwnProperty'](_0xd83c('0x57'))){_0x509dd1[_0xd83c('0x1e')]=qs[_0xd83c('0x1e')](_0x3df1e5[_0xd83c('0x31')][_0xd83c('0x1e')]);_0x509dd1[_0xd83c('0x1d')]=qs[_0xd83c('0x1d')](_0x3df1e5[_0xd83c('0x31')]['offset']);}return _0x37d7c9['getTeams'](_0x509dd1);}})[_0xd83c('0x26')](function(_0x4e697b){if(_0x4e697b){return _0x4e697b?{'count':_0xaca159,'rows':_0x4e697b}:null;}})['then'](respondWithResult(_0x21a5b8,null))[_0xd83c('0x44')](handleError(_0x21a5b8,null));};exports[_0xd83c('0x61')]=function(_0x5c5532,_0x441132,_0x69dc89){var _0xc9fb63=_0x5c5532['body'][_0xd83c('0x62')];return db['Team'][_0xd83c('0x42')]({'where':{'id':_0xc9fb63},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd83c('0x63'),'attributes':['id',_0xd83c('0x2b'),_0xd83c('0x64'),_0xd83c('0x65'),_0xd83c('0x66')],'raw':!![]}]})[_0xd83c('0x26')](function(_0x3bc128){if(_0x3bc128){var _0x383ba7=_[_0xd83c('0x67')](_0x3bc128,function(_0x3205c2){var _0x2fb720=_0x3205c2['get']({'plain':!![]});return _0x2fb720['Agents'];});return db[_0xd83c('0x2d')][_0xd83c('0x48')]({'where':{'id':_0x5c5532[_0xd83c('0x46')]['id']}})[_0xd83c('0x26')](function(_0x452a1b){return db[_0xd83c('0x68')][_0xd83c('0x69')](function(_0x931ed7){return _0x452a1b[_0xd83c('0x61')](_0xc9fb63,{'transaction':_0x931ed7})[_0xd83c('0x26')](function(){return BPromise['each'](_0x383ba7,function(_0x1a16c1){return db['UserFaxQueue'][_0xd83c('0x6a')]({'where':{'UserId':_0x1a16c1['id'],'FaxQueueId':_0x5c5532[_0xd83c('0x46')]['id']},'transaction':_0x931ed7});});})[_0xd83c('0x26')](function(){_0x383ba7[_0xd83c('0x6b')](function(_0x2dd610){socket[_0xd83c('0x6c')](_0xd83c('0x6d'),{'UserId':_0x2dd610['id'],'FaxQueueId':_0x452a1b['id']});});});});});}})[_0xd83c('0x26')](respondWithStatusCode(_0x441132,null))[_0xd83c('0x44')](handleError(_0x441132,null));};exports['removeTeams']=function(_0x573802,_0x50823f,_0x3809bc){return db[_0xd83c('0x6e')][_0xd83c('0x42')]({'where':{'id':_0x573802[_0xd83c('0x31')][_0xd83c('0x62')]},'attributes':['id'],'include':[{'model':db[_0xd83c('0x59')],'as':_0xd83c('0x63'),'attributes':['id'],'raw':!![]}]})[_0xd83c('0x26')](handleEntityNotFound(_0x50823f,null))[_0xd83c('0x26')](function(_0x26c297){var _0x212be4=_[_0xd83c('0x30')](_0x26c297,'id');var _0x4791fd=[];var _0xd6f2e9=[];var _0x72d4c6=squel[_0xd83c('0x6f')]();_0x72d4c6['field'](_0xd83c('0x70'))[_0xd83c('0x71')](_0xd83c('0x72'),'tq')[_0xd83c('0x73')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd83c('0x3d')](_0xd83c('0x74'),_0x573802[_0xd83c('0x46')]['id']);for(var _0x475195=0x0;_0x475195<_0x26c297[_0xd83c('0x38')];_0x475195+=0x1){let _0x1f996c=_0x26c297[_0x475195];for(var _0xd1f8c=0x0;_0xd1f8c<_0x1f996c['Agents'][_0xd83c('0x38')];_0xd1f8c+=0x1){let _0x3988b5=_0x1f996c[_0xd83c('0x63')][_0xd1f8c];var _0x302c0f=_0x72d4c6['clone']();_0x302c0f[_0xd83c('0x3d')](_0xd83c('0x75'),_0x3988b5['id']);_0xd6f2e9[_0xd83c('0x76')](db[_0xd83c('0x68')][_0xd83c('0x31')](_0x302c0f['toString'](),{'type':db[_0xd83c('0x68')]['QueryTypes'][_0xd83c('0x77')]})['then'](function(_0x3c8501){if(_0x3c8501[_0xd83c('0x38')]===0x1){return _0x3988b5['id'];}else{var _0x14dcd0=_['every'](_[_0xd83c('0x30')](_0x3c8501,_0xd83c('0x78')),function(_0x1f46ee){return _[_0xd83c('0x79')](_0x212be4,_0x1f46ee);});if(_0x14dcd0){return _0x3988b5['id'];}}}));}}return BPromise[_0xd83c('0x7a')](_0xd6f2e9)['then'](function(_0x34e96a){_0x4791fd=_(_0x4791fd)[_0xd83c('0x7b')](_0x34e96a)[_0xd83c('0x7c')]()['value']();return db['FaxQueue'][_0xd83c('0x48')]({'where':{'id':_0x573802['params']['id']}})[_0xd83c('0x26')](function(_0x5471d0){return db['sequelize'][_0xd83c('0x69')](function(_0x390961){return _0x5471d0[_0xd83c('0x7d')](_0x573802[_0xd83c('0x31')]['ids'],{'transaction':_0x390961})[_0xd83c('0x26')](function(){if(!_[_0xd83c('0x7e')](_0x4791fd)){return _0x5471d0[_0xd83c('0x7f')](_0x4791fd,{'transaction':_0x390961});}})[_0xd83c('0x26')](function(){_0x4791fd['forEach'](function(_0x2bc632){socket[_0xd83c('0x6c')](_0xd83c('0x80'),{'UserId':_0x2bc632,'FaxQueueId':_0x5471d0['id']});});});});});});})[_0xd83c('0x26')](respondWithStatusCode(_0x50823f,null))['catch'](handleError(_0x50823f,null));};exports[_0xd83c('0x81')]=function(_0x2588e6,_0x5cf22a,_0x42dfbb){return db[_0xd83c('0x2d')][_0xd83c('0x48')]({'where':{'id':_0x2588e6[_0xd83c('0x46')]['id']}})[_0xd83c('0x26')](handleEntityNotFound(_0x5cf22a,null))[_0xd83c('0x26')](function(_0x4df7d4){if(_0x4df7d4){return _0x4df7d4[_0xd83c('0x81')](_0x2588e6[_0xd83c('0x4a')][_0xd83c('0x62')],_[_0xd83c('0x82')](_0x2588e6[_0xd83c('0x4a')],['ids','id'])||{})[_0xd83c('0x83')](function(_0x1e8068){for(var _0x2e5920=0x0;_0x2e5920<_0x2588e6[_0xd83c('0x4a')][_0xd83c('0x62')][_0xd83c('0x38')];_0x2e5920+=0x1){socket[_0xd83c('0x6c')](_0xd83c('0x6d'),{'UserId':_0x2588e6['body'][_0xd83c('0x62')][_0x2e5920],'FaxQueueId':_0x2588e6[_0xd83c('0x46')]['id']});}return _0x1e8068;});}})[_0xd83c('0x26')](respondWithResult(_0x5cf22a,null))[_0xd83c('0x44')](handleError(_0x5cf22a,null));};exports[_0xd83c('0x7f')]=function(_0x23e7ff,_0x3b4725,_0xa9a1bc){return db[_0xd83c('0x2d')][_0xd83c('0x48')]({'where':{'id':_0x23e7ff[_0xd83c('0x46')]['id']}})[_0xd83c('0x26')](handleEntityNotFound(_0x3b4725,null))[_0xd83c('0x26')](function(_0x3e7202){if(_0x3e7202){return _0x3e7202[_0xd83c('0x7f')](_0x23e7ff['query'][_0xd83c('0x62')])[_0xd83c('0x26')](function(){if(_[_0xd83c('0x84')](_0x23e7ff[_0xd83c('0x31')][_0xd83c('0x62')])){for(var _0x57931a=0x0;_0x57931a<_0x23e7ff['query']['ids'][_0xd83c('0x38')];_0x57931a+=0x1){socket[_0xd83c('0x6c')](_0xd83c('0x80'),{'UserId':Number(_0x23e7ff[_0xd83c('0x31')][_0xd83c('0x62')][_0x57931a]),'FaxQueueId':Number(_0x23e7ff[_0xd83c('0x46')]['id'])});}}else{socket['emit'](_0xd83c('0x80'),{'UserId':Number(_0x23e7ff[_0xd83c('0x31')]['ids']),'FaxQueueId':Number(_0x23e7ff[_0xd83c('0x46')]['id'])});}});}})[_0xd83c('0x26')](respondWithStatusCode(_0x3b4725,null))['catch'](handleError(_0x3b4725,null));};exports[_0xd83c('0x85')]=function(_0x41968f,_0x9c271e,_0x4ac677){var _0x1ff648={};var _0xed91eb={};var _0x45cf1c;var _0x11a526;return db[_0xd83c('0x2d')][_0xd83c('0x55')]({'where':{'id':_0x41968f['params']['id']}})[_0xd83c('0x26')](handleEntityNotFound(_0x9c271e,null))[_0xd83c('0x26')](function(_0x364e3a){if(_0x364e3a){_0x45cf1c=_0x364e3a;_0xed91eb[_0xd83c('0x35')]=_[_0xd83c('0x32')](db['User'][_0xd83c('0x2e')]);_0xed91eb[_0xd83c('0x31')]=_[_0xd83c('0x32')](_0x41968f['query']);_0xed91eb[_0xd83c('0x33')]=_[_0xd83c('0x34')](_0xed91eb[_0xd83c('0x35')],_0xed91eb[_0xd83c('0x31')]);_0x1ff648[_0xd83c('0x36')]=_[_0xd83c('0x34')](_0xed91eb[_0xd83c('0x35')],qs[_0xd83c('0x37')](_0x41968f[_0xd83c('0x31')]['fields']));_0x1ff648[_0xd83c('0x36')]=_0x1ff648[_0xd83c('0x36')]['length']?_0x1ff648[_0xd83c('0x36')]:_0xed91eb[_0xd83c('0x35')];_0x1ff648[_0xd83c('0x39')]=qs[_0xd83c('0x3a')](_0x41968f['query']['sort']);_0x1ff648[_0xd83c('0x3d')]=qs['filters'](_['pick'](_0x41968f[_0xd83c('0x31')],_0xed91eb[_0xd83c('0x33')]));if(_0x41968f['query'][_0xd83c('0x3c')]){_0x1ff648[_0xd83c('0x3d')]=_[_0xd83c('0x3e')](_0x1ff648[_0xd83c('0x3d')],{'$or':_[_0xd83c('0x30')](_0x1ff648['attributes'],function(_0x26fb66){var _0x7c6604={};_0x7c6604[_0x26fb66]={'$like':'%'+_0x41968f[_0xd83c('0x31')][_0xd83c('0x3c')]+'%'};return _0x7c6604;})});}_0x1ff648=_[_0xd83c('0x3e')]({},_0x1ff648,_0x41968f[_0xd83c('0x47')]);return _0x45cf1c['getAgents'](_0x1ff648);}})['then'](function(_0x444889){if(_0x444889){_0x11a526=_0x444889[_0xd83c('0x38')];if(!_0x41968f[_0xd83c('0x31')][_0xd83c('0x86')](_0xd83c('0x57'))){_0x1ff648[_0xd83c('0x1e')]=qs[_0xd83c('0x1e')](_0x41968f[_0xd83c('0x31')][_0xd83c('0x1e')]);_0x1ff648[_0xd83c('0x1d')]=qs['offset'](_0x41968f['query'][_0xd83c('0x1d')]);}return _0x45cf1c[_0xd83c('0x85')](_0x1ff648);}})[_0xd83c('0x26')](function(_0x5bd40e){if(_0x5bd40e){return _0x5bd40e?{'count':_0x11a526,'rows':_0x5bd40e}:null;}})[_0xd83c('0x26')](respondWithResult(_0x9c271e,null))[_0xd83c('0x44')](handleError(_0x9c271e,null));};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js
index 85ea584..9c72e55 100644
--- a/server/api/faxQueue/faxQueue.events.js
+++ b/server/api/faxQueue/faxQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4dd8=['hook','exports','events','save','update','remove','emit'];(function(_0x13b5d6,_0x1fd375){var _0x7d090f=function(_0x94c1d5){while(--_0x94c1d5){_0x13b5d6['push'](_0x13b5d6['shift']());}};_0x7d090f(++_0x1fd375);}(_0x4dd8,0xcd));var _0x84dd=function(_0x1a09b3,_0x392cb3){_0x1a09b3=_0x1a09b3-0x0;var _0x506cff=_0x4dd8[_0x1a09b3];return _0x506cff;};'use strict';var EventEmitter=require(_0x84dd('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84dd('0x1'),'afterUpdate':_0x84dd('0x2'),'afterDestroy':_0x84dd('0x3')};function emitEvent(_0x56497b){return function(_0xe734a0,_0x4fc7ad,_0x122437){FaxQueueEvents[_0x84dd('0x4')](_0x56497b+':'+_0xe734a0['id'],_0xe734a0);FaxQueueEvents[_0x84dd('0x4')](_0x56497b,_0xe734a0);_0x122437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x84dd('0x5')](e,emitEvent(event));}}module[_0x84dd('0x6')]=FaxQueueEvents;
\ No newline at end of file
+var _0x27ce=['hook','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3bf5e5,_0x49ec32){var _0x366733=function(_0xc800c4){while(--_0xc800c4){_0x3bf5e5['push'](_0x3bf5e5['shift']());}};_0x366733(++_0x49ec32);}(_0x27ce,0x1b1));var _0xe27c=function(_0x486d8c,_0x5e74aa){_0x486d8c=_0x486d8c-0x0;var _0xd83b68=_0x27ce[_0x486d8c];return _0xd83b68;};'use strict';var EventEmitter=require(_0xe27c('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe27c('0x1')](0x0);var events={'afterCreate':_0xe27c('0x2'),'afterUpdate':_0xe27c('0x3'),'afterDestroy':_0xe27c('0x4')};function emitEvent(_0x1c3125){return function(_0x4ad326,_0x4a7655,_0x5e0c0e){FaxQueueEvents[_0xe27c('0x5')](_0x1c3125+':'+_0x4ad326['id'],_0x4ad326);FaxQueueEvents['emit'](_0x1c3125,_0x4ad326);_0x5e0c0e(null);};}for(var e in events){if(events[_0xe27c('0x6')](e)){var event=events[e];FaxQueue[_0xe27c('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js
index 0fe0462..1d7a283 100644
--- a/server/api/faxQueue/faxQueue.model.js
+++ b/server/api/faxQueue/faxQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbdc=['request-promise','path','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','../../config/logger','api','moment','bluebird'];(function(_0xd00c2c,_0x1be383){var _0x44c046=function(_0x2a37ce){while(--_0x2a37ce){_0xd00c2c['push'](_0xd00c2c['shift']());}};_0x44c046(++_0x1be383);}(_0xcbdc,0x1e8));var _0xccbd=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xcbdc[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xccbd('0x0'))(_0xccbd('0x1'));var moment=require(_0xccbd('0x2'));var BPromise=require(_0xccbd('0x3'));var rp=require(_0xccbd('0x4'));var fs=require('fs');var path=require(_0xccbd('0x5'));var rimraf=require('rimraf');var config=require(_0xccbd('0x6'));var attributes=require(_0xccbd('0x7'));module[_0xccbd('0x8')]=function(_0x3c0212,_0x25d73a){return _0x3c0212[_0xccbd('0x9')](_0xccbd('0xa'),attributes,{'tableName':_0xccbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x81c1=['rimraf','../../config/environment','./faxQueue.attributes','define','fax_queues','lodash','api','request-promise','path'];(function(_0x205ac9,_0x27baae){var _0x533cfa=function(_0x3fb5b5){while(--_0x3fb5b5){_0x205ac9['push'](_0x205ac9['shift']());}};_0x533cfa(++_0x27baae);}(_0x81c1,0xdd));var _0x181c=function(_0x5344f8,_0x285eeb){_0x5344f8=_0x5344f8-0x0;var _0x43d64a=_0x81c1[_0x5344f8];return _0x43d64a;};'use strict';var _=require(_0x181c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x181c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x181c('0x2'));var fs=require('fs');var path=require(_0x181c('0x3'));var rimraf=require(_0x181c('0x4'));var config=require(_0x181c('0x5'));var attributes=require(_0x181c('0x6'));module['exports']=function(_0x47afb6,_0x311141){return _0x47afb6[_0x181c('0x7')]('FaxQueue',attributes,{'tableName':_0x181c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js
index c319937..28aac04 100644
--- a/server/api/faxQueue/faxQueue.rpc.js
+++ b/server/api/faxQueue/faxQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec27=['info','result','catch','FaxQueue','findAll','options','raw','attributes','limit','include','model','map','GetFaxQueue','ShowFaxQueue','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec27,0x1b4));var _0x7ec2=function(_0x58d188,_0xa06a1f){_0x58d188=_0x58d188-0x0;var _0x1fc4a6=_0xec27[_0x58d188];return _0x1fc4a6;};'use strict';var _=require(_0x7ec2('0x0'));var util=require(_0x7ec2('0x1'));var moment=require('moment');var BPromise=require(_0x7ec2('0x2'));var rs=require(_0x7ec2('0x3'));var fs=require('fs');var Redis=require(_0x7ec2('0x4'));var db=require(_0x7ec2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7ec2('0x6'))(_0x7ec2('0x7'));var config=require(_0x7ec2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7ec2('0x9')][_0x7ec2('0xa')]({'port':0x232a});config[_0x7ec2('0xb')]=_[_0x7ec2('0xc')](config[_0x7ec2('0xb')],{'host':_0x7ec2('0xd'),'port':0x18eb});var socket=require(_0x7ec2('0xe'))(new Redis(config[_0x7ec2('0xb')]));require(_0x7ec2('0xf'))[_0x7ec2('0x10')](socket);function respondWithRpcPromise(_0x438067,_0x50f949,_0x255e7a){return new BPromise(function(_0x172f55,_0x4b5b87){return client[_0x7ec2('0x11')](_0x438067,_0x255e7a)[_0x7ec2('0x12')](function(_0x549a0f){logger['info'](_0x7ec2('0x13'),_0x50f949,_0x7ec2('0x14'));logger[_0x7ec2('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x50f949,'request\x20sent',JSON[_0x7ec2('0x16')](_0x549a0f));if(_0x549a0f[_0x7ec2('0x17')]){if(_0x549a0f[_0x7ec2('0x17')][_0x7ec2('0x18')]===0x1f4){logger[_0x7ec2('0x17')](_0x7ec2('0x13'),_0x50f949,_0x549a0f[_0x7ec2('0x17')][_0x7ec2('0x19')]);return _0x4b5b87(_0x549a0f[_0x7ec2('0x17')][_0x7ec2('0x19')]);}logger[_0x7ec2('0x17')](_0x7ec2('0x13'),_0x50f949,_0x549a0f[_0x7ec2('0x17')][_0x7ec2('0x19')]);return _0x172f55(_0x549a0f[_0x7ec2('0x17')][_0x7ec2('0x19')]);}else{logger[_0x7ec2('0x1a')]('FaxQueue,\x20%s,\x20%s',_0x50f949,_0x7ec2('0x14'));_0x172f55(_0x549a0f[_0x7ec2('0x1b')][_0x7ec2('0x19')]);}})[_0x7ec2('0x1c')](function(_0x25dd71){logger['error'](_0x7ec2('0x13'),_0x50f949,_0x25dd71);_0x4b5b87(_0x25dd71);});});}exports['GetFaxQueue']=function(_0x33ea27){var _0xfa6d1a=this;return new Promise(function(_0x501349,_0x5be486){return db[_0x7ec2('0x1d')][_0x7ec2('0x1e')]({'raw':_0x33ea27['options']?_0x33ea27[_0x7ec2('0x1f')][_0x7ec2('0x20')]===undefined?!![]:![]:!![],'where':_0x33ea27[_0x7ec2('0x1f')]?_0x33ea27['options']['where']||null:null,'attributes':_0x33ea27[_0x7ec2('0x1f')]?_0x33ea27[_0x7ec2('0x1f')][_0x7ec2('0x21')]||null:null,'limit':_0x33ea27[_0x7ec2('0x1f')]?_0x33ea27[_0x7ec2('0x1f')][_0x7ec2('0x22')]||null:null,'include':_0x33ea27[_0x7ec2('0x1f')]?_0x33ea27[_0x7ec2('0x1f')][_0x7ec2('0x23')]?_['map'](_0x33ea27[_0x7ec2('0x1f')][_0x7ec2('0x23')],function(_0x8ccdd2){return{'model':db[_0x8ccdd2[_0x7ec2('0x24')]],'as':_0x8ccdd2['as'],'attributes':_0x8ccdd2['attributes'],'include':_0x8ccdd2[_0x7ec2('0x23')]?_[_0x7ec2('0x25')](_0x8ccdd2['include'],function(_0x1a26ab){return{'model':db[_0x1a26ab[_0x7ec2('0x24')]],'as':_0x1a26ab['as'],'attributes':_0x1a26ab[_0x7ec2('0x21')],'include':_0x1a26ab['include']?_[_0x7ec2('0x25')](_0x1a26ab['include'],function(_0x244434){return{'model':db[_0x244434[_0x7ec2('0x24')]],'as':_0x244434['as'],'attributes':_0x244434[_0x7ec2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7ec2('0x12')](function(_0x14bf5e){logger[_0x7ec2('0x1a')](_0x7ec2('0x26'),_0x33ea27);logger[_0x7ec2('0x15')](_0x7ec2('0x26'),_0x33ea27,JSON[_0x7ec2('0x16')](_0x14bf5e));_0x501349(_0x14bf5e);})[_0x7ec2('0x1c')](function(_0x38af37){logger[_0x7ec2('0x17')](_0x7ec2('0x26'),_0x38af37[_0x7ec2('0x19')],_0x33ea27);_0x5be486(_0xfa6d1a['error'](0x1f4,_0x38af37['message']));});});};exports[_0x7ec2('0x27')]=function(_0x227d34){var _0x4745ab=this;return new Promise(function(_0xfba3fe,_0x558d4a){return db[_0x7ec2('0x1d')][_0x7ec2('0x28')]({'raw':_0x227d34[_0x7ec2('0x1f')]?_0x227d34[_0x7ec2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x227d34[_0x7ec2('0x1f')]?_0x227d34[_0x7ec2('0x1f')][_0x7ec2('0x29')]||null:null,'attributes':_0x227d34[_0x7ec2('0x1f')]?_0x227d34[_0x7ec2('0x1f')][_0x7ec2('0x21')]||null:null,'include':_0x227d34[_0x7ec2('0x1f')]?_0x227d34[_0x7ec2('0x1f')][_0x7ec2('0x23')]?_[_0x7ec2('0x25')](_0x227d34['options'][_0x7ec2('0x23')],function(_0x5c186c){return{'model':db[_0x5c186c[_0x7ec2('0x24')]],'as':_0x5c186c['as'],'attributes':_0x5c186c[_0x7ec2('0x21')],'include':_0x5c186c[_0x7ec2('0x23')]?_['map'](_0x5c186c[_0x7ec2('0x23')],function(_0x33dec){return{'model':db[_0x33dec[_0x7ec2('0x24')]],'as':_0x33dec['as'],'attributes':_0x33dec['attributes'],'include':_0x33dec[_0x7ec2('0x23')]?_[_0x7ec2('0x25')](_0x33dec[_0x7ec2('0x23')],function(_0x7e9b44){return{'model':db[_0x7e9b44[_0x7ec2('0x24')]],'as':_0x7e9b44['as'],'attributes':_0x7e9b44['attributes']};}):[]};}):[]};}):[]:[]})[_0x7ec2('0x12')](function(_0x2727ec){logger[_0x7ec2('0x1a')](_0x7ec2('0x27'),_0x227d34);logger[_0x7ec2('0x15')](_0x7ec2('0x27'),_0x227d34,JSON[_0x7ec2('0x16')](_0x2727ec));_0xfba3fe(_0x2727ec);})['catch'](function(_0x56a5cf){logger[_0x7ec2('0x17')](_0x7ec2('0x27'),_0x56a5cf[_0x7ec2('0x19')],_0x227d34);_0x558d4a(_0x4745ab['error'](0x1f4,_0x56a5cf[_0x7ec2('0x19')]));});});};
\ No newline at end of file
+var _0xad15=['socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x30cd1b,_0x157bd5){var _0x1edd5a=function(_0x141db6){while(--_0x141db6){_0x30cd1b['push'](_0x30cd1b['shift']());}};_0x1edd5a(++_0x157bd5);}(_0xad15,0x1df));var _0x5ad1=function(_0x3a5648,_0x58054e){_0x3a5648=_0x3a5648-0x0;var _0x34126d=_0xad15[_0x3a5648];return _0x34126d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5ad1('0x0'));var BPromise=require(_0x5ad1('0x1'));var rs=require(_0x5ad1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ad1('0x3'))['db'];var utils=require(_0x5ad1('0x4'));var logger=require(_0x5ad1('0x5'))(_0x5ad1('0x6'));var config=require(_0x5ad1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ad1('0x8')][_0x5ad1('0x9')]({'port':0x232a});config[_0x5ad1('0xa')]=_[_0x5ad1('0xb')](config[_0x5ad1('0xa')],{'host':_0x5ad1('0xc'),'port':0x18eb});var socket=require(_0x5ad1('0xd'))(new Redis(config[_0x5ad1('0xa')]));require(_0x5ad1('0xe'))[_0x5ad1('0xf')](socket);function respondWithRpcPromise(_0x50b798,_0x3af60f,_0x489feb){return new BPromise(function(_0xa9bacb,_0x12d03e){return client['request'](_0x50b798,_0x489feb)[_0x5ad1('0x10')](function(_0x52bde8){logger[_0x5ad1('0x11')](_0x5ad1('0x12'),_0x3af60f,_0x5ad1('0x13'));logger[_0x5ad1('0x14')](_0x5ad1('0x15'),_0x3af60f,_0x5ad1('0x13'),JSON[_0x5ad1('0x16')](_0x52bde8));if(_0x52bde8['error']){if(_0x52bde8['error'][_0x5ad1('0x17')]===0x1f4){logger['error'](_0x5ad1('0x12'),_0x3af60f,_0x52bde8[_0x5ad1('0x18')][_0x5ad1('0x19')]);return _0x12d03e(_0x52bde8[_0x5ad1('0x18')]['message']);}logger['error'](_0x5ad1('0x12'),_0x3af60f,_0x52bde8[_0x5ad1('0x18')]['message']);return _0xa9bacb(_0x52bde8[_0x5ad1('0x18')][_0x5ad1('0x19')]);}else{logger['info'](_0x5ad1('0x12'),_0x3af60f,_0x5ad1('0x13'));_0xa9bacb(_0x52bde8[_0x5ad1('0x1a')][_0x5ad1('0x19')]);}})['catch'](function(_0xea14fe){logger[_0x5ad1('0x18')](_0x5ad1('0x12'),_0x3af60f,_0xea14fe);_0x12d03e(_0xea14fe);});});}exports[_0x5ad1('0x1b')]=function(_0x2e0de6){var _0x456d1d=this;return new Promise(function(_0x4fc645,_0x300885){return db[_0x5ad1('0x1c')][_0x5ad1('0x1d')]({'raw':_0x2e0de6[_0x5ad1('0x1e')]?_0x2e0de6['options'][_0x5ad1('0x1f')]===undefined?!![]:![]:!![],'where':_0x2e0de6[_0x5ad1('0x1e')]?_0x2e0de6[_0x5ad1('0x1e')][_0x5ad1('0x20')]||null:null,'attributes':_0x2e0de6[_0x5ad1('0x1e')]?_0x2e0de6['options'][_0x5ad1('0x21')]||null:null,'limit':_0x2e0de6[_0x5ad1('0x1e')]?_0x2e0de6[_0x5ad1('0x1e')][_0x5ad1('0x22')]||null:null,'include':_0x2e0de6[_0x5ad1('0x1e')]?_0x2e0de6[_0x5ad1('0x1e')][_0x5ad1('0x23')]?_[_0x5ad1('0x24')](_0x2e0de6['options'][_0x5ad1('0x23')],function(_0x4e59e0){return{'model':db[_0x4e59e0[_0x5ad1('0x25')]],'as':_0x4e59e0['as'],'attributes':_0x4e59e0['attributes'],'include':_0x4e59e0['include']?_['map'](_0x4e59e0['include'],function(_0x86f54d){return{'model':db[_0x86f54d[_0x5ad1('0x25')]],'as':_0x86f54d['as'],'attributes':_0x86f54d['attributes'],'include':_0x86f54d[_0x5ad1('0x23')]?_[_0x5ad1('0x24')](_0x86f54d[_0x5ad1('0x23')],function(_0x4f824b){return{'model':db[_0x4f824b[_0x5ad1('0x25')]],'as':_0x4f824b['as'],'attributes':_0x4f824b[_0x5ad1('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x290df5){logger['info'](_0x5ad1('0x1b'),_0x2e0de6);logger[_0x5ad1('0x14')](_0x5ad1('0x1b'),_0x2e0de6,JSON[_0x5ad1('0x16')](_0x290df5));_0x4fc645(_0x290df5);})['catch'](function(_0x4440fd){logger[_0x5ad1('0x18')](_0x5ad1('0x1b'),_0x4440fd[_0x5ad1('0x19')],_0x2e0de6);_0x300885(_0x456d1d[_0x5ad1('0x18')](0x1f4,_0x4440fd[_0x5ad1('0x19')]));});});};exports[_0x5ad1('0x26')]=function(_0x58ed92){var _0x2de68d=this;return new Promise(function(_0xa9ad7b,_0x45cef9){return db[_0x5ad1('0x1c')][_0x5ad1('0x27')]({'raw':_0x58ed92[_0x5ad1('0x1e')]?_0x58ed92[_0x5ad1('0x1e')][_0x5ad1('0x1f')]===undefined?!![]:![]:!![],'where':_0x58ed92['options']?_0x58ed92[_0x5ad1('0x1e')]['where']||null:null,'attributes':_0x58ed92[_0x5ad1('0x1e')]?_0x58ed92[_0x5ad1('0x1e')]['attributes']||null:null,'include':_0x58ed92[_0x5ad1('0x1e')]?_0x58ed92[_0x5ad1('0x1e')][_0x5ad1('0x23')]?_[_0x5ad1('0x24')](_0x58ed92[_0x5ad1('0x1e')]['include'],function(_0x26400f){return{'model':db[_0x26400f[_0x5ad1('0x25')]],'as':_0x26400f['as'],'attributes':_0x26400f['attributes'],'include':_0x26400f[_0x5ad1('0x23')]?_['map'](_0x26400f[_0x5ad1('0x23')],function(_0x29520d){return{'model':db[_0x29520d['model']],'as':_0x29520d['as'],'attributes':_0x29520d[_0x5ad1('0x21')],'include':_0x29520d[_0x5ad1('0x23')]?_[_0x5ad1('0x24')](_0x29520d[_0x5ad1('0x23')],function(_0x198829){return{'model':db[_0x198829[_0x5ad1('0x25')]],'as':_0x198829['as'],'attributes':_0x198829[_0x5ad1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5ad1('0x10')](function(_0x269b7e){logger[_0x5ad1('0x11')](_0x5ad1('0x26'),_0x58ed92);logger[_0x5ad1('0x14')](_0x5ad1('0x26'),_0x58ed92,JSON['stringify'](_0x269b7e));_0xa9ad7b(_0x269b7e);})[_0x5ad1('0x28')](function(_0x110c78){logger[_0x5ad1('0x18')](_0x5ad1('0x26'),_0x110c78[_0x5ad1('0x19')],_0x58ed92);_0x45cef9(_0x2de68d[_0x5ad1('0x18')](0x1f4,_0x110c78['message']));});});};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js
index 2209086..e8b1865 100644
--- a/server/api/faxQueue/faxQueue.socket.js
+++ b/server/api/faxQueue/faxQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e82=['faxQueue:','./faxQueue.events','save','remove'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x9e82,0x119));var _0x29e8=function(_0x2a134d,_0x4cb9d2){_0x2a134d=_0x2a134d-0x0;var _0x82053e=_0x9e82[_0x2a134d];return _0x82053e;};'use strict';var FaxQueueEvents=require(_0x29e8('0x0'));var events=[_0x29e8('0x1'),_0x29e8('0x2'),'update'];function createListener(_0x4b4694,_0xa38ba8){return function(_0xdb70fe){_0xa38ba8['emit'](_0x4b4694,_0xdb70fe);};}function removeListener(_0x217d27,_0x564af7){return function(){FaxQueueEvents['removeListener'](_0x217d27,_0x564af7);};}exports['register']=function(_0x884b3c){for(var _0x431480=0x0,_0x5883fc=events['length'];_0x431480<_0x5883fc;_0x431480++){var _0xc8aebc=events[_0x431480];var _0x3ad15c=createListener(_0x29e8('0x3')+_0xc8aebc,_0x884b3c);FaxQueueEvents['on'](_0xc8aebc,_0x3ad15c);}};
\ No newline at end of file
+var _0x95f5=['remove','emit','removeListener','register','length','faxQueue:','save'];(function(_0x278642,_0x19acd7){var _0x33b72d=function(_0x43551f){while(--_0x43551f){_0x278642['push'](_0x278642['shift']());}};_0x33b72d(++_0x19acd7);}(_0x95f5,0x6f));var _0x595f=function(_0x18dfea,_0x43d571){_0x18dfea=_0x18dfea-0x0;var _0x5222e3=_0x95f5[_0x18dfea];return _0x5222e3;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x595f('0x0'),_0x595f('0x1'),'update'];function createListener(_0x15ec5b,_0x2c6986){return function(_0x13e9e5){_0x2c6986[_0x595f('0x2')](_0x15ec5b,_0x13e9e5);};}function removeListener(_0x5982f7,_0x507276){return function(){FaxQueueEvents[_0x595f('0x3')](_0x5982f7,_0x507276);};}exports[_0x595f('0x4')]=function(_0x2a8fb7){for(var _0x439642=0x0,_0x4301f5=events[_0x595f('0x5')];_0x439642<_0x4301f5;_0x439642++){var _0x4ad1a6=events[_0x439642];var _0xc0b3d7=createListener(_0x595f('0x6')+_0x4ad1a6,_0x2a8fb7);FaxQueueEvents['on'](_0x4ad1a6,_0xc0b3d7);}};
\ No newline at end of file
diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js
index 0441020..8626f7b 100644
--- a/server/api/faxQueue/index.js
+++ b/server/api/faxQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xb10b,0x12a));var _0xbb10=function(_0xc29e65,_0x7f1e9e){_0xc29e65=_0xc29e65-0x0;var _0x36240d=_0xb10b[_0xc29e65];return _0x36240d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xb10b,0x12a));var _0xbb10=function(_0x25e905,_0x42f080){_0x25e905=_0x25e905-0x0;var _0x4d1f16=_0xb10b[_0x25e905];return _0x4d1f16;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js
index 71587d4..0e1c4a7 100644
--- a/server/api/faxQueueReport/faxQueueReport.attributes.js
+++ b/server/api/faxQueueReport/faxQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70d9=['moment','sequelize','exports','STRING','DATE'];(function(_0x42b13c,_0x55b4e7){var _0x39a0d=function(_0x352ce7){while(--_0x352ce7){_0x42b13c['push'](_0x42b13c['shift']());}};_0x39a0d(++_0x55b4e7);}(_0x70d9,0x13b));var _0x970d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x70d9[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x970d('0x0'));var Sequelize=require(_0x970d('0x1'));module[_0x970d('0x2')]={'uniqueid':{'type':Sequelize[_0x970d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x970d('0x3')]},'joinAt':{'type':Sequelize[_0x970d('0x4')]},'leaveAt':{'type':Sequelize[_0x970d('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x970d('0x4')]},'reason':{'type':Sequelize[_0x970d('0x3')]}};
\ No newline at end of file
+var _0x9ffa=['sequelize','exports','STRING','DATE','moment'];(function(_0x4454c3,_0x24c130){var _0x195fa6=function(_0x594c1a){while(--_0x594c1a){_0x4454c3['push'](_0x4454c3['shift']());}};_0x195fa6(++_0x24c130);}(_0x9ffa,0x81));var _0xa9ff=function(_0x569a90,_0x46206e){_0x569a90=_0x569a90-0x0;var _0x41d0d3=_0x9ffa[_0x569a90];return _0x41d0d3;};'use strict';var moment=require(_0xa9ff('0x0'));var Sequelize=require(_0xa9ff('0x1'));module[_0xa9ff('0x2')]={'uniqueid':{'type':Sequelize[_0xa9ff('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa9ff('0x3')]},'joinAt':{'type':Sequelize[_0xa9ff('0x4')]},'leaveAt':{'type':Sequelize[_0xa9ff('0x4')]},'acceptAt':{'type':Sequelize[_0xa9ff('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js
index fe18fc5..82a94fd 100644
--- a/server/api/faxQueueReport/faxQueueReport.controller.js
+++ b/server/api/faxQueueReport/faxQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1962=['json','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','include','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','end','status'];(function(_0xd1abbc,_0x5d0d38){var _0x4c4848=function(_0x58fafe){while(--_0x58fafe){_0xd1abbc['push'](_0xd1abbc['shift']());}};_0x4c4848(++_0x5d0d38);}(_0x1962,0x111));var _0x2196=function(_0x146fc2,_0x4beccc){_0x146fc2=_0x146fc2-0x0;var _0x3600ee=_0x1962[_0x146fc2];return _0x3600ee;};'use strict';var pdf=require(_0x2196('0x0'));var emlformat=require(_0x2196('0x1'));var rimraf=require(_0x2196('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2196('0x3'));var rp=require(_0x2196('0x4'));var moment=require(_0x2196('0x5'));var BPromise=require(_0x2196('0x6'));var Mustache=require(_0x2196('0x7'));var util=require(_0x2196('0x8'));var path=require(_0x2196('0x9'));var sox=require(_0x2196('0xa'));var csv=require(_0x2196('0xb'));var ejs=require(_0x2196('0xc'));var fs=require('fs');var _=require(_0x2196('0xd'));var squel=require(_0x2196('0xe'));var crypto=require(_0x2196('0xf'));var jsforce=require(_0x2196('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2196('0xb'));var querystring=require('querystring');var Papa=require(_0x2196('0x11'));var Redis=require(_0x2196('0x12'));var authService=require(_0x2196('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2196('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2196('0x15'));var utils=require('../../config/utils');var config=require(_0x2196('0x16'));var db=require(_0x2196('0x17'))['db'];function respondWithStatusCode(_0x2a2d16,_0x3c196f){_0x3c196f=_0x3c196f||0xcc;return function(_0x2fc0f6){if(_0x2fc0f6){return _0x2a2d16[_0x2196('0x18')](_0x3c196f);}return _0x2a2d16['status'](_0x3c196f)[_0x2196('0x19')]();};}function respondWithResult(_0x1ae3f8,_0x3da474){_0x3da474=_0x3da474||0xc8;return function(_0x5b11e3){if(_0x5b11e3){return _0x1ae3f8[_0x2196('0x1a')](_0x3da474)[_0x2196('0x1b')](_0x5b11e3);}};}function respondWithFilteredResult(_0xdef55f,_0x2d99ef){return function(_0x353bc2){if(_0x353bc2){var _0x2bb164=_0x353bc2[_0x2196('0x1c')],_0x5f44a6=_0x2d99ef[_0x2196('0x1d')],_0x479f57=_0x2d99ef[_0x2196('0x1d')]+_0x2d99ef['limit'],_0x1af50d;if(_0x479f57>=_0x2bb164){_0x479f57=_0x2bb164;_0x1af50d=0xc8;}else{_0x1af50d=0xce;}_0xdef55f[_0x2196('0x1a')](_0x1af50d);return _0xdef55f['set'](_0x2196('0x1e'),_0x5f44a6+'-'+_0x479f57+'/'+_0x2bb164)[_0x2196('0x1b')](_0x353bc2);}return null;};}function patchUpdates(_0x224856){return function(_0x3c590f){try{jsonpatch[_0x2196('0x1f')](_0x3c590f,_0x224856,!![]);}catch(_0x5206a4){return BPromise[_0x2196('0x20')](_0x5206a4);}return _0x3c590f[_0x2196('0x21')]();};}function saveUpdates(_0x1abc1d,_0x2cedd4){return function(_0x5a458b){if(_0x5a458b){return _0x5a458b[_0x2196('0x22')](_0x1abc1d)['then'](function(_0x47a7f9){return _0x47a7f9;});}return null;};}function removeEntity(_0x4d9e76,_0x3f0528){return function(_0x53ffb3){if(_0x53ffb3){return _0x53ffb3[_0x2196('0x23')]()[_0x2196('0x24')](function(){_0x4d9e76[_0x2196('0x1a')](0xcc)[_0x2196('0x19')]();});}};}function handleEntityNotFound(_0x45192b,_0x35ae03){return function(_0x19965f){if(!_0x19965f){_0x45192b[_0x2196('0x18')](0x194);}return _0x19965f;};}function handleError(_0x3a9e7b,_0x20d8fb){_0x20d8fb=_0x20d8fb||0x1f4;return function(_0x251036){logger[_0x2196('0x25')](_0x251036[_0x2196('0x26')]);if(_0x251036['name']){delete _0x251036[_0x2196('0x27')];}_0x3a9e7b[_0x2196('0x1a')](_0x20d8fb)[_0x2196('0x28')](_0x251036);};}exports[_0x2196('0x29')]=function(_0x5d1984,_0x100c4e){var _0x5ad68d={},_0x62c313={},_0x1ce819={'count':0x0,'rows':[]};var _0x14a47f=_[_0x2196('0x2a')](db[_0x2196('0x2b')][_0x2196('0x2c')],function(_0xa3269b){return{'name':_0xa3269b[_0x2196('0x2d')],'type':_0xa3269b[_0x2196('0x2e')][_0x2196('0x2f')]};});_0x62c313[_0x2196('0x30')]=_[_0x2196('0x2a')](_0x14a47f,_0x2196('0x27'));_0x62c313[_0x2196('0x31')]=_['keys'](_0x5d1984[_0x2196('0x31')]);_0x62c313[_0x2196('0x32')]=_[_0x2196('0x33')](_0x62c313[_0x2196('0x30')],_0x62c313[_0x2196('0x31')]);_0x5ad68d['attributes']=_[_0x2196('0x33')](_0x62c313['model'],qs['fields'](_0x5d1984[_0x2196('0x31')][_0x2196('0x34')]));_0x5ad68d[_0x2196('0x35')]=_0x5ad68d[_0x2196('0x35')][_0x2196('0x36')]?_0x5ad68d[_0x2196('0x35')]:_0x62c313[_0x2196('0x30')];if(!_0x5d1984[_0x2196('0x31')][_0x2196('0x37')](_0x2196('0x38'))){_0x5ad68d['limit']=qs['limit'](_0x5d1984[_0x2196('0x31')]['limit']);_0x5ad68d[_0x2196('0x1d')]=qs[_0x2196('0x1d')](_0x5d1984['query']['offset']);}_0x5ad68d[_0x2196('0x39')]=qs[_0x2196('0x3a')](_0x5d1984['query'][_0x2196('0x3a')]);_0x5ad68d[_0x2196('0x3b')]=qs['filters'](_[_0x2196('0x3c')](_0x5d1984[_0x2196('0x31')],_0x62c313['filters']),_0x14a47f);if(_0x5d1984['query'][_0x2196('0x3d')]){_0x5ad68d[_0x2196('0x3b')]=_[_0x2196('0x3e')](_0x5ad68d['where'],{'$or':_[_0x2196('0x2a')](_0x14a47f,function(_0x3973c3){if(_0x3973c3['type']!==_0x2196('0x3f')){var _0x52b0e8={};_0x52b0e8[_0x3973c3[_0x2196('0x27')]]={'$like':'%'+_0x5d1984[_0x2196('0x31')][_0x2196('0x3d')]+'%'};return _0x52b0e8;}})});}_0x5ad68d=_[_0x2196('0x3e')]({},_0x5ad68d,_0x5d1984[_0x2196('0x40')]);var _0x3dc99a={'where':_0x5ad68d[_0x2196('0x3b')]};return db[_0x2196('0x2b')]['count'](_0x3dc99a)[_0x2196('0x24')](function(_0x30f18d){_0x1ce819[_0x2196('0x1c')]=_0x30f18d;if(_0x5d1984['query'][_0x2196('0x41')]){_0x5ad68d['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x2196('0x42')](_0x5ad68d);})[_0x2196('0x24')](function(_0x4a7b6c){_0x1ce819['rows']=_0x4a7b6c;return _0x1ce819;})[_0x2196('0x24')](respondWithFilteredResult(_0x100c4e,_0x5ad68d))[_0x2196('0x43')](handleError(_0x100c4e,null));};exports[_0x2196('0x44')]=function(_0xb45a11,_0x1bf544){var _0x3ef057={'raw':!![],'where':{'id':_0xb45a11[_0x2196('0x45')]['id']}},_0x460b79={};_0x460b79[_0x2196('0x30')]=_['keys'](db[_0x2196('0x2b')][_0x2196('0x2c')]);_0x460b79[_0x2196('0x31')]=_[_0x2196('0x46')](_0xb45a11[_0x2196('0x31')]);_0x460b79[_0x2196('0x32')]=_[_0x2196('0x33')](_0x460b79['model'],_0x460b79['query']);_0x3ef057[_0x2196('0x35')]=_[_0x2196('0x33')](_0x460b79[_0x2196('0x30')],qs[_0x2196('0x34')](_0xb45a11['query'][_0x2196('0x34')]));_0x3ef057[_0x2196('0x35')]=_0x3ef057[_0x2196('0x35')]['length']?_0x3ef057['attributes']:_0x460b79[_0x2196('0x30')];if(_0xb45a11['query'][_0x2196('0x41')]){_0x3ef057[_0x2196('0x47')]=[{'all':!![]}];}_0x3ef057=_[_0x2196('0x3e')]({},_0x3ef057,_0xb45a11['options']);return db[_0x2196('0x2b')]['find'](_0x3ef057)['then'](handleEntityNotFound(_0x1bf544,null))[_0x2196('0x24')](respondWithResult(_0x1bf544,null))[_0x2196('0x43')](handleError(_0x1bf544,null));};exports['create']=function(_0xb62c9,_0x11ac3){return db[_0x2196('0x2b')]['create'](_0xb62c9[_0x2196('0x48')],{})['then'](respondWithResult(_0x11ac3,0xc9))['catch'](handleError(_0x11ac3,null));};exports[_0x2196('0x22')]=function(_0x22ee36,_0x51eb30){if(_0x22ee36['body']['id']){delete _0x22ee36[_0x2196('0x48')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x22ee36[_0x2196('0x45')]['id']}})[_0x2196('0x24')](handleEntityNotFound(_0x51eb30,null))[_0x2196('0x24')](saveUpdates(_0x22ee36[_0x2196('0x48')],null))[_0x2196('0x24')](respondWithResult(_0x51eb30,null))[_0x2196('0x43')](handleError(_0x51eb30,null));};exports[_0x2196('0x23')]=function(_0x5710bb,_0x521f31){return db[_0x2196('0x2b')][_0x2196('0x49')]({'where':{'id':_0x5710bb['params']['id']}})[_0x2196('0x24')](handleEntityNotFound(_0x521f31,null))['then'](removeEntity(_0x521f31,null))[_0x2196('0x43')](handleError(_0x521f31,null));};exports['describe']=function(_0x1659cb,_0x36ea6e){return db[_0x2196('0x2b')][_0x2196('0x4a')]()[_0x2196('0x24')](respondWithResult(_0x36ea6e,null))['catch'](handleError(_0x36ea6e,null));};
\ No newline at end of file
+var _0x7ad5=['FaxQueueReport','findAll','catch','show','params','length','find','create','body','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','options','count','includeAll','include'];(function(_0x9d1180,_0x2f71fb){var _0x155274=function(_0x1867c1){while(--_0x1867c1){_0x9d1180['push'](_0x9d1180['shift']());}};_0x155274(++_0x2f71fb);}(_0x7ad5,0x1ad));var _0x57ad=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7ad5[_0xf50820];return _0x2a9b10;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x57ad('0x0'));var rimraf=require(_0x57ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x57ad('0x2'));var moment=require('moment');var BPromise=require(_0x57ad('0x3'));var Mustache=require('mustache');var util=require(_0x57ad('0x4'));var path=require(_0x57ad('0x5'));var sox=require(_0x57ad('0x6'));var csv=require(_0x57ad('0x7'));var ejs=require(_0x57ad('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x57ad('0x9'));var crypto=require(_0x57ad('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57ad('0x7'));var querystring=require(_0x57ad('0xb'));var Papa=require(_0x57ad('0xc'));var Redis=require('ioredis');var authService=require(_0x57ad('0xd'));var qs=require(_0x57ad('0xe'));var as=require(_0x57ad('0xf'));var hardwareService=require(_0x57ad('0x10'));var logger=require(_0x57ad('0x11'))(_0x57ad('0x12'));var utils=require(_0x57ad('0x13'));var config=require(_0x57ad('0x14'));var db=require(_0x57ad('0x15'))['db'];function respondWithStatusCode(_0x528121,_0x42edb1){_0x42edb1=_0x42edb1||0xcc;return function(_0x3c9704){if(_0x3c9704){return _0x528121[_0x57ad('0x16')](_0x42edb1);}return _0x528121[_0x57ad('0x17')](_0x42edb1)[_0x57ad('0x18')]();};}function respondWithResult(_0x5e57ba,_0x42f442){_0x42f442=_0x42f442||0xc8;return function(_0x19dbbc){if(_0x19dbbc){return _0x5e57ba['status'](_0x42f442)[_0x57ad('0x19')](_0x19dbbc);}};}function respondWithFilteredResult(_0x1609cc,_0x45975f){return function(_0x4045fb){if(_0x4045fb){var _0x159017=_0x4045fb['count'],_0x28576e=_0x45975f[_0x57ad('0x1a')],_0x5b7369=_0x45975f['offset']+_0x45975f[_0x57ad('0x1b')],_0x5983d7;if(_0x5b7369>=_0x159017){_0x5b7369=_0x159017;_0x5983d7=0xc8;}else{_0x5983d7=0xce;}_0x1609cc[_0x57ad('0x17')](_0x5983d7);return _0x1609cc[_0x57ad('0x1c')]('Content-Range',_0x28576e+'-'+_0x5b7369+'/'+_0x159017)[_0x57ad('0x19')](_0x4045fb);}return null;};}function patchUpdates(_0x20e0d9){return function(_0x1c9774){try{jsonpatch[_0x57ad('0x1d')](_0x1c9774,_0x20e0d9,!![]);}catch(_0x56f3f4){return BPromise[_0x57ad('0x1e')](_0x56f3f4);}return _0x1c9774['save']();};}function saveUpdates(_0x26a626,_0x2e6815){return function(_0x3db809){if(_0x3db809){return _0x3db809[_0x57ad('0x1f')](_0x26a626)['then'](function(_0x53f19e){return _0x53f19e;});}return null;};}function removeEntity(_0x4322e8,_0x44d501){return function(_0xb642a9){if(_0xb642a9){return _0xb642a9[_0x57ad('0x20')]()[_0x57ad('0x21')](function(){_0x4322e8['status'](0xcc)[_0x57ad('0x18')]();});}};}function handleEntityNotFound(_0x404231,_0x4a908c){return function(_0xc99e5){if(!_0xc99e5){_0x404231[_0x57ad('0x16')](0x194);}return _0xc99e5;};}function handleError(_0x365364,_0x547aee){_0x547aee=_0x547aee||0x1f4;return function(_0x2039b0){logger[_0x57ad('0x22')](_0x2039b0[_0x57ad('0x23')]);if(_0x2039b0[_0x57ad('0x24')]){delete _0x2039b0['name'];}_0x365364[_0x57ad('0x17')](_0x547aee)[_0x57ad('0x25')](_0x2039b0);};}exports[_0x57ad('0x26')]=function(_0x293ee1,_0x20c37e){var _0x430422={},_0x37244f={},_0x2e04ec={'count':0x0,'rows':[]};var _0x524f45=_[_0x57ad('0x27')](db['FaxQueueReport'][_0x57ad('0x28')],function(_0x4e3551){return{'name':_0x4e3551[_0x57ad('0x29')],'type':_0x4e3551['type']['key']};});_0x37244f['model']=_[_0x57ad('0x27')](_0x524f45,'name');_0x37244f['query']=_[_0x57ad('0x2a')](_0x293ee1[_0x57ad('0x2b')]);_0x37244f[_0x57ad('0x2c')]=_[_0x57ad('0x2d')](_0x37244f[_0x57ad('0x2e')],_0x37244f[_0x57ad('0x2b')]);_0x430422[_0x57ad('0x2f')]=_[_0x57ad('0x2d')](_0x37244f[_0x57ad('0x2e')],qs[_0x57ad('0x30')](_0x293ee1[_0x57ad('0x2b')][_0x57ad('0x30')]));_0x430422['attributes']=_0x430422[_0x57ad('0x2f')]['length']?_0x430422[_0x57ad('0x2f')]:_0x37244f[_0x57ad('0x2e')];if(!_0x293ee1['query']['hasOwnProperty'](_0x57ad('0x31'))){_0x430422[_0x57ad('0x1b')]=qs[_0x57ad('0x1b')](_0x293ee1[_0x57ad('0x2b')]['limit']);_0x430422[_0x57ad('0x1a')]=qs[_0x57ad('0x1a')](_0x293ee1['query']['offset']);}_0x430422[_0x57ad('0x32')]=qs[_0x57ad('0x33')](_0x293ee1[_0x57ad('0x2b')][_0x57ad('0x33')]);_0x430422[_0x57ad('0x34')]=qs['filters'](_[_0x57ad('0x35')](_0x293ee1[_0x57ad('0x2b')],_0x37244f[_0x57ad('0x2c')]),_0x524f45);if(_0x293ee1[_0x57ad('0x2b')][_0x57ad('0x36')]){_0x430422[_0x57ad('0x34')]=_[_0x57ad('0x37')](_0x430422[_0x57ad('0x34')],{'$or':_[_0x57ad('0x27')](_0x524f45,function(_0x5be0a9){if(_0x5be0a9[_0x57ad('0x38')]!=='VIRTUAL'){var _0x4db9f0={};_0x4db9f0[_0x5be0a9[_0x57ad('0x24')]]={'$like':'%'+_0x293ee1[_0x57ad('0x2b')][_0x57ad('0x36')]+'%'};return _0x4db9f0;}})});}_0x430422=_[_0x57ad('0x37')]({},_0x430422,_0x293ee1[_0x57ad('0x39')]);var _0x49a296={'where':_0x430422[_0x57ad('0x34')]};return db['FaxQueueReport'][_0x57ad('0x3a')](_0x49a296)['then'](function(_0x1ed8a5){_0x2e04ec[_0x57ad('0x3a')]=_0x1ed8a5;if(_0x293ee1[_0x57ad('0x2b')][_0x57ad('0x3b')]){_0x430422[_0x57ad('0x3c')]=[{'all':!![]}];}return db[_0x57ad('0x3d')][_0x57ad('0x3e')](_0x430422);})[_0x57ad('0x21')](function(_0x5ae340){_0x2e04ec['rows']=_0x5ae340;return _0x2e04ec;})[_0x57ad('0x21')](respondWithFilteredResult(_0x20c37e,_0x430422))[_0x57ad('0x3f')](handleError(_0x20c37e,null));};exports[_0x57ad('0x40')]=function(_0x20fbfe,_0x5c0877){var _0x115712={'raw':!![],'where':{'id':_0x20fbfe[_0x57ad('0x41')]['id']}},_0x159958={};_0x159958[_0x57ad('0x2e')]=_[_0x57ad('0x2a')](db[_0x57ad('0x3d')][_0x57ad('0x28')]);_0x159958['query']=_[_0x57ad('0x2a')](_0x20fbfe[_0x57ad('0x2b')]);_0x159958[_0x57ad('0x2c')]=_[_0x57ad('0x2d')](_0x159958[_0x57ad('0x2e')],_0x159958[_0x57ad('0x2b')]);_0x115712[_0x57ad('0x2f')]=_[_0x57ad('0x2d')](_0x159958[_0x57ad('0x2e')],qs[_0x57ad('0x30')](_0x20fbfe[_0x57ad('0x2b')][_0x57ad('0x30')]));_0x115712['attributes']=_0x115712[_0x57ad('0x2f')][_0x57ad('0x42')]?_0x115712[_0x57ad('0x2f')]:_0x159958[_0x57ad('0x2e')];if(_0x20fbfe[_0x57ad('0x2b')][_0x57ad('0x3b')]){_0x115712['include']=[{'all':!![]}];}_0x115712=_['merge']({},_0x115712,_0x20fbfe[_0x57ad('0x39')]);return db[_0x57ad('0x3d')][_0x57ad('0x43')](_0x115712)[_0x57ad('0x21')](handleEntityNotFound(_0x5c0877,null))[_0x57ad('0x21')](respondWithResult(_0x5c0877,null))[_0x57ad('0x3f')](handleError(_0x5c0877,null));};exports[_0x57ad('0x44')]=function(_0x38cccb,_0x5c8454){return db['FaxQueueReport'][_0x57ad('0x44')](_0x38cccb[_0x57ad('0x45')],{})[_0x57ad('0x21')](respondWithResult(_0x5c8454,0xc9))[_0x57ad('0x3f')](handleError(_0x5c8454,null));};exports[_0x57ad('0x1f')]=function(_0x17b4a9,_0x3a1162){if(_0x17b4a9[_0x57ad('0x45')]['id']){delete _0x17b4a9[_0x57ad('0x45')]['id'];}return db[_0x57ad('0x3d')][_0x57ad('0x43')]({'where':{'id':_0x17b4a9['params']['id']}})[_0x57ad('0x21')](handleEntityNotFound(_0x3a1162,null))[_0x57ad('0x21')](saveUpdates(_0x17b4a9[_0x57ad('0x45')],null))[_0x57ad('0x21')](respondWithResult(_0x3a1162,null))[_0x57ad('0x3f')](handleError(_0x3a1162,null));};exports[_0x57ad('0x20')]=function(_0x43ddbf,_0xadffac){return db[_0x57ad('0x3d')]['find']({'where':{'id':_0x43ddbf[_0x57ad('0x41')]['id']}})[_0x57ad('0x21')](handleEntityNotFound(_0xadffac,null))['then'](removeEntity(_0xadffac,null))[_0x57ad('0x3f')](handleError(_0xadffac,null));};exports['describe']=function(_0x304996,_0x17b6ea){return db[_0x57ad('0x3d')]['describe']()[_0x57ad('0x21')](respondWithResult(_0x17b6ea,null))[_0x57ad('0x3f')](handleError(_0x17b6ea,null));};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js
index 409502b..a2819f9 100644
--- a/server/api/faxQueueReport/faxQueueReport.model.js
+++ b/server/api/faxQueueReport/faxQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd943=['api','bluebird','request-promise','path','rimraf','../../config/environment','report_fax_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x5b9a30,_0x2b3667){var _0x35f722=function(_0xfb962b){while(--_0xfb962b){_0x5b9a30['push'](_0x5b9a30['shift']());}};_0x35f722(++_0x2b3667);}(_0xd943,0x15d));var _0x3d94=function(_0x2cb517,_0x564c92){_0x2cb517=_0x2cb517-0x0;var _0x8b5aec=_0xd943[_0x2cb517];return _0x8b5aec;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x34c9c3,_0x51cf1f){return _0x34c9c3['define']('FaxQueueReport',attributes,{'tableName':_0x3d94('0x9'),'paranoid':![],'indexes':[{'name':_0x3d94('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1751=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util'];(function(_0x4bc06e,_0xb9db1f){var _0x429c6e=function(_0x357c0b){while(--_0x357c0b){_0x4bc06e['push'](_0x4bc06e['shift']());}};_0x429c6e(++_0xb9db1f);}(_0x1751,0x76));var _0x1175=function(_0x580807,_0x3ead48){_0x580807=_0x580807-0x0;var _0xab6f2e=_0x1751[_0x580807];return _0xab6f2e;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var logger=require(_0x1175('0x2'))(_0x1175('0x3'));var moment=require('moment');var BPromise=require(_0x1175('0x4'));var rp=require(_0x1175('0x5'));var fs=require('fs');var path=require(_0x1175('0x6'));var rimraf=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var attributes=require(_0x1175('0x9'));module[_0x1175('0xa')]=function(_0x171756,_0x3f99ca){return _0x171756[_0x1175('0xb')](_0x1175('0xc'),attributes,{'tableName':_0x1175('0xd'),'paranoid':![],'indexes':[{'name':_0x1175('0xe'),'fields':[_0x1175('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js
index 282fb86..f2c5aac 100644
--- a/server/api/faxQueueReport/faxQueueReport.rpc.js
+++ b/server/api/faxQueueReport/faxQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7533=['message','FaxQueueReport,\x20%s,\x20%s','info','result','catch','FaxQueueReport','create','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','body','options','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x7533,0x93));var _0x3753=function(_0xd40e6b,_0x4a8e56){_0xd40e6b=_0xd40e6b-0x0;var _0x359de4=_0x7533[_0xd40e6b];return _0x359de4;};'use strict';var _=require(_0x3753('0x0'));var util=require(_0x3753('0x1'));var moment=require(_0x3753('0x2'));var BPromise=require(_0x3753('0x3'));var rs=require(_0x3753('0x4'));var fs=require('fs');var Redis=require(_0x3753('0x5'));var db=require(_0x3753('0x6'))['db'];var utils=require(_0x3753('0x7'));var logger=require(_0x3753('0x8'))(_0x3753('0x9'));var config=require(_0x3753('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x525904,_0x27f53e,_0x339596){return new BPromise(function(_0x122aae,_0x30efa8){return client[_0x3753('0xb')](_0x525904,_0x339596)[_0x3753('0xc')](function(_0x26cb0){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x27f53e,_0x3753('0xd'));logger[_0x3753('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x27f53e,'request\x20sent',JSON[_0x3753('0xf')](_0x26cb0));if(_0x26cb0[_0x3753('0x10')]){if(_0x26cb0[_0x3753('0x10')][_0x3753('0x11')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x27f53e,_0x26cb0['error']['message']);return _0x30efa8(_0x26cb0[_0x3753('0x10')][_0x3753('0x12')]);}logger[_0x3753('0x10')](_0x3753('0x13'),_0x27f53e,_0x26cb0[_0x3753('0x10')][_0x3753('0x12')]);return _0x122aae(_0x26cb0[_0x3753('0x10')][_0x3753('0x12')]);}else{logger[_0x3753('0x14')](_0x3753('0x13'),_0x27f53e,_0x3753('0xd'));_0x122aae(_0x26cb0[_0x3753('0x15')][_0x3753('0x12')]);}})[_0x3753('0x16')](function(_0x47c284){logger[_0x3753('0x10')](_0x3753('0x13'),_0x27f53e,_0x47c284);_0x30efa8(_0x47c284);});});}exports['CreateFaxQueueReport']=function(_0x41ef44){var _0x27da2b=this;return new Promise(function(_0x1b0da6,_0x2eaab2){return db[_0x3753('0x17')][_0x3753('0x18')](_0x41ef44['body'],{'raw':_0x41ef44['options']?_0x41ef44['options'][_0x3753('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2614c9){logger['info'](_0x3753('0x1a'),_0x41ef44);logger[_0x3753('0xe')](_0x3753('0x1a'),_0x41ef44,JSON[_0x3753('0xf')](_0x2614c9));_0x1b0da6(_0x2614c9);})['catch'](function(_0x1383b8){logger['error']('CreateFaxQueueReport',_0x1383b8['message'],_0x41ef44);_0x2eaab2(_0x27da2b[_0x3753('0x10')](0x1f4,_0x1383b8[_0x3753('0x12')]));});});};exports[_0x3753('0x1b')]=function(_0x3ae759){var _0x249c6e=this;return new Promise(function(_0x1abf0b,_0xdf758d){return db[_0x3753('0x17')][_0x3753('0x1c')](_0x3ae759[_0x3753('0x1d')],{'raw':_0x3ae759[_0x3753('0x1e')]?_0x3ae759[_0x3753('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ae759[_0x3753('0x1e')]?_0x3ae759['options']['where']||null:null,'attributes':_0x3ae759[_0x3753('0x1e')]?_0x3ae759[_0x3753('0x1e')][_0x3753('0x1f')]||null:null,'limit':_0x3ae759[_0x3753('0x1e')]?_0x3ae759['options'][_0x3753('0x20')]||null:null})[_0x3753('0xc')](function(_0x1a2644){logger['info'](_0x3753('0x1b'),_0x3ae759);logger[_0x3753('0xe')](_0x3753('0x1b'),_0x3ae759,JSON[_0x3753('0xf')](_0x1a2644));_0x1abf0b(_0x1a2644);})[_0x3753('0x16')](function(_0x13f6e7){logger[_0x3753('0x10')](_0x3753('0x1b'),_0x13f6e7['message'],_0x3ae759);_0xdf758d(_0x249c6e[_0x3753('0x10')](0x1f4,_0x13f6e7[_0x3753('0x12')]));});});};
\ No newline at end of file
+var _0x9390=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','FaxQueueReport,\x20%s,\x20%s','message','create','options','then','CreateFaxQueueReport','stringify','catch','UpdateFaxQueueReport','FaxQueueReport','update','body','raw','where','attributes','limit'];(function(_0x463d31,_0x300f00){var _0x54d42f=function(_0x3b6f3f){while(--_0x3b6f3f){_0x463d31['push'](_0x463d31['shift']());}};_0x54d42f(++_0x300f00);}(_0x9390,0x154));var _0x0939=function(_0x352ecf,_0x12964d){_0x352ecf=_0x352ecf-0x0;var _0x4b45c5=_0x9390[_0x352ecf];return _0x4b45c5;};'use strict';var _=require(_0x0939('0x0'));var util=require(_0x0939('0x1'));var moment=require(_0x0939('0x2'));var BPromise=require(_0x0939('0x3'));var rs=require(_0x0939('0x4'));var fs=require('fs');var Redis=require(_0x0939('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0939('0x6'));var logger=require(_0x0939('0x7'))(_0x0939('0x8'));var config=require(_0x0939('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0939('0xa')][_0x0939('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe3fc7,_0x37b5d5,_0x2a1c72){return new BPromise(function(_0x597ab2,_0x2e4acd){return client[_0x0939('0xc')](_0xbe3fc7,_0x2a1c72)['then'](function(_0x2adb92){logger[_0x0939('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x37b5d5,_0x0939('0xe'));logger[_0x0939('0xf')](_0x0939('0x10'),_0x37b5d5,_0x0939('0xe'),JSON['stringify'](_0x2adb92));if(_0x2adb92['error']){if(_0x2adb92['error']['code']===0x1f4){logger[_0x0939('0x11')](_0x0939('0x12'),_0x37b5d5,_0x2adb92[_0x0939('0x11')][_0x0939('0x13')]);return _0x2e4acd(_0x2adb92[_0x0939('0x11')]['message']);}logger[_0x0939('0x11')](_0x0939('0x12'),_0x37b5d5,_0x2adb92[_0x0939('0x11')][_0x0939('0x13')]);return _0x597ab2(_0x2adb92['error'][_0x0939('0x13')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x37b5d5,'request\x20sent');_0x597ab2(_0x2adb92['result'][_0x0939('0x13')]);}})['catch'](function(_0x55fdb3){logger[_0x0939('0x11')](_0x0939('0x12'),_0x37b5d5,_0x55fdb3);_0x2e4acd(_0x55fdb3);});});}exports['CreateFaxQueueReport']=function(_0x2b9a7f){var _0xaf9699=this;return new Promise(function(_0x572fbd,_0x5b4838){return db['FaxQueueReport'][_0x0939('0x14')](_0x2b9a7f['body'],{'raw':_0x2b9a7f[_0x0939('0x15')]?_0x2b9a7f['options']['raw']===undefined?!![]:![]:!![]})[_0x0939('0x16')](function(_0x3f2494){logger[_0x0939('0xd')](_0x0939('0x17'),_0x2b9a7f);logger[_0x0939('0xf')]('CreateFaxQueueReport',_0x2b9a7f,JSON[_0x0939('0x18')](_0x3f2494));_0x572fbd(_0x3f2494);})[_0x0939('0x19')](function(_0xdc06ea){logger[_0x0939('0x11')](_0x0939('0x17'),_0xdc06ea[_0x0939('0x13')],_0x2b9a7f);_0x5b4838(_0xaf9699[_0x0939('0x11')](0x1f4,_0xdc06ea[_0x0939('0x13')]));});});};exports[_0x0939('0x1a')]=function(_0x27bc1b){var _0x2893f3=this;return new Promise(function(_0x249f7f,_0x2c3ebb){return db[_0x0939('0x1b')][_0x0939('0x1c')](_0x27bc1b[_0x0939('0x1d')],{'raw':_0x27bc1b[_0x0939('0x15')]?_0x27bc1b[_0x0939('0x15')][_0x0939('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27bc1b[_0x0939('0x15')]?_0x27bc1b[_0x0939('0x15')][_0x0939('0x1f')]||null:null,'attributes':_0x27bc1b[_0x0939('0x15')]?_0x27bc1b[_0x0939('0x15')][_0x0939('0x20')]||null:null,'limit':_0x27bc1b[_0x0939('0x15')]?_0x27bc1b['options'][_0x0939('0x21')]||null:null})[_0x0939('0x16')](function(_0x22c512){logger['info'](_0x0939('0x1a'),_0x27bc1b);logger[_0x0939('0xf')](_0x0939('0x1a'),_0x27bc1b,JSON[_0x0939('0x18')](_0x22c512));_0x249f7f(_0x22c512);})[_0x0939('0x19')](function(_0x43ba2b){logger[_0x0939('0x11')](_0x0939('0x1a'),_0x43ba2b[_0x0939('0x13')],_0x27bc1b);_0x2c3ebb(_0x2893f3[_0x0939('0x11')](0x1f4,_0x43ba2b[_0x0939('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js
index 68943b0..f3e1ac1 100644
--- a/server/api/faxQueueReport/index.js
+++ b/server/api/faxQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7d3=['put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create'];(function(_0x1de158,_0x42540f){var _0x2ab676=function(_0x1b2d3f){while(--_0x1b2d3f){_0x1de158['push'](_0x1de158['shift']());}};_0x2ab676(++_0x42540f);}(_0xf7d3,0xcc));var _0x3f7d=function(_0x4c09b0,_0x2e33e6){_0x4c09b0=_0x4c09b0-0x0;var _0x3bfcbc=_0xf7d3[_0x4c09b0];return _0x3bfcbc;};'use strict';var multer=require(_0x3f7d('0x0'));var util=require(_0x3f7d('0x1'));var path=require(_0x3f7d('0x2'));var timeout=require(_0x3f7d('0x3'));var express=require(_0x3f7d('0x4'));var router=express[_0x3f7d('0x5')]();var auth=require(_0x3f7d('0x6'));var interaction=require(_0x3f7d('0x7'));var config=require('../../config/environment');var controller=require(_0x3f7d('0x8'));router[_0x3f7d('0x9')]('/',auth[_0x3f7d('0xa')](),controller[_0x3f7d('0xb')]);router[_0x3f7d('0x9')](_0x3f7d('0xc'),auth[_0x3f7d('0xa')](),controller[_0x3f7d('0xd')]);router[_0x3f7d('0x9')]('/:id',auth[_0x3f7d('0xa')](),controller[_0x3f7d('0xe')]);router['post']('/',auth[_0x3f7d('0xa')](),controller[_0x3f7d('0xf')]);router[_0x3f7d('0x10')](_0x3f7d('0x11'),auth[_0x3f7d('0xa')](),controller[_0x3f7d('0x12')]);router['delete'](_0x3f7d('0x11'),auth[_0x3f7d('0xa')](),controller['destroy']);module[_0x3f7d('0x13')]=router;
\ No newline at end of file
+var _0xb1d3=['show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x21e284,_0x2c9bea){var _0x34355e=function(_0x484a72){while(--_0x484a72){_0x21e284['push'](_0x21e284['shift']());}};_0x34355e(++_0x2c9bea);}(_0xb1d3,0x93));var _0x3b1d=function(_0x488342,_0x25b816){_0x488342=_0x488342-0x0;var _0x959c20=_0xb1d3[_0x488342];return _0x959c20;};'use strict';var multer=require(_0x3b1d('0x0'));var util=require('util');var path=require(_0x3b1d('0x1'));var timeout=require(_0x3b1d('0x2'));var express=require('express');var router=express[_0x3b1d('0x3')]();var auth=require(_0x3b1d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3b1d('0x5'));var controller=require(_0x3b1d('0x6'));router[_0x3b1d('0x7')]('/',auth[_0x3b1d('0x8')](),controller[_0x3b1d('0x9')]);router['get'](_0x3b1d('0xa'),auth[_0x3b1d('0x8')](),controller[_0x3b1d('0xb')]);router['get'](_0x3b1d('0xc'),auth[_0x3b1d('0x8')](),controller[_0x3b1d('0xd')]);router['post']('/',auth[_0x3b1d('0x8')](),controller[_0x3b1d('0xe')]);router[_0x3b1d('0xf')](_0x3b1d('0xc'),auth[_0x3b1d('0x8')](),controller[_0x3b1d('0x10')]);router[_0x3b1d('0x11')]('/:id',auth[_0x3b1d('0x8')](),controller[_0x3b1d('0x12')]);module[_0x3b1d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js
index 7674c82..73804fb 100644
--- a/server/api/faxTransferReport/faxTransferReport.attributes.js
+++ b/server/api/faxTransferReport/faxTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x64d3=['STRING','ENUM','account','agent','queue','NOW','sequelize','exports'];(function(_0x53eb54,_0x292d5a){var _0x186387=function(_0x29889b){while(--_0x29889b){_0x53eb54['push'](_0x53eb54['shift']());}};_0x186387(++_0x292d5a);}(_0x64d3,0x15e));var _0x364d=function(_0x1f2e2d,_0x57f149){_0x1f2e2d=_0x1f2e2d-0x0;var _0x18f734=_0x64d3[_0x1f2e2d];return _0x18f734;};'use strict';var moment=require('moment');var Sequelize=require(_0x364d('0x0'));module[_0x364d('0x1')]={'uniqueid':{'type':Sequelize[_0x364d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x364d('0x3')](_0x364d('0x4'),_0x364d('0x5'),'queue'),'allowNull':![],'defaultValue':_0x364d('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x364d('0x7')]}};
\ No newline at end of file
+var _0x7958=['account','queue','DATE','NOW','moment','exports','ENUM'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7958,0xcf));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x8795('0x0'));var Sequelize=require('sequelize');module[_0x8795('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8795('0x2')](_0x8795('0x3'),'agent',_0x8795('0x4')),'allowNull':![],'defaultValue':_0x8795('0x4')},'transferredAt':{'type':Sequelize[_0x8795('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x8795('0x6')]}};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js
index c4a71fe..f177627 100644
--- a/server/api/faxTransferReport/faxTransferReport.controller.js
+++ b/server/api/faxTransferReport/faxTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['send','index','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','limit','set','apply','reject','save','update','destroy','then','stack','name'];(function(_0x5830f1,_0x1a5dd8){var _0x1a35eb=function(_0x4a829c){while(--_0x4a829c){_0x5830f1['push'](_0x5830f1['shift']());}};_0x1a35eb(++_0x1a5dd8);}(_0x2ef3,0xba));var _0x32ef=function(_0xfa7827,_0x17c457){_0xfa7827=_0xfa7827-0x0;var _0x1b82f5=_0x2ef3[_0xfa7827];return _0x1b82f5;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];function respondWithStatusCode(_0x5afcc2,_0x1a5106){_0x1a5106=_0x1a5106||0xcc;return function(_0x49d590){if(_0x49d590){return _0x5afcc2[_0x32ef('0x19')](_0x1a5106);}return _0x5afcc2[_0x32ef('0x1a')](_0x1a5106)['end']();};}function respondWithResult(_0x539d18,_0x19ce1){_0x19ce1=_0x19ce1||0xc8;return function(_0x4d8009){if(_0x4d8009){return _0x539d18[_0x32ef('0x1a')](_0x19ce1)[_0x32ef('0x1b')](_0x4d8009);}};}function respondWithFilteredResult(_0x93d492,_0x54c7f5){return function(_0x57aff1){if(_0x57aff1){var _0x55bf0b=_0x57aff1[_0x32ef('0x1c')],_0x531e30=_0x54c7f5['offset'],_0x13db1a=_0x54c7f5['offset']+_0x54c7f5[_0x32ef('0x1d')],_0x3950e6;if(_0x13db1a>=_0x55bf0b){_0x13db1a=_0x55bf0b;_0x3950e6=0xc8;}else{_0x3950e6=0xce;}_0x93d492[_0x32ef('0x1a')](_0x3950e6);return _0x93d492[_0x32ef('0x1e')]('Content-Range',_0x531e30+'-'+_0x13db1a+'/'+_0x55bf0b)[_0x32ef('0x1b')](_0x57aff1);}return null;};}function patchUpdates(_0x33e230){return function(_0x4f4c98){try{jsonpatch[_0x32ef('0x1f')](_0x4f4c98,_0x33e230,!![]);}catch(_0x314ef1){return BPromise[_0x32ef('0x20')](_0x314ef1);}return _0x4f4c98[_0x32ef('0x21')]();};}function saveUpdates(_0x445cda,_0x3aec05){return function(_0x4de441){if(_0x4de441){return _0x4de441[_0x32ef('0x22')](_0x445cda)['then'](function(_0x309866){return _0x309866;});}return null;};}function removeEntity(_0x3a20ca,_0x49f2d8){return function(_0x1af371){if(_0x1af371){return _0x1af371[_0x32ef('0x23')]()[_0x32ef('0x24')](function(){_0x3a20ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(!_0x225feb){_0x22f2d7['sendStatus'](0x194);}return _0x225feb;};}function handleError(_0x59585f,_0x19ea6){_0x19ea6=_0x19ea6||0x1f4;return function(_0x4d584b){logger['error'](_0x4d584b[_0x32ef('0x25')]);if(_0x4d584b[_0x32ef('0x26')]){delete _0x4d584b[_0x32ef('0x26')];}_0x59585f[_0x32ef('0x1a')](_0x19ea6)[_0x32ef('0x27')](_0x4d584b);};}exports[_0x32ef('0x28')]=function(_0x1874ea,_0x38aed5){var _0x338f19={},_0x2f52d7={},_0x1335e2={'count':0x0,'rows':[]};var _0xba4b3f=_['map'](db[_0x32ef('0x29')][_0x32ef('0x2a')],function(_0x5a04cd){return{'name':_0x5a04cd[_0x32ef('0x2b')],'type':_0x5a04cd[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x2f52d7[_0x32ef('0x2e')]=_['map'](_0xba4b3f,_0x32ef('0x26'));_0x2f52d7[_0x32ef('0x2f')]=_[_0x32ef('0x30')](_0x1874ea[_0x32ef('0x2f')]);_0x2f52d7[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2f52d7[_0x32ef('0x2e')],_0x2f52d7['query']);_0x338f19[_0x32ef('0x33')]=_['intersection'](_0x2f52d7[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x1874ea['query'][_0x32ef('0x34')]));_0x338f19[_0x32ef('0x33')]=_0x338f19[_0x32ef('0x33')][_0x32ef('0x35')]?_0x338f19[_0x32ef('0x33')]:_0x2f52d7['model'];if(!_0x1874ea['query'][_0x32ef('0x36')]('nolimit')){_0x338f19[_0x32ef('0x1d')]=qs[_0x32ef('0x1d')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x338f19[_0x32ef('0x37')]=qs[_0x32ef('0x37')](_0x1874ea['query']['offset']);}_0x338f19['order']=qs[_0x32ef('0x38')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x38')]);_0x338f19['where']=qs['filters'](_[_0x32ef('0x39')](_0x1874ea[_0x32ef('0x2f')],_0x2f52d7[_0x32ef('0x31')]),_0xba4b3f);if(_0x1874ea['query']['filter']){_0x338f19[_0x32ef('0x3a')]=_[_0x32ef('0x3b')](_0x338f19[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x3c')](_0xba4b3f,function(_0x3a7c49){if(_0x3a7c49[_0x32ef('0x2c')]!==_0x32ef('0x3d')){var _0x21da90={};_0x21da90[_0x3a7c49[_0x32ef('0x26')]]={'$like':'%'+_0x1874ea['query'][_0x32ef('0x3e')]+'%'};return _0x21da90;}})});}_0x338f19=_[_0x32ef('0x3b')]({},_0x338f19,_0x1874ea[_0x32ef('0x3f')]);var _0x4b97dc={'where':_0x338f19[_0x32ef('0x3a')]};return db[_0x32ef('0x29')][_0x32ef('0x1c')](_0x4b97dc)[_0x32ef('0x24')](function(_0x1faf72){_0x1335e2[_0x32ef('0x1c')]=_0x1faf72;if(_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x40')]){_0x338f19[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x29')][_0x32ef('0x42')](_0x338f19);})[_0x32ef('0x24')](function(_0x48e071){_0x1335e2[_0x32ef('0x43')]=_0x48e071;return _0x1335e2;})[_0x32ef('0x24')](respondWithFilteredResult(_0x38aed5,_0x338f19))[_0x32ef('0x44')](handleError(_0x38aed5,null));};exports[_0x32ef('0x45')]=function(_0x2f92f5,_0x2ca66b){var _0x3c0e44={'raw':!![],'where':{'id':_0x2f92f5['params']['id']}},_0x596d5a={};_0x596d5a[_0x32ef('0x2e')]=_[_0x32ef('0x30')](db[_0x32ef('0x29')][_0x32ef('0x2a')]);_0x596d5a['query']=_[_0x32ef('0x30')](_0x2f92f5[_0x32ef('0x2f')]);_0x596d5a['filters']=_[_0x32ef('0x32')](_0x596d5a['model'],_0x596d5a[_0x32ef('0x2f')]);_0x3c0e44[_0x32ef('0x33')]=_[_0x32ef('0x32')](_0x596d5a[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x2f92f5[_0x32ef('0x2f')][_0x32ef('0x34')]));_0x3c0e44[_0x32ef('0x33')]=_0x3c0e44[_0x32ef('0x33')][_0x32ef('0x35')]?_0x3c0e44['attributes']:_0x596d5a[_0x32ef('0x2e')];if(_0x2f92f5['query'][_0x32ef('0x40')]){_0x3c0e44[_0x32ef('0x41')]=[{'all':!![]}];}_0x3c0e44=_[_0x32ef('0x3b')]({},_0x3c0e44,_0x2f92f5['options']);return db[_0x32ef('0x29')][_0x32ef('0x46')](_0x3c0e44)[_0x32ef('0x24')](handleEntityNotFound(_0x2ca66b,null))[_0x32ef('0x24')](respondWithResult(_0x2ca66b,null))[_0x32ef('0x44')](handleError(_0x2ca66b,null));};exports[_0x32ef('0x47')]=function(_0x12c9e6,_0x47dbe1){return db['FaxTransferReport'][_0x32ef('0x47')](_0x12c9e6[_0x32ef('0x48')],{})[_0x32ef('0x24')](respondWithResult(_0x47dbe1,0xc9))[_0x32ef('0x44')](handleError(_0x47dbe1,null));};exports[_0x32ef('0x22')]=function(_0xd67dc9,_0x44ad11){if(_0xd67dc9[_0x32ef('0x48')]['id']){delete _0xd67dc9[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0xd67dc9[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x44ad11,null))['then'](saveUpdates(_0xd67dc9[_0x32ef('0x48')],null))[_0x32ef('0x24')](respondWithResult(_0x44ad11,null))[_0x32ef('0x44')](handleError(_0x44ad11,null));};exports[_0x32ef('0x23')]=function(_0x1cc9f3,_0x4353f0){return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0x1cc9f3[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x4353f0,null))[_0x32ef('0x24')](removeEntity(_0x4353f0,null))[_0x32ef('0x44')](handleError(_0x4353f0,null));};exports[_0x32ef('0x4a')]=function(_0x326445,_0x307ac8){return db[_0x32ef('0x29')][_0x32ef('0x4a')]()[_0x32ef('0x24')](respondWithResult(_0x307ac8,null))['catch'](handleError(_0x307ac8,null));};
\ No newline at end of file
+var _0x0b0e=['index','map','FaxTransferReport','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject','update','then','destroy','end','error','name'];(function(_0x20d8a3,_0x17d44b){var _0x4b0fb6=function(_0x43904d){while(--_0x43904d){_0x20d8a3['push'](_0x20d8a3['shift']());}};_0x4b0fb6(++_0x17d44b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x41c88c,_0x381f8d){_0x41c88c=_0x41c88c-0x0;var _0x2c97ea=_0x0b0e[_0x41c88c];return _0x2c97ea;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x24')](_0x5200a6,_0xe0b0('0x22'));_0x3ec2['query']=_[_0xe0b0('0x2a')](_0x3c3bc2[_0xe0b0('0x2b')]);_0x3ec2['filters']=_['intersection'](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2b')]);_0x1d91ad[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x3ec2[_0xe0b0('0x29')],qs['fields'](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x2e')]));_0x1d91ad[_0xe0b0('0x2c')]=_0x1d91ad[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x1d91ad['attributes']:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x30')](_0xe0b0('0x31'))){_0x1d91ad[_0xe0b0('0x32')]=qs[_0xe0b0('0x32')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x32')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x33')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2b')]['sort']);_0x1d91ad[_0xe0b0('0x35')]=qs[_0xe0b0('0x36')](_[_0xe0b0('0x37')](_0x3c3bc2[_0xe0b0('0x2b')],_0x3ec2[_0xe0b0('0x36')]),_0x5200a6);if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]){_0x1d91ad['where']=_['merge'](_0x1d91ad['where'],{'$or':_['map'](_0x5200a6,function(_0x26137c){if(_0x26137c[_0xe0b0('0x27')]!==_0xe0b0('0x39')){var _0x4e4b20={};_0x4e4b20[_0x26137c[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]+'%'};return _0x4e4b20;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2['options']);var _0xed3226={'where':_0x1d91ad[_0xe0b0('0x35')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3b')](_0xed3226)[_0xe0b0('0x1e')](function(_0x1205db){_0x10745d[_0xe0b0('0x3b')]=_0x1205db;if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')]['findAll'](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x2d5f47){_0x10745d[_0xe0b0('0x3d')]=_0x2d5f47;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))['catch'](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x3e')]=function(_0x41adcb,_0x33706d){var _0x402a0e={'raw':!![],'where':{'id':_0x41adcb[_0xe0b0('0x3f')]['id']}},_0x19c80e={};_0x19c80e[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](db['FaxTransferReport'][_0xe0b0('0x40')]);_0x19c80e[_0xe0b0('0x2b')]=_['keys'](_0x41adcb['query']);_0x19c80e[_0xe0b0('0x36')]=_[_0xe0b0('0x2d')](_0x19c80e['model'],_0x19c80e[_0xe0b0('0x2b')]);_0x402a0e[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x19c80e[_0xe0b0('0x29')],qs[_0xe0b0('0x2e')](_0x41adcb['query']['fields']));_0x402a0e['attributes']=_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x402a0e['attributes']:_0x19c80e[_0xe0b0('0x29')];if(_0x41adcb[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x402a0e[_0xe0b0('0x41')]=[{'all':!![]}];}_0x402a0e=_[_0xe0b0('0x3a')]({},_0x402a0e,_0x41adcb['options']);return db['FaxTransferReport'][_0xe0b0('0x42')](_0x402a0e)[_0xe0b0('0x1e')](handleEntityNotFound(_0x33706d,null))[_0xe0b0('0x1e')](respondWithResult(_0x33706d,null))[_0xe0b0('0x43')](handleError(_0x33706d,null));};exports[_0xe0b0('0x44')]=function(_0x575c7d,_0x3b1474){return db[_0xe0b0('0x25')]['create'](_0x575c7d['body'],{})['then'](respondWithResult(_0x3b1474,0xc9))[_0xe0b0('0x43')](handleError(_0x3b1474,null));};exports[_0xe0b0('0x1d')]=function(_0x2419ce,_0x364877){if(_0x2419ce['body']['id']){delete _0x2419ce[_0xe0b0('0x45')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':{'id':_0x2419ce['params']['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x364877,null))[_0xe0b0('0x1e')](saveUpdates(_0x2419ce['body'],null))[_0xe0b0('0x1e')](respondWithResult(_0x364877,null))[_0xe0b0('0x43')](handleError(_0x364877,null));};exports['destroy']=function(_0x5cb2b6,_0x123ad2){return db['FaxTransferReport'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));};exports[_0xe0b0('0x46')]=function(_0x5f5486,_0x5d018d){return db[_0xe0b0('0x25')]['describe']()['then'](respondWithResult(_0x5d018d,null))[_0xe0b0('0x43')](handleError(_0x5d018d,null));};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js
index 60499ef..9181526 100644
--- a/server/api/faxTransferReport/faxTransferReport.model.js
+++ b/server/api/faxTransferReport/faxTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe58a=['util','../../config/logger','moment','path','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0x501ca1,_0x6c6edc){var _0x2a99c4=function(_0x542cad){while(--_0x542cad){_0x501ca1['push'](_0x501ca1['shift']());}};_0x2a99c4(++_0x6c6edc);}(_0xe58a,0x9f));var _0xae58=function(_0x28132e,_0x561138){_0x28132e=_0x28132e-0x0;var _0x3cf5b7=_0xe58a[_0x28132e];return _0x3cf5b7;};'use strict';var _=require(_0xae58('0x0'));var util=require(_0xae58('0x1'));var logger=require(_0xae58('0x2'))('api');var moment=require(_0xae58('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae58('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xae58('0x5'));module['exports']=function(_0x198e0c,_0x29749a){return _0x198e0c[_0xae58('0x6')](_0xae58('0x7'),attributes,{'tableName':_0xae58('0x8'),'paranoid':![],'indexes':[{'name':_0xae58('0x9'),'fields':[_0xae58('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5981=['report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxTransferReport'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5981,0xa7));var _0x1598=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5981[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1598('0x0'));var util=require(_0x1598('0x1'));var logger=require(_0x1598('0x2'))(_0x1598('0x3'));var moment=require(_0x1598('0x4'));var BPromise=require(_0x1598('0x5'));var rp=require(_0x1598('0x6'));var fs=require('fs');var path=require(_0x1598('0x7'));var rimraf=require(_0x1598('0x8'));var config=require(_0x1598('0x9'));var attributes=require('./faxTransferReport.attributes');module[_0x1598('0xa')]=function(_0x4af2c2,_0xead3f4){return _0x4af2c2[_0x1598('0xb')](_0x1598('0xc'),attributes,{'tableName':_0x1598('0xd'),'paranoid':![],'indexes':[{'name':_0x1598('0xe'),'fields':[_0x1598('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js
index e0e8bd8..726af44 100644
--- a/server/api/faxTransferReport/faxTransferReport.rpc.js
+++ b/server/api/faxTransferReport/faxTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b93=['../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x36b3f4,_0x2c6ae2){var _0x139d9e=function(_0x43e077){while(--_0x43e077){_0x36b3f4['push'](_0x36b3f4['shift']());}};_0x139d9e(++_0x2c6ae2);}(_0x4b93,0x1f2));var _0x34b9=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x4b93[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x34b9('0x0'));var util=require('util');var moment=require(_0x34b9('0x1'));var BPromise=require(_0x34b9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34b9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x34b9('0x4'))(_0x34b9('0x5'));var config=require(_0x34b9('0x6'));var jayson=require(_0x34b9('0x7'));var client=jayson[_0x34b9('0x8')][_0x34b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f47f,_0x2b700b,_0x355094){return new BPromise(function(_0x493b45,_0x2c11f8){return client[_0x34b9('0xa')](_0x44f47f,_0x355094)[_0x34b9('0xb')](function(_0xc4a8fe){logger['info'](_0x34b9('0xc'),_0x2b700b,_0x34b9('0xd'));logger[_0x34b9('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2b700b,_0x34b9('0xd'),JSON['stringify'](_0xc4a8fe));if(_0xc4a8fe[_0x34b9('0xf')]){if(_0xc4a8fe[_0x34b9('0xf')][_0x34b9('0x10')]===0x1f4){logger[_0x34b9('0xf')](_0x34b9('0xc'),_0x2b700b,_0xc4a8fe[_0x34b9('0xf')][_0x34b9('0x11')]);return _0x2c11f8(_0xc4a8fe[_0x34b9('0xf')][_0x34b9('0x11')]);}logger[_0x34b9('0xf')](_0x34b9('0xc'),_0x2b700b,_0xc4a8fe['error'][_0x34b9('0x11')]);return _0x493b45(_0xc4a8fe[_0x34b9('0xf')][_0x34b9('0x11')]);}else{logger[_0x34b9('0x12')](_0x34b9('0xc'),_0x2b700b,_0x34b9('0xd'));_0x493b45(_0xc4a8fe[_0x34b9('0x13')]['message']);}})[_0x34b9('0x14')](function(_0x4729c2){logger[_0x34b9('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2b700b,_0x4729c2);_0x2c11f8(_0x4729c2);});});}
\ No newline at end of file
+var _0x1409=['request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x52803d,_0x36b350){var _0x626880=function(_0x335d98){while(--_0x335d98){_0x52803d['push'](_0x52803d['shift']());}};_0x626880(++_0x36b350);}(_0x1409,0x193));var _0x9140=function(_0x10a306,_0x2e8ff3){_0x10a306=_0x10a306-0x0;var _0x4f848b=_0x1409[_0x10a306];return _0x4f848b;};'use strict';var _=require(_0x9140('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9140('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9140('0x2'))['db'];var utils=require(_0x9140('0x3'));var logger=require(_0x9140('0x4'))(_0x9140('0x5'));var config=require(_0x9140('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ed726,_0x175463,_0x548b16){return new BPromise(function(_0x4453b0,_0x47d05c){return client[_0x9140('0x7')](_0x3ed726,_0x548b16)[_0x9140('0x8')](function(_0x229a2b){logger[_0x9140('0x9')](_0x9140('0xa'),_0x175463,_0x9140('0xb'));logger[_0x9140('0xc')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x175463,_0x9140('0xb'),JSON[_0x9140('0xd')](_0x229a2b));if(_0x229a2b[_0x9140('0xe')]){if(_0x229a2b['error'][_0x9140('0xf')]===0x1f4){logger[_0x9140('0xe')](_0x9140('0xa'),_0x175463,_0x229a2b[_0x9140('0xe')][_0x9140('0x10')]);return _0x47d05c(_0x229a2b['error'][_0x9140('0x10')]);}logger[_0x9140('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x175463,_0x229a2b[_0x9140('0xe')][_0x9140('0x10')]);return _0x4453b0(_0x229a2b['error'][_0x9140('0x10')]);}else{logger[_0x9140('0x9')]('FaxTransferReport,\x20%s,\x20%s',_0x175463,_0x9140('0xb'));_0x4453b0(_0x229a2b['result'][_0x9140('0x10')]);}})[_0x9140('0x11')](function(_0x36d9ee){logger[_0x9140('0xe')](_0x9140('0xa'),_0x175463,_0x36d9ee);_0x47d05c(_0x36d9ee);});});}
\ No newline at end of file
diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js
index 1303137..ad61321 100644
--- a/server/api/faxTransferReport/index.js
+++ b/server/api/faxTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8541=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','update','destroy','exports','util','path'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x8541,0x11f));var _0x1854=function(_0x4b4aec,_0x264398){_0x4b4aec=_0x4b4aec-0x0;var _0x11577c=_0x8541[_0x4b4aec];return _0x11577c;};'use strict';var multer=require('multer');var util=require(_0x1854('0x0'));var path=require(_0x1854('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x1854('0x2'));var interaction=require(_0x1854('0x3'));var config=require(_0x1854('0x4'));var controller=require(_0x1854('0x5'));router[_0x1854('0x6')]('/',auth['isAuthenticated'](),controller[_0x1854('0x7')]);router[_0x1854('0x6')](_0x1854('0x8'),auth[_0x1854('0x9')](),controller['describe']);router[_0x1854('0x6')](_0x1854('0xa'),auth['isAuthenticated'](),controller[_0x1854('0xb')]);router[_0x1854('0xc')]('/',auth[_0x1854('0x9')](),controller[_0x1854('0xd')]);router['put'](_0x1854('0xa'),auth[_0x1854('0x9')](),controller[_0x1854('0xe')]);router['delete'](_0x1854('0xa'),auth[_0x1854('0x9')](),controller[_0x1854('0xf')]);module[_0x1854('0x10')]=router;
\ No newline at end of file
+var _0x70b6=['show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x540c3d,_0xe787c3){var _0x4470e8=function(_0x2cfb50){while(--_0x2cfb50){_0x540c3d['push'](_0x540c3d['shift']());}};_0x4470e8(++_0xe787c3);}(_0x70b6,0x15c));var _0x670b=function(_0x22fd68,_0x42fb90){_0x22fd68=_0x22fd68-0x0;var _0x3ed1b1=_0x70b6[_0x22fd68];return _0x3ed1b1;};'use strict';var multer=require(_0x670b('0x0'));var util=require(_0x670b('0x1'));var path=require('path');var timeout=require(_0x670b('0x2'));var express=require(_0x670b('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x670b('0x4'));var config=require('../../config/environment');var controller=require(_0x670b('0x5'));router[_0x670b('0x6')]('/',auth[_0x670b('0x7')](),controller[_0x670b('0x8')]);router['get'](_0x670b('0x9'),auth['isAuthenticated'](),controller[_0x670b('0xa')]);router[_0x670b('0x6')](_0x670b('0xb'),auth[_0x670b('0x7')](),controller[_0x670b('0xc')]);router[_0x670b('0xd')]('/',auth['isAuthenticated'](),controller[_0x670b('0xe')]);router[_0x670b('0xf')](_0x670b('0xb'),auth['isAuthenticated'](),controller[_0x670b('0x10')]);router[_0x670b('0x11')](_0x670b('0xb'),auth[_0x670b('0x7')](),controller[_0x670b('0x12')]);module[_0x670b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js
index 7368a25..a1059a6 100644
--- a/server/api/intDeskAccount/index.js
+++ b/server/api/intDeskAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x277c=['show','get','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','/:id'];(function(_0x5912e7,_0x1db12c){var _0x3ccdb0=function(_0x407741){while(--_0x407741){_0x5912e7['push'](_0x5912e7['shift']());}};_0x3ccdb0(++_0x1db12c);}(_0x277c,0x153));var _0xc277=function(_0xb2bc61,_0x390f29){_0xb2bc61=_0xb2bc61-0x0;var _0x1a73d5=_0x277c[_0xb2bc61];return _0x1a73d5;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var auth=require(_0xc277('0x5'));var interaction=require(_0xc277('0x6'));var config=require(_0xc277('0x7'));var controller=require(_0xc277('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc277('0x9')]);router['get'](_0xc277('0xa'),auth['isAuthenticated'](),controller[_0xc277('0xb')]);router[_0xc277('0xc')]('/:id/configurations',auth[_0xc277('0xd')](),controller[_0xc277('0xe')]);router[_0xc277('0xc')](_0xc277('0xf'),auth[_0xc277('0xd')](),controller[_0xc277('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc277('0x11')]);router[_0xc277('0x12')](_0xc277('0x13'),auth[_0xc277('0xd')](),controller['addConfiguration']);router[_0xc277('0x14')]('/:id',auth[_0xc277('0xd')](),controller[_0xc277('0x15')]);router[_0xc277('0x16')](_0xc277('0xa'),auth['isAuthenticated'](),controller[_0xc277('0x17')]);module[_0xc277('0x18')]=router;
\ No newline at end of file
+var _0x25fa=['create','addConfiguration','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x8fb092,_0x883290){var _0xd63883=function(_0x567d8e){while(--_0x567d8e){_0x8fb092['push'](_0x8fb092['shift']());}};_0xd63883(++_0x883290);}(_0x25fa,0x109));var _0xa25f=function(_0x301805,_0x54808c){_0x301805=_0x301805-0x0;var _0x22c58e=_0x25fa[_0x301805];return _0x22c58e;};'use strict';var multer=require(_0xa25f('0x0'));var util=require('util');var path=require(_0xa25f('0x1'));var timeout=require(_0xa25f('0x2'));var express=require('express');var router=express[_0xa25f('0x3')]();var auth=require(_0xa25f('0x4'));var interaction=require(_0xa25f('0x5'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xa25f('0x6')]('/',auth['isAuthenticated'](),controller[_0xa25f('0x7')]);router[_0xa25f('0x6')](_0xa25f('0x8'),auth[_0xa25f('0x9')](),controller[_0xa25f('0xa')]);router[_0xa25f('0x6')](_0xa25f('0xb'),auth[_0xa25f('0x9')](),controller[_0xa25f('0xc')]);router['get'](_0xa25f('0xd'),auth[_0xa25f('0x9')](),controller['getFields']);router[_0xa25f('0xe')]('/',auth[_0xa25f('0x9')](),controller[_0xa25f('0xf')]);router[_0xa25f('0xe')]('/:id/configurations',auth[_0xa25f('0x9')](),controller[_0xa25f('0x10')]);router['put'](_0xa25f('0x8'),auth[_0xa25f('0x9')](),controller['update']);router[_0xa25f('0x11')](_0xa25f('0x8'),auth[_0xa25f('0x9')](),controller[_0xa25f('0x12')]);module[_0xa25f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js
index 9479461..925bfa0 100644
--- a/server/api/intDeskAccount/intDeskAccount.attributes.js
+++ b/server/api/intDeskAccount/intDeskAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f16=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x4196a3,_0x3685de){var _0x17d255=function(_0x27bef6){while(--_0x27bef6){_0x4196a3['push'](_0x4196a3['shift']());}};_0x17d255(++_0x3685de);}(_0x2f16,0x18c));var _0x62f1=function(_0x1d2c63,_0x4bf487){_0x1d2c63=_0x1d2c63-0x0;var _0x498857=_0x2f16[_0x1d2c63];return _0x498857;};'use strict';var Sequelize=require(_0x62f1('0x0'));module[_0x62f1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x62f1('0x2')]},'username':{'type':Sequelize[_0x62f1('0x2')]},'remoteUri':{'type':Sequelize[_0x62f1('0x2')]},'authType':{'type':Sequelize[_0x62f1('0x3')](_0x62f1('0x4')),'defaultValue':_0x62f1('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x62f1('0x2')]},'consumerSecret':{'type':Sequelize[_0x62f1('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x62f1('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x62f1('0x3')](_0x62f1('0x5'),_0x62f1('0x6')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x462b=['ENUM','basic','sequelize','STRING'];(function(_0x361704,_0x3af61c){var _0x258953=function(_0x53ca46){while(--_0x53ca46){_0x361704['push'](_0x361704['shift']());}};_0x258953(++_0x3af61c);}(_0x462b,0xf6));var _0xb462=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x462b[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xb462('0x0'));module['exports']={'name':{'type':Sequelize[_0xb462('0x1')]},'description':{'type':Sequelize[_0xb462('0x1')]},'username':{'type':Sequelize[_0xb462('0x1')]},'remoteUri':{'type':Sequelize[_0xb462('0x1')]},'authType':{'type':Sequelize[_0xb462('0x2')](_0xb462('0x3')),'defaultValue':_0xb462('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xb462('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb462('0x1')]},'tokenSecret':{'type':Sequelize[_0xb462('0x1')]},'serverUrl':{'type':Sequelize[_0xb462('0x1')]},'type':{'type':Sequelize[_0xb462('0x2')]('integrationTab','newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js
index 552b3a6..90fcbed 100644
--- a/server/api/intDeskAccount/intDeskAccount.controller.js
+++ b/server/api/intDeskAccount/intDeskAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008b=['getFields','priority','authType','username','password','consumerSecret','token','tokenSecret','remoteUri','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Basic\x20%s','toString','_embedded','entries','active','label','statusCode','test','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','destroy','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','rows','catch','show','params','create','body','find','getConfigurations','findOne','DeskConfiguration','addConfiguration','Subjects','channel','Descriptions','DeskField'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0x008b,0x105));var _0xb008=function(_0x51463b,_0x58ddbc){_0x51463b=_0x51463b-0x0;var _0x5d99f1=_0x008b[_0x51463b];return _0x5d99f1;};'use strict';var pdf=require(_0xb008('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb008('0x1'));var zipdir=require(_0xb008('0x2'));var jsonpatch=require(_0xb008('0x3'));var rp=require(_0xb008('0x4'));var moment=require(_0xb008('0x5'));var BPromise=require(_0xb008('0x6'));var Mustache=require('mustache');var util=require(_0xb008('0x7'));var path=require(_0xb008('0x8'));var sox=require(_0xb008('0x9'));var csv=require(_0xb008('0xa'));var ejs=require(_0xb008('0xb'));var fs=require('fs');var _=require(_0xb008('0xc'));var squel=require(_0xb008('0xd'));var crypto=require(_0xb008('0xe'));var jsforce=require(_0xb008('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb008('0xa'));var querystring=require('querystring');var Papa=require(_0xb008('0x10'));var Redis=require(_0xb008('0x11'));var authService=require(_0xb008('0x12'));var qs=require(_0xb008('0x13'));var as=require(_0xb008('0x14'));var hardwareService=require(_0xb008('0x15'));var logger=require(_0xb008('0x16'))(_0xb008('0x17'));var utils=require('../../config/utils');var config=require(_0xb008('0x18'));var db=require(_0xb008('0x19'))['db'];var integrations=require(_0xb008('0x1a'));var jayson=require(_0xb008('0x1b'));var client=jayson[_0xb008('0x1c')][_0xb008('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x41f532,_0x2ef879,_0x3885e3){if(_0x3885e3){var _0x13ed41=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13ed41['test'](_0x2ef879)){return _0x41f532;}else{throw new db[(_0xb008('0x1e'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x41f532;}}function respondWithRpcPromise(_0x502155,_0x33c31b,_0x5b8cf7,_0xd4df1f){return new BPromise(function(_0x161c36,_0xa770bb){var _0x514425=_0xd4df1f||client;return _0x514425['request'](_0x502155,_0x5b8cf7)[_0xb008('0x1f')](function(_0x1ca64b){logger[_0xb008('0x20')](_0xb008('0x21'),_0x33c31b,_0xb008('0x22'));logger[_0xb008('0x23')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x33c31b,'request\x20sent',JSON[_0xb008('0x24')](_0x1ca64b));if(_0x1ca64b[_0xb008('0x25')]){if(_0x1ca64b[_0xb008('0x25')][_0xb008('0x26')]===0x1f4){logger['error'](_0xb008('0x21'),_0x33c31b,_0x1ca64b['error'][_0xb008('0x27')]);return _0xa770bb(_0x1ca64b[_0xb008('0x25')][_0xb008('0x27')]);}logger['error'](_0xb008('0x21'),_0x33c31b,_0x1ca64b['error'][_0xb008('0x27')]);return _0x161c36(_0x1ca64b[_0xb008('0x25')][_0xb008('0x27')]);}else{logger[_0xb008('0x20')]('DeskAccount,\x20%s,\x20%s',_0x33c31b,_0xb008('0x22'));_0x161c36(_0x1ca64b[_0xb008('0x28')][_0xb008('0x27')]);}})['catch'](function(_0xd2cb86){logger[_0xb008('0x25')](_0xb008('0x21'),_0x33c31b,_0xd2cb86);_0xa770bb(_0xd2cb86);});});}function respondWithStatusCode(_0x391e0c,_0x5e6723){_0x5e6723=_0x5e6723||0xcc;return function(_0x13655d){if(_0x13655d){return _0x391e0c[_0xb008('0x29')](_0x5e6723);}return _0x391e0c[_0xb008('0x2a')](_0x5e6723)[_0xb008('0x2b')]();};}function respondWithResult(_0x518446,_0x572caf){_0x572caf=_0x572caf||0xc8;return function(_0x54f297){if(_0x54f297){return _0x518446['status'](_0x572caf)[_0xb008('0x2c')](_0x54f297);}};}function respondWithFilteredResult(_0x42ca39,_0x19c624){return function(_0x51d106){if(_0x51d106){var _0x449a19=_0x51d106[_0xb008('0x2d')],_0x4b696e=_0x19c624['offset'],_0x492150=_0x19c624[_0xb008('0x2e')]+_0x19c624[_0xb008('0x2f')],_0xe0d130;if(_0x492150>=_0x449a19){_0x492150=_0x449a19;_0xe0d130=0xc8;}else{_0xe0d130=0xce;}_0x42ca39[_0xb008('0x2a')](_0xe0d130);return _0x42ca39[_0xb008('0x30')](_0xb008('0x31'),_0x4b696e+'-'+_0x492150+'/'+_0x449a19)[_0xb008('0x2c')](_0x51d106);}return null;};}function patchUpdates(_0x2df8cf){return function(_0x44742f){try{jsonpatch['apply'](_0x44742f,_0x2df8cf,!![]);}catch(_0x262f15){return BPromise['reject'](_0x262f15);}return _0x44742f[_0xb008('0x32')]();};}function saveUpdates(_0xfd83de,_0x1141a3){return function(_0x111d06){if(_0x111d06){return _0x111d06[_0xb008('0x33')](_0xfd83de)[_0xb008('0x1f')](function(_0x93e9a9){return _0x93e9a9;});}return null;};}function removeEntity(_0x4e7097,_0x3384a2){return function(_0x22f4df){if(_0x22f4df){return _0x22f4df[_0xb008('0x34')]()[_0xb008('0x1f')](function(){_0x4e7097['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50a38b,_0x44f1d4){return function(_0x5dab5f){if(!_0x5dab5f){_0x50a38b[_0xb008('0x29')](0x194);}return _0x5dab5f;};}function handleError(_0x47638e,_0x3893bc){_0x3893bc=_0x3893bc||0x1f4;return function(_0x1050a6){logger['error'](_0x1050a6['stack']);if(_0x1050a6['name']){delete _0x1050a6[_0xb008('0x35')];}_0x47638e[_0xb008('0x2a')](_0x3893bc)[_0xb008('0x36')](_0x1050a6);};}exports[_0xb008('0x37')]=function(_0x594241,_0x4fff75){var _0x848eba={},_0x4110ef={},_0x402362={'count':0x0,'rows':[]};var _0x2ef549=_[_0xb008('0x38')](db[_0xb008('0x39')][_0xb008('0x3a')],function(_0x3b3790){return{'name':_0x3b3790[_0xb008('0x3b')],'type':_0x3b3790[_0xb008('0x3c')][_0xb008('0x3d')]};});_0x4110ef[_0xb008('0x3e')]=_[_0xb008('0x38')](_0x2ef549,_0xb008('0x35'));_0x4110ef[_0xb008('0x3f')]=_[_0xb008('0x40')](_0x594241[_0xb008('0x3f')]);_0x4110ef[_0xb008('0x41')]=_[_0xb008('0x42')](_0x4110ef[_0xb008('0x3e')],_0x4110ef[_0xb008('0x3f')]);_0x848eba[_0xb008('0x43')]=_['intersection'](_0x4110ef[_0xb008('0x3e')],qs[_0xb008('0x44')](_0x594241[_0xb008('0x3f')][_0xb008('0x44')]));_0x848eba[_0xb008('0x43')]=_0x848eba['attributes'][_0xb008('0x45')]?_0x848eba[_0xb008('0x43')]:_0x4110ef['model'];if(!_0x594241[_0xb008('0x3f')][_0xb008('0x46')](_0xb008('0x47'))){_0x848eba[_0xb008('0x2f')]=qs[_0xb008('0x2f')](_0x594241['query'][_0xb008('0x2f')]);_0x848eba[_0xb008('0x2e')]=qs[_0xb008('0x2e')](_0x594241['query'][_0xb008('0x2e')]);}_0x848eba['order']=qs[_0xb008('0x48')](_0x594241[_0xb008('0x3f')]['sort']);_0x848eba[_0xb008('0x49')]=qs[_0xb008('0x41')](_['pick'](_0x594241[_0xb008('0x3f')],_0x4110ef[_0xb008('0x41')]),_0x2ef549);if(_0x594241[_0xb008('0x3f')]['filter']){_0x848eba[_0xb008('0x49')]=_['merge'](_0x848eba['where'],{'$or':_[_0xb008('0x38')](_0x2ef549,function(_0x38757a){if(_0x38757a[_0xb008('0x3c')]!=='VIRTUAL'){var _0x18679f={};_0x18679f[_0x38757a[_0xb008('0x35')]]={'$like':'%'+_0x594241[_0xb008('0x3f')][_0xb008('0x4a')]+'%'};return _0x18679f;}})});}_0x848eba=_[_0xb008('0x4b')]({},_0x848eba,_0x594241[_0xb008('0x4c')]);var _0x5a0f6d={'where':_0x848eba[_0xb008('0x49')]};return db[_0xb008('0x39')]['count'](_0x5a0f6d)[_0xb008('0x1f')](function(_0x263cf8){_0x402362[_0xb008('0x2d')]=_0x263cf8;if(_0x594241[_0xb008('0x3f')]['includeAll']){_0x848eba[_0xb008('0x4d')]=[{'all':!![]}];}return db[_0xb008('0x39')]['findAll'](_0x848eba);})[_0xb008('0x1f')](function(_0x2dcc26){_0x402362[_0xb008('0x4e')]=_0x2dcc26;return _0x402362;})[_0xb008('0x1f')](respondWithFilteredResult(_0x4fff75,_0x848eba))[_0xb008('0x4f')](handleError(_0x4fff75,null));};exports[_0xb008('0x50')]=function(_0x2fd3e7,_0x27f162){var _0x50f2c7={'raw':![],'where':{'id':_0x2fd3e7[_0xb008('0x51')]['id']}},_0x193e7c={};_0x193e7c[_0xb008('0x3e')]=_[_0xb008('0x40')](db[_0xb008('0x39')][_0xb008('0x3a')]);_0x193e7c[_0xb008('0x3f')]=_[_0xb008('0x40')](_0x2fd3e7[_0xb008('0x3f')]);_0x193e7c[_0xb008('0x41')]=_[_0xb008('0x42')](_0x193e7c[_0xb008('0x3e')],_0x193e7c[_0xb008('0x3f')]);_0x50f2c7[_0xb008('0x43')]=_[_0xb008('0x42')](_0x193e7c[_0xb008('0x3e')],qs['fields'](_0x2fd3e7[_0xb008('0x3f')][_0xb008('0x44')]));_0x50f2c7[_0xb008('0x43')]=_0x50f2c7['attributes']['length']?_0x50f2c7[_0xb008('0x43')]:_0x193e7c['model'];if(_0x2fd3e7[_0xb008('0x3f')]['includeAll']){_0x50f2c7['include']=[{'all':!![]}];}_0x50f2c7=_[_0xb008('0x4b')]({},_0x50f2c7,_0x2fd3e7['options']);return db['DeskAccount']['find'](_0x50f2c7)[_0xb008('0x1f')](handleEntityNotFound(_0x27f162,null))['then'](respondWithResult(_0x27f162,null))[_0xb008('0x4f')](handleError(_0x27f162,null));};exports['create']=function(_0x4ee02f,_0x345696){return db[_0xb008('0x39')][_0xb008('0x52')](_0x4ee02f[_0xb008('0x53')],{})[_0xb008('0x1f')](respondWithResult(_0x345696,0xc9))[_0xb008('0x4f')](handleError(_0x345696,null));};exports[_0xb008('0x33')]=function(_0x1efdb9,_0x26eb6d){if(_0x1efdb9['body']['id']){delete _0x1efdb9[_0xb008('0x53')]['id'];}return db[_0xb008('0x39')][_0xb008('0x54')]({'where':{'id':_0x1efdb9[_0xb008('0x51')]['id']}})[_0xb008('0x1f')](handleEntityNotFound(_0x26eb6d,null))[_0xb008('0x1f')](saveUpdates(_0x1efdb9[_0xb008('0x53')],null))[_0xb008('0x1f')](respondWithResult(_0x26eb6d,null))[_0xb008('0x4f')](handleError(_0x26eb6d,null));};exports[_0xb008('0x34')]=function(_0x53a28d,_0x4432dd){return db[_0xb008('0x39')][_0xb008('0x54')]({'where':{'id':_0x53a28d['params']['id']}})[_0xb008('0x1f')](handleEntityNotFound(_0x4432dd,null))[_0xb008('0x1f')](removeEntity(_0x4432dd,null))[_0xb008('0x4f')](handleError(_0x4432dd,null));};exports[_0xb008('0x55')]=function(_0xa503b3,_0x3dec13,_0x13fb6a){var _0x2cc9a3={};var _0x50ebf3={};var _0x5dce29;var _0x32ad2c;return db[_0xb008('0x39')][_0xb008('0x56')]({'where':{'id':_0xa503b3[_0xb008('0x51')]['id']}})[_0xb008('0x1f')](handleEntityNotFound(_0x3dec13,null))['then'](function(_0x54e3bc){if(_0x54e3bc){_0x5dce29=_0x54e3bc;_0x50ebf3[_0xb008('0x3e')]=_[_0xb008('0x40')](db[_0xb008('0x57')][_0xb008('0x3a')]);_0x50ebf3[_0xb008('0x3f')]=_[_0xb008('0x40')](_0xa503b3[_0xb008('0x3f')]);_0x50ebf3[_0xb008('0x41')]=_[_0xb008('0x42')](_0x50ebf3[_0xb008('0x3e')],_0x50ebf3[_0xb008('0x3f')]);_0x2cc9a3[_0xb008('0x43')]=_['intersection'](_0x50ebf3[_0xb008('0x3e')],qs['fields'](_0xa503b3[_0xb008('0x3f')][_0xb008('0x44')]));_0x2cc9a3['attributes']=_0x2cc9a3[_0xb008('0x43')][_0xb008('0x45')]?_0x2cc9a3['attributes']:_0x50ebf3[_0xb008('0x3e')];_0x2cc9a3['order']=qs[_0xb008('0x48')](_0xa503b3['query'][_0xb008('0x48')]);_0x2cc9a3[_0xb008('0x49')]=qs['filters'](_['pick'](_0xa503b3[_0xb008('0x3f')],_0x50ebf3[_0xb008('0x41')]));if(_0xa503b3[_0xb008('0x3f')][_0xb008('0x4a')]){_0x2cc9a3[_0xb008('0x49')]=_[_0xb008('0x4b')](_0x2cc9a3[_0xb008('0x49')],{'$or':_[_0xb008('0x38')](_0x2cc9a3[_0xb008('0x43')],function(_0xd0c530){var _0x43ba73={};_0x43ba73[_0xd0c530]={'$like':'%'+_0xa503b3[_0xb008('0x3f')]['filter']+'%'};return _0x43ba73;})});}_0x2cc9a3=_[_0xb008('0x4b')]({},_0x2cc9a3,_0xa503b3[_0xb008('0x4c')]);return _0x5dce29[_0xb008('0x55')](_0x2cc9a3);}})['then'](function(_0x2cc1bf){if(_0x2cc1bf){_0x32ad2c=_0x2cc1bf['length'];if(!_0xa503b3[_0xb008('0x3f')][_0xb008('0x46')](_0xb008('0x47'))){_0x2cc9a3['limit']=qs[_0xb008('0x2f')](_0xa503b3[_0xb008('0x3f')][_0xb008('0x2f')]);_0x2cc9a3[_0xb008('0x2e')]=qs['offset'](_0xa503b3[_0xb008('0x3f')][_0xb008('0x2e')]);}return _0x5dce29[_0xb008('0x55')](_0x2cc9a3);}})[_0xb008('0x1f')](function(_0x212521){if(_0x212521){return _0x212521?{'count':_0x32ad2c,'rows':_0x212521}:null;}})[_0xb008('0x1f')](respondWithResult(_0x3dec13,null))['catch'](handleError(_0x3dec13,null));};exports[_0xb008('0x58')]=function(_0x416649,_0x3c5ceb,_0x6c82d){if(_0x416649[_0xb008('0x53')]['id']){delete _0x416649['body']['id'];}return db['DeskAccount'][_0xb008('0x56')]({'where':{'id':_0x416649[_0xb008('0x51')]['id']}})[_0xb008('0x1f')](handleEntityNotFound(_0x3c5ceb,null))[_0xb008('0x1f')](function(_0x157273){if(_0x157273){_0x416649[_0xb008('0x53')]['AccountId']=_0x157273['id'];_0x416649[_0xb008('0x53')][_0xb008('0x59')]=integrations['getSubjects'](_0x416649[_0xb008('0x53')][_0xb008('0x5a')],_0x416649[_0xb008('0x53')][_0xb008('0x3c')]);_0x416649['body'][_0xb008('0x5b')]=integrations['getDescriptions'](_0x416649[_0xb008('0x53')][_0xb008('0x5a')],_0x416649[_0xb008('0x53')][_0xb008('0x3c')]);return db[_0xb008('0x57')]['create'](_0x416649['body'],{'include':[{'model':db[_0xb008('0x5c')],'as':_0xb008('0x59')},{'model':db[_0xb008('0x5c')],'as':_0xb008('0x5b')}]});}return null;})['then'](respondWithResult(_0x3c5ceb,null))[_0xb008('0x4f')](handleError(_0x3c5ceb,null));};exports[_0xb008('0x5d')]=function(_0x10a49a,_0x50c754,_0x4e9fb8){var _0x41a676=[{'name':'priority','label':_0xb008('0x5e'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x53e5bf='';return db[_0xb008('0x39')][_0xb008('0x56')]({'where':{'id':_0x10a49a[_0xb008('0x51')]['id']},'attributes':['id','remoteUri',_0xb008('0x5f'),_0xb008('0x60'),_0xb008('0x61'),'consumerKey',_0xb008('0x62'),_0xb008('0x63'),_0xb008('0x64')]})[_0xb008('0x1f')](handleEntityNotFound(_0x50c754,null))[_0xb008('0x1f')](function(_0x5e820e){if(_0x5e820e){_0x53e5bf=_0x5e820e[_0xb008('0x65')];var _0x134603=_0x53e5bf[_0xb008('0x66')](-0x1);if(_0x134603==='/'){_0x53e5bf=_0x53e5bf['substring'](0x0,_0x53e5bf[_0xb008('0x67')](_0x134603));}var _0x3df177={'method':_0xb008('0x68'),'uri':util[_0xb008('0x69')](_0xb008('0x6a'),_0x53e5bf),'headers':{'Content-Type':_0xb008('0x6b'),'Accept':'application/json'},'json':!![]};if(_0x5e820e[_0xb008('0x5f')]==='basic'){_0x3df177[_0xb008('0x6c')]['Authorization']=util[_0xb008('0x69')](_0xb008('0x6d'),new Buffer(util[_0xb008('0x69')]('%s:%s',_0x5e820e[_0xb008('0x60')],_0x5e820e[_0xb008('0x61')]))[_0xb008('0x6e')]('base64'));}return rp(_0x3df177)[_0xb008('0x1f')](function(_0x1f0a8a){return _0x41a676['concat'](_['map'](_0x1f0a8a[_0xb008('0x6f')][_0xb008('0x70')],function(_0x31b787){return{'id':_0x31b787[_0xb008('0x35')],'name':_0x31b787[_0xb008('0x35')],'type':_0x31b787[_0xb008('0x3c')],'active':_0x31b787[_0xb008('0x71')],'label':_0x31b787[_0xb008('0x72')],'custom':!![]};}));});}})[_0xb008('0x1f')](function(_0x16daa6){return{'count':_0x16daa6[_0xb008('0x45')],'rows':_0x16daa6};})[_0xb008('0x1f')](respondWithResult(_0x50c754,null))[_0xb008('0x4f')](function(_0x459630){var _0x1111a1=_0x10a49a['query']['test']?0x1f4:_0x459630[_0xb008('0x73')]||0x1f4;logger[_0xb008('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xb008('0x5d'),_0x1111a1,JSON[_0xb008('0x24')](_0x459630));delete _0x459630[_0xb008('0x35')];if(_0x1111a1===0x191){_0x1111a1=0x190;}_0x50c754['status'](_0x1111a1)[_0xb008('0x36')](_0x10a49a[_0xb008('0x3f')][_0xb008('0x74')]?{'message':_0xb008('0x75'),'statusCode':_0x459630[_0xb008('0x73')]}:_0x459630);});};
\ No newline at end of file
+var _0x6be9=['sendStatus','stack','name','send','index','map','DeskAccount','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','length','create','body','update','find','destroy','params','getConfigurations','findOne','keys','DeskConfiguration','rawAttributes','nolimit','addConfiguration','AccountId','Subjects','channel','DeskField','Descriptions','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','substring','GET','application/json','headers','Authorization','format','toString','base64','concat','_embedded','entries','label','statusCode','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x5488c0,_0x567595){var _0x51bfda=function(_0x3ca80e){while(--_0x3ca80e){_0x5488c0['push'](_0x5488c0['shift']());}};_0x51bfda(++_0x567595);}(_0x6be9,0xc7));var _0x96be=function(_0x13edea,_0x571f13){_0x13edea=_0x13edea-0x0;var _0x58500b=_0x6be9[_0x13edea];return _0x58500b;};'use strict';var pdf=require(_0x96be('0x0'));var emlformat=require(_0x96be('0x1'));var rimraf=require(_0x96be('0x2'));var zipdir=require(_0x96be('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96be('0x4'));var moment=require(_0x96be('0x5'));var BPromise=require(_0x96be('0x6'));var Mustache=require(_0x96be('0x7'));var util=require(_0x96be('0x8'));var path=require(_0x96be('0x9'));var sox=require(_0x96be('0xa'));var csv=require(_0x96be('0xb'));var ejs=require(_0x96be('0xc'));var fs=require('fs');var _=require(_0x96be('0xd'));var squel=require(_0x96be('0xe'));var crypto=require(_0x96be('0xf'));var jsforce=require(_0x96be('0x10'));var deskjs=require(_0x96be('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96be('0x12'));var Redis=require(_0x96be('0x13'));var authService=require(_0x96be('0x14'));var qs=require(_0x96be('0x15'));var as=require(_0x96be('0x16'));var hardwareService=require(_0x96be('0x17'));var logger=require(_0x96be('0x18'))(_0x96be('0x19'));var utils=require(_0x96be('0x1a'));var config=require(_0x96be('0x1b'));var db=require(_0x96be('0x1c'))['db'];var integrations=require(_0x96be('0x1d'));var jayson=require('jayson/promise');var client=jayson['client'][_0x96be('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3177a9,_0x351aef,_0x16344d){if(_0x16344d){var _0x25e73f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25e73f[_0x96be('0x1f')](_0x351aef)){return _0x3177a9;}else{throw new db[(_0x96be('0x20'))][(_0x96be('0x21'))](_0x96be('0x22'));}}else{return _0x3177a9;}}function respondWithRpcPromise(_0x1803ee,_0x3d5d04,_0x42b48b,_0x3a7475){return new BPromise(function(_0x154884,_0x3736bc){var _0x1835fd=_0x3a7475||client;return _0x1835fd[_0x96be('0x23')](_0x1803ee,_0x42b48b)[_0x96be('0x24')](function(_0x52c5f7){logger[_0x96be('0x25')](_0x96be('0x26'),_0x3d5d04,'request\x20sent');logger[_0x96be('0x27')](_0x96be('0x28'),_0x3d5d04,_0x96be('0x29'),JSON[_0x96be('0x2a')](_0x52c5f7));if(_0x52c5f7['error']){if(_0x52c5f7[_0x96be('0x2b')][_0x96be('0x2c')]===0x1f4){logger[_0x96be('0x2b')]('DeskAccount,\x20%s,\x20%s',_0x3d5d04,_0x52c5f7[_0x96be('0x2b')][_0x96be('0x2d')]);return _0x3736bc(_0x52c5f7[_0x96be('0x2b')][_0x96be('0x2d')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x3d5d04,_0x52c5f7[_0x96be('0x2b')]['message']);return _0x154884(_0x52c5f7[_0x96be('0x2b')][_0x96be('0x2d')]);}else{logger[_0x96be('0x25')](_0x96be('0x26'),_0x3d5d04,_0x96be('0x29'));_0x154884(_0x52c5f7[_0x96be('0x2e')][_0x96be('0x2d')]);}})[_0x96be('0x2f')](function(_0x10f876){logger[_0x96be('0x2b')](_0x96be('0x26'),_0x3d5d04,_0x10f876);_0x3736bc(_0x10f876);});});}function respondWithStatusCode(_0x57a3ea,_0x2993f2){_0x2993f2=_0x2993f2||0xcc;return function(_0x144d3b){if(_0x144d3b){return _0x57a3ea['sendStatus'](_0x2993f2);}return _0x57a3ea[_0x96be('0x30')](_0x2993f2)[_0x96be('0x31')]();};}function respondWithResult(_0x46027b,_0x4cca5f){_0x4cca5f=_0x4cca5f||0xc8;return function(_0x410432){if(_0x410432){return _0x46027b[_0x96be('0x30')](_0x4cca5f)[_0x96be('0x32')](_0x410432);}};}function respondWithFilteredResult(_0x15c752,_0x21b108){return function(_0x55c14b){if(_0x55c14b){var _0x3d1bfc=_0x55c14b[_0x96be('0x33')],_0x42db60=_0x21b108[_0x96be('0x34')],_0x465fb3=_0x21b108['offset']+_0x21b108[_0x96be('0x35')],_0x40b6a0;if(_0x465fb3>=_0x3d1bfc){_0x465fb3=_0x3d1bfc;_0x40b6a0=0xc8;}else{_0x40b6a0=0xce;}_0x15c752[_0x96be('0x30')](_0x40b6a0);return _0x15c752[_0x96be('0x36')](_0x96be('0x37'),_0x42db60+'-'+_0x465fb3+'/'+_0x3d1bfc)['json'](_0x55c14b);}return null;};}function patchUpdates(_0x1703ed){return function(_0x4c5318){try{jsonpatch[_0x96be('0x38')](_0x4c5318,_0x1703ed,!![]);}catch(_0x5decf5){return BPromise[_0x96be('0x39')](_0x5decf5);}return _0x4c5318[_0x96be('0x3a')]();};}function saveUpdates(_0x3b3936,_0x443c2d){return function(_0x10d8fc){if(_0x10d8fc){return _0x10d8fc['update'](_0x3b3936)[_0x96be('0x24')](function(_0x1ce924){return _0x1ce924;});}return null;};}function removeEntity(_0x14fb67,_0x22ac40){return function(_0x10065b){if(_0x10065b){return _0x10065b['destroy']()[_0x96be('0x24')](function(){_0x14fb67[_0x96be('0x30')](0xcc)[_0x96be('0x31')]();});}};}function handleEntityNotFound(_0x2444f0,_0xc6fedf){return function(_0x1e1cdc){if(!_0x1e1cdc){_0x2444f0[_0x96be('0x3b')](0x194);}return _0x1e1cdc;};}function handleError(_0x5deafd,_0x149e9){_0x149e9=_0x149e9||0x1f4;return function(_0x204957){logger[_0x96be('0x2b')](_0x204957[_0x96be('0x3c')]);if(_0x204957[_0x96be('0x3d')]){delete _0x204957['name'];}_0x5deafd[_0x96be('0x30')](_0x149e9)[_0x96be('0x3e')](_0x204957);};}exports[_0x96be('0x3f')]=function(_0xd7aa44,_0x44423){var _0x219a57={},_0x502a55={},_0x5c5c38={'count':0x0,'rows':[]};var _0x119620=_[_0x96be('0x40')](db[_0x96be('0x41')]['rawAttributes'],function(_0x1b9312){return{'name':_0x1b9312[_0x96be('0x42')],'type':_0x1b9312['type'][_0x96be('0x43')]};});_0x502a55[_0x96be('0x44')]=_[_0x96be('0x40')](_0x119620,_0x96be('0x3d'));_0x502a55[_0x96be('0x45')]=_['keys'](_0xd7aa44[_0x96be('0x45')]);_0x502a55['filters']=_[_0x96be('0x46')](_0x502a55[_0x96be('0x44')],_0x502a55[_0x96be('0x45')]);_0x219a57['attributes']=_[_0x96be('0x46')](_0x502a55[_0x96be('0x44')],qs['fields'](_0xd7aa44[_0x96be('0x45')][_0x96be('0x47')]));_0x219a57[_0x96be('0x48')]=_0x219a57['attributes']['length']?_0x219a57['attributes']:_0x502a55[_0x96be('0x44')];if(!_0xd7aa44[_0x96be('0x45')][_0x96be('0x49')]('nolimit')){_0x219a57[_0x96be('0x35')]=qs['limit'](_0xd7aa44[_0x96be('0x45')][_0x96be('0x35')]);_0x219a57[_0x96be('0x34')]=qs[_0x96be('0x34')](_0xd7aa44[_0x96be('0x45')][_0x96be('0x34')]);}_0x219a57[_0x96be('0x4a')]=qs['sort'](_0xd7aa44[_0x96be('0x45')][_0x96be('0x4b')]);_0x219a57[_0x96be('0x4c')]=qs[_0x96be('0x4d')](_[_0x96be('0x4e')](_0xd7aa44[_0x96be('0x45')],_0x502a55[_0x96be('0x4d')]),_0x119620);if(_0xd7aa44['query'][_0x96be('0x4f')]){_0x219a57[_0x96be('0x4c')]=_[_0x96be('0x50')](_0x219a57[_0x96be('0x4c')],{'$or':_[_0x96be('0x40')](_0x119620,function(_0x513f66){if(_0x513f66[_0x96be('0x51')]!==_0x96be('0x52')){var _0xd2374d={};_0xd2374d[_0x513f66[_0x96be('0x3d')]]={'$like':'%'+_0xd7aa44[_0x96be('0x45')][_0x96be('0x4f')]+'%'};return _0xd2374d;}})});}_0x219a57=_[_0x96be('0x50')]({},_0x219a57,_0xd7aa44[_0x96be('0x53')]);var _0x1dcc6f={'where':_0x219a57[_0x96be('0x4c')]};return db['DeskAccount']['count'](_0x1dcc6f)[_0x96be('0x24')](function(_0x484896){_0x5c5c38[_0x96be('0x33')]=_0x484896;if(_0xd7aa44[_0x96be('0x45')][_0x96be('0x54')]){_0x219a57[_0x96be('0x55')]=[{'all':!![]}];}return db['DeskAccount'][_0x96be('0x56')](_0x219a57);})[_0x96be('0x24')](function(_0x140924){_0x5c5c38[_0x96be('0x57')]=_0x140924;return _0x5c5c38;})[_0x96be('0x24')](respondWithFilteredResult(_0x44423,_0x219a57))[_0x96be('0x2f')](handleError(_0x44423,null));};exports['show']=function(_0x521b51,_0x1d33db){var _0x400a8c={'raw':![],'where':{'id':_0x521b51['params']['id']}},_0x120bcd={};_0x120bcd[_0x96be('0x44')]=_['keys'](db['DeskAccount']['rawAttributes']);_0x120bcd['query']=_['keys'](_0x521b51[_0x96be('0x45')]);_0x120bcd[_0x96be('0x4d')]=_[_0x96be('0x46')](_0x120bcd['model'],_0x120bcd[_0x96be('0x45')]);_0x400a8c[_0x96be('0x48')]=_[_0x96be('0x46')](_0x120bcd[_0x96be('0x44')],qs[_0x96be('0x47')](_0x521b51[_0x96be('0x45')]['fields']));_0x400a8c[_0x96be('0x48')]=_0x400a8c['attributes'][_0x96be('0x58')]?_0x400a8c[_0x96be('0x48')]:_0x120bcd['model'];if(_0x521b51[_0x96be('0x45')][_0x96be('0x54')]){_0x400a8c[_0x96be('0x55')]=[{'all':!![]}];}_0x400a8c=_[_0x96be('0x50')]({},_0x400a8c,_0x521b51[_0x96be('0x53')]);return db[_0x96be('0x41')]['find'](_0x400a8c)[_0x96be('0x24')](handleEntityNotFound(_0x1d33db,null))[_0x96be('0x24')](respondWithResult(_0x1d33db,null))[_0x96be('0x2f')](handleError(_0x1d33db,null));};exports[_0x96be('0x59')]=function(_0x2bf879,_0x7ed5f){return db['DeskAccount']['create'](_0x2bf879[_0x96be('0x5a')],{})[_0x96be('0x24')](respondWithResult(_0x7ed5f,0xc9))[_0x96be('0x2f')](handleError(_0x7ed5f,null));};exports[_0x96be('0x5b')]=function(_0x37fee1,_0xd18f9c){if(_0x37fee1[_0x96be('0x5a')]['id']){delete _0x37fee1[_0x96be('0x5a')]['id'];}return db[_0x96be('0x41')][_0x96be('0x5c')]({'where':{'id':_0x37fee1['params']['id']}})[_0x96be('0x24')](handleEntityNotFound(_0xd18f9c,null))['then'](saveUpdates(_0x37fee1[_0x96be('0x5a')],null))[_0x96be('0x24')](respondWithResult(_0xd18f9c,null))['catch'](handleError(_0xd18f9c,null));};exports[_0x96be('0x5d')]=function(_0x5351ad,_0x138056){return db['DeskAccount'][_0x96be('0x5c')]({'where':{'id':_0x5351ad[_0x96be('0x5e')]['id']}})['then'](handleEntityNotFound(_0x138056,null))[_0x96be('0x24')](removeEntity(_0x138056,null))[_0x96be('0x2f')](handleError(_0x138056,null));};exports[_0x96be('0x5f')]=function(_0x12cc0,_0x35fe3f,_0x36dbda){var _0x22cfeb={};var _0x1faee3={};var _0x2cbdac;var _0x5bc629;return db['DeskAccount'][_0x96be('0x60')]({'where':{'id':_0x12cc0['params']['id']}})[_0x96be('0x24')](handleEntityNotFound(_0x35fe3f,null))[_0x96be('0x24')](function(_0x4c705a){if(_0x4c705a){_0x2cbdac=_0x4c705a;_0x1faee3[_0x96be('0x44')]=_[_0x96be('0x61')](db[_0x96be('0x62')][_0x96be('0x63')]);_0x1faee3[_0x96be('0x45')]=_['keys'](_0x12cc0[_0x96be('0x45')]);_0x1faee3[_0x96be('0x4d')]=_[_0x96be('0x46')](_0x1faee3[_0x96be('0x44')],_0x1faee3[_0x96be('0x45')]);_0x22cfeb[_0x96be('0x48')]=_['intersection'](_0x1faee3[_0x96be('0x44')],qs[_0x96be('0x47')](_0x12cc0[_0x96be('0x45')]['fields']));_0x22cfeb['attributes']=_0x22cfeb['attributes'][_0x96be('0x58')]?_0x22cfeb[_0x96be('0x48')]:_0x1faee3[_0x96be('0x44')];_0x22cfeb['order']=qs[_0x96be('0x4b')](_0x12cc0[_0x96be('0x45')][_0x96be('0x4b')]);_0x22cfeb[_0x96be('0x4c')]=qs[_0x96be('0x4d')](_[_0x96be('0x4e')](_0x12cc0['query'],_0x1faee3[_0x96be('0x4d')]));if(_0x12cc0['query'][_0x96be('0x4f')]){_0x22cfeb['where']=_[_0x96be('0x50')](_0x22cfeb[_0x96be('0x4c')],{'$or':_[_0x96be('0x40')](_0x22cfeb[_0x96be('0x48')],function(_0x285e38){var _0x3d2e35={};_0x3d2e35[_0x285e38]={'$like':'%'+_0x12cc0[_0x96be('0x45')][_0x96be('0x4f')]+'%'};return _0x3d2e35;})});}_0x22cfeb=_[_0x96be('0x50')]({},_0x22cfeb,_0x12cc0['options']);return _0x2cbdac[_0x96be('0x5f')](_0x22cfeb);}})[_0x96be('0x24')](function(_0x57dd64){if(_0x57dd64){_0x5bc629=_0x57dd64[_0x96be('0x58')];if(!_0x12cc0[_0x96be('0x45')][_0x96be('0x49')](_0x96be('0x64'))){_0x22cfeb[_0x96be('0x35')]=qs[_0x96be('0x35')](_0x12cc0[_0x96be('0x45')][_0x96be('0x35')]);_0x22cfeb['offset']=qs['offset'](_0x12cc0[_0x96be('0x45')][_0x96be('0x34')]);}return _0x2cbdac[_0x96be('0x5f')](_0x22cfeb);}})[_0x96be('0x24')](function(_0xef4a5a){if(_0xef4a5a){return _0xef4a5a?{'count':_0x5bc629,'rows':_0xef4a5a}:null;}})['then'](respondWithResult(_0x35fe3f,null))[_0x96be('0x2f')](handleError(_0x35fe3f,null));};exports[_0x96be('0x65')]=function(_0x201c57,_0x3e9713,_0x3feb75){if(_0x201c57['body']['id']){delete _0x201c57['body']['id'];}return db[_0x96be('0x41')][_0x96be('0x60')]({'where':{'id':_0x201c57['params']['id']}})['then'](handleEntityNotFound(_0x3e9713,null))[_0x96be('0x24')](function(_0x4c78d8){if(_0x4c78d8){_0x201c57[_0x96be('0x5a')][_0x96be('0x66')]=_0x4c78d8['id'];_0x201c57[_0x96be('0x5a')][_0x96be('0x67')]=integrations['getSubjects'](_0x201c57[_0x96be('0x5a')][_0x96be('0x68')],_0x201c57[_0x96be('0x5a')][_0x96be('0x51')]);_0x201c57[_0x96be('0x5a')]['Descriptions']=integrations['getDescriptions'](_0x201c57[_0x96be('0x5a')][_0x96be('0x68')],_0x201c57[_0x96be('0x5a')][_0x96be('0x51')]);return db[_0x96be('0x62')]['create'](_0x201c57['body'],{'include':[{'model':db[_0x96be('0x69')],'as':_0x96be('0x67')},{'model':db[_0x96be('0x69')],'as':_0x96be('0x6a')}]});}return null;})['then'](respondWithResult(_0x3e9713,null))[_0x96be('0x2f')](handleError(_0x3e9713,null));};exports[_0x96be('0x6b')]=function(_0x474578,_0x1f5edf,_0x1498c7){var _0x3cc288=[{'name':'priority','label':_0x96be('0x6c'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3358ff='';return db['DeskAccount'][_0x96be('0x60')]({'where':{'id':_0x474578[_0x96be('0x5e')]['id']},'attributes':['id',_0x96be('0x6d'),_0x96be('0x6e'),'username',_0x96be('0x6f'),_0x96be('0x70'),_0x96be('0x71'),_0x96be('0x72'),_0x96be('0x73')]})[_0x96be('0x24')](handleEntityNotFound(_0x1f5edf,null))[_0x96be('0x24')](function(_0x36c4b9){if(_0x36c4b9){_0x3358ff=_0x36c4b9[_0x96be('0x6d')];var _0x544582=_0x3358ff['slice'](-0x1);if(_0x544582==='/'){_0x3358ff=_0x3358ff[_0x96be('0x74')](0x0,_0x3358ff['lastIndexOf'](_0x544582));}var _0x217415={'method':_0x96be('0x75'),'uri':util['format']('%s/custom_fields',_0x3358ff),'headers':{'Content-Type':'application/json','Accept':_0x96be('0x76')},'json':!![]};if(_0x36c4b9[_0x96be('0x6e')]==='basic'){_0x217415[_0x96be('0x77')][_0x96be('0x78')]=util[_0x96be('0x79')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x36c4b9['username'],_0x36c4b9[_0x96be('0x6f')]))[_0x96be('0x7a')](_0x96be('0x7b')));}return rp(_0x217415)[_0x96be('0x24')](function(_0xe5f1e7){return _0x3cc288[_0x96be('0x7c')](_[_0x96be('0x40')](_0xe5f1e7[_0x96be('0x7d')][_0x96be('0x7e')],function(_0x261a68){return{'id':_0x261a68[_0x96be('0x3d')],'name':_0x261a68[_0x96be('0x3d')],'type':_0x261a68['type'],'active':_0x261a68['active'],'label':_0x261a68[_0x96be('0x7f')],'custom':!![]};}));});}})[_0x96be('0x24')](function(_0x4b7e79){return{'count':_0x4b7e79[_0x96be('0x58')],'rows':_0x4b7e79};})[_0x96be('0x24')](respondWithResult(_0x1f5edf,null))['catch'](function(_0x3beb95){var _0x191a43=_0x474578['query'][_0x96be('0x1f')]?0x1f4:_0x3beb95['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x191a43,JSON[_0x96be('0x2a')](_0x3beb95));delete _0x3beb95[_0x96be('0x3d')];if(_0x191a43===0x191){_0x191a43=0x190;}_0x1f5edf['status'](_0x191a43)[_0x96be('0x3e')](_0x474578[_0x96be('0x45')][_0x96be('0x1f')]?{'message':'Wrong\x20credentials','statusCode':_0x3beb95[_0x96be('0x80')]}:_0x3beb95);});};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js
index bff7458..f527903 100644
--- a/server/api/intDeskAccount/intDeskAccount.model.js
+++ b/server/api/intDeskAccount/intDeskAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x612f=['request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x612f,0x19f));var _0xf612=function(_0x4082e3,_0x46da9f){_0x4082e3=_0x4082e3-0x0;var _0x523209=_0x612f[_0x4082e3];return _0x523209;};'use strict';var _=require(_0xf612('0x0'));var util=require(_0xf612('0x1'));var logger=require(_0xf612('0x2'))('api');var moment=require(_0xf612('0x3'));var BPromise=require(_0xf612('0x4'));var rp=require(_0xf612('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf612('0x6'));var config=require(_0xf612('0x7'));var attributes=require(_0xf612('0x8'));var integrations=require(_0xf612('0x9'));module['exports']=function(_0x19a7f4,_0x5b2f69){return _0x19a7f4[_0xf612('0xa')](_0xf612('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6b5=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xb6b5,0xaf));var _0x5b6b=function(_0x2186bb,_0x45f112){_0x2186bb=_0x2186bb-0x0;var _0x172957=_0xb6b5[_0x2186bb];return _0x172957;};'use strict';var _=require(_0x5b6b('0x0'));var util=require('util');var logger=require(_0x5b6b('0x1'))(_0x5b6b('0x2'));var moment=require('moment');var BPromise=require(_0x5b6b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b6b('0x4'));var rimraf=require(_0x5b6b('0x5'));var config=require(_0x5b6b('0x6'));var attributes=require(_0x5b6b('0x7'));var integrations=require(_0x5b6b('0x8'));module[_0x5b6b('0x9')]=function(_0x10d213,_0xe9b9ea){return _0x10d213[_0x5b6b('0xa')](_0x5b6b('0xb'),attributes,{'tableName':_0x5b6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js
index 516c4f8..1083cbc 100644
--- a/server/api/intDeskAccount/intDeskAccount.rpc.js
+++ b/server/api/intDeskAccount/intDeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc6aa=['error','code','message','result','catch','GetDeskAccount','DeskAccount','options','include','model','attributes','map','ShowDeskAccount','find','where','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0xc6aa,0xf7));var _0xac6a=function(_0x1dea49,_0x20ec30){_0x1dea49=_0x1dea49-0x0;var _0xada06e=_0xc6aa[_0x1dea49];return _0xada06e;};'use strict';var _=require(_0xac6a('0x0'));var util=require(_0xac6a('0x1'));var moment=require(_0xac6a('0x2'));var BPromise=require(_0xac6a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac6a('0x4'));var db=require(_0xac6a('0x5'))['db'];var utils=require(_0xac6a('0x6'));var logger=require(_0xac6a('0x7'))(_0xac6a('0x8'));var config=require('../../config/environment');var jayson=require(_0xac6a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5db799,_0xd20075,_0x4c42fd){return new BPromise(function(_0x42e574,_0x5e0369){return client[_0xac6a('0xa')](_0x5db799,_0x4c42fd)[_0xac6a('0xb')](function(_0x57c886){logger[_0xac6a('0xc')](_0xac6a('0xd'),_0xd20075,_0xac6a('0xe'));logger[_0xac6a('0xf')](_0xac6a('0x10'),_0xd20075,_0xac6a('0xe'),JSON['stringify'](_0x57c886));if(_0x57c886['error']){if(_0x57c886[_0xac6a('0x11')][_0xac6a('0x12')]===0x1f4){logger[_0xac6a('0x11')](_0xac6a('0xd'),_0xd20075,_0x57c886[_0xac6a('0x11')]['message']);return _0x5e0369(_0x57c886[_0xac6a('0x11')][_0xac6a('0x13')]);}logger['error'](_0xac6a('0xd'),_0xd20075,_0x57c886[_0xac6a('0x11')][_0xac6a('0x13')]);return _0x42e574(_0x57c886[_0xac6a('0x11')][_0xac6a('0x13')]);}else{logger[_0xac6a('0xc')](_0xac6a('0xd'),_0xd20075,'request\x20sent');_0x42e574(_0x57c886[_0xac6a('0x14')][_0xac6a('0x13')]);}})[_0xac6a('0x15')](function(_0x14f3d8){logger[_0xac6a('0x11')](_0xac6a('0xd'),_0xd20075,_0x14f3d8);_0x5e0369(_0x14f3d8);});});}exports[_0xac6a('0x16')]=function(_0x282fad){var _0xac1432=this;return new Promise(function(_0x57fdbe,_0x2bb520){return db[_0xac6a('0x17')]['findAll']({'raw':_0x282fad[_0xac6a('0x18')]?_0x282fad['options']['raw']===undefined?!![]:![]:!![],'where':_0x282fad[_0xac6a('0x18')]?_0x282fad[_0xac6a('0x18')]['where']||null:null,'attributes':_0x282fad[_0xac6a('0x18')]?_0x282fad['options']['attributes']||null:null,'limit':_0x282fad[_0xac6a('0x18')]?_0x282fad['options']['limit']||null:null,'include':_0x282fad[_0xac6a('0x18')]?_0x282fad[_0xac6a('0x18')]['include']?_['map'](_0x282fad[_0xac6a('0x18')][_0xac6a('0x19')],function(_0x38a214){return{'model':db[_0x38a214[_0xac6a('0x1a')]],'as':_0x38a214['as'],'attributes':_0x38a214[_0xac6a('0x1b')],'include':_0x38a214[_0xac6a('0x19')]?_[_0xac6a('0x1c')](_0x38a214[_0xac6a('0x19')],function(_0x577846){return{'model':db[_0x577846[_0xac6a('0x1a')]],'as':_0x577846['as'],'attributes':_0x577846[_0xac6a('0x1b')],'include':_0x577846[_0xac6a('0x19')]?_[_0xac6a('0x1c')](_0x577846[_0xac6a('0x19')],function(_0x3649a6){return{'model':db[_0x3649a6[_0xac6a('0x1a')]],'as':_0x3649a6['as'],'attributes':_0x3649a6[_0xac6a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac6a('0xb')](function(_0x3c88ce){logger[_0xac6a('0xc')](_0xac6a('0x16'),_0x282fad);logger[_0xac6a('0xf')](_0xac6a('0x16'),_0x282fad,JSON['stringify'](_0x3c88ce));_0x57fdbe(_0x3c88ce);})[_0xac6a('0x15')](function(_0x32ba12){logger[_0xac6a('0x11')](_0xac6a('0x16'),_0x32ba12['message'],_0x282fad);_0x2bb520(_0xac1432[_0xac6a('0x11')](0x1f4,_0x32ba12[_0xac6a('0x13')]));});});};exports[_0xac6a('0x1d')]=function(_0x1f2c40){var _0x3bec14=this;return new Promise(function(_0x2c8fbb,_0x257c34){return db[_0xac6a('0x17')][_0xac6a('0x1e')]({'raw':_0x1f2c40[_0xac6a('0x18')]?_0x1f2c40[_0xac6a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1f2c40['options']?_0x1f2c40[_0xac6a('0x18')][_0xac6a('0x1f')]||null:null,'attributes':_0x1f2c40['options']?_0x1f2c40[_0xac6a('0x18')][_0xac6a('0x1b')]||null:null,'include':_0x1f2c40['options']?_0x1f2c40[_0xac6a('0x18')][_0xac6a('0x19')]?_[_0xac6a('0x1c')](_0x1f2c40['options']['include'],function(_0x4e2dce){return{'model':db[_0x4e2dce[_0xac6a('0x1a')]],'as':_0x4e2dce['as'],'attributes':_0x4e2dce[_0xac6a('0x1b')],'include':_0x4e2dce[_0xac6a('0x19')]?_[_0xac6a('0x1c')](_0x4e2dce[_0xac6a('0x19')],function(_0xc37248){return{'model':db[_0xc37248[_0xac6a('0x1a')]],'as':_0xc37248['as'],'attributes':_0xc37248[_0xac6a('0x1b')],'include':_0xc37248[_0xac6a('0x19')]?_['map'](_0xc37248['include'],function(_0x305914){return{'model':db[_0x305914[_0xac6a('0x1a')]],'as':_0x305914['as'],'attributes':_0x305914[_0xac6a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac6a('0xb')](function(_0x4d794d){logger[_0xac6a('0xc')](_0xac6a('0x1d'),_0x1f2c40);logger[_0xac6a('0xf')]('ShowDeskAccount',_0x1f2c40,JSON[_0xac6a('0x20')](_0x4d794d));_0x2c8fbb(_0x4d794d);})[_0xac6a('0x15')](function(_0x479906){logger[_0xac6a('0x11')](_0xac6a('0x1d'),_0x479906['message'],_0x1f2c40);_0x257c34(_0x3bec14[_0xac6a('0x11')](0x1f4,_0x479906[_0xac6a('0x13')]));});});};
\ No newline at end of file
+var _0x7671=['randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','request\x20sent','debug','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','map','include','model','attributes','ShowDeskAccount','find','lodash','util','bluebird'];(function(_0x2cb4c3,_0x45c7c2){var _0x6c4667=function(_0x102fc2){while(--_0x102fc2){_0x2cb4c3['push'](_0x2cb4c3['shift']());}};_0x6c4667(++_0x45c7c2);}(_0x7671,0x85));var _0x1767=function(_0x5f1c59,_0x3fff4c){_0x5f1c59=_0x5f1c59-0x0;var _0xbfb242=_0x7671[_0x5f1c59];return _0xbfb242;};'use strict';var _=require(_0x1767('0x0'));var util=require(_0x1767('0x1'));var moment=require('moment');var BPromise=require(_0x1767('0x2'));var rs=require(_0x1767('0x3'));var fs=require('fs');var Redis=require(_0x1767('0x4'));var db=require(_0x1767('0x5'))['db'];var utils=require(_0x1767('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1767('0x7')][_0x1767('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x336f6f,_0x479066,_0x169742){return new BPromise(function(_0x50088e,_0x4b07ca){return client[_0x1767('0x9')](_0x336f6f,_0x169742)[_0x1767('0xa')](function(_0x2bd364){logger[_0x1767('0xb')]('DeskAccount,\x20%s,\x20%s',_0x479066,_0x1767('0xc'));logger[_0x1767('0xd')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x479066,'request\x20sent',JSON[_0x1767('0xe')](_0x2bd364));if(_0x2bd364[_0x1767('0xf')]){if(_0x2bd364[_0x1767('0xf')][_0x1767('0x10')]===0x1f4){logger[_0x1767('0xf')](_0x1767('0x11'),_0x479066,_0x2bd364[_0x1767('0xf')][_0x1767('0x12')]);return _0x4b07ca(_0x2bd364[_0x1767('0xf')][_0x1767('0x12')]);}logger[_0x1767('0xf')]('DeskAccount,\x20%s,\x20%s',_0x479066,_0x2bd364[_0x1767('0xf')]['message']);return _0x50088e(_0x2bd364['error'][_0x1767('0x12')]);}else{logger['info'](_0x1767('0x11'),_0x479066,_0x1767('0xc'));_0x50088e(_0x2bd364[_0x1767('0x13')]['message']);}})[_0x1767('0x14')](function(_0x27436b){logger[_0x1767('0xf')](_0x1767('0x11'),_0x479066,_0x27436b);_0x4b07ca(_0x27436b);});});}exports[_0x1767('0x15')]=function(_0xe70cbf){var _0x2f24ae=this;return new Promise(function(_0x103b9f,_0x34dd42){return db[_0x1767('0x16')][_0x1767('0x17')]({'raw':_0xe70cbf[_0x1767('0x18')]?_0xe70cbf[_0x1767('0x18')][_0x1767('0x19')]===undefined?!![]:![]:!![],'where':_0xe70cbf[_0x1767('0x18')]?_0xe70cbf[_0x1767('0x18')][_0x1767('0x1a')]||null:null,'attributes':_0xe70cbf[_0x1767('0x18')]?_0xe70cbf['options']['attributes']||null:null,'limit':_0xe70cbf[_0x1767('0x18')]?_0xe70cbf['options'][_0x1767('0x1b')]||null:null,'include':_0xe70cbf[_0x1767('0x18')]?_0xe70cbf['options']['include']?_[_0x1767('0x1c')](_0xe70cbf[_0x1767('0x18')][_0x1767('0x1d')],function(_0xd804ee){return{'model':db[_0xd804ee['model']],'as':_0xd804ee['as'],'attributes':_0xd804ee['attributes'],'include':_0xd804ee[_0x1767('0x1d')]?_[_0x1767('0x1c')](_0xd804ee[_0x1767('0x1d')],function(_0x55c5ed){return{'model':db[_0x55c5ed[_0x1767('0x1e')]],'as':_0x55c5ed['as'],'attributes':_0x55c5ed[_0x1767('0x1f')],'include':_0x55c5ed['include']?_[_0x1767('0x1c')](_0x55c5ed['include'],function(_0x1a1520){return{'model':db[_0x1a1520['model']],'as':_0x1a1520['as'],'attributes':_0x1a1520['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x124fb5){logger['info'](_0x1767('0x15'),_0xe70cbf);logger[_0x1767('0xd')](_0x1767('0x15'),_0xe70cbf,JSON[_0x1767('0xe')](_0x124fb5));_0x103b9f(_0x124fb5);})[_0x1767('0x14')](function(_0x176bca){logger[_0x1767('0xf')](_0x1767('0x15'),_0x176bca[_0x1767('0x12')],_0xe70cbf);_0x34dd42(_0x2f24ae[_0x1767('0xf')](0x1f4,_0x176bca[_0x1767('0x12')]));});});};exports[_0x1767('0x20')]=function(_0x55af1a){var _0x43ee00=this;return new Promise(function(_0xe55c45,_0x27b123){return db[_0x1767('0x16')][_0x1767('0x21')]({'raw':_0x55af1a[_0x1767('0x18')]?_0x55af1a['options'][_0x1767('0x19')]===undefined?!![]:![]:!![],'where':_0x55af1a[_0x1767('0x18')]?_0x55af1a['options'][_0x1767('0x1a')]||null:null,'attributes':_0x55af1a['options']?_0x55af1a[_0x1767('0x18')][_0x1767('0x1f')]||null:null,'include':_0x55af1a['options']?_0x55af1a[_0x1767('0x18')][_0x1767('0x1d')]?_['map'](_0x55af1a[_0x1767('0x18')][_0x1767('0x1d')],function(_0x4d5437){return{'model':db[_0x4d5437[_0x1767('0x1e')]],'as':_0x4d5437['as'],'attributes':_0x4d5437[_0x1767('0x1f')],'include':_0x4d5437[_0x1767('0x1d')]?_[_0x1767('0x1c')](_0x4d5437[_0x1767('0x1d')],function(_0x4379d9){return{'model':db[_0x4379d9['model']],'as':_0x4379d9['as'],'attributes':_0x4379d9[_0x1767('0x1f')],'include':_0x4379d9[_0x1767('0x1d')]?_[_0x1767('0x1c')](_0x4379d9[_0x1767('0x1d')],function(_0x46d0b8){return{'model':db[_0x46d0b8['model']],'as':_0x46d0b8['as'],'attributes':_0x46d0b8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22ba42){logger[_0x1767('0xb')](_0x1767('0x20'),_0x55af1a);logger[_0x1767('0xd')](_0x1767('0x20'),_0x55af1a,JSON[_0x1767('0xe')](_0x22ba42));_0xe55c45(_0x22ba42);})[_0x1767('0x14')](function(_0xeda4e6){logger[_0x1767('0xf')](_0x1767('0x20'),_0xeda4e6[_0x1767('0x12')],_0x55af1a);_0x27b123(_0x43ee00[_0x1767('0xf')](0x1f4,_0xeda4e6[_0x1767('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js
index a82e5c1..60e5e09 100644
--- a/server/api/intDeskConfiguration/index.js
+++ b/server/api/intDeskConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa817=['/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields'];(function(_0x132f76,_0x210b33){var _0x4d8953=function(_0x67f065){while(--_0x67f065){_0x132f76['push'](_0x132f76['shift']());}};_0x4d8953(++_0x210b33);}(_0xa817,0x7b));var _0x7a81=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0xa817[_0x574ce3];return _0x3447a0;};'use strict';var multer=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var path=require(_0x7a81('0x2'));var timeout=require(_0x7a81('0x3'));var express=require(_0x7a81('0x4'));var router=express[_0x7a81('0x5')]();var auth=require(_0x7a81('0x6'));var interaction=require(_0x7a81('0x7'));var config=require(_0x7a81('0x8'));var controller=require('./intDeskConfiguration.controller');router[_0x7a81('0x9')]('/',auth[_0x7a81('0xa')](),controller['index']);router[_0x7a81('0x9')](_0x7a81('0xb'),auth[_0x7a81('0xa')](),controller[_0x7a81('0xc')]);router[_0x7a81('0x9')](_0x7a81('0xd'),auth['isAuthenticated'](),controller[_0x7a81('0xe')]);router['get']('/:id/subjects',auth[_0x7a81('0xa')](),controller['getSubjects']);router[_0x7a81('0x9')](_0x7a81('0xf'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x10')]);router[_0x7a81('0x9')](_0x7a81('0x11'),auth[_0x7a81('0xa')](),controller['getTags']);router[_0x7a81('0x12')]('/',auth[_0x7a81('0xa')](),controller[_0x7a81('0x13')]);router['post'](_0x7a81('0x11'),auth[_0x7a81('0xa')](),controller[_0x7a81('0x14')]);router[_0x7a81('0x15')](_0x7a81('0xb'),auth[_0x7a81('0xa')](),controller['update']);router['delete'](_0x7a81('0xb'),auth[_0x7a81('0xa')](),controller['destroy']);module[_0x7a81('0x16')]=router;
\ No newline at end of file
+var _0xa46e=['multer','util','connect-timeout','express','Router','../../components/interaction/service','./intDeskConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','getTags','create','/:id/tags','setTags','put','update','delete','destroy'];(function(_0x19bf0a,_0x3e4ccf){var _0x34f9af=function(_0xde9745){while(--_0xde9745){_0x19bf0a['push'](_0x19bf0a['shift']());}};_0x34f9af(++_0x3e4ccf);}(_0xa46e,0x8a));var _0xea46=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xa46e[_0x3e2fcf];return _0x497db7;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xea46('0x5'));var config=require('../../config/environment');var controller=require(_0xea46('0x6'));router['get']('/',auth[_0xea46('0x7')](),controller['index']);router[_0xea46('0x8')](_0xea46('0x9'),auth['isAuthenticated'](),controller[_0xea46('0xa')]);router[_0xea46('0x8')](_0xea46('0xb'),auth[_0xea46('0x7')](),controller[_0xea46('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xea46('0xd')]);router[_0xea46('0x8')]('/:id/descriptions',auth[_0xea46('0x7')](),controller[_0xea46('0xe')]);router[_0xea46('0x8')]('/:id/tags',auth[_0xea46('0x7')](),controller[_0xea46('0xf')]);router['post']('/',auth[_0xea46('0x7')](),controller[_0xea46('0x10')]);router['post'](_0xea46('0x11'),auth['isAuthenticated'](),controller[_0xea46('0x12')]);router[_0xea46('0x13')](_0xea46('0x9'),auth[_0xea46('0x7')](),controller[_0xea46('0x14')]);router[_0xea46('0x15')](_0xea46('0x9'),auth[_0xea46('0x7')](),controller[_0xea46('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
index 9426b80..2893b18 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf66f=['STRING','sequelize','exports'];(function(_0x4d5376,_0x3d10c6){var _0x849db0=function(_0x316bce){while(--_0x316bce){_0x4d5376['push'](_0x4d5376['shift']());}};_0x849db0(++_0x3d10c6);}(_0xf66f,0x1f3));var _0xff66=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0xf66f[_0x548200];return _0x1a6d74;};'use strict';var Sequelize=require(_0xff66('0x0'));module[_0xff66('0x1')]={'name':{'type':Sequelize[_0xff66('0x2')]},'description':{'type':Sequelize[_0xff66('0x2')]}};
\ No newline at end of file
+var _0xffdb=['STRING','sequelize','exports'];(function(_0x460cc,_0x26b70d){var _0x731169=function(_0x39fe10){while(--_0x39fe10){_0x460cc['push'](_0x460cc['shift']());}};_0x731169(++_0x26b70d);}(_0xffdb,0x1e7));var _0xbffd=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xffdb[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0xbffd('0x0'));module[_0xbffd('0x1')]={'name':{'type':Sequelize[_0xbffd('0x2')]},'description':{'type':Sequelize[_0xbffd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
index d5ab9bd..9d724d8 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb2ef=['http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','limit','order','sort','where','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','rows','params','fields','body','find','findOne','DeskField','filter','hasOwnProperty','nolimit','getFields','getSubjects','pick','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','jayson/promise'];(function(_0x389b8d,_0x3199b3){var _0x4259c7=function(_0x30fc81){while(--_0x30fc81){_0x389b8d['push'](_0x389b8d['shift']());}};_0x4259c7(++_0x3199b3);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x20b5db,_0x4fc613){_0x20b5db=_0x20b5db-0x0;var _0x410181=_0xb2ef[_0x20b5db];return _0x410181;};'use strict';var pdf=require(_0xfb2e('0x0'));var emlformat=require(_0xfb2e('0x1'));var rimraf=require(_0xfb2e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb2e('0x3'));var rp=require(_0xfb2e('0x4'));var moment=require(_0xfb2e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfb2e('0x6'));var util=require(_0xfb2e('0x7'));var path=require(_0xfb2e('0x8'));var sox=require(_0xfb2e('0x9'));var csv=require(_0xfb2e('0xa'));var ejs=require(_0xfb2e('0xb'));var fs=require('fs');var _=require(_0xfb2e('0xc'));var squel=require(_0xfb2e('0xd'));var crypto=require(_0xfb2e('0xe'));var jsforce=require(_0xfb2e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfb2e('0xa'));var querystring=require(_0xfb2e('0x10'));var Papa=require(_0xfb2e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb2e('0x12'));var as=require(_0xfb2e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb2e('0x14'))(_0xfb2e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xfb2e('0x16'));var client=jayson['client'][_0xfb2e('0x17')]({'port':0x232a});function checkPasswordPattern(_0x8d5a90,_0x306481,_0x3ddf89){if(_0x3ddf89){var _0x3ffa17=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ffa17[_0xfb2e('0x18')](_0x306481)){return _0x8d5a90;}else{throw new db['Sequelize'][(_0xfb2e('0x19'))](_0xfb2e('0x1a'));}}else{return _0x8d5a90;}}function respondWithRpcPromise(_0x298e50,_0x363e52,_0x166b56,_0x48da9b){return new BPromise(function(_0x4b0005,_0x4d59e8){var _0x4d5607=_0x48da9b||client;return _0x4d5607[_0xfb2e('0x1b')](_0x298e50,_0x166b56)[_0xfb2e('0x1c')](function(_0x4d7f55){logger[_0xfb2e('0x1d')](_0xfb2e('0x1e'),_0x363e52,'request\x20sent');logger[_0xfb2e('0x1f')](_0xfb2e('0x20'),_0x363e52,'request\x20sent',JSON[_0xfb2e('0x21')](_0x4d7f55));if(_0x4d7f55['error']){if(_0x4d7f55['error'][_0xfb2e('0x22')]===0x1f4){logger[_0xfb2e('0x23')](_0xfb2e('0x1e'),_0x363e52,_0x4d7f55['error']['message']);return _0x4d59e8(_0x4d7f55['error'][_0xfb2e('0x24')]);}logger[_0xfb2e('0x23')](_0xfb2e('0x1e'),_0x363e52,_0x4d7f55[_0xfb2e('0x23')][_0xfb2e('0x24')]);return _0x4b0005(_0x4d7f55[_0xfb2e('0x23')][_0xfb2e('0x24')]);}else{logger[_0xfb2e('0x1d')](_0xfb2e('0x1e'),_0x363e52,_0xfb2e('0x25'));_0x4b0005(_0x4d7f55[_0xfb2e('0x26')][_0xfb2e('0x24')]);}})[_0xfb2e('0x27')](function(_0x1caafc){logger[_0xfb2e('0x23')]('DeskConfiguration,\x20%s,\x20%s',_0x363e52,_0x1caafc);_0x4d59e8(_0x1caafc);});});}function respondWithStatusCode(_0x105c17,_0x49c216){_0x49c216=_0x49c216||0xcc;return function(_0x331ee7){if(_0x331ee7){return _0x105c17[_0xfb2e('0x28')](_0x49c216);}return _0x105c17['status'](_0x49c216)['end']();};}function respondWithResult(_0x5f1950,_0x47dc1e){_0x47dc1e=_0x47dc1e||0xc8;return function(_0x227374){if(_0x227374){return _0x5f1950[_0xfb2e('0x29')](_0x47dc1e)[_0xfb2e('0x2a')](_0x227374);}};}function respondWithFilteredResult(_0x229256,_0x43cbab){return function(_0x42a80f){if(_0x42a80f){var _0x2ac1f1=_0x42a80f[_0xfb2e('0x2b')],_0x14c948=_0x43cbab[_0xfb2e('0x2c')],_0x31e8a1=_0x43cbab[_0xfb2e('0x2c')]+_0x43cbab['limit'],_0x2eef6d;if(_0x31e8a1>=_0x2ac1f1){_0x31e8a1=_0x2ac1f1;_0x2eef6d=0xc8;}else{_0x2eef6d=0xce;}_0x229256[_0xfb2e('0x29')](_0x2eef6d);return _0x229256[_0xfb2e('0x2d')](_0xfb2e('0x2e'),_0x14c948+'-'+_0x31e8a1+'/'+_0x2ac1f1)[_0xfb2e('0x2a')](_0x42a80f);}return null;};}function patchUpdates(_0xa05e59){return function(_0xd82f0f){try{jsonpatch['apply'](_0xd82f0f,_0xa05e59,!![]);}catch(_0x528d8b){return BPromise[_0xfb2e('0x2f')](_0x528d8b);}return _0xd82f0f[_0xfb2e('0x30')]();};}function saveUpdates(_0x5dc1a8,_0x5e6764){return function(_0x268473){if(_0x268473){return _0x268473[_0xfb2e('0x31')](_0x5dc1a8)[_0xfb2e('0x1c')](function(_0x1f5ada){return _0x1f5ada;});}return null;};}function removeEntity(_0x1a7e92,_0x4925db){return function(_0x3f74e2){if(_0x3f74e2){return _0x3f74e2[_0xfb2e('0x32')]()[_0xfb2e('0x1c')](function(){_0x1a7e92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35921d,_0x10423a){return function(_0x54a5b5){if(!_0x54a5b5){_0x35921d[_0xfb2e('0x28')](0x194);}return _0x54a5b5;};}function handleError(_0x30fedb,_0x5754d9){_0x5754d9=_0x5754d9||0x1f4;return function(_0xe59faf){logger[_0xfb2e('0x23')](_0xe59faf[_0xfb2e('0x33')]);if(_0xe59faf[_0xfb2e('0x34')]){delete _0xe59faf[_0xfb2e('0x34')];}_0x30fedb['status'](_0x5754d9)[_0xfb2e('0x35')](_0xe59faf);};}exports[_0xfb2e('0x36')]=function(_0x551197,_0x4b15a2){var _0x58855d={},_0x3f2ed2={},_0x1efeca={'count':0x0,'rows':[]};var _0x31fdc3=_[_0xfb2e('0x37')](db['DeskConfiguration'][_0xfb2e('0x38')],function(_0x3f6eb0){return{'name':_0x3f6eb0[_0xfb2e('0x39')],'type':_0x3f6eb0[_0xfb2e('0x3a')][_0xfb2e('0x3b')]};});_0x3f2ed2[_0xfb2e('0x3c')]=_[_0xfb2e('0x37')](_0x31fdc3,_0xfb2e('0x34'));_0x3f2ed2[_0xfb2e('0x3d')]=_[_0xfb2e('0x3e')](_0x551197['query']);_0x3f2ed2[_0xfb2e('0x3f')]=_['intersection'](_0x3f2ed2['model'],_0x3f2ed2['query']);_0x58855d[_0xfb2e('0x40')]=_[_0xfb2e('0x41')](_0x3f2ed2[_0xfb2e('0x3c')],qs['fields'](_0x551197[_0xfb2e('0x3d')]['fields']));_0x58855d['attributes']=_0x58855d[_0xfb2e('0x40')][_0xfb2e('0x42')]?_0x58855d[_0xfb2e('0x40')]:_0x3f2ed2[_0xfb2e('0x3c')];if(!_0x551197[_0xfb2e('0x3d')]['hasOwnProperty']('nolimit')){_0x58855d[_0xfb2e('0x43')]=qs[_0xfb2e('0x43')](_0x551197['query']['limit']);_0x58855d[_0xfb2e('0x2c')]=qs['offset'](_0x551197[_0xfb2e('0x3d')][_0xfb2e('0x2c')]);}_0x58855d[_0xfb2e('0x44')]=qs[_0xfb2e('0x45')](_0x551197[_0xfb2e('0x3d')][_0xfb2e('0x45')]);_0x58855d[_0xfb2e('0x46')]=qs[_0xfb2e('0x3f')](_['pick'](_0x551197[_0xfb2e('0x3d')],_0x3f2ed2[_0xfb2e('0x3f')]),_0x31fdc3);if(_0x551197[_0xfb2e('0x3d')]['filter']){_0x58855d[_0xfb2e('0x46')]=_[_0xfb2e('0x47')](_0x58855d[_0xfb2e('0x46')],{'$or':_['map'](_0x31fdc3,function(_0x214dda){if(_0x214dda['type']!==_0xfb2e('0x48')){var _0xa9bcac={};_0xa9bcac[_0x214dda[_0xfb2e('0x34')]]={'$like':'%'+_0x551197['query']['filter']+'%'};return _0xa9bcac;}})});}_0x58855d=_[_0xfb2e('0x47')]({},_0x58855d,_0x551197[_0xfb2e('0x49')]);var _0x29054e={'where':_0x58855d[_0xfb2e('0x46')]};return db[_0xfb2e('0x4a')][_0xfb2e('0x2b')](_0x29054e)[_0xfb2e('0x1c')](function(_0x23ab97){_0x1efeca[_0xfb2e('0x2b')]=_0x23ab97;if(_0x551197['query'][_0xfb2e('0x4b')]){_0x58855d[_0xfb2e('0x4c')]=[{'all':!![]}];}return db[_0xfb2e('0x4a')]['findAll'](_0x58855d);})[_0xfb2e('0x1c')](function(_0x7beac8){_0x1efeca[_0xfb2e('0x4d')]=_0x7beac8;return _0x1efeca;})[_0xfb2e('0x1c')](respondWithFilteredResult(_0x4b15a2,_0x58855d))['catch'](handleError(_0x4b15a2,null));};exports['show']=function(_0x5069ed,_0x220047){var _0x32dccb={'raw':![],'where':{'id':_0x5069ed[_0xfb2e('0x4e')]['id']}},_0x1ffa50={};_0x1ffa50[_0xfb2e('0x3c')]=_[_0xfb2e('0x3e')](db[_0xfb2e('0x4a')][_0xfb2e('0x38')]);_0x1ffa50[_0xfb2e('0x3d')]=_['keys'](_0x5069ed[_0xfb2e('0x3d')]);_0x1ffa50[_0xfb2e('0x3f')]=_['intersection'](_0x1ffa50[_0xfb2e('0x3c')],_0x1ffa50[_0xfb2e('0x3d')]);_0x32dccb[_0xfb2e('0x40')]=_[_0xfb2e('0x41')](_0x1ffa50[_0xfb2e('0x3c')],qs[_0xfb2e('0x4f')](_0x5069ed[_0xfb2e('0x3d')][_0xfb2e('0x4f')]));_0x32dccb[_0xfb2e('0x40')]=_0x32dccb[_0xfb2e('0x40')][_0xfb2e('0x42')]?_0x32dccb[_0xfb2e('0x40')]:_0x1ffa50['model'];if(_0x5069ed[_0xfb2e('0x3d')][_0xfb2e('0x4b')]){_0x32dccb[_0xfb2e('0x4c')]=[{'all':!![]}];}_0x32dccb=_['merge']({},_0x32dccb,_0x5069ed[_0xfb2e('0x49')]);return db[_0xfb2e('0x4a')]['find'](_0x32dccb)[_0xfb2e('0x1c')](handleEntityNotFound(_0x220047,null))[_0xfb2e('0x1c')](respondWithResult(_0x220047,null))[_0xfb2e('0x27')](handleError(_0x220047,null));};exports['create']=function(_0x555ced,_0x363960){return db[_0xfb2e('0x4a')]['create'](_0x555ced[_0xfb2e('0x50')],{})['then'](respondWithResult(_0x363960,0xc9))[_0xfb2e('0x27')](handleError(_0x363960,null));};exports[_0xfb2e('0x31')]=function(_0x376d2e,_0x3a120c){if(_0x376d2e['body']['id']){delete _0x376d2e['body']['id'];}return db[_0xfb2e('0x4a')][_0xfb2e('0x51')]({'where':{'id':_0x376d2e[_0xfb2e('0x4e')]['id']}})[_0xfb2e('0x1c')](handleEntityNotFound(_0x3a120c,null))[_0xfb2e('0x1c')](saveUpdates(_0x376d2e[_0xfb2e('0x50')],null))[_0xfb2e('0x1c')](respondWithResult(_0x3a120c,null))[_0xfb2e('0x27')](handleError(_0x3a120c,null));};exports['destroy']=function(_0x278aed,_0xadb413){return db[_0xfb2e('0x4a')][_0xfb2e('0x51')]({'where':{'id':_0x278aed[_0xfb2e('0x4e')]['id']}})['then'](handleEntityNotFound(_0xadb413,null))[_0xfb2e('0x1c')](removeEntity(_0xadb413,null))[_0xfb2e('0x27')](handleError(_0xadb413,null));};exports['getFields']=function(_0x3090a1,_0x3c9cc0,_0x53b12c){var _0x4c5017={};var _0x3b5cf2={};var _0x9d40f9;var _0x47d369;return db[_0xfb2e('0x4a')][_0xfb2e('0x52')]({'where':{'id':_0x3090a1['params']['id']}})[_0xfb2e('0x1c')](handleEntityNotFound(_0x3c9cc0,null))[_0xfb2e('0x1c')](function(_0x28b415){if(_0x28b415){_0x9d40f9=_0x28b415;_0x3b5cf2['model']=_[_0xfb2e('0x3e')](db[_0xfb2e('0x53')]['rawAttributes']);_0x3b5cf2[_0xfb2e('0x3d')]=_[_0xfb2e('0x3e')](_0x3090a1['query']);_0x3b5cf2[_0xfb2e('0x3f')]=_[_0xfb2e('0x41')](_0x3b5cf2[_0xfb2e('0x3c')],_0x3b5cf2[_0xfb2e('0x3d')]);_0x4c5017[_0xfb2e('0x40')]=_[_0xfb2e('0x41')](_0x3b5cf2[_0xfb2e('0x3c')],qs[_0xfb2e('0x4f')](_0x3090a1['query']['fields']));_0x4c5017[_0xfb2e('0x40')]=_0x4c5017[_0xfb2e('0x40')]['length']?_0x4c5017['attributes']:_0x3b5cf2[_0xfb2e('0x3c')];_0x4c5017[_0xfb2e('0x44')]=qs[_0xfb2e('0x45')](_0x3090a1[_0xfb2e('0x3d')][_0xfb2e('0x45')]);_0x4c5017[_0xfb2e('0x46')]=qs[_0xfb2e('0x3f')](_['pick'](_0x3090a1['query'],_0x3b5cf2['filters']));if(_0x3090a1[_0xfb2e('0x3d')][_0xfb2e('0x54')]){_0x4c5017[_0xfb2e('0x46')]=_[_0xfb2e('0x47')](_0x4c5017[_0xfb2e('0x46')],{'$or':_[_0xfb2e('0x37')](_0x4c5017['attributes'],function(_0x51e3c0){var _0x23b93a={};_0x23b93a[_0x51e3c0]={'$like':'%'+_0x3090a1['query'][_0xfb2e('0x54')]+'%'};return _0x23b93a;})});}_0x4c5017=_[_0xfb2e('0x47')]({},_0x4c5017,_0x3090a1[_0xfb2e('0x49')]);return _0x9d40f9['getFields'](_0x4c5017);}})[_0xfb2e('0x1c')](function(_0x1826c3){if(_0x1826c3){_0x47d369=_0x1826c3['length'];if(!_0x3090a1[_0xfb2e('0x3d')][_0xfb2e('0x55')](_0xfb2e('0x56'))){_0x4c5017[_0xfb2e('0x43')]=qs[_0xfb2e('0x43')](_0x3090a1[_0xfb2e('0x3d')][_0xfb2e('0x43')]);_0x4c5017[_0xfb2e('0x2c')]=qs['offset'](_0x3090a1[_0xfb2e('0x3d')][_0xfb2e('0x2c')]);}return _0x9d40f9[_0xfb2e('0x57')](_0x4c5017);}})['then'](function(_0x2e8722){if(_0x2e8722){return _0x2e8722?{'count':_0x47d369,'rows':_0x2e8722}:null;}})[_0xfb2e('0x1c')](respondWithResult(_0x3c9cc0,null))[_0xfb2e('0x27')](handleError(_0x3c9cc0,null));};exports[_0xfb2e('0x58')]=function(_0x4fd8b0,_0x9e29,_0x4109b0){var _0x3e02fc={};var _0x235a2c={};var _0x161128;var _0x57c036;return db[_0xfb2e('0x4a')][_0xfb2e('0x52')]({'where':{'id':_0x4fd8b0[_0xfb2e('0x4e')]['id']}})[_0xfb2e('0x1c')](handleEntityNotFound(_0x9e29,null))[_0xfb2e('0x1c')](function(_0x3bc9fe){if(_0x3bc9fe){_0x161128=_0x3bc9fe;_0x235a2c[_0xfb2e('0x3c')]=_[_0xfb2e('0x3e')](db['DeskField'][_0xfb2e('0x38')]);_0x235a2c[_0xfb2e('0x3d')]=_[_0xfb2e('0x3e')](_0x4fd8b0[_0xfb2e('0x3d')]);_0x235a2c['filters']=_[_0xfb2e('0x41')](_0x235a2c['model'],_0x235a2c[_0xfb2e('0x3d')]);_0x3e02fc[_0xfb2e('0x40')]=_[_0xfb2e('0x41')](_0x235a2c['model'],qs[_0xfb2e('0x4f')](_0x4fd8b0['query'][_0xfb2e('0x4f')]));_0x3e02fc[_0xfb2e('0x40')]=_0x3e02fc[_0xfb2e('0x40')]['length']?_0x3e02fc[_0xfb2e('0x40')]:_0x235a2c[_0xfb2e('0x3c')];_0x3e02fc[_0xfb2e('0x44')]=qs[_0xfb2e('0x45')](_0x4fd8b0[_0xfb2e('0x3d')][_0xfb2e('0x45')]);_0x3e02fc['where']=qs['filters'](_[_0xfb2e('0x59')](_0x4fd8b0['query'],_0x235a2c[_0xfb2e('0x3f')]));if(_0x4fd8b0[_0xfb2e('0x3d')][_0xfb2e('0x54')]){_0x3e02fc[_0xfb2e('0x46')]=_[_0xfb2e('0x47')](_0x3e02fc[_0xfb2e('0x46')],{'$or':_[_0xfb2e('0x37')](_0x3e02fc['attributes'],function(_0x5d8eb2){var _0x2a4bea={};_0x2a4bea[_0x5d8eb2]={'$like':'%'+_0x4fd8b0[_0xfb2e('0x3d')][_0xfb2e('0x54')]+'%'};return _0x2a4bea;})});}_0x3e02fc=_[_0xfb2e('0x47')]({},_0x3e02fc,_0x4fd8b0[_0xfb2e('0x49')]);return _0x161128[_0xfb2e('0x58')](_0x3e02fc);}})[_0xfb2e('0x1c')](function(_0x5066c7){if(_0x5066c7){_0x57c036=_0x5066c7[_0xfb2e('0x42')];if(!_0x4fd8b0['query']['hasOwnProperty'](_0xfb2e('0x56'))){_0x3e02fc[_0xfb2e('0x43')]=qs['limit'](_0x4fd8b0[_0xfb2e('0x3d')][_0xfb2e('0x43')]);_0x3e02fc[_0xfb2e('0x2c')]=qs[_0xfb2e('0x2c')](_0x4fd8b0['query']['offset']);}return _0x161128[_0xfb2e('0x58')](_0x3e02fc);}})[_0xfb2e('0x1c')](function(_0x494231){if(_0x494231){return _0x494231?{'count':_0x57c036,'rows':_0x494231}:null;}})[_0xfb2e('0x1c')](respondWithResult(_0x9e29,null))[_0xfb2e('0x27')](handleError(_0x9e29,null));};exports[_0xfb2e('0x5a')]=function(_0x52c333,_0x20801f,_0x54caf7){var _0x4270ef={};var _0x53221b={};var _0x206c19;var _0x20cad8;return db[_0xfb2e('0x4a')][_0xfb2e('0x52')]({'where':{'id':_0x52c333[_0xfb2e('0x4e')]['id']}})[_0xfb2e('0x1c')](handleEntityNotFound(_0x20801f,null))[_0xfb2e('0x1c')](function(_0x4e1d3e){if(_0x4e1d3e){_0x206c19=_0x4e1d3e;_0x53221b[_0xfb2e('0x3c')]=_[_0xfb2e('0x3e')](db[_0xfb2e('0x53')][_0xfb2e('0x38')]);_0x53221b[_0xfb2e('0x3d')]=_[_0xfb2e('0x3e')](_0x52c333[_0xfb2e('0x3d')]);_0x53221b['filters']=_[_0xfb2e('0x41')](_0x53221b[_0xfb2e('0x3c')],_0x53221b[_0xfb2e('0x3d')]);_0x4270ef[_0xfb2e('0x40')]=_[_0xfb2e('0x41')](_0x53221b[_0xfb2e('0x3c')],qs[_0xfb2e('0x4f')](_0x52c333[_0xfb2e('0x3d')][_0xfb2e('0x4f')]));_0x4270ef[_0xfb2e('0x40')]=_0x4270ef[_0xfb2e('0x40')][_0xfb2e('0x42')]?_0x4270ef[_0xfb2e('0x40')]:_0x53221b[_0xfb2e('0x3c')];_0x4270ef[_0xfb2e('0x44')]=qs['sort'](_0x52c333[_0xfb2e('0x3d')][_0xfb2e('0x45')]);_0x4270ef[_0xfb2e('0x46')]=qs[_0xfb2e('0x3f')](_[_0xfb2e('0x59')](_0x52c333[_0xfb2e('0x3d')],_0x53221b['filters']));if(_0x52c333['query'][_0xfb2e('0x54')]){_0x4270ef['where']=_[_0xfb2e('0x47')](_0x4270ef[_0xfb2e('0x46')],{'$or':_[_0xfb2e('0x37')](_0x4270ef[_0xfb2e('0x40')],function(_0x502d7d){var _0x199fe6={};_0x199fe6[_0x502d7d]={'$like':'%'+_0x52c333[_0xfb2e('0x3d')][_0xfb2e('0x54')]+'%'};return _0x199fe6;})});}_0x4270ef=_['merge']({},_0x4270ef,_0x52c333[_0xfb2e('0x49')]);return _0x206c19['getDescriptions'](_0x4270ef);}})[_0xfb2e('0x1c')](function(_0x5808f6){if(_0x5808f6){_0x20cad8=_0x5808f6[_0xfb2e('0x42')];if(!_0x52c333['query'][_0xfb2e('0x55')](_0xfb2e('0x56'))){_0x4270ef['limit']=qs[_0xfb2e('0x43')](_0x52c333[_0xfb2e('0x3d')][_0xfb2e('0x43')]);_0x4270ef[_0xfb2e('0x2c')]=qs[_0xfb2e('0x2c')](_0x52c333['query']['offset']);}return _0x206c19[_0xfb2e('0x5a')](_0x4270ef);}})[_0xfb2e('0x1c')](function(_0x21746f){if(_0x21746f){return _0x21746f?{'count':_0x20cad8,'rows':_0x21746f}:null;}})[_0xfb2e('0x1c')](respondWithResult(_0x20801f,null))[_0xfb2e('0x27')](handleError(_0x20801f,null));};exports['getTags']=function(_0x5bc8e7,_0x24f471,_0xa6e222){var _0x36e4d8={};var _0x3c65e1={};var _0x5edb2b;var _0x3639cb;return db[_0xfb2e('0x4a')][_0xfb2e('0x52')]({'where':{'id':_0x5bc8e7[_0xfb2e('0x4e')]['id']}})[_0xfb2e('0x1c')](handleEntityNotFound(_0x24f471,null))[_0xfb2e('0x1c')](function(_0x30c132){if(_0x30c132){_0x5edb2b=_0x30c132;_0x3c65e1['model']=_['keys'](db[_0xfb2e('0x5b')]['rawAttributes']);_0x3c65e1[_0xfb2e('0x3d')]=_[_0xfb2e('0x3e')](_0x5bc8e7['query']);_0x3c65e1[_0xfb2e('0x3f')]=_['intersection'](_0x3c65e1[_0xfb2e('0x3c')],_0x3c65e1[_0xfb2e('0x3d')]);_0x36e4d8[_0xfb2e('0x40')]=_[_0xfb2e('0x41')](_0x3c65e1[_0xfb2e('0x3c')],qs[_0xfb2e('0x4f')](_0x5bc8e7[_0xfb2e('0x3d')][_0xfb2e('0x4f')]));_0x36e4d8[_0xfb2e('0x40')]=_0x36e4d8[_0xfb2e('0x40')][_0xfb2e('0x42')]?_0x36e4d8[_0xfb2e('0x40')]:_0x3c65e1['model'];_0x36e4d8[_0xfb2e('0x44')]=qs[_0xfb2e('0x45')](_0x5bc8e7[_0xfb2e('0x3d')][_0xfb2e('0x45')]);_0x36e4d8[_0xfb2e('0x46')]=qs[_0xfb2e('0x3f')](_[_0xfb2e('0x59')](_0x5bc8e7['query'],_0x3c65e1['filters']));if(_0x5bc8e7['query'][_0xfb2e('0x54')]){_0x36e4d8[_0xfb2e('0x46')]=_['merge'](_0x36e4d8[_0xfb2e('0x46')],{'$or':_['map'](_0x36e4d8[_0xfb2e('0x40')],function(_0x122420){var _0x205a5f={};_0x205a5f[_0x122420]={'$like':'%'+_0x5bc8e7[_0xfb2e('0x3d')][_0xfb2e('0x54')]+'%'};return _0x205a5f;})});}_0x36e4d8=_['merge']({},_0x36e4d8,_0x5bc8e7[_0xfb2e('0x49')]);return _0x5edb2b['getTags'](_0x36e4d8);}})[_0xfb2e('0x1c')](function(_0x57e4c8){if(_0x57e4c8){_0x3639cb=_0x57e4c8[_0xfb2e('0x42')];if(!_0x5bc8e7[_0xfb2e('0x3d')][_0xfb2e('0x55')](_0xfb2e('0x56'))){_0x36e4d8[_0xfb2e('0x43')]=qs[_0xfb2e('0x43')](_0x5bc8e7[_0xfb2e('0x3d')][_0xfb2e('0x43')]);_0x36e4d8[_0xfb2e('0x2c')]=qs[_0xfb2e('0x2c')](_0x5bc8e7['query'][_0xfb2e('0x2c')]);}return _0x5edb2b[_0xfb2e('0x5c')](_0x36e4d8);}})[_0xfb2e('0x1c')](function(_0x3ed099){if(_0x3ed099){return _0x3ed099?{'count':_0x3639cb,'rows':_0x3ed099}:null;}})[_0xfb2e('0x1c')](respondWithResult(_0x24f471,null))[_0xfb2e('0x27')](handleError(_0x24f471,null));};exports['setTags']=function(_0x5f432a,_0x37b98d,_0x321b4b){if(_0x5f432a['body']['id']){delete _0x5f432a[_0xfb2e('0x50')]['id'];}return db[_0xfb2e('0x4a')][_0xfb2e('0x52')]({'where':{'id':_0x5f432a['params']['id']}})['then'](handleEntityNotFound(_0x37b98d,null))[_0xfb2e('0x1c')](function(_0x525764){if(_0x525764){return _0x525764[_0xfb2e('0x5d')](_0x5f432a[_0xfb2e('0x50')][_0xfb2e('0x5e')]||[]);}return null;})[_0xfb2e('0x1c')](respondWithResult(_0x37b98d,null))[_0xfb2e('0x27')](handleError(_0x37b98d,null));};
\ No newline at end of file
+var _0x2263=['update','getFields','findOne','DeskField','length','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','json','offset','limit','set','apply','reject','save','destroy','end','sendStatus','name','send','index','DeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body'];(function(_0x18fec1,_0x52f453){var _0x2fbc61=function(_0x235d5c){while(--_0x235d5c){_0x18fec1['push'](_0x18fec1['shift']());}};_0x2fbc61(++_0x52f453);}(_0x2263,0x6e));var _0x3226=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x2263[_0x45fc6a];return _0x14bcfd;};'use strict';var pdf=require(_0x3226('0x0'));var emlformat=require(_0x3226('0x1'));var rimraf=require(_0x3226('0x2'));var zipdir=require(_0x3226('0x3'));var jsonpatch=require(_0x3226('0x4'));var rp=require(_0x3226('0x5'));var moment=require(_0x3226('0x6'));var BPromise=require(_0x3226('0x7'));var Mustache=require('mustache');var util=require(_0x3226('0x8'));var path=require(_0x3226('0x9'));var sox=require(_0x3226('0xa'));var csv=require(_0x3226('0xb'));var ejs=require(_0x3226('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3226('0xd'));var crypto=require(_0x3226('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3226('0xb'));var querystring=require(_0x3226('0xf'));var Papa=require('papaparse');var Redis=require(_0x3226('0x10'));var authService=require(_0x3226('0x11'));var qs=require(_0x3226('0x12'));var as=require(_0x3226('0x13'));var hardwareService=require(_0x3226('0x14'));var logger=require(_0x3226('0x15'))(_0x3226('0x16'));var utils=require('../../config/utils');var config=require(_0x3226('0x17'));var db=require(_0x3226('0x18'))['db'];var jayson=require(_0x3226('0x19'));var client=jayson[_0x3226('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x485859,_0x53ba8b,_0x48a499){if(_0x48a499){var _0x51db46=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x51db46[_0x3226('0x1b')](_0x53ba8b)){return _0x485859;}else{throw new db[(_0x3226('0x1c'))][(_0x3226('0x1d'))](_0x3226('0x1e'));}}else{return _0x485859;}}function respondWithRpcPromise(_0x56d64c,_0x5b5c77,_0x2808e5,_0xfc7cb5){return new BPromise(function(_0x86bb0f,_0x5eb4a8){var _0x2fd0e5=_0xfc7cb5||client;return _0x2fd0e5[_0x3226('0x1f')](_0x56d64c,_0x2808e5)[_0x3226('0x20')](function(_0x31d4f0){logger[_0x3226('0x21')](_0x3226('0x22'),_0x5b5c77,'request\x20sent');logger['debug'](_0x3226('0x23'),_0x5b5c77,'request\x20sent',JSON[_0x3226('0x24')](_0x31d4f0));if(_0x31d4f0[_0x3226('0x25')]){if(_0x31d4f0[_0x3226('0x25')][_0x3226('0x26')]===0x1f4){logger[_0x3226('0x25')](_0x3226('0x22'),_0x5b5c77,_0x31d4f0['error'][_0x3226('0x27')]);return _0x5eb4a8(_0x31d4f0[_0x3226('0x25')]['message']);}logger[_0x3226('0x25')](_0x3226('0x22'),_0x5b5c77,_0x31d4f0[_0x3226('0x25')]['message']);return _0x86bb0f(_0x31d4f0[_0x3226('0x25')][_0x3226('0x27')]);}else{logger[_0x3226('0x21')](_0x3226('0x22'),_0x5b5c77,_0x3226('0x28'));_0x86bb0f(_0x31d4f0[_0x3226('0x29')][_0x3226('0x27')]);}})[_0x3226('0x2a')](function(_0x5850c9){logger[_0x3226('0x25')]('DeskConfiguration,\x20%s,\x20%s',_0x5b5c77,_0x5850c9);_0x5eb4a8(_0x5850c9);});});}function respondWithStatusCode(_0x3d6341,_0x5b8d32){_0x5b8d32=_0x5b8d32||0xcc;return function(_0x26c845){if(_0x26c845){return _0x3d6341['sendStatus'](_0x5b8d32);}return _0x3d6341[_0x3226('0x2b')](_0x5b8d32)['end']();};}function respondWithResult(_0x10942a,_0x11246e){_0x11246e=_0x11246e||0xc8;return function(_0x553639){if(_0x553639){return _0x10942a[_0x3226('0x2b')](_0x11246e)[_0x3226('0x2c')](_0x553639);}};}function respondWithFilteredResult(_0x3a4af0,_0x3b44d0){return function(_0x1e6181){if(_0x1e6181){var _0x38c83c=_0x1e6181['count'],_0x12e26d=_0x3b44d0[_0x3226('0x2d')],_0x4b9174=_0x3b44d0[_0x3226('0x2d')]+_0x3b44d0[_0x3226('0x2e')],_0x34d2aa;if(_0x4b9174>=_0x38c83c){_0x4b9174=_0x38c83c;_0x34d2aa=0xc8;}else{_0x34d2aa=0xce;}_0x3a4af0['status'](_0x34d2aa);return _0x3a4af0[_0x3226('0x2f')]('Content-Range',_0x12e26d+'-'+_0x4b9174+'/'+_0x38c83c)['json'](_0x1e6181);}return null;};}function patchUpdates(_0x35b530){return function(_0x4141ac){try{jsonpatch[_0x3226('0x30')](_0x4141ac,_0x35b530,!![]);}catch(_0x3b5ea5){return BPromise[_0x3226('0x31')](_0x3b5ea5);}return _0x4141ac[_0x3226('0x32')]();};}function saveUpdates(_0xf482d4,_0x1dafc8){return function(_0x4048a4){if(_0x4048a4){return _0x4048a4['update'](_0xf482d4)[_0x3226('0x20')](function(_0x6ccaef){return _0x6ccaef;});}return null;};}function removeEntity(_0x326ec3,_0x2bb98e){return function(_0x3f439a){if(_0x3f439a){return _0x3f439a[_0x3226('0x33')]()[_0x3226('0x20')](function(){_0x326ec3[_0x3226('0x2b')](0xcc)[_0x3226('0x34')]();});}};}function handleEntityNotFound(_0x2e53bb,_0x1a4195){return function(_0x55df69){if(!_0x55df69){_0x2e53bb[_0x3226('0x35')](0x194);}return _0x55df69;};}function handleError(_0xc7e1a1,_0x4f4c51){_0x4f4c51=_0x4f4c51||0x1f4;return function(_0x4fa28c){logger[_0x3226('0x25')](_0x4fa28c['stack']);if(_0x4fa28c[_0x3226('0x36')]){delete _0x4fa28c['name'];}_0xc7e1a1[_0x3226('0x2b')](_0x4f4c51)[_0x3226('0x37')](_0x4fa28c);};}exports[_0x3226('0x38')]=function(_0x1bb5f2,_0x32438f){var _0x4df2a9={},_0x20715={},_0x5d409b={'count':0x0,'rows':[]};var _0x35bd48=_['map'](db[_0x3226('0x39')][_0x3226('0x3a')],function(_0x1d1374){return{'name':_0x1d1374['fieldName'],'type':_0x1d1374[_0x3226('0x3b')][_0x3226('0x3c')]};});_0x20715[_0x3226('0x3d')]=_[_0x3226('0x3e')](_0x35bd48,_0x3226('0x36'));_0x20715[_0x3226('0x3f')]=_[_0x3226('0x40')](_0x1bb5f2[_0x3226('0x3f')]);_0x20715[_0x3226('0x41')]=_[_0x3226('0x42')](_0x20715[_0x3226('0x3d')],_0x20715[_0x3226('0x3f')]);_0x4df2a9[_0x3226('0x43')]=_[_0x3226('0x42')](_0x20715[_0x3226('0x3d')],qs['fields'](_0x1bb5f2[_0x3226('0x3f')][_0x3226('0x44')]));_0x4df2a9[_0x3226('0x43')]=_0x4df2a9[_0x3226('0x43')]['length']?_0x4df2a9[_0x3226('0x43')]:_0x20715[_0x3226('0x3d')];if(!_0x1bb5f2[_0x3226('0x3f')][_0x3226('0x45')](_0x3226('0x46'))){_0x4df2a9[_0x3226('0x2e')]=qs[_0x3226('0x2e')](_0x1bb5f2[_0x3226('0x3f')][_0x3226('0x2e')]);_0x4df2a9['offset']=qs[_0x3226('0x2d')](_0x1bb5f2[_0x3226('0x3f')][_0x3226('0x2d')]);}_0x4df2a9[_0x3226('0x47')]=qs[_0x3226('0x48')](_0x1bb5f2[_0x3226('0x3f')]['sort']);_0x4df2a9['where']=qs[_0x3226('0x41')](_[_0x3226('0x49')](_0x1bb5f2['query'],_0x20715[_0x3226('0x41')]),_0x35bd48);if(_0x1bb5f2[_0x3226('0x3f')][_0x3226('0x4a')]){_0x4df2a9[_0x3226('0x4b')]=_[_0x3226('0x4c')](_0x4df2a9[_0x3226('0x4b')],{'$or':_[_0x3226('0x3e')](_0x35bd48,function(_0x35083d){if(_0x35083d['type']!==_0x3226('0x4d')){var _0x4ea529={};_0x4ea529[_0x35083d[_0x3226('0x36')]]={'$like':'%'+_0x1bb5f2[_0x3226('0x3f')]['filter']+'%'};return _0x4ea529;}})});}_0x4df2a9=_['merge']({},_0x4df2a9,_0x1bb5f2[_0x3226('0x4e')]);var _0x800463={'where':_0x4df2a9[_0x3226('0x4b')]};return db[_0x3226('0x39')]['count'](_0x800463)[_0x3226('0x20')](function(_0x424688){_0x5d409b['count']=_0x424688;if(_0x1bb5f2[_0x3226('0x3f')][_0x3226('0x4f')]){_0x4df2a9['include']=[{'all':!![]}];}return db[_0x3226('0x39')][_0x3226('0x50')](_0x4df2a9);})[_0x3226('0x20')](function(_0x421b47){_0x5d409b[_0x3226('0x51')]=_0x421b47;return _0x5d409b;})['then'](respondWithFilteredResult(_0x32438f,_0x4df2a9))[_0x3226('0x2a')](handleError(_0x32438f,null));};exports[_0x3226('0x52')]=function(_0x3199b1,_0x34b554){var _0xe890c={'raw':![],'where':{'id':_0x3199b1[_0x3226('0x53')]['id']}},_0x47ad6c={};_0x47ad6c[_0x3226('0x3d')]=_[_0x3226('0x40')](db[_0x3226('0x39')][_0x3226('0x3a')]);_0x47ad6c[_0x3226('0x3f')]=_[_0x3226('0x40')](_0x3199b1[_0x3226('0x3f')]);_0x47ad6c[_0x3226('0x41')]=_[_0x3226('0x42')](_0x47ad6c[_0x3226('0x3d')],_0x47ad6c[_0x3226('0x3f')]);_0xe890c[_0x3226('0x43')]=_['intersection'](_0x47ad6c[_0x3226('0x3d')],qs['fields'](_0x3199b1[_0x3226('0x3f')]['fields']));_0xe890c[_0x3226('0x43')]=_0xe890c[_0x3226('0x43')]['length']?_0xe890c[_0x3226('0x43')]:_0x47ad6c[_0x3226('0x3d')];if(_0x3199b1[_0x3226('0x3f')]['includeAll']){_0xe890c[_0x3226('0x54')]=[{'all':!![]}];}_0xe890c=_[_0x3226('0x4c')]({},_0xe890c,_0x3199b1[_0x3226('0x4e')]);return db['DeskConfiguration'][_0x3226('0x55')](_0xe890c)[_0x3226('0x20')](handleEntityNotFound(_0x34b554,null))[_0x3226('0x20')](respondWithResult(_0x34b554,null))[_0x3226('0x2a')](handleError(_0x34b554,null));};exports['create']=function(_0x5b11f8,_0x407fa5){return db[_0x3226('0x39')][_0x3226('0x56')](_0x5b11f8[_0x3226('0x57')],{})[_0x3226('0x20')](respondWithResult(_0x407fa5,0xc9))[_0x3226('0x2a')](handleError(_0x407fa5,null));};exports[_0x3226('0x58')]=function(_0x6f9ae0,_0x30dab5){if(_0x6f9ae0['body']['id']){delete _0x6f9ae0[_0x3226('0x57')]['id'];}return db[_0x3226('0x39')]['find']({'where':{'id':_0x6f9ae0[_0x3226('0x53')]['id']}})[_0x3226('0x20')](handleEntityNotFound(_0x30dab5,null))[_0x3226('0x20')](saveUpdates(_0x6f9ae0['body'],null))[_0x3226('0x20')](respondWithResult(_0x30dab5,null))[_0x3226('0x2a')](handleError(_0x30dab5,null));};exports['destroy']=function(_0x8877e2,_0x59a988){return db[_0x3226('0x39')][_0x3226('0x55')]({'where':{'id':_0x8877e2[_0x3226('0x53')]['id']}})['then'](handleEntityNotFound(_0x59a988,null))['then'](removeEntity(_0x59a988,null))['catch'](handleError(_0x59a988,null));};exports[_0x3226('0x59')]=function(_0x2ec688,_0xd63ce1,_0x1da8d3){var _0x479b95={};var _0x5d8293={};var _0x34ec6f;var _0x351640;return db[_0x3226('0x39')][_0x3226('0x5a')]({'where':{'id':_0x2ec688[_0x3226('0x53')]['id']}})[_0x3226('0x20')](handleEntityNotFound(_0xd63ce1,null))[_0x3226('0x20')](function(_0x3216ba){if(_0x3216ba){_0x34ec6f=_0x3216ba;_0x5d8293['model']=_[_0x3226('0x40')](db[_0x3226('0x5b')][_0x3226('0x3a')]);_0x5d8293[_0x3226('0x3f')]=_['keys'](_0x2ec688[_0x3226('0x3f')]);_0x5d8293[_0x3226('0x41')]=_[_0x3226('0x42')](_0x5d8293[_0x3226('0x3d')],_0x5d8293['query']);_0x479b95['attributes']=_[_0x3226('0x42')](_0x5d8293['model'],qs[_0x3226('0x44')](_0x2ec688[_0x3226('0x3f')][_0x3226('0x44')]));_0x479b95[_0x3226('0x43')]=_0x479b95['attributes'][_0x3226('0x5c')]?_0x479b95[_0x3226('0x43')]:_0x5d8293[_0x3226('0x3d')];_0x479b95['order']=qs[_0x3226('0x48')](_0x2ec688[_0x3226('0x3f')]['sort']);_0x479b95[_0x3226('0x4b')]=qs[_0x3226('0x41')](_[_0x3226('0x49')](_0x2ec688[_0x3226('0x3f')],_0x5d8293[_0x3226('0x41')]));if(_0x2ec688[_0x3226('0x3f')][_0x3226('0x4a')]){_0x479b95[_0x3226('0x4b')]=_[_0x3226('0x4c')](_0x479b95['where'],{'$or':_[_0x3226('0x3e')](_0x479b95['attributes'],function(_0x5e78ff){var _0x1687bd={};_0x1687bd[_0x5e78ff]={'$like':'%'+_0x2ec688[_0x3226('0x3f')][_0x3226('0x4a')]+'%'};return _0x1687bd;})});}_0x479b95=_[_0x3226('0x4c')]({},_0x479b95,_0x2ec688[_0x3226('0x4e')]);return _0x34ec6f[_0x3226('0x59')](_0x479b95);}})[_0x3226('0x20')](function(_0x2c44fb){if(_0x2c44fb){_0x351640=_0x2c44fb[_0x3226('0x5c')];if(!_0x2ec688[_0x3226('0x3f')][_0x3226('0x45')]('nolimit')){_0x479b95[_0x3226('0x2e')]=qs[_0x3226('0x2e')](_0x2ec688['query'][_0x3226('0x2e')]);_0x479b95['offset']=qs[_0x3226('0x2d')](_0x2ec688[_0x3226('0x3f')]['offset']);}return _0x34ec6f['getFields'](_0x479b95);}})['then'](function(_0x41a2b4){if(_0x41a2b4){return _0x41a2b4?{'count':_0x351640,'rows':_0x41a2b4}:null;}})[_0x3226('0x20')](respondWithResult(_0xd63ce1,null))[_0x3226('0x2a')](handleError(_0xd63ce1,null));};exports[_0x3226('0x5d')]=function(_0x99d08,_0x55ffe2,_0x154617){var _0x2a2cf3={};var _0x132a60={};var _0x4ca391;var _0x278ba8;return db[_0x3226('0x39')][_0x3226('0x5a')]({'where':{'id':_0x99d08[_0x3226('0x53')]['id']}})['then'](handleEntityNotFound(_0x55ffe2,null))[_0x3226('0x20')](function(_0x2dcab6){if(_0x2dcab6){_0x4ca391=_0x2dcab6;_0x132a60[_0x3226('0x3d')]=_['keys'](db[_0x3226('0x5b')]['rawAttributes']);_0x132a60[_0x3226('0x3f')]=_[_0x3226('0x40')](_0x99d08[_0x3226('0x3f')]);_0x132a60[_0x3226('0x41')]=_['intersection'](_0x132a60['model'],_0x132a60[_0x3226('0x3f')]);_0x2a2cf3[_0x3226('0x43')]=_['intersection'](_0x132a60[_0x3226('0x3d')],qs[_0x3226('0x44')](_0x99d08[_0x3226('0x3f')][_0x3226('0x44')]));_0x2a2cf3[_0x3226('0x43')]=_0x2a2cf3['attributes'][_0x3226('0x5c')]?_0x2a2cf3[_0x3226('0x43')]:_0x132a60['model'];_0x2a2cf3[_0x3226('0x47')]=qs[_0x3226('0x48')](_0x99d08[_0x3226('0x3f')][_0x3226('0x48')]);_0x2a2cf3['where']=qs['filters'](_[_0x3226('0x49')](_0x99d08[_0x3226('0x3f')],_0x132a60[_0x3226('0x41')]));if(_0x99d08['query'][_0x3226('0x4a')]){_0x2a2cf3[_0x3226('0x4b')]=_[_0x3226('0x4c')](_0x2a2cf3[_0x3226('0x4b')],{'$or':_[_0x3226('0x3e')](_0x2a2cf3[_0x3226('0x43')],function(_0x282038){var _0x34d1c8={};_0x34d1c8[_0x282038]={'$like':'%'+_0x99d08[_0x3226('0x3f')]['filter']+'%'};return _0x34d1c8;})});}_0x2a2cf3=_[_0x3226('0x4c')]({},_0x2a2cf3,_0x99d08[_0x3226('0x4e')]);return _0x4ca391[_0x3226('0x5d')](_0x2a2cf3);}})['then'](function(_0xf0a93c){if(_0xf0a93c){_0x278ba8=_0xf0a93c[_0x3226('0x5c')];if(!_0x99d08['query'][_0x3226('0x45')]('nolimit')){_0x2a2cf3['limit']=qs[_0x3226('0x2e')](_0x99d08[_0x3226('0x3f')]['limit']);_0x2a2cf3[_0x3226('0x2d')]=qs[_0x3226('0x2d')](_0x99d08[_0x3226('0x3f')][_0x3226('0x2d')]);}return _0x4ca391[_0x3226('0x5d')](_0x2a2cf3);}})[_0x3226('0x20')](function(_0x3ff3bd){if(_0x3ff3bd){return _0x3ff3bd?{'count':_0x278ba8,'rows':_0x3ff3bd}:null;}})[_0x3226('0x20')](respondWithResult(_0x55ffe2,null))['catch'](handleError(_0x55ffe2,null));};exports[_0x3226('0x5e')]=function(_0x238242,_0x35229e,_0x5770f4){var _0x10bf04={};var _0x2b387f={};var _0x58cb84;var _0x75123a;return db['DeskConfiguration'][_0x3226('0x5a')]({'where':{'id':_0x238242['params']['id']}})['then'](handleEntityNotFound(_0x35229e,null))[_0x3226('0x20')](function(_0x2dfebe){if(_0x2dfebe){_0x58cb84=_0x2dfebe;_0x2b387f[_0x3226('0x3d')]=_[_0x3226('0x40')](db[_0x3226('0x5b')][_0x3226('0x3a')]);_0x2b387f['query']=_[_0x3226('0x40')](_0x238242[_0x3226('0x3f')]);_0x2b387f[_0x3226('0x41')]=_[_0x3226('0x42')](_0x2b387f[_0x3226('0x3d')],_0x2b387f[_0x3226('0x3f')]);_0x10bf04[_0x3226('0x43')]=_['intersection'](_0x2b387f[_0x3226('0x3d')],qs[_0x3226('0x44')](_0x238242['query']['fields']));_0x10bf04['attributes']=_0x10bf04[_0x3226('0x43')][_0x3226('0x5c')]?_0x10bf04['attributes']:_0x2b387f[_0x3226('0x3d')];_0x10bf04['order']=qs[_0x3226('0x48')](_0x238242[_0x3226('0x3f')][_0x3226('0x48')]);_0x10bf04[_0x3226('0x4b')]=qs[_0x3226('0x41')](_[_0x3226('0x49')](_0x238242[_0x3226('0x3f')],_0x2b387f['filters']));if(_0x238242['query'][_0x3226('0x4a')]){_0x10bf04[_0x3226('0x4b')]=_[_0x3226('0x4c')](_0x10bf04[_0x3226('0x4b')],{'$or':_['map'](_0x10bf04[_0x3226('0x43')],function(_0x10ae52){var _0x3d080a={};_0x3d080a[_0x10ae52]={'$like':'%'+_0x238242['query'][_0x3226('0x4a')]+'%'};return _0x3d080a;})});}_0x10bf04=_[_0x3226('0x4c')]({},_0x10bf04,_0x238242['options']);return _0x58cb84[_0x3226('0x5e')](_0x10bf04);}})[_0x3226('0x20')](function(_0x461b3f){if(_0x461b3f){_0x75123a=_0x461b3f[_0x3226('0x5c')];if(!_0x238242['query'][_0x3226('0x45')](_0x3226('0x46'))){_0x10bf04[_0x3226('0x2e')]=qs[_0x3226('0x2e')](_0x238242['query'][_0x3226('0x2e')]);_0x10bf04['offset']=qs['offset'](_0x238242[_0x3226('0x3f')][_0x3226('0x2d')]);}return _0x58cb84['getDescriptions'](_0x10bf04);}})[_0x3226('0x20')](function(_0x21a3d9){if(_0x21a3d9){return _0x21a3d9?{'count':_0x75123a,'rows':_0x21a3d9}:null;}})['then'](respondWithResult(_0x35229e,null))[_0x3226('0x2a')](handleError(_0x35229e,null));};exports[_0x3226('0x5f')]=function(_0x4022a5,_0x8593cc,_0x2ea985){var _0x219028={};var _0x5b73f6={};var _0x453676;var _0x35ea94;return db[_0x3226('0x39')][_0x3226('0x5a')]({'where':{'id':_0x4022a5[_0x3226('0x53')]['id']}})['then'](handleEntityNotFound(_0x8593cc,null))[_0x3226('0x20')](function(_0x5ea60a){if(_0x5ea60a){_0x453676=_0x5ea60a;_0x5b73f6[_0x3226('0x3d')]=_[_0x3226('0x40')](db[_0x3226('0x60')]['rawAttributes']);_0x5b73f6[_0x3226('0x3f')]=_[_0x3226('0x40')](_0x4022a5['query']);_0x5b73f6['filters']=_[_0x3226('0x42')](_0x5b73f6[_0x3226('0x3d')],_0x5b73f6[_0x3226('0x3f')]);_0x219028[_0x3226('0x43')]=_['intersection'](_0x5b73f6[_0x3226('0x3d')],qs[_0x3226('0x44')](_0x4022a5[_0x3226('0x3f')][_0x3226('0x44')]));_0x219028[_0x3226('0x43')]=_0x219028[_0x3226('0x43')][_0x3226('0x5c')]?_0x219028[_0x3226('0x43')]:_0x5b73f6['model'];_0x219028[_0x3226('0x47')]=qs[_0x3226('0x48')](_0x4022a5['query']['sort']);_0x219028['where']=qs[_0x3226('0x41')](_['pick'](_0x4022a5[_0x3226('0x3f')],_0x5b73f6[_0x3226('0x41')]));if(_0x4022a5[_0x3226('0x3f')][_0x3226('0x4a')]){_0x219028[_0x3226('0x4b')]=_[_0x3226('0x4c')](_0x219028[_0x3226('0x4b')],{'$or':_[_0x3226('0x3e')](_0x219028[_0x3226('0x43')],function(_0x332c3b){var _0x2901b6={};_0x2901b6[_0x332c3b]={'$like':'%'+_0x4022a5[_0x3226('0x3f')]['filter']+'%'};return _0x2901b6;})});}_0x219028=_[_0x3226('0x4c')]({},_0x219028,_0x4022a5['options']);return _0x453676[_0x3226('0x5f')](_0x219028);}})[_0x3226('0x20')](function(_0x54639b){if(_0x54639b){_0x35ea94=_0x54639b[_0x3226('0x5c')];if(!_0x4022a5[_0x3226('0x3f')][_0x3226('0x45')]('nolimit')){_0x219028[_0x3226('0x2e')]=qs[_0x3226('0x2e')](_0x4022a5[_0x3226('0x3f')]['limit']);_0x219028[_0x3226('0x2d')]=qs[_0x3226('0x2d')](_0x4022a5[_0x3226('0x3f')][_0x3226('0x2d')]);}return _0x453676[_0x3226('0x5f')](_0x219028);}})['then'](function(_0x33aac9){if(_0x33aac9){return _0x33aac9?{'count':_0x35ea94,'rows':_0x33aac9}:null;}})[_0x3226('0x20')](respondWithResult(_0x8593cc,null))[_0x3226('0x2a')](handleError(_0x8593cc,null));};exports[_0x3226('0x61')]=function(_0x5e6938,_0x4749f8,_0x5b022d){if(_0x5e6938['body']['id']){delete _0x5e6938[_0x3226('0x57')]['id'];}return db[_0x3226('0x39')]['findOne']({'where':{'id':_0x5e6938[_0x3226('0x53')]['id']}})['then'](handleEntityNotFound(_0x4749f8,null))[_0x3226('0x20')](function(_0x44d894){if(_0x44d894){return _0x44d894[_0x3226('0x61')](_0x5e6938['body'][_0x3226('0x62')]||[]);}return null;})[_0x3226('0x20')](respondWithResult(_0x4749f8,null))['catch'](handleError(_0x4749f8,null));};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js
index cb1f7fe..26f2f6a 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.model.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x571e=['./intDeskConfiguration.attributes','exports','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4f51c9,_0x2548ef){var _0x28f86b=function(_0x57c56c){while(--_0x57c56c){_0x4f51c9['push'](_0x4f51c9['shift']());}};_0x28f86b(++_0x2548ef);}(_0x571e,0x71));var _0xe571=function(_0x27ce53,_0x1f4aab){_0x27ce53=_0x27ce53-0x0;var _0x41308c=_0x571e[_0x27ce53];return _0x41308c;};'use strict';var _=require(_0xe571('0x0'));var util=require(_0xe571('0x1'));var logger=require('../../config/logger')(_0xe571('0x2'));var moment=require(_0xe571('0x3'));var BPromise=require(_0xe571('0x4'));var rp=require(_0xe571('0x5'));var fs=require('fs');var path=require(_0xe571('0x6'));var rimraf=require('rimraf');var config=require(_0xe571('0x7'));var attributes=require(_0xe571('0x8'));module[_0xe571('0x9')]=function(_0x2d034e,_0x4b10a6){return _0x2d034e['define']('DeskConfiguration',attributes,{'tableName':_0xe571('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3b0=['exports','int_desk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intDeskConfiguration.attributes'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xf3b0,0x16a));var _0x0f3b=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0xf3b0[_0x5d7227];return _0x15ac55;};'use strict';var _=require(_0x0f3b('0x0'));var util=require('util');var logger=require(_0x0f3b('0x1'))(_0x0f3b('0x2'));var moment=require(_0x0f3b('0x3'));var BPromise=require(_0x0f3b('0x4'));var rp=require(_0x0f3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f3b('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f3b('0x7'));module[_0x0f3b('0x8')]=function(_0x9baae6,_0x5d1642){return _0x9baae6['define']('DeskConfiguration',attributes,{'tableName':_0x0f3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
index 7bbf8f7..e6db62c 100644
--- a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
+++ b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0565=['client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xb3c46e,_0x5c15f0){var _0x43ad16=function(_0x865238){while(--_0x865238){_0xb3c46e['push'](_0xb3c46e['shift']());}};_0x43ad16(++_0x5c15f0);}(_0x0565,0xf2));var _0x5056=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0565[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});}
\ No newline at end of file
+var _0x7914=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7914,0x107));var _0x4791=function(_0x2696d2,_0x11c781){_0x2696d2=_0x2696d2-0x0;var _0x233492=_0x7914[_0x2696d2];return _0x233492;};'use strict';var _=require(_0x4791('0x0'));var util=require(_0x4791('0x1'));var moment=require('moment');var BPromise=require(_0x4791('0x2'));var rs=require(_0x4791('0x3'));var fs=require('fs');var Redis=require(_0x4791('0x4'));var db=require(_0x4791('0x5'))['db'];var utils=require(_0x4791('0x6'));var logger=require(_0x4791('0x7'))(_0x4791('0x8'));var config=require(_0x4791('0x9'));var jayson=require(_0x4791('0xa'));var client=jayson[_0x4791('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x306863,_0x559fc1,_0x1dc98f){return new BPromise(function(_0x22163f,_0xa154fc){return client[_0x4791('0xc')](_0x306863,_0x1dc98f)[_0x4791('0xd')](function(_0x153de4){logger[_0x4791('0xe')](_0x4791('0xf'),_0x559fc1,'request\x20sent');logger[_0x4791('0x10')](_0x4791('0x11'),_0x559fc1,_0x4791('0x12'),JSON[_0x4791('0x13')](_0x153de4));if(_0x153de4[_0x4791('0x14')]){if(_0x153de4[_0x4791('0x14')]['code']===0x1f4){logger[_0x4791('0x14')](_0x4791('0xf'),_0x559fc1,_0x153de4['error'][_0x4791('0x15')]);return _0xa154fc(_0x153de4[_0x4791('0x14')][_0x4791('0x15')]);}logger[_0x4791('0x14')](_0x4791('0xf'),_0x559fc1,_0x153de4[_0x4791('0x14')][_0x4791('0x15')]);return _0x22163f(_0x153de4['error'][_0x4791('0x15')]);}else{logger[_0x4791('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x559fc1,_0x4791('0x12'));_0x22163f(_0x153de4[_0x4791('0x16')][_0x4791('0x15')]);}})[_0x4791('0x17')](function(_0xab1f15){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x559fc1,_0xab1f15);_0xa154fc(_0xab1f15);});});}
\ No newline at end of file
diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js
index 3f61d84..b90e255 100644
--- a/server/api/intDeskField/index.js
+++ b/server/api/intDeskField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x02c8=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show','create','put','/:id','update','exports','multer','util'];(function(_0x20679c,_0x57b5ff){var _0x53d3bb=function(_0x15ea2c){while(--_0x15ea2c){_0x20679c['push'](_0x20679c['shift']());}};_0x53d3bb(++_0x57b5ff);}(_0x02c8,0x166));var _0x802c=function(_0x42fb1b,_0x5118a2){_0x42fb1b=_0x42fb1b-0x0;var _0x5eadc2=_0x02c8[_0x42fb1b];return _0x5eadc2;};'use strict';var multer=require(_0x802c('0x0'));var util=require(_0x802c('0x1'));var path=require(_0x802c('0x2'));var timeout=require(_0x802c('0x3'));var express=require('express');var router=express[_0x802c('0x4')]();var auth=require(_0x802c('0x5'));var interaction=require(_0x802c('0x6'));var config=require(_0x802c('0x7'));var controller=require(_0x802c('0x8'));router[_0x802c('0x9')]('/',auth[_0x802c('0xa')](),controller[_0x802c('0xb')]);router[_0x802c('0x9')]('/:id',auth[_0x802c('0xa')](),controller[_0x802c('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x802c('0xd')]);router[_0x802c('0xe')](_0x802c('0xf'),auth[_0x802c('0xa')](),controller[_0x802c('0x10')]);router['delete'](_0x802c('0xf'),auth[_0x802c('0xa')](),controller['destroy']);module[_0x802c('0x11')]=router;
\ No newline at end of file
+var _0x6afe=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6afe,0x1c1));var _0xe6af=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0x6afe[_0x82140];return _0x2b15a6;};'use strict';var multer=require(_0xe6af('0x0'));var util=require(_0xe6af('0x1'));var path=require(_0xe6af('0x2'));var timeout=require(_0xe6af('0x3'));var express=require(_0xe6af('0x4'));var router=express[_0xe6af('0x5')]();var auth=require(_0xe6af('0x6'));var interaction=require(_0xe6af('0x7'));var config=require(_0xe6af('0x8'));var controller=require('./intDeskField.controller');router[_0xe6af('0x9')]('/',auth['isAuthenticated'](),controller[_0xe6af('0xa')]);router[_0xe6af('0x9')]('/:id',auth[_0xe6af('0xb')](),controller[_0xe6af('0xc')]);router[_0xe6af('0xd')]('/',auth[_0xe6af('0xb')](),controller['create']);router[_0xe6af('0xe')](_0xe6af('0xf'),auth['isAuthenticated'](),controller[_0xe6af('0x10')]);router[_0xe6af('0x11')](_0xe6af('0xf'),auth[_0xe6af('0xb')](),controller['destroy']);module[_0xe6af('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js
index e106729..5a31899 100644
--- a/server/api/intDeskField/intDeskField.attributes.js
+++ b/server/api/intDeskField/intDeskField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6592=['variable','customVariable','string','STRING','BOOLEAN','exports','ENUM'];(function(_0x15456c,_0x420b80){var _0x51849c=function(_0x181c7e){while(--_0x181c7e){_0x15456c['push'](_0x15456c['shift']());}};_0x51849c(++_0x420b80);}(_0x6592,0x17f));var _0x2659=function(_0xffa5c6,_0x22b5f2){_0xffa5c6=_0xffa5c6-0x0;var _0x5bc418=_0x6592[_0xffa5c6];return _0x5bc418;};'use strict';var Sequelize=require('sequelize');module[_0x2659('0x0')]={'type':{'type':Sequelize[_0x2659('0x1')]('string',_0x2659('0x2'),_0x2659('0x3'),'keyValue'),'defaultValue':_0x2659('0x4')},'content':{'type':Sequelize[_0x2659('0x5')]},'key':{'type':Sequelize[_0x2659('0x5')]},'keyType':{'type':Sequelize[_0x2659('0x1')](_0x2659('0x4'),'variable',_0x2659('0x3'))},'keyContent':{'type':Sequelize[_0x2659('0x5')]},'idField':{'type':Sequelize[_0x2659('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2659('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2659('0x5')]}};
\ No newline at end of file
+var _0x8be3=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3d7595,_0x23bf60){var _0x163d06=function(_0x2c3a21){while(--_0x2c3a21){_0x3d7595['push'](_0x3d7595['shift']());}};_0x163d06(++_0x23bf60);}(_0x8be3,0x1c8));var _0x38be=function(_0x122f9b,_0x5e05c3){_0x122f9b=_0x122f9b-0x0;var _0x17fb4c=_0x8be3[_0x122f9b];return _0x17fb4c;};'use strict';var Sequelize=require(_0x38be('0x0'));module[_0x38be('0x1')]={'type':{'type':Sequelize[_0x38be('0x2')](_0x38be('0x3'),_0x38be('0x4'),_0x38be('0x5'),_0x38be('0x6')),'defaultValue':_0x38be('0x3')},'content':{'type':Sequelize[_0x38be('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x38be('0x2')](_0x38be('0x3'),_0x38be('0x4'),_0x38be('0x5'))},'keyContent':{'type':Sequelize[_0x38be('0x7')]},'idField':{'type':Sequelize[_0x38be('0x7')]},'nameField':{'type':Sequelize[_0x38be('0x7')]},'customField':{'type':Sequelize[_0x38be('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38be('0x7')]}};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js
index 2f22159..01c4eaf 100644
--- a/server/api/intDeskField/intDeskField.controller.js
+++ b/server/api/intDeskField/intDeskField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8075=['query','fields','attributes','length','order','where','filter','options','then','includeAll','include','findAll','rows','catch','show','merge','create','body','find','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','stack','name','map','DeskField','rawAttributes','fieldName','type','key','model','keys','filters','intersection'];(function(_0x1338c5,_0x224492){var _0x56173e=function(_0x4e31b7){while(--_0x4e31b7){_0x1338c5['push'](_0x1338c5['shift']());}};_0x56173e(++_0x224492);}(_0x8075,0x1ac));var _0x5807=function(_0x3f7980,_0x474139){_0x3f7980=_0x3f7980-0x0;var _0x279982=_0x8075[_0x3f7980];return _0x279982;};'use strict';var pdf=require(_0x5807('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5807('0x1'));var zipdir=require(_0x5807('0x2'));var jsonpatch=require(_0x5807('0x3'));var rp=require(_0x5807('0x4'));var moment=require(_0x5807('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5807('0x6'));var util=require(_0x5807('0x7'));var path=require(_0x5807('0x8'));var sox=require(_0x5807('0x9'));var csv=require(_0x5807('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5807('0xb'));var squel=require('squel');var crypto=require(_0x5807('0xc'));var jsforce=require(_0x5807('0xd'));var deskjs=require(_0x5807('0xe'));var toCsv=require(_0x5807('0xa'));var querystring=require('querystring');var Papa=require(_0x5807('0xf'));var Redis=require('ioredis');var authService=require(_0x5807('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5807('0x11'));var hardwareService=require(_0x5807('0x12'));var logger=require(_0x5807('0x13'))('api');var utils=require(_0x5807('0x14'));var config=require(_0x5807('0x15'));var db=require(_0x5807('0x16'))['db'];function respondWithStatusCode(_0x30847d,_0x6319f3){_0x6319f3=_0x6319f3||0xcc;return function(_0x143d27){if(_0x143d27){return _0x30847d[_0x5807('0x17')](_0x6319f3);}return _0x30847d[_0x5807('0x18')](_0x6319f3)[_0x5807('0x19')]();};}function respondWithResult(_0x4e6289,_0x4b1c7d){_0x4b1c7d=_0x4b1c7d||0xc8;return function(_0x4f1485){if(_0x4f1485){return _0x4e6289[_0x5807('0x18')](_0x4b1c7d)['json'](_0x4f1485);}};}function respondWithFilteredResult(_0x4c0452,_0x5f1b33){return function(_0x268b52){if(_0x268b52){var _0x4b3592=_0x268b52[_0x5807('0x1a')],_0x31c980=_0x5f1b33[_0x5807('0x1b')],_0x56f7dd=_0x5f1b33[_0x5807('0x1b')]+_0x5f1b33[_0x5807('0x1c')],_0x3f30e7;if(_0x56f7dd>=_0x4b3592){_0x56f7dd=_0x4b3592;_0x3f30e7=0xc8;}else{_0x3f30e7=0xce;}_0x4c0452[_0x5807('0x18')](_0x3f30e7);return _0x4c0452[_0x5807('0x1d')](_0x5807('0x1e'),_0x31c980+'-'+_0x56f7dd+'/'+_0x4b3592)[_0x5807('0x1f')](_0x268b52);}return null;};}function patchUpdates(_0xf40e3){return function(_0xa3c835){try{jsonpatch[_0x5807('0x20')](_0xa3c835,_0xf40e3,!![]);}catch(_0xaf47f){return BPromise['reject'](_0xaf47f);}return _0xa3c835[_0x5807('0x21')]();};}function saveUpdates(_0x10e74a,_0x428dad){return function(_0x282bf5){if(_0x282bf5){return _0x282bf5[_0x5807('0x22')](_0x10e74a)['then'](function(_0x112571){return _0x112571;});}return null;};}function removeEntity(_0x11ea6f,_0x16faad){return function(_0x2a852e){if(_0x2a852e){return _0x2a852e[_0x5807('0x23')]()['then'](function(){_0x11ea6f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48513e,_0x2aff07){return function(_0x30d1f8){if(!_0x30d1f8){_0x48513e[_0x5807('0x17')](0x194);}return _0x30d1f8;};}function handleError(_0xa7124d,_0x19e8da){_0x19e8da=_0x19e8da||0x1f4;return function(_0x1732db){logger['error'](_0x1732db[_0x5807('0x24')]);if(_0x1732db[_0x5807('0x25')]){delete _0x1732db[_0x5807('0x25')];}_0xa7124d[_0x5807('0x18')](_0x19e8da)['send'](_0x1732db);};}exports['index']=function(_0x34b3cd,_0x212f0c){var _0x3de2db={},_0x5f5973={},_0xa4beae={'count':0x0,'rows':[]};var _0xeaf48d=_[_0x5807('0x26')](db[_0x5807('0x27')][_0x5807('0x28')],function(_0x3a383e){return{'name':_0x3a383e[_0x5807('0x29')],'type':_0x3a383e[_0x5807('0x2a')][_0x5807('0x2b')]};});_0x5f5973[_0x5807('0x2c')]=_[_0x5807('0x26')](_0xeaf48d,_0x5807('0x25'));_0x5f5973['query']=_[_0x5807('0x2d')](_0x34b3cd['query']);_0x5f5973[_0x5807('0x2e')]=_['intersection'](_0x5f5973[_0x5807('0x2c')],_0x5f5973['query']);_0x3de2db['attributes']=_[_0x5807('0x2f')](_0x5f5973[_0x5807('0x2c')],qs['fields'](_0x34b3cd[_0x5807('0x30')][_0x5807('0x31')]));_0x3de2db[_0x5807('0x32')]=_0x3de2db[_0x5807('0x32')][_0x5807('0x33')]?_0x3de2db[_0x5807('0x32')]:_0x5f5973['model'];if(!_0x34b3cd[_0x5807('0x30')]['hasOwnProperty']('nolimit')){_0x3de2db['limit']=qs[_0x5807('0x1c')](_0x34b3cd[_0x5807('0x30')][_0x5807('0x1c')]);_0x3de2db[_0x5807('0x1b')]=qs['offset'](_0x34b3cd[_0x5807('0x30')]['offset']);}_0x3de2db[_0x5807('0x34')]=qs['sort'](_0x34b3cd[_0x5807('0x30')]['sort']);_0x3de2db['where']=qs['filters'](_['pick'](_0x34b3cd[_0x5807('0x30')],_0x5f5973['filters']),_0xeaf48d);if(_0x34b3cd['query']['filter']){_0x3de2db[_0x5807('0x35')]=_['merge'](_0x3de2db[_0x5807('0x35')],{'$or':_[_0x5807('0x26')](_0xeaf48d,function(_0x5bf41d){if(_0x5bf41d[_0x5807('0x2a')]!=='VIRTUAL'){var _0x505071={};_0x505071[_0x5bf41d[_0x5807('0x25')]]={'$like':'%'+_0x34b3cd['query'][_0x5807('0x36')]+'%'};return _0x505071;}})});}_0x3de2db=_['merge']({},_0x3de2db,_0x34b3cd[_0x5807('0x37')]);var _0x7b4e2a={'where':_0x3de2db[_0x5807('0x35')]};return db[_0x5807('0x27')]['count'](_0x7b4e2a)[_0x5807('0x38')](function(_0x30933c){_0xa4beae[_0x5807('0x1a')]=_0x30933c;if(_0x34b3cd[_0x5807('0x30')][_0x5807('0x39')]){_0x3de2db[_0x5807('0x3a')]=[{'all':!![]}];}return db[_0x5807('0x27')][_0x5807('0x3b')](_0x3de2db);})['then'](function(_0x1d872c){_0xa4beae[_0x5807('0x3c')]=_0x1d872c;return _0xa4beae;})['then'](respondWithFilteredResult(_0x212f0c,_0x3de2db))[_0x5807('0x3d')](handleError(_0x212f0c,null));};exports[_0x5807('0x3e')]=function(_0x4ac653,_0x525b55){var _0x2660d8={'raw':!![],'where':{'id':_0x4ac653['params']['id']}},_0x2380ef={};_0x2380ef[_0x5807('0x2c')]=_[_0x5807('0x2d')](db[_0x5807('0x27')]['rawAttributes']);_0x2380ef['query']=_[_0x5807('0x2d')](_0x4ac653['query']);_0x2380ef[_0x5807('0x2e')]=_[_0x5807('0x2f')](_0x2380ef[_0x5807('0x2c')],_0x2380ef[_0x5807('0x30')]);_0x2660d8[_0x5807('0x32')]=_['intersection'](_0x2380ef[_0x5807('0x2c')],qs[_0x5807('0x31')](_0x4ac653[_0x5807('0x30')][_0x5807('0x31')]));_0x2660d8['attributes']=_0x2660d8[_0x5807('0x32')][_0x5807('0x33')]?_0x2660d8[_0x5807('0x32')]:_0x2380ef[_0x5807('0x2c')];if(_0x4ac653[_0x5807('0x30')]['includeAll']){_0x2660d8['include']=[{'all':!![]}];}_0x2660d8=_[_0x5807('0x3f')]({},_0x2660d8,_0x4ac653['options']);return db[_0x5807('0x27')]['find'](_0x2660d8)['then'](handleEntityNotFound(_0x525b55,null))[_0x5807('0x38')](respondWithResult(_0x525b55,null))[_0x5807('0x3d')](handleError(_0x525b55,null));};exports[_0x5807('0x40')]=function(_0x5a7c12,_0x45f23c){return db['DeskField'][_0x5807('0x40')](_0x5a7c12[_0x5807('0x41')],{})['then'](respondWithResult(_0x45f23c,0xc9))[_0x5807('0x3d')](handleError(_0x45f23c,null));};exports[_0x5807('0x22')]=function(_0x184a76,_0x43181b){if(_0x184a76[_0x5807('0x41')]['id']){delete _0x184a76[_0x5807('0x41')]['id'];}return db[_0x5807('0x27')][_0x5807('0x42')]({'where':{'id':_0x184a76[_0x5807('0x43')]['id']}})[_0x5807('0x38')](handleEntityNotFound(_0x43181b,null))[_0x5807('0x38')](saveUpdates(_0x184a76['body'],null))['then'](respondWithResult(_0x43181b,null))[_0x5807('0x3d')](handleError(_0x43181b,null));};exports[_0x5807('0x23')]=function(_0x4b0ab3,_0xe97eb1){return db[_0x5807('0x27')][_0x5807('0x42')]({'where':{'id':_0x4b0ab3[_0x5807('0x43')]['id']}})[_0x5807('0x38')](handleEntityNotFound(_0xe97eb1,null))[_0x5807('0x38')](removeEntity(_0xe97eb1,null))[_0x5807('0x3d')](handleError(_0xe97eb1,null));};
\ No newline at end of file
+var _0x23b2=['../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','status','Content-Range','reject','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','options','DeskField','then','includeAll','include','findAll','catch','show','keys','length','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0x23b2,0x1ed));var _0x223b=function(_0x563e2d,_0x1a7f14){_0x563e2d=_0x563e2d-0x0;var _0x1e97b6=_0x23b2[_0x563e2d];return _0x1e97b6;};'use strict';var pdf=require(_0x223b('0x0'));var emlformat=require(_0x223b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x223b('0x2'));var jsonpatch=require(_0x223b('0x3'));var rp=require(_0x223b('0x4'));var moment=require('moment');var BPromise=require(_0x223b('0x5'));var Mustache=require(_0x223b('0x6'));var util=require(_0x223b('0x7'));var path=require(_0x223b('0x8'));var sox=require(_0x223b('0x9'));var csv=require('to-csv');var ejs=require(_0x223b('0xa'));var fs=require('fs');var _=require(_0x223b('0xb'));var squel=require(_0x223b('0xc'));var crypto=require(_0x223b('0xd'));var jsforce=require(_0x223b('0xe'));var deskjs=require(_0x223b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x223b('0x10'));var Papa=require(_0x223b('0x11'));var Redis=require(_0x223b('0x12'));var authService=require(_0x223b('0x13'));var qs=require(_0x223b('0x14'));var as=require(_0x223b('0x15'));var hardwareService=require(_0x223b('0x16'));var logger=require(_0x223b('0x17'))(_0x223b('0x18'));var utils=require(_0x223b('0x19'));var config=require(_0x223b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11e3b6,_0x347009){_0x347009=_0x347009||0xcc;return function(_0x3d2853){if(_0x3d2853){return _0x11e3b6[_0x223b('0x1b')](_0x347009);}return _0x11e3b6['status'](_0x347009)[_0x223b('0x1c')]();};}function respondWithResult(_0x14f3aa,_0x2299b2){_0x2299b2=_0x2299b2||0xc8;return function(_0x2fa753){if(_0x2fa753){return _0x14f3aa['status'](_0x2299b2)[_0x223b('0x1d')](_0x2fa753);}};}function respondWithFilteredResult(_0xfc90e,_0x15eaa5){return function(_0x8e523){if(_0x8e523){var _0x461c16=_0x8e523[_0x223b('0x1e')],_0x2d86e4=_0x15eaa5['offset'],_0x4bb11e=_0x15eaa5[_0x223b('0x1f')]+_0x15eaa5[_0x223b('0x20')],_0x255a1b;if(_0x4bb11e>=_0x461c16){_0x4bb11e=_0x461c16;_0x255a1b=0xc8;}else{_0x255a1b=0xce;}_0xfc90e[_0x223b('0x21')](_0x255a1b);return _0xfc90e['set'](_0x223b('0x22'),_0x2d86e4+'-'+_0x4bb11e+'/'+_0x461c16)[_0x223b('0x1d')](_0x8e523);}return null;};}function patchUpdates(_0x57c8cf){return function(_0x5b37d3){try{jsonpatch['apply'](_0x5b37d3,_0x57c8cf,!![]);}catch(_0xe8c626){return BPromise[_0x223b('0x23')](_0xe8c626);}return _0x5b37d3[_0x223b('0x24')]();};}function saveUpdates(_0x460837,_0x1ce705){return function(_0x25ab85){if(_0x25ab85){return _0x25ab85[_0x223b('0x25')](_0x460837)['then'](function(_0x4f2a34){return _0x4f2a34;});}return null;};}function removeEntity(_0x2785ef,_0x33c2e7){return function(_0x574409){if(_0x574409){return _0x574409[_0x223b('0x26')]()['then'](function(){_0x2785ef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x531d0e,_0x3f22ac){return function(_0x44907f){if(!_0x44907f){_0x531d0e[_0x223b('0x1b')](0x194);}return _0x44907f;};}function handleError(_0x37de38,_0x363de3){_0x363de3=_0x363de3||0x1f4;return function(_0x4c726e){logger[_0x223b('0x27')](_0x4c726e[_0x223b('0x28')]);if(_0x4c726e[_0x223b('0x29')]){delete _0x4c726e[_0x223b('0x29')];}_0x37de38[_0x223b('0x21')](_0x363de3)[_0x223b('0x2a')](_0x4c726e);};}exports['index']=function(_0x4efd4c,_0x2a2787){var _0x2b77b4={},_0x326927={},_0x3fdd0={'count':0x0,'rows':[]};var _0x16a776=_[_0x223b('0x2b')](db['DeskField'][_0x223b('0x2c')],function(_0x375b29){return{'name':_0x375b29[_0x223b('0x2d')],'type':_0x375b29[_0x223b('0x2e')]['key']};});_0x326927['model']=_[_0x223b('0x2b')](_0x16a776,_0x223b('0x29'));_0x326927[_0x223b('0x2f')]=_['keys'](_0x4efd4c['query']);_0x326927[_0x223b('0x30')]=_[_0x223b('0x31')](_0x326927[_0x223b('0x32')],_0x326927[_0x223b('0x2f')]);_0x2b77b4[_0x223b('0x33')]=_[_0x223b('0x31')](_0x326927[_0x223b('0x32')],qs[_0x223b('0x34')](_0x4efd4c[_0x223b('0x2f')]['fields']));_0x2b77b4['attributes']=_0x2b77b4[_0x223b('0x33')]['length']?_0x2b77b4[_0x223b('0x33')]:_0x326927[_0x223b('0x32')];if(!_0x4efd4c[_0x223b('0x2f')]['hasOwnProperty'](_0x223b('0x35'))){_0x2b77b4['limit']=qs[_0x223b('0x20')](_0x4efd4c[_0x223b('0x2f')][_0x223b('0x20')]);_0x2b77b4[_0x223b('0x1f')]=qs['offset'](_0x4efd4c[_0x223b('0x2f')][_0x223b('0x1f')]);}_0x2b77b4[_0x223b('0x36')]=qs[_0x223b('0x37')](_0x4efd4c[_0x223b('0x2f')][_0x223b('0x37')]);_0x2b77b4['where']=qs[_0x223b('0x30')](_[_0x223b('0x38')](_0x4efd4c['query'],_0x326927['filters']),_0x16a776);if(_0x4efd4c[_0x223b('0x2f')]['filter']){_0x2b77b4[_0x223b('0x39')]=_[_0x223b('0x3a')](_0x2b77b4[_0x223b('0x39')],{'$or':_[_0x223b('0x2b')](_0x16a776,function(_0x56badf){if(_0x56badf['type']!==_0x223b('0x3b')){var _0x114459={};_0x114459[_0x56badf['name']]={'$like':'%'+_0x4efd4c[_0x223b('0x2f')]['filter']+'%'};return _0x114459;}})});}_0x2b77b4=_[_0x223b('0x3a')]({},_0x2b77b4,_0x4efd4c[_0x223b('0x3c')]);var _0xd8e2bc={'where':_0x2b77b4[_0x223b('0x39')]};return db[_0x223b('0x3d')][_0x223b('0x1e')](_0xd8e2bc)[_0x223b('0x3e')](function(_0x24f895){_0x3fdd0[_0x223b('0x1e')]=_0x24f895;if(_0x4efd4c[_0x223b('0x2f')][_0x223b('0x3f')]){_0x2b77b4[_0x223b('0x40')]=[{'all':!![]}];}return db[_0x223b('0x3d')][_0x223b('0x41')](_0x2b77b4);})[_0x223b('0x3e')](function(_0x43246b){_0x3fdd0['rows']=_0x43246b;return _0x3fdd0;})['then'](respondWithFilteredResult(_0x2a2787,_0x2b77b4))[_0x223b('0x42')](handleError(_0x2a2787,null));};exports[_0x223b('0x43')]=function(_0x360de7,_0x28b317){var _0xb07c09={'raw':!![],'where':{'id':_0x360de7['params']['id']}},_0x46cad7={};_0x46cad7['model']=_[_0x223b('0x44')](db[_0x223b('0x3d')][_0x223b('0x2c')]);_0x46cad7[_0x223b('0x2f')]=_['keys'](_0x360de7['query']);_0x46cad7[_0x223b('0x30')]=_[_0x223b('0x31')](_0x46cad7[_0x223b('0x32')],_0x46cad7[_0x223b('0x2f')]);_0xb07c09[_0x223b('0x33')]=_['intersection'](_0x46cad7[_0x223b('0x32')],qs[_0x223b('0x34')](_0x360de7[_0x223b('0x2f')][_0x223b('0x34')]));_0xb07c09[_0x223b('0x33')]=_0xb07c09['attributes'][_0x223b('0x45')]?_0xb07c09[_0x223b('0x33')]:_0x46cad7['model'];if(_0x360de7[_0x223b('0x2f')]['includeAll']){_0xb07c09[_0x223b('0x40')]=[{'all':!![]}];}_0xb07c09=_[_0x223b('0x3a')]({},_0xb07c09,_0x360de7[_0x223b('0x3c')]);return db['DeskField'][_0x223b('0x46')](_0xb07c09)['then'](handleEntityNotFound(_0x28b317,null))[_0x223b('0x3e')](respondWithResult(_0x28b317,null))[_0x223b('0x42')](handleError(_0x28b317,null));};exports[_0x223b('0x47')]=function(_0x1f366a,_0x317576){return db[_0x223b('0x3d')][_0x223b('0x47')](_0x1f366a[_0x223b('0x48')],{})[_0x223b('0x3e')](respondWithResult(_0x317576,0xc9))[_0x223b('0x42')](handleError(_0x317576,null));};exports[_0x223b('0x25')]=function(_0xd8df25,_0x54d5c4){if(_0xd8df25[_0x223b('0x48')]['id']){delete _0xd8df25[_0x223b('0x48')]['id'];}return db[_0x223b('0x3d')][_0x223b('0x46')]({'where':{'id':_0xd8df25[_0x223b('0x49')]['id']}})['then'](handleEntityNotFound(_0x54d5c4,null))[_0x223b('0x3e')](saveUpdates(_0xd8df25['body'],null))['then'](respondWithResult(_0x54d5c4,null))[_0x223b('0x42')](handleError(_0x54d5c4,null));};exports[_0x223b('0x26')]=function(_0x39ff98,_0xbe94b8){return db[_0x223b('0x3d')]['find']({'where':{'id':_0x39ff98[_0x223b('0x49')]['id']}})[_0x223b('0x3e')](handleEntityNotFound(_0xbe94b8,null))[_0x223b('0x3e')](removeEntity(_0xbe94b8,null))[_0x223b('0x42')](handleError(_0xbe94b8,null));};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js
index bf3ae4b..8fe5d6c 100644
--- a/server/api/intDeskField/intDeskField.model.js
+++ b/server/api/intDeskField/intDeskField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf12=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash'];(function(_0x4a9cf8,_0x3b5fba){var _0xdff0dd=function(_0x55b213){while(--_0x55b213){_0x4a9cf8['push'](_0x4a9cf8['shift']());}};_0xdff0dd(++_0x3b5fba);}(_0xaf12,0x1db));var _0x2af1=function(_0x41b7f3,_0x2d95e9){_0x41b7f3=_0x41b7f3-0x0;var _0x48d434=_0xaf12[_0x41b7f3];return _0x48d434;};'use strict';var _=require(_0x2af1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2af1('0x1'));var moment=require('moment');var BPromise=require(_0x2af1('0x2'));var rp=require(_0x2af1('0x3'));var fs=require('fs');var path=require(_0x2af1('0x4'));var rimraf=require(_0x2af1('0x5'));var config=require(_0x2af1('0x6'));var attributes=require(_0x2af1('0x7'));module[_0x2af1('0x8')]=function(_0x1f1511,_0x18af19){return _0x1f1511[_0x2af1('0x9')](_0x2af1('0xa'),attributes,{'tableName':_0x2af1('0xb'),'paranoid':![],'indexes':[{'name':_0x2af1('0xc'),'fields':['idField',_0x2af1('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa269=['../../config/logger','api','bluebird','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','FieldId','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa269,0x99));var _0x9a26=function(_0x329c72,_0x155380){_0x329c72=_0x329c72-0x0;var _0x1019d8=_0xa269[_0x329c72];return _0x1019d8;};'use strict';var _=require(_0x9a26('0x0'));var util=require('util');var logger=require(_0x9a26('0x1'))(_0x9a26('0x2'));var moment=require('moment');var BPromise=require(_0x9a26('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9a26('0x4'));var config=require(_0x9a26('0x5'));var attributes=require(_0x9a26('0x6'));module[_0x9a26('0x7')]=function(_0x323de3,_0x57abd8){return _0x323de3[_0x9a26('0x8')](_0x9a26('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x9a26('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js
index 4494af0..70cf655 100644
--- a/server/api/intDeskField/intDeskField.rpc.js
+++ b/server/api/intDeskField/intDeskField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebad=['request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','DeskField,\x20%s,\x20%s'];(function(_0x19e815,_0x9f4fc8){var _0x4a2913=function(_0x2401d9){while(--_0x2401d9){_0x19e815['push'](_0x19e815['shift']());}};_0x4a2913(++_0x9f4fc8);}(_0xebad,0x8c));var _0xdeba=function(_0x385da2,_0xdc9161){_0x385da2=_0x385da2-0x0;var _0x1fdd43=_0xebad[_0x385da2];return _0x1fdd43;};'use strict';var _=require(_0xdeba('0x0'));var util=require('util');var moment=require(_0xdeba('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdeba('0x2'));var db=require(_0xdeba('0x3'))['db'];var utils=require(_0xdeba('0x4'));var logger=require(_0xdeba('0x5'))(_0xdeba('0x6'));var config=require(_0xdeba('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdeba('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b910c,_0x52ac4d,_0x549c22){return new BPromise(function(_0x30e069,_0x411a54){return client[_0xdeba('0x9')](_0x4b910c,_0x549c22)[_0xdeba('0xa')](function(_0x28150d){logger[_0xdeba('0xb')](_0xdeba('0xc'),_0x52ac4d,_0xdeba('0xd'));logger['debug'](_0xdeba('0xe'),_0x52ac4d,_0xdeba('0xd'),JSON['stringify'](_0x28150d));if(_0x28150d['error']){if(_0x28150d[_0xdeba('0xf')]['code']===0x1f4){logger['error'](_0xdeba('0xc'),_0x52ac4d,_0x28150d[_0xdeba('0xf')][_0xdeba('0x10')]);return _0x411a54(_0x28150d[_0xdeba('0xf')]['message']);}logger[_0xdeba('0xf')]('DeskField,\x20%s,\x20%s',_0x52ac4d,_0x28150d[_0xdeba('0xf')][_0xdeba('0x10')]);return _0x30e069(_0x28150d[_0xdeba('0xf')][_0xdeba('0x10')]);}else{logger[_0xdeba('0xb')](_0xdeba('0xc'),_0x52ac4d,_0xdeba('0xd'));_0x30e069(_0x28150d['result'][_0xdeba('0x10')]);}})['catch'](function(_0x2864ec){logger[_0xdeba('0xf')](_0xdeba('0xc'),_0x52ac4d,_0x2864ec);_0x411a54(_0x2864ec);});});}
\ No newline at end of file
+var _0x75ee=['request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','DeskField,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x18e84d,_0x400654){var _0x154f7c=function(_0xbb4ecb){while(--_0xbb4ecb){_0x18e84d['push'](_0x18e84d['shift']());}};_0x154f7c(++_0x400654);}(_0x75ee,0x186));var _0xe75e=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0x75ee[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe75e('0x0'));var BPromise=require(_0xe75e('0x1'));var rs=require(_0xe75e('0x2'));var fs=require('fs');var Redis=require(_0xe75e('0x3'));var db=require(_0xe75e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe75e('0x5'))('rpc');var config=require(_0xe75e('0x6'));var jayson=require(_0xe75e('0x7'));var client=jayson['client'][_0xe75e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27fc0f,_0x2840db,_0x4436c0){return new BPromise(function(_0xf6bce1,_0x1e6b43){return client[_0xe75e('0x9')](_0x27fc0f,_0x4436c0)[_0xe75e('0xa')](function(_0x9b9435){logger[_0xe75e('0xb')]('DeskField,\x20%s,\x20%s',_0x2840db,_0xe75e('0xc'));logger[_0xe75e('0xd')](_0xe75e('0xe'),_0x2840db,_0xe75e('0xc'),JSON[_0xe75e('0xf')](_0x9b9435));if(_0x9b9435[_0xe75e('0x10')]){if(_0x9b9435[_0xe75e('0x10')]['code']===0x1f4){logger['error'](_0xe75e('0x11'),_0x2840db,_0x9b9435[_0xe75e('0x10')][_0xe75e('0x12')]);return _0x1e6b43(_0x9b9435[_0xe75e('0x10')]['message']);}logger['error']('DeskField,\x20%s,\x20%s',_0x2840db,_0x9b9435[_0xe75e('0x10')][_0xe75e('0x12')]);return _0xf6bce1(_0x9b9435[_0xe75e('0x10')][_0xe75e('0x12')]);}else{logger[_0xe75e('0xb')]('DeskField,\x20%s,\x20%s',_0x2840db,_0xe75e('0xc'));_0xf6bce1(_0x9b9435[_0xe75e('0x13')]['message']);}})[_0xe75e('0x14')](function(_0x50de42){logger[_0xe75e('0x10')](_0xe75e('0x11'),_0x2840db,_0x50de42);_0x1e6b43(_0x50de42);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js
index 710097d..1ece4e8 100644
--- a/server/api/intDynamics365Account/index.js
+++ b/server/api/intDynamics365Account/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8819=['/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','isAuthenticated','show','getConfigurations'];(function(_0x2ffd05,_0x1840e3){var _0x5038bf=function(_0xe7e075){while(--_0xe7e075){_0x2ffd05['push'](_0x2ffd05['shift']());}};_0x5038bf(++_0x1840e3);}(_0x8819,0xd4));var _0x9881=function(_0x197e30,_0x1bac76){_0x197e30=_0x197e30-0x0;var _0x1ef1e3=_0x8819[_0x197e30];return _0x1ef1e3;};'use strict';var multer=require(_0x9881('0x0'));var util=require(_0x9881('0x1'));var path=require(_0x9881('0x2'));var timeout=require('connect-timeout');var express=require(_0x9881('0x3'));var router=express[_0x9881('0x4')]();var auth=require(_0x9881('0x5'));var interaction=require(_0x9881('0x6'));var config=require('../../config/environment');var controller=require(_0x9881('0x7'));router[_0x9881('0x8')]('/',auth['isAuthenticated'](),controller[_0x9881('0x9')]);router[_0x9881('0x8')]('/:id',auth[_0x9881('0xa')](),controller[_0x9881('0xb')]);router[_0x9881('0x8')]('/:id/configurations',auth[_0x9881('0xa')](),controller[_0x9881('0xc')]);router[_0x9881('0x8')](_0x9881('0xd'),auth[_0x9881('0xa')](),controller[_0x9881('0xe')]);router[_0x9881('0xf')]('/',auth[_0x9881('0xa')](),controller[_0x9881('0x10')]);router[_0x9881('0xf')](_0x9881('0x11'),auth[_0x9881('0xa')](),controller[_0x9881('0x12')]);router[_0x9881('0x13')](_0x9881('0x14'),auth[_0x9881('0xa')](),controller[_0x9881('0x15')]);router[_0x9881('0x16')](_0x9881('0x14'),auth[_0x9881('0xa')](),controller[_0x9881('0x17')]);module[_0x9881('0x18')]=router;
\ No newline at end of file
+var _0x5687=['update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration'];(function(_0xb77fe3,_0x2e3a2e){var _0x4645c7=function(_0x83cdfc){while(--_0x83cdfc){_0xb77fe3['push'](_0xb77fe3['shift']());}};_0x4645c7(++_0x2e3a2e);}(_0x5687,0x8e));var _0x7568=function(_0x2d7589,_0x5c1077){_0x2d7589=_0x2d7589-0x0;var _0x4a6ddd=_0x5687[_0x2d7589];return _0x4a6ddd;};'use strict';var multer=require('multer');var util=require(_0x7568('0x0'));var path=require(_0x7568('0x1'));var timeout=require(_0x7568('0x2'));var express=require(_0x7568('0x3'));var router=express['Router']();var auth=require(_0x7568('0x4'));var interaction=require(_0x7568('0x5'));var config=require(_0x7568('0x6'));var controller=require(_0x7568('0x7'));router[_0x7568('0x8')]('/',auth[_0x7568('0x9')](),controller[_0x7568('0xa')]);router[_0x7568('0x8')](_0x7568('0xb'),auth[_0x7568('0x9')](),controller[_0x7568('0xc')]);router[_0x7568('0x8')](_0x7568('0xd'),auth[_0x7568('0x9')](),controller[_0x7568('0xe')]);router[_0x7568('0x8')]('/:id/fields',auth[_0x7568('0x9')](),controller[_0x7568('0xf')]);router['post']('/',auth[_0x7568('0x9')](),controller[_0x7568('0x10')]);router[_0x7568('0x11')](_0x7568('0xd'),auth['isAuthenticated'](),controller[_0x7568('0x12')]);router['put'](_0x7568('0xb'),auth[_0x7568('0x9')](),controller[_0x7568('0x13')]);router[_0x7568('0x14')](_0x7568('0xb'),auth[_0x7568('0x9')](),controller[_0x7568('0x15')]);module[_0x7568('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js
index 2d1f39a..d8b2009 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.attributes.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x07f1=['exports','STRING','sequelize'];(function(_0x1ee559,_0x3c6e7e){var _0x12831c=function(_0x29898c){while(--_0x29898c){_0x1ee559['push'](_0x1ee559['shift']());}};_0x12831c(++_0x3c6e7e);}(_0x07f1,0x1dc));var _0x107f=function(_0x45bbd0,_0x53eecf){_0x45bbd0=_0x45bbd0-0x0;var _0x19c8dc=_0x07f1[_0x45bbd0];return _0x19c8dc;};'use strict';var Sequelize=require(_0x107f('0x0'));module[_0x107f('0x1')]={'name':{'type':Sequelize[_0x107f('0x2')]},'username':{'type':Sequelize[_0x107f('0x2')]},'password':{'type':Sequelize[_0x107f('0x2')]},'remoteUri':{'type':Sequelize[_0x107f('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x107f('0x2')]},'clientSecret':{'type':Sequelize[_0x107f('0x2')]},'serverUrl':{'type':Sequelize[_0x107f('0x2')]},'description':{'type':Sequelize[_0x107f('0x2')]}};
\ No newline at end of file
+var _0x6ca3=['exports','STRING'];(function(_0xab968c,_0x3e36d7){var _0x351c8d=function(_0x317b1c){while(--_0x317b1c){_0xab968c['push'](_0xab968c['shift']());}};_0x351c8d(++_0x3e36d7);}(_0x6ca3,0xa4));var _0x36ca=function(_0x214fe8,_0x3eea5e){_0x214fe8=_0x214fe8-0x0;var _0x405a51=_0x6ca3[_0x214fe8];return _0x405a51;};'use strict';var Sequelize=require('sequelize');module[_0x36ca('0x0')]={'name':{'type':Sequelize[_0x36ca('0x1')]},'username':{'type':Sequelize[_0x36ca('0x1')]},'password':{'type':Sequelize[_0x36ca('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x36ca('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x36ca('0x1')]},'serverUrl':{'type':Sequelize[_0x36ca('0x1')]},'description':{'type':Sequelize[_0x36ca('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js
index 634dd59..6d7d2d2 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.controller.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8483=['slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','includes','LogicalName','forEach','@odata.type','push','all','BooleanAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','concat','send','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','save','update','stack','name','index','map','Dynamics365Account','fieldName','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','find','destroy','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','ticketType','incident','Incident','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x1b580e,_0x469f93){var _0x4936aa=function(_0x555dfa){while(--_0x555dfa){_0x1b580e['push'](_0x1b580e['shift']());}};_0x4936aa(++_0x469f93);}(_0x8483,0x103));var _0x3848=function(_0x767fa3,_0x238478){_0x767fa3=_0x767fa3-0x0;var _0x357617=_0x8483[_0x767fa3];return _0x357617;};'use strict';var pdf=require(_0x3848('0x0'));var emlformat=require(_0x3848('0x1'));var rimraf=require(_0x3848('0x2'));var zipdir=require(_0x3848('0x3'));var jsonpatch=require(_0x3848('0x4'));var rp=require(_0x3848('0x5'));var moment=require(_0x3848('0x6'));var BPromise=require(_0x3848('0x7'));var Mustache=require(_0x3848('0x8'));var util=require(_0x3848('0x9'));var path=require(_0x3848('0xa'));var sox=require(_0x3848('0xb'));var csv=require(_0x3848('0xc'));var ejs=require(_0x3848('0xd'));var fs=require('fs');var _=require(_0x3848('0xe'));var squel=require(_0x3848('0xf'));var crypto=require(_0x3848('0x10'));var jsforce=require(_0x3848('0x11'));var deskjs=require(_0x3848('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3848('0x13'));var Redis=require('ioredis');var authService=require(_0x3848('0x14'));var qs=require(_0x3848('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3848('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x3848('0x17'));var config=require(_0x3848('0x18'));var db=require(_0x3848('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x3848('0x1a'));var client=jayson[_0x3848('0x1b')][_0x3848('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3401c0,_0x443df0,_0x57c6f1){if(_0x57c6f1){var _0x50ec4b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50ec4b[_0x3848('0x1d')](_0x443df0)){return _0x3401c0;}else{throw new db[(_0x3848('0x1e'))][(_0x3848('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3401c0;}}function respondWithRpcPromise(_0x8b310,_0x43cddc,_0x1de557,_0x5d5dd3){return new BPromise(function(_0x3ff6e5,_0x193e94){var _0x35800a=_0x5d5dd3||client;return _0x35800a[_0x3848('0x20')](_0x8b310,_0x1de557)[_0x3848('0x21')](function(_0x1a9bf9){logger[_0x3848('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x43cddc,_0x3848('0x23'));logger['debug'](_0x3848('0x24'),_0x43cddc,'request\x20sent',JSON[_0x3848('0x25')](_0x1a9bf9));if(_0x1a9bf9[_0x3848('0x26')]){if(_0x1a9bf9[_0x3848('0x26')][_0x3848('0x27')]===0x1f4){logger[_0x3848('0x26')](_0x3848('0x28'),_0x43cddc,_0x1a9bf9[_0x3848('0x26')][_0x3848('0x29')]);return _0x193e94(_0x1a9bf9[_0x3848('0x26')][_0x3848('0x29')]);}logger[_0x3848('0x26')](_0x3848('0x28'),_0x43cddc,_0x1a9bf9[_0x3848('0x26')]['message']);return _0x3ff6e5(_0x1a9bf9[_0x3848('0x26')][_0x3848('0x29')]);}else{logger[_0x3848('0x22')](_0x3848('0x28'),_0x43cddc,_0x3848('0x23'));_0x3ff6e5(_0x1a9bf9[_0x3848('0x2a')][_0x3848('0x29')]);}})[_0x3848('0x2b')](function(_0x1d8cdc){logger['error'](_0x3848('0x28'),_0x43cddc,_0x1d8cdc);_0x193e94(_0x1d8cdc);});});}function respondWithStatusCode(_0x5581fc,_0x34bcf5){_0x34bcf5=_0x34bcf5||0xcc;return function(_0x2cd807){if(_0x2cd807){return _0x5581fc[_0x3848('0x2c')](_0x34bcf5);}return _0x5581fc[_0x3848('0x2d')](_0x34bcf5)[_0x3848('0x2e')]();};}function respondWithResult(_0x2490c7,_0x531b21){_0x531b21=_0x531b21||0xc8;return function(_0x23668b){if(_0x23668b){return _0x2490c7[_0x3848('0x2d')](_0x531b21)['json'](_0x23668b);}};}function respondWithFilteredResult(_0x23a91e,_0x434d80){return function(_0x322a6e){if(_0x322a6e){var _0x57f62f=_0x322a6e['count'],_0x23b02c=_0x434d80[_0x3848('0x2f')],_0x33ede0=_0x434d80[_0x3848('0x2f')]+_0x434d80[_0x3848('0x30')],_0x9bece;if(_0x33ede0>=_0x57f62f){_0x33ede0=_0x57f62f;_0x9bece=0xc8;}else{_0x9bece=0xce;}_0x23a91e['status'](_0x9bece);return _0x23a91e[_0x3848('0x31')](_0x3848('0x32'),_0x23b02c+'-'+_0x33ede0+'/'+_0x57f62f)[_0x3848('0x33')](_0x322a6e);}return null;};}function patchUpdates(_0xc440c9){return function(_0x3fa6b2){try{jsonpatch[_0x3848('0x34')](_0x3fa6b2,_0xc440c9,!![]);}catch(_0x308f95){return BPromise['reject'](_0x308f95);}return _0x3fa6b2[_0x3848('0x35')]();};}function saveUpdates(_0x386b79,_0x320c4b){return function(_0x39a85d){if(_0x39a85d){return _0x39a85d[_0x3848('0x36')](_0x386b79)[_0x3848('0x21')](function(_0x349b81){return _0x349b81;});}return null;};}function removeEntity(_0x5e4153,_0xc38abc){return function(_0x397db2){if(_0x397db2){return _0x397db2['destroy']()[_0x3848('0x21')](function(){_0x5e4153[_0x3848('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ec733,_0x4424ab){return function(_0xfe0da5){if(!_0xfe0da5){_0x1ec733['sendStatus'](0x194);}return _0xfe0da5;};}function handleError(_0x3c3048,_0x1423de){_0x1423de=_0x1423de||0x1f4;return function(_0x1516e8){logger[_0x3848('0x26')](_0x1516e8[_0x3848('0x37')]);if(_0x1516e8['name']){delete _0x1516e8[_0x3848('0x38')];}_0x3c3048[_0x3848('0x2d')](_0x1423de)['send'](_0x1516e8);};}exports[_0x3848('0x39')]=function(_0x29c027,_0xb9b479){var _0x3062b3={},_0x2ff5fe={},_0x42a163={'count':0x0,'rows':[]};var _0x1b54ff=_[_0x3848('0x3a')](db[_0x3848('0x3b')]['rawAttributes'],function(_0x48fd7d){return{'name':_0x48fd7d[_0x3848('0x3c')],'type':_0x48fd7d['type']['key']};});_0x2ff5fe['model']=_['map'](_0x1b54ff,_0x3848('0x38'));_0x2ff5fe[_0x3848('0x3d')]=_[_0x3848('0x3e')](_0x29c027[_0x3848('0x3d')]);_0x2ff5fe['filters']=_[_0x3848('0x3f')](_0x2ff5fe[_0x3848('0x40')],_0x2ff5fe[_0x3848('0x3d')]);_0x3062b3[_0x3848('0x41')]=_[_0x3848('0x3f')](_0x2ff5fe[_0x3848('0x40')],qs['fields'](_0x29c027['query'][_0x3848('0x42')]));_0x3062b3[_0x3848('0x41')]=_0x3062b3[_0x3848('0x41')][_0x3848('0x43')]?_0x3062b3['attributes']:_0x2ff5fe[_0x3848('0x40')];if(!_0x29c027[_0x3848('0x3d')]['hasOwnProperty'](_0x3848('0x44'))){_0x3062b3[_0x3848('0x30')]=qs[_0x3848('0x30')](_0x29c027['query'][_0x3848('0x30')]);_0x3062b3[_0x3848('0x2f')]=qs[_0x3848('0x2f')](_0x29c027[_0x3848('0x3d')][_0x3848('0x2f')]);}_0x3062b3[_0x3848('0x45')]=qs[_0x3848('0x46')](_0x29c027[_0x3848('0x3d')][_0x3848('0x46')]);_0x3062b3[_0x3848('0x47')]=qs[_0x3848('0x48')](_[_0x3848('0x49')](_0x29c027[_0x3848('0x3d')],_0x2ff5fe['filters']),_0x1b54ff);if(_0x29c027[_0x3848('0x3d')][_0x3848('0x4a')]){_0x3062b3[_0x3848('0x47')]=_['merge'](_0x3062b3['where'],{'$or':_['map'](_0x1b54ff,function(_0x45f599){if(_0x45f599[_0x3848('0x4b')]!==_0x3848('0x4c')){var _0x180768={};_0x180768[_0x45f599[_0x3848('0x38')]]={'$like':'%'+_0x29c027[_0x3848('0x3d')][_0x3848('0x4a')]+'%'};return _0x180768;}})});}_0x3062b3=_[_0x3848('0x4d')]({},_0x3062b3,_0x29c027[_0x3848('0x4e')]);var _0x58bcbe={'where':_0x3062b3[_0x3848('0x47')]};return db[_0x3848('0x3b')][_0x3848('0x4f')](_0x58bcbe)[_0x3848('0x21')](function(_0x2441b7){_0x42a163[_0x3848('0x4f')]=_0x2441b7;if(_0x29c027['query'][_0x3848('0x50')]){_0x3062b3[_0x3848('0x51')]=[{'all':!![]}];}return db[_0x3848('0x3b')][_0x3848('0x52')](_0x3062b3);})[_0x3848('0x21')](function(_0x19d285){_0x42a163[_0x3848('0x53')]=_0x19d285;return _0x42a163;})[_0x3848('0x21')](respondWithFilteredResult(_0xb9b479,_0x3062b3))[_0x3848('0x2b')](handleError(_0xb9b479,null));};exports[_0x3848('0x54')]=function(_0x3ef0bd,_0x52381c){var _0x5b0168={'raw':![],'where':{'id':_0x3ef0bd[_0x3848('0x55')]['id']}},_0x124539={};_0x124539['model']=_[_0x3848('0x3e')](db[_0x3848('0x3b')][_0x3848('0x56')]);_0x124539[_0x3848('0x3d')]=_['keys'](_0x3ef0bd[_0x3848('0x3d')]);_0x124539[_0x3848('0x48')]=_[_0x3848('0x3f')](_0x124539[_0x3848('0x40')],_0x124539[_0x3848('0x3d')]);_0x5b0168['attributes']=_[_0x3848('0x3f')](_0x124539[_0x3848('0x40')],qs[_0x3848('0x42')](_0x3ef0bd[_0x3848('0x3d')][_0x3848('0x42')]));_0x5b0168['attributes']=_0x5b0168[_0x3848('0x41')][_0x3848('0x43')]?_0x5b0168['attributes']:_0x124539[_0x3848('0x40')];if(_0x3ef0bd[_0x3848('0x3d')][_0x3848('0x50')]){_0x5b0168[_0x3848('0x51')]=[{'all':!![]}];}_0x5b0168=_['merge']({},_0x5b0168,_0x3ef0bd[_0x3848('0x4e')]);return db[_0x3848('0x3b')]['find'](_0x5b0168)['then'](handleEntityNotFound(_0x52381c,null))['then'](respondWithResult(_0x52381c,null))[_0x3848('0x2b')](handleError(_0x52381c,null));};exports['create']=function(_0x357946,_0x5fec52){return db[_0x3848('0x3b')][_0x3848('0x57')](_0x357946[_0x3848('0x58')],{})[_0x3848('0x21')](respondWithResult(_0x5fec52,0xc9))[_0x3848('0x2b')](handleError(_0x5fec52,null));};exports['update']=function(_0x4dca09,_0x51faff){if(_0x4dca09[_0x3848('0x58')]['id']){delete _0x4dca09[_0x3848('0x58')]['id'];}return db[_0x3848('0x3b')][_0x3848('0x59')]({'where':{'id':_0x4dca09[_0x3848('0x55')]['id']}})[_0x3848('0x21')](handleEntityNotFound(_0x51faff,null))['then'](saveUpdates(_0x4dca09[_0x3848('0x58')],null))[_0x3848('0x21')](respondWithResult(_0x51faff,null))[_0x3848('0x2b')](handleError(_0x51faff,null));};exports[_0x3848('0x5a')]=function(_0x1a4aaf,_0x3a67da){return db[_0x3848('0x3b')][_0x3848('0x59')]({'where':{'id':_0x1a4aaf['params']['id']}})[_0x3848('0x21')](handleEntityNotFound(_0x3a67da,null))['then'](removeEntity(_0x3a67da,null))['catch'](handleError(_0x3a67da,null));};exports[_0x3848('0x5b')]=function(_0x54b03a,_0x1f7ab6,_0x3a895a){var _0x5a4bf0={};var _0x59cca5={};var _0x41ab0c;var _0x360a48;return db['Dynamics365Account'][_0x3848('0x5c')]({'where':{'id':_0x54b03a[_0x3848('0x55')]['id']}})[_0x3848('0x21')](handleEntityNotFound(_0x1f7ab6,null))[_0x3848('0x21')](function(_0x3ed3ff){if(_0x3ed3ff){_0x41ab0c=_0x3ed3ff;_0x59cca5[_0x3848('0x40')]=_['keys'](db[_0x3848('0x5d')]['rawAttributes']);_0x59cca5[_0x3848('0x3d')]=_[_0x3848('0x3e')](_0x54b03a[_0x3848('0x3d')]);_0x59cca5[_0x3848('0x48')]=_[_0x3848('0x3f')](_0x59cca5[_0x3848('0x40')],_0x59cca5[_0x3848('0x3d')]);_0x5a4bf0[_0x3848('0x41')]=_[_0x3848('0x3f')](_0x59cca5[_0x3848('0x40')],qs[_0x3848('0x42')](_0x54b03a['query'][_0x3848('0x42')]));_0x5a4bf0[_0x3848('0x41')]=_0x5a4bf0[_0x3848('0x41')][_0x3848('0x43')]?_0x5a4bf0[_0x3848('0x41')]:_0x59cca5[_0x3848('0x40')];_0x5a4bf0['order']=qs[_0x3848('0x46')](_0x54b03a['query']['sort']);_0x5a4bf0[_0x3848('0x47')]=qs[_0x3848('0x48')](_['pick'](_0x54b03a['query'],_0x59cca5[_0x3848('0x48')]));if(_0x54b03a[_0x3848('0x3d')][_0x3848('0x4a')]){_0x5a4bf0['where']=_[_0x3848('0x4d')](_0x5a4bf0[_0x3848('0x47')],{'$or':_['map'](_0x5a4bf0[_0x3848('0x41')],function(_0x5c0c79){var _0xbf2ea3={};_0xbf2ea3[_0x5c0c79]={'$like':'%'+_0x54b03a[_0x3848('0x3d')][_0x3848('0x4a')]+'%'};return _0xbf2ea3;})});}_0x5a4bf0=_[_0x3848('0x4d')]({},_0x5a4bf0,_0x54b03a['options']);return _0x41ab0c['getConfigurations'](_0x5a4bf0);}})[_0x3848('0x21')](function(_0x4bbcf7){if(_0x4bbcf7){_0x360a48=_0x4bbcf7[_0x3848('0x43')];if(!_0x54b03a[_0x3848('0x3d')][_0x3848('0x5e')](_0x3848('0x44'))){_0x5a4bf0[_0x3848('0x30')]=qs[_0x3848('0x30')](_0x54b03a[_0x3848('0x3d')][_0x3848('0x30')]);_0x5a4bf0[_0x3848('0x2f')]=qs[_0x3848('0x2f')](_0x54b03a[_0x3848('0x3d')][_0x3848('0x2f')]);}return _0x41ab0c[_0x3848('0x5b')](_0x5a4bf0);}})[_0x3848('0x21')](function(_0x54b271){if(_0x54b271){return _0x54b271?{'count':_0x360a48,'rows':_0x54b271}:null;}})[_0x3848('0x21')](respondWithResult(_0x1f7ab6,null))['catch'](handleError(_0x1f7ab6,null));};exports[_0x3848('0x5f')]=function(_0x48d40d,_0x563a8a,_0x26e485){if(_0x48d40d['body']['id']){delete _0x48d40d[_0x3848('0x58')]['id'];}return db[_0x3848('0x3b')]['findOne']({'where':{'id':_0x48d40d[_0x3848('0x55')]['id']}})['then'](handleEntityNotFound(_0x563a8a,null))[_0x3848('0x21')](function(_0x39f587){if(_0x39f587){_0x48d40d[_0x3848('0x58')][_0x3848('0x60')]=_0x39f587['id'];_0x48d40d['body']['Subjects']=integrations[_0x3848('0x61')](_0x48d40d['body'][_0x3848('0x62')],_0x48d40d[_0x3848('0x58')][_0x3848('0x4b')]);_0x48d40d[_0x3848('0x58')][_0x3848('0x63')]=integrations[_0x3848('0x64')](_0x48d40d[_0x3848('0x58')][_0x3848('0x62')],_0x48d40d[_0x3848('0x58')][_0x3848('0x4b')]);return db[_0x3848('0x5d')][_0x3848('0x57')](_0x48d40d[_0x3848('0x58')],{'include':[{'model':db['Dynamics365Field'],'as':_0x3848('0x65')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x3848('0x21')](respondWithResult(_0x563a8a,null))[_0x3848('0x2b')](handleError(_0x563a8a,null));};exports['getFields']=function(_0x5cc495,_0x1659e4,_0x34808e){var _0x5c7d9c=_0x5cc495[_0x3848('0x3d')][_0x3848('0x66')];var _0x3f77f9=_0x5c7d9c===_0x3848('0x67')?_0x3848('0x68'):'PhoneCall';var _0x1bdb26='';var _0x38e07a='';var _0x921c7='';var _0x535937='';var _0x36ead7='';var _0x2cccc9='';var _0x5164a6='';var _0x7f2f74='';var _0x201fdd=[_0x3848('0x69'),'description',_0x3848('0x6a'),_0x3848('0x6b'),_0x3848('0x6c'),_0x3848('0x6d'),_0x3848('0x6e'),_0x3848('0x6f'),'directioncode',_0x3848('0x70')];var _0x4c576b=[_0x3848('0x71'),_0x3848('0x72'),_0x3848('0x73'),_0x3848('0x74'),'contactidname',_0x3848('0x75'),_0x3848('0x76'),_0x3848('0x77'),'createdbyexternalpartyname',_0x3848('0x78'),_0x3848('0x79'),_0x3848('0x7a'),_0x3848('0x7b'),_0x3848('0x7c'),'createdonbehalfbyyominame',_0x3848('0x7d'),'customeridtype',_0x3848('0x7e'),'emailaddress',_0x3848('0x7f'),_0x3848('0x80'),_0x3848('0x81'),'escalatedon','exchangerate','firstresponsebykpiidname','followupby',_0x3848('0x82'),'influencescore',_0x3848('0x83'),'lastonholdtime',_0x3848('0x84'),_0x3848('0x85'),_0x3848('0x86'),_0x3848('0x87'),'modifiedbyyominame',_0x3848('0x88'),_0x3848('0x89'),'modifiedonbehalfbyyominame',_0x3848('0x8a'),_0x3848('0x8b'),_0x3848('0x8c'),_0x3848('0x8d'),_0x3848('0x8e'),'owneridname',_0x3848('0x8f'),_0x3848('0x90'),_0x3848('0x91'),_0x3848('0x92'),_0x3848('0x93'),_0x3848('0x94'),_0x3848('0x95'),'productserialnumber',_0x3848('0x96'),_0x3848('0x97'),_0x3848('0x98'),'responsiblecontactidname',_0x3848('0x99'),_0x3848('0x9a'),_0x3848('0x9b'),_0x3848('0x9c'),_0x3848('0x9d'),'statecode',_0x3848('0x9e'),_0x3848('0x9f'),'ticketnumber','timezoneruleversionnumber',_0x3848('0xa0'),_0x3848('0xa1'),_0x3848('0xa2'),_0x3848('0xa3')];var _0x2f7fe9=_0x201fdd['concat'](_0x4c576b);return db[_0x3848('0x3b')][_0x3848('0x5c')]({'where':{'id':_0x5cc495['params']['id']},'attributes':['id','username',_0x3848('0xa4'),_0x3848('0xa5'),_0x3848('0xa6'),_0x3848('0xa7'),_0x3848('0xa8')]})[_0x3848('0x21')](handleEntityNotFound(_0x1659e4,null))[_0x3848('0x21')](function(_0x333939){if(_0x333939){_0x7f2f74=_0x333939[_0x3848('0xa5')];var _0x3048de=_0x7f2f74[_0x3848('0xa9')](-0x1);if(_0x3048de==='/'){_0x7f2f74=_0x7f2f74[_0x3848('0xaa')](0x0,_0x7f2f74[_0x3848('0xab')](_0x3048de));}_0x5164a6=util['format'](_0x3848('0xac'),_0x7f2f74);var _0x3c0a9b={'method':_0x3848('0xad'),'uri':_0x3848('0xae')+_0x333939[_0x3848('0xa6')]+'/oauth2/token','form':{'client_id':_0x333939[_0x3848('0xa7')],'resource':_0x7f2f74,'username':_0x333939[_0x3848('0xaf')],'password':_0x333939[_0x3848('0xa4')],'grant_type':_0x3848('0xa4'),'client_secret':_0x333939['clientSecret']},'json':!![]};return rp(_0x3c0a9b);}})[_0x3848('0x21')](function(_0x42bf2d){_0x2cccc9=_0x42bf2d[_0x3848('0xb0')];var _0x27b751={'method':_0x3848('0xb1'),'uri':encodeURI(_0x5164a6+_0x3848('0xb2')+_0x3f77f9+'\x27'),'headers':{'Authorization':_0x3848('0xb3')+_0x2cccc9,'If-None-Match':null,'OData-Version':_0x3848('0xb4')},'json':!![]};return rp(_0x27b751);})[_0x3848('0x21')](function(_0x27bddb){var _0x167b57=_0x27bddb[_0x3848('0xb5')][0x0];var _0x187273=_0x167b57[_0x3848('0xb6')];var _0x2f82e3={'method':_0x3848('0xb1'),'uri':_0x5164a6+_0x3848('0xb7')+_0x187273+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x2cccc9,'If-None-Match':null,'OData-Version':_0x3848('0xb4')},'json':!![]};return rp(_0x2f82e3);})[_0x3848('0x21')](function(_0xb120d4){_0x1bdb26=_0xb120d4;_0x38e07a=_0x1bdb26[_0x3848('0xb8')];_0x38e07a=_['remove'](_0x38e07a,function(_0x45f244){return!_0x2f7fe9[_0x3848('0xb9')](_0x45f244[_0x3848('0xba')]);});var _0x5540bb=[];var _0x361332=[];_0x38e07a[_0x3848('0xbb')](function(_0x489aae){if(_0x489aae[_0x3848('0xbc')]){var _0x55b618=_0x489aae[_0x3848('0xbc')][_0x3848('0xaa')](_0x489aae[_0x3848('0xbc')][_0x3848('0xab')]('.')+0x1);if(_0x55b618==='PicklistAttributeMetadata'){_0x5540bb[_0x3848('0xbd')](getSelectList(_0x5164a6,_0x5c7d9c,_0x361332,_0x1bdb26[_0x3848('0xb6')],_0x489aae[_0x3848('0xb6')],_0x2cccc9));}}});return Promise[_0x3848('0xbe')](_0x5540bb);})[_0x3848('0x21')](function(_0x1c10b6){_0x921c7=_0x1c10b6[0x0];var _0x45bfa6=[];var _0xbef7d0=[];_0x38e07a[_0x3848('0xbb')](function(_0x4fbcec){if(!_['isNil'](_0x4fbcec[_0x3848('0xbc')])){var _0x20c3de=_0x4fbcec[_0x3848('0xbc')][_0x3848('0xaa')](_0x4fbcec[_0x3848('0xbc')]['lastIndexOf']('.')+0x1);if(_0x20c3de===_0x3848('0xbf')){_0x45bfa6[_0x3848('0xbd')](getBooleanList(_0x5164a6,_0x5c7d9c,_0xbef7d0,_0x1bdb26[_0x3848('0xb6')],_0x4fbcec[_0x3848('0xb6')],_0x2cccc9));}}});return Promise[_0x3848('0xbe')](_0x45bfa6);})[_0x3848('0x21')](function(_0x12603d){_0x535937=_0x12603d[0x0];var _0x4a6e4b=[];var _0x1618ab=[];_0x38e07a[_0x3848('0xbb')](function(_0xe059d0){if(_0xe059d0[_0x3848('0xbc')]){var _0x101b3b=_0xe059d0[_0x3848('0xbc')]['substring'](_0xe059d0['@odata.type'][_0x3848('0xab')]('.')+0x1);if(_0x101b3b==='StringAttributeMetadata'||_0x101b3b==='DoubleAttributeMetadata'||_0x101b3b===_0x3848('0xc0')||_0x101b3b===_0x3848('0xc1')||_0x101b3b==='MemoAttributeMetadata'||_0x101b3b===_0x3848('0xc2')||_0x101b3b===_0x3848('0xc3')||_0x101b3b==='EntityNameAttributeMetadata'||_0x101b3b===_0x3848('0xc4')||_0x101b3b==='DecimalAttributeMetadata'){_0x4a6e4b[_0x3848('0xbd')](getInputList(_0x5164a6,_0x5c7d9c,_0x101b3b,_0x1618ab,_0x1bdb26[_0x3848('0xb6')],_0xe059d0['MetadataId'],_0x2cccc9));}}});return Promise[_0x3848('0xbe')](_0x4a6e4b);})[_0x3848('0x21')](function(_0x4a8284){_0x36ead7=_0x4a8284[0x0];var _0xcd41ba=_0x921c7[_0x3848('0xc5')](_0x535937)[_0x3848('0xc5')](_0x36ead7);var _0x34d5b4={'count':_0xcd41ba[_0x3848('0x43')],'rows':_0xcd41ba};return _0x34d5b4;})[_0x3848('0x21')](respondWithResult(_0x1659e4,null))[_0x3848('0x2b')](function(_0x182901){var _0x248c40=_0x5cc495[_0x3848('0x3d')][_0x3848('0x1d')]?0x1f4:_0x182901['statusCode']||0x1f4;logger[_0x3848('0x26')](_0x182901[_0x3848('0x37')]);delete _0x182901[_0x3848('0x38')];if(_0x248c40===0x191){_0x248c40=0x190;}_0x1659e4[_0x3848('0x2d')](_0x248c40)[_0x3848('0xc6')](_0x5cc495[_0x3848('0x3d')][_0x3848('0x1d')]?{'message':_0x3848('0xc7'),'statusCode':_0x182901[_0x3848('0xc8')]}:_0x182901);});};function getSelectList(_0x1d8c46,_0x369e09,_0x2ce5b5,_0x40e275,_0x25b830,_0x49e563){var _0xa31cad={'method':'GET','uri':_0x1d8c46+_0x3848('0xb7')+_0x40e275+_0x3848('0xc9')+_0x25b830+_0x3848('0xca')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x3848('0xb3')+_0x49e563,'If-None-Match':null,'OData-Version':_0x3848('0xb4')},'json':!![]};return rp(_0xa31cad)[_0x3848('0x21')](function(_0x355131){var _0x114ef3=[];var _0x1f2ff9=_0x355131['OptionSet'][_0x3848('0xcb')];_0x1f2ff9['forEach'](function(_0x1f462b){_0x114ef3[_0x3848('0xbd')]({'name':_0x1f462b[_0x3848('0xcc')]['UserLocalizedLabel'][_0x3848('0xcc')],'value':String(_0x1f462b[_0x3848('0xcd')])});});var _0x192ee2={'id':_0x369e09+'_'+_0x355131[_0x3848('0xba')],'name':_0x355131[_0x3848('0xce')][_0x3848('0xcf')]['Label'],'custom':![],'options':_0x114ef3};_0x2ce5b5[_0x3848('0xbd')](_0x192ee2);return _0x2ce5b5;});}function getBooleanList(_0x265977,_0xa82dcc,_0x11dc57,_0x2428ab,_0x194578,_0x3a5b5a){var _0x208244={'method':_0x3848('0xb1'),'uri':_0x265977+'EntityDefinitions('+_0x2428ab+')/Attributes('+_0x194578+_0x3848('0xd0'),'headers':{'Authorization':_0x3848('0xb3')+_0x3a5b5a,'If-None-Match':null,'OData-Version':_0x3848('0xb4')},'json':!![]};return rp(_0x208244)[_0x3848('0x21')](function(_0x51e4c3){var _0x1109e6=[];_0x1109e6[_0x3848('0xbd')]({'name':_0x51e4c3[_0x3848('0xd1')]['TrueOption'][_0x3848('0xcc')]['UserLocalizedLabel'][_0x3848('0xcc')],'value':_0x3848('0xd2')},{'name':_0x51e4c3[_0x3848('0xd1')][_0x3848('0xd3')]['Label'][_0x3848('0xcf')][_0x3848('0xcc')],'value':'false'});var _0x5603f5={'id':_0xa82dcc+'_'+_0x51e4c3[_0x3848('0xba')],'name':_0x51e4c3[_0x3848('0xce')][_0x3848('0xcf')][_0x3848('0xcc')],'custom':![],'options':_0x1109e6};_0x11dc57[_0x3848('0xbd')](_0x5603f5);return _0x11dc57;});}function getInputList(_0x3c154a,_0x2bc715,_0x572b9b,_0x4f91f5,_0xa1effd,_0x4849d3,_0x22d086){var _0x4d0d40={'method':_0x3848('0xb1'),'uri':_0x3c154a+_0x3848('0xb7')+_0xa1effd+')/Attributes('+_0x4849d3+_0x3848('0xd4')+_0x572b9b+_0x3848('0xd5'),'headers':{'Authorization':_0x3848('0xb3')+_0x22d086,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4d0d40)[_0x3848('0x21')](function(_0x5979e2){var _0xa15fc3={'id':_0x2bc715+'_'+_0x5979e2[_0x3848('0xba')],'name':_0x5979e2[_0x3848('0xce')][_0x3848('0xcf')]?_0x5979e2[_0x3848('0xce')][_0x3848('0xcf')][_0x3848('0xcc')]:_0x5979e2[_0x3848('0xba')],'custom':![],'options':[]};_0x4f91f5[_0x3848('0xbd')](_0xa15fc3);return _0x4f91f5;});}
\ No newline at end of file
+var _0x43ab=['getSubjects','channel','type','Descriptions','create','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','createdbyexternalpartyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientSecret','slice','substring','format','%s/api/data/v9.0/','POST','/oauth2/token','clientId','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','all','forEach','isNil','lastIndexOf','BooleanAttributeMetadata','push','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','false','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','Dynamics365Account','rows','show','params','fields','include','options','find','catch','body','findOne','Dynamics365Configuration','nolimit','addConfiguration','Subjects'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x43ab,0x7e));var _0xb43a=function(_0x5f3731,_0x57ecc6){_0x5f3731=_0x5f3731-0x0;var _0x4a0a9d=_0x43ab[_0x5f3731];return _0x4a0a9d;};'use strict';var pdf=require(_0xb43a('0x0'));var emlformat=require(_0xb43a('0x1'));var rimraf=require(_0xb43a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb43a('0x3'));var rp=require('request-promise');var moment=require(_0xb43a('0x4'));var BPromise=require(_0xb43a('0x5'));var Mustache=require(_0xb43a('0x6'));var util=require(_0xb43a('0x7'));var path=require(_0xb43a('0x8'));var sox=require(_0xb43a('0x9'));var csv=require('to-csv');var ejs=require(_0xb43a('0xa'));var fs=require('fs');var _=require(_0xb43a('0xb'));var squel=require(_0xb43a('0xc'));var crypto=require(_0xb43a('0xd'));var jsforce=require(_0xb43a('0xe'));var deskjs=require(_0xb43a('0xf'));var toCsv=require(_0xb43a('0x10'));var querystring=require(_0xb43a('0x11'));var Papa=require(_0xb43a('0x12'));var Redis=require('ioredis');var authService=require(_0xb43a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb43a('0x14'));var hardwareService=require(_0xb43a('0x15'));var logger=require(_0xb43a('0x16'))(_0xb43a('0x17'));var utils=require(_0xb43a('0x18'));var config=require(_0xb43a('0x19'));var db=require(_0xb43a('0x1a'))['db'];var integrations=require(_0xb43a('0x1b'));var jayson=require(_0xb43a('0x1c'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x793734,_0x3060dd,_0x1329ca){if(_0x1329ca){var _0x472c89=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x472c89[_0xb43a('0x1d')](_0x3060dd)){return _0x793734;}else{throw new db[(_0xb43a('0x1e'))][(_0xb43a('0x1f'))](_0xb43a('0x20'));}}else{return _0x793734;}}function respondWithRpcPromise(_0x478058,_0x48d848,_0x551325,_0x9a37af){return new BPromise(function(_0x419d43,_0x287bd5){var _0x41978e=_0x9a37af||client;return _0x41978e[_0xb43a('0x21')](_0x478058,_0x551325)[_0xb43a('0x22')](function(_0x3f7ab5){logger['info'](_0xb43a('0x23'),_0x48d848,_0xb43a('0x24'));logger[_0xb43a('0x25')](_0xb43a('0x26'),_0x48d848,_0xb43a('0x24'),JSON[_0xb43a('0x27')](_0x3f7ab5));if(_0x3f7ab5[_0xb43a('0x28')]){if(_0x3f7ab5['error']['code']===0x1f4){logger['error'](_0xb43a('0x23'),_0x48d848,_0x3f7ab5[_0xb43a('0x28')][_0xb43a('0x29')]);return _0x287bd5(_0x3f7ab5[_0xb43a('0x28')][_0xb43a('0x29')]);}logger[_0xb43a('0x28')](_0xb43a('0x23'),_0x48d848,_0x3f7ab5[_0xb43a('0x28')][_0xb43a('0x29')]);return _0x419d43(_0x3f7ab5['error'][_0xb43a('0x29')]);}else{logger['info'](_0xb43a('0x23'),_0x48d848,_0xb43a('0x24'));_0x419d43(_0x3f7ab5[_0xb43a('0x2a')][_0xb43a('0x29')]);}})['catch'](function(_0xb95701){logger[_0xb43a('0x28')](_0xb43a('0x23'),_0x48d848,_0xb95701);_0x287bd5(_0xb95701);});});}function respondWithStatusCode(_0x5c2175,_0x431169){_0x431169=_0x431169||0xcc;return function(_0x4bc83f){if(_0x4bc83f){return _0x5c2175[_0xb43a('0x2b')](_0x431169);}return _0x5c2175[_0xb43a('0x2c')](_0x431169)[_0xb43a('0x2d')]();};}function respondWithResult(_0x5bf150,_0x300896){_0x300896=_0x300896||0xc8;return function(_0x7a3284){if(_0x7a3284){return _0x5bf150[_0xb43a('0x2c')](_0x300896)[_0xb43a('0x2e')](_0x7a3284);}};}function respondWithFilteredResult(_0x4d9fbf,_0x497bdc){return function(_0x382d38){if(_0x382d38){var _0xb0ea39=_0x382d38[_0xb43a('0x2f')],_0x21e4ba=_0x497bdc[_0xb43a('0x30')],_0x2ae1d3=_0x497bdc[_0xb43a('0x30')]+_0x497bdc[_0xb43a('0x31')],_0x2674cd;if(_0x2ae1d3>=_0xb0ea39){_0x2ae1d3=_0xb0ea39;_0x2674cd=0xc8;}else{_0x2674cd=0xce;}_0x4d9fbf['status'](_0x2674cd);return _0x4d9fbf[_0xb43a('0x32')](_0xb43a('0x33'),_0x21e4ba+'-'+_0x2ae1d3+'/'+_0xb0ea39)[_0xb43a('0x2e')](_0x382d38);}return null;};}function patchUpdates(_0x1aec53){return function(_0x48833e){try{jsonpatch['apply'](_0x48833e,_0x1aec53,!![]);}catch(_0x4e852c){return BPromise[_0xb43a('0x34')](_0x4e852c);}return _0x48833e['save']();};}function saveUpdates(_0x5b94b0,_0x31b0f9){return function(_0x3425d0){if(_0x3425d0){return _0x3425d0[_0xb43a('0x35')](_0x5b94b0)[_0xb43a('0x22')](function(_0x198ab5){return _0x198ab5;});}return null;};}function removeEntity(_0x59f0be,_0x432c44){return function(_0x3dc620){if(_0x3dc620){return _0x3dc620[_0xb43a('0x36')]()[_0xb43a('0x22')](function(){_0x59f0be['status'](0xcc)[_0xb43a('0x2d')]();});}};}function handleEntityNotFound(_0x11450d,_0x1a6739){return function(_0x443278){if(!_0x443278){_0x11450d[_0xb43a('0x2b')](0x194);}return _0x443278;};}function handleError(_0x51acbc,_0x176b3b){_0x176b3b=_0x176b3b||0x1f4;return function(_0x483c35){logger[_0xb43a('0x28')](_0x483c35['stack']);if(_0x483c35[_0xb43a('0x37')]){delete _0x483c35['name'];}_0x51acbc[_0xb43a('0x2c')](_0x176b3b)[_0xb43a('0x38')](_0x483c35);};}exports['index']=function(_0x3e7bde,_0x6b7705){var _0x52e762={},_0x1f367d={},_0x306b0e={'count':0x0,'rows':[]};var _0x2edccc=_[_0xb43a('0x39')](db['Dynamics365Account'][_0xb43a('0x3a')],function(_0x2d9e90){return{'name':_0x2d9e90[_0xb43a('0x3b')],'type':_0x2d9e90['type'][_0xb43a('0x3c')]};});_0x1f367d[_0xb43a('0x3d')]=_[_0xb43a('0x39')](_0x2edccc,_0xb43a('0x37'));_0x1f367d[_0xb43a('0x3e')]=_[_0xb43a('0x3f')](_0x3e7bde[_0xb43a('0x3e')]);_0x1f367d[_0xb43a('0x40')]=_[_0xb43a('0x41')](_0x1f367d[_0xb43a('0x3d')],_0x1f367d['query']);_0x52e762[_0xb43a('0x42')]=_[_0xb43a('0x41')](_0x1f367d[_0xb43a('0x3d')],qs['fields'](_0x3e7bde[_0xb43a('0x3e')]['fields']));_0x52e762[_0xb43a('0x42')]=_0x52e762['attributes'][_0xb43a('0x43')]?_0x52e762[_0xb43a('0x42')]:_0x1f367d[_0xb43a('0x3d')];if(!_0x3e7bde[_0xb43a('0x3e')][_0xb43a('0x44')]('nolimit')){_0x52e762[_0xb43a('0x31')]=qs[_0xb43a('0x31')](_0x3e7bde['query'][_0xb43a('0x31')]);_0x52e762[_0xb43a('0x30')]=qs[_0xb43a('0x30')](_0x3e7bde[_0xb43a('0x3e')][_0xb43a('0x30')]);}_0x52e762[_0xb43a('0x45')]=qs[_0xb43a('0x46')](_0x3e7bde[_0xb43a('0x3e')][_0xb43a('0x46')]);_0x52e762[_0xb43a('0x47')]=qs[_0xb43a('0x40')](_[_0xb43a('0x48')](_0x3e7bde[_0xb43a('0x3e')],_0x1f367d['filters']),_0x2edccc);if(_0x3e7bde['query'][_0xb43a('0x49')]){_0x52e762[_0xb43a('0x47')]=_[_0xb43a('0x4a')](_0x52e762[_0xb43a('0x47')],{'$or':_[_0xb43a('0x39')](_0x2edccc,function(_0x11f93b){if(_0x11f93b['type']!==_0xb43a('0x4b')){var _0x3bec29={};_0x3bec29[_0x11f93b[_0xb43a('0x37')]]={'$like':'%'+_0x3e7bde[_0xb43a('0x3e')]['filter']+'%'};return _0x3bec29;}})});}_0x52e762=_[_0xb43a('0x4a')]({},_0x52e762,_0x3e7bde['options']);var _0x311a37={'where':_0x52e762[_0xb43a('0x47')]};return db['Dynamics365Account'][_0xb43a('0x2f')](_0x311a37)[_0xb43a('0x22')](function(_0x4d87af){_0x306b0e[_0xb43a('0x2f')]=_0x4d87af;if(_0x3e7bde[_0xb43a('0x3e')][_0xb43a('0x4c')]){_0x52e762['include']=[{'all':!![]}];}return db[_0xb43a('0x4d')]['findAll'](_0x52e762);})[_0xb43a('0x22')](function(_0x9f5dfa){_0x306b0e[_0xb43a('0x4e')]=_0x9f5dfa;return _0x306b0e;})[_0xb43a('0x22')](respondWithFilteredResult(_0x6b7705,_0x52e762))['catch'](handleError(_0x6b7705,null));};exports[_0xb43a('0x4f')]=function(_0x5a66f5,_0xbf0fea){var _0x16369d={'raw':![],'where':{'id':_0x5a66f5[_0xb43a('0x50')]['id']}},_0xfa583d={};_0xfa583d[_0xb43a('0x3d')]=_[_0xb43a('0x3f')](db[_0xb43a('0x4d')][_0xb43a('0x3a')]);_0xfa583d[_0xb43a('0x3e')]=_[_0xb43a('0x3f')](_0x5a66f5[_0xb43a('0x3e')]);_0xfa583d[_0xb43a('0x40')]=_[_0xb43a('0x41')](_0xfa583d['model'],_0xfa583d[_0xb43a('0x3e')]);_0x16369d['attributes']=_[_0xb43a('0x41')](_0xfa583d[_0xb43a('0x3d')],qs[_0xb43a('0x51')](_0x5a66f5['query'][_0xb43a('0x51')]));_0x16369d[_0xb43a('0x42')]=_0x16369d[_0xb43a('0x42')]['length']?_0x16369d[_0xb43a('0x42')]:_0xfa583d[_0xb43a('0x3d')];if(_0x5a66f5[_0xb43a('0x3e')][_0xb43a('0x4c')]){_0x16369d[_0xb43a('0x52')]=[{'all':!![]}];}_0x16369d=_[_0xb43a('0x4a')]({},_0x16369d,_0x5a66f5[_0xb43a('0x53')]);return db[_0xb43a('0x4d')][_0xb43a('0x54')](_0x16369d)['then'](handleEntityNotFound(_0xbf0fea,null))['then'](respondWithResult(_0xbf0fea,null))[_0xb43a('0x55')](handleError(_0xbf0fea,null));};exports['create']=function(_0x2f8d11,_0x4a2431){return db[_0xb43a('0x4d')]['create'](_0x2f8d11[_0xb43a('0x56')],{})[_0xb43a('0x22')](respondWithResult(_0x4a2431,0xc9))[_0xb43a('0x55')](handleError(_0x4a2431,null));};exports['update']=function(_0x3f12bd,_0x2351a5){if(_0x3f12bd[_0xb43a('0x56')]['id']){delete _0x3f12bd['body']['id'];}return db[_0xb43a('0x4d')]['find']({'where':{'id':_0x3f12bd[_0xb43a('0x50')]['id']}})[_0xb43a('0x22')](handleEntityNotFound(_0x2351a5,null))['then'](saveUpdates(_0x3f12bd[_0xb43a('0x56')],null))[_0xb43a('0x22')](respondWithResult(_0x2351a5,null))['catch'](handleError(_0x2351a5,null));};exports['destroy']=function(_0x2d3d59,_0xab4e7d){return db['Dynamics365Account'][_0xb43a('0x54')]({'where':{'id':_0x2d3d59[_0xb43a('0x50')]['id']}})[_0xb43a('0x22')](handleEntityNotFound(_0xab4e7d,null))['then'](removeEntity(_0xab4e7d,null))['catch'](handleError(_0xab4e7d,null));};exports['getConfigurations']=function(_0x16925d,_0x1a9ee6,_0x59981e){var _0x288230={};var _0x43830c={};var _0x1f4713;var _0x4da9e3;return db[_0xb43a('0x4d')][_0xb43a('0x57')]({'where':{'id':_0x16925d[_0xb43a('0x50')]['id']}})[_0xb43a('0x22')](handleEntityNotFound(_0x1a9ee6,null))['then'](function(_0x8b2c86){if(_0x8b2c86){_0x1f4713=_0x8b2c86;_0x43830c['model']=_[_0xb43a('0x3f')](db[_0xb43a('0x58')][_0xb43a('0x3a')]);_0x43830c[_0xb43a('0x3e')]=_[_0xb43a('0x3f')](_0x16925d[_0xb43a('0x3e')]);_0x43830c[_0xb43a('0x40')]=_[_0xb43a('0x41')](_0x43830c[_0xb43a('0x3d')],_0x43830c[_0xb43a('0x3e')]);_0x288230['attributes']=_[_0xb43a('0x41')](_0x43830c[_0xb43a('0x3d')],qs['fields'](_0x16925d[_0xb43a('0x3e')][_0xb43a('0x51')]));_0x288230[_0xb43a('0x42')]=_0x288230[_0xb43a('0x42')]['length']?_0x288230[_0xb43a('0x42')]:_0x43830c[_0xb43a('0x3d')];_0x288230[_0xb43a('0x45')]=qs['sort'](_0x16925d['query']['sort']);_0x288230['where']=qs[_0xb43a('0x40')](_[_0xb43a('0x48')](_0x16925d[_0xb43a('0x3e')],_0x43830c[_0xb43a('0x40')]));if(_0x16925d[_0xb43a('0x3e')][_0xb43a('0x49')]){_0x288230[_0xb43a('0x47')]=_[_0xb43a('0x4a')](_0x288230[_0xb43a('0x47')],{'$or':_[_0xb43a('0x39')](_0x288230[_0xb43a('0x42')],function(_0x44534c){var _0x24379e={};_0x24379e[_0x44534c]={'$like':'%'+_0x16925d[_0xb43a('0x3e')][_0xb43a('0x49')]+'%'};return _0x24379e;})});}_0x288230=_[_0xb43a('0x4a')]({},_0x288230,_0x16925d[_0xb43a('0x53')]);return _0x1f4713['getConfigurations'](_0x288230);}})[_0xb43a('0x22')](function(_0x4b983f){if(_0x4b983f){_0x4da9e3=_0x4b983f[_0xb43a('0x43')];if(!_0x16925d[_0xb43a('0x3e')][_0xb43a('0x44')](_0xb43a('0x59'))){_0x288230['limit']=qs['limit'](_0x16925d['query'][_0xb43a('0x31')]);_0x288230['offset']=qs[_0xb43a('0x30')](_0x16925d[_0xb43a('0x3e')][_0xb43a('0x30')]);}return _0x1f4713['getConfigurations'](_0x288230);}})[_0xb43a('0x22')](function(_0xdc6eb1){if(_0xdc6eb1){return _0xdc6eb1?{'count':_0x4da9e3,'rows':_0xdc6eb1}:null;}})[_0xb43a('0x22')](respondWithResult(_0x1a9ee6,null))['catch'](handleError(_0x1a9ee6,null));};exports[_0xb43a('0x5a')]=function(_0xf0642e,_0x46fbfd,_0x51761c){if(_0xf0642e[_0xb43a('0x56')]['id']){delete _0xf0642e[_0xb43a('0x56')]['id'];}return db[_0xb43a('0x4d')][_0xb43a('0x57')]({'where':{'id':_0xf0642e['params']['id']}})[_0xb43a('0x22')](handleEntityNotFound(_0x46fbfd,null))[_0xb43a('0x22')](function(_0x3a7caa){if(_0x3a7caa){_0xf0642e['body']['AccountId']=_0x3a7caa['id'];_0xf0642e[_0xb43a('0x56')][_0xb43a('0x5b')]=integrations[_0xb43a('0x5c')](_0xf0642e[_0xb43a('0x56')][_0xb43a('0x5d')],_0xf0642e[_0xb43a('0x56')][_0xb43a('0x5e')]);_0xf0642e['body'][_0xb43a('0x5f')]=integrations['getDescriptions'](_0xf0642e[_0xb43a('0x56')]['channel'],_0xf0642e[_0xb43a('0x56')][_0xb43a('0x5e')]);return db['Dynamics365Configuration'][_0xb43a('0x60')](_0xf0642e[_0xb43a('0x56')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0xb43a('0x61')],'as':_0xb43a('0x5f')}]});}return null;})[_0xb43a('0x22')](respondWithResult(_0x46fbfd,null))[_0xb43a('0x55')](handleError(_0x46fbfd,null));};exports[_0xb43a('0x62')]=function(_0xd438ab,_0x254a65,_0x12c695){var _0x1689bc=_0xd438ab[_0xb43a('0x3e')][_0xb43a('0x63')];var _0x6f696e=_0x1689bc===_0xb43a('0x64')?_0xb43a('0x65'):_0xb43a('0x66');var _0xfd7c5a='';var _0x5340fd='';var _0x2f2f8e='';var _0x5c1627='';var _0x58219b='';var _0x577f1a='';var _0x403c92='';var _0x5383cf='';var _0x23474e=[_0xb43a('0x67'),'description',_0xb43a('0x68'),_0xb43a('0x69'),_0xb43a('0x6a'),_0xb43a('0x6b'),'phonenumber',_0xb43a('0x6c'),_0xb43a('0x6d'),_0xb43a('0x6e')];var _0x56a99b=[_0xb43a('0x6f'),_0xb43a('0x70'),_0xb43a('0x71'),_0xb43a('0x72'),_0xb43a('0x73'),_0xb43a('0x74'),'contractdetailidname','contractidname',_0xb43a('0x75'),'createdbyexternalpartyyominame','createdbyname','createdbyyominame',_0xb43a('0x76'),_0xb43a('0x77'),'createdonbehalfbyyominame',_0xb43a('0x78'),_0xb43a('0x79'),_0xb43a('0x7a'),_0xb43a('0x7b'),_0xb43a('0x7c'),_0xb43a('0x7d'),_0xb43a('0x7e'),_0xb43a('0x7f'),_0xb43a('0x80'),_0xb43a('0x81'),'followupby',_0xb43a('0x82'),_0xb43a('0x83'),'kbarticleidname',_0xb43a('0x84'),_0xb43a('0x85'),_0xb43a('0x86'),_0xb43a('0x87'),_0xb43a('0x88'),_0xb43a('0x89'),'modifiedon','modifiedonbehalfbyname',_0xb43a('0x8a'),_0xb43a('0x8b'),_0xb43a('0x8c'),_0xb43a('0x8d'),_0xb43a('0x8e'),_0xb43a('0x8f'),_0xb43a('0x90'),_0xb43a('0x91'),_0xb43a('0x92'),_0xb43a('0x93'),_0xb43a('0x94'),_0xb43a('0x95'),_0xb43a('0x96'),'productidname','productserialnumber',_0xb43a('0x97'),_0xb43a('0x98'),_0xb43a('0x99'),_0xb43a('0x9a'),'responsiblecontactidyominame','sentimentvalue',_0xb43a('0x9b'),_0xb43a('0x9c'),_0xb43a('0x9d'),_0xb43a('0x9e'),_0xb43a('0x9f'),_0xb43a('0xa0'),'ticketnumber',_0xb43a('0xa1'),_0xb43a('0xa2'),'traversedpath',_0xb43a('0xa3'),_0xb43a('0xa4')];var _0xad71c3=_0x23474e[_0xb43a('0xa5')](_0x56a99b);return db[_0xb43a('0x4d')][_0xb43a('0x57')]({'where':{'id':_0xd438ab['params']['id']},'attributes':['id',_0xb43a('0xa6'),'password',_0xb43a('0xa7'),_0xb43a('0xa8'),'clientId',_0xb43a('0xa9')]})[_0xb43a('0x22')](handleEntityNotFound(_0x254a65,null))[_0xb43a('0x22')](function(_0x3b4759){if(_0x3b4759){_0x5383cf=_0x3b4759[_0xb43a('0xa7')];var _0x75d431=_0x5383cf[_0xb43a('0xaa')](-0x1);if(_0x75d431==='/'){_0x5383cf=_0x5383cf[_0xb43a('0xab')](0x0,_0x5383cf['lastIndexOf'](_0x75d431));}_0x403c92=util[_0xb43a('0xac')](_0xb43a('0xad'),_0x5383cf);var _0xd67054={'method':_0xb43a('0xae'),'uri':'https://login.microsoftonline.com/'+_0x3b4759[_0xb43a('0xa8')]+_0xb43a('0xaf'),'form':{'client_id':_0x3b4759[_0xb43a('0xb0')],'resource':_0x5383cf,'username':_0x3b4759['username'],'password':_0x3b4759[_0xb43a('0xb1')],'grant_type':_0xb43a('0xb1'),'client_secret':_0x3b4759[_0xb43a('0xa9')]},'json':!![]};return rp(_0xd67054);}})['then'](function(_0x1e5288){_0x577f1a=_0x1e5288[_0xb43a('0xb2')];var _0x367793={'method':_0xb43a('0xb3'),'uri':encodeURI(_0x403c92+_0xb43a('0xb4')+_0x6f696e+'\x27'),'headers':{'Authorization':_0xb43a('0xb5')+_0x577f1a,'If-None-Match':null,'OData-Version':_0xb43a('0xb6')},'json':!![]};return rp(_0x367793);})['then'](function(_0x582c4e){var _0x10225a=_0x582c4e[_0xb43a('0xb7')][0x0];var _0x39e462=_0x10225a[_0xb43a('0xb8')];var _0x5946c7={'method':'GET','uri':_0x403c92+'EntityDefinitions('+_0x39e462+_0xb43a('0xb9'),'headers':{'Authorization':'Bearer\x20'+_0x577f1a,'If-None-Match':null,'OData-Version':_0xb43a('0xb6')},'json':!![]};return rp(_0x5946c7);})[_0xb43a('0x22')](function(_0x16deef){_0xfd7c5a=_0x16deef;_0x5340fd=_0xfd7c5a['Attributes'];_0x5340fd=_[_0xb43a('0xba')](_0x5340fd,function(_0x2c125d){return!_0xad71c3[_0xb43a('0xbb')](_0x2c125d[_0xb43a('0xbc')]);});var _0x7c601=[];var _0x3e763b=[];_0x5340fd['forEach'](function(_0x2e7688){if(_0x2e7688[_0xb43a('0xbd')]){var _0x33e517=_0x2e7688[_0xb43a('0xbd')][_0xb43a('0xab')](_0x2e7688[_0xb43a('0xbd')]['lastIndexOf']('.')+0x1);if(_0x33e517==='PicklistAttributeMetadata'){_0x7c601['push'](getSelectList(_0x403c92,_0x1689bc,_0x3e763b,_0xfd7c5a[_0xb43a('0xb8')],_0x2e7688[_0xb43a('0xb8')],_0x577f1a));}}});return Promise[_0xb43a('0xbe')](_0x7c601);})[_0xb43a('0x22')](function(_0x2e48fa){_0x2f2f8e=_0x2e48fa[0x0];var _0x4b003a=[];var _0x1986a9=[];_0x5340fd[_0xb43a('0xbf')](function(_0x21aa68){if(!_[_0xb43a('0xc0')](_0x21aa68[_0xb43a('0xbd')])){var _0x51bbc9=_0x21aa68[_0xb43a('0xbd')][_0xb43a('0xab')](_0x21aa68[_0xb43a('0xbd')][_0xb43a('0xc1')]('.')+0x1);if(_0x51bbc9===_0xb43a('0xc2')){_0x4b003a[_0xb43a('0xc3')](getBooleanList(_0x403c92,_0x1689bc,_0x1986a9,_0xfd7c5a[_0xb43a('0xb8')],_0x21aa68[_0xb43a('0xb8')],_0x577f1a));}}});return Promise[_0xb43a('0xbe')](_0x4b003a);})['then'](function(_0x2ec149){_0x5c1627=_0x2ec149[0x0];var _0x384c9b=[];var _0x4ee53c=[];_0x5340fd[_0xb43a('0xbf')](function(_0x3be1ad){if(_0x3be1ad['@odata.type']){var _0x3f6584=_0x3be1ad['@odata.type'][_0xb43a('0xab')](_0x3be1ad['@odata.type'][_0xb43a('0xc1')]('.')+0x1);if(_0x3f6584==='StringAttributeMetadata'||_0x3f6584===_0xb43a('0xc4')||_0x3f6584===_0xb43a('0xc5')||_0x3f6584==='IntegerAttributeMetadata'||_0x3f6584===_0xb43a('0xc6')||_0x3f6584===_0xb43a('0xc7')||_0x3f6584===_0xb43a('0xc8')||_0x3f6584==='EntityNameAttributeMetadata'||_0x3f6584===_0xb43a('0xc9')||_0x3f6584===_0xb43a('0xca')){_0x384c9b[_0xb43a('0xc3')](getInputList(_0x403c92,_0x1689bc,_0x3f6584,_0x4ee53c,_0xfd7c5a[_0xb43a('0xb8')],_0x3be1ad[_0xb43a('0xb8')],_0x577f1a));}}});return Promise['all'](_0x384c9b);})[_0xb43a('0x22')](function(_0x7cc4e5){_0x58219b=_0x7cc4e5[0x0];var _0x335a40=_0x2f2f8e[_0xb43a('0xa5')](_0x5c1627)['concat'](_0x58219b);var _0x528b18={'count':_0x335a40[_0xb43a('0x43')],'rows':_0x335a40};return _0x528b18;})[_0xb43a('0x22')](respondWithResult(_0x254a65,null))[_0xb43a('0x55')](function(_0x1871a1){var _0x520b49=_0xd438ab[_0xb43a('0x3e')][_0xb43a('0x1d')]?0x1f4:_0x1871a1[_0xb43a('0xcb')]||0x1f4;logger[_0xb43a('0x28')](_0x1871a1['stack']);delete _0x1871a1[_0xb43a('0x37')];if(_0x520b49===0x191){_0x520b49=0x190;}_0x254a65[_0xb43a('0x2c')](_0x520b49)[_0xb43a('0x38')](_0xd438ab['query']['test']?{'message':_0xb43a('0xcc'),'statusCode':_0x1871a1[_0xb43a('0xcb')]}:_0x1871a1);});};function getSelectList(_0x47a519,_0x2f7a0a,_0x503c67,_0x598602,_0x15e9f1,_0x495e48){var _0x285074={'method':_0xb43a('0xb3'),'uri':_0x47a519+_0xb43a('0xcd')+_0x598602+_0xb43a('0xce')+_0x15e9f1+_0xb43a('0xcf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x495e48,'If-None-Match':null,'OData-Version':_0xb43a('0xb6')},'json':!![]};return rp(_0x285074)[_0xb43a('0x22')](function(_0x1fcf75){var _0x5161f9=[];var _0x3d1a47=_0x1fcf75[_0xb43a('0xd0')][_0xb43a('0xd1')];_0x3d1a47[_0xb43a('0xbf')](function(_0x92bc51){_0x5161f9['push']({'name':_0x92bc51[_0xb43a('0xd2')][_0xb43a('0xd3')][_0xb43a('0xd2')],'value':String(_0x92bc51[_0xb43a('0xd4')])});});var _0x53142c={'id':_0x2f7a0a+'_'+_0x1fcf75[_0xb43a('0xbc')],'name':_0x1fcf75[_0xb43a('0xd5')][_0xb43a('0xd3')]['Label'],'custom':![],'options':_0x5161f9};_0x503c67[_0xb43a('0xc3')](_0x53142c);return _0x503c67;});}function getBooleanList(_0x5d8167,_0x1672ce,_0x595302,_0x67de58,_0x36ecf5,_0x11f28a){var _0x596f9c={'method':_0xb43a('0xb3'),'uri':_0x5d8167+_0xb43a('0xcd')+_0x67de58+_0xb43a('0xce')+_0x36ecf5+_0xb43a('0xd6'),'headers':{'Authorization':_0xb43a('0xb5')+_0x11f28a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x596f9c)[_0xb43a('0x22')](function(_0x371e59){var _0x3894ff=[];_0x3894ff[_0xb43a('0xc3')]({'name':_0x371e59[_0xb43a('0xd0')][_0xb43a('0xd7')][_0xb43a('0xd2')][_0xb43a('0xd3')]['Label'],'value':'true'},{'name':_0x371e59['OptionSet']['FalseOption'][_0xb43a('0xd2')][_0xb43a('0xd3')][_0xb43a('0xd2')],'value':_0xb43a('0xd8')});var _0x2a59e0={'id':_0x1672ce+'_'+_0x371e59['LogicalName'],'name':_0x371e59[_0xb43a('0xd5')]['UserLocalizedLabel'][_0xb43a('0xd2')],'custom':![],'options':_0x3894ff};_0x595302[_0xb43a('0xc3')](_0x2a59e0);return _0x595302;});}function getInputList(_0x6be2b9,_0x3bb388,_0x4e7323,_0x20a814,_0x10dec1,_0x3b56f7,_0x182a53){var _0xf84f4={'method':_0xb43a('0xb3'),'uri':_0x6be2b9+_0xb43a('0xcd')+_0x10dec1+_0xb43a('0xce')+_0x3b56f7+')/Microsoft.Dynamics.CRM.'+_0x4e7323+_0xb43a('0xd9'),'headers':{'Authorization':_0xb43a('0xb5')+_0x182a53,'If-None-Match':null,'OData-Version':_0xb43a('0xb6')},'json':!![]};return rp(_0xf84f4)[_0xb43a('0x22')](function(_0x22dece){var _0x20ade2={'id':_0x3bb388+'_'+_0x22dece[_0xb43a('0xbc')],'name':_0x22dece[_0xb43a('0xd5')][_0xb43a('0xd3')]?_0x22dece[_0xb43a('0xd5')][_0xb43a('0xd3')]['Label']:_0x22dece[_0xb43a('0xbc')],'custom':![],'options':[]};_0x20a814[_0xb43a('0xc3')](_0x20ade2);return _0x20a814;});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js
index f7c225b..f9a3c4f 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.model.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0bb9=['exports','define','int_dynamics365_accounts','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3e245e,_0x58d397){var _0x1980b1=function(_0x50ff63){while(--_0x50ff63){_0x3e245e['push'](_0x3e245e['shift']());}};_0x1980b1(++_0x58d397);}(_0x0bb9,0xd4));var _0x90bb=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x0bb9[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x90bb('0x0'));var util=require('util');var logger=require(_0x90bb('0x1'))(_0x90bb('0x2'));var moment=require('moment');var BPromise=require(_0x90bb('0x3'));var rp=require(_0x90bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x90bb('0x5'));var attributes=require(_0x90bb('0x6'));var integrations=require(_0x90bb('0x7'));module[_0x90bb('0x8')]=function(_0x12ceaa,_0x3b54fd){return _0x12ceaa[_0x90bb('0x9')]('Dynamics365Account',attributes,{'tableName':_0x90bb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x96ed=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','int_dynamics365_accounts','lodash','util','../../config/logger'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x96ed,0xfc));var _0xd96e=function(_0x341ac5,_0xa682b9){_0x341ac5=_0x341ac5-0x0;var _0x9c7dc1=_0x96ed[_0x341ac5];return _0x9c7dc1;};'use strict';var _=require(_0xd96e('0x0'));var util=require(_0xd96e('0x1'));var logger=require(_0xd96e('0x2'))(_0xd96e('0x3'));var moment=require(_0xd96e('0x4'));var BPromise=require(_0xd96e('0x5'));var rp=require(_0xd96e('0x6'));var fs=require('fs');var path=require(_0xd96e('0x7'));var rimraf=require(_0xd96e('0x8'));var config=require(_0xd96e('0x9'));var attributes=require(_0xd96e('0xa'));var integrations=require(_0xd96e('0xb'));module[_0xd96e('0xc')]=function(_0x8209ec,_0xc0d2d0){return _0x8209ec[_0xd96e('0xd')]('Dynamics365Account',attributes,{'tableName':_0xd96e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js
index 59b562c..6cf69fa 100644
--- a/server/api/intDynamics365Account/intDynamics365Account.rpc.js
+++ b/server/api/intDynamics365Account/intDynamics365Account.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdfa0=['raw','attributes','include','map','model','debug','ShowDynamics365Account','Dynamics365Account','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','findAll','options'];(function(_0x2fdb6e,_0x49380f){var _0xcf785f=function(_0x56d638){while(--_0x56d638){_0x2fdb6e['push'](_0x2fdb6e['shift']());}};_0xcf785f(++_0x49380f);}(_0xdfa0,0x69));var _0x0dfa=function(_0x5c33ea,_0x363a69){_0x5c33ea=_0x5c33ea-0x0;var _0xeabec8=_0xdfa0[_0x5c33ea];return _0xeabec8;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var moment=require(_0x0dfa('0x1'));var BPromise=require(_0x0dfa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dfa('0x3'));var db=require(_0x0dfa('0x4'))['db'];var utils=require(_0x0dfa('0x5'));var logger=require('../../config/logger')(_0x0dfa('0x6'));var config=require('../../config/environment');var jayson=require(_0x0dfa('0x7'));var client=jayson[_0x0dfa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x417f7a,_0x29ca78,_0x32280b){return new BPromise(function(_0x16070c,_0x3b6881){return client['request'](_0x417f7a,_0x32280b)[_0x0dfa('0x9')](function(_0x2f813e){logger[_0x0dfa('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x29ca78,_0x0dfa('0xb'));logger['debug'](_0x0dfa('0xc'),_0x29ca78,_0x0dfa('0xb'),JSON[_0x0dfa('0xd')](_0x2f813e));if(_0x2f813e['error']){if(_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0xf')]===0x1f4){logger['error'](_0x0dfa('0x10'),_0x29ca78,_0x2f813e[_0x0dfa('0xe')]['message']);return _0x3b6881(_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0x11')]);}logger[_0x0dfa('0xe')](_0x0dfa('0x10'),_0x29ca78,_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0x11')]);return _0x16070c(_0x2f813e['error'][_0x0dfa('0x11')]);}else{logger[_0x0dfa('0xa')](_0x0dfa('0x10'),_0x29ca78,_0x0dfa('0xb'));_0x16070c(_0x2f813e[_0x0dfa('0x12')][_0x0dfa('0x11')]);}})[_0x0dfa('0x13')](function(_0x3c79f0){logger[_0x0dfa('0xe')](_0x0dfa('0x10'),_0x29ca78,_0x3c79f0);_0x3b6881(_0x3c79f0);});});}exports[_0x0dfa('0x14')]=function(_0x1d3576){var _0x166107=this;return new Promise(function(_0x208c0b,_0x24e3ee){return db['Dynamics365Account'][_0x0dfa('0x15')]({'raw':_0x1d3576[_0x0dfa('0x16')]?_0x1d3576[_0x0dfa('0x16')][_0x0dfa('0x17')]===undefined?!![]:![]:!![],'where':_0x1d3576[_0x0dfa('0x16')]?_0x1d3576['options']['where']||null:null,'attributes':_0x1d3576[_0x0dfa('0x16')]?_0x1d3576[_0x0dfa('0x16')][_0x0dfa('0x18')]||null:null,'limit':_0x1d3576['options']?_0x1d3576[_0x0dfa('0x16')]['limit']||null:null,'include':_0x1d3576[_0x0dfa('0x16')]?_0x1d3576['options'][_0x0dfa('0x19')]?_[_0x0dfa('0x1a')](_0x1d3576[_0x0dfa('0x16')]['include'],function(_0x2e1566){return{'model':db[_0x2e1566[_0x0dfa('0x1b')]],'as':_0x2e1566['as'],'attributes':_0x2e1566[_0x0dfa('0x18')],'include':_0x2e1566[_0x0dfa('0x19')]?_[_0x0dfa('0x1a')](_0x2e1566[_0x0dfa('0x19')],function(_0x13005a){return{'model':db[_0x13005a[_0x0dfa('0x1b')]],'as':_0x13005a['as'],'attributes':_0x13005a[_0x0dfa('0x18')],'include':_0x13005a[_0x0dfa('0x19')]?_['map'](_0x13005a['include'],function(_0x4084c6){return{'model':db[_0x4084c6[_0x0dfa('0x1b')]],'as':_0x4084c6['as'],'attributes':_0x4084c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x0dfa('0x9')](function(_0x3be821){logger[_0x0dfa('0xa')]('GetDynamics365Account',_0x1d3576);logger[_0x0dfa('0x1c')](_0x0dfa('0x14'),_0x1d3576,JSON[_0x0dfa('0xd')](_0x3be821));_0x208c0b(_0x3be821);})[_0x0dfa('0x13')](function(_0x194790){logger[_0x0dfa('0xe')]('GetDynamics365Account',_0x194790[_0x0dfa('0x11')],_0x1d3576);_0x24e3ee(_0x166107[_0x0dfa('0xe')](0x1f4,_0x194790['message']));});});};exports[_0x0dfa('0x1d')]=function(_0x37e050){var _0x239230=this;return new Promise(function(_0xd03108,_0x5a8375){return db[_0x0dfa('0x1e')][_0x0dfa('0x1f')]({'raw':_0x37e050[_0x0dfa('0x16')]?_0x37e050['options']['raw']===undefined?!![]:![]:!![],'where':_0x37e050[_0x0dfa('0x16')]?_0x37e050[_0x0dfa('0x16')]['where']||null:null,'attributes':_0x37e050['options']?_0x37e050['options'][_0x0dfa('0x18')]||null:null,'include':_0x37e050[_0x0dfa('0x16')]?_0x37e050[_0x0dfa('0x16')][_0x0dfa('0x19')]?_['map'](_0x37e050[_0x0dfa('0x16')][_0x0dfa('0x19')],function(_0x6709a0){return{'model':db[_0x6709a0[_0x0dfa('0x1b')]],'as':_0x6709a0['as'],'attributes':_0x6709a0[_0x0dfa('0x18')],'include':_0x6709a0[_0x0dfa('0x19')]?_[_0x0dfa('0x1a')](_0x6709a0[_0x0dfa('0x19')],function(_0x10b105){return{'model':db[_0x10b105[_0x0dfa('0x1b')]],'as':_0x10b105['as'],'attributes':_0x10b105['attributes'],'include':_0x10b105['include']?_[_0x0dfa('0x1a')](_0x10b105[_0x0dfa('0x19')],function(_0xdb2edf){return{'model':db[_0xdb2edf[_0x0dfa('0x1b')]],'as':_0xdb2edf['as'],'attributes':_0xdb2edf[_0x0dfa('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cbc89){logger['info'](_0x0dfa('0x1d'),_0x37e050);logger[_0x0dfa('0x1c')](_0x0dfa('0x1d'),_0x37e050,JSON['stringify'](_0x2cbc89));_0xd03108(_0x2cbc89);})['catch'](function(_0x243dd0){logger[_0x0dfa('0xe')](_0x0dfa('0x1d'),_0x243dd0['message'],_0x37e050);_0x5a8375(_0x239230[_0x0dfa('0xe')](0x1f4,_0x243dd0['message']));});});};
\ No newline at end of file
+var _0x2542=['options','raw','attributes','include','map','model','catch','ShowDynamics365Account','Dynamics365Account','find','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','GetDynamics365Account','findAll'];(function(_0x2cd03f,_0x1f21fe){var _0x280ee5=function(_0xfd01c2){while(--_0xfd01c2){_0x2cd03f['push'](_0x2cd03f['shift']());}};_0x280ee5(++_0x1f21fe);}(_0x2542,0x169));var _0x2254=function(_0x1e8d7a,_0x58ca61){_0x1e8d7a=_0x1e8d7a-0x0;var _0x5865d3=_0x2542[_0x1e8d7a];return _0x5865d3;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});}exports[_0x2254('0x16')]=function(_0x1ae11e){var _0x34f90e=this;return new Promise(function(_0x497724,_0x51b395){return db['Dynamics365Account'][_0x2254('0x17')]({'raw':_0x1ae11e[_0x2254('0x18')]?_0x1ae11e[_0x2254('0x18')][_0x2254('0x19')]===undefined?!![]:![]:!![],'where':_0x1ae11e[_0x2254('0x18')]?_0x1ae11e[_0x2254('0x18')]['where']||null:null,'attributes':_0x1ae11e[_0x2254('0x18')]?_0x1ae11e[_0x2254('0x18')][_0x2254('0x1a')]||null:null,'limit':_0x1ae11e['options']?_0x1ae11e['options']['limit']||null:null,'include':_0x1ae11e[_0x2254('0x18')]?_0x1ae11e[_0x2254('0x18')][_0x2254('0x1b')]?_['map'](_0x1ae11e['options']['include'],function(_0x540020){return{'model':db[_0x540020['model']],'as':_0x540020['as'],'attributes':_0x540020['attributes'],'include':_0x540020[_0x2254('0x1b')]?_[_0x2254('0x1c')](_0x540020[_0x2254('0x1b')],function(_0x265467){return{'model':db[_0x265467[_0x2254('0x1d')]],'as':_0x265467['as'],'attributes':_0x265467[_0x2254('0x1a')],'include':_0x265467['include']?_['map'](_0x265467[_0x2254('0x1b')],function(_0x4f6877){return{'model':db[_0x4f6877[_0x2254('0x1d')]],'as':_0x4f6877['as'],'attributes':_0x4f6877[_0x2254('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2254('0xc')](function(_0x3aa0bd){logger[_0x2254('0xd')]('GetDynamics365Account',_0x1ae11e);logger[_0x2254('0xf')](_0x2254('0x16'),_0x1ae11e,JSON[_0x2254('0x12')](_0x3aa0bd));_0x497724(_0x3aa0bd);})[_0x2254('0x1e')](function(_0x13366a){logger[_0x2254('0x14')](_0x2254('0x16'),_0x13366a[_0x2254('0x15')],_0x1ae11e);_0x51b395(_0x34f90e[_0x2254('0x14')](0x1f4,_0x13366a[_0x2254('0x15')]));});});};exports[_0x2254('0x1f')]=function(_0xad7774){var _0x220f2a=this;return new Promise(function(_0x27d30a,_0x4577f4){return db[_0x2254('0x20')][_0x2254('0x21')]({'raw':_0xad7774[_0x2254('0x18')]?_0xad7774[_0x2254('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xad7774[_0x2254('0x18')]?_0xad7774[_0x2254('0x18')][_0x2254('0x22')]||null:null,'attributes':_0xad7774[_0x2254('0x18')]?_0xad7774[_0x2254('0x18')][_0x2254('0x1a')]||null:null,'include':_0xad7774[_0x2254('0x18')]?_0xad7774[_0x2254('0x18')][_0x2254('0x1b')]?_['map'](_0xad7774[_0x2254('0x18')][_0x2254('0x1b')],function(_0x503540){return{'model':db[_0x503540[_0x2254('0x1d')]],'as':_0x503540['as'],'attributes':_0x503540[_0x2254('0x1a')],'include':_0x503540[_0x2254('0x1b')]?_[_0x2254('0x1c')](_0x503540['include'],function(_0x4a2df0){return{'model':db[_0x4a2df0[_0x2254('0x1d')]],'as':_0x4a2df0['as'],'attributes':_0x4a2df0['attributes'],'include':_0x4a2df0[_0x2254('0x1b')]?_[_0x2254('0x1c')](_0x4a2df0[_0x2254('0x1b')],function(_0x141ddc){return{'model':db[_0x141ddc[_0x2254('0x1d')]],'as':_0x141ddc['as'],'attributes':_0x141ddc[_0x2254('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2254('0xc')](function(_0x51f235){logger[_0x2254('0xd')](_0x2254('0x1f'),_0xad7774);logger[_0x2254('0xf')](_0x2254('0x1f'),_0xad7774,JSON[_0x2254('0x12')](_0x51f235));_0x27d30a(_0x51f235);})[_0x2254('0x1e')](function(_0x3e7ccb){logger[_0x2254('0x14')](_0x2254('0x1f'),_0x3e7ccb[_0x2254('0x15')],_0xad7774);_0x4577f4(_0x220f2a['error'](0x1f4,_0x3e7ccb[_0x2254('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js
index 5db4daa..2c0ff31 100644
--- a/server/api/intDynamics365Configuration/index.js
+++ b/server/api/intDynamics365Configuration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17f1=['/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x320362,_0x19438e){var _0x40ef57=function(_0x52f3f9){while(--_0x52f3f9){_0x320362['push'](_0x320362['shift']());}};_0x40ef57(++_0x19438e);}(_0x17f1,0x7b));var _0x117f=function(_0x5bda89,_0x283da4){_0x5bda89=_0x5bda89-0x0;var _0x43f2a1=_0x17f1[_0x5bda89];return _0x43f2a1;};'use strict';var multer=require(_0x117f('0x0'));var util=require('util');var path=require(_0x117f('0x1'));var timeout=require(_0x117f('0x2'));var express=require(_0x117f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x117f('0x4'));var config=require(_0x117f('0x5'));var controller=require(_0x117f('0x6'));router[_0x117f('0x7')]('/',auth[_0x117f('0x8')](),controller['index']);router[_0x117f('0x7')](_0x117f('0x9'),auth['isAuthenticated'](),controller[_0x117f('0xa')]);router[_0x117f('0x7')](_0x117f('0xb'),auth[_0x117f('0x8')](),controller['getFields']);router[_0x117f('0x7')](_0x117f('0xc'),auth[_0x117f('0x8')](),controller[_0x117f('0xd')]);router[_0x117f('0x7')](_0x117f('0xe'),auth['isAuthenticated'](),controller[_0x117f('0xf')]);router[_0x117f('0x10')]('/',auth[_0x117f('0x8')](),controller[_0x117f('0x11')]);router[_0x117f('0x12')](_0x117f('0x9'),auth[_0x117f('0x8')](),controller[_0x117f('0x13')]);router['delete'](_0x117f('0x9'),auth[_0x117f('0x8')](),controller[_0x117f('0x14')]);module[_0x117f('0x15')]=router;
\ No newline at end of file
+var _0x0a34=['multer','util','path','connect-timeout','express','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','index','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0a34,0x1b8));var _0x40a3=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x0a34[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var path=require(_0x40a3('0x2'));var timeout=require(_0x40a3('0x3'));var express=require(_0x40a3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x40a3('0x5'));var config=require('../../config/environment');var controller=require(_0x40a3('0x6'));router['get']('/',auth[_0x40a3('0x7')](),controller[_0x40a3('0x8')]);router['get']('/:id',auth[_0x40a3('0x7')](),controller[_0x40a3('0x9')]);router[_0x40a3('0xa')](_0x40a3('0xb'),auth[_0x40a3('0x7')](),controller[_0x40a3('0xc')]);router[_0x40a3('0xa')](_0x40a3('0xd'),auth[_0x40a3('0x7')](),controller[_0x40a3('0xe')]);router[_0x40a3('0xa')](_0x40a3('0xf'),auth[_0x40a3('0x7')](),controller[_0x40a3('0x10')]);router[_0x40a3('0x11')]('/',auth['isAuthenticated'](),controller[_0x40a3('0x12')]);router['put'](_0x40a3('0x13'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x40a3('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
index 4213194..570d983 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x20da=['ENUM','incident','phonecall','STRING'];(function(_0x38f5f8,_0xefe164){var _0x34e820=function(_0x3a2407){while(--_0x3a2407){_0x38f5f8['push'](_0x38f5f8['shift']());}};_0x34e820(++_0xefe164);}(_0x20da,0x177));var _0xa20d=function(_0x251830,_0x493b1a){_0x251830=_0x251830-0x0;var _0x5b370e=_0x20da[_0x251830];return _0x5b370e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa20d('0x0')]},'ticketType':{'type':Sequelize[_0xa20d('0x1')](_0xa20d('0x2'),_0xa20d('0x3')),'defaultValue':_0xa20d('0x2')}};
\ No newline at end of file
+var _0x09c6=['phonecall','sequelize','exports','STRING','ENUM'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x09c6,0xb5));var _0x609c=function(_0x5cc766,_0x34d628){_0x5cc766=_0x5cc766-0x0;var _0x30e6a2=_0x09c6[_0x5cc766];return _0x30e6a2;};'use strict';var Sequelize=require(_0x609c('0x0'));module[_0x609c('0x1')]={'name':{'type':Sequelize[_0x609c('0x2')]},'description':{'type':Sequelize[_0x609c('0x2')]},'ticketType':{'type':Sequelize[_0x609c('0x3')]('incident',_0x609c('0x4')),'defaultValue':'incident'}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
index faa36a7..7313851 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d7f=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','type','model','query','keys','fields','attributes','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','intersection','length','find','create','body','destroy','getFields','findOne','params','Dynamics365Field','options','hasOwnProperty','getSubjects','nolimit','getDescriptions'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0x6d7f,0xbc));var _0xf6d7=function(_0x25efb2,_0x331357){_0x25efb2=_0x25efb2-0x0;var _0x1bed45=_0x6d7f[_0x25efb2];return _0x1bed45;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf6d7('0x0'));var rimraf=require(_0xf6d7('0x1'));var zipdir=require(_0xf6d7('0x2'));var jsonpatch=require(_0xf6d7('0x3'));var rp=require(_0xf6d7('0x4'));var moment=require(_0xf6d7('0x5'));var BPromise=require(_0xf6d7('0x6'));var Mustache=require(_0xf6d7('0x7'));var util=require('util');var path=require(_0xf6d7('0x8'));var sox=require(_0xf6d7('0x9'));var csv=require(_0xf6d7('0xa'));var ejs=require(_0xf6d7('0xb'));var fs=require('fs');var _=require(_0xf6d7('0xc'));var squel=require(_0xf6d7('0xd'));var crypto=require(_0xf6d7('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6d7('0xa'));var querystring=require(_0xf6d7('0xf'));var Papa=require(_0xf6d7('0x10'));var Redis=require(_0xf6d7('0x11'));var authService=require(_0xf6d7('0x12'));var qs=require(_0xf6d7('0x13'));var as=require(_0xf6d7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6d7('0x15'))(_0xf6d7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf6d7('0x17'))['db'];var jayson=require(_0xf6d7('0x18'));var client=jayson[_0xf6d7('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x45e069,_0x58219d,_0x3d3010){if(_0x3d3010){var _0x35e2be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35e2be[_0xf6d7('0x1a')](_0x58219d)){return _0x45e069;}else{throw new db[(_0xf6d7('0x1b'))][(_0xf6d7('0x1c'))](_0xf6d7('0x1d'));}}else{return _0x45e069;}}function respondWithRpcPromise(_0x447ef4,_0x554dab,_0x8a1d42,_0x323d8d){return new BPromise(function(_0x4487b8,_0x1b08ef){var _0x350b3a=_0x323d8d||client;return _0x350b3a[_0xf6d7('0x1e')](_0x447ef4,_0x8a1d42)[_0xf6d7('0x1f')](function(_0xc9f887){logger['info'](_0xf6d7('0x20'),_0x554dab,_0xf6d7('0x21'));logger[_0xf6d7('0x22')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x554dab,_0xf6d7('0x21'),JSON['stringify'](_0xc9f887));if(_0xc9f887['error']){if(_0xc9f887['error'][_0xf6d7('0x23')]===0x1f4){logger[_0xf6d7('0x24')](_0xf6d7('0x20'),_0x554dab,_0xc9f887[_0xf6d7('0x24')][_0xf6d7('0x25')]);return _0x1b08ef(_0xc9f887['error'][_0xf6d7('0x25')]);}logger[_0xf6d7('0x24')](_0xf6d7('0x20'),_0x554dab,_0xc9f887[_0xf6d7('0x24')]['message']);return _0x4487b8(_0xc9f887['error'][_0xf6d7('0x25')]);}else{logger[_0xf6d7('0x26')]('Dynamics365Configuration,\x20%s,\x20%s',_0x554dab,_0xf6d7('0x21'));_0x4487b8(_0xc9f887[_0xf6d7('0x27')][_0xf6d7('0x25')]);}})[_0xf6d7('0x28')](function(_0x18bfb7){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x554dab,_0x18bfb7);_0x1b08ef(_0x18bfb7);});});}function respondWithStatusCode(_0x3b8f01,_0x134c90){_0x134c90=_0x134c90||0xcc;return function(_0x54abfc){if(_0x54abfc){return _0x3b8f01[_0xf6d7('0x29')](_0x134c90);}return _0x3b8f01[_0xf6d7('0x2a')](_0x134c90)[_0xf6d7('0x2b')]();};}function respondWithResult(_0x1898bb,_0x40e115){_0x40e115=_0x40e115||0xc8;return function(_0x181891){if(_0x181891){return _0x1898bb['status'](_0x40e115)[_0xf6d7('0x2c')](_0x181891);}};}function respondWithFilteredResult(_0x58d3d5,_0x36e806){return function(_0xaca23e){if(_0xaca23e){var _0x26f420=_0xaca23e[_0xf6d7('0x2d')],_0x17a443=_0x36e806[_0xf6d7('0x2e')],_0x25acf5=_0x36e806[_0xf6d7('0x2e')]+_0x36e806[_0xf6d7('0x2f')],_0x53f091;if(_0x25acf5>=_0x26f420){_0x25acf5=_0x26f420;_0x53f091=0xc8;}else{_0x53f091=0xce;}_0x58d3d5[_0xf6d7('0x2a')](_0x53f091);return _0x58d3d5[_0xf6d7('0x30')]('Content-Range',_0x17a443+'-'+_0x25acf5+'/'+_0x26f420)[_0xf6d7('0x2c')](_0xaca23e);}return null;};}function patchUpdates(_0x508e0b){return function(_0x2e103d){try{jsonpatch[_0xf6d7('0x31')](_0x2e103d,_0x508e0b,!![]);}catch(_0x38a667){return BPromise[_0xf6d7('0x32')](_0x38a667);}return _0x2e103d[_0xf6d7('0x33')]();};}function saveUpdates(_0x5b7342,_0x6566d4){return function(_0xeebcc4){if(_0xeebcc4){return _0xeebcc4[_0xf6d7('0x34')](_0x5b7342)['then'](function(_0x2926d2){return _0x2926d2;});}return null;};}function removeEntity(_0x33185a,_0x303ece){return function(_0x183c2b){if(_0x183c2b){return _0x183c2b['destroy']()[_0xf6d7('0x1f')](function(){_0x33185a[_0xf6d7('0x2a')](0xcc)[_0xf6d7('0x2b')]();});}};}function handleEntityNotFound(_0x2aaa76,_0x355a9a){return function(_0x2bb1e8){if(!_0x2bb1e8){_0x2aaa76[_0xf6d7('0x29')](0x194);}return _0x2bb1e8;};}function handleError(_0x97f050,_0x5f0ea6){_0x5f0ea6=_0x5f0ea6||0x1f4;return function(_0x2ab18e){logger[_0xf6d7('0x24')](_0x2ab18e[_0xf6d7('0x35')]);if(_0x2ab18e[_0xf6d7('0x36')]){delete _0x2ab18e[_0xf6d7('0x36')];}_0x97f050[_0xf6d7('0x2a')](_0x5f0ea6)[_0xf6d7('0x37')](_0x2ab18e);};}exports[_0xf6d7('0x38')]=function(_0x46c359,_0x877f7f){var _0x5907a7={},_0x4254c5={},_0x36f39a={'count':0x0,'rows':[]};var _0x4071d6=_[_0xf6d7('0x39')](db[_0xf6d7('0x3a')][_0xf6d7('0x3b')],function(_0x1777bd){return{'name':_0x1777bd['fieldName'],'type':_0x1777bd[_0xf6d7('0x3c')]['key']};});_0x4254c5[_0xf6d7('0x3d')]=_[_0xf6d7('0x39')](_0x4071d6,'name');_0x4254c5[_0xf6d7('0x3e')]=_[_0xf6d7('0x3f')](_0x46c359[_0xf6d7('0x3e')]);_0x4254c5['filters']=_['intersection'](_0x4254c5[_0xf6d7('0x3d')],_0x4254c5['query']);_0x5907a7['attributes']=_['intersection'](_0x4254c5['model'],qs[_0xf6d7('0x40')](_0x46c359[_0xf6d7('0x3e')]['fields']));_0x5907a7[_0xf6d7('0x41')]=_0x5907a7[_0xf6d7('0x41')]['length']?_0x5907a7['attributes']:_0x4254c5[_0xf6d7('0x3d')];if(!_0x46c359[_0xf6d7('0x3e')]['hasOwnProperty']('nolimit')){_0x5907a7[_0xf6d7('0x2f')]=qs[_0xf6d7('0x2f')](_0x46c359[_0xf6d7('0x3e')][_0xf6d7('0x2f')]);_0x5907a7['offset']=qs[_0xf6d7('0x2e')](_0x46c359[_0xf6d7('0x3e')]['offset']);}_0x5907a7[_0xf6d7('0x42')]=qs['sort'](_0x46c359['query'][_0xf6d7('0x43')]);_0x5907a7[_0xf6d7('0x44')]=qs[_0xf6d7('0x45')](_[_0xf6d7('0x46')](_0x46c359[_0xf6d7('0x3e')],_0x4254c5['filters']),_0x4071d6);if(_0x46c359[_0xf6d7('0x3e')][_0xf6d7('0x47')]){_0x5907a7[_0xf6d7('0x44')]=_[_0xf6d7('0x48')](_0x5907a7['where'],{'$or':_[_0xf6d7('0x39')](_0x4071d6,function(_0x1bf46b){if(_0x1bf46b[_0xf6d7('0x3c')]!==_0xf6d7('0x49')){var _0x39e24b={};_0x39e24b[_0x1bf46b[_0xf6d7('0x36')]]={'$like':'%'+_0x46c359[_0xf6d7('0x3e')][_0xf6d7('0x47')]+'%'};return _0x39e24b;}})});}_0x5907a7=_[_0xf6d7('0x48')]({},_0x5907a7,_0x46c359['options']);var _0x529dad={'where':_0x5907a7[_0xf6d7('0x44')]};return db['Dynamics365Configuration']['count'](_0x529dad)[_0xf6d7('0x1f')](function(_0x5851f9){_0x36f39a[_0xf6d7('0x2d')]=_0x5851f9;if(_0x46c359[_0xf6d7('0x3e')][_0xf6d7('0x4a')]){_0x5907a7[_0xf6d7('0x4b')]=[{'all':!![]}];}return db[_0xf6d7('0x3a')][_0xf6d7('0x4c')](_0x5907a7);})[_0xf6d7('0x1f')](function(_0x91bd16){_0x36f39a[_0xf6d7('0x4d')]=_0x91bd16;return _0x36f39a;})[_0xf6d7('0x1f')](respondWithFilteredResult(_0x877f7f,_0x5907a7))[_0xf6d7('0x28')](handleError(_0x877f7f,null));};exports[_0xf6d7('0x4e')]=function(_0x460cf3,_0x122103){var _0x4f1992={'raw':![],'where':{'id':_0x460cf3['params']['id']}},_0x5ba58b={};_0x5ba58b[_0xf6d7('0x3d')]=_[_0xf6d7('0x3f')](db[_0xf6d7('0x3a')][_0xf6d7('0x3b')]);_0x5ba58b[_0xf6d7('0x3e')]=_[_0xf6d7('0x3f')](_0x460cf3[_0xf6d7('0x3e')]);_0x5ba58b[_0xf6d7('0x45')]=_[_0xf6d7('0x4f')](_0x5ba58b[_0xf6d7('0x3d')],_0x5ba58b['query']);_0x4f1992['attributes']=_[_0xf6d7('0x4f')](_0x5ba58b[_0xf6d7('0x3d')],qs['fields'](_0x460cf3[_0xf6d7('0x3e')][_0xf6d7('0x40')]));_0x4f1992[_0xf6d7('0x41')]=_0x4f1992[_0xf6d7('0x41')][_0xf6d7('0x50')]?_0x4f1992[_0xf6d7('0x41')]:_0x5ba58b[_0xf6d7('0x3d')];if(_0x460cf3['query'][_0xf6d7('0x4a')]){_0x4f1992[_0xf6d7('0x4b')]=[{'all':!![]}];}_0x4f1992=_[_0xf6d7('0x48')]({},_0x4f1992,_0x460cf3['options']);return db[_0xf6d7('0x3a')][_0xf6d7('0x51')](_0x4f1992)['then'](handleEntityNotFound(_0x122103,null))[_0xf6d7('0x1f')](respondWithResult(_0x122103,null))[_0xf6d7('0x28')](handleError(_0x122103,null));};exports['create']=function(_0x19dcd0,_0x1a177c){return db[_0xf6d7('0x3a')][_0xf6d7('0x52')](_0x19dcd0[_0xf6d7('0x53')],{})[_0xf6d7('0x1f')](respondWithResult(_0x1a177c,0xc9))[_0xf6d7('0x28')](handleError(_0x1a177c,null));};exports[_0xf6d7('0x34')]=function(_0x2d1935,_0x52ac18){if(_0x2d1935[_0xf6d7('0x53')]['id']){delete _0x2d1935['body']['id'];}return db[_0xf6d7('0x3a')]['find']({'where':{'id':_0x2d1935['params']['id']}})[_0xf6d7('0x1f')](handleEntityNotFound(_0x52ac18,null))[_0xf6d7('0x1f')](saveUpdates(_0x2d1935[_0xf6d7('0x53')],null))[_0xf6d7('0x1f')](respondWithResult(_0x52ac18,null))[_0xf6d7('0x28')](handleError(_0x52ac18,null));};exports[_0xf6d7('0x54')]=function(_0x52d57a,_0x4c2d07){return db[_0xf6d7('0x3a')][_0xf6d7('0x51')]({'where':{'id':_0x52d57a['params']['id']}})[_0xf6d7('0x1f')](handleEntityNotFound(_0x4c2d07,null))[_0xf6d7('0x1f')](removeEntity(_0x4c2d07,null))[_0xf6d7('0x28')](handleError(_0x4c2d07,null));};exports[_0xf6d7('0x55')]=function(_0x1d5808,_0xa9dd80,_0x3bd56d){var _0x12a3f5={};var _0x4c36d2={};var _0x3fc372;var _0x1a8ac2;return db[_0xf6d7('0x3a')][_0xf6d7('0x56')]({'where':{'id':_0x1d5808[_0xf6d7('0x57')]['id']}})[_0xf6d7('0x1f')](handleEntityNotFound(_0xa9dd80,null))[_0xf6d7('0x1f')](function(_0x44a92e){if(_0x44a92e){_0x3fc372=_0x44a92e;_0x4c36d2[_0xf6d7('0x3d')]=_[_0xf6d7('0x3f')](db[_0xf6d7('0x58')][_0xf6d7('0x3b')]);_0x4c36d2['query']=_[_0xf6d7('0x3f')](_0x1d5808[_0xf6d7('0x3e')]);_0x4c36d2[_0xf6d7('0x45')]=_[_0xf6d7('0x4f')](_0x4c36d2[_0xf6d7('0x3d')],_0x4c36d2[_0xf6d7('0x3e')]);_0x12a3f5['attributes']=_['intersection'](_0x4c36d2['model'],qs[_0xf6d7('0x40')](_0x1d5808['query'][_0xf6d7('0x40')]));_0x12a3f5[_0xf6d7('0x41')]=_0x12a3f5['attributes'][_0xf6d7('0x50')]?_0x12a3f5[_0xf6d7('0x41')]:_0x4c36d2[_0xf6d7('0x3d')];_0x12a3f5[_0xf6d7('0x42')]=qs[_0xf6d7('0x43')](_0x1d5808[_0xf6d7('0x3e')][_0xf6d7('0x43')]);_0x12a3f5[_0xf6d7('0x44')]=qs[_0xf6d7('0x45')](_[_0xf6d7('0x46')](_0x1d5808[_0xf6d7('0x3e')],_0x4c36d2[_0xf6d7('0x45')]));if(_0x1d5808[_0xf6d7('0x3e')][_0xf6d7('0x47')]){_0x12a3f5[_0xf6d7('0x44')]=_['merge'](_0x12a3f5[_0xf6d7('0x44')],{'$or':_[_0xf6d7('0x39')](_0x12a3f5[_0xf6d7('0x41')],function(_0x5ef52d){var _0x5276ba={};_0x5276ba[_0x5ef52d]={'$like':'%'+_0x1d5808[_0xf6d7('0x3e')][_0xf6d7('0x47')]+'%'};return _0x5276ba;})});}_0x12a3f5=_['merge']({},_0x12a3f5,_0x1d5808[_0xf6d7('0x59')]);return _0x3fc372['getFields'](_0x12a3f5);}})[_0xf6d7('0x1f')](function(_0x5a2d37){if(_0x5a2d37){_0x1a8ac2=_0x5a2d37[_0xf6d7('0x50')];if(!_0x1d5808[_0xf6d7('0x3e')][_0xf6d7('0x5a')]('nolimit')){_0x12a3f5[_0xf6d7('0x2f')]=qs[_0xf6d7('0x2f')](_0x1d5808['query'][_0xf6d7('0x2f')]);_0x12a3f5[_0xf6d7('0x2e')]=qs['offset'](_0x1d5808['query'][_0xf6d7('0x2e')]);}return _0x3fc372['getFields'](_0x12a3f5);}})[_0xf6d7('0x1f')](function(_0x4ab9f1){if(_0x4ab9f1){return _0x4ab9f1?{'count':_0x1a8ac2,'rows':_0x4ab9f1}:null;}})[_0xf6d7('0x1f')](respondWithResult(_0xa9dd80,null))[_0xf6d7('0x28')](handleError(_0xa9dd80,null));};exports[_0xf6d7('0x5b')]=function(_0x14d69a,_0x541a9b,_0x3387e8){var _0x1fac83={};var _0x3072c5={};var _0x432cd4;var _0x591c1e;return db['Dynamics365Configuration'][_0xf6d7('0x56')]({'where':{'id':_0x14d69a['params']['id']}})[_0xf6d7('0x1f')](handleEntityNotFound(_0x541a9b,null))[_0xf6d7('0x1f')](function(_0x3ebe5f){if(_0x3ebe5f){_0x432cd4=_0x3ebe5f;_0x3072c5[_0xf6d7('0x3d')]=_[_0xf6d7('0x3f')](db[_0xf6d7('0x58')][_0xf6d7('0x3b')]);_0x3072c5[_0xf6d7('0x3e')]=_[_0xf6d7('0x3f')](_0x14d69a[_0xf6d7('0x3e')]);_0x3072c5[_0xf6d7('0x45')]=_['intersection'](_0x3072c5['model'],_0x3072c5[_0xf6d7('0x3e')]);_0x1fac83['attributes']=_[_0xf6d7('0x4f')](_0x3072c5[_0xf6d7('0x3d')],qs[_0xf6d7('0x40')](_0x14d69a[_0xf6d7('0x3e')][_0xf6d7('0x40')]));_0x1fac83[_0xf6d7('0x41')]=_0x1fac83['attributes']['length']?_0x1fac83['attributes']:_0x3072c5['model'];_0x1fac83['order']=qs[_0xf6d7('0x43')](_0x14d69a[_0xf6d7('0x3e')][_0xf6d7('0x43')]);_0x1fac83[_0xf6d7('0x44')]=qs['filters'](_[_0xf6d7('0x46')](_0x14d69a['query'],_0x3072c5[_0xf6d7('0x45')]));if(_0x14d69a[_0xf6d7('0x3e')][_0xf6d7('0x47')]){_0x1fac83[_0xf6d7('0x44')]=_[_0xf6d7('0x48')](_0x1fac83['where'],{'$or':_['map'](_0x1fac83['attributes'],function(_0xd7dcc6){var _0x12cd81={};_0x12cd81[_0xd7dcc6]={'$like':'%'+_0x14d69a[_0xf6d7('0x3e')][_0xf6d7('0x47')]+'%'};return _0x12cd81;})});}_0x1fac83=_[_0xf6d7('0x48')]({},_0x1fac83,_0x14d69a[_0xf6d7('0x59')]);return _0x432cd4[_0xf6d7('0x5b')](_0x1fac83);}})[_0xf6d7('0x1f')](function(_0x2c98b0){if(_0x2c98b0){_0x591c1e=_0x2c98b0[_0xf6d7('0x50')];if(!_0x14d69a[_0xf6d7('0x3e')]['hasOwnProperty'](_0xf6d7('0x5c'))){_0x1fac83[_0xf6d7('0x2f')]=qs[_0xf6d7('0x2f')](_0x14d69a[_0xf6d7('0x3e')][_0xf6d7('0x2f')]);_0x1fac83[_0xf6d7('0x2e')]=qs['offset'](_0x14d69a[_0xf6d7('0x3e')][_0xf6d7('0x2e')]);}return _0x432cd4[_0xf6d7('0x5b')](_0x1fac83);}})['then'](function(_0xbbe1ed){if(_0xbbe1ed){return _0xbbe1ed?{'count':_0x591c1e,'rows':_0xbbe1ed}:null;}})['then'](respondWithResult(_0x541a9b,null))['catch'](handleError(_0x541a9b,null));};exports[_0xf6d7('0x5d')]=function(_0x227373,_0x1ea895,_0x386fd1){var _0x43bfb3={};var _0x13d188={};var _0x4b32e7;var _0x7c05de;return db[_0xf6d7('0x3a')][_0xf6d7('0x56')]({'where':{'id':_0x227373[_0xf6d7('0x57')]['id']}})['then'](handleEntityNotFound(_0x1ea895,null))[_0xf6d7('0x1f')](function(_0x28409d){if(_0x28409d){_0x4b32e7=_0x28409d;_0x13d188['model']=_['keys'](db['Dynamics365Field'][_0xf6d7('0x3b')]);_0x13d188[_0xf6d7('0x3e')]=_['keys'](_0x227373[_0xf6d7('0x3e')]);_0x13d188['filters']=_[_0xf6d7('0x4f')](_0x13d188[_0xf6d7('0x3d')],_0x13d188['query']);_0x43bfb3['attributes']=_[_0xf6d7('0x4f')](_0x13d188[_0xf6d7('0x3d')],qs[_0xf6d7('0x40')](_0x227373[_0xf6d7('0x3e')][_0xf6d7('0x40')]));_0x43bfb3[_0xf6d7('0x41')]=_0x43bfb3[_0xf6d7('0x41')]['length']?_0x43bfb3['attributes']:_0x13d188[_0xf6d7('0x3d')];_0x43bfb3['order']=qs['sort'](_0x227373[_0xf6d7('0x3e')]['sort']);_0x43bfb3[_0xf6d7('0x44')]=qs[_0xf6d7('0x45')](_[_0xf6d7('0x46')](_0x227373[_0xf6d7('0x3e')],_0x13d188[_0xf6d7('0x45')]));if(_0x227373[_0xf6d7('0x3e')][_0xf6d7('0x47')]){_0x43bfb3[_0xf6d7('0x44')]=_[_0xf6d7('0x48')](_0x43bfb3[_0xf6d7('0x44')],{'$or':_['map'](_0x43bfb3[_0xf6d7('0x41')],function(_0x4dd48f){var _0x1211c0={};_0x1211c0[_0x4dd48f]={'$like':'%'+_0x227373[_0xf6d7('0x3e')][_0xf6d7('0x47')]+'%'};return _0x1211c0;})});}_0x43bfb3=_[_0xf6d7('0x48')]({},_0x43bfb3,_0x227373[_0xf6d7('0x59')]);return _0x4b32e7[_0xf6d7('0x5d')](_0x43bfb3);}})['then'](function(_0x19855f){if(_0x19855f){_0x7c05de=_0x19855f[_0xf6d7('0x50')];if(!_0x227373[_0xf6d7('0x3e')]['hasOwnProperty'](_0xf6d7('0x5c'))){_0x43bfb3[_0xf6d7('0x2f')]=qs[_0xf6d7('0x2f')](_0x227373['query'][_0xf6d7('0x2f')]);_0x43bfb3[_0xf6d7('0x2e')]=qs['offset'](_0x227373['query']['offset']);}return _0x4b32e7[_0xf6d7('0x5d')](_0x43bfb3);}})[_0xf6d7('0x1f')](function(_0x1c9991){if(_0x1c9991){return _0x1c9991?{'count':_0x7c05de,'rows':_0x1c9991}:null;}})[_0xf6d7('0x1f')](respondWithResult(_0x1ea895,null))[_0xf6d7('0x28')](handleError(_0x1ea895,null));};
\ No newline at end of file
+var _0xc67e=['find','body','params','findOne','getFields','Dynamics365Field','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','request\x20sent','result','catch','status','count','offset','limit','Content-Range','apply','save','update','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','show','keys'];(function(_0x204415,_0x4f6beb){var _0x1d1588=function(_0x392ae4){while(--_0x392ae4){_0x204415['push'](_0x204415['shift']());}};_0x1d1588(++_0x4f6beb);}(_0xc67e,0xc0));var _0xec67=function(_0x5b456d,_0x1537a9){_0x5b456d=_0x5b456d-0x0;var _0x12f5ec=_0xc67e[_0x5b456d];return _0x12f5ec;};'use strict';var pdf=require(_0xec67('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xec67('0x1'));var zipdir=require(_0xec67('0x2'));var jsonpatch=require(_0xec67('0x3'));var rp=require(_0xec67('0x4'));var moment=require(_0xec67('0x5'));var BPromise=require(_0xec67('0x6'));var Mustache=require(_0xec67('0x7'));var util=require('util');var path=require(_0xec67('0x8'));var sox=require(_0xec67('0x9'));var csv=require(_0xec67('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xec67('0xb'));var squel=require(_0xec67('0xc'));var crypto=require(_0xec67('0xd'));var jsforce=require(_0xec67('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xec67('0xa'));var querystring=require(_0xec67('0xf'));var Papa=require(_0xec67('0x10'));var Redis=require('ioredis');var authService=require(_0xec67('0x11'));var qs=require(_0xec67('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec67('0x13'));var logger=require(_0xec67('0x14'))(_0xec67('0x15'));var utils=require(_0xec67('0x16'));var config=require(_0xec67('0x17'));var db=require(_0xec67('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xec67('0x19')][_0xec67('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2c5f4f,_0x1d6bc9,_0x45441b){if(_0x45441b){var _0xa6e3d5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa6e3d5[_0xec67('0x1b')](_0x1d6bc9)){return _0x2c5f4f;}else{throw new db[(_0xec67('0x1c'))][(_0xec67('0x1d'))](_0xec67('0x1e'));}}else{return _0x2c5f4f;}}function respondWithRpcPromise(_0x39feee,_0x260a74,_0x13ee0e,_0x435593){return new BPromise(function(_0x48d030,_0x2e2434){var _0x2c577f=_0x435593||client;return _0x2c577f['request'](_0x39feee,_0x13ee0e)[_0xec67('0x1f')](function(_0x396759){logger[_0xec67('0x20')]('Dynamics365Configuration,\x20%s,\x20%s',_0x260a74,'request\x20sent');logger[_0xec67('0x21')](_0xec67('0x22'),_0x260a74,'request\x20sent',JSON[_0xec67('0x23')](_0x396759));if(_0x396759[_0xec67('0x24')]){if(_0x396759[_0xec67('0x24')][_0xec67('0x25')]===0x1f4){logger['error'](_0xec67('0x26'),_0x260a74,_0x396759[_0xec67('0x24')][_0xec67('0x27')]);return _0x2e2434(_0x396759[_0xec67('0x24')][_0xec67('0x27')]);}logger[_0xec67('0x24')](_0xec67('0x26'),_0x260a74,_0x396759[_0xec67('0x24')][_0xec67('0x27')]);return _0x48d030(_0x396759['error'][_0xec67('0x27')]);}else{logger[_0xec67('0x20')](_0xec67('0x26'),_0x260a74,_0xec67('0x28'));_0x48d030(_0x396759[_0xec67('0x29')][_0xec67('0x27')]);}})[_0xec67('0x2a')](function(_0x54647d){logger['error'](_0xec67('0x26'),_0x260a74,_0x54647d);_0x2e2434(_0x54647d);});});}function respondWithStatusCode(_0x4b644e,_0x546ea1){_0x546ea1=_0x546ea1||0xcc;return function(_0x361d30){if(_0x361d30){return _0x4b644e['sendStatus'](_0x546ea1);}return _0x4b644e[_0xec67('0x2b')](_0x546ea1)['end']();};}function respondWithResult(_0x2f144e,_0x2fffe3){_0x2fffe3=_0x2fffe3||0xc8;return function(_0x57b19e){if(_0x57b19e){return _0x2f144e[_0xec67('0x2b')](_0x2fffe3)['json'](_0x57b19e);}};}function respondWithFilteredResult(_0x17a177,_0x1b99ac){return function(_0x25b8c6){if(_0x25b8c6){var _0x1d2abf=_0x25b8c6[_0xec67('0x2c')],_0x46b62b=_0x1b99ac[_0xec67('0x2d')],_0x35440d=_0x1b99ac[_0xec67('0x2d')]+_0x1b99ac[_0xec67('0x2e')],_0x153ed6;if(_0x35440d>=_0x1d2abf){_0x35440d=_0x1d2abf;_0x153ed6=0xc8;}else{_0x153ed6=0xce;}_0x17a177[_0xec67('0x2b')](_0x153ed6);return _0x17a177['set'](_0xec67('0x2f'),_0x46b62b+'-'+_0x35440d+'/'+_0x1d2abf)['json'](_0x25b8c6);}return null;};}function patchUpdates(_0x3cc194){return function(_0x4e6af5){try{jsonpatch[_0xec67('0x30')](_0x4e6af5,_0x3cc194,!![]);}catch(_0x593990){return BPromise['reject'](_0x593990);}return _0x4e6af5[_0xec67('0x31')]();};}function saveUpdates(_0x43017c,_0x31ad68){return function(_0x40ce78){if(_0x40ce78){return _0x40ce78[_0xec67('0x32')](_0x43017c)[_0xec67('0x1f')](function(_0x56432c){return _0x56432c;});}return null;};}function removeEntity(_0x273d9d,_0x58d3e8){return function(_0x4349ac){if(_0x4349ac){return _0x4349ac['destroy']()[_0xec67('0x1f')](function(){_0x273d9d[_0xec67('0x2b')](0xcc)[_0xec67('0x33')]();});}};}function handleEntityNotFound(_0x131392,_0x14b431){return function(_0x2c36c6){if(!_0x2c36c6){_0x131392[_0xec67('0x34')](0x194);}return _0x2c36c6;};}function handleError(_0x4cfb81,_0x1e081b){_0x1e081b=_0x1e081b||0x1f4;return function(_0x420adf){logger[_0xec67('0x24')](_0x420adf[_0xec67('0x35')]);if(_0x420adf['name']){delete _0x420adf[_0xec67('0x36')];}_0x4cfb81[_0xec67('0x2b')](_0x1e081b)[_0xec67('0x37')](_0x420adf);};}exports[_0xec67('0x38')]=function(_0x471ba2,_0x536ca4){var _0x1c2e3a={},_0x1b0044={},_0x212e12={'count':0x0,'rows':[]};var _0x146da8=_[_0xec67('0x39')](db['Dynamics365Configuration'][_0xec67('0x3a')],function(_0x47a918){return{'name':_0x47a918[_0xec67('0x3b')],'type':_0x47a918['type'][_0xec67('0x3c')]};});_0x1b0044[_0xec67('0x3d')]=_['map'](_0x146da8,_0xec67('0x36'));_0x1b0044[_0xec67('0x3e')]=_['keys'](_0x471ba2[_0xec67('0x3e')]);_0x1b0044['filters']=_[_0xec67('0x3f')](_0x1b0044[_0xec67('0x3d')],_0x1b0044[_0xec67('0x3e')]);_0x1c2e3a[_0xec67('0x40')]=_[_0xec67('0x3f')](_0x1b0044[_0xec67('0x3d')],qs[_0xec67('0x41')](_0x471ba2['query'][_0xec67('0x41')]));_0x1c2e3a['attributes']=_0x1c2e3a[_0xec67('0x40')][_0xec67('0x42')]?_0x1c2e3a[_0xec67('0x40')]:_0x1b0044[_0xec67('0x3d')];if(!_0x471ba2[_0xec67('0x3e')][_0xec67('0x43')](_0xec67('0x44'))){_0x1c2e3a[_0xec67('0x2e')]=qs[_0xec67('0x2e')](_0x471ba2[_0xec67('0x3e')]['limit']);_0x1c2e3a[_0xec67('0x2d')]=qs[_0xec67('0x2d')](_0x471ba2[_0xec67('0x3e')][_0xec67('0x2d')]);}_0x1c2e3a[_0xec67('0x45')]=qs[_0xec67('0x46')](_0x471ba2['query'][_0xec67('0x46')]);_0x1c2e3a[_0xec67('0x47')]=qs[_0xec67('0x48')](_[_0xec67('0x49')](_0x471ba2['query'],_0x1b0044['filters']),_0x146da8);if(_0x471ba2[_0xec67('0x3e')][_0xec67('0x4a')]){_0x1c2e3a[_0xec67('0x47')]=_[_0xec67('0x4b')](_0x1c2e3a[_0xec67('0x47')],{'$or':_[_0xec67('0x39')](_0x146da8,function(_0x63b80){if(_0x63b80['type']!==_0xec67('0x4c')){var _0x2ede5a={};_0x2ede5a[_0x63b80['name']]={'$like':'%'+_0x471ba2[_0xec67('0x3e')][_0xec67('0x4a')]+'%'};return _0x2ede5a;}})});}_0x1c2e3a=_[_0xec67('0x4b')]({},_0x1c2e3a,_0x471ba2[_0xec67('0x4d')]);var _0x46c631={'where':_0x1c2e3a[_0xec67('0x47')]};return db[_0xec67('0x4e')][_0xec67('0x2c')](_0x46c631)[_0xec67('0x1f')](function(_0x1f508f){_0x212e12[_0xec67('0x2c')]=_0x1f508f;if(_0x471ba2[_0xec67('0x3e')][_0xec67('0x4f')]){_0x1c2e3a[_0xec67('0x50')]=[{'all':!![]}];}return db[_0xec67('0x4e')][_0xec67('0x51')](_0x1c2e3a);})['then'](function(_0x188ef8){_0x212e12['rows']=_0x188ef8;return _0x212e12;})['then'](respondWithFilteredResult(_0x536ca4,_0x1c2e3a))[_0xec67('0x2a')](handleError(_0x536ca4,null));};exports[_0xec67('0x52')]=function(_0x459eea,_0x4b5dd1){var _0x106b0e={'raw':![],'where':{'id':_0x459eea['params']['id']}},_0x3ce495={};_0x3ce495[_0xec67('0x3d')]=_[_0xec67('0x53')](db[_0xec67('0x4e')][_0xec67('0x3a')]);_0x3ce495[_0xec67('0x3e')]=_['keys'](_0x459eea[_0xec67('0x3e')]);_0x3ce495[_0xec67('0x48')]=_[_0xec67('0x3f')](_0x3ce495['model'],_0x3ce495[_0xec67('0x3e')]);_0x106b0e['attributes']=_['intersection'](_0x3ce495[_0xec67('0x3d')],qs['fields'](_0x459eea[_0xec67('0x3e')][_0xec67('0x41')]));_0x106b0e[_0xec67('0x40')]=_0x106b0e[_0xec67('0x40')]['length']?_0x106b0e['attributes']:_0x3ce495[_0xec67('0x3d')];if(_0x459eea[_0xec67('0x3e')][_0xec67('0x4f')]){_0x106b0e[_0xec67('0x50')]=[{'all':!![]}];}_0x106b0e=_['merge']({},_0x106b0e,_0x459eea['options']);return db[_0xec67('0x4e')][_0xec67('0x54')](_0x106b0e)[_0xec67('0x1f')](handleEntityNotFound(_0x4b5dd1,null))['then'](respondWithResult(_0x4b5dd1,null))[_0xec67('0x2a')](handleError(_0x4b5dd1,null));};exports['create']=function(_0x571f62,_0x505382){return db['Dynamics365Configuration']['create'](_0x571f62['body'],{})[_0xec67('0x1f')](respondWithResult(_0x505382,0xc9))[_0xec67('0x2a')](handleError(_0x505382,null));};exports[_0xec67('0x32')]=function(_0x4389bc,_0x2207d6){if(_0x4389bc[_0xec67('0x55')]['id']){delete _0x4389bc[_0xec67('0x55')]['id'];}return db['Dynamics365Configuration'][_0xec67('0x54')]({'where':{'id':_0x4389bc[_0xec67('0x56')]['id']}})[_0xec67('0x1f')](handleEntityNotFound(_0x2207d6,null))['then'](saveUpdates(_0x4389bc[_0xec67('0x55')],null))[_0xec67('0x1f')](respondWithResult(_0x2207d6,null))[_0xec67('0x2a')](handleError(_0x2207d6,null));};exports['destroy']=function(_0x3975b8,_0x4e6b45){return db[_0xec67('0x4e')][_0xec67('0x54')]({'where':{'id':_0x3975b8[_0xec67('0x56')]['id']}})[_0xec67('0x1f')](handleEntityNotFound(_0x4e6b45,null))[_0xec67('0x1f')](removeEntity(_0x4e6b45,null))[_0xec67('0x2a')](handleError(_0x4e6b45,null));};exports['getFields']=function(_0x31aed9,_0x33a5bc,_0x33f79e){var _0x381a7e={};var _0x4430db={};var _0x55f381;var _0x34ad11;return db['Dynamics365Configuration'][_0xec67('0x57')]({'where':{'id':_0x31aed9['params']['id']}})[_0xec67('0x1f')](handleEntityNotFound(_0x33a5bc,null))['then'](function(_0x3ab5cd){if(_0x3ab5cd){_0x55f381=_0x3ab5cd;_0x4430db[_0xec67('0x3d')]=_['keys'](db['Dynamics365Field'][_0xec67('0x3a')]);_0x4430db['query']=_[_0xec67('0x53')](_0x31aed9[_0xec67('0x3e')]);_0x4430db[_0xec67('0x48')]=_[_0xec67('0x3f')](_0x4430db[_0xec67('0x3d')],_0x4430db[_0xec67('0x3e')]);_0x381a7e[_0xec67('0x40')]=_[_0xec67('0x3f')](_0x4430db[_0xec67('0x3d')],qs[_0xec67('0x41')](_0x31aed9[_0xec67('0x3e')][_0xec67('0x41')]));_0x381a7e[_0xec67('0x40')]=_0x381a7e[_0xec67('0x40')][_0xec67('0x42')]?_0x381a7e[_0xec67('0x40')]:_0x4430db[_0xec67('0x3d')];_0x381a7e[_0xec67('0x45')]=qs['sort'](_0x31aed9[_0xec67('0x3e')]['sort']);_0x381a7e[_0xec67('0x47')]=qs[_0xec67('0x48')](_['pick'](_0x31aed9['query'],_0x4430db[_0xec67('0x48')]));if(_0x31aed9[_0xec67('0x3e')][_0xec67('0x4a')]){_0x381a7e[_0xec67('0x47')]=_[_0xec67('0x4b')](_0x381a7e['where'],{'$or':_[_0xec67('0x39')](_0x381a7e[_0xec67('0x40')],function(_0x5ce902){var _0x59f63f={};_0x59f63f[_0x5ce902]={'$like':'%'+_0x31aed9[_0xec67('0x3e')][_0xec67('0x4a')]+'%'};return _0x59f63f;})});}_0x381a7e=_[_0xec67('0x4b')]({},_0x381a7e,_0x31aed9[_0xec67('0x4d')]);return _0x55f381[_0xec67('0x58')](_0x381a7e);}})[_0xec67('0x1f')](function(_0x7fdf8d){if(_0x7fdf8d){_0x34ad11=_0x7fdf8d[_0xec67('0x42')];if(!_0x31aed9['query'][_0xec67('0x43')](_0xec67('0x44'))){_0x381a7e[_0xec67('0x2e')]=qs[_0xec67('0x2e')](_0x31aed9['query'][_0xec67('0x2e')]);_0x381a7e['offset']=qs[_0xec67('0x2d')](_0x31aed9[_0xec67('0x3e')][_0xec67('0x2d')]);}return _0x55f381[_0xec67('0x58')](_0x381a7e);}})[_0xec67('0x1f')](function(_0x467d6d){if(_0x467d6d){return _0x467d6d?{'count':_0x34ad11,'rows':_0x467d6d}:null;}})[_0xec67('0x1f')](respondWithResult(_0x33a5bc,null))['catch'](handleError(_0x33a5bc,null));};exports['getSubjects']=function(_0x2a4a21,_0x37e895,_0x589c21){var _0x4e9ea7={};var _0xf7c800={};var _0x2e671b;var _0x1d783f;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2a4a21[_0xec67('0x56')]['id']}})[_0xec67('0x1f')](handleEntityNotFound(_0x37e895,null))[_0xec67('0x1f')](function(_0x1438e9){if(_0x1438e9){_0x2e671b=_0x1438e9;_0xf7c800[_0xec67('0x3d')]=_[_0xec67('0x53')](db[_0xec67('0x59')][_0xec67('0x3a')]);_0xf7c800['query']=_['keys'](_0x2a4a21[_0xec67('0x3e')]);_0xf7c800[_0xec67('0x48')]=_[_0xec67('0x3f')](_0xf7c800[_0xec67('0x3d')],_0xf7c800[_0xec67('0x3e')]);_0x4e9ea7[_0xec67('0x40')]=_[_0xec67('0x3f')](_0xf7c800['model'],qs[_0xec67('0x41')](_0x2a4a21[_0xec67('0x3e')][_0xec67('0x41')]));_0x4e9ea7[_0xec67('0x40')]=_0x4e9ea7[_0xec67('0x40')][_0xec67('0x42')]?_0x4e9ea7[_0xec67('0x40')]:_0xf7c800[_0xec67('0x3d')];_0x4e9ea7[_0xec67('0x45')]=qs[_0xec67('0x46')](_0x2a4a21['query'][_0xec67('0x46')]);_0x4e9ea7[_0xec67('0x47')]=qs[_0xec67('0x48')](_['pick'](_0x2a4a21[_0xec67('0x3e')],_0xf7c800['filters']));if(_0x2a4a21[_0xec67('0x3e')][_0xec67('0x4a')]){_0x4e9ea7[_0xec67('0x47')]=_[_0xec67('0x4b')](_0x4e9ea7['where'],{'$or':_[_0xec67('0x39')](_0x4e9ea7['attributes'],function(_0x9f77ee){var _0xf70913={};_0xf70913[_0x9f77ee]={'$like':'%'+_0x2a4a21[_0xec67('0x3e')][_0xec67('0x4a')]+'%'};return _0xf70913;})});}_0x4e9ea7=_[_0xec67('0x4b')]({},_0x4e9ea7,_0x2a4a21[_0xec67('0x4d')]);return _0x2e671b[_0xec67('0x5a')](_0x4e9ea7);}})[_0xec67('0x1f')](function(_0x5ad093){if(_0x5ad093){_0x1d783f=_0x5ad093['length'];if(!_0x2a4a21[_0xec67('0x3e')][_0xec67('0x43')](_0xec67('0x44'))){_0x4e9ea7[_0xec67('0x2e')]=qs[_0xec67('0x2e')](_0x2a4a21['query'][_0xec67('0x2e')]);_0x4e9ea7[_0xec67('0x2d')]=qs['offset'](_0x2a4a21[_0xec67('0x3e')]['offset']);}return _0x2e671b['getSubjects'](_0x4e9ea7);}})[_0xec67('0x1f')](function(_0x5146e5){if(_0x5146e5){return _0x5146e5?{'count':_0x1d783f,'rows':_0x5146e5}:null;}})[_0xec67('0x1f')](respondWithResult(_0x37e895,null))[_0xec67('0x2a')](handleError(_0x37e895,null));};exports[_0xec67('0x5b')]=function(_0x5dbf44,_0x4067f4,_0x4f4626){var _0xf8142f={};var _0x10965c={};var _0x4f10d4;var _0xf119e3;return db[_0xec67('0x4e')][_0xec67('0x57')]({'where':{'id':_0x5dbf44[_0xec67('0x56')]['id']}})[_0xec67('0x1f')](handleEntityNotFound(_0x4067f4,null))['then'](function(_0x3d3641){if(_0x3d3641){_0x4f10d4=_0x3d3641;_0x10965c[_0xec67('0x3d')]=_[_0xec67('0x53')](db[_0xec67('0x59')]['rawAttributes']);_0x10965c['query']=_[_0xec67('0x53')](_0x5dbf44['query']);_0x10965c['filters']=_[_0xec67('0x3f')](_0x10965c['model'],_0x10965c[_0xec67('0x3e')]);_0xf8142f[_0xec67('0x40')]=_[_0xec67('0x3f')](_0x10965c['model'],qs[_0xec67('0x41')](_0x5dbf44[_0xec67('0x3e')][_0xec67('0x41')]));_0xf8142f[_0xec67('0x40')]=_0xf8142f[_0xec67('0x40')]['length']?_0xf8142f['attributes']:_0x10965c[_0xec67('0x3d')];_0xf8142f['order']=qs['sort'](_0x5dbf44[_0xec67('0x3e')][_0xec67('0x46')]);_0xf8142f[_0xec67('0x47')]=qs['filters'](_[_0xec67('0x49')](_0x5dbf44[_0xec67('0x3e')],_0x10965c['filters']));if(_0x5dbf44[_0xec67('0x3e')][_0xec67('0x4a')]){_0xf8142f[_0xec67('0x47')]=_[_0xec67('0x4b')](_0xf8142f['where'],{'$or':_[_0xec67('0x39')](_0xf8142f[_0xec67('0x40')],function(_0x3c0c60){var _0x1c7861={};_0x1c7861[_0x3c0c60]={'$like':'%'+_0x5dbf44[_0xec67('0x3e')]['filter']+'%'};return _0x1c7861;})});}_0xf8142f=_[_0xec67('0x4b')]({},_0xf8142f,_0x5dbf44[_0xec67('0x4d')]);return _0x4f10d4[_0xec67('0x5b')](_0xf8142f);}})[_0xec67('0x1f')](function(_0x3c17e9){if(_0x3c17e9){_0xf119e3=_0x3c17e9[_0xec67('0x42')];if(!_0x5dbf44[_0xec67('0x3e')][_0xec67('0x43')](_0xec67('0x44'))){_0xf8142f[_0xec67('0x2e')]=qs[_0xec67('0x2e')](_0x5dbf44[_0xec67('0x3e')][_0xec67('0x2e')]);_0xf8142f[_0xec67('0x2d')]=qs[_0xec67('0x2d')](_0x5dbf44['query'][_0xec67('0x2d')]);}return _0x4f10d4[_0xec67('0x5b')](_0xf8142f);}})[_0xec67('0x1f')](function(_0x320043){if(_0x320043){return _0x320043?{'count':_0xf119e3,'rows':_0x320043}:null;}})['then'](respondWithResult(_0x4067f4,null))[_0xec67('0x2a')](handleError(_0x4067f4,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
index f12a6fe..fad61bf 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c23=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7c23,0x13a));var _0x37c2=function(_0x4da557,_0x4ca613){_0x4da557=_0x4da557-0x0;var _0x4795c3=_0x7c23[_0x4da557];return _0x4795c3;};'use strict';var _=require(_0x37c2('0x0'));var util=require(_0x37c2('0x1'));var logger=require(_0x37c2('0x2'))(_0x37c2('0x3'));var moment=require(_0x37c2('0x4'));var BPromise=require(_0x37c2('0x5'));var rp=require(_0x37c2('0x6'));var fs=require('fs');var path=require(_0x37c2('0x7'));var rimraf=require(_0x37c2('0x8'));var config=require(_0x37c2('0x9'));var attributes=require(_0x37c2('0xa'));module[_0x37c2('0xb')]=function(_0x29c8dd,_0x3185e6){return _0x29c8dd[_0x37c2('0xc')](_0x37c2('0xd'),attributes,{'tableName':_0x37c2('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x523f=['bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x3a794d,_0x3896cb){var _0x5e46ab=function(_0x8fef14){while(--_0x8fef14){_0x3a794d['push'](_0x3a794d['shift']());}};_0x5e46ab(++_0x3896cb);}(_0x523f,0x190));var _0xf523=function(_0x3c8df0,_0x5cd8d0){_0x3c8df0=_0x3c8df0-0x0;var _0x31ac2b=_0x523f[_0x3c8df0];return _0x31ac2b;};'use strict';var _=require(_0xf523('0x0'));var util=require(_0xf523('0x1'));var logger=require(_0xf523('0x2'))(_0xf523('0x3'));var moment=require(_0xf523('0x4'));var BPromise=require(_0xf523('0x5'));var rp=require(_0xf523('0x6'));var fs=require('fs');var path=require(_0xf523('0x7'));var rimraf=require(_0xf523('0x8'));var config=require(_0xf523('0x9'));var attributes=require(_0xf523('0xa'));module[_0xf523('0xb')]=function(_0x1c00dd,_0x329c9f){return _0x1c00dd[_0xf523('0xc')](_0xf523('0xd'),attributes,{'tableName':_0xf523('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
index 4040da6..195e7ae 100644
--- a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
+++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2066=['http','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5c4b6a,_0x3e4163){var _0x2dec05=function(_0x17017e){while(--_0x17017e){_0x5c4b6a['push'](_0x5c4b6a['shift']());}};_0x2dec05(++_0x3e4163);}(_0x2066,0x89));var _0x6206=function(_0x3bfb7a,_0x10f0fb){_0x3bfb7a=_0x3bfb7a-0x0;var _0x5a7039=_0x2066[_0x3bfb7a];return _0x5a7039;};'use strict';var _=require(_0x6206('0x0'));var util=require('util');var moment=require(_0x6206('0x1'));var BPromise=require('bluebird');var rs=require(_0x6206('0x2'));var fs=require('fs');var Redis=require(_0x6206('0x3'));var db=require(_0x6206('0x4'))['db'];var utils=require(_0x6206('0x5'));var logger=require(_0x6206('0x6'))(_0x6206('0x7'));var config=require(_0x6206('0x8'));var jayson=require(_0x6206('0x9'));var client=jayson['client'][_0x6206('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x514e65,_0x1a1d6b,_0x13ac34){return new BPromise(function(_0x53d17e,_0x3982b3){return client['request'](_0x514e65,_0x13ac34)[_0x6206('0xb')](function(_0x1ec4d2){logger[_0x6206('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a1d6b,_0x6206('0xd'));logger[_0x6206('0xe')](_0x6206('0xf'),_0x1a1d6b,_0x6206('0xd'),JSON['stringify'](_0x1ec4d2));if(_0x1ec4d2[_0x6206('0x10')]){if(_0x1ec4d2[_0x6206('0x10')]['code']===0x1f4){logger[_0x6206('0x10')](_0x6206('0x11'),_0x1a1d6b,_0x1ec4d2[_0x6206('0x10')][_0x6206('0x12')]);return _0x3982b3(_0x1ec4d2[_0x6206('0x10')]['message']);}logger[_0x6206('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a1d6b,_0x1ec4d2[_0x6206('0x10')][_0x6206('0x12')]);return _0x53d17e(_0x1ec4d2[_0x6206('0x10')][_0x6206('0x12')]);}else{logger['info'](_0x6206('0x11'),_0x1a1d6b,_0x6206('0xd'));_0x53d17e(_0x1ec4d2[_0x6206('0x13')]['message']);}})[_0x6206('0x14')](function(_0x50b3f3){logger['error'](_0x6206('0x11'),_0x1a1d6b,_0x50b3f3);_0x3982b3(_0x50b3f3);});});}
\ No newline at end of file
+var _0x7236=['util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x1e49ee,_0x3257b6){var _0x3dcf1e=function(_0x62a4fa){while(--_0x62a4fa){_0x1e49ee['push'](_0x1e49ee['shift']());}};_0x3dcf1e(++_0x3257b6);}(_0x7236,0x9f));var _0x6723=function(_0x203824,_0x5170a9){_0x203824=_0x203824-0x0;var _0x7b571a=_0x7236[_0x203824];return _0x7b571a;};'use strict';var _=require(_0x6723('0x0'));var util=require(_0x6723('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6723('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6723('0x3'));var logger=require(_0x6723('0x4'))(_0x6723('0x5'));var config=require(_0x6723('0x6'));var jayson=require(_0x6723('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30418d,_0x54b284,_0x58a855){return new BPromise(function(_0x323f7,_0x2eb7e2){return client[_0x6723('0x8')](_0x30418d,_0x58a855)[_0x6723('0x9')](function(_0x35e958){logger[_0x6723('0xa')](_0x6723('0xb'),_0x54b284,_0x6723('0xc'));logger[_0x6723('0xd')](_0x6723('0xe'),_0x54b284,_0x6723('0xc'),JSON[_0x6723('0xf')](_0x35e958));if(_0x35e958[_0x6723('0x10')]){if(_0x35e958[_0x6723('0x10')]['code']===0x1f4){logger[_0x6723('0x10')](_0x6723('0xb'),_0x54b284,_0x35e958['error'][_0x6723('0x11')]);return _0x2eb7e2(_0x35e958[_0x6723('0x10')][_0x6723('0x11')]);}logger[_0x6723('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x54b284,_0x35e958[_0x6723('0x10')]['message']);return _0x323f7(_0x35e958[_0x6723('0x10')]['message']);}else{logger[_0x6723('0xa')](_0x6723('0xb'),_0x54b284,'request\x20sent');_0x323f7(_0x35e958[_0x6723('0x12')][_0x6723('0x11')]);}})[_0x6723('0x13')](function(_0x58024d){logger[_0x6723('0x10')](_0x6723('0xb'),_0x54b284,_0x58024d);_0x2eb7e2(_0x58024d);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js
index 8e2fdc6..f3abef6 100644
--- a/server/api/intDynamics365Field/index.js
+++ b/server/api/intDynamics365Field/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x68fc=['get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x68fc,0xa5));var _0xc68f=function(_0x1fd383,_0x4e46b7){_0x1fd383=_0x1fd383-0x0;var _0x98d969=_0x68fc[_0x1fd383];return _0x98d969;};'use strict';var multer=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var path=require(_0xc68f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc68f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc68f('0x4'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xc68f('0x5')]('/',auth[_0xc68f('0x6')](),controller[_0xc68f('0x7')]);router[_0xc68f('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xc68f('0x8')]);router[_0xc68f('0x9')]('/',auth[_0xc68f('0x6')](),controller[_0xc68f('0xa')]);router[_0xc68f('0xb')](_0xc68f('0xc'),auth[_0xc68f('0x6')](),controller[_0xc68f('0xd')]);router[_0xc68f('0xe')](_0xc68f('0xc'),auth['isAuthenticated'](),controller[_0xc68f('0xf')]);module[_0xc68f('0x10')]=router;
\ No newline at end of file
+var _0x2121=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x2121,0x1b4));var _0x1212=function(_0x3e899a,_0x306088){_0x3e899a=_0x3e899a-0x0;var _0x2b5686=_0x2121[_0x3e899a];return _0x2b5686;};'use strict';var multer=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1212('0x2'));var router=express[_0x1212('0x3')]();var auth=require(_0x1212('0x4'));var interaction=require(_0x1212('0x5'));var config=require(_0x1212('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x1212('0x7')]('/',auth['isAuthenticated'](),controller[_0x1212('0x8')]);router[_0x1212('0x7')](_0x1212('0x9'),auth[_0x1212('0xa')](),controller[_0x1212('0xb')]);router[_0x1212('0xc')]('/',auth['isAuthenticated'](),controller[_0x1212('0xd')]);router[_0x1212('0xe')](_0x1212('0x9'),auth[_0x1212('0xa')](),controller[_0x1212('0xf')]);router[_0x1212('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1212('0x11')]);module[_0x1212('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js
index 2272767..01e5d2f 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.attributes.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34b3=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x44fc33,_0x480283){var _0x1e64a1=function(_0x2b642b){while(--_0x2b642b){_0x44fc33['push'](_0x44fc33['shift']());}};_0x1e64a1(++_0x480283);}(_0x34b3,0x1b2));var _0x334b=function(_0x185069,_0x259e5a){_0x185069=_0x185069-0x0;var _0x7344ec=_0x34b3[_0x185069];return _0x7344ec;};'use strict';var Sequelize=require(_0x334b('0x0'));module[_0x334b('0x1')]={'type':{'type':Sequelize[_0x334b('0x2')](_0x334b('0x3'),_0x334b('0x4'),_0x334b('0x5'),_0x334b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x334b('0x7')]},'key':{'type':Sequelize[_0x334b('0x7')]},'keyType':{'type':Sequelize[_0x334b('0x2')](_0x334b('0x3'),_0x334b('0x4'),_0x334b('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x334b('0x7')]},'nameField':{'type':Sequelize[_0x334b('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1625=['ENUM','variable','customVariable','keyValue','STRING','string','sequelize'];(function(_0x5dac37,_0x430287){var _0x4cb576=function(_0x5a833d){while(--_0x5a833d){_0x5dac37['push'](_0x5dac37['shift']());}};_0x4cb576(++_0x430287);}(_0x1625,0xa7));var _0x5162=function(_0x50dd86,_0x43a6e7){_0x50dd86=_0x50dd86-0x0;var _0x5715a2=_0x1625[_0x50dd86];return _0x5715a2;};'use strict';var Sequelize=require(_0x5162('0x0'));module['exports']={'type':{'type':Sequelize[_0x5162('0x1')]('string',_0x5162('0x2'),_0x5162('0x3'),_0x5162('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5162('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5162('0x1')](_0x5162('0x6'),_0x5162('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x5162('0x5')]},'idField':{'type':Sequelize[_0x5162('0x5')]},'nameField':{'type':Sequelize[_0x5162('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5162('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js
index 3012a29..d5daad8 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.controller.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf579=['limit','order','where','filters','pick','filter','merge','type','include','then','rows','catch','show','params','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit'];(function(_0x3e3d20,_0x2b6968){var _0x5605a5=function(_0x4d5a75){while(--_0x4d5a75){_0x3e3d20['push'](_0x3e3d20['shift']());}};_0x5605a5(++_0x2b6968);}(_0xf579,0x1bc));var _0x9f57=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xf579[_0x376b45];return _0x2341b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9f57('0x0'));var rimraf=require(_0x9f57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f57('0x2'));var rp=require(_0x9f57('0x3'));var moment=require('moment');var BPromise=require(_0x9f57('0x4'));var Mustache=require(_0x9f57('0x5'));var util=require(_0x9f57('0x6'));var path=require(_0x9f57('0x7'));var sox=require('sox');var csv=require(_0x9f57('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f57('0x9'));var squel=require(_0x9f57('0xa'));var crypto=require(_0x9f57('0xb'));var jsforce=require(_0x9f57('0xc'));var deskjs=require(_0x9f57('0xd'));var toCsv=require(_0x9f57('0x8'));var querystring=require(_0x9f57('0xe'));var Papa=require(_0x9f57('0xf'));var Redis=require(_0x9f57('0x10'));var authService=require(_0x9f57('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9f57('0x12'));var hardwareService=require(_0x9f57('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9f57('0x14'));var config=require(_0x9f57('0x15'));var db=require(_0x9f57('0x16'))['db'];function respondWithStatusCode(_0x5f5465,_0x5380df){_0x5380df=_0x5380df||0xcc;return function(_0x3a6eb7){if(_0x3a6eb7){return _0x5f5465[_0x9f57('0x17')](_0x5380df);}return _0x5f5465[_0x9f57('0x18')](_0x5380df)['end']();};}function respondWithResult(_0x906fab,_0x3eed3c){_0x3eed3c=_0x3eed3c||0xc8;return function(_0x2742af){if(_0x2742af){return _0x906fab[_0x9f57('0x18')](_0x3eed3c)['json'](_0x2742af);}};}function respondWithFilteredResult(_0x569e97,_0x42c3cb){return function(_0x3678f2){if(_0x3678f2){var _0xb98953=_0x3678f2[_0x9f57('0x19')],_0x113e73=_0x42c3cb[_0x9f57('0x1a')],_0x154ae5=_0x42c3cb[_0x9f57('0x1a')]+_0x42c3cb['limit'],_0x345a8f;if(_0x154ae5>=_0xb98953){_0x154ae5=_0xb98953;_0x345a8f=0xc8;}else{_0x345a8f=0xce;}_0x569e97[_0x9f57('0x18')](_0x345a8f);return _0x569e97[_0x9f57('0x1b')](_0x9f57('0x1c'),_0x113e73+'-'+_0x154ae5+'/'+_0xb98953)[_0x9f57('0x1d')](_0x3678f2);}return null;};}function patchUpdates(_0x356abb){return function(_0x160082){try{jsonpatch[_0x9f57('0x1e')](_0x160082,_0x356abb,!![]);}catch(_0x31e836){return BPromise[_0x9f57('0x1f')](_0x31e836);}return _0x160082[_0x9f57('0x20')]();};}function saveUpdates(_0x32a4aa,_0x539e8c){return function(_0x42aba3){if(_0x42aba3){return _0x42aba3[_0x9f57('0x21')](_0x32a4aa)['then'](function(_0x41eac5){return _0x41eac5;});}return null;};}function removeEntity(_0x3bfe7f,_0x57c193){return function(_0x2abc65){if(_0x2abc65){return _0x2abc65[_0x9f57('0x22')]()['then'](function(){_0x3bfe7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ae801,_0xae6f7b){return function(_0x19a702){if(!_0x19a702){_0x5ae801['sendStatus'](0x194);}return _0x19a702;};}function handleError(_0x38d14b,_0x3cdf5b){_0x3cdf5b=_0x3cdf5b||0x1f4;return function(_0x47918a){logger[_0x9f57('0x23')](_0x47918a[_0x9f57('0x24')]);if(_0x47918a[_0x9f57('0x25')]){delete _0x47918a[_0x9f57('0x25')];}_0x38d14b[_0x9f57('0x18')](_0x3cdf5b)[_0x9f57('0x26')](_0x47918a);};}exports[_0x9f57('0x27')]=function(_0x3ccc5b,_0x4734bb){var _0x2bbfe0={},_0x4f6e78={},_0x29da4b={'count':0x0,'rows':[]};var _0x15ef57=_[_0x9f57('0x28')](db[_0x9f57('0x29')][_0x9f57('0x2a')],function(_0x554994){return{'name':_0x554994[_0x9f57('0x2b')],'type':_0x554994['type'][_0x9f57('0x2c')]};});_0x4f6e78[_0x9f57('0x2d')]=_[_0x9f57('0x28')](_0x15ef57,_0x9f57('0x25'));_0x4f6e78[_0x9f57('0x2e')]=_[_0x9f57('0x2f')](_0x3ccc5b[_0x9f57('0x2e')]);_0x4f6e78['filters']=_['intersection'](_0x4f6e78[_0x9f57('0x2d')],_0x4f6e78[_0x9f57('0x2e')]);_0x2bbfe0[_0x9f57('0x30')]=_[_0x9f57('0x31')](_0x4f6e78[_0x9f57('0x2d')],qs['fields'](_0x3ccc5b[_0x9f57('0x2e')][_0x9f57('0x32')]));_0x2bbfe0[_0x9f57('0x30')]=_0x2bbfe0[_0x9f57('0x30')][_0x9f57('0x33')]?_0x2bbfe0[_0x9f57('0x30')]:_0x4f6e78[_0x9f57('0x2d')];if(!_0x3ccc5b[_0x9f57('0x2e')]['hasOwnProperty'](_0x9f57('0x34'))){_0x2bbfe0['limit']=qs[_0x9f57('0x35')](_0x3ccc5b[_0x9f57('0x2e')][_0x9f57('0x35')]);_0x2bbfe0['offset']=qs[_0x9f57('0x1a')](_0x3ccc5b[_0x9f57('0x2e')][_0x9f57('0x1a')]);}_0x2bbfe0[_0x9f57('0x36')]=qs['sort'](_0x3ccc5b[_0x9f57('0x2e')]['sort']);_0x2bbfe0[_0x9f57('0x37')]=qs[_0x9f57('0x38')](_[_0x9f57('0x39')](_0x3ccc5b[_0x9f57('0x2e')],_0x4f6e78[_0x9f57('0x38')]),_0x15ef57);if(_0x3ccc5b[_0x9f57('0x2e')][_0x9f57('0x3a')]){_0x2bbfe0[_0x9f57('0x37')]=_[_0x9f57('0x3b')](_0x2bbfe0[_0x9f57('0x37')],{'$or':_['map'](_0x15ef57,function(_0x23f9c8){if(_0x23f9c8[_0x9f57('0x3c')]!=='VIRTUAL'){var _0x38589a={};_0x38589a[_0x23f9c8['name']]={'$like':'%'+_0x3ccc5b[_0x9f57('0x2e')]['filter']+'%'};return _0x38589a;}})});}_0x2bbfe0=_[_0x9f57('0x3b')]({},_0x2bbfe0,_0x3ccc5b['options']);var _0x5cf42f={'where':_0x2bbfe0[_0x9f57('0x37')]};return db[_0x9f57('0x29')][_0x9f57('0x19')](_0x5cf42f)['then'](function(_0x204103){_0x29da4b['count']=_0x204103;if(_0x3ccc5b['query']['includeAll']){_0x2bbfe0[_0x9f57('0x3d')]=[{'all':!![]}];}return db[_0x9f57('0x29')]['findAll'](_0x2bbfe0);})[_0x9f57('0x3e')](function(_0x149958){_0x29da4b[_0x9f57('0x3f')]=_0x149958;return _0x29da4b;})[_0x9f57('0x3e')](respondWithFilteredResult(_0x4734bb,_0x2bbfe0))[_0x9f57('0x40')](handleError(_0x4734bb,null));};exports[_0x9f57('0x41')]=function(_0x1ac293,_0x188f6d){var _0xa13aa3={'raw':!![],'where':{'id':_0x1ac293[_0x9f57('0x42')]['id']}},_0x27266a={};_0x27266a['model']=_[_0x9f57('0x2f')](db[_0x9f57('0x29')][_0x9f57('0x2a')]);_0x27266a[_0x9f57('0x2e')]=_[_0x9f57('0x2f')](_0x1ac293[_0x9f57('0x2e')]);_0x27266a[_0x9f57('0x38')]=_['intersection'](_0x27266a[_0x9f57('0x2d')],_0x27266a[_0x9f57('0x2e')]);_0xa13aa3['attributes']=_['intersection'](_0x27266a[_0x9f57('0x2d')],qs[_0x9f57('0x32')](_0x1ac293[_0x9f57('0x2e')][_0x9f57('0x32')]));_0xa13aa3[_0x9f57('0x30')]=_0xa13aa3['attributes']['length']?_0xa13aa3[_0x9f57('0x30')]:_0x27266a[_0x9f57('0x2d')];if(_0x1ac293[_0x9f57('0x2e')]['includeAll']){_0xa13aa3[_0x9f57('0x3d')]=[{'all':!![]}];}_0xa13aa3=_[_0x9f57('0x3b')]({},_0xa13aa3,_0x1ac293[_0x9f57('0x43')]);return db[_0x9f57('0x29')]['find'](_0xa13aa3)['then'](handleEntityNotFound(_0x188f6d,null))[_0x9f57('0x3e')](respondWithResult(_0x188f6d,null))['catch'](handleError(_0x188f6d,null));};exports['create']=function(_0x51a020,_0x482f55){return db[_0x9f57('0x29')][_0x9f57('0x44')](_0x51a020[_0x9f57('0x45')],{})[_0x9f57('0x3e')](respondWithResult(_0x482f55,0xc9))[_0x9f57('0x40')](handleError(_0x482f55,null));};exports[_0x9f57('0x21')]=function(_0x2a92ab,_0x15fae1){if(_0x2a92ab[_0x9f57('0x45')]['id']){delete _0x2a92ab[_0x9f57('0x45')]['id'];}return db[_0x9f57('0x29')][_0x9f57('0x46')]({'where':{'id':_0x2a92ab['params']['id']}})[_0x9f57('0x3e')](handleEntityNotFound(_0x15fae1,null))[_0x9f57('0x3e')](saveUpdates(_0x2a92ab[_0x9f57('0x45')],null))[_0x9f57('0x3e')](respondWithResult(_0x15fae1,null))[_0x9f57('0x40')](handleError(_0x15fae1,null));};exports[_0x9f57('0x22')]=function(_0x35f222,_0x197e46){return db[_0x9f57('0x29')][_0x9f57('0x46')]({'where':{'id':_0x35f222[_0x9f57('0x42')]['id']}})[_0x9f57('0x3e')](handleEntityNotFound(_0x197e46,null))[_0x9f57('0x3e')](removeEntity(_0x197e46,null))[_0x9f57('0x40')](handleError(_0x197e46,null));};
\ No newline at end of file
+var _0x1393=['fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','Dynamics365Field','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','to-csv','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','json','apply','reject','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model'];(function(_0x198d12,_0x919d3b){var _0x22d8c8=function(_0x52caf1){while(--_0x52caf1){_0x198d12['push'](_0x198d12['shift']());}};_0x22d8c8(++_0x919d3b);}(_0x1393,0x92));var _0x3139=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1393[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3139('0x0'));var rimraf=require(_0x3139('0x1'));var zipdir=require(_0x3139('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3139('0x3'));var moment=require(_0x3139('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3139('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3139('0x6'));var crypto=require(_0x3139('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x3139('0x8'));var toCsv=require(_0x3139('0x5'));var querystring=require(_0x3139('0x9'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3139('0xa'));var qs=require(_0x3139('0xb'));var as=require(_0x3139('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3139('0xd'));var utils=require('../../config/utils');var config=require(_0x3139('0xe'));var db=require(_0x3139('0xf'))['db'];function respondWithStatusCode(_0x13b6bc,_0x42de27){_0x42de27=_0x42de27||0xcc;return function(_0x5eb5de){if(_0x5eb5de){return _0x13b6bc[_0x3139('0x10')](_0x42de27);}return _0x13b6bc[_0x3139('0x11')](_0x42de27)[_0x3139('0x12')]();};}function respondWithResult(_0x3a8fb2,_0x57c46d){_0x57c46d=_0x57c46d||0xc8;return function(_0x26d7d7){if(_0x26d7d7){return _0x3a8fb2[_0x3139('0x11')](_0x57c46d)['json'](_0x26d7d7);}};}function respondWithFilteredResult(_0xe937f5,_0x39f5f2){return function(_0x3aa61a){if(_0x3aa61a){var _0x16fd66=_0x3aa61a[_0x3139('0x13')],_0x78696d=_0x39f5f2[_0x3139('0x14')],_0x3ff9ef=_0x39f5f2['offset']+_0x39f5f2[_0x3139('0x15')],_0x58a570;if(_0x3ff9ef>=_0x16fd66){_0x3ff9ef=_0x16fd66;_0x58a570=0xc8;}else{_0x58a570=0xce;}_0xe937f5[_0x3139('0x11')](_0x58a570);return _0xe937f5['set']('Content-Range',_0x78696d+'-'+_0x3ff9ef+'/'+_0x16fd66)[_0x3139('0x16')](_0x3aa61a);}return null;};}function patchUpdates(_0x28e246){return function(_0x5ce5d3){try{jsonpatch[_0x3139('0x17')](_0x5ce5d3,_0x28e246,!![]);}catch(_0x3a4f3f){return BPromise[_0x3139('0x18')](_0x3a4f3f);}return _0x5ce5d3['save']();};}function saveUpdates(_0x2b938c,_0x3d6b4d){return function(_0x4069a3){if(_0x4069a3){return _0x4069a3[_0x3139('0x19')](_0x2b938c)[_0x3139('0x1a')](function(_0x3b3c6b){return _0x3b3c6b;});}return null;};}function removeEntity(_0x39eb62,_0x138822){return function(_0x5d6853){if(_0x5d6853){return _0x5d6853[_0x3139('0x1b')]()[_0x3139('0x1a')](function(){_0x39eb62['status'](0xcc)[_0x3139('0x12')]();});}};}function handleEntityNotFound(_0x7c4a0,_0x46235c){return function(_0x187ea6){if(!_0x187ea6){_0x7c4a0['sendStatus'](0x194);}return _0x187ea6;};}function handleError(_0x1a3cf8,_0xdecb7f){_0xdecb7f=_0xdecb7f||0x1f4;return function(_0x146fe8){logger[_0x3139('0x1c')](_0x146fe8[_0x3139('0x1d')]);if(_0x146fe8[_0x3139('0x1e')]){delete _0x146fe8['name'];}_0x1a3cf8[_0x3139('0x11')](_0xdecb7f)['send'](_0x146fe8);};}exports['index']=function(_0x5817d3,_0x4b22d7){var _0x9d41db={},_0x2d5d2c={},_0xd3426f={'count':0x0,'rows':[]};var _0x286bff=_[_0x3139('0x1f')](db['Dynamics365Field'][_0x3139('0x20')],function(_0x223b65){return{'name':_0x223b65[_0x3139('0x21')],'type':_0x223b65[_0x3139('0x22')]['key']};});_0x2d5d2c['model']=_[_0x3139('0x1f')](_0x286bff,_0x3139('0x1e'));_0x2d5d2c[_0x3139('0x23')]=_[_0x3139('0x24')](_0x5817d3['query']);_0x2d5d2c[_0x3139('0x25')]=_[_0x3139('0x26')](_0x2d5d2c[_0x3139('0x27')],_0x2d5d2c['query']);_0x9d41db['attributes']=_[_0x3139('0x26')](_0x2d5d2c['model'],qs[_0x3139('0x28')](_0x5817d3[_0x3139('0x23')]['fields']));_0x9d41db[_0x3139('0x29')]=_0x9d41db[_0x3139('0x29')][_0x3139('0x2a')]?_0x9d41db[_0x3139('0x29')]:_0x2d5d2c['model'];if(!_0x5817d3['query'][_0x3139('0x2b')]('nolimit')){_0x9d41db['limit']=qs[_0x3139('0x15')](_0x5817d3['query'][_0x3139('0x15')]);_0x9d41db[_0x3139('0x14')]=qs[_0x3139('0x14')](_0x5817d3[_0x3139('0x23')][_0x3139('0x14')]);}_0x9d41db['order']=qs[_0x3139('0x2c')](_0x5817d3['query']['sort']);_0x9d41db[_0x3139('0x2d')]=qs[_0x3139('0x25')](_[_0x3139('0x2e')](_0x5817d3[_0x3139('0x23')],_0x2d5d2c['filters']),_0x286bff);if(_0x5817d3['query'][_0x3139('0x2f')]){_0x9d41db[_0x3139('0x2d')]=_[_0x3139('0x30')](_0x9d41db[_0x3139('0x2d')],{'$or':_['map'](_0x286bff,function(_0x138169){if(_0x138169[_0x3139('0x22')]!==_0x3139('0x31')){var _0x5b24b7={};_0x5b24b7[_0x138169[_0x3139('0x1e')]]={'$like':'%'+_0x5817d3[_0x3139('0x23')]['filter']+'%'};return _0x5b24b7;}})});}_0x9d41db=_[_0x3139('0x30')]({},_0x9d41db,_0x5817d3['options']);var _0x2ce36b={'where':_0x9d41db['where']};return db['Dynamics365Field']['count'](_0x2ce36b)[_0x3139('0x1a')](function(_0x5013ed){_0xd3426f['count']=_0x5013ed;if(_0x5817d3[_0x3139('0x23')][_0x3139('0x32')]){_0x9d41db[_0x3139('0x33')]=[{'all':!![]}];}return db[_0x3139('0x34')][_0x3139('0x35')](_0x9d41db);})[_0x3139('0x1a')](function(_0x28a7e4){_0xd3426f[_0x3139('0x36')]=_0x28a7e4;return _0xd3426f;})[_0x3139('0x1a')](respondWithFilteredResult(_0x4b22d7,_0x9d41db))[_0x3139('0x37')](handleError(_0x4b22d7,null));};exports[_0x3139('0x38')]=function(_0x52fee9,_0x85e8e){var _0x10f7d1={'raw':!![],'where':{'id':_0x52fee9[_0x3139('0x39')]['id']}},_0x176ab7={};_0x176ab7[_0x3139('0x27')]=_['keys'](db['Dynamics365Field'][_0x3139('0x20')]);_0x176ab7[_0x3139('0x23')]=_[_0x3139('0x24')](_0x52fee9[_0x3139('0x23')]);_0x176ab7[_0x3139('0x25')]=_[_0x3139('0x26')](_0x176ab7[_0x3139('0x27')],_0x176ab7[_0x3139('0x23')]);_0x10f7d1['attributes']=_[_0x3139('0x26')](_0x176ab7[_0x3139('0x27')],qs[_0x3139('0x28')](_0x52fee9[_0x3139('0x23')][_0x3139('0x28')]));_0x10f7d1[_0x3139('0x29')]=_0x10f7d1[_0x3139('0x29')]['length']?_0x10f7d1['attributes']:_0x176ab7[_0x3139('0x27')];if(_0x52fee9[_0x3139('0x23')][_0x3139('0x32')]){_0x10f7d1[_0x3139('0x33')]=[{'all':!![]}];}_0x10f7d1=_[_0x3139('0x30')]({},_0x10f7d1,_0x52fee9[_0x3139('0x3a')]);return db[_0x3139('0x34')][_0x3139('0x3b')](_0x10f7d1)['then'](handleEntityNotFound(_0x85e8e,null))['then'](respondWithResult(_0x85e8e,null))[_0x3139('0x37')](handleError(_0x85e8e,null));};exports[_0x3139('0x3c')]=function(_0x488bae,_0x5020fe){return db[_0x3139('0x34')][_0x3139('0x3c')](_0x488bae[_0x3139('0x3d')],{})['then'](respondWithResult(_0x5020fe,0xc9))[_0x3139('0x37')](handleError(_0x5020fe,null));};exports[_0x3139('0x19')]=function(_0x2d507e,_0x4c63ad){if(_0x2d507e[_0x3139('0x3d')]['id']){delete _0x2d507e[_0x3139('0x3d')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x2d507e[_0x3139('0x39')]['id']}})['then'](handleEntityNotFound(_0x4c63ad,null))[_0x3139('0x1a')](saveUpdates(_0x2d507e[_0x3139('0x3d')],null))[_0x3139('0x1a')](respondWithResult(_0x4c63ad,null))[_0x3139('0x37')](handleError(_0x4c63ad,null));};exports[_0x3139('0x1b')]=function(_0x499822,_0x56e8ab){return db['Dynamics365Field'][_0x3139('0x3b')]({'where':{'id':_0x499822['params']['id']}})['then'](handleEntityNotFound(_0x56e8ab,null))['then'](removeEntity(_0x56e8ab,null))[_0x3139('0x37')](handleError(_0x56e8ab,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js
index f6bca9d..9c491d3 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.model.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa97=['util','../../config/logger','api','moment','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xaa97,0x144));var _0x7aa9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa97[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7aa9('0x0'));var util=require(_0x7aa9('0x1'));var logger=require(_0x7aa9('0x2'))(_0x7aa9('0x3'));var moment=require(_0x7aa9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7aa9('0x5'));var attributes=require('./intDynamics365Field.attributes');module[_0x7aa9('0x6')]=function(_0x59e00d,_0x48ed29){return _0x59e00d[_0x7aa9('0x7')](_0x7aa9('0x8'),attributes,{'tableName':_0x7aa9('0x9'),'paranoid':![],'indexes':[{'name':_0x7aa9('0xa'),'fields':[_0x7aa9('0xb'),_0x7aa9('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6385=['exports','define','Dynamics365Field','FieldId','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x3b387d,_0x4c448e){var _0x7bde16=function(_0x5e7d8e){while(--_0x5e7d8e){_0x3b387d['push'](_0x3b387d['shift']());}};_0x7bde16(++_0x4c448e);}(_0x6385,0xe0));var _0x5638=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x6385[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x5638('0x0'));var util=require(_0x5638('0x1'));var logger=require(_0x5638('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5638('0x3'));var fs=require('fs');var path=require(_0x5638('0x4'));var rimraf=require(_0x5638('0x5'));var config=require(_0x5638('0x6'));var attributes=require('./intDynamics365Field.attributes');module[_0x5638('0x7')]=function(_0x45083c,_0x52f6b0){return _0x45083c[_0x5638('0x8')](_0x5638('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x5638('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js
index 2942375..fe723b9 100644
--- a/server/api/intDynamics365Field/intDynamics365Field.rpc.js
+++ b/server/api/intDynamics365Field/intDynamics365Field.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46e1=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x200082,_0x25aec6){var _0x2903e2=function(_0x4e4082){while(--_0x4e4082){_0x200082['push'](_0x200082['shift']());}};_0x2903e2(++_0x25aec6);}(_0x46e1,0x155));var _0x146e=function(_0x20241c,_0x294c44){_0x20241c=_0x20241c-0x0;var _0x5b3087=_0x46e1[_0x20241c];return _0x5b3087;};'use strict';var _=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var moment=require(_0x146e('0x2'));var BPromise=require(_0x146e('0x3'));var rs=require(_0x146e('0x4'));var fs=require('fs');var Redis=require(_0x146e('0x5'));var db=require(_0x146e('0x6'))['db'];var utils=require(_0x146e('0x7'));var logger=require(_0x146e('0x8'))(_0x146e('0x9'));var config=require('../../config/environment');var jayson=require(_0x146e('0xa'));var client=jayson[_0x146e('0xb')][_0x146e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x228fe7,_0x70ce4,_0x35e40e){return new BPromise(function(_0x1c1398,_0x5f33c0){return client[_0x146e('0xd')](_0x228fe7,_0x35e40e)['then'](function(_0x36f843){logger[_0x146e('0xe')](_0x146e('0xf'),_0x70ce4,_0x146e('0x10'));logger[_0x146e('0x11')](_0x146e('0x12'),_0x70ce4,'request\x20sent',JSON['stringify'](_0x36f843));if(_0x36f843[_0x146e('0x13')]){if(_0x36f843[_0x146e('0x13')][_0x146e('0x14')]===0x1f4){logger[_0x146e('0x13')](_0x146e('0xf'),_0x70ce4,_0x36f843[_0x146e('0x13')][_0x146e('0x15')]);return _0x5f33c0(_0x36f843[_0x146e('0x13')]['message']);}logger['error'](_0x146e('0xf'),_0x70ce4,_0x36f843[_0x146e('0x13')][_0x146e('0x15')]);return _0x1c1398(_0x36f843[_0x146e('0x13')][_0x146e('0x15')]);}else{logger[_0x146e('0xe')](_0x146e('0xf'),_0x70ce4,_0x146e('0x10'));_0x1c1398(_0x36f843[_0x146e('0x16')][_0x146e('0x15')]);}})[_0x146e('0x17')](function(_0x55fddc){logger[_0x146e('0x13')](_0x146e('0xf'),_0x70ce4,_0x55fddc);_0x5f33c0(_0x55fddc);});});}
\ No newline at end of file
+var _0x2e65=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1a5b4f,_0x387294){var _0x19b7e2=function(_0x4890b8){while(--_0x4890b8){_0x1a5b4f['push'](_0x1a5b4f['shift']());}};_0x19b7e2(++_0x387294);}(_0x2e65,0x193));var _0x52e6=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x2e65[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var moment=require(_0x52e6('0x2'));var BPromise=require(_0x52e6('0x3'));var rs=require(_0x52e6('0x4'));var fs=require('fs');var Redis=require(_0x52e6('0x5'));var db=require(_0x52e6('0x6'))['db'];var utils=require(_0x52e6('0x7'));var logger=require('../../config/logger')(_0x52e6('0x8'));var config=require(_0x52e6('0x9'));var jayson=require(_0x52e6('0xa'));var client=jayson[_0x52e6('0xb')][_0x52e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x116651,_0x15e4af,_0x1401a3){return new BPromise(function(_0x27f270,_0x2ab17e){return client['request'](_0x116651,_0x1401a3)[_0x52e6('0xd')](function(_0x1db169){logger['info'](_0x52e6('0xe'),_0x15e4af,'request\x20sent');logger['debug'](_0x52e6('0xf'),_0x15e4af,_0x52e6('0x10'),JSON[_0x52e6('0x11')](_0x1db169));if(_0x1db169[_0x52e6('0x12')]){if(_0x1db169[_0x52e6('0x12')][_0x52e6('0x13')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x15e4af,_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);return _0x2ab17e(_0x1db169['error'][_0x52e6('0x14')]);}logger[_0x52e6('0x12')](_0x52e6('0xe'),_0x15e4af,_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);return _0x27f270(_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);}else{logger[_0x52e6('0x15')](_0x52e6('0xe'),_0x15e4af,_0x52e6('0x10'));_0x27f270(_0x1db169[_0x52e6('0x16')][_0x52e6('0x14')]);}})[_0x52e6('0x17')](function(_0x5c275c){logger['error'](_0x52e6('0xe'),_0x15e4af,_0x5c275c);_0x2ab17e(_0x5c275c);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js
index cfd68f9..3f303b3 100644
--- a/server/api/intFreshdeskAccount/index.js
+++ b/server/api/intFreshdeskAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21c1=['create','addConfiguration','put','delete','destroy','util','path','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','/:id','show','get','/:id/configurations','getConfigurations','isAuthenticated','getFields','post'];(function(_0x5d84d6,_0x1a4671){var _0x2cd0f5=function(_0x243d25){while(--_0x243d25){_0x5d84d6['push'](_0x5d84d6['shift']());}};_0x2cd0f5(++_0x1a4671);}(_0x21c1,0x195));var _0x121c=function(_0x2a69ee,_0x443917){_0x2a69ee=_0x2a69ee-0x0;var _0x5db1a5=_0x21c1[_0x2a69ee];return _0x5db1a5;};'use strict';var multer=require('multer');var util=require(_0x121c('0x0'));var path=require(_0x121c('0x1'));var timeout=require('connect-timeout');var express=require(_0x121c('0x2'));var router=express[_0x121c('0x3')]();var auth=require(_0x121c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x121c('0x5'));var controller=require(_0x121c('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x121c('0x7'),auth['isAuthenticated'](),controller[_0x121c('0x8')]);router[_0x121c('0x9')](_0x121c('0xa'),auth['isAuthenticated'](),controller[_0x121c('0xb')]);router['get']('/:id/fields',auth[_0x121c('0xc')](),controller[_0x121c('0xd')]);router[_0x121c('0xe')]('/',auth['isAuthenticated'](),controller[_0x121c('0xf')]);router[_0x121c('0xe')](_0x121c('0xa'),auth[_0x121c('0xc')](),controller[_0x121c('0x10')]);router[_0x121c('0x11')]('/:id',auth[_0x121c('0xc')](),controller['update']);router[_0x121c('0x12')]('/:id',auth[_0x121c('0xc')](),controller[_0x121c('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x0d48=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','getConfigurations','getFields','post','/:id/configurations','addConfiguration'];(function(_0x5d4b45,_0x296b35){var _0x5dd938=function(_0x9cf4){while(--_0x9cf4){_0x5d4b45['push'](_0x5d4b45['shift']());}};_0x5dd938(++_0x296b35);}(_0x0d48,0x16d));var _0x80d4=function(_0x2989ef,_0x353d45){_0x2989ef=_0x2989ef-0x0;var _0x25c7dd=_0x0d48[_0x2989ef];return _0x25c7dd;};'use strict';var multer=require(_0x80d4('0x0'));var util=require(_0x80d4('0x1'));var path=require(_0x80d4('0x2'));var timeout=require(_0x80d4('0x3'));var express=require(_0x80d4('0x4'));var router=express[_0x80d4('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x80d4('0x6'));var config=require('../../config/environment');var controller=require(_0x80d4('0x7'));router[_0x80d4('0x8')]('/',auth[_0x80d4('0x9')](),controller['index']);router[_0x80d4('0x8')]('/:id',auth[_0x80d4('0x9')](),controller['show']);router[_0x80d4('0x8')]('/:id/configurations',auth[_0x80d4('0x9')](),controller[_0x80d4('0xa')]);router[_0x80d4('0x8')]('/:id/fields',auth[_0x80d4('0x9')](),controller[_0x80d4('0xb')]);router['post']('/',auth[_0x80d4('0x9')](),controller['create']);router[_0x80d4('0xc')](_0x80d4('0xd'),auth[_0x80d4('0x9')](),controller[_0x80d4('0xe')]);router[_0x80d4('0xf')](_0x80d4('0x10'),auth['isAuthenticated'](),controller[_0x80d4('0x11')]);router[_0x80d4('0x12')](_0x80d4('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x80d4('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
index ce09a02..618d591 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef4d=['username','remoteUri','sequelize','exports','STRING'];(function(_0xcdf550,_0x3c033a){var _0x5c390e=function(_0x3b0d7c){while(--_0x3b0d7c){_0xcdf550['push'](_0xcdf550['shift']());}};_0x5c390e(++_0x3c033a);}(_0xef4d,0x165));var _0xdef4=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xef4d[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0xdef4('0x0'));module[_0xdef4('0x1')]={'name':{'type':Sequelize[_0xdef4('0x2')]},'description':{'type':Sequelize[_0xdef4('0x2')]},'username':{'type':Sequelize[_0xdef4('0x2')],'unique':_0xdef4('0x3')},'apiKey':{'type':Sequelize[_0xdef4('0x2')]},'remoteUri':{'type':Sequelize[_0xdef4('0x2')],'unique':_0xdef4('0x4')},'serverUrl':{'type':Sequelize[_0xdef4('0x2')]}};
\ No newline at end of file
+var _0xa5c9=['exports','STRING','sequelize'];(function(_0x2a388,_0x447623){var _0x43b023=function(_0x3341a3){while(--_0x3341a3){_0x2a388['push'](_0x2a388['shift']());}};_0x43b023(++_0x447623);}(_0xa5c9,0x143));var _0x9a5c=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0xa5c9[_0x478414];return _0x5eb6b9;};'use strict';var Sequelize=require(_0x9a5c('0x0'));module[_0x9a5c('0x1')]={'name':{'type':Sequelize[_0x9a5c('0x2')]},'description':{'type':Sequelize[_0x9a5c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x9a5c('0x2')]},'remoteUri':{'type':Sequelize[_0x9a5c('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
index b0f66b5..70aef47 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa41a=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','end','status','json','count','offset','limit','Content-Range','apply','update','destroy','sendStatus','name','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','FreshdeskConfiguration','map','addConfiguration','findOne','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','requester','subject','description','priority','source','ticket_type','company','includes','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce'];(function(_0x30d061,_0x1b0de8){var _0x5c44c9=function(_0x7271c0){while(--_0x7271c0){_0x30d061['push'](_0x30d061['shift']());}};_0x5c44c9(++_0x1b0de8);}(_0xa41a,0x6b));var _0xaa41=function(_0xcae9f7,_0x1caec1){_0xcae9f7=_0xcae9f7-0x0;var _0x3b7f5e=_0xa41a[_0xcae9f7];return _0x3b7f5e;};'use strict';var pdf=require(_0xaa41('0x0'));var emlformat=require(_0xaa41('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaa41('0x2'));var jsonpatch=require(_0xaa41('0x3'));var rp=require(_0xaa41('0x4'));var moment=require(_0xaa41('0x5'));var BPromise=require(_0xaa41('0x6'));var Mustache=require(_0xaa41('0x7'));var util=require(_0xaa41('0x8'));var path=require(_0xaa41('0x9'));var sox=require('sox');var csv=require(_0xaa41('0xa'));var ejs=require(_0xaa41('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xa'));var querystring=require(_0xaa41('0xe'));var Papa=require(_0xaa41('0xf'));var Redis=require(_0xaa41('0x10'));var authService=require(_0xaa41('0x11'));var qs=require(_0xaa41('0x12'));var as=require(_0xaa41('0x13'));var hardwareService=require(_0xaa41('0x14'));var logger=require(_0xaa41('0x15'))('api');var utils=require(_0xaa41('0x16'));var config=require(_0xaa41('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xaa41('0x18'));var client=jayson['client'][_0xaa41('0x19')]({'port':0x232a});function checkPasswordPattern(_0x12d9e6,_0x2f64bc,_0x889d44){if(_0x889d44){var _0x6f9ade=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6f9ade['test'](_0x2f64bc)){return _0x12d9e6;}else{throw new db[(_0xaa41('0x1a'))][(_0xaa41('0x1b'))](_0xaa41('0x1c'));}}else{return _0x12d9e6;}}function respondWithRpcPromise(_0x1ef7d9,_0x2a6988,_0x2005ae,_0x1e1e02){return new BPromise(function(_0x550ad5,_0x2d868a){var _0x16b930=_0x1e1e02||client;return _0x16b930[_0xaa41('0x1d')](_0x1ef7d9,_0x2005ae)[_0xaa41('0x1e')](function(_0x230a6a){logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2a6988,_0xaa41('0x21'));logger[_0xaa41('0x22')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2a6988,'request\x20sent',JSON[_0xaa41('0x23')](_0x230a6a));if(_0x230a6a[_0xaa41('0x24')]){if(_0x230a6a[_0xaa41('0x24')]['code']===0x1f4){logger[_0xaa41('0x24')](_0xaa41('0x20'),_0x2a6988,_0x230a6a['error']['message']);return _0x2d868a(_0x230a6a[_0xaa41('0x24')]['message']);}logger[_0xaa41('0x24')](_0xaa41('0x20'),_0x2a6988,_0x230a6a[_0xaa41('0x24')][_0xaa41('0x25')]);return _0x550ad5(_0x230a6a[_0xaa41('0x24')]['message']);}else{logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2a6988,_0xaa41('0x21'));_0x550ad5(_0x230a6a[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x5c3074){logger['error'](_0xaa41('0x20'),_0x2a6988,_0x5c3074);_0x2d868a(_0x5c3074);});});}function respondWithStatusCode(_0x527cac,_0x493a10){_0x493a10=_0x493a10||0xcc;return function(_0x12e362){if(_0x12e362){return _0x527cac['sendStatus'](_0x493a10);}return _0x527cac['status'](_0x493a10)[_0xaa41('0x28')]();};}function respondWithResult(_0x9c8c21,_0x392214){_0x392214=_0x392214||0xc8;return function(_0x632fd2){if(_0x632fd2){return _0x9c8c21[_0xaa41('0x29')](_0x392214)[_0xaa41('0x2a')](_0x632fd2);}};}function respondWithFilteredResult(_0x57ef96,_0x30a174){return function(_0x1f0275){if(_0x1f0275){var _0x63c18c=_0x1f0275[_0xaa41('0x2b')],_0x9a16e3=_0x30a174[_0xaa41('0x2c')],_0x1d8c2b=_0x30a174['offset']+_0x30a174[_0xaa41('0x2d')],_0x4466a3;if(_0x1d8c2b>=_0x63c18c){_0x1d8c2b=_0x63c18c;_0x4466a3=0xc8;}else{_0x4466a3=0xce;}_0x57ef96['status'](_0x4466a3);return _0x57ef96['set'](_0xaa41('0x2e'),_0x9a16e3+'-'+_0x1d8c2b+'/'+_0x63c18c)[_0xaa41('0x2a')](_0x1f0275);}return null;};}function patchUpdates(_0x534a85){return function(_0x392b5d){try{jsonpatch[_0xaa41('0x2f')](_0x392b5d,_0x534a85,!![]);}catch(_0x4e3b44){return BPromise['reject'](_0x4e3b44);}return _0x392b5d['save']();};}function saveUpdates(_0x1cf3da,_0x2f5cc0){return function(_0x2a186e){if(_0x2a186e){return _0x2a186e[_0xaa41('0x30')](_0x1cf3da)['then'](function(_0x289c4a){return _0x289c4a;});}return null;};}function removeEntity(_0x45c8fe,_0x3e0204){return function(_0x4de770){if(_0x4de770){return _0x4de770[_0xaa41('0x31')]()[_0xaa41('0x1e')](function(){_0x45c8fe[_0xaa41('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x252c62,_0x374117){return function(_0x57fe1d){if(!_0x57fe1d){_0x252c62[_0xaa41('0x32')](0x194);}return _0x57fe1d;};}function handleError(_0x13b6d4,_0x2298ed){_0x2298ed=_0x2298ed||0x1f4;return function(_0x5cec87){logger[_0xaa41('0x24')](_0x5cec87['stack']);if(_0x5cec87[_0xaa41('0x33')]){delete _0x5cec87[_0xaa41('0x33')];}_0x13b6d4[_0xaa41('0x29')](_0x2298ed)['send'](_0x5cec87);};}exports['index']=function(_0x4cdd42,_0x2dc05a){var _0x2e785f={},_0x1334c8={},_0x224eb3={'count':0x0,'rows':[]};var _0x4fbb92=_['map'](db[_0xaa41('0x34')][_0xaa41('0x35')],function(_0x951e52){return{'name':_0x951e52[_0xaa41('0x36')],'type':_0x951e52[_0xaa41('0x37')][_0xaa41('0x38')]};});_0x1334c8[_0xaa41('0x39')]=_['map'](_0x4fbb92,_0xaa41('0x33'));_0x1334c8[_0xaa41('0x3a')]=_[_0xaa41('0x3b')](_0x4cdd42[_0xaa41('0x3a')]);_0x1334c8['filters']=_['intersection'](_0x1334c8[_0xaa41('0x39')],_0x1334c8[_0xaa41('0x3a')]);_0x2e785f['attributes']=_[_0xaa41('0x3c')](_0x1334c8['model'],qs[_0xaa41('0x3d')](_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x3d')]));_0x2e785f[_0xaa41('0x3e')]=_0x2e785f[_0xaa41('0x3e')][_0xaa41('0x3f')]?_0x2e785f[_0xaa41('0x3e')]:_0x1334c8[_0xaa41('0x39')];if(!_0x4cdd42['query'][_0xaa41('0x40')](_0xaa41('0x41'))){_0x2e785f[_0xaa41('0x2d')]=qs[_0xaa41('0x2d')](_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x2d')]);_0x2e785f['offset']=qs['offset'](_0x4cdd42[_0xaa41('0x3a')]['offset']);}_0x2e785f[_0xaa41('0x42')]=qs[_0xaa41('0x43')](_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x43')]);_0x2e785f[_0xaa41('0x44')]=qs[_0xaa41('0x45')](_[_0xaa41('0x46')](_0x4cdd42['query'],_0x1334c8[_0xaa41('0x45')]),_0x4fbb92);if(_0x4cdd42['query']['filter']){_0x2e785f[_0xaa41('0x44')]=_['merge'](_0x2e785f['where'],{'$or':_['map'](_0x4fbb92,function(_0x3bad48){if(_0x3bad48['type']!==_0xaa41('0x47')){var _0x198716={};_0x198716[_0x3bad48['name']]={'$like':'%'+_0x4cdd42['query'][_0xaa41('0x48')]+'%'};return _0x198716;}})});}_0x2e785f=_[_0xaa41('0x49')]({},_0x2e785f,_0x4cdd42[_0xaa41('0x4a')]);var _0x2af8ba={'where':_0x2e785f[_0xaa41('0x44')]};return db[_0xaa41('0x34')][_0xaa41('0x2b')](_0x2af8ba)[_0xaa41('0x1e')](function(_0x2fa6ec){_0x224eb3['count']=_0x2fa6ec;if(_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x4b')]){_0x2e785f[_0xaa41('0x4c')]=[{'all':!![]}];}return db[_0xaa41('0x34')][_0xaa41('0x4d')](_0x2e785f);})[_0xaa41('0x1e')](function(_0x538b12){_0x224eb3[_0xaa41('0x4e')]=_0x538b12;return _0x224eb3;})[_0xaa41('0x1e')](respondWithFilteredResult(_0x2dc05a,_0x2e785f))[_0xaa41('0x27')](handleError(_0x2dc05a,null));};exports[_0xaa41('0x4f')]=function(_0x57d1f6,_0x23bc61){var _0x5787f3={'raw':![],'where':{'id':_0x57d1f6[_0xaa41('0x50')]['id']}},_0x49fedd={};_0x49fedd[_0xaa41('0x39')]=_[_0xaa41('0x3b')](db['FreshdeskAccount'][_0xaa41('0x35')]);_0x49fedd[_0xaa41('0x3a')]=_[_0xaa41('0x3b')](_0x57d1f6['query']);_0x49fedd[_0xaa41('0x45')]=_[_0xaa41('0x3c')](_0x49fedd[_0xaa41('0x39')],_0x49fedd[_0xaa41('0x3a')]);_0x5787f3[_0xaa41('0x3e')]=_[_0xaa41('0x3c')](_0x49fedd[_0xaa41('0x39')],qs[_0xaa41('0x3d')](_0x57d1f6['query'][_0xaa41('0x3d')]));_0x5787f3['attributes']=_0x5787f3['attributes'][_0xaa41('0x3f')]?_0x5787f3[_0xaa41('0x3e')]:_0x49fedd[_0xaa41('0x39')];if(_0x57d1f6[_0xaa41('0x3a')][_0xaa41('0x4b')]){_0x5787f3[_0xaa41('0x4c')]=[{'all':!![]}];}_0x5787f3=_[_0xaa41('0x49')]({},_0x5787f3,_0x57d1f6[_0xaa41('0x4a')]);return db['FreshdeskAccount'][_0xaa41('0x51')](_0x5787f3)[_0xaa41('0x1e')](handleEntityNotFound(_0x23bc61,null))[_0xaa41('0x1e')](respondWithResult(_0x23bc61,null))['catch'](handleError(_0x23bc61,null));};exports[_0xaa41('0x52')]=function(_0x35f664,_0x4cf674){return db[_0xaa41('0x34')][_0xaa41('0x52')](_0x35f664[_0xaa41('0x53')],{})['then'](respondWithResult(_0x4cf674,0xc9))[_0xaa41('0x27')](handleError(_0x4cf674,null));};exports[_0xaa41('0x30')]=function(_0x4e3b13,_0x49789a){if(_0x4e3b13[_0xaa41('0x53')]['id']){delete _0x4e3b13[_0xaa41('0x53')]['id'];}return db[_0xaa41('0x34')]['find']({'where':{'id':_0x4e3b13[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x49789a,null))[_0xaa41('0x1e')](saveUpdates(_0x4e3b13[_0xaa41('0x53')],null))[_0xaa41('0x1e')](respondWithResult(_0x49789a,null))['catch'](handleError(_0x49789a,null));};exports[_0xaa41('0x31')]=function(_0x57cb70,_0x555186){return db[_0xaa41('0x34')]['find']({'where':{'id':_0x57cb70[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x555186,null))[_0xaa41('0x1e')](removeEntity(_0x555186,null))['catch'](handleError(_0x555186,null));};exports[_0xaa41('0x54')]=function(_0x41c7f4,_0x36154e,_0x857bbc){var _0xa1f9f9={};var _0x332a3c={};var _0xc56018;var _0x337059;return db[_0xaa41('0x34')]['findOne']({'where':{'id':_0x41c7f4[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x36154e,null))[_0xaa41('0x1e')](function(_0x5a5a55){if(_0x5a5a55){_0xc56018=_0x5a5a55;_0x332a3c[_0xaa41('0x39')]=_[_0xaa41('0x3b')](db[_0xaa41('0x55')][_0xaa41('0x35')]);_0x332a3c[_0xaa41('0x3a')]=_[_0xaa41('0x3b')](_0x41c7f4[_0xaa41('0x3a')]);_0x332a3c['filters']=_['intersection'](_0x332a3c['model'],_0x332a3c['query']);_0xa1f9f9['attributes']=_['intersection'](_0x332a3c[_0xaa41('0x39')],qs['fields'](_0x41c7f4['query'][_0xaa41('0x3d')]));_0xa1f9f9[_0xaa41('0x3e')]=_0xa1f9f9[_0xaa41('0x3e')][_0xaa41('0x3f')]?_0xa1f9f9['attributes']:_0x332a3c[_0xaa41('0x39')];_0xa1f9f9[_0xaa41('0x42')]=qs[_0xaa41('0x43')](_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x43')]);_0xa1f9f9[_0xaa41('0x44')]=qs[_0xaa41('0x45')](_[_0xaa41('0x46')](_0x41c7f4[_0xaa41('0x3a')],_0x332a3c['filters']));if(_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x48')]){_0xa1f9f9['where']=_['merge'](_0xa1f9f9['where'],{'$or':_[_0xaa41('0x56')](_0xa1f9f9['attributes'],function(_0x1eac4a){var _0x5c8028={};_0x5c8028[_0x1eac4a]={'$like':'%'+_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x48')]+'%'};return _0x5c8028;})});}_0xa1f9f9=_['merge']({},_0xa1f9f9,_0x41c7f4[_0xaa41('0x4a')]);return _0xc56018[_0xaa41('0x54')](_0xa1f9f9);}})[_0xaa41('0x1e')](function(_0x33f5c2){if(_0x33f5c2){_0x337059=_0x33f5c2['length'];if(!_0x41c7f4['query'][_0xaa41('0x40')](_0xaa41('0x41'))){_0xa1f9f9['limit']=qs['limit'](_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x2d')]);_0xa1f9f9[_0xaa41('0x2c')]=qs[_0xaa41('0x2c')](_0x41c7f4[_0xaa41('0x3a')]['offset']);}return _0xc56018[_0xaa41('0x54')](_0xa1f9f9);}})['then'](function(_0x5062db){if(_0x5062db){return _0x5062db?{'count':_0x337059,'rows':_0x5062db}:null;}})['then'](respondWithResult(_0x36154e,null))[_0xaa41('0x27')](handleError(_0x36154e,null));};exports[_0xaa41('0x57')]=function(_0x436362,_0x5bad74,_0x229297){if(_0x436362[_0xaa41('0x53')]['id']){delete _0x436362[_0xaa41('0x53')]['id'];}return db[_0xaa41('0x34')][_0xaa41('0x58')]({'where':{'id':_0x436362[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x5bad74,null))['then'](function(_0x1d2978){if(_0x1d2978){_0x436362[_0xaa41('0x53')][_0xaa41('0x59')]=_0x1d2978['id'];_0x436362[_0xaa41('0x53')]['Subjects']=integrations[_0xaa41('0x5a')](_0x436362['body'][_0xaa41('0x5b')],_0x436362[_0xaa41('0x53')][_0xaa41('0x37')]);_0x436362[_0xaa41('0x53')]['Descriptions']=integrations[_0xaa41('0x5c')](_0x436362[_0xaa41('0x53')][_0xaa41('0x5b')],_0x436362[_0xaa41('0x53')]['type']);return db[_0xaa41('0x55')]['create'](_0x436362[_0xaa41('0x53')],{'include':[{'model':db[_0xaa41('0x5d')],'as':'Subjects'},{'model':db[_0xaa41('0x5d')],'as':_0xaa41('0x5e')}]});}return null;})[_0xaa41('0x1e')](respondWithResult(_0x5bad74,null))[_0xaa41('0x27')](handleError(_0x5bad74,null));};exports[_0xaa41('0x5f')]=function(_0x1338d3,_0x384aba,_0x297ec6){var _0x33b5f4='';return db[_0xaa41('0x34')][_0xaa41('0x58')]({'where':{'id':_0x1338d3['params']['id']},'attributes':['id',_0xaa41('0x60'),_0xaa41('0x61')]})[_0xaa41('0x1e')](handleEntityNotFound(_0x384aba,null))['then'](function(_0x5ec19b){if(_0x5ec19b){_0x33b5f4=_0x5ec19b[_0xaa41('0x60')];var _0x39da69=_0x33b5f4['slice'](-0x1);if(_0x39da69==='/'){_0x33b5f4=_0x33b5f4[_0xaa41('0x62')](0x0,_0x33b5f4[_0xaa41('0x63')](_0x39da69));}return rp({'method':'GET','uri':util[_0xaa41('0x64')](_0xaa41('0x65'),_0x33b5f4,_0xaa41('0x66')),'headers':{'Authorization':util[_0xaa41('0x64')](_0xaa41('0x67'),new Buffer(util[_0xaa41('0x64')](_0xaa41('0x68'),_0x5ec19b[_0xaa41('0x61')]))['toString']('base64'))},'json':!![]});}})[_0xaa41('0x1e')](function(_0x481db9){if(_0x481db9){var _0x654594=[_0xaa41('0x69'),_0xaa41('0x6a'),'agent',_0xaa41('0x6b'),_0xaa41('0x29'),_0xaa41('0x6c'),'group',_0xaa41('0x6d'),_0xaa41('0x6e'),'group',_0xaa41('0x6f')];_['remove'](_0x481db9,function(_0x53faf4){return _0x654594[_0xaa41('0x70')](_0x53faf4[_0xaa41('0x33')])||!_0x53faf4['default']&&_0x53faf4['type']!==_0xaa41('0x71')&&_0x53faf4[_0xaa41('0x37')]!==_0xaa41('0x72');});return{'count':_0x481db9[_0xaa41('0x3f')],'rows':_['map'](_0x481db9,function(_0x9741a8){return{'id':_0x9741a8[_0xaa41('0x33')],'name':_0x9741a8[_0xaa41('0x73')],'custom':!_0x9741a8['default'],'options':_0x9741a8[_0xaa41('0x74')]?_[_0xaa41('0x56')](_0x9741a8[_0xaa41('0x74')],function(_0x5697b6){return{'name':_[_0xaa41('0x75')](_0x5697b6),'value':_0x5697b6};}):[]};})};}})['then'](respondWithResult(_0x384aba,null))['catch'](function(_0x364d24){var _0x25c4d0=_0x1338d3['query'][_0xaa41('0x76')]?0x1f4:_0x364d24[_0xaa41('0x77')]||0x1f4;logger[_0xaa41('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xaa41('0x5f'),_0x25c4d0,JSON[_0xaa41('0x23')](_0x364d24));delete _0x364d24[_0xaa41('0x33')];if(_0x25c4d0===0x191){_0x25c4d0=0x190;}_0x384aba[_0xaa41('0x29')](_0x25c4d0)[_0xaa41('0x78')](_0x1338d3['query'][_0xaa41('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x364d24[_0xaa41('0x77')]}:_0x364d24);});};
\ No newline at end of file
+var _0x326f=['offset','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','merge','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','options','addConfiguration','AccountId','getSubjects','Descriptions','FreshdeskField','Subjects','getFields','apiKey','remoteUri','slice','substring','GET','api/v2/ticket_fields','format','base64','requester','subject','description','source','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','Sequelize','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count'];(function(_0x1fbc8c,_0x85afeb){var _0xe0ec5e=function(_0x57445d){while(--_0x57445d){_0x1fbc8c['push'](_0x1fbc8c['shift']());}};_0xe0ec5e(++_0x85afeb);}(_0x326f,0xd1));var _0xf326=function(_0x20e485,_0x416e1a){_0x20e485=_0x20e485-0x0;var _0x4f6878=_0x326f[_0x20e485];return _0x4f6878;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xf326('0x17'));var client=jayson[_0xf326('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x342fe5,_0x472632,_0x3504eb){if(_0x3504eb){var _0x17a098=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17a098['test'](_0x472632)){return _0x342fe5;}else{throw new db[(_0xf326('0x19'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x342fe5;}}function respondWithRpcPromise(_0xdf21d9,_0x11f6d2,_0x1f2e5a,_0xa63d1a){return new BPromise(function(_0x292f4b,_0x287a2a){var _0x34128e=_0xa63d1a||client;return _0x34128e[_0xf326('0x1a')](_0xdf21d9,_0x1f2e5a)['then'](function(_0x3ad7da){logger[_0xf326('0x1b')](_0xf326('0x1c'),_0x11f6d2,_0xf326('0x1d'));logger[_0xf326('0x1e')](_0xf326('0x1f'),_0x11f6d2,'request\x20sent',JSON['stringify'](_0x3ad7da));if(_0x3ad7da['error']){if(_0x3ad7da[_0xf326('0x20')][_0xf326('0x21')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da[_0xf326('0x20')]['message']);return _0x287a2a(_0x3ad7da['error'][_0xf326('0x22')]);}logger[_0xf326('0x20')]('FreshdeskAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da['error'][_0xf326('0x22')]);return _0x292f4b(_0x3ad7da[_0xf326('0x20')]['message']);}else{logger[_0xf326('0x1b')](_0xf326('0x1c'),_0x11f6d2,_0xf326('0x1d'));_0x292f4b(_0x3ad7da[_0xf326('0x23')][_0xf326('0x22')]);}})[_0xf326('0x24')](function(_0x5ce532){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x11f6d2,_0x5ce532);_0x287a2a(_0x5ce532);});});}function respondWithStatusCode(_0x520d85,_0x1a2c4e){_0x1a2c4e=_0x1a2c4e||0xcc;return function(_0x2cd45a){if(_0x2cd45a){return _0x520d85[_0xf326('0x25')](_0x1a2c4e);}return _0x520d85[_0xf326('0x26')](_0x1a2c4e)[_0xf326('0x27')]();};}function respondWithResult(_0x5217d4,_0x201d28){_0x201d28=_0x201d28||0xc8;return function(_0xa3c0b){if(_0xa3c0b){return _0x5217d4[_0xf326('0x26')](_0x201d28)['json'](_0xa3c0b);}};}function respondWithFilteredResult(_0x1617d2,_0x55ad0f){return function(_0x4a9abf){if(_0x4a9abf){var _0x6a8e89=_0x4a9abf[_0xf326('0x28')],_0x1ae23a=_0x55ad0f[_0xf326('0x29')],_0x2fa28e=_0x55ad0f['offset']+_0x55ad0f[_0xf326('0x2a')],_0x5dbe63;if(_0x2fa28e>=_0x6a8e89){_0x2fa28e=_0x6a8e89;_0x5dbe63=0xc8;}else{_0x5dbe63=0xce;}_0x1617d2[_0xf326('0x26')](_0x5dbe63);return _0x1617d2[_0xf326('0x2b')](_0xf326('0x2c'),_0x1ae23a+'-'+_0x2fa28e+'/'+_0x6a8e89)[_0xf326('0x2d')](_0x4a9abf);}return null;};}function patchUpdates(_0x269be9){return function(_0x161143){try{jsonpatch[_0xf326('0x2e')](_0x161143,_0x269be9,!![]);}catch(_0x43b951){return BPromise[_0xf326('0x2f')](_0x43b951);}return _0x161143['save']();};}function saveUpdates(_0x1035ed,_0x424104){return function(_0x21b23d){if(_0x21b23d){return _0x21b23d['update'](_0x1035ed)[_0xf326('0x30')](function(_0x1721fd){return _0x1721fd;});}return null;};}function removeEntity(_0x303dc6,_0x4df451){return function(_0x5b101d){if(_0x5b101d){return _0x5b101d[_0xf326('0x31')]()[_0xf326('0x30')](function(){_0x303dc6[_0xf326('0x26')](0xcc)[_0xf326('0x27')]();});}};}function handleEntityNotFound(_0x30694f,_0x2e8a64){return function(_0x62585a){if(!_0x62585a){_0x30694f[_0xf326('0x25')](0x194);}return _0x62585a;};}function handleError(_0x580374,_0x461e93){_0x461e93=_0x461e93||0x1f4;return function(_0x1981bc){logger['error'](_0x1981bc[_0xf326('0x32')]);if(_0x1981bc['name']){delete _0x1981bc[_0xf326('0x33')];}_0x580374['status'](_0x461e93)['send'](_0x1981bc);};}exports[_0xf326('0x34')]=function(_0x4d8eac,_0x40dcb4){var _0x57aa27={},_0x310dbb={},_0x409260={'count':0x0,'rows':[]};var _0x2750ae=_['map'](db[_0xf326('0x35')][_0xf326('0x36')],function(_0x48525a){return{'name':_0x48525a[_0xf326('0x37')],'type':_0x48525a[_0xf326('0x38')][_0xf326('0x39')]};});_0x310dbb[_0xf326('0x3a')]=_['map'](_0x2750ae,_0xf326('0x33'));_0x310dbb[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x4d8eac[_0xf326('0x3b')]);_0x310dbb[_0xf326('0x3d')]=_['intersection'](_0x310dbb[_0xf326('0x3a')],_0x310dbb[_0xf326('0x3b')]);_0x57aa27['attributes']=_['intersection'](_0x310dbb[_0xf326('0x3a')],qs['fields'](_0x4d8eac['query'][_0xf326('0x3e')]));_0x57aa27['attributes']=_0x57aa27[_0xf326('0x3f')][_0xf326('0x40')]?_0x57aa27[_0xf326('0x3f')]:_0x310dbb[_0xf326('0x3a')];if(!_0x4d8eac['query'][_0xf326('0x41')](_0xf326('0x42'))){_0x57aa27[_0xf326('0x2a')]=qs[_0xf326('0x2a')](_0x4d8eac[_0xf326('0x3b')][_0xf326('0x2a')]);_0x57aa27[_0xf326('0x29')]=qs[_0xf326('0x29')](_0x4d8eac[_0xf326('0x3b')][_0xf326('0x29')]);}_0x57aa27[_0xf326('0x43')]=qs[_0xf326('0x44')](_0x4d8eac['query'][_0xf326('0x44')]);_0x57aa27[_0xf326('0x45')]=qs[_0xf326('0x3d')](_[_0xf326('0x46')](_0x4d8eac[_0xf326('0x3b')],_0x310dbb[_0xf326('0x3d')]),_0x2750ae);if(_0x4d8eac['query'][_0xf326('0x47')]){_0x57aa27[_0xf326('0x45')]=_['merge'](_0x57aa27[_0xf326('0x45')],{'$or':_[_0xf326('0x48')](_0x2750ae,function(_0x130c56){if(_0x130c56[_0xf326('0x38')]!==_0xf326('0x49')){var _0x55361f={};_0x55361f[_0x130c56['name']]={'$like':'%'+_0x4d8eac[_0xf326('0x3b')][_0xf326('0x47')]+'%'};return _0x55361f;}})});}_0x57aa27=_['merge']({},_0x57aa27,_0x4d8eac['options']);var _0x8e318d={'where':_0x57aa27[_0xf326('0x45')]};return db[_0xf326('0x35')]['count'](_0x8e318d)[_0xf326('0x30')](function(_0xe96e1e){_0x409260[_0xf326('0x28')]=_0xe96e1e;if(_0x4d8eac[_0xf326('0x3b')][_0xf326('0x4a')]){_0x57aa27[_0xf326('0x4b')]=[{'all':!![]}];}return db[_0xf326('0x35')][_0xf326('0x4c')](_0x57aa27);})[_0xf326('0x30')](function(_0x27ced1){_0x409260[_0xf326('0x4d')]=_0x27ced1;return _0x409260;})[_0xf326('0x30')](respondWithFilteredResult(_0x40dcb4,_0x57aa27))[_0xf326('0x24')](handleError(_0x40dcb4,null));};exports[_0xf326('0x4e')]=function(_0xeac1a1,_0x59f9a7){var _0x199f8b={'raw':![],'where':{'id':_0xeac1a1[_0xf326('0x4f')]['id']}},_0x1b0e03={};_0x1b0e03[_0xf326('0x3a')]=_['keys'](db[_0xf326('0x35')][_0xf326('0x36')]);_0x1b0e03[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xeac1a1['query']);_0x1b0e03[_0xf326('0x3d')]=_[_0xf326('0x50')](_0x1b0e03[_0xf326('0x3a')],_0x1b0e03[_0xf326('0x3b')]);_0x199f8b[_0xf326('0x3f')]=_['intersection'](_0x1b0e03['model'],qs[_0xf326('0x3e')](_0xeac1a1[_0xf326('0x3b')][_0xf326('0x3e')]));_0x199f8b['attributes']=_0x199f8b[_0xf326('0x3f')][_0xf326('0x40')]?_0x199f8b[_0xf326('0x3f')]:_0x1b0e03['model'];if(_0xeac1a1['query'][_0xf326('0x4a')]){_0x199f8b['include']=[{'all':!![]}];}_0x199f8b=_[_0xf326('0x51')]({},_0x199f8b,_0xeac1a1['options']);return db[_0xf326('0x35')][_0xf326('0x52')](_0x199f8b)[_0xf326('0x30')](handleEntityNotFound(_0x59f9a7,null))[_0xf326('0x30')](respondWithResult(_0x59f9a7,null))[_0xf326('0x24')](handleError(_0x59f9a7,null));};exports[_0xf326('0x53')]=function(_0x7f7ece,_0x495a16){return db[_0xf326('0x35')][_0xf326('0x53')](_0x7f7ece[_0xf326('0x54')],{})['then'](respondWithResult(_0x495a16,0xc9))[_0xf326('0x24')](handleError(_0x495a16,null));};exports[_0xf326('0x55')]=function(_0x3b8635,_0x16c578){if(_0x3b8635[_0xf326('0x54')]['id']){delete _0x3b8635['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x52')]({'where':{'id':_0x3b8635[_0xf326('0x4f')]['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x16c578,null))['then'](saveUpdates(_0x3b8635[_0xf326('0x54')],null))[_0xf326('0x30')](respondWithResult(_0x16c578,null))[_0xf326('0x24')](handleError(_0x16c578,null));};exports[_0xf326('0x31')]=function(_0x4d3b9e,_0x5be2b1){return db[_0xf326('0x35')][_0xf326('0x52')]({'where':{'id':_0x4d3b9e['params']['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x5be2b1,null))[_0xf326('0x30')](removeEntity(_0x5be2b1,null))[_0xf326('0x24')](handleError(_0x5be2b1,null));};exports[_0xf326('0x56')]=function(_0x5765b0,_0xb1c18c,_0x5657b7){var _0x5dbeb9={};var _0x9d84c3={};var _0x51d466;var _0x173760;return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x5765b0['params']['id']}})['then'](handleEntityNotFound(_0xb1c18c,null))[_0xf326('0x30')](function(_0xa85a42){if(_0xa85a42){_0x51d466=_0xa85a42;_0x9d84c3[_0xf326('0x3a')]=_['keys'](db[_0xf326('0x58')]['rawAttributes']);_0x9d84c3[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5765b0[_0xf326('0x3b')]);_0x9d84c3[_0xf326('0x3d')]=_[_0xf326('0x50')](_0x9d84c3[_0xf326('0x3a')],_0x9d84c3[_0xf326('0x3b')]);_0x5dbeb9[_0xf326('0x3f')]=_[_0xf326('0x50')](_0x9d84c3[_0xf326('0x3a')],qs[_0xf326('0x3e')](_0x5765b0[_0xf326('0x3b')][_0xf326('0x3e')]));_0x5dbeb9['attributes']=_0x5dbeb9[_0xf326('0x3f')]['length']?_0x5dbeb9[_0xf326('0x3f')]:_0x9d84c3[_0xf326('0x3a')];_0x5dbeb9['order']=qs[_0xf326('0x44')](_0x5765b0['query'][_0xf326('0x44')]);_0x5dbeb9[_0xf326('0x45')]=qs[_0xf326('0x3d')](_[_0xf326('0x46')](_0x5765b0[_0xf326('0x3b')],_0x9d84c3['filters']));if(_0x5765b0['query'][_0xf326('0x47')]){_0x5dbeb9[_0xf326('0x45')]=_[_0xf326('0x51')](_0x5dbeb9[_0xf326('0x45')],{'$or':_[_0xf326('0x48')](_0x5dbeb9['attributes'],function(_0x28c4f2){var _0x471da8={};_0x471da8[_0x28c4f2]={'$like':'%'+_0x5765b0['query']['filter']+'%'};return _0x471da8;})});}_0x5dbeb9=_['merge']({},_0x5dbeb9,_0x5765b0[_0xf326('0x59')]);return _0x51d466[_0xf326('0x56')](_0x5dbeb9);}})[_0xf326('0x30')](function(_0x235525){if(_0x235525){_0x173760=_0x235525[_0xf326('0x40')];if(!_0x5765b0[_0xf326('0x3b')][_0xf326('0x41')]('nolimit')){_0x5dbeb9[_0xf326('0x2a')]=qs[_0xf326('0x2a')](_0x5765b0[_0xf326('0x3b')][_0xf326('0x2a')]);_0x5dbeb9['offset']=qs[_0xf326('0x29')](_0x5765b0['query']['offset']);}return _0x51d466[_0xf326('0x56')](_0x5dbeb9);}})['then'](function(_0x78ba34){if(_0x78ba34){return _0x78ba34?{'count':_0x173760,'rows':_0x78ba34}:null;}})[_0xf326('0x30')](respondWithResult(_0xb1c18c,null))[_0xf326('0x24')](handleError(_0xb1c18c,null));};exports[_0xf326('0x5a')]=function(_0x17cd36,_0x541491,_0x4a053c){if(_0x17cd36['body']['id']){delete _0x17cd36[_0xf326('0x54')]['id'];}return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x17cd36[_0xf326('0x4f')]['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x541491,null))['then'](function(_0x1ed961){if(_0x1ed961){_0x17cd36[_0xf326('0x54')][_0xf326('0x5b')]=_0x1ed961['id'];_0x17cd36['body']['Subjects']=integrations[_0xf326('0x5c')](_0x17cd36[_0xf326('0x54')]['channel'],_0x17cd36['body'][_0xf326('0x38')]);_0x17cd36['body'][_0xf326('0x5d')]=integrations['getDescriptions'](_0x17cd36['body']['channel'],_0x17cd36[_0xf326('0x54')][_0xf326('0x38')]);return db[_0xf326('0x58')]['create'](_0x17cd36[_0xf326('0x54')],{'include':[{'model':db[_0xf326('0x5e')],'as':_0xf326('0x5f')},{'model':db[_0xf326('0x5e')],'as':_0xf326('0x5d')}]});}return null;})[_0xf326('0x30')](respondWithResult(_0x541491,null))[_0xf326('0x24')](handleError(_0x541491,null));};exports[_0xf326('0x60')]=function(_0x3855a4,_0x5290da,_0x34c3cf){var _0x5b1494='';return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x3855a4[_0xf326('0x4f')]['id']},'attributes':['id','remoteUri',_0xf326('0x61')]})[_0xf326('0x30')](handleEntityNotFound(_0x5290da,null))[_0xf326('0x30')](function(_0x4dc8d7){if(_0x4dc8d7){_0x5b1494=_0x4dc8d7[_0xf326('0x62')];var _0x4057e1=_0x5b1494[_0xf326('0x63')](-0x1);if(_0x4057e1==='/'){_0x5b1494=_0x5b1494[_0xf326('0x64')](0x0,_0x5b1494['lastIndexOf'](_0x4057e1));}return rp({'method':_0xf326('0x65'),'uri':util['format']('%s/%s',_0x5b1494,_0xf326('0x66')),'headers':{'Authorization':util[_0xf326('0x67')]('Basic\x20%s',new Buffer(util['format']('%s:X',_0x4dc8d7[_0xf326('0x61')]))['toString'](_0xf326('0x68')))},'json':!![]});}})[_0xf326('0x30')](function(_0x3434b2){if(_0x3434b2){var _0x2ec314=[_0xf326('0x69'),_0xf326('0x6a'),'agent',_0xf326('0x6b'),_0xf326('0x26'),'priority','group',_0xf326('0x6c'),'ticket_type',_0xf326('0x6d'),_0xf326('0x6e')];_[_0xf326('0x6f')](_0x3434b2,function(_0x363e64){return _0x2ec314[_0xf326('0x70')](_0x363e64[_0xf326('0x33')])||!_0x363e64[_0xf326('0x71')]&&_0x363e64[_0xf326('0x38')]!==_0xf326('0x72')&&_0x363e64['type']!==_0xf326('0x73');});return{'count':_0x3434b2[_0xf326('0x40')],'rows':_['map'](_0x3434b2,function(_0x3c82cf){return{'id':_0x3c82cf['name'],'name':_0x3c82cf[_0xf326('0x74')],'custom':!_0x3c82cf[_0xf326('0x71')],'options':_0x3c82cf[_0xf326('0x75')]?_['map'](_0x3c82cf[_0xf326('0x75')],function(_0x1c86c8){return{'name':_[_0xf326('0x76')](_0x1c86c8),'value':_0x1c86c8};}):[]};})};}})[_0xf326('0x30')](respondWithResult(_0x5290da,null))[_0xf326('0x24')](function(_0x1e50aa){var _0x148779=_0x3855a4[_0xf326('0x3b')][_0xf326('0x77')]?0x1f4:_0x1e50aa[_0xf326('0x78')]||0x1f4;logger[_0xf326('0x20')](_0xf326('0x79'),_0xf326('0x60'),_0x148779,JSON[_0xf326('0x7a')](_0x1e50aa));delete _0x1e50aa[_0xf326('0x33')];if(_0x148779===0x191){_0x148779=0x190;}_0x5290da['status'](_0x148779)[_0xf326('0x7b')](_0x3855a4[_0xf326('0x3b')]['test']?{'message':_0xf326('0x7c'),'statusCode':_0x1e50aa[_0xf326('0x78')]}:_0x1e50aa);});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
index fbed279..7a419fb 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x59b1=['../../config/environment','../../components/integrations/configuration','FreshdeskAccount','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x16418d,_0x20e494){var _0x5f41f1=function(_0x43e9f6){while(--_0x43e9f6){_0x16418d['push'](_0x16418d['shift']());}};_0x5f41f1(++_0x20e494);}(_0x59b1,0x9c));var _0x159b=function(_0x8b3954,_0x5d2bdf){_0x8b3954=_0x8b3954-0x0;var _0x4dac97=_0x59b1[_0x8b3954];return _0x4dac97;};'use strict';var _=require(_0x159b('0x0'));var util=require(_0x159b('0x1'));var logger=require(_0x159b('0x2'))('api');var moment=require(_0x159b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x159b('0x4'));var rimraf=require(_0x159b('0x5'));var config=require(_0x159b('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x159b('0x7'));module['exports']=function(_0x63a42c,_0x4305f9){return _0x63a42c['define'](_0x159b('0x8'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x186f=['rimraf','./intFreshdeskAccount.attributes','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x50c0c8,_0x29f7d3){var _0x17e76f=function(_0x45d991){while(--_0x45d991){_0x50c0c8['push'](_0x50c0c8['shift']());}};_0x17e76f(++_0x29f7d3);}(_0x186f,0x170));var _0xf186=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x186f[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xf186('0x0'));var util=require(_0xf186('0x1'));var logger=require(_0xf186('0x2'))(_0xf186('0x3'));var moment=require('moment');var BPromise=require(_0xf186('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf186('0x5'));var rimraf=require(_0xf186('0x6'));var config=require('../../config/environment');var attributes=require(_0xf186('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xde0bdb,_0x407b32){return _0xde0bdb[_0xf186('0x8')](_0xf186('0x9'),attributes,{'tableName':_0xf186('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
index a1c1429..311a55e 100644
--- a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
+++ b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf8d0=['moment','bluebird','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','options','where','attributes','limit','map','include','model','catch','find','raw','then','ShowFreshdeskAccount','lodash'];(function(_0x14c260,_0x1849ae){var _0x20901d=function(_0x1e2a1f){while(--_0x1e2a1f){_0x14c260['push'](_0x14c260['shift']());}};_0x20901d(++_0x1849ae);}(_0xf8d0,0x1ee));var _0x0f8d=function(_0xffc356,_0x113150){_0xffc356=_0xffc356-0x0;var _0x5e7f25=_0xf8d0[_0xffc356];return _0x5e7f25;};'use strict';var _=require(_0x0f8d('0x0'));var util=require('util');var moment=require(_0x0f8d('0x1'));var BPromise=require(_0x0f8d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0f8d('0x3'))('rpc');var config=require(_0x0f8d('0x4'));var jayson=require(_0x0f8d('0x5'));var client=jayson[_0x0f8d('0x6')][_0x0f8d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e6cd0,_0x49d37f,_0x443432){return new BPromise(function(_0x36c3a7,_0x37be01){return client[_0x0f8d('0x8')](_0x2e6cd0,_0x443432)['then'](function(_0x16ffa2){logger[_0x0f8d('0x9')](_0x0f8d('0xa'),_0x49d37f,_0x0f8d('0xb'));logger[_0x0f8d('0xc')](_0x0f8d('0xd'),_0x49d37f,_0x0f8d('0xb'),JSON[_0x0f8d('0xe')](_0x16ffa2));if(_0x16ffa2[_0x0f8d('0xf')]){if(_0x16ffa2[_0x0f8d('0xf')][_0x0f8d('0x10')]===0x1f4){logger['error'](_0x0f8d('0xa'),_0x49d37f,_0x16ffa2[_0x0f8d('0xf')][_0x0f8d('0x11')]);return _0x37be01(_0x16ffa2[_0x0f8d('0xf')][_0x0f8d('0x11')]);}logger['error'](_0x0f8d('0xa'),_0x49d37f,_0x16ffa2[_0x0f8d('0xf')][_0x0f8d('0x11')]);return _0x36c3a7(_0x16ffa2[_0x0f8d('0xf')][_0x0f8d('0x11')]);}else{logger[_0x0f8d('0x9')]('FreshdeskAccount,\x20%s,\x20%s',_0x49d37f,'request\x20sent');_0x36c3a7(_0x16ffa2[_0x0f8d('0x12')][_0x0f8d('0x11')]);}})['catch'](function(_0x49315c){logger[_0x0f8d('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x49d37f,_0x49315c);_0x37be01(_0x49315c);});});}exports[_0x0f8d('0x13')]=function(_0x979df0){var _0x29b419=this;return new Promise(function(_0x179c9a,_0x444318){return db[_0x0f8d('0x14')]['findAll']({'raw':_0x979df0[_0x0f8d('0x15')]?_0x979df0[_0x0f8d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x979df0[_0x0f8d('0x15')]?_0x979df0['options'][_0x0f8d('0x16')]||null:null,'attributes':_0x979df0[_0x0f8d('0x15')]?_0x979df0['options'][_0x0f8d('0x17')]||null:null,'limit':_0x979df0[_0x0f8d('0x15')]?_0x979df0['options'][_0x0f8d('0x18')]||null:null,'include':_0x979df0['options']?_0x979df0[_0x0f8d('0x15')]['include']?_[_0x0f8d('0x19')](_0x979df0['options'][_0x0f8d('0x1a')],function(_0x5f146e){return{'model':db[_0x5f146e[_0x0f8d('0x1b')]],'as':_0x5f146e['as'],'attributes':_0x5f146e[_0x0f8d('0x17')],'include':_0x5f146e[_0x0f8d('0x1a')]?_[_0x0f8d('0x19')](_0x5f146e[_0x0f8d('0x1a')],function(_0x354573){return{'model':db[_0x354573[_0x0f8d('0x1b')]],'as':_0x354573['as'],'attributes':_0x354573['attributes'],'include':_0x354573[_0x0f8d('0x1a')]?_[_0x0f8d('0x19')](_0x354573['include'],function(_0x331a7a){return{'model':db[_0x331a7a[_0x0f8d('0x1b')]],'as':_0x331a7a['as'],'attributes':_0x331a7a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd7fd4f){logger[_0x0f8d('0x9')](_0x0f8d('0x13'),_0x979df0);logger[_0x0f8d('0xc')]('GetFreshdeskAccount',_0x979df0,JSON['stringify'](_0xd7fd4f));_0x179c9a(_0xd7fd4f);})[_0x0f8d('0x1c')](function(_0x4bc6a4){logger['error'](_0x0f8d('0x13'),_0x4bc6a4[_0x0f8d('0x11')],_0x979df0);_0x444318(_0x29b419[_0x0f8d('0xf')](0x1f4,_0x4bc6a4['message']));});});};exports['ShowFreshdeskAccount']=function(_0x34341c){var _0x21cb08=this;return new Promise(function(_0x5b53eb,_0x14233b){return db[_0x0f8d('0x14')][_0x0f8d('0x1d')]({'raw':_0x34341c['options']?_0x34341c[_0x0f8d('0x15')][_0x0f8d('0x1e')]===undefined?!![]:![]:!![],'where':_0x34341c[_0x0f8d('0x15')]?_0x34341c[_0x0f8d('0x15')][_0x0f8d('0x16')]||null:null,'attributes':_0x34341c[_0x0f8d('0x15')]?_0x34341c[_0x0f8d('0x15')][_0x0f8d('0x17')]||null:null,'include':_0x34341c[_0x0f8d('0x15')]?_0x34341c[_0x0f8d('0x15')][_0x0f8d('0x1a')]?_[_0x0f8d('0x19')](_0x34341c[_0x0f8d('0x15')][_0x0f8d('0x1a')],function(_0x1d4901){return{'model':db[_0x1d4901[_0x0f8d('0x1b')]],'as':_0x1d4901['as'],'attributes':_0x1d4901[_0x0f8d('0x17')],'include':_0x1d4901[_0x0f8d('0x1a')]?_[_0x0f8d('0x19')](_0x1d4901['include'],function(_0x4858e7){return{'model':db[_0x4858e7[_0x0f8d('0x1b')]],'as':_0x4858e7['as'],'attributes':_0x4858e7[_0x0f8d('0x17')],'include':_0x4858e7['include']?_[_0x0f8d('0x19')](_0x4858e7[_0x0f8d('0x1a')],function(_0x118157){return{'model':db[_0x118157['model']],'as':_0x118157['as'],'attributes':_0x118157['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f8d('0x1f')](function(_0x4eca37){logger[_0x0f8d('0x9')]('ShowFreshdeskAccount',_0x34341c);logger['debug'](_0x0f8d('0x20'),_0x34341c,JSON[_0x0f8d('0xe')](_0x4eca37));_0x5b53eb(_0x4eca37);})['catch'](function(_0xb6da89){logger['error']('ShowFreshdeskAccount',_0xb6da89[_0x0f8d('0x11')],_0x34341c);_0x14233b(_0x21cb08[_0x0f8d('0xf')](0x1f4,_0xb6da89[_0x0f8d('0x11')]));});});};
\ No newline at end of file
+var _0x2639=['code','message','result','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetFreshdeskAccount','catch','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1c6d9b,_0xdbeb62){var _0x2c6f92=function(_0x3584a5){while(--_0x3584a5){_0x1c6d9b['push'](_0x1c6d9b['shift']());}};_0x2c6f92(++_0xdbeb62);}(_0x2639,0xe4));var _0x9263=function(_0x493f24,_0x28c482){_0x493f24=_0x493f24-0x0;var _0x3bd8b4=_0x2639[_0x493f24];return _0x3bd8b4;};'use strict';var _=require(_0x9263('0x0'));var util=require(_0x9263('0x1'));var moment=require(_0x9263('0x2'));var BPromise=require(_0x9263('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9263('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9263('0x5'))('rpc');var config=require(_0x9263('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9263('0x7')][_0x9263('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3cced8,_0x222875,_0x1008a5){return new BPromise(function(_0x57955e,_0x31cedf){return client[_0x9263('0x9')](_0x3cced8,_0x1008a5)['then'](function(_0x52cf3b){logger[_0x9263('0xa')](_0x9263('0xb'),_0x222875,'request\x20sent');logger[_0x9263('0xc')](_0x9263('0xd'),_0x222875,_0x9263('0xe'),JSON[_0x9263('0xf')](_0x52cf3b));if(_0x52cf3b['error']){if(_0x52cf3b[_0x9263('0x10')][_0x9263('0x11')]===0x1f4){logger[_0x9263('0x10')](_0x9263('0xb'),_0x222875,_0x52cf3b[_0x9263('0x10')]['message']);return _0x31cedf(_0x52cf3b[_0x9263('0x10')]['message']);}logger['error'](_0x9263('0xb'),_0x222875,_0x52cf3b['error']['message']);return _0x57955e(_0x52cf3b['error'][_0x9263('0x12')]);}else{logger['info'](_0x9263('0xb'),_0x222875,_0x9263('0xe'));_0x57955e(_0x52cf3b[_0x9263('0x13')][_0x9263('0x12')]);}})['catch'](function(_0x5a7817){logger[_0x9263('0x10')](_0x9263('0xb'),_0x222875,_0x5a7817);_0x31cedf(_0x5a7817);});});}exports['GetFreshdeskAccount']=function(_0x367cb8){var _0x11eafe=this;return new Promise(function(_0x1ca078,_0x5ee63c){return db[_0x9263('0x14')][_0x9263('0x15')]({'raw':_0x367cb8[_0x9263('0x16')]?_0x367cb8[_0x9263('0x16')][_0x9263('0x17')]===undefined?!![]:![]:!![],'where':_0x367cb8[_0x9263('0x16')]?_0x367cb8['options'][_0x9263('0x18')]||null:null,'attributes':_0x367cb8[_0x9263('0x16')]?_0x367cb8[_0x9263('0x16')][_0x9263('0x19')]||null:null,'limit':_0x367cb8['options']?_0x367cb8['options'][_0x9263('0x1a')]||null:null,'include':_0x367cb8[_0x9263('0x16')]?_0x367cb8[_0x9263('0x16')][_0x9263('0x1b')]?_[_0x9263('0x1c')](_0x367cb8[_0x9263('0x16')]['include'],function(_0x230bfe){return{'model':db[_0x230bfe[_0x9263('0x1d')]],'as':_0x230bfe['as'],'attributes':_0x230bfe[_0x9263('0x19')],'include':_0x230bfe[_0x9263('0x1b')]?_[_0x9263('0x1c')](_0x230bfe[_0x9263('0x1b')],function(_0x3b7030){return{'model':db[_0x3b7030['model']],'as':_0x3b7030['as'],'attributes':_0x3b7030[_0x9263('0x19')],'include':_0x3b7030[_0x9263('0x1b')]?_['map'](_0x3b7030[_0x9263('0x1b')],function(_0x34f66f){return{'model':db[_0x34f66f[_0x9263('0x1d')]],'as':_0x34f66f['as'],'attributes':_0x34f66f[_0x9263('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9263('0x1e')](function(_0x4c7e0d){logger[_0x9263('0xa')](_0x9263('0x1f'),_0x367cb8);logger[_0x9263('0xc')](_0x9263('0x1f'),_0x367cb8,JSON['stringify'](_0x4c7e0d));_0x1ca078(_0x4c7e0d);})[_0x9263('0x20')](function(_0x324363){logger['error'](_0x9263('0x1f'),_0x324363[_0x9263('0x12')],_0x367cb8);_0x5ee63c(_0x11eafe['error'](0x1f4,_0x324363[_0x9263('0x12')]));});});};exports[_0x9263('0x21')]=function(_0x396efa){var _0x4d3431=this;return new Promise(function(_0x3d6108,_0x5d213c){return db['FreshdeskAccount'][_0x9263('0x22')]({'raw':_0x396efa['options']?_0x396efa[_0x9263('0x16')][_0x9263('0x17')]===undefined?!![]:![]:!![],'where':_0x396efa[_0x9263('0x16')]?_0x396efa[_0x9263('0x16')][_0x9263('0x18')]||null:null,'attributes':_0x396efa[_0x9263('0x16')]?_0x396efa[_0x9263('0x16')][_0x9263('0x19')]||null:null,'include':_0x396efa['options']?_0x396efa[_0x9263('0x16')]['include']?_[_0x9263('0x1c')](_0x396efa[_0x9263('0x16')][_0x9263('0x1b')],function(_0x514ca2){return{'model':db[_0x514ca2['model']],'as':_0x514ca2['as'],'attributes':_0x514ca2[_0x9263('0x19')],'include':_0x514ca2['include']?_[_0x9263('0x1c')](_0x514ca2[_0x9263('0x1b')],function(_0x144e48){return{'model':db[_0x144e48[_0x9263('0x1d')]],'as':_0x144e48['as'],'attributes':_0x144e48[_0x9263('0x19')],'include':_0x144e48[_0x9263('0x1b')]?_[_0x9263('0x1c')](_0x144e48['include'],function(_0x5daa0d){return{'model':db[_0x5daa0d[_0x9263('0x1d')]],'as':_0x5daa0d['as'],'attributes':_0x5daa0d[_0x9263('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9263('0x1e')](function(_0x23b9c1){logger['info'](_0x9263('0x21'),_0x396efa);logger[_0x9263('0xc')](_0x9263('0x21'),_0x396efa,JSON[_0x9263('0xf')](_0x23b9c1));_0x3d6108(_0x23b9c1);})[_0x9263('0x20')](function(_0x3334ce){logger[_0x9263('0x10')]('ShowFreshdeskAccount',_0x3334ce[_0x9263('0x12')],_0x396efa);_0x5d213c(_0x4d3431[_0x9263('0x10')](0x1f4,_0x3334ce[_0x9263('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js
index bb36d04..c62d50f 100644
--- a/server/api/intFreshdeskConfiguration/index.js
+++ b/server/api/intFreshdeskConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3b16=['get','isAuthenticated','index','/:id','show','getSubjects','getDescriptions','/:id/tags','post','create','setTags','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x3b16,0x1ac));var _0x63b1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3b16[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x63b1('0x0'));var util=require(_0x63b1('0x1'));var path=require(_0x63b1('0x2'));var timeout=require(_0x63b1('0x3'));var express=require(_0x63b1('0x4'));var router=express[_0x63b1('0x5')]();var auth=require(_0x63b1('0x6'));var interaction=require(_0x63b1('0x7'));var config=require('../../config/environment');var controller=require(_0x63b1('0x8'));router[_0x63b1('0x9')]('/',auth[_0x63b1('0xa')](),controller[_0x63b1('0xb')]);router['get'](_0x63b1('0xc'),auth['isAuthenticated'](),controller[_0x63b1('0xd')]);router[_0x63b1('0x9')]('/:id/fields',auth[_0x63b1('0xa')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x63b1('0xa')](),controller[_0x63b1('0xe')]);router[_0x63b1('0x9')]('/:id/descriptions',auth[_0x63b1('0xa')](),controller[_0x63b1('0xf')]);router[_0x63b1('0x9')](_0x63b1('0x10'),auth[_0x63b1('0xa')](),controller['getTags']);router[_0x63b1('0x11')]('/',auth['isAuthenticated'](),controller[_0x63b1('0x12')]);router[_0x63b1('0x11')]('/:id/tags',auth[_0x63b1('0xa')](),controller[_0x63b1('0x13')]);router['put']('/:id',auth[_0x63b1('0xa')](),controller[_0x63b1('0x14')]);router[_0x63b1('0x15')](_0x63b1('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x63b1('0x16')]=router;
\ No newline at end of file
+var _0x0449=['get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x4f9614,_0x3071e0){var _0xa037a5=function(_0x33b1ce){while(--_0x33b1ce){_0x4f9614['push'](_0x4f9614['shift']());}};_0xa037a5(++_0x3071e0);}(_0x0449,0xff));var _0x9044=function(_0x21a930,_0x4b0213){_0x21a930=_0x21a930-0x0;var _0x2ac7b1=_0x0449[_0x21a930];return _0x2ac7b1;};'use strict';var multer=require(_0x9044('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9044('0x1'));var express=require(_0x9044('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9044('0x3'));var config=require(_0x9044('0x4'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x9044('0x5')]('/',auth[_0x9044('0x6')](),controller['index']);router[_0x9044('0x5')](_0x9044('0x7'),auth[_0x9044('0x6')](),controller['show']);router['get'](_0x9044('0x8'),auth[_0x9044('0x6')](),controller[_0x9044('0x9')]);router[_0x9044('0x5')]('/:id/subjects',auth[_0x9044('0x6')](),controller[_0x9044('0xa')]);router[_0x9044('0x5')]('/:id/descriptions',auth[_0x9044('0x6')](),controller['getDescriptions']);router[_0x9044('0x5')](_0x9044('0xb'),auth['isAuthenticated'](),controller['getTags']);router[_0x9044('0xc')]('/',auth['isAuthenticated'](),controller[_0x9044('0xd')]);router[_0x9044('0xc')](_0x9044('0xb'),auth[_0x9044('0x6')](),controller[_0x9044('0xe')]);router[_0x9044('0xf')](_0x9044('0x7'),auth[_0x9044('0x6')](),controller[_0x9044('0x10')]);router[_0x9044('0x11')](_0x9044('0x7'),auth[_0x9044('0x6')](),controller[_0x9044('0x12')]);module[_0x9044('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
index 200a242..c318d19 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec24=['sequelize','STRING'];(function(_0x176317,_0x4897b3){var _0xef2759=function(_0x581e2b){while(--_0x581e2b){_0x176317['push'](_0x176317['shift']());}};_0xef2759(++_0x4897b3);}(_0xec24,0x8e));var _0x4ec2=function(_0x3650e0,_0xda0f52){_0x3650e0=_0x3650e0-0x0;var _0x6841fb=_0xec24[_0x3650e0];return _0x6841fb;};'use strict';var Sequelize=require(_0x4ec2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4ec2('0x1')]}};
\ No newline at end of file
+var _0x5072=['STRING','exports'];(function(_0x455dfe,_0x2ed986){var _0x5f22eb=function(_0x352b4e){while(--_0x352b4e){_0x455dfe['push'](_0x455dfe['shift']());}};_0x5f22eb(++_0x2ed986);}(_0x5072,0x1c3));var _0x2507=function(_0x2b6448,_0x4fa425){_0x2b6448=_0x2b6448-0x0;var _0x5cc0f1=_0x5072[_0x2b6448];return _0x5cc0f1;};'use strict';var Sequelize=require('sequelize');module[_0x2507('0x0')]={'name':{'type':Sequelize[_0x2507('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
index 58ae647..ecbf114 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcba7=['rows','show','fields','include','body','find','params','destroy','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','request','then','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll'];(function(_0x21aafd,_0x1f0fa6){var _0x9f2800=function(_0xf23734){while(--_0xf23734){_0x21aafd['push'](_0x21aafd['shift']());}};_0x9f2800(++_0x1f0fa6);}(_0xcba7,0x199));var _0x7cba=function(_0x15e749,_0x3f70d0){_0x15e749=_0x15e749-0x0;var _0xf62575=_0xcba7[_0x15e749];return _0xf62575;};'use strict';var pdf=require(_0x7cba('0x0'));var emlformat=require(_0x7cba('0x1'));var rimraf=require(_0x7cba('0x2'));var zipdir=require(_0x7cba('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7cba('0x4'));var moment=require(_0x7cba('0x5'));var BPromise=require(_0x7cba('0x6'));var Mustache=require('mustache');var util=require(_0x7cba('0x7'));var path=require(_0x7cba('0x8'));var sox=require(_0x7cba('0x9'));var csv=require(_0x7cba('0xa'));var ejs=require(_0x7cba('0xb'));var fs=require('fs');var _=require(_0x7cba('0xc'));var squel=require(_0x7cba('0xd'));var crypto=require(_0x7cba('0xe'));var jsforce=require(_0x7cba('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7cba('0xa'));var querystring=require(_0x7cba('0x10'));var Papa=require(_0x7cba('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7cba('0x12'));var as=require(_0x7cba('0x13'));var hardwareService=require(_0x7cba('0x14'));var logger=require(_0x7cba('0x15'))('api');var utils=require(_0x7cba('0x16'));var config=require(_0x7cba('0x17'));var db=require(_0x7cba('0x18'))['db'];var jayson=require(_0x7cba('0x19'));var client=jayson[_0x7cba('0x1a')][_0x7cba('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x522529,_0x3ed673,_0x2647b9){if(_0x2647b9){var _0x406553=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x406553[_0x7cba('0x1c')](_0x3ed673)){return _0x522529;}else{throw new db[(_0x7cba('0x1d'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x522529;}}function respondWithRpcPromise(_0x252005,_0xbf5ce8,_0x39585b,_0x2b52a4){return new BPromise(function(_0x38b935,_0x28dfd1){var _0x384768=_0x2b52a4||client;return _0x384768[_0x7cba('0x1e')](_0x252005,_0x39585b)[_0x7cba('0x1f')](function(_0x39761b){logger['info'](_0x7cba('0x20'),_0xbf5ce8,'request\x20sent');logger['debug'](_0x7cba('0x21'),_0xbf5ce8,_0x7cba('0x22'),JSON[_0x7cba('0x23')](_0x39761b));if(_0x39761b['error']){if(_0x39761b[_0x7cba('0x24')]['code']===0x1f4){logger[_0x7cba('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xbf5ce8,_0x39761b['error'][_0x7cba('0x25')]);return _0x28dfd1(_0x39761b[_0x7cba('0x24')][_0x7cba('0x25')]);}logger[_0x7cba('0x24')](_0x7cba('0x20'),_0xbf5ce8,_0x39761b['error'][_0x7cba('0x25')]);return _0x38b935(_0x39761b['error'][_0x7cba('0x25')]);}else{logger[_0x7cba('0x26')](_0x7cba('0x20'),_0xbf5ce8,_0x7cba('0x22'));_0x38b935(_0x39761b[_0x7cba('0x27')][_0x7cba('0x25')]);}})[_0x7cba('0x28')](function(_0x4a6883){logger[_0x7cba('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xbf5ce8,_0x4a6883);_0x28dfd1(_0x4a6883);});});}function respondWithStatusCode(_0x4e5974,_0x1c9535){_0x1c9535=_0x1c9535||0xcc;return function(_0x5391e6){if(_0x5391e6){return _0x4e5974[_0x7cba('0x29')](_0x1c9535);}return _0x4e5974[_0x7cba('0x2a')](_0x1c9535)[_0x7cba('0x2b')]();};}function respondWithResult(_0x109dfa,_0x1cb91a){_0x1cb91a=_0x1cb91a||0xc8;return function(_0x539bb1){if(_0x539bb1){return _0x109dfa[_0x7cba('0x2a')](_0x1cb91a)['json'](_0x539bb1);}};}function respondWithFilteredResult(_0x5d9ce3,_0xd9b2af){return function(_0x1f8065){if(_0x1f8065){var _0x34a121=_0x1f8065[_0x7cba('0x2c')],_0x336dcb=_0xd9b2af[_0x7cba('0x2d')],_0x2f4f15=_0xd9b2af[_0x7cba('0x2d')]+_0xd9b2af['limit'],_0x213f3a;if(_0x2f4f15>=_0x34a121){_0x2f4f15=_0x34a121;_0x213f3a=0xc8;}else{_0x213f3a=0xce;}_0x5d9ce3[_0x7cba('0x2a')](_0x213f3a);return _0x5d9ce3['set'](_0x7cba('0x2e'),_0x336dcb+'-'+_0x2f4f15+'/'+_0x34a121)[_0x7cba('0x2f')](_0x1f8065);}return null;};}function patchUpdates(_0x34b9e6){return function(_0x16bab3){try{jsonpatch[_0x7cba('0x30')](_0x16bab3,_0x34b9e6,!![]);}catch(_0xdcfb3f){return BPromise[_0x7cba('0x31')](_0xdcfb3f);}return _0x16bab3[_0x7cba('0x32')]();};}function saveUpdates(_0x4e9e93,_0x27837b){return function(_0x5da550){if(_0x5da550){return _0x5da550[_0x7cba('0x33')](_0x4e9e93)[_0x7cba('0x1f')](function(_0x3d29d1){return _0x3d29d1;});}return null;};}function removeEntity(_0x1863d0,_0x11d6a0){return function(_0x41661f){if(_0x41661f){return _0x41661f['destroy']()['then'](function(){_0x1863d0[_0x7cba('0x2a')](0xcc)[_0x7cba('0x2b')]();});}};}function handleEntityNotFound(_0x73614f,_0x51061b){return function(_0x58b1ba){if(!_0x58b1ba){_0x73614f[_0x7cba('0x29')](0x194);}return _0x58b1ba;};}function handleError(_0x49651b,_0x3a2844){_0x3a2844=_0x3a2844||0x1f4;return function(_0x179331){logger[_0x7cba('0x24')](_0x179331[_0x7cba('0x34')]);if(_0x179331[_0x7cba('0x35')]){delete _0x179331['name'];}_0x49651b[_0x7cba('0x2a')](_0x3a2844)[_0x7cba('0x36')](_0x179331);};}exports[_0x7cba('0x37')]=function(_0x540b9a,_0x4c91af){var _0x1dc306={},_0x5c4558={},_0x202c55={'count':0x0,'rows':[]};var _0x2861c6=_['map'](db[_0x7cba('0x38')][_0x7cba('0x39')],function(_0x3e6f99){return{'name':_0x3e6f99[_0x7cba('0x3a')],'type':_0x3e6f99[_0x7cba('0x3b')][_0x7cba('0x3c')]};});_0x5c4558[_0x7cba('0x3d')]=_[_0x7cba('0x3e')](_0x2861c6,'name');_0x5c4558[_0x7cba('0x3f')]=_[_0x7cba('0x40')](_0x540b9a[_0x7cba('0x3f')]);_0x5c4558[_0x7cba('0x41')]=_[_0x7cba('0x42')](_0x5c4558[_0x7cba('0x3d')],_0x5c4558[_0x7cba('0x3f')]);_0x1dc306[_0x7cba('0x43')]=_[_0x7cba('0x42')](_0x5c4558['model'],qs['fields'](_0x540b9a['query']['fields']));_0x1dc306['attributes']=_0x1dc306[_0x7cba('0x43')][_0x7cba('0x44')]?_0x1dc306[_0x7cba('0x43')]:_0x5c4558['model'];if(!_0x540b9a['query'][_0x7cba('0x45')](_0x7cba('0x46'))){_0x1dc306['limit']=qs[_0x7cba('0x47')](_0x540b9a[_0x7cba('0x3f')][_0x7cba('0x47')]);_0x1dc306[_0x7cba('0x2d')]=qs[_0x7cba('0x2d')](_0x540b9a['query'][_0x7cba('0x2d')]);}_0x1dc306[_0x7cba('0x48')]=qs[_0x7cba('0x49')](_0x540b9a[_0x7cba('0x3f')]['sort']);_0x1dc306[_0x7cba('0x4a')]=qs['filters'](_[_0x7cba('0x4b')](_0x540b9a[_0x7cba('0x3f')],_0x5c4558[_0x7cba('0x41')]),_0x2861c6);if(_0x540b9a[_0x7cba('0x3f')][_0x7cba('0x4c')]){_0x1dc306[_0x7cba('0x4a')]=_[_0x7cba('0x4d')](_0x1dc306['where'],{'$or':_['map'](_0x2861c6,function(_0x1d81a1){if(_0x1d81a1['type']!=='VIRTUAL'){var _0x35f5e6={};_0x35f5e6[_0x1d81a1[_0x7cba('0x35')]]={'$like':'%'+_0x540b9a[_0x7cba('0x3f')][_0x7cba('0x4c')]+'%'};return _0x35f5e6;}})});}_0x1dc306=_[_0x7cba('0x4d')]({},_0x1dc306,_0x540b9a[_0x7cba('0x4e')]);var _0x2c4f72={'where':_0x1dc306[_0x7cba('0x4a')]};return db[_0x7cba('0x38')][_0x7cba('0x2c')](_0x2c4f72)[_0x7cba('0x1f')](function(_0x4c3f7c){_0x202c55['count']=_0x4c3f7c;if(_0x540b9a['query'][_0x7cba('0x4f')]){_0x1dc306['include']=[{'all':!![]}];}return db[_0x7cba('0x38')][_0x7cba('0x50')](_0x1dc306);})[_0x7cba('0x1f')](function(_0x2545dd){_0x202c55[_0x7cba('0x51')]=_0x2545dd;return _0x202c55;})['then'](respondWithFilteredResult(_0x4c91af,_0x1dc306))[_0x7cba('0x28')](handleError(_0x4c91af,null));};exports[_0x7cba('0x52')]=function(_0x5b077f,_0x6e8ab7){var _0x42d1b0={'raw':![],'where':{'id':_0x5b077f['params']['id']}},_0x5fc3d8={};_0x5fc3d8['model']=_[_0x7cba('0x40')](db[_0x7cba('0x38')][_0x7cba('0x39')]);_0x5fc3d8[_0x7cba('0x3f')]=_['keys'](_0x5b077f[_0x7cba('0x3f')]);_0x5fc3d8[_0x7cba('0x41')]=_[_0x7cba('0x42')](_0x5fc3d8[_0x7cba('0x3d')],_0x5fc3d8[_0x7cba('0x3f')]);_0x42d1b0['attributes']=_[_0x7cba('0x42')](_0x5fc3d8['model'],qs[_0x7cba('0x53')](_0x5b077f[_0x7cba('0x3f')][_0x7cba('0x53')]));_0x42d1b0['attributes']=_0x42d1b0[_0x7cba('0x43')][_0x7cba('0x44')]?_0x42d1b0[_0x7cba('0x43')]:_0x5fc3d8['model'];if(_0x5b077f[_0x7cba('0x3f')][_0x7cba('0x4f')]){_0x42d1b0[_0x7cba('0x54')]=[{'all':!![]}];}_0x42d1b0=_['merge']({},_0x42d1b0,_0x5b077f[_0x7cba('0x4e')]);return db['FreshdeskConfiguration']['find'](_0x42d1b0)[_0x7cba('0x1f')](handleEntityNotFound(_0x6e8ab7,null))[_0x7cba('0x1f')](respondWithResult(_0x6e8ab7,null))[_0x7cba('0x28')](handleError(_0x6e8ab7,null));};exports['create']=function(_0x23f2a0,_0x1d84f3){return db[_0x7cba('0x38')]['create'](_0x23f2a0['body'],{})['then'](respondWithResult(_0x1d84f3,0xc9))[_0x7cba('0x28')](handleError(_0x1d84f3,null));};exports[_0x7cba('0x33')]=function(_0x4c3045,_0x5a7099){if(_0x4c3045[_0x7cba('0x55')]['id']){delete _0x4c3045[_0x7cba('0x55')]['id'];}return db['FreshdeskConfiguration'][_0x7cba('0x56')]({'where':{'id':_0x4c3045[_0x7cba('0x57')]['id']}})[_0x7cba('0x1f')](handleEntityNotFound(_0x5a7099,null))[_0x7cba('0x1f')](saveUpdates(_0x4c3045[_0x7cba('0x55')],null))[_0x7cba('0x1f')](respondWithResult(_0x5a7099,null))[_0x7cba('0x28')](handleError(_0x5a7099,null));};exports[_0x7cba('0x58')]=function(_0x274982,_0x2c1e2f){return db[_0x7cba('0x38')]['find']({'where':{'id':_0x274982[_0x7cba('0x57')]['id']}})[_0x7cba('0x1f')](handleEntityNotFound(_0x2c1e2f,null))['then'](removeEntity(_0x2c1e2f,null))[_0x7cba('0x28')](handleError(_0x2c1e2f,null));};exports[_0x7cba('0x59')]=function(_0x2b7704,_0x5ce153,_0x1b13a9){var _0x5b1af3={};var _0x323a3d={};var _0x4c7726;var _0x3d21a2;return db[_0x7cba('0x38')][_0x7cba('0x5a')]({'where':{'id':_0x2b7704[_0x7cba('0x57')]['id']}})[_0x7cba('0x1f')](handleEntityNotFound(_0x5ce153,null))[_0x7cba('0x1f')](function(_0x15ffaf){if(_0x15ffaf){_0x4c7726=_0x15ffaf;_0x323a3d['model']=_[_0x7cba('0x40')](db[_0x7cba('0x5b')][_0x7cba('0x39')]);_0x323a3d[_0x7cba('0x3f')]=_[_0x7cba('0x40')](_0x2b7704['query']);_0x323a3d['filters']=_[_0x7cba('0x42')](_0x323a3d[_0x7cba('0x3d')],_0x323a3d[_0x7cba('0x3f')]);_0x5b1af3[_0x7cba('0x43')]=_[_0x7cba('0x42')](_0x323a3d[_0x7cba('0x3d')],qs[_0x7cba('0x53')](_0x2b7704[_0x7cba('0x3f')][_0x7cba('0x53')]));_0x5b1af3[_0x7cba('0x43')]=_0x5b1af3[_0x7cba('0x43')][_0x7cba('0x44')]?_0x5b1af3[_0x7cba('0x43')]:_0x323a3d[_0x7cba('0x3d')];_0x5b1af3[_0x7cba('0x48')]=qs[_0x7cba('0x49')](_0x2b7704[_0x7cba('0x3f')][_0x7cba('0x49')]);_0x5b1af3['where']=qs[_0x7cba('0x41')](_[_0x7cba('0x4b')](_0x2b7704['query'],_0x323a3d[_0x7cba('0x41')]));if(_0x2b7704[_0x7cba('0x3f')][_0x7cba('0x4c')]){_0x5b1af3[_0x7cba('0x4a')]=_['merge'](_0x5b1af3[_0x7cba('0x4a')],{'$or':_[_0x7cba('0x3e')](_0x5b1af3[_0x7cba('0x43')],function(_0x2649f6){var _0x30fac5={};_0x30fac5[_0x2649f6]={'$like':'%'+_0x2b7704[_0x7cba('0x3f')]['filter']+'%'};return _0x30fac5;})});}_0x5b1af3=_[_0x7cba('0x4d')]({},_0x5b1af3,_0x2b7704[_0x7cba('0x4e')]);return _0x4c7726[_0x7cba('0x59')](_0x5b1af3);}})[_0x7cba('0x1f')](function(_0x339146){if(_0x339146){_0x3d21a2=_0x339146[_0x7cba('0x44')];if(!_0x2b7704[_0x7cba('0x3f')][_0x7cba('0x45')](_0x7cba('0x46'))){_0x5b1af3[_0x7cba('0x47')]=qs[_0x7cba('0x47')](_0x2b7704[_0x7cba('0x3f')][_0x7cba('0x47')]);_0x5b1af3[_0x7cba('0x2d')]=qs[_0x7cba('0x2d')](_0x2b7704[_0x7cba('0x3f')][_0x7cba('0x2d')]);}return _0x4c7726[_0x7cba('0x59')](_0x5b1af3);}})['then'](function(_0x24cac9){if(_0x24cac9){return _0x24cac9?{'count':_0x3d21a2,'rows':_0x24cac9}:null;}})[_0x7cba('0x1f')](respondWithResult(_0x5ce153,null))[_0x7cba('0x28')](handleError(_0x5ce153,null));};exports[_0x7cba('0x5c')]=function(_0x1364d8,_0x10ebab,_0x5201b1){var _0x280cf2={};var _0x2083dd={};var _0x1fa89b;var _0x12b3f7;return db[_0x7cba('0x38')][_0x7cba('0x5a')]({'where':{'id':_0x1364d8['params']['id']}})['then'](handleEntityNotFound(_0x10ebab,null))[_0x7cba('0x1f')](function(_0x6a0b82){if(_0x6a0b82){_0x1fa89b=_0x6a0b82;_0x2083dd[_0x7cba('0x3d')]=_[_0x7cba('0x40')](db[_0x7cba('0x5b')][_0x7cba('0x39')]);_0x2083dd[_0x7cba('0x3f')]=_[_0x7cba('0x40')](_0x1364d8[_0x7cba('0x3f')]);_0x2083dd[_0x7cba('0x41')]=_[_0x7cba('0x42')](_0x2083dd['model'],_0x2083dd['query']);_0x280cf2[_0x7cba('0x43')]=_[_0x7cba('0x42')](_0x2083dd[_0x7cba('0x3d')],qs[_0x7cba('0x53')](_0x1364d8[_0x7cba('0x3f')][_0x7cba('0x53')]));_0x280cf2[_0x7cba('0x43')]=_0x280cf2['attributes'][_0x7cba('0x44')]?_0x280cf2[_0x7cba('0x43')]:_0x2083dd[_0x7cba('0x3d')];_0x280cf2[_0x7cba('0x48')]=qs[_0x7cba('0x49')](_0x1364d8[_0x7cba('0x3f')][_0x7cba('0x49')]);_0x280cf2[_0x7cba('0x4a')]=qs['filters'](_[_0x7cba('0x4b')](_0x1364d8[_0x7cba('0x3f')],_0x2083dd[_0x7cba('0x41')]));if(_0x1364d8[_0x7cba('0x3f')][_0x7cba('0x4c')]){_0x280cf2[_0x7cba('0x4a')]=_[_0x7cba('0x4d')](_0x280cf2[_0x7cba('0x4a')],{'$or':_[_0x7cba('0x3e')](_0x280cf2[_0x7cba('0x43')],function(_0x21599d){var _0x4d6ff5={};_0x4d6ff5[_0x21599d]={'$like':'%'+_0x1364d8[_0x7cba('0x3f')][_0x7cba('0x4c')]+'%'};return _0x4d6ff5;})});}_0x280cf2=_[_0x7cba('0x4d')]({},_0x280cf2,_0x1364d8['options']);return _0x1fa89b[_0x7cba('0x5c')](_0x280cf2);}})[_0x7cba('0x1f')](function(_0x15d3d2){if(_0x15d3d2){_0x12b3f7=_0x15d3d2[_0x7cba('0x44')];if(!_0x1364d8[_0x7cba('0x3f')]['hasOwnProperty'](_0x7cba('0x46'))){_0x280cf2[_0x7cba('0x47')]=qs[_0x7cba('0x47')](_0x1364d8[_0x7cba('0x3f')][_0x7cba('0x47')]);_0x280cf2[_0x7cba('0x2d')]=qs['offset'](_0x1364d8[_0x7cba('0x3f')][_0x7cba('0x2d')]);}return _0x1fa89b['getSubjects'](_0x280cf2);}})[_0x7cba('0x1f')](function(_0x292b6e){if(_0x292b6e){return _0x292b6e?{'count':_0x12b3f7,'rows':_0x292b6e}:null;}})[_0x7cba('0x1f')](respondWithResult(_0x10ebab,null))[_0x7cba('0x28')](handleError(_0x10ebab,null));};exports[_0x7cba('0x5d')]=function(_0x799ef1,_0x53731d,_0x426cb6){var _0x595626={};var _0x5da879={};var _0x349271;var _0x140cf7;return db['FreshdeskConfiguration'][_0x7cba('0x5a')]({'where':{'id':_0x799ef1[_0x7cba('0x57')]['id']}})[_0x7cba('0x1f')](handleEntityNotFound(_0x53731d,null))['then'](function(_0x36bfa3){if(_0x36bfa3){_0x349271=_0x36bfa3;_0x5da879[_0x7cba('0x3d')]=_['keys'](db[_0x7cba('0x5b')]['rawAttributes']);_0x5da879[_0x7cba('0x3f')]=_[_0x7cba('0x40')](_0x799ef1[_0x7cba('0x3f')]);_0x5da879[_0x7cba('0x41')]=_['intersection'](_0x5da879[_0x7cba('0x3d')],_0x5da879[_0x7cba('0x3f')]);_0x595626[_0x7cba('0x43')]=_[_0x7cba('0x42')](_0x5da879[_0x7cba('0x3d')],qs[_0x7cba('0x53')](_0x799ef1[_0x7cba('0x3f')][_0x7cba('0x53')]));_0x595626['attributes']=_0x595626[_0x7cba('0x43')]['length']?_0x595626['attributes']:_0x5da879['model'];_0x595626['order']=qs[_0x7cba('0x49')](_0x799ef1['query'][_0x7cba('0x49')]);_0x595626[_0x7cba('0x4a')]=qs['filters'](_[_0x7cba('0x4b')](_0x799ef1['query'],_0x5da879['filters']));if(_0x799ef1[_0x7cba('0x3f')][_0x7cba('0x4c')]){_0x595626['where']=_['merge'](_0x595626['where'],{'$or':_[_0x7cba('0x3e')](_0x595626[_0x7cba('0x43')],function(_0x113d08){var _0x1d8f7f={};_0x1d8f7f[_0x113d08]={'$like':'%'+_0x799ef1[_0x7cba('0x3f')][_0x7cba('0x4c')]+'%'};return _0x1d8f7f;})});}_0x595626=_[_0x7cba('0x4d')]({},_0x595626,_0x799ef1[_0x7cba('0x4e')]);return _0x349271[_0x7cba('0x5d')](_0x595626);}})[_0x7cba('0x1f')](function(_0x3a2ab3){if(_0x3a2ab3){_0x140cf7=_0x3a2ab3['length'];if(!_0x799ef1[_0x7cba('0x3f')]['hasOwnProperty'](_0x7cba('0x46'))){_0x595626[_0x7cba('0x47')]=qs[_0x7cba('0x47')](_0x799ef1[_0x7cba('0x3f')][_0x7cba('0x47')]);_0x595626[_0x7cba('0x2d')]=qs[_0x7cba('0x2d')](_0x799ef1[_0x7cba('0x3f')][_0x7cba('0x2d')]);}return _0x349271[_0x7cba('0x5d')](_0x595626);}})['then'](function(_0x319fce){if(_0x319fce){return _0x319fce?{'count':_0x140cf7,'rows':_0x319fce}:null;}})[_0x7cba('0x1f')](respondWithResult(_0x53731d,null))[_0x7cba('0x28')](handleError(_0x53731d,null));};exports['getTags']=function(_0x1fc127,_0x3cc85e,_0x222dd6){var _0x5efd80={};var _0x5af8ab={};var _0x3e1cdd;var _0x198683;return db['FreshdeskConfiguration'][_0x7cba('0x5a')]({'where':{'id':_0x1fc127['params']['id']}})[_0x7cba('0x1f')](handleEntityNotFound(_0x3cc85e,null))['then'](function(_0x15fbbf){if(_0x15fbbf){_0x3e1cdd=_0x15fbbf;_0x5af8ab[_0x7cba('0x3d')]=_[_0x7cba('0x40')](db[_0x7cba('0x5e')]['rawAttributes']);_0x5af8ab[_0x7cba('0x3f')]=_[_0x7cba('0x40')](_0x1fc127[_0x7cba('0x3f')]);_0x5af8ab['filters']=_['intersection'](_0x5af8ab['model'],_0x5af8ab[_0x7cba('0x3f')]);_0x5efd80[_0x7cba('0x43')]=_[_0x7cba('0x42')](_0x5af8ab[_0x7cba('0x3d')],qs[_0x7cba('0x53')](_0x1fc127[_0x7cba('0x3f')][_0x7cba('0x53')]));_0x5efd80[_0x7cba('0x43')]=_0x5efd80[_0x7cba('0x43')][_0x7cba('0x44')]?_0x5efd80[_0x7cba('0x43')]:_0x5af8ab[_0x7cba('0x3d')];_0x5efd80[_0x7cba('0x48')]=qs[_0x7cba('0x49')](_0x1fc127[_0x7cba('0x3f')]['sort']);_0x5efd80[_0x7cba('0x4a')]=qs[_0x7cba('0x41')](_[_0x7cba('0x4b')](_0x1fc127[_0x7cba('0x3f')],_0x5af8ab['filters']));if(_0x1fc127[_0x7cba('0x3f')][_0x7cba('0x4c')]){_0x5efd80['where']=_[_0x7cba('0x4d')](_0x5efd80[_0x7cba('0x4a')],{'$or':_[_0x7cba('0x3e')](_0x5efd80[_0x7cba('0x43')],function(_0x2a91b5){var _0x4198d9={};_0x4198d9[_0x2a91b5]={'$like':'%'+_0x1fc127[_0x7cba('0x3f')][_0x7cba('0x4c')]+'%'};return _0x4198d9;})});}_0x5efd80=_['merge']({},_0x5efd80,_0x1fc127[_0x7cba('0x4e')]);return _0x3e1cdd[_0x7cba('0x5f')](_0x5efd80);}})[_0x7cba('0x1f')](function(_0x5243b8){if(_0x5243b8){_0x198683=_0x5243b8[_0x7cba('0x44')];if(!_0x1fc127[_0x7cba('0x3f')][_0x7cba('0x45')](_0x7cba('0x46'))){_0x5efd80[_0x7cba('0x47')]=qs['limit'](_0x1fc127['query'][_0x7cba('0x47')]);_0x5efd80[_0x7cba('0x2d')]=qs['offset'](_0x1fc127[_0x7cba('0x3f')]['offset']);}return _0x3e1cdd[_0x7cba('0x5f')](_0x5efd80);}})[_0x7cba('0x1f')](function(_0x3c5292){if(_0x3c5292){return _0x3c5292?{'count':_0x198683,'rows':_0x3c5292}:null;}})[_0x7cba('0x1f')](respondWithResult(_0x3cc85e,null))[_0x7cba('0x28')](handleError(_0x3cc85e,null));};exports[_0x7cba('0x60')]=function(_0x2fcf0e,_0x4dc337,_0x2ca57f){if(_0x2fcf0e[_0x7cba('0x55')]['id']){delete _0x2fcf0e[_0x7cba('0x55')]['id'];}return db[_0x7cba('0x38')][_0x7cba('0x5a')]({'where':{'id':_0x2fcf0e[_0x7cba('0x57')]['id']}})[_0x7cba('0x1f')](handleEntityNotFound(_0x4dc337,null))['then'](function(_0x5ab972){if(_0x5ab972){return _0x5ab972[_0x7cba('0x60')](_0x2fcf0e[_0x7cba('0x55')][_0x7cba('0x61')]||[]);}return null;})['then'](respondWithResult(_0x4dc337,null))[_0x7cba('0x28')](handleError(_0x4dc337,null));};
\ No newline at end of file
+var _0xea44=['where','pick','merge','filter','options','count','includeAll','include','findAll','rows','params','keys','length','find','create','body','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x595872,_0x9498ed){var _0x2fbf41=function(_0x312964){while(--_0x312964){_0x595872['push'](_0x595872['shift']());}};_0x2fbf41(++_0x9498ed);}(_0xea44,0x1a5));var _0x4ea4=function(_0x412d68,_0x1148e9){_0x412d68=_0x412d68-0x0;var _0x5db8ee=_0xea44[_0x412d68];return _0x5db8ee;};'use strict';var pdf=require(_0x4ea4('0x0'));var emlformat=require(_0x4ea4('0x1'));var rimraf=require(_0x4ea4('0x2'));var zipdir=require(_0x4ea4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ea4('0x4'));var moment=require(_0x4ea4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4ea4('0x6'));var util=require(_0x4ea4('0x7'));var path=require(_0x4ea4('0x8'));var sox=require(_0x4ea4('0x9'));var csv=require('to-csv');var ejs=require(_0x4ea4('0xa'));var fs=require('fs');var _=require(_0x4ea4('0xb'));var squel=require(_0x4ea4('0xc'));var crypto=require(_0x4ea4('0xd'));var jsforce=require(_0x4ea4('0xe'));var deskjs=require(_0x4ea4('0xf'));var toCsv=require(_0x4ea4('0x10'));var querystring=require(_0x4ea4('0x11'));var Papa=require(_0x4ea4('0x12'));var Redis=require('ioredis');var authService=require(_0x4ea4('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ea4('0x14'));var logger=require('../../config/logger')(_0x4ea4('0x15'));var utils=require(_0x4ea4('0x16'));var config=require(_0x4ea4('0x17'));var db=require(_0x4ea4('0x18'))['db'];var jayson=require(_0x4ea4('0x19'));var client=jayson[_0x4ea4('0x1a')][_0x4ea4('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x32e31a,_0xd7632e,_0x31c02a){if(_0x31c02a){var _0x21c479=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x21c479[_0x4ea4('0x1c')](_0xd7632e)){return _0x32e31a;}else{throw new db[(_0x4ea4('0x1d'))][(_0x4ea4('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x32e31a;}}function respondWithRpcPromise(_0x24e8b7,_0x27d49b,_0x29fd45,_0xdfbad8){return new BPromise(function(_0xbaa351,_0x28ef26){var _0x4db240=_0xdfbad8||client;return _0x4db240[_0x4ea4('0x1f')](_0x24e8b7,_0x29fd45)['then'](function(_0x5cd504){logger[_0x4ea4('0x20')](_0x4ea4('0x21'),_0x27d49b,'request\x20sent');logger[_0x4ea4('0x22')](_0x4ea4('0x23'),_0x27d49b,'request\x20sent',JSON[_0x4ea4('0x24')](_0x5cd504));if(_0x5cd504[_0x4ea4('0x25')]){if(_0x5cd504[_0x4ea4('0x25')][_0x4ea4('0x26')]===0x1f4){logger[_0x4ea4('0x25')](_0x4ea4('0x21'),_0x27d49b,_0x5cd504[_0x4ea4('0x25')]['message']);return _0x28ef26(_0x5cd504[_0x4ea4('0x25')]['message']);}logger[_0x4ea4('0x25')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x27d49b,_0x5cd504[_0x4ea4('0x25')][_0x4ea4('0x27')]);return _0xbaa351(_0x5cd504['error'][_0x4ea4('0x27')]);}else{logger[_0x4ea4('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x27d49b,'request\x20sent');_0xbaa351(_0x5cd504[_0x4ea4('0x28')][_0x4ea4('0x27')]);}})[_0x4ea4('0x29')](function(_0x11701b){logger['error'](_0x4ea4('0x21'),_0x27d49b,_0x11701b);_0x28ef26(_0x11701b);});});}function respondWithStatusCode(_0xdeae1,_0x5b086a){_0x5b086a=_0x5b086a||0xcc;return function(_0x3f3e57){if(_0x3f3e57){return _0xdeae1[_0x4ea4('0x2a')](_0x5b086a);}return _0xdeae1[_0x4ea4('0x2b')](_0x5b086a)[_0x4ea4('0x2c')]();};}function respondWithResult(_0x1ed218,_0x2202c2){_0x2202c2=_0x2202c2||0xc8;return function(_0x52aa7e){if(_0x52aa7e){return _0x1ed218['status'](_0x2202c2)[_0x4ea4('0x2d')](_0x52aa7e);}};}function respondWithFilteredResult(_0x323a75,_0x4379fd){return function(_0x53325e){if(_0x53325e){var _0x3cb206=_0x53325e['count'],_0x11b197=_0x4379fd[_0x4ea4('0x2e')],_0x197d99=_0x4379fd[_0x4ea4('0x2e')]+_0x4379fd[_0x4ea4('0x2f')],_0xfb2c7f;if(_0x197d99>=_0x3cb206){_0x197d99=_0x3cb206;_0xfb2c7f=0xc8;}else{_0xfb2c7f=0xce;}_0x323a75[_0x4ea4('0x2b')](_0xfb2c7f);return _0x323a75[_0x4ea4('0x30')](_0x4ea4('0x31'),_0x11b197+'-'+_0x197d99+'/'+_0x3cb206)['json'](_0x53325e);}return null;};}function patchUpdates(_0x411853){return function(_0x394c55){try{jsonpatch[_0x4ea4('0x32')](_0x394c55,_0x411853,!![]);}catch(_0x9d56db){return BPromise[_0x4ea4('0x33')](_0x9d56db);}return _0x394c55[_0x4ea4('0x34')]();};}function saveUpdates(_0x1f844d,_0x1578de){return function(_0x324862){if(_0x324862){return _0x324862[_0x4ea4('0x35')](_0x1f844d)[_0x4ea4('0x36')](function(_0x3b92b5){return _0x3b92b5;});}return null;};}function removeEntity(_0x5ec81a,_0x3ed768){return function(_0x55d713){if(_0x55d713){return _0x55d713[_0x4ea4('0x37')]()[_0x4ea4('0x36')](function(){_0x5ec81a[_0x4ea4('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x282a9f,_0x4985eb){return function(_0x51b956){if(!_0x51b956){_0x282a9f[_0x4ea4('0x2a')](0x194);}return _0x51b956;};}function handleError(_0x230efe,_0x16df57){_0x16df57=_0x16df57||0x1f4;return function(_0x479d40){logger[_0x4ea4('0x25')](_0x479d40[_0x4ea4('0x38')]);if(_0x479d40[_0x4ea4('0x39')]){delete _0x479d40[_0x4ea4('0x39')];}_0x230efe[_0x4ea4('0x2b')](_0x16df57)[_0x4ea4('0x3a')](_0x479d40);};}exports[_0x4ea4('0x3b')]=function(_0x23fde9,_0x1ccc34){var _0x230478={},_0x7b3ea4={},_0xca308c={'count':0x0,'rows':[]};var _0x17a931=_[_0x4ea4('0x3c')](db[_0x4ea4('0x3d')][_0x4ea4('0x3e')],function(_0x26ad5d){return{'name':_0x26ad5d['fieldName'],'type':_0x26ad5d[_0x4ea4('0x3f')]['key']};});_0x7b3ea4[_0x4ea4('0x40')]=_['map'](_0x17a931,_0x4ea4('0x39'));_0x7b3ea4[_0x4ea4('0x41')]=_['keys'](_0x23fde9[_0x4ea4('0x41')]);_0x7b3ea4[_0x4ea4('0x42')]=_[_0x4ea4('0x43')](_0x7b3ea4['model'],_0x7b3ea4['query']);_0x230478[_0x4ea4('0x44')]=_[_0x4ea4('0x43')](_0x7b3ea4[_0x4ea4('0x40')],qs[_0x4ea4('0x45')](_0x23fde9[_0x4ea4('0x41')][_0x4ea4('0x45')]));_0x230478[_0x4ea4('0x44')]=_0x230478[_0x4ea4('0x44')]['length']?_0x230478[_0x4ea4('0x44')]:_0x7b3ea4[_0x4ea4('0x40')];if(!_0x23fde9['query'][_0x4ea4('0x46')](_0x4ea4('0x47'))){_0x230478['limit']=qs[_0x4ea4('0x2f')](_0x23fde9[_0x4ea4('0x41')][_0x4ea4('0x2f')]);_0x230478[_0x4ea4('0x2e')]=qs['offset'](_0x23fde9['query'][_0x4ea4('0x2e')]);}_0x230478[_0x4ea4('0x48')]=qs[_0x4ea4('0x49')](_0x23fde9[_0x4ea4('0x41')]['sort']);_0x230478[_0x4ea4('0x4a')]=qs[_0x4ea4('0x42')](_[_0x4ea4('0x4b')](_0x23fde9[_0x4ea4('0x41')],_0x7b3ea4[_0x4ea4('0x42')]),_0x17a931);if(_0x23fde9[_0x4ea4('0x41')]['filter']){_0x230478[_0x4ea4('0x4a')]=_[_0x4ea4('0x4c')](_0x230478['where'],{'$or':_['map'](_0x17a931,function(_0x320b07){if(_0x320b07['type']!=='VIRTUAL'){var _0x304cb7={};_0x304cb7[_0x320b07[_0x4ea4('0x39')]]={'$like':'%'+_0x23fde9[_0x4ea4('0x41')][_0x4ea4('0x4d')]+'%'};return _0x304cb7;}})});}_0x230478=_[_0x4ea4('0x4c')]({},_0x230478,_0x23fde9[_0x4ea4('0x4e')]);var _0x43def8={'where':_0x230478[_0x4ea4('0x4a')]};return db[_0x4ea4('0x3d')][_0x4ea4('0x4f')](_0x43def8)[_0x4ea4('0x36')](function(_0x1dc065){_0xca308c['count']=_0x1dc065;if(_0x23fde9['query'][_0x4ea4('0x50')]){_0x230478[_0x4ea4('0x51')]=[{'all':!![]}];}return db[_0x4ea4('0x3d')][_0x4ea4('0x52')](_0x230478);})[_0x4ea4('0x36')](function(_0xffcf92){_0xca308c[_0x4ea4('0x53')]=_0xffcf92;return _0xca308c;})[_0x4ea4('0x36')](respondWithFilteredResult(_0x1ccc34,_0x230478))[_0x4ea4('0x29')](handleError(_0x1ccc34,null));};exports['show']=function(_0x3acb3a,_0x111582){var _0x193fdf={'raw':![],'where':{'id':_0x3acb3a[_0x4ea4('0x54')]['id']}},_0x4543b6={};_0x4543b6[_0x4ea4('0x40')]=_[_0x4ea4('0x55')](db[_0x4ea4('0x3d')]['rawAttributes']);_0x4543b6[_0x4ea4('0x41')]=_[_0x4ea4('0x55')](_0x3acb3a[_0x4ea4('0x41')]);_0x4543b6[_0x4ea4('0x42')]=_['intersection'](_0x4543b6[_0x4ea4('0x40')],_0x4543b6[_0x4ea4('0x41')]);_0x193fdf['attributes']=_[_0x4ea4('0x43')](_0x4543b6[_0x4ea4('0x40')],qs[_0x4ea4('0x45')](_0x3acb3a['query'][_0x4ea4('0x45')]));_0x193fdf[_0x4ea4('0x44')]=_0x193fdf[_0x4ea4('0x44')][_0x4ea4('0x56')]?_0x193fdf[_0x4ea4('0x44')]:_0x4543b6[_0x4ea4('0x40')];if(_0x3acb3a[_0x4ea4('0x41')]['includeAll']){_0x193fdf[_0x4ea4('0x51')]=[{'all':!![]}];}_0x193fdf=_[_0x4ea4('0x4c')]({},_0x193fdf,_0x3acb3a['options']);return db[_0x4ea4('0x3d')][_0x4ea4('0x57')](_0x193fdf)[_0x4ea4('0x36')](handleEntityNotFound(_0x111582,null))[_0x4ea4('0x36')](respondWithResult(_0x111582,null))[_0x4ea4('0x29')](handleError(_0x111582,null));};exports[_0x4ea4('0x58')]=function(_0x57fbfb,_0x353c43){return db[_0x4ea4('0x3d')][_0x4ea4('0x58')](_0x57fbfb[_0x4ea4('0x59')],{})[_0x4ea4('0x36')](respondWithResult(_0x353c43,0xc9))[_0x4ea4('0x29')](handleError(_0x353c43,null));};exports['update']=function(_0x42abc0,_0x4006ea){if(_0x42abc0[_0x4ea4('0x59')]['id']){delete _0x42abc0[_0x4ea4('0x59')]['id'];}return db[_0x4ea4('0x3d')][_0x4ea4('0x57')]({'where':{'id':_0x42abc0[_0x4ea4('0x54')]['id']}})[_0x4ea4('0x36')](handleEntityNotFound(_0x4006ea,null))[_0x4ea4('0x36')](saveUpdates(_0x42abc0[_0x4ea4('0x59')],null))[_0x4ea4('0x36')](respondWithResult(_0x4006ea,null))[_0x4ea4('0x29')](handleError(_0x4006ea,null));};exports[_0x4ea4('0x37')]=function(_0x4824bd,_0x204037){return db[_0x4ea4('0x3d')][_0x4ea4('0x57')]({'where':{'id':_0x4824bd[_0x4ea4('0x54')]['id']}})[_0x4ea4('0x36')](handleEntityNotFound(_0x204037,null))[_0x4ea4('0x36')](removeEntity(_0x204037,null))['catch'](handleError(_0x204037,null));};exports['getFields']=function(_0x35d3f6,_0x366166,_0x3fe6a9){var _0x13be6b={};var _0x45ca99={};var _0x169d88;var _0x4c4379;return db['FreshdeskConfiguration'][_0x4ea4('0x5a')]({'where':{'id':_0x35d3f6[_0x4ea4('0x54')]['id']}})[_0x4ea4('0x36')](handleEntityNotFound(_0x366166,null))[_0x4ea4('0x36')](function(_0x2e6334){if(_0x2e6334){_0x169d88=_0x2e6334;_0x45ca99['model']=_[_0x4ea4('0x55')](db[_0x4ea4('0x5b')][_0x4ea4('0x3e')]);_0x45ca99['query']=_[_0x4ea4('0x55')](_0x35d3f6[_0x4ea4('0x41')]);_0x45ca99[_0x4ea4('0x42')]=_[_0x4ea4('0x43')](_0x45ca99[_0x4ea4('0x40')],_0x45ca99[_0x4ea4('0x41')]);_0x13be6b[_0x4ea4('0x44')]=_[_0x4ea4('0x43')](_0x45ca99['model'],qs[_0x4ea4('0x45')](_0x35d3f6[_0x4ea4('0x41')][_0x4ea4('0x45')]));_0x13be6b[_0x4ea4('0x44')]=_0x13be6b[_0x4ea4('0x44')]['length']?_0x13be6b[_0x4ea4('0x44')]:_0x45ca99[_0x4ea4('0x40')];_0x13be6b[_0x4ea4('0x48')]=qs[_0x4ea4('0x49')](_0x35d3f6[_0x4ea4('0x41')][_0x4ea4('0x49')]);_0x13be6b[_0x4ea4('0x4a')]=qs[_0x4ea4('0x42')](_['pick'](_0x35d3f6['query'],_0x45ca99['filters']));if(_0x35d3f6[_0x4ea4('0x41')][_0x4ea4('0x4d')]){_0x13be6b[_0x4ea4('0x4a')]=_['merge'](_0x13be6b[_0x4ea4('0x4a')],{'$or':_[_0x4ea4('0x3c')](_0x13be6b['attributes'],function(_0x117af2){var _0xb3eca4={};_0xb3eca4[_0x117af2]={'$like':'%'+_0x35d3f6[_0x4ea4('0x41')][_0x4ea4('0x4d')]+'%'};return _0xb3eca4;})});}_0x13be6b=_[_0x4ea4('0x4c')]({},_0x13be6b,_0x35d3f6[_0x4ea4('0x4e')]);return _0x169d88[_0x4ea4('0x5c')](_0x13be6b);}})['then'](function(_0x22ad65){if(_0x22ad65){_0x4c4379=_0x22ad65[_0x4ea4('0x56')];if(!_0x35d3f6[_0x4ea4('0x41')]['hasOwnProperty']('nolimit')){_0x13be6b[_0x4ea4('0x2f')]=qs['limit'](_0x35d3f6['query']['limit']);_0x13be6b[_0x4ea4('0x2e')]=qs[_0x4ea4('0x2e')](_0x35d3f6['query'][_0x4ea4('0x2e')]);}return _0x169d88[_0x4ea4('0x5c')](_0x13be6b);}})['then'](function(_0x8c7f8d){if(_0x8c7f8d){return _0x8c7f8d?{'count':_0x4c4379,'rows':_0x8c7f8d}:null;}})[_0x4ea4('0x36')](respondWithResult(_0x366166,null))['catch'](handleError(_0x366166,null));};exports[_0x4ea4('0x5d')]=function(_0x11acee,_0x457b42,_0x2d7d1c){var _0x23074b={};var _0x2bbf9c={};var _0x1e7b98;var _0x3064a6;return db[_0x4ea4('0x3d')][_0x4ea4('0x5a')]({'where':{'id':_0x11acee['params']['id']}})[_0x4ea4('0x36')](handleEntityNotFound(_0x457b42,null))[_0x4ea4('0x36')](function(_0xc20d33){if(_0xc20d33){_0x1e7b98=_0xc20d33;_0x2bbf9c[_0x4ea4('0x40')]=_['keys'](db[_0x4ea4('0x5b')][_0x4ea4('0x3e')]);_0x2bbf9c['query']=_['keys'](_0x11acee[_0x4ea4('0x41')]);_0x2bbf9c[_0x4ea4('0x42')]=_[_0x4ea4('0x43')](_0x2bbf9c[_0x4ea4('0x40')],_0x2bbf9c[_0x4ea4('0x41')]);_0x23074b[_0x4ea4('0x44')]=_[_0x4ea4('0x43')](_0x2bbf9c[_0x4ea4('0x40')],qs[_0x4ea4('0x45')](_0x11acee[_0x4ea4('0x41')][_0x4ea4('0x45')]));_0x23074b[_0x4ea4('0x44')]=_0x23074b[_0x4ea4('0x44')]['length']?_0x23074b[_0x4ea4('0x44')]:_0x2bbf9c[_0x4ea4('0x40')];_0x23074b[_0x4ea4('0x48')]=qs[_0x4ea4('0x49')](_0x11acee['query'][_0x4ea4('0x49')]);_0x23074b['where']=qs[_0x4ea4('0x42')](_[_0x4ea4('0x4b')](_0x11acee[_0x4ea4('0x41')],_0x2bbf9c[_0x4ea4('0x42')]));if(_0x11acee[_0x4ea4('0x41')][_0x4ea4('0x4d')]){_0x23074b[_0x4ea4('0x4a')]=_[_0x4ea4('0x4c')](_0x23074b[_0x4ea4('0x4a')],{'$or':_[_0x4ea4('0x3c')](_0x23074b['attributes'],function(_0x3337b1){var _0x303d65={};_0x303d65[_0x3337b1]={'$like':'%'+_0x11acee[_0x4ea4('0x41')][_0x4ea4('0x4d')]+'%'};return _0x303d65;})});}_0x23074b=_['merge']({},_0x23074b,_0x11acee['options']);return _0x1e7b98[_0x4ea4('0x5d')](_0x23074b);}})[_0x4ea4('0x36')](function(_0x4b09ca){if(_0x4b09ca){_0x3064a6=_0x4b09ca[_0x4ea4('0x56')];if(!_0x11acee[_0x4ea4('0x41')][_0x4ea4('0x46')](_0x4ea4('0x47'))){_0x23074b[_0x4ea4('0x2f')]=qs[_0x4ea4('0x2f')](_0x11acee[_0x4ea4('0x41')][_0x4ea4('0x2f')]);_0x23074b[_0x4ea4('0x2e')]=qs[_0x4ea4('0x2e')](_0x11acee[_0x4ea4('0x41')][_0x4ea4('0x2e')]);}return _0x1e7b98[_0x4ea4('0x5d')](_0x23074b);}})[_0x4ea4('0x36')](function(_0x43c2ad){if(_0x43c2ad){return _0x43c2ad?{'count':_0x3064a6,'rows':_0x43c2ad}:null;}})[_0x4ea4('0x36')](respondWithResult(_0x457b42,null))[_0x4ea4('0x29')](handleError(_0x457b42,null));};exports['getDescriptions']=function(_0x26ff26,_0x359e25,_0x109543){var _0x1d46de={};var _0x3bf3e3={};var _0x5865cc;var _0x306b13;return db[_0x4ea4('0x3d')][_0x4ea4('0x5a')]({'where':{'id':_0x26ff26[_0x4ea4('0x54')]['id']}})[_0x4ea4('0x36')](handleEntityNotFound(_0x359e25,null))[_0x4ea4('0x36')](function(_0x19d1da){if(_0x19d1da){_0x5865cc=_0x19d1da;_0x3bf3e3['model']=_['keys'](db[_0x4ea4('0x5b')][_0x4ea4('0x3e')]);_0x3bf3e3[_0x4ea4('0x41')]=_[_0x4ea4('0x55')](_0x26ff26[_0x4ea4('0x41')]);_0x3bf3e3[_0x4ea4('0x42')]=_[_0x4ea4('0x43')](_0x3bf3e3[_0x4ea4('0x40')],_0x3bf3e3[_0x4ea4('0x41')]);_0x1d46de['attributes']=_['intersection'](_0x3bf3e3[_0x4ea4('0x40')],qs[_0x4ea4('0x45')](_0x26ff26[_0x4ea4('0x41')][_0x4ea4('0x45')]));_0x1d46de[_0x4ea4('0x44')]=_0x1d46de[_0x4ea4('0x44')][_0x4ea4('0x56')]?_0x1d46de[_0x4ea4('0x44')]:_0x3bf3e3[_0x4ea4('0x40')];_0x1d46de[_0x4ea4('0x48')]=qs[_0x4ea4('0x49')](_0x26ff26[_0x4ea4('0x41')]['sort']);_0x1d46de['where']=qs['filters'](_['pick'](_0x26ff26[_0x4ea4('0x41')],_0x3bf3e3[_0x4ea4('0x42')]));if(_0x26ff26[_0x4ea4('0x41')][_0x4ea4('0x4d')]){_0x1d46de[_0x4ea4('0x4a')]=_[_0x4ea4('0x4c')](_0x1d46de['where'],{'$or':_[_0x4ea4('0x3c')](_0x1d46de['attributes'],function(_0x50d8a8){var _0x335a66={};_0x335a66[_0x50d8a8]={'$like':'%'+_0x26ff26[_0x4ea4('0x41')][_0x4ea4('0x4d')]+'%'};return _0x335a66;})});}_0x1d46de=_[_0x4ea4('0x4c')]({},_0x1d46de,_0x26ff26[_0x4ea4('0x4e')]);return _0x5865cc[_0x4ea4('0x5e')](_0x1d46de);}})[_0x4ea4('0x36')](function(_0x3a67ce){if(_0x3a67ce){_0x306b13=_0x3a67ce[_0x4ea4('0x56')];if(!_0x26ff26[_0x4ea4('0x41')]['hasOwnProperty'](_0x4ea4('0x47'))){_0x1d46de[_0x4ea4('0x2f')]=qs[_0x4ea4('0x2f')](_0x26ff26[_0x4ea4('0x41')]['limit']);_0x1d46de['offset']=qs[_0x4ea4('0x2e')](_0x26ff26[_0x4ea4('0x41')][_0x4ea4('0x2e')]);}return _0x5865cc[_0x4ea4('0x5e')](_0x1d46de);}})['then'](function(_0x59566e){if(_0x59566e){return _0x59566e?{'count':_0x306b13,'rows':_0x59566e}:null;}})[_0x4ea4('0x36')](respondWithResult(_0x359e25,null))['catch'](handleError(_0x359e25,null));};exports[_0x4ea4('0x5f')]=function(_0x2d4222,_0x247098,_0x2d6e3f){var _0x591c3e={};var _0x274c9b={};var _0x3e149b;var _0xa83f81;return db['FreshdeskConfiguration'][_0x4ea4('0x5a')]({'where':{'id':_0x2d4222[_0x4ea4('0x54')]['id']}})[_0x4ea4('0x36')](handleEntityNotFound(_0x247098,null))[_0x4ea4('0x36')](function(_0x21d8cc){if(_0x21d8cc){_0x3e149b=_0x21d8cc;_0x274c9b['model']=_[_0x4ea4('0x55')](db[_0x4ea4('0x60')]['rawAttributes']);_0x274c9b[_0x4ea4('0x41')]=_[_0x4ea4('0x55')](_0x2d4222['query']);_0x274c9b['filters']=_['intersection'](_0x274c9b[_0x4ea4('0x40')],_0x274c9b['query']);_0x591c3e['attributes']=_[_0x4ea4('0x43')](_0x274c9b[_0x4ea4('0x40')],qs[_0x4ea4('0x45')](_0x2d4222[_0x4ea4('0x41')][_0x4ea4('0x45')]));_0x591c3e[_0x4ea4('0x44')]=_0x591c3e[_0x4ea4('0x44')][_0x4ea4('0x56')]?_0x591c3e[_0x4ea4('0x44')]:_0x274c9b[_0x4ea4('0x40')];_0x591c3e[_0x4ea4('0x48')]=qs[_0x4ea4('0x49')](_0x2d4222['query'][_0x4ea4('0x49')]);_0x591c3e[_0x4ea4('0x4a')]=qs[_0x4ea4('0x42')](_[_0x4ea4('0x4b')](_0x2d4222['query'],_0x274c9b['filters']));if(_0x2d4222[_0x4ea4('0x41')]['filter']){_0x591c3e['where']=_[_0x4ea4('0x4c')](_0x591c3e[_0x4ea4('0x4a')],{'$or':_[_0x4ea4('0x3c')](_0x591c3e['attributes'],function(_0x28bc73){var _0x45655d={};_0x45655d[_0x28bc73]={'$like':'%'+_0x2d4222[_0x4ea4('0x41')][_0x4ea4('0x4d')]+'%'};return _0x45655d;})});}_0x591c3e=_[_0x4ea4('0x4c')]({},_0x591c3e,_0x2d4222[_0x4ea4('0x4e')]);return _0x3e149b[_0x4ea4('0x5f')](_0x591c3e);}})['then'](function(_0x1dbeec){if(_0x1dbeec){_0xa83f81=_0x1dbeec[_0x4ea4('0x56')];if(!_0x2d4222[_0x4ea4('0x41')]['hasOwnProperty'](_0x4ea4('0x47'))){_0x591c3e['limit']=qs['limit'](_0x2d4222[_0x4ea4('0x41')][_0x4ea4('0x2f')]);_0x591c3e[_0x4ea4('0x2e')]=qs['offset'](_0x2d4222[_0x4ea4('0x41')][_0x4ea4('0x2e')]);}return _0x3e149b[_0x4ea4('0x5f')](_0x591c3e);}})[_0x4ea4('0x36')](function(_0xd0ca3d){if(_0xd0ca3d){return _0xd0ca3d?{'count':_0xa83f81,'rows':_0xd0ca3d}:null;}})[_0x4ea4('0x36')](respondWithResult(_0x247098,null))['catch'](handleError(_0x247098,null));};exports[_0x4ea4('0x61')]=function(_0x1476eb,_0x23b3a6,_0x3d9150){if(_0x1476eb[_0x4ea4('0x59')]['id']){delete _0x1476eb[_0x4ea4('0x59')]['id'];}return db[_0x4ea4('0x3d')][_0x4ea4('0x5a')]({'where':{'id':_0x1476eb[_0x4ea4('0x54')]['id']}})[_0x4ea4('0x36')](handleEntityNotFound(_0x23b3a6,null))[_0x4ea4('0x36')](function(_0x10273e){if(_0x10273e){return _0x10273e[_0x4ea4('0x61')](_0x1476eb[_0x4ea4('0x59')][_0x4ea4('0x62')]||[]);}return null;})[_0x4ea4('0x36')](respondWithResult(_0x23b3a6,null))[_0x4ea4('0x29')](handleError(_0x23b3a6,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
index d85e7b3..7a3d681 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x53ec=['bluebird','path','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x319517,_0x411b3c){var _0x57ffcb=function(_0x3c3ec0){while(--_0x3c3ec0){_0x319517['push'](_0x319517['shift']());}};_0x57ffcb(++_0x411b3c);}(_0x53ec,0x192));var _0xc53e=function(_0x25ccbe,_0xc935c0){_0x25ccbe=_0x25ccbe-0x0;var _0x289529=_0x53ec[_0x25ccbe];return _0x289529;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6aa7=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6aa7,0x178));var _0x76aa=function(_0x4bc81a,_0x8059e2){_0x4bc81a=_0x4bc81a-0x0;var _0x57b884=_0x6aa7[_0x4bc81a];return _0x57b884;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
index 3ab544d..b7915a2 100644
--- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
+++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b5d=['error','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x24618a,_0x2cd0f4){var _0x2e3d64=function(_0x28c59c){while(--_0x28c59c){_0x24618a['push'](_0x24618a['shift']());}};_0x2e3d64(++_0x2cd0f4);}(_0x5b5d,0x98));var _0xd5b5=function(_0x12237d,_0x58361e){_0x12237d=_0x12237d-0x0;var _0x57643d=_0x5b5d[_0x12237d];return _0x57643d;};'use strict';var _=require(_0xd5b5('0x0'));var util=require(_0xd5b5('0x1'));var moment=require('moment');var BPromise=require(_0xd5b5('0x2'));var rs=require(_0xd5b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5b5('0x4'))['db'];var utils=require(_0xd5b5('0x5'));var logger=require(_0xd5b5('0x6'))(_0xd5b5('0x7'));var config=require(_0xd5b5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd5b5('0x9')][_0xd5b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1078bd,_0xf5b6ab,_0xe65ec2){return new BPromise(function(_0x2b4793,_0x4faae5){return client[_0xd5b5('0xb')](_0x1078bd,_0xe65ec2)['then'](function(_0x1b2e17){logger[_0xd5b5('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xf5b6ab,_0xd5b5('0xd'));logger[_0xd5b5('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0xf5b6ab,'request\x20sent',JSON[_0xd5b5('0xf')](_0x1b2e17));if(_0x1b2e17[_0xd5b5('0x10')]){if(_0x1b2e17[_0xd5b5('0x10')]['code']===0x1f4){logger[_0xd5b5('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xf5b6ab,_0x1b2e17[_0xd5b5('0x10')]['message']);return _0x4faae5(_0x1b2e17[_0xd5b5('0x10')][_0xd5b5('0x11')]);}logger[_0xd5b5('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xf5b6ab,_0x1b2e17[_0xd5b5('0x10')][_0xd5b5('0x11')]);return _0x2b4793(_0x1b2e17[_0xd5b5('0x10')][_0xd5b5('0x11')]);}else{logger[_0xd5b5('0xc')](_0xd5b5('0x12'),_0xf5b6ab,_0xd5b5('0xd'));_0x2b4793(_0x1b2e17[_0xd5b5('0x13')][_0xd5b5('0x11')]);}})[_0xd5b5('0x14')](function(_0x412e41){logger[_0xd5b5('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xf5b6ab,_0x412e41);_0x4faae5(_0x412e41);});});}
\ No newline at end of file
+var _0x81dc=['request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x5a3430,_0x2da4c5){var _0x40b12e=function(_0x48611d){while(--_0x48611d){_0x5a3430['push'](_0x5a3430['shift']());}};_0x40b12e(++_0x2da4c5);}(_0x81dc,0x13b));var _0xc81d=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x81dc[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0xc81d('0x0'));var util=require(_0xc81d('0x1'));var moment=require(_0xc81d('0x2'));var BPromise=require(_0xc81d('0x3'));var rs=require(_0xc81d('0x4'));var fs=require('fs');var Redis=require(_0xc81d('0x5'));var db=require(_0xc81d('0x6'))['db'];var utils=require(_0xc81d('0x7'));var logger=require(_0xc81d('0x8'))(_0xc81d('0x9'));var config=require(_0xc81d('0xa'));var jayson=require(_0xc81d('0xb'));var client=jayson['client'][_0xc81d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x522fb5,_0x4e447b,_0x1fd9e0){return new BPromise(function(_0x478ba6,_0x1cbfed){return client[_0xc81d('0xd')](_0x522fb5,_0x1fd9e0)['then'](function(_0xf41052){logger['info'](_0xc81d('0xe'),_0x4e447b,_0xc81d('0xf'));logger[_0xc81d('0x10')](_0xc81d('0x11'),_0x4e447b,_0xc81d('0xf'),JSON['stringify'](_0xf41052));if(_0xf41052[_0xc81d('0x12')]){if(_0xf41052[_0xc81d('0x12')]['code']===0x1f4){logger[_0xc81d('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4e447b,_0xf41052['error'][_0xc81d('0x13')]);return _0x1cbfed(_0xf41052[_0xc81d('0x12')][_0xc81d('0x13')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4e447b,_0xf41052[_0xc81d('0x12')][_0xc81d('0x13')]);return _0x478ba6(_0xf41052['error']['message']);}else{logger['info'](_0xc81d('0xe'),_0x4e447b,_0xc81d('0xf'));_0x478ba6(_0xf41052[_0xc81d('0x14')][_0xc81d('0x13')]);}})[_0xc81d('0x15')](function(_0x2d37e8){logger[_0xc81d('0x12')](_0xc81d('0xe'),_0x4e447b,_0x2d37e8);_0x1cbfed(_0x2d37e8);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js
index 34facf7..db600eb 100644
--- a/server/api/intFreshdeskField/index.js
+++ b/server/api/intFreshdeskField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0xc6a3a4,_0x40e54f){var _0x2b8e96=function(_0x3082f0){while(--_0x3082f0){_0xc6a3a4['push'](_0xc6a3a4['shift']());}};_0x2b8e96(++_0x40e54f);}(_0x008c,0x188));var _0xc008=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0x008c[_0xd02bb];return _0x1cdf23;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','delete','/:id','destroy','exports'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xedd9,0xfc));var _0x9edd=function(_0x2fa8a1,_0x270b10){_0x2fa8a1=_0x2fa8a1-0x0;var _0x279b78=_0xedd9[_0x2fa8a1];return _0x279b78;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0xb')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router[_0x9edd('0xd')]('/:id',auth[_0x9edd('0x9')](),controller['update']);router[_0x9edd('0xe')](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);module[_0x9edd('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js
index 3b4c598..e7e6e31 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.attributes.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee5c=['string','variable','keyValue','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports'];(function(_0x1a8447,_0x36530a){var _0x395a51=function(_0x4c2d74){while(--_0x4c2d74){_0x1a8447['push'](_0x1a8447['shift']());}};_0x395a51(++_0x36530a);}(_0xee5c,0xcd));var _0xcee5=function(_0x254abd,_0x1ab7f0){_0x254abd=_0x254abd-0x0;var _0x31bf1b=_0xee5c[_0x254abd];return _0x31bf1b;};'use strict';var Sequelize=require(_0xcee5('0x0'));module[_0xcee5('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcee5('0x2'),_0xcee5('0x3'),'customVariable',_0xcee5('0x4')),'defaultValue':_0xcee5('0x2')},'content':{'type':Sequelize[_0xcee5('0x5')]},'key':{'type':Sequelize[_0xcee5('0x5')]},'keyType':{'type':Sequelize[_0xcee5('0x6')](_0xcee5('0x2'),_0xcee5('0x3'),_0xcee5('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xcee5('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xcee5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcee5('0x5')]}};
\ No newline at end of file
+var _0x54da=['string','STRING','sequelize','ENUM','customVariable'];(function(_0x295d4f,_0x50d0e5){var _0x842a3=function(_0x3bfbf3){while(--_0x3bfbf3){_0x295d4f['push'](_0x295d4f['shift']());}};_0x842a3(++_0x50d0e5);}(_0x54da,0x9d));var _0xa54d=function(_0x42bedd,_0x157a71){_0x42bedd=_0x42bedd-0x0;var _0x1a2b17=_0x54da[_0x42bedd];return _0x1a2b17;};'use strict';var Sequelize=require(_0xa54d('0x0'));module['exports']={'type':{'type':Sequelize[_0xa54d('0x1')]('string','variable',_0xa54d('0x2'),'keyValue'),'defaultValue':_0xa54d('0x3')},'content':{'type':Sequelize[_0xa54d('0x4')]},'key':{'type':Sequelize[_0xa54d('0x4')]},'keyType':{'type':Sequelize[_0xa54d('0x1')]('string','variable',_0xa54d('0x2'))},'keyContent':{'type':Sequelize[_0xa54d('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa54d('0x4')]}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js
index 2ab37e4..1ce556b 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.controller.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c35=['json','count','offset','limit','set','Content-Range','apply','reject','save','then','end','error','name','send','index','FreshdeskField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','includeAll','include','findAll','show','params','find','catch','create','body','update','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7c35,0x147));var _0x57c3=function(_0x442f83,_0x47ddbf){_0x442f83=_0x442f83-0x0;var _0x5bf96b=_0x7c35[_0x442f83];return _0x5bf96b;};'use strict';var pdf=require(_0x57c3('0x0'));var emlformat=require(_0x57c3('0x1'));var rimraf=require(_0x57c3('0x2'));var zipdir=require(_0x57c3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57c3('0x4'));var moment=require('moment');var BPromise=require(_0x57c3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x57c3('0x6'));var csv=require(_0x57c3('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x57c3('0x8'));var jsforce=require(_0x57c3('0x9'));var deskjs=require(_0x57c3('0xa'));var toCsv=require('to-csv');var querystring=require(_0x57c3('0xb'));var Papa=require(_0x57c3('0xc'));var Redis=require(_0x57c3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x57c3('0xe'));var as=require(_0x57c3('0xf'));var hardwareService=require(_0x57c3('0x10'));var logger=require(_0x57c3('0x11'))(_0x57c3('0x12'));var utils=require(_0x57c3('0x13'));var config=require('../../config/environment');var db=require(_0x57c3('0x14'))['db'];function respondWithStatusCode(_0x35f0d3,_0x5323b7){_0x5323b7=_0x5323b7||0xcc;return function(_0x1535ce){if(_0x1535ce){return _0x35f0d3[_0x57c3('0x15')](_0x5323b7);}return _0x35f0d3['status'](_0x5323b7)['end']();};}function respondWithResult(_0x3acc3f,_0xa51656){_0xa51656=_0xa51656||0xc8;return function(_0x2603ad){if(_0x2603ad){return _0x3acc3f[_0x57c3('0x16')](_0xa51656)[_0x57c3('0x17')](_0x2603ad);}};}function respondWithFilteredResult(_0x374c5a,_0x2f170d){return function(_0x134b97){if(_0x134b97){var _0x17f70a=_0x134b97[_0x57c3('0x18')],_0x249987=_0x2f170d[_0x57c3('0x19')],_0x3de554=_0x2f170d[_0x57c3('0x19')]+_0x2f170d[_0x57c3('0x1a')],_0x3f36e3;if(_0x3de554>=_0x17f70a){_0x3de554=_0x17f70a;_0x3f36e3=0xc8;}else{_0x3f36e3=0xce;}_0x374c5a[_0x57c3('0x16')](_0x3f36e3);return _0x374c5a[_0x57c3('0x1b')](_0x57c3('0x1c'),_0x249987+'-'+_0x3de554+'/'+_0x17f70a)['json'](_0x134b97);}return null;};}function patchUpdates(_0x14deda){return function(_0x2b80c4){try{jsonpatch[_0x57c3('0x1d')](_0x2b80c4,_0x14deda,!![]);}catch(_0x5ac599){return BPromise[_0x57c3('0x1e')](_0x5ac599);}return _0x2b80c4[_0x57c3('0x1f')]();};}function saveUpdates(_0x43a036,_0x13a6f0){return function(_0x2b0327){if(_0x2b0327){return _0x2b0327['update'](_0x43a036)[_0x57c3('0x20')](function(_0x43c791){return _0x43c791;});}return null;};}function removeEntity(_0x233840,_0xf2f9aa){return function(_0x319814){if(_0x319814){return _0x319814['destroy']()['then'](function(){_0x233840[_0x57c3('0x16')](0xcc)[_0x57c3('0x21')]();});}};}function handleEntityNotFound(_0x32d82d,_0xc76901){return function(_0x5fae56){if(!_0x5fae56){_0x32d82d[_0x57c3('0x15')](0x194);}return _0x5fae56;};}function handleError(_0xfb6af4,_0x28f1b3){_0x28f1b3=_0x28f1b3||0x1f4;return function(_0x109549){logger[_0x57c3('0x22')](_0x109549['stack']);if(_0x109549['name']){delete _0x109549[_0x57c3('0x23')];}_0xfb6af4[_0x57c3('0x16')](_0x28f1b3)[_0x57c3('0x24')](_0x109549);};}exports[_0x57c3('0x25')]=function(_0xb9df5e,_0x1a3d01){var _0x5d5ce6={},_0x142083={},_0x2c1581={'count':0x0,'rows':[]};var _0x306ee7=_['map'](db[_0x57c3('0x26')][_0x57c3('0x27')],function(_0x57f573){return{'name':_0x57f573[_0x57c3('0x28')],'type':_0x57f573['type']['key']};});_0x142083[_0x57c3('0x29')]=_['map'](_0x306ee7,_0x57c3('0x23'));_0x142083[_0x57c3('0x2a')]=_[_0x57c3('0x2b')](_0xb9df5e[_0x57c3('0x2a')]);_0x142083[_0x57c3('0x2c')]=_[_0x57c3('0x2d')](_0x142083[_0x57c3('0x29')],_0x142083[_0x57c3('0x2a')]);_0x5d5ce6[_0x57c3('0x2e')]=_['intersection'](_0x142083[_0x57c3('0x29')],qs[_0x57c3('0x2f')](_0xb9df5e[_0x57c3('0x2a')][_0x57c3('0x2f')]));_0x5d5ce6[_0x57c3('0x2e')]=_0x5d5ce6[_0x57c3('0x2e')][_0x57c3('0x30')]?_0x5d5ce6[_0x57c3('0x2e')]:_0x142083[_0x57c3('0x29')];if(!_0xb9df5e[_0x57c3('0x2a')][_0x57c3('0x31')](_0x57c3('0x32'))){_0x5d5ce6[_0x57c3('0x1a')]=qs['limit'](_0xb9df5e[_0x57c3('0x2a')][_0x57c3('0x1a')]);_0x5d5ce6[_0x57c3('0x19')]=qs[_0x57c3('0x19')](_0xb9df5e[_0x57c3('0x2a')][_0x57c3('0x19')]);}_0x5d5ce6[_0x57c3('0x33')]=qs[_0x57c3('0x34')](_0xb9df5e[_0x57c3('0x2a')][_0x57c3('0x34')]);_0x5d5ce6['where']=qs['filters'](_[_0x57c3('0x35')](_0xb9df5e[_0x57c3('0x2a')],_0x142083[_0x57c3('0x2c')]),_0x306ee7);if(_0xb9df5e['query'][_0x57c3('0x36')]){_0x5d5ce6['where']=_[_0x57c3('0x37')](_0x5d5ce6[_0x57c3('0x38')],{'$or':_['map'](_0x306ee7,function(_0x1e831d){if(_0x1e831d[_0x57c3('0x39')]!=='VIRTUAL'){var _0x2c3c58={};_0x2c3c58[_0x1e831d[_0x57c3('0x23')]]={'$like':'%'+_0xb9df5e['query'][_0x57c3('0x36')]+'%'};return _0x2c3c58;}})});}_0x5d5ce6=_[_0x57c3('0x37')]({},_0x5d5ce6,_0xb9df5e[_0x57c3('0x3a')]);var _0x26d82c={'where':_0x5d5ce6[_0x57c3('0x38')]};return db['FreshdeskField'][_0x57c3('0x18')](_0x26d82c)[_0x57c3('0x20')](function(_0x2d6419){_0x2c1581[_0x57c3('0x18')]=_0x2d6419;if(_0xb9df5e[_0x57c3('0x2a')][_0x57c3('0x3b')]){_0x5d5ce6[_0x57c3('0x3c')]=[{'all':!![]}];}return db[_0x57c3('0x26')][_0x57c3('0x3d')](_0x5d5ce6);})[_0x57c3('0x20')](function(_0x3c8880){_0x2c1581['rows']=_0x3c8880;return _0x2c1581;})['then'](respondWithFilteredResult(_0x1a3d01,_0x5d5ce6))['catch'](handleError(_0x1a3d01,null));};exports[_0x57c3('0x3e')]=function(_0x248122,_0x203a37){var _0x560d46={'raw':!![],'where':{'id':_0x248122[_0x57c3('0x3f')]['id']}},_0x208bf3={};_0x208bf3[_0x57c3('0x29')]=_['keys'](db['FreshdeskField'][_0x57c3('0x27')]);_0x208bf3['query']=_[_0x57c3('0x2b')](_0x248122[_0x57c3('0x2a')]);_0x208bf3[_0x57c3('0x2c')]=_['intersection'](_0x208bf3[_0x57c3('0x29')],_0x208bf3[_0x57c3('0x2a')]);_0x560d46[_0x57c3('0x2e')]=_[_0x57c3('0x2d')](_0x208bf3[_0x57c3('0x29')],qs['fields'](_0x248122[_0x57c3('0x2a')][_0x57c3('0x2f')]));_0x560d46['attributes']=_0x560d46[_0x57c3('0x2e')][_0x57c3('0x30')]?_0x560d46[_0x57c3('0x2e')]:_0x208bf3['model'];if(_0x248122[_0x57c3('0x2a')][_0x57c3('0x3b')]){_0x560d46['include']=[{'all':!![]}];}_0x560d46=_[_0x57c3('0x37')]({},_0x560d46,_0x248122[_0x57c3('0x3a')]);return db[_0x57c3('0x26')][_0x57c3('0x40')](_0x560d46)[_0x57c3('0x20')](handleEntityNotFound(_0x203a37,null))[_0x57c3('0x20')](respondWithResult(_0x203a37,null))[_0x57c3('0x41')](handleError(_0x203a37,null));};exports[_0x57c3('0x42')]=function(_0x155eba,_0x529524){return db['FreshdeskField']['create'](_0x155eba[_0x57c3('0x43')],{})[_0x57c3('0x20')](respondWithResult(_0x529524,0xc9))[_0x57c3('0x41')](handleError(_0x529524,null));};exports[_0x57c3('0x44')]=function(_0x3e93be,_0x1c6334){if(_0x3e93be[_0x57c3('0x43')]['id']){delete _0x3e93be[_0x57c3('0x43')]['id'];}return db[_0x57c3('0x26')][_0x57c3('0x40')]({'where':{'id':_0x3e93be[_0x57c3('0x3f')]['id']}})[_0x57c3('0x20')](handleEntityNotFound(_0x1c6334,null))[_0x57c3('0x20')](saveUpdates(_0x3e93be[_0x57c3('0x43')],null))[_0x57c3('0x20')](respondWithResult(_0x1c6334,null))[_0x57c3('0x41')](handleError(_0x1c6334,null));};exports[_0x57c3('0x45')]=function(_0x54d16a,_0x224270){return db[_0x57c3('0x26')]['find']({'where':{'id':_0x54d16a[_0x57c3('0x3f')]['id']}})[_0x57c3('0x20')](handleEntityNotFound(_0x224270,null))[_0x57c3('0x20')](removeEntity(_0x224270,null))[_0x57c3('0x41')](handleError(_0x224270,null));};
\ No newline at end of file
+var _0x1f14=['moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','sendStatus','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0x1f14,0x122));var _0x41f1=function(_0x3dbb04,_0x277159){_0x3dbb04=_0x3dbb04-0x0;var _0x1dc38f=_0x1f14[_0x3dbb04];return _0x1dc38f;};'use strict';var pdf=require(_0x41f1('0x0'));var emlformat=require(_0x41f1('0x1'));var rimraf=require(_0x41f1('0x2'));var zipdir=require(_0x41f1('0x3'));var jsonpatch=require(_0x41f1('0x4'));var rp=require(_0x41f1('0x5'));var moment=require(_0x41f1('0x6'));var BPromise=require(_0x41f1('0x7'));var Mustache=require('mustache');var util=require(_0x41f1('0x8'));var path=require(_0x41f1('0x9'));var sox=require('sox');var csv=require(_0x41f1('0xa'));var ejs=require(_0x41f1('0xb'));var fs=require('fs');var _=require(_0x41f1('0xc'));var squel=require(_0x41f1('0xd'));var crypto=require('crypto');var jsforce=require(_0x41f1('0xe'));var deskjs=require(_0x41f1('0xf'));var toCsv=require(_0x41f1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x41f1('0x10'));var authService=require(_0x41f1('0x11'));var qs=require(_0x41f1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x41f1('0x13'));var logger=require(_0x41f1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x41f1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x367be1,_0x13c5c7){_0x13c5c7=_0x13c5c7||0xcc;return function(_0x9ff6e2){if(_0x9ff6e2){return _0x367be1['sendStatus'](_0x13c5c7);}return _0x367be1[_0x41f1('0x16')](_0x13c5c7)[_0x41f1('0x17')]();};}function respondWithResult(_0x311caf,_0x408a8b){_0x408a8b=_0x408a8b||0xc8;return function(_0x3273c3){if(_0x3273c3){return _0x311caf[_0x41f1('0x16')](_0x408a8b)[_0x41f1('0x18')](_0x3273c3);}};}function respondWithFilteredResult(_0x530b7f,_0x5400a3){return function(_0x36900a){if(_0x36900a){var _0x1710af=_0x36900a[_0x41f1('0x19')],_0x1c2838=_0x5400a3[_0x41f1('0x1a')],_0x24d096=_0x5400a3[_0x41f1('0x1a')]+_0x5400a3[_0x41f1('0x1b')],_0x47a869;if(_0x24d096>=_0x1710af){_0x24d096=_0x1710af;_0x47a869=0xc8;}else{_0x47a869=0xce;}_0x530b7f['status'](_0x47a869);return _0x530b7f[_0x41f1('0x1c')](_0x41f1('0x1d'),_0x1c2838+'-'+_0x24d096+'/'+_0x1710af)[_0x41f1('0x18')](_0x36900a);}return null;};}function patchUpdates(_0x498d11){return function(_0x57ca98){try{jsonpatch['apply'](_0x57ca98,_0x498d11,!![]);}catch(_0xa1c288){return BPromise[_0x41f1('0x1e')](_0xa1c288);}return _0x57ca98['save']();};}function saveUpdates(_0x449f23,_0x164bf7){return function(_0x52b6ff){if(_0x52b6ff){return _0x52b6ff[_0x41f1('0x1f')](_0x449f23)['then'](function(_0x3344ce){return _0x3344ce;});}return null;};}function removeEntity(_0x1499c1,_0x2e318c){return function(_0x29ea4a){if(_0x29ea4a){return _0x29ea4a['destroy']()[_0x41f1('0x20')](function(){_0x1499c1[_0x41f1('0x16')](0xcc)[_0x41f1('0x17')]();});}};}function handleEntityNotFound(_0x55b351,_0x5a9963){return function(_0x3f74a7){if(!_0x3f74a7){_0x55b351[_0x41f1('0x21')](0x194);}return _0x3f74a7;};}function handleError(_0x189f10,_0x1fb709){_0x1fb709=_0x1fb709||0x1f4;return function(_0x509808){logger[_0x41f1('0x22')](_0x509808[_0x41f1('0x23')]);if(_0x509808[_0x41f1('0x24')]){delete _0x509808[_0x41f1('0x24')];}_0x189f10[_0x41f1('0x16')](_0x1fb709)[_0x41f1('0x25')](_0x509808);};}exports[_0x41f1('0x26')]=function(_0x320152,_0xf4b547){var _0x33c3ea={},_0x567a83={},_0x48315b={'count':0x0,'rows':[]};var _0x5cc8d9=_[_0x41f1('0x27')](db[_0x41f1('0x28')][_0x41f1('0x29')],function(_0xb17fe){return{'name':_0xb17fe[_0x41f1('0x2a')],'type':_0xb17fe[_0x41f1('0x2b')][_0x41f1('0x2c')]};});_0x567a83[_0x41f1('0x2d')]=_[_0x41f1('0x27')](_0x5cc8d9,_0x41f1('0x24'));_0x567a83[_0x41f1('0x2e')]=_['keys'](_0x320152[_0x41f1('0x2e')]);_0x567a83[_0x41f1('0x2f')]=_[_0x41f1('0x30')](_0x567a83[_0x41f1('0x2d')],_0x567a83[_0x41f1('0x2e')]);_0x33c3ea['attributes']=_[_0x41f1('0x30')](_0x567a83[_0x41f1('0x2d')],qs[_0x41f1('0x31')](_0x320152[_0x41f1('0x2e')]['fields']));_0x33c3ea[_0x41f1('0x32')]=_0x33c3ea['attributes'][_0x41f1('0x33')]?_0x33c3ea[_0x41f1('0x32')]:_0x567a83[_0x41f1('0x2d')];if(!_0x320152[_0x41f1('0x2e')][_0x41f1('0x34')](_0x41f1('0x35'))){_0x33c3ea[_0x41f1('0x1b')]=qs[_0x41f1('0x1b')](_0x320152[_0x41f1('0x2e')][_0x41f1('0x1b')]);_0x33c3ea['offset']=qs[_0x41f1('0x1a')](_0x320152[_0x41f1('0x2e')][_0x41f1('0x1a')]);}_0x33c3ea[_0x41f1('0x36')]=qs[_0x41f1('0x37')](_0x320152[_0x41f1('0x2e')][_0x41f1('0x37')]);_0x33c3ea[_0x41f1('0x38')]=qs[_0x41f1('0x2f')](_[_0x41f1('0x39')](_0x320152[_0x41f1('0x2e')],_0x567a83['filters']),_0x5cc8d9);if(_0x320152['query']['filter']){_0x33c3ea[_0x41f1('0x38')]=_['merge'](_0x33c3ea['where'],{'$or':_[_0x41f1('0x27')](_0x5cc8d9,function(_0x5d87c8){if(_0x5d87c8['type']!==_0x41f1('0x3a')){var _0x5a8d84={};_0x5a8d84[_0x5d87c8[_0x41f1('0x24')]]={'$like':'%'+_0x320152['query'][_0x41f1('0x3b')]+'%'};return _0x5a8d84;}})});}_0x33c3ea=_[_0x41f1('0x3c')]({},_0x33c3ea,_0x320152[_0x41f1('0x3d')]);var _0x28c0ea={'where':_0x33c3ea['where']};return db[_0x41f1('0x28')]['count'](_0x28c0ea)[_0x41f1('0x20')](function(_0x2871ab){_0x48315b['count']=_0x2871ab;if(_0x320152[_0x41f1('0x2e')][_0x41f1('0x3e')]){_0x33c3ea[_0x41f1('0x3f')]=[{'all':!![]}];}return db[_0x41f1('0x28')][_0x41f1('0x40')](_0x33c3ea);})[_0x41f1('0x20')](function(_0x25b5c3){_0x48315b[_0x41f1('0x41')]=_0x25b5c3;return _0x48315b;})['then'](respondWithFilteredResult(_0xf4b547,_0x33c3ea))[_0x41f1('0x42')](handleError(_0xf4b547,null));};exports[_0x41f1('0x43')]=function(_0x3bc7ef,_0x49f62e){var _0x49a6d5={'raw':!![],'where':{'id':_0x3bc7ef[_0x41f1('0x44')]['id']}},_0x54579f={};_0x54579f[_0x41f1('0x2d')]=_[_0x41f1('0x45')](db['FreshdeskField'][_0x41f1('0x29')]);_0x54579f[_0x41f1('0x2e')]=_[_0x41f1('0x45')](_0x3bc7ef[_0x41f1('0x2e')]);_0x54579f[_0x41f1('0x2f')]=_[_0x41f1('0x30')](_0x54579f[_0x41f1('0x2d')],_0x54579f[_0x41f1('0x2e')]);_0x49a6d5[_0x41f1('0x32')]=_[_0x41f1('0x30')](_0x54579f[_0x41f1('0x2d')],qs[_0x41f1('0x31')](_0x3bc7ef[_0x41f1('0x2e')][_0x41f1('0x31')]));_0x49a6d5['attributes']=_0x49a6d5[_0x41f1('0x32')][_0x41f1('0x33')]?_0x49a6d5[_0x41f1('0x32')]:_0x54579f['model'];if(_0x3bc7ef[_0x41f1('0x2e')]['includeAll']){_0x49a6d5['include']=[{'all':!![]}];}_0x49a6d5=_['merge']({},_0x49a6d5,_0x3bc7ef[_0x41f1('0x3d')]);return db[_0x41f1('0x28')]['find'](_0x49a6d5)['then'](handleEntityNotFound(_0x49f62e,null))[_0x41f1('0x20')](respondWithResult(_0x49f62e,null))[_0x41f1('0x42')](handleError(_0x49f62e,null));};exports[_0x41f1('0x46')]=function(_0x21d3aa,_0x52888c){return db[_0x41f1('0x28')][_0x41f1('0x46')](_0x21d3aa[_0x41f1('0x47')],{})[_0x41f1('0x20')](respondWithResult(_0x52888c,0xc9))['catch'](handleError(_0x52888c,null));};exports[_0x41f1('0x1f')]=function(_0x2c53f5,_0x2b6a8e){if(_0x2c53f5[_0x41f1('0x47')]['id']){delete _0x2c53f5[_0x41f1('0x47')]['id'];}return db['FreshdeskField'][_0x41f1('0x48')]({'where':{'id':_0x2c53f5[_0x41f1('0x44')]['id']}})[_0x41f1('0x20')](handleEntityNotFound(_0x2b6a8e,null))[_0x41f1('0x20')](saveUpdates(_0x2c53f5[_0x41f1('0x47')],null))['then'](respondWithResult(_0x2b6a8e,null))[_0x41f1('0x42')](handleError(_0x2b6a8e,null));};exports[_0x41f1('0x49')]=function(_0x1d1dea,_0xa1e5e1){return db[_0x41f1('0x28')][_0x41f1('0x48')]({'where':{'id':_0x1d1dea[_0x41f1('0x44')]['id']}})['then'](handleEntityNotFound(_0xa1e5e1,null))[_0x41f1('0x20')](removeEntity(_0xa1e5e1,null))[_0x41f1('0x42')](handleError(_0xa1e5e1,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js
index 2bb25bc..4fa91bf 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.model.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1dcd=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshdeskField.attributes','define'];(function(_0x3cfb45,_0x34cfa8){var _0x5dd7ad=function(_0x3b0f69){while(--_0x3b0f69){_0x3cfb45['push'](_0x3cfb45['shift']());}};_0x5dd7ad(++_0x34cfa8);}(_0x1dcd,0xa0));var _0xd1dc=function(_0x136f48,_0x14e54d){_0x136f48=_0x136f48-0x0;var _0x343726=_0x1dcd[_0x136f48];return _0x343726;};'use strict';var _=require('lodash');var util=require(_0xd1dc('0x0'));var logger=require(_0xd1dc('0x1'))(_0xd1dc('0x2'));var moment=require(_0xd1dc('0x3'));var BPromise=require('bluebird');var rp=require(_0xd1dc('0x4'));var fs=require('fs');var path=require(_0xd1dc('0x5'));var rimraf=require('rimraf');var config=require(_0xd1dc('0x6'));var attributes=require(_0xd1dc('0x7'));module['exports']=function(_0x1aa53e,_0x3a6373){return _0x1aa53e[_0xd1dc('0x8')](_0xd1dc('0x9'),attributes,{'tableName':_0xd1dc('0xa'),'paranoid':![],'indexes':[{'name':_0xd1dc('0xb'),'fields':[_0xd1dc('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4883=['idField','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x475145,_0x7558bd){var _0x4e0327=function(_0x46db88){while(--_0x46db88){_0x475145['push'](_0x475145['shift']());}};_0x4e0327(++_0x7558bd);}(_0x4883,0x119));var _0x3488=function(_0x474a17,_0x1b5979){_0x474a17=_0x474a17-0x0;var _0x4dac76=_0x4883[_0x474a17];return _0x4dac76;};'use strict';var _=require(_0x3488('0x0'));var util=require('util');var logger=require(_0x3488('0x1'))('api');var moment=require(_0x3488('0x2'));var BPromise=require(_0x3488('0x3'));var rp=require(_0x3488('0x4'));var fs=require('fs');var path=require(_0x3488('0x5'));var rimraf=require(_0x3488('0x6'));var config=require('../../config/environment');var attributes=require(_0x3488('0x7'));module[_0x3488('0x8')]=function(_0x10b342,_0x14221a){return _0x10b342[_0x3488('0x9')](_0x3488('0xa'),attributes,{'tableName':_0x3488('0xb'),'paranoid':![],'indexes':[{'name':_0x3488('0xc'),'fields':[_0x3488('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js
index db99d47..bdf42b0 100644
--- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js
+++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3ebf20,_0x55ef3b){var _0x786bb3=function(_0x499672){while(--_0x499672){_0x3ebf20['push'](_0x3ebf20['shift']());}};_0x786bb3(++_0x55ef3b);}(_0xb10b,0x12a));var _0xbb10=function(_0x45aa18,_0x412fc5){_0x45aa18=_0x45aa18-0x0;var _0x26119d=_0xb10b[_0x45aa18];return _0x26119d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}
\ No newline at end of file
+var _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x56eaff,_0x3ea7b1){_0x56eaff=_0x56eaff-0x0;var _0x12bd58=_0x7a54[_0x56eaff];return _0x12bd58;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js
index 4e812c3..ae40c90 100644
--- a/server/api/intFreshsalesAccount/index.js
+++ b/server/api/intFreshsalesAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbecb=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','/:id','update','destroy','exports'];(function(_0x5aa147,_0x3ba38f){var _0x59ff19=function(_0x50ee42){while(--_0x50ee42){_0x5aa147['push'](_0x5aa147['shift']());}};_0x59ff19(++_0x3ba38f);}(_0xbecb,0xb0));var _0xbbec=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xbecb[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0xbbec('0x0'));var util=require(_0xbbec('0x1'));var path=require(_0xbbec('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbec('0x3'));var router=express[_0xbbec('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbbec('0x5'));var config=require(_0xbbec('0x6'));var controller=require(_0xbbec('0x7'));router[_0xbbec('0x8')]('/',auth[_0xbbec('0x9')](),controller['index']);router[_0xbbec('0x8')]('/:id',auth[_0xbbec('0x9')](),controller[_0xbbec('0xa')]);router['get'](_0xbbec('0xb'),auth[_0xbbec('0x9')](),controller[_0xbbec('0xc')]);router[_0xbbec('0x8')](_0xbbec('0xd'),auth[_0xbbec('0x9')](),controller[_0xbbec('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbbec('0xf')]);router[_0xbbec('0x10')](_0xbbec('0xb'),auth[_0xbbec('0x9')](),controller['addConfiguration']);router[_0xbbec('0x11')](_0xbbec('0x12'),auth[_0xbbec('0x9')](),controller[_0xbbec('0x13')]);router['delete'](_0xbbec('0x12'),auth['isAuthenticated'](),controller[_0xbbec('0x14')]);module[_0xbbec('0x15')]=router;
\ No newline at end of file
+var _0xe441=['../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3452ce,_0x124927){var _0xee20c5=function(_0x16dceb){while(--_0x16dceb){_0x3452ce['push'](_0x3452ce['shift']());}};_0xee20c5(++_0x124927);}(_0xe441,0xa2));var _0x1e44=function(_0x1106d8,_0x560d5b){_0x1106d8=_0x1106d8-0x0;var _0x129cff=_0xe441[_0x1106d8];return _0x129cff;};'use strict';var multer=require(_0x1e44('0x0'));var util=require(_0x1e44('0x1'));var path=require('path');var timeout=require(_0x1e44('0x2'));var express=require(_0x1e44('0x3'));var router=express[_0x1e44('0x4')]();var auth=require(_0x1e44('0x5'));var interaction=require(_0x1e44('0x6'));var config=require(_0x1e44('0x7'));var controller=require(_0x1e44('0x8'));router[_0x1e44('0x9')]('/',auth[_0x1e44('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1e44('0xb')]);router[_0x1e44('0x9')](_0x1e44('0xc'),auth[_0x1e44('0xa')](),controller['getConfigurations']);router['get'](_0x1e44('0xd'),auth[_0x1e44('0xa')](),controller[_0x1e44('0xe')]);router[_0x1e44('0xf')]('/',auth[_0x1e44('0xa')](),controller[_0x1e44('0x10')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x1e44('0x11')](_0x1e44('0x12'),auth[_0x1e44('0xa')](),controller['update']);router[_0x1e44('0x13')]('/:id',auth[_0x1e44('0xa')](),controller[_0x1e44('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
index e225b98..b80bcbd 100644
--- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
+++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a03=['exports','STRING','username'];(function(_0x5f2637,_0x1eec28){var _0x4c1c9d=function(_0x5e3782){while(--_0x5e3782){_0x5f2637['push'](_0x5f2637['shift']());}};_0x4c1c9d(++_0x1eec28);}(_0x4a03,0x16e));var _0x34a0=function(_0x57be4c,_0x170051){_0x57be4c=_0x57be4c-0x0;var _0x191de4=_0x4a03[_0x57be4c];return _0x191de4;};'use strict';var Sequelize=require('sequelize');module[_0x34a0('0x0')]={'name':{'type':Sequelize[_0x34a0('0x1')]},'description':{'type':Sequelize[_0x34a0('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x34a0('0x2')},'apiKey':{'type':Sequelize[_0x34a0('0x1')]},'remoteUri':{'type':Sequelize[_0x34a0('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x34a0('0x1')]}};
\ No newline at end of file
+var _0xbedb=['STRING','remoteUri','sequelize'];(function(_0x35072d,_0x3c788e){var _0x25681a=function(_0x22c1c5){while(--_0x22c1c5){_0x35072d['push'](_0x35072d['shift']());}};_0x25681a(++_0x3c788e);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbbed('0x0'));module['exports']={'name':{'type':Sequelize[_0xbbed('0x1')]},'description':{'type':Sequelize[_0xbbed('0x1')]},'username':{'type':Sequelize[_0xbbed('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbbed('0x1')],'unique':_0xbbed('0x2')},'serverUrl':{'type':Sequelize[_0xbbed('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
index 1e7c3bd..edcf3f9 100644
--- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
+++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x664c=['format','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','destroy','name','send','index','map','FreshsalesAccount','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','rows','keys','create','body','find','params','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','FreshsalesField','getFields','remoteUri','username','substring','GET'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x664c,0x1ad));var _0xc664=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x664c[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xc664('0x0'));var emlformat=require(_0xc664('0x1'));var rimraf=require(_0xc664('0x2'));var zipdir=require(_0xc664('0x3'));var jsonpatch=require(_0xc664('0x4'));var rp=require(_0xc664('0x5'));var moment=require('moment');var BPromise=require(_0xc664('0x6'));var Mustache=require(_0xc664('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc664('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc664('0x9'));var squel=require('squel');var crypto=require(_0xc664('0xa'));var jsforce=require(_0xc664('0xb'));var deskjs=require(_0xc664('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc664('0xd'));var Papa=require(_0xc664('0xe'));var Redis=require(_0xc664('0xf'));var authService=require(_0xc664('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc664('0x11'));var hardwareService=require(_0xc664('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc664('0x13'));var db=require(_0xc664('0x14'))['db'];var integrations=require(_0xc664('0x15'));var jayson=require(_0xc664('0x16'));var client=jayson[_0xc664('0x17')][_0xc664('0x18')]({'port':0x232a});function checkPasswordPattern(_0x47b5c0,_0x4be781,_0x45517b){if(_0x45517b){var _0x4eeed2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4eeed2[_0xc664('0x19')](_0x4be781)){return _0x47b5c0;}else{throw new db[(_0xc664('0x1a'))][(_0xc664('0x1b'))](_0xc664('0x1c'));}}else{return _0x47b5c0;}}function respondWithRpcPromise(_0x48f0d7,_0x3eef7f,_0x196b82,_0x1ee774){return new BPromise(function(_0x574754,_0x126a67){var _0x14ed88=_0x1ee774||client;return _0x14ed88[_0xc664('0x1d')](_0x48f0d7,_0x196b82)[_0xc664('0x1e')](function(_0xb2751e){logger[_0xc664('0x1f')]('FreshsalesAccount,\x20%s,\x20%s',_0x3eef7f,_0xc664('0x20'));logger[_0xc664('0x21')](_0xc664('0x22'),_0x3eef7f,_0xc664('0x20'),JSON[_0xc664('0x23')](_0xb2751e));if(_0xb2751e[_0xc664('0x24')]){if(_0xb2751e[_0xc664('0x24')][_0xc664('0x25')]===0x1f4){logger['error'](_0xc664('0x26'),_0x3eef7f,_0xb2751e['error'][_0xc664('0x27')]);return _0x126a67(_0xb2751e['error']['message']);}logger[_0xc664('0x24')](_0xc664('0x26'),_0x3eef7f,_0xb2751e[_0xc664('0x24')][_0xc664('0x27')]);return _0x574754(_0xb2751e[_0xc664('0x24')][_0xc664('0x27')]);}else{logger[_0xc664('0x1f')](_0xc664('0x26'),_0x3eef7f,_0xc664('0x20'));_0x574754(_0xb2751e[_0xc664('0x28')][_0xc664('0x27')]);}})[_0xc664('0x29')](function(_0x834e9a){logger[_0xc664('0x24')](_0xc664('0x26'),_0x3eef7f,_0x834e9a);_0x126a67(_0x834e9a);});});}function respondWithStatusCode(_0xfcfd1e,_0x86adef){_0x86adef=_0x86adef||0xcc;return function(_0x4cf3d4){if(_0x4cf3d4){return _0xfcfd1e[_0xc664('0x2a')](_0x86adef);}return _0xfcfd1e[_0xc664('0x2b')](_0x86adef)[_0xc664('0x2c')]();};}function respondWithResult(_0x5eeb0d,_0xc0229e){_0xc0229e=_0xc0229e||0xc8;return function(_0x299310){if(_0x299310){return _0x5eeb0d[_0xc664('0x2b')](_0xc0229e)['json'](_0x299310);}};}function respondWithFilteredResult(_0x48c183,_0x2c4f22){return function(_0x2657f1){if(_0x2657f1){var _0x35b228=_0x2657f1['count'],_0x1551fe=_0x2c4f22['offset'],_0x479743=_0x2c4f22[_0xc664('0x2d')]+_0x2c4f22[_0xc664('0x2e')],_0x217ad0;if(_0x479743>=_0x35b228){_0x479743=_0x35b228;_0x217ad0=0xc8;}else{_0x217ad0=0xce;}_0x48c183[_0xc664('0x2b')](_0x217ad0);return _0x48c183[_0xc664('0x2f')]('Content-Range',_0x1551fe+'-'+_0x479743+'/'+_0x35b228)[_0xc664('0x30')](_0x2657f1);}return null;};}function patchUpdates(_0x532874){return function(_0x5649cc){try{jsonpatch[_0xc664('0x31')](_0x5649cc,_0x532874,!![]);}catch(_0x4275f9){return BPromise[_0xc664('0x32')](_0x4275f9);}return _0x5649cc[_0xc664('0x33')]();};}function saveUpdates(_0x4bcbe1,_0x1abfc6){return function(_0x35c7f6){if(_0x35c7f6){return _0x35c7f6[_0xc664('0x34')](_0x4bcbe1)[_0xc664('0x1e')](function(_0x2ad113){return _0x2ad113;});}return null;};}function removeEntity(_0x48bb16,_0x1107a2){return function(_0x464c6f){if(_0x464c6f){return _0x464c6f[_0xc664('0x35')]()[_0xc664('0x1e')](function(){_0x48bb16[_0xc664('0x2b')](0xcc)[_0xc664('0x2c')]();});}};}function handleEntityNotFound(_0x403d72,_0x121cce){return function(_0x25918a){if(!_0x25918a){_0x403d72[_0xc664('0x2a')](0x194);}return _0x25918a;};}function handleError(_0x3de0c5,_0x2088ed){_0x2088ed=_0x2088ed||0x1f4;return function(_0x1cc44f){logger[_0xc664('0x24')](_0x1cc44f['stack']);if(_0x1cc44f[_0xc664('0x36')]){delete _0x1cc44f[_0xc664('0x36')];}_0x3de0c5[_0xc664('0x2b')](_0x2088ed)[_0xc664('0x37')](_0x1cc44f);};}exports[_0xc664('0x38')]=function(_0x4cdba3,_0x539334){var _0xbd1259={},_0x374415={},_0xe3d3c={'count':0x0,'rows':[]};var _0x3754ee=_[_0xc664('0x39')](db[_0xc664('0x3a')][_0xc664('0x3b')],function(_0x476377){return{'name':_0x476377['fieldName'],'type':_0x476377[_0xc664('0x3c')][_0xc664('0x3d')]};});_0x374415['model']=_[_0xc664('0x39')](_0x3754ee,_0xc664('0x36'));_0x374415[_0xc664('0x3e')]=_['keys'](_0x4cdba3['query']);_0x374415[_0xc664('0x3f')]=_[_0xc664('0x40')](_0x374415[_0xc664('0x41')],_0x374415[_0xc664('0x3e')]);_0xbd1259['attributes']=_[_0xc664('0x40')](_0x374415['model'],qs[_0xc664('0x42')](_0x4cdba3[_0xc664('0x3e')][_0xc664('0x42')]));_0xbd1259[_0xc664('0x43')]=_0xbd1259['attributes'][_0xc664('0x44')]?_0xbd1259[_0xc664('0x43')]:_0x374415[_0xc664('0x41')];if(!_0x4cdba3[_0xc664('0x3e')][_0xc664('0x45')]('nolimit')){_0xbd1259[_0xc664('0x2e')]=qs[_0xc664('0x2e')](_0x4cdba3[_0xc664('0x3e')][_0xc664('0x2e')]);_0xbd1259[_0xc664('0x2d')]=qs[_0xc664('0x2d')](_0x4cdba3[_0xc664('0x3e')][_0xc664('0x2d')]);}_0xbd1259[_0xc664('0x46')]=qs[_0xc664('0x47')](_0x4cdba3[_0xc664('0x3e')]['sort']);_0xbd1259[_0xc664('0x48')]=qs[_0xc664('0x3f')](_['pick'](_0x4cdba3['query'],_0x374415[_0xc664('0x3f')]),_0x3754ee);if(_0x4cdba3['query'][_0xc664('0x49')]){_0xbd1259[_0xc664('0x48')]=_[_0xc664('0x4a')](_0xbd1259[_0xc664('0x48')],{'$or':_[_0xc664('0x39')](_0x3754ee,function(_0x1708d4){if(_0x1708d4[_0xc664('0x3c')]!==_0xc664('0x4b')){var _0x944944={};_0x944944[_0x1708d4['name']]={'$like':'%'+_0x4cdba3['query'][_0xc664('0x49')]+'%'};return _0x944944;}})});}_0xbd1259=_[_0xc664('0x4a')]({},_0xbd1259,_0x4cdba3[_0xc664('0x4c')]);var _0x5603ec={'where':_0xbd1259['where']};return db[_0xc664('0x3a')][_0xc664('0x4d')](_0x5603ec)[_0xc664('0x1e')](function(_0x2b155c){_0xe3d3c[_0xc664('0x4d')]=_0x2b155c;if(_0x4cdba3['query'][_0xc664('0x4e')]){_0xbd1259[_0xc664('0x4f')]=[{'all':!![]}];}return db[_0xc664('0x3a')]['findAll'](_0xbd1259);})['then'](function(_0x2b1ff6){_0xe3d3c[_0xc664('0x50')]=_0x2b1ff6;return _0xe3d3c;})[_0xc664('0x1e')](respondWithFilteredResult(_0x539334,_0xbd1259))['catch'](handleError(_0x539334,null));};exports['show']=function(_0x49c450,_0x7b2641){var _0x236779={'raw':![],'where':{'id':_0x49c450['params']['id']}},_0x1b4e1d={};_0x1b4e1d[_0xc664('0x41')]=_[_0xc664('0x51')](db[_0xc664('0x3a')]['rawAttributes']);_0x1b4e1d[_0xc664('0x3e')]=_[_0xc664('0x51')](_0x49c450[_0xc664('0x3e')]);_0x1b4e1d[_0xc664('0x3f')]=_['intersection'](_0x1b4e1d['model'],_0x1b4e1d[_0xc664('0x3e')]);_0x236779[_0xc664('0x43')]=_[_0xc664('0x40')](_0x1b4e1d['model'],qs[_0xc664('0x42')](_0x49c450[_0xc664('0x3e')][_0xc664('0x42')]));_0x236779['attributes']=_0x236779[_0xc664('0x43')][_0xc664('0x44')]?_0x236779[_0xc664('0x43')]:_0x1b4e1d['model'];if(_0x49c450['query'][_0xc664('0x4e')]){_0x236779['include']=[{'all':!![]}];}_0x236779=_[_0xc664('0x4a')]({},_0x236779,_0x49c450[_0xc664('0x4c')]);return db[_0xc664('0x3a')]['find'](_0x236779)[_0xc664('0x1e')](handleEntityNotFound(_0x7b2641,null))[_0xc664('0x1e')](respondWithResult(_0x7b2641,null))[_0xc664('0x29')](handleError(_0x7b2641,null));};exports[_0xc664('0x52')]=function(_0x1f2a4a,_0x59d410){return db['FreshsalesAccount']['create'](_0x1f2a4a['body'],{})[_0xc664('0x1e')](respondWithResult(_0x59d410,0xc9))[_0xc664('0x29')](handleError(_0x59d410,null));};exports[_0xc664('0x34')]=function(_0x5d0e62,_0x2ecd43){if(_0x5d0e62[_0xc664('0x53')]['id']){delete _0x5d0e62['body']['id'];}return db[_0xc664('0x3a')][_0xc664('0x54')]({'where':{'id':_0x5d0e62[_0xc664('0x55')]['id']}})[_0xc664('0x1e')](handleEntityNotFound(_0x2ecd43,null))[_0xc664('0x1e')](saveUpdates(_0x5d0e62['body'],null))[_0xc664('0x1e')](respondWithResult(_0x2ecd43,null))[_0xc664('0x29')](handleError(_0x2ecd43,null));};exports[_0xc664('0x35')]=function(_0xade90,_0x3ee750){return db[_0xc664('0x3a')][_0xc664('0x54')]({'where':{'id':_0xade90[_0xc664('0x55')]['id']}})[_0xc664('0x1e')](handleEntityNotFound(_0x3ee750,null))[_0xc664('0x1e')](removeEntity(_0x3ee750,null))['catch'](handleError(_0x3ee750,null));};exports[_0xc664('0x56')]=function(_0x375d14,_0x33fd9b,_0x364f70){var _0x2970c6={};var _0x39d12c={};var _0x2582b5;var _0x41a0fb;return db[_0xc664('0x3a')][_0xc664('0x57')]({'where':{'id':_0x375d14[_0xc664('0x55')]['id']}})[_0xc664('0x1e')](handleEntityNotFound(_0x33fd9b,null))['then'](function(_0x2a9234){if(_0x2a9234){_0x2582b5=_0x2a9234;_0x39d12c['model']=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x39d12c[_0xc664('0x3e')]=_[_0xc664('0x51')](_0x375d14['query']);_0x39d12c['filters']=_[_0xc664('0x40')](_0x39d12c[_0xc664('0x41')],_0x39d12c[_0xc664('0x3e')]);_0x2970c6['attributes']=_[_0xc664('0x40')](_0x39d12c[_0xc664('0x41')],qs[_0xc664('0x42')](_0x375d14[_0xc664('0x3e')][_0xc664('0x42')]));_0x2970c6[_0xc664('0x43')]=_0x2970c6[_0xc664('0x43')]['length']?_0x2970c6[_0xc664('0x43')]:_0x39d12c[_0xc664('0x41')];_0x2970c6[_0xc664('0x46')]=qs[_0xc664('0x47')](_0x375d14['query'][_0xc664('0x47')]);_0x2970c6['where']=qs[_0xc664('0x3f')](_['pick'](_0x375d14[_0xc664('0x3e')],_0x39d12c[_0xc664('0x3f')]));if(_0x375d14[_0xc664('0x3e')]['filter']){_0x2970c6[_0xc664('0x48')]=_[_0xc664('0x4a')](_0x2970c6[_0xc664('0x48')],{'$or':_[_0xc664('0x39')](_0x2970c6['attributes'],function(_0x2a40ec){var _0x42f8b7={};_0x42f8b7[_0x2a40ec]={'$like':'%'+_0x375d14['query'][_0xc664('0x49')]+'%'};return _0x42f8b7;})});}_0x2970c6=_[_0xc664('0x4a')]({},_0x2970c6,_0x375d14[_0xc664('0x4c')]);return _0x2582b5['getConfigurations'](_0x2970c6);}})[_0xc664('0x1e')](function(_0x2856fd){if(_0x2856fd){_0x41a0fb=_0x2856fd['length'];if(!_0x375d14[_0xc664('0x3e')]['hasOwnProperty'](_0xc664('0x58'))){_0x2970c6[_0xc664('0x2e')]=qs[_0xc664('0x2e')](_0x375d14[_0xc664('0x3e')][_0xc664('0x2e')]);_0x2970c6['offset']=qs[_0xc664('0x2d')](_0x375d14[_0xc664('0x3e')][_0xc664('0x2d')]);}return _0x2582b5[_0xc664('0x56')](_0x2970c6);}})[_0xc664('0x1e')](function(_0x43aa4a){if(_0x43aa4a){return _0x43aa4a?{'count':_0x41a0fb,'rows':_0x43aa4a}:null;}})[_0xc664('0x1e')](respondWithResult(_0x33fd9b,null))[_0xc664('0x29')](handleError(_0x33fd9b,null));};exports[_0xc664('0x59')]=function(_0x362189,_0xccfaf0,_0x578ed6){if(_0x362189[_0xc664('0x53')]['id']){delete _0x362189[_0xc664('0x53')]['id'];}return db[_0xc664('0x3a')][_0xc664('0x57')]({'where':{'id':_0x362189[_0xc664('0x55')]['id']}})[_0xc664('0x1e')](handleEntityNotFound(_0xccfaf0,null))[_0xc664('0x1e')](function(_0x2e9619){if(_0x2e9619){_0x362189['body'][_0xc664('0x5a')]=_0x2e9619['id'];_0x362189['body'][_0xc664('0x5b')]=integrations[_0xc664('0x5c')](_0x362189[_0xc664('0x53')]['channel'],_0x362189[_0xc664('0x53')]['type']);_0x362189[_0xc664('0x53')][_0xc664('0x5d')]=integrations['getDescriptions'](_0x362189[_0xc664('0x53')][_0xc664('0x5e')],_0x362189[_0xc664('0x53')][_0xc664('0x3c')]);return db['FreshsalesConfiguration']['create'](_0x362189[_0xc664('0x53')],{'include':[{'model':db[_0xc664('0x5f')],'as':_0xc664('0x5b')},{'model':db['FreshsalesField'],'as':_0xc664('0x5d')}]});}return null;})[_0xc664('0x1e')](respondWithResult(_0xccfaf0,null))['catch'](handleError(_0xccfaf0,null));};exports[_0xc664('0x60')]=function(_0xd141c6,_0x353014,_0x43a261){var _0x279d4d='';var _0x1b0631='';return db[_0xc664('0x3a')]['findOne']({'where':{'id':_0xd141c6[_0xc664('0x55')]['id']},'attributes':['id','username',_0xc664('0x61'),'apiKey']})[_0xc664('0x1e')](handleEntityNotFound(_0x353014,null))[_0xc664('0x1e')](function(_0x814de0){if(_0x814de0){_0x1b0631=_0x814de0[_0xc664('0x62')];_0x279d4d=_0x814de0['remoteUri'];var _0x401a93=_0x814de0[_0xc664('0x61')]['slice'](-0x1);if(_0x401a93==='/'){_0x279d4d=_0x279d4d[_0xc664('0x63')](0x0,_0x279d4d['lastIndexOf'](_0x401a93));}return rp({'method':_0xc664('0x64'),'uri':util[_0xc664('0x65')]('%s%s',_0x279d4d,'/api/selector/owners'),'headers':{'Authorization':_0xc664('0x66')+_0x814de0['apiKey']},'json':!![]});}})[_0xc664('0x1e')](function(_0x40a947){if(_0x40a947){var _0x31bc9c=_0x40a947['users'];var _0x2160f1=![];var _0x14842d=null;for(_0x14842d=0x0;_0x14842d<_0x31bc9c[_0xc664('0x44')];_0x14842d++){if(_0x31bc9c[_0x14842d][_0xc664('0x67')]===_0x1b0631){_0x2160f1=!![];}}if(_0x2160f1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc664('0x68')});}}})['then'](respondWithResult(_0x353014,null))['catch'](function(_0x10911c){var _0x220b17=_0xd141c6[_0xc664('0x3e')][_0xc664('0x19')]?0x1f4:_0x10911c[_0xc664('0x69')]||0x1f4;logger[_0xc664('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xc664('0x60'),_0x220b17,JSON[_0xc664('0x23')](_0x10911c));delete _0x10911c[_0xc664('0x36')];if(_0x220b17===0x191){_0x220b17=0x190;}_0x353014[_0xc664('0x2b')](_0x220b17)[_0xc664('0x37')](_0xd141c6[_0xc664('0x3e')][_0xc664('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x10911c['statusCode']}:_0x10911c);});};
\ No newline at end of file
+var _0x3110=['code','message','info','result','end','status','json','offset','set','Content-Range','apply','save','update','sendStatus','name','send','index','FreshsalesAccount','type','key','model','map','query','filters','intersection','attributes','fields','length','limit','order','sort','filter','where','VIRTUAL','merge','options','count','findAll','rows','show','params','keys','include','find','catch','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','rawAttributes','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','/api/selector/owners','email','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x337f8b,_0x452e07){var _0x1afaeb=function(_0x50c05e){while(--_0x50c05e){_0x337f8b['push'](_0x337f8b['shift']());}};_0x1afaeb(++_0x452e07);}(_0x3110,0xbe));var _0x0311=function(_0x49937f,_0x3f1c06){_0x49937f=_0x49937f-0x0;var _0x1c6290=_0x3110[_0x49937f];return _0x1c6290;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0311('0x0'));var rimraf=require(_0x0311('0x1'));var zipdir=require(_0x0311('0x2'));var jsonpatch=require(_0x0311('0x3'));var rp=require(_0x0311('0x4'));var moment=require('moment');var BPromise=require(_0x0311('0x5'));var Mustache=require(_0x0311('0x6'));var util=require(_0x0311('0x7'));var path=require('path');var sox=require(_0x0311('0x8'));var csv=require(_0x0311('0x9'));var ejs=require(_0x0311('0xa'));var fs=require('fs');var _=require(_0x0311('0xb'));var squel=require(_0x0311('0xc'));var crypto=require(_0x0311('0xd'));var jsforce=require(_0x0311('0xe'));var deskjs=require(_0x0311('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0311('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0311('0x11'));var as=require(_0x0311('0x12'));var hardwareService=require(_0x0311('0x13'));var logger=require(_0x0311('0x14'))(_0x0311('0x15'));var utils=require(_0x0311('0x16'));var config=require(_0x0311('0x17'));var db=require(_0x0311('0x18'))['db'];var integrations=require(_0x0311('0x19'));var jayson=require(_0x0311('0x1a'));var client=jayson[_0x0311('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x34fd14,_0x42e9af,_0x5b4e02){if(_0x5b4e02){var _0x22f9ac=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22f9ac[_0x0311('0x1c')](_0x42e9af)){return _0x34fd14;}else{throw new db[(_0x0311('0x1d'))]['ValidationError'](_0x0311('0x1e'));}}else{return _0x34fd14;}}function respondWithRpcPromise(_0x5aa4d4,_0x26a927,_0x4d7f4d,_0x53a42f){return new BPromise(function(_0x535ce9,_0x1e2e73){var _0x1febe0=_0x53a42f||client;return _0x1febe0[_0x0311('0x1f')](_0x5aa4d4,_0x4d7f4d)[_0x0311('0x20')](function(_0x18dda4){logger['info'](_0x0311('0x21'),_0x26a927,_0x0311('0x22'));logger[_0x0311('0x23')](_0x0311('0x24'),_0x26a927,_0x0311('0x22'),JSON['stringify'](_0x18dda4));if(_0x18dda4[_0x0311('0x25')]){if(_0x18dda4[_0x0311('0x25')][_0x0311('0x26')]===0x1f4){logger[_0x0311('0x25')](_0x0311('0x21'),_0x26a927,_0x18dda4[_0x0311('0x25')][_0x0311('0x27')]);return _0x1e2e73(_0x18dda4[_0x0311('0x25')][_0x0311('0x27')]);}logger['error'](_0x0311('0x21'),_0x26a927,_0x18dda4[_0x0311('0x25')][_0x0311('0x27')]);return _0x535ce9(_0x18dda4[_0x0311('0x25')][_0x0311('0x27')]);}else{logger[_0x0311('0x28')]('FreshsalesAccount,\x20%s,\x20%s',_0x26a927,_0x0311('0x22'));_0x535ce9(_0x18dda4[_0x0311('0x29')]['message']);}})['catch'](function(_0x9e07dc){logger[_0x0311('0x25')](_0x0311('0x21'),_0x26a927,_0x9e07dc);_0x1e2e73(_0x9e07dc);});});}function respondWithStatusCode(_0x560c42,_0x55c725){_0x55c725=_0x55c725||0xcc;return function(_0x2de701){if(_0x2de701){return _0x560c42['sendStatus'](_0x55c725);}return _0x560c42['status'](_0x55c725)[_0x0311('0x2a')]();};}function respondWithResult(_0x273469,_0x48a9cc){_0x48a9cc=_0x48a9cc||0xc8;return function(_0x284c50){if(_0x284c50){return _0x273469[_0x0311('0x2b')](_0x48a9cc)[_0x0311('0x2c')](_0x284c50);}};}function respondWithFilteredResult(_0x10357a,_0x5bf04e){return function(_0x526b5c){if(_0x526b5c){var _0x1b2b33=_0x526b5c['count'],_0x101762=_0x5bf04e['offset'],_0x518cc4=_0x5bf04e[_0x0311('0x2d')]+_0x5bf04e['limit'],_0x523c9b;if(_0x518cc4>=_0x1b2b33){_0x518cc4=_0x1b2b33;_0x523c9b=0xc8;}else{_0x523c9b=0xce;}_0x10357a[_0x0311('0x2b')](_0x523c9b);return _0x10357a[_0x0311('0x2e')](_0x0311('0x2f'),_0x101762+'-'+_0x518cc4+'/'+_0x1b2b33)[_0x0311('0x2c')](_0x526b5c);}return null;};}function patchUpdates(_0x5bf8d9){return function(_0x1dbc83){try{jsonpatch[_0x0311('0x30')](_0x1dbc83,_0x5bf8d9,!![]);}catch(_0x95fdcb){return BPromise['reject'](_0x95fdcb);}return _0x1dbc83[_0x0311('0x31')]();};}function saveUpdates(_0x44838f,_0x3fb6ac){return function(_0x40a83b){if(_0x40a83b){return _0x40a83b[_0x0311('0x32')](_0x44838f)['then'](function(_0x487702){return _0x487702;});}return null;};}function removeEntity(_0x173578,_0x45daaa){return function(_0xb1ae2a){if(_0xb1ae2a){return _0xb1ae2a['destroy']()[_0x0311('0x20')](function(){_0x173578[_0x0311('0x2b')](0xcc)[_0x0311('0x2a')]();});}};}function handleEntityNotFound(_0x365b52,_0x1a1a87){return function(_0x513920){if(!_0x513920){_0x365b52[_0x0311('0x33')](0x194);}return _0x513920;};}function handleError(_0x17f705,_0x59d500){_0x59d500=_0x59d500||0x1f4;return function(_0x32052a){logger['error'](_0x32052a['stack']);if(_0x32052a[_0x0311('0x34')]){delete _0x32052a[_0x0311('0x34')];}_0x17f705['status'](_0x59d500)[_0x0311('0x35')](_0x32052a);};}exports[_0x0311('0x36')]=function(_0x41d49a,_0x49167c){var _0x5d6b86={},_0x469f88={},_0x2cd217={'count':0x0,'rows':[]};var _0x49f0ec=_['map'](db[_0x0311('0x37')]['rawAttributes'],function(_0x1df400){return{'name':_0x1df400['fieldName'],'type':_0x1df400[_0x0311('0x38')][_0x0311('0x39')]};});_0x469f88[_0x0311('0x3a')]=_[_0x0311('0x3b')](_0x49f0ec,_0x0311('0x34'));_0x469f88[_0x0311('0x3c')]=_['keys'](_0x41d49a['query']);_0x469f88[_0x0311('0x3d')]=_[_0x0311('0x3e')](_0x469f88['model'],_0x469f88[_0x0311('0x3c')]);_0x5d6b86[_0x0311('0x3f')]=_[_0x0311('0x3e')](_0x469f88[_0x0311('0x3a')],qs[_0x0311('0x40')](_0x41d49a[_0x0311('0x3c')]['fields']));_0x5d6b86[_0x0311('0x3f')]=_0x5d6b86['attributes'][_0x0311('0x41')]?_0x5d6b86[_0x0311('0x3f')]:_0x469f88['model'];if(!_0x41d49a[_0x0311('0x3c')]['hasOwnProperty']('nolimit')){_0x5d6b86[_0x0311('0x42')]=qs[_0x0311('0x42')](_0x41d49a[_0x0311('0x3c')][_0x0311('0x42')]);_0x5d6b86[_0x0311('0x2d')]=qs[_0x0311('0x2d')](_0x41d49a[_0x0311('0x3c')][_0x0311('0x2d')]);}_0x5d6b86[_0x0311('0x43')]=qs[_0x0311('0x44')](_0x41d49a[_0x0311('0x3c')][_0x0311('0x44')]);_0x5d6b86['where']=qs[_0x0311('0x3d')](_['pick'](_0x41d49a[_0x0311('0x3c')],_0x469f88[_0x0311('0x3d')]),_0x49f0ec);if(_0x41d49a['query'][_0x0311('0x45')]){_0x5d6b86[_0x0311('0x46')]=_['merge'](_0x5d6b86[_0x0311('0x46')],{'$or':_[_0x0311('0x3b')](_0x49f0ec,function(_0x13989e){if(_0x13989e[_0x0311('0x38')]!==_0x0311('0x47')){var _0x5be791={};_0x5be791[_0x13989e['name']]={'$like':'%'+_0x41d49a[_0x0311('0x3c')]['filter']+'%'};return _0x5be791;}})});}_0x5d6b86=_[_0x0311('0x48')]({},_0x5d6b86,_0x41d49a[_0x0311('0x49')]);var _0x4543ca={'where':_0x5d6b86[_0x0311('0x46')]};return db[_0x0311('0x37')][_0x0311('0x4a')](_0x4543ca)['then'](function(_0xb5222d){_0x2cd217[_0x0311('0x4a')]=_0xb5222d;if(_0x41d49a[_0x0311('0x3c')]['includeAll']){_0x5d6b86['include']=[{'all':!![]}];}return db[_0x0311('0x37')][_0x0311('0x4b')](_0x5d6b86);})[_0x0311('0x20')](function(_0x5da9dd){_0x2cd217[_0x0311('0x4c')]=_0x5da9dd;return _0x2cd217;})[_0x0311('0x20')](respondWithFilteredResult(_0x49167c,_0x5d6b86))['catch'](handleError(_0x49167c,null));};exports[_0x0311('0x4d')]=function(_0x4fc6ec,_0x92596e){var _0x168c77={'raw':![],'where':{'id':_0x4fc6ec[_0x0311('0x4e')]['id']}},_0x12eee9={};_0x12eee9[_0x0311('0x3a')]=_[_0x0311('0x4f')](db[_0x0311('0x37')]['rawAttributes']);_0x12eee9[_0x0311('0x3c')]=_[_0x0311('0x4f')](_0x4fc6ec['query']);_0x12eee9[_0x0311('0x3d')]=_['intersection'](_0x12eee9[_0x0311('0x3a')],_0x12eee9[_0x0311('0x3c')]);_0x168c77[_0x0311('0x3f')]=_[_0x0311('0x3e')](_0x12eee9[_0x0311('0x3a')],qs['fields'](_0x4fc6ec['query']['fields']));_0x168c77[_0x0311('0x3f')]=_0x168c77[_0x0311('0x3f')][_0x0311('0x41')]?_0x168c77[_0x0311('0x3f')]:_0x12eee9[_0x0311('0x3a')];if(_0x4fc6ec[_0x0311('0x3c')]['includeAll']){_0x168c77[_0x0311('0x50')]=[{'all':!![]}];}_0x168c77=_['merge']({},_0x168c77,_0x4fc6ec[_0x0311('0x49')]);return db[_0x0311('0x37')][_0x0311('0x51')](_0x168c77)['then'](handleEntityNotFound(_0x92596e,null))['then'](respondWithResult(_0x92596e,null))[_0x0311('0x52')](handleError(_0x92596e,null));};exports[_0x0311('0x53')]=function(_0x38d4bb,_0x304816){return db[_0x0311('0x37')][_0x0311('0x53')](_0x38d4bb[_0x0311('0x54')],{})['then'](respondWithResult(_0x304816,0xc9))[_0x0311('0x52')](handleError(_0x304816,null));};exports[_0x0311('0x32')]=function(_0x572045,_0x590aa7){if(_0x572045[_0x0311('0x54')]['id']){delete _0x572045[_0x0311('0x54')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x572045['params']['id']}})[_0x0311('0x20')](handleEntityNotFound(_0x590aa7,null))['then'](saveUpdates(_0x572045['body'],null))[_0x0311('0x20')](respondWithResult(_0x590aa7,null))[_0x0311('0x52')](handleError(_0x590aa7,null));};exports[_0x0311('0x55')]=function(_0x250edf,_0x5f3b04){return db[_0x0311('0x37')][_0x0311('0x51')]({'where':{'id':_0x250edf['params']['id']}})['then'](handleEntityNotFound(_0x5f3b04,null))[_0x0311('0x20')](removeEntity(_0x5f3b04,null))[_0x0311('0x52')](handleError(_0x5f3b04,null));};exports[_0x0311('0x56')]=function(_0x3871d6,_0x39502a,_0x323568){var _0x26b16e={};var _0x112e43={};var _0x52801e;var _0x198fba;return db[_0x0311('0x37')][_0x0311('0x57')]({'where':{'id':_0x3871d6[_0x0311('0x4e')]['id']}})[_0x0311('0x20')](handleEntityNotFound(_0x39502a,null))[_0x0311('0x20')](function(_0x1a6bc3){if(_0x1a6bc3){_0x52801e=_0x1a6bc3;_0x112e43[_0x0311('0x3a')]=_['keys'](db[_0x0311('0x58')][_0x0311('0x59')]);_0x112e43[_0x0311('0x3c')]=_[_0x0311('0x4f')](_0x3871d6[_0x0311('0x3c')]);_0x112e43[_0x0311('0x3d')]=_['intersection'](_0x112e43[_0x0311('0x3a')],_0x112e43[_0x0311('0x3c')]);_0x26b16e[_0x0311('0x3f')]=_[_0x0311('0x3e')](_0x112e43[_0x0311('0x3a')],qs[_0x0311('0x40')](_0x3871d6[_0x0311('0x3c')][_0x0311('0x40')]));_0x26b16e[_0x0311('0x3f')]=_0x26b16e[_0x0311('0x3f')][_0x0311('0x41')]?_0x26b16e[_0x0311('0x3f')]:_0x112e43['model'];_0x26b16e[_0x0311('0x43')]=qs[_0x0311('0x44')](_0x3871d6['query'][_0x0311('0x44')]);_0x26b16e[_0x0311('0x46')]=qs[_0x0311('0x3d')](_[_0x0311('0x5a')](_0x3871d6['query'],_0x112e43[_0x0311('0x3d')]));if(_0x3871d6[_0x0311('0x3c')][_0x0311('0x45')]){_0x26b16e[_0x0311('0x46')]=_['merge'](_0x26b16e[_0x0311('0x46')],{'$or':_['map'](_0x26b16e[_0x0311('0x3f')],function(_0x1b68a7){var _0xa61841={};_0xa61841[_0x1b68a7]={'$like':'%'+_0x3871d6[_0x0311('0x3c')][_0x0311('0x45')]+'%'};return _0xa61841;})});}_0x26b16e=_['merge']({},_0x26b16e,_0x3871d6[_0x0311('0x49')]);return _0x52801e[_0x0311('0x56')](_0x26b16e);}})['then'](function(_0x23fcce){if(_0x23fcce){_0x198fba=_0x23fcce[_0x0311('0x41')];if(!_0x3871d6[_0x0311('0x3c')][_0x0311('0x5b')](_0x0311('0x5c'))){_0x26b16e[_0x0311('0x42')]=qs[_0x0311('0x42')](_0x3871d6[_0x0311('0x3c')][_0x0311('0x42')]);_0x26b16e[_0x0311('0x2d')]=qs['offset'](_0x3871d6[_0x0311('0x3c')]['offset']);}return _0x52801e[_0x0311('0x56')](_0x26b16e);}})[_0x0311('0x20')](function(_0x3d532b){if(_0x3d532b){return _0x3d532b?{'count':_0x198fba,'rows':_0x3d532b}:null;}})[_0x0311('0x20')](respondWithResult(_0x39502a,null))[_0x0311('0x52')](handleError(_0x39502a,null));};exports[_0x0311('0x5d')]=function(_0x133061,_0x1ff13f,_0x16b1b1){if(_0x133061[_0x0311('0x54')]['id']){delete _0x133061[_0x0311('0x54')]['id'];}return db[_0x0311('0x37')][_0x0311('0x57')]({'where':{'id':_0x133061[_0x0311('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ff13f,null))[_0x0311('0x20')](function(_0x4bc578){if(_0x4bc578){_0x133061['body'][_0x0311('0x5e')]=_0x4bc578['id'];_0x133061[_0x0311('0x54')][_0x0311('0x5f')]=integrations[_0x0311('0x60')](_0x133061[_0x0311('0x54')][_0x0311('0x61')],_0x133061[_0x0311('0x54')][_0x0311('0x38')]);_0x133061[_0x0311('0x54')][_0x0311('0x62')]=integrations['getDescriptions'](_0x133061[_0x0311('0x54')][_0x0311('0x61')],_0x133061[_0x0311('0x54')][_0x0311('0x38')]);return db[_0x0311('0x58')][_0x0311('0x53')](_0x133061['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x0311('0x5f')},{'model':db[_0x0311('0x63')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1ff13f,null))[_0x0311('0x52')](handleError(_0x1ff13f,null));};exports[_0x0311('0x64')]=function(_0x2f7ccc,_0x236c37,_0x58f0b0){var _0x890e00='';var _0x1abf12='';return db[_0x0311('0x37')][_0x0311('0x57')]({'where':{'id':_0x2f7ccc[_0x0311('0x4e')]['id']},'attributes':['id',_0x0311('0x65'),_0x0311('0x66'),_0x0311('0x67')]})[_0x0311('0x20')](handleEntityNotFound(_0x236c37,null))[_0x0311('0x20')](function(_0x5bac07){if(_0x5bac07){_0x1abf12=_0x5bac07[_0x0311('0x65')];_0x890e00=_0x5bac07[_0x0311('0x66')];var _0x5eddc4=_0x5bac07[_0x0311('0x66')][_0x0311('0x68')](-0x1);if(_0x5eddc4==='/'){_0x890e00=_0x890e00[_0x0311('0x69')](0x0,_0x890e00[_0x0311('0x6a')](_0x5eddc4));}return rp({'method':_0x0311('0x6b'),'uri':util[_0x0311('0x6c')]('%s%s',_0x890e00,_0x0311('0x6d')),'headers':{'Authorization':'Token\x20token='+_0x5bac07[_0x0311('0x67')]},'json':!![]});}})['then'](function(_0x4c95e4){if(_0x4c95e4){var _0x6f6fdf=_0x4c95e4['users'];var _0x3460e1=![];var _0x5beca2=null;for(_0x5beca2=0x0;_0x5beca2<_0x6f6fdf['length'];_0x5beca2++){if(_0x6f6fdf[_0x5beca2][_0x0311('0x6e')]===_0x1abf12){_0x3460e1=!![];}}if(_0x3460e1){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x0311('0x20')](respondWithResult(_0x236c37,null))[_0x0311('0x52')](function(_0x5998aa){var _0x52e522=_0x2f7ccc[_0x0311('0x3c')][_0x0311('0x1c')]?0x1f4:_0x5998aa[_0x0311('0x6f')]||0x1f4;logger[_0x0311('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x0311('0x64'),_0x52e522,JSON[_0x0311('0x70')](_0x5998aa));delete _0x5998aa['name'];if(_0x52e522===0x191){_0x52e522=0x190;}_0x236c37['status'](_0x52e522)[_0x0311('0x35')](_0x2f7ccc[_0x0311('0x3c')]['test']?{'message':_0x0311('0x71'),'statusCode':_0x5998aa[_0x0311('0x6f')]}:_0x5998aa);});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
index 082694e..4adb7d9 100644
--- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
+++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b9b=['define','FreshsalesAccount','int_freshsales_accounts','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x9b9b,0x114));var _0xb9b9=function(_0x4a02e9,_0x5d7b67){_0x4a02e9=_0x4a02e9-0x0;var _0x229ed7=_0x9b9b[_0x4a02e9];return _0x229ed7;};'use strict';var _=require('lodash');var util=require(_0xb9b9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb9b9('0x1'));var BPromise=require(_0xb9b9('0x2'));var rp=require(_0xb9b9('0x3'));var fs=require('fs');var path=require(_0xb9b9('0x4'));var rimraf=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var attributes=require(_0xb9b9('0x7'));var integrations=require(_0xb9b9('0x8'));module[_0xb9b9('0x9')]=function(_0x3d1a95,_0x85eec){return _0x3d1a95[_0xb9b9('0xa')](_0xb9b9('0xb'),attributes,{'tableName':_0xb9b9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb903=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','FreshsalesAccount','int_freshsales_accounts','lodash'];(function(_0x560d0b,_0xd3ff3){var _0x53a97c=function(_0xff66aa){while(--_0xff66aa){_0x560d0b['push'](_0x560d0b['shift']());}};_0x53a97c(++_0xd3ff3);}(_0xb903,0x185));var _0x3b90=function(_0x4dd971,_0x39da31){_0x4dd971=_0x4dd971-0x0;var _0x520ffa=_0xb903[_0x4dd971];return _0x520ffa;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));var integrations=require(_0x3b90('0xa'));module['exports']=function(_0x15b68f,_0x5e845a){return _0x15b68f['define'](_0x3b90('0xb'),attributes,{'tableName':_0x3b90('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
index 353985a..74caf4c 100644
--- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
+++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x01d9=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','ShowFreshsalesAccount','find','where','stringify','lodash','util','moment'];(function(_0x4c0e4f,_0x311307){var _0x27aafe=function(_0x2b13a4){while(--_0x2b13a4){_0x4c0e4f['push'](_0x4c0e4f['shift']());}};_0x27aafe(++_0x311307);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}exports[_0x901d('0x17')]=function(_0x285353){var _0x403db9=this;return new Promise(function(_0x38f42b,_0x414171){return db[_0x901d('0x18')][_0x901d('0x19')]({'raw':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x285353['options']?_0x285353['options']['where']||null:null,'attributes':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1c')]||null:null,'limit':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1d')]||null:null,'include':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x285353[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1818d3){return{'model':db[_0x1818d3[_0x901d('0x20')]],'as':_0x1818d3['as'],'attributes':_0x1818d3[_0x901d('0x1c')],'include':_0x1818d3['include']?_[_0x901d('0x1f')](_0x1818d3[_0x901d('0x1e')],function(_0xbc89a5){return{'model':db[_0xbc89a5[_0x901d('0x20')]],'as':_0xbc89a5['as'],'attributes':_0xbc89a5['attributes'],'include':_0xbc89a5[_0x901d('0x1e')]?_[_0x901d('0x1f')](_0xbc89a5[_0x901d('0x1e')],function(_0x3cbe43){return{'model':db[_0x3cbe43[_0x901d('0x20')]],'as':_0x3cbe43['as'],'attributes':_0x3cbe43['attributes']};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0xc52d0f){logger[_0x901d('0xe')](_0x901d('0x17'),_0x285353);logger[_0x901d('0x11')](_0x901d('0x17'),_0x285353,JSON['stringify'](_0xc52d0f));_0x38f42b(_0xc52d0f);})[_0x901d('0x16')](function(_0x533038){logger[_0x901d('0x12')](_0x901d('0x17'),_0x533038[_0x901d('0x14')],_0x285353);_0x414171(_0x403db9[_0x901d('0x12')](0x1f4,_0x533038[_0x901d('0x14')]));});});};exports[_0x901d('0x21')]=function(_0x4137b7){var _0x115676=this;return new Promise(function(_0x530c4b,_0x336f28){return db[_0x901d('0x18')][_0x901d('0x22')]({'raw':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4137b7['options']?_0x4137b7[_0x901d('0x1a')][_0x901d('0x23')]||null:null,'attributes':_0x4137b7[_0x901d('0x1a')]?_0x4137b7['options'][_0x901d('0x1c')]||null:null,'include':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1b8d3){return{'model':db[_0x1b8d3[_0x901d('0x20')]],'as':_0x1b8d3['as'],'attributes':_0x1b8d3[_0x901d('0x1c')],'include':_0x1b8d3['include']?_['map'](_0x1b8d3[_0x901d('0x1e')],function(_0x4e66b4){return{'model':db[_0x4e66b4[_0x901d('0x20')]],'as':_0x4e66b4['as'],'attributes':_0x4e66b4[_0x901d('0x1c')],'include':_0x4e66b4['include']?_[_0x901d('0x1f')](_0x4e66b4[_0x901d('0x1e')],function(_0x2f5e22){return{'model':db[_0x2f5e22['model']],'as':_0x2f5e22['as'],'attributes':_0x2f5e22[_0x901d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0x1a1f9c){logger[_0x901d('0xe')](_0x901d('0x21'),_0x4137b7);logger[_0x901d('0x11')](_0x901d('0x21'),_0x4137b7,JSON[_0x901d('0x24')](_0x1a1f9c));_0x530c4b(_0x1a1f9c);})[_0x901d('0x16')](function(_0x384d82){logger[_0x901d('0x12')](_0x901d('0x21'),_0x384d82[_0x901d('0x14')],_0x4137b7);_0x336f28(_0x115676[_0x901d('0x12')](0x1f4,_0x384d82[_0x901d('0x14')]));});});};
\ No newline at end of file
+var _0xb91a=['request','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','then','info','ShowFreshsalesAccount','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x506887,_0x16611b){var _0x287091=function(_0x54f31a){while(--_0x54f31a){_0x506887['push'](_0x506887['shift']());}};_0x287091(++_0x16611b);}(_0xb91a,0xe5));var _0xab91=function(_0x59751b,_0x4e95eb){_0x59751b=_0x59751b-0x0;var _0x3438b1=_0xb91a[_0x59751b];return _0x3438b1;};'use strict';var _=require('lodash');var util=require(_0xab91('0x0'));var moment=require(_0xab91('0x1'));var BPromise=require(_0xab91('0x2'));var rs=require(_0xab91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab91('0x4'))['db'];var utils=require(_0xab91('0x5'));var logger=require('../../config/logger')(_0xab91('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab91('0x7')][_0xab91('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56f24d,_0x2ebd86,_0x26e44b){return new BPromise(function(_0x55a554,_0x1748f2){return client[_0xab91('0x9')](_0x56f24d,_0x26e44b)['then'](function(_0x5765fc){logger['info'](_0xab91('0xa'),_0x2ebd86,_0xab91('0xb'));logger[_0xab91('0xc')](_0xab91('0xd'),_0x2ebd86,'request\x20sent',JSON[_0xab91('0xe')](_0x5765fc));if(_0x5765fc[_0xab91('0xf')]){if(_0x5765fc['error'][_0xab91('0x10')]===0x1f4){logger['error'](_0xab91('0xa'),_0x2ebd86,_0x5765fc['error']['message']);return _0x1748f2(_0x5765fc[_0xab91('0xf')]['message']);}logger[_0xab91('0xf')](_0xab91('0xa'),_0x2ebd86,_0x5765fc[_0xab91('0xf')][_0xab91('0x11')]);return _0x55a554(_0x5765fc[_0xab91('0xf')][_0xab91('0x11')]);}else{logger['info'](_0xab91('0xa'),_0x2ebd86,'request\x20sent');_0x55a554(_0x5765fc[_0xab91('0x12')][_0xab91('0x11')]);}})[_0xab91('0x13')](function(_0x32df88){logger['error'](_0xab91('0xa'),_0x2ebd86,_0x32df88);_0x1748f2(_0x32df88);});});}exports[_0xab91('0x14')]=function(_0x1ece47){var _0x5835e1=this;return new Promise(function(_0x489ef5,_0x3205d1){return db[_0xab91('0x15')][_0xab91('0x16')]({'raw':_0x1ece47[_0xab91('0x17')]?_0x1ece47[_0xab91('0x17')][_0xab91('0x18')]===undefined?!![]:![]:!![],'where':_0x1ece47[_0xab91('0x17')]?_0x1ece47[_0xab91('0x17')][_0xab91('0x19')]||null:null,'attributes':_0x1ece47[_0xab91('0x17')]?_0x1ece47['options'][_0xab91('0x1a')]||null:null,'limit':_0x1ece47[_0xab91('0x17')]?_0x1ece47[_0xab91('0x17')]['limit']||null:null,'include':_0x1ece47['options']?_0x1ece47[_0xab91('0x17')][_0xab91('0x1b')]?_[_0xab91('0x1c')](_0x1ece47['options']['include'],function(_0x2d7a9f){return{'model':db[_0x2d7a9f['model']],'as':_0x2d7a9f['as'],'attributes':_0x2d7a9f[_0xab91('0x1a')],'include':_0x2d7a9f['include']?_['map'](_0x2d7a9f[_0xab91('0x1b')],function(_0x43f334){return{'model':db[_0x43f334[_0xab91('0x1d')]],'as':_0x43f334['as'],'attributes':_0x43f334[_0xab91('0x1a')],'include':_0x43f334[_0xab91('0x1b')]?_[_0xab91('0x1c')](_0x43f334[_0xab91('0x1b')],function(_0x17a1f3){return{'model':db[_0x17a1f3['model']],'as':_0x17a1f3['as'],'attributes':_0x17a1f3[_0xab91('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xab91('0x1e')](function(_0x1a3f68){logger[_0xab91('0x1f')]('GetFreshsalesAccount',_0x1ece47);logger[_0xab91('0xc')](_0xab91('0x14'),_0x1ece47,JSON['stringify'](_0x1a3f68));_0x489ef5(_0x1a3f68);})['catch'](function(_0x3e3a94){logger[_0xab91('0xf')](_0xab91('0x14'),_0x3e3a94[_0xab91('0x11')],_0x1ece47);_0x3205d1(_0x5835e1[_0xab91('0xf')](0x1f4,_0x3e3a94[_0xab91('0x11')]));});});};exports[_0xab91('0x20')]=function(_0x2e022d){var _0x19c9a5=this;return new Promise(function(_0x1e4b6f,_0x6852ca){return db['FreshsalesAccount'][_0xab91('0x21')]({'raw':_0x2e022d[_0xab91('0x17')]?_0x2e022d['options'][_0xab91('0x18')]===undefined?!![]:![]:!![],'where':_0x2e022d[_0xab91('0x17')]?_0x2e022d[_0xab91('0x17')]['where']||null:null,'attributes':_0x2e022d[_0xab91('0x17')]?_0x2e022d['options'][_0xab91('0x1a')]||null:null,'include':_0x2e022d[_0xab91('0x17')]?_0x2e022d['options'][_0xab91('0x1b')]?_[_0xab91('0x1c')](_0x2e022d['options'][_0xab91('0x1b')],function(_0x4182e7){return{'model':db[_0x4182e7[_0xab91('0x1d')]],'as':_0x4182e7['as'],'attributes':_0x4182e7['attributes'],'include':_0x4182e7[_0xab91('0x1b')]?_[_0xab91('0x1c')](_0x4182e7['include'],function(_0x436962){return{'model':db[_0x436962[_0xab91('0x1d')]],'as':_0x436962['as'],'attributes':_0x436962[_0xab91('0x1a')],'include':_0x436962['include']?_['map'](_0x436962[_0xab91('0x1b')],function(_0x587c84){return{'model':db[_0x587c84['model']],'as':_0x587c84['as'],'attributes':_0x587c84[_0xab91('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xab91('0x1e')](function(_0x4e11d5){logger[_0xab91('0x1f')](_0xab91('0x20'),_0x2e022d);logger[_0xab91('0xc')](_0xab91('0x20'),_0x2e022d,JSON[_0xab91('0xe')](_0x4e11d5));_0x1e4b6f(_0x4e11d5);})[_0xab91('0x13')](function(_0x50e3a6){logger[_0xab91('0xf')](_0xab91('0x20'),_0x50e3a6[_0xab91('0x11')],_0x2e022d);_0x6852ca(_0x19c9a5[_0xab91('0xf')](0x1f4,_0x50e3a6[_0xab91('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js
index 28c2f33..3e0ce0d 100644
--- a/server/api/intFreshsalesConfiguration/index.js
+++ b/server/api/intFreshsalesConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1ad2=['getFields','create','exports','multer','util','path','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions'];(function(_0x4f5537,_0x1b1f5c){var _0x4d31f9=function(_0x3b6e30){while(--_0x3b6e30){_0x4f5537['push'](_0x4f5537['shift']());}};_0x4d31f9(++_0x1b1f5c);}(_0x1ad2,0x19b));var _0x21ad=function(_0xe1b111,_0x5661dc){_0xe1b111=_0xe1b111-0x0;var _0x339286=_0x1ad2[_0xe1b111];return _0x339286;};'use strict';var multer=require(_0x21ad('0x0'));var util=require(_0x21ad('0x1'));var path=require(_0x21ad('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x21ad('0x3'));var config=require(_0x21ad('0x4'));var controller=require(_0x21ad('0x5'));router[_0x21ad('0x6')]('/',auth[_0x21ad('0x7')](),controller[_0x21ad('0x8')]);router['get'](_0x21ad('0x9'),auth[_0x21ad('0x7')](),controller[_0x21ad('0xa')]);router['get'](_0x21ad('0xb'),auth[_0x21ad('0x7')](),controller[_0x21ad('0xc')]);router[_0x21ad('0x6')]('/:id/descriptions',auth[_0x21ad('0x7')](),controller[_0x21ad('0xd')]);router[_0x21ad('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x21ad('0xe')]);router['post']('/',auth[_0x21ad('0x7')](),controller[_0x21ad('0xf')]);router['put'](_0x21ad('0x9'),auth[_0x21ad('0x7')](),controller['update']);router['delete'](_0x21ad('0x9'),auth[_0x21ad('0x7')](),controller['destroy']);module[_0x21ad('0x10')]=router;
\ No newline at end of file
+var _0x0126=['getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0126,0x173));var _0x6012=function(_0x38201c,_0x3ad0d4){_0x38201c=_0x38201c-0x0;var _0x11234e=_0x0126[_0x38201c];return _0x11234e;};'use strict';var multer=require(_0x6012('0x0'));var util=require(_0x6012('0x1'));var path=require(_0x6012('0x2'));var timeout=require(_0x6012('0x3'));var express=require(_0x6012('0x4'));var router=express[_0x6012('0x5')]();var auth=require(_0x6012('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6012('0x7'));var controller=require(_0x6012('0x8'));router[_0x6012('0x9')]('/',auth[_0x6012('0xa')](),controller[_0x6012('0xb')]);router[_0x6012('0x9')](_0x6012('0xc'),auth[_0x6012('0xa')](),controller[_0x6012('0xd')]);router['get'](_0x6012('0xe'),auth[_0x6012('0xa')](),controller[_0x6012('0xf')]);router[_0x6012('0x9')](_0x6012('0x10'),auth[_0x6012('0xa')](),controller[_0x6012('0x11')]);router[_0x6012('0x9')](_0x6012('0x12'),auth[_0x6012('0xa')](),controller[_0x6012('0x13')]);router[_0x6012('0x14')]('/',auth['isAuthenticated'](),controller[_0x6012('0x15')]);router[_0x6012('0x16')](_0x6012('0xc'),auth[_0x6012('0xa')](),controller[_0x6012('0x17')]);router[_0x6012('0x18')](_0x6012('0xc'),auth[_0x6012('0xa')](),controller[_0x6012('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
index 5b1dbb8..a1a600c 100644
--- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
+++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdc4=['STRING','exports'];(function(_0x150994,_0x3ab8ca){var _0x249f7a=function(_0x498ef3){while(--_0x498ef3){_0x150994['push'](_0x150994['shift']());}};_0x249f7a(++_0x3ab8ca);}(_0xbdc4,0x195));var _0x4bdc=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xbdc4[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require('sequelize');module[_0x4bdc('0x0')]={'name':{'type':Sequelize[_0x4bdc('0x1')]},'description':{'type':Sequelize[_0x4bdc('0x1')]}};
\ No newline at end of file
+var _0xb8ae=['exports','STRING','sequelize'];(function(_0x476533,_0x843561){var _0x12291f=function(_0x4e7beb){while(--_0x4e7beb){_0x476533['push'](_0x476533['shift']());}};_0x12291f(++_0x843561);}(_0xb8ae,0x7d));var _0xeb8a=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xb8ae[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require(_0xeb8a('0x0'));module[_0xeb8a('0x1')]={'name':{'type':Sequelize[_0xeb8a('0x2')]},'description':{'type':Sequelize[_0xeb8a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
index 6cca888..6b55c89 100644
--- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
+++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2bf9=['findAll','rows','show','find','create','body','catch','params','getSubjects','findOne','getDescriptions','FreshsalesField','getFields','html-pdf','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update','destroy','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include'];(function(_0x1ba71b,_0xfa5ab){var _0x386eed=function(_0x380f24){while(--_0x380f24){_0x1ba71b['push'](_0x1ba71b['shift']());}};_0x386eed(++_0xfa5ab);}(_0x2bf9,0xc7));var _0x92bf=function(_0x2391cf,_0x2593e9){_0x2391cf=_0x2391cf-0x0;var _0x11f9e5=_0x2bf9[_0x2391cf];return _0x11f9e5;};'use strict';var pdf=require(_0x92bf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x92bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x92bf('0x2'));var BPromise=require(_0x92bf('0x3'));var Mustache=require(_0x92bf('0x4'));var util=require(_0x92bf('0x5'));var path=require(_0x92bf('0x6'));var sox=require(_0x92bf('0x7'));var csv=require(_0x92bf('0x8'));var ejs=require(_0x92bf('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x92bf('0xa'));var crypto=require(_0x92bf('0xb'));var jsforce=require(_0x92bf('0xc'));var deskjs=require(_0x92bf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x92bf('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x92bf('0xf'));var qs=require(_0x92bf('0x10'));var as=require(_0x92bf('0x11'));var hardwareService=require(_0x92bf('0x12'));var logger=require(_0x92bf('0x13'))(_0x92bf('0x14'));var utils=require(_0x92bf('0x15'));var config=require(_0x92bf('0x16'));var db=require(_0x92bf('0x17'))['db'];var jayson=require(_0x92bf('0x18'));var client=jayson[_0x92bf('0x19')][_0x92bf('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xbd689,_0x20563f,_0xdd06cd){if(_0xdd06cd){var _0x1ebd76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ebd76['test'](_0x20563f)){return _0xbd689;}else{throw new db[(_0x92bf('0x1b'))][(_0x92bf('0x1c'))](_0x92bf('0x1d'));}}else{return _0xbd689;}}function respondWithRpcPromise(_0x47eca1,_0x409795,_0x4b2e64,_0x5ea3f8){return new BPromise(function(_0x51d1ce,_0x383858){var _0x36b7b8=_0x5ea3f8||client;return _0x36b7b8[_0x92bf('0x1e')](_0x47eca1,_0x4b2e64)[_0x92bf('0x1f')](function(_0x6c306e){logger[_0x92bf('0x20')](_0x92bf('0x21'),_0x409795,_0x92bf('0x22'));logger['debug'](_0x92bf('0x23'),_0x409795,'request\x20sent',JSON[_0x92bf('0x24')](_0x6c306e));if(_0x6c306e[_0x92bf('0x25')]){if(_0x6c306e['error'][_0x92bf('0x26')]===0x1f4){logger['error'](_0x92bf('0x21'),_0x409795,_0x6c306e[_0x92bf('0x25')]['message']);return _0x383858(_0x6c306e[_0x92bf('0x25')][_0x92bf('0x27')]);}logger['error'](_0x92bf('0x21'),_0x409795,_0x6c306e['error'][_0x92bf('0x27')]);return _0x51d1ce(_0x6c306e[_0x92bf('0x25')][_0x92bf('0x27')]);}else{logger['info'](_0x92bf('0x21'),_0x409795,_0x92bf('0x22'));_0x51d1ce(_0x6c306e[_0x92bf('0x28')]['message']);}})['catch'](function(_0x5978a8){logger[_0x92bf('0x25')](_0x92bf('0x21'),_0x409795,_0x5978a8);_0x383858(_0x5978a8);});});}function respondWithStatusCode(_0x31c98d,_0x1ab65b){_0x1ab65b=_0x1ab65b||0xcc;return function(_0x1326e4){if(_0x1326e4){return _0x31c98d[_0x92bf('0x29')](_0x1ab65b);}return _0x31c98d[_0x92bf('0x2a')](_0x1ab65b)[_0x92bf('0x2b')]();};}function respondWithResult(_0x1110d0,_0x30a6bb){_0x30a6bb=_0x30a6bb||0xc8;return function(_0x591786){if(_0x591786){return _0x1110d0['status'](_0x30a6bb)[_0x92bf('0x2c')](_0x591786);}};}function respondWithFilteredResult(_0x1f791e,_0x6a9472){return function(_0x516e2c){if(_0x516e2c){var _0x523566=_0x516e2c['count'],_0x5245a9=_0x6a9472['offset'],_0x1056c7=_0x6a9472[_0x92bf('0x2d')]+_0x6a9472[_0x92bf('0x2e')],_0x1e2d8d;if(_0x1056c7>=_0x523566){_0x1056c7=_0x523566;_0x1e2d8d=0xc8;}else{_0x1e2d8d=0xce;}_0x1f791e[_0x92bf('0x2a')](_0x1e2d8d);return _0x1f791e[_0x92bf('0x2f')](_0x92bf('0x30'),_0x5245a9+'-'+_0x1056c7+'/'+_0x523566)['json'](_0x516e2c);}return null;};}function patchUpdates(_0x528d79){return function(_0x22add2){try{jsonpatch[_0x92bf('0x31')](_0x22add2,_0x528d79,!![]);}catch(_0x50ec8c){return BPromise['reject'](_0x50ec8c);}return _0x22add2['save']();};}function saveUpdates(_0xe7d203,_0x5494ea){return function(_0x203677){if(_0x203677){return _0x203677[_0x92bf('0x32')](_0xe7d203)[_0x92bf('0x1f')](function(_0x5ead26){return _0x5ead26;});}return null;};}function removeEntity(_0x40909f,_0x504987){return function(_0x3dc00e){if(_0x3dc00e){return _0x3dc00e[_0x92bf('0x33')]()[_0x92bf('0x1f')](function(){_0x40909f[_0x92bf('0x2a')](0xcc)[_0x92bf('0x2b')]();});}};}function handleEntityNotFound(_0x420770,_0x216ea2){return function(_0x43c747){if(!_0x43c747){_0x420770[_0x92bf('0x29')](0x194);}return _0x43c747;};}function handleError(_0x408310,_0x4c074e){_0x4c074e=_0x4c074e||0x1f4;return function(_0x5a4824){logger[_0x92bf('0x25')](_0x5a4824['stack']);if(_0x5a4824[_0x92bf('0x34')]){delete _0x5a4824[_0x92bf('0x34')];}_0x408310[_0x92bf('0x2a')](_0x4c074e)[_0x92bf('0x35')](_0x5a4824);};}exports['index']=function(_0x2202c3,_0x2dfd1e){var _0x4d0f3f={},_0x353e98={},_0x2289d4={'count':0x0,'rows':[]};var _0x162e4a=_[_0x92bf('0x36')](db[_0x92bf('0x37')][_0x92bf('0x38')],function(_0x2b156a){return{'name':_0x2b156a[_0x92bf('0x39')],'type':_0x2b156a[_0x92bf('0x3a')]['key']};});_0x353e98[_0x92bf('0x3b')]=_[_0x92bf('0x36')](_0x162e4a,_0x92bf('0x34'));_0x353e98[_0x92bf('0x3c')]=_[_0x92bf('0x3d')](_0x2202c3[_0x92bf('0x3c')]);_0x353e98[_0x92bf('0x3e')]=_[_0x92bf('0x3f')](_0x353e98[_0x92bf('0x3b')],_0x353e98['query']);_0x4d0f3f[_0x92bf('0x40')]=_[_0x92bf('0x3f')](_0x353e98['model'],qs[_0x92bf('0x41')](_0x2202c3[_0x92bf('0x3c')][_0x92bf('0x41')]));_0x4d0f3f[_0x92bf('0x40')]=_0x4d0f3f[_0x92bf('0x40')][_0x92bf('0x42')]?_0x4d0f3f[_0x92bf('0x40')]:_0x353e98[_0x92bf('0x3b')];if(!_0x2202c3[_0x92bf('0x3c')][_0x92bf('0x43')](_0x92bf('0x44'))){_0x4d0f3f[_0x92bf('0x2e')]=qs[_0x92bf('0x2e')](_0x2202c3[_0x92bf('0x3c')][_0x92bf('0x2e')]);_0x4d0f3f[_0x92bf('0x2d')]=qs[_0x92bf('0x2d')](_0x2202c3[_0x92bf('0x3c')][_0x92bf('0x2d')]);}_0x4d0f3f[_0x92bf('0x45')]=qs['sort'](_0x2202c3[_0x92bf('0x3c')][_0x92bf('0x46')]);_0x4d0f3f[_0x92bf('0x47')]=qs[_0x92bf('0x3e')](_[_0x92bf('0x48')](_0x2202c3[_0x92bf('0x3c')],_0x353e98[_0x92bf('0x3e')]),_0x162e4a);if(_0x2202c3['query'][_0x92bf('0x49')]){_0x4d0f3f['where']=_['merge'](_0x4d0f3f[_0x92bf('0x47')],{'$or':_[_0x92bf('0x36')](_0x162e4a,function(_0x545e7a){if(_0x545e7a[_0x92bf('0x3a')]!==_0x92bf('0x4a')){var _0x4c302e={};_0x4c302e[_0x545e7a[_0x92bf('0x34')]]={'$like':'%'+_0x2202c3[_0x92bf('0x3c')][_0x92bf('0x49')]+'%'};return _0x4c302e;}})});}_0x4d0f3f=_[_0x92bf('0x4b')]({},_0x4d0f3f,_0x2202c3[_0x92bf('0x4c')]);var _0x1511f1={'where':_0x4d0f3f['where']};return db['FreshsalesConfiguration']['count'](_0x1511f1)[_0x92bf('0x1f')](function(_0x306915){_0x2289d4[_0x92bf('0x4d')]=_0x306915;if(_0x2202c3[_0x92bf('0x3c')][_0x92bf('0x4e')]){_0x4d0f3f[_0x92bf('0x4f')]=[{'all':!![]}];}return db[_0x92bf('0x37')][_0x92bf('0x50')](_0x4d0f3f);})['then'](function(_0x317187){_0x2289d4[_0x92bf('0x51')]=_0x317187;return _0x2289d4;})['then'](respondWithFilteredResult(_0x2dfd1e,_0x4d0f3f))['catch'](handleError(_0x2dfd1e,null));};exports[_0x92bf('0x52')]=function(_0x286dae,_0x32f33d){var _0x1bf257={'raw':![],'where':{'id':_0x286dae['params']['id']}},_0x4e1c74={};_0x4e1c74[_0x92bf('0x3b')]=_[_0x92bf('0x3d')](db['FreshsalesConfiguration'][_0x92bf('0x38')]);_0x4e1c74['query']=_[_0x92bf('0x3d')](_0x286dae[_0x92bf('0x3c')]);_0x4e1c74['filters']=_['intersection'](_0x4e1c74[_0x92bf('0x3b')],_0x4e1c74[_0x92bf('0x3c')]);_0x1bf257[_0x92bf('0x40')]=_[_0x92bf('0x3f')](_0x4e1c74[_0x92bf('0x3b')],qs[_0x92bf('0x41')](_0x286dae[_0x92bf('0x3c')][_0x92bf('0x41')]));_0x1bf257[_0x92bf('0x40')]=_0x1bf257[_0x92bf('0x40')][_0x92bf('0x42')]?_0x1bf257[_0x92bf('0x40')]:_0x4e1c74[_0x92bf('0x3b')];if(_0x286dae[_0x92bf('0x3c')][_0x92bf('0x4e')]){_0x1bf257[_0x92bf('0x4f')]=[{'all':!![]}];}_0x1bf257=_[_0x92bf('0x4b')]({},_0x1bf257,_0x286dae[_0x92bf('0x4c')]);return db[_0x92bf('0x37')][_0x92bf('0x53')](_0x1bf257)[_0x92bf('0x1f')](handleEntityNotFound(_0x32f33d,null))[_0x92bf('0x1f')](respondWithResult(_0x32f33d,null))['catch'](handleError(_0x32f33d,null));};exports['create']=function(_0x306ac1,_0x2a504b){return db[_0x92bf('0x37')][_0x92bf('0x54')](_0x306ac1[_0x92bf('0x55')],{})['then'](respondWithResult(_0x2a504b,0xc9))[_0x92bf('0x56')](handleError(_0x2a504b,null));};exports[_0x92bf('0x32')]=function(_0x33a0b6,_0x590f56){if(_0x33a0b6[_0x92bf('0x55')]['id']){delete _0x33a0b6['body']['id'];}return db[_0x92bf('0x37')]['find']({'where':{'id':_0x33a0b6[_0x92bf('0x57')]['id']}})[_0x92bf('0x1f')](handleEntityNotFound(_0x590f56,null))[_0x92bf('0x1f')](saveUpdates(_0x33a0b6[_0x92bf('0x55')],null))[_0x92bf('0x1f')](respondWithResult(_0x590f56,null))[_0x92bf('0x56')](handleError(_0x590f56,null));};exports[_0x92bf('0x33')]=function(_0x58e406,_0x264425){return db[_0x92bf('0x37')][_0x92bf('0x53')]({'where':{'id':_0x58e406[_0x92bf('0x57')]['id']}})[_0x92bf('0x1f')](handleEntityNotFound(_0x264425,null))[_0x92bf('0x1f')](removeEntity(_0x264425,null))[_0x92bf('0x56')](handleError(_0x264425,null));};exports[_0x92bf('0x58')]=function(_0xd12d9e,_0x17ea28,_0x24f704){var _0x37b8db={};var _0x55e0ea={};var _0x513cb0;var _0x470147;return db[_0x92bf('0x37')][_0x92bf('0x59')]({'where':{'id':_0xd12d9e[_0x92bf('0x57')]['id']}})['then'](handleEntityNotFound(_0x17ea28,null))[_0x92bf('0x1f')](function(_0x2cdf09){if(_0x2cdf09){_0x513cb0=_0x2cdf09;_0x55e0ea[_0x92bf('0x3b')]=_[_0x92bf('0x3d')](db['FreshsalesField'][_0x92bf('0x38')]);_0x55e0ea[_0x92bf('0x3c')]=_['keys'](_0xd12d9e[_0x92bf('0x3c')]);_0x55e0ea[_0x92bf('0x3e')]=_[_0x92bf('0x3f')](_0x55e0ea['model'],_0x55e0ea[_0x92bf('0x3c')]);_0x37b8db[_0x92bf('0x40')]=_['intersection'](_0x55e0ea[_0x92bf('0x3b')],qs[_0x92bf('0x41')](_0xd12d9e[_0x92bf('0x3c')][_0x92bf('0x41')]));_0x37b8db[_0x92bf('0x40')]=_0x37b8db[_0x92bf('0x40')][_0x92bf('0x42')]?_0x37b8db[_0x92bf('0x40')]:_0x55e0ea[_0x92bf('0x3b')];_0x37b8db[_0x92bf('0x45')]=qs[_0x92bf('0x46')](_0xd12d9e[_0x92bf('0x3c')][_0x92bf('0x46')]);_0x37b8db[_0x92bf('0x47')]=qs['filters'](_[_0x92bf('0x48')](_0xd12d9e['query'],_0x55e0ea['filters']));if(_0xd12d9e[_0x92bf('0x3c')]['filter']){_0x37b8db[_0x92bf('0x47')]=_[_0x92bf('0x4b')](_0x37b8db[_0x92bf('0x47')],{'$or':_['map'](_0x37b8db[_0x92bf('0x40')],function(_0x12a44c){var _0x42ca8b={};_0x42ca8b[_0x12a44c]={'$like':'%'+_0xd12d9e['query'][_0x92bf('0x49')]+'%'};return _0x42ca8b;})});}_0x37b8db=_[_0x92bf('0x4b')]({},_0x37b8db,_0xd12d9e['options']);return _0x513cb0['getSubjects'](_0x37b8db);}})[_0x92bf('0x1f')](function(_0x318f66){if(_0x318f66){_0x470147=_0x318f66[_0x92bf('0x42')];if(!_0xd12d9e[_0x92bf('0x3c')][_0x92bf('0x43')](_0x92bf('0x44'))){_0x37b8db[_0x92bf('0x2e')]=qs[_0x92bf('0x2e')](_0xd12d9e[_0x92bf('0x3c')][_0x92bf('0x2e')]);_0x37b8db['offset']=qs[_0x92bf('0x2d')](_0xd12d9e[_0x92bf('0x3c')][_0x92bf('0x2d')]);}return _0x513cb0[_0x92bf('0x58')](_0x37b8db);}})[_0x92bf('0x1f')](function(_0x1b1dc6){if(_0x1b1dc6){return _0x1b1dc6?{'count':_0x470147,'rows':_0x1b1dc6}:null;}})[_0x92bf('0x1f')](respondWithResult(_0x17ea28,null))[_0x92bf('0x56')](handleError(_0x17ea28,null));};exports[_0x92bf('0x5a')]=function(_0x4fe4e5,_0x927191,_0x3d092b){var _0x4a1ad6={};var _0x1dc46d={};var _0x4069e5;var _0x48bdd9;return db[_0x92bf('0x37')][_0x92bf('0x59')]({'where':{'id':_0x4fe4e5[_0x92bf('0x57')]['id']}})['then'](handleEntityNotFound(_0x927191,null))[_0x92bf('0x1f')](function(_0x51c53d){if(_0x51c53d){_0x4069e5=_0x51c53d;_0x1dc46d['model']=_[_0x92bf('0x3d')](db['FreshsalesField'][_0x92bf('0x38')]);_0x1dc46d[_0x92bf('0x3c')]=_[_0x92bf('0x3d')](_0x4fe4e5[_0x92bf('0x3c')]);_0x1dc46d[_0x92bf('0x3e')]=_[_0x92bf('0x3f')](_0x1dc46d[_0x92bf('0x3b')],_0x1dc46d[_0x92bf('0x3c')]);_0x4a1ad6[_0x92bf('0x40')]=_['intersection'](_0x1dc46d['model'],qs[_0x92bf('0x41')](_0x4fe4e5[_0x92bf('0x3c')][_0x92bf('0x41')]));_0x4a1ad6[_0x92bf('0x40')]=_0x4a1ad6[_0x92bf('0x40')][_0x92bf('0x42')]?_0x4a1ad6[_0x92bf('0x40')]:_0x1dc46d[_0x92bf('0x3b')];_0x4a1ad6[_0x92bf('0x45')]=qs[_0x92bf('0x46')](_0x4fe4e5[_0x92bf('0x3c')][_0x92bf('0x46')]);_0x4a1ad6[_0x92bf('0x47')]=qs[_0x92bf('0x3e')](_[_0x92bf('0x48')](_0x4fe4e5[_0x92bf('0x3c')],_0x1dc46d[_0x92bf('0x3e')]));if(_0x4fe4e5[_0x92bf('0x3c')]['filter']){_0x4a1ad6[_0x92bf('0x47')]=_[_0x92bf('0x4b')](_0x4a1ad6[_0x92bf('0x47')],{'$or':_[_0x92bf('0x36')](_0x4a1ad6['attributes'],function(_0x1cc752){var _0x3786b5={};_0x3786b5[_0x1cc752]={'$like':'%'+_0x4fe4e5[_0x92bf('0x3c')][_0x92bf('0x49')]+'%'};return _0x3786b5;})});}_0x4a1ad6=_['merge']({},_0x4a1ad6,_0x4fe4e5[_0x92bf('0x4c')]);return _0x4069e5['getDescriptions'](_0x4a1ad6);}})[_0x92bf('0x1f')](function(_0x380d88){if(_0x380d88){_0x48bdd9=_0x380d88[_0x92bf('0x42')];if(!_0x4fe4e5['query'][_0x92bf('0x43')](_0x92bf('0x44'))){_0x4a1ad6['limit']=qs['limit'](_0x4fe4e5[_0x92bf('0x3c')]['limit']);_0x4a1ad6[_0x92bf('0x2d')]=qs[_0x92bf('0x2d')](_0x4fe4e5[_0x92bf('0x3c')][_0x92bf('0x2d')]);}return _0x4069e5[_0x92bf('0x5a')](_0x4a1ad6);}})[_0x92bf('0x1f')](function(_0x2e9742){if(_0x2e9742){return _0x2e9742?{'count':_0x48bdd9,'rows':_0x2e9742}:null;}})['then'](respondWithResult(_0x927191,null))[_0x92bf('0x56')](handleError(_0x927191,null));};exports['getFields']=function(_0x85d199,_0x3880e2,_0x207b58){var _0x9bd24a={};var _0xa2e22b={};var _0x192b01;var _0x574414;return db['FreshsalesConfiguration'][_0x92bf('0x59')]({'where':{'id':_0x85d199['params']['id']}})['then'](handleEntityNotFound(_0x3880e2,null))[_0x92bf('0x1f')](function(_0x5831fa){if(_0x5831fa){_0x192b01=_0x5831fa;_0xa2e22b[_0x92bf('0x3b')]=_['keys'](db[_0x92bf('0x5b')][_0x92bf('0x38')]);_0xa2e22b['query']=_[_0x92bf('0x3d')](_0x85d199[_0x92bf('0x3c')]);_0xa2e22b[_0x92bf('0x3e')]=_['intersection'](_0xa2e22b['model'],_0xa2e22b[_0x92bf('0x3c')]);_0x9bd24a[_0x92bf('0x40')]=_[_0x92bf('0x3f')](_0xa2e22b[_0x92bf('0x3b')],qs['fields'](_0x85d199['query']['fields']));_0x9bd24a[_0x92bf('0x40')]=_0x9bd24a[_0x92bf('0x40')]['length']?_0x9bd24a[_0x92bf('0x40')]:_0xa2e22b[_0x92bf('0x3b')];_0x9bd24a[_0x92bf('0x45')]=qs[_0x92bf('0x46')](_0x85d199['query'][_0x92bf('0x46')]);_0x9bd24a[_0x92bf('0x47')]=qs['filters'](_[_0x92bf('0x48')](_0x85d199[_0x92bf('0x3c')],_0xa2e22b[_0x92bf('0x3e')]));if(_0x85d199['query'][_0x92bf('0x49')]){_0x9bd24a['where']=_[_0x92bf('0x4b')](_0x9bd24a[_0x92bf('0x47')],{'$or':_['map'](_0x9bd24a[_0x92bf('0x40')],function(_0x1507b6){var _0x22687c={};_0x22687c[_0x1507b6]={'$like':'%'+_0x85d199['query'][_0x92bf('0x49')]+'%'};return _0x22687c;})});}_0x9bd24a=_[_0x92bf('0x4b')]({},_0x9bd24a,_0x85d199[_0x92bf('0x4c')]);return _0x192b01[_0x92bf('0x5c')](_0x9bd24a);}})[_0x92bf('0x1f')](function(_0x2c5f7e){if(_0x2c5f7e){_0x574414=_0x2c5f7e[_0x92bf('0x42')];if(!_0x85d199[_0x92bf('0x3c')][_0x92bf('0x43')](_0x92bf('0x44'))){_0x9bd24a[_0x92bf('0x2e')]=qs[_0x92bf('0x2e')](_0x85d199['query'][_0x92bf('0x2e')]);_0x9bd24a[_0x92bf('0x2d')]=qs[_0x92bf('0x2d')](_0x85d199[_0x92bf('0x3c')][_0x92bf('0x2d')]);}return _0x192b01['getFields'](_0x9bd24a);}})[_0x92bf('0x1f')](function(_0x209d43){if(_0x209d43){return _0x209d43?{'count':_0x574414,'rows':_0x209d43}:null;}})['then'](respondWithResult(_0x3880e2,null))[_0x92bf('0x56')](handleError(_0x3880e2,null));};
\ No newline at end of file
+var _0x8ded=['include','findAll','rows','find','create','update','body','params','getSubjects','FreshsalesField','getDescriptions','findOne','getFields','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','destroy','end','stack','send','FreshsalesConfiguration','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','name','options','includeAll'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x8ded,0x6a));var _0xd8de=function(_0x39f52f,_0x3bd6aa){_0x39f52f=_0x39f52f-0x0;var _0x38c903=_0x8ded[_0x39f52f];return _0x38c903;};'use strict';var pdf=require(_0xd8de('0x0'));var emlformat=require(_0xd8de('0x1'));var rimraf=require(_0xd8de('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8de('0x3'));var rp=require(_0xd8de('0x4'));var moment=require(_0xd8de('0x5'));var BPromise=require(_0xd8de('0x6'));var Mustache=require(_0xd8de('0x7'));var util=require(_0xd8de('0x8'));var path=require(_0xd8de('0x9'));var sox=require('sox');var csv=require(_0xd8de('0xa'));var ejs=require(_0xd8de('0xb'));var fs=require('fs');var _=require(_0xd8de('0xc'));var squel=require(_0xd8de('0xd'));var crypto=require(_0xd8de('0xe'));var jsforce=require(_0xd8de('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd8de('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd8de('0x11'));var qs=require(_0xd8de('0x12'));var as=require(_0xd8de('0x13'));var hardwareService=require(_0xd8de('0x14'));var logger=require(_0xd8de('0x15'))(_0xd8de('0x16'));var utils=require(_0xd8de('0x17'));var config=require(_0xd8de('0x18'));var db=require(_0xd8de('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xd8de('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x57e03c,_0x54d331,_0x3d48ed){if(_0x3d48ed){var _0x1e6bc6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e6bc6[_0xd8de('0x1b')](_0x54d331)){return _0x57e03c;}else{throw new db[(_0xd8de('0x1c'))][(_0xd8de('0x1d'))](_0xd8de('0x1e'));}}else{return _0x57e03c;}}function respondWithRpcPromise(_0x586d60,_0x415a8c,_0x34a3bb,_0x8afa48){return new BPromise(function(_0x3cf417,_0x317d24){var _0x2f1d0d=_0x8afa48||client;return _0x2f1d0d[_0xd8de('0x1f')](_0x586d60,_0x34a3bb)[_0xd8de('0x20')](function(_0x99175b){logger[_0xd8de('0x21')](_0xd8de('0x22'),_0x415a8c,'request\x20sent');logger[_0xd8de('0x23')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x415a8c,_0xd8de('0x24'),JSON['stringify'](_0x99175b));if(_0x99175b[_0xd8de('0x25')]){if(_0x99175b[_0xd8de('0x25')]['code']===0x1f4){logger[_0xd8de('0x25')](_0xd8de('0x22'),_0x415a8c,_0x99175b[_0xd8de('0x25')][_0xd8de('0x26')]);return _0x317d24(_0x99175b['error'][_0xd8de('0x26')]);}logger[_0xd8de('0x25')](_0xd8de('0x22'),_0x415a8c,_0x99175b[_0xd8de('0x25')][_0xd8de('0x26')]);return _0x3cf417(_0x99175b['error'][_0xd8de('0x26')]);}else{logger[_0xd8de('0x21')](_0xd8de('0x22'),_0x415a8c,'request\x20sent');_0x3cf417(_0x99175b[_0xd8de('0x27')][_0xd8de('0x26')]);}})[_0xd8de('0x28')](function(_0x5a02eb){logger[_0xd8de('0x25')](_0xd8de('0x22'),_0x415a8c,_0x5a02eb);_0x317d24(_0x5a02eb);});});}function respondWithStatusCode(_0x17b483,_0x4b3b34){_0x4b3b34=_0x4b3b34||0xcc;return function(_0x1b37dd){if(_0x1b37dd){return _0x17b483[_0xd8de('0x29')](_0x4b3b34);}return _0x17b483[_0xd8de('0x2a')](_0x4b3b34)['end']();};}function respondWithResult(_0x41b292,_0xc01510){_0xc01510=_0xc01510||0xc8;return function(_0x577578){if(_0x577578){return _0x41b292[_0xd8de('0x2a')](_0xc01510)[_0xd8de('0x2b')](_0x577578);}};}function respondWithFilteredResult(_0x3f402a,_0x20e9d1){return function(_0x105f17){if(_0x105f17){var _0x1c4613=_0x105f17[_0xd8de('0x2c')],_0x4f96c8=_0x20e9d1[_0xd8de('0x2d')],_0x5512a9=_0x20e9d1[_0xd8de('0x2d')]+_0x20e9d1[_0xd8de('0x2e')],_0x26ecde;if(_0x5512a9>=_0x1c4613){_0x5512a9=_0x1c4613;_0x26ecde=0xc8;}else{_0x26ecde=0xce;}_0x3f402a[_0xd8de('0x2a')](_0x26ecde);return _0x3f402a[_0xd8de('0x2f')](_0xd8de('0x30'),_0x4f96c8+'-'+_0x5512a9+'/'+_0x1c4613)[_0xd8de('0x2b')](_0x105f17);}return null;};}function patchUpdates(_0x21709a){return function(_0x183953){try{jsonpatch['apply'](_0x183953,_0x21709a,!![]);}catch(_0x20db7e){return BPromise[_0xd8de('0x31')](_0x20db7e);}return _0x183953[_0xd8de('0x32')]();};}function saveUpdates(_0x2b5faa,_0x2a5b99){return function(_0x18e6ec){if(_0x18e6ec){return _0x18e6ec['update'](_0x2b5faa)[_0xd8de('0x20')](function(_0x913aaf){return _0x913aaf;});}return null;};}function removeEntity(_0x5bd924,_0x7e84ed){return function(_0x5b4fee){if(_0x5b4fee){return _0x5b4fee[_0xd8de('0x33')]()['then'](function(){_0x5bd924['status'](0xcc)[_0xd8de('0x34')]();});}};}function handleEntityNotFound(_0x3d1691,_0x4b42bd){return function(_0x1607a7){if(!_0x1607a7){_0x3d1691[_0xd8de('0x29')](0x194);}return _0x1607a7;};}function handleError(_0xdff70c,_0x402608){_0x402608=_0x402608||0x1f4;return function(_0x2ef157){logger['error'](_0x2ef157[_0xd8de('0x35')]);if(_0x2ef157['name']){delete _0x2ef157['name'];}_0xdff70c[_0xd8de('0x2a')](_0x402608)[_0xd8de('0x36')](_0x2ef157);};}exports['index']=function(_0x10ee61,_0x233906){var _0x270e37={},_0x4319e5={},_0x4c6b0c={'count':0x0,'rows':[]};var _0x3a06e1=_['map'](db[_0xd8de('0x37')][_0xd8de('0x38')],function(_0x396a13){return{'name':_0x396a13['fieldName'],'type':_0x396a13[_0xd8de('0x39')][_0xd8de('0x3a')]};});_0x4319e5[_0xd8de('0x3b')]=_[_0xd8de('0x3c')](_0x3a06e1,'name');_0x4319e5[_0xd8de('0x3d')]=_[_0xd8de('0x3e')](_0x10ee61[_0xd8de('0x3d')]);_0x4319e5['filters']=_[_0xd8de('0x3f')](_0x4319e5[_0xd8de('0x3b')],_0x4319e5['query']);_0x270e37[_0xd8de('0x40')]=_[_0xd8de('0x3f')](_0x4319e5[_0xd8de('0x3b')],qs[_0xd8de('0x41')](_0x10ee61[_0xd8de('0x3d')][_0xd8de('0x41')]));_0x270e37[_0xd8de('0x40')]=_0x270e37['attributes'][_0xd8de('0x42')]?_0x270e37[_0xd8de('0x40')]:_0x4319e5['model'];if(!_0x10ee61[_0xd8de('0x3d')][_0xd8de('0x43')](_0xd8de('0x44'))){_0x270e37['limit']=qs['limit'](_0x10ee61['query'][_0xd8de('0x2e')]);_0x270e37[_0xd8de('0x2d')]=qs['offset'](_0x10ee61['query']['offset']);}_0x270e37[_0xd8de('0x45')]=qs[_0xd8de('0x46')](_0x10ee61[_0xd8de('0x3d')]['sort']);_0x270e37[_0xd8de('0x47')]=qs['filters'](_[_0xd8de('0x48')](_0x10ee61[_0xd8de('0x3d')],_0x4319e5[_0xd8de('0x49')]),_0x3a06e1);if(_0x10ee61[_0xd8de('0x3d')][_0xd8de('0x4a')]){_0x270e37['where']=_[_0xd8de('0x4b')](_0x270e37['where'],{'$or':_[_0xd8de('0x3c')](_0x3a06e1,function(_0x2a1a18){if(_0x2a1a18[_0xd8de('0x39')]!==_0xd8de('0x4c')){var _0x4d7c50={};_0x4d7c50[_0x2a1a18[_0xd8de('0x4d')]]={'$like':'%'+_0x10ee61[_0xd8de('0x3d')][_0xd8de('0x4a')]+'%'};return _0x4d7c50;}})});}_0x270e37=_[_0xd8de('0x4b')]({},_0x270e37,_0x10ee61[_0xd8de('0x4e')]);var _0x1e2c03={'where':_0x270e37[_0xd8de('0x47')]};return db[_0xd8de('0x37')][_0xd8de('0x2c')](_0x1e2c03)['then'](function(_0x5acf16){_0x4c6b0c[_0xd8de('0x2c')]=_0x5acf16;if(_0x10ee61[_0xd8de('0x3d')][_0xd8de('0x4f')]){_0x270e37[_0xd8de('0x50')]=[{'all':!![]}];}return db[_0xd8de('0x37')][_0xd8de('0x51')](_0x270e37);})['then'](function(_0x307751){_0x4c6b0c[_0xd8de('0x52')]=_0x307751;return _0x4c6b0c;})[_0xd8de('0x20')](respondWithFilteredResult(_0x233906,_0x270e37))[_0xd8de('0x28')](handleError(_0x233906,null));};exports['show']=function(_0x5be68,_0x3f9cb7){var _0x3feebf={'raw':![],'where':{'id':_0x5be68['params']['id']}},_0x4c7283={};_0x4c7283[_0xd8de('0x3b')]=_[_0xd8de('0x3e')](db[_0xd8de('0x37')]['rawAttributes']);_0x4c7283[_0xd8de('0x3d')]=_[_0xd8de('0x3e')](_0x5be68[_0xd8de('0x3d')]);_0x4c7283[_0xd8de('0x49')]=_[_0xd8de('0x3f')](_0x4c7283[_0xd8de('0x3b')],_0x4c7283['query']);_0x3feebf[_0xd8de('0x40')]=_['intersection'](_0x4c7283[_0xd8de('0x3b')],qs[_0xd8de('0x41')](_0x5be68[_0xd8de('0x3d')][_0xd8de('0x41')]));_0x3feebf[_0xd8de('0x40')]=_0x3feebf[_0xd8de('0x40')][_0xd8de('0x42')]?_0x3feebf[_0xd8de('0x40')]:_0x4c7283[_0xd8de('0x3b')];if(_0x5be68['query'][_0xd8de('0x4f')]){_0x3feebf[_0xd8de('0x50')]=[{'all':!![]}];}_0x3feebf=_[_0xd8de('0x4b')]({},_0x3feebf,_0x5be68[_0xd8de('0x4e')]);return db[_0xd8de('0x37')][_0xd8de('0x53')](_0x3feebf)['then'](handleEntityNotFound(_0x3f9cb7,null))[_0xd8de('0x20')](respondWithResult(_0x3f9cb7,null))[_0xd8de('0x28')](handleError(_0x3f9cb7,null));};exports[_0xd8de('0x54')]=function(_0x16548c,_0x3a35ef){return db[_0xd8de('0x37')][_0xd8de('0x54')](_0x16548c['body'],{})[_0xd8de('0x20')](respondWithResult(_0x3a35ef,0xc9))['catch'](handleError(_0x3a35ef,null));};exports[_0xd8de('0x55')]=function(_0x9f496f,_0x5716a){if(_0x9f496f[_0xd8de('0x56')]['id']){delete _0x9f496f[_0xd8de('0x56')]['id'];}return db[_0xd8de('0x37')][_0xd8de('0x53')]({'where':{'id':_0x9f496f[_0xd8de('0x57')]['id']}})[_0xd8de('0x20')](handleEntityNotFound(_0x5716a,null))['then'](saveUpdates(_0x9f496f['body'],null))[_0xd8de('0x20')](respondWithResult(_0x5716a,null))[_0xd8de('0x28')](handleError(_0x5716a,null));};exports['destroy']=function(_0x4866cf,_0x2f562e){return db['FreshsalesConfiguration'][_0xd8de('0x53')]({'where':{'id':_0x4866cf[_0xd8de('0x57')]['id']}})[_0xd8de('0x20')](handleEntityNotFound(_0x2f562e,null))[_0xd8de('0x20')](removeEntity(_0x2f562e,null))[_0xd8de('0x28')](handleError(_0x2f562e,null));};exports[_0xd8de('0x58')]=function(_0x5bdf79,_0x4b0bf4,_0x219a1d){var _0x2e6e67={};var _0x464bf8={};var _0x376f92;var _0x5033b1;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x5bdf79[_0xd8de('0x57')]['id']}})['then'](handleEntityNotFound(_0x4b0bf4,null))[_0xd8de('0x20')](function(_0x52f70a){if(_0x52f70a){_0x376f92=_0x52f70a;_0x464bf8[_0xd8de('0x3b')]=_['keys'](db[_0xd8de('0x59')][_0xd8de('0x38')]);_0x464bf8[_0xd8de('0x3d')]=_[_0xd8de('0x3e')](_0x5bdf79[_0xd8de('0x3d')]);_0x464bf8[_0xd8de('0x49')]=_[_0xd8de('0x3f')](_0x464bf8[_0xd8de('0x3b')],_0x464bf8[_0xd8de('0x3d')]);_0x2e6e67['attributes']=_[_0xd8de('0x3f')](_0x464bf8[_0xd8de('0x3b')],qs[_0xd8de('0x41')](_0x5bdf79[_0xd8de('0x3d')][_0xd8de('0x41')]));_0x2e6e67['attributes']=_0x2e6e67['attributes'][_0xd8de('0x42')]?_0x2e6e67[_0xd8de('0x40')]:_0x464bf8[_0xd8de('0x3b')];_0x2e6e67[_0xd8de('0x45')]=qs['sort'](_0x5bdf79[_0xd8de('0x3d')][_0xd8de('0x46')]);_0x2e6e67[_0xd8de('0x47')]=qs['filters'](_[_0xd8de('0x48')](_0x5bdf79[_0xd8de('0x3d')],_0x464bf8[_0xd8de('0x49')]));if(_0x5bdf79[_0xd8de('0x3d')][_0xd8de('0x4a')]){_0x2e6e67['where']=_[_0xd8de('0x4b')](_0x2e6e67[_0xd8de('0x47')],{'$or':_[_0xd8de('0x3c')](_0x2e6e67[_0xd8de('0x40')],function(_0x1807e4){var _0x428b02={};_0x428b02[_0x1807e4]={'$like':'%'+_0x5bdf79[_0xd8de('0x3d')]['filter']+'%'};return _0x428b02;})});}_0x2e6e67=_[_0xd8de('0x4b')]({},_0x2e6e67,_0x5bdf79['options']);return _0x376f92[_0xd8de('0x58')](_0x2e6e67);}})['then'](function(_0x4c8565){if(_0x4c8565){_0x5033b1=_0x4c8565[_0xd8de('0x42')];if(!_0x5bdf79[_0xd8de('0x3d')]['hasOwnProperty'](_0xd8de('0x44'))){_0x2e6e67['limit']=qs['limit'](_0x5bdf79[_0xd8de('0x3d')][_0xd8de('0x2e')]);_0x2e6e67[_0xd8de('0x2d')]=qs[_0xd8de('0x2d')](_0x5bdf79[_0xd8de('0x3d')][_0xd8de('0x2d')]);}return _0x376f92[_0xd8de('0x58')](_0x2e6e67);}})[_0xd8de('0x20')](function(_0x148d8e){if(_0x148d8e){return _0x148d8e?{'count':_0x5033b1,'rows':_0x148d8e}:null;}})[_0xd8de('0x20')](respondWithResult(_0x4b0bf4,null))[_0xd8de('0x28')](handleError(_0x4b0bf4,null));};exports[_0xd8de('0x5a')]=function(_0x30d757,_0xd7d753,_0x373f03){var _0x674ecb={};var _0x5630b0={};var _0x3e7978;var _0x5f474a;return db[_0xd8de('0x37')][_0xd8de('0x5b')]({'where':{'id':_0x30d757[_0xd8de('0x57')]['id']}})[_0xd8de('0x20')](handleEntityNotFound(_0xd7d753,null))[_0xd8de('0x20')](function(_0x44ecb7){if(_0x44ecb7){_0x3e7978=_0x44ecb7;_0x5630b0[_0xd8de('0x3b')]=_['keys'](db['FreshsalesField'][_0xd8de('0x38')]);_0x5630b0[_0xd8de('0x3d')]=_['keys'](_0x30d757[_0xd8de('0x3d')]);_0x5630b0[_0xd8de('0x49')]=_[_0xd8de('0x3f')](_0x5630b0['model'],_0x5630b0[_0xd8de('0x3d')]);_0x674ecb[_0xd8de('0x40')]=_['intersection'](_0x5630b0['model'],qs[_0xd8de('0x41')](_0x30d757[_0xd8de('0x3d')]['fields']));_0x674ecb[_0xd8de('0x40')]=_0x674ecb[_0xd8de('0x40')]['length']?_0x674ecb[_0xd8de('0x40')]:_0x5630b0['model'];_0x674ecb[_0xd8de('0x45')]=qs[_0xd8de('0x46')](_0x30d757['query'][_0xd8de('0x46')]);_0x674ecb[_0xd8de('0x47')]=qs['filters'](_[_0xd8de('0x48')](_0x30d757['query'],_0x5630b0[_0xd8de('0x49')]));if(_0x30d757['query'][_0xd8de('0x4a')]){_0x674ecb[_0xd8de('0x47')]=_['merge'](_0x674ecb[_0xd8de('0x47')],{'$or':_[_0xd8de('0x3c')](_0x674ecb[_0xd8de('0x40')],function(_0x3105ca){var _0x319cf2={};_0x319cf2[_0x3105ca]={'$like':'%'+_0x30d757[_0xd8de('0x3d')][_0xd8de('0x4a')]+'%'};return _0x319cf2;})});}_0x674ecb=_[_0xd8de('0x4b')]({},_0x674ecb,_0x30d757[_0xd8de('0x4e')]);return _0x3e7978[_0xd8de('0x5a')](_0x674ecb);}})['then'](function(_0x4d8187){if(_0x4d8187){_0x5f474a=_0x4d8187[_0xd8de('0x42')];if(!_0x30d757[_0xd8de('0x3d')]['hasOwnProperty'](_0xd8de('0x44'))){_0x674ecb[_0xd8de('0x2e')]=qs[_0xd8de('0x2e')](_0x30d757['query'][_0xd8de('0x2e')]);_0x674ecb[_0xd8de('0x2d')]=qs['offset'](_0x30d757[_0xd8de('0x3d')][_0xd8de('0x2d')]);}return _0x3e7978['getDescriptions'](_0x674ecb);}})['then'](function(_0x2d0235){if(_0x2d0235){return _0x2d0235?{'count':_0x5f474a,'rows':_0x2d0235}:null;}})[_0xd8de('0x20')](respondWithResult(_0xd7d753,null))[_0xd8de('0x28')](handleError(_0xd7d753,null));};exports[_0xd8de('0x5c')]=function(_0x3aaee8,_0x1b26f5,_0x40e299){var _0x4f1e47={};var _0x4014ee={};var _0x1b7432;var _0x346a91;return db[_0xd8de('0x37')][_0xd8de('0x5b')]({'where':{'id':_0x3aaee8[_0xd8de('0x57')]['id']}})[_0xd8de('0x20')](handleEntityNotFound(_0x1b26f5,null))[_0xd8de('0x20')](function(_0x3e005e){if(_0x3e005e){_0x1b7432=_0x3e005e;_0x4014ee['model']=_['keys'](db[_0xd8de('0x59')]['rawAttributes']);_0x4014ee[_0xd8de('0x3d')]=_[_0xd8de('0x3e')](_0x3aaee8['query']);_0x4014ee['filters']=_[_0xd8de('0x3f')](_0x4014ee[_0xd8de('0x3b')],_0x4014ee[_0xd8de('0x3d')]);_0x4f1e47[_0xd8de('0x40')]=_['intersection'](_0x4014ee['model'],qs[_0xd8de('0x41')](_0x3aaee8[_0xd8de('0x3d')][_0xd8de('0x41')]));_0x4f1e47[_0xd8de('0x40')]=_0x4f1e47[_0xd8de('0x40')][_0xd8de('0x42')]?_0x4f1e47['attributes']:_0x4014ee[_0xd8de('0x3b')];_0x4f1e47[_0xd8de('0x45')]=qs[_0xd8de('0x46')](_0x3aaee8[_0xd8de('0x3d')]['sort']);_0x4f1e47[_0xd8de('0x47')]=qs[_0xd8de('0x49')](_[_0xd8de('0x48')](_0x3aaee8[_0xd8de('0x3d')],_0x4014ee[_0xd8de('0x49')]));if(_0x3aaee8['query']['filter']){_0x4f1e47[_0xd8de('0x47')]=_[_0xd8de('0x4b')](_0x4f1e47['where'],{'$or':_['map'](_0x4f1e47['attributes'],function(_0x392600){var _0x427b6b={};_0x427b6b[_0x392600]={'$like':'%'+_0x3aaee8[_0xd8de('0x3d')]['filter']+'%'};return _0x427b6b;})});}_0x4f1e47=_[_0xd8de('0x4b')]({},_0x4f1e47,_0x3aaee8[_0xd8de('0x4e')]);return _0x1b7432[_0xd8de('0x5c')](_0x4f1e47);}})[_0xd8de('0x20')](function(_0x37f959){if(_0x37f959){_0x346a91=_0x37f959[_0xd8de('0x42')];if(!_0x3aaee8[_0xd8de('0x3d')][_0xd8de('0x43')](_0xd8de('0x44'))){_0x4f1e47[_0xd8de('0x2e')]=qs[_0xd8de('0x2e')](_0x3aaee8[_0xd8de('0x3d')][_0xd8de('0x2e')]);_0x4f1e47[_0xd8de('0x2d')]=qs['offset'](_0x3aaee8['query'][_0xd8de('0x2d')]);}return _0x1b7432[_0xd8de('0x5c')](_0x4f1e47);}})[_0xd8de('0x20')](function(_0x24bc97){if(_0x24bc97){return _0x24bc97?{'count':_0x346a91,'rows':_0x24bc97}:null;}})[_0xd8de('0x20')](respondWithResult(_0x1b26f5,null))[_0xd8de('0x28')](handleError(_0x1b26f5,null));};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
index 76f3b99..698df68 100644
--- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
+++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5055=['api','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','../../config/logger'];(function(_0x9d0e74,_0x40807a){var _0x21b6dd=function(_0x3c0ed3){while(--_0x3c0ed3){_0x9d0e74['push'](_0x9d0e74['shift']());}};_0x21b6dd(++_0x40807a);}(_0x5055,0xef));var _0x5505=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5055[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5505('0x0'))(_0x5505('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5505('0x2'));var fs=require('fs');var path=require(_0x5505('0x3'));var rimraf=require(_0x5505('0x4'));var config=require(_0x5505('0x5'));var attributes=require(_0x5505('0x6'));module[_0x5505('0x7')]=function(_0x12c466,_0x37b8cf){return _0x12c466[_0x5505('0x8')](_0x5505('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c97=['define','int_freshsales_configurations','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x5c97,0x11a));var _0x75c9=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x5c97[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x75c9('0x0'))(_0x75c9('0x1'));var moment=require(_0x75c9('0x2'));var BPromise=require(_0x75c9('0x3'));var rp=require(_0x75c9('0x4'));var fs=require('fs');var path=require(_0x75c9('0x5'));var rimraf=require('rimraf');var config=require(_0x75c9('0x6'));var attributes=require(_0x75c9('0x7'));module['exports']=function(_0x204be7,_0x5784ad){return _0x204be7[_0x75c9('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x75c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
index 2be02c8..d3c98a8 100644
--- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
+++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x138d=['FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x31fd0a,_0x1c41aa){var _0x11e7d1=function(_0x5b18df){while(--_0x5b18df){_0x31fd0a['push'](_0x31fd0a['shift']());}};_0x11e7d1(++_0x1c41aa);}(_0x138d,0x1ab));var _0xd138=function(_0x5c98ea,_0xa782aa){_0x5c98ea=_0x5c98ea-0x0;var _0x51e853=_0x138d[_0x5c98ea];return _0x51e853;};'use strict';var _=require(_0xd138('0x0'));var util=require(_0xd138('0x1'));var moment=require('moment');var BPromise=require(_0xd138('0x2'));var rs=require(_0xd138('0x3'));var fs=require('fs');var Redis=require(_0xd138('0x4'));var db=require(_0xd138('0x5'))['db'];var utils=require(_0xd138('0x6'));var logger=require(_0xd138('0x7'))('rpc');var config=require(_0xd138('0x8'));var jayson=require(_0xd138('0x9'));var client=jayson[_0xd138('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19869d,_0x1edfa7,_0x117c23){return new BPromise(function(_0x5790ff,_0x54e1f2){return client[_0xd138('0xb')](_0x19869d,_0x117c23)[_0xd138('0xc')](function(_0x121cce){logger['info'](_0xd138('0xd'),_0x1edfa7,'request\x20sent');logger['debug'](_0xd138('0xe'),_0x1edfa7,_0xd138('0xf'),JSON[_0xd138('0x10')](_0x121cce));if(_0x121cce[_0xd138('0x11')]){if(_0x121cce['error'][_0xd138('0x12')]===0x1f4){logger['error'](_0xd138('0xd'),_0x1edfa7,_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);return _0x54e1f2(_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);}logger[_0xd138('0x11')](_0xd138('0xd'),_0x1edfa7,_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);return _0x5790ff(_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);}else{logger[_0xd138('0x14')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1edfa7,_0xd138('0xf'));_0x5790ff(_0x121cce[_0xd138('0x15')]['message']);}})['catch'](function(_0x502d3b){logger[_0xd138('0x11')](_0xd138('0xd'),_0x1edfa7,_0x502d3b);_0x54e1f2(_0x502d3b);});});}
\ No newline at end of file
+var _0x9173=['client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1478d7,_0x5b83bb){var _0x5172e7=function(_0x3905c2){while(--_0x3905c2){_0x1478d7['push'](_0x1478d7['shift']());}};_0x5172e7(++_0x5b83bb);}(_0x9173,0xb4));var _0x3917=function(_0x352f3e,_0x324cf6){_0x352f3e=_0x352f3e-0x0;var _0x9d3d07=_0x9173[_0x352f3e];return _0x9d3d07;};'use strict';var _=require(_0x3917('0x0'));var util=require(_0x3917('0x1'));var moment=require('moment');var BPromise=require(_0x3917('0x2'));var rs=require(_0x3917('0x3'));var fs=require('fs');var Redis=require(_0x3917('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3917('0x5'));var logger=require('../../config/logger')(_0x3917('0x6'));var config=require(_0x3917('0x7'));var jayson=require(_0x3917('0x8'));var client=jayson[_0x3917('0x9')][_0x3917('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d592,_0x181918,_0x27f513){return new BPromise(function(_0x11267b,_0x44d50e){return client[_0x3917('0xb')](_0x48d592,_0x27f513)[_0x3917('0xc')](function(_0x58282f){logger[_0x3917('0xd')](_0x3917('0xe'),_0x181918,'request\x20sent');logger[_0x3917('0xf')](_0x3917('0x10'),_0x181918,'request\x20sent',JSON['stringify'](_0x58282f));if(_0x58282f['error']){if(_0x58282f[_0x3917('0x11')][_0x3917('0x12')]===0x1f4){logger[_0x3917('0x11')](_0x3917('0xe'),_0x181918,_0x58282f[_0x3917('0x11')][_0x3917('0x13')]);return _0x44d50e(_0x58282f['error'][_0x3917('0x13')]);}logger[_0x3917('0x11')](_0x3917('0xe'),_0x181918,_0x58282f[_0x3917('0x11')]['message']);return _0x11267b(_0x58282f[_0x3917('0x11')][_0x3917('0x13')]);}else{logger[_0x3917('0xd')](_0x3917('0xe'),_0x181918,_0x3917('0x14'));_0x11267b(_0x58282f['result'][_0x3917('0x13')]);}})['catch'](function(_0x4912cd){logger[_0x3917('0x11')](_0x3917('0xe'),_0x181918,_0x4912cd);_0x44d50e(_0x4912cd);});});}
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js
index d918e5b..cf99594 100644
--- a/server/api/intFreshsalesField/index.js
+++ b/server/api/intFreshsalesField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5d33=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports'];(function(_0x39940d,_0x42d30c){var _0x492a28=function(_0x152b2d){while(--_0x152b2d){_0x39940d['push'](_0x39940d['shift']());}};_0x492a28(++_0x42d30c);}(_0x5d33,0x1b0));var _0x35d3=function(_0x393f10,_0x24c7cb){_0x393f10=_0x393f10-0x0;var _0x480dd4=_0x5d33[_0x393f10];return _0x480dd4;};'use strict';var multer=require(_0x35d3('0x0'));var util=require(_0x35d3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x35d3('0x2'));var router=express[_0x35d3('0x3')]();var auth=require(_0x35d3('0x4'));var interaction=require(_0x35d3('0x5'));var config=require(_0x35d3('0x6'));var controller=require(_0x35d3('0x7'));router['get']('/',auth[_0x35d3('0x8')](),controller[_0x35d3('0x9')]);router['get'](_0x35d3('0xa'),auth[_0x35d3('0x8')](),controller[_0x35d3('0xb')]);router[_0x35d3('0xc')]('/',auth[_0x35d3('0x8')](),controller[_0x35d3('0xd')]);router[_0x35d3('0xe')](_0x35d3('0xa'),auth['isAuthenticated'](),controller[_0x35d3('0xf')]);router[_0x35d3('0x10')](_0x35d3('0xa'),auth[_0x35d3('0x8')](),controller['destroy']);module[_0x35d3('0x11')]=router;
\ No newline at end of file
+var _0x86d6=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2301d3,_0xe7f24e){var _0x51d0f6=function(_0x570fae){while(--_0x570fae){_0x2301d3['push'](_0x2301d3['shift']());}};_0x51d0f6(++_0xe7f24e);}(_0x86d6,0x1ad));var _0x686d=function(_0x3a7b2c,_0x1c025b){_0x3a7b2c=_0x3a7b2c-0x0;var _0x4b7ce5=_0x86d6[_0x3a7b2c];return _0x4b7ce5;};'use strict';var multer=require(_0x686d('0x0'));var util=require(_0x686d('0x1'));var path=require(_0x686d('0x2'));var timeout=require(_0x686d('0x3'));var express=require('express');var router=express[_0x686d('0x4')]();var auth=require(_0x686d('0x5'));var interaction=require(_0x686d('0x6'));var config=require(_0x686d('0x7'));var controller=require(_0x686d('0x8'));router[_0x686d('0x9')]('/',auth[_0x686d('0xa')](),controller['index']);router['get'](_0x686d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x686d('0xc')]('/',auth[_0x686d('0xa')](),controller['create']);router[_0x686d('0xd')](_0x686d('0xb'),auth[_0x686d('0xa')](),controller[_0x686d('0xe')]);router[_0x686d('0xf')]('/:id',auth[_0x686d('0xa')](),controller[_0x686d('0x10')]);module[_0x686d('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js
index 83ff137..78f85b8 100644
--- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js
+++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x24d3=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x1dab75,_0x584b43){var _0x59df44=function(_0x5f5536){while(--_0x5f5536){_0x1dab75['push'](_0x1dab75['shift']());}};_0x59df44(++_0x584b43);}(_0x24d3,0xcf));var _0x324d=function(_0x577227,_0x37be3a){_0x577227=_0x577227-0x0;var _0x5c6afd=_0x24d3[_0x577227];return _0x5c6afd;};'use strict';var Sequelize=require(_0x324d('0x0'));module[_0x324d('0x1')]={'type':{'type':Sequelize[_0x324d('0x2')](_0x324d('0x3'),_0x324d('0x4'),_0x324d('0x5'),_0x324d('0x6')),'defaultValue':_0x324d('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x324d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x324d('0x3'),_0x324d('0x4'),_0x324d('0x5'))},'keyContent':{'type':Sequelize[_0x324d('0x7')]},'idField':{'type':Sequelize[_0x324d('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x324d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x324d('0x7')]}};
\ No newline at end of file
+var _0xeb1e=['string','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2fceeb,_0x2f8be3){var _0x5ec9ad=function(_0x45edfc){while(--_0x45edfc){_0x2fceeb['push'](_0x2fceeb['shift']());}};_0x5ec9ad(++_0x2f8be3);}(_0xeb1e,0x115));var _0xeeb1=function(_0x28db8c,_0x4b17c6){_0x28db8c=_0x28db8c-0x0;var _0x2acc78=_0xeb1e[_0x28db8c];return _0x2acc78;};'use strict';var Sequelize=require(_0xeeb1('0x0'));module[_0xeeb1('0x1')]={'type':{'type':Sequelize[_0xeeb1('0x2')](_0xeeb1('0x3'),'variable',_0xeeb1('0x4'),_0xeeb1('0x5')),'defaultValue':_0xeeb1('0x3')},'content':{'type':Sequelize[_0xeeb1('0x6')]},'key':{'type':Sequelize[_0xeeb1('0x6')]},'keyType':{'type':Sequelize[_0xeeb1('0x2')](_0xeeb1('0x3'),'variable',_0xeeb1('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xeeb1('0x6')]},'nameField':{'type':Sequelize[_0xeeb1('0x6')]},'customField':{'type':Sequelize[_0xeeb1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeeb1('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js
index 28e7f7a..4e295f6 100644
--- a/server/api/intFreshsalesField/intFreshsalesField.controller.js
+++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ad5=['update','body','html-pdf','eml-format','rimraf','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','apply','reject','save','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create'];(function(_0x1ace56,_0x1509be){var _0x5005c8=function(_0x179818){while(--_0x179818){_0x1ace56['push'](_0x1ace56['shift']());}};_0x5005c8(++_0x1509be);}(_0x4ad5,0x174));var _0x54ad=function(_0x2a2569,_0x53f529){_0x2a2569=_0x2a2569-0x0;var _0x490e52=_0x4ad5[_0x2a2569];return _0x490e52;};'use strict';var pdf=require(_0x54ad('0x0'));var emlformat=require(_0x54ad('0x1'));var rimraf=require(_0x54ad('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x54ad('0x3'));var Mustache=require(_0x54ad('0x4'));var util=require(_0x54ad('0x5'));var path=require(_0x54ad('0x6'));var sox=require(_0x54ad('0x7'));var csv=require('to-csv');var ejs=require(_0x54ad('0x8'));var fs=require('fs');var _=require(_0x54ad('0x9'));var squel=require(_0x54ad('0xa'));var crypto=require(_0x54ad('0xb'));var jsforce=require(_0x54ad('0xc'));var deskjs=require(_0x54ad('0xd'));var toCsv=require('to-csv');var querystring=require(_0x54ad('0xe'));var Papa=require(_0x54ad('0xf'));var Redis=require('ioredis');var authService=require(_0x54ad('0x10'));var qs=require(_0x54ad('0x11'));var as=require(_0x54ad('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54ad('0x13'))(_0x54ad('0x14'));var utils=require(_0x54ad('0x15'));var config=require(_0x54ad('0x16'));var db=require(_0x54ad('0x17'))['db'];function respondWithStatusCode(_0x59c216,_0x3daa17){_0x3daa17=_0x3daa17||0xcc;return function(_0x1eb443){if(_0x1eb443){return _0x59c216[_0x54ad('0x18')](_0x3daa17);}return _0x59c216[_0x54ad('0x19')](_0x3daa17)[_0x54ad('0x1a')]();};}function respondWithResult(_0xf552dd,_0x47e412){_0x47e412=_0x47e412||0xc8;return function(_0x8af55b){if(_0x8af55b){return _0xf552dd[_0x54ad('0x19')](_0x47e412)['json'](_0x8af55b);}};}function respondWithFilteredResult(_0x153587,_0x138202){return function(_0x4d2819){if(_0x4d2819){var _0x9cb13=_0x4d2819['count'],_0x1f73cd=_0x138202[_0x54ad('0x1b')],_0x226700=_0x138202[_0x54ad('0x1b')]+_0x138202[_0x54ad('0x1c')],_0xdb9e4f;if(_0x226700>=_0x9cb13){_0x226700=_0x9cb13;_0xdb9e4f=0xc8;}else{_0xdb9e4f=0xce;}_0x153587['status'](_0xdb9e4f);return _0x153587[_0x54ad('0x1d')]('Content-Range',_0x1f73cd+'-'+_0x226700+'/'+_0x9cb13)['json'](_0x4d2819);}return null;};}function patchUpdates(_0x191ecc){return function(_0x204c04){try{jsonpatch[_0x54ad('0x1e')](_0x204c04,_0x191ecc,!![]);}catch(_0x3428d3){return BPromise[_0x54ad('0x1f')](_0x3428d3);}return _0x204c04[_0x54ad('0x20')]();};}function saveUpdates(_0x3ddc08,_0x1bcfbe){return function(_0x5021cd){if(_0x5021cd){return _0x5021cd['update'](_0x3ddc08)['then'](function(_0x18ade5){return _0x18ade5;});}return null;};}function removeEntity(_0x1401b6,_0x2e46e5){return function(_0x102e14){if(_0x102e14){return _0x102e14[_0x54ad('0x21')]()[_0x54ad('0x22')](function(){_0x1401b6[_0x54ad('0x19')](0xcc)[_0x54ad('0x1a')]();});}};}function handleEntityNotFound(_0x1863ff,_0x34dc60){return function(_0x3975b5){if(!_0x3975b5){_0x1863ff[_0x54ad('0x18')](0x194);}return _0x3975b5;};}function handleError(_0x36d95d,_0x4bfc74){_0x4bfc74=_0x4bfc74||0x1f4;return function(_0x3ec08f){logger[_0x54ad('0x23')](_0x3ec08f[_0x54ad('0x24')]);if(_0x3ec08f[_0x54ad('0x25')]){delete _0x3ec08f['name'];}_0x36d95d['status'](_0x4bfc74)[_0x54ad('0x26')](_0x3ec08f);};}exports[_0x54ad('0x27')]=function(_0x334355,_0x1f90c1){var _0x5c0e74={},_0x373a5c={},_0x4be4a2={'count':0x0,'rows':[]};var _0x388bb3=_[_0x54ad('0x28')](db[_0x54ad('0x29')][_0x54ad('0x2a')],function(_0x1eca3d){return{'name':_0x1eca3d[_0x54ad('0x2b')],'type':_0x1eca3d['type']['key']};});_0x373a5c[_0x54ad('0x2c')]=_[_0x54ad('0x28')](_0x388bb3,_0x54ad('0x25'));_0x373a5c[_0x54ad('0x2d')]=_['keys'](_0x334355[_0x54ad('0x2d')]);_0x373a5c[_0x54ad('0x2e')]=_[_0x54ad('0x2f')](_0x373a5c['model'],_0x373a5c[_0x54ad('0x2d')]);_0x5c0e74['attributes']=_['intersection'](_0x373a5c['model'],qs[_0x54ad('0x30')](_0x334355[_0x54ad('0x2d')][_0x54ad('0x30')]));_0x5c0e74['attributes']=_0x5c0e74[_0x54ad('0x31')][_0x54ad('0x32')]?_0x5c0e74[_0x54ad('0x31')]:_0x373a5c[_0x54ad('0x2c')];if(!_0x334355[_0x54ad('0x2d')][_0x54ad('0x33')](_0x54ad('0x34'))){_0x5c0e74[_0x54ad('0x1c')]=qs[_0x54ad('0x1c')](_0x334355[_0x54ad('0x2d')][_0x54ad('0x1c')]);_0x5c0e74['offset']=qs['offset'](_0x334355[_0x54ad('0x2d')]['offset']);}_0x5c0e74[_0x54ad('0x35')]=qs[_0x54ad('0x36')](_0x334355[_0x54ad('0x2d')][_0x54ad('0x36')]);_0x5c0e74['where']=qs[_0x54ad('0x2e')](_[_0x54ad('0x37')](_0x334355['query'],_0x373a5c['filters']),_0x388bb3);if(_0x334355[_0x54ad('0x2d')][_0x54ad('0x38')]){_0x5c0e74[_0x54ad('0x39')]=_[_0x54ad('0x3a')](_0x5c0e74[_0x54ad('0x39')],{'$or':_[_0x54ad('0x28')](_0x388bb3,function(_0x5d935c){if(_0x5d935c[_0x54ad('0x3b')]!=='VIRTUAL'){var _0x5339b5={};_0x5339b5[_0x5d935c[_0x54ad('0x25')]]={'$like':'%'+_0x334355[_0x54ad('0x2d')]['filter']+'%'};return _0x5339b5;}})});}_0x5c0e74=_[_0x54ad('0x3a')]({},_0x5c0e74,_0x334355[_0x54ad('0x3c')]);var _0x47ec9e={'where':_0x5c0e74[_0x54ad('0x39')]};return db['FreshsalesField'][_0x54ad('0x3d')](_0x47ec9e)[_0x54ad('0x22')](function(_0x523cb9){_0x4be4a2[_0x54ad('0x3d')]=_0x523cb9;if(_0x334355[_0x54ad('0x2d')][_0x54ad('0x3e')]){_0x5c0e74[_0x54ad('0x3f')]=[{'all':!![]}];}return db['FreshsalesField'][_0x54ad('0x40')](_0x5c0e74);})[_0x54ad('0x22')](function(_0x5c2aa8){_0x4be4a2[_0x54ad('0x41')]=_0x5c2aa8;return _0x4be4a2;})[_0x54ad('0x22')](respondWithFilteredResult(_0x1f90c1,_0x5c0e74))[_0x54ad('0x42')](handleError(_0x1f90c1,null));};exports[_0x54ad('0x43')]=function(_0x562ddb,_0x481784){var _0x5e2079={'raw':!![],'where':{'id':_0x562ddb[_0x54ad('0x44')]['id']}},_0x8d3b73={};_0x8d3b73[_0x54ad('0x2c')]=_[_0x54ad('0x45')](db[_0x54ad('0x29')]['rawAttributes']);_0x8d3b73['query']=_[_0x54ad('0x45')](_0x562ddb['query']);_0x8d3b73[_0x54ad('0x2e')]=_[_0x54ad('0x2f')](_0x8d3b73[_0x54ad('0x2c')],_0x8d3b73[_0x54ad('0x2d')]);_0x5e2079[_0x54ad('0x31')]=_[_0x54ad('0x2f')](_0x8d3b73[_0x54ad('0x2c')],qs[_0x54ad('0x30')](_0x562ddb[_0x54ad('0x2d')]['fields']));_0x5e2079[_0x54ad('0x31')]=_0x5e2079['attributes'][_0x54ad('0x32')]?_0x5e2079['attributes']:_0x8d3b73[_0x54ad('0x2c')];if(_0x562ddb[_0x54ad('0x2d')][_0x54ad('0x3e')]){_0x5e2079[_0x54ad('0x3f')]=[{'all':!![]}];}_0x5e2079=_[_0x54ad('0x3a')]({},_0x5e2079,_0x562ddb['options']);return db['FreshsalesField'][_0x54ad('0x46')](_0x5e2079)[_0x54ad('0x22')](handleEntityNotFound(_0x481784,null))['then'](respondWithResult(_0x481784,null))[_0x54ad('0x42')](handleError(_0x481784,null));};exports[_0x54ad('0x47')]=function(_0xb01f2f,_0x2f7211){return db[_0x54ad('0x29')][_0x54ad('0x47')](_0xb01f2f['body'],{})['then'](respondWithResult(_0x2f7211,0xc9))[_0x54ad('0x42')](handleError(_0x2f7211,null));};exports[_0x54ad('0x48')]=function(_0x377a25,_0x3a1658){if(_0x377a25[_0x54ad('0x49')]['id']){delete _0x377a25[_0x54ad('0x49')]['id'];}return db[_0x54ad('0x29')]['find']({'where':{'id':_0x377a25['params']['id']}})[_0x54ad('0x22')](handleEntityNotFound(_0x3a1658,null))[_0x54ad('0x22')](saveUpdates(_0x377a25['body'],null))[_0x54ad('0x22')](respondWithResult(_0x3a1658,null))[_0x54ad('0x42')](handleError(_0x3a1658,null));};exports[_0x54ad('0x21')]=function(_0x29c5f9,_0x4a0ba6){return db[_0x54ad('0x29')][_0x54ad('0x46')]({'where':{'id':_0x29c5f9[_0x54ad('0x44')]['id']}})[_0x54ad('0x22')](handleEntityNotFound(_0x4a0ba6,null))['then'](removeEntity(_0x4a0ba6,null))['catch'](handleError(_0x4a0ba6,null));};
\ No newline at end of file
+var _0x9152=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','intersection','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','squel','desk.js','querystring'];(function(_0x45dafa,_0x171e29){var _0xeb385a=function(_0x2491d0){while(--_0x2491d0){_0x45dafa['push'](_0x45dafa['shift']());}};_0xeb385a(++_0x171e29);}(_0x9152,0x86));var _0x2915=function(_0x8ef16d,_0x37ab0c){_0x8ef16d=_0x8ef16d-0x0;var _0x4f26c6=_0x9152[_0x8ef16d];return _0x4f26c6;};'use strict';var pdf=require(_0x2915('0x0'));var emlformat=require(_0x2915('0x1'));var rimraf=require(_0x2915('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2915('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2915('0x4'));var util=require(_0x2915('0x5'));var path=require(_0x2915('0x6'));var sox=require(_0x2915('0x7'));var csv=require(_0x2915('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2915('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2915('0xa'));var toCsv=require(_0x2915('0x8'));var querystring=require(_0x2915('0xb'));var Papa=require(_0x2915('0xc'));var Redis=require(_0x2915('0xd'));var authService=require(_0x2915('0xe'));var qs=require(_0x2915('0xf'));var as=require(_0x2915('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2915('0x11'))(_0x2915('0x12'));var utils=require(_0x2915('0x13'));var config=require(_0x2915('0x14'));var db=require(_0x2915('0x15'))['db'];function respondWithStatusCode(_0x5b4d47,_0x14dce7){_0x14dce7=_0x14dce7||0xcc;return function(_0x55ec36){if(_0x55ec36){return _0x5b4d47[_0x2915('0x16')](_0x14dce7);}return _0x5b4d47[_0x2915('0x17')](_0x14dce7)['end']();};}function respondWithResult(_0x36b602,_0x19c1e3){_0x19c1e3=_0x19c1e3||0xc8;return function(_0x2ecc55){if(_0x2ecc55){return _0x36b602[_0x2915('0x17')](_0x19c1e3)[_0x2915('0x18')](_0x2ecc55);}};}function respondWithFilteredResult(_0x201397,_0x4cca07){return function(_0x1c164e){if(_0x1c164e){var _0x517ae6=_0x1c164e[_0x2915('0x19')],_0x297011=_0x4cca07['offset'],_0x5c7ba1=_0x4cca07[_0x2915('0x1a')]+_0x4cca07[_0x2915('0x1b')],_0x42d00f;if(_0x5c7ba1>=_0x517ae6){_0x5c7ba1=_0x517ae6;_0x42d00f=0xc8;}else{_0x42d00f=0xce;}_0x201397[_0x2915('0x17')](_0x42d00f);return _0x201397[_0x2915('0x1c')](_0x2915('0x1d'),_0x297011+'-'+_0x5c7ba1+'/'+_0x517ae6)[_0x2915('0x18')](_0x1c164e);}return null;};}function patchUpdates(_0x15f399){return function(_0x5076a4){try{jsonpatch[_0x2915('0x1e')](_0x5076a4,_0x15f399,!![]);}catch(_0x454741){return BPromise[_0x2915('0x1f')](_0x454741);}return _0x5076a4[_0x2915('0x20')]();};}function saveUpdates(_0x3e56fe,_0x50a245){return function(_0x7503d6){if(_0x7503d6){return _0x7503d6[_0x2915('0x21')](_0x3e56fe)[_0x2915('0x22')](function(_0x1c83ec){return _0x1c83ec;});}return null;};}function removeEntity(_0x4a8abb,_0x268de1){return function(_0x1faff8){if(_0x1faff8){return _0x1faff8['destroy']()['then'](function(){_0x4a8abb['status'](0xcc)[_0x2915('0x23')]();});}};}function handleEntityNotFound(_0x21efb0,_0x38e3d8){return function(_0x273f52){if(!_0x273f52){_0x21efb0['sendStatus'](0x194);}return _0x273f52;};}function handleError(_0x5d8e47,_0x3ea3a3){_0x3ea3a3=_0x3ea3a3||0x1f4;return function(_0x467a8f){logger[_0x2915('0x24')](_0x467a8f['stack']);if(_0x467a8f['name']){delete _0x467a8f[_0x2915('0x25')];}_0x5d8e47['status'](_0x3ea3a3)['send'](_0x467a8f);};}exports[_0x2915('0x26')]=function(_0x4e543b,_0x2f90a4){var _0x53850f={},_0x4861de={},_0xb0612b={'count':0x0,'rows':[]};var _0x5958fe=_[_0x2915('0x27')](db[_0x2915('0x28')][_0x2915('0x29')],function(_0x26e394){return{'name':_0x26e394[_0x2915('0x2a')],'type':_0x26e394[_0x2915('0x2b')][_0x2915('0x2c')]};});_0x4861de[_0x2915('0x2d')]=_[_0x2915('0x27')](_0x5958fe,'name');_0x4861de[_0x2915('0x2e')]=_[_0x2915('0x2f')](_0x4e543b[_0x2915('0x2e')]);_0x4861de[_0x2915('0x30')]=_['intersection'](_0x4861de[_0x2915('0x2d')],_0x4861de[_0x2915('0x2e')]);_0x53850f['attributes']=_['intersection'](_0x4861de[_0x2915('0x2d')],qs[_0x2915('0x31')](_0x4e543b['query']['fields']));_0x53850f[_0x2915('0x32')]=_0x53850f[_0x2915('0x32')][_0x2915('0x33')]?_0x53850f[_0x2915('0x32')]:_0x4861de[_0x2915('0x2d')];if(!_0x4e543b[_0x2915('0x2e')][_0x2915('0x34')](_0x2915('0x35'))){_0x53850f[_0x2915('0x1b')]=qs['limit'](_0x4e543b['query'][_0x2915('0x1b')]);_0x53850f[_0x2915('0x1a')]=qs[_0x2915('0x1a')](_0x4e543b['query']['offset']);}_0x53850f[_0x2915('0x36')]=qs[_0x2915('0x37')](_0x4e543b[_0x2915('0x2e')][_0x2915('0x37')]);_0x53850f[_0x2915('0x38')]=qs[_0x2915('0x30')](_[_0x2915('0x39')](_0x4e543b[_0x2915('0x2e')],_0x4861de[_0x2915('0x30')]),_0x5958fe);if(_0x4e543b[_0x2915('0x2e')][_0x2915('0x3a')]){_0x53850f[_0x2915('0x38')]=_[_0x2915('0x3b')](_0x53850f['where'],{'$or':_['map'](_0x5958fe,function(_0x4ccf3c){if(_0x4ccf3c['type']!==_0x2915('0x3c')){var _0x519106={};_0x519106[_0x4ccf3c['name']]={'$like':'%'+_0x4e543b['query'][_0x2915('0x3a')]+'%'};return _0x519106;}})});}_0x53850f=_[_0x2915('0x3b')]({},_0x53850f,_0x4e543b[_0x2915('0x3d')]);var _0x9a0971={'where':_0x53850f['where']};return db['FreshsalesField'][_0x2915('0x19')](_0x9a0971)[_0x2915('0x22')](function(_0xcc8bf0){_0xb0612b['count']=_0xcc8bf0;if(_0x4e543b[_0x2915('0x2e')][_0x2915('0x3e')]){_0x53850f[_0x2915('0x3f')]=[{'all':!![]}];}return db[_0x2915('0x28')][_0x2915('0x40')](_0x53850f);})[_0x2915('0x22')](function(_0x153944){_0xb0612b[_0x2915('0x41')]=_0x153944;return _0xb0612b;})[_0x2915('0x22')](respondWithFilteredResult(_0x2f90a4,_0x53850f))['catch'](handleError(_0x2f90a4,null));};exports['show']=function(_0x265120,_0x544a69){var _0x577a5a={'raw':!![],'where':{'id':_0x265120[_0x2915('0x42')]['id']}},_0x23a062={};_0x23a062[_0x2915('0x2d')]=_[_0x2915('0x2f')](db[_0x2915('0x28')][_0x2915('0x29')]);_0x23a062[_0x2915('0x2e')]=_['keys'](_0x265120['query']);_0x23a062[_0x2915('0x30')]=_[_0x2915('0x43')](_0x23a062[_0x2915('0x2d')],_0x23a062[_0x2915('0x2e')]);_0x577a5a[_0x2915('0x32')]=_[_0x2915('0x43')](_0x23a062['model'],qs[_0x2915('0x31')](_0x265120['query']['fields']));_0x577a5a['attributes']=_0x577a5a[_0x2915('0x32')][_0x2915('0x33')]?_0x577a5a[_0x2915('0x32')]:_0x23a062[_0x2915('0x2d')];if(_0x265120[_0x2915('0x2e')]['includeAll']){_0x577a5a['include']=[{'all':!![]}];}_0x577a5a=_[_0x2915('0x3b')]({},_0x577a5a,_0x265120['options']);return db[_0x2915('0x28')][_0x2915('0x44')](_0x577a5a)['then'](handleEntityNotFound(_0x544a69,null))['then'](respondWithResult(_0x544a69,null))[_0x2915('0x45')](handleError(_0x544a69,null));};exports['create']=function(_0xbaaece,_0x35c625){return db[_0x2915('0x28')][_0x2915('0x46')](_0xbaaece['body'],{})[_0x2915('0x22')](respondWithResult(_0x35c625,0xc9))[_0x2915('0x45')](handleError(_0x35c625,null));};exports[_0x2915('0x21')]=function(_0x391b63,_0x52cbc3){if(_0x391b63[_0x2915('0x47')]['id']){delete _0x391b63[_0x2915('0x47')]['id'];}return db[_0x2915('0x28')]['find']({'where':{'id':_0x391b63[_0x2915('0x42')]['id']}})[_0x2915('0x22')](handleEntityNotFound(_0x52cbc3,null))['then'](saveUpdates(_0x391b63[_0x2915('0x47')],null))[_0x2915('0x22')](respondWithResult(_0x52cbc3,null))[_0x2915('0x45')](handleError(_0x52cbc3,null));};exports[_0x2915('0x48')]=function(_0x59db06,_0x308171){return db[_0x2915('0x28')]['find']({'where':{'id':_0x59db06[_0x2915('0x42')]['id']}})[_0x2915('0x22')](handleEntityNotFound(_0x308171,null))['then'](removeEntity(_0x308171,null))[_0x2915('0x45')](handleError(_0x308171,null));};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js
index f91e2d8..4a00840 100644
--- a/server/api/intFreshsalesField/intFreshsalesField.model.js
+++ b/server/api/intFreshsalesField/intFreshsalesField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55cb=['bluebird','path','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','lodash','util','../../config/logger','api'];(function(_0x3f6c8d,_0x40f3d7){var _0x2efde0=function(_0x2b8e30){while(--_0x2b8e30){_0x3f6c8d['push'](_0x3f6c8d['shift']());}};_0x2efde0(++_0x40f3d7);}(_0x55cb,0x151));var _0xb55c=function(_0xe9c8e4,_0x3aa2f6){_0xe9c8e4=_0xe9c8e4-0x0;var _0x2037fa=_0x55cb[_0xe9c8e4];return _0x2037fa;};'use strict';var _=require(_0xb55c('0x0'));var util=require(_0xb55c('0x1'));var logger=require(_0xb55c('0x2'))(_0xb55c('0x3'));var moment=require('moment');var BPromise=require(_0xb55c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb55c('0x5'));var rimraf=require('rimraf');var config=require(_0xb55c('0x6'));var attributes=require(_0xb55c('0x7'));module[_0xb55c('0x8')]=function(_0x1f56de,_0x1579c3){return _0x1f56de['define'](_0xb55c('0x9'),attributes,{'tableName':_0xb55c('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x13b7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','int_freshsales_fields','freshsales_unique_index','idField','lodash'];(function(_0x1a3573,_0x132868){var _0x42ebf1=function(_0x5cbd7c){while(--_0x5cbd7c){_0x1a3573['push'](_0x1a3573['shift']());}};_0x42ebf1(++_0x132868);}(_0x13b7,0xa8));var _0x713b=function(_0x3dd6cc,_0x203488){_0x3dd6cc=_0x3dd6cc-0x0;var _0x45c035=_0x13b7[_0x3dd6cc];return _0x45c035;};'use strict';var _=require(_0x713b('0x0'));var util=require('util');var logger=require(_0x713b('0x1'))(_0x713b('0x2'));var moment=require(_0x713b('0x3'));var BPromise=require('bluebird');var rp=require(_0x713b('0x4'));var fs=require('fs');var path=require(_0x713b('0x5'));var rimraf=require(_0x713b('0x6'));var config=require(_0x713b('0x7'));var attributes=require(_0x713b('0x8'));module[_0x713b('0x9')]=function(_0x37b488,_0x4e706e){return _0x37b488['define']('FreshsalesField',attributes,{'tableName':_0x713b('0xa'),'paranoid':![],'indexes':[{'name':_0x713b('0xb'),'fields':[_0x713b('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js
index a345971..10c6d8f 100644
--- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js
+++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc852=['FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x209e2e,_0x2ebe53){var _0x1a6358=function(_0x132102){while(--_0x132102){_0x209e2e['push'](_0x209e2e['shift']());}};_0x1a6358(++_0x2ebe53);}(_0xc852,0x1d5));var _0x2c85=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc852[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2c85('0x0'));var util=require(_0x2c85('0x1'));var moment=require(_0x2c85('0x2'));var BPromise=require(_0x2c85('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c85('0x4'))['db'];var utils=require(_0x2c85('0x5'));var logger=require(_0x2c85('0x6'))(_0x2c85('0x7'));var config=require(_0x2c85('0x8'));var jayson=require(_0x2c85('0x9'));var client=jayson[_0x2c85('0xa')][_0x2c85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22680c,_0x30456a,_0x473fc0){return new BPromise(function(_0x5d55c0,_0x11074b){return client[_0x2c85('0xc')](_0x22680c,_0x473fc0)[_0x2c85('0xd')](function(_0x4f6faa){logger[_0x2c85('0xe')](_0x2c85('0xf'),_0x30456a,_0x2c85('0x10'));logger[_0x2c85('0x11')](_0x2c85('0x12'),_0x30456a,_0x2c85('0x10'),JSON['stringify'](_0x4f6faa));if(_0x4f6faa[_0x2c85('0x13')]){if(_0x4f6faa[_0x2c85('0x13')]['code']===0x1f4){logger[_0x2c85('0x13')](_0x2c85('0xf'),_0x30456a,_0x4f6faa[_0x2c85('0x13')][_0x2c85('0x14')]);return _0x11074b(_0x4f6faa[_0x2c85('0x13')][_0x2c85('0x14')]);}logger[_0x2c85('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x30456a,_0x4f6faa[_0x2c85('0x13')]['message']);return _0x5d55c0(_0x4f6faa[_0x2c85('0x13')]['message']);}else{logger[_0x2c85('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x30456a,_0x2c85('0x10'));_0x5d55c0(_0x4f6faa[_0x2c85('0x15')]['message']);}})['catch'](function(_0x350e94){logger[_0x2c85('0x13')](_0x2c85('0xf'),_0x30456a,_0x350e94);_0x11074b(_0x350e94);});});}
\ No newline at end of file
+var _0xe0e2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x558647,_0xd47657){var _0x44ccb2=function(_0x3a70e8){while(--_0x3a70e8){_0x558647['push'](_0x558647['shift']());}};_0x44ccb2(++_0xd47657);}(_0xe0e2,0x17c));var _0x2e0e=function(_0x56039b,_0x3de8d8){_0x56039b=_0x56039b-0x0;var _0xc90792=_0xe0e2[_0x56039b];return _0xc90792;};'use strict';var _=require('lodash');var util=require(_0x2e0e('0x0'));var moment=require(_0x2e0e('0x1'));var BPromise=require(_0x2e0e('0x2'));var rs=require(_0x2e0e('0x3'));var fs=require('fs');var Redis=require(_0x2e0e('0x4'));var db=require(_0x2e0e('0x5'))['db'];var utils=require(_0x2e0e('0x6'));var logger=require(_0x2e0e('0x7'))(_0x2e0e('0x8'));var config=require(_0x2e0e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2e0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x520b9a,_0x473303,_0x386f6a){return new BPromise(function(_0x26f1b3,_0x38559f){return client[_0x2e0e('0xb')](_0x520b9a,_0x386f6a)[_0x2e0e('0xc')](function(_0x4cfd20){logger[_0x2e0e('0xd')](_0x2e0e('0xe'),_0x473303,_0x2e0e('0xf'));logger[_0x2e0e('0x10')](_0x2e0e('0x11'),_0x473303,'request\x20sent',JSON[_0x2e0e('0x12')](_0x4cfd20));if(_0x4cfd20[_0x2e0e('0x13')]){if(_0x4cfd20[_0x2e0e('0x13')][_0x2e0e('0x14')]===0x1f4){logger['error'](_0x2e0e('0xe'),_0x473303,_0x4cfd20[_0x2e0e('0x13')]['message']);return _0x38559f(_0x4cfd20[_0x2e0e('0x13')][_0x2e0e('0x15')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x473303,_0x4cfd20[_0x2e0e('0x13')][_0x2e0e('0x15')]);return _0x26f1b3(_0x4cfd20[_0x2e0e('0x13')][_0x2e0e('0x15')]);}else{logger[_0x2e0e('0xd')](_0x2e0e('0xe'),_0x473303,_0x2e0e('0xf'));_0x26f1b3(_0x4cfd20[_0x2e0e('0x16')][_0x2e0e('0x15')]);}})[_0x2e0e('0x17')](function(_0x21e80b){logger['error'](_0x2e0e('0xe'),_0x473303,_0x21e80b);_0x38559f(_0x21e80b);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js
index e3fbb91..e5a5a04 100644
--- a/server/api/intSalesforceAccount/index.js
+++ b/server/api/intSalesforceAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb5d=['post','addConfiguration','put','update','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x17d006,_0x4884c1){var _0x43ec4a=function(_0x3cd41b){while(--_0x3cd41b){_0x17d006['push'](_0x17d006['shift']());}};_0x43ec4a(++_0x4884c1);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xeb5d[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xdeb5('0x0'));var path=require(_0xdeb5('0x1'));var timeout=require(_0xdeb5('0x2'));var express=require(_0xdeb5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdeb5('0x4'));var config=require(_0xdeb5('0x5'));var controller=require('./intSalesforceAccount.controller');router[_0xdeb5('0x6')]('/',auth[_0xdeb5('0x7')](),controller[_0xdeb5('0x8')]);router[_0xdeb5('0x6')](_0xdeb5('0x9'),auth[_0xdeb5('0x7')](),controller[_0xdeb5('0xa')]);router[_0xdeb5('0x6')](_0xdeb5('0xb'),auth[_0xdeb5('0x7')](),controller[_0xdeb5('0xc')]);router[_0xdeb5('0x6')](_0xdeb5('0xd'),auth[_0xdeb5('0x7')](),controller[_0xdeb5('0xe')]);router[_0xdeb5('0xf')]('/',auth[_0xdeb5('0x7')](),controller['create']);router[_0xdeb5('0xf')](_0xdeb5('0xb'),auth[_0xdeb5('0x7')](),controller[_0xdeb5('0x10')]);router[_0xdeb5('0x11')](_0xdeb5('0x9'),auth[_0xdeb5('0x7')](),controller[_0xdeb5('0x12')]);router['delete'](_0xdeb5('0x9'),auth['isAuthenticated'](),controller[_0xdeb5('0x13')]);module[_0xdeb5('0x14')]=router;
\ No newline at end of file
+var _0xea4e=['get','/:id','/:id/configurations','getFields','create','addConfiguration','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','isAuthenticated','index'];(function(_0x1a52b7,_0x2555dc){var _0x2a25e0=function(_0x3c0a45){while(--_0x3c0a45){_0x1a52b7['push'](_0x1a52b7['shift']());}};_0x2a25e0(++_0x2555dc);}(_0xea4e,0x7f));var _0xeea4=function(_0x41d902,_0x29d0b){_0x41d902=_0x41d902-0x0;var _0x360fb1=_0xea4e[_0x41d902];return _0x360fb1;};'use strict';var multer=require('multer');var util=require(_0xeea4('0x0'));var path=require(_0xeea4('0x1'));var timeout=require(_0xeea4('0x2'));var express=require(_0xeea4('0x3'));var router=express['Router']();var auth=require(_0xeea4('0x4'));var interaction=require(_0xeea4('0x5'));var config=require('../../config/environment');var controller=require(_0xeea4('0x6'));router['get']('/',auth[_0xeea4('0x7')](),controller[_0xeea4('0x8')]);router[_0xeea4('0x9')](_0xeea4('0xa'),auth[_0xeea4('0x7')](),controller['show']);router[_0xeea4('0x9')](_0xeea4('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xeea4('0x9')]('/:id/fields',auth[_0xeea4('0x7')](),controller[_0xeea4('0xc')]);router['post']('/',auth[_0xeea4('0x7')](),controller[_0xeea4('0xd')]);router['post'](_0xeea4('0xb'),auth['isAuthenticated'](),controller[_0xeea4('0xe')]);router['put'](_0xeea4('0xa'),auth[_0xeea4('0x7')](),controller['update']);router[_0xeea4('0xf')]('/:id',auth[_0xeea4('0x7')](),controller[_0xeea4('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
index 2f15b15..3b88c81 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x326f=['STRING','username','ENUM','newTab','integrationTab','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x10beb0,_0x494197){_0x10beb0=_0x10beb0-0x0;var _0x225f78=_0x326f[_0x10beb0];return _0x225f78;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf326('0x1')]},'username':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x2')},'remoteUri':{'type':Sequelize[_0xf326('0x1')]},'password':{'type':Sequelize[_0xf326('0x1')]},'clientId':{'type':Sequelize[_0xf326('0x1')]},'clientSecret':{'type':Sequelize[_0xf326('0x1')]},'securityToken':{'type':Sequelize[_0xf326('0x1')]},'serverUrl':{'type':Sequelize[_0xf326('0x1')]},'type':{'type':Sequelize[_0xf326('0x3')]('integrationTab',_0xf326('0x4')),'defaultValue':_0xf326('0x5')}};
\ No newline at end of file
+var _0x8ef6=['newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x2872ab,_0xfec43c){var _0x5066e6=function(_0x217a98){while(--_0x217a98){_0x2872ab['push'](_0x2872ab['shift']());}};_0x5066e6(++_0xfec43c);}(_0x8ef6,0xf2));var _0x68ef=function(_0x443791,_0x4928d8){_0x443791=_0x443791-0x0;var _0x410766=_0x8ef6[_0x443791];return _0x410766;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')]},'description':{'type':Sequelize[_0x68ef('0x2')]},'username':{'type':Sequelize[_0x68ef('0x2')],'unique':_0x68ef('0x3')},'remoteUri':{'type':Sequelize[_0x68ef('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x68ef('0x2')]},'clientSecret':{'type':Sequelize[_0x68ef('0x2')]},'securityToken':{'type':Sequelize[_0x68ef('0x2')]},'serverUrl':{'type':Sequelize[_0x68ef('0x2')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x68ef('0x4')),'defaultValue':_0x68ef('0x5')}};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
index 3f17020..c25a826 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f98=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','name','send','index','map','SalesforceAccount','fieldName','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','update','body','getConfigurations','findOne','rawAttributes','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','remoteUri','clientId','clientSecret','password','securityToken','slice','substring','Connection','login','username','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','CallType','IsArchived','Priority','Status','Type','Reason','SuppliedCompany','remove','custom','includes','label','picklistValues','boolean','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x2af491,_0x282b08){var _0x4d281f=function(_0x3fd903){while(--_0x3fd903){_0x2af491['push'](_0x2af491['shift']());}};_0x4d281f(++_0x282b08);}(_0x3f98,0xfb));var _0x83f9=function(_0x3ba3f2,_0x322f22){_0x3ba3f2=_0x3ba3f2-0x0;var _0x110e03=_0x3f98[_0x3ba3f2];return _0x110e03;};'use strict';var pdf=require(_0x83f9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x83f9('0x1'));var zipdir=require(_0x83f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83f9('0x3'));var moment=require(_0x83f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x83f9('0x5'));var util=require(_0x83f9('0x6'));var path=require(_0x83f9('0x7'));var sox=require(_0x83f9('0x8'));var csv=require(_0x83f9('0x9'));var ejs=require(_0x83f9('0xa'));var fs=require('fs');var _=require(_0x83f9('0xb'));var squel=require(_0x83f9('0xc'));var crypto=require(_0x83f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x83f9('0xe'));var toCsv=require(_0x83f9('0x9'));var querystring=require(_0x83f9('0xf'));var Papa=require(_0x83f9('0x10'));var Redis=require(_0x83f9('0x11'));var authService=require(_0x83f9('0x12'));var qs=require(_0x83f9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83f9('0x14'));var logger=require(_0x83f9('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x83f9('0x16'));var db=require(_0x83f9('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x83f9('0x18')][_0x83f9('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3f6c90,_0x9764e6,_0xd7c2b2){if(_0xd7c2b2){var _0x1a4840=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a4840[_0x83f9('0x1a')](_0x9764e6)){return _0x3f6c90;}else{throw new db[(_0x83f9('0x1b'))][(_0x83f9('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3f6c90;}}function respondWithRpcPromise(_0x411248,_0x3d93e7,_0x17c1bf,_0x61fa6d){return new BPromise(function(_0x1b077c,_0x60e3c7){var _0x18c914=_0x61fa6d||client;return _0x18c914[_0x83f9('0x1d')](_0x411248,_0x17c1bf)['then'](function(_0x397c47){logger['info'](_0x83f9('0x1e'),_0x3d93e7,_0x83f9('0x1f'));logger[_0x83f9('0x20')](_0x83f9('0x21'),_0x3d93e7,_0x83f9('0x1f'),JSON[_0x83f9('0x22')](_0x397c47));if(_0x397c47[_0x83f9('0x23')]){if(_0x397c47[_0x83f9('0x23')][_0x83f9('0x24')]===0x1f4){logger[_0x83f9('0x23')](_0x83f9('0x1e'),_0x3d93e7,_0x397c47[_0x83f9('0x23')]['message']);return _0x60e3c7(_0x397c47[_0x83f9('0x23')][_0x83f9('0x25')]);}logger[_0x83f9('0x23')]('SalesforceAccount,\x20%s,\x20%s',_0x3d93e7,_0x397c47[_0x83f9('0x23')][_0x83f9('0x25')]);return _0x1b077c(_0x397c47['error'][_0x83f9('0x25')]);}else{logger[_0x83f9('0x26')]('SalesforceAccount,\x20%s,\x20%s',_0x3d93e7,'request\x20sent');_0x1b077c(_0x397c47['result']['message']);}})[_0x83f9('0x27')](function(_0xfa1235){logger[_0x83f9('0x23')](_0x83f9('0x1e'),_0x3d93e7,_0xfa1235);_0x60e3c7(_0xfa1235);});});}function respondWithStatusCode(_0x2598d6,_0x351d24){_0x351d24=_0x351d24||0xcc;return function(_0x343112){if(_0x343112){return _0x2598d6['sendStatus'](_0x351d24);}return _0x2598d6[_0x83f9('0x28')](_0x351d24)[_0x83f9('0x29')]();};}function respondWithResult(_0x19347f,_0xf0f7de){_0xf0f7de=_0xf0f7de||0xc8;return function(_0x18744b){if(_0x18744b){return _0x19347f[_0x83f9('0x28')](_0xf0f7de)[_0x83f9('0x2a')](_0x18744b);}};}function respondWithFilteredResult(_0x3cb932,_0x1fdb66){return function(_0x366efd){if(_0x366efd){var _0x58556a=_0x366efd[_0x83f9('0x2b')],_0x36fc48=_0x1fdb66[_0x83f9('0x2c')],_0x5d6418=_0x1fdb66[_0x83f9('0x2c')]+_0x1fdb66[_0x83f9('0x2d')],_0x2f11fe;if(_0x5d6418>=_0x58556a){_0x5d6418=_0x58556a;_0x2f11fe=0xc8;}else{_0x2f11fe=0xce;}_0x3cb932[_0x83f9('0x28')](_0x2f11fe);return _0x3cb932[_0x83f9('0x2e')](_0x83f9('0x2f'),_0x36fc48+'-'+_0x5d6418+'/'+_0x58556a)[_0x83f9('0x2a')](_0x366efd);}return null;};}function patchUpdates(_0x239340){return function(_0x3ea3be){try{jsonpatch[_0x83f9('0x30')](_0x3ea3be,_0x239340,!![]);}catch(_0x52d1f0){return BPromise['reject'](_0x52d1f0);}return _0x3ea3be[_0x83f9('0x31')]();};}function saveUpdates(_0xe570c4,_0x763d21){return function(_0xc717e){if(_0xc717e){return _0xc717e['update'](_0xe570c4)[_0x83f9('0x32')](function(_0x595654){return _0x595654;});}return null;};}function removeEntity(_0x1f9c2a,_0x582777){return function(_0x4dcbf0){if(_0x4dcbf0){return _0x4dcbf0[_0x83f9('0x33')]()[_0x83f9('0x32')](function(){_0x1f9c2a[_0x83f9('0x28')](0xcc)[_0x83f9('0x29')]();});}};}function handleEntityNotFound(_0x45e45f,_0x32c18a){return function(_0x56e111){if(!_0x56e111){_0x45e45f['sendStatus'](0x194);}return _0x56e111;};}function handleError(_0x4393f2,_0xc406d3){_0xc406d3=_0xc406d3||0x1f4;return function(_0x47990f){logger[_0x83f9('0x23')](_0x47990f['stack']);if(_0x47990f[_0x83f9('0x34')]){delete _0x47990f['name'];}_0x4393f2[_0x83f9('0x28')](_0xc406d3)[_0x83f9('0x35')](_0x47990f);};}exports[_0x83f9('0x36')]=function(_0x3ee198,_0x103572){var _0x563c40={},_0x55345a={},_0x2e6c8a={'count':0x0,'rows':[]};var _0x2a5226=_[_0x83f9('0x37')](db[_0x83f9('0x38')]['rawAttributes'],function(_0x3f282d){return{'name':_0x3f282d[_0x83f9('0x39')],'type':_0x3f282d['type']['key']};});_0x55345a[_0x83f9('0x3a')]=_[_0x83f9('0x37')](_0x2a5226,'name');_0x55345a['query']=_[_0x83f9('0x3b')](_0x3ee198['query']);_0x55345a[_0x83f9('0x3c')]=_[_0x83f9('0x3d')](_0x55345a[_0x83f9('0x3a')],_0x55345a[_0x83f9('0x3e')]);_0x563c40[_0x83f9('0x3f')]=_[_0x83f9('0x3d')](_0x55345a['model'],qs[_0x83f9('0x40')](_0x3ee198['query'][_0x83f9('0x40')]));_0x563c40['attributes']=_0x563c40[_0x83f9('0x3f')][_0x83f9('0x41')]?_0x563c40[_0x83f9('0x3f')]:_0x55345a[_0x83f9('0x3a')];if(!_0x3ee198['query'][_0x83f9('0x42')](_0x83f9('0x43'))){_0x563c40[_0x83f9('0x2d')]=qs[_0x83f9('0x2d')](_0x3ee198[_0x83f9('0x3e')][_0x83f9('0x2d')]);_0x563c40[_0x83f9('0x2c')]=qs[_0x83f9('0x2c')](_0x3ee198['query'][_0x83f9('0x2c')]);}_0x563c40['order']=qs[_0x83f9('0x44')](_0x3ee198[_0x83f9('0x3e')]['sort']);_0x563c40[_0x83f9('0x45')]=qs[_0x83f9('0x3c')](_['pick'](_0x3ee198[_0x83f9('0x3e')],_0x55345a['filters']),_0x2a5226);if(_0x3ee198[_0x83f9('0x3e')][_0x83f9('0x46')]){_0x563c40[_0x83f9('0x45')]=_[_0x83f9('0x47')](_0x563c40['where'],{'$or':_[_0x83f9('0x37')](_0x2a5226,function(_0x829f3d){if(_0x829f3d[_0x83f9('0x48')]!==_0x83f9('0x49')){var _0x3342bb={};_0x3342bb[_0x829f3d[_0x83f9('0x34')]]={'$like':'%'+_0x3ee198[_0x83f9('0x3e')]['filter']+'%'};return _0x3342bb;}})});}_0x563c40=_[_0x83f9('0x47')]({},_0x563c40,_0x3ee198[_0x83f9('0x4a')]);var _0x5d4d2b={'where':_0x563c40[_0x83f9('0x45')]};return db[_0x83f9('0x38')][_0x83f9('0x2b')](_0x5d4d2b)['then'](function(_0x4cf3a4){_0x2e6c8a[_0x83f9('0x2b')]=_0x4cf3a4;if(_0x3ee198['query'][_0x83f9('0x4b')]){_0x563c40[_0x83f9('0x4c')]=[{'all':!![]}];}return db[_0x83f9('0x38')][_0x83f9('0x4d')](_0x563c40);})[_0x83f9('0x32')](function(_0x214d98){_0x2e6c8a[_0x83f9('0x4e')]=_0x214d98;return _0x2e6c8a;})[_0x83f9('0x32')](respondWithFilteredResult(_0x103572,_0x563c40))[_0x83f9('0x27')](handleError(_0x103572,null));};exports[_0x83f9('0x4f')]=function(_0xf9f3d1,_0x254ffa){var _0x473ee6={'raw':![],'where':{'id':_0xf9f3d1[_0x83f9('0x50')]['id']}},_0x29cfbb={};_0x29cfbb[_0x83f9('0x3a')]=_[_0x83f9('0x3b')](db[_0x83f9('0x38')]['rawAttributes']);_0x29cfbb[_0x83f9('0x3e')]=_[_0x83f9('0x3b')](_0xf9f3d1[_0x83f9('0x3e')]);_0x29cfbb[_0x83f9('0x3c')]=_[_0x83f9('0x3d')](_0x29cfbb['model'],_0x29cfbb[_0x83f9('0x3e')]);_0x473ee6[_0x83f9('0x3f')]=_[_0x83f9('0x3d')](_0x29cfbb[_0x83f9('0x3a')],qs[_0x83f9('0x40')](_0xf9f3d1[_0x83f9('0x3e')][_0x83f9('0x40')]));_0x473ee6[_0x83f9('0x3f')]=_0x473ee6[_0x83f9('0x3f')]['length']?_0x473ee6[_0x83f9('0x3f')]:_0x29cfbb['model'];if(_0xf9f3d1[_0x83f9('0x3e')]['includeAll']){_0x473ee6[_0x83f9('0x4c')]=[{'all':!![]}];}_0x473ee6=_[_0x83f9('0x47')]({},_0x473ee6,_0xf9f3d1['options']);return db['SalesforceAccount'][_0x83f9('0x51')](_0x473ee6)[_0x83f9('0x32')](handleEntityNotFound(_0x254ffa,null))['then'](respondWithResult(_0x254ffa,null))[_0x83f9('0x27')](handleError(_0x254ffa,null));};exports[_0x83f9('0x52')]=function(_0x1d3cc6,_0x5091e3){return db['SalesforceAccount'][_0x83f9('0x52')](_0x1d3cc6['body'],{})[_0x83f9('0x32')](respondWithResult(_0x5091e3,0xc9))[_0x83f9('0x27')](handleError(_0x5091e3,null));};exports[_0x83f9('0x53')]=function(_0x5b85dd,_0x1e329d){if(_0x5b85dd[_0x83f9('0x54')]['id']){delete _0x5b85dd['body']['id'];}return db[_0x83f9('0x38')]['find']({'where':{'id':_0x5b85dd[_0x83f9('0x50')]['id']}})['then'](handleEntityNotFound(_0x1e329d,null))['then'](saveUpdates(_0x5b85dd[_0x83f9('0x54')],null))['then'](respondWithResult(_0x1e329d,null))['catch'](handleError(_0x1e329d,null));};exports[_0x83f9('0x33')]=function(_0x10c2f3,_0x17991c){return db['SalesforceAccount'][_0x83f9('0x51')]({'where':{'id':_0x10c2f3[_0x83f9('0x50')]['id']}})['then'](handleEntityNotFound(_0x17991c,null))[_0x83f9('0x32')](removeEntity(_0x17991c,null))[_0x83f9('0x27')](handleError(_0x17991c,null));};exports[_0x83f9('0x55')]=function(_0x2ebffc,_0x5b968a,_0x5181a0){var _0x123e32={};var _0x228cf9={};var _0x5da665;var _0x336ce5;return db['SalesforceAccount'][_0x83f9('0x56')]({'where':{'id':_0x2ebffc[_0x83f9('0x50')]['id']}})[_0x83f9('0x32')](handleEntityNotFound(_0x5b968a,null))[_0x83f9('0x32')](function(_0x3c865c){if(_0x3c865c){_0x5da665=_0x3c865c;_0x228cf9[_0x83f9('0x3a')]=_[_0x83f9('0x3b')](db['SalesforceConfiguration'][_0x83f9('0x57')]);_0x228cf9[_0x83f9('0x3e')]=_[_0x83f9('0x3b')](_0x2ebffc[_0x83f9('0x3e')]);_0x228cf9['filters']=_[_0x83f9('0x3d')](_0x228cf9[_0x83f9('0x3a')],_0x228cf9[_0x83f9('0x3e')]);_0x123e32['attributes']=_[_0x83f9('0x3d')](_0x228cf9['model'],qs[_0x83f9('0x40')](_0x2ebffc[_0x83f9('0x3e')]['fields']));_0x123e32[_0x83f9('0x3f')]=_0x123e32[_0x83f9('0x3f')][_0x83f9('0x41')]?_0x123e32['attributes']:_0x228cf9[_0x83f9('0x3a')];_0x123e32[_0x83f9('0x58')]=qs[_0x83f9('0x44')](_0x2ebffc[_0x83f9('0x3e')][_0x83f9('0x44')]);_0x123e32[_0x83f9('0x45')]=qs['filters'](_['pick'](_0x2ebffc['query'],_0x228cf9[_0x83f9('0x3c')]));if(_0x2ebffc[_0x83f9('0x3e')]['filter']){_0x123e32['where']=_[_0x83f9('0x47')](_0x123e32['where'],{'$or':_['map'](_0x123e32['attributes'],function(_0x16752c){var _0x41556d={};_0x41556d[_0x16752c]={'$like':'%'+_0x2ebffc[_0x83f9('0x3e')]['filter']+'%'};return _0x41556d;})});}_0x123e32=_[_0x83f9('0x47')]({},_0x123e32,_0x2ebffc[_0x83f9('0x4a')]);return _0x5da665[_0x83f9('0x55')](_0x123e32);}})[_0x83f9('0x32')](function(_0x4c2ed3){if(_0x4c2ed3){_0x336ce5=_0x4c2ed3[_0x83f9('0x41')];if(!_0x2ebffc[_0x83f9('0x3e')][_0x83f9('0x42')](_0x83f9('0x43'))){_0x123e32[_0x83f9('0x2d')]=qs[_0x83f9('0x2d')](_0x2ebffc[_0x83f9('0x3e')][_0x83f9('0x2d')]);_0x123e32['offset']=qs[_0x83f9('0x2c')](_0x2ebffc[_0x83f9('0x3e')][_0x83f9('0x2c')]);}return _0x5da665[_0x83f9('0x55')](_0x123e32);}})[_0x83f9('0x32')](function(_0x420895){if(_0x420895){return _0x420895?{'count':_0x336ce5,'rows':_0x420895}:null;}})[_0x83f9('0x32')](respondWithResult(_0x5b968a,null))[_0x83f9('0x27')](handleError(_0x5b968a,null));};exports[_0x83f9('0x59')]=function(_0x19987e,_0x725352,_0x5820af){if(_0x19987e[_0x83f9('0x54')]['id']){delete _0x19987e[_0x83f9('0x54')]['id'];}return db[_0x83f9('0x38')][_0x83f9('0x56')]({'where':{'id':_0x19987e[_0x83f9('0x50')]['id']}})[_0x83f9('0x32')](handleEntityNotFound(_0x725352,null))[_0x83f9('0x32')](function(_0x38f873){if(_0x38f873){_0x19987e[_0x83f9('0x54')][_0x83f9('0x5a')]=_0x38f873['id'];_0x19987e[_0x83f9('0x54')][_0x83f9('0x5b')]=integrations[_0x83f9('0x5c')](_0x19987e['body'][_0x83f9('0x5d')],_0x19987e[_0x83f9('0x54')][_0x83f9('0x48')]);_0x19987e[_0x83f9('0x54')][_0x83f9('0x5e')]=integrations[_0x83f9('0x5f')](_0x19987e[_0x83f9('0x54')][_0x83f9('0x5d')],_0x19987e[_0x83f9('0x54')]['type']);return db[_0x83f9('0x60')][_0x83f9('0x52')](_0x19987e[_0x83f9('0x54')],{'include':[{'model':db[_0x83f9('0x61')],'as':_0x83f9('0x5b')},{'model':db[_0x83f9('0x61')],'as':_0x83f9('0x5e')}]});}return null;})['then'](respondWithResult(_0x725352,null))[_0x83f9('0x27')](handleError(_0x725352,null));};exports['getFields']=function(_0xb4471e,_0x5911e3,_0x2dc43f){var _0x252bec;var _0x355b7a='';var _0x32c1e8='Task';return db['SalesforceAccount']['findOne']({'where':{'id':_0xb4471e[_0x83f9('0x50')]['id']},'attributes':['id',_0x83f9('0x62'),_0x83f9('0x63'),_0x83f9('0x64'),'username',_0x83f9('0x65'),_0x83f9('0x66')]})[_0x83f9('0x32')](handleEntityNotFound(_0x5911e3,null))[_0x83f9('0x32')](function(_0x1d6e05){if(_0x1d6e05){_0x355b7a=_0x1d6e05[_0x83f9('0x62')];var _0x54ed4e=_0x355b7a[_0x83f9('0x67')](-0x1);if(_0x54ed4e==='/'){_0x355b7a=_0x355b7a[_0x83f9('0x68')](0x0,_0x355b7a['lastIndexOf'](_0x54ed4e));}_0x252bec=new jsforce[(_0x83f9('0x69'))]({'oauth2':{'loginUrl':_0x355b7a,'clientId':_0x1d6e05[_0x83f9('0x63')],'clientSecret':_0x1d6e05[_0x83f9('0x64')]}});return _0x252bec[_0x83f9('0x6a')](_0x1d6e05[_0x83f9('0x6b')],_0x1d6e05[_0x83f9('0x65')]['concat'](_0x1d6e05[_0x83f9('0x66')]));}})[_0x83f9('0x32')](function(_0x19838a){if(_0x19838a){if(!_[_0x83f9('0x6c')](_0xb4471e['query'][_0x83f9('0x6d')])){_0x32c1e8=_0xb4471e[_0x83f9('0x3e')][_0x83f9('0x6d')];}return _0x252bec[_0x83f9('0x6e')](_0x32c1e8)['describe']();}})['then'](function(_0x5c784f){var _0xcb522=[_0x83f9('0x6f'),_0x83f9('0x70'),'CallObject',_0x83f9('0x71'),_0x83f9('0x72'),_0x83f9('0x73'),_0x83f9('0x74'),_0x83f9('0x75')];if(!_[_0x83f9('0x6c')](_0xb4471e[_0x83f9('0x3e')]['ticketType'])&&_0xb4471e[_0x83f9('0x3e')][_0x83f9('0x6d')]==='Case'){_0xcb522=['Type','Origin',_0x83f9('0x76'),_0x83f9('0x74'),_0x83f9('0x73'),'IsEscalated','SuppliedName',_0x83f9('0x77')];}if(_0x5c784f){_[_0x83f9('0x78')](_0x5c784f['fields'],function(_0x17e4c2){return _0x17e4c2[_0x83f9('0x79')]===![]&&!_0xcb522[_0x83f9('0x7a')](_0x17e4c2[_0x83f9('0x34')]);});return{'count':_0x5c784f[_0x83f9('0x40')][_0x83f9('0x41')],'rows':_['map'](_0x5c784f[_0x83f9('0x40')],function(_0x56df00){return{'id':_0x56df00[_0x83f9('0x34')],'name':_0x56df00[_0x83f9('0x7b')],'custom':_0x56df00['custom'],'options':_0x56df00['picklistValues'][_0x83f9('0x41')]>0x0?_[_0x83f9('0x37')](_0x56df00[_0x83f9('0x7c')],function(_0x250c9b){return{'name':_0x250c9b[_0x83f9('0x7b')],'value':_0x250c9b['value']};}):_0x56df00[_0x83f9('0x48')]==_0x83f9('0x7d')?[{'name':'True','value':_0x83f9('0x7e')},{'name':_0x83f9('0x7f'),'value':_0x83f9('0x80')}]:[]};})};}})[_0x83f9('0x32')](respondWithResult(_0x5911e3,null))['catch'](function(_0x4e9e73){var _0x496a45=_0xb4471e[_0x83f9('0x3e')][_0x83f9('0x1a')]?0x1f4:_0x4e9e73[_0x83f9('0x81')]||0x1f4;logger[_0x83f9('0x23')](_0x83f9('0x82'),_0x83f9('0x83'),_0x496a45,JSON['stringify'](_0x4e9e73));delete _0x4e9e73['name'];if(_0x496a45===0x191){_0x496a45=0x190;}_0x5911e3['status'](_0x496a45)[_0x83f9('0x35')](_0xb4471e[_0x83f9('0x3e')][_0x83f9('0x1a')]?{'message':_0x83f9('0x84'),'statusCode':_0x4e9e73['statusCode']}:_0x4e9e73);});};
\ No newline at end of file
+var _0x6a41=['IsEscalated','SuppliedName','remove','custom','includes','label','picklistValues','boolean','statusCode','getFields','stringify','send','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','count','offset','limit','set','apply','save','destroy','end','stack','name','index','map','SalesforceAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','keys','find','catch','create','body','update','getConfigurations','findOne','SalesforceConfiguration','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','securityToken','slice','substring','lastIndexOf','Connection','concat','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','CallType','IsArchived','Status','Case','Type','Origin','Reason'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0x6a41,0x189));var _0x16a4=function(_0x531adc,_0x11312f){_0x531adc=_0x531adc-0x0;var _0xcb04b6=_0x6a41[_0x531adc];return _0xcb04b6;};'use strict';var pdf=require(_0x16a4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x16a4('0x1'));var jsonpatch=require(_0x16a4('0x2'));var rp=require(_0x16a4('0x3'));var moment=require('moment');var BPromise=require(_0x16a4('0x4'));var Mustache=require('mustache');var util=require(_0x16a4('0x5'));var path=require(_0x16a4('0x6'));var sox=require(_0x16a4('0x7'));var csv=require('to-csv');var ejs=require(_0x16a4('0x8'));var fs=require('fs');var _=require(_0x16a4('0x9'));var squel=require(_0x16a4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x16a4('0xb'));var querystring=require(_0x16a4('0xc'));var Papa=require('papaparse');var Redis=require(_0x16a4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x16a4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16a4('0xf'));var logger=require(_0x16a4('0x10'))(_0x16a4('0x11'));var utils=require(_0x16a4('0x12'));var config=require(_0x16a4('0x13'));var db=require(_0x16a4('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x16a4('0x15'));var client=jayson[_0x16a4('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x41ad07,_0x545ab7,_0x1c63e0){if(_0x1c63e0){var _0x4837f9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4837f9[_0x16a4('0x17')](_0x545ab7)){return _0x41ad07;}else{throw new db[(_0x16a4('0x18'))][(_0x16a4('0x19'))](_0x16a4('0x1a'));}}else{return _0x41ad07;}}function respondWithRpcPromise(_0x359eca,_0x1b0d9b,_0x228207,_0xf1b62e){return new BPromise(function(_0x7b5a24,_0x55afea){var _0x35b943=_0xf1b62e||client;return _0x35b943['request'](_0x359eca,_0x228207)[_0x16a4('0x1b')](function(_0x38c622){logger[_0x16a4('0x1c')](_0x16a4('0x1d'),_0x1b0d9b,_0x16a4('0x1e'));logger[_0x16a4('0x1f')](_0x16a4('0x20'),_0x1b0d9b,_0x16a4('0x1e'),JSON['stringify'](_0x38c622));if(_0x38c622[_0x16a4('0x21')]){if(_0x38c622[_0x16a4('0x21')][_0x16a4('0x22')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x1b0d9b,_0x38c622['error'][_0x16a4('0x23')]);return _0x55afea(_0x38c622[_0x16a4('0x21')][_0x16a4('0x23')]);}logger[_0x16a4('0x21')](_0x16a4('0x1d'),_0x1b0d9b,_0x38c622[_0x16a4('0x21')][_0x16a4('0x23')]);return _0x7b5a24(_0x38c622[_0x16a4('0x21')]['message']);}else{logger[_0x16a4('0x1c')](_0x16a4('0x1d'),_0x1b0d9b,_0x16a4('0x1e'));_0x7b5a24(_0x38c622[_0x16a4('0x24')][_0x16a4('0x23')]);}})['catch'](function(_0x3f6dfd){logger[_0x16a4('0x21')](_0x16a4('0x1d'),_0x1b0d9b,_0x3f6dfd);_0x55afea(_0x3f6dfd);});});}function respondWithStatusCode(_0x497a19,_0x53e43d){_0x53e43d=_0x53e43d||0xcc;return function(_0x2c5959){if(_0x2c5959){return _0x497a19[_0x16a4('0x25')](_0x53e43d);}return _0x497a19[_0x16a4('0x26')](_0x53e43d)['end']();};}function respondWithResult(_0x1d1d7f,_0x2aef31){_0x2aef31=_0x2aef31||0xc8;return function(_0x18e396){if(_0x18e396){return _0x1d1d7f['status'](_0x2aef31)[_0x16a4('0x27')](_0x18e396);}};}function respondWithFilteredResult(_0x5d4662,_0x506303){return function(_0x18554b){if(_0x18554b){var _0x5e7f92=_0x18554b[_0x16a4('0x28')],_0x5a81af=_0x506303[_0x16a4('0x29')],_0x342caa=_0x506303[_0x16a4('0x29')]+_0x506303[_0x16a4('0x2a')],_0x161f7a;if(_0x342caa>=_0x5e7f92){_0x342caa=_0x5e7f92;_0x161f7a=0xc8;}else{_0x161f7a=0xce;}_0x5d4662[_0x16a4('0x26')](_0x161f7a);return _0x5d4662[_0x16a4('0x2b')]('Content-Range',_0x5a81af+'-'+_0x342caa+'/'+_0x5e7f92)[_0x16a4('0x27')](_0x18554b);}return null;};}function patchUpdates(_0x13307f){return function(_0x5b55b6){try{jsonpatch[_0x16a4('0x2c')](_0x5b55b6,_0x13307f,!![]);}catch(_0x15187c){return BPromise['reject'](_0x15187c);}return _0x5b55b6[_0x16a4('0x2d')]();};}function saveUpdates(_0x1305ec,_0x3c2826){return function(_0x2c2d91){if(_0x2c2d91){return _0x2c2d91['update'](_0x1305ec)['then'](function(_0x44f680){return _0x44f680;});}return null;};}function removeEntity(_0x85bc49,_0x3f78c4){return function(_0x5c7926){if(_0x5c7926){return _0x5c7926[_0x16a4('0x2e')]()[_0x16a4('0x1b')](function(){_0x85bc49['status'](0xcc)[_0x16a4('0x2f')]();});}};}function handleEntityNotFound(_0x2876c4,_0x161c50){return function(_0x417679){if(!_0x417679){_0x2876c4[_0x16a4('0x25')](0x194);}return _0x417679;};}function handleError(_0x283d99,_0x253b8e){_0x253b8e=_0x253b8e||0x1f4;return function(_0x27b5d0){logger['error'](_0x27b5d0[_0x16a4('0x30')]);if(_0x27b5d0[_0x16a4('0x31')]){delete _0x27b5d0[_0x16a4('0x31')];}_0x283d99[_0x16a4('0x26')](_0x253b8e)['send'](_0x27b5d0);};}exports[_0x16a4('0x32')]=function(_0x18be6b,_0x31d895){var _0x3bd0d0={},_0xdf9e3b={},_0x115edd={'count':0x0,'rows':[]};var _0x35f5b9=_[_0x16a4('0x33')](db[_0x16a4('0x34')][_0x16a4('0x35')],function(_0x26ee8e){return{'name':_0x26ee8e['fieldName'],'type':_0x26ee8e[_0x16a4('0x36')][_0x16a4('0x37')]};});_0xdf9e3b[_0x16a4('0x38')]=_[_0x16a4('0x33')](_0x35f5b9,_0x16a4('0x31'));_0xdf9e3b[_0x16a4('0x39')]=_['keys'](_0x18be6b['query']);_0xdf9e3b[_0x16a4('0x3a')]=_[_0x16a4('0x3b')](_0xdf9e3b[_0x16a4('0x38')],_0xdf9e3b[_0x16a4('0x39')]);_0x3bd0d0[_0x16a4('0x3c')]=_['intersection'](_0xdf9e3b[_0x16a4('0x38')],qs[_0x16a4('0x3d')](_0x18be6b[_0x16a4('0x39')][_0x16a4('0x3d')]));_0x3bd0d0[_0x16a4('0x3c')]=_0x3bd0d0['attributes'][_0x16a4('0x3e')]?_0x3bd0d0[_0x16a4('0x3c')]:_0xdf9e3b['model'];if(!_0x18be6b[_0x16a4('0x39')][_0x16a4('0x3f')]('nolimit')){_0x3bd0d0[_0x16a4('0x2a')]=qs[_0x16a4('0x2a')](_0x18be6b[_0x16a4('0x39')][_0x16a4('0x2a')]);_0x3bd0d0[_0x16a4('0x29')]=qs[_0x16a4('0x29')](_0x18be6b[_0x16a4('0x39')]['offset']);}_0x3bd0d0[_0x16a4('0x40')]=qs[_0x16a4('0x41')](_0x18be6b[_0x16a4('0x39')]['sort']);_0x3bd0d0[_0x16a4('0x42')]=qs[_0x16a4('0x3a')](_[_0x16a4('0x43')](_0x18be6b[_0x16a4('0x39')],_0xdf9e3b['filters']),_0x35f5b9);if(_0x18be6b[_0x16a4('0x39')][_0x16a4('0x44')]){_0x3bd0d0[_0x16a4('0x42')]=_['merge'](_0x3bd0d0['where'],{'$or':_[_0x16a4('0x33')](_0x35f5b9,function(_0x47ab71){if(_0x47ab71[_0x16a4('0x36')]!=='VIRTUAL'){var _0xc0d1d={};_0xc0d1d[_0x47ab71[_0x16a4('0x31')]]={'$like':'%'+_0x18be6b[_0x16a4('0x39')][_0x16a4('0x44')]+'%'};return _0xc0d1d;}})});}_0x3bd0d0=_[_0x16a4('0x45')]({},_0x3bd0d0,_0x18be6b[_0x16a4('0x46')]);var _0x1a3691={'where':_0x3bd0d0[_0x16a4('0x42')]};return db['SalesforceAccount'][_0x16a4('0x28')](_0x1a3691)['then'](function(_0x26116d){_0x115edd[_0x16a4('0x28')]=_0x26116d;if(_0x18be6b[_0x16a4('0x39')][_0x16a4('0x47')]){_0x3bd0d0[_0x16a4('0x48')]=[{'all':!![]}];}return db[_0x16a4('0x34')]['findAll'](_0x3bd0d0);})[_0x16a4('0x1b')](function(_0xa79c04){_0x115edd[_0x16a4('0x49')]=_0xa79c04;return _0x115edd;})[_0x16a4('0x1b')](respondWithFilteredResult(_0x31d895,_0x3bd0d0))['catch'](handleError(_0x31d895,null));};exports[_0x16a4('0x4a')]=function(_0x38e972,_0x39de8b){var _0xf38228={'raw':![],'where':{'id':_0x38e972[_0x16a4('0x4b')]['id']}},_0x372977={};_0x372977[_0x16a4('0x38')]=_[_0x16a4('0x4c')](db['SalesforceAccount'][_0x16a4('0x35')]);_0x372977[_0x16a4('0x39')]=_[_0x16a4('0x4c')](_0x38e972[_0x16a4('0x39')]);_0x372977[_0x16a4('0x3a')]=_['intersection'](_0x372977[_0x16a4('0x38')],_0x372977[_0x16a4('0x39')]);_0xf38228[_0x16a4('0x3c')]=_['intersection'](_0x372977[_0x16a4('0x38')],qs[_0x16a4('0x3d')](_0x38e972[_0x16a4('0x39')]['fields']));_0xf38228['attributes']=_0xf38228[_0x16a4('0x3c')]['length']?_0xf38228[_0x16a4('0x3c')]:_0x372977['model'];if(_0x38e972['query'][_0x16a4('0x47')]){_0xf38228[_0x16a4('0x48')]=[{'all':!![]}];}_0xf38228=_['merge']({},_0xf38228,_0x38e972[_0x16a4('0x46')]);return db[_0x16a4('0x34')][_0x16a4('0x4d')](_0xf38228)['then'](handleEntityNotFound(_0x39de8b,null))['then'](respondWithResult(_0x39de8b,null))[_0x16a4('0x4e')](handleError(_0x39de8b,null));};exports[_0x16a4('0x4f')]=function(_0x1b3903,_0x58ed89){return db[_0x16a4('0x34')][_0x16a4('0x4f')](_0x1b3903[_0x16a4('0x50')],{})['then'](respondWithResult(_0x58ed89,0xc9))[_0x16a4('0x4e')](handleError(_0x58ed89,null));};exports[_0x16a4('0x51')]=function(_0x2612f7,_0x2dc04d){if(_0x2612f7[_0x16a4('0x50')]['id']){delete _0x2612f7[_0x16a4('0x50')]['id'];}return db['SalesforceAccount'][_0x16a4('0x4d')]({'where':{'id':_0x2612f7[_0x16a4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2dc04d,null))[_0x16a4('0x1b')](saveUpdates(_0x2612f7[_0x16a4('0x50')],null))[_0x16a4('0x1b')](respondWithResult(_0x2dc04d,null))[_0x16a4('0x4e')](handleError(_0x2dc04d,null));};exports['destroy']=function(_0x508629,_0x3774a8){return db[_0x16a4('0x34')][_0x16a4('0x4d')]({'where':{'id':_0x508629[_0x16a4('0x4b')]['id']}})[_0x16a4('0x1b')](handleEntityNotFound(_0x3774a8,null))[_0x16a4('0x1b')](removeEntity(_0x3774a8,null))[_0x16a4('0x4e')](handleError(_0x3774a8,null));};exports[_0x16a4('0x52')]=function(_0x431f3d,_0x32efe0,_0x55d807){var _0x32e851={};var _0x4a9be1={};var _0x233ad8;var _0x3db89e;return db['SalesforceAccount'][_0x16a4('0x53')]({'where':{'id':_0x431f3d[_0x16a4('0x4b')]['id']}})[_0x16a4('0x1b')](handleEntityNotFound(_0x32efe0,null))[_0x16a4('0x1b')](function(_0x409bcf){if(_0x409bcf){_0x233ad8=_0x409bcf;_0x4a9be1['model']=_[_0x16a4('0x4c')](db[_0x16a4('0x54')][_0x16a4('0x35')]);_0x4a9be1[_0x16a4('0x39')]=_['keys'](_0x431f3d['query']);_0x4a9be1[_0x16a4('0x3a')]=_[_0x16a4('0x3b')](_0x4a9be1['model'],_0x4a9be1[_0x16a4('0x39')]);_0x32e851[_0x16a4('0x3c')]=_[_0x16a4('0x3b')](_0x4a9be1['model'],qs[_0x16a4('0x3d')](_0x431f3d[_0x16a4('0x39')][_0x16a4('0x3d')]));_0x32e851[_0x16a4('0x3c')]=_0x32e851[_0x16a4('0x3c')][_0x16a4('0x3e')]?_0x32e851[_0x16a4('0x3c')]:_0x4a9be1['model'];_0x32e851[_0x16a4('0x40')]=qs[_0x16a4('0x41')](_0x431f3d[_0x16a4('0x39')][_0x16a4('0x41')]);_0x32e851['where']=qs[_0x16a4('0x3a')](_[_0x16a4('0x43')](_0x431f3d['query'],_0x4a9be1[_0x16a4('0x3a')]));if(_0x431f3d[_0x16a4('0x39')]['filter']){_0x32e851[_0x16a4('0x42')]=_[_0x16a4('0x45')](_0x32e851['where'],{'$or':_[_0x16a4('0x33')](_0x32e851[_0x16a4('0x3c')],function(_0x26816b){var _0x6097e0={};_0x6097e0[_0x26816b]={'$like':'%'+_0x431f3d[_0x16a4('0x39')]['filter']+'%'};return _0x6097e0;})});}_0x32e851=_['merge']({},_0x32e851,_0x431f3d[_0x16a4('0x46')]);return _0x233ad8[_0x16a4('0x52')](_0x32e851);}})[_0x16a4('0x1b')](function(_0x291d97){if(_0x291d97){_0x3db89e=_0x291d97[_0x16a4('0x3e')];if(!_0x431f3d[_0x16a4('0x39')]['hasOwnProperty'](_0x16a4('0x55'))){_0x32e851[_0x16a4('0x2a')]=qs[_0x16a4('0x2a')](_0x431f3d[_0x16a4('0x39')]['limit']);_0x32e851[_0x16a4('0x29')]=qs['offset'](_0x431f3d[_0x16a4('0x39')][_0x16a4('0x29')]);}return _0x233ad8['getConfigurations'](_0x32e851);}})['then'](function(_0xee9fbc){if(_0xee9fbc){return _0xee9fbc?{'count':_0x3db89e,'rows':_0xee9fbc}:null;}})['then'](respondWithResult(_0x32efe0,null))[_0x16a4('0x4e')](handleError(_0x32efe0,null));};exports['addConfiguration']=function(_0x28140b,_0x5705cc,_0x8b31eb){if(_0x28140b[_0x16a4('0x50')]['id']){delete _0x28140b['body']['id'];}return db['SalesforceAccount'][_0x16a4('0x53')]({'where':{'id':_0x28140b[_0x16a4('0x4b')]['id']}})[_0x16a4('0x1b')](handleEntityNotFound(_0x5705cc,null))[_0x16a4('0x1b')](function(_0x1d0055){if(_0x1d0055){_0x28140b[_0x16a4('0x50')][_0x16a4('0x56')]=_0x1d0055['id'];_0x28140b['body'][_0x16a4('0x57')]=integrations[_0x16a4('0x58')](_0x28140b[_0x16a4('0x50')][_0x16a4('0x59')],_0x28140b[_0x16a4('0x50')][_0x16a4('0x36')]);_0x28140b[_0x16a4('0x50')][_0x16a4('0x5a')]=integrations[_0x16a4('0x5b')](_0x28140b[_0x16a4('0x50')][_0x16a4('0x59')],_0x28140b[_0x16a4('0x50')][_0x16a4('0x36')]);return db[_0x16a4('0x54')][_0x16a4('0x4f')](_0x28140b['body'],{'include':[{'model':db[_0x16a4('0x5c')],'as':_0x16a4('0x57')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x16a4('0x1b')](respondWithResult(_0x5705cc,null))[_0x16a4('0x4e')](handleError(_0x5705cc,null));};exports['getFields']=function(_0x32353b,_0x286ece,_0x34c4d8){var _0x2bc292;var _0x94f64='';var _0x362f32=_0x16a4('0x5d');return db[_0x16a4('0x34')]['findOne']({'where':{'id':_0x32353b[_0x16a4('0x4b')]['id']},'attributes':['id',_0x16a4('0x5e'),_0x16a4('0x5f'),_0x16a4('0x60'),'username','password',_0x16a4('0x61')]})['then'](handleEntityNotFound(_0x286ece,null))[_0x16a4('0x1b')](function(_0x267897){if(_0x267897){_0x94f64=_0x267897['remoteUri'];var _0x5aa55a=_0x94f64[_0x16a4('0x62')](-0x1);if(_0x5aa55a==='/'){_0x94f64=_0x94f64[_0x16a4('0x63')](0x0,_0x94f64[_0x16a4('0x64')](_0x5aa55a));}_0x2bc292=new jsforce[(_0x16a4('0x65'))]({'oauth2':{'loginUrl':_0x94f64,'clientId':_0x267897['clientId'],'clientSecret':_0x267897[_0x16a4('0x60')]}});return _0x2bc292['login'](_0x267897['username'],_0x267897['password'][_0x16a4('0x66')](_0x267897['securityToken']));}})[_0x16a4('0x1b')](function(_0x3787e9){if(_0x3787e9){if(!_[_0x16a4('0x67')](_0x32353b['query'][_0x16a4('0x68')])){_0x362f32=_0x32353b[_0x16a4('0x39')]['ticketType'];}return _0x2bc292[_0x16a4('0x69')](_0x362f32)['describe']();}})[_0x16a4('0x1b')](function(_0x467783){var _0x311054=[_0x16a4('0x6a'),_0x16a4('0x6b'),'CallObject',_0x16a4('0x6c'),_0x16a4('0x6d'),'Priority',_0x16a4('0x6e'),'Type'];if(!_[_0x16a4('0x67')](_0x32353b[_0x16a4('0x39')]['ticketType'])&&_0x32353b[_0x16a4('0x39')][_0x16a4('0x68')]===_0x16a4('0x6f')){_0x311054=[_0x16a4('0x70'),_0x16a4('0x71'),_0x16a4('0x72'),'Status','Priority',_0x16a4('0x73'),_0x16a4('0x74'),'SuppliedCompany'];}if(_0x467783){_[_0x16a4('0x75')](_0x467783[_0x16a4('0x3d')],function(_0x55dd84){return _0x55dd84[_0x16a4('0x76')]===![]&&!_0x311054[_0x16a4('0x77')](_0x55dd84[_0x16a4('0x31')]);});return{'count':_0x467783['fields'][_0x16a4('0x3e')],'rows':_[_0x16a4('0x33')](_0x467783[_0x16a4('0x3d')],function(_0x555e5e){return{'id':_0x555e5e[_0x16a4('0x31')],'name':_0x555e5e[_0x16a4('0x78')],'custom':_0x555e5e[_0x16a4('0x76')],'options':_0x555e5e[_0x16a4('0x79')][_0x16a4('0x3e')]>0x0?_[_0x16a4('0x33')](_0x555e5e['picklistValues'],function(_0x5ece4c){return{'name':_0x5ece4c[_0x16a4('0x78')],'value':_0x5ece4c['value']};}):_0x555e5e[_0x16a4('0x36')]==_0x16a4('0x7a')?[{'name':'True','value':'true'},{'name':'False','value':'false'}]:[]};})};}})[_0x16a4('0x1b')](respondWithResult(_0x286ece,null))[_0x16a4('0x4e')](function(_0x521210){var _0x1e2053=_0x32353b[_0x16a4('0x39')]['test']?0x1f4:_0x521210[_0x16a4('0x7b')]||0x1f4;logger[_0x16a4('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x16a4('0x7c'),_0x1e2053,JSON[_0x16a4('0x7d')](_0x521210));delete _0x521210[_0x16a4('0x31')];if(_0x1e2053===0x191){_0x1e2053=0x190;}_0x286ece[_0x16a4('0x26')](_0x1e2053)[_0x16a4('0x7e')](_0x32353b[_0x16a4('0x39')][_0x16a4('0x17')]?{'message':'Wrong\x20credentials','statusCode':_0x521210[_0x16a4('0x7b')]}:_0x521210);});};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js
index bc67322..964a4e0 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.model.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6700=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','SalesforceAccount','int_salesforce_accounts','lodash'];(function(_0x17c715,_0x4fbf50){var _0x38b123=function(_0x58cdff){while(--_0x58cdff){_0x17c715['push'](_0x17c715['shift']());}};_0x38b123(++_0x4fbf50);}(_0x6700,0x1ad));var _0x0670=function(_0xb091d2,_0x43f12b){_0xb091d2=_0xb091d2-0x0;var _0x407cab=_0x6700[_0xb091d2];return _0x407cab;};'use strict';var _=require(_0x0670('0x0'));var util=require('util');var logger=require(_0x0670('0x1'))(_0x0670('0x2'));var moment=require(_0x0670('0x3'));var BPromise=require(_0x0670('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0670('0x5'));var rimraf=require('rimraf');var config=require(_0x0670('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0670('0x7')]=function(_0x14cf35,_0x3e19e0){return _0x14cf35['define'](_0x0670('0x8'),attributes,{'tableName':_0x0670('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7182=['./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x10e840,_0x5b3935){var _0x405caa=function(_0x46b707){while(--_0x46b707){_0x10e840['push'](_0x10e840['shift']());}};_0x405caa(++_0x5b3935);}(_0x7182,0x117));var _0x2718=function(_0x16b671,_0x5585c){_0x16b671=_0x16b671-0x0;var _0x47c65c=_0x7182[_0x16b671];return _0x47c65c;};'use strict';var _=require(_0x2718('0x0'));var util=require(_0x2718('0x1'));var logger=require(_0x2718('0x2'))('api');var moment=require(_0x2718('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2718('0x4'));var rimraf=require(_0x2718('0x5'));var config=require(_0x2718('0x6'));var attributes=require(_0x2718('0x7'));var integrations=require(_0x2718('0x8'));module['exports']=function(_0x322989,_0x2a0fb9){return _0x322989[_0x2718('0x9')]('SalesforceAccount',attributes,{'tableName':_0x2718('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
index 8d901ce..7904677 100644
--- a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
+++ b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['http','request','then','request\x20sent','debug','stringify','code','error','message','SalesforceAccount,\x20%s,\x20%s','info','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','include','model','map','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x248c3d,_0x5438dc){var _0x12c2e2=function(_0x3add80){while(--_0x3add80){_0x248c3d['push'](_0x248c3d['shift']());}};_0x12c2e2(++_0x5438dc);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}exports[_0x49c4('0x15')]=function(_0x4c3253){var _0x512650=this;return new Promise(function(_0x3c782d,_0x2f82d5){return db[_0x49c4('0x16')]['findAll']({'raw':_0x4c3253[_0x49c4('0x17')]?_0x4c3253['options'][_0x49c4('0x18')]===undefined?!![]:![]:!![],'where':_0x4c3253[_0x49c4('0x17')]?_0x4c3253[_0x49c4('0x17')][_0x49c4('0x19')]||null:null,'attributes':_0x4c3253[_0x49c4('0x17')]?_0x4c3253[_0x49c4('0x17')][_0x49c4('0x1a')]||null:null,'limit':_0x4c3253[_0x49c4('0x17')]?_0x4c3253[_0x49c4('0x17')]['limit']||null:null,'include':_0x4c3253['options']?_0x4c3253['options'][_0x49c4('0x1b')]?_['map'](_0x4c3253['options'][_0x49c4('0x1b')],function(_0x15581b){return{'model':db[_0x15581b[_0x49c4('0x1c')]],'as':_0x15581b['as'],'attributes':_0x15581b[_0x49c4('0x1a')],'include':_0x15581b['include']?_['map'](_0x15581b[_0x49c4('0x1b')],function(_0x9cb797){return{'model':db[_0x9cb797['model']],'as':_0x9cb797['as'],'attributes':_0x9cb797[_0x49c4('0x1a')],'include':_0x9cb797[_0x49c4('0x1b')]?_[_0x49c4('0x1d')](_0x9cb797[_0x49c4('0x1b')],function(_0x531d92){return{'model':db[_0x531d92['model']],'as':_0x531d92['as'],'attributes':_0x531d92[_0x49c4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3800b7){logger[_0x49c4('0x12')](_0x49c4('0x15'),_0x4c3253);logger[_0x49c4('0xc')]('GetSalesforceAccount',_0x4c3253,JSON[_0x49c4('0xd')](_0x3800b7));_0x3c782d(_0x3800b7);})[_0x49c4('0x14')](function(_0x46e04d){logger[_0x49c4('0xf')](_0x49c4('0x15'),_0x46e04d[_0x49c4('0x10')],_0x4c3253);_0x2f82d5(_0x512650[_0x49c4('0xf')](0x1f4,_0x46e04d[_0x49c4('0x10')]));});});};exports[_0x49c4('0x1e')]=function(_0x2cbd88){var _0x46f7ea=this;return new Promise(function(_0x4ea6ea,_0x4f4495){return db['SalesforceAccount'][_0x49c4('0x1f')]({'raw':_0x2cbd88[_0x49c4('0x17')]?_0x2cbd88[_0x49c4('0x17')][_0x49c4('0x18')]===undefined?!![]:![]:!![],'where':_0x2cbd88[_0x49c4('0x17')]?_0x2cbd88['options'][_0x49c4('0x19')]||null:null,'attributes':_0x2cbd88[_0x49c4('0x17')]?_0x2cbd88[_0x49c4('0x17')][_0x49c4('0x1a')]||null:null,'include':_0x2cbd88['options']?_0x2cbd88['options'][_0x49c4('0x1b')]?_[_0x49c4('0x1d')](_0x2cbd88[_0x49c4('0x17')][_0x49c4('0x1b')],function(_0xd38540){return{'model':db[_0xd38540['model']],'as':_0xd38540['as'],'attributes':_0xd38540[_0x49c4('0x1a')],'include':_0xd38540[_0x49c4('0x1b')]?_[_0x49c4('0x1d')](_0xd38540['include'],function(_0x5ba924){return{'model':db[_0x5ba924[_0x49c4('0x1c')]],'as':_0x5ba924['as'],'attributes':_0x5ba924[_0x49c4('0x1a')],'include':_0x5ba924[_0x49c4('0x1b')]?_[_0x49c4('0x1d')](_0x5ba924[_0x49c4('0x1b')],function(_0x2cf897){return{'model':db[_0x2cf897[_0x49c4('0x1c')]],'as':_0x2cf897['as'],'attributes':_0x2cf897[_0x49c4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x49c4('0xa')](function(_0x4e0209){logger[_0x49c4('0x12')]('ShowSalesforceAccount',_0x2cbd88);logger[_0x49c4('0xc')](_0x49c4('0x1e'),_0x2cbd88,JSON[_0x49c4('0xd')](_0x4e0209));_0x4ea6ea(_0x4e0209);})[_0x49c4('0x14')](function(_0x4ed4f8){logger[_0x49c4('0xf')](_0x49c4('0x1e'),_0x4ed4f8[_0x49c4('0x10')],_0x2cbd88);_0x4f4495(_0x46f7ea['error'](0x1f4,_0x4ed4f8[_0x49c4('0x10')]));});});};
\ No newline at end of file
+var _0x750a=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','catch','options','raw','attributes','limit','model','include','map','GetSalesforceAccount','ShowSalesforceAccount','SalesforceAccount','where'];(function(_0x526160,_0x1d8aa8){var _0x2e90b1=function(_0x2ab67e){while(--_0x2ab67e){_0x526160['push'](_0x526160['shift']());}};_0x2e90b1(++_0x1d8aa8);}(_0x750a,0x140));var _0xa750=function(_0x5e4a0b,_0x58c3a8){_0x5e4a0b=_0x5e4a0b-0x0;var _0x2f894e=_0x750a[_0x5e4a0b];return _0x2f894e;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}exports['GetSalesforceAccount']=function(_0x433dbd){var _0x1bde87=this;return new Promise(function(_0x4f1faa,_0x36dcca){return db['SalesforceAccount']['findAll']({'raw':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['where']||null:null,'attributes':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x17')]||null:null,'limit':_0x433dbd['options']?_0x433dbd['options'][_0xa750('0x18')]||null:null,'include':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['include']?_['map'](_0x433dbd['options']['include'],function(_0x15d72f){return{'model':db[_0x15d72f[_0xa750('0x19')]],'as':_0x15d72f['as'],'attributes':_0x15d72f[_0xa750('0x17')],'include':_0x15d72f[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x15d72f[_0xa750('0x1a')],function(_0x3001bc){return{'model':db[_0x3001bc[_0xa750('0x19')]],'as':_0x3001bc['as'],'attributes':_0x3001bc[_0xa750('0x17')],'include':_0x3001bc[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x3001bc[_0xa750('0x1a')],function(_0x31ea63){return{'model':db[_0x31ea63[_0xa750('0x19')]],'as':_0x31ea63['as'],'attributes':_0x31ea63[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d3923){logger[_0xa750('0xc')](_0xa750('0x1c'),_0x433dbd);logger['debug'](_0xa750('0x1c'),_0x433dbd,JSON[_0xa750('0xf')](_0x3d3923));_0x4f1faa(_0x3d3923);})[_0xa750('0x14')](function(_0x1223d2){logger['error'](_0xa750('0x1c'),_0x1223d2[_0xa750('0x13')],_0x433dbd);_0x36dcca(_0x1bde87[_0xa750('0x10')](0x1f4,_0x1223d2[_0xa750('0x13')]));});});};exports[_0xa750('0x1d')]=function(_0x59ab33){var _0x46cc11=this;return new Promise(function(_0x4c2c9e,_0x2d0e93){return db[_0xa750('0x1e')]['find']({'raw':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x1f')]||null:null,'attributes':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')]['attributes']||null:null,'include':_0x59ab33[_0xa750('0x15')]?_0x59ab33['options'][_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x59ab33[_0xa750('0x15')][_0xa750('0x1a')],function(_0x556fde){return{'model':db[_0x556fde[_0xa750('0x19')]],'as':_0x556fde['as'],'attributes':_0x556fde[_0xa750('0x17')],'include':_0x556fde['include']?_[_0xa750('0x1b')](_0x556fde[_0xa750('0x1a')],function(_0x280b87){return{'model':db[_0x280b87[_0xa750('0x19')]],'as':_0x280b87['as'],'attributes':_0x280b87['attributes'],'include':_0x280b87[_0xa750('0x1a')]?_['map'](_0x280b87['include'],function(_0x4e59f3){return{'model':db[_0x4e59f3[_0xa750('0x19')]],'as':_0x4e59f3['as'],'attributes':_0x4e59f3[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x470089){logger[_0xa750('0xc')](_0xa750('0x1d'),_0x59ab33);logger['debug'](_0xa750('0x1d'),_0x59ab33,JSON[_0xa750('0xf')](_0x470089));_0x4c2c9e(_0x470089);})[_0xa750('0x14')](function(_0x5d402a){logger[_0xa750('0x10')](_0xa750('0x1d'),_0x5d402a[_0xa750('0x13')],_0x59ab33);_0x2d0e93(_0x46cc11['error'](0x1f4,_0x5d402a[_0xa750('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js
index 42f4f74..fa88b22 100644
--- a/server/api/intSalesforceConfiguration/index.js
+++ b/server/api/intSalesforceConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc8cf=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x5b6b11,_0x1bc350){var _0x5379d0=function(_0x444f0e){while(--_0x444f0e){_0x5b6b11['push'](_0x5b6b11['shift']());}};_0x5379d0(++_0x1bc350);}(_0xc8cf,0x111));var _0xfc8c=function(_0x235187,_0x467163){_0x235187=_0x235187-0x0;var _0x7337d0=_0xc8cf[_0x235187];return _0x7337d0;};'use strict';var multer=require(_0xfc8c('0x0'));var util=require('util');var path=require(_0xfc8c('0x1'));var timeout=require(_0xfc8c('0x2'));var express=require(_0xfc8c('0x3'));var router=express[_0xfc8c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfc8c('0x5'));var config=require(_0xfc8c('0x6'));var controller=require(_0xfc8c('0x7'));router[_0xfc8c('0x8')]('/',auth[_0xfc8c('0x9')](),controller[_0xfc8c('0xa')]);router[_0xfc8c('0x8')](_0xfc8c('0xb'),auth['isAuthenticated'](),controller[_0xfc8c('0xc')]);router[_0xfc8c('0x8')](_0xfc8c('0xd'),auth[_0xfc8c('0x9')](),controller[_0xfc8c('0xe')]);router[_0xfc8c('0x8')](_0xfc8c('0xf'),auth['isAuthenticated'](),controller[_0xfc8c('0x10')]);router[_0xfc8c('0x8')](_0xfc8c('0x11'),auth['isAuthenticated'](),controller[_0xfc8c('0x12')]);router[_0xfc8c('0x13')]('/',auth['isAuthenticated'](),controller[_0xfc8c('0x14')]);router['put'](_0xfc8c('0xb'),auth[_0xfc8c('0x9')](),controller['update']);router[_0xfc8c('0x15')](_0xfc8c('0xb'),auth[_0xfc8c('0x9')](),controller[_0xfc8c('0x16')]);module[_0xfc8c('0x17')]=router;
\ No newline at end of file
+var _0xd843=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0xd843,0x1c5));var _0x3d84=function(_0x3cb21e,_0x11849a){_0x3cb21e=_0x3cb21e-0x0;var _0xeacd6a=_0xd843[_0x3cb21e];return _0xeacd6a;};'use strict';var multer=require(_0x3d84('0x0'));var util=require(_0x3d84('0x1'));var path=require(_0x3d84('0x2'));var timeout=require(_0x3d84('0x3'));var express=require(_0x3d84('0x4'));var router=express['Router']();var auth=require(_0x3d84('0x5'));var interaction=require(_0x3d84('0x6'));var config=require(_0x3d84('0x7'));var controller=require(_0x3d84('0x8'));router[_0x3d84('0x9')]('/',auth[_0x3d84('0xa')](),controller[_0x3d84('0xb')]);router[_0x3d84('0x9')]('/:id',auth[_0x3d84('0xa')](),controller['show']);router[_0x3d84('0x9')](_0x3d84('0xc'),auth[_0x3d84('0xa')](),controller[_0x3d84('0xd')]);router[_0x3d84('0x9')](_0x3d84('0xe'),auth[_0x3d84('0xa')](),controller[_0x3d84('0xf')]);router['get'](_0x3d84('0x10'),auth[_0x3d84('0xa')](),controller[_0x3d84('0x11')]);router[_0x3d84('0x12')]('/',auth['isAuthenticated'](),controller[_0x3d84('0x13')]);router[_0x3d84('0x14')]('/:id',auth[_0x3d84('0xa')](),controller[_0x3d84('0x15')]);router[_0x3d84('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x3d84('0x17')]);module[_0x3d84('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
index ed38aa4..556941d 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf5d=['exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','nothing','sequelize'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0xaf5d,0x1b7));var _0xdaf5=function(_0xcbf68,_0x4dfe6b){_0xcbf68=_0xcbf68-0x0;var _0xb1aac7=_0xaf5d[_0xcbf68];return _0xb1aac7;};'use strict';var Sequelize=require(_0xdaf5('0x0'));module[_0xdaf5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdaf5('0x2')]},'ticketType':{'type':Sequelize[_0xdaf5('0x3')](_0xdaf5('0x4'),_0xdaf5('0x5')),'defaultValue':_0xdaf5('0x4')},'moduleSearch':{'type':Sequelize[_0xdaf5('0x3')](_0xdaf5('0x6'),_0xdaf5('0x7'),_0xdaf5('0x8')),'defaultValue':_0xdaf5('0x6')},'moduleCreate':{'type':Sequelize[_0xdaf5('0x3')](_0xdaf5('0x9'),'contact',_0xdaf5('0x8')),'defaultValue':_0xdaf5('0x8')}};
\ No newline at end of file
+var _0xd83a=['contact','lead','exports','STRING','ENUM','Task','Case','contact_lead'];(function(_0x5cb798,_0x5a3754){var _0xacea49=function(_0x301c41){while(--_0x301c41){_0x5cb798['push'](_0x5cb798['shift']());}};_0xacea49(++_0x5a3754);}(_0xd83a,0xca));var _0xad83=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0xd83a[_0x5e6cb8];return _0x3faeb3;};'use strict';var Sequelize=require('sequelize');module[_0xad83('0x0')]={'name':{'type':Sequelize[_0xad83('0x1')]},'description':{'type':Sequelize[_0xad83('0x1')]},'ticketType':{'type':Sequelize[_0xad83('0x2')](_0xad83('0x3'),_0xad83('0x4')),'defaultValue':_0xad83('0x3')},'moduleSearch':{'type':Sequelize[_0xad83('0x2')](_0xad83('0x5'),_0xad83('0x6'),'lead'),'defaultValue':_0xad83('0x5')},'moduleCreate':{'type':Sequelize[_0xad83('0x2')]('nothing',_0xad83('0x6'),_0xad83('0x7')),'defaultValue':_0xad83('0x7')}};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
index 9816719..c4390cf 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c6d=['VIRTUAL','then','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','getFields','findOne','length','getSubjects','SalesforceField','pick','options','getDescriptions','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','end','status','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge'];(function(_0x342b67,_0x2941d2){var _0x1c97f7=function(_0x570454){while(--_0x570454){_0x342b67['push'](_0x342b67['shift']());}};_0x1c97f7(++_0x2941d2);}(_0x3c6d,0x190));var _0xd3c6=function(_0x4177ee,_0x507602){_0x4177ee=_0x4177ee-0x0;var _0xae98ab=_0x3c6d[_0x4177ee];return _0xae98ab;};'use strict';var pdf=require(_0xd3c6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd3c6('0x1'));var jsonpatch=require(_0xd3c6('0x2'));var rp=require(_0xd3c6('0x3'));var moment=require(_0xd3c6('0x4'));var BPromise=require(_0xd3c6('0x5'));var Mustache=require(_0xd3c6('0x6'));var util=require(_0xd3c6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd3c6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd3c6('0x9'));var squel=require('squel');var crypto=require(_0xd3c6('0xa'));var jsforce=require(_0xd3c6('0xb'));var deskjs=require(_0xd3c6('0xc'));var toCsv=require(_0xd3c6('0x8'));var querystring=require(_0xd3c6('0xd'));var Papa=require(_0xd3c6('0xe'));var Redis=require(_0xd3c6('0xf'));var authService=require(_0xd3c6('0x10'));var qs=require(_0xd3c6('0x11'));var as=require(_0xd3c6('0x12'));var hardwareService=require(_0xd3c6('0x13'));var logger=require('../../config/logger')(_0xd3c6('0x14'));var utils=require(_0xd3c6('0x15'));var config=require(_0xd3c6('0x16'));var db=require(_0xd3c6('0x17'))['db'];var jayson=require(_0xd3c6('0x18'));var client=jayson[_0xd3c6('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x44d541,_0x2c4c,_0x55f959){if(_0x55f959){var _0x176bf8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x176bf8[_0xd3c6('0x1a')](_0x2c4c)){return _0x44d541;}else{throw new db[(_0xd3c6('0x1b'))][(_0xd3c6('0x1c'))](_0xd3c6('0x1d'));}}else{return _0x44d541;}}function respondWithRpcPromise(_0x4047c1,_0xd8cd4f,_0x1b8653,_0x5ad5f9){return new BPromise(function(_0x420b20,_0x12722f){var _0x1d78bf=_0x5ad5f9||client;return _0x1d78bf['request'](_0x4047c1,_0x1b8653)['then'](function(_0xe68efc){logger[_0xd3c6('0x1e')](_0xd3c6('0x1f'),_0xd8cd4f,'request\x20sent');logger[_0xd3c6('0x20')](_0xd3c6('0x21'),_0xd8cd4f,_0xd3c6('0x22'),JSON['stringify'](_0xe68efc));if(_0xe68efc[_0xd3c6('0x23')]){if(_0xe68efc[_0xd3c6('0x23')][_0xd3c6('0x24')]===0x1f4){logger['error'](_0xd3c6('0x1f'),_0xd8cd4f,_0xe68efc[_0xd3c6('0x23')]['message']);return _0x12722f(_0xe68efc[_0xd3c6('0x23')]['message']);}logger['error'](_0xd3c6('0x1f'),_0xd8cd4f,_0xe68efc[_0xd3c6('0x23')][_0xd3c6('0x25')]);return _0x420b20(_0xe68efc['error'][_0xd3c6('0x25')]);}else{logger[_0xd3c6('0x1e')](_0xd3c6('0x1f'),_0xd8cd4f,'request\x20sent');_0x420b20(_0xe68efc[_0xd3c6('0x26')][_0xd3c6('0x25')]);}})[_0xd3c6('0x27')](function(_0x3f1a81){logger[_0xd3c6('0x23')](_0xd3c6('0x1f'),_0xd8cd4f,_0x3f1a81);_0x12722f(_0x3f1a81);});});}function respondWithStatusCode(_0x38aeef,_0xcfa161){_0xcfa161=_0xcfa161||0xcc;return function(_0x37a237){if(_0x37a237){return _0x38aeef[_0xd3c6('0x28')](_0xcfa161);}return _0x38aeef['status'](_0xcfa161)[_0xd3c6('0x29')]();};}function respondWithResult(_0x150406,_0x484652){_0x484652=_0x484652||0xc8;return function(_0x5ad313){if(_0x5ad313){return _0x150406[_0xd3c6('0x2a')](_0x484652)['json'](_0x5ad313);}};}function respondWithFilteredResult(_0xe3e7eb,_0x343e54){return function(_0x12ebff){if(_0x12ebff){var _0xe1f688=_0x12ebff[_0xd3c6('0x2b')],_0x3bef90=_0x343e54[_0xd3c6('0x2c')],_0x1fbc60=_0x343e54[_0xd3c6('0x2c')]+_0x343e54['limit'],_0x5ee78c;if(_0x1fbc60>=_0xe1f688){_0x1fbc60=_0xe1f688;_0x5ee78c=0xc8;}else{_0x5ee78c=0xce;}_0xe3e7eb['status'](_0x5ee78c);return _0xe3e7eb[_0xd3c6('0x2d')](_0xd3c6('0x2e'),_0x3bef90+'-'+_0x1fbc60+'/'+_0xe1f688)[_0xd3c6('0x2f')](_0x12ebff);}return null;};}function patchUpdates(_0x921018){return function(_0x437819){try{jsonpatch[_0xd3c6('0x30')](_0x437819,_0x921018,!![]);}catch(_0x42c7d7){return BPromise[_0xd3c6('0x31')](_0x42c7d7);}return _0x437819[_0xd3c6('0x32')]();};}function saveUpdates(_0x5cf909,_0x155648){return function(_0x3f7dae){if(_0x3f7dae){return _0x3f7dae[_0xd3c6('0x33')](_0x5cf909)['then'](function(_0xa557fc){return _0xa557fc;});}return null;};}function removeEntity(_0xb3f10,_0x76d28c){return function(_0x220b0f){if(_0x220b0f){return _0x220b0f[_0xd3c6('0x34')]()['then'](function(){_0xb3f10[_0xd3c6('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x480de5,_0x140028){return function(_0x27eba6){if(!_0x27eba6){_0x480de5[_0xd3c6('0x28')](0x194);}return _0x27eba6;};}function handleError(_0x1fc90b,_0x4676d9){_0x4676d9=_0x4676d9||0x1f4;return function(_0x1cbc47){logger['error'](_0x1cbc47[_0xd3c6('0x35')]);if(_0x1cbc47['name']){delete _0x1cbc47[_0xd3c6('0x36')];}_0x1fc90b['status'](_0x4676d9)['send'](_0x1cbc47);};}exports['index']=function(_0x5e980e,_0x3e4126){var _0x206fac={},_0x463e54={},_0x1f8f91={'count':0x0,'rows':[]};var _0x2112db=_[_0xd3c6('0x37')](db[_0xd3c6('0x38')]['rawAttributes'],function(_0x124376){return{'name':_0x124376[_0xd3c6('0x39')],'type':_0x124376[_0xd3c6('0x3a')][_0xd3c6('0x3b')]};});_0x463e54[_0xd3c6('0x3c')]=_['map'](_0x2112db,'name');_0x463e54[_0xd3c6('0x3d')]=_[_0xd3c6('0x3e')](_0x5e980e[_0xd3c6('0x3d')]);_0x463e54['filters']=_[_0xd3c6('0x3f')](_0x463e54['model'],_0x463e54[_0xd3c6('0x3d')]);_0x206fac[_0xd3c6('0x40')]=_[_0xd3c6('0x3f')](_0x463e54['model'],qs[_0xd3c6('0x41')](_0x5e980e[_0xd3c6('0x3d')][_0xd3c6('0x41')]));_0x206fac['attributes']=_0x206fac[_0xd3c6('0x40')]['length']?_0x206fac[_0xd3c6('0x40')]:_0x463e54[_0xd3c6('0x3c')];if(!_0x5e980e['query'][_0xd3c6('0x42')](_0xd3c6('0x43'))){_0x206fac['limit']=qs[_0xd3c6('0x44')](_0x5e980e[_0xd3c6('0x3d')][_0xd3c6('0x44')]);_0x206fac[_0xd3c6('0x2c')]=qs[_0xd3c6('0x2c')](_0x5e980e[_0xd3c6('0x3d')]['offset']);}_0x206fac[_0xd3c6('0x45')]=qs[_0xd3c6('0x46')](_0x5e980e[_0xd3c6('0x3d')][_0xd3c6('0x46')]);_0x206fac[_0xd3c6('0x47')]=qs[_0xd3c6('0x48')](_['pick'](_0x5e980e[_0xd3c6('0x3d')],_0x463e54[_0xd3c6('0x48')]),_0x2112db);if(_0x5e980e[_0xd3c6('0x3d')][_0xd3c6('0x49')]){_0x206fac[_0xd3c6('0x47')]=_[_0xd3c6('0x4a')](_0x206fac[_0xd3c6('0x47')],{'$or':_[_0xd3c6('0x37')](_0x2112db,function(_0x26860d){if(_0x26860d[_0xd3c6('0x3a')]!==_0xd3c6('0x4b')){var _0x4c58a0={};_0x4c58a0[_0x26860d[_0xd3c6('0x36')]]={'$like':'%'+_0x5e980e[_0xd3c6('0x3d')][_0xd3c6('0x49')]+'%'};return _0x4c58a0;}})});}_0x206fac=_[_0xd3c6('0x4a')]({},_0x206fac,_0x5e980e['options']);var _0x543ba8={'where':_0x206fac[_0xd3c6('0x47')]};return db['SalesforceConfiguration']['count'](_0x543ba8)[_0xd3c6('0x4c')](function(_0x5274ea){_0x1f8f91[_0xd3c6('0x2b')]=_0x5274ea;if(_0x5e980e['query'][_0xd3c6('0x4d')]){_0x206fac[_0xd3c6('0x4e')]=[{'all':!![]}];}return db[_0xd3c6('0x38')][_0xd3c6('0x4f')](_0x206fac);})['then'](function(_0x54bb6f){_0x1f8f91[_0xd3c6('0x50')]=_0x54bb6f;return _0x1f8f91;})[_0xd3c6('0x4c')](respondWithFilteredResult(_0x3e4126,_0x206fac))[_0xd3c6('0x27')](handleError(_0x3e4126,null));};exports[_0xd3c6('0x51')]=function(_0x1a9a5a,_0x38878a){var _0x12ea1f={'raw':![],'where':{'id':_0x1a9a5a[_0xd3c6('0x52')]['id']}},_0x4ffa46={};_0x4ffa46[_0xd3c6('0x3c')]=_[_0xd3c6('0x3e')](db[_0xd3c6('0x38')][_0xd3c6('0x53')]);_0x4ffa46['query']=_[_0xd3c6('0x3e')](_0x1a9a5a[_0xd3c6('0x3d')]);_0x4ffa46[_0xd3c6('0x48')]=_[_0xd3c6('0x3f')](_0x4ffa46['model'],_0x4ffa46[_0xd3c6('0x3d')]);_0x12ea1f['attributes']=_['intersection'](_0x4ffa46[_0xd3c6('0x3c')],qs['fields'](_0x1a9a5a[_0xd3c6('0x3d')][_0xd3c6('0x41')]));_0x12ea1f[_0xd3c6('0x40')]=_0x12ea1f[_0xd3c6('0x40')]['length']?_0x12ea1f[_0xd3c6('0x40')]:_0x4ffa46[_0xd3c6('0x3c')];if(_0x1a9a5a[_0xd3c6('0x3d')]['includeAll']){_0x12ea1f[_0xd3c6('0x4e')]=[{'all':!![]}];}_0x12ea1f=_[_0xd3c6('0x4a')]({},_0x12ea1f,_0x1a9a5a['options']);return db['SalesforceConfiguration'][_0xd3c6('0x54')](_0x12ea1f)['then'](handleEntityNotFound(_0x38878a,null))[_0xd3c6('0x4c')](respondWithResult(_0x38878a,null))[_0xd3c6('0x27')](handleError(_0x38878a,null));};exports['create']=function(_0x3136ac,_0xa983e6){return db['SalesforceConfiguration'][_0xd3c6('0x55')](_0x3136ac[_0xd3c6('0x56')],{})[_0xd3c6('0x4c')](respondWithResult(_0xa983e6,0xc9))[_0xd3c6('0x27')](handleError(_0xa983e6,null));};exports[_0xd3c6('0x33')]=function(_0x5657b1,_0x22624f){if(_0x5657b1['body']['id']){delete _0x5657b1['body']['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x5657b1[_0xd3c6('0x52')]['id']}})['then'](handleEntityNotFound(_0x22624f,null))[_0xd3c6('0x4c')](saveUpdates(_0x5657b1['body'],null))[_0xd3c6('0x4c')](respondWithResult(_0x22624f,null))[_0xd3c6('0x27')](handleError(_0x22624f,null));};exports[_0xd3c6('0x34')]=function(_0x1a4b22,_0x788d17){return db[_0xd3c6('0x38')][_0xd3c6('0x54')]({'where':{'id':_0x1a4b22[_0xd3c6('0x52')]['id']}})[_0xd3c6('0x4c')](handleEntityNotFound(_0x788d17,null))[_0xd3c6('0x4c')](removeEntity(_0x788d17,null))['catch'](handleError(_0x788d17,null));};exports[_0xd3c6('0x57')]=function(_0x364f63,_0x533ea8,_0x570d88){var _0x21e1c6={};var _0x30c11f={};var _0x105ff8;var _0x414863;return db[_0xd3c6('0x38')][_0xd3c6('0x58')]({'where':{'id':_0x364f63[_0xd3c6('0x52')]['id']}})[_0xd3c6('0x4c')](handleEntityNotFound(_0x533ea8,null))[_0xd3c6('0x4c')](function(_0x237f08){if(_0x237f08){_0x105ff8=_0x237f08;_0x30c11f['model']=_[_0xd3c6('0x3e')](db['SalesforceField'][_0xd3c6('0x53')]);_0x30c11f[_0xd3c6('0x3d')]=_['keys'](_0x364f63[_0xd3c6('0x3d')]);_0x30c11f[_0xd3c6('0x48')]=_[_0xd3c6('0x3f')](_0x30c11f[_0xd3c6('0x3c')],_0x30c11f['query']);_0x21e1c6['attributes']=_[_0xd3c6('0x3f')](_0x30c11f[_0xd3c6('0x3c')],qs[_0xd3c6('0x41')](_0x364f63['query'][_0xd3c6('0x41')]));_0x21e1c6[_0xd3c6('0x40')]=_0x21e1c6['attributes'][_0xd3c6('0x59')]?_0x21e1c6[_0xd3c6('0x40')]:_0x30c11f['model'];_0x21e1c6[_0xd3c6('0x45')]=qs[_0xd3c6('0x46')](_0x364f63[_0xd3c6('0x3d')][_0xd3c6('0x46')]);_0x21e1c6['where']=qs[_0xd3c6('0x48')](_['pick'](_0x364f63[_0xd3c6('0x3d')],_0x30c11f[_0xd3c6('0x48')]));if(_0x364f63[_0xd3c6('0x3d')]['filter']){_0x21e1c6['where']=_[_0xd3c6('0x4a')](_0x21e1c6['where'],{'$or':_[_0xd3c6('0x37')](_0x21e1c6['attributes'],function(_0x509b5e){var _0x13562a={};_0x13562a[_0x509b5e]={'$like':'%'+_0x364f63[_0xd3c6('0x3d')][_0xd3c6('0x49')]+'%'};return _0x13562a;})});}_0x21e1c6=_['merge']({},_0x21e1c6,_0x364f63['options']);return _0x105ff8['getFields'](_0x21e1c6);}})[_0xd3c6('0x4c')](function(_0x1a7799){if(_0x1a7799){_0x414863=_0x1a7799[_0xd3c6('0x59')];if(!_0x364f63[_0xd3c6('0x3d')][_0xd3c6('0x42')](_0xd3c6('0x43'))){_0x21e1c6[_0xd3c6('0x44')]=qs[_0xd3c6('0x44')](_0x364f63[_0xd3c6('0x3d')][_0xd3c6('0x44')]);_0x21e1c6[_0xd3c6('0x2c')]=qs[_0xd3c6('0x2c')](_0x364f63[_0xd3c6('0x3d')][_0xd3c6('0x2c')]);}return _0x105ff8[_0xd3c6('0x57')](_0x21e1c6);}})[_0xd3c6('0x4c')](function(_0xc3cd76){if(_0xc3cd76){return _0xc3cd76?{'count':_0x414863,'rows':_0xc3cd76}:null;}})[_0xd3c6('0x4c')](respondWithResult(_0x533ea8,null))[_0xd3c6('0x27')](handleError(_0x533ea8,null));};exports[_0xd3c6('0x5a')]=function(_0x24572f,_0xadc0a3,_0x51180f){var _0x3441d5={};var _0x3aa61a={};var _0x3ddfa2;var _0x2c31f2;return db[_0xd3c6('0x38')][_0xd3c6('0x58')]({'where':{'id':_0x24572f[_0xd3c6('0x52')]['id']}})[_0xd3c6('0x4c')](handleEntityNotFound(_0xadc0a3,null))['then'](function(_0x375839){if(_0x375839){_0x3ddfa2=_0x375839;_0x3aa61a[_0xd3c6('0x3c')]=_[_0xd3c6('0x3e')](db[_0xd3c6('0x5b')][_0xd3c6('0x53')]);_0x3aa61a[_0xd3c6('0x3d')]=_['keys'](_0x24572f[_0xd3c6('0x3d')]);_0x3aa61a['filters']=_[_0xd3c6('0x3f')](_0x3aa61a[_0xd3c6('0x3c')],_0x3aa61a[_0xd3c6('0x3d')]);_0x3441d5[_0xd3c6('0x40')]=_[_0xd3c6('0x3f')](_0x3aa61a[_0xd3c6('0x3c')],qs[_0xd3c6('0x41')](_0x24572f[_0xd3c6('0x3d')][_0xd3c6('0x41')]));_0x3441d5[_0xd3c6('0x40')]=_0x3441d5[_0xd3c6('0x40')][_0xd3c6('0x59')]?_0x3441d5[_0xd3c6('0x40')]:_0x3aa61a['model'];_0x3441d5[_0xd3c6('0x45')]=qs[_0xd3c6('0x46')](_0x24572f[_0xd3c6('0x3d')][_0xd3c6('0x46')]);_0x3441d5[_0xd3c6('0x47')]=qs[_0xd3c6('0x48')](_[_0xd3c6('0x5c')](_0x24572f['query'],_0x3aa61a[_0xd3c6('0x48')]));if(_0x24572f[_0xd3c6('0x3d')][_0xd3c6('0x49')]){_0x3441d5[_0xd3c6('0x47')]=_['merge'](_0x3441d5['where'],{'$or':_[_0xd3c6('0x37')](_0x3441d5[_0xd3c6('0x40')],function(_0x2eed3f){var _0x1190a4={};_0x1190a4[_0x2eed3f]={'$like':'%'+_0x24572f[_0xd3c6('0x3d')][_0xd3c6('0x49')]+'%'};return _0x1190a4;})});}_0x3441d5=_[_0xd3c6('0x4a')]({},_0x3441d5,_0x24572f[_0xd3c6('0x5d')]);return _0x3ddfa2['getSubjects'](_0x3441d5);}})[_0xd3c6('0x4c')](function(_0x48439f){if(_0x48439f){_0x2c31f2=_0x48439f[_0xd3c6('0x59')];if(!_0x24572f[_0xd3c6('0x3d')][_0xd3c6('0x42')](_0xd3c6('0x43'))){_0x3441d5['limit']=qs[_0xd3c6('0x44')](_0x24572f[_0xd3c6('0x3d')][_0xd3c6('0x44')]);_0x3441d5['offset']=qs[_0xd3c6('0x2c')](_0x24572f[_0xd3c6('0x3d')][_0xd3c6('0x2c')]);}return _0x3ddfa2[_0xd3c6('0x5a')](_0x3441d5);}})[_0xd3c6('0x4c')](function(_0x19f37e){if(_0x19f37e){return _0x19f37e?{'count':_0x2c31f2,'rows':_0x19f37e}:null;}})[_0xd3c6('0x4c')](respondWithResult(_0xadc0a3,null))['catch'](handleError(_0xadc0a3,null));};exports[_0xd3c6('0x5e')]=function(_0x4e3143,_0x4a7694,_0x4d2f8b){var _0x44a428={};var _0x59cc54={};var _0xef38b4;var _0xf97334;return db['SalesforceConfiguration'][_0xd3c6('0x58')]({'where':{'id':_0x4e3143[_0xd3c6('0x52')]['id']}})['then'](handleEntityNotFound(_0x4a7694,null))['then'](function(_0x2e06bc){if(_0x2e06bc){_0xef38b4=_0x2e06bc;_0x59cc54[_0xd3c6('0x3c')]=_[_0xd3c6('0x3e')](db[_0xd3c6('0x5b')][_0xd3c6('0x53')]);_0x59cc54[_0xd3c6('0x3d')]=_[_0xd3c6('0x3e')](_0x4e3143[_0xd3c6('0x3d')]);_0x59cc54[_0xd3c6('0x48')]=_[_0xd3c6('0x3f')](_0x59cc54[_0xd3c6('0x3c')],_0x59cc54[_0xd3c6('0x3d')]);_0x44a428[_0xd3c6('0x40')]=_['intersection'](_0x59cc54[_0xd3c6('0x3c')],qs[_0xd3c6('0x41')](_0x4e3143['query'][_0xd3c6('0x41')]));_0x44a428[_0xd3c6('0x40')]=_0x44a428['attributes']['length']?_0x44a428[_0xd3c6('0x40')]:_0x59cc54[_0xd3c6('0x3c')];_0x44a428[_0xd3c6('0x45')]=qs[_0xd3c6('0x46')](_0x4e3143[_0xd3c6('0x3d')][_0xd3c6('0x46')]);_0x44a428[_0xd3c6('0x47')]=qs[_0xd3c6('0x48')](_[_0xd3c6('0x5c')](_0x4e3143[_0xd3c6('0x3d')],_0x59cc54[_0xd3c6('0x48')]));if(_0x4e3143[_0xd3c6('0x3d')]['filter']){_0x44a428['where']=_['merge'](_0x44a428[_0xd3c6('0x47')],{'$or':_[_0xd3c6('0x37')](_0x44a428[_0xd3c6('0x40')],function(_0x4fa26c){var _0x40e028={};_0x40e028[_0x4fa26c]={'$like':'%'+_0x4e3143[_0xd3c6('0x3d')][_0xd3c6('0x49')]+'%'};return _0x40e028;})});}_0x44a428=_[_0xd3c6('0x4a')]({},_0x44a428,_0x4e3143[_0xd3c6('0x5d')]);return _0xef38b4['getDescriptions'](_0x44a428);}})[_0xd3c6('0x4c')](function(_0x1bd62d){if(_0x1bd62d){_0xf97334=_0x1bd62d[_0xd3c6('0x59')];if(!_0x4e3143[_0xd3c6('0x3d')][_0xd3c6('0x42')]('nolimit')){_0x44a428[_0xd3c6('0x44')]=qs[_0xd3c6('0x44')](_0x4e3143[_0xd3c6('0x3d')]['limit']);_0x44a428[_0xd3c6('0x2c')]=qs[_0xd3c6('0x2c')](_0x4e3143['query']['offset']);}return _0xef38b4[_0xd3c6('0x5e')](_0x44a428);}})['then'](function(_0x5783c9){if(_0x5783c9){return _0x5783c9?{'count':_0xf97334,'rows':_0x5783c9}:null;}})[_0xd3c6('0x4c')](respondWithResult(_0x4a7694,null))[_0xd3c6('0x27')](handleError(_0x4a7694,null));};
\ No newline at end of file
+var _0x1823=['result','catch','sendStatus','status','end','count','offset','json','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','limit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','SalesforceConfiguration','params','create','body','find','findOne','hasOwnProperty','nolimit','getFields','SalesforceField','order','getSubjects','getDescriptions','html-pdf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','http','test','Sequelize','ValidationError','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0x5c5512,_0x3897fd){var _0x22ab03=function(_0x14ec98){while(--_0x14ec98){_0x5c5512['push'](_0x5c5512['shift']());}};_0x22ab03(++_0x3897fd);}(_0x1823,0xe6));var _0x3182=function(_0x20a1b0,_0x18fe84){_0x20a1b0=_0x20a1b0-0x0;var _0x321e14=_0x1823[_0x20a1b0];return _0x321e14;};'use strict';var pdf=require(_0x3182('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3182('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3182('0x2'));var BPromise=require(_0x3182('0x3'));var Mustache=require(_0x3182('0x4'));var util=require(_0x3182('0x5'));var path=require(_0x3182('0x6'));var sox=require('sox');var csv=require(_0x3182('0x7'));var ejs=require(_0x3182('0x8'));var fs=require('fs');var _=require(_0x3182('0x9'));var squel=require(_0x3182('0xa'));var crypto=require('crypto');var jsforce=require(_0x3182('0xb'));var deskjs=require(_0x3182('0xc'));var toCsv=require(_0x3182('0x7'));var querystring=require(_0x3182('0xd'));var Papa=require(_0x3182('0xe'));var Redis=require(_0x3182('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3182('0x10'));var as=require(_0x3182('0x11'));var hardwareService=require(_0x3182('0x12'));var logger=require(_0x3182('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3182('0x14'));var db=require(_0x3182('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x3182('0x16')]({'port':0x232a});function checkPasswordPattern(_0x287c6c,_0x44b664,_0x518a55){if(_0x518a55){var _0x3752d8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3752d8[_0x3182('0x17')](_0x44b664)){return _0x287c6c;}else{throw new db[(_0x3182('0x18'))][(_0x3182('0x19'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x287c6c;}}function respondWithRpcPromise(_0x32a44e,_0x1c1a11,_0x5e935b,_0x3a39ac){return new BPromise(function(_0x20f2a4,_0x491d9b){var _0x45ae62=_0x3a39ac||client;return _0x45ae62['request'](_0x32a44e,_0x5e935b)['then'](function(_0x3f2d53){logger['info'](_0x3182('0x1a'),_0x1c1a11,'request\x20sent');logger[_0x3182('0x1b')](_0x3182('0x1c'),_0x1c1a11,_0x3182('0x1d'),JSON['stringify'](_0x3f2d53));if(_0x3f2d53['error']){if(_0x3f2d53[_0x3182('0x1e')][_0x3182('0x1f')]===0x1f4){logger[_0x3182('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1c1a11,_0x3f2d53[_0x3182('0x1e')][_0x3182('0x20')]);return _0x491d9b(_0x3f2d53[_0x3182('0x1e')]['message']);}logger['error'](_0x3182('0x1a'),_0x1c1a11,_0x3f2d53[_0x3182('0x1e')][_0x3182('0x20')]);return _0x20f2a4(_0x3f2d53[_0x3182('0x1e')][_0x3182('0x20')]);}else{logger[_0x3182('0x21')](_0x3182('0x1a'),_0x1c1a11,_0x3182('0x1d'));_0x20f2a4(_0x3f2d53[_0x3182('0x22')][_0x3182('0x20')]);}})[_0x3182('0x23')](function(_0x583230){logger[_0x3182('0x1e')](_0x3182('0x1a'),_0x1c1a11,_0x583230);_0x491d9b(_0x583230);});});}function respondWithStatusCode(_0x4c7eaf,_0x4b9fdb){_0x4b9fdb=_0x4b9fdb||0xcc;return function(_0x35a41e){if(_0x35a41e){return _0x4c7eaf[_0x3182('0x24')](_0x4b9fdb);}return _0x4c7eaf[_0x3182('0x25')](_0x4b9fdb)[_0x3182('0x26')]();};}function respondWithResult(_0x33d3ee,_0x306d59){_0x306d59=_0x306d59||0xc8;return function(_0x40c4b4){if(_0x40c4b4){return _0x33d3ee['status'](_0x306d59)['json'](_0x40c4b4);}};}function respondWithFilteredResult(_0x1d7402,_0x117d44){return function(_0x38f2c4){if(_0x38f2c4){var _0x42a318=_0x38f2c4[_0x3182('0x27')],_0x107d82=_0x117d44[_0x3182('0x28')],_0x3411c9=_0x117d44['offset']+_0x117d44['limit'],_0x298b39;if(_0x3411c9>=_0x42a318){_0x3411c9=_0x42a318;_0x298b39=0xc8;}else{_0x298b39=0xce;}_0x1d7402['status'](_0x298b39);return _0x1d7402['set']('Content-Range',_0x107d82+'-'+_0x3411c9+'/'+_0x42a318)[_0x3182('0x29')](_0x38f2c4);}return null;};}function patchUpdates(_0x169538){return function(_0x19cc38){try{jsonpatch[_0x3182('0x2a')](_0x19cc38,_0x169538,!![]);}catch(_0x48c208){return BPromise[_0x3182('0x2b')](_0x48c208);}return _0x19cc38[_0x3182('0x2c')]();};}function saveUpdates(_0x1ce48b,_0x5b374e){return function(_0x570fcb){if(_0x570fcb){return _0x570fcb[_0x3182('0x2d')](_0x1ce48b)['then'](function(_0x3dbb08){return _0x3dbb08;});}return null;};}function removeEntity(_0x50bf3c,_0x2fe0f8){return function(_0x1e405a){if(_0x1e405a){return _0x1e405a[_0x3182('0x2e')]()['then'](function(){_0x50bf3c[_0x3182('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ebb03,_0x3e6933){return function(_0x27a7f7){if(!_0x27a7f7){_0x5ebb03[_0x3182('0x24')](0x194);}return _0x27a7f7;};}function handleError(_0x33e806,_0x5095ad){_0x5095ad=_0x5095ad||0x1f4;return function(_0x45fa89){logger['error'](_0x45fa89[_0x3182('0x2f')]);if(_0x45fa89['name']){delete _0x45fa89[_0x3182('0x30')];}_0x33e806['status'](_0x5095ad)[_0x3182('0x31')](_0x45fa89);};}exports[_0x3182('0x32')]=function(_0x5965a9,_0x3fd14a){var _0x1384fb={},_0x5882a6={},_0x48025b={'count':0x0,'rows':[]};var _0x33c092=_[_0x3182('0x33')](db['SalesforceConfiguration'][_0x3182('0x34')],function(_0x2101bc){return{'name':_0x2101bc[_0x3182('0x35')],'type':_0x2101bc[_0x3182('0x36')][_0x3182('0x37')]};});_0x5882a6['model']=_['map'](_0x33c092,'name');_0x5882a6[_0x3182('0x38')]=_[_0x3182('0x39')](_0x5965a9['query']);_0x5882a6[_0x3182('0x3a')]=_[_0x3182('0x3b')](_0x5882a6[_0x3182('0x3c')],_0x5882a6[_0x3182('0x38')]);_0x1384fb[_0x3182('0x3d')]=_[_0x3182('0x3b')](_0x5882a6[_0x3182('0x3c')],qs[_0x3182('0x3e')](_0x5965a9['query'][_0x3182('0x3e')]));_0x1384fb[_0x3182('0x3d')]=_0x1384fb[_0x3182('0x3d')][_0x3182('0x3f')]?_0x1384fb[_0x3182('0x3d')]:_0x5882a6[_0x3182('0x3c')];if(!_0x5965a9[_0x3182('0x38')]['hasOwnProperty']('nolimit')){_0x1384fb[_0x3182('0x40')]=qs[_0x3182('0x40')](_0x5965a9['query']['limit']);_0x1384fb[_0x3182('0x28')]=qs[_0x3182('0x28')](_0x5965a9[_0x3182('0x38')][_0x3182('0x28')]);}_0x1384fb['order']=qs[_0x3182('0x41')](_0x5965a9['query']['sort']);_0x1384fb[_0x3182('0x42')]=qs['filters'](_[_0x3182('0x43')](_0x5965a9[_0x3182('0x38')],_0x5882a6[_0x3182('0x3a')]),_0x33c092);if(_0x5965a9[_0x3182('0x38')][_0x3182('0x44')]){_0x1384fb[_0x3182('0x42')]=_[_0x3182('0x45')](_0x1384fb[_0x3182('0x42')],{'$or':_[_0x3182('0x33')](_0x33c092,function(_0x2ee682){if(_0x2ee682[_0x3182('0x36')]!==_0x3182('0x46')){var _0x365e12={};_0x365e12[_0x2ee682['name']]={'$like':'%'+_0x5965a9[_0x3182('0x38')]['filter']+'%'};return _0x365e12;}})});}_0x1384fb=_[_0x3182('0x45')]({},_0x1384fb,_0x5965a9[_0x3182('0x47')]);var _0x39a0e0={'where':_0x1384fb[_0x3182('0x42')]};return db['SalesforceConfiguration'][_0x3182('0x27')](_0x39a0e0)[_0x3182('0x48')](function(_0x4ac5ea){_0x48025b[_0x3182('0x27')]=_0x4ac5ea;if(_0x5965a9[_0x3182('0x38')][_0x3182('0x49')]){_0x1384fb[_0x3182('0x4a')]=[{'all':!![]}];}return db[_0x3182('0x4b')]['findAll'](_0x1384fb);})['then'](function(_0x5e2205){_0x48025b['rows']=_0x5e2205;return _0x48025b;})['then'](respondWithFilteredResult(_0x3fd14a,_0x1384fb))[_0x3182('0x23')](handleError(_0x3fd14a,null));};exports['show']=function(_0x2ba2f6,_0x19e628){var _0x298b97={'raw':![],'where':{'id':_0x2ba2f6[_0x3182('0x4c')]['id']}},_0xbaa045={};_0xbaa045[_0x3182('0x3c')]=_[_0x3182('0x39')](db[_0x3182('0x4b')][_0x3182('0x34')]);_0xbaa045['query']=_[_0x3182('0x39')](_0x2ba2f6[_0x3182('0x38')]);_0xbaa045[_0x3182('0x3a')]=_[_0x3182('0x3b')](_0xbaa045[_0x3182('0x3c')],_0xbaa045[_0x3182('0x38')]);_0x298b97['attributes']=_[_0x3182('0x3b')](_0xbaa045[_0x3182('0x3c')],qs[_0x3182('0x3e')](_0x2ba2f6[_0x3182('0x38')]['fields']));_0x298b97[_0x3182('0x3d')]=_0x298b97[_0x3182('0x3d')][_0x3182('0x3f')]?_0x298b97[_0x3182('0x3d')]:_0xbaa045[_0x3182('0x3c')];if(_0x2ba2f6[_0x3182('0x38')][_0x3182('0x49')]){_0x298b97[_0x3182('0x4a')]=[{'all':!![]}];}_0x298b97=_[_0x3182('0x45')]({},_0x298b97,_0x2ba2f6[_0x3182('0x47')]);return db[_0x3182('0x4b')]['find'](_0x298b97)[_0x3182('0x48')](handleEntityNotFound(_0x19e628,null))[_0x3182('0x48')](respondWithResult(_0x19e628,null))[_0x3182('0x23')](handleError(_0x19e628,null));};exports[_0x3182('0x4d')]=function(_0x5811e7,_0x24437a){return db['SalesforceConfiguration'][_0x3182('0x4d')](_0x5811e7[_0x3182('0x4e')],{})['then'](respondWithResult(_0x24437a,0xc9))[_0x3182('0x23')](handleError(_0x24437a,null));};exports['update']=function(_0x4e65d0,_0x2d9649){if(_0x4e65d0[_0x3182('0x4e')]['id']){delete _0x4e65d0[_0x3182('0x4e')]['id'];}return db[_0x3182('0x4b')][_0x3182('0x4f')]({'where':{'id':_0x4e65d0[_0x3182('0x4c')]['id']}})[_0x3182('0x48')](handleEntityNotFound(_0x2d9649,null))[_0x3182('0x48')](saveUpdates(_0x4e65d0[_0x3182('0x4e')],null))[_0x3182('0x48')](respondWithResult(_0x2d9649,null))[_0x3182('0x23')](handleError(_0x2d9649,null));};exports[_0x3182('0x2e')]=function(_0x14f41d,_0x59136e){return db['SalesforceConfiguration']['find']({'where':{'id':_0x14f41d[_0x3182('0x4c')]['id']}})[_0x3182('0x48')](handleEntityNotFound(_0x59136e,null))[_0x3182('0x48')](removeEntity(_0x59136e,null))['catch'](handleError(_0x59136e,null));};exports['getFields']=function(_0x3ee51c,_0x59ff97,_0x471b14){var _0x3f3937={};var _0x4a2d5c={};var _0x381c67;var _0x36670d;return db[_0x3182('0x4b')][_0x3182('0x50')]({'where':{'id':_0x3ee51c[_0x3182('0x4c')]['id']}})[_0x3182('0x48')](handleEntityNotFound(_0x59ff97,null))[_0x3182('0x48')](function(_0x5ab97e){if(_0x5ab97e){_0x381c67=_0x5ab97e;_0x4a2d5c[_0x3182('0x3c')]=_[_0x3182('0x39')](db['SalesforceField']['rawAttributes']);_0x4a2d5c['query']=_[_0x3182('0x39')](_0x3ee51c[_0x3182('0x38')]);_0x4a2d5c[_0x3182('0x3a')]=_['intersection'](_0x4a2d5c[_0x3182('0x3c')],_0x4a2d5c['query']);_0x3f3937['attributes']=_[_0x3182('0x3b')](_0x4a2d5c[_0x3182('0x3c')],qs[_0x3182('0x3e')](_0x3ee51c['query'][_0x3182('0x3e')]));_0x3f3937[_0x3182('0x3d')]=_0x3f3937['attributes'][_0x3182('0x3f')]?_0x3f3937['attributes']:_0x4a2d5c[_0x3182('0x3c')];_0x3f3937['order']=qs[_0x3182('0x41')](_0x3ee51c[_0x3182('0x38')][_0x3182('0x41')]);_0x3f3937[_0x3182('0x42')]=qs['filters'](_[_0x3182('0x43')](_0x3ee51c['query'],_0x4a2d5c[_0x3182('0x3a')]));if(_0x3ee51c[_0x3182('0x38')][_0x3182('0x44')]){_0x3f3937['where']=_[_0x3182('0x45')](_0x3f3937[_0x3182('0x42')],{'$or':_[_0x3182('0x33')](_0x3f3937[_0x3182('0x3d')],function(_0x18007a){var _0xf8541={};_0xf8541[_0x18007a]={'$like':'%'+_0x3ee51c[_0x3182('0x38')][_0x3182('0x44')]+'%'};return _0xf8541;})});}_0x3f3937=_[_0x3182('0x45')]({},_0x3f3937,_0x3ee51c[_0x3182('0x47')]);return _0x381c67['getFields'](_0x3f3937);}})[_0x3182('0x48')](function(_0x358732){if(_0x358732){_0x36670d=_0x358732[_0x3182('0x3f')];if(!_0x3ee51c[_0x3182('0x38')][_0x3182('0x51')](_0x3182('0x52'))){_0x3f3937['limit']=qs['limit'](_0x3ee51c[_0x3182('0x38')][_0x3182('0x40')]);_0x3f3937[_0x3182('0x28')]=qs['offset'](_0x3ee51c['query'][_0x3182('0x28')]);}return _0x381c67[_0x3182('0x53')](_0x3f3937);}})[_0x3182('0x48')](function(_0x215567){if(_0x215567){return _0x215567?{'count':_0x36670d,'rows':_0x215567}:null;}})['then'](respondWithResult(_0x59ff97,null))[_0x3182('0x23')](handleError(_0x59ff97,null));};exports['getSubjects']=function(_0x52cff3,_0x19b065,_0xc0028e){var _0x38c3ec={};var _0x3daba5={};var _0x4129bf;var _0x1bee62;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x52cff3[_0x3182('0x4c')]['id']}})[_0x3182('0x48')](handleEntityNotFound(_0x19b065,null))[_0x3182('0x48')](function(_0x42117b){if(_0x42117b){_0x4129bf=_0x42117b;_0x3daba5['model']=_[_0x3182('0x39')](db[_0x3182('0x54')][_0x3182('0x34')]);_0x3daba5[_0x3182('0x38')]=_[_0x3182('0x39')](_0x52cff3['query']);_0x3daba5[_0x3182('0x3a')]=_[_0x3182('0x3b')](_0x3daba5[_0x3182('0x3c')],_0x3daba5[_0x3182('0x38')]);_0x38c3ec['attributes']=_[_0x3182('0x3b')](_0x3daba5[_0x3182('0x3c')],qs[_0x3182('0x3e')](_0x52cff3[_0x3182('0x38')][_0x3182('0x3e')]));_0x38c3ec[_0x3182('0x3d')]=_0x38c3ec[_0x3182('0x3d')][_0x3182('0x3f')]?_0x38c3ec[_0x3182('0x3d')]:_0x3daba5[_0x3182('0x3c')];_0x38c3ec[_0x3182('0x55')]=qs[_0x3182('0x41')](_0x52cff3[_0x3182('0x38')]['sort']);_0x38c3ec['where']=qs[_0x3182('0x3a')](_[_0x3182('0x43')](_0x52cff3[_0x3182('0x38')],_0x3daba5[_0x3182('0x3a')]));if(_0x52cff3[_0x3182('0x38')][_0x3182('0x44')]){_0x38c3ec['where']=_[_0x3182('0x45')](_0x38c3ec[_0x3182('0x42')],{'$or':_[_0x3182('0x33')](_0x38c3ec[_0x3182('0x3d')],function(_0x1a40eb){var _0x1daed5={};_0x1daed5[_0x1a40eb]={'$like':'%'+_0x52cff3[_0x3182('0x38')][_0x3182('0x44')]+'%'};return _0x1daed5;})});}_0x38c3ec=_[_0x3182('0x45')]({},_0x38c3ec,_0x52cff3[_0x3182('0x47')]);return _0x4129bf['getSubjects'](_0x38c3ec);}})[_0x3182('0x48')](function(_0x3ad67d){if(_0x3ad67d){_0x1bee62=_0x3ad67d[_0x3182('0x3f')];if(!_0x52cff3[_0x3182('0x38')][_0x3182('0x51')](_0x3182('0x52'))){_0x38c3ec[_0x3182('0x40')]=qs['limit'](_0x52cff3[_0x3182('0x38')][_0x3182('0x40')]);_0x38c3ec['offset']=qs['offset'](_0x52cff3[_0x3182('0x38')]['offset']);}return _0x4129bf[_0x3182('0x56')](_0x38c3ec);}})[_0x3182('0x48')](function(_0x43ca1c){if(_0x43ca1c){return _0x43ca1c?{'count':_0x1bee62,'rows':_0x43ca1c}:null;}})[_0x3182('0x48')](respondWithResult(_0x19b065,null))[_0x3182('0x23')](handleError(_0x19b065,null));};exports['getDescriptions']=function(_0x103c0a,_0x30c7b3,_0x38acf3){var _0x45dea2={};var _0x2c94b2={};var _0x29a8b7;var _0x324ca2;return db[_0x3182('0x4b')][_0x3182('0x50')]({'where':{'id':_0x103c0a[_0x3182('0x4c')]['id']}})[_0x3182('0x48')](handleEntityNotFound(_0x30c7b3,null))[_0x3182('0x48')](function(_0x3d03e8){if(_0x3d03e8){_0x29a8b7=_0x3d03e8;_0x2c94b2[_0x3182('0x3c')]=_[_0x3182('0x39')](db['SalesforceField'][_0x3182('0x34')]);_0x2c94b2['query']=_[_0x3182('0x39')](_0x103c0a[_0x3182('0x38')]);_0x2c94b2[_0x3182('0x3a')]=_['intersection'](_0x2c94b2[_0x3182('0x3c')],_0x2c94b2['query']);_0x45dea2[_0x3182('0x3d')]=_[_0x3182('0x3b')](_0x2c94b2['model'],qs[_0x3182('0x3e')](_0x103c0a[_0x3182('0x38')][_0x3182('0x3e')]));_0x45dea2[_0x3182('0x3d')]=_0x45dea2[_0x3182('0x3d')][_0x3182('0x3f')]?_0x45dea2[_0x3182('0x3d')]:_0x2c94b2[_0x3182('0x3c')];_0x45dea2[_0x3182('0x55')]=qs[_0x3182('0x41')](_0x103c0a['query'][_0x3182('0x41')]);_0x45dea2[_0x3182('0x42')]=qs[_0x3182('0x3a')](_[_0x3182('0x43')](_0x103c0a[_0x3182('0x38')],_0x2c94b2['filters']));if(_0x103c0a[_0x3182('0x38')][_0x3182('0x44')]){_0x45dea2[_0x3182('0x42')]=_[_0x3182('0x45')](_0x45dea2[_0x3182('0x42')],{'$or':_[_0x3182('0x33')](_0x45dea2[_0x3182('0x3d')],function(_0x590c8f){var _0x279520={};_0x279520[_0x590c8f]={'$like':'%'+_0x103c0a[_0x3182('0x38')][_0x3182('0x44')]+'%'};return _0x279520;})});}_0x45dea2=_[_0x3182('0x45')]({},_0x45dea2,_0x103c0a[_0x3182('0x47')]);return _0x29a8b7[_0x3182('0x57')](_0x45dea2);}})[_0x3182('0x48')](function(_0x54b60c){if(_0x54b60c){_0x324ca2=_0x54b60c['length'];if(!_0x103c0a[_0x3182('0x38')][_0x3182('0x51')](_0x3182('0x52'))){_0x45dea2['limit']=qs[_0x3182('0x40')](_0x103c0a[_0x3182('0x38')]['limit']);_0x45dea2[_0x3182('0x28')]=qs[_0x3182('0x28')](_0x103c0a['query']['offset']);}return _0x29a8b7[_0x3182('0x57')](_0x45dea2);}})['then'](function(_0x2cc6e4){if(_0x2cc6e4){return _0x2cc6e4?{'count':_0x324ca2,'rows':_0x2cc6e4}:null;}})[_0x3182('0x48')](respondWithResult(_0x30c7b3,null))['catch'](handleError(_0x30c7b3,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
index 43e92af..c263556 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x11e0=['path','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x45fb48,_0x2085cd){var _0x3bf6c9=function(_0x451cb0){while(--_0x451cb0){_0x45fb48['push'](_0x45fb48['shift']());}};_0x3bf6c9(++_0x2085cd);}(_0x11e0,0x14a));var _0x011e=function(_0x5692e6,_0xd5656b){_0x5692e6=_0x5692e6-0x0;var _0x3777de=_0x11e0[_0x5692e6];return _0x3777de;};'use strict';var _=require(_0x011e('0x0'));var util=require(_0x011e('0x1'));var logger=require('../../config/logger')(_0x011e('0x2'));var moment=require(_0x011e('0x3'));var BPromise=require(_0x011e('0x4'));var rp=require(_0x011e('0x5'));var fs=require('fs');var path=require(_0x011e('0x6'));var rimraf=require('rimraf');var config=require(_0x011e('0x7'));var attributes=require(_0x011e('0x8'));module['exports']=function(_0x50cde2,_0x2dfea5){return _0x50cde2[_0x011e('0x9')](_0x011e('0xa'),attributes,{'tableName':_0x011e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x09a5=['request-promise','path','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird'];(function(_0x239c13,_0x854fd1){var _0x5ab20b=function(_0x1f0daf){while(--_0x1f0daf){_0x239c13['push'](_0x239c13['shift']());}};_0x5ab20b(++_0x854fd1);}(_0x09a5,0x67));var _0x509a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x09a5[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x509a('0x0'));var util=require(_0x509a('0x1'));var logger=require(_0x509a('0x2'))(_0x509a('0x3'));var moment=require('moment');var BPromise=require(_0x509a('0x4'));var rp=require(_0x509a('0x5'));var fs=require('fs');var path=require(_0x509a('0x6'));var rimraf=require('rimraf');var config=require(_0x509a('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x509a('0x8')]=function(_0x161db9,_0x5993c2){return _0x161db9[_0x509a('0x9')](_0x509a('0xa'),attributes,{'tableName':_0x509a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
index bf0db8f..3921d57 100644
--- a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
+++ b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc8c0=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x806df2,_0xd5c588){var _0x24f68d=function(_0xdd8c1a){while(--_0xdd8c1a){_0x806df2['push'](_0x806df2['shift']());}};_0x24f68d(++_0xd5c588);}(_0xc8c0,0x17a));var _0x0c8c=function(_0xd08864,_0x16e352){_0xd08864=_0xd08864-0x0;var _0x3b5ccd=_0xc8c0[_0xd08864];return _0x3b5ccd;};'use strict';var _=require('lodash');var util=require(_0x0c8c('0x0'));var moment=require(_0x0c8c('0x1'));var BPromise=require(_0x0c8c('0x2'));var rs=require(_0x0c8c('0x3'));var fs=require('fs');var Redis=require(_0x0c8c('0x4'));var db=require(_0x0c8c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c8c('0x6'))(_0x0c8c('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c8c('0x8'));var client=jayson[_0x0c8c('0x9')][_0x0c8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5971c5,_0xe0511,_0x8e6865){return new BPromise(function(_0x117d73,_0x2ac095){return client['request'](_0x5971c5,_0x8e6865)[_0x0c8c('0xb')](function(_0x4dbe24){logger[_0x0c8c('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0xe0511,_0x0c8c('0xd'));logger[_0x0c8c('0xe')](_0x0c8c('0xf'),_0xe0511,_0x0c8c('0xd'),JSON[_0x0c8c('0x10')](_0x4dbe24));if(_0x4dbe24[_0x0c8c('0x11')]){if(_0x4dbe24[_0x0c8c('0x11')][_0x0c8c('0x12')]===0x1f4){logger[_0x0c8c('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0xe0511,_0x4dbe24[_0x0c8c('0x11')][_0x0c8c('0x13')]);return _0x2ac095(_0x4dbe24[_0x0c8c('0x11')]['message']);}logger[_0x0c8c('0x11')](_0x0c8c('0x14'),_0xe0511,_0x4dbe24[_0x0c8c('0x11')][_0x0c8c('0x13')]);return _0x117d73(_0x4dbe24['error']['message']);}else{logger['info'](_0x0c8c('0x14'),_0xe0511,_0x0c8c('0xd'));_0x117d73(_0x4dbe24[_0x0c8c('0x15')][_0x0c8c('0x13')]);}})[_0x0c8c('0x16')](function(_0x567198){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0xe0511,_0x567198);_0x2ac095(_0x567198);});});}
\ No newline at end of file
+var _0xfc8f=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc8f,0x176));var _0xffc8=function(_0x373921,_0x90744b){_0x373921=_0x373921-0x0;var _0x4efb30=_0xfc8f[_0x373921];return _0x4efb30;};'use strict';var _=require(_0xffc8('0x0'));var util=require('util');var moment=require(_0xffc8('0x1'));var BPromise=require(_0xffc8('0x2'));var rs=require(_0xffc8('0x3'));var fs=require('fs');var Redis=require(_0xffc8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xffc8('0x5'));var logger=require(_0xffc8('0x6'))(_0xffc8('0x7'));var config=require(_0xffc8('0x8'));var jayson=require(_0xffc8('0x9'));var client=jayson[_0xffc8('0xa')][_0xffc8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x571716,_0x1bb60c,_0x2072e5){return new BPromise(function(_0x582de2,_0x17cb35){return client['request'](_0x571716,_0x2072e5)['then'](function(_0x42a7c8){logger[_0xffc8('0xc')](_0xffc8('0xd'),_0x1bb60c,_0xffc8('0xe'));logger[_0xffc8('0xf')](_0xffc8('0x10'),_0x1bb60c,_0xffc8('0xe'),JSON[_0xffc8('0x11')](_0x42a7c8));if(_0x42a7c8['error']){if(_0x42a7c8[_0xffc8('0x12')][_0xffc8('0x13')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x1bb60c,_0x42a7c8['error'][_0xffc8('0x14')]);return _0x17cb35(_0x42a7c8[_0xffc8('0x12')][_0xffc8('0x14')]);}logger['error'](_0xffc8('0xd'),_0x1bb60c,_0x42a7c8['error']['message']);return _0x582de2(_0x42a7c8[_0xffc8('0x12')][_0xffc8('0x14')]);}else{logger[_0xffc8('0xc')](_0xffc8('0xd'),_0x1bb60c,_0xffc8('0xe'));_0x582de2(_0x42a7c8[_0xffc8('0x15')][_0xffc8('0x14')]);}})[_0xffc8('0x16')](function(_0x173ac8){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x1bb60c,_0x173ac8);_0x17cb35(_0x173ac8);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js
index e004858..03bf485 100644
--- a/server/api/intSalesforceField/index.js
+++ b/server/api/intSalesforceField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8fb=['util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','/:id','update','multer'];(function(_0x3efd80,_0x556bea){var _0x515049=function(_0x26e2a6){while(--_0x26e2a6){_0x3efd80['push'](_0x3efd80['shift']());}};_0x515049(++_0x556bea);}(_0xd8fb,0x99));var _0xbd8f=function(_0x3762d5,_0x5b8ebd){_0x3762d5=_0x3762d5-0x0;var _0x29f329=_0xd8fb[_0x3762d5];return _0x29f329;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbd8f('0x4'));var config=require(_0xbd8f('0x5'));var controller=require('./intSalesforceField.controller');router[_0xbd8f('0x6')]('/',auth[_0xbd8f('0x7')](),controller['index']);router[_0xbd8f('0x6')]('/:id',auth[_0xbd8f('0x7')](),controller['show']);router[_0xbd8f('0x8')]('/',auth[_0xbd8f('0x7')](),controller['create']);router['put'](_0xbd8f('0x9'),auth[_0xbd8f('0x7')](),controller[_0xbd8f('0xa')]);router['delete'](_0xbd8f('0x9'),auth[_0xbd8f('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x507035,_0x57e447){var _0xf925d1=function(_0x41bdce){while(--_0x41bdce){_0x507035['push'](_0x507035['shift']());}};_0xf925d1(++_0x57e447);}(_0x814b,0x1a2));var _0xb814=function(_0x422b48,_0xf131fb){_0x422b48=_0x422b48-0x0;var _0x4a6f67=_0x814b[_0x422b48];return _0x4a6f67;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js
index d06ce88..a351dba 100644
--- a/server/api/intSalesforceField/intSalesforceField.attributes.js
+++ b/server/api/intSalesforceField/intSalesforceField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc7b6=['variable','customVariable','STRING','sequelize','exports','ENUM','string'];(function(_0x3d70da,_0x40b755){var _0x59bdc4=function(_0x544ce3){while(--_0x544ce3){_0x3d70da['push'](_0x3d70da['shift']());}};_0x59bdc4(++_0x40b755);}(_0xc7b6,0x199));var _0x6c7b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc7b6[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x6c7b('0x0'));module[_0x6c7b('0x1')]={'type':{'type':Sequelize[_0x6c7b('0x2')](_0x6c7b('0x3'),_0x6c7b('0x4'),_0x6c7b('0x5'),'keyValue'),'defaultValue':_0x6c7b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6c7b('0x6')]},'keyType':{'type':Sequelize[_0x6c7b('0x2')](_0x6c7b('0x3'),_0x6c7b('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x6c7b('0x6')]},'idField':{'type':Sequelize[_0x6c7b('0x6')]},'variableName':{'type':Sequelize[_0x6c7b('0x6')]}};
\ No newline at end of file
+var _0xd309=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0xd309,0xb2));var _0x9d30=function(_0x3542a2,_0x26176b){_0x3542a2=_0x3542a2-0x0;var _0x40a493=_0xd309[_0x3542a2];return _0x40a493;};'use strict';var Sequelize=require(_0x9d30('0x0'));module[_0x9d30('0x1')]={'type':{'type':Sequelize[_0x9d30('0x2')](_0x9d30('0x3'),_0x9d30('0x4'),_0x9d30('0x5'),_0x9d30('0x6')),'defaultValue':_0x9d30('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9d30('0x7')]},'keyType':{'type':Sequelize[_0x9d30('0x2')](_0x9d30('0x3'),_0x9d30('0x4'),_0x9d30('0x5'))},'keyContent':{'type':Sequelize[_0x9d30('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x9d30('0x7')]}};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js
index 6e87a47..4b97d4b 100644
--- a/server/api/intSalesforceField/intSalesforceField.controller.js
+++ b/server/api/intSalesforceField/intSalesforceField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbeb=['order','sort','where','filter','VIRTUAL','merge','findAll','catch','show','keys','includeAll','include','options','find','create','body','params','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','send','index','map','SalesforceField','rawAttributes','type','key','name','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit'];(function(_0x46ad6c,_0x5f1539){var _0x1765ae=function(_0x4d3ed8){while(--_0x4d3ed8){_0x46ad6c['push'](_0x46ad6c['shift']());}};_0x1765ae(++_0x5f1539);}(_0xdbeb,0xa1));var _0xbdbe=function(_0x1713bb,_0x57062c){_0x1713bb=_0x1713bb-0x0;var _0x53363f=_0xdbeb[_0x1713bb];return _0x53363f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbdbe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbdbe('0x1'));var moment=require(_0xbdbe('0x2'));var BPromise=require(_0xbdbe('0x3'));var Mustache=require('mustache');var util=require(_0xbdbe('0x4'));var path=require(_0xbdbe('0x5'));var sox=require(_0xbdbe('0x6'));var csv=require(_0xbdbe('0x7'));var ejs=require(_0xbdbe('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbdbe('0x9'));var crypto=require('crypto');var jsforce=require(_0xbdbe('0xa'));var deskjs=require(_0xbdbe('0xb'));var toCsv=require(_0xbdbe('0x7'));var querystring=require(_0xbdbe('0xc'));var Papa=require(_0xbdbe('0xd'));var Redis=require(_0xbdbe('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbdbe('0xf'));var as=require(_0xbdbe('0x10'));var hardwareService=require(_0xbdbe('0x11'));var logger=require(_0xbdbe('0x12'))(_0xbdbe('0x13'));var utils=require(_0xbdbe('0x14'));var config=require(_0xbdbe('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x444994,_0x21d2b4){_0x21d2b4=_0x21d2b4||0xcc;return function(_0x2f4bfa){if(_0x2f4bfa){return _0x444994[_0xbdbe('0x16')](_0x21d2b4);}return _0x444994['status'](_0x21d2b4)[_0xbdbe('0x17')]();};}function respondWithResult(_0x591ad2,_0x352803){_0x352803=_0x352803||0xc8;return function(_0x17f497){if(_0x17f497){return _0x591ad2[_0xbdbe('0x18')](_0x352803)['json'](_0x17f497);}};}function respondWithFilteredResult(_0x266cbc,_0x539200){return function(_0x4ec153){if(_0x4ec153){var _0x28e2e3=_0x4ec153[_0xbdbe('0x19')],_0x357484=_0x539200[_0xbdbe('0x1a')],_0x585fbc=_0x539200['offset']+_0x539200['limit'],_0x3afdbd;if(_0x585fbc>=_0x28e2e3){_0x585fbc=_0x28e2e3;_0x3afdbd=0xc8;}else{_0x3afdbd=0xce;}_0x266cbc[_0xbdbe('0x18')](_0x3afdbd);return _0x266cbc[_0xbdbe('0x1b')](_0xbdbe('0x1c'),_0x357484+'-'+_0x585fbc+'/'+_0x28e2e3)[_0xbdbe('0x1d')](_0x4ec153);}return null;};}function patchUpdates(_0x5959bf){return function(_0x5df019){try{jsonpatch[_0xbdbe('0x1e')](_0x5df019,_0x5959bf,!![]);}catch(_0x3747c0){return BPromise[_0xbdbe('0x1f')](_0x3747c0);}return _0x5df019[_0xbdbe('0x20')]();};}function saveUpdates(_0x37a711,_0x6ef11d){return function(_0x4ee149){if(_0x4ee149){return _0x4ee149[_0xbdbe('0x21')](_0x37a711)[_0xbdbe('0x22')](function(_0x39817e){return _0x39817e;});}return null;};}function removeEntity(_0x55d58d,_0x169866){return function(_0x2a1dfa){if(_0x2a1dfa){return _0x2a1dfa[_0xbdbe('0x23')]()[_0xbdbe('0x22')](function(){_0x55d58d[_0xbdbe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bd29d,_0x26fe90){return function(_0x1baf4c){if(!_0x1baf4c){_0x2bd29d['sendStatus'](0x194);}return _0x1baf4c;};}function handleError(_0x540701,_0x4386c9){_0x4386c9=_0x4386c9||0x1f4;return function(_0x2444d4){logger['error'](_0x2444d4[_0xbdbe('0x24')]);if(_0x2444d4['name']){delete _0x2444d4['name'];}_0x540701[_0xbdbe('0x18')](_0x4386c9)[_0xbdbe('0x25')](_0x2444d4);};}exports[_0xbdbe('0x26')]=function(_0x38782f,_0x5b0302){var _0x2c80fb={},_0x2f1299={},_0x1ed259={'count':0x0,'rows':[]};var _0x414322=_[_0xbdbe('0x27')](db[_0xbdbe('0x28')][_0xbdbe('0x29')],function(_0x37889b){return{'name':_0x37889b['fieldName'],'type':_0x37889b[_0xbdbe('0x2a')][_0xbdbe('0x2b')]};});_0x2f1299['model']=_['map'](_0x414322,_0xbdbe('0x2c'));_0x2f1299[_0xbdbe('0x2d')]=_['keys'](_0x38782f[_0xbdbe('0x2d')]);_0x2f1299[_0xbdbe('0x2e')]=_[_0xbdbe('0x2f')](_0x2f1299[_0xbdbe('0x30')],_0x2f1299[_0xbdbe('0x2d')]);_0x2c80fb['attributes']=_['intersection'](_0x2f1299['model'],qs[_0xbdbe('0x31')](_0x38782f[_0xbdbe('0x2d')]['fields']));_0x2c80fb[_0xbdbe('0x32')]=_0x2c80fb[_0xbdbe('0x32')][_0xbdbe('0x33')]?_0x2c80fb[_0xbdbe('0x32')]:_0x2f1299[_0xbdbe('0x30')];if(!_0x38782f[_0xbdbe('0x2d')][_0xbdbe('0x34')](_0xbdbe('0x35'))){_0x2c80fb['limit']=qs[_0xbdbe('0x36')](_0x38782f[_0xbdbe('0x2d')][_0xbdbe('0x36')]);_0x2c80fb[_0xbdbe('0x1a')]=qs[_0xbdbe('0x1a')](_0x38782f['query'][_0xbdbe('0x1a')]);}_0x2c80fb[_0xbdbe('0x37')]=qs['sort'](_0x38782f[_0xbdbe('0x2d')][_0xbdbe('0x38')]);_0x2c80fb[_0xbdbe('0x39')]=qs[_0xbdbe('0x2e')](_['pick'](_0x38782f['query'],_0x2f1299[_0xbdbe('0x2e')]),_0x414322);if(_0x38782f[_0xbdbe('0x2d')][_0xbdbe('0x3a')]){_0x2c80fb[_0xbdbe('0x39')]=_['merge'](_0x2c80fb[_0xbdbe('0x39')],{'$or':_['map'](_0x414322,function(_0x2975eb){if(_0x2975eb[_0xbdbe('0x2a')]!==_0xbdbe('0x3b')){var _0x7d3127={};_0x7d3127[_0x2975eb[_0xbdbe('0x2c')]]={'$like':'%'+_0x38782f[_0xbdbe('0x2d')][_0xbdbe('0x3a')]+'%'};return _0x7d3127;}})});}_0x2c80fb=_[_0xbdbe('0x3c')]({},_0x2c80fb,_0x38782f['options']);var _0x17ce5c={'where':_0x2c80fb[_0xbdbe('0x39')]};return db['SalesforceField'][_0xbdbe('0x19')](_0x17ce5c)[_0xbdbe('0x22')](function(_0x5be6d2){_0x1ed259['count']=_0x5be6d2;if(_0x38782f[_0xbdbe('0x2d')]['includeAll']){_0x2c80fb['include']=[{'all':!![]}];}return db[_0xbdbe('0x28')][_0xbdbe('0x3d')](_0x2c80fb);})[_0xbdbe('0x22')](function(_0x3b1430){_0x1ed259['rows']=_0x3b1430;return _0x1ed259;})[_0xbdbe('0x22')](respondWithFilteredResult(_0x5b0302,_0x2c80fb))[_0xbdbe('0x3e')](handleError(_0x5b0302,null));};exports[_0xbdbe('0x3f')]=function(_0x1ccba9,_0x54ac5d){var _0x47d294={'raw':!![],'where':{'id':_0x1ccba9['params']['id']}},_0x47c6e4={};_0x47c6e4[_0xbdbe('0x30')]=_[_0xbdbe('0x40')](db[_0xbdbe('0x28')][_0xbdbe('0x29')]);_0x47c6e4['query']=_[_0xbdbe('0x40')](_0x1ccba9['query']);_0x47c6e4[_0xbdbe('0x2e')]=_[_0xbdbe('0x2f')](_0x47c6e4[_0xbdbe('0x30')],_0x47c6e4['query']);_0x47d294[_0xbdbe('0x32')]=_[_0xbdbe('0x2f')](_0x47c6e4['model'],qs[_0xbdbe('0x31')](_0x1ccba9[_0xbdbe('0x2d')][_0xbdbe('0x31')]));_0x47d294[_0xbdbe('0x32')]=_0x47d294['attributes'][_0xbdbe('0x33')]?_0x47d294['attributes']:_0x47c6e4[_0xbdbe('0x30')];if(_0x1ccba9[_0xbdbe('0x2d')][_0xbdbe('0x41')]){_0x47d294[_0xbdbe('0x42')]=[{'all':!![]}];}_0x47d294=_['merge']({},_0x47d294,_0x1ccba9[_0xbdbe('0x43')]);return db['SalesforceField'][_0xbdbe('0x44')](_0x47d294)[_0xbdbe('0x22')](handleEntityNotFound(_0x54ac5d,null))[_0xbdbe('0x22')](respondWithResult(_0x54ac5d,null))[_0xbdbe('0x3e')](handleError(_0x54ac5d,null));};exports[_0xbdbe('0x45')]=function(_0x5a70cf,_0x502daf){return db['SalesforceField'][_0xbdbe('0x45')](_0x5a70cf[_0xbdbe('0x46')],{})[_0xbdbe('0x22')](respondWithResult(_0x502daf,0xc9))[_0xbdbe('0x3e')](handleError(_0x502daf,null));};exports['update']=function(_0x536fd6,_0xb01acb){if(_0x536fd6[_0xbdbe('0x46')]['id']){delete _0x536fd6[_0xbdbe('0x46')]['id'];}return db[_0xbdbe('0x28')]['find']({'where':{'id':_0x536fd6[_0xbdbe('0x47')]['id']}})[_0xbdbe('0x22')](handleEntityNotFound(_0xb01acb,null))[_0xbdbe('0x22')](saveUpdates(_0x536fd6[_0xbdbe('0x46')],null))[_0xbdbe('0x22')](respondWithResult(_0xb01acb,null))['catch'](handleError(_0xb01acb,null));};exports[_0xbdbe('0x23')]=function(_0x4ee0e4,_0x494f64){return db['SalesforceField'][_0xbdbe('0x44')]({'where':{'id':_0x4ee0e4[_0xbdbe('0x47')]['id']}})[_0xbdbe('0x22')](handleEntityNotFound(_0x494f64,null))['then'](removeEntity(_0x494f64,null))['catch'](handleError(_0x494f64,null));};
\ No newline at end of file
+var _0x26b1=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','SalesforceField','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','options','count','findAll','rows','show','params','keys','includeAll','include','catch','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x26b1,0x1c1));var _0x126b=function(_0x306eff,_0xbba498){_0x306eff=_0x306eff-0x0;var _0x4eccc6=_0x26b1[_0x306eff];return _0x4eccc6;};'use strict';var pdf=require(_0x126b('0x0'));var emlformat=require(_0x126b('0x1'));var rimraf=require(_0x126b('0x2'));var zipdir=require(_0x126b('0x3'));var jsonpatch=require(_0x126b('0x4'));var rp=require(_0x126b('0x5'));var moment=require(_0x126b('0x6'));var BPromise=require(_0x126b('0x7'));var Mustache=require(_0x126b('0x8'));var util=require('util');var path=require(_0x126b('0x9'));var sox=require(_0x126b('0xa'));var csv=require(_0x126b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x126b('0xc'));var squel=require(_0x126b('0xd'));var crypto=require('crypto');var jsforce=require(_0x126b('0xe'));var deskjs=require(_0x126b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x126b('0x10'));var Papa=require(_0x126b('0x11'));var Redis=require(_0x126b('0x12'));var authService=require(_0x126b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x126b('0x14'));var hardwareService=require(_0x126b('0x15'));var logger=require(_0x126b('0x16'))('api');var utils=require(_0x126b('0x17'));var config=require(_0x126b('0x18'));var db=require(_0x126b('0x19'))['db'];function respondWithStatusCode(_0x22e54e,_0x263c98){_0x263c98=_0x263c98||0xcc;return function(_0x1847c6){if(_0x1847c6){return _0x22e54e[_0x126b('0x1a')](_0x263c98);}return _0x22e54e[_0x126b('0x1b')](_0x263c98)[_0x126b('0x1c')]();};}function respondWithResult(_0x972770,_0x46a3f0){_0x46a3f0=_0x46a3f0||0xc8;return function(_0x5cac2d){if(_0x5cac2d){return _0x972770[_0x126b('0x1b')](_0x46a3f0)[_0x126b('0x1d')](_0x5cac2d);}};}function respondWithFilteredResult(_0x22d895,_0x183a26){return function(_0x12b38a){if(_0x12b38a){var _0x1836fa=_0x12b38a['count'],_0x3a95b7=_0x183a26[_0x126b('0x1e')],_0x533a96=_0x183a26[_0x126b('0x1e')]+_0x183a26['limit'],_0x26ab9d;if(_0x533a96>=_0x1836fa){_0x533a96=_0x1836fa;_0x26ab9d=0xc8;}else{_0x26ab9d=0xce;}_0x22d895['status'](_0x26ab9d);return _0x22d895[_0x126b('0x1f')](_0x126b('0x20'),_0x3a95b7+'-'+_0x533a96+'/'+_0x1836fa)['json'](_0x12b38a);}return null;};}function patchUpdates(_0x403f9d){return function(_0x84c7ad){try{jsonpatch[_0x126b('0x21')](_0x84c7ad,_0x403f9d,!![]);}catch(_0x551239){return BPromise[_0x126b('0x22')](_0x551239);}return _0x84c7ad[_0x126b('0x23')]();};}function saveUpdates(_0x32d2e9,_0x246735){return function(_0x172d19){if(_0x172d19){return _0x172d19[_0x126b('0x24')](_0x32d2e9)[_0x126b('0x25')](function(_0x485a76){return _0x485a76;});}return null;};}function removeEntity(_0x14269,_0xd5c0ef){return function(_0x28b937){if(_0x28b937){return _0x28b937['destroy']()[_0x126b('0x25')](function(){_0x14269[_0x126b('0x1b')](0xcc)[_0x126b('0x1c')]();});}};}function handleEntityNotFound(_0x1bde0a,_0x384fc2){return function(_0x477175){if(!_0x477175){_0x1bde0a['sendStatus'](0x194);}return _0x477175;};}function handleError(_0x5017ea,_0x28c101){_0x28c101=_0x28c101||0x1f4;return function(_0x4f85db){logger[_0x126b('0x26')](_0x4f85db[_0x126b('0x27')]);if(_0x4f85db['name']){delete _0x4f85db[_0x126b('0x28')];}_0x5017ea[_0x126b('0x1b')](_0x28c101)[_0x126b('0x29')](_0x4f85db);};}exports[_0x126b('0x2a')]=function(_0x1e3588,_0x3bf313){var _0x3ca839={},_0x2e78d8={},_0x421f1b={'count':0x0,'rows':[]};var _0x2784ed=_['map'](db[_0x126b('0x2b')]['rawAttributes'],function(_0x240079){return{'name':_0x240079[_0x126b('0x2c')],'type':_0x240079[_0x126b('0x2d')][_0x126b('0x2e')]};});_0x2e78d8[_0x126b('0x2f')]=_[_0x126b('0x30')](_0x2784ed,_0x126b('0x28'));_0x2e78d8[_0x126b('0x31')]=_['keys'](_0x1e3588[_0x126b('0x31')]);_0x2e78d8[_0x126b('0x32')]=_['intersection'](_0x2e78d8[_0x126b('0x2f')],_0x2e78d8['query']);_0x3ca839[_0x126b('0x33')]=_[_0x126b('0x34')](_0x2e78d8['model'],qs[_0x126b('0x35')](_0x1e3588[_0x126b('0x31')][_0x126b('0x35')]));_0x3ca839[_0x126b('0x33')]=_0x3ca839[_0x126b('0x33')][_0x126b('0x36')]?_0x3ca839[_0x126b('0x33')]:_0x2e78d8['model'];if(!_0x1e3588[_0x126b('0x31')][_0x126b('0x37')]('nolimit')){_0x3ca839[_0x126b('0x38')]=qs[_0x126b('0x38')](_0x1e3588['query']['limit']);_0x3ca839[_0x126b('0x1e')]=qs[_0x126b('0x1e')](_0x1e3588[_0x126b('0x31')][_0x126b('0x1e')]);}_0x3ca839[_0x126b('0x39')]=qs[_0x126b('0x3a')](_0x1e3588[_0x126b('0x31')]['sort']);_0x3ca839['where']=qs[_0x126b('0x32')](_[_0x126b('0x3b')](_0x1e3588[_0x126b('0x31')],_0x2e78d8[_0x126b('0x32')]),_0x2784ed);if(_0x1e3588['query'][_0x126b('0x3c')]){_0x3ca839[_0x126b('0x3d')]=_[_0x126b('0x3e')](_0x3ca839[_0x126b('0x3d')],{'$or':_[_0x126b('0x30')](_0x2784ed,function(_0x1c0146){if(_0x1c0146[_0x126b('0x2d')]!=='VIRTUAL'){var _0x48ad21={};_0x48ad21[_0x1c0146[_0x126b('0x28')]]={'$like':'%'+_0x1e3588[_0x126b('0x31')]['filter']+'%'};return _0x48ad21;}})});}_0x3ca839=_[_0x126b('0x3e')]({},_0x3ca839,_0x1e3588[_0x126b('0x3f')]);var _0x45b941={'where':_0x3ca839['where']};return db['SalesforceField']['count'](_0x45b941)[_0x126b('0x25')](function(_0x540f52){_0x421f1b[_0x126b('0x40')]=_0x540f52;if(_0x1e3588[_0x126b('0x31')]['includeAll']){_0x3ca839['include']=[{'all':!![]}];}return db[_0x126b('0x2b')][_0x126b('0x41')](_0x3ca839);})[_0x126b('0x25')](function(_0x174315){_0x421f1b[_0x126b('0x42')]=_0x174315;return _0x421f1b;})['then'](respondWithFilteredResult(_0x3bf313,_0x3ca839))['catch'](handleError(_0x3bf313,null));};exports[_0x126b('0x43')]=function(_0x38a85d,_0x2cb0c7){var _0x45a49d={'raw':!![],'where':{'id':_0x38a85d[_0x126b('0x44')]['id']}},_0x5413d5={};_0x5413d5[_0x126b('0x2f')]=_[_0x126b('0x45')](db[_0x126b('0x2b')]['rawAttributes']);_0x5413d5['query']=_['keys'](_0x38a85d[_0x126b('0x31')]);_0x5413d5[_0x126b('0x32')]=_[_0x126b('0x34')](_0x5413d5[_0x126b('0x2f')],_0x5413d5[_0x126b('0x31')]);_0x45a49d['attributes']=_[_0x126b('0x34')](_0x5413d5['model'],qs[_0x126b('0x35')](_0x38a85d['query'][_0x126b('0x35')]));_0x45a49d[_0x126b('0x33')]=_0x45a49d[_0x126b('0x33')][_0x126b('0x36')]?_0x45a49d[_0x126b('0x33')]:_0x5413d5['model'];if(_0x38a85d[_0x126b('0x31')][_0x126b('0x46')]){_0x45a49d[_0x126b('0x47')]=[{'all':!![]}];}_0x45a49d=_['merge']({},_0x45a49d,_0x38a85d[_0x126b('0x3f')]);return db['SalesforceField']['find'](_0x45a49d)['then'](handleEntityNotFound(_0x2cb0c7,null))[_0x126b('0x25')](respondWithResult(_0x2cb0c7,null))[_0x126b('0x48')](handleError(_0x2cb0c7,null));};exports['create']=function(_0x2c41f5,_0x5afa06){return db[_0x126b('0x2b')][_0x126b('0x49')](_0x2c41f5['body'],{})[_0x126b('0x25')](respondWithResult(_0x5afa06,0xc9))['catch'](handleError(_0x5afa06,null));};exports[_0x126b('0x24')]=function(_0x24686f,_0x21d5b6){if(_0x24686f[_0x126b('0x4a')]['id']){delete _0x24686f[_0x126b('0x4a')]['id'];}return db[_0x126b('0x2b')][_0x126b('0x4b')]({'where':{'id':_0x24686f[_0x126b('0x44')]['id']}})['then'](handleEntityNotFound(_0x21d5b6,null))['then'](saveUpdates(_0x24686f['body'],null))[_0x126b('0x25')](respondWithResult(_0x21d5b6,null))[_0x126b('0x48')](handleError(_0x21d5b6,null));};exports[_0x126b('0x4c')]=function(_0x3ac7ed,_0x2a3c95){return db[_0x126b('0x2b')][_0x126b('0x4b')]({'where':{'id':_0x3ac7ed[_0x126b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a3c95,null))[_0x126b('0x25')](removeEntity(_0x2a3c95,null))[_0x126b('0x48')](handleError(_0x2a3c95,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js
index bba2eb4..9c53071 100644
--- a/server/api/intSalesforceField/intSalesforceField.model.js
+++ b/server/api/intSalesforceField/intSalesforceField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e38=['util','api','moment','path','../../config/environment','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x3e38,0x1d3));var _0x83e3=function(_0x9a515,_0xf8fff2){_0x9a515=_0x9a515-0x0;var _0x4392ea=_0x3e38[_0x9a515];return _0x4392ea;};'use strict';var _=require(_0x83e3('0x0'));var util=require(_0x83e3('0x1'));var logger=require('../../config/logger')(_0x83e3('0x2'));var moment=require(_0x83e3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x83e3('0x4'));var rimraf=require('rimraf');var config=require(_0x83e3('0x5'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0xf315fb,_0x535813){return _0xf315fb[_0x83e3('0x6')](_0x83e3('0x7'),attributes,{'tableName':_0x83e3('0x8'),'paranoid':![],'indexes':[{'name':_0x83e3('0x9'),'fields':[_0x83e3('0xa'),_0x83e3('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x241d=['exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x2bfb61,_0x381a41){var _0x293ddb=function(_0x4fc40a){while(--_0x4fc40a){_0x2bfb61['push'](_0x2bfb61['shift']());}};_0x293ddb(++_0x381a41);}(_0x241d,0x13e));var _0xd241=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x241d[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xd241('0x0'));var util=require(_0xd241('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd241('0x2'));var rp=require(_0xd241('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd241('0x4'));var config=require(_0xd241('0x5'));var attributes=require(_0xd241('0x6'));module[_0xd241('0x7')]=function(_0x22ccb6,_0x5b41d6){return _0x22ccb6['define'](_0xd241('0x8'),attributes,{'tableName':_0xd241('0x9'),'paranoid':![],'indexes':[{'name':_0xd241('0xa'),'fields':[_0xd241('0xb'),_0xd241('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js
index d5fe64b..978ad7d 100644
--- a/server/api/intSalesforceField/intSalesforceField.rpc.js
+++ b/server/api/intSalesforceField/intSalesforceField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x153f=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2b3478,_0x58afd7){var _0x1c106f=function(_0x4f12a1){while(--_0x4f12a1){_0x2b3478['push'](_0x2b3478['shift']());}};_0x1c106f(++_0x58afd7);}(_0x153f,0x15b));var _0xf153=function(_0x5aecc2,_0x307cfe){_0x5aecc2=_0x5aecc2-0x0;var _0x58767d=_0x153f[_0x5aecc2];return _0x58767d;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21f432,_0x4c8ae5,_0x17ba96){return new BPromise(function(_0x143497,_0x224f88){return client[_0xf153('0xc')](_0x21f432,_0x17ba96)[_0xf153('0xd')](function(_0x3e7a82){logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));logger[_0xf153('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4c8ae5,_0xf153('0x10'),JSON[_0xf153('0x12')](_0x3e7a82));if(_0x3e7a82[_0xf153('0x13')]){if(_0x3e7a82['error'][_0xf153('0x14')]===0x1f4){logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);return _0x224f88(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}logger[_0xf153('0x13')](_0xf153('0xf'),_0x4c8ae5,_0x3e7a82['error'][_0xf153('0x15')]);return _0x143497(_0x3e7a82[_0xf153('0x13')][_0xf153('0x15')]);}else{logger[_0xf153('0xe')](_0xf153('0xf'),_0x4c8ae5,_0xf153('0x10'));_0x143497(_0x3e7a82[_0xf153('0x16')][_0xf153('0x15')]);}})['catch'](function(_0x35f4e8){logger['error'](_0xf153('0xf'),_0x4c8ae5,_0x35f4e8);_0x224f88(_0x35f4e8);});});}
\ No newline at end of file
+var _0x9ffd=['SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x39456d,_0x420674){var _0x596c5c=function(_0xe584e5){while(--_0xe584e5){_0x39456d['push'](_0x39456d['shift']());}};_0x596c5c(++_0x420674);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xb559a7,_0x49817b){_0xb559a7=_0xb559a7-0x0;var _0x501df0=_0x9ffd[_0xb559a7];return _0x501df0;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('SalesforceField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js
index 6ad64b6..7be5b16 100644
--- a/server/api/intServicenowAccount/index.js
+++ b/server/api/intServicenowAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5294=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','update','destroy','exports','multer','util','path'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x5294,0x111));var _0x4529=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x5294[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x4529('0x0'));var util=require(_0x4529('0x1'));var path=require(_0x4529('0x2'));var timeout=require(_0x4529('0x3'));var express=require(_0x4529('0x4'));var router=express[_0x4529('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4529('0x6'));var config=require(_0x4529('0x7'));var controller=require(_0x4529('0x8'));router['get']('/',auth[_0x4529('0x9')](),controller[_0x4529('0xa')]);router[_0x4529('0xb')](_0x4529('0xc'),auth['isAuthenticated'](),controller[_0x4529('0xd')]);router[_0x4529('0xb')](_0x4529('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x4529('0xf'),auth[_0x4529('0x9')](),controller[_0x4529('0x10')]);router['post']('/',auth[_0x4529('0x9')](),controller[_0x4529('0x11')]);router[_0x4529('0x12')](_0x4529('0xe'),auth[_0x4529('0x9')](),controller[_0x4529('0x13')]);router['put']('/:id',auth[_0x4529('0x9')](),controller[_0x4529('0x14')]);router['delete'](_0x4529('0xc'),auth['isAuthenticated'](),controller[_0x4529('0x15')]);module[_0x4529('0x16')]=router;
\ No newline at end of file
+var _0xa3d1=['index','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated'];(function(_0x36921a,_0x8dc422){var _0xdb9f12=function(_0x28b743){while(--_0x28b743){_0x36921a['push'](_0x36921a['shift']());}};_0xdb9f12(++_0x8dc422);}(_0xa3d1,0x126));var _0x1a3d=function(_0x21634b,_0x54e2b2){_0x21634b=_0x21634b-0x0;var _0x5be605=_0xa3d1[_0x21634b];return _0x5be605;};'use strict';var multer=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var path=require(_0x1a3d('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a3d('0x3'));var router=express['Router']();var auth=require(_0x1a3d('0x4'));var interaction=require(_0x1a3d('0x5'));var config=require(_0x1a3d('0x6'));var controller=require(_0x1a3d('0x7'));router[_0x1a3d('0x8')]('/',auth[_0x1a3d('0x9')](),controller[_0x1a3d('0xa')]);router[_0x1a3d('0x8')]('/:id',auth[_0x1a3d('0x9')](),controller['show']);router[_0x1a3d('0x8')](_0x1a3d('0xb'),auth[_0x1a3d('0x9')](),controller['getConfigurations']);router[_0x1a3d('0x8')](_0x1a3d('0xc'),auth[_0x1a3d('0x9')](),controller[_0x1a3d('0xd')]);router[_0x1a3d('0xe')]('/',auth[_0x1a3d('0x9')](),controller[_0x1a3d('0xf')]);router[_0x1a3d('0xe')]('/:id/configurations',auth[_0x1a3d('0x9')](),controller[_0x1a3d('0x10')]);router[_0x1a3d('0x11')]('/:id',auth[_0x1a3d('0x9')](),controller['update']);router['delete']('/:id',auth[_0x1a3d('0x9')](),controller['destroy']);module[_0x1a3d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js
index 66752ae..3e1a5d0 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.attributes.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa5f9=['exports','STRING','username','remoteUri'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa5f9,0x188));var _0x9a5f=function(_0x2bf39f,_0x3641ad){_0x2bf39f=_0x2bf39f-0x0;var _0x2d1c1c=_0xa5f9[_0x2bf39f];return _0x2d1c1c;};'use strict';var Sequelize=require('sequelize');module[_0x9a5f('0x0')]={'name':{'type':Sequelize[_0x9a5f('0x1')]},'description':{'type':Sequelize[_0x9a5f('0x1')]},'username':{'type':Sequelize[_0x9a5f('0x1')],'unique':_0x9a5f('0x2')},'password':{'type':Sequelize[_0x9a5f('0x1')]},'email':{'type':Sequelize[_0x9a5f('0x1')]},'remoteUri':{'type':Sequelize[_0x9a5f('0x1')],'unique':_0x9a5f('0x3')},'serverUrl':{'type':Sequelize[_0x9a5f('0x1')]}};
\ No newline at end of file
+var _0xa026=['sequelize','STRING'];(function(_0x42701f,_0x3d2f90){var _0x36aafb=function(_0x1bb284){while(--_0x1bb284){_0x42701f['push'](_0x42701f['shift']());}};_0x36aafb(++_0x3d2f90);}(_0xa026,0xdc));var _0x6a02=function(_0x20c809,_0x26b566){_0x20c809=_0x20c809-0x0;var _0x1064a1=_0xa026[_0x20c809];return _0x1064a1;};'use strict';var Sequelize=require(_0x6a02('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6a02('0x1')]},'username':{'type':Sequelize[_0x6a02('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x6a02('0x1')]},'email':{'type':Sequelize[_0x6a02('0x1')]},'remoteUri':{'type':Sequelize[_0x6a02('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6a02('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js
index 2450635..512ae64 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.controller.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa181=['close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','upon_approval','correlation_id','location','findOne','username','password','email','serverUrl','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','stack','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','ServicenowConfiguration','hasOwnProperty','getConfigurations','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','watch_list','upon_reject','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name'];(function(_0x3d0fd2,_0x1f6d63){var _0x2aaa8d=function(_0x5551c1){while(--_0x5551c1){_0x3d0fd2['push'](_0x3d0fd2['shift']());}};_0x2aaa8d(++_0x1f6d63);}(_0xa181,0x10a));var _0x1a18=function(_0x5d2fc7,_0x2feef4){_0x5d2fc7=_0x5d2fc7-0x0;var _0x45b1fe=_0xa181[_0x5d2fc7];return _0x45b1fe;};'use strict';var pdf=require(_0x1a18('0x0'));var emlformat=require(_0x1a18('0x1'));var rimraf=require(_0x1a18('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a18('0x3'));var rp=require(_0x1a18('0x4'));var moment=require(_0x1a18('0x5'));var BPromise=require(_0x1a18('0x6'));var Mustache=require(_0x1a18('0x7'));var util=require(_0x1a18('0x8'));var path=require('path');var sox=require(_0x1a18('0x9'));var csv=require('to-csv');var ejs=require(_0x1a18('0xa'));var fs=require('fs');var _=require(_0x1a18('0xb'));var squel=require(_0x1a18('0xc'));var crypto=require(_0x1a18('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a18('0xe'));var toCsv=require(_0x1a18('0xf'));var querystring=require(_0x1a18('0x10'));var Papa=require('papaparse');var Redis=require(_0x1a18('0x11'));var authService=require(_0x1a18('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1a18('0x13'));var hardwareService=require(_0x1a18('0x14'));var logger=require(_0x1a18('0x15'))(_0x1a18('0x16'));var utils=require(_0x1a18('0x17'));var config=require('../../config/environment');var db=require(_0x1a18('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x1a18('0x19'));var client=jayson[_0x1a18('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x12c34d,_0x4ea0eb,_0x1b3de2){if(_0x1b3de2){var _0x15f465=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15f465['test'](_0x4ea0eb)){return _0x12c34d;}else{throw new db[(_0x1a18('0x1b'))][(_0x1a18('0x1c'))](_0x1a18('0x1d'));}}else{return _0x12c34d;}}function respondWithRpcPromise(_0x5da6ce,_0x2785f6,_0x47ac2e,_0x375527){return new BPromise(function(_0x4ef807,_0x30baba){var _0x5cdea8=_0x375527||client;return _0x5cdea8[_0x1a18('0x1e')](_0x5da6ce,_0x47ac2e)['then'](function(_0x2a621f){logger[_0x1a18('0x1f')](_0x1a18('0x20'),_0x2785f6,_0x1a18('0x21'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x2785f6,'request\x20sent',JSON[_0x1a18('0x22')](_0x2a621f));if(_0x2a621f[_0x1a18('0x23')]){if(_0x2a621f[_0x1a18('0x23')][_0x1a18('0x24')]===0x1f4){logger[_0x1a18('0x23')](_0x1a18('0x20'),_0x2785f6,_0x2a621f['error'][_0x1a18('0x25')]);return _0x30baba(_0x2a621f[_0x1a18('0x23')][_0x1a18('0x25')]);}logger[_0x1a18('0x23')](_0x1a18('0x20'),_0x2785f6,_0x2a621f[_0x1a18('0x23')][_0x1a18('0x25')]);return _0x4ef807(_0x2a621f[_0x1a18('0x23')][_0x1a18('0x25')]);}else{logger[_0x1a18('0x1f')](_0x1a18('0x20'),_0x2785f6,_0x1a18('0x21'));_0x4ef807(_0x2a621f[_0x1a18('0x26')][_0x1a18('0x25')]);}})[_0x1a18('0x27')](function(_0x27932b){logger[_0x1a18('0x23')]('ServicenowAccount,\x20%s,\x20%s',_0x2785f6,_0x27932b);_0x30baba(_0x27932b);});});}function respondWithStatusCode(_0x8cebc6,_0x33cef2){_0x33cef2=_0x33cef2||0xcc;return function(_0x1616c9){if(_0x1616c9){return _0x8cebc6[_0x1a18('0x28')](_0x33cef2);}return _0x8cebc6[_0x1a18('0x29')](_0x33cef2)[_0x1a18('0x2a')]();};}function respondWithResult(_0x486294,_0x20425e){_0x20425e=_0x20425e||0xc8;return function(_0x36e016){if(_0x36e016){return _0x486294[_0x1a18('0x29')](_0x20425e)[_0x1a18('0x2b')](_0x36e016);}};}function respondWithFilteredResult(_0x54f60e,_0x3ea0b7){return function(_0x4699ab){if(_0x4699ab){var _0x299277=_0x4699ab[_0x1a18('0x2c')],_0x17776b=_0x3ea0b7[_0x1a18('0x2d')],_0x14c983=_0x3ea0b7[_0x1a18('0x2d')]+_0x3ea0b7[_0x1a18('0x2e')],_0x855cca;if(_0x14c983>=_0x299277){_0x14c983=_0x299277;_0x855cca=0xc8;}else{_0x855cca=0xce;}_0x54f60e[_0x1a18('0x29')](_0x855cca);return _0x54f60e[_0x1a18('0x2f')](_0x1a18('0x30'),_0x17776b+'-'+_0x14c983+'/'+_0x299277)[_0x1a18('0x2b')](_0x4699ab);}return null;};}function patchUpdates(_0x337130){return function(_0x54b624){try{jsonpatch[_0x1a18('0x31')](_0x54b624,_0x337130,!![]);}catch(_0x51fb15){return BPromise[_0x1a18('0x32')](_0x51fb15);}return _0x54b624[_0x1a18('0x33')]();};}function saveUpdates(_0x50e3f3,_0x49dd5f){return function(_0x55cc08){if(_0x55cc08){return _0x55cc08[_0x1a18('0x34')](_0x50e3f3)[_0x1a18('0x35')](function(_0x32bad1){return _0x32bad1;});}return null;};}function removeEntity(_0x24b537,_0x34674c){return function(_0x2b0636){if(_0x2b0636){return _0x2b0636[_0x1a18('0x36')]()[_0x1a18('0x35')](function(){_0x24b537[_0x1a18('0x29')](0xcc)[_0x1a18('0x2a')]();});}};}function handleEntityNotFound(_0x51b7c9,_0x4d5ba3){return function(_0xeb0b1f){if(!_0xeb0b1f){_0x51b7c9[_0x1a18('0x28')](0x194);}return _0xeb0b1f;};}function handleError(_0xaf21f,_0x1b5064){_0x1b5064=_0x1b5064||0x1f4;return function(_0x37c82c){logger['error'](_0x37c82c['stack']);if(_0x37c82c[_0x1a18('0x37')]){delete _0x37c82c[_0x1a18('0x37')];}_0xaf21f[_0x1a18('0x29')](_0x1b5064)[_0x1a18('0x38')](_0x37c82c);};}exports['index']=function(_0x21c6d2,_0x40c1b5){var _0x553ee6={},_0x164522={},_0x5adc6f={'count':0x0,'rows':[]};var _0x3c8ffe=_[_0x1a18('0x39')](db[_0x1a18('0x3a')][_0x1a18('0x3b')],function(_0x2a6f05){return{'name':_0x2a6f05[_0x1a18('0x3c')],'type':_0x2a6f05[_0x1a18('0x3d')][_0x1a18('0x3e')]};});_0x164522[_0x1a18('0x3f')]=_[_0x1a18('0x39')](_0x3c8ffe,_0x1a18('0x37'));_0x164522[_0x1a18('0x40')]=_[_0x1a18('0x41')](_0x21c6d2[_0x1a18('0x40')]);_0x164522[_0x1a18('0x42')]=_['intersection'](_0x164522['model'],_0x164522['query']);_0x553ee6[_0x1a18('0x43')]=_[_0x1a18('0x44')](_0x164522['model'],qs['fields'](_0x21c6d2[_0x1a18('0x40')][_0x1a18('0x45')]));_0x553ee6[_0x1a18('0x43')]=_0x553ee6['attributes'][_0x1a18('0x46')]?_0x553ee6[_0x1a18('0x43')]:_0x164522['model'];if(!_0x21c6d2[_0x1a18('0x40')]['hasOwnProperty'](_0x1a18('0x47'))){_0x553ee6[_0x1a18('0x2e')]=qs[_0x1a18('0x2e')](_0x21c6d2[_0x1a18('0x40')][_0x1a18('0x2e')]);_0x553ee6[_0x1a18('0x2d')]=qs[_0x1a18('0x2d')](_0x21c6d2['query'][_0x1a18('0x2d')]);}_0x553ee6[_0x1a18('0x48')]=qs[_0x1a18('0x49')](_0x21c6d2[_0x1a18('0x40')][_0x1a18('0x49')]);_0x553ee6[_0x1a18('0x4a')]=qs['filters'](_[_0x1a18('0x4b')](_0x21c6d2['query'],_0x164522[_0x1a18('0x42')]),_0x3c8ffe);if(_0x21c6d2['query'][_0x1a18('0x4c')]){_0x553ee6[_0x1a18('0x4a')]=_[_0x1a18('0x4d')](_0x553ee6[_0x1a18('0x4a')],{'$or':_[_0x1a18('0x39')](_0x3c8ffe,function(_0x58f845){if(_0x58f845[_0x1a18('0x3d')]!==_0x1a18('0x4e')){var _0x120fce={};_0x120fce[_0x58f845['name']]={'$like':'%'+_0x21c6d2[_0x1a18('0x40')][_0x1a18('0x4c')]+'%'};return _0x120fce;}})});}_0x553ee6=_[_0x1a18('0x4d')]({},_0x553ee6,_0x21c6d2[_0x1a18('0x4f')]);var _0x590d91={'where':_0x553ee6['where']};return db['ServicenowAccount']['count'](_0x590d91)[_0x1a18('0x35')](function(_0xe4b76e){_0x5adc6f[_0x1a18('0x2c')]=_0xe4b76e;if(_0x21c6d2[_0x1a18('0x40')][_0x1a18('0x50')]){_0x553ee6[_0x1a18('0x51')]=[{'all':!![]}];}return db[_0x1a18('0x3a')][_0x1a18('0x52')](_0x553ee6);})[_0x1a18('0x35')](function(_0x11e3d3){_0x5adc6f[_0x1a18('0x53')]=_0x11e3d3;return _0x5adc6f;})[_0x1a18('0x35')](respondWithFilteredResult(_0x40c1b5,_0x553ee6))[_0x1a18('0x27')](handleError(_0x40c1b5,null));};exports[_0x1a18('0x54')]=function(_0x340660,_0x5434e8){var _0xde94b0={'raw':![],'where':{'id':_0x340660[_0x1a18('0x55')]['id']}},_0x1a301c={};_0x1a301c['model']=_[_0x1a18('0x41')](db['ServicenowAccount'][_0x1a18('0x3b')]);_0x1a301c[_0x1a18('0x40')]=_[_0x1a18('0x41')](_0x340660[_0x1a18('0x40')]);_0x1a301c[_0x1a18('0x42')]=_[_0x1a18('0x44')](_0x1a301c[_0x1a18('0x3f')],_0x1a301c['query']);_0xde94b0[_0x1a18('0x43')]=_[_0x1a18('0x44')](_0x1a301c[_0x1a18('0x3f')],qs['fields'](_0x340660[_0x1a18('0x40')][_0x1a18('0x45')]));_0xde94b0[_0x1a18('0x43')]=_0xde94b0['attributes'][_0x1a18('0x46')]?_0xde94b0[_0x1a18('0x43')]:_0x1a301c[_0x1a18('0x3f')];if(_0x340660[_0x1a18('0x40')]['includeAll']){_0xde94b0[_0x1a18('0x51')]=[{'all':!![]}];}_0xde94b0=_[_0x1a18('0x4d')]({},_0xde94b0,_0x340660[_0x1a18('0x4f')]);return db[_0x1a18('0x3a')]['find'](_0xde94b0)[_0x1a18('0x35')](handleEntityNotFound(_0x5434e8,null))[_0x1a18('0x35')](respondWithResult(_0x5434e8,null))['catch'](handleError(_0x5434e8,null));};exports[_0x1a18('0x56')]=function(_0x557709,_0x48642c){return db[_0x1a18('0x3a')][_0x1a18('0x56')](_0x557709[_0x1a18('0x57')],{})['then'](respondWithResult(_0x48642c,0xc9))[_0x1a18('0x27')](handleError(_0x48642c,null));};exports[_0x1a18('0x34')]=function(_0x5781f0,_0x37aeba){if(_0x5781f0[_0x1a18('0x57')]['id']){delete _0x5781f0[_0x1a18('0x57')]['id'];}return db['ServicenowAccount'][_0x1a18('0x58')]({'where':{'id':_0x5781f0[_0x1a18('0x55')]['id']}})[_0x1a18('0x35')](handleEntityNotFound(_0x37aeba,null))['then'](saveUpdates(_0x5781f0[_0x1a18('0x57')],null))[_0x1a18('0x35')](respondWithResult(_0x37aeba,null))[_0x1a18('0x27')](handleError(_0x37aeba,null));};exports[_0x1a18('0x36')]=function(_0x3bfa4c,_0x375d5f){return db['ServicenowAccount']['find']({'where':{'id':_0x3bfa4c['params']['id']}})[_0x1a18('0x35')](handleEntityNotFound(_0x375d5f,null))['then'](removeEntity(_0x375d5f,null))[_0x1a18('0x27')](handleError(_0x375d5f,null));};exports['getConfigurations']=function(_0x249d5b,_0x6df303,_0xfd9aa8){var _0x497898={};var _0x1df3b8={};var _0x17150c;var _0x4c2210;return db[_0x1a18('0x3a')]['findOne']({'where':{'id':_0x249d5b[_0x1a18('0x55')]['id']}})[_0x1a18('0x35')](handleEntityNotFound(_0x6df303,null))[_0x1a18('0x35')](function(_0x2c9a72){if(_0x2c9a72){_0x17150c=_0x2c9a72;_0x1df3b8[_0x1a18('0x3f')]=_[_0x1a18('0x41')](db[_0x1a18('0x59')]['rawAttributes']);_0x1df3b8['query']=_[_0x1a18('0x41')](_0x249d5b[_0x1a18('0x40')]);_0x1df3b8[_0x1a18('0x42')]=_[_0x1a18('0x44')](_0x1df3b8['model'],_0x1df3b8[_0x1a18('0x40')]);_0x497898['attributes']=_[_0x1a18('0x44')](_0x1df3b8[_0x1a18('0x3f')],qs['fields'](_0x249d5b[_0x1a18('0x40')][_0x1a18('0x45')]));_0x497898[_0x1a18('0x43')]=_0x497898[_0x1a18('0x43')][_0x1a18('0x46')]?_0x497898[_0x1a18('0x43')]:_0x1df3b8[_0x1a18('0x3f')];_0x497898[_0x1a18('0x48')]=qs[_0x1a18('0x49')](_0x249d5b['query'][_0x1a18('0x49')]);_0x497898[_0x1a18('0x4a')]=qs['filters'](_[_0x1a18('0x4b')](_0x249d5b['query'],_0x1df3b8[_0x1a18('0x42')]));if(_0x249d5b[_0x1a18('0x40')]['filter']){_0x497898[_0x1a18('0x4a')]=_['merge'](_0x497898[_0x1a18('0x4a')],{'$or':_[_0x1a18('0x39')](_0x497898[_0x1a18('0x43')],function(_0x5d352c){var _0x27a8d2={};_0x27a8d2[_0x5d352c]={'$like':'%'+_0x249d5b[_0x1a18('0x40')][_0x1a18('0x4c')]+'%'};return _0x27a8d2;})});}_0x497898=_[_0x1a18('0x4d')]({},_0x497898,_0x249d5b[_0x1a18('0x4f')]);return _0x17150c['getConfigurations'](_0x497898);}})['then'](function(_0x198aa8){if(_0x198aa8){_0x4c2210=_0x198aa8[_0x1a18('0x46')];if(!_0x249d5b['query'][_0x1a18('0x5a')]('nolimit')){_0x497898[_0x1a18('0x2e')]=qs['limit'](_0x249d5b[_0x1a18('0x40')][_0x1a18('0x2e')]);_0x497898['offset']=qs[_0x1a18('0x2d')](_0x249d5b[_0x1a18('0x40')][_0x1a18('0x2d')]);}return _0x17150c[_0x1a18('0x5b')](_0x497898);}})['then'](function(_0x482096){if(_0x482096){return _0x482096?{'count':_0x4c2210,'rows':_0x482096}:null;}})['then'](respondWithResult(_0x6df303,null))[_0x1a18('0x27')](handleError(_0x6df303,null));};exports[_0x1a18('0x5c')]=function(_0x3c0eec,_0x3ff56e,_0x45ae21){if(_0x3c0eec[_0x1a18('0x57')]['id']){delete _0x3c0eec[_0x1a18('0x57')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x3c0eec[_0x1a18('0x55')]['id']}})[_0x1a18('0x35')](handleEntityNotFound(_0x3ff56e,null))[_0x1a18('0x35')](function(_0x320db1){if(_0x320db1){_0x3c0eec[_0x1a18('0x57')][_0x1a18('0x5d')]=_0x320db1['id'];_0x3c0eec['body'][_0x1a18('0x5e')]=integrations['getSubjects'](_0x3c0eec[_0x1a18('0x57')]['channel'],_0x3c0eec[_0x1a18('0x57')]['type']);_0x3c0eec['body'][_0x1a18('0x5f')]=integrations[_0x1a18('0x60')](_0x3c0eec[_0x1a18('0x57')][_0x1a18('0x61')],_0x3c0eec[_0x1a18('0x57')][_0x1a18('0x3d')]);return db['ServicenowConfiguration'][_0x1a18('0x56')](_0x3c0eec[_0x1a18('0x57')],{'include':[{'model':db[_0x1a18('0x62')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x1a18('0x5f')}]});}return null;})[_0x1a18('0x35')](respondWithResult(_0x3ff56e,null))[_0x1a18('0x27')](handleError(_0x3ff56e,null));};exports[_0x1a18('0x63')]=function(_0x217472,_0x45ef82,_0x1a0bd9){var _0x56450f=[_0x1a18('0x64'),_0x1a18('0x65'),_0x1a18('0x66'),_0x1a18('0x67'),_0x1a18('0x68'),_0x1a18('0x69'),_0x1a18('0x6a'),_0x1a18('0x6b'),_0x1a18('0x6c')];var _0x1ea9bd=[_0x1a18('0x6d'),'made_sla','caused_by',_0x1a18('0x6e'),_0x1a18('0x6f'),'sys_updated_on','child_incidents',_0x1a18('0x65'),_0x1a18('0x70'),_0x1a18('0x71'),_0x1a18('0x72'),_0x1a18('0x73'),_0x1a18('0x74'),'user_input',_0x1a18('0x75'),'sys_domain',_0x1a18('0x76'),_0x1a18('0x77'),_0x1a18('0x66'),_0x1a18('0x48'),_0x1a18('0x78'),_0x1a18('0x79'),_0x1a18('0x7a'),_0x1a18('0x7b'),_0x1a18('0x7c'),_0x1a18('0x7d'),'work_notes_list',_0x1a18('0x7e'),_0x1a18('0x7f'),_0x1a18('0x80'),_0x1a18('0x81'),_0x1a18('0x82'),'expected_start',_0x1a18('0x83'),_0x1a18('0x84'),_0x1a18('0x85'),_0x1a18('0x86'),_0x1a18('0x87'),_0x1a18('0x88'),'caller_id',_0x1a18('0x89'),_0x1a18('0x67'),'work_notes',_0x1a18('0x8a'),_0x1a18('0x68'),_0x1a18('0x8b'),'delivery_task',_0x1a18('0x8c'),_0x1a18('0x8d'),_0x1a18('0x8e'),_0x1a18('0x8f'),_0x1a18('0x90'),'calendar_duration',_0x1a18('0x69'),_0x1a18('0x91'),_0x1a18('0x92'),_0x1a18('0x93'),_0x1a18('0x94'),_0x1a18('0x95'),_0x1a18('0x96'),_0x1a18('0x97'),_0x1a18('0x98'),'incident_state',_0x1a18('0x99'),_0x1a18('0x9a'),'company',_0x1a18('0x9b'),_0x1a18('0x9c'),_0x1a18('0x9d'),'severity',_0x1a18('0x9e'),_0x1a18('0x9f'),_0x1a18('0xa0'),_0x1a18('0xa1'),_0x1a18('0xa2'),_0x1a18('0xa3'),_0x1a18('0xa4'),'sys_tags','escalation',_0x1a18('0xa5'),_0x1a18('0xa6'),_0x1a18('0xa7'),_0x1a18('0x6c')];var _0x192d4c='';var _0x456720='';var _0x327aa7=[];var _0x40781f='';var _0x14ee96='';var _0x477031=[];var _0x2316e8='';var _0x587e3c='';var _0x7a4d72={};var _0xc5a0af='';return db['ServicenowAccount'][_0x1a18('0xa8')]({'where':{'id':_0x217472[_0x1a18('0x55')]['id']},'attributes':['id',_0x1a18('0xa9'),_0x1a18('0xaa'),_0x1a18('0xab'),'remoteUri',_0x1a18('0xac')]})[_0x1a18('0x35')](handleEntityNotFound(_0x45ef82,null))[_0x1a18('0x35')](function(_0x36837b){if(_0x36837b){_0xc5a0af=_0x36837b[_0x1a18('0xad')];var _0x5eb1a5=_0xc5a0af[_0x1a18('0xae')](-0x1);if(_0x5eb1a5==='/'){_0xc5a0af=_0xc5a0af['substring'](0x0,_0xc5a0af[_0x1a18('0xaf')](_0x5eb1a5));}_0x587e3c=util[_0x1a18('0xb0')](_0x1a18('0xb1'),_0xc5a0af);_0x2316e8=util[_0x1a18('0xb0')](_0x1a18('0xb2'),_0xc5a0af);_0x7a4d72={'user':_0x36837b[_0x1a18('0xa9')],'pass':_0x36837b[_0x1a18('0xaa')]};var _0x14a95e={'method':_0x1a18('0xb3'),'uri':_0x587e3c+_0x1a18('0xb4'),'auth':_0x7a4d72,'json':!![]};return rp(_0x14a95e);}})[_0x1a18('0x35')](function(_0x4f59e2){if(_0x4f59e2['result'][_0x1a18('0x46')]>0x0){_0x192d4c=_0x4f59e2[_0x1a18('0x26')];}console[_0x1a18('0xb5')](_0x1a18('0xb6'),_0x192d4c);_0x477031=[];_0x456720=Object[_0x1a18('0xb7')]([],_0x192d4c);_[_0x1a18('0xb8')](_0x456720,function(_0x2cdb5b){return!_0x56450f[_0x1a18('0xb9')](_0x2cdb5b[_0x1a18('0x37')]);});_0x456720[_0x1a18('0xba')](function(_0x5159e9){var _0x5e21e5=createFieldObject(_0x2316e8,_0x7a4d72,_0x5159e9[_0x1a18('0xbb')],_0x5159e9[_0x1a18('0x37')],_0x5159e9[_0x1a18('0xbc')],![]);_0x477031[_0x1a18('0xbd')](_0x5e21e5);});return Promise[_0x1a18('0xbe')](_0x477031);})[_0x1a18('0x35')](function(_0x5bd0f0){_0x327aa7=_0x5bd0f0;_0x40781f=Object[_0x1a18('0xb7')]([],_0x192d4c);console[_0x1a18('0xb5')](_0x1a18('0xbf'),_0x192d4c);_[_0x1a18('0xb8')](_0x40781f,function(_0x380b7f){return _0x1ea9bd[_0x1a18('0xb9')](_0x380b7f[_0x1a18('0x37')]);});console[_0x1a18('0xb5')](_0x1a18('0xc0'),_0x40781f);_0x477031=[];_0x40781f[_0x1a18('0xba')](function(_0x7b3f11){var _0x2f969d=createFieldObject(_0x2316e8,_0x7a4d72,_0x7b3f11['internalType'],_0x7b3f11[_0x1a18('0x37')],_0x7b3f11[_0x1a18('0xbc')],!![]);_0x477031[_0x1a18('0xbd')](_0x2f969d);});return Promise[_0x1a18('0xbe')](_0x477031);})[_0x1a18('0x35')](function(_0x36eb21){_0x14ee96=_0x36eb21;var _0x1767cc=_0x327aa7[_0x1a18('0xc1')](_0x14ee96);return{'count':_0x1767cc['length'],'rows':_0x1767cc};})[_0x1a18('0x35')](respondWithResult(_0x45ef82,null))[_0x1a18('0x27')](function(_0x30f3a5){console['log'](_0x1a18('0xc2')+_0x30f3a5);var _0x402131=_0x217472[_0x1a18('0x40')]['test']?0x1f4:_0x30f3a5[_0x1a18('0xc3')]||0x1f4;logger[_0x1a18('0x23')](_0x30f3a5[_0x1a18('0xc4')]);delete _0x30f3a5[_0x1a18('0x37')];if(_0x402131===0x191){_0x402131=0x190;}_0x45ef82[_0x1a18('0x29')](_0x402131)[_0x1a18('0x38')](_0x217472['query'][_0x1a18('0xc5')]?{'message':_0x1a18('0xc6'),'statusCode':_0x30f3a5[_0x1a18('0xc3')]}:_0x30f3a5);});};function createFieldObject(_0x2d92c5,_0x1ffc83,_0x563326,_0x3f59ed,_0x1402db,_0x1de266){return new Promise(function(_0x398241,_0x4791ef){var _0xd61bc={'id':_0x3f59ed,'name':_0x1402db,'custom':_0x1de266};if(_0x563326===_0x1a18('0xc7')){_0xd61bc['options']=[{'name':_0x1a18('0xc8'),'value':_0x1a18('0xc9')},{'name':_0x1a18('0xca'),'value':_0x1a18('0xcb')}];_0x398241(_0xd61bc);}else{var _0x349ab0={'method':_0x1a18('0xb3'),'uri':_0x2d92c5+_0x1a18('0xcc')+_0x3f59ed,'auth':_0x1ffc83,'json':!![]};return rp(_0x349ab0)[_0x1a18('0x35')](function(_0x15b83e){var _0x182ab2=[];if(_0x15b83e[_0x1a18('0x26')]['length']>0x0){_0x15b83e['result']['forEach'](function(_0x1dcd63){if(_0x1dcd63['inactive']===_0x1a18('0xcb')){var _0x5b024c={'name':_0x1dcd63['label'],'value':_0x1dcd63[_0x1a18('0xcd')]};_0x182ab2['push'](_0x5b024c);}});}_0xd61bc[_0x1a18('0x4f')]=_0x182ab2;if(_0xd61bc[_0x1a18('0x4f')]['length']>0x0){_0x398241(_0xd61bc);}else{if(_0x1de266==![]){_0x398241();}else{_0x398241(_0xd61bc);}}});}});}
\ No newline at end of file
+var _0x161d=['getDescriptions','ServicenowField','made_sla','hold_reason','subcategory','close_code','notify','incident_state','category','parent','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','assigned_to','severity','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','correlation_id','location','username','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','password','GET','incident\x20table\x20objects','remove','includes','forEach','internalType','push','all','assign','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','end','json','offset','limit','set','apply','reject','save','update','then','sendStatus','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','merge','find','create','body','getConfigurations','findOne','ServicenowConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions'];(function(_0xdcc394,_0x2e02b1){var _0xe8ad95=function(_0xda4ba5){while(--_0xda4ba5){_0xdcc394['push'](_0xdcc394['shift']());}};_0xe8ad95(++_0x2e02b1);}(_0x161d,0x65));var _0xd161=function(_0xcbe31f,_0x70af70){_0xcbe31f=_0xcbe31f-0x0;var _0x54e0b2=_0x161d[_0xcbe31f];return _0x54e0b2;};'use strict';var pdf=require(_0xd161('0x0'));var emlformat=require(_0xd161('0x1'));var rimraf=require(_0xd161('0x2'));var zipdir=require(_0xd161('0x3'));var jsonpatch=require(_0xd161('0x4'));var rp=require(_0xd161('0x5'));var moment=require(_0xd161('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd161('0x7'));var util=require(_0xd161('0x8'));var path=require(_0xd161('0x9'));var sox=require(_0xd161('0xa'));var csv=require(_0xd161('0xb'));var ejs=require(_0xd161('0xc'));var fs=require('fs');var _=require(_0xd161('0xd'));var squel=require(_0xd161('0xe'));var crypto=require(_0xd161('0xf'));var jsforce=require(_0xd161('0x10'));var deskjs=require(_0xd161('0x11'));var toCsv=require(_0xd161('0xb'));var querystring=require(_0xd161('0x12'));var Papa=require(_0xd161('0x13'));var Redis=require(_0xd161('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd161('0x15'));var as=require(_0xd161('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd161('0x17'))('api');var utils=require(_0xd161('0x18'));var config=require(_0xd161('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd161('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0xd161('0x1b')][_0xd161('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1edc5a,_0x69228b,_0x31bce5){if(_0x31bce5){var _0x23e138=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23e138['test'](_0x69228b)){return _0x1edc5a;}else{throw new db['Sequelize']['ValidationError'](_0xd161('0x1d'));}}else{return _0x1edc5a;}}function respondWithRpcPromise(_0x5359ca,_0x57ebbf,_0x5976ae,_0x2536d0){return new BPromise(function(_0x6c9768,_0x23894f){var _0x5ad450=_0x2536d0||client;return _0x5ad450[_0xd161('0x1e')](_0x5359ca,_0x5976ae)['then'](function(_0x2c96f8){logger[_0xd161('0x1f')](_0xd161('0x20'),_0x57ebbf,_0xd161('0x21'));logger[_0xd161('0x22')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x57ebbf,_0xd161('0x21'),JSON['stringify'](_0x2c96f8));if(_0x2c96f8[_0xd161('0x23')]){if(_0x2c96f8[_0xd161('0x23')]['code']===0x1f4){logger[_0xd161('0x23')](_0xd161('0x20'),_0x57ebbf,_0x2c96f8[_0xd161('0x23')][_0xd161('0x24')]);return _0x23894f(_0x2c96f8[_0xd161('0x23')][_0xd161('0x24')]);}logger[_0xd161('0x23')]('ServicenowAccount,\x20%s,\x20%s',_0x57ebbf,_0x2c96f8[_0xd161('0x23')][_0xd161('0x24')]);return _0x6c9768(_0x2c96f8[_0xd161('0x23')][_0xd161('0x24')]);}else{logger['info'](_0xd161('0x20'),_0x57ebbf,_0xd161('0x21'));_0x6c9768(_0x2c96f8[_0xd161('0x25')][_0xd161('0x24')]);}})[_0xd161('0x26')](function(_0x10bf93){logger[_0xd161('0x23')](_0xd161('0x20'),_0x57ebbf,_0x10bf93);_0x23894f(_0x10bf93);});});}function respondWithStatusCode(_0x4d2899,_0x5c27e3){_0x5c27e3=_0x5c27e3||0xcc;return function(_0x4fa3f0){if(_0x4fa3f0){return _0x4d2899['sendStatus'](_0x5c27e3);}return _0x4d2899[_0xd161('0x27')](_0x5c27e3)[_0xd161('0x28')]();};}function respondWithResult(_0x5ecac2,_0x1aac6f){_0x1aac6f=_0x1aac6f||0xc8;return function(_0xeba7e){if(_0xeba7e){return _0x5ecac2[_0xd161('0x27')](_0x1aac6f)[_0xd161('0x29')](_0xeba7e);}};}function respondWithFilteredResult(_0x142dd4,_0x23d03a){return function(_0x10e984){if(_0x10e984){var _0x37ad00=_0x10e984['count'],_0x33ee04=_0x23d03a[_0xd161('0x2a')],_0x445809=_0x23d03a[_0xd161('0x2a')]+_0x23d03a[_0xd161('0x2b')],_0x5344f4;if(_0x445809>=_0x37ad00){_0x445809=_0x37ad00;_0x5344f4=0xc8;}else{_0x5344f4=0xce;}_0x142dd4['status'](_0x5344f4);return _0x142dd4[_0xd161('0x2c')]('Content-Range',_0x33ee04+'-'+_0x445809+'/'+_0x37ad00)[_0xd161('0x29')](_0x10e984);}return null;};}function patchUpdates(_0x3a3478){return function(_0x52d6ab){try{jsonpatch[_0xd161('0x2d')](_0x52d6ab,_0x3a3478,!![]);}catch(_0x57f2b0){return BPromise[_0xd161('0x2e')](_0x57f2b0);}return _0x52d6ab[_0xd161('0x2f')]();};}function saveUpdates(_0x10e0c8,_0x3d0693){return function(_0x5e9897){if(_0x5e9897){return _0x5e9897[_0xd161('0x30')](_0x10e0c8)[_0xd161('0x31')](function(_0x13fdc6){return _0x13fdc6;});}return null;};}function removeEntity(_0x4f5b31,_0x28a77d){return function(_0x49fcf6){if(_0x49fcf6){return _0x49fcf6['destroy']()['then'](function(){_0x4f5b31[_0xd161('0x27')](0xcc)[_0xd161('0x28')]();});}};}function handleEntityNotFound(_0xee9be2,_0x2df724){return function(_0x398582){if(!_0x398582){_0xee9be2[_0xd161('0x32')](0x194);}return _0x398582;};}function handleError(_0x1906f1,_0x5f4480){_0x5f4480=_0x5f4480||0x1f4;return function(_0x1936f1){logger['error'](_0x1936f1[_0xd161('0x33')]);if(_0x1936f1[_0xd161('0x34')]){delete _0x1936f1['name'];}_0x1906f1[_0xd161('0x27')](_0x5f4480)[_0xd161('0x35')](_0x1936f1);};}exports[_0xd161('0x36')]=function(_0x38b6b2,_0x4db540){var _0xcbbdf2={},_0x30980e={},_0x1f78eb={'count':0x0,'rows':[]};var _0x518e6b=_['map'](db[_0xd161('0x37')][_0xd161('0x38')],function(_0x209cb1){return{'name':_0x209cb1[_0xd161('0x39')],'type':_0x209cb1[_0xd161('0x3a')][_0xd161('0x3b')]};});_0x30980e[_0xd161('0x3c')]=_[_0xd161('0x3d')](_0x518e6b,_0xd161('0x34'));_0x30980e[_0xd161('0x3e')]=_['keys'](_0x38b6b2[_0xd161('0x3e')]);_0x30980e[_0xd161('0x3f')]=_[_0xd161('0x40')](_0x30980e['model'],_0x30980e[_0xd161('0x3e')]);_0xcbbdf2[_0xd161('0x41')]=_[_0xd161('0x40')](_0x30980e['model'],qs[_0xd161('0x42')](_0x38b6b2[_0xd161('0x3e')][_0xd161('0x42')]));_0xcbbdf2[_0xd161('0x41')]=_0xcbbdf2[_0xd161('0x41')][_0xd161('0x43')]?_0xcbbdf2['attributes']:_0x30980e[_0xd161('0x3c')];if(!_0x38b6b2[_0xd161('0x3e')][_0xd161('0x44')](_0xd161('0x45'))){_0xcbbdf2[_0xd161('0x2b')]=qs[_0xd161('0x2b')](_0x38b6b2[_0xd161('0x3e')][_0xd161('0x2b')]);_0xcbbdf2[_0xd161('0x2a')]=qs[_0xd161('0x2a')](_0x38b6b2[_0xd161('0x3e')]['offset']);}_0xcbbdf2[_0xd161('0x46')]=qs['sort'](_0x38b6b2['query'][_0xd161('0x47')]);_0xcbbdf2['where']=qs['filters'](_[_0xd161('0x48')](_0x38b6b2[_0xd161('0x3e')],_0x30980e['filters']),_0x518e6b);if(_0x38b6b2[_0xd161('0x3e')][_0xd161('0x49')]){_0xcbbdf2[_0xd161('0x4a')]=_['merge'](_0xcbbdf2['where'],{'$or':_['map'](_0x518e6b,function(_0x21fd16){if(_0x21fd16[_0xd161('0x3a')]!==_0xd161('0x4b')){var _0x4eb7b9={};_0x4eb7b9[_0x21fd16['name']]={'$like':'%'+_0x38b6b2['query']['filter']+'%'};return _0x4eb7b9;}})});}_0xcbbdf2=_['merge']({},_0xcbbdf2,_0x38b6b2[_0xd161('0x4c')]);var _0x1aa211={'where':_0xcbbdf2['where']};return db['ServicenowAccount'][_0xd161('0x4d')](_0x1aa211)['then'](function(_0x5b4a9b){_0x1f78eb[_0xd161('0x4d')]=_0x5b4a9b;if(_0x38b6b2['query'][_0xd161('0x4e')]){_0xcbbdf2[_0xd161('0x4f')]=[{'all':!![]}];}return db[_0xd161('0x37')][_0xd161('0x50')](_0xcbbdf2);})[_0xd161('0x31')](function(_0x29b63c){_0x1f78eb[_0xd161('0x51')]=_0x29b63c;return _0x1f78eb;})['then'](respondWithFilteredResult(_0x4db540,_0xcbbdf2))[_0xd161('0x26')](handleError(_0x4db540,null));};exports[_0xd161('0x52')]=function(_0x48b526,_0x334677){var _0x48ac79={'raw':![],'where':{'id':_0x48b526[_0xd161('0x53')]['id']}},_0xd83dce={};_0xd83dce['model']=_[_0xd161('0x54')](db[_0xd161('0x37')][_0xd161('0x38')]);_0xd83dce['query']=_[_0xd161('0x54')](_0x48b526[_0xd161('0x3e')]);_0xd83dce['filters']=_['intersection'](_0xd83dce['model'],_0xd83dce[_0xd161('0x3e')]);_0x48ac79[_0xd161('0x41')]=_['intersection'](_0xd83dce[_0xd161('0x3c')],qs[_0xd161('0x42')](_0x48b526[_0xd161('0x3e')]['fields']));_0x48ac79[_0xd161('0x41')]=_0x48ac79[_0xd161('0x41')]['length']?_0x48ac79['attributes']:_0xd83dce[_0xd161('0x3c')];if(_0x48b526['query'][_0xd161('0x4e')]){_0x48ac79['include']=[{'all':!![]}];}_0x48ac79=_[_0xd161('0x55')]({},_0x48ac79,_0x48b526[_0xd161('0x4c')]);return db[_0xd161('0x37')][_0xd161('0x56')](_0x48ac79)[_0xd161('0x31')](handleEntityNotFound(_0x334677,null))[_0xd161('0x31')](respondWithResult(_0x334677,null))[_0xd161('0x26')](handleError(_0x334677,null));};exports[_0xd161('0x57')]=function(_0x169836,_0x366684){return db[_0xd161('0x37')][_0xd161('0x57')](_0x169836[_0xd161('0x58')],{})[_0xd161('0x31')](respondWithResult(_0x366684,0xc9))['catch'](handleError(_0x366684,null));};exports['update']=function(_0xfb348c,_0x5db0bc){if(_0xfb348c[_0xd161('0x58')]['id']){delete _0xfb348c[_0xd161('0x58')]['id'];}return db[_0xd161('0x37')][_0xd161('0x56')]({'where':{'id':_0xfb348c[_0xd161('0x53')]['id']}})[_0xd161('0x31')](handleEntityNotFound(_0x5db0bc,null))[_0xd161('0x31')](saveUpdates(_0xfb348c[_0xd161('0x58')],null))['then'](respondWithResult(_0x5db0bc,null))['catch'](handleError(_0x5db0bc,null));};exports['destroy']=function(_0x36cd52,_0x4a0227){return db[_0xd161('0x37')][_0xd161('0x56')]({'where':{'id':_0x36cd52[_0xd161('0x53')]['id']}})[_0xd161('0x31')](handleEntityNotFound(_0x4a0227,null))[_0xd161('0x31')](removeEntity(_0x4a0227,null))['catch'](handleError(_0x4a0227,null));};exports[_0xd161('0x59')]=function(_0xd591ba,_0x140c68,_0x2ef699){var _0x1a3b56={};var _0x28a429={};var _0xa46935;var _0x5c592c;return db[_0xd161('0x37')][_0xd161('0x5a')]({'where':{'id':_0xd591ba[_0xd161('0x53')]['id']}})[_0xd161('0x31')](handleEntityNotFound(_0x140c68,null))[_0xd161('0x31')](function(_0x5d22e7){if(_0x5d22e7){_0xa46935=_0x5d22e7;_0x28a429['model']=_[_0xd161('0x54')](db[_0xd161('0x5b')][_0xd161('0x38')]);_0x28a429['query']=_[_0xd161('0x54')](_0xd591ba[_0xd161('0x3e')]);_0x28a429['filters']=_[_0xd161('0x40')](_0x28a429['model'],_0x28a429['query']);_0x1a3b56['attributes']=_['intersection'](_0x28a429['model'],qs['fields'](_0xd591ba[_0xd161('0x3e')][_0xd161('0x42')]));_0x1a3b56[_0xd161('0x41')]=_0x1a3b56[_0xd161('0x41')][_0xd161('0x43')]?_0x1a3b56[_0xd161('0x41')]:_0x28a429[_0xd161('0x3c')];_0x1a3b56[_0xd161('0x46')]=qs[_0xd161('0x47')](_0xd591ba[_0xd161('0x3e')][_0xd161('0x47')]);_0x1a3b56[_0xd161('0x4a')]=qs[_0xd161('0x3f')](_[_0xd161('0x48')](_0xd591ba[_0xd161('0x3e')],_0x28a429[_0xd161('0x3f')]));if(_0xd591ba[_0xd161('0x3e')]['filter']){_0x1a3b56[_0xd161('0x4a')]=_[_0xd161('0x55')](_0x1a3b56[_0xd161('0x4a')],{'$or':_['map'](_0x1a3b56[_0xd161('0x41')],function(_0x29d8c2){var _0x21918d={};_0x21918d[_0x29d8c2]={'$like':'%'+_0xd591ba[_0xd161('0x3e')][_0xd161('0x49')]+'%'};return _0x21918d;})});}_0x1a3b56=_[_0xd161('0x55')]({},_0x1a3b56,_0xd591ba['options']);return _0xa46935[_0xd161('0x59')](_0x1a3b56);}})[_0xd161('0x31')](function(_0xd69d1d){if(_0xd69d1d){_0x5c592c=_0xd69d1d[_0xd161('0x43')];if(!_0xd591ba[_0xd161('0x3e')][_0xd161('0x44')](_0xd161('0x45'))){_0x1a3b56[_0xd161('0x2b')]=qs[_0xd161('0x2b')](_0xd591ba[_0xd161('0x3e')][_0xd161('0x2b')]);_0x1a3b56['offset']=qs[_0xd161('0x2a')](_0xd591ba['query']['offset']);}return _0xa46935[_0xd161('0x59')](_0x1a3b56);}})[_0xd161('0x31')](function(_0x15d6f6){if(_0x15d6f6){return _0x15d6f6?{'count':_0x5c592c,'rows':_0x15d6f6}:null;}})[_0xd161('0x31')](respondWithResult(_0x140c68,null))['catch'](handleError(_0x140c68,null));};exports['addConfiguration']=function(_0xaf931a,_0x4af8dd,_0x3173b5){if(_0xaf931a['body']['id']){delete _0xaf931a[_0xd161('0x58')]['id'];}return db[_0xd161('0x37')][_0xd161('0x5a')]({'where':{'id':_0xaf931a[_0xd161('0x53')]['id']}})['then'](handleEntityNotFound(_0x4af8dd,null))[_0xd161('0x31')](function(_0x2d259e){if(_0x2d259e){_0xaf931a[_0xd161('0x58')][_0xd161('0x5c')]=_0x2d259e['id'];_0xaf931a[_0xd161('0x58')][_0xd161('0x5d')]=integrations[_0xd161('0x5e')](_0xaf931a[_0xd161('0x58')][_0xd161('0x5f')],_0xaf931a[_0xd161('0x58')]['type']);_0xaf931a[_0xd161('0x58')][_0xd161('0x60')]=integrations[_0xd161('0x61')](_0xaf931a['body'][_0xd161('0x5f')],_0xaf931a[_0xd161('0x58')][_0xd161('0x3a')]);return db[_0xd161('0x5b')][_0xd161('0x57')](_0xaf931a['body'],{'include':[{'model':db[_0xd161('0x62')],'as':_0xd161('0x5d')},{'model':db[_0xd161('0x62')],'as':_0xd161('0x60')}]});}return null;})[_0xd161('0x31')](respondWithResult(_0x4af8dd,null))[_0xd161('0x26')](handleError(_0x4af8dd,null));};exports['getFields']=function(_0x42d3cc,_0x3b79a6,_0xf6d5c0){var _0x2ecd7f=[_0xd161('0x63'),_0xd161('0x64'),'knowledge',_0xd161('0x65'),_0xd161('0x66'),_0xd161('0x67'),_0xd161('0x68'),'severity',_0xd161('0x69')];var _0x33f136=[_0xd161('0x6a'),_0xd161('0x63'),'caused_by',_0xd161('0x6b'),'upon_reject',_0xd161('0x6c'),_0xd161('0x6d'),_0xd161('0x64'),_0xd161('0x6e'),_0xd161('0x6f'),_0xd161('0x70'),_0xd161('0x71'),_0xd161('0x72'),_0xd161('0x73'),_0xd161('0x74'),_0xd161('0x75'),_0xd161('0x76'),_0xd161('0x77'),_0xd161('0x78'),_0xd161('0x46'),_0xd161('0x79'),_0xd161('0x7a'),_0xd161('0x7b'),_0xd161('0x7c'),'impact','active',_0xd161('0x7d'),_0xd161('0x7e'),'priority',_0xd161('0x7f'),_0xd161('0x80'),_0xd161('0x81'),_0xd161('0x82'),_0xd161('0x83'),_0xd161('0x84'),_0xd161('0x85'),_0xd161('0x86'),_0xd161('0x87'),'resolved_at',_0xd161('0x88'),_0xd161('0x89'),_0xd161('0x65'),'work_notes',_0xd161('0x8a'),'close_code',_0xd161('0x8b'),_0xd161('0x8c'),_0xd161('0x8d'),_0xd161('0x8e'),_0xd161('0x8f'),_0xd161('0x90'),_0xd161('0x91'),'calendar_duration',_0xd161('0x67'),_0xd161('0x92'),_0xd161('0x93'),_0xd161('0x94'),_0xd161('0x95'),'parent_incident',_0xd161('0x96'),_0xd161('0x97'),_0xd161('0x98'),'incident_state',_0xd161('0x99'),_0xd161('0x9a'),_0xd161('0x9b'),'reassignment_count','activity_due',_0xd161('0x9c'),_0xd161('0x9d'),'comments',_0xd161('0x9e'),_0xd161('0x9f'),_0xd161('0xa0'),_0xd161('0xa1'),_0xd161('0xa2'),'reopen_count',_0xd161('0xa3'),'escalation','upon_approval',_0xd161('0xa4'),_0xd161('0xa5'),'category'];var _0x34f129='';var _0x6d7ce9='';var _0x2e7786=[];var _0x17e42a='';var _0x134fb6='';var _0x1035be=[];var _0x41640c='';var _0x3b56e9='';var _0x4913b7={};var _0x1bff2e='';return db[_0xd161('0x37')][_0xd161('0x5a')]({'where':{'id':_0x42d3cc[_0xd161('0x53')]['id']},'attributes':['id',_0xd161('0xa6'),'password','email','remoteUri',_0xd161('0xa7')]})['then'](handleEntityNotFound(_0x3b79a6,null))[_0xd161('0x31')](function(_0x122171){if(_0x122171){_0x1bff2e=_0x122171[_0xd161('0xa8')];var _0x1882f3=_0x1bff2e[_0xd161('0xa9')](-0x1);if(_0x1882f3==='/'){_0x1bff2e=_0x1bff2e[_0xd161('0xaa')](0x0,_0x1bff2e[_0xd161('0xab')](_0x1882f3));}_0x3b56e9=util['format']('%s/api/now/doc/table/schema/',_0x1bff2e);_0x41640c=util[_0xd161('0xac')](_0xd161('0xad'),_0x1bff2e);_0x4913b7={'user':_0x122171[_0xd161('0xa6')],'pass':_0x122171[_0xd161('0xae')]};var _0x2cf3bc={'method':_0xd161('0xaf'),'uri':_0x3b56e9+'incident?sysparm_display_value=all','auth':_0x4913b7,'json':!![]};return rp(_0x2cf3bc);}})[_0xd161('0x31')](function(_0x68b675){if(_0x68b675['result'][_0xd161('0x43')]>0x0){_0x34f129=_0x68b675['result'];}console['log'](_0xd161('0xb0'),_0x34f129);_0x1035be=[];_0x6d7ce9=Object['assign']([],_0x34f129);_[_0xd161('0xb1')](_0x6d7ce9,function(_0xa636e1){return!_0x2ecd7f[_0xd161('0xb2')](_0xa636e1[_0xd161('0x34')]);});_0x6d7ce9[_0xd161('0xb3')](function(_0x28905e){var _0x47ed9f=createFieldObject(_0x41640c,_0x4913b7,_0x28905e[_0xd161('0xb4')],_0x28905e['name'],_0x28905e['label'],![]);_0x1035be[_0xd161('0xb5')](_0x47ed9f);});return Promise[_0xd161('0xb6')](_0x1035be);})[_0xd161('0x31')](function(_0x48ed5d){_0x2e7786=_0x48ed5d;_0x17e42a=Object[_0xd161('0xb7')]([],_0x34f129);console[_0xd161('0xb8')]('TCL:\x20_object',_0x34f129);_[_0xd161('0xb1')](_0x17e42a,function(_0x337454){return _0x33f136[_0xd161('0xb2')](_0x337454[_0xd161('0x34')]);});console['log'](_0xd161('0xb9'),_0x17e42a);_0x1035be=[];_0x17e42a[_0xd161('0xb3')](function(_0x47775c){var _0xc3c0d=createFieldObject(_0x41640c,_0x4913b7,_0x47775c[_0xd161('0xb4')],_0x47775c[_0xd161('0x34')],_0x47775c[_0xd161('0xba')],!![]);_0x1035be[_0xd161('0xb5')](_0xc3c0d);});return Promise[_0xd161('0xb6')](_0x1035be);})['then'](function(_0x10ab34){_0x134fb6=_0x10ab34;var _0x419de2=_0x2e7786[_0xd161('0xbb')](_0x134fb6);return{'count':_0x419de2[_0xd161('0x43')],'rows':_0x419de2};})[_0xd161('0x31')](respondWithResult(_0x3b79a6,null))[_0xd161('0x26')](function(_0x3cdfa2){console[_0xd161('0xb8')](_0xd161('0xbc')+_0x3cdfa2);var _0x583de6=_0x42d3cc[_0xd161('0x3e')][_0xd161('0xbd')]?0x1f4:_0x3cdfa2[_0xd161('0xbe')]||0x1f4;logger[_0xd161('0x23')](_0x3cdfa2[_0xd161('0x33')]);delete _0x3cdfa2[_0xd161('0x34')];if(_0x583de6===0x191){_0x583de6=0x190;}_0x3b79a6[_0xd161('0x27')](_0x583de6)[_0xd161('0x35')](_0x42d3cc[_0xd161('0x3e')]['test']?{'message':_0xd161('0xbf'),'statusCode':_0x3cdfa2[_0xd161('0xbe')]}:_0x3cdfa2);});};function createFieldObject(_0x2eec1a,_0x22db5c,_0x26ee80,_0x210f61,_0x5b2bcd,_0x2d6f70){return new Promise(function(_0x4ce29d,_0x386961){var _0x5aaec7={'id':_0x210f61,'name':_0x5b2bcd,'custom':_0x2d6f70};if(_0x26ee80===_0xd161('0xc0')){_0x5aaec7[_0xd161('0x4c')]=[{'name':'True','value':_0xd161('0xc1')},{'name':_0xd161('0xc2'),'value':_0xd161('0xc3')}];_0x4ce29d(_0x5aaec7);}else{var _0x481644={'method':_0xd161('0xaf'),'uri':_0x2eec1a+_0xd161('0xc4')+_0x210f61,'auth':_0x22db5c,'json':!![]};return rp(_0x481644)[_0xd161('0x31')](function(_0x32a08f){var _0x14aa75=[];if(_0x32a08f[_0xd161('0x25')][_0xd161('0x43')]>0x0){_0x32a08f[_0xd161('0x25')][_0xd161('0xb3')](function(_0x257e57){if(_0x257e57['inactive']===_0xd161('0xc3')){var _0x5ed678={'name':_0x257e57[_0xd161('0xba')],'value':_0x257e57[_0xd161('0xc5')]};_0x14aa75[_0xd161('0xb5')](_0x5ed678);}});}_0x5aaec7[_0xd161('0x4c')]=_0x14aa75;if(_0x5aaec7['options'][_0xd161('0x43')]>0x0){_0x4ce29d(_0x5aaec7);}else{if(_0x2d6f70==![]){_0x4ce29d();}else{_0x4ce29d(_0x5aaec7);}}});}});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js
index 9cb3903..87664f5 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.model.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f06=['rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','ServicenowAccount','lodash','util','moment','bluebird','request-promise'];(function(_0x36f76c,_0x111a33){var _0x14c483=function(_0x49062c){while(--_0x49062c){_0x36f76c['push'](_0x36f76c['shift']());}};_0x14c483(++_0x111a33);}(_0x1f06,0xb8));var _0x61f0=function(_0x18124a,_0x3d13a7){_0x18124a=_0x18124a-0x0;var _0x50262f=_0x1f06[_0x18124a];return _0x50262f;};'use strict';var _=require(_0x61f0('0x0'));var util=require(_0x61f0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x61f0('0x2'));var BPromise=require(_0x61f0('0x3'));var rp=require(_0x61f0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61f0('0x5'));var config=require('../../config/environment');var attributes=require(_0x61f0('0x6'));var integrations=require(_0x61f0('0x7'));module['exports']=function(_0x4322db,_0x292cc4){return _0x4322db['define'](_0x61f0('0x8'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x116b=['rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','lodash','util','api','moment','bluebird'];(function(_0x484a2f,_0x3dc5b8){var _0x5ad2ad=function(_0x545f7c){while(--_0x545f7c){_0x484a2f['push'](_0x484a2f['shift']());}};_0x5ad2ad(++_0x3dc5b8);}(_0x116b,0x91));var _0xb116=function(_0x5512ed,_0x38f4b6){_0x5512ed=_0x5512ed-0x0;var _0x31e432=_0x116b[_0x5512ed];return _0x31e432;};'use strict';var _=require(_0xb116('0x0'));var util=require(_0xb116('0x1'));var logger=require('../../config/logger')(_0xb116('0x2'));var moment=require(_0xb116('0x3'));var BPromise=require(_0xb116('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb116('0x5'));var config=require(_0xb116('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xb116('0x7'));module[_0xb116('0x8')]=function(_0x2fe5f2,_0x5925f9){return _0x2fe5f2['define'](_0xb116('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js
index 1b932a6..b4c6cd6 100644
--- a/server/api/intServicenowAccount/intServicenowAccount.rpc.js
+++ b/server/api/intServicenowAccount/intServicenowAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc5df=['ServicenowAccount,\x20%s,\x20%s','message','info','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','limit','include','model','attributes','map','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2c3287,_0x36e2ef){var _0xdeed9e=function(_0x290165){while(--_0x290165){_0x2c3287['push'](_0x2c3287['shift']());}};_0xdeed9e(++_0x36e2ef);}(_0xc5df,0x1b3));var _0xfc5d=function(_0x20cb0e,_0x4cd0f7){_0x20cb0e=_0x20cb0e-0x0;var _0x8be3e5=_0xc5df[_0x20cb0e];return _0x8be3e5;};'use strict';var _=require(_0xfc5d('0x0'));var util=require(_0xfc5d('0x1'));var moment=require(_0xfc5d('0x2'));var BPromise=require(_0xfc5d('0x3'));var rs=require(_0xfc5d('0x4'));var fs=require('fs');var Redis=require(_0xfc5d('0x5'));var db=require(_0xfc5d('0x6'))['db'];var utils=require(_0xfc5d('0x7'));var logger=require(_0xfc5d('0x8'))(_0xfc5d('0x9'));var config=require('../../config/environment');var jayson=require(_0xfc5d('0xa'));var client=jayson[_0xfc5d('0xb')][_0xfc5d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xea662b,_0x21f4ce,_0x10a318){return new BPromise(function(_0x5a7be4,_0x1283af){return client[_0xfc5d('0xd')](_0xea662b,_0x10a318)[_0xfc5d('0xe')](function(_0x39096d){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x21f4ce,_0xfc5d('0xf'));logger[_0xfc5d('0x10')](_0xfc5d('0x11'),_0x21f4ce,_0xfc5d('0xf'),JSON[_0xfc5d('0x12')](_0x39096d));if(_0x39096d[_0xfc5d('0x13')]){if(_0x39096d[_0xfc5d('0x13')][_0xfc5d('0x14')]===0x1f4){logger[_0xfc5d('0x13')](_0xfc5d('0x15'),_0x21f4ce,_0x39096d['error'][_0xfc5d('0x16')]);return _0x1283af(_0x39096d[_0xfc5d('0x13')][_0xfc5d('0x16')]);}logger[_0xfc5d('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x21f4ce,_0x39096d['error'][_0xfc5d('0x16')]);return _0x5a7be4(_0x39096d[_0xfc5d('0x13')][_0xfc5d('0x16')]);}else{logger[_0xfc5d('0x17')](_0xfc5d('0x15'),_0x21f4ce,_0xfc5d('0xf'));_0x5a7be4(_0x39096d['result'][_0xfc5d('0x16')]);}})[_0xfc5d('0x18')](function(_0x4d805d){logger['error'](_0xfc5d('0x15'),_0x21f4ce,_0x4d805d);_0x1283af(_0x4d805d);});});}exports[_0xfc5d('0x19')]=function(_0x2d0e5a){var _0x577055=this;return new Promise(function(_0x17fc1a,_0x3bb8a9){return db[_0xfc5d('0x1a')][_0xfc5d('0x1b')]({'raw':_0x2d0e5a[_0xfc5d('0x1c')]?_0x2d0e5a['options'][_0xfc5d('0x1d')]===undefined?!![]:![]:!![],'where':_0x2d0e5a[_0xfc5d('0x1c')]?_0x2d0e5a[_0xfc5d('0x1c')][_0xfc5d('0x1e')]||null:null,'attributes':_0x2d0e5a[_0xfc5d('0x1c')]?_0x2d0e5a[_0xfc5d('0x1c')]['attributes']||null:null,'limit':_0x2d0e5a['options']?_0x2d0e5a[_0xfc5d('0x1c')][_0xfc5d('0x1f')]||null:null,'include':_0x2d0e5a[_0xfc5d('0x1c')]?_0x2d0e5a[_0xfc5d('0x1c')][_0xfc5d('0x20')]?_['map'](_0x2d0e5a[_0xfc5d('0x1c')][_0xfc5d('0x20')],function(_0x38f469){return{'model':db[_0x38f469[_0xfc5d('0x21')]],'as':_0x38f469['as'],'attributes':_0x38f469[_0xfc5d('0x22')],'include':_0x38f469['include']?_[_0xfc5d('0x23')](_0x38f469[_0xfc5d('0x20')],function(_0x1996d8){return{'model':db[_0x1996d8[_0xfc5d('0x21')]],'as':_0x1996d8['as'],'attributes':_0x1996d8[_0xfc5d('0x22')],'include':_0x1996d8[_0xfc5d('0x20')]?_[_0xfc5d('0x23')](_0x1996d8[_0xfc5d('0x20')],function(_0x560b86){return{'model':db[_0x560b86[_0xfc5d('0x21')]],'as':_0x560b86['as'],'attributes':_0x560b86[_0xfc5d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfc5d('0xe')](function(_0x7f1894){logger[_0xfc5d('0x17')]('GetServicenowAccount',_0x2d0e5a);logger[_0xfc5d('0x10')](_0xfc5d('0x19'),_0x2d0e5a,JSON['stringify'](_0x7f1894));_0x17fc1a(_0x7f1894);})[_0xfc5d('0x18')](function(_0x48e329){logger[_0xfc5d('0x13')]('GetServicenowAccount',_0x48e329['message'],_0x2d0e5a);_0x3bb8a9(_0x577055[_0xfc5d('0x13')](0x1f4,_0x48e329[_0xfc5d('0x16')]));});});};exports[_0xfc5d('0x24')]=function(_0x103968){var _0x286def=this;return new Promise(function(_0x2263e7,_0x527bd0){return db[_0xfc5d('0x1a')][_0xfc5d('0x25')]({'raw':_0x103968[_0xfc5d('0x1c')]?_0x103968[_0xfc5d('0x1c')][_0xfc5d('0x1d')]===undefined?!![]:![]:!![],'where':_0x103968[_0xfc5d('0x1c')]?_0x103968[_0xfc5d('0x1c')][_0xfc5d('0x1e')]||null:null,'attributes':_0x103968[_0xfc5d('0x1c')]?_0x103968[_0xfc5d('0x1c')][_0xfc5d('0x22')]||null:null,'include':_0x103968[_0xfc5d('0x1c')]?_0x103968[_0xfc5d('0x1c')][_0xfc5d('0x20')]?_[_0xfc5d('0x23')](_0x103968[_0xfc5d('0x1c')][_0xfc5d('0x20')],function(_0x3bde51){return{'model':db[_0x3bde51['model']],'as':_0x3bde51['as'],'attributes':_0x3bde51[_0xfc5d('0x22')],'include':_0x3bde51['include']?_[_0xfc5d('0x23')](_0x3bde51[_0xfc5d('0x20')],function(_0x171320){return{'model':db[_0x171320[_0xfc5d('0x21')]],'as':_0x171320['as'],'attributes':_0x171320[_0xfc5d('0x22')],'include':_0x171320['include']?_['map'](_0x171320[_0xfc5d('0x20')],function(_0x16cc28){return{'model':db[_0x16cc28[_0xfc5d('0x21')]],'as':_0x16cc28['as'],'attributes':_0x16cc28['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc5d('0xe')](function(_0x1b53df){logger[_0xfc5d('0x17')](_0xfc5d('0x24'),_0x103968);logger['debug'](_0xfc5d('0x24'),_0x103968,JSON['stringify'](_0x1b53df));_0x2263e7(_0x1b53df);})[_0xfc5d('0x18')](function(_0x1cee5e){logger['error'](_0xfc5d('0x24'),_0x1cee5e['message'],_0x103968);_0x527bd0(_0x286def[_0xfc5d('0x13')](0x1f4,_0x1cee5e[_0xfc5d('0x16')]));});});};
\ No newline at end of file
+var _0xd697=['raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','include','map','model','attributes','ShowServicenowAccount'];(function(_0x488435,_0x15a36a){var _0x266b61=function(_0x5d81c3){while(--_0x5d81c3){_0x488435['push'](_0x488435['shift']());}};_0x266b61(++_0x15a36a);}(_0xd697,0x15f));var _0x7d69=function(_0x1d44f1,_0x16fc3f){_0x1d44f1=_0x1d44f1-0x0;var _0x1ad667=_0xd697[_0x1d44f1];return _0x1ad667;};'use strict';var _=require(_0x7d69('0x0'));var util=require(_0x7d69('0x1'));var moment=require(_0x7d69('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d69('0x3'));var fs=require('fs');var Redis=require(_0x7d69('0x4'));var db=require(_0x7d69('0x5'))['db'];var utils=require(_0x7d69('0x6'));var logger=require(_0x7d69('0x7'))(_0x7d69('0x8'));var config=require(_0x7d69('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d69('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cfcc6,_0x2e9b8d,_0x5436fe){return new BPromise(function(_0xb9f125,_0x448efc){return client[_0x7d69('0xb')](_0x2cfcc6,_0x5436fe)[_0x7d69('0xc')](function(_0x301cf1){logger[_0x7d69('0xd')](_0x7d69('0xe'),_0x2e9b8d,_0x7d69('0xf'));logger[_0x7d69('0x10')](_0x7d69('0x11'),_0x2e9b8d,_0x7d69('0xf'),JSON[_0x7d69('0x12')](_0x301cf1));if(_0x301cf1[_0x7d69('0x13')]){if(_0x301cf1[_0x7d69('0x13')][_0x7d69('0x14')]===0x1f4){logger['error'](_0x7d69('0xe'),_0x2e9b8d,_0x301cf1[_0x7d69('0x13')]['message']);return _0x448efc(_0x301cf1[_0x7d69('0x13')]['message']);}logger[_0x7d69('0x13')](_0x7d69('0xe'),_0x2e9b8d,_0x301cf1['error'][_0x7d69('0x15')]);return _0xb9f125(_0x301cf1[_0x7d69('0x13')][_0x7d69('0x15')]);}else{logger[_0x7d69('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x2e9b8d,'request\x20sent');_0xb9f125(_0x301cf1[_0x7d69('0x16')]['message']);}})[_0x7d69('0x17')](function(_0x4e7224){logger[_0x7d69('0x13')](_0x7d69('0xe'),_0x2e9b8d,_0x4e7224);_0x448efc(_0x4e7224);});});}exports[_0x7d69('0x18')]=function(_0x54f123){var _0x5989d4=this;return new Promise(function(_0x226ab6,_0x2b795f){return db[_0x7d69('0x19')][_0x7d69('0x1a')]({'raw':_0x54f123[_0x7d69('0x1b')]?_0x54f123['options']['raw']===undefined?!![]:![]:!![],'where':_0x54f123[_0x7d69('0x1b')]?_0x54f123[_0x7d69('0x1b')][_0x7d69('0x1c')]||null:null,'attributes':_0x54f123[_0x7d69('0x1b')]?_0x54f123[_0x7d69('0x1b')]['attributes']||null:null,'limit':_0x54f123[_0x7d69('0x1b')]?_0x54f123[_0x7d69('0x1b')]['limit']||null:null,'include':_0x54f123['options']?_0x54f123[_0x7d69('0x1b')][_0x7d69('0x1d')]?_[_0x7d69('0x1e')](_0x54f123[_0x7d69('0x1b')]['include'],function(_0x2ca927){return{'model':db[_0x2ca927[_0x7d69('0x1f')]],'as':_0x2ca927['as'],'attributes':_0x2ca927[_0x7d69('0x20')],'include':_0x2ca927['include']?_[_0x7d69('0x1e')](_0x2ca927[_0x7d69('0x1d')],function(_0x405b2a){return{'model':db[_0x405b2a[_0x7d69('0x1f')]],'as':_0x405b2a['as'],'attributes':_0x405b2a[_0x7d69('0x20')],'include':_0x405b2a[_0x7d69('0x1d')]?_[_0x7d69('0x1e')](_0x405b2a[_0x7d69('0x1d')],function(_0x3bea15){return{'model':db[_0x3bea15['model']],'as':_0x3bea15['as'],'attributes':_0x3bea15[_0x7d69('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7d69('0xc')](function(_0x3e1caa){logger[_0x7d69('0xd')]('GetServicenowAccount',_0x54f123);logger[_0x7d69('0x10')]('GetServicenowAccount',_0x54f123,JSON['stringify'](_0x3e1caa));_0x226ab6(_0x3e1caa);})[_0x7d69('0x17')](function(_0x283809){logger['error'](_0x7d69('0x18'),_0x283809[_0x7d69('0x15')],_0x54f123);_0x2b795f(_0x5989d4[_0x7d69('0x13')](0x1f4,_0x283809[_0x7d69('0x15')]));});});};exports[_0x7d69('0x21')]=function(_0x34a2aa){var _0x129f8f=this;return new Promise(function(_0x27aac5,_0x2bc64a){return db[_0x7d69('0x19')]['find']({'raw':_0x34a2aa['options']?_0x34a2aa[_0x7d69('0x1b')][_0x7d69('0x22')]===undefined?!![]:![]:!![],'where':_0x34a2aa[_0x7d69('0x1b')]?_0x34a2aa[_0x7d69('0x1b')][_0x7d69('0x1c')]||null:null,'attributes':_0x34a2aa[_0x7d69('0x1b')]?_0x34a2aa['options'][_0x7d69('0x20')]||null:null,'include':_0x34a2aa[_0x7d69('0x1b')]?_0x34a2aa[_0x7d69('0x1b')][_0x7d69('0x1d')]?_[_0x7d69('0x1e')](_0x34a2aa[_0x7d69('0x1b')][_0x7d69('0x1d')],function(_0x4dd2b6){return{'model':db[_0x4dd2b6[_0x7d69('0x1f')]],'as':_0x4dd2b6['as'],'attributes':_0x4dd2b6['attributes'],'include':_0x4dd2b6[_0x7d69('0x1d')]?_[_0x7d69('0x1e')](_0x4dd2b6[_0x7d69('0x1d')],function(_0x1e17c6){return{'model':db[_0x1e17c6[_0x7d69('0x1f')]],'as':_0x1e17c6['as'],'attributes':_0x1e17c6[_0x7d69('0x20')],'include':_0x1e17c6[_0x7d69('0x1d')]?_[_0x7d69('0x1e')](_0x1e17c6[_0x7d69('0x1d')],function(_0x3d1cf1){return{'model':db[_0x3d1cf1['model']],'as':_0x3d1cf1['as'],'attributes':_0x3d1cf1[_0x7d69('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7d69('0xc')](function(_0x4aef7c){logger[_0x7d69('0xd')]('ShowServicenowAccount',_0x34a2aa);logger[_0x7d69('0x10')](_0x7d69('0x21'),_0x34a2aa,JSON[_0x7d69('0x12')](_0x4aef7c));_0x27aac5(_0x4aef7c);})[_0x7d69('0x17')](function(_0x543e17){logger[_0x7d69('0x13')](_0x7d69('0x21'),_0x543e17[_0x7d69('0x15')],_0x34a2aa);_0x2bc64a(_0x129f8f['error'](0x1f4,_0x543e17[_0x7d69('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js
index 2c338f5..81cc01e 100644
--- a/server/api/intServicenowConfiguration/index.js
+++ b/server/api/intServicenowConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf03c=['util','path','express','Router','../../components/auth/service','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','post','delete','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf03c,0x1c1));var _0xcf03=function(_0x2d9c65,_0x59b62e){_0x2d9c65=_0x2d9c65-0x0;var _0x56118a=_0xf03c[_0x2d9c65];return _0x56118a;};'use strict';var multer=require(_0xcf03('0x0'));var util=require(_0xcf03('0x1'));var path=require(_0xcf03('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf03('0x3'));var router=express[_0xcf03('0x4')]();var auth=require(_0xcf03('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcf03('0x6'));router[_0xcf03('0x7')]('/',auth['isAuthenticated'](),controller[_0xcf03('0x8')]);router[_0xcf03('0x7')](_0xcf03('0x9'),auth[_0xcf03('0xa')](),controller[_0xcf03('0xb')]);router['get']('/:id/fields',auth[_0xcf03('0xa')](),controller[_0xcf03('0xc')]);router[_0xcf03('0x7')](_0xcf03('0xd'),auth[_0xcf03('0xa')](),controller[_0xcf03('0xe')]);router[_0xcf03('0x7')]('/:id/descriptions',auth[_0xcf03('0xa')](),controller['getDescriptions']);router[_0xcf03('0xf')]('/',auth[_0xcf03('0xa')](),controller['create']);router['put'](_0xcf03('0x9'),auth[_0xcf03('0xa')](),controller['update']);router[_0xcf03('0x10')](_0xcf03('0x9'),auth[_0xcf03('0xa')](),controller['destroy']);module[_0xcf03('0x11')]=router;
\ No newline at end of file
+var _0x4ad6=['../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','put','update','destroy','exports','path','express','../../components/auth/service'];(function(_0x1f8899,_0x1d3ff0){var _0x4e879d=function(_0x61490d){while(--_0x61490d){_0x1f8899['push'](_0x1f8899['shift']());}};_0x4e879d(++_0x1d3ff0);}(_0x4ad6,0xc9));var _0x64ad=function(_0x3325c4,_0x39657e){_0x3325c4=_0x3325c4-0x0;var _0x298b6b=_0x4ad6[_0x3325c4];return _0x298b6b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x64ad('0x0'));var timeout=require('connect-timeout');var express=require(_0x64ad('0x1'));var router=express['Router']();var auth=require(_0x64ad('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x64ad('0x3'));var controller=require('./intServicenowConfiguration.controller');router[_0x64ad('0x4')]('/',auth[_0x64ad('0x5')](),controller[_0x64ad('0x6')]);router[_0x64ad('0x4')](_0x64ad('0x7'),auth[_0x64ad('0x5')](),controller[_0x64ad('0x8')]);router[_0x64ad('0x4')]('/:id/fields',auth[_0x64ad('0x5')](),controller[_0x64ad('0x9')]);router[_0x64ad('0x4')](_0x64ad('0xa'),auth[_0x64ad('0x5')](),controller[_0x64ad('0xb')]);router[_0x64ad('0x4')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x64ad('0xc')]);router['post']('/',auth[_0x64ad('0x5')](),controller['create']);router[_0x64ad('0xd')](_0x64ad('0x7'),auth[_0x64ad('0x5')](),controller[_0x64ad('0xe')]);router['delete']('/:id',auth[_0x64ad('0x5')](),controller[_0x64ad('0xf')]);module[_0x64ad('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
index 6b05b55..0c7feff 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1d48=['exports','STRING'];(function(_0x1d7d0a,_0x4fc899){var _0x163fce=function(_0x5791ab){while(--_0x5791ab){_0x1d7d0a['push'](_0x1d7d0a['shift']());}};_0x163fce(++_0x4fc899);}(_0x1d48,0x1d6));var _0x81d4=function(_0xbdc673,_0x4a2d16){_0xbdc673=_0xbdc673-0x0;var _0x383eb9=_0x1d48[_0xbdc673];return _0x383eb9;};'use strict';var Sequelize=require('sequelize');module[_0x81d4('0x0')]={'name':{'type':Sequelize[_0x81d4('0x1')]},'description':{'type':Sequelize[_0x81d4('0x1')]}};
\ No newline at end of file
+var _0xaf2d=['sequelize','exports','STRING'];(function(_0x1eaa2b,_0xc218ed){var _0xefc94=function(_0x3cf20f){while(--_0x3cf20f){_0x1eaa2b['push'](_0x1eaa2b['shift']());}};_0xefc94(++_0xc218ed);}(_0xaf2d,0x1d4));var _0xdaf2=function(_0x1f64ab,_0x22517c){_0x1f64ab=_0x1f64ab-0x0;var _0x4dce75=_0xaf2d[_0x1f64ab];return _0x4dce75;};'use strict';var Sequelize=require(_0xdaf2('0x0'));module[_0xdaf2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdaf2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
index 1f7824a..818968e 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe511=['getFields','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','end','status','count','offset','Content-Range','json','apply','reject','save','then','sendStatus','stack','name','send','map','ServicenowConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','update','body','params','destroy','findOne','ServicenowField'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe511,0x16f));var _0x1e51=function(_0x1121fc,_0x3ad11a){_0x1121fc=_0x1121fc-0x0;var _0x7963c3=_0xe511[_0x1121fc];return _0x7963c3;};'use strict';var pdf=require(_0x1e51('0x0'));var emlformat=require(_0x1e51('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1e51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e51('0x3'));var moment=require(_0x1e51('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1e51('0x5'));var util=require(_0x1e51('0x6'));var path=require(_0x1e51('0x7'));var sox=require(_0x1e51('0x8'));var csv=require('to-csv');var ejs=require(_0x1e51('0x9'));var fs=require('fs');var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var db=require(_0x1e51('0x16'))['db'];var jayson=require(_0x1e51('0x17'));var client=jayson[_0x1e51('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x408a77,_0x102f01,_0x2acdf5){if(_0x2acdf5){var _0xcf297f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcf297f[_0x1e51('0x19')](_0x102f01)){return _0x408a77;}else{throw new db[(_0x1e51('0x1a'))][(_0x1e51('0x1b'))](_0x1e51('0x1c'));}}else{return _0x408a77;}}function respondWithRpcPromise(_0x1cc62a,_0xd76fba,_0x5a5c07,_0x3b01b7){return new BPromise(function(_0x24db4f,_0x4526b4){var _0x5857e2=_0x3b01b7||client;return _0x5857e2[_0x1e51('0x1d')](_0x1cc62a,_0x5a5c07)['then'](function(_0x53d222){logger[_0x1e51('0x1e')](_0x1e51('0x1f'),_0xd76fba,_0x1e51('0x20'));logger[_0x1e51('0x21')](_0x1e51('0x22'),_0xd76fba,_0x1e51('0x20'),JSON['stringify'](_0x53d222));if(_0x53d222[_0x1e51('0x23')]){if(_0x53d222['error'][_0x1e51('0x24')]===0x1f4){logger[_0x1e51('0x23')](_0x1e51('0x1f'),_0xd76fba,_0x53d222[_0x1e51('0x23')]['message']);return _0x4526b4(_0x53d222['error']['message']);}logger['error'](_0x1e51('0x1f'),_0xd76fba,_0x53d222['error'][_0x1e51('0x25')]);return _0x24db4f(_0x53d222[_0x1e51('0x23')][_0x1e51('0x25')]);}else{logger[_0x1e51('0x1e')](_0x1e51('0x1f'),_0xd76fba,_0x1e51('0x20'));_0x24db4f(_0x53d222[_0x1e51('0x26')][_0x1e51('0x25')]);}})['catch'](function(_0x4d04c0){logger[_0x1e51('0x23')](_0x1e51('0x1f'),_0xd76fba,_0x4d04c0);_0x4526b4(_0x4d04c0);});});}function respondWithStatusCode(_0x2e42b1,_0x1386db){_0x1386db=_0x1386db||0xcc;return function(_0x505d79){if(_0x505d79){return _0x2e42b1['sendStatus'](_0x1386db);}return _0x2e42b1['status'](_0x1386db)[_0x1e51('0x27')]();};}function respondWithResult(_0x2a1561,_0x433c2d){_0x433c2d=_0x433c2d||0xc8;return function(_0x5412bc){if(_0x5412bc){return _0x2a1561[_0x1e51('0x28')](_0x433c2d)['json'](_0x5412bc);}};}function respondWithFilteredResult(_0x5eccee,_0x3349f0){return function(_0x5c5bbd){if(_0x5c5bbd){var _0x170ec6=_0x5c5bbd[_0x1e51('0x29')],_0x1eb79f=_0x3349f0[_0x1e51('0x2a')],_0x56722f=_0x3349f0[_0x1e51('0x2a')]+_0x3349f0['limit'],_0x3e6ef2;if(_0x56722f>=_0x170ec6){_0x56722f=_0x170ec6;_0x3e6ef2=0xc8;}else{_0x3e6ef2=0xce;}_0x5eccee['status'](_0x3e6ef2);return _0x5eccee['set'](_0x1e51('0x2b'),_0x1eb79f+'-'+_0x56722f+'/'+_0x170ec6)[_0x1e51('0x2c')](_0x5c5bbd);}return null;};}function patchUpdates(_0x1ba84a){return function(_0x36dabe){try{jsonpatch[_0x1e51('0x2d')](_0x36dabe,_0x1ba84a,!![]);}catch(_0x27d9a2){return BPromise[_0x1e51('0x2e')](_0x27d9a2);}return _0x36dabe[_0x1e51('0x2f')]();};}function saveUpdates(_0x31b678,_0x3167b6){return function(_0x27b550){if(_0x27b550){return _0x27b550['update'](_0x31b678)[_0x1e51('0x30')](function(_0x366925){return _0x366925;});}return null;};}function removeEntity(_0x92707a,_0x12da89){return function(_0xcf6b2){if(_0xcf6b2){return _0xcf6b2['destroy']()[_0x1e51('0x30')](function(){_0x92707a['status'](0xcc)[_0x1e51('0x27')]();});}};}function handleEntityNotFound(_0x3fb57e,_0x1fbd06){return function(_0x59f405){if(!_0x59f405){_0x3fb57e[_0x1e51('0x31')](0x194);}return _0x59f405;};}function handleError(_0x58f8b1,_0x247de2){_0x247de2=_0x247de2||0x1f4;return function(_0x4e0187){logger['error'](_0x4e0187[_0x1e51('0x32')]);if(_0x4e0187[_0x1e51('0x33')]){delete _0x4e0187[_0x1e51('0x33')];}_0x58f8b1['status'](_0x247de2)[_0x1e51('0x34')](_0x4e0187);};}exports['index']=function(_0x3797a6,_0x2df269){var _0x5760ba={},_0xd4fd91={},_0x1bab7f={'count':0x0,'rows':[]};var _0x433cb1=_[_0x1e51('0x35')](db[_0x1e51('0x36')][_0x1e51('0x37')],function(_0x5c57a6){return{'name':_0x5c57a6['fieldName'],'type':_0x5c57a6[_0x1e51('0x38')]['key']};});_0xd4fd91[_0x1e51('0x39')]=_[_0x1e51('0x35')](_0x433cb1,_0x1e51('0x33'));_0xd4fd91[_0x1e51('0x3a')]=_[_0x1e51('0x3b')](_0x3797a6[_0x1e51('0x3a')]);_0xd4fd91[_0x1e51('0x3c')]=_[_0x1e51('0x3d')](_0xd4fd91[_0x1e51('0x39')],_0xd4fd91[_0x1e51('0x3a')]);_0x5760ba[_0x1e51('0x3e')]=_['intersection'](_0xd4fd91[_0x1e51('0x39')],qs['fields'](_0x3797a6[_0x1e51('0x3a')][_0x1e51('0x3f')]));_0x5760ba[_0x1e51('0x3e')]=_0x5760ba[_0x1e51('0x3e')][_0x1e51('0x40')]?_0x5760ba[_0x1e51('0x3e')]:_0xd4fd91[_0x1e51('0x39')];if(!_0x3797a6[_0x1e51('0x3a')][_0x1e51('0x41')](_0x1e51('0x42'))){_0x5760ba[_0x1e51('0x43')]=qs['limit'](_0x3797a6['query'][_0x1e51('0x43')]);_0x5760ba[_0x1e51('0x2a')]=qs[_0x1e51('0x2a')](_0x3797a6[_0x1e51('0x3a')][_0x1e51('0x2a')]);}_0x5760ba[_0x1e51('0x44')]=qs[_0x1e51('0x45')](_0x3797a6[_0x1e51('0x3a')]['sort']);_0x5760ba[_0x1e51('0x46')]=qs[_0x1e51('0x3c')](_[_0x1e51('0x47')](_0x3797a6[_0x1e51('0x3a')],_0xd4fd91[_0x1e51('0x3c')]),_0x433cb1);if(_0x3797a6[_0x1e51('0x3a')][_0x1e51('0x48')]){_0x5760ba['where']=_[_0x1e51('0x49')](_0x5760ba[_0x1e51('0x46')],{'$or':_['map'](_0x433cb1,function(_0xfd6521){if(_0xfd6521[_0x1e51('0x38')]!==_0x1e51('0x4a')){var _0x507d0c={};_0x507d0c[_0xfd6521[_0x1e51('0x33')]]={'$like':'%'+_0x3797a6[_0x1e51('0x3a')][_0x1e51('0x48')]+'%'};return _0x507d0c;}})});}_0x5760ba=_[_0x1e51('0x49')]({},_0x5760ba,_0x3797a6[_0x1e51('0x4b')]);var _0x3baebb={'where':_0x5760ba[_0x1e51('0x46')]};return db[_0x1e51('0x36')][_0x1e51('0x29')](_0x3baebb)['then'](function(_0x132625){_0x1bab7f[_0x1e51('0x29')]=_0x132625;if(_0x3797a6['query'][_0x1e51('0x4c')]){_0x5760ba[_0x1e51('0x4d')]=[{'all':!![]}];}return db[_0x1e51('0x36')]['findAll'](_0x5760ba);})[_0x1e51('0x30')](function(_0x4634de){_0x1bab7f[_0x1e51('0x4e')]=_0x4634de;return _0x1bab7f;})['then'](respondWithFilteredResult(_0x2df269,_0x5760ba))[_0x1e51('0x4f')](handleError(_0x2df269,null));};exports['show']=function(_0x581f7a,_0x54688b){var _0x169e6c={'raw':![],'where':{'id':_0x581f7a['params']['id']}},_0x2e79ca={};_0x2e79ca['model']=_[_0x1e51('0x3b')](db[_0x1e51('0x36')][_0x1e51('0x37')]);_0x2e79ca[_0x1e51('0x3a')]=_[_0x1e51('0x3b')](_0x581f7a[_0x1e51('0x3a')]);_0x2e79ca['filters']=_[_0x1e51('0x3d')](_0x2e79ca['model'],_0x2e79ca[_0x1e51('0x3a')]);_0x169e6c[_0x1e51('0x3e')]=_['intersection'](_0x2e79ca['model'],qs['fields'](_0x581f7a[_0x1e51('0x3a')][_0x1e51('0x3f')]));_0x169e6c[_0x1e51('0x3e')]=_0x169e6c['attributes'][_0x1e51('0x40')]?_0x169e6c[_0x1e51('0x3e')]:_0x2e79ca[_0x1e51('0x39')];if(_0x581f7a[_0x1e51('0x3a')][_0x1e51('0x4c')]){_0x169e6c[_0x1e51('0x4d')]=[{'all':!![]}];}_0x169e6c=_[_0x1e51('0x49')]({},_0x169e6c,_0x581f7a[_0x1e51('0x4b')]);return db['ServicenowConfiguration'][_0x1e51('0x50')](_0x169e6c)[_0x1e51('0x30')](handleEntityNotFound(_0x54688b,null))[_0x1e51('0x30')](respondWithResult(_0x54688b,null))[_0x1e51('0x4f')](handleError(_0x54688b,null));};exports[_0x1e51('0x51')]=function(_0x2a88db,_0x5ba6c2){return db[_0x1e51('0x36')]['create'](_0x2a88db['body'],{})['then'](respondWithResult(_0x5ba6c2,0xc9))[_0x1e51('0x4f')](handleError(_0x5ba6c2,null));};exports[_0x1e51('0x52')]=function(_0x4b2046,_0x56f9ba){if(_0x4b2046[_0x1e51('0x53')]['id']){delete _0x4b2046[_0x1e51('0x53')]['id'];}return db[_0x1e51('0x36')]['find']({'where':{'id':_0x4b2046[_0x1e51('0x54')]['id']}})[_0x1e51('0x30')](handleEntityNotFound(_0x56f9ba,null))[_0x1e51('0x30')](saveUpdates(_0x4b2046['body'],null))[_0x1e51('0x30')](respondWithResult(_0x56f9ba,null))[_0x1e51('0x4f')](handleError(_0x56f9ba,null));};exports[_0x1e51('0x55')]=function(_0x30ee67,_0x666ae9){return db[_0x1e51('0x36')][_0x1e51('0x50')]({'where':{'id':_0x30ee67[_0x1e51('0x54')]['id']}})['then'](handleEntityNotFound(_0x666ae9,null))[_0x1e51('0x30')](removeEntity(_0x666ae9,null))[_0x1e51('0x4f')](handleError(_0x666ae9,null));};exports['getFields']=function(_0x5a9d2a,_0x577b19,_0xa39f42){var _0x686433={};var _0x2ffd82={};var _0x3bdf55;var _0x18e9d1;return db[_0x1e51('0x36')][_0x1e51('0x56')]({'where':{'id':_0x5a9d2a[_0x1e51('0x54')]['id']}})[_0x1e51('0x30')](handleEntityNotFound(_0x577b19,null))['then'](function(_0x5acc97){if(_0x5acc97){_0x3bdf55=_0x5acc97;_0x2ffd82['model']=_[_0x1e51('0x3b')](db[_0x1e51('0x57')]['rawAttributes']);_0x2ffd82['query']=_[_0x1e51('0x3b')](_0x5a9d2a[_0x1e51('0x3a')]);_0x2ffd82['filters']=_[_0x1e51('0x3d')](_0x2ffd82[_0x1e51('0x39')],_0x2ffd82[_0x1e51('0x3a')]);_0x686433[_0x1e51('0x3e')]=_[_0x1e51('0x3d')](_0x2ffd82[_0x1e51('0x39')],qs[_0x1e51('0x3f')](_0x5a9d2a[_0x1e51('0x3a')][_0x1e51('0x3f')]));_0x686433[_0x1e51('0x3e')]=_0x686433['attributes'][_0x1e51('0x40')]?_0x686433[_0x1e51('0x3e')]:_0x2ffd82[_0x1e51('0x39')];_0x686433[_0x1e51('0x44')]=qs[_0x1e51('0x45')](_0x5a9d2a[_0x1e51('0x3a')]['sort']);_0x686433['where']=qs[_0x1e51('0x3c')](_[_0x1e51('0x47')](_0x5a9d2a[_0x1e51('0x3a')],_0x2ffd82[_0x1e51('0x3c')]));if(_0x5a9d2a['query']['filter']){_0x686433['where']=_[_0x1e51('0x49')](_0x686433[_0x1e51('0x46')],{'$or':_[_0x1e51('0x35')](_0x686433[_0x1e51('0x3e')],function(_0x184665){var _0x5c68b1={};_0x5c68b1[_0x184665]={'$like':'%'+_0x5a9d2a[_0x1e51('0x3a')][_0x1e51('0x48')]+'%'};return _0x5c68b1;})});}_0x686433=_[_0x1e51('0x49')]({},_0x686433,_0x5a9d2a['options']);return _0x3bdf55[_0x1e51('0x58')](_0x686433);}})[_0x1e51('0x30')](function(_0x45e607){if(_0x45e607){_0x18e9d1=_0x45e607['length'];if(!_0x5a9d2a[_0x1e51('0x3a')][_0x1e51('0x41')]('nolimit')){_0x686433['limit']=qs[_0x1e51('0x43')](_0x5a9d2a['query'][_0x1e51('0x43')]);_0x686433['offset']=qs[_0x1e51('0x2a')](_0x5a9d2a[_0x1e51('0x3a')][_0x1e51('0x2a')]);}return _0x3bdf55[_0x1e51('0x58')](_0x686433);}})['then'](function(_0x37f3e6){if(_0x37f3e6){return _0x37f3e6?{'count':_0x18e9d1,'rows':_0x37f3e6}:null;}})['then'](respondWithResult(_0x577b19,null))['catch'](handleError(_0x577b19,null));};exports[_0x1e51('0x59')]=function(_0x34ae65,_0x4aa76d,_0x4e69b5){var _0x1fc580={};var _0x25ce1d={};var _0x15f15b;var _0xbe8e21;return db['ServicenowConfiguration'][_0x1e51('0x56')]({'where':{'id':_0x34ae65['params']['id']}})['then'](handleEntityNotFound(_0x4aa76d,null))[_0x1e51('0x30')](function(_0x4f6e7b){if(_0x4f6e7b){_0x15f15b=_0x4f6e7b;_0x25ce1d[_0x1e51('0x39')]=_['keys'](db[_0x1e51('0x57')]['rawAttributes']);_0x25ce1d[_0x1e51('0x3a')]=_[_0x1e51('0x3b')](_0x34ae65['query']);_0x25ce1d[_0x1e51('0x3c')]=_['intersection'](_0x25ce1d[_0x1e51('0x39')],_0x25ce1d[_0x1e51('0x3a')]);_0x1fc580[_0x1e51('0x3e')]=_[_0x1e51('0x3d')](_0x25ce1d[_0x1e51('0x39')],qs[_0x1e51('0x3f')](_0x34ae65['query'][_0x1e51('0x3f')]));_0x1fc580['attributes']=_0x1fc580['attributes'][_0x1e51('0x40')]?_0x1fc580[_0x1e51('0x3e')]:_0x25ce1d[_0x1e51('0x39')];_0x1fc580[_0x1e51('0x44')]=qs[_0x1e51('0x45')](_0x34ae65[_0x1e51('0x3a')][_0x1e51('0x45')]);_0x1fc580['where']=qs[_0x1e51('0x3c')](_[_0x1e51('0x47')](_0x34ae65[_0x1e51('0x3a')],_0x25ce1d['filters']));if(_0x34ae65['query'][_0x1e51('0x48')]){_0x1fc580[_0x1e51('0x46')]=_['merge'](_0x1fc580[_0x1e51('0x46')],{'$or':_[_0x1e51('0x35')](_0x1fc580['attributes'],function(_0x5eb939){var _0xe96651={};_0xe96651[_0x5eb939]={'$like':'%'+_0x34ae65[_0x1e51('0x3a')][_0x1e51('0x48')]+'%'};return _0xe96651;})});}_0x1fc580=_[_0x1e51('0x49')]({},_0x1fc580,_0x34ae65[_0x1e51('0x4b')]);return _0x15f15b[_0x1e51('0x59')](_0x1fc580);}})[_0x1e51('0x30')](function(_0x56f13a){if(_0x56f13a){_0xbe8e21=_0x56f13a['length'];if(!_0x34ae65[_0x1e51('0x3a')][_0x1e51('0x41')]('nolimit')){_0x1fc580[_0x1e51('0x43')]=qs[_0x1e51('0x43')](_0x34ae65['query'][_0x1e51('0x43')]);_0x1fc580['offset']=qs[_0x1e51('0x2a')](_0x34ae65['query']['offset']);}return _0x15f15b['getSubjects'](_0x1fc580);}})['then'](function(_0x51ada3){if(_0x51ada3){return _0x51ada3?{'count':_0xbe8e21,'rows':_0x51ada3}:null;}})['then'](respondWithResult(_0x4aa76d,null))[_0x1e51('0x4f')](handleError(_0x4aa76d,null));};exports['getDescriptions']=function(_0xd05f32,_0x5682a6,_0x45d3b1){var _0x2ff3e5={};var _0xbb6872={};var _0x52d0ca;var _0x30336b;return db[_0x1e51('0x36')]['findOne']({'where':{'id':_0xd05f32[_0x1e51('0x54')]['id']}})['then'](handleEntityNotFound(_0x5682a6,null))[_0x1e51('0x30')](function(_0x5c4452){if(_0x5c4452){_0x52d0ca=_0x5c4452;_0xbb6872[_0x1e51('0x39')]=_[_0x1e51('0x3b')](db[_0x1e51('0x57')][_0x1e51('0x37')]);_0xbb6872[_0x1e51('0x3a')]=_[_0x1e51('0x3b')](_0xd05f32['query']);_0xbb6872[_0x1e51('0x3c')]=_['intersection'](_0xbb6872[_0x1e51('0x39')],_0xbb6872[_0x1e51('0x3a')]);_0x2ff3e5[_0x1e51('0x3e')]=_[_0x1e51('0x3d')](_0xbb6872['model'],qs['fields'](_0xd05f32['query'][_0x1e51('0x3f')]));_0x2ff3e5[_0x1e51('0x3e')]=_0x2ff3e5[_0x1e51('0x3e')][_0x1e51('0x40')]?_0x2ff3e5['attributes']:_0xbb6872[_0x1e51('0x39')];_0x2ff3e5['order']=qs[_0x1e51('0x45')](_0xd05f32['query']['sort']);_0x2ff3e5[_0x1e51('0x46')]=qs[_0x1e51('0x3c')](_['pick'](_0xd05f32[_0x1e51('0x3a')],_0xbb6872['filters']));if(_0xd05f32[_0x1e51('0x3a')]['filter']){_0x2ff3e5[_0x1e51('0x46')]=_[_0x1e51('0x49')](_0x2ff3e5['where'],{'$or':_[_0x1e51('0x35')](_0x2ff3e5['attributes'],function(_0x284348){var _0x29fc47={};_0x29fc47[_0x284348]={'$like':'%'+_0xd05f32[_0x1e51('0x3a')][_0x1e51('0x48')]+'%'};return _0x29fc47;})});}_0x2ff3e5=_['merge']({},_0x2ff3e5,_0xd05f32[_0x1e51('0x4b')]);return _0x52d0ca[_0x1e51('0x5a')](_0x2ff3e5);}})[_0x1e51('0x30')](function(_0x4ff0ff){if(_0x4ff0ff){_0x30336b=_0x4ff0ff['length'];if(!_0xd05f32[_0x1e51('0x3a')][_0x1e51('0x41')](_0x1e51('0x42'))){_0x2ff3e5['limit']=qs['limit'](_0xd05f32['query'][_0x1e51('0x43')]);_0x2ff3e5[_0x1e51('0x2a')]=qs[_0x1e51('0x2a')](_0xd05f32['query'][_0x1e51('0x2a')]);}return _0x52d0ca[_0x1e51('0x5a')](_0x2ff3e5);}})['then'](function(_0xd58339){if(_0xd58339){return _0xd58339?{'count':_0x30336b,'rows':_0xd58339}:null;}})[_0x1e51('0x30')](respondWithResult(_0x5682a6,null))[_0x1e51('0x4f')](handleError(_0x5682a6,null));};
\ No newline at end of file
+var _0x1eba=['fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','options','find','create','body','params','getFields','findOne','nolimit','getSubjects','ServicenowField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x2ef7f0,_0x514677){var _0x219fcc=function(_0x54d037){while(--_0x54d037){_0x2ef7f0['push'](_0x2ef7f0['shift']());}};_0x219fcc(++_0x514677);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x1eba[_0x2ce6d5];return _0x32d272;};'use strict';var pdf=require(_0xa1eb('0x0'));var emlformat=require(_0xa1eb('0x1'));var rimraf=require(_0xa1eb('0x2'));var zipdir=require(_0xa1eb('0x3'));var jsonpatch=require(_0xa1eb('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa1eb('0x5'));var Mustache=require(_0xa1eb('0x6'));var util=require(_0xa1eb('0x7'));var path=require(_0xa1eb('0x8'));var sox=require(_0xa1eb('0x9'));var csv=require(_0xa1eb('0xa'));var ejs=require(_0xa1eb('0xb'));var fs=require('fs');var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa1eb('0x18'));var client=jayson[_0xa1eb('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x16a623,_0x4a3774,_0x4e65dc){if(_0x4e65dc){var _0x35a353=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35a353['test'](_0x4a3774)){return _0x16a623;}else{throw new db[(_0xa1eb('0x1a'))][(_0xa1eb('0x1b'))](_0xa1eb('0x1c'));}}else{return _0x16a623;}}function respondWithRpcPromise(_0x2877cb,_0x3cd675,_0x44f37d,_0x1c858c){return new BPromise(function(_0x45d6dd,_0x211e42){var _0x4aa527=_0x1c858c||client;return _0x4aa527[_0xa1eb('0x1d')](_0x2877cb,_0x44f37d)['then'](function(_0x1401ef){logger[_0xa1eb('0x1e')](_0xa1eb('0x1f'),_0x3cd675,_0xa1eb('0x20'));logger['debug'](_0xa1eb('0x21'),_0x3cd675,_0xa1eb('0x20'),JSON[_0xa1eb('0x22')](_0x1401ef));if(_0x1401ef[_0xa1eb('0x23')]){if(_0x1401ef[_0xa1eb('0x23')][_0xa1eb('0x24')]===0x1f4){logger[_0xa1eb('0x23')](_0xa1eb('0x1f'),_0x3cd675,_0x1401ef['error'][_0xa1eb('0x25')]);return _0x211e42(_0x1401ef['error'][_0xa1eb('0x25')]);}logger[_0xa1eb('0x23')](_0xa1eb('0x1f'),_0x3cd675,_0x1401ef[_0xa1eb('0x23')]['message']);return _0x45d6dd(_0x1401ef['error'][_0xa1eb('0x25')]);}else{logger[_0xa1eb('0x1e')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3cd675,_0xa1eb('0x20'));_0x45d6dd(_0x1401ef[_0xa1eb('0x26')][_0xa1eb('0x25')]);}})[_0xa1eb('0x27')](function(_0x23b49e){logger[_0xa1eb('0x23')](_0xa1eb('0x1f'),_0x3cd675,_0x23b49e);_0x211e42(_0x23b49e);});});}function respondWithStatusCode(_0x364b1c,_0xd7bb88){_0xd7bb88=_0xd7bb88||0xcc;return function(_0x352796){if(_0x352796){return _0x364b1c[_0xa1eb('0x28')](_0xd7bb88);}return _0x364b1c[_0xa1eb('0x29')](_0xd7bb88)['end']();};}function respondWithResult(_0x7c617e,_0xbd5517){_0xbd5517=_0xbd5517||0xc8;return function(_0x491f37){if(_0x491f37){return _0x7c617e[_0xa1eb('0x29')](_0xbd5517)['json'](_0x491f37);}};}function respondWithFilteredResult(_0x3aae71,_0x2d31d1){return function(_0x53a890){if(_0x53a890){var _0x45ff0d=_0x53a890[_0xa1eb('0x2a')],_0x1581ee=_0x2d31d1[_0xa1eb('0x2b')],_0x136835=_0x2d31d1['offset']+_0x2d31d1[_0xa1eb('0x2c')],_0x4f64bb;if(_0x136835>=_0x45ff0d){_0x136835=_0x45ff0d;_0x4f64bb=0xc8;}else{_0x4f64bb=0xce;}_0x3aae71[_0xa1eb('0x29')](_0x4f64bb);return _0x3aae71[_0xa1eb('0x2d')](_0xa1eb('0x2e'),_0x1581ee+'-'+_0x136835+'/'+_0x45ff0d)[_0xa1eb('0x2f')](_0x53a890);}return null;};}function patchUpdates(_0x52f9c7){return function(_0x9d49d8){try{jsonpatch[_0xa1eb('0x30')](_0x9d49d8,_0x52f9c7,!![]);}catch(_0x198fdb){return BPromise[_0xa1eb('0x31')](_0x198fdb);}return _0x9d49d8[_0xa1eb('0x32')]();};}function saveUpdates(_0xcd9efd,_0x1d5b64){return function(_0xcfda64){if(_0xcfda64){return _0xcfda64[_0xa1eb('0x33')](_0xcd9efd)[_0xa1eb('0x34')](function(_0x4345a3){return _0x4345a3;});}return null;};}function removeEntity(_0x4fdba4,_0x563b11){return function(_0x126d50){if(_0x126d50){return _0x126d50[_0xa1eb('0x35')]()[_0xa1eb('0x34')](function(){_0x4fdba4[_0xa1eb('0x29')](0xcc)[_0xa1eb('0x36')]();});}};}function handleEntityNotFound(_0x58d336,_0x49ddb9){return function(_0x151446){if(!_0x151446){_0x58d336[_0xa1eb('0x28')](0x194);}return _0x151446;};}function handleError(_0x516c14,_0x48b23d){_0x48b23d=_0x48b23d||0x1f4;return function(_0x3761bf){logger['error'](_0x3761bf[_0xa1eb('0x37')]);if(_0x3761bf['name']){delete _0x3761bf[_0xa1eb('0x38')];}_0x516c14[_0xa1eb('0x29')](_0x48b23d)[_0xa1eb('0x39')](_0x3761bf);};}exports['index']=function(_0x355839,_0x3d59b9){var _0x35ed30={},_0x481405={},_0x140f1e={'count':0x0,'rows':[]};var _0x27273a=_[_0xa1eb('0x3a')](db[_0xa1eb('0x3b')][_0xa1eb('0x3c')],function(_0x5912d5){return{'name':_0x5912d5[_0xa1eb('0x3d')],'type':_0x5912d5[_0xa1eb('0x3e')][_0xa1eb('0x3f')]};});_0x481405[_0xa1eb('0x40')]=_[_0xa1eb('0x3a')](_0x27273a,_0xa1eb('0x38'));_0x481405[_0xa1eb('0x41')]=_[_0xa1eb('0x42')](_0x355839['query']);_0x481405[_0xa1eb('0x43')]=_[_0xa1eb('0x44')](_0x481405[_0xa1eb('0x40')],_0x481405[_0xa1eb('0x41')]);_0x35ed30[_0xa1eb('0x45')]=_['intersection'](_0x481405[_0xa1eb('0x40')],qs[_0xa1eb('0x46')](_0x355839[_0xa1eb('0x41')]['fields']));_0x35ed30[_0xa1eb('0x45')]=_0x35ed30[_0xa1eb('0x45')][_0xa1eb('0x47')]?_0x35ed30[_0xa1eb('0x45')]:_0x481405[_0xa1eb('0x40')];if(!_0x355839[_0xa1eb('0x41')][_0xa1eb('0x48')]('nolimit')){_0x35ed30[_0xa1eb('0x2c')]=qs[_0xa1eb('0x2c')](_0x355839['query'][_0xa1eb('0x2c')]);_0x35ed30['offset']=qs[_0xa1eb('0x2b')](_0x355839[_0xa1eb('0x41')][_0xa1eb('0x2b')]);}_0x35ed30[_0xa1eb('0x49')]=qs[_0xa1eb('0x4a')](_0x355839[_0xa1eb('0x41')][_0xa1eb('0x4a')]);_0x35ed30[_0xa1eb('0x4b')]=qs[_0xa1eb('0x43')](_[_0xa1eb('0x4c')](_0x355839[_0xa1eb('0x41')],_0x481405[_0xa1eb('0x43')]),_0x27273a);if(_0x355839[_0xa1eb('0x41')][_0xa1eb('0x4d')]){_0x35ed30[_0xa1eb('0x4b')]=_[_0xa1eb('0x4e')](_0x35ed30['where'],{'$or':_[_0xa1eb('0x3a')](_0x27273a,function(_0x4fd053){if(_0x4fd053[_0xa1eb('0x3e')]!==_0xa1eb('0x4f')){var _0x54a29f={};_0x54a29f[_0x4fd053['name']]={'$like':'%'+_0x355839[_0xa1eb('0x41')][_0xa1eb('0x4d')]+'%'};return _0x54a29f;}})});}_0x35ed30=_[_0xa1eb('0x4e')]({},_0x35ed30,_0x355839['options']);var _0x267893={'where':_0x35ed30[_0xa1eb('0x4b')]};return db[_0xa1eb('0x3b')][_0xa1eb('0x2a')](_0x267893)[_0xa1eb('0x34')](function(_0x6f47c5){_0x140f1e[_0xa1eb('0x2a')]=_0x6f47c5;if(_0x355839[_0xa1eb('0x41')][_0xa1eb('0x50')]){_0x35ed30[_0xa1eb('0x51')]=[{'all':!![]}];}return db[_0xa1eb('0x3b')][_0xa1eb('0x52')](_0x35ed30);})[_0xa1eb('0x34')](function(_0x10e15a){_0x140f1e['rows']=_0x10e15a;return _0x140f1e;})[_0xa1eb('0x34')](respondWithFilteredResult(_0x3d59b9,_0x35ed30))[_0xa1eb('0x27')](handleError(_0x3d59b9,null));};exports[_0xa1eb('0x53')]=function(_0x977d00,_0x2b0cbf){var _0x12dfd4={'raw':![],'where':{'id':_0x977d00['params']['id']}},_0x2374c0={};_0x2374c0[_0xa1eb('0x40')]=_[_0xa1eb('0x42')](db[_0xa1eb('0x3b')][_0xa1eb('0x3c')]);_0x2374c0[_0xa1eb('0x41')]=_[_0xa1eb('0x42')](_0x977d00[_0xa1eb('0x41')]);_0x2374c0[_0xa1eb('0x43')]=_[_0xa1eb('0x44')](_0x2374c0['model'],_0x2374c0[_0xa1eb('0x41')]);_0x12dfd4['attributes']=_[_0xa1eb('0x44')](_0x2374c0['model'],qs[_0xa1eb('0x46')](_0x977d00[_0xa1eb('0x41')][_0xa1eb('0x46')]));_0x12dfd4['attributes']=_0x12dfd4[_0xa1eb('0x45')][_0xa1eb('0x47')]?_0x12dfd4['attributes']:_0x2374c0[_0xa1eb('0x40')];if(_0x977d00[_0xa1eb('0x41')][_0xa1eb('0x50')]){_0x12dfd4[_0xa1eb('0x51')]=[{'all':!![]}];}_0x12dfd4=_[_0xa1eb('0x4e')]({},_0x12dfd4,_0x977d00[_0xa1eb('0x54')]);return db[_0xa1eb('0x3b')][_0xa1eb('0x55')](_0x12dfd4)[_0xa1eb('0x34')](handleEntityNotFound(_0x2b0cbf,null))[_0xa1eb('0x34')](respondWithResult(_0x2b0cbf,null))[_0xa1eb('0x27')](handleError(_0x2b0cbf,null));};exports[_0xa1eb('0x56')]=function(_0x159a19,_0x260c4a){return db[_0xa1eb('0x3b')][_0xa1eb('0x56')](_0x159a19[_0xa1eb('0x57')],{})['then'](respondWithResult(_0x260c4a,0xc9))[_0xa1eb('0x27')](handleError(_0x260c4a,null));};exports[_0xa1eb('0x33')]=function(_0x2161ed,_0x1085ca){if(_0x2161ed[_0xa1eb('0x57')]['id']){delete _0x2161ed[_0xa1eb('0x57')]['id'];}return db['ServicenowConfiguration'][_0xa1eb('0x55')]({'where':{'id':_0x2161ed[_0xa1eb('0x58')]['id']}})[_0xa1eb('0x34')](handleEntityNotFound(_0x1085ca,null))[_0xa1eb('0x34')](saveUpdates(_0x2161ed[_0xa1eb('0x57')],null))[_0xa1eb('0x34')](respondWithResult(_0x1085ca,null))[_0xa1eb('0x27')](handleError(_0x1085ca,null));};exports['destroy']=function(_0x257236,_0xdebe47){return db[_0xa1eb('0x3b')][_0xa1eb('0x55')]({'where':{'id':_0x257236['params']['id']}})['then'](handleEntityNotFound(_0xdebe47,null))['then'](removeEntity(_0xdebe47,null))['catch'](handleError(_0xdebe47,null));};exports[_0xa1eb('0x59')]=function(_0x1e1e5d,_0x591907,_0x4643f3){var _0x3e2d2f={};var _0x262b22={};var _0x167be2;var _0x4edf8e;return db['ServicenowConfiguration'][_0xa1eb('0x5a')]({'where':{'id':_0x1e1e5d[_0xa1eb('0x58')]['id']}})[_0xa1eb('0x34')](handleEntityNotFound(_0x591907,null))[_0xa1eb('0x34')](function(_0x3203c6){if(_0x3203c6){_0x167be2=_0x3203c6;_0x262b22[_0xa1eb('0x40')]=_['keys'](db['ServicenowField'][_0xa1eb('0x3c')]);_0x262b22['query']=_[_0xa1eb('0x42')](_0x1e1e5d['query']);_0x262b22[_0xa1eb('0x43')]=_[_0xa1eb('0x44')](_0x262b22['model'],_0x262b22[_0xa1eb('0x41')]);_0x3e2d2f[_0xa1eb('0x45')]=_['intersection'](_0x262b22[_0xa1eb('0x40')],qs[_0xa1eb('0x46')](_0x1e1e5d[_0xa1eb('0x41')]['fields']));_0x3e2d2f[_0xa1eb('0x45')]=_0x3e2d2f[_0xa1eb('0x45')]['length']?_0x3e2d2f[_0xa1eb('0x45')]:_0x262b22[_0xa1eb('0x40')];_0x3e2d2f[_0xa1eb('0x49')]=qs['sort'](_0x1e1e5d[_0xa1eb('0x41')]['sort']);_0x3e2d2f[_0xa1eb('0x4b')]=qs[_0xa1eb('0x43')](_[_0xa1eb('0x4c')](_0x1e1e5d[_0xa1eb('0x41')],_0x262b22[_0xa1eb('0x43')]));if(_0x1e1e5d['query'][_0xa1eb('0x4d')]){_0x3e2d2f[_0xa1eb('0x4b')]=_[_0xa1eb('0x4e')](_0x3e2d2f['where'],{'$or':_[_0xa1eb('0x3a')](_0x3e2d2f['attributes'],function(_0x4e582c){var _0x4e5e70={};_0x4e5e70[_0x4e582c]={'$like':'%'+_0x1e1e5d['query'][_0xa1eb('0x4d')]+'%'};return _0x4e5e70;})});}_0x3e2d2f=_[_0xa1eb('0x4e')]({},_0x3e2d2f,_0x1e1e5d[_0xa1eb('0x54')]);return _0x167be2[_0xa1eb('0x59')](_0x3e2d2f);}})[_0xa1eb('0x34')](function(_0x99ce4f){if(_0x99ce4f){_0x4edf8e=_0x99ce4f[_0xa1eb('0x47')];if(!_0x1e1e5d[_0xa1eb('0x41')][_0xa1eb('0x48')](_0xa1eb('0x5b'))){_0x3e2d2f['limit']=qs[_0xa1eb('0x2c')](_0x1e1e5d[_0xa1eb('0x41')][_0xa1eb('0x2c')]);_0x3e2d2f[_0xa1eb('0x2b')]=qs[_0xa1eb('0x2b')](_0x1e1e5d[_0xa1eb('0x41')]['offset']);}return _0x167be2[_0xa1eb('0x59')](_0x3e2d2f);}})[_0xa1eb('0x34')](function(_0x16c5a3){if(_0x16c5a3){return _0x16c5a3?{'count':_0x4edf8e,'rows':_0x16c5a3}:null;}})['then'](respondWithResult(_0x591907,null))[_0xa1eb('0x27')](handleError(_0x591907,null));};exports[_0xa1eb('0x5c')]=function(_0x1403cf,_0xf39210,_0x197e38){var _0x540746={};var _0x2eca4e={};var _0x50eff6;var _0x2597de;return db['ServicenowConfiguration'][_0xa1eb('0x5a')]({'where':{'id':_0x1403cf[_0xa1eb('0x58')]['id']}})[_0xa1eb('0x34')](handleEntityNotFound(_0xf39210,null))[_0xa1eb('0x34')](function(_0x47c618){if(_0x47c618){_0x50eff6=_0x47c618;_0x2eca4e[_0xa1eb('0x40')]=_[_0xa1eb('0x42')](db[_0xa1eb('0x5d')][_0xa1eb('0x3c')]);_0x2eca4e['query']=_[_0xa1eb('0x42')](_0x1403cf[_0xa1eb('0x41')]);_0x2eca4e[_0xa1eb('0x43')]=_[_0xa1eb('0x44')](_0x2eca4e[_0xa1eb('0x40')],_0x2eca4e[_0xa1eb('0x41')]);_0x540746[_0xa1eb('0x45')]=_[_0xa1eb('0x44')](_0x2eca4e[_0xa1eb('0x40')],qs['fields'](_0x1403cf['query']['fields']));_0x540746[_0xa1eb('0x45')]=_0x540746['attributes'][_0xa1eb('0x47')]?_0x540746[_0xa1eb('0x45')]:_0x2eca4e['model'];_0x540746['order']=qs[_0xa1eb('0x4a')](_0x1403cf[_0xa1eb('0x41')][_0xa1eb('0x4a')]);_0x540746[_0xa1eb('0x4b')]=qs[_0xa1eb('0x43')](_['pick'](_0x1403cf['query'],_0x2eca4e[_0xa1eb('0x43')]));if(_0x1403cf[_0xa1eb('0x41')][_0xa1eb('0x4d')]){_0x540746[_0xa1eb('0x4b')]=_['merge'](_0x540746[_0xa1eb('0x4b')],{'$or':_[_0xa1eb('0x3a')](_0x540746[_0xa1eb('0x45')],function(_0x4050d6){var _0x3863ce={};_0x3863ce[_0x4050d6]={'$like':'%'+_0x1403cf[_0xa1eb('0x41')][_0xa1eb('0x4d')]+'%'};return _0x3863ce;})});}_0x540746=_[_0xa1eb('0x4e')]({},_0x540746,_0x1403cf[_0xa1eb('0x54')]);return _0x50eff6[_0xa1eb('0x5c')](_0x540746);}})[_0xa1eb('0x34')](function(_0x4fa17f){if(_0x4fa17f){_0x2597de=_0x4fa17f[_0xa1eb('0x47')];if(!_0x1403cf[_0xa1eb('0x41')][_0xa1eb('0x48')](_0xa1eb('0x5b'))){_0x540746[_0xa1eb('0x2c')]=qs[_0xa1eb('0x2c')](_0x1403cf['query'][_0xa1eb('0x2c')]);_0x540746[_0xa1eb('0x2b')]=qs[_0xa1eb('0x2b')](_0x1403cf[_0xa1eb('0x41')]['offset']);}return _0x50eff6['getSubjects'](_0x540746);}})[_0xa1eb('0x34')](function(_0x5e0cd5){if(_0x5e0cd5){return _0x5e0cd5?{'count':_0x2597de,'rows':_0x5e0cd5}:null;}})[_0xa1eb('0x34')](respondWithResult(_0xf39210,null))[_0xa1eb('0x27')](handleError(_0xf39210,null));};exports['getDescriptions']=function(_0x2f9822,_0x1b01f9,_0x525498){var _0x355058={};var _0x3a6be1={};var _0x3dc3bf;var _0x2d54e9;return db[_0xa1eb('0x3b')][_0xa1eb('0x5a')]({'where':{'id':_0x2f9822[_0xa1eb('0x58')]['id']}})[_0xa1eb('0x34')](handleEntityNotFound(_0x1b01f9,null))[_0xa1eb('0x34')](function(_0x64943f){if(_0x64943f){_0x3dc3bf=_0x64943f;_0x3a6be1[_0xa1eb('0x40')]=_['keys'](db[_0xa1eb('0x5d')][_0xa1eb('0x3c')]);_0x3a6be1[_0xa1eb('0x41')]=_[_0xa1eb('0x42')](_0x2f9822['query']);_0x3a6be1[_0xa1eb('0x43')]=_[_0xa1eb('0x44')](_0x3a6be1[_0xa1eb('0x40')],_0x3a6be1['query']);_0x355058[_0xa1eb('0x45')]=_[_0xa1eb('0x44')](_0x3a6be1[_0xa1eb('0x40')],qs['fields'](_0x2f9822[_0xa1eb('0x41')]['fields']));_0x355058[_0xa1eb('0x45')]=_0x355058[_0xa1eb('0x45')][_0xa1eb('0x47')]?_0x355058[_0xa1eb('0x45')]:_0x3a6be1[_0xa1eb('0x40')];_0x355058[_0xa1eb('0x49')]=qs[_0xa1eb('0x4a')](_0x2f9822[_0xa1eb('0x41')]['sort']);_0x355058[_0xa1eb('0x4b')]=qs[_0xa1eb('0x43')](_[_0xa1eb('0x4c')](_0x2f9822[_0xa1eb('0x41')],_0x3a6be1[_0xa1eb('0x43')]));if(_0x2f9822['query'][_0xa1eb('0x4d')]){_0x355058[_0xa1eb('0x4b')]=_['merge'](_0x355058[_0xa1eb('0x4b')],{'$or':_['map'](_0x355058['attributes'],function(_0x29f795){var _0x22f25d={};_0x22f25d[_0x29f795]={'$like':'%'+_0x2f9822['query'][_0xa1eb('0x4d')]+'%'};return _0x22f25d;})});}_0x355058=_[_0xa1eb('0x4e')]({},_0x355058,_0x2f9822['options']);return _0x3dc3bf[_0xa1eb('0x5e')](_0x355058);}})[_0xa1eb('0x34')](function(_0x4d2598){if(_0x4d2598){_0x2d54e9=_0x4d2598['length'];if(!_0x2f9822[_0xa1eb('0x41')]['hasOwnProperty'](_0xa1eb('0x5b'))){_0x355058[_0xa1eb('0x2c')]=qs[_0xa1eb('0x2c')](_0x2f9822[_0xa1eb('0x41')][_0xa1eb('0x2c')]);_0x355058[_0xa1eb('0x2b')]=qs['offset'](_0x2f9822[_0xa1eb('0x41')]['offset']);}return _0x3dc3bf[_0xa1eb('0x5e')](_0x355058);}})[_0xa1eb('0x34')](function(_0x3ca0ee){if(_0x3ca0ee){return _0x3ca0ee?{'count':_0x2d54e9,'rows':_0x3ca0ee}:null;}})[_0xa1eb('0x34')](respondWithResult(_0x1b01f9,null))[_0xa1eb('0x27')](handleError(_0x1b01f9,null));};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
index 5cb113b..a48a0ad 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x01ed=['int_servicenow_configurations','util','../../config/logger','api','moment','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define'];(function(_0x30c710,_0x109af3){var _0x43dcf2=function(_0x4dfde2){while(--_0x4dfde2){_0x30c710['push'](_0x30c710['shift']());}};_0x43dcf2(++_0x109af3);}(_0x01ed,0x119));var _0xd01e=function(_0xbb7389,_0x12b29d){_0xbb7389=_0xbb7389-0x0;var _0x12537b=_0x01ed[_0xbb7389];return _0x12537b;};'use strict';var _=require('lodash');var util=require(_0xd01e('0x0'));var logger=require(_0xd01e('0x1'))(_0xd01e('0x2'));var moment=require(_0xd01e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd01e('0x4'));var rimraf=require('rimraf');var config=require(_0xd01e('0x5'));var attributes=require(_0xd01e('0x6'));module[_0xd01e('0x7')]=function(_0x4624c7,_0x43bc91){return _0x4624c7[_0xd01e('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0xd01e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4288=['moment','bluebird','path','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger'];(function(_0x33ca2e,_0x1a5d92){var _0x49fb30=function(_0x147074){while(--_0x147074){_0x33ca2e['push'](_0x33ca2e['shift']());}};_0x49fb30(++_0x1a5d92);}(_0x4288,0xb8));var _0x8428=function(_0xe4733d,_0x585e23){_0xe4733d=_0xe4733d-0x0;var _0x309d44=_0x4288[_0xe4733d];return _0x309d44;};'use strict';var _=require(_0x8428('0x0'));var util=require(_0x8428('0x1'));var logger=require(_0x8428('0x2'))('api');var moment=require(_0x8428('0x3'));var BPromise=require(_0x8428('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8428('0x5'));var rimraf=require('rimraf');var config=require(_0x8428('0x6'));var attributes=require(_0x8428('0x7'));module['exports']=function(_0x2e63c5,_0x651a26){return _0x2e63c5[_0x8428('0x8')](_0x8428('0x9'),attributes,{'tableName':_0x8428('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
index af76f87..cce7e9d 100644
--- a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
+++ b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0c3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','randomstring','ioredis'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xe0c3,0x1f4));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3e0c('0x0'));var moment=require(_0x3e0c('0x1'));var BPromise=require('bluebird');var rs=require(_0x3e0c('0x2'));var fs=require('fs');var Redis=require(_0x3e0c('0x3'));var db=require(_0x3e0c('0x4'))['db'];var utils=require(_0x3e0c('0x5'));var logger=require(_0x3e0c('0x6'))(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var jayson=require(_0x3e0c('0x9'));var client=jayson[_0x3e0c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c2d6a,_0x2298e6,_0x11cb31){return new BPromise(function(_0x4d490a,_0x2784b7){return client[_0x3e0c('0xb')](_0x4c2d6a,_0x11cb31)[_0x3e0c('0xc')](function(_0x328560){logger['info'](_0x3e0c('0xd'),_0x2298e6,_0x3e0c('0xe'));logger[_0x3e0c('0xf')](_0x3e0c('0x10'),_0x2298e6,'request\x20sent',JSON[_0x3e0c('0x11')](_0x328560));if(_0x328560[_0x3e0c('0x12')]){if(_0x328560['error'][_0x3e0c('0x13')]===0x1f4){logger[_0x3e0c('0x12')](_0x3e0c('0xd'),_0x2298e6,_0x328560[_0x3e0c('0x12')][_0x3e0c('0x14')]);return _0x2784b7(_0x328560['error'][_0x3e0c('0x14')]);}logger[_0x3e0c('0x12')](_0x3e0c('0xd'),_0x2298e6,_0x328560['error'][_0x3e0c('0x14')]);return _0x4d490a(_0x328560[_0x3e0c('0x12')][_0x3e0c('0x14')]);}else{logger[_0x3e0c('0x15')](_0x3e0c('0xd'),_0x2298e6,_0x3e0c('0xe'));_0x4d490a(_0x328560[_0x3e0c('0x16')][_0x3e0c('0x14')]);}})[_0x3e0c('0x17')](function(_0x4effc7){logger['error'](_0x3e0c('0xd'),_0x2298e6,_0x4effc7);_0x2784b7(_0x4effc7);});});}
\ No newline at end of file
+var _0x5300=['request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','info','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x251429,_0x55f265){var _0x2d5d69=function(_0x5f93c8){while(--_0x5f93c8){_0x251429['push'](_0x251429['shift']());}};_0x2d5d69(++_0x55f265);}(_0x5300,0x97));var _0x0530=function(_0x4fd929,_0x196261){_0x4fd929=_0x4fd929-0x0;var _0xf5df45=_0x5300[_0x4fd929];return _0xf5df45;};'use strict';var _=require(_0x0530('0x0'));var util=require('util');var moment=require(_0x0530('0x1'));var BPromise=require(_0x0530('0x2'));var rs=require(_0x0530('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0530('0x4'))['db'];var utils=require(_0x0530('0x5'));var logger=require('../../config/logger')(_0x0530('0x6'));var config=require(_0x0530('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0530('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ce68,_0x1f6e0e,_0x65414c){return new BPromise(function(_0x3da240,_0x45218c){return client['request'](_0x49ce68,_0x65414c)['then'](function(_0x1b1d71){logger[_0x0530('0x9')](_0x0530('0xa'),_0x1f6e0e,_0x0530('0xb'));logger[_0x0530('0xc')](_0x0530('0xd'),_0x1f6e0e,_0x0530('0xb'),JSON[_0x0530('0xe')](_0x1b1d71));if(_0x1b1d71[_0x0530('0xf')]){if(_0x1b1d71[_0x0530('0xf')][_0x0530('0x10')]===0x1f4){logger[_0x0530('0xf')](_0x0530('0xa'),_0x1f6e0e,_0x1b1d71[_0x0530('0xf')][_0x0530('0x11')]);return _0x45218c(_0x1b1d71[_0x0530('0xf')]['message']);}logger[_0x0530('0xf')](_0x0530('0xa'),_0x1f6e0e,_0x1b1d71['error'][_0x0530('0x11')]);return _0x3da240(_0x1b1d71[_0x0530('0xf')][_0x0530('0x11')]);}else{logger['info'](_0x0530('0xa'),_0x1f6e0e,'request\x20sent');_0x3da240(_0x1b1d71['result'][_0x0530('0x11')]);}})['catch'](function(_0x5aba18){logger[_0x0530('0xf')](_0x0530('0xa'),_0x1f6e0e,_0x5aba18);_0x45218c(_0x5aba18);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js
index eea3b05..f834c36 100644
--- a/server/api/intServicenowField/index.js
+++ b/server/api/intServicenowField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f27=['isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f27,0x1ef));var _0x71f2=function(_0x24e574,_0xe9c65c){_0x24e574=_0x24e574-0x0;var _0x3c4325=_0x1f27[_0x24e574];return _0x3c4325;};'use strict';var multer=require(_0x71f2('0x0'));var util=require(_0x71f2('0x1'));var path=require(_0x71f2('0x2'));var timeout=require(_0x71f2('0x3'));var express=require(_0x71f2('0x4'));var router=express[_0x71f2('0x5')]();var auth=require(_0x71f2('0x6'));var interaction=require(_0x71f2('0x7'));var config=require(_0x71f2('0x8'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x71f2('0x9')](),controller[_0x71f2('0xa')]);router['get'](_0x71f2('0xb'),auth['isAuthenticated'](),controller[_0x71f2('0xc')]);router['post']('/',auth[_0x71f2('0x9')](),controller[_0x71f2('0xd')]);router[_0x71f2('0xe')](_0x71f2('0xb'),auth[_0x71f2('0x9')](),controller['update']);router[_0x71f2('0xf')]('/:id',auth[_0x71f2('0x9')](),controller[_0x71f2('0x10')]);module[_0x71f2('0x11')]=router;
\ No newline at end of file
+var _0x4470=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4470,0xe8));var _0x0447=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x4470[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0447('0x0'));var util=require(_0x0447('0x1'));var path=require(_0x0447('0x2'));var timeout=require('connect-timeout');var express=require(_0x0447('0x3'));var router=express[_0x0447('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0447('0x5'));var config=require(_0x0447('0x6'));var controller=require(_0x0447('0x7'));router[_0x0447('0x8')]('/',auth[_0x0447('0x9')](),controller['index']);router[_0x0447('0x8')](_0x0447('0xa'),auth[_0x0447('0x9')](),controller[_0x0447('0xb')]);router[_0x0447('0xc')]('/',auth[_0x0447('0x9')](),controller[_0x0447('0xd')]);router[_0x0447('0xe')](_0x0447('0xa'),auth['isAuthenticated'](),controller[_0x0447('0xf')]);router[_0x0447('0x10')](_0x0447('0xa'),auth['isAuthenticated'](),controller[_0x0447('0x11')]);module[_0x0447('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js
index fc4bf15..ef83a40 100644
--- a/server/api/intServicenowField/intServicenowField.attributes.js
+++ b/server/api/intServicenowField/intServicenowField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d8e=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x0d8e,0x16a));var _0xe0d8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0d8e[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xe0d8('0x0'));module[_0xe0d8('0x1')]={'type':{'type':Sequelize[_0xe0d8('0x2')](_0xe0d8('0x3'),_0xe0d8('0x4'),_0xe0d8('0x5'),_0xe0d8('0x6')),'defaultValue':_0xe0d8('0x3')},'content':{'type':Sequelize[_0xe0d8('0x7')]},'key':{'type':Sequelize[_0xe0d8('0x7')]},'keyType':{'type':Sequelize[_0xe0d8('0x2')]('string',_0xe0d8('0x4'),_0xe0d8('0x5'))},'keyContent':{'type':Sequelize[_0xe0d8('0x7')]},'idField':{'type':Sequelize[_0xe0d8('0x7')]},'nameField':{'type':Sequelize[_0xe0d8('0x7')]},'customField':{'type':Sequelize[_0xe0d8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe0d8('0x7')]}};
\ No newline at end of file
+var _0x1457=['customVariable','STRING','string','variable','BOOLEAN','exports','ENUM'];(function(_0x31e888,_0x2c1b5a){var _0x21cf22=function(_0xcfa85f){while(--_0xcfa85f){_0x31e888['push'](_0x31e888['shift']());}};_0x21cf22(++_0x2c1b5a);}(_0x1457,0x67));var _0x7145=function(_0x5b013d,_0xc7691c){_0x5b013d=_0x5b013d-0x0;var _0x2b6eef=_0x1457[_0x5b013d];return _0x2b6eef;};'use strict';var Sequelize=require('sequelize');module[_0x7145('0x0')]={'type':{'type':Sequelize[_0x7145('0x1')]('string','variable',_0x7145('0x2'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x7145('0x3')]},'key':{'type':Sequelize[_0x7145('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x7145('0x4'),_0x7145('0x5'),_0x7145('0x2'))},'keyContent':{'type':Sequelize[_0x7145('0x3')]},'idField':{'type':Sequelize[_0x7145('0x3')]},'nameField':{'type':Sequelize[_0x7145('0x3')]},'customField':{'type':Sequelize[_0x7145('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js
index 601c01f..dbe063e 100644
--- a/server/api/intServicenowField/intServicenowField.controller.js
+++ b/server/api/intServicenowField/intServicenowField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x823f14,_0xa8444c){var _0x5ac864=function(_0x5a4320){while(--_0x5a4320){_0x823f14['push'](_0x823f14['shift']());}};_0x5ac864(++_0xa8444c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x5e4219,_0x2342a0){var _0x395815=function(_0x10b90e){while(--_0x10b90e){_0x5e4219['push'](_0x5e4219['shift']());}};_0x395815(++_0x2342a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js
index f49628d..3b707d7 100644
--- a/server/api/intServicenowField/intServicenowField.model.js
+++ b/server/api/intServicenowField/intServicenowField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf6d6=['FieldId','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','servicenow_unique_index'];(function(_0x287e92,_0x14e6d9){var _0x11f5a8=function(_0xe18c43){while(--_0xe18c43){_0x287e92['push'](_0x287e92['shift']());}};_0x11f5a8(++_0x14e6d9);}(_0xf6d6,0x181));var _0x6f6d=function(_0x90810e,_0x5ed338){_0x90810e=_0x90810e-0x0;var _0x2c04dd=_0xf6d6[_0x90810e];return _0x2c04dd;};'use strict';var _=require(_0x6f6d('0x0'));var util=require('util');var logger=require(_0x6f6d('0x1'))('api');var moment=require(_0x6f6d('0x2'));var BPromise=require('bluebird');var rp=require(_0x6f6d('0x3'));var fs=require('fs');var path=require(_0x6f6d('0x4'));var rimraf=require(_0x6f6d('0x5'));var config=require(_0x6f6d('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x6f6d('0x7')]=function(_0x3d1448,_0x2c82a3){return _0x3d1448[_0x6f6d('0x8')](_0x6f6d('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x6f6d('0xa'),'fields':['idField',_0x6f6d('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1e54=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','servicenow_unique_index','FieldId'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1e54,0x1c8));var _0x41e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e54[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41e5('0x0'));var util=require(_0x41e5('0x1'));var logger=require(_0x41e5('0x2'))('api');var moment=require(_0x41e5('0x3'));var BPromise=require(_0x41e5('0x4'));var rp=require(_0x41e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41e5('0x6'));var config=require(_0x41e5('0x7'));var attributes=require(_0x41e5('0x8'));module['exports']=function(_0x34b022,_0x2daf79){return _0x34b022[_0x41e5('0x9')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x41e5('0xa'),'fields':['idField',_0x41e5('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js
index 51f86de..503294b 100644
--- a/server/api/intServicenowField/intServicenowField.rpc.js
+++ b/server/api/intServicenowField/intServicenowField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa648=['rpc','../../config/environment','http','request','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xbffc8c,_0x44e49e){var _0x13d9de=function(_0x584f5d){while(--_0x584f5d){_0xbffc8c['push'](_0xbffc8c['shift']());}};_0x13d9de(++_0x44e49e);}(_0xa648,0x185));var _0x8a64=function(_0x240b5c,_0x2230eb){_0x240b5c=_0x240b5c-0x0;var _0x26299d=_0xa648[_0x240b5c];return _0x26299d;};'use strict';var _=require(_0x8a64('0x0'));var util=require(_0x8a64('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8a64('0x2'));var fs=require('fs');var Redis=require(_0x8a64('0x3'));var db=require(_0x8a64('0x4'))['db'];var utils=require(_0x8a64('0x5'));var logger=require(_0x8a64('0x6'))(_0x8a64('0x7'));var config=require(_0x8a64('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8a64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fc4ef,_0x1b1ed0,_0x155bfe){return new BPromise(function(_0x460cb7,_0x3afb30){return client[_0x8a64('0xa')](_0x4fc4ef,_0x155bfe)[_0x8a64('0xb')](function(_0x5feb8){logger[_0x8a64('0xc')]('ServicenowField,\x20%s,\x20%s',_0x1b1ed0,_0x8a64('0xd'));logger[_0x8a64('0xe')](_0x8a64('0xf'),_0x1b1ed0,_0x8a64('0xd'),JSON[_0x8a64('0x10')](_0x5feb8));if(_0x5feb8['error']){if(_0x5feb8[_0x8a64('0x11')][_0x8a64('0x12')]===0x1f4){logger[_0x8a64('0x11')]('ServicenowField,\x20%s,\x20%s',_0x1b1ed0,_0x5feb8[_0x8a64('0x11')][_0x8a64('0x13')]);return _0x3afb30(_0x5feb8['error'][_0x8a64('0x13')]);}logger[_0x8a64('0x11')](_0x8a64('0x14'),_0x1b1ed0,_0x5feb8[_0x8a64('0x11')][_0x8a64('0x13')]);return _0x460cb7(_0x5feb8[_0x8a64('0x11')][_0x8a64('0x13')]);}else{logger[_0x8a64('0xc')]('ServicenowField,\x20%s,\x20%s',_0x1b1ed0,_0x8a64('0xd'));_0x460cb7(_0x5feb8['result']['message']);}})[_0x8a64('0x15')](function(_0x1fda22){logger[_0x8a64('0x11')](_0x8a64('0x14'),_0x1b1ed0,_0x1fda22);_0x3afb30(_0x1fda22);});});}
\ No newline at end of file
+var _0x43d0=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x43d0,0x7d));var _0x043d=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x43d0[_0x1399d6];return _0x4a9db4;};'use strict';var _=require(_0x043d('0x0'));var util=require(_0x043d('0x1'));var moment=require('moment');var BPromise=require(_0x043d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x043d('0x3'))['db'];var utils=require(_0x043d('0x4'));var logger=require(_0x043d('0x5'))('rpc');var config=require(_0x043d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x043d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2abe9c,_0x17e541,_0x273663){return new BPromise(function(_0x231a4f,_0x488995){return client['request'](_0x2abe9c,_0x273663)['then'](function(_0x23f176){logger['info'](_0x043d('0x8'),_0x17e541,_0x043d('0x9'));logger[_0x043d('0xa')](_0x043d('0xb'),_0x17e541,_0x043d('0x9'),JSON[_0x043d('0xc')](_0x23f176));if(_0x23f176['error']){if(_0x23f176[_0x043d('0xd')]['code']===0x1f4){logger['error'](_0x043d('0x8'),_0x17e541,_0x23f176[_0x043d('0xd')]['message']);return _0x488995(_0x23f176[_0x043d('0xd')]['message']);}logger[_0x043d('0xd')](_0x043d('0x8'),_0x17e541,_0x23f176['error'][_0x043d('0xe')]);return _0x231a4f(_0x23f176[_0x043d('0xd')][_0x043d('0xe')]);}else{logger[_0x043d('0xf')](_0x043d('0x8'),_0x17e541,_0x043d('0x9'));_0x231a4f(_0x23f176[_0x043d('0x10')][_0x043d('0xe')]);}})[_0x043d('0x11')](function(_0x293990){logger[_0x043d('0xd')]('ServicenowField,\x20%s,\x20%s',_0x17e541,_0x293990);_0x488995(_0x293990);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js
index 32e4500..7ee9ffd 100644
--- a/server/api/intSugarcrmAccount/index.js
+++ b/server/api/intSugarcrmAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb088=['./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','/:id/configurations','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0xe4d6c6,_0x3bdbf2){var _0x3a8935=function(_0x131483){while(--_0x131483){_0xe4d6c6['push'](_0xe4d6c6['shift']());}};_0x3a8935(++_0x3bdbf2);}(_0xb088,0x1b1));var _0x8b08=function(_0x234589,_0x2e8250){_0x234589=_0x234589-0x0;var _0x3effa1=_0xb088[_0x234589];return _0x3effa1;};'use strict';var multer=require(_0x8b08('0x0'));var util=require('util');var path=require(_0x8b08('0x1'));var timeout=require(_0x8b08('0x2'));var express=require(_0x8b08('0x3'));var router=express[_0x8b08('0x4')]();var auth=require(_0x8b08('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b08('0x6'));var controller=require(_0x8b08('0x7'));router[_0x8b08('0x8')]('/',auth[_0x8b08('0x9')](),controller[_0x8b08('0xa')]);router[_0x8b08('0x8')](_0x8b08('0xb'),auth[_0x8b08('0x9')](),controller[_0x8b08('0xc')]);router[_0x8b08('0x8')]('/:id/configurations',auth[_0x8b08('0x9')](),controller[_0x8b08('0xd')]);router[_0x8b08('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x8b08('0xe')]);router['post']('/',auth[_0x8b08('0x9')](),controller['create']);router[_0x8b08('0xf')](_0x8b08('0x10'),auth[_0x8b08('0x9')](),controller['addConfiguration']);router[_0x8b08('0x11')]('/:id',auth[_0x8b08('0x9')](),controller[_0x8b08('0x12')]);router[_0x8b08('0x13')](_0x8b08('0xb'),auth[_0x8b08('0x9')](),controller[_0x8b08('0x14')]);module[_0x8b08('0x15')]=router;
\ No newline at end of file
+var _0xa3ca=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3bb663,_0x1acbf9){var _0x1681b7=function(_0x120a71){while(--_0x120a71){_0x3bb663['push'](_0x3bb663['shift']());}};_0x1681b7(++_0x1acbf9);}(_0xa3ca,0x18b));var _0xaa3c=function(_0x51916e,_0x1c627e){_0x51916e=_0x51916e-0x0;var _0x450daf=_0xa3ca[_0x51916e];return _0x450daf;};'use strict';var multer=require(_0xaa3c('0x0'));var util=require(_0xaa3c('0x1'));var path=require(_0xaa3c('0x2'));var timeout=require(_0xaa3c('0x3'));var express=require(_0xaa3c('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaa3c('0x5'));var controller=require('./intSugarcrmAccount.controller');router[_0xaa3c('0x6')]('/',auth[_0xaa3c('0x7')](),controller[_0xaa3c('0x8')]);router[_0xaa3c('0x6')](_0xaa3c('0x9'),auth[_0xaa3c('0x7')](),controller[_0xaa3c('0xa')]);router[_0xaa3c('0x6')](_0xaa3c('0xb'),auth[_0xaa3c('0x7')](),controller[_0xaa3c('0xc')]);router['get'](_0xaa3c('0xd'),auth[_0xaa3c('0x7')](),controller[_0xaa3c('0xe')]);router[_0xaa3c('0xf')]('/',auth[_0xaa3c('0x7')](),controller['create']);router['post'](_0xaa3c('0xb'),auth['isAuthenticated'](),controller[_0xaa3c('0x10')]);router['put'](_0xaa3c('0x9'),auth[_0xaa3c('0x7')](),controller['update']);router[_0xaa3c('0x11')](_0xaa3c('0x9'),auth[_0xaa3c('0x7')](),controller[_0xaa3c('0x12')]);module[_0xaa3c('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
index 61088b5..865c2af 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e94=['username','remoteUri','STRING'];(function(_0x49e888,_0x53a0be){var _0x263725=function(_0x29045c){while(--_0x29045c){_0x49e888['push'](_0x49e888['shift']());}};_0x263725(++_0x53a0be);}(_0x9e94,0xe0));var _0x49e9=function(_0x236316,_0x25d02b){_0x236316=_0x236316-0x0;var _0x18720a=_0x9e94[_0x236316];return _0x18720a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49e9('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x49e9('0x0')],'unique':_0x49e9('0x1')},'password':{'type':Sequelize[_0x49e9('0x0')]},'remoteUri':{'type':Sequelize[_0x49e9('0x0')],'unique':_0x49e9('0x2')},'serverUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4ce6=['sequelize','STRING','username'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x4ce6,0x108));var _0x64ce=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0x4ce6[_0x7b173];return _0x1c598c;};'use strict';var Sequelize=require(_0x64ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x64ce('0x1')]},'description':{'type':Sequelize[_0x64ce('0x1')]},'username':{'type':Sequelize[_0x64ce('0x1')],'unique':_0x64ce('0x2')},'password':{'type':Sequelize[_0x64ce('0x1')]},'remoteUri':{'type':Sequelize[_0x64ce('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x64ce('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
index b71b305..525b401 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe517=['end','json','count','offset','limit','apply','save','update','name','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','include','findAll','catch','show','params','length','find','create','body','destroy','getConfigurations','SugarcrmConfiguration','pick','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','duration_hours','parent_type','parent_name','direction','username','remoteUri','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status'];(function(_0x30927f,_0x125246){var _0x1b7e1e=function(_0x187590){while(--_0x187590){_0x30927f['push'](_0x30927f['shift']());}};_0x1b7e1e(++_0x125246);}(_0xe517,0x15e));var _0x7e51=function(_0x9a0d13,_0x4dd805){_0x9a0d13=_0x9a0d13-0x0;var _0x250f69=_0xe517[_0x9a0d13];return _0x250f69;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7e51('0x0'));var rimraf=require(_0x7e51('0x1'));var zipdir=require(_0x7e51('0x2'));var jsonpatch=require(_0x7e51('0x3'));var rp=require('request-promise');var moment=require(_0x7e51('0x4'));var BPromise=require(_0x7e51('0x5'));var Mustache=require('mustache');var util=require(_0x7e51('0x6'));var path=require(_0x7e51('0x7'));var sox=require(_0x7e51('0x8'));var csv=require(_0x7e51('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e51('0xa'));var squel=require(_0x7e51('0xb'));var crypto=require('crypto');var jsforce=require(_0x7e51('0xc'));var deskjs=require(_0x7e51('0xd'));var toCsv=require(_0x7e51('0x9'));var querystring=require(_0x7e51('0xe'));var Papa=require(_0x7e51('0xf'));var Redis=require(_0x7e51('0x10'));var authService=require(_0x7e51('0x11'));var qs=require(_0x7e51('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e51('0x13'));var logger=require(_0x7e51('0x14'))(_0x7e51('0x15'));var utils=require(_0x7e51('0x16'));var config=require(_0x7e51('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7e51('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x7e51('0x19')][_0x7e51('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x38cfd0,_0x246183,_0x117579){if(_0x117579){var _0x228f81=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x228f81[_0x7e51('0x1b')](_0x246183)){return _0x38cfd0;}else{throw new db[(_0x7e51('0x1c'))][(_0x7e51('0x1d'))](_0x7e51('0x1e'));}}else{return _0x38cfd0;}}function respondWithRpcPromise(_0x15ce6d,_0x12a237,_0x2674fd,_0x4c4886){return new BPromise(function(_0x4c117d,_0x3a454){var _0x4160e2=_0x4c4886||client;return _0x4160e2[_0x7e51('0x1f')](_0x15ce6d,_0x2674fd)[_0x7e51('0x20')](function(_0x530001){logger[_0x7e51('0x21')](_0x7e51('0x22'),_0x12a237,_0x7e51('0x23'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x12a237,_0x7e51('0x23'),JSON[_0x7e51('0x24')](_0x530001));if(_0x530001['error']){if(_0x530001[_0x7e51('0x25')][_0x7e51('0x26')]===0x1f4){logger[_0x7e51('0x25')](_0x7e51('0x22'),_0x12a237,_0x530001['error'][_0x7e51('0x27')]);return _0x3a454(_0x530001[_0x7e51('0x25')][_0x7e51('0x27')]);}logger[_0x7e51('0x25')]('SugarcrmAccount,\x20%s,\x20%s',_0x12a237,_0x530001['error']['message']);return _0x4c117d(_0x530001['error'][_0x7e51('0x27')]);}else{logger['info'](_0x7e51('0x22'),_0x12a237,_0x7e51('0x23'));_0x4c117d(_0x530001[_0x7e51('0x28')][_0x7e51('0x27')]);}})['catch'](function(_0xb3117){logger[_0x7e51('0x25')](_0x7e51('0x22'),_0x12a237,_0xb3117);_0x3a454(_0xb3117);});});}function respondWithStatusCode(_0x5ef75c,_0x239a46){_0x239a46=_0x239a46||0xcc;return function(_0x231c8d){if(_0x231c8d){return _0x5ef75c[_0x7e51('0x29')](_0x239a46);}return _0x5ef75c[_0x7e51('0x2a')](_0x239a46)[_0x7e51('0x2b')]();};}function respondWithResult(_0x23cdc3,_0x219b0c){_0x219b0c=_0x219b0c||0xc8;return function(_0x352e6e){if(_0x352e6e){return _0x23cdc3[_0x7e51('0x2a')](_0x219b0c)[_0x7e51('0x2c')](_0x352e6e);}};}function respondWithFilteredResult(_0x199518,_0x3b5a16){return function(_0x26f547){if(_0x26f547){var _0x2be78c=_0x26f547[_0x7e51('0x2d')],_0x225ebb=_0x3b5a16['offset'],_0x589a15=_0x3b5a16[_0x7e51('0x2e')]+_0x3b5a16[_0x7e51('0x2f')],_0x51c978;if(_0x589a15>=_0x2be78c){_0x589a15=_0x2be78c;_0x51c978=0xc8;}else{_0x51c978=0xce;}_0x199518['status'](_0x51c978);return _0x199518['set']('Content-Range',_0x225ebb+'-'+_0x589a15+'/'+_0x2be78c)[_0x7e51('0x2c')](_0x26f547);}return null;};}function patchUpdates(_0x32a715){return function(_0x3ee6fa){try{jsonpatch[_0x7e51('0x30')](_0x3ee6fa,_0x32a715,!![]);}catch(_0x303252){return BPromise['reject'](_0x303252);}return _0x3ee6fa[_0x7e51('0x31')]();};}function saveUpdates(_0x2ba784,_0x5c3e74){return function(_0xf5ad6a){if(_0xf5ad6a){return _0xf5ad6a[_0x7e51('0x32')](_0x2ba784)[_0x7e51('0x20')](function(_0x17eb19){return _0x17eb19;});}return null;};}function removeEntity(_0x23bbda,_0x5b8ec5){return function(_0x1ca473){if(_0x1ca473){return _0x1ca473['destroy']()['then'](function(){_0x23bbda[_0x7e51('0x2a')](0xcc)[_0x7e51('0x2b')]();});}};}function handleEntityNotFound(_0x32fff9,_0x19caf2){return function(_0x217a65){if(!_0x217a65){_0x32fff9['sendStatus'](0x194);}return _0x217a65;};}function handleError(_0x33670b,_0x6e0a79){_0x6e0a79=_0x6e0a79||0x1f4;return function(_0x163070){logger['error'](_0x163070['stack']);if(_0x163070['name']){delete _0x163070[_0x7e51('0x33')];}_0x33670b['status'](_0x6e0a79)['send'](_0x163070);};}exports[_0x7e51('0x34')]=function(_0x34be02,_0x19da5e){var _0x472784={},_0x1b9b4c={},_0x44f9d3={'count':0x0,'rows':[]};var _0x2210d3=_[_0x7e51('0x35')](db[_0x7e51('0x36')][_0x7e51('0x37')],function(_0x3fe822){return{'name':_0x3fe822[_0x7e51('0x38')],'type':_0x3fe822['type'][_0x7e51('0x39')]};});_0x1b9b4c[_0x7e51('0x3a')]=_[_0x7e51('0x35')](_0x2210d3,_0x7e51('0x33'));_0x1b9b4c[_0x7e51('0x3b')]=_[_0x7e51('0x3c')](_0x34be02[_0x7e51('0x3b')]);_0x1b9b4c[_0x7e51('0x3d')]=_[_0x7e51('0x3e')](_0x1b9b4c['model'],_0x1b9b4c[_0x7e51('0x3b')]);_0x472784[_0x7e51('0x3f')]=_['intersection'](_0x1b9b4c['model'],qs[_0x7e51('0x40')](_0x34be02[_0x7e51('0x3b')][_0x7e51('0x40')]));_0x472784[_0x7e51('0x3f')]=_0x472784[_0x7e51('0x3f')]['length']?_0x472784[_0x7e51('0x3f')]:_0x1b9b4c[_0x7e51('0x3a')];if(!_0x34be02[_0x7e51('0x3b')][_0x7e51('0x41')]('nolimit')){_0x472784['limit']=qs[_0x7e51('0x2f')](_0x34be02[_0x7e51('0x3b')][_0x7e51('0x2f')]);_0x472784['offset']=qs[_0x7e51('0x2e')](_0x34be02['query'][_0x7e51('0x2e')]);}_0x472784[_0x7e51('0x42')]=qs[_0x7e51('0x43')](_0x34be02[_0x7e51('0x3b')][_0x7e51('0x43')]);_0x472784['where']=qs['filters'](_['pick'](_0x34be02[_0x7e51('0x3b')],_0x1b9b4c[_0x7e51('0x3d')]),_0x2210d3);if(_0x34be02[_0x7e51('0x3b')][_0x7e51('0x44')]){_0x472784['where']=_[_0x7e51('0x45')](_0x472784[_0x7e51('0x46')],{'$or':_[_0x7e51('0x35')](_0x2210d3,function(_0x221737){if(_0x221737['type']!==_0x7e51('0x47')){var _0x370995={};_0x370995[_0x221737[_0x7e51('0x33')]]={'$like':'%'+_0x34be02[_0x7e51('0x3b')]['filter']+'%'};return _0x370995;}})});}_0x472784=_[_0x7e51('0x45')]({},_0x472784,_0x34be02[_0x7e51('0x48')]);var _0x38c341={'where':_0x472784[_0x7e51('0x46')]};return db[_0x7e51('0x36')]['count'](_0x38c341)[_0x7e51('0x20')](function(_0x1a03c7){_0x44f9d3[_0x7e51('0x2d')]=_0x1a03c7;if(_0x34be02[_0x7e51('0x3b')]['includeAll']){_0x472784[_0x7e51('0x49')]=[{'all':!![]}];}return db[_0x7e51('0x36')][_0x7e51('0x4a')](_0x472784);})['then'](function(_0x568812){_0x44f9d3['rows']=_0x568812;return _0x44f9d3;})['then'](respondWithFilteredResult(_0x19da5e,_0x472784))[_0x7e51('0x4b')](handleError(_0x19da5e,null));};exports[_0x7e51('0x4c')]=function(_0x3e8104,_0x3f43d0){var _0x1a3b4a={'raw':![],'where':{'id':_0x3e8104[_0x7e51('0x4d')]['id']}},_0x175f07={};_0x175f07['model']=_[_0x7e51('0x3c')](db[_0x7e51('0x36')][_0x7e51('0x37')]);_0x175f07['query']=_['keys'](_0x3e8104[_0x7e51('0x3b')]);_0x175f07[_0x7e51('0x3d')]=_['intersection'](_0x175f07[_0x7e51('0x3a')],_0x175f07[_0x7e51('0x3b')]);_0x1a3b4a[_0x7e51('0x3f')]=_[_0x7e51('0x3e')](_0x175f07[_0x7e51('0x3a')],qs[_0x7e51('0x40')](_0x3e8104[_0x7e51('0x3b')][_0x7e51('0x40')]));_0x1a3b4a[_0x7e51('0x3f')]=_0x1a3b4a[_0x7e51('0x3f')][_0x7e51('0x4e')]?_0x1a3b4a[_0x7e51('0x3f')]:_0x175f07['model'];if(_0x3e8104[_0x7e51('0x3b')]['includeAll']){_0x1a3b4a[_0x7e51('0x49')]=[{'all':!![]}];}_0x1a3b4a=_['merge']({},_0x1a3b4a,_0x3e8104[_0x7e51('0x48')]);return db[_0x7e51('0x36')][_0x7e51('0x4f')](_0x1a3b4a)[_0x7e51('0x20')](handleEntityNotFound(_0x3f43d0,null))[_0x7e51('0x20')](respondWithResult(_0x3f43d0,null))[_0x7e51('0x4b')](handleError(_0x3f43d0,null));};exports[_0x7e51('0x50')]=function(_0x104f60,_0x54f209){return db[_0x7e51('0x36')]['create'](_0x104f60[_0x7e51('0x51')],{})[_0x7e51('0x20')](respondWithResult(_0x54f209,0xc9))[_0x7e51('0x4b')](handleError(_0x54f209,null));};exports[_0x7e51('0x32')]=function(_0x41c025,_0x3e59b2){if(_0x41c025[_0x7e51('0x51')]['id']){delete _0x41c025[_0x7e51('0x51')]['id'];}return db[_0x7e51('0x36')][_0x7e51('0x4f')]({'where':{'id':_0x41c025[_0x7e51('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3e59b2,null))[_0x7e51('0x20')](saveUpdates(_0x41c025[_0x7e51('0x51')],null))[_0x7e51('0x20')](respondWithResult(_0x3e59b2,null))[_0x7e51('0x4b')](handleError(_0x3e59b2,null));};exports[_0x7e51('0x52')]=function(_0x56b665,_0x2108e3){return db[_0x7e51('0x36')]['find']({'where':{'id':_0x56b665[_0x7e51('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2108e3,null))[_0x7e51('0x20')](removeEntity(_0x2108e3,null))['catch'](handleError(_0x2108e3,null));};exports[_0x7e51('0x53')]=function(_0x2342fe,_0x5776ed,_0xaed464){var _0x846c14={};var _0x294426={};var _0x5e9de3;var _0x3d1562;return db[_0x7e51('0x36')]['findOne']({'where':{'id':_0x2342fe[_0x7e51('0x4d')]['id']}})[_0x7e51('0x20')](handleEntityNotFound(_0x5776ed,null))[_0x7e51('0x20')](function(_0x41e90a){if(_0x41e90a){_0x5e9de3=_0x41e90a;_0x294426[_0x7e51('0x3a')]=_['keys'](db[_0x7e51('0x54')][_0x7e51('0x37')]);_0x294426['query']=_[_0x7e51('0x3c')](_0x2342fe[_0x7e51('0x3b')]);_0x294426[_0x7e51('0x3d')]=_[_0x7e51('0x3e')](_0x294426[_0x7e51('0x3a')],_0x294426['query']);_0x846c14[_0x7e51('0x3f')]=_[_0x7e51('0x3e')](_0x294426[_0x7e51('0x3a')],qs[_0x7e51('0x40')](_0x2342fe[_0x7e51('0x3b')]['fields']));_0x846c14['attributes']=_0x846c14[_0x7e51('0x3f')][_0x7e51('0x4e')]?_0x846c14['attributes']:_0x294426[_0x7e51('0x3a')];_0x846c14[_0x7e51('0x42')]=qs['sort'](_0x2342fe['query'][_0x7e51('0x43')]);_0x846c14[_0x7e51('0x46')]=qs[_0x7e51('0x3d')](_[_0x7e51('0x55')](_0x2342fe[_0x7e51('0x3b')],_0x294426['filters']));if(_0x2342fe['query'][_0x7e51('0x44')]){_0x846c14[_0x7e51('0x46')]=_[_0x7e51('0x45')](_0x846c14[_0x7e51('0x46')],{'$or':_['map'](_0x846c14[_0x7e51('0x3f')],function(_0x5c33f7){var _0x299cbd={};_0x299cbd[_0x5c33f7]={'$like':'%'+_0x2342fe[_0x7e51('0x3b')][_0x7e51('0x44')]+'%'};return _0x299cbd;})});}_0x846c14=_[_0x7e51('0x45')]({},_0x846c14,_0x2342fe[_0x7e51('0x48')]);return _0x5e9de3['getConfigurations'](_0x846c14);}})[_0x7e51('0x20')](function(_0x324ade){if(_0x324ade){_0x3d1562=_0x324ade[_0x7e51('0x4e')];if(!_0x2342fe[_0x7e51('0x3b')][_0x7e51('0x41')](_0x7e51('0x56'))){_0x846c14[_0x7e51('0x2f')]=qs['limit'](_0x2342fe[_0x7e51('0x3b')][_0x7e51('0x2f')]);_0x846c14['offset']=qs[_0x7e51('0x2e')](_0x2342fe['query'][_0x7e51('0x2e')]);}return _0x5e9de3[_0x7e51('0x53')](_0x846c14);}})['then'](function(_0x14adaf){if(_0x14adaf){return _0x14adaf?{'count':_0x3d1562,'rows':_0x14adaf}:null;}})[_0x7e51('0x20')](respondWithResult(_0x5776ed,null))[_0x7e51('0x4b')](handleError(_0x5776ed,null));};exports[_0x7e51('0x57')]=function(_0x528ae7,_0x478d9b,_0x5b4f9b){if(_0x528ae7['body']['id']){delete _0x528ae7[_0x7e51('0x51')]['id'];}return db[_0x7e51('0x36')][_0x7e51('0x58')]({'where':{'id':_0x528ae7[_0x7e51('0x4d')]['id']}})['then'](handleEntityNotFound(_0x478d9b,null))['then'](function(_0x59719d){if(_0x59719d){_0x528ae7['body'][_0x7e51('0x59')]=_0x59719d['id'];_0x528ae7[_0x7e51('0x51')][_0x7e51('0x5a')]=integrations[_0x7e51('0x5b')](_0x528ae7[_0x7e51('0x51')][_0x7e51('0x5c')],_0x528ae7[_0x7e51('0x51')][_0x7e51('0x5d')]);_0x528ae7['body'][_0x7e51('0x5e')]=integrations[_0x7e51('0x5f')](_0x528ae7['body'][_0x7e51('0x5c')],_0x528ae7[_0x7e51('0x51')][_0x7e51('0x5d')]);return db[_0x7e51('0x54')][_0x7e51('0x50')](_0x528ae7[_0x7e51('0x51')],{'include':[{'model':db[_0x7e51('0x60')],'as':_0x7e51('0x5a')},{'model':db[_0x7e51('0x60')],'as':_0x7e51('0x5e')}]});}return null;})[_0x7e51('0x20')](respondWithResult(_0x478d9b,null))[_0x7e51('0x4b')](handleError(_0x478d9b,null));};exports[_0x7e51('0x61')]=function(_0x1cc95c,_0x305ad1,_0x43f024){var _0x52fa6a='';var _0x5ee70b=['id',_0x7e51('0x33'),_0x7e51('0x62'),_0x7e51('0x63'),'description','date_start',_0x7e51('0x64'),'duration_minutes','parent_id',_0x7e51('0x65'),_0x7e51('0x66'),_0x7e51('0x67')];return db[_0x7e51('0x36')]['findOne']({'where':{'id':_0x1cc95c[_0x7e51('0x4d')]['id']},'attributes':['id',_0x7e51('0x68'),'password',_0x7e51('0x69')]})[_0x7e51('0x20')](handleEntityNotFound(_0x305ad1,null))['then'](function(_0x24bcdf){if(_0x24bcdf){_0x52fa6a=_0x24bcdf[_0x7e51('0x69')];var _0x2d0055=_0x52fa6a['slice'](-0x1);if(_0x2d0055==='/'){_0x52fa6a=_0x52fa6a[_0x7e51('0x6a')](0x0,_0x52fa6a[_0x7e51('0x6b')](_0x2d0055));}return rp({'method':_0x7e51('0x6c'),'uri':util[_0x7e51('0x6d')]('%s%s',_0x52fa6a,_0x7e51('0x6e')),'json':!![],'form':{'method':_0x7e51('0x6f'),'input_type':_0x7e51('0x70'),'response_type':_0x7e51('0x70'),'rest_data':JSON[_0x7e51('0x24')]({'user_auth':{'user_name':_0x24bcdf[_0x7e51('0x68')],'password':_0x24bcdf[_0x7e51('0x71')],'encryption':_0x7e51('0x72')},'application':_0x7e51('0x73')})}});}})['then'](function(_0x24eeca){if(_0x24eeca&&_0x24eeca[_0x7e51('0x33')]!==_0x7e51('0x74')&&_0x24eeca[_0x7e51('0x33')]!==_0x7e51('0x75')){return rp({'method':'POST','uri':util[_0x7e51('0x6d')](_0x7e51('0x76'),_0x52fa6a,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x7e51('0x77'),'input_type':_0x7e51('0x70'),'response_type':_0x7e51('0x70'),'rest_data':JSON['stringify']({'session':_0x24eeca['id'],'module_name':_0x7e51('0x78')})}})[_0x7e51('0x20')](function(_0x3eb46f){if(_0x3eb46f){var _0x43e30f=_[_0x7e51('0x79')](_0x3eb46f[_0x7e51('0x7a')]);_[_0x7e51('0x7b')](_0x43e30f,function(_0x369fab){return _0x5ee70b[_0x7e51('0x7c')](_0x369fab['name']);});return{'count':_0x43e30f[_0x7e51('0x4e')],'rows':_[_0x7e51('0x35')](_0x43e30f,function(_0x19e136){return{'id':_0x19e136['name'],'name':_0x19e136[_0x7e51('0x7d')],'custom':_[_0x7e51('0x7e')](_0x19e136['name'],'_c')?!![]:![],'options':_0x19e136[_0x7e51('0x48')]?_[_0x7e51('0x35')](_[_0x7e51('0x79')](_0x19e136[_0x7e51('0x48')]),function(_0x4d532c){return{'name':_0x4d532c[_0x7e51('0x7f')],'value':_0x4d532c[_0x7e51('0x33')]};}):[]};})};}})['then'](respondWithResult(_0x305ad1,null))['catch'](function(_0x3665d2){var _0x3d8ec8=_0x1cc95c[_0x7e51('0x3b')]['test']?0x1f4:_0x3665d2[_0x7e51('0x80')]||0x1f4;logger[_0x7e51('0x25')](_0x7e51('0x81'),'getFields',_0x3d8ec8,JSON[_0x7e51('0x24')](_0x3665d2));delete _0x3665d2['name'];if(_0x3d8ec8===0x191){_0x3d8ec8=0x190;}_0x305ad1[_0x7e51('0x2a')](_0x3d8ec8)['send'](_0x1cc95c['query'][_0x7e51('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x3665d2[_0x7e51('0x80')]}:_0x3665d2);});}else{var _0x2baf04=0x1f4;_0x305ad1[_0x7e51('0x2a')](_0x2baf04)[_0x7e51('0x82')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0x1b32=['sendStatus','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','nolimit','order','sort','filter','merge','where','VIRTUAL','SugarcrmAccount','includeAll','include','rows','show','params','keys','length','options','find','create','body','update','catch','destroy','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','direction','username','remoteUri','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','get_module_fields','Calls','values','module_fields','remove','includes','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','ValidationError','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','status','end','json','count','offset','limit','set','Content-Range','reject','save'];(function(_0x2268ab,_0x5ad3a0){var _0x2cdb04=function(_0xe8c763){while(--_0xe8c763){_0x2268ab['push'](_0x2268ab['shift']());}};_0x2cdb04(++_0x5ad3a0);}(_0x1b32,0x149));var _0x21b3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1b32[_0x2c91e9];return _0x13f0ff;};'use strict';var pdf=require(_0x21b3('0x0'));var emlformat=require(_0x21b3('0x1'));var rimraf=require(_0x21b3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21b3('0x3'));var rp=require(_0x21b3('0x4'));var moment=require(_0x21b3('0x5'));var BPromise=require(_0x21b3('0x6'));var Mustache=require(_0x21b3('0x7'));var util=require(_0x21b3('0x8'));var path=require('path');var sox=require(_0x21b3('0x9'));var csv=require(_0x21b3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x21b3('0xb'));var squel=require(_0x21b3('0xc'));var crypto=require(_0x21b3('0xd'));var jsforce=require(_0x21b3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x21b3('0xa'));var querystring=require(_0x21b3('0xf'));var Papa=require(_0x21b3('0x10'));var Redis=require(_0x21b3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x21b3('0x12'));var as=require(_0x21b3('0x13'));var hardwareService=require(_0x21b3('0x14'));var logger=require('../../config/logger')(_0x21b3('0x15'));var utils=require('../../config/utils');var config=require(_0x21b3('0x16'));var db=require(_0x21b3('0x17'))['db'];var integrations=require(_0x21b3('0x18'));var jayson=require(_0x21b3('0x19'));var client=jayson['client'][_0x21b3('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5bc286,_0x286ef7,_0x3c23f3){if(_0x3c23f3){var _0x27572e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27572e[_0x21b3('0x1b')](_0x286ef7)){return _0x5bc286;}else{throw new db['Sequelize'][(_0x21b3('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5bc286;}}function respondWithRpcPromise(_0x169402,_0x197443,_0x74127c,_0x49f5bb){return new BPromise(function(_0x3faaea,_0xa6f583){var _0x51196d=_0x49f5bb||client;return _0x51196d[_0x21b3('0x1d')](_0x169402,_0x74127c)[_0x21b3('0x1e')](function(_0xa7d2d6){logger[_0x21b3('0x1f')]('SugarcrmAccount,\x20%s,\x20%s',_0x197443,_0x21b3('0x20'));logger[_0x21b3('0x21')](_0x21b3('0x22'),_0x197443,'request\x20sent',JSON[_0x21b3('0x23')](_0xa7d2d6));if(_0xa7d2d6[_0x21b3('0x24')]){if(_0xa7d2d6['error']['code']===0x1f4){logger[_0x21b3('0x24')](_0x21b3('0x25'),_0x197443,_0xa7d2d6[_0x21b3('0x24')][_0x21b3('0x26')]);return _0xa6f583(_0xa7d2d6[_0x21b3('0x24')][_0x21b3('0x26')]);}logger[_0x21b3('0x24')](_0x21b3('0x25'),_0x197443,_0xa7d2d6[_0x21b3('0x24')][_0x21b3('0x26')]);return _0x3faaea(_0xa7d2d6['error'][_0x21b3('0x26')]);}else{logger[_0x21b3('0x1f')](_0x21b3('0x25'),_0x197443,_0x21b3('0x20'));_0x3faaea(_0xa7d2d6['result'][_0x21b3('0x26')]);}})['catch'](function(_0x3414da){logger[_0x21b3('0x24')](_0x21b3('0x25'),_0x197443,_0x3414da);_0xa6f583(_0x3414da);});});}function respondWithStatusCode(_0x1365e3,_0x2db05a){_0x2db05a=_0x2db05a||0xcc;return function(_0x533739){if(_0x533739){return _0x1365e3['sendStatus'](_0x2db05a);}return _0x1365e3[_0x21b3('0x27')](_0x2db05a)[_0x21b3('0x28')]();};}function respondWithResult(_0xa8135a,_0x9a81cd){_0x9a81cd=_0x9a81cd||0xc8;return function(_0x729036){if(_0x729036){return _0xa8135a['status'](_0x9a81cd)[_0x21b3('0x29')](_0x729036);}};}function respondWithFilteredResult(_0x43ca71,_0x2ea139){return function(_0x3745f0){if(_0x3745f0){var _0x577c58=_0x3745f0[_0x21b3('0x2a')],_0x33620a=_0x2ea139['offset'],_0x2535ff=_0x2ea139[_0x21b3('0x2b')]+_0x2ea139[_0x21b3('0x2c')],_0x1c472c;if(_0x2535ff>=_0x577c58){_0x2535ff=_0x577c58;_0x1c472c=0xc8;}else{_0x1c472c=0xce;}_0x43ca71[_0x21b3('0x27')](_0x1c472c);return _0x43ca71[_0x21b3('0x2d')](_0x21b3('0x2e'),_0x33620a+'-'+_0x2535ff+'/'+_0x577c58)[_0x21b3('0x29')](_0x3745f0);}return null;};}function patchUpdates(_0x341a3e){return function(_0x3a3277){try{jsonpatch['apply'](_0x3a3277,_0x341a3e,!![]);}catch(_0x1e95dd){return BPromise[_0x21b3('0x2f')](_0x1e95dd);}return _0x3a3277[_0x21b3('0x30')]();};}function saveUpdates(_0x7cc5de,_0x586b07){return function(_0x407092){if(_0x407092){return _0x407092['update'](_0x7cc5de)[_0x21b3('0x1e')](function(_0x4b479d){return _0x4b479d;});}return null;};}function removeEntity(_0x824cd8,_0x376743){return function(_0x1066a7){if(_0x1066a7){return _0x1066a7['destroy']()[_0x21b3('0x1e')](function(){_0x824cd8[_0x21b3('0x27')](0xcc)[_0x21b3('0x28')]();});}};}function handleEntityNotFound(_0x427cdd,_0x2f279a){return function(_0x30b9bb){if(!_0x30b9bb){_0x427cdd[_0x21b3('0x31')](0x194);}return _0x30b9bb;};}function handleError(_0x4114bd,_0x4bb9db){_0x4bb9db=_0x4bb9db||0x1f4;return function(_0x1f95d1){logger[_0x21b3('0x24')](_0x1f95d1['stack']);if(_0x1f95d1[_0x21b3('0x32')]){delete _0x1f95d1[_0x21b3('0x32')];}_0x4114bd['status'](_0x4bb9db)[_0x21b3('0x33')](_0x1f95d1);};}exports[_0x21b3('0x34')]=function(_0x5a82f6,_0x42c32e){var _0x31a25f={},_0x3fed1e={},_0x3e1f16={'count':0x0,'rows':[]};var _0x606c22=_[_0x21b3('0x35')](db['SugarcrmAccount'][_0x21b3('0x36')],function(_0x4954ea){return{'name':_0x4954ea[_0x21b3('0x37')],'type':_0x4954ea[_0x21b3('0x38')]['key']};});_0x3fed1e[_0x21b3('0x39')]=_[_0x21b3('0x35')](_0x606c22,'name');_0x3fed1e['query']=_['keys'](_0x5a82f6[_0x21b3('0x3a')]);_0x3fed1e[_0x21b3('0x3b')]=_['intersection'](_0x3fed1e[_0x21b3('0x39')],_0x3fed1e['query']);_0x31a25f[_0x21b3('0x3c')]=_[_0x21b3('0x3d')](_0x3fed1e[_0x21b3('0x39')],qs[_0x21b3('0x3e')](_0x5a82f6[_0x21b3('0x3a')][_0x21b3('0x3e')]));_0x31a25f[_0x21b3('0x3c')]=_0x31a25f['attributes']['length']?_0x31a25f['attributes']:_0x3fed1e[_0x21b3('0x39')];if(!_0x5a82f6[_0x21b3('0x3a')]['hasOwnProperty'](_0x21b3('0x3f'))){_0x31a25f[_0x21b3('0x2c')]=qs[_0x21b3('0x2c')](_0x5a82f6[_0x21b3('0x3a')]['limit']);_0x31a25f[_0x21b3('0x2b')]=qs['offset'](_0x5a82f6[_0x21b3('0x3a')][_0x21b3('0x2b')]);}_0x31a25f[_0x21b3('0x40')]=qs[_0x21b3('0x41')](_0x5a82f6[_0x21b3('0x3a')]['sort']);_0x31a25f['where']=qs[_0x21b3('0x3b')](_['pick'](_0x5a82f6['query'],_0x3fed1e[_0x21b3('0x3b')]),_0x606c22);if(_0x5a82f6[_0x21b3('0x3a')][_0x21b3('0x42')]){_0x31a25f['where']=_[_0x21b3('0x43')](_0x31a25f[_0x21b3('0x44')],{'$or':_[_0x21b3('0x35')](_0x606c22,function(_0x1f1d3f){if(_0x1f1d3f['type']!==_0x21b3('0x45')){var _0x4f0a80={};_0x4f0a80[_0x1f1d3f[_0x21b3('0x32')]]={'$like':'%'+_0x5a82f6[_0x21b3('0x3a')][_0x21b3('0x42')]+'%'};return _0x4f0a80;}})});}_0x31a25f=_['merge']({},_0x31a25f,_0x5a82f6['options']);var _0x1f1b16={'where':_0x31a25f['where']};return db[_0x21b3('0x46')][_0x21b3('0x2a')](_0x1f1b16)[_0x21b3('0x1e')](function(_0x54f61e){_0x3e1f16[_0x21b3('0x2a')]=_0x54f61e;if(_0x5a82f6['query'][_0x21b3('0x47')]){_0x31a25f[_0x21b3('0x48')]=[{'all':!![]}];}return db[_0x21b3('0x46')]['findAll'](_0x31a25f);})[_0x21b3('0x1e')](function(_0xc3fb7f){_0x3e1f16[_0x21b3('0x49')]=_0xc3fb7f;return _0x3e1f16;})[_0x21b3('0x1e')](respondWithFilteredResult(_0x42c32e,_0x31a25f))['catch'](handleError(_0x42c32e,null));};exports[_0x21b3('0x4a')]=function(_0xea79c9,_0x514ee7){var _0x1764fe={'raw':![],'where':{'id':_0xea79c9[_0x21b3('0x4b')]['id']}},_0x2e5fc7={};_0x2e5fc7[_0x21b3('0x39')]=_[_0x21b3('0x4c')](db[_0x21b3('0x46')][_0x21b3('0x36')]);_0x2e5fc7[_0x21b3('0x3a')]=_[_0x21b3('0x4c')](_0xea79c9[_0x21b3('0x3a')]);_0x2e5fc7[_0x21b3('0x3b')]=_['intersection'](_0x2e5fc7['model'],_0x2e5fc7[_0x21b3('0x3a')]);_0x1764fe[_0x21b3('0x3c')]=_[_0x21b3('0x3d')](_0x2e5fc7['model'],qs[_0x21b3('0x3e')](_0xea79c9[_0x21b3('0x3a')]['fields']));_0x1764fe[_0x21b3('0x3c')]=_0x1764fe[_0x21b3('0x3c')][_0x21b3('0x4d')]?_0x1764fe[_0x21b3('0x3c')]:_0x2e5fc7['model'];if(_0xea79c9['query'][_0x21b3('0x47')]){_0x1764fe[_0x21b3('0x48')]=[{'all':!![]}];}_0x1764fe=_['merge']({},_0x1764fe,_0xea79c9[_0x21b3('0x4e')]);return db['SugarcrmAccount'][_0x21b3('0x4f')](_0x1764fe)[_0x21b3('0x1e')](handleEntityNotFound(_0x514ee7,null))['then'](respondWithResult(_0x514ee7,null))['catch'](handleError(_0x514ee7,null));};exports[_0x21b3('0x50')]=function(_0x33f71b,_0x4b8caa){return db[_0x21b3('0x46')][_0x21b3('0x50')](_0x33f71b[_0x21b3('0x51')],{})[_0x21b3('0x1e')](respondWithResult(_0x4b8caa,0xc9))['catch'](handleError(_0x4b8caa,null));};exports[_0x21b3('0x52')]=function(_0x3d799d,_0x25b4ae){if(_0x3d799d[_0x21b3('0x51')]['id']){delete _0x3d799d['body']['id'];}return db[_0x21b3('0x46')][_0x21b3('0x4f')]({'where':{'id':_0x3d799d['params']['id']}})[_0x21b3('0x1e')](handleEntityNotFound(_0x25b4ae,null))[_0x21b3('0x1e')](saveUpdates(_0x3d799d['body'],null))[_0x21b3('0x1e')](respondWithResult(_0x25b4ae,null))[_0x21b3('0x53')](handleError(_0x25b4ae,null));};exports[_0x21b3('0x54')]=function(_0x2784e9,_0x486140){return db[_0x21b3('0x46')][_0x21b3('0x4f')]({'where':{'id':_0x2784e9[_0x21b3('0x4b')]['id']}})[_0x21b3('0x1e')](handleEntityNotFound(_0x486140,null))[_0x21b3('0x1e')](removeEntity(_0x486140,null))['catch'](handleError(_0x486140,null));};exports[_0x21b3('0x55')]=function(_0x479342,_0x2a194c,_0x3632b9){var _0x59c7ad={};var _0x5691c2={};var _0x4684d8;var _0x3d4de6;return db[_0x21b3('0x46')][_0x21b3('0x56')]({'where':{'id':_0x479342[_0x21b3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a194c,null))[_0x21b3('0x1e')](function(_0x3ead53){if(_0x3ead53){_0x4684d8=_0x3ead53;_0x5691c2[_0x21b3('0x39')]=_[_0x21b3('0x4c')](db[_0x21b3('0x57')][_0x21b3('0x36')]);_0x5691c2[_0x21b3('0x3a')]=_['keys'](_0x479342[_0x21b3('0x3a')]);_0x5691c2[_0x21b3('0x3b')]=_[_0x21b3('0x3d')](_0x5691c2[_0x21b3('0x39')],_0x5691c2[_0x21b3('0x3a')]);_0x59c7ad[_0x21b3('0x3c')]=_[_0x21b3('0x3d')](_0x5691c2['model'],qs[_0x21b3('0x3e')](_0x479342[_0x21b3('0x3a')][_0x21b3('0x3e')]));_0x59c7ad[_0x21b3('0x3c')]=_0x59c7ad[_0x21b3('0x3c')]['length']?_0x59c7ad[_0x21b3('0x3c')]:_0x5691c2[_0x21b3('0x39')];_0x59c7ad[_0x21b3('0x40')]=qs['sort'](_0x479342[_0x21b3('0x3a')]['sort']);_0x59c7ad[_0x21b3('0x44')]=qs[_0x21b3('0x3b')](_['pick'](_0x479342[_0x21b3('0x3a')],_0x5691c2[_0x21b3('0x3b')]));if(_0x479342['query'][_0x21b3('0x42')]){_0x59c7ad[_0x21b3('0x44')]=_[_0x21b3('0x43')](_0x59c7ad[_0x21b3('0x44')],{'$or':_[_0x21b3('0x35')](_0x59c7ad['attributes'],function(_0x31e292){var _0x41d41e={};_0x41d41e[_0x31e292]={'$like':'%'+_0x479342['query'][_0x21b3('0x42')]+'%'};return _0x41d41e;})});}_0x59c7ad=_['merge']({},_0x59c7ad,_0x479342[_0x21b3('0x4e')]);return _0x4684d8[_0x21b3('0x55')](_0x59c7ad);}})[_0x21b3('0x1e')](function(_0x444368){if(_0x444368){_0x3d4de6=_0x444368['length'];if(!_0x479342[_0x21b3('0x3a')][_0x21b3('0x58')](_0x21b3('0x3f'))){_0x59c7ad[_0x21b3('0x2c')]=qs['limit'](_0x479342[_0x21b3('0x3a')][_0x21b3('0x2c')]);_0x59c7ad[_0x21b3('0x2b')]=qs[_0x21b3('0x2b')](_0x479342['query'][_0x21b3('0x2b')]);}return _0x4684d8[_0x21b3('0x55')](_0x59c7ad);}})['then'](function(_0x43ebed){if(_0x43ebed){return _0x43ebed?{'count':_0x3d4de6,'rows':_0x43ebed}:null;}})[_0x21b3('0x1e')](respondWithResult(_0x2a194c,null))['catch'](handleError(_0x2a194c,null));};exports[_0x21b3('0x59')]=function(_0x47d35c,_0x47e5c8,_0x12074c){if(_0x47d35c[_0x21b3('0x51')]['id']){delete _0x47d35c[_0x21b3('0x51')]['id'];}return db[_0x21b3('0x46')]['findOne']({'where':{'id':_0x47d35c[_0x21b3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x47e5c8,null))[_0x21b3('0x1e')](function(_0x359eb0){if(_0x359eb0){_0x47d35c[_0x21b3('0x51')][_0x21b3('0x5a')]=_0x359eb0['id'];_0x47d35c[_0x21b3('0x51')][_0x21b3('0x5b')]=integrations['getSubjects'](_0x47d35c[_0x21b3('0x51')][_0x21b3('0x5c')],_0x47d35c[_0x21b3('0x51')][_0x21b3('0x38')]);_0x47d35c['body'][_0x21b3('0x5d')]=integrations[_0x21b3('0x5e')](_0x47d35c[_0x21b3('0x51')][_0x21b3('0x5c')],_0x47d35c[_0x21b3('0x51')][_0x21b3('0x38')]);return db[_0x21b3('0x57')][_0x21b3('0x50')](_0x47d35c['body'],{'include':[{'model':db[_0x21b3('0x5f')],'as':_0x21b3('0x5b')},{'model':db[_0x21b3('0x5f')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x47e5c8,null))['catch'](handleError(_0x47e5c8,null));};exports[_0x21b3('0x60')]=function(_0x3605b8,_0x141d46,_0x418d24){var _0x5ee490='';var _0x481a1d=['id',_0x21b3('0x32'),_0x21b3('0x61'),_0x21b3('0x62'),'description',_0x21b3('0x63'),_0x21b3('0x64'),_0x21b3('0x65'),_0x21b3('0x66'),_0x21b3('0x67'),'parent_name',_0x21b3('0x68')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x3605b8[_0x21b3('0x4b')]['id']},'attributes':['id',_0x21b3('0x69'),'password',_0x21b3('0x6a')]})['then'](handleEntityNotFound(_0x141d46,null))[_0x21b3('0x1e')](function(_0x211bcf){if(_0x211bcf){_0x5ee490=_0x211bcf[_0x21b3('0x6a')];var _0x1dc347=_0x5ee490['slice'](-0x1);if(_0x1dc347==='/'){_0x5ee490=_0x5ee490['substring'](0x0,_0x5ee490[_0x21b3('0x6b')](_0x1dc347));}return rp({'method':_0x21b3('0x6c'),'uri':util[_0x21b3('0x6d')](_0x21b3('0x6e'),_0x5ee490,_0x21b3('0x6f')),'json':!![],'form':{'method':_0x21b3('0x70'),'input_type':'JSON','response_type':_0x21b3('0x71'),'rest_data':JSON[_0x21b3('0x23')]({'user_auth':{'user_name':_0x211bcf[_0x21b3('0x69')],'password':_0x211bcf['password'],'encryption':'PLAIN'},'application':_0x21b3('0x72')})}});}})['then'](function(_0x1e5da3){if(_0x1e5da3&&_0x1e5da3[_0x21b3('0x32')]!=='Invalid\x20Login'&&_0x1e5da3['name']!=='Password\x20Expired'){return rp({'method':_0x21b3('0x6c'),'uri':util[_0x21b3('0x6d')]('%s%s',_0x5ee490,_0x21b3('0x6f')),'json':!![],'form':{'method':_0x21b3('0x73'),'input_type':_0x21b3('0x71'),'response_type':_0x21b3('0x71'),'rest_data':JSON['stringify']({'session':_0x1e5da3['id'],'module_name':_0x21b3('0x74')})}})['then'](function(_0x4a7e3f){if(_0x4a7e3f){var _0x8937b9=_[_0x21b3('0x75')](_0x4a7e3f[_0x21b3('0x76')]);_[_0x21b3('0x77')](_0x8937b9,function(_0x3441a2){return _0x481a1d[_0x21b3('0x78')](_0x3441a2[_0x21b3('0x32')]);});return{'count':_0x8937b9[_0x21b3('0x4d')],'rows':_[_0x21b3('0x35')](_0x8937b9,function(_0x418d62){return{'id':_0x418d62['name'],'name':_0x418d62[_0x21b3('0x79')],'custom':_['endsWith'](_0x418d62[_0x21b3('0x32')],'_c')?!![]:![],'options':_0x418d62['options']?_[_0x21b3('0x35')](_['values'](_0x418d62['options']),function(_0x3a711c){return{'name':_0x3a711c[_0x21b3('0x7a')],'value':_0x3a711c['name']};}):[]};})};}})[_0x21b3('0x1e')](respondWithResult(_0x141d46,null))[_0x21b3('0x53')](function(_0x651b46){var _0x1e5afb=_0x3605b8[_0x21b3('0x3a')][_0x21b3('0x1b')]?0x1f4:_0x651b46[_0x21b3('0x7b')]||0x1f4;logger[_0x21b3('0x24')](_0x21b3('0x7c'),_0x21b3('0x60'),_0x1e5afb,JSON[_0x21b3('0x23')](_0x651b46));delete _0x651b46[_0x21b3('0x32')];if(_0x1e5afb===0x191){_0x1e5afb=0x190;}_0x141d46[_0x21b3('0x27')](_0x1e5afb)[_0x21b3('0x33')](_0x3605b8[_0x21b3('0x3a')][_0x21b3('0x1b')]?{'message':_0x21b3('0x7d'),'statusCode':_0x651b46['statusCode']}:_0x651b46);});}else{var _0x2f18db=0x1f4;_0x141d46[_0x21b3('0x27')](_0x2f18db)[_0x21b3('0x33')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
index f730cb1..3f7d48d 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0cbc=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0cbc,0xa7));var _0xc0cb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0cbc[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xc0cb('0x0'));var util=require(_0xc0cb('0x1'));var logger=require(_0xc0cb('0x2'))('api');var moment=require(_0xc0cb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc0cb('0x4'));var config=require('../../config/environment');var attributes=require(_0xc0cb('0x5'));var integrations=require(_0xc0cb('0x6'));module[_0xc0cb('0x7')]=function(_0x567e1c,_0x56aee2){return _0x567e1c[_0xc0cb('0x8')](_0xc0cb('0x9'),attributes,{'tableName':_0xc0cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x07c8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x2d85d9,_0x3608f3){var _0x3b23c3=function(_0x3e3ca7){while(--_0x3e3ca7){_0x2d85d9['push'](_0x2d85d9['shift']());}};_0x3b23c3(++_0x3608f3);}(_0x07c8,0x1b3));var _0x807c=function(_0x5e3743,_0x2e1a8a){_0x5e3743=_0x5e3743-0x0;var _0x273581=_0x07c8[_0x5e3743];return _0x273581;};'use strict';var _=require(_0x807c('0x0'));var util=require(_0x807c('0x1'));var logger=require(_0x807c('0x2'))(_0x807c('0x3'));var moment=require(_0x807c('0x4'));var BPromise=require(_0x807c('0x5'));var rp=require(_0x807c('0x6'));var fs=require('fs');var path=require(_0x807c('0x7'));var rimraf=require(_0x807c('0x8'));var config=require(_0x807c('0x9'));var attributes=require(_0x807c('0xa'));var integrations=require(_0x807c('0xb'));module[_0x807c('0xc')]=function(_0x1c8012,_0x427dcd){return _0x1c8012['define'](_0x807c('0xd'),attributes,{'tableName':_0x807c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
index 0353abc..33466ed 100644
--- a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
+++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4330=['http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','SugarcrmAccount','options','raw','where','limit','include','map','model','GetSugarcrmAccount','stringify','ShowSugarcrmAccount','find','attributes','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x4330,0x128));var _0x0433=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x4330[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require(_0x0433('0x0'));var moment=require(_0x0433('0x1'));var BPromise=require(_0x0433('0x2'));var rs=require(_0x0433('0x3'));var fs=require('fs');var Redis=require(_0x0433('0x4'));var db=require(_0x0433('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0433('0x6'))('rpc');var config=require(_0x0433('0x7'));var jayson=require(_0x0433('0x8'));var client=jayson[_0x0433('0x9')][_0x0433('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b90fe,_0x8cbea9,_0x37de14){return new BPromise(function(_0x279cdd,_0x19f4c9){return client[_0x0433('0xb')](_0x1b90fe,_0x37de14)[_0x0433('0xc')](function(_0x245bf3){logger[_0x0433('0xd')](_0x0433('0xe'),_0x8cbea9,_0x0433('0xf'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x8cbea9,_0x0433('0xf'),JSON['stringify'](_0x245bf3));if(_0x245bf3[_0x0433('0x10')]){if(_0x245bf3[_0x0433('0x10')]['code']===0x1f4){logger[_0x0433('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x8cbea9,_0x245bf3[_0x0433('0x10')][_0x0433('0x11')]);return _0x19f4c9(_0x245bf3[_0x0433('0x10')][_0x0433('0x11')]);}logger[_0x0433('0x10')](_0x0433('0xe'),_0x8cbea9,_0x245bf3[_0x0433('0x10')]['message']);return _0x279cdd(_0x245bf3[_0x0433('0x10')][_0x0433('0x11')]);}else{logger[_0x0433('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x8cbea9,_0x0433('0xf'));_0x279cdd(_0x245bf3[_0x0433('0x12')][_0x0433('0x11')]);}})[_0x0433('0x13')](function(_0x2e983c){logger[_0x0433('0x10')](_0x0433('0xe'),_0x8cbea9,_0x2e983c);_0x19f4c9(_0x2e983c);});});}exports['GetSugarcrmAccount']=function(_0x3a19aa){var _0x483704=this;return new Promise(function(_0x4f3665,_0xcf6ebd){return db[_0x0433('0x14')]['findAll']({'raw':_0x3a19aa[_0x0433('0x15')]?_0x3a19aa[_0x0433('0x15')][_0x0433('0x16')]===undefined?!![]:![]:!![],'where':_0x3a19aa[_0x0433('0x15')]?_0x3a19aa['options'][_0x0433('0x17')]||null:null,'attributes':_0x3a19aa[_0x0433('0x15')]?_0x3a19aa[_0x0433('0x15')]['attributes']||null:null,'limit':_0x3a19aa[_0x0433('0x15')]?_0x3a19aa[_0x0433('0x15')][_0x0433('0x18')]||null:null,'include':_0x3a19aa[_0x0433('0x15')]?_0x3a19aa['options'][_0x0433('0x19')]?_[_0x0433('0x1a')](_0x3a19aa[_0x0433('0x15')][_0x0433('0x19')],function(_0x34df04){return{'model':db[_0x34df04['model']],'as':_0x34df04['as'],'attributes':_0x34df04['attributes'],'include':_0x34df04[_0x0433('0x19')]?_[_0x0433('0x1a')](_0x34df04['include'],function(_0x1025b6){return{'model':db[_0x1025b6['model']],'as':_0x1025b6['as'],'attributes':_0x1025b6['attributes'],'include':_0x1025b6['include']?_[_0x0433('0x1a')](_0x1025b6[_0x0433('0x19')],function(_0x378f34){return{'model':db[_0x378f34[_0x0433('0x1b')]],'as':_0x378f34['as'],'attributes':_0x378f34['attributes']};}):[]};}):[]};}):[]:[]})[_0x0433('0xc')](function(_0x350857){logger[_0x0433('0xd')](_0x0433('0x1c'),_0x3a19aa);logger['debug'](_0x0433('0x1c'),_0x3a19aa,JSON[_0x0433('0x1d')](_0x350857));_0x4f3665(_0x350857);})[_0x0433('0x13')](function(_0x23baad){logger['error'](_0x0433('0x1c'),_0x23baad[_0x0433('0x11')],_0x3a19aa);_0xcf6ebd(_0x483704[_0x0433('0x10')](0x1f4,_0x23baad[_0x0433('0x11')]));});});};exports[_0x0433('0x1e')]=function(_0x21ddcb){var _0x3f52de=this;return new Promise(function(_0x1ded05,_0x4241f){return db[_0x0433('0x14')][_0x0433('0x1f')]({'raw':_0x21ddcb['options']?_0x21ddcb['options'][_0x0433('0x16')]===undefined?!![]:![]:!![],'where':_0x21ddcb[_0x0433('0x15')]?_0x21ddcb['options'][_0x0433('0x17')]||null:null,'attributes':_0x21ddcb[_0x0433('0x15')]?_0x21ddcb[_0x0433('0x15')][_0x0433('0x20')]||null:null,'include':_0x21ddcb[_0x0433('0x15')]?_0x21ddcb[_0x0433('0x15')][_0x0433('0x19')]?_[_0x0433('0x1a')](_0x21ddcb[_0x0433('0x15')][_0x0433('0x19')],function(_0x5463ab){return{'model':db[_0x5463ab['model']],'as':_0x5463ab['as'],'attributes':_0x5463ab[_0x0433('0x20')],'include':_0x5463ab['include']?_['map'](_0x5463ab[_0x0433('0x19')],function(_0x222458){return{'model':db[_0x222458[_0x0433('0x1b')]],'as':_0x222458['as'],'attributes':_0x222458[_0x0433('0x20')],'include':_0x222458[_0x0433('0x19')]?_[_0x0433('0x1a')](_0x222458[_0x0433('0x19')],function(_0x5aaf1d){return{'model':db[_0x5aaf1d[_0x0433('0x1b')]],'as':_0x5aaf1d['as'],'attributes':_0x5aaf1d[_0x0433('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x334673){logger[_0x0433('0xd')]('ShowSugarcrmAccount',_0x21ddcb);logger[_0x0433('0x21')](_0x0433('0x1e'),_0x21ddcb,JSON[_0x0433('0x1d')](_0x334673));_0x1ded05(_0x334673);})[_0x0433('0x13')](function(_0x1a7755){logger[_0x0433('0x10')](_0x0433('0x1e'),_0x1a7755[_0x0433('0x11')],_0x21ddcb);_0x4241f(_0x3f52de[_0x0433('0x10')](0x1f4,_0x1a7755['message']));});});};
\ No newline at end of file
+var _0x19ed=['model','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','where','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','options','raw','attributes','limit','include','map'];(function(_0xf58718,_0x33541a){var _0x5aea10=function(_0x16f386){while(--_0x16f386){_0xf58718['push'](_0xf58718['shift']());}};_0x5aea10(++_0x33541a);}(_0x19ed,0x17c));var _0xd19e=function(_0x2484e6,_0x2cbe6c){_0x2484e6=_0x2484e6-0x0;var _0x20efaf=_0x19ed[_0x2484e6];return _0x20efaf;};'use strict';var _=require(_0xd19e('0x0'));var util=require('util');var moment=require(_0xd19e('0x1'));var BPromise=require(_0xd19e('0x2'));var rs=require(_0xd19e('0x3'));var fs=require('fs');var Redis=require(_0xd19e('0x4'));var db=require(_0xd19e('0x5'))['db'];var utils=require(_0xd19e('0x6'));var logger=require(_0xd19e('0x7'))(_0xd19e('0x8'));var config=require(_0xd19e('0x9'));var jayson=require(_0xd19e('0xa'));var client=jayson['client'][_0xd19e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5da6e3,_0x2422aa,_0x48c7b7){return new BPromise(function(_0x3a7680,_0x3728d1){return client['request'](_0x5da6e3,_0x48c7b7)['then'](function(_0x5e5c40){logger[_0xd19e('0xc')](_0xd19e('0xd'),_0x2422aa,'request\x20sent');logger['debug'](_0xd19e('0xe'),_0x2422aa,'request\x20sent',JSON[_0xd19e('0xf')](_0x5e5c40));if(_0x5e5c40[_0xd19e('0x10')]){if(_0x5e5c40['error']['code']===0x1f4){logger[_0xd19e('0x10')](_0xd19e('0xd'),_0x2422aa,_0x5e5c40['error'][_0xd19e('0x11')]);return _0x3728d1(_0x5e5c40[_0xd19e('0x10')]['message']);}logger[_0xd19e('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x2422aa,_0x5e5c40[_0xd19e('0x10')]['message']);return _0x3a7680(_0x5e5c40[_0xd19e('0x10')]['message']);}else{logger[_0xd19e('0xc')](_0xd19e('0xd'),_0x2422aa,_0xd19e('0x12'));_0x3a7680(_0x5e5c40[_0xd19e('0x13')]['message']);}})[_0xd19e('0x14')](function(_0x3d9223){logger[_0xd19e('0x10')](_0xd19e('0xd'),_0x2422aa,_0x3d9223);_0x3728d1(_0x3d9223);});});}exports['GetSugarcrmAccount']=function(_0x349cf1){var _0x42c159=this;return new Promise(function(_0x4b78ee,_0x30dd88){return db['SugarcrmAccount'][_0xd19e('0x15')]({'raw':_0x349cf1[_0xd19e('0x16')]?_0x349cf1[_0xd19e('0x16')][_0xd19e('0x17')]===undefined?!![]:![]:!![],'where':_0x349cf1[_0xd19e('0x16')]?_0x349cf1[_0xd19e('0x16')]['where']||null:null,'attributes':_0x349cf1[_0xd19e('0x16')]?_0x349cf1[_0xd19e('0x16')][_0xd19e('0x18')]||null:null,'limit':_0x349cf1['options']?_0x349cf1[_0xd19e('0x16')][_0xd19e('0x19')]||null:null,'include':_0x349cf1[_0xd19e('0x16')]?_0x349cf1['options'][_0xd19e('0x1a')]?_[_0xd19e('0x1b')](_0x349cf1[_0xd19e('0x16')][_0xd19e('0x1a')],function(_0x23be09){return{'model':db[_0x23be09['model']],'as':_0x23be09['as'],'attributes':_0x23be09[_0xd19e('0x18')],'include':_0x23be09[_0xd19e('0x1a')]?_[_0xd19e('0x1b')](_0x23be09[_0xd19e('0x1a')],function(_0x1f5161){return{'model':db[_0x1f5161['model']],'as':_0x1f5161['as'],'attributes':_0x1f5161[_0xd19e('0x18')],'include':_0x1f5161[_0xd19e('0x1a')]?_[_0xd19e('0x1b')](_0x1f5161[_0xd19e('0x1a')],function(_0x253042){return{'model':db[_0x253042[_0xd19e('0x1c')]],'as':_0x253042['as'],'attributes':_0x253042['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1af6bd){logger[_0xd19e('0xc')](_0xd19e('0x1d'),_0x349cf1);logger['debug'](_0xd19e('0x1d'),_0x349cf1,JSON[_0xd19e('0xf')](_0x1af6bd));_0x4b78ee(_0x1af6bd);})[_0xd19e('0x14')](function(_0x3f29bb){logger['error']('GetSugarcrmAccount',_0x3f29bb[_0xd19e('0x11')],_0x349cf1);_0x30dd88(_0x42c159['error'](0x1f4,_0x3f29bb[_0xd19e('0x11')]));});});};exports[_0xd19e('0x1e')]=function(_0x3dd8d8){var _0xb201ac=this;return new Promise(function(_0x1ab467,_0xa42302){return db[_0xd19e('0x1f')]['find']({'raw':_0x3dd8d8[_0xd19e('0x16')]?_0x3dd8d8['options'][_0xd19e('0x17')]===undefined?!![]:![]:!![],'where':_0x3dd8d8[_0xd19e('0x16')]?_0x3dd8d8[_0xd19e('0x16')][_0xd19e('0x20')]||null:null,'attributes':_0x3dd8d8['options']?_0x3dd8d8['options']['attributes']||null:null,'include':_0x3dd8d8[_0xd19e('0x16')]?_0x3dd8d8['options']['include']?_['map'](_0x3dd8d8['options'][_0xd19e('0x1a')],function(_0x3ecf83){return{'model':db[_0x3ecf83['model']],'as':_0x3ecf83['as'],'attributes':_0x3ecf83[_0xd19e('0x18')],'include':_0x3ecf83[_0xd19e('0x1a')]?_['map'](_0x3ecf83[_0xd19e('0x1a')],function(_0x270af9){return{'model':db[_0x270af9['model']],'as':_0x270af9['as'],'attributes':_0x270af9[_0xd19e('0x18')],'include':_0x270af9[_0xd19e('0x1a')]?_[_0xd19e('0x1b')](_0x270af9['include'],function(_0x523406){return{'model':db[_0x523406['model']],'as':_0x523406['as'],'attributes':_0x523406[_0xd19e('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd19e('0x21')](function(_0x4c27f0){logger[_0xd19e('0xc')](_0xd19e('0x1e'),_0x3dd8d8);logger['debug']('ShowSugarcrmAccount',_0x3dd8d8,JSON['stringify'](_0x4c27f0));_0x1ab467(_0x4c27f0);})[_0xd19e('0x14')](function(_0x3f8c7d){logger[_0xd19e('0x10')](_0xd19e('0x1e'),_0x3f8c7d[_0xd19e('0x11')],_0x3dd8d8);_0xa42302(_0xb201ac[_0xd19e('0x10')](0x1f4,_0x3f8c7d['message']));});});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js
index 3c886bc..6b999c2 100644
--- a/server/api/intSugarcrmConfiguration/index.js
+++ b/server/api/intSugarcrmConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29bf=['destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x29bf,0x1ce));var _0xf29b=function(_0x4a50ef,_0x1731bf){_0x4a50ef=_0x4a50ef-0x0;var _0x17ab1b=_0x29bf[_0x4a50ef];return _0x17ab1b;};'use strict';var multer=require(_0xf29b('0x0'));var util=require('util');var path=require(_0xf29b('0x1'));var timeout=require(_0xf29b('0x2'));var express=require('express');var router=express[_0xf29b('0x3')]();var auth=require(_0xf29b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf29b('0x5'));var controller=require(_0xf29b('0x6'));router[_0xf29b('0x7')]('/',auth[_0xf29b('0x8')](),controller[_0xf29b('0x9')]);router['get'](_0xf29b('0xa'),auth['isAuthenticated'](),controller[_0xf29b('0xb')]);router[_0xf29b('0x7')](_0xf29b('0xc'),auth[_0xf29b('0x8')](),controller[_0xf29b('0xd')]);router['get']('/:id/subjects',auth[_0xf29b('0x8')](),controller[_0xf29b('0xe')]);router[_0xf29b('0x7')](_0xf29b('0xf'),auth[_0xf29b('0x8')](),controller[_0xf29b('0x10')]);router[_0xf29b('0x11')]('/',auth['isAuthenticated'](),controller[_0xf29b('0x12')]);router[_0xf29b('0x13')](_0xf29b('0xa'),auth[_0xf29b('0x8')](),controller[_0xf29b('0x14')]);router['delete'](_0xf29b('0xa'),auth[_0xf29b('0x8')](),controller[_0xf29b('0x15')]);module[_0xf29b('0x16')]=router;
\ No newline at end of file
+var _0xe3f7=['getDescriptions','create','put','/:id','update','delete','destroy','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/subjects','/:id/descriptions'];(function(_0x552b29,_0x365617){var _0xc8565e=function(_0x371105){while(--_0x371105){_0x552b29['push'](_0x552b29['shift']());}};_0xc8565e(++_0x365617);}(_0xe3f7,0xcd));var _0x7e3f=function(_0x119a29,_0x4456fa){_0x119a29=_0x119a29-0x0;var _0x52750f=_0xe3f7[_0x119a29];return _0x52750f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7e3f('0x0'));var express=require(_0x7e3f('0x1'));var router=express[_0x7e3f('0x2')]();var auth=require(_0x7e3f('0x3'));var interaction=require(_0x7e3f('0x4'));var config=require(_0x7e3f('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x7e3f('0x6')]('/',auth[_0x7e3f('0x7')](),controller['index']);router['get']('/:id',auth[_0x7e3f('0x7')](),controller[_0x7e3f('0x8')]);router[_0x7e3f('0x6')]('/:id/fields',auth[_0x7e3f('0x7')](),controller['getFields']);router[_0x7e3f('0x6')](_0x7e3f('0x9'),auth[_0x7e3f('0x7')](),controller['getSubjects']);router[_0x7e3f('0x6')](_0x7e3f('0xa'),auth[_0x7e3f('0x7')](),controller[_0x7e3f('0xb')]);router['post']('/',auth[_0x7e3f('0x7')](),controller[_0x7e3f('0xc')]);router[_0x7e3f('0xd')](_0x7e3f('0xe'),auth[_0x7e3f('0x7')](),controller[_0x7e3f('0xf')]);router[_0x7e3f('0x10')]('/:id',auth[_0x7e3f('0x7')](),controller[_0x7e3f('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
index d8cafa8..155523d 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7600=['STRING','sequelize'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x7600,0x8d));var _0x0760=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7600[_0xa8883];return _0x479426;};'use strict';var Sequelize=require(_0x0760('0x0'));module['exports']={'name':{'type':Sequelize[_0x0760('0x1')]},'description':{'type':Sequelize[_0x0760('0x1')]}};
\ No newline at end of file
+var _0xf14f=['exports','STRING','sequelize'];(function(_0x2389cd,_0x134ccf){var _0x33c274=function(_0x47738f){while(--_0x47738f){_0x2389cd['push'](_0x2389cd['shift']());}};_0x33c274(++_0x134ccf);}(_0xf14f,0x152));var _0xff14=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0xf14f[_0x2b0a86];return _0x955940;};'use strict';var Sequelize=require(_0xff14('0x0'));module[_0xff14('0x1')]={'name':{'type':Sequelize[_0xff14('0x2')]},'description':{'type':Sequelize[_0xff14('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
index 9b662f9..f36589f 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9310=['ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','keys','create','body','find','getFields','pick','getSubjects','findOne','SugarcrmField','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','Sequelize'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x9310,0x15e));var _0x0931=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0x9310[_0x12ca5f];return _0xfc3ae9;};'use strict';var pdf=require(_0x0931('0x0'));var emlformat=require(_0x0931('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0931('0x2'));var jsonpatch=require(_0x0931('0x3'));var rp=require(_0x0931('0x4'));var moment=require(_0x0931('0x5'));var BPromise=require(_0x0931('0x6'));var Mustache=require(_0x0931('0x7'));var util=require('util');var path=require(_0x0931('0x8'));var sox=require('sox');var csv=require(_0x0931('0x9'));var ejs=require(_0x0931('0xa'));var fs=require('fs');var _=require(_0x0931('0xb'));var squel=require(_0x0931('0xc'));var crypto=require(_0x0931('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0931('0x9'));var querystring=require('querystring');var Papa=require(_0x0931('0xe'));var Redis=require('ioredis');var authService=require(_0x0931('0xf'));var qs=require(_0x0931('0x10'));var as=require(_0x0931('0x11'));var hardwareService=require(_0x0931('0x12'));var logger=require(_0x0931('0x13'))(_0x0931('0x14'));var utils=require(_0x0931('0x15'));var config=require(_0x0931('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0931('0x17'));var client=jayson[_0x0931('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x314a45,_0x1e212d,_0x5cbd87){if(_0x5cbd87){var _0x4f88dd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f88dd['test'](_0x1e212d)){return _0x314a45;}else{throw new db[(_0x0931('0x19'))][(_0x0931('0x1a'))](_0x0931('0x1b'));}}else{return _0x314a45;}}function respondWithRpcPromise(_0x38bf3a,_0x276875,_0x1b69f3,_0x55beea){return new BPromise(function(_0xe947c4,_0x2038e7){var _0x425327=_0x55beea||client;return _0x425327[_0x0931('0x1c')](_0x38bf3a,_0x1b69f3)[_0x0931('0x1d')](function(_0x1a05c4){logger['info'](_0x0931('0x1e'),_0x276875,_0x0931('0x1f'));logger[_0x0931('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x276875,_0x0931('0x1f'),JSON[_0x0931('0x21')](_0x1a05c4));if(_0x1a05c4[_0x0931('0x22')]){if(_0x1a05c4['error'][_0x0931('0x23')]===0x1f4){logger[_0x0931('0x22')](_0x0931('0x1e'),_0x276875,_0x1a05c4[_0x0931('0x22')]['message']);return _0x2038e7(_0x1a05c4[_0x0931('0x22')][_0x0931('0x24')]);}logger[_0x0931('0x22')](_0x0931('0x1e'),_0x276875,_0x1a05c4[_0x0931('0x22')][_0x0931('0x24')]);return _0xe947c4(_0x1a05c4['error'][_0x0931('0x24')]);}else{logger[_0x0931('0x25')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x276875,_0x0931('0x1f'));_0xe947c4(_0x1a05c4[_0x0931('0x26')][_0x0931('0x24')]);}})[_0x0931('0x27')](function(_0x3f83d8){logger[_0x0931('0x22')](_0x0931('0x1e'),_0x276875,_0x3f83d8);_0x2038e7(_0x3f83d8);});});}function respondWithStatusCode(_0x39ffc1,_0x1adae3){_0x1adae3=_0x1adae3||0xcc;return function(_0x58ae02){if(_0x58ae02){return _0x39ffc1['sendStatus'](_0x1adae3);}return _0x39ffc1[_0x0931('0x28')](_0x1adae3)[_0x0931('0x29')]();};}function respondWithResult(_0x49d744,_0x1c0913){_0x1c0913=_0x1c0913||0xc8;return function(_0x196f8c){if(_0x196f8c){return _0x49d744[_0x0931('0x28')](_0x1c0913)['json'](_0x196f8c);}};}function respondWithFilteredResult(_0x1dd7cc,_0x5dec1b){return function(_0x5f33b1){if(_0x5f33b1){var _0x4e5395=_0x5f33b1['count'],_0x4ee551=_0x5dec1b[_0x0931('0x2a')],_0x10dcac=_0x5dec1b['offset']+_0x5dec1b[_0x0931('0x2b')],_0x50f805;if(_0x10dcac>=_0x4e5395){_0x10dcac=_0x4e5395;_0x50f805=0xc8;}else{_0x50f805=0xce;}_0x1dd7cc['status'](_0x50f805);return _0x1dd7cc[_0x0931('0x2c')](_0x0931('0x2d'),_0x4ee551+'-'+_0x10dcac+'/'+_0x4e5395)[_0x0931('0x2e')](_0x5f33b1);}return null;};}function patchUpdates(_0x460d21){return function(_0x1dd0e4){try{jsonpatch[_0x0931('0x2f')](_0x1dd0e4,_0x460d21,!![]);}catch(_0x58a52d){return BPromise[_0x0931('0x30')](_0x58a52d);}return _0x1dd0e4['save']();};}function saveUpdates(_0x4bcd53,_0x3bb9a4){return function(_0x38decf){if(_0x38decf){return _0x38decf[_0x0931('0x31')](_0x4bcd53)['then'](function(_0x4091f3){return _0x4091f3;});}return null;};}function removeEntity(_0x3f47c3,_0x12decc){return function(_0x2d9e11){if(_0x2d9e11){return _0x2d9e11[_0x0931('0x32')]()[_0x0931('0x1d')](function(){_0x3f47c3[_0x0931('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc3c8fb,_0x41b3c1){return function(_0x121e44){if(!_0x121e44){_0xc3c8fb[_0x0931('0x33')](0x194);}return _0x121e44;};}function handleError(_0x22d612,_0x14a03b){_0x14a03b=_0x14a03b||0x1f4;return function(_0x5d7d8e){logger['error'](_0x5d7d8e[_0x0931('0x34')]);if(_0x5d7d8e[_0x0931('0x35')]){delete _0x5d7d8e['name'];}_0x22d612[_0x0931('0x28')](_0x14a03b)[_0x0931('0x36')](_0x5d7d8e);};}exports[_0x0931('0x37')]=function(_0x7da09d,_0x4c5aa0){var _0x390499={},_0x4ef01c={},_0xbc8146={'count':0x0,'rows':[]};var _0xa0b570=_[_0x0931('0x38')](db[_0x0931('0x39')][_0x0931('0x3a')],function(_0x939cd){return{'name':_0x939cd[_0x0931('0x3b')],'type':_0x939cd[_0x0931('0x3c')][_0x0931('0x3d')]};});_0x4ef01c[_0x0931('0x3e')]=_[_0x0931('0x38')](_0xa0b570,_0x0931('0x35'));_0x4ef01c[_0x0931('0x3f')]=_['keys'](_0x7da09d[_0x0931('0x3f')]);_0x4ef01c['filters']=_[_0x0931('0x40')](_0x4ef01c[_0x0931('0x3e')],_0x4ef01c[_0x0931('0x3f')]);_0x390499[_0x0931('0x41')]=_[_0x0931('0x40')](_0x4ef01c[_0x0931('0x3e')],qs[_0x0931('0x42')](_0x7da09d['query'][_0x0931('0x42')]));_0x390499[_0x0931('0x41')]=_0x390499['attributes'][_0x0931('0x43')]?_0x390499[_0x0931('0x41')]:_0x4ef01c['model'];if(!_0x7da09d['query'][_0x0931('0x44')](_0x0931('0x45'))){_0x390499[_0x0931('0x2b')]=qs[_0x0931('0x2b')](_0x7da09d[_0x0931('0x3f')][_0x0931('0x2b')]);_0x390499[_0x0931('0x2a')]=qs[_0x0931('0x2a')](_0x7da09d['query'][_0x0931('0x2a')]);}_0x390499[_0x0931('0x46')]=qs[_0x0931('0x47')](_0x7da09d[_0x0931('0x3f')]['sort']);_0x390499[_0x0931('0x48')]=qs['filters'](_['pick'](_0x7da09d[_0x0931('0x3f')],_0x4ef01c[_0x0931('0x49')]),_0xa0b570);if(_0x7da09d[_0x0931('0x3f')][_0x0931('0x4a')]){_0x390499['where']=_[_0x0931('0x4b')](_0x390499[_0x0931('0x48')],{'$or':_[_0x0931('0x38')](_0xa0b570,function(_0x3a6837){if(_0x3a6837[_0x0931('0x3c')]!==_0x0931('0x4c')){var _0x5e1324={};_0x5e1324[_0x3a6837['name']]={'$like':'%'+_0x7da09d[_0x0931('0x3f')][_0x0931('0x4a')]+'%'};return _0x5e1324;}})});}_0x390499=_['merge']({},_0x390499,_0x7da09d[_0x0931('0x4d')]);var _0x4a7b0a={'where':_0x390499[_0x0931('0x48')]};return db[_0x0931('0x39')][_0x0931('0x4e')](_0x4a7b0a)[_0x0931('0x1d')](function(_0x29842f){_0xbc8146[_0x0931('0x4e')]=_0x29842f;if(_0x7da09d[_0x0931('0x3f')][_0x0931('0x4f')]){_0x390499[_0x0931('0x50')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x0931('0x51')](_0x390499);})[_0x0931('0x1d')](function(_0x1f04d0){_0xbc8146['rows']=_0x1f04d0;return _0xbc8146;})[_0x0931('0x1d')](respondWithFilteredResult(_0x4c5aa0,_0x390499))['catch'](handleError(_0x4c5aa0,null));};exports[_0x0931('0x52')]=function(_0x4fef0e,_0x385042){var _0x30df97={'raw':![],'where':{'id':_0x4fef0e[_0x0931('0x53')]['id']}},_0x2562cb={};_0x2562cb['model']=_['keys'](db[_0x0931('0x39')]['rawAttributes']);_0x2562cb[_0x0931('0x3f')]=_[_0x0931('0x54')](_0x4fef0e[_0x0931('0x3f')]);_0x2562cb['filters']=_['intersection'](_0x2562cb[_0x0931('0x3e')],_0x2562cb['query']);_0x30df97[_0x0931('0x41')]=_[_0x0931('0x40')](_0x2562cb[_0x0931('0x3e')],qs['fields'](_0x4fef0e[_0x0931('0x3f')]['fields']));_0x30df97[_0x0931('0x41')]=_0x30df97[_0x0931('0x41')][_0x0931('0x43')]?_0x30df97[_0x0931('0x41')]:_0x2562cb[_0x0931('0x3e')];if(_0x4fef0e[_0x0931('0x3f')][_0x0931('0x4f')]){_0x30df97[_0x0931('0x50')]=[{'all':!![]}];}_0x30df97=_[_0x0931('0x4b')]({},_0x30df97,_0x4fef0e[_0x0931('0x4d')]);return db[_0x0931('0x39')]['find'](_0x30df97)[_0x0931('0x1d')](handleEntityNotFound(_0x385042,null))['then'](respondWithResult(_0x385042,null))[_0x0931('0x27')](handleError(_0x385042,null));};exports[_0x0931('0x55')]=function(_0x5b1432,_0x2200fe){return db[_0x0931('0x39')][_0x0931('0x55')](_0x5b1432[_0x0931('0x56')],{})[_0x0931('0x1d')](respondWithResult(_0x2200fe,0xc9))[_0x0931('0x27')](handleError(_0x2200fe,null));};exports[_0x0931('0x31')]=function(_0x24b420,_0x44610d){if(_0x24b420[_0x0931('0x56')]['id']){delete _0x24b420[_0x0931('0x56')]['id'];}return db[_0x0931('0x39')][_0x0931('0x57')]({'where':{'id':_0x24b420['params']['id']}})['then'](handleEntityNotFound(_0x44610d,null))['then'](saveUpdates(_0x24b420[_0x0931('0x56')],null))[_0x0931('0x1d')](respondWithResult(_0x44610d,null))[_0x0931('0x27')](handleError(_0x44610d,null));};exports[_0x0931('0x32')]=function(_0x1702e8,_0x2921ae){return db[_0x0931('0x39')][_0x0931('0x57')]({'where':{'id':_0x1702e8['params']['id']}})[_0x0931('0x1d')](handleEntityNotFound(_0x2921ae,null))['then'](removeEntity(_0x2921ae,null))['catch'](handleError(_0x2921ae,null));};exports[_0x0931('0x58')]=function(_0x6fce9a,_0x5243b9,_0x2bf6ea){var _0x390169={};var _0x53ae1b={};var _0x3311bb;var _0x2e7238;return db[_0x0931('0x39')]['findOne']({'where':{'id':_0x6fce9a[_0x0931('0x53')]['id']}})[_0x0931('0x1d')](handleEntityNotFound(_0x5243b9,null))[_0x0931('0x1d')](function(_0x211932){if(_0x211932){_0x3311bb=_0x211932;_0x53ae1b[_0x0931('0x3e')]=_[_0x0931('0x54')](db['SugarcrmField']['rawAttributes']);_0x53ae1b['query']=_[_0x0931('0x54')](_0x6fce9a['query']);_0x53ae1b['filters']=_['intersection'](_0x53ae1b[_0x0931('0x3e')],_0x53ae1b[_0x0931('0x3f')]);_0x390169[_0x0931('0x41')]=_[_0x0931('0x40')](_0x53ae1b[_0x0931('0x3e')],qs[_0x0931('0x42')](_0x6fce9a['query'][_0x0931('0x42')]));_0x390169[_0x0931('0x41')]=_0x390169[_0x0931('0x41')][_0x0931('0x43')]?_0x390169['attributes']:_0x53ae1b[_0x0931('0x3e')];_0x390169[_0x0931('0x46')]=qs[_0x0931('0x47')](_0x6fce9a[_0x0931('0x3f')]['sort']);_0x390169['where']=qs['filters'](_[_0x0931('0x59')](_0x6fce9a['query'],_0x53ae1b[_0x0931('0x49')]));if(_0x6fce9a[_0x0931('0x3f')]['filter']){_0x390169[_0x0931('0x48')]=_['merge'](_0x390169['where'],{'$or':_['map'](_0x390169[_0x0931('0x41')],function(_0x4d89f8){var _0x3a20b5={};_0x3a20b5[_0x4d89f8]={'$like':'%'+_0x6fce9a['query'][_0x0931('0x4a')]+'%'};return _0x3a20b5;})});}_0x390169=_[_0x0931('0x4b')]({},_0x390169,_0x6fce9a[_0x0931('0x4d')]);return _0x3311bb[_0x0931('0x58')](_0x390169);}})[_0x0931('0x1d')](function(_0x31b98b){if(_0x31b98b){_0x2e7238=_0x31b98b[_0x0931('0x43')];if(!_0x6fce9a[_0x0931('0x3f')][_0x0931('0x44')](_0x0931('0x45'))){_0x390169[_0x0931('0x2b')]=qs['limit'](_0x6fce9a['query'][_0x0931('0x2b')]);_0x390169[_0x0931('0x2a')]=qs[_0x0931('0x2a')](_0x6fce9a[_0x0931('0x3f')][_0x0931('0x2a')]);}return _0x3311bb['getFields'](_0x390169);}})[_0x0931('0x1d')](function(_0x33fdf1){if(_0x33fdf1){return _0x33fdf1?{'count':_0x2e7238,'rows':_0x33fdf1}:null;}})[_0x0931('0x1d')](respondWithResult(_0x5243b9,null))[_0x0931('0x27')](handleError(_0x5243b9,null));};exports[_0x0931('0x5a')]=function(_0x2de154,_0x590f7,_0x249375){var _0x75e94a={};var _0x3b8acb={};var _0xdc4479;var _0x16857d;return db[_0x0931('0x39')][_0x0931('0x5b')]({'where':{'id':_0x2de154[_0x0931('0x53')]['id']}})[_0x0931('0x1d')](handleEntityNotFound(_0x590f7,null))['then'](function(_0x1d2336){if(_0x1d2336){_0xdc4479=_0x1d2336;_0x3b8acb['model']=_[_0x0931('0x54')](db[_0x0931('0x5c')][_0x0931('0x3a')]);_0x3b8acb[_0x0931('0x3f')]=_[_0x0931('0x54')](_0x2de154[_0x0931('0x3f')]);_0x3b8acb['filters']=_['intersection'](_0x3b8acb[_0x0931('0x3e')],_0x3b8acb['query']);_0x75e94a[_0x0931('0x41')]=_[_0x0931('0x40')](_0x3b8acb[_0x0931('0x3e')],qs[_0x0931('0x42')](_0x2de154[_0x0931('0x3f')][_0x0931('0x42')]));_0x75e94a[_0x0931('0x41')]=_0x75e94a[_0x0931('0x41')]['length']?_0x75e94a[_0x0931('0x41')]:_0x3b8acb['model'];_0x75e94a['order']=qs[_0x0931('0x47')](_0x2de154[_0x0931('0x3f')][_0x0931('0x47')]);_0x75e94a[_0x0931('0x48')]=qs[_0x0931('0x49')](_[_0x0931('0x59')](_0x2de154['query'],_0x3b8acb[_0x0931('0x49')]));if(_0x2de154['query'][_0x0931('0x4a')]){_0x75e94a[_0x0931('0x48')]=_[_0x0931('0x4b')](_0x75e94a[_0x0931('0x48')],{'$or':_[_0x0931('0x38')](_0x75e94a['attributes'],function(_0x3e987c){var _0x4b8556={};_0x4b8556[_0x3e987c]={'$like':'%'+_0x2de154[_0x0931('0x3f')]['filter']+'%'};return _0x4b8556;})});}_0x75e94a=_['merge']({},_0x75e94a,_0x2de154['options']);return _0xdc4479[_0x0931('0x5a')](_0x75e94a);}})[_0x0931('0x1d')](function(_0x3cefd7){if(_0x3cefd7){_0x16857d=_0x3cefd7[_0x0931('0x43')];if(!_0x2de154[_0x0931('0x3f')][_0x0931('0x44')]('nolimit')){_0x75e94a[_0x0931('0x2b')]=qs[_0x0931('0x2b')](_0x2de154[_0x0931('0x3f')][_0x0931('0x2b')]);_0x75e94a[_0x0931('0x2a')]=qs[_0x0931('0x2a')](_0x2de154[_0x0931('0x3f')][_0x0931('0x2a')]);}return _0xdc4479[_0x0931('0x5a')](_0x75e94a);}})[_0x0931('0x1d')](function(_0x2a3cde){if(_0x2a3cde){return _0x2a3cde?{'count':_0x16857d,'rows':_0x2a3cde}:null;}})['then'](respondWithResult(_0x590f7,null))[_0x0931('0x27')](handleError(_0x590f7,null));};exports[_0x0931('0x5d')]=function(_0x1563b7,_0x3313c8,_0x1c9543){var _0x1c3684={};var _0x24dbea={};var _0x3cc6e6;var _0x46a0a1;return db[_0x0931('0x39')]['findOne']({'where':{'id':_0x1563b7[_0x0931('0x53')]['id']}})['then'](handleEntityNotFound(_0x3313c8,null))[_0x0931('0x1d')](function(_0x23ddab){if(_0x23ddab){_0x3cc6e6=_0x23ddab;_0x24dbea[_0x0931('0x3e')]=_['keys'](db[_0x0931('0x5c')][_0x0931('0x3a')]);_0x24dbea[_0x0931('0x3f')]=_['keys'](_0x1563b7[_0x0931('0x3f')]);_0x24dbea['filters']=_[_0x0931('0x40')](_0x24dbea[_0x0931('0x3e')],_0x24dbea['query']);_0x1c3684[_0x0931('0x41')]=_['intersection'](_0x24dbea[_0x0931('0x3e')],qs[_0x0931('0x42')](_0x1563b7['query']['fields']));_0x1c3684[_0x0931('0x41')]=_0x1c3684['attributes']['length']?_0x1c3684[_0x0931('0x41')]:_0x24dbea[_0x0931('0x3e')];_0x1c3684[_0x0931('0x46')]=qs['sort'](_0x1563b7[_0x0931('0x3f')][_0x0931('0x47')]);_0x1c3684[_0x0931('0x48')]=qs[_0x0931('0x49')](_[_0x0931('0x59')](_0x1563b7[_0x0931('0x3f')],_0x24dbea['filters']));if(_0x1563b7['query']['filter']){_0x1c3684[_0x0931('0x48')]=_['merge'](_0x1c3684[_0x0931('0x48')],{'$or':_['map'](_0x1c3684[_0x0931('0x41')],function(_0x3a5d7a){var _0x15e8bb={};_0x15e8bb[_0x3a5d7a]={'$like':'%'+_0x1563b7[_0x0931('0x3f')][_0x0931('0x4a')]+'%'};return _0x15e8bb;})});}_0x1c3684=_['merge']({},_0x1c3684,_0x1563b7[_0x0931('0x4d')]);return _0x3cc6e6[_0x0931('0x5d')](_0x1c3684);}})[_0x0931('0x1d')](function(_0x53288d){if(_0x53288d){_0x46a0a1=_0x53288d[_0x0931('0x43')];if(!_0x1563b7[_0x0931('0x3f')][_0x0931('0x44')]('nolimit')){_0x1c3684['limit']=qs[_0x0931('0x2b')](_0x1563b7[_0x0931('0x3f')]['limit']);_0x1c3684[_0x0931('0x2a')]=qs['offset'](_0x1563b7[_0x0931('0x3f')]['offset']);}return _0x3cc6e6[_0x0931('0x5d')](_0x1c3684);}})['then'](function(_0x6ec3ee){if(_0x6ec3ee){return _0x6ec3ee?{'count':_0x46a0a1,'rows':_0x6ec3ee}:null;}})[_0x0931('0x1d')](respondWithResult(_0x3313c8,null))[_0x0931('0x27')](handleError(_0x3313c8,null));};
\ No newline at end of file
+var _0x5ef4=['limit','Content-Range','reject','save','destroy','stack','name','send','map','SugarcrmConfiguration','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','filter','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','update','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset'];(function(_0x522c9b,_0x783a88){var _0x38abfc=function(_0x16097c){while(--_0x16097c){_0x522c9b['push'](_0x522c9b['shift']());}};_0x38abfc(++_0x783a88);}(_0x5ef4,0x8b));var _0x45ef=function(_0x231f72,_0x1b522b){_0x231f72=_0x231f72-0x0;var _0x64254e=_0x5ef4[_0x231f72];return _0x64254e;};'use strict';var pdf=require(_0x45ef('0x0'));var emlformat=require(_0x45ef('0x1'));var rimraf=require(_0x45ef('0x2'));var zipdir=require(_0x45ef('0x3'));var jsonpatch=require(_0x45ef('0x4'));var rp=require('request-promise');var moment=require(_0x45ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x45ef('0x6'));var util=require(_0x45ef('0x7'));var path=require(_0x45ef('0x8'));var sox=require(_0x45ef('0x9'));var csv=require(_0x45ef('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x45ef('0xb'));var squel=require('squel');var crypto=require(_0x45ef('0xc'));var jsforce=require(_0x45ef('0xd'));var deskjs=require(_0x45ef('0xe'));var toCsv=require(_0x45ef('0xa'));var querystring=require(_0x45ef('0xf'));var Papa=require(_0x45ef('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x45ef('0x11'));var as=require(_0x45ef('0x12'));var hardwareService=require(_0x45ef('0x13'));var logger=require('../../config/logger')(_0x45ef('0x14'));var utils=require(_0x45ef('0x15'));var config=require(_0x45ef('0x16'));var db=require(_0x45ef('0x17'))['db'];var jayson=require(_0x45ef('0x18'));var client=jayson[_0x45ef('0x19')][_0x45ef('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3dcee9,_0x2d683c,_0x594196){if(_0x594196){var _0x5d98ab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d98ab[_0x45ef('0x1b')](_0x2d683c)){return _0x3dcee9;}else{throw new db[(_0x45ef('0x1c'))][(_0x45ef('0x1d'))](_0x45ef('0x1e'));}}else{return _0x3dcee9;}}function respondWithRpcPromise(_0x1c79a3,_0x595bc8,_0x246158,_0x4fa973){return new BPromise(function(_0x3a3311,_0x52cea8){var _0x3e6016=_0x4fa973||client;return _0x3e6016[_0x45ef('0x1f')](_0x1c79a3,_0x246158)[_0x45ef('0x20')](function(_0x42d022){logger[_0x45ef('0x21')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x595bc8,_0x45ef('0x22'));logger[_0x45ef('0x23')](_0x45ef('0x24'),_0x595bc8,_0x45ef('0x22'),JSON['stringify'](_0x42d022));if(_0x42d022[_0x45ef('0x25')]){if(_0x42d022['error'][_0x45ef('0x26')]===0x1f4){logger[_0x45ef('0x25')](_0x45ef('0x27'),_0x595bc8,_0x42d022[_0x45ef('0x25')][_0x45ef('0x28')]);return _0x52cea8(_0x42d022[_0x45ef('0x25')]['message']);}logger['error'](_0x45ef('0x27'),_0x595bc8,_0x42d022[_0x45ef('0x25')][_0x45ef('0x28')]);return _0x3a3311(_0x42d022[_0x45ef('0x25')][_0x45ef('0x28')]);}else{logger[_0x45ef('0x21')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x595bc8,'request\x20sent');_0x3a3311(_0x42d022[_0x45ef('0x29')][_0x45ef('0x28')]);}})['catch'](function(_0x3af071){logger[_0x45ef('0x25')](_0x45ef('0x27'),_0x595bc8,_0x3af071);_0x52cea8(_0x3af071);});});}function respondWithStatusCode(_0x3e313f,_0x5496fa){_0x5496fa=_0x5496fa||0xcc;return function(_0xee1698){if(_0xee1698){return _0x3e313f[_0x45ef('0x2a')](_0x5496fa);}return _0x3e313f[_0x45ef('0x2b')](_0x5496fa)[_0x45ef('0x2c')]();};}function respondWithResult(_0x1349ef,_0x213dec){_0x213dec=_0x213dec||0xc8;return function(_0x357559){if(_0x357559){return _0x1349ef['status'](_0x213dec)[_0x45ef('0x2d')](_0x357559);}};}function respondWithFilteredResult(_0x2a8189,_0x409c42){return function(_0x5b6db3){if(_0x5b6db3){var _0x35c370=_0x5b6db3['count'],_0x592edb=_0x409c42[_0x45ef('0x2e')],_0x2988e9=_0x409c42[_0x45ef('0x2e')]+_0x409c42[_0x45ef('0x2f')],_0x241df7;if(_0x2988e9>=_0x35c370){_0x2988e9=_0x35c370;_0x241df7=0xc8;}else{_0x241df7=0xce;}_0x2a8189[_0x45ef('0x2b')](_0x241df7);return _0x2a8189['set'](_0x45ef('0x30'),_0x592edb+'-'+_0x2988e9+'/'+_0x35c370)['json'](_0x5b6db3);}return null;};}function patchUpdates(_0x496bc2){return function(_0x4cbfec){try{jsonpatch['apply'](_0x4cbfec,_0x496bc2,!![]);}catch(_0x1e7005){return BPromise[_0x45ef('0x31')](_0x1e7005);}return _0x4cbfec[_0x45ef('0x32')]();};}function saveUpdates(_0x4167fd,_0x793c44){return function(_0x2734d8){if(_0x2734d8){return _0x2734d8['update'](_0x4167fd)['then'](function(_0x5c6e03){return _0x5c6e03;});}return null;};}function removeEntity(_0x1d3941,_0x4349bc){return function(_0x363447){if(_0x363447){return _0x363447[_0x45ef('0x33')]()[_0x45ef('0x20')](function(){_0x1d3941[_0x45ef('0x2b')](0xcc)[_0x45ef('0x2c')]();});}};}function handleEntityNotFound(_0x531d64,_0x4aa65a){return function(_0x54091d){if(!_0x54091d){_0x531d64[_0x45ef('0x2a')](0x194);}return _0x54091d;};}function handleError(_0x4028f3,_0x27a56e){_0x27a56e=_0x27a56e||0x1f4;return function(_0x4021eb){logger['error'](_0x4021eb[_0x45ef('0x34')]);if(_0x4021eb[_0x45ef('0x35')]){delete _0x4021eb['name'];}_0x4028f3[_0x45ef('0x2b')](_0x27a56e)[_0x45ef('0x36')](_0x4021eb);};}exports['index']=function(_0xcc3127,_0x34ad44){var _0x4865d8={},_0x17d781={},_0x2ae459={'count':0x0,'rows':[]};var _0x1cd3f3=_[_0x45ef('0x37')](db[_0x45ef('0x38')]['rawAttributes'],function(_0x2f64e5){return{'name':_0x2f64e5[_0x45ef('0x39')],'type':_0x2f64e5[_0x45ef('0x3a')]['key']};});_0x17d781[_0x45ef('0x3b')]=_[_0x45ef('0x37')](_0x1cd3f3,_0x45ef('0x35'));_0x17d781[_0x45ef('0x3c')]=_[_0x45ef('0x3d')](_0xcc3127[_0x45ef('0x3c')]);_0x17d781['filters']=_[_0x45ef('0x3e')](_0x17d781['model'],_0x17d781['query']);_0x4865d8['attributes']=_[_0x45ef('0x3e')](_0x17d781['model'],qs[_0x45ef('0x3f')](_0xcc3127['query'][_0x45ef('0x3f')]));_0x4865d8['attributes']=_0x4865d8[_0x45ef('0x40')][_0x45ef('0x41')]?_0x4865d8[_0x45ef('0x40')]:_0x17d781['model'];if(!_0xcc3127['query'][_0x45ef('0x42')](_0x45ef('0x43'))){_0x4865d8[_0x45ef('0x2f')]=qs[_0x45ef('0x2f')](_0xcc3127['query']['limit']);_0x4865d8[_0x45ef('0x2e')]=qs[_0x45ef('0x2e')](_0xcc3127[_0x45ef('0x3c')][_0x45ef('0x2e')]);}_0x4865d8[_0x45ef('0x44')]=qs[_0x45ef('0x45')](_0xcc3127[_0x45ef('0x3c')][_0x45ef('0x45')]);_0x4865d8['where']=qs[_0x45ef('0x46')](_[_0x45ef('0x47')](_0xcc3127['query'],_0x17d781['filters']),_0x1cd3f3);if(_0xcc3127[_0x45ef('0x3c')]['filter']){_0x4865d8[_0x45ef('0x48')]=_[_0x45ef('0x49')](_0x4865d8['where'],{'$or':_[_0x45ef('0x37')](_0x1cd3f3,function(_0x23c3f1){if(_0x23c3f1[_0x45ef('0x3a')]!=='VIRTUAL'){var _0x343b2e={};_0x343b2e[_0x23c3f1['name']]={'$like':'%'+_0xcc3127[_0x45ef('0x3c')][_0x45ef('0x4a')]+'%'};return _0x343b2e;}})});}_0x4865d8=_[_0x45ef('0x49')]({},_0x4865d8,_0xcc3127[_0x45ef('0x4b')]);var _0x10f20f={'where':_0x4865d8[_0x45ef('0x48')]};return db[_0x45ef('0x38')][_0x45ef('0x4c')](_0x10f20f)['then'](function(_0x4782f9){_0x2ae459[_0x45ef('0x4c')]=_0x4782f9;if(_0xcc3127[_0x45ef('0x3c')][_0x45ef('0x4d')]){_0x4865d8[_0x45ef('0x4e')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x45ef('0x4f')](_0x4865d8);})['then'](function(_0x187967){_0x2ae459['rows']=_0x187967;return _0x2ae459;})[_0x45ef('0x20')](respondWithFilteredResult(_0x34ad44,_0x4865d8))[_0x45ef('0x50')](handleError(_0x34ad44,null));};exports[_0x45ef('0x51')]=function(_0x4b9454,_0x3e4fb4){var _0x138fc9={'raw':![],'where':{'id':_0x4b9454[_0x45ef('0x52')]['id']}},_0x4d9cab={};_0x4d9cab['model']=_[_0x45ef('0x3d')](db[_0x45ef('0x38')][_0x45ef('0x53')]);_0x4d9cab[_0x45ef('0x3c')]=_[_0x45ef('0x3d')](_0x4b9454[_0x45ef('0x3c')]);_0x4d9cab[_0x45ef('0x46')]=_['intersection'](_0x4d9cab[_0x45ef('0x3b')],_0x4d9cab['query']);_0x138fc9[_0x45ef('0x40')]=_[_0x45ef('0x3e')](_0x4d9cab[_0x45ef('0x3b')],qs[_0x45ef('0x3f')](_0x4b9454[_0x45ef('0x3c')][_0x45ef('0x3f')]));_0x138fc9[_0x45ef('0x40')]=_0x138fc9[_0x45ef('0x40')]['length']?_0x138fc9[_0x45ef('0x40')]:_0x4d9cab['model'];if(_0x4b9454['query'][_0x45ef('0x4d')]){_0x138fc9[_0x45ef('0x4e')]=[{'all':!![]}];}_0x138fc9=_['merge']({},_0x138fc9,_0x4b9454['options']);return db['SugarcrmConfiguration'][_0x45ef('0x54')](_0x138fc9)[_0x45ef('0x20')](handleEntityNotFound(_0x3e4fb4,null))[_0x45ef('0x20')](respondWithResult(_0x3e4fb4,null))[_0x45ef('0x50')](handleError(_0x3e4fb4,null));};exports['create']=function(_0x41eb9c,_0x3500f6){return db[_0x45ef('0x38')][_0x45ef('0x55')](_0x41eb9c[_0x45ef('0x56')],{})[_0x45ef('0x20')](respondWithResult(_0x3500f6,0xc9))['catch'](handleError(_0x3500f6,null));};exports[_0x45ef('0x57')]=function(_0x1c1051,_0x38f8f6){if(_0x1c1051[_0x45ef('0x56')]['id']){delete _0x1c1051['body']['id'];}return db[_0x45ef('0x38')][_0x45ef('0x54')]({'where':{'id':_0x1c1051[_0x45ef('0x52')]['id']}})[_0x45ef('0x20')](handleEntityNotFound(_0x38f8f6,null))[_0x45ef('0x20')](saveUpdates(_0x1c1051[_0x45ef('0x56')],null))[_0x45ef('0x20')](respondWithResult(_0x38f8f6,null))[_0x45ef('0x50')](handleError(_0x38f8f6,null));};exports[_0x45ef('0x33')]=function(_0x5e0806,_0x41e5e4){return db['SugarcrmConfiguration'][_0x45ef('0x54')]({'where':{'id':_0x5e0806[_0x45ef('0x52')]['id']}})[_0x45ef('0x20')](handleEntityNotFound(_0x41e5e4,null))[_0x45ef('0x20')](removeEntity(_0x41e5e4,null))[_0x45ef('0x50')](handleError(_0x41e5e4,null));};exports[_0x45ef('0x58')]=function(_0x6090bf,_0x65a4fd,_0x26f9f7){var _0x584d72={};var _0x1f6f8f={};var _0x16237f;var _0x687879;return db['SugarcrmConfiguration'][_0x45ef('0x59')]({'where':{'id':_0x6090bf[_0x45ef('0x52')]['id']}})[_0x45ef('0x20')](handleEntityNotFound(_0x65a4fd,null))[_0x45ef('0x20')](function(_0x4cbb6a){if(_0x4cbb6a){_0x16237f=_0x4cbb6a;_0x1f6f8f[_0x45ef('0x3b')]=_['keys'](db[_0x45ef('0x5a')][_0x45ef('0x53')]);_0x1f6f8f[_0x45ef('0x3c')]=_[_0x45ef('0x3d')](_0x6090bf['query']);_0x1f6f8f['filters']=_[_0x45ef('0x3e')](_0x1f6f8f['model'],_0x1f6f8f[_0x45ef('0x3c')]);_0x584d72[_0x45ef('0x40')]=_['intersection'](_0x1f6f8f[_0x45ef('0x3b')],qs[_0x45ef('0x3f')](_0x6090bf[_0x45ef('0x3c')][_0x45ef('0x3f')]));_0x584d72[_0x45ef('0x40')]=_0x584d72['attributes'][_0x45ef('0x41')]?_0x584d72['attributes']:_0x1f6f8f[_0x45ef('0x3b')];_0x584d72['order']=qs[_0x45ef('0x45')](_0x6090bf[_0x45ef('0x3c')][_0x45ef('0x45')]);_0x584d72[_0x45ef('0x48')]=qs['filters'](_['pick'](_0x6090bf[_0x45ef('0x3c')],_0x1f6f8f['filters']));if(_0x6090bf[_0x45ef('0x3c')][_0x45ef('0x4a')]){_0x584d72[_0x45ef('0x48')]=_[_0x45ef('0x49')](_0x584d72[_0x45ef('0x48')],{'$or':_[_0x45ef('0x37')](_0x584d72[_0x45ef('0x40')],function(_0x5e6c5a){var _0x2f8ce0={};_0x2f8ce0[_0x5e6c5a]={'$like':'%'+_0x6090bf[_0x45ef('0x3c')][_0x45ef('0x4a')]+'%'};return _0x2f8ce0;})});}_0x584d72=_[_0x45ef('0x49')]({},_0x584d72,_0x6090bf['options']);return _0x16237f[_0x45ef('0x58')](_0x584d72);}})[_0x45ef('0x20')](function(_0x51699c){if(_0x51699c){_0x687879=_0x51699c['length'];if(!_0x6090bf[_0x45ef('0x3c')][_0x45ef('0x42')]('nolimit')){_0x584d72[_0x45ef('0x2f')]=qs['limit'](_0x6090bf['query'][_0x45ef('0x2f')]);_0x584d72[_0x45ef('0x2e')]=qs[_0x45ef('0x2e')](_0x6090bf[_0x45ef('0x3c')][_0x45ef('0x2e')]);}return _0x16237f[_0x45ef('0x58')](_0x584d72);}})['then'](function(_0x4edbb4){if(_0x4edbb4){return _0x4edbb4?{'count':_0x687879,'rows':_0x4edbb4}:null;}})['then'](respondWithResult(_0x65a4fd,null))[_0x45ef('0x50')](handleError(_0x65a4fd,null));};exports[_0x45ef('0x5b')]=function(_0x20d15e,_0x3c2f28,_0x243177){var _0x47f8a7={};var _0x17690e={};var _0x44c874;var _0x2dbd4c;return db[_0x45ef('0x38')][_0x45ef('0x59')]({'where':{'id':_0x20d15e[_0x45ef('0x52')]['id']}})[_0x45ef('0x20')](handleEntityNotFound(_0x3c2f28,null))[_0x45ef('0x20')](function(_0x1cdf70){if(_0x1cdf70){_0x44c874=_0x1cdf70;_0x17690e[_0x45ef('0x3b')]=_[_0x45ef('0x3d')](db[_0x45ef('0x5a')][_0x45ef('0x53')]);_0x17690e['query']=_[_0x45ef('0x3d')](_0x20d15e[_0x45ef('0x3c')]);_0x17690e[_0x45ef('0x46')]=_[_0x45ef('0x3e')](_0x17690e[_0x45ef('0x3b')],_0x17690e[_0x45ef('0x3c')]);_0x47f8a7[_0x45ef('0x40')]=_['intersection'](_0x17690e['model'],qs[_0x45ef('0x3f')](_0x20d15e[_0x45ef('0x3c')][_0x45ef('0x3f')]));_0x47f8a7[_0x45ef('0x40')]=_0x47f8a7[_0x45ef('0x40')]['length']?_0x47f8a7[_0x45ef('0x40')]:_0x17690e[_0x45ef('0x3b')];_0x47f8a7[_0x45ef('0x44')]=qs[_0x45ef('0x45')](_0x20d15e[_0x45ef('0x3c')][_0x45ef('0x45')]);_0x47f8a7[_0x45ef('0x48')]=qs[_0x45ef('0x46')](_['pick'](_0x20d15e[_0x45ef('0x3c')],_0x17690e['filters']));if(_0x20d15e[_0x45ef('0x3c')][_0x45ef('0x4a')]){_0x47f8a7['where']=_[_0x45ef('0x49')](_0x47f8a7['where'],{'$or':_[_0x45ef('0x37')](_0x47f8a7[_0x45ef('0x40')],function(_0x1fc160){var _0x2fa273={};_0x2fa273[_0x1fc160]={'$like':'%'+_0x20d15e[_0x45ef('0x3c')]['filter']+'%'};return _0x2fa273;})});}_0x47f8a7=_[_0x45ef('0x49')]({},_0x47f8a7,_0x20d15e[_0x45ef('0x4b')]);return _0x44c874['getSubjects'](_0x47f8a7);}})[_0x45ef('0x20')](function(_0x112f09){if(_0x112f09){_0x2dbd4c=_0x112f09['length'];if(!_0x20d15e['query']['hasOwnProperty'](_0x45ef('0x43'))){_0x47f8a7[_0x45ef('0x2f')]=qs['limit'](_0x20d15e['query'][_0x45ef('0x2f')]);_0x47f8a7[_0x45ef('0x2e')]=qs[_0x45ef('0x2e')](_0x20d15e[_0x45ef('0x3c')][_0x45ef('0x2e')]);}return _0x44c874[_0x45ef('0x5b')](_0x47f8a7);}})[_0x45ef('0x20')](function(_0x5113dc){if(_0x5113dc){return _0x5113dc?{'count':_0x2dbd4c,'rows':_0x5113dc}:null;}})['then'](respondWithResult(_0x3c2f28,null))[_0x45ef('0x50')](handleError(_0x3c2f28,null));};exports[_0x45ef('0x5c')]=function(_0xe5dc0d,_0x39fafe,_0x29185c){var _0x5aae4f={};var _0x35dd94={};var _0x2fe37f;var _0xead541;return db[_0x45ef('0x38')][_0x45ef('0x59')]({'where':{'id':_0xe5dc0d[_0x45ef('0x52')]['id']}})[_0x45ef('0x20')](handleEntityNotFound(_0x39fafe,null))['then'](function(_0x5e0853){if(_0x5e0853){_0x2fe37f=_0x5e0853;_0x35dd94[_0x45ef('0x3b')]=_[_0x45ef('0x3d')](db[_0x45ef('0x5a')][_0x45ef('0x53')]);_0x35dd94[_0x45ef('0x3c')]=_[_0x45ef('0x3d')](_0xe5dc0d[_0x45ef('0x3c')]);_0x35dd94[_0x45ef('0x46')]=_[_0x45ef('0x3e')](_0x35dd94['model'],_0x35dd94[_0x45ef('0x3c')]);_0x5aae4f[_0x45ef('0x40')]=_[_0x45ef('0x3e')](_0x35dd94[_0x45ef('0x3b')],qs[_0x45ef('0x3f')](_0xe5dc0d[_0x45ef('0x3c')][_0x45ef('0x3f')]));_0x5aae4f[_0x45ef('0x40')]=_0x5aae4f[_0x45ef('0x40')]['length']?_0x5aae4f[_0x45ef('0x40')]:_0x35dd94['model'];_0x5aae4f[_0x45ef('0x44')]=qs[_0x45ef('0x45')](_0xe5dc0d[_0x45ef('0x3c')][_0x45ef('0x45')]);_0x5aae4f[_0x45ef('0x48')]=qs[_0x45ef('0x46')](_[_0x45ef('0x47')](_0xe5dc0d[_0x45ef('0x3c')],_0x35dd94[_0x45ef('0x46')]));if(_0xe5dc0d['query'][_0x45ef('0x4a')]){_0x5aae4f['where']=_[_0x45ef('0x49')](_0x5aae4f[_0x45ef('0x48')],{'$or':_[_0x45ef('0x37')](_0x5aae4f['attributes'],function(_0x3cb995){var _0x17709b={};_0x17709b[_0x3cb995]={'$like':'%'+_0xe5dc0d[_0x45ef('0x3c')][_0x45ef('0x4a')]+'%'};return _0x17709b;})});}_0x5aae4f=_[_0x45ef('0x49')]({},_0x5aae4f,_0xe5dc0d[_0x45ef('0x4b')]);return _0x2fe37f[_0x45ef('0x5c')](_0x5aae4f);}})['then'](function(_0x42d89a){if(_0x42d89a){_0xead541=_0x42d89a[_0x45ef('0x41')];if(!_0xe5dc0d[_0x45ef('0x3c')][_0x45ef('0x42')](_0x45ef('0x43'))){_0x5aae4f[_0x45ef('0x2f')]=qs[_0x45ef('0x2f')](_0xe5dc0d[_0x45ef('0x3c')][_0x45ef('0x2f')]);_0x5aae4f['offset']=qs[_0x45ef('0x2e')](_0xe5dc0d[_0x45ef('0x3c')][_0x45ef('0x2e')]);}return _0x2fe37f[_0x45ef('0x5c')](_0x5aae4f);}})[_0x45ef('0x20')](function(_0x3a0e22){if(_0x3a0e22){return _0x3a0e22?{'count':_0xead541,'rows':_0x3a0e22}:null;}})[_0x45ef('0x20')](respondWithResult(_0x39fafe,null))['catch'](handleError(_0x39fafe,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
index c094737..77ed6b9 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b3b=['exports','define','int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','rimraf','./intSugarcrmConfiguration.attributes'];(function(_0x4e3fc7,_0x195200){var _0x4527bf=function(_0x122d8b){while(--_0x122d8b){_0x4e3fc7['push'](_0x4e3fc7['shift']());}};_0x4527bf(++_0x195200);}(_0x7b3b,0x107));var _0xb7b3=function(_0x323b64,_0x3bb64e){_0x323b64=_0x323b64-0x0;var _0x4d7b92=_0x7b3b[_0x323b64];return _0x4d7b92;};'use strict';var _=require('lodash');var util=require(_0xb7b3('0x0'));var logger=require(_0xb7b3('0x1'))(_0xb7b3('0x2'));var moment=require(_0xb7b3('0x3'));var BPromise=require(_0xb7b3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb7b3('0x5'));var config=require('../../config/environment');var attributes=require(_0xb7b3('0x6'));module[_0xb7b3('0x7')]=function(_0x55ca42,_0x58f6f6){return _0x55ca42[_0xb7b3('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xb7b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8308=['int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x36119f,_0x1cc544){var _0x25f3c1=function(_0x145c68){while(--_0x145c68){_0x36119f['push'](_0x36119f['shift']());}};_0x25f3c1(++_0x1cc544);}(_0x8308,0xb7));var _0x8830=function(_0x455953,_0x2ee57d){_0x455953=_0x455953-0x0;var _0x2d7d6b=_0x8308[_0x455953];return _0x2d7d6b;};'use strict';var _=require('lodash');var util=require(_0x8830('0x0'));var logger=require(_0x8830('0x1'))(_0x8830('0x2'));var moment=require(_0x8830('0x3'));var BPromise=require(_0x8830('0x4'));var rp=require(_0x8830('0x5'));var fs=require('fs');var path=require(_0x8830('0x6'));var rimraf=require(_0x8830('0x7'));var config=require(_0x8830('0x8'));var attributes=require(_0x8830('0x9'));module[_0x8830('0xa')]=function(_0x4a7e85,_0xc44ec9){return _0x4a7e85[_0x8830('0xb')](_0x8830('0xc'),attributes,{'tableName':_0x8830('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
index ee73d00..21a65d8 100644
--- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
+++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc49=['rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfc49,0x1dd));var _0x9fc4=function(_0x4e9b3b,_0x49a85c){_0x4e9b3b=_0x4e9b3b-0x0;var _0x3d18f0=_0xfc49[_0x4e9b3b];return _0x3d18f0;};'use strict';var _=require('lodash');var util=require(_0x9fc4('0x0'));var moment=require('moment');var BPromise=require(_0x9fc4('0x1'));var rs=require(_0x9fc4('0x2'));var fs=require('fs');var Redis=require(_0x9fc4('0x3'));var db=require(_0x9fc4('0x4'))['db'];var utils=require(_0x9fc4('0x5'));var logger=require(_0x9fc4('0x6'))(_0x9fc4('0x7'));var config=require(_0x9fc4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9fc4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x148202,_0xc9dd4b,_0x47283e){return new BPromise(function(_0x4cb2b8,_0x5a9432){return client[_0x9fc4('0xa')](_0x148202,_0x47283e)[_0x9fc4('0xb')](function(_0x52f016){logger[_0x9fc4('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc9dd4b,_0x9fc4('0xd'));logger[_0x9fc4('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xc9dd4b,_0x9fc4('0xd'),JSON[_0x9fc4('0xf')](_0x52f016));if(_0x52f016[_0x9fc4('0x10')]){if(_0x52f016['error'][_0x9fc4('0x11')]===0x1f4){logger[_0x9fc4('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc9dd4b,_0x52f016[_0x9fc4('0x10')][_0x9fc4('0x12')]);return _0x5a9432(_0x52f016[_0x9fc4('0x10')][_0x9fc4('0x12')]);}logger[_0x9fc4('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xc9dd4b,_0x52f016[_0x9fc4('0x10')][_0x9fc4('0x12')]);return _0x4cb2b8(_0x52f016[_0x9fc4('0x10')][_0x9fc4('0x12')]);}else{logger[_0x9fc4('0xc')](_0x9fc4('0x13'),_0xc9dd4b,_0x9fc4('0xd'));_0x4cb2b8(_0x52f016[_0x9fc4('0x14')][_0x9fc4('0x12')]);}})[_0x9fc4('0x15')](function(_0x5b1f9d){logger[_0x9fc4('0x10')](_0x9fc4('0x13'),_0xc9dd4b,_0x5b1f9d);_0x5a9432(_0x5b1f9d);});});}
\ No newline at end of file
+var _0xeba1=['http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3c3fc9,_0x19452a){var _0x34debd=function(_0x2ec1f2){while(--_0x2ec1f2){_0x3c3fc9['push'](_0x3c3fc9['shift']());}};_0x34debd(++_0x19452a);}(_0xeba1,0x1e9));var _0x1eba=function(_0x3b62e4,_0x5272e9){_0x3b62e4=_0x3b62e4-0x0;var _0x2b81c8=_0xeba1[_0x3b62e4];return _0x2b81c8;};'use strict';var _=require(_0x1eba('0x0'));var util=require(_0x1eba('0x1'));var moment=require(_0x1eba('0x2'));var BPromise=require(_0x1eba('0x3'));var rs=require(_0x1eba('0x4'));var fs=require('fs');var Redis=require(_0x1eba('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1eba('0x6'));var logger=require(_0x1eba('0x7'))(_0x1eba('0x8'));var config=require(_0x1eba('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1eba('0xa')][_0x1eba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10b884,_0x168468,_0x4a7ef6){return new BPromise(function(_0x9f64ec,_0x1e9cc2){return client[_0x1eba('0xc')](_0x10b884,_0x4a7ef6)[_0x1eba('0xd')](function(_0x3196f8){logger[_0x1eba('0xe')](_0x1eba('0xf'),_0x168468,_0x1eba('0x10'));logger[_0x1eba('0x11')](_0x1eba('0x12'),_0x168468,_0x1eba('0x10'),JSON[_0x1eba('0x13')](_0x3196f8));if(_0x3196f8[_0x1eba('0x14')]){if(_0x3196f8[_0x1eba('0x14')][_0x1eba('0x15')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x168468,_0x3196f8['error'][_0x1eba('0x16')]);return _0x1e9cc2(_0x3196f8['error'][_0x1eba('0x16')]);}logger['error'](_0x1eba('0xf'),_0x168468,_0x3196f8[_0x1eba('0x14')][_0x1eba('0x16')]);return _0x9f64ec(_0x3196f8[_0x1eba('0x14')]['message']);}else{logger[_0x1eba('0xe')](_0x1eba('0xf'),_0x168468,_0x1eba('0x10'));_0x9f64ec(_0x3196f8[_0x1eba('0x17')]['message']);}})[_0x1eba('0x18')](function(_0x55139d){logger[_0x1eba('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x168468,_0x55139d);_0x1e9cc2(_0x55139d);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js
index 4780edf..63e33e8 100644
--- a/server/api/intSugarcrmField/index.js
+++ b/server/api/intSugarcrmField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x94c4=['delete','util','express','../../components/interaction/service','../../config/environment','isAuthenticated','get','create','put','/:id','update'];(function(_0x33ab16,_0x249972){var _0x544b62=function(_0x597db7){while(--_0x597db7){_0x33ab16['push'](_0x33ab16['shift']());}};_0x544b62(++_0x249972);}(_0x94c4,0xfe));var _0x494c=function(_0xa94fd,_0x21edfe){_0xa94fd=_0xa94fd-0x0;var _0x315fea=_0x94c4[_0xa94fd];return _0x315fea;};'use strict';var multer=require('multer');var util=require(_0x494c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x494c('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x494c('0x2'));var config=require(_0x494c('0x3'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x494c('0x4')](),controller['index']);router[_0x494c('0x5')]('/:id',auth[_0x494c('0x4')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x494c('0x6')]);router[_0x494c('0x7')](_0x494c('0x8'),auth[_0x494c('0x4')](),controller[_0x494c('0x9')]);router[_0x494c('0xa')](_0x494c('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe7e0=['util','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post','create','delete','exports','multer'];(function(_0xc0921a,_0x1f107f){var _0x3f6189=function(_0x5cd2fe){while(--_0x5cd2fe){_0xc0921a['push'](_0xc0921a['shift']());}};_0x3f6189(++_0x1f107f);}(_0xe7e0,0x1a3));var _0x0e7e=function(_0x27ce14,_0x30c506){_0x27ce14=_0x27ce14-0x0;var _0x54ffbd=_0xe7e0[_0x27ce14];return _0x54ffbd;};'use strict';var multer=require(_0x0e7e('0x0'));var util=require(_0x0e7e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0e7e('0x2'));var router=express[_0x0e7e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0e7e('0x4'));var config=require(_0x0e7e('0x5'));var controller=require('./intSugarcrmField.controller');router[_0x0e7e('0x6')]('/',auth['isAuthenticated'](),controller[_0x0e7e('0x7')]);router['get'](_0x0e7e('0x8'),auth[_0x0e7e('0x9')](),controller['show']);router[_0x0e7e('0xa')]('/',auth['isAuthenticated'](),controller[_0x0e7e('0xb')]);router['put'](_0x0e7e('0x8'),auth[_0x0e7e('0x9')](),controller['update']);router[_0x0e7e('0xc')](_0x0e7e('0x8'),auth[_0x0e7e('0x9')](),controller['destroy']);module[_0x0e7e('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js
index 5676e72..06a0c5b 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.attributes.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0bde=['sequelize','ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0bde,0x110));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xe0bd('0x0'));module['exports']={'type':{'type':Sequelize[_0xe0bd('0x1')](_0xe0bd('0x2'),'variable',_0xe0bd('0x3'),_0xe0bd('0x4')),'defaultValue':_0xe0bd('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe0bd('0x5')]},'keyType':{'type':Sequelize[_0xe0bd('0x1')](_0xe0bd('0x2'),_0xe0bd('0x6'),_0xe0bd('0x3'))},'keyContent':{'type':Sequelize[_0xe0bd('0x5')]},'idField':{'type':Sequelize[_0xe0bd('0x5')]},'nameField':{'type':Sequelize[_0xe0bd('0x5')]},'customField':{'type':Sequelize[_0xe0bd('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe0bd('0x5')]}};
\ No newline at end of file
+var _0xd8ee=['customVariable','BOOLEAN','sequelize','ENUM','string','variable','keyValue','STRING'];(function(_0x591601,_0x555fae){var _0x4c7c8b=function(_0xe08d30){while(--_0xe08d30){_0x591601['push'](_0x591601['shift']());}};_0x4c7c8b(++_0x555fae);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x422ca7,_0xfd7d6){_0x422ca7=_0x422ca7-0x0;var _0x4c2961=_0xd8ee[_0x422ca7];return _0x4c2961;};'use strict';var Sequelize=require(_0xed8e('0x0'));module['exports']={'type':{'type':Sequelize[_0xed8e('0x1')](_0xed8e('0x2'),_0xed8e('0x3'),'customVariable',_0xed8e('0x4')),'defaultValue':_0xed8e('0x2')},'content':{'type':Sequelize[_0xed8e('0x5')]},'key':{'type':Sequelize[_0xed8e('0x5')]},'keyType':{'type':Sequelize[_0xed8e('0x1')](_0xed8e('0x2'),'variable',_0xed8e('0x6'))},'keyContent':{'type':Sequelize[_0xed8e('0x5')]},'idField':{'type':Sequelize[_0xed8e('0x5')]},'nameField':{'type':Sequelize[_0xed8e('0x5')]},'customField':{'type':Sequelize[_0xed8e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xed8e('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js
index 6a51aaa..949da75 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.controller.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x940e=['filter','VIRTUAL','merge','options','SugarcrmField','include','findAll','rows','show','params','create','catch','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x940e,0x126));var _0xe940=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x940e[_0x61b3ab];return _0x57097f;};'use strict';var pdf=require(_0xe940('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe940('0x1'));var zipdir=require(_0xe940('0x2'));var jsonpatch=require(_0xe940('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe940('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe940('0x5'));var sox=require(_0xe940('0x6'));var csv=require(_0xe940('0x7'));var ejs=require(_0xe940('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe940('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe940('0xa'));var toCsv=require(_0xe940('0x7'));var querystring=require(_0xe940('0xb'));var Papa=require(_0xe940('0xc'));var Redis=require('ioredis');var authService=require(_0xe940('0xd'));var qs=require(_0xe940('0xe'));var as=require(_0xe940('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe940('0x10'))(_0xe940('0x11'));var utils=require(_0xe940('0x12'));var config=require(_0xe940('0x13'));var db=require(_0xe940('0x14'))['db'];function respondWithStatusCode(_0x52774e,_0x36649f){_0x36649f=_0x36649f||0xcc;return function(_0x277691){if(_0x277691){return _0x52774e['sendStatus'](_0x36649f);}return _0x52774e[_0xe940('0x15')](_0x36649f)[_0xe940('0x16')]();};}function respondWithResult(_0x24d847,_0x3600fa){_0x3600fa=_0x3600fa||0xc8;return function(_0x2a9e3d){if(_0x2a9e3d){return _0x24d847['status'](_0x3600fa)['json'](_0x2a9e3d);}};}function respondWithFilteredResult(_0x23ff91,_0x58e154){return function(_0x7ee89e){if(_0x7ee89e){var _0x17a13b=_0x7ee89e[_0xe940('0x17')],_0x78dadc=_0x58e154[_0xe940('0x18')],_0x55587d=_0x58e154[_0xe940('0x18')]+_0x58e154[_0xe940('0x19')],_0x3d38bc;if(_0x55587d>=_0x17a13b){_0x55587d=_0x17a13b;_0x3d38bc=0xc8;}else{_0x3d38bc=0xce;}_0x23ff91['status'](_0x3d38bc);return _0x23ff91[_0xe940('0x1a')](_0xe940('0x1b'),_0x78dadc+'-'+_0x55587d+'/'+_0x17a13b)['json'](_0x7ee89e);}return null;};}function patchUpdates(_0x1f07bc){return function(_0x116a63){try{jsonpatch[_0xe940('0x1c')](_0x116a63,_0x1f07bc,!![]);}catch(_0x319bb9){return BPromise[_0xe940('0x1d')](_0x319bb9);}return _0x116a63[_0xe940('0x1e')]();};}function saveUpdates(_0x2d97eb,_0x2d4964){return function(_0x2538df){if(_0x2538df){return _0x2538df[_0xe940('0x1f')](_0x2d97eb)['then'](function(_0x4aadb6){return _0x4aadb6;});}return null;};}function removeEntity(_0x9143e4,_0x397f32){return function(_0x2091e3){if(_0x2091e3){return _0x2091e3[_0xe940('0x20')]()[_0xe940('0x21')](function(){_0x9143e4[_0xe940('0x15')](0xcc)[_0xe940('0x16')]();});}};}function handleEntityNotFound(_0x2a7f6b,_0x2d0269){return function(_0x3a5839){if(!_0x3a5839){_0x2a7f6b[_0xe940('0x22')](0x194);}return _0x3a5839;};}function handleError(_0x453bc6,_0x112d4d){_0x112d4d=_0x112d4d||0x1f4;return function(_0x35399c){logger['error'](_0x35399c[_0xe940('0x23')]);if(_0x35399c[_0xe940('0x24')]){delete _0x35399c['name'];}_0x453bc6['status'](_0x112d4d)[_0xe940('0x25')](_0x35399c);};}exports['index']=function(_0x12f4c9,_0x217fe5){var _0x441146={},_0x46e694={},_0x5d6c23={'count':0x0,'rows':[]};var _0x452acb=_[_0xe940('0x26')](db['SugarcrmField'][_0xe940('0x27')],function(_0x178731){return{'name':_0x178731[_0xe940('0x28')],'type':_0x178731[_0xe940('0x29')][_0xe940('0x2a')]};});_0x46e694[_0xe940('0x2b')]=_[_0xe940('0x26')](_0x452acb,_0xe940('0x24'));_0x46e694[_0xe940('0x2c')]=_[_0xe940('0x2d')](_0x12f4c9[_0xe940('0x2c')]);_0x46e694[_0xe940('0x2e')]=_[_0xe940('0x2f')](_0x46e694[_0xe940('0x2b')],_0x46e694['query']);_0x441146[_0xe940('0x30')]=_[_0xe940('0x2f')](_0x46e694['model'],qs['fields'](_0x12f4c9['query'][_0xe940('0x31')]));_0x441146[_0xe940('0x30')]=_0x441146[_0xe940('0x30')][_0xe940('0x32')]?_0x441146[_0xe940('0x30')]:_0x46e694[_0xe940('0x2b')];if(!_0x12f4c9[_0xe940('0x2c')][_0xe940('0x33')](_0xe940('0x34'))){_0x441146[_0xe940('0x19')]=qs[_0xe940('0x19')](_0x12f4c9[_0xe940('0x2c')][_0xe940('0x19')]);_0x441146[_0xe940('0x18')]=qs[_0xe940('0x18')](_0x12f4c9[_0xe940('0x2c')][_0xe940('0x18')]);}_0x441146[_0xe940('0x35')]=qs[_0xe940('0x36')](_0x12f4c9[_0xe940('0x2c')][_0xe940('0x36')]);_0x441146[_0xe940('0x37')]=qs['filters'](_['pick'](_0x12f4c9[_0xe940('0x2c')],_0x46e694[_0xe940('0x2e')]),_0x452acb);if(_0x12f4c9[_0xe940('0x2c')][_0xe940('0x38')]){_0x441146[_0xe940('0x37')]=_['merge'](_0x441146['where'],{'$or':_[_0xe940('0x26')](_0x452acb,function(_0x1f3a20){if(_0x1f3a20[_0xe940('0x29')]!==_0xe940('0x39')){var _0x2fcf76={};_0x2fcf76[_0x1f3a20[_0xe940('0x24')]]={'$like':'%'+_0x12f4c9[_0xe940('0x2c')][_0xe940('0x38')]+'%'};return _0x2fcf76;}})});}_0x441146=_[_0xe940('0x3a')]({},_0x441146,_0x12f4c9[_0xe940('0x3b')]);var _0x36f839={'where':_0x441146[_0xe940('0x37')]};return db[_0xe940('0x3c')]['count'](_0x36f839)[_0xe940('0x21')](function(_0x1374c4){_0x5d6c23[_0xe940('0x17')]=_0x1374c4;if(_0x12f4c9['query']['includeAll']){_0x441146[_0xe940('0x3d')]=[{'all':!![]}];}return db[_0xe940('0x3c')][_0xe940('0x3e')](_0x441146);})['then'](function(_0x5e2047){_0x5d6c23[_0xe940('0x3f')]=_0x5e2047;return _0x5d6c23;})['then'](respondWithFilteredResult(_0x217fe5,_0x441146))['catch'](handleError(_0x217fe5,null));};exports[_0xe940('0x40')]=function(_0x96979c,_0x1b49d3){var _0x2ee21b={'raw':!![],'where':{'id':_0x96979c[_0xe940('0x41')]['id']}},_0x571b89={};_0x571b89[_0xe940('0x2b')]=_[_0xe940('0x2d')](db[_0xe940('0x3c')]['rawAttributes']);_0x571b89[_0xe940('0x2c')]=_[_0xe940('0x2d')](_0x96979c[_0xe940('0x2c')]);_0x571b89[_0xe940('0x2e')]=_[_0xe940('0x2f')](_0x571b89[_0xe940('0x2b')],_0x571b89[_0xe940('0x2c')]);_0x2ee21b[_0xe940('0x30')]=_[_0xe940('0x2f')](_0x571b89[_0xe940('0x2b')],qs[_0xe940('0x31')](_0x96979c['query'][_0xe940('0x31')]));_0x2ee21b[_0xe940('0x30')]=_0x2ee21b['attributes'][_0xe940('0x32')]?_0x2ee21b[_0xe940('0x30')]:_0x571b89[_0xe940('0x2b')];if(_0x96979c[_0xe940('0x2c')]['includeAll']){_0x2ee21b[_0xe940('0x3d')]=[{'all':!![]}];}_0x2ee21b=_[_0xe940('0x3a')]({},_0x2ee21b,_0x96979c['options']);return db[_0xe940('0x3c')]['find'](_0x2ee21b)[_0xe940('0x21')](handleEntityNotFound(_0x1b49d3,null))['then'](respondWithResult(_0x1b49d3,null))['catch'](handleError(_0x1b49d3,null));};exports[_0xe940('0x42')]=function(_0x2138d4,_0x615b68){return db[_0xe940('0x3c')][_0xe940('0x42')](_0x2138d4['body'],{})[_0xe940('0x21')](respondWithResult(_0x615b68,0xc9))[_0xe940('0x43')](handleError(_0x615b68,null));};exports[_0xe940('0x1f')]=function(_0x99a02d,_0x39ba5b){if(_0x99a02d[_0xe940('0x44')]['id']){delete _0x99a02d[_0xe940('0x44')]['id'];}return db[_0xe940('0x3c')][_0xe940('0x45')]({'where':{'id':_0x99a02d['params']['id']}})['then'](handleEntityNotFound(_0x39ba5b,null))[_0xe940('0x21')](saveUpdates(_0x99a02d['body'],null))[_0xe940('0x21')](respondWithResult(_0x39ba5b,null))[_0xe940('0x43')](handleError(_0x39ba5b,null));};exports[_0xe940('0x20')]=function(_0x4253af,_0x2c4c16){return db[_0xe940('0x3c')][_0xe940('0x45')]({'where':{'id':_0x4253af['params']['id']}})[_0xe940('0x21')](handleEntityNotFound(_0x2c4c16,null))[_0xe940('0x21')](removeEntity(_0x2c4c16,null))[_0xe940('0x43')](handleError(_0x2c4c16,null));};
\ No newline at end of file
+var _0x759c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','destroy','error','name','send','SugarcrmField','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','eml-format','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x759c,0x13f));var _0xc759=function(_0x378555,_0x474745){_0x378555=_0x378555-0x0;var _0x14d79b=_0x759c[_0x378555];return _0x14d79b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc759('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc759('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc759('0x2'));var Mustache=require('mustache');var util=require(_0xc759('0x3'));var path=require(_0xc759('0x4'));var sox=require(_0xc759('0x5'));var csv=require(_0xc759('0x6'));var ejs=require(_0xc759('0x7'));var fs=require('fs');var _=require(_0xc759('0x8'));var squel=require(_0xc759('0x9'));var crypto=require(_0xc759('0xa'));var jsforce=require(_0xc759('0xb'));var deskjs=require(_0xc759('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc759('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc759('0xe'));var qs=require(_0xc759('0xf'));var as=require(_0xc759('0x10'));var hardwareService=require(_0xc759('0x11'));var logger=require('../../config/logger')(_0xc759('0x12'));var utils=require(_0xc759('0x13'));var config=require('../../config/environment');var db=require(_0xc759('0x14'))['db'];function respondWithStatusCode(_0x31c74d,_0x30a682){_0x30a682=_0x30a682||0xcc;return function(_0x4572ed){if(_0x4572ed){return _0x31c74d['sendStatus'](_0x30a682);}return _0x31c74d[_0xc759('0x15')](_0x30a682)[_0xc759('0x16')]();};}function respondWithResult(_0x1b2701,_0x1f601b){_0x1f601b=_0x1f601b||0xc8;return function(_0x4f22e0){if(_0x4f22e0){return _0x1b2701['status'](_0x1f601b)['json'](_0x4f22e0);}};}function respondWithFilteredResult(_0x4e7def,_0x4a76c8){return function(_0x132e47){if(_0x132e47){var _0x5c53f6=_0x132e47[_0xc759('0x17')],_0x415604=_0x4a76c8[_0xc759('0x18')],_0x5add22=_0x4a76c8['offset']+_0x4a76c8[_0xc759('0x19')],_0x4b8733;if(_0x5add22>=_0x5c53f6){_0x5add22=_0x5c53f6;_0x4b8733=0xc8;}else{_0x4b8733=0xce;}_0x4e7def[_0xc759('0x15')](_0x4b8733);return _0x4e7def[_0xc759('0x1a')](_0xc759('0x1b'),_0x415604+'-'+_0x5add22+'/'+_0x5c53f6)[_0xc759('0x1c')](_0x132e47);}return null;};}function patchUpdates(_0x3ca336){return function(_0x42b017){try{jsonpatch[_0xc759('0x1d')](_0x42b017,_0x3ca336,!![]);}catch(_0x17d19d){return BPromise['reject'](_0x17d19d);}return _0x42b017['save']();};}function saveUpdates(_0x957d3b,_0x8cc6d8){return function(_0x3b3cad){if(_0x3b3cad){return _0x3b3cad[_0xc759('0x1e')](_0x957d3b)[_0xc759('0x1f')](function(_0xf21057){return _0xf21057;});}return null;};}function removeEntity(_0x4b90d6,_0x2dc104){return function(_0x4ba037){if(_0x4ba037){return _0x4ba037[_0xc759('0x20')]()[_0xc759('0x1f')](function(){_0x4b90d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d34da,_0x1c440b){return function(_0x20c091){if(!_0x20c091){_0x5d34da['sendStatus'](0x194);}return _0x20c091;};}function handleError(_0x1a4e62,_0x84788f){_0x84788f=_0x84788f||0x1f4;return function(_0x497d18){logger[_0xc759('0x21')](_0x497d18['stack']);if(_0x497d18[_0xc759('0x22')]){delete _0x497d18[_0xc759('0x22')];}_0x1a4e62[_0xc759('0x15')](_0x84788f)[_0xc759('0x23')](_0x497d18);};}exports['index']=function(_0x1c5e2b,_0x3d2f5c){var _0x54329e={},_0x5bd33b={},_0x3b2c19={'count':0x0,'rows':[]};var _0x20a879=_['map'](db[_0xc759('0x24')]['rawAttributes'],function(_0x39a79e){return{'name':_0x39a79e['fieldName'],'type':_0x39a79e['type'][_0xc759('0x25')]};});_0x5bd33b[_0xc759('0x26')]=_[_0xc759('0x27')](_0x20a879,_0xc759('0x22'));_0x5bd33b['query']=_['keys'](_0x1c5e2b[_0xc759('0x28')]);_0x5bd33b[_0xc759('0x29')]=_['intersection'](_0x5bd33b[_0xc759('0x26')],_0x5bd33b['query']);_0x54329e[_0xc759('0x2a')]=_[_0xc759('0x2b')](_0x5bd33b['model'],qs['fields'](_0x1c5e2b[_0xc759('0x28')][_0xc759('0x2c')]));_0x54329e[_0xc759('0x2a')]=_0x54329e[_0xc759('0x2a')][_0xc759('0x2d')]?_0x54329e[_0xc759('0x2a')]:_0x5bd33b[_0xc759('0x26')];if(!_0x1c5e2b['query'][_0xc759('0x2e')](_0xc759('0x2f'))){_0x54329e[_0xc759('0x19')]=qs['limit'](_0x1c5e2b[_0xc759('0x28')][_0xc759('0x19')]);_0x54329e[_0xc759('0x18')]=qs[_0xc759('0x18')](_0x1c5e2b['query'][_0xc759('0x18')]);}_0x54329e[_0xc759('0x30')]=qs[_0xc759('0x31')](_0x1c5e2b[_0xc759('0x28')][_0xc759('0x31')]);_0x54329e[_0xc759('0x32')]=qs[_0xc759('0x29')](_[_0xc759('0x33')](_0x1c5e2b[_0xc759('0x28')],_0x5bd33b[_0xc759('0x29')]),_0x20a879);if(_0x1c5e2b[_0xc759('0x28')][_0xc759('0x34')]){_0x54329e[_0xc759('0x32')]=_[_0xc759('0x35')](_0x54329e[_0xc759('0x32')],{'$or':_['map'](_0x20a879,function(_0x259675){if(_0x259675['type']!=='VIRTUAL'){var _0x8188c8={};_0x8188c8[_0x259675[_0xc759('0x22')]]={'$like':'%'+_0x1c5e2b[_0xc759('0x28')][_0xc759('0x34')]+'%'};return _0x8188c8;}})});}_0x54329e=_[_0xc759('0x35')]({},_0x54329e,_0x1c5e2b[_0xc759('0x36')]);var _0x28b13c={'where':_0x54329e[_0xc759('0x32')]};return db[_0xc759('0x24')]['count'](_0x28b13c)[_0xc759('0x1f')](function(_0x2a6ee0){_0x3b2c19[_0xc759('0x17')]=_0x2a6ee0;if(_0x1c5e2b[_0xc759('0x28')][_0xc759('0x37')]){_0x54329e[_0xc759('0x38')]=[{'all':!![]}];}return db['SugarcrmField'][_0xc759('0x39')](_0x54329e);})[_0xc759('0x1f')](function(_0x1f4b3b){_0x3b2c19[_0xc759('0x3a')]=_0x1f4b3b;return _0x3b2c19;})['then'](respondWithFilteredResult(_0x3d2f5c,_0x54329e))[_0xc759('0x3b')](handleError(_0x3d2f5c,null));};exports[_0xc759('0x3c')]=function(_0x51908d,_0x1dae77){var _0x26cccc={'raw':!![],'where':{'id':_0x51908d[_0xc759('0x3d')]['id']}},_0x18881e={};_0x18881e[_0xc759('0x26')]=_[_0xc759('0x3e')](db[_0xc759('0x24')][_0xc759('0x3f')]);_0x18881e[_0xc759('0x28')]=_[_0xc759('0x3e')](_0x51908d[_0xc759('0x28')]);_0x18881e['filters']=_[_0xc759('0x2b')](_0x18881e['model'],_0x18881e[_0xc759('0x28')]);_0x26cccc['attributes']=_['intersection'](_0x18881e[_0xc759('0x26')],qs[_0xc759('0x2c')](_0x51908d[_0xc759('0x28')][_0xc759('0x2c')]));_0x26cccc['attributes']=_0x26cccc['attributes'][_0xc759('0x2d')]?_0x26cccc[_0xc759('0x2a')]:_0x18881e['model'];if(_0x51908d['query'][_0xc759('0x37')]){_0x26cccc[_0xc759('0x38')]=[{'all':!![]}];}_0x26cccc=_[_0xc759('0x35')]({},_0x26cccc,_0x51908d[_0xc759('0x36')]);return db[_0xc759('0x24')][_0xc759('0x40')](_0x26cccc)[_0xc759('0x1f')](handleEntityNotFound(_0x1dae77,null))[_0xc759('0x1f')](respondWithResult(_0x1dae77,null))[_0xc759('0x3b')](handleError(_0x1dae77,null));};exports[_0xc759('0x41')]=function(_0x56ebb7,_0x39ef0b){return db[_0xc759('0x24')]['create'](_0x56ebb7[_0xc759('0x42')],{})[_0xc759('0x1f')](respondWithResult(_0x39ef0b,0xc9))[_0xc759('0x3b')](handleError(_0x39ef0b,null));};exports['update']=function(_0x360f47,_0xe51797){if(_0x360f47['body']['id']){delete _0x360f47[_0xc759('0x42')]['id'];}return db[_0xc759('0x24')][_0xc759('0x40')]({'where':{'id':_0x360f47['params']['id']}})[_0xc759('0x1f')](handleEntityNotFound(_0xe51797,null))[_0xc759('0x1f')](saveUpdates(_0x360f47[_0xc759('0x42')],null))[_0xc759('0x1f')](respondWithResult(_0xe51797,null))[_0xc759('0x3b')](handleError(_0xe51797,null));};exports[_0xc759('0x20')]=function(_0x15cf70,_0x2e2064){return db[_0xc759('0x24')][_0xc759('0x40')]({'where':{'id':_0x15cf70[_0xc759('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2e2064,null))['then'](removeEntity(_0x2e2064,null))[_0xc759('0x3b')](handleError(_0x2e2064,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js
index 9c1bfa1..c347f8b 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.model.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x935c=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField'];(function(_0x15bf32,_0x2a4119){var _0x215301=function(_0x55079b){while(--_0x55079b){_0x15bf32['push'](_0x15bf32['shift']());}};_0x215301(++_0x2a4119);}(_0x935c,0x1f0));var _0xc935=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x935c[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xc935('0x0'));var util=require(_0xc935('0x1'));var logger=require(_0xc935('0x2'))(_0xc935('0x3'));var moment=require(_0xc935('0x4'));var BPromise=require(_0xc935('0x5'));var rp=require(_0xc935('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc935('0x7'));var attributes=require(_0xc935('0x8'));module['exports']=function(_0x2f88e4,_0x5212be){return _0x2f88e4[_0xc935('0x9')](_0xc935('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xc935('0xb'),_0xc935('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe679=['rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','FieldId','util','../../config/logger','api','moment','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe679,0x157));var _0x9e67=function(_0x529556,_0x176ea1){_0x529556=_0x529556-0x0;var _0x5748e1=_0xe679[_0x529556];return _0x5748e1;};'use strict';var _=require('lodash');var util=require(_0x9e67('0x0'));var logger=require(_0x9e67('0x1'))(_0x9e67('0x2'));var moment=require(_0x9e67('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e67('0x4'));var rimraf=require(_0x9e67('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e67('0x6'));module[_0x9e67('0x7')]=function(_0x4035af,_0x449049){return _0x4035af[_0x9e67('0x8')](_0x9e67('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x9e67('0xa'),'fields':['idField',_0x9e67('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js
index ec9a451..2acbbde 100644
--- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js
+++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x18492f,_0x1fd80a){var _0x39b8d2=function(_0x570347){while(--_0x570347){_0x18492f['push'](_0x18492f['shift']());}};_0x39b8d2(++_0x1fd80a);}(_0x1a85,0x178));var _0x51a8=function(_0x408a02,_0x478ca0){_0x408a02=_0x408a02-0x0;var _0x579bce=_0x1a85[_0x408a02];return _0x579bce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}
\ No newline at end of file
+var _0x4fc2=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x4fc2,0x111));var _0x24fc=function(_0x39221a,_0xf9c0c2){_0x39221a=_0x39221a-0x0;var _0x14644d=_0x4fc2[_0x39221a];return _0x14644d;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js
index 67b6491..03c76e4 100644
--- a/server/api/intVtigerAccount/index.js
+++ b/server/api/intVtigerAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0fcd=['getFields','post','create','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations'];(function(_0x1ccb6b,_0x4e91e6){var _0x4c316=function(_0x324f8c){while(--_0x324f8c){_0x1ccb6b['push'](_0x1ccb6b['shift']());}};_0x4c316(++_0x4e91e6);}(_0x0fcd,0x197));var _0xd0fc=function(_0x5572b0,_0x3dfcce){_0x5572b0=_0x5572b0-0x0;var _0x559e38=_0x0fcd[_0x5572b0];return _0x559e38;};'use strict';var multer=require(_0xd0fc('0x0'));var util=require('util');var path=require(_0xd0fc('0x1'));var timeout=require(_0xd0fc('0x2'));var express=require('express');var router=express[_0xd0fc('0x3')]();var auth=require(_0xd0fc('0x4'));var interaction=require(_0xd0fc('0x5'));var config=require('../../config/environment');var controller=require(_0xd0fc('0x6'));router[_0xd0fc('0x7')]('/',auth[_0xd0fc('0x8')](),controller[_0xd0fc('0x9')]);router[_0xd0fc('0x7')](_0xd0fc('0xa'),auth[_0xd0fc('0x8')](),controller['show']);router[_0xd0fc('0x7')](_0xd0fc('0xb'),auth[_0xd0fc('0x8')](),controller[_0xd0fc('0xc')]);router[_0xd0fc('0x7')]('/:id/fields',auth[_0xd0fc('0x8')](),controller[_0xd0fc('0xd')]);router[_0xd0fc('0xe')]('/',auth[_0xd0fc('0x8')](),controller[_0xd0fc('0xf')]);router[_0xd0fc('0xe')](_0xd0fc('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xd0fc('0x10')]('/:id',auth[_0xd0fc('0x8')](),controller[_0xd0fc('0x11')]);router[_0xd0fc('0x12')](_0xd0fc('0xa'),auth[_0xd0fc('0x8')](),controller['destroy']);module[_0xd0fc('0x13')]=router;
\ No newline at end of file
+var _0x3788=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','update','destroy','multer','util','path'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x3788,0x1d1));var _0x8378=function(_0x3b8dd8,_0x894728){_0x3b8dd8=_0x3b8dd8-0x0;var _0x4112cd=_0x3788[_0x3b8dd8];return _0x4112cd;};'use strict';var multer=require(_0x8378('0x0'));var util=require(_0x8378('0x1'));var path=require(_0x8378('0x2'));var timeout=require(_0x8378('0x3'));var express=require('express');var router=express[_0x8378('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8378('0x5'));var config=require(_0x8378('0x6'));var controller=require(_0x8378('0x7'));router[_0x8378('0x8')]('/',auth[_0x8378('0x9')](),controller['index']);router['get'](_0x8378('0xa'),auth[_0x8378('0x9')](),controller[_0x8378('0xb')]);router[_0x8378('0x8')](_0x8378('0xc'),auth[_0x8378('0x9')](),controller[_0x8378('0xd')]);router[_0x8378('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x8378('0xe')]);router[_0x8378('0xf')]('/',auth[_0x8378('0x9')](),controller['create']);router[_0x8378('0xf')](_0x8378('0xc'),auth[_0x8378('0x9')](),controller['addConfiguration']);router['put']('/:id',auth[_0x8378('0x9')](),controller[_0x8378('0x10')]);router['delete'](_0x8378('0xa'),auth[_0x8378('0x9')](),controller[_0x8378('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js
index 1671c8a..c43203e 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.attributes.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1848=['STRING','HelpDesk','exports'];(function(_0x1d2fb7,_0x46f357){var _0x4fadd9=function(_0x54b557){while(--_0x54b557){_0x1d2fb7['push'](_0x1d2fb7['shift']());}};_0x4fadd9(++_0x46f357);}(_0x1848,0x12b));var _0x8184=function(_0x53b8f2,_0x33050a){_0x53b8f2=_0x53b8f2-0x0;var _0x40abf1=_0x1848[_0x53b8f2];return _0x40abf1;};'use strict';var Sequelize=require('sequelize');module[_0x8184('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8184('0x1')]},'username':{'type':Sequelize[_0x8184('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8184('0x1')],'allowNull':![],'defaultValue':_0x8184('0x2')},'remoteUri':{'type':Sequelize[_0x8184('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xb57a=['STRING','HelpDesk','exports'];(function(_0x365b8b,_0x10de10){var _0x42647a=function(_0x331155){while(--_0x331155){_0x365b8b['push'](_0x365b8b['shift']());}};_0x42647a(++_0x10de10);}(_0xb57a,0x107));var _0xab57=function(_0x47b14b,_0x1df7d8){_0x47b14b=_0x47b14b-0x0;var _0x10cd15=_0xb57a[_0x47b14b];return _0x10cd15;};'use strict';var Sequelize=require('sequelize');module[_0xab57('0x0')]={'name':{'type':Sequelize[_0xab57('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xab57('0x1')]},'username':{'type':Sequelize[_0xab57('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xab57('0x1')],'allowNull':![],'defaultValue':_0xab57('0x2')},'remoteUri':{'type':Sequelize[_0xab57('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0xab57('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js
index 5b6e004..a8a984a 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.controller.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3ca=['owner','remove','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','index','map','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','VtigerAccount','includeAll','findAll','rows','params','find','create','body','update','getConfigurations','findOne','VtigerConfiguration','filters','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','token','success','sessionName','autogenerated','reference'];(function(_0x367725,_0x1888d4){var _0x2526f6=function(_0x18725e){while(--_0x18725e){_0x367725['push'](_0x367725['shift']());}};_0x2526f6(++_0x1888d4);}(_0xf3ca,0x97));var _0xaf3c=function(_0x3bcf38,_0x290cc0){_0x3bcf38=_0x3bcf38-0x0;var _0x49d42e=_0xf3ca[_0x3bcf38];return _0x49d42e;};'use strict';var pdf=require(_0xaf3c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaf3c('0x1'));var zipdir=require(_0xaf3c('0x2'));var jsonpatch=require(_0xaf3c('0x3'));var rp=require(_0xaf3c('0x4'));var moment=require(_0xaf3c('0x5'));var BPromise=require(_0xaf3c('0x6'));var Mustache=require(_0xaf3c('0x7'));var util=require('util');var path=require(_0xaf3c('0x8'));var sox=require(_0xaf3c('0x9'));var csv=require('to-csv');var ejs=require(_0xaf3c('0xa'));var fs=require('fs');var _=require(_0xaf3c('0xb'));var squel=require(_0xaf3c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaf3c('0xd'));var toCsv=require(_0xaf3c('0xe'));var querystring=require('querystring');var Papa=require(_0xaf3c('0xf'));var Redis=require(_0xaf3c('0x10'));var authService=require(_0xaf3c('0x11'));var qs=require(_0xaf3c('0x12'));var as=require(_0xaf3c('0x13'));var hardwareService=require(_0xaf3c('0x14'));var logger=require(_0xaf3c('0x15'))(_0xaf3c('0x16'));var utils=require(_0xaf3c('0x17'));var config=require(_0xaf3c('0x18'));var db=require(_0xaf3c('0x19'))['db'];var integrations=require(_0xaf3c('0x1a'));var jayson=require(_0xaf3c('0x1b'));var client=jayson[_0xaf3c('0x1c')][_0xaf3c('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x563571,_0x3c66ac,_0x890fdc){if(_0x890fdc){var _0x180331=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x180331[_0xaf3c('0x1e')](_0x3c66ac)){return _0x563571;}else{throw new db['Sequelize'][(_0xaf3c('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x563571;}}function respondWithRpcPromise(_0x194ff5,_0x962b9,_0x238c01,_0x197193){return new BPromise(function(_0x2d1f96,_0xb3b0c8){var _0x33cd12=_0x197193||client;return _0x33cd12[_0xaf3c('0x20')](_0x194ff5,_0x238c01)['then'](function(_0x5e23e5){logger[_0xaf3c('0x21')](_0xaf3c('0x22'),_0x962b9,_0xaf3c('0x23'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x962b9,_0xaf3c('0x23'),JSON[_0xaf3c('0x24')](_0x5e23e5));if(_0x5e23e5[_0xaf3c('0x25')]){if(_0x5e23e5['error'][_0xaf3c('0x26')]===0x1f4){logger[_0xaf3c('0x25')](_0xaf3c('0x22'),_0x962b9,_0x5e23e5[_0xaf3c('0x25')]['message']);return _0xb3b0c8(_0x5e23e5[_0xaf3c('0x25')][_0xaf3c('0x27')]);}logger[_0xaf3c('0x25')](_0xaf3c('0x22'),_0x962b9,_0x5e23e5[_0xaf3c('0x25')][_0xaf3c('0x27')]);return _0x2d1f96(_0x5e23e5[_0xaf3c('0x25')][_0xaf3c('0x27')]);}else{logger[_0xaf3c('0x21')](_0xaf3c('0x22'),_0x962b9,'request\x20sent');_0x2d1f96(_0x5e23e5[_0xaf3c('0x28')][_0xaf3c('0x27')]);}})[_0xaf3c('0x29')](function(_0x2d7c49){logger['error'](_0xaf3c('0x22'),_0x962b9,_0x2d7c49);_0xb3b0c8(_0x2d7c49);});});}function respondWithStatusCode(_0x32405d,_0x20ab0c){_0x20ab0c=_0x20ab0c||0xcc;return function(_0x4a9716){if(_0x4a9716){return _0x32405d[_0xaf3c('0x2a')](_0x20ab0c);}return _0x32405d[_0xaf3c('0x2b')](_0x20ab0c)[_0xaf3c('0x2c')]();};}function respondWithResult(_0x4cee46,_0x311a7f){_0x311a7f=_0x311a7f||0xc8;return function(_0x261db5){if(_0x261db5){return _0x4cee46[_0xaf3c('0x2b')](_0x311a7f)[_0xaf3c('0x2d')](_0x261db5);}};}function respondWithFilteredResult(_0x293c8f,_0x335ebf){return function(_0x31748d){if(_0x31748d){var _0x3ad0ba=_0x31748d[_0xaf3c('0x2e')],_0x1adcff=_0x335ebf[_0xaf3c('0x2f')],_0x5a502a=_0x335ebf[_0xaf3c('0x2f')]+_0x335ebf[_0xaf3c('0x30')],_0x5a4d7b;if(_0x5a502a>=_0x3ad0ba){_0x5a502a=_0x3ad0ba;_0x5a4d7b=0xc8;}else{_0x5a4d7b=0xce;}_0x293c8f[_0xaf3c('0x2b')](_0x5a4d7b);return _0x293c8f[_0xaf3c('0x31')](_0xaf3c('0x32'),_0x1adcff+'-'+_0x5a502a+'/'+_0x3ad0ba)['json'](_0x31748d);}return null;};}function patchUpdates(_0xe5adc){return function(_0x118536){try{jsonpatch[_0xaf3c('0x33')](_0x118536,_0xe5adc,!![]);}catch(_0x571787){return BPromise[_0xaf3c('0x34')](_0x571787);}return _0x118536[_0xaf3c('0x35')]();};}function saveUpdates(_0x3712cc,_0x34dd49){return function(_0x264f25){if(_0x264f25){return _0x264f25['update'](_0x3712cc)[_0xaf3c('0x36')](function(_0x318b9d){return _0x318b9d;});}return null;};}function removeEntity(_0x478f8c,_0x2f5069){return function(_0x1e4519){if(_0x1e4519){return _0x1e4519[_0xaf3c('0x37')]()['then'](function(){_0x478f8c[_0xaf3c('0x2b')](0xcc)[_0xaf3c('0x2c')]();});}};}function handleEntityNotFound(_0xb2a65e,_0x1d7f8d){return function(_0x537c34){if(!_0x537c34){_0xb2a65e[_0xaf3c('0x2a')](0x194);}return _0x537c34;};}function handleError(_0x2970af,_0x19cc6d){_0x19cc6d=_0x19cc6d||0x1f4;return function(_0x353076){logger['error'](_0x353076['stack']);if(_0x353076['name']){delete _0x353076['name'];}_0x2970af['status'](_0x19cc6d)['send'](_0x353076);};}exports[_0xaf3c('0x38')]=function(_0x1d9287,_0x1be0a6){var _0x52e041={},_0x20644e={},_0x4bf674={'count':0x0,'rows':[]};var _0x45b661=_[_0xaf3c('0x39')](db['VtigerAccount'][_0xaf3c('0x3a')],function(_0x239a62){return{'name':_0x239a62[_0xaf3c('0x3b')],'type':_0x239a62['type'][_0xaf3c('0x3c')]};});_0x20644e[_0xaf3c('0x3d')]=_[_0xaf3c('0x39')](_0x45b661,_0xaf3c('0x3e'));_0x20644e[_0xaf3c('0x3f')]=_[_0xaf3c('0x40')](_0x1d9287[_0xaf3c('0x3f')]);_0x20644e['filters']=_[_0xaf3c('0x41')](_0x20644e['model'],_0x20644e['query']);_0x52e041[_0xaf3c('0x42')]=_['intersection'](_0x20644e[_0xaf3c('0x3d')],qs[_0xaf3c('0x43')](_0x1d9287[_0xaf3c('0x3f')][_0xaf3c('0x43')]));_0x52e041[_0xaf3c('0x42')]=_0x52e041[_0xaf3c('0x42')][_0xaf3c('0x44')]?_0x52e041[_0xaf3c('0x42')]:_0x20644e['model'];if(!_0x1d9287['query'][_0xaf3c('0x45')](_0xaf3c('0x46'))){_0x52e041[_0xaf3c('0x30')]=qs[_0xaf3c('0x30')](_0x1d9287[_0xaf3c('0x3f')][_0xaf3c('0x30')]);_0x52e041[_0xaf3c('0x2f')]=qs[_0xaf3c('0x2f')](_0x1d9287[_0xaf3c('0x3f')][_0xaf3c('0x2f')]);}_0x52e041[_0xaf3c('0x47')]=qs[_0xaf3c('0x48')](_0x1d9287[_0xaf3c('0x3f')][_0xaf3c('0x48')]);_0x52e041[_0xaf3c('0x49')]=qs['filters'](_[_0xaf3c('0x4a')](_0x1d9287[_0xaf3c('0x3f')],_0x20644e['filters']),_0x45b661);if(_0x1d9287['query'][_0xaf3c('0x4b')]){_0x52e041[_0xaf3c('0x49')]=_[_0xaf3c('0x4c')](_0x52e041['where'],{'$or':_[_0xaf3c('0x39')](_0x45b661,function(_0x386f16){if(_0x386f16[_0xaf3c('0x4d')]!=='VIRTUAL'){var _0x3ab598={};_0x3ab598[_0x386f16[_0xaf3c('0x3e')]]={'$like':'%'+_0x1d9287[_0xaf3c('0x3f')][_0xaf3c('0x4b')]+'%'};return _0x3ab598;}})});}_0x52e041=_['merge']({},_0x52e041,_0x1d9287[_0xaf3c('0x4e')]);var _0x4c3cd8={'where':_0x52e041[_0xaf3c('0x49')]};return db[_0xaf3c('0x4f')][_0xaf3c('0x2e')](_0x4c3cd8)[_0xaf3c('0x36')](function(_0x38cec){_0x4bf674[_0xaf3c('0x2e')]=_0x38cec;if(_0x1d9287[_0xaf3c('0x3f')][_0xaf3c('0x50')]){_0x52e041['include']=[{'all':!![]}];}return db[_0xaf3c('0x4f')][_0xaf3c('0x51')](_0x52e041);})['then'](function(_0x93ff81){_0x4bf674[_0xaf3c('0x52')]=_0x93ff81;return _0x4bf674;})[_0xaf3c('0x36')](respondWithFilteredResult(_0x1be0a6,_0x52e041))[_0xaf3c('0x29')](handleError(_0x1be0a6,null));};exports['show']=function(_0x26d71a,_0x478bbf){var _0x55ec22={'raw':![],'where':{'id':_0x26d71a[_0xaf3c('0x53')]['id']}},_0x529d29={};_0x529d29['model']=_[_0xaf3c('0x40')](db[_0xaf3c('0x4f')][_0xaf3c('0x3a')]);_0x529d29[_0xaf3c('0x3f')]=_[_0xaf3c('0x40')](_0x26d71a['query']);_0x529d29['filters']=_[_0xaf3c('0x41')](_0x529d29['model'],_0x529d29[_0xaf3c('0x3f')]);_0x55ec22[_0xaf3c('0x42')]=_[_0xaf3c('0x41')](_0x529d29[_0xaf3c('0x3d')],qs[_0xaf3c('0x43')](_0x26d71a[_0xaf3c('0x3f')][_0xaf3c('0x43')]));_0x55ec22[_0xaf3c('0x42')]=_0x55ec22[_0xaf3c('0x42')][_0xaf3c('0x44')]?_0x55ec22[_0xaf3c('0x42')]:_0x529d29[_0xaf3c('0x3d')];if(_0x26d71a[_0xaf3c('0x3f')][_0xaf3c('0x50')]){_0x55ec22['include']=[{'all':!![]}];}_0x55ec22=_['merge']({},_0x55ec22,_0x26d71a[_0xaf3c('0x4e')]);return db['VtigerAccount'][_0xaf3c('0x54')](_0x55ec22)[_0xaf3c('0x36')](handleEntityNotFound(_0x478bbf,null))[_0xaf3c('0x36')](respondWithResult(_0x478bbf,null))['catch'](handleError(_0x478bbf,null));};exports[_0xaf3c('0x55')]=function(_0xc3a16e,_0x3576ea){return db[_0xaf3c('0x4f')][_0xaf3c('0x55')](_0xc3a16e[_0xaf3c('0x56')],{})['then'](respondWithResult(_0x3576ea,0xc9))[_0xaf3c('0x29')](handleError(_0x3576ea,null));};exports[_0xaf3c('0x57')]=function(_0x5821ed,_0x29dd46){if(_0x5821ed[_0xaf3c('0x56')]['id']){delete _0x5821ed[_0xaf3c('0x56')]['id'];}return db[_0xaf3c('0x4f')]['find']({'where':{'id':_0x5821ed[_0xaf3c('0x53')]['id']}})['then'](handleEntityNotFound(_0x29dd46,null))[_0xaf3c('0x36')](saveUpdates(_0x5821ed[_0xaf3c('0x56')],null))['then'](respondWithResult(_0x29dd46,null))[_0xaf3c('0x29')](handleError(_0x29dd46,null));};exports[_0xaf3c('0x37')]=function(_0x30f9df,_0x528db9){return db['VtigerAccount'][_0xaf3c('0x54')]({'where':{'id':_0x30f9df['params']['id']}})[_0xaf3c('0x36')](handleEntityNotFound(_0x528db9,null))[_0xaf3c('0x36')](removeEntity(_0x528db9,null))[_0xaf3c('0x29')](handleError(_0x528db9,null));};exports[_0xaf3c('0x58')]=function(_0xfbe8cc,_0x26f93e,_0x46cf4f){var _0x44fa0a={};var _0x1a926f={};var _0x50e361;var _0x5927ab;return db[_0xaf3c('0x4f')][_0xaf3c('0x59')]({'where':{'id':_0xfbe8cc[_0xaf3c('0x53')]['id']}})[_0xaf3c('0x36')](handleEntityNotFound(_0x26f93e,null))[_0xaf3c('0x36')](function(_0x235a30){if(_0x235a30){_0x50e361=_0x235a30;_0x1a926f[_0xaf3c('0x3d')]=_[_0xaf3c('0x40')](db[_0xaf3c('0x5a')]['rawAttributes']);_0x1a926f[_0xaf3c('0x3f')]=_[_0xaf3c('0x40')](_0xfbe8cc[_0xaf3c('0x3f')]);_0x1a926f[_0xaf3c('0x5b')]=_['intersection'](_0x1a926f[_0xaf3c('0x3d')],_0x1a926f['query']);_0x44fa0a[_0xaf3c('0x42')]=_[_0xaf3c('0x41')](_0x1a926f[_0xaf3c('0x3d')],qs[_0xaf3c('0x43')](_0xfbe8cc[_0xaf3c('0x3f')]['fields']));_0x44fa0a[_0xaf3c('0x42')]=_0x44fa0a[_0xaf3c('0x42')][_0xaf3c('0x44')]?_0x44fa0a[_0xaf3c('0x42')]:_0x1a926f['model'];_0x44fa0a[_0xaf3c('0x47')]=qs['sort'](_0xfbe8cc[_0xaf3c('0x3f')][_0xaf3c('0x48')]);_0x44fa0a[_0xaf3c('0x49')]=qs[_0xaf3c('0x5b')](_[_0xaf3c('0x4a')](_0xfbe8cc[_0xaf3c('0x3f')],_0x1a926f['filters']));if(_0xfbe8cc[_0xaf3c('0x3f')][_0xaf3c('0x4b')]){_0x44fa0a[_0xaf3c('0x49')]=_[_0xaf3c('0x4c')](_0x44fa0a[_0xaf3c('0x49')],{'$or':_[_0xaf3c('0x39')](_0x44fa0a[_0xaf3c('0x42')],function(_0x51677b){var _0x20b77a={};_0x20b77a[_0x51677b]={'$like':'%'+_0xfbe8cc['query'][_0xaf3c('0x4b')]+'%'};return _0x20b77a;})});}_0x44fa0a=_['merge']({},_0x44fa0a,_0xfbe8cc[_0xaf3c('0x4e')]);return _0x50e361['getConfigurations'](_0x44fa0a);}})[_0xaf3c('0x36')](function(_0x496464){if(_0x496464){_0x5927ab=_0x496464['length'];if(!_0xfbe8cc[_0xaf3c('0x3f')][_0xaf3c('0x45')](_0xaf3c('0x46'))){_0x44fa0a[_0xaf3c('0x30')]=qs[_0xaf3c('0x30')](_0xfbe8cc[_0xaf3c('0x3f')]['limit']);_0x44fa0a[_0xaf3c('0x2f')]=qs[_0xaf3c('0x2f')](_0xfbe8cc[_0xaf3c('0x3f')]['offset']);}return _0x50e361['getConfigurations'](_0x44fa0a);}})[_0xaf3c('0x36')](function(_0x2cd55c){if(_0x2cd55c){return _0x2cd55c?{'count':_0x5927ab,'rows':_0x2cd55c}:null;}})[_0xaf3c('0x36')](respondWithResult(_0x26f93e,null))[_0xaf3c('0x29')](handleError(_0x26f93e,null));};exports[_0xaf3c('0x5c')]=function(_0x37dce5,_0x4142a4,_0x209baa){if(_0x37dce5['body']['id']){delete _0x37dce5[_0xaf3c('0x56')]['id'];}return db[_0xaf3c('0x4f')][_0xaf3c('0x59')]({'where':{'id':_0x37dce5[_0xaf3c('0x53')]['id']}})[_0xaf3c('0x36')](handleEntityNotFound(_0x4142a4,null))['then'](function(_0xaf2e1){if(_0xaf2e1){_0x37dce5[_0xaf3c('0x56')][_0xaf3c('0x5d')]=_0xaf2e1['id'];_0x37dce5['body'][_0xaf3c('0x5e')]=integrations[_0xaf3c('0x5f')](_0x37dce5[_0xaf3c('0x56')][_0xaf3c('0x60')],_0x37dce5[_0xaf3c('0x56')][_0xaf3c('0x4d')]);_0x37dce5[_0xaf3c('0x56')]['Descriptions']=integrations[_0xaf3c('0x61')](_0x37dce5['body']['channel'],_0x37dce5[_0xaf3c('0x56')][_0xaf3c('0x4d')]);return db['VtigerConfiguration'][_0xaf3c('0x55')](_0x37dce5[_0xaf3c('0x56')],{'include':[{'model':db[_0xaf3c('0x62')],'as':_0xaf3c('0x5e')},{'model':db[_0xaf3c('0x62')],'as':_0xaf3c('0x63')}]});}return null;})['then'](respondWithResult(_0x4142a4,null))['catch'](handleError(_0x4142a4,null));};var md5=require(_0xaf3c('0x64'));exports[_0xaf3c('0x65')]=function(_0x339f3b,_0x27c43e,_0x396458){var _0x1f8f0b=null;var _0x1640f2=null;var _0x909c05=null;var _0x327aa5=null;var _0x1ab0ac='';return db[_0xaf3c('0x4f')]['findOne']({'where':{'id':_0x339f3b[_0xaf3c('0x53')]['id']},'attributes':['id',_0xaf3c('0x3e'),_0xaf3c('0x66'),_0xaf3c('0x67'),_0xaf3c('0x68'),'remoteUri',_0xaf3c('0x69'),'accessKey']})[_0xaf3c('0x36')](handleEntityNotFound(_0x27c43e,null))[_0xaf3c('0x36')](function(_0x122d5b){if(_0x122d5b){_0x1f8f0b=_0x122d5b[_0xaf3c('0x66')];_0x1640f2=_0x122d5b[_0xaf3c('0x6a')];_0x909c05=_0x122d5b[_0xaf3c('0x68')];_0x1ab0ac=_0x122d5b[_0xaf3c('0x6b')];var _0x154bec=_0x1ab0ac[_0xaf3c('0x6c')](-0x1);if(_0x154bec==='/'){_0x1ab0ac=_0x1ab0ac['substring'](0x0,_0x1ab0ac[_0xaf3c('0x6d')](_0x154bec));}_0x327aa5=util[_0xaf3c('0x6e')](_0xaf3c('0x6f'),_0x1ab0ac);var _0x399faa={'method':_0xaf3c('0x70'),'uri':_0x327aa5,'qs':{'operation':_0xaf3c('0x71'),'username':_0x122d5b[_0xaf3c('0x66')]},'json':!![]};return rp(_0x399faa);}})[_0xaf3c('0x36')](function(_0x1fcc92){if(_0x1fcc92['success']){var _0xcfe242={'method':_0xaf3c('0x72'),'uri':_0x327aa5,'form':{'operation':_0xaf3c('0x73'),'username':_0x1f8f0b,'accessKey':md5(_0x1fcc92['result'][_0xaf3c('0x74')]+_0x1640f2)},'json':!![]};return rp(_0xcfe242);}})[_0xaf3c('0x36')](function(_0x3192ce){if(_0x3192ce[_0xaf3c('0x75')]){var _0x5dee64={'method':'GET','uri':_0x327aa5,'qs':{'operation':'describe','username':_0x1f8f0b,'sessionName':_0x3192ce[_0xaf3c('0x28')][_0xaf3c('0x76')],'elementType':_0x909c05},'json':!![]};return rp(_0x5dee64);}})[_0xaf3c('0x36')](function(_0x507473){if(_0x507473[_0xaf3c('0x75')]){var _0x356243=[_0xaf3c('0x77'),_0xaf3c('0x78'),_0xaf3c('0x79')];_['remove'](_0x507473['result'][_0xaf3c('0x43')],function(_0x339a4c){return _0x356243['includes'](_0x339a4c[_0xaf3c('0x4d')][_0xaf3c('0x3e')]);});_[_0xaf3c('0x7a')](_0x507473[_0xaf3c('0x28')][_0xaf3c('0x43')],function(_0x1afae2){return _0x1afae2[_0xaf3c('0x7b')]===_0xaf3c('0x7c');});return{'count':_0x507473['result'][_0xaf3c('0x43')]['length'],'rows':_[_0xaf3c('0x39')](_0x507473[_0xaf3c('0x28')]['fields'],function(_0x1947fd){return{'id':_0x1947fd[_0xaf3c('0x3e')],'name':_0x1947fd[_0xaf3c('0x7d')],'custom':_['startsWith'](_0x1947fd[_0xaf3c('0x3e')],_0xaf3c('0x7e'))?!![]:![],'options':_0x1947fd[_0xaf3c('0x4d')]['name']===_0xaf3c('0x7f')&&_0x1947fd[_0xaf3c('0x4d')][_0xaf3c('0x80')][_0xaf3c('0x44')]>0x0?_[_0xaf3c('0x39')](_0x1947fd[_0xaf3c('0x4d')][_0xaf3c('0x80')],function(_0x3c7965){return{'name':_0x3c7965[_0xaf3c('0x7d')],'value':_0x3c7965[_0xaf3c('0x81')]};}):[]};})};}})['then'](respondWithResult(_0x27c43e,null))[_0xaf3c('0x29')](function(_0x108533){console[_0xaf3c('0x82')](_0xaf3c('0x83')+_0x108533);var _0x24037a=_0x339f3b['query'][_0xaf3c('0x1e')]?0x1f4:_0x108533[_0xaf3c('0x84')]||0x1f4;logger[_0xaf3c('0x25')](_0xaf3c('0x85'),_0xaf3c('0x65'),_0x24037a,JSON['stringify'](_0x108533));delete _0x108533[_0xaf3c('0x3e')];if(_0x24037a===0x191){_0x24037a=0x190;}_0x27c43e[_0xaf3c('0x2b')](_0x24037a)[_0xaf3c('0x86')](_0x339f3b[_0xaf3c('0x3f')][_0xaf3c('0x1e')]?{'message':_0xaf3c('0x87'),'statusCode':_0x108533[_0xaf3c('0x84')]}:_0x108533);});};
\ No newline at end of file
+var _0x6e2a=['count','offset','Content-Range','apply','reject','save','update','end','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll','find','catch','body','destroy','getConfigurations','findOne','VtigerConfiguration','options','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','POST','token','success','autogenerated','owner','remove','includes','editable','false','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','zip-dir','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status'];(function(_0x10ec98,_0x17f693){var _0x2976b9=function(_0x37d0aa){while(--_0x37d0aa){_0x10ec98['push'](_0x10ec98['shift']());}};_0x2976b9(++_0x17f693);}(_0x6e2a,0xd4));var _0xa6e2=function(_0x957193,_0x3fec8b){_0x957193=_0x957193-0x0;var _0x9473f8=_0x6e2a[_0x957193];return _0x9473f8;};'use strict';var pdf=require(_0xa6e2('0x0'));var emlformat=require(_0xa6e2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa6e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa6e2('0x3'));var util=require(_0xa6e2('0x4'));var path=require(_0xa6e2('0x5'));var sox=require('sox');var csv=require(_0xa6e2('0x6'));var ejs=require(_0xa6e2('0x7'));var fs=require('fs');var _=require(_0xa6e2('0x8'));var squel=require(_0xa6e2('0x9'));var crypto=require(_0xa6e2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa6e2('0xb'));var toCsv=require(_0xa6e2('0x6'));var querystring=require(_0xa6e2('0xc'));var Papa=require(_0xa6e2('0xd'));var Redis=require(_0xa6e2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa6e2('0xf'));var as=require(_0xa6e2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6e2('0x11'))(_0xa6e2('0x12'));var utils=require(_0xa6e2('0x13'));var config=require(_0xa6e2('0x14'));var db=require(_0xa6e2('0x15'))['db'];var integrations=require(_0xa6e2('0x16'));var jayson=require(_0xa6e2('0x17'));var client=jayson[_0xa6e2('0x18')][_0xa6e2('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2cd92e,_0x3ce3a8,_0x166de5){if(_0x166de5){var _0x390da0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x390da0['test'](_0x3ce3a8)){return _0x2cd92e;}else{throw new db[(_0xa6e2('0x1a'))][(_0xa6e2('0x1b'))](_0xa6e2('0x1c'));}}else{return _0x2cd92e;}}function respondWithRpcPromise(_0xdb0d29,_0x2150a5,_0xcf2473,_0x135b29){return new BPromise(function(_0x4be9dc,_0x57ab33){var _0x4caede=_0x135b29||client;return _0x4caede[_0xa6e2('0x1d')](_0xdb0d29,_0xcf2473)[_0xa6e2('0x1e')](function(_0x547040){logger['info'](_0xa6e2('0x1f'),_0x2150a5,_0xa6e2('0x20'));logger[_0xa6e2('0x21')](_0xa6e2('0x22'),_0x2150a5,_0xa6e2('0x20'),JSON[_0xa6e2('0x23')](_0x547040));if(_0x547040[_0xa6e2('0x24')]){if(_0x547040[_0xa6e2('0x24')]['code']===0x1f4){logger['error'](_0xa6e2('0x1f'),_0x2150a5,_0x547040['error'][_0xa6e2('0x25')]);return _0x57ab33(_0x547040[_0xa6e2('0x24')]['message']);}logger[_0xa6e2('0x24')](_0xa6e2('0x1f'),_0x2150a5,_0x547040['error'][_0xa6e2('0x25')]);return _0x4be9dc(_0x547040[_0xa6e2('0x24')][_0xa6e2('0x25')]);}else{logger[_0xa6e2('0x26')](_0xa6e2('0x1f'),_0x2150a5,_0xa6e2('0x20'));_0x4be9dc(_0x547040[_0xa6e2('0x27')][_0xa6e2('0x25')]);}})['catch'](function(_0x207ca8){logger[_0xa6e2('0x24')](_0xa6e2('0x1f'),_0x2150a5,_0x207ca8);_0x57ab33(_0x207ca8);});});}function respondWithStatusCode(_0x1e09b9,_0x1e4ad){_0x1e4ad=_0x1e4ad||0xcc;return function(_0x2290d7){if(_0x2290d7){return _0x1e09b9[_0xa6e2('0x28')](_0x1e4ad);}return _0x1e09b9[_0xa6e2('0x29')](_0x1e4ad)['end']();};}function respondWithResult(_0x240de5,_0x53b480){_0x53b480=_0x53b480||0xc8;return function(_0x27e13d){if(_0x27e13d){return _0x240de5[_0xa6e2('0x29')](_0x53b480)['json'](_0x27e13d);}};}function respondWithFilteredResult(_0x10e2c0,_0x163060){return function(_0x446b59){if(_0x446b59){var _0x3048f9=_0x446b59[_0xa6e2('0x2a')],_0x2e8bfe=_0x163060[_0xa6e2('0x2b')],_0x399221=_0x163060[_0xa6e2('0x2b')]+_0x163060['limit'],_0x5818c8;if(_0x399221>=_0x3048f9){_0x399221=_0x3048f9;_0x5818c8=0xc8;}else{_0x5818c8=0xce;}_0x10e2c0[_0xa6e2('0x29')](_0x5818c8);return _0x10e2c0['set'](_0xa6e2('0x2c'),_0x2e8bfe+'-'+_0x399221+'/'+_0x3048f9)['json'](_0x446b59);}return null;};}function patchUpdates(_0xd75c3f){return function(_0x2e0ad2){try{jsonpatch[_0xa6e2('0x2d')](_0x2e0ad2,_0xd75c3f,!![]);}catch(_0x4cf970){return BPromise[_0xa6e2('0x2e')](_0x4cf970);}return _0x2e0ad2[_0xa6e2('0x2f')]();};}function saveUpdates(_0x436801,_0xf9e8c8){return function(_0x365a47){if(_0x365a47){return _0x365a47[_0xa6e2('0x30')](_0x436801)['then'](function(_0x3b694f){return _0x3b694f;});}return null;};}function removeEntity(_0x28d5e8,_0x4849cf){return function(_0x2e86a9){if(_0x2e86a9){return _0x2e86a9['destroy']()[_0xa6e2('0x1e')](function(){_0x28d5e8['status'](0xcc)[_0xa6e2('0x31')]();});}};}function handleEntityNotFound(_0x30d3a7,_0x516089){return function(_0x4df956){if(!_0x4df956){_0x30d3a7[_0xa6e2('0x28')](0x194);}return _0x4df956;};}function handleError(_0x53640b,_0x2e52b2){_0x2e52b2=_0x2e52b2||0x1f4;return function(_0x1900ce){logger[_0xa6e2('0x24')](_0x1900ce[_0xa6e2('0x32')]);if(_0x1900ce[_0xa6e2('0x33')]){delete _0x1900ce['name'];}_0x53640b[_0xa6e2('0x29')](_0x2e52b2)[_0xa6e2('0x34')](_0x1900ce);};}exports['index']=function(_0x18d0b0,_0x26073b){var _0x2c0373={},_0x1b1635={},_0x284a1f={'count':0x0,'rows':[]};var _0x3a68b5=_[_0xa6e2('0x35')](db[_0xa6e2('0x36')][_0xa6e2('0x37')],function(_0x7e9e1f){return{'name':_0x7e9e1f[_0xa6e2('0x38')],'type':_0x7e9e1f[_0xa6e2('0x39')][_0xa6e2('0x3a')]};});_0x1b1635[_0xa6e2('0x3b')]=_['map'](_0x3a68b5,_0xa6e2('0x33'));_0x1b1635[_0xa6e2('0x3c')]=_[_0xa6e2('0x3d')](_0x18d0b0[_0xa6e2('0x3c')]);_0x1b1635[_0xa6e2('0x3e')]=_[_0xa6e2('0x3f')](_0x1b1635['model'],_0x1b1635[_0xa6e2('0x3c')]);_0x2c0373[_0xa6e2('0x40')]=_['intersection'](_0x1b1635[_0xa6e2('0x3b')],qs[_0xa6e2('0x41')](_0x18d0b0[_0xa6e2('0x3c')][_0xa6e2('0x41')]));_0x2c0373[_0xa6e2('0x40')]=_0x2c0373[_0xa6e2('0x40')][_0xa6e2('0x42')]?_0x2c0373[_0xa6e2('0x40')]:_0x1b1635[_0xa6e2('0x3b')];if(!_0x18d0b0[_0xa6e2('0x3c')][_0xa6e2('0x43')](_0xa6e2('0x44'))){_0x2c0373[_0xa6e2('0x45')]=qs['limit'](_0x18d0b0['query'][_0xa6e2('0x45')]);_0x2c0373[_0xa6e2('0x2b')]=qs['offset'](_0x18d0b0[_0xa6e2('0x3c')][_0xa6e2('0x2b')]);}_0x2c0373[_0xa6e2('0x46')]=qs['sort'](_0x18d0b0[_0xa6e2('0x3c')][_0xa6e2('0x47')]);_0x2c0373[_0xa6e2('0x48')]=qs[_0xa6e2('0x3e')](_[_0xa6e2('0x49')](_0x18d0b0[_0xa6e2('0x3c')],_0x1b1635[_0xa6e2('0x3e')]),_0x3a68b5);if(_0x18d0b0[_0xa6e2('0x3c')][_0xa6e2('0x4a')]){_0x2c0373[_0xa6e2('0x48')]=_[_0xa6e2('0x4b')](_0x2c0373[_0xa6e2('0x48')],{'$or':_[_0xa6e2('0x35')](_0x3a68b5,function(_0x5d24c6){if(_0x5d24c6['type']!==_0xa6e2('0x4c')){var _0x5b2fbb={};_0x5b2fbb[_0x5d24c6[_0xa6e2('0x33')]]={'$like':'%'+_0x18d0b0[_0xa6e2('0x3c')]['filter']+'%'};return _0x5b2fbb;}})});}_0x2c0373=_[_0xa6e2('0x4b')]({},_0x2c0373,_0x18d0b0['options']);var _0x4a7023={'where':_0x2c0373[_0xa6e2('0x48')]};return db['VtigerAccount'][_0xa6e2('0x2a')](_0x4a7023)[_0xa6e2('0x1e')](function(_0x1c3108){_0x284a1f['count']=_0x1c3108;if(_0x18d0b0[_0xa6e2('0x3c')]['includeAll']){_0x2c0373['include']=[{'all':!![]}];}return db[_0xa6e2('0x36')][_0xa6e2('0x4d')](_0x2c0373);})[_0xa6e2('0x1e')](function(_0x4a993f){_0x284a1f[_0xa6e2('0x4e')]=_0x4a993f;return _0x284a1f;})['then'](respondWithFilteredResult(_0x26073b,_0x2c0373))['catch'](handleError(_0x26073b,null));};exports[_0xa6e2('0x4f')]=function(_0x2d9bc1,_0x173048){var _0x425c7c={'raw':![],'where':{'id':_0x2d9bc1[_0xa6e2('0x50')]['id']}},_0x15571a={};_0x15571a['model']=_[_0xa6e2('0x3d')](db[_0xa6e2('0x36')][_0xa6e2('0x37')]);_0x15571a[_0xa6e2('0x3c')]=_['keys'](_0x2d9bc1['query']);_0x15571a[_0xa6e2('0x3e')]=_[_0xa6e2('0x3f')](_0x15571a[_0xa6e2('0x3b')],_0x15571a[_0xa6e2('0x3c')]);_0x425c7c[_0xa6e2('0x40')]=_['intersection'](_0x15571a['model'],qs[_0xa6e2('0x41')](_0x2d9bc1[_0xa6e2('0x3c')][_0xa6e2('0x41')]));_0x425c7c['attributes']=_0x425c7c[_0xa6e2('0x40')][_0xa6e2('0x42')]?_0x425c7c[_0xa6e2('0x40')]:_0x15571a[_0xa6e2('0x3b')];if(_0x2d9bc1[_0xa6e2('0x3c')][_0xa6e2('0x51')]){_0x425c7c['include']=[{'all':!![]}];}_0x425c7c=_[_0xa6e2('0x4b')]({},_0x425c7c,_0x2d9bc1['options']);return db[_0xa6e2('0x36')][_0xa6e2('0x52')](_0x425c7c)[_0xa6e2('0x1e')](handleEntityNotFound(_0x173048,null))[_0xa6e2('0x1e')](respondWithResult(_0x173048,null))[_0xa6e2('0x53')](handleError(_0x173048,null));};exports['create']=function(_0x3674ba,_0x431a23){return db[_0xa6e2('0x36')]['create'](_0x3674ba[_0xa6e2('0x54')],{})[_0xa6e2('0x1e')](respondWithResult(_0x431a23,0xc9))['catch'](handleError(_0x431a23,null));};exports[_0xa6e2('0x30')]=function(_0x54099f,_0x5b3501){if(_0x54099f['body']['id']){delete _0x54099f[_0xa6e2('0x54')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x54099f['params']['id']}})['then'](handleEntityNotFound(_0x5b3501,null))[_0xa6e2('0x1e')](saveUpdates(_0x54099f[_0xa6e2('0x54')],null))['then'](respondWithResult(_0x5b3501,null))[_0xa6e2('0x53')](handleError(_0x5b3501,null));};exports[_0xa6e2('0x55')]=function(_0xec14c,_0x90ab91){return db[_0xa6e2('0x36')]['find']({'where':{'id':_0xec14c['params']['id']}})['then'](handleEntityNotFound(_0x90ab91,null))[_0xa6e2('0x1e')](removeEntity(_0x90ab91,null))[_0xa6e2('0x53')](handleError(_0x90ab91,null));};exports[_0xa6e2('0x56')]=function(_0x927a1b,_0x134912,_0x2c445c){var _0x463cd5={};var _0x2bc92e={};var _0x459fa5;var _0x3b23ff;return db[_0xa6e2('0x36')][_0xa6e2('0x57')]({'where':{'id':_0x927a1b[_0xa6e2('0x50')]['id']}})[_0xa6e2('0x1e')](handleEntityNotFound(_0x134912,null))[_0xa6e2('0x1e')](function(_0xfdf616){if(_0xfdf616){_0x459fa5=_0xfdf616;_0x2bc92e[_0xa6e2('0x3b')]=_[_0xa6e2('0x3d')](db[_0xa6e2('0x58')][_0xa6e2('0x37')]);_0x2bc92e['query']=_['keys'](_0x927a1b[_0xa6e2('0x3c')]);_0x2bc92e[_0xa6e2('0x3e')]=_[_0xa6e2('0x3f')](_0x2bc92e[_0xa6e2('0x3b')],_0x2bc92e[_0xa6e2('0x3c')]);_0x463cd5[_0xa6e2('0x40')]=_[_0xa6e2('0x3f')](_0x2bc92e['model'],qs[_0xa6e2('0x41')](_0x927a1b['query'][_0xa6e2('0x41')]));_0x463cd5[_0xa6e2('0x40')]=_0x463cd5[_0xa6e2('0x40')][_0xa6e2('0x42')]?_0x463cd5[_0xa6e2('0x40')]:_0x2bc92e[_0xa6e2('0x3b')];_0x463cd5[_0xa6e2('0x46')]=qs['sort'](_0x927a1b[_0xa6e2('0x3c')]['sort']);_0x463cd5['where']=qs[_0xa6e2('0x3e')](_['pick'](_0x927a1b[_0xa6e2('0x3c')],_0x2bc92e[_0xa6e2('0x3e')]));if(_0x927a1b[_0xa6e2('0x3c')][_0xa6e2('0x4a')]){_0x463cd5[_0xa6e2('0x48')]=_[_0xa6e2('0x4b')](_0x463cd5[_0xa6e2('0x48')],{'$or':_[_0xa6e2('0x35')](_0x463cd5[_0xa6e2('0x40')],function(_0x484d9c){var _0x58429b={};_0x58429b[_0x484d9c]={'$like':'%'+_0x927a1b[_0xa6e2('0x3c')][_0xa6e2('0x4a')]+'%'};return _0x58429b;})});}_0x463cd5=_[_0xa6e2('0x4b')]({},_0x463cd5,_0x927a1b[_0xa6e2('0x59')]);return _0x459fa5[_0xa6e2('0x56')](_0x463cd5);}})[_0xa6e2('0x1e')](function(_0x5f4889){if(_0x5f4889){_0x3b23ff=_0x5f4889[_0xa6e2('0x42')];if(!_0x927a1b[_0xa6e2('0x3c')][_0xa6e2('0x43')](_0xa6e2('0x44'))){_0x463cd5[_0xa6e2('0x45')]=qs['limit'](_0x927a1b[_0xa6e2('0x3c')][_0xa6e2('0x45')]);_0x463cd5['offset']=qs[_0xa6e2('0x2b')](_0x927a1b[_0xa6e2('0x3c')][_0xa6e2('0x2b')]);}return _0x459fa5[_0xa6e2('0x56')](_0x463cd5);}})['then'](function(_0x3e0821){if(_0x3e0821){return _0x3e0821?{'count':_0x3b23ff,'rows':_0x3e0821}:null;}})['then'](respondWithResult(_0x134912,null))[_0xa6e2('0x53')](handleError(_0x134912,null));};exports[_0xa6e2('0x5a')]=function(_0x1f9541,_0x217717,_0x979a33){if(_0x1f9541[_0xa6e2('0x54')]['id']){delete _0x1f9541[_0xa6e2('0x54')]['id'];}return db[_0xa6e2('0x36')][_0xa6e2('0x57')]({'where':{'id':_0x1f9541[_0xa6e2('0x50')]['id']}})[_0xa6e2('0x1e')](handleEntityNotFound(_0x217717,null))[_0xa6e2('0x1e')](function(_0x27a62b){if(_0x27a62b){_0x1f9541[_0xa6e2('0x54')]['AccountId']=_0x27a62b['id'];_0x1f9541[_0xa6e2('0x54')][_0xa6e2('0x5b')]=integrations[_0xa6e2('0x5c')](_0x1f9541[_0xa6e2('0x54')][_0xa6e2('0x5d')],_0x1f9541[_0xa6e2('0x54')][_0xa6e2('0x39')]);_0x1f9541[_0xa6e2('0x54')][_0xa6e2('0x5e')]=integrations[_0xa6e2('0x5f')](_0x1f9541[_0xa6e2('0x54')][_0xa6e2('0x5d')],_0x1f9541[_0xa6e2('0x54')][_0xa6e2('0x39')]);return db['VtigerConfiguration']['create'](_0x1f9541[_0xa6e2('0x54')],{'include':[{'model':db[_0xa6e2('0x60')],'as':_0xa6e2('0x5b')},{'model':db[_0xa6e2('0x60')],'as':'Descriptions'}]});}return null;})[_0xa6e2('0x1e')](respondWithResult(_0x217717,null))[_0xa6e2('0x53')](handleError(_0x217717,null));};var md5=require('md5');exports[_0xa6e2('0x61')]=function(_0x2db0b1,_0x29de12,_0x3ffb41){var _0x30427f=null;var _0x406d81=null;var _0x164da0=null;var _0x576c68=null;var _0x162176='';return db[_0xa6e2('0x36')]['findOne']({'where':{'id':_0x2db0b1[_0xa6e2('0x50')]['id']},'attributes':['id',_0xa6e2('0x33'),_0xa6e2('0x62'),'description','moduleName',_0xa6e2('0x63'),_0xa6e2('0x64'),_0xa6e2('0x65')]})[_0xa6e2('0x1e')](handleEntityNotFound(_0x29de12,null))['then'](function(_0x17423d){if(_0x17423d){_0x30427f=_0x17423d[_0xa6e2('0x62')];_0x406d81=_0x17423d['accessKey'];_0x164da0=_0x17423d['moduleName'];_0x162176=_0x17423d[_0xa6e2('0x63')];var _0x232543=_0x162176[_0xa6e2('0x66')](-0x1);if(_0x232543==='/'){_0x162176=_0x162176[_0xa6e2('0x67')](0x0,_0x162176[_0xa6e2('0x68')](_0x232543));}_0x576c68=util[_0xa6e2('0x69')]('%s/webservice.php',_0x162176);var _0x49a8b1={'method':_0xa6e2('0x6a'),'uri':_0x576c68,'qs':{'operation':_0xa6e2('0x6b'),'username':_0x17423d[_0xa6e2('0x62')]},'json':!![]};return rp(_0x49a8b1);}})[_0xa6e2('0x1e')](function(_0x46d069){if(_0x46d069['success']){var _0x4978a8={'method':_0xa6e2('0x6c'),'uri':_0x576c68,'form':{'operation':'login','username':_0x30427f,'accessKey':md5(_0x46d069[_0xa6e2('0x27')][_0xa6e2('0x6d')]+_0x406d81)},'json':!![]};return rp(_0x4978a8);}})['then'](function(_0x1777ee){if(_0x1777ee['success']){var _0x350d3a={'method':_0xa6e2('0x6a'),'uri':_0x576c68,'qs':{'operation':'describe','username':_0x30427f,'sessionName':_0x1777ee[_0xa6e2('0x27')]['sessionName'],'elementType':_0x164da0},'json':!![]};return rp(_0x350d3a);}})[_0xa6e2('0x1e')](function(_0x2c35f5){if(_0x2c35f5[_0xa6e2('0x6e')]){var _0x1b8f46=[_0xa6e2('0x6f'),'reference',_0xa6e2('0x70')];_[_0xa6e2('0x71')](_0x2c35f5['result'][_0xa6e2('0x41')],function(_0x5173b9){return _0x1b8f46[_0xa6e2('0x72')](_0x5173b9[_0xa6e2('0x39')][_0xa6e2('0x33')]);});_[_0xa6e2('0x71')](_0x2c35f5['result'][_0xa6e2('0x41')],function(_0x508cfc){return _0x508cfc[_0xa6e2('0x73')]===_0xa6e2('0x74');});return{'count':_0x2c35f5[_0xa6e2('0x27')][_0xa6e2('0x41')][_0xa6e2('0x42')],'rows':_['map'](_0x2c35f5[_0xa6e2('0x27')][_0xa6e2('0x41')],function(_0x1a3313){return{'id':_0x1a3313[_0xa6e2('0x33')],'name':_0x1a3313['label'],'custom':_['startsWith'](_0x1a3313[_0xa6e2('0x33')],_0xa6e2('0x75'))?!![]:![],'options':_0x1a3313['type']['name']===_0xa6e2('0x76')&&_0x1a3313[_0xa6e2('0x39')]['picklistValues'][_0xa6e2('0x42')]>0x0?_[_0xa6e2('0x35')](_0x1a3313[_0xa6e2('0x39')][_0xa6e2('0x77')],function(_0x128474){return{'name':_0x128474[_0xa6e2('0x78')],'value':_0x128474[_0xa6e2('0x79')]};}):[]};})};}})[_0xa6e2('0x1e')](respondWithResult(_0x29de12,null))[_0xa6e2('0x53')](function(_0x2eb2d1){console[_0xa6e2('0x7a')](_0xa6e2('0x7b')+_0x2eb2d1);var _0x431f71=_0x2db0b1[_0xa6e2('0x3c')][_0xa6e2('0x7c')]?0x1f4:_0x2eb2d1[_0xa6e2('0x7d')]||0x1f4;logger[_0xa6e2('0x24')](_0xa6e2('0x7e'),_0xa6e2('0x61'),_0x431f71,JSON['stringify'](_0x2eb2d1));delete _0x2eb2d1[_0xa6e2('0x33')];if(_0x431f71===0x191){_0x431f71=0x190;}_0x29de12[_0xa6e2('0x29')](_0x431f71)[_0xa6e2('0x34')](_0x2db0b1[_0xa6e2('0x3c')][_0xa6e2('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x2eb2d1['statusCode']}:_0x2eb2d1);});};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js
index 47d8e53..8975270 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.model.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb508=['rimraf','../../config/environment','./intVtigerAccount.attributes','VtigerAccount','lodash','util','../../config/logger','api','request-promise'];(function(_0x543ed1,_0x4bf288){var _0x4fb489=function(_0x455ccc){while(--_0x455ccc){_0x543ed1['push'](_0x543ed1['shift']());}};_0x4fb489(++_0x4bf288);}(_0xb508,0xaf));var _0x8b50=function(_0x4b30d2,_0x3815d0){_0x4b30d2=_0x4b30d2-0x0;var _0x1a27dc=_0xb508[_0x4b30d2];return _0x1a27dc;};'use strict';var _=require(_0x8b50('0x0'));var util=require(_0x8b50('0x1'));var logger=require(_0x8b50('0x2'))(_0x8b50('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8b50('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b50('0x5'));var config=require(_0x8b50('0x6'));var attributes=require(_0x8b50('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x56387e,_0x485dae){return _0x56387e['define'](_0x8b50('0x8'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x80a5=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports','int_vtiger_accounts','lodash','util','api','request-promise'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x80a5,0x164));var _0x580a=function(_0x1978af,_0x2a2504){_0x1978af=_0x1978af-0x0;var _0x3f0410=_0x80a5[_0x1978af];return _0x3f0410;};'use strict';var _=require(_0x580a('0x0'));var util=require(_0x580a('0x1'));var logger=require('../../config/logger')(_0x580a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x580a('0x3'));var fs=require('fs');var path=require(_0x580a('0x4'));var rimraf=require(_0x580a('0x5'));var config=require(_0x580a('0x6'));var attributes=require(_0x580a('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x580a('0x8')]=function(_0x4f560b,_0x12243b){return _0x4f560b['define']('VtigerAccount',attributes,{'tableName':_0x580a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js
index f6efe61..bc142cf 100644
--- a/server/api/intVtigerAccount/intVtigerAccount.rpc.js
+++ b/server/api/intVtigerAccount/intVtigerAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x74a1=['options','raw','attributes','limit','map','model','include','stringify','ShowVtigerAccount','VtigerAccount','find','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVtigerAccount','findAll'];(function(_0xc96929,_0x6b9a4c){var _0x305d00=function(_0x38c36b){while(--_0x38c36b){_0xc96929['push'](_0xc96929['shift']());}};_0x305d00(++_0x6b9a4c);}(_0x74a1,0x17e));var _0x174a=function(_0x1f1283,_0x1bea3b){_0x1f1283=_0x1f1283-0x0;var _0x205041=_0x74a1[_0x1f1283];return _0x205041;};'use strict';var _=require(_0x174a('0x0'));var util=require(_0x174a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x174a('0x2'));var fs=require('fs');var Redis=require(_0x174a('0x3'));var db=require(_0x174a('0x4'))['db'];var utils=require(_0x174a('0x5'));var logger=require(_0x174a('0x6'))(_0x174a('0x7'));var config=require(_0x174a('0x8'));var jayson=require(_0x174a('0x9'));var client=jayson['client'][_0x174a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x438c0f,_0x434906,_0x7f55c2){return new BPromise(function(_0x35b62d,_0x205399){return client[_0x174a('0xb')](_0x438c0f,_0x7f55c2)[_0x174a('0xc')](function(_0x9e5008){logger['info'](_0x174a('0xd'),_0x434906,'request\x20sent');logger[_0x174a('0xe')](_0x174a('0xf'),_0x434906,_0x174a('0x10'),JSON['stringify'](_0x9e5008));if(_0x9e5008['error']){if(_0x9e5008[_0x174a('0x11')][_0x174a('0x12')]===0x1f4){logger[_0x174a('0x11')](_0x174a('0xd'),_0x434906,_0x9e5008['error'][_0x174a('0x13')]);return _0x205399(_0x9e5008[_0x174a('0x11')][_0x174a('0x13')]);}logger['error'](_0x174a('0xd'),_0x434906,_0x9e5008['error'][_0x174a('0x13')]);return _0x35b62d(_0x9e5008[_0x174a('0x11')]['message']);}else{logger[_0x174a('0x14')](_0x174a('0xd'),_0x434906,'request\x20sent');_0x35b62d(_0x9e5008[_0x174a('0x15')][_0x174a('0x13')]);}})[_0x174a('0x16')](function(_0x1e54a4){logger[_0x174a('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x434906,_0x1e54a4);_0x205399(_0x1e54a4);});});}exports[_0x174a('0x17')]=function(_0x587a1c){var _0x26a8df=this;return new Promise(function(_0x6581b4,_0x46fcdc){return db['VtigerAccount'][_0x174a('0x18')]({'raw':_0x587a1c[_0x174a('0x19')]?_0x587a1c[_0x174a('0x19')][_0x174a('0x1a')]===undefined?!![]:![]:!![],'where':_0x587a1c[_0x174a('0x19')]?_0x587a1c[_0x174a('0x19')]['where']||null:null,'attributes':_0x587a1c[_0x174a('0x19')]?_0x587a1c[_0x174a('0x19')][_0x174a('0x1b')]||null:null,'limit':_0x587a1c[_0x174a('0x19')]?_0x587a1c[_0x174a('0x19')][_0x174a('0x1c')]||null:null,'include':_0x587a1c[_0x174a('0x19')]?_0x587a1c[_0x174a('0x19')]['include']?_[_0x174a('0x1d')](_0x587a1c['options']['include'],function(_0x20c9f8){return{'model':db[_0x20c9f8[_0x174a('0x1e')]],'as':_0x20c9f8['as'],'attributes':_0x20c9f8[_0x174a('0x1b')],'include':_0x20c9f8['include']?_[_0x174a('0x1d')](_0x20c9f8[_0x174a('0x1f')],function(_0x2bbeed){return{'model':db[_0x2bbeed[_0x174a('0x1e')]],'as':_0x2bbeed['as'],'attributes':_0x2bbeed[_0x174a('0x1b')],'include':_0x2bbeed[_0x174a('0x1f')]?_[_0x174a('0x1d')](_0x2bbeed['include'],function(_0x2fae2f){return{'model':db[_0x2fae2f[_0x174a('0x1e')]],'as':_0x2fae2f['as'],'attributes':_0x2fae2f[_0x174a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x174a('0xc')](function(_0x5d6cdd){logger[_0x174a('0x14')](_0x174a('0x17'),_0x587a1c);logger[_0x174a('0xe')](_0x174a('0x17'),_0x587a1c,JSON[_0x174a('0x20')](_0x5d6cdd));_0x6581b4(_0x5d6cdd);})[_0x174a('0x16')](function(_0x1252a2){logger[_0x174a('0x11')](_0x174a('0x17'),_0x1252a2['message'],_0x587a1c);_0x46fcdc(_0x26a8df['error'](0x1f4,_0x1252a2[_0x174a('0x13')]));});});};exports[_0x174a('0x21')]=function(_0x3fb2c7){var _0x482ac1=this;return new Promise(function(_0x17afc3,_0x46cad3){return db[_0x174a('0x22')][_0x174a('0x23')]({'raw':_0x3fb2c7['options']?_0x3fb2c7[_0x174a('0x19')][_0x174a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3fb2c7[_0x174a('0x19')]?_0x3fb2c7[_0x174a('0x19')][_0x174a('0x24')]||null:null,'attributes':_0x3fb2c7[_0x174a('0x19')]?_0x3fb2c7['options'][_0x174a('0x1b')]||null:null,'include':_0x3fb2c7[_0x174a('0x19')]?_0x3fb2c7[_0x174a('0x19')][_0x174a('0x1f')]?_[_0x174a('0x1d')](_0x3fb2c7['options'][_0x174a('0x1f')],function(_0x532473){return{'model':db[_0x532473[_0x174a('0x1e')]],'as':_0x532473['as'],'attributes':_0x532473['attributes'],'include':_0x532473[_0x174a('0x1f')]?_[_0x174a('0x1d')](_0x532473[_0x174a('0x1f')],function(_0x5ee9f4){return{'model':db[_0x5ee9f4[_0x174a('0x1e')]],'as':_0x5ee9f4['as'],'attributes':_0x5ee9f4['attributes'],'include':_0x5ee9f4['include']?_[_0x174a('0x1d')](_0x5ee9f4['include'],function(_0x5ce11c){return{'model':db[_0x5ce11c[_0x174a('0x1e')]],'as':_0x5ce11c['as'],'attributes':_0x5ce11c[_0x174a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x174a('0xc')](function(_0xd64b1b){logger[_0x174a('0x14')](_0x174a('0x21'),_0x3fb2c7);logger['debug'](_0x174a('0x21'),_0x3fb2c7,JSON[_0x174a('0x20')](_0xd64b1b));_0x17afc3(_0xd64b1b);})[_0x174a('0x16')](function(_0x55ed1a){logger[_0x174a('0x11')]('ShowVtigerAccount',_0x55ed1a[_0x174a('0x13')],_0x3fb2c7);_0x46cad3(_0x482ac1[_0x174a('0x11')](0x1f4,_0x55ed1a[_0x174a('0x13')]));});});};
\ No newline at end of file
+var _0xa994=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','attributes','limit','include','model','map','info','debug','stringify','ShowVtigerAccount','find','lodash'];(function(_0x56b05e,_0x472e27){var _0x3adafd=function(_0x171ab8){while(--_0x171ab8){_0x56b05e['push'](_0x56b05e['shift']());}};_0x3adafd(++_0x472e27);}(_0xa994,0xb8));var _0x4a99=function(_0x32c2c8,_0x3cb23d){_0x32c2c8=_0x32c2c8-0x0;var _0x311bd7=_0xa994[_0x32c2c8];return _0x311bd7;};'use strict';var _=require(_0x4a99('0x0'));var util=require(_0x4a99('0x1'));var moment=require(_0x4a99('0x2'));var BPromise=require(_0x4a99('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a99('0x4'));var db=require(_0x4a99('0x5'))['db'];var utils=require(_0x4a99('0x6'));var logger=require(_0x4a99('0x7'))(_0x4a99('0x8'));var config=require(_0x4a99('0x9'));var jayson=require(_0x4a99('0xa'));var client=jayson[_0x4a99('0xb')][_0x4a99('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45c683,_0x4219e7,_0x489bb6){return new BPromise(function(_0x54f663,_0x111fe8){return client[_0x4a99('0xd')](_0x45c683,_0x489bb6)[_0x4a99('0xe')](function(_0x3131c7){logger['info'](_0x4a99('0xf'),_0x4219e7,'request\x20sent');logger['debug'](_0x4a99('0x10'),_0x4219e7,'request\x20sent',JSON['stringify'](_0x3131c7));if(_0x3131c7[_0x4a99('0x11')]){if(_0x3131c7[_0x4a99('0x11')][_0x4a99('0x12')]===0x1f4){logger['error'](_0x4a99('0xf'),_0x4219e7,_0x3131c7[_0x4a99('0x11')][_0x4a99('0x13')]);return _0x111fe8(_0x3131c7['error'][_0x4a99('0x13')]);}logger[_0x4a99('0x11')](_0x4a99('0xf'),_0x4219e7,_0x3131c7['error'][_0x4a99('0x13')]);return _0x54f663(_0x3131c7[_0x4a99('0x11')][_0x4a99('0x13')]);}else{logger['info'](_0x4a99('0xf'),_0x4219e7,'request\x20sent');_0x54f663(_0x3131c7[_0x4a99('0x14')]['message']);}})[_0x4a99('0x15')](function(_0x568a89){logger[_0x4a99('0x11')](_0x4a99('0xf'),_0x4219e7,_0x568a89);_0x111fe8(_0x568a89);});});}exports[_0x4a99('0x16')]=function(_0x3ef472){var _0x397a80=this;return new Promise(function(_0x29b482,_0x29bb20){return db[_0x4a99('0x17')]['findAll']({'raw':_0x3ef472[_0x4a99('0x18')]?_0x3ef472[_0x4a99('0x18')][_0x4a99('0x19')]===undefined?!![]:![]:!![],'where':_0x3ef472[_0x4a99('0x18')]?_0x3ef472[_0x4a99('0x18')][_0x4a99('0x1a')]||null:null,'attributes':_0x3ef472[_0x4a99('0x18')]?_0x3ef472['options'][_0x4a99('0x1b')]||null:null,'limit':_0x3ef472[_0x4a99('0x18')]?_0x3ef472[_0x4a99('0x18')][_0x4a99('0x1c')]||null:null,'include':_0x3ef472[_0x4a99('0x18')]?_0x3ef472['options'][_0x4a99('0x1d')]?_['map'](_0x3ef472['options'][_0x4a99('0x1d')],function(_0x597125){return{'model':db[_0x597125[_0x4a99('0x1e')]],'as':_0x597125['as'],'attributes':_0x597125[_0x4a99('0x1b')],'include':_0x597125[_0x4a99('0x1d')]?_[_0x4a99('0x1f')](_0x597125[_0x4a99('0x1d')],function(_0x5e0abe){return{'model':db[_0x5e0abe[_0x4a99('0x1e')]],'as':_0x5e0abe['as'],'attributes':_0x5e0abe[_0x4a99('0x1b')],'include':_0x5e0abe['include']?_['map'](_0x5e0abe[_0x4a99('0x1d')],function(_0x172649){return{'model':db[_0x172649[_0x4a99('0x1e')]],'as':_0x172649['as'],'attributes':_0x172649[_0x4a99('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4a99('0xe')](function(_0x5dfb0b){logger[_0x4a99('0x20')](_0x4a99('0x16'),_0x3ef472);logger[_0x4a99('0x21')](_0x4a99('0x16'),_0x3ef472,JSON[_0x4a99('0x22')](_0x5dfb0b));_0x29b482(_0x5dfb0b);})[_0x4a99('0x15')](function(_0x6313dc){logger[_0x4a99('0x11')](_0x4a99('0x16'),_0x6313dc[_0x4a99('0x13')],_0x3ef472);_0x29bb20(_0x397a80[_0x4a99('0x11')](0x1f4,_0x6313dc[_0x4a99('0x13')]));});});};exports[_0x4a99('0x23')]=function(_0x193a2a){var _0x128ab8=this;return new Promise(function(_0x312ea2,_0x59e6bd){return db[_0x4a99('0x17')][_0x4a99('0x24')]({'raw':_0x193a2a[_0x4a99('0x18')]?_0x193a2a['options']['raw']===undefined?!![]:![]:!![],'where':_0x193a2a[_0x4a99('0x18')]?_0x193a2a[_0x4a99('0x18')]['where']||null:null,'attributes':_0x193a2a[_0x4a99('0x18')]?_0x193a2a[_0x4a99('0x18')][_0x4a99('0x1b')]||null:null,'include':_0x193a2a['options']?_0x193a2a['options'][_0x4a99('0x1d')]?_[_0x4a99('0x1f')](_0x193a2a[_0x4a99('0x18')][_0x4a99('0x1d')],function(_0x1ad0f5){return{'model':db[_0x1ad0f5['model']],'as':_0x1ad0f5['as'],'attributes':_0x1ad0f5[_0x4a99('0x1b')],'include':_0x1ad0f5[_0x4a99('0x1d')]?_[_0x4a99('0x1f')](_0x1ad0f5[_0x4a99('0x1d')],function(_0x1c0a35){return{'model':db[_0x1c0a35[_0x4a99('0x1e')]],'as':_0x1c0a35['as'],'attributes':_0x1c0a35[_0x4a99('0x1b')],'include':_0x1c0a35[_0x4a99('0x1d')]?_[_0x4a99('0x1f')](_0x1c0a35[_0x4a99('0x1d')],function(_0x3955b3){return{'model':db[_0x3955b3[_0x4a99('0x1e')]],'as':_0x3955b3['as'],'attributes':_0x3955b3[_0x4a99('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4a99('0xe')](function(_0x43c100){logger[_0x4a99('0x20')](_0x4a99('0x23'),_0x193a2a);logger[_0x4a99('0x21')](_0x4a99('0x23'),_0x193a2a,JSON['stringify'](_0x43c100));_0x312ea2(_0x43c100);})[_0x4a99('0x15')](function(_0x49d1d6){logger['error'](_0x4a99('0x23'),_0x49d1d6[_0x4a99('0x13')],_0x193a2a);_0x59e6bd(_0x128ab8[_0x4a99('0x11')](0x1f4,_0x49d1d6[_0x4a99('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js
index 286890f..02f5764 100644
--- a/server/api/intVtigerConfiguration/index.js
+++ b/server/api/intVtigerConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router;
\ No newline at end of file
+var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x319a8f,_0x592590){var _0x252993=function(_0x27a240){while(--_0x27a240){_0x319a8f['push'](_0x319a8f['shift']());}};_0x252993(++_0x592590);}(_0xb10b,0x12a));var _0xbb10=function(_0x27442d,_0x3a3df2){_0x27442d=_0x27442d-0x0;var _0x43e32f=_0xb10b[_0x27442d];return _0x43e32f;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
index 8b8a3b6..feb601d 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf51e=['sequelize','exports','STRING'];(function(_0x361a28,_0x4da70e){var _0x2f8f23=function(_0x1fac35){while(--_0x1fac35){_0x361a28['push'](_0x361a28['shift']());}};_0x2f8f23(++_0x4da70e);}(_0xf51e,0x99));var _0xef51=function(_0x1e3045,_0x5a0c98){_0x1e3045=_0x1e3045-0x0;var _0x48ba27=_0xf51e[_0x1e3045];return _0x48ba27;};'use strict';var Sequelize=require(_0xef51('0x0'));module[_0xef51('0x1')]={'name':{'type':Sequelize[_0xef51('0x2')]},'description':{'type':Sequelize[_0xef51('0x2')]}};
\ No newline at end of file
+var _0x893a=['exports','STRING','sequelize'];(function(_0x2278fc,_0x2e7af1){var _0xda596a=function(_0x244e5a){while(--_0x244e5a){_0x2278fc['push'](_0x2278fc['shift']());}};_0xda596a(++_0x2e7af1);}(_0x893a,0xa7));var _0xa893=function(_0x1b10e5,_0x1413e6){_0x1b10e5=_0x1b10e5-0x0;var _0x4d2caf=_0x893a[_0x1b10e5];return _0x4d2caf;};'use strict';var Sequelize=require(_0xa893('0x0'));module[_0xa893('0x1')]={'name':{'type':Sequelize[_0xa893('0x2')]},'description':{'type':Sequelize[_0xa893('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
index a215a7c..638b392 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaed1=['key','model','map','query','filters','intersection','attributes','fields','length','nolimit','offset','order','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','findOne','keys','VtigerField','sort','pick','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaed1,0x1b1));var _0x1aed=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0xaed1[_0x53e3de];return _0x7b905b;};'use strict';var pdf=require(_0x1aed('0x0'));var emlformat=require(_0x1aed('0x1'));var rimraf=require(_0x1aed('0x2'));var zipdir=require(_0x1aed('0x3'));var jsonpatch=require(_0x1aed('0x4'));var rp=require(_0x1aed('0x5'));var moment=require(_0x1aed('0x6'));var BPromise=require(_0x1aed('0x7'));var Mustache=require(_0x1aed('0x8'));var util=require(_0x1aed('0x9'));var path=require(_0x1aed('0xa'));var sox=require(_0x1aed('0xb'));var csv=require(_0x1aed('0xc'));var ejs=require(_0x1aed('0xd'));var fs=require('fs');var _=require(_0x1aed('0xe'));var squel=require(_0x1aed('0xf'));var crypto=require('crypto');var jsforce=require(_0x1aed('0x10'));var deskjs=require(_0x1aed('0x11'));var toCsv=require(_0x1aed('0xc'));var querystring=require('querystring');var Papa=require(_0x1aed('0x12'));var Redis=require(_0x1aed('0x13'));var authService=require(_0x1aed('0x14'));var qs=require(_0x1aed('0x15'));var as=require(_0x1aed('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1aed('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x1aed('0x18'));var db=require(_0x1aed('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1aed('0x1a')][_0x1aed('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4db5d4,_0x5d4309,_0x1dd8f7){if(_0x1dd8f7){var _0x4bb255=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bb255['test'](_0x5d4309)){return _0x4db5d4;}else{throw new db[(_0x1aed('0x1c'))][(_0x1aed('0x1d'))](_0x1aed('0x1e'));}}else{return _0x4db5d4;}}function respondWithRpcPromise(_0x4056fb,_0x8d87be,_0x1c8bcf,_0x5e466e){return new BPromise(function(_0x9ed034,_0x3b7636){var _0x1f0b32=_0x5e466e||client;return _0x1f0b32[_0x1aed('0x1f')](_0x4056fb,_0x1c8bcf)[_0x1aed('0x20')](function(_0x23c4e4){logger[_0x1aed('0x21')](_0x1aed('0x22'),_0x8d87be,_0x1aed('0x23'));logger[_0x1aed('0x24')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x8d87be,_0x1aed('0x23'),JSON[_0x1aed('0x25')](_0x23c4e4));if(_0x23c4e4[_0x1aed('0x26')]){if(_0x23c4e4[_0x1aed('0x26')][_0x1aed('0x27')]===0x1f4){logger['error'](_0x1aed('0x22'),_0x8d87be,_0x23c4e4[_0x1aed('0x26')]['message']);return _0x3b7636(_0x23c4e4[_0x1aed('0x26')]['message']);}logger[_0x1aed('0x26')](_0x1aed('0x22'),_0x8d87be,_0x23c4e4[_0x1aed('0x26')]['message']);return _0x9ed034(_0x23c4e4[_0x1aed('0x26')][_0x1aed('0x28')]);}else{logger['info'](_0x1aed('0x22'),_0x8d87be,_0x1aed('0x23'));_0x9ed034(_0x23c4e4[_0x1aed('0x29')][_0x1aed('0x28')]);}})['catch'](function(_0x1a00ad){logger[_0x1aed('0x26')](_0x1aed('0x22'),_0x8d87be,_0x1a00ad);_0x3b7636(_0x1a00ad);});});}function respondWithStatusCode(_0x31c4e6,_0x396a5f){_0x396a5f=_0x396a5f||0xcc;return function(_0xc19d30){if(_0xc19d30){return _0x31c4e6[_0x1aed('0x2a')](_0x396a5f);}return _0x31c4e6[_0x1aed('0x2b')](_0x396a5f)[_0x1aed('0x2c')]();};}function respondWithResult(_0x5d3fca,_0x15d80d){_0x15d80d=_0x15d80d||0xc8;return function(_0x5b8afd){if(_0x5b8afd){return _0x5d3fca[_0x1aed('0x2b')](_0x15d80d)['json'](_0x5b8afd);}};}function respondWithFilteredResult(_0x27b8c1,_0x2bfa77){return function(_0x2363a8){if(_0x2363a8){var _0x130cd0=_0x2363a8[_0x1aed('0x2d')],_0x38cf7d=_0x2bfa77['offset'],_0x6f4dab=_0x2bfa77['offset']+_0x2bfa77[_0x1aed('0x2e')],_0x4aba03;if(_0x6f4dab>=_0x130cd0){_0x6f4dab=_0x130cd0;_0x4aba03=0xc8;}else{_0x4aba03=0xce;}_0x27b8c1['status'](_0x4aba03);return _0x27b8c1[_0x1aed('0x2f')](_0x1aed('0x30'),_0x38cf7d+'-'+_0x6f4dab+'/'+_0x130cd0)[_0x1aed('0x31')](_0x2363a8);}return null;};}function patchUpdates(_0x5d6e28){return function(_0x1bc795){try{jsonpatch[_0x1aed('0x32')](_0x1bc795,_0x5d6e28,!![]);}catch(_0x368bd4){return BPromise[_0x1aed('0x33')](_0x368bd4);}return _0x1bc795[_0x1aed('0x34')]();};}function saveUpdates(_0x30b657,_0x4d5423){return function(_0x44f44a){if(_0x44f44a){return _0x44f44a[_0x1aed('0x35')](_0x30b657)[_0x1aed('0x20')](function(_0x3ad6ad){return _0x3ad6ad;});}return null;};}function removeEntity(_0x1b9101,_0x287f21){return function(_0x316596){if(_0x316596){return _0x316596[_0x1aed('0x36')]()[_0x1aed('0x20')](function(){_0x1b9101[_0x1aed('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x62d394,_0xda8120){return function(_0x4369ce){if(!_0x4369ce){_0x62d394[_0x1aed('0x2a')](0x194);}return _0x4369ce;};}function handleError(_0x2b7edb,_0x24c7ae){_0x24c7ae=_0x24c7ae||0x1f4;return function(_0x182584){logger[_0x1aed('0x26')](_0x182584[_0x1aed('0x37')]);if(_0x182584[_0x1aed('0x38')]){delete _0x182584[_0x1aed('0x38')];}_0x2b7edb[_0x1aed('0x2b')](_0x24c7ae)[_0x1aed('0x39')](_0x182584);};}exports[_0x1aed('0x3a')]=function(_0x492dc6,_0x5378fd){var _0x36ce17={},_0x5d7c8d={},_0x446d6a={'count':0x0,'rows':[]};var _0xa0ac8=_['map'](db[_0x1aed('0x3b')][_0x1aed('0x3c')],function(_0x8fc169){return{'name':_0x8fc169[_0x1aed('0x3d')],'type':_0x8fc169['type'][_0x1aed('0x3e')]};});_0x5d7c8d[_0x1aed('0x3f')]=_[_0x1aed('0x40')](_0xa0ac8,_0x1aed('0x38'));_0x5d7c8d[_0x1aed('0x41')]=_['keys'](_0x492dc6[_0x1aed('0x41')]);_0x5d7c8d[_0x1aed('0x42')]=_[_0x1aed('0x43')](_0x5d7c8d[_0x1aed('0x3f')],_0x5d7c8d[_0x1aed('0x41')]);_0x36ce17[_0x1aed('0x44')]=_[_0x1aed('0x43')](_0x5d7c8d[_0x1aed('0x3f')],qs[_0x1aed('0x45')](_0x492dc6['query'][_0x1aed('0x45')]));_0x36ce17['attributes']=_0x36ce17['attributes'][_0x1aed('0x46')]?_0x36ce17[_0x1aed('0x44')]:_0x5d7c8d[_0x1aed('0x3f')];if(!_0x492dc6[_0x1aed('0x41')]['hasOwnProperty'](_0x1aed('0x47'))){_0x36ce17['limit']=qs[_0x1aed('0x2e')](_0x492dc6[_0x1aed('0x41')]['limit']);_0x36ce17[_0x1aed('0x48')]=qs[_0x1aed('0x48')](_0x492dc6['query'][_0x1aed('0x48')]);}_0x36ce17[_0x1aed('0x49')]=qs['sort'](_0x492dc6[_0x1aed('0x41')]['sort']);_0x36ce17[_0x1aed('0x4a')]=qs['filters'](_['pick'](_0x492dc6[_0x1aed('0x41')],_0x5d7c8d[_0x1aed('0x42')]),_0xa0ac8);if(_0x492dc6['query']['filter']){_0x36ce17['where']=_[_0x1aed('0x4b')](_0x36ce17[_0x1aed('0x4a')],{'$or':_['map'](_0xa0ac8,function(_0x59cab0){if(_0x59cab0[_0x1aed('0x4c')]!==_0x1aed('0x4d')){var _0x3bbcc8={};_0x3bbcc8[_0x59cab0[_0x1aed('0x38')]]={'$like':'%'+_0x492dc6[_0x1aed('0x41')][_0x1aed('0x4e')]+'%'};return _0x3bbcc8;}})});}_0x36ce17=_[_0x1aed('0x4b')]({},_0x36ce17,_0x492dc6[_0x1aed('0x4f')]);var _0x7e5dc9={'where':_0x36ce17[_0x1aed('0x4a')]};return db[_0x1aed('0x3b')][_0x1aed('0x2d')](_0x7e5dc9)[_0x1aed('0x20')](function(_0x165b9f){_0x446d6a[_0x1aed('0x2d')]=_0x165b9f;if(_0x492dc6[_0x1aed('0x41')][_0x1aed('0x50')]){_0x36ce17['include']=[{'all':!![]}];}return db[_0x1aed('0x3b')][_0x1aed('0x51')](_0x36ce17);})[_0x1aed('0x20')](function(_0x308106){_0x446d6a[_0x1aed('0x52')]=_0x308106;return _0x446d6a;})[_0x1aed('0x20')](respondWithFilteredResult(_0x5378fd,_0x36ce17))[_0x1aed('0x53')](handleError(_0x5378fd,null));};exports[_0x1aed('0x54')]=function(_0x16ec31,_0x24e20c){var _0x501bab={'raw':![],'where':{'id':_0x16ec31[_0x1aed('0x55')]['id']}},_0x21c446={};_0x21c446[_0x1aed('0x3f')]=_['keys'](db[_0x1aed('0x3b')][_0x1aed('0x3c')]);_0x21c446['query']=_['keys'](_0x16ec31[_0x1aed('0x41')]);_0x21c446[_0x1aed('0x42')]=_[_0x1aed('0x43')](_0x21c446[_0x1aed('0x3f')],_0x21c446[_0x1aed('0x41')]);_0x501bab[_0x1aed('0x44')]=_[_0x1aed('0x43')](_0x21c446[_0x1aed('0x3f')],qs[_0x1aed('0x45')](_0x16ec31[_0x1aed('0x41')][_0x1aed('0x45')]));_0x501bab['attributes']=_0x501bab[_0x1aed('0x44')][_0x1aed('0x46')]?_0x501bab[_0x1aed('0x44')]:_0x21c446['model'];if(_0x16ec31[_0x1aed('0x41')][_0x1aed('0x50')]){_0x501bab[_0x1aed('0x56')]=[{'all':!![]}];}_0x501bab=_[_0x1aed('0x4b')]({},_0x501bab,_0x16ec31[_0x1aed('0x4f')]);return db[_0x1aed('0x3b')][_0x1aed('0x57')](_0x501bab)['then'](handleEntityNotFound(_0x24e20c,null))['then'](respondWithResult(_0x24e20c,null))[_0x1aed('0x53')](handleError(_0x24e20c,null));};exports['create']=function(_0x185c17,_0x35f8d0){return db[_0x1aed('0x3b')][_0x1aed('0x58')](_0x185c17[_0x1aed('0x59')],{})[_0x1aed('0x20')](respondWithResult(_0x35f8d0,0xc9))[_0x1aed('0x53')](handleError(_0x35f8d0,null));};exports[_0x1aed('0x35')]=function(_0x4eb42,_0x4fe9d8){if(_0x4eb42[_0x1aed('0x59')]['id']){delete _0x4eb42['body']['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x4eb42[_0x1aed('0x55')]['id']}})[_0x1aed('0x20')](handleEntityNotFound(_0x4fe9d8,null))[_0x1aed('0x20')](saveUpdates(_0x4eb42[_0x1aed('0x59')],null))[_0x1aed('0x20')](respondWithResult(_0x4fe9d8,null))[_0x1aed('0x53')](handleError(_0x4fe9d8,null));};exports[_0x1aed('0x36')]=function(_0x2b94dc,_0x4173b6){return db[_0x1aed('0x3b')][_0x1aed('0x57')]({'where':{'id':_0x2b94dc[_0x1aed('0x55')]['id']}})[_0x1aed('0x20')](handleEntityNotFound(_0x4173b6,null))[_0x1aed('0x20')](removeEntity(_0x4173b6,null))[_0x1aed('0x53')](handleError(_0x4173b6,null));};exports[_0x1aed('0x5a')]=function(_0x529e83,_0x24506d,_0x295c15){var _0x27073={};var _0x2f6b46={};var _0x50dfcc;var _0x4b9e03;return db[_0x1aed('0x3b')][_0x1aed('0x5b')]({'where':{'id':_0x529e83['params']['id']}})[_0x1aed('0x20')](handleEntityNotFound(_0x24506d,null))[_0x1aed('0x20')](function(_0x5b3e5f){if(_0x5b3e5f){_0x50dfcc=_0x5b3e5f;_0x2f6b46[_0x1aed('0x3f')]=_[_0x1aed('0x5c')](db[_0x1aed('0x5d')][_0x1aed('0x3c')]);_0x2f6b46['query']=_[_0x1aed('0x5c')](_0x529e83['query']);_0x2f6b46[_0x1aed('0x42')]=_[_0x1aed('0x43')](_0x2f6b46[_0x1aed('0x3f')],_0x2f6b46[_0x1aed('0x41')]);_0x27073[_0x1aed('0x44')]=_[_0x1aed('0x43')](_0x2f6b46['model'],qs[_0x1aed('0x45')](_0x529e83[_0x1aed('0x41')]['fields']));_0x27073[_0x1aed('0x44')]=_0x27073[_0x1aed('0x44')][_0x1aed('0x46')]?_0x27073[_0x1aed('0x44')]:_0x2f6b46[_0x1aed('0x3f')];_0x27073[_0x1aed('0x49')]=qs[_0x1aed('0x5e')](_0x529e83[_0x1aed('0x41')][_0x1aed('0x5e')]);_0x27073[_0x1aed('0x4a')]=qs[_0x1aed('0x42')](_[_0x1aed('0x5f')](_0x529e83[_0x1aed('0x41')],_0x2f6b46['filters']));if(_0x529e83['query'][_0x1aed('0x4e')]){_0x27073[_0x1aed('0x4a')]=_[_0x1aed('0x4b')](_0x27073[_0x1aed('0x4a')],{'$or':_[_0x1aed('0x40')](_0x27073[_0x1aed('0x44')],function(_0x5d954b){var _0x2d2e3a={};_0x2d2e3a[_0x5d954b]={'$like':'%'+_0x529e83['query'][_0x1aed('0x4e')]+'%'};return _0x2d2e3a;})});}_0x27073=_[_0x1aed('0x4b')]({},_0x27073,_0x529e83[_0x1aed('0x4f')]);return _0x50dfcc[_0x1aed('0x5a')](_0x27073);}})[_0x1aed('0x20')](function(_0x3d97b8){if(_0x3d97b8){_0x4b9e03=_0x3d97b8['length'];if(!_0x529e83[_0x1aed('0x41')][_0x1aed('0x60')](_0x1aed('0x47'))){_0x27073[_0x1aed('0x2e')]=qs[_0x1aed('0x2e')](_0x529e83['query'][_0x1aed('0x2e')]);_0x27073[_0x1aed('0x48')]=qs[_0x1aed('0x48')](_0x529e83[_0x1aed('0x41')]['offset']);}return _0x50dfcc[_0x1aed('0x5a')](_0x27073);}})[_0x1aed('0x20')](function(_0x5b4e77){if(_0x5b4e77){return _0x5b4e77?{'count':_0x4b9e03,'rows':_0x5b4e77}:null;}})[_0x1aed('0x20')](respondWithResult(_0x24506d,null))[_0x1aed('0x53')](handleError(_0x24506d,null));};exports[_0x1aed('0x61')]=function(_0x307c74,_0x22546e,_0x2c1eac){var _0x21c206={};var _0x245e30={};var _0x23a1ca;var _0x4f7a80;return db[_0x1aed('0x3b')][_0x1aed('0x5b')]({'where':{'id':_0x307c74[_0x1aed('0x55')]['id']}})[_0x1aed('0x20')](handleEntityNotFound(_0x22546e,null))[_0x1aed('0x20')](function(_0x380279){if(_0x380279){_0x23a1ca=_0x380279;_0x245e30[_0x1aed('0x3f')]=_[_0x1aed('0x5c')](db[_0x1aed('0x5d')][_0x1aed('0x3c')]);_0x245e30[_0x1aed('0x41')]=_[_0x1aed('0x5c')](_0x307c74[_0x1aed('0x41')]);_0x245e30[_0x1aed('0x42')]=_[_0x1aed('0x43')](_0x245e30[_0x1aed('0x3f')],_0x245e30['query']);_0x21c206[_0x1aed('0x44')]=_['intersection'](_0x245e30['model'],qs[_0x1aed('0x45')](_0x307c74[_0x1aed('0x41')][_0x1aed('0x45')]));_0x21c206[_0x1aed('0x44')]=_0x21c206[_0x1aed('0x44')][_0x1aed('0x46')]?_0x21c206['attributes']:_0x245e30['model'];_0x21c206[_0x1aed('0x49')]=qs['sort'](_0x307c74[_0x1aed('0x41')][_0x1aed('0x5e')]);_0x21c206[_0x1aed('0x4a')]=qs['filters'](_[_0x1aed('0x5f')](_0x307c74[_0x1aed('0x41')],_0x245e30[_0x1aed('0x42')]));if(_0x307c74['query'][_0x1aed('0x4e')]){_0x21c206[_0x1aed('0x4a')]=_[_0x1aed('0x4b')](_0x21c206['where'],{'$or':_['map'](_0x21c206[_0x1aed('0x44')],function(_0x3e27ec){var _0x3e77b1={};_0x3e77b1[_0x3e27ec]={'$like':'%'+_0x307c74['query'][_0x1aed('0x4e')]+'%'};return _0x3e77b1;})});}_0x21c206=_[_0x1aed('0x4b')]({},_0x21c206,_0x307c74[_0x1aed('0x4f')]);return _0x23a1ca[_0x1aed('0x61')](_0x21c206);}})['then'](function(_0xabd7d9){if(_0xabd7d9){_0x4f7a80=_0xabd7d9[_0x1aed('0x46')];if(!_0x307c74['query'][_0x1aed('0x60')](_0x1aed('0x47'))){_0x21c206[_0x1aed('0x2e')]=qs[_0x1aed('0x2e')](_0x307c74['query'][_0x1aed('0x2e')]);_0x21c206[_0x1aed('0x48')]=qs[_0x1aed('0x48')](_0x307c74['query'][_0x1aed('0x48')]);}return _0x23a1ca['getSubjects'](_0x21c206);}})[_0x1aed('0x20')](function(_0x415a9c){if(_0x415a9c){return _0x415a9c?{'count':_0x4f7a80,'rows':_0x415a9c}:null;}})['then'](respondWithResult(_0x22546e,null))['catch'](handleError(_0x22546e,null));};exports['getDescriptions']=function(_0x13e0f9,_0x1c2246,_0x4f8c4b){var _0x1113b0={};var _0x439f51={};var _0x484313;var _0x2978ff;return db[_0x1aed('0x3b')][_0x1aed('0x5b')]({'where':{'id':_0x13e0f9[_0x1aed('0x55')]['id']}})[_0x1aed('0x20')](handleEntityNotFound(_0x1c2246,null))[_0x1aed('0x20')](function(_0xae1f9c){if(_0xae1f9c){_0x484313=_0xae1f9c;_0x439f51[_0x1aed('0x3f')]=_[_0x1aed('0x5c')](db[_0x1aed('0x5d')][_0x1aed('0x3c')]);_0x439f51[_0x1aed('0x41')]=_['keys'](_0x13e0f9[_0x1aed('0x41')]);_0x439f51[_0x1aed('0x42')]=_[_0x1aed('0x43')](_0x439f51[_0x1aed('0x3f')],_0x439f51['query']);_0x1113b0[_0x1aed('0x44')]=_[_0x1aed('0x43')](_0x439f51['model'],qs[_0x1aed('0x45')](_0x13e0f9[_0x1aed('0x41')][_0x1aed('0x45')]));_0x1113b0[_0x1aed('0x44')]=_0x1113b0[_0x1aed('0x44')][_0x1aed('0x46')]?_0x1113b0['attributes']:_0x439f51[_0x1aed('0x3f')];_0x1113b0[_0x1aed('0x49')]=qs[_0x1aed('0x5e')](_0x13e0f9[_0x1aed('0x41')][_0x1aed('0x5e')]);_0x1113b0[_0x1aed('0x4a')]=qs[_0x1aed('0x42')](_[_0x1aed('0x5f')](_0x13e0f9[_0x1aed('0x41')],_0x439f51['filters']));if(_0x13e0f9[_0x1aed('0x41')]['filter']){_0x1113b0['where']=_[_0x1aed('0x4b')](_0x1113b0[_0x1aed('0x4a')],{'$or':_[_0x1aed('0x40')](_0x1113b0[_0x1aed('0x44')],function(_0x132ffd){var _0x684953={};_0x684953[_0x132ffd]={'$like':'%'+_0x13e0f9['query'][_0x1aed('0x4e')]+'%'};return _0x684953;})});}_0x1113b0=_[_0x1aed('0x4b')]({},_0x1113b0,_0x13e0f9[_0x1aed('0x4f')]);return _0x484313[_0x1aed('0x62')](_0x1113b0);}})['then'](function(_0x82fbe2){if(_0x82fbe2){_0x2978ff=_0x82fbe2['length'];if(!_0x13e0f9['query'][_0x1aed('0x60')](_0x1aed('0x47'))){_0x1113b0[_0x1aed('0x2e')]=qs[_0x1aed('0x2e')](_0x13e0f9[_0x1aed('0x41')][_0x1aed('0x2e')]);_0x1113b0['offset']=qs['offset'](_0x13e0f9[_0x1aed('0x41')]['offset']);}return _0x484313[_0x1aed('0x62')](_0x1113b0);}})[_0x1aed('0x20')](function(_0x65ee68){if(_0x65ee68){return _0x65ee68?{'count':_0x2978ff,'rows':_0x65ee68}:null;}})[_0x1aed('0x20')](respondWithResult(_0x1c2246,null))[_0x1aed('0x53')](handleError(_0x1c2246,null));};
\ No newline at end of file
+var _0xe442=['getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','options','find','create','body','update','params','getFields','hasOwnProperty','findOne','VtigerField','pick'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xe442,0x11f));var _0x2e44=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xe442[_0x32f7d7];return _0x133d09;};'use strict';var pdf=require(_0x2e44('0x0'));var emlformat=require(_0x2e44('0x1'));var rimraf=require(_0x2e44('0x2'));var zipdir=require(_0x2e44('0x3'));var jsonpatch=require(_0x2e44('0x4'));var rp=require('request-promise');var moment=require(_0x2e44('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2e44('0x6'));var util=require(_0x2e44('0x7'));var path=require(_0x2e44('0x8'));var sox=require(_0x2e44('0x9'));var csv=require(_0x2e44('0xa'));var ejs=require(_0x2e44('0xb'));var fs=require('fs');var _=require(_0x2e44('0xc'));var squel=require(_0x2e44('0xd'));var crypto=require(_0x2e44('0xe'));var jsforce=require(_0x2e44('0xf'));var deskjs=require(_0x2e44('0x10'));var toCsv=require(_0x2e44('0xa'));var querystring=require(_0x2e44('0x11'));var Papa=require(_0x2e44('0x12'));var Redis=require('ioredis');var authService=require(_0x2e44('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2e44('0x14'));var hardwareService=require(_0x2e44('0x15'));var logger=require(_0x2e44('0x16'))(_0x2e44('0x17'));var utils=require(_0x2e44('0x18'));var config=require(_0x2e44('0x19'));var db=require(_0x2e44('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2e44('0x1b')][_0x2e44('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xfb4b95,_0xda193e,_0x471d34){if(_0x471d34){var _0x3187e5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3187e5[_0x2e44('0x1d')](_0xda193e)){return _0xfb4b95;}else{throw new db[(_0x2e44('0x1e'))][(_0x2e44('0x1f'))](_0x2e44('0x20'));}}else{return _0xfb4b95;}}function respondWithRpcPromise(_0x4bae87,_0x74f021,_0x5c21c7,_0xf5f75c){return new BPromise(function(_0x820bce,_0x796c39){var _0x36a511=_0xf5f75c||client;return _0x36a511[_0x2e44('0x21')](_0x4bae87,_0x5c21c7)[_0x2e44('0x22')](function(_0x4c763e){logger['info'](_0x2e44('0x23'),_0x74f021,_0x2e44('0x24'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x74f021,'request\x20sent',JSON['stringify'](_0x4c763e));if(_0x4c763e['error']){if(_0x4c763e[_0x2e44('0x25')][_0x2e44('0x26')]===0x1f4){logger[_0x2e44('0x25')]('VtigerConfiguration,\x20%s,\x20%s',_0x74f021,_0x4c763e[_0x2e44('0x25')][_0x2e44('0x27')]);return _0x796c39(_0x4c763e[_0x2e44('0x25')]['message']);}logger['error'](_0x2e44('0x23'),_0x74f021,_0x4c763e[_0x2e44('0x25')]['message']);return _0x820bce(_0x4c763e['error'][_0x2e44('0x27')]);}else{logger['info'](_0x2e44('0x23'),_0x74f021,_0x2e44('0x24'));_0x820bce(_0x4c763e['result']['message']);}})[_0x2e44('0x28')](function(_0x4efa65){logger[_0x2e44('0x25')](_0x2e44('0x23'),_0x74f021,_0x4efa65);_0x796c39(_0x4efa65);});});}function respondWithStatusCode(_0x4974d2,_0x43e170){_0x43e170=_0x43e170||0xcc;return function(_0x2027b1){if(_0x2027b1){return _0x4974d2[_0x2e44('0x29')](_0x43e170);}return _0x4974d2['status'](_0x43e170)[_0x2e44('0x2a')]();};}function respondWithResult(_0x16bfa6,_0x43c04a){_0x43c04a=_0x43c04a||0xc8;return function(_0x468898){if(_0x468898){return _0x16bfa6[_0x2e44('0x2b')](_0x43c04a)[_0x2e44('0x2c')](_0x468898);}};}function respondWithFilteredResult(_0xaf82f8,_0x2e2677){return function(_0x4dfc59){if(_0x4dfc59){var _0x410848=_0x4dfc59[_0x2e44('0x2d')],_0x32f1d8=_0x2e2677[_0x2e44('0x2e')],_0x39888f=_0x2e2677[_0x2e44('0x2e')]+_0x2e2677['limit'],_0x2a8922;if(_0x39888f>=_0x410848){_0x39888f=_0x410848;_0x2a8922=0xc8;}else{_0x2a8922=0xce;}_0xaf82f8[_0x2e44('0x2b')](_0x2a8922);return _0xaf82f8[_0x2e44('0x2f')](_0x2e44('0x30'),_0x32f1d8+'-'+_0x39888f+'/'+_0x410848)[_0x2e44('0x2c')](_0x4dfc59);}return null;};}function patchUpdates(_0x433de2){return function(_0x2fc063){try{jsonpatch[_0x2e44('0x31')](_0x2fc063,_0x433de2,!![]);}catch(_0x1c4f3a){return BPromise[_0x2e44('0x32')](_0x1c4f3a);}return _0x2fc063[_0x2e44('0x33')]();};}function saveUpdates(_0x7fa3c8,_0x4b7749){return function(_0x3005e6){if(_0x3005e6){return _0x3005e6['update'](_0x7fa3c8)[_0x2e44('0x22')](function(_0x31c752){return _0x31c752;});}return null;};}function removeEntity(_0x7fde00,_0xd85590){return function(_0x301e47){if(_0x301e47){return _0x301e47['destroy']()[_0x2e44('0x22')](function(){_0x7fde00[_0x2e44('0x2b')](0xcc)[_0x2e44('0x2a')]();});}};}function handleEntityNotFound(_0x12a61c,_0x302237){return function(_0x9a62c1){if(!_0x9a62c1){_0x12a61c[_0x2e44('0x29')](0x194);}return _0x9a62c1;};}function handleError(_0x2e3d9b,_0x37e182){_0x37e182=_0x37e182||0x1f4;return function(_0xaa990b){logger['error'](_0xaa990b[_0x2e44('0x34')]);if(_0xaa990b[_0x2e44('0x35')]){delete _0xaa990b['name'];}_0x2e3d9b[_0x2e44('0x2b')](_0x37e182)[_0x2e44('0x36')](_0xaa990b);};}exports[_0x2e44('0x37')]=function(_0x4c7c91,_0x463e67){var _0x4b98b7={},_0x3209f4={},_0x48c5ab={'count':0x0,'rows':[]};var _0x11c1c0=_[_0x2e44('0x38')](db[_0x2e44('0x39')][_0x2e44('0x3a')],function(_0x17e798){return{'name':_0x17e798[_0x2e44('0x3b')],'type':_0x17e798[_0x2e44('0x3c')][_0x2e44('0x3d')]};});_0x3209f4[_0x2e44('0x3e')]=_[_0x2e44('0x38')](_0x11c1c0,_0x2e44('0x35'));_0x3209f4[_0x2e44('0x3f')]=_[_0x2e44('0x40')](_0x4c7c91[_0x2e44('0x3f')]);_0x3209f4[_0x2e44('0x41')]=_['intersection'](_0x3209f4[_0x2e44('0x3e')],_0x3209f4['query']);_0x4b98b7[_0x2e44('0x42')]=_[_0x2e44('0x43')](_0x3209f4[_0x2e44('0x3e')],qs[_0x2e44('0x44')](_0x4c7c91[_0x2e44('0x3f')][_0x2e44('0x44')]));_0x4b98b7[_0x2e44('0x42')]=_0x4b98b7[_0x2e44('0x42')][_0x2e44('0x45')]?_0x4b98b7[_0x2e44('0x42')]:_0x3209f4[_0x2e44('0x3e')];if(!_0x4c7c91[_0x2e44('0x3f')]['hasOwnProperty'](_0x2e44('0x46'))){_0x4b98b7[_0x2e44('0x47')]=qs['limit'](_0x4c7c91[_0x2e44('0x3f')][_0x2e44('0x47')]);_0x4b98b7[_0x2e44('0x2e')]=qs['offset'](_0x4c7c91[_0x2e44('0x3f')][_0x2e44('0x2e')]);}_0x4b98b7[_0x2e44('0x48')]=qs[_0x2e44('0x49')](_0x4c7c91['query'][_0x2e44('0x49')]);_0x4b98b7[_0x2e44('0x4a')]=qs['filters'](_['pick'](_0x4c7c91['query'],_0x3209f4['filters']),_0x11c1c0);if(_0x4c7c91[_0x2e44('0x3f')][_0x2e44('0x4b')]){_0x4b98b7[_0x2e44('0x4a')]=_[_0x2e44('0x4c')](_0x4b98b7[_0x2e44('0x4a')],{'$or':_[_0x2e44('0x38')](_0x11c1c0,function(_0xe0a8e4){if(_0xe0a8e4[_0x2e44('0x3c')]!==_0x2e44('0x4d')){var _0x304265={};_0x304265[_0xe0a8e4[_0x2e44('0x35')]]={'$like':'%'+_0x4c7c91['query'][_0x2e44('0x4b')]+'%'};return _0x304265;}})});}_0x4b98b7=_['merge']({},_0x4b98b7,_0x4c7c91['options']);var _0x3ad5ce={'where':_0x4b98b7[_0x2e44('0x4a')]};return db[_0x2e44('0x39')][_0x2e44('0x2d')](_0x3ad5ce)[_0x2e44('0x22')](function(_0x8b15dd){_0x48c5ab[_0x2e44('0x2d')]=_0x8b15dd;if(_0x4c7c91[_0x2e44('0x3f')][_0x2e44('0x4e')]){_0x4b98b7[_0x2e44('0x4f')]=[{'all':!![]}];}return db[_0x2e44('0x39')][_0x2e44('0x50')](_0x4b98b7);})['then'](function(_0xeda0c3){_0x48c5ab[_0x2e44('0x51')]=_0xeda0c3;return _0x48c5ab;})[_0x2e44('0x22')](respondWithFilteredResult(_0x463e67,_0x4b98b7))['catch'](handleError(_0x463e67,null));};exports['show']=function(_0x519125,_0x821021){var _0x389ed7={'raw':![],'where':{'id':_0x519125['params']['id']}},_0x2dd596={};_0x2dd596[_0x2e44('0x3e')]=_[_0x2e44('0x40')](db[_0x2e44('0x39')][_0x2e44('0x3a')]);_0x2dd596[_0x2e44('0x3f')]=_[_0x2e44('0x40')](_0x519125[_0x2e44('0x3f')]);_0x2dd596[_0x2e44('0x41')]=_[_0x2e44('0x43')](_0x2dd596[_0x2e44('0x3e')],_0x2dd596[_0x2e44('0x3f')]);_0x389ed7[_0x2e44('0x42')]=_[_0x2e44('0x43')](_0x2dd596[_0x2e44('0x3e')],qs[_0x2e44('0x44')](_0x519125[_0x2e44('0x3f')][_0x2e44('0x44')]));_0x389ed7[_0x2e44('0x42')]=_0x389ed7[_0x2e44('0x42')][_0x2e44('0x45')]?_0x389ed7[_0x2e44('0x42')]:_0x2dd596[_0x2e44('0x3e')];if(_0x519125['query'][_0x2e44('0x4e')]){_0x389ed7[_0x2e44('0x4f')]=[{'all':!![]}];}_0x389ed7=_[_0x2e44('0x4c')]({},_0x389ed7,_0x519125[_0x2e44('0x52')]);return db[_0x2e44('0x39')][_0x2e44('0x53')](_0x389ed7)['then'](handleEntityNotFound(_0x821021,null))[_0x2e44('0x22')](respondWithResult(_0x821021,null))[_0x2e44('0x28')](handleError(_0x821021,null));};exports['create']=function(_0x3eb063,_0x1d5e44){return db[_0x2e44('0x39')][_0x2e44('0x54')](_0x3eb063[_0x2e44('0x55')],{})[_0x2e44('0x22')](respondWithResult(_0x1d5e44,0xc9))[_0x2e44('0x28')](handleError(_0x1d5e44,null));};exports[_0x2e44('0x56')]=function(_0x22e99b,_0x52c21c){if(_0x22e99b[_0x2e44('0x55')]['id']){delete _0x22e99b['body']['id'];}return db[_0x2e44('0x39')][_0x2e44('0x53')]({'where':{'id':_0x22e99b['params']['id']}})[_0x2e44('0x22')](handleEntityNotFound(_0x52c21c,null))['then'](saveUpdates(_0x22e99b[_0x2e44('0x55')],null))[_0x2e44('0x22')](respondWithResult(_0x52c21c,null))[_0x2e44('0x28')](handleError(_0x52c21c,null));};exports['destroy']=function(_0xba8db8,_0x540072){return db[_0x2e44('0x39')]['find']({'where':{'id':_0xba8db8[_0x2e44('0x57')]['id']}})[_0x2e44('0x22')](handleEntityNotFound(_0x540072,null))['then'](removeEntity(_0x540072,null))['catch'](handleError(_0x540072,null));};exports[_0x2e44('0x58')]=function(_0x34617d,_0x3fc740,_0x943e44){var _0x575132={};var _0x22bc73={};var _0x458145;var _0x296410;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x34617d[_0x2e44('0x57')]['id']}})[_0x2e44('0x22')](handleEntityNotFound(_0x3fc740,null))[_0x2e44('0x22')](function(_0x213019){if(_0x213019){_0x458145=_0x213019;_0x22bc73[_0x2e44('0x3e')]=_[_0x2e44('0x40')](db['VtigerField'][_0x2e44('0x3a')]);_0x22bc73[_0x2e44('0x3f')]=_['keys'](_0x34617d[_0x2e44('0x3f')]);_0x22bc73['filters']=_[_0x2e44('0x43')](_0x22bc73[_0x2e44('0x3e')],_0x22bc73[_0x2e44('0x3f')]);_0x575132[_0x2e44('0x42')]=_[_0x2e44('0x43')](_0x22bc73[_0x2e44('0x3e')],qs[_0x2e44('0x44')](_0x34617d[_0x2e44('0x3f')][_0x2e44('0x44')]));_0x575132[_0x2e44('0x42')]=_0x575132[_0x2e44('0x42')][_0x2e44('0x45')]?_0x575132[_0x2e44('0x42')]:_0x22bc73[_0x2e44('0x3e')];_0x575132[_0x2e44('0x48')]=qs['sort'](_0x34617d[_0x2e44('0x3f')]['sort']);_0x575132[_0x2e44('0x4a')]=qs[_0x2e44('0x41')](_['pick'](_0x34617d[_0x2e44('0x3f')],_0x22bc73[_0x2e44('0x41')]));if(_0x34617d[_0x2e44('0x3f')][_0x2e44('0x4b')]){_0x575132[_0x2e44('0x4a')]=_[_0x2e44('0x4c')](_0x575132['where'],{'$or':_[_0x2e44('0x38')](_0x575132[_0x2e44('0x42')],function(_0x12d940){var _0x3c06a3={};_0x3c06a3[_0x12d940]={'$like':'%'+_0x34617d[_0x2e44('0x3f')]['filter']+'%'};return _0x3c06a3;})});}_0x575132=_[_0x2e44('0x4c')]({},_0x575132,_0x34617d[_0x2e44('0x52')]);return _0x458145['getFields'](_0x575132);}})[_0x2e44('0x22')](function(_0x1f50c0){if(_0x1f50c0){_0x296410=_0x1f50c0[_0x2e44('0x45')];if(!_0x34617d[_0x2e44('0x3f')][_0x2e44('0x59')](_0x2e44('0x46'))){_0x575132['limit']=qs[_0x2e44('0x47')](_0x34617d[_0x2e44('0x3f')][_0x2e44('0x47')]);_0x575132['offset']=qs['offset'](_0x34617d[_0x2e44('0x3f')][_0x2e44('0x2e')]);}return _0x458145[_0x2e44('0x58')](_0x575132);}})[_0x2e44('0x22')](function(_0x517316){if(_0x517316){return _0x517316?{'count':_0x296410,'rows':_0x517316}:null;}})[_0x2e44('0x22')](respondWithResult(_0x3fc740,null))[_0x2e44('0x28')](handleError(_0x3fc740,null));};exports['getSubjects']=function(_0x3f1705,_0x20daed,_0x20a350){var _0x5939e5={};var _0x5a86f1={};var _0x84b1d;var _0x5e521c;return db['VtigerConfiguration'][_0x2e44('0x5a')]({'where':{'id':_0x3f1705[_0x2e44('0x57')]['id']}})[_0x2e44('0x22')](handleEntityNotFound(_0x20daed,null))[_0x2e44('0x22')](function(_0x3a4d41){if(_0x3a4d41){_0x84b1d=_0x3a4d41;_0x5a86f1[_0x2e44('0x3e')]=_[_0x2e44('0x40')](db[_0x2e44('0x5b')][_0x2e44('0x3a')]);_0x5a86f1[_0x2e44('0x3f')]=_[_0x2e44('0x40')](_0x3f1705[_0x2e44('0x3f')]);_0x5a86f1[_0x2e44('0x41')]=_[_0x2e44('0x43')](_0x5a86f1[_0x2e44('0x3e')],_0x5a86f1[_0x2e44('0x3f')]);_0x5939e5[_0x2e44('0x42')]=_[_0x2e44('0x43')](_0x5a86f1[_0x2e44('0x3e')],qs[_0x2e44('0x44')](_0x3f1705[_0x2e44('0x3f')][_0x2e44('0x44')]));_0x5939e5[_0x2e44('0x42')]=_0x5939e5[_0x2e44('0x42')]['length']?_0x5939e5[_0x2e44('0x42')]:_0x5a86f1[_0x2e44('0x3e')];_0x5939e5[_0x2e44('0x48')]=qs[_0x2e44('0x49')](_0x3f1705[_0x2e44('0x3f')][_0x2e44('0x49')]);_0x5939e5['where']=qs[_0x2e44('0x41')](_[_0x2e44('0x5c')](_0x3f1705[_0x2e44('0x3f')],_0x5a86f1[_0x2e44('0x41')]));if(_0x3f1705[_0x2e44('0x3f')][_0x2e44('0x4b')]){_0x5939e5['where']=_[_0x2e44('0x4c')](_0x5939e5[_0x2e44('0x4a')],{'$or':_[_0x2e44('0x38')](_0x5939e5['attributes'],function(_0x3999df){var _0x41c0ef={};_0x41c0ef[_0x3999df]={'$like':'%'+_0x3f1705[_0x2e44('0x3f')][_0x2e44('0x4b')]+'%'};return _0x41c0ef;})});}_0x5939e5=_[_0x2e44('0x4c')]({},_0x5939e5,_0x3f1705[_0x2e44('0x52')]);return _0x84b1d[_0x2e44('0x5d')](_0x5939e5);}})['then'](function(_0x21d3f4){if(_0x21d3f4){_0x5e521c=_0x21d3f4[_0x2e44('0x45')];if(!_0x3f1705['query'][_0x2e44('0x59')]('nolimit')){_0x5939e5[_0x2e44('0x47')]=qs[_0x2e44('0x47')](_0x3f1705['query']['limit']);_0x5939e5[_0x2e44('0x2e')]=qs[_0x2e44('0x2e')](_0x3f1705[_0x2e44('0x3f')][_0x2e44('0x2e')]);}return _0x84b1d[_0x2e44('0x5d')](_0x5939e5);}})[_0x2e44('0x22')](function(_0x1a4793){if(_0x1a4793){return _0x1a4793?{'count':_0x5e521c,'rows':_0x1a4793}:null;}})['then'](respondWithResult(_0x20daed,null))[_0x2e44('0x28')](handleError(_0x20daed,null));};exports[_0x2e44('0x5e')]=function(_0x21c9f9,_0x182e11,_0x1cac0c){var _0x3ed4b7={};var _0xda4740={};var _0x2f5a61;var _0xd5bb43;return db[_0x2e44('0x39')][_0x2e44('0x5a')]({'where':{'id':_0x21c9f9[_0x2e44('0x57')]['id']}})[_0x2e44('0x22')](handleEntityNotFound(_0x182e11,null))[_0x2e44('0x22')](function(_0xe379b0){if(_0xe379b0){_0x2f5a61=_0xe379b0;_0xda4740[_0x2e44('0x3e')]=_[_0x2e44('0x40')](db['VtigerField'][_0x2e44('0x3a')]);_0xda4740[_0x2e44('0x3f')]=_['keys'](_0x21c9f9[_0x2e44('0x3f')]);_0xda4740[_0x2e44('0x41')]=_['intersection'](_0xda4740['model'],_0xda4740[_0x2e44('0x3f')]);_0x3ed4b7[_0x2e44('0x42')]=_[_0x2e44('0x43')](_0xda4740[_0x2e44('0x3e')],qs[_0x2e44('0x44')](_0x21c9f9[_0x2e44('0x3f')][_0x2e44('0x44')]));_0x3ed4b7['attributes']=_0x3ed4b7[_0x2e44('0x42')][_0x2e44('0x45')]?_0x3ed4b7[_0x2e44('0x42')]:_0xda4740[_0x2e44('0x3e')];_0x3ed4b7[_0x2e44('0x48')]=qs[_0x2e44('0x49')](_0x21c9f9[_0x2e44('0x3f')][_0x2e44('0x49')]);_0x3ed4b7[_0x2e44('0x4a')]=qs[_0x2e44('0x41')](_[_0x2e44('0x5c')](_0x21c9f9[_0x2e44('0x3f')],_0xda4740[_0x2e44('0x41')]));if(_0x21c9f9[_0x2e44('0x3f')][_0x2e44('0x4b')]){_0x3ed4b7[_0x2e44('0x4a')]=_[_0x2e44('0x4c')](_0x3ed4b7['where'],{'$or':_[_0x2e44('0x38')](_0x3ed4b7[_0x2e44('0x42')],function(_0x354e08){var _0x215af3={};_0x215af3[_0x354e08]={'$like':'%'+_0x21c9f9[_0x2e44('0x3f')][_0x2e44('0x4b')]+'%'};return _0x215af3;})});}_0x3ed4b7=_[_0x2e44('0x4c')]({},_0x3ed4b7,_0x21c9f9[_0x2e44('0x52')]);return _0x2f5a61[_0x2e44('0x5e')](_0x3ed4b7);}})[_0x2e44('0x22')](function(_0x3c6a09){if(_0x3c6a09){_0xd5bb43=_0x3c6a09[_0x2e44('0x45')];if(!_0x21c9f9[_0x2e44('0x3f')][_0x2e44('0x59')](_0x2e44('0x46'))){_0x3ed4b7[_0x2e44('0x47')]=qs['limit'](_0x21c9f9[_0x2e44('0x3f')]['limit']);_0x3ed4b7[_0x2e44('0x2e')]=qs['offset'](_0x21c9f9[_0x2e44('0x3f')][_0x2e44('0x2e')]);}return _0x2f5a61[_0x2e44('0x5e')](_0x3ed4b7);}})[_0x2e44('0x22')](function(_0x3581e4){if(_0x3581e4){return _0x3581e4?{'count':_0xd5bb43,'rows':_0x3581e4}:null;}})[_0x2e44('0x22')](respondWithResult(_0x182e11,null))[_0x2e44('0x28')](handleError(_0x182e11,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
index 125d36e..bda6da0 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x967f=['int_vtiger_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','VtigerConfiguration'];(function(_0x173721,_0x9803e5){var _0x2f8644=function(_0x7d96d2){while(--_0x7d96d2){_0x173721['push'](_0x173721['shift']());}};_0x2f8644(++_0x9803e5);}(_0x967f,0x1f0));var _0xf967=function(_0x279a4d,_0x345707){_0x279a4d=_0x279a4d-0x0;var _0x1a0cc5=_0x967f[_0x279a4d];return _0x1a0cc5;};'use strict';var _=require(_0xf967('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf967('0x1'));var moment=require(_0xf967('0x2'));var BPromise=require(_0xf967('0x3'));var rp=require(_0xf967('0x4'));var fs=require('fs');var path=require(_0xf967('0x5'));var rimraf=require(_0xf967('0x6'));var config=require('../../config/environment');var attributes=require(_0xf967('0x7'));module[_0xf967('0x8')]=function(_0x26c380,_0x5c7ffc){return _0x26c380['define'](_0xf967('0x9'),attributes,{'tableName':_0xf967('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x825c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x825c,0x1d2));var _0xc825=function(_0x2f3947,_0x2ee083){_0x2f3947=_0x2f3947-0x0;var _0x3e6ab7=_0x825c[_0x2f3947];return _0x3e6ab7;};'use strict';var _=require(_0xc825('0x0'));var util=require('util');var logger=require(_0xc825('0x1'))(_0xc825('0x2'));var moment=require(_0xc825('0x3'));var BPromise=require(_0xc825('0x4'));var rp=require(_0xc825('0x5'));var fs=require('fs');var path=require(_0xc825('0x6'));var rimraf=require(_0xc825('0x7'));var config=require(_0xc825('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x527548,_0x1152c8){return _0x527548[_0xc825('0x9')](_0xc825('0xa'),attributes,{'tableName':_0xc825('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
index b6234d3..5fd6e9d 100644
--- a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
+++ b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb378=['rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xd3ae21,_0x40870f){var _0x20850b=function(_0x2d6860){while(--_0x2d6860){_0xd3ae21['push'](_0xd3ae21['shift']());}};_0x20850b(++_0x40870f);}(_0xb378,0x143));var _0x8b37=function(_0x434cf2,_0x4e49f8){_0x434cf2=_0x434cf2-0x0;var _0x41f6c7=_0xb378[_0x434cf2];return _0x41f6c7;};'use strict';var _=require('lodash');var util=require(_0x8b37('0x0'));var moment=require(_0x8b37('0x1'));var BPromise=require(_0x8b37('0x2'));var rs=require(_0x8b37('0x3'));var fs=require('fs');var Redis=require(_0x8b37('0x4'));var db=require(_0x8b37('0x5'))['db'];var utils=require(_0x8b37('0x6'));var logger=require('../../config/logger')(_0x8b37('0x7'));var config=require(_0x8b37('0x8'));var jayson=require(_0x8b37('0x9'));var client=jayson[_0x8b37('0xa')][_0x8b37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f19f8,_0x31cce8,_0x23b870){return new BPromise(function(_0x18de25,_0x3548ab){return client[_0x8b37('0xc')](_0x1f19f8,_0x23b870)['then'](function(_0x5b7c4d){logger[_0x8b37('0xd')](_0x8b37('0xe'),_0x31cce8,_0x8b37('0xf'));logger[_0x8b37('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x31cce8,_0x8b37('0xf'),JSON['stringify'](_0x5b7c4d));if(_0x5b7c4d[_0x8b37('0x11')]){if(_0x5b7c4d[_0x8b37('0x11')][_0x8b37('0x12')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x31cce8,_0x5b7c4d[_0x8b37('0x11')][_0x8b37('0x13')]);return _0x3548ab(_0x5b7c4d[_0x8b37('0x11')][_0x8b37('0x13')]);}logger['error'](_0x8b37('0xe'),_0x31cce8,_0x5b7c4d[_0x8b37('0x11')][_0x8b37('0x13')]);return _0x18de25(_0x5b7c4d['error'][_0x8b37('0x13')]);}else{logger[_0x8b37('0xd')](_0x8b37('0xe'),_0x31cce8,'request\x20sent');_0x18de25(_0x5b7c4d[_0x8b37('0x14')][_0x8b37('0x13')]);}})[_0x8b37('0x15')](function(_0x169bc2){logger[_0x8b37('0x11')](_0x8b37('0xe'),_0x31cce8,_0x169bc2);_0x3548ab(_0x169bc2);});});}
\ No newline at end of file
+var _0xfe0f=['code','message','catch','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xfe0f,0x18f));var _0xffe0=function(_0x16af7d,_0x443055){_0x16af7d=_0x16af7d-0x0;var _0x599d0c=_0xfe0f[_0x16af7d];return _0x599d0c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xffe0('0x0'));var fs=require('fs');var Redis=require(_0xffe0('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xffe0('0x2'));var logger=require(_0xffe0('0x3'))(_0xffe0('0x4'));var config=require(_0xffe0('0x5'));var jayson=require(_0xffe0('0x6'));var client=jayson['client'][_0xffe0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1cff11,_0x2325f7,_0x42f706){return new BPromise(function(_0x39803d,_0x3a5399){return client[_0xffe0('0x8')](_0x1cff11,_0x42f706)[_0xffe0('0x9')](function(_0xe41306){logger['info'](_0xffe0('0xa'),_0x2325f7,_0xffe0('0xb'));logger['debug'](_0xffe0('0xc'),_0x2325f7,'request\x20sent',JSON[_0xffe0('0xd')](_0xe41306));if(_0xe41306[_0xffe0('0xe')]){if(_0xe41306[_0xffe0('0xe')][_0xffe0('0xf')]===0x1f4){logger[_0xffe0('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x2325f7,_0xe41306[_0xffe0('0xe')]['message']);return _0x3a5399(_0xe41306[_0xffe0('0xe')][_0xffe0('0x10')]);}logger['error'](_0xffe0('0xa'),_0x2325f7,_0xe41306[_0xffe0('0xe')][_0xffe0('0x10')]);return _0x39803d(_0xe41306[_0xffe0('0xe')][_0xffe0('0x10')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x2325f7,_0xffe0('0xb'));_0x39803d(_0xe41306['result'][_0xffe0('0x10')]);}})[_0xffe0('0x11')](function(_0x3330d7){logger[_0xffe0('0xe')](_0xffe0('0xa'),_0x2325f7,_0x3330d7);_0x3a5399(_0x3330d7);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js
index 16d447b..18485dd 100644
--- a/server/api/intVtigerField/index.js
+++ b/server/api/intVtigerField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2b3=['index','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xf2b3,0x182));var _0x3f2b=function(_0x18e5d9,_0x22e3d9){_0x18e5d9=_0x18e5d9-0x0;var _0x3e6e0c=_0xf2b3[_0x18e5d9];return _0x3e6e0c;};'use strict';var multer=require('multer');var util=require(_0x3f2b('0x0'));var path=require(_0x3f2b('0x1'));var timeout=require(_0x3f2b('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3f2b('0x3'));var config=require(_0x3f2b('0x4'));var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3f2b('0x5')]);router[_0x3f2b('0x6')]('/:id',auth[_0x3f2b('0x7')](),controller[_0x3f2b('0x8')]);router[_0x3f2b('0x9')]('/',auth[_0x3f2b('0x7')](),controller[_0x3f2b('0xa')]);router[_0x3f2b('0xb')](_0x3f2b('0xc'),auth[_0x3f2b('0x7')](),controller[_0x3f2b('0xd')]);router[_0x3f2b('0xe')](_0x3f2b('0xc'),auth['isAuthenticated'](),controller[_0x3f2b('0xf')]);module[_0x3f2b('0x10')]=router;
\ No newline at end of file
+var _0x8707=['/:id','show','post','create','put','update','delete','exports','multer','util','path','Router','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x222ff9,_0x872f74){var _0x5817f5=function(_0x153889){while(--_0x153889){_0x222ff9['push'](_0x222ff9['shift']());}};_0x5817f5(++_0x872f74);}(_0x8707,0xa1));var _0x7870=function(_0x12b52c,_0xfd0c98){_0x12b52c=_0x12b52c-0x0;var _0x46ef8d=_0x8707[_0x12b52c];return _0x46ef8d;};'use strict';var multer=require(_0x7870('0x0'));var util=require(_0x7870('0x1'));var path=require(_0x7870('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7870('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7870('0x4'));var controller=require(_0x7870('0x5'));router[_0x7870('0x6')]('/',auth[_0x7870('0x7')](),controller[_0x7870('0x8')]);router[_0x7870('0x6')](_0x7870('0x9'),auth[_0x7870('0x7')](),controller[_0x7870('0xa')]);router[_0x7870('0xb')]('/',auth[_0x7870('0x7')](),controller[_0x7870('0xc')]);router[_0x7870('0xd')](_0x7870('0x9'),auth[_0x7870('0x7')](),controller[_0x7870('0xe')]);router[_0x7870('0xf')](_0x7870('0x9'),auth[_0x7870('0x7')](),controller['destroy']);module[_0x7870('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js
index 27d099c..2a44f33 100644
--- a/server/api/intVtigerField/intVtigerField.attributes.js
+++ b/server/api/intVtigerField/intVtigerField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29fb=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x4c3830,_0x529376){var _0x368604=function(_0x54d700){while(--_0x54d700){_0x4c3830['push'](_0x4c3830['shift']());}};_0x368604(++_0x529376);}(_0x29fb,0x13d));var _0xb29f=function(_0x5b73f6,_0x146997){_0x5b73f6=_0x5b73f6-0x0;var _0x2a2c05=_0x29fb[_0x5b73f6];return _0x2a2c05;};'use strict';var Sequelize=require(_0xb29f('0x0'));module['exports']={'type':{'type':Sequelize[_0xb29f('0x1')](_0xb29f('0x2'),_0xb29f('0x3'),_0xb29f('0x4'),_0xb29f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb29f('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb29f('0x1')](_0xb29f('0x2'),_0xb29f('0x3'),_0xb29f('0x4'))},'keyContent':{'type':Sequelize[_0xb29f('0x6')]},'idField':{'type':Sequelize[_0xb29f('0x6')]},'nameField':{'type':Sequelize[_0xb29f('0x6')]},'customField':{'type':Sequelize[_0xb29f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb29f('0x6')]}};
\ No newline at end of file
+var _0x6208=['STRING','variable','BOOLEAN','sequelize','ENUM','string','customVariable'];(function(_0x2a6af5,_0x48a394){var _0xf982cf=function(_0xc7eee5){while(--_0xc7eee5){_0x2a6af5['push'](_0x2a6af5['shift']());}};_0xf982cf(++_0x48a394);}(_0x6208,0x17d));var _0x8620=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x6208[_0x349367];return _0x14179b;};'use strict';var Sequelize=require(_0x8620('0x0'));module['exports']={'type':{'type':Sequelize[_0x8620('0x1')](_0x8620('0x2'),'variable',_0x8620('0x3'),'keyValue'),'defaultValue':_0x8620('0x2')},'content':{'type':Sequelize[_0x8620('0x4')]},'key':{'type':Sequelize[_0x8620('0x4')]},'keyType':{'type':Sequelize[_0x8620('0x1')](_0x8620('0x2'),_0x8620('0x5'),_0x8620('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8620('0x4')]},'nameField':{'type':Sequelize[_0x8620('0x4')]},'customField':{'type':Sequelize[_0x8620('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8620('0x4')]}};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js
index 9545ae2..09b949a 100644
--- a/server/api/intVtigerField/intVtigerField.controller.js
+++ b/server/api/intVtigerField/intVtigerField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe2c8=['create','body','html-pdf','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','VtigerField','fieldName','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','count','includeAll','include','rows','catch','show','params','rawAttributes','intersection','find'];(function(_0x3512c3,_0x346843){var _0x3b2842=function(_0x49341b){while(--_0x49341b){_0x3512c3['push'](_0x3512c3['shift']());}};_0x3b2842(++_0x346843);}(_0xe2c8,0x8c));var _0x8e2c=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xe2c8[_0x13b02f];return _0x12e9a6;};'use strict';var pdf=require(_0x8e2c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8e2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8e2c('0x2'));var BPromise=require(_0x8e2c('0x3'));var Mustache=require(_0x8e2c('0x4'));var util=require(_0x8e2c('0x5'));var path=require('path');var sox=require(_0x8e2c('0x6'));var csv=require(_0x8e2c('0x7'));var ejs=require(_0x8e2c('0x8'));var fs=require('fs');var _=require(_0x8e2c('0x9'));var squel=require(_0x8e2c('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8e2c('0xb'));var toCsv=require(_0x8e2c('0x7'));var querystring=require(_0x8e2c('0xc'));var Papa=require('papaparse');var Redis=require(_0x8e2c('0xd'));var authService=require(_0x8e2c('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e2c('0xf'));var logger=require(_0x8e2c('0x10'))(_0x8e2c('0x11'));var utils=require(_0x8e2c('0x12'));var config=require(_0x8e2c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x827076,_0x37f8a8){_0x37f8a8=_0x37f8a8||0xcc;return function(_0x560748){if(_0x560748){return _0x827076[_0x8e2c('0x14')](_0x37f8a8);}return _0x827076[_0x8e2c('0x15')](_0x37f8a8)[_0x8e2c('0x16')]();};}function respondWithResult(_0x237b69,_0x3f7b0e){_0x3f7b0e=_0x3f7b0e||0xc8;return function(_0x3faf6f){if(_0x3faf6f){return _0x237b69[_0x8e2c('0x15')](_0x3f7b0e)[_0x8e2c('0x17')](_0x3faf6f);}};}function respondWithFilteredResult(_0x1f7711,_0x2556f0){return function(_0x318611){if(_0x318611){var _0x55dc72=_0x318611['count'],_0x133036=_0x2556f0['offset'],_0xeafae=_0x2556f0[_0x8e2c('0x18')]+_0x2556f0[_0x8e2c('0x19')],_0xbd1615;if(_0xeafae>=_0x55dc72){_0xeafae=_0x55dc72;_0xbd1615=0xc8;}else{_0xbd1615=0xce;}_0x1f7711[_0x8e2c('0x15')](_0xbd1615);return _0x1f7711['set'](_0x8e2c('0x1a'),_0x133036+'-'+_0xeafae+'/'+_0x55dc72)['json'](_0x318611);}return null;};}function patchUpdates(_0x38fbe4){return function(_0x3477e3){try{jsonpatch[_0x8e2c('0x1b')](_0x3477e3,_0x38fbe4,!![]);}catch(_0x42f299){return BPromise[_0x8e2c('0x1c')](_0x42f299);}return _0x3477e3[_0x8e2c('0x1d')]();};}function saveUpdates(_0x4e6398,_0x2130f1){return function(_0x1464b4){if(_0x1464b4){return _0x1464b4[_0x8e2c('0x1e')](_0x4e6398)[_0x8e2c('0x1f')](function(_0x35463d){return _0x35463d;});}return null;};}function removeEntity(_0x11b647,_0x5d2160){return function(_0x1c4537){if(_0x1c4537){return _0x1c4537[_0x8e2c('0x20')]()[_0x8e2c('0x1f')](function(){_0x11b647[_0x8e2c('0x15')](0xcc)[_0x8e2c('0x16')]();});}};}function handleEntityNotFound(_0x3606ad,_0x4c85d0){return function(_0x1aa6c2){if(!_0x1aa6c2){_0x3606ad[_0x8e2c('0x14')](0x194);}return _0x1aa6c2;};}function handleError(_0x4d9f62,_0x4e2f13){_0x4e2f13=_0x4e2f13||0x1f4;return function(_0x300cbd){logger[_0x8e2c('0x21')](_0x300cbd[_0x8e2c('0x22')]);if(_0x300cbd[_0x8e2c('0x23')]){delete _0x300cbd['name'];}_0x4d9f62[_0x8e2c('0x15')](_0x4e2f13)['send'](_0x300cbd);};}exports['index']=function(_0x4a9b50,_0x1847ba){var _0x5b1e87={},_0x22664c={},_0x1d29ff={'count':0x0,'rows':[]};var _0x507f93=_[_0x8e2c('0x24')](db[_0x8e2c('0x25')]['rawAttributes'],function(_0x319d5e){return{'name':_0x319d5e[_0x8e2c('0x26')],'type':_0x319d5e['type'][_0x8e2c('0x27')]};});_0x22664c[_0x8e2c('0x28')]=_[_0x8e2c('0x24')](_0x507f93,'name');_0x22664c['query']=_[_0x8e2c('0x29')](_0x4a9b50[_0x8e2c('0x2a')]);_0x22664c[_0x8e2c('0x2b')]=_['intersection'](_0x22664c['model'],_0x22664c[_0x8e2c('0x2a')]);_0x5b1e87['attributes']=_['intersection'](_0x22664c['model'],qs[_0x8e2c('0x2c')](_0x4a9b50[_0x8e2c('0x2a')][_0x8e2c('0x2c')]));_0x5b1e87['attributes']=_0x5b1e87[_0x8e2c('0x2d')][_0x8e2c('0x2e')]?_0x5b1e87[_0x8e2c('0x2d')]:_0x22664c[_0x8e2c('0x28')];if(!_0x4a9b50[_0x8e2c('0x2a')][_0x8e2c('0x2f')](_0x8e2c('0x30'))){_0x5b1e87[_0x8e2c('0x19')]=qs[_0x8e2c('0x19')](_0x4a9b50[_0x8e2c('0x2a')]['limit']);_0x5b1e87['offset']=qs[_0x8e2c('0x18')](_0x4a9b50[_0x8e2c('0x2a')]['offset']);}_0x5b1e87[_0x8e2c('0x31')]=qs['sort'](_0x4a9b50[_0x8e2c('0x2a')][_0x8e2c('0x32')]);_0x5b1e87[_0x8e2c('0x33')]=qs[_0x8e2c('0x2b')](_[_0x8e2c('0x34')](_0x4a9b50[_0x8e2c('0x2a')],_0x22664c[_0x8e2c('0x2b')]),_0x507f93);if(_0x4a9b50[_0x8e2c('0x2a')][_0x8e2c('0x35')]){_0x5b1e87[_0x8e2c('0x33')]=_[_0x8e2c('0x36')](_0x5b1e87[_0x8e2c('0x33')],{'$or':_[_0x8e2c('0x24')](_0x507f93,function(_0x1bb9ce){if(_0x1bb9ce[_0x8e2c('0x37')]!=='VIRTUAL'){var _0x4e38ae={};_0x4e38ae[_0x1bb9ce[_0x8e2c('0x23')]]={'$like':'%'+_0x4a9b50[_0x8e2c('0x2a')][_0x8e2c('0x35')]+'%'};return _0x4e38ae;}})});}_0x5b1e87=_[_0x8e2c('0x36')]({},_0x5b1e87,_0x4a9b50[_0x8e2c('0x38')]);var _0x2121b3={'where':_0x5b1e87[_0x8e2c('0x33')]};return db[_0x8e2c('0x25')][_0x8e2c('0x39')](_0x2121b3)['then'](function(_0x2a3896){_0x1d29ff[_0x8e2c('0x39')]=_0x2a3896;if(_0x4a9b50[_0x8e2c('0x2a')][_0x8e2c('0x3a')]){_0x5b1e87[_0x8e2c('0x3b')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x5b1e87);})['then'](function(_0x570edd){_0x1d29ff[_0x8e2c('0x3c')]=_0x570edd;return _0x1d29ff;})[_0x8e2c('0x1f')](respondWithFilteredResult(_0x1847ba,_0x5b1e87))[_0x8e2c('0x3d')](handleError(_0x1847ba,null));};exports[_0x8e2c('0x3e')]=function(_0x307cf6,_0x434446){var _0x8469b1={'raw':!![],'where':{'id':_0x307cf6[_0x8e2c('0x3f')]['id']}},_0x22ebf9={};_0x22ebf9[_0x8e2c('0x28')]=_[_0x8e2c('0x29')](db[_0x8e2c('0x25')][_0x8e2c('0x40')]);_0x22ebf9['query']=_[_0x8e2c('0x29')](_0x307cf6[_0x8e2c('0x2a')]);_0x22ebf9[_0x8e2c('0x2b')]=_[_0x8e2c('0x41')](_0x22ebf9[_0x8e2c('0x28')],_0x22ebf9[_0x8e2c('0x2a')]);_0x8469b1['attributes']=_[_0x8e2c('0x41')](_0x22ebf9['model'],qs[_0x8e2c('0x2c')](_0x307cf6[_0x8e2c('0x2a')]['fields']));_0x8469b1[_0x8e2c('0x2d')]=_0x8469b1[_0x8e2c('0x2d')][_0x8e2c('0x2e')]?_0x8469b1[_0x8e2c('0x2d')]:_0x22ebf9['model'];if(_0x307cf6[_0x8e2c('0x2a')][_0x8e2c('0x3a')]){_0x8469b1[_0x8e2c('0x3b')]=[{'all':!![]}];}_0x8469b1=_[_0x8e2c('0x36')]({},_0x8469b1,_0x307cf6[_0x8e2c('0x38')]);return db['VtigerField'][_0x8e2c('0x42')](_0x8469b1)['then'](handleEntityNotFound(_0x434446,null))['then'](respondWithResult(_0x434446,null))[_0x8e2c('0x3d')](handleError(_0x434446,null));};exports[_0x8e2c('0x43')]=function(_0x3f09dd,_0x111a0d){return db['VtigerField'][_0x8e2c('0x43')](_0x3f09dd[_0x8e2c('0x44')],{})[_0x8e2c('0x1f')](respondWithResult(_0x111a0d,0xc9))[_0x8e2c('0x3d')](handleError(_0x111a0d,null));};exports[_0x8e2c('0x1e')]=function(_0x5c8227,_0x140d96){if(_0x5c8227['body']['id']){delete _0x5c8227[_0x8e2c('0x44')]['id'];}return db[_0x8e2c('0x25')]['find']({'where':{'id':_0x5c8227[_0x8e2c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x140d96,null))[_0x8e2c('0x1f')](saveUpdates(_0x5c8227[_0x8e2c('0x44')],null))[_0x8e2c('0x1f')](respondWithResult(_0x140d96,null))[_0x8e2c('0x3d')](handleError(_0x140d96,null));};exports[_0x8e2c('0x20')]=function(_0x583ae5,_0x42870c){return db[_0x8e2c('0x25')][_0x8e2c('0x42')]({'where':{'id':_0x583ae5[_0x8e2c('0x3f')]['id']}})[_0x8e2c('0x1f')](handleEntityNotFound(_0x42870c,null))[_0x8e2c('0x1f')](removeEntity(_0x42870c,null))['catch'](handleError(_0x42870c,null));};
\ No newline at end of file
+var _0xae3f=['hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','save','destroy','then','end','stack','send','map','VtigerField','rawAttributes','fieldName','type','query','keys','filters','intersection','fields','attributes','length','model'];(function(_0x39c380,_0x4849cf){var _0xa0d012=function(_0x7baffc){while(--_0x7baffc){_0x39c380['push'](_0x39c380['shift']());}};_0xa0d012(++_0x4849cf);}(_0xae3f,0x136));var _0xfae3=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xae3f[_0x45b034];return _0x509cb0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfae3('0x0'));var rimraf=require(_0xfae3('0x1'));var zipdir=require(_0xfae3('0x2'));var jsonpatch=require(_0xfae3('0x3'));var rp=require(_0xfae3('0x4'));var moment=require(_0xfae3('0x5'));var BPromise=require(_0xfae3('0x6'));var Mustache=require(_0xfae3('0x7'));var util=require(_0xfae3('0x8'));var path=require(_0xfae3('0x9'));var sox=require(_0xfae3('0xa'));var csv=require(_0xfae3('0xb'));var ejs=require(_0xfae3('0xc'));var fs=require('fs');var _=require(_0xfae3('0xd'));var squel=require('squel');var crypto=require(_0xfae3('0xe'));var jsforce=require(_0xfae3('0xf'));var deskjs=require(_0xfae3('0x10'));var toCsv=require(_0xfae3('0xb'));var querystring=require(_0xfae3('0x11'));var Papa=require(_0xfae3('0x12'));var Redis=require('ioredis');var authService=require(_0xfae3('0x13'));var qs=require(_0xfae3('0x14'));var as=require(_0xfae3('0x15'));var hardwareService=require(_0xfae3('0x16'));var logger=require(_0xfae3('0x17'))(_0xfae3('0x18'));var utils=require(_0xfae3('0x19'));var config=require(_0xfae3('0x1a'));var db=require(_0xfae3('0x1b'))['db'];function respondWithStatusCode(_0xe37e66,_0x1e99f1){_0x1e99f1=_0x1e99f1||0xcc;return function(_0x379956){if(_0x379956){return _0xe37e66[_0xfae3('0x1c')](_0x1e99f1);}return _0xe37e66['status'](_0x1e99f1)['end']();};}function respondWithResult(_0x25cdf8,_0x2a37c4){_0x2a37c4=_0x2a37c4||0xc8;return function(_0x1e4706){if(_0x1e4706){return _0x25cdf8[_0xfae3('0x1d')](_0x2a37c4)[_0xfae3('0x1e')](_0x1e4706);}};}function respondWithFilteredResult(_0x50dcfb,_0x55d463){return function(_0xdae13f){if(_0xdae13f){var _0x308fda=_0xdae13f[_0xfae3('0x1f')],_0x285866=_0x55d463['offset'],_0x50dd0a=_0x55d463[_0xfae3('0x20')]+_0x55d463[_0xfae3('0x21')],_0xaf7bf5;if(_0x50dd0a>=_0x308fda){_0x50dd0a=_0x308fda;_0xaf7bf5=0xc8;}else{_0xaf7bf5=0xce;}_0x50dcfb['status'](_0xaf7bf5);return _0x50dcfb['set']('Content-Range',_0x285866+'-'+_0x50dd0a+'/'+_0x308fda)[_0xfae3('0x1e')](_0xdae13f);}return null;};}function patchUpdates(_0x50d0ef){return function(_0x3c0ae7){try{jsonpatch[_0xfae3('0x22')](_0x3c0ae7,_0x50d0ef,!![]);}catch(_0x592bea){return BPromise[_0xfae3('0x23')](_0x592bea);}return _0x3c0ae7[_0xfae3('0x24')]();};}function saveUpdates(_0x5ca53a,_0x468955){return function(_0x382d9c){if(_0x382d9c){return _0x382d9c['update'](_0x5ca53a)['then'](function(_0x2aa3b2){return _0x2aa3b2;});}return null;};}function removeEntity(_0x53dc40,_0x251537){return function(_0x5ee570){if(_0x5ee570){return _0x5ee570[_0xfae3('0x25')]()[_0xfae3('0x26')](function(){_0x53dc40[_0xfae3('0x1d')](0xcc)[_0xfae3('0x27')]();});}};}function handleEntityNotFound(_0x23be47,_0x15419a){return function(_0x2fa4b8){if(!_0x2fa4b8){_0x23be47[_0xfae3('0x1c')](0x194);}return _0x2fa4b8;};}function handleError(_0x3eef44,_0x590c10){_0x590c10=_0x590c10||0x1f4;return function(_0x4296bc){logger['error'](_0x4296bc[_0xfae3('0x28')]);if(_0x4296bc['name']){delete _0x4296bc['name'];}_0x3eef44[_0xfae3('0x1d')](_0x590c10)[_0xfae3('0x29')](_0x4296bc);};}exports['index']=function(_0xdd9ac5,_0x4d0504){var _0x3cbea9={},_0x4c6d78={},_0x392930={'count':0x0,'rows':[]};var _0x54a5e2=_[_0xfae3('0x2a')](db[_0xfae3('0x2b')][_0xfae3('0x2c')],function(_0x281250){return{'name':_0x281250[_0xfae3('0x2d')],'type':_0x281250[_0xfae3('0x2e')]['key']};});_0x4c6d78['model']=_[_0xfae3('0x2a')](_0x54a5e2,'name');_0x4c6d78[_0xfae3('0x2f')]=_[_0xfae3('0x30')](_0xdd9ac5[_0xfae3('0x2f')]);_0x4c6d78[_0xfae3('0x31')]=_[_0xfae3('0x32')](_0x4c6d78['model'],_0x4c6d78[_0xfae3('0x2f')]);_0x3cbea9['attributes']=_[_0xfae3('0x32')](_0x4c6d78['model'],qs[_0xfae3('0x33')](_0xdd9ac5[_0xfae3('0x2f')][_0xfae3('0x33')]));_0x3cbea9['attributes']=_0x3cbea9[_0xfae3('0x34')][_0xfae3('0x35')]?_0x3cbea9[_0xfae3('0x34')]:_0x4c6d78[_0xfae3('0x36')];if(!_0xdd9ac5[_0xfae3('0x2f')][_0xfae3('0x37')](_0xfae3('0x38'))){_0x3cbea9[_0xfae3('0x21')]=qs[_0xfae3('0x21')](_0xdd9ac5['query'][_0xfae3('0x21')]);_0x3cbea9[_0xfae3('0x20')]=qs[_0xfae3('0x20')](_0xdd9ac5[_0xfae3('0x2f')][_0xfae3('0x20')]);}_0x3cbea9['order']=qs[_0xfae3('0x39')](_0xdd9ac5[_0xfae3('0x2f')][_0xfae3('0x39')]);_0x3cbea9[_0xfae3('0x3a')]=qs['filters'](_[_0xfae3('0x3b')](_0xdd9ac5[_0xfae3('0x2f')],_0x4c6d78['filters']),_0x54a5e2);if(_0xdd9ac5[_0xfae3('0x2f')][_0xfae3('0x3c')]){_0x3cbea9[_0xfae3('0x3a')]=_['merge'](_0x3cbea9[_0xfae3('0x3a')],{'$or':_[_0xfae3('0x2a')](_0x54a5e2,function(_0x531b82){if(_0x531b82['type']!==_0xfae3('0x3d')){var _0x7e425={};_0x7e425[_0x531b82['name']]={'$like':'%'+_0xdd9ac5[_0xfae3('0x2f')][_0xfae3('0x3c')]+'%'};return _0x7e425;}})});}_0x3cbea9=_[_0xfae3('0x3e')]({},_0x3cbea9,_0xdd9ac5[_0xfae3('0x3f')]);var _0x5f593d={'where':_0x3cbea9[_0xfae3('0x3a')]};return db['VtigerField'][_0xfae3('0x1f')](_0x5f593d)[_0xfae3('0x26')](function(_0x2c0779){_0x392930[_0xfae3('0x1f')]=_0x2c0779;if(_0xdd9ac5[_0xfae3('0x2f')][_0xfae3('0x40')]){_0x3cbea9['include']=[{'all':!![]}];}return db[_0xfae3('0x2b')]['findAll'](_0x3cbea9);})[_0xfae3('0x26')](function(_0x1148bb){_0x392930[_0xfae3('0x41')]=_0x1148bb;return _0x392930;})[_0xfae3('0x26')](respondWithFilteredResult(_0x4d0504,_0x3cbea9))[_0xfae3('0x42')](handleError(_0x4d0504,null));};exports[_0xfae3('0x43')]=function(_0x31ea6a,_0x4c37c3){var _0x3d1acd={'raw':!![],'where':{'id':_0x31ea6a[_0xfae3('0x44')]['id']}},_0x38b013={};_0x38b013[_0xfae3('0x36')]=_[_0xfae3('0x30')](db['VtigerField'][_0xfae3('0x2c')]);_0x38b013[_0xfae3('0x2f')]=_['keys'](_0x31ea6a[_0xfae3('0x2f')]);_0x38b013['filters']=_[_0xfae3('0x32')](_0x38b013[_0xfae3('0x36')],_0x38b013['query']);_0x3d1acd['attributes']=_[_0xfae3('0x32')](_0x38b013[_0xfae3('0x36')],qs[_0xfae3('0x33')](_0x31ea6a[_0xfae3('0x2f')][_0xfae3('0x33')]));_0x3d1acd[_0xfae3('0x34')]=_0x3d1acd[_0xfae3('0x34')][_0xfae3('0x35')]?_0x3d1acd[_0xfae3('0x34')]:_0x38b013[_0xfae3('0x36')];if(_0x31ea6a['query'][_0xfae3('0x40')]){_0x3d1acd['include']=[{'all':!![]}];}_0x3d1acd=_[_0xfae3('0x3e')]({},_0x3d1acd,_0x31ea6a[_0xfae3('0x3f')]);return db[_0xfae3('0x2b')][_0xfae3('0x45')](_0x3d1acd)['then'](handleEntityNotFound(_0x4c37c3,null))['then'](respondWithResult(_0x4c37c3,null))[_0xfae3('0x42')](handleError(_0x4c37c3,null));};exports[_0xfae3('0x46')]=function(_0xb9f652,_0x5deabd){return db[_0xfae3('0x2b')][_0xfae3('0x46')](_0xb9f652['body'],{})[_0xfae3('0x26')](respondWithResult(_0x5deabd,0xc9))['catch'](handleError(_0x5deabd,null));};exports[_0xfae3('0x47')]=function(_0x27f021,_0x26e925){if(_0x27f021[_0xfae3('0x48')]['id']){delete _0x27f021[_0xfae3('0x48')]['id'];}return db['VtigerField'][_0xfae3('0x45')]({'where':{'id':_0x27f021['params']['id']}})[_0xfae3('0x26')](handleEntityNotFound(_0x26e925,null))['then'](saveUpdates(_0x27f021[_0xfae3('0x48')],null))[_0xfae3('0x26')](respondWithResult(_0x26e925,null))[_0xfae3('0x42')](handleError(_0x26e925,null));};exports['destroy']=function(_0x5acc88,_0x561a47){return db[_0xfae3('0x2b')][_0xfae3('0x45')]({'where':{'id':_0x5acc88['params']['id']}})[_0xfae3('0x26')](handleEntityNotFound(_0x561a47,null))[_0xfae3('0x26')](removeEntity(_0x561a47,null))['catch'](handleError(_0x561a47,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js
index e0b93d1..5082b22 100644
--- a/server/api/intVtigerField/intVtigerField.model.js
+++ b/server/api/intVtigerField/intVtigerField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['VtigerField','int_vtiger_fields','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerField.attributes','define'];(function(_0x111976,_0x1370f9){var _0x57982c=function(_0x3b30ad){while(--_0x3b30ad){_0x111976['push'](_0x111976['shift']());}};_0x57982c(++_0x1370f9);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x49c4('0xa'),_0x49c4('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x34e8=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x34e8,0x12c));var _0x834e=function(_0x17a9c5,_0x2809d9){_0x17a9c5=_0x17a9c5-0x0;var _0x1e8059=_0x34e8[_0x17a9c5];return _0x1e8059;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[{'name':_0x834e('0xd'),'fields':[_0x834e('0xe'),_0x834e('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js
index 59032ab..ae76889 100644
--- a/server/api/intVtigerField/intVtigerField.rpc.js
+++ b/server/api/intVtigerField/intVtigerField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x20d8=['stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x2916fe,_0x4b5b34){var _0x474a73=function(_0x10b287){while(--_0x10b287){_0x2916fe['push'](_0x2916fe['shift']());}};_0x474a73(++_0x4b5b34);}(_0x20d8,0xee));var _0x820d=function(_0x5f4b29,_0x5b1df1){_0x5f4b29=_0x5f4b29-0x0;var _0x3059c2=_0x20d8[_0x5f4b29];return _0x3059c2;};'use strict';var _=require(_0x820d('0x0'));var util=require(_0x820d('0x1'));var moment=require(_0x820d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x820d('0x3'));var db=require(_0x820d('0x4'))['db'];var utils=require(_0x820d('0x5'));var logger=require(_0x820d('0x6'))(_0x820d('0x7'));var config=require('../../config/environment');var jayson=require(_0x820d('0x8'));var client=jayson[_0x820d('0x9')][_0x820d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e23e3,_0x435a84,_0xa2751d){return new BPromise(function(_0x3b084c,_0x485bde){return client[_0x820d('0xb')](_0x4e23e3,_0xa2751d)['then'](function(_0x45fdd7){logger['info']('VtigerField,\x20%s,\x20%s',_0x435a84,_0x820d('0xc'));logger['debug'](_0x820d('0xd'),_0x435a84,_0x820d('0xc'),JSON[_0x820d('0xe')](_0x45fdd7));if(_0x45fdd7['error']){if(_0x45fdd7[_0x820d('0xf')][_0x820d('0x10')]===0x1f4){logger['error'](_0x820d('0x11'),_0x435a84,_0x45fdd7['error'][_0x820d('0x12')]);return _0x485bde(_0x45fdd7[_0x820d('0xf')][_0x820d('0x12')]);}logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x45fdd7[_0x820d('0xf')]['message']);return _0x3b084c(_0x45fdd7['error'][_0x820d('0x12')]);}else{logger['info'](_0x820d('0x11'),_0x435a84,_0x820d('0xc'));_0x3b084c(_0x45fdd7[_0x820d('0x13')]['message']);}})[_0x820d('0x14')](function(_0x3466c1){logger[_0x820d('0xf')](_0x820d('0x11'),_0x435a84,_0x3466c1);_0x485bde(_0x3466c1);});});}
\ No newline at end of file
+var _0xb7e7=['VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x55f663,_0x4b95b7){var _0x162cdf=function(_0x5d181b){while(--_0x5d181b){_0x55f663['push'](_0x55f663['shift']());}};_0x162cdf(++_0x4b95b7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('VtigerField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js
index ac07c84..bc18dff 100644
--- a/server/api/intZendeskAccount/index.js
+++ b/server/api/intZendeskAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x518f=['isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get'];(function(_0x4f24f6,_0x25e034){var _0x4f63f9=function(_0x104e13){while(--_0x104e13){_0x4f24f6['push'](_0x4f24f6['shift']());}};_0x4f63f9(++_0x25e034);}(_0x518f,0x1f1));var _0xf518=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x518f[_0x65c903];return _0x23e1d7;};'use strict';var multer=require(_0xf518('0x0'));var util=require('util');var path=require(_0xf518('0x1'));var timeout=require(_0xf518('0x2'));var express=require(_0xf518('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf518('0x4'));var config=require(_0xf518('0x5'));var controller=require('./intZendeskAccount.controller');router[_0xf518('0x6')]('/',auth[_0xf518('0x7')](),controller[_0xf518('0x8')]);router[_0xf518('0x6')]('/:id',auth[_0xf518('0x7')](),controller[_0xf518('0x9')]);router[_0xf518('0x6')](_0xf518('0xa'),auth[_0xf518('0x7')](),controller['getConfigurations']);router['get'](_0xf518('0xb'),auth[_0xf518('0x7')](),controller[_0xf518('0xc')]);router[_0xf518('0xd')]('/',auth[_0xf518('0x7')](),controller[_0xf518('0xe')]);router[_0xf518('0xd')](_0xf518('0xa'),auth['isAuthenticated'](),controller[_0xf518('0xf')]);router[_0xf518('0x10')](_0xf518('0x11'),auth[_0xf518('0x7')](),controller['update']);router[_0xf518('0x12')](_0xf518('0x11'),auth[_0xf518('0x7')](),controller[_0xf518('0x13')]);module[_0xf518('0x14')]=router;
\ No newline at end of file
+var _0x54df=['update','destroy','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id'];(function(_0x5d16f2,_0x4d2c39){var _0x557378=function(_0x123216){while(--_0x123216){_0x5d16f2['push'](_0x5d16f2['shift']());}};_0x557378(++_0x4d2c39);}(_0x54df,0x1c4));var _0xf54d=function(_0x5ae025,_0x41964d){_0x5ae025=_0x5ae025-0x0;var _0x35523b=_0x54df[_0x5ae025];return _0x35523b;};'use strict';var multer=require('multer');var util=require(_0xf54d('0x0'));var path=require('path');var timeout=require(_0xf54d('0x1'));var express=require(_0xf54d('0x2'));var router=express['Router']();var auth=require(_0xf54d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf54d('0x4'));var controller=require(_0xf54d('0x5'));router[_0xf54d('0x6')]('/',auth[_0xf54d('0x7')](),controller['index']);router[_0xf54d('0x6')]('/:id',auth[_0xf54d('0x7')](),controller['show']);router[_0xf54d('0x6')](_0xf54d('0x8'),auth['isAuthenticated'](),controller[_0xf54d('0x9')]);router[_0xf54d('0x6')](_0xf54d('0xa'),auth[_0xf54d('0x7')](),controller[_0xf54d('0xb')]);router[_0xf54d('0xc')]('/',auth[_0xf54d('0x7')](),controller[_0xf54d('0xd')]);router[_0xf54d('0xc')](_0xf54d('0x8'),auth[_0xf54d('0x7')](),controller[_0xf54d('0xe')]);router['put'](_0xf54d('0xf'),auth['isAuthenticated'](),controller[_0xf54d('0x10')]);router['delete'](_0xf54d('0xf'),auth[_0xf54d('0x7')](),controller[_0xf54d('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js
index 2c1e9d0..619eb4b 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.attributes.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8836=['exports','STRING','username','remoteUri','ENUM','token','password','integrationTab','newTab','sequelize'];(function(_0x38a616,_0x4cfea9){var _0x46e2e6=function(_0xb082c3){while(--_0xb082c3){_0x38a616['push'](_0x38a616['shift']());}};_0x46e2e6(++_0x4cfea9);}(_0x8836,0x199));var _0x6883=function(_0x2b6473,_0xaa5ff3){_0x2b6473=_0x2b6473-0x0;var _0x4e7348=_0x8836[_0x2b6473];return _0x4e7348;};'use strict';var Sequelize=require(_0x6883('0x0'));module[_0x6883('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6883('0x2')],'unique':_0x6883('0x3')},'password':{'type':Sequelize[_0x6883('0x2')]},'token':{'type':Sequelize[_0x6883('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x6883('0x4')},'authType':{'type':Sequelize[_0x6883('0x5')]('password',_0x6883('0x6')),'defaultValue':_0x6883('0x7')},'serverUrl':{'type':Sequelize[_0x6883('0x2')]},'type':{'type':Sequelize[_0x6883('0x5')](_0x6883('0x8'),_0x6883('0x9')),'defaultValue':_0x6883('0x8')}};
\ No newline at end of file
+var _0x127c=['token','ENUM','integrationTab','exports','STRING','username','remoteUri','password'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x127c,0xe3));var _0xc127=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x127c[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0xc127('0x0')]={'name':{'type':Sequelize[_0xc127('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc127('0x1')],'unique':_0xc127('0x2')},'password':{'type':Sequelize[_0xc127('0x1')]},'token':{'type':Sequelize[_0xc127('0x1')]},'remoteUri':{'type':Sequelize[_0xc127('0x1')],'unique':_0xc127('0x3')},'authType':{'type':Sequelize['ENUM'](_0xc127('0x4'),_0xc127('0x5')),'defaultValue':_0xc127('0x4')},'serverUrl':{'type':Sequelize[_0xc127('0x1')]},'type':{'type':Sequelize[_0xc127('0x6')](_0xc127('0x7'),'newTab'),'defaultValue':_0xc127('0x7')}};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js
index e2a7858..94e34fb 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.controller.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x263b=['findOne','AccountId','getSubjects','channel','getDescriptions','Subjects','ZendeskField','Descriptions','getFields','username','token','authType','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','password','toString','base64','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','title','position','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','ZendeskAccount,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','fields','attributes','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','keys','intersection','find','create','body','update','params','ZendeskConfiguration','length','getConfigurations','hasOwnProperty','nolimit','addConfiguration'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x263b,0x12b));var _0xb263=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x263b[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0xb263('0x0'));var emlformat=require(_0xb263('0x1'));var rimraf=require(_0xb263('0x2'));var zipdir=require(_0xb263('0x3'));var jsonpatch=require(_0xb263('0x4'));var rp=require('request-promise');var moment=require(_0xb263('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb263('0x6'));var sox=require(_0xb263('0x7'));var csv=require(_0xb263('0x8'));var ejs=require(_0xb263('0x9'));var fs=require('fs');var _=require(_0xb263('0xa'));var squel=require(_0xb263('0xb'));var crypto=require(_0xb263('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb263('0xd'));var toCsv=require(_0xb263('0x8'));var querystring=require('querystring');var Papa=require(_0xb263('0xe'));var Redis=require(_0xb263('0xf'));var authService=require(_0xb263('0x10'));var qs=require(_0xb263('0x11'));var as=require(_0xb263('0x12'));var hardwareService=require(_0xb263('0x13'));var logger=require(_0xb263('0x14'))('api');var utils=require(_0xb263('0x15'));var config=require(_0xb263('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xb263('0x17'));var client=jayson[_0xb263('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x2af8be,_0x3fcdb6,_0x3567e9){if(_0x3567e9){var _0x3f6f24=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f6f24['test'](_0x3fcdb6)){return _0x2af8be;}else{throw new db[(_0xb263('0x19'))][(_0xb263('0x1a'))](_0xb263('0x1b'));}}else{return _0x2af8be;}}function respondWithRpcPromise(_0x13f63c,_0x38ef28,_0x253872,_0x48210c){return new BPromise(function(_0x369677,_0x3f4888){var _0x561a50=_0x48210c||client;return _0x561a50[_0xb263('0x1c')](_0x13f63c,_0x253872)[_0xb263('0x1d')](function(_0x48caa9){logger[_0xb263('0x1e')]('ZendeskAccount,\x20%s,\x20%s',_0x38ef28,_0xb263('0x1f'));logger[_0xb263('0x20')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x38ef28,_0xb263('0x1f'),JSON['stringify'](_0x48caa9));if(_0x48caa9['error']){if(_0x48caa9[_0xb263('0x21')]['code']===0x1f4){logger[_0xb263('0x21')](_0xb263('0x22'),_0x38ef28,_0x48caa9['error']['message']);return _0x3f4888(_0x48caa9[_0xb263('0x21')][_0xb263('0x23')]);}logger['error'](_0xb263('0x22'),_0x38ef28,_0x48caa9['error'][_0xb263('0x23')]);return _0x369677(_0x48caa9[_0xb263('0x21')]['message']);}else{logger['info'](_0xb263('0x22'),_0x38ef28,_0xb263('0x1f'));_0x369677(_0x48caa9[_0xb263('0x24')][_0xb263('0x23')]);}})['catch'](function(_0x144d3a){logger[_0xb263('0x21')](_0xb263('0x22'),_0x38ef28,_0x144d3a);_0x3f4888(_0x144d3a);});});}function respondWithStatusCode(_0x48df4d,_0x4d3ccd){_0x4d3ccd=_0x4d3ccd||0xcc;return function(_0x46b705){if(_0x46b705){return _0x48df4d[_0xb263('0x25')](_0x4d3ccd);}return _0x48df4d['status'](_0x4d3ccd)[_0xb263('0x26')]();};}function respondWithResult(_0x20e8f6,_0x2aadbe){_0x2aadbe=_0x2aadbe||0xc8;return function(_0x2e93b8){if(_0x2e93b8){return _0x20e8f6[_0xb263('0x27')](_0x2aadbe)[_0xb263('0x28')](_0x2e93b8);}};}function respondWithFilteredResult(_0x56907e,_0x507c06){return function(_0x2f55d1){if(_0x2f55d1){var _0x4d00ef=_0x2f55d1['count'],_0x59e04a=_0x507c06[_0xb263('0x29')],_0x141bc1=_0x507c06[_0xb263('0x29')]+_0x507c06[_0xb263('0x2a')],_0x506246;if(_0x141bc1>=_0x4d00ef){_0x141bc1=_0x4d00ef;_0x506246=0xc8;}else{_0x506246=0xce;}_0x56907e[_0xb263('0x27')](_0x506246);return _0x56907e[_0xb263('0x2b')](_0xb263('0x2c'),_0x59e04a+'-'+_0x141bc1+'/'+_0x4d00ef)[_0xb263('0x28')](_0x2f55d1);}return null;};}function patchUpdates(_0x411bea){return function(_0x314863){try{jsonpatch[_0xb263('0x2d')](_0x314863,_0x411bea,!![]);}catch(_0x276368){return BPromise[_0xb263('0x2e')](_0x276368);}return _0x314863[_0xb263('0x2f')]();};}function saveUpdates(_0x1fd8d0,_0x2690d2){return function(_0xbfecda){if(_0xbfecda){return _0xbfecda['update'](_0x1fd8d0)['then'](function(_0x54f3d1){return _0x54f3d1;});}return null;};}function removeEntity(_0x258312,_0x19ac96){return function(_0x3215c8){if(_0x3215c8){return _0x3215c8[_0xb263('0x30')]()[_0xb263('0x1d')](function(){_0x258312['status'](0xcc)[_0xb263('0x26')]();});}};}function handleEntityNotFound(_0x3e3ac6,_0x248c63){return function(_0x531c2e){if(!_0x531c2e){_0x3e3ac6[_0xb263('0x25')](0x194);}return _0x531c2e;};}function handleError(_0x452f02,_0x537ab5){_0x537ab5=_0x537ab5||0x1f4;return function(_0x270162){logger[_0xb263('0x21')](_0x270162[_0xb263('0x31')]);if(_0x270162[_0xb263('0x32')]){delete _0x270162[_0xb263('0x32')];}_0x452f02[_0xb263('0x27')](_0x537ab5)[_0xb263('0x33')](_0x270162);};}exports[_0xb263('0x34')]=function(_0x391a47,_0x243ae0){var _0x16d68c={},_0xac8784={},_0x45c2ee={'count':0x0,'rows':[]};var _0x59891a=_[_0xb263('0x35')](db[_0xb263('0x36')][_0xb263('0x37')],function(_0x4c9fa9){return{'name':_0x4c9fa9[_0xb263('0x38')],'type':_0x4c9fa9[_0xb263('0x39')][_0xb263('0x3a')]};});_0xac8784[_0xb263('0x3b')]=_[_0xb263('0x35')](_0x59891a,_0xb263('0x32'));_0xac8784[_0xb263('0x3c')]=_['keys'](_0x391a47[_0xb263('0x3c')]);_0xac8784['filters']=_['intersection'](_0xac8784[_0xb263('0x3b')],_0xac8784['query']);_0x16d68c['attributes']=_['intersection'](_0xac8784[_0xb263('0x3b')],qs['fields'](_0x391a47[_0xb263('0x3c')][_0xb263('0x3d')]));_0x16d68c['attributes']=_0x16d68c[_0xb263('0x3e')]['length']?_0x16d68c[_0xb263('0x3e')]:_0xac8784[_0xb263('0x3b')];if(!_0x391a47['query']['hasOwnProperty']('nolimit')){_0x16d68c[_0xb263('0x2a')]=qs[_0xb263('0x2a')](_0x391a47['query'][_0xb263('0x2a')]);_0x16d68c[_0xb263('0x29')]=qs['offset'](_0x391a47['query'][_0xb263('0x29')]);}_0x16d68c[_0xb263('0x3f')]=qs[_0xb263('0x40')](_0x391a47[_0xb263('0x3c')][_0xb263('0x40')]);_0x16d68c[_0xb263('0x41')]=qs[_0xb263('0x42')](_[_0xb263('0x43')](_0x391a47[_0xb263('0x3c')],_0xac8784[_0xb263('0x42')]),_0x59891a);if(_0x391a47[_0xb263('0x3c')][_0xb263('0x44')]){_0x16d68c[_0xb263('0x41')]=_[_0xb263('0x45')](_0x16d68c['where'],{'$or':_[_0xb263('0x35')](_0x59891a,function(_0x1b7fa6){if(_0x1b7fa6[_0xb263('0x39')]!=='VIRTUAL'){var _0x28e531={};_0x28e531[_0x1b7fa6[_0xb263('0x32')]]={'$like':'%'+_0x391a47['query'][_0xb263('0x44')]+'%'};return _0x28e531;}})});}_0x16d68c=_[_0xb263('0x45')]({},_0x16d68c,_0x391a47[_0xb263('0x46')]);var _0x5d6916={'where':_0x16d68c[_0xb263('0x41')]};return db[_0xb263('0x36')][_0xb263('0x47')](_0x5d6916)[_0xb263('0x1d')](function(_0x4a9f4c){_0x45c2ee[_0xb263('0x47')]=_0x4a9f4c;if(_0x391a47[_0xb263('0x3c')][_0xb263('0x48')]){_0x16d68c[_0xb263('0x49')]=[{'all':!![]}];}return db[_0xb263('0x36')][_0xb263('0x4a')](_0x16d68c);})[_0xb263('0x1d')](function(_0x4c1713){_0x45c2ee[_0xb263('0x4b')]=_0x4c1713;return _0x45c2ee;})[_0xb263('0x1d')](respondWithFilteredResult(_0x243ae0,_0x16d68c))[_0xb263('0x4c')](handleError(_0x243ae0,null));};exports[_0xb263('0x4d')]=function(_0x410948,_0x177229){var _0x58a13f={'raw':![],'where':{'id':_0x410948['params']['id']}},_0x3bc61c={};_0x3bc61c[_0xb263('0x3b')]=_[_0xb263('0x4e')](db[_0xb263('0x36')][_0xb263('0x37')]);_0x3bc61c[_0xb263('0x3c')]=_[_0xb263('0x4e')](_0x410948[_0xb263('0x3c')]);_0x3bc61c['filters']=_[_0xb263('0x4f')](_0x3bc61c[_0xb263('0x3b')],_0x3bc61c[_0xb263('0x3c')]);_0x58a13f[_0xb263('0x3e')]=_['intersection'](_0x3bc61c[_0xb263('0x3b')],qs[_0xb263('0x3d')](_0x410948[_0xb263('0x3c')][_0xb263('0x3d')]));_0x58a13f['attributes']=_0x58a13f[_0xb263('0x3e')]['length']?_0x58a13f[_0xb263('0x3e')]:_0x3bc61c[_0xb263('0x3b')];if(_0x410948[_0xb263('0x3c')][_0xb263('0x48')]){_0x58a13f[_0xb263('0x49')]=[{'all':!![]}];}_0x58a13f=_['merge']({},_0x58a13f,_0x410948['options']);return db[_0xb263('0x36')][_0xb263('0x50')](_0x58a13f)[_0xb263('0x1d')](handleEntityNotFound(_0x177229,null))[_0xb263('0x1d')](respondWithResult(_0x177229,null))[_0xb263('0x4c')](handleError(_0x177229,null));};exports['create']=function(_0x4a99f7,_0x5e48a3){return db[_0xb263('0x36')][_0xb263('0x51')](_0x4a99f7[_0xb263('0x52')],{})[_0xb263('0x1d')](respondWithResult(_0x5e48a3,0xc9))[_0xb263('0x4c')](handleError(_0x5e48a3,null));};exports[_0xb263('0x53')]=function(_0x5802f0,_0x57cd01){if(_0x5802f0[_0xb263('0x52')]['id']){delete _0x5802f0[_0xb263('0x52')]['id'];}return db[_0xb263('0x36')][_0xb263('0x50')]({'where':{'id':_0x5802f0[_0xb263('0x54')]['id']}})[_0xb263('0x1d')](handleEntityNotFound(_0x57cd01,null))[_0xb263('0x1d')](saveUpdates(_0x5802f0[_0xb263('0x52')],null))[_0xb263('0x1d')](respondWithResult(_0x57cd01,null))[_0xb263('0x4c')](handleError(_0x57cd01,null));};exports[_0xb263('0x30')]=function(_0x25d169,_0x41b36e){return db['ZendeskAccount'][_0xb263('0x50')]({'where':{'id':_0x25d169[_0xb263('0x54')]['id']}})[_0xb263('0x1d')](handleEntityNotFound(_0x41b36e,null))[_0xb263('0x1d')](removeEntity(_0x41b36e,null))[_0xb263('0x4c')](handleError(_0x41b36e,null));};exports['getConfigurations']=function(_0x18ac53,_0x369cf1,_0x1b9ccb){var _0x13099b={};var _0x1ec46f={};var _0x32cc05;var _0x1aaa52;return db[_0xb263('0x36')]['findOne']({'where':{'id':_0x18ac53['params']['id']}})['then'](handleEntityNotFound(_0x369cf1,null))[_0xb263('0x1d')](function(_0xd72407){if(_0xd72407){_0x32cc05=_0xd72407;_0x1ec46f['model']=_['keys'](db[_0xb263('0x55')][_0xb263('0x37')]);_0x1ec46f[_0xb263('0x3c')]=_[_0xb263('0x4e')](_0x18ac53[_0xb263('0x3c')]);_0x1ec46f['filters']=_[_0xb263('0x4f')](_0x1ec46f['model'],_0x1ec46f[_0xb263('0x3c')]);_0x13099b[_0xb263('0x3e')]=_[_0xb263('0x4f')](_0x1ec46f[_0xb263('0x3b')],qs[_0xb263('0x3d')](_0x18ac53[_0xb263('0x3c')]['fields']));_0x13099b[_0xb263('0x3e')]=_0x13099b['attributes'][_0xb263('0x56')]?_0x13099b[_0xb263('0x3e')]:_0x1ec46f[_0xb263('0x3b')];_0x13099b[_0xb263('0x3f')]=qs[_0xb263('0x40')](_0x18ac53[_0xb263('0x3c')]['sort']);_0x13099b[_0xb263('0x41')]=qs[_0xb263('0x42')](_['pick'](_0x18ac53[_0xb263('0x3c')],_0x1ec46f[_0xb263('0x42')]));if(_0x18ac53[_0xb263('0x3c')][_0xb263('0x44')]){_0x13099b[_0xb263('0x41')]=_['merge'](_0x13099b[_0xb263('0x41')],{'$or':_['map'](_0x13099b[_0xb263('0x3e')],function(_0x5d2e66){var _0x258f8e={};_0x258f8e[_0x5d2e66]={'$like':'%'+_0x18ac53[_0xb263('0x3c')][_0xb263('0x44')]+'%'};return _0x258f8e;})});}_0x13099b=_[_0xb263('0x45')]({},_0x13099b,_0x18ac53[_0xb263('0x46')]);return _0x32cc05[_0xb263('0x57')](_0x13099b);}})[_0xb263('0x1d')](function(_0x1a678a){if(_0x1a678a){_0x1aaa52=_0x1a678a['length'];if(!_0x18ac53[_0xb263('0x3c')][_0xb263('0x58')](_0xb263('0x59'))){_0x13099b[_0xb263('0x2a')]=qs['limit'](_0x18ac53['query'][_0xb263('0x2a')]);_0x13099b[_0xb263('0x29')]=qs[_0xb263('0x29')](_0x18ac53[_0xb263('0x3c')]['offset']);}return _0x32cc05[_0xb263('0x57')](_0x13099b);}})[_0xb263('0x1d')](function(_0x2c892d){if(_0x2c892d){return _0x2c892d?{'count':_0x1aaa52,'rows':_0x2c892d}:null;}})['then'](respondWithResult(_0x369cf1,null))[_0xb263('0x4c')](handleError(_0x369cf1,null));};exports[_0xb263('0x5a')]=function(_0x36631d,_0x2e4596,_0x3bc595){if(_0x36631d['body']['id']){delete _0x36631d[_0xb263('0x52')]['id'];}return db[_0xb263('0x36')][_0xb263('0x5b')]({'where':{'id':_0x36631d[_0xb263('0x54')]['id']}})[_0xb263('0x1d')](handleEntityNotFound(_0x2e4596,null))[_0xb263('0x1d')](function(_0xaa739d){if(_0xaa739d){_0x36631d[_0xb263('0x52')][_0xb263('0x5c')]=_0xaa739d['id'];_0x36631d['body']['Subjects']=integrations[_0xb263('0x5d')](_0x36631d[_0xb263('0x52')][_0xb263('0x5e')],_0x36631d[_0xb263('0x52')][_0xb263('0x39')]);_0x36631d[_0xb263('0x52')]['Descriptions']=integrations[_0xb263('0x5f')](_0x36631d[_0xb263('0x52')][_0xb263('0x5e')],_0x36631d[_0xb263('0x52')]['type']);return db[_0xb263('0x55')][_0xb263('0x51')](_0x36631d[_0xb263('0x52')],{'include':[{'model':db['ZendeskField'],'as':_0xb263('0x60')},{'model':db[_0xb263('0x61')],'as':_0xb263('0x62')}]});}return null;})['then'](respondWithResult(_0x2e4596,null))[_0xb263('0x4c')](handleError(_0x2e4596,null));};exports[_0xb263('0x63')]=function(_0x129fb1,_0x3c1312,_0x1ba275){var _0x43763c='';return db[_0xb263('0x36')][_0xb263('0x5b')]({'where':{'id':_0x129fb1[_0xb263('0x54')]['id']},'attributes':['id',_0xb263('0x64'),'password',_0xb263('0x65'),_0xb263('0x66'),'remoteUri']})[_0xb263('0x1d')](handleEntityNotFound(_0x3c1312,null))['then'](function(_0x5a43c5){if(_0x5a43c5){_0x43763c=_0x5a43c5[_0xb263('0x67')];var _0x4daccd=_0x43763c[_0xb263('0x68')](-0x1);if(_0x4daccd==='/'){_0x43763c=_0x43763c['substring'](0x0,_0x43763c[_0xb263('0x69')](_0x4daccd));}var _0x23c133={'method':_0xb263('0x6a'),'uri':util[_0xb263('0x6b')](_0xb263('0x6c'),_0x43763c,_0xb263('0x6d')),'json':!![]};switch(_0x5a43c5[_0xb263('0x66')]){case'password':_0x23c133[_0xb263('0x6e')]={'Authorization':util['format'](_0xb263('0x6f'),new Buffer(util[_0xb263('0x6b')](_0xb263('0x70'),_0x5a43c5['username'],_0x5a43c5[_0xb263('0x71')]))[_0xb263('0x72')](_0xb263('0x73')))};break;case _0xb263('0x65'):_0x23c133['headers']={'Authorization':util[_0xb263('0x6b')](_0xb263('0x6f'),new Buffer(util[_0xb263('0x6b')]('%s/token:%s',_0x5a43c5['username'],_0x5a43c5[_0xb263('0x65')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0xb263('0x1a'))](_0xb263('0x74'));}return rp(_0x23c133);}})['then'](function(_0x4b0d12){if(_0x4b0d12){var _0x2b3145=[_0xb263('0x75'),_0xb263('0x76'),'group',_0xb263('0x77')];_[_0xb263('0x78')](_0x4b0d12[_0xb263('0x6d')],function(_0x514212){return _0x2b3145[_0xb263('0x79')](_0x514212[_0xb263('0x39')]);});return{'count':_0x4b0d12[_0xb263('0x6d')][_0xb263('0x56')],'rows':_['map'](_0x4b0d12[_0xb263('0x6d')],function(_0x3d483f){return{'id':_0x3d483f['id'],'name':_0x3d483f['position']>0x7?_0x3d483f[_0xb263('0x7a')]:_0x3d483f[_0xb263('0x39')],'custom':_0x3d483f[_0xb263('0x7b')]>0x7?!![]:![],'options':_0x3d483f['system_field_options']?_0x3d483f['system_field_options']:_0x3d483f[_0xb263('0x7c')]?_0x3d483f[_0xb263('0x7c')]:[]};})};}})[_0xb263('0x1d')](respondWithResult(_0x3c1312,null))[_0xb263('0x4c')](function(_0x359e99){var _0x3b26a9=_0x129fb1[_0xb263('0x3c')]['test']?0x1f4:_0x359e99['statusCode']||0x1f4;logger[_0xb263('0x21')](_0xb263('0x7d'),_0xb263('0x63'),_0x3b26a9,JSON[_0xb263('0x7e')](_0x359e99));delete _0x359e99['name'];if(_0x3b26a9===0x191){_0x3b26a9=0x190;}_0x3c1312[_0xb263('0x27')](_0x3b26a9)[_0xb263('0x33')](_0x129fb1['query'][_0xb263('0x7f')]?{'message':_0xb263('0x80'),'statusCode':_0x359e99[_0xb263('0x81')]}:_0x359e99);});};
\ No newline at end of file
+var _0x833f=['json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','options','includeAll','ZendeskAccount','findAll','rows','catch','params','include','find','create','body','update','ZendeskConfiguration','filter','hasOwnProperty','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','findOne','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','group','remove','includes','title','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','ValidationError','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','sendStatus','status','end'];(function(_0x252b99,_0x1f81b4){var _0x56800f=function(_0x134c8a){while(--_0x134c8a){_0x252b99['push'](_0x252b99['shift']());}};_0x56800f(++_0x1f81b4);}(_0x833f,0xdf));var _0xf833=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x833f[_0x58dc25];return _0x21b0a7;};'use strict';var pdf=require(_0xf833('0x0'));var emlformat=require(_0xf833('0x1'));var rimraf=require(_0xf833('0x2'));var zipdir=require(_0xf833('0x3'));var jsonpatch=require(_0xf833('0x4'));var rp=require(_0xf833('0x5'));var moment=require(_0xf833('0x6'));var BPromise=require(_0xf833('0x7'));var Mustache=require(_0xf833('0x8'));var util=require(_0xf833('0x9'));var path=require(_0xf833('0xa'));var sox=require(_0xf833('0xb'));var csv=require(_0xf833('0xc'));var ejs=require(_0xf833('0xd'));var fs=require('fs');var _=require(_0xf833('0xe'));var squel=require(_0xf833('0xf'));var crypto=require(_0xf833('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xf833('0x11'));var toCsv=require(_0xf833('0xc'));var querystring=require(_0xf833('0x12'));var Papa=require(_0xf833('0x13'));var Redis=require(_0xf833('0x14'));var authService=require(_0xf833('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf833('0x16'));var utils=require('../../config/utils');var config=require(_0xf833('0x17'));var db=require(_0xf833('0x18'))['db'];var integrations=require(_0xf833('0x19'));var jayson=require('jayson/promise');var client=jayson[_0xf833('0x1a')][_0xf833('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4675b9,_0xa52ee3,_0xcbfac5){if(_0xcbfac5){var _0x438fa5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x438fa5['test'](_0xa52ee3)){return _0x4675b9;}else{throw new db['Sequelize'][(_0xf833('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4675b9;}}function respondWithRpcPromise(_0xea628a,_0x3b6f03,_0x1b7649,_0x768ffa){return new BPromise(function(_0x1d644d,_0x486f1c){var _0x197c2f=_0x768ffa||client;return _0x197c2f[_0xf833('0x1d')](_0xea628a,_0x1b7649)[_0xf833('0x1e')](function(_0x5a331){logger[_0xf833('0x1f')]('ZendeskAccount,\x20%s,\x20%s',_0x3b6f03,_0xf833('0x20'));logger[_0xf833('0x21')](_0xf833('0x22'),_0x3b6f03,_0xf833('0x20'),JSON[_0xf833('0x23')](_0x5a331));if(_0x5a331[_0xf833('0x24')]){if(_0x5a331['error'][_0xf833('0x25')]===0x1f4){logger[_0xf833('0x24')]('ZendeskAccount,\x20%s,\x20%s',_0x3b6f03,_0x5a331[_0xf833('0x24')]['message']);return _0x486f1c(_0x5a331['error'][_0xf833('0x26')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x3b6f03,_0x5a331[_0xf833('0x24')][_0xf833('0x26')]);return _0x1d644d(_0x5a331[_0xf833('0x24')][_0xf833('0x26')]);}else{logger[_0xf833('0x1f')]('ZendeskAccount,\x20%s,\x20%s',_0x3b6f03,_0xf833('0x20'));_0x1d644d(_0x5a331['result'][_0xf833('0x26')]);}})['catch'](function(_0x1c433c){logger[_0xf833('0x24')](_0xf833('0x27'),_0x3b6f03,_0x1c433c);_0x486f1c(_0x1c433c);});});}function respondWithStatusCode(_0x7f4c13,_0x6b4830){_0x6b4830=_0x6b4830||0xcc;return function(_0x580b94){if(_0x580b94){return _0x7f4c13[_0xf833('0x28')](_0x6b4830);}return _0x7f4c13[_0xf833('0x29')](_0x6b4830)[_0xf833('0x2a')]();};}function respondWithResult(_0x4d4483,_0x54e1bb){_0x54e1bb=_0x54e1bb||0xc8;return function(_0x4475fa){if(_0x4475fa){return _0x4d4483[_0xf833('0x29')](_0x54e1bb)[_0xf833('0x2b')](_0x4475fa);}};}function respondWithFilteredResult(_0x2a58b3,_0x5c7d91){return function(_0x477a32){if(_0x477a32){var _0xc946b6=_0x477a32[_0xf833('0x2c')],_0x17e144=_0x5c7d91[_0xf833('0x2d')],_0x358338=_0x5c7d91['offset']+_0x5c7d91[_0xf833('0x2e')],_0x311339;if(_0x358338>=_0xc946b6){_0x358338=_0xc946b6;_0x311339=0xc8;}else{_0x311339=0xce;}_0x2a58b3[_0xf833('0x29')](_0x311339);return _0x2a58b3[_0xf833('0x2f')](_0xf833('0x30'),_0x17e144+'-'+_0x358338+'/'+_0xc946b6)[_0xf833('0x2b')](_0x477a32);}return null;};}function patchUpdates(_0x47d29c){return function(_0x32396a){try{jsonpatch[_0xf833('0x31')](_0x32396a,_0x47d29c,!![]);}catch(_0x935505){return BPromise[_0xf833('0x32')](_0x935505);}return _0x32396a[_0xf833('0x33')]();};}function saveUpdates(_0x5d37fe,_0xdf031b){return function(_0xf87b7f){if(_0xf87b7f){return _0xf87b7f['update'](_0x5d37fe)[_0xf833('0x1e')](function(_0x47f18e){return _0x47f18e;});}return null;};}function removeEntity(_0x4e4865,_0x359bab){return function(_0x2a34ae){if(_0x2a34ae){return _0x2a34ae[_0xf833('0x34')]()['then'](function(){_0x4e4865[_0xf833('0x29')](0xcc)[_0xf833('0x2a')]();});}};}function handleEntityNotFound(_0x57d462,_0x37512d){return function(_0x278909){if(!_0x278909){_0x57d462[_0xf833('0x28')](0x194);}return _0x278909;};}function handleError(_0x47b078,_0x2907b4){_0x2907b4=_0x2907b4||0x1f4;return function(_0x2d91f5){logger[_0xf833('0x24')](_0x2d91f5[_0xf833('0x35')]);if(_0x2d91f5['name']){delete _0x2d91f5[_0xf833('0x36')];}_0x47b078['status'](_0x2907b4)[_0xf833('0x37')](_0x2d91f5);};}exports[_0xf833('0x38')]=function(_0x5fd1ae,_0x4b0c03){var _0x52e01c={},_0x2a79f4={},_0x4c9bdf={'count':0x0,'rows':[]};var _0x3950ce=_[_0xf833('0x39')](db['ZendeskAccount'][_0xf833('0x3a')],function(_0x666361){return{'name':_0x666361[_0xf833('0x3b')],'type':_0x666361[_0xf833('0x3c')][_0xf833('0x3d')]};});_0x2a79f4[_0xf833('0x3e')]=_['map'](_0x3950ce,'name');_0x2a79f4[_0xf833('0x3f')]=_[_0xf833('0x40')](_0x5fd1ae[_0xf833('0x3f')]);_0x2a79f4[_0xf833('0x41')]=_[_0xf833('0x42')](_0x2a79f4['model'],_0x2a79f4[_0xf833('0x3f')]);_0x52e01c[_0xf833('0x43')]=_['intersection'](_0x2a79f4[_0xf833('0x3e')],qs[_0xf833('0x44')](_0x5fd1ae['query'][_0xf833('0x44')]));_0x52e01c[_0xf833('0x43')]=_0x52e01c[_0xf833('0x43')][_0xf833('0x45')]?_0x52e01c['attributes']:_0x2a79f4[_0xf833('0x3e')];if(!_0x5fd1ae[_0xf833('0x3f')]['hasOwnProperty'](_0xf833('0x46'))){_0x52e01c['limit']=qs[_0xf833('0x2e')](_0x5fd1ae[_0xf833('0x3f')]['limit']);_0x52e01c[_0xf833('0x2d')]=qs[_0xf833('0x2d')](_0x5fd1ae[_0xf833('0x3f')]['offset']);}_0x52e01c[_0xf833('0x47')]=qs['sort'](_0x5fd1ae[_0xf833('0x3f')][_0xf833('0x48')]);_0x52e01c['where']=qs[_0xf833('0x41')](_[_0xf833('0x49')](_0x5fd1ae[_0xf833('0x3f')],_0x2a79f4[_0xf833('0x41')]),_0x3950ce);if(_0x5fd1ae[_0xf833('0x3f')]['filter']){_0x52e01c[_0xf833('0x4a')]=_[_0xf833('0x4b')](_0x52e01c[_0xf833('0x4a')],{'$or':_[_0xf833('0x39')](_0x3950ce,function(_0xbe37db){if(_0xbe37db[_0xf833('0x3c')]!=='VIRTUAL'){var _0x2d2e4d={};_0x2d2e4d[_0xbe37db['name']]={'$like':'%'+_0x5fd1ae[_0xf833('0x3f')]['filter']+'%'};return _0x2d2e4d;}})});}_0x52e01c=_['merge']({},_0x52e01c,_0x5fd1ae[_0xf833('0x4c')]);var _0x1e75de={'where':_0x52e01c[_0xf833('0x4a')]};return db['ZendeskAccount'][_0xf833('0x2c')](_0x1e75de)[_0xf833('0x1e')](function(_0x179fc7){_0x4c9bdf[_0xf833('0x2c')]=_0x179fc7;if(_0x5fd1ae['query'][_0xf833('0x4d')]){_0x52e01c['include']=[{'all':!![]}];}return db[_0xf833('0x4e')][_0xf833('0x4f')](_0x52e01c);})[_0xf833('0x1e')](function(_0x5c76d3){_0x4c9bdf[_0xf833('0x50')]=_0x5c76d3;return _0x4c9bdf;})[_0xf833('0x1e')](respondWithFilteredResult(_0x4b0c03,_0x52e01c))[_0xf833('0x51')](handleError(_0x4b0c03,null));};exports['show']=function(_0x1035e5,_0x73e33e){var _0x331fbb={'raw':![],'where':{'id':_0x1035e5[_0xf833('0x52')]['id']}},_0x7c7bfb={};_0x7c7bfb[_0xf833('0x3e')]=_['keys'](db[_0xf833('0x4e')][_0xf833('0x3a')]);_0x7c7bfb[_0xf833('0x3f')]=_[_0xf833('0x40')](_0x1035e5[_0xf833('0x3f')]);_0x7c7bfb[_0xf833('0x41')]=_[_0xf833('0x42')](_0x7c7bfb[_0xf833('0x3e')],_0x7c7bfb['query']);_0x331fbb['attributes']=_['intersection'](_0x7c7bfb[_0xf833('0x3e')],qs[_0xf833('0x44')](_0x1035e5[_0xf833('0x3f')][_0xf833('0x44')]));_0x331fbb['attributes']=_0x331fbb[_0xf833('0x43')][_0xf833('0x45')]?_0x331fbb[_0xf833('0x43')]:_0x7c7bfb[_0xf833('0x3e')];if(_0x1035e5[_0xf833('0x3f')][_0xf833('0x4d')]){_0x331fbb[_0xf833('0x53')]=[{'all':!![]}];}_0x331fbb=_[_0xf833('0x4b')]({},_0x331fbb,_0x1035e5[_0xf833('0x4c')]);return db[_0xf833('0x4e')][_0xf833('0x54')](_0x331fbb)[_0xf833('0x1e')](handleEntityNotFound(_0x73e33e,null))['then'](respondWithResult(_0x73e33e,null))[_0xf833('0x51')](handleError(_0x73e33e,null));};exports[_0xf833('0x55')]=function(_0x311948,_0x953a2a){return db[_0xf833('0x4e')][_0xf833('0x55')](_0x311948[_0xf833('0x56')],{})['then'](respondWithResult(_0x953a2a,0xc9))[_0xf833('0x51')](handleError(_0x953a2a,null));};exports[_0xf833('0x57')]=function(_0x341e22,_0x37cd6e){if(_0x341e22[_0xf833('0x56')]['id']){delete _0x341e22[_0xf833('0x56')]['id'];}return db[_0xf833('0x4e')][_0xf833('0x54')]({'where':{'id':_0x341e22[_0xf833('0x52')]['id']}})[_0xf833('0x1e')](handleEntityNotFound(_0x37cd6e,null))[_0xf833('0x1e')](saveUpdates(_0x341e22[_0xf833('0x56')],null))[_0xf833('0x1e')](respondWithResult(_0x37cd6e,null))[_0xf833('0x51')](handleError(_0x37cd6e,null));};exports['destroy']=function(_0x2210ae,_0xaba0b9){return db[_0xf833('0x4e')][_0xf833('0x54')]({'where':{'id':_0x2210ae[_0xf833('0x52')]['id']}})['then'](handleEntityNotFound(_0xaba0b9,null))['then'](removeEntity(_0xaba0b9,null))[_0xf833('0x51')](handleError(_0xaba0b9,null));};exports['getConfigurations']=function(_0x4e3075,_0x3c3ba7,_0x53541d){var _0xb0538f={};var _0x197469={};var _0x45af07;var _0xd17a53;return db[_0xf833('0x4e')]['findOne']({'where':{'id':_0x4e3075['params']['id']}})[_0xf833('0x1e')](handleEntityNotFound(_0x3c3ba7,null))[_0xf833('0x1e')](function(_0x503831){if(_0x503831){_0x45af07=_0x503831;_0x197469[_0xf833('0x3e')]=_[_0xf833('0x40')](db[_0xf833('0x58')]['rawAttributes']);_0x197469[_0xf833('0x3f')]=_['keys'](_0x4e3075[_0xf833('0x3f')]);_0x197469[_0xf833('0x41')]=_[_0xf833('0x42')](_0x197469[_0xf833('0x3e')],_0x197469[_0xf833('0x3f')]);_0xb0538f[_0xf833('0x43')]=_[_0xf833('0x42')](_0x197469[_0xf833('0x3e')],qs[_0xf833('0x44')](_0x4e3075[_0xf833('0x3f')][_0xf833('0x44')]));_0xb0538f[_0xf833('0x43')]=_0xb0538f[_0xf833('0x43')][_0xf833('0x45')]?_0xb0538f[_0xf833('0x43')]:_0x197469[_0xf833('0x3e')];_0xb0538f['order']=qs['sort'](_0x4e3075[_0xf833('0x3f')][_0xf833('0x48')]);_0xb0538f['where']=qs[_0xf833('0x41')](_['pick'](_0x4e3075[_0xf833('0x3f')],_0x197469[_0xf833('0x41')]));if(_0x4e3075['query'][_0xf833('0x59')]){_0xb0538f[_0xf833('0x4a')]=_[_0xf833('0x4b')](_0xb0538f[_0xf833('0x4a')],{'$or':_[_0xf833('0x39')](_0xb0538f['attributes'],function(_0x2688a3){var _0x2ec73f={};_0x2ec73f[_0x2688a3]={'$like':'%'+_0x4e3075['query'][_0xf833('0x59')]+'%'};return _0x2ec73f;})});}_0xb0538f=_[_0xf833('0x4b')]({},_0xb0538f,_0x4e3075[_0xf833('0x4c')]);return _0x45af07['getConfigurations'](_0xb0538f);}})['then'](function(_0x445346){if(_0x445346){_0xd17a53=_0x445346[_0xf833('0x45')];if(!_0x4e3075[_0xf833('0x3f')][_0xf833('0x5a')]('nolimit')){_0xb0538f[_0xf833('0x2e')]=qs[_0xf833('0x2e')](_0x4e3075[_0xf833('0x3f')]['limit']);_0xb0538f[_0xf833('0x2d')]=qs[_0xf833('0x2d')](_0x4e3075[_0xf833('0x3f')][_0xf833('0x2d')]);}return _0x45af07[_0xf833('0x5b')](_0xb0538f);}})[_0xf833('0x1e')](function(_0x897b87){if(_0x897b87){return _0x897b87?{'count':_0xd17a53,'rows':_0x897b87}:null;}})[_0xf833('0x1e')](respondWithResult(_0x3c3ba7,null))[_0xf833('0x51')](handleError(_0x3c3ba7,null));};exports[_0xf833('0x5c')]=function(_0x234d29,_0x24dc1a,_0x4eabd0){if(_0x234d29[_0xf833('0x56')]['id']){delete _0x234d29[_0xf833('0x56')]['id'];}return db[_0xf833('0x4e')]['findOne']({'where':{'id':_0x234d29[_0xf833('0x52')]['id']}})[_0xf833('0x1e')](handleEntityNotFound(_0x24dc1a,null))['then'](function(_0x17ae66){if(_0x17ae66){_0x234d29[_0xf833('0x56')]['AccountId']=_0x17ae66['id'];_0x234d29['body'][_0xf833('0x5d')]=integrations[_0xf833('0x5e')](_0x234d29['body'][_0xf833('0x5f')],_0x234d29[_0xf833('0x56')]['type']);_0x234d29['body'][_0xf833('0x60')]=integrations[_0xf833('0x61')](_0x234d29[_0xf833('0x56')][_0xf833('0x5f')],_0x234d29['body'][_0xf833('0x3c')]);return db[_0xf833('0x58')]['create'](_0x234d29[_0xf833('0x56')],{'include':[{'model':db[_0xf833('0x62')],'as':_0xf833('0x5d')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xf833('0x1e')](respondWithResult(_0x24dc1a,null))[_0xf833('0x51')](handleError(_0x24dc1a,null));};exports[_0xf833('0x63')]=function(_0x477e4b,_0x4c4acf,_0x549034){var _0x88e9bc='';return db[_0xf833('0x4e')][_0xf833('0x64')]({'where':{'id':_0x477e4b['params']['id']},'attributes':['id',_0xf833('0x65'),_0xf833('0x66'),_0xf833('0x67'),_0xf833('0x68'),'remoteUri']})[_0xf833('0x1e')](handleEntityNotFound(_0x4c4acf,null))[_0xf833('0x1e')](function(_0x583cae){if(_0x583cae){_0x88e9bc=_0x583cae[_0xf833('0x69')];var _0x451094=_0x88e9bc[_0xf833('0x6a')](-0x1);if(_0x451094==='/'){_0x88e9bc=_0x88e9bc[_0xf833('0x6b')](0x0,_0x88e9bc[_0xf833('0x6c')](_0x451094));}var _0x12c46e={'method':_0xf833('0x6d'),'uri':util[_0xf833('0x6e')]('%s/%s',_0x88e9bc,_0xf833('0x6f')),'json':!![]};switch(_0x583cae[_0xf833('0x68')]){case _0xf833('0x66'):_0x12c46e[_0xf833('0x70')]={'Authorization':util[_0xf833('0x6e')](_0xf833('0x71'),new Buffer(util[_0xf833('0x6e')](_0xf833('0x72'),_0x583cae[_0xf833('0x65')],_0x583cae[_0xf833('0x66')]))[_0xf833('0x73')](_0xf833('0x74')))};break;case'token':_0x12c46e['headers']={'Authorization':util[_0xf833('0x6e')](_0xf833('0x71'),new Buffer(util[_0xf833('0x6e')](_0xf833('0x75'),_0x583cae['username'],_0x583cae[_0xf833('0x67')]))[_0xf833('0x73')](_0xf833('0x74')))};break;default:throw new db[(_0xf833('0x76'))][(_0xf833('0x1c'))](_0xf833('0x77'));}return rp(_0x12c46e);}})[_0xf833('0x1e')](function(_0x1b6e6a){if(_0x1b6e6a){var _0x37bfc6=[_0xf833('0x78'),_0xf833('0x79'),_0xf833('0x7a'),'assignee'];_[_0xf833('0x7b')](_0x1b6e6a[_0xf833('0x6f')],function(_0x3d4e34){return _0x37bfc6[_0xf833('0x7c')](_0x3d4e34[_0xf833('0x3c')]);});return{'count':_0x1b6e6a['ticket_fields'][_0xf833('0x45')],'rows':_[_0xf833('0x39')](_0x1b6e6a[_0xf833('0x6f')],function(_0x5265b0){return{'id':_0x5265b0['id'],'name':_0x5265b0['position']>0x7?_0x5265b0[_0xf833('0x7d')]:_0x5265b0[_0xf833('0x3c')],'custom':_0x5265b0[_0xf833('0x7e')]>0x7?!![]:![],'options':_0x5265b0['system_field_options']?_0x5265b0[_0xf833('0x7f')]:_0x5265b0[_0xf833('0x80')]?_0x5265b0[_0xf833('0x80')]:[]};})};}})['then'](respondWithResult(_0x4c4acf,null))[_0xf833('0x51')](function(_0x2536f0){var _0x3ff16b=_0x477e4b['query']['test']?0x1f4:_0x2536f0[_0xf833('0x81')]||0x1f4;logger[_0xf833('0x24')](_0xf833('0x82'),_0xf833('0x63'),_0x3ff16b,JSON[_0xf833('0x23')](_0x2536f0));delete _0x2536f0[_0xf833('0x36')];if(_0x3ff16b===0x191){_0x3ff16b=0x190;}_0x4c4acf[_0xf833('0x29')](_0x3ff16b)[_0xf833('0x37')](_0x477e4b[_0xf833('0x3f')][_0xf833('0x83')]?{'message':_0xf833('0x84'),'statusCode':_0x2536f0[_0xf833('0x81')]}:_0x2536f0);});};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js
index c5f0472..01f2c36 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.model.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5073=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x18ce1b,_0x205cf4){var _0x2c4454=function(_0x396b38){while(--_0x396b38){_0x18ce1b['push'](_0x18ce1b['shift']());}};_0x2c4454(++_0x205cf4);}(_0x5073,0x191));var _0x3507=function(_0x24dfd2,_0x504fac){_0x24dfd2=_0x24dfd2-0x0;var _0x3abda1=_0x5073[_0x24dfd2];return _0x3abda1;};'use strict';var _=require(_0x3507('0x0'));var util=require(_0x3507('0x1'));var logger=require(_0x3507('0x2'))(_0x3507('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3507('0x4'));var fs=require('fs');var path=require(_0x3507('0x5'));var rimraf=require(_0x3507('0x6'));var config=require(_0x3507('0x7'));var attributes=require(_0x3507('0x8'));var integrations=require(_0x3507('0x9'));module['exports']=function(_0x53233b,_0x47a66f){return _0x53233b[_0x3507('0xa')](_0x3507('0xb'),attributes,{'tableName':_0x3507('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4434=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4434,0x150));var _0x4443=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4434[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x4443('0x0'));var util=require(_0x4443('0x1'));var logger=require(_0x4443('0x2'))(_0x4443('0x3'));var moment=require(_0x4443('0x4'));var BPromise=require(_0x4443('0x5'));var rp=require(_0x4443('0x6'));var fs=require('fs');var path=require(_0x4443('0x7'));var rimraf=require(_0x4443('0x8'));var config=require(_0x4443('0x9'));var attributes=require(_0x4443('0xa'));var integrations=require(_0x4443('0xb'));module[_0x4443('0xc')]=function(_0x4c9228,_0xb6c3f3){return _0x4c9228[_0x4443('0xd')](_0x4443('0xe'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js
index 34f88e3..e068dcb 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowZendeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0xcb91[_0x3ed054];return _0x16dd95;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetZendeskAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['ZendeskAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowZendeskAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});};
\ No newline at end of file
+var _0xb7e7=['request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x1b51e2,_0x213fe6){var _0x597695=function(_0x5a2988){while(--_0x5a2988){_0x1b51e2['push'](_0x1b51e2['shift']());}};_0x597695(++_0x213fe6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb7e7[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')]({'raw':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')]['where']||null:null,'attributes':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x19')]||null:null,'limit':_0x242368['options']?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1a')]||null:null,'include':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x53bbb3){return{'model':db[_0x53bbb3['model']],'as':_0x53bbb3['as'],'attributes':_0x53bbb3['attributes'],'include':_0x53bbb3[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x53bbb3[_0x7b7e('0x1b')],function(_0x483c6f){return{'model':db[_0x483c6f['model']],'as':_0x483c6f['as'],'attributes':_0x483c6f['attributes'],'include':_0x483c6f[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x483c6f[_0x7b7e('0x1b')],function(_0x7aa71){return{'model':db[_0x7aa71[_0x7b7e('0x1d')]],'as':_0x7aa71['as'],'attributes':_0x7aa71['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x21a15){logger['info']('GetZendeskAccount',_0x242368);logger['debug'](_0x7b7e('0x14'),_0x242368,JSON[_0x7b7e('0xf')](_0x21a15));_0x2acb8c(_0x21a15);})['catch'](function(_0x3db8c4){logger['error'](_0x7b7e('0x14'),_0x3db8c4[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x3db8c4['message']));});});};exports[_0x7b7e('0x1e')]=function(_0xe31336){var _0x35602a=this;return new Promise(function(_0x326dd2,_0x33f9a1){return db['ZendeskAccount'][_0x7b7e('0x1f')]({'raw':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x20')]||null:null,'attributes':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')]['attributes']||null:null,'include':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_['map'](_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x2ca366){return{'model':db[_0x2ca366['model']],'as':_0x2ca366['as'],'attributes':_0x2ca366[_0x7b7e('0x19')],'include':_0x2ca366[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x2ca366[_0x7b7e('0x1b')],function(_0x31043a){return{'model':db[_0x31043a[_0x7b7e('0x1d')]],'as':_0x31043a['as'],'attributes':_0x31043a[_0x7b7e('0x19')],'include':_0x31043a[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x31043a[_0x7b7e('0x1b')],function(_0xd5a64d){return{'model':db[_0xd5a64d[_0x7b7e('0x1d')]],'as':_0xd5a64d['as'],'attributes':_0xd5a64d[_0x7b7e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x116563){logger[_0x7b7e('0xa')]('ShowZendeskAccount',_0xe31336);logger[_0x7b7e('0xc')](_0x7b7e('0x1e'),_0xe31336,JSON[_0x7b7e('0xf')](_0x116563));_0x326dd2(_0x116563);})[_0x7b7e('0x13')](function(_0x36abfc){logger[_0x7b7e('0x10')](_0x7b7e('0x1e'),_0x36abfc[_0x7b7e('0x12')],_0xe31336);_0x33f9a1(_0x35602a[_0x7b7e('0x10')](0x1f4,_0x36abfc[_0x7b7e('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js
index d5b39e8..3977d6f 100644
--- a/server/api/intZendeskConfiguration/index.js
+++ b/server/api/intZendeskConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf528=['put','update','delete','/:id','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','getTags','post','create','setTags'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf528,0x78));var _0x8f52=function(_0x8284bc,_0x1a4b6c){_0x8284bc=_0x8284bc-0x0;var _0x49e865=_0xf528[_0x8284bc];return _0x49e865;};'use strict';var multer=require('multer');var util=require(_0x8f52('0x0'));var path=require('path');var timeout=require(_0x8f52('0x1'));var express=require('express');var router=express[_0x8f52('0x2')]();var auth=require(_0x8f52('0x3'));var interaction=require(_0x8f52('0x4'));var config=require(_0x8f52('0x5'));var controller=require('./intZendeskConfiguration.controller');router[_0x8f52('0x6')]('/',auth[_0x8f52('0x7')](),controller[_0x8f52('0x8')]);router[_0x8f52('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x8f52('0x9')]);router[_0x8f52('0x6')](_0x8f52('0xa'),auth['isAuthenticated'](),controller[_0x8f52('0xb')]);router[_0x8f52('0x6')](_0x8f52('0xc'),auth[_0x8f52('0x7')](),controller[_0x8f52('0xd')]);router['get']('/:id/descriptions',auth[_0x8f52('0x7')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x8f52('0xe')]);router[_0x8f52('0xf')]('/',auth[_0x8f52('0x7')](),controller[_0x8f52('0x10')]);router[_0x8f52('0xf')]('/:id/tags',auth[_0x8f52('0x7')](),controller[_0x8f52('0x11')]);router[_0x8f52('0x12')]('/:id',auth[_0x8f52('0x7')](),controller[_0x8f52('0x13')]);router[_0x8f52('0x14')](_0x8f52('0x15'),auth['isAuthenticated'](),controller[_0x8f52('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x2145=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x2145,0x98));var _0x5214=function(_0x24e4a2,_0x127d00){_0x24e4a2=_0x24e4a2-0x0;var _0x3f2a39=_0x2145[_0x24e4a2];return _0x3f2a39;};'use strict';var multer=require(_0x5214('0x0'));var util=require('util');var path=require(_0x5214('0x1'));var timeout=require(_0x5214('0x2'));var express=require(_0x5214('0x3'));var router=express[_0x5214('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5214('0x5'));var controller=require(_0x5214('0x6'));router[_0x5214('0x7')]('/',auth[_0x5214('0x8')](),controller[_0x5214('0x9')]);router[_0x5214('0x7')](_0x5214('0xa'),auth[_0x5214('0x8')](),controller[_0x5214('0xb')]);router[_0x5214('0x7')](_0x5214('0xc'),auth[_0x5214('0x8')](),controller[_0x5214('0xd')]);router['get'](_0x5214('0xe'),auth['isAuthenticated'](),controller[_0x5214('0xf')]);router['get'](_0x5214('0x10'),auth[_0x5214('0x8')](),controller[_0x5214('0x11')]);router['get']('/:id/tags',auth[_0x5214('0x8')](),controller[_0x5214('0x12')]);router[_0x5214('0x13')]('/',auth['isAuthenticated'](),controller[_0x5214('0x14')]);router[_0x5214('0x13')](_0x5214('0x15'),auth['isAuthenticated'](),controller[_0x5214('0x16')]);router['put'](_0x5214('0xa'),auth[_0x5214('0x8')](),controller[_0x5214('0x17')]);router[_0x5214('0x18')]('/:id',auth[_0x5214('0x8')](),controller[_0x5214('0x19')]);module[_0x5214('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
index 8c7326e..4c07b8a 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f11=['sequelize','exports','STRING'];(function(_0x24ccc0,_0x4b2ae1){var _0x11256e=function(_0x6ab9b){while(--_0x6ab9b){_0x24ccc0['push'](_0x24ccc0['shift']());}};_0x11256e(++_0x4b2ae1);}(_0x2f11,0x1ef));var _0x12f1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2f11[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x12f1('0x0'));module[_0x12f1('0x1')]={'name':{'type':Sequelize[_0x12f1('0x2')]},'description':{'type':Sequelize[_0x12f1('0x2')]}};
\ No newline at end of file
+var _0x7a90=['STRING','sequelize','exports'];(function(_0x50ab16,_0x401575){var _0x3e5d78=function(_0x34383c){while(--_0x34383c){_0x50ab16['push'](_0x50ab16['shift']());}};_0x3e5d78(++_0x401575);}(_0x7a90,0x163));var _0x07a9=function(_0x399344,_0x2d6413){_0x399344=_0x399344-0x0;var _0xb7b960=_0x7a90[_0x399344];return _0xb7b960;};'use strict';var Sequelize=require(_0x07a9('0x0'));module[_0x07a9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x07a9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
index 16cb5d5..fdf69fc 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe44=['order','pick','getSubjects','getDescriptions','getTags','Tag','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','index','map','ZendeskConfiguration','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','body','destroy','getFields','findOne','ZendeskField','rawAttributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbe44,0x1e1));var _0x4be4=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0xbe44[_0x2431d6];return _0x4d0f9b;};'use strict';var pdf=require(_0x4be4('0x0'));var emlformat=require(_0x4be4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4be4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4be4('0x3'));var moment=require(_0x4be4('0x4'));var BPromise=require(_0x4be4('0x5'));var Mustache=require(_0x4be4('0x6'));var util=require(_0x4be4('0x7'));var path=require('path');var sox=require(_0x4be4('0x8'));var csv=require(_0x4be4('0x9'));var ejs=require(_0x4be4('0xa'));var fs=require('fs');var _=require(_0x4be4('0xb'));var squel=require(_0x4be4('0xc'));var crypto=require(_0x4be4('0xd'));var jsforce=require(_0x4be4('0xe'));var deskjs=require(_0x4be4('0xf'));var toCsv=require(_0x4be4('0x9'));var querystring=require(_0x4be4('0x10'));var Papa=require(_0x4be4('0x11'));var Redis=require(_0x4be4('0x12'));var authService=require(_0x4be4('0x13'));var qs=require(_0x4be4('0x14'));var as=require(_0x4be4('0x15'));var hardwareService=require(_0x4be4('0x16'));var logger=require(_0x4be4('0x17'))(_0x4be4('0x18'));var utils=require(_0x4be4('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x4be4('0x1a')][_0x4be4('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xdaecc1,_0x8f5b73,_0xbd27a8){if(_0xbd27a8){var _0x11d4b8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11d4b8['test'](_0x8f5b73)){return _0xdaecc1;}else{throw new db['Sequelize']['ValidationError'](_0x4be4('0x1c'));}}else{return _0xdaecc1;}}function respondWithRpcPromise(_0x35241c,_0x5be56f,_0x2f7525,_0x28ffbe){return new BPromise(function(_0x20654e,_0x4ce1b2){var _0x3ee013=_0x28ffbe||client;return _0x3ee013[_0x4be4('0x1d')](_0x35241c,_0x2f7525)['then'](function(_0x56c7fa){logger['info'](_0x4be4('0x1e'),_0x5be56f,_0x4be4('0x1f'));logger[_0x4be4('0x20')](_0x4be4('0x21'),_0x5be56f,_0x4be4('0x1f'),JSON['stringify'](_0x56c7fa));if(_0x56c7fa[_0x4be4('0x22')]){if(_0x56c7fa['error'][_0x4be4('0x23')]===0x1f4){logger[_0x4be4('0x22')](_0x4be4('0x1e'),_0x5be56f,_0x56c7fa['error']['message']);return _0x4ce1b2(_0x56c7fa[_0x4be4('0x22')][_0x4be4('0x24')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5be56f,_0x56c7fa[_0x4be4('0x22')]['message']);return _0x20654e(_0x56c7fa[_0x4be4('0x22')][_0x4be4('0x24')]);}else{logger[_0x4be4('0x25')](_0x4be4('0x1e'),_0x5be56f,_0x4be4('0x1f'));_0x20654e(_0x56c7fa[_0x4be4('0x26')][_0x4be4('0x24')]);}})[_0x4be4('0x27')](function(_0x13b347){logger[_0x4be4('0x22')](_0x4be4('0x1e'),_0x5be56f,_0x13b347);_0x4ce1b2(_0x13b347);});});}function respondWithStatusCode(_0x22d4e9,_0x3087a4){_0x3087a4=_0x3087a4||0xcc;return function(_0x2223c5){if(_0x2223c5){return _0x22d4e9[_0x4be4('0x28')](_0x3087a4);}return _0x22d4e9[_0x4be4('0x29')](_0x3087a4)[_0x4be4('0x2a')]();};}function respondWithResult(_0xe4dfe8,_0x31a947){_0x31a947=_0x31a947||0xc8;return function(_0x15cd8f){if(_0x15cd8f){return _0xe4dfe8[_0x4be4('0x29')](_0x31a947)[_0x4be4('0x2b')](_0x15cd8f);}};}function respondWithFilteredResult(_0x4be523,_0x5957b0){return function(_0x55a2a7){if(_0x55a2a7){var _0x48fff5=_0x55a2a7[_0x4be4('0x2c')],_0x48a0d2=_0x5957b0['offset'],_0x2098eb=_0x5957b0[_0x4be4('0x2d')]+_0x5957b0[_0x4be4('0x2e')],_0x2bb82d;if(_0x2098eb>=_0x48fff5){_0x2098eb=_0x48fff5;_0x2bb82d=0xc8;}else{_0x2bb82d=0xce;}_0x4be523['status'](_0x2bb82d);return _0x4be523[_0x4be4('0x2f')](_0x4be4('0x30'),_0x48a0d2+'-'+_0x2098eb+'/'+_0x48fff5)['json'](_0x55a2a7);}return null;};}function patchUpdates(_0x33fe1a){return function(_0x41f335){try{jsonpatch[_0x4be4('0x31')](_0x41f335,_0x33fe1a,!![]);}catch(_0x341a71){return BPromise[_0x4be4('0x32')](_0x341a71);}return _0x41f335['save']();};}function saveUpdates(_0x2adfb2,_0x156a1f){return function(_0x1bcc6e){if(_0x1bcc6e){return _0x1bcc6e[_0x4be4('0x33')](_0x2adfb2)[_0x4be4('0x34')](function(_0x7d608f){return _0x7d608f;});}return null;};}function removeEntity(_0xe8f33f,_0x359d58){return function(_0x10c93d){if(_0x10c93d){return _0x10c93d['destroy']()[_0x4be4('0x34')](function(){_0xe8f33f[_0x4be4('0x29')](0xcc)[_0x4be4('0x2a')]();});}};}function handleEntityNotFound(_0x31bfb3,_0x20b8cf){return function(_0x15cd07){if(!_0x15cd07){_0x31bfb3[_0x4be4('0x28')](0x194);}return _0x15cd07;};}function handleError(_0x849698,_0x50d98d){_0x50d98d=_0x50d98d||0x1f4;return function(_0xf503c7){logger['error'](_0xf503c7[_0x4be4('0x35')]);if(_0xf503c7[_0x4be4('0x36')]){delete _0xf503c7[_0x4be4('0x36')];}_0x849698[_0x4be4('0x29')](_0x50d98d)['send'](_0xf503c7);};}exports[_0x4be4('0x37')]=function(_0x5afa08,_0x221c7b){var _0xbcdf61={},_0x5db92d={},_0x4e6dd5={'count':0x0,'rows':[]};var _0x5f4ba3=_[_0x4be4('0x38')](db[_0x4be4('0x39')]['rawAttributes'],function(_0x19afbf){return{'name':_0x19afbf[_0x4be4('0x3a')],'type':_0x19afbf[_0x4be4('0x3b')]['key']};});_0x5db92d[_0x4be4('0x3c')]=_['map'](_0x5f4ba3,'name');_0x5db92d['query']=_['keys'](_0x5afa08[_0x4be4('0x3d')]);_0x5db92d[_0x4be4('0x3e')]=_[_0x4be4('0x3f')](_0x5db92d[_0x4be4('0x3c')],_0x5db92d[_0x4be4('0x3d')]);_0xbcdf61['attributes']=_[_0x4be4('0x3f')](_0x5db92d[_0x4be4('0x3c')],qs[_0x4be4('0x40')](_0x5afa08['query'][_0x4be4('0x40')]));_0xbcdf61[_0x4be4('0x41')]=_0xbcdf61['attributes'][_0x4be4('0x42')]?_0xbcdf61[_0x4be4('0x41')]:_0x5db92d[_0x4be4('0x3c')];if(!_0x5afa08[_0x4be4('0x3d')][_0x4be4('0x43')](_0x4be4('0x44'))){_0xbcdf61[_0x4be4('0x2e')]=qs[_0x4be4('0x2e')](_0x5afa08[_0x4be4('0x3d')][_0x4be4('0x2e')]);_0xbcdf61['offset']=qs[_0x4be4('0x2d')](_0x5afa08[_0x4be4('0x3d')]['offset']);}_0xbcdf61['order']=qs[_0x4be4('0x45')](_0x5afa08[_0x4be4('0x3d')]['sort']);_0xbcdf61[_0x4be4('0x46')]=qs[_0x4be4('0x3e')](_['pick'](_0x5afa08[_0x4be4('0x3d')],_0x5db92d[_0x4be4('0x3e')]),_0x5f4ba3);if(_0x5afa08[_0x4be4('0x3d')][_0x4be4('0x47')]){_0xbcdf61[_0x4be4('0x46')]=_[_0x4be4('0x48')](_0xbcdf61[_0x4be4('0x46')],{'$or':_[_0x4be4('0x38')](_0x5f4ba3,function(_0x5c60ce){if(_0x5c60ce[_0x4be4('0x3b')]!==_0x4be4('0x49')){var _0x500beb={};_0x500beb[_0x5c60ce[_0x4be4('0x36')]]={'$like':'%'+_0x5afa08['query']['filter']+'%'};return _0x500beb;}})});}_0xbcdf61=_[_0x4be4('0x48')]({},_0xbcdf61,_0x5afa08[_0x4be4('0x4a')]);var _0x5a473d={'where':_0xbcdf61[_0x4be4('0x46')]};return db[_0x4be4('0x39')][_0x4be4('0x2c')](_0x5a473d)[_0x4be4('0x34')](function(_0x2b97cc){_0x4e6dd5['count']=_0x2b97cc;if(_0x5afa08['query'][_0x4be4('0x4b')]){_0xbcdf61[_0x4be4('0x4c')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x4be4('0x4d')](_0xbcdf61);})[_0x4be4('0x34')](function(_0x276af5){_0x4e6dd5['rows']=_0x276af5;return _0x4e6dd5;})[_0x4be4('0x34')](respondWithFilteredResult(_0x221c7b,_0xbcdf61))[_0x4be4('0x27')](handleError(_0x221c7b,null));};exports[_0x4be4('0x4e')]=function(_0x2d4e07,_0x1fc0a9){var _0x413886={'raw':![],'where':{'id':_0x2d4e07[_0x4be4('0x4f')]['id']}},_0x328c8c={};_0x328c8c['model']=_[_0x4be4('0x50')](db[_0x4be4('0x39')]['rawAttributes']);_0x328c8c[_0x4be4('0x3d')]=_[_0x4be4('0x50')](_0x2d4e07['query']);_0x328c8c[_0x4be4('0x3e')]=_[_0x4be4('0x3f')](_0x328c8c[_0x4be4('0x3c')],_0x328c8c[_0x4be4('0x3d')]);_0x413886['attributes']=_['intersection'](_0x328c8c[_0x4be4('0x3c')],qs[_0x4be4('0x40')](_0x2d4e07['query'][_0x4be4('0x40')]));_0x413886[_0x4be4('0x41')]=_0x413886[_0x4be4('0x41')][_0x4be4('0x42')]?_0x413886[_0x4be4('0x41')]:_0x328c8c[_0x4be4('0x3c')];if(_0x2d4e07[_0x4be4('0x3d')][_0x4be4('0x4b')]){_0x413886[_0x4be4('0x4c')]=[{'all':!![]}];}_0x413886=_[_0x4be4('0x48')]({},_0x413886,_0x2d4e07[_0x4be4('0x4a')]);return db[_0x4be4('0x39')][_0x4be4('0x51')](_0x413886)[_0x4be4('0x34')](handleEntityNotFound(_0x1fc0a9,null))[_0x4be4('0x34')](respondWithResult(_0x1fc0a9,null))['catch'](handleError(_0x1fc0a9,null));};exports[_0x4be4('0x52')]=function(_0x5436c9,_0x15818a){return db[_0x4be4('0x39')]['create'](_0x5436c9[_0x4be4('0x53')],{})[_0x4be4('0x34')](respondWithResult(_0x15818a,0xc9))['catch'](handleError(_0x15818a,null));};exports[_0x4be4('0x33')]=function(_0x3cddfd,_0x22b690){if(_0x3cddfd[_0x4be4('0x53')]['id']){delete _0x3cddfd[_0x4be4('0x53')]['id'];}return db[_0x4be4('0x39')][_0x4be4('0x51')]({'where':{'id':_0x3cddfd['params']['id']}})['then'](handleEntityNotFound(_0x22b690,null))[_0x4be4('0x34')](saveUpdates(_0x3cddfd[_0x4be4('0x53')],null))[_0x4be4('0x34')](respondWithResult(_0x22b690,null))[_0x4be4('0x27')](handleError(_0x22b690,null));};exports[_0x4be4('0x54')]=function(_0x73aedf,_0x39122e){return db[_0x4be4('0x39')][_0x4be4('0x51')]({'where':{'id':_0x73aedf[_0x4be4('0x4f')]['id']}})[_0x4be4('0x34')](handleEntityNotFound(_0x39122e,null))[_0x4be4('0x34')](removeEntity(_0x39122e,null))[_0x4be4('0x27')](handleError(_0x39122e,null));};exports[_0x4be4('0x55')]=function(_0x5f595e,_0x49fa73,_0x5692de){var _0x373b9a={};var _0x426ca3={};var _0x445737;var _0xf339b4;return db[_0x4be4('0x39')][_0x4be4('0x56')]({'where':{'id':_0x5f595e[_0x4be4('0x4f')]['id']}})[_0x4be4('0x34')](handleEntityNotFound(_0x49fa73,null))[_0x4be4('0x34')](function(_0xda5c65){if(_0xda5c65){_0x445737=_0xda5c65;_0x426ca3['model']=_[_0x4be4('0x50')](db[_0x4be4('0x57')][_0x4be4('0x58')]);_0x426ca3['query']=_[_0x4be4('0x50')](_0x5f595e['query']);_0x426ca3[_0x4be4('0x3e')]=_[_0x4be4('0x3f')](_0x426ca3[_0x4be4('0x3c')],_0x426ca3['query']);_0x373b9a[_0x4be4('0x41')]=_[_0x4be4('0x3f')](_0x426ca3['model'],qs['fields'](_0x5f595e[_0x4be4('0x3d')][_0x4be4('0x40')]));_0x373b9a['attributes']=_0x373b9a[_0x4be4('0x41')][_0x4be4('0x42')]?_0x373b9a[_0x4be4('0x41')]:_0x426ca3['model'];_0x373b9a[_0x4be4('0x59')]=qs[_0x4be4('0x45')](_0x5f595e[_0x4be4('0x3d')][_0x4be4('0x45')]);_0x373b9a[_0x4be4('0x46')]=qs['filters'](_[_0x4be4('0x5a')](_0x5f595e['query'],_0x426ca3[_0x4be4('0x3e')]));if(_0x5f595e[_0x4be4('0x3d')][_0x4be4('0x47')]){_0x373b9a[_0x4be4('0x46')]=_[_0x4be4('0x48')](_0x373b9a['where'],{'$or':_['map'](_0x373b9a[_0x4be4('0x41')],function(_0x2e959a){var _0x34bd39={};_0x34bd39[_0x2e959a]={'$like':'%'+_0x5f595e[_0x4be4('0x3d')][_0x4be4('0x47')]+'%'};return _0x34bd39;})});}_0x373b9a=_[_0x4be4('0x48')]({},_0x373b9a,_0x5f595e[_0x4be4('0x4a')]);return _0x445737['getFields'](_0x373b9a);}})[_0x4be4('0x34')](function(_0x4aa8bd){if(_0x4aa8bd){_0xf339b4=_0x4aa8bd['length'];if(!_0x5f595e[_0x4be4('0x3d')][_0x4be4('0x43')](_0x4be4('0x44'))){_0x373b9a[_0x4be4('0x2e')]=qs['limit'](_0x5f595e[_0x4be4('0x3d')][_0x4be4('0x2e')]);_0x373b9a[_0x4be4('0x2d')]=qs[_0x4be4('0x2d')](_0x5f595e[_0x4be4('0x3d')][_0x4be4('0x2d')]);}return _0x445737[_0x4be4('0x55')](_0x373b9a);}})['then'](function(_0xef9265){if(_0xef9265){return _0xef9265?{'count':_0xf339b4,'rows':_0xef9265}:null;}})[_0x4be4('0x34')](respondWithResult(_0x49fa73,null))[_0x4be4('0x27')](handleError(_0x49fa73,null));};exports['getSubjects']=function(_0x32ac3c,_0x276c3f,_0x35b1d9){var _0x406930={};var _0x15e3ca={};var _0xfb855e;var _0x2bc532;return db['ZendeskConfiguration'][_0x4be4('0x56')]({'where':{'id':_0x32ac3c['params']['id']}})[_0x4be4('0x34')](handleEntityNotFound(_0x276c3f,null))['then'](function(_0x592e89){if(_0x592e89){_0xfb855e=_0x592e89;_0x15e3ca[_0x4be4('0x3c')]=_['keys'](db[_0x4be4('0x57')]['rawAttributes']);_0x15e3ca['query']=_[_0x4be4('0x50')](_0x32ac3c[_0x4be4('0x3d')]);_0x15e3ca['filters']=_[_0x4be4('0x3f')](_0x15e3ca[_0x4be4('0x3c')],_0x15e3ca[_0x4be4('0x3d')]);_0x406930[_0x4be4('0x41')]=_['intersection'](_0x15e3ca[_0x4be4('0x3c')],qs[_0x4be4('0x40')](_0x32ac3c[_0x4be4('0x3d')]['fields']));_0x406930['attributes']=_0x406930['attributes']['length']?_0x406930[_0x4be4('0x41')]:_0x15e3ca[_0x4be4('0x3c')];_0x406930[_0x4be4('0x59')]=qs['sort'](_0x32ac3c['query']['sort']);_0x406930['where']=qs[_0x4be4('0x3e')](_[_0x4be4('0x5a')](_0x32ac3c[_0x4be4('0x3d')],_0x15e3ca['filters']));if(_0x32ac3c[_0x4be4('0x3d')][_0x4be4('0x47')]){_0x406930[_0x4be4('0x46')]=_[_0x4be4('0x48')](_0x406930[_0x4be4('0x46')],{'$or':_['map'](_0x406930['attributes'],function(_0x737cbc){var _0x3674eb={};_0x3674eb[_0x737cbc]={'$like':'%'+_0x32ac3c[_0x4be4('0x3d')][_0x4be4('0x47')]+'%'};return _0x3674eb;})});}_0x406930=_['merge']({},_0x406930,_0x32ac3c['options']);return _0xfb855e['getSubjects'](_0x406930);}})[_0x4be4('0x34')](function(_0x13f39c){if(_0x13f39c){_0x2bc532=_0x13f39c[_0x4be4('0x42')];if(!_0x32ac3c[_0x4be4('0x3d')][_0x4be4('0x43')]('nolimit')){_0x406930['limit']=qs[_0x4be4('0x2e')](_0x32ac3c[_0x4be4('0x3d')][_0x4be4('0x2e')]);_0x406930[_0x4be4('0x2d')]=qs[_0x4be4('0x2d')](_0x32ac3c[_0x4be4('0x3d')][_0x4be4('0x2d')]);}return _0xfb855e[_0x4be4('0x5b')](_0x406930);}})[_0x4be4('0x34')](function(_0x56e033){if(_0x56e033){return _0x56e033?{'count':_0x2bc532,'rows':_0x56e033}:null;}})[_0x4be4('0x34')](respondWithResult(_0x276c3f,null))[_0x4be4('0x27')](handleError(_0x276c3f,null));};exports[_0x4be4('0x5c')]=function(_0x4b9000,_0x424f51,_0x2b4905){var _0x549cfa={};var _0x202517={};var _0x21aeb4;var _0x2d3a66;return db['ZendeskConfiguration'][_0x4be4('0x56')]({'where':{'id':_0x4b9000[_0x4be4('0x4f')]['id']}})[_0x4be4('0x34')](handleEntityNotFound(_0x424f51,null))[_0x4be4('0x34')](function(_0x17e606){if(_0x17e606){_0x21aeb4=_0x17e606;_0x202517['model']=_[_0x4be4('0x50')](db[_0x4be4('0x57')][_0x4be4('0x58')]);_0x202517[_0x4be4('0x3d')]=_[_0x4be4('0x50')](_0x4b9000[_0x4be4('0x3d')]);_0x202517[_0x4be4('0x3e')]=_[_0x4be4('0x3f')](_0x202517[_0x4be4('0x3c')],_0x202517['query']);_0x549cfa[_0x4be4('0x41')]=_[_0x4be4('0x3f')](_0x202517['model'],qs[_0x4be4('0x40')](_0x4b9000[_0x4be4('0x3d')][_0x4be4('0x40')]));_0x549cfa['attributes']=_0x549cfa[_0x4be4('0x41')][_0x4be4('0x42')]?_0x549cfa['attributes']:_0x202517['model'];_0x549cfa[_0x4be4('0x59')]=qs[_0x4be4('0x45')](_0x4b9000[_0x4be4('0x3d')][_0x4be4('0x45')]);_0x549cfa[_0x4be4('0x46')]=qs[_0x4be4('0x3e')](_[_0x4be4('0x5a')](_0x4b9000[_0x4be4('0x3d')],_0x202517['filters']));if(_0x4b9000[_0x4be4('0x3d')]['filter']){_0x549cfa[_0x4be4('0x46')]=_[_0x4be4('0x48')](_0x549cfa[_0x4be4('0x46')],{'$or':_[_0x4be4('0x38')](_0x549cfa[_0x4be4('0x41')],function(_0x8c2d6d){var _0x13302c={};_0x13302c[_0x8c2d6d]={'$like':'%'+_0x4b9000['query'][_0x4be4('0x47')]+'%'};return _0x13302c;})});}_0x549cfa=_[_0x4be4('0x48')]({},_0x549cfa,_0x4b9000[_0x4be4('0x4a')]);return _0x21aeb4['getDescriptions'](_0x549cfa);}})['then'](function(_0x12a0e1){if(_0x12a0e1){_0x2d3a66=_0x12a0e1['length'];if(!_0x4b9000[_0x4be4('0x3d')][_0x4be4('0x43')]('nolimit')){_0x549cfa[_0x4be4('0x2e')]=qs[_0x4be4('0x2e')](_0x4b9000[_0x4be4('0x3d')][_0x4be4('0x2e')]);_0x549cfa['offset']=qs[_0x4be4('0x2d')](_0x4b9000[_0x4be4('0x3d')][_0x4be4('0x2d')]);}return _0x21aeb4[_0x4be4('0x5c')](_0x549cfa);}})['then'](function(_0x1b6a50){if(_0x1b6a50){return _0x1b6a50?{'count':_0x2d3a66,'rows':_0x1b6a50}:null;}})[_0x4be4('0x34')](respondWithResult(_0x424f51,null))['catch'](handleError(_0x424f51,null));};exports[_0x4be4('0x5d')]=function(_0x528364,_0x4fba4e,_0x2808a9){var _0x1315cf={};var _0x578322={};var _0xe2cf0b;var _0x59ff74;return db[_0x4be4('0x39')][_0x4be4('0x56')]({'where':{'id':_0x528364[_0x4be4('0x4f')]['id']}})[_0x4be4('0x34')](handleEntityNotFound(_0x4fba4e,null))[_0x4be4('0x34')](function(_0x89f5e8){if(_0x89f5e8){_0xe2cf0b=_0x89f5e8;_0x578322[_0x4be4('0x3c')]=_[_0x4be4('0x50')](db[_0x4be4('0x5e')][_0x4be4('0x58')]);_0x578322[_0x4be4('0x3d')]=_[_0x4be4('0x50')](_0x528364[_0x4be4('0x3d')]);_0x578322[_0x4be4('0x3e')]=_['intersection'](_0x578322[_0x4be4('0x3c')],_0x578322['query']);_0x1315cf[_0x4be4('0x41')]=_[_0x4be4('0x3f')](_0x578322[_0x4be4('0x3c')],qs[_0x4be4('0x40')](_0x528364['query'][_0x4be4('0x40')]));_0x1315cf[_0x4be4('0x41')]=_0x1315cf[_0x4be4('0x41')][_0x4be4('0x42')]?_0x1315cf[_0x4be4('0x41')]:_0x578322[_0x4be4('0x3c')];_0x1315cf[_0x4be4('0x59')]=qs['sort'](_0x528364[_0x4be4('0x3d')][_0x4be4('0x45')]);_0x1315cf['where']=qs[_0x4be4('0x3e')](_[_0x4be4('0x5a')](_0x528364[_0x4be4('0x3d')],_0x578322[_0x4be4('0x3e')]));if(_0x528364[_0x4be4('0x3d')][_0x4be4('0x47')]){_0x1315cf[_0x4be4('0x46')]=_[_0x4be4('0x48')](_0x1315cf[_0x4be4('0x46')],{'$or':_[_0x4be4('0x38')](_0x1315cf['attributes'],function(_0x42b712){var _0x34356c={};_0x34356c[_0x42b712]={'$like':'%'+_0x528364[_0x4be4('0x3d')][_0x4be4('0x47')]+'%'};return _0x34356c;})});}_0x1315cf=_[_0x4be4('0x48')]({},_0x1315cf,_0x528364['options']);return _0xe2cf0b[_0x4be4('0x5d')](_0x1315cf);}})['then'](function(_0x1fc4c7){if(_0x1fc4c7){_0x59ff74=_0x1fc4c7['length'];if(!_0x528364[_0x4be4('0x3d')][_0x4be4('0x43')](_0x4be4('0x44'))){_0x1315cf['limit']=qs[_0x4be4('0x2e')](_0x528364[_0x4be4('0x3d')]['limit']);_0x1315cf[_0x4be4('0x2d')]=qs[_0x4be4('0x2d')](_0x528364[_0x4be4('0x3d')][_0x4be4('0x2d')]);}return _0xe2cf0b[_0x4be4('0x5d')](_0x1315cf);}})[_0x4be4('0x34')](function(_0xb77b37){if(_0xb77b37){return _0xb77b37?{'count':_0x59ff74,'rows':_0xb77b37}:null;}})[_0x4be4('0x34')](respondWithResult(_0x4fba4e,null))[_0x4be4('0x27')](handleError(_0x4fba4e,null));};exports['setTags']=function(_0x2a39c8,_0x567d3b,_0xe28f52){if(_0x2a39c8[_0x4be4('0x53')]['id']){delete _0x2a39c8[_0x4be4('0x53')]['id'];}return db[_0x4be4('0x39')]['findOne']({'where':{'id':_0x2a39c8[_0x4be4('0x4f')]['id']}})[_0x4be4('0x34')](handleEntityNotFound(_0x567d3b,null))[_0x4be4('0x34')](function(_0x4d6155){if(_0x4d6155){return _0x4d6155['setTags'](_0x2a39c8[_0x4be4('0x53')]['ids']||[]);}return null;})['then'](respondWithResult(_0x567d3b,null))[_0x4be4('0x27')](handleError(_0x567d3b,null));};
\ No newline at end of file
+var _0x6668=['lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','merge','type','filter','options','include','findAll','rows','params','create','body','find','findOne','ZendeskField','keys','pick','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x1d0e07,_0x2037e9){var _0x8912e0=function(_0x3b1c66){while(--_0x3b1c66){_0x1d0e07['push'](_0x1d0e07['shift']());}};_0x8912e0(++_0x2037e9);}(_0x6668,0x166));var _0x8666=function(_0x2c0323,_0x22ade0){_0x2c0323=_0x2c0323-0x0;var _0x2253ad=_0x6668[_0x2c0323];return _0x2253ad;};'use strict';var pdf=require(_0x8666('0x0'));var emlformat=require(_0x8666('0x1'));var rimraf=require(_0x8666('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8666('0x3'));var moment=require('moment');var BPromise=require(_0x8666('0x4'));var Mustache=require(_0x8666('0x5'));var util=require(_0x8666('0x6'));var path=require('path');var sox=require(_0x8666('0x7'));var csv=require(_0x8666('0x8'));var ejs=require(_0x8666('0x9'));var fs=require('fs');var _=require(_0x8666('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8666('0xb'));var deskjs=require(_0x8666('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8666('0xd'));var Papa=require(_0x8666('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8666('0xf'));var as=require(_0x8666('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8666('0x11'))(_0x8666('0x12'));var utils=require('../../config/utils');var config=require(_0x8666('0x13'));var db=require(_0x8666('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x8666('0x15')]({'port':0x232a});function checkPasswordPattern(_0x4e90f5,_0x1e99e7,_0x11d589){if(_0x11d589){var _0xbdf870=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbdf870[_0x8666('0x16')](_0x1e99e7)){return _0x4e90f5;}else{throw new db[(_0x8666('0x17'))][(_0x8666('0x18'))](_0x8666('0x19'));}}else{return _0x4e90f5;}}function respondWithRpcPromise(_0x5dfa7a,_0xbc63ec,_0x33e817,_0xc79bc5){return new BPromise(function(_0x221cf5,_0x77252d){var _0x38d9fd=_0xc79bc5||client;return _0x38d9fd[_0x8666('0x1a')](_0x5dfa7a,_0x33e817)['then'](function(_0x218232){logger[_0x8666('0x1b')](_0x8666('0x1c'),_0xbc63ec,_0x8666('0x1d'));logger['debug'](_0x8666('0x1e'),_0xbc63ec,_0x8666('0x1d'),JSON[_0x8666('0x1f')](_0x218232));if(_0x218232[_0x8666('0x20')]){if(_0x218232[_0x8666('0x20')][_0x8666('0x21')]===0x1f4){logger[_0x8666('0x20')](_0x8666('0x1c'),_0xbc63ec,_0x218232[_0x8666('0x20')][_0x8666('0x22')]);return _0x77252d(_0x218232[_0x8666('0x20')][_0x8666('0x22')]);}logger[_0x8666('0x20')](_0x8666('0x1c'),_0xbc63ec,_0x218232[_0x8666('0x20')]['message']);return _0x221cf5(_0x218232['error']['message']);}else{logger[_0x8666('0x1b')]('ZendeskConfiguration,\x20%s,\x20%s',_0xbc63ec,_0x8666('0x1d'));_0x221cf5(_0x218232['result'][_0x8666('0x22')]);}})[_0x8666('0x23')](function(_0x336872){logger[_0x8666('0x20')](_0x8666('0x1c'),_0xbc63ec,_0x336872);_0x77252d(_0x336872);});});}function respondWithStatusCode(_0x4c654f,_0x13fd82){_0x13fd82=_0x13fd82||0xcc;return function(_0x4376e6){if(_0x4376e6){return _0x4c654f['sendStatus'](_0x13fd82);}return _0x4c654f[_0x8666('0x24')](_0x13fd82)[_0x8666('0x25')]();};}function respondWithResult(_0x1e23b3,_0x526bc3){_0x526bc3=_0x526bc3||0xc8;return function(_0x3cee9e){if(_0x3cee9e){return _0x1e23b3[_0x8666('0x24')](_0x526bc3)['json'](_0x3cee9e);}};}function respondWithFilteredResult(_0x7d4f16,_0x352e5c){return function(_0x590383){if(_0x590383){var _0x3a545c=_0x590383[_0x8666('0x26')],_0x23ed67=_0x352e5c[_0x8666('0x27')],_0x40c91d=_0x352e5c[_0x8666('0x27')]+_0x352e5c[_0x8666('0x28')],_0x21935a;if(_0x40c91d>=_0x3a545c){_0x40c91d=_0x3a545c;_0x21935a=0xc8;}else{_0x21935a=0xce;}_0x7d4f16[_0x8666('0x24')](_0x21935a);return _0x7d4f16[_0x8666('0x29')](_0x8666('0x2a'),_0x23ed67+'-'+_0x40c91d+'/'+_0x3a545c)['json'](_0x590383);}return null;};}function patchUpdates(_0xc7a7e1){return function(_0x5291b6){try{jsonpatch[_0x8666('0x2b')](_0x5291b6,_0xc7a7e1,!![]);}catch(_0x156746){return BPromise[_0x8666('0x2c')](_0x156746);}return _0x5291b6[_0x8666('0x2d')]();};}function saveUpdates(_0x1f8480,_0x220c59){return function(_0x5936bd){if(_0x5936bd){return _0x5936bd[_0x8666('0x2e')](_0x1f8480)[_0x8666('0x2f')](function(_0x4f2d6a){return _0x4f2d6a;});}return null;};}function removeEntity(_0x2944a5,_0x49e9d1){return function(_0x5251f3){if(_0x5251f3){return _0x5251f3[_0x8666('0x30')]()[_0x8666('0x2f')](function(){_0x2944a5[_0x8666('0x24')](0xcc)[_0x8666('0x25')]();});}};}function handleEntityNotFound(_0x38c3bb,_0xb5df5){return function(_0x40231f){if(!_0x40231f){_0x38c3bb[_0x8666('0x31')](0x194);}return _0x40231f;};}function handleError(_0x38000e,_0x4e1223){_0x4e1223=_0x4e1223||0x1f4;return function(_0x26a6e5){logger['error'](_0x26a6e5[_0x8666('0x32')]);if(_0x26a6e5[_0x8666('0x33')]){delete _0x26a6e5[_0x8666('0x33')];}_0x38000e[_0x8666('0x24')](_0x4e1223)[_0x8666('0x34')](_0x26a6e5);};}exports['index']=function(_0x47c03c,_0x4706cc){var _0x3aec38={},_0x1d1353={},_0x22d66c={'count':0x0,'rows':[]};var _0x3014f0=_[_0x8666('0x35')](db[_0x8666('0x36')][_0x8666('0x37')],function(_0x551ab9){return{'name':_0x551ab9[_0x8666('0x38')],'type':_0x551ab9['type'][_0x8666('0x39')]};});_0x1d1353[_0x8666('0x3a')]=_[_0x8666('0x35')](_0x3014f0,_0x8666('0x33'));_0x1d1353[_0x8666('0x3b')]=_['keys'](_0x47c03c[_0x8666('0x3b')]);_0x1d1353[_0x8666('0x3c')]=_[_0x8666('0x3d')](_0x1d1353[_0x8666('0x3a')],_0x1d1353['query']);_0x3aec38[_0x8666('0x3e')]=_[_0x8666('0x3d')](_0x1d1353[_0x8666('0x3a')],qs[_0x8666('0x3f')](_0x47c03c['query'][_0x8666('0x3f')]));_0x3aec38[_0x8666('0x3e')]=_0x3aec38[_0x8666('0x3e')][_0x8666('0x40')]?_0x3aec38[_0x8666('0x3e')]:_0x1d1353[_0x8666('0x3a')];if(!_0x47c03c[_0x8666('0x3b')]['hasOwnProperty']('nolimit')){_0x3aec38['limit']=qs['limit'](_0x47c03c[_0x8666('0x3b')][_0x8666('0x28')]);_0x3aec38['offset']=qs['offset'](_0x47c03c[_0x8666('0x3b')][_0x8666('0x27')]);}_0x3aec38[_0x8666('0x41')]=qs[_0x8666('0x42')](_0x47c03c[_0x8666('0x3b')][_0x8666('0x42')]);_0x3aec38[_0x8666('0x43')]=qs[_0x8666('0x3c')](_['pick'](_0x47c03c[_0x8666('0x3b')],_0x1d1353['filters']),_0x3014f0);if(_0x47c03c[_0x8666('0x3b')]['filter']){_0x3aec38['where']=_[_0x8666('0x44')](_0x3aec38['where'],{'$or':_['map'](_0x3014f0,function(_0x2e5778){if(_0x2e5778[_0x8666('0x45')]!=='VIRTUAL'){var _0x4c6676={};_0x4c6676[_0x2e5778[_0x8666('0x33')]]={'$like':'%'+_0x47c03c['query'][_0x8666('0x46')]+'%'};return _0x4c6676;}})});}_0x3aec38=_[_0x8666('0x44')]({},_0x3aec38,_0x47c03c[_0x8666('0x47')]);var _0x3eb0d0={'where':_0x3aec38[_0x8666('0x43')]};return db['ZendeskConfiguration'][_0x8666('0x26')](_0x3eb0d0)[_0x8666('0x2f')](function(_0x5236b8){_0x22d66c[_0x8666('0x26')]=_0x5236b8;if(_0x47c03c[_0x8666('0x3b')]['includeAll']){_0x3aec38[_0x8666('0x48')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x8666('0x49')](_0x3aec38);})[_0x8666('0x2f')](function(_0xedc59){_0x22d66c[_0x8666('0x4a')]=_0xedc59;return _0x22d66c;})[_0x8666('0x2f')](respondWithFilteredResult(_0x4706cc,_0x3aec38))[_0x8666('0x23')](handleError(_0x4706cc,null));};exports['show']=function(_0x22513a,_0x416b61){var _0x2e9946={'raw':![],'where':{'id':_0x22513a[_0x8666('0x4b')]['id']}},_0x35581f={};_0x35581f[_0x8666('0x3a')]=_['keys'](db['ZendeskConfiguration'][_0x8666('0x37')]);_0x35581f[_0x8666('0x3b')]=_['keys'](_0x22513a['query']);_0x35581f[_0x8666('0x3c')]=_['intersection'](_0x35581f[_0x8666('0x3a')],_0x35581f[_0x8666('0x3b')]);_0x2e9946['attributes']=_[_0x8666('0x3d')](_0x35581f[_0x8666('0x3a')],qs['fields'](_0x22513a['query'][_0x8666('0x3f')]));_0x2e9946['attributes']=_0x2e9946[_0x8666('0x3e')][_0x8666('0x40')]?_0x2e9946[_0x8666('0x3e')]:_0x35581f['model'];if(_0x22513a[_0x8666('0x3b')]['includeAll']){_0x2e9946['include']=[{'all':!![]}];}_0x2e9946=_[_0x8666('0x44')]({},_0x2e9946,_0x22513a[_0x8666('0x47')]);return db[_0x8666('0x36')]['find'](_0x2e9946)['then'](handleEntityNotFound(_0x416b61,null))[_0x8666('0x2f')](respondWithResult(_0x416b61,null))['catch'](handleError(_0x416b61,null));};exports[_0x8666('0x4c')]=function(_0x1e1b02,_0x556526){return db[_0x8666('0x36')][_0x8666('0x4c')](_0x1e1b02[_0x8666('0x4d')],{})[_0x8666('0x2f')](respondWithResult(_0x556526,0xc9))['catch'](handleError(_0x556526,null));};exports['update']=function(_0x417565,_0x8c54a5){if(_0x417565[_0x8666('0x4d')]['id']){delete _0x417565[_0x8666('0x4d')]['id'];}return db[_0x8666('0x36')]['find']({'where':{'id':_0x417565['params']['id']}})[_0x8666('0x2f')](handleEntityNotFound(_0x8c54a5,null))[_0x8666('0x2f')](saveUpdates(_0x417565[_0x8666('0x4d')],null))[_0x8666('0x2f')](respondWithResult(_0x8c54a5,null))['catch'](handleError(_0x8c54a5,null));};exports[_0x8666('0x30')]=function(_0x5edede,_0x430dc2){return db['ZendeskConfiguration'][_0x8666('0x4e')]({'where':{'id':_0x5edede['params']['id']}})['then'](handleEntityNotFound(_0x430dc2,null))['then'](removeEntity(_0x430dc2,null))[_0x8666('0x23')](handleError(_0x430dc2,null));};exports['getFields']=function(_0x3391c6,_0x33705c,_0x1e92ce){var _0x327dce={};var _0x4e4805={};var _0x1393bb;var _0x423f54;return db[_0x8666('0x36')][_0x8666('0x4f')]({'where':{'id':_0x3391c6['params']['id']}})[_0x8666('0x2f')](handleEntityNotFound(_0x33705c,null))['then'](function(_0x552da0){if(_0x552da0){_0x1393bb=_0x552da0;_0x4e4805[_0x8666('0x3a')]=_['keys'](db[_0x8666('0x50')][_0x8666('0x37')]);_0x4e4805[_0x8666('0x3b')]=_[_0x8666('0x51')](_0x3391c6[_0x8666('0x3b')]);_0x4e4805[_0x8666('0x3c')]=_[_0x8666('0x3d')](_0x4e4805[_0x8666('0x3a')],_0x4e4805[_0x8666('0x3b')]);_0x327dce['attributes']=_[_0x8666('0x3d')](_0x4e4805[_0x8666('0x3a')],qs[_0x8666('0x3f')](_0x3391c6['query'][_0x8666('0x3f')]));_0x327dce[_0x8666('0x3e')]=_0x327dce[_0x8666('0x3e')]['length']?_0x327dce[_0x8666('0x3e')]:_0x4e4805[_0x8666('0x3a')];_0x327dce['order']=qs[_0x8666('0x42')](_0x3391c6[_0x8666('0x3b')][_0x8666('0x42')]);_0x327dce['where']=qs['filters'](_[_0x8666('0x52')](_0x3391c6[_0x8666('0x3b')],_0x4e4805[_0x8666('0x3c')]));if(_0x3391c6[_0x8666('0x3b')][_0x8666('0x46')]){_0x327dce[_0x8666('0x43')]=_['merge'](_0x327dce['where'],{'$or':_[_0x8666('0x35')](_0x327dce[_0x8666('0x3e')],function(_0x2974ee){var _0x2e0b2c={};_0x2e0b2c[_0x2974ee]={'$like':'%'+_0x3391c6['query'][_0x8666('0x46')]+'%'};return _0x2e0b2c;})});}_0x327dce=_['merge']({},_0x327dce,_0x3391c6[_0x8666('0x47')]);return _0x1393bb[_0x8666('0x53')](_0x327dce);}})[_0x8666('0x2f')](function(_0x45b9c7){if(_0x45b9c7){_0x423f54=_0x45b9c7[_0x8666('0x40')];if(!_0x3391c6[_0x8666('0x3b')][_0x8666('0x54')](_0x8666('0x55'))){_0x327dce[_0x8666('0x28')]=qs[_0x8666('0x28')](_0x3391c6[_0x8666('0x3b')]['limit']);_0x327dce[_0x8666('0x27')]=qs[_0x8666('0x27')](_0x3391c6[_0x8666('0x3b')]['offset']);}return _0x1393bb[_0x8666('0x53')](_0x327dce);}})[_0x8666('0x2f')](function(_0xf3e07e){if(_0xf3e07e){return _0xf3e07e?{'count':_0x423f54,'rows':_0xf3e07e}:null;}})[_0x8666('0x2f')](respondWithResult(_0x33705c,null))['catch'](handleError(_0x33705c,null));};exports[_0x8666('0x56')]=function(_0x273d2a,_0xa40086,_0x36172b){var _0x4133d9={};var _0x1543f9={};var _0x25b458;var _0x5d2ee3;return db[_0x8666('0x36')][_0x8666('0x4f')]({'where':{'id':_0x273d2a[_0x8666('0x4b')]['id']}})['then'](handleEntityNotFound(_0xa40086,null))[_0x8666('0x2f')](function(_0x2bd453){if(_0x2bd453){_0x25b458=_0x2bd453;_0x1543f9['model']=_['keys'](db[_0x8666('0x50')]['rawAttributes']);_0x1543f9[_0x8666('0x3b')]=_[_0x8666('0x51')](_0x273d2a[_0x8666('0x3b')]);_0x1543f9[_0x8666('0x3c')]=_['intersection'](_0x1543f9['model'],_0x1543f9[_0x8666('0x3b')]);_0x4133d9[_0x8666('0x3e')]=_[_0x8666('0x3d')](_0x1543f9[_0x8666('0x3a')],qs[_0x8666('0x3f')](_0x273d2a[_0x8666('0x3b')]['fields']));_0x4133d9[_0x8666('0x3e')]=_0x4133d9[_0x8666('0x3e')]['length']?_0x4133d9['attributes']:_0x1543f9[_0x8666('0x3a')];_0x4133d9['order']=qs[_0x8666('0x42')](_0x273d2a['query'][_0x8666('0x42')]);_0x4133d9[_0x8666('0x43')]=qs[_0x8666('0x3c')](_[_0x8666('0x52')](_0x273d2a[_0x8666('0x3b')],_0x1543f9[_0x8666('0x3c')]));if(_0x273d2a[_0x8666('0x3b')][_0x8666('0x46')]){_0x4133d9[_0x8666('0x43')]=_[_0x8666('0x44')](_0x4133d9[_0x8666('0x43')],{'$or':_[_0x8666('0x35')](_0x4133d9[_0x8666('0x3e')],function(_0x5f0f5a){var _0x3b674a={};_0x3b674a[_0x5f0f5a]={'$like':'%'+_0x273d2a[_0x8666('0x3b')][_0x8666('0x46')]+'%'};return _0x3b674a;})});}_0x4133d9=_[_0x8666('0x44')]({},_0x4133d9,_0x273d2a[_0x8666('0x47')]);return _0x25b458[_0x8666('0x56')](_0x4133d9);}})[_0x8666('0x2f')](function(_0x5965e4){if(_0x5965e4){_0x5d2ee3=_0x5965e4[_0x8666('0x40')];if(!_0x273d2a[_0x8666('0x3b')][_0x8666('0x54')](_0x8666('0x55'))){_0x4133d9[_0x8666('0x28')]=qs[_0x8666('0x28')](_0x273d2a[_0x8666('0x3b')][_0x8666('0x28')]);_0x4133d9[_0x8666('0x27')]=qs[_0x8666('0x27')](_0x273d2a[_0x8666('0x3b')]['offset']);}return _0x25b458['getSubjects'](_0x4133d9);}})['then'](function(_0x5e0c71){if(_0x5e0c71){return _0x5e0c71?{'count':_0x5d2ee3,'rows':_0x5e0c71}:null;}})[_0x8666('0x2f')](respondWithResult(_0xa40086,null))[_0x8666('0x23')](handleError(_0xa40086,null));};exports[_0x8666('0x57')]=function(_0x2c9b2d,_0x243334,_0x2c2cd7){var _0x1405fe={};var _0x2b7ea6={};var _0x502f90;var _0xaa533b;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2c9b2d['params']['id']}})['then'](handleEntityNotFound(_0x243334,null))['then'](function(_0x1fac5a){if(_0x1fac5a){_0x502f90=_0x1fac5a;_0x2b7ea6[_0x8666('0x3a')]=_['keys'](db['ZendeskField'][_0x8666('0x37')]);_0x2b7ea6[_0x8666('0x3b')]=_[_0x8666('0x51')](_0x2c9b2d[_0x8666('0x3b')]);_0x2b7ea6[_0x8666('0x3c')]=_['intersection'](_0x2b7ea6[_0x8666('0x3a')],_0x2b7ea6[_0x8666('0x3b')]);_0x1405fe[_0x8666('0x3e')]=_[_0x8666('0x3d')](_0x2b7ea6[_0x8666('0x3a')],qs[_0x8666('0x3f')](_0x2c9b2d[_0x8666('0x3b')][_0x8666('0x3f')]));_0x1405fe[_0x8666('0x3e')]=_0x1405fe[_0x8666('0x3e')][_0x8666('0x40')]?_0x1405fe[_0x8666('0x3e')]:_0x2b7ea6[_0x8666('0x3a')];_0x1405fe[_0x8666('0x41')]=qs[_0x8666('0x42')](_0x2c9b2d[_0x8666('0x3b')][_0x8666('0x42')]);_0x1405fe[_0x8666('0x43')]=qs[_0x8666('0x3c')](_['pick'](_0x2c9b2d[_0x8666('0x3b')],_0x2b7ea6[_0x8666('0x3c')]));if(_0x2c9b2d[_0x8666('0x3b')][_0x8666('0x46')]){_0x1405fe[_0x8666('0x43')]=_[_0x8666('0x44')](_0x1405fe[_0x8666('0x43')],{'$or':_[_0x8666('0x35')](_0x1405fe[_0x8666('0x3e')],function(_0x15b344){var _0x27f8bc={};_0x27f8bc[_0x15b344]={'$like':'%'+_0x2c9b2d['query'][_0x8666('0x46')]+'%'};return _0x27f8bc;})});}_0x1405fe=_[_0x8666('0x44')]({},_0x1405fe,_0x2c9b2d[_0x8666('0x47')]);return _0x502f90['getDescriptions'](_0x1405fe);}})[_0x8666('0x2f')](function(_0x375f20){if(_0x375f20){_0xaa533b=_0x375f20['length'];if(!_0x2c9b2d[_0x8666('0x3b')]['hasOwnProperty'](_0x8666('0x55'))){_0x1405fe['limit']=qs[_0x8666('0x28')](_0x2c9b2d['query'][_0x8666('0x28')]);_0x1405fe[_0x8666('0x27')]=qs[_0x8666('0x27')](_0x2c9b2d[_0x8666('0x3b')][_0x8666('0x27')]);}return _0x502f90[_0x8666('0x57')](_0x1405fe);}})[_0x8666('0x2f')](function(_0x16a3c2){if(_0x16a3c2){return _0x16a3c2?{'count':_0xaa533b,'rows':_0x16a3c2}:null;}})[_0x8666('0x2f')](respondWithResult(_0x243334,null))[_0x8666('0x23')](handleError(_0x243334,null));};exports[_0x8666('0x58')]=function(_0x42f214,_0x378240,_0x44b896){var _0x277bc4={};var _0x495082={};var _0x427be3;var _0xcd97d8;return db[_0x8666('0x36')][_0x8666('0x4f')]({'where':{'id':_0x42f214['params']['id']}})['then'](handleEntityNotFound(_0x378240,null))[_0x8666('0x2f')](function(_0x5c22e9){if(_0x5c22e9){_0x427be3=_0x5c22e9;_0x495082[_0x8666('0x3a')]=_['keys'](db[_0x8666('0x59')][_0x8666('0x37')]);_0x495082['query']=_[_0x8666('0x51')](_0x42f214['query']);_0x495082[_0x8666('0x3c')]=_[_0x8666('0x3d')](_0x495082[_0x8666('0x3a')],_0x495082[_0x8666('0x3b')]);_0x277bc4[_0x8666('0x3e')]=_['intersection'](_0x495082[_0x8666('0x3a')],qs[_0x8666('0x3f')](_0x42f214['query'][_0x8666('0x3f')]));_0x277bc4[_0x8666('0x3e')]=_0x277bc4['attributes'][_0x8666('0x40')]?_0x277bc4[_0x8666('0x3e')]:_0x495082[_0x8666('0x3a')];_0x277bc4[_0x8666('0x41')]=qs[_0x8666('0x42')](_0x42f214[_0x8666('0x3b')]['sort']);_0x277bc4[_0x8666('0x43')]=qs[_0x8666('0x3c')](_['pick'](_0x42f214[_0x8666('0x3b')],_0x495082[_0x8666('0x3c')]));if(_0x42f214['query'][_0x8666('0x46')]){_0x277bc4[_0x8666('0x43')]=_[_0x8666('0x44')](_0x277bc4[_0x8666('0x43')],{'$or':_[_0x8666('0x35')](_0x277bc4[_0x8666('0x3e')],function(_0x16442e){var _0x28886c={};_0x28886c[_0x16442e]={'$like':'%'+_0x42f214[_0x8666('0x3b')]['filter']+'%'};return _0x28886c;})});}_0x277bc4=_[_0x8666('0x44')]({},_0x277bc4,_0x42f214[_0x8666('0x47')]);return _0x427be3[_0x8666('0x58')](_0x277bc4);}})[_0x8666('0x2f')](function(_0x179be5){if(_0x179be5){_0xcd97d8=_0x179be5['length'];if(!_0x42f214[_0x8666('0x3b')][_0x8666('0x54')](_0x8666('0x55'))){_0x277bc4[_0x8666('0x28')]=qs[_0x8666('0x28')](_0x42f214[_0x8666('0x3b')][_0x8666('0x28')]);_0x277bc4[_0x8666('0x27')]=qs['offset'](_0x42f214[_0x8666('0x3b')][_0x8666('0x27')]);}return _0x427be3['getTags'](_0x277bc4);}})[_0x8666('0x2f')](function(_0x1a16f3){if(_0x1a16f3){return _0x1a16f3?{'count':_0xcd97d8,'rows':_0x1a16f3}:null;}})[_0x8666('0x2f')](respondWithResult(_0x378240,null))[_0x8666('0x23')](handleError(_0x378240,null));};exports['setTags']=function(_0x34868d,_0x32bacd,_0x16ee64){if(_0x34868d['body']['id']){delete _0x34868d[_0x8666('0x4d')]['id'];}return db[_0x8666('0x36')][_0x8666('0x4f')]({'where':{'id':_0x34868d[_0x8666('0x4b')]['id']}})[_0x8666('0x2f')](handleEntityNotFound(_0x32bacd,null))[_0x8666('0x2f')](function(_0x513c8){if(_0x513c8){return _0x513c8[_0x8666('0x5a')](_0x34868d[_0x8666('0x4d')][_0x8666('0x5b')]||[]);}return null;})[_0x8666('0x2f')](respondWithResult(_0x32bacd,null))['catch'](handleError(_0x32bacd,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
index 975bf37..9b264ca 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2619=['bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','util','api','moment'];(function(_0x5b5e43,_0x2a5f33){var _0x337596=function(_0xcf1cfe){while(--_0xcf1cfe){_0x5b5e43['push'](_0x5b5e43['shift']());}};_0x337596(++_0x2a5f33);}(_0x2619,0x168));var _0x9261=function(_0xc96648,_0x550944){_0xc96648=_0xc96648-0x0;var _0x46c5d9=_0x2619[_0xc96648];return _0x46c5d9;};'use strict';var _=require('lodash');var util=require(_0x9261('0x0'));var logger=require('../../config/logger')(_0x9261('0x1'));var moment=require(_0x9261('0x2'));var BPromise=require(_0x9261('0x3'));var rp=require(_0x9261('0x4'));var fs=require('fs');var path=require(_0x9261('0x5'));var rimraf=require('rimraf');var config=require(_0x9261('0x6'));var attributes=require(_0x9261('0x7'));module[_0x9261('0x8')]=function(_0x3e06ab,_0xaa3f90){return _0x3e06ab[_0x9261('0x9')]('ZendeskConfiguration',attributes,{'tableName':_0x9261('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5039=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x569540,_0x140c34){var _0x376ca7=function(_0x867e2a){while(--_0x867e2a){_0x569540['push'](_0x569540['shift']());}};_0x376ca7(++_0x140c34);}(_0x5039,0xf2));var _0x9503=function(_0x154cb5,_0x1a8d5a){_0x154cb5=_0x154cb5-0x0;var _0x3f574f=_0x5039[_0x154cb5];return _0x3f574f;};'use strict';var _=require('lodash');var util=require(_0x9503('0x0'));var logger=require(_0x9503('0x1'))('api');var moment=require(_0x9503('0x2'));var BPromise=require(_0x9503('0x3'));var rp=require(_0x9503('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9503('0x5'));var attributes=require(_0x9503('0x6'));module[_0x9503('0x7')]=function(_0x109a63,_0x1c2372){return _0x109a63[_0x9503('0x8')](_0x9503('0x9'),attributes,{'tableName':_0x9503('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
index e4c399a..ad911ed 100644
--- a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
+++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca6d=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x8e6e61,_0x46ee60){var _0x5507c0=function(_0x1e0b9c){while(--_0x1e0b9c){_0x8e6e61['push'](_0x8e6e61['shift']());}};_0x5507c0(++_0x46ee60);}(_0xca6d,0x74));var _0xdca6=function(_0xc3b08e,_0x427235){_0xc3b08e=_0xc3b08e-0x0;var _0x4c5e08=_0xca6d[_0xc3b08e];return _0x4c5e08;};'use strict';var _=require(_0xdca6('0x0'));var util=require(_0xdca6('0x1'));var moment=require(_0xdca6('0x2'));var BPromise=require(_0xdca6('0x3'));var rs=require(_0xdca6('0x4'));var fs=require('fs');var Redis=require(_0xdca6('0x5'));var db=require(_0xdca6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdca6('0x7'));var config=require('../../config/environment');var jayson=require(_0xdca6('0x8'));var client=jayson[_0xdca6('0x9')][_0xdca6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548822,_0x5ae1ef,_0x557300){return new BPromise(function(_0x379b24,_0x47419f){return client[_0xdca6('0xb')](_0x548822,_0x557300)[_0xdca6('0xc')](function(_0x9e16bb){logger['info'](_0xdca6('0xd'),_0x5ae1ef,_0xdca6('0xe'));logger[_0xdca6('0xf')](_0xdca6('0x10'),_0x5ae1ef,_0xdca6('0xe'),JSON[_0xdca6('0x11')](_0x9e16bb));if(_0x9e16bb['error']){if(_0x9e16bb[_0xdca6('0x12')][_0xdca6('0x13')]===0x1f4){logger[_0xdca6('0x12')](_0xdca6('0xd'),_0x5ae1ef,_0x9e16bb['error']['message']);return _0x47419f(_0x9e16bb[_0xdca6('0x12')]['message']);}logger[_0xdca6('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5ae1ef,_0x9e16bb[_0xdca6('0x12')][_0xdca6('0x14')]);return _0x379b24(_0x9e16bb['error'][_0xdca6('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x5ae1ef,_0xdca6('0xe'));_0x379b24(_0x9e16bb[_0xdca6('0x15')]['message']);}})[_0xdca6('0x16')](function(_0x583417){logger['error'](_0xdca6('0xd'),_0x5ae1ef,_0x583417);_0x47419f(_0x583417);});});}
\ No newline at end of file
+var _0x70d8=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0xdcf291,_0x3b3a1f){var _0x12093c=function(_0xcaeef3){while(--_0xcaeef3){_0xdcf291['push'](_0xdcf291['shift']());}};_0x12093c(++_0x3b3a1f);}(_0x70d8,0xe4));var _0x870d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x70d8[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x870d('0x0'));var util=require('util');var moment=require(_0x870d('0x1'));var BPromise=require(_0x870d('0x2'));var rs=require(_0x870d('0x3'));var fs=require('fs');var Redis=require(_0x870d('0x4'));var db=require(_0x870d('0x5'))['db'];var utils=require(_0x870d('0x6'));var logger=require(_0x870d('0x7'))('rpc');var config=require(_0x870d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x870d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x455c06,_0x5a9b4a,_0x21ab77){return new BPromise(function(_0x776052,_0x540047){return client['request'](_0x455c06,_0x21ab77)['then'](function(_0x1d57d2){logger['info'](_0x870d('0xa'),_0x5a9b4a,_0x870d('0xb'));logger[_0x870d('0xc')](_0x870d('0xd'),_0x5a9b4a,_0x870d('0xb'),JSON[_0x870d('0xe')](_0x1d57d2));if(_0x1d57d2[_0x870d('0xf')]){if(_0x1d57d2[_0x870d('0xf')]['code']===0x1f4){logger[_0x870d('0xf')](_0x870d('0xa'),_0x5a9b4a,_0x1d57d2['error'][_0x870d('0x10')]);return _0x540047(_0x1d57d2[_0x870d('0xf')][_0x870d('0x10')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5a9b4a,_0x1d57d2[_0x870d('0xf')][_0x870d('0x10')]);return _0x776052(_0x1d57d2['error'][_0x870d('0x10')]);}else{logger[_0x870d('0x11')](_0x870d('0xa'),_0x5a9b4a,_0x870d('0xb'));_0x776052(_0x1d57d2[_0x870d('0x12')][_0x870d('0x10')]);}})[_0x870d('0x13')](function(_0x269fc8){logger[_0x870d('0xf')](_0x870d('0xa'),_0x5a9b4a,_0x269fc8);_0x540047(_0x269fc8);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js
index 3896f3b..3b03232 100644
--- a/server/api/intZendeskField/index.js
+++ b/server/api/intZendeskField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d1f=['Router','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','path','connect-timeout'];(function(_0x139c07,_0x5b120c){var _0xda8e22=function(_0x37d955){while(--_0x37d955){_0x139c07['push'](_0x139c07['shift']());}};_0xda8e22(++_0x5b120c);}(_0x3d1f,0x163));var _0xf3d1=function(_0x15b593,_0x28767f){_0x15b593=_0x15b593-0x0;var _0x2c285f=_0x3d1f[_0x15b593];return _0x2c285f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf3d1('0x0'));var timeout=require(_0xf3d1('0x1'));var express=require('express');var router=express[_0xf3d1('0x2')]();var auth=require(_0xf3d1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf3d1('0x4'));var controller=require(_0xf3d1('0x5'));router[_0xf3d1('0x6')]('/',auth['isAuthenticated'](),controller[_0xf3d1('0x7')]);router[_0xf3d1('0x6')](_0xf3d1('0x8'),auth[_0xf3d1('0x9')](),controller[_0xf3d1('0xa')]);router[_0xf3d1('0xb')]('/',auth[_0xf3d1('0x9')](),controller[_0xf3d1('0xc')]);router[_0xf3d1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xf3d1('0xe')]);router['delete']('/:id',auth[_0xf3d1('0x9')](),controller[_0xf3d1('0xf')]);module[_0xf3d1('0x10')]=router;
\ No newline at end of file
+var _0xf9a6=['index','get','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller'];(function(_0x24852d,_0x200599){var _0x1f5a84=function(_0x1bb56d){while(--_0x1bb56d){_0x24852d['push'](_0x24852d['shift']());}};_0x1f5a84(++_0x200599);}(_0xf9a6,0xd8));var _0x6f9a=function(_0x3c0874,_0x5c2663){_0x3c0874=_0x3c0874-0x0;var _0x402eb6=_0xf9a6[_0x3c0874];return _0x402eb6;};'use strict';var multer=require(_0x6f9a('0x0'));var util=require(_0x6f9a('0x1'));var path=require(_0x6f9a('0x2'));var timeout=require(_0x6f9a('0x3'));var express=require(_0x6f9a('0x4'));var router=express['Router']();var auth=require(_0x6f9a('0x5'));var interaction=require(_0x6f9a('0x6'));var config=require('../../config/environment');var controller=require(_0x6f9a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6f9a('0x8')]);router[_0x6f9a('0x9')](_0x6f9a('0xa'),auth[_0x6f9a('0xb')](),controller['show']);router[_0x6f9a('0xc')]('/',auth[_0x6f9a('0xb')](),controller['create']);router['put']('/:id',auth[_0x6f9a('0xb')](),controller['update']);router[_0x6f9a('0xd')](_0x6f9a('0xa'),auth[_0x6f9a('0xb')](),controller[_0x6f9a('0xe')]);module[_0x6f9a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js
index d9db404..3979f4a 100644
--- a/server/api/intZendeskField/intZendeskField.attributes.js
+++ b/server/api/intZendeskField/intZendeskField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x66fa=['sequelize','exports','ENUM','customVariable','keyValue','string','STRING','variable','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66fa,0x168));var _0xa66f=function(_0x222170,_0x4cffcf){_0x222170=_0x222170-0x0;var _0x4dd378=_0x66fa[_0x222170];return _0x4dd378;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'type':{'type':Sequelize[_0xa66f('0x2')]('string','variable',_0xa66f('0x3'),_0xa66f('0x4')),'defaultValue':_0xa66f('0x5')},'content':{'type':Sequelize[_0xa66f('0x6')]},'key':{'type':Sequelize[_0xa66f('0x6')]},'keyType':{'type':Sequelize[_0xa66f('0x2')](_0xa66f('0x5'),_0xa66f('0x7'),_0xa66f('0x3'))},'keyContent':{'type':Sequelize[_0xa66f('0x6')]},'idField':{'type':Sequelize[_0xa66f('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa66f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x432b=['customVariable','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x4753f3,_0xfa186e){var _0x124353=function(_0x43a04a){while(--_0x43a04a){_0x4753f3['push'](_0x4753f3['shift']());}};_0x124353(++_0xfa186e);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb432('0x0'));module['exports']={'type':{'type':Sequelize[_0xb432('0x1')](_0xb432('0x2'),_0xb432('0x3'),_0xb432('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xb432('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb432('0x1')]('string',_0xb432('0x3'),_0xb432('0x4'))},'keyContent':{'type':Sequelize[_0xb432('0x5')]},'idField':{'type':Sequelize[_0xb432('0x5')]},'nameField':{'type':Sequelize[_0xb432('0x5')]},'customField':{'type':Sequelize[_0xb432('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb432('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js
index 1da5971..367986c 100644
--- a/server/api/intZendeskField/intZendeskField.controller.js
+++ b/server/api/intZendeskField/intZendeskField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc0e=['filters','intersection','model','query','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','map','keys'];(function(_0x358c99,_0x4c17ab){var _0x354267=function(_0x21d4e4){while(--_0x21d4e4){_0x358c99['push'](_0x358c99['shift']());}};_0x354267(++_0x4c17ab);}(_0xfc0e,0x1d4));var _0xefc0=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0xfc0e[_0xf6e75d];return _0x27514d;};'use strict';var pdf=require(_0xefc0('0x0'));var emlformat=require(_0xefc0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xefc0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefc0('0x3'));var moment=require(_0xefc0('0x4'));var BPromise=require(_0xefc0('0x5'));var Mustache=require(_0xefc0('0x6'));var util=require(_0xefc0('0x7'));var path=require(_0xefc0('0x8'));var sox=require(_0xefc0('0x9'));var csv=require(_0xefc0('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xefc0('0xb'));var squel=require(_0xefc0('0xc'));var crypto=require(_0xefc0('0xd'));var jsforce=require(_0xefc0('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xefc0('0xf'));var Redis=require(_0xefc0('0x10'));var authService=require(_0xefc0('0x11'));var qs=require(_0xefc0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefc0('0x13'));var logger=require(_0xefc0('0x14'))(_0xefc0('0x15'));var utils=require(_0xefc0('0x16'));var config=require(_0xefc0('0x17'));var db=require(_0xefc0('0x18'))['db'];function respondWithStatusCode(_0x4f81da,_0x558b3d){_0x558b3d=_0x558b3d||0xcc;return function(_0x57d220){if(_0x57d220){return _0x4f81da['sendStatus'](_0x558b3d);}return _0x4f81da[_0xefc0('0x19')](_0x558b3d)[_0xefc0('0x1a')]();};}function respondWithResult(_0x225861,_0xf01e44){_0xf01e44=_0xf01e44||0xc8;return function(_0x10882a){if(_0x10882a){return _0x225861[_0xefc0('0x19')](_0xf01e44)['json'](_0x10882a);}};}function respondWithFilteredResult(_0x4f9b87,_0x38366a){return function(_0x959c59){if(_0x959c59){var _0x15947f=_0x959c59[_0xefc0('0x1b')],_0x180d8a=_0x38366a['offset'],_0x14ee89=_0x38366a[_0xefc0('0x1c')]+_0x38366a[_0xefc0('0x1d')],_0x5c6647;if(_0x14ee89>=_0x15947f){_0x14ee89=_0x15947f;_0x5c6647=0xc8;}else{_0x5c6647=0xce;}_0x4f9b87[_0xefc0('0x19')](_0x5c6647);return _0x4f9b87[_0xefc0('0x1e')]('Content-Range',_0x180d8a+'-'+_0x14ee89+'/'+_0x15947f)[_0xefc0('0x1f')](_0x959c59);}return null;};}function patchUpdates(_0x47197f){return function(_0x389557){try{jsonpatch[_0xefc0('0x20')](_0x389557,_0x47197f,!![]);}catch(_0xb27d61){return BPromise[_0xefc0('0x21')](_0xb27d61);}return _0x389557['save']();};}function saveUpdates(_0x1c6688,_0x42a1cf){return function(_0x56102c){if(_0x56102c){return _0x56102c[_0xefc0('0x22')](_0x1c6688)[_0xefc0('0x23')](function(_0x1edfc5){return _0x1edfc5;});}return null;};}function removeEntity(_0xa8d006,_0x135a5){return function(_0x39c023){if(_0x39c023){return _0x39c023[_0xefc0('0x24')]()[_0xefc0('0x23')](function(){_0xa8d006[_0xefc0('0x19')](0xcc)[_0xefc0('0x1a')]();});}};}function handleEntityNotFound(_0x5d698a,_0x4da9c3){return function(_0x41b115){if(!_0x41b115){_0x5d698a[_0xefc0('0x25')](0x194);}return _0x41b115;};}function handleError(_0x1b9771,_0x452885){_0x452885=_0x452885||0x1f4;return function(_0x59ad7a){logger[_0xefc0('0x26')](_0x59ad7a[_0xefc0('0x27')]);if(_0x59ad7a[_0xefc0('0x28')]){delete _0x59ad7a[_0xefc0('0x28')];}_0x1b9771[_0xefc0('0x19')](_0x452885)[_0xefc0('0x29')](_0x59ad7a);};}exports[_0xefc0('0x2a')]=function(_0x50d2ed,_0x10cd53){var _0x5a7a7a={},_0x6605e2={},_0x5583e1={'count':0x0,'rows':[]};var _0x44ebc5=_['map'](db[_0xefc0('0x2b')][_0xefc0('0x2c')],function(_0x367ae8){return{'name':_0x367ae8[_0xefc0('0x2d')],'type':_0x367ae8[_0xefc0('0x2e')][_0xefc0('0x2f')]};});_0x6605e2['model']=_[_0xefc0('0x30')](_0x44ebc5,_0xefc0('0x28'));_0x6605e2['query']=_[_0xefc0('0x31')](_0x50d2ed['query']);_0x6605e2[_0xefc0('0x32')]=_[_0xefc0('0x33')](_0x6605e2[_0xefc0('0x34')],_0x6605e2[_0xefc0('0x35')]);_0x5a7a7a[_0xefc0('0x36')]=_['intersection'](_0x6605e2['model'],qs[_0xefc0('0x37')](_0x50d2ed['query']['fields']));_0x5a7a7a[_0xefc0('0x36')]=_0x5a7a7a[_0xefc0('0x36')]['length']?_0x5a7a7a[_0xefc0('0x36')]:_0x6605e2['model'];if(!_0x50d2ed[_0xefc0('0x35')][_0xefc0('0x38')]('nolimit')){_0x5a7a7a[_0xefc0('0x1d')]=qs[_0xefc0('0x1d')](_0x50d2ed[_0xefc0('0x35')]['limit']);_0x5a7a7a[_0xefc0('0x1c')]=qs[_0xefc0('0x1c')](_0x50d2ed[_0xefc0('0x35')]['offset']);}_0x5a7a7a[_0xefc0('0x39')]=qs[_0xefc0('0x3a')](_0x50d2ed['query'][_0xefc0('0x3a')]);_0x5a7a7a['where']=qs[_0xefc0('0x32')](_[_0xefc0('0x3b')](_0x50d2ed[_0xefc0('0x35')],_0x6605e2[_0xefc0('0x32')]),_0x44ebc5);if(_0x50d2ed[_0xefc0('0x35')][_0xefc0('0x3c')]){_0x5a7a7a[_0xefc0('0x3d')]=_[_0xefc0('0x3e')](_0x5a7a7a[_0xefc0('0x3d')],{'$or':_[_0xefc0('0x30')](_0x44ebc5,function(_0x34aff2){if(_0x34aff2[_0xefc0('0x2e')]!==_0xefc0('0x3f')){var _0x4549f5={};_0x4549f5[_0x34aff2['name']]={'$like':'%'+_0x50d2ed[_0xefc0('0x35')]['filter']+'%'};return _0x4549f5;}})});}_0x5a7a7a=_[_0xefc0('0x3e')]({},_0x5a7a7a,_0x50d2ed[_0xefc0('0x40')]);var _0x210f8e={'where':_0x5a7a7a[_0xefc0('0x3d')]};return db[_0xefc0('0x2b')][_0xefc0('0x1b')](_0x210f8e)[_0xefc0('0x23')](function(_0x5281fb){_0x5583e1[_0xefc0('0x1b')]=_0x5281fb;if(_0x50d2ed[_0xefc0('0x35')][_0xefc0('0x41')]){_0x5a7a7a[_0xefc0('0x42')]=[{'all':!![]}];}return db[_0xefc0('0x2b')]['findAll'](_0x5a7a7a);})[_0xefc0('0x23')](function(_0x5ede33){_0x5583e1[_0xefc0('0x43')]=_0x5ede33;return _0x5583e1;})['then'](respondWithFilteredResult(_0x10cd53,_0x5a7a7a))[_0xefc0('0x44')](handleError(_0x10cd53,null));};exports[_0xefc0('0x45')]=function(_0x41c323,_0x5c23ac){var _0x267a22={'raw':!![],'where':{'id':_0x41c323[_0xefc0('0x46')]['id']}},_0x8e98bc={};_0x8e98bc[_0xefc0('0x34')]=_[_0xefc0('0x31')](db[_0xefc0('0x2b')][_0xefc0('0x2c')]);_0x8e98bc[_0xefc0('0x35')]=_[_0xefc0('0x31')](_0x41c323[_0xefc0('0x35')]);_0x8e98bc[_0xefc0('0x32')]=_['intersection'](_0x8e98bc[_0xefc0('0x34')],_0x8e98bc[_0xefc0('0x35')]);_0x267a22[_0xefc0('0x36')]=_[_0xefc0('0x33')](_0x8e98bc['model'],qs[_0xefc0('0x37')](_0x41c323[_0xefc0('0x35')][_0xefc0('0x37')]));_0x267a22[_0xefc0('0x36')]=_0x267a22[_0xefc0('0x36')]['length']?_0x267a22[_0xefc0('0x36')]:_0x8e98bc[_0xefc0('0x34')];if(_0x41c323['query'][_0xefc0('0x41')]){_0x267a22['include']=[{'all':!![]}];}_0x267a22=_[_0xefc0('0x3e')]({},_0x267a22,_0x41c323[_0xefc0('0x40')]);return db[_0xefc0('0x2b')][_0xefc0('0x47')](_0x267a22)['then'](handleEntityNotFound(_0x5c23ac,null))[_0xefc0('0x23')](respondWithResult(_0x5c23ac,null))[_0xefc0('0x44')](handleError(_0x5c23ac,null));};exports['create']=function(_0x581115,_0x15a942){return db[_0xefc0('0x2b')][_0xefc0('0x48')](_0x581115[_0xefc0('0x49')],{})[_0xefc0('0x23')](respondWithResult(_0x15a942,0xc9))[_0xefc0('0x44')](handleError(_0x15a942,null));};exports[_0xefc0('0x22')]=function(_0x591a63,_0x4738e7){if(_0x591a63[_0xefc0('0x49')]['id']){delete _0x591a63['body']['id'];}return db[_0xefc0('0x2b')][_0xefc0('0x47')]({'where':{'id':_0x591a63['params']['id']}})[_0xefc0('0x23')](handleEntityNotFound(_0x4738e7,null))[_0xefc0('0x23')](saveUpdates(_0x591a63[_0xefc0('0x49')],null))[_0xefc0('0x23')](respondWithResult(_0x4738e7,null))[_0xefc0('0x44')](handleError(_0x4738e7,null));};exports[_0xefc0('0x24')]=function(_0x58f1f5,_0x3aa216){return db[_0xefc0('0x2b')][_0xefc0('0x47')]({'where':{'id':_0x58f1f5[_0xefc0('0x46')]['id']}})['then'](handleEntityNotFound(_0x3aa216,null))[_0xefc0('0x23')](removeEntity(_0x3aa216,null))[_0xefc0('0x44')](handleError(_0x3aa216,null));};
\ No newline at end of file
+var _0x4ff4=['model','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskField','includeAll','include','findAll','rows','catch','params','find','create','update','body','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length'];(function(_0x53e42f,_0x4bf244){var _0x8e1c36=function(_0x4c4456){while(--_0x4c4456){_0x53e42f['push'](_0x53e42f['shift']());}};_0x8e1c36(++_0x4bf244);}(_0x4ff4,0x184));var _0x44ff=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0x4ff4[_0x16dbcd];return _0x34706e;};'use strict';var pdf=require(_0x44ff('0x0'));var emlformat=require(_0x44ff('0x1'));var rimraf=require(_0x44ff('0x2'));var zipdir=require(_0x44ff('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x44ff('0x4'));var moment=require(_0x44ff('0x5'));var BPromise=require(_0x44ff('0x6'));var Mustache=require(_0x44ff('0x7'));var util=require('util');var path=require(_0x44ff('0x8'));var sox=require('sox');var csv=require(_0x44ff('0x9'));var ejs=require(_0x44ff('0xa'));var fs=require('fs');var _=require(_0x44ff('0xb'));var squel=require('squel');var crypto=require(_0x44ff('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x44ff('0xd'));var toCsv=require(_0x44ff('0x9'));var querystring=require(_0x44ff('0xe'));var Papa=require(_0x44ff('0xf'));var Redis=require('ioredis');var authService=require(_0x44ff('0x10'));var qs=require(_0x44ff('0x11'));var as=require(_0x44ff('0x12'));var hardwareService=require(_0x44ff('0x13'));var logger=require('../../config/logger')(_0x44ff('0x14'));var utils=require('../../config/utils');var config=require(_0x44ff('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32ebaf,_0x475b91){_0x475b91=_0x475b91||0xcc;return function(_0x4c3d11){if(_0x4c3d11){return _0x32ebaf[_0x44ff('0x16')](_0x475b91);}return _0x32ebaf[_0x44ff('0x17')](_0x475b91)[_0x44ff('0x18')]();};}function respondWithResult(_0x4f4a5f,_0x190270){_0x190270=_0x190270||0xc8;return function(_0x267473){if(_0x267473){return _0x4f4a5f[_0x44ff('0x17')](_0x190270)[_0x44ff('0x19')](_0x267473);}};}function respondWithFilteredResult(_0x34ab3c,_0x265b1f){return function(_0x140a3f){if(_0x140a3f){var _0x43374a=_0x140a3f[_0x44ff('0x1a')],_0x2c960a=_0x265b1f[_0x44ff('0x1b')],_0x11bff7=_0x265b1f[_0x44ff('0x1b')]+_0x265b1f['limit'],_0x26d1e2;if(_0x11bff7>=_0x43374a){_0x11bff7=_0x43374a;_0x26d1e2=0xc8;}else{_0x26d1e2=0xce;}_0x34ab3c['status'](_0x26d1e2);return _0x34ab3c['set'](_0x44ff('0x1c'),_0x2c960a+'-'+_0x11bff7+'/'+_0x43374a)[_0x44ff('0x19')](_0x140a3f);}return null;};}function patchUpdates(_0x9d23a9){return function(_0x32a19f){try{jsonpatch[_0x44ff('0x1d')](_0x32a19f,_0x9d23a9,!![]);}catch(_0x15a5ff){return BPromise[_0x44ff('0x1e')](_0x15a5ff);}return _0x32a19f[_0x44ff('0x1f')]();};}function saveUpdates(_0x3f00bf,_0x13223f){return function(_0x5598d3){if(_0x5598d3){return _0x5598d3['update'](_0x3f00bf)[_0x44ff('0x20')](function(_0x341fcf){return _0x341fcf;});}return null;};}function removeEntity(_0x495c40,_0x48af1e){return function(_0x5536ae){if(_0x5536ae){return _0x5536ae['destroy']()[_0x44ff('0x20')](function(){_0x495c40[_0x44ff('0x17')](0xcc)[_0x44ff('0x18')]();});}};}function handleEntityNotFound(_0x36e0c4,_0x26ec0e){return function(_0x4c7a46){if(!_0x4c7a46){_0x36e0c4['sendStatus'](0x194);}return _0x4c7a46;};}function handleError(_0x5009da,_0x43d12a){_0x43d12a=_0x43d12a||0x1f4;return function(_0x500637){logger[_0x44ff('0x21')](_0x500637[_0x44ff('0x22')]);if(_0x500637['name']){delete _0x500637[_0x44ff('0x23')];}_0x5009da[_0x44ff('0x17')](_0x43d12a)[_0x44ff('0x24')](_0x500637);};}exports[_0x44ff('0x25')]=function(_0x58b1ea,_0x34257d){var _0x4bab6e={},_0x5df85e={},_0x43f279={'count':0x0,'rows':[]};var _0x51495e=_[_0x44ff('0x26')](db['ZendeskField'][_0x44ff('0x27')],function(_0x218676){return{'name':_0x218676[_0x44ff('0x28')],'type':_0x218676[_0x44ff('0x29')][_0x44ff('0x2a')]};});_0x5df85e['model']=_['map'](_0x51495e,_0x44ff('0x23'));_0x5df85e['query']=_[_0x44ff('0x2b')](_0x58b1ea[_0x44ff('0x2c')]);_0x5df85e[_0x44ff('0x2d')]=_[_0x44ff('0x2e')](_0x5df85e['model'],_0x5df85e['query']);_0x4bab6e[_0x44ff('0x2f')]=_[_0x44ff('0x2e')](_0x5df85e['model'],qs[_0x44ff('0x30')](_0x58b1ea[_0x44ff('0x2c')][_0x44ff('0x30')]));_0x4bab6e[_0x44ff('0x2f')]=_0x4bab6e[_0x44ff('0x2f')][_0x44ff('0x31')]?_0x4bab6e[_0x44ff('0x2f')]:_0x5df85e[_0x44ff('0x32')];if(!_0x58b1ea[_0x44ff('0x2c')][_0x44ff('0x33')](_0x44ff('0x34'))){_0x4bab6e['limit']=qs[_0x44ff('0x35')](_0x58b1ea[_0x44ff('0x2c')][_0x44ff('0x35')]);_0x4bab6e['offset']=qs[_0x44ff('0x1b')](_0x58b1ea['query']['offset']);}_0x4bab6e['order']=qs[_0x44ff('0x36')](_0x58b1ea[_0x44ff('0x2c')][_0x44ff('0x36')]);_0x4bab6e[_0x44ff('0x37')]=qs['filters'](_[_0x44ff('0x38')](_0x58b1ea[_0x44ff('0x2c')],_0x5df85e['filters']),_0x51495e);if(_0x58b1ea[_0x44ff('0x2c')][_0x44ff('0x39')]){_0x4bab6e['where']=_[_0x44ff('0x3a')](_0x4bab6e[_0x44ff('0x37')],{'$or':_[_0x44ff('0x26')](_0x51495e,function(_0x29ddbc){if(_0x29ddbc['type']!==_0x44ff('0x3b')){var _0xadce56={};_0xadce56[_0x29ddbc[_0x44ff('0x23')]]={'$like':'%'+_0x58b1ea[_0x44ff('0x2c')][_0x44ff('0x39')]+'%'};return _0xadce56;}})});}_0x4bab6e=_['merge']({},_0x4bab6e,_0x58b1ea[_0x44ff('0x3c')]);var _0x8b6e39={'where':_0x4bab6e[_0x44ff('0x37')]};return db[_0x44ff('0x3d')][_0x44ff('0x1a')](_0x8b6e39)[_0x44ff('0x20')](function(_0x55b89d){_0x43f279[_0x44ff('0x1a')]=_0x55b89d;if(_0x58b1ea[_0x44ff('0x2c')][_0x44ff('0x3e')]){_0x4bab6e[_0x44ff('0x3f')]=[{'all':!![]}];}return db[_0x44ff('0x3d')][_0x44ff('0x40')](_0x4bab6e);})[_0x44ff('0x20')](function(_0x5281f0){_0x43f279[_0x44ff('0x41')]=_0x5281f0;return _0x43f279;})['then'](respondWithFilteredResult(_0x34257d,_0x4bab6e))[_0x44ff('0x42')](handleError(_0x34257d,null));};exports['show']=function(_0x1dfb52,_0x39492f){var _0x4337b1={'raw':!![],'where':{'id':_0x1dfb52[_0x44ff('0x43')]['id']}},_0x167e11={};_0x167e11[_0x44ff('0x32')]=_[_0x44ff('0x2b')](db[_0x44ff('0x3d')][_0x44ff('0x27')]);_0x167e11[_0x44ff('0x2c')]=_['keys'](_0x1dfb52['query']);_0x167e11[_0x44ff('0x2d')]=_[_0x44ff('0x2e')](_0x167e11[_0x44ff('0x32')],_0x167e11[_0x44ff('0x2c')]);_0x4337b1[_0x44ff('0x2f')]=_[_0x44ff('0x2e')](_0x167e11['model'],qs[_0x44ff('0x30')](_0x1dfb52[_0x44ff('0x2c')][_0x44ff('0x30')]));_0x4337b1['attributes']=_0x4337b1[_0x44ff('0x2f')][_0x44ff('0x31')]?_0x4337b1['attributes']:_0x167e11['model'];if(_0x1dfb52[_0x44ff('0x2c')]['includeAll']){_0x4337b1['include']=[{'all':!![]}];}_0x4337b1=_[_0x44ff('0x3a')]({},_0x4337b1,_0x1dfb52[_0x44ff('0x3c')]);return db[_0x44ff('0x3d')][_0x44ff('0x44')](_0x4337b1)[_0x44ff('0x20')](handleEntityNotFound(_0x39492f,null))[_0x44ff('0x20')](respondWithResult(_0x39492f,null))['catch'](handleError(_0x39492f,null));};exports['create']=function(_0x40441d,_0x3f58c3){return db[_0x44ff('0x3d')][_0x44ff('0x45')](_0x40441d['body'],{})[_0x44ff('0x20')](respondWithResult(_0x3f58c3,0xc9))[_0x44ff('0x42')](handleError(_0x3f58c3,null));};exports[_0x44ff('0x46')]=function(_0x29e5d6,_0x50109d){if(_0x29e5d6[_0x44ff('0x47')]['id']){delete _0x29e5d6[_0x44ff('0x47')]['id'];}return db[_0x44ff('0x3d')][_0x44ff('0x44')]({'where':{'id':_0x29e5d6[_0x44ff('0x43')]['id']}})[_0x44ff('0x20')](handleEntityNotFound(_0x50109d,null))[_0x44ff('0x20')](saveUpdates(_0x29e5d6[_0x44ff('0x47')],null))[_0x44ff('0x20')](respondWithResult(_0x50109d,null))['catch'](handleError(_0x50109d,null));};exports[_0x44ff('0x48')]=function(_0x4d23c,_0x23b28e){return db['ZendeskField'][_0x44ff('0x44')]({'where':{'id':_0x4d23c[_0x44ff('0x43')]['id']}})[_0x44ff('0x20')](handleEntityNotFound(_0x23b28e,null))['then'](removeEntity(_0x23b28e,null))['catch'](handleError(_0x23b28e,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js
index 833d43f..2a97c3c 100644
--- a/server/api/intZendeskField/intZendeskField.model.js
+++ b/server/api/intZendeskField/intZendeskField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a5c=['exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes'];(function(_0x7c3bae,_0x2fb37d){var _0x460159=function(_0x5d7644){while(--_0x5d7644){_0x7c3bae['push'](_0x7c3bae['shift']());}};_0x460159(++_0x2fb37d);}(_0x8a5c,0x136));var _0xc8a5=function(_0x2a8087,_0x457331){_0x2a8087=_0x2a8087-0x0;var _0x200dbe=_0x8a5c[_0x2a8087];return _0x200dbe;};'use strict';var _=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var logger=require(_0xc8a5('0x2'))(_0xc8a5('0x3'));var moment=require(_0xc8a5('0x4'));var BPromise=require(_0xc8a5('0x5'));var rp=require(_0xc8a5('0x6'));var fs=require('fs');var path=require(_0xc8a5('0x7'));var rimraf=require(_0xc8a5('0x8'));var config=require('../../config/environment');var attributes=require(_0xc8a5('0x9'));module[_0xc8a5('0xa')]=function(_0x5b6cc2,_0x1b4ed4){return _0x5b6cc2[_0xc8a5('0xb')](_0xc8a5('0xc'),attributes,{'tableName':_0xc8a5('0xd'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xc8a5('0xe'),_0xc8a5('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd87e=['int_zendesk_fields','zendesk_unique_index','idField','lodash','util','api','moment','bluebird','path','../../config/environment','./intZendeskField.attributes','ZendeskField'];(function(_0x465147,_0x240ccd){var _0x5449b5=function(_0x3d7dce){while(--_0x3d7dce){_0x465147['push'](_0x465147['shift']());}};_0x5449b5(++_0x240ccd);}(_0xd87e,0x1bf));var _0xed87=function(_0x5ed024,_0x20fcac){_0x5ed024=_0x5ed024-0x0;var _0x529b32=_0xd87e[_0x5ed024];return _0x529b32;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var logger=require('../../config/logger')(_0xed87('0x2'));var moment=require(_0xed87('0x3'));var BPromise=require(_0xed87('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed87('0x5'));var rimraf=require('rimraf');var config=require(_0xed87('0x6'));var attributes=require(_0xed87('0x7'));module['exports']=function(_0x17adfe,_0x589fb9){return _0x17adfe['define'](_0xed87('0x8'),attributes,{'tableName':_0xed87('0x9'),'paranoid':![],'indexes':[{'name':_0xed87('0xa'),'fields':[_0xed87('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js
index 59f061b..211d72d 100644
--- a/server/api/intZendeskField/intZendeskField.rpc.js
+++ b/server/api/intZendeskField/intZendeskField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3095=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment'];(function(_0x3c4298,_0x35155f){var _0x4517ae=function(_0x46e2c4){while(--_0x46e2c4){_0x3c4298['push'](_0x3c4298['shift']());}};_0x4517ae(++_0x35155f);}(_0x3095,0xc6));var _0x5309=function(_0x5cbcdf,_0x2224a4){_0x5cbcdf=_0x5cbcdf-0x0;var _0x4be16f=_0x3095[_0x5cbcdf];return _0x4be16f;};'use strict';var _=require('lodash');var util=require(_0x5309('0x0'));var moment=require(_0x5309('0x1'));var BPromise=require(_0x5309('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5309('0x3'));var db=require(_0x5309('0x4'))['db'];var utils=require(_0x5309('0x5'));var logger=require(_0x5309('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5309('0x7'));var client=jayson[_0x5309('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5755ba,_0x45a496,_0x1628c3){return new BPromise(function(_0x50873c,_0x1b73b5){return client[_0x5309('0x9')](_0x5755ba,_0x1628c3)[_0x5309('0xa')](function(_0x3ac459){logger[_0x5309('0xb')](_0x5309('0xc'),_0x45a496,_0x5309('0xd'));logger[_0x5309('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x45a496,_0x5309('0xd'),JSON['stringify'](_0x3ac459));if(_0x3ac459['error']){if(_0x3ac459[_0x5309('0xf')][_0x5309('0x10')]===0x1f4){logger['error'](_0x5309('0xc'),_0x45a496,_0x3ac459[_0x5309('0xf')][_0x5309('0x11')]);return _0x1b73b5(_0x3ac459['error']['message']);}logger['error'](_0x5309('0xc'),_0x45a496,_0x3ac459[_0x5309('0xf')]['message']);return _0x50873c(_0x3ac459[_0x5309('0xf')][_0x5309('0x11')]);}else{logger[_0x5309('0xb')]('ZendeskField,\x20%s,\x20%s',_0x45a496,'request\x20sent');_0x50873c(_0x3ac459[_0x5309('0x12')][_0x5309('0x11')]);}})[_0x5309('0x13')](function(_0xe3b701){logger[_0x5309('0xf')](_0x5309('0xc'),_0x45a496,_0xe3b701);_0x1b73b5(_0xe3b701);});});}
\ No newline at end of file
+var _0x8e4b=['http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3708c1,_0x1e5d1c){var _0x4cedf5=function(_0xebd76e){while(--_0xebd76e){_0x3708c1['push'](_0x3708c1['shift']());}};_0x4cedf5(++_0x1e5d1c);}(_0x8e4b,0x7a));var _0xb8e4=function(_0x3b6cc7,_0x5df0c1){_0x3b6cc7=_0x3b6cc7-0x0;var _0x37f564=_0x8e4b[_0x3b6cc7];return _0x37f564;};'use strict';var _=require(_0xb8e4('0x0'));var util=require('util');var moment=require(_0xb8e4('0x1'));var BPromise=require(_0xb8e4('0x2'));var rs=require(_0xb8e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8e4('0x4'))['db'];var utils=require(_0xb8e4('0x5'));var logger=require(_0xb8e4('0x6'))(_0xb8e4('0x7'));var config=require(_0xb8e4('0x8'));var jayson=require(_0xb8e4('0x9'));var client=jayson['client'][_0xb8e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d1c7,_0x25b330,_0x1e7476){return new BPromise(function(_0x4f9834,_0x223e72){return client[_0xb8e4('0xb')](_0x5d1c7,_0x1e7476)[_0xb8e4('0xc')](function(_0x3fd847){logger[_0xb8e4('0xd')](_0xb8e4('0xe'),_0x25b330,_0xb8e4('0xf'));logger['debug'](_0xb8e4('0x10'),_0x25b330,'request\x20sent',JSON[_0xb8e4('0x11')](_0x3fd847));if(_0x3fd847[_0xb8e4('0x12')]){if(_0x3fd847[_0xb8e4('0x12')][_0xb8e4('0x13')]===0x1f4){logger[_0xb8e4('0x12')](_0xb8e4('0xe'),_0x25b330,_0x3fd847['error'][_0xb8e4('0x14')]);return _0x223e72(_0x3fd847[_0xb8e4('0x12')][_0xb8e4('0x14')]);}logger[_0xb8e4('0x12')](_0xb8e4('0xe'),_0x25b330,_0x3fd847['error'][_0xb8e4('0x14')]);return _0x4f9834(_0x3fd847[_0xb8e4('0x12')][_0xb8e4('0x14')]);}else{logger[_0xb8e4('0xd')]('ZendeskField,\x20%s,\x20%s',_0x25b330,'request\x20sent');_0x4f9834(_0x3fd847[_0xb8e4('0x15')][_0xb8e4('0x14')]);}})['catch'](function(_0xa387af){logger[_0xb8e4('0x12')](_0xb8e4('0xe'),_0x25b330,_0xa387af);_0x223e72(_0xa387af);});});}
\ No newline at end of file
diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js
index 37ca856..9f07fff 100644
--- a/server/api/intZohoAccount/index.js
+++ b/server/api/intZohoAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08e3=['util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','/:id','destroy','exports','multer'];(function(_0x4c0ff1,_0x435923){var _0x56f73e=function(_0x349c73){while(--_0x349c73){_0x4c0ff1['push'](_0x4c0ff1['shift']());}};_0x56f73e(++_0x435923);}(_0x08e3,0x142));var _0x308e=function(_0x444ba8,_0x375704){_0x444ba8=_0x444ba8-0x0;var _0x325f47=_0x08e3[_0x444ba8];return _0x325f47;};'use strict';var multer=require(_0x308e('0x0'));var util=require(_0x308e('0x1'));var path=require('path');var timeout=require(_0x308e('0x2'));var express=require('express');var router=express[_0x308e('0x3')]();var auth=require(_0x308e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x308e('0x5'));var controller=require('./intZohoAccount.controller');router[_0x308e('0x6')]('/',auth[_0x308e('0x7')](),controller[_0x308e('0x8')]);router[_0x308e('0x6')]('/:id',auth[_0x308e('0x7')](),controller[_0x308e('0x9')]);router[_0x308e('0x6')](_0x308e('0xa'),auth[_0x308e('0x7')](),controller[_0x308e('0xb')]);router[_0x308e('0x6')]('/:id/fields',auth[_0x308e('0x7')](),controller[_0x308e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x308e('0xd')]);router[_0x308e('0xe')](_0x308e('0xa'),auth['isAuthenticated'](),controller[_0x308e('0xf')]);router['put'](_0x308e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x308e('0x11')]);module[_0x308e('0x12')]=router;
\ No newline at end of file
+var _0x5447=['util','connect-timeout','express','Router','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','create','put','update','delete','destroy','exports','multer'];(function(_0x112404,_0x2ec8e0){var _0x40b7f3=function(_0x393738){while(--_0x393738){_0x112404['push'](_0x112404['shift']());}};_0x40b7f3(++_0x2ec8e0);}(_0x5447,0x1a3));var _0x7544=function(_0x3e9d7e,_0x2978ef){_0x3e9d7e=_0x3e9d7e-0x0;var _0x43faea=_0x5447[_0x3e9d7e];return _0x43faea;};'use strict';var multer=require(_0x7544('0x0'));var util=require(_0x7544('0x1'));var path=require('path');var timeout=require(_0x7544('0x2'));var express=require(_0x7544('0x3'));var router=express[_0x7544('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7544('0x5'));var controller=require(_0x7544('0x6'));router[_0x7544('0x7')]('/',auth[_0x7544('0x8')](),controller[_0x7544('0x9')]);router[_0x7544('0x7')](_0x7544('0xa'),auth[_0x7544('0x8')](),controller[_0x7544('0xb')]);router[_0x7544('0x7')](_0x7544('0xc'),auth[_0x7544('0x8')](),controller[_0x7544('0xd')]);router[_0x7544('0x7')]('/:id/fields',auth[_0x7544('0x8')](),controller['getFields']);router[_0x7544('0xe')]('/',auth[_0x7544('0x8')](),controller[_0x7544('0xf')]);router['post'](_0x7544('0xc'),auth[_0x7544('0x8')](),controller['addConfiguration']);router[_0x7544('0x10')](_0x7544('0xa'),auth[_0x7544('0x8')](),controller[_0x7544('0x11')]);router[_0x7544('0x12')](_0x7544('0xa'),auth[_0x7544('0x8')](),controller[_0x7544('0x13')]);module[_0x7544('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js
index b68ac13..6a1caa9 100644
--- a/server/api/intZohoAccount/intZohoAccount.attributes.js
+++ b/server/api/intZohoAccount/intZohoAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe79=['STRING','sequelize','exports'];(function(_0x447193,_0x1b602d){var _0x410ddf=function(_0x71e1e9){while(--_0x71e1e9){_0x447193['push'](_0x447193['shift']());}};_0x410ddf(++_0x1b602d);}(_0xbe79,0x169));var _0x9be7=function(_0x4fac81,_0x1cf513){_0x4fac81=_0x4fac81-0x0;var _0xc117c1=_0xbe79[_0x4fac81];return _0xc117c1;};'use strict';var Sequelize=require(_0x9be7('0x0'));module[_0x9be7('0x1')]={'name':{'type':Sequelize[_0x9be7('0x2')]},'description':{'type':Sequelize[_0x9be7('0x2')]},'host':{'type':Sequelize[_0x9be7('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9be7('0x2')]},'clientSecret':{'type':Sequelize[_0x9be7('0x2')]},'serverUrl':{'type':Sequelize[_0x9be7('0x2')]},'code':{'type':Sequelize[_0x9be7('0x2')]},'refreshToken':{'type':Sequelize[_0x9be7('0x2')]}};
\ No newline at end of file
+var _0xf363=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf363,0x1ae));var _0x3f36=function(_0x20788c,_0x427555){_0x20788c=_0x20788c-0x0;var _0x5a9081=_0xf363[_0x20788c];return _0x5a9081;};'use strict';var Sequelize=require(_0x3f36('0x0'));module[_0x3f36('0x1')]={'name':{'type':Sequelize[_0x3f36('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3f36('0x2')]},'zone':{'type':Sequelize[_0x3f36('0x2')]},'clientId':{'type':Sequelize[_0x3f36('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x3f36('0x2')]},'code':{'type':Sequelize[_0x3f36('0x2')]},'refreshToken':{'type':Sequelize[_0x3f36('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js
index a86c081..8fc4a41 100644
--- a/server/api/intZohoAccount/intZohoAccount.controller.js
+++ b/server/api/intZohoAccount/intZohoAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5066=['getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','host','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','response','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','api_name','push','display_label','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','limit','set','apply','reject','update','then','name','index','map','ZohoAccount','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','count','include','findAll','rows','show','params','keys','rawAttributes','includeAll','options','create','body','find','pick','getConfigurations','addConfiguration','findOne','AccountId','Subjects'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0x5066,0x1ce));var _0x6506=function(_0x5aa6a9,_0x3ae14c){_0x5aa6a9=_0x5aa6a9-0x0;var _0x119ce5=_0x5066[_0x5aa6a9];return _0x119ce5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6506('0x0'));var rimraf=require(_0x6506('0x1'));var zipdir=require(_0x6506('0x2'));var jsonpatch=require(_0x6506('0x3'));var rp=require('request-promise');var moment=require(_0x6506('0x4'));var BPromise=require(_0x6506('0x5'));var Mustache=require(_0x6506('0x6'));var util=require(_0x6506('0x7'));var path=require(_0x6506('0x8'));var sox=require(_0x6506('0x9'));var csv=require(_0x6506('0xa'));var ejs=require(_0x6506('0xb'));var fs=require('fs');var _=require(_0x6506('0xc'));var squel=require(_0x6506('0xd'));var crypto=require(_0x6506('0xe'));var jsforce=require(_0x6506('0xf'));var deskjs=require(_0x6506('0x10'));var toCsv=require(_0x6506('0xa'));var querystring=require(_0x6506('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6506('0x12'));var qs=require(_0x6506('0x13'));var as=require(_0x6506('0x14'));var hardwareService=require(_0x6506('0x15'));var logger=require(_0x6506('0x16'))(_0x6506('0x17'));var utils=require('../../config/utils');var config=require(_0x6506('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6506('0x19'));var jayson=require(_0x6506('0x1a'));var client=jayson['client'][_0x6506('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x58790b,_0x2c14f8,_0x66d03a){if(_0x66d03a){var _0x81bb8d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x81bb8d[_0x6506('0x1c')](_0x2c14f8)){return _0x58790b;}else{throw new db[(_0x6506('0x1d'))][(_0x6506('0x1e'))](_0x6506('0x1f'));}}else{return _0x58790b;}}function respondWithRpcPromise(_0x4b9405,_0x133e91,_0x45de6a,_0x4b8ef4){return new BPromise(function(_0x1f90b4,_0x2728c6){var _0x4b7936=_0x4b8ef4||client;return _0x4b7936[_0x6506('0x20')](_0x4b9405,_0x45de6a)['then'](function(_0x3cf127){logger[_0x6506('0x21')](_0x6506('0x22'),_0x133e91,_0x6506('0x23'));logger[_0x6506('0x24')](_0x6506('0x25'),_0x133e91,_0x6506('0x23'),JSON[_0x6506('0x26')](_0x3cf127));if(_0x3cf127[_0x6506('0x27')]){if(_0x3cf127[_0x6506('0x27')][_0x6506('0x28')]===0x1f4){logger[_0x6506('0x27')]('ZohoAccount,\x20%s,\x20%s',_0x133e91,_0x3cf127['error'][_0x6506('0x29')]);return _0x2728c6(_0x3cf127[_0x6506('0x27')][_0x6506('0x29')]);}logger[_0x6506('0x27')]('ZohoAccount,\x20%s,\x20%s',_0x133e91,_0x3cf127['error']['message']);return _0x1f90b4(_0x3cf127[_0x6506('0x27')][_0x6506('0x29')]);}else{logger[_0x6506('0x21')](_0x6506('0x22'),_0x133e91,_0x6506('0x23'));_0x1f90b4(_0x3cf127['result'][_0x6506('0x29')]);}})[_0x6506('0x2a')](function(_0x2322f7){logger['error'](_0x6506('0x22'),_0x133e91,_0x2322f7);_0x2728c6(_0x2322f7);});});}function respondWithStatusCode(_0x5edf08,_0x111758){_0x111758=_0x111758||0xcc;return function(_0x16e895){if(_0x16e895){return _0x5edf08[_0x6506('0x2b')](_0x111758);}return _0x5edf08[_0x6506('0x2c')](_0x111758)[_0x6506('0x2d')]();};}function respondWithResult(_0x2db65d,_0xfde7ee){_0xfde7ee=_0xfde7ee||0xc8;return function(_0x3be010){if(_0x3be010){return _0x2db65d[_0x6506('0x2c')](_0xfde7ee)[_0x6506('0x2e')](_0x3be010);}};}function respondWithFilteredResult(_0x374704,_0x41e245){return function(_0x5c24bc){if(_0x5c24bc){var _0x167540=_0x5c24bc['count'],_0x221cd4=_0x41e245['offset'],_0x43052c=_0x41e245['offset']+_0x41e245[_0x6506('0x2f')],_0xbb7a52;if(_0x43052c>=_0x167540){_0x43052c=_0x167540;_0xbb7a52=0xc8;}else{_0xbb7a52=0xce;}_0x374704['status'](_0xbb7a52);return _0x374704[_0x6506('0x30')]('Content-Range',_0x221cd4+'-'+_0x43052c+'/'+_0x167540)[_0x6506('0x2e')](_0x5c24bc);}return null;};}function patchUpdates(_0x49d8a0){return function(_0x2fbcc2){try{jsonpatch[_0x6506('0x31')](_0x2fbcc2,_0x49d8a0,!![]);}catch(_0x1f4756){return BPromise[_0x6506('0x32')](_0x1f4756);}return _0x2fbcc2['save']();};}function saveUpdates(_0x2afb61,_0x3e91cf){return function(_0xca1f1b){if(_0xca1f1b){return _0xca1f1b[_0x6506('0x33')](_0x2afb61)[_0x6506('0x34')](function(_0x27986e){return _0x27986e;});}return null;};}function removeEntity(_0x27bb43,_0x19cd1c){return function(_0x290443){if(_0x290443){return _0x290443['destroy']()[_0x6506('0x34')](function(){_0x27bb43[_0x6506('0x2c')](0xcc)[_0x6506('0x2d')]();});}};}function handleEntityNotFound(_0x11654c,_0x4497f8){return function(_0x6aa688){if(!_0x6aa688){_0x11654c[_0x6506('0x2b')](0x194);}return _0x6aa688;};}function handleError(_0x30b3d9,_0x562919){_0x562919=_0x562919||0x1f4;return function(_0x5d08cd){logger['error'](_0x5d08cd['stack']);if(_0x5d08cd['name']){delete _0x5d08cd[_0x6506('0x35')];}_0x30b3d9['status'](_0x562919)['send'](_0x5d08cd);};}exports[_0x6506('0x36')]=function(_0x5c80ff,_0x18f245){var _0x191946={},_0x3bf64f={},_0xab2181={'count':0x0,'rows':[]};var _0x5af782=_[_0x6506('0x37')](db[_0x6506('0x38')]['rawAttributes'],function(_0xf00054){return{'name':_0xf00054[_0x6506('0x39')],'type':_0xf00054[_0x6506('0x3a')]['key']};});_0x3bf64f['model']=_[_0x6506('0x37')](_0x5af782,_0x6506('0x35'));_0x3bf64f[_0x6506('0x3b')]=_['keys'](_0x5c80ff[_0x6506('0x3b')]);_0x3bf64f[_0x6506('0x3c')]=_[_0x6506('0x3d')](_0x3bf64f[_0x6506('0x3e')],_0x3bf64f[_0x6506('0x3b')]);_0x191946[_0x6506('0x3f')]=_['intersection'](_0x3bf64f['model'],qs['fields'](_0x5c80ff[_0x6506('0x3b')][_0x6506('0x40')]));_0x191946['attributes']=_0x191946[_0x6506('0x3f')][_0x6506('0x41')]?_0x191946[_0x6506('0x3f')]:_0x3bf64f[_0x6506('0x3e')];if(!_0x5c80ff[_0x6506('0x3b')][_0x6506('0x42')](_0x6506('0x43'))){_0x191946['limit']=qs[_0x6506('0x2f')](_0x5c80ff['query']['limit']);_0x191946[_0x6506('0x44')]=qs[_0x6506('0x44')](_0x5c80ff[_0x6506('0x3b')][_0x6506('0x44')]);}_0x191946[_0x6506('0x45')]=qs['sort'](_0x5c80ff[_0x6506('0x3b')][_0x6506('0x46')]);_0x191946[_0x6506('0x47')]=qs[_0x6506('0x3c')](_['pick'](_0x5c80ff[_0x6506('0x3b')],_0x3bf64f[_0x6506('0x3c')]),_0x5af782);if(_0x5c80ff['query'][_0x6506('0x48')]){_0x191946[_0x6506('0x47')]=_[_0x6506('0x49')](_0x191946[_0x6506('0x47')],{'$or':_[_0x6506('0x37')](_0x5af782,function(_0x4445bf){if(_0x4445bf['type']!==_0x6506('0x4a')){var _0x6e26b={};_0x6e26b[_0x4445bf[_0x6506('0x35')]]={'$like':'%'+_0x5c80ff[_0x6506('0x3b')][_0x6506('0x48')]+'%'};return _0x6e26b;}})});}_0x191946=_[_0x6506('0x49')]({},_0x191946,_0x5c80ff['options']);var _0x1dbca1={'where':_0x191946[_0x6506('0x47')]};return db[_0x6506('0x38')]['count'](_0x1dbca1)[_0x6506('0x34')](function(_0x23090a){_0xab2181[_0x6506('0x4b')]=_0x23090a;if(_0x5c80ff[_0x6506('0x3b')]['includeAll']){_0x191946[_0x6506('0x4c')]=[{'all':!![]}];}return db[_0x6506('0x38')][_0x6506('0x4d')](_0x191946);})[_0x6506('0x34')](function(_0x28b415){_0xab2181[_0x6506('0x4e')]=_0x28b415;return _0xab2181;})[_0x6506('0x34')](respondWithFilteredResult(_0x18f245,_0x191946))[_0x6506('0x2a')](handleError(_0x18f245,null));};exports[_0x6506('0x4f')]=function(_0x53fd06,_0x2e5105){var _0x23df9d={'raw':![],'where':{'id':_0x53fd06[_0x6506('0x50')]['id']}},_0x39cb22={};_0x39cb22['model']=_[_0x6506('0x51')](db['ZohoAccount'][_0x6506('0x52')]);_0x39cb22[_0x6506('0x3b')]=_[_0x6506('0x51')](_0x53fd06[_0x6506('0x3b')]);_0x39cb22[_0x6506('0x3c')]=_[_0x6506('0x3d')](_0x39cb22[_0x6506('0x3e')],_0x39cb22[_0x6506('0x3b')]);_0x23df9d[_0x6506('0x3f')]=_[_0x6506('0x3d')](_0x39cb22[_0x6506('0x3e')],qs[_0x6506('0x40')](_0x53fd06[_0x6506('0x3b')]['fields']));_0x23df9d[_0x6506('0x3f')]=_0x23df9d['attributes']['length']?_0x23df9d['attributes']:_0x39cb22[_0x6506('0x3e')];if(_0x53fd06['query'][_0x6506('0x53')]){_0x23df9d[_0x6506('0x4c')]=[{'all':!![]}];}_0x23df9d=_[_0x6506('0x49')]({},_0x23df9d,_0x53fd06[_0x6506('0x54')]);return db[_0x6506('0x38')]['find'](_0x23df9d)[_0x6506('0x34')](handleEntityNotFound(_0x2e5105,null))[_0x6506('0x34')](respondWithResult(_0x2e5105,null))[_0x6506('0x2a')](handleError(_0x2e5105,null));};exports['create']=function(_0x1f7d58,_0x42fe77){return db[_0x6506('0x38')][_0x6506('0x55')](_0x1f7d58[_0x6506('0x56')],{})[_0x6506('0x34')](respondWithResult(_0x42fe77,0xc9))[_0x6506('0x2a')](handleError(_0x42fe77,null));};exports['update']=function(_0x4e15f2,_0x324f76){if(_0x4e15f2[_0x6506('0x56')]['id']){delete _0x4e15f2[_0x6506('0x56')]['id'];}return db[_0x6506('0x38')][_0x6506('0x57')]({'where':{'id':_0x4e15f2['params']['id']}})[_0x6506('0x34')](handleEntityNotFound(_0x324f76,null))['then'](saveUpdates(_0x4e15f2['body'],null))['then'](respondWithResult(_0x324f76,null))[_0x6506('0x2a')](handleError(_0x324f76,null));};exports['destroy']=function(_0x15b0e3,_0x5c5fa3){return db[_0x6506('0x38')][_0x6506('0x57')]({'where':{'id':_0x15b0e3[_0x6506('0x50')]['id']}})[_0x6506('0x34')](handleEntityNotFound(_0x5c5fa3,null))[_0x6506('0x34')](removeEntity(_0x5c5fa3,null))['catch'](handleError(_0x5c5fa3,null));};exports['getConfigurations']=function(_0x13f7d5,_0x8f8c72,_0x7615bf){var _0x1cdcd7={};var _0x502d21={};var _0x4b6bf7;var _0x4df0b5;return db[_0x6506('0x38')]['findOne']({'where':{'id':_0x13f7d5[_0x6506('0x50')]['id']}})[_0x6506('0x34')](handleEntityNotFound(_0x8f8c72,null))[_0x6506('0x34')](function(_0x13a264){if(_0x13a264){_0x4b6bf7=_0x13a264;_0x502d21[_0x6506('0x3e')]=_[_0x6506('0x51')](db['ZohoConfiguration'][_0x6506('0x52')]);_0x502d21[_0x6506('0x3b')]=_[_0x6506('0x51')](_0x13f7d5['query']);_0x502d21[_0x6506('0x3c')]=_[_0x6506('0x3d')](_0x502d21[_0x6506('0x3e')],_0x502d21[_0x6506('0x3b')]);_0x1cdcd7[_0x6506('0x3f')]=_[_0x6506('0x3d')](_0x502d21[_0x6506('0x3e')],qs[_0x6506('0x40')](_0x13f7d5[_0x6506('0x3b')][_0x6506('0x40')]));_0x1cdcd7[_0x6506('0x3f')]=_0x1cdcd7[_0x6506('0x3f')][_0x6506('0x41')]?_0x1cdcd7[_0x6506('0x3f')]:_0x502d21['model'];_0x1cdcd7[_0x6506('0x45')]=qs[_0x6506('0x46')](_0x13f7d5[_0x6506('0x3b')][_0x6506('0x46')]);_0x1cdcd7[_0x6506('0x47')]=qs[_0x6506('0x3c')](_[_0x6506('0x58')](_0x13f7d5[_0x6506('0x3b')],_0x502d21['filters']));if(_0x13f7d5[_0x6506('0x3b')][_0x6506('0x48')]){_0x1cdcd7[_0x6506('0x47')]=_[_0x6506('0x49')](_0x1cdcd7[_0x6506('0x47')],{'$or':_[_0x6506('0x37')](_0x1cdcd7[_0x6506('0x3f')],function(_0x167200){var _0x8d490b={};_0x8d490b[_0x167200]={'$like':'%'+_0x13f7d5[_0x6506('0x3b')][_0x6506('0x48')]+'%'};return _0x8d490b;})});}_0x1cdcd7=_[_0x6506('0x49')]({},_0x1cdcd7,_0x13f7d5[_0x6506('0x54')]);return _0x4b6bf7[_0x6506('0x59')](_0x1cdcd7);}})[_0x6506('0x34')](function(_0x496005){if(_0x496005){_0x4df0b5=_0x496005[_0x6506('0x41')];if(!_0x13f7d5[_0x6506('0x3b')]['hasOwnProperty']('nolimit')){_0x1cdcd7[_0x6506('0x2f')]=qs[_0x6506('0x2f')](_0x13f7d5[_0x6506('0x3b')][_0x6506('0x2f')]);_0x1cdcd7[_0x6506('0x44')]=qs['offset'](_0x13f7d5[_0x6506('0x3b')]['offset']);}return _0x4b6bf7[_0x6506('0x59')](_0x1cdcd7);}})['then'](function(_0x57015e){if(_0x57015e){return _0x57015e?{'count':_0x4df0b5,'rows':_0x57015e}:null;}})[_0x6506('0x34')](respondWithResult(_0x8f8c72,null))[_0x6506('0x2a')](handleError(_0x8f8c72,null));};exports[_0x6506('0x5a')]=function(_0x46004e,_0x29919f,_0x16d307){if(_0x46004e['body']['id']){delete _0x46004e[_0x6506('0x56')]['id'];}return db['ZohoAccount'][_0x6506('0x5b')]({'where':{'id':_0x46004e[_0x6506('0x50')]['id']}})[_0x6506('0x34')](handleEntityNotFound(_0x29919f,null))['then'](function(_0x307fa9){if(_0x307fa9){_0x46004e[_0x6506('0x56')][_0x6506('0x5c')]=_0x307fa9['id'];_0x46004e[_0x6506('0x56')][_0x6506('0x5d')]=integrations[_0x6506('0x5e')](_0x46004e[_0x6506('0x56')][_0x6506('0x5f')],_0x46004e['body'][_0x6506('0x3a')]);_0x46004e[_0x6506('0x56')][_0x6506('0x60')]=integrations[_0x6506('0x61')](_0x46004e[_0x6506('0x56')][_0x6506('0x5f')],_0x46004e[_0x6506('0x56')][_0x6506('0x3a')]);return db['ZohoConfiguration'][_0x6506('0x55')](_0x46004e[_0x6506('0x56')],{'include':[{'model':db[_0x6506('0x62')],'as':_0x6506('0x5d')},{'model':db[_0x6506('0x62')],'as':_0x6506('0x60')}]});}return null;})[_0x6506('0x34')](respondWithResult(_0x29919f,null))['catch'](handleError(_0x29919f,null));};function getAccessToken(_0x19c867){return new Promise(function(_0xe099d4,_0x5bd67c){var _0x203094;switch(_0x19c867['zone']){case'US':_0x203094=_0x6506('0x63');break;case'AU':_0x203094=_0x6506('0x64');break;case'EU':_0x203094=_0x6506('0x65');break;case'IN':_0x203094=_0x6506('0x66');break;case'CN':_0x203094=_0x6506('0x67');break;default:_0x203094=_0x6506('0x65');break;}var _0x93b207={'method':_0x6506('0x68'),'uri':_0x203094+'/oauth/v2/token','qs':{'refresh_token':_0x19c867[_0x6506('0x69')],'client_id':_0x19c867[_0x6506('0x6a')],'client_secret':_0x19c867[_0x6506('0x6b')],'grant_type':_0x6506('0x6c')},'json':!![]};return rp(_0x93b207)[_0x6506('0x34')](function(_0x57ce1b){if(_0x57ce1b[_0x6506('0x6d')]){_0xe099d4(_0x57ce1b[_0x6506('0x6d')]);}else{_0x5bd67c(_0x6506('0x6e'));}})[_0x6506('0x2a')](function(_0x56b840){_0x5bd67c(_0x56b840);});});}exports[_0x6506('0x6f')]=function(_0x1a234a,_0x52cad4,_0xa2af97){var _0x11b934,_0xa456e9,_0x2addb6,_0x2ba77d,_0x11edd3;return db[_0x6506('0x38')][_0x6506('0x5b')]({'where':{'id':_0x1a234a[_0x6506('0x50')]['id']},'attributes':['id','host',_0x6506('0x70'),_0x6506('0x6a'),'clientSecret',_0x6506('0x71'),_0x6506('0x28'),_0x6506('0x69')]})[_0x6506('0x34')](handleEntityNotFound(_0x52cad4,null))[_0x6506('0x34')](function(_0x930500){_0x11edd3=_0x930500;_0x11b934=_0x11edd3[_0x6506('0x72')];_0xa456e9=_0x11b934===_0x6506('0x73')?'eu':_0x6506('0x74');_0x2addb6=_0x11edd3[_0x6506('0x71')];var _0x4d8878=_0x2addb6[_0x6506('0x75')](-0x1);if(_0x4d8878==='/'||_0x4d8878==='\x5c'||_0x4d8878===':'){_0x2addb6=_0x2addb6[_0x6506('0x76')](0x0,_0x2addb6[_0x6506('0x77')](_0x4d8878));}if(!_0x11edd3['refreshToken']){throw new Error(_0x6506('0x78'));}return getAccessToken(_0x11edd3);})[_0x6506('0x34')](function(_0x1665e8){if(_0x1665e8){return rp({'method':'GET','uri':util['format'](_0x6506('0x79'),_0xa456e9),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1665e8},'json':!![]});}})[_0x6506('0x34')](function(_0x25a8d9){if(_0x25a8d9){if(_0x25a8d9[_0x6506('0x7a')]&&_0x25a8d9[_0x6506('0x7a')][_0x6506('0x27')]){throw new Error(_0x25a8d9[_0x6506('0x7a')]['error'][_0x6506('0x29')]);}var _0x566b8a=[];var _0xaa1c2e=[];var _0x1ac6fe=[_0x6506('0x7b'),_0x6506('0x7c'),'Description',_0x6506('0x7d'),_0x6506('0x7e'),_0x6506('0x7f'),_0x6506('0x80'),'Call_Type'];_0xaa1c2e=_[_0x6506('0x81')](_0x25a8d9[_0x6506('0x40')],function(_0x5b539d){return _0x1ac6fe['includes'](_0x5b539d[_0x6506('0x82')]);});for(var _0x8c28a=0x0;_0x8c28a<_0xaa1c2e[_0x6506('0x41')];_0x8c28a++){if(_0xaa1c2e[_0x8c28a]['system_mandatory']===![]){_0x566b8a[_0x6506('0x83')]({'id':_0xaa1c2e[_0x8c28a]['id'],'name':_0xaa1c2e[_0x8c28a][_0x6506('0x84')],'custom':_0xaa1c2e[_0x8c28a]['custom_field'],'options':_0xaa1c2e[_0x8c28a]['data_type']===_0x6506('0x85')&&_0xaa1c2e[_0x8c28a][_0x6506('0x86')][_0x6506('0x41')]>-0x1?_[_0x6506('0x37')](_0xaa1c2e[_0x8c28a][_0x6506('0x86')],function(_0x18be95){return{'name':_0x18be95,'value':_0x18be95};}):[]});}}return{'count':_0x566b8a['length'],'rows':_0x566b8a};}else{return{'count':0x0,'rows':[]};}})[_0x6506('0x34')](respondWithResult(_0x52cad4,null))[_0x6506('0x2a')](function(_0xe694d){var _0xe5ecb4=_0x1a234a['query'][_0x6506('0x1c')]?0x1f4:_0xe694d['statusCode']||0x1f4;logger[_0x6506('0x27')](_0x6506('0x87'),_0x6506('0x6f'),_0xe5ecb4,JSON['stringify'](_0xe694d));delete _0xe694d['name'];if(_0xe5ecb4===0x191){_0xe5ecb4=0x190;}_0x52cad4[_0x6506('0x2c')](_0xe5ecb4)[_0x6506('0x88')](_0x1a234a[_0x6506('0x3b')][_0x6506('0x1c')]?{'message':_0x6506('0x89'),'statusCode':_0xe694d[_0x6506('0x8a')]}:_0xe694d);});};
\ No newline at end of file
+var _0xcfd1=['includeAll','include','findAll','rows','show','find','create','body','params','findOne','ZohoConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientId','clientSecret','refreshToken','host','com','serverUrl','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','path','sox','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','sendStatus','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcfd1,0x1d7));var _0x1cfd=function(_0x22080c,_0x2104dd){_0x22080c=_0x22080c-0x0;var _0x2fce17=_0xcfd1[_0x22080c];return _0x2fce17;};'use strict';var pdf=require(_0x1cfd('0x0'));var emlformat=require(_0x1cfd('0x1'));var rimraf=require(_0x1cfd('0x2'));var zipdir=require(_0x1cfd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1cfd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1cfd('0x5'));var sox=require(_0x1cfd('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1cfd('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x1cfd('0x8'));var toCsv=require(_0x1cfd('0x9'));var querystring=require(_0x1cfd('0xa'));var Papa=require(_0x1cfd('0xb'));var Redis=require(_0x1cfd('0xc'));var authService=require(_0x1cfd('0xd'));var qs=require(_0x1cfd('0xe'));var as=require(_0x1cfd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1cfd('0x10'))(_0x1cfd('0x11'));var utils=require(_0x1cfd('0x12'));var config=require(_0x1cfd('0x13'));var db=require(_0x1cfd('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x1cfd('0x15')][_0x1cfd('0x16')]({'port':0x232a});function checkPasswordPattern(_0x37fe43,_0x6caf9b,_0x299769){if(_0x299769){var _0x53d260=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53d260[_0x1cfd('0x17')](_0x6caf9b)){return _0x37fe43;}else{throw new db[(_0x1cfd('0x18'))]['ValidationError'](_0x1cfd('0x19'));}}else{return _0x37fe43;}}function respondWithRpcPromise(_0x1a1de3,_0x39221b,_0x3dd470,_0x251eff){return new BPromise(function(_0x2412f5,_0x269a38){var _0xaca497=_0x251eff||client;return _0xaca497[_0x1cfd('0x1a')](_0x1a1de3,_0x3dd470)[_0x1cfd('0x1b')](function(_0x40f0c7){logger['info'](_0x1cfd('0x1c'),_0x39221b,_0x1cfd('0x1d'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x39221b,_0x1cfd('0x1d'),JSON[_0x1cfd('0x1e')](_0x40f0c7));if(_0x40f0c7[_0x1cfd('0x1f')]){if(_0x40f0c7[_0x1cfd('0x1f')][_0x1cfd('0x20')]===0x1f4){logger[_0x1cfd('0x1f')](_0x1cfd('0x1c'),_0x39221b,_0x40f0c7[_0x1cfd('0x1f')][_0x1cfd('0x21')]);return _0x269a38(_0x40f0c7[_0x1cfd('0x1f')]['message']);}logger[_0x1cfd('0x1f')](_0x1cfd('0x1c'),_0x39221b,_0x40f0c7[_0x1cfd('0x1f')][_0x1cfd('0x21')]);return _0x2412f5(_0x40f0c7[_0x1cfd('0x1f')][_0x1cfd('0x21')]);}else{logger[_0x1cfd('0x22')](_0x1cfd('0x1c'),_0x39221b,_0x1cfd('0x1d'));_0x2412f5(_0x40f0c7['result'][_0x1cfd('0x21')]);}})[_0x1cfd('0x23')](function(_0xaa3bfb){logger[_0x1cfd('0x1f')](_0x1cfd('0x1c'),_0x39221b,_0xaa3bfb);_0x269a38(_0xaa3bfb);});});}function respondWithStatusCode(_0x269bfa,_0x5a1b42){_0x5a1b42=_0x5a1b42||0xcc;return function(_0x2157b5){if(_0x2157b5){return _0x269bfa['sendStatus'](_0x5a1b42);}return _0x269bfa[_0x1cfd('0x24')](_0x5a1b42)[_0x1cfd('0x25')]();};}function respondWithResult(_0x88342e,_0x1243c7){_0x1243c7=_0x1243c7||0xc8;return function(_0x268bb4){if(_0x268bb4){return _0x88342e['status'](_0x1243c7)[_0x1cfd('0x26')](_0x268bb4);}};}function respondWithFilteredResult(_0x48ed1e,_0x388640){return function(_0xc25268){if(_0xc25268){var _0x45ffa8=_0xc25268[_0x1cfd('0x27')],_0x3e4c55=_0x388640[_0x1cfd('0x28')],_0x440e80=_0x388640[_0x1cfd('0x28')]+_0x388640[_0x1cfd('0x29')],_0x4f347d;if(_0x440e80>=_0x45ffa8){_0x440e80=_0x45ffa8;_0x4f347d=0xc8;}else{_0x4f347d=0xce;}_0x48ed1e[_0x1cfd('0x24')](_0x4f347d);return _0x48ed1e[_0x1cfd('0x2a')](_0x1cfd('0x2b'),_0x3e4c55+'-'+_0x440e80+'/'+_0x45ffa8)[_0x1cfd('0x26')](_0xc25268);}return null;};}function patchUpdates(_0x15136c){return function(_0x38d68d){try{jsonpatch[_0x1cfd('0x2c')](_0x38d68d,_0x15136c,!![]);}catch(_0x2d5c18){return BPromise['reject'](_0x2d5c18);}return _0x38d68d[_0x1cfd('0x2d')]();};}function saveUpdates(_0x1acea1,_0x529c61){return function(_0x2918e5){if(_0x2918e5){return _0x2918e5['update'](_0x1acea1)['then'](function(_0xaf94de){return _0xaf94de;});}return null;};}function removeEntity(_0x44a8ad,_0x1b7c21){return function(_0x277f9c){if(_0x277f9c){return _0x277f9c[_0x1cfd('0x2e')]()['then'](function(){_0x44a8ad['status'](0xcc)[_0x1cfd('0x25')]();});}};}function handleEntityNotFound(_0x3ffb75,_0x1e150e){return function(_0x4127c2){if(!_0x4127c2){_0x3ffb75[_0x1cfd('0x2f')](0x194);}return _0x4127c2;};}function handleError(_0x3732a4,_0x528886){_0x528886=_0x528886||0x1f4;return function(_0x23216d){logger['error'](_0x23216d[_0x1cfd('0x30')]);if(_0x23216d['name']){delete _0x23216d[_0x1cfd('0x31')];}_0x3732a4[_0x1cfd('0x24')](_0x528886)[_0x1cfd('0x32')](_0x23216d);};}exports[_0x1cfd('0x33')]=function(_0x854c67,_0x4014ec){var _0x3a2096={},_0x42b74d={},_0x39ce79={'count':0x0,'rows':[]};var _0xb95409=_[_0x1cfd('0x34')](db[_0x1cfd('0x35')][_0x1cfd('0x36')],function(_0xf74dd5){return{'name':_0xf74dd5['fieldName'],'type':_0xf74dd5[_0x1cfd('0x37')][_0x1cfd('0x38')]};});_0x42b74d[_0x1cfd('0x39')]=_['map'](_0xb95409,'name');_0x42b74d[_0x1cfd('0x3a')]=_[_0x1cfd('0x3b')](_0x854c67['query']);_0x42b74d[_0x1cfd('0x3c')]=_[_0x1cfd('0x3d')](_0x42b74d[_0x1cfd('0x39')],_0x42b74d[_0x1cfd('0x3a')]);_0x3a2096[_0x1cfd('0x3e')]=_[_0x1cfd('0x3d')](_0x42b74d[_0x1cfd('0x39')],qs[_0x1cfd('0x3f')](_0x854c67[_0x1cfd('0x3a')][_0x1cfd('0x3f')]));_0x3a2096[_0x1cfd('0x3e')]=_0x3a2096[_0x1cfd('0x3e')][_0x1cfd('0x40')]?_0x3a2096[_0x1cfd('0x3e')]:_0x42b74d[_0x1cfd('0x39')];if(!_0x854c67[_0x1cfd('0x3a')][_0x1cfd('0x41')]('nolimit')){_0x3a2096[_0x1cfd('0x29')]=qs[_0x1cfd('0x29')](_0x854c67['query'][_0x1cfd('0x29')]);_0x3a2096[_0x1cfd('0x28')]=qs[_0x1cfd('0x28')](_0x854c67['query'][_0x1cfd('0x28')]);}_0x3a2096[_0x1cfd('0x42')]=qs['sort'](_0x854c67[_0x1cfd('0x3a')][_0x1cfd('0x43')]);_0x3a2096[_0x1cfd('0x44')]=qs[_0x1cfd('0x3c')](_[_0x1cfd('0x45')](_0x854c67[_0x1cfd('0x3a')],_0x42b74d[_0x1cfd('0x3c')]),_0xb95409);if(_0x854c67[_0x1cfd('0x3a')]['filter']){_0x3a2096[_0x1cfd('0x44')]=_[_0x1cfd('0x46')](_0x3a2096[_0x1cfd('0x44')],{'$or':_[_0x1cfd('0x34')](_0xb95409,function(_0x49bf1d){if(_0x49bf1d[_0x1cfd('0x37')]!=='VIRTUAL'){var _0x27592e={};_0x27592e[_0x49bf1d[_0x1cfd('0x31')]]={'$like':'%'+_0x854c67[_0x1cfd('0x3a')][_0x1cfd('0x47')]+'%'};return _0x27592e;}})});}_0x3a2096=_['merge']({},_0x3a2096,_0x854c67[_0x1cfd('0x48')]);var _0x316b33={'where':_0x3a2096['where']};return db[_0x1cfd('0x35')]['count'](_0x316b33)['then'](function(_0x4a8797){_0x39ce79[_0x1cfd('0x27')]=_0x4a8797;if(_0x854c67['query'][_0x1cfd('0x49')]){_0x3a2096[_0x1cfd('0x4a')]=[{'all':!![]}];}return db[_0x1cfd('0x35')][_0x1cfd('0x4b')](_0x3a2096);})[_0x1cfd('0x1b')](function(_0x3e42e1){_0x39ce79[_0x1cfd('0x4c')]=_0x3e42e1;return _0x39ce79;})[_0x1cfd('0x1b')](respondWithFilteredResult(_0x4014ec,_0x3a2096))['catch'](handleError(_0x4014ec,null));};exports[_0x1cfd('0x4d')]=function(_0x4ec559,_0x56b46e){var _0x1377a8={'raw':![],'where':{'id':_0x4ec559['params']['id']}},_0x4729cd={};_0x4729cd['model']=_[_0x1cfd('0x3b')](db[_0x1cfd('0x35')][_0x1cfd('0x36')]);_0x4729cd[_0x1cfd('0x3a')]=_['keys'](_0x4ec559[_0x1cfd('0x3a')]);_0x4729cd[_0x1cfd('0x3c')]=_[_0x1cfd('0x3d')](_0x4729cd[_0x1cfd('0x39')],_0x4729cd['query']);_0x1377a8[_0x1cfd('0x3e')]=_[_0x1cfd('0x3d')](_0x4729cd[_0x1cfd('0x39')],qs[_0x1cfd('0x3f')](_0x4ec559[_0x1cfd('0x3a')][_0x1cfd('0x3f')]));_0x1377a8[_0x1cfd('0x3e')]=_0x1377a8[_0x1cfd('0x3e')]['length']?_0x1377a8[_0x1cfd('0x3e')]:_0x4729cd['model'];if(_0x4ec559[_0x1cfd('0x3a')]['includeAll']){_0x1377a8[_0x1cfd('0x4a')]=[{'all':!![]}];}_0x1377a8=_[_0x1cfd('0x46')]({},_0x1377a8,_0x4ec559[_0x1cfd('0x48')]);return db[_0x1cfd('0x35')][_0x1cfd('0x4e')](_0x1377a8)[_0x1cfd('0x1b')](handleEntityNotFound(_0x56b46e,null))[_0x1cfd('0x1b')](respondWithResult(_0x56b46e,null))[_0x1cfd('0x23')](handleError(_0x56b46e,null));};exports['create']=function(_0x563b8a,_0x1c7659){return db[_0x1cfd('0x35')][_0x1cfd('0x4f')](_0x563b8a[_0x1cfd('0x50')],{})[_0x1cfd('0x1b')](respondWithResult(_0x1c7659,0xc9))[_0x1cfd('0x23')](handleError(_0x1c7659,null));};exports['update']=function(_0xc8bec4,_0xc3c5c6){if(_0xc8bec4[_0x1cfd('0x50')]['id']){delete _0xc8bec4[_0x1cfd('0x50')]['id'];}return db[_0x1cfd('0x35')][_0x1cfd('0x4e')]({'where':{'id':_0xc8bec4[_0x1cfd('0x51')]['id']}})[_0x1cfd('0x1b')](handleEntityNotFound(_0xc3c5c6,null))[_0x1cfd('0x1b')](saveUpdates(_0xc8bec4[_0x1cfd('0x50')],null))[_0x1cfd('0x1b')](respondWithResult(_0xc3c5c6,null))[_0x1cfd('0x23')](handleError(_0xc3c5c6,null));};exports[_0x1cfd('0x2e')]=function(_0x211fdf,_0x467c7f){return db['ZohoAccount']['find']({'where':{'id':_0x211fdf[_0x1cfd('0x51')]['id']}})[_0x1cfd('0x1b')](handleEntityNotFound(_0x467c7f,null))[_0x1cfd('0x1b')](removeEntity(_0x467c7f,null))[_0x1cfd('0x23')](handleError(_0x467c7f,null));};exports['getConfigurations']=function(_0x1e2c98,_0x17cf48,_0x8b1cd3){var _0x4d3ae4={};var _0x5892d6={};var _0x7a4234;var _0x12befa;return db[_0x1cfd('0x35')][_0x1cfd('0x52')]({'where':{'id':_0x1e2c98[_0x1cfd('0x51')]['id']}})[_0x1cfd('0x1b')](handleEntityNotFound(_0x17cf48,null))[_0x1cfd('0x1b')](function(_0xeff9ed){if(_0xeff9ed){_0x7a4234=_0xeff9ed;_0x5892d6['model']=_['keys'](db[_0x1cfd('0x53')]['rawAttributes']);_0x5892d6[_0x1cfd('0x3a')]=_[_0x1cfd('0x3b')](_0x1e2c98[_0x1cfd('0x3a')]);_0x5892d6['filters']=_[_0x1cfd('0x3d')](_0x5892d6[_0x1cfd('0x39')],_0x5892d6[_0x1cfd('0x3a')]);_0x4d3ae4[_0x1cfd('0x3e')]=_[_0x1cfd('0x3d')](_0x5892d6[_0x1cfd('0x39')],qs[_0x1cfd('0x3f')](_0x1e2c98[_0x1cfd('0x3a')]['fields']));_0x4d3ae4['attributes']=_0x4d3ae4['attributes'][_0x1cfd('0x40')]?_0x4d3ae4[_0x1cfd('0x3e')]:_0x5892d6[_0x1cfd('0x39')];_0x4d3ae4['order']=qs[_0x1cfd('0x43')](_0x1e2c98[_0x1cfd('0x3a')][_0x1cfd('0x43')]);_0x4d3ae4[_0x1cfd('0x44')]=qs[_0x1cfd('0x3c')](_[_0x1cfd('0x45')](_0x1e2c98['query'],_0x5892d6[_0x1cfd('0x3c')]));if(_0x1e2c98[_0x1cfd('0x3a')]['filter']){_0x4d3ae4[_0x1cfd('0x44')]=_[_0x1cfd('0x46')](_0x4d3ae4[_0x1cfd('0x44')],{'$or':_['map'](_0x4d3ae4['attributes'],function(_0x515392){var _0x3f97e5={};_0x3f97e5[_0x515392]={'$like':'%'+_0x1e2c98['query'][_0x1cfd('0x47')]+'%'};return _0x3f97e5;})});}_0x4d3ae4=_[_0x1cfd('0x46')]({},_0x4d3ae4,_0x1e2c98[_0x1cfd('0x48')]);return _0x7a4234[_0x1cfd('0x54')](_0x4d3ae4);}})[_0x1cfd('0x1b')](function(_0xdb88a2){if(_0xdb88a2){_0x12befa=_0xdb88a2[_0x1cfd('0x40')];if(!_0x1e2c98['query'][_0x1cfd('0x41')](_0x1cfd('0x55'))){_0x4d3ae4[_0x1cfd('0x29')]=qs[_0x1cfd('0x29')](_0x1e2c98[_0x1cfd('0x3a')][_0x1cfd('0x29')]);_0x4d3ae4[_0x1cfd('0x28')]=qs[_0x1cfd('0x28')](_0x1e2c98[_0x1cfd('0x3a')][_0x1cfd('0x28')]);}return _0x7a4234[_0x1cfd('0x54')](_0x4d3ae4);}})['then'](function(_0x3e6e18){if(_0x3e6e18){return _0x3e6e18?{'count':_0x12befa,'rows':_0x3e6e18}:null;}})[_0x1cfd('0x1b')](respondWithResult(_0x17cf48,null))[_0x1cfd('0x23')](handleError(_0x17cf48,null));};exports[_0x1cfd('0x56')]=function(_0x384332,_0x23ee37,_0x312d0e){if(_0x384332['body']['id']){delete _0x384332[_0x1cfd('0x50')]['id'];}return db[_0x1cfd('0x35')]['findOne']({'where':{'id':_0x384332['params']['id']}})[_0x1cfd('0x1b')](handleEntityNotFound(_0x23ee37,null))[_0x1cfd('0x1b')](function(_0x17c54c){if(_0x17c54c){_0x384332[_0x1cfd('0x50')][_0x1cfd('0x57')]=_0x17c54c['id'];_0x384332[_0x1cfd('0x50')][_0x1cfd('0x58')]=integrations[_0x1cfd('0x59')](_0x384332[_0x1cfd('0x50')][_0x1cfd('0x5a')],_0x384332[_0x1cfd('0x50')][_0x1cfd('0x37')]);_0x384332[_0x1cfd('0x50')]['Descriptions']=integrations[_0x1cfd('0x5b')](_0x384332[_0x1cfd('0x50')][_0x1cfd('0x5a')],_0x384332[_0x1cfd('0x50')][_0x1cfd('0x37')]);return db[_0x1cfd('0x53')][_0x1cfd('0x4f')](_0x384332[_0x1cfd('0x50')],{'include':[{'model':db[_0x1cfd('0x5c')],'as':'Subjects'},{'model':db[_0x1cfd('0x5c')],'as':'Descriptions'}]});}return null;})[_0x1cfd('0x1b')](respondWithResult(_0x23ee37,null))['catch'](handleError(_0x23ee37,null));};function getAccessToken(_0x4556d7){return new Promise(function(_0x475693,_0x1024bb){var _0x488c7b;switch(_0x4556d7[_0x1cfd('0x5d')]){case'US':_0x488c7b=_0x1cfd('0x5e');break;case'AU':_0x488c7b='https://accounts.zoho.com.au';break;case'EU':_0x488c7b=_0x1cfd('0x5f');break;case'IN':_0x488c7b=_0x1cfd('0x60');break;case'CN':_0x488c7b=_0x1cfd('0x61');break;default:_0x488c7b=_0x1cfd('0x5f');break;}var _0x324383={'method':_0x1cfd('0x62'),'uri':_0x488c7b+_0x1cfd('0x63'),'qs':{'refresh_token':_0x4556d7['refreshToken'],'client_id':_0x4556d7['clientId'],'client_secret':_0x4556d7['clientSecret'],'grant_type':_0x1cfd('0x64')},'json':!![]};return rp(_0x324383)[_0x1cfd('0x1b')](function(_0x2d1bef){if(_0x2d1bef[_0x1cfd('0x65')]){_0x475693(_0x2d1bef[_0x1cfd('0x65')]);}else{_0x1024bb(_0x1cfd('0x66'));}})['catch'](function(_0x34deed){_0x1024bb(_0x34deed);});});}exports[_0x1cfd('0x67')]=function(_0x429344,_0x551139,_0x1d475f){var _0x1c5dd0,_0xecf487,_0x598862,_0x45504d,_0x3acd71;return db[_0x1cfd('0x35')][_0x1cfd('0x52')]({'where':{'id':_0x429344['params']['id']},'attributes':['id','host',_0x1cfd('0x5d'),_0x1cfd('0x68'),_0x1cfd('0x69'),'serverUrl','code',_0x1cfd('0x6a')]})[_0x1cfd('0x1b')](handleEntityNotFound(_0x551139,null))[_0x1cfd('0x1b')](function(_0x95ec9){_0x3acd71=_0x95ec9;_0x1c5dd0=_0x3acd71[_0x1cfd('0x6b')];_0xecf487=_0x1c5dd0==='zoho.eu'?'eu':_0x1cfd('0x6c');_0x598862=_0x3acd71[_0x1cfd('0x6d')];var _0x220fe4=_0x598862['slice'](-0x1);if(_0x220fe4==='/'||_0x220fe4==='\x5c'||_0x220fe4===':'){_0x598862=_0x598862[_0x1cfd('0x6e')](0x0,_0x598862[_0x1cfd('0x6f')](_0x220fe4));}if(!_0x3acd71['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x3acd71);})[_0x1cfd('0x1b')](function(_0x1b5504){if(_0x1b5504){return rp({'method':_0x1cfd('0x70'),'uri':util[_0x1cfd('0x71')](_0x1cfd('0x72'),_0xecf487),'qs':{'module':_0x1cfd('0x73')},'headers':{'Authorization':_0x1cfd('0x74')+_0x1b5504},'json':!![]});}})[_0x1cfd('0x1b')](function(_0x14b2a8){if(_0x14b2a8){if(_0x14b2a8[_0x1cfd('0x75')]&&_0x14b2a8[_0x1cfd('0x75')][_0x1cfd('0x1f')]){throw new Error(_0x14b2a8[_0x1cfd('0x75')][_0x1cfd('0x1f')]['message']);}var _0x10b86b=[];var _0x437628=[];var _0x341f4a=[_0x1cfd('0x76'),_0x1cfd('0x77'),_0x1cfd('0x78'),_0x1cfd('0x79'),'Call_Duration',_0x1cfd('0x7a'),_0x1cfd('0x7b'),_0x1cfd('0x7c')];_0x437628=_[_0x1cfd('0x7d')](_0x14b2a8[_0x1cfd('0x3f')],function(_0x55d8bd){return _0x341f4a[_0x1cfd('0x7e')](_0x55d8bd[_0x1cfd('0x7f')]);});for(var _0x44a270=0x0;_0x44a270<_0x437628[_0x1cfd('0x40')];_0x44a270++){if(_0x437628[_0x44a270][_0x1cfd('0x80')]===![]){_0x10b86b[_0x1cfd('0x81')]({'id':_0x437628[_0x44a270]['id'],'name':_0x437628[_0x44a270][_0x1cfd('0x82')],'custom':_0x437628[_0x44a270]['custom_field'],'options':_0x437628[_0x44a270]['data_type']===_0x1cfd('0x83')&&_0x437628[_0x44a270][_0x1cfd('0x84')][_0x1cfd('0x40')]>-0x1?_[_0x1cfd('0x34')](_0x437628[_0x44a270]['pick_list_values'],function(_0x403d68){return{'name':_0x403d68,'value':_0x403d68};}):[]});}}return{'count':_0x10b86b[_0x1cfd('0x40')],'rows':_0x10b86b};}else{return{'count':0x0,'rows':[]};}})[_0x1cfd('0x1b')](respondWithResult(_0x551139,null))[_0x1cfd('0x23')](function(_0x1be3e6){var _0xcfad65=_0x429344[_0x1cfd('0x3a')][_0x1cfd('0x17')]?0x1f4:_0x1be3e6[_0x1cfd('0x85')]||0x1f4;logger[_0x1cfd('0x1f')](_0x1cfd('0x86'),_0x1cfd('0x67'),_0xcfad65,JSON[_0x1cfd('0x1e')](_0x1be3e6));delete _0x1be3e6['name'];if(_0xcfad65===0x191){_0xcfad65=0x190;}_0x551139[_0x1cfd('0x24')](_0xcfad65)[_0x1cfd('0x32')](_0x429344[_0x1cfd('0x3a')][_0x1cfd('0x17')]?{'message':_0x1cfd('0x87'),'statusCode':_0x1be3e6[_0x1cfd('0x85')]}:_0x1be3e6);});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js
index a5f9857..7a65298 100644
--- a/server/api/intZohoAccount/intZohoAccount.model.js
+++ b/server/api/intZohoAccount/intZohoAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0480=['rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','clientSecret','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','then','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.in','https://accounts.zoho.com.cn','serverUrl','application/x-www-form-urlencoded','parse','util','../../config/logger','api','bluebird','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0480,0xf7));var _0x0048=function(_0x565411,_0x5a59db){_0x565411=_0x565411-0x0;var _0x214584=_0x0480[_0x565411];return _0x214584;};'use strict';var _=require('lodash');var util=require(_0x0048('0x0'));var logger=require(_0x0048('0x1'))(_0x0048('0x2'));var moment=require('moment');var BPromise=require(_0x0048('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0048('0x4'));var rimraf=require(_0x0048('0x5'));var config=require(_0x0048('0x6'));var attributes=require(_0x0048('0x7'));var integrations=require(_0x0048('0x8'));module['exports']=function(_0x5477cf,_0x223e50){return _0x5477cf[_0x0048('0x9')](_0x0048('0xa'),attributes,{'tableName':_0x0048('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x138c08,_0x24bfa1,_0x5cbb66){if(_0x138c08['changed'](_0x0048('0xc'))||_0x138c08[_0x0048('0xd')]('serverUrl')||_0x138c08[_0x0048('0xd')](_0x0048('0xe'))||_0x138c08[_0x0048('0xd')](_0x0048('0xf'))||_0x138c08[_0x0048('0xd')]('code')||_0x138c08['changed'](_0x0048('0x10'))){var _0x157319,_0x1f4a44;_0x157319=_0x138c08['serverUrl'];var _0x4d9e4a=_0x157319['slice'](-0x1);if(_0x4d9e4a==='/'||_0x4d9e4a==='\x5c'||_0x4d9e4a===':'){_0x157319=_0x157319[_0x0048('0x11')](0x0,_0x157319[_0x0048('0x12')](_0x4d9e4a));}switch(_0x138c08['zone']){case'US':_0x1f4a44=_0x0048('0x13');break;case'AU':_0x1f4a44=_0x0048('0x14');break;case'IN':_0x1f4a44='https://accounts.zoho.in';break;case'CN':_0x1f4a44='https://accounts.zoho.com.cn';break;default:_0x1f4a44=_0x0048('0x15');break;}var _0x573a2e={'method':_0x0048('0x16'),'uri':_0x1f4a44+_0x0048('0x17'),'form':{'grant_type':_0x0048('0x18'),'client_id':_0x138c08[_0x0048('0xe')],'client_secret':_0x138c08['clientSecret'],'redirect_uri':_0x138c08['serverUrl'],'code':_0x138c08[_0x0048('0x19')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x573a2e)[_0x0048('0x1a')](function(_0x485f98){var _0x4f4858=JSON['parse'](_0x485f98);if(_0x4f4858[_0x0048('0x1b')]){_0x138c08[_0x0048('0x1c')]=_0x4f4858['refresh_token'];logger[_0x0048('0x1d')](util['format'](_0x0048('0x1e'),_0x138c08[_0x0048('0x1f')],_0x138c08['id']));}else{logger[_0x0048('0x20')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x138c08[_0x0048('0x1f')],_0x138c08['id']),util[_0x0048('0x21')](_0x4f4858,{'showHidden':![],'depth':null}));}return _0x5cbb66(null,_0x24bfa1);})[_0x0048('0x22')](function(_0x13ffe1){logger[_0x0048('0x20')](util[_0x0048('0x23')](_0x0048('0x24'),_0x138c08['name'],_0x138c08['id']),util[_0x0048('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x5cbb66(_0x13ffe1);});}else{return _0x5cbb66(null,_0x24bfa1);}},'beforeUpdate':function(_0x2c7f64,_0x1c7b01,_0x45931d){if(_0x2c7f64[_0x0048('0xd')](_0x0048('0xc'))||_0x2c7f64[_0x0048('0xd')]('serverUrl')||_0x2c7f64[_0x0048('0xd')](_0x0048('0xe'))||_0x2c7f64[_0x0048('0xd')]('clientSecret')||_0x2c7f64['changed']('code')||_0x2c7f64[_0x0048('0xd')]('host')){var _0x340d6b,_0x9d43b0;_0x340d6b=_0x2c7f64['serverUrl'];var _0x446fa1=_0x340d6b['slice'](-0x1);if(_0x446fa1==='/'||_0x446fa1==='\x5c'||_0x446fa1===':'){_0x340d6b=_0x340d6b[_0x0048('0x11')](0x0,_0x340d6b[_0x0048('0x12')](_0x446fa1));}switch(_0x2c7f64[_0x0048('0xc')]){case'US':_0x9d43b0=_0x0048('0x13');break;case'AU':_0x9d43b0='https://accounts.zoho.com.au';break;case'IN':_0x9d43b0=_0x0048('0x25');break;case'CN':_0x9d43b0=_0x0048('0x26');break;default:_0x9d43b0=_0x0048('0x15');break;}var _0x1519be={'method':_0x0048('0x16'),'uri':_0x9d43b0+_0x0048('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x2c7f64['clientId'],'client_secret':_0x2c7f64['clientSecret'],'redirect_uri':_0x2c7f64[_0x0048('0x27')],'code':_0x2c7f64[_0x0048('0x19')]},'headers':{'Content-Type':_0x0048('0x28')}};return rp(_0x1519be)[_0x0048('0x1a')](function(_0x663e97){var _0xe1f24f=JSON[_0x0048('0x29')](_0x663e97);if(_0xe1f24f[_0x0048('0x1b')]){_0x2c7f64[_0x0048('0x1c')]=_0xe1f24f[_0x0048('0x1b')];logger[_0x0048('0x1d')](util[_0x0048('0x23')](_0x0048('0x1e'),_0x2c7f64[_0x0048('0x1f')],_0x2c7f64['id']));}else{logger['error'](util[_0x0048('0x23')](_0x0048('0x24'),_0x2c7f64[_0x0048('0x1f')],_0x2c7f64['id']),util['inspect'](_0xe1f24f,{'showHidden':![],'depth':null}));}return _0x45931d(null,_0x1c7b01);})[_0x0048('0x22')](function(_0x50af97){logger[_0x0048('0x20')](util['format'](_0x0048('0x24'),_0x2c7f64['name'],_0x2c7f64['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x45931d(_0x50af97);});}else{return _0x45931d(null,_0x1c7b01);}}}});};
\ No newline at end of file
+var _0x3f53=['then','parse','refresh_token','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','host','slice','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','catch','clientSecret','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','application/x-www-form-urlencoded'];(function(_0x1c0a06,_0x53b821){var _0x43e800=function(_0x460a21){while(--_0x460a21){_0x1c0a06['push'](_0x1c0a06['shift']());}};_0x43e800(++_0x53b821);}(_0x3f53,0xe0));var _0x33f5=function(_0x925149,_0x2c61d2){_0x925149=_0x925149-0x0;var _0xd5c22b=_0x3f53[_0x925149];return _0xd5c22b;};'use strict';var _=require(_0x33f5('0x0'));var util=require(_0x33f5('0x1'));var logger=require('../../config/logger')(_0x33f5('0x2'));var moment=require(_0x33f5('0x3'));var BPromise=require(_0x33f5('0x4'));var rp=require(_0x33f5('0x5'));var fs=require('fs');var path=require(_0x33f5('0x6'));var rimraf=require(_0x33f5('0x7'));var config=require('../../config/environment');var attributes=require(_0x33f5('0x8'));var integrations=require(_0x33f5('0x9'));module[_0x33f5('0xa')]=function(_0x412de7,_0x7efaae){return _0x412de7[_0x33f5('0xb')](_0x33f5('0xc'),attributes,{'tableName':_0x33f5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x104f0a,_0x1121ee,_0x37ae59){if(_0x104f0a['changed'](_0x33f5('0xe'))||_0x104f0a[_0x33f5('0xf')](_0x33f5('0x10'))||_0x104f0a[_0x33f5('0xf')](_0x33f5('0x11'))||_0x104f0a[_0x33f5('0xf')]('clientSecret')||_0x104f0a[_0x33f5('0xf')]('code')||_0x104f0a['changed'](_0x33f5('0x12'))){var _0x4a3f62,_0x1367f9;_0x4a3f62=_0x104f0a[_0x33f5('0x10')];var _0x413fcb=_0x4a3f62[_0x33f5('0x13')](-0x1);if(_0x413fcb==='/'||_0x413fcb==='\x5c'||_0x413fcb===':'){_0x4a3f62=_0x4a3f62['substring'](0x0,_0x4a3f62['lastIndexOf'](_0x413fcb));}switch(_0x104f0a[_0x33f5('0xe')]){case'US':_0x1367f9=_0x33f5('0x14');break;case'AU':_0x1367f9='https://accounts.zoho.com.au';break;case'IN':_0x1367f9=_0x33f5('0x15');break;case'CN':_0x1367f9='https://accounts.zoho.com.cn';break;default:_0x1367f9=_0x33f5('0x16');break;}var _0x74527a={'method':_0x33f5('0x17'),'uri':_0x1367f9+_0x33f5('0x18'),'form':{'grant_type':_0x33f5('0x19'),'client_id':_0x104f0a['clientId'],'client_secret':_0x104f0a['clientSecret'],'redirect_uri':_0x104f0a[_0x33f5('0x10')],'code':_0x104f0a[_0x33f5('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x74527a)['then'](function(_0x47dbc0){var _0x155691=JSON['parse'](_0x47dbc0);if(_0x155691['refresh_token']){_0x104f0a[_0x33f5('0x1b')]=_0x155691['refresh_token'];logger['info'](util['format'](_0x33f5('0x1c'),_0x104f0a[_0x33f5('0x1d')],_0x104f0a['id']));}else{logger[_0x33f5('0x1e')](util[_0x33f5('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x104f0a[_0x33f5('0x1d')],_0x104f0a['id']),util[_0x33f5('0x20')](_0x155691,{'showHidden':![],'depth':null}));}return _0x37ae59(null,_0x1121ee);})[_0x33f5('0x21')](function(_0x5140b2){logger[_0x33f5('0x1e')](util[_0x33f5('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x104f0a[_0x33f5('0x1d')],_0x104f0a['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x37ae59(_0x5140b2);});}else{return _0x37ae59(null,_0x1121ee);}},'beforeUpdate':function(_0x1c138d,_0x301801,_0x4979f5){if(_0x1c138d[_0x33f5('0xf')](_0x33f5('0xe'))||_0x1c138d[_0x33f5('0xf')](_0x33f5('0x10'))||_0x1c138d['changed'](_0x33f5('0x11'))||_0x1c138d['changed'](_0x33f5('0x22'))||_0x1c138d[_0x33f5('0xf')](_0x33f5('0x1a'))||_0x1c138d[_0x33f5('0xf')](_0x33f5('0x12'))){var _0x946402,_0x77bdb6;_0x946402=_0x1c138d['serverUrl'];var _0x41ccc3=_0x946402[_0x33f5('0x13')](-0x1);if(_0x41ccc3==='/'||_0x41ccc3==='\x5c'||_0x41ccc3===':'){_0x946402=_0x946402[_0x33f5('0x23')](0x0,_0x946402[_0x33f5('0x24')](_0x41ccc3));}switch(_0x1c138d[_0x33f5('0xe')]){case'US':_0x77bdb6=_0x33f5('0x14');break;case'AU':_0x77bdb6=_0x33f5('0x25');break;case'IN':_0x77bdb6=_0x33f5('0x15');break;case'CN':_0x77bdb6=_0x33f5('0x26');break;default:_0x77bdb6=_0x33f5('0x16');break;}var _0x5e537a={'method':'POST','uri':_0x77bdb6+_0x33f5('0x18'),'form':{'grant_type':_0x33f5('0x19'),'client_id':_0x1c138d[_0x33f5('0x11')],'client_secret':_0x1c138d['clientSecret'],'redirect_uri':_0x1c138d[_0x33f5('0x10')],'code':_0x1c138d['code']},'headers':{'Content-Type':_0x33f5('0x27')}};return rp(_0x5e537a)[_0x33f5('0x28')](function(_0x207e26){var _0x4ef25d=JSON[_0x33f5('0x29')](_0x207e26);if(_0x4ef25d[_0x33f5('0x2a')]){_0x1c138d[_0x33f5('0x1b')]=_0x4ef25d['refresh_token'];logger['info'](util['format'](_0x33f5('0x1c'),_0x1c138d[_0x33f5('0x1d')],_0x1c138d['id']));}else{logger['error'](util[_0x33f5('0x1f')](_0x33f5('0x2b'),_0x1c138d[_0x33f5('0x1d')],_0x1c138d['id']),util[_0x33f5('0x20')](_0x4ef25d,{'showHidden':![],'depth':null}));}return _0x4979f5(null,_0x301801);})[_0x33f5('0x21')](function(_0x22a3b6){logger[_0x33f5('0x1e')](util[_0x33f5('0x1f')](_0x33f5('0x2b'),_0x1c138d[_0x33f5('0x1d')],_0x1c138d['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4979f5(_0x22a3b6);});}else{return _0x4979f5(null,_0x301801);}}}});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js
index ef9624d..5cb828b 100644
--- a/server/api/intZohoAccount/intZohoAccount.rpc.js
+++ b/server/api/intZohoAccount/intZohoAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe81e=['include','map','model','attributes','stringify','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetZohoAccount','findAll','options','raw','where','limit'];(function(_0x1ed36f,_0x3a544f){var _0x99d754=function(_0x5d6459){while(--_0x5d6459){_0x1ed36f['push'](_0x1ed36f['shift']());}};_0x99d754(++_0x3a544f);}(_0xe81e,0xb6));var _0xee81=function(_0x72c194,_0x1a953a){_0x72c194=_0x72c194-0x0;var _0x1f4f68=_0xe81e[_0x72c194];return _0x1f4f68;};'use strict';var _=require(_0xee81('0x0'));var util=require(_0xee81('0x1'));var moment=require(_0xee81('0x2'));var BPromise=require('bluebird');var rs=require(_0xee81('0x3'));var fs=require('fs');var Redis=require(_0xee81('0x4'));var db=require(_0xee81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xee81('0x6'))(_0xee81('0x7'));var config=require(_0xee81('0x8'));var jayson=require(_0xee81('0x9'));var client=jayson[_0xee81('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27a465,_0x4543be,_0x3814a5){return new BPromise(function(_0x86f845,_0xdde81d){return client[_0xee81('0xb')](_0x27a465,_0x3814a5)[_0xee81('0xc')](function(_0x29c197){logger['info'](_0xee81('0xd'),_0x4543be,_0xee81('0xe'));logger[_0xee81('0xf')](_0xee81('0x10'),_0x4543be,_0xee81('0xe'),JSON['stringify'](_0x29c197));if(_0x29c197[_0xee81('0x11')]){if(_0x29c197['error'][_0xee81('0x12')]===0x1f4){logger[_0xee81('0x11')](_0xee81('0xd'),_0x4543be,_0x29c197[_0xee81('0x11')][_0xee81('0x13')]);return _0xdde81d(_0x29c197[_0xee81('0x11')][_0xee81('0x13')]);}logger[_0xee81('0x11')](_0xee81('0xd'),_0x4543be,_0x29c197[_0xee81('0x11')]['message']);return _0x86f845(_0x29c197[_0xee81('0x11')]['message']);}else{logger[_0xee81('0x14')](_0xee81('0xd'),_0x4543be,_0xee81('0xe'));_0x86f845(_0x29c197['result'][_0xee81('0x13')]);}})[_0xee81('0x15')](function(_0x32e472){logger[_0xee81('0x11')](_0xee81('0xd'),_0x4543be,_0x32e472);_0xdde81d(_0x32e472);});});}exports[_0xee81('0x16')]=function(_0x1b6c46){var _0x4dd4fa=this;return new Promise(function(_0x5065d7,_0x3c6f70){return db['ZohoAccount'][_0xee81('0x17')]({'raw':_0x1b6c46[_0xee81('0x18')]?_0x1b6c46[_0xee81('0x18')][_0xee81('0x19')]===undefined?!![]:![]:!![],'where':_0x1b6c46[_0xee81('0x18')]?_0x1b6c46['options'][_0xee81('0x1a')]||null:null,'attributes':_0x1b6c46[_0xee81('0x18')]?_0x1b6c46[_0xee81('0x18')]['attributes']||null:null,'limit':_0x1b6c46['options']?_0x1b6c46[_0xee81('0x18')][_0xee81('0x1b')]||null:null,'include':_0x1b6c46[_0xee81('0x18')]?_0x1b6c46[_0xee81('0x18')][_0xee81('0x1c')]?_[_0xee81('0x1d')](_0x1b6c46[_0xee81('0x18')][_0xee81('0x1c')],function(_0x43d52a){return{'model':db[_0x43d52a[_0xee81('0x1e')]],'as':_0x43d52a['as'],'attributes':_0x43d52a[_0xee81('0x1f')],'include':_0x43d52a[_0xee81('0x1c')]?_[_0xee81('0x1d')](_0x43d52a[_0xee81('0x1c')],function(_0x4bbe10){return{'model':db[_0x4bbe10[_0xee81('0x1e')]],'as':_0x4bbe10['as'],'attributes':_0x4bbe10[_0xee81('0x1f')],'include':_0x4bbe10[_0xee81('0x1c')]?_[_0xee81('0x1d')](_0x4bbe10['include'],function(_0xb792ec){return{'model':db[_0xb792ec[_0xee81('0x1e')]],'as':_0xb792ec['as'],'attributes':_0xb792ec['attributes']};}):[]};}):[]};}):[]:[]})[_0xee81('0xc')](function(_0x5ee93d){logger[_0xee81('0x14')](_0xee81('0x16'),_0x1b6c46);logger[_0xee81('0xf')](_0xee81('0x16'),_0x1b6c46,JSON[_0xee81('0x20')](_0x5ee93d));_0x5065d7(_0x5ee93d);})[_0xee81('0x15')](function(_0x4077ef){logger[_0xee81('0x11')](_0xee81('0x16'),_0x4077ef['message'],_0x1b6c46);_0x3c6f70(_0x4dd4fa['error'](0x1f4,_0x4077ef[_0xee81('0x13')]));});});};exports[_0xee81('0x21')]=function(_0x556a83){var _0x2dece7=this;return new Promise(function(_0x18a3eb,_0x3c247b){return db['ZohoAccount'][_0xee81('0x22')]({'raw':_0x556a83[_0xee81('0x18')]?_0x556a83[_0xee81('0x18')][_0xee81('0x19')]===undefined?!![]:![]:!![],'where':_0x556a83['options']?_0x556a83['options']['where']||null:null,'attributes':_0x556a83[_0xee81('0x18')]?_0x556a83[_0xee81('0x18')]['attributes']||null:null,'include':_0x556a83[_0xee81('0x18')]?_0x556a83[_0xee81('0x18')][_0xee81('0x1c')]?_['map'](_0x556a83[_0xee81('0x18')][_0xee81('0x1c')],function(_0x3da047){return{'model':db[_0x3da047[_0xee81('0x1e')]],'as':_0x3da047['as'],'attributes':_0x3da047[_0xee81('0x1f')],'include':_0x3da047[_0xee81('0x1c')]?_['map'](_0x3da047[_0xee81('0x1c')],function(_0x25b152){return{'model':db[_0x25b152['model']],'as':_0x25b152['as'],'attributes':_0x25b152['attributes'],'include':_0x25b152[_0xee81('0x1c')]?_['map'](_0x25b152['include'],function(_0x430dc4){return{'model':db[_0x430dc4[_0xee81('0x1e')]],'as':_0x430dc4['as'],'attributes':_0x430dc4[_0xee81('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xee81('0xc')](function(_0x1e23c0){logger['info'](_0xee81('0x21'),_0x556a83);logger[_0xee81('0xf')](_0xee81('0x21'),_0x556a83,JSON['stringify'](_0x1e23c0));_0x18a3eb(_0x1e23c0);})[_0xee81('0x15')](function(_0x40417e){logger[_0xee81('0x11')](_0xee81('0x21'),_0x40417e['message'],_0x556a83);_0x3c247b(_0x2dece7['error'](0x1f4,_0x40417e['message']));});});};
\ No newline at end of file
+var _0xf642=['http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ZohoAccount','findAll','options','raw','where','map','include','model','attributes','GetZohoAccount','ShowZohoAccount','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x52cae4,_0x3d34e6){var _0x1daa4b=function(_0x151af4){while(--_0x151af4){_0x52cae4['push'](_0x52cae4['shift']());}};_0x1daa4b(++_0x3d34e6);}(_0xf642,0xbc));var _0x2f64=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0xf642[_0x503ffd];return _0x160437;};'use strict';var _=require(_0x2f64('0x0'));var util=require(_0x2f64('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f64('0x2'));var db=require(_0x2f64('0x3'))['db'];var utils=require(_0x2f64('0x4'));var logger=require(_0x2f64('0x5'))(_0x2f64('0x6'));var config=require(_0x2f64('0x7'));var jayson=require(_0x2f64('0x8'));var client=jayson[_0x2f64('0x9')][_0x2f64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x467c32,_0x2a011e,_0x99bd74){return new BPromise(function(_0x455702,_0x2581b2){return client['request'](_0x467c32,_0x99bd74)[_0x2f64('0xb')](function(_0x5c6cb8){logger[_0x2f64('0xc')](_0x2f64('0xd'),_0x2a011e,_0x2f64('0xe'));logger[_0x2f64('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2a011e,_0x2f64('0xe'),JSON[_0x2f64('0x10')](_0x5c6cb8));if(_0x5c6cb8[_0x2f64('0x11')]){if(_0x5c6cb8[_0x2f64('0x11')]['code']===0x1f4){logger[_0x2f64('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x2a011e,_0x5c6cb8[_0x2f64('0x11')][_0x2f64('0x12')]);return _0x2581b2(_0x5c6cb8[_0x2f64('0x11')][_0x2f64('0x12')]);}logger['error'](_0x2f64('0xd'),_0x2a011e,_0x5c6cb8[_0x2f64('0x11')][_0x2f64('0x12')]);return _0x455702(_0x5c6cb8[_0x2f64('0x11')][_0x2f64('0x12')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x2a011e,_0x2f64('0xe'));_0x455702(_0x5c6cb8[_0x2f64('0x13')]['message']);}})[_0x2f64('0x14')](function(_0x112e3a){logger[_0x2f64('0x11')](_0x2f64('0xd'),_0x2a011e,_0x112e3a);_0x2581b2(_0x112e3a);});});}exports['GetZohoAccount']=function(_0x57c3d3){var _0x3cd409=this;return new Promise(function(_0x230423,_0x4a8318){return db[_0x2f64('0x15')][_0x2f64('0x16')]({'raw':_0x57c3d3[_0x2f64('0x17')]?_0x57c3d3[_0x2f64('0x17')][_0x2f64('0x18')]===undefined?!![]:![]:!![],'where':_0x57c3d3['options']?_0x57c3d3[_0x2f64('0x17')][_0x2f64('0x19')]||null:null,'attributes':_0x57c3d3[_0x2f64('0x17')]?_0x57c3d3[_0x2f64('0x17')]['attributes']||null:null,'limit':_0x57c3d3[_0x2f64('0x17')]?_0x57c3d3['options']['limit']||null:null,'include':_0x57c3d3[_0x2f64('0x17')]?_0x57c3d3['options']['include']?_[_0x2f64('0x1a')](_0x57c3d3[_0x2f64('0x17')][_0x2f64('0x1b')],function(_0x392619){return{'model':db[_0x392619[_0x2f64('0x1c')]],'as':_0x392619['as'],'attributes':_0x392619[_0x2f64('0x1d')],'include':_0x392619[_0x2f64('0x1b')]?_[_0x2f64('0x1a')](_0x392619[_0x2f64('0x1b')],function(_0x44ed92){return{'model':db[_0x44ed92['model']],'as':_0x44ed92['as'],'attributes':_0x44ed92[_0x2f64('0x1d')],'include':_0x44ed92[_0x2f64('0x1b')]?_[_0x2f64('0x1a')](_0x44ed92['include'],function(_0x340475){return{'model':db[_0x340475[_0x2f64('0x1c')]],'as':_0x340475['as'],'attributes':_0x340475['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f64('0xb')](function(_0x15774e){logger[_0x2f64('0xc')]('GetZohoAccount',_0x57c3d3);logger[_0x2f64('0xf')](_0x2f64('0x1e'),_0x57c3d3,JSON[_0x2f64('0x10')](_0x15774e));_0x230423(_0x15774e);})[_0x2f64('0x14')](function(_0x118308){logger['error'](_0x2f64('0x1e'),_0x118308[_0x2f64('0x12')],_0x57c3d3);_0x4a8318(_0x3cd409['error'](0x1f4,_0x118308[_0x2f64('0x12')]));});});};exports[_0x2f64('0x1f')]=function(_0xef8edf){var _0x10f7f8=this;return new Promise(function(_0x23d1cf,_0x30d4ab){return db[_0x2f64('0x15')][_0x2f64('0x20')]({'raw':_0xef8edf[_0x2f64('0x17')]?_0xef8edf['options'][_0x2f64('0x18')]===undefined?!![]:![]:!![],'where':_0xef8edf['options']?_0xef8edf[_0x2f64('0x17')][_0x2f64('0x19')]||null:null,'attributes':_0xef8edf[_0x2f64('0x17')]?_0xef8edf['options'][_0x2f64('0x1d')]||null:null,'include':_0xef8edf[_0x2f64('0x17')]?_0xef8edf[_0x2f64('0x17')]['include']?_[_0x2f64('0x1a')](_0xef8edf[_0x2f64('0x17')][_0x2f64('0x1b')],function(_0x3e9016){return{'model':db[_0x3e9016[_0x2f64('0x1c')]],'as':_0x3e9016['as'],'attributes':_0x3e9016[_0x2f64('0x1d')],'include':_0x3e9016[_0x2f64('0x1b')]?_[_0x2f64('0x1a')](_0x3e9016[_0x2f64('0x1b')],function(_0x3b653d){return{'model':db[_0x3b653d[_0x2f64('0x1c')]],'as':_0x3b653d['as'],'attributes':_0x3b653d[_0x2f64('0x1d')],'include':_0x3b653d['include']?_[_0x2f64('0x1a')](_0x3b653d['include'],function(_0x400667){return{'model':db[_0x400667[_0x2f64('0x1c')]],'as':_0x400667['as'],'attributes':_0x400667['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f64('0xb')](function(_0x106b80){logger[_0x2f64('0xc')]('ShowZohoAccount',_0xef8edf);logger[_0x2f64('0xf')](_0x2f64('0x1f'),_0xef8edf,JSON[_0x2f64('0x10')](_0x106b80));_0x23d1cf(_0x106b80);})[_0x2f64('0x14')](function(_0x153fe6){logger[_0x2f64('0x11')](_0x2f64('0x1f'),_0x153fe6[_0x2f64('0x12')],_0xef8edf);_0x30d4ab(_0x10f7f8[_0x2f64('0x11')](0x1f4,_0x153fe6['message']));});});};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js
index d68147b..326f0a0 100644
--- a/server/api/intZohoConfiguration/index.js
+++ b/server/api/intZohoConfiguration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc7=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x59a053,_0x3d743f){var _0x4bf794=function(_0x5589ef){while(--_0x5589ef){_0x59a053['push'](_0x59a053['shift']());}};_0x4bf794(++_0x3d743f);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x5fc7[_0x31b5a5];return _0x364cc9;};'use strict';var multer=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var path=require(_0x75fc('0x2'));var timeout=require(_0x75fc('0x3'));var express=require(_0x75fc('0x4'));var router=express[_0x75fc('0x5')]();var auth=require(_0x75fc('0x6'));var interaction=require(_0x75fc('0x7'));var config=require(_0x75fc('0x8'));var controller=require(_0x75fc('0x9'));router[_0x75fc('0xa')]('/',auth[_0x75fc('0xb')](),controller['index']);router[_0x75fc('0xa')](_0x75fc('0xc'),auth[_0x75fc('0xb')](),controller[_0x75fc('0xd')]);router[_0x75fc('0xa')](_0x75fc('0xe'),auth[_0x75fc('0xb')](),controller[_0x75fc('0xf')]);router[_0x75fc('0xa')](_0x75fc('0x10'),auth['isAuthenticated'](),controller[_0x75fc('0x11')]);router[_0x75fc('0xa')](_0x75fc('0x12'),auth[_0x75fc('0xb')](),controller['getDescriptions']);router[_0x75fc('0x13')]('/',auth[_0x75fc('0xb')](),controller[_0x75fc('0x14')]);router[_0x75fc('0x15')](_0x75fc('0xc'),auth[_0x75fc('0xb')](),controller[_0x75fc('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x75fc('0x17')]);module[_0x75fc('0x18')]=router;
\ No newline at end of file
+var _0xee5b=['multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy'];(function(_0x4ded16,_0x23fcbf){var _0x4a525a=function(_0x2c6b5e){while(--_0x2c6b5e){_0x4ded16['push'](_0x4ded16['shift']());}};_0x4a525a(++_0x23fcbf);}(_0xee5b,0x1f4));var _0xbee5=function(_0x559bb6,_0x1b8606){_0x559bb6=_0x559bb6-0x0;var _0x2c8f1e=_0xee5b[_0x559bb6];return _0x2c8f1e;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var auth=require(_0xbee5('0x4'));var interaction=require(_0xbee5('0x5'));var config=require(_0xbee5('0x6'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0xbee5('0x7')](),controller[_0xbee5('0x8')]);router[_0xbee5('0x9')](_0xbee5('0xa'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xbee5('0xb')]);router[_0xbee5('0x9')](_0xbee5('0xc'),auth[_0xbee5('0x7')](),controller['getSubjects']);router[_0xbee5('0x9')](_0xbee5('0xd'),auth[_0xbee5('0x7')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xf')]('/',auth[_0xbee5('0x7')](),controller[_0xbee5('0x10')]);router[_0xbee5('0x11')](_0xbee5('0xa'),auth['isAuthenticated'](),controller[_0xbee5('0x12')]);router['delete'](_0xbee5('0xa'),auth[_0xbee5('0x7')](),controller[_0xbee5('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
index 4aaab82..896ea57 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa733=['exports','STRING','ENUM','contact','nothing','lead','contact_lead','sequelize'];(function(_0x3329bd,_0xd1b1b2){var _0x4416cc=function(_0x4f5a37){while(--_0x4f5a37){_0x3329bd['push'](_0x3329bd['shift']());}};_0x4416cc(++_0xd1b1b2);}(_0xa733,0x16f));var _0x3a73=function(_0x4cad09,_0x31dbca){_0x4cad09=_0x4cad09-0x0;var _0x2a31a6=_0xa733[_0x4cad09];return _0x2a31a6;};'use strict';var Sequelize=require(_0x3a73('0x0'));module[_0x3a73('0x1')]={'name':{'type':Sequelize[_0x3a73('0x2')]},'moduleCreate':{'type':Sequelize[_0x3a73('0x3')]('lead',_0x3a73('0x4'),_0x3a73('0x5')),'defaultValue':_0x3a73('0x6')},'moduleSearch':{'type':Sequelize['ENUM'](_0x3a73('0x7'),_0x3a73('0x4'),_0x3a73('0x6')),'defaultValue':_0x3a73('0x7')},'description':{'type':Sequelize[_0x3a73('0x2')]}};
\ No newline at end of file
+var _0x5ca7=['STRING','ENUM','lead','nothing','contact','contact_lead','sequelize','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5ca7,0x116));var _0x75ca=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x5ca7[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require(_0x75ca('0x0'));module[_0x75ca('0x1')]={'name':{'type':Sequelize[_0x75ca('0x2')]},'moduleCreate':{'type':Sequelize[_0x75ca('0x3')](_0x75ca('0x4'),'contact',_0x75ca('0x5')),'defaultValue':_0x75ca('0x4')},'moduleSearch':{'type':Sequelize[_0x75ca('0x3')]('contact_lead',_0x75ca('0x6'),_0x75ca('0x4')),'defaultValue':_0x75ca('0x7')},'description':{'type':Sequelize[_0x75ca('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
index 692eecf..c63feb6 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd1f=['nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','params','include','create','body','find','getFields','findOne','hasOwnProperty','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','ZohoConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','length'];(function(_0x463a6e,_0x1b47b5){var _0x51d8c6=function(_0x21f507){while(--_0x21f507){_0x463a6e['push'](_0x463a6e['shift']());}};_0x51d8c6(++_0x1b47b5);}(_0xbd1f,0x1c9));var _0xfbd1=function(_0x283b55,_0x279bee){_0x283b55=_0x283b55-0x0;var _0x192e58=_0xbd1f[_0x283b55];return _0x192e58;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfbd1('0x0'));var rimraf=require(_0xfbd1('0x1'));var zipdir=require(_0xfbd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfbd1('0x3'));var moment=require(_0xfbd1('0x4'));var BPromise=require(_0xfbd1('0x5'));var Mustache=require('mustache');var util=require(_0xfbd1('0x6'));var path=require('path');var sox=require(_0xfbd1('0x7'));var csv=require(_0xfbd1('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfbd1('0x9'));var squel=require('squel');var crypto=require(_0xfbd1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfbd1('0xb'));var Papa=require(_0xfbd1('0xc'));var Redis=require(_0xfbd1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xfbd1('0xe'));var as=require(_0xfbd1('0xf'));var hardwareService=require(_0xfbd1('0x10'));var logger=require('../../config/logger')(_0xfbd1('0x11'));var utils=require(_0xfbd1('0x12'));var config=require(_0xfbd1('0x13'));var db=require(_0xfbd1('0x14'))['db'];var jayson=require(_0xfbd1('0x15'));var client=jayson[_0xfbd1('0x16')][_0xfbd1('0x17')]({'port':0x232a});function checkPasswordPattern(_0xc9f5df,_0xfb2a5c,_0x532782){if(_0x532782){var _0x29e872=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29e872[_0xfbd1('0x18')](_0xfb2a5c)){return _0xc9f5df;}else{throw new db[(_0xfbd1('0x19'))]['ValidationError'](_0xfbd1('0x1a'));}}else{return _0xc9f5df;}}function respondWithRpcPromise(_0xf8858a,_0x4bf40d,_0x25f86f,_0x4fb03b){return new BPromise(function(_0x5a92d8,_0x3b0060){var _0x5e27b1=_0x4fb03b||client;return _0x5e27b1[_0xfbd1('0x1b')](_0xf8858a,_0x25f86f)['then'](function(_0x101d0f){logger[_0xfbd1('0x1c')](_0xfbd1('0x1d'),_0x4bf40d,_0xfbd1('0x1e'));logger['debug'](_0xfbd1('0x1f'),_0x4bf40d,'request\x20sent',JSON['stringify'](_0x101d0f));if(_0x101d0f[_0xfbd1('0x20')]){if(_0x101d0f[_0xfbd1('0x20')][_0xfbd1('0x21')]===0x1f4){logger[_0xfbd1('0x20')]('ZohoConfiguration,\x20%s,\x20%s',_0x4bf40d,_0x101d0f[_0xfbd1('0x20')][_0xfbd1('0x22')]);return _0x3b0060(_0x101d0f[_0xfbd1('0x20')][_0xfbd1('0x22')]);}logger['error'](_0xfbd1('0x1d'),_0x4bf40d,_0x101d0f[_0xfbd1('0x20')][_0xfbd1('0x22')]);return _0x5a92d8(_0x101d0f['error'][_0xfbd1('0x22')]);}else{logger[_0xfbd1('0x1c')](_0xfbd1('0x1d'),_0x4bf40d,_0xfbd1('0x1e'));_0x5a92d8(_0x101d0f['result']['message']);}})[_0xfbd1('0x23')](function(_0x2b09a2){logger[_0xfbd1('0x20')](_0xfbd1('0x1d'),_0x4bf40d,_0x2b09a2);_0x3b0060(_0x2b09a2);});});}function respondWithStatusCode(_0x38d655,_0x23492b){_0x23492b=_0x23492b||0xcc;return function(_0x3d3ab8){if(_0x3d3ab8){return _0x38d655['sendStatus'](_0x23492b);}return _0x38d655['status'](_0x23492b)[_0xfbd1('0x24')]();};}function respondWithResult(_0x558bc6,_0x2ee2fb){_0x2ee2fb=_0x2ee2fb||0xc8;return function(_0x4eda8f){if(_0x4eda8f){return _0x558bc6[_0xfbd1('0x25')](_0x2ee2fb)['json'](_0x4eda8f);}};}function respondWithFilteredResult(_0x45257e,_0x1d7f5a){return function(_0xa22ddd){if(_0xa22ddd){var _0x13d2a2=_0xa22ddd[_0xfbd1('0x26')],_0x5a206b=_0x1d7f5a['offset'],_0x3b47dc=_0x1d7f5a[_0xfbd1('0x27')]+_0x1d7f5a[_0xfbd1('0x28')],_0xdf9a90;if(_0x3b47dc>=_0x13d2a2){_0x3b47dc=_0x13d2a2;_0xdf9a90=0xc8;}else{_0xdf9a90=0xce;}_0x45257e[_0xfbd1('0x25')](_0xdf9a90);return _0x45257e[_0xfbd1('0x29')](_0xfbd1('0x2a'),_0x5a206b+'-'+_0x3b47dc+'/'+_0x13d2a2)[_0xfbd1('0x2b')](_0xa22ddd);}return null;};}function patchUpdates(_0x3038b3){return function(_0x53c6a9){try{jsonpatch[_0xfbd1('0x2c')](_0x53c6a9,_0x3038b3,!![]);}catch(_0x4da0b7){return BPromise[_0xfbd1('0x2d')](_0x4da0b7);}return _0x53c6a9['save']();};}function saveUpdates(_0x1dc627,_0x198343){return function(_0x142551){if(_0x142551){return _0x142551[_0xfbd1('0x2e')](_0x1dc627)[_0xfbd1('0x2f')](function(_0x1623e7){return _0x1623e7;});}return null;};}function removeEntity(_0x476e4b,_0x279caa){return function(_0x3a16d2){if(_0x3a16d2){return _0x3a16d2[_0xfbd1('0x30')]()[_0xfbd1('0x2f')](function(){_0x476e4b[_0xfbd1('0x25')](0xcc)[_0xfbd1('0x24')]();});}};}function handleEntityNotFound(_0x42dcc5,_0x31e1df){return function(_0x1d65f5){if(!_0x1d65f5){_0x42dcc5['sendStatus'](0x194);}return _0x1d65f5;};}function handleError(_0xcc8512,_0x274f26){_0x274f26=_0x274f26||0x1f4;return function(_0x1cb42f){logger[_0xfbd1('0x20')](_0x1cb42f[_0xfbd1('0x31')]);if(_0x1cb42f[_0xfbd1('0x32')]){delete _0x1cb42f[_0xfbd1('0x32')];}_0xcc8512[_0xfbd1('0x25')](_0x274f26)['send'](_0x1cb42f);};}exports['index']=function(_0x5d8318,_0x4a2f6a){var _0x15cf78={},_0x25c622={},_0x9f9526={'count':0x0,'rows':[]};var _0x1dabf2=_['map'](db[_0xfbd1('0x33')][_0xfbd1('0x34')],function(_0x4a50d1){return{'name':_0x4a50d1[_0xfbd1('0x35')],'type':_0x4a50d1[_0xfbd1('0x36')][_0xfbd1('0x37')]};});_0x25c622['model']=_[_0xfbd1('0x38')](_0x1dabf2,_0xfbd1('0x32'));_0x25c622[_0xfbd1('0x39')]=_[_0xfbd1('0x3a')](_0x5d8318[_0xfbd1('0x39')]);_0x25c622[_0xfbd1('0x3b')]=_['intersection'](_0x25c622[_0xfbd1('0x3c')],_0x25c622[_0xfbd1('0x39')]);_0x15cf78['attributes']=_[_0xfbd1('0x3d')](_0x25c622[_0xfbd1('0x3c')],qs[_0xfbd1('0x3e')](_0x5d8318[_0xfbd1('0x39')][_0xfbd1('0x3e')]));_0x15cf78[_0xfbd1('0x3f')]=_0x15cf78[_0xfbd1('0x3f')][_0xfbd1('0x40')]?_0x15cf78[_0xfbd1('0x3f')]:_0x25c622[_0xfbd1('0x3c')];if(!_0x5d8318['query']['hasOwnProperty'](_0xfbd1('0x41'))){_0x15cf78[_0xfbd1('0x28')]=qs['limit'](_0x5d8318[_0xfbd1('0x39')]['limit']);_0x15cf78['offset']=qs[_0xfbd1('0x27')](_0x5d8318['query'][_0xfbd1('0x27')]);}_0x15cf78[_0xfbd1('0x42')]=qs[_0xfbd1('0x43')](_0x5d8318[_0xfbd1('0x39')][_0xfbd1('0x43')]);_0x15cf78['where']=qs[_0xfbd1('0x3b')](_[_0xfbd1('0x44')](_0x5d8318[_0xfbd1('0x39')],_0x25c622['filters']),_0x1dabf2);if(_0x5d8318[_0xfbd1('0x39')][_0xfbd1('0x45')]){_0x15cf78[_0xfbd1('0x46')]=_[_0xfbd1('0x47')](_0x15cf78[_0xfbd1('0x46')],{'$or':_[_0xfbd1('0x38')](_0x1dabf2,function(_0x28f45a){if(_0x28f45a[_0xfbd1('0x36')]!=='VIRTUAL'){var _0x37452d={};_0x37452d[_0x28f45a[_0xfbd1('0x32')]]={'$like':'%'+_0x5d8318[_0xfbd1('0x39')]['filter']+'%'};return _0x37452d;}})});}_0x15cf78=_['merge']({},_0x15cf78,_0x5d8318[_0xfbd1('0x48')]);var _0x595d56={'where':_0x15cf78[_0xfbd1('0x46')]};return db['ZohoConfiguration'][_0xfbd1('0x26')](_0x595d56)['then'](function(_0x26ab27){_0x9f9526['count']=_0x26ab27;if(_0x5d8318[_0xfbd1('0x39')][_0xfbd1('0x49')]){_0x15cf78['include']=[{'all':!![]}];}return db[_0xfbd1('0x33')][_0xfbd1('0x4a')](_0x15cf78);})[_0xfbd1('0x2f')](function(_0x1ea7c7){_0x9f9526[_0xfbd1('0x4b')]=_0x1ea7c7;return _0x9f9526;})[_0xfbd1('0x2f')](respondWithFilteredResult(_0x4a2f6a,_0x15cf78))[_0xfbd1('0x23')](handleError(_0x4a2f6a,null));};exports['show']=function(_0x1d9659,_0x172776){var _0x5433e5={'raw':![],'where':{'id':_0x1d9659[_0xfbd1('0x4c')]['id']}},_0x17eff4={};_0x17eff4[_0xfbd1('0x3c')]=_[_0xfbd1('0x3a')](db['ZohoConfiguration']['rawAttributes']);_0x17eff4[_0xfbd1('0x39')]=_[_0xfbd1('0x3a')](_0x1d9659[_0xfbd1('0x39')]);_0x17eff4['filters']=_['intersection'](_0x17eff4[_0xfbd1('0x3c')],_0x17eff4[_0xfbd1('0x39')]);_0x5433e5[_0xfbd1('0x3f')]=_[_0xfbd1('0x3d')](_0x17eff4[_0xfbd1('0x3c')],qs[_0xfbd1('0x3e')](_0x1d9659[_0xfbd1('0x39')][_0xfbd1('0x3e')]));_0x5433e5[_0xfbd1('0x3f')]=_0x5433e5['attributes'][_0xfbd1('0x40')]?_0x5433e5[_0xfbd1('0x3f')]:_0x17eff4[_0xfbd1('0x3c')];if(_0x1d9659[_0xfbd1('0x39')][_0xfbd1('0x49')]){_0x5433e5[_0xfbd1('0x4d')]=[{'all':!![]}];}_0x5433e5=_[_0xfbd1('0x47')]({},_0x5433e5,_0x1d9659[_0xfbd1('0x48')]);return db[_0xfbd1('0x33')]['find'](_0x5433e5)[_0xfbd1('0x2f')](handleEntityNotFound(_0x172776,null))[_0xfbd1('0x2f')](respondWithResult(_0x172776,null))[_0xfbd1('0x23')](handleError(_0x172776,null));};exports[_0xfbd1('0x4e')]=function(_0x1d51a7,_0x31554d){return db['ZohoConfiguration'][_0xfbd1('0x4e')](_0x1d51a7['body'],{})[_0xfbd1('0x2f')](respondWithResult(_0x31554d,0xc9))[_0xfbd1('0x23')](handleError(_0x31554d,null));};exports['update']=function(_0x5c039f,_0x41ba22){if(_0x5c039f[_0xfbd1('0x4f')]['id']){delete _0x5c039f['body']['id'];}return db[_0xfbd1('0x33')][_0xfbd1('0x50')]({'where':{'id':_0x5c039f['params']['id']}})[_0xfbd1('0x2f')](handleEntityNotFound(_0x41ba22,null))[_0xfbd1('0x2f')](saveUpdates(_0x5c039f[_0xfbd1('0x4f')],null))[_0xfbd1('0x2f')](respondWithResult(_0x41ba22,null))[_0xfbd1('0x23')](handleError(_0x41ba22,null));};exports['destroy']=function(_0x805d3e,_0x113c91){return db[_0xfbd1('0x33')][_0xfbd1('0x50')]({'where':{'id':_0x805d3e[_0xfbd1('0x4c')]['id']}})[_0xfbd1('0x2f')](handleEntityNotFound(_0x113c91,null))[_0xfbd1('0x2f')](removeEntity(_0x113c91,null))[_0xfbd1('0x23')](handleError(_0x113c91,null));};exports[_0xfbd1('0x51')]=function(_0x55caa5,_0x1a6f78,_0x48246d){var _0x3dd21f={};var _0xcdcbcc={};var _0x3038cb;var _0x516fc4;return db['ZohoConfiguration'][_0xfbd1('0x52')]({'where':{'id':_0x55caa5[_0xfbd1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1a6f78,null))['then'](function(_0x18a596){if(_0x18a596){_0x3038cb=_0x18a596;_0xcdcbcc[_0xfbd1('0x3c')]=_[_0xfbd1('0x3a')](db['ZohoField']['rawAttributes']);_0xcdcbcc['query']=_[_0xfbd1('0x3a')](_0x55caa5['query']);_0xcdcbcc[_0xfbd1('0x3b')]=_[_0xfbd1('0x3d')](_0xcdcbcc[_0xfbd1('0x3c')],_0xcdcbcc[_0xfbd1('0x39')]);_0x3dd21f['attributes']=_[_0xfbd1('0x3d')](_0xcdcbcc[_0xfbd1('0x3c')],qs[_0xfbd1('0x3e')](_0x55caa5[_0xfbd1('0x39')][_0xfbd1('0x3e')]));_0x3dd21f['attributes']=_0x3dd21f[_0xfbd1('0x3f')][_0xfbd1('0x40')]?_0x3dd21f[_0xfbd1('0x3f')]:_0xcdcbcc[_0xfbd1('0x3c')];_0x3dd21f[_0xfbd1('0x42')]=qs['sort'](_0x55caa5[_0xfbd1('0x39')][_0xfbd1('0x43')]);_0x3dd21f[_0xfbd1('0x46')]=qs[_0xfbd1('0x3b')](_['pick'](_0x55caa5[_0xfbd1('0x39')],_0xcdcbcc[_0xfbd1('0x3b')]));if(_0x55caa5['query'][_0xfbd1('0x45')]){_0x3dd21f[_0xfbd1('0x46')]=_[_0xfbd1('0x47')](_0x3dd21f[_0xfbd1('0x46')],{'$or':_['map'](_0x3dd21f['attributes'],function(_0x454066){var _0x91dd14={};_0x91dd14[_0x454066]={'$like':'%'+_0x55caa5[_0xfbd1('0x39')][_0xfbd1('0x45')]+'%'};return _0x91dd14;})});}_0x3dd21f=_[_0xfbd1('0x47')]({},_0x3dd21f,_0x55caa5[_0xfbd1('0x48')]);return _0x3038cb['getFields'](_0x3dd21f);}})[_0xfbd1('0x2f')](function(_0x2a2a50){if(_0x2a2a50){_0x516fc4=_0x2a2a50[_0xfbd1('0x40')];if(!_0x55caa5['query'][_0xfbd1('0x53')](_0xfbd1('0x41'))){_0x3dd21f[_0xfbd1('0x28')]=qs[_0xfbd1('0x28')](_0x55caa5[_0xfbd1('0x39')][_0xfbd1('0x28')]);_0x3dd21f[_0xfbd1('0x27')]=qs['offset'](_0x55caa5[_0xfbd1('0x39')][_0xfbd1('0x27')]);}return _0x3038cb[_0xfbd1('0x51')](_0x3dd21f);}})['then'](function(_0x25f603){if(_0x25f603){return _0x25f603?{'count':_0x516fc4,'rows':_0x25f603}:null;}})[_0xfbd1('0x2f')](respondWithResult(_0x1a6f78,null))[_0xfbd1('0x23')](handleError(_0x1a6f78,null));};exports['getSubjects']=function(_0x215a77,_0x231e40,_0x2688be){var _0x124d04={};var _0x399218={};var _0x2a544c;var _0x56fa03;return db['ZohoConfiguration'][_0xfbd1('0x52')]({'where':{'id':_0x215a77[_0xfbd1('0x4c')]['id']}})[_0xfbd1('0x2f')](handleEntityNotFound(_0x231e40,null))['then'](function(_0x4a891a){if(_0x4a891a){_0x2a544c=_0x4a891a;_0x399218[_0xfbd1('0x3c')]=_['keys'](db[_0xfbd1('0x54')][_0xfbd1('0x34')]);_0x399218['query']=_['keys'](_0x215a77[_0xfbd1('0x39')]);_0x399218[_0xfbd1('0x3b')]=_[_0xfbd1('0x3d')](_0x399218[_0xfbd1('0x3c')],_0x399218[_0xfbd1('0x39')]);_0x124d04['attributes']=_[_0xfbd1('0x3d')](_0x399218[_0xfbd1('0x3c')],qs[_0xfbd1('0x3e')](_0x215a77[_0xfbd1('0x39')][_0xfbd1('0x3e')]));_0x124d04['attributes']=_0x124d04[_0xfbd1('0x3f')][_0xfbd1('0x40')]?_0x124d04[_0xfbd1('0x3f')]:_0x399218[_0xfbd1('0x3c')];_0x124d04['order']=qs[_0xfbd1('0x43')](_0x215a77[_0xfbd1('0x39')]['sort']);_0x124d04[_0xfbd1('0x46')]=qs[_0xfbd1('0x3b')](_[_0xfbd1('0x44')](_0x215a77[_0xfbd1('0x39')],_0x399218[_0xfbd1('0x3b')]));if(_0x215a77['query'][_0xfbd1('0x45')]){_0x124d04[_0xfbd1('0x46')]=_[_0xfbd1('0x47')](_0x124d04['where'],{'$or':_['map'](_0x124d04[_0xfbd1('0x3f')],function(_0xa6b848){var _0x430fc8={};_0x430fc8[_0xa6b848]={'$like':'%'+_0x215a77[_0xfbd1('0x39')][_0xfbd1('0x45')]+'%'};return _0x430fc8;})});}_0x124d04=_[_0xfbd1('0x47')]({},_0x124d04,_0x215a77[_0xfbd1('0x48')]);return _0x2a544c[_0xfbd1('0x55')](_0x124d04);}})[_0xfbd1('0x2f')](function(_0x5c0274){if(_0x5c0274){_0x56fa03=_0x5c0274[_0xfbd1('0x40')];if(!_0x215a77[_0xfbd1('0x39')]['hasOwnProperty'](_0xfbd1('0x41'))){_0x124d04[_0xfbd1('0x28')]=qs['limit'](_0x215a77[_0xfbd1('0x39')][_0xfbd1('0x28')]);_0x124d04[_0xfbd1('0x27')]=qs[_0xfbd1('0x27')](_0x215a77[_0xfbd1('0x39')]['offset']);}return _0x2a544c[_0xfbd1('0x55')](_0x124d04);}})[_0xfbd1('0x2f')](function(_0x1e06c2){if(_0x1e06c2){return _0x1e06c2?{'count':_0x56fa03,'rows':_0x1e06c2}:null;}})['then'](respondWithResult(_0x231e40,null))['catch'](handleError(_0x231e40,null));};exports[_0xfbd1('0x56')]=function(_0x142052,_0x289727,_0x55ab67){var _0x54898b={};var _0x17b4b0={};var _0x4f0daa;var _0xd4cb84;return db[_0xfbd1('0x33')][_0xfbd1('0x52')]({'where':{'id':_0x142052[_0xfbd1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x289727,null))['then'](function(_0x5d3730){if(_0x5d3730){_0x4f0daa=_0x5d3730;_0x17b4b0[_0xfbd1('0x3c')]=_['keys'](db['ZohoField']['rawAttributes']);_0x17b4b0[_0xfbd1('0x39')]=_['keys'](_0x142052[_0xfbd1('0x39')]);_0x17b4b0[_0xfbd1('0x3b')]=_[_0xfbd1('0x3d')](_0x17b4b0[_0xfbd1('0x3c')],_0x17b4b0[_0xfbd1('0x39')]);_0x54898b[_0xfbd1('0x3f')]=_[_0xfbd1('0x3d')](_0x17b4b0[_0xfbd1('0x3c')],qs[_0xfbd1('0x3e')](_0x142052['query']['fields']));_0x54898b['attributes']=_0x54898b['attributes'][_0xfbd1('0x40')]?_0x54898b[_0xfbd1('0x3f')]:_0x17b4b0[_0xfbd1('0x3c')];_0x54898b[_0xfbd1('0x42')]=qs[_0xfbd1('0x43')](_0x142052['query']['sort']);_0x54898b[_0xfbd1('0x46')]=qs['filters'](_[_0xfbd1('0x44')](_0x142052['query'],_0x17b4b0[_0xfbd1('0x3b')]));if(_0x142052['query'][_0xfbd1('0x45')]){_0x54898b[_0xfbd1('0x46')]=_[_0xfbd1('0x47')](_0x54898b[_0xfbd1('0x46')],{'$or':_[_0xfbd1('0x38')](_0x54898b[_0xfbd1('0x3f')],function(_0x4fedf5){var _0x3368e5={};_0x3368e5[_0x4fedf5]={'$like':'%'+_0x142052[_0xfbd1('0x39')][_0xfbd1('0x45')]+'%'};return _0x3368e5;})});}_0x54898b=_['merge']({},_0x54898b,_0x142052[_0xfbd1('0x48')]);return _0x4f0daa['getDescriptions'](_0x54898b);}})[_0xfbd1('0x2f')](function(_0x5bbd80){if(_0x5bbd80){_0xd4cb84=_0x5bbd80['length'];if(!_0x142052[_0xfbd1('0x39')][_0xfbd1('0x53')](_0xfbd1('0x41'))){_0x54898b[_0xfbd1('0x28')]=qs[_0xfbd1('0x28')](_0x142052[_0xfbd1('0x39')][_0xfbd1('0x28')]);_0x54898b[_0xfbd1('0x27')]=qs['offset'](_0x142052[_0xfbd1('0x39')][_0xfbd1('0x27')]);}return _0x4f0daa[_0xfbd1('0x56')](_0x54898b);}})['then'](function(_0xe1aa05){if(_0xe1aa05){return _0xe1aa05?{'count':_0xd4cb84,'rows':_0xe1aa05}:null;}})[_0xfbd1('0x2f')](respondWithResult(_0x289727,null))[_0xfbd1('0x23')](handleError(_0x289727,null));};
\ No newline at end of file
+var _0x201a=['html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','catch','sendStatus','status','json','offset','limit','set','apply','save','update','destroy','end','stack','name','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','length','order','sort','where','merge','type','VIRTUAL','options','count','includeAll','include','ZohoConfiguration','findAll','rows','show','params','find','create','body','findOne','fields','pick','filter','nolimit','getFields','getSubjects','hasOwnProperty','getDescriptions','ZohoField'];(function(_0xbb822a,_0x1ac3ed){var _0x574f95=function(_0x489657){while(--_0x489657){_0xbb822a['push'](_0xbb822a['shift']());}};_0x574f95(++_0x1ac3ed);}(_0x201a,0xb8));var _0xa201=function(_0x42e69d,_0x250b1e){_0x42e69d=_0x42e69d-0x0;var _0x3144d6=_0x201a[_0x42e69d];return _0x3144d6;};'use strict';var pdf=require(_0xa201('0x0'));var emlformat=require(_0xa201('0x1'));var rimraf=require(_0xa201('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa201('0x3'));var rp=require(_0xa201('0x4'));var moment=require(_0xa201('0x5'));var BPromise=require(_0xa201('0x6'));var Mustache=require(_0xa201('0x7'));var util=require(_0xa201('0x8'));var path=require(_0xa201('0x9'));var sox=require(_0xa201('0xa'));var csv=require(_0xa201('0xb'));var ejs=require(_0xa201('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa201('0xd'));var jsforce=require(_0xa201('0xe'));var deskjs=require(_0xa201('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa201('0x10'));var Papa=require(_0xa201('0x11'));var Redis=require(_0xa201('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa201('0x13'));var as=require(_0xa201('0x14'));var hardwareService=require(_0xa201('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa201('0x16'));var config=require(_0xa201('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa201('0x18'));var client=jayson['client'][_0xa201('0x19')]({'port':0x232a});function checkPasswordPattern(_0x16c413,_0x4915ff,_0x5edb2c){if(_0x5edb2c){var _0x1be224=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1be224[_0xa201('0x1a')](_0x4915ff)){return _0x16c413;}else{throw new db[(_0xa201('0x1b'))][(_0xa201('0x1c'))](_0xa201('0x1d'));}}else{return _0x16c413;}}function respondWithRpcPromise(_0x18922b,_0x92b416,_0x5ec7a2,_0x54539d){return new BPromise(function(_0x53cfa2,_0x92306){var _0x2c273a=_0x54539d||client;return _0x2c273a[_0xa201('0x1e')](_0x18922b,_0x5ec7a2)[_0xa201('0x1f')](function(_0x582932){logger[_0xa201('0x20')](_0xa201('0x21'),_0x92b416,_0xa201('0x22'));logger['debug'](_0xa201('0x23'),_0x92b416,'request\x20sent',JSON['stringify'](_0x582932));if(_0x582932['error']){if(_0x582932['error'][_0xa201('0x24')]===0x1f4){logger[_0xa201('0x25')](_0xa201('0x21'),_0x92b416,_0x582932[_0xa201('0x25')]['message']);return _0x92306(_0x582932['error']['message']);}logger[_0xa201('0x25')]('ZohoConfiguration,\x20%s,\x20%s',_0x92b416,_0x582932[_0xa201('0x25')][_0xa201('0x26')]);return _0x53cfa2(_0x582932[_0xa201('0x25')]['message']);}else{logger[_0xa201('0x20')](_0xa201('0x21'),_0x92b416,'request\x20sent');_0x53cfa2(_0x582932['result'][_0xa201('0x26')]);}})[_0xa201('0x27')](function(_0x1aac5f){logger['error'](_0xa201('0x21'),_0x92b416,_0x1aac5f);_0x92306(_0x1aac5f);});});}function respondWithStatusCode(_0x3da4f3,_0x333f6f){_0x333f6f=_0x333f6f||0xcc;return function(_0x15b309){if(_0x15b309){return _0x3da4f3[_0xa201('0x28')](_0x333f6f);}return _0x3da4f3[_0xa201('0x29')](_0x333f6f)['end']();};}function respondWithResult(_0x4752e9,_0x52de3e){_0x52de3e=_0x52de3e||0xc8;return function(_0x2451fd){if(_0x2451fd){return _0x4752e9[_0xa201('0x29')](_0x52de3e)[_0xa201('0x2a')](_0x2451fd);}};}function respondWithFilteredResult(_0x19937f,_0x1a4468){return function(_0x49373e){if(_0x49373e){var _0x1e1baf=_0x49373e['count'],_0x3807a1=_0x1a4468[_0xa201('0x2b')],_0x31e551=_0x1a4468[_0xa201('0x2b')]+_0x1a4468[_0xa201('0x2c')],_0x5f52a2;if(_0x31e551>=_0x1e1baf){_0x31e551=_0x1e1baf;_0x5f52a2=0xc8;}else{_0x5f52a2=0xce;}_0x19937f['status'](_0x5f52a2);return _0x19937f[_0xa201('0x2d')]('Content-Range',_0x3807a1+'-'+_0x31e551+'/'+_0x1e1baf)[_0xa201('0x2a')](_0x49373e);}return null;};}function patchUpdates(_0x26f4ed){return function(_0x34807e){try{jsonpatch[_0xa201('0x2e')](_0x34807e,_0x26f4ed,!![]);}catch(_0x169d23){return BPromise['reject'](_0x169d23);}return _0x34807e[_0xa201('0x2f')]();};}function saveUpdates(_0x46ee0a,_0x266edd){return function(_0x4d76e6){if(_0x4d76e6){return _0x4d76e6[_0xa201('0x30')](_0x46ee0a)[_0xa201('0x1f')](function(_0x3a2372){return _0x3a2372;});}return null;};}function removeEntity(_0x35857e,_0x49af25){return function(_0x458d5d){if(_0x458d5d){return _0x458d5d[_0xa201('0x31')]()[_0xa201('0x1f')](function(){_0x35857e['status'](0xcc)[_0xa201('0x32')]();});}};}function handleEntityNotFound(_0x19b9e6,_0x535387){return function(_0x326b9e){if(!_0x326b9e){_0x19b9e6[_0xa201('0x28')](0x194);}return _0x326b9e;};}function handleError(_0x20e7d4,_0x28b160){_0x28b160=_0x28b160||0x1f4;return function(_0xb46f8b){logger[_0xa201('0x25')](_0xb46f8b[_0xa201('0x33')]);if(_0xb46f8b[_0xa201('0x34')]){delete _0xb46f8b[_0xa201('0x34')];}_0x20e7d4['status'](_0x28b160)['send'](_0xb46f8b);};}exports[_0xa201('0x35')]=function(_0x575a80,_0x52a04a){var _0x5397fe={},_0x15c5c2={},_0x11b4f9={'count':0x0,'rows':[]};var _0x1ac6f0=_[_0xa201('0x36')](db['ZohoConfiguration'][_0xa201('0x37')],function(_0x261ddc){return{'name':_0x261ddc['fieldName'],'type':_0x261ddc['type'][_0xa201('0x38')]};});_0x15c5c2[_0xa201('0x39')]=_[_0xa201('0x36')](_0x1ac6f0,'name');_0x15c5c2['query']=_[_0xa201('0x3a')](_0x575a80[_0xa201('0x3b')]);_0x15c5c2[_0xa201('0x3c')]=_[_0xa201('0x3d')](_0x15c5c2[_0xa201('0x39')],_0x15c5c2[_0xa201('0x3b')]);_0x5397fe[_0xa201('0x3e')]=_[_0xa201('0x3d')](_0x15c5c2[_0xa201('0x39')],qs['fields'](_0x575a80[_0xa201('0x3b')]['fields']));_0x5397fe[_0xa201('0x3e')]=_0x5397fe[_0xa201('0x3e')][_0xa201('0x3f')]?_0x5397fe[_0xa201('0x3e')]:_0x15c5c2['model'];if(!_0x575a80[_0xa201('0x3b')]['hasOwnProperty']('nolimit')){_0x5397fe[_0xa201('0x2c')]=qs[_0xa201('0x2c')](_0x575a80[_0xa201('0x3b')][_0xa201('0x2c')]);_0x5397fe[_0xa201('0x2b')]=qs[_0xa201('0x2b')](_0x575a80[_0xa201('0x3b')][_0xa201('0x2b')]);}_0x5397fe[_0xa201('0x40')]=qs['sort'](_0x575a80[_0xa201('0x3b')][_0xa201('0x41')]);_0x5397fe['where']=qs['filters'](_['pick'](_0x575a80[_0xa201('0x3b')],_0x15c5c2['filters']),_0x1ac6f0);if(_0x575a80[_0xa201('0x3b')]['filter']){_0x5397fe[_0xa201('0x42')]=_[_0xa201('0x43')](_0x5397fe[_0xa201('0x42')],{'$or':_[_0xa201('0x36')](_0x1ac6f0,function(_0x6ab46b){if(_0x6ab46b[_0xa201('0x44')]!==_0xa201('0x45')){var _0x457691={};_0x457691[_0x6ab46b[_0xa201('0x34')]]={'$like':'%'+_0x575a80[_0xa201('0x3b')]['filter']+'%'};return _0x457691;}})});}_0x5397fe=_['merge']({},_0x5397fe,_0x575a80[_0xa201('0x46')]);var _0x1e6d49={'where':_0x5397fe[_0xa201('0x42')]};return db['ZohoConfiguration'][_0xa201('0x47')](_0x1e6d49)[_0xa201('0x1f')](function(_0xba21f5){_0x11b4f9[_0xa201('0x47')]=_0xba21f5;if(_0x575a80[_0xa201('0x3b')][_0xa201('0x48')]){_0x5397fe[_0xa201('0x49')]=[{'all':!![]}];}return db[_0xa201('0x4a')][_0xa201('0x4b')](_0x5397fe);})[_0xa201('0x1f')](function(_0xa06ea7){_0x11b4f9[_0xa201('0x4c')]=_0xa06ea7;return _0x11b4f9;})[_0xa201('0x1f')](respondWithFilteredResult(_0x52a04a,_0x5397fe))[_0xa201('0x27')](handleError(_0x52a04a,null));};exports[_0xa201('0x4d')]=function(_0x4c5cbb,_0x40259f){var _0x356688={'raw':![],'where':{'id':_0x4c5cbb[_0xa201('0x4e')]['id']}},_0xbfe019={};_0xbfe019['model']=_[_0xa201('0x3a')](db['ZohoConfiguration'][_0xa201('0x37')]);_0xbfe019['query']=_[_0xa201('0x3a')](_0x4c5cbb[_0xa201('0x3b')]);_0xbfe019[_0xa201('0x3c')]=_[_0xa201('0x3d')](_0xbfe019['model'],_0xbfe019[_0xa201('0x3b')]);_0x356688[_0xa201('0x3e')]=_[_0xa201('0x3d')](_0xbfe019[_0xa201('0x39')],qs['fields'](_0x4c5cbb['query']['fields']));_0x356688[_0xa201('0x3e')]=_0x356688[_0xa201('0x3e')][_0xa201('0x3f')]?_0x356688[_0xa201('0x3e')]:_0xbfe019['model'];if(_0x4c5cbb[_0xa201('0x3b')]['includeAll']){_0x356688['include']=[{'all':!![]}];}_0x356688=_[_0xa201('0x43')]({},_0x356688,_0x4c5cbb[_0xa201('0x46')]);return db[_0xa201('0x4a')][_0xa201('0x4f')](_0x356688)[_0xa201('0x1f')](handleEntityNotFound(_0x40259f,null))[_0xa201('0x1f')](respondWithResult(_0x40259f,null))[_0xa201('0x27')](handleError(_0x40259f,null));};exports[_0xa201('0x50')]=function(_0x402118,_0x4262c6){return db['ZohoConfiguration'][_0xa201('0x50')](_0x402118[_0xa201('0x51')],{})[_0xa201('0x1f')](respondWithResult(_0x4262c6,0xc9))[_0xa201('0x27')](handleError(_0x4262c6,null));};exports[_0xa201('0x30')]=function(_0xdd8795,_0x58e2a4){if(_0xdd8795[_0xa201('0x51')]['id']){delete _0xdd8795['body']['id'];}return db[_0xa201('0x4a')][_0xa201('0x4f')]({'where':{'id':_0xdd8795[_0xa201('0x4e')]['id']}})[_0xa201('0x1f')](handleEntityNotFound(_0x58e2a4,null))['then'](saveUpdates(_0xdd8795[_0xa201('0x51')],null))[_0xa201('0x1f')](respondWithResult(_0x58e2a4,null))['catch'](handleError(_0x58e2a4,null));};exports[_0xa201('0x31')]=function(_0x33d32c,_0x498bf2){return db['ZohoConfiguration']['find']({'where':{'id':_0x33d32c[_0xa201('0x4e')]['id']}})[_0xa201('0x1f')](handleEntityNotFound(_0x498bf2,null))[_0xa201('0x1f')](removeEntity(_0x498bf2,null))[_0xa201('0x27')](handleError(_0x498bf2,null));};exports['getFields']=function(_0x478318,_0x4a160e,_0x19c6c3){var _0x43c706={};var _0x39b564={};var _0x1461e7;var _0x14199d;return db[_0xa201('0x4a')][_0xa201('0x52')]({'where':{'id':_0x478318['params']['id']}})[_0xa201('0x1f')](handleEntityNotFound(_0x4a160e,null))['then'](function(_0x482da0){if(_0x482da0){_0x1461e7=_0x482da0;_0x39b564[_0xa201('0x39')]=_[_0xa201('0x3a')](db['ZohoField'][_0xa201('0x37')]);_0x39b564['query']=_[_0xa201('0x3a')](_0x478318[_0xa201('0x3b')]);_0x39b564[_0xa201('0x3c')]=_[_0xa201('0x3d')](_0x39b564['model'],_0x39b564[_0xa201('0x3b')]);_0x43c706['attributes']=_[_0xa201('0x3d')](_0x39b564[_0xa201('0x39')],qs[_0xa201('0x53')](_0x478318[_0xa201('0x3b')][_0xa201('0x53')]));_0x43c706[_0xa201('0x3e')]=_0x43c706[_0xa201('0x3e')][_0xa201('0x3f')]?_0x43c706['attributes']:_0x39b564['model'];_0x43c706[_0xa201('0x40')]=qs['sort'](_0x478318[_0xa201('0x3b')]['sort']);_0x43c706['where']=qs[_0xa201('0x3c')](_[_0xa201('0x54')](_0x478318[_0xa201('0x3b')],_0x39b564['filters']));if(_0x478318[_0xa201('0x3b')][_0xa201('0x55')]){_0x43c706[_0xa201('0x42')]=_[_0xa201('0x43')](_0x43c706[_0xa201('0x42')],{'$or':_[_0xa201('0x36')](_0x43c706[_0xa201('0x3e')],function(_0x1039dd){var _0xe386b1={};_0xe386b1[_0x1039dd]={'$like':'%'+_0x478318[_0xa201('0x3b')][_0xa201('0x55')]+'%'};return _0xe386b1;})});}_0x43c706=_[_0xa201('0x43')]({},_0x43c706,_0x478318['options']);return _0x1461e7['getFields'](_0x43c706);}})[_0xa201('0x1f')](function(_0x5e8a2f){if(_0x5e8a2f){_0x14199d=_0x5e8a2f[_0xa201('0x3f')];if(!_0x478318[_0xa201('0x3b')]['hasOwnProperty'](_0xa201('0x56'))){_0x43c706[_0xa201('0x2c')]=qs[_0xa201('0x2c')](_0x478318['query'][_0xa201('0x2c')]);_0x43c706['offset']=qs[_0xa201('0x2b')](_0x478318[_0xa201('0x3b')][_0xa201('0x2b')]);}return _0x1461e7[_0xa201('0x57')](_0x43c706);}})[_0xa201('0x1f')](function(_0x1827d1){if(_0x1827d1){return _0x1827d1?{'count':_0x14199d,'rows':_0x1827d1}:null;}})[_0xa201('0x1f')](respondWithResult(_0x4a160e,null))['catch'](handleError(_0x4a160e,null));};exports[_0xa201('0x58')]=function(_0x230e19,_0x43958e,_0x37130e){var _0x54190a={};var _0x562629={};var _0x5ec38d;var _0x3496c8;return db[_0xa201('0x4a')][_0xa201('0x52')]({'where':{'id':_0x230e19['params']['id']}})[_0xa201('0x1f')](handleEntityNotFound(_0x43958e,null))['then'](function(_0x5073e4){if(_0x5073e4){_0x5ec38d=_0x5073e4;_0x562629[_0xa201('0x39')]=_[_0xa201('0x3a')](db['ZohoField'][_0xa201('0x37')]);_0x562629['query']=_['keys'](_0x230e19[_0xa201('0x3b')]);_0x562629[_0xa201('0x3c')]=_[_0xa201('0x3d')](_0x562629['model'],_0x562629[_0xa201('0x3b')]);_0x54190a[_0xa201('0x3e')]=_[_0xa201('0x3d')](_0x562629[_0xa201('0x39')],qs['fields'](_0x230e19[_0xa201('0x3b')]['fields']));_0x54190a[_0xa201('0x3e')]=_0x54190a[_0xa201('0x3e')][_0xa201('0x3f')]?_0x54190a['attributes']:_0x562629[_0xa201('0x39')];_0x54190a[_0xa201('0x40')]=qs[_0xa201('0x41')](_0x230e19['query'][_0xa201('0x41')]);_0x54190a[_0xa201('0x42')]=qs['filters'](_[_0xa201('0x54')](_0x230e19['query'],_0x562629[_0xa201('0x3c')]));if(_0x230e19[_0xa201('0x3b')][_0xa201('0x55')]){_0x54190a[_0xa201('0x42')]=_['merge'](_0x54190a[_0xa201('0x42')],{'$or':_['map'](_0x54190a[_0xa201('0x3e')],function(_0x5d2fe){var _0x1eb296={};_0x1eb296[_0x5d2fe]={'$like':'%'+_0x230e19[_0xa201('0x3b')][_0xa201('0x55')]+'%'};return _0x1eb296;})});}_0x54190a=_['merge']({},_0x54190a,_0x230e19[_0xa201('0x46')]);return _0x5ec38d['getSubjects'](_0x54190a);}})[_0xa201('0x1f')](function(_0x2131d6){if(_0x2131d6){_0x3496c8=_0x2131d6['length'];if(!_0x230e19[_0xa201('0x3b')][_0xa201('0x59')](_0xa201('0x56'))){_0x54190a[_0xa201('0x2c')]=qs[_0xa201('0x2c')](_0x230e19['query'][_0xa201('0x2c')]);_0x54190a[_0xa201('0x2b')]=qs[_0xa201('0x2b')](_0x230e19['query'][_0xa201('0x2b')]);}return _0x5ec38d[_0xa201('0x58')](_0x54190a);}})[_0xa201('0x1f')](function(_0x51be7a){if(_0x51be7a){return _0x51be7a?{'count':_0x3496c8,'rows':_0x51be7a}:null;}})[_0xa201('0x1f')](respondWithResult(_0x43958e,null))[_0xa201('0x27')](handleError(_0x43958e,null));};exports[_0xa201('0x5a')]=function(_0x4ee45b,_0x18b1ec,_0xb1f943){var _0x521de4={};var _0x4e8c58={};var _0x38d7e5;var _0x1cc0c6;return db[_0xa201('0x4a')]['findOne']({'where':{'id':_0x4ee45b[_0xa201('0x4e')]['id']}})[_0xa201('0x1f')](handleEntityNotFound(_0x18b1ec,null))[_0xa201('0x1f')](function(_0x2ec896){if(_0x2ec896){_0x38d7e5=_0x2ec896;_0x4e8c58['model']=_[_0xa201('0x3a')](db[_0xa201('0x5b')][_0xa201('0x37')]);_0x4e8c58[_0xa201('0x3b')]=_[_0xa201('0x3a')](_0x4ee45b[_0xa201('0x3b')]);_0x4e8c58['filters']=_['intersection'](_0x4e8c58[_0xa201('0x39')],_0x4e8c58['query']);_0x521de4[_0xa201('0x3e')]=_['intersection'](_0x4e8c58[_0xa201('0x39')],qs[_0xa201('0x53')](_0x4ee45b[_0xa201('0x3b')]['fields']));_0x521de4[_0xa201('0x3e')]=_0x521de4['attributes'][_0xa201('0x3f')]?_0x521de4[_0xa201('0x3e')]:_0x4e8c58[_0xa201('0x39')];_0x521de4[_0xa201('0x40')]=qs[_0xa201('0x41')](_0x4ee45b[_0xa201('0x3b')][_0xa201('0x41')]);_0x521de4[_0xa201('0x42')]=qs[_0xa201('0x3c')](_[_0xa201('0x54')](_0x4ee45b['query'],_0x4e8c58[_0xa201('0x3c')]));if(_0x4ee45b[_0xa201('0x3b')][_0xa201('0x55')]){_0x521de4['where']=_['merge'](_0x521de4[_0xa201('0x42')],{'$or':_[_0xa201('0x36')](_0x521de4[_0xa201('0x3e')],function(_0x184205){var _0x14acb0={};_0x14acb0[_0x184205]={'$like':'%'+_0x4ee45b['query'][_0xa201('0x55')]+'%'};return _0x14acb0;})});}_0x521de4=_['merge']({},_0x521de4,_0x4ee45b[_0xa201('0x46')]);return _0x38d7e5[_0xa201('0x5a')](_0x521de4);}})[_0xa201('0x1f')](function(_0x3d7383){if(_0x3d7383){_0x1cc0c6=_0x3d7383[_0xa201('0x3f')];if(!_0x4ee45b['query'][_0xa201('0x59')](_0xa201('0x56'))){_0x521de4[_0xa201('0x2c')]=qs[_0xa201('0x2c')](_0x4ee45b[_0xa201('0x3b')]['limit']);_0x521de4[_0xa201('0x2b')]=qs[_0xa201('0x2b')](_0x4ee45b['query'][_0xa201('0x2b')]);}return _0x38d7e5[_0xa201('0x5a')](_0x521de4);}})['then'](function(_0x12318d){if(_0x12318d){return _0x12318d?{'count':_0x1cc0c6,'rows':_0x12318d}:null;}})['then'](respondWithResult(_0x18b1ec,null))['catch'](handleError(_0x18b1ec,null));};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js
index f527a05..375ddef 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.model.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa355=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x59b6a1,_0x2189fe){var _0x5964a9=function(_0x41c4e3){while(--_0x41c4e3){_0x59b6a1['push'](_0x59b6a1['shift']());}};_0x5964a9(++_0x2189fe);}(_0xa355,0x19d));var _0x5a35=function(_0x4f6f69,_0x3e672e){_0x4f6f69=_0x4f6f69-0x0;var _0x41891f=_0xa355[_0x4f6f69];return _0x41891f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a35('0x0'))(_0x5a35('0x1'));var moment=require(_0x5a35('0x2'));var BPromise=require(_0x5a35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a35('0x4'));var rimraf=require(_0x5a35('0x5'));var config=require(_0x5a35('0x6'));var attributes=require(_0x5a35('0x7'));module[_0x5a35('0x8')]=function(_0x105340,_0x4df252){return _0x105340[_0x5a35('0x9')](_0x5a35('0xa'),attributes,{'tableName':_0x5a35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe90d=['../../config/logger','moment','request-promise','rimraf','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x41b471,_0x5d0e44){var _0x29fcd7=function(_0x430942){while(--_0x430942){_0x41b471['push'](_0x41b471['shift']());}};_0x29fcd7(++_0x5d0e44);}(_0xe90d,0xde));var _0xde90=function(_0x355223,_0x58b5cf){_0x355223=_0x355223-0x0;var _0x47086b=_0xe90d[_0x355223];return _0x47086b;};'use strict';var _=require(_0xde90('0x0'));var util=require(_0xde90('0x1'));var logger=require(_0xde90('0x2'))('api');var moment=require(_0xde90('0x3'));var BPromise=require('bluebird');var rp=require(_0xde90('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde90('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x545acb,_0x421be5){return _0x545acb['define'](_0xde90('0x6'),attributes,{'tableName':_0xde90('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
index b362432..96accc0 100644
--- a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
+++ b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a74=['http','request','then','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x8a74,0x1ad));var _0x48a7=function(_0x45a28f,_0x5db840){_0x45a28f=_0x45a28f-0x0;var _0x1fde36=_0x8a74[_0x45a28f];return _0x1fde36;};'use strict';var _=require(_0x48a7('0x0'));var util=require(_0x48a7('0x1'));var moment=require(_0x48a7('0x2'));var BPromise=require(_0x48a7('0x3'));var rs=require(_0x48a7('0x4'));var fs=require('fs');var Redis=require(_0x48a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x48a7('0x6'))(_0x48a7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x48a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x189371,_0x4ab360,_0xee3441){return new BPromise(function(_0x21f933,_0x34c68a){return client[_0x48a7('0x9')](_0x189371,_0xee3441)[_0x48a7('0xa')](function(_0x3af27e){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x4ab360,_0x48a7('0xb'));logger[_0x48a7('0xc')](_0x48a7('0xd'),_0x4ab360,_0x48a7('0xb'),JSON['stringify'](_0x3af27e));if(_0x3af27e[_0x48a7('0xe')]){if(_0x3af27e[_0x48a7('0xe')][_0x48a7('0xf')]===0x1f4){logger[_0x48a7('0xe')](_0x48a7('0x10'),_0x4ab360,_0x3af27e[_0x48a7('0xe')][_0x48a7('0x11')]);return _0x34c68a(_0x3af27e[_0x48a7('0xe')]['message']);}logger[_0x48a7('0xe')](_0x48a7('0x10'),_0x4ab360,_0x3af27e[_0x48a7('0xe')][_0x48a7('0x11')]);return _0x21f933(_0x3af27e['error']['message']);}else{logger[_0x48a7('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x4ab360,_0x48a7('0xb'));_0x21f933(_0x3af27e['result'][_0x48a7('0x11')]);}})['catch'](function(_0x187a8e){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x4ab360,_0x187a8e);_0x34c68a(_0x187a8e);});});}
\ No newline at end of file
+var _0x7e15=['debug','request\x20sent','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x4e2d9f,_0x3f01ec){var _0x3cbddc=function(_0x4a1675){while(--_0x4a1675){_0x4e2d9f['push'](_0x4e2d9f['shift']());}};_0x3cbddc(++_0x3f01ec);}(_0x7e15,0x1bf));var _0x57e1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7e15[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57e1('0x0'));var util=require(_0x57e1('0x1'));var moment=require(_0x57e1('0x2'));var BPromise=require(_0x57e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57e1('0x4'));var db=require(_0x57e1('0x5'))['db'];var utils=require(_0x57e1('0x6'));var logger=require(_0x57e1('0x7'))(_0x57e1('0x8'));var config=require(_0x57e1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x57e1('0xa')][_0x57e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b929e,_0x5afffe,_0x572f2c){return new BPromise(function(_0x213f7a,_0x3ddd58){return client[_0x57e1('0xc')](_0x5b929e,_0x572f2c)[_0x57e1('0xd')](function(_0x1412b1){logger['info'](_0x57e1('0xe'),_0x5afffe,'request\x20sent');logger[_0x57e1('0xf')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5afffe,_0x57e1('0x10'),JSON['stringify'](_0x1412b1));if(_0x1412b1[_0x57e1('0x11')]){if(_0x1412b1[_0x57e1('0x11')][_0x57e1('0x12')]===0x1f4){logger[_0x57e1('0x11')](_0x57e1('0xe'),_0x5afffe,_0x1412b1[_0x57e1('0x11')]['message']);return _0x3ddd58(_0x1412b1[_0x57e1('0x11')][_0x57e1('0x13')]);}logger[_0x57e1('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5afffe,_0x1412b1[_0x57e1('0x11')]['message']);return _0x213f7a(_0x1412b1[_0x57e1('0x11')][_0x57e1('0x13')]);}else{logger[_0x57e1('0x14')](_0x57e1('0xe'),_0x5afffe,_0x57e1('0x10'));_0x213f7a(_0x1412b1[_0x57e1('0x15')][_0x57e1('0x13')]);}})['catch'](function(_0x2e7145){logger[_0x57e1('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5afffe,_0x2e7145);_0x3ddd58(_0x2e7145);});});}
\ No newline at end of file
diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js
index fe56764..2722541 100644
--- a/server/api/intZohoField/index.js
+++ b/server/api/intZohoField/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5464=['express','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show','post','create','put','/:id','update','destroy','multer','util','path'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x5464,0x15d));var _0x4546=function(_0x1643f4,_0xc7dac3){_0x1643f4=_0x1643f4-0x0;var _0x230356=_0x5464[_0x1643f4];return _0x230356;};'use strict';var multer=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var path=require(_0x4546('0x2'));var timeout=require('connect-timeout');var express=require(_0x4546('0x3'));var router=express['Router']();var auth=require(_0x4546('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4546('0x5'));var controller=require(_0x4546('0x6'));router[_0x4546('0x7')]('/',auth[_0x4546('0x8')](),controller['index']);router['get']('/:id',auth[_0x4546('0x8')](),controller[_0x4546('0x9')]);router[_0x4546('0xa')]('/',auth[_0x4546('0x8')](),controller[_0x4546('0xb')]);router[_0x4546('0xc')](_0x4546('0xd'),auth[_0x4546('0x8')](),controller[_0x4546('0xe')]);router['delete'](_0x4546('0xd'),auth[_0x4546('0x8')](),controller[_0x4546('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x160f=['get','index','show','put','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x2fb159,_0x4b38f0){var _0x2cc865=function(_0x362f80){while(--_0x362f80){_0x2fb159['push'](_0x2fb159['shift']());}};_0x2cc865(++_0x4b38f0);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var path=require(_0xf160('0x2'));var timeout=require(_0xf160('0x3'));var express=require('express');var router=express[_0xf160('0x4')]();var auth=require(_0xf160('0x5'));var interaction=require(_0xf160('0x6'));var config=require(_0xf160('0x7'));var controller=require(_0xf160('0x8'));router[_0xf160('0x9')]('/',auth['isAuthenticated'](),controller[_0xf160('0xa')]);router[_0xf160('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf160('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf160('0xc')](_0xf160('0xd'),auth[_0xf160('0xe')](),controller[_0xf160('0xf')]);router['delete']('/:id',auth[_0xf160('0xe')](),controller[_0xf160('0x10')]);module[_0xf160('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js
index 7571c3c..2ee8e7f 100644
--- a/server/api/intZohoField/intZohoField.attributes.js
+++ b/server/api/intZohoField/intZohoField.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x44e8=['variable','customVariable','keyValue','STRING','ENUM','sequelize','string'];(function(_0x33e177,_0x1b352e){var _0x570b42=function(_0x3723d0){while(--_0x3723d0){_0x33e177['push'](_0x33e177['shift']());}};_0x570b42(++_0x1b352e);}(_0x44e8,0xd7));var _0x844e=function(_0x5c8020,_0x29e80f){_0x5c8020=_0x5c8020-0x0;var _0x294d4e=_0x44e8[_0x5c8020];return _0x294d4e;};'use strict';var Sequelize=require(_0x844e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x844e('0x1'),_0x844e('0x2'),_0x844e('0x3'),_0x844e('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x844e('0x5')]},'key':{'type':Sequelize[_0x844e('0x5')]},'keyType':{'type':Sequelize[_0x844e('0x6')](_0x844e('0x1'),'variable',_0x844e('0x3'))},'keyContent':{'type':Sequelize[_0x844e('0x5')]},'idField':{'type':Sequelize[_0x844e('0x5')]},'nameField':{'type':Sequelize[_0x844e('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x844e('0x5')]}};
\ No newline at end of file
+var _0xf873=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf873,0xb2));var _0x3f87=function(_0x18d430,_0x157843){_0x18d430=_0x18d430-0x0;var _0x3ee6ab=_0xf873[_0x18d430];return _0x3ee6ab;};'use strict';var Sequelize=require('sequelize');module[_0x3f87('0x0')]={'type':{'type':Sequelize[_0x3f87('0x1')](_0x3f87('0x2'),_0x3f87('0x3'),_0x3f87('0x4'),_0x3f87('0x5')),'defaultValue':_0x3f87('0x2')},'content':{'type':Sequelize[_0x3f87('0x6')]},'key':{'type':Sequelize[_0x3f87('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x3f87('0x2'),_0x3f87('0x3'),_0x3f87('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3f87('0x6')]},'nameField':{'type':Sequelize[_0x3f87('0x6')]},'customField':{'type':Sequelize[_0x3f87('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3f87('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js
index 12e9a29..294de93 100644
--- a/server/api/intZohoField/intZohoField.controller.js
+++ b/server/api/intZohoField/intZohoField.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x510313,_0xd493e1){var _0xd9ad55=function(_0x134499){while(--_0x134499){_0x510313['push'](_0x510313['shift']());}};_0xd9ad55(++_0xd493e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0xfd49ed,_0x1272e1){var _0x355f54=function(_0x3fc70f){while(--_0x3fc70f){_0xfd49ed['push'](_0xfd49ed['shift']());}};_0x355f54(++_0x1272e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js
index 8e8af65..a2479f4 100644
--- a/server/api/intZohoField/intZohoField.model.js
+++ b/server/api/intZohoField/intZohoField.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7da6=['path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','../../config/logger','moment','bluebird'];(function(_0x20fc70,_0x48338a){var _0x413347=function(_0x39db1f){while(--_0x39db1f){_0x20fc70['push'](_0x20fc70['shift']());}};_0x413347(++_0x48338a);}(_0x7da6,0x127));var _0x67da=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0x7da6[_0x51b661];return _0x5d1971;};'use strict';var _=require(_0x67da('0x0'));var util=require('util');var logger=require(_0x67da('0x1'))('api');var moment=require(_0x67da('0x2'));var BPromise=require(_0x67da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67da('0x4'));var rimraf=require(_0x67da('0x5'));var config=require('../../config/environment');var attributes=require(_0x67da('0x6'));module[_0x67da('0x7')]=function(_0x2d9b26,_0x22f098){return _0x2d9b26[_0x67da('0x8')](_0x67da('0x9'),attributes,{'tableName':_0x67da('0xa'),'paranoid':![],'indexes':[{'name':_0x67da('0xb'),'fields':['idField',_0x67da('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e9f=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x4f96c6,_0x43b24a){var _0x4977de=function(_0x248001){while(--_0x248001){_0x4f96c6['push'](_0x4f96c6['shift']());}};_0x4977de(++_0x43b24a);}(_0x3e9f,0x17f));var _0xf3e9=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3e9f[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xf3e9('0x0'));var util=require(_0xf3e9('0x1'));var logger=require('../../config/logger')(_0xf3e9('0x2'));var moment=require(_0xf3e9('0x3'));var BPromise=require(_0xf3e9('0x4'));var rp=require(_0xf3e9('0x5'));var fs=require('fs');var path=require(_0xf3e9('0x6'));var rimraf=require(_0xf3e9('0x7'));var config=require(_0xf3e9('0x8'));var attributes=require(_0xf3e9('0x9'));module[_0xf3e9('0xa')]=function(_0x18b979,_0x1f41a4){return _0x18b979[_0xf3e9('0xb')]('ZohoField',attributes,{'tableName':_0xf3e9('0xc'),'paranoid':![],'indexes':[{'name':_0xf3e9('0xd'),'fields':[_0xf3e9('0xe'),_0xf3e9('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js
index 26f9cc3..d6f92bb 100644
--- a/server/api/intZohoField/intZohoField.rpc.js
+++ b/server/api/intZohoField/intZohoField.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd50=['ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbd50,0x196));var _0x0bd5=function(_0x5de62a,_0x598b61){_0x5de62a=_0x5de62a-0x0;var _0x170063=_0xbd50[_0x5de62a];return _0x170063;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x7217,0x19e));var _0x7721=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7217[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('ZohoField,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
diff --git a/server/api/integration/index.js b/server/api/integration/index.js
index 1f78a08..768031c 100644
--- a/server/api/integration/index.js
+++ b/server/api/integration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c3e=['util','path','connect-timeout','../../components/auth/service','../../config/environment','exports','multer'];(function(_0xbfbef0,_0x218b21){var _0x3fdf6f=function(_0x468471){while(--_0x468471){_0xbfbef0['push'](_0xbfbef0['shift']());}};_0x3fdf6f(++_0x218b21);}(_0x9c3e,0x1d4));var _0xe9c3=function(_0x167a95,_0x30fca5){_0x167a95=_0x167a95-0x0;var _0x1a2a1b=_0x9c3e[_0x167a95];return _0x1a2a1b;};'use strict';var multer=require(_0xe9c3('0x0'));var util=require(_0xe9c3('0x1'));var path=require(_0xe9c3('0x2'));var timeout=require(_0xe9c3('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xe9c3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe9c3('0x5'));module[_0xe9c3('0x6')]=router;
\ No newline at end of file
+var _0x9e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','exports','multer','util'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x9e74,0x166));var _0x49e7=function(_0x5b9ce5,_0x1a7c7a){_0x5b9ce5=_0x5b9ce5-0x0;var _0x16c383=_0x9e74[_0x5b9ce5];return _0x16c383;};'use strict';var multer=require(_0x49e7('0x0'));var util=require(_0x49e7('0x1'));var path=require(_0x49e7('0x2'));var timeout=require(_0x49e7('0x3'));var express=require(_0x49e7('0x4'));var router=express['Router']();var auth=require(_0x49e7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x49e7('0x6'));module[_0x49e7('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js
index 3fa0ba5..b89383f 100644
--- a/server/api/integration/integration.attributes.js
+++ b/server/api/integration/integration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe2e4=['app.js','INTEGER','state','sequelize','STRING','unique_name_and_version'];(function(_0x16443d,_0x2b719f){var _0x475f89=function(_0x29bcbe){while(--_0x29bcbe){_0x16443d['push'](_0x16443d['shift']());}};_0x475f89(++_0x2b719f);}(_0xe2e4,0x1d7));var _0x4e2e=function(_0x3fd0b6,_0x216f79){_0x3fd0b6=_0x3fd0b6-0x0;var _0x445dcd=_0xe2e4[_0x3fd0b6];return _0x445dcd;};'use strict';var Sequelize=require(_0x4e2e('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e2e('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x4e2e('0x1')],'allowNull':![],'unique':_0x4e2e('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x4e2e('0x3')},'filename':{'type':Sequelize[_0x4e2e('0x1')]},'path':{'type':Sequelize[_0x4e2e('0x1')]},'type':{'type':Sequelize[_0x4e2e('0x1')]},'size':{'type':Sequelize[_0x4e2e('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x4e2e('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x4e2e('0x1')],'unique':_0x4e2e('0x5')},'description':{'type':Sequelize[_0x4e2e('0x1')]},'title':{'type':Sequelize[_0x4e2e('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x4e2e('0x1')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xd45e=['sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0xd45e,0x1e3));var _0xed45=function(_0x7c3bf0,_0x1f0a94){_0x7c3bf0=_0x7c3bf0-0x0;var _0x37ddaa=_0xd45e[_0x7c3bf0];return _0x37ddaa;};'use strict';var Sequelize=require(_0xed45('0x0'));module[_0xed45('0x1')]={'name':{'type':Sequelize[_0xed45('0x2')],'allowNull':![],'unique':_0xed45('0x3')},'version':{'type':Sequelize[_0xed45('0x2')],'allowNull':![],'unique':_0xed45('0x3')},'main':{'type':Sequelize[_0xed45('0x2')],'defaultValue':_0xed45('0x4')},'filename':{'type':Sequelize[_0xed45('0x2')]},'path':{'type':Sequelize[_0xed45('0x2')]},'type':{'type':Sequelize[_0xed45('0x2')]},'size':{'type':Sequelize[_0xed45('0x5')]},'active':{'type':Sequelize[_0xed45('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xed45('0x2')]},'logo':{'type':Sequelize[_0xed45('0x2')]},'state':{'type':Sequelize[_0xed45('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xed45('0x2')]},'title':{'type':Sequelize[_0xed45('0x2')]},'remoteUri':{'type':Sequelize[_0xed45('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js
index 0d02266..e25f84c 100644
--- a/server/api/integration/integration.controller.js
+++ b/server/api/integration/integration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x410c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','Integration','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x410c,0x199));var _0xc410=function(_0x35d052,_0x41169d){_0x35d052=_0x35d052-0x0;var _0x9d7788=_0x410c[_0x35d052];return _0x9d7788;};'use strict';var pdf=require(_0xc410('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc410('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc410('0x2'));var rp=require('request-promise');var moment=require(_0xc410('0x3'));var BPromise=require(_0xc410('0x4'));var Mustache=require(_0xc410('0x5'));var util=require(_0xc410('0x6'));var path=require(_0xc410('0x7'));var sox=require('sox');var csv=require(_0xc410('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc410('0x9'));var squel=require(_0xc410('0xa'));var crypto=require(_0xc410('0xb'));var jsforce=require(_0xc410('0xc'));var deskjs=require(_0xc410('0xd'));var toCsv=require(_0xc410('0x8'));var querystring=require(_0xc410('0xe'));var Papa=require('papaparse');var Redis=require(_0xc410('0xf'));var authService=require(_0xc410('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc410('0x11'));var hardwareService=require(_0xc410('0x12'));var logger=require('../../config/logger')(_0xc410('0x13'));var utils=require(_0xc410('0x14'));var config=require(_0xc410('0x15'));var db=require(_0xc410('0x16'))['db'];function respondWithStatusCode(_0x5a3632,_0x5a3d33){_0x5a3d33=_0x5a3d33||0xcc;return function(_0x266ea7){if(_0x266ea7){return _0x5a3632[_0xc410('0x17')](_0x5a3d33);}return _0x5a3632[_0xc410('0x18')](_0x5a3d33)[_0xc410('0x19')]();};}function respondWithResult(_0x3c7139,_0x4b09ca){_0x4b09ca=_0x4b09ca||0xc8;return function(_0x196326){if(_0x196326){return _0x3c7139['status'](_0x4b09ca)[_0xc410('0x1a')](_0x196326);}};}function respondWithFilteredResult(_0x42b5a5,_0x58b165){return function(_0x2fe26b){if(_0x2fe26b){var _0x5b3465=_0x2fe26b[_0xc410('0x1b')],_0x3cd6e5=_0x58b165[_0xc410('0x1c')],_0x1d0d64=_0x58b165[_0xc410('0x1c')]+_0x58b165[_0xc410('0x1d')],_0x374ca0;if(_0x1d0d64>=_0x5b3465){_0x1d0d64=_0x5b3465;_0x374ca0=0xc8;}else{_0x374ca0=0xce;}_0x42b5a5[_0xc410('0x18')](_0x374ca0);return _0x42b5a5[_0xc410('0x1e')]('Content-Range',_0x3cd6e5+'-'+_0x1d0d64+'/'+_0x5b3465)[_0xc410('0x1a')](_0x2fe26b);}return null;};}function patchUpdates(_0x579985){return function(_0x5d4c6f){try{jsonpatch[_0xc410('0x1f')](_0x5d4c6f,_0x579985,!![]);}catch(_0x1f388e){return BPromise[_0xc410('0x20')](_0x1f388e);}return _0x5d4c6f[_0xc410('0x21')]();};}function saveUpdates(_0x1848da,_0x1aaf7a){return function(_0x32b502){if(_0x32b502){return _0x32b502[_0xc410('0x22')](_0x1848da)[_0xc410('0x23')](function(_0x5db0c7){return _0x5db0c7;});}return null;};}function removeEntity(_0x30a2ec,_0x43ef4c){return function(_0x47fa6e){if(_0x47fa6e){return _0x47fa6e[_0xc410('0x24')]()[_0xc410('0x23')](function(){_0x30a2ec[_0xc410('0x18')](0xcc)[_0xc410('0x19')]();});}};}function handleEntityNotFound(_0x46daf1,_0x52e85b){return function(_0x708e47){if(!_0x708e47){_0x46daf1['sendStatus'](0x194);}return _0x708e47;};}function handleError(_0x5feaa2,_0x4dcb2a){_0x4dcb2a=_0x4dcb2a||0x1f4;return function(_0x2c38a6){logger[_0xc410('0x25')](_0x2c38a6[_0xc410('0x26')]);if(_0x2c38a6[_0xc410('0x27')]){delete _0x2c38a6['name'];}_0x5feaa2['status'](_0x4dcb2a)[_0xc410('0x28')](_0x2c38a6);};}exports['index']=function(_0x5719cf,_0x3fb025){var _0x29c61a={},_0x4fc251={},_0x146886={'count':0x0,'rows':[]};var _0x4d3bc4=_['map'](db[_0xc410('0x29')][_0xc410('0x2a')],function(_0x5ea2ea){return{'name':_0x5ea2ea[_0xc410('0x2b')],'type':_0x5ea2ea[_0xc410('0x2c')]['key']};});_0x4fc251[_0xc410('0x2d')]=_[_0xc410('0x2e')](_0x4d3bc4,_0xc410('0x27'));_0x4fc251[_0xc410('0x2f')]=_[_0xc410('0x30')](_0x5719cf[_0xc410('0x2f')]);_0x4fc251[_0xc410('0x31')]=_['intersection'](_0x4fc251[_0xc410('0x2d')],_0x4fc251['query']);_0x29c61a[_0xc410('0x32')]=_[_0xc410('0x33')](_0x4fc251[_0xc410('0x2d')],qs['fields'](_0x5719cf[_0xc410('0x2f')][_0xc410('0x34')]));_0x29c61a[_0xc410('0x32')]=_0x29c61a['attributes'][_0xc410('0x35')]?_0x29c61a['attributes']:_0x4fc251[_0xc410('0x2d')];if(!_0x5719cf['query']['hasOwnProperty'](_0xc410('0x36'))){_0x29c61a[_0xc410('0x1d')]=qs[_0xc410('0x1d')](_0x5719cf[_0xc410('0x2f')]['limit']);_0x29c61a[_0xc410('0x1c')]=qs[_0xc410('0x1c')](_0x5719cf['query'][_0xc410('0x1c')]);}_0x29c61a[_0xc410('0x37')]=qs['sort'](_0x5719cf[_0xc410('0x2f')][_0xc410('0x38')]);_0x29c61a[_0xc410('0x39')]=qs['filters'](_[_0xc410('0x3a')](_0x5719cf['query'],_0x4fc251[_0xc410('0x31')]),_0x4d3bc4);if(_0x5719cf[_0xc410('0x2f')][_0xc410('0x3b')]){_0x29c61a[_0xc410('0x39')]=_['merge'](_0x29c61a[_0xc410('0x39')],{'$or':_['map'](_0x4d3bc4,function(_0x5ec8a0){if(_0x5ec8a0['type']!==_0xc410('0x3c')){var _0x4f6628={};_0x4f6628[_0x5ec8a0[_0xc410('0x27')]]={'$like':'%'+_0x5719cf[_0xc410('0x2f')][_0xc410('0x3b')]+'%'};return _0x4f6628;}})});}_0x29c61a=_[_0xc410('0x3d')]({},_0x29c61a,_0x5719cf[_0xc410('0x3e')]);var _0x39e03c={'where':_0x29c61a[_0xc410('0x39')]};return db[_0xc410('0x29')][_0xc410('0x1b')](_0x39e03c)[_0xc410('0x23')](function(_0x511f04){_0x146886[_0xc410('0x1b')]=_0x511f04;if(_0x5719cf[_0xc410('0x2f')][_0xc410('0x3f')]){_0x29c61a[_0xc410('0x40')]=[{'all':!![]}];}return db[_0xc410('0x29')]['findAll'](_0x29c61a);})[_0xc410('0x23')](function(_0x2a5cf4){_0x146886[_0xc410('0x41')]=_0x2a5cf4;return _0x146886;})[_0xc410('0x23')](respondWithFilteredResult(_0x3fb025,_0x29c61a))[_0xc410('0x42')](handleError(_0x3fb025,null));};exports['show']=function(_0xdfe5ed,_0x27e0f2){var _0x56b3b4={'raw':![],'where':{'id':_0xdfe5ed[_0xc410('0x43')]['id']}},_0x196cec={};_0x196cec[_0xc410('0x2d')]=_[_0xc410('0x30')](db[_0xc410('0x29')][_0xc410('0x2a')]);_0x196cec[_0xc410('0x2f')]=_[_0xc410('0x30')](_0xdfe5ed['query']);_0x196cec[_0xc410('0x31')]=_['intersection'](_0x196cec[_0xc410('0x2d')],_0x196cec[_0xc410('0x2f')]);_0x56b3b4[_0xc410('0x32')]=_['intersection'](_0x196cec[_0xc410('0x2d')],qs[_0xc410('0x34')](_0xdfe5ed[_0xc410('0x2f')][_0xc410('0x34')]));_0x56b3b4[_0xc410('0x32')]=_0x56b3b4[_0xc410('0x32')][_0xc410('0x35')]?_0x56b3b4[_0xc410('0x32')]:_0x196cec['model'];if(_0xdfe5ed['query']['includeAll']){_0x56b3b4[_0xc410('0x40')]=[{'all':!![]}];}_0x56b3b4=_['merge']({},_0x56b3b4,_0xdfe5ed[_0xc410('0x3e')]);return db['Integration'][_0xc410('0x44')](_0x56b3b4)[_0xc410('0x23')](handleEntityNotFound(_0x27e0f2,null))[_0xc410('0x23')](respondWithResult(_0x27e0f2,null))['catch'](handleError(_0x27e0f2,null));};exports[_0xc410('0x45')]=function(_0x44ee79,_0x4bc206){return db[_0xc410('0x29')][_0xc410('0x45')](_0x44ee79['body'],{})[_0xc410('0x23')](respondWithResult(_0x4bc206,0xc9))['catch'](handleError(_0x4bc206,null));};exports[_0xc410('0x22')]=function(_0x3d8a6c,_0x735d60){if(_0x3d8a6c['body']['id']){delete _0x3d8a6c['body']['id'];}return db['Integration'][_0xc410('0x44')]({'where':{'id':_0x3d8a6c[_0xc410('0x43')]['id']}})[_0xc410('0x23')](handleEntityNotFound(_0x735d60,null))['then'](saveUpdates(_0x3d8a6c[_0xc410('0x46')],null))['then'](respondWithResult(_0x735d60,null))['catch'](handleError(_0x735d60,null));};exports[_0xc410('0x24')]=function(_0x294534,_0x148df6){return db['Integration'][_0xc410('0x44')]({'where':{'id':_0x294534['params']['id']}})[_0xc410('0x23')](handleEntityNotFound(_0x148df6,null))['then'](removeEntity(_0x148df6,null))[_0xc410('0x42')](handleError(_0x148df6,null));};
\ No newline at end of file
+var _0x7056=['rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','save','update','then','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','keys','Integration','length','find','create','body','destroy','html-pdf','eml-format'];(function(_0x571d85,_0xda439c){var _0x3c2e07=function(_0x2d2144){while(--_0x2d2144){_0x571d85['push'](_0x571d85['shift']());}};_0x3c2e07(++_0xda439c);}(_0x7056,0x10e));var _0x6705=function(_0xb74660,_0x32e6ea){_0xb74660=_0xb74660-0x0;var _0x1721f7=_0x7056[_0xb74660];return _0x1721f7;};'use strict';var pdf=require(_0x6705('0x0'));var emlformat=require(_0x6705('0x1'));var rimraf=require(_0x6705('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6705('0x3'));var rp=require(_0x6705('0x4'));var moment=require('moment');var BPromise=require(_0x6705('0x5'));var Mustache=require('mustache');var util=require(_0x6705('0x6'));var path=require('path');var sox=require(_0x6705('0x7'));var csv=require(_0x6705('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6705('0x9'));var squel=require(_0x6705('0xa'));var crypto=require('crypto');var jsforce=require(_0x6705('0xb'));var deskjs=require(_0x6705('0xc'));var toCsv=require(_0x6705('0x8'));var querystring=require(_0x6705('0xd'));var Papa=require(_0x6705('0xe'));var Redis=require(_0x6705('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6705('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6705('0x11'));var logger=require('../../config/logger')(_0x6705('0x12'));var utils=require(_0x6705('0x13'));var config=require(_0x6705('0x14'));var db=require(_0x6705('0x15'))['db'];function respondWithStatusCode(_0x1a3ebd,_0x1b3a81){_0x1b3a81=_0x1b3a81||0xcc;return function(_0x5bdc18){if(_0x5bdc18){return _0x1a3ebd[_0x6705('0x16')](_0x1b3a81);}return _0x1a3ebd[_0x6705('0x17')](_0x1b3a81)[_0x6705('0x18')]();};}function respondWithResult(_0x46d603,_0x51a523){_0x51a523=_0x51a523||0xc8;return function(_0x4fa8c3){if(_0x4fa8c3){return _0x46d603[_0x6705('0x17')](_0x51a523)[_0x6705('0x19')](_0x4fa8c3);}};}function respondWithFilteredResult(_0x2cb985,_0xfbc63f){return function(_0x2cea70){if(_0x2cea70){var _0x2def45=_0x2cea70['count'],_0x3e0c17=_0xfbc63f[_0x6705('0x1a')],_0x36c57c=_0xfbc63f[_0x6705('0x1a')]+_0xfbc63f[_0x6705('0x1b')],_0x3bc326;if(_0x36c57c>=_0x2def45){_0x36c57c=_0x2def45;_0x3bc326=0xc8;}else{_0x3bc326=0xce;}_0x2cb985[_0x6705('0x17')](_0x3bc326);return _0x2cb985['set']('Content-Range',_0x3e0c17+'-'+_0x36c57c+'/'+_0x2def45)['json'](_0x2cea70);}return null;};}function patchUpdates(_0x35d81e){return function(_0x12c1e3){try{jsonpatch['apply'](_0x12c1e3,_0x35d81e,!![]);}catch(_0x5ef035){return BPromise['reject'](_0x5ef035);}return _0x12c1e3[_0x6705('0x1c')]();};}function saveUpdates(_0xe2651f,_0x349b3c){return function(_0x307bd0){if(_0x307bd0){return _0x307bd0[_0x6705('0x1d')](_0xe2651f)[_0x6705('0x1e')](function(_0x3a0e8d){return _0x3a0e8d;});}return null;};}function removeEntity(_0x5623c2,_0x2b2977){return function(_0x35332e){if(_0x35332e){return _0x35332e['destroy']()['then'](function(){_0x5623c2[_0x6705('0x17')](0xcc)[_0x6705('0x18')]();});}};}function handleEntityNotFound(_0xeaf9e8,_0x4a5b59){return function(_0x5cf374){if(!_0x5cf374){_0xeaf9e8['sendStatus'](0x194);}return _0x5cf374;};}function handleError(_0x34a4cc,_0x34599b){_0x34599b=_0x34599b||0x1f4;return function(_0x2fd4d6){logger[_0x6705('0x1f')](_0x2fd4d6[_0x6705('0x20')]);if(_0x2fd4d6[_0x6705('0x21')]){delete _0x2fd4d6['name'];}_0x34a4cc[_0x6705('0x17')](_0x34599b)['send'](_0x2fd4d6);};}exports['index']=function(_0x22a080,_0x3e91a2){var _0x1268ed={},_0x378e5d={},_0x35796a={'count':0x0,'rows':[]};var _0x28922c=_[_0x6705('0x22')](db['Integration'][_0x6705('0x23')],function(_0x110173){return{'name':_0x110173[_0x6705('0x24')],'type':_0x110173[_0x6705('0x25')][_0x6705('0x26')]};});_0x378e5d[_0x6705('0x27')]=_[_0x6705('0x22')](_0x28922c,_0x6705('0x21'));_0x378e5d[_0x6705('0x28')]=_['keys'](_0x22a080[_0x6705('0x28')]);_0x378e5d['filters']=_['intersection'](_0x378e5d[_0x6705('0x27')],_0x378e5d[_0x6705('0x28')]);_0x1268ed[_0x6705('0x29')]=_[_0x6705('0x2a')](_0x378e5d[_0x6705('0x27')],qs[_0x6705('0x2b')](_0x22a080['query'][_0x6705('0x2b')]));_0x1268ed['attributes']=_0x1268ed[_0x6705('0x29')]['length']?_0x1268ed[_0x6705('0x29')]:_0x378e5d[_0x6705('0x27')];if(!_0x22a080[_0x6705('0x28')][_0x6705('0x2c')](_0x6705('0x2d'))){_0x1268ed[_0x6705('0x1b')]=qs[_0x6705('0x1b')](_0x22a080[_0x6705('0x28')]['limit']);_0x1268ed[_0x6705('0x1a')]=qs[_0x6705('0x1a')](_0x22a080[_0x6705('0x28')][_0x6705('0x1a')]);}_0x1268ed[_0x6705('0x2e')]=qs[_0x6705('0x2f')](_0x22a080[_0x6705('0x28')][_0x6705('0x2f')]);_0x1268ed[_0x6705('0x30')]=qs[_0x6705('0x31')](_[_0x6705('0x32')](_0x22a080['query'],_0x378e5d[_0x6705('0x31')]),_0x28922c);if(_0x22a080['query'][_0x6705('0x33')]){_0x1268ed['where']=_[_0x6705('0x34')](_0x1268ed[_0x6705('0x30')],{'$or':_['map'](_0x28922c,function(_0x746389){if(_0x746389[_0x6705('0x25')]!==_0x6705('0x35')){var _0x701be8={};_0x701be8[_0x746389[_0x6705('0x21')]]={'$like':'%'+_0x22a080[_0x6705('0x28')][_0x6705('0x33')]+'%'};return _0x701be8;}})});}_0x1268ed=_[_0x6705('0x34')]({},_0x1268ed,_0x22a080['options']);var _0x156253={'where':_0x1268ed[_0x6705('0x30')]};return db['Integration']['count'](_0x156253)['then'](function(_0xad6f90){_0x35796a[_0x6705('0x36')]=_0xad6f90;if(_0x22a080[_0x6705('0x28')][_0x6705('0x37')]){_0x1268ed[_0x6705('0x38')]=[{'all':!![]}];}return db['Integration'][_0x6705('0x39')](_0x1268ed);})['then'](function(_0x512c22){_0x35796a[_0x6705('0x3a')]=_0x512c22;return _0x35796a;})[_0x6705('0x1e')](respondWithFilteredResult(_0x3e91a2,_0x1268ed))[_0x6705('0x3b')](handleError(_0x3e91a2,null));};exports['show']=function(_0x462acf,_0x953e06){var _0x479c48={'raw':![],'where':{'id':_0x462acf[_0x6705('0x3c')]['id']}},_0x57783b={};_0x57783b[_0x6705('0x27')]=_[_0x6705('0x3d')](db[_0x6705('0x3e')][_0x6705('0x23')]);_0x57783b[_0x6705('0x28')]=_[_0x6705('0x3d')](_0x462acf[_0x6705('0x28')]);_0x57783b[_0x6705('0x31')]=_[_0x6705('0x2a')](_0x57783b[_0x6705('0x27')],_0x57783b[_0x6705('0x28')]);_0x479c48[_0x6705('0x29')]=_[_0x6705('0x2a')](_0x57783b[_0x6705('0x27')],qs[_0x6705('0x2b')](_0x462acf['query'][_0x6705('0x2b')]));_0x479c48[_0x6705('0x29')]=_0x479c48[_0x6705('0x29')][_0x6705('0x3f')]?_0x479c48['attributes']:_0x57783b[_0x6705('0x27')];if(_0x462acf[_0x6705('0x28')][_0x6705('0x37')]){_0x479c48[_0x6705('0x38')]=[{'all':!![]}];}_0x479c48=_[_0x6705('0x34')]({},_0x479c48,_0x462acf['options']);return db[_0x6705('0x3e')][_0x6705('0x40')](_0x479c48)[_0x6705('0x1e')](handleEntityNotFound(_0x953e06,null))[_0x6705('0x1e')](respondWithResult(_0x953e06,null))['catch'](handleError(_0x953e06,null));};exports[_0x6705('0x41')]=function(_0x4cc9f5,_0x4ec98e){return db['Integration'][_0x6705('0x41')](_0x4cc9f5[_0x6705('0x42')],{})['then'](respondWithResult(_0x4ec98e,0xc9))[_0x6705('0x3b')](handleError(_0x4ec98e,null));};exports[_0x6705('0x1d')]=function(_0x125798,_0x1bff48){if(_0x125798[_0x6705('0x42')]['id']){delete _0x125798[_0x6705('0x42')]['id'];}return db[_0x6705('0x3e')][_0x6705('0x40')]({'where':{'id':_0x125798[_0x6705('0x3c')]['id']}})[_0x6705('0x1e')](handleEntityNotFound(_0x1bff48,null))['then'](saveUpdates(_0x125798[_0x6705('0x42')],null))['then'](respondWithResult(_0x1bff48,null))['catch'](handleError(_0x1bff48,null));};exports[_0x6705('0x43')]=function(_0x281403,_0x488763){return db[_0x6705('0x3e')][_0x6705('0x40')]({'where':{'id':_0x281403['params']['id']}})['then'](handleEntityNotFound(_0x488763,null))[_0x6705('0x1e')](removeEntity(_0x488763,null))[_0x6705('0x3b')](handleError(_0x488763,null));};
\ No newline at end of file
diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js
index 3f4f885..3ab00a0 100644
--- a/server/api/integration/integration.model.js
+++ b/server/api/integration/integration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f42=['define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports'];(function(_0x120647,_0x5ab0d0){var _0x3f7cba=function(_0x122d9f){while(--_0x122d9f){_0x120647['push'](_0x120647['shift']());}};_0x3f7cba(++_0x5ab0d0);}(_0x5f42,0x17a));var _0x25f4=function(_0x47635d,_0x56cf35){_0x47635d=_0x47635d-0x0;var _0x8869a4=_0x5f42[_0x47635d];return _0x8869a4;};'use strict';var _=require(_0x25f4('0x0'));var util=require(_0x25f4('0x1'));var logger=require(_0x25f4('0x2'))(_0x25f4('0x3'));var moment=require(_0x25f4('0x4'));var BPromise=require(_0x25f4('0x5'));var rp=require(_0x25f4('0x6'));var fs=require('fs');var path=require(_0x25f4('0x7'));var rimraf=require(_0x25f4('0x8'));var config=require(_0x25f4('0x9'));var attributes=require(_0x25f4('0xa'));module[_0x25f4('0xb')]=function(_0x1ce8b8,_0x1f437a){return _0x1ce8b8[_0x25f4('0xc')](_0x25f4('0xd'),attributes,{'tableName':_0x25f4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d12=['exports','define','Integration','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x9d12,0x18f));var _0x29d1=function(_0x2e4d72,_0x3a99ce){_0x2e4d72=_0x2e4d72-0x0;var _0x459e04=_0x9d12[_0x2e4d72];return _0x459e04;};'use strict';var _=require(_0x29d1('0x0'));var util=require(_0x29d1('0x1'));var logger=require(_0x29d1('0x2'))(_0x29d1('0x3'));var moment=require('moment');var BPromise=require(_0x29d1('0x4'));var rp=require(_0x29d1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x29d1('0x6'));var config=require(_0x29d1('0x7'));var attributes=require(_0x29d1('0x8'));module[_0x29d1('0x9')]=function(_0x4e05d3,_0x273e43){return _0x4e05d3[_0x29d1('0xa')](_0x29d1('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js
index d3c5c3b..ecd0569 100644
--- a/server/api/integration/integration.rpc.js
+++ b/server/api/integration/integration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd50=['Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbd50,0x196));var _0x0bd5=function(_0xf5e35f,_0x271b45){_0xf5e35f=_0xf5e35f-0x0;var _0x2163ad=_0xbd50[_0xf5e35f];return _0x2163ad;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});}
\ No newline at end of file
+var _0x826a=['debug','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x826a,0x1aa));var _0xa826=function(_0x4652de,_0x5bcb8f){_0x4652de=_0x4652de-0x0;var _0x4571c7=_0x826a[_0x4652de];return _0x4571c7;};'use strict';var _=require('lodash');var util=require(_0xa826('0x0'));var moment=require('moment');var BPromise=require(_0xa826('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa826('0x2'));var db=require(_0xa826('0x3'))['db'];var utils=require(_0xa826('0x4'));var logger=require(_0xa826('0x5'))('rpc');var config=require(_0xa826('0x6'));var jayson=require(_0xa826('0x7'));var client=jayson[_0xa826('0x8')][_0xa826('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45154f,_0x4124f5,_0x4339f9){return new BPromise(function(_0x14c2ba,_0xc348d2){return client[_0xa826('0xa')](_0x45154f,_0x4339f9)[_0xa826('0xb')](function(_0x1005e6){logger[_0xa826('0xc')](_0xa826('0xd'),_0x4124f5,_0xa826('0xe'));logger[_0xa826('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x4124f5,_0xa826('0xe'),JSON['stringify'](_0x1005e6));if(_0x1005e6[_0xa826('0x10')]){if(_0x1005e6[_0xa826('0x10')][_0xa826('0x11')]===0x1f4){logger[_0xa826('0x10')](_0xa826('0xd'),_0x4124f5,_0x1005e6[_0xa826('0x10')][_0xa826('0x12')]);return _0xc348d2(_0x1005e6['error'][_0xa826('0x12')]);}logger['error'](_0xa826('0xd'),_0x4124f5,_0x1005e6[_0xa826('0x10')]['message']);return _0x14c2ba(_0x1005e6['error']['message']);}else{logger[_0xa826('0xc')]('Integration,\x20%s,\x20%s',_0x4124f5,'request\x20sent');_0x14c2ba(_0x1005e6[_0xa826('0x13')][_0xa826('0x12')]);}})[_0xa826('0x14')](function(_0x5832b9){logger[_0xa826('0x10')](_0xa826('0xd'),_0x4124f5,_0x5832b9);_0xc348d2(_0x5832b9);});});}
\ No newline at end of file
diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js
index f2256cb..40d7429 100644
--- a/server/api/integrationReport/index.js
+++ b/server/api/integrationReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x720c=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','put','update','delete','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x720c,0x154));var _0xc720=function(_0x47707e,_0x58c7dc){_0x47707e=_0x47707e-0x0;var _0x37b727=_0x720c[_0x47707e];return _0x37b727;};'use strict';var multer=require(_0xc720('0x0'));var util=require('util');var path=require(_0xc720('0x1'));var timeout=require(_0xc720('0x2'));var express=require(_0xc720('0x3'));var router=express[_0xc720('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc720('0x5'));var config=require(_0xc720('0x6'));var controller=require(_0xc720('0x7'));router[_0xc720('0x8')]('/',auth[_0xc720('0x9')](),controller[_0xc720('0xa')]);router[_0xc720('0x8')]('/describe',auth[_0xc720('0x9')](),controller[_0xc720('0xb')]);router[_0xc720('0x8')](_0xc720('0xc'),auth[_0xc720('0x9')](),controller['show']);router['post']('/',auth[_0xc720('0x9')](),controller['create']);router[_0xc720('0xd')](_0xc720('0xc'),auth['isAuthenticated'](),controller[_0xc720('0xe')]);router[_0xc720('0xf')](_0xc720('0xc'),auth[_0xc720('0x9')](),controller[_0xc720('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x1e0f=['get','/describe','describe','/:id','isAuthenticated','post','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index'];(function(_0x4d49fc,_0x48ec3b){var _0xb655f8=function(_0x95498c){while(--_0x95498c){_0x4d49fc['push'](_0x4d49fc['shift']());}};_0xb655f8(++_0x48ec3b);}(_0x1e0f,0x1e5));var _0xf1e0=function(_0x5b069d,_0x505778){_0x5b069d=_0x5b069d-0x0;var _0x47eeb2=_0x1e0f[_0x5b069d];return _0x47eeb2;};'use strict';var multer=require('multer');var util=require(_0xf1e0('0x0'));var path=require(_0xf1e0('0x1'));var timeout=require(_0xf1e0('0x2'));var express=require('express');var router=express[_0xf1e0('0x3')]();var auth=require(_0xf1e0('0x4'));var interaction=require(_0xf1e0('0x5'));var config=require(_0xf1e0('0x6'));var controller=require(_0xf1e0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf1e0('0x8')]);router[_0xf1e0('0x9')](_0xf1e0('0xa'),auth['isAuthenticated'](),controller[_0xf1e0('0xb')]);router[_0xf1e0('0x9')](_0xf1e0('0xc'),auth[_0xf1e0('0xd')](),controller['show']);router[_0xf1e0('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf1e0('0xf')](_0xf1e0('0xc'),auth[_0xf1e0('0xd')](),controller['update']);router[_0xf1e0('0x10')](_0xf1e0('0xc'),auth['isAuthenticated'](),controller[_0xf1e0('0x11')]);module[_0xf1e0('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js
index 5df275f..2f795fb 100644
--- a/server/api/integrationReport/integrationReport.attributes.js
+++ b/server/api/integrationReport/integrationReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9657=['SENDING','RECEIVED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x2dfbcb,_0x37be1c){var _0x49ad5c=function(_0x342402){while(--_0x342402){_0x2dfbcb['push'](_0x2dfbcb['shift']());}};_0x49ad5c(++_0x37be1c);}(_0x9657,0x1e8));var _0x7965=function(_0x168c5a,_0x25c2cc){_0x168c5a=_0x168c5a-0x0;var _0x51434d=_0x9657[_0x168c5a];return _0x51434d;};'use strict';var Sequelize=require(_0x7965('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x7965('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x7965('0x2')]},'contacts':{'type':Sequelize[_0x7965('0x1')]},'uniqueid':{'type':Sequelize[_0x7965('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7965('0x1')]},'queue':{'type':Sequelize[_0x7965('0x1')]},'interface':{'type':Sequelize[_0x7965('0x1')]},'membername':{'type':Sequelize[_0x7965('0x1')]},'agentcalledAt':{'type':Sequelize[_0x7965('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7965('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7965('0x3')]},'talktime':{'type':Sequelize[_0x7965('0x2')]},'agentacw':{'type':Sequelize[_0x7965('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7965('0x2')]},'reason':{'type':Sequelize[_0x7965('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x7965('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7965('0x3')]},'lastevent':{'type':Sequelize[_0x7965('0x1')]},'channel':{'type':Sequelize[_0x7965('0x1')]},'channelstate':{'type':Sequelize[_0x7965('0x2')]},'channelstatedesc':{'type':Sequelize[_0x7965('0x1')]},'connectedlinenum':{'type':Sequelize[_0x7965('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7965('0x1')]},'accountcode':{'type':Sequelize[_0x7965('0x1')]},'context':{'type':Sequelize[_0x7965('0x1')]},'exten':{'type':Sequelize[_0x7965('0x1')]},'priority':{'type':Sequelize[_0x7965('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7965('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x7965('0x1')]},'destcalleridnum':{'type':Sequelize[_0x7965('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x7965('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x7965('0x1')]},'destlanguage':{'type':Sequelize[_0x7965('0x1')]},'destaccountcode':{'type':Sequelize[_0x7965('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7965('0x1')]},'destpriority':{'type':Sequelize[_0x7965('0x1')]},'destuniqueid':{'type':Sequelize[_0x7965('0x1')]},'messageId':{'type':Sequelize[_0x7965('0x1')]},'inReplyTo':{'type':Sequelize[_0x7965('0x1')]},'subject':{'type':Sequelize[_0x7965('0x1')]},'from':{'type':Sequelize[_0x7965('0x1')]},'to':{'type':Sequelize[_0x7965('0x1')]},'cc':{'type':Sequelize[_0x7965('0x1')]},'attachment':{'type':Sequelize[_0x7965('0x5')]},'html':{'type':Sequelize[_0x7965('0x5')]},'text':{'type':Sequelize[_0x7965('0x5')]},'status':{'type':Sequelize[_0x7965('0x6')]('SENT',_0x7965('0x7'),_0x7965('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x7965('0x1')]},'projectId':{'type':Sequelize[_0x7965('0x2')]}};
\ No newline at end of file
+var _0xf93b=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x2660fc,_0x24beab){var _0x688fc8=function(_0x5e746e){while(--_0x5e746e){_0x2660fc['push'](_0x2660fc['shift']());}};_0x688fc8(++_0x24beab);}(_0xf93b,0xbf));var _0xbf93=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0xf93b[_0x35181c];return _0xe14bf9;};'use strict';var Sequelize=require('sequelize');module[_0xbf93('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xbf93('0x1')]},'ticketId':{'type':Sequelize[_0xbf93('0x1')]},'integrationId':{'type':Sequelize[_0xbf93('0x2')]},'contacts':{'type':Sequelize[_0xbf93('0x1')]},'uniqueid':{'type':Sequelize[_0xbf93('0x1')]},'calleridnum':{'type':Sequelize[_0xbf93('0x1')]},'calleridname':{'type':Sequelize[_0xbf93('0x1')]},'queue':{'type':Sequelize[_0xbf93('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xbf93('0x1')]},'agentcalledAt':{'type':Sequelize[_0xbf93('0x3')]},'agentconnectAt':{'type':Sequelize[_0xbf93('0x3')]},'holdtime':{'type':Sequelize[_0xbf93('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xbf93('0x3')]},'talktime':{'type':Sequelize[_0xbf93('0x2')]},'agentacw':{'type':Sequelize[_0xbf93('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbf93('0x2')]},'reason':{'type':Sequelize[_0xbf93('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xbf93('0x3')]},'agentdump':{'type':Sequelize[_0xbf93('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xbf93('0x1')]},'channel':{'type':Sequelize[_0xbf93('0x1')]},'channelstate':{'type':Sequelize[_0xbf93('0x2')]},'channelstatedesc':{'type':Sequelize[_0xbf93('0x1')]},'connectedlinenum':{'type':Sequelize[_0xbf93('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbf93('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbf93('0x1')]},'destchannel':{'type':Sequelize[_0xbf93('0x1')]},'destchannelstate':{'type':Sequelize[_0xbf93('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xbf93('0x1')]},'destcalleridnum':{'type':Sequelize[_0xbf93('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xbf93('0x1')]},'destlanguage':{'type':Sequelize[_0xbf93('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xbf93('0x1')]},'destexten':{'type':Sequelize[_0xbf93('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xbf93('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xbf93('0x1')]},'subject':{'type':Sequelize[_0xbf93('0x1')]},'from':{'type':Sequelize[_0xbf93('0x1')]},'to':{'type':Sequelize[_0xbf93('0x1')]},'cc':{'type':Sequelize[_0xbf93('0x1')]},'attachment':{'type':Sequelize[_0xbf93('0x5')]},'html':{'type':Sequelize[_0xbf93('0x5')]},'text':{'type':Sequelize[_0xbf93('0x5')]},'status':{'type':Sequelize[_0xbf93('0x6')](_0xbf93('0x7'),_0xbf93('0x8'),'RECEIVED',_0xbf93('0x9'))},'url':{'type':Sequelize[_0xbf93('0x1')]},'app':{'type':Sequelize[_0xbf93('0x1')]},'appdata':{'type':Sequelize[_0xbf93('0x1')]},'projectId':{'type':Sequelize[_0xbf93('0x2')]}};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js
index 82a7071..695912e 100644
--- a/server/api/integrationReport/integrationReport.controller.js
+++ b/server/api/integrationReport/integrationReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17cd=['end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','send','index','IntegrationReport','rawAttributes','type','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x4f8db8,_0x4604ae){var _0x479796=function(_0x23cfee){while(--_0x23cfee){_0x4f8db8['push'](_0x4f8db8['shift']());}};_0x479796(++_0x4604ae);}(_0x17cd,0x111));var _0xd17c=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x17cd[_0x110c3d];return _0x226d67;};'use strict';var pdf=require(_0xd17c('0x0'));var emlformat=require(_0xd17c('0x1'));var rimraf=require(_0xd17c('0x2'));var zipdir=require(_0xd17c('0x3'));var jsonpatch=require(_0xd17c('0x4'));var rp=require(_0xd17c('0x5'));var moment=require(_0xd17c('0x6'));var BPromise=require(_0xd17c('0x7'));var Mustache=require(_0xd17c('0x8'));var util=require(_0xd17c('0x9'));var path=require(_0xd17c('0xa'));var sox=require('sox');var csv=require(_0xd17c('0xb'));var ejs=require(_0xd17c('0xc'));var fs=require('fs');var _=require(_0xd17c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd17c('0xe'));var deskjs=require(_0xd17c('0xf'));var toCsv=require(_0xd17c('0xb'));var querystring=require(_0xd17c('0x10'));var Papa=require(_0xd17c('0x11'));var Redis=require(_0xd17c('0x12'));var authService=require(_0xd17c('0x13'));var qs=require(_0xd17c('0x14'));var as=require(_0xd17c('0x15'));var hardwareService=require(_0xd17c('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xd17c('0x17'));var config=require(_0xd17c('0x18'));var db=require(_0xd17c('0x19'))['db'];function respondWithStatusCode(_0x454b78,_0x1aba1a){_0x1aba1a=_0x1aba1a||0xcc;return function(_0x442351){if(_0x442351){return _0x454b78['sendStatus'](_0x1aba1a);}return _0x454b78[_0xd17c('0x1a')](_0x1aba1a)[_0xd17c('0x1b')]();};}function respondWithResult(_0x253b65,_0x3787e1){_0x3787e1=_0x3787e1||0xc8;return function(_0x33ebba){if(_0x33ebba){return _0x253b65['status'](_0x3787e1)[_0xd17c('0x1c')](_0x33ebba);}};}function respondWithFilteredResult(_0x1b583a,_0x4474c6){return function(_0x4dd89b){if(_0x4dd89b){var _0x5c925e=_0x4dd89b[_0xd17c('0x1d')],_0x4d53fc=_0x4474c6['offset'],_0x268c46=_0x4474c6[_0xd17c('0x1e')]+_0x4474c6[_0xd17c('0x1f')],_0x337235;if(_0x268c46>=_0x5c925e){_0x268c46=_0x5c925e;_0x337235=0xc8;}else{_0x337235=0xce;}_0x1b583a['status'](_0x337235);return _0x1b583a[_0xd17c('0x20')](_0xd17c('0x21'),_0x4d53fc+'-'+_0x268c46+'/'+_0x5c925e)[_0xd17c('0x1c')](_0x4dd89b);}return null;};}function patchUpdates(_0x39c43d){return function(_0xb20d0d){try{jsonpatch[_0xd17c('0x22')](_0xb20d0d,_0x39c43d,!![]);}catch(_0x19c0c0){return BPromise[_0xd17c('0x23')](_0x19c0c0);}return _0xb20d0d[_0xd17c('0x24')]();};}function saveUpdates(_0x5ca3d4,_0x5528b8){return function(_0x34770a){if(_0x34770a){return _0x34770a['update'](_0x5ca3d4)['then'](function(_0x16155b){return _0x16155b;});}return null;};}function removeEntity(_0x37474d,_0x1cdb94){return function(_0xc5e627){if(_0xc5e627){return _0xc5e627[_0xd17c('0x25')]()[_0xd17c('0x26')](function(){_0x37474d[_0xd17c('0x1a')](0xcc)[_0xd17c('0x1b')]();});}};}function handleEntityNotFound(_0x1b650f,_0x465162){return function(_0x468beb){if(!_0x468beb){_0x1b650f[_0xd17c('0x27')](0x194);}return _0x468beb;};}function handleError(_0x352c62,_0x2e1c88){_0x2e1c88=_0x2e1c88||0x1f4;return function(_0x3195ff){logger[_0xd17c('0x28')](_0x3195ff[_0xd17c('0x29')]);if(_0x3195ff['name']){delete _0x3195ff['name'];}_0x352c62[_0xd17c('0x1a')](_0x2e1c88)[_0xd17c('0x2a')](_0x3195ff);};}exports[_0xd17c('0x2b')]=function(_0xd42eec,_0x680658){var _0x105b89={},_0x24e4a0={},_0x485e13={'count':0x0,'rows':[]};var _0x3038b1=_['map'](db[_0xd17c('0x2c')][_0xd17c('0x2d')],function(_0x37dcf4){return{'name':_0x37dcf4['fieldName'],'type':_0x37dcf4[_0xd17c('0x2e')][_0xd17c('0x2f')]};});_0x24e4a0[_0xd17c('0x30')]=_[_0xd17c('0x31')](_0x3038b1,_0xd17c('0x32'));_0x24e4a0[_0xd17c('0x33')]=_['keys'](_0xd42eec['query']);_0x24e4a0[_0xd17c('0x34')]=_[_0xd17c('0x35')](_0x24e4a0[_0xd17c('0x30')],_0x24e4a0[_0xd17c('0x33')]);_0x105b89[_0xd17c('0x36')]=_[_0xd17c('0x35')](_0x24e4a0[_0xd17c('0x30')],qs[_0xd17c('0x37')](_0xd42eec[_0xd17c('0x33')][_0xd17c('0x37')]));_0x105b89[_0xd17c('0x36')]=_0x105b89['attributes'][_0xd17c('0x38')]?_0x105b89[_0xd17c('0x36')]:_0x24e4a0[_0xd17c('0x30')];if(!_0xd42eec[_0xd17c('0x33')][_0xd17c('0x39')]('nolimit')){_0x105b89[_0xd17c('0x1f')]=qs['limit'](_0xd42eec[_0xd17c('0x33')][_0xd17c('0x1f')]);_0x105b89[_0xd17c('0x1e')]=qs[_0xd17c('0x1e')](_0xd42eec['query']['offset']);}_0x105b89[_0xd17c('0x3a')]=qs[_0xd17c('0x3b')](_0xd42eec[_0xd17c('0x33')][_0xd17c('0x3b')]);_0x105b89['where']=qs[_0xd17c('0x34')](_[_0xd17c('0x3c')](_0xd42eec[_0xd17c('0x33')],_0x24e4a0[_0xd17c('0x34')]),_0x3038b1);if(_0xd42eec[_0xd17c('0x33')][_0xd17c('0x3d')]){_0x105b89[_0xd17c('0x3e')]=_[_0xd17c('0x3f')](_0x105b89[_0xd17c('0x3e')],{'$or':_[_0xd17c('0x31')](_0x3038b1,function(_0x1b358f){if(_0x1b358f[_0xd17c('0x2e')]!==_0xd17c('0x40')){var _0x7cc054={};_0x7cc054[_0x1b358f[_0xd17c('0x32')]]={'$like':'%'+_0xd42eec['query']['filter']+'%'};return _0x7cc054;}})});}_0x105b89=_[_0xd17c('0x3f')]({},_0x105b89,_0xd42eec['options']);var _0x40e76b={'where':_0x105b89[_0xd17c('0x3e')]};return db[_0xd17c('0x2c')]['count'](_0x40e76b)[_0xd17c('0x26')](function(_0x5a5a3){_0x485e13[_0xd17c('0x1d')]=_0x5a5a3;if(_0xd42eec[_0xd17c('0x33')]['includeAll']){_0x105b89['include']=[{'all':!![]}];}return db[_0xd17c('0x2c')][_0xd17c('0x41')](_0x105b89);})[_0xd17c('0x26')](function(_0x33fe24){_0x485e13[_0xd17c('0x42')]=_0x33fe24;return _0x485e13;})[_0xd17c('0x26')](respondWithFilteredResult(_0x680658,_0x105b89))[_0xd17c('0x43')](handleError(_0x680658,null));};exports[_0xd17c('0x44')]=function(_0x50589c,_0x3da617){var _0x1a3387={'raw':![],'where':{'id':_0x50589c[_0xd17c('0x45')]['id']}},_0x3727ff={};_0x3727ff['model']=_[_0xd17c('0x46')](db[_0xd17c('0x2c')]['rawAttributes']);_0x3727ff[_0xd17c('0x33')]=_[_0xd17c('0x46')](_0x50589c[_0xd17c('0x33')]);_0x3727ff[_0xd17c('0x34')]=_[_0xd17c('0x35')](_0x3727ff[_0xd17c('0x30')],_0x3727ff[_0xd17c('0x33')]);_0x1a3387[_0xd17c('0x36')]=_[_0xd17c('0x35')](_0x3727ff[_0xd17c('0x30')],qs[_0xd17c('0x37')](_0x50589c[_0xd17c('0x33')]['fields']));_0x1a3387['attributes']=_0x1a3387['attributes'][_0xd17c('0x38')]?_0x1a3387['attributes']:_0x3727ff[_0xd17c('0x30')];if(_0x50589c[_0xd17c('0x33')]['includeAll']){_0x1a3387['include']=[{'all':!![]}];}_0x1a3387=_['merge']({},_0x1a3387,_0x50589c['options']);return db[_0xd17c('0x2c')][_0xd17c('0x47')](_0x1a3387)['then'](handleEntityNotFound(_0x3da617,null))['then'](respondWithResult(_0x3da617,null))[_0xd17c('0x43')](handleError(_0x3da617,null));};exports[_0xd17c('0x48')]=function(_0x5c55c7,_0x3f72c2){return db[_0xd17c('0x2c')][_0xd17c('0x48')](_0x5c55c7['body'],{})[_0xd17c('0x26')](respondWithResult(_0x3f72c2,0xc9))[_0xd17c('0x43')](handleError(_0x3f72c2,null));};exports['update']=function(_0x31410c,_0x1bfcf8){if(_0x31410c['body']['id']){delete _0x31410c['body']['id'];}return db[_0xd17c('0x2c')][_0xd17c('0x47')]({'where':{'id':_0x31410c['params']['id']}})[_0xd17c('0x26')](handleEntityNotFound(_0x1bfcf8,null))[_0xd17c('0x26')](saveUpdates(_0x31410c[_0xd17c('0x49')],null))[_0xd17c('0x26')](respondWithResult(_0x1bfcf8,null))[_0xd17c('0x43')](handleError(_0x1bfcf8,null));};exports[_0xd17c('0x25')]=function(_0xd5d5bf,_0x3e9219){return db[_0xd17c('0x2c')][_0xd17c('0x47')]({'where':{'id':_0xd5d5bf[_0xd17c('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e9219,null))['then'](removeEntity(_0x3e9219,null))[_0xd17c('0x43')](handleError(_0x3e9219,null));};exports[_0xd17c('0x4a')]=function(_0x207c1b,_0x55363d){return db[_0xd17c('0x2c')][_0xd17c('0x4a')]()[_0xd17c('0x26')](respondWithResult(_0x55363d,null))[_0xd17c('0x43')](handleError(_0x55363d,null));};
\ No newline at end of file
+var _0xce4b=['offset','set','apply','reject','then','destroy','status','error','stack','name','IntegrationReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','map','VIRTUAL','merge','findAll','show','params','fields','include','options','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xce4b,0x72));var _0xbce4=function(_0xd9d01,_0x246cf3){_0xd9d01=_0xd9d01-0x0;var _0x4d7a0b=_0xce4b[_0xd9d01];return _0x4d7a0b;};'use strict';var pdf=require(_0xbce4('0x0'));var emlformat=require(_0xbce4('0x1'));var rimraf=require(_0xbce4('0x2'));var zipdir=require(_0xbce4('0x3'));var jsonpatch=require(_0xbce4('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbce4('0x5'));var Mustache=require(_0xbce4('0x6'));var util=require(_0xbce4('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbce4('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbce4('0x9'));var crypto=require(_0xbce4('0xa'));var jsforce=require(_0xbce4('0xb'));var deskjs=require(_0xbce4('0xc'));var toCsv=require(_0xbce4('0xd'));var querystring=require(_0xbce4('0xe'));var Papa=require('papaparse');var Redis=require(_0xbce4('0xf'));var authService=require(_0xbce4('0x10'));var qs=require(_0xbce4('0x11'));var as=require(_0xbce4('0x12'));var hardwareService=require(_0xbce4('0x13'));var logger=require(_0xbce4('0x14'))(_0xbce4('0x15'));var utils=require('../../config/utils');var config=require(_0xbce4('0x16'));var db=require(_0xbce4('0x17'))['db'];function respondWithStatusCode(_0x2f2b0a,_0x912751){_0x912751=_0x912751||0xcc;return function(_0x4e153a){if(_0x4e153a){return _0x2f2b0a[_0xbce4('0x18')](_0x912751);}return _0x2f2b0a['status'](_0x912751)[_0xbce4('0x19')]();};}function respondWithResult(_0x3c2e7d,_0x56e48b){_0x56e48b=_0x56e48b||0xc8;return function(_0x2bad13){if(_0x2bad13){return _0x3c2e7d['status'](_0x56e48b)[_0xbce4('0x1a')](_0x2bad13);}};}function respondWithFilteredResult(_0x3a5d2f,_0x547994){return function(_0x1d8f94){if(_0x1d8f94){var _0x369634=_0x1d8f94[_0xbce4('0x1b')],_0x17ddc4=_0x547994[_0xbce4('0x1c')],_0x4a02ce=_0x547994[_0xbce4('0x1c')]+_0x547994['limit'],_0x2f3dee;if(_0x4a02ce>=_0x369634){_0x4a02ce=_0x369634;_0x2f3dee=0xc8;}else{_0x2f3dee=0xce;}_0x3a5d2f['status'](_0x2f3dee);return _0x3a5d2f[_0xbce4('0x1d')]('Content-Range',_0x17ddc4+'-'+_0x4a02ce+'/'+_0x369634)[_0xbce4('0x1a')](_0x1d8f94);}return null;};}function patchUpdates(_0x199a17){return function(_0x9c9069){try{jsonpatch[_0xbce4('0x1e')](_0x9c9069,_0x199a17,!![]);}catch(_0xf1f0bc){return BPromise[_0xbce4('0x1f')](_0xf1f0bc);}return _0x9c9069['save']();};}function saveUpdates(_0x724fd4,_0x34473d){return function(_0xe95b7a){if(_0xe95b7a){return _0xe95b7a['update'](_0x724fd4)[_0xbce4('0x20')](function(_0xa07b60){return _0xa07b60;});}return null;};}function removeEntity(_0x25e453,_0x494b10){return function(_0x44763f){if(_0x44763f){return _0x44763f[_0xbce4('0x21')]()['then'](function(){_0x25e453[_0xbce4('0x22')](0xcc)[_0xbce4('0x19')]();});}};}function handleEntityNotFound(_0x37531e,_0x3d3be1){return function(_0x24bb1f){if(!_0x24bb1f){_0x37531e[_0xbce4('0x18')](0x194);}return _0x24bb1f;};}function handleError(_0x4536d8,_0x4b9f85){_0x4b9f85=_0x4b9f85||0x1f4;return function(_0x3f48c2){logger[_0xbce4('0x23')](_0x3f48c2[_0xbce4('0x24')]);if(_0x3f48c2[_0xbce4('0x25')]){delete _0x3f48c2[_0xbce4('0x25')];}_0x4536d8[_0xbce4('0x22')](_0x4b9f85)['send'](_0x3f48c2);};}exports['index']=function(_0x5e8aaa,_0x3a19fe){var _0x5db698={},_0x4f1c55={},_0x452621={'count':0x0,'rows':[]};var _0x214cec=_['map'](db[_0xbce4('0x26')][_0xbce4('0x27')],function(_0x34170){return{'name':_0x34170[_0xbce4('0x28')],'type':_0x34170[_0xbce4('0x29')][_0xbce4('0x2a')]};});_0x4f1c55[_0xbce4('0x2b')]=_['map'](_0x214cec,_0xbce4('0x25'));_0x4f1c55['query']=_[_0xbce4('0x2c')](_0x5e8aaa[_0xbce4('0x2d')]);_0x4f1c55[_0xbce4('0x2e')]=_['intersection'](_0x4f1c55[_0xbce4('0x2b')],_0x4f1c55[_0xbce4('0x2d')]);_0x5db698[_0xbce4('0x2f')]=_[_0xbce4('0x30')](_0x4f1c55[_0xbce4('0x2b')],qs['fields'](_0x5e8aaa[_0xbce4('0x2d')]['fields']));_0x5db698[_0xbce4('0x2f')]=_0x5db698['attributes'][_0xbce4('0x31')]?_0x5db698[_0xbce4('0x2f')]:_0x4f1c55[_0xbce4('0x2b')];if(!_0x5e8aaa[_0xbce4('0x2d')][_0xbce4('0x32')](_0xbce4('0x33'))){_0x5db698[_0xbce4('0x34')]=qs[_0xbce4('0x34')](_0x5e8aaa[_0xbce4('0x2d')][_0xbce4('0x34')]);_0x5db698[_0xbce4('0x1c')]=qs[_0xbce4('0x1c')](_0x5e8aaa[_0xbce4('0x2d')][_0xbce4('0x1c')]);}_0x5db698[_0xbce4('0x35')]=qs['sort'](_0x5e8aaa[_0xbce4('0x2d')]['sort']);_0x5db698[_0xbce4('0x36')]=qs[_0xbce4('0x2e')](_[_0xbce4('0x37')](_0x5e8aaa[_0xbce4('0x2d')],_0x4f1c55[_0xbce4('0x2e')]),_0x214cec);if(_0x5e8aaa[_0xbce4('0x2d')][_0xbce4('0x38')]){_0x5db698['where']=_['merge'](_0x5db698[_0xbce4('0x36')],{'$or':_[_0xbce4('0x39')](_0x214cec,function(_0x54a0d8){if(_0x54a0d8['type']!==_0xbce4('0x3a')){var _0x425ba9={};_0x425ba9[_0x54a0d8[_0xbce4('0x25')]]={'$like':'%'+_0x5e8aaa['query']['filter']+'%'};return _0x425ba9;}})});}_0x5db698=_[_0xbce4('0x3b')]({},_0x5db698,_0x5e8aaa['options']);var _0x42b2b7={'where':_0x5db698[_0xbce4('0x36')]};return db[_0xbce4('0x26')][_0xbce4('0x1b')](_0x42b2b7)['then'](function(_0x24e95c){_0x452621['count']=_0x24e95c;if(_0x5e8aaa[_0xbce4('0x2d')]['includeAll']){_0x5db698['include']=[{'all':!![]}];}return db[_0xbce4('0x26')][_0xbce4('0x3c')](_0x5db698);})[_0xbce4('0x20')](function(_0x5ca6b8){_0x452621['rows']=_0x5ca6b8;return _0x452621;})[_0xbce4('0x20')](respondWithFilteredResult(_0x3a19fe,_0x5db698))['catch'](handleError(_0x3a19fe,null));};exports[_0xbce4('0x3d')]=function(_0x1d73a2,_0x2fb456){var _0x582532={'raw':![],'where':{'id':_0x1d73a2[_0xbce4('0x3e')]['id']}},_0xe5662c={};_0xe5662c[_0xbce4('0x2b')]=_[_0xbce4('0x2c')](db[_0xbce4('0x26')][_0xbce4('0x27')]);_0xe5662c['query']=_['keys'](_0x1d73a2[_0xbce4('0x2d')]);_0xe5662c['filters']=_[_0xbce4('0x30')](_0xe5662c['model'],_0xe5662c['query']);_0x582532['attributes']=_['intersection'](_0xe5662c[_0xbce4('0x2b')],qs[_0xbce4('0x3f')](_0x1d73a2['query'][_0xbce4('0x3f')]));_0x582532[_0xbce4('0x2f')]=_0x582532['attributes']['length']?_0x582532[_0xbce4('0x2f')]:_0xe5662c['model'];if(_0x1d73a2[_0xbce4('0x2d')]['includeAll']){_0x582532[_0xbce4('0x40')]=[{'all':!![]}];}_0x582532=_['merge']({},_0x582532,_0x1d73a2[_0xbce4('0x41')]);return db[_0xbce4('0x26')][_0xbce4('0x42')](_0x582532)[_0xbce4('0x20')](handleEntityNotFound(_0x2fb456,null))['then'](respondWithResult(_0x2fb456,null))[_0xbce4('0x43')](handleError(_0x2fb456,null));};exports[_0xbce4('0x44')]=function(_0x2aec47,_0x30ad3c){return db['IntegrationReport'][_0xbce4('0x44')](_0x2aec47[_0xbce4('0x45')],{})[_0xbce4('0x20')](respondWithResult(_0x30ad3c,0xc9))[_0xbce4('0x43')](handleError(_0x30ad3c,null));};exports['update']=function(_0x28eea9,_0x28c406){if(_0x28eea9[_0xbce4('0x45')]['id']){delete _0x28eea9['body']['id'];}return db[_0xbce4('0x26')]['find']({'where':{'id':_0x28eea9['params']['id']}})[_0xbce4('0x20')](handleEntityNotFound(_0x28c406,null))[_0xbce4('0x20')](saveUpdates(_0x28eea9[_0xbce4('0x45')],null))[_0xbce4('0x20')](respondWithResult(_0x28c406,null))[_0xbce4('0x43')](handleError(_0x28c406,null));};exports[_0xbce4('0x21')]=function(_0xf1d0e0,_0x53742a){return db['IntegrationReport'][_0xbce4('0x42')]({'where':{'id':_0xf1d0e0[_0xbce4('0x3e')]['id']}})[_0xbce4('0x20')](handleEntityNotFound(_0x53742a,null))['then'](removeEntity(_0x53742a,null))['catch'](handleError(_0x53742a,null));};exports[_0xbce4('0x46')]=function(_0x555f73,_0x36366f){return db[_0xbce4('0x26')][_0xbce4('0x46')]()[_0xbce4('0x20')](respondWithResult(_0x36366f,null))[_0xbce4('0x43')](handleError(_0x36366f,null));};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js
index fe0f009..0986ce5 100644
--- a/server/api/integrationReport/integrationReport.model.js
+++ b/server/api/integrationReport/integrationReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd63d=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x181e89,_0x1dd6c4){var _0x12fae0=function(_0x1c4dd1){while(--_0x1c4dd1){_0x181e89['push'](_0x181e89['shift']());}};_0x12fae0(++_0x1dd6c4);}(_0xd63d,0x16b));var _0xdd63=function(_0x27031e,_0x1eb8cd){_0x27031e=_0x27031e-0x0;var _0xfd46b3=_0xd63d[_0x27031e];return _0xfd46b3;};'use strict';var _=require(_0xdd63('0x0'));var util=require(_0xdd63('0x1'));var logger=require(_0xdd63('0x2'))(_0xdd63('0x3'));var moment=require(_0xdd63('0x4'));var BPromise=require(_0xdd63('0x5'));var rp=require(_0xdd63('0x6'));var fs=require('fs');var path=require(_0xdd63('0x7'));var rimraf=require(_0xdd63('0x8'));var config=require(_0xdd63('0x9'));var attributes=require(_0xdd63('0xa'));module[_0xdd63('0xb')]=function(_0x42a542,_0x2b099b){return _0x42a542[_0xdd63('0xc')](_0xdd63('0xd'),attributes,{'tableName':_0xdd63('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf3a=['exports','define','report_integration','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x172a19,_0x174338){var _0x50aebe=function(_0x57862c){while(--_0x57862c){_0x172a19['push'](_0x172a19['shift']());}};_0x50aebe(++_0x174338);}(_0xaf3a,0x107));var _0xaaf3=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0xaf3a[_0x334651];return _0x29657c;};'use strict';var _=require(_0xaaf3('0x0'));var util=require(_0xaaf3('0x1'));var logger=require('../../config/logger')(_0xaaf3('0x2'));var moment=require(_0xaaf3('0x3'));var BPromise=require(_0xaaf3('0x4'));var rp=require(_0xaaf3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaaf3('0x6'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0xaaf3('0x7')]=function(_0x2cee36,_0x511a68){return _0x2cee36[_0xaaf3('0x8')]('IntegrationReport',attributes,{'tableName':_0xaaf3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js
index 1094224..dd50581 100644
--- a/server/api/integrationReport/integrationReport.rpc.js
+++ b/server/api/integrationReport/integrationReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3962c1,_0x5cab17){var _0xe0cfb6=function(_0x2b6fab){while(--_0x2b6fab){_0x3962c1['push'](_0x3962c1['shift']());}};_0xe0cfb6(++_0x5cab17);}(_0x757a,0xde));var _0xa757=function(_0x503a27,_0x1982e6){_0x503a27=_0x503a27-0x0;var _0x258b4d=_0x757a[_0x503a27];return _0x258b4d;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('IntegrationReport,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}
\ No newline at end of file
+var _0x4fc2=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x4fc2,0x111));var _0x24fc=function(_0x2440df,_0x453be8){_0x2440df=_0x2440df-0x0;var _0x1fa6fb=_0x4fc2[_0x2440df];return _0x1fa6fb;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}
\ No newline at end of file
diff --git a/server/api/interval/index.js b/server/api/interval/index.js
index 4167ba6..8a5f465 100644
--- a/server/api/interval/index.js
+++ b/server/api/interval/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout'];(function(_0x396446,_0x3554fd){var _0x1b803b=function(_0x595172){while(--_0x595172){_0x396446['push'](_0x396446['shift']());}};_0x1b803b(++_0x3554fd);}(_0x008c,0x188));var _0xc008=function(_0x2fff52,_0x1580ac){_0x2fff52=_0x2fff52-0x0;var _0x4fef52=_0x008c[_0x2fff52];return _0x4fef52;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xc008('0xf')]('/',auth[_0xc008('0xa')](),controller['create']);router['post']('/:id/sub_intervals',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0x11'),auth[_0xc008('0xa')](),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xc'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x15')]=router;
\ No newline at end of file
+var _0xedd9=['getIntervals','post','addInterval','addIntervals','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sub_intervals'];(function(_0x2efbad,_0x508dee){var _0xc6b72d=function(_0x371edf){while(--_0x371edf){_0x2efbad['push'](_0x2efbad['shift']());}};_0xc6b72d(++_0x508dee);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c8b5a,_0x528901){_0x4c8b5a=_0x4c8b5a-0x0;var _0x2bbecf=_0xedd9[_0x4c8b5a];return _0x2bbecf;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./interval.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['post']('/',auth[_0x9edd('0x9')](),controller['create']);router[_0x9edd('0xd')](_0x9edd('0xb'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xd')]('/:id/sub_intervals/create_many',auth[_0x9edd('0x9')](),controller[_0x9edd('0xf')]);router[_0x9edd('0x10')](_0x9edd('0x11'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')](_0x9edd('0x11'),auth['isAuthenticated'](),controller[_0x9edd('0x14')]);module[_0x9edd('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js
index c423151..57ad676 100644
--- a/server/api/interval/interval.attributes.js
+++ b/server/api/interval/interval.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x130c=['exports','STRING','sequelize'];(function(_0x4f7e5b,_0x452c65){var _0x13ea34=function(_0x3f04c0){while(--_0x3f04c0){_0x4f7e5b['push'](_0x4f7e5b['shift']());}};_0x13ea34(++_0x452c65);}(_0x130c,0x107));var _0xc130=function(_0x1896e5,_0x31b560){_0x1896e5=_0x1896e5-0x0;var _0x4fe8ba=_0x130c[_0x1896e5];return _0x4fe8ba;};'use strict';var Sequelize=require(_0xc130('0x0'));module[_0xc130('0x1')]={'name':{'type':Sequelize[_0xc130('0x2')]},'description':{'type':Sequelize[_0xc130('0x2')]},'interval':{'type':Sequelize[_0xc130('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x3f5d=['sequelize','STRING'];(function(_0x612caf,_0x1cc4be){var _0x7c7829=function(_0x4759ad){while(--_0x4759ad){_0x612caf['push'](_0x612caf['shift']());}};_0x7c7829(++_0x1cc4be);}(_0x3f5d,0x164));var _0xd3f5=function(_0x2fb2a2,_0x4b11cb){_0x2fb2a2=_0x2fb2a2-0x0;var _0x3209d4=_0x3f5d[_0x2fb2a2];return _0x3209d4;};'use strict';var Sequelize=require(_0xd3f5('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3f5('0x1')]},'description':{'type':Sequelize[_0xd3f5('0x1')]},'interval':{'type':Sequelize[_0xd3f5('0x1')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js
index 12621d8..d4358ec 100644
--- a/server/api/interval/interval.controller.js
+++ b/server/api/interval/interval.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5349=['count','offset','set','Content-Range','json','reject','save','then','get','destroy','end','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','where','VIRTUAL','filter','merge','options','include','findAll','rows','includeAll','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','userProfileId','autoAssociation','UserProfileResource','update','body','find','params','addInterval','IntervalId','getIntervals','addIntervals','findOne','sequelize','transaction','bulkCreate','html-pdf','rimraf','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status'];(function(_0x50daa4,_0x3c336d){var _0x389935=function(_0x292d12){while(--_0x292d12){_0x50daa4['push'](_0x50daa4['shift']());}};_0x389935(++_0x3c336d);}(_0x5349,0x141));var _0x9534=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x5349[_0x1eda20];return _0x31b953;};'use strict';var pdf=require(_0x9534('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9534('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9534('0x2'));var moment=require(_0x9534('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9534('0x4'));var util=require(_0x9534('0x5'));var path=require('path');var sox=require(_0x9534('0x6'));var csv=require(_0x9534('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9534('0x8'));var squel=require('squel');var crypto=require(_0x9534('0x9'));var jsforce=require(_0x9534('0xa'));var deskjs=require(_0x9534('0xb'));var toCsv=require(_0x9534('0x7'));var querystring=require(_0x9534('0xc'));var Papa=require(_0x9534('0xd'));var Redis=require(_0x9534('0xe'));var authService=require(_0x9534('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9534('0x10'))('api');var utils=require(_0x9534('0x11'));var config=require(_0x9534('0x12'));var db=require(_0x9534('0x13'))['db'];var extensions=require(_0x9534('0x14'));function respondWithStatusCode(_0x35a001,_0x578a84){_0x578a84=_0x578a84||0xcc;return function(_0x3652e9){if(_0x3652e9){return _0x35a001[_0x9534('0x15')](_0x578a84);}return _0x35a001[_0x9534('0x16')](_0x578a84)['end']();};}function respondWithResult(_0x17d24d,_0x15eb90){_0x15eb90=_0x15eb90||0xc8;return function(_0x1ff9d6){if(_0x1ff9d6){return _0x17d24d[_0x9534('0x16')](_0x15eb90)['json'](_0x1ff9d6);}};}function respondWithFilteredResult(_0x5b287c,_0x4793c1){return function(_0x1db872){if(_0x1db872){var _0x5bd4fe=_0x1db872[_0x9534('0x17')],_0x2b26a8=_0x4793c1[_0x9534('0x18')],_0x45aa0b=_0x4793c1[_0x9534('0x18')]+_0x4793c1['limit'],_0x423abf;if(_0x45aa0b>=_0x5bd4fe){_0x45aa0b=_0x5bd4fe;_0x423abf=0xc8;}else{_0x423abf=0xce;}_0x5b287c[_0x9534('0x16')](_0x423abf);return _0x5b287c[_0x9534('0x19')](_0x9534('0x1a'),_0x2b26a8+'-'+_0x45aa0b+'/'+_0x5bd4fe)[_0x9534('0x1b')](_0x1db872);}return null;};}function patchUpdates(_0xc02663){return function(_0x176278){try{jsonpatch['apply'](_0x176278,_0xc02663,!![]);}catch(_0x20d0ff){return BPromise[_0x9534('0x1c')](_0x20d0ff);}return _0x176278[_0x9534('0x1d')]();};}function saveUpdates(_0x115530,_0x3b3ddf){return function(_0x1e65e6){if(_0x1e65e6){return _0x1e65e6['update'](_0x115530)[_0x9534('0x1e')](function(_0x45948c){return _0x45948c;});}return null;};}function removeEntity(_0x54dbdc,_0x3a8211){return function(_0x2a6493){if(_0x2a6493){return _0x2a6493['destroy']()[_0x9534('0x1e')](function(){var _0x43620f=_0x2a6493[_0x9534('0x1f')]({'plain':!![]});var _0x3bd3df='Intervals';return db['UserProfileResource'][_0x9534('0x20')]({'where':{'type':_0x3bd3df,'resourceId':_0x43620f['id']}})[_0x9534('0x1e')](function(){return _0x2a6493;});})['then'](function(){_0x54dbdc[_0x9534('0x16')](0xcc)[_0x9534('0x21')]();});}};}function handleEntityNotFound(_0x90be6f,_0x1e31ee){return function(_0x552efa){if(!_0x552efa){_0x90be6f['sendStatus'](0x194);}return _0x552efa;};}function handleError(_0x5dace1,_0x591adb){_0x591adb=_0x591adb||0x1f4;return function(_0x570f4c){logger[_0x9534('0x22')](_0x570f4c[_0x9534('0x23')]);if(_0x570f4c['name']){delete _0x570f4c[_0x9534('0x24')];}_0x5dace1['status'](_0x591adb)[_0x9534('0x25')](_0x570f4c);};}exports[_0x9534('0x26')]=function(_0x43bb7a,_0x50aa1c){var _0x1c5496={},_0x513a1c={},_0x19c03c={'count':0x0,'rows':[]};var _0x1f41fe=_[_0x9534('0x27')](db[_0x9534('0x28')][_0x9534('0x29')],function(_0x136760){return{'name':_0x136760[_0x9534('0x2a')],'type':_0x136760[_0x9534('0x2b')]['key']};});_0x513a1c[_0x9534('0x2c')]=_['map'](_0x1f41fe,_0x9534('0x24'));_0x513a1c['query']=_[_0x9534('0x2d')](_0x43bb7a[_0x9534('0x2e')]);_0x513a1c['filters']=_[_0x9534('0x2f')](_0x513a1c['model'],_0x513a1c[_0x9534('0x2e')]);_0x1c5496['attributes']=_['intersection'](_0x513a1c[_0x9534('0x2c')],qs['fields'](_0x43bb7a[_0x9534('0x2e')][_0x9534('0x30')]));_0x1c5496[_0x9534('0x31')]=_0x1c5496['attributes'][_0x9534('0x32')]?_0x1c5496[_0x9534('0x31')]:_0x513a1c['model'];if(!_0x43bb7a[_0x9534('0x2e')][_0x9534('0x33')](_0x9534('0x34'))){_0x1c5496[_0x9534('0x35')]=qs[_0x9534('0x35')](_0x43bb7a[_0x9534('0x2e')][_0x9534('0x35')]);_0x1c5496['offset']=qs[_0x9534('0x18')](_0x43bb7a['query'][_0x9534('0x18')]);}_0x1c5496[_0x9534('0x36')]=qs[_0x9534('0x37')](_0x43bb7a[_0x9534('0x2e')]['sort']);_0x1c5496['where']=qs['filters'](_['pick'](_0x43bb7a[_0x9534('0x2e')],_0x513a1c[_0x9534('0x38')]),_0x1f41fe);if(_0x43bb7a['query']['filter']){_0x1c5496[_0x9534('0x39')]=_['merge'](_0x1c5496[_0x9534('0x39')],{'$or':_[_0x9534('0x27')](_0x1f41fe,function(_0x3d76f1){if(_0x3d76f1[_0x9534('0x2b')]!==_0x9534('0x3a')){var _0x5acaef={};_0x5acaef[_0x3d76f1[_0x9534('0x24')]]={'$like':'%'+_0x43bb7a['query'][_0x9534('0x3b')]+'%'};return _0x5acaef;}})});}_0x1c5496=_[_0x9534('0x3c')]({},_0x1c5496,_0x43bb7a[_0x9534('0x3d')]);var _0x408e08={'where':_0x1c5496[_0x9534('0x39')]};return db[_0x9534('0x28')][_0x9534('0x17')](_0x408e08)['then'](function(_0x3a2543){_0x19c03c['count']=_0x3a2543;if(_0x43bb7a[_0x9534('0x2e')]['includeAll']){_0x1c5496[_0x9534('0x3e')]=[{'all':!![]}];}return db[_0x9534('0x28')][_0x9534('0x3f')](_0x1c5496);})[_0x9534('0x1e')](function(_0x252633){_0x19c03c[_0x9534('0x40')]=_0x252633;return _0x19c03c;})[_0x9534('0x1e')](respondWithFilteredResult(_0x50aa1c,_0x1c5496))['catch'](handleError(_0x50aa1c,null));};exports['show']=function(_0x5b55de,_0x119b56){var _0xf301a2={'raw':!![],'where':{'id':_0x5b55de['params']['id']}},_0x564054={};_0x564054['model']=_[_0x9534('0x2d')](db['Interval'][_0x9534('0x29')]);_0x564054[_0x9534('0x2e')]=_[_0x9534('0x2d')](_0x5b55de[_0x9534('0x2e')]);_0x564054[_0x9534('0x38')]=_[_0x9534('0x2f')](_0x564054[_0x9534('0x2c')],_0x564054[_0x9534('0x2e')]);_0xf301a2[_0x9534('0x31')]=_['intersection'](_0x564054[_0x9534('0x2c')],qs[_0x9534('0x30')](_0x5b55de[_0x9534('0x2e')][_0x9534('0x30')]));_0xf301a2[_0x9534('0x31')]=_0xf301a2['attributes'][_0x9534('0x32')]?_0xf301a2[_0x9534('0x31')]:_0x564054[_0x9534('0x2c')];if(_0x5b55de[_0x9534('0x2e')][_0x9534('0x41')]){_0xf301a2[_0x9534('0x3e')]=[{'all':!![]}];}_0xf301a2=_[_0x9534('0x3c')]({},_0xf301a2,_0x5b55de[_0x9534('0x3d')]);return db[_0x9534('0x28')]['find'](_0xf301a2)[_0x9534('0x1e')](handleEntityNotFound(_0x119b56,null))[_0x9534('0x1e')](respondWithResult(_0x119b56,null))[_0x9534('0x42')](handleError(_0x119b56,null));};exports[_0x9534('0x43')]=function(_0x2765d2,_0x127c1d){return db[_0x9534('0x28')][_0x9534('0x43')](_0x2765d2['body'],{})[_0x9534('0x1e')](function(_0x59c782){var _0x26aff5=_0x2765d2[_0x9534('0x44')]['get']({'plain':!![]});if(!_0x26aff5)throw new Error(_0x9534('0x45'));if(_0x26aff5['role']===_0x9534('0x44')){var _0x896365=_0x59c782[_0x9534('0x1f')]({'plain':!![]});var _0x3a371c=_0x9534('0x46');return db['UserProfileSection']['find']({'where':{'name':_0x3a371c,'userProfileId':_0x26aff5[_0x9534('0x47')]},'raw':!![]})[_0x9534('0x1e')](function(_0xb09507){if(_0xb09507&&_0xb09507[_0x9534('0x48')]===0x0){return db[_0x9534('0x49')][_0x9534('0x43')]({'name':_0x896365['name'],'resourceId':_0x896365['id'],'type':_0xb09507[_0x9534('0x24')],'sectionId':_0xb09507['id']},{})[_0x9534('0x1e')](function(){return _0x59c782;});}else{return _0x59c782;}})['catch'](function(_0x20dcfd){logger[_0x9534('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20dcfd);throw _0x20dcfd;});}return _0x59c782;})['then'](respondWithResult(_0x127c1d,0xc9))[_0x9534('0x42')](handleError(_0x127c1d,null));};exports[_0x9534('0x4a')]=function(_0x1b2490,_0x3c07eb){if(_0x1b2490[_0x9534('0x4b')]['id']){delete _0x1b2490[_0x9534('0x4b')]['id'];}return db['Interval']['find']({'where':{'id':_0x1b2490['params']['id']}})[_0x9534('0x1e')](handleEntityNotFound(_0x3c07eb,null))[_0x9534('0x1e')](saveUpdates(_0x1b2490[_0x9534('0x4b')],null))[_0x9534('0x1e')](respondWithResult(_0x3c07eb,null))['catch'](handleError(_0x3c07eb,null));};exports['destroy']=function(_0x24b07a,_0x24a4c1){return db[_0x9534('0x28')][_0x9534('0x4c')]({'where':{'id':_0x24b07a[_0x9534('0x4d')]['id']}})[_0x9534('0x1e')](handleEntityNotFound(_0x24a4c1,null))[_0x9534('0x1e')](removeEntity(_0x24a4c1,null))[_0x9534('0x42')](handleError(_0x24a4c1,null));};exports[_0x9534('0x4e')]=function(_0x46a49e,_0x2db031,_0x516c72){if(_0x46a49e['body']['id']){delete _0x46a49e['body']['id'];}return db['Interval'][_0x9534('0x4c')]({'where':{'id':_0x46a49e[_0x9534('0x4d')]['id']}})[_0x9534('0x1e')](handleEntityNotFound(_0x2db031,null))[_0x9534('0x1e')](function(_0x37089c){if(_0x37089c){_0x46a49e[_0x9534('0x4b')][_0x9534('0x4f')]=_0x37089c['id'];return db['Interval'][_0x9534('0x43')](_0x46a49e[_0x9534('0x4b')]);}})['then'](respondWithResult(_0x2db031,null))[_0x9534('0x42')](handleError(_0x2db031,null));};exports[_0x9534('0x50')]=function(_0x20614f,_0x7ca3b0,_0xf4702b){var _0x2f4ce3={};var _0x645775={};var _0x5852bb;var _0x182f5f;return db['Interval']['findOne']({'where':{'id':_0x20614f[_0x9534('0x4d')]['id']}})[_0x9534('0x1e')](handleEntityNotFound(_0x7ca3b0,null))[_0x9534('0x1e')](function(_0x49ddfe){if(_0x49ddfe){_0x5852bb=_0x49ddfe;_0x645775[_0x9534('0x2c')]=_['keys'](db['Interval'][_0x9534('0x29')]);_0x645775[_0x9534('0x2e')]=_[_0x9534('0x2d')](_0x20614f[_0x9534('0x2e')]);_0x645775['filters']=_[_0x9534('0x2f')](_0x645775[_0x9534('0x2c')],_0x645775['query']);_0x2f4ce3[_0x9534('0x31')]=_['intersection'](_0x645775['model'],qs[_0x9534('0x30')](_0x20614f[_0x9534('0x2e')][_0x9534('0x30')]));_0x2f4ce3[_0x9534('0x31')]=_0x2f4ce3[_0x9534('0x31')]['length']?_0x2f4ce3[_0x9534('0x31')]:_0x645775['model'];_0x2f4ce3['order']=qs[_0x9534('0x37')](_0x20614f[_0x9534('0x2e')][_0x9534('0x37')]);_0x2f4ce3['where']=qs[_0x9534('0x38')](_['pick'](_0x20614f['query'],_0x645775[_0x9534('0x38')]));if(_0x20614f[_0x9534('0x2e')]['filter']){_0x2f4ce3[_0x9534('0x39')]=_['merge'](_0x2f4ce3['where'],{'$or':_[_0x9534('0x27')](_0x2f4ce3[_0x9534('0x31')],function(_0x3ecf82){var _0x35d8d2={};_0x35d8d2[_0x3ecf82]={'$like':'%'+_0x20614f[_0x9534('0x2e')]['filter']+'%'};return _0x35d8d2;})});}_0x2f4ce3=_[_0x9534('0x3c')]({},_0x2f4ce3,_0x20614f[_0x9534('0x3d')]);return _0x5852bb['getIntervals'](_0x2f4ce3);}})[_0x9534('0x1e')](function(_0x5ea41f){if(_0x5ea41f){_0x182f5f=_0x5ea41f['length'];if(!_0x20614f[_0x9534('0x2e')][_0x9534('0x33')]('nolimit')){_0x2f4ce3[_0x9534('0x35')]=qs[_0x9534('0x35')](_0x20614f[_0x9534('0x2e')]['limit']);_0x2f4ce3[_0x9534('0x18')]=qs['offset'](_0x20614f[_0x9534('0x2e')][_0x9534('0x18')]);}return _0x5852bb[_0x9534('0x50')](_0x2f4ce3);}})[_0x9534('0x1e')](function(_0x10a4ee){if(_0x10a4ee){return _0x10a4ee?{'count':_0x182f5f,'rows':_0x10a4ee}:null;}})[_0x9534('0x1e')](respondWithResult(_0x7ca3b0,null))[_0x9534('0x42')](handleError(_0x7ca3b0,null));};exports[_0x9534('0x51')]=function(_0x3b0af3,_0x3eb215,_0x4ab3f5){return db[_0x9534('0x28')][_0x9534('0x52')]({'where':{'id':_0x3b0af3[_0x9534('0x4d')]['id']}})[_0x9534('0x1e')](handleEntityNotFound(_0x3eb215,null))[_0x9534('0x1e')](function(_0x3397b5){if(_0x3397b5){return db[_0x9534('0x53')][_0x9534('0x54')](function(_0x13fc8b){return db[_0x9534('0x28')][_0x9534('0x20')]({'where':{'IntervalId':_0x3b0af3['params']['id']},'transaction':_0x13fc8b})[_0x9534('0x1e')](function(_0x447db1){var _0xbf115d=_['map'](_0x3b0af3[_0x9534('0x4b')],function(_0x1cd328){delete _0x1cd328['id'];_0x1cd328[_0x9534('0x4f')]=_0x3b0af3[_0x9534('0x4d')]['id'];return _0x1cd328;});return db[_0x9534('0x28')][_0x9534('0x55')](_0xbf115d,{'transaction':_0x13fc8b});});})[_0x9534('0x1e')](function(){return db[_0x9534('0x28')][_0x9534('0x3f')]({'where':{'IntervalId':_0x3b0af3[_0x9534('0x4d')]['id']}});});}})['then'](respondWithResult(_0x3eb215,null))[_0x9534('0x42')](handleError(_0x3eb215,null));};
\ No newline at end of file
+var _0x8861=['update','then','destroy','get','Intervals','end','stack','name','send','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','addInterval','IntervalId','getIntervals','filter','addIntervals','sequelize','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','limit','Content-Range','apply','reject'];(function(_0x53de7d,_0x44bc03){var _0x45721e=function(_0x4f5831){while(--_0x4f5831){_0x53de7d['push'](_0x53de7d['shift']());}};_0x45721e(++_0x44bc03);}(_0x8861,0x1eb));var _0x1886=function(_0x34f645,_0x3a894c){_0x34f645=_0x34f645-0x0;var _0x47ca5d=_0x8861[_0x34f645];return _0x47ca5d;};'use strict';var pdf=require(_0x1886('0x0'));var emlformat=require(_0x1886('0x1'));var rimraf=require(_0x1886('0x2'));var zipdir=require(_0x1886('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1886('0x4'));var moment=require(_0x1886('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1886('0x6'));var util=require(_0x1886('0x7'));var path=require('path');var sox=require(_0x1886('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1886('0x9'));var squel=require(_0x1886('0xa'));var crypto=require(_0x1886('0xb'));var jsforce=require(_0x1886('0xc'));var deskjs=require(_0x1886('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1886('0xe'));var Papa=require(_0x1886('0xf'));var Redis=require(_0x1886('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1886('0x11'));var as=require(_0x1886('0x12'));var hardwareService=require(_0x1886('0x13'));var logger=require(_0x1886('0x14'))(_0x1886('0x15'));var utils=require(_0x1886('0x16'));var config=require('../../config/environment');var db=require(_0x1886('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4d21df,_0x3efc61){_0x3efc61=_0x3efc61||0xcc;return function(_0x387a6d){if(_0x387a6d){return _0x4d21df['sendStatus'](_0x3efc61);}return _0x4d21df[_0x1886('0x18')](_0x3efc61)['end']();};}function respondWithResult(_0x3aec65,_0x129ef7){_0x129ef7=_0x129ef7||0xc8;return function(_0x290294){if(_0x290294){return _0x3aec65[_0x1886('0x18')](_0x129ef7)[_0x1886('0x19')](_0x290294);}};}function respondWithFilteredResult(_0xad17e7,_0x52c034){return function(_0x3c22f0){if(_0x3c22f0){var _0x305f8c=_0x3c22f0[_0x1886('0x1a')],_0xae3e0a=_0x52c034['offset'],_0x18b23a=_0x52c034['offset']+_0x52c034[_0x1886('0x1b')],_0x44faf7;if(_0x18b23a>=_0x305f8c){_0x18b23a=_0x305f8c;_0x44faf7=0xc8;}else{_0x44faf7=0xce;}_0xad17e7[_0x1886('0x18')](_0x44faf7);return _0xad17e7['set'](_0x1886('0x1c'),_0xae3e0a+'-'+_0x18b23a+'/'+_0x305f8c)[_0x1886('0x19')](_0x3c22f0);}return null;};}function patchUpdates(_0x2ec2b8){return function(_0x232d70){try{jsonpatch[_0x1886('0x1d')](_0x232d70,_0x2ec2b8,!![]);}catch(_0x42f184){return BPromise[_0x1886('0x1e')](_0x42f184);}return _0x232d70['save']();};}function saveUpdates(_0x1973b9,_0x32b704){return function(_0x2bec5b){if(_0x2bec5b){return _0x2bec5b[_0x1886('0x1f')](_0x1973b9)[_0x1886('0x20')](function(_0x193240){return _0x193240;});}return null;};}function removeEntity(_0x2c9194,_0x40d752){return function(_0x1d6c4c){if(_0x1d6c4c){return _0x1d6c4c[_0x1886('0x21')]()[_0x1886('0x20')](function(){var _0x230bb3=_0x1d6c4c[_0x1886('0x22')]({'plain':!![]});var _0x3b5aa2=_0x1886('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b5aa2,'resourceId':_0x230bb3['id']}})[_0x1886('0x20')](function(){return _0x1d6c4c;});})[_0x1886('0x20')](function(){_0x2c9194[_0x1886('0x18')](0xcc)[_0x1886('0x24')]();});}};}function handleEntityNotFound(_0x5bd4e6,_0x13775c){return function(_0x14cca7){if(!_0x14cca7){_0x5bd4e6['sendStatus'](0x194);}return _0x14cca7;};}function handleError(_0x169734,_0x4a1a38){_0x4a1a38=_0x4a1a38||0x1f4;return function(_0x4cf779){logger['error'](_0x4cf779[_0x1886('0x25')]);if(_0x4cf779[_0x1886('0x26')]){delete _0x4cf779[_0x1886('0x26')];}_0x169734[_0x1886('0x18')](_0x4a1a38)[_0x1886('0x27')](_0x4cf779);};}exports['index']=function(_0x771775,_0x4f02d9){var _0x583ebd={},_0x156fea={},_0x23bbd8={'count':0x0,'rows':[]};var _0x6f4c38=_[_0x1886('0x28')](db[_0x1886('0x29')][_0x1886('0x2a')],function(_0x25ab4b){return{'name':_0x25ab4b[_0x1886('0x2b')],'type':_0x25ab4b[_0x1886('0x2c')][_0x1886('0x2d')]};});_0x156fea[_0x1886('0x2e')]=_['map'](_0x6f4c38,_0x1886('0x26'));_0x156fea[_0x1886('0x2f')]=_[_0x1886('0x30')](_0x771775['query']);_0x156fea['filters']=_[_0x1886('0x31')](_0x156fea[_0x1886('0x2e')],_0x156fea[_0x1886('0x2f')]);_0x583ebd[_0x1886('0x32')]=_[_0x1886('0x31')](_0x156fea[_0x1886('0x2e')],qs[_0x1886('0x33')](_0x771775[_0x1886('0x2f')][_0x1886('0x33')]));_0x583ebd['attributes']=_0x583ebd[_0x1886('0x32')]['length']?_0x583ebd[_0x1886('0x32')]:_0x156fea[_0x1886('0x2e')];if(!_0x771775['query'][_0x1886('0x34')](_0x1886('0x35'))){_0x583ebd[_0x1886('0x1b')]=qs[_0x1886('0x1b')](_0x771775[_0x1886('0x2f')][_0x1886('0x1b')]);_0x583ebd[_0x1886('0x36')]=qs[_0x1886('0x36')](_0x771775['query'][_0x1886('0x36')]);}_0x583ebd[_0x1886('0x37')]=qs[_0x1886('0x38')](_0x771775[_0x1886('0x2f')][_0x1886('0x38')]);_0x583ebd['where']=qs[_0x1886('0x39')](_[_0x1886('0x3a')](_0x771775['query'],_0x156fea[_0x1886('0x39')]),_0x6f4c38);if(_0x771775[_0x1886('0x2f')]['filter']){_0x583ebd[_0x1886('0x3b')]=_[_0x1886('0x3c')](_0x583ebd[_0x1886('0x3b')],{'$or':_['map'](_0x6f4c38,function(_0x67f20){if(_0x67f20[_0x1886('0x2c')]!==_0x1886('0x3d')){var _0x356f6f={};_0x356f6f[_0x67f20[_0x1886('0x26')]]={'$like':'%'+_0x771775['query']['filter']+'%'};return _0x356f6f;}})});}_0x583ebd=_[_0x1886('0x3c')]({},_0x583ebd,_0x771775[_0x1886('0x3e')]);var _0x2f7de3={'where':_0x583ebd['where']};return db[_0x1886('0x29')][_0x1886('0x1a')](_0x2f7de3)['then'](function(_0x31f3b3){_0x23bbd8['count']=_0x31f3b3;if(_0x771775[_0x1886('0x2f')][_0x1886('0x3f')]){_0x583ebd['include']=[{'all':!![]}];}return db[_0x1886('0x29')][_0x1886('0x40')](_0x583ebd);})['then'](function(_0x53a8fe){_0x23bbd8[_0x1886('0x41')]=_0x53a8fe;return _0x23bbd8;})[_0x1886('0x20')](respondWithFilteredResult(_0x4f02d9,_0x583ebd))[_0x1886('0x42')](handleError(_0x4f02d9,null));};exports[_0x1886('0x43')]=function(_0x5c0680,_0x1ed4fe){var _0x4e29ce={'raw':!![],'where':{'id':_0x5c0680[_0x1886('0x44')]['id']}},_0x3a22f1={};_0x3a22f1[_0x1886('0x2e')]=_['keys'](db[_0x1886('0x29')]['rawAttributes']);_0x3a22f1[_0x1886('0x2f')]=_[_0x1886('0x30')](_0x5c0680[_0x1886('0x2f')]);_0x3a22f1[_0x1886('0x39')]=_[_0x1886('0x31')](_0x3a22f1[_0x1886('0x2e')],_0x3a22f1[_0x1886('0x2f')]);_0x4e29ce[_0x1886('0x32')]=_[_0x1886('0x31')](_0x3a22f1[_0x1886('0x2e')],qs[_0x1886('0x33')](_0x5c0680[_0x1886('0x2f')]['fields']));_0x4e29ce['attributes']=_0x4e29ce['attributes']['length']?_0x4e29ce['attributes']:_0x3a22f1[_0x1886('0x2e')];if(_0x5c0680[_0x1886('0x2f')]['includeAll']){_0x4e29ce[_0x1886('0x45')]=[{'all':!![]}];}_0x4e29ce=_['merge']({},_0x4e29ce,_0x5c0680['options']);return db[_0x1886('0x29')][_0x1886('0x46')](_0x4e29ce)[_0x1886('0x20')](handleEntityNotFound(_0x1ed4fe,null))[_0x1886('0x20')](respondWithResult(_0x1ed4fe,null))[_0x1886('0x42')](handleError(_0x1ed4fe,null));};exports[_0x1886('0x47')]=function(_0x4afb47,_0x1ae414){return db['Interval'][_0x1886('0x47')](_0x4afb47[_0x1886('0x48')],{})['then'](function(_0x12dcab){var _0x55f7ae=_0x4afb47[_0x1886('0x49')][_0x1886('0x22')]({'plain':!![]});if(!_0x55f7ae)throw new Error(_0x1886('0x4a'));if(_0x55f7ae[_0x1886('0x4b')]===_0x1886('0x49')){var _0x2ad629=_0x12dcab[_0x1886('0x22')]({'plain':!![]});var _0x30ea9f='Intervals';return db[_0x1886('0x4c')][_0x1886('0x46')]({'where':{'name':_0x30ea9f,'userProfileId':_0x55f7ae[_0x1886('0x4d')]},'raw':!![]})[_0x1886('0x20')](function(_0x5ac120){if(_0x5ac120&&_0x5ac120[_0x1886('0x4e')]===0x0){return db[_0x1886('0x4f')]['create']({'name':_0x2ad629[_0x1886('0x26')],'resourceId':_0x2ad629['id'],'type':_0x5ac120[_0x1886('0x26')],'sectionId':_0x5ac120['id']},{})[_0x1886('0x20')](function(){return _0x12dcab;});}else{return _0x12dcab;}})[_0x1886('0x42')](function(_0x303e03){logger[_0x1886('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x303e03);throw _0x303e03;});}return _0x12dcab;})['then'](respondWithResult(_0x1ae414,0xc9))[_0x1886('0x42')](handleError(_0x1ae414,null));};exports[_0x1886('0x1f')]=function(_0x3e94dd,_0x18c934){if(_0x3e94dd[_0x1886('0x48')]['id']){delete _0x3e94dd['body']['id'];}return db['Interval'][_0x1886('0x46')]({'where':{'id':_0x3e94dd[_0x1886('0x44')]['id']}})[_0x1886('0x20')](handleEntityNotFound(_0x18c934,null))[_0x1886('0x20')](saveUpdates(_0x3e94dd[_0x1886('0x48')],null))[_0x1886('0x20')](respondWithResult(_0x18c934,null))['catch'](handleError(_0x18c934,null));};exports[_0x1886('0x21')]=function(_0x3281f8,_0x19a6db){return db[_0x1886('0x29')]['find']({'where':{'id':_0x3281f8[_0x1886('0x44')]['id']}})[_0x1886('0x20')](handleEntityNotFound(_0x19a6db,null))[_0x1886('0x20')](removeEntity(_0x19a6db,null))[_0x1886('0x42')](handleError(_0x19a6db,null));};exports[_0x1886('0x51')]=function(_0x280c17,_0x19d88b,_0x3905d5){if(_0x280c17[_0x1886('0x48')]['id']){delete _0x280c17[_0x1886('0x48')]['id'];}return db[_0x1886('0x29')][_0x1886('0x46')]({'where':{'id':_0x280c17[_0x1886('0x44')]['id']}})[_0x1886('0x20')](handleEntityNotFound(_0x19d88b,null))[_0x1886('0x20')](function(_0x30709d){if(_0x30709d){_0x280c17[_0x1886('0x48')][_0x1886('0x52')]=_0x30709d['id'];return db[_0x1886('0x29')][_0x1886('0x47')](_0x280c17[_0x1886('0x48')]);}})[_0x1886('0x20')](respondWithResult(_0x19d88b,null))[_0x1886('0x42')](handleError(_0x19d88b,null));};exports[_0x1886('0x53')]=function(_0x15f34b,_0x3441a0,_0x51e03f){var _0x2c12b9={};var _0x42e24d={};var _0x492e92;var _0x32c240;return db[_0x1886('0x29')]['findOne']({'where':{'id':_0x15f34b[_0x1886('0x44')]['id']}})['then'](handleEntityNotFound(_0x3441a0,null))[_0x1886('0x20')](function(_0xb23cd4){if(_0xb23cd4){_0x492e92=_0xb23cd4;_0x42e24d['model']=_[_0x1886('0x30')](db[_0x1886('0x29')][_0x1886('0x2a')]);_0x42e24d[_0x1886('0x2f')]=_[_0x1886('0x30')](_0x15f34b[_0x1886('0x2f')]);_0x42e24d[_0x1886('0x39')]=_[_0x1886('0x31')](_0x42e24d['model'],_0x42e24d[_0x1886('0x2f')]);_0x2c12b9[_0x1886('0x32')]=_['intersection'](_0x42e24d[_0x1886('0x2e')],qs[_0x1886('0x33')](_0x15f34b[_0x1886('0x2f')][_0x1886('0x33')]));_0x2c12b9[_0x1886('0x32')]=_0x2c12b9[_0x1886('0x32')]['length']?_0x2c12b9[_0x1886('0x32')]:_0x42e24d['model'];_0x2c12b9[_0x1886('0x37')]=qs[_0x1886('0x38')](_0x15f34b[_0x1886('0x2f')][_0x1886('0x38')]);_0x2c12b9[_0x1886('0x3b')]=qs[_0x1886('0x39')](_[_0x1886('0x3a')](_0x15f34b['query'],_0x42e24d['filters']));if(_0x15f34b[_0x1886('0x2f')][_0x1886('0x54')]){_0x2c12b9[_0x1886('0x3b')]=_[_0x1886('0x3c')](_0x2c12b9[_0x1886('0x3b')],{'$or':_['map'](_0x2c12b9[_0x1886('0x32')],function(_0x1ef01f){var _0x3d8247={};_0x3d8247[_0x1ef01f]={'$like':'%'+_0x15f34b[_0x1886('0x2f')][_0x1886('0x54')]+'%'};return _0x3d8247;})});}_0x2c12b9=_[_0x1886('0x3c')]({},_0x2c12b9,_0x15f34b[_0x1886('0x3e')]);return _0x492e92[_0x1886('0x53')](_0x2c12b9);}})[_0x1886('0x20')](function(_0x2e2a0a){if(_0x2e2a0a){_0x32c240=_0x2e2a0a['length'];if(!_0x15f34b[_0x1886('0x2f')]['hasOwnProperty'](_0x1886('0x35'))){_0x2c12b9[_0x1886('0x1b')]=qs[_0x1886('0x1b')](_0x15f34b[_0x1886('0x2f')]['limit']);_0x2c12b9[_0x1886('0x36')]=qs[_0x1886('0x36')](_0x15f34b[_0x1886('0x2f')][_0x1886('0x36')]);}return _0x492e92[_0x1886('0x53')](_0x2c12b9);}})[_0x1886('0x20')](function(_0x3f73cc){if(_0x3f73cc){return _0x3f73cc?{'count':_0x32c240,'rows':_0x3f73cc}:null;}})['then'](respondWithResult(_0x3441a0,null))[_0x1886('0x42')](handleError(_0x3441a0,null));};exports[_0x1886('0x55')]=function(_0x49f06a,_0x4e0b01,_0xea4ae7){return db[_0x1886('0x29')]['findOne']({'where':{'id':_0x49f06a[_0x1886('0x44')]['id']}})[_0x1886('0x20')](handleEntityNotFound(_0x4e0b01,null))[_0x1886('0x20')](function(_0x4b37cc){if(_0x4b37cc){return db[_0x1886('0x56')]['transaction'](function(_0x5430d1){return db['Interval'][_0x1886('0x21')]({'where':{'IntervalId':_0x49f06a['params']['id']},'transaction':_0x5430d1})['then'](function(_0x1ab03d){var _0x20cbd1=_[_0x1886('0x28')](_0x49f06a[_0x1886('0x48')],function(_0x108b30){delete _0x108b30['id'];_0x108b30[_0x1886('0x52')]=_0x49f06a[_0x1886('0x44')]['id'];return _0x108b30;});return db[_0x1886('0x29')]['bulkCreate'](_0x20cbd1,{'transaction':_0x5430d1});});})[_0x1886('0x20')](function(){return db[_0x1886('0x29')][_0x1886('0x40')]({'where':{'IntervalId':_0x49f06a[_0x1886('0x44')]['id']}});});}})[_0x1886('0x20')](respondWithResult(_0x4e0b01,null))[_0x1886('0x42')](handleError(_0x4e0b01,null));};
\ No newline at end of file
diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js
index e6f11d3..b134663 100644
--- a/server/api/interval/interval.model.js
+++ b/server/api/interval/interval.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d4a=['path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x340fb6,_0x47f6cc){var _0x6b8f9=function(_0x44f2e2){while(--_0x44f2e2){_0x340fb6['push'](_0x340fb6['shift']());}};_0x6b8f9(++_0x47f6cc);}(_0x6d4a,0x117));var _0xa6d4=function(_0x5ee02d,_0x56fc77){_0x5ee02d=_0x5ee02d-0x0;var _0x321430=_0x6d4a[_0x5ee02d];return _0x321430;};'use strict';var _=require(_0xa6d4('0x0'));var util=require('util');var logger=require(_0xa6d4('0x1'))(_0xa6d4('0x2'));var moment=require(_0xa6d4('0x3'));var BPromise=require(_0xa6d4('0x4'));var rp=require(_0xa6d4('0x5'));var fs=require('fs');var path=require(_0xa6d4('0x6'));var rimraf=require(_0xa6d4('0x7'));var config=require(_0xa6d4('0x8'));var attributes=require(_0xa6d4('0x9'));var extensions=require(_0xa6d4('0xa'));module[_0xa6d4('0xb')]=function(_0xe6dda6,_0x354148){return _0xe6dda6[_0xa6d4('0xc')]('Interval',attributes,{'tableName':_0xa6d4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xc6d920,_0x52739a){extensions[_0xa6d4('0xe')](_0xe6dda6,_0xc6d920);},'afterBulkCreate':function(_0x36af3a,_0x2bea15,_0xb76050){_0xb76050();extensions[_0xa6d4('0xe')](_0xe6dda6,_0x36af3a[0x0]);},'afterUpdate':function(_0x54edec,_0x340d84){extensions[_0xa6d4('0xe')](_0xe6dda6,_0x54edec);},'afterDestroy':function(_0x58d06f,_0x2c7f14){extensions[_0xa6d4('0xe')](_0xe6dda6,_0x58d06f);}}});};
\ No newline at end of file
+var _0xf9bb=['moment','bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','rewrite','lodash','util','../../config/logger'];(function(_0xd0802,_0x3e6189){var _0x5d5289=function(_0x1a4383){while(--_0x1a4383){_0xd0802['push'](_0xd0802['shift']());}};_0x5d5289(++_0x3e6189);}(_0xf9bb,0x14d));var _0xbf9b=function(_0x5bf4fa,_0xc0399f){_0x5bf4fa=_0x5bf4fa-0x0;var _0x519465=_0xf9bb[_0x5bf4fa];return _0x519465;};'use strict';var _=require(_0xbf9b('0x0'));var util=require(_0xbf9b('0x1'));var logger=require(_0xbf9b('0x2'))('api');var moment=require(_0xbf9b('0x3'));var BPromise=require(_0xbf9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf9b('0x5'));var config=require(_0xbf9b('0x6'));var attributes=require(_0xbf9b('0x7'));var extensions=require(_0xbf9b('0x8'));module[_0xbf9b('0x9')]=function(_0x7fa5a,_0x52e0ef){return _0x7fa5a['define'](_0xbf9b('0xa'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x17c197,_0x3367e3){extensions[_0xbf9b('0xb')](_0x7fa5a,_0x17c197);},'afterBulkCreate':function(_0xf3c89c,_0x42ec70,_0x1437cd){_0x1437cd();extensions[_0xbf9b('0xb')](_0x7fa5a,_0xf3c89c[0x0]);},'afterUpdate':function(_0x4ae03b,_0x449ce9){extensions[_0xbf9b('0xb')](_0x7fa5a,_0x4ae03b);},'afterDestroy':function(_0x450e29,_0xaa9158){extensions[_0xbf9b('0xb')](_0x7fa5a,_0x450e29);}}});};
\ No newline at end of file
diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js
index 9cc84f1..c2aa0f7 100644
--- a/server/api/interval/interval.rpc.js
+++ b/server/api/interval/interval.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2114=['error','message','catch','GetInterval','Interval','findAll','options','where','limit','include','map','attributes','model','find','raw','ShowInterval','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x315b61,_0x4bb11e){var _0x3521e8=function(_0x5e6389){while(--_0x5e6389){_0x315b61['push'](_0x315b61['shift']());}};_0x3521e8(++_0x4bb11e);}(_0x2114,0x191));var _0x4211=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0x2114[_0x2a18b7];return _0x45e74e;};'use strict';var _=require('lodash');var util=require(_0x4211('0x0'));var moment=require(_0x4211('0x1'));var BPromise=require('bluebird');var rs=require(_0x4211('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4211('0x3'))['db'];var utils=require(_0x4211('0x4'));var logger=require(_0x4211('0x5'))(_0x4211('0x6'));var config=require(_0x4211('0x7'));var jayson=require(_0x4211('0x8'));var client=jayson[_0x4211('0x9')][_0x4211('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x326e5a,_0x20a343,_0x10ce34){return new BPromise(function(_0x46ca18,_0x3c84a4){return client[_0x4211('0xb')](_0x326e5a,_0x10ce34)[_0x4211('0xc')](function(_0x308b60){logger[_0x4211('0xd')](_0x4211('0xe'),_0x20a343,_0x4211('0xf'));logger[_0x4211('0x10')](_0x4211('0x11'),_0x20a343,_0x4211('0xf'),JSON[_0x4211('0x12')](_0x308b60));if(_0x308b60[_0x4211('0x13')]){if(_0x308b60[_0x4211('0x13')]['code']===0x1f4){logger['error']('Interval,\x20%s,\x20%s',_0x20a343,_0x308b60['error']['message']);return _0x3c84a4(_0x308b60[_0x4211('0x13')][_0x4211('0x14')]);}logger[_0x4211('0x13')](_0x4211('0xe'),_0x20a343,_0x308b60[_0x4211('0x13')][_0x4211('0x14')]);return _0x46ca18(_0x308b60[_0x4211('0x13')][_0x4211('0x14')]);}else{logger[_0x4211('0xd')]('Interval,\x20%s,\x20%s',_0x20a343,'request\x20sent');_0x46ca18(_0x308b60['result'][_0x4211('0x14')]);}})[_0x4211('0x15')](function(_0x1800e6){logger[_0x4211('0x13')]('Interval,\x20%s,\x20%s',_0x20a343,_0x1800e6);_0x3c84a4(_0x1800e6);});});}exports[_0x4211('0x16')]=function(_0x2e48c1){var _0x4ebc1d=this;return new Promise(function(_0x3470b0,_0x56eb44){return db[_0x4211('0x17')][_0x4211('0x18')]({'raw':_0x2e48c1[_0x4211('0x19')]?_0x2e48c1[_0x4211('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2e48c1[_0x4211('0x19')]?_0x2e48c1[_0x4211('0x19')][_0x4211('0x1a')]||null:null,'attributes':_0x2e48c1['options']?_0x2e48c1[_0x4211('0x19')]['attributes']||null:null,'limit':_0x2e48c1['options']?_0x2e48c1['options'][_0x4211('0x1b')]||null:null,'include':_0x2e48c1[_0x4211('0x19')]?_0x2e48c1[_0x4211('0x19')][_0x4211('0x1c')]?_[_0x4211('0x1d')](_0x2e48c1['options'][_0x4211('0x1c')],function(_0x3a8420){return{'model':db[_0x3a8420['model']],'as':_0x3a8420['as'],'attributes':_0x3a8420['attributes'],'include':_0x3a8420[_0x4211('0x1c')]?_[_0x4211('0x1d')](_0x3a8420[_0x4211('0x1c')],function(_0x567732){return{'model':db[_0x567732['model']],'as':_0x567732['as'],'attributes':_0x567732[_0x4211('0x1e')],'include':_0x567732[_0x4211('0x1c')]?_[_0x4211('0x1d')](_0x567732[_0x4211('0x1c')],function(_0x2eb403){return{'model':db[_0x2eb403[_0x4211('0x1f')]],'as':_0x2eb403['as'],'attributes':_0x2eb403[_0x4211('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4211('0xc')](function(_0x3e099a){logger[_0x4211('0xd')](_0x4211('0x16'),_0x2e48c1);logger[_0x4211('0x10')]('GetInterval',_0x2e48c1,JSON['stringify'](_0x3e099a));_0x3470b0(_0x3e099a);})[_0x4211('0x15')](function(_0x29b19e){logger[_0x4211('0x13')](_0x4211('0x16'),_0x29b19e[_0x4211('0x14')],_0x2e48c1);_0x56eb44(_0x4ebc1d['error'](0x1f4,_0x29b19e['message']));});});};exports['ShowInterval']=function(_0x433426){var _0x29ce01=this;return new Promise(function(_0x4b5ef2,_0xeb6970){return db['Interval'][_0x4211('0x20')]({'raw':_0x433426['options']?_0x433426[_0x4211('0x19')][_0x4211('0x21')]===undefined?!![]:![]:!![],'where':_0x433426[_0x4211('0x19')]?_0x433426[_0x4211('0x19')][_0x4211('0x1a')]||null:null,'attributes':_0x433426[_0x4211('0x19')]?_0x433426['options']['attributes']||null:null,'include':_0x433426[_0x4211('0x19')]?_0x433426[_0x4211('0x19')][_0x4211('0x1c')]?_['map'](_0x433426[_0x4211('0x19')][_0x4211('0x1c')],function(_0x578b79){return{'model':db[_0x578b79[_0x4211('0x1f')]],'as':_0x578b79['as'],'attributes':_0x578b79['attributes'],'include':_0x578b79[_0x4211('0x1c')]?_[_0x4211('0x1d')](_0x578b79['include'],function(_0x173da8){return{'model':db[_0x173da8[_0x4211('0x1f')]],'as':_0x173da8['as'],'attributes':_0x173da8[_0x4211('0x1e')],'include':_0x173da8['include']?_[_0x4211('0x1d')](_0x173da8[_0x4211('0x1c')],function(_0x150106){return{'model':db[_0x150106[_0x4211('0x1f')]],'as':_0x150106['as'],'attributes':_0x150106[_0x4211('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4211('0xc')](function(_0x2ad215){logger['info'](_0x4211('0x22'),_0x433426);logger[_0x4211('0x10')](_0x4211('0x22'),_0x433426,JSON[_0x4211('0x12')](_0x2ad215));_0x4b5ef2(_0x2ad215);})[_0x4211('0x15')](function(_0x3e590d){logger[_0x4211('0x13')](_0x4211('0x22'),_0x3e590d[_0x4211('0x14')],_0x433426);_0xeb6970(_0x29ce01['error'](0x1f4,_0x3e590d[_0x4211('0x14')]));});});};
\ No newline at end of file
+var _0xda3f=['raw','where','attributes','limit','include','map','model','ShowInterval','Interval','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','debug','Interval,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetInterval','findAll','options'];(function(_0x2191c6,_0x367416){var _0x29a129=function(_0x2e9281){while(--_0x2e9281){_0x2191c6['push'](_0x2191c6['shift']());}};_0x29a129(++_0x367416);}(_0xda3f,0x132));var _0xfda3=function(_0xdbce83,_0x26f55b){_0xdbce83=_0xdbce83-0x0;var _0x824b5c=_0xda3f[_0xdbce83];return _0x824b5c;};'use strict';var _=require(_0xfda3('0x0'));var util=require(_0xfda3('0x1'));var moment=require(_0xfda3('0x2'));var BPromise=require('bluebird');var rs=require(_0xfda3('0x3'));var fs=require('fs');var Redis=require(_0xfda3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfda3('0x5'));var logger=require(_0xfda3('0x6'))(_0xfda3('0x7'));var config=require(_0xfda3('0x8'));var jayson=require(_0xfda3('0x9'));var client=jayson[_0xfda3('0xa')][_0xfda3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cffdb,_0x4779b6,_0x46ffcb){return new BPromise(function(_0xe9f69e,_0x505fcb){return client[_0xfda3('0xc')](_0x4cffdb,_0x46ffcb)[_0xfda3('0xd')](function(_0xb79165){logger[_0xfda3('0xe')](_0xfda3('0xf'),_0x4779b6,'request\x20sent');logger[_0xfda3('0x10')](_0xfda3('0x11'),_0x4779b6,_0xfda3('0x12'),JSON[_0xfda3('0x13')](_0xb79165));if(_0xb79165[_0xfda3('0x14')]){if(_0xb79165[_0xfda3('0x14')][_0xfda3('0x15')]===0x1f4){logger[_0xfda3('0x14')](_0xfda3('0xf'),_0x4779b6,_0xb79165[_0xfda3('0x14')][_0xfda3('0x16')]);return _0x505fcb(_0xb79165[_0xfda3('0x14')]['message']);}logger['error'](_0xfda3('0xf'),_0x4779b6,_0xb79165[_0xfda3('0x14')][_0xfda3('0x16')]);return _0xe9f69e(_0xb79165[_0xfda3('0x14')][_0xfda3('0x16')]);}else{logger[_0xfda3('0xe')]('Interval,\x20%s,\x20%s',_0x4779b6,_0xfda3('0x12'));_0xe9f69e(_0xb79165['result'][_0xfda3('0x16')]);}})[_0xfda3('0x17')](function(_0x286fc4){logger['error']('Interval,\x20%s,\x20%s',_0x4779b6,_0x286fc4);_0x505fcb(_0x286fc4);});});}exports[_0xfda3('0x18')]=function(_0x4bdf2b){var _0xefc748=this;return new Promise(function(_0x31e2e5,_0x42bc5d){return db['Interval'][_0xfda3('0x19')]({'raw':_0x4bdf2b[_0xfda3('0x1a')]?_0x4bdf2b['options'][_0xfda3('0x1b')]===undefined?!![]:![]:!![],'where':_0x4bdf2b[_0xfda3('0x1a')]?_0x4bdf2b[_0xfda3('0x1a')][_0xfda3('0x1c')]||null:null,'attributes':_0x4bdf2b[_0xfda3('0x1a')]?_0x4bdf2b[_0xfda3('0x1a')][_0xfda3('0x1d')]||null:null,'limit':_0x4bdf2b[_0xfda3('0x1a')]?_0x4bdf2b['options'][_0xfda3('0x1e')]||null:null,'include':_0x4bdf2b[_0xfda3('0x1a')]?_0x4bdf2b['options'][_0xfda3('0x1f')]?_[_0xfda3('0x20')](_0x4bdf2b['options'][_0xfda3('0x1f')],function(_0x10327f){return{'model':db[_0x10327f['model']],'as':_0x10327f['as'],'attributes':_0x10327f[_0xfda3('0x1d')],'include':_0x10327f[_0xfda3('0x1f')]?_[_0xfda3('0x20')](_0x10327f[_0xfda3('0x1f')],function(_0x28453c){return{'model':db[_0x28453c['model']],'as':_0x28453c['as'],'attributes':_0x28453c[_0xfda3('0x1d')],'include':_0x28453c[_0xfda3('0x1f')]?_[_0xfda3('0x20')](_0x28453c['include'],function(_0x3e9cf2){return{'model':db[_0x3e9cf2[_0xfda3('0x21')]],'as':_0x3e9cf2['as'],'attributes':_0x3e9cf2[_0xfda3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0xd')](function(_0x47765f){logger['info'](_0xfda3('0x18'),_0x4bdf2b);logger['debug'](_0xfda3('0x18'),_0x4bdf2b,JSON['stringify'](_0x47765f));_0x31e2e5(_0x47765f);})[_0xfda3('0x17')](function(_0x165c5f){logger[_0xfda3('0x14')](_0xfda3('0x18'),_0x165c5f[_0xfda3('0x16')],_0x4bdf2b);_0x42bc5d(_0xefc748[_0xfda3('0x14')](0x1f4,_0x165c5f[_0xfda3('0x16')]));});});};exports[_0xfda3('0x22')]=function(_0x39f429){var _0x1c39aa=this;return new Promise(function(_0x28e004,_0x56ddad){return db[_0xfda3('0x23')][_0xfda3('0x24')]({'raw':_0x39f429[_0xfda3('0x1a')]?_0x39f429[_0xfda3('0x1a')][_0xfda3('0x1b')]===undefined?!![]:![]:!![],'where':_0x39f429[_0xfda3('0x1a')]?_0x39f429[_0xfda3('0x1a')][_0xfda3('0x1c')]||null:null,'attributes':_0x39f429[_0xfda3('0x1a')]?_0x39f429[_0xfda3('0x1a')][_0xfda3('0x1d')]||null:null,'include':_0x39f429[_0xfda3('0x1a')]?_0x39f429['options'][_0xfda3('0x1f')]?_[_0xfda3('0x20')](_0x39f429[_0xfda3('0x1a')][_0xfda3('0x1f')],function(_0x486f07){return{'model':db[_0x486f07[_0xfda3('0x21')]],'as':_0x486f07['as'],'attributes':_0x486f07['attributes'],'include':_0x486f07[_0xfda3('0x1f')]?_[_0xfda3('0x20')](_0x486f07['include'],function(_0x1d9184){return{'model':db[_0x1d9184[_0xfda3('0x21')]],'as':_0x1d9184['as'],'attributes':_0x1d9184[_0xfda3('0x1d')],'include':_0x1d9184[_0xfda3('0x1f')]?_[_0xfda3('0x20')](_0x1d9184['include'],function(_0x587e5c){return{'model':db[_0x587e5c[_0xfda3('0x21')]],'as':_0x587e5c['as'],'attributes':_0x587e5c[_0xfda3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0xd')](function(_0x20dbfe){logger['info']('ShowInterval',_0x39f429);logger[_0xfda3('0x10')](_0xfda3('0x22'),_0x39f429,JSON[_0xfda3('0x13')](_0x20dbfe));_0x28e004(_0x20dbfe);})['catch'](function(_0x287475){logger['error'](_0xfda3('0x22'),_0x287475['message'],_0x39f429);_0x56ddad(_0x1c39aa['error'](0x1f4,_0x287475['message']));});});};
\ No newline at end of file
diff --git a/server/api/jira/index.js b/server/api/jira/index.js
index c0571ab..700e97d 100644
--- a/server/api/jira/index.js
+++ b/server/api/jira/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb5dc=['send','exports','express','Router','./jira.controller','post','isAuthenticated'];(function(_0x4e3e84,_0x2462dc){var _0x1b8acf=function(_0x239b12){while(--_0x239b12){_0x4e3e84['push'](_0x4e3e84['shift']());}};_0x1b8acf(++_0x2462dc);}(_0xb5dc,0x1c2));var _0xcb5d=function(_0x3b6d96,_0x5d3241){_0x3b6d96=_0x3b6d96-0x0;var _0x1e6b1c=_0xb5dc[_0x3b6d96];return _0x1e6b1c;};'use strict';var express=require(_0xcb5d('0x0'));var router=express[_0xcb5d('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xcb5d('0x2'));router[_0xcb5d('0x3')]('/',auth[_0xcb5d('0x4')](),controller[_0xcb5d('0x5')]);module[_0xcb5d('0x6')]=router;
\ No newline at end of file
+var _0x56c0=['Router','./jira.controller','post','isAuthenticated','send','exports'];(function(_0x1cdb42,_0x29b269){var _0x398978=function(_0x5d1db4){while(--_0x5d1db4){_0x1cdb42['push'](_0x1cdb42['shift']());}};_0x398978(++_0x29b269);}(_0x56c0,0x174));var _0x056c=function(_0x5d1b11,_0x48c8c6){_0x5d1b11=_0x5d1b11-0x0;var _0x1ad2b5=_0x56c0[_0x5d1b11];return _0x1ad2b5;};'use strict';var express=require('express');var router=express[_0x056c('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x056c('0x1'));router[_0x056c('0x2')]('/',auth[_0x056c('0x3')](),controller[_0x056c('0x4')]);module[_0x056c('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js
index e7bec39..1a9d8b4 100644
--- a/server/api/jira/jira.controller.js
+++ b/server/api/jira/jira.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e3c=['status','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','headers','x-forwarded-for','connection','socket','remoteAddress','body','bluebird','https','../../config/logger','api','support','key','MOTGUI','summary','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','utf8','data','end'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4e3c,0x98));var _0xc4e3=function(_0x34986b,_0x56fb4a){_0x34986b=_0x34986b-0x0;var _0x28a0d1=_0x4e3c[_0x34986b];return _0x28a0d1;};'use strict';var BPromise=require(_0xc4e3('0x0'));var https=require(_0xc4e3('0x1'));var logger=require(_0xc4e3('0x2'))(_0xc4e3('0x3'));var USERNAME=_0xc4e3('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0xa65497,_0x30aa1c){var _0x21cc06={'fields':{'project':{'key':_0xa65497[_0xc4e3('0x5')]||_0xc4e3('0x6')},'summary':(_0xa65497[_0xc4e3('0x7')]||'Report')+_0xc4e3('0x8')+_0xa65497['ip'],'description':_0xa65497[_0xc4e3('0x9')]||JSON[_0xc4e3('0xa')](_0xa65497),'issuetype':{'name':_0xa65497['issuetype']||_0xc4e3('0xb')}}};_0x21cc06[_0xc4e3('0xc')][_0xc4e3('0xd')]=_0xa65497[_0xc4e3('0xe')];_0x21cc06[_0xc4e3('0xc')]['customfield_11501']=_0xa65497[_0xc4e3('0xf')];_0x21cc06['fields'][_0xc4e3('0x10')]=_0xa65497['newToken'];_0x21cc06[_0xc4e3('0xc')][_0xc4e3('0x11')]=_0xa65497[_0xc4e3('0x12')];_0x21cc06[_0xc4e3('0xc')][_0xc4e3('0x13')]=_0xa65497[_0xc4e3('0x14')];_0x21cc06[_0xc4e3('0xc')][_0xc4e3('0x15')]=_0xa65497['ip'];var _0x2a0d09={'host':_0xc4e3('0x16'),'port':0x1bb,'path':_0xc4e3('0x17'),'method':_0xc4e3('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0xc4e3('0x19'),'Authorization':_0xc4e3('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0xc4e3('0x1b')]('base64')}};var _0x5a563e=JSON['stringify'](_0x21cc06);var _0x5157df=https[_0xc4e3('0x1c')](_0x2a0d09,function(_0x2e9715){_0x2e9715['setEncoding'](_0xc4e3('0x1d'));var _0x43269f='';_0x2e9715['on'](_0xc4e3('0x1e'),function(_0x10c7b6){_0x43269f+=_0x10c7b6;});_0x2e9715['on'](_0xc4e3('0x1f'),function(){if(_0x30aa1c){return _0x30aa1c[_0xc4e3('0x20')](_0x2e9715['statusCode'])[_0xc4e3('0x21')](JSON[_0xc4e3('0x22')](_0x43269f));}});});_0x5157df['on']('error',function(_0x3cfb5e){if(_0x30aa1c){return _0x30aa1c[_0xc4e3('0x20')](0x1f4)['json']({'errors':[{'message':_0xc4e3('0x23'),'type':_0xc4e3('0x24')}]});}});_0x5157df[_0xc4e3('0x25')](_0x5a563e);_0x5157df[_0xc4e3('0x1f')]();}exports[_0xc4e3('0x26')]=openIssue;exports[_0xc4e3('0x27')]=function(_0x1bbdc6,_0x15fbaa){_0x1bbdc6['body']['ip']=_0x1bbdc6[_0xc4e3('0x28')][_0xc4e3('0x29')]||_0x1bbdc6[_0xc4e3('0x2a')]['remoteAddress']||_0x1bbdc6[_0xc4e3('0x2b')][_0xc4e3('0x2c')]||_0x1bbdc6['connection'][_0xc4e3('0x2b')][_0xc4e3('0x2c')];return openIssue(_0x1bbdc6[_0xc4e3('0x2d')],_0x15fbaa);};
\ No newline at end of file
+var _0x2c06=['customfield_11502','newToken','customfield_11503','reason','customfield_10102','/rest/api/2/issue','POST','application/json','toString','base64','request','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','description','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken'];(function(_0x22be6d,_0x90876b){var _0x1985e1=function(_0x4a8921){while(--_0x4a8921){_0x22be6d['push'](_0x22be6d['shift']());}};_0x1985e1(++_0x90876b);}(_0x2c06,0x1bc));var _0x62c0=function(_0x231e7d,_0x2bd424){_0x231e7d=_0x231e7d-0x0;var _0x378be8=_0x2c06[_0x231e7d];return _0x378be8;};'use strict';var BPromise=require(_0x62c0('0x0'));var https=require(_0x62c0('0x1'));var logger=require(_0x62c0('0x2'))(_0x62c0('0x3'));var USERNAME=_0x62c0('0x4');var PASSWORD=_0x62c0('0x5');function openIssue(_0x37cdb8,_0x59304c){var _0x4330e7={'fields':{'project':{'key':_0x37cdb8['key']||_0x62c0('0x6')},'summary':(_0x37cdb8[_0x62c0('0x7')]||'Report')+'\x20from\x20'+_0x37cdb8['ip'],'description':_0x37cdb8[_0x62c0('0x8')]||JSON[_0x62c0('0x9')](_0x37cdb8),'issuetype':{'name':_0x37cdb8[_0x62c0('0xa')]||_0x62c0('0xb')}}};_0x4330e7[_0x62c0('0xc')][_0x62c0('0xd')]=_0x37cdb8[_0x62c0('0xe')];_0x4330e7[_0x62c0('0xc')]['customfield_11501']=_0x37cdb8[_0x62c0('0xf')];_0x4330e7[_0x62c0('0xc')][_0x62c0('0x10')]=_0x37cdb8[_0x62c0('0x11')];_0x4330e7[_0x62c0('0xc')][_0x62c0('0x12')]=_0x37cdb8['name'];_0x4330e7[_0x62c0('0xc')]['customfield_11504']=_0x37cdb8[_0x62c0('0x13')];_0x4330e7['fields'][_0x62c0('0x14')]=_0x37cdb8['ip'];var _0x4bed79={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x62c0('0x15'),'method':_0x62c0('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x62c0('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x62c0('0x18')](_0x62c0('0x19'))}};var _0x504334=JSON['stringify'](_0x4330e7);var _0x23a39e=https[_0x62c0('0x1a')](_0x4bed79,function(_0x3ab9a7){_0x3ab9a7['setEncoding'](_0x62c0('0x1b'));var _0x5b12dc='';_0x3ab9a7['on'](_0x62c0('0x1c'),function(_0x1383b5){_0x5b12dc+=_0x1383b5;});_0x3ab9a7['on'](_0x62c0('0x1d'),function(){if(_0x59304c){return _0x59304c[_0x62c0('0x1e')](_0x3ab9a7[_0x62c0('0x1f')])[_0x62c0('0x20')](JSON[_0x62c0('0x21')](_0x5b12dc));}});});_0x23a39e['on'](_0x62c0('0x22'),function(_0x47cb7e){if(_0x59304c){return _0x59304c[_0x62c0('0x1e')](0x1f4)[_0x62c0('0x20')]({'errors':[{'message':_0x62c0('0x23'),'type':_0x62c0('0x24')}]});}});_0x23a39e[_0x62c0('0x25')](_0x504334);_0x23a39e[_0x62c0('0x1d')]();}exports[_0x62c0('0x26')]=openIssue;exports[_0x62c0('0x27')]=function(_0x57afbd,_0x263317){_0x57afbd[_0x62c0('0x28')]['ip']=_0x57afbd[_0x62c0('0x29')][_0x62c0('0x2a')]||_0x57afbd[_0x62c0('0x2b')][_0x62c0('0x2c')]||_0x57afbd[_0x62c0('0x2d')][_0x62c0('0x2c')]||_0x57afbd['connection'][_0x62c0('0x2d')][_0x62c0('0x2c')];return openIssue(_0x57afbd[_0x62c0('0x28')],_0x263317);};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js
index 495401a..fe6eed8 100644
--- a/server/api/jscriptyAnswerReport/index.js
+++ b/server/api/jscriptyAnswerReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6837=['express','Router','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x30f030,_0xd03b7a){var _0xf7614f=function(_0x261cac){while(--_0x261cac){_0x30f030['push'](_0x30f030['shift']());}};_0xf7614f(++_0xd03b7a);}(_0x6837,0xf8));var _0x7683=function(_0x4aaaeb,_0x1d0819){_0x4aaaeb=_0x4aaaeb-0x0;var _0x521328=_0x6837[_0x4aaaeb];return _0x521328;};'use strict';var multer=require(_0x7683('0x0'));var util=require(_0x7683('0x1'));var path=require(_0x7683('0x2'));var timeout=require(_0x7683('0x3'));var express=require(_0x7683('0x4'));var router=express[_0x7683('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7683('0x6'));var config=require('../../config/environment');var controller=require(_0x7683('0x7'));router[_0x7683('0x8')]('/',auth[_0x7683('0x9')](),controller[_0x7683('0xa')]);router[_0x7683('0x8')](_0x7683('0xb'),auth[_0x7683('0x9')](),controller[_0x7683('0xc')]);router[_0x7683('0x8')](_0x7683('0xd'),auth[_0x7683('0x9')](),controller[_0x7683('0xe')]);router[_0x7683('0xf')]('/',auth[_0x7683('0x9')](),controller[_0x7683('0x10')]);router[_0x7683('0x11')](_0x7683('0xd'),auth[_0x7683('0x9')](),controller['update']);router[_0x7683('0x12')](_0x7683('0xd'),auth[_0x7683('0x9')](),controller[_0x7683('0x13')]);module[_0x7683('0x14')]=router;
\ No newline at end of file
+var _0x6ee2=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x30c3bc,_0x511688){var _0x153c44=function(_0xc838ad){while(--_0xc838ad){_0x30c3bc['push'](_0x30c3bc['shift']());}};_0x153c44(++_0x511688);}(_0x6ee2,0x1e0));var _0x26ee=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x6ee2[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x26ee('0x0'));var util=require(_0x26ee('0x1'));var path=require(_0x26ee('0x2'));var timeout=require(_0x26ee('0x3'));var express=require(_0x26ee('0x4'));var router=express[_0x26ee('0x5')]();var auth=require(_0x26ee('0x6'));var interaction=require(_0x26ee('0x7'));var config=require('../../config/environment');var controller=require(_0x26ee('0x8'));router[_0x26ee('0x9')]('/',auth['isAuthenticated'](),controller[_0x26ee('0xa')]);router[_0x26ee('0x9')](_0x26ee('0xb'),auth[_0x26ee('0xc')](),controller[_0x26ee('0xd')]);router['get']('/:id',auth[_0x26ee('0xc')](),controller[_0x26ee('0xe')]);router[_0x26ee('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x26ee('0x10')](_0x26ee('0x11'),auth['isAuthenticated'](),controller[_0x26ee('0x12')]);router[_0x26ee('0x13')](_0x26ee('0x11'),auth[_0x26ee('0xc')](),controller[_0x26ee('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
index b5e152d..70efaea 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x82ea=['TEXT','long','sequelize','STRING'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x82ea,0x10a));var _0xa82e=function(_0x35666b,_0xa44069){_0x35666b=_0x35666b-0x0;var _0x204cdd=_0x82ea[_0x35666b];return _0x204cdd;};'use strict';var Sequelize=require(_0xa82e('0x0'));module['exports']={'question':{'type':Sequelize[_0xa82e('0x1')]},'answer':{'type':Sequelize[_0xa82e('0x2')](_0xa82e('0x3'))},'membername':{'type':Sequelize[_0xa82e('0x1')]},'projectname':{'type':Sequelize[_0xa82e('0x1')]},'queue':{'type':Sequelize[_0xa82e('0x1')]},'uniqueid':{'type':Sequelize[_0xa82e('0x1')]},'calleridname':{'type':Sequelize[_0xa82e('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x46ed=['exports','STRING','sequelize'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x46ed,0x143));var _0xd46e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x46ed[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'question':{'type':Sequelize[_0xd46e('0x2')]},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize[_0xd46e('0x2')]},'projectname':{'type':Sequelize[_0xd46e('0x2')]},'queue':{'type':Sequelize[_0xd46e('0x2')]},'uniqueid':{'type':Sequelize[_0xd46e('0x2')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd46e('0x2')]},'questionId':{'type':Sequelize[_0xd46e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
index ab30e26..2a716d9 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e48=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','status','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','show','params','include','catch','create','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x27a24a,_0x4b5d8f){var _0x3ec224=function(_0x270edf){while(--_0x270edf){_0x27a24a['push'](_0x27a24a['shift']());}};_0x3ec224(++_0x4b5d8f);}(_0x4e48,0xd6));var _0x84e4=function(_0x3124f7,_0x5db6e7){_0x3124f7=_0x3124f7-0x0;var _0x35903a=_0x4e48[_0x3124f7];return _0x35903a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x84e4('0x0'));var jsonpatch=require(_0x84e4('0x1'));var rp=require(_0x84e4('0x2'));var moment=require(_0x84e4('0x3'));var BPromise=require(_0x84e4('0x4'));var Mustache=require(_0x84e4('0x5'));var util=require(_0x84e4('0x6'));var path=require(_0x84e4('0x7'));var sox=require(_0x84e4('0x8'));var csv=require(_0x84e4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x84e4('0xa'));var squel=require(_0x84e4('0xb'));var crypto=require(_0x84e4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x84e4('0xd'));var toCsv=require(_0x84e4('0x9'));var querystring=require(_0x84e4('0xe'));var Papa=require(_0x84e4('0xf'));var Redis=require(_0x84e4('0x10'));var authService=require(_0x84e4('0x11'));var qs=require(_0x84e4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84e4('0x13'));var logger=require(_0x84e4('0x14'))(_0x84e4('0x15'));var utils=require(_0x84e4('0x16'));var config=require(_0x84e4('0x17'));var db=require(_0x84e4('0x18'))['db'];function respondWithStatusCode(_0x1f4629,_0x2222fa){_0x2222fa=_0x2222fa||0xcc;return function(_0x5dc7c3){if(_0x5dc7c3){return _0x1f4629[_0x84e4('0x19')](_0x2222fa);}return _0x1f4629['status'](_0x2222fa)[_0x84e4('0x1a')]();};}function respondWithResult(_0x4f345f,_0x1ef766){_0x1ef766=_0x1ef766||0xc8;return function(_0x348fe5){if(_0x348fe5){return _0x4f345f['status'](_0x1ef766)[_0x84e4('0x1b')](_0x348fe5);}};}function respondWithFilteredResult(_0x54c298,_0xc42231){return function(_0x1a4109){if(_0x1a4109){var _0x488706=_0x1a4109['count'],_0xcb8f0a=_0xc42231[_0x84e4('0x1c')],_0x327245=_0xc42231[_0x84e4('0x1c')]+_0xc42231['limit'],_0x3b5cd9;if(_0x327245>=_0x488706){_0x327245=_0x488706;_0x3b5cd9=0xc8;}else{_0x3b5cd9=0xce;}_0x54c298[_0x84e4('0x1d')](_0x3b5cd9);return _0x54c298[_0x84e4('0x1e')](_0x84e4('0x1f'),_0xcb8f0a+'-'+_0x327245+'/'+_0x488706)[_0x84e4('0x1b')](_0x1a4109);}return null;};}function patchUpdates(_0x434969){return function(_0x55329f){try{jsonpatch[_0x84e4('0x20')](_0x55329f,_0x434969,!![]);}catch(_0x4f3b65){return BPromise['reject'](_0x4f3b65);}return _0x55329f[_0x84e4('0x21')]();};}function saveUpdates(_0x4a5746,_0x29271f){return function(_0x41d96d){if(_0x41d96d){return _0x41d96d[_0x84e4('0x22')](_0x4a5746)[_0x84e4('0x23')](function(_0x3cf455){return _0x3cf455;});}return null;};}function removeEntity(_0x322e64,_0x544579){return function(_0x5d1589){if(_0x5d1589){return _0x5d1589[_0x84e4('0x24')]()[_0x84e4('0x23')](function(){_0x322e64['status'](0xcc)[_0x84e4('0x1a')]();});}};}function handleEntityNotFound(_0x465747,_0x3eb640){return function(_0x4644b7){if(!_0x4644b7){_0x465747[_0x84e4('0x19')](0x194);}return _0x4644b7;};}function handleError(_0x52f2ed,_0x47f616){_0x47f616=_0x47f616||0x1f4;return function(_0x2513e1){logger[_0x84e4('0x25')](_0x2513e1['stack']);if(_0x2513e1[_0x84e4('0x26')]){delete _0x2513e1[_0x84e4('0x26')];}_0x52f2ed[_0x84e4('0x1d')](_0x47f616)[_0x84e4('0x27')](_0x2513e1);};}exports[_0x84e4('0x28')]=function(_0x2a8365,_0x15a2ab){var _0x56cfc3={},_0x51ffe5={},_0x157ad4={'count':0x0,'rows':[]};var _0x4e7293=_[_0x84e4('0x29')](db[_0x84e4('0x2a')][_0x84e4('0x2b')],function(_0x295b5a){return{'name':_0x295b5a[_0x84e4('0x2c')],'type':_0x295b5a[_0x84e4('0x2d')][_0x84e4('0x2e')]};});_0x51ffe5[_0x84e4('0x2f')]=_[_0x84e4('0x29')](_0x4e7293,_0x84e4('0x26'));_0x51ffe5[_0x84e4('0x30')]=_[_0x84e4('0x31')](_0x2a8365['query']);_0x51ffe5[_0x84e4('0x32')]=_[_0x84e4('0x33')](_0x51ffe5[_0x84e4('0x2f')],_0x51ffe5[_0x84e4('0x30')]);_0x56cfc3['attributes']=_['intersection'](_0x51ffe5[_0x84e4('0x2f')],qs[_0x84e4('0x34')](_0x2a8365[_0x84e4('0x30')][_0x84e4('0x34')]));_0x56cfc3['attributes']=_0x56cfc3[_0x84e4('0x35')][_0x84e4('0x36')]?_0x56cfc3[_0x84e4('0x35')]:_0x51ffe5[_0x84e4('0x2f')];if(!_0x2a8365['query']['hasOwnProperty'](_0x84e4('0x37'))){_0x56cfc3[_0x84e4('0x38')]=qs[_0x84e4('0x38')](_0x2a8365[_0x84e4('0x30')][_0x84e4('0x38')]);_0x56cfc3['offset']=qs[_0x84e4('0x1c')](_0x2a8365[_0x84e4('0x30')]['offset']);}_0x56cfc3[_0x84e4('0x39')]=qs['sort'](_0x2a8365[_0x84e4('0x30')][_0x84e4('0x3a')]);_0x56cfc3[_0x84e4('0x3b')]=qs['filters'](_['pick'](_0x2a8365['query'],_0x51ffe5[_0x84e4('0x32')]),_0x4e7293);if(_0x2a8365[_0x84e4('0x30')]['filter']){_0x56cfc3[_0x84e4('0x3b')]=_[_0x84e4('0x3c')](_0x56cfc3[_0x84e4('0x3b')],{'$or':_[_0x84e4('0x29')](_0x4e7293,function(_0x7ede74){if(_0x7ede74[_0x84e4('0x2d')]!==_0x84e4('0x3d')){var _0x46e164={};_0x46e164[_0x7ede74[_0x84e4('0x26')]]={'$like':'%'+_0x2a8365[_0x84e4('0x30')][_0x84e4('0x3e')]+'%'};return _0x46e164;}})});}_0x56cfc3=_['merge']({},_0x56cfc3,_0x2a8365[_0x84e4('0x3f')]);var _0x41998e={'where':_0x56cfc3[_0x84e4('0x3b')]};return db['JscriptyAnswerReport'][_0x84e4('0x40')](_0x41998e)[_0x84e4('0x23')](function(_0x597cc1){_0x157ad4[_0x84e4('0x40')]=_0x597cc1;if(_0x2a8365['query'][_0x84e4('0x41')]){_0x56cfc3['include']=[{'all':!![]}];}return db[_0x84e4('0x2a')][_0x84e4('0x42')](_0x56cfc3);})[_0x84e4('0x23')](function(_0x4004a6){_0x157ad4[_0x84e4('0x43')]=_0x4004a6;return _0x157ad4;})[_0x84e4('0x23')](respondWithFilteredResult(_0x15a2ab,_0x56cfc3))['catch'](handleError(_0x15a2ab,null));};exports[_0x84e4('0x44')]=function(_0x4e12a4,_0x408af8){var _0x49de81={'raw':!![],'where':{'id':_0x4e12a4[_0x84e4('0x45')]['id']}},_0xd5c997={};_0xd5c997[_0x84e4('0x2f')]=_['keys'](db[_0x84e4('0x2a')]['rawAttributes']);_0xd5c997[_0x84e4('0x30')]=_['keys'](_0x4e12a4[_0x84e4('0x30')]);_0xd5c997[_0x84e4('0x32')]=_['intersection'](_0xd5c997[_0x84e4('0x2f')],_0xd5c997[_0x84e4('0x30')]);_0x49de81['attributes']=_[_0x84e4('0x33')](_0xd5c997[_0x84e4('0x2f')],qs[_0x84e4('0x34')](_0x4e12a4[_0x84e4('0x30')][_0x84e4('0x34')]));_0x49de81[_0x84e4('0x35')]=_0x49de81[_0x84e4('0x35')][_0x84e4('0x36')]?_0x49de81[_0x84e4('0x35')]:_0xd5c997[_0x84e4('0x2f')];if(_0x4e12a4[_0x84e4('0x30')]['includeAll']){_0x49de81[_0x84e4('0x46')]=[{'all':!![]}];}_0x49de81=_[_0x84e4('0x3c')]({},_0x49de81,_0x4e12a4['options']);return db['JscriptyAnswerReport']['find'](_0x49de81)[_0x84e4('0x23')](handleEntityNotFound(_0x408af8,null))[_0x84e4('0x23')](respondWithResult(_0x408af8,null))[_0x84e4('0x47')](handleError(_0x408af8,null));};exports[_0x84e4('0x48')]=function(_0x4d1fc1,_0x4a69f6){return db[_0x84e4('0x2a')]['create'](_0x4d1fc1[_0x84e4('0x49')],{})[_0x84e4('0x23')](respondWithResult(_0x4a69f6,0xc9))[_0x84e4('0x47')](handleError(_0x4a69f6,null));};exports[_0x84e4('0x22')]=function(_0x2c9f74,_0x3b38d1){if(_0x2c9f74['body']['id']){delete _0x2c9f74[_0x84e4('0x49')]['id'];}return db['JscriptyAnswerReport'][_0x84e4('0x4a')]({'where':{'id':_0x2c9f74[_0x84e4('0x45')]['id']}})[_0x84e4('0x23')](handleEntityNotFound(_0x3b38d1,null))[_0x84e4('0x23')](saveUpdates(_0x2c9f74['body'],null))[_0x84e4('0x23')](respondWithResult(_0x3b38d1,null))[_0x84e4('0x47')](handleError(_0x3b38d1,null));};exports['destroy']=function(_0x4cc780,_0x5875cf){return db[_0x84e4('0x2a')][_0x84e4('0x4a')]({'where':{'id':_0x4cc780[_0x84e4('0x45')]['id']}})[_0x84e4('0x23')](handleEntityNotFound(_0x5875cf,null))[_0x84e4('0x23')](removeEntity(_0x5875cf,null))['catch'](handleError(_0x5875cf,null));};exports[_0x84e4('0x4b')]=function(_0x1cbe35,_0x3f5c2e){return db['JscriptyAnswerReport'][_0x84e4('0x4b')]()[_0x84e4('0x23')](respondWithResult(_0x3f5c2e,null))[_0x84e4('0x47')](handleError(_0x3f5c2e,null));};
\ No newline at end of file
+var _0xb7c2=['apply','reject','update','then','destroy','end','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','length','attributes','hasOwnProperty','nolimit','limit','order','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json'];(function(_0x41f13f,_0x2718da){var _0x1b2f68=function(_0x143695){while(--_0x143695){_0x41f13f['push'](_0x41f13f['shift']());}};_0x1b2f68(++_0x2718da);}(_0xb7c2,0x149));var _0x2b7c=function(_0x46e66f,_0x20378b){_0x46e66f=_0x46e66f-0x0;var _0x420e77=_0xb7c2[_0x46e66f];return _0x420e77;};'use strict';var pdf=require(_0x2b7c('0x0'));var emlformat=require(_0x2b7c('0x1'));var rimraf=require(_0x2b7c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2b7c('0x3'));var moment=require(_0x2b7c('0x4'));var BPromise=require(_0x2b7c('0x5'));var Mustache=require(_0x2b7c('0x6'));var util=require(_0x2b7c('0x7'));var path=require(_0x2b7c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2b7c('0x9'));var fs=require('fs');var _=require(_0x2b7c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2b7c('0xb'));var Papa=require('papaparse');var Redis=require(_0x2b7c('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x2b7c('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b7c('0xe'));var logger=require('../../config/logger')(_0x2b7c('0xf'));var utils=require(_0x2b7c('0x10'));var config=require(_0x2b7c('0x11'));var db=require(_0x2b7c('0x12'))['db'];function respondWithStatusCode(_0x4b4580,_0x121a10){_0x121a10=_0x121a10||0xcc;return function(_0x43bb44){if(_0x43bb44){return _0x4b4580[_0x2b7c('0x13')](_0x121a10);}return _0x4b4580[_0x2b7c('0x14')](_0x121a10)['end']();};}function respondWithResult(_0x413178,_0xabd428){_0xabd428=_0xabd428||0xc8;return function(_0x1d5355){if(_0x1d5355){return _0x413178[_0x2b7c('0x14')](_0xabd428)['json'](_0x1d5355);}};}function respondWithFilteredResult(_0x32ee90,_0x44400e){return function(_0x19335c){if(_0x19335c){var _0x49717b=_0x19335c[_0x2b7c('0x15')],_0x1eb076=_0x44400e[_0x2b7c('0x16')],_0x4c4b4c=_0x44400e[_0x2b7c('0x16')]+_0x44400e['limit'],_0x451eee;if(_0x4c4b4c>=_0x49717b){_0x4c4b4c=_0x49717b;_0x451eee=0xc8;}else{_0x451eee=0xce;}_0x32ee90['status'](_0x451eee);return _0x32ee90[_0x2b7c('0x17')](_0x2b7c('0x18'),_0x1eb076+'-'+_0x4c4b4c+'/'+_0x49717b)[_0x2b7c('0x19')](_0x19335c);}return null;};}function patchUpdates(_0x19ed62){return function(_0x521190){try{jsonpatch[_0x2b7c('0x1a')](_0x521190,_0x19ed62,!![]);}catch(_0x34af91){return BPromise[_0x2b7c('0x1b')](_0x34af91);}return _0x521190['save']();};}function saveUpdates(_0x28bf23,_0x18bd11){return function(_0x38a154){if(_0x38a154){return _0x38a154[_0x2b7c('0x1c')](_0x28bf23)[_0x2b7c('0x1d')](function(_0x758b8e){return _0x758b8e;});}return null;};}function removeEntity(_0x16990c,_0x7d1338){return function(_0x1baf20){if(_0x1baf20){return _0x1baf20[_0x2b7c('0x1e')]()[_0x2b7c('0x1d')](function(){_0x16990c[_0x2b7c('0x14')](0xcc)[_0x2b7c('0x1f')]();});}};}function handleEntityNotFound(_0x570602,_0x5d171c){return function(_0x555915){if(!_0x555915){_0x570602['sendStatus'](0x194);}return _0x555915;};}function handleError(_0x4dd3c7,_0x2b9a69){_0x2b9a69=_0x2b9a69||0x1f4;return function(_0x2ab136){logger[_0x2b7c('0x20')](_0x2ab136[_0x2b7c('0x21')]);if(_0x2ab136[_0x2b7c('0x22')]){delete _0x2ab136[_0x2b7c('0x22')];}_0x4dd3c7[_0x2b7c('0x14')](_0x2b9a69)[_0x2b7c('0x23')](_0x2ab136);};}exports[_0x2b7c('0x24')]=function(_0x84a334,_0x3c8fb2){var _0x4ee78c={},_0x552a8f={},_0x4782c0={'count':0x0,'rows':[]};var _0x2f1099=_[_0x2b7c('0x25')](db[_0x2b7c('0x26')][_0x2b7c('0x27')],function(_0x4f7b8f){return{'name':_0x4f7b8f[_0x2b7c('0x28')],'type':_0x4f7b8f[_0x2b7c('0x29')][_0x2b7c('0x2a')]};});_0x552a8f[_0x2b7c('0x2b')]=_['map'](_0x2f1099,'name');_0x552a8f[_0x2b7c('0x2c')]=_[_0x2b7c('0x2d')](_0x84a334['query']);_0x552a8f[_0x2b7c('0x2e')]=_['intersection'](_0x552a8f['model'],_0x552a8f[_0x2b7c('0x2c')]);_0x4ee78c['attributes']=_[_0x2b7c('0x2f')](_0x552a8f[_0x2b7c('0x2b')],qs['fields'](_0x84a334[_0x2b7c('0x2c')]['fields']));_0x4ee78c['attributes']=_0x4ee78c['attributes'][_0x2b7c('0x30')]?_0x4ee78c[_0x2b7c('0x31')]:_0x552a8f[_0x2b7c('0x2b')];if(!_0x84a334['query'][_0x2b7c('0x32')](_0x2b7c('0x33'))){_0x4ee78c[_0x2b7c('0x34')]=qs['limit'](_0x84a334['query'][_0x2b7c('0x34')]);_0x4ee78c[_0x2b7c('0x16')]=qs['offset'](_0x84a334['query']['offset']);}_0x4ee78c[_0x2b7c('0x35')]=qs['sort'](_0x84a334['query']['sort']);_0x4ee78c[_0x2b7c('0x36')]=qs['filters'](_['pick'](_0x84a334[_0x2b7c('0x2c')],_0x552a8f['filters']),_0x2f1099);if(_0x84a334[_0x2b7c('0x2c')]['filter']){_0x4ee78c[_0x2b7c('0x36')]=_[_0x2b7c('0x37')](_0x4ee78c[_0x2b7c('0x36')],{'$or':_['map'](_0x2f1099,function(_0x57f120){if(_0x57f120[_0x2b7c('0x29')]!==_0x2b7c('0x38')){var _0x3e4857={};_0x3e4857[_0x57f120[_0x2b7c('0x22')]]={'$like':'%'+_0x84a334[_0x2b7c('0x2c')][_0x2b7c('0x39')]+'%'};return _0x3e4857;}})});}_0x4ee78c=_[_0x2b7c('0x37')]({},_0x4ee78c,_0x84a334[_0x2b7c('0x3a')]);var _0x3778f8={'where':_0x4ee78c[_0x2b7c('0x36')]};return db['JscriptyAnswerReport'][_0x2b7c('0x15')](_0x3778f8)[_0x2b7c('0x1d')](function(_0xb20dae){_0x4782c0[_0x2b7c('0x15')]=_0xb20dae;if(_0x84a334[_0x2b7c('0x2c')][_0x2b7c('0x3b')]){_0x4ee78c[_0x2b7c('0x3c')]=[{'all':!![]}];}return db[_0x2b7c('0x26')][_0x2b7c('0x3d')](_0x4ee78c);})['then'](function(_0x2f7fe7){_0x4782c0[_0x2b7c('0x3e')]=_0x2f7fe7;return _0x4782c0;})['then'](respondWithFilteredResult(_0x3c8fb2,_0x4ee78c))[_0x2b7c('0x3f')](handleError(_0x3c8fb2,null));};exports[_0x2b7c('0x40')]=function(_0x194e0c,_0x2a0ecd){var _0x3aed83={'raw':!![],'where':{'id':_0x194e0c[_0x2b7c('0x41')]['id']}},_0x3caac5={};_0x3caac5[_0x2b7c('0x2b')]=_[_0x2b7c('0x2d')](db[_0x2b7c('0x26')][_0x2b7c('0x27')]);_0x3caac5['query']=_['keys'](_0x194e0c[_0x2b7c('0x2c')]);_0x3caac5[_0x2b7c('0x2e')]=_['intersection'](_0x3caac5[_0x2b7c('0x2b')],_0x3caac5[_0x2b7c('0x2c')]);_0x3aed83['attributes']=_[_0x2b7c('0x2f')](_0x3caac5['model'],qs[_0x2b7c('0x42')](_0x194e0c[_0x2b7c('0x2c')]['fields']));_0x3aed83[_0x2b7c('0x31')]=_0x3aed83[_0x2b7c('0x31')][_0x2b7c('0x30')]?_0x3aed83[_0x2b7c('0x31')]:_0x3caac5['model'];if(_0x194e0c[_0x2b7c('0x2c')][_0x2b7c('0x3b')]){_0x3aed83['include']=[{'all':!![]}];}_0x3aed83=_[_0x2b7c('0x37')]({},_0x3aed83,_0x194e0c['options']);return db['JscriptyAnswerReport'][_0x2b7c('0x43')](_0x3aed83)['then'](handleEntityNotFound(_0x2a0ecd,null))[_0x2b7c('0x1d')](respondWithResult(_0x2a0ecd,null))[_0x2b7c('0x3f')](handleError(_0x2a0ecd,null));};exports['create']=function(_0x272873,_0x32f965){return db[_0x2b7c('0x26')][_0x2b7c('0x44')](_0x272873[_0x2b7c('0x45')],{})[_0x2b7c('0x1d')](respondWithResult(_0x32f965,0xc9))[_0x2b7c('0x3f')](handleError(_0x32f965,null));};exports['update']=function(_0x24c325,_0x5da21c){if(_0x24c325[_0x2b7c('0x45')]['id']){delete _0x24c325[_0x2b7c('0x45')]['id'];}return db[_0x2b7c('0x26')][_0x2b7c('0x43')]({'where':{'id':_0x24c325[_0x2b7c('0x41')]['id']}})[_0x2b7c('0x1d')](handleEntityNotFound(_0x5da21c,null))['then'](saveUpdates(_0x24c325['body'],null))[_0x2b7c('0x1d')](respondWithResult(_0x5da21c,null))['catch'](handleError(_0x5da21c,null));};exports[_0x2b7c('0x1e')]=function(_0x5a73c9,_0x1a91cc){return db[_0x2b7c('0x26')][_0x2b7c('0x43')]({'where':{'id':_0x5a73c9[_0x2b7c('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a91cc,null))[_0x2b7c('0x1d')](removeEntity(_0x1a91cc,null))[_0x2b7c('0x3f')](handleError(_0x1a91cc,null));};exports[_0x2b7c('0x46')]=function(_0x1f4ac4,_0xce08de){return db['JscriptyAnswerReport'][_0x2b7c('0x46')]()[_0x2b7c('0x1d')](respondWithResult(_0xce08de,null))['catch'](handleError(_0xce08de,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
index 30e60df..23ce4e5 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0626=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','report_jscripty_answers'];(function(_0x139b54,_0x242dcf){var _0x647405=function(_0x1e6614){while(--_0x1e6614){_0x139b54['push'](_0x139b54['shift']());}};_0x647405(++_0x242dcf);}(_0x0626,0x1ef));var _0x6062=function(_0x23c5b3,_0x369a5e){_0x23c5b3=_0x23c5b3-0x0;var _0x4cfde9=_0x0626[_0x23c5b3];return _0x4cfde9;};'use strict';var _=require(_0x6062('0x0'));var util=require(_0x6062('0x1'));var logger=require(_0x6062('0x2'))(_0x6062('0x3'));var moment=require(_0x6062('0x4'));var BPromise=require(_0x6062('0x5'));var rp=require(_0x6062('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6062('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x6062('0x8')]=function(_0x354f34,_0x7c3d72){return _0x354f34[_0x6062('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x6062('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4db0=['api','request-promise','path','rimraf','../../config/environment','exports','lodash','util','../../config/logger'];(function(_0x4f2447,_0x28cb03){var _0x4d566d=function(_0x1b5488){while(--_0x1b5488){_0x4f2447['push'](_0x4f2447['shift']());}};_0x4d566d(++_0x28cb03);}(_0x4db0,0x16e));var _0x04db=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0x4db0[_0x10b48a];return _0x2c4533;};'use strict';var _=require(_0x04db('0x0'));var util=require(_0x04db('0x1'));var logger=require(_0x04db('0x2'))(_0x04db('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x04db('0x4'));var fs=require('fs');var path=require(_0x04db('0x5'));var rimraf=require(_0x04db('0x6'));var config=require(_0x04db('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x04db('0x8')]=function(_0x3a8195,_0x3358d9){return _0x3a8195['define']('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
index 51e3235..17d1892 100644
--- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
+++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x952c=['request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','debug'];(function(_0x1a89ca,_0x27394b){var _0x29cbb2=function(_0x31e1f4){while(--_0x31e1f4){_0x1a89ca['push'](_0x1a89ca['shift']());}};_0x29cbb2(++_0x27394b);}(_0x952c,0xd6));var _0xc952=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0x952c[_0x705b98];return _0x47b72f;};'use strict';var _=require(_0xc952('0x0'));var util=require(_0xc952('0x1'));var moment=require(_0xc952('0x2'));var BPromise=require(_0xc952('0x3'));var rs=require(_0xc952('0x4'));var fs=require('fs');var Redis=require(_0xc952('0x5'));var db=require(_0xc952('0x6'))['db'];var utils=require(_0xc952('0x7'));var logger=require(_0xc952('0x8'))(_0xc952('0x9'));var config=require(_0xc952('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc952('0xb')][_0xc952('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47a44d,_0x23bf20,_0x20e046){return new BPromise(function(_0x1f8b83,_0x1c311b){return client['request'](_0x47a44d,_0x20e046)[_0xc952('0xd')](function(_0x29bd89){logger['info'](_0xc952('0xe'),_0x23bf20,'request\x20sent');logger[_0xc952('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x23bf20,_0xc952('0x10'),JSON['stringify'](_0x29bd89));if(_0x29bd89[_0xc952('0x11')]){if(_0x29bd89['error'][_0xc952('0x12')]===0x1f4){logger[_0xc952('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x23bf20,_0x29bd89[_0xc952('0x11')][_0xc952('0x13')]);return _0x1c311b(_0x29bd89[_0xc952('0x11')][_0xc952('0x13')]);}logger[_0xc952('0x11')](_0xc952('0xe'),_0x23bf20,_0x29bd89[_0xc952('0x11')]['message']);return _0x1f8b83(_0x29bd89[_0xc952('0x11')][_0xc952('0x13')]);}else{logger[_0xc952('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x23bf20,'request\x20sent');_0x1f8b83(_0x29bd89[_0xc952('0x15')][_0xc952('0x13')]);}})[_0xc952('0x16')](function(_0x72cf30){logger[_0xc952('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x23bf20,_0x72cf30);_0x1c311b(_0x72cf30);});});}
\ No newline at end of file
+var _0x8452=['../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x1bd3ab,_0x352c42){var _0x37e394=function(_0x2f581d){while(--_0x2f581d){_0x1bd3ab['push'](_0x1bd3ab['shift']());}};_0x37e394(++_0x352c42);}(_0x8452,0x1dd));var _0x2845=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0x8452[_0x40d8d7];return _0x3454cc;};'use strict';var _=require(_0x2845('0x0'));var util=require(_0x2845('0x1'));var moment=require(_0x2845('0x2'));var BPromise=require(_0x2845('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2845('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2845('0x5'));var logger=require(_0x2845('0x6'))('rpc');var config=require(_0x2845('0x7'));var jayson=require(_0x2845('0x8'));var client=jayson[_0x2845('0x9')][_0x2845('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5552dd,_0x55c285,_0x32146b){return new BPromise(function(_0x23805c,_0x1424e4){return client[_0x2845('0xb')](_0x5552dd,_0x32146b)[_0x2845('0xc')](function(_0x13e0f2){logger[_0x2845('0xd')](_0x2845('0xe'),_0x55c285,_0x2845('0xf'));logger[_0x2845('0x10')](_0x2845('0x11'),_0x55c285,_0x2845('0xf'),JSON['stringify'](_0x13e0f2));if(_0x13e0f2[_0x2845('0x12')]){if(_0x13e0f2['error'][_0x2845('0x13')]===0x1f4){logger[_0x2845('0x12')](_0x2845('0xe'),_0x55c285,_0x13e0f2[_0x2845('0x12')][_0x2845('0x14')]);return _0x1424e4(_0x13e0f2[_0x2845('0x12')][_0x2845('0x14')]);}logger[_0x2845('0x12')](_0x2845('0xe'),_0x55c285,_0x13e0f2[_0x2845('0x12')][_0x2845('0x14')]);return _0x23805c(_0x13e0f2['error']['message']);}else{logger['info'](_0x2845('0xe'),_0x55c285,_0x2845('0xf'));_0x23805c(_0x13e0f2[_0x2845('0x15')][_0x2845('0x14')]);}})['catch'](function(_0x98ab77){logger[_0x2845('0x12')](_0x2845('0xe'),_0x55c285,_0x98ab77);_0x1424e4(_0x98ab77);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js
index 25aaf79..9f044b6 100644
--- a/server/api/jscriptyProject/index.js
+++ b/server/api/jscriptyProject/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6452=['/:id','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','/:id/clone','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x27161e,_0x136b07){var _0x179d9=function(_0x44d83b){while(--_0x44d83b){_0x27161e['push'](_0x27161e['shift']());}};_0x179d9(++_0x136b07);}(_0x6452,0x156));var _0x2645=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x6452[_0x5311e8];return _0x582ad8;};'use strict';var multer=require(_0x2645('0x0'));var util=require(_0x2645('0x1'));var path=require(_0x2645('0x2'));var timeout=require('connect-timeout');var express=require(_0x2645('0x3'));var router=express[_0x2645('0x4')]();var auth=require(_0x2645('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2645('0x6'));var controller=require(_0x2645('0x7'));router[_0x2645('0x8')]('/',auth[_0x2645('0x9')](),controller['index']);router[_0x2645('0x8')](_0x2645('0xa'),auth[_0x2645('0x9')](),controller['show']);router['get']('/:id/sessions',auth[_0x2645('0x9')](),controller[_0x2645('0xb')]);router['get'](_0x2645('0xc'),auth['isAuthenticated'](),controller[_0x2645('0xd')]);router['get'](_0x2645('0xe'),auth['isAuthenticated'](),timeout('30s'),controller[_0x2645('0xf')]);router[_0x2645('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2645('0x10')](_0x2645('0x11'),auth[_0x2645('0x9')](),controller['clone']);router[_0x2645('0x12')](_0x2645('0xa'),auth[_0x2645('0x9')](),controller[_0x2645('0x13')]);router['delete'](_0x2645('0xa'),auth[_0x2645('0x9')](),controller[_0x2645('0x14')]);module[_0x2645('0x15')]=router;
\ No newline at end of file
+var _0xebc8=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','/:id','delete','destroy','multer','util','connect-timeout','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xebc8,0xc4));var _0x8ebc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xebc8[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x8ebc('0x0'));var util=require(_0x8ebc('0x1'));var path=require('path');var timeout=require(_0x8ebc('0x2'));var express=require(_0x8ebc('0x3'));var router=express[_0x8ebc('0x4')]();var auth=require(_0x8ebc('0x5'));var interaction=require(_0x8ebc('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x8ebc('0x7')]('/',auth[_0x8ebc('0x8')](),controller[_0x8ebc('0x9')]);router['get']('/:id',auth[_0x8ebc('0x8')](),controller[_0x8ebc('0xa')]);router[_0x8ebc('0x7')](_0x8ebc('0xb'),auth[_0x8ebc('0x8')](),controller[_0x8ebc('0xc')]);router[_0x8ebc('0x7')](_0x8ebc('0xd'),auth[_0x8ebc('0x8')](),controller[_0x8ebc('0xe')]);router[_0x8ebc('0x7')](_0x8ebc('0xf'),auth[_0x8ebc('0x8')](),timeout(_0x8ebc('0x10')),controller[_0x8ebc('0x11')]);router[_0x8ebc('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8ebc('0x12')](_0x8ebc('0x13'),auth['isAuthenticated'](),controller[_0x8ebc('0x14')]);router[_0x8ebc('0x15')](_0x8ebc('0x16'),auth[_0x8ebc('0x8')](),controller['update']);router[_0x8ebc('0x17')](_0x8ebc('0x16'),auth[_0x8ebc('0x8')](),controller[_0x8ebc('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js
index 3272a6b..11b727a 100644
--- a/server/api/jscriptyProject/jscriptyProject.attributes.js
+++ b/server/api/jscriptyProject/jscriptyProject.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6040=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','name','STRING','TEXT','isObjectLike','setDataValue','stringify','isString','formData'];(function(_0x3470c3,_0xb7e4fc){var _0x5045c5=function(_0x5a16f5){while(--_0x5a16f5){_0x3470c3['push'](_0x3470c3['shift']());}};_0x5045c5(++_0xb7e4fc);}(_0x6040,0x19d));var _0x0604=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0x6040[_0x4ce028];return _0x583d0c;};'use strict';var Sequelize=require(_0x0604('0x0'));var _=require(_0x0604('0x1'));var util=require(_0x0604('0x2'));module[_0x0604('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x0604('0x4')},'description':{'type':Sequelize[_0x0604('0x5')]},'formData':{'type':Sequelize[_0x0604('0x6')]('long'),'set':function(_0x1556d9){if(_[_0x0604('0x7')](_0x1556d9)){this[_0x0604('0x8')]('formData',JSON[_0x0604('0x9')](_0x1556d9));}else if(_[_0x0604('0xa')](_0x1556d9)){this[_0x0604('0x8')](_0x0604('0xb'),_0x1556d9);}else{this[_0x0604('0x8')](_0x0604('0xb'),util[_0x0604('0xc')](_0x0604('0xd'),this[_0x0604('0xe')](_0x0604('0x4'))||'',this['getDataValue'](_0x0604('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0604('0x10')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb23b=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','long','isObjectLike','setDataValue','isString','formData','format'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0xb23b,0x1e1));var _0xbb23=function(_0x38d883,_0x3be1ae){_0x38d883=_0x38d883-0x0;var _0x5e1601=_0xb23b[_0x38d883];return _0x5e1601;};'use strict';var Sequelize=require(_0xbb23('0x0'));var _=require(_0xbb23('0x1'));var util=require(_0xbb23('0x2'));module[_0xbb23('0x3')]={'name':{'type':Sequelize[_0xbb23('0x4')],'unique':'name'},'description':{'type':Sequelize[_0xbb23('0x4')]},'formData':{'type':Sequelize[_0xbb23('0x5')](_0xbb23('0x6')),'set':function(_0x5055bc){if(_[_0xbb23('0x7')](_0x5055bc)){this[_0xbb23('0x8')]('formData',JSON['stringify'](_0x5055bc));}else if(_[_0xbb23('0x9')](_0x5055bc)){this[_0xbb23('0x8')](_0xbb23('0xa'),_0x5055bc);}else{this['setDataValue'](_0xbb23('0xa'),util[_0xbb23('0xb')](_0xbb23('0xc'),this[_0xbb23('0xd')](_0xbb23('0xe'))||'',this['getDataValue'](_0xbb23('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xbb23('0x10')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js
index a7384b3..af33925 100644
--- a/server/api/jscriptyProject/jscriptyProject.controller.js
+++ b/server/api/jscriptyProject/jscriptyProject.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6178=['UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','findOne','JscriptySessionReport','order','pick','ProjectId','findAll','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','question','format','SessionId','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','Projects','sendStatus','error','send','index','map','JscriptyProject','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','params','catch','create','body','role'];(function(_0x5ed8f2,_0x4ab02d){var _0x49803d=function(_0x508539){while(--_0x508539){_0x5ed8f2['push'](_0x5ed8f2['shift']());}};_0x49803d(++_0x4ab02d);}(_0x6178,0x9f));var _0x8617=function(_0x37420b,_0x9f3340){_0x37420b=_0x37420b-0x0;var _0x531f8a=_0x6178[_0x37420b];return _0x531f8a;};'use strict';var pdf=require(_0x8617('0x0'));var emlformat=require(_0x8617('0x1'));var rimraf=require(_0x8617('0x2'));var zipdir=require(_0x8617('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8617('0x4'));var moment=require(_0x8617('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8617('0x6'));var util=require(_0x8617('0x7'));var path=require(_0x8617('0x8'));var sox=require('sox');var csv=require(_0x8617('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8617('0xa'));var squel=require(_0x8617('0xb'));var crypto=require(_0x8617('0xc'));var jsforce=require(_0x8617('0xd'));var deskjs=require(_0x8617('0xe'));var toCsv=require(_0x8617('0x9'));var querystring=require(_0x8617('0xf'));var Papa=require(_0x8617('0x10'));var Redis=require('ioredis');var authService=require(_0x8617('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8617('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8617('0x13'))(_0x8617('0x14'));var utils=require('../../config/utils');var config=require(_0x8617('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43701a,_0x5af201){_0x5af201=_0x5af201||0xcc;return function(_0x192df1){if(_0x192df1){return _0x43701a['sendStatus'](_0x5af201);}return _0x43701a[_0x8617('0x16')](_0x5af201)[_0x8617('0x17')]();};}function respondWithResult(_0x1cc316,_0x187ba0){_0x187ba0=_0x187ba0||0xc8;return function(_0x1a39f7){if(_0x1a39f7){return _0x1cc316[_0x8617('0x16')](_0x187ba0)[_0x8617('0x18')](_0x1a39f7);}};}function respondWithFilteredResult(_0xfd0741,_0x1f4e45){return function(_0x36c41d){if(_0x36c41d){var _0x288bd9=_0x36c41d[_0x8617('0x19')],_0x33fc4f=_0x1f4e45['offset'],_0xf8b2f0=_0x1f4e45[_0x8617('0x1a')]+_0x1f4e45[_0x8617('0x1b')],_0x5ec8a0;if(_0xf8b2f0>=_0x288bd9){_0xf8b2f0=_0x288bd9;_0x5ec8a0=0xc8;}else{_0x5ec8a0=0xce;}_0xfd0741[_0x8617('0x16')](_0x5ec8a0);return _0xfd0741['set'](_0x8617('0x1c'),_0x33fc4f+'-'+_0xf8b2f0+'/'+_0x288bd9)['json'](_0x36c41d);}return null;};}function patchUpdates(_0x3799fa){return function(_0x3c5f9c){try{jsonpatch[_0x8617('0x1d')](_0x3c5f9c,_0x3799fa,!![]);}catch(_0x38f718){return BPromise[_0x8617('0x1e')](_0x38f718);}return _0x3c5f9c[_0x8617('0x1f')]();};}function saveUpdates(_0x4ede94,_0x202bfd){return function(_0x3e7908){if(_0x3e7908){return _0x3e7908[_0x8617('0x20')](_0x4ede94)['then'](function(_0x4271a7){return _0x4271a7;});}return null;};}function removeEntity(_0x4ac27a,_0x1e68b1){return function(_0x5937b9){if(_0x5937b9){return _0x5937b9[_0x8617('0x21')]()[_0x8617('0x22')](function(){var _0x2d9c5f=_0x5937b9[_0x8617('0x23')]({'plain':!![]});var _0x388567=_0x8617('0x24');return db['UserProfileResource'][_0x8617('0x21')]({'where':{'type':_0x388567,'resourceId':_0x2d9c5f['id']}})[_0x8617('0x22')](function(){return _0x5937b9;});})['then'](function(){_0x4ac27a[_0x8617('0x16')](0xcc)[_0x8617('0x17')]();});}};}function handleEntityNotFound(_0x77f92a,_0x2816e1){return function(_0x5b95f6){if(!_0x5b95f6){_0x77f92a[_0x8617('0x25')](0x194);}return _0x5b95f6;};}function handleError(_0x5e28ca,_0x48f2f6){_0x48f2f6=_0x48f2f6||0x1f4;return function(_0x2c9e51){logger[_0x8617('0x26')](_0x2c9e51['stack']);if(_0x2c9e51['name']){delete _0x2c9e51['name'];}_0x5e28ca[_0x8617('0x16')](_0x48f2f6)[_0x8617('0x27')](_0x2c9e51);};}exports[_0x8617('0x28')]=function(_0x384d4a,_0x223e22){var _0xd73817={},_0x49b150={},_0x3f63fd={'count':0x0,'rows':[]};var _0x45641b=_[_0x8617('0x29')](db[_0x8617('0x2a')][_0x8617('0x2b')],function(_0xbe4343){return{'name':_0xbe4343['fieldName'],'type':_0xbe4343[_0x8617('0x2c')][_0x8617('0x2d')]};});_0x49b150[_0x8617('0x2e')]=_[_0x8617('0x29')](_0x45641b,_0x8617('0x2f'));_0x49b150[_0x8617('0x30')]=_[_0x8617('0x31')](_0x384d4a[_0x8617('0x30')]);_0x49b150[_0x8617('0x32')]=_[_0x8617('0x33')](_0x49b150[_0x8617('0x2e')],_0x49b150[_0x8617('0x30')]);_0xd73817[_0x8617('0x34')]=_[_0x8617('0x33')](_0x49b150['model'],qs[_0x8617('0x35')](_0x384d4a[_0x8617('0x30')][_0x8617('0x35')]));_0xd73817[_0x8617('0x34')]=_0xd73817['attributes'][_0x8617('0x36')]?_0xd73817['attributes']:_0x49b150['model'];if(!_0x384d4a[_0x8617('0x30')][_0x8617('0x37')](_0x8617('0x38'))){_0xd73817['limit']=qs[_0x8617('0x1b')](_0x384d4a[_0x8617('0x30')]['limit']);_0xd73817[_0x8617('0x1a')]=qs['offset'](_0x384d4a[_0x8617('0x30')][_0x8617('0x1a')]);}_0xd73817['order']=qs[_0x8617('0x39')](_0x384d4a[_0x8617('0x30')][_0x8617('0x39')]);_0xd73817[_0x8617('0x3a')]=qs['filters'](_['pick'](_0x384d4a[_0x8617('0x30')],_0x49b150[_0x8617('0x32')]),_0x45641b);if(_0x384d4a['query'][_0x8617('0x3b')]){_0xd73817[_0x8617('0x3a')]=_['merge'](_0xd73817['where'],{'$or':_[_0x8617('0x29')](_0x45641b,function(_0x48e5b5){if(_0x48e5b5[_0x8617('0x2c')]!==_0x8617('0x3c')){var _0x3d0837={};_0x3d0837[_0x48e5b5[_0x8617('0x2f')]]={'$like':'%'+_0x384d4a['query']['filter']+'%'};return _0x3d0837;}})});}_0xd73817=_[_0x8617('0x3d')]({},_0xd73817,_0x384d4a[_0x8617('0x3e')]);var _0x598a3f={'where':_0xd73817[_0x8617('0x3a')]};return db['JscriptyProject'][_0x8617('0x19')](_0x598a3f)['then'](function(_0x2037d5){_0x3f63fd[_0x8617('0x19')]=_0x2037d5;if(_0x384d4a[_0x8617('0x30')][_0x8617('0x3f')]){_0xd73817[_0x8617('0x40')]=[{'all':!![]}];}return db[_0x8617('0x2a')]['findAll'](_0xd73817);})[_0x8617('0x22')](function(_0x4ad693){_0x3f63fd[_0x8617('0x41')]=_0x4ad693;return _0x3f63fd;})[_0x8617('0x22')](respondWithFilteredResult(_0x223e22,_0xd73817))['catch'](handleError(_0x223e22,null));};exports['show']=function(_0x5d956a,_0x3c3041){var _0x571ace={'raw':![],'where':{'id':_0x5d956a[_0x8617('0x42')]['id']}},_0x2fd20d={};_0x2fd20d[_0x8617('0x2e')]=_['keys'](db[_0x8617('0x2a')][_0x8617('0x2b')]);_0x2fd20d['query']=_[_0x8617('0x31')](_0x5d956a[_0x8617('0x30')]);_0x2fd20d[_0x8617('0x32')]=_[_0x8617('0x33')](_0x2fd20d[_0x8617('0x2e')],_0x2fd20d['query']);_0x571ace['attributes']=_[_0x8617('0x33')](_0x2fd20d['model'],qs[_0x8617('0x35')](_0x5d956a[_0x8617('0x30')][_0x8617('0x35')]));_0x571ace['attributes']=_0x571ace[_0x8617('0x34')][_0x8617('0x36')]?_0x571ace['attributes']:_0x2fd20d[_0x8617('0x2e')];if(_0x5d956a[_0x8617('0x30')]['includeAll']){_0x571ace['include']=[{'all':!![]}];}_0x571ace=_[_0x8617('0x3d')]({},_0x571ace,_0x5d956a['options']);return db['JscriptyProject']['find'](_0x571ace)[_0x8617('0x22')](handleEntityNotFound(_0x3c3041,null))[_0x8617('0x22')](respondWithResult(_0x3c3041,null))[_0x8617('0x43')](handleError(_0x3c3041,null));};exports[_0x8617('0x44')]=function(_0x5b3996,_0x4347e5){return db['JscriptyProject']['create'](_0x5b3996[_0x8617('0x45')],{})['then'](function(_0x14f9e2){var _0x498778=_0x5b3996['user'][_0x8617('0x23')]({'plain':!![]});if(!_0x498778)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x498778[_0x8617('0x46')]==='user'){var _0x508fff=_0x14f9e2[_0x8617('0x23')]({'plain':!![]});var _0x193790=_0x8617('0x24');return db[_0x8617('0x47')][_0x8617('0x48')]({'where':{'name':_0x193790,'userProfileId':_0x498778['userProfileId']},'raw':!![]})[_0x8617('0x22')](function(_0x27ccb1){if(_0x27ccb1&&_0x27ccb1['autoAssociation']===0x0){return db[_0x8617('0x49')][_0x8617('0x44')]({'name':_0x508fff[_0x8617('0x2f')],'resourceId':_0x508fff['id'],'type':_0x27ccb1['name'],'sectionId':_0x27ccb1['id']},{})[_0x8617('0x22')](function(){return _0x14f9e2;});}else{return _0x14f9e2;}})['catch'](function(_0x5ee194){logger[_0x8617('0x26')](_0x8617('0x4a'),_0x5ee194);throw _0x5ee194;});}return _0x14f9e2;})[_0x8617('0x22')](respondWithResult(_0x4347e5,0xc9))[_0x8617('0x43')](handleError(_0x4347e5,null));};exports['clone']=function(_0x5eb4b2,_0x1f81cc){var _0x408b33={'where':{'id':_0x5eb4b2['params']['id']}},_0x31e160={};_0x31e160[_0x8617('0x2e')]=_[_0x8617('0x31')](db[_0x8617('0x2a')][_0x8617('0x2b')]);_0x408b33['attributes']=_[_0x8617('0x33')](_0x31e160[_0x8617('0x2e')],qs['fields'](_0x5eb4b2[_0x8617('0x30')][_0x8617('0x35')]));_0x408b33[_0x8617('0x34')]=_0x408b33[_0x8617('0x34')][_0x8617('0x36')]?_0x408b33[_0x8617('0x34')]:_0x31e160[_0x8617('0x2e')];if(_0x5eb4b2[_0x8617('0x30')][_0x8617('0x3f')]){_0x408b33[_0x8617('0x40')]=[{'all':!![]}];}_0x408b33=_[_0x8617('0x3d')]({},_0x408b33,_0x5eb4b2[_0x8617('0x3e')]);return db[_0x8617('0x2a')][_0x8617('0x48')](_0x408b33)[_0x8617('0x22')](handleEntityNotFound(_0x1f81cc,null))[_0x8617('0x22')](function(_0x25d788){if(_0x25d788){var _0x4e9e51=_0x25d788[_0x8617('0x23')]({'plain':!![]});_0x4e9e51=qs['omit'](_0x4e9e51,['id',_0x8617('0x4b'),_0x8617('0x4c')]);_0x5eb4b2[_0x8617('0x45')]=_[_0x8617('0x4d')](_0x5eb4b2[_0x8617('0x45')],['id',_0x8617('0x4b'),_0x8617('0x4c')]);return db[_0x8617('0x2a')][_0x8617('0x44')](_[_0x8617('0x3d')](_0x4e9e51,_0x5eb4b2['body']),{'include':_0x5eb4b2[_0x8617('0x30')][_0x8617('0x3f')]?[{'all':!![]}]:undefined})[_0x8617('0x22')](function(_0x10b47f){var _0x16f7dc=_0x5eb4b2['user'][_0x8617('0x23')]({'plain':!![]});if(!_0x16f7dc)throw new Error(_0x8617('0x4e'));if(_0x16f7dc['role']===_0x8617('0x4f')){var _0x2776a0=_0x10b47f[_0x8617('0x23')]({'plain':!![]});var _0x5eb252='Projects';return db[_0x8617('0x47')]['find']({'where':{'name':_0x5eb252,'userProfileId':_0x16f7dc[_0x8617('0x50')]},'raw':!![]})['then'](function(_0x35a300){if(_0x35a300&&_0x35a300[_0x8617('0x51')]===0x0){return db[_0x8617('0x49')][_0x8617('0x44')]({'name':_0x2776a0[_0x8617('0x2f')],'resourceId':_0x2776a0['id'],'type':_0x35a300[_0x8617('0x2f')],'sectionId':_0x35a300['id']},{})[_0x8617('0x22')](function(){return _0x10b47f;});}else{return _0x10b47f;}})['catch'](function(_0x4552c1){logger['error'](_0x8617('0x4a'),_0x4552c1);throw _0x4552c1;});}return _0x10b47f;});}})[_0x8617('0x22')](respondWithResult(_0x1f81cc,0xc9))[_0x8617('0x43')](handleError(_0x1f81cc,null));};exports[_0x8617('0x20')]=function(_0x1d8b22,_0x8ac34c){if(_0x1d8b22['body']['id']){delete _0x1d8b22[_0x8617('0x45')]['id'];}return db[_0x8617('0x2a')][_0x8617('0x48')]({'where':{'id':_0x1d8b22['params']['id']}})[_0x8617('0x22')](handleEntityNotFound(_0x8ac34c,null))[_0x8617('0x22')](saveUpdates(_0x1d8b22[_0x8617('0x45')],null))['then'](respondWithResult(_0x8ac34c,null))[_0x8617('0x43')](handleError(_0x8ac34c,null));};exports[_0x8617('0x21')]=function(_0x23e055,_0x1e1664){return db[_0x8617('0x2a')]['find']({'where':{'id':_0x23e055[_0x8617('0x42')]['id']}})[_0x8617('0x22')](handleEntityNotFound(_0x1e1664,null))[_0x8617('0x22')](removeEntity(_0x1e1664,null))['catch'](handleError(_0x1e1664,null));};exports['getSessions']=function(_0x301790,_0x4177d2,_0x1cd4db){var _0x5aef01={'raw':!![],'where':{}};var _0x4fe894={};var _0x8e9c9c={'count':0x0,'rows':[]};return db[_0x8617('0x2a')][_0x8617('0x52')]({'where':{'id':_0x301790[_0x8617('0x42')]['id']}})[_0x8617('0x22')](handleEntityNotFound(_0x4177d2,null))[_0x8617('0x22')](function(_0x2f271e){if(_0x2f271e){_0x4fe894[_0x8617('0x2e')]=_['keys'](db[_0x8617('0x53')][_0x8617('0x2b')]);_0x4fe894[_0x8617('0x30')]=_[_0x8617('0x31')](_0x301790['query']);_0x4fe894[_0x8617('0x32')]=_[_0x8617('0x33')](_0x4fe894[_0x8617('0x2e')],_0x4fe894['query']);_0x5aef01[_0x8617('0x34')]=_[_0x8617('0x33')](_0x4fe894[_0x8617('0x2e')],qs[_0x8617('0x35')](_0x301790[_0x8617('0x30')]['fields']));_0x5aef01[_0x8617('0x34')]=_0x5aef01[_0x8617('0x34')][_0x8617('0x36')]?_0x5aef01[_0x8617('0x34')]:_0x4fe894[_0x8617('0x2e')];if(!_0x301790[_0x8617('0x30')][_0x8617('0x37')](_0x8617('0x38'))){_0x5aef01[_0x8617('0x1b')]=qs[_0x8617('0x1b')](_0x301790['query'][_0x8617('0x1b')]);_0x5aef01[_0x8617('0x1a')]=qs['offset'](_0x301790['query'][_0x8617('0x1a')]);}_0x5aef01[_0x8617('0x54')]=qs[_0x8617('0x39')](_0x301790['query'][_0x8617('0x39')]);_0x5aef01[_0x8617('0x3a')]=qs[_0x8617('0x32')](_[_0x8617('0x55')](_0x301790['query'],_0x4fe894['filters']));_0x5aef01[_0x8617('0x3a')][_0x8617('0x56')]=_0x2f271e['id'];if(_0x301790[_0x8617('0x30')][_0x8617('0x3b')]){_0x5aef01[_0x8617('0x3a')]=_[_0x8617('0x3d')](_0x5aef01[_0x8617('0x3a')],{'$or':_['map'](_0x5aef01[_0x8617('0x34')],function(_0x24449b){var _0x157163={};_0x157163[_0x24449b]={'$like':'%'+_0x301790[_0x8617('0x30')]['filter']+'%'};return _0x157163;})});}_0x5aef01=_[_0x8617('0x3d')]({},_0x5aef01,_0x301790[_0x8617('0x3e')]);return db['JscriptySessionReport'][_0x8617('0x19')]({'where':_0x5aef01[_0x8617('0x3a')]})[_0x8617('0x22')](function(_0x12da5c){_0x8e9c9c['count']=_0x12da5c;if(_0x301790[_0x8617('0x30')]['includeAll']){_0x5aef01[_0x8617('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x8617('0x57')](_0x5aef01);})[_0x8617('0x22')](function(_0x38b376){_0x8e9c9c[_0x8617('0x41')]=_0x38b376;return _0x8e9c9c;});}})['then'](respondWithFilteredResult(_0x4177d2,_0x5aef01))[_0x8617('0x43')](handleError(_0x4177d2,null));};exports['getAnswers']=function(_0x21f173,_0x1de665,_0x2b7e8d){var _0x29274a={'raw':!![],'where':{}};var _0x424086={};var _0x546818={'count':0x0,'rows':[]};return db[_0x8617('0x2a')][_0x8617('0x52')]({'where':{'id':_0x21f173[_0x8617('0x42')]['id']}})[_0x8617('0x22')](handleEntityNotFound(_0x1de665,null))[_0x8617('0x22')](function(_0x2a2eae){if(_0x2a2eae){_0x424086[_0x8617('0x2e')]=_[_0x8617('0x31')](db[_0x8617('0x58')]['rawAttributes']);_0x424086[_0x8617('0x30')]=_[_0x8617('0x31')](_0x21f173[_0x8617('0x30')]);_0x424086[_0x8617('0x32')]=_[_0x8617('0x33')](_0x424086['model'],_0x424086[_0x8617('0x30')]);_0x29274a[_0x8617('0x34')]=_[_0x8617('0x33')](_0x424086[_0x8617('0x2e')],qs[_0x8617('0x35')](_0x21f173['query'][_0x8617('0x35')]));_0x29274a['attributes']=_0x29274a[_0x8617('0x34')][_0x8617('0x36')]?_0x29274a['attributes']:_0x424086['model'];if(!_0x21f173[_0x8617('0x30')][_0x8617('0x37')](_0x8617('0x38'))){_0x29274a[_0x8617('0x1b')]=qs['limit'](_0x21f173[_0x8617('0x30')][_0x8617('0x1b')]);_0x29274a[_0x8617('0x1a')]=qs[_0x8617('0x1a')](_0x21f173['query']['offset']);}_0x29274a['order']=qs[_0x8617('0x39')](_0x21f173[_0x8617('0x30')][_0x8617('0x39')]);_0x29274a['where']=qs[_0x8617('0x32')](_[_0x8617('0x55')](_0x21f173[_0x8617('0x30')],_0x424086['filters']));_0x29274a['where'][_0x8617('0x56')]=_0x2a2eae['id'];if(_0x21f173['query']['filter']){_0x29274a['where']=_['merge'](_0x29274a[_0x8617('0x3a')],{'$or':_[_0x8617('0x29')](_0x29274a[_0x8617('0x34')],function(_0x2f98a6){var _0x13928c={};_0x13928c[_0x2f98a6]={'$like':'%'+_0x21f173['query'][_0x8617('0x3b')]+'%'};return _0x13928c;})});}_0x29274a=_[_0x8617('0x3d')]({},_0x29274a,_0x21f173[_0x8617('0x3e')]);return db['JscriptyAnswerReport'][_0x8617('0x19')]({'where':_0x29274a[_0x8617('0x3a')]})[_0x8617('0x22')](function(_0x1eb14b){_0x546818['count']=_0x1eb14b;if(_0x21f173[_0x8617('0x30')]['includeAll']){_0x29274a['include']=[{'all':!![]}];}return db[_0x8617('0x58')]['findAll'](_0x29274a);})[_0x8617('0x22')](function(_0x13ff98){_0x546818[_0x8617('0x41')]=_0x13ff98;return _0x546818;});}})[_0x8617('0x22')](respondWithFilteredResult(_0x1de665,_0x29274a))[_0x8617('0x43')](handleError(_0x1de665,null));};function char(_0x3bfd53){return _0x8617('0x59')===typeof _0x3bfd53?String[_0x8617('0x5a')]['apply'](null,arguments):_0x3bfd53;}function needsEncapsulation(_0x11606a){return!!_0x11606a&&(_0x11606a[_0x8617('0x5b')]()[_0x8617('0x5c')](char(0xd))>=0x0||_0x11606a[_0x8617('0x5b')]()['indexOf'](char(0xa))>=0x0||_0x11606a['toString']()[_0x8617('0x5c')](char(0x2c))>=0x0||_0x11606a['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x589fc7){var _0x557896=char(0x22),_0xfa125='\x5c'+char(0x22),_0x86e138=_0x589fc7[_0x8617('0x5b')]()[_0x8617('0x5d')](new RegExp(_0x557896,'g'),_0xfa125);return _0x557896+_0x86e138+_0x557896;}exports[_0x8617('0x5e')]=function(_0x45a8d2,_0xde966c,_0x1fca90){var _0x3cdbf4,_0x27e4f5;var _0x264fb7={'where':{'ProjectId':_0x45a8d2[_0x8617('0x42')]['id']}};if(_0x45a8d2[_0x8617('0x30')]['startTime']){_0x264fb7[_0x8617('0x3a')][_0x8617('0x5f')]=JSON[_0x8617('0x60')](_0x45a8d2[_0x8617('0x30')][_0x8617('0x61')]);}return db[_0x8617('0x53')]['findAll'](_0x264fb7)[_0x8617('0x22')](handleEntityNotFound(_0xde966c,null))['then'](function(_0x251bcc){if(_0x251bcc){_0x3cdbf4=_0x251bcc;return db[_0x8617('0x62')][_0x8617('0x57')]({'where':{'SessionId':{'$in':_[_0x8617('0x29')](_0x3cdbf4,'id')},'ProjectId':_0x45a8d2[_0x8617('0x42')]['id']},'order':_0x8617('0x63')});}})[_0x8617('0x22')](handleEntityNotFound(_0xde966c,null))['then'](function(_0x20358d){if(_0x20358d){_0x27e4f5=_0x20358d;var _0x38154b={};for(var _0x87be6a=0x0,_0x58329c=_0x27e4f5[_0x8617('0x36')];_0x87be6a<_0x58329c;_0x87be6a++){if(!_0x38154b[_0x8617('0x37')](_0x27e4f5[_0x87be6a]['questionId'])){_0x38154b[_0x27e4f5[_0x87be6a]['questionId']]=needsEncapsulation(_0x27e4f5[_0x87be6a][_0x8617('0x64')])?encapsulate(_0x27e4f5[_0x87be6a][_0x8617('0x64')]):_0x27e4f5[_0x87be6a][_0x8617('0x64')];}}var _0x327e5b=[],_0x95ceaa={};for(var _0xef6654=0x0,_0x3cec60=_0x3cdbf4[_0x8617('0x36')];_0xef6654<_0x3cec60;_0xef6654++){_0x95ceaa={'ProjectId':_0x45a8d2[_0x8617('0x42')]['id'],'SessionId':_0x3cdbf4[_0xef6654]['id'],'StartTime':moment(_0x3cdbf4[_0xef6654]['starttime'])[_0x8617('0x65')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x5b9e66=0x0,_0x80d679=_0x27e4f5['length'];_0x5b9e66<_0x80d679;_0x5b9e66++){if(_0x27e4f5[_0x5b9e66][_0x8617('0x66')]==_0x3cdbf4[_0xef6654]['id']&&_0x38154b['hasOwnProperty'](_0x27e4f5[_0x5b9e66][_0x8617('0x67')])){_0x95ceaa[_0x38154b[_0x27e4f5[_0x5b9e66][_0x8617('0x67')]]]=_0x27e4f5[_0x5b9e66][_0x8617('0x68')];}}for(var _0x34e97e in _0x38154b){if(!_0x95ceaa['hasOwnProperty'](_0x38154b[_0x34e97e])){_0x95ceaa[_0x38154b[_0x34e97e]]=null;}}_0x327e5b[_0x8617('0x69')](_0x95ceaa);}return _0x327e5b;}})[_0x8617('0x22')](function(_0x4eba2a){if(!_[_0x8617('0x6a')](_0x4eba2a)){var _0x5182e1=toCsv(_0x4eba2a);var _0x59fb16=Date[_0x8617('0x6b')]();fs[_0x8617('0x6c')](util[_0x8617('0x65')](_0x8617('0x6d'),_0x45a8d2[_0x8617('0x42')]['id'],_0x59fb16),_0x5182e1);_0xde966c[_0x8617('0x6e')]('Content-disposition',_0x8617('0x6f')+util[_0x8617('0x65')](_0x8617('0x70'),_0x45a8d2[_0x8617('0x42')]['id'],_0x59fb16));_0xde966c[_0x8617('0x6e')](_0x8617('0x71'),'text/csv');return _0xde966c[_0x8617('0x72')](util['format'](_0x8617('0x6d'),_0x45a8d2[_0x8617('0x42')]['id'],_0x59fb16));}else{return _0xde966c[_0x8617('0x25')](0xcc);}})[_0x8617('0x43')](handleError(_0xde966c,null));};
\ No newline at end of file
+var _0x5d91=['error','stack','name','send','index','map','JscriptyProject','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','createdAt','userProfileId','autoAssociation','getSessions','findOne','JscriptySessionReport','ProjectId','findAll','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','questionId','question','starttime','format','answer','push','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource'];(function(_0x56968c,_0x1e4877){var _0x3e3524=function(_0x3374c2){while(--_0x3374c2){_0x56968c['push'](_0x56968c['shift']());}};_0x3e3524(++_0x1e4877);}(_0x5d91,0x1a4));var _0x15d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d91[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x15d9('0x0'));var rimraf=require(_0x15d9('0x1'));var zipdir=require(_0x15d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x15d9('0x3'));var moment=require('moment');var BPromise=require(_0x15d9('0x4'));var Mustache=require(_0x15d9('0x5'));var util=require(_0x15d9('0x6'));var path=require('path');var sox=require(_0x15d9('0x7'));var csv=require(_0x15d9('0x8'));var ejs=require(_0x15d9('0x9'));var fs=require('fs');var _=require(_0x15d9('0xa'));var squel=require(_0x15d9('0xb'));var crypto=require('crypto');var jsforce=require(_0x15d9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x15d9('0x8'));var querystring=require(_0x15d9('0xd'));var Papa=require(_0x15d9('0xe'));var Redis=require(_0x15d9('0xf'));var authService=require(_0x15d9('0x10'));var qs=require(_0x15d9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15d9('0x12'));var logger=require(_0x15d9('0x13'))('api');var utils=require(_0x15d9('0x14'));var config=require(_0x15d9('0x15'));var db=require(_0x15d9('0x16'))['db'];function respondWithStatusCode(_0x4fce71,_0x19b7fb){_0x19b7fb=_0x19b7fb||0xcc;return function(_0x26080e){if(_0x26080e){return _0x4fce71[_0x15d9('0x17')](_0x19b7fb);}return _0x4fce71[_0x15d9('0x18')](_0x19b7fb)[_0x15d9('0x19')]();};}function respondWithResult(_0xdc3274,_0x3bbd88){_0x3bbd88=_0x3bbd88||0xc8;return function(_0x2647e5){if(_0x2647e5){return _0xdc3274['status'](_0x3bbd88)[_0x15d9('0x1a')](_0x2647e5);}};}function respondWithFilteredResult(_0x503cc7,_0x5e084b){return function(_0x61fdf){if(_0x61fdf){var _0x5336bf=_0x61fdf[_0x15d9('0x1b')],_0x18e192=_0x5e084b[_0x15d9('0x1c')],_0x110126=_0x5e084b['offset']+_0x5e084b[_0x15d9('0x1d')],_0x3093a1;if(_0x110126>=_0x5336bf){_0x110126=_0x5336bf;_0x3093a1=0xc8;}else{_0x3093a1=0xce;}_0x503cc7[_0x15d9('0x18')](_0x3093a1);return _0x503cc7[_0x15d9('0x1e')](_0x15d9('0x1f'),_0x18e192+'-'+_0x110126+'/'+_0x5336bf)[_0x15d9('0x1a')](_0x61fdf);}return null;};}function patchUpdates(_0x43566b){return function(_0x1439bb){try{jsonpatch[_0x15d9('0x20')](_0x1439bb,_0x43566b,!![]);}catch(_0x399072){return BPromise[_0x15d9('0x21')](_0x399072);}return _0x1439bb[_0x15d9('0x22')]();};}function saveUpdates(_0x1760c9,_0x195e0a){return function(_0x2a5860){if(_0x2a5860){return _0x2a5860[_0x15d9('0x23')](_0x1760c9)[_0x15d9('0x24')](function(_0x350aa6){return _0x350aa6;});}return null;};}function removeEntity(_0x5b7717,_0x19d15d){return function(_0x3ae2b1){if(_0x3ae2b1){return _0x3ae2b1[_0x15d9('0x25')]()[_0x15d9('0x24')](function(){var _0x3f3465=_0x3ae2b1[_0x15d9('0x26')]({'plain':!![]});var _0xd863e6='Projects';return db[_0x15d9('0x27')][_0x15d9('0x25')]({'where':{'type':_0xd863e6,'resourceId':_0x3f3465['id']}})[_0x15d9('0x24')](function(){return _0x3ae2b1;});})[_0x15d9('0x24')](function(){_0x5b7717[_0x15d9('0x18')](0xcc)[_0x15d9('0x19')]();});}};}function handleEntityNotFound(_0x1addb3,_0x2c9fa2){return function(_0x546202){if(!_0x546202){_0x1addb3[_0x15d9('0x17')](0x194);}return _0x546202;};}function handleError(_0x205667,_0x31e890){_0x31e890=_0x31e890||0x1f4;return function(_0x19a2cb){logger[_0x15d9('0x28')](_0x19a2cb[_0x15d9('0x29')]);if(_0x19a2cb[_0x15d9('0x2a')]){delete _0x19a2cb[_0x15d9('0x2a')];}_0x205667[_0x15d9('0x18')](_0x31e890)[_0x15d9('0x2b')](_0x19a2cb);};}exports[_0x15d9('0x2c')]=function(_0x34f8bd,_0x1fbac3){var _0x53e279={},_0x42de3e={},_0x415084={'count':0x0,'rows':[]};var _0x5bddc8=_[_0x15d9('0x2d')](db[_0x15d9('0x2e')][_0x15d9('0x2f')],function(_0x343ccf){return{'name':_0x343ccf['fieldName'],'type':_0x343ccf['type'][_0x15d9('0x30')]};});_0x42de3e['model']=_[_0x15d9('0x2d')](_0x5bddc8,'name');_0x42de3e[_0x15d9('0x31')]=_[_0x15d9('0x32')](_0x34f8bd[_0x15d9('0x31')]);_0x42de3e[_0x15d9('0x33')]=_[_0x15d9('0x34')](_0x42de3e[_0x15d9('0x35')],_0x42de3e[_0x15d9('0x31')]);_0x53e279['attributes']=_[_0x15d9('0x34')](_0x42de3e['model'],qs[_0x15d9('0x36')](_0x34f8bd['query'][_0x15d9('0x36')]));_0x53e279[_0x15d9('0x37')]=_0x53e279[_0x15d9('0x37')][_0x15d9('0x38')]?_0x53e279['attributes']:_0x42de3e[_0x15d9('0x35')];if(!_0x34f8bd[_0x15d9('0x31')][_0x15d9('0x39')](_0x15d9('0x3a'))){_0x53e279['limit']=qs[_0x15d9('0x1d')](_0x34f8bd['query'][_0x15d9('0x1d')]);_0x53e279[_0x15d9('0x1c')]=qs[_0x15d9('0x1c')](_0x34f8bd['query'][_0x15d9('0x1c')]);}_0x53e279[_0x15d9('0x3b')]=qs[_0x15d9('0x3c')](_0x34f8bd[_0x15d9('0x31')][_0x15d9('0x3c')]);_0x53e279[_0x15d9('0x3d')]=qs['filters'](_[_0x15d9('0x3e')](_0x34f8bd[_0x15d9('0x31')],_0x42de3e['filters']),_0x5bddc8);if(_0x34f8bd[_0x15d9('0x31')][_0x15d9('0x3f')]){_0x53e279[_0x15d9('0x3d')]=_[_0x15d9('0x40')](_0x53e279[_0x15d9('0x3d')],{'$or':_['map'](_0x5bddc8,function(_0x4297a3){if(_0x4297a3[_0x15d9('0x41')]!==_0x15d9('0x42')){var _0x271b3c={};_0x271b3c[_0x4297a3['name']]={'$like':'%'+_0x34f8bd[_0x15d9('0x31')][_0x15d9('0x3f')]+'%'};return _0x271b3c;}})});}_0x53e279=_['merge']({},_0x53e279,_0x34f8bd[_0x15d9('0x43')]);var _0x4d7a90={'where':_0x53e279[_0x15d9('0x3d')]};return db[_0x15d9('0x2e')][_0x15d9('0x1b')](_0x4d7a90)[_0x15d9('0x24')](function(_0x24e923){_0x415084[_0x15d9('0x1b')]=_0x24e923;if(_0x34f8bd[_0x15d9('0x31')]['includeAll']){_0x53e279[_0x15d9('0x44')]=[{'all':!![]}];}return db[_0x15d9('0x2e')]['findAll'](_0x53e279);})[_0x15d9('0x24')](function(_0x1c0442){_0x415084[_0x15d9('0x45')]=_0x1c0442;return _0x415084;})['then'](respondWithFilteredResult(_0x1fbac3,_0x53e279))[_0x15d9('0x46')](handleError(_0x1fbac3,null));};exports[_0x15d9('0x47')]=function(_0x533104,_0x52dd20){var _0x20f4cf={'raw':![],'where':{'id':_0x533104[_0x15d9('0x48')]['id']}},_0x5ec88e={};_0x5ec88e[_0x15d9('0x35')]=_['keys'](db['JscriptyProject'][_0x15d9('0x2f')]);_0x5ec88e[_0x15d9('0x31')]=_['keys'](_0x533104['query']);_0x5ec88e[_0x15d9('0x33')]=_['intersection'](_0x5ec88e[_0x15d9('0x35')],_0x5ec88e[_0x15d9('0x31')]);_0x20f4cf['attributes']=_[_0x15d9('0x34')](_0x5ec88e['model'],qs[_0x15d9('0x36')](_0x533104[_0x15d9('0x31')][_0x15d9('0x36')]));_0x20f4cf[_0x15d9('0x37')]=_0x20f4cf['attributes'][_0x15d9('0x38')]?_0x20f4cf[_0x15d9('0x37')]:_0x5ec88e[_0x15d9('0x35')];if(_0x533104[_0x15d9('0x31')][_0x15d9('0x49')]){_0x20f4cf['include']=[{'all':!![]}];}_0x20f4cf=_['merge']({},_0x20f4cf,_0x533104[_0x15d9('0x43')]);return db[_0x15d9('0x2e')][_0x15d9('0x4a')](_0x20f4cf)['then'](handleEntityNotFound(_0x52dd20,null))[_0x15d9('0x24')](respondWithResult(_0x52dd20,null))[_0x15d9('0x46')](handleError(_0x52dd20,null));};exports[_0x15d9('0x4b')]=function(_0x222bee,_0x42ffe1){return db['JscriptyProject']['create'](_0x222bee['body'],{})[_0x15d9('0x24')](function(_0xf76a7a){var _0x357be7=_0x222bee[_0x15d9('0x4c')][_0x15d9('0x26')]({'plain':!![]});if(!_0x357be7)throw new Error(_0x15d9('0x4d'));if(_0x357be7[_0x15d9('0x4e')]===_0x15d9('0x4c')){var _0x5c4ac2=_0xf76a7a[_0x15d9('0x26')]({'plain':!![]});var _0x191c53=_0x15d9('0x4f');return db['UserProfileSection'][_0x15d9('0x4a')]({'where':{'name':_0x191c53,'userProfileId':_0x357be7['userProfileId']},'raw':!![]})[_0x15d9('0x24')](function(_0x20498f){if(_0x20498f&&_0x20498f['autoAssociation']===0x0){return db['UserProfileResource'][_0x15d9('0x4b')]({'name':_0x5c4ac2['name'],'resourceId':_0x5c4ac2['id'],'type':_0x20498f[_0x15d9('0x2a')],'sectionId':_0x20498f['id']},{})[_0x15d9('0x24')](function(){return _0xf76a7a;});}else{return _0xf76a7a;}})[_0x15d9('0x46')](function(_0x481831){logger[_0x15d9('0x28')](_0x15d9('0x50'),_0x481831);throw _0x481831;});}return _0xf76a7a;})[_0x15d9('0x24')](respondWithResult(_0x42ffe1,0xc9))[_0x15d9('0x46')](handleError(_0x42ffe1,null));};exports['clone']=function(_0x40f171,_0x58f415){var _0xa339d3={'where':{'id':_0x40f171[_0x15d9('0x48')]['id']}},_0x1dc210={};_0x1dc210[_0x15d9('0x35')]=_[_0x15d9('0x32')](db['JscriptyProject'][_0x15d9('0x2f')]);_0xa339d3[_0x15d9('0x37')]=_[_0x15d9('0x34')](_0x1dc210[_0x15d9('0x35')],qs[_0x15d9('0x36')](_0x40f171[_0x15d9('0x31')][_0x15d9('0x36')]));_0xa339d3['attributes']=_0xa339d3[_0x15d9('0x37')][_0x15d9('0x38')]?_0xa339d3[_0x15d9('0x37')]:_0x1dc210['model'];if(_0x40f171[_0x15d9('0x31')][_0x15d9('0x49')]){_0xa339d3[_0x15d9('0x44')]=[{'all':!![]}];}_0xa339d3=_['merge']({},_0xa339d3,_0x40f171['options']);return db[_0x15d9('0x2e')][_0x15d9('0x4a')](_0xa339d3)[_0x15d9('0x24')](handleEntityNotFound(_0x58f415,null))['then'](function(_0x47d437){if(_0x47d437){var _0x1d7096=_0x47d437[_0x15d9('0x26')]({'plain':!![]});_0x1d7096=qs[_0x15d9('0x51')](_0x1d7096,['id','createdAt',_0x15d9('0x52')]);_0x40f171[_0x15d9('0x53')]=_[_0x15d9('0x51')](_0x40f171[_0x15d9('0x53')],['id',_0x15d9('0x54'),_0x15d9('0x52')]);return db['JscriptyProject']['create'](_[_0x15d9('0x40')](_0x1d7096,_0x40f171[_0x15d9('0x53')]),{'include':_0x40f171[_0x15d9('0x31')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x42155e){var _0x375a3a=_0x40f171['user'][_0x15d9('0x26')]({'plain':!![]});if(!_0x375a3a)throw new Error(_0x15d9('0x4d'));if(_0x375a3a[_0x15d9('0x4e')]===_0x15d9('0x4c')){var _0x2324e5=_0x42155e[_0x15d9('0x26')]({'plain':!![]});var _0x5e6d25='Projects';return db['UserProfileSection'][_0x15d9('0x4a')]({'where':{'name':_0x5e6d25,'userProfileId':_0x375a3a[_0x15d9('0x55')]},'raw':!![]})[_0x15d9('0x24')](function(_0x3e8d68){if(_0x3e8d68&&_0x3e8d68[_0x15d9('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x2324e5[_0x15d9('0x2a')],'resourceId':_0x2324e5['id'],'type':_0x3e8d68['name'],'sectionId':_0x3e8d68['id']},{})['then'](function(){return _0x42155e;});}else{return _0x42155e;}})[_0x15d9('0x46')](function(_0x1b1b54){logger[_0x15d9('0x28')](_0x15d9('0x50'),_0x1b1b54);throw _0x1b1b54;});}return _0x42155e;});}})[_0x15d9('0x24')](respondWithResult(_0x58f415,0xc9))[_0x15d9('0x46')](handleError(_0x58f415,null));};exports[_0x15d9('0x23')]=function(_0x48e5fb,_0x2db066){if(_0x48e5fb[_0x15d9('0x53')]['id']){delete _0x48e5fb['body']['id'];}return db[_0x15d9('0x2e')][_0x15d9('0x4a')]({'where':{'id':_0x48e5fb['params']['id']}})[_0x15d9('0x24')](handleEntityNotFound(_0x2db066,null))[_0x15d9('0x24')](saveUpdates(_0x48e5fb[_0x15d9('0x53')],null))[_0x15d9('0x24')](respondWithResult(_0x2db066,null))[_0x15d9('0x46')](handleError(_0x2db066,null));};exports[_0x15d9('0x25')]=function(_0x5aa5d2,_0x560ea7){return db[_0x15d9('0x2e')][_0x15d9('0x4a')]({'where':{'id':_0x5aa5d2[_0x15d9('0x48')]['id']}})['then'](handleEntityNotFound(_0x560ea7,null))[_0x15d9('0x24')](removeEntity(_0x560ea7,null))[_0x15d9('0x46')](handleError(_0x560ea7,null));};exports[_0x15d9('0x57')]=function(_0x24adce,_0x316e92,_0x42e6d4){var _0x440812={'raw':!![],'where':{}};var _0x5daece={};var _0x57b0ce={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x15d9('0x58')]({'where':{'id':_0x24adce[_0x15d9('0x48')]['id']}})[_0x15d9('0x24')](handleEntityNotFound(_0x316e92,null))['then'](function(_0x12236c){if(_0x12236c){_0x5daece[_0x15d9('0x35')]=_[_0x15d9('0x32')](db[_0x15d9('0x59')][_0x15d9('0x2f')]);_0x5daece['query']=_['keys'](_0x24adce[_0x15d9('0x31')]);_0x5daece[_0x15d9('0x33')]=_[_0x15d9('0x34')](_0x5daece[_0x15d9('0x35')],_0x5daece[_0x15d9('0x31')]);_0x440812['attributes']=_['intersection'](_0x5daece[_0x15d9('0x35')],qs[_0x15d9('0x36')](_0x24adce[_0x15d9('0x31')]['fields']));_0x440812[_0x15d9('0x37')]=_0x440812['attributes']['length']?_0x440812['attributes']:_0x5daece[_0x15d9('0x35')];if(!_0x24adce[_0x15d9('0x31')]['hasOwnProperty'](_0x15d9('0x3a'))){_0x440812[_0x15d9('0x1d')]=qs[_0x15d9('0x1d')](_0x24adce['query'][_0x15d9('0x1d')]);_0x440812[_0x15d9('0x1c')]=qs[_0x15d9('0x1c')](_0x24adce[_0x15d9('0x31')][_0x15d9('0x1c')]);}_0x440812[_0x15d9('0x3b')]=qs['sort'](_0x24adce['query'][_0x15d9('0x3c')]);_0x440812[_0x15d9('0x3d')]=qs[_0x15d9('0x33')](_[_0x15d9('0x3e')](_0x24adce[_0x15d9('0x31')],_0x5daece['filters']));_0x440812[_0x15d9('0x3d')][_0x15d9('0x5a')]=_0x12236c['id'];if(_0x24adce[_0x15d9('0x31')][_0x15d9('0x3f')]){_0x440812[_0x15d9('0x3d')]=_[_0x15d9('0x40')](_0x440812[_0x15d9('0x3d')],{'$or':_['map'](_0x440812['attributes'],function(_0x278d17){var _0x2c1d08={};_0x2c1d08[_0x278d17]={'$like':'%'+_0x24adce[_0x15d9('0x31')][_0x15d9('0x3f')]+'%'};return _0x2c1d08;})});}_0x440812=_[_0x15d9('0x40')]({},_0x440812,_0x24adce[_0x15d9('0x43')]);return db['JscriptySessionReport']['count']({'where':_0x440812[_0x15d9('0x3d')]})['then'](function(_0x385143){_0x57b0ce[_0x15d9('0x1b')]=_0x385143;if(_0x24adce[_0x15d9('0x31')][_0x15d9('0x49')]){_0x440812[_0x15d9('0x44')]=[{'all':!![]}];}return db[_0x15d9('0x59')][_0x15d9('0x5b')](_0x440812);})[_0x15d9('0x24')](function(_0x4a72be){_0x57b0ce[_0x15d9('0x45')]=_0x4a72be;return _0x57b0ce;});}})[_0x15d9('0x24')](respondWithFilteredResult(_0x316e92,_0x440812))[_0x15d9('0x46')](handleError(_0x316e92,null));};exports['getAnswers']=function(_0x2129a7,_0x4d0dc8,_0x1e053c){var _0x230dd1={'raw':!![],'where':{}};var _0x35be03={};var _0xdc3eb7={'count':0x0,'rows':[]};return db[_0x15d9('0x2e')][_0x15d9('0x58')]({'where':{'id':_0x2129a7[_0x15d9('0x48')]['id']}})[_0x15d9('0x24')](handleEntityNotFound(_0x4d0dc8,null))[_0x15d9('0x24')](function(_0x5c0e3c){if(_0x5c0e3c){_0x35be03['model']=_[_0x15d9('0x32')](db[_0x15d9('0x5c')][_0x15d9('0x2f')]);_0x35be03[_0x15d9('0x31')]=_[_0x15d9('0x32')](_0x2129a7['query']);_0x35be03[_0x15d9('0x33')]=_['intersection'](_0x35be03['model'],_0x35be03['query']);_0x230dd1[_0x15d9('0x37')]=_['intersection'](_0x35be03[_0x15d9('0x35')],qs[_0x15d9('0x36')](_0x2129a7[_0x15d9('0x31')][_0x15d9('0x36')]));_0x230dd1['attributes']=_0x230dd1[_0x15d9('0x37')][_0x15d9('0x38')]?_0x230dd1[_0x15d9('0x37')]:_0x35be03['model'];if(!_0x2129a7['query'][_0x15d9('0x39')]('nolimit')){_0x230dd1['limit']=qs[_0x15d9('0x1d')](_0x2129a7['query']['limit']);_0x230dd1[_0x15d9('0x1c')]=qs[_0x15d9('0x1c')](_0x2129a7['query'][_0x15d9('0x1c')]);}_0x230dd1['order']=qs['sort'](_0x2129a7[_0x15d9('0x31')][_0x15d9('0x3c')]);_0x230dd1[_0x15d9('0x3d')]=qs[_0x15d9('0x33')](_['pick'](_0x2129a7[_0x15d9('0x31')],_0x35be03[_0x15d9('0x33')]));_0x230dd1['where'][_0x15d9('0x5a')]=_0x5c0e3c['id'];if(_0x2129a7[_0x15d9('0x31')][_0x15d9('0x3f')]){_0x230dd1[_0x15d9('0x3d')]=_[_0x15d9('0x40')](_0x230dd1['where'],{'$or':_[_0x15d9('0x2d')](_0x230dd1[_0x15d9('0x37')],function(_0xf9698a){var _0x8a3388={};_0x8a3388[_0xf9698a]={'$like':'%'+_0x2129a7[_0x15d9('0x31')][_0x15d9('0x3f')]+'%'};return _0x8a3388;})});}_0x230dd1=_[_0x15d9('0x40')]({},_0x230dd1,_0x2129a7[_0x15d9('0x43')]);return db['JscriptyAnswerReport'][_0x15d9('0x1b')]({'where':_0x230dd1[_0x15d9('0x3d')]})[_0x15d9('0x24')](function(_0x241a94){_0xdc3eb7[_0x15d9('0x1b')]=_0x241a94;if(_0x2129a7[_0x15d9('0x31')][_0x15d9('0x49')]){_0x230dd1[_0x15d9('0x44')]=[{'all':!![]}];}return db[_0x15d9('0x5c')]['findAll'](_0x230dd1);})['then'](function(_0x43c0b7){_0xdc3eb7[_0x15d9('0x45')]=_0x43c0b7;return _0xdc3eb7;});}})[_0x15d9('0x24')](respondWithFilteredResult(_0x4d0dc8,_0x230dd1))[_0x15d9('0x46')](handleError(_0x4d0dc8,null));};function char(_0x38f6bd){return _0x15d9('0x5d')===typeof _0x38f6bd?String[_0x15d9('0x5e')]['apply'](null,arguments):_0x38f6bd;}function needsEncapsulation(_0x4607a7){return!!_0x4607a7&&(_0x4607a7[_0x15d9('0x5f')]()[_0x15d9('0x60')](char(0xd))>=0x0||_0x4607a7[_0x15d9('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x4607a7[_0x15d9('0x5f')]()[_0x15d9('0x60')](char(0x2c))>=0x0||_0x4607a7['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x5a5928){var _0x321c85=char(0x22),_0x543a81='\x5c'+char(0x22),_0x28022e=_0x5a5928[_0x15d9('0x5f')]()[_0x15d9('0x61')](new RegExp(_0x321c85,'g'),_0x543a81);return _0x321c85+_0x28022e+_0x321c85;}exports[_0x15d9('0x62')]=function(_0x7ed5ce,_0x2b408a,_0x32f99d){var _0x57039d,_0x54fb00;var _0x306fdd={'where':{'ProjectId':_0x7ed5ce[_0x15d9('0x48')]['id']}};if(_0x7ed5ce[_0x15d9('0x31')][_0x15d9('0x63')]){_0x306fdd[_0x15d9('0x3d')]['starttime']=JSON[_0x15d9('0x64')](_0x7ed5ce[_0x15d9('0x31')][_0x15d9('0x63')]);}return db['JscriptySessionReport'][_0x15d9('0x5b')](_0x306fdd)[_0x15d9('0x24')](handleEntityNotFound(_0x2b408a,null))['then'](function(_0x4d94d9){if(_0x4d94d9){_0x57039d=_0x4d94d9;return db[_0x15d9('0x65')][_0x15d9('0x5b')]({'where':{'SessionId':{'$in':_[_0x15d9('0x2d')](_0x57039d,'id')},'ProjectId':_0x7ed5ce[_0x15d9('0x48')]['id']},'order':'-createdAt'});}})[_0x15d9('0x24')](handleEntityNotFound(_0x2b408a,null))[_0x15d9('0x24')](function(_0x58faf9){if(_0x58faf9){_0x54fb00=_0x58faf9;var _0x141ef0={};for(var _0xd5c5ae=0x0,_0x531129=_0x54fb00[_0x15d9('0x38')];_0xd5c5ae<_0x531129;_0xd5c5ae++){if(!_0x141ef0[_0x15d9('0x39')](_0x54fb00[_0xd5c5ae][_0x15d9('0x66')])){_0x141ef0[_0x54fb00[_0xd5c5ae]['questionId']]=needsEncapsulation(_0x54fb00[_0xd5c5ae][_0x15d9('0x67')])?encapsulate(_0x54fb00[_0xd5c5ae][_0x15d9('0x67')]):_0x54fb00[_0xd5c5ae][_0x15d9('0x67')];}}var _0x52c91f=[],_0x4196cb={};for(var _0x27dc63=0x0,_0x4f68f1=_0x57039d[_0x15d9('0x38')];_0x27dc63<_0x4f68f1;_0x27dc63++){_0x4196cb={'ProjectId':_0x7ed5ce['params']['id'],'SessionId':_0x57039d[_0x27dc63]['id'],'StartTime':moment(_0x57039d[_0x27dc63][_0x15d9('0x68')])[_0x15d9('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x491d99=0x0,_0x5ce179=_0x54fb00[_0x15d9('0x38')];_0x491d99<_0x5ce179;_0x491d99++){if(_0x54fb00[_0x491d99]['SessionId']==_0x57039d[_0x27dc63]['id']&&_0x141ef0[_0x15d9('0x39')](_0x54fb00[_0x491d99][_0x15d9('0x66')])){_0x4196cb[_0x141ef0[_0x54fb00[_0x491d99]['questionId']]]=_0x54fb00[_0x491d99][_0x15d9('0x6a')];}}for(var _0x7d7a25 in _0x141ef0){if(!_0x4196cb['hasOwnProperty'](_0x141ef0[_0x7d7a25])){_0x4196cb[_0x141ef0[_0x7d7a25]]=null;}}_0x52c91f[_0x15d9('0x6b')](_0x4196cb);}return _0x52c91f;}})[_0x15d9('0x24')](function(_0x2cbc43){if(!_['isEmpty'](_0x2cbc43)){var _0x3c3170=toCsv(_0x2cbc43);var _0x53cada=Date['now']();fs['writeFileSync'](util[_0x15d9('0x69')](_0x15d9('0x6c'),_0x7ed5ce[_0x15d9('0x48')]['id'],_0x53cada),_0x3c3170);_0x2b408a[_0x15d9('0x6d')](_0x15d9('0x6e'),_0x15d9('0x6f')+util[_0x15d9('0x69')](_0x15d9('0x70'),_0x7ed5ce[_0x15d9('0x48')]['id'],_0x53cada));_0x2b408a['setHeader'](_0x15d9('0x71'),'text/csv');return _0x2b408a[_0x15d9('0x72')](util[_0x15d9('0x69')](_0x15d9('0x6c'),_0x7ed5ce['params']['id'],_0x53cada));}else{return _0x2b408a[_0x15d9('0x17')](0xcc);}})[_0x15d9('0x46')](handleError(_0x2b408a,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js
index 19f8e90..287175b 100644
--- a/server/api/jscriptyProject/jscriptyProject.model.js
+++ b/server/api/jscriptyProject/jscriptyProject.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc29c=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment'];(function(_0x3e5d09,_0x36a139){var _0x47d1e=function(_0x4bd133){while(--_0x4bd133){_0x3e5d09['push'](_0x3e5d09['shift']());}};_0x47d1e(++_0x36a139);}(_0xc29c,0x105));var _0xcc29=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0xc29c[_0x5a187b];return _0x14d601;};'use strict';var _=require(_0xcc29('0x0'));var util=require(_0xcc29('0x1'));var logger=require(_0xcc29('0x2'))(_0xcc29('0x3'));var moment=require(_0xcc29('0x4'));var BPromise=require(_0xcc29('0x5'));var rp=require(_0xcc29('0x6'));var fs=require('fs');var path=require(_0xcc29('0x7'));var rimraf=require(_0xcc29('0x8'));var config=require(_0xcc29('0x9'));var attributes=require(_0xcc29('0xa'));module[_0xcc29('0xb')]=function(_0x10f8c4,_0x30f43a){return _0x10f8c4['define'](_0xcc29('0xc'),attributes,{'tableName':_0xcc29('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x374a=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject'];(function(_0x474b13,_0x59597e){var _0x58c18a=function(_0x3a9dce){while(--_0x3a9dce){_0x474b13['push'](_0x474b13['shift']());}};_0x58c18a(++_0x59597e);}(_0x374a,0x122));var _0xa374=function(_0x257ef4,_0x56ee58){_0x257ef4=_0x257ef4-0x0;var _0x315c7f=_0x374a[_0x257ef4];return _0x315c7f;};'use strict';var _=require(_0xa374('0x0'));var util=require('util');var logger=require(_0xa374('0x1'))('api');var moment=require(_0xa374('0x2'));var BPromise=require(_0xa374('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa374('0x4'));var rimraf=require(_0xa374('0x5'));var config=require(_0xa374('0x6'));var attributes=require(_0xa374('0x7'));module[_0xa374('0x8')]=function(_0x3f4382,_0x57885c){return _0x3f4382['define'](_0xa374('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js
index cc65ac9..2b8eea6 100644
--- a/server/api/jscriptyProject/jscriptyProject.rpc.js
+++ b/server/api/jscriptyProject/jscriptyProject.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f22=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','JscriptyProject,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x7f22,0x1ba));var _0x27f2=function(_0x5ed0e7,_0x3cb09c){_0x5ed0e7=_0x5ed0e7-0x0;var _0xd29408=_0x7f22[_0x5ed0e7];return _0xd29408;};'use strict';var _=require(_0x27f2('0x0'));var util=require(_0x27f2('0x1'));var moment=require(_0x27f2('0x2'));var BPromise=require(_0x27f2('0x3'));var rs=require(_0x27f2('0x4'));var fs=require('fs');var Redis=require(_0x27f2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x27f2('0x6'));var logger=require(_0x27f2('0x7'))(_0x27f2('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x27f2('0x9')][_0x27f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5eb568,_0x9b6d4e,_0x5da1fb){return new BPromise(function(_0x465364,_0x51cefc){return client[_0x27f2('0xb')](_0x5eb568,_0x5da1fb)[_0x27f2('0xc')](function(_0x6850a0){logger['info'](_0x27f2('0xd'),_0x9b6d4e,'request\x20sent');logger['debug']('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x9b6d4e,_0x27f2('0xe'),JSON[_0x27f2('0xf')](_0x6850a0));if(_0x6850a0['error']){if(_0x6850a0[_0x27f2('0x10')]['code']===0x1f4){logger[_0x27f2('0x10')](_0x27f2('0xd'),_0x9b6d4e,_0x6850a0[_0x27f2('0x10')][_0x27f2('0x11')]);return _0x51cefc(_0x6850a0[_0x27f2('0x10')][_0x27f2('0x11')]);}logger[_0x27f2('0x10')](_0x27f2('0xd'),_0x9b6d4e,_0x6850a0[_0x27f2('0x10')]['message']);return _0x465364(_0x6850a0[_0x27f2('0x10')]['message']);}else{logger[_0x27f2('0x12')](_0x27f2('0xd'),_0x9b6d4e,_0x27f2('0xe'));_0x465364(_0x6850a0[_0x27f2('0x13')][_0x27f2('0x11')]);}})[_0x27f2('0x14')](function(_0x16b40c){logger[_0x27f2('0x10')](_0x27f2('0xd'),_0x9b6d4e,_0x16b40c);_0x51cefc(_0x16b40c);});});}
\ No newline at end of file
+var _0x9c01=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xf75187,_0x398958){var _0x295303=function(_0x495970){while(--_0x495970){_0xf75187['push'](_0xf75187['shift']());}};_0x295303(++_0x398958);}(_0x9c01,0x10e));var _0x19c0=function(_0x5c7217,_0x32f7aa){_0x5c7217=_0x5c7217-0x0;var _0x4608a2=_0x9c01[_0x5c7217];return _0x4608a2;};'use strict';var _=require(_0x19c0('0x0'));var util=require('util');var moment=require(_0x19c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x19c0('0x2'));var fs=require('fs');var Redis=require(_0x19c0('0x3'));var db=require(_0x19c0('0x4'))['db'];var utils=require(_0x19c0('0x5'));var logger=require(_0x19c0('0x6'))(_0x19c0('0x7'));var config=require(_0x19c0('0x8'));var jayson=require(_0x19c0('0x9'));var client=jayson[_0x19c0('0xa')][_0x19c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d7bd9,_0x1bcfaf,_0x29a34a){return new BPromise(function(_0x5ecc39,_0x146050){return client['request'](_0x3d7bd9,_0x29a34a)[_0x19c0('0xc')](function(_0x41b8b8){logger[_0x19c0('0xd')](_0x19c0('0xe'),_0x1bcfaf,_0x19c0('0xf'));logger['debug'](_0x19c0('0x10'),_0x1bcfaf,_0x19c0('0xf'),JSON[_0x19c0('0x11')](_0x41b8b8));if(_0x41b8b8[_0x19c0('0x12')]){if(_0x41b8b8[_0x19c0('0x12')][_0x19c0('0x13')]===0x1f4){logger[_0x19c0('0x12')](_0x19c0('0xe'),_0x1bcfaf,_0x41b8b8['error'][_0x19c0('0x14')]);return _0x146050(_0x41b8b8['error'][_0x19c0('0x14')]);}logger[_0x19c0('0x12')](_0x19c0('0xe'),_0x1bcfaf,_0x41b8b8[_0x19c0('0x12')][_0x19c0('0x14')]);return _0x5ecc39(_0x41b8b8[_0x19c0('0x12')][_0x19c0('0x14')]);}else{logger[_0x19c0('0xd')](_0x19c0('0xe'),_0x1bcfaf,'request\x20sent');_0x5ecc39(_0x41b8b8[_0x19c0('0x15')]['message']);}})[_0x19c0('0x16')](function(_0x3789dc){logger[_0x19c0('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x1bcfaf,_0x3789dc);_0x146050(_0x3789dc);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js
index 12efbf6..577c5d7 100644
--- a/server/api/jscriptyQuestionReport/index.js
+++ b/server/api/jscriptyQuestionReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17f7=['create','update','delete','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x13219f,_0x13c6e7){var _0x387ee6=function(_0x255112){while(--_0x255112){_0x13219f['push'](_0x13219f['shift']());}};_0x387ee6(++_0x13c6e7);}(_0x17f7,0x16b));var _0x717f=function(_0x24b08a,_0x58c333){_0x24b08a=_0x24b08a-0x0;var _0x4a8b06=_0x17f7[_0x24b08a];return _0x4a8b06;};'use strict';var multer=require(_0x717f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x717f('0x1'));var express=require(_0x717f('0x2'));var router=express[_0x717f('0x3')]();var auth=require(_0x717f('0x4'));var interaction=require(_0x717f('0x5'));var config=require('../../config/environment');var controller=require(_0x717f('0x6'));router[_0x717f('0x7')]('/',auth[_0x717f('0x8')](),controller[_0x717f('0x9')]);router[_0x717f('0x7')](_0x717f('0xa'),auth['isAuthenticated'](),controller[_0x717f('0xb')]);router['get'](_0x717f('0xc'),auth[_0x717f('0x8')](),controller[_0x717f('0xd')]);router[_0x717f('0xe')]('/',auth[_0x717f('0x8')](),controller[_0x717f('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x717f('0x10')]);router[_0x717f('0x11')](_0x717f('0xc'),auth[_0x717f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3bba=['index','get','/describe','/:id','show','post','create','update','destroy','path','express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0x3bba,0x129));var _0xa3bb=function(_0x26dd8c,_0x53d877){_0x26dd8c=_0x26dd8c-0x0;var _0xa8cf74=_0x3bba[_0x26dd8c];return _0xa8cf74;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa3bb('0x0'));var timeout=require('connect-timeout');var express=require(_0xa3bb('0x1'));var router=express[_0xa3bb('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xa3bb('0x3'));var config=require(_0xa3bb('0x4'));var controller=require(_0xa3bb('0x5'));router['get']('/',auth[_0xa3bb('0x6')](),controller[_0xa3bb('0x7')]);router[_0xa3bb('0x8')](_0xa3bb('0x9'),auth[_0xa3bb('0x6')](),controller['describe']);router['get'](_0xa3bb('0xa'),auth[_0xa3bb('0x6')](),controller[_0xa3bb('0xb')]);router[_0xa3bb('0xc')]('/',auth[_0xa3bb('0x6')](),controller[_0xa3bb('0xd')]);router['put']('/:id',auth[_0xa3bb('0x6')](),controller[_0xa3bb('0xe')]);router['delete']('/:id',auth[_0xa3bb('0x6')](),controller[_0xa3bb('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
index dc2f166..806bd72 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc784=['exports','STRING','long','sequelize'];(function(_0x2f1339,_0x429823){var _0x2054c5=function(_0x3aeadb){while(--_0x3aeadb){_0x2f1339['push'](_0x2f1339['shift']());}};_0x2054c5(++_0x429823);}(_0xc784,0x1e3));var _0x4c78=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0xc784[_0x281e5e];return _0x5a22d2;};'use strict';var Sequelize=require(_0x4c78('0x0'));module[_0x4c78('0x1')]={'question':{'type':Sequelize[_0x4c78('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x4c78('0x3'))},'membername':{'type':Sequelize[_0x4c78('0x2')]},'projectname':{'type':Sequelize[_0x4c78('0x2')]},'queue':{'type':Sequelize[_0x4c78('0x2')]},'uniqueid':{'type':Sequelize[_0x4c78('0x2')]},'calleridname':{'type':Sequelize[_0x4c78('0x2')]},'calleridnum':{'type':Sequelize[_0x4c78('0x2')]},'questionId':{'type':Sequelize[_0x4c78('0x2')]}};
\ No newline at end of file
+var _0x65c5=['exports','STRING','TEXT','long','sequelize'];(function(_0x17960b,_0x5a0690){var _0x493ee9=function(_0x1797c5){while(--_0x1797c5){_0x17960b['push'](_0x17960b['shift']());}};_0x493ee9(++_0x5a0690);}(_0x65c5,0x176));var _0x565c=function(_0x45df32,_0x42cba0){_0x45df32=_0x45df32-0x0;var _0x1a427e=_0x65c5[_0x45df32];return _0x1a427e;};'use strict';var Sequelize=require(_0x565c('0x0'));module[_0x565c('0x1')]={'question':{'type':Sequelize[_0x565c('0x2')]},'answer':{'type':Sequelize[_0x565c('0x3')](_0x565c('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x565c('0x2')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x565c('0x2')]},'calleridnum':{'type':Sequelize[_0x565c('0x2')]},'questionId':{'type':Sequelize[_0x565c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
index 0e26511..b6fb967 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a6d=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','fields','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x3f43ef,_0x4c2ba9){var _0x20af43=function(_0x17fb2b){while(--_0x17fb2b){_0x3f43ef['push'](_0x3f43ef['shift']());}};_0x20af43(++_0x4c2ba9);}(_0x5a6d,0x18f));var _0xd5a6=function(_0x4cfe1a,_0x222056){_0x4cfe1a=_0x4cfe1a-0x0;var _0x4fa61b=_0x5a6d[_0x4cfe1a];return _0x4fa61b;};'use strict';var pdf=require(_0xd5a6('0x0'));var emlformat=require(_0xd5a6('0x1'));var rimraf=require(_0xd5a6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd5a6('0x3'));var rp=require(_0xd5a6('0x4'));var moment=require(_0xd5a6('0x5'));var BPromise=require(_0xd5a6('0x6'));var Mustache=require(_0xd5a6('0x7'));var util=require(_0xd5a6('0x8'));var path=require(_0xd5a6('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd5a6('0xa'));var fs=require('fs');var _=require(_0xd5a6('0xb'));var squel=require(_0xd5a6('0xc'));var crypto=require(_0xd5a6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd5a6('0xe'));var toCsv=require(_0xd5a6('0xf'));var querystring=require(_0xd5a6('0x10'));var Papa=require('papaparse');var Redis=require(_0xd5a6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd5a6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd5a6('0x13'));var logger=require(_0xd5a6('0x14'))(_0xd5a6('0x15'));var utils=require(_0xd5a6('0x16'));var config=require('../../config/environment');var db=require(_0xd5a6('0x17'))['db'];function respondWithStatusCode(_0x233010,_0x578972){_0x578972=_0x578972||0xcc;return function(_0x4eec5a){if(_0x4eec5a){return _0x233010['sendStatus'](_0x578972);}return _0x233010['status'](_0x578972)['end']();};}function respondWithResult(_0x2c33bb,_0x5bb196){_0x5bb196=_0x5bb196||0xc8;return function(_0x56782a){if(_0x56782a){return _0x2c33bb[_0xd5a6('0x18')](_0x5bb196)[_0xd5a6('0x19')](_0x56782a);}};}function respondWithFilteredResult(_0x3037e9,_0x36665f){return function(_0x1154d7){if(_0x1154d7){var _0x1bd2e0=_0x1154d7[_0xd5a6('0x1a')],_0x14f28c=_0x36665f[_0xd5a6('0x1b')],_0x1d84ea=_0x36665f[_0xd5a6('0x1b')]+_0x36665f[_0xd5a6('0x1c')],_0x33d8d2;if(_0x1d84ea>=_0x1bd2e0){_0x1d84ea=_0x1bd2e0;_0x33d8d2=0xc8;}else{_0x33d8d2=0xce;}_0x3037e9[_0xd5a6('0x18')](_0x33d8d2);return _0x3037e9[_0xd5a6('0x1d')]('Content-Range',_0x14f28c+'-'+_0x1d84ea+'/'+_0x1bd2e0)['json'](_0x1154d7);}return null;};}function patchUpdates(_0x4ba2fd){return function(_0x327b7e){try{jsonpatch[_0xd5a6('0x1e')](_0x327b7e,_0x4ba2fd,!![]);}catch(_0x204f41){return BPromise[_0xd5a6('0x1f')](_0x204f41);}return _0x327b7e[_0xd5a6('0x20')]();};}function saveUpdates(_0x3bcf20,_0x151761){return function(_0xe2c0c0){if(_0xe2c0c0){return _0xe2c0c0[_0xd5a6('0x21')](_0x3bcf20)[_0xd5a6('0x22')](function(_0x36dc37){return _0x36dc37;});}return null;};}function removeEntity(_0x55ac27,_0x144a06){return function(_0x486218){if(_0x486218){return _0x486218[_0xd5a6('0x23')]()[_0xd5a6('0x22')](function(){_0x55ac27[_0xd5a6('0x18')](0xcc)[_0xd5a6('0x24')]();});}};}function handleEntityNotFound(_0x24545b,_0x154f06){return function(_0x309f3c){if(!_0x309f3c){_0x24545b[_0xd5a6('0x25')](0x194);}return _0x309f3c;};}function handleError(_0x2d0811,_0x163d4d){_0x163d4d=_0x163d4d||0x1f4;return function(_0x3c5627){logger[_0xd5a6('0x26')](_0x3c5627[_0xd5a6('0x27')]);if(_0x3c5627[_0xd5a6('0x28')]){delete _0x3c5627[_0xd5a6('0x28')];}_0x2d0811[_0xd5a6('0x18')](_0x163d4d)[_0xd5a6('0x29')](_0x3c5627);};}exports['index']=function(_0x4e783a,_0x854064){var _0x4b864b={},_0x163e74={},_0x26be34={'count':0x0,'rows':[]};var _0x425056=_[_0xd5a6('0x2a')](db[_0xd5a6('0x2b')][_0xd5a6('0x2c')],function(_0x1c4456){return{'name':_0x1c4456[_0xd5a6('0x2d')],'type':_0x1c4456['type'][_0xd5a6('0x2e')]};});_0x163e74[_0xd5a6('0x2f')]=_['map'](_0x425056,_0xd5a6('0x28'));_0x163e74[_0xd5a6('0x30')]=_[_0xd5a6('0x31')](_0x4e783a[_0xd5a6('0x30')]);_0x163e74[_0xd5a6('0x32')]=_[_0xd5a6('0x33')](_0x163e74[_0xd5a6('0x2f')],_0x163e74['query']);_0x4b864b['attributes']=_[_0xd5a6('0x33')](_0x163e74[_0xd5a6('0x2f')],qs['fields'](_0x4e783a['query']['fields']));_0x4b864b[_0xd5a6('0x34')]=_0x4b864b[_0xd5a6('0x34')][_0xd5a6('0x35')]?_0x4b864b[_0xd5a6('0x34')]:_0x163e74['model'];if(!_0x4e783a[_0xd5a6('0x30')][_0xd5a6('0x36')](_0xd5a6('0x37'))){_0x4b864b[_0xd5a6('0x1c')]=qs[_0xd5a6('0x1c')](_0x4e783a[_0xd5a6('0x30')]['limit']);_0x4b864b['offset']=qs[_0xd5a6('0x1b')](_0x4e783a['query']['offset']);}_0x4b864b[_0xd5a6('0x38')]=qs['sort'](_0x4e783a[_0xd5a6('0x30')][_0xd5a6('0x39')]);_0x4b864b[_0xd5a6('0x3a')]=qs[_0xd5a6('0x32')](_[_0xd5a6('0x3b')](_0x4e783a[_0xd5a6('0x30')],_0x163e74[_0xd5a6('0x32')]),_0x425056);if(_0x4e783a[_0xd5a6('0x30')][_0xd5a6('0x3c')]){_0x4b864b[_0xd5a6('0x3a')]=_[_0xd5a6('0x3d')](_0x4b864b[_0xd5a6('0x3a')],{'$or':_[_0xd5a6('0x2a')](_0x425056,function(_0x4e5b72){if(_0x4e5b72['type']!==_0xd5a6('0x3e')){var _0x123a69={};_0x123a69[_0x4e5b72[_0xd5a6('0x28')]]={'$like':'%'+_0x4e783a[_0xd5a6('0x30')][_0xd5a6('0x3c')]+'%'};return _0x123a69;}})});}_0x4b864b=_['merge']({},_0x4b864b,_0x4e783a[_0xd5a6('0x3f')]);var _0x40d3c1={'where':_0x4b864b['where']};return db['JscriptyQuestionReport'][_0xd5a6('0x1a')](_0x40d3c1)['then'](function(_0x429d93){_0x26be34[_0xd5a6('0x1a')]=_0x429d93;if(_0x4e783a['query'][_0xd5a6('0x40')]){_0x4b864b[_0xd5a6('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xd5a6('0x42')](_0x4b864b);})[_0xd5a6('0x22')](function(_0x5dc32d){_0x26be34[_0xd5a6('0x43')]=_0x5dc32d;return _0x26be34;})[_0xd5a6('0x22')](respondWithFilteredResult(_0x854064,_0x4b864b))['catch'](handleError(_0x854064,null));};exports[_0xd5a6('0x44')]=function(_0x31af5,_0x243f47){var _0xecc1ea={'raw':!![],'where':{'id':_0x31af5['params']['id']}},_0xb1e8fb={};_0xb1e8fb['model']=_['keys'](db[_0xd5a6('0x2b')][_0xd5a6('0x2c')]);_0xb1e8fb[_0xd5a6('0x30')]=_['keys'](_0x31af5[_0xd5a6('0x30')]);_0xb1e8fb[_0xd5a6('0x32')]=_[_0xd5a6('0x33')](_0xb1e8fb['model'],_0xb1e8fb['query']);_0xecc1ea[_0xd5a6('0x34')]=_[_0xd5a6('0x33')](_0xb1e8fb['model'],qs[_0xd5a6('0x45')](_0x31af5[_0xd5a6('0x30')][_0xd5a6('0x45')]));_0xecc1ea[_0xd5a6('0x34')]=_0xecc1ea[_0xd5a6('0x34')][_0xd5a6('0x35')]?_0xecc1ea['attributes']:_0xb1e8fb['model'];if(_0x31af5[_0xd5a6('0x30')]['includeAll']){_0xecc1ea[_0xd5a6('0x41')]=[{'all':!![]}];}_0xecc1ea=_[_0xd5a6('0x3d')]({},_0xecc1ea,_0x31af5[_0xd5a6('0x3f')]);return db['JscriptyQuestionReport'][_0xd5a6('0x46')](_0xecc1ea)['then'](handleEntityNotFound(_0x243f47,null))[_0xd5a6('0x22')](respondWithResult(_0x243f47,null))[_0xd5a6('0x47')](handleError(_0x243f47,null));};exports[_0xd5a6('0x48')]=function(_0x89e237,_0x23f11e){return db['JscriptyQuestionReport'][_0xd5a6('0x48')](_0x89e237['body'],{})['then'](respondWithResult(_0x23f11e,0xc9))[_0xd5a6('0x47')](handleError(_0x23f11e,null));};exports[_0xd5a6('0x21')]=function(_0x3ecfd3,_0x3498a2){if(_0x3ecfd3['body']['id']){delete _0x3ecfd3[_0xd5a6('0x49')]['id'];}return db[_0xd5a6('0x2b')]['find']({'where':{'id':_0x3ecfd3[_0xd5a6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3498a2,null))['then'](saveUpdates(_0x3ecfd3[_0xd5a6('0x49')],null))['then'](respondWithResult(_0x3498a2,null))[_0xd5a6('0x47')](handleError(_0x3498a2,null));};exports['destroy']=function(_0x239047,_0x40d5e3){return db[_0xd5a6('0x2b')][_0xd5a6('0x46')]({'where':{'id':_0x239047['params']['id']}})[_0xd5a6('0x22')](handleEntityNotFound(_0x40d5e3,null))[_0xd5a6('0x22')](removeEntity(_0x40d5e3,null))[_0xd5a6('0x47')](handleError(_0x40d5e3,null));};exports[_0xd5a6('0x4b')]=function(_0x4b4fe7,_0x2d0881){return db[_0xd5a6('0x2b')]['describe']()[_0xd5a6('0x22')](respondWithResult(_0x2d0881,null))[_0xd5a6('0x47')](handleError(_0x2d0881,null));};
\ No newline at end of file
+var _0x30e0=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','includeAll','catch','create','update','body','find','params','describe','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30e0,0x123));var _0x030e=function(_0x43ebd4,_0x3b3630){_0x43ebd4=_0x43ebd4-0x0;var _0x218876=_0x30e0[_0x43ebd4];return _0x218876;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x030e('0x0'));var zipdir=require(_0x030e('0x1'));var jsonpatch=require(_0x030e('0x2'));var rp=require(_0x030e('0x3'));var moment=require(_0x030e('0x4'));var BPromise=require(_0x030e('0x5'));var Mustache=require(_0x030e('0x6'));var util=require('util');var path=require(_0x030e('0x7'));var sox=require('sox');var csv=require(_0x030e('0x8'));var ejs=require(_0x030e('0x9'));var fs=require('fs');var _=require(_0x030e('0xa'));var squel=require(_0x030e('0xb'));var crypto=require(_0x030e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x030e('0xd'));var toCsv=require(_0x030e('0x8'));var querystring=require(_0x030e('0xe'));var Papa=require(_0x030e('0xf'));var Redis=require(_0x030e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x030e('0x11'));var as=require(_0x030e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x030e('0x13'));var utils=require('../../config/utils');var config=require(_0x030e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x147e41,_0x4d380c){_0x4d380c=_0x4d380c||0xcc;return function(_0x3c8265){if(_0x3c8265){return _0x147e41[_0x030e('0x15')](_0x4d380c);}return _0x147e41[_0x030e('0x16')](_0x4d380c)['end']();};}function respondWithResult(_0xe29b17,_0xe4c6e7){_0xe4c6e7=_0xe4c6e7||0xc8;return function(_0x54f085){if(_0x54f085){return _0xe29b17[_0x030e('0x16')](_0xe4c6e7)[_0x030e('0x17')](_0x54f085);}};}function respondWithFilteredResult(_0x10461d,_0xb97b7f){return function(_0x108e16){if(_0x108e16){var _0x1fff76=_0x108e16['count'],_0x54fe71=_0xb97b7f[_0x030e('0x18')],_0x15ba02=_0xb97b7f[_0x030e('0x18')]+_0xb97b7f[_0x030e('0x19')],_0x1487f8;if(_0x15ba02>=_0x1fff76){_0x15ba02=_0x1fff76;_0x1487f8=0xc8;}else{_0x1487f8=0xce;}_0x10461d['status'](_0x1487f8);return _0x10461d[_0x030e('0x1a')](_0x030e('0x1b'),_0x54fe71+'-'+_0x15ba02+'/'+_0x1fff76)[_0x030e('0x17')](_0x108e16);}return null;};}function patchUpdates(_0x2eea54){return function(_0x1a5d52){try{jsonpatch[_0x030e('0x1c')](_0x1a5d52,_0x2eea54,!![]);}catch(_0x28c116){return BPromise[_0x030e('0x1d')](_0x28c116);}return _0x1a5d52[_0x030e('0x1e')]();};}function saveUpdates(_0x374a4e,_0xdb2a00){return function(_0x393d6f){if(_0x393d6f){return _0x393d6f['update'](_0x374a4e)[_0x030e('0x1f')](function(_0xcf055c){return _0xcf055c;});}return null;};}function removeEntity(_0x2d9b3c,_0x23662f){return function(_0x4feeb6){if(_0x4feeb6){return _0x4feeb6[_0x030e('0x20')]()[_0x030e('0x1f')](function(){_0x2d9b3c[_0x030e('0x16')](0xcc)[_0x030e('0x21')]();});}};}function handleEntityNotFound(_0x5d2256,_0x434878){return function(_0x14e6a2){if(!_0x14e6a2){_0x5d2256[_0x030e('0x15')](0x194);}return _0x14e6a2;};}function handleError(_0x2d1329,_0x13144d){_0x13144d=_0x13144d||0x1f4;return function(_0x4e16b7){logger[_0x030e('0x22')](_0x4e16b7['stack']);if(_0x4e16b7['name']){delete _0x4e16b7['name'];}_0x2d1329[_0x030e('0x16')](_0x13144d)['send'](_0x4e16b7);};}exports[_0x030e('0x23')]=function(_0x33d270,_0x33d180){var _0x49c40f={},_0x2c880d={},_0x1eac3a={'count':0x0,'rows':[]};var _0x4881ae=_[_0x030e('0x24')](db[_0x030e('0x25')][_0x030e('0x26')],function(_0x4e0e8d){return{'name':_0x4e0e8d[_0x030e('0x27')],'type':_0x4e0e8d[_0x030e('0x28')][_0x030e('0x29')]};});_0x2c880d[_0x030e('0x2a')]=_[_0x030e('0x24')](_0x4881ae,_0x030e('0x2b'));_0x2c880d[_0x030e('0x2c')]=_[_0x030e('0x2d')](_0x33d270[_0x030e('0x2c')]);_0x2c880d[_0x030e('0x2e')]=_[_0x030e('0x2f')](_0x2c880d['model'],_0x2c880d[_0x030e('0x2c')]);_0x49c40f['attributes']=_[_0x030e('0x2f')](_0x2c880d['model'],qs[_0x030e('0x30')](_0x33d270[_0x030e('0x2c')]['fields']));_0x49c40f['attributes']=_0x49c40f[_0x030e('0x31')][_0x030e('0x32')]?_0x49c40f[_0x030e('0x31')]:_0x2c880d['model'];if(!_0x33d270['query'][_0x030e('0x33')](_0x030e('0x34'))){_0x49c40f[_0x030e('0x19')]=qs[_0x030e('0x19')](_0x33d270['query'][_0x030e('0x19')]);_0x49c40f[_0x030e('0x18')]=qs[_0x030e('0x18')](_0x33d270[_0x030e('0x2c')][_0x030e('0x18')]);}_0x49c40f[_0x030e('0x35')]=qs[_0x030e('0x36')](_0x33d270[_0x030e('0x2c')][_0x030e('0x36')]);_0x49c40f[_0x030e('0x37')]=qs[_0x030e('0x2e')](_['pick'](_0x33d270['query'],_0x2c880d[_0x030e('0x2e')]),_0x4881ae);if(_0x33d270[_0x030e('0x2c')][_0x030e('0x38')]){_0x49c40f[_0x030e('0x37')]=_[_0x030e('0x39')](_0x49c40f[_0x030e('0x37')],{'$or':_['map'](_0x4881ae,function(_0xde934b){if(_0xde934b[_0x030e('0x28')]!==_0x030e('0x3a')){var _0x5cdd48={};_0x5cdd48[_0xde934b[_0x030e('0x2b')]]={'$like':'%'+_0x33d270[_0x030e('0x2c')][_0x030e('0x38')]+'%'};return _0x5cdd48;}})});}_0x49c40f=_[_0x030e('0x39')]({},_0x49c40f,_0x33d270[_0x030e('0x3b')]);var _0x15fbfc={'where':_0x49c40f[_0x030e('0x37')]};return db[_0x030e('0x25')][_0x030e('0x3c')](_0x15fbfc)[_0x030e('0x1f')](function(_0x30535c){_0x1eac3a[_0x030e('0x3c')]=_0x30535c;if(_0x33d270['query']['includeAll']){_0x49c40f[_0x030e('0x3d')]=[{'all':!![]}];}return db[_0x030e('0x25')][_0x030e('0x3e')](_0x49c40f);})[_0x030e('0x1f')](function(_0x5bb192){_0x1eac3a[_0x030e('0x3f')]=_0x5bb192;return _0x1eac3a;})[_0x030e('0x1f')](respondWithFilteredResult(_0x33d180,_0x49c40f))['catch'](handleError(_0x33d180,null));};exports[_0x030e('0x40')]=function(_0x4bf5dd,_0x2839b3){var _0x419a70={'raw':!![],'where':{'id':_0x4bf5dd['params']['id']}},_0x4b898d={};_0x4b898d['model']=_[_0x030e('0x2d')](db['JscriptyQuestionReport'][_0x030e('0x26')]);_0x4b898d['query']=_[_0x030e('0x2d')](_0x4bf5dd[_0x030e('0x2c')]);_0x4b898d[_0x030e('0x2e')]=_[_0x030e('0x2f')](_0x4b898d[_0x030e('0x2a')],_0x4b898d[_0x030e('0x2c')]);_0x419a70[_0x030e('0x31')]=_[_0x030e('0x2f')](_0x4b898d[_0x030e('0x2a')],qs[_0x030e('0x30')](_0x4bf5dd[_0x030e('0x2c')]['fields']));_0x419a70[_0x030e('0x31')]=_0x419a70[_0x030e('0x31')]['length']?_0x419a70['attributes']:_0x4b898d[_0x030e('0x2a')];if(_0x4bf5dd[_0x030e('0x2c')][_0x030e('0x41')]){_0x419a70['include']=[{'all':!![]}];}_0x419a70=_[_0x030e('0x39')]({},_0x419a70,_0x4bf5dd[_0x030e('0x3b')]);return db['JscriptyQuestionReport']['find'](_0x419a70)['then'](handleEntityNotFound(_0x2839b3,null))[_0x030e('0x1f')](respondWithResult(_0x2839b3,null))[_0x030e('0x42')](handleError(_0x2839b3,null));};exports['create']=function(_0x590c90,_0x599a01){return db[_0x030e('0x25')][_0x030e('0x43')](_0x590c90['body'],{})[_0x030e('0x1f')](respondWithResult(_0x599a01,0xc9))[_0x030e('0x42')](handleError(_0x599a01,null));};exports[_0x030e('0x44')]=function(_0x1bd18a,_0x1e39b6){if(_0x1bd18a[_0x030e('0x45')]['id']){delete _0x1bd18a[_0x030e('0x45')]['id'];}return db['JscriptyQuestionReport'][_0x030e('0x46')]({'where':{'id':_0x1bd18a[_0x030e('0x47')]['id']}})[_0x030e('0x1f')](handleEntityNotFound(_0x1e39b6,null))[_0x030e('0x1f')](saveUpdates(_0x1bd18a[_0x030e('0x45')],null))[_0x030e('0x1f')](respondWithResult(_0x1e39b6,null))[_0x030e('0x42')](handleError(_0x1e39b6,null));};exports['destroy']=function(_0x553931,_0x4ba1a5){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x553931[_0x030e('0x47')]['id']}})[_0x030e('0x1f')](handleEntityNotFound(_0x4ba1a5,null))[_0x030e('0x1f')](removeEntity(_0x4ba1a5,null))[_0x030e('0x42')](handleError(_0x4ba1a5,null));};exports[_0x030e('0x48')]=function(_0x19bc4c,_0x4cfe57){return db[_0x030e('0x25')][_0x030e('0x48')]()[_0x030e('0x1f')](respondWithResult(_0x4cfe57,null))[_0x030e('0x42')](handleError(_0x4cfe57,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
index 57abdf5..04f2df4 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x706d=['exports','define','JscriptyQuestionReport','report_jscripty_questions','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5696f1,_0x2b013f){var _0x464d2f=function(_0x5522a8){while(--_0x5522a8){_0x5696f1['push'](_0x5696f1['shift']());}};_0x464d2f(++_0x2b013f);}(_0x706d,0xa9));var _0xd706=function(_0x11caaa,_0xfa10b0){_0x11caaa=_0x11caaa-0x0;var _0x5e0c77=_0x706d[_0x11caaa];return _0x5e0c77;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd706('0x0'))(_0xd706('0x1'));var moment=require(_0xd706('0x2'));var BPromise=require(_0xd706('0x3'));var rp=require(_0xd706('0x4'));var fs=require('fs');var path=require(_0xd706('0x5'));var rimraf=require('rimraf');var config=require(_0xd706('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xd706('0x7')]=function(_0x34c95b,_0x33f538){return _0x34c95b[_0xd706('0x8')](_0xd706('0x9'),attributes,{'tableName':_0xd706('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa050=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x52c436,_0x1816a6){var _0x3b5700=function(_0x2c4a29){while(--_0x2c4a29){_0x52c436['push'](_0x52c436['shift']());}};_0x3b5700(++_0x1816a6);}(_0xa050,0x1bc));var _0x0a05=function(_0x2b0511,_0xb0ffd2){_0x2b0511=_0x2b0511-0x0;var _0x3e3f37=_0xa050[_0x2b0511];return _0x3e3f37;};'use strict';var _=require(_0x0a05('0x0'));var util=require(_0x0a05('0x1'));var logger=require(_0x0a05('0x2'))('api');var moment=require(_0x0a05('0x3'));var BPromise=require('bluebird');var rp=require(_0x0a05('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a05('0x5'));var config=require(_0x0a05('0x6'));var attributes=require(_0x0a05('0x7'));module[_0x0a05('0x8')]=function(_0x36080c,_0x275de6){return _0x36080c[_0x0a05('0x9')](_0x0a05('0xa'),attributes,{'tableName':_0x0a05('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
index f5292f9..69cc44e 100644
--- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
+++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe99=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3c6064,_0x4af185){var _0x3d520b=function(_0x3ed263){while(--_0x3ed263){_0x3c6064['push'](_0x3c6064['shift']());}};_0x3d520b(++_0x4af185);}(_0xbe99,0x175));var _0x9be9=function(_0x3526a5,_0x56825d){_0x3526a5=_0x3526a5-0x0;var _0x44f869=_0xbe99[_0x3526a5];return _0x44f869;};'use strict';var _=require(_0x9be9('0x0'));var util=require(_0x9be9('0x1'));var moment=require('moment');var BPromise=require(_0x9be9('0x2'));var rs=require(_0x9be9('0x3'));var fs=require('fs');var Redis=require(_0x9be9('0x4'));var db=require(_0x9be9('0x5'))['db'];var utils=require(_0x9be9('0x6'));var logger=require('../../config/logger')(_0x9be9('0x7'));var config=require('../../config/environment');var jayson=require(_0x9be9('0x8'));var client=jayson[_0x9be9('0x9')][_0x9be9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a052d,_0x5b4829,_0x38ee51){return new BPromise(function(_0x3bd059,_0x5072cb){return client['request'](_0x5a052d,_0x38ee51)['then'](function(_0x375fde){logger['info'](_0x9be9('0xb'),_0x5b4829,_0x9be9('0xc'));logger[_0x9be9('0xd')](_0x9be9('0xe'),_0x5b4829,_0x9be9('0xc'),JSON[_0x9be9('0xf')](_0x375fde));if(_0x375fde[_0x9be9('0x10')]){if(_0x375fde[_0x9be9('0x10')][_0x9be9('0x11')]===0x1f4){logger['error'](_0x9be9('0xb'),_0x5b4829,_0x375fde[_0x9be9('0x10')][_0x9be9('0x12')]);return _0x5072cb(_0x375fde[_0x9be9('0x10')][_0x9be9('0x12')]);}logger['error'](_0x9be9('0xb'),_0x5b4829,_0x375fde[_0x9be9('0x10')][_0x9be9('0x12')]);return _0x3bd059(_0x375fde[_0x9be9('0x10')][_0x9be9('0x12')]);}else{logger[_0x9be9('0x13')](_0x9be9('0xb'),_0x5b4829,_0x9be9('0xc'));_0x3bd059(_0x375fde[_0x9be9('0x14')][_0x9be9('0x12')]);}})['catch'](function(_0x26f9b1){logger['error'](_0x9be9('0xb'),_0x5b4829,_0x26f9b1);_0x5072cb(_0x26f9b1);});});}
\ No newline at end of file
+var _0xecb0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info','result','lodash','util','moment'];(function(_0x421739,_0x5a48a4){var _0x30e63b=function(_0x8ca827){while(--_0x8ca827){_0x421739['push'](_0x421739['shift']());}};_0x30e63b(++_0x5a48a4);}(_0xecb0,0xfa));var _0x0ecb=function(_0x49b50c,_0x243c04){_0x49b50c=_0x49b50c-0x0;var _0x81bfba=_0xecb0[_0x49b50c];return _0x81bfba;};'use strict';var _=require(_0x0ecb('0x0'));var util=require(_0x0ecb('0x1'));var moment=require(_0x0ecb('0x2'));var BPromise=require(_0x0ecb('0x3'));var rs=require(_0x0ecb('0x4'));var fs=require('fs');var Redis=require(_0x0ecb('0x5'));var db=require(_0x0ecb('0x6'))['db'];var utils=require(_0x0ecb('0x7'));var logger=require(_0x0ecb('0x8'))(_0x0ecb('0x9'));var config=require(_0x0ecb('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0ecb('0xb')][_0x0ecb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10b3e6,_0x41e196,_0x13f72a){return new BPromise(function(_0x43d1be,_0xe0519d){return client['request'](_0x10b3e6,_0x13f72a)['then'](function(_0x594fe2){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x41e196,_0x0ecb('0xd'));logger[_0x0ecb('0xe')](_0x0ecb('0xf'),_0x41e196,_0x0ecb('0xd'),JSON[_0x0ecb('0x10')](_0x594fe2));if(_0x594fe2[_0x0ecb('0x11')]){if(_0x594fe2[_0x0ecb('0x11')][_0x0ecb('0x12')]===0x1f4){logger[_0x0ecb('0x11')](_0x0ecb('0x13'),_0x41e196,_0x594fe2[_0x0ecb('0x11')]['message']);return _0xe0519d(_0x594fe2[_0x0ecb('0x11')][_0x0ecb('0x14')]);}logger[_0x0ecb('0x11')](_0x0ecb('0x13'),_0x41e196,_0x594fe2[_0x0ecb('0x11')][_0x0ecb('0x14')]);return _0x43d1be(_0x594fe2[_0x0ecb('0x11')][_0x0ecb('0x14')]);}else{logger[_0x0ecb('0x15')](_0x0ecb('0x13'),_0x41e196,_0x0ecb('0xd'));_0x43d1be(_0x594fe2[_0x0ecb('0x16')][_0x0ecb('0x14')]);}})['catch'](function(_0x52a693){logger[_0x0ecb('0x11')](_0x0ecb('0x13'),_0x41e196,_0x52a693);_0xe0519d(_0x52a693);});});}
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js
index 4e5dd46..748b8d5 100644
--- a/server/api/jscriptySessionReport/index.js
+++ b/server/api/jscriptySessionReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x24ca=['../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','create','put','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x3a3691,_0x433384){var _0x463a6b=function(_0x129389){while(--_0x129389){_0x3a3691['push'](_0x3a3691['shift']());}};_0x463a6b(++_0x433384);}(_0x24ca,0x8c));var _0xa24c=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x24ca[_0x2c2980];return _0x2a20a9;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa24c('0x1'));var express=require('express');var router=express[_0xa24c('0x2')]();var auth=require(_0xa24c('0x3'));var interaction=require(_0xa24c('0x4'));var config=require('../../config/environment');var controller=require(_0xa24c('0x5'));router[_0xa24c('0x6')]('/',auth[_0xa24c('0x7')](),controller['index']);router['get']('/describe',auth[_0xa24c('0x7')](),controller[_0xa24c('0x8')]);router[_0xa24c('0x6')](_0xa24c('0x9'),auth[_0xa24c('0x7')](),controller[_0xa24c('0xa')]);router['get'](_0xa24c('0xb'),auth[_0xa24c('0x7')](),controller[_0xa24c('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa24c('0xd')]);router[_0xa24c('0xe')](_0xa24c('0x9'),auth[_0xa24c('0x7')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa24c('0x11')]=router;
\ No newline at end of file
+var _0x6dac=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete'];(function(_0x1d03e2,_0x4068c1){var _0x2b9a0c=function(_0x5a3325){while(--_0x5a3325){_0x1d03e2['push'](_0x1d03e2['shift']());}};_0x2b9a0c(++_0x4068c1);}(_0x6dac,0x16e));var _0xc6da=function(_0x5ccaf3,_0x58dd54){_0x5ccaf3=_0x5ccaf3-0x0;var _0x4f6e9d=_0x6dac[_0x5ccaf3];return _0x4f6e9d;};'use strict';var multer=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var path=require(_0xc6da('0x2'));var timeout=require(_0xc6da('0x3'));var express=require(_0xc6da('0x4'));var router=express[_0xc6da('0x5')]();var auth=require(_0xc6da('0x6'));var interaction=require(_0xc6da('0x7'));var config=require(_0xc6da('0x8'));var controller=require(_0xc6da('0x9'));router[_0xc6da('0xa')]('/',auth[_0xc6da('0xb')](),controller[_0xc6da('0xc')]);router['get'](_0xc6da('0xd'),auth[_0xc6da('0xb')](),controller[_0xc6da('0xe')]);router[_0xc6da('0xa')](_0xc6da('0xf'),auth[_0xc6da('0xb')](),controller[_0xc6da('0x10')]);router[_0xc6da('0xa')](_0xc6da('0x11'),auth['isAuthenticated'](),controller[_0xc6da('0x12')]);router[_0xc6da('0x13')]('/',auth[_0xc6da('0xb')](),controller[_0xc6da('0x14')]);router[_0xc6da('0x15')](_0xc6da('0xf'),auth[_0xc6da('0xb')](),controller[_0xc6da('0x16')]);router[_0xc6da('0x17')](_0xc6da('0xf'),auth[_0xc6da('0xb')](),controller[_0xc6da('0x18')]);module[_0xc6da('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
index 19e61b6..a8db6c0 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38f2=['STRING','BOOLEAN','moment','sequelize','exports','setDataValue','starttime','endtime','DATE'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x38f2,0xad));var _0x238f=function(_0x508100,_0x1f92ee){_0x508100=_0x508100-0x0;var _0x5dc4e9=_0x38f2[_0x508100];return _0x5dc4e9;};'use strict';var moment=require(_0x238f('0x0'));var Sequelize=require(_0x238f('0x1'));module[_0x238f('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2970bf){this[_0x238f('0x3')](_0x238f('0x4'),_0x2970bf);this[_0x238f('0x3')](_0x238f('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x238f('0x6')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x238f('0x7')]},'queue':{'type':Sequelize[_0x238f('0x7')]},'uniqueid':{'type':Sequelize[_0x238f('0x7')]},'calleridname':{'type':Sequelize[_0x238f('0x7')]},'calleridnum':{'type':Sequelize[_0x238f('0x7')]},'completed':{'type':Sequelize[_0x238f('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1bf9=['setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','starttime'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x1bf9,0x1c9));var _0x91bf=function(_0x57f8d5,_0x166847){_0x57f8d5=_0x57f8d5-0x0;var _0xd49f60=_0x1bf9[_0x57f8d5];return _0xd49f60;};'use strict';var moment=require(_0x91bf('0x0'));var Sequelize=require(_0x91bf('0x1'));module[_0x91bf('0x2')]={'starttime':{'type':Sequelize[_0x91bf('0x3')],'set':function(_0x5169a8){this['setDataValue'](_0x91bf('0x4'),_0x5169a8);this[_0x91bf('0x5')](_0x91bf('0x6'),moment()[_0x91bf('0x7')](_0x91bf('0x8')));}},'endtime':{'type':Sequelize[_0x91bf('0x3')]},'membername':{'type':Sequelize[_0x91bf('0x9')]},'projectname':{'type':Sequelize[_0x91bf('0x9')]},'queue':{'type':Sequelize[_0x91bf('0x9')]},'uniqueid':{'type':Sequelize[_0x91bf('0x9')]},'calleridname':{'type':Sequelize[_0x91bf('0x9')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x91bf('0xa')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
index 80b3360..562526d 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5bcc=['merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','options','find','create','body','params','describe','getQuestions','JscriptyQuestionReport','order','pick','SessionId','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','update','then','destroy','stack','name','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filter'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5bcc,0x133));var _0xc5bc=function(_0x2020b5,_0x3952cc){_0x2020b5=_0x2020b5-0x0;var _0x5c7717=_0x5bcc[_0x2020b5];return _0x5c7717;};'use strict';var pdf=require(_0xc5bc('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc5bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5bc('0x2'));var moment=require(_0xc5bc('0x3'));var BPromise=require(_0xc5bc('0x4'));var Mustache=require(_0xc5bc('0x5'));var util=require(_0xc5bc('0x6'));var path=require(_0xc5bc('0x7'));var sox=require(_0xc5bc('0x8'));var csv=require(_0xc5bc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc5bc('0xa'));var squel=require(_0xc5bc('0xb'));var crypto=require('crypto');var jsforce=require(_0xc5bc('0xc'));var deskjs=require(_0xc5bc('0xd'));var toCsv=require(_0xc5bc('0x9'));var querystring=require(_0xc5bc('0xe'));var Papa=require(_0xc5bc('0xf'));var Redis=require(_0xc5bc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc5bc('0x11'));var as=require(_0xc5bc('0x12'));var hardwareService=require(_0xc5bc('0x13'));var logger=require('../../config/logger')(_0xc5bc('0x14'));var utils=require(_0xc5bc('0x15'));var config=require('../../config/environment');var db=require(_0xc5bc('0x16'))['db'];function respondWithStatusCode(_0x3138ea,_0x15ab9d){_0x15ab9d=_0x15ab9d||0xcc;return function(_0x55098d){if(_0x55098d){return _0x3138ea[_0xc5bc('0x17')](_0x15ab9d);}return _0x3138ea[_0xc5bc('0x18')](_0x15ab9d)[_0xc5bc('0x19')]();};}function respondWithResult(_0x1dc736,_0x471cfd){_0x471cfd=_0x471cfd||0xc8;return function(_0x560aa5){if(_0x560aa5){return _0x1dc736['status'](_0x471cfd)['json'](_0x560aa5);}};}function respondWithFilteredResult(_0x149f56,_0x4bd9fe){return function(_0x332899){if(_0x332899){var _0x58388b=_0x332899[_0xc5bc('0x1a')],_0x41e598=_0x4bd9fe[_0xc5bc('0x1b')],_0x23781a=_0x4bd9fe[_0xc5bc('0x1b')]+_0x4bd9fe[_0xc5bc('0x1c')],_0x109ce1;if(_0x23781a>=_0x58388b){_0x23781a=_0x58388b;_0x109ce1=0xc8;}else{_0x109ce1=0xce;}_0x149f56[_0xc5bc('0x18')](_0x109ce1);return _0x149f56[_0xc5bc('0x1d')]('Content-Range',_0x41e598+'-'+_0x23781a+'/'+_0x58388b)['json'](_0x332899);}return null;};}function patchUpdates(_0x5505b1){return function(_0x74e6a6){try{jsonpatch['apply'](_0x74e6a6,_0x5505b1,!![]);}catch(_0x4261d4){return BPromise['reject'](_0x4261d4);}return _0x74e6a6['save']();};}function saveUpdates(_0x8f564,_0x209d08){return function(_0x20ff3f){if(_0x20ff3f){return _0x20ff3f[_0xc5bc('0x1e')](_0x8f564)[_0xc5bc('0x1f')](function(_0x60f97d){return _0x60f97d;});}return null;};}function removeEntity(_0x182246,_0x4bd0f9){return function(_0x3279f1){if(_0x3279f1){return _0x3279f1[_0xc5bc('0x20')]()[_0xc5bc('0x1f')](function(){_0x182246[_0xc5bc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26e050,_0x31cafd){return function(_0x5bcc82){if(!_0x5bcc82){_0x26e050[_0xc5bc('0x17')](0x194);}return _0x5bcc82;};}function handleError(_0x578fd2,_0x1f8d51){_0x1f8d51=_0x1f8d51||0x1f4;return function(_0x5a6410){logger['error'](_0x5a6410[_0xc5bc('0x21')]);if(_0x5a6410[_0xc5bc('0x22')]){delete _0x5a6410[_0xc5bc('0x22')];}_0x578fd2[_0xc5bc('0x18')](_0x1f8d51)['send'](_0x5a6410);};}exports['index']=function(_0x54cbe7,_0x2c4e36){var _0x4d3ad={},_0x5da617={},_0x12d2f7={'count':0x0,'rows':[]};var _0x22480a=_[_0xc5bc('0x23')](db[_0xc5bc('0x24')][_0xc5bc('0x25')],function(_0x4eac55){return{'name':_0x4eac55[_0xc5bc('0x26')],'type':_0x4eac55[_0xc5bc('0x27')][_0xc5bc('0x28')]};});_0x5da617['model']=_[_0xc5bc('0x23')](_0x22480a,_0xc5bc('0x22'));_0x5da617[_0xc5bc('0x29')]=_['keys'](_0x54cbe7[_0xc5bc('0x29')]);_0x5da617[_0xc5bc('0x2a')]=_[_0xc5bc('0x2b')](_0x5da617[_0xc5bc('0x2c')],_0x5da617[_0xc5bc('0x29')]);_0x4d3ad['attributes']=_['intersection'](_0x5da617[_0xc5bc('0x2c')],qs[_0xc5bc('0x2d')](_0x54cbe7[_0xc5bc('0x29')]['fields']));_0x4d3ad['attributes']=_0x4d3ad['attributes'][_0xc5bc('0x2e')]?_0x4d3ad[_0xc5bc('0x2f')]:_0x5da617[_0xc5bc('0x2c')];if(!_0x54cbe7[_0xc5bc('0x29')][_0xc5bc('0x30')](_0xc5bc('0x31'))){_0x4d3ad[_0xc5bc('0x1c')]=qs[_0xc5bc('0x1c')](_0x54cbe7[_0xc5bc('0x29')]['limit']);_0x4d3ad['offset']=qs[_0xc5bc('0x1b')](_0x54cbe7[_0xc5bc('0x29')][_0xc5bc('0x1b')]);}_0x4d3ad['order']=qs['sort'](_0x54cbe7[_0xc5bc('0x29')][_0xc5bc('0x32')]);_0x4d3ad[_0xc5bc('0x33')]=qs[_0xc5bc('0x2a')](_['pick'](_0x54cbe7[_0xc5bc('0x29')],_0x5da617[_0xc5bc('0x2a')]),_0x22480a);if(_0x54cbe7[_0xc5bc('0x29')][_0xc5bc('0x34')]){_0x4d3ad[_0xc5bc('0x33')]=_[_0xc5bc('0x35')](_0x4d3ad['where'],{'$or':_['map'](_0x22480a,function(_0x26c9e2){if(_0x26c9e2[_0xc5bc('0x27')]!==_0xc5bc('0x36')){var _0x12618e={};_0x12618e[_0x26c9e2['name']]={'$like':'%'+_0x54cbe7[_0xc5bc('0x29')][_0xc5bc('0x34')]+'%'};return _0x12618e;}})});}_0x4d3ad=_[_0xc5bc('0x35')]({},_0x4d3ad,_0x54cbe7['options']);var _0x385775={'where':_0x4d3ad[_0xc5bc('0x33')]};return db[_0xc5bc('0x24')][_0xc5bc('0x1a')](_0x385775)[_0xc5bc('0x1f')](function(_0x3f5b56){_0x12d2f7[_0xc5bc('0x1a')]=_0x3f5b56;if(_0x54cbe7['query'][_0xc5bc('0x37')]){_0x4d3ad[_0xc5bc('0x38')]=[{'all':!![]}];}return db[_0xc5bc('0x24')][_0xc5bc('0x39')](_0x4d3ad);})['then'](function(_0x46d9d7){_0x12d2f7['rows']=_0x46d9d7;return _0x12d2f7;})[_0xc5bc('0x1f')](respondWithFilteredResult(_0x2c4e36,_0x4d3ad))[_0xc5bc('0x3a')](handleError(_0x2c4e36,null));};exports[_0xc5bc('0x3b')]=function(_0x21f0ea,_0x7f1f06){var _0x2f09de={'raw':!![],'where':{'id':_0x21f0ea['params']['id']}},_0x5d1623={};_0x5d1623[_0xc5bc('0x2c')]=_[_0xc5bc('0x3c')](db[_0xc5bc('0x24')][_0xc5bc('0x25')]);_0x5d1623[_0xc5bc('0x29')]=_[_0xc5bc('0x3c')](_0x21f0ea[_0xc5bc('0x29')]);_0x5d1623['filters']=_['intersection'](_0x5d1623['model'],_0x5d1623[_0xc5bc('0x29')]);_0x2f09de[_0xc5bc('0x2f')]=_[_0xc5bc('0x2b')](_0x5d1623[_0xc5bc('0x2c')],qs[_0xc5bc('0x2d')](_0x21f0ea['query'][_0xc5bc('0x2d')]));_0x2f09de['attributes']=_0x2f09de['attributes'][_0xc5bc('0x2e')]?_0x2f09de[_0xc5bc('0x2f')]:_0x5d1623['model'];if(_0x21f0ea['query'][_0xc5bc('0x37')]){_0x2f09de['include']=[{'all':!![]}];}_0x2f09de=_[_0xc5bc('0x35')]({},_0x2f09de,_0x21f0ea[_0xc5bc('0x3d')]);return db[_0xc5bc('0x24')][_0xc5bc('0x3e')](_0x2f09de)[_0xc5bc('0x1f')](handleEntityNotFound(_0x7f1f06,null))['then'](respondWithResult(_0x7f1f06,null))[_0xc5bc('0x3a')](handleError(_0x7f1f06,null));};exports[_0xc5bc('0x3f')]=function(_0x1bbfda,_0x431d27){return db[_0xc5bc('0x24')][_0xc5bc('0x3f')](_0x1bbfda[_0xc5bc('0x40')],{})[_0xc5bc('0x1f')](respondWithResult(_0x431d27,0xc9))[_0xc5bc('0x3a')](handleError(_0x431d27,null));};exports[_0xc5bc('0x1e')]=function(_0x1a1209,_0x3d8837){if(_0x1a1209['body']['id']){delete _0x1a1209[_0xc5bc('0x40')]['id'];}return db[_0xc5bc('0x24')][_0xc5bc('0x3e')]({'where':{'id':_0x1a1209[_0xc5bc('0x41')]['id']}})[_0xc5bc('0x1f')](handleEntityNotFound(_0x3d8837,null))[_0xc5bc('0x1f')](saveUpdates(_0x1a1209[_0xc5bc('0x40')],null))['then'](respondWithResult(_0x3d8837,null))[_0xc5bc('0x3a')](handleError(_0x3d8837,null));};exports[_0xc5bc('0x20')]=function(_0x400bca,_0x13653c){return db[_0xc5bc('0x24')][_0xc5bc('0x3e')]({'where':{'id':_0x400bca[_0xc5bc('0x41')]['id']}})[_0xc5bc('0x1f')](handleEntityNotFound(_0x13653c,null))[_0xc5bc('0x1f')](removeEntity(_0x13653c,null))[_0xc5bc('0x3a')](handleError(_0x13653c,null));};exports[_0xc5bc('0x42')]=function(_0x8d4e17,_0x48a665){return db[_0xc5bc('0x24')][_0xc5bc('0x42')]()[_0xc5bc('0x1f')](respondWithResult(_0x48a665,null))[_0xc5bc('0x3a')](handleError(_0x48a665,null));};exports[_0xc5bc('0x43')]=function(_0xe0bff,_0x498551,_0x1b5f5f){var _0x4562d9={'raw':!![],'where':{}};var _0x42e0da={};var _0x2d574b={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0xe0bff['params']['id']}})['then'](handleEntityNotFound(_0x498551,null))[_0xc5bc('0x1f')](function(_0x24ad15){if(_0x24ad15){_0x42e0da['model']=_[_0xc5bc('0x3c')](db[_0xc5bc('0x44')][_0xc5bc('0x25')]);_0x42e0da['query']=_[_0xc5bc('0x3c')](_0xe0bff[_0xc5bc('0x29')]);_0x42e0da['filters']=_[_0xc5bc('0x2b')](_0x42e0da[_0xc5bc('0x2c')],_0x42e0da[_0xc5bc('0x29')]);_0x4562d9['attributes']=_[_0xc5bc('0x2b')](_0x42e0da[_0xc5bc('0x2c')],qs['fields'](_0xe0bff[_0xc5bc('0x29')][_0xc5bc('0x2d')]));_0x4562d9['attributes']=_0x4562d9['attributes']['length']?_0x4562d9[_0xc5bc('0x2f')]:_0x42e0da[_0xc5bc('0x2c')];if(!_0xe0bff['query']['hasOwnProperty'](_0xc5bc('0x31'))){_0x4562d9[_0xc5bc('0x1c')]=qs[_0xc5bc('0x1c')](_0xe0bff[_0xc5bc('0x29')][_0xc5bc('0x1c')]);_0x4562d9[_0xc5bc('0x1b')]=qs[_0xc5bc('0x1b')](_0xe0bff[_0xc5bc('0x29')][_0xc5bc('0x1b')]);}_0x4562d9[_0xc5bc('0x45')]=qs['sort'](_0xe0bff[_0xc5bc('0x29')]['sort']);_0x4562d9['where']=qs[_0xc5bc('0x2a')](_[_0xc5bc('0x46')](_0xe0bff[_0xc5bc('0x29')],_0x42e0da[_0xc5bc('0x2a')]));_0x4562d9[_0xc5bc('0x33')][_0xc5bc('0x47')]=_0x24ad15['id'];if(_0xe0bff[_0xc5bc('0x29')][_0xc5bc('0x34')]){_0x4562d9[_0xc5bc('0x33')]=_['merge'](_0x4562d9[_0xc5bc('0x33')],{'$or':_[_0xc5bc('0x23')](_0x4562d9[_0xc5bc('0x2f')],function(_0x1ad167){var _0x26c6b5={};_0x26c6b5[_0x1ad167]={'$like':'%'+_0xe0bff[_0xc5bc('0x29')][_0xc5bc('0x34')]+'%'};return _0x26c6b5;})});}_0x4562d9=_[_0xc5bc('0x35')]({},_0x4562d9,_0xe0bff[_0xc5bc('0x3d')]);return db[_0xc5bc('0x44')][_0xc5bc('0x1a')]({'where':_0x4562d9['where']})[_0xc5bc('0x1f')](function(_0x43a7c0){_0x2d574b[_0xc5bc('0x1a')]=_0x43a7c0;if(_0xe0bff[_0xc5bc('0x29')][_0xc5bc('0x37')]){_0x4562d9[_0xc5bc('0x38')]=[{'all':!![]}];}return db[_0xc5bc('0x44')]['findAll'](_0x4562d9);})[_0xc5bc('0x1f')](function(_0x5e89de){_0x2d574b['rows']=_0x5e89de;return _0x2d574b;});}})[_0xc5bc('0x1f')](respondWithFilteredResult(_0x498551,_0x4562d9))[_0xc5bc('0x3a')](handleError(_0x498551,null));};
\ No newline at end of file
+var _0x1ee5=['limit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x561098,_0xdd1933){var _0x42701a=function(_0x2ab50f){while(--_0x2ab50f){_0x561098['push'](_0x561098['shift']());}};_0x42701a(++_0xdd1933);}(_0x1ee5,0x13e));var _0x51ee=function(_0x1b8aac,_0x89a673){_0x1b8aac=_0x1b8aac-0x0;var _0x178790=_0x1ee5[_0x1b8aac];return _0x178790;};'use strict';var pdf=require(_0x51ee('0x0'));var emlformat=require(_0x51ee('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x51ee('0x2'));var rp=require(_0x51ee('0x3'));var moment=require(_0x51ee('0x4'));var BPromise=require(_0x51ee('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x51ee('0x6'));var csv=require(_0x51ee('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x51ee('0x8'));var squel=require(_0x51ee('0x9'));var crypto=require(_0x51ee('0xa'));var jsforce=require(_0x51ee('0xb'));var deskjs=require(_0x51ee('0xc'));var toCsv=require(_0x51ee('0x7'));var querystring=require('querystring');var Papa=require(_0x51ee('0xd'));var Redis=require(_0x51ee('0xe'));var authService=require(_0x51ee('0xf'));var qs=require(_0x51ee('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51ee('0x11'));var logger=require('../../config/logger')(_0x51ee('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa7c07c,_0x79c0e){_0x79c0e=_0x79c0e||0xcc;return function(_0x44168d){if(_0x44168d){return _0xa7c07c['sendStatus'](_0x79c0e);}return _0xa7c07c[_0x51ee('0x13')](_0x79c0e)[_0x51ee('0x14')]();};}function respondWithResult(_0x2c450f,_0x22ff12){_0x22ff12=_0x22ff12||0xc8;return function(_0x5b19a7){if(_0x5b19a7){return _0x2c450f[_0x51ee('0x13')](_0x22ff12)[_0x51ee('0x15')](_0x5b19a7);}};}function respondWithFilteredResult(_0x4784ed,_0x3a2a8d){return function(_0x44ba9d){if(_0x44ba9d){var _0x35a5e7=_0x44ba9d[_0x51ee('0x16')],_0x501cc4=_0x3a2a8d[_0x51ee('0x17')],_0x3c9fbc=_0x3a2a8d[_0x51ee('0x17')]+_0x3a2a8d['limit'],_0x4dbd52;if(_0x3c9fbc>=_0x35a5e7){_0x3c9fbc=_0x35a5e7;_0x4dbd52=0xc8;}else{_0x4dbd52=0xce;}_0x4784ed['status'](_0x4dbd52);return _0x4784ed['set'](_0x51ee('0x18'),_0x501cc4+'-'+_0x3c9fbc+'/'+_0x35a5e7)[_0x51ee('0x15')](_0x44ba9d);}return null;};}function patchUpdates(_0x2ea575){return function(_0x12939e){try{jsonpatch[_0x51ee('0x19')](_0x12939e,_0x2ea575,!![]);}catch(_0x19dfd6){return BPromise[_0x51ee('0x1a')](_0x19dfd6);}return _0x12939e[_0x51ee('0x1b')]();};}function saveUpdates(_0x4e338f,_0x257578){return function(_0xe6def9){if(_0xe6def9){return _0xe6def9[_0x51ee('0x1c')](_0x4e338f)[_0x51ee('0x1d')](function(_0x5c645e){return _0x5c645e;});}return null;};}function removeEntity(_0x42c15d,_0x245d79){return function(_0x588c8a){if(_0x588c8a){return _0x588c8a[_0x51ee('0x1e')]()[_0x51ee('0x1d')](function(){_0x42c15d[_0x51ee('0x13')](0xcc)[_0x51ee('0x14')]();});}};}function handleEntityNotFound(_0x3086bb,_0x2c4751){return function(_0x19f82f){if(!_0x19f82f){_0x3086bb[_0x51ee('0x1f')](0x194);}return _0x19f82f;};}function handleError(_0x3c8645,_0x122ed0){_0x122ed0=_0x122ed0||0x1f4;return function(_0x21a8b7){logger['error'](_0x21a8b7[_0x51ee('0x20')]);if(_0x21a8b7[_0x51ee('0x21')]){delete _0x21a8b7[_0x51ee('0x21')];}_0x3c8645[_0x51ee('0x13')](_0x122ed0)[_0x51ee('0x22')](_0x21a8b7);};}exports[_0x51ee('0x23')]=function(_0x565b55,_0x3dc57f){var _0x4a3419={},_0x12c787={},_0xbbf93d={'count':0x0,'rows':[]};var _0x2ca05a=_[_0x51ee('0x24')](db[_0x51ee('0x25')][_0x51ee('0x26')],function(_0x388207){return{'name':_0x388207[_0x51ee('0x27')],'type':_0x388207[_0x51ee('0x28')][_0x51ee('0x29')]};});_0x12c787[_0x51ee('0x2a')]=_[_0x51ee('0x24')](_0x2ca05a,_0x51ee('0x21'));_0x12c787[_0x51ee('0x2b')]=_[_0x51ee('0x2c')](_0x565b55[_0x51ee('0x2b')]);_0x12c787[_0x51ee('0x2d')]=_[_0x51ee('0x2e')](_0x12c787['model'],_0x12c787[_0x51ee('0x2b')]);_0x4a3419[_0x51ee('0x2f')]=_[_0x51ee('0x2e')](_0x12c787[_0x51ee('0x2a')],qs[_0x51ee('0x30')](_0x565b55[_0x51ee('0x2b')]['fields']));_0x4a3419[_0x51ee('0x2f')]=_0x4a3419['attributes'][_0x51ee('0x31')]?_0x4a3419[_0x51ee('0x2f')]:_0x12c787['model'];if(!_0x565b55['query'][_0x51ee('0x32')](_0x51ee('0x33'))){_0x4a3419[_0x51ee('0x34')]=qs['limit'](_0x565b55[_0x51ee('0x2b')][_0x51ee('0x34')]);_0x4a3419[_0x51ee('0x17')]=qs[_0x51ee('0x17')](_0x565b55['query'][_0x51ee('0x17')]);}_0x4a3419[_0x51ee('0x35')]=qs[_0x51ee('0x36')](_0x565b55['query'][_0x51ee('0x36')]);_0x4a3419[_0x51ee('0x37')]=qs['filters'](_[_0x51ee('0x38')](_0x565b55[_0x51ee('0x2b')],_0x12c787[_0x51ee('0x2d')]),_0x2ca05a);if(_0x565b55[_0x51ee('0x2b')][_0x51ee('0x39')]){_0x4a3419[_0x51ee('0x37')]=_[_0x51ee('0x3a')](_0x4a3419[_0x51ee('0x37')],{'$or':_[_0x51ee('0x24')](_0x2ca05a,function(_0x8b146b){if(_0x8b146b['type']!=='VIRTUAL'){var _0xcee030={};_0xcee030[_0x8b146b[_0x51ee('0x21')]]={'$like':'%'+_0x565b55[_0x51ee('0x2b')]['filter']+'%'};return _0xcee030;}})});}_0x4a3419=_['merge']({},_0x4a3419,_0x565b55[_0x51ee('0x3b')]);var _0x54e67f={'where':_0x4a3419['where']};return db['JscriptySessionReport'][_0x51ee('0x16')](_0x54e67f)['then'](function(_0x2e7092){_0xbbf93d[_0x51ee('0x16')]=_0x2e7092;if(_0x565b55[_0x51ee('0x2b')]['includeAll']){_0x4a3419[_0x51ee('0x3c')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x51ee('0x3d')](_0x4a3419);})[_0x51ee('0x1d')](function(_0x343e08){_0xbbf93d[_0x51ee('0x3e')]=_0x343e08;return _0xbbf93d;})[_0x51ee('0x1d')](respondWithFilteredResult(_0x3dc57f,_0x4a3419))[_0x51ee('0x3f')](handleError(_0x3dc57f,null));};exports['show']=function(_0x4d742b,_0x4d3e84){var _0x140185={'raw':!![],'where':{'id':_0x4d742b[_0x51ee('0x40')]['id']}},_0x399929={};_0x399929[_0x51ee('0x2a')]=_[_0x51ee('0x2c')](db['JscriptySessionReport'][_0x51ee('0x26')]);_0x399929['query']=_[_0x51ee('0x2c')](_0x4d742b[_0x51ee('0x2b')]);_0x399929[_0x51ee('0x2d')]=_[_0x51ee('0x2e')](_0x399929['model'],_0x399929['query']);_0x140185['attributes']=_[_0x51ee('0x2e')](_0x399929['model'],qs[_0x51ee('0x30')](_0x4d742b[_0x51ee('0x2b')]['fields']));_0x140185['attributes']=_0x140185[_0x51ee('0x2f')]['length']?_0x140185[_0x51ee('0x2f')]:_0x399929[_0x51ee('0x2a')];if(_0x4d742b[_0x51ee('0x2b')][_0x51ee('0x41')]){_0x140185['include']=[{'all':!![]}];}_0x140185=_[_0x51ee('0x3a')]({},_0x140185,_0x4d742b[_0x51ee('0x3b')]);return db['JscriptySessionReport'][_0x51ee('0x42')](_0x140185)[_0x51ee('0x1d')](handleEntityNotFound(_0x4d3e84,null))[_0x51ee('0x1d')](respondWithResult(_0x4d3e84,null))[_0x51ee('0x3f')](handleError(_0x4d3e84,null));};exports[_0x51ee('0x43')]=function(_0x49a8b3,_0x21640d){return db['JscriptySessionReport'][_0x51ee('0x43')](_0x49a8b3[_0x51ee('0x44')],{})['then'](respondWithResult(_0x21640d,0xc9))[_0x51ee('0x3f')](handleError(_0x21640d,null));};exports[_0x51ee('0x1c')]=function(_0xdc319a,_0x4f0f41){if(_0xdc319a[_0x51ee('0x44')]['id']){delete _0xdc319a[_0x51ee('0x44')]['id'];}return db[_0x51ee('0x25')]['find']({'where':{'id':_0xdc319a[_0x51ee('0x40')]['id']}})[_0x51ee('0x1d')](handleEntityNotFound(_0x4f0f41,null))['then'](saveUpdates(_0xdc319a[_0x51ee('0x44')],null))[_0x51ee('0x1d')](respondWithResult(_0x4f0f41,null))[_0x51ee('0x3f')](handleError(_0x4f0f41,null));};exports['destroy']=function(_0x4876de,_0x2cd78b){return db['JscriptySessionReport']['find']({'where':{'id':_0x4876de[_0x51ee('0x40')]['id']}})[_0x51ee('0x1d')](handleEntityNotFound(_0x2cd78b,null))[_0x51ee('0x1d')](removeEntity(_0x2cd78b,null))['catch'](handleError(_0x2cd78b,null));};exports[_0x51ee('0x45')]=function(_0x17c7f9,_0xc8d43a){return db[_0x51ee('0x25')][_0x51ee('0x45')]()[_0x51ee('0x1d')](respondWithResult(_0xc8d43a,null))[_0x51ee('0x3f')](handleError(_0xc8d43a,null));};exports[_0x51ee('0x46')]=function(_0x2a9478,_0x322619,_0x247c64){var _0x503300={'raw':!![],'where':{}};var _0x205674={};var _0x11a908={'count':0x0,'rows':[]};return db[_0x51ee('0x25')][_0x51ee('0x47')]({'where':{'id':_0x2a9478[_0x51ee('0x40')]['id']}})['then'](handleEntityNotFound(_0x322619,null))[_0x51ee('0x1d')](function(_0x1043a7){if(_0x1043a7){_0x205674[_0x51ee('0x2a')]=_[_0x51ee('0x2c')](db[_0x51ee('0x48')]['rawAttributes']);_0x205674[_0x51ee('0x2b')]=_['keys'](_0x2a9478[_0x51ee('0x2b')]);_0x205674[_0x51ee('0x2d')]=_['intersection'](_0x205674['model'],_0x205674[_0x51ee('0x2b')]);_0x503300['attributes']=_[_0x51ee('0x2e')](_0x205674[_0x51ee('0x2a')],qs['fields'](_0x2a9478['query'][_0x51ee('0x30')]));_0x503300[_0x51ee('0x2f')]=_0x503300['attributes'][_0x51ee('0x31')]?_0x503300[_0x51ee('0x2f')]:_0x205674['model'];if(!_0x2a9478['query'][_0x51ee('0x32')](_0x51ee('0x33'))){_0x503300[_0x51ee('0x34')]=qs['limit'](_0x2a9478[_0x51ee('0x2b')]['limit']);_0x503300[_0x51ee('0x17')]=qs[_0x51ee('0x17')](_0x2a9478[_0x51ee('0x2b')][_0x51ee('0x17')]);}_0x503300[_0x51ee('0x35')]=qs[_0x51ee('0x36')](_0x2a9478[_0x51ee('0x2b')][_0x51ee('0x36')]);_0x503300[_0x51ee('0x37')]=qs[_0x51ee('0x2d')](_['pick'](_0x2a9478[_0x51ee('0x2b')],_0x205674[_0x51ee('0x2d')]));_0x503300[_0x51ee('0x37')][_0x51ee('0x49')]=_0x1043a7['id'];if(_0x2a9478[_0x51ee('0x2b')][_0x51ee('0x39')]){_0x503300['where']=_[_0x51ee('0x3a')](_0x503300['where'],{'$or':_[_0x51ee('0x24')](_0x503300['attributes'],function(_0x25d056){var _0x51f771={};_0x51f771[_0x25d056]={'$like':'%'+_0x2a9478[_0x51ee('0x2b')]['filter']+'%'};return _0x51f771;})});}_0x503300=_[_0x51ee('0x3a')]({},_0x503300,_0x2a9478[_0x51ee('0x3b')]);return db[_0x51ee('0x48')][_0x51ee('0x16')]({'where':_0x503300[_0x51ee('0x37')]})[_0x51ee('0x1d')](function(_0x211f81){_0x11a908[_0x51ee('0x16')]=_0x211f81;if(_0x2a9478[_0x51ee('0x2b')][_0x51ee('0x41')]){_0x503300[_0x51ee('0x3c')]=[{'all':!![]}];}return db[_0x51ee('0x48')]['findAll'](_0x503300);})[_0x51ee('0x1d')](function(_0x35a1a9){_0x11a908[_0x51ee('0x3e')]=_0x35a1a9;return _0x11a908;});}})['then'](respondWithFilteredResult(_0x322619,_0x503300))['catch'](handleError(_0x322619,null));};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js
index f67d18d..97bf61b 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.model.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['bluebird','request-promise','path','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment'];(function(_0x47513d,_0x335d90){var _0x55c187=function(_0x10dcfb){while(--_0x10dcfb){_0x47513d['push'](_0x47513d['shift']());}};_0x55c187(++_0x335d90);}(_0x5f2f,0x73));var _0xf5f2=function(_0x339c7e,_0x4e3b7b){_0x339c7e=_0x339c7e-0x0;var _0x9809bc=_0x5f2f[_0x339c7e];return _0x9809bc;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e27=['JscriptySessionReport','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','define'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7e27,0xdd));var _0x77e2=function(_0x47e305,_0x48f6b7){_0x47e305=_0x47e305-0x0;var _0x1ad62e=_0x7e27[_0x47e305];return _0x1ad62e;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var logger=require('../../config/logger')(_0x77e2('0x2'));var moment=require(_0x77e2('0x3'));var BPromise=require(_0x77e2('0x4'));var rp=require(_0x77e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77e2('0x6'));var config=require(_0x77e2('0x7'));var attributes=require(_0x77e2('0x8'));module['exports']=function(_0x3a312a,_0x57562e){return _0x3a312a[_0x77e2('0x9')](_0x77e2('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
index 03e4a2e..e26687c 100644
--- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
+++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e21=['request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1c7534,_0x50b70b){var _0x31c5c1=function(_0x7df4d6){while(--_0x7df4d6){_0x1c7534['push'](_0x1c7534['shift']());}};_0x31c5c1(++_0x50b70b);}(_0x2e21,0xba));var _0x12e2=function(_0x125037,_0x58bfae){_0x125037=_0x125037-0x0;var _0x3341bc=_0x2e21[_0x125037];return _0x3341bc;};'use strict';var _=require(_0x12e2('0x0'));var util=require(_0x12e2('0x1'));var moment=require(_0x12e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x12e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12e2('0x4'))['db'];var utils=require(_0x12e2('0x5'));var logger=require(_0x12e2('0x6'))(_0x12e2('0x7'));var config=require(_0x12e2('0x8'));var jayson=require(_0x12e2('0x9'));var client=jayson[_0x12e2('0xa')][_0x12e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f52d6,_0x2a7059,_0x321e79){return new BPromise(function(_0x372494,_0x4a53a2){return client[_0x12e2('0xc')](_0x2f52d6,_0x321e79)['then'](function(_0xf7ae46){logger['info'](_0x12e2('0xd'),_0x2a7059,_0x12e2('0xe'));logger[_0x12e2('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2a7059,_0x12e2('0xe'),JSON[_0x12e2('0x10')](_0xf7ae46));if(_0xf7ae46['error']){if(_0xf7ae46[_0x12e2('0x11')]['code']===0x1f4){logger[_0x12e2('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x2a7059,_0xf7ae46[_0x12e2('0x11')][_0x12e2('0x12')]);return _0x4a53a2(_0xf7ae46[_0x12e2('0x11')][_0x12e2('0x12')]);}logger[_0x12e2('0x11')](_0x12e2('0xd'),_0x2a7059,_0xf7ae46[_0x12e2('0x11')][_0x12e2('0x12')]);return _0x372494(_0xf7ae46[_0x12e2('0x11')]['message']);}else{logger[_0x12e2('0x13')](_0x12e2('0xd'),_0x2a7059,_0x12e2('0xe'));_0x372494(_0xf7ae46[_0x12e2('0x14')][_0x12e2('0x12')]);}})[_0x12e2('0x15')](function(_0x18e557){logger[_0x12e2('0x11')](_0x12e2('0xd'),_0x2a7059,_0x18e557);_0x4a53a2(_0x18e557);});});}
\ No newline at end of file
+var _0x6727=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x154f9f,_0x15d64b){var _0xf50626=function(_0x5cedfa){while(--_0x5cedfa){_0x154f9f['push'](_0x154f9f['shift']());}};_0xf50626(++_0x15d64b);}(_0x6727,0x17a));var _0x7672=function(_0x122d9f,_0x2c9e5b){_0x122d9f=_0x122d9f-0x0;var _0x41a09e=_0x6727[_0x122d9f];return _0x41a09e;};'use strict';var _=require(_0x7672('0x0'));var util=require(_0x7672('0x1'));var moment=require(_0x7672('0x2'));var BPromise=require(_0x7672('0x3'));var rs=require(_0x7672('0x4'));var fs=require('fs');var Redis=require(_0x7672('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7672('0x6'));var logger=require('../../config/logger')(_0x7672('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7672('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fb21d,_0x3abea8,_0x7429ca){return new BPromise(function(_0x4474c1,_0x3636de){return client['request'](_0x2fb21d,_0x7429ca)['then'](function(_0x4775c0){logger[_0x7672('0x9')](_0x7672('0xa'),_0x3abea8,_0x7672('0xb'));logger[_0x7672('0xc')](_0x7672('0xd'),_0x3abea8,_0x7672('0xb'),JSON[_0x7672('0xe')](_0x4775c0));if(_0x4775c0[_0x7672('0xf')]){if(_0x4775c0[_0x7672('0xf')][_0x7672('0x10')]===0x1f4){logger[_0x7672('0xf')](_0x7672('0xa'),_0x3abea8,_0x4775c0[_0x7672('0xf')][_0x7672('0x11')]);return _0x3636de(_0x4775c0[_0x7672('0xf')][_0x7672('0x11')]);}logger[_0x7672('0xf')](_0x7672('0xa'),_0x3abea8,_0x4775c0[_0x7672('0xf')][_0x7672('0x11')]);return _0x4474c1(_0x4775c0['error'][_0x7672('0x11')]);}else{logger[_0x7672('0x9')](_0x7672('0xa'),_0x3abea8,_0x7672('0xb'));_0x4474c1(_0x4775c0[_0x7672('0x12')][_0x7672('0x11')]);}})['catch'](function(_0x4a22c1){logger[_0x7672('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x3abea8,_0x4a22c1);_0x3636de(_0x4a22c1);});});}
\ No newline at end of file
diff --git a/server/api/license/index.js b/server/api/license/index.js
index 90b56b4..969680c 100644
--- a/server/api/license/index.js
+++ b/server/api/license/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6df5=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','isAuthenticated','update','exports'];(function(_0x409ec2,_0x1270c4){var _0x2a811c=function(_0x5a6035){while(--_0x5a6035){_0x409ec2['push'](_0x409ec2['shift']());}};_0x2a811c(++_0x1270c4);}(_0x6df5,0x1c7));var _0x56df=function(_0x1d8d9e,_0x20b77b){_0x1d8d9e=_0x1d8d9e-0x0;var _0x151b9d=_0x6df5[_0x1d8d9e];return _0x151b9d;};'use strict';var multer=require(_0x56df('0x0'));var util=require(_0x56df('0x1'));var path=require(_0x56df('0x2'));var timeout=require('connect-timeout');var express=require(_0x56df('0x3'));var router=express['Router']();var auth=require(_0x56df('0x4'));var interaction=require(_0x56df('0x5'));var config=require(_0x56df('0x6'));var controller=require(_0x56df('0x7'));router[_0x56df('0x8')]('/',controller[_0x56df('0x9')]);router['put']('/:id',auth[_0x56df('0xa')](),controller[_0x56df('0xb')]);module[_0x56df('0xc')]=router;
\ No newline at end of file
+var _0xf96d=['../../config/environment','./license.controller','get','put','/:id','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xf96d,0xcb));var _0xdf96=function(_0x4b2a50,_0x263a05){_0x4b2a50=_0x4b2a50-0x0;var _0xb30673=_0xf96d[_0x4b2a50];return _0xb30673;};'use strict';var multer=require(_0xdf96('0x0'));var util=require(_0xdf96('0x1'));var path=require(_0xdf96('0x2'));var timeout=require(_0xdf96('0x3'));var express=require(_0xdf96('0x4'));var router=express[_0xdf96('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf96('0x6'));var config=require(_0xdf96('0x7'));var controller=require(_0xdf96('0x8'));router[_0xdf96('0x9')]('/',controller['index']);router[_0xdf96('0xa')](_0xdf96('0xb'),auth[_0xdf96('0xc')](),controller['update']);module[_0xdf96('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js
index 2bcef80..372415f 100644
--- a/server/api/license/license.attributes.js
+++ b/server/api/license/license.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe2fe=['STRING','INTEGER','sequelize'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xee2f('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xee2f('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6d38=['exports','TEXT','STRING'];(function(_0x5af0d9,_0x268bcc){var _0xd83390=function(_0x42c6c5){while(--_0x42c6c5){_0x5af0d9['push'](_0x5af0d9['shift']());}};_0xd83390(++_0x268bcc);}(_0x6d38,0x1ef));var _0x86d3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6d38[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0x86d3('0x0')]={'license':{'type':Sequelize[_0x86d3('0x1')]},'data1':{'type':Sequelize[_0x86d3('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js
index a926e2c..1ac3217 100644
--- a/server/api/license/license.controller.js
+++ b/server/api/license/license.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a13=['fields','options','getLicense','catch','update','body','License','find','get','checkLicense','key','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','reject','then','error','stack','name','send','../../config/license/util','index','model','keys','rawAttributes','query','filters','intersection','attributes'];(function(_0x18cd55,_0x314fc4){var _0x295117=function(_0x18b2d7){while(--_0x18b2d7){_0x18cd55['push'](_0x18cd55['shift']());}};_0x295117(++_0x314fc4);}(_0x7a13,0x1af));var _0x37a1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7a13[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x37a1('0x0'));var emlformat=require(_0x37a1('0x1'));var rimraf=require(_0x37a1('0x2'));var zipdir=require(_0x37a1('0x3'));var jsonpatch=require(_0x37a1('0x4'));var rp=require(_0x37a1('0x5'));var moment=require(_0x37a1('0x6'));var BPromise=require(_0x37a1('0x7'));var Mustache=require(_0x37a1('0x8'));var util=require('util');var path=require(_0x37a1('0x9'));var sox=require(_0x37a1('0xa'));var csv=require(_0x37a1('0xb'));var ejs=require(_0x37a1('0xc'));var fs=require('fs');var _=require(_0x37a1('0xd'));var squel=require(_0x37a1('0xe'));var crypto=require(_0x37a1('0xf'));var jsforce=require(_0x37a1('0x10'));var deskjs=require(_0x37a1('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x37a1('0x12'));var Redis=require(_0x37a1('0x13'));var authService=require(_0x37a1('0x14'));var qs=require(_0x37a1('0x15'));var as=require(_0x37a1('0x16'));var hardwareService=require(_0x37a1('0x17'));var logger=require(_0x37a1('0x18'))('api');var utils=require(_0x37a1('0x19'));var config=require(_0x37a1('0x1a'));var db=require(_0x37a1('0x1b'))['db'];function respondWithStatusCode(_0x2e4a55,_0x388a30){_0x388a30=_0x388a30||0xcc;return function(_0x5eab9e){if(_0x5eab9e){return _0x2e4a55[_0x37a1('0x1c')](_0x388a30);}return _0x2e4a55[_0x37a1('0x1d')](_0x388a30)[_0x37a1('0x1e')]();};}function respondWithResult(_0x2ebc40,_0x58b8fb){_0x58b8fb=_0x58b8fb||0xc8;return function(_0x2b54df){if(_0x2b54df){return _0x2ebc40['status'](_0x58b8fb)[_0x37a1('0x1f')](_0x2b54df);}};}function respondWithFilteredResult(_0x3f3f33,_0x2de801){return function(_0x5ce9e7){if(_0x5ce9e7){var _0x5ce260=_0x5ce9e7['count'],_0x480d56=_0x2de801[_0x37a1('0x20')],_0x402998=_0x2de801['offset']+_0x2de801['limit'],_0x1d7a84;if(_0x402998>=_0x5ce260){_0x402998=_0x5ce260;_0x1d7a84=0xc8;}else{_0x1d7a84=0xce;}_0x3f3f33[_0x37a1('0x1d')](_0x1d7a84);return _0x3f3f33['set'](_0x37a1('0x21'),_0x480d56+'-'+_0x402998+'/'+_0x5ce260)['json'](_0x5ce9e7);}return null;};}function patchUpdates(_0x4fed63){return function(_0x232622){try{jsonpatch['apply'](_0x232622,_0x4fed63,!![]);}catch(_0x216682){return BPromise[_0x37a1('0x22')](_0x216682);}return _0x232622['save']();};}function saveUpdates(_0x1b6aa7,_0x5d120f){return function(_0x593963){if(_0x593963){return _0x593963['update'](_0x1b6aa7)[_0x37a1('0x23')](function(_0x5e3230){return _0x5e3230;});}return null;};}function removeEntity(_0x4156a6,_0x540c97){return function(_0x15929c){if(_0x15929c){return _0x15929c['destroy']()[_0x37a1('0x23')](function(){_0x4156a6[_0x37a1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2efbf3,_0x57b905){return function(_0x175ae4){if(!_0x175ae4){_0x2efbf3['sendStatus'](0x194);}return _0x175ae4;};}function handleError(_0x107278,_0x46f2a8){_0x46f2a8=_0x46f2a8||0x1f4;return function(_0x305e25){logger[_0x37a1('0x24')](_0x305e25[_0x37a1('0x25')]);if(_0x305e25[_0x37a1('0x26')]){delete _0x305e25[_0x37a1('0x26')];}_0x107278[_0x37a1('0x1d')](_0x46f2a8)[_0x37a1('0x27')](_0x305e25);};}var utilLicense=require(_0x37a1('0x28'));exports[_0x37a1('0x29')]=function(_0x5be7e1,_0x236427){var _0x1f839e={'raw':!![],'where':{'id':0x1}},_0x5a8e68={};_0x5a8e68[_0x37a1('0x2a')]=_[_0x37a1('0x2b')](db['License'][_0x37a1('0x2c')]);_0x5a8e68[_0x37a1('0x2d')]=_[_0x37a1('0x2b')](_0x5be7e1[_0x37a1('0x2d')]);_0x5a8e68[_0x37a1('0x2e')]=_[_0x37a1('0x2f')](_0x5a8e68['model'],_0x5a8e68[_0x37a1('0x2d')]);_0x1f839e[_0x37a1('0x30')]=_['intersection'](_0x5a8e68[_0x37a1('0x2a')],qs[_0x37a1('0x31')](_0x5be7e1[_0x37a1('0x2d')][_0x37a1('0x31')]));_0x1f839e[_0x37a1('0x30')]=_0x1f839e[_0x37a1('0x30')]['length']?_0x1f839e[_0x37a1('0x30')]:_0x5a8e68['model'];_0x1f839e=_['merge']({},_0x1f839e,_0x5be7e1[_0x37a1('0x32')]);return utilLicense[_0x37a1('0x33')](_0x1f839e)[_0x37a1('0x23')](respondWithResult(_0x236427,null))[_0x37a1('0x34')](handleError(_0x236427,null));};exports[_0x37a1('0x35')]=function(_0x4187ac,_0x4dd509){if(_0x4187ac['body']['id']){delete _0x4187ac[_0x37a1('0x36')]['id'];}return db[_0x37a1('0x37')][_0x37a1('0x38')]({'where':{'id':_0x4187ac['params']['id']}})[_0x37a1('0x23')](handleEntityNotFound(_0x4dd509,null))[_0x37a1('0x23')](function(_0x649f5e){var _0x30ba8a=_0x649f5e[_0x37a1('0x39')]({'plain':!![]});return utilLicense[_0x37a1('0x3a')](_0x30ba8a,_0x4187ac['body'][_0x37a1('0x3b')]);})['then'](function(_0x39cd91){if(!_0x39cd91['demo']){return saveUpdates(_0x4187ac[_0x37a1('0x36')],null);}return _0x39cd91;})[_0x37a1('0x23')](respondWithResult(_0x4dd509,null))[_0x37a1('0x34')](handleError(_0x4dd509,null));};
\ No newline at end of file
+var _0xb251=['catch','body','find','checkLicense','key','demo','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','../../config/license/util','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense'];(function(_0xce4281,_0x45c7bc){var _0x285894=function(_0x208c7c){while(--_0x208c7c){_0xce4281['push'](_0xce4281['shift']());}};_0x285894(++_0x45c7bc);}(_0xb251,0x7e));var _0x1b25=function(_0x329068,_0x4d0c4e){_0x329068=_0x329068-0x0;var _0x717241=_0xb251[_0x329068];return _0x717241;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1b25('0x0'));var zipdir=require(_0x1b25('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b25('0x2'));var moment=require(_0x1b25('0x3'));var BPromise=require(_0x1b25('0x4'));var Mustache=require(_0x1b25('0x5'));var util=require(_0x1b25('0x6'));var path=require('path');var sox=require(_0x1b25('0x7'));var csv=require('to-csv');var ejs=require(_0x1b25('0x8'));var fs=require('fs');var _=require(_0x1b25('0x9'));var squel=require(_0x1b25('0xa'));var crypto=require(_0x1b25('0xb'));var jsforce=require(_0x1b25('0xc'));var deskjs=require(_0x1b25('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1b25('0xe'));var Papa=require('papaparse');var Redis=require(_0x1b25('0xf'));var authService=require(_0x1b25('0x10'));var qs=require(_0x1b25('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b25('0x12'))(_0x1b25('0x13'));var utils=require(_0x1b25('0x14'));var config=require(_0x1b25('0x15'));var db=require(_0x1b25('0x16'))['db'];function respondWithStatusCode(_0x1e91ea,_0x3069d9){_0x3069d9=_0x3069d9||0xcc;return function(_0x1e43fb){if(_0x1e43fb){return _0x1e91ea['sendStatus'](_0x3069d9);}return _0x1e91ea[_0x1b25('0x17')](_0x3069d9)['end']();};}function respondWithResult(_0x58f781,_0xed849c){_0xed849c=_0xed849c||0xc8;return function(_0x1cb15d){if(_0x1cb15d){return _0x58f781['status'](_0xed849c)[_0x1b25('0x18')](_0x1cb15d);}};}function respondWithFilteredResult(_0x1b8f60,_0x22bd15){return function(_0x5c486f){if(_0x5c486f){var _0x57333e=_0x5c486f[_0x1b25('0x19')],_0xf6f4e7=_0x22bd15[_0x1b25('0x1a')],_0x1a4d45=_0x22bd15[_0x1b25('0x1a')]+_0x22bd15[_0x1b25('0x1b')],_0x5302d6;if(_0x1a4d45>=_0x57333e){_0x1a4d45=_0x57333e;_0x5302d6=0xc8;}else{_0x5302d6=0xce;}_0x1b8f60[_0x1b25('0x17')](_0x5302d6);return _0x1b8f60['set'](_0x1b25('0x1c'),_0xf6f4e7+'-'+_0x1a4d45+'/'+_0x57333e)[_0x1b25('0x18')](_0x5c486f);}return null;};}function patchUpdates(_0x4f2e92){return function(_0x3e2777){try{jsonpatch[_0x1b25('0x1d')](_0x3e2777,_0x4f2e92,!![]);}catch(_0x4381f7){return BPromise[_0x1b25('0x1e')](_0x4381f7);}return _0x3e2777[_0x1b25('0x1f')]();};}function saveUpdates(_0x42c30f,_0x3d964e){return function(_0x5b5e0d){if(_0x5b5e0d){return _0x5b5e0d[_0x1b25('0x20')](_0x42c30f)[_0x1b25('0x21')](function(_0x128db9){return _0x128db9;});}return null;};}function removeEntity(_0x209c31,_0x56cf6c){return function(_0x484d71){if(_0x484d71){return _0x484d71[_0x1b25('0x22')]()[_0x1b25('0x21')](function(){_0x209c31['status'](0xcc)[_0x1b25('0x23')]();});}};}function handleEntityNotFound(_0x5a8bf0,_0x1a0540){return function(_0x3b49c3){if(!_0x3b49c3){_0x5a8bf0[_0x1b25('0x24')](0x194);}return _0x3b49c3;};}function handleError(_0x4d7c46,_0x4b2aaa){_0x4b2aaa=_0x4b2aaa||0x1f4;return function(_0x215fb7){logger[_0x1b25('0x25')](_0x215fb7[_0x1b25('0x26')]);if(_0x215fb7[_0x1b25('0x27')]){delete _0x215fb7[_0x1b25('0x27')];}_0x4d7c46[_0x1b25('0x17')](_0x4b2aaa)['send'](_0x215fb7);};}var utilLicense=require(_0x1b25('0x28'));exports[_0x1b25('0x29')]=function(_0x2ee333,_0x370d28){var _0x2445e5={'raw':!![],'where':{'id':0x1}},_0x5b3404={};_0x5b3404[_0x1b25('0x2a')]=_[_0x1b25('0x2b')](db['License'][_0x1b25('0x2c')]);_0x5b3404[_0x1b25('0x2d')]=_[_0x1b25('0x2b')](_0x2ee333[_0x1b25('0x2d')]);_0x5b3404[_0x1b25('0x2e')]=_[_0x1b25('0x2f')](_0x5b3404['model'],_0x5b3404[_0x1b25('0x2d')]);_0x2445e5[_0x1b25('0x30')]=_[_0x1b25('0x2f')](_0x5b3404[_0x1b25('0x2a')],qs[_0x1b25('0x31')](_0x2ee333['query'][_0x1b25('0x31')]));_0x2445e5[_0x1b25('0x30')]=_0x2445e5[_0x1b25('0x30')][_0x1b25('0x32')]?_0x2445e5['attributes']:_0x5b3404[_0x1b25('0x2a')];_0x2445e5=_[_0x1b25('0x33')]({},_0x2445e5,_0x2ee333[_0x1b25('0x34')]);return utilLicense[_0x1b25('0x35')](_0x2445e5)['then'](respondWithResult(_0x370d28,null))[_0x1b25('0x36')](handleError(_0x370d28,null));};exports[_0x1b25('0x20')]=function(_0x3a2e8e,_0x331f53){if(_0x3a2e8e[_0x1b25('0x37')]['id']){delete _0x3a2e8e[_0x1b25('0x37')]['id'];}return db['License'][_0x1b25('0x38')]({'where':{'id':_0x3a2e8e['params']['id']}})[_0x1b25('0x21')](handleEntityNotFound(_0x331f53,null))[_0x1b25('0x21')](function(_0x5af5c9){var _0x1e5b0c=_0x5af5c9['get']({'plain':!![]});return utilLicense[_0x1b25('0x39')](_0x1e5b0c,_0x3a2e8e[_0x1b25('0x37')][_0x1b25('0x3a')]);})['then'](function(_0x16955f){if(!_0x16955f[_0x1b25('0x3b')]){return saveUpdates(_0x3a2e8e[_0x1b25('0x37')],null);}return _0x16955f;})[_0x1b25('0x21')](respondWithResult(_0x331f53,null))[_0x1b25('0x36')](handleError(_0x331f53,null));};
\ No newline at end of file
diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js
index 4d51efd..fe847d9 100644
--- a/server/api/license/license.model.js
+++ b/server/api/license/license.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d6135,_0x256136){_0x3d6135=_0x3d6135-0x0;var _0x16f3c1=_0xb10b[_0x3d6135];return _0x16f3c1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('License',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','license','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1b27cb,_0x496c64){var _0x57184c=function(_0x5a54e6){while(--_0x5a54e6){_0x1b27cb['push'](_0x1b27cb['shift']());}};_0x57184c(++_0x496c64);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./license.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('License',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js
index a7c8879..a8f8596 100644
--- a/server/api/license/license.rpc.js
+++ b/server/api/license/license.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbbfa=['License,\x20%s,\x20%s,\x20%s','error','code','License,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x276f25,_0x4e485b){var _0x3bb4fa=function(_0x21c5f5){while(--_0x21c5f5){_0x276f25['push'](_0x276f25['shift']());}};_0x3bb4fa(++_0x4e485b);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x504575,_0x1ad9e0){_0x504575=_0x504575-0x0;var _0x4484cc=_0xbbfa[_0x504575];return _0x4484cc;};'use strict';var _=require(_0xabbf('0x0'));var util=require('util');var moment=require(_0xabbf('0x1'));var BPromise=require('bluebird');var rs=require(_0xabbf('0x2'));var fs=require('fs');var Redis=require(_0xabbf('0x3'));var db=require(_0xabbf('0x4'))['db'];var utils=require(_0xabbf('0x5'));var logger=require(_0xabbf('0x6'))(_0xabbf('0x7'));var config=require(_0xabbf('0x8'));var jayson=require(_0xabbf('0x9'));var client=jayson[_0xabbf('0xa')][_0xabbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45b7d6,_0x58f0a8,_0x5b471b){return new BPromise(function(_0x536a4c,_0x1380cd){return client[_0xabbf('0xc')](_0x45b7d6,_0x5b471b)['then'](function(_0x5f35ee){logger[_0xabbf('0xd')]('License,\x20%s,\x20%s',_0x58f0a8,_0xabbf('0xe'));logger['debug'](_0xabbf('0xf'),_0x58f0a8,'request\x20sent',JSON['stringify'](_0x5f35ee));if(_0x5f35ee[_0xabbf('0x10')]){if(_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x11')]===0x1f4){logger[_0xabbf('0x10')](_0xabbf('0x12'),_0x58f0a8,_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x13')]);return _0x1380cd(_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x13')]);}logger['error'](_0xabbf('0x12'),_0x58f0a8,_0x5f35ee['error'][_0xabbf('0x13')]);return _0x536a4c(_0x5f35ee['error'][_0xabbf('0x13')]);}else{logger[_0xabbf('0xd')](_0xabbf('0x12'),_0x58f0a8,_0xabbf('0xe'));_0x536a4c(_0x5f35ee['result'][_0xabbf('0x13')]);}})[_0xabbf('0x14')](function(_0x31245d){logger[_0xabbf('0x10')](_0xabbf('0x12'),_0x58f0a8,_0x31245d);_0x1380cd(_0x31245d);});});}
\ No newline at end of file
+var _0x3402=['jayson/promise','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3402,0x1f0));var _0x2340=function(_0xc41b70,_0x18dc25){_0xc41b70=_0xc41b70-0x0;var _0x59949d=_0x3402[_0xc41b70];return _0x59949d;};'use strict';var _=require(_0x2340('0x0'));var util=require('util');var moment=require(_0x2340('0x1'));var BPromise=require(_0x2340('0x2'));var rs=require(_0x2340('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2340('0x4'));var logger=require(_0x2340('0x5'))(_0x2340('0x6'));var config=require(_0x2340('0x7'));var jayson=require(_0x2340('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc37850,_0x1deef4,_0x16174f){return new BPromise(function(_0x225250,_0x152e52){return client['request'](_0xc37850,_0x16174f)[_0x2340('0x9')](function(_0x1da381){logger[_0x2340('0xa')](_0x2340('0xb'),_0x1deef4,_0x2340('0xc'));logger['debug'](_0x2340('0xd'),_0x1deef4,_0x2340('0xc'),JSON['stringify'](_0x1da381));if(_0x1da381['error']){if(_0x1da381[_0x2340('0xe')]['code']===0x1f4){logger[_0x2340('0xe')]('License,\x20%s,\x20%s',_0x1deef4,_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);return _0x152e52(_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);}logger[_0x2340('0xe')](_0x2340('0xb'),_0x1deef4,_0x1da381[_0x2340('0xe')]['message']);return _0x225250(_0x1da381[_0x2340('0xe')][_0x2340('0xf')]);}else{logger[_0x2340('0xa')]('License,\x20%s,\x20%s',_0x1deef4,_0x2340('0xc'));_0x225250(_0x1da381[_0x2340('0x10')][_0x2340('0xf')]);}})[_0x2340('0x11')](function(_0x4dcab6){logger[_0x2340('0xe')](_0x2340('0xb'),_0x1deef4,_0x4dcab6);_0x152e52(_0x4dcab6);});});}
\ No newline at end of file
diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js
index 899c99b..7106aa7 100644
--- a/server/api/mailAccount/index.js
+++ b/server/api/mailAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x514e=['verifySmtp','getAgents','addDisposition','post','addAnswer','create','/:id/out_servers','addSmtp','/:id/interactions','addInteraction','addApplications','send','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','util','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','getInteractions','/:id/applications','getApplications','getMessages'];(function(_0x216370,_0x4b9c47){var _0x93aa9d=function(_0x2f1ca4){while(--_0x2f1ca4){_0x216370['push'](_0x216370['shift']());}};_0x93aa9d(++_0x4b9c47);}(_0x514e,0x73));var _0xe514=function(_0x2c5018,_0x17078a){_0x2c5018=_0x2c5018-0x0;var _0x14a42b=_0x514e[_0x2c5018];return _0x14a42b;};'use strict';var multer=require('multer');var util=require(_0xe514('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe514('0x1'));var router=express[_0xe514('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe514('0x3'));var config=require(_0xe514('0x4'));var controller=require('./mailAccount.controller');router[_0xe514('0x5')]('/',auth[_0xe514('0x6')](),controller[_0xe514('0x7')]);router[_0xe514('0x5')](_0xe514('0x8'),auth[_0xe514('0x6')](),controller[_0xe514('0x9')]);router['get']('/:id',auth[_0xe514('0x6')](),controller[_0xe514('0xa')]);router[_0xe514('0x5')](_0xe514('0xb'),auth[_0xe514('0x6')](),controller[_0xe514('0xc')]);router[_0xe514('0x5')](_0xe514('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xe514('0x5')](_0xe514('0xe'),auth[_0xe514('0x6')](),controller[_0xe514('0xf')]);router[_0xe514('0x5')]('/:id/out_servers',auth['isAuthenticated'](),controller['getSmtp']);router[_0xe514('0x5')]('/:id/interactions',auth[_0xe514('0x6')](),controller[_0xe514('0x10')]);router['get'](_0xe514('0x11'),auth[_0xe514('0x6')](),controller[_0xe514('0x12')]);router[_0xe514('0x5')]('/:id/messages',auth[_0xe514('0x6')](),controller[_0xe514('0x13')]);router[_0xe514('0x5')]('/:id/verify',auth[_0xe514('0x6')](),controller[_0xe514('0x14')]);router[_0xe514('0x5')]('/:id/users',auth[_0xe514('0x6')](),controller[_0xe514('0x15')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe514('0x16')]);router[_0xe514('0x17')](_0xe514('0xd'),auth[_0xe514('0x6')](),controller[_0xe514('0x18')]);router['post']('/',auth[_0xe514('0x6')](),controller[_0xe514('0x19')]);router[_0xe514('0x17')](_0xe514('0xe'),auth[_0xe514('0x6')](),controller['addImap']);router[_0xe514('0x17')](_0xe514('0x1a'),auth[_0xe514('0x6')](),controller[_0xe514('0x1b')]);router[_0xe514('0x17')](_0xe514('0x1c'),auth[_0xe514('0x6')](),controller[_0xe514('0x1d')]);router[_0xe514('0x17')](_0xe514('0x11'),auth[_0xe514('0x6')](),controller[_0xe514('0x1e')]);router[_0xe514('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xe514('0x1f')]);router[_0xe514('0x17')](_0xe514('0x20'),auth[_0xe514('0x6')](),controller[_0xe514('0x21')]);router[_0xe514('0x22')](_0xe514('0x23'),auth['isAuthenticated'](),controller[_0xe514('0x24')]);router[_0xe514('0x25')](_0xe514('0xb'),auth[_0xe514('0x6')](),controller[_0xe514('0x26')]);router[_0xe514('0x25')]('/:id/canned_answers',auth[_0xe514('0x6')](),controller[_0xe514('0x27')]);router[_0xe514('0x25')]('/:id/in_servers',auth[_0xe514('0x6')](),controller[_0xe514('0x28')]);router[_0xe514('0x25')](_0xe514('0x1a'),auth['isAuthenticated'](),controller[_0xe514('0x29')]);router['delete'](_0xe514('0x23'),auth[_0xe514('0x6')](),controller[_0xe514('0x2a')]);router[_0xe514('0x25')](_0xe514('0x20'),auth[_0xe514('0x6')](),controller[_0xe514('0x2b')]);module[_0xe514('0x2c')]=router;
\ No newline at end of file
+var _0xcaa6=['./mailAccount.controller','/describe','isAuthenticated','get','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','post','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','put','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5c88c8,_0x2c04cf){var _0x7b15d5=function(_0x3435dd){while(--_0x3435dd){_0x5c88c8['push'](_0x5c88c8['shift']());}};_0x7b15d5(++_0x2c04cf);}(_0xcaa6,0x114));var _0x6caa=function(_0xc73508,_0x1bbe66){_0xc73508=_0xc73508-0x0;var _0x1e2c69=_0xcaa6[_0xc73508];return _0x1e2c69;};'use strict';var multer=require(_0x6caa('0x0'));var util=require(_0x6caa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6caa('0x2'));var router=express[_0x6caa('0x3')]();var auth=require(_0x6caa('0x4'));var interaction=require(_0x6caa('0x5'));var config=require('../../config/environment');var controller=require(_0x6caa('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6caa('0x7'),auth[_0x6caa('0x8')](),controller['describe']);router[_0x6caa('0x9')](_0x6caa('0xa'),auth[_0x6caa('0x8')](),controller[_0x6caa('0xb')]);router[_0x6caa('0x9')](_0x6caa('0xc'),auth['isAuthenticated'](),controller[_0x6caa('0xd')]);router[_0x6caa('0x9')]('/:id/canned_answers',auth[_0x6caa('0x8')](),controller[_0x6caa('0xe')]);router['get'](_0x6caa('0xf'),auth['isAuthenticated'](),controller[_0x6caa('0x10')]);router[_0x6caa('0x9')](_0x6caa('0x11'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x12')]);router[_0x6caa('0x9')](_0x6caa('0x13'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x14')]);router[_0x6caa('0x9')](_0x6caa('0x15'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x16')]);router['get'](_0x6caa('0x17'),auth[_0x6caa('0x8')](),controller['getMessages']);router[_0x6caa('0x9')](_0x6caa('0x18'),auth['isAuthenticated'](),controller[_0x6caa('0x19')]);router[_0x6caa('0x9')](_0x6caa('0x1a'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x1b')]);router['post'](_0x6caa('0xc'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x1c')]);router[_0x6caa('0x1d')]('/:id/canned_answers',auth[_0x6caa('0x8')](),controller[_0x6caa('0x1e')]);router[_0x6caa('0x1d')]('/',auth[_0x6caa('0x8')](),controller[_0x6caa('0x1f')]);router[_0x6caa('0x1d')](_0x6caa('0xf'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x20')]);router[_0x6caa('0x1d')](_0x6caa('0x11'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x21')]);router[_0x6caa('0x1d')](_0x6caa('0x13'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x22')]);router[_0x6caa('0x1d')](_0x6caa('0x15'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x23')]);router['post'](_0x6caa('0x24'),auth[_0x6caa('0x8')](),controller['send']);router[_0x6caa('0x1d')](_0x6caa('0x1a'),auth[_0x6caa('0x8')](),controller['addAgents']);router[_0x6caa('0x25')](_0x6caa('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x6caa('0x26')](_0x6caa('0xc'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x27')]);router[_0x6caa('0x26')](_0x6caa('0x28'),auth['isAuthenticated'](),controller[_0x6caa('0x29')]);router[_0x6caa('0x26')](_0x6caa('0xf'),auth['isAuthenticated'](),controller[_0x6caa('0x2a')]);router[_0x6caa('0x26')](_0x6caa('0x11'),auth[_0x6caa('0x8')](),controller[_0x6caa('0x2b')]);router[_0x6caa('0x26')](_0x6caa('0xa'),auth['isAuthenticated'](),controller[_0x6caa('0x2c')]);router[_0x6caa('0x26')]('/:id/users',auth[_0x6caa('0x8')](),controller[_0x6caa('0x2d')]);module[_0x6caa('0x2e')]=router;
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js
index b7d9d7b..f8b3c6d 100644
--- a/server/api/mailAccount/mailAccount.attributes.js
+++ b/server/api/mailAccount/mailAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x19b7=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}} Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x3dafe6,_0x7bcc30){var _0xe8e073=function(_0x244160){while(--_0x244160){_0x3dafe6['push'](_0x3dafe6['shift']());}};_0xe8e073(++_0x7bcc30);}(_0x19b7,0xcb));var _0x719b=function(_0x573e33,_0xea7dd9){_0x573e33=_0x573e33-0x0;var _0x1b20b5=_0x19b7[_0x573e33];return _0x1b20b5;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x719b('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x719b('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x719b('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x719b('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x719b('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x719b('0x2')]},'markAsUnread':{'type':Sequelize[_0x719b('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x719b('0x0')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x719b('0x3')](0x2)[_0x719b('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x719b('0x2')],'defaultValue':function(){return _0x719b('0x5');}},'notificationSound':{'type':Sequelize[_0x719b('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x719b('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x719b('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x719b('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x719b('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x719b('0x3')],'allowNull':!![],'defaultValue':null,'comment':_0x719b('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x719b('0x1')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x14a99e){if(!_0x14a99e)this[_0x719b('0x7')](_0x719b('0x8'),null);this[_0x719b('0x7')](_0x719b('0x9'),_0x14a99e);}}};
\ No newline at end of file
+var _0xac0a=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}} Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','BOOLEAN'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xac0a,0x6a));var _0xaac0=function(_0x27933b,_0x2769ee){_0x27933b=_0x27933b-0x0;var _0x3065b9=_0xac0a[_0x27933b];return _0x3065b9;};'use strict';var Sequelize=require(_0xaac0('0x0'));module[_0xaac0('0x1')]={'description':{'type':Sequelize[_0xaac0('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xaac0('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xaac0('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xaac0('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xaac0('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xaac0('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xaac0('0x2')],'allowNull':![],'defaultValue':_0xaac0('0x4')},'fontSize':{'type':Sequelize[_0xaac0('0x5')](0x2)[_0xaac0('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xaac0('0x7');}},'notificationSound':{'type':Sequelize[_0xaac0('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xaac0('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaac0('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaac0('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaac0('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaac0('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xaac0('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xaac0('0x3')],'defaultValue':![],'comment':_0xaac0('0x9'),'set':function(_0x146ff5){if(!_0x146ff5)this[_0xaac0('0xa')]('mandatoryDispositionPauseId',null);this[_0xaac0('0xa')]('mandatoryDisposition',_0x146ff5);}}};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js
index feef9b4..8ddf9e4 100644
--- a/server/api/mailAccount/mailAccount.controller.js
+++ b/server/api/mailAccount/mailAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3dfa=['status','count','offset','limit','set','json','apply','save','then','get','MailAccounts','UserProfileResource','destroy','name','index','MailServerIn','MailServerOut','Smtp','Pause','map','rawAttributes','fieldName','type','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','rows','show','mandatoryDispositionPause','length','update','find','params','Imap','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','key','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','cpassword','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','send','CmList','List','Contacts','updatedAt','DESC','from','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','subject','attach','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end'];(function(_0x23945f,_0x9d3e4e){var _0xa38592=function(_0x406b83){while(--_0x406b83){_0x23945f['push'](_0x23945f['shift']());}};_0xa38592(++_0x9d3e4e);}(_0x3dfa,0x95));var _0xa3df=function(_0x5bf420,_0x2d068d){_0x5bf420=_0x5bf420-0x0;var _0x1c5255=_0x3dfa[_0x5bf420];return _0x1c5255;};'use strict';var pdf=require(_0xa3df('0x0'));var emlformat=require(_0xa3df('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa3df('0x2'));var jsonpatch=require(_0xa3df('0x3'));var rp=require(_0xa3df('0x4'));var moment=require('moment');var BPromise=require(_0xa3df('0x5'));var Mustache=require(_0xa3df('0x6'));var util=require(_0xa3df('0x7'));var path=require(_0xa3df('0x8'));var sox=require(_0xa3df('0x9'));var csv=require(_0xa3df('0xa'));var ejs=require(_0xa3df('0xb'));var fs=require('fs');var _=require(_0xa3df('0xc'));var squel=require(_0xa3df('0xd'));var crypto=require(_0xa3df('0xe'));var jsforce=require(_0xa3df('0xf'));var deskjs=require(_0xa3df('0x10'));var toCsv=require(_0xa3df('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa3df('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa3df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3df('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa3df('0x14'));var config=require('../../config/environment');var db=require(_0xa3df('0x15'))['db'];config[_0xa3df('0x16')]=_[_0xa3df('0x17')](config[_0xa3df('0x16')],{'host':_0xa3df('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa3df('0x16')]));require(_0xa3df('0x19'))[_0xa3df('0x1a')](socket);var jayson=require(_0xa3df('0x1b'));var client=jayson[_0xa3df('0x1c')][_0xa3df('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x752641,_0x55e29f,_0x18e762){if(_0x18e762){var _0xf52a29=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf52a29['test'](_0x55e29f)){return _0x752641;}else{throw new db['Sequelize'][(_0xa3df('0x1e'))](_0xa3df('0x1f'));}}else{return _0x752641;}}function respondWithRpcPromise(_0x1cc910,_0x3fed70,_0x4d2dae,_0x423a8c){return new BPromise(function(_0x4da63b,_0x5cc5ed){var _0x5c37cb=_0x423a8c||client;return _0x5c37cb[_0xa3df('0x20')](_0x1cc910,_0x4d2dae)['then'](function(_0x4d9261){logger['info']('MailAccount,\x20%s,\x20%s',_0x3fed70,_0xa3df('0x21'));logger[_0xa3df('0x22')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3fed70,_0xa3df('0x21'),JSON[_0xa3df('0x23')](_0x4d9261));if(_0x4d9261['error']){if(_0x4d9261[_0xa3df('0x24')]['code']===0x1f4){logger[_0xa3df('0x24')](_0xa3df('0x25'),_0x3fed70,_0x4d9261[_0xa3df('0x24')][_0xa3df('0x26')]);return _0x5cc5ed(_0x4d9261['error'][_0xa3df('0x26')]);}logger[_0xa3df('0x24')](_0xa3df('0x25'),_0x3fed70,_0x4d9261[_0xa3df('0x24')][_0xa3df('0x26')]);return _0x4da63b(_0x4d9261[_0xa3df('0x24')][_0xa3df('0x26')]);}else{logger['info'](_0xa3df('0x25'),_0x3fed70,_0xa3df('0x21'));_0x4da63b(_0x4d9261[_0xa3df('0x27')][_0xa3df('0x26')]);}})[_0xa3df('0x28')](function(_0x1d0f2b){logger[_0xa3df('0x24')]('MailAccount,\x20%s,\x20%s',_0x3fed70,_0x1d0f2b);_0x5cc5ed(_0x1d0f2b);});});}function respondWithStatusCode(_0x3e4152,_0x4117d3){_0x4117d3=_0x4117d3||0xcc;return function(_0x321c26){if(_0x321c26){return _0x3e4152[_0xa3df('0x29')](_0x4117d3);}return _0x3e4152['status'](_0x4117d3)[_0xa3df('0x2a')]();};}function respondWithResult(_0x25397e,_0x509e8a){_0x509e8a=_0x509e8a||0xc8;return function(_0x4067c8){if(_0x4067c8){return _0x25397e[_0xa3df('0x2b')](_0x509e8a)['json'](_0x4067c8);}};}function respondWithFilteredResult(_0x5f22c5,_0x1529d1){return function(_0x238e88){if(_0x238e88){var _0x15f193=_0x238e88[_0xa3df('0x2c')],_0x2e28de=_0x1529d1[_0xa3df('0x2d')],_0x426542=_0x1529d1[_0xa3df('0x2d')]+_0x1529d1[_0xa3df('0x2e')],_0x1193e3;if(_0x426542>=_0x15f193){_0x426542=_0x15f193;_0x1193e3=0xc8;}else{_0x1193e3=0xce;}_0x5f22c5[_0xa3df('0x2b')](_0x1193e3);return _0x5f22c5[_0xa3df('0x2f')]('Content-Range',_0x2e28de+'-'+_0x426542+'/'+_0x15f193)[_0xa3df('0x30')](_0x238e88);}return null;};}function patchUpdates(_0x5aa30c){return function(_0xc1a66c){try{jsonpatch[_0xa3df('0x31')](_0xc1a66c,_0x5aa30c,!![]);}catch(_0x2c81dd){return BPromise['reject'](_0x2c81dd);}return _0xc1a66c[_0xa3df('0x32')]();};}function saveUpdates(_0x4b297c,_0x2b4c35){return function(_0x109f36){if(_0x109f36){return _0x109f36['update'](_0x4b297c)[_0xa3df('0x33')](function(_0x2cc267){return _0x2cc267;});}return null;};}function removeEntity(_0x2dd53d,_0x4aeac7){return function(_0x4f9f3a){if(_0x4f9f3a){return _0x4f9f3a['destroy']()[_0xa3df('0x33')](function(){var _0x457938=_0x4f9f3a[_0xa3df('0x34')]({'plain':!![]});var _0x386548=_0xa3df('0x35');return db[_0xa3df('0x36')][_0xa3df('0x37')]({'where':{'type':_0x386548,'resourceId':_0x457938['id']}})[_0xa3df('0x33')](function(){return _0x4f9f3a;});})[_0xa3df('0x33')](function(){_0x2dd53d['status'](0xcc)[_0xa3df('0x2a')]();});}};}function handleEntityNotFound(_0x114149,_0x4de013){return function(_0xd30452){if(!_0xd30452){_0x114149['sendStatus'](0x194);}return _0xd30452;};}function handleError(_0x36112e,_0x371bb7){_0x371bb7=_0x371bb7||0x1f4;return function(_0x9b86b8){logger[_0xa3df('0x24')](_0x9b86b8['stack']);if(_0x9b86b8[_0xa3df('0x38')]){delete _0x9b86b8[_0xa3df('0x38')];}_0x36112e[_0xa3df('0x2b')](_0x371bb7)['send'](_0x9b86b8);};}exports[_0xa3df('0x39')]=function(_0x45d9d2,_0x1864da){var _0x160fb5={'include':[{'model':db[_0xa3df('0x3a')],'as':'Imap'},{'model':db[_0xa3df('0x3b')],'as':_0xa3df('0x3c')},{'model':db[_0xa3df('0x3d')],'as':'mandatoryDispositionPause'}]},_0x386719={},_0x2e210f={'count':0x0,'rows':[]};var _0xf0c69b=_[_0xa3df('0x3e')](db['MailAccount'][_0xa3df('0x3f')],function(_0x205601){return{'name':_0x205601[_0xa3df('0x40')],'type':_0x205601[_0xa3df('0x41')]['key']};});_0x386719['model']=_[_0xa3df('0x3e')](_0xf0c69b,_0xa3df('0x38'));_0x386719['query']=_[_0xa3df('0x42')](_0x45d9d2[_0xa3df('0x43')]);_0x386719['filters']=_[_0xa3df('0x44')](_0x386719[_0xa3df('0x45')],_0x386719[_0xa3df('0x43')]);_0x160fb5['attributes']=_[_0xa3df('0x44')](_0x386719['model'],qs[_0xa3df('0x46')](_0x45d9d2[_0xa3df('0x43')][_0xa3df('0x46')]));_0x160fb5[_0xa3df('0x47')]=_0x160fb5['attributes']['length']?_0x160fb5[_0xa3df('0x47')]:_0x386719[_0xa3df('0x45')];if(!_0x45d9d2[_0xa3df('0x43')][_0xa3df('0x48')](_0xa3df('0x49'))){_0x160fb5['limit']=qs['limit'](_0x45d9d2[_0xa3df('0x43')][_0xa3df('0x2e')]);_0x160fb5['offset']=qs['offset'](_0x45d9d2[_0xa3df('0x43')]['offset']);}_0x160fb5[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x45d9d2[_0xa3df('0x43')][_0xa3df('0x4b')]);_0x160fb5[_0xa3df('0x4c')]=qs[_0xa3df('0x4d')](_['pick'](_0x45d9d2['query'],_0x386719['filters']),_0xf0c69b);if(_0x45d9d2[_0xa3df('0x43')][_0xa3df('0x4e')]){_0x160fb5[_0xa3df('0x4c')]=_[_0xa3df('0x4f')](_0x160fb5[_0xa3df('0x4c')],{'$or':_[_0xa3df('0x3e')](_0xf0c69b,function(_0x113e53){if(_0x113e53['type']!==_0xa3df('0x50')){var _0x444d93={};_0x444d93[_0x113e53['name']]={'$like':'%'+_0x45d9d2[_0xa3df('0x43')]['filter']+'%'};return _0x444d93;}})});}_0x160fb5=_[_0xa3df('0x4f')]({},_0x160fb5,_0x45d9d2[_0xa3df('0x51')]);var _0x4d4cc1={'where':_0x160fb5[_0xa3df('0x4c')]};return db[_0xa3df('0x52')][_0xa3df('0x2c')](_0x4d4cc1)[_0xa3df('0x33')](function(_0x41497f){_0x2e210f[_0xa3df('0x2c')]=_0x41497f;if(_0x45d9d2[_0xa3df('0x43')][_0xa3df('0x53')]){_0x160fb5[_0xa3df('0x54')]=[{'all':!![]}];}return db[_0xa3df('0x52')][_0xa3df('0x55')](_0x160fb5);})[_0xa3df('0x33')](function(_0x5428c9){_0x2e210f[_0xa3df('0x56')]=_0x5428c9;return _0x2e210f;})[_0xa3df('0x33')](respondWithFilteredResult(_0x1864da,_0x160fb5))[_0xa3df('0x28')](handleError(_0x1864da,null));};exports[_0xa3df('0x57')]=function(_0x4383df,_0x2d08c1){var _0x5ad79d={'raw':![],'where':{'id':_0x4383df['params']['id']},'include':[{'model':db[_0xa3df('0x3a')],'as':'Imap'},{'model':db[_0xa3df('0x3b')],'as':_0xa3df('0x3c')},{'model':db[_0xa3df('0x3d')],'as':_0xa3df('0x58')}]},_0x5e1426={};_0x5e1426[_0xa3df('0x45')]=_[_0xa3df('0x42')](db[_0xa3df('0x52')]['rawAttributes']);_0x5e1426[_0xa3df('0x43')]=_['keys'](_0x4383df['query']);_0x5e1426[_0xa3df('0x4d')]=_['intersection'](_0x5e1426[_0xa3df('0x45')],_0x5e1426[_0xa3df('0x43')]);_0x5ad79d[_0xa3df('0x47')]=_[_0xa3df('0x44')](_0x5e1426[_0xa3df('0x45')],qs[_0xa3df('0x46')](_0x4383df[_0xa3df('0x43')][_0xa3df('0x46')]));_0x5ad79d['attributes']=_0x5ad79d[_0xa3df('0x47')][_0xa3df('0x59')]?_0x5ad79d[_0xa3df('0x47')]:_0x5e1426[_0xa3df('0x45')];if(_0x4383df[_0xa3df('0x43')][_0xa3df('0x53')]){_0x5ad79d['include']=[{'all':!![]}];}_0x5ad79d=_[_0xa3df('0x4f')]({},_0x5ad79d,_0x4383df[_0xa3df('0x51')]);return db[_0xa3df('0x52')]['find'](_0x5ad79d)[_0xa3df('0x33')](handleEntityNotFound(_0x2d08c1,null))[_0xa3df('0x33')](respondWithResult(_0x2d08c1,null))['catch'](handleError(_0x2d08c1,null));};exports[_0xa3df('0x5a')]=function(_0x4113ba,_0x4640e1){if(_0x4113ba['body']['id']){delete _0x4113ba['body']['id'];}return db[_0xa3df('0x52')][_0xa3df('0x5b')]({'where':{'id':_0x4113ba[_0xa3df('0x5c')]['id']},'include':[{'model':db[_0xa3df('0x3a')],'as':_0xa3df('0x5d')},{'model':db['MailServerOut'],'as':_0xa3df('0x3c')},{'model':db[_0xa3df('0x3d')],'as':'mandatoryDispositionPause'}]})[_0xa3df('0x33')](handleEntityNotFound(_0x4640e1,null))['then'](saveUpdates(_0x4113ba[_0xa3df('0x5e')],null))[_0xa3df('0x33')](function(_0x8e245){if(_0x8e245&&_0x4113ba['body'][_0xa3df('0x5d')]){return db['MailServerIn'][_0xa3df('0x5a')](_0x4113ba[_0xa3df('0x5e')][_0xa3df('0x5d')],{'where':{'MailAccountId':_0x8e245['id']}})[_0xa3df('0x33')](function(){return _0x8e245;});}return _0x8e245;})[_0xa3df('0x33')](function(_0x3e66a0){if(_0x3e66a0&&_0x4113ba[_0xa3df('0x5e')]['Smtp']){return db[_0xa3df('0x3b')][_0xa3df('0x5a')](_0x4113ba['body'][_0xa3df('0x3c')],{'where':{'MailAccountId':_0x3e66a0['id']}})[_0xa3df('0x33')](function(){return _0x3e66a0;});}return _0x3e66a0;})[_0xa3df('0x33')](respondWithResult(_0x4640e1,null))[_0xa3df('0x28')](handleError(_0x4640e1,null));};exports['describe']=function(_0x255440,_0x42682c){return db[_0xa3df('0x52')][_0xa3df('0x5f')]()['then'](respondWithResult(_0x42682c,null))[_0xa3df('0x28')](handleError(_0x42682c,null));};exports[_0xa3df('0x60')]=function(_0x25f12b,_0x86adaa,_0x57fa9b){if(_0x25f12b['body']['id']){delete _0x25f12b['body']['id'];}return db[_0xa3df('0x52')]['find']({'where':{'id':_0x25f12b[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x86adaa,null))[_0xa3df('0x33')](function(_0x5534d9){if(_0x5534d9){_0x25f12b[_0xa3df('0x5e')][_0xa3df('0x61')]=_0x5534d9['id'];return db[_0xa3df('0x62')][_0xa3df('0x63')](_0x25f12b[_0xa3df('0x5e')]);}})[_0xa3df('0x33')](respondWithResult(_0x86adaa,null))[_0xa3df('0x28')](handleError(_0x86adaa,null));};exports[_0xa3df('0x64')]=function(_0x2313b0,_0x369797,_0x59b039){var _0x10e87a={'raw':![],'where':{}};var _0x4be5f4={};var _0x5957c3={'count':0x0,'rows':[]};return db[_0xa3df('0x52')]['findOne']({'where':{'id':_0x2313b0[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x369797,null))['then'](function(_0x31b698){if(_0x31b698){_0x4be5f4[_0xa3df('0x45')]=_['keys'](db[_0xa3df('0x62')][_0xa3df('0x3f')]);_0x4be5f4[_0xa3df('0x43')]=_['keys'](_0x2313b0[_0xa3df('0x43')]);_0x4be5f4[_0xa3df('0x4d')]=_['intersection'](_0x4be5f4[_0xa3df('0x45')],_0x4be5f4['query']);_0x10e87a[_0xa3df('0x47')]=_['intersection'](_0x4be5f4[_0xa3df('0x45')],qs[_0xa3df('0x46')](_0x2313b0[_0xa3df('0x43')][_0xa3df('0x46')]));_0x10e87a[_0xa3df('0x47')]=_0x10e87a[_0xa3df('0x47')][_0xa3df('0x59')]?_0x10e87a[_0xa3df('0x47')]:_0x4be5f4['model'];if(!_0x2313b0[_0xa3df('0x43')]['hasOwnProperty'](_0xa3df('0x49'))){_0x10e87a['limit']=qs[_0xa3df('0x2e')](_0x2313b0[_0xa3df('0x43')]['limit']);_0x10e87a['offset']=qs[_0xa3df('0x2d')](_0x2313b0['query'][_0xa3df('0x2d')]);}_0x10e87a[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x2313b0[_0xa3df('0x43')][_0xa3df('0x4b')]);_0x10e87a[_0xa3df('0x4c')]=qs['filters'](_['pick'](_0x2313b0[_0xa3df('0x43')],_0x4be5f4[_0xa3df('0x4d')]));_0x10e87a['where'][_0xa3df('0x61')]=_0x31b698['id'];if(_0x2313b0[_0xa3df('0x43')][_0xa3df('0x4e')]){_0x10e87a[_0xa3df('0x4c')]=_[_0xa3df('0x4f')](_0x10e87a[_0xa3df('0x4c')],{'$or':_[_0xa3df('0x3e')](_0x10e87a[_0xa3df('0x47')],function(_0x1c95d2){var _0x552962={};_0x552962[_0x1c95d2]={'$like':'%'+_0x2313b0[_0xa3df('0x43')][_0xa3df('0x4e')]+'%'};return _0x552962;})});}_0x10e87a=_[_0xa3df('0x4f')]({},_0x10e87a,_0x2313b0[_0xa3df('0x51')]);return db[_0xa3df('0x62')]['count']({'where':_0x10e87a[_0xa3df('0x4c')]})[_0xa3df('0x33')](function(_0x1f7679){_0x5957c3[_0xa3df('0x2c')]=_0x1f7679;if(_0x2313b0[_0xa3df('0x43')][_0xa3df('0x53')]){_0x10e87a['include']=[{'all':!![]}];}return db[_0xa3df('0x62')]['findAll'](_0x10e87a);})[_0xa3df('0x33')](function(_0x17ed2b){_0x5957c3[_0xa3df('0x56')]=_0x17ed2b;return _0x5957c3;});}})[_0xa3df('0x33')](respondWithFilteredResult(_0x369797,_0x10e87a))[_0xa3df('0x28')](handleError(_0x369797,null));};exports['removeDispositions']=function(_0x1a085c,_0xe50875,_0x3485fc){return db[_0xa3df('0x52')]['find']({'where':{'id':_0x1a085c[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0xe50875,null))['then'](function(_0x1e25b4){if(_0x1e25b4){return _0x1e25b4[_0xa3df('0x65')](_0x1a085c['query'][_0xa3df('0x66')]);}})[_0xa3df('0x33')](respondWithStatusCode(_0xe50875,null))[_0xa3df('0x28')](handleError(_0xe50875,null));};exports['addAnswer']=function(_0x3b342b,_0x58b23c,_0x5c4288){if(_0x3b342b[_0xa3df('0x5e')]['id']){delete _0x3b342b[_0xa3df('0x5e')]['id'];}return db[_0xa3df('0x52')][_0xa3df('0x5b')]({'where':{'id':_0x3b342b[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x58b23c,null))['then'](function(_0x261aef){if(_0x261aef){_0x3b342b[_0xa3df('0x5e')]['MailAccountId']=_0x261aef['id'];return db[_0xa3df('0x67')]['create'](_0x3b342b[_0xa3df('0x5e')]);}})[_0xa3df('0x33')](respondWithResult(_0x58b23c,null))[_0xa3df('0x28')](handleError(_0x58b23c,null));};exports[_0xa3df('0x68')]=function(_0x20499f,_0x13cb16,_0x4736f3){var _0x2a7d17={'raw':![],'where':{}};var _0x172572={};var _0x98e71a={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x20499f[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x13cb16,null))[_0xa3df('0x33')](function(_0x51ea5b){if(_0x51ea5b){_0x172572['model']=_['keys'](db['CannedAnswer']['rawAttributes']);_0x172572['query']=_['keys'](_0x20499f[_0xa3df('0x43')]);_0x172572[_0xa3df('0x4d')]=_[_0xa3df('0x44')](_0x172572[_0xa3df('0x45')],_0x172572[_0xa3df('0x43')]);_0x2a7d17['attributes']=_[_0xa3df('0x44')](_0x172572[_0xa3df('0x45')],qs[_0xa3df('0x46')](_0x20499f[_0xa3df('0x43')][_0xa3df('0x46')]));_0x2a7d17[_0xa3df('0x47')]=_0x2a7d17[_0xa3df('0x47')][_0xa3df('0x59')]?_0x2a7d17['attributes']:_0x172572[_0xa3df('0x45')];if(!_0x20499f[_0xa3df('0x43')][_0xa3df('0x48')](_0xa3df('0x49'))){_0x2a7d17[_0xa3df('0x2e')]=qs['limit'](_0x20499f[_0xa3df('0x43')][_0xa3df('0x2e')]);_0x2a7d17[_0xa3df('0x2d')]=qs['offset'](_0x20499f[_0xa3df('0x43')][_0xa3df('0x2d')]);}_0x2a7d17[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x20499f[_0xa3df('0x43')][_0xa3df('0x4b')]);_0x2a7d17['where']=qs[_0xa3df('0x4d')](_[_0xa3df('0x69')](_0x20499f[_0xa3df('0x43')],_0x172572['filters']));_0x2a7d17['where'][_0xa3df('0x61')]=_0x51ea5b['id'];if(_0x20499f[_0xa3df('0x43')][_0xa3df('0x4e')]){_0x2a7d17[_0xa3df('0x4c')]=_[_0xa3df('0x4f')](_0x2a7d17[_0xa3df('0x4c')],{'$or':_[_0xa3df('0x3e')](_0x2a7d17[_0xa3df('0x47')],function(_0x7a5bee){var _0xb1384a={};_0xb1384a[_0x7a5bee]={'$like':'%'+_0x20499f[_0xa3df('0x43')][_0xa3df('0x4e')]+'%'};return _0xb1384a;})});}_0x2a7d17=_[_0xa3df('0x4f')]({},_0x2a7d17,_0x20499f['options']);return db[_0xa3df('0x67')][_0xa3df('0x2c')]({'where':_0x2a7d17[_0xa3df('0x4c')]})[_0xa3df('0x33')](function(_0x5c3d74){_0x98e71a[_0xa3df('0x2c')]=_0x5c3d74;if(_0x20499f[_0xa3df('0x43')]['includeAll']){_0x2a7d17[_0xa3df('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa3df('0x55')](_0x2a7d17);})[_0xa3df('0x33')](function(_0x338d6a){_0x98e71a['rows']=_0x338d6a;return _0x98e71a;});}})['then'](respondWithFilteredResult(_0x13cb16,_0x2a7d17))[_0xa3df('0x28')](handleError(_0x13cb16,null));};exports[_0xa3df('0x6a')]=function(_0xe6de98,_0x46b193,_0x46ecd6){return db[_0xa3df('0x52')][_0xa3df('0x5b')]({'where':{'id':_0xe6de98[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x46b193,null))[_0xa3df('0x33')](function(_0x26cc96){if(_0x26cc96){return _0x26cc96[_0xa3df('0x6a')](_0xe6de98['query']['ids']);}})['then'](respondWithStatusCode(_0x46b193,null))['catch'](handleError(_0x46b193,null));};exports[_0xa3df('0x63')]=function(_0x5b3283,_0x23ae62){var _0xcdcbc7={'name':_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x38')],'key':_0x5b3283['body'][_0xa3df('0x6b')],'email':_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x6c')],'ListId':_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x6d')],'active':!_[_0xa3df('0x6e')](_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x6f')])?_0x5b3283[_0xa3df('0x5e')]['active']:!![],'description':_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0xa3df('0x6e')](_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x71')])){if(_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x72')]){_0xcdcbc7['Imap']['user']=_0xcdcbc7['Smtp'][_0xa3df('0x73')]=_0x5b3283['body'][_0xa3df('0x74')];_0xcdcbc7[_0xa3df('0x5d')][_0xa3df('0x75')]=_0xcdcbc7[_0xa3df('0x3c')][_0xa3df('0x76')]=_0x5b3283['body']['cpassword'];}else{_0xcdcbc7[_0xa3df('0x5d')][_0xa3df('0x77')]=_0xcdcbc7['Smtp'][_0xa3df('0x77')]=![];}_0xcdcbc7['Imap'][_0xa3df('0x78')]=_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x5d')][_0xa3df('0x78')];_0xcdcbc7[_0xa3df('0x5d')][_0xa3df('0x79')]=_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x5d')][_0xa3df('0x79')];_0xcdcbc7[_0xa3df('0x3c')][_0xa3df('0x78')]=_0x5b3283[_0xa3df('0x5e')]['Smtp'][_0xa3df('0x78')];_0xcdcbc7['Smtp'][_0xa3df('0x79')]=_0x5b3283[_0xa3df('0x5e')]['Smtp'][_0xa3df('0x79')];}else{_0xcdcbc7['Imap'][_0xa3df('0x7a')]=_0xcdcbc7[_0xa3df('0x3c')][_0xa3df('0x7a')]=_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x71')];_0xcdcbc7[_0xa3df('0x5d')][_0xa3df('0x73')]=_0xcdcbc7['Smtp'][_0xa3df('0x73')]=_0x5b3283['body']['cuser'];_0xcdcbc7[_0xa3df('0x5d')][_0xa3df('0x75')]=_0xcdcbc7[_0xa3df('0x3c')][_0xa3df('0x76')]=_0x5b3283[_0xa3df('0x5e')][_0xa3df('0x7b')];}return db[_0xa3df('0x52')][_0xa3df('0x63')](_0xcdcbc7,{'include':[{'model':db[_0xa3df('0x3b')],'as':'Smtp'},{'model':db[_0xa3df('0x3a')],'as':_0xa3df('0x5d')}]})[_0xa3df('0x33')](function(_0x515219){var _0x4433bc=_0x5b3283[_0xa3df('0x73')]['get']({'plain':!![]});if(!_0x4433bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4433bc[_0xa3df('0x7c')]===_0xa3df('0x73')){var _0x5b5b0f=_0x515219[_0xa3df('0x34')]({'plain':!![]});return db[_0xa3df('0x7d')][_0xa3df('0x5b')]({'where':{'name':_0xa3df('0x35'),'userProfileId':_0x4433bc['userProfileId']},'raw':!![]})[_0xa3df('0x33')](function(_0x1422f9){if(_0x1422f9&&_0x1422f9[_0xa3df('0x7e')]===0x0){return db[_0xa3df('0x36')][_0xa3df('0x63')]({'name':_0x5b5b0f[_0xa3df('0x38')],'resourceId':_0x5b5b0f['id'],'type':_0x1422f9['name'],'sectionId':_0x1422f9['id']},{})[_0xa3df('0x33')](function(){return _0x515219;});}else{return _0x515219;}})[_0xa3df('0x28')](function(_0x4135cf){logger['error'](_0xa3df('0x7f'),_0x4135cf);throw _0x4135cf;});}return _0x515219;})[_0xa3df('0x33')](respondWithResult(_0x23ae62,0xc9))[_0xa3df('0x28')](handleError(_0x23ae62,null));};exports[_0xa3df('0x80')]=function(_0x2ac36e,_0xfc1ecc,_0xaf529a){return db[_0xa3df('0x52')][_0xa3df('0x81')]({'where':{'id':_0x2ac36e['params']['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0xfc1ecc,null))[_0xa3df('0x33')](function(_0x198ab8){if(_0x198ab8){return _0x198ab8['getImap']();}return null;})['then'](respondWithResult(_0xfc1ecc,null))['catch'](handleError(_0xfc1ecc,null));};exports[_0xa3df('0x82')]=function(_0x56af4b,_0x4f2f82,_0x1c45ac){if(_0x56af4b[_0xa3df('0x5e')]['id']){delete _0x56af4b[_0xa3df('0x5e')]['id'];}return db[_0xa3df('0x52')][_0xa3df('0x5b')]({'where':{'id':_0x56af4b['params']['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x4f2f82,null))[_0xa3df('0x33')](function(_0x1751bd){if(_0x1751bd){_0x56af4b[_0xa3df('0x5e')][_0xa3df('0x61')]=_0x1751bd['id'];return db[_0xa3df('0x3a')][_0xa3df('0x63')](_0x56af4b[_0xa3df('0x5e')]);}})['then'](respondWithResult(_0x4f2f82,null))['catch'](handleError(_0x4f2f82,null));};exports[_0xa3df('0x83')]=function(_0x1d79b4,_0x26dfa1,_0x5af905){return db['MailAccount'][_0xa3df('0x81')]({'where':{'id':_0x1d79b4[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x26dfa1,null))[_0xa3df('0x33')](function(_0x5305fa){if(_0x5305fa){return _0x5305fa[_0xa3df('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x26dfa1,null))['catch'](handleError(_0x26dfa1,null));};exports[_0xa3df('0x85')]=function(_0x12cee3,_0x21956b,_0x2e08cf){return db[_0xa3df('0x52')][_0xa3df('0x81')]({'where':{'id':_0x12cee3[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x21956b,null))[_0xa3df('0x33')](function(_0xe443b6){if(_0xe443b6){return _0xe443b6[_0xa3df('0x85')]();}return null;})['then'](respondWithResult(_0x21956b,null))[_0xa3df('0x28')](handleError(_0x21956b,null));};exports[_0xa3df('0x86')]=function(_0x588fe9,_0x5e56ed,_0x1cea57){if(_0x588fe9[_0xa3df('0x5e')]['id']){delete _0x588fe9[_0xa3df('0x5e')]['id'];}return db['MailAccount'][_0xa3df('0x5b')]({'where':{'id':_0x588fe9[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x5e56ed,null))['then'](function(_0x430409){if(_0x430409){_0x588fe9['body'][_0xa3df('0x61')]=_0x430409['id'];return db[_0xa3df('0x3b')][_0xa3df('0x63')](_0x588fe9['body']);}})[_0xa3df('0x33')](respondWithResult(_0x5e56ed,null))[_0xa3df('0x28')](handleError(_0x5e56ed,null));};exports[_0xa3df('0x87')]=function(_0x3c1f64,_0x5341ef,_0x385977){return db[_0xa3df('0x52')][_0xa3df('0x81')]({'where':{'id':_0x3c1f64[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x5341ef,null))[_0xa3df('0x33')](function(_0x12dcb9){if(_0x12dcb9){return _0x12dcb9[_0xa3df('0x88')](null);}return null;})[_0xa3df('0x33')](respondWithStatusCode(_0x5341ef,null))[_0xa3df('0x28')](handleError(_0x5341ef,null));};exports['addInteraction']=function(_0x5b6971,_0x10134f,_0x15599b){return db[_0xa3df('0x89')][_0xa3df('0x5b')]({'where':{'id':_0x5b6971['params']['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x10134f,null))['then'](function(_0x21fad6){if(_0x21fad6){return _0x21fad6[_0xa3df('0x8a')](_0x5b6971[_0xa3df('0x5e')][_0xa3df('0x66')],_[_0xa3df('0x8b')](_0x5b6971[_0xa3df('0x5e')],['ids','id'])||{});}})[_0xa3df('0x33')](respondWithResult(_0x10134f,null))['catch'](handleError(_0x10134f,null));};exports[_0xa3df('0x8c')]=function(_0x5e681f,_0x3d5073,_0x44816c){var _0xa74103={'raw':![],'where':{}};var _0xfd8b5f={};var _0x31bbf6={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x5e681f[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x3d5073,null))['then'](function(_0x3c2628){if(_0x3c2628){_0xfd8b5f[_0xa3df('0x45')]=_['keys'](db[_0xa3df('0x89')]['rawAttributes']);_0xfd8b5f[_0xa3df('0x43')]=_[_0xa3df('0x42')](_0x5e681f[_0xa3df('0x43')]);_0xfd8b5f['filters']=_[_0xa3df('0x44')](_0xfd8b5f[_0xa3df('0x45')],_0xfd8b5f[_0xa3df('0x43')]);_0xa74103['attributes']=_['intersection'](_0xfd8b5f[_0xa3df('0x45')],qs['fields'](_0x5e681f['query']['fields']));_0xa74103[_0xa3df('0x47')]=_0xa74103[_0xa3df('0x47')][_0xa3df('0x59')]?_0xa74103[_0xa3df('0x47')]:_0xfd8b5f[_0xa3df('0x45')];if(!_0x5e681f[_0xa3df('0x43')][_0xa3df('0x48')](_0xa3df('0x49'))){_0xa74103[_0xa3df('0x2e')]=qs[_0xa3df('0x2e')](_0x5e681f[_0xa3df('0x43')]['limit']);_0xa74103[_0xa3df('0x2d')]=qs[_0xa3df('0x2d')](_0x5e681f[_0xa3df('0x43')][_0xa3df('0x2d')]);}_0xa74103[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x5e681f[_0xa3df('0x43')][_0xa3df('0x4b')]);_0xa74103[_0xa3df('0x4c')]=qs['filters'](_['pick'](_0x5e681f[_0xa3df('0x43')],_0xfd8b5f['filters']));_0xa74103['where'][_0xa3df('0x61')]=_0x3c2628['id'];if(_0x5e681f[_0xa3df('0x43')]['filter']){_0xa74103[_0xa3df('0x4c')]=_[_0xa3df('0x4f')](_0xa74103['where'],{'$or':_[_0xa3df('0x3e')](_0xa74103[_0xa3df('0x47')],function(_0x46f0f1){var _0x5c368f={};_0x5c368f[_0x46f0f1]={'$like':'%'+_0x5e681f[_0xa3df('0x43')][_0xa3df('0x4e')]+'%'};return _0x5c368f;})});}_0xa74103=_[_0xa3df('0x4f')]({},_0xa74103,_0x5e681f[_0xa3df('0x51')]);return db[_0xa3df('0x89')][_0xa3df('0x2c')]({'where':_0xa74103['where']})[_0xa3df('0x33')](function(_0x23ea06){_0x31bbf6[_0xa3df('0x2c')]=_0x23ea06;if(_0x5e681f[_0xa3df('0x43')][_0xa3df('0x53')]){_0xa74103[_0xa3df('0x54')]=[{'model':db[_0xa3df('0x8d')],'as':_0xa3df('0x8e'),'required':![]},{'model':db[_0xa3df('0x8f')],'as':_0xa3df('0x90'),'attributes':['name',_0xa3df('0x91'),_0xa3df('0x92')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xa3df('0x38'),'color'],'where':_0x5e681f[_0xa3df('0x43')][_0xa3df('0x93')]?{'id':_0x5e681f['query'][_0xa3df('0x93')]}:undefined,'required':_0x5e681f['query'][_0xa3df('0x93')]?!![]:![]}];}return db[_0xa3df('0x89')]['findAll'](_0xa74103);})[_0xa3df('0x33')](function(_0x173810){_0x31bbf6[_0xa3df('0x56')]=_0x173810;return _0x31bbf6;});}})[_0xa3df('0x33')](respondWithFilteredResult(_0x3d5073,_0xa74103))['catch'](handleError(_0x3d5073,null));};exports[_0xa3df('0x94')]=function(_0x1dfa4f,_0xd0b955,_0x1c52cb){return db['MailAccount'][_0xa3df('0x81')]({'where':{'id':_0x1dfa4f[_0xa3df('0x5c')]['id']}})['then'](handleEntityNotFound(_0xd0b955,null))[_0xa3df('0x33')](function(_0x3d2828){if(_0x3d2828){return db[_0xa3df('0x95')][_0xa3df('0x96')](function(_0xf1b035){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x1dfa4f[_0xa3df('0x5c')]['id']},'transaction':_0xf1b035})[_0xa3df('0x33')](function(_0x4f4038){var _0x23f0d5=_['map'](_0x1dfa4f[_0xa3df('0x5e')],function(_0x1072ab){_0x1072ab[_0xa3df('0x61')]=_0x1dfa4f[_0xa3df('0x5c')]['id'];return _0x1072ab;});return db[_0xa3df('0x97')]['bulkCreate'](_0x23f0d5,{'transaction':_0xf1b035});});})['then'](function(){return db[_0xa3df('0x97')][_0xa3df('0x98')]({'where':{'MailAccountId':_0x1dfa4f[_0xa3df('0x5c')]['id']},'order':_0xa3df('0x99')});});}})[_0xa3df('0x33')](respondWithResult(_0xd0b955,null))['catch'](handleError(_0xd0b955,null));};exports[_0xa3df('0x9a')]=function(_0x3a2953,_0x24476c,_0x1c4218){var _0x13264c={};var _0x23af87={};var _0x34ee1f;var _0xda984b;return db['MailAccount'][_0xa3df('0x81')]({'where':{'id':_0x3a2953[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x24476c,null))[_0xa3df('0x33')](function(_0x372f88){if(_0x372f88){_0x34ee1f=_0x372f88;_0x23af87[_0xa3df('0x45')]=_[_0xa3df('0x42')](db[_0xa3df('0x97')][_0xa3df('0x3f')]);_0x23af87[_0xa3df('0x43')]=_[_0xa3df('0x42')](_0x3a2953['query']);_0x23af87[_0xa3df('0x4d')]=_[_0xa3df('0x44')](_0x23af87[_0xa3df('0x45')],_0x23af87[_0xa3df('0x43')]);_0x13264c[_0xa3df('0x47')]=_['intersection'](_0x23af87[_0xa3df('0x45')],qs['fields'](_0x3a2953[_0xa3df('0x43')][_0xa3df('0x46')]));_0x13264c['attributes']=_0x13264c[_0xa3df('0x47')][_0xa3df('0x59')]?_0x13264c[_0xa3df('0x47')]:_0x23af87[_0xa3df('0x45')];_0x13264c[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x3a2953['query'][_0xa3df('0x4b')]);_0x13264c['where']=qs[_0xa3df('0x4d')](_['pick'](_0x3a2953[_0xa3df('0x43')],_0x23af87[_0xa3df('0x4d')]));if(_0x3a2953[_0xa3df('0x43')][_0xa3df('0x4e')]){_0x13264c[_0xa3df('0x4c')]=_['merge'](_0x13264c[_0xa3df('0x4c')],{'$or':_[_0xa3df('0x3e')](_0x13264c[_0xa3df('0x47')],function(_0x2bbb36){var _0x56693d={};_0x56693d[_0x2bbb36]={'$like':'%'+_0x3a2953[_0xa3df('0x43')]['filter']+'%'};return _0x56693d;})});}_0x13264c=_['merge']({},_0x13264c,_0x3a2953[_0xa3df('0x51')]);return _0x34ee1f['getApplications'](_0x13264c);}})[_0xa3df('0x33')](function(_0x3d46d2){if(_0x3d46d2){_0xda984b=_0x3d46d2[_0xa3df('0x59')];if(!_0x3a2953[_0xa3df('0x43')][_0xa3df('0x48')](_0xa3df('0x49'))){_0x13264c[_0xa3df('0x2e')]=qs[_0xa3df('0x2e')](_0x3a2953[_0xa3df('0x43')][_0xa3df('0x2e')]);_0x13264c[_0xa3df('0x2d')]=qs[_0xa3df('0x2d')](_0x3a2953[_0xa3df('0x43')][_0xa3df('0x2d')]);}return _0x34ee1f[_0xa3df('0x9a')](_0x13264c);}})[_0xa3df('0x33')](function(_0x58b312){if(_0x58b312){return _0x58b312?{'count':_0xda984b,'rows':_0x58b312}:null;}})['then'](respondWithResult(_0x24476c,null))[_0xa3df('0x28')](handleError(_0x24476c,null));};exports[_0xa3df('0x9b')]=function(_0x2032f6,_0x536fb2,_0x56fb21){var _0xf92ae={'raw':!![],'where':{}};var _0x25e88d={};var _0x443354={'count':0x0,'rows':[]};return db[_0xa3df('0x52')][_0xa3df('0x81')]({'where':{'id':_0x2032f6[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x536fb2,null))[_0xa3df('0x33')](function(_0x2bf724){if(_0x2bf724){_0x25e88d['model']=_[_0xa3df('0x42')](db['MailMessage'][_0xa3df('0x3f')]);_0x25e88d[_0xa3df('0x43')]=_[_0xa3df('0x42')](_0x2032f6[_0xa3df('0x43')]);_0x25e88d[_0xa3df('0x4d')]=_[_0xa3df('0x44')](_0x25e88d[_0xa3df('0x45')],_0x25e88d[_0xa3df('0x43')]);_0xf92ae[_0xa3df('0x47')]=_[_0xa3df('0x44')](_0x25e88d[_0xa3df('0x45')],qs[_0xa3df('0x46')](_0x2032f6['query']['fields']));_0xf92ae[_0xa3df('0x47')]=_0xf92ae[_0xa3df('0x47')][_0xa3df('0x59')]?_0xf92ae['attributes']:_0x25e88d['model'];if(!_0x2032f6['query'][_0xa3df('0x48')]('nolimit')){_0xf92ae[_0xa3df('0x2e')]=qs['limit'](_0x2032f6[_0xa3df('0x43')][_0xa3df('0x2e')]);_0xf92ae['offset']=qs[_0xa3df('0x2d')](_0x2032f6[_0xa3df('0x43')]['offset']);}_0xf92ae[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x2032f6[_0xa3df('0x43')]['sort']);_0xf92ae[_0xa3df('0x4c')]=qs[_0xa3df('0x4d')](_[_0xa3df('0x69')](_0x2032f6[_0xa3df('0x43')],_0x25e88d[_0xa3df('0x4d')]));_0xf92ae[_0xa3df('0x4c')]['MailAccountId']=_0x2bf724['id'];if(_0x2032f6[_0xa3df('0x43')]['filter']){_0xf92ae[_0xa3df('0x4c')]=_[_0xa3df('0x4f')](_0xf92ae[_0xa3df('0x4c')],{'$or':_['map'](_0xf92ae['attributes'],function(_0x16b1d2){var _0x3e3168={};_0x3e3168[_0x16b1d2]={'$like':'%'+_0x2032f6[_0xa3df('0x43')][_0xa3df('0x4e')]+'%'};return _0x3e3168;})});}if(_0x2032f6['query'][_0xa3df('0x9c')]){var _0x3c9514=_0x2032f6[_0xa3df('0x43')]['$gte'][_0xa3df('0x9d')](',');var _0xd14427={};_0xd14427[_0x3c9514[0x0]]={'$gte':moment(_0x3c9514[0x1])[_0xa3df('0x9e')](_0xa3df('0x9f'))};_0xf92ae[_0xa3df('0x4c')]=_[_0xa3df('0x4f')](_0xf92ae[_0xa3df('0x4c')],_0xd14427);}_0xf92ae=_[_0xa3df('0x4f')]({},_0xf92ae,_0x2032f6['options']);return db[_0xa3df('0xa0')][_0xa3df('0x2c')]({'where':_0xf92ae['where']})[_0xa3df('0x33')](function(_0x518a0c){_0x443354[_0xa3df('0x2c')]=_0x518a0c;if(_0x2032f6[_0xa3df('0x43')]['includeAll']){_0xf92ae[_0xa3df('0x54')]=[{'all':!![]}];}return db['MailMessage'][_0xa3df('0x55')](_0xf92ae);})[_0xa3df('0x33')](function(_0x4e614b){_0x443354[_0xa3df('0x56')]=_0x4e614b;return _0x443354;});}})[_0xa3df('0x33')](respondWithFilteredResult(_0x536fb2,_0xf92ae))[_0xa3df('0x28')](handleError(_0x536fb2,null));};exports[_0xa3df('0xa1')]=function(_0x32d4ce,_0x1e2024,_0xed5f6c){var _0x32bdc6,_0x1a3f06={},_0x1792b3;if(_0x32d4ce[_0xa3df('0x5e')]['to']){_0x1792b3=_0x32d4ce[_0xa3df('0x5e')]['to'][_0xa3df('0x9d')](',')[0x0];}return db[_0xa3df('0x52')][_0xa3df('0x5b')]({'where':{'id':_0x32d4ce[_0xa3df('0x5c')]['id']},'include':[{'model':db[_0xa3df('0xa2')],'as':_0xa3df('0xa3'),'include':[{'model':db[_0xa3df('0x8d')],'as':_0xa3df('0xa4'),'where':{'email':_0x1792b3},'limit':0x1,'order':[[_0xa3df('0xa5'),_0xa3df('0xa6')]]}]},{'model':db[_0xa3df('0x3b')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x1e2024,null))['then'](function(_0x422daa){if(_0x422daa){_0x32bdc6=_0x422daa;if(_0x422daa['Smtp']){if(_[_0xa3df('0x6e')](_0x32d4ce[_0xa3df('0x5e')][_0xa3df('0xa7')])){_0x32d4ce['body'][_0xa3df('0xa7')]=util[_0xa3df('0x9e')]('%s\x20<%s>',_0x422daa[_0xa3df('0x38')],_0x422daa[_0xa3df('0x6c')]||_0x422daa[_0xa3df('0x3c')][_0xa3df('0x73')]);}if(_0x32d4ce[_0xa3df('0x5e')]['attachments']&&_0x32d4ce['body']['attachments'][_0xa3df('0x59')]){for(var _0x3ba882=0x0;_0x3ba882<_0x32d4ce['body'][_0xa3df('0xa8')][_0xa3df('0x59')];_0x3ba882+=0x1){_0x32d4ce[_0xa3df('0x5e')][_0xa3df('0xa8')][_0x3ba882]={'filename':_0x32d4ce['body'][_0xa3df('0xa8')][_0x3ba882][_0xa3df('0x38')],'path':path[_0xa3df('0xa9')](config[_0xa3df('0xaa')],_0xa3df('0xab'),_0x32d4ce['body'][_0xa3df('0xa8')][_0x3ba882][_0xa3df('0xac')])};}}var _0x5699c2={'tls':{'rejectUnauthorized':![]}};if(_[_0xa3df('0x6e')](_0x422daa[_0xa3df('0x3c')][_0xa3df('0x7a')])){if(_0x422daa[_0xa3df('0x3c')][_0xa3df('0x77')]){_0x5699c2[_0xa3df('0xad')]={'user':_0x422daa[_0xa3df('0x3c')][_0xa3df('0x73')],'pass':_0x422daa[_0xa3df('0x3c')][_0xa3df('0x76')]};}_0x5699c2['host']=_0x422daa[_0xa3df('0x3c')][_0xa3df('0x78')];_0x5699c2[_0xa3df('0x79')]=_0x422daa[_0xa3df('0x3c')][_0xa3df('0x79')];_0x5699c2[_0xa3df('0xae')]=_0x422daa[_0xa3df('0x3c')][_0xa3df('0xae')];}else{_0x5699c2[_0xa3df('0x7a')]=_0x422daa[_0xa3df('0x3c')]['service'];_0x5699c2[_0xa3df('0xad')]={'user':_0x422daa[_0xa3df('0x3c')]['user'],'pass':_0x422daa[_0xa3df('0x3c')]['pass']};}return respondWithRpcPromise(_0xa3df('0xaf'),_0xa3df('0xb0'),{'account':_0x5699c2,'message':_0x32d4ce[_0xa3df('0x5e')]});}else{throw new Error('List\x20not\x20found');}}})[_0xa3df('0x33')](function(_0x2f4c8e){if(_0x2f4c8e){_0x1a3f06=_0x2f4c8e;if(_0x32bdc6[_0xa3df('0xa3')]){if(_0x32bdc6['List'][_0xa3df('0xa4')][_0xa3df('0x59')]){return _0x32bdc6['List']['Contacts'][0x0];}else{return db[_0xa3df('0x8d')]['create'](_[_0xa3df('0x17')](_0x32d4ce[_0xa3df('0x5e')],{'firstName':_0x32d4ce['body']['to'],'email':_0x32d4ce[_0xa3df('0x5e')]['to'],'phone':_0x32d4ce[_0xa3df('0x5e')]['to'],'ListId':_0x32bdc6['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})[_0xa3df('0x33')](function(_0x356bb4){if(_0x356bb4){var _0x46e89b={'UserId':_0x32d4ce[_0xa3df('0x73')]['id'],'ContactId':_0x356bb4['id'],'MailAccountId':_0x32bdc6['id'],'inReplyTo':_0x1a3f06['messageId'],'to':_0x32d4ce[_0xa3df('0x5e')][_0xa3df('0xa7')],'cc':_0x32d4ce['body']['cc'],'subject':_0x32d4ce[_0xa3df('0x5e')][_0xa3df('0xb1')],'attach':_0x32d4ce[_0xa3df('0x5e')][_0xa3df('0xb2')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xa3df('0x9f')),'lastMsgDirection':'out','lastMsgBody':_0x32d4ce['body'][_0xa3df('0x5e')],'Messages':[_[_0xa3df('0x4f')](_0x32d4ce['body'],{'messageId':_0x1a3f06[_0xa3df('0xb3')],'sentAt':moment()[_0xa3df('0x9e')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x32bdc6['id'],'UserId':_0x32d4ce[_0xa3df('0x73')]['id'],'ContactId':_0x356bb4['id']})]};if(_0x32d4ce[_0xa3df('0x5e')][_0xa3df('0xb4')]){_0x46e89b=_[_0xa3df('0x4f')](_0x46e89b,_0x32d4ce[_0xa3df('0x5e')][_0xa3df('0xb4')]);}return db['MailInteraction'][_0xa3df('0x63')](_0x46e89b,{'include':[{'model':db[_0xa3df('0xa0')],'as':_0xa3df('0xb5')}]});}})[_0xa3df('0x33')](respondWithResult(_0x1e2024,null))[_0xa3df('0x28')](handleError(_0x1e2024,null));};exports[_0xa3df('0xb6')]=function(_0x1c1284,_0x321209,_0x883ba9){return db['MailAccount'][_0xa3df('0x5b')]({'where':{'id':_0x1c1284[_0xa3df('0x5c')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xa3df('0x3c'),'raw':!![]}]})[_0xa3df('0x33')](handleEntityNotFound(_0x321209,null))[_0xa3df('0x33')](function(_0x21a597){if(_0x21a597&&_0x21a597[_0xa3df('0x3c')]){var _0x90a0f8={'id':_0x21a597['id'],'tls':{'rejectUnauthorized':![]}};if(_0x21a597[_0xa3df('0x3c')][_0xa3df('0x7a')]){_0x90a0f8[_0xa3df('0x7a')]=_0x21a597[_0xa3df('0x3c')][_0xa3df('0x7a')];}else{_0x90a0f8['host']=_0x21a597[_0xa3df('0x3c')][_0xa3df('0x78')];_0x90a0f8[_0xa3df('0x79')]=_0x21a597[_0xa3df('0x3c')][_0xa3df('0x79')];_0x90a0f8[_0xa3df('0xae')]=_0x21a597[_0xa3df('0x3c')][_0xa3df('0xae')];}if(_0x21a597[_0xa3df('0x3c')][_0xa3df('0x77')]){_0x90a0f8[_0xa3df('0xad')]={'user':_0x21a597['Smtp'][_0xa3df('0x73')],'pass':_0x21a597[_0xa3df('0x3c')][_0xa3df('0x76')]};}return respondWithRpcPromise(_0xa3df('0xb7'),_0xa3df('0xb6'),{'account':_0x90a0f8});}})[_0xa3df('0x33')](respondWithResult(_0x321209,null))['catch'](handleError(_0x321209,null));};exports['destroy']=function(_0x33d1d5,_0x562c56){return db[_0xa3df('0x52')][_0xa3df('0x5b')]({'where':{'id':_0x33d1d5[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x562c56,null))[_0xa3df('0x33')](function(_0x419bd5){if(_0x419bd5&&_0x419bd5[_0xa3df('0x7a')]){throw new db[(_0xa3df('0xb8'))][(_0xa3df('0x1e'))](_0xa3df('0xb9'));}return _0x419bd5;})['then'](removeEntity(_0x562c56,null))[_0xa3df('0x28')](handleError(_0x562c56,null));};exports['addAgents']=function(_0x4e8e1c,_0x412c6b,_0x4706e1){return db[_0xa3df('0x52')][_0xa3df('0x5b')]({'where':{'id':_0x4e8e1c[_0xa3df('0x5c')]['id']}})['then'](handleEntityNotFound(_0x412c6b,null))[_0xa3df('0x33')](function(_0x33cf82){if(_0x33cf82){return _0x33cf82['addAgents'](_0x4e8e1c['body'][_0xa3df('0x66')],_[_0xa3df('0x8b')](_0x4e8e1c[_0xa3df('0x5e')],[_0xa3df('0x66'),'id'])||{})[_0xa3df('0xba')](function(_0x486622){for(var _0x48f271=0x0;_0x48f271<_0x4e8e1c[_0xa3df('0x5e')][_0xa3df('0x66')][_0xa3df('0x59')];_0x48f271+=0x1){socket[_0xa3df('0xbb')]('userMailAccount:save',{'UserId':_0x4e8e1c['body'][_0xa3df('0x66')][_0x48f271],'MailAccountId':_0x4e8e1c[_0xa3df('0x5c')]['id']});}return _0x486622;});}})[_0xa3df('0x33')](respondWithResult(_0x412c6b,null))[_0xa3df('0x28')](handleError(_0x412c6b,null));};exports['removeAgents']=function(_0x57d3da,_0x9d8b98,_0x2c5ba4){return db['MailAccount'][_0xa3df('0x5b')]({'where':{'id':_0x57d3da[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x9d8b98,null))['then'](function(_0xb9fc4f){if(_0xb9fc4f){return _0xb9fc4f[_0xa3df('0xbc')](_0x57d3da[_0xa3df('0x43')][_0xa3df('0x66')])['then'](function(){if(_[_0xa3df('0xbd')](_0x57d3da[_0xa3df('0x43')][_0xa3df('0x66')])){for(var _0x36dc66=0x0;_0x36dc66<_0x57d3da['query'][_0xa3df('0x66')][_0xa3df('0x59')];_0x36dc66+=0x1){socket[_0xa3df('0xbb')](_0xa3df('0xbe'),{'UserId':Number(_0x57d3da[_0xa3df('0x43')][_0xa3df('0x66')][_0x36dc66]),'MailAccountId':Number(_0x57d3da['params']['id'])});}}else{socket[_0xa3df('0xbb')](_0xa3df('0xbe'),{'UserId':Number(_0x57d3da[_0xa3df('0x43')][_0xa3df('0x66')]),'MailAccountId':Number(_0x57d3da['params']['id'])});}});}})[_0xa3df('0x33')](respondWithStatusCode(_0x9d8b98,null))[_0xa3df('0x28')](handleError(_0x9d8b98,null));};exports['getAgents']=function(_0x48c1c4,_0x1db375,_0x4eb10a){var _0x47901e={};var _0x270086={};var _0xcbd187;var _0x16a183;return db[_0xa3df('0x52')]['findOne']({'where':{'id':_0x48c1c4[_0xa3df('0x5c')]['id']}})[_0xa3df('0x33')](handleEntityNotFound(_0x1db375,null))[_0xa3df('0x33')](function(_0x22eb0f){if(_0x22eb0f){_0xcbd187=_0x22eb0f;_0x270086[_0xa3df('0x45')]=_[_0xa3df('0x42')](db[_0xa3df('0x8f')][_0xa3df('0x3f')]);_0x270086[_0xa3df('0x43')]=_[_0xa3df('0x42')](_0x48c1c4[_0xa3df('0x43')]);_0x270086[_0xa3df('0x4d')]=_[_0xa3df('0x44')](_0x270086['model'],_0x270086[_0xa3df('0x43')]);_0x47901e[_0xa3df('0x47')]=_[_0xa3df('0x44')](_0x270086[_0xa3df('0x45')],qs[_0xa3df('0x46')](_0x48c1c4['query'][_0xa3df('0x46')]));_0x47901e[_0xa3df('0x47')]=_0x47901e[_0xa3df('0x47')][_0xa3df('0x59')]?_0x47901e['attributes']:_0x270086[_0xa3df('0x45')];_0x47901e[_0xa3df('0x4a')]=qs[_0xa3df('0x4b')](_0x48c1c4[_0xa3df('0x43')][_0xa3df('0x4b')]);_0x47901e[_0xa3df('0x4c')]=qs[_0xa3df('0x4d')](_[_0xa3df('0x69')](_0x48c1c4['query'],_0x270086['filters']));if(_0x48c1c4[_0xa3df('0x43')][_0xa3df('0x4e')]){_0x47901e[_0xa3df('0x4c')]=_['merge'](_0x47901e[_0xa3df('0x4c')],{'$or':_['map'](_0x47901e['attributes'],function(_0x40cb3c){var _0x434aa2={};_0x434aa2[_0x40cb3c]={'$like':'%'+_0x48c1c4[_0xa3df('0x43')][_0xa3df('0x4e')]+'%'};return _0x434aa2;})});}_0x47901e=_['merge']({},_0x47901e,_0x48c1c4[_0xa3df('0x51')]);return _0xcbd187[_0xa3df('0xbf')](_0x47901e);}})['then'](function(_0x3d3a9b){if(_0x3d3a9b){_0x16a183=_0x3d3a9b[_0xa3df('0x59')];if(!_0x48c1c4[_0xa3df('0x43')][_0xa3df('0x48')](_0xa3df('0x49'))){_0x47901e[_0xa3df('0x2e')]=qs['limit'](_0x48c1c4[_0xa3df('0x43')][_0xa3df('0x2e')]);_0x47901e[_0xa3df('0x2d')]=qs[_0xa3df('0x2d')](_0x48c1c4[_0xa3df('0x43')][_0xa3df('0x2d')]);}return _0xcbd187[_0xa3df('0xbf')](_0x47901e);}})[_0xa3df('0x33')](function(_0x3e791e){if(_0x3e791e){return _0x3e791e?{'count':_0x16a183,'rows':_0x3e791e}:null;}})[_0xa3df('0x33')](respondWithResult(_0x1db375,null))[_0xa3df('0x28')](handleError(_0x1db375,null));};
\ No newline at end of file
+var _0x16ac=['isArray','userMailAccount:remove','getAgents','html-pdf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','stack','name','send','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','rows','show','Smtp','includeAll','include','options','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','params','findAll','removeDispositions','addAnswer','CannedAnswer','findOne','removeAnswers','ids','isNil','active','description','cservice','user','cuser','cpassword','authentication','host','port','service','pass','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','CmList','Contacts','updatedAt','from','format','%s\x20<%s>','email','attachments','root','secure','auth','SendMail','List','List\x20not\x20found','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','messageId','Interaction','Messages','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents'];(function(_0x6127ba,_0x3ef5e6){var _0x2f9d83=function(_0x180ecc){while(--_0x180ecc){_0x6127ba['push'](_0x6127ba['shift']());}};_0x2f9d83(++_0x3ef5e6);}(_0x16ac,0xc4));var _0xc16a=function(_0x5e7e92,_0xdb0f1){_0x5e7e92=_0x5e7e92-0x0;var _0x412746=_0x16ac[_0x5e7e92];return _0x412746;};'use strict';var pdf=require(_0xc16a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc16a('0x1'));var rp=require(_0xc16a('0x2'));var moment=require('moment');var BPromise=require(_0xc16a('0x3'));var Mustache=require(_0xc16a('0x4'));var util=require(_0xc16a('0x5'));var path=require(_0xc16a('0x6'));var sox=require(_0xc16a('0x7'));var csv=require(_0xc16a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc16a('0x9'));var squel=require(_0xc16a('0xa'));var crypto=require(_0xc16a('0xb'));var jsforce=require(_0xc16a('0xc'));var deskjs=require(_0xc16a('0xd'));var toCsv=require(_0xc16a('0x8'));var querystring=require(_0xc16a('0xe'));var Papa=require('papaparse');var Redis=require(_0xc16a('0xf'));var authService=require(_0xc16a('0x10'));var qs=require(_0xc16a('0x11'));var as=require(_0xc16a('0x12'));var hardwareService=require(_0xc16a('0x13'));var logger=require(_0xc16a('0x14'))('api');var utils=require(_0xc16a('0x15'));var config=require(_0xc16a('0x16'));var db=require(_0xc16a('0x17'))['db'];config['redis']=_[_0xc16a('0x18')](config[_0xc16a('0x19')],{'host':_0xc16a('0x1a'),'port':0x18eb});var socket=require(_0xc16a('0x1b'))(new Redis(config[_0xc16a('0x19')]));require(_0xc16a('0x1c'))[_0xc16a('0x1d')](socket);var jayson=require(_0xc16a('0x1e'));var client=jayson[_0xc16a('0x1f')][_0xc16a('0x20')]({'port':0x232b});function checkPasswordPattern(_0x205cf4,_0xa019db,_0x5930ab){if(_0x5930ab){var _0x2f9c7e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2f9c7e[_0xc16a('0x21')](_0xa019db)){return _0x205cf4;}else{throw new db[(_0xc16a('0x22'))][(_0xc16a('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x205cf4;}}function respondWithRpcPromise(_0xf369b4,_0x41bac1,_0x5bb2c4,_0x413743){return new BPromise(function(_0x149b8b,_0x39cd18){var _0x5da9b8=_0x413743||client;return _0x5da9b8[_0xc16a('0x24')](_0xf369b4,_0x5bb2c4)['then'](function(_0x1c7d19){logger[_0xc16a('0x25')](_0xc16a('0x26'),_0x41bac1,_0xc16a('0x27'));logger[_0xc16a('0x28')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x41bac1,_0xc16a('0x27'),JSON[_0xc16a('0x29')](_0x1c7d19));if(_0x1c7d19[_0xc16a('0x2a')]){if(_0x1c7d19['error']['code']===0x1f4){logger['error'](_0xc16a('0x26'),_0x41bac1,_0x1c7d19['error'][_0xc16a('0x2b')]);return _0x39cd18(_0x1c7d19[_0xc16a('0x2a')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x41bac1,_0x1c7d19[_0xc16a('0x2a')][_0xc16a('0x2b')]);return _0x149b8b(_0x1c7d19[_0xc16a('0x2a')][_0xc16a('0x2b')]);}else{logger[_0xc16a('0x25')](_0xc16a('0x26'),_0x41bac1,_0xc16a('0x27'));_0x149b8b(_0x1c7d19[_0xc16a('0x2c')][_0xc16a('0x2b')]);}})[_0xc16a('0x2d')](function(_0x36b60f){logger[_0xc16a('0x2a')]('MailAccount,\x20%s,\x20%s',_0x41bac1,_0x36b60f);_0x39cd18(_0x36b60f);});});}function respondWithStatusCode(_0x2a24cd,_0x94dfc8){_0x94dfc8=_0x94dfc8||0xcc;return function(_0x5c475c){if(_0x5c475c){return _0x2a24cd[_0xc16a('0x2e')](_0x94dfc8);}return _0x2a24cd['status'](_0x94dfc8)[_0xc16a('0x2f')]();};}function respondWithResult(_0x44fe35,_0x5cef92){_0x5cef92=_0x5cef92||0xc8;return function(_0x4c58d6){if(_0x4c58d6){return _0x44fe35[_0xc16a('0x30')](_0x5cef92)['json'](_0x4c58d6);}};}function respondWithFilteredResult(_0x3abb09,_0x179c5a){return function(_0x27bee9){if(_0x27bee9){var _0x37bd0e=_0x27bee9[_0xc16a('0x31')],_0x2a07f6=_0x179c5a[_0xc16a('0x32')],_0x5580da=_0x179c5a[_0xc16a('0x32')]+_0x179c5a[_0xc16a('0x33')],_0x59b65a;if(_0x5580da>=_0x37bd0e){_0x5580da=_0x37bd0e;_0x59b65a=0xc8;}else{_0x59b65a=0xce;}_0x3abb09[_0xc16a('0x30')](_0x59b65a);return _0x3abb09[_0xc16a('0x34')](_0xc16a('0x35'),_0x2a07f6+'-'+_0x5580da+'/'+_0x37bd0e)['json'](_0x27bee9);}return null;};}function patchUpdates(_0x5b680d){return function(_0x14d3ab){try{jsonpatch[_0xc16a('0x36')](_0x14d3ab,_0x5b680d,!![]);}catch(_0x1b50bb){return BPromise['reject'](_0x1b50bb);}return _0x14d3ab[_0xc16a('0x37')]();};}function saveUpdates(_0xdecebc,_0x58842b){return function(_0x1e956a){if(_0x1e956a){return _0x1e956a[_0xc16a('0x38')](_0xdecebc)[_0xc16a('0x39')](function(_0x2176e0){return _0x2176e0;});}return null;};}function removeEntity(_0x562beb,_0x2c140c){return function(_0x2b2c3b){if(_0x2b2c3b){return _0x2b2c3b[_0xc16a('0x3a')]()[_0xc16a('0x39')](function(){var _0x8cda0c=_0x2b2c3b[_0xc16a('0x3b')]({'plain':!![]});var _0x5d3024='MailAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x5d3024,'resourceId':_0x8cda0c['id']}})['then'](function(){return _0x2b2c3b;});})[_0xc16a('0x39')](function(){_0x562beb[_0xc16a('0x30')](0xcc)[_0xc16a('0x2f')]();});}};}function handleEntityNotFound(_0x544f0c,_0x59a783){return function(_0x1942ba){if(!_0x1942ba){_0x544f0c['sendStatus'](0x194);}return _0x1942ba;};}function handleError(_0x36a925,_0x337437){_0x337437=_0x337437||0x1f4;return function(_0xa97c26){logger[_0xc16a('0x2a')](_0xa97c26[_0xc16a('0x3c')]);if(_0xa97c26[_0xc16a('0x3d')]){delete _0xa97c26[_0xc16a('0x3d')];}_0x36a925[_0xc16a('0x30')](_0x337437)[_0xc16a('0x3e')](_0xa97c26);};}exports[_0xc16a('0x3f')]=function(_0x55f55c,_0x5e5c86){var _0x3a7906={'include':[{'model':db[_0xc16a('0x40')],'as':_0xc16a('0x41')},{'model':db[_0xc16a('0x42')],'as':'Smtp'},{'model':db[_0xc16a('0x43')],'as':_0xc16a('0x44')}]},_0x52f22e={},_0x2d81aa={'count':0x0,'rows':[]};var _0xc1432b=_[_0xc16a('0x45')](db[_0xc16a('0x46')][_0xc16a('0x47')],function(_0x1f4d20){return{'name':_0x1f4d20['fieldName'],'type':_0x1f4d20[_0xc16a('0x48')][_0xc16a('0x49')]};});_0x52f22e[_0xc16a('0x4a')]=_['map'](_0xc1432b,_0xc16a('0x3d'));_0x52f22e[_0xc16a('0x4b')]=_[_0xc16a('0x4c')](_0x55f55c[_0xc16a('0x4b')]);_0x52f22e[_0xc16a('0x4d')]=_[_0xc16a('0x4e')](_0x52f22e[_0xc16a('0x4a')],_0x52f22e[_0xc16a('0x4b')]);_0x3a7906[_0xc16a('0x4f')]=_[_0xc16a('0x4e')](_0x52f22e[_0xc16a('0x4a')],qs[_0xc16a('0x50')](_0x55f55c[_0xc16a('0x4b')][_0xc16a('0x50')]));_0x3a7906[_0xc16a('0x4f')]=_0x3a7906[_0xc16a('0x4f')][_0xc16a('0x51')]?_0x3a7906['attributes']:_0x52f22e[_0xc16a('0x4a')];if(!_0x55f55c['query'][_0xc16a('0x52')](_0xc16a('0x53'))){_0x3a7906[_0xc16a('0x33')]=qs[_0xc16a('0x33')](_0x55f55c[_0xc16a('0x4b')]['limit']);_0x3a7906['offset']=qs[_0xc16a('0x32')](_0x55f55c['query'][_0xc16a('0x32')]);}_0x3a7906[_0xc16a('0x54')]=qs[_0xc16a('0x55')](_0x55f55c[_0xc16a('0x4b')][_0xc16a('0x55')]);_0x3a7906['where']=qs[_0xc16a('0x4d')](_[_0xc16a('0x56')](_0x55f55c[_0xc16a('0x4b')],_0x52f22e[_0xc16a('0x4d')]),_0xc1432b);if(_0x55f55c[_0xc16a('0x4b')]['filter']){_0x3a7906[_0xc16a('0x57')]=_[_0xc16a('0x58')](_0x3a7906[_0xc16a('0x57')],{'$or':_[_0xc16a('0x45')](_0xc1432b,function(_0xc3f86f){if(_0xc3f86f[_0xc16a('0x48')]!==_0xc16a('0x59')){var _0x17d6cf={};_0x17d6cf[_0xc3f86f[_0xc16a('0x3d')]]={'$like':'%'+_0x55f55c['query'][_0xc16a('0x5a')]+'%'};return _0x17d6cf;}})});}_0x3a7906=_[_0xc16a('0x58')]({},_0x3a7906,_0x55f55c['options']);var _0x3b6f01={'where':_0x3a7906[_0xc16a('0x57')]};return db[_0xc16a('0x46')][_0xc16a('0x31')](_0x3b6f01)[_0xc16a('0x39')](function(_0x4ec589){_0x2d81aa[_0xc16a('0x31')]=_0x4ec589;if(_0x55f55c[_0xc16a('0x4b')]['includeAll']){_0x3a7906['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x3a7906);})['then'](function(_0x2cde6c){_0x2d81aa[_0xc16a('0x5b')]=_0x2cde6c;return _0x2d81aa;})['then'](respondWithFilteredResult(_0x5e5c86,_0x3a7906))[_0xc16a('0x2d')](handleError(_0x5e5c86,null));};exports[_0xc16a('0x5c')]=function(_0x58ef32,_0x418f4c){var _0x165278={'raw':![],'where':{'id':_0x58ef32['params']['id']},'include':[{'model':db[_0xc16a('0x40')],'as':_0xc16a('0x41')},{'model':db[_0xc16a('0x42')],'as':_0xc16a('0x5d')},{'model':db[_0xc16a('0x43')],'as':_0xc16a('0x44')}]},_0x45f026={};_0x45f026[_0xc16a('0x4a')]=_[_0xc16a('0x4c')](db[_0xc16a('0x46')]['rawAttributes']);_0x45f026[_0xc16a('0x4b')]=_[_0xc16a('0x4c')](_0x58ef32['query']);_0x45f026['filters']=_['intersection'](_0x45f026['model'],_0x45f026['query']);_0x165278['attributes']=_['intersection'](_0x45f026[_0xc16a('0x4a')],qs['fields'](_0x58ef32['query'][_0xc16a('0x50')]));_0x165278[_0xc16a('0x4f')]=_0x165278['attributes'][_0xc16a('0x51')]?_0x165278[_0xc16a('0x4f')]:_0x45f026[_0xc16a('0x4a')];if(_0x58ef32[_0xc16a('0x4b')][_0xc16a('0x5e')]){_0x165278[_0xc16a('0x5f')]=[{'all':!![]}];}_0x165278=_[_0xc16a('0x58')]({},_0x165278,_0x58ef32[_0xc16a('0x60')]);return db['MailAccount'][_0xc16a('0x61')](_0x165278)[_0xc16a('0x39')](handleEntityNotFound(_0x418f4c,null))['then'](respondWithResult(_0x418f4c,null))[_0xc16a('0x2d')](handleError(_0x418f4c,null));};exports[_0xc16a('0x38')]=function(_0x4156e6,_0x1134cb){if(_0x4156e6[_0xc16a('0x62')]['id']){delete _0x4156e6[_0xc16a('0x62')]['id'];}return db[_0xc16a('0x46')]['find']({'where':{'id':_0x4156e6['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xc16a('0x41')},{'model':db[_0xc16a('0x42')],'as':'Smtp'},{'model':db[_0xc16a('0x43')],'as':_0xc16a('0x44')}]})[_0xc16a('0x39')](handleEntityNotFound(_0x1134cb,null))[_0xc16a('0x39')](saveUpdates(_0x4156e6[_0xc16a('0x62')],null))[_0xc16a('0x39')](function(_0x2d4031){if(_0x2d4031&&_0x4156e6[_0xc16a('0x62')]['Imap']){return db[_0xc16a('0x40')][_0xc16a('0x38')](_0x4156e6['body'][_0xc16a('0x41')],{'where':{'MailAccountId':_0x2d4031['id']}})[_0xc16a('0x39')](function(){return _0x2d4031;});}return _0x2d4031;})['then'](function(_0x5ce72d){if(_0x5ce72d&&_0x4156e6['body'][_0xc16a('0x5d')]){return db[_0xc16a('0x42')]['update'](_0x4156e6[_0xc16a('0x62')][_0xc16a('0x5d')],{'where':{'MailAccountId':_0x5ce72d['id']}})[_0xc16a('0x39')](function(){return _0x5ce72d;});}return _0x5ce72d;})['then'](respondWithResult(_0x1134cb,null))['catch'](handleError(_0x1134cb,null));};exports[_0xc16a('0x63')]=function(_0x3e204f,_0x11349a){return db['MailAccount'][_0xc16a('0x63')]()[_0xc16a('0x39')](respondWithResult(_0x11349a,null))['catch'](handleError(_0x11349a,null));};exports[_0xc16a('0x64')]=function(_0x2ecbba,_0x819e55,_0x28c216){if(_0x2ecbba['body']['id']){delete _0x2ecbba['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x2ecbba['params']['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x819e55,null))[_0xc16a('0x39')](function(_0x28232e){if(_0x28232e){_0x2ecbba[_0xc16a('0x62')][_0xc16a('0x65')]=_0x28232e['id'];return db[_0xc16a('0x66')][_0xc16a('0x67')](_0x2ecbba[_0xc16a('0x62')]);}})['then'](respondWithResult(_0x819e55,null))['catch'](handleError(_0x819e55,null));};exports[_0xc16a('0x68')]=function(_0x1831be,_0x35841b,_0x264804){var _0x289b1f={'raw':![],'where':{}};var _0x3cfc26={};var _0x160942={'count':0x0,'rows':[]};return db[_0xc16a('0x46')]['findOne']({'where':{'id':_0x1831be[_0xc16a('0x69')]['id']}})['then'](handleEntityNotFound(_0x35841b,null))[_0xc16a('0x39')](function(_0x1bd782){if(_0x1bd782){_0x3cfc26[_0xc16a('0x4a')]=_[_0xc16a('0x4c')](db[_0xc16a('0x66')][_0xc16a('0x47')]);_0x3cfc26['query']=_[_0xc16a('0x4c')](_0x1831be['query']);_0x3cfc26[_0xc16a('0x4d')]=_['intersection'](_0x3cfc26['model'],_0x3cfc26[_0xc16a('0x4b')]);_0x289b1f[_0xc16a('0x4f')]=_['intersection'](_0x3cfc26[_0xc16a('0x4a')],qs[_0xc16a('0x50')](_0x1831be[_0xc16a('0x4b')][_0xc16a('0x50')]));_0x289b1f[_0xc16a('0x4f')]=_0x289b1f['attributes'][_0xc16a('0x51')]?_0x289b1f[_0xc16a('0x4f')]:_0x3cfc26[_0xc16a('0x4a')];if(!_0x1831be['query']['hasOwnProperty'](_0xc16a('0x53'))){_0x289b1f[_0xc16a('0x33')]=qs[_0xc16a('0x33')](_0x1831be[_0xc16a('0x4b')][_0xc16a('0x33')]);_0x289b1f[_0xc16a('0x32')]=qs[_0xc16a('0x32')](_0x1831be['query'][_0xc16a('0x32')]);}_0x289b1f[_0xc16a('0x54')]=qs[_0xc16a('0x55')](_0x1831be[_0xc16a('0x4b')][_0xc16a('0x55')]);_0x289b1f[_0xc16a('0x57')]=qs[_0xc16a('0x4d')](_[_0xc16a('0x56')](_0x1831be[_0xc16a('0x4b')],_0x3cfc26[_0xc16a('0x4d')]));_0x289b1f['where'][_0xc16a('0x65')]=_0x1bd782['id'];if(_0x1831be[_0xc16a('0x4b')][_0xc16a('0x5a')]){_0x289b1f[_0xc16a('0x57')]=_[_0xc16a('0x58')](_0x289b1f[_0xc16a('0x57')],{'$or':_[_0xc16a('0x45')](_0x289b1f[_0xc16a('0x4f')],function(_0x2c6992){var _0x400a86={};_0x400a86[_0x2c6992]={'$like':'%'+_0x1831be['query'][_0xc16a('0x5a')]+'%'};return _0x400a86;})});}_0x289b1f=_[_0xc16a('0x58')]({},_0x289b1f,_0x1831be['options']);return db[_0xc16a('0x66')][_0xc16a('0x31')]({'where':_0x289b1f[_0xc16a('0x57')]})[_0xc16a('0x39')](function(_0x94d027){_0x160942[_0xc16a('0x31')]=_0x94d027;if(_0x1831be[_0xc16a('0x4b')][_0xc16a('0x5e')]){_0x289b1f[_0xc16a('0x5f')]=[{'all':!![]}];}return db[_0xc16a('0x66')][_0xc16a('0x6a')](_0x289b1f);})[_0xc16a('0x39')](function(_0x24d02d){_0x160942[_0xc16a('0x5b')]=_0x24d02d;return _0x160942;});}})[_0xc16a('0x39')](respondWithFilteredResult(_0x35841b,_0x289b1f))[_0xc16a('0x2d')](handleError(_0x35841b,null));};exports[_0xc16a('0x6b')]=function(_0x24722b,_0x5d4e8b,_0x4e096d){return db[_0xc16a('0x46')][_0xc16a('0x61')]({'where':{'id':_0x24722b[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x5d4e8b,null))[_0xc16a('0x39')](function(_0x481802){if(_0x481802){return _0x481802[_0xc16a('0x6b')](_0x24722b['query']['ids']);}})[_0xc16a('0x39')](respondWithStatusCode(_0x5d4e8b,null))[_0xc16a('0x2d')](handleError(_0x5d4e8b,null));};exports[_0xc16a('0x6c')]=function(_0x5306e8,_0x1a6c75,_0x4a39cd){if(_0x5306e8[_0xc16a('0x62')]['id']){delete _0x5306e8['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x5306e8[_0xc16a('0x69')]['id']}})['then'](handleEntityNotFound(_0x1a6c75,null))[_0xc16a('0x39')](function(_0x596898){if(_0x596898){_0x5306e8[_0xc16a('0x62')][_0xc16a('0x65')]=_0x596898['id'];return db[_0xc16a('0x6d')]['create'](_0x5306e8[_0xc16a('0x62')]);}})[_0xc16a('0x39')](respondWithResult(_0x1a6c75,null))[_0xc16a('0x2d')](handleError(_0x1a6c75,null));};exports['getAnswers']=function(_0x3b6ed5,_0x1fbf8b,_0x1742b7){var _0x4330a2={'raw':![],'where':{}};var _0x491296={};var _0x22b495={'count':0x0,'rows':[]};return db['MailAccount'][_0xc16a('0x6e')]({'where':{'id':_0x3b6ed5['params']['id']}})['then'](handleEntityNotFound(_0x1fbf8b,null))['then'](function(_0x3677d6){if(_0x3677d6){_0x491296['model']=_[_0xc16a('0x4c')](db[_0xc16a('0x6d')][_0xc16a('0x47')]);_0x491296[_0xc16a('0x4b')]=_[_0xc16a('0x4c')](_0x3b6ed5['query']);_0x491296['filters']=_[_0xc16a('0x4e')](_0x491296[_0xc16a('0x4a')],_0x491296[_0xc16a('0x4b')]);_0x4330a2[_0xc16a('0x4f')]=_[_0xc16a('0x4e')](_0x491296[_0xc16a('0x4a')],qs[_0xc16a('0x50')](_0x3b6ed5[_0xc16a('0x4b')][_0xc16a('0x50')]));_0x4330a2[_0xc16a('0x4f')]=_0x4330a2[_0xc16a('0x4f')]['length']?_0x4330a2[_0xc16a('0x4f')]:_0x491296[_0xc16a('0x4a')];if(!_0x3b6ed5[_0xc16a('0x4b')][_0xc16a('0x52')](_0xc16a('0x53'))){_0x4330a2[_0xc16a('0x33')]=qs[_0xc16a('0x33')](_0x3b6ed5['query'][_0xc16a('0x33')]);_0x4330a2['offset']=qs[_0xc16a('0x32')](_0x3b6ed5[_0xc16a('0x4b')][_0xc16a('0x32')]);}_0x4330a2[_0xc16a('0x54')]=qs[_0xc16a('0x55')](_0x3b6ed5[_0xc16a('0x4b')]['sort']);_0x4330a2['where']=qs['filters'](_['pick'](_0x3b6ed5['query'],_0x491296[_0xc16a('0x4d')]));_0x4330a2['where'][_0xc16a('0x65')]=_0x3677d6['id'];if(_0x3b6ed5[_0xc16a('0x4b')][_0xc16a('0x5a')]){_0x4330a2[_0xc16a('0x57')]=_[_0xc16a('0x58')](_0x4330a2[_0xc16a('0x57')],{'$or':_[_0xc16a('0x45')](_0x4330a2[_0xc16a('0x4f')],function(_0x95262e){var _0x5234f2={};_0x5234f2[_0x95262e]={'$like':'%'+_0x3b6ed5[_0xc16a('0x4b')][_0xc16a('0x5a')]+'%'};return _0x5234f2;})});}_0x4330a2=_[_0xc16a('0x58')]({},_0x4330a2,_0x3b6ed5[_0xc16a('0x60')]);return db['CannedAnswer'][_0xc16a('0x31')]({'where':_0x4330a2[_0xc16a('0x57')]})[_0xc16a('0x39')](function(_0x3e29bc){_0x22b495[_0xc16a('0x31')]=_0x3e29bc;if(_0x3b6ed5[_0xc16a('0x4b')]['includeAll']){_0x4330a2[_0xc16a('0x5f')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc16a('0x6a')](_0x4330a2);})['then'](function(_0x442c27){_0x22b495[_0xc16a('0x5b')]=_0x442c27;return _0x22b495;});}})[_0xc16a('0x39')](respondWithFilteredResult(_0x1fbf8b,_0x4330a2))[_0xc16a('0x2d')](handleError(_0x1fbf8b,null));};exports['removeAnswers']=function(_0x555d7f,_0x36c840,_0x16ace2){return db['MailAccount']['find']({'where':{'id':_0x555d7f[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x36c840,null))[_0xc16a('0x39')](function(_0x5c257d){if(_0x5c257d){return _0x5c257d[_0xc16a('0x6f')](_0x555d7f[_0xc16a('0x4b')][_0xc16a('0x70')]);}})[_0xc16a('0x39')](respondWithStatusCode(_0x36c840,null))['catch'](handleError(_0x36c840,null));};exports[_0xc16a('0x67')]=function(_0x4cae45,_0x431cb8){var _0x430bfa={'name':_0x4cae45[_0xc16a('0x62')][_0xc16a('0x3d')],'key':_0x4cae45[_0xc16a('0x62')][_0xc16a('0x49')],'email':_0x4cae45[_0xc16a('0x62')]['email'],'ListId':_0x4cae45[_0xc16a('0x62')]['ListId'],'active':!_[_0xc16a('0x71')](_0x4cae45[_0xc16a('0x62')][_0xc16a('0x72')])?_0x4cae45[_0xc16a('0x62')][_0xc16a('0x72')]:!![],'description':_0x4cae45[_0xc16a('0x62')][_0xc16a('0x73')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x4cae45['body'][_0xc16a('0x74')])){if(_0x4cae45[_0xc16a('0x62')]['cauthentication']){_0x430bfa['Imap'][_0xc16a('0x75')]=_0x430bfa['Smtp'][_0xc16a('0x75')]=_0x4cae45[_0xc16a('0x62')][_0xc16a('0x76')];_0x430bfa[_0xc16a('0x41')]['password']=_0x430bfa[_0xc16a('0x5d')]['pass']=_0x4cae45[_0xc16a('0x62')][_0xc16a('0x77')];}else{_0x430bfa[_0xc16a('0x41')][_0xc16a('0x78')]=_0x430bfa[_0xc16a('0x5d')][_0xc16a('0x78')]=![];}_0x430bfa[_0xc16a('0x41')]['host']=_0x4cae45['body'][_0xc16a('0x41')][_0xc16a('0x79')];_0x430bfa[_0xc16a('0x41')][_0xc16a('0x7a')]=_0x4cae45[_0xc16a('0x62')][_0xc16a('0x41')][_0xc16a('0x7a')];_0x430bfa[_0xc16a('0x5d')][_0xc16a('0x79')]=_0x4cae45[_0xc16a('0x62')][_0xc16a('0x5d')]['host'];_0x430bfa[_0xc16a('0x5d')][_0xc16a('0x7a')]=_0x4cae45['body'][_0xc16a('0x5d')][_0xc16a('0x7a')];}else{_0x430bfa['Imap']['service']=_0x430bfa['Smtp'][_0xc16a('0x7b')]=_0x4cae45[_0xc16a('0x62')][_0xc16a('0x74')];_0x430bfa[_0xc16a('0x41')][_0xc16a('0x75')]=_0x430bfa[_0xc16a('0x5d')][_0xc16a('0x75')]=_0x4cae45['body'][_0xc16a('0x76')];_0x430bfa[_0xc16a('0x41')]['password']=_0x430bfa[_0xc16a('0x5d')][_0xc16a('0x7c')]=_0x4cae45[_0xc16a('0x62')]['cpassword'];}return db[_0xc16a('0x46')][_0xc16a('0x67')](_0x430bfa,{'include':[{'model':db[_0xc16a('0x42')],'as':_0xc16a('0x5d')},{'model':db[_0xc16a('0x40')],'as':_0xc16a('0x41')}]})[_0xc16a('0x39')](function(_0x34e47b){var _0xe5e3f9=_0x4cae45['user'][_0xc16a('0x3b')]({'plain':!![]});if(!_0xe5e3f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe5e3f9[_0xc16a('0x7d')]===_0xc16a('0x75')){var _0x524586=_0x34e47b[_0xc16a('0x3b')]({'plain':!![]});return db[_0xc16a('0x7e')][_0xc16a('0x61')]({'where':{'name':_0xc16a('0x7f'),'userProfileId':_0xe5e3f9[_0xc16a('0x80')]},'raw':!![]})[_0xc16a('0x39')](function(_0x2ac6de){if(_0x2ac6de&&_0x2ac6de[_0xc16a('0x81')]===0x0){return db[_0xc16a('0x82')][_0xc16a('0x67')]({'name':_0x524586[_0xc16a('0x3d')],'resourceId':_0x524586['id'],'type':_0x2ac6de[_0xc16a('0x3d')],'sectionId':_0x2ac6de['id']},{})[_0xc16a('0x39')](function(){return _0x34e47b;});}else{return _0x34e47b;}})[_0xc16a('0x2d')](function(_0x2ab628){logger[_0xc16a('0x2a')](_0xc16a('0x83'),_0x2ab628);throw _0x2ab628;});}return _0x34e47b;})[_0xc16a('0x39')](respondWithResult(_0x431cb8,0xc9))[_0xc16a('0x2d')](handleError(_0x431cb8,null));};exports[_0xc16a('0x84')]=function(_0x684d96,_0x47a38d,_0x157737){return db[_0xc16a('0x46')][_0xc16a('0x6e')]({'where':{'id':_0x684d96['params']['id']}})['then'](handleEntityNotFound(_0x47a38d,null))[_0xc16a('0x39')](function(_0x2e552e){if(_0x2e552e){return _0x2e552e['getImap']();}return null;})[_0xc16a('0x39')](respondWithResult(_0x47a38d,null))[_0xc16a('0x2d')](handleError(_0x47a38d,null));};exports['addImap']=function(_0x45e3c6,_0x266400,_0x1e40a3){if(_0x45e3c6[_0xc16a('0x62')]['id']){delete _0x45e3c6[_0xc16a('0x62')]['id'];}return db['MailAccount'][_0xc16a('0x61')]({'where':{'id':_0x45e3c6[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x266400,null))[_0xc16a('0x39')](function(_0xcddb40){if(_0xcddb40){_0x45e3c6[_0xc16a('0x62')]['MailAccountId']=_0xcddb40['id'];return db[_0xc16a('0x40')][_0xc16a('0x67')](_0x45e3c6[_0xc16a('0x62')]);}})['then'](respondWithResult(_0x266400,null))[_0xc16a('0x2d')](handleError(_0x266400,null));};exports[_0xc16a('0x85')]=function(_0x390989,_0x3cfab8,_0x14931b){return db[_0xc16a('0x46')][_0xc16a('0x6e')]({'where':{'id':_0x390989[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x3cfab8,null))[_0xc16a('0x39')](function(_0x5bcbef){if(_0x5bcbef){return _0x5bcbef[_0xc16a('0x86')](null);}return null;})[_0xc16a('0x39')](respondWithStatusCode(_0x3cfab8,null))[_0xc16a('0x2d')](handleError(_0x3cfab8,null));};exports['getSmtp']=function(_0x327027,_0x261a58,_0x49fca9){return db['MailAccount'][_0xc16a('0x6e')]({'where':{'id':_0x327027[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x261a58,null))['then'](function(_0x3c1c53){if(_0x3c1c53){return _0x3c1c53[_0xc16a('0x87')]();}return null;})[_0xc16a('0x39')](respondWithResult(_0x261a58,null))['catch'](handleError(_0x261a58,null));};exports[_0xc16a('0x88')]=function(_0xa900be,_0x35250d,_0x216f60){if(_0xa900be[_0xc16a('0x62')]['id']){delete _0xa900be[_0xc16a('0x62')]['id'];}return db[_0xc16a('0x46')][_0xc16a('0x61')]({'where':{'id':_0xa900be[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x35250d,null))[_0xc16a('0x39')](function(_0x56eec7){if(_0x56eec7){_0xa900be[_0xc16a('0x62')][_0xc16a('0x65')]=_0x56eec7['id'];return db[_0xc16a('0x42')]['create'](_0xa900be[_0xc16a('0x62')]);}})['then'](respondWithResult(_0x35250d,null))[_0xc16a('0x2d')](handleError(_0x35250d,null));};exports['removeSmtp']=function(_0x3ca2b5,_0x5c6725,_0x3200a5){return db[_0xc16a('0x46')][_0xc16a('0x6e')]({'where':{'id':_0x3ca2b5['params']['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x5c6725,null))[_0xc16a('0x39')](function(_0x576836){if(_0x576836){return _0x576836[_0xc16a('0x89')](null);}return null;})[_0xc16a('0x39')](respondWithStatusCode(_0x5c6725,null))[_0xc16a('0x2d')](handleError(_0x5c6725,null));};exports[_0xc16a('0x8a')]=function(_0x4ded95,_0x1178e3,_0x1fabb7){return db[_0xc16a('0x8b')]['find']({'where':{'id':_0x4ded95[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x1178e3,null))[_0xc16a('0x39')](function(_0x1d0e91){if(_0x1d0e91){return _0x1d0e91[_0xc16a('0x8a')](_0x4ded95['body'][_0xc16a('0x70')],_[_0xc16a('0x8c')](_0x4ded95[_0xc16a('0x62')],[_0xc16a('0x70'),'id'])||{});}})['then'](respondWithResult(_0x1178e3,null))[_0xc16a('0x2d')](handleError(_0x1178e3,null));};exports[_0xc16a('0x8d')]=function(_0x4557b5,_0x125abd,_0x12d2fa){var _0x810667={'raw':![],'where':{}};var _0x3926fd={};var _0x421ef0={'count':0x0,'rows':[]};return db['MailAccount'][_0xc16a('0x6e')]({'where':{'id':_0x4557b5[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x125abd,null))['then'](function(_0x3f55fe){if(_0x3f55fe){_0x3926fd[_0xc16a('0x4a')]=_[_0xc16a('0x4c')](db[_0xc16a('0x8b')]['rawAttributes']);_0x3926fd[_0xc16a('0x4b')]=_[_0xc16a('0x4c')](_0x4557b5[_0xc16a('0x4b')]);_0x3926fd[_0xc16a('0x4d')]=_[_0xc16a('0x4e')](_0x3926fd[_0xc16a('0x4a')],_0x3926fd[_0xc16a('0x4b')]);_0x810667[_0xc16a('0x4f')]=_[_0xc16a('0x4e')](_0x3926fd[_0xc16a('0x4a')],qs[_0xc16a('0x50')](_0x4557b5[_0xc16a('0x4b')][_0xc16a('0x50')]));_0x810667[_0xc16a('0x4f')]=_0x810667[_0xc16a('0x4f')][_0xc16a('0x51')]?_0x810667['attributes']:_0x3926fd[_0xc16a('0x4a')];if(!_0x4557b5[_0xc16a('0x4b')]['hasOwnProperty'](_0xc16a('0x53'))){_0x810667[_0xc16a('0x33')]=qs[_0xc16a('0x33')](_0x4557b5[_0xc16a('0x4b')][_0xc16a('0x33')]);_0x810667[_0xc16a('0x32')]=qs[_0xc16a('0x32')](_0x4557b5[_0xc16a('0x4b')]['offset']);}_0x810667[_0xc16a('0x54')]=qs[_0xc16a('0x55')](_0x4557b5[_0xc16a('0x4b')]['sort']);_0x810667[_0xc16a('0x57')]=qs[_0xc16a('0x4d')](_[_0xc16a('0x56')](_0x4557b5[_0xc16a('0x4b')],_0x3926fd[_0xc16a('0x4d')]));_0x810667[_0xc16a('0x57')][_0xc16a('0x65')]=_0x3f55fe['id'];if(_0x4557b5[_0xc16a('0x4b')][_0xc16a('0x5a')]){_0x810667[_0xc16a('0x57')]=_['merge'](_0x810667['where'],{'$or':_[_0xc16a('0x45')](_0x810667['attributes'],function(_0x3acd71){var _0x56156a={};_0x56156a[_0x3acd71]={'$like':'%'+_0x4557b5[_0xc16a('0x4b')][_0xc16a('0x5a')]+'%'};return _0x56156a;})});}_0x810667=_[_0xc16a('0x58')]({},_0x810667,_0x4557b5[_0xc16a('0x60')]);return db['MailInteraction'][_0xc16a('0x31')]({'where':_0x810667[_0xc16a('0x57')]})[_0xc16a('0x39')](function(_0x8f9a39){_0x421ef0[_0xc16a('0x31')]=_0x8f9a39;if(_0x4557b5['query'][_0xc16a('0x5e')]){_0x810667['include']=[{'model':db[_0xc16a('0x8e')],'as':_0xc16a('0x8f'),'required':![]},{'model':db[_0xc16a('0x90')],'as':_0xc16a('0x91'),'attributes':[_0xc16a('0x3d'),'fullname',_0xc16a('0x92')],'required':![]},{'model':db[_0xc16a('0x93')],'as':_0xc16a('0x94'),'attributes':['id',_0xc16a('0x3d'),_0xc16a('0x95')],'where':_0x4557b5['query'][_0xc16a('0x96')]?{'id':_0x4557b5[_0xc16a('0x4b')][_0xc16a('0x96')]}:undefined,'required':_0x4557b5['query'][_0xc16a('0x96')]?!![]:![]}];}return db[_0xc16a('0x8b')][_0xc16a('0x6a')](_0x810667);})[_0xc16a('0x39')](function(_0x2531e8){_0x421ef0[_0xc16a('0x5b')]=_0x2531e8;return _0x421ef0;});}})[_0xc16a('0x39')](respondWithFilteredResult(_0x125abd,_0x810667))['catch'](handleError(_0x125abd,null));};exports[_0xc16a('0x97')]=function(_0x57dda6,_0x5ec877,_0x14dc76){return db['MailAccount'][_0xc16a('0x6e')]({'where':{'id':_0x57dda6[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x5ec877,null))[_0xc16a('0x39')](function(_0x1ae413){if(_0x1ae413){return db[_0xc16a('0x98')][_0xc16a('0x99')](function(_0x45859f){return db['MailApplication'][_0xc16a('0x3a')]({'where':{'MailAccountId':_0x57dda6[_0xc16a('0x69')]['id']},'transaction':_0x45859f})[_0xc16a('0x39')](function(_0x30da8a){var _0x50cd85=_[_0xc16a('0x45')](_0x57dda6[_0xc16a('0x62')],function(_0x5f0409){_0x5f0409[_0xc16a('0x65')]=_0x57dda6[_0xc16a('0x69')]['id'];return _0x5f0409;});return db[_0xc16a('0x9a')]['bulkCreate'](_0x50cd85,{'transaction':_0x45859f});});})[_0xc16a('0x39')](function(){return db[_0xc16a('0x9a')][_0xc16a('0x9b')]({'where':{'MailAccountId':_0x57dda6[_0xc16a('0x69')]['id']},'order':_0xc16a('0x9c')});});}})[_0xc16a('0x39')](respondWithResult(_0x5ec877,null))[_0xc16a('0x2d')](handleError(_0x5ec877,null));};exports[_0xc16a('0x9d')]=function(_0x5dbb55,_0x5ea993,_0x4690a5){var _0x363d3d={};var _0x1daaf0={};var _0x5ca4d9;var _0x5cf44d;return db[_0xc16a('0x46')][_0xc16a('0x6e')]({'where':{'id':_0x5dbb55[_0xc16a('0x69')]['id']}})['then'](handleEntityNotFound(_0x5ea993,null))[_0xc16a('0x39')](function(_0x41f708){if(_0x41f708){_0x5ca4d9=_0x41f708;_0x1daaf0['model']=_[_0xc16a('0x4c')](db[_0xc16a('0x9a')][_0xc16a('0x47')]);_0x1daaf0[_0xc16a('0x4b')]=_['keys'](_0x5dbb55[_0xc16a('0x4b')]);_0x1daaf0['filters']=_[_0xc16a('0x4e')](_0x1daaf0['model'],_0x1daaf0['query']);_0x363d3d['attributes']=_[_0xc16a('0x4e')](_0x1daaf0[_0xc16a('0x4a')],qs[_0xc16a('0x50')](_0x5dbb55[_0xc16a('0x4b')][_0xc16a('0x50')]));_0x363d3d[_0xc16a('0x4f')]=_0x363d3d[_0xc16a('0x4f')][_0xc16a('0x51')]?_0x363d3d[_0xc16a('0x4f')]:_0x1daaf0[_0xc16a('0x4a')];_0x363d3d['order']=qs[_0xc16a('0x55')](_0x5dbb55[_0xc16a('0x4b')]['sort']);_0x363d3d[_0xc16a('0x57')]=qs['filters'](_[_0xc16a('0x56')](_0x5dbb55[_0xc16a('0x4b')],_0x1daaf0[_0xc16a('0x4d')]));if(_0x5dbb55['query'][_0xc16a('0x5a')]){_0x363d3d['where']=_[_0xc16a('0x58')](_0x363d3d[_0xc16a('0x57')],{'$or':_[_0xc16a('0x45')](_0x363d3d[_0xc16a('0x4f')],function(_0x13b640){var _0xf0ec46={};_0xf0ec46[_0x13b640]={'$like':'%'+_0x5dbb55[_0xc16a('0x4b')]['filter']+'%'};return _0xf0ec46;})});}_0x363d3d=_[_0xc16a('0x58')]({},_0x363d3d,_0x5dbb55['options']);return _0x5ca4d9[_0xc16a('0x9d')](_0x363d3d);}})['then'](function(_0x3fbce9){if(_0x3fbce9){_0x5cf44d=_0x3fbce9[_0xc16a('0x51')];if(!_0x5dbb55[_0xc16a('0x4b')][_0xc16a('0x52')](_0xc16a('0x53'))){_0x363d3d[_0xc16a('0x33')]=qs[_0xc16a('0x33')](_0x5dbb55[_0xc16a('0x4b')][_0xc16a('0x33')]);_0x363d3d[_0xc16a('0x32')]=qs[_0xc16a('0x32')](_0x5dbb55[_0xc16a('0x4b')]['offset']);}return _0x5ca4d9[_0xc16a('0x9d')](_0x363d3d);}})[_0xc16a('0x39')](function(_0x2714af){if(_0x2714af){return _0x2714af?{'count':_0x5cf44d,'rows':_0x2714af}:null;}})[_0xc16a('0x39')](respondWithResult(_0x5ea993,null))[_0xc16a('0x2d')](handleError(_0x5ea993,null));};exports[_0xc16a('0x9e')]=function(_0x3a270a,_0x3f204d,_0x153d0f){var _0x3abec3={'raw':!![],'where':{}};var _0x2a7e0b={};var _0x42a979={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x3a270a[_0xc16a('0x69')]['id']}})['then'](handleEntityNotFound(_0x3f204d,null))[_0xc16a('0x39')](function(_0x144993){if(_0x144993){_0x2a7e0b[_0xc16a('0x4a')]=_[_0xc16a('0x4c')](db[_0xc16a('0x9f')][_0xc16a('0x47')]);_0x2a7e0b[_0xc16a('0x4b')]=_[_0xc16a('0x4c')](_0x3a270a['query']);_0x2a7e0b[_0xc16a('0x4d')]=_['intersection'](_0x2a7e0b[_0xc16a('0x4a')],_0x2a7e0b[_0xc16a('0x4b')]);_0x3abec3[_0xc16a('0x4f')]=_['intersection'](_0x2a7e0b[_0xc16a('0x4a')],qs[_0xc16a('0x50')](_0x3a270a[_0xc16a('0x4b')][_0xc16a('0x50')]));_0x3abec3[_0xc16a('0x4f')]=_0x3abec3[_0xc16a('0x4f')]['length']?_0x3abec3[_0xc16a('0x4f')]:_0x2a7e0b[_0xc16a('0x4a')];if(!_0x3a270a[_0xc16a('0x4b')]['hasOwnProperty'](_0xc16a('0x53'))){_0x3abec3['limit']=qs['limit'](_0x3a270a[_0xc16a('0x4b')][_0xc16a('0x33')]);_0x3abec3['offset']=qs[_0xc16a('0x32')](_0x3a270a[_0xc16a('0x4b')][_0xc16a('0x32')]);}_0x3abec3['order']=qs['sort'](_0x3a270a[_0xc16a('0x4b')][_0xc16a('0x55')]);_0x3abec3[_0xc16a('0x57')]=qs[_0xc16a('0x4d')](_['pick'](_0x3a270a[_0xc16a('0x4b')],_0x2a7e0b[_0xc16a('0x4d')]));_0x3abec3[_0xc16a('0x57')][_0xc16a('0x65')]=_0x144993['id'];if(_0x3a270a[_0xc16a('0x4b')][_0xc16a('0x5a')]){_0x3abec3[_0xc16a('0x57')]=_[_0xc16a('0x58')](_0x3abec3[_0xc16a('0x57')],{'$or':_[_0xc16a('0x45')](_0x3abec3[_0xc16a('0x4f')],function(_0x7afd99){var _0x489cf2={};_0x489cf2[_0x7afd99]={'$like':'%'+_0x3a270a[_0xc16a('0x4b')]['filter']+'%'};return _0x489cf2;})});}if(_0x3a270a[_0xc16a('0x4b')][_0xc16a('0xa0')]){var _0x329348=_0x3a270a[_0xc16a('0x4b')][_0xc16a('0xa0')][_0xc16a('0xa1')](',');var _0x1d2ce1={};_0x1d2ce1[_0x329348[0x0]]={'$gte':moment(_0x329348[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3abec3[_0xc16a('0x57')]=_['merge'](_0x3abec3[_0xc16a('0x57')],_0x1d2ce1);}_0x3abec3=_[_0xc16a('0x58')]({},_0x3abec3,_0x3a270a[_0xc16a('0x60')]);return db[_0xc16a('0x9f')]['count']({'where':_0x3abec3[_0xc16a('0x57')]})['then'](function(_0x2879a3){_0x42a979[_0xc16a('0x31')]=_0x2879a3;if(_0x3a270a[_0xc16a('0x4b')][_0xc16a('0x5e')]){_0x3abec3[_0xc16a('0x5f')]=[{'all':!![]}];}return db[_0xc16a('0x9f')][_0xc16a('0x6a')](_0x3abec3);})[_0xc16a('0x39')](function(_0x554d44){_0x42a979[_0xc16a('0x5b')]=_0x554d44;return _0x42a979;});}})['then'](respondWithFilteredResult(_0x3f204d,_0x3abec3))[_0xc16a('0x2d')](handleError(_0x3f204d,null));};exports[_0xc16a('0x3e')]=function(_0x3da4b0,_0x382a73,_0x263485){var _0x1cfeaa,_0x271762={},_0x27f3cd;if(_0x3da4b0[_0xc16a('0x62')]['to']){_0x27f3cd=_0x3da4b0[_0xc16a('0x62')]['to'][_0xc16a('0xa1')](',')[0x0];}return db['MailAccount'][_0xc16a('0x61')]({'where':{'id':_0x3da4b0[_0xc16a('0x69')]['id']},'include':[{'model':db[_0xc16a('0xa2')],'as':'List','include':[{'model':db[_0xc16a('0x8e')],'as':_0xc16a('0xa3'),'where':{'email':_0x27f3cd},'limit':0x1,'order':[[_0xc16a('0xa4'),'DESC']]}]},{'model':db[_0xc16a('0x42')],'as':_0xc16a('0x5d'),'raw':!![]}]})[_0xc16a('0x39')](handleEntityNotFound(_0x382a73,null))[_0xc16a('0x39')](function(_0x1bf651){if(_0x1bf651){_0x1cfeaa=_0x1bf651;if(_0x1bf651['Smtp']){if(_[_0xc16a('0x71')](_0x3da4b0['body'][_0xc16a('0xa5')])){_0x3da4b0[_0xc16a('0x62')][_0xc16a('0xa5')]=util[_0xc16a('0xa6')](_0xc16a('0xa7'),_0x1bf651[_0xc16a('0x3d')],_0x1bf651[_0xc16a('0xa8')]||_0x1bf651[_0xc16a('0x5d')]['user']);}if(_0x3da4b0[_0xc16a('0x62')][_0xc16a('0xa9')]&&_0x3da4b0[_0xc16a('0x62')][_0xc16a('0xa9')][_0xc16a('0x51')]){for(var _0x2bc7d2=0x0;_0x2bc7d2<_0x3da4b0['body'][_0xc16a('0xa9')]['length'];_0x2bc7d2+=0x1){_0x3da4b0[_0xc16a('0x62')][_0xc16a('0xa9')][_0x2bc7d2]={'filename':_0x3da4b0[_0xc16a('0x62')][_0xc16a('0xa9')][_0x2bc7d2][_0xc16a('0x3d')],'path':path['join'](config[_0xc16a('0xaa')],'server/files/attachments',_0x3da4b0[_0xc16a('0x62')][_0xc16a('0xa9')][_0x2bc7d2]['basename'])};}}var _0x5ec181={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1bf651[_0xc16a('0x5d')][_0xc16a('0x7b')])){if(_0x1bf651[_0xc16a('0x5d')][_0xc16a('0x78')]){_0x5ec181['auth']={'user':_0x1bf651[_0xc16a('0x5d')][_0xc16a('0x75')],'pass':_0x1bf651['Smtp'][_0xc16a('0x7c')]};}_0x5ec181[_0xc16a('0x79')]=_0x1bf651['Smtp']['host'];_0x5ec181[_0xc16a('0x7a')]=_0x1bf651[_0xc16a('0x5d')][_0xc16a('0x7a')];_0x5ec181['secure']=_0x1bf651['Smtp'][_0xc16a('0xab')];}else{_0x5ec181[_0xc16a('0x7b')]=_0x1bf651['Smtp'][_0xc16a('0x7b')];_0x5ec181[_0xc16a('0xac')]={'user':_0x1bf651[_0xc16a('0x5d')][_0xc16a('0x75')],'pass':_0x1bf651[_0xc16a('0x5d')]['pass']};}return respondWithRpcPromise(_0xc16a('0xad'),'sendMail',{'account':_0x5ec181,'message':_0x3da4b0[_0xc16a('0x62')]});}else{throw new Error('List\x20not\x20found');}}})[_0xc16a('0x39')](function(_0x4812f6){if(_0x4812f6){_0x271762=_0x4812f6;if(_0x1cfeaa[_0xc16a('0xae')]){if(_0x1cfeaa['List'][_0xc16a('0xa3')][_0xc16a('0x51')]){return _0x1cfeaa[_0xc16a('0xae')]['Contacts'][0x0];}else{return db[_0xc16a('0x8e')]['create'](_[_0xc16a('0x18')](_0x3da4b0['body'],{'firstName':_0x3da4b0[_0xc16a('0x62')]['to'],'email':_0x3da4b0[_0xc16a('0x62')]['to'],'phone':_0x3da4b0['body']['to'],'ListId':_0x1cfeaa['ListId']}));}}else{throw new Error(_0xc16a('0xaf'));}}})[_0xc16a('0x39')](function(_0x2c36da){if(_0x2c36da){var _0x341e63={'UserId':_0x3da4b0[_0xc16a('0x75')]['id'],'ContactId':_0x2c36da['id'],'MailAccountId':_0x1cfeaa['id'],'inReplyTo':_0x271762['messageId'],'to':_0x3da4b0[_0xc16a('0x62')]['from'],'cc':_0x3da4b0[_0xc16a('0x62')]['cc'],'subject':_0x3da4b0[_0xc16a('0x62')][_0xc16a('0xb0')],'attach':_0x3da4b0[_0xc16a('0x62')][_0xc16a('0xb1')],'firstMsgDirection':_0xc16a('0xb2'),'lastMsgAt':moment()[_0xc16a('0xa6')](_0xc16a('0xb3')),'lastMsgDirection':_0xc16a('0xb2'),'lastMsgBody':_0x3da4b0['body'][_0xc16a('0x62')],'Messages':[_[_0xc16a('0x58')](_0x3da4b0[_0xc16a('0x62')],{'messageId':_0x271762[_0xc16a('0xb4')],'sentAt':moment()[_0xc16a('0xa6')](_0xc16a('0xb3')),'read':!![],'MailAccountId':_0x1cfeaa['id'],'UserId':_0x3da4b0[_0xc16a('0x75')]['id'],'ContactId':_0x2c36da['id']})]};if(_0x3da4b0['body'][_0xc16a('0xb5')]){_0x341e63=_['merge'](_0x341e63,_0x3da4b0[_0xc16a('0x62')][_0xc16a('0xb5')]);}return db[_0xc16a('0x8b')][_0xc16a('0x67')](_0x341e63,{'include':[{'model':db[_0xc16a('0x9f')],'as':_0xc16a('0xb6')}]});}})[_0xc16a('0x39')](respondWithResult(_0x382a73,null))[_0xc16a('0x2d')](handleError(_0x382a73,null));};exports[_0xc16a('0xb7')]=function(_0x57c3c8,_0x5df6e7,_0x585053){return db[_0xc16a('0x46')][_0xc16a('0x61')]({'where':{'id':_0x57c3c8[_0xc16a('0x69')]['id']},'include':[{'model':db[_0xc16a('0x42')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x5df6e7,null))[_0xc16a('0x39')](function(_0x19d53d){if(_0x19d53d&&_0x19d53d[_0xc16a('0x5d')]){var _0x1a3609={'id':_0x19d53d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x19d53d['Smtp'][_0xc16a('0x7b')]){_0x1a3609[_0xc16a('0x7b')]=_0x19d53d[_0xc16a('0x5d')][_0xc16a('0x7b')];}else{_0x1a3609[_0xc16a('0x79')]=_0x19d53d[_0xc16a('0x5d')][_0xc16a('0x79')];_0x1a3609[_0xc16a('0x7a')]=_0x19d53d['Smtp'][_0xc16a('0x7a')];_0x1a3609[_0xc16a('0xab')]=_0x19d53d['Smtp'][_0xc16a('0xab')];}if(_0x19d53d['Smtp'][_0xc16a('0x78')]){_0x1a3609['auth']={'user':_0x19d53d['Smtp'][_0xc16a('0x75')],'pass':_0x19d53d['Smtp'][_0xc16a('0x7c')]};}return respondWithRpcPromise('VerifySmtp',_0xc16a('0xb7'),{'account':_0x1a3609});}})[_0xc16a('0x39')](respondWithResult(_0x5df6e7,null))[_0xc16a('0x2d')](handleError(_0x5df6e7,null));};exports[_0xc16a('0x3a')]=function(_0x1994e7,_0x530e76){return db['MailAccount']['find']({'where':{'id':_0x1994e7[_0xc16a('0x69')]['id']}})[_0xc16a('0x39')](handleEntityNotFound(_0x530e76,null))[_0xc16a('0x39')](function(_0x4a5f79){if(_0x4a5f79&&_0x4a5f79[_0xc16a('0x7b')]){throw new db[(_0xc16a('0x22'))]['ValidationError'](_0xc16a('0xb8'));}return _0x4a5f79;})[_0xc16a('0x39')](removeEntity(_0x530e76,null))[_0xc16a('0x2d')](handleError(_0x530e76,null));};exports[_0xc16a('0xb9')]=function(_0x2e02c4,_0xad3ec3,_0x42a995){return db[_0xc16a('0x46')]['find']({'where':{'id':_0x2e02c4[_0xc16a('0x69')]['id']}})['then'](handleEntityNotFound(_0xad3ec3,null))['then'](function(_0x11ea41){if(_0x11ea41){return _0x11ea41[_0xc16a('0xb9')](_0x2e02c4[_0xc16a('0x62')][_0xc16a('0x70')],_[_0xc16a('0x8c')](_0x2e02c4['body'],[_0xc16a('0x70'),'id'])||{})[_0xc16a('0xba')](function(_0x13f251){for(var _0x11b15e=0x0;_0x11b15e<_0x2e02c4[_0xc16a('0x62')][_0xc16a('0x70')][_0xc16a('0x51')];_0x11b15e+=0x1){socket[_0xc16a('0xbb')](_0xc16a('0xbc'),{'UserId':_0x2e02c4[_0xc16a('0x62')][_0xc16a('0x70')][_0x11b15e],'MailAccountId':_0x2e02c4[_0xc16a('0x69')]['id']});}return _0x13f251;});}})[_0xc16a('0x39')](respondWithResult(_0xad3ec3,null))[_0xc16a('0x2d')](handleError(_0xad3ec3,null));};exports[_0xc16a('0xbd')]=function(_0x4ecf41,_0x5eeb71,_0x4fab11){return db[_0xc16a('0x46')][_0xc16a('0x61')]({'where':{'id':_0x4ecf41[_0xc16a('0x69')]['id']}})['then'](handleEntityNotFound(_0x5eeb71,null))[_0xc16a('0x39')](function(_0x48ca9a){if(_0x48ca9a){return _0x48ca9a['removeAgents'](_0x4ecf41[_0xc16a('0x4b')][_0xc16a('0x70')])[_0xc16a('0x39')](function(){if(_[_0xc16a('0xbe')](_0x4ecf41[_0xc16a('0x4b')]['ids'])){for(var _0x1f4e04=0x0;_0x1f4e04<_0x4ecf41['query']['ids']['length'];_0x1f4e04+=0x1){socket[_0xc16a('0xbb')](_0xc16a('0xbf'),{'UserId':Number(_0x4ecf41['query']['ids'][_0x1f4e04]),'MailAccountId':Number(_0x4ecf41[_0xc16a('0x69')]['id'])});}}else{socket['emit'](_0xc16a('0xbf'),{'UserId':Number(_0x4ecf41[_0xc16a('0x4b')][_0xc16a('0x70')]),'MailAccountId':Number(_0x4ecf41[_0xc16a('0x69')]['id'])});}});}})[_0xc16a('0x39')](respondWithStatusCode(_0x5eeb71,null))['catch'](handleError(_0x5eeb71,null));};exports[_0xc16a('0xc0')]=function(_0x5481ac,_0x546b63,_0xdc72e){var _0xa90753={};var _0x26676d={};var _0x2916b1;var _0x5185e6;return db[_0xc16a('0x46')]['findOne']({'where':{'id':_0x5481ac[_0xc16a('0x69')]['id']}})['then'](handleEntityNotFound(_0x546b63,null))['then'](function(_0x2f87e1){if(_0x2f87e1){_0x2916b1=_0x2f87e1;_0x26676d[_0xc16a('0x4a')]=_[_0xc16a('0x4c')](db[_0xc16a('0x90')][_0xc16a('0x47')]);_0x26676d['query']=_[_0xc16a('0x4c')](_0x5481ac[_0xc16a('0x4b')]);_0x26676d[_0xc16a('0x4d')]=_[_0xc16a('0x4e')](_0x26676d[_0xc16a('0x4a')],_0x26676d[_0xc16a('0x4b')]);_0xa90753[_0xc16a('0x4f')]=_['intersection'](_0x26676d[_0xc16a('0x4a')],qs[_0xc16a('0x50')](_0x5481ac[_0xc16a('0x4b')][_0xc16a('0x50')]));_0xa90753['attributes']=_0xa90753[_0xc16a('0x4f')][_0xc16a('0x51')]?_0xa90753[_0xc16a('0x4f')]:_0x26676d[_0xc16a('0x4a')];_0xa90753[_0xc16a('0x54')]=qs['sort'](_0x5481ac['query'][_0xc16a('0x55')]);_0xa90753['where']=qs[_0xc16a('0x4d')](_[_0xc16a('0x56')](_0x5481ac[_0xc16a('0x4b')],_0x26676d[_0xc16a('0x4d')]));if(_0x5481ac[_0xc16a('0x4b')][_0xc16a('0x5a')]){_0xa90753['where']=_[_0xc16a('0x58')](_0xa90753[_0xc16a('0x57')],{'$or':_['map'](_0xa90753['attributes'],function(_0x23d4eb){var _0x2e4c1a={};_0x2e4c1a[_0x23d4eb]={'$like':'%'+_0x5481ac['query'][_0xc16a('0x5a')]+'%'};return _0x2e4c1a;})});}_0xa90753=_['merge']({},_0xa90753,_0x5481ac[_0xc16a('0x60')]);return _0x2916b1['getAgents'](_0xa90753);}})[_0xc16a('0x39')](function(_0x1c95ee){if(_0x1c95ee){_0x5185e6=_0x1c95ee[_0xc16a('0x51')];if(!_0x5481ac[_0xc16a('0x4b')]['hasOwnProperty']('nolimit')){_0xa90753[_0xc16a('0x33')]=qs[_0xc16a('0x33')](_0x5481ac['query'][_0xc16a('0x33')]);_0xa90753[_0xc16a('0x32')]=qs[_0xc16a('0x32')](_0x5481ac[_0xc16a('0x4b')][_0xc16a('0x32')]);}return _0x2916b1['getAgents'](_0xa90753);}})['then'](function(_0x5b57f0){if(_0x5b57f0){return _0x5b57f0?{'count':_0x5185e6,'rows':_0x5b57f0}:null;}})[_0xc16a('0x39')](respondWithResult(_0x546b63,null))[_0xc16a('0x2d')](handleError(_0x546b63,null));};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js
index 5bd155f..1cceb2a 100644
--- a/server/api/mailAccount/mailAccount.events.js
+++ b/server/api/mailAccount/mailAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd15=['MailAccount','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2f8e01,_0x278674){var _0x5333e9=function(_0x1abd14){while(--_0x1abd14){_0x2f8e01['push'](_0x2f8e01['shift']());}};_0x5333e9(++_0x278674);}(_0xdd15,0x1e7));var _0x5dd1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdd15[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x5dd1('0x0'))['db'][_0x5dd1('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5dd1('0x2'),'afterUpdate':'update','afterDestroy':_0x5dd1('0x3')};function emitEvent(_0x466de0){return function(_0x10b96f,_0xee0868,_0x3d3a6d){MailAccountEvents[_0x5dd1('0x4')](_0x466de0+':'+_0x10b96f['id'],_0x10b96f);MailAccountEvents[_0x5dd1('0x4')](_0x466de0,_0x10b96f);_0x3d3a6d(null);};}for(var e in events){if(events[_0x5dd1('0x5')](e)){var event=events[e];MailAccount[_0x5dd1('0x6')](e,emitEvent(event));}}module[_0x5dd1('0x7')]=MailAccountEvents;
\ No newline at end of file
+var _0xeb82=['MailAccount','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xeb82,0x8e));var _0x2eb8=function(_0x57700e,_0x222894){_0x57700e=_0x57700e-0x0;var _0x30097d=_0xeb82[_0x57700e];return _0x30097d;};'use strict';var EventEmitter=require(_0x2eb8('0x0'));var MailAccount=require(_0x2eb8('0x1'))['db'][_0x2eb8('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2eb8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2eb8('0x4'),'afterDestroy':_0x2eb8('0x5')};function emitEvent(_0x5e4af6){return function(_0x2084b5,_0x4f3845,_0x4a9a10){MailAccountEvents['emit'](_0x5e4af6+':'+_0x2084b5['id'],_0x2084b5);MailAccountEvents[_0x2eb8('0x6')](_0x5e4af6,_0x2084b5);_0x4a9a10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x2eb8('0x7')](e,emitEvent(event));}}module[_0x2eb8('0x8')]=MailAccountEvents;
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js
index f59005b..1ca8303 100644
--- a/server/api/mailAccount/mailAccount.model.js
+++ b/server/api/mailAccount/mailAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x35f9=['util','../../config/logger','api','bluebird','path','../../config/environment','exports','MailAccount','mail_accounts','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35f9,0x10d));var _0x935f=function(_0x3283c3,_0x249100){_0x3283c3=_0x3283c3-0x0;var _0x393f5c=_0x35f9[_0x3283c3];return _0x393f5c;};'use strict';var _=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var logger=require(_0x935f('0x2'))(_0x935f('0x3'));var moment=require('moment');var BPromise=require(_0x935f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x935f('0x5'));var rimraf=require('rimraf');var config=require(_0x935f('0x6'));var attributes=require('./mailAccount.attributes');module[_0x935f('0x7')]=function(_0x4a038a,_0x754386){return _0x4a038a['define'](_0x935f('0x8'),attributes,{'tableName':_0x935f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe841=['../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xe841,0x161));var _0x1e84=function(_0x23d2d6,_0x7f83d){_0x23d2d6=_0x23d2d6-0x0;var _0x566256=_0xe841[_0x23d2d6];return _0x566256;};'use strict';var _=require(_0x1e84('0x0'));var util=require(_0x1e84('0x1'));var logger=require(_0x1e84('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1e84('0x3'));var rp=require(_0x1e84('0x4'));var fs=require('fs');var path=require(_0x1e84('0x5'));var rimraf=require(_0x1e84('0x6'));var config=require(_0x1e84('0x7'));var attributes=require(_0x1e84('0x8'));module[_0x1e84('0x9')]=function(_0x41d444,_0x46d58b){return _0x41d444['define'](_0x1e84('0xa'),attributes,{'tableName':_0x1e84('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js
index 543ca65..25584f7 100644
--- a/server/api/mailAccount/mailAccount.rpc.js
+++ b/server/api/mailAccount/mailAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4058=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','request','then','debug','code','error','message','MailAccount,\x20%s,\x20%s','info','request\x20sent','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','map','include','model','stringify','find','where','ShowMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','MailApplication','Applications','MailServerOut','get','account','omit','applications','list','orderBy','asc','autoclose','push','length','create','List\x20not\x20found','messageId','generate','subject','attach','MailInteraction','Messages','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','format','interaction','created','MailMessage','attachments','originCc','bcc','Attachment','Attachments','UserId','User','unshift','agent','name','*,*,*,*','Start','startRouting'];(function(_0x4d471b,_0x281167){var _0x54fd9b=function(_0x4d85b0){while(--_0x4d85b0){_0x4d471b['push'](_0x4d471b['shift']());}};_0x54fd9b(++_0x281167);}(_0x4058,0x129));var _0x8405=function(_0x52864c,_0x51caad){_0x52864c=_0x52864c-0x0;var _0x3d3fcd=_0x4058[_0x52864c];return _0x3d3fcd;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var moment=require(_0x8405('0x2'));var BPromise=require(_0x8405('0x3'));var rs=require(_0x8405('0x4'));var fs=require('fs');var Redis=require(_0x8405('0x5'));var db=require(_0x8405('0x6'))['db'];var utils=require(_0x8405('0x7'));var logger=require(_0x8405('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8405('0x9')][_0x8405('0xa')]({'port':0x232c});config[_0x8405('0xb')]=_[_0x8405('0xc')](config[_0x8405('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8405('0xd'))(new Redis(config[_0x8405('0xb')]));require(_0x8405('0xe'))['register'](socket);function respondWithRpcPromise(_0x30705f,_0x5e132b,_0x6979fd){return new BPromise(function(_0xb442,_0x50344e){return client[_0x8405('0xf')](_0x30705f,_0x6979fd)[_0x8405('0x10')](function(_0x5b94d5){logger['info']('MailAccount,\x20%s,\x20%s',_0x5e132b,'request\x20sent');logger[_0x8405('0x11')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5e132b,'request\x20sent',JSON['stringify'](_0x5b94d5));if(_0x5b94d5['error']){if(_0x5b94d5['error'][_0x8405('0x12')]===0x1f4){logger[_0x8405('0x13')]('MailAccount,\x20%s,\x20%s',_0x5e132b,_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);return _0x50344e(_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);}logger['error'](_0x8405('0x15'),_0x5e132b,_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);return _0xb442(_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);}else{logger[_0x8405('0x16')](_0x8405('0x15'),_0x5e132b,_0x8405('0x17'));_0xb442(_0x5b94d5[_0x8405('0x18')][_0x8405('0x14')]);}})[_0x8405('0x19')](function(_0x21376d){logger[_0x8405('0x13')](_0x8405('0x15'),_0x5e132b,_0x21376d);_0x50344e(_0x21376d);});});}exports[_0x8405('0x1a')]=function(_0x42c191){var _0x2902d9=this;return new Promise(function(_0x14bc3e,_0x2483ab){return db[_0x8405('0x1b')][_0x8405('0x1c')]({'raw':_0x42c191[_0x8405('0x1d')]?_0x42c191[_0x8405('0x1d')][_0x8405('0x1e')]===undefined?!![]:![]:!![],'where':_0x42c191[_0x8405('0x1d')]?_0x42c191[_0x8405('0x1d')]['where']||null:null,'attributes':_0x42c191['options']?_0x42c191[_0x8405('0x1d')][_0x8405('0x1f')]||null:null,'limit':_0x42c191[_0x8405('0x1d')]?_0x42c191['options'][_0x8405('0x20')]||null:null,'include':_0x42c191['options']?_0x42c191[_0x8405('0x1d')]['include']?_[_0x8405('0x21')](_0x42c191[_0x8405('0x1d')][_0x8405('0x22')],function(_0x4450eb){return{'model':db[_0x4450eb[_0x8405('0x23')]],'as':_0x4450eb['as'],'attributes':_0x4450eb[_0x8405('0x1f')],'include':_0x4450eb[_0x8405('0x22')]?_[_0x8405('0x21')](_0x4450eb[_0x8405('0x22')],function(_0x24b88d){return{'model':db[_0x24b88d[_0x8405('0x23')]],'as':_0x24b88d['as'],'attributes':_0x24b88d[_0x8405('0x1f')],'include':_0x24b88d['include']?_[_0x8405('0x21')](_0x24b88d['include'],function(_0x48a425){return{'model':db[_0x48a425[_0x8405('0x23')]],'as':_0x48a425['as'],'attributes':_0x48a425[_0x8405('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8405('0x10')](function(_0x26d5ec){logger[_0x8405('0x16')](_0x8405('0x1a'),_0x42c191);logger[_0x8405('0x11')](_0x8405('0x1a'),_0x42c191,JSON[_0x8405('0x24')](_0x26d5ec));_0x14bc3e(_0x26d5ec);})[_0x8405('0x19')](function(_0x20bca3){logger[_0x8405('0x13')](_0x8405('0x1a'),_0x20bca3['message'],_0x42c191);_0x2483ab(_0x2902d9[_0x8405('0x13')](0x1f4,_0x20bca3[_0x8405('0x14')]));});});};exports['ShowMailAccount']=function(_0x3c12e3){var _0x17c589=this;return new Promise(function(_0x1bcfa5,_0x5c50f9){return db[_0x8405('0x1b')][_0x8405('0x25')]({'raw':_0x3c12e3[_0x8405('0x1d')]?_0x3c12e3['options'][_0x8405('0x1e')]===undefined?!![]:![]:!![],'where':_0x3c12e3[_0x8405('0x1d')]?_0x3c12e3['options'][_0x8405('0x26')]||null:null,'attributes':_0x3c12e3['options']?_0x3c12e3[_0x8405('0x1d')][_0x8405('0x1f')]||null:null,'include':_0x3c12e3[_0x8405('0x1d')]?_0x3c12e3[_0x8405('0x1d')][_0x8405('0x22')]?_[_0x8405('0x21')](_0x3c12e3[_0x8405('0x1d')][_0x8405('0x22')],function(_0x1ae1c4){return{'model':db[_0x1ae1c4[_0x8405('0x23')]],'as':_0x1ae1c4['as'],'attributes':_0x1ae1c4[_0x8405('0x1f')],'include':_0x1ae1c4[_0x8405('0x22')]?_['map'](_0x1ae1c4[_0x8405('0x22')],function(_0x4c174c){return{'model':db[_0x4c174c['model']],'as':_0x4c174c['as'],'attributes':_0x4c174c[_0x8405('0x1f')],'include':_0x4c174c[_0x8405('0x22')]?_['map'](_0x4c174c[_0x8405('0x22')],function(_0x4349d2){return{'model':db[_0x4349d2[_0x8405('0x23')]],'as':_0x4349d2['as'],'attributes':_0x4349d2[_0x8405('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8405('0x10')](function(_0x565324){logger[_0x8405('0x16')](_0x8405('0x27'),_0x3c12e3);logger[_0x8405('0x11')](_0x8405('0x27'),_0x3c12e3,JSON[_0x8405('0x24')](_0x565324));_0x1bcfa5(_0x565324);})['catch'](function(_0x349143){logger[_0x8405('0x13')](_0x8405('0x27'),_0x349143[_0x8405('0x14')],_0x3c12e3);_0x5c50f9(_0x17c589[_0x8405('0x13')](0x1f4,_0x349143[_0x8405('0x14')]));});});};exports['NotifyMailAccount']=function(_0xfe699c){var _0x37ea80=this;return new Promise(function(_0x23e559,_0x1df6a6){var _0x27ce36={'body':_0xfe699c[_0x8405('0x28')],'channel':_0x8405('0x29')};var _0x4f3692=_[_0x8405('0x2a')](_['keys'](db[_0x8405('0x2b')][_0x8405('0x2c')]),['createdAt',_0x8405('0x2d'),_0x8405('0x2e'),_0x8405('0x2f')]);var _0xaf6465=![];if(_0xfe699c[_0x8405('0x28')]['id']){delete _0xfe699c[_0x8405('0x28')]['id'];}if(_[_0x8405('0x30')](_0xfe699c[_0x8405('0x28')][_0x8405('0x31')])){return _0x1df6a6(_0x37ea80[_0x8405('0x13')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0xfe699c[_0x8405('0x28')]['body'])||_0xfe699c[_0x8405('0x28')][_0x8405('0x28')]===''){return _0x1df6a6(_0x37ea80[_0x8405('0x13')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8405('0x30')](_0xfe699c[_0x8405('0x28')]['mapKey'])){return _0x1df6a6(_0x37ea80[_0x8405('0x13')](0x1f4,_0x8405('0x32')+_0x4f3692));}if(!_[_0x8405('0x33')](_0x4f3692,_0xfe699c[_0x8405('0x28')][_0x8405('0x34')])){return _0x1df6a6(_0x37ea80[_0x8405('0x13')](0x1f4,_0x8405('0x35')+_0x4f3692));}var _0x4fec13={};_0x4fec13[_0xfe699c['body']['mapKey']]=_0xfe699c[_0x8405('0x28')][_0x8405('0x31')];return db[_0x8405('0x1b')][_0x8405('0x25')]({'where':{'id':_0xfe699c['account']['id']},'include':[{'model':db['CmList'],'as':_0x8405('0x36'),'include':[{'model':db[_0x8405('0x2b')],'as':_0x8405('0x37'),'where':_0x4fec13,'limit':0x1,'order':[[_0x8405('0x2d'),_0x8405('0x38')]]}]},{'model':db[_0x8405('0x39')],'as':_0x8405('0x3a')},{'model':db[_0x8405('0x3b')],'as':'Smtp'}]})[_0x8405('0x10')](function(_0x4e9c9e){if(_0x4e9c9e&&_0x4e9c9e[_0x8405('0x36')]){var _0xe34167=_0x4e9c9e[_0x8405('0x3c')]({'plain':!![]});_0x27ce36[_0x8405('0x3d')]=_[_0x8405('0x3e')](_0xe34167,[_0x8405('0x3a'),_0x8405('0x36')]);_0x27ce36[_0x8405('0x3f')]=_0xe34167['Applications'];_0x27ce36[_0x8405('0x40')]=_0xe34167[_0x8405('0x36')];_0x27ce36[_0x8405('0x3f')]=_[_0x8405('0x41')](_0x27ce36['applications'],['priority'],[_0x8405('0x42')]);if(_0x27ce36[_0x8405('0x3d')]&&_0x27ce36[_0x8405('0x3d')][_0x8405('0x43')]){_0x27ce36[_0x8405('0x3f')][_0x8405('0x44')]({'id':0x0,'priority':_0x27ce36[_0x8405('0x3f')]['length']+0x1,'app':'close','appdata':_0x8405('0x43'),'interval':'*,*,*,*'});}if(_0x27ce36[_0x8405('0x3d')][_0x8405('0x3a')]){delete _0x27ce36[_0x8405('0x3d')]['Applications'];}if(_0x27ce36['account'][_0x8405('0x36')]){delete _0x27ce36['account'][_0x8405('0x36')];}if(_0xe34167[_0x8405('0x36')][_0x8405('0x37')][_0x8405('0x45')]){return _0xe34167[_0x8405('0x36')][_0x8405('0x37')][0x0];}var _0x1f720c=_[_0x8405('0xc')](_0xfe699c[_0x8405('0x28')],{'firstName':_0xfe699c['body'][_0x8405('0x31')],'ListId':_0xe34167[_0x8405('0x2f')]});_0x1f720c[_0xfe699c[_0x8405('0x28')][_0x8405('0x34')]]=_0xfe699c['body'][_0x8405('0x31')];return db[_0x8405('0x2b')][_0x8405('0x46')](_0x1f720c);}else{throw new Error(_0x8405('0x47'));}})[_0x8405('0x10')](function(_0x3ce3ff){_0x27ce36['contact']=_0x3ce3ff;if(_0x3ce3ff){if(!_0xfe699c[_0x8405('0x28')][_0x8405('0x14')][_0x8405('0x48')]){_0xfe699c['body'][_0x8405('0x14')][_0x8405('0x48')]=rs[_0x8405('0x49')]()+'\x20'+_0xfe699c[_0x8405('0x28')][_0x8405('0x14')][_0x8405('0x31')];}var _0x283dcb={'ContactId':_0x3ce3ff['id'],'MailAccountId':_0xfe699c[_0x8405('0x3d')]['id'],'inReplyTo':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')]['messageId'],'to':_0xfe699c[_0x8405('0x28')]['message'][_0x8405('0x31')],'cc':_0xfe699c['body'][_0x8405('0x14')]['cc'],'subject':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')][_0x8405('0x4a')],'attach':_0xfe699c[_0x8405('0x28')]['message'][_0x8405('0x4b')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0xfe699c[_0x8405('0x28')]['body']};return db[_0x8405('0x4c')][_0x8405('0x25')]({'where':{'closed':![],'MailAccountId':_0xfe699c[_0x8405('0x3d')]['id']},'include':[{'model':db['MailMessage'],'as':_0x8405('0x4d'),'attributes':[_0x8405('0x48')],'where':{'messageId':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')][_0x8405('0x4e')]}}]})[_0x8405('0x10')](function(_0x485af5){if(_0x485af5){return[_0x485af5,![]];}return db[_0x8405('0x4c')][_0x8405('0x46')](_0x283dcb)[_0x8405('0x10')](function(_0x539969){return[_0x539969,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8405('0x4f')](function(_0x408e39,_0x13d60f){if(_0x408e39){_0xaf6465=_0x13d60f;if(!_0x13d60f){return _0x408e39[_0x8405('0x50')]({'inReplyTo':_0xfe699c[_0x8405('0x28')]['message']['messageId'],'to':_0xfe699c['body'][_0x8405('0x14')][_0x8405('0x31')],'cc':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')]['cc'],'subject':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')][_0x8405('0x4a')],'attach':_0x408e39[_0x8405('0x4b')]?_0x408e39[_0x8405('0x4b')]:_0xfe699c[_0x8405('0x28')][_0x8405('0x14')][_0x8405('0x4b')],'substatus':null,'substatusAt':moment()['format'](_0x8405('0x51')),'lastMsgAt':moment()[_0x8405('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0xfe699c[_0x8405('0x28')][_0x8405('0x28')]});}else{return _0x408e39;}}})[_0x8405('0x10')](function(_0x3fd943){_0x27ce36[_0x8405('0x53')]=_0x3fd943[_0x8405('0x3c')]({'plain':!![]});_0x27ce36[_0x8405('0x53')][_0x8405('0x54')]=_0xaf6465;return db[_0x8405('0x55')]['create']({'body':_0xfe699c[_0x8405('0x28')][_0x8405('0x28')],'MailAccountId':_0xfe699c[_0x8405('0x3d')]['id'],'MailInteractionId':_0x3fd943['id'],'direction':'in','ContactId':_0x27ce36['contact']['id'],'messageId':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')][_0x8405('0x48')],'from':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')]['from'],'to':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')]['to'],'cc':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')]['cc'],'subject':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')][_0x8405('0x4a')],'attach':_0xfe699c[_0x8405('0x28')][_0x8405('0x14')]['attach'],'Attachments':_0xfe699c[_0x8405('0x28')]['message'][_0x8405('0x56')],'originTo':_0xfe699c[_0x8405('0x28')]['message']['originTo'],'originCc':_0xfe699c['body']['message'][_0x8405('0x57')],'bcc':_0xfe699c['body'][_0x8405('0x14')][_0x8405('0x58')]},{'include':[{'model':db[_0x8405('0x59')],'as':_0x8405('0x5a')}]});})[_0x8405('0x10')](function(_0x22d5ef){_0x27ce36[_0x8405('0x14')]=_0x22d5ef;if(_0x27ce36['interaction'][_0x8405('0x5b')]){return db[_0x8405('0x5c')]['find']({'attributes':['id','name'],'where':{'id':_0x27ce36['interaction']['UserId']}})['then'](function(_0x506456){if(_0x506456){_0x27ce36[_0x8405('0x3f')][_0x8405('0x5d')]({'id':0x0,'priority':0x0,'app':_0x8405('0x5e'),'appdata':_0x506456[_0x8405('0x5f')]+','+(_0x27ce36[_0x8405('0x3d')]['waitForTheAssignedAgent']||0xa),'interval':_0x8405('0x60')});}return respondWithRpcPromise(_0x8405('0x61'),_0x8405('0x62'),_0x27ce36);});}return respondWithRpcPromise(_0x8405('0x61'),_0x8405('0x62'),_0x27ce36);})['then'](function(_0x2e648d){_0x23e559(_0x2e648d);})[_0x8405('0x19')](function(_0xaf9bf){_0x1df6a6(_0x37ea80[_0x8405('0x13')](0x1f4,_0xaf9bf[_0x8405('0x14')]));});});};
\ No newline at end of file
+var _0x0e9f=['../../config/environment','jayson/promise','http','defaults','redis','localhost','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowMailAccount','MailAccount','find','NotifyMailAccount','mail','keys','updatedAt','CompanyId','ListId','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','account','CmList','List','CmContact','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','asc','autoclose','push','length','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','format','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','bcc','UserId','User','name','agent','waitForTheAssignedAgent','Start','lodash','util','randomstring','../../config/utils'];(function(_0x1957fb,_0x3c6771){var _0x2a93bc=function(_0x4303d9){while(--_0x4303d9){_0x1957fb['push'](_0x1957fb['shift']());}};_0x2a93bc(++_0x3c6771);}(_0x0e9f,0x116));var _0xf0e9=function(_0x19d09f,_0x2bd6d6){_0x19d09f=_0x19d09f-0x0;var _0x178b15=_0x0e9f[_0x19d09f];return _0x178b15;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232c});config['redis']=_[_0xf0e9('0x7')](config[_0xf0e9('0x8')],{'host':_0xf0e9('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf0e9('0xa'))[_0xf0e9('0xb')](socket);function respondWithRpcPromise(_0x55278c,_0x5071a4,_0x3cbdd8){return new BPromise(function(_0x3c498e,_0x3cfc16){return client['request'](_0x55278c,_0x3cbdd8)[_0xf0e9('0xc')](function(_0x34af01){logger[_0xf0e9('0xd')](_0xf0e9('0xe'),_0x5071a4,'request\x20sent');logger[_0xf0e9('0xf')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5071a4,_0xf0e9('0x10'),JSON[_0xf0e9('0x11')](_0x34af01));if(_0x34af01['error']){if(_0x34af01[_0xf0e9('0x12')][_0xf0e9('0x13')]===0x1f4){logger[_0xf0e9('0x12')](_0xf0e9('0xe'),_0x5071a4,_0x34af01[_0xf0e9('0x12')][_0xf0e9('0x14')]);return _0x3cfc16(_0x34af01['error'][_0xf0e9('0x14')]);}logger[_0xf0e9('0x12')]('MailAccount,\x20%s,\x20%s',_0x5071a4,_0x34af01[_0xf0e9('0x12')][_0xf0e9('0x14')]);return _0x3c498e(_0x34af01[_0xf0e9('0x12')][_0xf0e9('0x14')]);}else{logger['info'](_0xf0e9('0xe'),_0x5071a4,_0xf0e9('0x10'));_0x3c498e(_0x34af01[_0xf0e9('0x15')][_0xf0e9('0x14')]);}})['catch'](function(_0x50df7a){logger[_0xf0e9('0x12')](_0xf0e9('0xe'),_0x5071a4,_0x50df7a);_0x3cfc16(_0x50df7a);});});}exports[_0xf0e9('0x16')]=function(_0x49c120){var _0x52cf0a=this;return new Promise(function(_0x19052c,_0x1ac91f){return db['MailAccount'][_0xf0e9('0x17')]({'raw':_0x49c120['options']?_0x49c120[_0xf0e9('0x18')][_0xf0e9('0x19')]===undefined?!![]:![]:!![],'where':_0x49c120['options']?_0x49c120['options'][_0xf0e9('0x1a')]||null:null,'attributes':_0x49c120[_0xf0e9('0x18')]?_0x49c120['options'][_0xf0e9('0x1b')]||null:null,'limit':_0x49c120[_0xf0e9('0x18')]?_0x49c120['options'][_0xf0e9('0x1c')]||null:null,'include':_0x49c120[_0xf0e9('0x18')]?_0x49c120['options'][_0xf0e9('0x1d')]?_[_0xf0e9('0x1e')](_0x49c120[_0xf0e9('0x18')][_0xf0e9('0x1d')],function(_0x33048a){return{'model':db[_0x33048a[_0xf0e9('0x1f')]],'as':_0x33048a['as'],'attributes':_0x33048a[_0xf0e9('0x1b')],'include':_0x33048a['include']?_['map'](_0x33048a[_0xf0e9('0x1d')],function(_0x4f9e96){return{'model':db[_0x4f9e96['model']],'as':_0x4f9e96['as'],'attributes':_0x4f9e96['attributes'],'include':_0x4f9e96[_0xf0e9('0x1d')]?_[_0xf0e9('0x1e')](_0x4f9e96['include'],function(_0x258927){return{'model':db[_0x258927[_0xf0e9('0x1f')]],'as':_0x258927['as'],'attributes':_0x258927[_0xf0e9('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fa5e9){logger[_0xf0e9('0xd')](_0xf0e9('0x16'),_0x49c120);logger[_0xf0e9('0xf')](_0xf0e9('0x16'),_0x49c120,JSON[_0xf0e9('0x11')](_0x2fa5e9));_0x19052c(_0x2fa5e9);})[_0xf0e9('0x20')](function(_0x1cd461){logger['error'](_0xf0e9('0x16'),_0x1cd461[_0xf0e9('0x14')],_0x49c120);_0x1ac91f(_0x52cf0a['error'](0x1f4,_0x1cd461['message']));});});};exports[_0xf0e9('0x21')]=function(_0x238ce0){var _0x5c365b=this;return new Promise(function(_0x35402d,_0x10ae6c){return db[_0xf0e9('0x22')][_0xf0e9('0x23')]({'raw':_0x238ce0[_0xf0e9('0x18')]?_0x238ce0[_0xf0e9('0x18')][_0xf0e9('0x19')]===undefined?!![]:![]:!![],'where':_0x238ce0[_0xf0e9('0x18')]?_0x238ce0['options'][_0xf0e9('0x1a')]||null:null,'attributes':_0x238ce0[_0xf0e9('0x18')]?_0x238ce0['options'][_0xf0e9('0x1b')]||null:null,'include':_0x238ce0['options']?_0x238ce0[_0xf0e9('0x18')]['include']?_['map'](_0x238ce0[_0xf0e9('0x18')][_0xf0e9('0x1d')],function(_0x31199e){return{'model':db[_0x31199e[_0xf0e9('0x1f')]],'as':_0x31199e['as'],'attributes':_0x31199e[_0xf0e9('0x1b')],'include':_0x31199e[_0xf0e9('0x1d')]?_['map'](_0x31199e[_0xf0e9('0x1d')],function(_0x5526b9){return{'model':db[_0x5526b9[_0xf0e9('0x1f')]],'as':_0x5526b9['as'],'attributes':_0x5526b9['attributes'],'include':_0x5526b9[_0xf0e9('0x1d')]?_[_0xf0e9('0x1e')](_0x5526b9[_0xf0e9('0x1d')],function(_0xfb8a73){return{'model':db[_0xfb8a73[_0xf0e9('0x1f')]],'as':_0xfb8a73['as'],'attributes':_0xfb8a73[_0xf0e9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf0e9('0xc')](function(_0x2dd0d7){logger[_0xf0e9('0xd')](_0xf0e9('0x21'),_0x238ce0);logger['debug'](_0xf0e9('0x21'),_0x238ce0,JSON[_0xf0e9('0x11')](_0x2dd0d7));_0x35402d(_0x2dd0d7);})['catch'](function(_0x34a15f){logger[_0xf0e9('0x12')](_0xf0e9('0x21'),_0x34a15f[_0xf0e9('0x14')],_0x238ce0);_0x10ae6c(_0x5c365b[_0xf0e9('0x12')](0x1f4,_0x34a15f['message']));});});};exports[_0xf0e9('0x24')]=function(_0xd14889){var _0x59e0e1=this;return new Promise(function(_0x27173f,_0x4d80bd){var _0x27b3e4={'body':_0xd14889['body'],'channel':_0xf0e9('0x25')};var _0xf7c1b5=_['difference'](_[_0xf0e9('0x26')](db['CmContact']['rawAttributes']),['createdAt',_0xf0e9('0x27'),_0xf0e9('0x28'),_0xf0e9('0x29')]);var _0x405bf3=![];if(_0xd14889['body']['id']){delete _0xd14889[_0xf0e9('0x2a')]['id'];}if(_[_0xf0e9('0x2b')](_0xd14889['body']['from'])){return _0x4d80bd(_0x59e0e1[_0xf0e9('0x12')](0x1f4,_0xf0e9('0x2c')));}if(_[_0xf0e9('0x2b')](_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x2a')])||_0xd14889['body'][_0xf0e9('0x2a')]===''){return _0x4d80bd(_0x59e0e1[_0xf0e9('0x12')](0x1f4,_0xf0e9('0x2d')));}if(_[_0xf0e9('0x2b')](_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x2e')])){return _0x4d80bd(_0x59e0e1[_0xf0e9('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf7c1b5));}if(!_[_0xf0e9('0x2f')](_0xf7c1b5,_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x2e')])){return _0x4d80bd(_0x59e0e1[_0xf0e9('0x12')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf7c1b5));}var _0x20f502={};_0x20f502[_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x2e')]]=_0xd14889['body'][_0xf0e9('0x30')];return db[_0xf0e9('0x22')][_0xf0e9('0x23')]({'where':{'id':_0xd14889[_0xf0e9('0x31')]['id']},'include':[{'model':db[_0xf0e9('0x32')],'as':_0xf0e9('0x33'),'include':[{'model':db[_0xf0e9('0x34')],'as':_0xf0e9('0x35'),'where':_0x20f502,'limit':0x1,'order':[[_0xf0e9('0x27'),_0xf0e9('0x36')]]}]},{'model':db[_0xf0e9('0x37')],'as':_0xf0e9('0x38')},{'model':db[_0xf0e9('0x39')],'as':_0xf0e9('0x3a')}]})[_0xf0e9('0xc')](function(_0x44967c){if(_0x44967c&&_0x44967c[_0xf0e9('0x33')]){var _0x1c94d2=_0x44967c[_0xf0e9('0x3b')]({'plain':!![]});_0x27b3e4[_0xf0e9('0x31')]=_[_0xf0e9('0x3c')](_0x1c94d2,[_0xf0e9('0x38'),_0xf0e9('0x33')]);_0x27b3e4[_0xf0e9('0x3d')]=_0x1c94d2[_0xf0e9('0x38')];_0x27b3e4[_0xf0e9('0x3e')]=_0x1c94d2['List'];_0x27b3e4[_0xf0e9('0x3d')]=_[_0xf0e9('0x3f')](_0x27b3e4['applications'],[_0xf0e9('0x40')],[_0xf0e9('0x41')]);if(_0x27b3e4[_0xf0e9('0x31')]&&_0x27b3e4[_0xf0e9('0x31')][_0xf0e9('0x42')]){_0x27b3e4['applications'][_0xf0e9('0x43')]({'id':0x0,'priority':_0x27b3e4['applications'][_0xf0e9('0x44')]+0x1,'app':'close','appdata':_0xf0e9('0x42'),'interval':_0xf0e9('0x45')});}if(_0x27b3e4[_0xf0e9('0x31')][_0xf0e9('0x38')]){delete _0x27b3e4['account']['Applications'];}if(_0x27b3e4[_0xf0e9('0x31')]['List']){delete _0x27b3e4[_0xf0e9('0x31')][_0xf0e9('0x33')];}if(_0x1c94d2['List'][_0xf0e9('0x35')]['length']){return _0x1c94d2[_0xf0e9('0x33')]['Contacts'][0x0];}var _0x210445=_['defaults'](_0xd14889[_0xf0e9('0x2a')],{'firstName':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x30')],'ListId':_0x1c94d2[_0xf0e9('0x29')]});_0x210445[_0xd14889['body'][_0xf0e9('0x2e')]]=_0xd14889['body'][_0xf0e9('0x30')];return db['CmContact'][_0xf0e9('0x46')](_0x210445);}else{throw new Error(_0xf0e9('0x47'));}})[_0xf0e9('0xc')](function(_0x21cddd){_0x27b3e4['contact']=_0x21cddd;if(_0x21cddd){if(!_0xd14889[_0xf0e9('0x2a')]['message'][_0xf0e9('0x48')]){_0xd14889['body'][_0xf0e9('0x14')][_0xf0e9('0x48')]=rs[_0xf0e9('0x49')]()+'\x20'+_0xd14889[_0xf0e9('0x2a')]['message']['from'];}var _0x337504={'ContactId':_0x21cddd['id'],'MailAccountId':_0xd14889[_0xf0e9('0x31')]['id'],'inReplyTo':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')][_0xf0e9('0x48')],'to':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')][_0xf0e9('0x30')],'cc':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')]['cc'],'subject':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')][_0xf0e9('0x4a')],'attach':_0xd14889[_0xf0e9('0x2a')]['message']['attach'],'lastMsgAt':moment()[_0xf0e9('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x2a')]};return db['MailInteraction'][_0xf0e9('0x23')]({'where':{'closed':![],'MailAccountId':_0xd14889[_0xf0e9('0x31')]['id']},'include':[{'model':db[_0xf0e9('0x4c')],'as':_0xf0e9('0x4d'),'attributes':[_0xf0e9('0x48')],'where':{'messageId':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')][_0xf0e9('0x4e')]}}]})[_0xf0e9('0xc')](function(_0x33a024){if(_0x33a024){return[_0x33a024,![]];}return db['MailInteraction'][_0xf0e9('0x46')](_0x337504)['then'](function(_0x5f3073){return[_0x5f3073,!![]];});});}else{throw new Error(_0xf0e9('0x4f'));}})[_0xf0e9('0x50')](function(_0x218698,_0x54fd62){if(_0x218698){_0x405bf3=_0x54fd62;if(!_0x54fd62){return _0x218698[_0xf0e9('0x51')]({'inReplyTo':_0xd14889[_0xf0e9('0x2a')]['message']['messageId'],'to':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')][_0xf0e9('0x30')],'cc':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')]['cc'],'subject':_0xd14889['body'][_0xf0e9('0x14')][_0xf0e9('0x4a')],'attach':_0x218698[_0xf0e9('0x52')]?_0x218698['attach']:_0xd14889[_0xf0e9('0x2a')]['message'][_0xf0e9('0x52')],'substatus':null,'substatusAt':moment()[_0xf0e9('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xf0e9('0x4b')](_0xf0e9('0x53')),'lastMsgDirection':'in','lastMsgBody':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x2a')]});}else{return _0x218698;}}})[_0xf0e9('0xc')](function(_0x11a77a){_0x27b3e4[_0xf0e9('0x54')]=_0x11a77a[_0xf0e9('0x3b')]({'plain':!![]});_0x27b3e4[_0xf0e9('0x54')][_0xf0e9('0x55')]=_0x405bf3;return db[_0xf0e9('0x4c')][_0xf0e9('0x46')]({'body':_0xd14889['body'][_0xf0e9('0x2a')],'MailAccountId':_0xd14889['account']['id'],'MailInteractionId':_0x11a77a['id'],'direction':'in','ContactId':_0x27b3e4['contact']['id'],'messageId':_0xd14889['body'][_0xf0e9('0x14')][_0xf0e9('0x48')],'from':_0xd14889[_0xf0e9('0x2a')]['message'][_0xf0e9('0x30')],'to':_0xd14889['body'][_0xf0e9('0x14')]['to'],'cc':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')]['cc'],'subject':_0xd14889['body'][_0xf0e9('0x14')][_0xf0e9('0x4a')],'attach':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')][_0xf0e9('0x52')],'Attachments':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')][_0xf0e9('0x56')],'originTo':_0xd14889['body'][_0xf0e9('0x14')]['originTo'],'originCc':_0xd14889[_0xf0e9('0x2a')][_0xf0e9('0x14')]['originCc'],'bcc':_0xd14889['body'][_0xf0e9('0x14')][_0xf0e9('0x57')]},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0xf0e9('0xc')](function(_0x120d1f){_0x27b3e4[_0xf0e9('0x14')]=_0x120d1f;if(_0x27b3e4[_0xf0e9('0x54')][_0xf0e9('0x58')]){return db[_0xf0e9('0x59')][_0xf0e9('0x23')]({'attributes':['id',_0xf0e9('0x5a')],'where':{'id':_0x27b3e4[_0xf0e9('0x54')][_0xf0e9('0x58')]}})[_0xf0e9('0xc')](function(_0x1e3b87){if(_0x1e3b87){_0x27b3e4['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf0e9('0x5b'),'appdata':_0x1e3b87[_0xf0e9('0x5a')]+','+(_0x27b3e4['account'][_0xf0e9('0x5c')]||0xa),'interval':_0xf0e9('0x45')});}return respondWithRpcPromise(_0xf0e9('0x5d'),'startRouting',_0x27b3e4);});}return respondWithRpcPromise('Start','startRouting',_0x27b3e4);})['then'](function(_0x1b54e5){_0x27173f(_0x1b54e5);})[_0xf0e9('0x20')](function(_0x177ac0){_0x4d80bd(_0x59e0e1[_0xf0e9('0x12')](0x1f4,_0x177ac0[_0xf0e9('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js
index 7d32d14..3e0494a 100644
--- a/server/api/mailAccount/mailAccount.socket.js
+++ b/server/api/mailAccount/mailAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x96f1=['emit','removeListener','register','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x40ce76,_0x3a1c50){var _0x3fa6ec=function(_0x31cad0){while(--_0x31cad0){_0x40ce76['push'](_0x40ce76['shift']());}};_0x3fa6ec(++_0x3a1c50);}(_0x96f1,0x19c));var _0x196f=function(_0x419f9a,_0x35ae89){_0x419f9a=_0x419f9a-0x0;var _0x25ba8f=_0x96f1[_0x419f9a];return _0x25ba8f;};'use strict';var MailAccountEvents=require(_0x196f('0x0'));var events=[_0x196f('0x1'),_0x196f('0x2'),_0x196f('0x3')];function createListener(_0x227254,_0x219e87){return function(_0xe61e26){_0x219e87[_0x196f('0x4')](_0x227254,_0xe61e26);};}function removeListener(_0x5b8eb5,_0x56fc61){return function(){MailAccountEvents[_0x196f('0x5')](_0x5b8eb5,_0x56fc61);};}exports[_0x196f('0x6')]=function(_0x267906){for(var _0x1f401c=0x0,_0x17f603=events['length'];_0x1f401c<_0x17f603;_0x1f401c++){var _0x427333=events[_0x1f401c];var _0x425e5c=createListener(_0x196f('0x7')+_0x427333,_0x267906);MailAccountEvents['on'](_0x427333,_0x425e5c);}};
\ No newline at end of file
+var _0x46ed=['./mailAccount.events','save','update','emit','removeListener','register','length','mailAccount:'];(function(_0x413cef,_0x4715e1){var _0x1deb1a=function(_0x2d383d){while(--_0x2d383d){_0x413cef['push'](_0x413cef['shift']());}};_0x1deb1a(++_0x4715e1);}(_0x46ed,0x168));var _0xd46e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x46ed[_0x57b54c];return _0x59cc19;};'use strict';var MailAccountEvents=require(_0xd46e('0x0'));var events=[_0xd46e('0x1'),'remove',_0xd46e('0x2')];function createListener(_0x1df30e,_0x1f15e7){return function(_0x537ad5){_0x1f15e7[_0xd46e('0x3')](_0x1df30e,_0x537ad5);};}function removeListener(_0x4518b8,_0x54ef98){return function(){MailAccountEvents[_0xd46e('0x4')](_0x4518b8,_0x54ef98);};}exports[_0xd46e('0x5')]=function(_0x160bcf){for(var _0x25cf78=0x0,_0x45e680=events[_0xd46e('0x6')];_0x25cf78<_0x45e680;_0x25cf78++){var _0x437ea0=events[_0x25cf78];var _0x144687=createListener(_0xd46e('0x7')+_0x437ea0,_0x160bcf);MailAccountEvents['on'](_0x437ea0,_0x144687);}};
\ No newline at end of file
diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js
index da2af4a..c7b805f 100644
--- a/server/api/mailApplication/index.js
+++ b/server/api/mailApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb49a=['express','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xb49a,0xfb));var _0xab49=function(_0x294a77,_0x8a359d){_0x294a77=_0x294a77-0x0;var _0x17db6d=_0xb49a[_0x294a77];return _0x17db6d;};'use strict';var multer=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var path=require(_0xab49('0x2'));var timeout=require(_0xab49('0x3'));var express=require(_0xab49('0x4'));var router=express['Router']();var auth=require(_0xab49('0x5'));var interaction=require(_0xab49('0x6'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0xab49('0x7')](_0xab49('0x8'),auth[_0xab49('0x9')](),controller[_0xab49('0xa')]);router[_0xab49('0xb')](_0xab49('0x8'),auth[_0xab49('0x9')](),controller['update']);router[_0xab49('0xc')](_0xab49('0x8'),auth[_0xab49('0x9')](),controller[_0xab49('0xd')]);module[_0xab49('0xe')]=router;
\ No newline at end of file
+var _0x44a3=['../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1bab7d,_0x422688){var _0x42e972=function(_0x28bcfa){while(--_0x28bcfa){_0x1bab7d['push'](_0x1bab7d['shift']());}};_0x42e972(++_0x422688);}(_0x44a3,0x1a9));var _0x344a=function(_0x515f78,_0x3b69be){_0x515f78=_0x515f78-0x0;var _0x506f6c=_0x44a3[_0x515f78];return _0x506f6c;};'use strict';var multer=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var path=require(_0x344a('0x2'));var timeout=require(_0x344a('0x3'));var express=require(_0x344a('0x4'));var router=express[_0x344a('0x5')]();var auth=require(_0x344a('0x6'));var interaction=require(_0x344a('0x7'));var config=require('../../config/environment');var controller=require(_0x344a('0x8'));router[_0x344a('0x9')](_0x344a('0xa'),auth[_0x344a('0xb')](),controller[_0x344a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x344a('0xd')](_0x344a('0xa'),auth[_0x344a('0xb')](),controller[_0x344a('0xe')]);module[_0x344a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js
index 70f2d19..d5d540f 100644
--- a/server/api/mailApplication/mailApplication.attributes.js
+++ b/server/api/mailApplication/mailApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcafc=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xcafc,0x69));var _0xccaf=function(_0x7d5f94,_0x5ea962){_0x7d5f94=_0x7d5f94-0x0;var _0x444a11=_0xcafc[_0x7d5f94];return _0x444a11;};'use strict';var Sequelize=require(_0xccaf('0x0'));module[_0xccaf('0x1')]={'priority':{'type':Sequelize[_0xccaf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xccaf('0x3')],'allowNull':![],'defaultValue':_0xccaf('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xccaf('0x3')],'defaultValue':_0xccaf('0x5')}};
\ No newline at end of file
+var _0x74f3=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x5ecade,_0x1354cc){var _0x29f7f8=function(_0x510d14){while(--_0x510d14){_0x5ecade['push'](_0x5ecade['shift']());}};_0x29f7f8(++_0x1354cc);}(_0x74f3,0xc1));var _0x374f=function(_0x19b419,_0x3d1f9b){_0x19b419=_0x19b419-0x0;var _0x3ed3ad=_0x74f3[_0x19b419];return _0x3ed3ad;};'use strict';var Sequelize=require('sequelize');module[_0x374f('0x0')]={'priority':{'type':Sequelize[_0x374f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x374f('0x2')],'allowNull':![],'defaultValue':_0x374f('0x3')},'appdata':{'type':Sequelize[_0x374f('0x4')]()},'description':{'type':Sequelize[_0x374f('0x2')]},'interval':{'type':Sequelize[_0x374f('0x2')],'defaultValue':_0x374f('0x5')}};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js
index 186429e..fa5cead 100644
--- a/server/api/mailApplication/mailApplication.controller.js
+++ b/server/api/mailApplication/mailApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f6b=['save','then','destroy','stack','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','fields','attributes','includeAll','merge','options','find','catch','body','params','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply'];(function(_0x4c3ece,_0x57053e){var _0x409c1d=function(_0x411a3b){while(--_0x411a3b){_0x4c3ece['push'](_0x4c3ece['shift']());}};_0x409c1d(++_0x57053e);}(_0x5f6b,0x81));var _0xb5f6=function(_0x1cbcf2,_0xffa353){_0x1cbcf2=_0x1cbcf2-0x0;var _0x2ce899=_0x5f6b[_0x1cbcf2];return _0x2ce899;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb5f6('0x0'));var zipdir=require(_0xb5f6('0x1'));var jsonpatch=require(_0xb5f6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb5f6('0x3'));var Mustache=require(_0xb5f6('0x4'));var util=require('util');var path=require(_0xb5f6('0x5'));var sox=require(_0xb5f6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb5f6('0x7'));var squel=require(_0xb5f6('0x8'));var crypto=require(_0xb5f6('0x9'));var jsforce=require(_0xb5f6('0xa'));var deskjs=require(_0xb5f6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb5f6('0xc'));var Papa=require(_0xb5f6('0xd'));var Redis=require(_0xb5f6('0xe'));var authService=require(_0xb5f6('0xf'));var qs=require(_0xb5f6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5f6('0x11'));var logger=require(_0xb5f6('0x12'))(_0xb5f6('0x13'));var utils=require('../../config/utils');var config=require(_0xb5f6('0x14'));var db=require(_0xb5f6('0x15'))['db'];function respondWithStatusCode(_0xb21200,_0x332096){_0x332096=_0x332096||0xcc;return function(_0x19d1e7){if(_0x19d1e7){return _0xb21200[_0xb5f6('0x16')](_0x332096);}return _0xb21200[_0xb5f6('0x17')](_0x332096)[_0xb5f6('0x18')]();};}function respondWithResult(_0xc71b82,_0x547f2d){_0x547f2d=_0x547f2d||0xc8;return function(_0x210b2f){if(_0x210b2f){return _0xc71b82[_0xb5f6('0x17')](_0x547f2d)['json'](_0x210b2f);}};}function respondWithFilteredResult(_0x10cc67,_0x4521d9){return function(_0x520946){if(_0x520946){var _0x5d5823=_0x520946[_0xb5f6('0x19')],_0xfc9507=_0x4521d9[_0xb5f6('0x1a')],_0x1eb805=_0x4521d9[_0xb5f6('0x1a')]+_0x4521d9['limit'],_0x113aaf;if(_0x1eb805>=_0x5d5823){_0x1eb805=_0x5d5823;_0x113aaf=0xc8;}else{_0x113aaf=0xce;}_0x10cc67[_0xb5f6('0x17')](_0x113aaf);return _0x10cc67[_0xb5f6('0x1b')](_0xb5f6('0x1c'),_0xfc9507+'-'+_0x1eb805+'/'+_0x5d5823)['json'](_0x520946);}return null;};}function patchUpdates(_0x5a8592){return function(_0x4c410d){try{jsonpatch[_0xb5f6('0x1d')](_0x4c410d,_0x5a8592,!![]);}catch(_0x2748c6){return BPromise['reject'](_0x2748c6);}return _0x4c410d[_0xb5f6('0x1e')]();};}function saveUpdates(_0x5b9d20,_0x3e123b){return function(_0x53fc9f){if(_0x53fc9f){return _0x53fc9f['update'](_0x5b9d20)[_0xb5f6('0x1f')](function(_0x5a8930){return _0x5a8930;});}return null;};}function removeEntity(_0x403159,_0x1dd202){return function(_0xdf5f19){if(_0xdf5f19){return _0xdf5f19[_0xb5f6('0x20')]()[_0xb5f6('0x1f')](function(){_0x403159['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e84d1,_0x2cf0e6){return function(_0x49c5d0){if(!_0x49c5d0){_0x1e84d1['sendStatus'](0x194);}return _0x49c5d0;};}function handleError(_0x4bfd97,_0x10f9fc){_0x10f9fc=_0x10f9fc||0x1f4;return function(_0x826969){logger['error'](_0x826969[_0xb5f6('0x21')]);if(_0x826969[_0xb5f6('0x22')]){delete _0x826969[_0xb5f6('0x22')];}_0x4bfd97[_0xb5f6('0x17')](_0x10f9fc)[_0xb5f6('0x23')](_0x826969);};}exports[_0xb5f6('0x24')]=function(_0xda8a9e,_0x37a327){var _0x1388d8={'raw':!![],'where':{'id':_0xda8a9e['params']['id']}},_0x56f42c={};_0x56f42c[_0xb5f6('0x25')]=_[_0xb5f6('0x26')](db[_0xb5f6('0x27')][_0xb5f6('0x28')]);_0x56f42c[_0xb5f6('0x29')]=_[_0xb5f6('0x26')](_0xda8a9e[_0xb5f6('0x29')]);_0x56f42c[_0xb5f6('0x2a')]=_[_0xb5f6('0x2b')](_0x56f42c[_0xb5f6('0x25')],_0x56f42c[_0xb5f6('0x29')]);_0x1388d8['attributes']=_[_0xb5f6('0x2b')](_0x56f42c[_0xb5f6('0x25')],qs[_0xb5f6('0x2c')](_0xda8a9e[_0xb5f6('0x29')]['fields']));_0x1388d8['attributes']=_0x1388d8[_0xb5f6('0x2d')]['length']?_0x1388d8[_0xb5f6('0x2d')]:_0x56f42c['model'];if(_0xda8a9e[_0xb5f6('0x29')][_0xb5f6('0x2e')]){_0x1388d8['include']=[{'all':!![]}];}_0x1388d8=_[_0xb5f6('0x2f')]({},_0x1388d8,_0xda8a9e[_0xb5f6('0x30')]);return db[_0xb5f6('0x27')][_0xb5f6('0x31')](_0x1388d8)[_0xb5f6('0x1f')](handleEntityNotFound(_0x37a327,null))['then'](respondWithResult(_0x37a327,null))[_0xb5f6('0x32')](handleError(_0x37a327,null));};exports['update']=function(_0x3ee3b1,_0xf9f5f3){if(_0x3ee3b1[_0xb5f6('0x33')]['id']){delete _0x3ee3b1[_0xb5f6('0x33')]['id'];}return db[_0xb5f6('0x27')][_0xb5f6('0x31')]({'where':{'id':_0x3ee3b1[_0xb5f6('0x34')]['id']}})[_0xb5f6('0x1f')](handleEntityNotFound(_0xf9f5f3,null))['then'](saveUpdates(_0x3ee3b1[_0xb5f6('0x33')],null))[_0xb5f6('0x1f')](respondWithResult(_0xf9f5f3,null))[_0xb5f6('0x32')](handleError(_0xf9f5f3,null));};exports[_0xb5f6('0x20')]=function(_0x6b65b1,_0x129752){return db[_0xb5f6('0x27')][_0xb5f6('0x31')]({'where':{'id':_0x6b65b1['params']['id']}})['then'](handleEntityNotFound(_0x129752,null))['then'](removeEntity(_0x129752,null))[_0xb5f6('0x32')](handleError(_0x129752,null));};
\ No newline at end of file
+var _0x786f=['sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','update','then','stack','name','show','params','model','MailApplication','rawAttributes','keys','query','filters','attributes','intersection','fields','include','merge','options','body','find','destroy','catch','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x530deb,_0x15584c){var _0x4f8c66=function(_0x13ed11){while(--_0x13ed11){_0x530deb['push'](_0x530deb['shift']());}};_0x4f8c66(++_0x15584c);}(_0x786f,0xc8));var _0xf786=function(_0x591db7,_0x150445){_0x591db7=_0x591db7-0x0;var _0x4ad760=_0x786f[_0x591db7];return _0x4ad760;};'use strict';var pdf=require(_0xf786('0x0'));var emlformat=require(_0xf786('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf786('0x2'));var jsonpatch=require(_0xf786('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf786('0x4'));var Mustache=require(_0xf786('0x5'));var util=require(_0xf786('0x6'));var path=require('path');var sox=require(_0xf786('0x7'));var csv=require('to-csv');var ejs=require(_0xf786('0x8'));var fs=require('fs');var _=require(_0xf786('0x9'));var squel=require(_0xf786('0xa'));var crypto=require(_0xf786('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf786('0xc'));var querystring=require(_0xf786('0xd'));var Papa=require(_0xf786('0xe'));var Redis=require(_0xf786('0xf'));var authService=require(_0xf786('0x10'));var qs=require(_0xf786('0x11'));var as=require(_0xf786('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf786('0x13'))(_0xf786('0x14'));var utils=require(_0xf786('0x15'));var config=require(_0xf786('0x16'));var db=require(_0xf786('0x17'))['db'];function respondWithStatusCode(_0x32c116,_0x5ffc2f){_0x5ffc2f=_0x5ffc2f||0xcc;return function(_0x30c37b){if(_0x30c37b){return _0x32c116[_0xf786('0x18')](_0x5ffc2f);}return _0x32c116['status'](_0x5ffc2f)[_0xf786('0x19')]();};}function respondWithResult(_0x452eec,_0x37228a){_0x37228a=_0x37228a||0xc8;return function(_0x279d0d){if(_0x279d0d){return _0x452eec[_0xf786('0x1a')](_0x37228a)[_0xf786('0x1b')](_0x279d0d);}};}function respondWithFilteredResult(_0x1a2a15,_0x3d1b02){return function(_0x5ee283){if(_0x5ee283){var _0x5c1a86=_0x5ee283[_0xf786('0x1c')],_0x76cddc=_0x3d1b02[_0xf786('0x1d')],_0x494aeb=_0x3d1b02[_0xf786('0x1d')]+_0x3d1b02[_0xf786('0x1e')],_0x62312b;if(_0x494aeb>=_0x5c1a86){_0x494aeb=_0x5c1a86;_0x62312b=0xc8;}else{_0x62312b=0xce;}_0x1a2a15[_0xf786('0x1a')](_0x62312b);return _0x1a2a15['set'](_0xf786('0x1f'),_0x76cddc+'-'+_0x494aeb+'/'+_0x5c1a86)[_0xf786('0x1b')](_0x5ee283);}return null;};}function patchUpdates(_0x276d12){return function(_0x3da13e){try{jsonpatch[_0xf786('0x20')](_0x3da13e,_0x276d12,!![]);}catch(_0x40e243){return BPromise[_0xf786('0x21')](_0x40e243);}return _0x3da13e['save']();};}function saveUpdates(_0x36fb44,_0x1be16a){return function(_0x1a1db3){if(_0x1a1db3){return _0x1a1db3[_0xf786('0x22')](_0x36fb44)[_0xf786('0x23')](function(_0x1b5f3a){return _0x1b5f3a;});}return null;};}function removeEntity(_0x579267,_0x369b3d){return function(_0x684c0f){if(_0x684c0f){return _0x684c0f['destroy']()[_0xf786('0x23')](function(){_0x579267[_0xf786('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49d875,_0x4efa55){return function(_0x268672){if(!_0x268672){_0x49d875['sendStatus'](0x194);}return _0x268672;};}function handleError(_0x4c955c,_0x5e5546){_0x5e5546=_0x5e5546||0x1f4;return function(_0x5a8d6a){logger['error'](_0x5a8d6a[_0xf786('0x24')]);if(_0x5a8d6a[_0xf786('0x25')]){delete _0x5a8d6a[_0xf786('0x25')];}_0x4c955c[_0xf786('0x1a')](_0x5e5546)['send'](_0x5a8d6a);};}exports[_0xf786('0x26')]=function(_0x4da66c,_0x3d32fb){var _0x5b33a9={'raw':!![],'where':{'id':_0x4da66c[_0xf786('0x27')]['id']}},_0x311b05={};_0x311b05[_0xf786('0x28')]=_['keys'](db[_0xf786('0x29')][_0xf786('0x2a')]);_0x311b05['query']=_[_0xf786('0x2b')](_0x4da66c[_0xf786('0x2c')]);_0x311b05[_0xf786('0x2d')]=_['intersection'](_0x311b05['model'],_0x311b05[_0xf786('0x2c')]);_0x5b33a9[_0xf786('0x2e')]=_[_0xf786('0x2f')](_0x311b05[_0xf786('0x28')],qs['fields'](_0x4da66c['query'][_0xf786('0x30')]));_0x5b33a9[_0xf786('0x2e')]=_0x5b33a9[_0xf786('0x2e')]['length']?_0x5b33a9['attributes']:_0x311b05[_0xf786('0x28')];if(_0x4da66c[_0xf786('0x2c')]['includeAll']){_0x5b33a9[_0xf786('0x31')]=[{'all':!![]}];}_0x5b33a9=_[_0xf786('0x32')]({},_0x5b33a9,_0x4da66c[_0xf786('0x33')]);return db[_0xf786('0x29')]['find'](_0x5b33a9)[_0xf786('0x23')](handleEntityNotFound(_0x3d32fb,null))[_0xf786('0x23')](respondWithResult(_0x3d32fb,null))['catch'](handleError(_0x3d32fb,null));};exports[_0xf786('0x22')]=function(_0x3bd519,_0xe1659){if(_0x3bd519[_0xf786('0x34')]['id']){delete _0x3bd519[_0xf786('0x34')]['id'];}return db[_0xf786('0x29')][_0xf786('0x35')]({'where':{'id':_0x3bd519[_0xf786('0x27')]['id']}})[_0xf786('0x23')](handleEntityNotFound(_0xe1659,null))[_0xf786('0x23')](saveUpdates(_0x3bd519['body'],null))['then'](respondWithResult(_0xe1659,null))['catch'](handleError(_0xe1659,null));};exports[_0xf786('0x36')]=function(_0x35d9a9,_0x5184e6){return db['MailApplication']['find']({'where':{'id':_0x35d9a9[_0xf786('0x27')]['id']}})['then'](handleEntityNotFound(_0x5184e6,null))[_0xf786('0x23')](removeEntity(_0x5184e6,null))[_0xf786('0x37')](handleError(_0x5184e6,null));};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js
index c712b35..82faebc 100644
--- a/server/api/mailApplication/mailApplication.model.js
+++ b/server/api/mailApplication/mailApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a14=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x5840fb,_0x384987){var _0x90a609=function(_0x26eb7c){while(--_0x26eb7c){_0x5840fb['push'](_0x5840fb['shift']());}};_0x90a609(++_0x384987);}(_0x5a14,0x19e));var _0x45a1=function(_0x3c31e0,_0xe68ef4){_0x3c31e0=_0x3c31e0-0x0;var _0x55366e=_0x5a14[_0x3c31e0];return _0x55366e;};'use strict';var _=require(_0x45a1('0x0'));var util=require(_0x45a1('0x1'));var logger=require(_0x45a1('0x2'))(_0x45a1('0x3'));var moment=require(_0x45a1('0x4'));var BPromise=require(_0x45a1('0x5'));var rp=require(_0x45a1('0x6'));var fs=require('fs');var path=require(_0x45a1('0x7'));var rimraf=require(_0x45a1('0x8'));var config=require(_0x45a1('0x9'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x5d003e,_0x3f2f65){return _0x5d003e['define'](_0x45a1('0xa'),attributes,{'tableName':_0x45a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x45a1('0xc')});};
\ No newline at end of file
+var _0xa36b=['bluebird','request-promise','path','rimraf','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x3dc758,_0x570406){var _0x4f3116=function(_0x4a8f17){while(--_0x4a8f17){_0x3dc758['push'](_0x3dc758['shift']());}};_0x4f3116(++_0x570406);}(_0xa36b,0x72));var _0xba36=function(_0x4b98e9,_0x3b6e3c){_0x4b98e9=_0x4b98e9-0x0;var _0x319291=_0xa36b[_0x4b98e9];return _0x319291;};'use strict';var _=require(_0xba36('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba36('0x1'));var moment=require(_0xba36('0x2'));var BPromise=require(_0xba36('0x3'));var rp=require(_0xba36('0x4'));var fs=require('fs');var path=require(_0xba36('0x5'));var rimraf=require(_0xba36('0x6'));var config=require('../../config/environment');var attributes=require(_0xba36('0x7'));module['exports']=function(_0xafe4a2,_0x2a8e83){return _0xafe4a2[_0xba36('0x8')](_0xba36('0x9'),attributes,{'tableName':_0xba36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba36('0xb'),'collate':_0xba36('0xc')});};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js
index c8f2974..bfbccf6 100644
--- a/server/api/mailApplication/mailApplication.rpc.js
+++ b/server/api/mailApplication/mailApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e2b=['options','raw','where','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','update','body'];(function(_0x403d5b,_0x16af13){var _0x193deb=function(_0x490d0b){while(--_0x490d0b){_0x403d5b['push'](_0x403d5b['shift']());}};_0x193deb(++_0x16af13);}(_0x3e2b,0x1c5));var _0xb3e2=function(_0x56922c,_0x22f4a3){_0x56922c=_0x56922c-0x0;var _0x3beedd=_0x3e2b[_0x56922c];return _0x3beedd;};'use strict';var _=require(_0xb3e2('0x0'));var util=require(_0xb3e2('0x1'));var moment=require(_0xb3e2('0x2'));var BPromise=require(_0xb3e2('0x3'));var rs=require(_0xb3e2('0x4'));var fs=require('fs');var Redis=require(_0xb3e2('0x5'));var db=require(_0xb3e2('0x6'))['db'];var utils=require(_0xb3e2('0x7'));var logger=require(_0xb3e2('0x8'))(_0xb3e2('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb3e2('0xa')][_0xb3e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41995b,_0x43a10c,_0x51f593){return new BPromise(function(_0x53e1fb,_0x166638){return client[_0xb3e2('0xc')](_0x41995b,_0x51f593)[_0xb3e2('0xd')](function(_0x4a8bdb){logger[_0xb3e2('0xe')](_0xb3e2('0xf'),_0x43a10c,'request\x20sent');logger['debug'](_0xb3e2('0x10'),_0x43a10c,_0xb3e2('0x11'),JSON[_0xb3e2('0x12')](_0x4a8bdb));if(_0x4a8bdb[_0xb3e2('0x13')]){if(_0x4a8bdb[_0xb3e2('0x13')][_0xb3e2('0x14')]===0x1f4){logger['error'](_0xb3e2('0xf'),_0x43a10c,_0x4a8bdb['error'][_0xb3e2('0x15')]);return _0x166638(_0x4a8bdb[_0xb3e2('0x13')][_0xb3e2('0x15')]);}logger['error'](_0xb3e2('0xf'),_0x43a10c,_0x4a8bdb[_0xb3e2('0x13')][_0xb3e2('0x15')]);return _0x53e1fb(_0x4a8bdb['error'][_0xb3e2('0x15')]);}else{logger[_0xb3e2('0xe')](_0xb3e2('0xf'),_0x43a10c,'request\x20sent');_0x53e1fb(_0x4a8bdb[_0xb3e2('0x16')]['message']);}})[_0xb3e2('0x17')](function(_0x351d2b){logger[_0xb3e2('0x13')]('MailApplication,\x20%s,\x20%s',_0x43a10c,_0x351d2b);_0x166638(_0x351d2b);});});}exports[_0xb3e2('0x18')]=function(_0x35d37f){var _0x437115=this;return new Promise(function(_0x2b6425,_0x139bc5){return db['MailApplication'][_0xb3e2('0x19')](_0x35d37f[_0xb3e2('0x1a')],{'raw':_0x35d37f[_0xb3e2('0x1b')]?_0x35d37f[_0xb3e2('0x1b')][_0xb3e2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35d37f['options']?_0x35d37f[_0xb3e2('0x1b')][_0xb3e2('0x1d')]||null:null,'attributes':_0x35d37f[_0xb3e2('0x1b')]?_0x35d37f['options']['attributes']||null:null,'limit':_0x35d37f[_0xb3e2('0x1b')]?_0x35d37f[_0xb3e2('0x1b')][_0xb3e2('0x1e')]||null:null})['then'](function(_0x1e935f){logger['info'](_0xb3e2('0x18'),_0x35d37f);logger[_0xb3e2('0x1f')](_0xb3e2('0x18'),_0x35d37f,JSON[_0xb3e2('0x12')](_0x1e935f));_0x2b6425(_0x1e935f);})[_0xb3e2('0x17')](function(_0x487d49){logger[_0xb3e2('0x13')](_0xb3e2('0x18'),_0x487d49[_0xb3e2('0x15')],_0x35d37f);_0x139bc5(_0x437115[_0xb3e2('0x13')](0x1f4,_0x487d49[_0xb3e2('0x15')]));});});};
\ No newline at end of file
+var _0x7fea=['stringify','error','code','message','catch','MailApplication','update','body','raw','options','where','limit','UpdateMailApplication','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s'];(function(_0x14047c,_0x42fda9){var _0x486ed5=function(_0x853982){while(--_0x853982){_0x14047c['push'](_0x14047c['shift']());}};_0x486ed5(++_0x42fda9);}(_0x7fea,0x1a2));var _0xa7fe=function(_0x23bd39,_0x328f3f){_0x23bd39=_0x23bd39-0x0;var _0x5ce240=_0x7fea[_0x23bd39];return _0x5ce240;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa7fe('0x0'));var rs=require(_0xa7fe('0x1'));var fs=require('fs');var Redis=require(_0xa7fe('0x2'));var db=require(_0xa7fe('0x3'))['db'];var utils=require(_0xa7fe('0x4'));var logger=require(_0xa7fe('0x5'))(_0xa7fe('0x6'));var config=require('../../config/environment');var jayson=require(_0xa7fe('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x494fb3,_0x50bd59,_0x31ca65){return new BPromise(function(_0x538c04,_0x3beb3e){return client[_0xa7fe('0x8')](_0x494fb3,_0x31ca65)['then'](function(_0xebfde4){logger[_0xa7fe('0x9')](_0xa7fe('0xa'),_0x50bd59,_0xa7fe('0xb'));logger[_0xa7fe('0xc')](_0xa7fe('0xd'),_0x50bd59,_0xa7fe('0xb'),JSON[_0xa7fe('0xe')](_0xebfde4));if(_0xebfde4[_0xa7fe('0xf')]){if(_0xebfde4['error'][_0xa7fe('0x10')]===0x1f4){logger[_0xa7fe('0xf')](_0xa7fe('0xa'),_0x50bd59,_0xebfde4[_0xa7fe('0xf')][_0xa7fe('0x11')]);return _0x3beb3e(_0xebfde4[_0xa7fe('0xf')][_0xa7fe('0x11')]);}logger[_0xa7fe('0xf')](_0xa7fe('0xa'),_0x50bd59,_0xebfde4[_0xa7fe('0xf')]['message']);return _0x538c04(_0xebfde4[_0xa7fe('0xf')][_0xa7fe('0x11')]);}else{logger[_0xa7fe('0x9')](_0xa7fe('0xa'),_0x50bd59,'request\x20sent');_0x538c04(_0xebfde4['result'][_0xa7fe('0x11')]);}})[_0xa7fe('0x12')](function(_0x4a7af7){logger[_0xa7fe('0xf')](_0xa7fe('0xa'),_0x50bd59,_0x4a7af7);_0x3beb3e(_0x4a7af7);});});}exports['UpdateMailApplication']=function(_0x92d47b){var _0x4f88b7=this;return new Promise(function(_0x3eefc1,_0x3aceb1){return db[_0xa7fe('0x13')][_0xa7fe('0x14')](_0x92d47b[_0xa7fe('0x15')],{'raw':_0x92d47b['options']?_0x92d47b['options'][_0xa7fe('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x92d47b[_0xa7fe('0x17')]?_0x92d47b['options'][_0xa7fe('0x18')]||null:null,'attributes':_0x92d47b[_0xa7fe('0x17')]?_0x92d47b['options']['attributes']||null:null,'limit':_0x92d47b[_0xa7fe('0x17')]?_0x92d47b['options'][_0xa7fe('0x19')]||null:null})['then'](function(_0x1ef44f){logger[_0xa7fe('0x9')]('UpdateMailApplication',_0x92d47b);logger[_0xa7fe('0xc')](_0xa7fe('0x1a'),_0x92d47b,JSON[_0xa7fe('0xe')](_0x1ef44f));_0x3eefc1(_0x1ef44f);})[_0xa7fe('0x12')](function(_0x287997){logger['error']('UpdateMailApplication',_0x287997[_0xa7fe('0x11')],_0x92d47b);_0x3aceb1(_0x4f88b7[_0xa7fe('0xf')](0x1f4,_0x287997[_0xa7fe('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js
index e5c5092..25e6438 100644
--- a/server/api/mailInteraction/index.js
+++ b/server/api/mailInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf228=['mailinteraction:update','delete','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','mail','mailinteraction:addtags','put','/:id','tracked'];(function(_0xedbfd,_0x3df491){var _0x3b0cff=function(_0x9f2e04){while(--_0x9f2e04){_0xedbfd['push'](_0xedbfd['shift']());}};_0x3b0cff(++_0x3df491);}(_0xf228,0x1a9));var _0x8f22=function(_0x17a510,_0x432726){_0x17a510=_0x17a510-0x0;var _0x36a919=_0xf228[_0x17a510];return _0x36a919;};'use strict';var multer=require(_0x8f22('0x0'));var util=require(_0x8f22('0x1'));var path=require('path');var timeout=require(_0x8f22('0x2'));var express=require(_0x8f22('0x3'));var router=express[_0x8f22('0x4')]();var auth=require(_0x8f22('0x5'));var interaction=require(_0x8f22('0x6'));var config=require(_0x8f22('0x7'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x8f22('0x8')](),controller['index']);router[_0x8f22('0x9')](_0x8f22('0xa'),auth['isAuthenticated'](),controller[_0x8f22('0xb')]);router[_0x8f22('0x9')]('/:id',auth[_0x8f22('0x8')](),controller[_0x8f22('0xc')]);router[_0x8f22('0x9')](_0x8f22('0xd'),auth[_0x8f22('0x8')](),controller[_0x8f22('0xe')]);router[_0x8f22('0x9')](_0x8f22('0xf'),auth['isAuthenticated'](),controller[_0x8f22('0x10')]);router[_0x8f22('0x11')]('/',auth[_0x8f22('0x8')](),controller['create']);router[_0x8f22('0x11')]('/:id/messages',auth[_0x8f22('0x8')](),controller[_0x8f22('0x12')]);router[_0x8f22('0x11')](_0x8f22('0x13'),auth[_0x8f22('0x8')](),interaction['tracked'](_0x8f22('0x14'),_0x8f22('0x15')),controller['addTags']);router[_0x8f22('0x16')](_0x8f22('0x17'),auth['isAuthenticated'](),interaction[_0x8f22('0x18')](_0x8f22('0x14'),_0x8f22('0x19')),controller['update']);router[_0x8f22('0x1a')](_0x8f22('0x17'),auth[_0x8f22('0x8')](),interaction[_0x8f22('0x18')]('mail','mailinteraction:destroy'),controller[_0x8f22('0x1b')]);router['delete'](_0x8f22('0x13'),auth['isAuthenticated'](),controller[_0x8f22('0x1c')]);module[_0x8f22('0x1d')]=router;
\ No newline at end of file
+var _0x4f5d=['index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','mail','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated'];(function(_0x27a94e,_0x40cac9){var _0x5be053=function(_0x5a8dfd){while(--_0x5a8dfd){_0x27a94e['push'](_0x27a94e['shift']());}};_0x5be053(++_0x40cac9);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4f5d[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var path=require(_0xd4f5('0x2'));var timeout=require(_0xd4f5('0x3'));var express=require(_0xd4f5('0x4'));var router=express[_0xd4f5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd4f5('0x6'));var config=require(_0xd4f5('0x7'));var controller=require(_0xd4f5('0x8'));router[_0xd4f5('0x9')]('/',auth[_0xd4f5('0xa')](),controller[_0xd4f5('0xb')]);router[_0xd4f5('0x9')](_0xd4f5('0xc'),auth[_0xd4f5('0xa')](),controller[_0xd4f5('0xd')]);router[_0xd4f5('0x9')](_0xd4f5('0xe'),auth[_0xd4f5('0xa')](),controller['show']);router[_0xd4f5('0x9')](_0xd4f5('0xf'),auth['isAuthenticated'](),controller[_0xd4f5('0x10')]);router[_0xd4f5('0x9')](_0xd4f5('0x11'),auth[_0xd4f5('0xa')](),controller[_0xd4f5('0x12')]);router[_0xd4f5('0x13')]('/',auth[_0xd4f5('0xa')](),controller[_0xd4f5('0x14')]);router[_0xd4f5('0x13')]('/:id/messages',auth[_0xd4f5('0xa')](),controller[_0xd4f5('0x15')]);router['post'](_0xd4f5('0x16'),auth[_0xd4f5('0xa')](),interaction[_0xd4f5('0x17')]('mail',_0xd4f5('0x18')),controller[_0xd4f5('0x19')]);router[_0xd4f5('0x1a')](_0xd4f5('0xe'),auth[_0xd4f5('0xa')](),interaction[_0xd4f5('0x17')](_0xd4f5('0x1b'),_0xd4f5('0x1c')),controller['update']);router[_0xd4f5('0x1d')]('/:id',auth[_0xd4f5('0xa')](),interaction['tracked'](_0xd4f5('0x1b'),_0xd4f5('0x1e')),controller[_0xd4f5('0x1f')]);router[_0xd4f5('0x1d')](_0xd4f5('0x16'),auth[_0xd4f5('0xa')](),controller[_0xd4f5('0x20')]);module[_0xd4f5('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js
index 797cdec..156aa39 100644
--- a/server/api/mailInteraction/mailInteraction.attributes.js
+++ b/server/api/mailInteraction/mailInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d80=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports'];(function(_0x22c4d1,_0x4e508e){var _0x103d87=function(_0x50de16){while(--_0x50de16){_0x22c4d1['push'](_0x22c4d1['shift']());}};_0x103d87(++_0x4e508e);}(_0x9d80,0x18d));var _0x09d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9d80[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x09d8('0x0'));var iconv=require(_0x09d8('0x1'));module[_0x09d8('0x2')]={'closed':{'type':Sequelize[_0x09d8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x09d8('0x4')]},'disposition':{'type':Sequelize[_0x09d8('0x5')]},'note':{'type':Sequelize[_0x09d8('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x09d8('0x6')](_0x09d8('0x7'))},'subject':{'type':Sequelize[_0x09d8('0x6')]()},'attach':{'type':Sequelize[_0x09d8('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x09d8('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x09d8('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x09d8('0x8')]('in',_0x09d8('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x09d8('0x6')](_0x09d8('0x7'))},'lastMsgText':{'type':Sequelize['TEXT'](_0x09d8('0x7'))}};
\ No newline at end of file
+var _0xf4d8=['out','ENUM','iconv','BOOLEAN','DATE','STRING','long','TEXT'];(function(_0x404953,_0x5ee16e){var _0x474afa=function(_0x282163){while(--_0x282163){_0x404953['push'](_0x404953['shift']());}};_0x474afa(++_0x5ee16e);}(_0xf4d8,0x15a));var _0x8f4d=function(_0x2d4eef,_0x48192f){_0x2d4eef=_0x2d4eef-0x0;var _0x4fa403=_0xf4d8[_0x2d4eef];return _0x4fa403;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x8f4d('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8f4d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8f4d('0x2')]},'disposition':{'type':Sequelize[_0x8f4d('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8f4d('0x3')](0x1fe)},'to':{'type':Sequelize[_0x8f4d('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x8f4d('0x4'))},'subject':{'type':Sequelize[_0x8f4d('0x5')]()},'attach':{'type':Sequelize[_0x8f4d('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8f4d('0x2')]},'substatus':{'type':Sequelize[_0x8f4d('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x8f4d('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8f4d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8f4d('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x8f4d('0x5')](_0x8f4d('0x4'))},'lastMsgText':{'type':Sequelize[_0x8f4d('0x5')](_0x8f4d('0x4'))}};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js
index 0679b24..cb412f7 100644
--- a/server/api/mailInteraction/mailInteraction.controller.js
+++ b/server/api/mailInteraction/mailInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x3b93fe,_0x45a258){var _0x20ae53=function(_0x3f06eb){while(--_0x3f06eb){_0x3b93fe['push'](_0x3b93fe['shift']());}};_0x20ae53(++_0x45a258);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));};
\ No newline at end of file
+var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x4dfa5c,_0x5d0cd7){var _0x343d95=function(_0x197d57){while(--_0x197d57){_0x4dfa5c['push'](_0x4dfa5c['shift']());}};_0x343d95(++_0x5d0cd7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js
index 2b9bbab..fc6a487 100644
--- a/server/api/mailInteraction/mailInteraction.events.js
+++ b/server/api/mailInteraction/mailInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd11f=['exports','events','../../mysqldb','MailMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x4f7fc6,_0x554d2f){var _0x235170=function(_0x489da4){while(--_0x489da4){_0x4f7fc6['push'](_0x4f7fc6['shift']());}};_0x235170(++_0x554d2f);}(_0xd11f,0xf8));var _0xfd11=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0xd11f[_0x29e3b6];return _0x55d4b0;};'use strict';var EventEmitter=require(_0xfd11('0x0'));var MailInteraction=require(_0xfd11('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xfd11('0x1'))['db'][_0xfd11('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xfd11('0x3')](0x0);var events={'afterCreate':_0xfd11('0x4'),'afterUpdate':'update','afterDestroy':_0xfd11('0x5')};function emitEvent(_0x4517c9){return function(_0x1b72c2,_0x1f36af,_0x476115){_0x1b72c2[_0xfd11('0x6')]({'attributes':['id'],'raw':!![]})[_0xfd11('0x7')](function(_0x1e0256){_0x1b72c2[_0xfd11('0x8')](_0xfd11('0x9'),_0x1e0256[_0xfd11('0xa')](function(_0x312966){return{'id':_0x312966['id']};}));return MailMessage[_0xfd11('0xb')]({'where':{'MailInteractionId':_0x1b72c2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfd11('0x7')](function(_0x369006){_0x1b72c2[_0xfd11('0x8')](_0xfd11('0xc'),_0x369006[_0xfd11('0xd')]);MailInteractionEvents[_0xfd11('0xe')](_0x4517c9+':'+_0x1b72c2['id'],_0x1b72c2);MailInteractionEvents[_0xfd11('0xe')](_0x4517c9,_0x1b72c2);_0x476115(null);})[_0xfd11('0xf')](_0x476115(null));};}for(var e in events){if(events[_0xfd11('0x10')](e)){var event=events[e];MailInteraction[_0xfd11('0x11')](e,emitEvent(event));}}module[_0xfd11('0x12')]=MailInteractionEvents;
\ No newline at end of file
+var _0x11d8=['unreadMessages','emit','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x3fe9d3,_0x810768){var _0x6c4564=function(_0x2098e3){while(--_0x2098e3){_0x3fe9d3['push'](_0x3fe9d3['shift']());}};_0x6c4564(++_0x810768);}(_0x11d8,0x1c4));var _0x811d=function(_0x4b6fbd,_0x1819b5){_0x4b6fbd=_0x4b6fbd-0x0;var _0x12b0ee=_0x11d8[_0x4b6fbd];return _0x12b0ee;};'use strict';var EventEmitter=require(_0x811d('0x0'));var MailInteraction=require(_0x811d('0x1'))['db'][_0x811d('0x2')];var MailMessage=require(_0x811d('0x1'))['db'][_0x811d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x811d('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x811d('0x5')};function emitEvent(_0x450f03){return function(_0x225df3,_0x2652a4,_0x1d9b7f){_0x225df3[_0x811d('0x6')]({'attributes':['id'],'raw':!![]})[_0x811d('0x7')](function(_0x10b3be){_0x225df3[_0x811d('0x8')](_0x811d('0x9'),_0x10b3be[_0x811d('0xa')](function(_0x4c1bc7){return{'id':_0x4c1bc7['id']};}));return MailMessage[_0x811d('0xb')]({'where':{'MailInteractionId':_0x225df3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x811d('0x7')](function(_0x1eff27){_0x225df3[_0x811d('0x8')](_0x811d('0xc'),_0x1eff27['length']);MailInteractionEvents[_0x811d('0xd')](_0x450f03+':'+_0x225df3['id'],_0x225df3);MailInteractionEvents['emit'](_0x450f03,_0x225df3);_0x1d9b7f(null);})['catch'](_0x1d9b7f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x811d('0xe')](e,emitEvent(event));}}module[_0x811d('0xf')]=MailInteractionEvents;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js
index 541fc17..551af99 100644
--- a/server/api/mailInteraction/mailInteraction.model.js
+++ b/server/api/mailInteraction/mailInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['MailInteraction','mail_interactions','subject','FULLTEXT','substatusAt','format','closed','closedAt','changed','substatus','YYYY-MM-DD\x20HH:mm:ss','get','update','then','catch','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','./mailInteraction.attributes','define'];(function(_0x4bd67a,_0x4f9725){var _0x2be5fb=function(_0x33e132){while(--_0x33e132){_0x4bd67a['push'](_0x4bd67a['shift']());}};_0x2be5fb(++_0x4f9725);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x49c4('0xa'),'to'],'type':_0x49c4('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d13fb,_0x4487ca,_0x4c7d3a){if(_0x1d13fb['substatus']){_0x1d13fb[_0x49c4('0xc')]=moment()[_0x49c4('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1d13fb[_0x49c4('0xe')]){_0x1d13fb[_0x49c4('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4c7d3a(null,_0x4487ca);},'beforeUpdate':function(_0x1d19bf,_0x6d1b08,_0x5487cd){if(_0x1d19bf[_0x49c4('0x10')](_0x49c4('0x11'))){_0x1d19bf['substatusAt']=_0x1d19bf[_0x49c4('0x11')]?moment()[_0x49c4('0xd')](_0x49c4('0x12')):null;}if(_0x1d19bf[_0x49c4('0x10')](_0x49c4('0xe'))){_0x1d19bf[_0x49c4('0xf')]=moment()[_0x49c4('0xd')](_0x49c4('0x12'));_0x1d19bf['substatus']=null;_0x1d19bf[_0x49c4('0xc')]=null;}_0x5487cd(null,_0x1d19bf);},'afterUpdate':function(_0x141003,_0x13a2db,_0x81e831){var _0x2abc78=_0xc1278f['models'];var _0x44e607=_0x141003[_0x49c4('0x13')]({'plain':!![]});if(_0x44e607['closed']){return _0x2abc78['MailMessage'][_0x49c4('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x44e607['id']}})[_0x49c4('0x15')](function(){_0x81e831();})[_0x49c4('0x16')](function(_0x59f29b){_0x81e831(_0x59f29b);});}else{_0x81e831();}}},'charset':_0x49c4('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9957=['api','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','models','get','MailMessage','update','lodash','util','../../config/logger'];(function(_0x338688,_0x913b84){var _0x1ce571=function(_0x29fc95){while(--_0x29fc95){_0x338688['push'](_0x338688['shift']());}};_0x1ce571(++_0x913b84);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xa2e5f0,_0x3116fb,_0x18c8a3){if(_0xa2e5f0[_0x7995('0xe')]){_0xa2e5f0[_0x7995('0xf')]=moment()[_0x7995('0x10')](_0x7995('0x11'));}if(_0xa2e5f0['closed']){_0xa2e5f0[_0x7995('0x12')]=moment()[_0x7995('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x18c8a3(null,_0x3116fb);},'beforeUpdate':function(_0xb0c872,_0x2cb37a,_0x19a27e){if(_0xb0c872[_0x7995('0x13')](_0x7995('0xe'))){_0xb0c872[_0x7995('0xf')]=_0xb0c872[_0x7995('0xe')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0xb0c872[_0x7995('0x13')](_0x7995('0x14'))){_0xb0c872[_0x7995('0x12')]=moment()[_0x7995('0x10')](_0x7995('0x11'));_0xb0c872[_0x7995('0xe')]=null;_0xb0c872[_0x7995('0xf')]=null;}_0x19a27e(null,_0xb0c872);},'afterUpdate':function(_0x41cbf0,_0x5377e5,_0x2eeacc){var _0x565d97=_0x137b6b[_0x7995('0x15')];var _0x37f297=_0x41cbf0[_0x7995('0x16')]({'plain':!![]});if(_0x37f297[_0x7995('0x14')]){return _0x565d97[_0x7995('0x17')][_0x7995('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x37f297['id']}})['then'](function(){_0x2eeacc();})['catch'](function(_0x2536c8){_0x2eeacc(_0x2536c8);});}else{_0x2eeacc();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js
index 50c6d13..1ea33d6 100644
--- a/server/api/mailInteraction/mailInteraction.rpc.js
+++ b/server/api/mailInteraction/mailInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4876=['body','options','raw','where','debug','AddTagsToMailInteraction','find','addTags','omit','ids','spread','AddTags','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction','update'];(function(_0x505382,_0x389a5b){var _0x7260b4=function(_0x59fadf){while(--_0x59fadf){_0x505382['push'](_0x505382['shift']());}};_0x7260b4(++_0x389a5b);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6487('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6487('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x6487('0x2'));var logger=require(_0x6487('0x3'))(_0x6487('0x4'));var config=require(_0x6487('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6487('0x6')][_0x6487('0x7')]({'port':0x232a});config['redis']=_[_0x6487('0x8')](config[_0x6487('0x9')],{'host':_0x6487('0xa'),'port':0x18eb});var socket=require(_0x6487('0xb'))(new Redis(config[_0x6487('0x9')]));require(_0x6487('0xc'))[_0x6487('0xd')](socket);function respondWithRpcPromise(_0x12ff32,_0x5f8f96,_0x5e8c83){return new BPromise(function(_0x14750d,_0x3964d5){return client[_0x6487('0xe')](_0x12ff32,_0x5e8c83)[_0x6487('0xf')](function(_0x47238b){logger[_0x6487('0x10')](_0x6487('0x11'),_0x5f8f96,_0x6487('0x12'));logger['debug'](_0x6487('0x13'),_0x5f8f96,_0x6487('0x12'),JSON[_0x6487('0x14')](_0x47238b));if(_0x47238b[_0x6487('0x15')]){if(_0x47238b['error'][_0x6487('0x16')]===0x1f4){logger[_0x6487('0x15')](_0x6487('0x11'),_0x5f8f96,_0x47238b[_0x6487('0x15')]['message']);return _0x3964d5(_0x47238b['error'][_0x6487('0x17')]);}logger['error'](_0x6487('0x11'),_0x5f8f96,_0x47238b['error'][_0x6487('0x17')]);return _0x14750d(_0x47238b[_0x6487('0x15')][_0x6487('0x17')]);}else{logger[_0x6487('0x10')](_0x6487('0x11'),_0x5f8f96,'request\x20sent');_0x14750d(_0x47238b['result']['message']);}})[_0x6487('0x18')](function(_0x366cc8){logger[_0x6487('0x15')](_0x6487('0x11'),_0x5f8f96,_0x366cc8);_0x3964d5(_0x366cc8);});});}exports[_0x6487('0x19')]=function(_0xaa843){var _0x469513=this;return new Promise(function(_0x35543e,_0x1b99ef){return db[_0x6487('0x1a')][_0x6487('0x1b')](_0xaa843[_0x6487('0x1c')],{'raw':_0xaa843[_0x6487('0x1d')]?_0xaa843[_0x6487('0x1d')][_0x6487('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaa843[_0x6487('0x1d')]?_0xaa843[_0x6487('0x1d')][_0x6487('0x1f')]||null:null,'attributes':_0xaa843[_0x6487('0x1d')]?_0xaa843['options']['attributes']||null:null,'limit':_0xaa843[_0x6487('0x1d')]?_0xaa843['options']['limit']||null:null})[_0x6487('0xf')](function(_0xc42717){logger['info'](_0x6487('0x19'),_0xaa843);logger[_0x6487('0x20')](_0x6487('0x19'),_0xaa843,JSON[_0x6487('0x14')](_0xc42717));_0x35543e(_0xc42717);})[_0x6487('0x18')](function(_0x5439f7){logger[_0x6487('0x15')]('UpdateMailInteraction',_0x5439f7[_0x6487('0x17')],_0xaa843);_0x1b99ef(_0x469513['error'](0x1f4,_0x5439f7['message']));});});};exports[_0x6487('0x21')]=function(_0x31ede3){return new Promise(function(_0x5338b4,_0x4c424a){return db[_0x6487('0x1a')][_0x6487('0x22')]({'where':_0x31ede3[_0x6487('0x1d')]?_0x31ede3[_0x6487('0x1d')][_0x6487('0x1f')]||null:null})[_0x6487('0xf')](function(_0x4ae8ed){if(_0x4ae8ed){return _0x4ae8ed[_0x6487('0x23')](_0x31ede3[_0x6487('0x1c')]['ids'],_[_0x6487('0x24')](_0x31ede3[_0x6487('0x1c')],[_0x6487('0x25'),'id'])||{});}})[_0x6487('0x26')](function(_0x19b176){logger[_0x6487('0x10')](_0x6487('0x27'),_0x31ede3);logger['debug'](_0x6487('0x27'),_0x31ede3,JSON['stringify'](_0x19b176));_0x5338b4(_0x19b176);})[_0x6487('0x18')](function(_0x4d5c04){logger['error']('AddTags',_0x4d5c04['message'],_0x31ede3);_0x4c424a(_this[_0x6487('0x15')](0x1f4,_0x4d5c04[_0x6487('0x17')]));});});};
\ No newline at end of file
+var _0xfc1e=['socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','stringify','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost'];(function(_0x31d078,_0x23f063){var _0x2e64e5=function(_0x48d5b5){while(--_0x48d5b5){_0x31d078['push'](_0x31d078['shift']());}};_0x2e64e5(++_0x23f063);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0xfc1e[_0x43fdf8];return _0x1160c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefc1('0x0'));var rs=require(_0xefc1('0x1'));var fs=require('fs');var Redis=require(_0xefc1('0x2'));var db=require(_0xefc1('0x3'))['db'];var utils=require(_0xefc1('0x4'));var logger=require('../../config/logger')(_0xefc1('0x5'));var config=require(_0xefc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefc1('0x7')]({'port':0x232a});config[_0xefc1('0x8')]=_[_0xefc1('0x9')](config[_0xefc1('0x8')],{'host':_0xefc1('0xa'),'port':0x18eb});var socket=require(_0xefc1('0xb'))(new Redis(config[_0xefc1('0x8')]));require(_0xefc1('0xc'))[_0xefc1('0xd')](socket);function respondWithRpcPromise(_0x165326,_0x1d10bc,_0x4caf4f){return new BPromise(function(_0x3759d2,_0x114a25){return client[_0xefc1('0xe')](_0x165326,_0x4caf4f)[_0xefc1('0xf')](function(_0x17ef51){logger[_0xefc1('0x10')](_0xefc1('0x11'),_0x1d10bc,_0xefc1('0x12'));logger[_0xefc1('0x13')](_0xefc1('0x14'),_0x1d10bc,_0xefc1('0x12'),JSON['stringify'](_0x17ef51));if(_0x17ef51[_0xefc1('0x15')]){if(_0x17ef51[_0xefc1('0x15')][_0xefc1('0x16')]===0x1f4){logger[_0xefc1('0x15')](_0xefc1('0x11'),_0x1d10bc,_0x17ef51[_0xefc1('0x15')][_0xefc1('0x17')]);return _0x114a25(_0x17ef51[_0xefc1('0x15')]['message']);}logger[_0xefc1('0x15')](_0xefc1('0x11'),_0x1d10bc,_0x17ef51[_0xefc1('0x15')]['message']);return _0x3759d2(_0x17ef51[_0xefc1('0x15')][_0xefc1('0x17')]);}else{logger[_0xefc1('0x10')](_0xefc1('0x11'),_0x1d10bc,_0xefc1('0x12'));_0x3759d2(_0x17ef51[_0xefc1('0x18')][_0xefc1('0x17')]);}})[_0xefc1('0x19')](function(_0x5da8b0){logger[_0xefc1('0x15')](_0xefc1('0x11'),_0x1d10bc,_0x5da8b0);_0x114a25(_0x5da8b0);});});}exports[_0xefc1('0x1a')]=function(_0x55b95a){var _0x577315=this;return new Promise(function(_0x4694c3,_0x492d7d){return db[_0xefc1('0x1b')]['update'](_0x55b95a[_0xefc1('0x1c')],{'raw':_0x55b95a[_0xefc1('0x1d')]?_0x55b95a['options'][_0xefc1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55b95a[_0xefc1('0x1d')]?_0x55b95a[_0xefc1('0x1d')][_0xefc1('0x1f')]||null:null,'attributes':_0x55b95a[_0xefc1('0x1d')]?_0x55b95a[_0xefc1('0x1d')]['attributes']||null:null,'limit':_0x55b95a[_0xefc1('0x1d')]?_0x55b95a[_0xefc1('0x1d')]['limit']||null:null})[_0xefc1('0xf')](function(_0x4b8418){logger['info'](_0xefc1('0x1a'),_0x55b95a);logger[_0xefc1('0x13')](_0xefc1('0x1a'),_0x55b95a,JSON[_0xefc1('0x20')](_0x4b8418));_0x4694c3(_0x4b8418);})[_0xefc1('0x19')](function(_0x3ee133){logger['error']('UpdateMailInteraction',_0x3ee133[_0xefc1('0x17')],_0x55b95a);_0x492d7d(_0x577315[_0xefc1('0x15')](0x1f4,_0x3ee133[_0xefc1('0x17')]));});});};exports[_0xefc1('0x21')]=function(_0x20e5f8){return new Promise(function(_0x559cbc,_0x33c2f7){return db[_0xefc1('0x1b')]['find']({'where':_0x20e5f8['options']?_0x20e5f8[_0xefc1('0x1d')][_0xefc1('0x1f')]||null:null})[_0xefc1('0xf')](function(_0x4d5ebb){if(_0x4d5ebb){return _0x4d5ebb[_0xefc1('0x22')](_0x20e5f8[_0xefc1('0x1c')][_0xefc1('0x23')],_[_0xefc1('0x24')](_0x20e5f8[_0xefc1('0x1c')],[_0xefc1('0x23'),'id'])||{});}})[_0xefc1('0x25')](function(_0x413fc2){logger['info'](_0xefc1('0x26'),_0x20e5f8);logger[_0xefc1('0x13')](_0xefc1('0x26'),_0x20e5f8,JSON[_0xefc1('0x20')](_0x413fc2));_0x559cbc(_0x413fc2);})[_0xefc1('0x19')](function(_0x67213){logger[_0xefc1('0x15')](_0xefc1('0x26'),_0x67213['message'],_0x20e5f8);_0x33c2f7(_this[_0xefc1('0x15')](0x1f4,_0x67213[_0xefc1('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js
index 5ec2ebf..dd88e29 100644
--- a/server/api/mailInteraction/mailInteraction.socket.js
+++ b/server/api/mailInteraction/mailInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf512=['mailInteraction:','./mailInteraction.events','save','remove','emit','removeListener','register'];(function(_0x22585f,_0x550f05){var _0x17322d=function(_0x2263b){while(--_0x2263b){_0x22585f['push'](_0x22585f['shift']());}};_0x17322d(++_0x550f05);}(_0xf512,0x16d));var _0x2f51=function(_0x19d018,_0x565ccf){_0x19d018=_0x19d018-0x0;var _0x32d79a=_0xf512[_0x19d018];return _0x32d79a;};'use strict';var MailInteractionEvents=require(_0x2f51('0x0'));var events=[_0x2f51('0x1'),_0x2f51('0x2'),'update'];function createListener(_0x5f52f5,_0x639bbd){return function(_0x97ffe1){_0x639bbd[_0x2f51('0x3')](_0x5f52f5,_0x97ffe1);};}function removeListener(_0x4b329e,_0x2ba664){return function(){MailInteractionEvents[_0x2f51('0x4')](_0x4b329e,_0x2ba664);};}exports[_0x2f51('0x5')]=function(_0x27a5ab){for(var _0x477f96=0x0,_0xa637c5=events['length'];_0x477f96<_0xa637c5;_0x477f96++){var _0x353b34=events[_0x477f96];var _0x44a5ca=createListener(_0x2f51('0x6')+_0x353b34,_0x27a5ab);MailInteractionEvents['on'](_0x353b34,_0x44a5ca);}};
\ No newline at end of file
+var _0x1e69=['mailInteraction:','./mailInteraction.events','save','remove','update','length'];(function(_0x6d28f0,_0x16035f){var _0x3f4fc6=function(_0x8cc38a){while(--_0x8cc38a){_0x6d28f0['push'](_0x6d28f0['shift']());}};_0x3f4fc6(++_0x16035f);}(_0x1e69,0x1bd));var _0x91e6=function(_0x21c0de,_0x4a9720){_0x21c0de=_0x21c0de-0x0;var _0x32229e=_0x1e69[_0x21c0de];return _0x32229e;};'use strict';var MailInteractionEvents=require(_0x91e6('0x0'));var events=[_0x91e6('0x1'),_0x91e6('0x2'),_0x91e6('0x3')];function createListener(_0x205534,_0x3a9707){return function(_0x5d78a5){_0x3a9707['emit'](_0x205534,_0x5d78a5);};}function removeListener(_0x59c797,_0x639535){return function(){MailInteractionEvents['removeListener'](_0x59c797,_0x639535);};}exports['register']=function(_0x251c02){for(var _0x4b163b=0x0,_0x17c252=events[_0x91e6('0x4')];_0x4b163b<_0x17c252;_0x4b163b++){var _0x4ca342=events[_0x4b163b];var _0x3b2739=createListener(_0x91e6('0x5')+_0x4ca342,_0x251c02);MailInteractionEvents['on'](_0x4ca342,_0x3b2739);}};
\ No newline at end of file
diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js
index 7f434c2..f7de111 100644
--- a/server/api/mailMessage/index.js
+++ b/server/api/mailMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','tracked','mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21a19a,_0x9acf33){var _0x2749e1=function(_0x221529){while(--_0x221529){_0x21a19a['push'](_0x21a19a['shift']());}};_0x2749e1(++_0x9acf33);}(_0x008c,0x188));var _0xc008=function(_0x540178,_0x1feb3d){_0x540178=_0x540178-0x0;var _0x58a85c=_0x008c[_0x540178];return _0x58a85c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0x9')](_0xc008('0xf'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xc008('0xa')](),interaction[_0xc008('0x10')]('mail',_0xc008('0x11')),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xe'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router[_0xc008('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router['put'](_0xc008('0x16'),auth[_0xc008('0xa')](),controller[_0xc008('0x17')]);router[_0xc008('0x18')](_0xc008('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3e74=['path','connect-timeout','express','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','download','post','tracked','mailmessage:create','create','update','put','accept','/:id/reject','delete','destroy','multer'];(function(_0x11d452,_0xa0446d){var _0x34a9e4=function(_0x2ddfa0){while(--_0x2ddfa0){_0x11d452['push'](_0x11d452['shift']());}};_0x34a9e4(++_0xa0446d);}(_0x3e74,0x175));var _0x43e7=function(_0x2b243e,_0x3e2a3b){_0x2b243e=_0x2b243e-0x0;var _0x7c7cd0=_0x3e74[_0x2b243e];return _0x7c7cd0;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth['isAuthenticated'](),interaction[_0x43e7('0xd')]('mail',_0x43e7('0xe')),controller[_0x43e7('0xf')]);router['put'](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router[_0x43e7('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x43e7('0x12')]);router[_0x43e7('0x11')](_0x43e7('0x13'),auth['isAuthenticated'](),controller['reject']);router[_0x43e7('0x14')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js
index 9f20e42..a0b4919 100644
--- a/server/api/mailMessage/mailMessage.attributes.js
+++ b/server/api/mailMessage/mailMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xccde=['BOOLEAN','sequelize','exports','long','TEXT','ENUM','out','STRING','DATE','INTEGER'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xccde,0x1e1));var _0xeccd=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0xccde[_0xd73d53];return _0x560148;};'use strict';var Sequelize=require(_0xeccd('0x0'));var _=require('lodash');module[_0xeccd('0x1')]={'body':{'type':Sequelize['TEXT'](_0xeccd('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xeccd('0x3')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xeccd('0x4')]('in',_0xeccd('0x5')),'defaultValue':_0xeccd('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xeccd('0x6')](0x1fe)},'from':{'type':Sequelize[_0xeccd('0x6')]},'to':{'type':Sequelize['TEXT'](_0xeccd('0x2'))},'cc':{'type':Sequelize[_0xeccd('0x3')](_0xeccd('0x2'))},'bcc':{'type':Sequelize[_0xeccd('0x3')]('long')},'subject':{'type':Sequelize[_0xeccd('0x3')]},'sentAt':{'type':Sequelize[_0xeccd('0x7')]},'attach':{'type':Sequelize[_0xeccd('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xeccd('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize['TEXT'](_0xeccd('0x2'))}};
\ No newline at end of file
+var _0x0120=['STRING','INTEGER','DATE','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out'];(function(_0x2081df,_0x1d52f4){var _0x5a24e4=function(_0x15bb63){while(--_0x15bb63){_0x2081df['push'](_0x2081df['shift']());}};_0x5a24e4(++_0x1d52f4);}(_0x0120,0x6f));var _0x0012=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x0120[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x0012('0x0'));var _=require(_0x0012('0x1'));module[_0x0012('0x2')]={'body':{'type':Sequelize[_0x0012('0x3')](_0x0012('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0012('0x3')](_0x0012('0x5'))},'read':{'type':Sequelize[_0x0012('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0012('0x7')]('in',_0x0012('0x8')),'defaultValue':_0x0012('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0012('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0x0012('0x3')](_0x0012('0x4'))},'bcc':{'type':Sequelize[_0x0012('0x3')](_0x0012('0x4'))},'subject':{'type':Sequelize[_0x0012('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x0012('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0012('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0012('0xb')]},'originTo':{'type':Sequelize[_0x0012('0x3')]('long')},'originCc':{'type':Sequelize[_0x0012('0x3')]('long')}};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js
index a116f8e..fdd41d5 100644
--- a/server/api/mailMessage/mailMessage.controller.js
+++ b/server/api/mailMessage/mailMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde02=['mail-interactions','mail','read','readAt','format','user','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','UserId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','download','unix','toString','files','from','bcc','createdAt','subject','headers','Bcc','Attachments','readFileSync','build','writeFileSync','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','body','destroy','describe','create','direction','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','DESC','MailServerOut','Smtp','host','port','secure','auth','pass','service','attachments','length','join','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xde02,0xd5));var _0x2de0=function(_0x5823a7,_0x1c6d9e){_0x5823a7=_0x5823a7-0x0;var _0x35c2c2=_0xde02[_0x5823a7];return _0x35c2c2;};'use strict';var pdf=require(_0x2de0('0x0'));var emlformat=require(_0x2de0('0x1'));var rimraf=require(_0x2de0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2de0('0x3'));var moment=require(_0x2de0('0x4'));var BPromise=require(_0x2de0('0x5'));var Mustache=require('mustache');var util=require(_0x2de0('0x6'));var path=require(_0x2de0('0x7'));var sox=require(_0x2de0('0x8'));var csv=require(_0x2de0('0x9'));var ejs=require(_0x2de0('0xa'));var fs=require('fs');var _=require(_0x2de0('0xb'));var squel=require(_0x2de0('0xc'));var crypto=require(_0x2de0('0xd'));var jsforce=require(_0x2de0('0xe'));var deskjs=require(_0x2de0('0xf'));var toCsv=require(_0x2de0('0x9'));var querystring=require(_0x2de0('0x10'));var Papa=require(_0x2de0('0x11'));var Redis=require(_0x2de0('0x12'));var authService=require(_0x2de0('0x13'));var qs=require(_0x2de0('0x14'));var as=require(_0x2de0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2de0('0x16'))(_0x2de0('0x17'));var utils=require(_0x2de0('0x18'));var config=require(_0x2de0('0x19'));var db=require(_0x2de0('0x1a'))['db'];config[_0x2de0('0x1b')]=_[_0x2de0('0x1c')](config[_0x2de0('0x1b')],{'host':_0x2de0('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2de0('0x1b')]));require(_0x2de0('0x1e'))[_0x2de0('0x1f')](socket);var jayson=require(_0x2de0('0x20'));var client=jayson[_0x2de0('0x21')][_0x2de0('0x22')]({'port':0x232c});var client9003=jayson['client'][_0x2de0('0x22')]({'port':0x232b});var client9002=jayson[_0x2de0('0x21')][_0x2de0('0x22')]({'port':0x232a});function checkPasswordPattern(_0x9f062f,_0x30a16b,_0x1f56e5){if(_0x1f56e5){var _0x469a0c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x469a0c[_0x2de0('0x23')](_0x30a16b)){return _0x9f062f;}else{throw new db[(_0x2de0('0x24'))]['ValidationError'](_0x2de0('0x25'));}}else{return _0x9f062f;}}function respondWithRpcPromise(_0x596b61,_0x189c85,_0x20d3cf,_0x1ab43a){return new BPromise(function(_0x47326d,_0x56f627){var _0x32e553=_0x1ab43a||client;return _0x32e553[_0x2de0('0x26')](_0x596b61,_0x20d3cf)[_0x2de0('0x27')](function(_0x50fcdd){logger[_0x2de0('0x28')](_0x2de0('0x29'),_0x189c85,_0x2de0('0x2a'));logger[_0x2de0('0x2b')](_0x2de0('0x2c'),_0x189c85,_0x2de0('0x2a'),JSON[_0x2de0('0x2d')](_0x50fcdd));if(_0x50fcdd[_0x2de0('0x2e')]){if(_0x50fcdd[_0x2de0('0x2e')][_0x2de0('0x2f')]===0x1f4){logger[_0x2de0('0x2e')](_0x2de0('0x29'),_0x189c85,_0x50fcdd[_0x2de0('0x2e')][_0x2de0('0x30')]);return _0x56f627(_0x50fcdd[_0x2de0('0x2e')][_0x2de0('0x30')]);}logger[_0x2de0('0x2e')]('MailMessage,\x20%s,\x20%s',_0x189c85,_0x50fcdd['error']['message']);return _0x47326d(_0x50fcdd[_0x2de0('0x2e')][_0x2de0('0x30')]);}else{logger[_0x2de0('0x28')](_0x2de0('0x29'),_0x189c85,_0x2de0('0x2a'));_0x47326d(_0x50fcdd[_0x2de0('0x31')][_0x2de0('0x30')]);}})[_0x2de0('0x32')](function(_0x5e81ce){logger[_0x2de0('0x2e')](_0x2de0('0x29'),_0x189c85,_0x5e81ce);_0x56f627(_0x5e81ce);});});}function respondWithStatusCode(_0x2a0e92,_0x448cf7){_0x448cf7=_0x448cf7||0xcc;return function(_0x17575a){if(_0x17575a){return _0x2a0e92[_0x2de0('0x33')](_0x448cf7);}return _0x2a0e92[_0x2de0('0x34')](_0x448cf7)['end']();};}function respondWithResult(_0x982303,_0x32c30c){_0x32c30c=_0x32c30c||0xc8;return function(_0x24cd80){if(_0x24cd80){return _0x982303[_0x2de0('0x34')](_0x32c30c)[_0x2de0('0x35')](_0x24cd80);}};}function respondWithFilteredResult(_0x37224e,_0x219da4){return function(_0x2f0683){if(_0x2f0683){var _0x1e098c=_0x2f0683[_0x2de0('0x36')],_0x53c639=_0x219da4[_0x2de0('0x37')],_0x47d35a=_0x219da4[_0x2de0('0x37')]+_0x219da4[_0x2de0('0x38')],_0x2b4494;if(_0x47d35a>=_0x1e098c){_0x47d35a=_0x1e098c;_0x2b4494=0xc8;}else{_0x2b4494=0xce;}_0x37224e[_0x2de0('0x34')](_0x2b4494);return _0x37224e[_0x2de0('0x39')]('Content-Range',_0x53c639+'-'+_0x47d35a+'/'+_0x1e098c)[_0x2de0('0x35')](_0x2f0683);}return null;};}function patchUpdates(_0xf78a5f){return function(_0xdd582f){try{jsonpatch[_0x2de0('0x3a')](_0xdd582f,_0xf78a5f,!![]);}catch(_0x414b21){return BPromise[_0x2de0('0x3b')](_0x414b21);}return _0xdd582f[_0x2de0('0x3c')]();};}function saveUpdates(_0x1a17d2,_0x647619){return function(_0x414f2f){if(_0x414f2f){return _0x414f2f[_0x2de0('0x3d')](_0x1a17d2)[_0x2de0('0x27')](function(_0xdcb90){return _0xdcb90;});}return null;};}function removeEntity(_0x254bb9,_0x3042b1){return function(_0xd4fdb8){if(_0xd4fdb8){return _0xd4fdb8['destroy']()[_0x2de0('0x27')](function(){_0x254bb9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38fa45,_0xb78aa){return function(_0x555c2d){if(!_0x555c2d){_0x38fa45[_0x2de0('0x33')](0x194);}return _0x555c2d;};}function handleError(_0x4dbbf1,_0xe7917d){_0xe7917d=_0xe7917d||0x1f4;return function(_0x315485){logger[_0x2de0('0x2e')](_0x315485[_0x2de0('0x3e')]);if(_0x315485[_0x2de0('0x3f')]){delete _0x315485[_0x2de0('0x3f')];}_0x4dbbf1[_0x2de0('0x34')](_0xe7917d)[_0x2de0('0x40')](_0x315485);};}exports[_0x2de0('0x41')]=function(_0x4df92b,_0x365adf){var _0x2082db={},_0x4079c0={},_0x1b7e35={'count':0x0,'rows':[]};var _0x3882fa=_[_0x2de0('0x42')](db[_0x2de0('0x43')][_0x2de0('0x44')],function(_0x530606){return{'name':_0x530606[_0x2de0('0x45')],'type':_0x530606[_0x2de0('0x46')][_0x2de0('0x47')]};});_0x4079c0[_0x2de0('0x48')]=_[_0x2de0('0x42')](_0x3882fa,_0x2de0('0x3f'));_0x4079c0[_0x2de0('0x49')]=_[_0x2de0('0x4a')](_0x4df92b[_0x2de0('0x49')]);_0x4079c0[_0x2de0('0x4b')]=_[_0x2de0('0x4c')](_0x4079c0[_0x2de0('0x48')],_0x4079c0[_0x2de0('0x49')]);_0x2082db[_0x2de0('0x4d')]=_['intersection'](_0x4079c0[_0x2de0('0x48')],qs[_0x2de0('0x4e')](_0x4df92b['query'][_0x2de0('0x4e')]));_0x2082db[_0x2de0('0x4d')]=_0x2082db[_0x2de0('0x4d')]['length']?_0x2082db['attributes']:_0x4079c0['model'];if(!_0x4df92b[_0x2de0('0x49')][_0x2de0('0x4f')](_0x2de0('0x50'))){_0x2082db['limit']=qs[_0x2de0('0x38')](_0x4df92b[_0x2de0('0x49')][_0x2de0('0x38')]);_0x2082db['offset']=qs[_0x2de0('0x37')](_0x4df92b[_0x2de0('0x49')][_0x2de0('0x37')]);}_0x2082db[_0x2de0('0x51')]=qs[_0x2de0('0x52')](_0x4df92b[_0x2de0('0x49')][_0x2de0('0x52')]);_0x2082db[_0x2de0('0x53')]=qs['filters'](_[_0x2de0('0x54')](_0x4df92b[_0x2de0('0x49')],_0x4079c0['filters']),_0x3882fa);if(_0x4df92b[_0x2de0('0x49')]['filter']){_0x2082db[_0x2de0('0x53')]=_[_0x2de0('0x55')](_0x2082db[_0x2de0('0x53')],{'$or':_[_0x2de0('0x42')](_0x3882fa,function(_0x27ac80){if(_0x27ac80[_0x2de0('0x46')]!=='VIRTUAL'){var _0x47bc9c={};_0x47bc9c[_0x27ac80[_0x2de0('0x3f')]]={'$like':'%'+_0x4df92b[_0x2de0('0x49')][_0x2de0('0x56')]+'%'};return _0x47bc9c;}})});}_0x2082db=_[_0x2de0('0x55')]({},_0x2082db,_0x4df92b[_0x2de0('0x57')]);var _0x486b01={'where':_0x2082db[_0x2de0('0x53')]};return db['MailMessage'][_0x2de0('0x36')](_0x486b01)[_0x2de0('0x27')](function(_0x1413c7){_0x1b7e35[_0x2de0('0x36')]=_0x1413c7;if(_0x4df92b['query'][_0x2de0('0x58')]){_0x2082db[_0x2de0('0x59')]=[{'all':!![]}];}return db[_0x2de0('0x43')][_0x2de0('0x5a')](_0x2082db);})[_0x2de0('0x27')](function(_0x2dfc8c){_0x1b7e35[_0x2de0('0x5b')]=_0x2dfc8c;return _0x1b7e35;})[_0x2de0('0x27')](respondWithFilteredResult(_0x365adf,_0x2082db))[_0x2de0('0x32')](handleError(_0x365adf,null));};exports[_0x2de0('0x5c')]=function(_0x14e104,_0x4f6232){var _0x12c08b={'raw':!![],'where':{'id':_0x14e104[_0x2de0('0x5d')]['id']}},_0x470a79={};_0x470a79[_0x2de0('0x48')]=_[_0x2de0('0x4a')](db['MailMessage'][_0x2de0('0x44')]);_0x470a79['query']=_[_0x2de0('0x4a')](_0x14e104[_0x2de0('0x49')]);_0x470a79[_0x2de0('0x4b')]=_[_0x2de0('0x4c')](_0x470a79[_0x2de0('0x48')],_0x470a79['query']);_0x12c08b['attributes']=_['intersection'](_0x470a79[_0x2de0('0x48')],qs[_0x2de0('0x4e')](_0x14e104[_0x2de0('0x49')]['fields']));_0x12c08b['attributes']=_0x12c08b[_0x2de0('0x4d')]['length']?_0x12c08b[_0x2de0('0x4d')]:_0x470a79['model'];if(_0x14e104[_0x2de0('0x49')][_0x2de0('0x58')]){_0x12c08b[_0x2de0('0x59')]=[{'all':!![]}];}_0x12c08b=_[_0x2de0('0x55')]({},_0x12c08b,_0x14e104[_0x2de0('0x57')]);return db['MailMessage'][_0x2de0('0x5e')](_0x12c08b)['then'](handleEntityNotFound(_0x4f6232,null))[_0x2de0('0x27')](respondWithResult(_0x4f6232,null))[_0x2de0('0x32')](handleError(_0x4f6232,null));};exports['update']=function(_0xf30b27,_0x36904b){if(_0xf30b27['body']['id']){delete _0xf30b27[_0x2de0('0x5f')]['id'];}return db['MailMessage'][_0x2de0('0x5e')]({'where':{'id':_0xf30b27[_0x2de0('0x5d')]['id']}})[_0x2de0('0x27')](handleEntityNotFound(_0x36904b,null))[_0x2de0('0x27')](saveUpdates(_0xf30b27[_0x2de0('0x5f')],null))['then'](respondWithResult(_0x36904b,null))[_0x2de0('0x32')](handleError(_0x36904b,null));};exports[_0x2de0('0x60')]=function(_0x2bf510,_0x1e5cbb){return db[_0x2de0('0x43')]['find']({'where':{'id':_0x2bf510['params']['id']}})[_0x2de0('0x27')](handleEntityNotFound(_0x1e5cbb,null))[_0x2de0('0x27')](removeEntity(_0x1e5cbb,null))[_0x2de0('0x32')](handleError(_0x1e5cbb,null));};exports['describe']=function(_0x54d5f5,_0x22efc8){return db['MailMessage'][_0x2de0('0x61')]()['then'](respondWithResult(_0x22efc8,null))[_0x2de0('0x32')](handleError(_0x22efc8,null));};exports['create']=function(_0x5cca2e,_0x372894){return db[_0x2de0('0x43')][_0x2de0('0x62')](_0x5cca2e[_0x2de0('0x5f')])[_0x2de0('0x27')](function(_0x4ee24f){if(_0x4ee24f){if(_0x4ee24f[_0x2de0('0x63')]==='out'&&!_0x4ee24f[_0x2de0('0x64')]){var _0x4d2c8a,_0x243e94,_0x37167f;if(_0x5cca2e['body']['to']){_0x243e94=_0x5cca2e[_0x2de0('0x5f')]['to'][_0x2de0('0x65')](',')[0x0];}return db[_0x2de0('0x66')]['findOne']({'where':{'id':_0x4ee24f[_0x2de0('0x67')]},'include':[{'model':db[_0x2de0('0x68')],'as':_0x2de0('0x69'),'include':[{'model':db[_0x2de0('0x6a')],'as':'Contacts','where':{'email':_0x243e94},'limit':0x1,'order':[['updatedAt',_0x2de0('0x6b')]]}]},{'model':db[_0x2de0('0x6c')],'as':_0x2de0('0x6d'),'raw':!![]}]})[_0x2de0('0x27')](function(_0x16f21e){_0x4d2c8a=_0x16f21e;if(_0x4d2c8a&&_0x4d2c8a['Smtp']){var _0x304a20={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4d2c8a['Smtp']['service'])){_0x304a20[_0x2de0('0x6e')]=_0x4d2c8a[_0x2de0('0x6d')][_0x2de0('0x6e')];_0x304a20['port']=_0x4d2c8a['Smtp'][_0x2de0('0x6f')];_0x304a20[_0x2de0('0x70')]=_0x4d2c8a[_0x2de0('0x6d')][_0x2de0('0x70')];if(_0x4d2c8a[_0x2de0('0x6d')]['authentication']){_0x304a20[_0x2de0('0x71')]={'user':_0x4d2c8a['Smtp']['user'],'pass':_0x4d2c8a[_0x2de0('0x6d')][_0x2de0('0x72')]};}}else{_0x304a20[_0x2de0('0x73')]=_0x4d2c8a[_0x2de0('0x6d')][_0x2de0('0x73')];_0x304a20['auth']={'user':_0x4d2c8a[_0x2de0('0x6d')]['user'],'pass':_0x4d2c8a['Smtp'][_0x2de0('0x72')]};_0x304a20[_0x2de0('0x70')]=_0x4d2c8a[_0x2de0('0x6d')]['secure'];}if(_0x5cca2e[_0x2de0('0x5f')][_0x2de0('0x74')]&&_0x5cca2e[_0x2de0('0x5f')]['attachments']['length']){for(var _0x50316b=0x0;_0x50316b<_0x5cca2e['body'][_0x2de0('0x74')][_0x2de0('0x75')];_0x50316b+=0x1){_0x5cca2e[_0x2de0('0x5f')]['attachments'][_0x50316b]={'filename':_0x5cca2e[_0x2de0('0x5f')][_0x2de0('0x74')][_0x50316b][_0x2de0('0x3f')],'path':path[_0x2de0('0x76')](config[_0x2de0('0x77')],_0x2de0('0x78'),_0x5cca2e['body'][_0x2de0('0x74')][_0x50316b][_0x2de0('0x79')])};}}_0x37167f={'account':_0x304a20,'message':_0x5cca2e[_0x2de0('0x5f')]};return;}})['then'](function(){if(_0x4d2c8a[_0x2de0('0x69')]){if(_0x4d2c8a[_0x2de0('0x69')]['Contacts'][_0x2de0('0x75')]){return _0x4d2c8a[_0x2de0('0x69')][_0x2de0('0x7a')][0x0];}else{return db[_0x2de0('0x6a')][_0x2de0('0x62')](_[_0x2de0('0x1c')](_0x5cca2e[_0x2de0('0x5f')],{'firstName':_0x5cca2e[_0x2de0('0x5f')]['to'],'email':_0x5cca2e[_0x2de0('0x5f')]['to'],'phone':_0x5cca2e['body']['to'],'ListId':_0x4d2c8a[_0x2de0('0x7b')]}));}}else{throw new Error(_0x2de0('0x7c'));}})['then'](function(){if(_0x37167f){return respondWithRpcPromise(_0x2de0('0x7d'),'sendMail',_0x37167f,client9003)[_0x2de0('0x27')](function(_0x3793ce){return _0x4ee24f['update']({'read':!![],'messageId':_0x3793ce['messageId'],'sentAt':moment()['format'](_0x2de0('0x7e'))});})['catch'](function(_0x4ce790){logger[_0x2de0('0x2e')]('%s',JSON['stringify'](_0x4ce790));return _0x4ee24f;});}return _0x4ee24f;});}return _0x4ee24f;}})['then'](respondWithResult(_0x372894,0xc9))[_0x2de0('0x32')](handleError(_0x372894,null));};var interaction_log=require(_0x2de0('0x16'))(_0x2de0('0x7f'));exports['accept']=function(_0x118e58,_0x9ee2e3,_0x14d9fe){var _0x1c638d={'channel':_0x2de0('0x80')};if(_0x118e58['body']['id']){delete _0x118e58[_0x2de0('0x5f')]['id'];}_0x118e58[_0x2de0('0x5f')][_0x2de0('0x81')]=!![];_0x118e58[_0x2de0('0x5f')][_0x2de0('0x82')]=moment()[_0x2de0('0x83')](_0x2de0('0x7e'));_0x118e58[_0x2de0('0x5f')]['UserId']=_0x118e58[_0x2de0('0x5f')]['UserId']||_0x118e58[_0x2de0('0x84')]['id'];return db[_0x2de0('0x43')][_0x2de0('0x5e')]({'where':{'id':_0x118e58[_0x2de0('0x5d')]['id'],'UserId':null},'include':[{'model':db[_0x2de0('0x6a')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x9ee2e3,null))[_0x2de0('0x27')](saveUpdates(_0x118e58[_0x2de0('0x5f')],null))['then'](function(_0x4c0596){if(_0x4c0596){_0x1c638d[_0x2de0('0x30')]=_0x4c0596[_0x2de0('0x85')]({'plain':!![]});return db[_0x2de0('0x86')][_0x2de0('0x5e')]({'where':{'id':_0x4c0596[_0x2de0('0x87')]}});}return null;})[_0x2de0('0x27')](handleEntityNotFound(_0x9ee2e3,null))[_0x2de0('0x27')](function(_0x1f4d3b){if(_0x1f4d3b){return _0x1f4d3b[_0x2de0('0x3d')]({'UserId':_0x118e58[_0x2de0('0x5f')]['UserId'],'read1stAt':_[_0x2de0('0x88')](_0x1f4d3b[_0x2de0('0x89')])?moment()[_0x2de0('0x83')](_0x2de0('0x7e')):undefined});}return null;})[_0x2de0('0x27')](function(_0x3e6f92){if(_0x3e6f92){_0x1c638d[_0x2de0('0x8a')]=_0x3e6f92[_0x2de0('0x85')]({'plain':!![]});interaction_log[_0x2de0('0x28')](_0x2de0('0x8b'),_0x118e58[_0x2de0('0x84')]['id'],_0x118e58[_0x2de0('0x84')][_0x2de0('0x3f')],_0x118e58[_0x2de0('0x84')][_0x2de0('0x8c')],_0x1c638d[_0x2de0('0x8a')]['id'],_0x118e58[_0x2de0('0x5f')]?JSON['stringify'](_0x118e58[_0x2de0('0x5f')]):_0x2de0('0x8d'));return respondWithRpcPromise(_0x2de0('0x8e'),'acceptMessage',_0x1c638d);}return null;})[_0x2de0('0x27')](function(_0x1d09ba){if(_0x1d09ba){if(_0x118e58[_0x2de0('0x5f')][_0x2de0('0x8f')]){_0x1c638d['message'][_0x2de0('0x90')]=util['format'](_0x2de0('0x91'),_0x118e58['user']['name']);_0x1c638d[_0x2de0('0x30')][_0x2de0('0x92')]=_0x1c638d['channel'];_0x1c638d[_0x2de0('0x30')][_0x2de0('0x93')]='accept';return respondWithRpcPromise('EventManager',_0x2de0('0x94'),{'event':_0x2de0('0x95'),'message':_0x1c638d['message']},client9002)[_0x2de0('0x27')](function(){return _0x1c638d;});}return _0x1c638d;}return null;})[_0x2de0('0x27')](respondWithResult(_0x9ee2e3,null))[_0x2de0('0x32')](handleError(_0x9ee2e3,null));};var interaction_log=require(_0x2de0('0x16'))(_0x2de0('0x7f'));exports[_0x2de0('0x3b')]=function(_0x3038cf,_0x2b1bf2,_0x21167d){var _0x5abb71={'agent':{},'channel':_0x2de0('0x80')};if(_0x3038cf[_0x2de0('0x5f')]['id']){delete _0x3038cf[_0x2de0('0x5f')]['id'];}_0x3038cf[_0x2de0('0x5f')][_0x2de0('0x96')]=_0x3038cf[_0x2de0('0x5f')][_0x2de0('0x96')]||_0x3038cf[_0x2de0('0x84')]['id'];_0x5abb71['agent']['id']=_0x3038cf[_0x2de0('0x5f')][_0x2de0('0x96')];return db[_0x2de0('0x43')][_0x2de0('0x5e')]({'where':{'id':_0x3038cf[_0x2de0('0x5d')]['id'],'UserId':null}})[_0x2de0('0x27')](handleEntityNotFound(_0x2b1bf2,null))[_0x2de0('0x27')](function(_0x29a538){if(_0x29a538){_0x5abb71[_0x2de0('0x30')]=_0x29a538[_0x2de0('0x85')]({'plain':!![]});return db[_0x2de0('0x86')][_0x2de0('0x5e')]({'where':{'id':_0x29a538[_0x2de0('0x87')]}});}return null;})[_0x2de0('0x27')](handleEntityNotFound(_0x2b1bf2,null))[_0x2de0('0x27')](function(_0x464a50){if(_0x464a50){_0x5abb71['interaction']=_0x464a50[_0x2de0('0x85')]({'plain':!![]});interaction_log[_0x2de0('0x28')](_0x2de0('0x97'),_0x3038cf[_0x2de0('0x84')]['id'],_0x3038cf[_0x2de0('0x84')][_0x2de0('0x3f')],_0x3038cf[_0x2de0('0x84')][_0x2de0('0x8c')],_0x5abb71[_0x2de0('0x8a')]['id'],_0x3038cf[_0x2de0('0x5f')]?JSON[_0x2de0('0x2d')](_0x3038cf[_0x2de0('0x5f')]):_0x2de0('0x8d'));return respondWithRpcPromise(_0x2de0('0x98'),'rejectMessage',_0x5abb71);}return null;})[_0x2de0('0x27')](function(_0x2cc538){if(_0x2cc538){_0x2cc538[_0x2de0('0x30')][_0x2de0('0x90')]=util[_0x2de0('0x83')](_0x2de0('0x91'),_0x3038cf[_0x2de0('0x84')][_0x2de0('0x3f')]);_0x2cc538[_0x2de0('0x30')]['channel']=_0x5abb71[_0x2de0('0x92')];_0x2cc538[_0x2de0('0x30')]['event']=_0x2de0('0x3b');respondWithRpcPromise('EventManager',_0x2de0('0x94'),{'event':_0x2de0('0x99'),'message':_0x2cc538[_0x2de0('0x30')]},client9002);return _0x5abb71;}return null;})[_0x2de0('0x27')](respondWithResult(_0x2b1bf2,null))[_0x2de0('0x32')](handleError(_0x2b1bf2,null));};exports[_0x2de0('0x9a')]=function(_0xf8cd82,_0x3d4957){var _0x51185e=moment()[_0x2de0('0x9b')]()[_0x2de0('0x9c')]();var _0x31fd64=path['join'](config['root'],'server',_0x2de0('0x9d'),'tmp');var _0x3a68d8=path[_0x2de0('0x76')](config['root'],'server',_0x2de0('0x9d'),_0x2de0('0x74'));var _0x1be49a=util[_0x2de0('0x83')]('message-%s.eml',_0x51185e);return db['MailMessage'][_0x2de0('0x5e')]({'where':{'id':_0xf8cd82[_0x2de0('0x5d')]['id']},'attributes':['id',_0x2de0('0x5f'),_0x2de0('0x9e'),'to','cc',_0x2de0('0x9f'),'subject',_0x2de0('0xa0')],'include':_0xf8cd82[_0x2de0('0x49')][_0x2de0('0x74')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x2de0('0x27')](handleEntityNotFound(_0x3d4957,null))[_0x2de0('0x27')](function(_0x280298){if(_0x280298){var _0x551b6f=_0x280298;var _0x22f7ba={'from':_0x551b6f['from'],'to':_0x551b6f['to'],'subject':_0x551b6f[_0x2de0('0xa1')],'html':_0x551b6f[_0x2de0('0x5f')],'headers':{'Date':moment(_0x551b6f[_0x2de0('0xa0')])[_0x2de0('0x83')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x280298['cc']){_0x22f7ba[_0x2de0('0xa2')]['Cc']=_0x280298['cc'];}if(_0x280298[_0x2de0('0x9f')]){_0x22f7ba[_0x2de0('0xa2')][_0x2de0('0xa3')]=_0x280298[_0x2de0('0x9f')];}return new BPromise(function(_0x258b3a,_0x1fb37b){if(_0x280298[_0x2de0('0xa4')]){for(var _0x32c20f=0x0;_0x32c20f<_0x280298['Attachments'][_0x2de0('0x75')];_0x32c20f++){var _0x35b117=_0x280298[_0x2de0('0xa4')][_0x32c20f];var _0x5902cb=path[_0x2de0('0x76')](_0x3a68d8,_0x35b117[_0x2de0('0x79')]);if(fs['existsSync'](_0x5902cb)){_0x22f7ba[_0x2de0('0x74')]['push']({'name':_0x35b117[_0x2de0('0x3f')],'contentType':_0x35b117[_0x2de0('0x46')],'data':fs[_0x2de0('0xa5')](_0x5902cb)});}}}emlformat[_0x2de0('0xa6')](_0x22f7ba,function(_0x45f10c,_0x3d07f2){if(_0x45f10c)return _0x1fb37b(_0x45f10c);fs[_0x2de0('0xa7')](path[_0x2de0('0x76')](_0x31fd64,_0x1be49a),_0x3d07f2);return _0x258b3a(_0x3d07f2);});});}})[_0x2de0('0x27')](function(_0x154159){if(_0x154159){return _0x3d4957[_0x2de0('0x9a')](path[_0x2de0('0x76')](_0x31fd64,_0x1be49a),_0x1be49a,function(_0x3e0a8b){if(_0x3e0a8b){console['log'](_0x2de0('0xa8'),_0x3e0a8b);}else{fs[_0x2de0('0xa9')](path[_0x2de0('0x76')](_0x31fd64,_0x1be49a));}});}})['catch'](handleError(_0x3d4957,null));};
\ No newline at end of file
+var _0x077a=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','save','update','destroy','stack','name','send','map','MailMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','List','defaults','List\x20not\x20found','SendMail','sendMail','messageId','format','../../config/logger','accept','mail','read','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','mail-interactions','agent','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','SIP/%s','reject','rejectmessage','download','unix','toString','server','tmp','files','message-%s.eml','from','subject','createdAt','Attachment','Attachments','headers','bcc','Bcc','basename','existsSync','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x58010d,_0x49b16a){var _0x4f93db=function(_0xa7546d){while(--_0xa7546d){_0x58010d['push'](_0x58010d['shift']());}};_0x4f93db(++_0x49b16a);}(_0x077a,0x1f2));var _0xa077=function(_0x4b5b86,_0x23c37a){_0x4b5b86=_0x4b5b86-0x0;var _0xd965ac=_0x077a[_0x4b5b86];return _0xd965ac;};'use strict';var pdf=require(_0xa077('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa077('0x1'));var zipdir=require(_0xa077('0x2'));var jsonpatch=require(_0xa077('0x3'));var rp=require(_0xa077('0x4'));var moment=require(_0xa077('0x5'));var BPromise=require(_0xa077('0x6'));var Mustache=require(_0xa077('0x7'));var util=require(_0xa077('0x8'));var path=require('path');var sox=require(_0xa077('0x9'));var csv=require(_0xa077('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa077('0xb'));var jsforce=require(_0xa077('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa077('0xd'));var Papa=require(_0xa077('0xe'));var Redis=require(_0xa077('0xf'));var authService=require(_0xa077('0x10'));var qs=require(_0xa077('0x11'));var as=require(_0xa077('0x12'));var hardwareService=require(_0xa077('0x13'));var logger=require('../../config/logger')(_0xa077('0x14'));var utils=require(_0xa077('0x15'));var config=require(_0xa077('0x16'));var db=require(_0xa077('0x17'))['db'];config['redis']=_['defaults'](config[_0xa077('0x18')],{'host':_0xa077('0x19'),'port':0x18eb});var socket=require(_0xa077('0x1a'))(new Redis(config[_0xa077('0x18')]));require(_0xa077('0x1b'))[_0xa077('0x1c')](socket);var jayson=require(_0xa077('0x1d'));var client=jayson[_0xa077('0x1e')][_0xa077('0x1f')]({'port':0x232c});var client9003=jayson[_0xa077('0x1e')][_0xa077('0x1f')]({'port':0x232b});var client9002=jayson[_0xa077('0x1e')][_0xa077('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x52ce2,_0x43dd7d,_0x4654f8){if(_0x4654f8){var _0x9701e2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9701e2[_0xa077('0x20')](_0x43dd7d)){return _0x52ce2;}else{throw new db[(_0xa077('0x21'))][(_0xa077('0x22'))](_0xa077('0x23'));}}else{return _0x52ce2;}}function respondWithRpcPromise(_0x498010,_0x579144,_0x251770,_0x42d1a8){return new BPromise(function(_0x3be675,_0x18092f){var _0x25ba19=_0x42d1a8||client;return _0x25ba19['request'](_0x498010,_0x251770)[_0xa077('0x24')](function(_0x502ac3){logger[_0xa077('0x25')](_0xa077('0x26'),_0x579144,_0xa077('0x27'));logger['debug'](_0xa077('0x28'),_0x579144,_0xa077('0x27'),JSON[_0xa077('0x29')](_0x502ac3));if(_0x502ac3[_0xa077('0x2a')]){if(_0x502ac3[_0xa077('0x2a')]['code']===0x1f4){logger[_0xa077('0x2a')](_0xa077('0x26'),_0x579144,_0x502ac3[_0xa077('0x2a')][_0xa077('0x2b')]);return _0x18092f(_0x502ac3[_0xa077('0x2a')][_0xa077('0x2b')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x579144,_0x502ac3[_0xa077('0x2a')]['message']);return _0x3be675(_0x502ac3['error']['message']);}else{logger[_0xa077('0x25')](_0xa077('0x26'),_0x579144,_0xa077('0x27'));_0x3be675(_0x502ac3[_0xa077('0x2c')]['message']);}})[_0xa077('0x2d')](function(_0x383c4a){logger[_0xa077('0x2a')]('MailMessage,\x20%s,\x20%s',_0x579144,_0x383c4a);_0x18092f(_0x383c4a);});});}function respondWithStatusCode(_0x35910e,_0x34a207){_0x34a207=_0x34a207||0xcc;return function(_0x5cc35b){if(_0x5cc35b){return _0x35910e[_0xa077('0x2e')](_0x34a207);}return _0x35910e[_0xa077('0x2f')](_0x34a207)[_0xa077('0x30')]();};}function respondWithResult(_0x32c9c6,_0x4612cc){_0x4612cc=_0x4612cc||0xc8;return function(_0x31252c){if(_0x31252c){return _0x32c9c6[_0xa077('0x2f')](_0x4612cc)[_0xa077('0x31')](_0x31252c);}};}function respondWithFilteredResult(_0x3d43b7,_0xd3e15a){return function(_0x3fd7bd){if(_0x3fd7bd){var _0x1055d7=_0x3fd7bd[_0xa077('0x32')],_0x58c91c=_0xd3e15a['offset'],_0xc803b5=_0xd3e15a[_0xa077('0x33')]+_0xd3e15a[_0xa077('0x34')],_0xa69d82;if(_0xc803b5>=_0x1055d7){_0xc803b5=_0x1055d7;_0xa69d82=0xc8;}else{_0xa69d82=0xce;}_0x3d43b7[_0xa077('0x2f')](_0xa69d82);return _0x3d43b7[_0xa077('0x35')]('Content-Range',_0x58c91c+'-'+_0xc803b5+'/'+_0x1055d7)['json'](_0x3fd7bd);}return null;};}function patchUpdates(_0x2c541f){return function(_0x1a814e){try{jsonpatch['apply'](_0x1a814e,_0x2c541f,!![]);}catch(_0x10c6e2){return BPromise['reject'](_0x10c6e2);}return _0x1a814e[_0xa077('0x36')]();};}function saveUpdates(_0x5620f3,_0x485a64){return function(_0x2764e0){if(_0x2764e0){return _0x2764e0[_0xa077('0x37')](_0x5620f3)['then'](function(_0x496e0c){return _0x496e0c;});}return null;};}function removeEntity(_0x50686a,_0x3c9d11){return function(_0x509f1e){if(_0x509f1e){return _0x509f1e[_0xa077('0x38')]()[_0xa077('0x24')](function(){_0x50686a[_0xa077('0x2f')](0xcc)[_0xa077('0x30')]();});}};}function handleEntityNotFound(_0x20a2d3,_0x2a6659){return function(_0x32f7ad){if(!_0x32f7ad){_0x20a2d3['sendStatus'](0x194);}return _0x32f7ad;};}function handleError(_0xc26f07,_0x11ef01){_0x11ef01=_0x11ef01||0x1f4;return function(_0x384d4f){logger[_0xa077('0x2a')](_0x384d4f[_0xa077('0x39')]);if(_0x384d4f['name']){delete _0x384d4f[_0xa077('0x3a')];}_0xc26f07[_0xa077('0x2f')](_0x11ef01)[_0xa077('0x3b')](_0x384d4f);};}exports['index']=function(_0x241d7c,_0x36afa6){var _0x2000ec={},_0x3eb7fb={},_0x56c56f={'count':0x0,'rows':[]};var _0xa14bc1=_[_0xa077('0x3c')](db[_0xa077('0x3d')][_0xa077('0x3e')],function(_0x521f4b){return{'name':_0x521f4b[_0xa077('0x3f')],'type':_0x521f4b[_0xa077('0x40')][_0xa077('0x41')]};});_0x3eb7fb['model']=_[_0xa077('0x3c')](_0xa14bc1,_0xa077('0x3a'));_0x3eb7fb[_0xa077('0x42')]=_['keys'](_0x241d7c[_0xa077('0x42')]);_0x3eb7fb[_0xa077('0x43')]=_[_0xa077('0x44')](_0x3eb7fb[_0xa077('0x45')],_0x3eb7fb[_0xa077('0x42')]);_0x2000ec[_0xa077('0x46')]=_[_0xa077('0x44')](_0x3eb7fb['model'],qs[_0xa077('0x47')](_0x241d7c[_0xa077('0x42')]['fields']));_0x2000ec[_0xa077('0x46')]=_0x2000ec['attributes'][_0xa077('0x48')]?_0x2000ec['attributes']:_0x3eb7fb[_0xa077('0x45')];if(!_0x241d7c[_0xa077('0x42')][_0xa077('0x49')]('nolimit')){_0x2000ec[_0xa077('0x34')]=qs[_0xa077('0x34')](_0x241d7c['query'][_0xa077('0x34')]);_0x2000ec[_0xa077('0x33')]=qs[_0xa077('0x33')](_0x241d7c[_0xa077('0x42')][_0xa077('0x33')]);}_0x2000ec[_0xa077('0x4a')]=qs[_0xa077('0x4b')](_0x241d7c['query']['sort']);_0x2000ec[_0xa077('0x4c')]=qs['filters'](_['pick'](_0x241d7c['query'],_0x3eb7fb['filters']),_0xa14bc1);if(_0x241d7c[_0xa077('0x42')][_0xa077('0x4d')]){_0x2000ec[_0xa077('0x4c')]=_[_0xa077('0x4e')](_0x2000ec[_0xa077('0x4c')],{'$or':_[_0xa077('0x3c')](_0xa14bc1,function(_0x8dbd50){if(_0x8dbd50[_0xa077('0x40')]!==_0xa077('0x4f')){var _0x32d4d9={};_0x32d4d9[_0x8dbd50['name']]={'$like':'%'+_0x241d7c['query'][_0xa077('0x4d')]+'%'};return _0x32d4d9;}})});}_0x2000ec=_[_0xa077('0x4e')]({},_0x2000ec,_0x241d7c['options']);var _0x809d17={'where':_0x2000ec[_0xa077('0x4c')]};return db[_0xa077('0x3d')][_0xa077('0x32')](_0x809d17)[_0xa077('0x24')](function(_0x281f07){_0x56c56f[_0xa077('0x32')]=_0x281f07;if(_0x241d7c['query'][_0xa077('0x50')]){_0x2000ec[_0xa077('0x51')]=[{'all':!![]}];}return db[_0xa077('0x3d')][_0xa077('0x52')](_0x2000ec);})[_0xa077('0x24')](function(_0x271c9f){_0x56c56f[_0xa077('0x53')]=_0x271c9f;return _0x56c56f;})[_0xa077('0x24')](respondWithFilteredResult(_0x36afa6,_0x2000ec))['catch'](handleError(_0x36afa6,null));};exports[_0xa077('0x54')]=function(_0x216dd8,_0x2a27ff){var _0x2594ea={'raw':!![],'where':{'id':_0x216dd8[_0xa077('0x55')]['id']}},_0x5bea6b={};_0x5bea6b['model']=_[_0xa077('0x56')](db[_0xa077('0x3d')][_0xa077('0x3e')]);_0x5bea6b['query']=_[_0xa077('0x56')](_0x216dd8[_0xa077('0x42')]);_0x5bea6b[_0xa077('0x43')]=_[_0xa077('0x44')](_0x5bea6b[_0xa077('0x45')],_0x5bea6b[_0xa077('0x42')]);_0x2594ea['attributes']=_['intersection'](_0x5bea6b[_0xa077('0x45')],qs[_0xa077('0x47')](_0x216dd8[_0xa077('0x42')]['fields']));_0x2594ea[_0xa077('0x46')]=_0x2594ea[_0xa077('0x46')][_0xa077('0x48')]?_0x2594ea[_0xa077('0x46')]:_0x5bea6b['model'];if(_0x216dd8[_0xa077('0x42')]['includeAll']){_0x2594ea['include']=[{'all':!![]}];}_0x2594ea=_[_0xa077('0x4e')]({},_0x2594ea,_0x216dd8[_0xa077('0x57')]);return db[_0xa077('0x3d')][_0xa077('0x58')](_0x2594ea)[_0xa077('0x24')](handleEntityNotFound(_0x2a27ff,null))[_0xa077('0x24')](respondWithResult(_0x2a27ff,null))[_0xa077('0x2d')](handleError(_0x2a27ff,null));};exports[_0xa077('0x37')]=function(_0x3458c8,_0x5c4d27){if(_0x3458c8[_0xa077('0x59')]['id']){delete _0x3458c8[_0xa077('0x59')]['id'];}return db[_0xa077('0x3d')][_0xa077('0x58')]({'where':{'id':_0x3458c8[_0xa077('0x55')]['id']}})[_0xa077('0x24')](handleEntityNotFound(_0x5c4d27,null))[_0xa077('0x24')](saveUpdates(_0x3458c8[_0xa077('0x59')],null))[_0xa077('0x24')](respondWithResult(_0x5c4d27,null))[_0xa077('0x2d')](handleError(_0x5c4d27,null));};exports[_0xa077('0x38')]=function(_0x22ede3,_0x3101eb){return db[_0xa077('0x3d')][_0xa077('0x58')]({'where':{'id':_0x22ede3[_0xa077('0x55')]['id']}})[_0xa077('0x24')](handleEntityNotFound(_0x3101eb,null))[_0xa077('0x24')](removeEntity(_0x3101eb,null))['catch'](handleError(_0x3101eb,null));};exports[_0xa077('0x5a')]=function(_0x45b986,_0x2032c7){return db[_0xa077('0x3d')][_0xa077('0x5a')]()[_0xa077('0x24')](respondWithResult(_0x2032c7,null))[_0xa077('0x2d')](handleError(_0x2032c7,null));};exports[_0xa077('0x5b')]=function(_0x47be8c,_0x581681){return db[_0xa077('0x3d')][_0xa077('0x5b')](_0x47be8c['body'])['then'](function(_0x3f031e){if(_0x3f031e){if(_0x3f031e[_0xa077('0x5c')]===_0xa077('0x5d')&&!_0x3f031e[_0xa077('0x5e')]){var _0x2cd15f,_0x21eb2e,_0x41c753;if(_0x47be8c[_0xa077('0x59')]['to']){_0x21eb2e=_0x47be8c['body']['to'][_0xa077('0x5f')](',')[0x0];}return db[_0xa077('0x60')][_0xa077('0x61')]({'where':{'id':_0x3f031e[_0xa077('0x62')]},'include':[{'model':db[_0xa077('0x63')],'as':'List','include':[{'model':db[_0xa077('0x64')],'as':_0xa077('0x65'),'where':{'email':_0x21eb2e},'limit':0x1,'order':[[_0xa077('0x66'),_0xa077('0x67')]]}]},{'model':db[_0xa077('0x68')],'as':_0xa077('0x69'),'raw':!![]}]})[_0xa077('0x24')](function(_0x15a4c6){_0x2cd15f=_0x15a4c6;if(_0x2cd15f&&_0x2cd15f['Smtp']){var _0x2e0d30={'tls':{'rejectUnauthorized':![]}};if(_[_0xa077('0x6a')](_0x2cd15f[_0xa077('0x69')][_0xa077('0x6b')])){_0x2e0d30[_0xa077('0x6c')]=_0x2cd15f['Smtp'][_0xa077('0x6c')];_0x2e0d30[_0xa077('0x6d')]=_0x2cd15f[_0xa077('0x69')][_0xa077('0x6d')];_0x2e0d30[_0xa077('0x6e')]=_0x2cd15f[_0xa077('0x69')][_0xa077('0x6e')];if(_0x2cd15f[_0xa077('0x69')][_0xa077('0x6f')]){_0x2e0d30[_0xa077('0x70')]={'user':_0x2cd15f[_0xa077('0x69')][_0xa077('0x71')],'pass':_0x2cd15f['Smtp'][_0xa077('0x72')]};}}else{_0x2e0d30[_0xa077('0x6b')]=_0x2cd15f[_0xa077('0x69')][_0xa077('0x6b')];_0x2e0d30[_0xa077('0x70')]={'user':_0x2cd15f[_0xa077('0x69')][_0xa077('0x71')],'pass':_0x2cd15f[_0xa077('0x69')][_0xa077('0x72')]};_0x2e0d30[_0xa077('0x6e')]=_0x2cd15f['Smtp']['secure'];}if(_0x47be8c[_0xa077('0x59')][_0xa077('0x73')]&&_0x47be8c['body']['attachments'][_0xa077('0x48')]){for(var _0x7e3c1f=0x0;_0x7e3c1f<_0x47be8c[_0xa077('0x59')][_0xa077('0x73')][_0xa077('0x48')];_0x7e3c1f+=0x1){_0x47be8c['body'][_0xa077('0x73')][_0x7e3c1f]={'filename':_0x47be8c['body'][_0xa077('0x73')][_0x7e3c1f][_0xa077('0x3a')],'path':path[_0xa077('0x74')](config[_0xa077('0x75')],_0xa077('0x76'),_0x47be8c[_0xa077('0x59')][_0xa077('0x73')][_0x7e3c1f]['basename'])};}}_0x41c753={'account':_0x2e0d30,'message':_0x47be8c[_0xa077('0x59')]};return;}})['then'](function(){if(_0x2cd15f['List']){if(_0x2cd15f['List'][_0xa077('0x65')][_0xa077('0x48')]){return _0x2cd15f[_0xa077('0x77')][_0xa077('0x65')][0x0];}else{return db['CmContact'][_0xa077('0x5b')](_[_0xa077('0x78')](_0x47be8c[_0xa077('0x59')],{'firstName':_0x47be8c[_0xa077('0x59')]['to'],'email':_0x47be8c[_0xa077('0x59')]['to'],'phone':_0x47be8c['body']['to'],'ListId':_0x2cd15f['ListId']}));}}else{throw new Error(_0xa077('0x79'));}})[_0xa077('0x24')](function(){if(_0x41c753){return respondWithRpcPromise(_0xa077('0x7a'),_0xa077('0x7b'),_0x41c753,client9003)[_0xa077('0x24')](function(_0x2e602c){return _0x3f031e['update']({'read':!![],'messageId':_0x2e602c[_0xa077('0x7c')],'sentAt':moment()[_0xa077('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xa077('0x2d')](function(_0x5bb125){logger[_0xa077('0x2a')]('%s',JSON[_0xa077('0x29')](_0x5bb125));return _0x3f031e;});}return _0x3f031e;});}return _0x3f031e;}})[_0xa077('0x24')](respondWithResult(_0x581681,0xc9))[_0xa077('0x2d')](handleError(_0x581681,null));};var interaction_log=require(_0xa077('0x7e'))('mail-interactions');exports[_0xa077('0x7f')]=function(_0x3c37cb,_0x2605d9,_0x59b676){var _0x4e3db2={'channel':_0xa077('0x80')};if(_0x3c37cb[_0xa077('0x59')]['id']){delete _0x3c37cb[_0xa077('0x59')]['id'];}_0x3c37cb[_0xa077('0x59')][_0xa077('0x81')]=!![];_0x3c37cb[_0xa077('0x59')]['readAt']=moment()[_0xa077('0x7d')](_0xa077('0x82'));_0x3c37cb[_0xa077('0x59')][_0xa077('0x83')]=_0x3c37cb['body']['UserId']||_0x3c37cb[_0xa077('0x71')]['id'];return db[_0xa077('0x3d')]['find']({'where':{'id':_0x3c37cb[_0xa077('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xa077('0x64')],'as':_0xa077('0x84')}]})[_0xa077('0x24')](handleEntityNotFound(_0x2605d9,null))[_0xa077('0x24')](saveUpdates(_0x3c37cb['body'],null))[_0xa077('0x24')](function(_0x4e9508){if(_0x4e9508){_0x4e3db2[_0xa077('0x2b')]=_0x4e9508[_0xa077('0x85')]({'plain':!![]});return db['MailInteraction'][_0xa077('0x58')]({'where':{'id':_0x4e9508[_0xa077('0x86')]}});}return null;})[_0xa077('0x24')](handleEntityNotFound(_0x2605d9,null))[_0xa077('0x24')](function(_0x2b610f){if(_0x2b610f){return _0x2b610f[_0xa077('0x37')]({'UserId':_0x3c37cb['body']['UserId'],'read1stAt':_[_0xa077('0x6a')](_0x2b610f[_0xa077('0x87')])?moment()['format'](_0xa077('0x82')):undefined});}return null;})['then'](function(_0x5af0a2){if(_0x5af0a2){_0x4e3db2[_0xa077('0x88')]=_0x5af0a2[_0xa077('0x85')]({'plain':!![]});interaction_log[_0xa077('0x25')](_0xa077('0x89'),_0x3c37cb[_0xa077('0x71')]['id'],_0x3c37cb[_0xa077('0x71')][_0xa077('0x3a')],_0x3c37cb[_0xa077('0x71')][_0xa077('0x8a')],_0x4e3db2[_0xa077('0x88')]['id'],_0x3c37cb[_0xa077('0x59')]?JSON[_0xa077('0x29')](_0x3c37cb[_0xa077('0x59')]):'null');return respondWithRpcPromise(_0xa077('0x8b'),_0xa077('0x8c'),_0x4e3db2);}return null;})['then'](function(_0x52d9c3){if(_0x52d9c3){if(_0x3c37cb['body'][_0xa077('0x8d')]){_0x4e3db2[_0xa077('0x2b')][_0xa077('0x8e')]=util[_0xa077('0x7d')]('SIP/%s',_0x3c37cb['user'][_0xa077('0x3a')]);_0x4e3db2['message'][_0xa077('0x8f')]=_0x4e3db2[_0xa077('0x8f')];_0x4e3db2[_0xa077('0x2b')][_0xa077('0x90')]=_0xa077('0x7f');return respondWithRpcPromise(_0xa077('0x91'),_0xa077('0x91'),{'event':_0xa077('0x92'),'message':_0x4e3db2[_0xa077('0x2b')]},client9002)[_0xa077('0x24')](function(){return _0x4e3db2;});}return _0x4e3db2;}return null;})['then'](respondWithResult(_0x2605d9,null))[_0xa077('0x2d')](handleError(_0x2605d9,null));};var interaction_log=require(_0xa077('0x7e'))(_0xa077('0x93'));exports['reject']=function(_0x37c428,_0x4c6cf5,_0x3f8fcf){var _0x12a4e6={'agent':{},'channel':'mail'};if(_0x37c428[_0xa077('0x59')]['id']){delete _0x37c428[_0xa077('0x59')]['id'];}_0x37c428[_0xa077('0x59')]['UserId']=_0x37c428['body'][_0xa077('0x83')]||_0x37c428[_0xa077('0x71')]['id'];_0x12a4e6[_0xa077('0x94')]['id']=_0x37c428[_0xa077('0x59')][_0xa077('0x83')];return db['MailMessage'][_0xa077('0x58')]({'where':{'id':_0x37c428['params']['id'],'UserId':null}})[_0xa077('0x24')](handleEntityNotFound(_0x4c6cf5,null))[_0xa077('0x24')](function(_0x5d39c8){if(_0x5d39c8){_0x12a4e6[_0xa077('0x2b')]=_0x5d39c8['get']({'plain':!![]});return db[_0xa077('0x95')][_0xa077('0x58')]({'where':{'id':_0x5d39c8['MailInteractionId']}});}return null;})[_0xa077('0x24')](handleEntityNotFound(_0x4c6cf5,null))[_0xa077('0x24')](function(_0x3f37b6){if(_0x3f37b6){_0x12a4e6[_0xa077('0x88')]=_0x3f37b6[_0xa077('0x85')]({'plain':!![]});interaction_log['info'](_0xa077('0x96'),_0x37c428[_0xa077('0x71')]['id'],_0x37c428[_0xa077('0x71')]['name'],_0x37c428[_0xa077('0x71')][_0xa077('0x8a')],_0x12a4e6['interaction']['id'],_0x37c428['body']?JSON[_0xa077('0x29')](_0x37c428[_0xa077('0x59')]):_0xa077('0x97'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x12a4e6);}return null;})[_0xa077('0x24')](function(_0xe189d7){if(_0xe189d7){_0xe189d7['message'][_0xa077('0x8e')]=util['format'](_0xa077('0x98'),_0x37c428[_0xa077('0x71')][_0xa077('0x3a')]);_0xe189d7[_0xa077('0x2b')][_0xa077('0x8f')]=_0x12a4e6[_0xa077('0x8f')];_0xe189d7[_0xa077('0x2b')]['event']=_0xa077('0x99');respondWithRpcPromise(_0xa077('0x91'),_0xa077('0x91'),{'event':_0xa077('0x9a'),'message':_0xe189d7[_0xa077('0x2b')]},client9002);return _0x12a4e6;}return null;})[_0xa077('0x24')](respondWithResult(_0x4c6cf5,null))[_0xa077('0x2d')](handleError(_0x4c6cf5,null));};exports[_0xa077('0x9b')]=function(_0x99631d,_0x20ba87){var _0x3a981f=moment()[_0xa077('0x9c')]()[_0xa077('0x9d')]();var _0x17b330=path['join'](config['root'],_0xa077('0x9e'),'files',_0xa077('0x9f'));var _0xfcf2b8=path['join'](config[_0xa077('0x75')],_0xa077('0x9e'),_0xa077('0xa0'),'attachments');var _0x42e548=util[_0xa077('0x7d')](_0xa077('0xa1'),_0x3a981f);return db[_0xa077('0x3d')]['find']({'where':{'id':_0x99631d['params']['id']},'attributes':['id',_0xa077('0x59'),_0xa077('0xa2'),'to','cc','bcc',_0xa077('0xa3'),_0xa077('0xa4')],'include':_0x99631d['query']['attachments']?[{'model':db[_0xa077('0xa5')],'as':_0xa077('0xa6')}]:undefined})[_0xa077('0x24')](handleEntityNotFound(_0x20ba87,null))[_0xa077('0x24')](function(_0x44e880){if(_0x44e880){var _0x185548=_0x44e880;var _0x9cfa22={'from':_0x185548[_0xa077('0xa2')],'to':_0x185548['to'],'subject':_0x185548[_0xa077('0xa3')],'html':_0x185548[_0xa077('0x59')],'headers':{'Date':moment(_0x185548[_0xa077('0xa4')])[_0xa077('0x7d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x44e880['cc']){_0x9cfa22[_0xa077('0xa7')]['Cc']=_0x44e880['cc'];}if(_0x44e880[_0xa077('0xa8')]){_0x9cfa22[_0xa077('0xa7')][_0xa077('0xa9')]=_0x44e880['bcc'];}return new BPromise(function(_0x20cb5d,_0x100bb3){if(_0x44e880[_0xa077('0xa6')]){for(var _0x150515=0x0;_0x150515<_0x44e880[_0xa077('0xa6')]['length'];_0x150515++){var _0xd6c7ee=_0x44e880[_0xa077('0xa6')][_0x150515];var _0x19d763=path['join'](_0xfcf2b8,_0xd6c7ee[_0xa077('0xaa')]);if(fs[_0xa077('0xab')](_0x19d763)){_0x9cfa22[_0xa077('0x73')]['push']({'name':_0xd6c7ee[_0xa077('0x3a')],'contentType':_0xd6c7ee[_0xa077('0x40')],'data':fs[_0xa077('0xac')](_0x19d763)});}}}emlformat[_0xa077('0xad')](_0x9cfa22,function(_0x42f377,_0x1f1728){if(_0x42f377)return _0x100bb3(_0x42f377);fs[_0xa077('0xae')](path[_0xa077('0x74')](_0x17b330,_0x42e548),_0x1f1728);return _0x20cb5d(_0x1f1728);});});}})['then'](function(_0x463448){if(_0x463448){return _0x20ba87[_0xa077('0x9b')](path['join'](_0x17b330,_0x42e548),_0x42e548,function(_0x1037eb){if(_0x1037eb){console[_0xa077('0xaf')](_0xa077('0xb0'),_0x1037eb);}else{fs[_0xa077('0xb1')](path[_0xa077('0x74')](_0x17b330,_0x42e548));}});}})[_0xa077('0x2d')](handleError(_0x20ba87,null));};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js
index 0fa33a7..dd8c17f 100644
--- a/server/api/mailMessage/mailMessage.events.js
+++ b/server/api/mailMessage/mailMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4284=['exports','events','../../mysqldb','MailMessage','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x596541,_0x3e674e){var _0x4e3383=function(_0x1c82a9){while(--_0x1c82a9){_0x596541['push'](_0x596541['shift']());}};_0x4e3383(++_0x3e674e);}(_0x4284,0x97));var _0x4428=function(_0x2cccbf,_0x3183bc){_0x2cccbf=_0x2cccbf-0x0;var _0x23e46e=_0x4284[_0x2cccbf];return _0x23e46e;};'use strict';var EventEmitter=require(_0x4428('0x0'));var MailMessage=require(_0x4428('0x1'))['db'][_0x4428('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4428('0x3'),'afterUpdate':_0x4428('0x4'),'afterDestroy':_0x4428('0x5')};function emitEvent(_0x248c78){return function(_0x4ac935,_0x1a7643,_0x3ccc94){MailMessageEvents[_0x4428('0x6')](_0x248c78+':'+_0x4ac935['id'],_0x4ac935);MailMessageEvents['emit'](_0x248c78,_0x4ac935);_0x3ccc94(null);};}for(var e in events){if(events[_0x4428('0x7')](e)){var event=events[e];MailMessage[_0x4428('0x8')](e,emitEvent(event));}}module[_0x4428('0x9')]=MailMessageEvents;
\ No newline at end of file
+var _0xbacb=['hook','exports','events','../../mysqldb','MailMessage','save','update','remove','hasOwnProperty'];(function(_0x40b8b8,_0x36e13c){var _0xcce78e=function(_0x1ac743){while(--_0x1ac743){_0x40b8b8['push'](_0x40b8b8['shift']());}};_0xcce78e(++_0x36e13c);}(_0xbacb,0x161));var _0xbbac=function(_0x5965f5,_0x95248f){_0x5965f5=_0x5965f5-0x0;var _0x3a84d3=_0xbacb[_0x5965f5];return _0x3a84d3;};'use strict';var EventEmitter=require(_0xbbac('0x0'));var MailMessage=require(_0xbbac('0x1'))['db'][_0xbbac('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbbac('0x3'),'afterUpdate':_0xbbac('0x4'),'afterDestroy':_0xbbac('0x5')};function emitEvent(_0x4f0886){return function(_0x244bba,_0x3f5ee7,_0x45aa01){MailMessageEvents['emit'](_0x4f0886+':'+_0x244bba['id'],_0x244bba);MailMessageEvents['emit'](_0x4f0886,_0x244bba);_0x45aa01(null);};}for(var e in events){if(events[_0xbbac('0x6')](e)){var event=events[e];MailMessage[_0xbbac('0x7')](e,emitEvent(event));}}module[_0xbbac('0x8')]=MailMessageEvents;
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js
index 16ab0cb..1ab9e93 100644
--- a/server/api/mailMessage/mailMessage.model.js
+++ b/server/api/mailMessage/mailMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ce3=['fti_mail_messages','plainBody','subject','fromString','models','toLowerCase','direction','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','createdAt','body','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId'];(function(_0x5828d0,_0x2c3e93){var _0x239b02=function(_0x702fe4){while(--_0x702fe4){_0x5828d0['push'](_0x5828d0['shift']());}};_0x239b02(++_0x2c3e93);}(_0x2ce3,0x98));var _0x32ce=function(_0x7d5b36,_0x6c122a){_0x7d5b36=_0x7d5b36-0x0;var _0x10b0fb=_0x2ce3[_0x7d5b36];return _0x10b0fb;};'use strict';var _=require(_0x32ce('0x0'));var util=require('util');var logger=require(_0x32ce('0x1'))(_0x32ce('0x2'));var moment=require(_0x32ce('0x3'));var BPromise=require(_0x32ce('0x4'));var rp=require(_0x32ce('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x32ce('0x6'));var rimraf=require('rimraf');var config=require(_0x32ce('0x7'));var attributes=require(_0x32ce('0x8'));module[_0x32ce('0x9')]=function(_0xe65493,_0x292d25){return _0xe65493['define'](_0x32ce('0xa'),attributes,{'tableName':_0x32ce('0xb'),'paranoid':![],'indexes':[{'name':_0x32ce('0xc'),'fields':['messageId']},{'name':_0x32ce('0xd'),'fields':[_0x32ce('0xe'),_0x32ce('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3193bb,_0x3ac3be,_0x241cb4){if(_0x3193bb['body']){_0x3193bb[_0x32ce('0xe')]=htmlToText[_0x32ce('0x10')](_0x3193bb['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x241cb4(null,_0x3ac3be);},'afterCreate':function(_0x2f651d,_0x356be8,_0xb52ba5){var _0x2baaea=_0xe65493[_0x32ce('0x11')];var _0x50ad55=_0x2f651d['get']({'plain':!![]});if(_0x50ad55['direction'][_0x32ce('0x12')]()==='in'||_0x50ad55[_0x32ce('0x13')][_0x32ce('0x12')]()===_0x32ce('0x14')&&!_0x50ad55[_0x32ce('0x15')]&&!_[_0x32ce('0x16')](_0x50ad55[_0x32ce('0x17')])){_0x2baaea[_0x32ce('0x18')][_0x32ce('0x19')]({'where':{'id':_0x50ad55[_0x32ce('0x1a')]}})['then'](function(_0xfcce56){if(_0xfcce56){_0xfcce56['update']({'lastMsgAt':_0x50ad55[_0x32ce('0x1b')],'lastMsgDirection':_0x50ad55[_0x32ce('0x13')][_0x32ce('0x12')](),'lastMsgBody':_0x50ad55[_0x32ce('0x1c')]});}})[_0x32ce('0x1d')](function(_0x5e3812){console[_0x32ce('0x1e')](_0x5e3812);});}_0xb52ba5();}},'charset':_0x32ce('0x1f'),'collate':_0x32ce('0x20')});};
\ No newline at end of file
+var _0x33dd=['body','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','./mailMessage.attributes','exports','define','MailMessage','mail_messages','fti_mail_messages','plainBody','subject','FULLTEXT'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x33dd,0x1de));var _0xd33d=function(_0x192590,_0x11d5d0){_0x192590=_0x192590-0x0;var _0x4692c5=_0x33dd[_0x192590];return _0x4692c5;};'use strict';var _=require(_0xd33d('0x0'));var util=require(_0xd33d('0x1'));var logger=require(_0xd33d('0x2'))(_0xd33d('0x3'));var moment=require(_0xd33d('0x4'));var BPromise=require(_0xd33d('0x5'));var rp=require(_0xd33d('0x6'));var htmlToText=require(_0xd33d('0x7'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd33d('0x8'));module[_0xd33d('0x9')]=function(_0x6cc0db,_0xcc04e3){return _0x6cc0db[_0xd33d('0xa')](_0xd33d('0xb'),attributes,{'tableName':_0xd33d('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xd33d('0xd'),'fields':[_0xd33d('0xe'),_0xd33d('0xf')],'type':_0xd33d('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a8703,_0x49496c,_0x26c388){if(_0x4a8703[_0xd33d('0x11')]){_0x4a8703[_0xd33d('0xe')]=htmlToText['fromString'](_0x4a8703[_0xd33d('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x26c388(null,_0x49496c);},'afterCreate':function(_0x1446df,_0x4e56dc,_0x21dfac){var _0x15d08c=_0x6cc0db[_0xd33d('0x12')];var _0x304cf8=_0x1446df[_0xd33d('0x13')]({'plain':!![]});if(_0x304cf8[_0xd33d('0x14')][_0xd33d('0x15')]()==='in'||_0x304cf8[_0xd33d('0x14')][_0xd33d('0x15')]()==='out'&&!_0x304cf8[_0xd33d('0x16')]&&!_[_0xd33d('0x17')](_0x304cf8[_0xd33d('0x18')])){_0x15d08c[_0xd33d('0x19')][_0xd33d('0x1a')]({'where':{'id':_0x304cf8[_0xd33d('0x1b')]}})[_0xd33d('0x1c')](function(_0x39264d){if(_0x39264d){_0x39264d[_0xd33d('0x1d')]({'lastMsgAt':_0x304cf8[_0xd33d('0x1e')],'lastMsgDirection':_0x304cf8[_0xd33d('0x14')][_0xd33d('0x15')](),'lastMsgBody':_0x304cf8[_0xd33d('0x11')]});}})[_0xd33d('0x1f')](function(_0x1f3393){console['error'](_0x1f3393);});}_0x21dfac();}},'charset':'utf8mb4','collate':_0xd33d('0x20')});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js
index 5c4c000..b7daf16 100644
--- a/server/api/mailMessage/mailMessage.rpc.js
+++ b/server/api/mailMessage/mailMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x044a=['localhost','socket.io-emitter','register','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','CreateMailMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x5502f2,_0x19801e){var _0x2d829d=function(_0xfc4bfe){while(--_0xfc4bfe){_0x5502f2['push'](_0x5502f2['shift']());}};_0x2d829d(++_0x19801e);}(_0x044a,0x173));var _0xa044=function(_0x12726e,_0x927169){_0x12726e=_0x12726e-0x0;var _0x5f1375=_0x044a[_0x12726e];return _0x5f1375;};'use strict';var _=require(_0xa044('0x0'));var util=require(_0xa044('0x1'));var moment=require(_0xa044('0x2'));var BPromise=require(_0xa044('0x3'));var rs=require(_0xa044('0x4'));var fs=require('fs');var Redis=require(_0xa044('0x5'));var db=require(_0xa044('0x6'))['db'];var utils=require(_0xa044('0x7'));var logger=require(_0xa044('0x8'))(_0xa044('0x9'));var config=require('../../config/environment');var jayson=require(_0xa044('0xa'));var client=jayson[_0xa044('0xb')][_0xa044('0xc')]({'port':0x232a});config[_0xa044('0xd')]=_['defaults'](config[_0xa044('0xd')],{'host':_0xa044('0xe'),'port':0x18eb});var socket=require(_0xa044('0xf'))(new Redis(config[_0xa044('0xd')]));require('./mailMessage.socket')[_0xa044('0x10')](socket);function respondWithRpcPromise(_0x9dec14,_0x3f170b,_0x47a9dc){return new BPromise(function(_0xdf14f6,_0xa3b07f){return client[_0xa044('0x11')](_0x9dec14,_0x47a9dc)[_0xa044('0x12')](function(_0x5e203d){logger[_0xa044('0x13')]('MailMessage,\x20%s,\x20%s',_0x3f170b,'request\x20sent');logger[_0xa044('0x14')](_0xa044('0x15'),_0x3f170b,_0xa044('0x16'),JSON[_0xa044('0x17')](_0x5e203d));if(_0x5e203d[_0xa044('0x18')]){if(_0x5e203d[_0xa044('0x18')][_0xa044('0x19')]===0x1f4){logger['error'](_0xa044('0x1a'),_0x3f170b,_0x5e203d['error'][_0xa044('0x1b')]);return _0xa3b07f(_0x5e203d[_0xa044('0x18')][_0xa044('0x1b')]);}logger[_0xa044('0x18')](_0xa044('0x1a'),_0x3f170b,_0x5e203d['error']['message']);return _0xdf14f6(_0x5e203d[_0xa044('0x18')]['message']);}else{logger[_0xa044('0x13')](_0xa044('0x1a'),_0x3f170b,_0xa044('0x16'));_0xdf14f6(_0x5e203d[_0xa044('0x1c')][_0xa044('0x1b')]);}})['catch'](function(_0x567124){logger['error'](_0xa044('0x1a'),_0x3f170b,_0x567124);_0xa3b07f(_0x567124);});});}exports[_0xa044('0x1d')]=function(_0x273f06){var _0x537bbb=this;return new Promise(function(_0x2092d4,_0x19854d){return db['MailMessage'][_0xa044('0x1e')](_0x273f06[_0xa044('0x1f')],{'raw':_0x273f06[_0xa044('0x20')]?_0x273f06['options'][_0xa044('0x21')]===undefined?!![]:![]:!![]})[_0xa044('0x12')](function(_0x26747b){logger[_0xa044('0x13')](_0xa044('0x1d'),_0x273f06);logger[_0xa044('0x14')](_0xa044('0x1d'),_0x273f06,JSON[_0xa044('0x17')](_0x26747b));_0x2092d4(_0x26747b);})[_0xa044('0x22')](function(_0x57ecd2){logger['error'](_0xa044('0x1d'),_0x57ecd2[_0xa044('0x1b')],_0x273f06);_0x19854d(_0x537bbb[_0xa044('0x18')](0x1f4,_0x57ecd2['message']));});});};
\ No newline at end of file
+var _0xc1c6=['defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x166ef8,_0x4d1b45){_0x166ef8=_0x166ef8-0x0;var _0x26feab=_0xc1c6[_0x166ef8];return _0x26feab;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});config['redis']=_[_0x6c1c('0x9')](config[_0x6c1c('0xa')],{'host':_0x6c1c('0xb'),'port':0x18eb});var socket=require(_0x6c1c('0xc'))(new Redis(config['redis']));require(_0x6c1c('0xd'))[_0x6c1c('0xe')](socket);function respondWithRpcPromise(_0x524d21,_0x147c7b,_0x36275f){return new BPromise(function(_0xb3bd12,_0x1137e8){return client['request'](_0x524d21,_0x36275f)[_0x6c1c('0xf')](function(_0x2a4fd4){logger[_0x6c1c('0x10')]('MailMessage,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));logger[_0x6c1c('0x12')](_0x6c1c('0x13'),_0x147c7b,'request\x20sent',JSON[_0x6c1c('0x14')](_0x2a4fd4));if(_0x2a4fd4['error']){if(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x16')]===0x1f4){logger[_0x6c1c('0x15')](_0x6c1c('0x17'),_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0x1137e8(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);}logger[_0x6c1c('0x15')]('MailMessage,\x20%s,\x20%s',_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0xb3bd12(_0x2a4fd4['error'][_0x6c1c('0x18')]);}else{logger[_0x6c1c('0x10')]('MailMessage,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));_0xb3bd12(_0x2a4fd4['result'][_0x6c1c('0x18')]);}})[_0x6c1c('0x19')](function(_0x5a3bb7){logger[_0x6c1c('0x15')]('MailMessage,\x20%s,\x20%s',_0x147c7b,_0x5a3bb7);_0x1137e8(_0x5a3bb7);});});}exports[_0x6c1c('0x1a')]=function(_0x3527bf){var _0x23470e=this;return new Promise(function(_0x211f49,_0x1acf7f){return db[_0x6c1c('0x1b')][_0x6c1c('0x1c')](_0x3527bf[_0x6c1c('0x1d')],{'raw':_0x3527bf[_0x6c1c('0x1e')]?_0x3527bf[_0x6c1c('0x1e')][_0x6c1c('0x1f')]===undefined?!![]:![]:!![]})[_0x6c1c('0xf')](function(_0x2382c0){logger[_0x6c1c('0x10')](_0x6c1c('0x1a'),_0x3527bf);logger[_0x6c1c('0x12')](_0x6c1c('0x1a'),_0x3527bf,JSON[_0x6c1c('0x14')](_0x2382c0));_0x211f49(_0x2382c0);})[_0x6c1c('0x19')](function(_0x1dba08){logger[_0x6c1c('0x15')](_0x6c1c('0x1a'),_0x1dba08[_0x6c1c('0x18')],_0x3527bf);_0x1acf7f(_0x23470e[_0x6c1c('0x15')](0x1f4,_0x1dba08[_0x6c1c('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js
index 534cb77..19b0a70 100644
--- a/server/api/mailMessage/mailMessage.socket.js
+++ b/server/api/mailMessage/mailMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe91f=['removeListener','length','mailMessage:','./mailMessage.events','save','update','emit'];(function(_0xf0d5b4,_0x3f480c){var _0x802fe2=function(_0x23e787){while(--_0x23e787){_0xf0d5b4['push'](_0xf0d5b4['shift']());}};_0x802fe2(++_0x3f480c);}(_0xe91f,0xf8));var _0xfe91=function(_0x1b4a6d,_0xf21f05){_0x1b4a6d=_0x1b4a6d-0x0;var _0x31ec4d=_0xe91f[_0x1b4a6d];return _0x31ec4d;};'use strict';var MailMessageEvents=require(_0xfe91('0x0'));var events=[_0xfe91('0x1'),'remove',_0xfe91('0x2')];function createListener(_0x569a3b,_0x2d3127){return function(_0x219329){_0x2d3127[_0xfe91('0x3')](_0x569a3b,_0x219329);};}function removeListener(_0x5c60b3,_0xa43e10){return function(){MailMessageEvents[_0xfe91('0x4')](_0x5c60b3,_0xa43e10);};}exports['register']=function(_0x59a492){for(var _0x4ab544=0x0,_0xed1057=events[_0xfe91('0x5')];_0x4ab544<_0xed1057;_0x4ab544++){var _0x249be6=events[_0x4ab544];var _0x5e35ae=createListener(_0xfe91('0x6')+_0x249be6,_0x59a492);MailMessageEvents['on'](_0x249be6,_0x5e35ae);}};
\ No newline at end of file
+var _0x4c95=['./mailMessage.events','save','remove','update','emit','register','length','mailMessage:'];(function(_0x4cd52a,_0x214f92){var _0x201620=function(_0xe33ad5){while(--_0xe33ad5){_0x4cd52a['push'](_0x4cd52a['shift']());}};_0x201620(++_0x214f92);}(_0x4c95,0x180));var _0x54c9=function(_0x559275,_0x23139f){_0x559275=_0x559275-0x0;var _0x1406a0=_0x4c95[_0x559275];return _0x1406a0;};'use strict';var MailMessageEvents=require(_0x54c9('0x0'));var events=[_0x54c9('0x1'),_0x54c9('0x2'),_0x54c9('0x3')];function createListener(_0x351676,_0x1f5eac){return function(_0x7f8896){_0x1f5eac[_0x54c9('0x4')](_0x351676,_0x7f8896);};}function removeListener(_0x1a37fb,_0x3a6cb8){return function(){MailMessageEvents['removeListener'](_0x1a37fb,_0x3a6cb8);};}exports[_0x54c9('0x5')]=function(_0x558793){for(var _0x4fa817=0x0,_0x1ff118=events[_0x54c9('0x6')];_0x4fa817<_0x1ff118;_0x4fa817++){var _0x7a09d2=events[_0x4fa817];var _0x3ec5df=createListener(_0x54c9('0x7')+_0x7a09d2,_0x558793);MailMessageEvents['on'](_0x7a09d2,_0x3ec5df);}};
\ No newline at end of file
diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js
index 01d5c6e..578ac87 100644
--- a/server/api/mailQueue/index.js
+++ b/server/api/mailQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9375=['../../components/interaction/service','./mailQueue.controller','index','get','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x52d120,_0x490293){var _0x2b37f1=function(_0x372019){while(--_0x372019){_0x52d120['push'](_0x52d120['shift']());}};_0x2b37f1(++_0x490293);}(_0x9375,0xc3));var _0x5937=function(_0x460ad7,_0x21ac08){_0x460ad7=_0x460ad7-0x0;var _0x25bd94=_0x9375[_0x460ad7];return _0x25bd94;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5937('0x0'));var timeout=require(_0x5937('0x1'));var express=require(_0x5937('0x2'));var router=express[_0x5937('0x3')]();var auth=require(_0x5937('0x4'));var interaction=require(_0x5937('0x5'));var config=require('../../config/environment');var controller=require(_0x5937('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x5937('0x7')]);router[_0x5937('0x8')]('/describe',auth[_0x5937('0x9')](),controller['describe']);router[_0x5937('0x8')](_0x5937('0xa'),auth[_0x5937('0x9')](),controller[_0x5937('0xb')]);router[_0x5937('0x8')](_0x5937('0xc'),auth[_0x5937('0x9')](),controller[_0x5937('0xd')]);router['get'](_0x5937('0xe'),auth['isAuthenticated'](),controller['getTeams']);router[_0x5937('0x8')](_0x5937('0xf'),auth['isAuthenticated'](),controller[_0x5937('0x10')]);router[_0x5937('0x11')]('/',auth['isAuthenticated'](),controller[_0x5937('0x12')]);router[_0x5937('0x11')](_0x5937('0xe'),auth['isAuthenticated'](),controller[_0x5937('0x13')]);router[_0x5937('0x11')](_0x5937('0xf'),auth[_0x5937('0x9')](),controller[_0x5937('0x14')]);router[_0x5937('0x15')]('/:id',auth[_0x5937('0x9')](),controller['update']);router[_0x5937('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5937('0x17')]);router[_0x5937('0x16')](_0x5937('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x5937('0x16')](_0x5937('0xf'),auth[_0x5937('0x9')](),controller['removeAgents']);module[_0x5937('0x18')]=router;
\ No newline at end of file
+var _0xd6f0=['delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','create','post','addTeams','put'];(function(_0x17ff87,_0x43c35d){var _0x3d01d0=function(_0x1e25d2){while(--_0x1e25d2){_0x17ff87['push'](_0x17ff87['shift']());}};_0x3d01d0(++_0x43c35d);}(_0xd6f0,0xd5));var _0x0d6f=function(_0x215250,_0x584168){_0x215250=_0x215250-0x0;var _0x22777b=_0xd6f0[_0x215250];return _0x22777b;};'use strict';var multer=require(_0x0d6f('0x0'));var util=require(_0x0d6f('0x1'));var path=require(_0x0d6f('0x2'));var timeout=require(_0x0d6f('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0d6f('0x4'));var controller=require(_0x0d6f('0x5'));router[_0x0d6f('0x6')]('/',auth[_0x0d6f('0x7')](),controller[_0x0d6f('0x8')]);router['get'](_0x0d6f('0x9'),auth[_0x0d6f('0x7')](),controller[_0x0d6f('0xa')]);router[_0x0d6f('0x6')](_0x0d6f('0xb'),auth[_0x0d6f('0x7')](),controller[_0x0d6f('0xc')]);router[_0x0d6f('0x6')](_0x0d6f('0xd'),auth[_0x0d6f('0x7')](),controller[_0x0d6f('0xe')]);router[_0x0d6f('0x6')](_0x0d6f('0xf'),auth['isAuthenticated'](),controller[_0x0d6f('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x0d6f('0x11')]);router[_0x0d6f('0x12')]('/:id/teams',auth[_0x0d6f('0x7')](),controller[_0x0d6f('0x13')]);router['post']('/:id/users',auth[_0x0d6f('0x7')](),controller['addAgents']);router[_0x0d6f('0x14')](_0x0d6f('0xb'),auth[_0x0d6f('0x7')](),controller['update']);router[_0x0d6f('0x15')](_0x0d6f('0xb'),auth[_0x0d6f('0x7')](),controller[_0x0d6f('0x16')]);router[_0x0d6f('0x15')](_0x0d6f('0xf'),auth[_0x0d6f('0x7')](),controller[_0x0d6f('0x17')]);router[_0x0d6f('0x15')]('/:id/users',auth[_0x0d6f('0x7')](),controller[_0x0d6f('0x18')]);module[_0x0d6f('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js
index 69fd3f3..3cc3abb 100644
--- a/server/api/mailQueue/mailQueue.attributes.js
+++ b/server/api/mailQueue/mailQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe2ea=['exports','STRING','name','INTEGER','rrmemory','beepall','sequelize'];(function(_0x5921a5,_0x69c710){var _0x53e882=function(_0x3d7706){while(--_0x3d7706){_0x5921a5['push'](_0x5921a5['shift']());}};_0x53e882(++_0x69c710);}(_0xe2ea,0xc3));var _0xae2e=function(_0x264dc3,_0x118bae){_0x264dc3=_0x264dc3-0x0;var _0x1f80b5=_0xe2ea[_0x264dc3];return _0x1f80b5;};'use strict';var Sequelize=require(_0xae2e('0x0'));module[_0xae2e('0x1')]={'name':{'type':Sequelize[_0xae2e('0x2')],'unique':_0xae2e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xae2e('0x2')]},'timeout':{'type':Sequelize[_0xae2e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xae2e('0x5'),_0xae2e('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0x94ff=['ENUM','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x1783fb,_0xa95539){var _0x45f883=function(_0x9cce73){while(--_0x9cce73){_0x1783fb['push'](_0x1783fb['shift']());}};_0x45f883(++_0xa95539);}(_0x94ff,0xc3));var _0xf94f=function(_0x4510b8,_0x49b6c3){_0x4510b8=_0x4510b8-0x0;var _0x222db7=_0x94ff[_0x4510b8];return _0x222db7;};'use strict';var Sequelize=require(_0xf94f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf94f('0x1')]},'timeout':{'type':Sequelize[_0xf94f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf94f('0x3')]('rrmemory',_0xf94f('0x4'),_0xf94f('0x5'))}};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js
index cf11796..7c65918 100644
--- a/server/api/mailQueue/mailQueue.controller.js
+++ b/server/api/mailQueue/mailQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x41c6=['update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','index','map','MailQueue','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','params','intersection','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','MailQueueId','UserMailQueue','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','createdAt','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','Team','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','removeAgents','userMailQueue:remove','omit','userMailQueue:save','isArray','findOne','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','end','status','json','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x4818c4,_0x349b68){var _0x49fa3d=function(_0x2eae0b){while(--_0x2eae0b){_0x4818c4['push'](_0x4818c4['shift']());}};_0x49fa3d(++_0x349b68);}(_0x41c6,0xf6));var _0x641c=function(_0x1b6382,_0x135c26){_0x1b6382=_0x1b6382-0x0;var _0x46d1d2=_0x41c6[_0x1b6382];return _0x46d1d2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x641c('0x0'));var rimraf=require(_0x641c('0x1'));var zipdir=require(_0x641c('0x2'));var jsonpatch=require(_0x641c('0x3'));var rp=require(_0x641c('0x4'));var moment=require(_0x641c('0x5'));var BPromise=require(_0x641c('0x6'));var Mustache=require(_0x641c('0x7'));var util=require(_0x641c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x641c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x641c('0xa'));var squel=require(_0x641c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x641c('0xc'));var toCsv=require(_0x641c('0x9'));var querystring=require(_0x641c('0xd'));var Papa=require('papaparse');var Redis=require(_0x641c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x641c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x641c('0x10'));var logger=require(_0x641c('0x11'))(_0x641c('0x12'));var utils=require(_0x641c('0x13'));var config=require(_0x641c('0x14'));var db=require(_0x641c('0x15'))['db'];config['redis']=_[_0x641c('0x16')](config[_0x641c('0x17')],{'host':_0x641c('0x18'),'port':0x18eb});var socket=require(_0x641c('0x19'))(new Redis(config[_0x641c('0x17')]));require(_0x641c('0x1a'))[_0x641c('0x1b')](socket);function respondWithStatusCode(_0x1730ec,_0x1a5ff3){_0x1a5ff3=_0x1a5ff3||0xcc;return function(_0xa9178e){if(_0xa9178e){return _0x1730ec['sendStatus'](_0x1a5ff3);}return _0x1730ec['status'](_0x1a5ff3)[_0x641c('0x1c')]();};}function respondWithResult(_0x5f0da0,_0x46c3d0){_0x46c3d0=_0x46c3d0||0xc8;return function(_0xd31419){if(_0xd31419){return _0x5f0da0[_0x641c('0x1d')](_0x46c3d0)[_0x641c('0x1e')](_0xd31419);}};}function respondWithFilteredResult(_0x28b4a8,_0x18b255){return function(_0x55487a){if(_0x55487a){var _0x2dd121=_0x55487a['count'],_0x8e062e=_0x18b255[_0x641c('0x1f')],_0x2df4a5=_0x18b255[_0x641c('0x1f')]+_0x18b255[_0x641c('0x20')],_0x39193b;if(_0x2df4a5>=_0x2dd121){_0x2df4a5=_0x2dd121;_0x39193b=0xc8;}else{_0x39193b=0xce;}_0x28b4a8[_0x641c('0x1d')](_0x39193b);return _0x28b4a8[_0x641c('0x21')](_0x641c('0x22'),_0x8e062e+'-'+_0x2df4a5+'/'+_0x2dd121)[_0x641c('0x1e')](_0x55487a);}return null;};}function patchUpdates(_0x2d9c35){return function(_0x42b1f9){try{jsonpatch[_0x641c('0x23')](_0x42b1f9,_0x2d9c35,!![]);}catch(_0x3e5154){return BPromise[_0x641c('0x24')](_0x3e5154);}return _0x42b1f9[_0x641c('0x25')]();};}function saveUpdates(_0x4cf9b2,_0x1e426e){return function(_0xbe5c59){if(_0xbe5c59){return _0xbe5c59[_0x641c('0x26')](_0x4cf9b2)[_0x641c('0x27')](function(_0x3b8119){return _0x3b8119;});}return null;};}function removeEntity(_0x402abb,_0x340f5b){return function(_0x31e68a){if(_0x31e68a){return _0x31e68a[_0x641c('0x28')]()['then'](function(){var _0x5c5c54=_0x31e68a[_0x641c('0x29')]({'plain':!![]});var _0x156366=_0x641c('0x2a');return db[_0x641c('0x2b')][_0x641c('0x28')]({'where':{'type':_0x156366,'resourceId':_0x5c5c54['id']}})['then'](function(){return _0x31e68a;});})[_0x641c('0x27')](function(){_0x402abb['status'](0xcc)[_0x641c('0x1c')]();});}};}function handleEntityNotFound(_0x5f259e,_0x29ab1a){return function(_0x49fd96){if(!_0x49fd96){_0x5f259e[_0x641c('0x2c')](0x194);}return _0x49fd96;};}function handleError(_0x3b7f05,_0x325258){_0x325258=_0x325258||0x1f4;return function(_0xf5ea5f){logger[_0x641c('0x2d')](_0xf5ea5f[_0x641c('0x2e')]);if(_0xf5ea5f['name']){delete _0xf5ea5f[_0x641c('0x2f')];}_0x3b7f05[_0x641c('0x1d')](_0x325258)['send'](_0xf5ea5f);};}exports[_0x641c('0x30')]=function(_0x457bac,_0x155d5e){var _0x59c246={},_0x373cb7={},_0x130e07={'count':0x0,'rows':[]};var _0x27e34f=_[_0x641c('0x31')](db[_0x641c('0x32')]['rawAttributes'],function(_0x4f852c){return{'name':_0x4f852c['fieldName'],'type':_0x4f852c[_0x641c('0x33')][_0x641c('0x34')]};});_0x373cb7[_0x641c('0x35')]=_[_0x641c('0x31')](_0x27e34f,'name');_0x373cb7[_0x641c('0x36')]=_[_0x641c('0x37')](_0x457bac[_0x641c('0x36')]);_0x373cb7[_0x641c('0x38')]=_['intersection'](_0x373cb7[_0x641c('0x35')],_0x373cb7['query']);_0x59c246[_0x641c('0x39')]=_['intersection'](_0x373cb7[_0x641c('0x35')],qs[_0x641c('0x3a')](_0x457bac['query'][_0x641c('0x3a')]));_0x59c246['attributes']=_0x59c246[_0x641c('0x39')][_0x641c('0x3b')]?_0x59c246[_0x641c('0x39')]:_0x373cb7[_0x641c('0x35')];if(!_0x457bac['query'][_0x641c('0x3c')](_0x641c('0x3d'))){_0x59c246['limit']=qs[_0x641c('0x20')](_0x457bac[_0x641c('0x36')]['limit']);_0x59c246[_0x641c('0x1f')]=qs[_0x641c('0x1f')](_0x457bac[_0x641c('0x36')][_0x641c('0x1f')]);}_0x59c246[_0x641c('0x3e')]=qs[_0x641c('0x3f')](_0x457bac[_0x641c('0x36')][_0x641c('0x3f')]);_0x59c246[_0x641c('0x40')]=qs[_0x641c('0x38')](_[_0x641c('0x41')](_0x457bac[_0x641c('0x36')],_0x373cb7[_0x641c('0x38')]),_0x27e34f);if(_0x457bac[_0x641c('0x36')][_0x641c('0x42')]){_0x59c246[_0x641c('0x40')]=_[_0x641c('0x43')](_0x59c246['where'],{'$or':_[_0x641c('0x31')](_0x27e34f,function(_0x5969c3){if(_0x5969c3['type']!==_0x641c('0x44')){var _0x3d3488={};_0x3d3488[_0x5969c3[_0x641c('0x2f')]]={'$like':'%'+_0x457bac[_0x641c('0x36')][_0x641c('0x42')]+'%'};return _0x3d3488;}})});}_0x59c246=_[_0x641c('0x43')]({},_0x59c246,_0x457bac[_0x641c('0x45')]);var _0x548448={'where':_0x59c246['where']};return db['MailQueue'][_0x641c('0x46')](_0x548448)[_0x641c('0x27')](function(_0xb6637b){_0x130e07[_0x641c('0x46')]=_0xb6637b;if(_0x457bac[_0x641c('0x36')]['includeAll']){_0x59c246[_0x641c('0x47')]=[{'all':!![]}];}return db['MailQueue'][_0x641c('0x48')](_0x59c246);})[_0x641c('0x27')](function(_0x57afd8){_0x130e07[_0x641c('0x49')]=_0x57afd8;return _0x130e07;})[_0x641c('0x27')](respondWithFilteredResult(_0x155d5e,_0x59c246))[_0x641c('0x4a')](handleError(_0x155d5e,null));};exports['show']=function(_0x2cf4fa,_0x4fab78){var _0xe31a5d={'raw':!![],'where':{'id':_0x2cf4fa[_0x641c('0x4b')]['id']}},_0x4b96b4={};_0x4b96b4[_0x641c('0x35')]=_[_0x641c('0x37')](db['MailQueue']['rawAttributes']);_0x4b96b4['query']=_[_0x641c('0x37')](_0x2cf4fa['query']);_0x4b96b4[_0x641c('0x38')]=_[_0x641c('0x4c')](_0x4b96b4['model'],_0x4b96b4[_0x641c('0x36')]);_0xe31a5d[_0x641c('0x39')]=_[_0x641c('0x4c')](_0x4b96b4[_0x641c('0x35')],qs['fields'](_0x2cf4fa[_0x641c('0x36')][_0x641c('0x3a')]));_0xe31a5d[_0x641c('0x39')]=_0xe31a5d[_0x641c('0x39')]['length']?_0xe31a5d[_0x641c('0x39')]:_0x4b96b4[_0x641c('0x35')];if(_0x2cf4fa[_0x641c('0x36')][_0x641c('0x4d')]){_0xe31a5d[_0x641c('0x47')]=[{'all':!![]}];}_0xe31a5d=_[_0x641c('0x43')]({},_0xe31a5d,_0x2cf4fa[_0x641c('0x45')]);return db[_0x641c('0x32')]['find'](_0xe31a5d)[_0x641c('0x27')](handleEntityNotFound(_0x4fab78,null))[_0x641c('0x27')](respondWithResult(_0x4fab78,null))[_0x641c('0x4a')](handleError(_0x4fab78,null));};exports[_0x641c('0x4e')]=function(_0x1fb60f,_0x4f7ca2){return db[_0x641c('0x32')][_0x641c('0x4e')](_0x1fb60f[_0x641c('0x4f')],{})[_0x641c('0x27')](function(_0x168350){var _0x58a228=_0x1fb60f[_0x641c('0x50')][_0x641c('0x29')]({'plain':!![]});if(!_0x58a228)throw new Error(_0x641c('0x51'));if(_0x58a228[_0x641c('0x52')]===_0x641c('0x50')){var _0x5aef85=_0x168350[_0x641c('0x29')]({'plain':!![]});var _0x554b04=_0x641c('0x2a');return db[_0x641c('0x53')][_0x641c('0x54')]({'where':{'name':_0x554b04,'userProfileId':_0x58a228['userProfileId']},'raw':!![]})[_0x641c('0x27')](function(_0x4de2e8){if(_0x4de2e8&&_0x4de2e8[_0x641c('0x55')]===0x0){return db[_0x641c('0x2b')][_0x641c('0x4e')]({'name':_0x5aef85[_0x641c('0x2f')],'resourceId':_0x5aef85['id'],'type':_0x4de2e8[_0x641c('0x2f')],'sectionId':_0x4de2e8['id']},{})[_0x641c('0x27')](function(){return _0x168350;});}else{return _0x168350;}})[_0x641c('0x4a')](function(_0x1e6ca6){logger[_0x641c('0x2d')](_0x641c('0x56'),_0x1e6ca6);throw _0x1e6ca6;});}return _0x168350;})[_0x641c('0x27')](respondWithResult(_0x4f7ca2,0xc9))[_0x641c('0x4a')](handleError(_0x4f7ca2,null));};exports[_0x641c('0x26')]=function(_0x10e258,_0x55055b){if(_0x10e258[_0x641c('0x4f')]['id']){delete _0x10e258[_0x641c('0x4f')]['id'];}return db[_0x641c('0x32')][_0x641c('0x54')]({'where':{'id':_0x10e258['params']['id']}})[_0x641c('0x27')](handleEntityNotFound(_0x55055b,null))[_0x641c('0x27')](saveUpdates(_0x10e258[_0x641c('0x4f')],null))[_0x641c('0x27')](respondWithResult(_0x55055b,null))[_0x641c('0x4a')](handleError(_0x55055b,null));};exports[_0x641c('0x28')]=function(_0x362cd7,_0x17307b){return db['MailQueue'][_0x641c('0x54')]({'where':{'id':_0x362cd7[_0x641c('0x4b')]['id']}})[_0x641c('0x27')](handleEntityNotFound(_0x17307b,null))[_0x641c('0x27')](removeEntity(_0x17307b,null))[_0x641c('0x4a')](handleError(_0x17307b,null));};exports[_0x641c('0x57')]=function(_0x31171d,_0x7a7313){return db[_0x641c('0x32')][_0x641c('0x57')]()[_0x641c('0x27')](respondWithResult(_0x7a7313,null))[_0x641c('0x4a')](handleError(_0x7a7313,null));};exports[_0x641c('0x58')]=function(_0x2aace3,_0x4386b4,_0x3b2dbc){var _0x34fe91={'raw':!![],'where':{}},_0x33dc2a={},_0x4039ca;return db['MailQueue']['findOne']({'where':{'id':_0x2aace3[_0x641c('0x4b')]['id']}})[_0x641c('0x27')](handleEntityNotFound(_0x4386b4,null))['then'](function(_0x52872a){if(_0x52872a){_0x4039ca=_0x52872a['get']({'plain':!![]});_0x33dc2a[_0x641c('0x35')]=_[_0x641c('0x37')](db['UserMailQueue']['rawAttributes']);_0x33dc2a[_0x641c('0x36')]=_[_0x641c('0x37')](_0x2aace3[_0x641c('0x36')]);_0x33dc2a[_0x641c('0x38')]=_[_0x641c('0x4c')](_0x33dc2a[_0x641c('0x35')],_0x33dc2a[_0x641c('0x36')]);_0x34fe91[_0x641c('0x39')]=_['intersection'](_0x33dc2a[_0x641c('0x35')],qs[_0x641c('0x3a')](_0x2aace3[_0x641c('0x36')][_0x641c('0x3a')]));_0x34fe91[_0x641c('0x39')]=_0x34fe91['attributes'][_0x641c('0x3b')]?_0x34fe91[_0x641c('0x39')]:_0x33dc2a[_0x641c('0x35')];if(!_0x2aace3[_0x641c('0x36')][_0x641c('0x3c')](_0x641c('0x3d'))){_0x34fe91[_0x641c('0x20')]=qs['limit'](_0x2aace3['query'][_0x641c('0x20')]);_0x34fe91[_0x641c('0x1f')]=qs[_0x641c('0x1f')](_0x2aace3[_0x641c('0x36')]['offset']);}_0x34fe91[_0x641c('0x3e')]=qs[_0x641c('0x3f')](_0x2aace3[_0x641c('0x36')][_0x641c('0x3f')]);_0x34fe91[_0x641c('0x40')]=qs['filters'](_[_0x641c('0x41')](_0x2aace3['query'],_0x33dc2a['filters']));_0x34fe91[_0x641c('0x40')][_0x641c('0x59')]=_0x52872a['id'];if(_0x2aace3[_0x641c('0x36')][_0x641c('0x42')]){_0x34fe91[_0x641c('0x40')]=_['merge'](_0x34fe91[_0x641c('0x40')],{'$or':_['map'](_0x34fe91[_0x641c('0x39')],function(_0x21f6db){var _0x3eaa72={};_0x3eaa72[_0x21f6db]={'$like':'%'+_0x2aace3[_0x641c('0x36')][_0x641c('0x42')]+'%'};return _0x3eaa72;})});}_0x34fe91=_['merge']({},_0x34fe91,_0x2aace3[_0x641c('0x45')]);return db[_0x641c('0x5a')]['findAll'](_0x34fe91);}})['then'](function(_0x5a6924){if(_0x5a6924){return db['User'][_0x641c('0x5b')]({'where':{'id':_[_0x641c('0x31')](_0x5a6924,_0x641c('0x5c')),'role':_0x641c('0x5d')},'attributes':['id',_0x641c('0x2f'),'mailPause',_0x641c('0x5e'),'createdAt']});}})[_0x641c('0x27')](function(_0x30e7b0){if(_0x30e7b0){return{'count':_0x30e7b0[_0x641c('0x46')],'rows':_[_0x641c('0x31')](_0x30e7b0[_0x641c('0x49')],function(_0x3064f4){return{'membername':_0x3064f4[_0x641c('0x2f')],'UserId':_0x3064f4['id'],'queue_name':_0x4039ca[_0x641c('0x2f')],'MailQueueId':_0x4039ca['id'],'interface':util[_0x641c('0x5f')](_0x641c('0x60'),_0x641c('0x61'),_0x3064f4[_0x641c('0x2f')]),'penalty':0x0,'paused':_0x3064f4['mailPause'],'createdAt':_0x3064f4[_0x641c('0x62')],'updatedAt':_0x3064f4[_0x641c('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4386b4,_0x34fe91))[_0x641c('0x4a')](handleError(_0x4386b4,null));};exports[_0x641c('0x63')]=function(_0x3bdeaf,_0x2f4245,_0x45b4e6){var _0x3754ee={};var _0x189de4={};var _0x3cbc3d;var _0x30e8d9;return db[_0x641c('0x32')]['findOne']({'where':{'id':_0x3bdeaf[_0x641c('0x4b')]['id']}})[_0x641c('0x27')](handleEntityNotFound(_0x2f4245,null))['then'](function(_0x2b749f){if(_0x2b749f){_0x3cbc3d=_0x2b749f;_0x189de4[_0x641c('0x35')]=_['keys'](db['Team']['rawAttributes']);_0x189de4[_0x641c('0x36')]=_[_0x641c('0x37')](_0x3bdeaf[_0x641c('0x36')]);_0x189de4['filters']=_[_0x641c('0x4c')](_0x189de4[_0x641c('0x35')],_0x189de4[_0x641c('0x36')]);_0x3754ee[_0x641c('0x39')]=_[_0x641c('0x4c')](_0x189de4[_0x641c('0x35')],qs['fields'](_0x3bdeaf[_0x641c('0x36')]['fields']));_0x3754ee['attributes']=_0x3754ee[_0x641c('0x39')][_0x641c('0x3b')]?_0x3754ee[_0x641c('0x39')]:_0x189de4['model'];_0x3754ee[_0x641c('0x3e')]=qs['sort'](_0x3bdeaf[_0x641c('0x36')]['sort']);_0x3754ee[_0x641c('0x40')]=qs[_0x641c('0x38')](_[_0x641c('0x41')](_0x3bdeaf['query'],_0x189de4[_0x641c('0x38')]));if(_0x3bdeaf[_0x641c('0x36')]['filter']){_0x3754ee['where']=_[_0x641c('0x43')](_0x3754ee[_0x641c('0x40')],{'$or':_[_0x641c('0x31')](_0x3754ee[_0x641c('0x39')],function(_0x3d2c58){var _0x2ae1b6={};_0x2ae1b6[_0x3d2c58]={'$like':'%'+_0x3bdeaf[_0x641c('0x36')][_0x641c('0x42')]+'%'};return _0x2ae1b6;})});}_0x3754ee=_[_0x641c('0x43')]({},_0x3754ee,_0x3bdeaf[_0x641c('0x45')]);return _0x3cbc3d['getTeams'](_0x3754ee);}})[_0x641c('0x27')](function(_0x20648e){if(_0x20648e){_0x30e8d9=_0x20648e[_0x641c('0x3b')];if(!_0x3bdeaf[_0x641c('0x36')][_0x641c('0x3c')](_0x641c('0x3d'))){_0x3754ee[_0x641c('0x20')]=qs[_0x641c('0x20')](_0x3bdeaf[_0x641c('0x36')][_0x641c('0x20')]);_0x3754ee[_0x641c('0x1f')]=qs[_0x641c('0x1f')](_0x3bdeaf['query']['offset']);}return _0x3cbc3d['getTeams'](_0x3754ee);}})[_0x641c('0x27')](function(_0x1fbd3c){if(_0x1fbd3c){return _0x1fbd3c?{'count':_0x30e8d9,'rows':_0x1fbd3c}:null;}})['then'](respondWithResult(_0x2f4245,null))['catch'](handleError(_0x2f4245,null));};exports[_0x641c('0x64')]=function(_0x5ac617,_0x5224c6,_0x56cf33){var _0x4d6637=_0x5ac617['body'][_0x641c('0x65')];return db['Team'][_0x641c('0x48')]({'where':{'id':_0x4d6637},'attributes':['id'],'include':[{'model':db[_0x641c('0x66')],'as':_0x641c('0x67'),'attributes':['id','name',_0x641c('0x68'),_0x641c('0x69'),_0x641c('0x6a')],'raw':!![]}]})[_0x641c('0x27')](function(_0x6931c8){if(_0x6931c8){var _0x27a1ef=_[_0x641c('0x6b')](_0x6931c8,function(_0x1f4ac3){var _0x430277=_0x1f4ac3[_0x641c('0x29')]({'plain':!![]});return _0x430277[_0x641c('0x67')];});return db[_0x641c('0x32')][_0x641c('0x54')]({'where':{'id':_0x5ac617['params']['id']}})[_0x641c('0x27')](function(_0x4d6b8c){return db[_0x641c('0x6c')][_0x641c('0x6d')](function(_0x38ceb0){return _0x4d6b8c[_0x641c('0x64')](_0x4d6637,{'transaction':_0x38ceb0})['then'](function(){return BPromise['each'](_0x27a1ef,function(_0x4a48c1){return db[_0x641c('0x5a')][_0x641c('0x6e')]({'where':{'UserId':_0x4a48c1['id'],'MailQueueId':_0x5ac617[_0x641c('0x4b')]['id']},'transaction':_0x38ceb0});});})[_0x641c('0x27')](function(){_0x27a1ef[_0x641c('0x6f')](function(_0x389d1d){socket[_0x641c('0x70')]('userMailQueue:save',{'UserId':_0x389d1d['id'],'MailQueueId':_0x4d6b8c['id']});});});});});}})[_0x641c('0x27')](respondWithStatusCode(_0x5224c6,null))[_0x641c('0x4a')](handleError(_0x5224c6,null));};exports[_0x641c('0x71')]=function(_0xe0c99d,_0x2783c0,_0x450d53){return db[_0x641c('0x72')][_0x641c('0x48')]({'where':{'id':_0xe0c99d[_0x641c('0x36')][_0x641c('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x641c('0x27')](handleEntityNotFound(_0x2783c0,null))[_0x641c('0x27')](function(_0x24a166){var _0xde6663=_[_0x641c('0x31')](_0x24a166,'id');var _0x147dc8=[];var _0xc2cd1=[];var _0x2d50a4=squel[_0x641c('0x73')]();_0x2d50a4[_0x641c('0x74')](_0x641c('0x75'))[_0x641c('0x76')](_0x641c('0x77'),'tq')[_0x641c('0x78')](_0x641c('0x79'),'ut',_0x641c('0x7a'))[_0x641c('0x40')](_0x641c('0x7b'),_0xe0c99d[_0x641c('0x4b')]['id']);for(var _0x535cb8=0x0;_0x535cb8<_0x24a166['length'];_0x535cb8+=0x1){let _0x106009=_0x24a166[_0x535cb8];for(var _0x591627=0x0;_0x591627<_0x106009['Agents'][_0x641c('0x3b')];_0x591627+=0x1){let _0x3e4283=_0x106009[_0x641c('0x67')][_0x591627];var _0x495a78=_0x2d50a4[_0x641c('0x7c')]();_0x495a78[_0x641c('0x40')](_0x641c('0x7d'),_0x3e4283['id']);_0xc2cd1[_0x641c('0x7e')](db[_0x641c('0x6c')]['query'](_0x495a78[_0x641c('0x7f')](),{'type':db['sequelize'][_0x641c('0x80')]['SELECT']})[_0x641c('0x27')](function(_0x379b4f){if(_0x379b4f[_0x641c('0x3b')]===0x1){return _0x3e4283['id'];}else{var _0x3a879f=_[_0x641c('0x81')](_[_0x641c('0x31')](_0x379b4f,_0x641c('0x82')),function(_0x3126b0){return _[_0x641c('0x83')](_0xde6663,_0x3126b0);});if(_0x3a879f){return _0x3e4283['id'];}}}));}}return BPromise[_0x641c('0x84')](_0xc2cd1)[_0x641c('0x27')](function(_0x1fb97c){_0x147dc8=_(_0x147dc8)['union'](_0x1fb97c)[_0x641c('0x85')]()[_0x641c('0x86')]();return db[_0x641c('0x32')][_0x641c('0x54')]({'where':{'id':_0xe0c99d[_0x641c('0x4b')]['id']}})[_0x641c('0x27')](function(_0x5bc9e0){return db[_0x641c('0x6c')][_0x641c('0x6d')](function(_0x4c7111){return _0x5bc9e0[_0x641c('0x71')](_0xe0c99d['query']['ids'],{'transaction':_0x4c7111})[_0x641c('0x27')](function(){if(!_['isEmpty'](_0x147dc8)){return _0x5bc9e0[_0x641c('0x87')](_0x147dc8,{'transaction':_0x4c7111});}})[_0x641c('0x27')](function(){_0x147dc8[_0x641c('0x6f')](function(_0x41c460){socket[_0x641c('0x70')](_0x641c('0x88'),{'UserId':_0x41c460,'MailQueueId':_0x5bc9e0['id']});});});});});});})[_0x641c('0x27')](respondWithStatusCode(_0x2783c0,null))[_0x641c('0x4a')](handleError(_0x2783c0,null));};exports['addAgents']=function(_0x4427a9,_0x868260,_0xe41a8a){return db[_0x641c('0x32')]['find']({'where':{'id':_0x4427a9[_0x641c('0x4b')]['id']}})[_0x641c('0x27')](handleEntityNotFound(_0x868260,null))[_0x641c('0x27')](function(_0xa802b0){if(_0xa802b0){return _0xa802b0['addAgents'](_0x4427a9[_0x641c('0x4f')]['ids'],_[_0x641c('0x89')](_0x4427a9[_0x641c('0x4f')],['ids','id'])||{})['spread'](function(_0x5f3d95){for(var _0x312333=0x0;_0x312333<_0x4427a9[_0x641c('0x4f')][_0x641c('0x65')][_0x641c('0x3b')];_0x312333+=0x1){socket[_0x641c('0x70')](_0x641c('0x8a'),{'UserId':_0x4427a9[_0x641c('0x4f')][_0x641c('0x65')][_0x312333],'MailQueueId':_0x4427a9[_0x641c('0x4b')]['id']});}return _0x5f3d95;});}})[_0x641c('0x27')](respondWithResult(_0x868260,null))[_0x641c('0x4a')](handleError(_0x868260,null));};exports[_0x641c('0x87')]=function(_0x4c1f87,_0x7f6561,_0x543787){return db['MailQueue'][_0x641c('0x54')]({'where':{'id':_0x4c1f87[_0x641c('0x4b')]['id']}})[_0x641c('0x27')](handleEntityNotFound(_0x7f6561,null))['then'](function(_0x32cfcc){if(_0x32cfcc){return _0x32cfcc[_0x641c('0x87')](_0x4c1f87['query']['ids'])[_0x641c('0x27')](function(){if(_[_0x641c('0x8b')](_0x4c1f87['query']['ids'])){for(var _0x8c249e=0x0;_0x8c249e<_0x4c1f87[_0x641c('0x36')][_0x641c('0x65')][_0x641c('0x3b')];_0x8c249e+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x4c1f87[_0x641c('0x36')][_0x641c('0x65')][_0x8c249e]),'MailQueueId':Number(_0x4c1f87[_0x641c('0x4b')]['id'])});}}else{socket[_0x641c('0x70')](_0x641c('0x88'),{'UserId':Number(_0x4c1f87['query']['ids']),'MailQueueId':Number(_0x4c1f87['params']['id'])});}});}})['then'](respondWithStatusCode(_0x7f6561,null))[_0x641c('0x4a')](handleError(_0x7f6561,null));};exports['getAgents']=function(_0x3bf504,_0x221371,_0x3743e6){var _0x54a10d={};var _0x1f9d1e={};var _0x5405fb;var _0x387b5f;return db[_0x641c('0x32')][_0x641c('0x8c')]({'where':{'id':_0x3bf504[_0x641c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x221371,null))['then'](function(_0x5f1603){if(_0x5f1603){_0x5405fb=_0x5f1603;_0x1f9d1e[_0x641c('0x35')]=_['keys'](db['User']['rawAttributes']);_0x1f9d1e[_0x641c('0x36')]=_[_0x641c('0x37')](_0x3bf504['query']);_0x1f9d1e[_0x641c('0x38')]=_[_0x641c('0x4c')](_0x1f9d1e['model'],_0x1f9d1e['query']);_0x54a10d['attributes']=_['intersection'](_0x1f9d1e[_0x641c('0x35')],qs[_0x641c('0x3a')](_0x3bf504['query'][_0x641c('0x3a')]));_0x54a10d[_0x641c('0x39')]=_0x54a10d['attributes']['length']?_0x54a10d[_0x641c('0x39')]:_0x1f9d1e['model'];_0x54a10d[_0x641c('0x3e')]=qs['sort'](_0x3bf504[_0x641c('0x36')][_0x641c('0x3f')]);_0x54a10d[_0x641c('0x40')]=qs[_0x641c('0x38')](_['pick'](_0x3bf504['query'],_0x1f9d1e[_0x641c('0x38')]));if(_0x3bf504[_0x641c('0x36')][_0x641c('0x42')]){_0x54a10d[_0x641c('0x40')]=_[_0x641c('0x43')](_0x54a10d['where'],{'$or':_[_0x641c('0x31')](_0x54a10d[_0x641c('0x39')],function(_0x2f8969){var _0x3c276c={};_0x3c276c[_0x2f8969]={'$like':'%'+_0x3bf504[_0x641c('0x36')][_0x641c('0x42')]+'%'};return _0x3c276c;})});}_0x54a10d=_[_0x641c('0x43')]({},_0x54a10d,_0x3bf504[_0x641c('0x45')]);return _0x5405fb['getAgents'](_0x54a10d);}})['then'](function(_0x139bd7){if(_0x139bd7){_0x387b5f=_0x139bd7['length'];if(!_0x3bf504[_0x641c('0x36')][_0x641c('0x3c')]('nolimit')){_0x54a10d['limit']=qs['limit'](_0x3bf504[_0x641c('0x36')]['limit']);_0x54a10d[_0x641c('0x1f')]=qs[_0x641c('0x1f')](_0x3bf504[_0x641c('0x36')]['offset']);}return _0x5405fb[_0x641c('0x8d')](_0x54a10d);}})[_0x641c('0x27')](function(_0x31a32e){if(_0x31a32e){return _0x31a32e?{'count':_0x387b5f,'rows':_0x31a32e}:null;}})[_0x641c('0x27')](respondWithResult(_0x221371,null))[_0x641c('0x4a')](handleError(_0x221371,null));};
\ No newline at end of file
+var _0xe838=['set','apply','reject','save','destroy','then','get','MailQueues','UserProfileResource','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','error','update','find','describe','getMembers','findOne','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','SIP','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','count','offset','limit'];(function(_0x2a18f5,_0x419e08){var _0x19452d=function(_0x57e2a5){while(--_0x57e2a5){_0x2a18f5['push'](_0x2a18f5['shift']());}};_0x19452d(++_0x419e08);}(_0xe838,0xfc));var _0x8e83=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe838[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x8e83('0x0'));var emlformat=require(_0x8e83('0x1'));var rimraf=require(_0x8e83('0x2'));var zipdir=require(_0x8e83('0x3'));var jsonpatch=require(_0x8e83('0x4'));var rp=require('request-promise');var moment=require(_0x8e83('0x5'));var BPromise=require(_0x8e83('0x6'));var Mustache=require(_0x8e83('0x7'));var util=require(_0x8e83('0x8'));var path=require(_0x8e83('0x9'));var sox=require(_0x8e83('0xa'));var csv=require(_0x8e83('0xb'));var ejs=require(_0x8e83('0xc'));var fs=require('fs');var _=require(_0x8e83('0xd'));var squel=require(_0x8e83('0xe'));var crypto=require('crypto');var jsforce=require(_0x8e83('0xf'));var deskjs=require(_0x8e83('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8e83('0x11'));var Papa=require(_0x8e83('0x12'));var Redis=require(_0x8e83('0x13'));var authService=require(_0x8e83('0x14'));var qs=require(_0x8e83('0x15'));var as=require(_0x8e83('0x16'));var hardwareService=require(_0x8e83('0x17'));var logger=require(_0x8e83('0x18'))(_0x8e83('0x19'));var utils=require(_0x8e83('0x1a'));var config=require(_0x8e83('0x1b'));var db=require(_0x8e83('0x1c'))['db'];config[_0x8e83('0x1d')]=_[_0x8e83('0x1e')](config[_0x8e83('0x1d')],{'host':_0x8e83('0x1f'),'port':0x18eb});var socket=require(_0x8e83('0x20'))(new Redis(config[_0x8e83('0x1d')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x2cce32,_0xa71f78){_0xa71f78=_0xa71f78||0xcc;return function(_0x106936){if(_0x106936){return _0x2cce32[_0x8e83('0x21')](_0xa71f78);}return _0x2cce32[_0x8e83('0x22')](_0xa71f78)[_0x8e83('0x23')]();};}function respondWithResult(_0x4d5a11,_0x2a69cb){_0x2a69cb=_0x2a69cb||0xc8;return function(_0x3e0237){if(_0x3e0237){return _0x4d5a11[_0x8e83('0x22')](_0x2a69cb)[_0x8e83('0x24')](_0x3e0237);}};}function respondWithFilteredResult(_0x1ffa06,_0x3af3d){return function(_0x46d7f1){if(_0x46d7f1){var _0xb6a490=_0x46d7f1[_0x8e83('0x25')],_0x3d8915=_0x3af3d['offset'],_0x5e1c79=_0x3af3d[_0x8e83('0x26')]+_0x3af3d[_0x8e83('0x27')],_0x1d31ea;if(_0x5e1c79>=_0xb6a490){_0x5e1c79=_0xb6a490;_0x1d31ea=0xc8;}else{_0x1d31ea=0xce;}_0x1ffa06[_0x8e83('0x22')](_0x1d31ea);return _0x1ffa06[_0x8e83('0x28')]('Content-Range',_0x3d8915+'-'+_0x5e1c79+'/'+_0xb6a490)['json'](_0x46d7f1);}return null;};}function patchUpdates(_0x3de6c1){return function(_0x5b9069){try{jsonpatch[_0x8e83('0x29')](_0x5b9069,_0x3de6c1,!![]);}catch(_0x34c3bf){return BPromise[_0x8e83('0x2a')](_0x34c3bf);}return _0x5b9069[_0x8e83('0x2b')]();};}function saveUpdates(_0x5d8fb7,_0x1ef353){return function(_0xfb3a4c){if(_0xfb3a4c){return _0xfb3a4c['update'](_0x5d8fb7)['then'](function(_0x36ea0d){return _0x36ea0d;});}return null;};}function removeEntity(_0x3228f4,_0x5d37c7){return function(_0x4d69e8){if(_0x4d69e8){return _0x4d69e8[_0x8e83('0x2c')]()[_0x8e83('0x2d')](function(){var _0x56f09c=_0x4d69e8[_0x8e83('0x2e')]({'plain':!![]});var _0x8833d1=_0x8e83('0x2f');return db[_0x8e83('0x30')][_0x8e83('0x2c')]({'where':{'type':_0x8833d1,'resourceId':_0x56f09c['id']}})[_0x8e83('0x2d')](function(){return _0x4d69e8;});})['then'](function(){_0x3228f4['status'](0xcc)[_0x8e83('0x23')]();});}};}function handleEntityNotFound(_0x1a7cac,_0x1f98fb){return function(_0x8a7d06){if(!_0x8a7d06){_0x1a7cac[_0x8e83('0x21')](0x194);}return _0x8a7d06;};}function handleError(_0x4d75e0,_0x279654){_0x279654=_0x279654||0x1f4;return function(_0x4cf1bd){logger['error'](_0x4cf1bd['stack']);if(_0x4cf1bd['name']){delete _0x4cf1bd[_0x8e83('0x31')];}_0x4d75e0['status'](_0x279654)[_0x8e83('0x32')](_0x4cf1bd);};}exports[_0x8e83('0x33')]=function(_0x459636,_0x41c841){var _0x5ee2d4={},_0x2cbc94={},_0x3b182b={'count':0x0,'rows':[]};var _0xc5beac=_[_0x8e83('0x34')](db[_0x8e83('0x35')][_0x8e83('0x36')],function(_0x314559){return{'name':_0x314559[_0x8e83('0x37')],'type':_0x314559['type'][_0x8e83('0x38')]};});_0x2cbc94[_0x8e83('0x39')]=_[_0x8e83('0x34')](_0xc5beac,_0x8e83('0x31'));_0x2cbc94['query']=_[_0x8e83('0x3a')](_0x459636[_0x8e83('0x3b')]);_0x2cbc94[_0x8e83('0x3c')]=_[_0x8e83('0x3d')](_0x2cbc94['model'],_0x2cbc94['query']);_0x5ee2d4[_0x8e83('0x3e')]=_[_0x8e83('0x3d')](_0x2cbc94[_0x8e83('0x39')],qs[_0x8e83('0x3f')](_0x459636[_0x8e83('0x3b')][_0x8e83('0x3f')]));_0x5ee2d4[_0x8e83('0x3e')]=_0x5ee2d4[_0x8e83('0x3e')][_0x8e83('0x40')]?_0x5ee2d4[_0x8e83('0x3e')]:_0x2cbc94[_0x8e83('0x39')];if(!_0x459636['query'][_0x8e83('0x41')](_0x8e83('0x42'))){_0x5ee2d4[_0x8e83('0x27')]=qs[_0x8e83('0x27')](_0x459636['query'][_0x8e83('0x27')]);_0x5ee2d4[_0x8e83('0x26')]=qs['offset'](_0x459636['query'][_0x8e83('0x26')]);}_0x5ee2d4[_0x8e83('0x43')]=qs[_0x8e83('0x44')](_0x459636[_0x8e83('0x3b')][_0x8e83('0x44')]);_0x5ee2d4[_0x8e83('0x45')]=qs['filters'](_[_0x8e83('0x46')](_0x459636[_0x8e83('0x3b')],_0x2cbc94[_0x8e83('0x3c')]),_0xc5beac);if(_0x459636[_0x8e83('0x3b')][_0x8e83('0x47')]){_0x5ee2d4['where']=_[_0x8e83('0x48')](_0x5ee2d4[_0x8e83('0x45')],{'$or':_[_0x8e83('0x34')](_0xc5beac,function(_0x97f5f3){if(_0x97f5f3['type']!==_0x8e83('0x49')){var _0x48bd82={};_0x48bd82[_0x97f5f3[_0x8e83('0x31')]]={'$like':'%'+_0x459636[_0x8e83('0x3b')][_0x8e83('0x47')]+'%'};return _0x48bd82;}})});}_0x5ee2d4=_[_0x8e83('0x48')]({},_0x5ee2d4,_0x459636['options']);var _0x46356a={'where':_0x5ee2d4[_0x8e83('0x45')]};return db[_0x8e83('0x35')][_0x8e83('0x25')](_0x46356a)[_0x8e83('0x2d')](function(_0x5b6327){_0x3b182b[_0x8e83('0x25')]=_0x5b6327;if(_0x459636[_0x8e83('0x3b')][_0x8e83('0x4a')]){_0x5ee2d4['include']=[{'all':!![]}];}return db[_0x8e83('0x35')][_0x8e83('0x4b')](_0x5ee2d4);})[_0x8e83('0x2d')](function(_0x147004){_0x3b182b[_0x8e83('0x4c')]=_0x147004;return _0x3b182b;})['then'](respondWithFilteredResult(_0x41c841,_0x5ee2d4))[_0x8e83('0x4d')](handleError(_0x41c841,null));};exports[_0x8e83('0x4e')]=function(_0x875895,_0x1ba631){var _0x12c66e={'raw':!![],'where':{'id':_0x875895[_0x8e83('0x4f')]['id']}},_0x8a4588={};_0x8a4588['model']=_[_0x8e83('0x3a')](db['MailQueue']['rawAttributes']);_0x8a4588['query']=_['keys'](_0x875895[_0x8e83('0x3b')]);_0x8a4588[_0x8e83('0x3c')]=_[_0x8e83('0x3d')](_0x8a4588['model'],_0x8a4588[_0x8e83('0x3b')]);_0x12c66e[_0x8e83('0x3e')]=_[_0x8e83('0x3d')](_0x8a4588['model'],qs[_0x8e83('0x3f')](_0x875895[_0x8e83('0x3b')]['fields']));_0x12c66e[_0x8e83('0x3e')]=_0x12c66e[_0x8e83('0x3e')][_0x8e83('0x40')]?_0x12c66e[_0x8e83('0x3e')]:_0x8a4588[_0x8e83('0x39')];if(_0x875895[_0x8e83('0x3b')]['includeAll']){_0x12c66e[_0x8e83('0x50')]=[{'all':!![]}];}_0x12c66e=_[_0x8e83('0x48')]({},_0x12c66e,_0x875895[_0x8e83('0x51')]);return db['MailQueue']['find'](_0x12c66e)[_0x8e83('0x2d')](handleEntityNotFound(_0x1ba631,null))['then'](respondWithResult(_0x1ba631,null))[_0x8e83('0x4d')](handleError(_0x1ba631,null));};exports['create']=function(_0x569dc2,_0x4ad95c){return db['MailQueue'][_0x8e83('0x52')](_0x569dc2[_0x8e83('0x53')],{})[_0x8e83('0x2d')](function(_0x318497){var _0x2d2aa5=_0x569dc2['user'][_0x8e83('0x2e')]({'plain':!![]});if(!_0x2d2aa5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d2aa5[_0x8e83('0x54')]===_0x8e83('0x55')){var _0x11775f=_0x318497[_0x8e83('0x2e')]({'plain':!![]});var _0x80aac2=_0x8e83('0x2f');return db[_0x8e83('0x56')]['find']({'where':{'name':_0x80aac2,'userProfileId':_0x2d2aa5[_0x8e83('0x57')]},'raw':!![]})[_0x8e83('0x2d')](function(_0x1b9e47){if(_0x1b9e47&&_0x1b9e47[_0x8e83('0x58')]===0x0){return db[_0x8e83('0x30')][_0x8e83('0x52')]({'name':_0x11775f[_0x8e83('0x31')],'resourceId':_0x11775f['id'],'type':_0x1b9e47[_0x8e83('0x31')],'sectionId':_0x1b9e47['id']},{})[_0x8e83('0x2d')](function(){return _0x318497;});}else{return _0x318497;}})['catch'](function(_0x2e129a){logger[_0x8e83('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e129a);throw _0x2e129a;});}return _0x318497;})[_0x8e83('0x2d')](respondWithResult(_0x4ad95c,0xc9))['catch'](handleError(_0x4ad95c,null));};exports[_0x8e83('0x5a')]=function(_0x14ab26,_0x345903){if(_0x14ab26[_0x8e83('0x53')]['id']){delete _0x14ab26[_0x8e83('0x53')]['id'];}return db[_0x8e83('0x35')]['find']({'where':{'id':_0x14ab26[_0x8e83('0x4f')]['id']}})[_0x8e83('0x2d')](handleEntityNotFound(_0x345903,null))[_0x8e83('0x2d')](saveUpdates(_0x14ab26[_0x8e83('0x53')],null))['then'](respondWithResult(_0x345903,null))[_0x8e83('0x4d')](handleError(_0x345903,null));};exports[_0x8e83('0x2c')]=function(_0x341379,_0x4de3c6){return db[_0x8e83('0x35')][_0x8e83('0x5b')]({'where':{'id':_0x341379['params']['id']}})[_0x8e83('0x2d')](handleEntityNotFound(_0x4de3c6,null))[_0x8e83('0x2d')](removeEntity(_0x4de3c6,null))[_0x8e83('0x4d')](handleError(_0x4de3c6,null));};exports[_0x8e83('0x5c')]=function(_0x1a8105,_0x30e866){return db[_0x8e83('0x35')][_0x8e83('0x5c')]()[_0x8e83('0x2d')](respondWithResult(_0x30e866,null))[_0x8e83('0x4d')](handleError(_0x30e866,null));};exports[_0x8e83('0x5d')]=function(_0x486a44,_0x5ec07c,_0x192cb2){var _0x1932d7={'raw':!![],'where':{}},_0x1ba68e={},_0x42ceb1;return db[_0x8e83('0x35')][_0x8e83('0x5e')]({'where':{'id':_0x486a44[_0x8e83('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ec07c,null))[_0x8e83('0x2d')](function(_0x2d616e){if(_0x2d616e){_0x42ceb1=_0x2d616e['get']({'plain':!![]});_0x1ba68e[_0x8e83('0x39')]=_['keys'](db['UserMailQueue'][_0x8e83('0x36')]);_0x1ba68e[_0x8e83('0x3b')]=_['keys'](_0x486a44['query']);_0x1ba68e[_0x8e83('0x3c')]=_['intersection'](_0x1ba68e[_0x8e83('0x39')],_0x1ba68e[_0x8e83('0x3b')]);_0x1932d7[_0x8e83('0x3e')]=_['intersection'](_0x1ba68e['model'],qs['fields'](_0x486a44['query'][_0x8e83('0x3f')]));_0x1932d7[_0x8e83('0x3e')]=_0x1932d7[_0x8e83('0x3e')][_0x8e83('0x40')]?_0x1932d7[_0x8e83('0x3e')]:_0x1ba68e[_0x8e83('0x39')];if(!_0x486a44[_0x8e83('0x3b')]['hasOwnProperty']('nolimit')){_0x1932d7[_0x8e83('0x27')]=qs['limit'](_0x486a44[_0x8e83('0x3b')][_0x8e83('0x27')]);_0x1932d7['offset']=qs[_0x8e83('0x26')](_0x486a44[_0x8e83('0x3b')]['offset']);}_0x1932d7[_0x8e83('0x43')]=qs[_0x8e83('0x44')](_0x486a44['query']['sort']);_0x1932d7[_0x8e83('0x45')]=qs[_0x8e83('0x3c')](_[_0x8e83('0x46')](_0x486a44[_0x8e83('0x3b')],_0x1ba68e[_0x8e83('0x3c')]));_0x1932d7[_0x8e83('0x45')][_0x8e83('0x5f')]=_0x2d616e['id'];if(_0x486a44['query'][_0x8e83('0x47')]){_0x1932d7[_0x8e83('0x45')]=_[_0x8e83('0x48')](_0x1932d7[_0x8e83('0x45')],{'$or':_[_0x8e83('0x34')](_0x1932d7['attributes'],function(_0x25000f){var _0x3f6ba4={};_0x3f6ba4[_0x25000f]={'$like':'%'+_0x486a44[_0x8e83('0x3b')][_0x8e83('0x47')]+'%'};return _0x3f6ba4;})});}_0x1932d7=_['merge']({},_0x1932d7,_0x486a44[_0x8e83('0x51')]);return db[_0x8e83('0x60')][_0x8e83('0x4b')](_0x1932d7);}})['then'](function(_0x3b5389){if(_0x3b5389){return db[_0x8e83('0x61')][_0x8e83('0x62')]({'where':{'id':_[_0x8e83('0x34')](_0x3b5389,_0x8e83('0x63')),'role':'agent'},'attributes':['id',_0x8e83('0x31'),_0x8e83('0x64'),_0x8e83('0x65'),_0x8e83('0x66')]});}})[_0x8e83('0x2d')](function(_0x3314f9){if(_0x3314f9){return{'count':_0x3314f9[_0x8e83('0x25')],'rows':_[_0x8e83('0x34')](_0x3314f9[_0x8e83('0x4c')],function(_0x1671ec){return{'membername':_0x1671ec[_0x8e83('0x31')],'UserId':_0x1671ec['id'],'queue_name':_0x42ceb1[_0x8e83('0x31')],'MailQueueId':_0x42ceb1['id'],'interface':util[_0x8e83('0x67')]('%s/%s',_0x8e83('0x68'),_0x1671ec['name']),'penalty':0x0,'paused':_0x1671ec[_0x8e83('0x64')],'createdAt':_0x1671ec['createdAt'],'updatedAt':_0x1671ec['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e83('0x2d')](respondWithFilteredResult(_0x5ec07c,_0x1932d7))['catch'](handleError(_0x5ec07c,null));};exports['getTeams']=function(_0x4431ea,_0x303c61,_0x5c8ad3){var _0x3370ef={};var _0x2d79d8={};var _0x37cc9;var _0x15450b;return db[_0x8e83('0x35')][_0x8e83('0x5e')]({'where':{'id':_0x4431ea[_0x8e83('0x4f')]['id']}})[_0x8e83('0x2d')](handleEntityNotFound(_0x303c61,null))[_0x8e83('0x2d')](function(_0x4ade8e){if(_0x4ade8e){_0x37cc9=_0x4ade8e;_0x2d79d8[_0x8e83('0x39')]=_[_0x8e83('0x3a')](db[_0x8e83('0x69')][_0x8e83('0x36')]);_0x2d79d8['query']=_[_0x8e83('0x3a')](_0x4431ea[_0x8e83('0x3b')]);_0x2d79d8['filters']=_['intersection'](_0x2d79d8[_0x8e83('0x39')],_0x2d79d8[_0x8e83('0x3b')]);_0x3370ef['attributes']=_['intersection'](_0x2d79d8[_0x8e83('0x39')],qs[_0x8e83('0x3f')](_0x4431ea[_0x8e83('0x3b')]['fields']));_0x3370ef[_0x8e83('0x3e')]=_0x3370ef[_0x8e83('0x3e')][_0x8e83('0x40')]?_0x3370ef[_0x8e83('0x3e')]:_0x2d79d8[_0x8e83('0x39')];_0x3370ef[_0x8e83('0x43')]=qs['sort'](_0x4431ea['query'][_0x8e83('0x44')]);_0x3370ef['where']=qs['filters'](_[_0x8e83('0x46')](_0x4431ea['query'],_0x2d79d8[_0x8e83('0x3c')]));if(_0x4431ea['query']['filter']){_0x3370ef[_0x8e83('0x45')]=_['merge'](_0x3370ef['where'],{'$or':_['map'](_0x3370ef[_0x8e83('0x3e')],function(_0x51e649){var _0x4d4487={};_0x4d4487[_0x51e649]={'$like':'%'+_0x4431ea[_0x8e83('0x3b')][_0x8e83('0x47')]+'%'};return _0x4d4487;})});}_0x3370ef=_['merge']({},_0x3370ef,_0x4431ea[_0x8e83('0x51')]);return _0x37cc9['getTeams'](_0x3370ef);}})[_0x8e83('0x2d')](function(_0x3da6bf){if(_0x3da6bf){_0x15450b=_0x3da6bf[_0x8e83('0x40')];if(!_0x4431ea[_0x8e83('0x3b')][_0x8e83('0x41')](_0x8e83('0x42'))){_0x3370ef[_0x8e83('0x27')]=qs['limit'](_0x4431ea[_0x8e83('0x3b')][_0x8e83('0x27')]);_0x3370ef[_0x8e83('0x26')]=qs[_0x8e83('0x26')](_0x4431ea['query'][_0x8e83('0x26')]);}return _0x37cc9['getTeams'](_0x3370ef);}})[_0x8e83('0x2d')](function(_0x1057a7){if(_0x1057a7){return _0x1057a7?{'count':_0x15450b,'rows':_0x1057a7}:null;}})[_0x8e83('0x2d')](respondWithResult(_0x303c61,null))[_0x8e83('0x4d')](handleError(_0x303c61,null));};exports[_0x8e83('0x6a')]=function(_0x519523,_0x2e5fb6,_0x55563e){var _0x250692=_0x519523[_0x8e83('0x53')][_0x8e83('0x6b')];return db[_0x8e83('0x69')]['findAll']({'where':{'id':_0x250692},'attributes':['id'],'include':[{'model':db[_0x8e83('0x61')],'as':_0x8e83('0x6c'),'attributes':['id',_0x8e83('0x31'),_0x8e83('0x6d'),_0x8e83('0x6e'),_0x8e83('0x6f')],'raw':!![]}]})['then'](function(_0x30e3e0){if(_0x30e3e0){var _0x1d1264=_['flatMap'](_0x30e3e0,function(_0x1cf36d){var _0x68a8a5=_0x1cf36d[_0x8e83('0x2e')]({'plain':!![]});return _0x68a8a5[_0x8e83('0x6c')];});return db[_0x8e83('0x35')]['find']({'where':{'id':_0x519523[_0x8e83('0x4f')]['id']}})['then'](function(_0x110396){return db[_0x8e83('0x70')][_0x8e83('0x71')](function(_0x584caa){return _0x110396[_0x8e83('0x6a')](_0x250692,{'transaction':_0x584caa})['then'](function(){return BPromise[_0x8e83('0x72')](_0x1d1264,function(_0xcc3e6f){return db['UserMailQueue'][_0x8e83('0x73')]({'where':{'UserId':_0xcc3e6f['id'],'MailQueueId':_0x519523[_0x8e83('0x4f')]['id']},'transaction':_0x584caa});});})[_0x8e83('0x2d')](function(){_0x1d1264[_0x8e83('0x74')](function(_0x528d5f){socket['emit']('userMailQueue:save',{'UserId':_0x528d5f['id'],'MailQueueId':_0x110396['id']});});});});});}})[_0x8e83('0x2d')](respondWithStatusCode(_0x2e5fb6,null))['catch'](handleError(_0x2e5fb6,null));};exports['removeTeams']=function(_0x1e1bb5,_0x259673,_0x4f844e){return db['Team']['findAll']({'where':{'id':_0x1e1bb5[_0x8e83('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8e83('0x61')],'as':_0x8e83('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x8e83('0x2d')](handleEntityNotFound(_0x259673,null))[_0x8e83('0x2d')](function(_0x2e8b6d){var _0x441245=_[_0x8e83('0x34')](_0x2e8b6d,'id');var _0x400e82=[];var _0x8b28c0=[];var _0x4e9cf8=squel[_0x8e83('0x75')]();_0x4e9cf8[_0x8e83('0x76')](_0x8e83('0x77'))[_0x8e83('0x78')](_0x8e83('0x79'),'tq')[_0x8e83('0x7a')](_0x8e83('0x7b'),'ut',_0x8e83('0x7c'))[_0x8e83('0x45')](_0x8e83('0x7d'),_0x1e1bb5[_0x8e83('0x4f')]['id']);for(var _0x5cf403=0x0;_0x5cf403<_0x2e8b6d[_0x8e83('0x40')];_0x5cf403+=0x1){let _0x560e2f=_0x2e8b6d[_0x5cf403];for(var _0x180251=0x0;_0x180251<_0x560e2f[_0x8e83('0x6c')][_0x8e83('0x40')];_0x180251+=0x1){let _0x309a4a=_0x560e2f['Agents'][_0x180251];var _0x11eee2=_0x4e9cf8['clone']();_0x11eee2[_0x8e83('0x45')]('ut.UserId\x20=\x20?',_0x309a4a['id']);_0x8b28c0[_0x8e83('0x7e')](db[_0x8e83('0x70')][_0x8e83('0x3b')](_0x11eee2['toString'](),{'type':db[_0x8e83('0x70')]['QueryTypes'][_0x8e83('0x7f')]})[_0x8e83('0x2d')](function(_0x1f9189){if(_0x1f9189[_0x8e83('0x40')]===0x1){return _0x309a4a['id'];}else{var _0x152180=_[_0x8e83('0x80')](_[_0x8e83('0x34')](_0x1f9189,_0x8e83('0x81')),function(_0x5c370c){return _[_0x8e83('0x82')](_0x441245,_0x5c370c);});if(_0x152180){return _0x309a4a['id'];}}}));}}return BPromise[_0x8e83('0x83')](_0x8b28c0)[_0x8e83('0x2d')](function(_0x408489){_0x400e82=_(_0x400e82)[_0x8e83('0x84')](_0x408489)[_0x8e83('0x85')]()[_0x8e83('0x86')]();return db['MailQueue'][_0x8e83('0x5b')]({'where':{'id':_0x1e1bb5[_0x8e83('0x4f')]['id']}})[_0x8e83('0x2d')](function(_0x282764){return db[_0x8e83('0x70')][_0x8e83('0x71')](function(_0x4af72b){return _0x282764[_0x8e83('0x87')](_0x1e1bb5[_0x8e83('0x3b')][_0x8e83('0x6b')],{'transaction':_0x4af72b})[_0x8e83('0x2d')](function(){if(!_[_0x8e83('0x88')](_0x400e82)){return _0x282764[_0x8e83('0x89')](_0x400e82,{'transaction':_0x4af72b});}})['then'](function(){_0x400e82[_0x8e83('0x74')](function(_0x42452c){socket[_0x8e83('0x8a')](_0x8e83('0x8b'),{'UserId':_0x42452c,'MailQueueId':_0x282764['id']});});});});});});})[_0x8e83('0x2d')](respondWithStatusCode(_0x259673,null))[_0x8e83('0x4d')](handleError(_0x259673,null));};exports[_0x8e83('0x8c')]=function(_0x5e1f88,_0x560b0e,_0xf4ed00){return db[_0x8e83('0x35')][_0x8e83('0x5b')]({'where':{'id':_0x5e1f88[_0x8e83('0x4f')]['id']}})[_0x8e83('0x2d')](handleEntityNotFound(_0x560b0e,null))[_0x8e83('0x2d')](function(_0x5acc38){if(_0x5acc38){return _0x5acc38[_0x8e83('0x8c')](_0x5e1f88[_0x8e83('0x53')][_0x8e83('0x6b')],_[_0x8e83('0x8d')](_0x5e1f88['body'],[_0x8e83('0x6b'),'id'])||{})[_0x8e83('0x8e')](function(_0xa9dac3){for(var _0x40dbce=0x0;_0x40dbce<_0x5e1f88[_0x8e83('0x53')][_0x8e83('0x6b')][_0x8e83('0x40')];_0x40dbce+=0x1){socket[_0x8e83('0x8a')](_0x8e83('0x8f'),{'UserId':_0x5e1f88[_0x8e83('0x53')][_0x8e83('0x6b')][_0x40dbce],'MailQueueId':_0x5e1f88[_0x8e83('0x4f')]['id']});}return _0xa9dac3;});}})['then'](respondWithResult(_0x560b0e,null))[_0x8e83('0x4d')](handleError(_0x560b0e,null));};exports[_0x8e83('0x89')]=function(_0x3ca0d0,_0x1c0105,_0x1390c5){return db[_0x8e83('0x35')][_0x8e83('0x5b')]({'where':{'id':_0x3ca0d0[_0x8e83('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1c0105,null))['then'](function(_0x48daa3){if(_0x48daa3){return _0x48daa3[_0x8e83('0x89')](_0x3ca0d0['query'][_0x8e83('0x6b')])['then'](function(){if(_[_0x8e83('0x90')](_0x3ca0d0[_0x8e83('0x3b')][_0x8e83('0x6b')])){for(var _0x14c8ca=0x0;_0x14c8ca<_0x3ca0d0[_0x8e83('0x3b')][_0x8e83('0x6b')][_0x8e83('0x40')];_0x14c8ca+=0x1){socket['emit'](_0x8e83('0x8b'),{'UserId':Number(_0x3ca0d0[_0x8e83('0x3b')][_0x8e83('0x6b')][_0x14c8ca]),'MailQueueId':Number(_0x3ca0d0[_0x8e83('0x4f')]['id'])});}}else{socket[_0x8e83('0x8a')](_0x8e83('0x8b'),{'UserId':Number(_0x3ca0d0['query'][_0x8e83('0x6b')]),'MailQueueId':Number(_0x3ca0d0['params']['id'])});}});}})[_0x8e83('0x2d')](respondWithStatusCode(_0x1c0105,null))['catch'](handleError(_0x1c0105,null));};exports[_0x8e83('0x91')]=function(_0x2ebf90,_0x351d12,_0x1d7133){var _0x5224a8={};var _0x5a03c9={};var _0x298872;var _0x48616f;return db[_0x8e83('0x35')][_0x8e83('0x5e')]({'where':{'id':_0x2ebf90[_0x8e83('0x4f')]['id']}})[_0x8e83('0x2d')](handleEntityNotFound(_0x351d12,null))[_0x8e83('0x2d')](function(_0x465e34){if(_0x465e34){_0x298872=_0x465e34;_0x5a03c9['model']=_['keys'](db[_0x8e83('0x61')][_0x8e83('0x36')]);_0x5a03c9[_0x8e83('0x3b')]=_[_0x8e83('0x3a')](_0x2ebf90['query']);_0x5a03c9[_0x8e83('0x3c')]=_['intersection'](_0x5a03c9[_0x8e83('0x39')],_0x5a03c9[_0x8e83('0x3b')]);_0x5224a8[_0x8e83('0x3e')]=_[_0x8e83('0x3d')](_0x5a03c9[_0x8e83('0x39')],qs[_0x8e83('0x3f')](_0x2ebf90[_0x8e83('0x3b')][_0x8e83('0x3f')]));_0x5224a8[_0x8e83('0x3e')]=_0x5224a8[_0x8e83('0x3e')][_0x8e83('0x40')]?_0x5224a8[_0x8e83('0x3e')]:_0x5a03c9[_0x8e83('0x39')];_0x5224a8[_0x8e83('0x43')]=qs[_0x8e83('0x44')](_0x2ebf90[_0x8e83('0x3b')][_0x8e83('0x44')]);_0x5224a8['where']=qs[_0x8e83('0x3c')](_[_0x8e83('0x46')](_0x2ebf90[_0x8e83('0x3b')],_0x5a03c9[_0x8e83('0x3c')]));if(_0x2ebf90['query'][_0x8e83('0x47')]){_0x5224a8[_0x8e83('0x45')]=_[_0x8e83('0x48')](_0x5224a8[_0x8e83('0x45')],{'$or':_[_0x8e83('0x34')](_0x5224a8[_0x8e83('0x3e')],function(_0x4bab49){var _0x4bcfbf={};_0x4bcfbf[_0x4bab49]={'$like':'%'+_0x2ebf90['query'][_0x8e83('0x47')]+'%'};return _0x4bcfbf;})});}_0x5224a8=_[_0x8e83('0x48')]({},_0x5224a8,_0x2ebf90[_0x8e83('0x51')]);return _0x298872[_0x8e83('0x91')](_0x5224a8);}})[_0x8e83('0x2d')](function(_0x1e9e4f){if(_0x1e9e4f){_0x48616f=_0x1e9e4f['length'];if(!_0x2ebf90[_0x8e83('0x3b')][_0x8e83('0x41')](_0x8e83('0x42'))){_0x5224a8['limit']=qs['limit'](_0x2ebf90[_0x8e83('0x3b')][_0x8e83('0x27')]);_0x5224a8[_0x8e83('0x26')]=qs['offset'](_0x2ebf90[_0x8e83('0x3b')][_0x8e83('0x26')]);}return _0x298872[_0x8e83('0x91')](_0x5224a8);}})['then'](function(_0x71dfe0){if(_0x71dfe0){return _0x71dfe0?{'count':_0x48616f,'rows':_0x71dfe0}:null;}})[_0x8e83('0x2d')](respondWithResult(_0x351d12,null))['catch'](handleError(_0x351d12,null));};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js
index 55b5263..75284c3 100644
--- a/server/api/mailQueue/mailQueue.events.js
+++ b/server/api/mailQueue/mailQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7c3=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0xb7c3,0x1f0));var _0x3b7c=function(_0x227687,_0x5bc752){_0x227687=_0x227687-0x0;var _0x5c1a30=_0xb7c3[_0x227687];return _0x5c1a30;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x3b7c('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3b7c('0x1'),'afterUpdate':_0x3b7c('0x2'),'afterDestroy':_0x3b7c('0x3')};function emitEvent(_0x3bcb78){return function(_0x4edad0,_0x2529fa,_0x1f47df){MailQueueEvents[_0x3b7c('0x4')](_0x3bcb78+':'+_0x4edad0['id'],_0x4edad0);MailQueueEvents[_0x3b7c('0x4')](_0x3bcb78,_0x4edad0);_0x1f47df(null);};}for(var e in events){if(events[_0x3b7c('0x5')](e)){var event=events[e];MailQueue[_0x3b7c('0x6')](e,emitEvent(event));}}module[_0x3b7c('0x7')]=MailQueueEvents;
\ No newline at end of file
+var _0x7f49=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x7f49,0xcb));var _0x97f4=function(_0x11295b,_0x1fd250){_0x11295b=_0x11295b-0x0;var _0x61b20=_0x7f49[_0x11295b];return _0x61b20;};'use strict';var EventEmitter=require(_0x97f4('0x0'));var MailQueue=require(_0x97f4('0x1'))['db'][_0x97f4('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x97f4('0x3'),'afterUpdate':_0x97f4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x640952){return function(_0x410725,_0x50cdc7,_0x5b7fb4){MailQueueEvents['emit'](_0x640952+':'+_0x410725['id'],_0x410725);MailQueueEvents[_0x97f4('0x5')](_0x640952,_0x410725);_0x5b7fb4(null);};}for(var e in events){if(events[_0x97f4('0x6')](e)){var event=events[e];MailQueue[_0x97f4('0x7')](e,emitEvent(event));}}module[_0x97f4('0x8')]=MailQueueEvents;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js
index 1aa8625..9d6d532 100644
--- a/server/api/mailQueue/mailQueue.model.js
+++ b/server/api/mailQueue/mailQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x73f3=['moment','bluebird','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','util','../../config/logger','api'];(function(_0x233543,_0x258205){var _0x3b34ea=function(_0x2f9e25){while(--_0x2f9e25){_0x233543['push'](_0x233543['shift']());}};_0x3b34ea(++_0x258205);}(_0x73f3,0x76));var _0x373f=function(_0x24e9e4,_0x3be39a){_0x24e9e4=_0x24e9e4-0x0;var _0x5973cc=_0x73f3[_0x24e9e4];return _0x5973cc;};'use strict';var _=require('lodash');var util=require(_0x373f('0x0'));var logger=require(_0x373f('0x1'))(_0x373f('0x2'));var moment=require(_0x373f('0x3'));var BPromise=require(_0x373f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x373f('0x5'));var config=require(_0x373f('0x6'));var attributes=require(_0x373f('0x7'));module[_0x373f('0x8')]=function(_0x234f6c,_0x599aab){return _0x234f6c['define'](_0x373f('0x9'),attributes,{'tableName':_0x373f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x555d=['api','bluebird','request-promise','path','rimraf','exports','MailQueue','mail_queues','util'];(function(_0x54658c,_0x3c5b17){var _0x52e86b=function(_0x1f1e71){while(--_0x1f1e71){_0x54658c['push'](_0x54658c['shift']());}};_0x52e86b(++_0x3c5b17);}(_0x555d,0x104));var _0xd555=function(_0x131c4c,_0x15e9a7){_0x131c4c=_0x131c4c-0x0;var _0x53d693=_0x555d[_0x131c4c];return _0x53d693;};'use strict';var _=require('lodash');var util=require(_0xd555('0x0'));var logger=require('../../config/logger')(_0xd555('0x1'));var moment=require('moment');var BPromise=require(_0xd555('0x2'));var rp=require(_0xd555('0x3'));var fs=require('fs');var path=require(_0xd555('0x4'));var rimraf=require(_0xd555('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0xd555('0x6')]=function(_0x531dc9,_0x8e370){return _0x531dc9['define'](_0xd555('0x7'),attributes,{'tableName':_0xd555('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js
index 81ba968..4886d43 100644
--- a/server/api/mailQueue/mailQueue.rpc.js
+++ b/server/api/mailQueue/mailQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3a62=['rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','info','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','findAll','options','attributes','limit','include','model','map','then','debug','GetMailQueue','find','raw','where','ShowMailQueue','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x16e586,_0x3e6274){var _0x13837d=function(_0x1c0e66){while(--_0x1c0e66){_0x16e586['push'](_0x16e586['shift']());}};_0x13837d(++_0x3e6274);}(_0x3a62,0x19d));var _0x23a6=function(_0x1bb4f0,_0x20f762){_0x1bb4f0=_0x1bb4f0-0x0;var _0x564396=_0x3a62[_0x1bb4f0];return _0x564396;};'use strict';var _=require(_0x23a6('0x0'));var util=require(_0x23a6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x23a6('0x2'));var fs=require('fs');var Redis=require(_0x23a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x23a6('0x4'))(_0x23a6('0x5'));var config=require(_0x23a6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x23a6('0x7')][_0x23a6('0x8')]({'port':0x232a});config[_0x23a6('0x9')]=_[_0x23a6('0xa')](config['redis'],{'host':_0x23a6('0xb'),'port':0x18eb});var socket=require(_0x23a6('0xc'))(new Redis(config[_0x23a6('0x9')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5020a5,_0x387763,_0x5d6d00){return new BPromise(function(_0x6afef2,_0x107784){return client[_0x23a6('0xd')](_0x5020a5,_0x5d6d00)['then'](function(_0x17d97a){logger[_0x23a6('0xe')]('MailQueue,\x20%s,\x20%s',_0x387763,'request\x20sent');logger['debug'](_0x23a6('0xf'),_0x387763,_0x23a6('0x10'),JSON[_0x23a6('0x11')](_0x17d97a));if(_0x17d97a[_0x23a6('0x12')]){if(_0x17d97a[_0x23a6('0x12')][_0x23a6('0x13')]===0x1f4){logger[_0x23a6('0x12')](_0x23a6('0x14'),_0x387763,_0x17d97a[_0x23a6('0x12')][_0x23a6('0x15')]);return _0x107784(_0x17d97a[_0x23a6('0x12')]['message']);}logger[_0x23a6('0x12')](_0x23a6('0x14'),_0x387763,_0x17d97a['error']['message']);return _0x6afef2(_0x17d97a['error'][_0x23a6('0x15')]);}else{logger[_0x23a6('0xe')](_0x23a6('0x14'),_0x387763,_0x23a6('0x10'));_0x6afef2(_0x17d97a[_0x23a6('0x16')][_0x23a6('0x15')]);}})[_0x23a6('0x17')](function(_0x5caae0){logger['error']('MailQueue,\x20%s,\x20%s',_0x387763,_0x5caae0);_0x107784(_0x5caae0);});});}exports['GetMailQueue']=function(_0x3d706d){var _0xefc23b=this;return new Promise(function(_0x257409,_0x11b999){return db['MailQueue'][_0x23a6('0x18')]({'raw':_0x3d706d[_0x23a6('0x19')]?_0x3d706d['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d706d[_0x23a6('0x19')]?_0x3d706d[_0x23a6('0x19')]['where']||null:null,'attributes':_0x3d706d[_0x23a6('0x19')]?_0x3d706d[_0x23a6('0x19')][_0x23a6('0x1a')]||null:null,'limit':_0x3d706d[_0x23a6('0x19')]?_0x3d706d[_0x23a6('0x19')][_0x23a6('0x1b')]||null:null,'include':_0x3d706d['options']?_0x3d706d[_0x23a6('0x19')]['include']?_['map'](_0x3d706d[_0x23a6('0x19')][_0x23a6('0x1c')],function(_0x33b830){return{'model':db[_0x33b830[_0x23a6('0x1d')]],'as':_0x33b830['as'],'attributes':_0x33b830['attributes'],'include':_0x33b830[_0x23a6('0x1c')]?_[_0x23a6('0x1e')](_0x33b830[_0x23a6('0x1c')],function(_0x5367fb){return{'model':db[_0x5367fb[_0x23a6('0x1d')]],'as':_0x5367fb['as'],'attributes':_0x5367fb[_0x23a6('0x1a')],'include':_0x5367fb[_0x23a6('0x1c')]?_[_0x23a6('0x1e')](_0x5367fb[_0x23a6('0x1c')],function(_0x359c15){return{'model':db[_0x359c15['model']],'as':_0x359c15['as'],'attributes':_0x359c15[_0x23a6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x23a6('0x1f')](function(_0x22a752){logger[_0x23a6('0xe')]('GetMailQueue',_0x3d706d);logger[_0x23a6('0x20')]('GetMailQueue',_0x3d706d,JSON['stringify'](_0x22a752));_0x257409(_0x22a752);})[_0x23a6('0x17')](function(_0x4f0d44){logger[_0x23a6('0x12')](_0x23a6('0x21'),_0x4f0d44[_0x23a6('0x15')],_0x3d706d);_0x11b999(_0xefc23b[_0x23a6('0x12')](0x1f4,_0x4f0d44[_0x23a6('0x15')]));});});};exports['ShowMailQueue']=function(_0x1dd5e3){var _0x5841cc=this;return new Promise(function(_0x673721,_0x43b3e6){return db['MailQueue'][_0x23a6('0x22')]({'raw':_0x1dd5e3[_0x23a6('0x19')]?_0x1dd5e3[_0x23a6('0x19')][_0x23a6('0x23')]===undefined?!![]:![]:!![],'where':_0x1dd5e3['options']?_0x1dd5e3['options'][_0x23a6('0x24')]||null:null,'attributes':_0x1dd5e3[_0x23a6('0x19')]?_0x1dd5e3[_0x23a6('0x19')]['attributes']||null:null,'include':_0x1dd5e3[_0x23a6('0x19')]?_0x1dd5e3[_0x23a6('0x19')]['include']?_[_0x23a6('0x1e')](_0x1dd5e3['options'][_0x23a6('0x1c')],function(_0xcc70d9){return{'model':db[_0xcc70d9[_0x23a6('0x1d')]],'as':_0xcc70d9['as'],'attributes':_0xcc70d9['attributes'],'include':_0xcc70d9[_0x23a6('0x1c')]?_[_0x23a6('0x1e')](_0xcc70d9[_0x23a6('0x1c')],function(_0xa01fdc){return{'model':db[_0xa01fdc[_0x23a6('0x1d')]],'as':_0xa01fdc['as'],'attributes':_0xa01fdc[_0x23a6('0x1a')],'include':_0xa01fdc['include']?_[_0x23a6('0x1e')](_0xa01fdc[_0x23a6('0x1c')],function(_0x49d7c7){return{'model':db[_0x49d7c7[_0x23a6('0x1d')]],'as':_0x49d7c7['as'],'attributes':_0x49d7c7[_0x23a6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x23a6('0x1f')](function(_0x36bcda){logger['info']('ShowMailQueue',_0x1dd5e3);logger[_0x23a6('0x20')]('ShowMailQueue',_0x1dd5e3,JSON[_0x23a6('0x11')](_0x36bcda));_0x673721(_0x36bcda);})['catch'](function(_0x570c71){logger['error'](_0x23a6('0x25'),_0x570c71[_0x23a6('0x15')],_0x1dd5e3);_0x43b3e6(_0x5841cc[_0x23a6('0x12')](0x1f4,_0x570c71[_0x23a6('0x15')]));});});};
\ No newline at end of file
+var _0xfeba=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','MailQueue','find','lodash','util','moment','randomstring'];(function(_0x489b94,_0x2bb8b9){var _0x35e6b7=function(_0x433359){while(--_0x433359){_0x489b94['push'](_0x489b94['shift']());}};_0x35e6b7(++_0x2bb8b9);}(_0xfeba,0x1f4));var _0xafeb=function(_0x2e4f62,_0x51fd4d){_0x2e4f62=_0x2e4f62-0x0;var _0x2cdfb9=_0xfeba[_0x2e4f62];return _0x2cdfb9;};'use strict';var _=require(_0xafeb('0x0'));var util=require(_0xafeb('0x1'));var moment=require(_0xafeb('0x2'));var BPromise=require('bluebird');var rs=require(_0xafeb('0x3'));var fs=require('fs');var Redis=require(_0xafeb('0x4'));var db=require(_0xafeb('0x5'))['db'];var utils=require(_0xafeb('0x6'));var logger=require('../../config/logger')(_0xafeb('0x7'));var config=require(_0xafeb('0x8'));var jayson=require(_0xafeb('0x9'));var client=jayson[_0xafeb('0xa')][_0xafeb('0xb')]({'port':0x232a});config[_0xafeb('0xc')]=_[_0xafeb('0xd')](config[_0xafeb('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xafeb('0xe'))(new Redis(config[_0xafeb('0xc')]));require(_0xafeb('0xf'))[_0xafeb('0x10')](socket);function respondWithRpcPromise(_0x1368cd,_0x455de3,_0x5f2a0e){return new BPromise(function(_0x532fe6,_0xbc6d4c){return client[_0xafeb('0x11')](_0x1368cd,_0x5f2a0e)[_0xafeb('0x12')](function(_0x577f86){logger['info'](_0xafeb('0x13'),_0x455de3,_0xafeb('0x14'));logger[_0xafeb('0x15')](_0xafeb('0x16'),_0x455de3,_0xafeb('0x14'),JSON[_0xafeb('0x17')](_0x577f86));if(_0x577f86['error']){if(_0x577f86[_0xafeb('0x18')][_0xafeb('0x19')]===0x1f4){logger[_0xafeb('0x18')](_0xafeb('0x13'),_0x455de3,_0x577f86['error'][_0xafeb('0x1a')]);return _0xbc6d4c(_0x577f86[_0xafeb('0x18')][_0xafeb('0x1a')]);}logger['error'](_0xafeb('0x13'),_0x455de3,_0x577f86[_0xafeb('0x18')][_0xafeb('0x1a')]);return _0x532fe6(_0x577f86[_0xafeb('0x18')][_0xafeb('0x1a')]);}else{logger[_0xafeb('0x1b')]('MailQueue,\x20%s,\x20%s',_0x455de3,'request\x20sent');_0x532fe6(_0x577f86['result'][_0xafeb('0x1a')]);}})[_0xafeb('0x1c')](function(_0x103487){logger[_0xafeb('0x18')](_0xafeb('0x13'),_0x455de3,_0x103487);_0xbc6d4c(_0x103487);});});}exports[_0xafeb('0x1d')]=function(_0x216389){var _0x3eb5ee=this;return new Promise(function(_0x19e5a5,_0x5dffa6){return db['MailQueue'][_0xafeb('0x1e')]({'raw':_0x216389[_0xafeb('0x1f')]?_0x216389[_0xafeb('0x1f')][_0xafeb('0x20')]===undefined?!![]:![]:!![],'where':_0x216389[_0xafeb('0x1f')]?_0x216389[_0xafeb('0x1f')][_0xafeb('0x21')]||null:null,'attributes':_0x216389[_0xafeb('0x1f')]?_0x216389[_0xafeb('0x1f')][_0xafeb('0x22')]||null:null,'limit':_0x216389[_0xafeb('0x1f')]?_0x216389[_0xafeb('0x1f')][_0xafeb('0x23')]||null:null,'include':_0x216389[_0xafeb('0x1f')]?_0x216389[_0xafeb('0x1f')][_0xafeb('0x24')]?_[_0xafeb('0x25')](_0x216389[_0xafeb('0x1f')][_0xafeb('0x24')],function(_0x198374){return{'model':db[_0x198374['model']],'as':_0x198374['as'],'attributes':_0x198374[_0xafeb('0x22')],'include':_0x198374['include']?_[_0xafeb('0x25')](_0x198374[_0xafeb('0x24')],function(_0x494654){return{'model':db[_0x494654['model']],'as':_0x494654['as'],'attributes':_0x494654[_0xafeb('0x22')],'include':_0x494654[_0xafeb('0x24')]?_[_0xafeb('0x25')](_0x494654[_0xafeb('0x24')],function(_0x47c31f){return{'model':db[_0x47c31f[_0xafeb('0x26')]],'as':_0x47c31f['as'],'attributes':_0x47c31f[_0xafeb('0x22')]};}):[]};}):[]};}):[]:[]})[_0xafeb('0x12')](function(_0x367676){logger['info'](_0xafeb('0x1d'),_0x216389);logger[_0xafeb('0x15')]('GetMailQueue',_0x216389,JSON[_0xafeb('0x17')](_0x367676));_0x19e5a5(_0x367676);})[_0xafeb('0x1c')](function(_0x31dd50){logger[_0xafeb('0x18')](_0xafeb('0x1d'),_0x31dd50[_0xafeb('0x1a')],_0x216389);_0x5dffa6(_0x3eb5ee[_0xafeb('0x18')](0x1f4,_0x31dd50[_0xafeb('0x1a')]));});});};exports[_0xafeb('0x27')]=function(_0x56a313){var _0x251a0a=this;return new Promise(function(_0x157bb0,_0xa316b7){return db[_0xafeb('0x28')][_0xafeb('0x29')]({'raw':_0x56a313['options']?_0x56a313[_0xafeb('0x1f')][_0xafeb('0x20')]===undefined?!![]:![]:!![],'where':_0x56a313[_0xafeb('0x1f')]?_0x56a313['options'][_0xafeb('0x21')]||null:null,'attributes':_0x56a313[_0xafeb('0x1f')]?_0x56a313[_0xafeb('0x1f')][_0xafeb('0x22')]||null:null,'include':_0x56a313[_0xafeb('0x1f')]?_0x56a313['options'][_0xafeb('0x24')]?_[_0xafeb('0x25')](_0x56a313[_0xafeb('0x1f')][_0xafeb('0x24')],function(_0x61c558){return{'model':db[_0x61c558[_0xafeb('0x26')]],'as':_0x61c558['as'],'attributes':_0x61c558[_0xafeb('0x22')],'include':_0x61c558[_0xafeb('0x24')]?_[_0xafeb('0x25')](_0x61c558[_0xafeb('0x24')],function(_0x5e68ee){return{'model':db[_0x5e68ee[_0xafeb('0x26')]],'as':_0x5e68ee['as'],'attributes':_0x5e68ee[_0xafeb('0x22')],'include':_0x5e68ee[_0xafeb('0x24')]?_[_0xafeb('0x25')](_0x5e68ee[_0xafeb('0x24')],function(_0x3810ad){return{'model':db[_0x3810ad[_0xafeb('0x26')]],'as':_0x3810ad['as'],'attributes':_0x3810ad[_0xafeb('0x22')]};}):[]};}):[]};}):[]:[]})[_0xafeb('0x12')](function(_0x52e565){logger['info'](_0xafeb('0x27'),_0x56a313);logger[_0xafeb('0x15')](_0xafeb('0x27'),_0x56a313,JSON[_0xafeb('0x17')](_0x52e565));_0x157bb0(_0x52e565);})[_0xafeb('0x1c')](function(_0x269783){logger['error'](_0xafeb('0x27'),_0x269783[_0xafeb('0x1a')],_0x56a313);_0xa316b7(_0x251a0a['error'](0x1f4,_0x269783[_0xafeb('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js
index 8e8124a..0b32f1e 100644
--- a/server/api/mailQueue/mailQueue.socket.js
+++ b/server/api/mailQueue/mailQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf468=['save','update','emit','register','length','./mailQueue.events'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf468,0x1e5));var _0x8f46=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xf468[_0x1cfa0d];return _0xe33279;};'use strict';var MailQueueEvents=require(_0x8f46('0x0'));var events=[_0x8f46('0x1'),'remove',_0x8f46('0x2')];function createListener(_0x525677,_0x3f9aba){return function(_0x2ac263){_0x3f9aba[_0x8f46('0x3')](_0x525677,_0x2ac263);};}function removeListener(_0xefc6cd,_0x2abe67){return function(){MailQueueEvents['removeListener'](_0xefc6cd,_0x2abe67);};}exports[_0x8f46('0x4')]=function(_0x5ef851){for(var _0x1210c8=0x0,_0x240358=events[_0x8f46('0x5')];_0x1210c8<_0x240358;_0x1210c8++){var _0x19a7ec=events[_0x1210c8];var _0x5e299c=createListener('mailQueue:'+_0x19a7ec,_0x5ef851);MailQueueEvents['on'](_0x19a7ec,_0x5e299c);}};
\ No newline at end of file
+var _0x9726=['emit','removeListener','length','mailQueue:','save','update'];(function(_0x1f62c3,_0x1ff95b){var _0x385c1c=function(_0x1db580){while(--_0x1db580){_0x1f62c3['push'](_0x1f62c3['shift']());}};_0x385c1c(++_0x1ff95b);}(_0x9726,0x1d8));var _0x6972=function(_0x2b6b83,_0x4ae6a2){_0x2b6b83=_0x2b6b83-0x0;var _0x4448f5=_0x9726[_0x2b6b83];return _0x4448f5;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x6972('0x0'),'remove',_0x6972('0x1')];function createListener(_0xd10e15,_0x599594){return function(_0x3750b9){_0x599594[_0x6972('0x2')](_0xd10e15,_0x3750b9);};}function removeListener(_0x308088,_0x23916a){return function(){MailQueueEvents[_0x6972('0x3')](_0x308088,_0x23916a);};}exports['register']=function(_0x1fa37e){for(var _0x1a47e6=0x0,_0x193520=events[_0x6972('0x4')];_0x1a47e6<_0x193520;_0x1a47e6++){var _0x58009f=events[_0x1a47e6];var _0x118ef3=createListener(_0x6972('0x5')+_0x58009f,_0x1fa37e);MailQueueEvents['on'](_0x58009f,_0x118ef3);}};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js
index 36bb118..0ecf9bb 100644
--- a/server/api/mailQueueReport/index.js
+++ b/server/api/mailQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7717=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','create','put','update','destroy','exports'];(function(_0x4b1cf8,_0x4ce962){var _0x45cac1=function(_0x5ac132){while(--_0x5ac132){_0x4b1cf8['push'](_0x4b1cf8['shift']());}};_0x45cac1(++_0x4ce962);}(_0x7717,0x168));var _0x7771=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7717[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7771('0x0'));var util=require(_0x7771('0x1'));var path=require(_0x7771('0x2'));var timeout=require('connect-timeout');var express=require(_0x7771('0x3'));var router=express[_0x7771('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7771('0x5'));var config=require(_0x7771('0x6'));var controller=require('./mailQueueReport.controller');router[_0x7771('0x7')]('/',auth[_0x7771('0x8')](),controller['index']);router[_0x7771('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x7771('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x7771('0x8')](),controller[_0x7771('0xa')]);router[_0x7771('0xb')](_0x7771('0x9'),auth[_0x7771('0x8')](),controller[_0x7771('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7771('0xd')]);module[_0x7771('0xe')]=router;
\ No newline at end of file
+var _0x17ec=['../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x56991a,_0x42e4ec){var _0x231e9c=function(_0x41d45b){while(--_0x41d45b){_0x56991a['push'](_0x56991a['shift']());}};_0x231e9c(++_0x42e4ec);}(_0x17ec,0xb0));var _0xc17e=function(_0x1c1b8c,_0x4078d3){_0x1c1b8c=_0x1c1b8c-0x0;var _0x1f00d4=_0x17ec[_0x1c1b8c];return _0x1f00d4;};'use strict';var multer=require(_0xc17e('0x0'));var util=require('util');var path=require(_0xc17e('0x1'));var timeout=require(_0xc17e('0x2'));var express=require(_0xc17e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc17e('0x4'));var config=require(_0xc17e('0x5'));var controller=require(_0xc17e('0x6'));router[_0xc17e('0x7')]('/',auth[_0xc17e('0x8')](),controller[_0xc17e('0x9')]);router[_0xc17e('0x7')](_0xc17e('0xa'),auth[_0xc17e('0x8')](),controller[_0xc17e('0xb')]);router[_0xc17e('0x7')](_0xc17e('0xc'),auth[_0xc17e('0x8')](),controller[_0xc17e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc17e('0xe')]);router[_0xc17e('0xf')](_0xc17e('0xc'),auth[_0xc17e('0x8')](),controller[_0xc17e('0x10')]);router[_0xc17e('0x11')](_0xc17e('0xc'),auth[_0xc17e('0x8')](),controller[_0xc17e('0x12')]);module[_0xc17e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js
index 645dd94..0ed5fe9 100644
--- a/server/api/mailQueueReport/mailQueueReport.attributes.js
+++ b/server/api/mailQueueReport/mailQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b81=['sequelize','exports','STRING','DATE','moment'];(function(_0x1b1365,_0x205568){var _0x5edfd8=function(_0xae9b3d){while(--_0xae9b3d){_0x1b1365['push'](_0x1b1365['shift']());}};_0x5edfd8(++_0x205568);}(_0x5b81,0xf4));var _0x15b8=function(_0x5cda03,_0x249db1){_0x5cda03=_0x5cda03-0x0;var _0x4318d5=_0x5b81[_0x5cda03];return _0x4318d5;};'use strict';var moment=require(_0x15b8('0x0'));var Sequelize=require(_0x15b8('0x1'));module[_0x15b8('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x15b8('0x3')]},'joinAt':{'type':Sequelize[_0x15b8('0x4')]},'leaveAt':{'type':Sequelize[_0x15b8('0x4')]},'acceptAt':{'type':Sequelize[_0x15b8('0x4')]},'exitAt':{'type':Sequelize[_0x15b8('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1116=['DATE','moment','sequelize','STRING'];(function(_0x2827d3,_0x14f01b){var _0x82fc1c=function(_0x5ba2f8){while(--_0x5ba2f8){_0x2827d3['push'](_0x2827d3['shift']());}};_0x82fc1c(++_0x14f01b);}(_0x1116,0x16d));var _0x6111=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x1116[_0x3ab9ee];return _0x82ee88;};'use strict';var moment=require(_0x6111('0x0'));var Sequelize=require(_0x6111('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6111('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6111('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js
index 0fad467..73f004c 100644
--- a/server/api/mailQueueReport/mailQueueReport.controller.js
+++ b/server/api/mailQueueReport/mailQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9a0b=['index','MailQueueReport','rawAttributes','fieldName','type','key','map','keys','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','params','length','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send'];(function(_0x75b304,_0x27d53f){var _0x321412=function(_0x37adb0){while(--_0x37adb0){_0x75b304['push'](_0x75b304['shift']());}};_0x321412(++_0x27d53f);}(_0x9a0b,0xff));var _0xb9a0=function(_0x2fb1b3,_0x264ac2){_0x2fb1b3=_0x2fb1b3-0x0;var _0x25fd2c=_0x9a0b[_0x2fb1b3];return _0x25fd2c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb9a0('0x0'));var zipdir=require(_0xb9a0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9a0('0x2'));var moment=require(_0xb9a0('0x3'));var BPromise=require(_0xb9a0('0x4'));var Mustache=require(_0xb9a0('0x5'));var util=require(_0xb9a0('0x6'));var path=require(_0xb9a0('0x7'));var sox=require(_0xb9a0('0x8'));var csv=require(_0xb9a0('0x9'));var ejs=require(_0xb9a0('0xa'));var fs=require('fs');var _=require(_0xb9a0('0xb'));var squel=require(_0xb9a0('0xc'));var crypto=require(_0xb9a0('0xd'));var jsforce=require(_0xb9a0('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb9a0('0xf'));var Papa=require(_0xb9a0('0x10'));var Redis=require('ioredis');var authService=require(_0xb9a0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb9a0('0x12'));var hardwareService=require(_0xb9a0('0x13'));var logger=require(_0xb9a0('0x14'))(_0xb9a0('0x15'));var utils=require(_0xb9a0('0x16'));var config=require(_0xb9a0('0x17'));var db=require(_0xb9a0('0x18'))['db'];function respondWithStatusCode(_0xeec7f4,_0x1d4ae3){_0x1d4ae3=_0x1d4ae3||0xcc;return function(_0x45533b){if(_0x45533b){return _0xeec7f4[_0xb9a0('0x19')](_0x1d4ae3);}return _0xeec7f4[_0xb9a0('0x1a')](_0x1d4ae3)[_0xb9a0('0x1b')]();};}function respondWithResult(_0x1f1458,_0x386343){_0x386343=_0x386343||0xc8;return function(_0x38f17f){if(_0x38f17f){return _0x1f1458[_0xb9a0('0x1a')](_0x386343)['json'](_0x38f17f);}};}function respondWithFilteredResult(_0x588f84,_0x44aabb){return function(_0x2670df){if(_0x2670df){var _0x39fe85=_0x2670df[_0xb9a0('0x1c')],_0x2395c3=_0x44aabb['offset'],_0x280365=_0x44aabb[_0xb9a0('0x1d')]+_0x44aabb[_0xb9a0('0x1e')],_0x2accf0;if(_0x280365>=_0x39fe85){_0x280365=_0x39fe85;_0x2accf0=0xc8;}else{_0x2accf0=0xce;}_0x588f84[_0xb9a0('0x1a')](_0x2accf0);return _0x588f84[_0xb9a0('0x1f')](_0xb9a0('0x20'),_0x2395c3+'-'+_0x280365+'/'+_0x39fe85)['json'](_0x2670df);}return null;};}function patchUpdates(_0x142d96){return function(_0x3b944a){try{jsonpatch[_0xb9a0('0x21')](_0x3b944a,_0x142d96,!![]);}catch(_0xe0a836){return BPromise['reject'](_0xe0a836);}return _0x3b944a[_0xb9a0('0x22')]();};}function saveUpdates(_0x5067b3,_0x20d4bb){return function(_0x1a3f6c){if(_0x1a3f6c){return _0x1a3f6c[_0xb9a0('0x23')](_0x5067b3)[_0xb9a0('0x24')](function(_0x4979e0){return _0x4979e0;});}return null;};}function removeEntity(_0x34ca5a,_0x38f101){return function(_0x5015b0){if(_0x5015b0){return _0x5015b0[_0xb9a0('0x25')]()[_0xb9a0('0x24')](function(){_0x34ca5a[_0xb9a0('0x1a')](0xcc)[_0xb9a0('0x1b')]();});}};}function handleEntityNotFound(_0x282c29,_0x4820a3){return function(_0x3117d1){if(!_0x3117d1){_0x282c29['sendStatus'](0x194);}return _0x3117d1;};}function handleError(_0x3514a4,_0x1b4b7e){_0x1b4b7e=_0x1b4b7e||0x1f4;return function(_0x18ed03){logger['error'](_0x18ed03[_0xb9a0('0x26')]);if(_0x18ed03['name']){delete _0x18ed03[_0xb9a0('0x27')];}_0x3514a4[_0xb9a0('0x1a')](_0x1b4b7e)[_0xb9a0('0x28')](_0x18ed03);};}exports[_0xb9a0('0x29')]=function(_0x12c56c,_0x242c84){var _0x3451af={},_0x1611e6={},_0x211de8={'count':0x0,'rows':[]};var _0xd4e6c4=_['map'](db[_0xb9a0('0x2a')][_0xb9a0('0x2b')],function(_0x5cd33a){return{'name':_0x5cd33a[_0xb9a0('0x2c')],'type':_0x5cd33a[_0xb9a0('0x2d')][_0xb9a0('0x2e')]};});_0x1611e6['model']=_[_0xb9a0('0x2f')](_0xd4e6c4,_0xb9a0('0x27'));_0x1611e6['query']=_[_0xb9a0('0x30')](_0x12c56c[_0xb9a0('0x31')]);_0x1611e6['filters']=_[_0xb9a0('0x32')](_0x1611e6['model'],_0x1611e6[_0xb9a0('0x31')]);_0x3451af[_0xb9a0('0x33')]=_[_0xb9a0('0x32')](_0x1611e6[_0xb9a0('0x34')],qs[_0xb9a0('0x35')](_0x12c56c[_0xb9a0('0x31')][_0xb9a0('0x35')]));_0x3451af[_0xb9a0('0x33')]=_0x3451af[_0xb9a0('0x33')]['length']?_0x3451af[_0xb9a0('0x33')]:_0x1611e6[_0xb9a0('0x34')];if(!_0x12c56c[_0xb9a0('0x31')][_0xb9a0('0x36')](_0xb9a0('0x37'))){_0x3451af[_0xb9a0('0x1e')]=qs['limit'](_0x12c56c[_0xb9a0('0x31')]['limit']);_0x3451af[_0xb9a0('0x1d')]=qs[_0xb9a0('0x1d')](_0x12c56c['query'][_0xb9a0('0x1d')]);}_0x3451af['order']=qs[_0xb9a0('0x38')](_0x12c56c[_0xb9a0('0x31')][_0xb9a0('0x38')]);_0x3451af[_0xb9a0('0x39')]=qs['filters'](_[_0xb9a0('0x3a')](_0x12c56c['query'],_0x1611e6[_0xb9a0('0x3b')]),_0xd4e6c4);if(_0x12c56c[_0xb9a0('0x31')]['filter']){_0x3451af[_0xb9a0('0x39')]=_['merge'](_0x3451af[_0xb9a0('0x39')],{'$or':_[_0xb9a0('0x2f')](_0xd4e6c4,function(_0x52cca9){if(_0x52cca9['type']!==_0xb9a0('0x3c')){var _0x32be87={};_0x32be87[_0x52cca9[_0xb9a0('0x27')]]={'$like':'%'+_0x12c56c['query'][_0xb9a0('0x3d')]+'%'};return _0x32be87;}})});}_0x3451af=_[_0xb9a0('0x3e')]({},_0x3451af,_0x12c56c[_0xb9a0('0x3f')]);var _0x4157eb={'where':_0x3451af[_0xb9a0('0x39')]};return db['MailQueueReport']['count'](_0x4157eb)['then'](function(_0x499959){_0x211de8[_0xb9a0('0x1c')]=_0x499959;if(_0x12c56c[_0xb9a0('0x31')][_0xb9a0('0x40')]){_0x3451af['include']=[{'all':!![]}];}return db['MailQueueReport'][_0xb9a0('0x41')](_0x3451af);})[_0xb9a0('0x24')](function(_0x4bb043){_0x211de8[_0xb9a0('0x42')]=_0x4bb043;return _0x211de8;})[_0xb9a0('0x24')](respondWithFilteredResult(_0x242c84,_0x3451af))[_0xb9a0('0x43')](handleError(_0x242c84,null));};exports['show']=function(_0x53d668,_0x3f7baa){var _0x565e78={'raw':!![],'where':{'id':_0x53d668[_0xb9a0('0x44')]['id']}},_0x71ce98={};_0x71ce98['model']=_[_0xb9a0('0x30')](db[_0xb9a0('0x2a')][_0xb9a0('0x2b')]);_0x71ce98[_0xb9a0('0x31')]=_[_0xb9a0('0x30')](_0x53d668['query']);_0x71ce98['filters']=_[_0xb9a0('0x32')](_0x71ce98[_0xb9a0('0x34')],_0x71ce98[_0xb9a0('0x31')]);_0x565e78[_0xb9a0('0x33')]=_[_0xb9a0('0x32')](_0x71ce98[_0xb9a0('0x34')],qs['fields'](_0x53d668['query']['fields']));_0x565e78['attributes']=_0x565e78['attributes'][_0xb9a0('0x45')]?_0x565e78[_0xb9a0('0x33')]:_0x71ce98[_0xb9a0('0x34')];if(_0x53d668[_0xb9a0('0x31')]['includeAll']){_0x565e78['include']=[{'all':!![]}];}_0x565e78=_['merge']({},_0x565e78,_0x53d668[_0xb9a0('0x3f')]);return db['MailQueueReport'][_0xb9a0('0x46')](_0x565e78)[_0xb9a0('0x24')](handleEntityNotFound(_0x3f7baa,null))['then'](respondWithResult(_0x3f7baa,null))[_0xb9a0('0x43')](handleError(_0x3f7baa,null));};exports[_0xb9a0('0x47')]=function(_0x16d569,_0x192671){return db['MailQueueReport'][_0xb9a0('0x47')](_0x16d569['body'],{})[_0xb9a0('0x24')](respondWithResult(_0x192671,0xc9))[_0xb9a0('0x43')](handleError(_0x192671,null));};exports[_0xb9a0('0x23')]=function(_0xc83db1,_0x4df346){if(_0xc83db1[_0xb9a0('0x48')]['id']){delete _0xc83db1['body']['id'];}return db['MailQueueReport'][_0xb9a0('0x46')]({'where':{'id':_0xc83db1[_0xb9a0('0x44')]['id']}})['then'](handleEntityNotFound(_0x4df346,null))[_0xb9a0('0x24')](saveUpdates(_0xc83db1[_0xb9a0('0x48')],null))[_0xb9a0('0x24')](respondWithResult(_0x4df346,null))[_0xb9a0('0x43')](handleError(_0x4df346,null));};exports[_0xb9a0('0x25')]=function(_0x2d46d0,_0x171caa){return db[_0xb9a0('0x2a')][_0xb9a0('0x46')]({'where':{'id':_0x2d46d0[_0xb9a0('0x44')]['id']}})[_0xb9a0('0x24')](handleEntityNotFound(_0x171caa,null))[_0xb9a0('0x24')](removeEntity(_0x171caa,null))[_0xb9a0('0x43')](handleError(_0x171caa,null));};exports[_0xb9a0('0x49')]=function(_0x2e0e79,_0x15b000){return db[_0xb9a0('0x2a')]['describe']()[_0xb9a0('0x24')](respondWithResult(_0x15b000,null))['catch'](handleError(_0x15b000,null));};
\ No newline at end of file
+var _0x7d23=['params','describe','html-pdf','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','MailQueueReport','include','rows','catch','show','keys','find','create','body'];(function(_0x2a723f,_0x5249e7){var _0x2117f9=function(_0x2a6eca){while(--_0x2a6eca){_0x2a723f['push'](_0x2a723f['shift']());}};_0x2117f9(++_0x5249e7);}(_0x7d23,0x136));var _0x37d2=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x7d23[_0x476bf4];return _0x788ffe;};'use strict';var pdf=require(_0x37d2('0x0'));var emlformat=require(_0x37d2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x37d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x37d2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x37d2('0x4'));var util=require(_0x37d2('0x5'));var path=require(_0x37d2('0x6'));var sox=require(_0x37d2('0x7'));var csv=require(_0x37d2('0x8'));var ejs=require(_0x37d2('0x9'));var fs=require('fs');var _=require(_0x37d2('0xa'));var squel=require(_0x37d2('0xb'));var crypto=require('crypto');var jsforce=require(_0x37d2('0xc'));var deskjs=require(_0x37d2('0xd'));var toCsv=require(_0x37d2('0x8'));var querystring=require(_0x37d2('0xe'));var Papa=require(_0x37d2('0xf'));var Redis=require(_0x37d2('0x10'));var authService=require(_0x37d2('0x11'));var qs=require(_0x37d2('0x12'));var as=require(_0x37d2('0x13'));var hardwareService=require(_0x37d2('0x14'));var logger=require(_0x37d2('0x15'))(_0x37d2('0x16'));var utils=require(_0x37d2('0x17'));var config=require('../../config/environment');var db=require(_0x37d2('0x18'))['db'];function respondWithStatusCode(_0x50f805,_0x465b37){_0x465b37=_0x465b37||0xcc;return function(_0x2638c4){if(_0x2638c4){return _0x50f805[_0x37d2('0x19')](_0x465b37);}return _0x50f805[_0x37d2('0x1a')](_0x465b37)[_0x37d2('0x1b')]();};}function respondWithResult(_0x31c6a2,_0x4f4727){_0x4f4727=_0x4f4727||0xc8;return function(_0x3504de){if(_0x3504de){return _0x31c6a2['status'](_0x4f4727)[_0x37d2('0x1c')](_0x3504de);}};}function respondWithFilteredResult(_0x3595b5,_0x2814de){return function(_0x523165){if(_0x523165){var _0x5eec52=_0x523165[_0x37d2('0x1d')],_0x10e9d3=_0x2814de['offset'],_0x327d7d=_0x2814de[_0x37d2('0x1e')]+_0x2814de[_0x37d2('0x1f')],_0xb421ff;if(_0x327d7d>=_0x5eec52){_0x327d7d=_0x5eec52;_0xb421ff=0xc8;}else{_0xb421ff=0xce;}_0x3595b5['status'](_0xb421ff);return _0x3595b5[_0x37d2('0x20')](_0x37d2('0x21'),_0x10e9d3+'-'+_0x327d7d+'/'+_0x5eec52)[_0x37d2('0x1c')](_0x523165);}return null;};}function patchUpdates(_0x16163b){return function(_0x911517){try{jsonpatch[_0x37d2('0x22')](_0x911517,_0x16163b,!![]);}catch(_0x56c474){return BPromise[_0x37d2('0x23')](_0x56c474);}return _0x911517[_0x37d2('0x24')]();};}function saveUpdates(_0x3a0079,_0xfb979a){return function(_0x73121c){if(_0x73121c){return _0x73121c[_0x37d2('0x25')](_0x3a0079)[_0x37d2('0x26')](function(_0x1f99e1){return _0x1f99e1;});}return null;};}function removeEntity(_0x1eb413,_0x368478){return function(_0x29e50c){if(_0x29e50c){return _0x29e50c[_0x37d2('0x27')]()['then'](function(){_0x1eb413[_0x37d2('0x1a')](0xcc)[_0x37d2('0x1b')]();});}};}function handleEntityNotFound(_0x114fed,_0x207e02){return function(_0x46ea1d){if(!_0x46ea1d){_0x114fed[_0x37d2('0x19')](0x194);}return _0x46ea1d;};}function handleError(_0x57a2a5,_0xe13772){_0xe13772=_0xe13772||0x1f4;return function(_0x4378af){logger['error'](_0x4378af[_0x37d2('0x28')]);if(_0x4378af[_0x37d2('0x29')]){delete _0x4378af[_0x37d2('0x29')];}_0x57a2a5[_0x37d2('0x1a')](_0xe13772)[_0x37d2('0x2a')](_0x4378af);};}exports[_0x37d2('0x2b')]=function(_0x56efc2,_0x54de2a){var _0x20bb1a={},_0x8de19d={},_0x53589e={'count':0x0,'rows':[]};var _0x2208f5=_[_0x37d2('0x2c')](db['MailQueueReport'][_0x37d2('0x2d')],function(_0x3a1cec){return{'name':_0x3a1cec[_0x37d2('0x2e')],'type':_0x3a1cec[_0x37d2('0x2f')][_0x37d2('0x30')]};});_0x8de19d[_0x37d2('0x31')]=_['map'](_0x2208f5,_0x37d2('0x29'));_0x8de19d[_0x37d2('0x32')]=_['keys'](_0x56efc2['query']);_0x8de19d[_0x37d2('0x33')]=_[_0x37d2('0x34')](_0x8de19d['model'],_0x8de19d[_0x37d2('0x32')]);_0x20bb1a['attributes']=_['intersection'](_0x8de19d[_0x37d2('0x31')],qs[_0x37d2('0x35')](_0x56efc2[_0x37d2('0x32')]['fields']));_0x20bb1a['attributes']=_0x20bb1a[_0x37d2('0x36')][_0x37d2('0x37')]?_0x20bb1a[_0x37d2('0x36')]:_0x8de19d[_0x37d2('0x31')];if(!_0x56efc2[_0x37d2('0x32')][_0x37d2('0x38')](_0x37d2('0x39'))){_0x20bb1a[_0x37d2('0x1f')]=qs[_0x37d2('0x1f')](_0x56efc2[_0x37d2('0x32')][_0x37d2('0x1f')]);_0x20bb1a[_0x37d2('0x1e')]=qs[_0x37d2('0x1e')](_0x56efc2[_0x37d2('0x32')][_0x37d2('0x1e')]);}_0x20bb1a[_0x37d2('0x3a')]=qs[_0x37d2('0x3b')](_0x56efc2['query'][_0x37d2('0x3b')]);_0x20bb1a[_0x37d2('0x3c')]=qs[_0x37d2('0x33')](_[_0x37d2('0x3d')](_0x56efc2['query'],_0x8de19d['filters']),_0x2208f5);if(_0x56efc2[_0x37d2('0x32')]['filter']){_0x20bb1a['where']=_[_0x37d2('0x3e')](_0x20bb1a[_0x37d2('0x3c')],{'$or':_['map'](_0x2208f5,function(_0x2c7ab4){if(_0x2c7ab4[_0x37d2('0x2f')]!==_0x37d2('0x3f')){var _0x365054={};_0x365054[_0x2c7ab4['name']]={'$like':'%'+_0x56efc2[_0x37d2('0x32')][_0x37d2('0x40')]+'%'};return _0x365054;}})});}_0x20bb1a=_[_0x37d2('0x3e')]({},_0x20bb1a,_0x56efc2[_0x37d2('0x41')]);var _0x313a07={'where':_0x20bb1a[_0x37d2('0x3c')]};return db[_0x37d2('0x42')]['count'](_0x313a07)[_0x37d2('0x26')](function(_0x747511){_0x53589e[_0x37d2('0x1d')]=_0x747511;if(_0x56efc2[_0x37d2('0x32')]['includeAll']){_0x20bb1a[_0x37d2('0x43')]=[{'all':!![]}];}return db[_0x37d2('0x42')]['findAll'](_0x20bb1a);})[_0x37d2('0x26')](function(_0x32c07a){_0x53589e[_0x37d2('0x44')]=_0x32c07a;return _0x53589e;})['then'](respondWithFilteredResult(_0x54de2a,_0x20bb1a))[_0x37d2('0x45')](handleError(_0x54de2a,null));};exports[_0x37d2('0x46')]=function(_0x5b3620,_0x575f42){var _0x4d9575={'raw':!![],'where':{'id':_0x5b3620['params']['id']}},_0x48a800={};_0x48a800[_0x37d2('0x31')]=_[_0x37d2('0x47')](db[_0x37d2('0x42')][_0x37d2('0x2d')]);_0x48a800[_0x37d2('0x32')]=_[_0x37d2('0x47')](_0x5b3620['query']);_0x48a800[_0x37d2('0x33')]=_[_0x37d2('0x34')](_0x48a800[_0x37d2('0x31')],_0x48a800['query']);_0x4d9575[_0x37d2('0x36')]=_[_0x37d2('0x34')](_0x48a800[_0x37d2('0x31')],qs[_0x37d2('0x35')](_0x5b3620[_0x37d2('0x32')][_0x37d2('0x35')]));_0x4d9575['attributes']=_0x4d9575[_0x37d2('0x36')][_0x37d2('0x37')]?_0x4d9575[_0x37d2('0x36')]:_0x48a800[_0x37d2('0x31')];if(_0x5b3620['query']['includeAll']){_0x4d9575[_0x37d2('0x43')]=[{'all':!![]}];}_0x4d9575=_[_0x37d2('0x3e')]({},_0x4d9575,_0x5b3620[_0x37d2('0x41')]);return db[_0x37d2('0x42')][_0x37d2('0x48')](_0x4d9575)[_0x37d2('0x26')](handleEntityNotFound(_0x575f42,null))[_0x37d2('0x26')](respondWithResult(_0x575f42,null))[_0x37d2('0x45')](handleError(_0x575f42,null));};exports[_0x37d2('0x49')]=function(_0xce3ff5,_0x1db743){return db['MailQueueReport'][_0x37d2('0x49')](_0xce3ff5[_0x37d2('0x4a')],{})['then'](respondWithResult(_0x1db743,0xc9))[_0x37d2('0x45')](handleError(_0x1db743,null));};exports['update']=function(_0x3ada32,_0xdbb15c){if(_0x3ada32['body']['id']){delete _0x3ada32[_0x37d2('0x4a')]['id'];}return db[_0x37d2('0x42')]['find']({'where':{'id':_0x3ada32[_0x37d2('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdbb15c,null))[_0x37d2('0x26')](saveUpdates(_0x3ada32[_0x37d2('0x4a')],null))[_0x37d2('0x26')](respondWithResult(_0xdbb15c,null))[_0x37d2('0x45')](handleError(_0xdbb15c,null));};exports['destroy']=function(_0x50f276,_0x21a162){return db[_0x37d2('0x42')][_0x37d2('0x48')]({'where':{'id':_0x50f276[_0x37d2('0x4b')]['id']}})[_0x37d2('0x26')](handleEntityNotFound(_0x21a162,null))[_0x37d2('0x26')](removeEntity(_0x21a162,null))[_0x37d2('0x45')](handleError(_0x21a162,null));};exports['describe']=function(_0x2c482c,_0x1ac941){return db[_0x37d2('0x42')][_0x37d2('0x4c')]()[_0x37d2('0x26')](respondWithResult(_0x1ac941,null))[_0x37d2('0x45')](handleError(_0x1ac941,null));};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js
index 0756171..15c9b9f 100644
--- a/server/api/mailQueueReport/mailQueueReport.model.js
+++ b/server/api/mailQueueReport/mailQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa30a=['./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x482065,_0x100d05){var _0xf7a180=function(_0x27bca3){while(--_0x27bca3){_0x482065['push'](_0x482065['shift']());}};_0xf7a180(++_0x100d05);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xaa30('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xde1a=['rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xde1a,0xfd));var _0xade1=function(_0x128ffb,_0x5dc0c7){_0x128ffb=_0x128ffb-0x0;var _0x3662be=_0xde1a[_0x128ffb];return _0x3662be;};'use strict';var _=require('lodash');var util=require(_0xade1('0x0'));var logger=require(_0xade1('0x1'))(_0xade1('0x2'));var moment=require(_0xade1('0x3'));var BPromise=require(_0xade1('0x4'));var rp=require(_0xade1('0x5'));var fs=require('fs');var path=require(_0xade1('0x6'));var rimraf=require(_0xade1('0x7'));var config=require('../../config/environment');var attributes=require(_0xade1('0x8'));module[_0xade1('0x9')]=function(_0x36721c,_0x983a27){return _0x36721c[_0xade1('0xa')](_0xade1('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xade1('0xc'),'fields':[_0xade1('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js
index f8489da..7c10de8 100644
--- a/server/api/mailQueueReport/mailQueueReport.rpc.js
+++ b/server/api/mailQueueReport/mailQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7096=['then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','body','options','raw','UpdateMailQueueReport','update','where','attributes','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x34f073,_0x19314c){var _0x1eb403=function(_0x2be314){while(--_0x2be314){_0x34f073['push'](_0x34f073['shift']());}};_0x1eb403(++_0x19314c);}(_0x7096,0x10c));var _0x6709=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7096[_0xae7c2f];return _0x5d7001;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});}exports[_0x6709('0x16')]=function(_0x235a54){var _0x4a732e=this;return new Promise(function(_0x9c1fd8,_0x166c97){return db[_0x6709('0x17')]['create'](_0x235a54[_0x6709('0x18')],{'raw':_0x235a54[_0x6709('0x19')]?_0x235a54[_0x6709('0x19')][_0x6709('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3c4971){logger[_0x6709('0xc')](_0x6709('0x16'),_0x235a54);logger[_0x6709('0xf')](_0x6709('0x16'),_0x235a54,JSON[_0x6709('0x10')](_0x3c4971));_0x9c1fd8(_0x3c4971);})[_0x6709('0x15')](function(_0x17763d){logger[_0x6709('0x11')](_0x6709('0x16'),_0x17763d[_0x6709('0x13')],_0x235a54);_0x166c97(_0x4a732e[_0x6709('0x11')](0x1f4,_0x17763d['message']));});});};exports[_0x6709('0x1b')]=function(_0x81138e){var _0x2bcc73=this;return new Promise(function(_0x5c7982,_0x2e3483){return db[_0x6709('0x17')][_0x6709('0x1c')](_0x81138e[_0x6709('0x18')],{'raw':_0x81138e['options']?_0x81138e[_0x6709('0x19')][_0x6709('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x81138e['options']?_0x81138e[_0x6709('0x19')][_0x6709('0x1d')]||null:null,'attributes':_0x81138e['options']?_0x81138e[_0x6709('0x19')][_0x6709('0x1e')]||null:null,'limit':_0x81138e['options']?_0x81138e[_0x6709('0x19')]['limit']||null:null})[_0x6709('0xb')](function(_0x3cd555){logger['info'](_0x6709('0x1b'),_0x81138e);logger['debug'](_0x6709('0x1b'),_0x81138e,JSON[_0x6709('0x10')](_0x3cd555));_0x5c7982(_0x3cd555);})['catch'](function(_0x1a9eea){logger['error'](_0x6709('0x1b'),_0x1a9eea[_0x6709('0x13')],_0x81138e);_0x2e3483(_0x2bcc73['error'](0x1f4,_0x1a9eea['message']));});});};
\ No newline at end of file
+var _0xfdbd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateMailQueueReport','MailQueueReport','create','body','options','UpdateMailQueueReport','update','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x31db36,_0x271b00){var _0xa5ecf0=function(_0x13b632){while(--_0x13b632){_0x31db36['push'](_0x31db36['shift']());}};_0xa5ecf0(++_0x271b00);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xf9e76,_0x2e6b9a){_0xf9e76=_0xf9e76-0x0;var _0x119a9b=_0xfdbd[_0xf9e76];return _0x119a9b;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var moment=require(_0xdfdb('0x2'));var BPromise=require(_0xdfdb('0x3'));var rs=require(_0xdfdb('0x4'));var fs=require('fs');var Redis=require(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var utils=require(_0xdfdb('0x7'));var logger=require(_0xdfdb('0x8'))('rpc');var config=require(_0xdfdb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdfdb('0xa')][_0xdfdb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x489f19,_0x556dc0,_0x590b5d){return new BPromise(function(_0x188508,_0xf72a24){return client['request'](_0x489f19,_0x590b5d)[_0xdfdb('0xc')](function(_0x444c19){logger[_0xdfdb('0xd')](_0xdfdb('0xe'),_0x556dc0,_0xdfdb('0xf'));logger[_0xdfdb('0x10')](_0xdfdb('0x11'),_0x556dc0,'request\x20sent',JSON[_0xdfdb('0x12')](_0x444c19));if(_0x444c19[_0xdfdb('0x13')]){if(_0x444c19['error'][_0xdfdb('0x14')]===0x1f4){logger[_0xdfdb('0x13')](_0xdfdb('0xe'),_0x556dc0,_0x444c19[_0xdfdb('0x13')][_0xdfdb('0x15')]);return _0xf72a24(_0x444c19[_0xdfdb('0x13')][_0xdfdb('0x15')]);}logger[_0xdfdb('0x13')]('MailQueueReport,\x20%s,\x20%s',_0x556dc0,_0x444c19['error'][_0xdfdb('0x15')]);return _0x188508(_0x444c19['error'][_0xdfdb('0x15')]);}else{logger[_0xdfdb('0xd')](_0xdfdb('0xe'),_0x556dc0,_0xdfdb('0xf'));_0x188508(_0x444c19[_0xdfdb('0x16')][_0xdfdb('0x15')]);}})['catch'](function(_0x4fd3d5){logger[_0xdfdb('0x13')](_0xdfdb('0xe'),_0x556dc0,_0x4fd3d5);_0xf72a24(_0x4fd3d5);});});}exports[_0xdfdb('0x17')]=function(_0x55ab5a){var _0x3eb100=this;return new Promise(function(_0xb677b1,_0x467653){return db[_0xdfdb('0x18')][_0xdfdb('0x19')](_0x55ab5a[_0xdfdb('0x1a')],{'raw':_0x55ab5a[_0xdfdb('0x1b')]?_0x55ab5a[_0xdfdb('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xdfdb('0xc')](function(_0xb7417c){logger[_0xdfdb('0xd')]('CreateMailQueueReport',_0x55ab5a);logger[_0xdfdb('0x10')](_0xdfdb('0x17'),_0x55ab5a,JSON[_0xdfdb('0x12')](_0xb7417c));_0xb677b1(_0xb7417c);})['catch'](function(_0x280e53){logger[_0xdfdb('0x13')](_0xdfdb('0x17'),_0x280e53['message'],_0x55ab5a);_0x467653(_0x3eb100[_0xdfdb('0x13')](0x1f4,_0x280e53['message']));});});};exports[_0xdfdb('0x1c')]=function(_0x145350){var _0x1fa2f3=this;return new Promise(function(_0x2a560c,_0x4f69cf){return db[_0xdfdb('0x18')][_0xdfdb('0x1d')](_0x145350[_0xdfdb('0x1a')],{'raw':_0x145350[_0xdfdb('0x1b')]?_0x145350[_0xdfdb('0x1b')][_0xdfdb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x145350['options']?_0x145350[_0xdfdb('0x1b')][_0xdfdb('0x1f')]||null:null,'attributes':_0x145350[_0xdfdb('0x1b')]?_0x145350['options'][_0xdfdb('0x20')]||null:null,'limit':_0x145350['options']?_0x145350[_0xdfdb('0x1b')][_0xdfdb('0x21')]||null:null})[_0xdfdb('0xc')](function(_0x513fa0){logger['info'](_0xdfdb('0x1c'),_0x145350);logger[_0xdfdb('0x10')](_0xdfdb('0x1c'),_0x145350,JSON[_0xdfdb('0x12')](_0x513fa0));_0x2a560c(_0x513fa0);})[_0xdfdb('0x22')](function(_0x165f72){logger['error'](_0xdfdb('0x1c'),_0x165f72[_0xdfdb('0x15')],_0x145350);_0x4f69cf(_0x1fa2f3[_0xdfdb('0x13')](0x1f4,_0x165f72[_0xdfdb('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js
index afb31af..7eb934e 100644
--- a/server/api/mailServerIn/index.js
+++ b/server/api/mailServerIn/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x393e=['exports','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4f2fd9,_0x329789){var _0x36888a=function(_0xbce87a){while(--_0xbce87a){_0x4f2fd9['push'](_0x4f2fd9['shift']());}};_0x36888a(++_0x329789);}(_0x393e,0x191));var _0xe393=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x393e[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe393('0x0'));var router=express[_0xe393('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xe393('0x2'));var config=require(_0xe393('0x3'));module[_0xe393('0x4')]=router;
\ No newline at end of file
+var _0x9d2f=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0xcb48ca,_0x540ecb){var _0x37be10=function(_0x3e1289){while(--_0x3e1289){_0xcb48ca['push'](_0xcb48ca['shift']());}};_0x37be10(++_0x540ecb);}(_0x9d2f,0x14a));var _0xf9d2=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x9d2f[_0x5627e1];return _0x2f013f;};'use strict';var multer=require(_0xf9d2('0x0'));var util=require(_0xf9d2('0x1'));var path=require(_0xf9d2('0x2'));var timeout=require(_0xf9d2('0x3'));var express=require('express');var router=express[_0xf9d2('0x4')]();var auth=require(_0xf9d2('0x5'));var interaction=require(_0xf9d2('0x6'));var config=require(_0xf9d2('0x7'));module[_0xf9d2('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js
index 645a464..8463469 100644
--- a/server/api/mailServerIn/mailServerIn.attributes.js
+++ b/server/api/mailServerIn/mailServerIn.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbfcf=['sequelize','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x3a53cb,_0x1fcb5d){var _0x3317bd=function(_0xc52e7){while(--_0xc52e7){_0x3a53cb['push'](_0x3a53cb['shift']());}};_0x3317bd(++_0x1fcb5d);}(_0xbfcf,0xff));var _0xfbfc=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0xbfcf[_0xae1a83];return _0xdb9da8;};'use strict';var Sequelize=require(_0xfbfc('0x0'));module['exports']={'description':{'type':Sequelize[_0xfbfc('0x1')]},'host':{'type':Sequelize[_0xfbfc('0x1')]},'authentication':{'type':Sequelize[_0xfbfc('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xfbfc('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xfbfc('0x1')]},'port':{'type':Sequelize[_0xfbfc('0x3')]},'tls':{'type':Sequelize[_0xfbfc('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xfbfc('0x1')],'defaultValue':_0xfbfc('0x4')},'connTimeout':{'type':Sequelize[_0xfbfc('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xfbfc('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x186b=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN','username'];(function(_0x62c128,_0x1f5876){var _0x4c3c69=function(_0x56d510){while(--_0x56d510){_0x62c128['push'](_0x62c128['shift']());}};_0x4c3c69(++_0x1f5876);}(_0x186b,0xbf));var _0xb186=function(_0x1a9c75,_0xa83750){_0x1a9c75=_0x1a9c75-0x0;var _0xb2f37e=_0x186b[_0x1a9c75];return _0xb2f37e;};'use strict';var Sequelize=require(_0xb186('0x0'));module[_0xb186('0x1')]={'description':{'type':Sequelize[_0xb186('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xb186('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0xb186('0x4')},'password':{'type':Sequelize[_0xb186('0x2')]},'port':{'type':Sequelize[_0xb186('0x5')]},'tls':{'type':Sequelize[_0xb186('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb186('0x2')],'defaultValue':_0xb186('0x6')},'connTimeout':{'type':Sequelize[_0xb186('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb186('0x5')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js
index 55bcb8e..d8518b1 100644
--- a/server/api/mailServerIn/mailServerIn.model.js
+++ b/server/api/mailServerIn/mailServerIn.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x25fa=['path','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xca526f,_0x4341a0){var _0x524cf6=function(_0x2fc4cb){while(--_0x2fc4cb){_0xca526f['push'](_0xca526f['shift']());}};_0x524cf6(++_0x4341a0);}(_0x25fa,0x109));var _0xa25f=function(_0x1a5433,_0x57f2a3){_0x1a5433=_0x1a5433-0x0;var _0x4a98cc=_0x25fa[_0x1a5433];return _0x4a98cc;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var moment=require('moment');var BPromise=require(_0xa25f('0x3'));var rp=require(_0xa25f('0x4'));var fs=require('fs');var path=require(_0xa25f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa25f('0x6'));module['exports']=function(_0x2ea9ea,_0x3ab530){return _0x2ea9ea[_0xa25f('0x7')](_0xa25f('0x8'),attributes,{'tableName':_0xa25f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc91=['mail_servers_in','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0xe5a26b,_0x1421ae){var _0x9ea56b=function(_0x4bec39){while(--_0x4bec39){_0xe5a26b['push'](_0xe5a26b['shift']());}};_0x9ea56b(++_0x1421ae);}(_0xfc91,0xb5));var _0x1fc9=function(_0x101c64,_0x4b0ec5){_0x101c64=_0x101c64-0x0;var _0x17ea14=_0xfc91[_0x101c64];return _0x17ea14;};'use strict';var _=require('lodash');var util=require(_0x1fc9('0x0'));var logger=require('../../config/logger')(_0x1fc9('0x1'));var moment=require(_0x1fc9('0x2'));var BPromise=require(_0x1fc9('0x3'));var rp=require(_0x1fc9('0x4'));var fs=require('fs');var path=require(_0x1fc9('0x5'));var rimraf=require(_0x1fc9('0x6'));var config=require(_0x1fc9('0x7'));var attributes=require(_0x1fc9('0x8'));module[_0x1fc9('0x9')]=function(_0xb6caac,_0xc81f3b){return _0xb6caac[_0x1fc9('0xa')]('MailServerIn',attributes,{'tableName':_0x1fc9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js
index 0ee9f70..d7f2206 100644
--- a/server/api/mailServerIn/mailServerIn.rpc.js
+++ b/server/api/mailServerIn/mailServerIn.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00ff=['map','model','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0x00ff,0x103));var _0xf00f=function(_0x59467b,_0x5da907){_0x59467b=_0x59467b-0x0;var _0x5d69da=_0x00ff[_0x59467b];return _0x5d69da;};'use strict';var _=require(_0xf00f('0x0'));var util=require(_0xf00f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf00f('0x2'));var fs=require('fs');var Redis=require(_0xf00f('0x3'));var db=require(_0xf00f('0x4'))['db'];var utils=require(_0xf00f('0x5'));var logger=require('../../config/logger')(_0xf00f('0x6'));var config=require('../../config/environment');var jayson=require(_0xf00f('0x7'));var client=jayson[_0xf00f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb4fae9,_0x382222,_0x3774d4){return new BPromise(function(_0x1351f4,_0x5609e7){return client[_0xf00f('0x9')](_0xb4fae9,_0x3774d4)['then'](function(_0x42f78a){logger[_0xf00f('0xa')]('MailServerIn,\x20%s,\x20%s',_0x382222,_0xf00f('0xb'));logger[_0xf00f('0xc')](_0xf00f('0xd'),_0x382222,_0xf00f('0xb'),JSON[_0xf00f('0xe')](_0x42f78a));if(_0x42f78a['error']){if(_0x42f78a[_0xf00f('0xf')]['code']===0x1f4){logger[_0xf00f('0xf')](_0xf00f('0x10'),_0x382222,_0x42f78a[_0xf00f('0xf')]['message']);return _0x5609e7(_0x42f78a[_0xf00f('0xf')][_0xf00f('0x11')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x382222,_0x42f78a['error'][_0xf00f('0x11')]);return _0x1351f4(_0x42f78a[_0xf00f('0xf')][_0xf00f('0x11')]);}else{logger[_0xf00f('0xa')](_0xf00f('0x10'),_0x382222,_0xf00f('0xb'));_0x1351f4(_0x42f78a[_0xf00f('0x12')]['message']);}})[_0xf00f('0x13')](function(_0x2840fc){logger[_0xf00f('0xf')](_0xf00f('0x10'),_0x382222,_0x2840fc);_0x5609e7(_0x2840fc);});});}exports[_0xf00f('0x14')]=function(_0x43f481){var _0x26e304=this;return new Promise(function(_0x203e1f,_0x246350){return db[_0xf00f('0x15')][_0xf00f('0x16')]({'raw':_0x43f481[_0xf00f('0x17')]?_0x43f481[_0xf00f('0x17')][_0xf00f('0x18')]===undefined?!![]:![]:!![],'where':_0x43f481[_0xf00f('0x17')]?_0x43f481[_0xf00f('0x17')][_0xf00f('0x19')]||null:null,'attributes':_0x43f481[_0xf00f('0x17')]?_0x43f481[_0xf00f('0x17')][_0xf00f('0x1a')]||null:null,'limit':_0x43f481[_0xf00f('0x17')]?_0x43f481[_0xf00f('0x17')][_0xf00f('0x1b')]||null:null,'include':_0x43f481['options']?_0x43f481[_0xf00f('0x17')]['include']?_['map'](_0x43f481['options']['include'],function(_0x4108b9){return{'model':db[_0x4108b9['model']],'as':_0x4108b9['as'],'attributes':_0x4108b9[_0xf00f('0x1a')],'include':_0x4108b9[_0xf00f('0x1c')]?_[_0xf00f('0x1d')](_0x4108b9[_0xf00f('0x1c')],function(_0x32add6){return{'model':db[_0x32add6[_0xf00f('0x1e')]],'as':_0x32add6['as'],'attributes':_0x32add6[_0xf00f('0x1a')],'include':_0x32add6[_0xf00f('0x1c')]?_[_0xf00f('0x1d')](_0x32add6[_0xf00f('0x1c')],function(_0x502093){return{'model':db[_0x502093['model']],'as':_0x502093['as'],'attributes':_0x502093[_0xf00f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf00f('0x1f')](function(_0xa3beb1){logger[_0xf00f('0xa')](_0xf00f('0x14'),_0x43f481);logger[_0xf00f('0xc')](_0xf00f('0x14'),_0x43f481,JSON[_0xf00f('0xe')](_0xa3beb1));_0x203e1f(_0xa3beb1);})[_0xf00f('0x13')](function(_0x18e1f8){logger['error']('GetMailServerIn',_0x18e1f8[_0xf00f('0x11')],_0x43f481);_0x246350(_0x26e304[_0xf00f('0xf')](0x1f4,_0x18e1f8[_0xf00f('0x11')]));});});};
\ No newline at end of file
+var _0x2130=['error','message','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x220c41,_0xfb9ef2){var _0x1e5e0a=function(_0x432d7b){while(--_0x432d7b){_0x220c41['push'](_0x220c41['shift']());}};_0x1e5e0a(++_0xfb9ef2);}(_0x2130,0xe5));var _0x0213=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x2130[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x0213('0x0'));var util=require('util');var moment=require(_0x0213('0x1'));var BPromise=require(_0x0213('0x2'));var rs=require(_0x0213('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0213('0x4'))['db'];var utils=require(_0x0213('0x5'));var logger=require(_0x0213('0x6'))(_0x0213('0x7'));var config=require(_0x0213('0x8'));var jayson=require(_0x0213('0x9'));var client=jayson[_0x0213('0xa')][_0x0213('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17cf9c,_0x4ef267,_0x4b2db0){return new BPromise(function(_0x23cd69,_0x3e139d){return client[_0x0213('0xc')](_0x17cf9c,_0x4b2db0)[_0x0213('0xd')](function(_0x2c42c9){logger[_0x0213('0xe')](_0x0213('0xf'),_0x4ef267,_0x0213('0x10'));logger[_0x0213('0x11')](_0x0213('0x12'),_0x4ef267,_0x0213('0x10'),JSON['stringify'](_0x2c42c9));if(_0x2c42c9[_0x0213('0x13')]){if(_0x2c42c9[_0x0213('0x13')]['code']===0x1f4){logger['error'](_0x0213('0xf'),_0x4ef267,_0x2c42c9[_0x0213('0x13')][_0x0213('0x14')]);return _0x3e139d(_0x2c42c9[_0x0213('0x13')][_0x0213('0x14')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x4ef267,_0x2c42c9[_0x0213('0x13')][_0x0213('0x14')]);return _0x23cd69(_0x2c42c9[_0x0213('0x13')][_0x0213('0x14')]);}else{logger[_0x0213('0xe')](_0x0213('0xf'),_0x4ef267,'request\x20sent');_0x23cd69(_0x2c42c9['result'][_0x0213('0x14')]);}})[_0x0213('0x15')](function(_0x28e7df){logger[_0x0213('0x13')](_0x0213('0xf'),_0x4ef267,_0x28e7df);_0x3e139d(_0x28e7df);});});}exports[_0x0213('0x16')]=function(_0x3a86fa){var _0x24da5a=this;return new Promise(function(_0x51e046,_0x31c3cc){return db[_0x0213('0x17')]['findAll']({'raw':_0x3a86fa['options']?_0x3a86fa[_0x0213('0x18')][_0x0213('0x19')]===undefined?!![]:![]:!![],'where':_0x3a86fa[_0x0213('0x18')]?_0x3a86fa[_0x0213('0x18')][_0x0213('0x1a')]||null:null,'attributes':_0x3a86fa[_0x0213('0x18')]?_0x3a86fa['options'][_0x0213('0x1b')]||null:null,'limit':_0x3a86fa[_0x0213('0x18')]?_0x3a86fa[_0x0213('0x18')]['limit']||null:null,'include':_0x3a86fa[_0x0213('0x18')]?_0x3a86fa[_0x0213('0x18')][_0x0213('0x1c')]?_[_0x0213('0x1d')](_0x3a86fa[_0x0213('0x18')][_0x0213('0x1c')],function(_0x4b2fe1){return{'model':db[_0x4b2fe1[_0x0213('0x1e')]],'as':_0x4b2fe1['as'],'attributes':_0x4b2fe1[_0x0213('0x1b')],'include':_0x4b2fe1['include']?_['map'](_0x4b2fe1[_0x0213('0x1c')],function(_0x2bc10d){return{'model':db[_0x2bc10d['model']],'as':_0x2bc10d['as'],'attributes':_0x2bc10d[_0x0213('0x1b')],'include':_0x2bc10d['include']?_[_0x0213('0x1d')](_0x2bc10d[_0x0213('0x1c')],function(_0x4d4d12){return{'model':db[_0x4d4d12['model']],'as':_0x4d4d12['as'],'attributes':_0x4d4d12[_0x0213('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3634e8){logger[_0x0213('0xe')](_0x0213('0x16'),_0x3a86fa);logger[_0x0213('0x11')](_0x0213('0x16'),_0x3a86fa,JSON['stringify'](_0x3634e8));_0x51e046(_0x3634e8);})['catch'](function(_0x39854f){logger[_0x0213('0x13')](_0x0213('0x16'),_0x39854f['message'],_0x3a86fa);_0x31c3cc(_0x24da5a[_0x0213('0x13')](0x1f4,_0x39854f[_0x0213('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js
index 7f2d08b..2011f7f 100644
--- a/server/api/mailServerOut/index.js
+++ b/server/api/mailServerOut/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf7f=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xdf7f,0x81));var _0xfdf7=function(_0x2cb4cc,_0x1042c9){_0x2cb4cc=_0x2cb4cc-0x0;var _0x54bca9=_0xdf7f[_0x2cb4cc];return _0x54bca9;};'use strict';var multer=require(_0xfdf7('0x0'));var util=require(_0xfdf7('0x1'));var path=require(_0xfdf7('0x2'));var timeout=require(_0xfdf7('0x3'));var express=require(_0xfdf7('0x4'));var router=express[_0xfdf7('0x5')]();var auth=require(_0xfdf7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfdf7('0x7'));var controller=require(_0xfdf7('0x8'));router[_0xfdf7('0x9')]('/',auth[_0xfdf7('0xa')](),controller['index']);router[_0xfdf7('0x9')](_0xfdf7('0xb'),auth[_0xfdf7('0xa')](),controller[_0xfdf7('0xc')]);router[_0xfdf7('0xd')]('/',auth[_0xfdf7('0xa')](),controller[_0xfdf7('0xe')]);router['put'](_0xfdf7('0xb'),auth[_0xfdf7('0xa')](),controller['update']);router[_0xfdf7('0xf')](_0xfdf7('0xb'),auth[_0xfdf7('0xa')](),controller[_0xfdf7('0x10')]);module[_0xfdf7('0x11')]=router;
\ No newline at end of file
+var _0x3874=['update','delete','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create'];(function(_0x434bce,_0x3bda80){var _0x246eae=function(_0x5dbc84){while(--_0x5dbc84){_0x434bce['push'](_0x434bce['shift']());}};_0x246eae(++_0x3bda80);}(_0x3874,0x110));var _0x4387=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3874[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x4387('0x0'));var path=require('path');var timeout=require(_0x4387('0x1'));var express=require(_0x4387('0x2'));var router=express[_0x4387('0x3')]();var auth=require(_0x4387('0x4'));var interaction=require(_0x4387('0x5'));var config=require(_0x4387('0x6'));var controller=require('./mailServerOut.controller');router['get']('/',auth[_0x4387('0x7')](),controller[_0x4387('0x8')]);router[_0x4387('0x9')](_0x4387('0xa'),auth[_0x4387('0x7')](),controller['show']);router[_0x4387('0xb')]('/',auth[_0x4387('0x7')](),controller[_0x4387('0xc')]);router['put'](_0x4387('0xa'),auth[_0x4387('0x7')](),controller[_0x4387('0xd')]);router[_0x4387('0xe')](_0x4387('0xa'),auth[_0x4387('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js
index 2a42109..c8a95c3 100644
--- a/server/api/mailServerOut/mailServerOut.attributes.js
+++ b/server/api/mailServerOut/mailServerOut.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ca9=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x8ca9,0x9c));var _0x98ca=function(_0x264af2,_0xd46cfb){_0x264af2=_0x264af2-0x0;var _0x58c582=_0x8ca9[_0x264af2];return _0x58c582;};'use strict';var Sequelize=require(_0x98ca('0x0'));module[_0x98ca('0x1')]={'description':{'type':Sequelize[_0x98ca('0x2')]},'host':{'type':Sequelize[_0x98ca('0x2')]},'user':{'type':Sequelize[_0x98ca('0x2')]},'pass':{'type':Sequelize[_0x98ca('0x2')]},'port':{'type':Sequelize[_0x98ca('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x98ca('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x905a=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x905a,0xeb));var _0xa905=function(_0x380892,_0x1e89a2){_0x380892=_0x380892-0x0;var _0x1a4b60=_0x905a[_0x380892];return _0x1a4b60;};'use strict';var Sequelize=require(_0xa905('0x0'));module['exports']={'description':{'type':Sequelize[_0xa905('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xa905('0x1')]},'port':{'type':Sequelize[_0xa905('0x2')]},'secure':{'type':Sequelize[_0xa905('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xa905('0x1')]},'authentication':{'type':Sequelize[_0xa905('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js
index c3acdba..25f649e 100644
--- a/server/api/mailServerOut/mailServerOut.controller.js
+++ b/server/api/mailServerOut/mailServerOut.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf263=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','Content-Range','json','apply','update','then','destroy','end','error','name','map','MailServerOut','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','papaparse'];(function(_0x22c684,_0x753309){var _0x39fcbb=function(_0x38b631){while(--_0x38b631){_0x22c684['push'](_0x22c684['shift']());}};_0x39fcbb(++_0x753309);}(_0xf263,0x149));var _0x3f26=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0xf263[_0x12ddb2];return _0x10b6dd;};'use strict';var pdf=require(_0x3f26('0x0'));var emlformat=require(_0x3f26('0x1'));var rimraf=require(_0x3f26('0x2'));var zipdir=require(_0x3f26('0x3'));var jsonpatch=require(_0x3f26('0x4'));var rp=require('request-promise');var moment=require(_0x3f26('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3f26('0x6'));var util=require(_0x3f26('0x7'));var path=require(_0x3f26('0x8'));var sox=require(_0x3f26('0x9'));var csv=require('to-csv');var ejs=require(_0x3f26('0xa'));var fs=require('fs');var _=require(_0x3f26('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3f26('0xc'));var deskjs=require(_0x3f26('0xd'));var toCsv=require(_0x3f26('0xe'));var querystring=require('querystring');var Papa=require(_0x3f26('0xf'));var Redis=require(_0x3f26('0x10'));var authService=require(_0x3f26('0x11'));var qs=require(_0x3f26('0x12'));var as=require(_0x3f26('0x13'));var hardwareService=require(_0x3f26('0x14'));var logger=require(_0x3f26('0x15'))(_0x3f26('0x16'));var utils=require(_0x3f26('0x17'));var config=require(_0x3f26('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ab0ef,_0x258b7f){_0x258b7f=_0x258b7f||0xcc;return function(_0x1ad495){if(_0x1ad495){return _0x5ab0ef[_0x3f26('0x19')](_0x258b7f);}return _0x5ab0ef[_0x3f26('0x1a')](_0x258b7f)['end']();};}function respondWithResult(_0x1802e4,_0x227655){_0x227655=_0x227655||0xc8;return function(_0x3f69c0){if(_0x3f69c0){return _0x1802e4[_0x3f26('0x1a')](_0x227655)['json'](_0x3f69c0);}};}function respondWithFilteredResult(_0x3d18ae,_0x1ce98c){return function(_0x37ee5c){if(_0x37ee5c){var _0x414672=_0x37ee5c[_0x3f26('0x1b')],_0x577ca3=_0x1ce98c[_0x3f26('0x1c')],_0x96bd2d=_0x1ce98c[_0x3f26('0x1c')]+_0x1ce98c['limit'],_0x2b9cd9;if(_0x96bd2d>=_0x414672){_0x96bd2d=_0x414672;_0x2b9cd9=0xc8;}else{_0x2b9cd9=0xce;}_0x3d18ae['status'](_0x2b9cd9);return _0x3d18ae['set'](_0x3f26('0x1d'),_0x577ca3+'-'+_0x96bd2d+'/'+_0x414672)[_0x3f26('0x1e')](_0x37ee5c);}return null;};}function patchUpdates(_0x54e79b){return function(_0x346461){try{jsonpatch[_0x3f26('0x1f')](_0x346461,_0x54e79b,!![]);}catch(_0x53b245){return BPromise['reject'](_0x53b245);}return _0x346461['save']();};}function saveUpdates(_0x3080f2,_0x20fe9c){return function(_0x4a8fcf){if(_0x4a8fcf){return _0x4a8fcf[_0x3f26('0x20')](_0x3080f2)[_0x3f26('0x21')](function(_0x172a07){return _0x172a07;});}return null;};}function removeEntity(_0x191a22,_0x254638){return function(_0x5a228f){if(_0x5a228f){return _0x5a228f[_0x3f26('0x22')]()[_0x3f26('0x21')](function(){_0x191a22[_0x3f26('0x1a')](0xcc)[_0x3f26('0x23')]();});}};}function handleEntityNotFound(_0x230400,_0x8d9aa1){return function(_0x272d05){if(!_0x272d05){_0x230400[_0x3f26('0x19')](0x194);}return _0x272d05;};}function handleError(_0x335584,_0xd5d467){_0xd5d467=_0xd5d467||0x1f4;return function(_0x12a0df){logger[_0x3f26('0x24')](_0x12a0df['stack']);if(_0x12a0df[_0x3f26('0x25')]){delete _0x12a0df[_0x3f26('0x25')];}_0x335584[_0x3f26('0x1a')](_0xd5d467)['send'](_0x12a0df);};}exports['index']=function(_0x16effb,_0x1eab9c){var _0x279057={},_0x2e48b2={},_0x1880d8={'count':0x0,'rows':[]};var _0x379001=_[_0x3f26('0x26')](db[_0x3f26('0x27')][_0x3f26('0x28')],function(_0x2bbf11){return{'name':_0x2bbf11['fieldName'],'type':_0x2bbf11[_0x3f26('0x29')][_0x3f26('0x2a')]};});_0x2e48b2[_0x3f26('0x2b')]=_['map'](_0x379001,'name');_0x2e48b2['query']=_[_0x3f26('0x2c')](_0x16effb[_0x3f26('0x2d')]);_0x2e48b2[_0x3f26('0x2e')]=_['intersection'](_0x2e48b2[_0x3f26('0x2b')],_0x2e48b2['query']);_0x279057[_0x3f26('0x2f')]=_[_0x3f26('0x30')](_0x2e48b2[_0x3f26('0x2b')],qs['fields'](_0x16effb[_0x3f26('0x2d')]['fields']));_0x279057[_0x3f26('0x2f')]=_0x279057[_0x3f26('0x2f')]['length']?_0x279057[_0x3f26('0x2f')]:_0x2e48b2[_0x3f26('0x2b')];if(!_0x16effb[_0x3f26('0x2d')][_0x3f26('0x31')]('nolimit')){_0x279057[_0x3f26('0x32')]=qs[_0x3f26('0x32')](_0x16effb[_0x3f26('0x2d')][_0x3f26('0x32')]);_0x279057[_0x3f26('0x1c')]=qs[_0x3f26('0x1c')](_0x16effb[_0x3f26('0x2d')]['offset']);}_0x279057[_0x3f26('0x33')]=qs[_0x3f26('0x34')](_0x16effb['query']['sort']);_0x279057[_0x3f26('0x35')]=qs['filters'](_[_0x3f26('0x36')](_0x16effb[_0x3f26('0x2d')],_0x2e48b2[_0x3f26('0x2e')]),_0x379001);if(_0x16effb['query'][_0x3f26('0x37')]){_0x279057[_0x3f26('0x35')]=_['merge'](_0x279057[_0x3f26('0x35')],{'$or':_[_0x3f26('0x26')](_0x379001,function(_0x3da11f){if(_0x3da11f[_0x3f26('0x29')]!==_0x3f26('0x38')){var _0x15106d={};_0x15106d[_0x3da11f[_0x3f26('0x25')]]={'$like':'%'+_0x16effb[_0x3f26('0x2d')][_0x3f26('0x37')]+'%'};return _0x15106d;}})});}_0x279057=_[_0x3f26('0x39')]({},_0x279057,_0x16effb[_0x3f26('0x3a')]);var _0x29212b={'where':_0x279057[_0x3f26('0x35')]};return db[_0x3f26('0x27')][_0x3f26('0x1b')](_0x29212b)['then'](function(_0x5edd7b){_0x1880d8[_0x3f26('0x1b')]=_0x5edd7b;if(_0x16effb[_0x3f26('0x2d')][_0x3f26('0x3b')]){_0x279057[_0x3f26('0x3c')]=[{'all':!![]}];}return db[_0x3f26('0x27')][_0x3f26('0x3d')](_0x279057);})[_0x3f26('0x21')](function(_0x3d1050){_0x1880d8[_0x3f26('0x3e')]=_0x3d1050;return _0x1880d8;})[_0x3f26('0x21')](respondWithFilteredResult(_0x1eab9c,_0x279057))[_0x3f26('0x3f')](handleError(_0x1eab9c,null));};exports[_0x3f26('0x40')]=function(_0x3b33a3,_0x38c07e){var _0x5161dc={'raw':!![],'where':{'id':_0x3b33a3[_0x3f26('0x41')]['id']}},_0x3bb322={};_0x3bb322[_0x3f26('0x2b')]=_[_0x3f26('0x2c')](db[_0x3f26('0x27')][_0x3f26('0x28')]);_0x3bb322[_0x3f26('0x2d')]=_['keys'](_0x3b33a3['query']);_0x3bb322['filters']=_['intersection'](_0x3bb322[_0x3f26('0x2b')],_0x3bb322['query']);_0x5161dc[_0x3f26('0x2f')]=_[_0x3f26('0x30')](_0x3bb322['model'],qs['fields'](_0x3b33a3[_0x3f26('0x2d')]['fields']));_0x5161dc[_0x3f26('0x2f')]=_0x5161dc[_0x3f26('0x2f')]['length']?_0x5161dc[_0x3f26('0x2f')]:_0x3bb322['model'];if(_0x3b33a3[_0x3f26('0x2d')][_0x3f26('0x3b')]){_0x5161dc['include']=[{'all':!![]}];}_0x5161dc=_[_0x3f26('0x39')]({},_0x5161dc,_0x3b33a3[_0x3f26('0x3a')]);return db[_0x3f26('0x27')]['find'](_0x5161dc)[_0x3f26('0x21')](handleEntityNotFound(_0x38c07e,null))[_0x3f26('0x21')](respondWithResult(_0x38c07e,null))[_0x3f26('0x3f')](handleError(_0x38c07e,null));};exports[_0x3f26('0x42')]=function(_0x129d4a,_0x7ead3){return db[_0x3f26('0x27')]['create'](_0x129d4a[_0x3f26('0x43')],{})[_0x3f26('0x21')](respondWithResult(_0x7ead3,0xc9))['catch'](handleError(_0x7ead3,null));};exports[_0x3f26('0x20')]=function(_0x3131d4,_0x39701c){if(_0x3131d4['body']['id']){delete _0x3131d4[_0x3f26('0x43')]['id'];}return db[_0x3f26('0x27')][_0x3f26('0x44')]({'where':{'id':_0x3131d4[_0x3f26('0x41')]['id']}})[_0x3f26('0x21')](handleEntityNotFound(_0x39701c,null))['then'](saveUpdates(_0x3131d4[_0x3f26('0x43')],null))[_0x3f26('0x21')](respondWithResult(_0x39701c,null))[_0x3f26('0x3f')](handleError(_0x39701c,null));};exports[_0x3f26('0x22')]=function(_0x493769,_0x2feabf){return db[_0x3f26('0x27')][_0x3f26('0x44')]({'where':{'id':_0x493769[_0x3f26('0x41')]['id']}})[_0x3f26('0x21')](handleEntityNotFound(_0x2feabf,null))[_0x3f26('0x21')](removeEntity(_0x2feabf,null))[_0x3f26('0x3f')](handleError(_0x2feabf,null));};
\ No newline at end of file
+var _0xa521=['update','then','error','stack','name','send','map','MailServerOut','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','find','catch','create','body','params','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save'];(function(_0x2e3da7,_0x4aa5df){var _0x5650dd=function(_0x202438){while(--_0x202438){_0x2e3da7['push'](_0x2e3da7['shift']());}};_0x5650dd(++_0x4aa5df);}(_0xa521,0xeb));var _0x1a52=function(_0x43742d,_0xd2930f){_0x43742d=_0x43742d-0x0;var _0x2ad4a1=_0xa521[_0x43742d];return _0x2ad4a1;};'use strict';var pdf=require(_0x1a52('0x0'));var emlformat=require(_0x1a52('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1a52('0x2'));var rp=require(_0x1a52('0x3'));var moment=require('moment');var BPromise=require(_0x1a52('0x4'));var Mustache=require(_0x1a52('0x5'));var util=require(_0x1a52('0x6'));var path=require(_0x1a52('0x7'));var sox=require(_0x1a52('0x8'));var csv=require(_0x1a52('0x9'));var ejs=require(_0x1a52('0xa'));var fs=require('fs');var _=require(_0x1a52('0xb'));var squel=require(_0x1a52('0xc'));var crypto=require(_0x1a52('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a52('0xe'));var Redis=require('ioredis');var authService=require(_0x1a52('0xf'));var qs=require(_0x1a52('0x10'));var as=require(_0x1a52('0x11'));var hardwareService=require(_0x1a52('0x12'));var logger=require('../../config/logger')(_0x1a52('0x13'));var utils=require('../../config/utils');var config=require(_0x1a52('0x14'));var db=require(_0x1a52('0x15'))['db'];function respondWithStatusCode(_0x328812,_0xbc8a53){_0xbc8a53=_0xbc8a53||0xcc;return function(_0x51d510){if(_0x51d510){return _0x328812[_0x1a52('0x16')](_0xbc8a53);}return _0x328812[_0x1a52('0x17')](_0xbc8a53)[_0x1a52('0x18')]();};}function respondWithResult(_0x3e67b6,_0x20e56e){_0x20e56e=_0x20e56e||0xc8;return function(_0x4fb67f){if(_0x4fb67f){return _0x3e67b6['status'](_0x20e56e)['json'](_0x4fb67f);}};}function respondWithFilteredResult(_0x5ed514,_0x1f7fca){return function(_0x438ac5){if(_0x438ac5){var _0x428a94=_0x438ac5[_0x1a52('0x19')],_0x280bb2=_0x1f7fca[_0x1a52('0x1a')],_0x50bbab=_0x1f7fca[_0x1a52('0x1a')]+_0x1f7fca[_0x1a52('0x1b')],_0x11be1a;if(_0x50bbab>=_0x428a94){_0x50bbab=_0x428a94;_0x11be1a=0xc8;}else{_0x11be1a=0xce;}_0x5ed514[_0x1a52('0x17')](_0x11be1a);return _0x5ed514[_0x1a52('0x1c')](_0x1a52('0x1d'),_0x280bb2+'-'+_0x50bbab+'/'+_0x428a94)[_0x1a52('0x1e')](_0x438ac5);}return null;};}function patchUpdates(_0x4392ff){return function(_0x2c0d0b){try{jsonpatch['apply'](_0x2c0d0b,_0x4392ff,!![]);}catch(_0x5201e4){return BPromise[_0x1a52('0x1f')](_0x5201e4);}return _0x2c0d0b[_0x1a52('0x20')]();};}function saveUpdates(_0x104e97,_0x59db0a){return function(_0x5b771e){if(_0x5b771e){return _0x5b771e[_0x1a52('0x21')](_0x104e97)[_0x1a52('0x22')](function(_0x227e95){return _0x227e95;});}return null;};}function removeEntity(_0x559d04,_0x5835f8){return function(_0x224b8d){if(_0x224b8d){return _0x224b8d['destroy']()[_0x1a52('0x22')](function(){_0x559d04[_0x1a52('0x17')](0xcc)[_0x1a52('0x18')]();});}};}function handleEntityNotFound(_0x20d574,_0xdffd26){return function(_0x250f43){if(!_0x250f43){_0x20d574[_0x1a52('0x16')](0x194);}return _0x250f43;};}function handleError(_0x563f59,_0x308866){_0x308866=_0x308866||0x1f4;return function(_0x4e845c){logger[_0x1a52('0x23')](_0x4e845c[_0x1a52('0x24')]);if(_0x4e845c[_0x1a52('0x25')]){delete _0x4e845c[_0x1a52('0x25')];}_0x563f59[_0x1a52('0x17')](_0x308866)[_0x1a52('0x26')](_0x4e845c);};}exports['index']=function(_0x1b98e5,_0x1fd2b5){var _0x46baf3={},_0xdf1ef5={},_0x536c3d={'count':0x0,'rows':[]};var _0x374175=_[_0x1a52('0x27')](db[_0x1a52('0x28')]['rawAttributes'],function(_0x378ad8){return{'name':_0x378ad8['fieldName'],'type':_0x378ad8['type']['key']};});_0xdf1ef5[_0x1a52('0x29')]=_[_0x1a52('0x27')](_0x374175,'name');_0xdf1ef5['query']=_[_0x1a52('0x2a')](_0x1b98e5['query']);_0xdf1ef5[_0x1a52('0x2b')]=_[_0x1a52('0x2c')](_0xdf1ef5[_0x1a52('0x29')],_0xdf1ef5[_0x1a52('0x2d')]);_0x46baf3[_0x1a52('0x2e')]=_['intersection'](_0xdf1ef5[_0x1a52('0x29')],qs[_0x1a52('0x2f')](_0x1b98e5[_0x1a52('0x2d')][_0x1a52('0x2f')]));_0x46baf3['attributes']=_0x46baf3[_0x1a52('0x2e')][_0x1a52('0x30')]?_0x46baf3['attributes']:_0xdf1ef5['model'];if(!_0x1b98e5[_0x1a52('0x2d')][_0x1a52('0x31')](_0x1a52('0x32'))){_0x46baf3[_0x1a52('0x1b')]=qs[_0x1a52('0x1b')](_0x1b98e5[_0x1a52('0x2d')][_0x1a52('0x1b')]);_0x46baf3[_0x1a52('0x1a')]=qs[_0x1a52('0x1a')](_0x1b98e5[_0x1a52('0x2d')]['offset']);}_0x46baf3[_0x1a52('0x33')]=qs[_0x1a52('0x34')](_0x1b98e5['query'][_0x1a52('0x34')]);_0x46baf3[_0x1a52('0x35')]=qs['filters'](_['pick'](_0x1b98e5['query'],_0xdf1ef5[_0x1a52('0x2b')]),_0x374175);if(_0x1b98e5[_0x1a52('0x2d')]['filter']){_0x46baf3[_0x1a52('0x35')]=_[_0x1a52('0x36')](_0x46baf3[_0x1a52('0x35')],{'$or':_[_0x1a52('0x27')](_0x374175,function(_0x1469f3){if(_0x1469f3['type']!==_0x1a52('0x37')){var _0x3b8c75={};_0x3b8c75[_0x1469f3['name']]={'$like':'%'+_0x1b98e5[_0x1a52('0x2d')][_0x1a52('0x38')]+'%'};return _0x3b8c75;}})});}_0x46baf3=_[_0x1a52('0x36')]({},_0x46baf3,_0x1b98e5[_0x1a52('0x39')]);var _0x4fcc15={'where':_0x46baf3[_0x1a52('0x35')]};return db[_0x1a52('0x28')][_0x1a52('0x19')](_0x4fcc15)[_0x1a52('0x22')](function(_0x45d696){_0x536c3d['count']=_0x45d696;if(_0x1b98e5[_0x1a52('0x2d')][_0x1a52('0x3a')]){_0x46baf3[_0x1a52('0x3b')]=[{'all':!![]}];}return db[_0x1a52('0x28')]['findAll'](_0x46baf3);})[_0x1a52('0x22')](function(_0x22a5eb){_0x536c3d[_0x1a52('0x3c')]=_0x22a5eb;return _0x536c3d;})[_0x1a52('0x22')](respondWithFilteredResult(_0x1fd2b5,_0x46baf3))['catch'](handleError(_0x1fd2b5,null));};exports[_0x1a52('0x3d')]=function(_0x50b6eb,_0x5b712f){var _0xd4fd80={'raw':!![],'where':{'id':_0x50b6eb['params']['id']}},_0x24d554={};_0x24d554['model']=_[_0x1a52('0x2a')](db[_0x1a52('0x28')]['rawAttributes']);_0x24d554[_0x1a52('0x2d')]=_['keys'](_0x50b6eb[_0x1a52('0x2d')]);_0x24d554[_0x1a52('0x2b')]=_[_0x1a52('0x2c')](_0x24d554[_0x1a52('0x29')],_0x24d554['query']);_0xd4fd80['attributes']=_[_0x1a52('0x2c')](_0x24d554[_0x1a52('0x29')],qs[_0x1a52('0x2f')](_0x50b6eb['query']['fields']));_0xd4fd80[_0x1a52('0x2e')]=_0xd4fd80[_0x1a52('0x2e')][_0x1a52('0x30')]?_0xd4fd80[_0x1a52('0x2e')]:_0x24d554[_0x1a52('0x29')];if(_0x50b6eb[_0x1a52('0x2d')][_0x1a52('0x3a')]){_0xd4fd80[_0x1a52('0x3b')]=[{'all':!![]}];}_0xd4fd80=_[_0x1a52('0x36')]({},_0xd4fd80,_0x50b6eb[_0x1a52('0x39')]);return db[_0x1a52('0x28')][_0x1a52('0x3e')](_0xd4fd80)[_0x1a52('0x22')](handleEntityNotFound(_0x5b712f,null))['then'](respondWithResult(_0x5b712f,null))[_0x1a52('0x3f')](handleError(_0x5b712f,null));};exports[_0x1a52('0x40')]=function(_0xb3725d,_0x2eeedc){return db['MailServerOut']['create'](_0xb3725d[_0x1a52('0x41')],{})['then'](respondWithResult(_0x2eeedc,0xc9))[_0x1a52('0x3f')](handleError(_0x2eeedc,null));};exports[_0x1a52('0x21')]=function(_0x42e52f,_0x2da2cb){if(_0x42e52f[_0x1a52('0x41')]['id']){delete _0x42e52f['body']['id'];}return db[_0x1a52('0x28')][_0x1a52('0x3e')]({'where':{'id':_0x42e52f[_0x1a52('0x42')]['id']}})['then'](handleEntityNotFound(_0x2da2cb,null))['then'](saveUpdates(_0x42e52f['body'],null))[_0x1a52('0x22')](respondWithResult(_0x2da2cb,null))['catch'](handleError(_0x2da2cb,null));};exports['destroy']=function(_0x3d3c26,_0x53e9ee){return db[_0x1a52('0x28')][_0x1a52('0x3e')]({'where':{'id':_0x3d3c26[_0x1a52('0x42')]['id']}})[_0x1a52('0x22')](handleEntityNotFound(_0x53e9ee,null))[_0x1a52('0x22')](removeEntity(_0x53e9ee,null))[_0x1a52('0x3f')](handleError(_0x53e9ee,null));};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js
index 546cb97..987435f 100644
--- a/server/api/mailServerOut/mailServerOut.model.js
+++ b/server/api/mailServerOut/mailServerOut.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0154=['request-promise','path','rimraf','../../config/environment','define','MailServerOut','lodash','util','api','moment','bluebird'];(function(_0x1cfba1,_0xceafc){var _0x4fd6aa=function(_0x27e430){while(--_0x27e430){_0x1cfba1['push'](_0x1cfba1['shift']());}};_0x4fd6aa(++_0xceafc);}(_0x0154,0x124));var _0x4015=function(_0x566e80,_0x586219){_0x566e80=_0x566e80-0x0;var _0x4193de=_0x0154[_0x566e80];return _0x4193de;};'use strict';var _=require(_0x4015('0x0'));var util=require(_0x4015('0x1'));var logger=require('../../config/logger')(_0x4015('0x2'));var moment=require(_0x4015('0x3'));var BPromise=require(_0x4015('0x4'));var rp=require(_0x4015('0x5'));var fs=require('fs');var path=require(_0x4015('0x6'));var rimraf=require(_0x4015('0x7'));var config=require(_0x4015('0x8'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x1921db,_0x3b7a0b){return _0x1921db[_0x4015('0x9')](_0x4015('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5822=['exports','MailServerOut','mail_servers_out','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x5822,0x1bb));var _0x2582=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0x5822[_0x4d521e];return _0x3beb42;};'use strict';var _=require(_0x2582('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2582('0x1'));var moment=require(_0x2582('0x2'));var BPromise=require(_0x2582('0x3'));var rp=require(_0x2582('0x4'));var fs=require('fs');var path=require(_0x2582('0x5'));var rimraf=require('rimraf');var config=require(_0x2582('0x6'));var attributes=require(_0x2582('0x7'));module[_0x2582('0x8')]=function(_0x2d0789,_0xbc22a){return _0x2d0789['define'](_0x2582('0x9'),attributes,{'tableName':_0x2582('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js
index c458995..bc968da 100644
--- a/server/api/mailServerOut/mailServerOut.rpc.js
+++ b/server/api/mailServerOut/mailServerOut.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd361=['request','then','info','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','MailServerOut,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x261347,_0x3744bd){var _0x47e650=function(_0xd19ed2){while(--_0xd19ed2){_0x261347['push'](_0x261347['shift']());}};_0x47e650(++_0x3744bd);}(_0xd361,0xf3));var _0x1d36=function(_0x2cd1f2,_0x39972b){_0x2cd1f2=_0x2cd1f2-0x0;var _0x5f1267=_0xd361[_0x2cd1f2];return _0x5f1267;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d36('0x0'));var BPromise=require(_0x1d36('0x1'));var rs=require(_0x1d36('0x2'));var fs=require('fs');var Redis=require(_0x1d36('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d36('0x4'));var logger=require(_0x1d36('0x5'))(_0x1d36('0x6'));var config=require(_0x1d36('0x7'));var jayson=require(_0x1d36('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e24ef,_0x2fa114,_0x116f25){return new BPromise(function(_0x1b530c,_0x59371a){return client[_0x1d36('0x9')](_0x1e24ef,_0x116f25)[_0x1d36('0xa')](function(_0x485533){logger[_0x1d36('0xb')]('MailServerOut,\x20%s,\x20%s',_0x2fa114,_0x1d36('0xc'));logger[_0x1d36('0xd')](_0x1d36('0xe'),_0x2fa114,_0x1d36('0xc'),JSON[_0x1d36('0xf')](_0x485533));if(_0x485533[_0x1d36('0x10')]){if(_0x485533[_0x1d36('0x10')]['code']===0x1f4){logger[_0x1d36('0x10')](_0x1d36('0x11'),_0x2fa114,_0x485533[_0x1d36('0x10')][_0x1d36('0x12')]);return _0x59371a(_0x485533[_0x1d36('0x10')][_0x1d36('0x12')]);}logger[_0x1d36('0x10')](_0x1d36('0x11'),_0x2fa114,_0x485533[_0x1d36('0x10')]['message']);return _0x1b530c(_0x485533['error'][_0x1d36('0x12')]);}else{logger[_0x1d36('0xb')](_0x1d36('0x11'),_0x2fa114,'request\x20sent');_0x1b530c(_0x485533[_0x1d36('0x13')][_0x1d36('0x12')]);}})[_0x1d36('0x14')](function(_0xa5696f){logger[_0x1d36('0x10')](_0x1d36('0x11'),_0x2fa114,_0xa5696f);_0x59371a(_0xa5696f);});});}
\ No newline at end of file
+var _0xd86a=['then','info','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../config/utils','rpc','client','http','request'];(function(_0x46f618,_0x4d9903){var _0x1e1d28=function(_0x35f252){while(--_0x35f252){_0x46f618['push'](_0x46f618['shift']());}};_0x1e1d28(++_0x4d9903);}(_0xd86a,0x83));var _0xad86=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0xd86a[_0x2c6810];return _0x213881;};'use strict';var _=require(_0xad86('0x0'));var util=require('util');var moment=require(_0xad86('0x1'));var BPromise=require('bluebird');var rs=require(_0xad86('0x2'));var fs=require('fs');var Redis=require(_0xad86('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad86('0x4'));var logger=require('../../config/logger')(_0xad86('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad86('0x6')][_0xad86('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7e3e80,_0x2352c6,_0x552eb8){return new BPromise(function(_0x5c42eb,_0x5f4b62){return client[_0xad86('0x8')](_0x7e3e80,_0x552eb8)[_0xad86('0x9')](function(_0x2f562c){logger[_0xad86('0xa')](_0xad86('0xb'),_0x2352c6,'request\x20sent');logger[_0xad86('0xc')](_0xad86('0xd'),_0x2352c6,_0xad86('0xe'),JSON[_0xad86('0xf')](_0x2f562c));if(_0x2f562c[_0xad86('0x10')]){if(_0x2f562c['error'][_0xad86('0x11')]===0x1f4){logger[_0xad86('0x10')](_0xad86('0xb'),_0x2352c6,_0x2f562c['error'][_0xad86('0x12')]);return _0x5f4b62(_0x2f562c[_0xad86('0x10')]['message']);}logger['error']('MailServerOut,\x20%s,\x20%s',_0x2352c6,_0x2f562c[_0xad86('0x10')][_0xad86('0x12')]);return _0x5c42eb(_0x2f562c[_0xad86('0x10')][_0xad86('0x12')]);}else{logger[_0xad86('0xa')]('MailServerOut,\x20%s,\x20%s',_0x2352c6,_0xad86('0xe'));_0x5c42eb(_0x2f562c[_0xad86('0x13')][_0xad86('0x12')]);}})['catch'](function(_0x96c056){logger[_0xad86('0x10')](_0xad86('0xb'),_0x2352c6,_0x96c056);_0x5f4b62(_0x96c056);});});}
\ No newline at end of file
diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js
index c17b712..21c973a 100644
--- a/server/api/mailSubstatus/index.js
+++ b/server/api/mailSubstatus/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d0c=['get','index','isAuthenticated','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailSubstatus.controller'];(function(_0x31e76c,_0x4bc691){var _0x54773e=function(_0x687377){while(--_0x687377){_0x31e76c['push'](_0x31e76c['shift']());}};_0x54773e(++_0x4bc691);}(_0x0d0c,0x6f));var _0xc0d0=function(_0x388601,_0x1cc3b9){_0x388601=_0x388601-0x0;var _0x4a29ec=_0x0d0c[_0x388601];return _0x4a29ec;};'use strict';var multer=require(_0xc0d0('0x0'));var util=require(_0xc0d0('0x1'));var path=require(_0xc0d0('0x2'));var timeout=require(_0xc0d0('0x3'));var express=require(_0xc0d0('0x4'));var router=express['Router']();var auth=require(_0xc0d0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc0d0('0x6'));var controller=require(_0xc0d0('0x7'));router[_0xc0d0('0x8')]('/',auth['isAuthenticated'](),controller[_0xc0d0('0x9')]);router[_0xc0d0('0x8')]('/describe',auth[_0xc0d0('0xa')](),controller['describe']);router[_0xc0d0('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc0d0('0xb')]('/',auth[_0xc0d0('0xa')](),controller[_0xc0d0('0xc')]);router[_0xc0d0('0xd')]('/:id',auth[_0xc0d0('0xa')](),controller[_0xc0d0('0xe')]);router['delete']('/:id',auth[_0xc0d0('0xa')](),controller[_0xc0d0('0xf')]);module[_0xc0d0('0x10')]=router;
\ No newline at end of file
+var _0x313c=['update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x1c2c2c,_0x12aa37){var _0x399d94=function(_0x1ae26d){while(--_0x1ae26d){_0x1c2c2c['push'](_0x1c2c2c['shift']());}};_0x399d94(++_0x12aa37);}(_0x313c,0xed));var _0xc313=function(_0xa01faa,_0xbb9e97){_0xa01faa=_0xa01faa-0x0;var _0x1e9eb6=_0x313c[_0xa01faa];return _0x1e9eb6;};'use strict';var multer=require(_0xc313('0x0'));var util=require(_0xc313('0x1'));var path=require(_0xc313('0x2'));var timeout=require('connect-timeout');var express=require(_0xc313('0x3'));var router=express['Router']();var auth=require(_0xc313('0x4'));var interaction=require(_0xc313('0x5'));var config=require('../../config/environment');var controller=require(_0xc313('0x6'));router[_0xc313('0x7')]('/',auth[_0xc313('0x8')](),controller[_0xc313('0x9')]);router[_0xc313('0x7')]('/describe',auth[_0xc313('0x8')](),controller['describe']);router['get'](_0xc313('0xa'),auth[_0xc313('0x8')](),controller[_0xc313('0xb')]);router[_0xc313('0xc')]('/',auth[_0xc313('0x8')](),controller[_0xc313('0xd')]);router[_0xc313('0xe')](_0xc313('0xa'),auth[_0xc313('0x8')](),controller[_0xc313('0xf')]);router[_0xc313('0x10')](_0xc313('0xa'),auth[_0xc313('0x8')](),controller[_0xc313('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js
index 0871dec..f6436db 100644
--- a/server/api/mailSubstatus/mailSubstatus.attributes.js
+++ b/server/api/mailSubstatus/mailSubstatus.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbcae=['name','sequelize','exports','STRING'];(function(_0x340a7c,_0x4e3a82){var _0x41dc1d=function(_0x163cb4){while(--_0x163cb4){_0x340a7c['push'](_0x340a7c['shift']());}};_0x41dc1d(++_0x4e3a82);}(_0xbcae,0xa9));var _0xebca=function(_0x481943,_0x38003c){_0x481943=_0x481943-0x0;var _0x2b4dd0=_0xbcae[_0x481943];return _0x2b4dd0;};'use strict';var Sequelize=require(_0xebca('0x0'));module[_0xebca('0x1')]={'name':{'type':Sequelize[_0xebca('0x2')],'unique':_0xebca('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xebca('0x2')]}};
\ No newline at end of file
+var _0x161a=['STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x161a,0x140));var _0xa161=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x161a[_0x622035];return _0x326cf2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa161('0x0')],'unique':_0xa161('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js
index ee77eb3..12d6313 100644
--- a/server/api/mailSubstatus/mailSubstatus.controller.js
+++ b/server/api/mailSubstatus/mailSubstatus.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x048a=['bluebird','mustache','path','sox','ejs','squel','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','map','MailSubstatus','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','filter','options','includeAll','findAll','catch','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x5a8ea5,_0x2ff794){var _0x3e5df1=function(_0x4493e2){while(--_0x4493e2){_0x5a8ea5['push'](_0x5a8ea5['shift']());}};_0x3e5df1(++_0x2ff794);}(_0x048a,0x1d8));var _0xa048=function(_0x441398,_0x5cf481){_0x441398=_0x441398-0x0;var _0x29b137=_0x048a[_0x441398];return _0x29b137;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa048('0x0'));var zipdir=require(_0xa048('0x1'));var jsonpatch=require(_0xa048('0x2'));var rp=require('request-promise');var moment=require(_0xa048('0x3'));var BPromise=require(_0xa048('0x4'));var Mustache=require(_0xa048('0x5'));var util=require('util');var path=require(_0xa048('0x6'));var sox=require(_0xa048('0x7'));var csv=require('to-csv');var ejs=require(_0xa048('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa048('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa048('0xa'));var toCsv=require(_0xa048('0xb'));var querystring=require(_0xa048('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa048('0xd'));var as=require(_0xa048('0xe'));var hardwareService=require(_0xa048('0xf'));var logger=require('../../config/logger')(_0xa048('0x10'));var utils=require(_0xa048('0x11'));var config=require(_0xa048('0x12'));var db=require(_0xa048('0x13'))['db'];function respondWithStatusCode(_0x37864b,_0xe4a621){_0xe4a621=_0xe4a621||0xcc;return function(_0x57becc){if(_0x57becc){return _0x37864b[_0xa048('0x14')](_0xe4a621);}return _0x37864b[_0xa048('0x15')](_0xe4a621)[_0xa048('0x16')]();};}function respondWithResult(_0xee9088,_0x90b1dc){_0x90b1dc=_0x90b1dc||0xc8;return function(_0x81c4cd){if(_0x81c4cd){return _0xee9088[_0xa048('0x15')](_0x90b1dc)[_0xa048('0x17')](_0x81c4cd);}};}function respondWithFilteredResult(_0x4348b0,_0x1adf69){return function(_0x4b0a2d){if(_0x4b0a2d){var _0x558e17=_0x4b0a2d[_0xa048('0x18')],_0x1c6785=_0x1adf69['offset'],_0x459ac9=_0x1adf69['offset']+_0x1adf69[_0xa048('0x19')],_0x44918b;if(_0x459ac9>=_0x558e17){_0x459ac9=_0x558e17;_0x44918b=0xc8;}else{_0x44918b=0xce;}_0x4348b0[_0xa048('0x15')](_0x44918b);return _0x4348b0[_0xa048('0x1a')](_0xa048('0x1b'),_0x1c6785+'-'+_0x459ac9+'/'+_0x558e17)[_0xa048('0x17')](_0x4b0a2d);}return null;};}function patchUpdates(_0xf61d09){return function(_0x329acf){try{jsonpatch[_0xa048('0x1c')](_0x329acf,_0xf61d09,!![]);}catch(_0x5027e1){return BPromise[_0xa048('0x1d')](_0x5027e1);}return _0x329acf[_0xa048('0x1e')]();};}function saveUpdates(_0x233732,_0x459c7d){return function(_0x53f325){if(_0x53f325){return _0x53f325[_0xa048('0x1f')](_0x233732)[_0xa048('0x20')](function(_0x446866){return _0x446866;});}return null;};}function removeEntity(_0x8e7e3d,_0x239fe4){return function(_0x474d4a){if(_0x474d4a){return _0x474d4a[_0xa048('0x21')]()[_0xa048('0x20')](function(){_0x8e7e3d['status'](0xcc)[_0xa048('0x16')]();});}};}function handleEntityNotFound(_0x2fbb67,_0x449eae){return function(_0x247130){if(!_0x247130){_0x2fbb67[_0xa048('0x14')](0x194);}return _0x247130;};}function handleError(_0x5559d2,_0x3ba97c){_0x3ba97c=_0x3ba97c||0x1f4;return function(_0x1d38f9){logger[_0xa048('0x22')](_0x1d38f9[_0xa048('0x23')]);if(_0x1d38f9['name']){delete _0x1d38f9['name'];}_0x5559d2[_0xa048('0x15')](_0x3ba97c)['send'](_0x1d38f9);};}exports['index']=function(_0x377957,_0x985bec){var _0x4fe7c0={},_0x46792f={},_0x20ac61={'count':0x0,'rows':[]};var _0x4826b4=_[_0xa048('0x24')](db[_0xa048('0x25')][_0xa048('0x26')],function(_0x2fc514){return{'name':_0x2fc514[_0xa048('0x27')],'type':_0x2fc514[_0xa048('0x28')][_0xa048('0x29')]};});_0x46792f['model']=_[_0xa048('0x24')](_0x4826b4,_0xa048('0x2a'));_0x46792f[_0xa048('0x2b')]=_[_0xa048('0x2c')](_0x377957[_0xa048('0x2b')]);_0x46792f[_0xa048('0x2d')]=_[_0xa048('0x2e')](_0x46792f[_0xa048('0x2f')],_0x46792f['query']);_0x4fe7c0[_0xa048('0x30')]=_[_0xa048('0x2e')](_0x46792f[_0xa048('0x2f')],qs[_0xa048('0x31')](_0x377957[_0xa048('0x2b')][_0xa048('0x31')]));_0x4fe7c0[_0xa048('0x30')]=_0x4fe7c0[_0xa048('0x30')][_0xa048('0x32')]?_0x4fe7c0[_0xa048('0x30')]:_0x46792f[_0xa048('0x2f')];if(!_0x377957[_0xa048('0x2b')][_0xa048('0x33')](_0xa048('0x34'))){_0x4fe7c0['limit']=qs[_0xa048('0x19')](_0x377957[_0xa048('0x2b')]['limit']);_0x4fe7c0[_0xa048('0x35')]=qs[_0xa048('0x35')](_0x377957[_0xa048('0x2b')][_0xa048('0x35')]);}_0x4fe7c0['order']=qs[_0xa048('0x36')](_0x377957[_0xa048('0x2b')][_0xa048('0x36')]);_0x4fe7c0[_0xa048('0x37')]=qs[_0xa048('0x2d')](_[_0xa048('0x38')](_0x377957['query'],_0x46792f[_0xa048('0x2d')]),_0x4826b4);if(_0x377957[_0xa048('0x2b')]['filter']){_0x4fe7c0['where']=_[_0xa048('0x39')](_0x4fe7c0[_0xa048('0x37')],{'$or':_['map'](_0x4826b4,function(_0x23f82d){if(_0x23f82d['type']!=='VIRTUAL'){var _0x2cf760={};_0x2cf760[_0x23f82d[_0xa048('0x2a')]]={'$like':'%'+_0x377957[_0xa048('0x2b')][_0xa048('0x3a')]+'%'};return _0x2cf760;}})});}_0x4fe7c0=_[_0xa048('0x39')]({},_0x4fe7c0,_0x377957[_0xa048('0x3b')]);var _0x19474f={'where':_0x4fe7c0[_0xa048('0x37')]};return db[_0xa048('0x25')][_0xa048('0x18')](_0x19474f)[_0xa048('0x20')](function(_0x21e801){_0x20ac61[_0xa048('0x18')]=_0x21e801;if(_0x377957[_0xa048('0x2b')][_0xa048('0x3c')]){_0x4fe7c0['include']=[{'all':!![]}];}return db[_0xa048('0x25')][_0xa048('0x3d')](_0x4fe7c0);})[_0xa048('0x20')](function(_0x215811){_0x20ac61['rows']=_0x215811;return _0x20ac61;})[_0xa048('0x20')](respondWithFilteredResult(_0x985bec,_0x4fe7c0))[_0xa048('0x3e')](handleError(_0x985bec,null));};exports['show']=function(_0x547b44,_0x127748){var _0x29177b={'raw':!![],'where':{'id':_0x547b44['params']['id']}},_0x4c1b45={};_0x4c1b45[_0xa048('0x2f')]=_[_0xa048('0x2c')](db['MailSubstatus'][_0xa048('0x26')]);_0x4c1b45[_0xa048('0x2b')]=_[_0xa048('0x2c')](_0x547b44[_0xa048('0x2b')]);_0x4c1b45['filters']=_[_0xa048('0x2e')](_0x4c1b45[_0xa048('0x2f')],_0x4c1b45[_0xa048('0x2b')]);_0x29177b['attributes']=_[_0xa048('0x2e')](_0x4c1b45[_0xa048('0x2f')],qs['fields'](_0x547b44[_0xa048('0x2b')][_0xa048('0x31')]));_0x29177b[_0xa048('0x30')]=_0x29177b[_0xa048('0x30')][_0xa048('0x32')]?_0x29177b['attributes']:_0x4c1b45[_0xa048('0x2f')];if(_0x547b44[_0xa048('0x2b')][_0xa048('0x3c')]){_0x29177b['include']=[{'all':!![]}];}_0x29177b=_[_0xa048('0x39')]({},_0x29177b,_0x547b44['options']);return db[_0xa048('0x25')][_0xa048('0x3f')](_0x29177b)[_0xa048('0x20')](handleEntityNotFound(_0x127748,null))[_0xa048('0x20')](respondWithResult(_0x127748,null))[_0xa048('0x3e')](handleError(_0x127748,null));};exports[_0xa048('0x40')]=function(_0x5bf2fd,_0x1a653c){return db[_0xa048('0x25')]['create'](_0x5bf2fd['body'],{})[_0xa048('0x20')](respondWithResult(_0x1a653c,0xc9))['catch'](handleError(_0x1a653c,null));};exports['update']=function(_0x5e47b7,_0x23744c){if(_0x5e47b7[_0xa048('0x41')]['id']){delete _0x5e47b7[_0xa048('0x41')]['id'];}return db[_0xa048('0x25')][_0xa048('0x3f')]({'where':{'id':_0x5e47b7[_0xa048('0x42')]['id']}})[_0xa048('0x20')](handleEntityNotFound(_0x23744c,null))[_0xa048('0x20')](saveUpdates(_0x5e47b7[_0xa048('0x41')],null))[_0xa048('0x20')](respondWithResult(_0x23744c,null))[_0xa048('0x3e')](handleError(_0x23744c,null));};exports[_0xa048('0x21')]=function(_0x594cdb,_0x148256){return db[_0xa048('0x25')][_0xa048('0x3f')]({'where':{'id':_0x594cdb['params']['id']}})['then'](handleEntityNotFound(_0x148256,null))[_0xa048('0x20')](removeEntity(_0x148256,null))[_0xa048('0x3e')](handleError(_0x148256,null));};exports[_0xa048('0x43')]=function(_0x348546,_0x4dcc65){return db[_0xa048('0x25')][_0xa048('0x43')]()[_0xa048('0x20')](respondWithResult(_0x4dcc65,null))[_0xa048('0x3e')](handleError(_0x4dcc65,null));};
\ No newline at end of file
+var _0x175b=['MailSubstatus','rawAttributes','fieldName','type','key','query','intersection','attributes','model','length','nolimit','limit','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','keys','fields','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x1f1020,_0x166ed7){var _0x36bda0=function(_0x14b530){while(--_0x14b530){_0x1f1020['push'](_0x1f1020['shift']());}};_0x36bda0(++_0x166ed7);}(_0x175b,0xb0));var _0xb175=function(_0x385467,_0x298239){_0x385467=_0x385467-0x0;var _0x5ed67e=_0x175b[_0x385467];return _0x5ed67e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb175('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb175('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb175('0x2'));var moment=require(_0xb175('0x3'));var BPromise=require(_0xb175('0x4'));var Mustache=require(_0xb175('0x5'));var util=require('util');var path=require(_0xb175('0x6'));var sox=require(_0xb175('0x7'));var csv=require('to-csv');var ejs=require(_0xb175('0x8'));var fs=require('fs');var _=require(_0xb175('0x9'));var squel=require('squel');var crypto=require(_0xb175('0xa'));var jsforce=require(_0xb175('0xb'));var deskjs=require(_0xb175('0xc'));var toCsv=require(_0xb175('0xd'));var querystring=require('querystring');var Papa=require(_0xb175('0xe'));var Redis=require('ioredis');var authService=require(_0xb175('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb175('0x10'));var logger=require(_0xb175('0x11'))(_0xb175('0x12'));var utils=require(_0xb175('0x13'));var config=require(_0xb175('0x14'));var db=require(_0xb175('0x15'))['db'];function respondWithStatusCode(_0xf78d50,_0x1d5d7f){_0x1d5d7f=_0x1d5d7f||0xcc;return function(_0xf9b628){if(_0xf9b628){return _0xf78d50[_0xb175('0x16')](_0x1d5d7f);}return _0xf78d50[_0xb175('0x17')](_0x1d5d7f)[_0xb175('0x18')]();};}function respondWithResult(_0x225360,_0x39bbe7){_0x39bbe7=_0x39bbe7||0xc8;return function(_0x5b8d17){if(_0x5b8d17){return _0x225360[_0xb175('0x17')](_0x39bbe7)['json'](_0x5b8d17);}};}function respondWithFilteredResult(_0x391f2a,_0x601a3d){return function(_0x1cf402){if(_0x1cf402){var _0x7ba8bc=_0x1cf402[_0xb175('0x19')],_0x79624=_0x601a3d[_0xb175('0x1a')],_0x3eb8ff=_0x601a3d[_0xb175('0x1a')]+_0x601a3d['limit'],_0x10f559;if(_0x3eb8ff>=_0x7ba8bc){_0x3eb8ff=_0x7ba8bc;_0x10f559=0xc8;}else{_0x10f559=0xce;}_0x391f2a['status'](_0x10f559);return _0x391f2a['set'](_0xb175('0x1b'),_0x79624+'-'+_0x3eb8ff+'/'+_0x7ba8bc)[_0xb175('0x1c')](_0x1cf402);}return null;};}function patchUpdates(_0x2590d4){return function(_0xa97426){try{jsonpatch[_0xb175('0x1d')](_0xa97426,_0x2590d4,!![]);}catch(_0x56bb31){return BPromise[_0xb175('0x1e')](_0x56bb31);}return _0xa97426[_0xb175('0x1f')]();};}function saveUpdates(_0x2cce64,_0x42acd6){return function(_0x515453){if(_0x515453){return _0x515453[_0xb175('0x20')](_0x2cce64)[_0xb175('0x21')](function(_0x415fe9){return _0x415fe9;});}return null;};}function removeEntity(_0x1d3ecf,_0x42175d){return function(_0x2a7108){if(_0x2a7108){return _0x2a7108[_0xb175('0x22')]()['then'](function(){_0x1d3ecf[_0xb175('0x17')](0xcc)[_0xb175('0x18')]();});}};}function handleEntityNotFound(_0x3443aa,_0x565764){return function(_0x104608){if(!_0x104608){_0x3443aa[_0xb175('0x16')](0x194);}return _0x104608;};}function handleError(_0x40b593,_0x302d98){_0x302d98=_0x302d98||0x1f4;return function(_0x1ad7f4){logger[_0xb175('0x23')](_0x1ad7f4['stack']);if(_0x1ad7f4['name']){delete _0x1ad7f4[_0xb175('0x24')];}_0x40b593[_0xb175('0x17')](_0x302d98)[_0xb175('0x25')](_0x1ad7f4);};}exports[_0xb175('0x26')]=function(_0x43d65a,_0x3ac6da){var _0x360a01={},_0xc2cdd3={},_0x73cf1={'count':0x0,'rows':[]};var _0x217b76=_[_0xb175('0x27')](db[_0xb175('0x28')][_0xb175('0x29')],function(_0x46c992){return{'name':_0x46c992[_0xb175('0x2a')],'type':_0x46c992[_0xb175('0x2b')][_0xb175('0x2c')]};});_0xc2cdd3['model']=_[_0xb175('0x27')](_0x217b76,_0xb175('0x24'));_0xc2cdd3[_0xb175('0x2d')]=_['keys'](_0x43d65a['query']);_0xc2cdd3['filters']=_[_0xb175('0x2e')](_0xc2cdd3['model'],_0xc2cdd3[_0xb175('0x2d')]);_0x360a01[_0xb175('0x2f')]=_[_0xb175('0x2e')](_0xc2cdd3[_0xb175('0x30')],qs['fields'](_0x43d65a[_0xb175('0x2d')]['fields']));_0x360a01[_0xb175('0x2f')]=_0x360a01[_0xb175('0x2f')][_0xb175('0x31')]?_0x360a01['attributes']:_0xc2cdd3[_0xb175('0x30')];if(!_0x43d65a[_0xb175('0x2d')]['hasOwnProperty'](_0xb175('0x32'))){_0x360a01[_0xb175('0x33')]=qs[_0xb175('0x33')](_0x43d65a[_0xb175('0x2d')]['limit']);_0x360a01[_0xb175('0x1a')]=qs[_0xb175('0x1a')](_0x43d65a[_0xb175('0x2d')][_0xb175('0x1a')]);}_0x360a01['order']=qs[_0xb175('0x34')](_0x43d65a[_0xb175('0x2d')][_0xb175('0x34')]);_0x360a01['where']=qs[_0xb175('0x35')](_[_0xb175('0x36')](_0x43d65a[_0xb175('0x2d')],_0xc2cdd3[_0xb175('0x35')]),_0x217b76);if(_0x43d65a[_0xb175('0x2d')][_0xb175('0x37')]){_0x360a01[_0xb175('0x38')]=_['merge'](_0x360a01[_0xb175('0x38')],{'$or':_[_0xb175('0x27')](_0x217b76,function(_0x49497c){if(_0x49497c[_0xb175('0x2b')]!=='VIRTUAL'){var _0x4a1b74={};_0x4a1b74[_0x49497c['name']]={'$like':'%'+_0x43d65a['query'][_0xb175('0x37')]+'%'};return _0x4a1b74;}})});}_0x360a01=_[_0xb175('0x39')]({},_0x360a01,_0x43d65a[_0xb175('0x3a')]);var _0x39572e={'where':_0x360a01['where']};return db[_0xb175('0x28')]['count'](_0x39572e)[_0xb175('0x21')](function(_0x15521e){_0x73cf1['count']=_0x15521e;if(_0x43d65a[_0xb175('0x2d')][_0xb175('0x3b')]){_0x360a01[_0xb175('0x3c')]=[{'all':!![]}];}return db[_0xb175('0x28')][_0xb175('0x3d')](_0x360a01);})['then'](function(_0x50224a){_0x73cf1[_0xb175('0x3e')]=_0x50224a;return _0x73cf1;})['then'](respondWithFilteredResult(_0x3ac6da,_0x360a01))[_0xb175('0x3f')](handleError(_0x3ac6da,null));};exports[_0xb175('0x40')]=function(_0x6d9b98,_0x3a41fd){var _0x5e39f2={'raw':!![],'where':{'id':_0x6d9b98['params']['id']}},_0x3f4c42={};_0x3f4c42[_0xb175('0x30')]=_['keys'](db[_0xb175('0x28')][_0xb175('0x29')]);_0x3f4c42[_0xb175('0x2d')]=_[_0xb175('0x41')](_0x6d9b98[_0xb175('0x2d')]);_0x3f4c42[_0xb175('0x35')]=_[_0xb175('0x2e')](_0x3f4c42[_0xb175('0x30')],_0x3f4c42['query']);_0x5e39f2[_0xb175('0x2f')]=_[_0xb175('0x2e')](_0x3f4c42['model'],qs['fields'](_0x6d9b98[_0xb175('0x2d')][_0xb175('0x42')]));_0x5e39f2[_0xb175('0x2f')]=_0x5e39f2[_0xb175('0x2f')]['length']?_0x5e39f2[_0xb175('0x2f')]:_0x3f4c42[_0xb175('0x30')];if(_0x6d9b98['query'][_0xb175('0x3b')]){_0x5e39f2[_0xb175('0x3c')]=[{'all':!![]}];}_0x5e39f2=_[_0xb175('0x39')]({},_0x5e39f2,_0x6d9b98[_0xb175('0x3a')]);return db[_0xb175('0x28')][_0xb175('0x43')](_0x5e39f2)[_0xb175('0x21')](handleEntityNotFound(_0x3a41fd,null))[_0xb175('0x21')](respondWithResult(_0x3a41fd,null))[_0xb175('0x3f')](handleError(_0x3a41fd,null));};exports[_0xb175('0x44')]=function(_0x2e0c9d,_0x29131b){return db[_0xb175('0x28')][_0xb175('0x44')](_0x2e0c9d[_0xb175('0x45')],{})[_0xb175('0x21')](respondWithResult(_0x29131b,0xc9))['catch'](handleError(_0x29131b,null));};exports[_0xb175('0x20')]=function(_0x34c355,_0x4ab751){if(_0x34c355[_0xb175('0x45')]['id']){delete _0x34c355[_0xb175('0x45')]['id'];}return db[_0xb175('0x28')][_0xb175('0x43')]({'where':{'id':_0x34c355[_0xb175('0x46')]['id']}})[_0xb175('0x21')](handleEntityNotFound(_0x4ab751,null))[_0xb175('0x21')](saveUpdates(_0x34c355[_0xb175('0x45')],null))[_0xb175('0x21')](respondWithResult(_0x4ab751,null))[_0xb175('0x3f')](handleError(_0x4ab751,null));};exports['destroy']=function(_0x414f0e,_0x22d277){return db[_0xb175('0x28')][_0xb175('0x43')]({'where':{'id':_0x414f0e[_0xb175('0x46')]['id']}})[_0xb175('0x21')](handleEntityNotFound(_0x22d277,null))[_0xb175('0x21')](removeEntity(_0x22d277,null))['catch'](handleError(_0x22d277,null));};exports[_0xb175('0x47')]=function(_0x5b47a2,_0x4cf98f){return db[_0xb175('0x28')][_0xb175('0x47')]()[_0xb175('0x21')](respondWithResult(_0x4cf98f,null))[_0xb175('0x3f')](handleError(_0x4cf98f,null));};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js
index 0f27e01..a12bef3 100644
--- a/server/api/mailSubstatus/mailSubstatus.model.js
+++ b/server/api/mailSubstatus/mailSubstatus.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbcf2=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0xbcf2,0x174));var _0x2bcf=function(_0x270e46,_0x122174){_0x270e46=_0x270e46-0x0;var _0x18ca4e=_0xbcf2[_0x270e46];return _0x18ca4e;};'use strict';var _=require(_0x2bcf('0x0'));var util=require(_0x2bcf('0x1'));var logger=require(_0x2bcf('0x2'))(_0x2bcf('0x3'));var moment=require(_0x2bcf('0x4'));var BPromise=require(_0x2bcf('0x5'));var rp=require(_0x2bcf('0x6'));var fs=require('fs');var path=require(_0x2bcf('0x7'));var rimraf=require(_0x2bcf('0x8'));var config=require(_0x2bcf('0x9'));var attributes=require(_0x2bcf('0xa'));module[_0x2bcf('0xb')]=function(_0x4d7b47,_0x2911d9){return _0x4d7b47['define'](_0x2bcf('0xc'),attributes,{'tableName':_0x2bcf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a90=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','MailSubstatus','lodash'];(function(_0x3126ae,_0x63144a){var _0x322ec9=function(_0x10db63){while(--_0x10db63){_0x3126ae['push'](_0x3126ae['shift']());}};_0x322ec9(++_0x63144a);}(_0x6a90,0x1a3));var _0x06a9=function(_0x3658da,_0x3db300){_0x3658da=_0x3658da-0x0;var _0x4b92fe=_0x6a90[_0x3658da];return _0x4b92fe;};'use strict';var _=require(_0x06a9('0x0'));var util=require(_0x06a9('0x1'));var logger=require(_0x06a9('0x2'))('api');var moment=require(_0x06a9('0x3'));var BPromise=require(_0x06a9('0x4'));var rp=require(_0x06a9('0x5'));var fs=require('fs');var path=require(_0x06a9('0x6'));var rimraf=require(_0x06a9('0x7'));var config=require(_0x06a9('0x8'));var attributes=require(_0x06a9('0x9'));module[_0x06a9('0xa')]=function(_0x185883,_0xc7208c){return _0x185883['define'](_0x06a9('0xb'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js
index 76d1829..0838184 100644
--- a/server/api/mailSubstatus/mailSubstatus.rpc.js
+++ b/server/api/mailSubstatus/mailSubstatus.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x702d=['stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x26fdc8,_0x2f70c1){var _0x574ebd=function(_0x8edbfa){while(--_0x8edbfa){_0x26fdc8['push'](_0x26fdc8['shift']());}};_0x574ebd(++_0x2f70c1);}(_0x702d,0x147));var _0xd702=function(_0x301936,_0x2c173f){_0x301936=_0x301936-0x0;var _0x398bee=_0x702d[_0x301936];return _0x398bee;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});}
\ No newline at end of file
+var _0xe706=['http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x195754,_0x399cbd){var _0x16004f=function(_0x17ce54){while(--_0x17ce54){_0x195754['push'](_0x195754['shift']());}};_0x16004f(++_0x399cbd);}(_0xe706,0xa3));var _0x6e70=function(_0x17aa7a,_0x2be8e4){_0x17aa7a=_0x17aa7a-0x0;var _0x2321f8=_0xe706[_0x17aa7a];return _0x2321f8;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js
index ebbabb6..68afdbb 100644
--- a/server/api/mailTransferReport/index.js
+++ b/server/api/mailTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa960=['create','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa960,0x1d0));var _0x0a96=function(_0x29da06,_0x4564fb){_0x29da06=_0x29da06-0x0;var _0x4b29fe=_0xa960[_0x29da06];return _0x4b29fe;};'use strict';var multer=require(_0x0a96('0x0'));var util=require('util');var path=require(_0x0a96('0x1'));var timeout=require(_0x0a96('0x2'));var express=require('express');var router=express[_0x0a96('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a96('0x4'));var config=require(_0x0a96('0x5'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x0a96('0x6')](),controller['index']);router[_0x0a96('0x7')](_0x0a96('0x8'),auth[_0x0a96('0x6')](),controller['describe']);router[_0x0a96('0x7')](_0x0a96('0x9'),auth[_0x0a96('0x6')](),controller[_0x0a96('0xa')]);router[_0x0a96('0xb')]('/',auth[_0x0a96('0x6')](),controller[_0x0a96('0xc')]);router[_0x0a96('0xd')](_0x0a96('0x9'),auth[_0x0a96('0x6')](),controller[_0x0a96('0xe')]);router[_0x0a96('0xf')]('/:id',auth[_0x0a96('0x6')](),controller['destroy']);module[_0x0a96('0x10')]=router;
\ No newline at end of file
+var _0x9ac5=['put','/:id','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','create'];(function(_0x56d31f,_0x1e4548){var _0x2ff62f=function(_0x5d20e9){while(--_0x5d20e9){_0x56d31f['push'](_0x56d31f['shift']());}};_0x2ff62f(++_0x1e4548);}(_0x9ac5,0x76));var _0x59ac=function(_0x1fd03e,_0x33108c){_0x1fd03e=_0x1fd03e-0x0;var _0x52a50b=_0x9ac5[_0x1fd03e];return _0x52a50b;};'use strict';var multer=require('multer');var util=require(_0x59ac('0x0'));var path=require('path');var timeout=require(_0x59ac('0x1'));var express=require(_0x59ac('0x2'));var router=express[_0x59ac('0x3')]();var auth=require(_0x59ac('0x4'));var interaction=require(_0x59ac('0x5'));var config=require(_0x59ac('0x6'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x59ac('0x7')](),controller[_0x59ac('0x8')]);router[_0x59ac('0x9')](_0x59ac('0xa'),auth[_0x59ac('0x7')](),controller[_0x59ac('0xb')]);router[_0x59ac('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x59ac('0xc')]);router[_0x59ac('0xd')]('/',auth[_0x59ac('0x7')](),controller[_0x59ac('0xe')]);router[_0x59ac('0xf')](_0x59ac('0x10'),auth[_0x59ac('0x7')](),controller['update']);router['delete'](_0x59ac('0x10'),auth[_0x59ac('0x7')](),controller[_0x59ac('0x11')]);module[_0x59ac('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js
index 4499e51..e6099a8 100644
--- a/server/api/mailTransferReport/mailTransferReport.attributes.js
+++ b/server/api/mailTransferReport/mailTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9b7=['exports','STRING','ENUM','account','agent','queue','DATE','moment','sequelize'];(function(_0x29995d,_0x54e53f){var _0x55348f=function(_0x12cf97){while(--_0x12cf97){_0x29995d['push'](_0x29995d['shift']());}};_0x55348f(++_0x54e53f);}(_0xa9b7,0xfa));var _0x7a9b=function(_0x3eb111,_0x307910){_0x3eb111=_0x3eb111-0x0;var _0x56c646=_0xa9b7[_0x3eb111];return _0x56c646;};'use strict';var moment=require(_0x7a9b('0x0'));var Sequelize=require(_0x7a9b('0x1'));module[_0x7a9b('0x2')]={'uniqueid':{'type':Sequelize[_0x7a9b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7a9b('0x4')](_0x7a9b('0x5'),_0x7a9b('0x6'),_0x7a9b('0x7')),'allowNull':![],'defaultValue':_0x7a9b('0x7')},'transferredAt':{'type':Sequelize[_0x7a9b('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xda7a=['queue','moment','sequelize','exports','STRING','account','agent'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xda7a,0x14a));var _0xada7=function(_0x38dd8f,_0xcb4236){_0x38dd8f=_0x38dd8f-0x0;var _0xc14c00=_0xda7a[_0x38dd8f];return _0xc14c00;};'use strict';var moment=require(_0xada7('0x0'));var Sequelize=require(_0xada7('0x1'));module[_0xada7('0x2')]={'uniqueid':{'type':Sequelize[_0xada7('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xada7('0x4'),_0xada7('0x5'),'queue'),'allowNull':![],'defaultValue':_0xada7('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js
index a6b04e2..7d7d42e 100644
--- a/server/api/mailTransferReport/mailTransferReport.controller.js
+++ b/server/api/mailTransferReport/mailTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa95d=['filter','merge','VIRTUAL','count','include','findAll','rows','show','includeAll','options','create','body','catch','update','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','reject','save','then','error','stack','send','MailTransferReport','rawAttributes','fieldName','type','key','map','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x8ce99,_0xe40fa0){var _0x186ca7=function(_0xa277bc){while(--_0xa277bc){_0x8ce99['push'](_0x8ce99['shift']());}};_0x186ca7(++_0xe40fa0);}(_0xa95d,0x12e));var _0xda95=function(_0x163807,_0x558cfa){_0x163807=_0x163807-0x0;var _0x535b97=_0xa95d[_0x163807];return _0x535b97;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xda95('0x0'));var zipdir=require(_0xda95('0x1'));var jsonpatch=require(_0xda95('0x2'));var rp=require('request-promise');var moment=require(_0xda95('0x3'));var BPromise=require(_0xda95('0x4'));var Mustache=require(_0xda95('0x5'));var util=require('util');var path=require(_0xda95('0x6'));var sox=require(_0xda95('0x7'));var csv=require(_0xda95('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xda95('0x9'));var squel=require(_0xda95('0xa'));var crypto=require(_0xda95('0xb'));var jsforce=require(_0xda95('0xc'));var deskjs=require(_0xda95('0xd'));var toCsv=require(_0xda95('0x8'));var querystring=require(_0xda95('0xe'));var Papa=require(_0xda95('0xf'));var Redis=require(_0xda95('0x10'));var authService=require(_0xda95('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda95('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xda95('0x13'));var config=require('../../config/environment');var db=require(_0xda95('0x14'))['db'];function respondWithStatusCode(_0x226c7f,_0x2161c5){_0x2161c5=_0x2161c5||0xcc;return function(_0x3f1706){if(_0x3f1706){return _0x226c7f[_0xda95('0x15')](_0x2161c5);}return _0x226c7f[_0xda95('0x16')](_0x2161c5)[_0xda95('0x17')]();};}function respondWithResult(_0x4af5dc,_0x25f794){_0x25f794=_0x25f794||0xc8;return function(_0x544990){if(_0x544990){return _0x4af5dc[_0xda95('0x16')](_0x25f794)[_0xda95('0x18')](_0x544990);}};}function respondWithFilteredResult(_0x35d3dc,_0x269ace){return function(_0x4aaa9e){if(_0x4aaa9e){var _0xdd0a7c=_0x4aaa9e['count'],_0x4bdf78=_0x269ace[_0xda95('0x19')],_0x4bf97f=_0x269ace[_0xda95('0x19')]+_0x269ace[_0xda95('0x1a')],_0x261719;if(_0x4bf97f>=_0xdd0a7c){_0x4bf97f=_0xdd0a7c;_0x261719=0xc8;}else{_0x261719=0xce;}_0x35d3dc[_0xda95('0x16')](_0x261719);return _0x35d3dc[_0xda95('0x1b')]('Content-Range',_0x4bdf78+'-'+_0x4bf97f+'/'+_0xdd0a7c)[_0xda95('0x18')](_0x4aaa9e);}return null;};}function patchUpdates(_0x5373a2){return function(_0x33af6f){try{jsonpatch['apply'](_0x33af6f,_0x5373a2,!![]);}catch(_0x2506af){return BPromise[_0xda95('0x1c')](_0x2506af);}return _0x33af6f[_0xda95('0x1d')]();};}function saveUpdates(_0x40f5bd,_0x1d11c8){return function(_0x17ade6){if(_0x17ade6){return _0x17ade6['update'](_0x40f5bd)[_0xda95('0x1e')](function(_0x3050d8){return _0x3050d8;});}return null;};}function removeEntity(_0x5f2e91,_0x4b15cf){return function(_0x1cf5e0){if(_0x1cf5e0){return _0x1cf5e0['destroy']()[_0xda95('0x1e')](function(){_0x5f2e91[_0xda95('0x16')](0xcc)[_0xda95('0x17')]();});}};}function handleEntityNotFound(_0x57e164,_0x275519){return function(_0x5decee){if(!_0x5decee){_0x57e164[_0xda95('0x15')](0x194);}return _0x5decee;};}function handleError(_0x3ffc12,_0x4fd009){_0x4fd009=_0x4fd009||0x1f4;return function(_0x10ac8f){logger[_0xda95('0x1f')](_0x10ac8f[_0xda95('0x20')]);if(_0x10ac8f['name']){delete _0x10ac8f['name'];}_0x3ffc12[_0xda95('0x16')](_0x4fd009)[_0xda95('0x21')](_0x10ac8f);};}exports['index']=function(_0x24bc17,_0x163132){var _0x272708={},_0x591f30={},_0x1865f1={'count':0x0,'rows':[]};var _0xfe26b3=_['map'](db[_0xda95('0x22')][_0xda95('0x23')],function(_0x1715b6){return{'name':_0x1715b6[_0xda95('0x24')],'type':_0x1715b6[_0xda95('0x25')][_0xda95('0x26')]};});_0x591f30['model']=_[_0xda95('0x27')](_0xfe26b3,_0xda95('0x28'));_0x591f30['query']=_[_0xda95('0x29')](_0x24bc17[_0xda95('0x2a')]);_0x591f30[_0xda95('0x2b')]=_[_0xda95('0x2c')](_0x591f30[_0xda95('0x2d')],_0x591f30['query']);_0x272708[_0xda95('0x2e')]=_[_0xda95('0x2c')](_0x591f30['model'],qs[_0xda95('0x2f')](_0x24bc17[_0xda95('0x2a')]['fields']));_0x272708[_0xda95('0x2e')]=_0x272708[_0xda95('0x2e')][_0xda95('0x30')]?_0x272708[_0xda95('0x2e')]:_0x591f30[_0xda95('0x2d')];if(!_0x24bc17[_0xda95('0x2a')][_0xda95('0x31')](_0xda95('0x32'))){_0x272708[_0xda95('0x1a')]=qs[_0xda95('0x1a')](_0x24bc17[_0xda95('0x2a')][_0xda95('0x1a')]);_0x272708[_0xda95('0x19')]=qs[_0xda95('0x19')](_0x24bc17[_0xda95('0x2a')][_0xda95('0x19')]);}_0x272708['order']=qs[_0xda95('0x33')](_0x24bc17['query']['sort']);_0x272708[_0xda95('0x34')]=qs[_0xda95('0x2b')](_['pick'](_0x24bc17[_0xda95('0x2a')],_0x591f30[_0xda95('0x2b')]),_0xfe26b3);if(_0x24bc17[_0xda95('0x2a')][_0xda95('0x35')]){_0x272708[_0xda95('0x34')]=_[_0xda95('0x36')](_0x272708['where'],{'$or':_['map'](_0xfe26b3,function(_0x93735c){if(_0x93735c[_0xda95('0x25')]!==_0xda95('0x37')){var _0xeef388={};_0xeef388[_0x93735c[_0xda95('0x28')]]={'$like':'%'+_0x24bc17['query']['filter']+'%'};return _0xeef388;}})});}_0x272708=_['merge']({},_0x272708,_0x24bc17['options']);var _0x5d5618={'where':_0x272708[_0xda95('0x34')]};return db[_0xda95('0x22')]['count'](_0x5d5618)[_0xda95('0x1e')](function(_0x49d949){_0x1865f1[_0xda95('0x38')]=_0x49d949;if(_0x24bc17['query']['includeAll']){_0x272708[_0xda95('0x39')]=[{'all':!![]}];}return db[_0xda95('0x22')][_0xda95('0x3a')](_0x272708);})['then'](function(_0x579beb){_0x1865f1[_0xda95('0x3b')]=_0x579beb;return _0x1865f1;})['then'](respondWithFilteredResult(_0x163132,_0x272708))['catch'](handleError(_0x163132,null));};exports[_0xda95('0x3c')]=function(_0x34d93c,_0x865613){var _0x22c1ed={'raw':!![],'where':{'id':_0x34d93c['params']['id']}},_0x3b2bd7={};_0x3b2bd7[_0xda95('0x2d')]=_[_0xda95('0x29')](db[_0xda95('0x22')][_0xda95('0x23')]);_0x3b2bd7[_0xda95('0x2a')]=_[_0xda95('0x29')](_0x34d93c['query']);_0x3b2bd7[_0xda95('0x2b')]=_['intersection'](_0x3b2bd7[_0xda95('0x2d')],_0x3b2bd7[_0xda95('0x2a')]);_0x22c1ed[_0xda95('0x2e')]=_[_0xda95('0x2c')](_0x3b2bd7[_0xda95('0x2d')],qs[_0xda95('0x2f')](_0x34d93c[_0xda95('0x2a')]['fields']));_0x22c1ed[_0xda95('0x2e')]=_0x22c1ed[_0xda95('0x2e')][_0xda95('0x30')]?_0x22c1ed[_0xda95('0x2e')]:_0x3b2bd7[_0xda95('0x2d')];if(_0x34d93c[_0xda95('0x2a')][_0xda95('0x3d')]){_0x22c1ed[_0xda95('0x39')]=[{'all':!![]}];}_0x22c1ed=_['merge']({},_0x22c1ed,_0x34d93c[_0xda95('0x3e')]);return db[_0xda95('0x22')]['find'](_0x22c1ed)[_0xda95('0x1e')](handleEntityNotFound(_0x865613,null))[_0xda95('0x1e')](respondWithResult(_0x865613,null))['catch'](handleError(_0x865613,null));};exports[_0xda95('0x3f')]=function(_0x21c40e,_0x63948b){return db[_0xda95('0x22')][_0xda95('0x3f')](_0x21c40e[_0xda95('0x40')],{})['then'](respondWithResult(_0x63948b,0xc9))[_0xda95('0x41')](handleError(_0x63948b,null));};exports[_0xda95('0x42')]=function(_0xc371b1,_0x4b7a38){if(_0xc371b1[_0xda95('0x40')]['id']){delete _0xc371b1[_0xda95('0x40')]['id'];}return db[_0xda95('0x22')][_0xda95('0x43')]({'where':{'id':_0xc371b1[_0xda95('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b7a38,null))[_0xda95('0x1e')](saveUpdates(_0xc371b1[_0xda95('0x40')],null))['then'](respondWithResult(_0x4b7a38,null))['catch'](handleError(_0x4b7a38,null));};exports[_0xda95('0x45')]=function(_0x33b663,_0x5723d8){return db[_0xda95('0x22')]['find']({'where':{'id':_0x33b663[_0xda95('0x44')]['id']}})['then'](handleEntityNotFound(_0x5723d8,null))['then'](removeEntity(_0x5723d8,null))['catch'](handleError(_0x5723d8,null));};exports[_0xda95('0x46')]=function(_0x25c705,_0x55746e){return db[_0xda95('0x22')][_0xda95('0x46')]()[_0xda95('0x1e')](respondWithResult(_0x55746e,null))['catch'](handleError(_0x55746e,null));};
\ No newline at end of file
+var _0xc315=['then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','MailTransferReport','include','findAll','catch','keys','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply'];(function(_0x3e509f,_0x5a3f17){var _0x42dfa0=function(_0x329762){while(--_0x329762){_0x3e509f['push'](_0x3e509f['shift']());}};_0x42dfa0(++_0x5a3f17);}(_0xc315,0x1ce));var _0x5c31=function(_0x425f5b,_0x1a1d3c){_0x425f5b=_0x425f5b-0x0;var _0x281dbd=_0xc315[_0x425f5b];return _0x281dbd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5c31('0x0'));var rimraf=require(_0x5c31('0x1'));var zipdir=require(_0x5c31('0x2'));var jsonpatch=require(_0x5c31('0x3'));var rp=require(_0x5c31('0x4'));var moment=require(_0x5c31('0x5'));var BPromise=require(_0x5c31('0x6'));var Mustache=require(_0x5c31('0x7'));var util=require(_0x5c31('0x8'));var path=require('path');var sox=require(_0x5c31('0x9'));var csv=require(_0x5c31('0xa'));var ejs=require(_0x5c31('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5c31('0xc'));var crypto=require(_0x5c31('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5c31('0xe'));var toCsv=require(_0x5c31('0xa'));var querystring=require('querystring');var Papa=require(_0x5c31('0xf'));var Redis=require(_0x5c31('0x10'));var authService=require(_0x5c31('0x11'));var qs=require(_0x5c31('0x12'));var as=require(_0x5c31('0x13'));var hardwareService=require(_0x5c31('0x14'));var logger=require(_0x5c31('0x15'))(_0x5c31('0x16'));var utils=require(_0x5c31('0x17'));var config=require(_0x5c31('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x423f82,_0x473c85){_0x473c85=_0x473c85||0xcc;return function(_0x3d3c5b){if(_0x3d3c5b){return _0x423f82[_0x5c31('0x19')](_0x473c85);}return _0x423f82['status'](_0x473c85)[_0x5c31('0x1a')]();};}function respondWithResult(_0x3a1f1e,_0x169cf5){_0x169cf5=_0x169cf5||0xc8;return function(_0x15ae3f){if(_0x15ae3f){return _0x3a1f1e[_0x5c31('0x1b')](_0x169cf5)[_0x5c31('0x1c')](_0x15ae3f);}};}function respondWithFilteredResult(_0x146c4c,_0x27d2a7){return function(_0x4d094f){if(_0x4d094f){var _0x179db5=_0x4d094f[_0x5c31('0x1d')],_0x57a843=_0x27d2a7[_0x5c31('0x1e')],_0x2d27da=_0x27d2a7[_0x5c31('0x1e')]+_0x27d2a7[_0x5c31('0x1f')],_0x1a0498;if(_0x2d27da>=_0x179db5){_0x2d27da=_0x179db5;_0x1a0498=0xc8;}else{_0x1a0498=0xce;}_0x146c4c[_0x5c31('0x1b')](_0x1a0498);return _0x146c4c[_0x5c31('0x20')](_0x5c31('0x21'),_0x57a843+'-'+_0x2d27da+'/'+_0x179db5)[_0x5c31('0x1c')](_0x4d094f);}return null;};}function patchUpdates(_0x3ac13e){return function(_0x562d3f){try{jsonpatch[_0x5c31('0x22')](_0x562d3f,_0x3ac13e,!![]);}catch(_0x278349){return BPromise['reject'](_0x278349);}return _0x562d3f['save']();};}function saveUpdates(_0xd69a7e,_0x2fbc4a){return function(_0x1ca033){if(_0x1ca033){return _0x1ca033['update'](_0xd69a7e)[_0x5c31('0x23')](function(_0x3779fe){return _0x3779fe;});}return null;};}function removeEntity(_0xfda9c4,_0x5218a8){return function(_0x453eab){if(_0x453eab){return _0x453eab[_0x5c31('0x24')]()[_0x5c31('0x23')](function(){_0xfda9c4[_0x5c31('0x1b')](0xcc)[_0x5c31('0x1a')]();});}};}function handleEntityNotFound(_0x32e850,_0x44dee4){return function(_0x497fc6){if(!_0x497fc6){_0x32e850[_0x5c31('0x19')](0x194);}return _0x497fc6;};}function handleError(_0x6a93f2,_0x28f5a2){_0x28f5a2=_0x28f5a2||0x1f4;return function(_0x2a2175){logger[_0x5c31('0x25')](_0x2a2175[_0x5c31('0x26')]);if(_0x2a2175[_0x5c31('0x27')]){delete _0x2a2175[_0x5c31('0x27')];}_0x6a93f2[_0x5c31('0x1b')](_0x28f5a2)[_0x5c31('0x28')](_0x2a2175);};}exports[_0x5c31('0x29')]=function(_0x328772,_0x60a8c5){var _0x41f833={},_0x37a19b={},_0x5839c5={'count':0x0,'rows':[]};var _0x15ec85=_[_0x5c31('0x2a')](db['MailTransferReport']['rawAttributes'],function(_0x245fbe){return{'name':_0x245fbe[_0x5c31('0x2b')],'type':_0x245fbe[_0x5c31('0x2c')][_0x5c31('0x2d')]};});_0x37a19b[_0x5c31('0x2e')]=_[_0x5c31('0x2a')](_0x15ec85,_0x5c31('0x27'));_0x37a19b[_0x5c31('0x2f')]=_['keys'](_0x328772['query']);_0x37a19b[_0x5c31('0x30')]=_[_0x5c31('0x31')](_0x37a19b[_0x5c31('0x2e')],_0x37a19b['query']);_0x41f833[_0x5c31('0x32')]=_['intersection'](_0x37a19b[_0x5c31('0x2e')],qs['fields'](_0x328772[_0x5c31('0x2f')][_0x5c31('0x33')]));_0x41f833['attributes']=_0x41f833[_0x5c31('0x32')]['length']?_0x41f833[_0x5c31('0x32')]:_0x37a19b['model'];if(!_0x328772[_0x5c31('0x2f')][_0x5c31('0x34')]('nolimit')){_0x41f833[_0x5c31('0x1f')]=qs[_0x5c31('0x1f')](_0x328772['query'][_0x5c31('0x1f')]);_0x41f833[_0x5c31('0x1e')]=qs[_0x5c31('0x1e')](_0x328772[_0x5c31('0x2f')][_0x5c31('0x1e')]);}_0x41f833[_0x5c31('0x35')]=qs[_0x5c31('0x36')](_0x328772[_0x5c31('0x2f')]['sort']);_0x41f833[_0x5c31('0x37')]=qs[_0x5c31('0x30')](_[_0x5c31('0x38')](_0x328772['query'],_0x37a19b[_0x5c31('0x30')]),_0x15ec85);if(_0x328772[_0x5c31('0x2f')][_0x5c31('0x39')]){_0x41f833['where']=_[_0x5c31('0x3a')](_0x41f833[_0x5c31('0x37')],{'$or':_['map'](_0x15ec85,function(_0x3c6724){if(_0x3c6724[_0x5c31('0x2c')]!=='VIRTUAL'){var _0x2f8d9e={};_0x2f8d9e[_0x3c6724['name']]={'$like':'%'+_0x328772[_0x5c31('0x2f')]['filter']+'%'};return _0x2f8d9e;}})});}_0x41f833=_[_0x5c31('0x3a')]({},_0x41f833,_0x328772[_0x5c31('0x3b')]);var _0x1fae19={'where':_0x41f833['where']};return db[_0x5c31('0x3c')][_0x5c31('0x1d')](_0x1fae19)[_0x5c31('0x23')](function(_0x2de526){_0x5839c5[_0x5c31('0x1d')]=_0x2de526;if(_0x328772['query']['includeAll']){_0x41f833[_0x5c31('0x3d')]=[{'all':!![]}];}return db[_0x5c31('0x3c')][_0x5c31('0x3e')](_0x41f833);})[_0x5c31('0x23')](function(_0x6abd9a){_0x5839c5['rows']=_0x6abd9a;return _0x5839c5;})['then'](respondWithFilteredResult(_0x60a8c5,_0x41f833))[_0x5c31('0x3f')](handleError(_0x60a8c5,null));};exports['show']=function(_0x1a447e,_0x3a4b43){var _0x22b113={'raw':!![],'where':{'id':_0x1a447e['params']['id']}},_0x436b33={};_0x436b33['model']=_['keys'](db[_0x5c31('0x3c')]['rawAttributes']);_0x436b33[_0x5c31('0x2f')]=_[_0x5c31('0x40')](_0x1a447e[_0x5c31('0x2f')]);_0x436b33[_0x5c31('0x30')]=_['intersection'](_0x436b33[_0x5c31('0x2e')],_0x436b33[_0x5c31('0x2f')]);_0x22b113[_0x5c31('0x32')]=_[_0x5c31('0x31')](_0x436b33['model'],qs[_0x5c31('0x33')](_0x1a447e[_0x5c31('0x2f')][_0x5c31('0x33')]));_0x22b113['attributes']=_0x22b113['attributes'][_0x5c31('0x41')]?_0x22b113['attributes']:_0x436b33[_0x5c31('0x2e')];if(_0x1a447e[_0x5c31('0x2f')][_0x5c31('0x42')]){_0x22b113[_0x5c31('0x3d')]=[{'all':!![]}];}_0x22b113=_[_0x5c31('0x3a')]({},_0x22b113,_0x1a447e[_0x5c31('0x3b')]);return db['MailTransferReport']['find'](_0x22b113)[_0x5c31('0x23')](handleEntityNotFound(_0x3a4b43,null))[_0x5c31('0x23')](respondWithResult(_0x3a4b43,null))[_0x5c31('0x3f')](handleError(_0x3a4b43,null));};exports[_0x5c31('0x43')]=function(_0x5a2bfc,_0x19f1ee){return db[_0x5c31('0x3c')][_0x5c31('0x43')](_0x5a2bfc[_0x5c31('0x44')],{})['then'](respondWithResult(_0x19f1ee,0xc9))[_0x5c31('0x3f')](handleError(_0x19f1ee,null));};exports['update']=function(_0x3504ec,_0x22fbff){if(_0x3504ec[_0x5c31('0x44')]['id']){delete _0x3504ec[_0x5c31('0x44')]['id'];}return db[_0x5c31('0x3c')][_0x5c31('0x45')]({'where':{'id':_0x3504ec['params']['id']}})['then'](handleEntityNotFound(_0x22fbff,null))['then'](saveUpdates(_0x3504ec[_0x5c31('0x44')],null))[_0x5c31('0x23')](respondWithResult(_0x22fbff,null))[_0x5c31('0x3f')](handleError(_0x22fbff,null));};exports[_0x5c31('0x24')]=function(_0x3d66b1,_0x33f551){return db[_0x5c31('0x3c')][_0x5c31('0x45')]({'where':{'id':_0x3d66b1['params']['id']}})[_0x5c31('0x23')](handleEntityNotFound(_0x33f551,null))[_0x5c31('0x23')](removeEntity(_0x33f551,null))[_0x5c31('0x3f')](handleError(_0x33f551,null));};exports[_0x5c31('0x46')]=function(_0x45eaac,_0x445bdd){return db['MailTransferReport'][_0x5c31('0x46')]()[_0x5c31('0x23')](respondWithResult(_0x445bdd,null))[_0x5c31('0x3f')](handleError(_0x445bdd,null));};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js
index 6c87bd2..4d9b4cd 100644
--- a/server/api/mailTransferReport/mailTransferReport.model.js
+++ b/server/api/mailTransferReport/mailTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce94=['bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x407a0d,_0x27b5e7){var _0x8b822b=function(_0x215550){while(--_0x215550){_0x407a0d['push'](_0x407a0d['shift']());}};_0x8b822b(++_0x27b5e7);}(_0xce94,0x19f));var _0x4ce9=function(_0x33902d,_0xa9b9d){_0x33902d=_0x33902d-0x0;var _0x14121e=_0xce94[_0x33902d];return _0x14121e;};'use strict';var _=require(_0x4ce9('0x0'));var util=require(_0x4ce9('0x1'));var logger=require(_0x4ce9('0x2'))(_0x4ce9('0x3'));var moment=require(_0x4ce9('0x4'));var BPromise=require(_0x4ce9('0x5'));var rp=require(_0x4ce9('0x6'));var fs=require('fs');var path=require(_0x4ce9('0x7'));var rimraf=require(_0x4ce9('0x8'));var config=require(_0x4ce9('0x9'));var attributes=require(_0x4ce9('0xa'));module['exports']=function(_0x3aa6eb,_0x5515c9){return _0x3aa6eb['define']('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x4ce9('0xb'),'fields':[_0x4ce9('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7397=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7397,0x143));var _0x7739=function(_0x5d07da,_0x3ffc5c){_0x5d07da=_0x5d07da-0x0;var _0x484bbd=_0x7397[_0x5d07da];return _0x484bbd;};'use strict';var _=require(_0x7739('0x0'));var util=require(_0x7739('0x1'));var logger=require(_0x7739('0x2'))(_0x7739('0x3'));var moment=require(_0x7739('0x4'));var BPromise=require(_0x7739('0x5'));var rp=require(_0x7739('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7739('0x7'));var config=require(_0x7739('0x8'));var attributes=require(_0x7739('0x9'));module[_0x7739('0xa')]=function(_0x2edb8c,_0x2dd4d7){return _0x2edb8c[_0x7739('0xb')](_0x7739('0xc'),attributes,{'tableName':_0x7739('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7739('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js
index 9d32f22..f890730 100644
--- a/server/api/mailTransferReport/mailTransferReport.rpc.js
+++ b/server/api/mailTransferReport/mailTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5d41=['code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x5d41,0xf4));var _0x15d4=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x5d41[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x15d4('0x0'));var util=require(_0x15d4('0x1'));var moment=require(_0x15d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x15d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15d4('0x4'))['db'];var utils=require(_0x15d4('0x5'));var logger=require(_0x15d4('0x6'))(_0x15d4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x15d4('0x8')][_0x15d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3faafc,_0x111aa1,_0x4166c2){return new BPromise(function(_0x1f806d,_0xc22083){return client['request'](_0x3faafc,_0x4166c2)['then'](function(_0x8ae96b){logger['info'](_0x15d4('0xa'),_0x111aa1,_0x15d4('0xb'));logger[_0x15d4('0xc')](_0x15d4('0xd'),_0x111aa1,'request\x20sent',JSON[_0x15d4('0xe')](_0x8ae96b));if(_0x8ae96b[_0x15d4('0xf')]){if(_0x8ae96b[_0x15d4('0xf')][_0x15d4('0x10')]===0x1f4){logger['error'](_0x15d4('0xa'),_0x111aa1,_0x8ae96b['error']['message']);return _0xc22083(_0x8ae96b[_0x15d4('0xf')][_0x15d4('0x11')]);}logger[_0x15d4('0xf')](_0x15d4('0xa'),_0x111aa1,_0x8ae96b[_0x15d4('0xf')][_0x15d4('0x11')]);return _0x1f806d(_0x8ae96b['error'][_0x15d4('0x11')]);}else{logger['info'](_0x15d4('0xa'),_0x111aa1,_0x15d4('0xb'));_0x1f806d(_0x8ae96b[_0x15d4('0x12')]['message']);}})[_0x15d4('0x13')](function(_0x39bcec){logger[_0x15d4('0xf')](_0x15d4('0xa'),_0x111aa1,_0x39bcec);_0xc22083(_0x39bcec);});});}
\ No newline at end of file
+var _0xd5fb=['rpc','../../config/environment','jayson/promise','client','http','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3332e8,_0x47f363){var _0x348e70=function(_0x46520c){while(--_0x46520c){_0x3332e8['push'](_0x3332e8['shift']());}};_0x348e70(++_0x47f363);}(_0xd5fb,0x11f));var _0xbd5f=function(_0x54d2fb,_0x31fd9e){_0x54d2fb=_0x54d2fb-0x0;var _0x10cb87=_0xd5fb[_0x54d2fb];return _0x10cb87;};'use strict';var _=require(_0xbd5f('0x0'));var util=require('util');var moment=require(_0xbd5f('0x1'));var BPromise=require(_0xbd5f('0x2'));var rs=require(_0xbd5f('0x3'));var fs=require('fs');var Redis=require(_0xbd5f('0x4'));var db=require(_0xbd5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd5f('0x6'))(_0xbd5f('0x7'));var config=require(_0xbd5f('0x8'));var jayson=require(_0xbd5f('0x9'));var client=jayson[_0xbd5f('0xa')][_0xbd5f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f2474,_0x271bd2,_0x17c57f){return new BPromise(function(_0x10f9ae,_0x2b924c){return client['request'](_0x5f2474,_0x17c57f)['then'](function(_0xece6cf){logger[_0xbd5f('0xc')](_0xbd5f('0xd'),_0x271bd2,_0xbd5f('0xe'));logger['debug'](_0xbd5f('0xf'),_0x271bd2,'request\x20sent',JSON[_0xbd5f('0x10')](_0xece6cf));if(_0xece6cf[_0xbd5f('0x11')]){if(_0xece6cf['error'][_0xbd5f('0x12')]===0x1f4){logger[_0xbd5f('0x11')](_0xbd5f('0xd'),_0x271bd2,_0xece6cf[_0xbd5f('0x11')][_0xbd5f('0x13')]);return _0x2b924c(_0xece6cf['error'][_0xbd5f('0x13')]);}logger[_0xbd5f('0x11')](_0xbd5f('0xd'),_0x271bd2,_0xece6cf[_0xbd5f('0x11')]['message']);return _0x10f9ae(_0xece6cf[_0xbd5f('0x11')]['message']);}else{logger[_0xbd5f('0xc')](_0xbd5f('0xd'),_0x271bd2,_0xbd5f('0xe'));_0x10f9ae(_0xece6cf[_0xbd5f('0x14')][_0xbd5f('0x13')]);}})['catch'](function(_0x463745){logger[_0xbd5f('0x11')](_0xbd5f('0xd'),_0x271bd2,_0x463745);_0x2b924c(_0x463745);});});}
\ No newline at end of file
diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js
index 8adf820..78e5458 100644
--- a/server/api/memberReport/index.js
+++ b/server/api/memberReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe1bc=['create','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x51f629,_0x308fac){var _0x538b08=function(_0x53facf){while(--_0x53facf){_0x51f629['push'](_0x51f629['shift']());}};_0x538b08(++_0x308fac);}(_0xe1bc,0xf4));var _0xce1b=function(_0x14b1cd,_0x4fb930){_0x14b1cd=_0x14b1cd-0x0;var _0x4aaf98=_0xe1bc[_0x14b1cd];return _0x4aaf98;};'use strict';var multer=require('multer');var util=require(_0xce1b('0x0'));var path=require(_0xce1b('0x1'));var timeout=require(_0xce1b('0x2'));var express=require(_0xce1b('0x3'));var router=express[_0xce1b('0x4')]();var auth=require(_0xce1b('0x5'));var interaction=require(_0xce1b('0x6'));var config=require(_0xce1b('0x7'));var controller=require(_0xce1b('0x8'));router[_0xce1b('0x9')]('/',auth[_0xce1b('0xa')](),controller[_0xce1b('0xb')]);router[_0xce1b('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xce1b('0xc')]);router[_0xce1b('0x9')](_0xce1b('0xd'),auth['isAuthenticated'](),controller[_0xce1b('0xe')]);router[_0xce1b('0xf')]('/',auth[_0xce1b('0xa')](),controller[_0xce1b('0x10')]);router[_0xce1b('0x11')](_0xce1b('0xd'),auth[_0xce1b('0xa')](),controller[_0xce1b('0x12')]);router[_0xce1b('0x13')](_0xce1b('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x9ff9=['./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ff9,0x14e));var _0x99ff=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x9ff9[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x99ff('0x0'));var util=require('util');var path=require(_0x99ff('0x1'));var timeout=require(_0x99ff('0x2'));var express=require(_0x99ff('0x3'));var router=express[_0x99ff('0x4')]();var auth=require(_0x99ff('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x99ff('0x6'));router[_0x99ff('0x7')]('/',auth[_0x99ff('0x8')](),controller['index']);router[_0x99ff('0x7')](_0x99ff('0x9'),auth['isAuthenticated'](),controller[_0x99ff('0xa')]);router[_0x99ff('0x7')](_0x99ff('0xb'),auth['isAuthenticated'](),controller[_0x99ff('0xc')]);router[_0x99ff('0xd')]('/',auth[_0x99ff('0x8')](),controller['create']);router['put'](_0x99ff('0xb'),auth[_0x99ff('0x8')](),controller[_0x99ff('0xe')]);router['delete'](_0x99ff('0xb'),auth[_0x99ff('0x8')](),controller[_0x99ff('0xf')]);module[_0x99ff('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js
index 58ba40b..6d03b54 100644
--- a/server/api/memberReport/memberReport.attributes.js
+++ b/server/api/memberReport/memberReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0d=['enterAt','diff','seconds','setDataValue','talk:[start]','talk:[destination]','talk:[dial\x20string]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue'];(function(_0x5691f2,_0x346508){var _0x5a5975=function(_0x494b3a){while(--_0x494b3a){_0x5691f2['push'](_0x5691f2['shift']());}};_0x5a5975(++_0x346508);}(_0x0b0d,0x108));var _0xd0b0=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x0b0d[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0xd0b0('0x0'));var moment=require(_0xd0b0('0x1'));module[_0xd0b0('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd0b0('0x3')]},'interface':{'type':Sequelize[_0xd0b0('0x3')]},'type':{'type':Sequelize[_0xd0b0('0x3')],'defaultValue':_0xd0b0('0x4'),'comment':_0xd0b0('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xd0b0('0x6')]},'exitAt':{'type':Sequelize[_0xd0b0('0x6')],'set':function(_0x20d127){var _0x589c17=moment(_0x20d127);var _0x17a37a=moment(this[_0xd0b0('0x7')](_0xd0b0('0x8')));var _0x215bb2=_0x589c17[_0xd0b0('0x9')](_0x17a37a,_0xd0b0('0xa'));this[_0xd0b0('0xb')]('exitAt',_0x20d127);this[_0xd0b0('0xb')]('duration',_0x215bb2||null);}},'data1':{'type':Sequelize[_0xd0b0('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0xd0b0('0xc')},'data3':{'type':Sequelize[_0xd0b0('0x3')],'comment':_0xd0b0('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0xd0b0('0xe')},'data5':{'type':Sequelize[_0xd0b0('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xd0b0('0x3')]},'internal':{'type':Sequelize[_0xd0b0('0xf')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5c24=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x5c24,0x1c5));var _0x45c2=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x5c24[_0x44d9ab];return _0x31485e;};'use strict';var Sequelize=require(_0x45c2('0x0'));var moment=require(_0x45c2('0x1'));module[_0x45c2('0x2')]={'channel':{'type':Sequelize[_0x45c2('0x3')]},'membername':{'type':Sequelize[_0x45c2('0x3')]},'interface':{'type':Sequelize[_0x45c2('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x45c2('0x4')},'duration':{'type':Sequelize[_0x45c2('0x5')]},'enterAt':{'type':Sequelize[_0x45c2('0x6')]},'exitAt':{'type':Sequelize[_0x45c2('0x6')],'set':function(_0xf741e0){var _0x305ba0=moment(_0xf741e0);var _0x529332=moment(this[_0x45c2('0x7')](_0x45c2('0x8')));var _0x27fff3=_0x305ba0['diff'](_0x529332,_0x45c2('0x9'));this[_0x45c2('0xa')]('exitAt',_0xf741e0);this['setDataValue'](_0x45c2('0xb'),_0x27fff3||null);}},'data1':{'type':Sequelize[_0x45c2('0x3')],'comment':_0x45c2('0xc')},'data2':{'type':Sequelize[_0x45c2('0x3')],'comment':_0x45c2('0xd')},'data3':{'type':Sequelize[_0x45c2('0x3')],'comment':_0x45c2('0xe')},'data4':{'type':Sequelize[_0x45c2('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x45c2('0x3')],'comment':_0x45c2('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x45c2('0x5')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js
index d50c31f..db660b0 100644
--- a/server/api/memberReport/memberReport.controller.js
+++ b/server/api/memberReport/memberReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f8c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5badd5,_0x37bdf1){var _0x326348=function(_0x38f3ba){while(--_0x38f3ba){_0x5badd5['push'](_0x5badd5['shift']());}};_0x326348(++_0x37bdf1);}(_0x7f8c,0xcf));var _0xc7f8=function(_0x5e6860,_0x2f654a){_0x5e6860=_0x5e6860-0x0;var _0x1ca768=_0x7f8c[_0x5e6860];return _0x1ca768;};'use strict';var pdf=require(_0xc7f8('0x0'));var emlformat=require(_0xc7f8('0x1'));var rimraf=require(_0xc7f8('0x2'));var zipdir=require(_0xc7f8('0x3'));var jsonpatch=require(_0xc7f8('0x4'));var rp=require(_0xc7f8('0x5'));var moment=require(_0xc7f8('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc7f8('0x7'));var util=require(_0xc7f8('0x8'));var path=require(_0xc7f8('0x9'));var sox=require(_0xc7f8('0xa'));var csv=require(_0xc7f8('0xb'));var ejs=require(_0xc7f8('0xc'));var fs=require('fs');var _=require(_0xc7f8('0xd'));var squel=require(_0xc7f8('0xe'));var crypto=require(_0xc7f8('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xc7f8('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc7f8('0x11'));var Papa=require('papaparse');var Redis=require(_0xc7f8('0x12'));var authService=require(_0xc7f8('0x13'));var qs=require(_0xc7f8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7f8('0x15'));var logger=require(_0xc7f8('0x16'))(_0xc7f8('0x17'));var utils=require(_0xc7f8('0x18'));var config=require('../../config/environment');var db=require(_0xc7f8('0x19'))['db'];function respondWithStatusCode(_0x5180f,_0x23c73f){_0x23c73f=_0x23c73f||0xcc;return function(_0x381b0d){if(_0x381b0d){return _0x5180f[_0xc7f8('0x1a')](_0x23c73f);}return _0x5180f[_0xc7f8('0x1b')](_0x23c73f)[_0xc7f8('0x1c')]();};}function respondWithResult(_0x4408a3,_0x1afc71){_0x1afc71=_0x1afc71||0xc8;return function(_0x4be462){if(_0x4be462){return _0x4408a3[_0xc7f8('0x1b')](_0x1afc71)['json'](_0x4be462);}};}function respondWithFilteredResult(_0x2c6554,_0x9f193b){return function(_0x207809){if(_0x207809){var _0x3544ed=_0x207809[_0xc7f8('0x1d')],_0x526bb9=_0x9f193b[_0xc7f8('0x1e')],_0x5ae7b6=_0x9f193b[_0xc7f8('0x1e')]+_0x9f193b[_0xc7f8('0x1f')],_0x20d11;if(_0x5ae7b6>=_0x3544ed){_0x5ae7b6=_0x3544ed;_0x20d11=0xc8;}else{_0x20d11=0xce;}_0x2c6554[_0xc7f8('0x1b')](_0x20d11);return _0x2c6554[_0xc7f8('0x20')](_0xc7f8('0x21'),_0x526bb9+'-'+_0x5ae7b6+'/'+_0x3544ed)['json'](_0x207809);}return null;};}function patchUpdates(_0x253777){return function(_0x523242){try{jsonpatch[_0xc7f8('0x22')](_0x523242,_0x253777,!![]);}catch(_0x2d4b4e){return BPromise['reject'](_0x2d4b4e);}return _0x523242['save']();};}function saveUpdates(_0x384420,_0x38f46e){return function(_0x50ad8c){if(_0x50ad8c){return _0x50ad8c[_0xc7f8('0x23')](_0x384420)[_0xc7f8('0x24')](function(_0x19cf71){return _0x19cf71;});}return null;};}function removeEntity(_0x1c57e7,_0x388c47){return function(_0x2e8e5b){if(_0x2e8e5b){return _0x2e8e5b[_0xc7f8('0x25')]()[_0xc7f8('0x24')](function(){_0x1c57e7[_0xc7f8('0x1b')](0xcc)[_0xc7f8('0x1c')]();});}};}function handleEntityNotFound(_0x24c2a0,_0x2e0da3){return function(_0x17acf9){if(!_0x17acf9){_0x24c2a0['sendStatus'](0x194);}return _0x17acf9;};}function handleError(_0x4e2347,_0x1336c3){_0x1336c3=_0x1336c3||0x1f4;return function(_0x487964){logger[_0xc7f8('0x26')](_0x487964[_0xc7f8('0x27')]);if(_0x487964[_0xc7f8('0x28')]){delete _0x487964[_0xc7f8('0x28')];}_0x4e2347[_0xc7f8('0x1b')](_0x1336c3)[_0xc7f8('0x29')](_0x487964);};}exports[_0xc7f8('0x2a')]=function(_0xbbd49d,_0x211c2c){var _0x1b3675={},_0x1a944c={},_0x3f3ad8={'count':0x0,'rows':[]};var _0x243c01=_[_0xc7f8('0x2b')](db[_0xc7f8('0x2c')][_0xc7f8('0x2d')],function(_0xb884aa){return{'name':_0xb884aa[_0xc7f8('0x2e')],'type':_0xb884aa[_0xc7f8('0x2f')][_0xc7f8('0x30')]};});_0x1a944c[_0xc7f8('0x31')]=_[_0xc7f8('0x2b')](_0x243c01,_0xc7f8('0x28'));_0x1a944c[_0xc7f8('0x32')]=_[_0xc7f8('0x33')](_0xbbd49d[_0xc7f8('0x32')]);_0x1a944c[_0xc7f8('0x34')]=_[_0xc7f8('0x35')](_0x1a944c[_0xc7f8('0x31')],_0x1a944c['query']);_0x1b3675[_0xc7f8('0x36')]=_['intersection'](_0x1a944c[_0xc7f8('0x31')],qs[_0xc7f8('0x37')](_0xbbd49d[_0xc7f8('0x32')][_0xc7f8('0x37')]));_0x1b3675['attributes']=_0x1b3675[_0xc7f8('0x36')]['length']?_0x1b3675['attributes']:_0x1a944c[_0xc7f8('0x31')];if(!_0xbbd49d[_0xc7f8('0x32')][_0xc7f8('0x38')](_0xc7f8('0x39'))){_0x1b3675[_0xc7f8('0x1f')]=qs[_0xc7f8('0x1f')](_0xbbd49d[_0xc7f8('0x32')][_0xc7f8('0x1f')]);_0x1b3675[_0xc7f8('0x1e')]=qs[_0xc7f8('0x1e')](_0xbbd49d[_0xc7f8('0x32')][_0xc7f8('0x1e')]);}_0x1b3675[_0xc7f8('0x3a')]=qs['sort'](_0xbbd49d['query'][_0xc7f8('0x3b')]);_0x1b3675['where']=qs[_0xc7f8('0x34')](_['pick'](_0xbbd49d[_0xc7f8('0x32')],_0x1a944c[_0xc7f8('0x34')]),_0x243c01);if(_0xbbd49d[_0xc7f8('0x32')][_0xc7f8('0x3c')]){_0x1b3675[_0xc7f8('0x3d')]=_[_0xc7f8('0x3e')](_0x1b3675[_0xc7f8('0x3d')],{'$or':_[_0xc7f8('0x2b')](_0x243c01,function(_0xf32114){if(_0xf32114[_0xc7f8('0x2f')]!==_0xc7f8('0x3f')){var _0x319428={};_0x319428[_0xf32114[_0xc7f8('0x28')]]={'$like':'%'+_0xbbd49d[_0xc7f8('0x32')][_0xc7f8('0x3c')]+'%'};return _0x319428;}})});}_0x1b3675=_['merge']({},_0x1b3675,_0xbbd49d[_0xc7f8('0x40')]);var _0x5b850e={'where':_0x1b3675['where']};return db[_0xc7f8('0x2c')][_0xc7f8('0x1d')](_0x5b850e)['then'](function(_0x4bcd90){_0x3f3ad8[_0xc7f8('0x1d')]=_0x4bcd90;if(_0xbbd49d[_0xc7f8('0x32')][_0xc7f8('0x41')]){_0x1b3675[_0xc7f8('0x42')]=[{'all':!![]}];}return db['MemberReport'][_0xc7f8('0x43')](_0x1b3675);})[_0xc7f8('0x24')](function(_0x5cd2d0){_0x3f3ad8[_0xc7f8('0x44')]=_0x5cd2d0;return _0x3f3ad8;})['then'](respondWithFilteredResult(_0x211c2c,_0x1b3675))[_0xc7f8('0x45')](handleError(_0x211c2c,null));};exports[_0xc7f8('0x46')]=function(_0x5d297b,_0x14826e){var _0x2a39c0={'raw':!![],'where':{'id':_0x5d297b[_0xc7f8('0x47')]['id']}},_0x28aeb6={};_0x28aeb6[_0xc7f8('0x31')]=_['keys'](db[_0xc7f8('0x2c')][_0xc7f8('0x2d')]);_0x28aeb6[_0xc7f8('0x32')]=_[_0xc7f8('0x33')](_0x5d297b['query']);_0x28aeb6[_0xc7f8('0x34')]=_[_0xc7f8('0x35')](_0x28aeb6[_0xc7f8('0x31')],_0x28aeb6['query']);_0x2a39c0[_0xc7f8('0x36')]=_[_0xc7f8('0x35')](_0x28aeb6[_0xc7f8('0x31')],qs[_0xc7f8('0x37')](_0x5d297b[_0xc7f8('0x32')]['fields']));_0x2a39c0[_0xc7f8('0x36')]=_0x2a39c0[_0xc7f8('0x36')][_0xc7f8('0x48')]?_0x2a39c0[_0xc7f8('0x36')]:_0x28aeb6[_0xc7f8('0x31')];if(_0x5d297b[_0xc7f8('0x32')]['includeAll']){_0x2a39c0['include']=[{'all':!![]}];}_0x2a39c0=_[_0xc7f8('0x3e')]({},_0x2a39c0,_0x5d297b[_0xc7f8('0x40')]);return db['MemberReport']['find'](_0x2a39c0)[_0xc7f8('0x24')](handleEntityNotFound(_0x14826e,null))[_0xc7f8('0x24')](respondWithResult(_0x14826e,null))[_0xc7f8('0x45')](handleError(_0x14826e,null));};exports[_0xc7f8('0x49')]=function(_0x48b0de,_0x11c8df){return db['MemberReport'][_0xc7f8('0x49')](_0x48b0de[_0xc7f8('0x4a')],{})[_0xc7f8('0x24')](respondWithResult(_0x11c8df,0xc9))[_0xc7f8('0x45')](handleError(_0x11c8df,null));};exports[_0xc7f8('0x23')]=function(_0x4399b2,_0x48f9c9){if(_0x4399b2['body']['id']){delete _0x4399b2[_0xc7f8('0x4a')]['id'];}return db[_0xc7f8('0x2c')][_0xc7f8('0x4b')]({'where':{'id':_0x4399b2['params']['id']}})[_0xc7f8('0x24')](handleEntityNotFound(_0x48f9c9,null))[_0xc7f8('0x24')](saveUpdates(_0x4399b2[_0xc7f8('0x4a')],null))[_0xc7f8('0x24')](respondWithResult(_0x48f9c9,null))[_0xc7f8('0x45')](handleError(_0x48f9c9,null));};exports[_0xc7f8('0x25')]=function(_0xa69d4d,_0x3115e7){return db[_0xc7f8('0x2c')][_0xc7f8('0x4b')]({'where':{'id':_0xa69d4d['params']['id']}})[_0xc7f8('0x24')](handleEntityNotFound(_0x3115e7,null))['then'](removeEntity(_0x3115e7,null))[_0xc7f8('0x45')](handleError(_0x3115e7,null));};exports['describe']=function(_0x343c0c,_0x79fa45){return db[_0xc7f8('0x2c')]['describe']()[_0xc7f8('0x24')](respondWithResult(_0x79fa45,null))['catch'](handleError(_0x79fa45,null));};
\ No newline at end of file
+var _0xb819=['filter','where','type','VIRTUAL','merge','options','MemberReport','include','catch','show','params','length','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','pick'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xb819,0x179));var _0x9b81=function(_0x25a0a3,_0x16806e){_0x25a0a3=_0x25a0a3-0x0;var _0x564a70=_0xb819[_0x25a0a3];return _0x564a70;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9b81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b81('0x1'));var jsonpatch=require(_0x9b81('0x2'));var rp=require('request-promise');var moment=require(_0x9b81('0x3'));var BPromise=require(_0x9b81('0x4'));var Mustache=require(_0x9b81('0x5'));var util=require(_0x9b81('0x6'));var path=require(_0x9b81('0x7'));var sox=require(_0x9b81('0x8'));var csv=require(_0x9b81('0x9'));var ejs=require(_0x9b81('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9b81('0xb'));var crypto=require('crypto');var jsforce=require(_0x9b81('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b81('0x9'));var querystring=require(_0x9b81('0xd'));var Papa=require(_0x9b81('0xe'));var Redis=require(_0x9b81('0xf'));var authService=require(_0x9b81('0x10'));var qs=require(_0x9b81('0x11'));var as=require(_0x9b81('0x12'));var hardwareService=require(_0x9b81('0x13'));var logger=require(_0x9b81('0x14'))(_0x9b81('0x15'));var utils=require('../../config/utils');var config=require(_0x9b81('0x16'));var db=require(_0x9b81('0x17'))['db'];function respondWithStatusCode(_0x388d0e,_0x13bd3a){_0x13bd3a=_0x13bd3a||0xcc;return function(_0x124f98){if(_0x124f98){return _0x388d0e[_0x9b81('0x18')](_0x13bd3a);}return _0x388d0e[_0x9b81('0x19')](_0x13bd3a)['end']();};}function respondWithResult(_0x53cdf7,_0x1575fd){_0x1575fd=_0x1575fd||0xc8;return function(_0x35905c){if(_0x35905c){return _0x53cdf7[_0x9b81('0x19')](_0x1575fd)[_0x9b81('0x1a')](_0x35905c);}};}function respondWithFilteredResult(_0x2283f0,_0x1faccb){return function(_0x495555){if(_0x495555){var _0x266a6f=_0x495555[_0x9b81('0x1b')],_0x415899=_0x1faccb[_0x9b81('0x1c')],_0x1079f0=_0x1faccb['offset']+_0x1faccb['limit'],_0x50fb2f;if(_0x1079f0>=_0x266a6f){_0x1079f0=_0x266a6f;_0x50fb2f=0xc8;}else{_0x50fb2f=0xce;}_0x2283f0[_0x9b81('0x19')](_0x50fb2f);return _0x2283f0[_0x9b81('0x1d')](_0x9b81('0x1e'),_0x415899+'-'+_0x1079f0+'/'+_0x266a6f)[_0x9b81('0x1a')](_0x495555);}return null;};}function patchUpdates(_0x5723e9){return function(_0x25b0ca){try{jsonpatch['apply'](_0x25b0ca,_0x5723e9,!![]);}catch(_0x47275a){return BPromise[_0x9b81('0x1f')](_0x47275a);}return _0x25b0ca[_0x9b81('0x20')]();};}function saveUpdates(_0x128c31,_0x43edeb){return function(_0x3fef42){if(_0x3fef42){return _0x3fef42[_0x9b81('0x21')](_0x128c31)[_0x9b81('0x22')](function(_0x3b1b03){return _0x3b1b03;});}return null;};}function removeEntity(_0xbda253,_0x288e55){return function(_0xf1a291){if(_0xf1a291){return _0xf1a291[_0x9b81('0x23')]()['then'](function(){_0xbda253[_0x9b81('0x19')](0xcc)[_0x9b81('0x24')]();});}};}function handleEntityNotFound(_0xfbdc09,_0x424c88){return function(_0x275e30){if(!_0x275e30){_0xfbdc09['sendStatus'](0x194);}return _0x275e30;};}function handleError(_0x2bfb2f,_0x4b52bc){_0x4b52bc=_0x4b52bc||0x1f4;return function(_0x3483b5){logger[_0x9b81('0x25')](_0x3483b5[_0x9b81('0x26')]);if(_0x3483b5[_0x9b81('0x27')]){delete _0x3483b5['name'];}_0x2bfb2f[_0x9b81('0x19')](_0x4b52bc)[_0x9b81('0x28')](_0x3483b5);};}exports['index']=function(_0x3b4dc5,_0x3c388e){var _0x5a6512={},_0x2e7d5f={},_0x5bd9b7={'count':0x0,'rows':[]};var _0x2db619=_[_0x9b81('0x29')](db['MemberReport'][_0x9b81('0x2a')],function(_0x4603a5){return{'name':_0x4603a5['fieldName'],'type':_0x4603a5['type']['key']};});_0x2e7d5f['model']=_[_0x9b81('0x29')](_0x2db619,_0x9b81('0x27'));_0x2e7d5f[_0x9b81('0x2b')]=_[_0x9b81('0x2c')](_0x3b4dc5['query']);_0x2e7d5f[_0x9b81('0x2d')]=_[_0x9b81('0x2e')](_0x2e7d5f[_0x9b81('0x2f')],_0x2e7d5f[_0x9b81('0x2b')]);_0x5a6512[_0x9b81('0x30')]=_['intersection'](_0x2e7d5f[_0x9b81('0x2f')],qs[_0x9b81('0x31')](_0x3b4dc5[_0x9b81('0x2b')][_0x9b81('0x31')]));_0x5a6512['attributes']=_0x5a6512['attributes']['length']?_0x5a6512[_0x9b81('0x30')]:_0x2e7d5f['model'];if(!_0x3b4dc5['query']['hasOwnProperty'](_0x9b81('0x32'))){_0x5a6512[_0x9b81('0x33')]=qs[_0x9b81('0x33')](_0x3b4dc5['query'][_0x9b81('0x33')]);_0x5a6512[_0x9b81('0x1c')]=qs[_0x9b81('0x1c')](_0x3b4dc5[_0x9b81('0x2b')]['offset']);}_0x5a6512[_0x9b81('0x34')]=qs[_0x9b81('0x35')](_0x3b4dc5[_0x9b81('0x2b')][_0x9b81('0x35')]);_0x5a6512['where']=qs[_0x9b81('0x2d')](_[_0x9b81('0x36')](_0x3b4dc5[_0x9b81('0x2b')],_0x2e7d5f['filters']),_0x2db619);if(_0x3b4dc5['query'][_0x9b81('0x37')]){_0x5a6512[_0x9b81('0x38')]=_['merge'](_0x5a6512[_0x9b81('0x38')],{'$or':_[_0x9b81('0x29')](_0x2db619,function(_0x1ace53){if(_0x1ace53[_0x9b81('0x39')]!==_0x9b81('0x3a')){var _0x2ca410={};_0x2ca410[_0x1ace53[_0x9b81('0x27')]]={'$like':'%'+_0x3b4dc5[_0x9b81('0x2b')][_0x9b81('0x37')]+'%'};return _0x2ca410;}})});}_0x5a6512=_[_0x9b81('0x3b')]({},_0x5a6512,_0x3b4dc5[_0x9b81('0x3c')]);var _0x52d97c={'where':_0x5a6512[_0x9b81('0x38')]};return db[_0x9b81('0x3d')][_0x9b81('0x1b')](_0x52d97c)['then'](function(_0x8c9d82){_0x5bd9b7['count']=_0x8c9d82;if(_0x3b4dc5[_0x9b81('0x2b')]['includeAll']){_0x5a6512[_0x9b81('0x3e')]=[{'all':!![]}];}return db[_0x9b81('0x3d')]['findAll'](_0x5a6512);})[_0x9b81('0x22')](function(_0x3bc452){_0x5bd9b7['rows']=_0x3bc452;return _0x5bd9b7;})[_0x9b81('0x22')](respondWithFilteredResult(_0x3c388e,_0x5a6512))[_0x9b81('0x3f')](handleError(_0x3c388e,null));};exports[_0x9b81('0x40')]=function(_0x593f41,_0x9c2386){var _0x3d2151={'raw':!![],'where':{'id':_0x593f41[_0x9b81('0x41')]['id']}},_0x597f65={};_0x597f65[_0x9b81('0x2f')]=_[_0x9b81('0x2c')](db['MemberReport'][_0x9b81('0x2a')]);_0x597f65[_0x9b81('0x2b')]=_[_0x9b81('0x2c')](_0x593f41['query']);_0x597f65[_0x9b81('0x2d')]=_[_0x9b81('0x2e')](_0x597f65[_0x9b81('0x2f')],_0x597f65[_0x9b81('0x2b')]);_0x3d2151[_0x9b81('0x30')]=_[_0x9b81('0x2e')](_0x597f65['model'],qs[_0x9b81('0x31')](_0x593f41[_0x9b81('0x2b')][_0x9b81('0x31')]));_0x3d2151[_0x9b81('0x30')]=_0x3d2151['attributes'][_0x9b81('0x42')]?_0x3d2151['attributes']:_0x597f65[_0x9b81('0x2f')];if(_0x593f41[_0x9b81('0x2b')][_0x9b81('0x43')]){_0x3d2151[_0x9b81('0x3e')]=[{'all':!![]}];}_0x3d2151=_[_0x9b81('0x3b')]({},_0x3d2151,_0x593f41[_0x9b81('0x3c')]);return db[_0x9b81('0x3d')]['find'](_0x3d2151)[_0x9b81('0x22')](handleEntityNotFound(_0x9c2386,null))['then'](respondWithResult(_0x9c2386,null))[_0x9b81('0x3f')](handleError(_0x9c2386,null));};exports[_0x9b81('0x44')]=function(_0x1210ca,_0x17b95f){return db[_0x9b81('0x3d')][_0x9b81('0x44')](_0x1210ca[_0x9b81('0x45')],{})[_0x9b81('0x22')](respondWithResult(_0x17b95f,0xc9))['catch'](handleError(_0x17b95f,null));};exports['update']=function(_0x1956d6,_0x35a7f3){if(_0x1956d6[_0x9b81('0x45')]['id']){delete _0x1956d6['body']['id'];}return db['MemberReport'][_0x9b81('0x46')]({'where':{'id':_0x1956d6[_0x9b81('0x41')]['id']}})[_0x9b81('0x22')](handleEntityNotFound(_0x35a7f3,null))['then'](saveUpdates(_0x1956d6[_0x9b81('0x45')],null))[_0x9b81('0x22')](respondWithResult(_0x35a7f3,null))[_0x9b81('0x3f')](handleError(_0x35a7f3,null));};exports['destroy']=function(_0x490eec,_0x3e282e){return db[_0x9b81('0x3d')]['find']({'where':{'id':_0x490eec[_0x9b81('0x41')]['id']}})[_0x9b81('0x22')](handleEntityNotFound(_0x3e282e,null))['then'](removeEntity(_0x3e282e,null))['catch'](handleError(_0x3e282e,null));};exports[_0x9b81('0x47')]=function(_0x3f4c55,_0x39fc7d){return db['MemberReport']['describe']()[_0x9b81('0x22')](respondWithResult(_0x39fc7d,null))[_0x9b81('0x3f')](handleError(_0x39fc7d,null));};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js
index 61f1cb8..9f39edc 100644
--- a/server/api/memberReport/memberReport.model.js
+++ b/server/api/memberReport/memberReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d9e=['lodash','api','bluebird','path','rimraf','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface'];(function(_0x42bae6,_0x2c98a2){var _0x1cfb87=function(_0x181225){while(--_0x181225){_0x42bae6['push'](_0x42bae6['shift']());}};_0x1cfb87(++_0x2c98a2);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x3f16e9,_0x310346){_0x3f16e9=_0x3f16e9-0x0;var _0x2c27a1=_0x4d9e[_0x3f16e9];return _0x2c27a1;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe4d9('0x1'));var moment=require('moment');var BPromise=require(_0xe4d9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4d9('0x3'));var rimraf=require(_0xe4d9('0x4'));var config=require('../../config/environment');var attributes=require(_0xe4d9('0x5'));module[_0xe4d9('0x6')]=function(_0x278035,_0x34c2a2){return _0x278035[_0xe4d9('0x7')](_0xe4d9('0x8'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xe4d9('0x9'),'fields':[_0xe4d9('0xa'),_0xe4d9('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b67=['path','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4b3714,_0x44276b){var _0x36ba21=function(_0x1dbdf9){while(--_0x1dbdf9){_0x4b3714['push'](_0x4b3714['shift']());}};_0x36ba21(++_0x44276b);}(_0x9b67,0xf6));var _0x79b6=function(_0x4faa30,_0x53fbb8){_0x4faa30=_0x4faa30-0x0;var _0x361633=_0x9b67[_0x4faa30];return _0x361633;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var logger=require(_0x79b6('0x2'))(_0x79b6('0x3'));var moment=require(_0x79b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x79b6('0x5'));var fs=require('fs');var path=require(_0x79b6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79b6('0x7'));module[_0x79b6('0x8')]=function(_0x258103,_0xec367e){return _0x258103[_0x79b6('0x9')](_0x79b6('0xa'),attributes,{'tableName':_0x79b6('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x79b6('0xc'),_0x79b6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js
index d6b98d5..e3bb78c 100644
--- a/server/api/memberReport/memberReport.rpc.js
+++ b/server/api/memberReport/memberReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8032=['include','map','model','debug','create','body','CreateMemberReport','UpdateMemberReport','update','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8032,0x1c1));var _0x2803=function(_0x2f31d0,_0x4fce9a){_0x2f31d0=_0x2f31d0-0x0;var _0x1d0256=_0x8032[_0x2f31d0];return _0x1d0256;};'use strict';var _=require(_0x2803('0x0'));var util=require(_0x2803('0x1'));var moment=require(_0x2803('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2803('0x3'));var db=require(_0x2803('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2803('0x5'))(_0x2803('0x6'));var config=require(_0x2803('0x7'));var jayson=require(_0x2803('0x8'));var client=jayson[_0x2803('0x9')][_0x2803('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x156306,_0x1ecf43,_0x6197bc){return new BPromise(function(_0x47ce3a,_0x3ddda8){return client[_0x2803('0xb')](_0x156306,_0x6197bc)[_0x2803('0xc')](function(_0x1da925){logger[_0x2803('0xd')](_0x2803('0xe'),_0x1ecf43,_0x2803('0xf'));logger['debug'](_0x2803('0x10'),_0x1ecf43,_0x2803('0xf'),JSON[_0x2803('0x11')](_0x1da925));if(_0x1da925[_0x2803('0x12')]){if(_0x1da925[_0x2803('0x12')][_0x2803('0x13')]===0x1f4){logger['error'](_0x2803('0xe'),_0x1ecf43,_0x1da925[_0x2803('0x12')]['message']);return _0x3ddda8(_0x1da925[_0x2803('0x12')][_0x2803('0x14')]);}logger[_0x2803('0x12')]('MemberReport,\x20%s,\x20%s',_0x1ecf43,_0x1da925['error'][_0x2803('0x14')]);return _0x47ce3a(_0x1da925['error'][_0x2803('0x14')]);}else{logger[_0x2803('0xd')]('MemberReport,\x20%s,\x20%s',_0x1ecf43,'request\x20sent');_0x47ce3a(_0x1da925[_0x2803('0x15')][_0x2803('0x14')]);}})[_0x2803('0x16')](function(_0x3b31e2){logger['error'](_0x2803('0xe'),_0x1ecf43,_0x3b31e2);_0x3ddda8(_0x3b31e2);});});}exports[_0x2803('0x17')]=function(_0x5d69d6){var _0x5d67bf=this;return new Promise(function(_0x2089a2,_0xb22a38){return db[_0x2803('0x18')][_0x2803('0x19')]({'raw':_0x5d69d6[_0x2803('0x1a')]?_0x5d69d6['options'][_0x2803('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d69d6[_0x2803('0x1a')]?_0x5d69d6['options'][_0x2803('0x1c')]||null:null,'attributes':_0x5d69d6[_0x2803('0x1a')]?_0x5d69d6[_0x2803('0x1a')][_0x2803('0x1d')]||null:null,'limit':_0x5d69d6['options']?_0x5d69d6[_0x2803('0x1a')][_0x2803('0x1e')]||null:null,'include':_0x5d69d6[_0x2803('0x1a')]?_0x5d69d6[_0x2803('0x1a')][_0x2803('0x1f')]?_[_0x2803('0x20')](_0x5d69d6[_0x2803('0x1a')]['include'],function(_0x6f1731){return{'model':db[_0x6f1731[_0x2803('0x21')]],'as':_0x6f1731['as'],'attributes':_0x6f1731[_0x2803('0x1d')],'include':_0x6f1731[_0x2803('0x1f')]?_[_0x2803('0x20')](_0x6f1731['include'],function(_0x2ecb31){return{'model':db[_0x2ecb31[_0x2803('0x21')]],'as':_0x2ecb31['as'],'attributes':_0x2ecb31[_0x2803('0x1d')],'include':_0x2ecb31[_0x2803('0x1f')]?_[_0x2803('0x20')](_0x2ecb31[_0x2803('0x1f')],function(_0x4d4283){return{'model':db[_0x4d4283[_0x2803('0x21')]],'as':_0x4d4283['as'],'attributes':_0x4d4283[_0x2803('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2803('0xc')](function(_0x3ca001){logger[_0x2803('0xd')](_0x2803('0x17'),_0x5d69d6);logger[_0x2803('0x22')](_0x2803('0x17'),_0x5d69d6,JSON[_0x2803('0x11')](_0x3ca001));_0x2089a2(_0x3ca001);})['catch'](function(_0x24d2c4){logger[_0x2803('0x12')](_0x2803('0x17'),_0x24d2c4[_0x2803('0x14')],_0x5d69d6);_0xb22a38(_0x5d67bf[_0x2803('0x12')](0x1f4,_0x24d2c4['message']));});});};exports['CreateMemberReport']=function(_0x3f8db6){var _0x10843b=this;return new Promise(function(_0x1dfcfa,_0x239d2c){return db[_0x2803('0x18')][_0x2803('0x23')](_0x3f8db6[_0x2803('0x24')],{'raw':_0x3f8db6[_0x2803('0x1a')]?_0x3f8db6[_0x2803('0x1a')][_0x2803('0x1b')]===undefined?!![]:![]:!![]})[_0x2803('0xc')](function(_0x45fb19){logger['info']('CreateMemberReport',_0x3f8db6);logger[_0x2803('0x22')](_0x2803('0x25'),_0x3f8db6,JSON[_0x2803('0x11')](_0x45fb19));_0x1dfcfa(_0x45fb19);})[_0x2803('0x16')](function(_0xb69078){logger[_0x2803('0x12')](_0x2803('0x25'),_0xb69078[_0x2803('0x14')],_0x3f8db6);_0x239d2c(_0x10843b[_0x2803('0x12')](0x1f4,_0xb69078[_0x2803('0x14')]));});});};exports[_0x2803('0x26')]=function(_0x50fa2c){var _0x4a1bc8=this;return new Promise(function(_0x14a6f6,_0x515ba4){return db[_0x2803('0x18')][_0x2803('0x27')](_0x50fa2c[_0x2803('0x24')],{'raw':_0x50fa2c[_0x2803('0x1a')]?_0x50fa2c['options'][_0x2803('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50fa2c['options']?_0x50fa2c[_0x2803('0x1a')]['where']||null:null,'attributes':_0x50fa2c['options']?_0x50fa2c['options'][_0x2803('0x1d')]||null:null,'limit':_0x50fa2c[_0x2803('0x1a')]?_0x50fa2c['options'][_0x2803('0x1e')]||null:null})[_0x2803('0xc')](function(_0xfc1e8c){logger['info']('UpdateMemberReport',_0x50fa2c);logger['debug'](_0x2803('0x26'),_0x50fa2c,JSON[_0x2803('0x11')](_0xfc1e8c));_0x14a6f6(_0xfc1e8c);})['catch'](function(_0x576ea9){logger[_0x2803('0x12')](_0x2803('0x26'),_0x576ea9[_0x2803('0x14')],_0x50fa2c);_0x515ba4(_0x4a1bc8[_0x2803('0x12')](0x1f4,_0x576ea9[_0x2803('0x14')]));});});};
\ No newline at end of file
+var _0x0cde=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetMemberReport','MemberReport','findAll','options','where','map','include','model','attributes','debug','catch','CreateMemberReport','create','body','raw','update','limit','UpdateMemberReport','util','randomstring','ioredis','../../mysqldb'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x0cde,0x1d0));var _0xe0cd=function(_0x3c4152,_0x5ca5ac){_0x3c4152=_0x3c4152-0x0;var _0xd45224=_0x0cde[_0x3c4152];return _0xd45224;};'use strict';var _=require('lodash');var util=require(_0xe0cd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe0cd('0x1'));var fs=require('fs');var Redis=require(_0xe0cd('0x2'));var db=require(_0xe0cd('0x3'))['db'];var utils=require(_0xe0cd('0x4'));var logger=require(_0xe0cd('0x5'))(_0xe0cd('0x6'));var config=require(_0xe0cd('0x7'));var jayson=require(_0xe0cd('0x8'));var client=jayson[_0xe0cd('0x9')][_0xe0cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4965d0,_0x3ce05a,_0xf7a918){return new BPromise(function(_0x4de8c0,_0x5cdc94){return client[_0xe0cd('0xb')](_0x4965d0,_0xf7a918)[_0xe0cd('0xc')](function(_0x38d92c){logger['info'](_0xe0cd('0xd'),_0x3ce05a,_0xe0cd('0xe'));logger['debug'](_0xe0cd('0xf'),_0x3ce05a,_0xe0cd('0xe'),JSON[_0xe0cd('0x10')](_0x38d92c));if(_0x38d92c[_0xe0cd('0x11')]){if(_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x12')]===0x1f4){logger[_0xe0cd('0x11')]('MemberReport,\x20%s,\x20%s',_0x3ce05a,_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x13')]);return _0x5cdc94(_0x38d92c['error'][_0xe0cd('0x13')]);}logger[_0xe0cd('0x11')](_0xe0cd('0xd'),_0x3ce05a,_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x13')]);return _0x4de8c0(_0x38d92c[_0xe0cd('0x11')][_0xe0cd('0x13')]);}else{logger[_0xe0cd('0x14')](_0xe0cd('0xd'),_0x3ce05a,_0xe0cd('0xe'));_0x4de8c0(_0x38d92c['result'][_0xe0cd('0x13')]);}})['catch'](function(_0x52f05f){logger[_0xe0cd('0x11')]('MemberReport,\x20%s,\x20%s',_0x3ce05a,_0x52f05f);_0x5cdc94(_0x52f05f);});});}exports[_0xe0cd('0x15')]=function(_0x49c072){var _0x1be8e5=this;return new Promise(function(_0x2d2576,_0x1e9c9f){return db[_0xe0cd('0x16')][_0xe0cd('0x17')]({'raw':_0x49c072['options']?_0x49c072[_0xe0cd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x49c072[_0xe0cd('0x18')]?_0x49c072[_0xe0cd('0x18')][_0xe0cd('0x19')]||null:null,'attributes':_0x49c072['options']?_0x49c072[_0xe0cd('0x18')]['attributes']||null:null,'limit':_0x49c072[_0xe0cd('0x18')]?_0x49c072[_0xe0cd('0x18')]['limit']||null:null,'include':_0x49c072[_0xe0cd('0x18')]?_0x49c072[_0xe0cd('0x18')]['include']?_[_0xe0cd('0x1a')](_0x49c072[_0xe0cd('0x18')][_0xe0cd('0x1b')],function(_0x1a7618){return{'model':db[_0x1a7618[_0xe0cd('0x1c')]],'as':_0x1a7618['as'],'attributes':_0x1a7618[_0xe0cd('0x1d')],'include':_0x1a7618[_0xe0cd('0x1b')]?_[_0xe0cd('0x1a')](_0x1a7618['include'],function(_0x4684c8){return{'model':db[_0x4684c8['model']],'as':_0x4684c8['as'],'attributes':_0x4684c8[_0xe0cd('0x1d')],'include':_0x4684c8['include']?_[_0xe0cd('0x1a')](_0x4684c8[_0xe0cd('0x1b')],function(_0x20c898){return{'model':db[_0x20c898[_0xe0cd('0x1c')]],'as':_0x20c898['as'],'attributes':_0x20c898[_0xe0cd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf13b59){logger[_0xe0cd('0x14')]('GetMemberReport',_0x49c072);logger[_0xe0cd('0x1e')](_0xe0cd('0x15'),_0x49c072,JSON[_0xe0cd('0x10')](_0xf13b59));_0x2d2576(_0xf13b59);})[_0xe0cd('0x1f')](function(_0x3eca4d){logger[_0xe0cd('0x11')](_0xe0cd('0x15'),_0x3eca4d['message'],_0x49c072);_0x1e9c9f(_0x1be8e5['error'](0x1f4,_0x3eca4d['message']));});});};exports[_0xe0cd('0x20')]=function(_0x39aed9){var _0x5808a8=this;return new Promise(function(_0x5ddb0a,_0xbf41b9){return db['MemberReport'][_0xe0cd('0x21')](_0x39aed9[_0xe0cd('0x22')],{'raw':_0x39aed9[_0xe0cd('0x18')]?_0x39aed9[_0xe0cd('0x18')][_0xe0cd('0x23')]===undefined?!![]:![]:!![]})[_0xe0cd('0xc')](function(_0x16a28f){logger[_0xe0cd('0x14')](_0xe0cd('0x20'),_0x39aed9);logger[_0xe0cd('0x1e')](_0xe0cd('0x20'),_0x39aed9,JSON[_0xe0cd('0x10')](_0x16a28f));_0x5ddb0a(_0x16a28f);})[_0xe0cd('0x1f')](function(_0x101d60){logger[_0xe0cd('0x11')]('CreateMemberReport',_0x101d60[_0xe0cd('0x13')],_0x39aed9);_0xbf41b9(_0x5808a8['error'](0x1f4,_0x101d60[_0xe0cd('0x13')]));});});};exports['UpdateMemberReport']=function(_0x25d2da){var _0x36852f=this;return new Promise(function(_0x54bbf9,_0x45e547){return db[_0xe0cd('0x16')][_0xe0cd('0x24')](_0x25d2da['body'],{'raw':_0x25d2da['options']?_0x25d2da[_0xe0cd('0x18')][_0xe0cd('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25d2da['options']?_0x25d2da[_0xe0cd('0x18')][_0xe0cd('0x19')]||null:null,'attributes':_0x25d2da[_0xe0cd('0x18')]?_0x25d2da[_0xe0cd('0x18')][_0xe0cd('0x1d')]||null:null,'limit':_0x25d2da[_0xe0cd('0x18')]?_0x25d2da[_0xe0cd('0x18')][_0xe0cd('0x25')]||null:null})[_0xe0cd('0xc')](function(_0x47e265){logger[_0xe0cd('0x14')](_0xe0cd('0x26'),_0x25d2da);logger[_0xe0cd('0x1e')](_0xe0cd('0x26'),_0x25d2da,JSON[_0xe0cd('0x10')](_0x47e265));_0x54bbf9(_0x47e265);})[_0xe0cd('0x1f')](function(_0x47a30e){logger[_0xe0cd('0x11')](_0xe0cd('0x26'),_0x47a30e['message'],_0x25d2da);_0x45e547(_0x36852f['error'](0x1f4,_0x47a30e[_0xe0cd('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/migration/index.js b/server/api/migration/index.js
index 5e362e5..2b85ea5 100644
--- a/server/api/migration/index.js
+++ b/server/api/migration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x373d=['Router','../../components/interaction/service','../../config/environment','./migration.controller','exports','multer','path','connect-timeout','express'];(function(_0x3d933d,_0x5d1cd1){var _0x3b0433=function(_0x4fa6c2){while(--_0x4fa6c2){_0x3d933d['push'](_0x3d933d['shift']());}};_0x3b0433(++_0x5d1cd1);}(_0x373d,0x1e2));var _0xd373=function(_0xf93b08,_0x2559d7){_0xf93b08=_0xf93b08-0x0;var _0x12f72e=_0x373d[_0xf93b08];return _0x12f72e;};'use strict';var multer=require(_0xd373('0x0'));var util=require('util');var path=require(_0xd373('0x1'));var timeout=require(_0xd373('0x2'));var express=require(_0xd373('0x3'));var router=express[_0xd373('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd373('0x5'));var config=require(_0xd373('0x6'));var controller=require(_0xd373('0x7'));router['get']('/',controller['index']);module[_0xd373('0x8')]=router;
\ No newline at end of file
+var _0xe605=['index','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x1c1451,_0x4fd4e0){var _0x5575da=function(_0x57ac8a){while(--_0x57ac8a){_0x1c1451['push'](_0x1c1451['shift']());}};_0x5575da(++_0x4fd4e0);}(_0xe605,0x92));var _0x5e60=function(_0x3e6d42,_0x4b02e5){_0x3e6d42=_0x3e6d42-0x0;var _0x3c622e=_0xe605[_0x3e6d42];return _0x3c622e;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var auth=require(_0x5e60('0x5'));var interaction=require(_0x5e60('0x6'));var config=require(_0x5e60('0x7'));var controller=require(_0x5e60('0x8'));router[_0x5e60('0x9')]('/',controller[_0x5e60('0xa')]);module[_0x5e60('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js
index 088bbca..3037633 100644
--- a/server/api/migration/migration.attributes.js
+++ b/server/api/migration/migration.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x81e5=['STRING','version','exports'];(function(_0x1f1359,_0xce4649){var _0x46977e=function(_0x4d6447){while(--_0x4d6447){_0x1f1359['push'](_0x1f1359['shift']());}};_0x46977e(++_0xce4649);}(_0x81e5,0x1a0));var _0x581e=function(_0x495fea,_0x363134){_0x495fea=_0x495fea-0x0;var _0x93773b=_0x81e5[_0x495fea];return _0x93773b;};'use strict';var Sequelize=require('sequelize');module[_0x581e('0x0')]={'version':{'type':Sequelize[_0x581e('0x1')],'unique':_0x581e('0x2')}};
\ No newline at end of file
+var _0x7fd0=['sequelize','exports','STRING'];(function(_0x446706,_0x4f9ba7){var _0x225fb8=function(_0x24a8c3){while(--_0x24a8c3){_0x446706['push'](_0x446706['shift']());}};_0x225fb8(++_0x4f9ba7);}(_0x7fd0,0x144));var _0x07fd=function(_0x23bc99,_0x3d29d7){_0x23bc99=_0x23bc99-0x0;var _0x3904cf=_0x7fd0[_0x23bc99];return _0x3904cf;};'use strict';var Sequelize=require(_0x07fd('0x0'));module[_0x07fd('0x1')]={'version':{'type':Sequelize[_0x07fd('0x2')],'unique':'version'}};
\ No newline at end of file
diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js
index 47ca3f2..e1151b5 100644
--- a/server/api/migration/migration.controller.js
+++ b/server/api/migration/migration.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00bb=['html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','count','offset','Content-Range','apply','update','then','destroy','error','stack','map','Migration','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'use strict';var pdf=require(_0xb00b('0x0'));var emlformat=require(_0xb00b('0x1'));var rimraf=require(_0xb00b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb00b('0x3'));var rp=require('request-promise');var moment=require(_0xb00b('0x4'));var BPromise=require(_0xb00b('0x5'));var Mustache=require('mustache');var util=require(_0xb00b('0x6'));var path=require(_0xb00b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ff792,_0x2d8ddf){_0x2d8ddf=_0x2d8ddf||0xcc;return function(_0x1be8aa){if(_0x1be8aa){return _0x4ff792[_0xb00b('0x14')](_0x2d8ddf);}return _0x4ff792[_0xb00b('0x15')](_0x2d8ddf)[_0xb00b('0x16')]();};}function respondWithResult(_0x4ada81,_0x218de2){_0x218de2=_0x218de2||0xc8;return function(_0xb0d42e){if(_0xb0d42e){return _0x4ada81['status'](_0x218de2)[_0xb00b('0x17')](_0xb0d42e);}};}function respondWithFilteredResult(_0x1084a6,_0x540b79){return function(_0x5da36b){if(_0x5da36b){var _0x9b471e=_0x5da36b[_0xb00b('0x18')],_0x4dcd45=_0x540b79[_0xb00b('0x19')],_0x51d136=_0x540b79[_0xb00b('0x19')]+_0x540b79['limit'],_0x1f9c78;if(_0x51d136>=_0x9b471e){_0x51d136=_0x9b471e;_0x1f9c78=0xc8;}else{_0x1f9c78=0xce;}_0x1084a6[_0xb00b('0x15')](_0x1f9c78);return _0x1084a6['set'](_0xb00b('0x1a'),_0x4dcd45+'-'+_0x51d136+'/'+_0x9b471e)['json'](_0x5da36b);}return null;};}function patchUpdates(_0x25d7a0){return function(_0x5e8d7b){try{jsonpatch[_0xb00b('0x1b')](_0x5e8d7b,_0x25d7a0,!![]);}catch(_0x3355a3){return BPromise['reject'](_0x3355a3);}return _0x5e8d7b['save']();};}function saveUpdates(_0x2b0da1,_0x4a334b){return function(_0x1344c4){if(_0x1344c4){return _0x1344c4[_0xb00b('0x1c')](_0x2b0da1)[_0xb00b('0x1d')](function(_0x3501af){return _0x3501af;});}return null;};}function removeEntity(_0x56c189,_0x362ee0){return function(_0x4df284){if(_0x4df284){return _0x4df284[_0xb00b('0x1e')]()[_0xb00b('0x1d')](function(){_0x56c189['status'](0xcc)[_0xb00b('0x16')]();});}};}function handleEntityNotFound(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(!_0x3ab3cc){_0x2896d1[_0xb00b('0x14')](0x194);}return _0x3ab3cc;};}function handleError(_0x5568bb,_0x44efe5){_0x44efe5=_0x44efe5||0x1f4;return function(_0x243fdb){logger[_0xb00b('0x1f')](_0x243fdb[_0xb00b('0x20')]);if(_0x243fdb['name']){delete _0x243fdb['name'];}_0x5568bb[_0xb00b('0x15')](_0x44efe5)['send'](_0x243fdb);};}exports['index']=function(_0x4a635e,_0x16ac55){var _0x73b6b0={},_0x2592cf={},_0x3825af={'count':0x0,'rows':[]};var _0x1f14fa=_[_0xb00b('0x21')](db[_0xb00b('0x22')]['rawAttributes'],function(_0x22c22d){return{'name':_0x22c22d['fieldName'],'type':_0x22c22d[_0xb00b('0x23')][_0xb00b('0x24')]};});_0x2592cf[_0xb00b('0x25')]=_['map'](_0x1f14fa,_0xb00b('0x26'));_0x2592cf[_0xb00b('0x27')]=_[_0xb00b('0x28')](_0x4a635e[_0xb00b('0x27')]);_0x2592cf[_0xb00b('0x29')]=_[_0xb00b('0x2a')](_0x2592cf[_0xb00b('0x25')],_0x2592cf[_0xb00b('0x27')]);_0x73b6b0[_0xb00b('0x2b')]=_['intersection'](_0x2592cf[_0xb00b('0x25')],qs[_0xb00b('0x2c')](_0x4a635e['query'][_0xb00b('0x2c')]));_0x73b6b0[_0xb00b('0x2b')]=_0x73b6b0['attributes'][_0xb00b('0x2d')]?_0x73b6b0['attributes']:_0x2592cf[_0xb00b('0x25')];if(!_0x4a635e[_0xb00b('0x27')][_0xb00b('0x2e')](_0xb00b('0x2f'))){_0x73b6b0[_0xb00b('0x30')]=qs[_0xb00b('0x30')](_0x4a635e[_0xb00b('0x27')]['limit']);_0x73b6b0['offset']=qs['offset'](_0x4a635e[_0xb00b('0x27')][_0xb00b('0x19')]);}_0x73b6b0[_0xb00b('0x31')]=qs[_0xb00b('0x32')](_0x4a635e['query'][_0xb00b('0x32')]);_0x73b6b0[_0xb00b('0x33')]=qs[_0xb00b('0x29')](_[_0xb00b('0x34')](_0x4a635e[_0xb00b('0x27')],_0x2592cf[_0xb00b('0x29')]),_0x1f14fa);if(_0x4a635e[_0xb00b('0x27')][_0xb00b('0x35')]){_0x73b6b0['where']=_['merge'](_0x73b6b0[_0xb00b('0x33')],{'$or':_['map'](_0x1f14fa,function(_0x1c8258){if(_0x1c8258[_0xb00b('0x23')]!==_0xb00b('0x36')){var _0x45ca74={};_0x45ca74[_0x1c8258[_0xb00b('0x26')]]={'$like':'%'+_0x4a635e[_0xb00b('0x27')][_0xb00b('0x35')]+'%'};return _0x45ca74;}})});}_0x73b6b0=_['merge']({},_0x73b6b0,_0x4a635e[_0xb00b('0x37')]);var _0x25578e={'where':_0x73b6b0[_0xb00b('0x33')]};return db[_0xb00b('0x22')][_0xb00b('0x18')](_0x25578e)[_0xb00b('0x1d')](function(_0x59fb00){_0x3825af[_0xb00b('0x18')]=_0x59fb00;if(_0x4a635e[_0xb00b('0x27')]['includeAll']){_0x73b6b0[_0xb00b('0x38')]=[{'all':!![]}];}return db[_0xb00b('0x22')][_0xb00b('0x39')](_0x73b6b0);})[_0xb00b('0x1d')](function(_0x2954e8){_0x3825af['rows']=_0x2954e8;return _0x3825af;})[_0xb00b('0x1d')](respondWithFilteredResult(_0x16ac55,_0x73b6b0))[_0xb00b('0x3a')](handleError(_0x16ac55,null));};
\ No newline at end of file
+var _0xe706=['type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','Migration','include','findAll','rows','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe706,0xa3));var _0x6e70=function(_0x7f1644,_0x268f86){_0x7f1644=_0x7f1644-0x0;var _0x5518b0=_0xe706[_0x7f1644];return _0x5518b0;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={},_0x3af17f={},_0x83c836={'count':0x0,'rows':[]};var _0x114344=_[_0x6e70('0x2c')](db['Migration'][_0x6e70('0x2d')],function(_0x406f29){return{'name':_0x406f29[_0x6e70('0x2e')],'type':_0x406f29[_0x6e70('0x2f')][_0x6e70('0x30')]};});_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x2c')](_0x114344,_0x6e70('0x29'));_0x3af17f[_0x6e70('0x32')]=_[_0x6e70('0x33')](_0x4a67ac['query']);_0x3af17f[_0x6e70('0x34')]=_['intersection'](_0x3af17f[_0x6e70('0x31')],_0x3af17f['query']);_0x2c4d37[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x3af17f[_0x6e70('0x31')],qs['fields'](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x37')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2c4d37['attributes']:_0x3af17f[_0x6e70('0x31')];if(!_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x39')](_0x6e70('0x3a'))){_0x2c4d37[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x20')]);_0x2c4d37[_0x6e70('0x3b')]=qs[_0x6e70('0x3b')](_0x4a67ac['query'][_0x6e70('0x3b')]);}_0x2c4d37['order']=qs[_0x6e70('0x3c')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3c')]);_0x2c4d37[_0x6e70('0x3d')]=qs[_0x6e70('0x34')](_[_0x6e70('0x3e')](_0x4a67ac[_0x6e70('0x32')],_0x3af17f[_0x6e70('0x34')]),_0x114344);if(_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]){_0x2c4d37[_0x6e70('0x3d')]=_[_0x6e70('0x40')](_0x2c4d37[_0x6e70('0x3d')],{'$or':_['map'](_0x114344,function(_0x5446a2){if(_0x5446a2['type']!==_0x6e70('0x41')){var _0x3841a0={};_0x3841a0[_0x5446a2[_0x6e70('0x29')]]={'$like':'%'+_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]+'%'};return _0x3841a0;}})});}_0x2c4d37=_[_0x6e70('0x40')]({},_0x2c4d37,_0x4a67ac['options']);var _0x3b508c={'where':_0x2c4d37[_0x6e70('0x3d')]};return db[_0x6e70('0x42')][_0x6e70('0x1f')](_0x3b508c)[_0x6e70('0x27')](function(_0x37bf46){_0x83c836[_0x6e70('0x1f')]=_0x37bf46;if(_0x4a67ac[_0x6e70('0x32')]['includeAll']){_0x2c4d37[_0x6e70('0x43')]=[{'all':!![]}];}return db[_0x6e70('0x42')][_0x6e70('0x44')](_0x2c4d37);})[_0x6e70('0x27')](function(_0x201da9){_0x83c836[_0x6e70('0x45')]=_0x201da9;return _0x83c836;})[_0x6e70('0x27')](respondWithFilteredResult(_0x54a5fe,_0x2c4d37))['catch'](handleError(_0x54a5fe,null));};
\ No newline at end of file
diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js
index 2cd4ea8..901a9f7 100644
--- a/server/api/migration/migration.model.js
+++ b/server/api/migration/migration.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1edd=['api','moment','bluebird','path','rimraf','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger'];(function(_0x31ce3d,_0x581047){var _0x203d95=function(_0x9b9243){while(--_0x9b9243){_0x31ce3d['push'](_0x31ce3d['shift']());}};_0x203d95(++_0x581047);}(_0x1edd,0xcd));var _0xd1ed=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x1edd[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0xd1ed('0x0'));var util=require(_0xd1ed('0x1'));var logger=require(_0xd1ed('0x2'))(_0xd1ed('0x3'));var moment=require(_0xd1ed('0x4'));var BPromise=require(_0xd1ed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd1ed('0x6'));var rimraf=require(_0xd1ed('0x7'));var config=require('../../config/environment');var attributes=require(_0xd1ed('0x8'));module[_0xd1ed('0x9')]=function(_0x59458c,_0x58283f){return _0x59458c[_0xd1ed('0xa')](_0xd1ed('0xb'),attributes,{'tableName':_0xd1ed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd549=['../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x5ca0ad,_0x43bc7a){var _0x4d7d25=function(_0x415ff5){while(--_0x415ff5){_0x5ca0ad['push'](_0x5ca0ad['shift']());}};_0x4d7d25(++_0x43bc7a);}(_0xd549,0xde));var _0x9d54=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xd549[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x9d54('0x0'));var util=require('util');var logger=require(_0x9d54('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9d54('0x2'));var rp=require(_0x9d54('0x3'));var fs=require('fs');var path=require(_0x9d54('0x4'));var rimraf=require(_0x9d54('0x5'));var config=require(_0x9d54('0x6'));var attributes=require(_0x9d54('0x7'));module[_0x9d54('0x8')]=function(_0x163b4c,_0x5d2641){return _0x163b4c[_0x9d54('0x9')](_0x9d54('0xa'),attributes,{'tableName':_0x9d54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js
index 80450d0..20c41e9 100644
--- a/server/api/migration/migration.rpc.js
+++ b/server/api/migration/migration.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7d31=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message'];(function(_0x2b63a0,_0x14fc48){var _0x4f0434=function(_0x8cba9e){while(--_0x8cba9e){_0x2b63a0['push'](_0x2b63a0['shift']());}};_0x4f0434(++_0x14fc48);}(_0x7d31,0x1e4));var _0x17d3=function(_0xe1063b,_0x49f6a5){_0xe1063b=_0xe1063b-0x0;var _0x3f79b1=_0x7d31[_0xe1063b];return _0x3f79b1;};'use strict';var _=require(_0x17d3('0x0'));var util=require('util');var moment=require(_0x17d3('0x1'));var BPromise=require(_0x17d3('0x2'));var rs=require(_0x17d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17d3('0x4'))['db'];var utils=require(_0x17d3('0x5'));var logger=require(_0x17d3('0x6'))(_0x17d3('0x7'));var config=require(_0x17d3('0x8'));var jayson=require(_0x17d3('0x9'));var client=jayson[_0x17d3('0xa')][_0x17d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14c515,_0x7e7376,_0x59589f){return new BPromise(function(_0x3d7936,_0x359c2e){return client['request'](_0x14c515,_0x59589f)[_0x17d3('0xc')](function(_0x250c4b){logger[_0x17d3('0xd')]('Migration,\x20%s,\x20%s',_0x7e7376,'request\x20sent');logger[_0x17d3('0xe')](_0x17d3('0xf'),_0x7e7376,_0x17d3('0x10'),JSON[_0x17d3('0x11')](_0x250c4b));if(_0x250c4b[_0x17d3('0x12')]){if(_0x250c4b[_0x17d3('0x12')][_0x17d3('0x13')]===0x1f4){logger[_0x17d3('0x12')](_0x17d3('0x14'),_0x7e7376,_0x250c4b[_0x17d3('0x12')][_0x17d3('0x15')]);return _0x359c2e(_0x250c4b[_0x17d3('0x12')][_0x17d3('0x15')]);}logger[_0x17d3('0x12')]('Migration,\x20%s,\x20%s',_0x7e7376,_0x250c4b[_0x17d3('0x12')]['message']);return _0x3d7936(_0x250c4b['error']['message']);}else{logger[_0x17d3('0xd')]('Migration,\x20%s,\x20%s',_0x7e7376,_0x17d3('0x10'));_0x3d7936(_0x250c4b[_0x17d3('0x16')]['message']);}})['catch'](function(_0x5d7f4e){logger[_0x17d3('0x12')](_0x17d3('0x14'),_0x7e7376,_0x5d7f4e);_0x359c2e(_0x5d7f4e);});});}
\ No newline at end of file
+var _0xe34e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','Migration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x468566,_0x1876e3){var _0x253880=function(_0xe01f65){while(--_0xe01f65){_0x468566['push'](_0x468566['shift']());}};_0x253880(++_0x1876e3);}(_0xe34e,0x132));var _0xee34=function(_0x44b93f,_0x38f81e){_0x44b93f=_0x44b93f-0x0;var _0xeca17e=_0xe34e[_0x44b93f];return _0xeca17e;};'use strict';var _=require(_0xee34('0x0'));var util=require(_0xee34('0x1'));var moment=require('moment');var BPromise=require(_0xee34('0x2'));var rs=require(_0xee34('0x3'));var fs=require('fs');var Redis=require(_0xee34('0x4'));var db=require(_0xee34('0x5'))['db'];var utils=require(_0xee34('0x6'));var logger=require(_0xee34('0x7'))(_0xee34('0x8'));var config=require(_0xee34('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xee34('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45e589,_0x3ed6fa,_0x46d0a9){return new BPromise(function(_0xa4ccdd,_0x1e60a9){return client[_0xee34('0xb')](_0x45e589,_0x46d0a9)[_0xee34('0xc')](function(_0x51738b){logger[_0xee34('0xd')]('Migration,\x20%s,\x20%s',_0x3ed6fa,_0xee34('0xe'));logger[_0xee34('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x3ed6fa,'request\x20sent',JSON[_0xee34('0x10')](_0x51738b));if(_0x51738b[_0xee34('0x11')]){if(_0x51738b[_0xee34('0x11')]['code']===0x1f4){logger[_0xee34('0x11')](_0xee34('0x12'),_0x3ed6fa,_0x51738b[_0xee34('0x11')]['message']);return _0x1e60a9(_0x51738b['error'][_0xee34('0x13')]);}logger[_0xee34('0x11')](_0xee34('0x12'),_0x3ed6fa,_0x51738b['error'][_0xee34('0x13')]);return _0xa4ccdd(_0x51738b['error'][_0xee34('0x13')]);}else{logger[_0xee34('0xd')](_0xee34('0x12'),_0x3ed6fa,'request\x20sent');_0xa4ccdd(_0x51738b[_0xee34('0x14')][_0xee34('0x13')]);}})[_0xee34('0x15')](function(_0x4164ae){logger['error'](_0xee34('0x12'),_0x3ed6fa,_0x4164ae);_0x1e60a9(_0x4164ae);});});}
\ No newline at end of file
diff --git a/server/api/network/index.js b/server/api/network/index.js
index edfd7ba..794511f 100644
--- a/server/api/network/index.js
+++ b/server/api/network/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf1c6=['./network.controller','isAuthenticated','index','get','post','create','/:id','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x52c5ac,_0x38272d){var _0x1b8234=function(_0x21ba42){while(--_0x21ba42){_0x52c5ac['push'](_0x52c5ac['shift']());}};_0x1b8234(++_0x38272d);}(_0xf1c6,0x145));var _0x6f1c=function(_0x2a325e,_0xed2333){_0x2a325e=_0x2a325e-0x0;var _0x3e06af=_0xf1c6[_0x2a325e];return _0x3e06af;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f1c('0x0'));var timeout=require(_0x6f1c('0x1'));var express=require(_0x6f1c('0x2'));var router=express[_0x6f1c('0x3')]();var auth=require(_0x6f1c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f1c('0x5'));router['get']('/',auth[_0x6f1c('0x6')](),controller[_0x6f1c('0x7')]);router[_0x6f1c('0x8')]('/:id',auth[_0x6f1c('0x6')](),controller['show']);router[_0x6f1c('0x9')]('/',auth[_0x6f1c('0x6')](),controller[_0x6f1c('0xa')]);router['put'](_0x6f1c('0xb'),auth['isAuthenticated'](),controller[_0x6f1c('0xc')]);router[_0x6f1c('0xd')]('/:id',auth[_0x6f1c('0x6')](),controller[_0x6f1c('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x9152=['./network.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0xd35f99,_0x2fa0ad){var _0x327805=function(_0x3e37a7){while(--_0x3e37a7){_0xd35f99['push'](_0xd35f99['shift']());}};_0x327805(++_0x2fa0ad);}(_0x9152,0xbf));var _0x2915=function(_0x472b3c,_0xfaa3ea){_0x472b3c=_0x472b3c-0x0;var _0x52a4f9=_0x9152[_0x472b3c];return _0x52a4f9;};'use strict';var multer=require(_0x2915('0x0'));var util=require(_0x2915('0x1'));var path=require(_0x2915('0x2'));var timeout=require(_0x2915('0x3'));var express=require('express');var router=express[_0x2915('0x4')]();var auth=require(_0x2915('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2915('0x6'));var controller=require(_0x2915('0x7'));router[_0x2915('0x8')]('/',auth[_0x2915('0x9')](),controller[_0x2915('0xa')]);router[_0x2915('0x8')](_0x2915('0xb'),auth[_0x2915('0x9')](),controller['show']);router[_0x2915('0xc')]('/',auth[_0x2915('0x9')](),controller['create']);router[_0x2915('0xd')](_0x2915('0xb'),auth[_0x2915('0x9')](),controller[_0x2915('0xe')]);router[_0x2915('0xf')]('/:id',auth[_0x2915('0x9')](),controller[_0x2915('0x10')]);module[_0x2915('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js
index a3bddb2..c20f7f8 100644
--- a/server/api/network/network.attributes.js
+++ b/server/api/network/network.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x36834f,_0x165f02){var _0x19ac8e=function(_0x32b6b7){while(--_0x32b6b7){_0x36834f['push'](_0x36834f['shift']());}};_0x19ac8e(++_0x165f02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}};
\ No newline at end of file
+var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x31a83a,_0x3ea8ad){var _0x1d1d82=function(_0x5c02cc){while(--_0x5c02cc){_0x31a83a['push'](_0x31a83a['shift']());}};_0x1d1d82(++_0x3ea8ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js
index be1b501..7a97602 100644
--- a/server/api/network/network.controller.js
+++ b/server/api/network/network.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb968=['params','intersection','include','find','sequelize','body','type','toUpperCase','STUN','join','utf8','render','Reload','create','res_stun_monitor.so','readFileSync','root','server/files/templates/turn_multiple.ejs','writeFileSync','server/files/templates/network.ejs','format','chan_sip.so','transaction','/etc/asterisk/stun_xcally.conf','TURN','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','server/files/templates/stun_multiple.ejs','toLowerCase','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','Network','rawAttributes','fieldName','key','query','keys','filters','fields','attributes','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show'];(function(_0x3940e4,_0x1aea48){var _0x1c9c03=function(_0x421054){while(--_0x421054){_0x3940e4['push'](_0x3940e4['shift']());}};_0x1c9c03(++_0x1aea48);}(_0xb968,0xe9));var _0x8b96=function(_0x1c75c4,_0x4bef49){_0x1c75c4=_0x1c75c4-0x0;var _0x5b9cdd=_0xb968[_0x1c75c4];return _0x5b9cdd;};'use strict';var pdf=require(_0x8b96('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8b96('0x1'));var zipdir=require(_0x8b96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b96('0x3'));var moment=require('moment');var BPromise=require(_0x8b96('0x4'));var Mustache=require('mustache');var util=require(_0x8b96('0x5'));var path=require(_0x8b96('0x6'));var sox=require(_0x8b96('0x7'));var csv=require(_0x8b96('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8b96('0x9'));var crypto=require(_0x8b96('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8b96('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8b96('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x8b96('0xc'));var as=require(_0x8b96('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b96('0xe'))(_0x8b96('0xf'));var utils=require(_0x8b96('0x10'));var config=require('../../config/environment');var db=require(_0x8b96('0x11'))['db'];var jayson=require(_0x8b96('0x12'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x323574,_0x702437,_0x98d8fd){if(_0x98d8fd){var _0x4a53df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a53df[_0x8b96('0x13')](_0x702437)){return _0x323574;}else{throw new db[(_0x8b96('0x14'))]['ValidationError'](_0x8b96('0x15'));}}else{return _0x323574;}}function respondWithRpcPromise(_0x2726bc,_0x41a183,_0x3e3740,_0x36da29){return new BPromise(function(_0x208a91,_0x59c643){var _0x2a0422=_0x36da29||client;return _0x2a0422['request'](_0x2726bc,_0x3e3740)[_0x8b96('0x16')](function(_0x3e5076){logger[_0x8b96('0x17')](_0x8b96('0x18'),_0x41a183,'request\x20sent');logger[_0x8b96('0x19')](_0x8b96('0x1a'),_0x41a183,_0x8b96('0x1b'),JSON[_0x8b96('0x1c')](_0x3e5076));if(_0x3e5076[_0x8b96('0x1d')]){if(_0x3e5076[_0x8b96('0x1d')]['code']===0x1f4){logger[_0x8b96('0x1d')](_0x8b96('0x18'),_0x41a183,_0x3e5076[_0x8b96('0x1d')][_0x8b96('0x1e')]);return _0x59c643(_0x3e5076['error'][_0x8b96('0x1e')]);}logger[_0x8b96('0x1d')]('Network,\x20%s,\x20%s',_0x41a183,_0x3e5076['error'][_0x8b96('0x1e')]);return _0x208a91(_0x3e5076['error'][_0x8b96('0x1e')]);}else{logger[_0x8b96('0x17')](_0x8b96('0x18'),_0x41a183,_0x8b96('0x1b'));_0x208a91(_0x3e5076[_0x8b96('0x1f')][_0x8b96('0x1e')]);}})[_0x8b96('0x20')](function(_0x230580){logger['error']('Network,\x20%s,\x20%s',_0x41a183,_0x230580);_0x59c643(_0x230580);});});}function respondWithStatusCode(_0x4197a4,_0x4d4265){_0x4d4265=_0x4d4265||0xcc;return function(_0x15bb63){if(_0x15bb63){return _0x4197a4[_0x8b96('0x21')](_0x4d4265);}return _0x4197a4[_0x8b96('0x22')](_0x4d4265)[_0x8b96('0x23')]();};}function respondWithResult(_0x5a9b93,_0x336e02){_0x336e02=_0x336e02||0xc8;return function(_0x36d0fb){if(_0x36d0fb){return _0x5a9b93['status'](_0x336e02)[_0x8b96('0x24')](_0x36d0fb);}};}function respondWithFilteredResult(_0x6ee9b5,_0x5dd82a){return function(_0x12943c){if(_0x12943c){var _0x46dd44=_0x12943c[_0x8b96('0x25')],_0x1e8e83=_0x5dd82a['offset'],_0x28cd10=_0x5dd82a[_0x8b96('0x26')]+_0x5dd82a['limit'],_0x5ba76e;if(_0x28cd10>=_0x46dd44){_0x28cd10=_0x46dd44;_0x5ba76e=0xc8;}else{_0x5ba76e=0xce;}_0x6ee9b5[_0x8b96('0x22')](_0x5ba76e);return _0x6ee9b5['set'](_0x8b96('0x27'),_0x1e8e83+'-'+_0x28cd10+'/'+_0x46dd44)['json'](_0x12943c);}return null;};}function patchUpdates(_0x13bd6f){return function(_0x30b262){try{jsonpatch[_0x8b96('0x28')](_0x30b262,_0x13bd6f,!![]);}catch(_0x4e3cc8){return BPromise[_0x8b96('0x29')](_0x4e3cc8);}return _0x30b262[_0x8b96('0x2a')]();};}function saveUpdates(_0x2c50ad,_0x10b209){return function(_0x48c6f6){if(_0x48c6f6){return _0x48c6f6[_0x8b96('0x2b')](_0x2c50ad)[_0x8b96('0x16')](function(_0x1bf77d){return _0x1bf77d;});}return null;};}function removeEntity(_0x58855c,_0x399b99){return function(_0x15e985){if(_0x15e985){return _0x15e985[_0x8b96('0x2c')]()[_0x8b96('0x16')](function(){_0x58855c[_0x8b96('0x22')](0xcc)[_0x8b96('0x23')]();});}};}function handleEntityNotFound(_0x2996ac,_0x381233){return function(_0x203418){if(!_0x203418){_0x2996ac['sendStatus'](0x194);}return _0x203418;};}function handleError(_0x3d51b7,_0x3866e8){_0x3866e8=_0x3866e8||0x1f4;return function(_0x3781f3){logger[_0x8b96('0x1d')](_0x3781f3[_0x8b96('0x2d')]);if(_0x3781f3[_0x8b96('0x2e')]){delete _0x3781f3[_0x8b96('0x2e')];}_0x3d51b7[_0x8b96('0x22')](_0x3866e8)['send'](_0x3781f3);};}exports[_0x8b96('0x2f')]=function(_0x3679f3,_0x5f16f7){var _0x59f5a2={},_0x3b1ba8={},_0x1649fa={'count':0x0,'rows':[]};var _0x3298a2=_[_0x8b96('0x30')](db[_0x8b96('0x31')][_0x8b96('0x32')],function(_0x261c49){return{'name':_0x261c49[_0x8b96('0x33')],'type':_0x261c49['type'][_0x8b96('0x34')]};});_0x3b1ba8['model']=_['map'](_0x3298a2,_0x8b96('0x2e'));_0x3b1ba8[_0x8b96('0x35')]=_[_0x8b96('0x36')](_0x3679f3[_0x8b96('0x35')]);_0x3b1ba8[_0x8b96('0x37')]=_['intersection'](_0x3b1ba8['model'],_0x3b1ba8['query']);_0x59f5a2['attributes']=_['intersection'](_0x3b1ba8['model'],qs['fields'](_0x3679f3[_0x8b96('0x35')][_0x8b96('0x38')]));_0x59f5a2[_0x8b96('0x39')]=_0x59f5a2[_0x8b96('0x39')]['length']?_0x59f5a2['attributes']:_0x3b1ba8[_0x8b96('0x3a')];if(!_0x3679f3[_0x8b96('0x35')][_0x8b96('0x3b')](_0x8b96('0x3c'))){_0x59f5a2[_0x8b96('0x3d')]=qs[_0x8b96('0x3d')](_0x3679f3[_0x8b96('0x35')][_0x8b96('0x3d')]);_0x59f5a2['offset']=qs['offset'](_0x3679f3[_0x8b96('0x35')][_0x8b96('0x26')]);}_0x59f5a2[_0x8b96('0x3e')]=qs[_0x8b96('0x3f')](_0x3679f3[_0x8b96('0x35')]['sort']);_0x59f5a2[_0x8b96('0x40')]=qs[_0x8b96('0x37')](_[_0x8b96('0x41')](_0x3679f3['query'],_0x3b1ba8[_0x8b96('0x37')]),_0x3298a2);if(_0x3679f3[_0x8b96('0x35')][_0x8b96('0x42')]){_0x59f5a2[_0x8b96('0x40')]=_[_0x8b96('0x43')](_0x59f5a2[_0x8b96('0x40')],{'$or':_[_0x8b96('0x30')](_0x3298a2,function(_0x564968){if(_0x564968['type']!==_0x8b96('0x44')){var _0x3c7436={};_0x3c7436[_0x564968['name']]={'$like':'%'+_0x3679f3[_0x8b96('0x35')][_0x8b96('0x42')]+'%'};return _0x3c7436;}})});}_0x59f5a2=_['merge']({},_0x59f5a2,_0x3679f3['options']);var _0x14716f={'where':_0x59f5a2['where']};return db[_0x8b96('0x31')][_0x8b96('0x25')](_0x14716f)[_0x8b96('0x16')](function(_0x57e597){_0x1649fa[_0x8b96('0x25')]=_0x57e597;if(_0x3679f3['query'][_0x8b96('0x45')]){_0x59f5a2['include']=[{'all':!![]}];}return db['Network'][_0x8b96('0x46')](_0x59f5a2);})[_0x8b96('0x16')](function(_0x1c1ba6){_0x1649fa[_0x8b96('0x47')]=_0x1c1ba6;return _0x1649fa;})['then'](respondWithFilteredResult(_0x5f16f7,_0x59f5a2))[_0x8b96('0x20')](handleError(_0x5f16f7,null));};exports[_0x8b96('0x48')]=function(_0x174aef,_0x4a9eee){var _0x346107={'raw':!![],'where':{'id':_0x174aef[_0x8b96('0x49')]['id']}},_0x5f16ac={};_0x5f16ac[_0x8b96('0x3a')]=_[_0x8b96('0x36')](db[_0x8b96('0x31')][_0x8b96('0x32')]);_0x5f16ac[_0x8b96('0x35')]=_['keys'](_0x174aef[_0x8b96('0x35')]);_0x5f16ac[_0x8b96('0x37')]=_['intersection'](_0x5f16ac[_0x8b96('0x3a')],_0x5f16ac['query']);_0x346107['attributes']=_[_0x8b96('0x4a')](_0x5f16ac[_0x8b96('0x3a')],qs[_0x8b96('0x38')](_0x174aef[_0x8b96('0x35')][_0x8b96('0x38')]));_0x346107['attributes']=_0x346107[_0x8b96('0x39')]['length']?_0x346107[_0x8b96('0x39')]:_0x5f16ac['model'];if(_0x174aef['query'][_0x8b96('0x45')]){_0x346107[_0x8b96('0x4b')]=[{'all':!![]}];}_0x346107=_[_0x8b96('0x43')]({},_0x346107,_0x174aef['options']);return db['Network'][_0x8b96('0x4c')](_0x346107)[_0x8b96('0x16')](handleEntityNotFound(_0x4a9eee,null))[_0x8b96('0x16')](respondWithResult(_0x4a9eee,null))[_0x8b96('0x20')](handleError(_0x4a9eee,null));};exports['create']=function(_0x2a56c2,_0x4ef4b4,_0x559df4){var _0xf0f534;return db[_0x8b96('0x4d')]['transaction'](function(_0x5edd54){return db[_0x8b96('0x31')]['create'](_0x2a56c2[_0x8b96('0x4e')],{'raw':!![]})[_0x8b96('0x16')](function(_0x1585cb){_0xf0f534=_0x1585cb;return db[_0x8b96('0x31')][_0x8b96('0x46')]({'where':{'type':_0x2a56c2[_0x8b96('0x4e')][_0x8b96('0x4f')]},'raw':!![]});})[_0x8b96('0x16')](function(_0x446f9f){if(_0xf0f534[_0x8b96('0x4f')][_0x8b96('0x50')]()==_0x8b96('0x51')){var _0x406e64=fs['readFileSync'](path[_0x8b96('0x52')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x8b96('0x53'));var _0x26e928=ejs[_0x8b96('0x54')](_0x406e64,{'networks':_0x446f9f||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x26e928);return respondWithRpcPromise(_0x8b96('0x55'),_0x8b96('0x56'),{'module':_0x8b96('0x57')});}else if(_0xf0f534['type'][_0x8b96('0x50')]()=='TURN'){var _0x41dab6=fs[_0x8b96('0x58')](path[_0x8b96('0x52')](config[_0x8b96('0x59')],_0x8b96('0x5a')),_0x8b96('0x53'));var _0x2968da=ejs['render'](_0x41dab6,{'networks':_0x446f9f||[]});fs[_0x8b96('0x5b')]('/etc/asterisk/turn_xcally.conf',_0x2968da);return respondWithRpcPromise('Reload',_0x8b96('0x56'),{'module':'res_stun_monitor.so'});}else{var _0x204a8d=fs[_0x8b96('0x58')](path[_0x8b96('0x52')](config[_0x8b96('0x59')],_0x8b96('0x5c')),'utf8');var _0x321f90=ejs['render'](_0x204a8d,{'networks':_0x446f9f||[]});fs[_0x8b96('0x5b')](util[_0x8b96('0x5d')]('/etc/asterisk/sip_xcally_%s.conf',_0x2a56c2[_0x8b96('0x4e')][_0x8b96('0x4f')]['toLowerCase']()),_0x321f90);return respondWithRpcPromise(_0x8b96('0x55'),_0x8b96('0x56'),{'module':_0x8b96('0x5e')});}return null;})[_0x8b96('0x16')](function(){return _0xf0f534;});})[_0x8b96('0x16')](respondWithResult(_0x4ef4b4,0xc9))[_0x8b96('0x20')](handleError(_0x4ef4b4,null));};exports[_0x8b96('0x2b')]=function(_0x3c2ae2,_0x24fa91,_0x5610db){var _0x4bc42e;return db[_0x8b96('0x4d')][_0x8b96('0x5f')](function(_0x190c2e){return db[_0x8b96('0x31')][_0x8b96('0x4c')]({'where':{'id':_0x3c2ae2[_0x8b96('0x49')]['id']}})[_0x8b96('0x16')](handleEntityNotFound(_0x24fa91,null))[_0x8b96('0x16')](saveUpdates(_0x3c2ae2['body'],null))[_0x8b96('0x16')](function(_0x3b62a1){if(_0x3b62a1){_0x4bc42e=_0x3b62a1;return db[_0x8b96('0x31')][_0x8b96('0x46')]({'where':{'type':_0x4bc42e[_0x8b96('0x4f')]},'raw':!![]});}return null;})[_0x8b96('0x16')](function(_0x17f1d5){if(_0x4bc42e[_0x8b96('0x4f')][_0x8b96('0x50')]()==_0x8b96('0x51')){var _0x5cc807=fs['readFileSync'](path[_0x8b96('0x52')](config[_0x8b96('0x59')],'server/files/templates/stun_multiple.ejs'),_0x8b96('0x53'));var _0x53c852=ejs['render'](_0x5cc807,{'networks':_0x17f1d5||[]});fs[_0x8b96('0x5b')](_0x8b96('0x60'),_0x53c852);return respondWithRpcPromise(_0x8b96('0x55'),_0x8b96('0x2b'),{'module':_0x8b96('0x57')});}else if(_0x4bc42e[_0x8b96('0x4f')][_0x8b96('0x50')]()==_0x8b96('0x61')){var _0x366956=fs[_0x8b96('0x58')](path['join'](config[_0x8b96('0x59')],'server/files/templates/turn_multiple.ejs'),_0x8b96('0x53'));var _0x56a12f=ejs[_0x8b96('0x54')](_0x366956,{'networks':_0x17f1d5||[]});fs['writeFileSync'](_0x8b96('0x62'),_0x56a12f);return respondWithRpcPromise(_0x8b96('0x55'),_0x8b96('0x2b'),{'module':_0x8b96('0x57')});}else{var _0x1a7e1e=fs[_0x8b96('0x58')](path[_0x8b96('0x52')](config[_0x8b96('0x59')],_0x8b96('0x5c')),_0x8b96('0x53'));var _0x2a5ab8=ejs[_0x8b96('0x54')](_0x1a7e1e,{'networks':_0x17f1d5||[]});fs['writeFileSync'](util[_0x8b96('0x5d')](_0x8b96('0x63'),_0x3c2ae2[_0x8b96('0x4e')][_0x8b96('0x4f')]['toLowerCase']()),_0x2a5ab8);return respondWithRpcPromise(_0x8b96('0x55'),_0x8b96('0x2b'),{'module':_0x8b96('0x5e')});}return null;})['then'](function(_0x2be839){if(_0x2be839){return _0x4bc42e;}return null;});})[_0x8b96('0x16')](respondWithResult(_0x24fa91,null))[_0x8b96('0x20')](handleError(_0x24fa91,null));};exports[_0x8b96('0x2c')]=function(_0x4d532a,_0x55a6bd,_0x2f759a){var _0x291993;return db[_0x8b96('0x31')][_0x8b96('0x4c')]({'where':{'id':_0x4d532a['params']['id']}})[_0x8b96('0x16')](function(_0x516a60){_0x291993=_0x516a60;return _0x516a60;})[_0x8b96('0x16')](handleEntityNotFound(_0x55a6bd,null))[_0x8b96('0x16')](removeEntity(_0x55a6bd,null))[_0x8b96('0x16')](function(){if(_0x291993){return db['Network']['findAll']({'where':{'type':_0x291993[_0x8b96('0x4f')]},'raw':!![]});}})[_0x8b96('0x16')](function(_0x2d5a39){if(_0x291993[_0x8b96('0x4f')][_0x8b96('0x50')]()==_0x8b96('0x51')){var _0x462fa8=fs[_0x8b96('0x58')](path[_0x8b96('0x52')](config[_0x8b96('0x59')],_0x8b96('0x64')),_0x8b96('0x53'));var _0x126ebd=ejs[_0x8b96('0x54')](_0x462fa8,{'networks':_0x2d5a39||[]});fs['writeFileSync'](_0x8b96('0x60'),_0x126ebd);return respondWithRpcPromise(_0x8b96('0x55'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x291993[_0x8b96('0x4f')][_0x8b96('0x50')]()==_0x8b96('0x61')){var _0x1d61ef=fs['readFileSync'](path[_0x8b96('0x52')](config[_0x8b96('0x59')],_0x8b96('0x5a')),_0x8b96('0x53'));var _0x42f2e9=ejs[_0x8b96('0x54')](_0x1d61ef,{'networks':_0x2d5a39||[]});fs[_0x8b96('0x5b')](_0x8b96('0x62'),_0x42f2e9);return respondWithRpcPromise('Reload',_0x8b96('0x2c'),{'module':_0x8b96('0x57')});}else{var _0x239444=fs[_0x8b96('0x58')](path[_0x8b96('0x52')](config['root'],_0x8b96('0x5c')),_0x8b96('0x53'));var _0x2ebf86=ejs[_0x8b96('0x54')](_0x239444,{'networks':_0x2d5a39||[]});fs[_0x8b96('0x5b')](util[_0x8b96('0x5d')](_0x8b96('0x63'),_0x4d532a[_0x8b96('0x4e')][_0x8b96('0x4f')][_0x8b96('0x65')]()),_0x2ebf86);return respondWithRpcPromise('Reload',_0x8b96('0x2c'),{'module':_0x8b96('0x5e')});}return null;})[_0x8b96('0x20')](handleError(_0x55a6bd,null));};
\ No newline at end of file
+var _0xefe5=['findAll','rows','catch','show','params','keys','find','transaction','create','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','chan_sip.so','sequelize','/etc/asterisk/sip_xcally_%s.conf','destroy','/etc/asterisk/stun_xcally.conf','toLowerCase','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','sendStatus','status','end','offset','limit','set','apply','reject','save','update','name','index','map','Network','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','count','includeAll'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xefe5,0xf6));var _0x5efe=function(_0x25bf0e,_0x4778ac){_0x25bf0e=_0x25bf0e-0x0;var _0x5e7c07=_0xefe5[_0x25bf0e];return _0x5e7c07;};'use strict';var pdf=require(_0x5efe('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5efe('0x1'));var zipdir=require(_0x5efe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5efe('0x3'));var moment=require(_0x5efe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5efe('0x5'));var util=require('util');var path=require(_0x5efe('0x6'));var sox=require(_0x5efe('0x7'));var csv=require(_0x5efe('0x8'));var ejs=require(_0x5efe('0x9'));var fs=require('fs');var _=require(_0x5efe('0xa'));var squel=require('squel');var crypto=require(_0x5efe('0xb'));var jsforce=require(_0x5efe('0xc'));var deskjs=require(_0x5efe('0xd'));var toCsv=require(_0x5efe('0x8'));var querystring=require(_0x5efe('0xe'));var Papa=require(_0x5efe('0xf'));var Redis=require(_0x5efe('0x10'));var authService=require(_0x5efe('0x11'));var qs=require(_0x5efe('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5efe('0x13'));var logger=require(_0x5efe('0x14'))(_0x5efe('0x15'));var utils=require(_0x5efe('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x5efe('0x17')][_0x5efe('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1b99c6,_0x4286b5,_0x313b2f){if(_0x313b2f){var _0x1ba98b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ba98b[_0x5efe('0x19')](_0x4286b5)){return _0x1b99c6;}else{throw new db[(_0x5efe('0x1a'))][(_0x5efe('0x1b'))](_0x5efe('0x1c'));}}else{return _0x1b99c6;}}function respondWithRpcPromise(_0x2af3da,_0x5041a8,_0x28036d,_0xe69cfa){return new BPromise(function(_0x649b61,_0x46644a){var _0x5b49b4=_0xe69cfa||client;return _0x5b49b4[_0x5efe('0x1d')](_0x2af3da,_0x28036d)[_0x5efe('0x1e')](function(_0x502784){logger[_0x5efe('0x1f')](_0x5efe('0x20'),_0x5041a8,'request\x20sent');logger[_0x5efe('0x21')](_0x5efe('0x22'),_0x5041a8,'request\x20sent',JSON['stringify'](_0x502784));if(_0x502784[_0x5efe('0x23')]){if(_0x502784[_0x5efe('0x23')][_0x5efe('0x24')]===0x1f4){logger[_0x5efe('0x23')]('Network,\x20%s,\x20%s',_0x5041a8,_0x502784['error'][_0x5efe('0x25')]);return _0x46644a(_0x502784[_0x5efe('0x23')][_0x5efe('0x25')]);}logger[_0x5efe('0x23')](_0x5efe('0x20'),_0x5041a8,_0x502784['error'][_0x5efe('0x25')]);return _0x649b61(_0x502784['error']['message']);}else{logger[_0x5efe('0x1f')]('Network,\x20%s,\x20%s',_0x5041a8,_0x5efe('0x26'));_0x649b61(_0x502784[_0x5efe('0x27')][_0x5efe('0x25')]);}})['catch'](function(_0xb98343){logger['error'](_0x5efe('0x20'),_0x5041a8,_0xb98343);_0x46644a(_0xb98343);});});}function respondWithStatusCode(_0x1a2754,_0x394344){_0x394344=_0x394344||0xcc;return function(_0x4560fb){if(_0x4560fb){return _0x1a2754[_0x5efe('0x28')](_0x394344);}return _0x1a2754[_0x5efe('0x29')](_0x394344)[_0x5efe('0x2a')]();};}function respondWithResult(_0x42dc9c,_0x4d6f5e){_0x4d6f5e=_0x4d6f5e||0xc8;return function(_0x415d9){if(_0x415d9){return _0x42dc9c[_0x5efe('0x29')](_0x4d6f5e)['json'](_0x415d9);}};}function respondWithFilteredResult(_0x2bb0c1,_0x33fc0a){return function(_0x34f7d2){if(_0x34f7d2){var _0x53ea04=_0x34f7d2['count'],_0x14b530=_0x33fc0a[_0x5efe('0x2b')],_0x4aeac7=_0x33fc0a[_0x5efe('0x2b')]+_0x33fc0a[_0x5efe('0x2c')],_0x23e796;if(_0x4aeac7>=_0x53ea04){_0x4aeac7=_0x53ea04;_0x23e796=0xc8;}else{_0x23e796=0xce;}_0x2bb0c1[_0x5efe('0x29')](_0x23e796);return _0x2bb0c1[_0x5efe('0x2d')]('Content-Range',_0x14b530+'-'+_0x4aeac7+'/'+_0x53ea04)['json'](_0x34f7d2);}return null;};}function patchUpdates(_0x41e113){return function(_0x521b55){try{jsonpatch[_0x5efe('0x2e')](_0x521b55,_0x41e113,!![]);}catch(_0x49826f){return BPromise[_0x5efe('0x2f')](_0x49826f);}return _0x521b55[_0x5efe('0x30')]();};}function saveUpdates(_0x2fe85c,_0x1be8cf){return function(_0x4e5fae){if(_0x4e5fae){return _0x4e5fae[_0x5efe('0x31')](_0x2fe85c)['then'](function(_0x2dd1c7){return _0x2dd1c7;});}return null;};}function removeEntity(_0x5f0690,_0x433e21){return function(_0xc248f2){if(_0xc248f2){return _0xc248f2['destroy']()[_0x5efe('0x1e')](function(){_0x5f0690[_0x5efe('0x29')](0xcc)[_0x5efe('0x2a')]();});}};}function handleEntityNotFound(_0x4ecb43,_0x5b9484){return function(_0x3aea2b){if(!_0x3aea2b){_0x4ecb43[_0x5efe('0x28')](0x194);}return _0x3aea2b;};}function handleError(_0x51082b,_0x91407e){_0x91407e=_0x91407e||0x1f4;return function(_0xf00299){logger[_0x5efe('0x23')](_0xf00299['stack']);if(_0xf00299[_0x5efe('0x32')]){delete _0xf00299[_0x5efe('0x32')];}_0x51082b[_0x5efe('0x29')](_0x91407e)['send'](_0xf00299);};}exports[_0x5efe('0x33')]=function(_0x505a79,_0x4f6204){var _0x29648d={},_0x1d17ef={},_0x4cd895={'count':0x0,'rows':[]};var _0x13fa56=_[_0x5efe('0x34')](db[_0x5efe('0x35')][_0x5efe('0x36')],function(_0x1a6fdb){return{'name':_0x1a6fdb['fieldName'],'type':_0x1a6fdb['type'][_0x5efe('0x37')]};});_0x1d17ef[_0x5efe('0x38')]=_[_0x5efe('0x34')](_0x13fa56,_0x5efe('0x32'));_0x1d17ef[_0x5efe('0x39')]=_['keys'](_0x505a79[_0x5efe('0x39')]);_0x1d17ef['filters']=_[_0x5efe('0x3a')](_0x1d17ef[_0x5efe('0x38')],_0x1d17ef[_0x5efe('0x39')]);_0x29648d[_0x5efe('0x3b')]=_['intersection'](_0x1d17ef[_0x5efe('0x38')],qs[_0x5efe('0x3c')](_0x505a79['query']['fields']));_0x29648d[_0x5efe('0x3b')]=_0x29648d[_0x5efe('0x3b')][_0x5efe('0x3d')]?_0x29648d[_0x5efe('0x3b')]:_0x1d17ef['model'];if(!_0x505a79[_0x5efe('0x39')][_0x5efe('0x3e')](_0x5efe('0x3f'))){_0x29648d[_0x5efe('0x2c')]=qs[_0x5efe('0x2c')](_0x505a79[_0x5efe('0x39')][_0x5efe('0x2c')]);_0x29648d[_0x5efe('0x2b')]=qs[_0x5efe('0x2b')](_0x505a79[_0x5efe('0x39')][_0x5efe('0x2b')]);}_0x29648d[_0x5efe('0x40')]=qs[_0x5efe('0x41')](_0x505a79[_0x5efe('0x39')]['sort']);_0x29648d[_0x5efe('0x42')]=qs['filters'](_['pick'](_0x505a79['query'],_0x1d17ef[_0x5efe('0x43')]),_0x13fa56);if(_0x505a79[_0x5efe('0x39')][_0x5efe('0x44')]){_0x29648d[_0x5efe('0x42')]=_[_0x5efe('0x45')](_0x29648d[_0x5efe('0x42')],{'$or':_['map'](_0x13fa56,function(_0x1f7d04){if(_0x1f7d04[_0x5efe('0x46')]!==_0x5efe('0x47')){var _0x45fa03={};_0x45fa03[_0x1f7d04[_0x5efe('0x32')]]={'$like':'%'+_0x505a79[_0x5efe('0x39')][_0x5efe('0x44')]+'%'};return _0x45fa03;}})});}_0x29648d=_['merge']({},_0x29648d,_0x505a79[_0x5efe('0x48')]);var _0x178935={'where':_0x29648d[_0x5efe('0x42')]};return db[_0x5efe('0x35')][_0x5efe('0x49')](_0x178935)[_0x5efe('0x1e')](function(_0x14b2ea){_0x4cd895[_0x5efe('0x49')]=_0x14b2ea;if(_0x505a79['query'][_0x5efe('0x4a')]){_0x29648d['include']=[{'all':!![]}];}return db['Network'][_0x5efe('0x4b')](_0x29648d);})['then'](function(_0x155819){_0x4cd895[_0x5efe('0x4c')]=_0x155819;return _0x4cd895;})[_0x5efe('0x1e')](respondWithFilteredResult(_0x4f6204,_0x29648d))[_0x5efe('0x4d')](handleError(_0x4f6204,null));};exports[_0x5efe('0x4e')]=function(_0x5670f2,_0x4675bf){var _0x39fdb2={'raw':!![],'where':{'id':_0x5670f2[_0x5efe('0x4f')]['id']}},_0xd721de={};_0xd721de[_0x5efe('0x38')]=_[_0x5efe('0x50')](db['Network'][_0x5efe('0x36')]);_0xd721de[_0x5efe('0x39')]=_[_0x5efe('0x50')](_0x5670f2['query']);_0xd721de[_0x5efe('0x43')]=_[_0x5efe('0x3a')](_0xd721de['model'],_0xd721de[_0x5efe('0x39')]);_0x39fdb2[_0x5efe('0x3b')]=_[_0x5efe('0x3a')](_0xd721de[_0x5efe('0x38')],qs['fields'](_0x5670f2[_0x5efe('0x39')]['fields']));_0x39fdb2[_0x5efe('0x3b')]=_0x39fdb2[_0x5efe('0x3b')][_0x5efe('0x3d')]?_0x39fdb2[_0x5efe('0x3b')]:_0xd721de['model'];if(_0x5670f2[_0x5efe('0x39')]['includeAll']){_0x39fdb2['include']=[{'all':!![]}];}_0x39fdb2=_[_0x5efe('0x45')]({},_0x39fdb2,_0x5670f2[_0x5efe('0x48')]);return db[_0x5efe('0x35')][_0x5efe('0x51')](_0x39fdb2)['then'](handleEntityNotFound(_0x4675bf,null))[_0x5efe('0x1e')](respondWithResult(_0x4675bf,null))[_0x5efe('0x4d')](handleError(_0x4675bf,null));};exports['create']=function(_0x3e3ef2,_0x3f3ae3,_0x1f7de2){var _0x1eeb4f;return db['sequelize'][_0x5efe('0x52')](function(_0x56297a){return db[_0x5efe('0x35')][_0x5efe('0x53')](_0x3e3ef2[_0x5efe('0x54')],{'raw':!![]})[_0x5efe('0x1e')](function(_0x156186){_0x1eeb4f=_0x156186;return db['Network'][_0x5efe('0x4b')]({'where':{'type':_0x3e3ef2['body'][_0x5efe('0x46')]},'raw':!![]});})[_0x5efe('0x1e')](function(_0x31ec5f){if(_0x1eeb4f[_0x5efe('0x46')][_0x5efe('0x55')]()==_0x5efe('0x56')){var _0xcd1ce2=fs[_0x5efe('0x57')](path[_0x5efe('0x58')](config['root'],_0x5efe('0x59')),_0x5efe('0x5a'));var _0x1a490c=ejs['render'](_0xcd1ce2,{'networks':_0x31ec5f||[]});fs[_0x5efe('0x5b')]('/etc/asterisk/stun_xcally.conf',_0x1a490c);return respondWithRpcPromise(_0x5efe('0x5c'),_0x5efe('0x53'),{'module':_0x5efe('0x5d')});}else if(_0x1eeb4f[_0x5efe('0x46')][_0x5efe('0x55')]()==_0x5efe('0x5e')){var _0x227279=fs['readFileSync'](path[_0x5efe('0x58')](config[_0x5efe('0x5f')],_0x5efe('0x60')),_0x5efe('0x5a'));var _0xc2eced=ejs[_0x5efe('0x61')](_0x227279,{'networks':_0x31ec5f||[]});fs[_0x5efe('0x5b')](_0x5efe('0x62'),_0xc2eced);return respondWithRpcPromise('Reload',_0x5efe('0x53'),{'module':_0x5efe('0x5d')});}else{var _0x1f60bd=fs['readFileSync'](path[_0x5efe('0x58')](config[_0x5efe('0x5f')],_0x5efe('0x63')),'utf8');var _0x2f0416=ejs['render'](_0x1f60bd,{'networks':_0x31ec5f||[]});fs[_0x5efe('0x5b')](util[_0x5efe('0x64')]('/etc/asterisk/sip_xcally_%s.conf',_0x3e3ef2[_0x5efe('0x54')]['type']['toLowerCase']()),_0x2f0416);return respondWithRpcPromise(_0x5efe('0x5c'),'create',{'module':_0x5efe('0x65')});}return null;})[_0x5efe('0x1e')](function(){return _0x1eeb4f;});})[_0x5efe('0x1e')](respondWithResult(_0x3f3ae3,0xc9))[_0x5efe('0x4d')](handleError(_0x3f3ae3,null));};exports[_0x5efe('0x31')]=function(_0xcbc6c1,_0x486fea,_0x42e1da){var _0x2d1355;return db[_0x5efe('0x66')]['transaction'](function(_0x290711){return db['Network'][_0x5efe('0x51')]({'where':{'id':_0xcbc6c1['params']['id']}})[_0x5efe('0x1e')](handleEntityNotFound(_0x486fea,null))['then'](saveUpdates(_0xcbc6c1['body'],null))[_0x5efe('0x1e')](function(_0x24a002){if(_0x24a002){_0x2d1355=_0x24a002;return db['Network']['findAll']({'where':{'type':_0x2d1355['type']},'raw':!![]});}return null;})[_0x5efe('0x1e')](function(_0x4d78b8){if(_0x2d1355[_0x5efe('0x46')][_0x5efe('0x55')]()==_0x5efe('0x56')){var _0x3f1c71=fs['readFileSync'](path['join'](config[_0x5efe('0x5f')],'server/files/templates/stun_multiple.ejs'),_0x5efe('0x5a'));var _0x1dfa9d=ejs[_0x5efe('0x61')](_0x3f1c71,{'networks':_0x4d78b8||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1dfa9d);return respondWithRpcPromise(_0x5efe('0x5c'),_0x5efe('0x31'),{'module':_0x5efe('0x5d')});}else if(_0x2d1355[_0x5efe('0x46')][_0x5efe('0x55')]()==_0x5efe('0x5e')){var _0x4115a9=fs[_0x5efe('0x57')](path[_0x5efe('0x58')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x5efe('0x5a'));var _0x5c8588=ejs[_0x5efe('0x61')](_0x4115a9,{'networks':_0x4d78b8||[]});fs[_0x5efe('0x5b')]('/etc/asterisk/turn_xcally.conf',_0x5c8588);return respondWithRpcPromise(_0x5efe('0x5c'),_0x5efe('0x31'),{'module':_0x5efe('0x5d')});}else{var _0x38a573=fs['readFileSync'](path['join'](config[_0x5efe('0x5f')],_0x5efe('0x63')),_0x5efe('0x5a'));var _0x25a483=ejs[_0x5efe('0x61')](_0x38a573,{'networks':_0x4d78b8||[]});fs[_0x5efe('0x5b')](util[_0x5efe('0x64')](_0x5efe('0x67'),_0xcbc6c1[_0x5efe('0x54')][_0x5efe('0x46')]['toLowerCase']()),_0x25a483);return respondWithRpcPromise(_0x5efe('0x5c'),_0x5efe('0x31'),{'module':_0x5efe('0x65')});}return null;})[_0x5efe('0x1e')](function(_0x4ff48d){if(_0x4ff48d){return _0x2d1355;}return null;});})[_0x5efe('0x1e')](respondWithResult(_0x486fea,null))['catch'](handleError(_0x486fea,null));};exports[_0x5efe('0x68')]=function(_0x70b90,_0x41c564,_0x39280b){var _0x3b2d86;return db[_0x5efe('0x35')][_0x5efe('0x51')]({'where':{'id':_0x70b90[_0x5efe('0x4f')]['id']}})[_0x5efe('0x1e')](function(_0x2433b0){_0x3b2d86=_0x2433b0;return _0x2433b0;})[_0x5efe('0x1e')](handleEntityNotFound(_0x41c564,null))[_0x5efe('0x1e')](removeEntity(_0x41c564,null))['then'](function(){if(_0x3b2d86){return db[_0x5efe('0x35')][_0x5efe('0x4b')]({'where':{'type':_0x3b2d86[_0x5efe('0x46')]},'raw':!![]});}})[_0x5efe('0x1e')](function(_0xa3f9e8){if(_0x3b2d86[_0x5efe('0x46')][_0x5efe('0x55')]()==_0x5efe('0x56')){var _0x1ec5b3=fs[_0x5efe('0x57')](path['join'](config[_0x5efe('0x5f')],_0x5efe('0x59')),_0x5efe('0x5a'));var _0x4b4b24=ejs[_0x5efe('0x61')](_0x1ec5b3,{'networks':_0xa3f9e8||[]});fs[_0x5efe('0x5b')](_0x5efe('0x69'),_0x4b4b24);return respondWithRpcPromise(_0x5efe('0x5c'),_0x5efe('0x68'),{'module':'res_stun_monitor.so'});}else if(_0x3b2d86[_0x5efe('0x46')]['toUpperCase']()==_0x5efe('0x5e')){var _0x9c842d=fs[_0x5efe('0x57')](path[_0x5efe('0x58')](config['root'],_0x5efe('0x60')),_0x5efe('0x5a'));var _0x3e72c3=ejs[_0x5efe('0x61')](_0x9c842d,{'networks':_0xa3f9e8||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x3e72c3);return respondWithRpcPromise('Reload',_0x5efe('0x68'),{'module':_0x5efe('0x5d')});}else{var _0x993281=fs[_0x5efe('0x57')](path['join'](config['root'],'server/files/templates/network.ejs'),_0x5efe('0x5a'));var _0x2fc983=ejs[_0x5efe('0x61')](_0x993281,{'networks':_0xa3f9e8||[]});fs['writeFileSync'](util[_0x5efe('0x64')](_0x5efe('0x67'),_0x70b90['body'][_0x5efe('0x46')][_0x5efe('0x6a')]()),_0x2fc983);return respondWithRpcPromise(_0x5efe('0x5c'),_0x5efe('0x68'),{'module':'chan_sip.so'});}return null;})[_0x5efe('0x4d')](handleError(_0x41c564,null));};
\ No newline at end of file
diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js
index 0775152..3e4b3ec 100644
--- a/server/api/network/network.model.js
+++ b/server/api/network/network.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./network.attributes','define','Network','network','lodash'];(function(_0x3551ad,_0x37802f){var _0x4ac4d6=function(_0x4d1a8c){while(--_0x4d1a8c){_0x3551ad['push'](_0x3551ad['shift']());}};_0x4ac4d6(++_0x37802f);}(_0xda55,0x6d));var _0x5da5=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xda55[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./network.attributes','define','Network','network','lodash'];(function(_0xdeb6be,_0x4e54b2){var _0xdd80f4=function(_0x4443d5){while(--_0x4443d5){_0xdeb6be['push'](_0xdeb6be['shift']());}};_0xdd80f4(++_0x4e54b2);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x00bb[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js
index 354704c..dca430a 100644
--- a/server/api/network/network.rpc.js
+++ b/server/api/network/network.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0433=['info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','then'];(function(_0x20f375,_0x366b80){var _0x563d0b=function(_0x4e286b){while(--_0x4e286b){_0x20f375['push'](_0x20f375['shift']());}};_0x563d0b(++_0x366b80);}(_0x0433,0x199));var _0x3043=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x0433[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3043('0x0'));var BPromise=require(_0x3043('0x1'));var rs=require(_0x3043('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3043('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3043('0x4'))(_0x3043('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3043('0x6')][_0x3043('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5b20a6,_0xdcb1c9,_0x545dd){return new BPromise(function(_0x5c009d,_0x285257){return client['request'](_0x5b20a6,_0x545dd)[_0x3043('0x8')](function(_0x45c6dd){logger[_0x3043('0x9')](_0x3043('0xa'),_0xdcb1c9,'request\x20sent');logger[_0x3043('0xb')](_0x3043('0xc'),_0xdcb1c9,'request\x20sent',JSON['stringify'](_0x45c6dd));if(_0x45c6dd['error']){if(_0x45c6dd['error'][_0x3043('0xd')]===0x1f4){logger[_0x3043('0xe')](_0x3043('0xa'),_0xdcb1c9,_0x45c6dd[_0x3043('0xe')][_0x3043('0xf')]);return _0x285257(_0x45c6dd[_0x3043('0xe')][_0x3043('0xf')]);}logger[_0x3043('0xe')](_0x3043('0xa'),_0xdcb1c9,_0x45c6dd[_0x3043('0xe')]['message']);return _0x5c009d(_0x45c6dd['error'][_0x3043('0xf')]);}else{logger[_0x3043('0x9')](_0x3043('0xa'),_0xdcb1c9,_0x3043('0x10'));_0x5c009d(_0x45c6dd[_0x3043('0x11')][_0x3043('0xf')]);}})[_0x3043('0x12')](function(_0x58ca97){logger['error'](_0x3043('0xa'),_0xdcb1c9,_0x58ca97);_0x285257(_0x58ca97);});});}
\ No newline at end of file
+var _0x9d95=['../../config/environment','jayson/promise','client','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x33e200,_0x4d13ab){var _0xc868bb=function(_0x2fd322){while(--_0x2fd322){_0x33e200['push'](_0x33e200['shift']());}};_0xc868bb(++_0x4d13ab);}(_0x9d95,0x1a3));var _0x59d9=function(_0x4f2f02,_0x9ba30f){_0x4f2f02=_0x4f2f02-0x0;var _0x6c0274=_0x9d95[_0x4f2f02];return _0x6c0274;};'use strict';var _=require('lodash');var util=require(_0x59d9('0x0'));var moment=require(_0x59d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x59d9('0x2'));var fs=require('fs');var Redis=require(_0x59d9('0x3'));var db=require(_0x59d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x59d9('0x5'));var config=require(_0x59d9('0x6'));var jayson=require(_0x59d9('0x7'));var client=jayson[_0x59d9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5697c7,_0x108a50,_0x406fc1){return new BPromise(function(_0x5df84f,_0xe91f20){return client['request'](_0x5697c7,_0x406fc1)[_0x59d9('0x9')](function(_0x49f89e){logger[_0x59d9('0xa')](_0x59d9('0xb'),_0x108a50,_0x59d9('0xc'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x108a50,'request\x20sent',JSON[_0x59d9('0xd')](_0x49f89e));if(_0x49f89e[_0x59d9('0xe')]){if(_0x49f89e['error']['code']===0x1f4){logger[_0x59d9('0xe')]('Network,\x20%s,\x20%s',_0x108a50,_0x49f89e[_0x59d9('0xe')]['message']);return _0xe91f20(_0x49f89e[_0x59d9('0xe')][_0x59d9('0xf')]);}logger[_0x59d9('0xe')](_0x59d9('0xb'),_0x108a50,_0x49f89e['error'][_0x59d9('0xf')]);return _0x5df84f(_0x49f89e[_0x59d9('0xe')][_0x59d9('0xf')]);}else{logger[_0x59d9('0xa')](_0x59d9('0xb'),_0x108a50,'request\x20sent');_0x5df84f(_0x49f89e['result'][_0x59d9('0xf')]);}})[_0x59d9('0x10')](function(_0x15c336){logger[_0x59d9('0xe')](_0x59d9('0xb'),_0x108a50,_0x15c336);_0xe91f20(_0x15c336);});});}
\ No newline at end of file
diff --git a/server/api/notification/index.js b/server/api/notification/index.js
index 2733ed9..b4e608b 100644
--- a/server/api/notification/index.js
+++ b/server/api/notification/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f23=['./notification.controller','post','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x3f23,0x111));var _0x33f2=function(_0x501a90,_0x3267d1){_0x501a90=_0x501a90-0x0;var _0x28bb97=_0x3f23[_0x501a90];return _0x28bb97;};'use strict';var multer=require(_0x33f2('0x0'));var util=require(_0x33f2('0x1'));var path=require(_0x33f2('0x2'));var timeout=require(_0x33f2('0x3'));var express=require(_0x33f2('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x33f2('0x5'));var config=require(_0x33f2('0x6'));var controller=require(_0x33f2('0x7'));router[_0x33f2('0x8')]('/',auth['isAuthenticated'](),controller['sendNotification']);module[_0x33f2('0x9')]=router;
\ No newline at end of file
+var _0xf64c=['../../config/environment','./notification.controller','post','isAuthenticated','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4983b2,_0x536bee){var _0x586771=function(_0x1b2804){while(--_0x1b2804){_0x4983b2['push'](_0x4983b2['shift']());}};_0x586771(++_0x536bee);}(_0xf64c,0x19c));var _0xcf64=function(_0x348258,_0x2e207e){_0x348258=_0x348258-0x0;var _0x37554a=_0xf64c[_0x348258];return _0x37554a;};'use strict';var multer=require(_0xcf64('0x0'));var util=require(_0xcf64('0x1'));var path=require(_0xcf64('0x2'));var timeout=require(_0xcf64('0x3'));var express=require(_0xcf64('0x4'));var router=express[_0xcf64('0x5')]();var auth=require(_0xcf64('0x6'));var interaction=require(_0xcf64('0x7'));var config=require(_0xcf64('0x8'));var controller=require(_0xcf64('0x9'));router[_0xcf64('0xa')]('/',auth[_0xcf64('0xb')](),controller['sendNotification']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/notification/notification.attributes.js b/server/api/notification/notification.attributes.js
index be39d66..62f90f0 100644
--- a/server/api/notification/notification.attributes.js
+++ b/server/api/notification/notification.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1b64=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x1fd544,_0x331069){var _0x230dd3=function(_0x1a3add){while(--_0x1a3add){_0x1fd544['push'](_0x1fd544['shift']());}};_0x230dd3(++_0x331069);}(_0x1b64,0xaf));var _0x41b6=function(_0x1109f8,_0x506244){_0x1109f8=_0x1109f8-0x0;var _0x24154a=_0x1b64[_0x1109f8];return _0x24154a;};'use strict';var Sequelize=require(_0x41b6('0x0'));module[_0x41b6('0x1')]={'body':{'type':Sequelize[_0x41b6('0x2')]},'senderName':{'type':Sequelize[_0x41b6('0x3')]},'recipientsId':{'type':Sequelize[_0x41b6('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x41b6('0x4')]}};
\ No newline at end of file
+var _0xf152=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xf152,0x121));var _0x2f15=function(_0x2d3d18,_0x475f4c){_0x2d3d18=_0x2d3d18-0x0;var _0x202f49=_0xf152[_0x2d3d18];return _0x202f49;};'use strict';var Sequelize=require(_0x2f15('0x0'));module[_0x2f15('0x1')]={'body':{'type':Sequelize[_0x2f15('0x2')]},'senderName':{'type':Sequelize[_0x2f15('0x3')]},'recipientsId':{'type':Sequelize[_0x2f15('0x2')]},'recipientsDescription':{'type':Sequelize[_0x2f15('0x3')]},'beep':{'type':Sequelize[_0x2f15('0x4')]}};
\ No newline at end of file
diff --git a/server/api/notification/notification.controller.js b/server/api/notification/notification.controller.js
index 2f9aa33..ab9d5c6 100644
--- a/server/api/notification/notification.controller.js
+++ b/server/api/notification/notification.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x389e=['recipientsId','sortBy','Notification','create','recipient','notification:send','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','catch','startCase','User','union','ids','replace','queue','Queue','forEach','push','all','flatten','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','sendNotification','body','hasOwnProperty','text','TemplateId','view','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','chatqueue','faxqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId'];(function(_0x2879df,_0x180e9f){var _0x46ec78=function(_0x30c809){while(--_0x30c809){_0x2879df['push'](_0x2879df['shift']());}};_0x46ec78(++_0x180e9f);}(_0x389e,0x137));var _0xe389=function(_0x425d5b,_0x546a25){_0x425d5b=_0x425d5b-0x0;var _0x517ec2=_0x389e[_0x425d5b];return _0x517ec2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe389('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe389('0x1'));var rp=require(_0xe389('0x2'));var moment=require(_0xe389('0x3'));var BPromise=require(_0xe389('0x4'));var Mustache=require(_0xe389('0x5'));var util=require(_0xe389('0x6'));var path=require(_0xe389('0x7'));var sox=require('sox');var csv=require(_0xe389('0x8'));var ejs=require(_0xe389('0x9'));var fs=require('fs');var _=require(_0xe389('0xa'));var squel=require('squel');var crypto=require(_0xe389('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe389('0x8'));var querystring=require(_0xe389('0xc'));var Papa=require('papaparse');var Redis=require(_0xe389('0xd'));var authService=require(_0xe389('0xe'));var qs=require(_0xe389('0xf'));var as=require(_0xe389('0x10'));var hardwareService=require(_0xe389('0x11'));var logger=require(_0xe389('0x12'))(_0xe389('0x13'));var utils=require(_0xe389('0x14'));var config=require('../../config/environment');var db=require(_0xe389('0x15'))['db'];config['redis']=_[_0xe389('0x16')](config['redis'],{'host':_0xe389('0x17'),'port':0x18eb});var socket=require(_0xe389('0x18'))(new Redis(config['redis']));require('./notification.socket')[_0xe389('0x19')](socket);function respondWithStatusCode(_0x3f840,_0x26a1b4){_0x26a1b4=_0x26a1b4||0xcc;return function(_0x244d44){if(_0x244d44){return _0x3f840[_0xe389('0x1a')](_0x26a1b4);}return _0x3f840['status'](_0x26a1b4)[_0xe389('0x1b')]();};}function respondWithResult(_0x13b794,_0x3efdb7){_0x3efdb7=_0x3efdb7||0xc8;return function(_0x454335){if(_0x454335){return _0x13b794[_0xe389('0x1c')](_0x3efdb7)[_0xe389('0x1d')](_0x454335);}};}function respondWithFilteredResult(_0x89779a,_0x1aef9f){return function(_0xe8089f){if(_0xe8089f){var _0x1067d4=_0xe8089f[_0xe389('0x1e')],_0x44264a=_0x1aef9f[_0xe389('0x1f')],_0x3d2d12=_0x1aef9f['offset']+_0x1aef9f[_0xe389('0x20')],_0x48ce8d;if(_0x3d2d12>=_0x1067d4){_0x3d2d12=_0x1067d4;_0x48ce8d=0xc8;}else{_0x48ce8d=0xce;}_0x89779a[_0xe389('0x1c')](_0x48ce8d);return _0x89779a[_0xe389('0x21')](_0xe389('0x22'),_0x44264a+'-'+_0x3d2d12+'/'+_0x1067d4)[_0xe389('0x1d')](_0xe8089f);}return null;};}function patchUpdates(_0x3723e8){return function(_0x3b054f){try{jsonpatch[_0xe389('0x23')](_0x3b054f,_0x3723e8,!![]);}catch(_0x3f65cb){return BPromise['reject'](_0x3f65cb);}return _0x3b054f[_0xe389('0x24')]();};}function saveUpdates(_0x29a128,_0x3c4f76){return function(_0x4dde4d){if(_0x4dde4d){return _0x4dde4d[_0xe389('0x25')](_0x29a128)[_0xe389('0x26')](function(_0x2d3bbc){return _0x2d3bbc;});}return null;};}function removeEntity(_0x223e1f,_0x1d9f09){return function(_0x224dd1){if(_0x224dd1){return _0x224dd1[_0xe389('0x27')]()[_0xe389('0x26')](function(){_0x223e1f[_0xe389('0x1c')](0xcc)[_0xe389('0x1b')]();});}};}function handleEntityNotFound(_0x288534,_0x2dbc6a){return function(_0x3d9765){if(!_0x3d9765){_0x288534[_0xe389('0x1a')](0x194);}return _0x3d9765;};}function handleError(_0x2a7489,_0x28a54f){_0x28a54f=_0x28a54f||0x1f4;return function(_0x58c2d9){logger['error'](_0x58c2d9[_0xe389('0x28')]);if(_0x58c2d9[_0xe389('0x29')]){delete _0x58c2d9[_0xe389('0x29')];}_0x2a7489[_0xe389('0x1c')](_0x28a54f)[_0xe389('0x2a')](_0x58c2d9);};}exports[_0xe389('0x2b')]=function(_0x102806,_0x45d2c2,_0x755abe){if(!_0x102806[_0xe389('0x2c')][_0xe389('0x2d')](_0xe389('0x2e'))&&!_0x102806[_0xe389('0x2c')][_0xe389('0x2d')](_0xe389('0x2f'))){throw new db['Sequelize']['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x102806[_0xe389('0x2c')]['hasOwnProperty']('TemplateId')&&!_0x102806[_0xe389('0x2c')][_0xe389('0x2d')](_0xe389('0x30'))){throw new db[(_0xe389('0x31'))][(_0xe389('0x32'))](_0xe389('0x33'));}if(!_0x102806['body'][_0xe389('0x2d')](_0xe389('0x34'))){throw new db[(_0xe389('0x31'))][(_0xe389('0x32'))](_0xe389('0x35'));}else{try{var _0xca2eaa=JSON[_0xe389('0x36')](_0x102806[_0xe389('0x2c')][_0xe389('0x34')]);}catch(_0x1b1506){logger[_0xe389('0x37')](_0x1b1506);throw new db['Sequelize'][(_0xe389('0x32'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x5368cf=[_0xe389('0x38'),_0xe389('0x39'),'mailqueue','openchannelqueue',_0xe389('0x3a'),_0xe389('0x3b'),_0xe389('0x3c'),_0xe389('0x3d'),_0xe389('0x3e')];if(_[_0xe389('0x3f')](_0xca2eaa,function(_0x4adb5d){return!_[_0xe389('0x40')](_0x5368cf,_0x4adb5d[_0xe389('0x41')][_0xe389('0x42')]());})){throw new db[(_0xe389('0x31'))][(_0xe389('0x32'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4c695f={};_0x4c695f['senderName']=_0x102806[_0xe389('0x2c')][_0xe389('0x2d')](_0xe389('0x43'))?_0x102806[_0xe389('0x2c')][_0xe389('0x43')]:_0x102806['user'][_0xe389('0x44')];_0x4c695f['recipientsDescription']=_[_0xe389('0x45')](_0x102806[_0xe389('0x2c')][_0xe389('0x46')])?null:_0x102806[_0xe389('0x2c')][_0xe389('0x46')];_0x4c695f[_0xe389('0x47')]=_0x102806['body'][_0xe389('0x47')]||![];_0x4c695f[_0xe389('0x48')]=_0x102806[_0xe389('0x3e')]['id'];return getContent(_0x102806[_0xe389('0x2c')])[_0xe389('0x26')](function(_0x3f5bb0){_0x4c695f[_0xe389('0x2c')]=_0x3f5bb0;return getRecipients(_0xca2eaa);})[_0xe389('0x26')](function(_0x205df6){_0x4c695f[_0xe389('0x49')]=_[_0xe389('0x4a')](_0x205df6)['join'](',');return db['sequelize']['transaction'](function(_0xd7527){return db[_0xe389('0x4b')][_0xe389('0x4c')](_0x4c695f,{'raw':!![],'transaction':_0xd7527})[_0xe389('0x26')](function(_0x2e85ae){var _0x2fd301={'sender':_0x4c695f[_0xe389('0x43')],'description':_0x4c695f[_0xe389('0x46')],'content':_0x4c695f[_0xe389('0x2c')],'beep':_0x4c695f[_0xe389('0x47')]};_0x205df6['forEach'](function(_0x12b794){_0x2fd301[_0xe389('0x4d')]=_0x12b794;socket['emit'](_0xe389('0x4e'),_0x2fd301);});return _0x2e85ae;});});})[_0xe389('0x26')](respondWithResult(_0x45d2c2,0xc9))['catch'](handleError(_0x45d2c2,null));};function getContent(_0x156224){return new BPromise(function(_0x3a720c,_0x3803d8){if(_0x156224[_0xe389('0x2e')]){_0x3a720c(_0x156224['text']);return;}return db[_0xe389('0x4f')][_0xe389('0x50')]({'attributes':['html'],'where':{'id':_0x156224[_0xe389('0x2f')]},'raw':!![]})[_0xe389('0x26')](function(_0x2cdfca){if(!_0x2cdfca)throw new db[(_0xe389('0x31'))][(_0xe389('0x32'))](_0xe389('0x51'));var _0x1145c6=Mustache[_0xe389('0x52')](_0x2cdfca[_0xe389('0x53')],_0x156224[_0xe389('0x30')]);_0x3a720c(_0x1145c6);})[_0xe389('0x54')](function(_0x3fa51e){_0x3803d8(_0x3fa51e);});});}function getRecipients(_0x1812eb){return new BPromise(function(_0x14ffec,_0x1625b9){var _0x1c66e8=[];var _0x9389d4=[];_0x1812eb['forEach'](function(_0x27872a){var _0x309874=_[_0xe389('0x55')](_0x27872a[_0xe389('0x41')][_0xe389('0x42')]());if(_0x309874===_0xe389('0x56')){_0x1c66e8=_[_0xe389('0x57')](_0x1c66e8,_0x27872a[_0xe389('0x58')]);}else{if(_[_0xe389('0x40')](_0x309874,'queue'))_0x309874=_0x309874[_0xe389('0x59')](_0xe389('0x5a'),_0xe389('0x5b'));_0x27872a['ids'][_0xe389('0x5c')](function(_0x46ff6e){_0x9389d4[_0xe389('0x5d')](getAgents(_0x309874,_0x46ff6e));});}});return BPromise[_0xe389('0x5e')](_0x9389d4)[_0xe389('0x26')](function(_0x6bd54a){_0x1c66e8=_['union'](_0x1c66e8,_[_0xe389('0x5f')](_0x6bd54a));_0x14ffec(_0x1c66e8);})[_0xe389('0x54')](function(_0x36781b){_0x1625b9(_0x36781b);});});}function getAgents(_0x41ab5b,_0x5e9ff8){return new BPromise(function(_0x5729c7,_0x3303cd){return db[_0x41ab5b][_0xe389('0x50')]({'where':{'id':_0x5e9ff8}})['then'](function(_0x54ccd3){return _0x54ccd3['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x2f8c05){var _0x57942f=_['map'](_0x2f8c05,'id');_0x5729c7(_0x57942f);});})[_0xe389('0x54')](function(_0x3cfb20){_0x3303cd(_0x3cfb20);});});}
\ No newline at end of file
+var _0xa1f7=['Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','transaction','Notification','create','forEach','recipient','emit','notification:send','findOne','html','catch','startCase','User','union','ids','queue','replace','Queue','push','all','getAgents','map','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','count','limit','set','Content-Range','json','save','update','then','destroy','stack','send','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error'];(function(_0x2f4ee6,_0x24a540){var _0x28f20e=function(_0x239715){while(--_0x239715){_0x2f4ee6['push'](_0x2f4ee6['shift']());}};_0x28f20e(++_0x24a540);}(_0xa1f7,0x14a));var _0x7a1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa1f7[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x7a1f('0x0'));var emlformat=require(_0x7a1f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7a1f('0x2'));var jsonpatch=require(_0x7a1f('0x3'));var rp=require(_0x7a1f('0x4'));var moment=require(_0x7a1f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7a1f('0x6'));var util=require(_0x7a1f('0x7'));var path=require(_0x7a1f('0x8'));var sox=require(_0x7a1f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7a1f('0xa'));var squel=require('squel');var crypto=require(_0x7a1f('0xb'));var jsforce=require(_0x7a1f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7a1f('0xd'));var querystring=require(_0x7a1f('0xe'));var Papa=require(_0x7a1f('0xf'));var Redis=require(_0x7a1f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7a1f('0x11'));var hardwareService=require(_0x7a1f('0x12'));var logger=require(_0x7a1f('0x13'))('api');var utils=require(_0x7a1f('0x14'));var config=require(_0x7a1f('0x15'));var db=require(_0x7a1f('0x16'))['db'];config[_0x7a1f('0x17')]=_['defaults'](config[_0x7a1f('0x17')],{'host':_0x7a1f('0x18'),'port':0x18eb});var socket=require(_0x7a1f('0x19'))(new Redis(config[_0x7a1f('0x17')]));require('./notification.socket')[_0x7a1f('0x1a')](socket);function respondWithStatusCode(_0xc03230,_0x2c418e){_0x2c418e=_0x2c418e||0xcc;return function(_0x580996){if(_0x580996){return _0xc03230[_0x7a1f('0x1b')](_0x2c418e);}return _0xc03230[_0x7a1f('0x1c')](_0x2c418e)[_0x7a1f('0x1d')]();};}function respondWithResult(_0x3e2145,_0x14c286){_0x14c286=_0x14c286||0xc8;return function(_0x3f25a3){if(_0x3f25a3){return _0x3e2145[_0x7a1f('0x1c')](_0x14c286)['json'](_0x3f25a3);}};}function respondWithFilteredResult(_0x1e5303,_0x1e4264){return function(_0x5729d3){if(_0x5729d3){var _0x5653b0=_0x5729d3[_0x7a1f('0x1e')],_0x1ebe5b=_0x1e4264['offset'],_0x6f6797=_0x1e4264['offset']+_0x1e4264[_0x7a1f('0x1f')],_0x51d39b;if(_0x6f6797>=_0x5653b0){_0x6f6797=_0x5653b0;_0x51d39b=0xc8;}else{_0x51d39b=0xce;}_0x1e5303['status'](_0x51d39b);return _0x1e5303[_0x7a1f('0x20')](_0x7a1f('0x21'),_0x1ebe5b+'-'+_0x6f6797+'/'+_0x5653b0)[_0x7a1f('0x22')](_0x5729d3);}return null;};}function patchUpdates(_0x1ff0c6){return function(_0x11afcb){try{jsonpatch['apply'](_0x11afcb,_0x1ff0c6,!![]);}catch(_0x3cd665){return BPromise['reject'](_0x3cd665);}return _0x11afcb[_0x7a1f('0x23')]();};}function saveUpdates(_0x2a756d,_0x421e9c){return function(_0x4624dc){if(_0x4624dc){return _0x4624dc[_0x7a1f('0x24')](_0x2a756d)[_0x7a1f('0x25')](function(_0x36797d){return _0x36797d;});}return null;};}function removeEntity(_0x43ec73,_0x388725){return function(_0x417d8d){if(_0x417d8d){return _0x417d8d[_0x7a1f('0x26')]()[_0x7a1f('0x25')](function(){_0x43ec73[_0x7a1f('0x1c')](0xcc)[_0x7a1f('0x1d')]();});}};}function handleEntityNotFound(_0x1eeaff,_0x118a6e){return function(_0x8c70ae){if(!_0x8c70ae){_0x1eeaff[_0x7a1f('0x1b')](0x194);}return _0x8c70ae;};}function handleError(_0x51e64b,_0x3feb59){_0x3feb59=_0x3feb59||0x1f4;return function(_0xf1e95b){logger['error'](_0xf1e95b[_0x7a1f('0x27')]);if(_0xf1e95b['name']){delete _0xf1e95b['name'];}_0x51e64b['status'](_0x3feb59)[_0x7a1f('0x28')](_0xf1e95b);};}exports['sendNotification']=function(_0x4e17f4,_0xd697b3,_0x52f989){if(!_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x2a')](_0x7a1f('0x2b'))&&!_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x2a')]('TemplateId')){throw new db[(_0x7a1f('0x2c'))][(_0x7a1f('0x2d'))](_0x7a1f('0x2e'));}else{if(_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x2a')](_0x7a1f('0x2f'))&&!_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x2a')](_0x7a1f('0x30'))){throw new db[(_0x7a1f('0x2c'))][(_0x7a1f('0x2d'))](_0x7a1f('0x31'));}if(!_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x2a')](_0x7a1f('0x32'))){throw new db[(_0x7a1f('0x2c'))][(_0x7a1f('0x2d'))](_0x7a1f('0x33'));}else{try{var _0x41951e=JSON[_0x7a1f('0x34')](_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x32')]);}catch(_0x3c51ba){logger[_0x7a1f('0x35')](_0x3c51ba);throw new db[(_0x7a1f('0x2c'))]['ValidationError'](_0x7a1f('0x36'));}var _0x441869=[_0x7a1f('0x37'),'faxqueue',_0x7a1f('0x38'),_0x7a1f('0x39'),_0x7a1f('0x3a'),_0x7a1f('0x3b'),_0x7a1f('0x3c'),_0x7a1f('0x3d'),_0x7a1f('0x3e')];if(_['some'](_0x41951e,function(_0x39faa1){return!_[_0x7a1f('0x3f')](_0x441869,_0x39faa1[_0x7a1f('0x40')][_0x7a1f('0x41')]());})){throw new db[(_0x7a1f('0x2c'))][(_0x7a1f('0x2d'))](_0x7a1f('0x42'));}}}var _0x3ca102={};_0x3ca102[_0x7a1f('0x43')]=_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x2a')]('senderName')?_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x43')]:_0x4e17f4[_0x7a1f('0x3e')][_0x7a1f('0x44')];_0x3ca102[_0x7a1f('0x45')]=_['isEmpty'](_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x45')])?null:_0x4e17f4['body'][_0x7a1f('0x45')];_0x3ca102[_0x7a1f('0x46')]=_0x4e17f4[_0x7a1f('0x29')][_0x7a1f('0x46')]||![];_0x3ca102[_0x7a1f('0x47')]=_0x4e17f4[_0x7a1f('0x3e')]['id'];return getContent(_0x4e17f4['body'])[_0x7a1f('0x25')](function(_0x1a6930){_0x3ca102[_0x7a1f('0x29')]=_0x1a6930;return getRecipients(_0x41951e);})[_0x7a1f('0x25')](function(_0x4d5690){_0x3ca102[_0x7a1f('0x48')]=_[_0x7a1f('0x49')](_0x4d5690)[_0x7a1f('0x4a')](',');return db['sequelize'][_0x7a1f('0x4b')](function(_0x30c60b){return db[_0x7a1f('0x4c')][_0x7a1f('0x4d')](_0x3ca102,{'raw':!![],'transaction':_0x30c60b})['then'](function(_0x133dba){var _0x1b54b7={'sender':_0x3ca102[_0x7a1f('0x43')],'description':_0x3ca102[_0x7a1f('0x45')],'content':_0x3ca102[_0x7a1f('0x29')],'beep':_0x3ca102[_0x7a1f('0x46')]};_0x4d5690[_0x7a1f('0x4e')](function(_0x4d324b){_0x1b54b7[_0x7a1f('0x4f')]=_0x4d324b;socket[_0x7a1f('0x50')](_0x7a1f('0x51'),_0x1b54b7);});return _0x133dba;});});})[_0x7a1f('0x25')](respondWithResult(_0xd697b3,0xc9))['catch'](handleError(_0xd697b3,null));};function getContent(_0x19dac0){return new BPromise(function(_0x58f3f2,_0x259e59){if(_0x19dac0['text']){_0x58f3f2(_0x19dac0['text']);return;}return db['Template'][_0x7a1f('0x52')]({'attributes':[_0x7a1f('0x53')],'where':{'id':_0x19dac0[_0x7a1f('0x2f')]},'raw':!![]})[_0x7a1f('0x25')](function(_0x113b8f){if(!_0x113b8f)throw new db[(_0x7a1f('0x2c'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x18bce4=Mustache['render'](_0x113b8f[_0x7a1f('0x53')],_0x19dac0['view']);_0x58f3f2(_0x18bce4);})[_0x7a1f('0x54')](function(_0x445163){_0x259e59(_0x445163);});});}function getRecipients(_0x368ddc){return new BPromise(function(_0x3a0fdf,_0x4d06d2){var _0x1755b0=[];var _0x5fb450=[];_0x368ddc[_0x7a1f('0x4e')](function(_0x49a29e){var _0x458150=_[_0x7a1f('0x55')](_0x49a29e[_0x7a1f('0x40')][_0x7a1f('0x41')]());if(_0x458150===_0x7a1f('0x56')){_0x1755b0=_[_0x7a1f('0x57')](_0x1755b0,_0x49a29e[_0x7a1f('0x58')]);}else{if(_[_0x7a1f('0x3f')](_0x458150,_0x7a1f('0x59')))_0x458150=_0x458150[_0x7a1f('0x5a')](_0x7a1f('0x59'),_0x7a1f('0x5b'));_0x49a29e[_0x7a1f('0x58')][_0x7a1f('0x4e')](function(_0x3a0bb5){_0x5fb450[_0x7a1f('0x5c')](getAgents(_0x458150,_0x3a0bb5));});}});return BPromise[_0x7a1f('0x5d')](_0x5fb450)[_0x7a1f('0x25')](function(_0x20b42e){_0x1755b0=_[_0x7a1f('0x57')](_0x1755b0,_['flatten'](_0x20b42e));_0x3a0fdf(_0x1755b0);})[_0x7a1f('0x54')](function(_0x1886b0){_0x4d06d2(_0x1886b0);});});}function getAgents(_0xb8725d,_0x224f3d){return new BPromise(function(_0x899afc,_0x121925){return db[_0xb8725d][_0x7a1f('0x52')]({'where':{'id':_0x224f3d}})[_0x7a1f('0x25')](function(_0x31de83){return _0x31de83[_0x7a1f('0x5e')]({'attributes':['id'],'raw':!![]})[_0x7a1f('0x25')](function(_0x59b5cc){var _0x4ba7eb=_[_0x7a1f('0x5f')](_0x59b5cc,'id');_0x899afc(_0x4ba7eb);});})[_0x7a1f('0x54')](function(_0x1c6f2d){_0x121925(_0x1c6f2d);});});}
\ No newline at end of file
diff --git a/server/api/notification/notification.events.js b/server/api/notification/notification.events.js
index 4d2a752..205b03a 100644
--- a/server/api/notification/notification.events.js
+++ b/server/api/notification/notification.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['exports','../../mysqldb','Notification','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x4d991a,_0x3dcfa0){_0x4d991a=_0x4d991a-0x0;var _0x438cd6=_0x2032[_0x4d991a];return _0x438cd6;};'use strict';var EventEmitter=require('events');var Notification=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var NotificationEvents=new EventEmitter();NotificationEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){NotificationEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);NotificationEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];Notification[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=NotificationEvents;
\ No newline at end of file
+var _0x0b0e=['Notification','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x290f14,_0x17ca73){var _0x1e4e4f=function(_0x2ce956){while(--_0x2ce956){_0x290f14['push'](_0x290f14['shift']());}};_0x1e4e4f(++_0x17ca73);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1de2bd,_0x953fb){_0x1de2bd=_0x1de2bd-0x0;var _0x595960=_0x0b0e[_0x1de2bd];return _0x595960;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var Notification=require('../../mysqldb')['db'][_0xe0b0('0x1')];var NotificationEvents=new EventEmitter();NotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){NotificationEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);NotificationEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];Notification[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=NotificationEvents;
\ No newline at end of file
diff --git a/server/api/notification/notification.model.js b/server/api/notification/notification.model.js
index c1c62e1..22f3b28 100644
--- a/server/api/notification/notification.model.js
+++ b/server/api/notification/notification.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x087b=['utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./notification.attributes','exports','define','Notification','notifications'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0x087b,0x11a));var _0xb087=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x087b[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb087('0x2'));var BPromise=require('bluebird');var rp=require(_0xb087('0x3'));var fs=require('fs');var path=require(_0xb087('0x4'));var rimraf=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var attributes=require(_0xb087('0x7'));module[_0xb087('0x8')]=function(_0x40156d,_0x17d6e8){return _0x40156d[_0xb087('0x9')](_0xb087('0xa'),attributes,{'tableName':_0xb087('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb087('0xc'),'collate':_0xb087('0xd')});};
\ No newline at end of file
+var _0xda3f=['../../config/environment','exports','Notification','notifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','rimraf'];(function(_0x4db3af,_0x2e3884){var _0x56c19d=function(_0x11dc75){while(--_0x11dc75){_0x4db3af['push'](_0x4db3af['shift']());}};_0x56c19d(++_0x2e3884);}(_0xda3f,0xec));var _0xfda3=function(_0xc3cd6c,_0x184d20){_0xc3cd6c=_0xc3cd6c-0x0;var _0x3c2329=_0xda3f[_0xc3cd6c];return _0x3c2329;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var attributes=require('./notification.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfda3('0x8'),'collate':_0xfda3('0x9')});};
\ No newline at end of file
diff --git a/server/api/notification/notification.rpc.js b/server/api/notification/notification.rpc.js
index 6ab0ffc..f6934b7 100644
--- a/server/api/notification/notification.rpc.js
+++ b/server/api/notification/notification.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd951=['message','Notification,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./notification.socket','info','debug','Notification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2e2b55,_0x7fc09e){var _0x36b6c1=function(_0x310290){while(--_0x310290){_0x2e2b55['push'](_0x2e2b55['shift']());}};_0x36b6c1(++_0x7fc09e);}(_0xd951,0x18a));var _0x1d95=function(_0x219627,_0x43e533){_0x219627=_0x219627-0x0;var _0x14b454=_0xd951[_0x219627];return _0x14b454;};'use strict';var _=require(_0x1d95('0x0'));var util=require(_0x1d95('0x1'));var moment=require('moment');var BPromise=require(_0x1d95('0x2'));var rs=require(_0x1d95('0x3'));var fs=require('fs');var Redis=require(_0x1d95('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d95('0x5'));var logger=require('../../config/logger')(_0x1d95('0x6'));var config=require(_0x1d95('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1d95('0x8')][_0x1d95('0x9')]({'port':0x232a});config[_0x1d95('0xa')]=_[_0x1d95('0xb')](config[_0x1d95('0xa')],{'host':_0x1d95('0xc'),'port':0x18eb});var socket=require(_0x1d95('0xd'))(new Redis(config[_0x1d95('0xa')]));require(_0x1d95('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e0c90,_0x2d1c71,_0x4be55b){return new BPromise(function(_0x449641,_0x5caa56){return client['request'](_0x2e0c90,_0x4be55b)['then'](function(_0x4d46fd){logger[_0x1d95('0xf')]('Notification,\x20%s,\x20%s',_0x2d1c71,'request\x20sent');logger[_0x1d95('0x10')](_0x1d95('0x11'),_0x2d1c71,_0x1d95('0x12'),JSON[_0x1d95('0x13')](_0x4d46fd));if(_0x4d46fd[_0x1d95('0x14')]){if(_0x4d46fd[_0x1d95('0x14')][_0x1d95('0x15')]===0x1f4){logger['error']('Notification,\x20%s,\x20%s',_0x2d1c71,_0x4d46fd[_0x1d95('0x14')][_0x1d95('0x16')]);return _0x5caa56(_0x4d46fd[_0x1d95('0x14')]['message']);}logger[_0x1d95('0x14')]('Notification,\x20%s,\x20%s',_0x2d1c71,_0x4d46fd[_0x1d95('0x14')][_0x1d95('0x16')]);return _0x449641(_0x4d46fd['error'][_0x1d95('0x16')]);}else{logger['info'](_0x1d95('0x17'),_0x2d1c71,'request\x20sent');_0x449641(_0x4d46fd[_0x1d95('0x18')][_0x1d95('0x16')]);}})[_0x1d95('0x19')](function(_0x2fdd19){logger[_0x1d95('0x14')](_0x1d95('0x17'),_0x2d1c71,_0x2fdd19);_0x5caa56(_0x2fdd19);});});}
\ No newline at end of file
+var _0x00de=['catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./notification.socket','register','info','Notification,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x2f5550,_0x4bd771){var _0x5667cd=function(_0x2cf5da){while(--_0x2cf5da){_0x2f5550['push'](_0x2f5550['shift']());}};_0x5667cd(++_0x4bd771);}(_0x00de,0x14b));var _0xe00d=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x00de[_0x2dd390];return _0x3afe47;};'use strict';var _=require('lodash');var util=require(_0xe00d('0x0'));var moment=require(_0xe00d('0x1'));var BPromise=require(_0xe00d('0x2'));var rs=require(_0xe00d('0x3'));var fs=require('fs');var Redis=require(_0xe00d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe00d('0x5'))(_0xe00d('0x6'));var config=require(_0xe00d('0x7'));var jayson=require(_0xe00d('0x8'));var client=jayson['client'][_0xe00d('0x9')]({'port':0x232a});config[_0xe00d('0xa')]=_['defaults'](config[_0xe00d('0xa')],{'host':_0xe00d('0xb'),'port':0x18eb});var socket=require(_0xe00d('0xc'))(new Redis(config[_0xe00d('0xa')]));require(_0xe00d('0xd'))[_0xe00d('0xe')](socket);function respondWithRpcPromise(_0x54bb85,_0x467c1c,_0x3e73fb){return new BPromise(function(_0x48d2e5,_0xaec4e1){return client['request'](_0x54bb85,_0x3e73fb)['then'](function(_0x2ea6ec){logger[_0xe00d('0xf')](_0xe00d('0x10'),_0x467c1c,_0xe00d('0x11'));logger['debug']('Notification,\x20%s,\x20%s,\x20%s',_0x467c1c,_0xe00d('0x11'),JSON[_0xe00d('0x12')](_0x2ea6ec));if(_0x2ea6ec['error']){if(_0x2ea6ec[_0xe00d('0x13')]['code']===0x1f4){logger[_0xe00d('0x13')](_0xe00d('0x10'),_0x467c1c,_0x2ea6ec[_0xe00d('0x13')][_0xe00d('0x14')]);return _0xaec4e1(_0x2ea6ec[_0xe00d('0x13')][_0xe00d('0x14')]);}logger['error']('Notification,\x20%s,\x20%s',_0x467c1c,_0x2ea6ec[_0xe00d('0x13')][_0xe00d('0x14')]);return _0x48d2e5(_0x2ea6ec[_0xe00d('0x13')][_0xe00d('0x14')]);}else{logger[_0xe00d('0xf')](_0xe00d('0x10'),_0x467c1c,'request\x20sent');_0x48d2e5(_0x2ea6ec['result'][_0xe00d('0x14')]);}})[_0xe00d('0x15')](function(_0x2d1087){logger[_0xe00d('0x13')]('Notification,\x20%s,\x20%s',_0x467c1c,_0x2d1087);_0xaec4e1(_0x2d1087);});});}
\ No newline at end of file
diff --git a/server/api/notification/notification.socket.js b/server/api/notification/notification.socket.js
index 3c7a398..0806bca 100644
--- a/server/api/notification/notification.socket.js
+++ b/server/api/notification/notification.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d00=['notification:','./notification.events','save','remove','update','emit','removeListener'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x9d00,0x166));var _0x09d0=function(_0x111d9a,_0x120b2b){_0x111d9a=_0x111d9a-0x0;var _0x31bcb7=_0x9d00[_0x111d9a];return _0x31bcb7;};'use strict';var NotificationEvents=require(_0x09d0('0x0'));var events=[_0x09d0('0x1'),_0x09d0('0x2'),_0x09d0('0x3')];function createListener(_0x22500b,_0x2fefff){return function(_0x46b12c){_0x2fefff[_0x09d0('0x4')](_0x22500b,_0x46b12c);};}function removeListener(_0xc665a3,_0x26082d){return function(){NotificationEvents[_0x09d0('0x5')](_0xc665a3,_0x26082d);};}exports['register']=function(_0x23aa58){for(var _0x34180a=0x0,_0x58191f=events['length'];_0x34180a<_0x58191f;_0x34180a++){var _0x47f0fe=events[_0x34180a];var _0x29cc47=createListener(_0x09d0('0x6')+_0x47f0fe,_0x23aa58);NotificationEvents['on'](_0x47f0fe,_0x29cc47);}};
\ No newline at end of file
+var _0xa9a0=['update','emit','removeListener','register','length','notification:','save'];(function(_0x214b56,_0x18b479){var _0x528b82=function(_0x3683b7){while(--_0x3683b7){_0x214b56['push'](_0x214b56['shift']());}};_0x528b82(++_0x18b479);}(_0xa9a0,0x195));var _0x0a9a=function(_0x2cc56c,_0x510ca2){_0x2cc56c=_0x2cc56c-0x0;var _0x25acd7=_0xa9a0[_0x2cc56c];return _0x25acd7;};'use strict';var NotificationEvents=require('./notification.events');var events=[_0x0a9a('0x0'),'remove',_0x0a9a('0x1')];function createListener(_0x41774d,_0x4bbf8e){return function(_0x17b577){_0x4bbf8e[_0x0a9a('0x2')](_0x41774d,_0x17b577);};}function removeListener(_0x1527f2,_0x573dc0){return function(){NotificationEvents[_0x0a9a('0x3')](_0x1527f2,_0x573dc0);};}exports[_0x0a9a('0x4')]=function(_0x1f0112){for(var _0x23572a=0x0,_0x564b86=events[_0x0a9a('0x5')];_0x23572a<_0x564b86;_0x23572a++){var _0x13ed65=events[_0x23572a];var _0x8ec92c=createListener(_0x0a9a('0x6')+_0x13ed65,_0x1f0112);NotificationEvents['on'](_0x13ed65,_0x8ec92c);}};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js
index b32a78e..1013483 100644
--- a/server/api/openchannelAccount/index.js
+++ b/server/api/openchannelAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x088d=['/:id/notify','post','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','removeDispositions','removeAnswers','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','describe','show','/:id/dispositions','getDispositions','isAuthenticated','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','create','addDisposition','/:id/canned_answers'];(function(_0x36a82f,_0x2be5b6){var _0x3d1d1d=function(_0x2a1bdc){while(--_0x2a1bdc){_0x36a82f['push'](_0x36a82f['shift']());}};_0x3d1d1d(++_0x2be5b6);}(_0x088d,0x1a4));var _0xd088=function(_0x3131b6,_0x3efb01){_0x3131b6=_0x3131b6-0x0;var _0x39f385=_0x088d[_0x3131b6];return _0x39f385;};'use strict';var multer=require('multer');var util=require(_0xd088('0x0'));var path=require(_0xd088('0x1'));var timeout=require('connect-timeout');var express=require(_0xd088('0x2'));var router=express[_0xd088('0x3')]();var auth=require(_0xd088('0x4'));var interaction=require(_0xd088('0x5'));var config=require(_0xd088('0x6'));var controller=require(_0xd088('0x7'));router[_0xd088('0x8')]('/',auth['isAuthenticated'](),controller[_0xd088('0x9')]);router[_0xd088('0x8')](_0xd088('0xa'),auth['isAuthenticated'](),controller[_0xd088('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd088('0xc')]);router[_0xd088('0x8')](_0xd088('0xd'),auth['isAuthenticated'](),controller[_0xd088('0xe')]);router[_0xd088('0x8')]('/:id/canned_answers',auth[_0xd088('0xf')](),controller['getAnswers']);router[_0xd088('0x8')](_0xd088('0x10'),auth[_0xd088('0xf')](),controller['getApplications']);router['get'](_0xd088('0x11'),auth[_0xd088('0xf')](),controller[_0xd088('0x12')]);router['get'](_0xd088('0x13'),auth[_0xd088('0xf')](),controller[_0xd088('0x14')]);router['post']('/',auth[_0xd088('0xf')](),controller[_0xd088('0x15')]);router['post'](_0xd088('0xd'),auth[_0xd088('0xf')](),controller[_0xd088('0x16')]);router['post'](_0xd088('0x17'),auth[_0xd088('0xf')](),controller['addAnswer']);router['post'](_0xd088('0x18'),controller['notify']);router[_0xd088('0x19')](_0xd088('0x10'),auth[_0xd088('0xf')](),controller[_0xd088('0x1a')]);router[_0xd088('0x19')](_0xd088('0x13'),auth['isAuthenticated'](),controller[_0xd088('0x1b')]);router['post'](_0xd088('0x1c'),auth[_0xd088('0xf')](),controller[_0xd088('0x1d')]);router[_0xd088('0x1e')](_0xd088('0x1f'),auth[_0xd088('0xf')](),controller[_0xd088('0x20')]);router[_0xd088('0x21')]('/:id',auth[_0xd088('0xf')](),controller['destroy']);router[_0xd088('0x21')](_0xd088('0xd'),auth[_0xd088('0xf')](),controller[_0xd088('0x22')]);router[_0xd088('0x21')](_0xd088('0x17'),auth[_0xd088('0xf')](),controller[_0xd088('0x23')]);router[_0xd088('0x21')]('/:id/users',auth[_0xd088('0xf')](),controller['removeAgents']);module[_0xd088('0x24')]=router;
\ No newline at end of file
+var _0x43fe=['/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','destroy','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43fe,0x1dc));var _0xe43f=function(_0x45c33b,_0x2926b9){_0x45c33b=_0x45c33b-0x0;var _0x2557a0=_0x43fe[_0x45c33b];return _0x2557a0;};'use strict';var multer=require(_0xe43f('0x0'));var util=require(_0xe43f('0x1'));var path=require(_0xe43f('0x2'));var timeout=require(_0xe43f('0x3'));var express=require(_0xe43f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe43f('0x5'));var config=require(_0xe43f('0x6'));var controller=require(_0xe43f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe43f('0x8')]);router[_0xe43f('0x9')](_0xe43f('0xa'),auth[_0xe43f('0xb')](),controller[_0xe43f('0xc')]);router[_0xe43f('0x9')](_0xe43f('0xd'),auth[_0xe43f('0xb')](),controller[_0xe43f('0xe')]);router[_0xe43f('0x9')](_0xe43f('0xf'),auth[_0xe43f('0xb')](),controller[_0xe43f('0x10')]);router['get'](_0xe43f('0x11'),auth[_0xe43f('0xb')](),controller['getAnswers']);router[_0xe43f('0x9')](_0xe43f('0x12'),auth[_0xe43f('0xb')](),controller[_0xe43f('0x13')]);router[_0xe43f('0x9')](_0xe43f('0x14'),auth[_0xe43f('0xb')](),controller[_0xe43f('0x15')]);router['get'](_0xe43f('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xe43f('0x17')]('/',auth[_0xe43f('0xb')](),controller[_0xe43f('0x18')]);router[_0xe43f('0x17')](_0xe43f('0xf'),auth[_0xe43f('0xb')](),controller[_0xe43f('0x19')]);router[_0xe43f('0x17')](_0xe43f('0x11'),auth[_0xe43f('0xb')](),controller['addAnswer']);router[_0xe43f('0x17')](_0xe43f('0x1a'),controller[_0xe43f('0x1b')]);router[_0xe43f('0x17')](_0xe43f('0x12'),auth[_0xe43f('0xb')](),controller[_0xe43f('0x1c')]);router[_0xe43f('0x17')](_0xe43f('0x16'),auth[_0xe43f('0xb')](),controller[_0xe43f('0x1d')]);router['post'](_0xe43f('0x1e'),auth[_0xe43f('0xb')](),controller[_0xe43f('0x1f')]);router[_0xe43f('0x20')](_0xe43f('0xd'),auth['isAuthenticated'](),controller[_0xe43f('0x21')]);router['delete'](_0xe43f('0xd'),auth[_0xe43f('0xb')](),controller[_0xe43f('0x22')]);router[_0xe43f('0x23')](_0xe43f('0xf'),auth[_0xe43f('0xb')](),controller[_0xe43f('0x24')]);router['delete']('/:id/canned_answers',auth[_0xe43f('0xb')](),controller['removeAnswers']);router[_0xe43f('0x23')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xe43f('0x25')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js
index 8ce7e05..c6fa889 100644
--- a/server/api/openchannelAccount/openchannelAccount.attributes.js
+++ b/server/api/openchannelAccount/openchannelAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6672=['mandatoryDisposition','STRING','generate','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x8ecc14,_0x5af5c1){var _0x2f80a8=function(_0x8dada6){while(--_0x8dada6){_0x8ecc14['push'](_0x8ecc14['shift']());}};_0x2f80a8(++_0x5af5c1);}(_0x6672,0x119));var _0x2667=function(_0x9be28f,_0x231334){_0x9be28f=_0x9be28f-0x0;var _0xa9f52d=_0x6672[_0x9be28f];return _0xa9f52d;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x2667('0x0')]},'token':{'type':Sequelize[_0x2667('0x0')],'defaultValue':function(){return rs[_0x2667('0x1')]();}},'replyUri':{'type':Sequelize[_0x2667('0x0')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2667('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2667('0x2');}},'notificationSound':{'type':Sequelize[_0x2667('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2667('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2667('0x0')]},'queueTransfer':{'type':Sequelize[_0x2667('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2667('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2667('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x2667('0x5')},'mandatoryDisposition':{'type':Sequelize[_0x2667('0x3')],'defaultValue':![],'comment':_0x2667('0x6'),'set':function(_0xdecd23){if(!_0xdecd23)this[_0x2667('0x7')](_0x2667('0x8'),null);this[_0x2667('0x7')](_0x2667('0x9'),_0xdecd23);}}};
\ No newline at end of file
+var _0x5788=['randomstring','exports','STRING','name','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x45398e,_0x228236){var _0x5507ee=function(_0x20a423){while(--_0x20a423){_0x45398e['push'](_0x45398e['shift']());}};_0x5507ee(++_0x228236);}(_0x5788,0x1cd));var _0x8578=function(_0x530e8d,_0x58cd2c){_0x530e8d=_0x530e8d-0x0;var _0x2ef275=_0x5788[_0x530e8d];return _0x2ef275;};'use strict';var Sequelize=require(_0x8578('0x0'));var rs=require(_0x8578('0x1'));module[_0x8578('0x2')]={'name':{'type':Sequelize[_0x8578('0x3')],'unique':_0x8578('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x8578('0x3')]},'token':{'type':Sequelize[_0x8578('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x8578('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8578('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8578('0x5')],'defaultValue':function(){return _0x8578('0x6');}},'notificationSound':{'type':Sequelize[_0x8578('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8578('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8578('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8578('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8578('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8578('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x8578('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x8578('0x7')],'defaultValue':![],'comment':_0x8578('0xa'),'set':function(_0x4ebfd9){if(!_0x4ebfd9)this[_0x8578('0xb')](_0x8578('0xc'),null);this[_0x8578('0xb')](_0x8578('0xd'),_0x4ebfd9);}}};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js
index 8ce3a8e..4be8a34 100644
--- a/server/api/openchannelAccount/openchannelAccount.controller.js
+++ b/server/api/openchannelAccount/openchannelAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8440=['sort','filters','filter','where','merge','type','VIRTUAL','OpenchannelAccount','includeAll','findAll','rows','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','describe','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','pick','removeAnswers','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','firstName','messageId','interaction','created','autoclose','push','unmanaged','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','hasOwnProperty','getInteractions','Contact','Owner','fullname','Tags','color','tag','omit','spread','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','defaults','Messages','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','OpenchannelAccounts','end','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit','offset','order'];(function(_0x1d9dfa,_0x30598d){var _0x252661=function(_0x4bcc24){while(--_0x4bcc24){_0x1d9dfa['push'](_0x1d9dfa['shift']());}};_0x252661(++_0x30598d);}(_0x8440,0x122));var _0x0844=function(_0x97fc4e,_0x493241){_0x97fc4e=_0x97fc4e-0x0;var _0x2ff264=_0x8440[_0x97fc4e];return _0x2ff264;};'use strict';var pdf=require(_0x0844('0x0'));var emlformat=require(_0x0844('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0844('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0844('0x3'));var moment=require(_0x0844('0x4'));var BPromise=require(_0x0844('0x5'));var Mustache=require(_0x0844('0x6'));var util=require(_0x0844('0x7'));var path=require(_0x0844('0x8'));var sox=require(_0x0844('0x9'));var csv=require(_0x0844('0xa'));var ejs=require(_0x0844('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0844('0xc'));var crypto=require(_0x0844('0xd'));var jsforce=require(_0x0844('0xe'));var deskjs=require(_0x0844('0xf'));var toCsv=require(_0x0844('0xa'));var querystring=require(_0x0844('0x10'));var Papa=require(_0x0844('0x11'));var Redis=require(_0x0844('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0844('0x13'));var as=require(_0x0844('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0844('0x15'))('api');var utils=require(_0x0844('0x16'));var config=require(_0x0844('0x17'));var db=require(_0x0844('0x18'))['db'];config[_0x0844('0x19')]=_['defaults'](config[_0x0844('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0844('0x1a'))(new Redis(config[_0x0844('0x19')]));require(_0x0844('0x1b'))[_0x0844('0x1c')](socket);var jayson=require(_0x0844('0x1d'));var client=jayson[_0x0844('0x1e')][_0x0844('0x1f')]({'port':0x232c});var client9002=jayson[_0x0844('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x19115c,_0x232486,_0x1ec66b){if(_0x1ec66b){var _0x229af3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x229af3[_0x0844('0x20')](_0x232486)){return _0x19115c;}else{throw new db[(_0x0844('0x21'))][(_0x0844('0x22'))](_0x0844('0x23'));}}else{return _0x19115c;}}function respondWithRpcPromise(_0x490498,_0x4b8351,_0x35d772,_0x12ef7b){return new BPromise(function(_0x177223,_0x1e3656){var _0x1e50de=_0x12ef7b||client;return _0x1e50de[_0x0844('0x24')](_0x490498,_0x35d772)['then'](function(_0x525470){logger[_0x0844('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b8351,'request\x20sent');logger[_0x0844('0x26')](_0x0844('0x27'),_0x4b8351,'request\x20sent',JSON[_0x0844('0x28')](_0x525470));if(_0x525470['error']){if(_0x525470['error'][_0x0844('0x29')]===0x1f4){logger[_0x0844('0x2a')](_0x0844('0x2b'),_0x4b8351,_0x525470[_0x0844('0x2a')][_0x0844('0x2c')]);return _0x1e3656(_0x525470[_0x0844('0x2a')]['message']);}logger[_0x0844('0x2a')](_0x0844('0x2b'),_0x4b8351,_0x525470[_0x0844('0x2a')]['message']);return _0x177223(_0x525470[_0x0844('0x2a')][_0x0844('0x2c')]);}else{logger[_0x0844('0x25')](_0x0844('0x2b'),_0x4b8351,_0x0844('0x2d'));_0x177223(_0x525470[_0x0844('0x2e')][_0x0844('0x2c')]);}})[_0x0844('0x2f')](function(_0xef46dd){logger[_0x0844('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b8351,_0xef46dd);_0x1e3656(_0xef46dd);});});}function respondWithStatusCode(_0x24e610,_0x4a7ff3){_0x4a7ff3=_0x4a7ff3||0xcc;return function(_0x375d30){if(_0x375d30){return _0x24e610[_0x0844('0x30')](_0x4a7ff3);}return _0x24e610[_0x0844('0x31')](_0x4a7ff3)['end']();};}function respondWithResult(_0x280eb4,_0x4f1de6){_0x4f1de6=_0x4f1de6||0xc8;return function(_0x699b45){if(_0x699b45){return _0x280eb4[_0x0844('0x31')](_0x4f1de6)[_0x0844('0x32')](_0x699b45);}};}function respondWithFilteredResult(_0x1f1e46,_0x36b48a){return function(_0x62a77b){if(_0x62a77b){var _0x47164a=_0x62a77b[_0x0844('0x33')],_0x1cc64d=_0x36b48a['offset'],_0x48bee3=_0x36b48a['offset']+_0x36b48a[_0x0844('0x34')],_0x46b271;if(_0x48bee3>=_0x47164a){_0x48bee3=_0x47164a;_0x46b271=0xc8;}else{_0x46b271=0xce;}_0x1f1e46[_0x0844('0x31')](_0x46b271);return _0x1f1e46['set'](_0x0844('0x35'),_0x1cc64d+'-'+_0x48bee3+'/'+_0x47164a)[_0x0844('0x32')](_0x62a77b);}return null;};}function patchUpdates(_0x14fc4b){return function(_0x5a17de){try{jsonpatch[_0x0844('0x36')](_0x5a17de,_0x14fc4b,!![]);}catch(_0x2a03a9){return BPromise[_0x0844('0x37')](_0x2a03a9);}return _0x5a17de[_0x0844('0x38')]();};}function saveUpdates(_0x4423e1,_0x5437e3){return function(_0x244eaf){if(_0x244eaf){return _0x244eaf[_0x0844('0x39')](_0x4423e1)['then'](function(_0x59aab9){return _0x59aab9;});}return null;};}function removeEntity(_0x20340f,_0x1b741a){return function(_0x122ace){if(_0x122ace){return _0x122ace[_0x0844('0x3a')]()[_0x0844('0x3b')](function(){var _0x2b6ed7=_0x122ace['get']({'plain':!![]});var _0xa37334=_0x0844('0x3c');return db['UserProfileResource']['destroy']({'where':{'type':_0xa37334,'resourceId':_0x2b6ed7['id']}})[_0x0844('0x3b')](function(){return _0x122ace;});})[_0x0844('0x3b')](function(){_0x20340f[_0x0844('0x31')](0xcc)[_0x0844('0x3d')]();});}};}function handleEntityNotFound(_0xb5ee55,_0x457a77){return function(_0x11691e){if(!_0x11691e){_0xb5ee55[_0x0844('0x30')](0x194);}return _0x11691e;};}function handleError(_0x4f7461,_0xf17e9d){_0xf17e9d=_0xf17e9d||0x1f4;return function(_0xea2ad5){logger[_0x0844('0x2a')](_0xea2ad5['stack']);if(_0xea2ad5[_0x0844('0x3e')]){delete _0xea2ad5[_0x0844('0x3e')];}_0x4f7461[_0x0844('0x31')](_0xf17e9d)[_0x0844('0x3f')](_0xea2ad5);};}exports['index']=function(_0xa8f968,_0x3a402a){var _0x55ab70={'include':[{'model':db[_0x0844('0x40')],'as':_0x0844('0x41')}]},_0x3520e0={},_0x29ee05={'count':0x0,'rows':[]};var _0x4873c0=_[_0x0844('0x42')](db['OpenchannelAccount'][_0x0844('0x43')],function(_0x1b262b){return{'name':_0x1b262b[_0x0844('0x44')],'type':_0x1b262b['type'][_0x0844('0x45')]};});_0x3520e0[_0x0844('0x46')]=_[_0x0844('0x42')](_0x4873c0,_0x0844('0x3e'));_0x3520e0[_0x0844('0x47')]=_[_0x0844('0x48')](_0xa8f968[_0x0844('0x47')]);_0x3520e0['filters']=_['intersection'](_0x3520e0[_0x0844('0x46')],_0x3520e0[_0x0844('0x47')]);_0x55ab70[_0x0844('0x49')]=_[_0x0844('0x4a')](_0x3520e0[_0x0844('0x46')],qs['fields'](_0xa8f968[_0x0844('0x47')][_0x0844('0x4b')]));_0x55ab70[_0x0844('0x49')]=_0x55ab70[_0x0844('0x49')][_0x0844('0x4c')]?_0x55ab70[_0x0844('0x49')]:_0x3520e0[_0x0844('0x46')];if(!_0xa8f968['query']['hasOwnProperty'](_0x0844('0x4d'))){_0x55ab70[_0x0844('0x34')]=qs[_0x0844('0x34')](_0xa8f968[_0x0844('0x47')]['limit']);_0x55ab70[_0x0844('0x4e')]=qs['offset'](_0xa8f968[_0x0844('0x47')][_0x0844('0x4e')]);}_0x55ab70[_0x0844('0x4f')]=qs[_0x0844('0x50')](_0xa8f968[_0x0844('0x47')][_0x0844('0x50')]);_0x55ab70['where']=qs['filters'](_['pick'](_0xa8f968['query'],_0x3520e0[_0x0844('0x51')]),_0x4873c0);if(_0xa8f968[_0x0844('0x47')][_0x0844('0x52')]){_0x55ab70[_0x0844('0x53')]=_[_0x0844('0x54')](_0x55ab70[_0x0844('0x53')],{'$or':_[_0x0844('0x42')](_0x4873c0,function(_0x3cdb35){if(_0x3cdb35[_0x0844('0x55')]!==_0x0844('0x56')){var _0x331e67={};_0x331e67[_0x3cdb35[_0x0844('0x3e')]]={'$like':'%'+_0xa8f968['query']['filter']+'%'};return _0x331e67;}})});}_0x55ab70=_[_0x0844('0x54')]({},_0x55ab70,_0xa8f968['options']);var _0x4e6c02={'where':_0x55ab70[_0x0844('0x53')]};return db[_0x0844('0x57')]['count'](_0x4e6c02)[_0x0844('0x3b')](function(_0x244b24){_0x29ee05[_0x0844('0x33')]=_0x244b24;if(_0xa8f968[_0x0844('0x47')][_0x0844('0x58')]){_0x55ab70['include']=[{'all':!![]}];}return db[_0x0844('0x57')][_0x0844('0x59')](_0x55ab70);})['then'](function(_0x561c26){_0x29ee05[_0x0844('0x5a')]=_0x561c26;return _0x29ee05;})[_0x0844('0x3b')](respondWithFilteredResult(_0x3a402a,_0x55ab70))[_0x0844('0x2f')](handleError(_0x3a402a,null));};exports[_0x0844('0x5b')]=function(_0x224588,_0x39cf69){var _0x1f8a6b={'raw':![],'where':{'id':_0x224588[_0x0844('0x5c')]['id']},'include':[{'model':db[_0x0844('0x40')],'as':_0x0844('0x41')}]},_0x25d3a0={};_0x25d3a0[_0x0844('0x46')]=_[_0x0844('0x48')](db[_0x0844('0x57')][_0x0844('0x43')]);_0x25d3a0['query']=_[_0x0844('0x48')](_0x224588[_0x0844('0x47')]);_0x25d3a0[_0x0844('0x51')]=_['intersection'](_0x25d3a0[_0x0844('0x46')],_0x25d3a0[_0x0844('0x47')]);_0x1f8a6b[_0x0844('0x49')]=_[_0x0844('0x4a')](_0x25d3a0['model'],qs['fields'](_0x224588['query'][_0x0844('0x4b')]));_0x1f8a6b['attributes']=_0x1f8a6b[_0x0844('0x49')][_0x0844('0x4c')]?_0x1f8a6b[_0x0844('0x49')]:_0x25d3a0[_0x0844('0x46')];if(_0x224588[_0x0844('0x47')]['includeAll']){_0x1f8a6b[_0x0844('0x5d')]=[{'all':!![]}];}_0x1f8a6b=_[_0x0844('0x54')]({},_0x1f8a6b,_0x224588[_0x0844('0x5e')]);return db[_0x0844('0x57')][_0x0844('0x5f')](_0x1f8a6b)[_0x0844('0x3b')](handleEntityNotFound(_0x39cf69,null))[_0x0844('0x3b')](respondWithResult(_0x39cf69,null))['catch'](handleError(_0x39cf69,null));};exports[_0x0844('0x60')]=function(_0x2b5ab4,_0x2f9c7b){return db['OpenchannelAccount']['create'](_0x2b5ab4[_0x0844('0x61')],{})[_0x0844('0x3b')](function(_0x29028b){var _0x519f04=_0x2b5ab4[_0x0844('0x62')]['get']({'plain':!![]});if(!_0x519f04)throw new Error(_0x0844('0x63'));if(_0x519f04['role']===_0x0844('0x62')){var _0x2d7f48=_0x29028b[_0x0844('0x64')]({'plain':!![]});var _0x57bdcd='OpenchannelAccounts';return db[_0x0844('0x65')][_0x0844('0x5f')]({'where':{'name':_0x57bdcd,'userProfileId':_0x519f04[_0x0844('0x66')]},'raw':!![]})[_0x0844('0x3b')](function(_0x41c008){if(_0x41c008&&_0x41c008['autoAssociation']===0x0){return db['UserProfileResource'][_0x0844('0x60')]({'name':_0x2d7f48[_0x0844('0x3e')],'resourceId':_0x2d7f48['id'],'type':_0x41c008['name'],'sectionId':_0x41c008['id']},{})['then'](function(){return _0x29028b;});}else{return _0x29028b;}})[_0x0844('0x2f')](function(_0x29a4f7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29a4f7);throw _0x29a4f7;});}return _0x29028b;})['then'](respondWithResult(_0x2f9c7b,0xc9))[_0x0844('0x2f')](handleError(_0x2f9c7b,null));};exports[_0x0844('0x39')]=function(_0x1dff8a,_0x2c7525){if(_0x1dff8a[_0x0844('0x61')]['id']){delete _0x1dff8a['body']['id'];}return db[_0x0844('0x57')]['find']({'where':{'id':_0x1dff8a[_0x0844('0x5c')]['id']},'include':[{'model':db[_0x0844('0x40')],'as':_0x0844('0x41')}]})[_0x0844('0x3b')](handleEntityNotFound(_0x2c7525,null))[_0x0844('0x3b')](saveUpdates(_0x1dff8a[_0x0844('0x61')],null))[_0x0844('0x3b')](respondWithResult(_0x2c7525,null))[_0x0844('0x2f')](handleError(_0x2c7525,null));};exports[_0x0844('0x3a')]=function(_0x10a8a4,_0x181af4){return db[_0x0844('0x57')][_0x0844('0x5f')]({'where':{'id':_0x10a8a4['params']['id']}})['then'](handleEntityNotFound(_0x181af4,null))[_0x0844('0x3b')](removeEntity(_0x181af4,null))[_0x0844('0x2f')](handleError(_0x181af4,null));};exports[_0x0844('0x67')]=function(_0x1b0342,_0x54395e){return db['OpenchannelAccount'][_0x0844('0x67')]()[_0x0844('0x3b')](respondWithResult(_0x54395e,null))[_0x0844('0x2f')](handleError(_0x54395e,null));};exports['addDisposition']=function(_0x1779c0,_0x597a15,_0xba5857){if(_0x1779c0[_0x0844('0x61')]['id']){delete _0x1779c0[_0x0844('0x61')]['id'];}return db[_0x0844('0x57')]['find']({'where':{'id':_0x1779c0['params']['id']}})['then'](handleEntityNotFound(_0x597a15,null))[_0x0844('0x3b')](function(_0x4c5e26){if(_0x4c5e26){_0x1779c0['body']['OpnechannelAccountId']=_0x4c5e26['id'];return db['Disposition'][_0x0844('0x60')](_0x1779c0[_0x0844('0x61')]);}})[_0x0844('0x3b')](respondWithResult(_0x597a15,null))[_0x0844('0x2f')](handleError(_0x597a15,null));};exports[_0x0844('0x68')]=function(_0x23c9ec,_0x3f5056,_0x276977){var _0x4ddbb5={'raw':![],'where':{}};var _0x11d3ca={};var _0x15b14a={'count':0x0,'rows':[]};return db[_0x0844('0x57')][_0x0844('0x69')]({'where':{'id':_0x23c9ec[_0x0844('0x5c')]['id']}})[_0x0844('0x3b')](handleEntityNotFound(_0x3f5056,null))[_0x0844('0x3b')](function(_0x301793){if(_0x301793){_0x11d3ca[_0x0844('0x46')]=_[_0x0844('0x48')](db[_0x0844('0x6a')][_0x0844('0x43')]);_0x11d3ca['query']=_['keys'](_0x23c9ec['query']);_0x11d3ca[_0x0844('0x51')]=_[_0x0844('0x4a')](_0x11d3ca[_0x0844('0x46')],_0x11d3ca[_0x0844('0x47')]);_0x4ddbb5['attributes']=_[_0x0844('0x4a')](_0x11d3ca[_0x0844('0x46')],qs[_0x0844('0x4b')](_0x23c9ec[_0x0844('0x47')][_0x0844('0x4b')]));_0x4ddbb5['attributes']=_0x4ddbb5[_0x0844('0x49')][_0x0844('0x4c')]?_0x4ddbb5['attributes']:_0x11d3ca[_0x0844('0x46')];if(!_0x23c9ec[_0x0844('0x47')]['hasOwnProperty'](_0x0844('0x4d'))){_0x4ddbb5[_0x0844('0x34')]=qs[_0x0844('0x34')](_0x23c9ec[_0x0844('0x47')][_0x0844('0x34')]);_0x4ddbb5['offset']=qs[_0x0844('0x4e')](_0x23c9ec[_0x0844('0x47')][_0x0844('0x4e')]);}_0x4ddbb5[_0x0844('0x4f')]=qs[_0x0844('0x50')](_0x23c9ec[_0x0844('0x47')]['sort']);_0x4ddbb5[_0x0844('0x53')]=qs[_0x0844('0x51')](_['pick'](_0x23c9ec[_0x0844('0x47')],_0x11d3ca['filters']));_0x4ddbb5[_0x0844('0x53')]['OpenchannelAccountId']=_0x301793['id'];if(_0x23c9ec[_0x0844('0x47')]['filter']){_0x4ddbb5[_0x0844('0x53')]=_['merge'](_0x4ddbb5[_0x0844('0x53')],{'$or':_[_0x0844('0x42')](_0x4ddbb5[_0x0844('0x49')],function(_0x49bfeb){var _0x216643={};_0x216643[_0x49bfeb]={'$like':'%'+_0x23c9ec[_0x0844('0x47')][_0x0844('0x52')]+'%'};return _0x216643;})});}_0x4ddbb5=_['merge']({},_0x4ddbb5,_0x23c9ec[_0x0844('0x5e')]);return db[_0x0844('0x6a')][_0x0844('0x33')]({'where':_0x4ddbb5['where']})[_0x0844('0x3b')](function(_0x24fdad){_0x15b14a['count']=_0x24fdad;if(_0x23c9ec[_0x0844('0x47')]['includeAll']){_0x4ddbb5[_0x0844('0x5d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4ddbb5);})[_0x0844('0x3b')](function(_0xc8d3c9){_0x15b14a[_0x0844('0x5a')]=_0xc8d3c9;return _0x15b14a;});}})[_0x0844('0x3b')](respondWithFilteredResult(_0x3f5056,_0x4ddbb5))[_0x0844('0x2f')](handleError(_0x3f5056,null));};exports[_0x0844('0x6b')]=function(_0x2cfa1a,_0xc2747d,_0x39c7aa){return db[_0x0844('0x57')][_0x0844('0x5f')]({'where':{'id':_0x2cfa1a[_0x0844('0x5c')]['id']}})['then'](handleEntityNotFound(_0xc2747d,null))[_0x0844('0x3b')](function(_0x7eeb97){if(_0x7eeb97){return _0x7eeb97[_0x0844('0x6b')](_0x2cfa1a[_0x0844('0x47')][_0x0844('0x6c')]);}})[_0x0844('0x3b')](respondWithStatusCode(_0xc2747d,null))['catch'](handleError(_0xc2747d,null));};exports[_0x0844('0x6d')]=function(_0xda98cf,_0x5b0b6e,_0x63b94f){if(_0xda98cf['body']['id']){delete _0xda98cf['body']['id'];}return db[_0x0844('0x57')][_0x0844('0x5f')]({'where':{'id':_0xda98cf[_0x0844('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5b0b6e,null))['then'](function(_0x74cd8e){if(_0x74cd8e){_0xda98cf[_0x0844('0x61')][_0x0844('0x6e')]=_0x74cd8e['id'];return db[_0x0844('0x6f')][_0x0844('0x60')](_0xda98cf['body']);}})[_0x0844('0x3b')](respondWithResult(_0x5b0b6e,null))['catch'](handleError(_0x5b0b6e,null));};exports[_0x0844('0x70')]=function(_0x34df7a,_0xb1613b,_0x4a65dd){var _0x5d36ac={'raw':![],'where':{}};var _0x3cae63={};var _0x4ae021={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x0844('0x69')]({'where':{'id':_0x34df7a[_0x0844('0x5c')]['id']}})[_0x0844('0x3b')](handleEntityNotFound(_0xb1613b,null))[_0x0844('0x3b')](function(_0x4d4d3e){if(_0x4d4d3e){_0x3cae63['model']=_[_0x0844('0x48')](db['CannedAnswer'][_0x0844('0x43')]);_0x3cae63['query']=_[_0x0844('0x48')](_0x34df7a[_0x0844('0x47')]);_0x3cae63[_0x0844('0x51')]=_[_0x0844('0x4a')](_0x3cae63[_0x0844('0x46')],_0x3cae63[_0x0844('0x47')]);_0x5d36ac['attributes']=_[_0x0844('0x4a')](_0x3cae63[_0x0844('0x46')],qs[_0x0844('0x4b')](_0x34df7a['query'][_0x0844('0x4b')]));_0x5d36ac[_0x0844('0x49')]=_0x5d36ac[_0x0844('0x49')][_0x0844('0x4c')]?_0x5d36ac['attributes']:_0x3cae63[_0x0844('0x46')];if(!_0x34df7a[_0x0844('0x47')]['hasOwnProperty'](_0x0844('0x4d'))){_0x5d36ac[_0x0844('0x34')]=qs[_0x0844('0x34')](_0x34df7a[_0x0844('0x47')][_0x0844('0x34')]);_0x5d36ac[_0x0844('0x4e')]=qs[_0x0844('0x4e')](_0x34df7a[_0x0844('0x47')][_0x0844('0x4e')]);}_0x5d36ac['order']=qs[_0x0844('0x50')](_0x34df7a[_0x0844('0x47')]['sort']);_0x5d36ac['where']=qs['filters'](_[_0x0844('0x71')](_0x34df7a['query'],_0x3cae63[_0x0844('0x51')]));_0x5d36ac[_0x0844('0x53')][_0x0844('0x6e')]=_0x4d4d3e['id'];if(_0x34df7a[_0x0844('0x47')]['filter']){_0x5d36ac[_0x0844('0x53')]=_[_0x0844('0x54')](_0x5d36ac[_0x0844('0x53')],{'$or':_['map'](_0x5d36ac[_0x0844('0x49')],function(_0x30f621){var _0x1c0eae={};_0x1c0eae[_0x30f621]={'$like':'%'+_0x34df7a[_0x0844('0x47')][_0x0844('0x52')]+'%'};return _0x1c0eae;})});}_0x5d36ac=_[_0x0844('0x54')]({},_0x5d36ac,_0x34df7a['options']);return db[_0x0844('0x6f')][_0x0844('0x33')]({'where':_0x5d36ac[_0x0844('0x53')]})['then'](function(_0x4986f5){_0x4ae021[_0x0844('0x33')]=_0x4986f5;if(_0x34df7a['query'][_0x0844('0x58')]){_0x5d36ac[_0x0844('0x5d')]=[{'all':!![]}];}return db[_0x0844('0x6f')][_0x0844('0x59')](_0x5d36ac);})[_0x0844('0x3b')](function(_0x372e66){_0x4ae021['rows']=_0x372e66;return _0x4ae021;});}})[_0x0844('0x3b')](respondWithFilteredResult(_0xb1613b,_0x5d36ac))[_0x0844('0x2f')](handleError(_0xb1613b,null));};exports[_0x0844('0x72')]=function(_0x12eaf1,_0x21ab41,_0x365d28){return db['OpenchannelAccount'][_0x0844('0x5f')]({'where':{'id':_0x12eaf1[_0x0844('0x5c')]['id']}})['then'](handleEntityNotFound(_0x21ab41,null))['then'](function(_0x21e1b0){if(_0x21e1b0){return _0x21e1b0['removeAnswers'](_0x12eaf1['query'][_0x0844('0x6c')]);}})[_0x0844('0x3b')](respondWithStatusCode(_0x21ab41,null))[_0x0844('0x2f')](handleError(_0x21ab41,null));};exports['notify']=function(_0x2fd2c5,_0x2caef1,_0x2da9c6){var _0x22e508={'body':_0x2fd2c5[_0x0844('0x61')],'channel':'openchannel'};var _0x63a46f=[];var _0x5ada2a=[];var _0x16b8d9={};var _0x5a63cd=![];return db['CmContact'][_0x0844('0x67')]()[_0x0844('0x3b')](function(_0x1b0fcc){if(!_0x1b0fcc){throw new db[(_0x0844('0x21'))]['ValidationError'](_0x0844('0x73'));}_0x63a46f=_[_0x0844('0x74')](_['keys'](_0x1b0fcc),[_0x0844('0x75'),_0x0844('0x76')]);_0x5ada2a=_['difference'](_['keys'](_0x1b0fcc),[_0x0844('0x75'),'updatedAt','CompanyId',_0x0844('0x77')]);if(_0x2fd2c5[_0x0844('0x61')]['id']){delete _0x2fd2c5[_0x0844('0x61')]['id'];}if(_['isNil'](_0x2fd2c5['body'][_0x0844('0x78')])){throw new db['Sequelize'][(_0x0844('0x22'))](_0x0844('0x79'));}if(_[_0x0844('0x7a')](_0x2fd2c5[_0x0844('0x61')]['body'])||_0x2fd2c5[_0x0844('0x61')]['body']===''){throw new db[(_0x0844('0x21'))]['ValidationError'](_0x0844('0x7b'));}if(_['isNil'](_0x2fd2c5[_0x0844('0x61')]['mapKey'])){throw new db[(_0x0844('0x21'))][(_0x0844('0x22'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5ada2a);}if(!_[_0x0844('0x7c')](_0x5ada2a,_0x2fd2c5[_0x0844('0x61')][_0x0844('0x7d')])){throw new db[(_0x0844('0x21'))][(_0x0844('0x22'))](_0x0844('0x7e')+_0x5ada2a);}_0x16b8d9[_0x2fd2c5[_0x0844('0x61')]['mapKey']]=_0x2fd2c5[_0x0844('0x61')][_0x0844('0x78')];})[_0x0844('0x3b')](function(){return db['OpenchannelAccount'][_0x0844('0x5f')]({'where':{'id':_0x2fd2c5[_0x0844('0x5c')]['id']},'include':[{'model':db[_0x0844('0x7f')],'as':_0x0844('0x80'),'include':[{'model':db[_0x0844('0x81')],'as':_0x0844('0x82'),'where':_0x16b8d9,'limit':0x1,'order':[[_0x0844('0x76'),_0x0844('0x83')]]}]},{'model':db[_0x0844('0x84')],'as':_0x0844('0x85')}]});})[_0x0844('0x3b')](handleEntityNotFound(_0x2caef1,null))[_0x0844('0x3b')](function(_0x3c5bb7){if(_0x3c5bb7&&_0x3c5bb7[_0x0844('0x80')]){_0x22e508[_0x0844('0x86')]=_0x3c5bb7;_0x22e508['applications']=_0x3c5bb7[_0x0844('0x85')];_0x22e508[_0x0844('0x87')]=_0x3c5bb7['List'];_0x22e508[_0x0844('0x88')]=_[_0x0844('0x89')](_0x22e508['applications'],[_0x0844('0x8a')],[_0x0844('0x8b')]);if(_0x22e508['account'][_0x0844('0x85')]){delete _0x22e508['account']['Applications'];}if(_0x22e508[_0x0844('0x86')][_0x0844('0x80')]&&_0x22e508[_0x0844('0x86')][_0x0844('0x80')][_0x0844('0x82')]['length']){return _0x22e508[_0x0844('0x86')][_0x0844('0x80')]['Contacts'][0x0];}var _0x5ced92=_['defaults'](_0x2fd2c5[_0x0844('0x61')],{'firstName':_0x2fd2c5[_0x0844('0x61')][_0x0844('0x78')],'ListId':_0x3c5bb7[_0x0844('0x77')]});_0x5ced92[_0x2fd2c5['body'][_0x0844('0x7d')]]=_0x2fd2c5[_0x0844('0x61')][_0x0844('0x78')];return db['CmContact'][_0x0844('0x60')](_0x5ced92,{'fields':_0x63a46f,'raw':!![]});}})[_0x0844('0x3b')](handleEntityNotFound(_0x2caef1,null))[_0x0844('0x3b')](function(_0x560153){_0x22e508[_0x0844('0x8c')]=_0x560153;if(_0x560153){var _0x2de1e8={'ContactId':_0x560153['id'],'OpenchannelAccountId':_0x2fd2c5['params']['id'],'from':(_0x560153['firstName']||'')+'\x20'+(_0x560153[_0x0844('0x8d')]||'')};var _0x597050={'OpenchannelAccountId':_0x2fd2c5[_0x0844('0x5c')]['id'],'closed':![]};if(_0x2fd2c5[_0x0844('0x61')][_0x0844('0x8e')]){_0x597050[_0x0844('0x8e')]=_0x2fd2c5['body']['threadId'];return db[_0x0844('0x8f')]['find']({'where':_0x597050})[_0x0844('0x3b')](function(_0x456201){if(_0x456201){return[_0x456201,![]];}_0x2de1e8[_0x0844('0x8e')]=_0x2fd2c5['body'][_0x0844('0x8e')];_0x2de1e8[_0x0844('0x90')]=_0x2fd2c5['body'][_0x0844('0x90')];return db['OpenchannelInteraction'][_0x0844('0x60')](_0x2de1e8)[_0x0844('0x3b')](function(_0x1f2bc6){return[_0x1f2bc6,!![]];});});}else{_0x597050[_0x0844('0x8e')]=null;}_0x597050['ContactId']=_0x560153['id'];return db['OpenchannelInteraction'][_0x0844('0x5f')]({'where':_0x597050})[_0x0844('0x3b')](function(_0x4e1fcb){if(_0x4e1fcb){return[_0x4e1fcb,![]];}return db['OpenchannelInteraction'][_0x0844('0x60')](_0x2de1e8)[_0x0844('0x3b')](function(_0x2e6c51){return[_0x2e6c51,!![]];});});}})['spread'](function(_0x5768e9,_0x3dcca9){if(_0x5768e9){_0x5a63cd=_0x3dcca9;if(!_0x3dcca9){var _0x12c184={'from':(_0x22e508['contact'][_0x0844('0x91')]||'')+'\x20'+(_0x22e508[_0x0844('0x8c')][_0x0844('0x8d')]||'')};if(_0x2fd2c5['body'][_0x0844('0x8e')]&&_0x2fd2c5['body']['messageId']&&_0x2fd2c5['body']['threadId']!=_0x2fd2c5['body'][_0x0844('0x92')]){_0x12c184['threadId']=_0x2fd2c5[_0x0844('0x61')][_0x0844('0x92')];}return _0x5768e9[_0x0844('0x39')](_0x12c184);}else{return _0x5768e9;}}})[_0x0844('0x3b')](function(_0xb5bdd){_0x22e508[_0x0844('0x93')]=_0xb5bdd['get']({'plain':!![]});_0x22e508['interaction'][_0x0844('0x94')]=_0x5a63cd;if(_0x22e508[_0x0844('0x93')][_0x0844('0x94')]){if(_0x22e508[_0x0844('0x86')][_0x0844('0x95')]){_0x22e508[_0x0844('0x88')][_0x0844('0x96')]({'id':0x0,'priority':_0x22e508[_0x0844('0x88')]['length']+0x1,'app':'close','appdata':_0x0844('0x97'),'interval':'*,*,*,*'});}}return db[_0x0844('0x98')]['create']({'body':_0x2fd2c5['body']['body'],'OpenchannelAccountId':_0x2fd2c5['params']['id'],'OpenchannelInteractionId':_0xb5bdd['id'],'direction':'in','ContactId':_0x22e508[_0x0844('0x8c')]['id'],'AttachmentId':_0x2fd2c5['body'][_0x0844('0x99')]});})[_0x0844('0x3b')](function(_0x450280){_0x22e508['message']=_0x450280;if(_0x22e508[_0x0844('0x93')]['UserId']){return db[_0x0844('0x9a')][_0x0844('0x5f')]({'attributes':['id',_0x0844('0x3e')],'where':{'id':_0x22e508[_0x0844('0x93')][_0x0844('0x9b')]}})[_0x0844('0x3b')](function(_0x49b813){if(_0x49b813){_0x22e508[_0x0844('0x88')][_0x0844('0x9c')]({'id':0x0,'priority':0x0,'app':_0x0844('0x9d'),'appdata':_0x49b813['name']+','+(_0x22e508['account'][_0x0844('0x9e')]||0xa),'interval':_0x0844('0x9f')});_0x22e508['forcedOwnership']=![];}return respondWithRpcPromise(_0x0844('0xa0'),_0x0844('0xa1'),_0x22e508);});}return respondWithRpcPromise(_0x0844('0xa0'),_0x0844('0xa1'),_0x22e508);})['then'](function(_0xbd52cc){respondWithRpcPromise(_0x0844('0xa2'),_0x0844('0xa2'),{'event':'notify','message':_0xbd52cc},client9002);return _0xbd52cc;})['then'](respondWithResult(_0x2caef1,null))['catch'](handleError(_0x2caef1,null));};exports['addApplications']=function(_0xbbb5ea,_0x5d8d1a,_0x1d392c){return db[_0x0844('0x57')][_0x0844('0x69')]({'where':{'id':_0xbbb5ea[_0x0844('0x5c')]['id']}})[_0x0844('0x3b')](handleEntityNotFound(_0x5d8d1a,null))[_0x0844('0x3b')](function(_0x2f24bf){if(_0x2f24bf){return db[_0x0844('0xa3')][_0x0844('0xa4')](function(_0x10f0a8){return db[_0x0844('0x84')][_0x0844('0x3a')]({'where':{'OpenchannelAccountId':_0xbbb5ea[_0x0844('0x5c')]['id']},'transaction':_0x10f0a8})[_0x0844('0x3b')](function(_0x461d2a){var _0x229c35=_[_0x0844('0x42')](_0xbbb5ea[_0x0844('0x61')],function(_0x9fdbdd){_0x9fdbdd[_0x0844('0x6e')]=_0xbbb5ea[_0x0844('0x5c')]['id'];return _0x9fdbdd;});return db[_0x0844('0x84')][_0x0844('0xa5')](_0x229c35,{'transaction':_0x10f0a8});});})[_0x0844('0x3b')](function(){return db[_0x0844('0x84')][_0x0844('0xa6')]({'where':{'OpenchannelAccountId':_0xbbb5ea[_0x0844('0x5c')]['id']},'order':_0x0844('0x8a')});});}})[_0x0844('0x3b')](respondWithResult(_0x5d8d1a,null))[_0x0844('0x2f')](handleError(_0x5d8d1a,null));};exports[_0x0844('0xa7')]=function(_0x37cabb,_0x3eff79,_0x3bb789){var _0x294aad={};var _0x1abd68={};var _0x25f030;var _0x25d117;return db[_0x0844('0x57')][_0x0844('0x69')]({'where':{'id':_0x37cabb[_0x0844('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3eff79,null))[_0x0844('0x3b')](function(_0x2e4322){if(_0x2e4322){_0x25f030=_0x2e4322;_0x1abd68[_0x0844('0x46')]=_[_0x0844('0x48')](db['OpenchannelApplication'][_0x0844('0x43')]);_0x1abd68[_0x0844('0x47')]=_['keys'](_0x37cabb[_0x0844('0x47')]);_0x1abd68[_0x0844('0x51')]=_['intersection'](_0x1abd68[_0x0844('0x46')],_0x1abd68[_0x0844('0x47')]);_0x294aad[_0x0844('0x49')]=_['intersection'](_0x1abd68[_0x0844('0x46')],qs[_0x0844('0x4b')](_0x37cabb[_0x0844('0x47')][_0x0844('0x4b')]));_0x294aad[_0x0844('0x49')]=_0x294aad[_0x0844('0x49')][_0x0844('0x4c')]?_0x294aad[_0x0844('0x49')]:_0x1abd68[_0x0844('0x46')];_0x294aad[_0x0844('0x4f')]=qs[_0x0844('0x50')](_0x37cabb[_0x0844('0x47')][_0x0844('0x50')]);_0x294aad[_0x0844('0x53')]=qs[_0x0844('0x51')](_['pick'](_0x37cabb[_0x0844('0x47')],_0x1abd68[_0x0844('0x51')]));if(_0x37cabb[_0x0844('0x47')][_0x0844('0x52')]){_0x294aad['where']=_[_0x0844('0x54')](_0x294aad['where'],{'$or':_[_0x0844('0x42')](_0x294aad[_0x0844('0x49')],function(_0x4f3248){var _0x39ec9d={};_0x39ec9d[_0x4f3248]={'$like':'%'+_0x37cabb[_0x0844('0x47')][_0x0844('0x52')]+'%'};return _0x39ec9d;})});}_0x294aad=_[_0x0844('0x54')]({},_0x294aad,_0x37cabb['options']);return _0x25f030['getApplications'](_0x294aad);}})['then'](function(_0x5b4a8e){if(_0x5b4a8e){_0x25d117=_0x5b4a8e[_0x0844('0x4c')];if(!_0x37cabb['query'][_0x0844('0xa8')](_0x0844('0x4d'))){_0x294aad[_0x0844('0x34')]=qs[_0x0844('0x34')](_0x37cabb[_0x0844('0x47')][_0x0844('0x34')]);_0x294aad['offset']=qs[_0x0844('0x4e')](_0x37cabb[_0x0844('0x47')][_0x0844('0x4e')]);}return _0x25f030[_0x0844('0xa7')](_0x294aad);}})[_0x0844('0x3b')](function(_0xdb3a78){if(_0xdb3a78){return _0xdb3a78?{'count':_0x25d117,'rows':_0xdb3a78}:null;}})[_0x0844('0x3b')](respondWithResult(_0x3eff79,null))[_0x0844('0x2f')](handleError(_0x3eff79,null));};exports[_0x0844('0xa9')]=function(_0x311b67,_0x154599,_0x3477b8){var _0x44b4b6={'raw':![],'where':{}};var _0x601601={};var _0x34e805={'count':0x0,'rows':[]};return db[_0x0844('0x57')][_0x0844('0x69')]({'where':{'id':_0x311b67[_0x0844('0x5c')]['id']}})[_0x0844('0x3b')](handleEntityNotFound(_0x154599,null))[_0x0844('0x3b')](function(_0x481446){if(_0x481446){_0x601601['model']=_[_0x0844('0x48')](db[_0x0844('0x8f')][_0x0844('0x43')]);_0x601601['query']=_[_0x0844('0x48')](_0x311b67[_0x0844('0x47')]);_0x601601[_0x0844('0x51')]=_['intersection'](_0x601601[_0x0844('0x46')],_0x601601[_0x0844('0x47')]);_0x44b4b6[_0x0844('0x49')]=_[_0x0844('0x4a')](_0x601601[_0x0844('0x46')],qs[_0x0844('0x4b')](_0x311b67[_0x0844('0x47')]['fields']));_0x44b4b6[_0x0844('0x49')]=_0x44b4b6[_0x0844('0x49')][_0x0844('0x4c')]?_0x44b4b6['attributes']:_0x601601['model'];if(!_0x311b67[_0x0844('0x47')][_0x0844('0xa8')](_0x0844('0x4d'))){_0x44b4b6[_0x0844('0x34')]=qs[_0x0844('0x34')](_0x311b67[_0x0844('0x47')][_0x0844('0x34')]);_0x44b4b6[_0x0844('0x4e')]=qs['offset'](_0x311b67[_0x0844('0x47')][_0x0844('0x4e')]);}_0x44b4b6[_0x0844('0x4f')]=qs[_0x0844('0x50')](_0x311b67[_0x0844('0x47')][_0x0844('0x50')]);_0x44b4b6['where']=qs['filters'](_[_0x0844('0x71')](_0x311b67[_0x0844('0x47')],_0x601601[_0x0844('0x51')]));_0x44b4b6[_0x0844('0x53')][_0x0844('0x6e')]=_0x481446['id'];if(_0x311b67['query'][_0x0844('0x52')]){_0x44b4b6[_0x0844('0x53')]=_['merge'](_0x44b4b6[_0x0844('0x53')],{'$or':_[_0x0844('0x42')](_0x44b4b6[_0x0844('0x49')],function(_0x13bcce){var _0x421267={};_0x421267[_0x13bcce]={'$like':'%'+_0x311b67[_0x0844('0x47')][_0x0844('0x52')]+'%'};return _0x421267;})});}_0x44b4b6=_['merge']({},_0x44b4b6,_0x311b67[_0x0844('0x5e')]);return db[_0x0844('0x8f')][_0x0844('0x33')]({'where':_0x44b4b6['where']})[_0x0844('0x3b')](function(_0x109d3e){_0x34e805[_0x0844('0x33')]=_0x109d3e;if(_0x311b67[_0x0844('0x47')][_0x0844('0x58')]){_0x44b4b6['include']=[{'model':db[_0x0844('0x81')],'as':_0x0844('0xaa'),'required':![]},{'model':db[_0x0844('0x9a')],'as':_0x0844('0xab'),'attributes':['name',_0x0844('0xac'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x0844('0xad'),'attributes':['id',_0x0844('0x3e'),_0x0844('0xae')],'where':_0x311b67[_0x0844('0x47')][_0x0844('0xaf')]?{'id':_0x311b67['query'][_0x0844('0xaf')]}:undefined,'required':_0x311b67['query'][_0x0844('0xaf')]?!![]:![]}];}return db[_0x0844('0x8f')]['findAll'](_0x44b4b6);})[_0x0844('0x3b')](function(_0xb7d9d5){_0x34e805[_0x0844('0x5a')]=_0xb7d9d5;return _0x34e805;});}})[_0x0844('0x3b')](respondWithFilteredResult(_0x154599,_0x44b4b6))[_0x0844('0x2f')](handleError(_0x154599,null));};exports['addAgents']=function(_0x44058a,_0x25c3a3,_0x5aa13a){return db[_0x0844('0x57')][_0x0844('0x5f')]({'where':{'id':_0x44058a[_0x0844('0x5c')]['id']}})[_0x0844('0x3b')](handleEntityNotFound(_0x25c3a3,null))[_0x0844('0x3b')](function(_0x464b1d){if(_0x464b1d){return _0x464b1d['addAgents'](_0x44058a['body'][_0x0844('0x6c')],_[_0x0844('0xb0')](_0x44058a[_0x0844('0x61')],[_0x0844('0x6c'),'id'])||{})[_0x0844('0xb1')](function(_0x465a3d){for(var _0x21795e=0x0;_0x21795e<_0x44058a[_0x0844('0x61')][_0x0844('0x6c')][_0x0844('0x4c')];_0x21795e+=0x1){socket['emit'](_0x0844('0xb2'),{'UserId':_0x44058a[_0x0844('0x61')][_0x0844('0x6c')][_0x21795e],'OpenchannelAccountId':_0x44058a[_0x0844('0x5c')]['id']});}return _0x465a3d;});}})[_0x0844('0x3b')](respondWithResult(_0x25c3a3,null))[_0x0844('0x2f')](handleError(_0x25c3a3,null));};exports[_0x0844('0xb3')]=function(_0x4aa052,_0xa27b98,_0x1600bc){return db[_0x0844('0x57')]['find']({'where':{'id':_0x4aa052['params']['id']}})['then'](handleEntityNotFound(_0xa27b98,null))[_0x0844('0x3b')](function(_0x52d313){if(_0x52d313){return _0x52d313[_0x0844('0xb3')](_0x4aa052[_0x0844('0x47')][_0x0844('0x6c')])[_0x0844('0x3b')](function(){if(_['isArray'](_0x4aa052[_0x0844('0x47')][_0x0844('0x6c')])){for(var _0x16b53a=0x0;_0x16b53a<_0x4aa052[_0x0844('0x47')][_0x0844('0x6c')][_0x0844('0x4c')];_0x16b53a+=0x1){socket[_0x0844('0xb4')](_0x0844('0xb5'),{'UserId':Number(_0x4aa052[_0x0844('0x47')][_0x0844('0x6c')][_0x16b53a]),'OpenchannelAccountId':Number(_0x4aa052[_0x0844('0x5c')]['id'])});}}else{socket[_0x0844('0xb4')](_0x0844('0xb5'),{'UserId':Number(_0x4aa052[_0x0844('0x47')][_0x0844('0x6c')]),'OpenchannelAccountId':Number(_0x4aa052[_0x0844('0x5c')]['id'])});}});}})[_0x0844('0x3b')](respondWithStatusCode(_0xa27b98,null))[_0x0844('0x2f')](handleError(_0xa27b98,null));};exports[_0x0844('0xb6')]=function(_0x147090,_0x3fac14,_0x294737){var _0x12d35a={};var _0x20cc3f={};var _0x19d508;var _0x4632e1;return db[_0x0844('0x57')][_0x0844('0x69')]({'where':{'id':_0x147090[_0x0844('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3fac14,null))[_0x0844('0x3b')](function(_0x350276){if(_0x350276){_0x19d508=_0x350276;_0x20cc3f[_0x0844('0x46')]=_[_0x0844('0x48')](db[_0x0844('0x9a')][_0x0844('0x43')]);_0x20cc3f[_0x0844('0x47')]=_[_0x0844('0x48')](_0x147090[_0x0844('0x47')]);_0x20cc3f[_0x0844('0x51')]=_[_0x0844('0x4a')](_0x20cc3f[_0x0844('0x46')],_0x20cc3f['query']);_0x12d35a[_0x0844('0x49')]=_['intersection'](_0x20cc3f[_0x0844('0x46')],qs[_0x0844('0x4b')](_0x147090[_0x0844('0x47')][_0x0844('0x4b')]));_0x12d35a[_0x0844('0x49')]=_0x12d35a[_0x0844('0x49')]['length']?_0x12d35a[_0x0844('0x49')]:_0x20cc3f[_0x0844('0x46')];_0x12d35a['order']=qs['sort'](_0x147090[_0x0844('0x47')][_0x0844('0x50')]);_0x12d35a[_0x0844('0x53')]=qs[_0x0844('0x51')](_['pick'](_0x147090['query'],_0x20cc3f[_0x0844('0x51')]));if(_0x147090[_0x0844('0x47')][_0x0844('0x52')]){_0x12d35a[_0x0844('0x53')]=_[_0x0844('0x54')](_0x12d35a[_0x0844('0x53')],{'$or':_['map'](_0x12d35a['attributes'],function(_0x2d544c){var _0x5c0fbb={};_0x5c0fbb[_0x2d544c]={'$like':'%'+_0x147090[_0x0844('0x47')]['filter']+'%'};return _0x5c0fbb;})});}_0x12d35a=_[_0x0844('0x54')]({},_0x12d35a,_0x147090[_0x0844('0x5e')]);return _0x19d508[_0x0844('0xb6')](_0x12d35a);}})[_0x0844('0x3b')](function(_0x45f59a){if(_0x45f59a){_0x4632e1=_0x45f59a['length'];if(!_0x147090[_0x0844('0x47')]['hasOwnProperty'](_0x0844('0x4d'))){_0x12d35a[_0x0844('0x34')]=qs[_0x0844('0x34')](_0x147090['query']['limit']);_0x12d35a[_0x0844('0x4e')]=qs[_0x0844('0x4e')](_0x147090[_0x0844('0x47')][_0x0844('0x4e')]);}return _0x19d508['getAgents'](_0x12d35a);}})[_0x0844('0x3b')](function(_0x113177){if(_0x113177){return _0x113177?{'count':_0x4632e1,'rows':_0x113177}:null;}})['then'](respondWithResult(_0x3fac14,null))[_0x0844('0x2f')](handleError(_0x3fac14,null));};exports['send']=function(_0x2253a1,_0x40bde9,_0x11a718){var _0x57cce8,_0x7917e,_0x375062;if(_[_0x0844('0x7a')](_0x2253a1[_0x0844('0x61')]['body'])||_0x2253a1[_0x0844('0x61')][_0x0844('0x61')]===''){throw new db[(_0x0844('0x21'))][(_0x0844('0x22'))](_0x0844('0x7b'));}if(_[_0x0844('0x7a')](_0x2253a1[_0x0844('0x61')]['to'])){}_0x57cce8=_0x2253a1['body']['to'];return db[_0x0844('0x57')][_0x0844('0x69')]({'where':{'id':_0x2253a1['params']['id']}})[_0x0844('0x3b')](handleEntityNotFound(_0x40bde9,null))[_0x0844('0x3b')](function(_0x2feb1f){if(_0x2feb1f){return db[_0x0844('0x57')]['find']({'where':{'id':_0x2feb1f['id']},'include':[{'model':db['CmList'],'as':_0x0844('0x80'),'include':[{'model':db[_0x0844('0x81')],'as':_0x0844('0x82'),'where':{[_0x2feb1f['mapKey']]:_0x57cce8},'limit':0x1,'order':[[_0x0844('0x76'),_0x0844('0x83')]]}]}]})[_0x0844('0x3b')](handleEntityNotFound(_0x40bde9,null))[_0x0844('0x3b')](function(_0x841db2){if(_0x841db2&&_0x841db2[_0x0844('0x80')]){_0x7917e=_0x841db2[_0x0844('0x64')]({'plain':!![]});if(_0x7917e['List']&&_0x7917e[_0x0844('0x80')][_0x0844('0x82')][_0x0844('0x4c')]){return _0x7917e[_0x0844('0x80')][_0x0844('0x82')][0x0];}return db[_0x0844('0x81')][_0x0844('0x60')](_[_0x0844('0xb7')](_0x2253a1['body'],{'firstName':_0x57cce8,[_0x841db2['mapKey']]:_0x57cce8,'phone':_0x57cce8,'ListId':_0x7917e[_0x0844('0x77')]}));}})[_0x0844('0x3b')](handleEntityNotFound(_0x40bde9,null))[_0x0844('0x3b')](function(_0x47764e){if(_0x47764e){_0x375062=_0x47764e;return db[_0x0844('0x8f')][_0x0844('0x5f')]({'where':{'ContactId':_0x375062['id'],'closed':![],'OpenchannelAccountId':_0x7917e['id']}})[_0x0844('0x3b')](function(_0x37716e){if(_0x37716e){return[_0x37716e,![]];}return db[_0x0844('0x8f')][_0x0844('0x60')]({'UserId':_0x2253a1[_0x0844('0x62')]['id'],'ContactId':_0x375062['id'],'OpenchannelAccountId':_0x7917e['id'],'lastMsgDirection':'out','Messages':[_[_0x0844('0x54')](_0x2253a1[_0x0844('0x61')],{'read':![],'body':_0x2253a1[_0x0844('0x61')]['body'],'OpenchannelAccountId':_0x7917e['id'],'UserId':_0x2253a1[_0x0844('0x62')]['id'],'ContactId':_0x375062['id']})]},{'include':[{'model':db[_0x0844('0x98')],'as':_0x0844('0xb8')}]})['then'](function(_0x1aa943){return[_0x1aa943,!![]];});});}})[_0x0844('0xb1')](function(_0xbdc64d,_0x18982f){if(_0x18982f){return _0xbdc64d;}return db['OpenchannelMessage'][_0x0844('0x60')](_['merge'](_0x2253a1[_0x0844('0x61')],{'read':![],'body':_0x2253a1[_0x0844('0x61')][_0x0844('0x61')],'OpenchannelAccountId':_0x7917e['id'],'OpenchannelInteractionId':_0xbdc64d['id'],'UserId':_0x2253a1[_0x0844('0x62')]['id'],'ContactId':_0x375062['id']}))[_0x0844('0x3b')](function(_0x325342){_0xbdc64d['dataValues']['Messages']=[];_0xbdc64d['dataValues'][_0x0844('0xb8')]['push'](_0x325342['dataValues']);return _0xbdc64d;});});}})[_0x0844('0x3b')](respondWithResult(_0x40bde9,null))['catch'](handleError(_0x40bde9,null));};
\ No newline at end of file
+var _0x9823=['Contacts','OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','defaults','ListId','contact','firstName','threadId','OpenchannelInteraction','externalUrl','spread','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','getApplications','pick','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','removeAgents','isArray','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','set','json','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','count','findAll','rows','show','params','includeAll','include','options','find','catch','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','OpenchannelAccountId','removeAnswers','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List'];(function(_0x22d06c,_0x42fd35){var _0x566b8e=function(_0x32bd1b){while(--_0x32bd1b){_0x22d06c['push'](_0x22d06c['shift']());}};_0x566b8e(++_0x42fd35);}(_0x9823,0xfd));var _0x3982=function(_0x2eec10,_0x58eb0c){_0x2eec10=_0x2eec10-0x0;var _0x1633b4=_0x9823[_0x2eec10];return _0x1633b4;};'use strict';var pdf=require(_0x3982('0x0'));var emlformat=require(_0x3982('0x1'));var rimraf=require(_0x3982('0x2'));var zipdir=require(_0x3982('0x3'));var jsonpatch=require(_0x3982('0x4'));var rp=require(_0x3982('0x5'));var moment=require(_0x3982('0x6'));var BPromise=require(_0x3982('0x7'));var Mustache=require(_0x3982('0x8'));var util=require(_0x3982('0x9'));var path=require(_0x3982('0xa'));var sox=require(_0x3982('0xb'));var csv=require('to-csv');var ejs=require(_0x3982('0xc'));var fs=require('fs');var _=require(_0x3982('0xd'));var squel=require(_0x3982('0xe'));var crypto=require(_0x3982('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3982('0x10'));var querystring=require(_0x3982('0x11'));var Papa=require(_0x3982('0x12'));var Redis=require(_0x3982('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3982('0x14'));var as=require(_0x3982('0x15'));var hardwareService=require(_0x3982('0x16'));var logger=require(_0x3982('0x17'))(_0x3982('0x18'));var utils=require('../../config/utils');var config=require(_0x3982('0x19'));var db=require(_0x3982('0x1a'))['db'];config['redis']=_['defaults'](config[_0x3982('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x3982('0x1c'))(new Redis(config[_0x3982('0x1b')]));require('./openchannelAccount.socket')[_0x3982('0x1d')](socket);var jayson=require(_0x3982('0x1e'));var client=jayson[_0x3982('0x1f')][_0x3982('0x20')]({'port':0x232c});var client9002=jayson[_0x3982('0x1f')][_0x3982('0x20')]({'port':0x232a});function checkPasswordPattern(_0x14eba5,_0x26bfb7,_0x2b0019){if(_0x2b0019){var _0x1e2bbf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e2bbf[_0x3982('0x21')](_0x26bfb7)){return _0x14eba5;}else{throw new db[(_0x3982('0x22'))]['ValidationError'](_0x3982('0x23'));}}else{return _0x14eba5;}}function respondWithRpcPromise(_0x5c302d,_0x284077,_0x2bb1c8,_0x245169){return new BPromise(function(_0x10064e,_0xf25401){var _0x40646d=_0x245169||client;return _0x40646d[_0x3982('0x24')](_0x5c302d,_0x2bb1c8)[_0x3982('0x25')](function(_0x4aa27f){logger[_0x3982('0x26')](_0x3982('0x27'),_0x284077,_0x3982('0x28'));logger[_0x3982('0x29')](_0x3982('0x2a'),_0x284077,'request\x20sent',JSON[_0x3982('0x2b')](_0x4aa27f));if(_0x4aa27f['error']){if(_0x4aa27f[_0x3982('0x2c')]['code']===0x1f4){logger[_0x3982('0x2c')](_0x3982('0x27'),_0x284077,_0x4aa27f[_0x3982('0x2c')][_0x3982('0x2d')]);return _0xf25401(_0x4aa27f[_0x3982('0x2c')]['message']);}logger['error'](_0x3982('0x27'),_0x284077,_0x4aa27f[_0x3982('0x2c')][_0x3982('0x2d')]);return _0x10064e(_0x4aa27f[_0x3982('0x2c')][_0x3982('0x2d')]);}else{logger[_0x3982('0x26')](_0x3982('0x27'),_0x284077,_0x3982('0x28'));_0x10064e(_0x4aa27f[_0x3982('0x2e')][_0x3982('0x2d')]);}})['catch'](function(_0x2c42a3){logger[_0x3982('0x2c')](_0x3982('0x27'),_0x284077,_0x2c42a3);_0xf25401(_0x2c42a3);});});}function respondWithStatusCode(_0x2c6e18,_0x55e040){_0x55e040=_0x55e040||0xcc;return function(_0x4dbce5){if(_0x4dbce5){return _0x2c6e18[_0x3982('0x2f')](_0x55e040);}return _0x2c6e18[_0x3982('0x30')](_0x55e040)[_0x3982('0x31')]();};}function respondWithResult(_0x5903c5,_0x247993){_0x247993=_0x247993||0xc8;return function(_0x666d7e){if(_0x666d7e){return _0x5903c5[_0x3982('0x30')](_0x247993)['json'](_0x666d7e);}};}function respondWithFilteredResult(_0x1a7b2e,_0x393809){return function(_0x25f238){if(_0x25f238){var _0x896332=_0x25f238['count'],_0x2b982e=_0x393809[_0x3982('0x32')],_0x9b36f9=_0x393809[_0x3982('0x32')]+_0x393809['limit'],_0x22fe2c;if(_0x9b36f9>=_0x896332){_0x9b36f9=_0x896332;_0x22fe2c=0xc8;}else{_0x22fe2c=0xce;}_0x1a7b2e[_0x3982('0x30')](_0x22fe2c);return _0x1a7b2e[_0x3982('0x33')]('Content-Range',_0x2b982e+'-'+_0x9b36f9+'/'+_0x896332)[_0x3982('0x34')](_0x25f238);}return null;};}function patchUpdates(_0x376b21){return function(_0x10db04){try{jsonpatch['apply'](_0x10db04,_0x376b21,!![]);}catch(_0x201978){return BPromise['reject'](_0x201978);}return _0x10db04[_0x3982('0x35')]();};}function saveUpdates(_0xcba975,_0xfa638f){return function(_0x249046){if(_0x249046){return _0x249046[_0x3982('0x36')](_0xcba975)[_0x3982('0x25')](function(_0x652e45){return _0x652e45;});}return null;};}function removeEntity(_0xc43fd7,_0xa38a8f){return function(_0x471661){if(_0x471661){return _0x471661[_0x3982('0x37')]()['then'](function(){var _0x8ec527=_0x471661[_0x3982('0x38')]({'plain':!![]});var _0x2605d9=_0x3982('0x39');return db[_0x3982('0x3a')][_0x3982('0x37')]({'where':{'type':_0x2605d9,'resourceId':_0x8ec527['id']}})[_0x3982('0x25')](function(){return _0x471661;});})[_0x3982('0x25')](function(){_0xc43fd7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x222f10,_0x29adee){return function(_0x248667){if(!_0x248667){_0x222f10[_0x3982('0x2f')](0x194);}return _0x248667;};}function handleError(_0x38c596,_0x1dd4f7){_0x1dd4f7=_0x1dd4f7||0x1f4;return function(_0x22e6a0){logger[_0x3982('0x2c')](_0x22e6a0[_0x3982('0x3b')]);if(_0x22e6a0[_0x3982('0x3c')]){delete _0x22e6a0[_0x3982('0x3c')];}_0x38c596[_0x3982('0x30')](_0x1dd4f7)[_0x3982('0x3d')](_0x22e6a0);};}exports[_0x3982('0x3e')]=function(_0x45b926,_0x355301){var _0x244605={'include':[{'model':db[_0x3982('0x3f')],'as':_0x3982('0x40')}]},_0x313222={},_0xc89627={'count':0x0,'rows':[]};var _0x2b580f=_[_0x3982('0x41')](db[_0x3982('0x42')][_0x3982('0x43')],function(_0x50566b){return{'name':_0x50566b[_0x3982('0x44')],'type':_0x50566b[_0x3982('0x45')][_0x3982('0x46')]};});_0x313222[_0x3982('0x47')]=_[_0x3982('0x41')](_0x2b580f,_0x3982('0x3c'));_0x313222['query']=_[_0x3982('0x48')](_0x45b926[_0x3982('0x49')]);_0x313222[_0x3982('0x4a')]=_[_0x3982('0x4b')](_0x313222[_0x3982('0x47')],_0x313222[_0x3982('0x49')]);_0x244605[_0x3982('0x4c')]=_[_0x3982('0x4b')](_0x313222[_0x3982('0x47')],qs[_0x3982('0x4d')](_0x45b926['query'][_0x3982('0x4d')]));_0x244605[_0x3982('0x4c')]=_0x244605['attributes'][_0x3982('0x4e')]?_0x244605[_0x3982('0x4c')]:_0x313222[_0x3982('0x47')];if(!_0x45b926['query'][_0x3982('0x4f')](_0x3982('0x50'))){_0x244605[_0x3982('0x51')]=qs[_0x3982('0x51')](_0x45b926[_0x3982('0x49')][_0x3982('0x51')]);_0x244605[_0x3982('0x32')]=qs['offset'](_0x45b926['query'][_0x3982('0x32')]);}_0x244605[_0x3982('0x52')]=qs[_0x3982('0x53')](_0x45b926['query'][_0x3982('0x53')]);_0x244605['where']=qs[_0x3982('0x4a')](_['pick'](_0x45b926[_0x3982('0x49')],_0x313222[_0x3982('0x4a')]),_0x2b580f);if(_0x45b926[_0x3982('0x49')][_0x3982('0x54')]){_0x244605[_0x3982('0x55')]=_[_0x3982('0x56')](_0x244605[_0x3982('0x55')],{'$or':_[_0x3982('0x41')](_0x2b580f,function(_0x138702){if(_0x138702[_0x3982('0x45')]!==_0x3982('0x57')){var _0x59aa10={};_0x59aa10[_0x138702[_0x3982('0x3c')]]={'$like':'%'+_0x45b926['query'][_0x3982('0x54')]+'%'};return _0x59aa10;}})});}_0x244605=_[_0x3982('0x56')]({},_0x244605,_0x45b926['options']);var _0x16c4a4={'where':_0x244605['where']};return db[_0x3982('0x42')][_0x3982('0x58')](_0x16c4a4)[_0x3982('0x25')](function(_0x476f76){_0xc89627[_0x3982('0x58')]=_0x476f76;if(_0x45b926['query']['includeAll']){_0x244605['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0x3982('0x59')](_0x244605);})['then'](function(_0x81a257){_0xc89627[_0x3982('0x5a')]=_0x81a257;return _0xc89627;})[_0x3982('0x25')](respondWithFilteredResult(_0x355301,_0x244605))['catch'](handleError(_0x355301,null));};exports[_0x3982('0x5b')]=function(_0x8144c6,_0x2a0548){var _0x11dc05={'raw':![],'where':{'id':_0x8144c6[_0x3982('0x5c')]['id']},'include':[{'model':db[_0x3982('0x3f')],'as':_0x3982('0x40')}]},_0x473c06={};_0x473c06['model']=_[_0x3982('0x48')](db[_0x3982('0x42')][_0x3982('0x43')]);_0x473c06[_0x3982('0x49')]=_[_0x3982('0x48')](_0x8144c6['query']);_0x473c06[_0x3982('0x4a')]=_['intersection'](_0x473c06['model'],_0x473c06[_0x3982('0x49')]);_0x11dc05[_0x3982('0x4c')]=_[_0x3982('0x4b')](_0x473c06[_0x3982('0x47')],qs[_0x3982('0x4d')](_0x8144c6[_0x3982('0x49')][_0x3982('0x4d')]));_0x11dc05[_0x3982('0x4c')]=_0x11dc05[_0x3982('0x4c')][_0x3982('0x4e')]?_0x11dc05[_0x3982('0x4c')]:_0x473c06[_0x3982('0x47')];if(_0x8144c6[_0x3982('0x49')][_0x3982('0x5d')]){_0x11dc05[_0x3982('0x5e')]=[{'all':!![]}];}_0x11dc05=_[_0x3982('0x56')]({},_0x11dc05,_0x8144c6[_0x3982('0x5f')]);return db[_0x3982('0x42')][_0x3982('0x60')](_0x11dc05)['then'](handleEntityNotFound(_0x2a0548,null))['then'](respondWithResult(_0x2a0548,null))[_0x3982('0x61')](handleError(_0x2a0548,null));};exports['create']=function(_0x5b7b36,_0x1aca40){return db['OpenchannelAccount'][_0x3982('0x62')](_0x5b7b36['body'],{})['then'](function(_0x526042){var _0x41c0a5=_0x5b7b36[_0x3982('0x63')][_0x3982('0x38')]({'plain':!![]});if(!_0x41c0a5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41c0a5[_0x3982('0x64')]==='user'){var _0x29e360=_0x526042[_0x3982('0x38')]({'plain':!![]});var _0x23fe76=_0x3982('0x39');return db[_0x3982('0x65')][_0x3982('0x60')]({'where':{'name':_0x23fe76,'userProfileId':_0x41c0a5['userProfileId']},'raw':!![]})['then'](function(_0x2f9e9f){if(_0x2f9e9f&&_0x2f9e9f[_0x3982('0x66')]===0x0){return db[_0x3982('0x3a')][_0x3982('0x62')]({'name':_0x29e360[_0x3982('0x3c')],'resourceId':_0x29e360['id'],'type':_0x2f9e9f[_0x3982('0x3c')],'sectionId':_0x2f9e9f['id']},{})[_0x3982('0x25')](function(){return _0x526042;});}else{return _0x526042;}})[_0x3982('0x61')](function(_0x424f56){logger['error'](_0x3982('0x67'),_0x424f56);throw _0x424f56;});}return _0x526042;})[_0x3982('0x25')](respondWithResult(_0x1aca40,0xc9))[_0x3982('0x61')](handleError(_0x1aca40,null));};exports['update']=function(_0x168c39,_0x22af84){if(_0x168c39[_0x3982('0x68')]['id']){delete _0x168c39[_0x3982('0x68')]['id'];}return db[_0x3982('0x42')][_0x3982('0x60')]({'where':{'id':_0x168c39[_0x3982('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x3982('0x40')}]})[_0x3982('0x25')](handleEntityNotFound(_0x22af84,null))[_0x3982('0x25')](saveUpdates(_0x168c39[_0x3982('0x68')],null))['then'](respondWithResult(_0x22af84,null))[_0x3982('0x61')](handleError(_0x22af84,null));};exports['destroy']=function(_0x2ff2ee,_0x4f8ebd){return db[_0x3982('0x42')][_0x3982('0x60')]({'where':{'id':_0x2ff2ee[_0x3982('0x5c')]['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x4f8ebd,null))[_0x3982('0x25')](removeEntity(_0x4f8ebd,null))[_0x3982('0x61')](handleError(_0x4f8ebd,null));};exports[_0x3982('0x69')]=function(_0x57ea13,_0x21dcaf){return db[_0x3982('0x42')][_0x3982('0x69')]()[_0x3982('0x25')](respondWithResult(_0x21dcaf,null))[_0x3982('0x61')](handleError(_0x21dcaf,null));};exports['addDisposition']=function(_0xe14452,_0x2692cb,_0x14c965){if(_0xe14452['body']['id']){delete _0xe14452[_0x3982('0x68')]['id'];}return db['OpenchannelAccount'][_0x3982('0x60')]({'where':{'id':_0xe14452['params']['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x2692cb,null))[_0x3982('0x25')](function(_0x251e19){if(_0x251e19){_0xe14452[_0x3982('0x68')]['OpnechannelAccountId']=_0x251e19['id'];return db[_0x3982('0x6a')][_0x3982('0x62')](_0xe14452[_0x3982('0x68')]);}})[_0x3982('0x25')](respondWithResult(_0x2692cb,null))[_0x3982('0x61')](handleError(_0x2692cb,null));};exports[_0x3982('0x6b')]=function(_0x10fffa,_0xb9e09b,_0x23cdd7){var _0x3582ea={'raw':![],'where':{}};var _0x1c3d1f={};var _0x493ef9={'count':0x0,'rows':[]};return db[_0x3982('0x42')][_0x3982('0x6c')]({'where':{'id':_0x10fffa[_0x3982('0x5c')]['id']}})[_0x3982('0x25')](handleEntityNotFound(_0xb9e09b,null))[_0x3982('0x25')](function(_0x5dd86c){if(_0x5dd86c){_0x1c3d1f[_0x3982('0x47')]=_[_0x3982('0x48')](db[_0x3982('0x6a')][_0x3982('0x43')]);_0x1c3d1f[_0x3982('0x49')]=_[_0x3982('0x48')](_0x10fffa[_0x3982('0x49')]);_0x1c3d1f[_0x3982('0x4a')]=_[_0x3982('0x4b')](_0x1c3d1f['model'],_0x1c3d1f[_0x3982('0x49')]);_0x3582ea['attributes']=_[_0x3982('0x4b')](_0x1c3d1f[_0x3982('0x47')],qs[_0x3982('0x4d')](_0x10fffa[_0x3982('0x49')][_0x3982('0x4d')]));_0x3582ea[_0x3982('0x4c')]=_0x3582ea[_0x3982('0x4c')][_0x3982('0x4e')]?_0x3582ea[_0x3982('0x4c')]:_0x1c3d1f[_0x3982('0x47')];if(!_0x10fffa[_0x3982('0x49')]['hasOwnProperty'](_0x3982('0x50'))){_0x3582ea[_0x3982('0x51')]=qs[_0x3982('0x51')](_0x10fffa[_0x3982('0x49')][_0x3982('0x51')]);_0x3582ea[_0x3982('0x32')]=qs[_0x3982('0x32')](_0x10fffa[_0x3982('0x49')][_0x3982('0x32')]);}_0x3582ea['order']=qs[_0x3982('0x53')](_0x10fffa[_0x3982('0x49')][_0x3982('0x53')]);_0x3582ea[_0x3982('0x55')]=qs[_0x3982('0x4a')](_['pick'](_0x10fffa[_0x3982('0x49')],_0x1c3d1f[_0x3982('0x4a')]));_0x3582ea[_0x3982('0x55')]['OpenchannelAccountId']=_0x5dd86c['id'];if(_0x10fffa['query']['filter']){_0x3582ea[_0x3982('0x55')]=_[_0x3982('0x56')](_0x3582ea['where'],{'$or':_['map'](_0x3582ea[_0x3982('0x4c')],function(_0x341b9b){var _0x214baf={};_0x214baf[_0x341b9b]={'$like':'%'+_0x10fffa[_0x3982('0x49')][_0x3982('0x54')]+'%'};return _0x214baf;})});}_0x3582ea=_[_0x3982('0x56')]({},_0x3582ea,_0x10fffa['options']);return db['Disposition'][_0x3982('0x58')]({'where':_0x3582ea[_0x3982('0x55')]})[_0x3982('0x25')](function(_0x2ee679){_0x493ef9['count']=_0x2ee679;if(_0x10fffa['query'][_0x3982('0x5d')]){_0x3582ea[_0x3982('0x5e')]=[{'all':!![]}];}return db[_0x3982('0x6a')][_0x3982('0x59')](_0x3582ea);})[_0x3982('0x25')](function(_0x2460a2){_0x493ef9[_0x3982('0x5a')]=_0x2460a2;return _0x493ef9;});}})[_0x3982('0x25')](respondWithFilteredResult(_0xb9e09b,_0x3582ea))[_0x3982('0x61')](handleError(_0xb9e09b,null));};exports[_0x3982('0x6d')]=function(_0x482fcd,_0x29f4be,_0x1dc499){return db[_0x3982('0x42')][_0x3982('0x60')]({'where':{'id':_0x482fcd['params']['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x29f4be,null))[_0x3982('0x25')](function(_0x4c5ca0){if(_0x4c5ca0){return _0x4c5ca0['removeDispositions'](_0x482fcd[_0x3982('0x49')][_0x3982('0x6e')]);}})['then'](respondWithStatusCode(_0x29f4be,null))['catch'](handleError(_0x29f4be,null));};exports[_0x3982('0x6f')]=function(_0x23a092,_0x143b80,_0x742279){if(_0x23a092[_0x3982('0x68')]['id']){delete _0x23a092[_0x3982('0x68')]['id'];}return db['OpenchannelAccount'][_0x3982('0x60')]({'where':{'id':_0x23a092['params']['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x143b80,null))[_0x3982('0x25')](function(_0x5a79f7){if(_0x5a79f7){_0x23a092[_0x3982('0x68')]['OpenchannelAccountId']=_0x5a79f7['id'];return db[_0x3982('0x70')][_0x3982('0x62')](_0x23a092[_0x3982('0x68')]);}})['then'](respondWithResult(_0x143b80,null))['catch'](handleError(_0x143b80,null));};exports[_0x3982('0x71')]=function(_0x202240,_0x3253d8,_0x3c9028){var _0x3c4bb1={'raw':![],'where':{}};var _0x3e6e74={};var _0x750b62={'count':0x0,'rows':[]};return db[_0x3982('0x42')][_0x3982('0x6c')]({'where':{'id':_0x202240[_0x3982('0x5c')]['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x3253d8,null))[_0x3982('0x25')](function(_0x5f33e6){if(_0x5f33e6){_0x3e6e74[_0x3982('0x47')]=_[_0x3982('0x48')](db['CannedAnswer'][_0x3982('0x43')]);_0x3e6e74[_0x3982('0x49')]=_['keys'](_0x202240[_0x3982('0x49')]);_0x3e6e74['filters']=_[_0x3982('0x4b')](_0x3e6e74['model'],_0x3e6e74['query']);_0x3c4bb1[_0x3982('0x4c')]=_['intersection'](_0x3e6e74[_0x3982('0x47')],qs[_0x3982('0x4d')](_0x202240['query'][_0x3982('0x4d')]));_0x3c4bb1[_0x3982('0x4c')]=_0x3c4bb1[_0x3982('0x4c')][_0x3982('0x4e')]?_0x3c4bb1[_0x3982('0x4c')]:_0x3e6e74[_0x3982('0x47')];if(!_0x202240[_0x3982('0x49')][_0x3982('0x4f')](_0x3982('0x50'))){_0x3c4bb1[_0x3982('0x51')]=qs[_0x3982('0x51')](_0x202240['query'][_0x3982('0x51')]);_0x3c4bb1['offset']=qs[_0x3982('0x32')](_0x202240[_0x3982('0x49')][_0x3982('0x32')]);}_0x3c4bb1[_0x3982('0x52')]=qs[_0x3982('0x53')](_0x202240[_0x3982('0x49')][_0x3982('0x53')]);_0x3c4bb1[_0x3982('0x55')]=qs[_0x3982('0x4a')](_['pick'](_0x202240[_0x3982('0x49')],_0x3e6e74[_0x3982('0x4a')]));_0x3c4bb1[_0x3982('0x55')][_0x3982('0x72')]=_0x5f33e6['id'];if(_0x202240['query'][_0x3982('0x54')]){_0x3c4bb1[_0x3982('0x55')]=_[_0x3982('0x56')](_0x3c4bb1[_0x3982('0x55')],{'$or':_[_0x3982('0x41')](_0x3c4bb1[_0x3982('0x4c')],function(_0x58128d){var _0x209d46={};_0x209d46[_0x58128d]={'$like':'%'+_0x202240[_0x3982('0x49')][_0x3982('0x54')]+'%'};return _0x209d46;})});}_0x3c4bb1=_[_0x3982('0x56')]({},_0x3c4bb1,_0x202240['options']);return db[_0x3982('0x70')][_0x3982('0x58')]({'where':_0x3c4bb1[_0x3982('0x55')]})[_0x3982('0x25')](function(_0x5ae9b8){_0x750b62[_0x3982('0x58')]=_0x5ae9b8;if(_0x202240['query'][_0x3982('0x5d')]){_0x3c4bb1[_0x3982('0x5e')]=[{'all':!![]}];}return db[_0x3982('0x70')][_0x3982('0x59')](_0x3c4bb1);})[_0x3982('0x25')](function(_0xf28122){_0x750b62[_0x3982('0x5a')]=_0xf28122;return _0x750b62;});}})[_0x3982('0x25')](respondWithFilteredResult(_0x3253d8,_0x3c4bb1))[_0x3982('0x61')](handleError(_0x3253d8,null));};exports[_0x3982('0x73')]=function(_0x581ee4,_0x1f176e,_0x58b423){return db[_0x3982('0x42')][_0x3982('0x60')]({'where':{'id':_0x581ee4[_0x3982('0x5c')]['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x1f176e,null))[_0x3982('0x25')](function(_0x31caae){if(_0x31caae){return _0x31caae[_0x3982('0x73')](_0x581ee4[_0x3982('0x49')][_0x3982('0x6e')]);}})[_0x3982('0x25')](respondWithStatusCode(_0x1f176e,null))['catch'](handleError(_0x1f176e,null));};exports['notify']=function(_0xcdf0bf,_0x4a1997,_0x12cda7){var _0x1e5f8c={'body':_0xcdf0bf['body'],'channel':_0x3982('0x74')};var _0x2256c4=[];var _0x5635f2=[];var _0x338546={};var _0x3dd486=![];return db[_0x3982('0x75')][_0x3982('0x69')]()['then'](function(_0x5be6ef){if(!_0x5be6ef){throw new db['Sequelize'][(_0x3982('0x76'))](_0x3982('0x77'));}_0x2256c4=_[_0x3982('0x78')](_[_0x3982('0x48')](_0x5be6ef),[_0x3982('0x79'),'updatedAt']);_0x5635f2=_['difference'](_[_0x3982('0x48')](_0x5be6ef),[_0x3982('0x79'),_0x3982('0x7a'),_0x3982('0x7b'),'ListId']);if(_0xcdf0bf[_0x3982('0x68')]['id']){delete _0xcdf0bf['body']['id'];}if(_['isNil'](_0xcdf0bf[_0x3982('0x68')][_0x3982('0x7c')])){throw new db[(_0x3982('0x22'))]['ValidationError'](_0x3982('0x7d'));}if(_['isNil'](_0xcdf0bf[_0x3982('0x68')]['body'])||_0xcdf0bf[_0x3982('0x68')][_0x3982('0x68')]===''){throw new db['Sequelize'][(_0x3982('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3982('0x7e')](_0xcdf0bf[_0x3982('0x68')][_0x3982('0x7f')])){throw new db[(_0x3982('0x22'))][(_0x3982('0x76'))](_0x3982('0x80')+_0x5635f2);}if(!_[_0x3982('0x81')](_0x5635f2,_0xcdf0bf[_0x3982('0x68')][_0x3982('0x7f')])){throw new db[(_0x3982('0x22'))]['ValidationError'](_0x3982('0x82')+_0x5635f2);}_0x338546[_0xcdf0bf[_0x3982('0x68')]['mapKey']]=_0xcdf0bf['body'][_0x3982('0x7c')];})[_0x3982('0x25')](function(){return db[_0x3982('0x42')][_0x3982('0x60')]({'where':{'id':_0xcdf0bf[_0x3982('0x5c')]['id']},'include':[{'model':db[_0x3982('0x83')],'as':_0x3982('0x84'),'include':[{'model':db['CmContact'],'as':_0x3982('0x85'),'where':_0x338546,'limit':0x1,'order':[[_0x3982('0x7a'),'DESC']]}]},{'model':db[_0x3982('0x86')],'as':_0x3982('0x87')}]});})[_0x3982('0x25')](handleEntityNotFound(_0x4a1997,null))[_0x3982('0x25')](function(_0xafcfaa){if(_0xafcfaa&&_0xafcfaa['List']){_0x1e5f8c['account']=_0xafcfaa;_0x1e5f8c[_0x3982('0x88')]=_0xafcfaa[_0x3982('0x87')];_0x1e5f8c[_0x3982('0x89')]=_0xafcfaa[_0x3982('0x84')];_0x1e5f8c[_0x3982('0x88')]=_[_0x3982('0x8a')](_0x1e5f8c[_0x3982('0x88')],[_0x3982('0x8b')],[_0x3982('0x8c')]);if(_0x1e5f8c[_0x3982('0x8d')][_0x3982('0x87')]){delete _0x1e5f8c[_0x3982('0x8d')][_0x3982('0x87')];}if(_0x1e5f8c[_0x3982('0x8d')][_0x3982('0x84')]&&_0x1e5f8c['account'][_0x3982('0x84')][_0x3982('0x85')]['length']){return _0x1e5f8c[_0x3982('0x8d')][_0x3982('0x84')][_0x3982('0x85')][0x0];}var _0x46de89=_[_0x3982('0x8e')](_0xcdf0bf[_0x3982('0x68')],{'firstName':_0xcdf0bf[_0x3982('0x68')][_0x3982('0x7c')],'ListId':_0xafcfaa[_0x3982('0x8f')]});_0x46de89[_0xcdf0bf[_0x3982('0x68')][_0x3982('0x7f')]]=_0xcdf0bf[_0x3982('0x68')][_0x3982('0x7c')];return db[_0x3982('0x75')][_0x3982('0x62')](_0x46de89,{'fields':_0x2256c4,'raw':!![]});}})['then'](handleEntityNotFound(_0x4a1997,null))['then'](function(_0x313cae){_0x1e5f8c[_0x3982('0x90')]=_0x313cae;if(_0x313cae){var _0x4e7af7={'ContactId':_0x313cae['id'],'OpenchannelAccountId':_0xcdf0bf[_0x3982('0x5c')]['id'],'from':(_0x313cae[_0x3982('0x91')]||'')+'\x20'+(_0x313cae['lastName']||'')};var _0x22780d={'OpenchannelAccountId':_0xcdf0bf[_0x3982('0x5c')]['id'],'closed':![]};if(_0xcdf0bf[_0x3982('0x68')][_0x3982('0x92')]){_0x22780d['threadId']=_0xcdf0bf[_0x3982('0x68')][_0x3982('0x92')];return db[_0x3982('0x93')]['find']({'where':_0x22780d})[_0x3982('0x25')](function(_0x288150){if(_0x288150){return[_0x288150,![]];}_0x4e7af7[_0x3982('0x92')]=_0xcdf0bf['body'][_0x3982('0x92')];_0x4e7af7['externalUrl']=_0xcdf0bf[_0x3982('0x68')][_0x3982('0x94')];return db[_0x3982('0x93')]['create'](_0x4e7af7)[_0x3982('0x25')](function(_0x3fc5da){return[_0x3fc5da,!![]];});});}else{_0x22780d[_0x3982('0x92')]=null;}_0x22780d['ContactId']=_0x313cae['id'];return db[_0x3982('0x93')][_0x3982('0x60')]({'where':_0x22780d})[_0x3982('0x25')](function(_0x53ffea){if(_0x53ffea){return[_0x53ffea,![]];}return db[_0x3982('0x93')][_0x3982('0x62')](_0x4e7af7)[_0x3982('0x25')](function(_0x4ee41a){return[_0x4ee41a,!![]];});});}})[_0x3982('0x95')](function(_0x52d610,_0x28c64b){if(_0x52d610){_0x3dd486=_0x28c64b;if(!_0x28c64b){var _0x4443ce={'from':(_0x1e5f8c['contact'][_0x3982('0x91')]||'')+'\x20'+(_0x1e5f8c[_0x3982('0x90')][_0x3982('0x96')]||'')};if(_0xcdf0bf[_0x3982('0x68')][_0x3982('0x92')]&&_0xcdf0bf[_0x3982('0x68')][_0x3982('0x97')]&&_0xcdf0bf[_0x3982('0x68')]['threadId']!=_0xcdf0bf['body']['messageId']){_0x4443ce['threadId']=_0xcdf0bf[_0x3982('0x68')]['messageId'];}return _0x52d610['update'](_0x4443ce);}else{return _0x52d610;}}})[_0x3982('0x25')](function(_0x4ae01a){_0x1e5f8c[_0x3982('0x98')]=_0x4ae01a['get']({'plain':!![]});_0x1e5f8c['interaction'][_0x3982('0x99')]=_0x3dd486;if(_0x1e5f8c[_0x3982('0x98')][_0x3982('0x99')]){if(_0x1e5f8c[_0x3982('0x8d')][_0x3982('0x9a')]){_0x1e5f8c[_0x3982('0x88')][_0x3982('0x9b')]({'id':0x0,'priority':_0x1e5f8c[_0x3982('0x88')][_0x3982('0x4e')]+0x1,'app':_0x3982('0x9c'),'appdata':_0x3982('0x9d'),'interval':_0x3982('0x9e')});}}return db[_0x3982('0x9f')][_0x3982('0x62')]({'body':_0xcdf0bf['body']['body'],'OpenchannelAccountId':_0xcdf0bf[_0x3982('0x5c')]['id'],'OpenchannelInteractionId':_0x4ae01a['id'],'direction':'in','ContactId':_0x1e5f8c[_0x3982('0x90')]['id'],'AttachmentId':_0xcdf0bf[_0x3982('0x68')][_0x3982('0xa0')]});})[_0x3982('0x25')](function(_0x25e778){_0x1e5f8c[_0x3982('0x2d')]=_0x25e778;if(_0x1e5f8c[_0x3982('0x98')][_0x3982('0xa1')]){return db[_0x3982('0xa2')][_0x3982('0x60')]({'attributes':['id',_0x3982('0x3c')],'where':{'id':_0x1e5f8c[_0x3982('0x98')][_0x3982('0xa1')]}})['then'](function(_0x125c36){if(_0x125c36){_0x1e5f8c['applications'][_0x3982('0xa3')]({'id':0x0,'priority':0x0,'app':_0x3982('0xa4'),'appdata':_0x125c36[_0x3982('0x3c')]+','+(_0x1e5f8c[_0x3982('0x8d')][_0x3982('0xa5')]||0xa),'interval':_0x3982('0x9e')});_0x1e5f8c['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0x3982('0xa6'),_0x1e5f8c);});}return respondWithRpcPromise('Start',_0x3982('0xa6'),_0x1e5f8c);})['then'](function(_0x2b0093){respondWithRpcPromise(_0x3982('0xa7'),_0x3982('0xa7'),{'event':'notify','message':_0x2b0093},client9002);return _0x2b0093;})[_0x3982('0x25')](respondWithResult(_0x4a1997,null))[_0x3982('0x61')](handleError(_0x4a1997,null));};exports[_0x3982('0xa8')]=function(_0x1805f2,_0x4217d3,_0x525cf3){return db['OpenchannelAccount'][_0x3982('0x6c')]({'where':{'id':_0x1805f2['params']['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x4217d3,null))[_0x3982('0x25')](function(_0x361b23){if(_0x361b23){return db[_0x3982('0xa9')][_0x3982('0xaa')](function(_0x41b9f4){return db[_0x3982('0x86')][_0x3982('0x37')]({'where':{'OpenchannelAccountId':_0x1805f2[_0x3982('0x5c')]['id']},'transaction':_0x41b9f4})[_0x3982('0x25')](function(_0x5aee17){var _0x401402=_[_0x3982('0x41')](_0x1805f2[_0x3982('0x68')],function(_0x40bf41){_0x40bf41[_0x3982('0x72')]=_0x1805f2[_0x3982('0x5c')]['id'];return _0x40bf41;});return db['OpenchannelApplication'][_0x3982('0xab')](_0x401402,{'transaction':_0x41b9f4});});})[_0x3982('0x25')](function(){return db[_0x3982('0x86')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x1805f2[_0x3982('0x5c')]['id']},'order':'priority'});});}})[_0x3982('0x25')](respondWithResult(_0x4217d3,null))['catch'](handleError(_0x4217d3,null));};exports[_0x3982('0xac')]=function(_0x161337,_0x323707,_0x11479f){var _0x1c1330={};var _0x537fab={};var _0x54a012;var _0x4ebd47;return db[_0x3982('0x42')][_0x3982('0x6c')]({'where':{'id':_0x161337[_0x3982('0x5c')]['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x323707,null))[_0x3982('0x25')](function(_0x2843e9){if(_0x2843e9){_0x54a012=_0x2843e9;_0x537fab[_0x3982('0x47')]=_['keys'](db[_0x3982('0x86')][_0x3982('0x43')]);_0x537fab[_0x3982('0x49')]=_[_0x3982('0x48')](_0x161337['query']);_0x537fab['filters']=_[_0x3982('0x4b')](_0x537fab[_0x3982('0x47')],_0x537fab[_0x3982('0x49')]);_0x1c1330['attributes']=_[_0x3982('0x4b')](_0x537fab['model'],qs[_0x3982('0x4d')](_0x161337[_0x3982('0x49')][_0x3982('0x4d')]));_0x1c1330['attributes']=_0x1c1330[_0x3982('0x4c')]['length']?_0x1c1330[_0x3982('0x4c')]:_0x537fab[_0x3982('0x47')];_0x1c1330[_0x3982('0x52')]=qs[_0x3982('0x53')](_0x161337[_0x3982('0x49')][_0x3982('0x53')]);_0x1c1330[_0x3982('0x55')]=qs[_0x3982('0x4a')](_[_0x3982('0xad')](_0x161337[_0x3982('0x49')],_0x537fab['filters']));if(_0x161337[_0x3982('0x49')]['filter']){_0x1c1330[_0x3982('0x55')]=_['merge'](_0x1c1330[_0x3982('0x55')],{'$or':_[_0x3982('0x41')](_0x1c1330['attributes'],function(_0x21b8ae){var _0x4aada6={};_0x4aada6[_0x21b8ae]={'$like':'%'+_0x161337['query'][_0x3982('0x54')]+'%'};return _0x4aada6;})});}_0x1c1330=_[_0x3982('0x56')]({},_0x1c1330,_0x161337['options']);return _0x54a012[_0x3982('0xac')](_0x1c1330);}})[_0x3982('0x25')](function(_0x2ff18f){if(_0x2ff18f){_0x4ebd47=_0x2ff18f[_0x3982('0x4e')];if(!_0x161337[_0x3982('0x49')][_0x3982('0x4f')]('nolimit')){_0x1c1330[_0x3982('0x51')]=qs[_0x3982('0x51')](_0x161337[_0x3982('0x49')][_0x3982('0x51')]);_0x1c1330[_0x3982('0x32')]=qs[_0x3982('0x32')](_0x161337[_0x3982('0x49')]['offset']);}return _0x54a012[_0x3982('0xac')](_0x1c1330);}})[_0x3982('0x25')](function(_0x2f484c){if(_0x2f484c){return _0x2f484c?{'count':_0x4ebd47,'rows':_0x2f484c}:null;}})[_0x3982('0x25')](respondWithResult(_0x323707,null))[_0x3982('0x61')](handleError(_0x323707,null));};exports[_0x3982('0xae')]=function(_0x97c757,_0x36247b,_0x2af717){var _0x5bd65e={'raw':![],'where':{}};var _0x424fd1={};var _0x5aa1e2={'count':0x0,'rows':[]};return db[_0x3982('0x42')]['findOne']({'where':{'id':_0x97c757[_0x3982('0x5c')]['id']}})['then'](handleEntityNotFound(_0x36247b,null))[_0x3982('0x25')](function(_0xf4f8dc){if(_0xf4f8dc){_0x424fd1[_0x3982('0x47')]=_[_0x3982('0x48')](db[_0x3982('0x93')]['rawAttributes']);_0x424fd1[_0x3982('0x49')]=_[_0x3982('0x48')](_0x97c757[_0x3982('0x49')]);_0x424fd1[_0x3982('0x4a')]=_[_0x3982('0x4b')](_0x424fd1[_0x3982('0x47')],_0x424fd1[_0x3982('0x49')]);_0x5bd65e[_0x3982('0x4c')]=_[_0x3982('0x4b')](_0x424fd1[_0x3982('0x47')],qs['fields'](_0x97c757[_0x3982('0x49')][_0x3982('0x4d')]));_0x5bd65e[_0x3982('0x4c')]=_0x5bd65e[_0x3982('0x4c')][_0x3982('0x4e')]?_0x5bd65e[_0x3982('0x4c')]:_0x424fd1[_0x3982('0x47')];if(!_0x97c757[_0x3982('0x49')][_0x3982('0x4f')](_0x3982('0x50'))){_0x5bd65e[_0x3982('0x51')]=qs[_0x3982('0x51')](_0x97c757[_0x3982('0x49')][_0x3982('0x51')]);_0x5bd65e['offset']=qs['offset'](_0x97c757[_0x3982('0x49')][_0x3982('0x32')]);}_0x5bd65e[_0x3982('0x52')]=qs[_0x3982('0x53')](_0x97c757['query'][_0x3982('0x53')]);_0x5bd65e[_0x3982('0x55')]=qs[_0x3982('0x4a')](_[_0x3982('0xad')](_0x97c757[_0x3982('0x49')],_0x424fd1[_0x3982('0x4a')]));_0x5bd65e[_0x3982('0x55')]['OpenchannelAccountId']=_0xf4f8dc['id'];if(_0x97c757[_0x3982('0x49')][_0x3982('0x54')]){_0x5bd65e[_0x3982('0x55')]=_['merge'](_0x5bd65e[_0x3982('0x55')],{'$or':_[_0x3982('0x41')](_0x5bd65e[_0x3982('0x4c')],function(_0x50db53){var _0x144c2e={};_0x144c2e[_0x50db53]={'$like':'%'+_0x97c757[_0x3982('0x49')][_0x3982('0x54')]+'%'};return _0x144c2e;})});}_0x5bd65e=_[_0x3982('0x56')]({},_0x5bd65e,_0x97c757[_0x3982('0x5f')]);return db[_0x3982('0x93')]['count']({'where':_0x5bd65e['where']})['then'](function(_0x2387c4){_0x5aa1e2[_0x3982('0x58')]=_0x2387c4;if(_0x97c757[_0x3982('0x49')][_0x3982('0x5d')]){_0x5bd65e[_0x3982('0x5e')]=[{'model':db[_0x3982('0x75')],'as':_0x3982('0xaf'),'required':![]},{'model':db['User'],'as':_0x3982('0xb0'),'attributes':[_0x3982('0x3c'),_0x3982('0xb1'),_0x3982('0xb2')],'required':![]},{'model':db[_0x3982('0xb3')],'as':'Tags','attributes':['id',_0x3982('0x3c'),_0x3982('0xb4')],'where':_0x97c757[_0x3982('0x49')][_0x3982('0xb5')]?{'id':_0x97c757[_0x3982('0x49')]['tag']}:undefined,'required':_0x97c757[_0x3982('0x49')][_0x3982('0xb5')]?!![]:![]}];}return db[_0x3982('0x93')][_0x3982('0x59')](_0x5bd65e);})[_0x3982('0x25')](function(_0x127adb){_0x5aa1e2[_0x3982('0x5a')]=_0x127adb;return _0x5aa1e2;});}})[_0x3982('0x25')](respondWithFilteredResult(_0x36247b,_0x5bd65e))[_0x3982('0x61')](handleError(_0x36247b,null));};exports[_0x3982('0xb6')]=function(_0x26e40d,_0xa1d70a,_0x5368e6){return db[_0x3982('0x42')][_0x3982('0x60')]({'where':{'id':_0x26e40d[_0x3982('0x5c')]['id']}})[_0x3982('0x25')](handleEntityNotFound(_0xa1d70a,null))['then'](function(_0x4ea16f){if(_0x4ea16f){return _0x4ea16f['addAgents'](_0x26e40d[_0x3982('0x68')][_0x3982('0x6e')],_[_0x3982('0xb7')](_0x26e40d[_0x3982('0x68')],['ids','id'])||{})[_0x3982('0x95')](function(_0xeee5e){for(var _0x271543=0x0;_0x271543<_0x26e40d[_0x3982('0x68')]['ids'][_0x3982('0x4e')];_0x271543+=0x1){socket[_0x3982('0xb8')]('userOpenchannelAccount:save',{'UserId':_0x26e40d[_0x3982('0x68')][_0x3982('0x6e')][_0x271543],'OpenchannelAccountId':_0x26e40d[_0x3982('0x5c')]['id']});}return _0xeee5e;});}})[_0x3982('0x25')](respondWithResult(_0xa1d70a,null))[_0x3982('0x61')](handleError(_0xa1d70a,null));};exports[_0x3982('0xb9')]=function(_0x271337,_0x3c3b2e,_0x5d536e){return db[_0x3982('0x42')][_0x3982('0x60')]({'where':{'id':_0x271337[_0x3982('0x5c')]['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x3c3b2e,null))['then'](function(_0x8b8f11){if(_0x8b8f11){return _0x8b8f11[_0x3982('0xb9')](_0x271337[_0x3982('0x49')]['ids'])[_0x3982('0x25')](function(){if(_[_0x3982('0xba')](_0x271337[_0x3982('0x49')][_0x3982('0x6e')])){for(var _0x220747=0x0;_0x220747<_0x271337[_0x3982('0x49')]['ids'][_0x3982('0x4e')];_0x220747+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x271337['query'][_0x3982('0x6e')][_0x220747]),'OpenchannelAccountId':Number(_0x271337[_0x3982('0x5c')]['id'])});}}else{socket[_0x3982('0xb8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x271337[_0x3982('0x49')]['ids']),'OpenchannelAccountId':Number(_0x271337[_0x3982('0x5c')]['id'])});}});}})[_0x3982('0x25')](respondWithStatusCode(_0x3c3b2e,null))[_0x3982('0x61')](handleError(_0x3c3b2e,null));};exports['getAgents']=function(_0x1679e4,_0x1fadea,_0xf4ff80){var _0x5a7e8b={};var _0x42bf27={};var _0x37e272;var _0x4b653c;return db[_0x3982('0x42')][_0x3982('0x6c')]({'where':{'id':_0x1679e4[_0x3982('0x5c')]['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x1fadea,null))[_0x3982('0x25')](function(_0x38d6b1){if(_0x38d6b1){_0x37e272=_0x38d6b1;_0x42bf27['model']=_['keys'](db[_0x3982('0xa2')][_0x3982('0x43')]);_0x42bf27[_0x3982('0x49')]=_[_0x3982('0x48')](_0x1679e4['query']);_0x42bf27[_0x3982('0x4a')]=_['intersection'](_0x42bf27[_0x3982('0x47')],_0x42bf27[_0x3982('0x49')]);_0x5a7e8b[_0x3982('0x4c')]=_[_0x3982('0x4b')](_0x42bf27['model'],qs['fields'](_0x1679e4['query']['fields']));_0x5a7e8b[_0x3982('0x4c')]=_0x5a7e8b[_0x3982('0x4c')][_0x3982('0x4e')]?_0x5a7e8b[_0x3982('0x4c')]:_0x42bf27[_0x3982('0x47')];_0x5a7e8b[_0x3982('0x52')]=qs[_0x3982('0x53')](_0x1679e4[_0x3982('0x49')][_0x3982('0x53')]);_0x5a7e8b[_0x3982('0x55')]=qs[_0x3982('0x4a')](_[_0x3982('0xad')](_0x1679e4[_0x3982('0x49')],_0x42bf27[_0x3982('0x4a')]));if(_0x1679e4[_0x3982('0x49')][_0x3982('0x54')]){_0x5a7e8b[_0x3982('0x55')]=_[_0x3982('0x56')](_0x5a7e8b['where'],{'$or':_[_0x3982('0x41')](_0x5a7e8b[_0x3982('0x4c')],function(_0x3f3167){var _0x477e5c={};_0x477e5c[_0x3f3167]={'$like':'%'+_0x1679e4[_0x3982('0x49')][_0x3982('0x54')]+'%'};return _0x477e5c;})});}_0x5a7e8b=_['merge']({},_0x5a7e8b,_0x1679e4[_0x3982('0x5f')]);return _0x37e272[_0x3982('0xbb')](_0x5a7e8b);}})[_0x3982('0x25')](function(_0x3703d4){if(_0x3703d4){_0x4b653c=_0x3703d4[_0x3982('0x4e')];if(!_0x1679e4[_0x3982('0x49')][_0x3982('0x4f')](_0x3982('0x50'))){_0x5a7e8b[_0x3982('0x51')]=qs[_0x3982('0x51')](_0x1679e4[_0x3982('0x49')][_0x3982('0x51')]);_0x5a7e8b[_0x3982('0x32')]=qs['offset'](_0x1679e4[_0x3982('0x49')][_0x3982('0x32')]);}return _0x37e272[_0x3982('0xbb')](_0x5a7e8b);}})[_0x3982('0x25')](function(_0x30609e){if(_0x30609e){return _0x30609e?{'count':_0x4b653c,'rows':_0x30609e}:null;}})[_0x3982('0x25')](respondWithResult(_0x1fadea,null))[_0x3982('0x61')](handleError(_0x1fadea,null));};exports['send']=function(_0x358947,_0x56c672,_0x5c3cd8){var _0x9aea32,_0x571acc,_0x3837ad;if(_['isNil'](_0x358947[_0x3982('0x68')][_0x3982('0x68')])||_0x358947[_0x3982('0x68')][_0x3982('0x68')]===''){throw new db[(_0x3982('0x22'))]['ValidationError'](_0x3982('0xbc'));}if(_[_0x3982('0x7e')](_0x358947[_0x3982('0x68')]['to'])){}_0x9aea32=_0x358947[_0x3982('0x68')]['to'];return db[_0x3982('0x42')][_0x3982('0x6c')]({'where':{'id':_0x358947[_0x3982('0x5c')]['id']}})[_0x3982('0x25')](handleEntityNotFound(_0x56c672,null))[_0x3982('0x25')](function(_0x5ff47c){if(_0x5ff47c){return db[_0x3982('0x42')][_0x3982('0x60')]({'where':{'id':_0x5ff47c['id']},'include':[{'model':db[_0x3982('0x83')],'as':_0x3982('0x84'),'include':[{'model':db[_0x3982('0x75')],'as':_0x3982('0x85'),'where':{[_0x5ff47c[_0x3982('0x7f')]]:_0x9aea32},'limit':0x1,'order':[['updatedAt',_0x3982('0xbd')]]}]}]})[_0x3982('0x25')](handleEntityNotFound(_0x56c672,null))[_0x3982('0x25')](function(_0x14c3bb){if(_0x14c3bb&&_0x14c3bb[_0x3982('0x84')]){_0x571acc=_0x14c3bb[_0x3982('0x38')]({'plain':!![]});if(_0x571acc[_0x3982('0x84')]&&_0x571acc['List'][_0x3982('0x85')][_0x3982('0x4e')]){return _0x571acc[_0x3982('0x84')][_0x3982('0x85')][0x0];}return db[_0x3982('0x75')][_0x3982('0x62')](_[_0x3982('0x8e')](_0x358947['body'],{'firstName':_0x9aea32,[_0x14c3bb['mapKey']]:_0x9aea32,'phone':_0x9aea32,'ListId':_0x571acc['ListId']}));}})[_0x3982('0x25')](handleEntityNotFound(_0x56c672,null))[_0x3982('0x25')](function(_0x16cdf8){if(_0x16cdf8){_0x3837ad=_0x16cdf8;return db['OpenchannelInteraction'][_0x3982('0x60')]({'where':{'ContactId':_0x3837ad['id'],'closed':![],'OpenchannelAccountId':_0x571acc['id']}})[_0x3982('0x25')](function(_0x30bdc1){if(_0x30bdc1){return[_0x30bdc1,![]];}return db[_0x3982('0x93')]['create']({'UserId':_0x358947['user']['id'],'ContactId':_0x3837ad['id'],'OpenchannelAccountId':_0x571acc['id'],'lastMsgDirection':_0x3982('0xbe'),'Messages':[_[_0x3982('0x56')](_0x358947[_0x3982('0x68')],{'read':![],'body':_0x358947['body'][_0x3982('0x68')],'OpenchannelAccountId':_0x571acc['id'],'UserId':_0x358947[_0x3982('0x63')]['id'],'ContactId':_0x3837ad['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x3982('0xbf')}]})['then'](function(_0xebd55f){return[_0xebd55f,!![]];});});}})[_0x3982('0x95')](function(_0xc3c6bd,_0x574945){if(_0x574945){return _0xc3c6bd;}return db[_0x3982('0x9f')][_0x3982('0x62')](_['merge'](_0x358947[_0x3982('0x68')],{'read':![],'body':_0x358947[_0x3982('0x68')][_0x3982('0x68')],'OpenchannelAccountId':_0x571acc['id'],'OpenchannelInteractionId':_0xc3c6bd['id'],'UserId':_0x358947[_0x3982('0x63')]['id'],'ContactId':_0x3837ad['id']}))[_0x3982('0x25')](function(_0xeb2caa){_0xc3c6bd[_0x3982('0xc0')][_0x3982('0xbf')]=[];_0xc3c6bd['dataValues'][_0x3982('0xbf')]['push'](_0xeb2caa[_0x3982('0xc0')]);return _0xc3c6bd;});});}})[_0x3982('0x25')](respondWithResult(_0x56c672,null))[_0x3982('0x61')](handleError(_0x56c672,null));};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js
index 94b3f06..8f4e23a 100644
--- a/server/api/openchannelAccount/openchannelAccount.events.js
+++ b/server/api/openchannelAccount/openchannelAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5247=['update','emit','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x5247,0x1f3));var _0x7524=function(_0xe9623b,_0x195170){_0xe9623b=_0xe9623b-0x0;var _0x222b5c=_0x5247[_0xe9623b];return _0x222b5c;};'use strict';var EventEmitter=require(_0x7524('0x0'));var OpenchannelAccount=require(_0x7524('0x1'))['db'][_0x7524('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7524('0x3')](0x0);var events={'afterCreate':_0x7524('0x4'),'afterUpdate':_0x7524('0x5'),'afterDestroy':'remove'};function emitEvent(_0x473d1c){return function(_0x73183b,_0x9b232a,_0xf5bbdc){OpenchannelAccountEvents[_0x7524('0x6')](_0x473d1c+':'+_0x73183b['id'],_0x73183b);OpenchannelAccountEvents[_0x7524('0x6')](_0x473d1c,_0x73183b);_0xf5bbdc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x7524('0x7')](e,emitEvent(event));}}module[_0x7524('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xba64=['../../mysqldb','OpenchannelAccount','update','emit','hasOwnProperty','hook','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xba64,0x93));var _0x4ba6=function(_0x356fbc,_0x38923c){_0x356fbc=_0x356fbc-0x0;var _0x59e588=_0xba64[_0x356fbc];return _0x59e588;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x4ba6('0x0'))['db'][_0x4ba6('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4ba6('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2245bb){return function(_0x3183ae,_0x56151e,_0x349230){OpenchannelAccountEvents[_0x4ba6('0x3')](_0x2245bb+':'+_0x3183ae['id'],_0x3183ae);OpenchannelAccountEvents[_0x4ba6('0x3')](_0x2245bb,_0x3183ae);_0x349230(null);};}for(var e in events){if(events[_0x4ba6('0x4')](e)){var event=events[e];OpenchannelAccount[_0x4ba6('0x5')](e,emitEvent(event));}}module[_0x4ba6('0x6')]=OpenchannelAccountEvents;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js
index 1cbc0f9..4c10b3c 100644
--- a/server/api/openchannelAccount/openchannelAccount.model.js
+++ b/server/api/openchannelAccount/openchannelAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe632=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','openchannel_accounts'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0xe632,0x113));var _0x2e63=function(_0x2527d0,_0x57bace){_0x2527d0=_0x2527d0-0x0;var _0x48e377=_0xe632[_0x2527d0];return _0x48e377;};'use strict';var _=require(_0x2e63('0x0'));var util=require(_0x2e63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2e63('0x2'));var BPromise=require(_0x2e63('0x3'));var rp=require(_0x2e63('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e63('0x5'));var config=require(_0x2e63('0x6'));var attributes=require(_0x2e63('0x7'));module[_0x2e63('0x8')]=function(_0x51c349,_0xd15dd5){return _0x51c349[_0x2e63('0x9')]('OpenchannelAccount',attributes,{'tableName':_0x2e63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cdc=['define','openchannel_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports'];(function(_0x3d43da,_0x439938){var _0x65d011=function(_0x1bd985){while(--_0x1bd985){_0x3d43da['push'](_0x3d43da['shift']());}};_0x65d011(++_0x439938);}(_0x7cdc,0x1de));var _0xc7cd=function(_0x50d766,_0x250d83){_0x50d766=_0x50d766-0x0;var _0x57a01c=_0x7cdc[_0x50d766];return _0x57a01c;};'use strict';var _=require(_0xc7cd('0x0'));var util=require(_0xc7cd('0x1'));var logger=require(_0xc7cd('0x2'))(_0xc7cd('0x3'));var moment=require(_0xc7cd('0x4'));var BPromise=require(_0xc7cd('0x5'));var rp=require(_0xc7cd('0x6'));var fs=require('fs');var path=require(_0xc7cd('0x7'));var rimraf=require(_0xc7cd('0x8'));var config=require(_0xc7cd('0x9'));var attributes=require(_0xc7cd('0xa'));module[_0xc7cd('0xb')]=function(_0x16e472,_0x49cb8f){return _0x16e472[_0xc7cd('0xc')]('OpenchannelAccount',attributes,{'tableName':_0xc7cd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js
index 7bf1764..7faba5b 100644
--- a/server/api/openchannelAccount/openchannelAccount.rpc.js
+++ b/server/api/openchannelAccount/openchannelAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe7c5=['error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xe7c5,0x162));var _0x5e7c=function(_0x2e9dba,_0x40b21e){_0x2e9dba=_0x2e9dba-0x0;var _0x3e24a3=_0xe7c5[_0x2e9dba];return _0x3e24a3;};'use strict';var _=require(_0x5e7c('0x0'));var util=require(_0x5e7c('0x1'));var moment=require(_0x5e7c('0x2'));var BPromise=require(_0x5e7c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5e7c('0x5'))('rpc');var config=require(_0x5e7c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5e7c('0x7')]({'port':0x232a});config['redis']=_[_0x5e7c('0x8')](config[_0x5e7c('0x9')],{'host':_0x5e7c('0xa'),'port':0x18eb});var socket=require(_0x5e7c('0xb'))(new Redis(config[_0x5e7c('0x9')]));require(_0x5e7c('0xc'))[_0x5e7c('0xd')](socket);function respondWithRpcPromise(_0x14f5fe,_0x5294c5,_0x20ee48){return new BPromise(function(_0x53661b,_0x532728){return client[_0x5e7c('0xe')](_0x14f5fe,_0x20ee48)[_0x5e7c('0xf')](function(_0x187fa3){logger[_0x5e7c('0x10')](_0x5e7c('0x11'),_0x5294c5,_0x5e7c('0x12'));logger['debug'](_0x5e7c('0x13'),_0x5294c5,_0x5e7c('0x12'),JSON[_0x5e7c('0x14')](_0x187fa3));if(_0x187fa3[_0x5e7c('0x15')]){if(_0x187fa3['error'][_0x5e7c('0x16')]===0x1f4){logger['error'](_0x5e7c('0x11'),_0x5294c5,_0x187fa3[_0x5e7c('0x15')][_0x5e7c('0x17')]);return _0x532728(_0x187fa3['error'][_0x5e7c('0x17')]);}logger['error'](_0x5e7c('0x11'),_0x5294c5,_0x187fa3[_0x5e7c('0x15')]['message']);return _0x53661b(_0x187fa3[_0x5e7c('0x15')]['message']);}else{logger['info'](_0x5e7c('0x11'),_0x5294c5,_0x5e7c('0x12'));_0x53661b(_0x187fa3[_0x5e7c('0x18')][_0x5e7c('0x17')]);}})['catch'](function(_0x55dc4b){logger[_0x5e7c('0x15')](_0x5e7c('0x11'),_0x5294c5,_0x55dc4b);_0x532728(_0x55dc4b);});});}
\ No newline at end of file
+var _0x91ea=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis'];(function(_0x86794c,_0x5df4b0){var _0x2ea7a8=function(_0x17a723){while(--_0x17a723){_0x86794c['push'](_0x86794c['shift']());}};_0x2ea7a8(++_0x5df4b0);}(_0x91ea,0x141));var _0xa91e=function(_0x173f6d,_0x45dc8b){_0x173f6d=_0x173f6d-0x0;var _0x36e9f2=_0x91ea[_0x173f6d];return _0x36e9f2;};'use strict';var _=require(_0xa91e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa91e('0x1'));var rs=require(_0xa91e('0x2'));var fs=require('fs');var Redis=require(_0xa91e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa91e('0x4'));var logger=require(_0xa91e('0x5'))(_0xa91e('0x6'));var config=require(_0xa91e('0x7'));var jayson=require(_0xa91e('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xa91e('0x9')]=_[_0xa91e('0xa')](config[_0xa91e('0x9')],{'host':_0xa91e('0xb'),'port':0x18eb});var socket=require(_0xa91e('0xc'))(new Redis(config['redis']));require(_0xa91e('0xd'))[_0xa91e('0xe')](socket);function respondWithRpcPromise(_0x449be9,_0x5d40f0,_0x283699){return new BPromise(function(_0x45f449,_0x5356b0){return client['request'](_0x449be9,_0x283699)['then'](function(_0x2717b9){logger[_0xa91e('0xf')](_0xa91e('0x10'),_0x5d40f0,_0xa91e('0x11'));logger[_0xa91e('0x12')](_0xa91e('0x13'),_0x5d40f0,_0xa91e('0x11'),JSON[_0xa91e('0x14')](_0x2717b9));if(_0x2717b9['error']){if(_0x2717b9[_0xa91e('0x15')][_0xa91e('0x16')]===0x1f4){logger['error'](_0xa91e('0x10'),_0x5d40f0,_0x2717b9[_0xa91e('0x15')][_0xa91e('0x17')]);return _0x5356b0(_0x2717b9[_0xa91e('0x15')][_0xa91e('0x17')]);}logger[_0xa91e('0x15')](_0xa91e('0x10'),_0x5d40f0,_0x2717b9[_0xa91e('0x15')][_0xa91e('0x17')]);return _0x45f449(_0x2717b9[_0xa91e('0x15')]['message']);}else{logger[_0xa91e('0xf')](_0xa91e('0x10'),_0x5d40f0,_0xa91e('0x11'));_0x45f449(_0x2717b9[_0xa91e('0x18')][_0xa91e('0x17')]);}})['catch'](function(_0x563e47){logger['error'](_0xa91e('0x10'),_0x5d40f0,_0x563e47);_0x5356b0(_0x563e47);});});}
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js
index a73b9f1..3703707 100644
--- a/server/api/openchannelAccount/openchannelAccount.socket.js
+++ b/server/api/openchannelAccount/openchannelAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe030=['remove','update','register','length','./openchannelAccount.events','save'];(function(_0xa49b00,_0x15dc38){var _0x17aeab=function(_0x15504c){while(--_0x15504c){_0xa49b00['push'](_0xa49b00['shift']());}};_0x17aeab(++_0x15dc38);}(_0xe030,0xdc));var _0x0e03=function(_0xd63b06,_0x34850f){_0xd63b06=_0xd63b06-0x0;var _0x343035=_0xe030[_0xd63b06];return _0x343035;};'use strict';var OpenchannelAccountEvents=require(_0x0e03('0x0'));var events=[_0x0e03('0x1'),_0x0e03('0x2'),_0x0e03('0x3')];function createListener(_0x4a99b9,_0x33a7a7){return function(_0x2f45f7){_0x33a7a7['emit'](_0x4a99b9,_0x2f45f7);};}function removeListener(_0x533429,_0x36fa8c){return function(){OpenchannelAccountEvents['removeListener'](_0x533429,_0x36fa8c);};}exports[_0x0e03('0x4')]=function(_0x5232d0){for(var _0x1cbb58=0x0,_0x57c33b=events[_0x0e03('0x5')];_0x1cbb58<_0x57c33b;_0x1cbb58++){var _0x26bf69=events[_0x1cbb58];var _0x394244=createListener('openchannelAccount:'+_0x26bf69,_0x5232d0);OpenchannelAccountEvents['on'](_0x26bf69,_0x394244);}};
\ No newline at end of file
+var _0x334a=['update','emit','removeListener','./openchannelAccount.events','remove'];(function(_0x4c207f,_0x420bff){var _0x3c1fe1=function(_0x57ed2a){while(--_0x57ed2a){_0x4c207f['push'](_0x4c207f['shift']());}};_0x3c1fe1(++_0x420bff);}(_0x334a,0x8f));var _0xa334=function(_0x5e715b,_0x96d5b1){_0x5e715b=_0x5e715b-0x0;var _0x430419=_0x334a[_0x5e715b];return _0x430419;};'use strict';var OpenchannelAccountEvents=require(_0xa334('0x0'));var events=['save',_0xa334('0x1'),_0xa334('0x2')];function createListener(_0x20487b,_0x2f51ec){return function(_0x1131b5){_0x2f51ec[_0xa334('0x3')](_0x20487b,_0x1131b5);};}function removeListener(_0x58a8d0,_0x27ed30){return function(){OpenchannelAccountEvents[_0xa334('0x4')](_0x58a8d0,_0x27ed30);};}exports['register']=function(_0x4e6f0b){for(var _0x4a3cc2=0x0,_0x17ceb9=events['length'];_0x4a3cc2<_0x17ceb9;_0x4a3cc2++){var _0x326370=events[_0x4a3cc2];var _0x886ff8=createListener('openchannelAccount:'+_0x326370,_0x4e6f0b);OpenchannelAccountEvents['on'](_0x326370,_0x886ff8);}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js
index 712fff1..6385efd 100644
--- a/server/api/openchannelApplication/index.js
+++ b/server/api/openchannelApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49b1=['delete','destroy','exports','util','path','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','isAuthenticated','show','post','put','/:id','update'];(function(_0x34cea1,_0x16d860){var _0x2d796a=function(_0x11e340){while(--_0x11e340){_0x34cea1['push'](_0x34cea1['shift']());}};_0x2d796a(++_0x16d860);}(_0x49b1,0x133));var _0x149b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49b1[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x149b('0x0'));var path=require(_0x149b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x149b('0x2'));var config=require(_0x149b('0x3'));var controller=require(_0x149b('0x4'));router[_0x149b('0x5')]('/',auth['isAuthenticated'](),controller[_0x149b('0x6')]);router['get']('/:id',auth[_0x149b('0x7')](),controller[_0x149b('0x8')]);router[_0x149b('0x9')]('/',auth[_0x149b('0x7')](),controller['create']);router[_0x149b('0xa')](_0x149b('0xb'),auth[_0x149b('0x7')](),controller[_0x149b('0xc')]);router[_0x149b('0xd')](_0x149b('0xb'),auth['isAuthenticated'](),controller[_0x149b('0xe')]);module[_0x149b('0xf')]=router;
\ No newline at end of file
+var _0x26b7=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','index','get','show','post','isAuthenticated','create','put','/:id','destroy','exports','multer','util'];(function(_0xabd28d,_0x4970f9){var _0x5de556=function(_0x34b0a1){while(--_0x34b0a1){_0xabd28d['push'](_0xabd28d['shift']());}};_0x5de556(++_0x4970f9);}(_0x26b7,0xb9));var _0x726b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x26b7[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x726b('0x0'));var util=require(_0x726b('0x1'));var path=require('path');var timeout=require(_0x726b('0x2'));var express=require('express');var router=express[_0x726b('0x3')]();var auth=require(_0x726b('0x4'));var interaction=require(_0x726b('0x5'));var config=require('../../config/environment');var controller=require(_0x726b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x726b('0x7')]);router[_0x726b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x726b('0x9')]);router[_0x726b('0xa')]('/',auth[_0x726b('0xb')](),controller[_0x726b('0xc')]);router[_0x726b('0xd')](_0x726b('0xe'),auth[_0x726b('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x726b('0xf')]);module[_0x726b('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js
index 512d29f..2540443 100644
--- a/server/api/openchannelApplication/openchannelApplication.attributes.js
+++ b/server/api/openchannelApplication/openchannelApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x21a6=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x360f8f,_0x8868be){var _0x48aa7b=function(_0x38e332){while(--_0x38e332){_0x360f8f['push'](_0x360f8f['shift']());}};_0x48aa7b(++_0x8868be);}(_0x21a6,0xf0));var _0x621a=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x21a6[_0x4e1a49];return _0x136aae;};'use strict';var Sequelize=require(_0x621a('0x0'));module[_0x621a('0x1')]={'priority':{'type':Sequelize[_0x621a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x621a('0x3')],'allowNull':![],'defaultValue':_0x621a('0x4')},'appdata':{'type':Sequelize[_0x621a('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x854f=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x1bd63d,_0x55b310){var _0x5e8074=function(_0x4ecce1){while(--_0x4ecce1){_0x1bd63d['push'](_0x1bd63d['shift']());}};_0x5e8074(++_0x55b310);}(_0x854f,0xc1));var _0xf854=function(_0xcdfa52,_0x5193d4){_0xcdfa52=_0xcdfa52-0x0;var _0x532f87=_0x854f[_0xcdfa52];return _0x532f87;};'use strict';var Sequelize=require(_0xf854('0x0'));module[_0xf854('0x1')]={'priority':{'type':Sequelize[_0xf854('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf854('0x3')],'allowNull':![],'defaultValue':_0xf854('0x4')},'appdata':{'type':Sequelize[_0xf854('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf854('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js
index af41dbc..3576499 100644
--- a/server/api/openchannelApplication/openchannelApplication.controller.js
+++ b/server/api/openchannelApplication/openchannelApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5cae=['ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','intersection','merge','catch','create','body','find','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0x3eed3f,_0x5253b5){var _0xd68fd8=function(_0x3395c4){while(--_0x3395c4){_0x3eed3f['push'](_0x3eed3f['shift']());}};_0xd68fd8(++_0x5253b5);}(_0x5cae,0x1b3));var _0xe5ca=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0x5cae[_0x118653];return _0xc11fa6;};'use strict';var pdf=require(_0xe5ca('0x0'));var emlformat=require(_0xe5ca('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe5ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5ca('0x3'));var moment=require(_0xe5ca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe5ca('0x5'));var util=require(_0xe5ca('0x6'));var path=require(_0xe5ca('0x7'));var sox=require(_0xe5ca('0x8'));var csv=require('to-csv');var ejs=require(_0xe5ca('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe5ca('0xa'));var crypto=require(_0xe5ca('0xb'));var jsforce=require(_0xe5ca('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe5ca('0xd'));var querystring=require(_0xe5ca('0xe'));var Papa=require(_0xe5ca('0xf'));var Redis=require('ioredis');var authService=require(_0xe5ca('0x10'));var qs=require(_0xe5ca('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe5ca('0x12'));var logger=require(_0xe5ca('0x13'))('api');var utils=require(_0xe5ca('0x14'));var config=require(_0xe5ca('0x15'));var db=require(_0xe5ca('0x16'))['db'];function respondWithStatusCode(_0x12d267,_0x50ee70){_0x50ee70=_0x50ee70||0xcc;return function(_0x130a84){if(_0x130a84){return _0x12d267[_0xe5ca('0x17')](_0x50ee70);}return _0x12d267['status'](_0x50ee70)[_0xe5ca('0x18')]();};}function respondWithResult(_0x2803d6,_0x1ab9d9){_0x1ab9d9=_0x1ab9d9||0xc8;return function(_0x228aa2){if(_0x228aa2){return _0x2803d6[_0xe5ca('0x19')](_0x1ab9d9)[_0xe5ca('0x1a')](_0x228aa2);}};}function respondWithFilteredResult(_0x43d1f1,_0x4cf01b){return function(_0x468e0a){if(_0x468e0a){var _0x339c74=_0x468e0a[_0xe5ca('0x1b')],_0x2c4d2e=_0x4cf01b[_0xe5ca('0x1c')],_0xc34521=_0x4cf01b[_0xe5ca('0x1c')]+_0x4cf01b[_0xe5ca('0x1d')],_0x5cd788;if(_0xc34521>=_0x339c74){_0xc34521=_0x339c74;_0x5cd788=0xc8;}else{_0x5cd788=0xce;}_0x43d1f1[_0xe5ca('0x19')](_0x5cd788);return _0x43d1f1[_0xe5ca('0x1e')]('Content-Range',_0x2c4d2e+'-'+_0xc34521+'/'+_0x339c74)['json'](_0x468e0a);}return null;};}function patchUpdates(_0xebba10){return function(_0x33d67e){try{jsonpatch[_0xe5ca('0x1f')](_0x33d67e,_0xebba10,!![]);}catch(_0x3e6288){return BPromise[_0xe5ca('0x20')](_0x3e6288);}return _0x33d67e[_0xe5ca('0x21')]();};}function saveUpdates(_0x2af6fd,_0x44350e){return function(_0x34bd1c){if(_0x34bd1c){return _0x34bd1c[_0xe5ca('0x22')](_0x2af6fd)[_0xe5ca('0x23')](function(_0x433b9e){return _0x433b9e;});}return null;};}function removeEntity(_0x3bb03c,_0x3dcd7f){return function(_0x2a76a9){if(_0x2a76a9){return _0x2a76a9[_0xe5ca('0x24')]()[_0xe5ca('0x23')](function(){_0x3bb03c[_0xe5ca('0x19')](0xcc)[_0xe5ca('0x18')]();});}};}function handleEntityNotFound(_0x1c2345,_0xd4c64){return function(_0x3d91cb){if(!_0x3d91cb){_0x1c2345[_0xe5ca('0x17')](0x194);}return _0x3d91cb;};}function handleError(_0x266c6c,_0xcb92b5){_0xcb92b5=_0xcb92b5||0x1f4;return function(_0x377055){logger[_0xe5ca('0x25')](_0x377055[_0xe5ca('0x26')]);if(_0x377055['name']){delete _0x377055[_0xe5ca('0x27')];}_0x266c6c[_0xe5ca('0x19')](_0xcb92b5)[_0xe5ca('0x28')](_0x377055);};}exports[_0xe5ca('0x29')]=function(_0x112888,_0x5b3dfd){var _0x220b3c={},_0x2b1675={},_0x5cf6c5={'count':0x0,'rows':[]};var _0x12dae2=_[_0xe5ca('0x2a')](db[_0xe5ca('0x2b')]['rawAttributes'],function(_0x4895df){return{'name':_0x4895df[_0xe5ca('0x2c')],'type':_0x4895df[_0xe5ca('0x2d')][_0xe5ca('0x2e')]};});_0x2b1675[_0xe5ca('0x2f')]=_[_0xe5ca('0x2a')](_0x12dae2,_0xe5ca('0x27'));_0x2b1675[_0xe5ca('0x30')]=_[_0xe5ca('0x31')](_0x112888[_0xe5ca('0x30')]);_0x2b1675[_0xe5ca('0x32')]=_['intersection'](_0x2b1675[_0xe5ca('0x2f')],_0x2b1675[_0xe5ca('0x30')]);_0x220b3c[_0xe5ca('0x33')]=_['intersection'](_0x2b1675['model'],qs[_0xe5ca('0x34')](_0x112888['query'][_0xe5ca('0x34')]));_0x220b3c['attributes']=_0x220b3c[_0xe5ca('0x33')][_0xe5ca('0x35')]?_0x220b3c[_0xe5ca('0x33')]:_0x2b1675[_0xe5ca('0x2f')];if(!_0x112888[_0xe5ca('0x30')][_0xe5ca('0x36')](_0xe5ca('0x37'))){_0x220b3c[_0xe5ca('0x1d')]=qs[_0xe5ca('0x1d')](_0x112888[_0xe5ca('0x30')][_0xe5ca('0x1d')]);_0x220b3c[_0xe5ca('0x1c')]=qs[_0xe5ca('0x1c')](_0x112888[_0xe5ca('0x30')][_0xe5ca('0x1c')]);}_0x220b3c[_0xe5ca('0x38')]=qs[_0xe5ca('0x39')](_0x112888[_0xe5ca('0x30')]['sort']);_0x220b3c[_0xe5ca('0x3a')]=qs[_0xe5ca('0x32')](_['pick'](_0x112888[_0xe5ca('0x30')],_0x2b1675[_0xe5ca('0x32')]),_0x12dae2);if(_0x112888[_0xe5ca('0x30')]['filter']){_0x220b3c[_0xe5ca('0x3a')]=_['merge'](_0x220b3c[_0xe5ca('0x3a')],{'$or':_[_0xe5ca('0x2a')](_0x12dae2,function(_0x5c57de){if(_0x5c57de['type']!==_0xe5ca('0x3b')){var _0x68294={};_0x68294[_0x5c57de[_0xe5ca('0x27')]]={'$like':'%'+_0x112888[_0xe5ca('0x30')][_0xe5ca('0x3c')]+'%'};return _0x68294;}})});}_0x220b3c=_['merge']({},_0x220b3c,_0x112888[_0xe5ca('0x3d')]);var _0x1e05dd={'where':_0x220b3c[_0xe5ca('0x3a')]};return db[_0xe5ca('0x2b')][_0xe5ca('0x1b')](_0x1e05dd)[_0xe5ca('0x23')](function(_0x413ef5){_0x5cf6c5[_0xe5ca('0x1b')]=_0x413ef5;if(_0x112888[_0xe5ca('0x30')][_0xe5ca('0x3e')]){_0x220b3c[_0xe5ca('0x3f')]=[{'all':!![]}];}return db[_0xe5ca('0x2b')][_0xe5ca('0x40')](_0x220b3c);})['then'](function(_0x57f4d){_0x5cf6c5[_0xe5ca('0x41')]=_0x57f4d;return _0x5cf6c5;})[_0xe5ca('0x23')](respondWithFilteredResult(_0x5b3dfd,_0x220b3c))['catch'](handleError(_0x5b3dfd,null));};exports[_0xe5ca('0x42')]=function(_0x1ec8fa,_0x589947){var _0xc2a783={'raw':!![],'where':{'id':_0x1ec8fa[_0xe5ca('0x43')]['id']}},_0x337914={};_0x337914[_0xe5ca('0x2f')]=_[_0xe5ca('0x31')](db[_0xe5ca('0x2b')]['rawAttributes']);_0x337914[_0xe5ca('0x30')]=_['keys'](_0x1ec8fa['query']);_0x337914[_0xe5ca('0x32')]=_[_0xe5ca('0x44')](_0x337914[_0xe5ca('0x2f')],_0x337914[_0xe5ca('0x30')]);_0xc2a783['attributes']=_[_0xe5ca('0x44')](_0x337914[_0xe5ca('0x2f')],qs[_0xe5ca('0x34')](_0x1ec8fa['query']['fields']));_0xc2a783['attributes']=_0xc2a783[_0xe5ca('0x33')][_0xe5ca('0x35')]?_0xc2a783[_0xe5ca('0x33')]:_0x337914[_0xe5ca('0x2f')];if(_0x1ec8fa[_0xe5ca('0x30')]['includeAll']){_0xc2a783[_0xe5ca('0x3f')]=[{'all':!![]}];}_0xc2a783=_[_0xe5ca('0x45')]({},_0xc2a783,_0x1ec8fa[_0xe5ca('0x3d')]);return db['OpenchannelApplication']['find'](_0xc2a783)['then'](handleEntityNotFound(_0x589947,null))[_0xe5ca('0x23')](respondWithResult(_0x589947,null))[_0xe5ca('0x46')](handleError(_0x589947,null));};exports[_0xe5ca('0x47')]=function(_0x4cbd80,_0x40698c){return db[_0xe5ca('0x2b')][_0xe5ca('0x47')](_0x4cbd80[_0xe5ca('0x48')],{})[_0xe5ca('0x23')](respondWithResult(_0x40698c,0xc9))[_0xe5ca('0x46')](handleError(_0x40698c,null));};exports[_0xe5ca('0x22')]=function(_0xe07fbe,_0x38b2cd){if(_0xe07fbe[_0xe5ca('0x48')]['id']){delete _0xe07fbe[_0xe5ca('0x48')]['id'];}return db[_0xe5ca('0x2b')][_0xe5ca('0x49')]({'where':{'id':_0xe07fbe[_0xe5ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x38b2cd,null))[_0xe5ca('0x23')](saveUpdates(_0xe07fbe['body'],null))[_0xe5ca('0x23')](respondWithResult(_0x38b2cd,null))[_0xe5ca('0x46')](handleError(_0x38b2cd,null));};exports[_0xe5ca('0x24')]=function(_0x4d2e5f,_0x549467){return db[_0xe5ca('0x2b')][_0xe5ca('0x49')]({'where':{'id':_0x4d2e5f[_0xe5ca('0x43')]['id']}})[_0xe5ca('0x23')](handleEntityNotFound(_0x549467,null))[_0xe5ca('0x23')](removeEntity(_0x549467,null))[_0xe5ca('0x46')](handleError(_0x549467,null));};
\ No newline at end of file
+var _0x8f2e=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','then','includeAll','include','findAll','rows','params','keys','find','catch','create','body','destroy','html-pdf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','update','end','error','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x15b6f8,_0x1c9077){var _0xd3a42a=function(_0x5b0355){while(--_0x5b0355){_0x15b6f8['push'](_0x15b6f8['shift']());}};_0xd3a42a(++_0x1c9077);}(_0x8f2e,0x12a));var _0xe8f2=function(_0x1a13f6,_0x1ae346){_0x1a13f6=_0x1a13f6-0x0;var _0xfb837a=_0x8f2e[_0x1a13f6];return _0xfb837a;};'use strict';var pdf=require(_0xe8f2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe8f2('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe8f2('0x2'));var Mustache=require(_0xe8f2('0x3'));var util=require(_0xe8f2('0x4'));var path=require('path');var sox=require(_0xe8f2('0x5'));var csv=require(_0xe8f2('0x6'));var ejs=require(_0xe8f2('0x7'));var fs=require('fs');var _=require(_0xe8f2('0x8'));var squel=require(_0xe8f2('0x9'));var crypto=require(_0xe8f2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe8f2('0xb'));var toCsv=require(_0xe8f2('0x6'));var querystring=require(_0xe8f2('0xc'));var Papa=require(_0xe8f2('0xd'));var Redis=require('ioredis');var authService=require(_0xe8f2('0xe'));var qs=require(_0xe8f2('0xf'));var as=require(_0xe8f2('0x10'));var hardwareService=require(_0xe8f2('0x11'));var logger=require('../../config/logger')(_0xe8f2('0x12'));var utils=require(_0xe8f2('0x13'));var config=require(_0xe8f2('0x14'));var db=require(_0xe8f2('0x15'))['db'];function respondWithStatusCode(_0xf5245,_0x3337e0){_0x3337e0=_0x3337e0||0xcc;return function(_0x58f169){if(_0x58f169){return _0xf5245[_0xe8f2('0x16')](_0x3337e0);}return _0xf5245[_0xe8f2('0x17')](_0x3337e0)['end']();};}function respondWithResult(_0x209827,_0x4e4d48){_0x4e4d48=_0x4e4d48||0xc8;return function(_0x27ea6c){if(_0x27ea6c){return _0x209827[_0xe8f2('0x17')](_0x4e4d48)[_0xe8f2('0x18')](_0x27ea6c);}};}function respondWithFilteredResult(_0x100f9f,_0x2f8350){return function(_0x12a24a){if(_0x12a24a){var _0x532413=_0x12a24a['count'],_0x25746f=_0x2f8350[_0xe8f2('0x19')],_0x504d47=_0x2f8350[_0xe8f2('0x19')]+_0x2f8350[_0xe8f2('0x1a')],_0x2d0e9c;if(_0x504d47>=_0x532413){_0x504d47=_0x532413;_0x2d0e9c=0xc8;}else{_0x2d0e9c=0xce;}_0x100f9f[_0xe8f2('0x17')](_0x2d0e9c);return _0x100f9f[_0xe8f2('0x1b')]('Content-Range',_0x25746f+'-'+_0x504d47+'/'+_0x532413)[_0xe8f2('0x18')](_0x12a24a);}return null;};}function patchUpdates(_0x17d007){return function(_0x17e45d){try{jsonpatch[_0xe8f2('0x1c')](_0x17e45d,_0x17d007,!![]);}catch(_0x7ad2b5){return BPromise['reject'](_0x7ad2b5);}return _0x17e45d['save']();};}function saveUpdates(_0x514166,_0x2adc9a){return function(_0x446bf1){if(_0x446bf1){return _0x446bf1[_0xe8f2('0x1d')](_0x514166)['then'](function(_0x2cfaeb){return _0x2cfaeb;});}return null;};}function removeEntity(_0x3d51a1,_0x5bc7cd){return function(_0x48288b){if(_0x48288b){return _0x48288b['destroy']()['then'](function(){_0x3d51a1['status'](0xcc)[_0xe8f2('0x1e')]();});}};}function handleEntityNotFound(_0x407d11,_0x2a613b){return function(_0x4a7cac){if(!_0x4a7cac){_0x407d11[_0xe8f2('0x16')](0x194);}return _0x4a7cac;};}function handleError(_0x177b42,_0x45fd88){_0x45fd88=_0x45fd88||0x1f4;return function(_0x35b322){logger[_0xe8f2('0x1f')](_0x35b322['stack']);if(_0x35b322[_0xe8f2('0x20')]){delete _0x35b322[_0xe8f2('0x20')];}_0x177b42['status'](_0x45fd88)[_0xe8f2('0x21')](_0x35b322);};}exports[_0xe8f2('0x22')]=function(_0x35a056,_0x2f05e2){var _0x17605d={},_0x45aeff={},_0x30d010={'count':0x0,'rows':[]};var _0x56786b=_['map'](db[_0xe8f2('0x23')][_0xe8f2('0x24')],function(_0x260b9d){return{'name':_0x260b9d[_0xe8f2('0x25')],'type':_0x260b9d[_0xe8f2('0x26')][_0xe8f2('0x27')]};});_0x45aeff[_0xe8f2('0x28')]=_['map'](_0x56786b,_0xe8f2('0x20'));_0x45aeff['query']=_['keys'](_0x35a056[_0xe8f2('0x29')]);_0x45aeff[_0xe8f2('0x2a')]=_[_0xe8f2('0x2b')](_0x45aeff['model'],_0x45aeff[_0xe8f2('0x29')]);_0x17605d['attributes']=_[_0xe8f2('0x2b')](_0x45aeff[_0xe8f2('0x28')],qs[_0xe8f2('0x2c')](_0x35a056[_0xe8f2('0x29')]['fields']));_0x17605d[_0xe8f2('0x2d')]=_0x17605d[_0xe8f2('0x2d')][_0xe8f2('0x2e')]?_0x17605d[_0xe8f2('0x2d')]:_0x45aeff['model'];if(!_0x35a056[_0xe8f2('0x29')][_0xe8f2('0x2f')]('nolimit')){_0x17605d['limit']=qs[_0xe8f2('0x1a')](_0x35a056[_0xe8f2('0x29')]['limit']);_0x17605d[_0xe8f2('0x19')]=qs[_0xe8f2('0x19')](_0x35a056[_0xe8f2('0x29')][_0xe8f2('0x19')]);}_0x17605d[_0xe8f2('0x30')]=qs[_0xe8f2('0x31')](_0x35a056['query'][_0xe8f2('0x31')]);_0x17605d[_0xe8f2('0x32')]=qs[_0xe8f2('0x2a')](_[_0xe8f2('0x33')](_0x35a056[_0xe8f2('0x29')],_0x45aeff[_0xe8f2('0x2a')]),_0x56786b);if(_0x35a056[_0xe8f2('0x29')][_0xe8f2('0x34')]){_0x17605d[_0xe8f2('0x32')]=_[_0xe8f2('0x35')](_0x17605d['where'],{'$or':_['map'](_0x56786b,function(_0x5c3e47){if(_0x5c3e47['type']!==_0xe8f2('0x36')){var _0x383c62={};_0x383c62[_0x5c3e47[_0xe8f2('0x20')]]={'$like':'%'+_0x35a056[_0xe8f2('0x29')][_0xe8f2('0x34')]+'%'};return _0x383c62;}})});}_0x17605d=_[_0xe8f2('0x35')]({},_0x17605d,_0x35a056[_0xe8f2('0x37')]);var _0x5c85ff={'where':_0x17605d[_0xe8f2('0x32')]};return db[_0xe8f2('0x23')][_0xe8f2('0x38')](_0x5c85ff)[_0xe8f2('0x39')](function(_0xcf6df0){_0x30d010[_0xe8f2('0x38')]=_0xcf6df0;if(_0x35a056[_0xe8f2('0x29')][_0xe8f2('0x3a')]){_0x17605d[_0xe8f2('0x3b')]=[{'all':!![]}];}return db[_0xe8f2('0x23')][_0xe8f2('0x3c')](_0x17605d);})['then'](function(_0x36dfe8){_0x30d010[_0xe8f2('0x3d')]=_0x36dfe8;return _0x30d010;})[_0xe8f2('0x39')](respondWithFilteredResult(_0x2f05e2,_0x17605d))['catch'](handleError(_0x2f05e2,null));};exports['show']=function(_0x2ee518,_0x4462a2){var _0x1b6100={'raw':!![],'where':{'id':_0x2ee518[_0xe8f2('0x3e')]['id']}},_0x359b53={};_0x359b53[_0xe8f2('0x28')]=_[_0xe8f2('0x3f')](db[_0xe8f2('0x23')][_0xe8f2('0x24')]);_0x359b53[_0xe8f2('0x29')]=_[_0xe8f2('0x3f')](_0x2ee518['query']);_0x359b53[_0xe8f2('0x2a')]=_[_0xe8f2('0x2b')](_0x359b53['model'],_0x359b53[_0xe8f2('0x29')]);_0x1b6100[_0xe8f2('0x2d')]=_[_0xe8f2('0x2b')](_0x359b53[_0xe8f2('0x28')],qs[_0xe8f2('0x2c')](_0x2ee518[_0xe8f2('0x29')][_0xe8f2('0x2c')]));_0x1b6100[_0xe8f2('0x2d')]=_0x1b6100['attributes'][_0xe8f2('0x2e')]?_0x1b6100[_0xe8f2('0x2d')]:_0x359b53[_0xe8f2('0x28')];if(_0x2ee518[_0xe8f2('0x29')][_0xe8f2('0x3a')]){_0x1b6100[_0xe8f2('0x3b')]=[{'all':!![]}];}_0x1b6100=_['merge']({},_0x1b6100,_0x2ee518[_0xe8f2('0x37')]);return db[_0xe8f2('0x23')][_0xe8f2('0x40')](_0x1b6100)[_0xe8f2('0x39')](handleEntityNotFound(_0x4462a2,null))['then'](respondWithResult(_0x4462a2,null))[_0xe8f2('0x41')](handleError(_0x4462a2,null));};exports[_0xe8f2('0x42')]=function(_0x1f087b,_0xdb67dd){return db[_0xe8f2('0x23')][_0xe8f2('0x42')](_0x1f087b[_0xe8f2('0x43')],{})[_0xe8f2('0x39')](respondWithResult(_0xdb67dd,0xc9))[_0xe8f2('0x41')](handleError(_0xdb67dd,null));};exports[_0xe8f2('0x1d')]=function(_0x37ca1c,_0x54e2f2){if(_0x37ca1c[_0xe8f2('0x43')]['id']){delete _0x37ca1c[_0xe8f2('0x43')]['id'];}return db[_0xe8f2('0x23')][_0xe8f2('0x40')]({'where':{'id':_0x37ca1c[_0xe8f2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x54e2f2,null))[_0xe8f2('0x39')](saveUpdates(_0x37ca1c[_0xe8f2('0x43')],null))['then'](respondWithResult(_0x54e2f2,null))[_0xe8f2('0x41')](handleError(_0x54e2f2,null));};exports[_0xe8f2('0x44')]=function(_0x443999,_0x5337ec){return db[_0xe8f2('0x23')][_0xe8f2('0x40')]({'where':{'id':_0x443999[_0xe8f2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5337ec,null))[_0xe8f2('0x39')](removeEntity(_0x5337ec,null))[_0xe8f2('0x41')](handleError(_0x5337ec,null));};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js
index 7d49e6a..02fb09d 100644
--- a/server/api/openchannelApplication/openchannelApplication.model.js
+++ b/server/api/openchannelApplication/openchannelApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8e23=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x8e23,0x101));var _0x38e2=function(_0x440fa6,_0x3e3950){_0x440fa6=_0x440fa6-0x0;var _0x4d678d=_0x8e23[_0x440fa6];return _0x4d678d;};'use strict';var _=require(_0x38e2('0x0'));var util=require(_0x38e2('0x1'));var logger=require(_0x38e2('0x2'))(_0x38e2('0x3'));var moment=require(_0x38e2('0x4'));var BPromise=require(_0x38e2('0x5'));var rp=require(_0x38e2('0x6'));var fs=require('fs');var path=require(_0x38e2('0x7'));var rimraf=require(_0x38e2('0x8'));var config=require('../../config/environment');var attributes=require(_0x38e2('0x9'));module[_0x38e2('0xa')]=function(_0x48df26,_0x3291b1){return _0x48df26[_0x38e2('0xb')](_0x38e2('0xc'),attributes,{'tableName':_0x38e2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xad70=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','openchannel_applications','utf8mb4'];(function(_0x316d1d,_0x5f4087){var _0x18f357=function(_0x4c3e3e){while(--_0x4c3e3e){_0x316d1d['push'](_0x316d1d['shift']());}};_0x18f357(++_0x5f4087);}(_0xad70,0x1a5));var _0x0ad7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xad70[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0ad7('0x0'));var util=require('util');var logger=require(_0x0ad7('0x1'))(_0x0ad7('0x2'));var moment=require(_0x0ad7('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ad7('0x4'));var fs=require('fs');var path=require(_0x0ad7('0x5'));var rimraf=require(_0x0ad7('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x3d09f5,_0x2c292f){return _0x3d09f5['define']('OpenchannelApplication',attributes,{'tableName':_0x0ad7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ad7('0x8'),'collate':_0x0ad7('0x9')});};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js
index f666e46..bded3ef 100644
--- a/server/api/openchannelApplication/openchannelApplication.rpc.js
+++ b/server/api/openchannelApplication/openchannelApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2bdb68,_0x83669a){var _0x3583e9=function(_0x46d5c8){while(--_0x46d5c8){_0x2bdb68['push'](_0x2bdb68['shift']());}};_0x3583e9(++_0x83669a);}(_0xb10b,0x12a));var _0xbb10=function(_0x43a939,_0x20c11a){_0x43a939=_0x43a939-0x0;var _0x8b5d30=_0xb10b[_0x43a939];return _0x8b5d30;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});};
\ No newline at end of file
+var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2b45d9,_0x3f4e3e){var _0x26f957=function(_0x487782){while(--_0x487782){_0x2b45d9['push'](_0x2b45d9['shift']());}};_0x26f957(++_0x3f4e3e);}(_0xb10b,0x12a));var _0xbb10=function(_0x2de699,_0x29ccd8){_0x2de699=_0x2de699-0x0;var _0x1754b7=_0xb10b[_0x2de699];return _0x1754b7;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js
index 5f230e4..f8db9de 100644
--- a/server/api/openchannelInteraction/index.js
+++ b/server/api/openchannelInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7db5=['isAuthenticated','index','/describe','describe','/:id','show','download','post','create','/:id/messages','addMessage','/:id/tags','openchannel','addTags','put','tracked','openchannelinteraction:update','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','../../config/environment','get'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x7db5,0x111));var _0x57db=function(_0x21f751,_0x4d5c7f){_0x21f751=_0x21f751-0x0;var _0x5616bf=_0x7db5[_0x21f751];return _0x5616bf;};'use strict';var multer=require(_0x57db('0x0'));var util=require(_0x57db('0x1'));var path=require(_0x57db('0x2'));var timeout=require(_0x57db('0x3'));var express=require(_0x57db('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x57db('0x5'));var controller=require('./openchannelInteraction.controller');router[_0x57db('0x6')]('/',auth[_0x57db('0x7')](),controller[_0x57db('0x8')]);router[_0x57db('0x6')](_0x57db('0x9'),auth['isAuthenticated'](),controller[_0x57db('0xa')]);router[_0x57db('0x6')](_0x57db('0xb'),auth[_0x57db('0x7')](),controller[_0x57db('0xc')]);router['get']('/:id/messages',auth[_0x57db('0x7')](),controller['getMessages']);router[_0x57db('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x57db('0xd')]);router[_0x57db('0xe')]('/',auth[_0x57db('0x7')](),controller[_0x57db('0xf')]);router[_0x57db('0xe')](_0x57db('0x10'),auth[_0x57db('0x7')](),controller[_0x57db('0x11')]);router['post'](_0x57db('0x12'),auth[_0x57db('0x7')](),interaction['tracked'](_0x57db('0x13'),'openchannelinteraction:addtags'),controller[_0x57db('0x14')]);router[_0x57db('0x15')]('/:id',auth[_0x57db('0x7')](),interaction[_0x57db('0x16')]('openchannel',_0x57db('0x17')),controller['update']);router['delete'](_0x57db('0xb'),auth[_0x57db('0x7')](),interaction[_0x57db('0x16')](_0x57db('0x13'),_0x57db('0x18')),controller[_0x57db('0x19')]);router['delete']('/:id/tags',auth[_0x57db('0x7')](),controller[_0x57db('0x1a')]);module[_0x57db('0x1b')]=router;
\ No newline at end of file
+var _0xc0b0=['openchannelinteraction:destroy','destroy','removeTags','exports','util','path','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xc0b0,0x64));var _0x0c0b=function(_0x1ce348,_0x872e84){_0x1ce348=_0x1ce348-0x0;var _0x20048f=_0xc0b0[_0x1ce348];return _0x20048f;};'use strict';var multer=require('multer');var util=require(_0x0c0b('0x0'));var path=require(_0x0c0b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c0b('0x2')]();var auth=require(_0x0c0b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0c0b('0x4'));var controller=require(_0x0c0b('0x5'));router[_0x0c0b('0x6')]('/',auth[_0x0c0b('0x7')](),controller[_0x0c0b('0x8')]);router[_0x0c0b('0x6')](_0x0c0b('0x9'),auth[_0x0c0b('0x7')](),controller[_0x0c0b('0xa')]);router['get'](_0x0c0b('0xb'),auth[_0x0c0b('0x7')](),controller['show']);router[_0x0c0b('0x6')](_0x0c0b('0xc'),auth['isAuthenticated'](),controller[_0x0c0b('0xd')]);router['get'](_0x0c0b('0xe'),auth[_0x0c0b('0x7')](),controller[_0x0c0b('0xf')]);router[_0x0c0b('0x10')]('/',auth[_0x0c0b('0x7')](),controller[_0x0c0b('0x11')]);router[_0x0c0b('0x10')]('/:id/messages',auth[_0x0c0b('0x7')](),controller[_0x0c0b('0x12')]);router[_0x0c0b('0x10')](_0x0c0b('0x13'),auth['isAuthenticated'](),interaction[_0x0c0b('0x14')](_0x0c0b('0x15'),_0x0c0b('0x16')),controller[_0x0c0b('0x17')]);router[_0x0c0b('0x18')](_0x0c0b('0xb'),auth[_0x0c0b('0x7')](),interaction[_0x0c0b('0x14')]('openchannel',_0x0c0b('0x19')),controller[_0x0c0b('0x1a')]);router[_0x0c0b('0x1b')](_0x0c0b('0xb'),auth[_0x0c0b('0x7')](),interaction['tracked']('openchannel',_0x0c0b('0x1c')),controller[_0x0c0b('0x1d')]);router[_0x0c0b('0x1b')](_0x0c0b('0x13'),auth[_0x0c0b('0x7')](),controller[_0x0c0b('0x1e')]);module[_0x0c0b('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js
index 9a20ebc..ccf4816 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.attributes.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb6e7=['BOOLEAN','DATE','STRING','out','exports'];(function(_0x157d39,_0x2d5444){var _0x39e9f0=function(_0x2f40cf){while(--_0x2f40cf){_0x157d39['push'](_0x157d39['shift']());}};_0x39e9f0(++_0x2d5444);}(_0xb6e7,0xa4));var _0x7b6e=function(_0xdabb4e,_0x444d77){_0xdabb4e=_0xdabb4e-0x0;var _0x163a15=_0xb6e7[_0xdabb4e];return _0x163a15;};'use strict';var Sequelize=require('sequelize');module[_0x7b6e('0x0')]={'closed':{'type':Sequelize[_0x7b6e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b6e('0x2')]},'disposition':{'type':Sequelize[_0x7b6e('0x3')]},'note':{'type':Sequelize[_0x7b6e('0x3')]},'read1stAt':{'type':Sequelize[_0x7b6e('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x7b6e('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7b6e('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7b6e('0x3')]}};
\ No newline at end of file
+var _0xf7c0=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0xf27b88,_0x43c542){var _0x6fd519=function(_0x46e55f){while(--_0x46e55f){_0xf27b88['push'](_0xf27b88['shift']());}};_0x6fd519(++_0x43c542);}(_0xf7c0,0x93));var _0x0f7c=function(_0x262500,_0x1b39e3){_0x262500=_0x262500-0x0;var _0x26e869=_0xf7c0[_0x262500];return _0x26e869;};'use strict';var Sequelize=require(_0x0f7c('0x0'));module[_0x0f7c('0x1')]={'closed':{'type':Sequelize[_0x0f7c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0f7c('0x3')]},'disposition':{'type':Sequelize[_0x0f7c('0x4')]},'note':{'type':Sequelize[_0x0f7c('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x0f7c('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x0f7c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0f7c('0x5')]('in',_0x0f7c('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0f7c('0x4')]}};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js
index 079cb56..5d1caf0 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.controller.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c48=['register','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','Users','fullname','TagIds','Tags','split','forEach','push','map','OpenchannelInteraction','fieldName','key','query','keys','filters','attributes','model','fields','length','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','type','text','body','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','\x27\x27\x27\x27','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','rows','catch','params','rawAttributes','intersection','includeAll','include','options','create','describe','addMessage','omit','getMessages','OpenchannelMessage','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','ids','spread','emit','openchannelInteractionTags:save','removeTags','root','server','files','tmp','attachments','transcript-%d-%s.zip','join','CmContact','firstName','lastName','Attachment','Messages','direction','secret','Account','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','format','%s\x20#%d','Openchannel','YYYY-MM-DD','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','views','downloadInteraction.html','toFile','transcript-','.pdf','download','err','sendStatus','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket'];(function(_0x57b4a5,_0x23918e){var _0x4493a8=function(_0x451624){while(--_0x451624){_0x57b4a5['push'](_0x57b4a5['shift']());}};_0x4493a8(++_0x23918e);}(_0x0c48,0xd3));var _0x80c4=function(_0x3d1c06,_0x30f2e0){_0x3d1c06=_0x3d1c06-0x0;var _0x10c6e6=_0x0c48[_0x3d1c06];return _0x10c6e6;};'use strict';var pdf=require(_0x80c4('0x0'));var emlformat=require(_0x80c4('0x1'));var rimraf=require(_0x80c4('0x2'));var zipdir=require(_0x80c4('0x3'));var jsonpatch=require(_0x80c4('0x4'));var rp=require(_0x80c4('0x5'));var moment=require(_0x80c4('0x6'));var BPromise=require(_0x80c4('0x7'));var Mustache=require(_0x80c4('0x8'));var util=require('util');var path=require(_0x80c4('0x9'));var sox=require(_0x80c4('0xa'));var csv=require(_0x80c4('0xb'));var ejs=require(_0x80c4('0xc'));var fs=require('fs');var _=require(_0x80c4('0xd'));var squel=require(_0x80c4('0xe'));var crypto=require(_0x80c4('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x80c4('0x10'));var toCsv=require(_0x80c4('0xb'));var querystring=require(_0x80c4('0x11'));var Papa=require('papaparse');var Redis=require(_0x80c4('0x12'));var authService=require(_0x80c4('0x13'));var qs=require(_0x80c4('0x14'));var as=require(_0x80c4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x80c4('0x16'));var utils=require(_0x80c4('0x17'));var config=require(_0x80c4('0x18'));var db=require(_0x80c4('0x19'))['db'];config[_0x80c4('0x1a')]=_[_0x80c4('0x1b')](config[_0x80c4('0x1a')],{'host':_0x80c4('0x1c'),'port':0x18eb});var socket=require(_0x80c4('0x1d'))(new Redis(config['redis']));require(_0x80c4('0x1e'))[_0x80c4('0x1f')](socket);function respondWithStatusCode(_0x274bb3,_0x4521b1){_0x4521b1=_0x4521b1||0xcc;return function(_0x6237c6){if(_0x6237c6){return _0x274bb3['sendStatus'](_0x4521b1);}return _0x274bb3[_0x80c4('0x20')](_0x4521b1)[_0x80c4('0x21')]();};}function respondWithResult(_0x73c1f7,_0x65d753){_0x65d753=_0x65d753||0xc8;return function(_0x436c03){if(_0x436c03){return _0x73c1f7[_0x80c4('0x20')](_0x65d753)[_0x80c4('0x22')](_0x436c03);}};}function respondWithFilteredResult(_0x124391,_0x491e89){return function(_0x479fb9){if(_0x479fb9){var _0x927a19=_0x479fb9[_0x80c4('0x23')],_0x100335=_0x491e89[_0x80c4('0x24')],_0x36f604=_0x491e89[_0x80c4('0x24')]+_0x491e89[_0x80c4('0x25')],_0x3027a4;if(_0x36f604>=_0x927a19){_0x36f604=_0x927a19;_0x3027a4=0xc8;}else{_0x3027a4=0xce;}_0x124391[_0x80c4('0x20')](_0x3027a4);return _0x124391[_0x80c4('0x26')](_0x80c4('0x27'),_0x100335+'-'+_0x36f604+'/'+_0x927a19)[_0x80c4('0x22')](_0x479fb9);}return null;};}function patchUpdates(_0xa1df4b){return function(_0x3b9b84){try{jsonpatch['apply'](_0x3b9b84,_0xa1df4b,!![]);}catch(_0x61ea22){return BPromise[_0x80c4('0x28')](_0x61ea22);}return _0x3b9b84[_0x80c4('0x29')]();};}function saveUpdates(_0xb75a5c,_0x3d99db){return function(_0x48da8d){if(_0x48da8d){return _0x48da8d[_0x80c4('0x2a')](_0xb75a5c)[_0x80c4('0x2b')](function(_0x1a333f){return _0x1a333f;});}return null;};}function removeEntity(_0x136a93,_0x345095){return function(_0x1ac69b){if(_0x1ac69b){return _0x1ac69b[_0x80c4('0x2c')]()['then'](function(){_0x136a93[_0x80c4('0x20')](0xcc)[_0x80c4('0x21')]();});}};}function handleEntityNotFound(_0x20d7cc,_0x5bdbc4){return function(_0x5695c6){if(!_0x5695c6){_0x20d7cc['sendStatus'](0x194);}return _0x5695c6;};}function handleError(_0x885a2d,_0x5eddfe){_0x5eddfe=_0x5eddfe||0x1f4;return function(_0x37d797){logger[_0x80c4('0x2d')](_0x37d797['stack']);if(_0x37d797[_0x80c4('0x2e')]){delete _0x37d797[_0x80c4('0x2e')];}_0x885a2d[_0x80c4('0x20')](_0x5eddfe)[_0x80c4('0x2f')](_0x37d797);};}function getInteractionUsers(_0x3b4203,_0x4fa625){return new BPromise(function(_0x242d07,_0x53c21b){try{if(_0x4fa625[_0x3b4203['id']]){_0x3b4203[_0x80c4('0x30')]=_['map'](_0x4fa625[_0x3b4203['id']],function(_0x225876){return{'id':_0x225876['id'],'fullname':_0x225876[_0x80c4('0x31')]};});}}catch(_0x3846e6){_0x53c21b(_0x3846e6);}_0x242d07(_0x3b4203);});}function getInteractionTags(_0x12d389,_0x24e816){return new BPromise(function(_0x10f947,_0x424fad){try{if(_0x12d389[_0x80c4('0x32')]){_0x12d389[_0x80c4('0x33')]=[];_0x12d389[_0x80c4('0x32')][_0x80c4('0x34')](',')[_0x80c4('0x35')](function(_0x3843e7){_0x12d389[_0x80c4('0x33')][_0x80c4('0x36')](_0x24e816[_0x3843e7]);});}delete _0x12d389[_0x80c4('0x32')];}catch(_0x33c627){_0x424fad(_0x33c627);}_0x10f947(_0x12d389);});}function updateOpenchannelInteraction(_0x1ea016,_0x4eb53e,_0xd7ae5b){return new BPromise(function(_0x18f520,_0xdf9c3c){return getInteractionUsers(_0x1ea016,_0xd7ae5b)['then'](function(_0x530229){return getInteractionTags(_0x530229,_0x4eb53e);})[_0x80c4('0x2b')](function(_0x1e9660){_0x18f520(_0x1e9660);})['catch'](function(_0x2b5375){_0xdf9c3c(_0x2b5375);});});}exports['index']=function(_0x2db86a,_0x5a1379){var _0xa0a956={},_0x26b66a={},_0x41461d={'count':0x0,'rows':[]};var _0xf0ec7b=_[_0x80c4('0x37')](db[_0x80c4('0x38')]['rawAttributes'],function(_0x1f0fa3){return{'name':_0x1f0fa3[_0x80c4('0x39')],'type':_0x1f0fa3['type'][_0x80c4('0x3a')]};});_0x26b66a['model']=_['map'](_0xf0ec7b,_0x80c4('0x2e'));_0x26b66a[_0x80c4('0x3b')]=_[_0x80c4('0x3c')](_0x2db86a[_0x80c4('0x3b')]);_0x26b66a[_0x80c4('0x3d')]=_['intersection'](_0x26b66a['model'],_0x26b66a[_0x80c4('0x3b')]);_0xa0a956[_0x80c4('0x3e')]=_['intersection'](_0x26b66a[_0x80c4('0x3f')],qs[_0x80c4('0x40')](_0x2db86a[_0x80c4('0x3b')][_0x80c4('0x40')]));_0xa0a956['attributes']=_0xa0a956['attributes'][_0x80c4('0x41')]?_0xa0a956[_0x80c4('0x3e')]:_0x26b66a['model'];if(!_0x2db86a[_0x80c4('0x3b')]['hasOwnProperty'](_0x80c4('0x42'))){_0xa0a956['limit']=qs['limit'](_0x2db86a[_0x80c4('0x3b')]['limit']);_0xa0a956[_0x80c4('0x24')]=qs['offset'](_0x2db86a[_0x80c4('0x3b')]['offset']);}_0xa0a956['order']=qs[_0x80c4('0x43')](_0x2db86a[_0x80c4('0x3b')]['sort']);_0xa0a956[_0x80c4('0x44')]=qs[_0x80c4('0x3d')](_[_0x80c4('0x45')](_0x2db86a[_0x80c4('0x3b')],_0x26b66a[_0x80c4('0x3d')]),_0xf0ec7b);var _0x30ba8b=[];var _0x51a702=squel[_0x80c4('0x46')]()[_0x80c4('0x47')]('id')['field'](_0x80c4('0x2e'))['field'](_0x80c4('0x48'))[_0x80c4('0x49')](_0x80c4('0x4a'));var _0x420242=squel[_0x80c4('0x46')]()['field'](_0x80c4('0x4b'))['field'](_0x80c4('0x4c'))['field'](_0x80c4('0x4d'))[_0x80c4('0x49')](_0x80c4('0x4e'),'ui')[_0x80c4('0x4f')](_0x80c4('0x50'),'u',_0x80c4('0x51'));var _0x248bc2=squel[_0x80c4('0x46')]()[_0x80c4('0x49')](_0x80c4('0x52'),'i')[_0x80c4('0x4f')](_0x80c4('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x80c4('0x4f')](_0x80c4('0x50'),'o','o.id\x20=\x20i.UserId')[_0x80c4('0x4f')](_0x80c4('0x54'),'a',_0x80c4('0x55'))[_0x80c4('0x4f')](_0x80c4('0x56'),'me',_0x80c4('0x57'))[_0x80c4('0x4f')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x80c4('0x4a'),'t',_0x80c4('0x58'));var _0x336132=squel['expr']();var _0x46bd10=[];var _0x564e3f=squel[_0x80c4('0x59')]();var _0x398ec9;if(_0x2db86a[_0x80c4('0x3b')]['search']){_0x398ec9=as[_0x80c4('0x5a')](_0x2db86a[_0x80c4('0x3b')][_0x80c4('0x5b')]);var _0x5800a2=_0x398ec9[_0x80c4('0x5c')];for(var _0x3eef38=0x0;_0x3eef38<_0x398ec9[_0x80c4('0x5d')]['length'];_0x3eef38++){var _0x3ee5a5=_0x398ec9[_0x80c4('0x5d')][_0x3eef38];var _0x58cfe0='i';var _0x479fad=_['find'](_0xf0ec7b,[_0x80c4('0x2e'),_0x3ee5a5[_0x80c4('0x47')]]);if(!_0x479fad){switch(_0x3ee5a5['field']){case'unreadMessages':if(_0x3ee5a5['value']==0x1){_0x248bc2[_0x80c4('0x5e')]('`'+_0x3ee5a5[_0x80c4('0x47')]+_0x80c4('0x5f'));}else{_0x248bc2[_0x80c4('0x5e')]('`'+_0x3ee5a5[_0x80c4('0x47')]+_0x80c4('0x60'));}break;case _0x80c4('0x61'):if(_0x3ee5a5[_0x80c4('0x62')]==='$substring'){if(_0x3ee5a5[_0x80c4('0x63')]['split']('\x20')['length']>0x1){_0x336132[_0x5800a2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x80c4('0x64')](_0x3ee5a5[_0x80c4('0x63')]),null);}else{var _0x1d5eec='%'+_0x3ee5a5[_0x80c4('0x63')]+'%';_0x336132[_0x5800a2](_0x80c4('0x65'),_0x1d5eec,_0x1d5eec,_0x1d5eec);}}else{_0x479fad=_['find'](_0xf0ec7b,[_0x80c4('0x2e'),_0x80c4('0x66')]);_0x3ee5a5[_0x80c4('0x47')]=_0x80c4('0x66');_0x212cfe=as[_0x80c4('0x67')](_0x58cfe0,_0x479fad['type'],_0x3ee5a5);_0x336132[_0x5800a2](_0x212cfe['text'],_0x212cfe[_0x80c4('0x63')][_0x80c4('0x68')],_0x212cfe[_0x80c4('0x63')][_0x80c4('0x21')]);}break;case _0x80c4('0x69'):var _0x1271a8=_0x3ee5a5[_0x80c4('0x63')]['split'](',')['map'](function(_0x5cd636){return Number(_0x5cd636);});_0x1271a8[_0x80c4('0x35')](function(_0x30eb9a){_0x564e3f['or'](_0x80c4('0x6a'),'%,'+_0x30eb9a+',%');});_0x46bd10=_[_0x80c4('0x6b')](_0x46bd10,_0x1271a8);break;case _0x80c4('0x6c'):if(_0x3ee5a5['operator']===_0x80c4('0x6d')){_0x336132[_0x5800a2](_0x80c4('0x6e'),'%'+_0x3ee5a5[_0x80c4('0x63')]+'%',null);}else{_0x479fad=_[_0x80c4('0x6f')](_0xf0ec7b,[_0x80c4('0x2e'),_0x80c4('0x70')]);_0x3ee5a5['field']=_0x80c4('0x70');_0x212cfe=as[_0x80c4('0x67')](_0x58cfe0,_0x479fad[_0x80c4('0x71')],_0x3ee5a5);_0x336132[_0x5800a2](_0x212cfe[_0x80c4('0x72')],_0x212cfe[_0x80c4('0x63')][_0x80c4('0x68')],_0x212cfe[_0x80c4('0x63')][_0x80c4('0x21')]);}break;case _0x80c4('0x73'):_0x212cfe=as['buildExpression']('me',null,_0x3ee5a5);_0x336132[_0x5800a2](_0x212cfe[_0x80c4('0x72')],_0x212cfe[_0x80c4('0x63')][_0x80c4('0x68')],_0x212cfe[_0x80c4('0x63')]['end']);break;}}else{var _0x212cfe=as['buildExpression'](_0x58cfe0,_0x479fad[_0x80c4('0x71')],_0x3ee5a5);_0x336132[_0x5800a2](_0x212cfe[_0x80c4('0x72')],_0x212cfe[_0x80c4('0x63')][_0x80c4('0x68')],_0x212cfe[_0x80c4('0x63')]['end']);}}}else{var _0x8489cc=_(_0x2db86a[_0x80c4('0x3b')])[_0x80c4('0x3c')]()[_0x80c4('0x37')](function(_0x4fb1ff){return _[_0x80c4('0x74')](_0xf0ec7b,[_0x80c4('0x2e'),_0x4fb1ff])?_0x4fb1ff:undefined;})[_0x80c4('0x75')]()['value']();if(!_['isEmpty'](_0x8489cc)){_0x8489cc[_0x80c4('0x35')](function(_0x4216f4){if(_0x4216f4===_0x80c4('0x76')){_0x248bc2['where'](_0x80c4('0x77'),[][_0x80c4('0x78')](_0x2db86a[_0x80c4('0x3b')][_0x4216f4]));}else if(_0x4216f4===_0x80c4('0x79')){var _0xef0905=JSON[_0x80c4('0x7a')](_0x2db86a[_0x80c4('0x3b')][_0x4216f4])[_0x80c4('0x7b')];var _0x29638b=JSON[_0x80c4('0x7a')](_0x2db86a['query'][_0x4216f4])[_0x80c4('0x7c')];_0x248bc2[_0x80c4('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xef0905,_0x29638b);}else{if(_0x2db86a[_0x80c4('0x3b')][_0x4216f4]===_0x80c4('0x7d')){_0x248bc2[_0x80c4('0x44')]('i.'+_0x4216f4+_0x80c4('0x7e'));}else{_0x248bc2[_0x80c4('0x44')]('i.'+_0x4216f4+_0x80c4('0x7f'),_0x2db86a['query'][_0x4216f4]);}}});}if(_0x2db86a['query'][_0x80c4('0x80')]){if(_0x2db86a[_0x80c4('0x3b')][_0x80c4('0x80')]==0x1){_0x248bc2['having'](_0x80c4('0x81'));}else{_0x248bc2['having'](_0x80c4('0x82'));}}if(_0x2db86a[_0x80c4('0x3b')][_0x80c4('0x83')]){_0x46bd10=_[_0x80c4('0x84')](_0x2db86a[_0x80c4('0x3b')][_0x80c4('0x83')])?_0x2db86a[_0x80c4('0x3b')]['tag']:new Array(_0x2db86a[_0x80c4('0x3b')][_0x80c4('0x83')]);_0x46bd10[_0x80c4('0x35')](function(_0x560530){_0x564e3f['or'](_0x80c4('0x6a'),'%,'+_0x560530+',%');});}if(_0x2db86a[_0x80c4('0x3b')]['filter']){var _0x1106dc=_0x2db86a[_0x80c4('0x3b')][_0x80c4('0x85')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x80c4('0x86'));if(qs[_0x80c4('0x87')](_0x1106dc)){_0x336132['or']('i.id\x20LIKE\x20?',_0x1106dc+'%');}else{_0x336132['or'](_0x80c4('0x88'),qs[_0x80c4('0x64')](_0x1106dc))['or'](_0x80c4('0x89'),_0x1106dc+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1106dc+'%');}}}_0x248bc2[_0x80c4('0x44')](_0x336132);_0x248bc2[_0x80c4('0x8a')](_0x80c4('0x8b'));var _0x10ebc3={'type':db[_0x80c4('0x8c')][_0x80c4('0x8d')][_0x80c4('0x8e')],'raw':!![]};var _0x3ec896=_0x248bc2[_0x80c4('0x8f')]();_0x3ec896[_0x80c4('0x47')]('i.id');_0x3ec896[_0x80c4('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x80c4('0x90'));if(_0xa0a956['order']){_0xa0a956[_0x80c4('0x91')][_0x80c4('0x35')](function(_0x40d96b){_0x248bc2['order']('i.'+_0x40d96b[0x0],_0x40d96b[0x1]===_0x80c4('0x92')?![]:!![]);});}if(!_[_0x80c4('0x93')](_0x46bd10)){_0x248bc2[_0x80c4('0x5e')](_0x564e3f);_0x3ec896[_0x80c4('0x44')](_0x80c4('0x94'),_0x46bd10);}BPromise[_0x80c4('0x95')]()[_0x80c4('0x2b')](function(){if(!_0x398ec9){if(_0x2db86a['query'][_0x80c4('0x76')]||_0x2db86a[_0x80c4('0x3b')]['journey'])return;_0x3ec896[_0x80c4('0x44')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x248bc2[_0x80c4('0x44')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}return _0x2db86a[_0x80c4('0x96')][_0x80c4('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4b0951){if(_[_0x80c4('0x93')](_0x4b0951)){_0x3ec896[_0x80c4('0x44')](_0x80c4('0x98'));_0x248bc2[_0x80c4('0x44')](_0x80c4('0x98'));}else{_0x3ec896['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0x80c4('0x37')](_0x4b0951,'id'));_0x248bc2[_0x80c4('0x44')](_0x80c4('0x77'),_[_0x80c4('0x37')](_0x4b0951,'id'));}});})[_0x80c4('0x2b')](function(){db['sequelize']['query'](_0x3ec896[_0x80c4('0x99')](),_0x10ebc3)[_0x80c4('0x2b')](function(_0x55fb5e){_0x41461d[_0x80c4('0x23')]=_0x55fb5e['length'];if(_0x41461d[_0x80c4('0x23')]===0x0)return[];return db[_0x80c4('0x9a')][_0x80c4('0x3b')](_0x51a702['toString'](),_0x10ebc3)[_0x80c4('0x2b')](function(_0x565bea){_0x30ba8b=_[_0x80c4('0x9b')](_0x565bea,'id');_0x10ebc3=_[_0x80c4('0x9c')](_0x10ebc3,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2db86a[_0x80c4('0x3b')][_0x80c4('0x40')]){_0xa0a956[_0x80c4('0x3e')][_0x80c4('0x35')](function(_0x267a05){_0x248bc2[_0x80c4('0x47')]('i.'+_0x267a05);});}else{_0x248bc2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x80c4('0x90'));_0x248bc2[_0x80c4('0x47')](_0x80c4('0x9d'),_0x80c4('0x9e'));_0x248bc2[_0x80c4('0x47')](_0x80c4('0x9f'),'Account.mandatoryDisposition');_0x248bc2[_0x80c4('0x47')]('i.*');_0x248bc2[_0x80c4('0x47')](_0x80c4('0xa0'),_0x80c4('0xa1'));_0x248bc2[_0x80c4('0x47')](_0x80c4('0xa2'),'Contact.lastName');_0x248bc2['field'](_0x80c4('0xa3'),'Contact.email');_0x248bc2['field'](_0x80c4('0xa4'),_0x80c4('0xa5'));_0x248bc2[_0x80c4('0x47')]('c.mobile',_0x80c4('0xa6'));_0x248bc2['field'](_0x80c4('0xa7'),_0x80c4('0xa8'));_0x248bc2[_0x80c4('0x47')]('o.fullname',_0x80c4('0xa9'));_0x248bc2[_0x80c4('0x47')](_0x80c4('0xaa'),'Owner.internal');_0x248bc2['field'](_0x80c4('0xab'),_0x80c4('0x32'));}if(_0xa0a956[_0x80c4('0x25')])_0x248bc2['limit'](_0xa0a956['limit']);if(_0xa0a956[_0x80c4('0x24')])_0x248bc2['offset'](_0xa0a956['offset']);return db[_0x80c4('0x9a')][_0x80c4('0x3b')](_0x248bc2['toString'](),_0x10ebc3);})[_0x80c4('0x2b')](function(_0xfeb7af){_0x420242[_0x80c4('0x44')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x80c4('0x37')](_0xfeb7af,'id'));return db[_0x80c4('0x9a')]['query'](_0x420242[_0x80c4('0x99')](),_0x10ebc3)[_0x80c4('0x2b')](function(_0x208195){var _0x1744ef=_[_0x80c4('0xac')](_0x208195,_0x80c4('0xad'));var _0x4bd4c6=[];_0xfeb7af[_0x80c4('0x35')](function(_0x485efc){_0x4bd4c6[_0x80c4('0x36')](updateOpenchannelInteraction(_0x485efc,_0x30ba8b,_0x1744ef));});return BPromise['all'](_0x4bd4c6);});});})[_0x80c4('0x2b')](function(_0x3f7f6a){_0x41461d[_0x80c4('0xae')]=_0x3f7f6a;return _0x41461d;})[_0x80c4('0x2b')](respondWithFilteredResult(_0x5a1379,_0xa0a956));})[_0x80c4('0xaf')](handleError(_0x5a1379,null));};exports['show']=function(_0x23d294,_0x1aaa45){var _0x730502={'raw':![],'where':{'id':_0x23d294[_0x80c4('0xb0')]['id']}},_0x4f5b87={};_0x4f5b87[_0x80c4('0x3f')]=_[_0x80c4('0x3c')](db['OpenchannelInteraction'][_0x80c4('0xb1')]);_0x4f5b87[_0x80c4('0x3b')]=_['keys'](_0x23d294[_0x80c4('0x3b')]);_0x4f5b87[_0x80c4('0x3d')]=_[_0x80c4('0xb2')](_0x4f5b87[_0x80c4('0x3f')],_0x4f5b87[_0x80c4('0x3b')]);_0x730502[_0x80c4('0x3e')]=_[_0x80c4('0xb2')](_0x4f5b87[_0x80c4('0x3f')],qs[_0x80c4('0x40')](_0x23d294['query']['fields']));_0x730502[_0x80c4('0x3e')]=_0x730502[_0x80c4('0x3e')]['length']?_0x730502[_0x80c4('0x3e')]:_0x4f5b87[_0x80c4('0x3f')];if(_0x23d294[_0x80c4('0x3b')][_0x80c4('0xb3')]){_0x730502[_0x80c4('0xb4')]=[{'all':!![]}];}_0x730502=_[_0x80c4('0x9c')]({},_0x730502,_0x23d294[_0x80c4('0xb5')]);return db[_0x80c4('0x38')][_0x80c4('0x6f')](_0x730502)['then'](handleEntityNotFound(_0x1aaa45,null))['then'](respondWithResult(_0x1aaa45,null))[_0x80c4('0xaf')](handleError(_0x1aaa45,null));};exports[_0x80c4('0xb6')]=function(_0x13ba50,_0x54a294){return db[_0x80c4('0x38')][_0x80c4('0xb6')](_0x13ba50[_0x80c4('0x73')],{})['then'](respondWithResult(_0x54a294,0xc9))[_0x80c4('0xaf')](handleError(_0x54a294,null));};exports[_0x80c4('0x2a')]=function(_0x41fecf,_0x44b013){if(_0x41fecf[_0x80c4('0x73')]['id']){delete _0x41fecf[_0x80c4('0x73')]['id'];}return db[_0x80c4('0x38')][_0x80c4('0x6f')]({'where':{'id':_0x41fecf[_0x80c4('0xb0')]['id']}})[_0x80c4('0x2b')](handleEntityNotFound(_0x44b013,null))[_0x80c4('0x2b')](saveUpdates(_0x41fecf[_0x80c4('0x73')],null))[_0x80c4('0x2b')](respondWithResult(_0x44b013,null))['catch'](handleError(_0x44b013,null));};exports['destroy']=function(_0x44486b,_0x88abe5){return db[_0x80c4('0x38')][_0x80c4('0x6f')]({'where':{'id':_0x44486b[_0x80c4('0xb0')]['id']}})[_0x80c4('0x2b')](handleEntityNotFound(_0x88abe5,null))[_0x80c4('0x2b')](removeEntity(_0x88abe5,null))['catch'](handleError(_0x88abe5,null));};exports[_0x80c4('0xb7')]=function(_0x5b6b5f,_0x5f3454){return db[_0x80c4('0x38')][_0x80c4('0xb7')]()['then'](respondWithResult(_0x5f3454,null))[_0x80c4('0xaf')](handleError(_0x5f3454,null));};exports[_0x80c4('0xb8')]=function(_0x472cdd,_0x2d52c3,_0x31b882){return db['OpenchannelMessage'][_0x80c4('0x6f')]({'where':{'id':_0x472cdd['params']['id']}})['then'](handleEntityNotFound(_0x2d52c3,null))[_0x80c4('0x2b')](function(_0xa1b6e0){if(_0xa1b6e0){return _0xa1b6e0[_0x80c4('0xb8')](_0x472cdd[_0x80c4('0x73')]['ids'],_[_0x80c4('0xb9')](_0x472cdd[_0x80c4('0x73')],['ids','id'])||{});}})[_0x80c4('0x2b')](respondWithResult(_0x2d52c3,null))[_0x80c4('0xaf')](handleError(_0x2d52c3,null));};exports[_0x80c4('0xba')]=function(_0x13575d,_0x43823d,_0x12ad3b){var _0x5380b9={'raw':![],'where':{}};var _0x1564e3={};var _0x3058c1={'count':0x0,'rows':[]};return db[_0x80c4('0x38')]['findOne']({'where':{'id':_0x13575d[_0x80c4('0xb0')]['id']}})[_0x80c4('0x2b')](handleEntityNotFound(_0x43823d,null))[_0x80c4('0x2b')](function(_0x3c3b72){if(_0x3c3b72){_0x1564e3[_0x80c4('0x3f')]=_[_0x80c4('0x3c')](db[_0x80c4('0xbb')]['rawAttributes']);_0x1564e3[_0x80c4('0x3b')]=_[_0x80c4('0x3c')](_0x13575d[_0x80c4('0x3b')]);_0x1564e3['filters']=_['intersection'](_0x1564e3[_0x80c4('0x3f')],_0x1564e3[_0x80c4('0x3b')]);_0x5380b9[_0x80c4('0x3e')]=_[_0x80c4('0xb2')](_0x1564e3['model'],qs[_0x80c4('0x40')](_0x13575d[_0x80c4('0x3b')][_0x80c4('0x40')]));_0x5380b9[_0x80c4('0x3e')]=_0x5380b9[_0x80c4('0x3e')][_0x80c4('0x41')]?_0x5380b9[_0x80c4('0x3e')]:_0x1564e3['model'];if(!_0x13575d[_0x80c4('0x3b')][_0x80c4('0xbc')]('nolimit')){_0x5380b9['limit']=qs[_0x80c4('0x25')](_0x13575d['query'][_0x80c4('0x25')]);_0x5380b9['offset']=qs[_0x80c4('0x24')](_0x13575d['query'][_0x80c4('0x24')]);}_0x5380b9[_0x80c4('0x91')]=qs[_0x80c4('0x43')](_0x13575d[_0x80c4('0x3b')][_0x80c4('0x43')]);_0x5380b9['where']=qs[_0x80c4('0x3d')](_[_0x80c4('0x45')](_0x13575d[_0x80c4('0x3b')],_0x1564e3[_0x80c4('0x3d')]));_0x5380b9['where']['OpenchannelInteractionId']=_0x3c3b72['id'];if(_0x13575d['query'][_0x80c4('0x85')]){_0x5380b9['where']=_[_0x80c4('0x9c')](_0x5380b9['where'],{'$or':_[_0x80c4('0x37')](_0x5380b9[_0x80c4('0x3e')],function(_0x56c257){var _0x928379={};_0x928379[_0x56c257]={'$like':'%'+_0x13575d['query']['filter']+'%'};return _0x928379;})});}if(_0x13575d[_0x80c4('0x3b')]['$gte']){var _0x163a06=_0x13575d[_0x80c4('0x3b')][_0x80c4('0x7b')][_0x80c4('0x34')](',');var _0x2cb5bc={};_0x2cb5bc[_0x163a06[0x0]]={'$gte':moment(_0x163a06[0x1])['format'](_0x80c4('0xbd'))};_0x5380b9[_0x80c4('0x44')]=_[_0x80c4('0x9c')](_0x5380b9[_0x80c4('0x44')],_0x2cb5bc);}_0x5380b9=_[_0x80c4('0x9c')]({},_0x5380b9,_0x13575d[_0x80c4('0xb5')]);return db['OpenchannelMessage'][_0x80c4('0x23')]({'where':_0x5380b9['where']})[_0x80c4('0x2b')](function(_0x22e25f){_0x3058c1[_0x80c4('0x23')]=_0x22e25f;if(_0x13575d[_0x80c4('0x3b')][_0x80c4('0xb3')]){_0x5380b9['include']=[{'all':!![]}];}return db[_0x80c4('0xbb')][_0x80c4('0xbe')](_0x5380b9);})[_0x80c4('0x2b')](function(_0x2d07d5){_0x3058c1[_0x80c4('0xae')]=_0x2d07d5;return _0x3058c1;});}})['then'](respondWithFilteredResult(_0x43823d,_0x5380b9))[_0x80c4('0xaf')](handleError(_0x43823d,null));};exports[_0x80c4('0xbf')]=function(_0x3f97cc,_0x4f867a,_0x322c3c){return db[_0x80c4('0x38')]['find']({'where':{'id':_0x3f97cc[_0x80c4('0xb0')]['id']}})['then'](handleEntityNotFound(_0x4f867a,null))[_0x80c4('0x2b')](function(_0x10b1bf){if(_0x10b1bf){return _0x10b1bf['setTags'](_0x3f97cc[_0x80c4('0x73')]['ids'],_[_0x80c4('0xb9')](_0x3f97cc[_0x80c4('0x73')],[_0x80c4('0xc0'),'id'])||{})[_0x80c4('0xc1')](function(){return db[_0x80c4('0x69')][_0x80c4('0xbe')]({'attributes':['id',_0x80c4('0x2e'),_0x80c4('0x48')],'where':{'id':_0x3f97cc[_0x80c4('0x73')][_0x80c4('0xc0')]}});})[_0x80c4('0x2b')](function(_0x5b7dc7){socket[_0x80c4('0xc2')](_0x80c4('0xc3'),{'id':Number(_0x3f97cc[_0x80c4('0xb0')]['id']),'tags':_0x5b7dc7||[]});return{'id':Number(_0x3f97cc[_0x80c4('0xb0')]['id']),'tags':_0x5b7dc7||[]};});}})[_0x80c4('0x2b')](respondWithResult(_0x4f867a,null))[_0x80c4('0xaf')](handleError(_0x4f867a,null));};exports[_0x80c4('0xc4')]=function(_0x4b7ec5,_0x1eeb0f,_0x3fefb0){return db[_0x80c4('0x38')][_0x80c4('0x6f')]({'where':{'id':_0x4b7ec5[_0x80c4('0xb0')]['id']}})[_0x80c4('0x2b')](handleEntityNotFound(_0x1eeb0f,null))[_0x80c4('0x2b')](function(_0x2892de){if(_0x2892de){return _0x2892de['removeTags'](_0x4b7ec5[_0x80c4('0x3b')][_0x80c4('0xc0')]);}})['then'](respondWithStatusCode(_0x1eeb0f,null))[_0x80c4('0xaf')](handleError(_0x1eeb0f,null));};exports['download']=function(_0x5847f9,_0x9839f1){var _0x184933=moment()['unix']()['toString']();var _0x49b283=path['join'](config[_0x80c4('0xc5')],_0x80c4('0xc6'),_0x80c4('0xc7'),_0x80c4('0xc8'));var _0x33140d=path['join'](config[_0x80c4('0xc5')],_0x80c4('0xc6'),_0x80c4('0xc7'),_0x80c4('0xc9'));var _0x784b1=path['join'](_0x49b283,_0x184933);var _0x46b4fe=util['format'](_0x80c4('0xca'),_0x5847f9['params']['id'],_0x184933);var _0x11a959=path[_0x80c4('0xcb')](_0x49b283,_0x46b4fe);var _0x5da49c=[];_0x5da49c['push']({'model':db[_0x80c4('0x6c')],'as':_0x80c4('0x6c'),'attributes':['id',_0x80c4('0x31')],'raw':!![]});_0x5da49c['push']({'model':db[_0x80c4('0xcc')],'as':_0x80c4('0x61'),'attributes':['id',_0x80c4('0xcd'),_0x80c4('0xce')],'raw':!![]});if(_0x5847f9['query'][_0x80c4('0xc9')]){_0x5da49c[_0x80c4('0x36')]({'model':db[_0x80c4('0xcf')],'as':_0x80c4('0xcf'),'raw':!![]});}var _0x302d63=[{'model':db[_0x80c4('0xbb')],'as':_0x80c4('0xd0'),'attributes':['id',_0x80c4('0x73'),_0x80c4('0x79'),_0x80c4('0xd1'),_0x80c4('0xd2'),_0x80c4('0x80')],'include':_0x5da49c}];_0x302d63['push']({'model':db['OpenchannelAccount'],'as':_0x80c4('0xd3'),'attributes':['id','name']});_0x302d63[_0x80c4('0x36')]({'model':db['User'],'as':'Owner','attributes':['id',_0x80c4('0x31')]});return db[_0x80c4('0x38')][_0x80c4('0x6f')]({'where':{'id':_0x5847f9['params']['id']},'include':_0x302d63})[_0x80c4('0x2b')](handleEntityNotFound(_0x9839f1,null))['then'](function(_0x3aa1d0){if(_0x3aa1d0){var _0x25f9a2=_0x3aa1d0[_0x80c4('0xd4')]({'plain':!![]});fs[_0x80c4('0xd5')](_0x784b1);var _0x16acdc={'format':'A4','border':_0x80c4('0xd6'),'header':{'height':_0x80c4('0xd7'),'contents':{'first':_0x80c4('0xd8')}},'footer':{'height':_0x80c4('0xd9'),'contents':{'default':util[_0x80c4('0xda')](' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',util[_0x80c4('0xda')](_0x80c4('0xdb'),_0x80c4('0xdc'),_0x25f9a2['id']),moment()[_0x80c4('0xda')](_0x80c4('0xdd'))[_0x80c4('0x99')]())}}};var _0xb7da08={'channel':_0x80c4('0xdc'),'account':_0x25f9a2[_0x80c4('0xd3')][_0x80c4('0x2e')],'agent':_0x25f9a2[_0x80c4('0xde')]?_0x25f9a2[_0x80c4('0xde')][_0x80c4('0x31')]:_0x80c4('0xdf'),'createdAt':moment(_0x25f9a2[_0x80c4('0x79')])['format'](_0x80c4('0xbd'))[_0x80c4('0x99')](),'closedAt':_0x25f9a2[_0x80c4('0xe0')]?moment(_0x25f9a2[_0x80c4('0xe1')])[_0x80c4('0xda')](_0x80c4('0xbd'))[_0x80c4('0x99')]():'','disposition':_0x25f9a2[_0x80c4('0xe2')],'visibility':_0x25f9a2[_0x80c4('0xe3')]?_0x80c4('0xe4'):_0x80c4('0xe5'),'messages':_(_0x25f9a2[_0x80c4('0xd0')])[_0x80c4('0x85')]({'secret':![]})[_0x80c4('0x37')](function(_0x452f38){if(_0x452f38[_0x80c4('0xcf')]){var _0x398798=path[_0x80c4('0xcb')](_0x33140d,_0x452f38[_0x80c4('0xcf')][_0x80c4('0xe6')]);if(fs[_0x80c4('0xe7')](_0x398798)){fs[_0x80c4('0xe8')](_0x398798)[_0x80c4('0xe9')](fs['createWriteStream'](path['join'](_0x784b1,_0x452f38[_0x80c4('0xcf')]['basename'])));}}return{'date':moment(_0x452f38['createdAt'])[_0x80c4('0xda')]('YYYY-MM-DD\x20HH:mm:ss')[_0x80c4('0x99')](),'sender':_0x452f38[_0x80c4('0xd1')]==='out'?_0x452f38[_0x80c4('0x6c')]?_0x452f38[_0x80c4('0x6c')]['fullname']:'System':_0x452f38[_0x80c4('0x61')][_0x80c4('0xcd')]+(_0x452f38['Contact'][_0x80c4('0xce')]?'\x20'+_0x452f38[_0x80c4('0x61')][_0x80c4('0xce')]:''),'body':_0x452f38[_0x80c4('0xcf')]?_0x452f38['Attachment'][_0x80c4('0xe6')]:_0x452f38[_0x80c4('0x73')],'direction':_0x452f38[_0x80c4('0xd1')]==='out'?'A':'C','secret':_0x452f38[_0x80c4('0xd2')],'read':_0x452f38[_0x80c4('0x80')],'attachment':_0x452f38['Attachment']};})[_0x80c4('0x63')]()};return ejs['renderFile'](path[_0x80c4('0xcb')](config['root'],_0x80c4('0xc6'),_0x80c4('0xea'),_0x80c4('0xeb')),{'interaction':_0xb7da08})[_0x80c4('0x2b')](function(_0x4e5fe7){return new BPromise(function(_0x33c46c,_0x123b62){pdf[_0x80c4('0xb6')](_0x4e5fe7,_0x16acdc)[_0x80c4('0xec')](path[_0x80c4('0xcb')](_0x784b1,_0x80c4('0xed')+_0x25f9a2['id']+'-'+_0x184933+_0x80c4('0xee')),function(_0xb1a18a,_0x5e1532){if(_0xb1a18a)return _0x123b62(_0xb1a18a);_0x33c46c(_0x5e1532);});});})[_0x80c4('0x2b')](function(){return new BPromise(function(_0x80f3a6,_0x5a5049){zipdir(_0x784b1,{'saveTo':_0x11a959},function(_0x214704,_0x20bb0c){if(_0x214704)return _0x5a5049(_0x214704);return _0x80f3a6(_0x20bb0c);});})[_0x80c4('0x2b')](function(){return new BPromise(function(_0xdb649e,_0x41951a){rimraf(_0x784b1,function(_0x284db1){if(_0x284db1)_0x41951a(_0x284db1);return _0xdb649e();});});})['then'](function(){return _0x9839f1[_0x80c4('0xef')](_0x11a959,_0x46b4fe,function(_0x356468){if(_0x356468){console['log'](_0x80c4('0xf0'),_0x356468);}else{fs['unlinkSync'](_0x11a959);}});});});}else{return _0x9839f1[_0x80c4('0xf1')](0xc8);}})[_0x80c4('0xaf')](handleError(_0x9839f1,null));};
\ No newline at end of file
+var _0xa7d3=['Attachment','basename','pipe','createWriteStream','direction','out','System','downloadInteraction.html','toFile','transcript-','.pdf','err','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','send','Users','map','fullname','TagIds','forEach','push','index','OpenchannelInteraction','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','count','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','catch','show','params','includeAll','include','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','filters','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','removeTags','unix','join','root','files','server','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Messages','OpenchannelAccount','Account','Owner','get','mkdirSync','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Openchannel','YYYY-MM-DD','closed','closedAt','disposition','threadId','Public','Private'];(function(_0xd323b,_0x282689){var _0x19ba89=function(_0x48cb9e){while(--_0x48cb9e){_0xd323b['push'](_0xd323b['shift']());}};_0x19ba89(++_0x282689);}(_0xa7d3,0x1ea));var _0x3a7d=function(_0x493c55,_0x458539){_0x493c55=_0x493c55-0x0;var _0x5e4e5a=_0xa7d3[_0x493c55];return _0x5e4e5a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3a7d('0x0'));var jsonpatch=require(_0x3a7d('0x1'));var rp=require(_0x3a7d('0x2'));var moment=require(_0x3a7d('0x3'));var BPromise=require(_0x3a7d('0x4'));var Mustache=require(_0x3a7d('0x5'));var util=require(_0x3a7d('0x6'));var path=require(_0x3a7d('0x7'));var sox=require(_0x3a7d('0x8'));var csv=require(_0x3a7d('0x9'));var ejs=require(_0x3a7d('0xa'));var fs=require('fs');var _=require(_0x3a7d('0xb'));var squel=require('squel');var crypto=require(_0x3a7d('0xc'));var jsforce=require(_0x3a7d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3a7d('0x9'));var querystring=require(_0x3a7d('0xe'));var Papa=require(_0x3a7d('0xf'));var Redis=require('ioredis');var authService=require(_0x3a7d('0x10'));var qs=require(_0x3a7d('0x11'));var as=require(_0x3a7d('0x12'));var hardwareService=require(_0x3a7d('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3a7d('0x14'))['db'];config['redis']=_['defaults'](config[_0x3a7d('0x15')],{'host':_0x3a7d('0x16'),'port':0x18eb});var socket=require(_0x3a7d('0x17'))(new Redis(config[_0x3a7d('0x15')]));require(_0x3a7d('0x18'))[_0x3a7d('0x19')](socket);function respondWithStatusCode(_0x6772bf,_0x2b0381){_0x2b0381=_0x2b0381||0xcc;return function(_0x1e1bbb){if(_0x1e1bbb){return _0x6772bf[_0x3a7d('0x1a')](_0x2b0381);}return _0x6772bf[_0x3a7d('0x1b')](_0x2b0381)['end']();};}function respondWithResult(_0x3b118d,_0x5be59f){_0x5be59f=_0x5be59f||0xc8;return function(_0x3017bd){if(_0x3017bd){return _0x3b118d[_0x3a7d('0x1b')](_0x5be59f)[_0x3a7d('0x1c')](_0x3017bd);}};}function respondWithFilteredResult(_0x368817,_0x34dfa1){return function(_0x1be67d){if(_0x1be67d){var _0x3d3caa=_0x1be67d['count'],_0x32e521=_0x34dfa1[_0x3a7d('0x1d')],_0x144a4d=_0x34dfa1[_0x3a7d('0x1d')]+_0x34dfa1[_0x3a7d('0x1e')],_0x25ab84;if(_0x144a4d>=_0x3d3caa){_0x144a4d=_0x3d3caa;_0x25ab84=0xc8;}else{_0x25ab84=0xce;}_0x368817[_0x3a7d('0x1b')](_0x25ab84);return _0x368817[_0x3a7d('0x1f')](_0x3a7d('0x20'),_0x32e521+'-'+_0x144a4d+'/'+_0x3d3caa)[_0x3a7d('0x1c')](_0x1be67d);}return null;};}function patchUpdates(_0x4ee28c){return function(_0x44d07f){try{jsonpatch[_0x3a7d('0x21')](_0x44d07f,_0x4ee28c,!![]);}catch(_0x27bf1a){return BPromise[_0x3a7d('0x22')](_0x27bf1a);}return _0x44d07f[_0x3a7d('0x23')]();};}function saveUpdates(_0x278f05,_0xf1748c){return function(_0x2b2d15){if(_0x2b2d15){return _0x2b2d15[_0x3a7d('0x24')](_0x278f05)[_0x3a7d('0x25')](function(_0x550629){return _0x550629;});}return null;};}function removeEntity(_0x46bcc4,_0x6d0bff){return function(_0x381a7a){if(_0x381a7a){return _0x381a7a['destroy']()[_0x3a7d('0x25')](function(){_0x46bcc4['status'](0xcc)[_0x3a7d('0x26')]();});}};}function handleEntityNotFound(_0x1146bb,_0x1b67ea){return function(_0x330350){if(!_0x330350){_0x1146bb[_0x3a7d('0x1a')](0x194);}return _0x330350;};}function handleError(_0x20440a,_0x191cb8){_0x191cb8=_0x191cb8||0x1f4;return function(_0x219deb){logger[_0x3a7d('0x27')](_0x219deb['stack']);if(_0x219deb[_0x3a7d('0x28')]){delete _0x219deb[_0x3a7d('0x28')];}_0x20440a[_0x3a7d('0x1b')](_0x191cb8)[_0x3a7d('0x29')](_0x219deb);};}function getInteractionUsers(_0x8a69b0,_0x353d22){return new BPromise(function(_0x381181,_0x336a59){try{if(_0x353d22[_0x8a69b0['id']]){_0x8a69b0[_0x3a7d('0x2a')]=_[_0x3a7d('0x2b')](_0x353d22[_0x8a69b0['id']],function(_0x4c9341){return{'id':_0x4c9341['id'],'fullname':_0x4c9341[_0x3a7d('0x2c')]};});}}catch(_0x417e37){_0x336a59(_0x417e37);}_0x381181(_0x8a69b0);});}function getInteractionTags(_0x1628ef,_0x4bf481){return new BPromise(function(_0x2359f2,_0x25c0b4){try{if(_0x1628ef[_0x3a7d('0x2d')]){_0x1628ef['Tags']=[];_0x1628ef[_0x3a7d('0x2d')]['split'](',')[_0x3a7d('0x2e')](function(_0x2a11ba){_0x1628ef['Tags'][_0x3a7d('0x2f')](_0x4bf481[_0x2a11ba]);});}delete _0x1628ef[_0x3a7d('0x2d')];}catch(_0x3012fe){_0x25c0b4(_0x3012fe);}_0x2359f2(_0x1628ef);});}function updateOpenchannelInteraction(_0x492609,_0x459f14,_0x2d3247){return new BPromise(function(_0x124070,_0x326650){return getInteractionUsers(_0x492609,_0x2d3247)[_0x3a7d('0x25')](function(_0x4e2493){return getInteractionTags(_0x4e2493,_0x459f14);})[_0x3a7d('0x25')](function(_0x46070a){_0x124070(_0x46070a);})['catch'](function(_0x3a11aa){_0x326650(_0x3a11aa);});});}exports[_0x3a7d('0x30')]=function(_0x4ee34f,_0x46e3cc){var _0x264cae={},_0x5e7221={},_0x38b467={'count':0x0,'rows':[]};var _0xf2823f=_['map'](db[_0x3a7d('0x31')][_0x3a7d('0x32')],function(_0x7f870e){return{'name':_0x7f870e[_0x3a7d('0x33')],'type':_0x7f870e[_0x3a7d('0x34')]['key']};});_0x5e7221[_0x3a7d('0x35')]=_['map'](_0xf2823f,_0x3a7d('0x28'));_0x5e7221[_0x3a7d('0x36')]=_['keys'](_0x4ee34f[_0x3a7d('0x36')]);_0x5e7221['filters']=_[_0x3a7d('0x37')](_0x5e7221['model'],_0x5e7221[_0x3a7d('0x36')]);_0x264cae['attributes']=_[_0x3a7d('0x37')](_0x5e7221[_0x3a7d('0x35')],qs[_0x3a7d('0x38')](_0x4ee34f['query'][_0x3a7d('0x38')]));_0x264cae[_0x3a7d('0x39')]=_0x264cae[_0x3a7d('0x39')]['length']?_0x264cae['attributes']:_0x5e7221[_0x3a7d('0x35')];if(!_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x3a')](_0x3a7d('0x3b'))){_0x264cae[_0x3a7d('0x1e')]=qs['limit'](_0x4ee34f['query']['limit']);_0x264cae[_0x3a7d('0x1d')]=qs[_0x3a7d('0x1d')](_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x1d')]);}_0x264cae[_0x3a7d('0x3c')]=qs['sort'](_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x3d')]);_0x264cae['where']=qs['filters'](_[_0x3a7d('0x3e')](_0x4ee34f[_0x3a7d('0x36')],_0x5e7221['filters']),_0xf2823f);var _0xd140a0=[];var _0x4711f1=squel[_0x3a7d('0x3f')]()[_0x3a7d('0x40')]('id')['field'](_0x3a7d('0x28'))['field'](_0x3a7d('0x41'))[_0x3a7d('0x42')](_0x3a7d('0x43'));var _0xcd5fc0=squel[_0x3a7d('0x3f')]()[_0x3a7d('0x40')](_0x3a7d('0x44'))[_0x3a7d('0x40')](_0x3a7d('0x45'))[_0x3a7d('0x40')](_0x3a7d('0x46'))['from']('user_has_openchannel_interactions','ui')[_0x3a7d('0x47')](_0x3a7d('0x48'),'u',_0x3a7d('0x49'));var _0x249ea6=squel[_0x3a7d('0x3f')]()['from'](_0x3a7d('0x4a'),'i')[_0x3a7d('0x47')](_0x3a7d('0x4b'),'c',_0x3a7d('0x4c'))[_0x3a7d('0x47')](_0x3a7d('0x48'),'o',_0x3a7d('0x4d'))[_0x3a7d('0x47')]('openchannel_accounts','a',_0x3a7d('0x4e'))[_0x3a7d('0x47')](_0x3a7d('0x4f'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x3a7d('0x47')]('openchannel_interaction_has_tags','it',_0x3a7d('0x50'))[_0x3a7d('0x47')]('tools_tags','t',_0x3a7d('0x51'));var _0x4b9fe6=squel[_0x3a7d('0x52')]();var _0x210058=[];var _0x3ce831=squel[_0x3a7d('0x52')]();var _0x1f1848;if(_0x4ee34f['query'][_0x3a7d('0x53')]){_0x1f1848=as[_0x3a7d('0x54')](_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x53')]);var _0x29eebb=_0x1f1848[_0x3a7d('0x55')];for(var _0x2a9f29=0x0;_0x2a9f29<_0x1f1848[_0x3a7d('0x56')]['length'];_0x2a9f29++){var _0x28281e=_0x1f1848[_0x3a7d('0x56')][_0x2a9f29];var _0x167fe5='i';var _0x21cd8e=_[_0x3a7d('0x57')](_0xf2823f,[_0x3a7d('0x28'),_0x28281e[_0x3a7d('0x40')]]);if(!_0x21cd8e){switch(_0x28281e[_0x3a7d('0x40')]){case _0x3a7d('0x58'):if(_0x28281e[_0x3a7d('0x59')]==0x1){_0x249ea6[_0x3a7d('0x5a')]('`'+_0x28281e[_0x3a7d('0x40')]+_0x3a7d('0x5b'));}else{_0x249ea6['having']('`'+_0x28281e['field']+_0x3a7d('0x5c'));}break;case'Contact':if(_0x28281e[_0x3a7d('0x5d')]===_0x3a7d('0x5e')){if(_0x28281e[_0x3a7d('0x59')][_0x3a7d('0x5f')]('\x20')[_0x3a7d('0x60')]>0x1){_0x4b9fe6[_0x29eebb](_0x3a7d('0x61'),qs['getFullTextValue'](_0x28281e[_0x3a7d('0x59')]),null);}else{var _0x383da2='%'+_0x28281e['value']+'%';_0x4b9fe6[_0x29eebb](_0x3a7d('0x62'),_0x383da2,_0x383da2,_0x383da2);}}else{_0x21cd8e=_['find'](_0xf2823f,[_0x3a7d('0x28'),_0x3a7d('0x63')]);_0x28281e['field']=_0x3a7d('0x63');_0x278846=as[_0x3a7d('0x64')](_0x167fe5,_0x21cd8e[_0x3a7d('0x34')],_0x28281e);_0x4b9fe6[_0x29eebb](_0x278846[_0x3a7d('0x65')],_0x278846[_0x3a7d('0x59')][_0x3a7d('0x66')],_0x278846['value'][_0x3a7d('0x26')]);}break;case _0x3a7d('0x67'):var _0x1dae38=_0x28281e[_0x3a7d('0x59')][_0x3a7d('0x5f')](',')['map'](function(_0x4671ad){return Number(_0x4671ad);});_0x1dae38['forEach'](function(_0x52e0dc){_0x3ce831['or'](_0x3a7d('0x68'),'%,'+_0x52e0dc+',%');});_0x210058=_[_0x3a7d('0x69')](_0x210058,_0x1dae38);break;case _0x3a7d('0x6a'):if(_0x28281e[_0x3a7d('0x5d')]===_0x3a7d('0x5e')){_0x4b9fe6[_0x29eebb](_0x3a7d('0x6b'),'%'+_0x28281e[_0x3a7d('0x59')]+'%',null);}else{_0x21cd8e=_[_0x3a7d('0x57')](_0xf2823f,[_0x3a7d('0x28'),_0x3a7d('0x6c')]);_0x28281e[_0x3a7d('0x40')]=_0x3a7d('0x6c');_0x278846=as['buildExpression'](_0x167fe5,_0x21cd8e[_0x3a7d('0x34')],_0x28281e);_0x4b9fe6[_0x29eebb](_0x278846[_0x3a7d('0x65')],_0x278846['value'][_0x3a7d('0x66')],_0x278846[_0x3a7d('0x59')][_0x3a7d('0x26')]);}break;case _0x3a7d('0x6d'):_0x278846=as[_0x3a7d('0x64')]('me',null,_0x28281e);_0x4b9fe6[_0x29eebb](_0x278846[_0x3a7d('0x65')],_0x278846['value'][_0x3a7d('0x66')],_0x278846[_0x3a7d('0x59')]['end']);break;}}else{var _0x278846=as['buildExpression'](_0x167fe5,_0x21cd8e[_0x3a7d('0x34')],_0x28281e);_0x4b9fe6[_0x29eebb](_0x278846[_0x3a7d('0x65')],_0x278846[_0x3a7d('0x59')][_0x3a7d('0x66')],_0x278846[_0x3a7d('0x59')][_0x3a7d('0x26')]);}}}else{var _0x254139=_(_0x4ee34f['query'])[_0x3a7d('0x6e')]()[_0x3a7d('0x2b')](function(_0x1f573f){return _[_0x3a7d('0x6f')](_0xf2823f,[_0x3a7d('0x28'),_0x1f573f])?_0x1f573f:undefined;})[_0x3a7d('0x70')]()['value']();if(!_[_0x3a7d('0x71')](_0x254139)){_0x254139[_0x3a7d('0x2e')](function(_0xb172cc){if(_0xb172cc===_0x3a7d('0x72')){_0x249ea6['where'](_0x3a7d('0x73'),[][_0x3a7d('0x74')](_0x4ee34f['query'][_0xb172cc]));}else if(_0xb172cc===_0x3a7d('0x75')){var _0x446d13=JSON['parse'](_0x4ee34f[_0x3a7d('0x36')][_0xb172cc])[_0x3a7d('0x76')];var _0x2138cd=JSON[_0x3a7d('0x77')](_0x4ee34f['query'][_0xb172cc])[_0x3a7d('0x78')];_0x249ea6[_0x3a7d('0x79')](_0x3a7d('0x7a'),_0x446d13,_0x2138cd);}else{if(_0x4ee34f[_0x3a7d('0x36')][_0xb172cc]==='null'){_0x249ea6[_0x3a7d('0x79')]('i.'+_0xb172cc+_0x3a7d('0x7b'));}else{_0x249ea6[_0x3a7d('0x79')]('i.'+_0xb172cc+_0x3a7d('0x7c'),_0x4ee34f['query'][_0xb172cc]);}}});}if(_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x7d')]){if(_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x7d')]==0x1){_0x249ea6[_0x3a7d('0x5a')](_0x3a7d('0x7e'));}else{_0x249ea6[_0x3a7d('0x5a')](_0x3a7d('0x7f'));}}if(_0x4ee34f[_0x3a7d('0x36')]['tag']){_0x210058=_[_0x3a7d('0x80')](_0x4ee34f[_0x3a7d('0x36')]['tag'])?_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x81')]:new Array(_0x4ee34f[_0x3a7d('0x36')]['tag']);_0x210058[_0x3a7d('0x2e')](function(_0x5662f0){_0x3ce831['or'](_0x3a7d('0x68'),'%,'+_0x5662f0+',%');});}if(_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x82')]){var _0x863b1d=_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x82')]['replace']('\x5c','\x5c\x5c')[_0x3a7d('0x83')]('\x27\x27',_0x3a7d('0x84'));if(qs[_0x3a7d('0x85')](_0x863b1d)){_0x4b9fe6['or'](_0x3a7d('0x86'),_0x863b1d+'%');}else{_0x4b9fe6['or'](_0x3a7d('0x87'),qs[_0x3a7d('0x88')](_0x863b1d))['or'](_0x3a7d('0x89'),_0x863b1d+'%')['or'](_0x3a7d('0x8a'),_0x863b1d+'%');}}}_0x249ea6['where'](_0x4b9fe6);_0x249ea6['group']('i.id');var _0x5333e4={'type':db[_0x3a7d('0x8b')][_0x3a7d('0x8c')][_0x3a7d('0x8d')],'raw':!![]};var _0x155fb1=_0x249ea6[_0x3a7d('0x8e')]();_0x155fb1['field'](_0x3a7d('0x8f'));_0x155fb1[_0x3a7d('0x40')](_0x3a7d('0x90'),_0x3a7d('0x58'));if(_0x264cae['order']){_0x264cae[_0x3a7d('0x3c')]['forEach'](function(_0x5b604e){_0x249ea6[_0x3a7d('0x3c')]('i.'+_0x5b604e[0x0],_0x5b604e[0x1]===_0x3a7d('0x91')?![]:!![]);});}if(!_['isEmpty'](_0x210058)){_0x249ea6[_0x3a7d('0x5a')](_0x3ce831);_0x155fb1[_0x3a7d('0x79')](_0x3a7d('0x92'),_0x210058);}BPromise[_0x3a7d('0x93')]()[_0x3a7d('0x25')](function(){if(!_0x1f1848){if(_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x72')]||_0x4ee34f[_0x3a7d('0x36')][_0x3a7d('0x94')])return;_0x155fb1[_0x3a7d('0x79')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x249ea6[_0x3a7d('0x79')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}return _0x4ee34f['user'][_0x3a7d('0x95')]({'attributes':['id'],'raw':!![]})[_0x3a7d('0x25')](function(_0x3a9e96){if(_[_0x3a7d('0x71')](_0x3a9e96)){_0x155fb1['where'](_0x3a7d('0x96'));_0x249ea6[_0x3a7d('0x79')](_0x3a7d('0x96'));}else{_0x155fb1['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0x3a7d('0x2b')](_0x3a9e96,'id'));_0x249ea6['where'](_0x3a7d('0x73'),_[_0x3a7d('0x2b')](_0x3a9e96,'id'));}});})[_0x3a7d('0x25')](function(){db['sequelize']['query'](_0x155fb1[_0x3a7d('0x97')](),_0x5333e4)[_0x3a7d('0x25')](function(_0x15c9b7){_0x38b467[_0x3a7d('0x98')]=_0x15c9b7[_0x3a7d('0x60')];if(_0x38b467['count']===0x0)return[];return db['sequelize'][_0x3a7d('0x36')](_0x4711f1[_0x3a7d('0x97')](),_0x5333e4)[_0x3a7d('0x25')](function(_0x5d5f94){_0xd140a0=_[_0x3a7d('0x99')](_0x5d5f94,'id');_0x5333e4=_[_0x3a7d('0x9a')](_0x5333e4,{'model':db[_0x3a7d('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4ee34f[_0x3a7d('0x36')]['fields']){_0x264cae['attributes'][_0x3a7d('0x2e')](function(_0x2a065b){_0x249ea6['field']('i.'+_0x2a065b);});}else{_0x249ea6['field'](_0x3a7d('0x90'),_0x3a7d('0x58'));_0x249ea6[_0x3a7d('0x40')](_0x3a7d('0x9b'),_0x3a7d('0x9c'));_0x249ea6[_0x3a7d('0x40')](_0x3a7d('0x9d'),_0x3a7d('0x9e'));_0x249ea6[_0x3a7d('0x40')]('i.*');_0x249ea6['field'](_0x3a7d('0x9f'),'Contact.firstName');_0x249ea6[_0x3a7d('0x40')](_0x3a7d('0xa0'),_0x3a7d('0xa1'));_0x249ea6[_0x3a7d('0x40')](_0x3a7d('0xa2'),_0x3a7d('0xa3'));_0x249ea6[_0x3a7d('0x40')]('c.phone','Contact.phone');_0x249ea6[_0x3a7d('0x40')]('c.mobile',_0x3a7d('0xa4'));_0x249ea6[_0x3a7d('0x40')](_0x3a7d('0xa5'),_0x3a7d('0xa6'));_0x249ea6[_0x3a7d('0x40')]('o.fullname',_0x3a7d('0xa7'));_0x249ea6[_0x3a7d('0x40')](_0x3a7d('0xa8'),'Owner.internal');_0x249ea6['field'](_0x3a7d('0xa9'),_0x3a7d('0x2d'));}if(_0x264cae[_0x3a7d('0x1e')])_0x249ea6[_0x3a7d('0x1e')](_0x264cae['limit']);if(_0x264cae[_0x3a7d('0x1d')])_0x249ea6[_0x3a7d('0x1d')](_0x264cae[_0x3a7d('0x1d')]);return db[_0x3a7d('0xaa')][_0x3a7d('0x36')](_0x249ea6[_0x3a7d('0x97')](),_0x5333e4);})[_0x3a7d('0x25')](function(_0x48cd24){_0xcd5fc0[_0x3a7d('0x79')](_0x3a7d('0xab'),_['map'](_0x48cd24,'id'));return db[_0x3a7d('0xaa')]['query'](_0xcd5fc0[_0x3a7d('0x97')](),_0x5333e4)[_0x3a7d('0x25')](function(_0x2b9b30){var _0x2aa430=_[_0x3a7d('0xac')](_0x2b9b30,_0x3a7d('0xad'));var _0x4ec7d6=[];_0x48cd24[_0x3a7d('0x2e')](function(_0xc839b4){_0x4ec7d6[_0x3a7d('0x2f')](updateOpenchannelInteraction(_0xc839b4,_0xd140a0,_0x2aa430));});return BPromise['all'](_0x4ec7d6);});});})[_0x3a7d('0x25')](function(_0x2ee190){_0x38b467['rows']=_0x2ee190;return _0x38b467;})[_0x3a7d('0x25')](respondWithFilteredResult(_0x46e3cc,_0x264cae));})[_0x3a7d('0xae')](handleError(_0x46e3cc,null));};exports[_0x3a7d('0xaf')]=function(_0x3d341b,_0x5744af){var _0x245cbb={'raw':![],'where':{'id':_0x3d341b[_0x3a7d('0xb0')]['id']}},_0xbcc51b={};_0xbcc51b[_0x3a7d('0x35')]=_[_0x3a7d('0x6e')](db[_0x3a7d('0x31')][_0x3a7d('0x32')]);_0xbcc51b[_0x3a7d('0x36')]=_[_0x3a7d('0x6e')](_0x3d341b[_0x3a7d('0x36')]);_0xbcc51b['filters']=_[_0x3a7d('0x37')](_0xbcc51b[_0x3a7d('0x35')],_0xbcc51b['query']);_0x245cbb[_0x3a7d('0x39')]=_['intersection'](_0xbcc51b[_0x3a7d('0x35')],qs[_0x3a7d('0x38')](_0x3d341b['query'][_0x3a7d('0x38')]));_0x245cbb[_0x3a7d('0x39')]=_0x245cbb[_0x3a7d('0x39')][_0x3a7d('0x60')]?_0x245cbb[_0x3a7d('0x39')]:_0xbcc51b['model'];if(_0x3d341b[_0x3a7d('0x36')][_0x3a7d('0xb1')]){_0x245cbb[_0x3a7d('0xb2')]=[{'all':!![]}];}_0x245cbb=_[_0x3a7d('0x9a')]({},_0x245cbb,_0x3d341b[_0x3a7d('0xb3')]);return db['OpenchannelInteraction'][_0x3a7d('0x57')](_0x245cbb)['then'](handleEntityNotFound(_0x5744af,null))[_0x3a7d('0x25')](respondWithResult(_0x5744af,null))['catch'](handleError(_0x5744af,null));};exports['create']=function(_0x4d7bc6,_0x9ececc){return db[_0x3a7d('0x31')][_0x3a7d('0xb4')](_0x4d7bc6[_0x3a7d('0x6d')],{})[_0x3a7d('0x25')](respondWithResult(_0x9ececc,0xc9))[_0x3a7d('0xae')](handleError(_0x9ececc,null));};exports[_0x3a7d('0x24')]=function(_0x5b6cba,_0x4a4b36){if(_0x5b6cba['body']['id']){delete _0x5b6cba[_0x3a7d('0x6d')]['id'];}return db['OpenchannelInteraction'][_0x3a7d('0x57')]({'where':{'id':_0x5b6cba[_0x3a7d('0xb0')]['id']}})['then'](handleEntityNotFound(_0x4a4b36,null))[_0x3a7d('0x25')](saveUpdates(_0x5b6cba[_0x3a7d('0x6d')],null))[_0x3a7d('0x25')](respondWithResult(_0x4a4b36,null))[_0x3a7d('0xae')](handleError(_0x4a4b36,null));};exports['destroy']=function(_0x1d73a7,_0x194a8b){return db['OpenchannelInteraction'][_0x3a7d('0x57')]({'where':{'id':_0x1d73a7[_0x3a7d('0xb0')]['id']}})[_0x3a7d('0x25')](handleEntityNotFound(_0x194a8b,null))[_0x3a7d('0x25')](removeEntity(_0x194a8b,null))['catch'](handleError(_0x194a8b,null));};exports['describe']=function(_0x17a737,_0x779c06){return db[_0x3a7d('0x31')][_0x3a7d('0xb5')]()[_0x3a7d('0x25')](respondWithResult(_0x779c06,null))[_0x3a7d('0xae')](handleError(_0x779c06,null));};exports[_0x3a7d('0xb6')]=function(_0x222056,_0x379935,_0x4cfbad){return db[_0x3a7d('0xb7')]['find']({'where':{'id':_0x222056[_0x3a7d('0xb0')]['id']}})[_0x3a7d('0x25')](handleEntityNotFound(_0x379935,null))[_0x3a7d('0x25')](function(_0x1ce99e){if(_0x1ce99e){return _0x1ce99e[_0x3a7d('0xb6')](_0x222056[_0x3a7d('0x6d')][_0x3a7d('0xb8')],_[_0x3a7d('0xb9')](_0x222056[_0x3a7d('0x6d')],[_0x3a7d('0xb8'),'id'])||{});}})['then'](respondWithResult(_0x379935,null))[_0x3a7d('0xae')](handleError(_0x379935,null));};exports[_0x3a7d('0xba')]=function(_0x5d07ee,_0xb80abf,_0x7c97dc){var _0x1116c9={'raw':![],'where':{}};var _0x193374={};var _0x489032={'count':0x0,'rows':[]};return db[_0x3a7d('0x31')][_0x3a7d('0xbb')]({'where':{'id':_0x5d07ee[_0x3a7d('0xb0')]['id']}})['then'](handleEntityNotFound(_0xb80abf,null))['then'](function(_0x4d9aff){if(_0x4d9aff){_0x193374['model']=_[_0x3a7d('0x6e')](db[_0x3a7d('0xb7')][_0x3a7d('0x32')]);_0x193374[_0x3a7d('0x36')]=_['keys'](_0x5d07ee['query']);_0x193374[_0x3a7d('0xbc')]=_[_0x3a7d('0x37')](_0x193374['model'],_0x193374[_0x3a7d('0x36')]);_0x1116c9['attributes']=_[_0x3a7d('0x37')](_0x193374[_0x3a7d('0x35')],qs['fields'](_0x5d07ee[_0x3a7d('0x36')][_0x3a7d('0x38')]));_0x1116c9[_0x3a7d('0x39')]=_0x1116c9[_0x3a7d('0x39')][_0x3a7d('0x60')]?_0x1116c9[_0x3a7d('0x39')]:_0x193374[_0x3a7d('0x35')];if(!_0x5d07ee[_0x3a7d('0x36')][_0x3a7d('0x3a')](_0x3a7d('0x3b'))){_0x1116c9['limit']=qs[_0x3a7d('0x1e')](_0x5d07ee['query'][_0x3a7d('0x1e')]);_0x1116c9[_0x3a7d('0x1d')]=qs[_0x3a7d('0x1d')](_0x5d07ee[_0x3a7d('0x36')]['offset']);}_0x1116c9[_0x3a7d('0x3c')]=qs['sort'](_0x5d07ee[_0x3a7d('0x36')]['sort']);_0x1116c9['where']=qs['filters'](_[_0x3a7d('0x3e')](_0x5d07ee[_0x3a7d('0x36')],_0x193374[_0x3a7d('0xbc')]));_0x1116c9[_0x3a7d('0x79')][_0x3a7d('0xad')]=_0x4d9aff['id'];if(_0x5d07ee[_0x3a7d('0x36')][_0x3a7d('0x82')]){_0x1116c9['where']=_[_0x3a7d('0x9a')](_0x1116c9[_0x3a7d('0x79')],{'$or':_[_0x3a7d('0x2b')](_0x1116c9[_0x3a7d('0x39')],function(_0x1ad847){var _0x20385b={};_0x20385b[_0x1ad847]={'$like':'%'+_0x5d07ee['query'][_0x3a7d('0x82')]+'%'};return _0x20385b;})});}if(_0x5d07ee[_0x3a7d('0x36')][_0x3a7d('0x76')]){var _0x2f7baa=_0x5d07ee['query'][_0x3a7d('0x76')]['split'](',');var _0x2cf7a7={};_0x2cf7a7[_0x2f7baa[0x0]]={'$gte':moment(_0x2f7baa[0x1])[_0x3a7d('0xbd')](_0x3a7d('0xbe'))};_0x1116c9[_0x3a7d('0x79')]=_[_0x3a7d('0x9a')](_0x1116c9[_0x3a7d('0x79')],_0x2cf7a7);}_0x1116c9=_[_0x3a7d('0x9a')]({},_0x1116c9,_0x5d07ee[_0x3a7d('0xb3')]);return db[_0x3a7d('0xb7')][_0x3a7d('0x98')]({'where':_0x1116c9[_0x3a7d('0x79')]})[_0x3a7d('0x25')](function(_0x410356){_0x489032[_0x3a7d('0x98')]=_0x410356;if(_0x5d07ee[_0x3a7d('0x36')][_0x3a7d('0xb1')]){_0x1116c9[_0x3a7d('0xb2')]=[{'all':!![]}];}return db[_0x3a7d('0xb7')][_0x3a7d('0xbf')](_0x1116c9);})['then'](function(_0x36d7c2){_0x489032[_0x3a7d('0xc0')]=_0x36d7c2;return _0x489032;});}})[_0x3a7d('0x25')](respondWithFilteredResult(_0xb80abf,_0x1116c9))[_0x3a7d('0xae')](handleError(_0xb80abf,null));};exports[_0x3a7d('0xc1')]=function(_0x233fb3,_0x240dd0,_0x16c625){return db[_0x3a7d('0x31')][_0x3a7d('0x57')]({'where':{'id':_0x233fb3['params']['id']}})[_0x3a7d('0x25')](handleEntityNotFound(_0x240dd0,null))[_0x3a7d('0x25')](function(_0x249939){if(_0x249939){return _0x249939[_0x3a7d('0xc2')](_0x233fb3[_0x3a7d('0x6d')][_0x3a7d('0xb8')],_[_0x3a7d('0xb9')](_0x233fb3[_0x3a7d('0x6d')],['ids','id'])||{})[_0x3a7d('0xc3')](function(){return db[_0x3a7d('0x67')][_0x3a7d('0xbf')]({'attributes':['id','name',_0x3a7d('0x41')],'where':{'id':_0x233fb3[_0x3a7d('0x6d')][_0x3a7d('0xb8')]}});})[_0x3a7d('0x25')](function(_0x4e9b37){socket[_0x3a7d('0xc4')]('openchannelInteractionTags:save',{'id':Number(_0x233fb3['params']['id']),'tags':_0x4e9b37||[]});return{'id':Number(_0x233fb3[_0x3a7d('0xb0')]['id']),'tags':_0x4e9b37||[]};});}})[_0x3a7d('0x25')](respondWithResult(_0x240dd0,null))['catch'](handleError(_0x240dd0,null));};exports[_0x3a7d('0xc5')]=function(_0x51aa31,_0x5d1ae6,_0xd7f014){return db[_0x3a7d('0x31')]['find']({'where':{'id':_0x51aa31['params']['id']}})['then'](handleEntityNotFound(_0x5d1ae6,null))[_0x3a7d('0x25')](function(_0xc45a32){if(_0xc45a32){return _0xc45a32[_0x3a7d('0xc5')](_0x51aa31[_0x3a7d('0x36')][_0x3a7d('0xb8')]);}})[_0x3a7d('0x25')](respondWithStatusCode(_0x5d1ae6,null))['catch'](handleError(_0x5d1ae6,null));};exports['download']=function(_0x550071,_0x29c08b){var _0x35ce82=moment()[_0x3a7d('0xc6')]()['toString']();var _0x5392f4=path[_0x3a7d('0xc7')](config[_0x3a7d('0xc8')],'server',_0x3a7d('0xc9'),'tmp');var _0x12499b=path[_0x3a7d('0xc7')](config['root'],_0x3a7d('0xca'),_0x3a7d('0xc9'),_0x3a7d('0xcb'));var _0x109fe6=path['join'](_0x5392f4,_0x35ce82);var _0x372f08=util['format'](_0x3a7d('0xcc'),_0x550071[_0x3a7d('0xb0')]['id'],_0x35ce82);var _0x1a3913=path[_0x3a7d('0xc7')](_0x5392f4,_0x372f08);var _0x2873af=[];_0x2873af['push']({'model':db['User'],'as':_0x3a7d('0x6a'),'attributes':['id',_0x3a7d('0x2c')],'raw':!![]});_0x2873af[_0x3a7d('0x2f')]({'model':db[_0x3a7d('0xcd')],'as':_0x3a7d('0xce'),'attributes':['id',_0x3a7d('0xcf'),_0x3a7d('0xd0')],'raw':!![]});if(_0x550071[_0x3a7d('0x36')][_0x3a7d('0xcb')]){_0x2873af[_0x3a7d('0x2f')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x1c65aa=[{'model':db['OpenchannelMessage'],'as':_0x3a7d('0xd1'),'attributes':['id',_0x3a7d('0x6d'),_0x3a7d('0x75'),'direction','secret',_0x3a7d('0x7d')],'include':_0x2873af}];_0x1c65aa[_0x3a7d('0x2f')]({'model':db[_0x3a7d('0xd2')],'as':_0x3a7d('0xd3'),'attributes':['id',_0x3a7d('0x28')]});_0x1c65aa[_0x3a7d('0x2f')]({'model':db[_0x3a7d('0x6a')],'as':_0x3a7d('0xd4'),'attributes':['id',_0x3a7d('0x2c')]});return db[_0x3a7d('0x31')]['find']({'where':{'id':_0x550071['params']['id']},'include':_0x1c65aa})[_0x3a7d('0x25')](handleEntityNotFound(_0x29c08b,null))[_0x3a7d('0x25')](function(_0x56ad37){if(_0x56ad37){var _0x264ffd=_0x56ad37[_0x3a7d('0xd5')]({'plain':!![]});fs[_0x3a7d('0xd6')](_0x109fe6);var _0x41a695={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':_0x3a7d('0xd7')}},'footer':{'height':_0x3a7d('0xd8'),'contents':{'default':util[_0x3a7d('0xbd')](_0x3a7d('0xd9'),util['format'](_0x3a7d('0xda'),_0x3a7d('0xdb'),_0x264ffd['id']),moment()[_0x3a7d('0xbd')](_0x3a7d('0xdc'))[_0x3a7d('0x97')]())}}};var _0x281447={'channel':_0x3a7d('0xdb'),'account':_0x264ffd[_0x3a7d('0xd3')][_0x3a7d('0x28')],'agent':_0x264ffd[_0x3a7d('0xd4')]?_0x264ffd[_0x3a7d('0xd4')]['fullname']:'N.A.','createdAt':moment(_0x264ffd[_0x3a7d('0x75')])[_0x3a7d('0xbd')](_0x3a7d('0xbe'))[_0x3a7d('0x97')](),'closedAt':_0x264ffd[_0x3a7d('0xdd')]?moment(_0x264ffd[_0x3a7d('0xde')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3a7d('0x97')]():'','disposition':_0x264ffd[_0x3a7d('0xdf')],'visibility':_0x264ffd[_0x3a7d('0xe0')]?_0x3a7d('0xe1'):_0x3a7d('0xe2'),'messages':_(_0x264ffd[_0x3a7d('0xd1')])[_0x3a7d('0x82')]({'secret':![]})[_0x3a7d('0x2b')](function(_0x24abd8){if(_0x24abd8[_0x3a7d('0xe3')]){var _0x563302=path[_0x3a7d('0xc7')](_0x12499b,_0x24abd8[_0x3a7d('0xe3')][_0x3a7d('0xe4')]);if(fs['existsSync'](_0x563302)){fs['createReadStream'](_0x563302)[_0x3a7d('0xe5')](fs[_0x3a7d('0xe6')](path[_0x3a7d('0xc7')](_0x109fe6,_0x24abd8[_0x3a7d('0xe3')][_0x3a7d('0xe4')])));}}return{'date':moment(_0x24abd8['createdAt'])['format'](_0x3a7d('0xbe'))[_0x3a7d('0x97')](),'sender':_0x24abd8[_0x3a7d('0xe7')]===_0x3a7d('0xe8')?_0x24abd8[_0x3a7d('0x6a')]?_0x24abd8[_0x3a7d('0x6a')][_0x3a7d('0x2c')]:_0x3a7d('0xe9'):_0x24abd8[_0x3a7d('0xce')]['firstName']+(_0x24abd8[_0x3a7d('0xce')][_0x3a7d('0xd0')]?'\x20'+_0x24abd8[_0x3a7d('0xce')]['lastName']:''),'body':_0x24abd8['Attachment']?_0x24abd8[_0x3a7d('0xe3')][_0x3a7d('0xe4')]:_0x24abd8[_0x3a7d('0x6d')],'direction':_0x24abd8[_0x3a7d('0xe7')]===_0x3a7d('0xe8')?'A':'C','secret':_0x24abd8['secret'],'read':_0x24abd8['read'],'attachment':_0x24abd8[_0x3a7d('0xe3')]};})['value']()};return ejs['renderFile'](path[_0x3a7d('0xc7')](config[_0x3a7d('0xc8')],_0x3a7d('0xca'),'views',_0x3a7d('0xea')),{'interaction':_0x281447})['then'](function(_0x313be4){return new BPromise(function(_0x455157,_0x3e0c93){pdf[_0x3a7d('0xb4')](_0x313be4,_0x41a695)[_0x3a7d('0xeb')](path['join'](_0x109fe6,_0x3a7d('0xec')+_0x264ffd['id']+'-'+_0x35ce82+_0x3a7d('0xed')),function(_0x2d6608,_0x4a2251){if(_0x2d6608)return _0x3e0c93(_0x2d6608);_0x455157(_0x4a2251);});});})[_0x3a7d('0x25')](function(){return new BPromise(function(_0x42e9ac,_0x5c333d){zipdir(_0x109fe6,{'saveTo':_0x1a3913},function(_0x3db246,_0x108b22){if(_0x3db246)return _0x5c333d(_0x3db246);return _0x42e9ac(_0x108b22);});})['then'](function(){return new BPromise(function(_0x3efafa,_0x186829){rimraf(_0x109fe6,function(_0x296078){if(_0x296078)_0x186829(_0x296078);return _0x3efafa();});});})[_0x3a7d('0x25')](function(){return _0x29c08b['download'](_0x1a3913,_0x372f08,function(_0x2ff68a){if(_0x2ff68a){console['log'](_0x3a7d('0xee'),_0x2ff68a);}else{fs['unlinkSync'](_0x1a3913);}});});});}else{return _0x29c08b[_0x3a7d('0x1a')](0xc8);}})[_0x3a7d('0xae')](handleError(_0x29c08b,null));};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js
index 341c63f..25f828c 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.events.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ca2=['setDataValue','Users','findAll','length','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','save','getUsers','then'];(function(_0xedc133,_0x39842c){var _0x58c7fb=function(_0x5ef1a5){while(--_0x5ef1a5){_0xedc133['push'](_0xedc133['shift']());}};_0x58c7fb(++_0x39842c);}(_0x2ca2,0xe4));var _0x22ca=function(_0x5bb14f,_0x106d44){_0x5bb14f=_0x5bb14f-0x0;var _0x219019=_0x2ca2[_0x5bb14f];return _0x219019;};'use strict';var EventEmitter=require(_0x22ca('0x0'));var OpenchannelInteraction=require(_0x22ca('0x1'))['db'][_0x22ca('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x22ca('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2997ad){return function(_0x148140,_0x36f157,_0x4ff236){_0x148140[_0x22ca('0x4')]({'attributes':['id'],'raw':!![]})[_0x22ca('0x5')](function(_0x165da8){_0x148140[_0x22ca('0x6')](_0x22ca('0x7'),_0x165da8['map'](function(_0x362654){return{'id':_0x362654['id']};}));return OpenchannelMessage[_0x22ca('0x8')]({'where':{'OpenchannelInteractionId':_0x148140['id'],'direction':'in','read':![]},'raw':!![]});})[_0x22ca('0x5')](function(_0x1e22cd){_0x148140[_0x22ca('0x6')]('unreadMessages',_0x1e22cd[_0x22ca('0x9')]);OpenchannelInteractionEvents['emit'](_0x2997ad+':'+_0x148140['id'],_0x148140);OpenchannelInteractionEvents['emit'](_0x2997ad,_0x148140);_0x4ff236(null);})['catch'](_0x4ff236(null));};}for(var e in events){if(events[_0x22ca('0xa')](e)){var event=events[e];OpenchannelInteraction[_0x22ca('0xb')](e,emitEvent(event));}}module[_0x22ca('0xc')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xee7c=['setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','update','remove','then'];(function(_0x4b77d4,_0x5524f2){var _0x25ce4=function(_0x254121){while(--_0x254121){_0x4b77d4['push'](_0x4b77d4['shift']());}};_0x25ce4(++_0x5524f2);}(_0xee7c,0x1ad));var _0xcee7=function(_0x447233,_0x307314){_0x447233=_0x447233-0x0;var _0x533329=_0xee7c[_0x447233];return _0x533329;};'use strict';var EventEmitter=require(_0xcee7('0x0'));var OpenchannelInteraction=require(_0xcee7('0x1'))['db'][_0xcee7('0x2')];var OpenchannelMessage=require(_0xcee7('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcee7('0x3'),'afterDestroy':_0xcee7('0x4')};function emitEvent(_0x2ed523){return function(_0x6b1bb6,_0x4d85f,_0x300b4c){_0x6b1bb6['getUsers']({'attributes':['id'],'raw':!![]})[_0xcee7('0x5')](function(_0x545825){_0x6b1bb6[_0xcee7('0x6')](_0xcee7('0x7'),_0x545825['map'](function(_0x33484b){return{'id':_0x33484b['id']};}));return OpenchannelMessage[_0xcee7('0x8')]({'where':{'OpenchannelInteractionId':_0x6b1bb6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcee7('0x5')](function(_0xbf91ce){_0x6b1bb6[_0xcee7('0x6')](_0xcee7('0x9'),_0xbf91ce[_0xcee7('0xa')]);OpenchannelInteractionEvents['emit'](_0x2ed523+':'+_0x6b1bb6['id'],_0x6b1bb6);OpenchannelInteractionEvents[_0xcee7('0xb')](_0x2ed523,_0x6b1bb6);_0x300b4c(null);})['catch'](_0x300b4c(null));};}for(var e in events){if(events[_0xcee7('0xc')](e)){var event=events[e];OpenchannelInteraction[_0xcee7('0xd')](e,emitEvent(event));}}module[_0xcee7('0xe')]=OpenchannelInteractionEvents;
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js
index 09f08f3..f38d8fe 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.model.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb84e=['OpenchannelInteraction','openchannel_interactions','closed','closedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x34bd11,_0x322433){var _0x2a4f5c=function(_0x3296e3){while(--_0x3296e3){_0x34bd11['push'](_0x34bd11['shift']());}};_0x2a4f5c(++_0x322433);}(_0xb84e,0x8b));var _0xeb84=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0xb84e[_0x282a1f];return _0x296ea7;};'use strict';var _=require(_0xeb84('0x0'));var util=require(_0xeb84('0x1'));var logger=require(_0xeb84('0x2'))(_0xeb84('0x3'));var moment=require(_0xeb84('0x4'));var BPromise=require(_0xeb84('0x5'));var rp=require(_0xeb84('0x6'));var fs=require('fs');var path=require(_0xeb84('0x7'));var rimraf=require(_0xeb84('0x8'));var config=require(_0xeb84('0x9'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x3e80d0,_0x14c57a){return _0x3e80d0[_0xeb84('0xa')](_0xeb84('0xb'),attributes,{'tableName':_0xeb84('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x261de0,_0x3eec15,_0x41bef4){if(_0x261de0['changed'](_0xeb84('0xd'))){_0x261de0[_0xeb84('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x41bef4(null,_0x261de0);}}});};
\ No newline at end of file
+var _0x62a5=['YYYY-MM-DD\x20HH:mm:ss','lodash','request-promise','path','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','changed','closed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62a5,0x12d));var _0x562a=function(_0x350385,_0x2f5d8b){_0x350385=_0x350385-0x0;var _0x92ccb3=_0x62a5[_0x350385];return _0x92ccb3;};'use strict';var _=require(_0x562a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x562a('0x1'));var fs=require('fs');var path=require(_0x562a('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x562a('0x3'));module[_0x562a('0x4')]=function(_0x3a3ffa,_0x549975){return _0x3a3ffa[_0x562a('0x5')](_0x562a('0x6'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fb98a,_0x232955,_0x3109e6){if(_0x2fb98a[_0x562a('0x7')](_0x562a('0x8'))){_0x2fb98a['closedAt']=moment()['format'](_0x562a('0x9'));}_0x3109e6(null,_0x2fb98a);}}});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js
index b4c69b3..5b5c4c2 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.rpc.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc91d=['result','catch','UpdateOpenchannelInteraction','body','options','raw','limit','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','where','addTags','omit','ids','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x172660,_0x260d9b){var _0x83204f=function(_0x4d6c80){while(--_0x4d6c80){_0x172660['push'](_0x172660['shift']());}};_0x83204f(++_0x260d9b);}(_0xc91d,0xb0));var _0xdc91=function(_0x16f999,_0x185767){_0x16f999=_0x16f999-0x0;var _0x50e988=_0xc91d[_0x16f999];return _0x50e988;};'use strict';var _=require('lodash');var util=require(_0xdc91('0x0'));var moment=require(_0xdc91('0x1'));var BPromise=require(_0xdc91('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc91('0x3'));var db=require(_0xdc91('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc91('0x5'))(_0xdc91('0x6'));var config=require(_0xdc91('0x7'));var jayson=require(_0xdc91('0x8'));var client=jayson['client'][_0xdc91('0x9')]({'port':0x232a});config[_0xdc91('0xa')]=_['defaults'](config[_0xdc91('0xa')],{'host':_0xdc91('0xb'),'port':0x18eb});var socket=require(_0xdc91('0xc'))(new Redis(config[_0xdc91('0xa')]));require('./openchannelInteraction.socket')[_0xdc91('0xd')](socket);function respondWithRpcPromise(_0x176245,_0x45798a,_0x360ed4){return new BPromise(function(_0x275263,_0x4094de){return client[_0xdc91('0xe')](_0x176245,_0x360ed4)[_0xdc91('0xf')](function(_0x211a96){logger['info'](_0xdc91('0x10'),_0x45798a,_0xdc91('0x11'));logger['debug'](_0xdc91('0x12'),_0x45798a,_0xdc91('0x11'),JSON[_0xdc91('0x13')](_0x211a96));if(_0x211a96['error']){if(_0x211a96[_0xdc91('0x14')][_0xdc91('0x15')]===0x1f4){logger[_0xdc91('0x14')](_0xdc91('0x10'),_0x45798a,_0x211a96[_0xdc91('0x14')][_0xdc91('0x16')]);return _0x4094de(_0x211a96['error'][_0xdc91('0x16')]);}logger[_0xdc91('0x14')](_0xdc91('0x10'),_0x45798a,_0x211a96[_0xdc91('0x14')]['message']);return _0x275263(_0x211a96['error'][_0xdc91('0x16')]);}else{logger[_0xdc91('0x17')](_0xdc91('0x10'),_0x45798a,_0xdc91('0x11'));_0x275263(_0x211a96[_0xdc91('0x18')]['message']);}})[_0xdc91('0x19')](function(_0x28bdbd){logger[_0xdc91('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x45798a,_0x28bdbd);_0x4094de(_0x28bdbd);});});}exports[_0xdc91('0x1a')]=function(_0x2bd887){var _0x3e57e3=this;return new Promise(function(_0x3be250,_0x483f0b){return db['OpenchannelInteraction']['update'](_0x2bd887[_0xdc91('0x1b')],{'raw':_0x2bd887[_0xdc91('0x1c')]?_0x2bd887[_0xdc91('0x1c')][_0xdc91('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bd887['options']?_0x2bd887[_0xdc91('0x1c')]['where']||null:null,'attributes':_0x2bd887[_0xdc91('0x1c')]?_0x2bd887[_0xdc91('0x1c')]['attributes']||null:null,'limit':_0x2bd887[_0xdc91('0x1c')]?_0x2bd887[_0xdc91('0x1c')][_0xdc91('0x1e')]||null:null})[_0xdc91('0xf')](function(_0xd20550){logger[_0xdc91('0x17')](_0xdc91('0x1a'),_0x2bd887);logger[_0xdc91('0x1f')](_0xdc91('0x1a'),_0x2bd887,JSON[_0xdc91('0x13')](_0xd20550));_0x3be250(_0xd20550);})[_0xdc91('0x19')](function(_0x3131d9){logger[_0xdc91('0x14')](_0xdc91('0x1a'),_0x3131d9[_0xdc91('0x16')],_0x2bd887);_0x483f0b(_0x3e57e3[_0xdc91('0x14')](0x1f4,_0x3131d9['message']));});});};exports[_0xdc91('0x20')]=function(_0x273807){return new Promise(function(_0x31c67e,_0x9f0291){return db[_0xdc91('0x21')][_0xdc91('0x22')]({'where':_0x273807['options']?_0x273807[_0xdc91('0x1c')][_0xdc91('0x23')]||null:null})[_0xdc91('0xf')](function(_0x1c4b75){if(_0x1c4b75){return _0x1c4b75[_0xdc91('0x24')](_0x273807[_0xdc91('0x1b')]['ids'],_[_0xdc91('0x25')](_0x273807[_0xdc91('0x1b')],[_0xdc91('0x26'),'id'])||{});}})['spread'](function(_0x211c00){logger['info'](_0xdc91('0x27'),_0x273807);logger[_0xdc91('0x1f')]('AddTags',_0x273807,JSON[_0xdc91('0x13')](_0x211c00));_0x31c67e(_0x211c00);})[_0xdc91('0x19')](function(_0x3892ed){logger['error'](_0xdc91('0x27'),_0x3892ed[_0xdc91('0x16')],_0x273807);_0x9f0291(_this['error'](0x1f4,_0x3892ed[_0xdc91('0x16')]));});});};
\ No newline at end of file
+var _0x4766=['limit','then','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./openchannelInteraction.socket','request\x20sent','debug','stringify','error','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0x4766,0xe6));var _0x6476=function(_0x55841f,_0x27f640){_0x55841f=_0x55841f-0x0;var _0x35824a=_0x4766[_0x55841f];return _0x35824a;};'use strict';var _=require(_0x6476('0x0'));var util=require(_0x6476('0x1'));var moment=require(_0x6476('0x2'));var BPromise=require(_0x6476('0x3'));var rs=require(_0x6476('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6476('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6476('0x6'))(_0x6476('0x7'));var config=require(_0x6476('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6476('0x9')][_0x6476('0xa')]({'port':0x232a});config[_0x6476('0xb')]=_[_0x6476('0xc')](config[_0x6476('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6476('0xb')]));require(_0x6476('0xd'))['register'](socket);function respondWithRpcPromise(_0x1e7266,_0x1d2188,_0x33210a){return new BPromise(function(_0x4ba1c7,_0x27c7d1){return client['request'](_0x1e7266,_0x33210a)['then'](function(_0x7ebba3){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x1d2188,_0x6476('0xe'));logger[_0x6476('0xf')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1d2188,_0x6476('0xe'),JSON[_0x6476('0x10')](_0x7ebba3));if(_0x7ebba3[_0x6476('0x11')]){if(_0x7ebba3[_0x6476('0x11')]['code']===0x1f4){logger['error'](_0x6476('0x12'),_0x1d2188,_0x7ebba3['error']['message']);return _0x27c7d1(_0x7ebba3[_0x6476('0x11')][_0x6476('0x13')]);}logger[_0x6476('0x11')](_0x6476('0x12'),_0x1d2188,_0x7ebba3[_0x6476('0x11')][_0x6476('0x13')]);return _0x4ba1c7(_0x7ebba3[_0x6476('0x11')]['message']);}else{logger[_0x6476('0x14')](_0x6476('0x12'),_0x1d2188,_0x6476('0xe'));_0x4ba1c7(_0x7ebba3[_0x6476('0x15')][_0x6476('0x13')]);}})[_0x6476('0x16')](function(_0x4d14a7){logger[_0x6476('0x11')](_0x6476('0x12'),_0x1d2188,_0x4d14a7);_0x27c7d1(_0x4d14a7);});});}exports[_0x6476('0x17')]=function(_0x40359a){var _0x494da=this;return new Promise(function(_0x2b6d37,_0x107d2e){return db['OpenchannelInteraction'][_0x6476('0x18')](_0x40359a[_0x6476('0x19')],{'raw':_0x40359a[_0x6476('0x1a')]?_0x40359a[_0x6476('0x1a')][_0x6476('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40359a['options']?_0x40359a[_0x6476('0x1a')][_0x6476('0x1c')]||null:null,'attributes':_0x40359a['options']?_0x40359a[_0x6476('0x1a')]['attributes']||null:null,'limit':_0x40359a[_0x6476('0x1a')]?_0x40359a[_0x6476('0x1a')][_0x6476('0x1d')]||null:null})[_0x6476('0x1e')](function(_0x2cdf0d){logger[_0x6476('0x14')](_0x6476('0x17'),_0x40359a);logger[_0x6476('0xf')](_0x6476('0x17'),_0x40359a,JSON[_0x6476('0x10')](_0x2cdf0d));_0x2b6d37(_0x2cdf0d);})['catch'](function(_0x22771b){logger['error']('UpdateOpenchannelInteraction',_0x22771b['message'],_0x40359a);_0x107d2e(_0x494da['error'](0x1f4,_0x22771b[_0x6476('0x13')]));});});};exports[_0x6476('0x1f')]=function(_0x5536e0){return new Promise(function(_0x1c5f5d,_0x13b918){return db[_0x6476('0x20')][_0x6476('0x21')]({'where':_0x5536e0['options']?_0x5536e0['options'][_0x6476('0x1c')]||null:null})[_0x6476('0x1e')](function(_0x405c20){if(_0x405c20){return _0x405c20[_0x6476('0x22')](_0x5536e0['body'][_0x6476('0x23')],_['omit'](_0x5536e0[_0x6476('0x19')],[_0x6476('0x23'),'id'])||{});}})['spread'](function(_0x3671e4){logger['info'](_0x6476('0x24'),_0x5536e0);logger[_0x6476('0xf')]('AddTags',_0x5536e0,JSON[_0x6476('0x10')](_0x3671e4));_0x1c5f5d(_0x3671e4);})[_0x6476('0x16')](function(_0x1e6284){logger[_0x6476('0x11')](_0x6476('0x24'),_0x1e6284[_0x6476('0x13')],_0x5536e0);_0x13b918(_this[_0x6476('0x11')](0x1f4,_0x1e6284['message']));});});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js
index 0a76bbd..cf95585 100644
--- a/server/api/openchannelInteraction/openchannelInteraction.socket.js
+++ b/server/api/openchannelInteraction/openchannelInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc354=['./openchannelInteraction.events','save','remove','update','removeListener','register','length','openchannelInteraction:'];(function(_0x520927,_0x55ba28){var _0x28b7f6=function(_0x50afc0){while(--_0x50afc0){_0x520927['push'](_0x520927['shift']());}};_0x28b7f6(++_0x55ba28);}(_0xc354,0x98));var _0x4c35=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc354[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelInteractionEvents=require(_0x4c35('0x0'));var events=[_0x4c35('0x1'),_0x4c35('0x2'),_0x4c35('0x3')];function createListener(_0x317d7e,_0xbb238e){return function(_0x48e78f){_0xbb238e['emit'](_0x317d7e,_0x48e78f);};}function removeListener(_0x57599b,_0x5a6f76){return function(){OpenchannelInteractionEvents[_0x4c35('0x4')](_0x57599b,_0x5a6f76);};}exports[_0x4c35('0x5')]=function(_0x14ffc3){for(var _0x3c4cd1=0x0,_0x5cdee6=events[_0x4c35('0x6')];_0x3c4cd1<_0x5cdee6;_0x3c4cd1++){var _0x19edfe=events[_0x3c4cd1];var _0x8d9057=createListener(_0x4c35('0x7')+_0x19edfe,_0x14ffc3);OpenchannelInteractionEvents['on'](_0x19edfe,_0x8d9057);}};
\ No newline at end of file
+var _0x876a=['./openchannelInteraction.events','remove','removeListener','register','length','openchannelInteraction:'];(function(_0x18924d,_0x29439d){var _0x134ed6=function(_0x30c277){while(--_0x30c277){_0x18924d['push'](_0x18924d['shift']());}};_0x134ed6(++_0x29439d);}(_0x876a,0x1ce));var _0xa876=function(_0x4f3a0e,_0x396ed2){_0x4f3a0e=_0x4f3a0e-0x0;var _0x1d5936=_0x876a[_0x4f3a0e];return _0x1d5936;};'use strict';var OpenchannelInteractionEvents=require(_0xa876('0x0'));var events=['save',_0xa876('0x1'),'update'];function createListener(_0x12ad46,_0xcefc26){return function(_0xe1313e){_0xcefc26['emit'](_0x12ad46,_0xe1313e);};}function removeListener(_0x203ab5,_0x16cc4f){return function(){OpenchannelInteractionEvents[_0xa876('0x2')](_0x203ab5,_0x16cc4f);};}exports[_0xa876('0x3')]=function(_0x103899){for(var _0xdd08e4=0x0,_0x56ce36=events[_0xa876('0x4')];_0xdd08e4<_0x56ce36;_0xdd08e4++){var _0x5ea733=events[_0xdd08e4];var _0x1e658f=createListener(_0xa876('0x5')+_0x5ea733,_0x103899);OpenchannelInteractionEvents['on'](_0x5ea733,_0x1e658f);}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js
index 21f2b87..a2c8823 100644
--- a/server/api/openchannelMessage/index.js
+++ b/server/api/openchannelMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x17ab=['show','openchannelmessage:create','create','/:id/accept','put','/:id/reject','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x17ab,0x65));var _0xb17a=function(_0x16e9bb,_0x2040e0){_0x16e9bb=_0x16e9bb-0x0;var _0x1c87fb=_0x17ab[_0x16e9bb];return _0x1c87fb;};'use strict';var multer=require('multer');var util=require(_0xb17a('0x0'));var path=require(_0xb17a('0x1'));var timeout=require('connect-timeout');var express=require(_0xb17a('0x2'));var router=express[_0xb17a('0x3')]();var auth=require(_0xb17a('0x4'));var interaction=require(_0xb17a('0x5'));var config=require(_0xb17a('0x6'));var controller=require(_0xb17a('0x7'));router[_0xb17a('0x8')]('/',auth[_0xb17a('0x9')](),controller[_0xb17a('0xa')]);router[_0xb17a('0x8')](_0xb17a('0xb'),auth['isAuthenticated'](),controller[_0xb17a('0xc')]);router[_0xb17a('0x8')](_0xb17a('0xd'),auth[_0xb17a('0x9')](),controller[_0xb17a('0xe')]);router['post']('/',auth[_0xb17a('0x9')](),interaction['tracked']('openchannel',_0xb17a('0xf')),controller[_0xb17a('0x10')]);router['put'](_0xb17a('0xd'),auth['isAuthenticated'](),controller['update']);router['put'](_0xb17a('0x11'),auth[_0xb17a('0x9')](),controller['accept']);router[_0xb17a('0x12')](_0xb17a('0x13'),auth[_0xb17a('0x9')](),controller['reject']);router[_0xb17a('0x14')](_0xb17a('0xd'),auth['isAuthenticated'](),controller[_0xb17a('0x15')]);module[_0xb17a('0x16')]=router;
\ No newline at end of file
+var _0x1590=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','openchannel','openchannelmessage:create','create','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','util'];(function(_0x473a79,_0x5e608b){var _0x5a91b3=function(_0x302411){while(--_0x302411){_0x473a79['push'](_0x473a79['shift']());}};_0x5a91b3(++_0x5e608b);}(_0x1590,0x12a));var _0x0159=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x1590[_0x45783c];return _0x1161da;};'use strict';var multer=require(_0x0159('0x0'));var util=require(_0x0159('0x1'));var path=require('path');var timeout=require(_0x0159('0x2'));var express=require(_0x0159('0x3'));var router=express['Router']();var auth=require(_0x0159('0x4'));var interaction=require(_0x0159('0x5'));var config=require(_0x0159('0x6'));var controller=require(_0x0159('0x7'));router[_0x0159('0x8')]('/',auth[_0x0159('0x9')](),controller[_0x0159('0xa')]);router['get'](_0x0159('0xb'),auth[_0x0159('0x9')](),controller[_0x0159('0xc')]);router[_0x0159('0x8')](_0x0159('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x0159('0x9')](),interaction['tracked'](_0x0159('0xe'),_0x0159('0xf')),controller[_0x0159('0x10')]);router['put']('/:id',auth[_0x0159('0x9')](),controller['update']);router['put'](_0x0159('0x11'),auth[_0x0159('0x9')](),controller[_0x0159('0x12')]);router[_0x0159('0x13')](_0x0159('0x14'),auth[_0x0159('0x9')](),controller[_0x0159('0x15')]);router[_0x0159('0x16')](_0x0159('0xd'),auth[_0x0159('0x9')](),controller[_0x0159('0x17')]);module[_0x0159('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js
index bb27bc5..5f00eea 100644
--- a/server/api/openchannelMessage/openchannelMessage.attributes.js
+++ b/server/api/openchannelMessage/openchannelMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x789f=['exports','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x4b1744,_0x3f3c39){var _0x5e4a6d=function(_0x594c61){while(--_0x594c61){_0x4b1744['push'](_0x4b1744['shift']());}};_0x5e4a6d(++_0x3f3c39);}(_0x789f,0x197));var _0xf789=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x789f[_0x31a576];return _0x30b1d3;};'use strict';var Sequelize=require(_0xf789('0x0'));module[_0xf789('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf789('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf789('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf789('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf789('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xf789('0x5')]}};
\ No newline at end of file
+var _0x4f1d=['exports','TEXT','medium','BOOLEAN','out'];(function(_0x4ca1bf,_0x2b1d4f){var _0xd46337=function(_0x2797d5){while(--_0x2797d5){_0x4ca1bf['push'](_0x4ca1bf['shift']());}};_0xd46337(++_0x2b1d4f);}(_0x4f1d,0xeb));var _0xd4f1=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x4f1d[_0x1e393b];return _0x3d0bfe;};'use strict';var Sequelize=require('sequelize');module[_0xd4f1('0x0')]={'body':{'type':Sequelize[_0xd4f1('0x1')](_0xd4f1('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd4f1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd4f1('0x4')),'defaultValue':_0xd4f1('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js
index 993019b..7832440 100644
--- a/server/api/openchannelMessage/openchannelMessage.controller.js
+++ b/server/api/openchannelMessage/openchannelMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe7c2=['key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','find','create','body','update','describe','openchannel-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteraction','read1stAt','interaction','role','null','AcceptMessage','interface','SIP/%s','channel','event','accept','EventManager','openchannel','agent','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectmessage','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','http','client','test','Sequelize','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','count','offset','limit','Content-Range','json','reject','save','destroy','end','sendStatus','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type'];(function(_0x13d363,_0x50b6e2){var _0x1ef624=function(_0xc30f3c){while(--_0xc30f3c){_0x13d363['push'](_0x13d363['shift']());}};_0x1ef624(++_0x50b6e2);}(_0xe7c2,0x1b8));var _0x2e7c=function(_0x41ebe6,_0x2398b9){_0x41ebe6=_0x41ebe6-0x0;var _0x4bdba3=_0xe7c2[_0x41ebe6];return _0x4bdba3;};'use strict';var pdf=require(_0x2e7c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2e7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e7c('0x2'));var rp=require(_0x2e7c('0x3'));var moment=require(_0x2e7c('0x4'));var BPromise=require(_0x2e7c('0x5'));var Mustache=require(_0x2e7c('0x6'));var util=require(_0x2e7c('0x7'));var path=require(_0x2e7c('0x8'));var sox=require(_0x2e7c('0x9'));var csv=require(_0x2e7c('0xa'));var ejs=require(_0x2e7c('0xb'));var fs=require('fs');var _=require(_0x2e7c('0xc'));var squel=require(_0x2e7c('0xd'));var crypto=require(_0x2e7c('0xe'));var jsforce=require(_0x2e7c('0xf'));var deskjs=require(_0x2e7c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2e7c('0x11'));var Papa=require(_0x2e7c('0x12'));var Redis=require(_0x2e7c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2e7c('0x14'));var as=require(_0x2e7c('0x15'));var hardwareService=require(_0x2e7c('0x16'));var logger=require(_0x2e7c('0x17'))(_0x2e7c('0x18'));var utils=require(_0x2e7c('0x19'));var config=require('../../config/environment');var db=require(_0x2e7c('0x1a'))['db'];config[_0x2e7c('0x1b')]=_[_0x2e7c('0x1c')](config['redis'],{'host':_0x2e7c('0x1d'),'port':0x18eb});var socket=require(_0x2e7c('0x1e'))(new Redis(config[_0x2e7c('0x1b')]));require(_0x2e7c('0x1f'))['register'](socket);var jayson=require(_0x2e7c('0x20'));var client=jayson['client'][_0x2e7c('0x21')]({'port':0x232c});var client9002=jayson[_0x2e7c('0x22')][_0x2e7c('0x21')]({'port':0x232a});function checkPasswordPattern(_0x1ee155,_0x193a39,_0x255b52){if(_0x255b52){var _0x5994e3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5994e3[_0x2e7c('0x23')](_0x193a39)){return _0x1ee155;}else{throw new db[(_0x2e7c('0x24'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1ee155;}}function respondWithRpcPromise(_0x5ddf44,_0x4b245e,_0x4693f3,_0x42976d){return new BPromise(function(_0x3d2744,_0x57585c){var _0x4c6685=_0x42976d||client;return _0x4c6685[_0x2e7c('0x25')](_0x5ddf44,_0x4693f3)[_0x2e7c('0x26')](function(_0x5159e7){logger[_0x2e7c('0x27')](_0x2e7c('0x28'),_0x4b245e,'request\x20sent');logger[_0x2e7c('0x29')](_0x2e7c('0x2a'),_0x4b245e,_0x2e7c('0x2b'),JSON['stringify'](_0x5159e7));if(_0x5159e7['error']){if(_0x5159e7[_0x2e7c('0x2c')][_0x2e7c('0x2d')]===0x1f4){logger[_0x2e7c('0x2c')](_0x2e7c('0x28'),_0x4b245e,_0x5159e7[_0x2e7c('0x2c')]['message']);return _0x57585c(_0x5159e7[_0x2e7c('0x2c')][_0x2e7c('0x2e')]);}logger[_0x2e7c('0x2c')](_0x2e7c('0x28'),_0x4b245e,_0x5159e7[_0x2e7c('0x2c')][_0x2e7c('0x2e')]);return _0x3d2744(_0x5159e7[_0x2e7c('0x2c')][_0x2e7c('0x2e')]);}else{logger[_0x2e7c('0x27')](_0x2e7c('0x28'),_0x4b245e,_0x2e7c('0x2b'));_0x3d2744(_0x5159e7[_0x2e7c('0x2f')][_0x2e7c('0x2e')]);}})[_0x2e7c('0x30')](function(_0x59d0c7){logger['error'](_0x2e7c('0x28'),_0x4b245e,_0x59d0c7);_0x57585c(_0x59d0c7);});});}function respondWithStatusCode(_0x2f0670,_0x4b30fd){_0x4b30fd=_0x4b30fd||0xcc;return function(_0x26a59b){if(_0x26a59b){return _0x2f0670['sendStatus'](_0x4b30fd);}return _0x2f0670[_0x2e7c('0x31')](_0x4b30fd)['end']();};}function respondWithResult(_0x171fbe,_0xbaba74){_0xbaba74=_0xbaba74||0xc8;return function(_0x332137){if(_0x332137){return _0x171fbe[_0x2e7c('0x31')](_0xbaba74)['json'](_0x332137);}};}function respondWithFilteredResult(_0x576c25,_0x232347){return function(_0x5d4f2e){if(_0x5d4f2e){var _0x7e43c8=_0x5d4f2e[_0x2e7c('0x32')],_0x5dcdfe=_0x232347['offset'],_0x9da822=_0x232347[_0x2e7c('0x33')]+_0x232347[_0x2e7c('0x34')],_0x124d86;if(_0x9da822>=_0x7e43c8){_0x9da822=_0x7e43c8;_0x124d86=0xc8;}else{_0x124d86=0xce;}_0x576c25['status'](_0x124d86);return _0x576c25['set'](_0x2e7c('0x35'),_0x5dcdfe+'-'+_0x9da822+'/'+_0x7e43c8)[_0x2e7c('0x36')](_0x5d4f2e);}return null;};}function patchUpdates(_0x46c0ff){return function(_0x441ecf){try{jsonpatch['apply'](_0x441ecf,_0x46c0ff,!![]);}catch(_0x205868){return BPromise[_0x2e7c('0x37')](_0x205868);}return _0x441ecf[_0x2e7c('0x38')]();};}function saveUpdates(_0x48ba43,_0x45f27d){return function(_0x24f8c7){if(_0x24f8c7){return _0x24f8c7['update'](_0x48ba43)['then'](function(_0x123c9a){return _0x123c9a;});}return null;};}function removeEntity(_0x5a1f6a,_0x2bbbf0){return function(_0x529e07){if(_0x529e07){return _0x529e07[_0x2e7c('0x39')]()[_0x2e7c('0x26')](function(){_0x5a1f6a[_0x2e7c('0x31')](0xcc)[_0x2e7c('0x3a')]();});}};}function handleEntityNotFound(_0x4b2119,_0x51afad){return function(_0x2c52be){if(!_0x2c52be){_0x4b2119[_0x2e7c('0x3b')](0x194);}return _0x2c52be;};}function handleError(_0x4734e8,_0x2edcfe){_0x2edcfe=_0x2edcfe||0x1f4;return function(_0x339bdd){logger[_0x2e7c('0x2c')](_0x339bdd[_0x2e7c('0x3c')]);if(_0x339bdd[_0x2e7c('0x3d')]){delete _0x339bdd[_0x2e7c('0x3d')];}_0x4734e8['status'](_0x2edcfe)['send'](_0x339bdd);};}exports[_0x2e7c('0x3e')]=function(_0x1abf67,_0x50b68a){var _0x2d245d={},_0x54e350={},_0x5a979c={'count':0x0,'rows':[]};var _0x29851a=_[_0x2e7c('0x3f')](db[_0x2e7c('0x40')][_0x2e7c('0x41')],function(_0x18a1e6){return{'name':_0x18a1e6[_0x2e7c('0x42')],'type':_0x18a1e6[_0x2e7c('0x43')][_0x2e7c('0x44')]};});_0x54e350[_0x2e7c('0x45')]=_[_0x2e7c('0x3f')](_0x29851a,_0x2e7c('0x3d'));_0x54e350[_0x2e7c('0x46')]=_[_0x2e7c('0x47')](_0x1abf67[_0x2e7c('0x46')]);_0x54e350[_0x2e7c('0x48')]=_[_0x2e7c('0x49')](_0x54e350[_0x2e7c('0x45')],_0x54e350[_0x2e7c('0x46')]);_0x2d245d['attributes']=_[_0x2e7c('0x49')](_0x54e350['model'],qs['fields'](_0x1abf67['query'][_0x2e7c('0x4a')]));_0x2d245d[_0x2e7c('0x4b')]=_0x2d245d['attributes']['length']?_0x2d245d[_0x2e7c('0x4b')]:_0x54e350['model'];if(!_0x1abf67[_0x2e7c('0x46')][_0x2e7c('0x4c')](_0x2e7c('0x4d'))){_0x2d245d[_0x2e7c('0x34')]=qs['limit'](_0x1abf67[_0x2e7c('0x46')][_0x2e7c('0x34')]);_0x2d245d[_0x2e7c('0x33')]=qs[_0x2e7c('0x33')](_0x1abf67[_0x2e7c('0x46')][_0x2e7c('0x33')]);}_0x2d245d[_0x2e7c('0x4e')]=qs[_0x2e7c('0x4f')](_0x1abf67[_0x2e7c('0x46')]['sort']);_0x2d245d[_0x2e7c('0x50')]=qs['filters'](_[_0x2e7c('0x51')](_0x1abf67[_0x2e7c('0x46')],_0x54e350['filters']),_0x29851a);if(_0x1abf67[_0x2e7c('0x46')]['filter']){_0x2d245d['where']=_[_0x2e7c('0x52')](_0x2d245d['where'],{'$or':_[_0x2e7c('0x3f')](_0x29851a,function(_0x34f394){if(_0x34f394['type']!==_0x2e7c('0x53')){var _0x170ebf={};_0x170ebf[_0x34f394[_0x2e7c('0x3d')]]={'$like':'%'+_0x1abf67[_0x2e7c('0x46')][_0x2e7c('0x54')]+'%'};return _0x170ebf;}})});}_0x2d245d=_['merge']({},_0x2d245d,_0x1abf67[_0x2e7c('0x55')]);var _0x160e52={'where':_0x2d245d[_0x2e7c('0x50')]};return db[_0x2e7c('0x40')][_0x2e7c('0x32')](_0x160e52)[_0x2e7c('0x26')](function(_0x12ad2e){_0x5a979c[_0x2e7c('0x32')]=_0x12ad2e;if(_0x1abf67['query'][_0x2e7c('0x56')]){_0x2d245d[_0x2e7c('0x57')]=[{'all':!![]}];}return db[_0x2e7c('0x40')][_0x2e7c('0x58')](_0x2d245d);})['then'](function(_0x499b32){_0x5a979c[_0x2e7c('0x59')]=_0x499b32;return _0x5a979c;})[_0x2e7c('0x26')](respondWithFilteredResult(_0x50b68a,_0x2d245d))[_0x2e7c('0x30')](handleError(_0x50b68a,null));};exports[_0x2e7c('0x5a')]=function(_0x1c0e37,_0x3254db){var _0x519dae={'raw':!![],'where':{'id':_0x1c0e37[_0x2e7c('0x5b')]['id']}},_0x354bcc={};_0x354bcc[_0x2e7c('0x45')]=_[_0x2e7c('0x47')](db[_0x2e7c('0x40')]['rawAttributes']);_0x354bcc[_0x2e7c('0x46')]=_[_0x2e7c('0x47')](_0x1c0e37['query']);_0x354bcc['filters']=_['intersection'](_0x354bcc[_0x2e7c('0x45')],_0x354bcc[_0x2e7c('0x46')]);_0x519dae[_0x2e7c('0x4b')]=_['intersection'](_0x354bcc[_0x2e7c('0x45')],qs['fields'](_0x1c0e37[_0x2e7c('0x46')][_0x2e7c('0x4a')]));_0x519dae[_0x2e7c('0x4b')]=_0x519dae[_0x2e7c('0x4b')][_0x2e7c('0x5c')]?_0x519dae[_0x2e7c('0x4b')]:_0x354bcc[_0x2e7c('0x45')];if(_0x1c0e37[_0x2e7c('0x46')]['includeAll']){_0x519dae['include']=[{'all':!![]}];}_0x519dae=_[_0x2e7c('0x52')]({},_0x519dae,_0x1c0e37['options']);return db[_0x2e7c('0x40')][_0x2e7c('0x5d')](_0x519dae)[_0x2e7c('0x26')](handleEntityNotFound(_0x3254db,null))['then'](respondWithResult(_0x3254db,null))['catch'](handleError(_0x3254db,null));};exports[_0x2e7c('0x5e')]=function(_0x35c4c6,_0x1be678){return db[_0x2e7c('0x40')][_0x2e7c('0x5e')](_0x35c4c6[_0x2e7c('0x5f')],{})['then'](respondWithResult(_0x1be678,0xc9))[_0x2e7c('0x30')](handleError(_0x1be678,null));};exports[_0x2e7c('0x60')]=function(_0x57192e,_0x11b8a4){if(_0x57192e[_0x2e7c('0x5f')]['id']){delete _0x57192e[_0x2e7c('0x5f')]['id'];}return db['OpenchannelMessage'][_0x2e7c('0x5d')]({'where':{'id':_0x57192e['params']['id']}})['then'](handleEntityNotFound(_0x11b8a4,null))[_0x2e7c('0x26')](saveUpdates(_0x57192e[_0x2e7c('0x5f')],null))[_0x2e7c('0x26')](respondWithResult(_0x11b8a4,null))[_0x2e7c('0x30')](handleError(_0x11b8a4,null));};exports[_0x2e7c('0x39')]=function(_0x220e00,_0x4cf251){return db[_0x2e7c('0x40')][_0x2e7c('0x5d')]({'where':{'id':_0x220e00[_0x2e7c('0x5b')]['id']}})[_0x2e7c('0x26')](handleEntityNotFound(_0x4cf251,null))['then'](removeEntity(_0x4cf251,null))[_0x2e7c('0x30')](handleError(_0x4cf251,null));};exports[_0x2e7c('0x61')]=function(_0xdf4be,_0x11bdba){return db['OpenchannelMessage'][_0x2e7c('0x61')]()[_0x2e7c('0x26')](respondWithResult(_0x11bdba,null))[_0x2e7c('0x30')](handleError(_0x11bdba,null));};var interaction_log=require(_0x2e7c('0x17'))(_0x2e7c('0x62'));exports['accept']=function(_0x455e82,_0x53cb75,_0x4048ca){var _0x1d5d0c={'channel':'openchannel'};if(_0x455e82[_0x2e7c('0x5f')]['id']){delete _0x455e82[_0x2e7c('0x5f')]['id'];}_0x455e82[_0x2e7c('0x5f')][_0x2e7c('0x63')]=!![];_0x455e82[_0x2e7c('0x5f')][_0x2e7c('0x64')]=moment()[_0x2e7c('0x65')](_0x2e7c('0x66'));_0x455e82[_0x2e7c('0x5f')][_0x2e7c('0x67')]=_0x455e82[_0x2e7c('0x5f')][_0x2e7c('0x67')]||_0x455e82[_0x2e7c('0x68')]['id'];return db[_0x2e7c('0x40')]['find']({'where':{'id':_0x455e82[_0x2e7c('0x5b')]['id'],'UserId':null},'include':[{'model':db[_0x2e7c('0x69')],'as':_0x2e7c('0x6a')}]})['then'](handleEntityNotFound(_0x53cb75,null))[_0x2e7c('0x26')](saveUpdates(_0x455e82[_0x2e7c('0x5f')],null))[_0x2e7c('0x26')](function(_0x460363){if(_0x460363){_0x1d5d0c['message']=_0x460363[_0x2e7c('0x6b')]({'plain':!![]});return db[_0x2e7c('0x6c')][_0x2e7c('0x5d')]({'where':{'id':_0x460363['OpenchannelInteractionId']}});}return null;})[_0x2e7c('0x26')](handleEntityNotFound(_0x53cb75,null))[_0x2e7c('0x26')](function(_0x5235ab){if(_0x5235ab){return _0x5235ab['update']({'UserId':_0x455e82[_0x2e7c('0x5f')][_0x2e7c('0x67')],'read1stAt':_['isNil'](_0x5235ab[_0x2e7c('0x6d')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3df3ea){if(_0x3df3ea){_0x1d5d0c[_0x2e7c('0x6e')]=_0x3df3ea[_0x2e7c('0x6b')]({'plain':!![]});interaction_log[_0x2e7c('0x27')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x455e82['user']['id'],_0x455e82['user'][_0x2e7c('0x3d')],_0x455e82[_0x2e7c('0x68')][_0x2e7c('0x6f')],_0x1d5d0c[_0x2e7c('0x6e')]['id'],_0x455e82[_0x2e7c('0x5f')]?JSON['stringify'](_0x455e82[_0x2e7c('0x5f')]):_0x2e7c('0x70'));return respondWithRpcPromise(_0x2e7c('0x71'),'acceptMessage',_0x1d5d0c);}return null;})[_0x2e7c('0x26')](function(_0x53c9bd){if(_0x53c9bd){if(_0x455e82[_0x2e7c('0x5f')]['manual']){_0x1d5d0c[_0x2e7c('0x2e')][_0x2e7c('0x72')]=util[_0x2e7c('0x65')](_0x2e7c('0x73'),_0x455e82['user'][_0x2e7c('0x3d')]);_0x1d5d0c[_0x2e7c('0x2e')][_0x2e7c('0x74')]=_0x1d5d0c[_0x2e7c('0x74')];_0x1d5d0c[_0x2e7c('0x2e')][_0x2e7c('0x75')]=_0x2e7c('0x76');return respondWithRpcPromise(_0x2e7c('0x77'),_0x2e7c('0x77'),{'event':'acceptmessage','message':_0x1d5d0c[_0x2e7c('0x2e')]},client9002)[_0x2e7c('0x26')](function(){return _0x1d5d0c;});}return _0x1d5d0c;}return null;})[_0x2e7c('0x26')](respondWithResult(_0x53cb75,null))[_0x2e7c('0x30')](handleError(_0x53cb75,null));};var interaction_log=require('../../config/logger')(_0x2e7c('0x62'));exports[_0x2e7c('0x37')]=function(_0x1b819e,_0x14af7f,_0x406582){var _0x51c70a={'agent':{},'channel':_0x2e7c('0x78')};if(_0x1b819e[_0x2e7c('0x5f')]['id']){delete _0x1b819e[_0x2e7c('0x5f')]['id'];}_0x1b819e[_0x2e7c('0x5f')][_0x2e7c('0x67')]=_0x1b819e['body'][_0x2e7c('0x67')]||_0x1b819e[_0x2e7c('0x68')]['id'];_0x51c70a[_0x2e7c('0x79')]['id']=_0x1b819e[_0x2e7c('0x5f')]['UserId'];return db[_0x2e7c('0x40')]['find']({'where':{'id':_0x1b819e[_0x2e7c('0x5b')]['id'],'UserId':null}})[_0x2e7c('0x26')](handleEntityNotFound(_0x14af7f,null))[_0x2e7c('0x26')](function(_0x5d8a81){if(_0x5d8a81){_0x51c70a[_0x2e7c('0x2e')]=_0x5d8a81['get']({'plain':!![]});return db[_0x2e7c('0x6c')][_0x2e7c('0x5d')]({'where':{'id':_0x5d8a81[_0x2e7c('0x7a')]}});}return null;})[_0x2e7c('0x26')](handleEntityNotFound(_0x14af7f,null))['then'](function(_0x2101de){if(_0x2101de){_0x51c70a['interaction']=_0x2101de[_0x2e7c('0x6b')]({'plain':!![]});interaction_log[_0x2e7c('0x27')](_0x2e7c('0x7b'),_0x1b819e[_0x2e7c('0x68')]['id'],_0x1b819e['user'][_0x2e7c('0x3d')],_0x1b819e[_0x2e7c('0x68')]['role'],_0x51c70a[_0x2e7c('0x6e')]['id'],_0x1b819e[_0x2e7c('0x5f')]?JSON[_0x2e7c('0x7c')](_0x1b819e[_0x2e7c('0x5f')]):_0x2e7c('0x70'));return respondWithRpcPromise(_0x2e7c('0x7d'),'rejectMessage',_0x51c70a);}return null;})[_0x2e7c('0x26')](function(_0x5b9560){if(_0x5b9560){_0x5b9560[_0x2e7c('0x2e')][_0x2e7c('0x72')]=util[_0x2e7c('0x65')](_0x2e7c('0x73'),_0x1b819e[_0x2e7c('0x68')][_0x2e7c('0x3d')]);_0x5b9560[_0x2e7c('0x2e')]['channel']=_0x51c70a[_0x2e7c('0x74')];_0x5b9560[_0x2e7c('0x2e')][_0x2e7c('0x75')]=_0x2e7c('0x37');respondWithRpcPromise('EventManager',_0x2e7c('0x77'),{'event':_0x2e7c('0x7e'),'message':_0x5b9560[_0x2e7c('0x2e')]},client9002);return _0x51c70a;}return null;})['then'](respondWithResult(_0x14af7f,null))[_0x2e7c('0x30')](handleError(_0x14af7f,null));};
\ No newline at end of file
+var _0x314b=['manual','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','apply','reject','destroy','sendStatus','stack','name','send','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','rows','show','OpenchannelMessage','includeAll','find','create','body','update','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','params','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x314b,0x89));var _0xb314=function(_0x57a5e5,_0x18b0d6){_0x57a5e5=_0x57a5e5-0x0;var _0x354012=_0x314b[_0x57a5e5];return _0x354012;};'use strict';var pdf=require(_0xb314('0x0'));var emlformat=require(_0xb314('0x1'));var rimraf=require(_0xb314('0x2'));var zipdir=require(_0xb314('0x3'));var jsonpatch=require(_0xb314('0x4'));var rp=require(_0xb314('0x5'));var moment=require(_0xb314('0x6'));var BPromise=require(_0xb314('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb314('0x8'));var sox=require(_0xb314('0x9'));var csv=require(_0xb314('0xa'));var ejs=require(_0xb314('0xb'));var fs=require('fs');var _=require(_0xb314('0xc'));var squel=require('squel');var crypto=require(_0xb314('0xd'));var jsforce=require(_0xb314('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb314('0xf'));var Papa=require('papaparse');var Redis=require(_0xb314('0x10'));var authService=require(_0xb314('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb314('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb314('0x13'))(_0xb314('0x14'));var utils=require('../../config/utils');var config=require(_0xb314('0x15'));var db=require(_0xb314('0x16'))['db'];config[_0xb314('0x17')]=_[_0xb314('0x18')](config['redis'],{'host':_0xb314('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb314('0x17')]));require('./openchannelMessage.socket')[_0xb314('0x1a')](socket);var jayson=require(_0xb314('0x1b'));var client=jayson[_0xb314('0x1c')][_0xb314('0x1d')]({'port':0x232c});var client9002=jayson[_0xb314('0x1c')][_0xb314('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x42f082,_0x4cebac,_0x2dc2c5){if(_0x2dc2c5){var _0x3b4299=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b4299[_0xb314('0x1e')](_0x4cebac)){return _0x42f082;}else{throw new db[(_0xb314('0x1f'))][(_0xb314('0x20'))](_0xb314('0x21'));}}else{return _0x42f082;}}function respondWithRpcPromise(_0x195f44,_0x2085d0,_0x4ee05a,_0x37e3ca){return new BPromise(function(_0xe7f30f,_0x155e41){var _0x252064=_0x37e3ca||client;return _0x252064[_0xb314('0x22')](_0x195f44,_0x4ee05a)[_0xb314('0x23')](function(_0x1ff2f5){logger[_0xb314('0x24')](_0xb314('0x25'),_0x2085d0,_0xb314('0x26'));logger[_0xb314('0x27')](_0xb314('0x28'),_0x2085d0,_0xb314('0x26'),JSON[_0xb314('0x29')](_0x1ff2f5));if(_0x1ff2f5[_0xb314('0x2a')]){if(_0x1ff2f5[_0xb314('0x2a')][_0xb314('0x2b')]===0x1f4){logger[_0xb314('0x2a')](_0xb314('0x25'),_0x2085d0,_0x1ff2f5[_0xb314('0x2a')][_0xb314('0x2c')]);return _0x155e41(_0x1ff2f5[_0xb314('0x2a')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2085d0,_0x1ff2f5[_0xb314('0x2a')]['message']);return _0xe7f30f(_0x1ff2f5['error'][_0xb314('0x2c')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2085d0,'request\x20sent');_0xe7f30f(_0x1ff2f5[_0xb314('0x2d')]['message']);}})[_0xb314('0x2e')](function(_0x3b8fac){logger[_0xb314('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x2085d0,_0x3b8fac);_0x155e41(_0x3b8fac);});});}function respondWithStatusCode(_0x4a4b59,_0x1888ab){_0x1888ab=_0x1888ab||0xcc;return function(_0x36210f){if(_0x36210f){return _0x4a4b59['sendStatus'](_0x1888ab);}return _0x4a4b59[_0xb314('0x2f')](_0x1888ab)[_0xb314('0x30')]();};}function respondWithResult(_0x3b19a9,_0x1eaae2){_0x1eaae2=_0x1eaae2||0xc8;return function(_0x8fc017){if(_0x8fc017){return _0x3b19a9[_0xb314('0x2f')](_0x1eaae2)[_0xb314('0x31')](_0x8fc017);}};}function respondWithFilteredResult(_0x16d5cd,_0x43bc24){return function(_0x3f3d34){if(_0x3f3d34){var _0x77a3ab=_0x3f3d34[_0xb314('0x32')],_0x42f843=_0x43bc24[_0xb314('0x33')],_0x5e1a12=_0x43bc24[_0xb314('0x33')]+_0x43bc24[_0xb314('0x34')],_0x402cd7;if(_0x5e1a12>=_0x77a3ab){_0x5e1a12=_0x77a3ab;_0x402cd7=0xc8;}else{_0x402cd7=0xce;}_0x16d5cd['status'](_0x402cd7);return _0x16d5cd[_0xb314('0x35')]('Content-Range',_0x42f843+'-'+_0x5e1a12+'/'+_0x77a3ab)[_0xb314('0x31')](_0x3f3d34);}return null;};}function patchUpdates(_0x105a54){return function(_0x5df1a0){try{jsonpatch[_0xb314('0x36')](_0x5df1a0,_0x105a54,!![]);}catch(_0x9dbcd4){return BPromise[_0xb314('0x37')](_0x9dbcd4);}return _0x5df1a0['save']();};}function saveUpdates(_0x8981db,_0x1b01a1){return function(_0x26b8e5){if(_0x26b8e5){return _0x26b8e5['update'](_0x8981db)[_0xb314('0x23')](function(_0x580b1b){return _0x580b1b;});}return null;};}function removeEntity(_0xdfe403,_0x594fe9){return function(_0x124b1e){if(_0x124b1e){return _0x124b1e[_0xb314('0x38')]()['then'](function(){_0xdfe403[_0xb314('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1863da,_0x1338f2){return function(_0x183958){if(!_0x183958){_0x1863da[_0xb314('0x39')](0x194);}return _0x183958;};}function handleError(_0x53cb12,_0x40d37b){_0x40d37b=_0x40d37b||0x1f4;return function(_0x5ac66f){logger[_0xb314('0x2a')](_0x5ac66f[_0xb314('0x3a')]);if(_0x5ac66f[_0xb314('0x3b')]){delete _0x5ac66f['name'];}_0x53cb12['status'](_0x40d37b)[_0xb314('0x3c')](_0x5ac66f);};}exports['index']=function(_0x2e6589,_0x8e43d4){var _0x55108a={},_0x4ef7b7={},_0x3f2462={'count':0x0,'rows':[]};var _0x256090=_[_0xb314('0x3d')](db['OpenchannelMessage']['rawAttributes'],function(_0x52fb1b){return{'name':_0x52fb1b[_0xb314('0x3e')],'type':_0x52fb1b[_0xb314('0x3f')][_0xb314('0x40')]};});_0x4ef7b7[_0xb314('0x41')]=_[_0xb314('0x3d')](_0x256090,'name');_0x4ef7b7['query']=_[_0xb314('0x42')](_0x2e6589[_0xb314('0x43')]);_0x4ef7b7['filters']=_[_0xb314('0x44')](_0x4ef7b7[_0xb314('0x41')],_0x4ef7b7[_0xb314('0x43')]);_0x55108a[_0xb314('0x45')]=_[_0xb314('0x44')](_0x4ef7b7[_0xb314('0x41')],qs[_0xb314('0x46')](_0x2e6589[_0xb314('0x43')][_0xb314('0x46')]));_0x55108a[_0xb314('0x45')]=_0x55108a[_0xb314('0x45')][_0xb314('0x47')]?_0x55108a[_0xb314('0x45')]:_0x4ef7b7[_0xb314('0x41')];if(!_0x2e6589['query'][_0xb314('0x48')](_0xb314('0x49'))){_0x55108a[_0xb314('0x34')]=qs[_0xb314('0x34')](_0x2e6589[_0xb314('0x43')][_0xb314('0x34')]);_0x55108a[_0xb314('0x33')]=qs['offset'](_0x2e6589['query'][_0xb314('0x33')]);}_0x55108a[_0xb314('0x4a')]=qs[_0xb314('0x4b')](_0x2e6589[_0xb314('0x43')]['sort']);_0x55108a['where']=qs[_0xb314('0x4c')](_[_0xb314('0x4d')](_0x2e6589[_0xb314('0x43')],_0x4ef7b7[_0xb314('0x4c')]),_0x256090);if(_0x2e6589[_0xb314('0x43')][_0xb314('0x4e')]){_0x55108a[_0xb314('0x4f')]=_[_0xb314('0x50')](_0x55108a[_0xb314('0x4f')],{'$or':_[_0xb314('0x3d')](_0x256090,function(_0x5c88bf){if(_0x5c88bf[_0xb314('0x3f')]!==_0xb314('0x51')){var _0x535f09={};_0x535f09[_0x5c88bf[_0xb314('0x3b')]]={'$like':'%'+_0x2e6589[_0xb314('0x43')]['filter']+'%'};return _0x535f09;}})});}_0x55108a=_[_0xb314('0x50')]({},_0x55108a,_0x2e6589[_0xb314('0x52')]);var _0x388493={'where':_0x55108a[_0xb314('0x4f')]};return db['OpenchannelMessage'][_0xb314('0x32')](_0x388493)['then'](function(_0xdb3d4a){_0x3f2462[_0xb314('0x32')]=_0xdb3d4a;if(_0x2e6589[_0xb314('0x43')]['includeAll']){_0x55108a[_0xb314('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x55108a);})[_0xb314('0x23')](function(_0x4e36f2){_0x3f2462[_0xb314('0x54')]=_0x4e36f2;return _0x3f2462;})['then'](respondWithFilteredResult(_0x8e43d4,_0x55108a))[_0xb314('0x2e')](handleError(_0x8e43d4,null));};exports[_0xb314('0x55')]=function(_0x29d4b0,_0x1c5656){var _0x5045a1={'raw':!![],'where':{'id':_0x29d4b0['params']['id']}},_0xc7407e={};_0xc7407e['model']=_[_0xb314('0x42')](db[_0xb314('0x56')]['rawAttributes']);_0xc7407e[_0xb314('0x43')]=_['keys'](_0x29d4b0[_0xb314('0x43')]);_0xc7407e[_0xb314('0x4c')]=_[_0xb314('0x44')](_0xc7407e[_0xb314('0x41')],_0xc7407e[_0xb314('0x43')]);_0x5045a1['attributes']=_[_0xb314('0x44')](_0xc7407e[_0xb314('0x41')],qs['fields'](_0x29d4b0[_0xb314('0x43')][_0xb314('0x46')]));_0x5045a1['attributes']=_0x5045a1[_0xb314('0x45')][_0xb314('0x47')]?_0x5045a1['attributes']:_0xc7407e[_0xb314('0x41')];if(_0x29d4b0[_0xb314('0x43')][_0xb314('0x57')]){_0x5045a1[_0xb314('0x53')]=[{'all':!![]}];}_0x5045a1=_[_0xb314('0x50')]({},_0x5045a1,_0x29d4b0['options']);return db[_0xb314('0x56')][_0xb314('0x58')](_0x5045a1)['then'](handleEntityNotFound(_0x1c5656,null))['then'](respondWithResult(_0x1c5656,null))[_0xb314('0x2e')](handleError(_0x1c5656,null));};exports[_0xb314('0x59')]=function(_0x43ac3f,_0x47d563){return db[_0xb314('0x56')]['create'](_0x43ac3f[_0xb314('0x5a')],{})[_0xb314('0x23')](respondWithResult(_0x47d563,0xc9))[_0xb314('0x2e')](handleError(_0x47d563,null));};exports[_0xb314('0x5b')]=function(_0x3db1c5,_0x47f356){if(_0x3db1c5['body']['id']){delete _0x3db1c5[_0xb314('0x5a')]['id'];}return db[_0xb314('0x56')][_0xb314('0x58')]({'where':{'id':_0x3db1c5['params']['id']}})[_0xb314('0x23')](handleEntityNotFound(_0x47f356,null))['then'](saveUpdates(_0x3db1c5[_0xb314('0x5a')],null))[_0xb314('0x23')](respondWithResult(_0x47f356,null))[_0xb314('0x2e')](handleError(_0x47f356,null));};exports[_0xb314('0x38')]=function(_0x43c24a,_0xee0a64){return db[_0xb314('0x56')][_0xb314('0x58')]({'where':{'id':_0x43c24a['params']['id']}})[_0xb314('0x23')](handleEntityNotFound(_0xee0a64,null))['then'](removeEntity(_0xee0a64,null))[_0xb314('0x2e')](handleError(_0xee0a64,null));};exports[_0xb314('0x5c')]=function(_0x528800,_0x1bcba6){return db[_0xb314('0x56')][_0xb314('0x5c')]()[_0xb314('0x23')](respondWithResult(_0x1bcba6,null))[_0xb314('0x2e')](handleError(_0x1bcba6,null));};var interaction_log=require(_0xb314('0x13'))(_0xb314('0x5d'));exports[_0xb314('0x5e')]=function(_0x2169c7,_0x4e8f2c,_0x11e21c){var _0x274706={'channel':_0xb314('0x5f')};if(_0x2169c7[_0xb314('0x5a')]['id']){delete _0x2169c7[_0xb314('0x5a')]['id'];}_0x2169c7[_0xb314('0x5a')][_0xb314('0x60')]=!![];_0x2169c7[_0xb314('0x5a')][_0xb314('0x61')]=moment()[_0xb314('0x62')](_0xb314('0x63'));_0x2169c7[_0xb314('0x5a')][_0xb314('0x64')]=_0x2169c7[_0xb314('0x5a')]['UserId']||_0x2169c7['user']['id'];return db[_0xb314('0x56')][_0xb314('0x58')]({'where':{'id':_0x2169c7[_0xb314('0x65')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xb314('0x66')}]})[_0xb314('0x23')](handleEntityNotFound(_0x4e8f2c,null))['then'](saveUpdates(_0x2169c7['body'],null))[_0xb314('0x23')](function(_0xd98b52){if(_0xd98b52){_0x274706[_0xb314('0x2c')]=_0xd98b52['get']({'plain':!![]});return db[_0xb314('0x67')]['find']({'where':{'id':_0xd98b52[_0xb314('0x68')]}});}return null;})[_0xb314('0x23')](handleEntityNotFound(_0x4e8f2c,null))[_0xb314('0x23')](function(_0x46cbfd){if(_0x46cbfd){return _0x46cbfd[_0xb314('0x5b')]({'UserId':_0x2169c7['body'][_0xb314('0x64')],'read1stAt':_[_0xb314('0x69')](_0x46cbfd['read1stAt'])?moment()[_0xb314('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb314('0x23')](function(_0x22969b){if(_0x22969b){_0x274706['interaction']=_0x22969b[_0xb314('0x6a')]({'plain':!![]});interaction_log[_0xb314('0x24')](_0xb314('0x6b'),_0x2169c7[_0xb314('0x6c')]['id'],_0x2169c7['user'][_0xb314('0x3b')],_0x2169c7['user'][_0xb314('0x6d')],_0x274706[_0xb314('0x6e')]['id'],_0x2169c7[_0xb314('0x5a')]?JSON['stringify'](_0x2169c7[_0xb314('0x5a')]):_0xb314('0x6f'));return respondWithRpcPromise(_0xb314('0x70'),'acceptMessage',_0x274706);}return null;})[_0xb314('0x23')](function(_0x3aa7b4){if(_0x3aa7b4){if(_0x2169c7[_0xb314('0x5a')][_0xb314('0x71')]){_0x274706['message']['interface']=util[_0xb314('0x62')](_0xb314('0x72'),_0x2169c7[_0xb314('0x6c')][_0xb314('0x3b')]);_0x274706[_0xb314('0x2c')][_0xb314('0x73')]=_0x274706[_0xb314('0x73')];_0x274706[_0xb314('0x2c')][_0xb314('0x74')]=_0xb314('0x5e');return respondWithRpcPromise(_0xb314('0x75'),_0xb314('0x75'),{'event':_0xb314('0x76'),'message':_0x274706[_0xb314('0x2c')]},client9002)['then'](function(){return _0x274706;});}return _0x274706;}return null;})[_0xb314('0x23')](respondWithResult(_0x4e8f2c,null))['catch'](handleError(_0x4e8f2c,null));};var interaction_log=require(_0xb314('0x13'))(_0xb314('0x5d'));exports[_0xb314('0x37')]=function(_0x35cf1d,_0x2f857b,_0x126c53){var _0x1de706={'agent':{},'channel':_0xb314('0x5f')};if(_0x35cf1d['body']['id']){delete _0x35cf1d[_0xb314('0x5a')]['id'];}_0x35cf1d[_0xb314('0x5a')][_0xb314('0x64')]=_0x35cf1d[_0xb314('0x5a')]['UserId']||_0x35cf1d[_0xb314('0x6c')]['id'];_0x1de706[_0xb314('0x77')]['id']=_0x35cf1d[_0xb314('0x5a')]['UserId'];return db[_0xb314('0x56')][_0xb314('0x58')]({'where':{'id':_0x35cf1d[_0xb314('0x65')]['id'],'UserId':null}})[_0xb314('0x23')](handleEntityNotFound(_0x2f857b,null))['then'](function(_0x30b25c){if(_0x30b25c){_0x1de706[_0xb314('0x2c')]=_0x30b25c[_0xb314('0x6a')]({'plain':!![]});return db[_0xb314('0x67')][_0xb314('0x58')]({'where':{'id':_0x30b25c[_0xb314('0x68')]}});}return null;})[_0xb314('0x23')](handleEntityNotFound(_0x2f857b,null))[_0xb314('0x23')](function(_0x361544){if(_0x361544){_0x1de706[_0xb314('0x6e')]=_0x361544[_0xb314('0x6a')]({'plain':!![]});interaction_log['info'](_0xb314('0x78'),_0x35cf1d[_0xb314('0x6c')]['id'],_0x35cf1d[_0xb314('0x6c')][_0xb314('0x3b')],_0x35cf1d[_0xb314('0x6c')]['role'],_0x1de706[_0xb314('0x6e')]['id'],_0x35cf1d['body']?JSON[_0xb314('0x29')](_0x35cf1d[_0xb314('0x5a')]):_0xb314('0x6f'));return respondWithRpcPromise(_0xb314('0x79'),_0xb314('0x7a'),_0x1de706);}return null;})[_0xb314('0x23')](function(_0x34b490){if(_0x34b490){_0x34b490[_0xb314('0x2c')][_0xb314('0x7b')]=util[_0xb314('0x62')](_0xb314('0x72'),_0x35cf1d['user'][_0xb314('0x3b')]);_0x34b490[_0xb314('0x2c')][_0xb314('0x73')]=_0x1de706[_0xb314('0x73')];_0x34b490[_0xb314('0x2c')][_0xb314('0x74')]=_0xb314('0x37');respondWithRpcPromise('EventManager','EventManager',{'event':_0xb314('0x7c'),'message':_0x34b490[_0xb314('0x2c')]},client9002);return _0x1de706;}return null;})[_0xb314('0x23')](respondWithResult(_0x2f857b,null))['catch'](handleError(_0x2f857b,null));};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js
index 02147b0..b642d4a 100644
--- a/server/api/openchannelMessage/openchannelMessage.events.js
+++ b/server/api/openchannelMessage/openchannelMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa5f8=['OpenchannelMessage','setMaxListeners','save','emit','hook','exports','../../mysqldb'];(function(_0x4da6c6,_0x4c8aa5){var _0x2e39ac=function(_0x1845ca){while(--_0x1845ca){_0x4da6c6['push'](_0x4da6c6['shift']());}};_0x2e39ac(++_0x4c8aa5);}(_0xa5f8,0x133));var _0x8a5f=function(_0x3eaefd,_0x1ce0e3){_0x3eaefd=_0x3eaefd-0x0;var _0x168216=_0xa5f8[_0x3eaefd];return _0x168216;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x8a5f('0x0'))['db'][_0x8a5f('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8a5f('0x2')](0x0);var events={'afterCreate':_0x8a5f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49d9cb){return function(_0x552fd3,_0x1ef38e,_0x66e4d1){OpenchannelMessageEvents['emit'](_0x49d9cb+':'+_0x552fd3['id'],_0x552fd3);OpenchannelMessageEvents[_0x8a5f('0x4')](_0x49d9cb,_0x552fd3);_0x66e4d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x8a5f('0x5')](e,emitEvent(event));}}module[_0x8a5f('0x6')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xcb35=['hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x33616f,_0x3855c6){var _0x47221f=function(_0xe32c3a){while(--_0xe32c3a){_0x33616f['push'](_0x33616f['shift']());}};_0x47221f(++_0x3855c6);}(_0xcb35,0x85));var _0x5cb3=function(_0x66c505,_0x472bb9){_0x66c505=_0x66c505-0x0;var _0x36b774=_0xcb35[_0x66c505];return _0x36b774;};'use strict';var EventEmitter=require(_0x5cb3('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x5cb3('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5cb3('0x2')](0x0);var events={'afterCreate':_0x5cb3('0x3'),'afterUpdate':_0x5cb3('0x4'),'afterDestroy':_0x5cb3('0x5')};function emitEvent(_0x1a2e9b){return function(_0x5dcfa6,_0x4c7f36,_0x172c28){OpenchannelMessageEvents[_0x5cb3('0x6')](_0x1a2e9b+':'+_0x5dcfa6['id'],_0x5dcfa6);OpenchannelMessageEvents[_0x5cb3('0x6')](_0x1a2e9b,_0x5dcfa6);_0x172c28(null);};}for(var e in events){if(events[_0x5cb3('0x7')](e)){var event=events[e];OpenchannelMessage[_0x5cb3('0x8')](e,emitEvent(event));}}module[_0x5cb3('0x9')]=OpenchannelMessageEvents;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js
index 32b7846..46b14b6 100644
--- a/server/api/openchannelMessage/openchannelMessage.model.js
+++ b/server/api/openchannelMessage/openchannelMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8781=['Forwarding\x20message\x20%d\x20to\x20%s','Interactions','Interaction','omit','Contact','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','afterCreate','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','findOne','update','catch','out','secret','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','keys','get','replyUri','OpenchannelMessage,\x20%s,\x20%s','format'];(function(_0x2c9905,_0x3c017b){var _0x3ece98=function(_0x3d1424){while(--_0x3d1424){_0x2c9905['push'](_0x2c9905['shift']());}};_0x3ece98(++_0x3c017b);}(_0x8781,0x1c8));var _0x1878=function(_0x2dbf97,_0x1a0ed4){_0x2dbf97=_0x2dbf97-0x0;var _0x3915e4=_0x8781[_0x2dbf97];return _0x3915e4;};'use strict';var _=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var logger=require(_0x1878('0x2'))(_0x1878('0x3'));var moment=require(_0x1878('0x4'));var BPromise=require(_0x1878('0x5'));var rp=require(_0x1878('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1878('0x7'));var config=require(_0x1878('0x8'));var attributes=require(_0x1878('0x9'));module[_0x1878('0xa')]=function(_0x43d827,_0x1c52e8){return _0x43d827['define'](_0x1878('0xb'),attributes,{'tableName':_0x1878('0xc'),'paranoid':![],'indexes':[{'name':_0x1878('0xd'),'fields':[_0x1878('0xe')],'type':_0x1878('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e6c2f,_0x2756b4,_0x31008c){var _0x3f00a4=_0x43d827[_0x1878('0x10')];var _0x412d55=_0x2e6c2f['get']({'plain':!![]});if(_0x412d55[_0x1878('0x11')][_0x1878('0x12')]()==='in'||_0x412d55[_0x1878('0x11')][_0x1878('0x12')]()==='out'&&!_0x412d55['secret']&&!_[_0x1878('0x13')](_0x412d55[_0x1878('0x14')])){_0x3f00a4[_0x1878('0x15')][_0x1878('0x16')]({'where':{'id':_0x412d55['OpenchannelInteractionId']}})['then'](function(_0x19ffaa){if(_0x19ffaa){_0x19ffaa[_0x1878('0x17')]({'lastMsgAt':_0x412d55['createdAt'],'lastMsgDirection':_0x412d55[_0x1878('0x11')][_0x1878('0x12')]()});}})[_0x1878('0x18')](function(_0x4a5ba9){console['error'](_0x4a5ba9);});}if(_0x412d55[_0x1878('0x11')]===_0x1878('0x19')&&!_0x412d55[_0x1878('0x1a')]){var _0x43b85e;_0x3f00a4[_0x1878('0x1b')][_0x1878('0x1c')]()[_0x1878('0x1d')](function(_0x1642b3){return _0x3f00a4[_0x1878('0x1e')][_0x1878('0x1f')]({'where':{'id':_0x412d55[_0x1878('0x20')]},'include':[{'model':_0x3f00a4['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x412d55[_0x1878('0x21')]},'limit':0x1,'include':[{'model':_0x3f00a4[_0x1878('0x1b')],'as':'Contact','attributes':_[_0x1878('0x22')](_0x1642b3)}]}]});})[_0x1878('0x1d')](function(_0x1fae20){_0x43b85e=_0x1fae20[_0x1878('0x23')]({'plain':!![]});if(_0x43b85e&&_0x43b85e[_0x1878('0x24')]){logger['info'](_0x1878('0x25'),'afterCreate',util[_0x1878('0x26')](_0x1878('0x27'),_0x412d55['id'],_0x43b85e[_0x1878('0x24')]));if(_0x43b85e[_0x1878('0x28')]&&_0x43b85e[_0x1878('0x28')]['length']){_0x412d55[_0x1878('0x29')]=_[_0x1878('0x2a')](_0x43b85e[_0x1878('0x28')][0x0],_0x1878('0x2b'));_0x412d55[_0x1878('0x2b')]=_0x43b85e[_0x1878('0x28')][0x0][_0x1878('0x2b')];}var _0x2756b4={'method':_0x1878('0x2c'),'uri':encodeURI(_0x43b85e[_0x1878('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2756b4[_0x1878('0x2d')]){case _0x1878('0x2e'):_0x2756b4['qs']=_0x412d55;break;case _0x1878('0x2c'):_0x2756b4['body']=_0x412d55;break;}return rp(_0x2756b4)[_0x1878('0x1d')](function(_0x16410e){logger[_0x1878('0x2f')](_0x1878('0x25'),'afterCreate',util[_0x1878('0x26')](_0x1878('0x30'),_0x412d55['id'],_0x43b85e[_0x1878('0x24')]));if(_0x16410e[_0x1878('0xe')][_0x1878('0x31')]&&_0x16410e[_0x1878('0xe')]['threadId']!=_0x412d55[_0x1878('0x29')][_0x1878('0x31')]){return _0x3f00a4['OpenchannelInteraction']['update']({'threadId':_0x16410e[_0x1878('0xe')]['threadId']},{'logging':!![],'where':{'id':_0x412d55['Interaction']['id']}});}else{return;}})[_0x1878('0x1d')](function(){return _0x2e6c2f[_0x1878('0x17')]({'read':!![]});})[_0x1878('0x18')](function(_0x509fde){logger[_0x1878('0x32')](_0x1878('0x25'),_0x1878('0x33'),util[_0x1878('0x34')](_0x509fde,{'showHidden':![],'depth':null}));_0x31008c();});}else{_0x31008c();}})['finally'](function(){_0x31008c();});}else{_0x31008c();}}},'charset':_0x1878('0x35'),'collate':_0x1878('0x36')});};
\ No newline at end of file
+var _0x20d6=['../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','CmContact','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x34960c,_0x294af0){var _0x83b93c=function(_0x7bf831){while(--_0x7bf831){_0x34960c['push'](_0x34960c['shift']());}};_0x83b93c(++_0x294af0);}(_0x20d6,0x9d));var _0x620d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x20d6[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var logger=require(_0x620d('0x2'))(_0x620d('0x3'));var moment=require(_0x620d('0x4'));var BPromise=require('bluebird');var rp=require(_0x620d('0x5'));var fs=require('fs');var path=require(_0x620d('0x6'));var rimraf=require(_0x620d('0x7'));var config=require(_0x620d('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0x620d('0x9')]=function(_0x3ea631,_0x5c67f9){return _0x3ea631[_0x620d('0xa')](_0x620d('0xb'),attributes,{'tableName':_0x620d('0xc'),'paranoid':![],'indexes':[{'name':_0x620d('0xd'),'fields':[_0x620d('0xe')],'type':_0x620d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x25c1f4,_0x2d0be1,_0x1eb5b0){var _0x12549a=_0x3ea631[_0x620d('0x10')];var _0x3c0558=_0x25c1f4['get']({'plain':!![]});if(_0x3c0558[_0x620d('0x11')]['toLowerCase']()==='in'||_0x3c0558[_0x620d('0x11')][_0x620d('0x12')]()===_0x620d('0x13')&&!_0x3c0558[_0x620d('0x14')]&&!_[_0x620d('0x15')](_0x3c0558[_0x620d('0x16')])){_0x12549a[_0x620d('0x17')][_0x620d('0x18')]({'where':{'id':_0x3c0558[_0x620d('0x19')]}})['then'](function(_0x38ee94){if(_0x38ee94){_0x38ee94[_0x620d('0x1a')]({'lastMsgAt':_0x3c0558[_0x620d('0x1b')],'lastMsgDirection':_0x3c0558[_0x620d('0x11')][_0x620d('0x12')]()});}})['catch'](function(_0xb53eae){console[_0x620d('0x1c')](_0xb53eae);});}if(_0x3c0558[_0x620d('0x11')]===_0x620d('0x13')&&!_0x3c0558['secret']){var _0x11f4ea;_0x12549a[_0x620d('0x1d')]['describe']()[_0x620d('0x1e')](function(_0x4b9cd7){return _0x12549a[_0x620d('0x1f')][_0x620d('0x20')]({'where':{'id':_0x3c0558[_0x620d('0x21')]},'include':[{'model':_0x12549a[_0x620d('0x17')],'as':_0x620d('0x22'),'where':{'id':_0x3c0558[_0x620d('0x19')]},'limit':0x1,'include':[{'model':_0x12549a[_0x620d('0x1d')],'as':_0x620d('0x23'),'attributes':_[_0x620d('0x24')](_0x4b9cd7)}]}]});})['then'](function(_0xc5f04b){_0x11f4ea=_0xc5f04b[_0x620d('0x25')]({'plain':!![]});if(_0x11f4ea&&_0x11f4ea[_0x620d('0x26')]){logger[_0x620d('0x27')](_0x620d('0x28'),_0x620d('0x29'),util[_0x620d('0x2a')](_0x620d('0x2b'),_0x3c0558['id'],_0x11f4ea[_0x620d('0x26')]));if(_0x11f4ea[_0x620d('0x22')]&&_0x11f4ea[_0x620d('0x22')][_0x620d('0x2c')]){_0x3c0558[_0x620d('0x2d')]=_['omit'](_0x11f4ea['Interactions'][0x0],_0x620d('0x23'));_0x3c0558[_0x620d('0x23')]=_0x11f4ea[_0x620d('0x22')][0x0][_0x620d('0x23')];}var _0x2d0be1={'method':_0x620d('0x2e'),'uri':encodeURI(_0x11f4ea[_0x620d('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2d0be1[_0x620d('0x2f')]){case _0x620d('0x30'):_0x2d0be1['qs']=_0x3c0558;break;case _0x620d('0x2e'):_0x2d0be1['body']=_0x3c0558;break;}return rp(_0x2d0be1)[_0x620d('0x1e')](function(_0x2b4542){logger[_0x620d('0x27')](_0x620d('0x28'),_0x620d('0x29'),util[_0x620d('0x2a')](_0x620d('0x31'),_0x3c0558['id'],_0x11f4ea[_0x620d('0x26')]));if(_0x2b4542[_0x620d('0xe')][_0x620d('0x32')]&&_0x2b4542[_0x620d('0xe')][_0x620d('0x32')]!=_0x3c0558['Interaction']['threadId']){return _0x12549a[_0x620d('0x17')]['update']({'threadId':_0x2b4542[_0x620d('0xe')][_0x620d('0x32')]},{'logging':!![],'where':{'id':_0x3c0558[_0x620d('0x2d')]['id']}});}else{return;}})[_0x620d('0x1e')](function(){return _0x25c1f4['update']({'read':!![]});})[_0x620d('0x33')](function(_0x329651){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x620d('0x29'),util[_0x620d('0x34')](_0x329651,{'showHidden':![],'depth':null}));_0x1eb5b0();});}else{_0x1eb5b0();}})['finally'](function(){_0x1eb5b0();});}else{_0x1eb5b0();}}},'charset':_0x620d('0x35'),'collate':_0x620d('0x36')});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js
index 2cce68d..5f12662 100644
--- a/server/api/openchannelMessage/openchannelMessage.rpc.js
+++ b/server/api/openchannelMessage/openchannelMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x06ae=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug'];(function(_0x2da9e1,_0x100a48){var _0x5a479e=function(_0x51ad9c){while(--_0x51ad9c){_0x2da9e1['push'](_0x2da9e1['shift']());}};_0x5a479e(++_0x100a48);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xe06a('0x0'));var moment=require(_0xe06a('0x1'));var BPromise=require(_0xe06a('0x2'));var rs=require(_0xe06a('0x3'));var fs=require('fs');var Redis=require(_0xe06a('0x4'));var db=require(_0xe06a('0x5'))['db'];var utils=require(_0xe06a('0x6'));var logger=require(_0xe06a('0x7'))(_0xe06a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe06a('0x9')]({'port':0x232a});config[_0xe06a('0xa')]=_[_0xe06a('0xb')](config[_0xe06a('0xa')],{'host':_0xe06a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe06a('0xa')]));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1a9f4e,_0x4eedc5,_0x2212e2){return new BPromise(function(_0x48e52a,_0x521741){return client[_0xe06a('0xd')](_0x1a9f4e,_0x2212e2)[_0xe06a('0xe')](function(_0x574fd0){logger[_0xe06a('0xf')](_0xe06a('0x10'),_0x4eedc5,'request\x20sent');logger[_0xe06a('0x11')](_0xe06a('0x12'),_0x4eedc5,_0xe06a('0x13'),JSON['stringify'](_0x574fd0));if(_0x574fd0[_0xe06a('0x14')]){if(_0x574fd0[_0xe06a('0x14')][_0xe06a('0x15')]===0x1f4){logger[_0xe06a('0x14')](_0xe06a('0x10'),_0x4eedc5,_0x574fd0['error'][_0xe06a('0x16')]);return _0x521741(_0x574fd0[_0xe06a('0x14')][_0xe06a('0x16')]);}logger[_0xe06a('0x14')](_0xe06a('0x10'),_0x4eedc5,_0x574fd0[_0xe06a('0x14')]['message']);return _0x48e52a(_0x574fd0[_0xe06a('0x14')]['message']);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x4eedc5,_0xe06a('0x13'));_0x48e52a(_0x574fd0[_0xe06a('0x17')][_0xe06a('0x16')]);}})['catch'](function(_0x614743){logger[_0xe06a('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x4eedc5,_0x614743);_0x521741(_0x614743);});});}exports[_0xe06a('0x18')]=function(_0x5382a6){var _0x3003f8=this;return new Promise(function(_0x4a2681,_0x550ff8){return db[_0xe06a('0x19')][_0xe06a('0x1a')](_0x5382a6[_0xe06a('0x1b')],{'raw':_0x5382a6[_0xe06a('0x1c')]?_0x5382a6[_0xe06a('0x1c')][_0xe06a('0x1d')]===undefined?!![]:![]:!![]})[_0xe06a('0xe')](function(_0x2c30c7){logger[_0xe06a('0xf')](_0xe06a('0x18'),_0x5382a6);logger['debug'](_0xe06a('0x18'),_0x5382a6,JSON[_0xe06a('0x1e')](_0x2c30c7));_0x4a2681(_0x2c30c7);})[_0xe06a('0x1f')](function(_0x82ba72){logger[_0xe06a('0x14')](_0xe06a('0x18'),_0x82ba72[_0xe06a('0x16')],_0x5382a6);_0x550ff8(_0x3003f8[_0xe06a('0x14')](0x1f4,_0x82ba72[_0xe06a('0x16')]));});});};
\ No newline at end of file
+var _0xc359=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateOpenchannelMessage','create','options','raw','util','bluebird'];(function(_0x3ad694,_0x31a0cd){var _0x286710=function(_0x39a50d){while(--_0x39a50d){_0x3ad694['push'](_0x3ad694['shift']());}};_0x286710(++_0x31a0cd);}(_0xc359,0x1d9));var _0x9c35=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0xc359[_0x5519a9];return _0x32f2cc;};'use strict';var _=require('lodash');var util=require(_0x9c35('0x0'));var moment=require('moment');var BPromise=require(_0x9c35('0x1'));var rs=require(_0x9c35('0x2'));var fs=require('fs');var Redis=require(_0x9c35('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c35('0x4'));var logger=require('../../config/logger')(_0x9c35('0x5'));var config=require('../../config/environment');var jayson=require(_0x9c35('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9c35('0x7')],{'host':_0x9c35('0x8'),'port':0x18eb});var socket=require(_0x9c35('0x9'))(new Redis(config[_0x9c35('0x7')]));require(_0x9c35('0xa'))[_0x9c35('0xb')](socket);function respondWithRpcPromise(_0x56d3fb,_0x21df9a,_0x467add){return new BPromise(function(_0x500420,_0x4e3834){return client['request'](_0x56d3fb,_0x467add)[_0x9c35('0xc')](function(_0x4d012f){logger[_0x9c35('0xd')](_0x9c35('0xe'),_0x21df9a,_0x9c35('0xf'));logger['debug'](_0x9c35('0x10'),_0x21df9a,_0x9c35('0xf'),JSON[_0x9c35('0x11')](_0x4d012f));if(_0x4d012f[_0x9c35('0x12')]){if(_0x4d012f[_0x9c35('0x12')]['code']===0x1f4){logger[_0x9c35('0x12')](_0x9c35('0xe'),_0x21df9a,_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);return _0x4e3834(_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);}logger[_0x9c35('0x12')](_0x9c35('0xe'),_0x21df9a,_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);return _0x500420(_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);}else{logger[_0x9c35('0xd')](_0x9c35('0xe'),_0x21df9a,_0x9c35('0xf'));_0x500420(_0x4d012f['result'][_0x9c35('0x13')]);}})[_0x9c35('0x14')](function(_0x26911d){logger[_0x9c35('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0x21df9a,_0x26911d);_0x4e3834(_0x26911d);});});}exports[_0x9c35('0x15')]=function(_0x3c3858){var _0x2edb26=this;return new Promise(function(_0x50d7b8,_0x69d118){return db['OpenchannelMessage'][_0x9c35('0x16')](_0x3c3858['body'],{'raw':_0x3c3858[_0x9c35('0x17')]?_0x3c3858[_0x9c35('0x17')][_0x9c35('0x18')]===undefined?!![]:![]:!![]})[_0x9c35('0xc')](function(_0x3d2193){logger[_0x9c35('0xd')](_0x9c35('0x15'),_0x3c3858);logger['debug']('CreateOpenchannelMessage',_0x3c3858,JSON[_0x9c35('0x11')](_0x3d2193));_0x50d7b8(_0x3d2193);})[_0x9c35('0x14')](function(_0x17deb2){logger[_0x9c35('0x12')]('CreateOpenchannelMessage',_0x17deb2[_0x9c35('0x13')],_0x3c3858);_0x69d118(_0x2edb26['error'](0x1f4,_0x17deb2[_0x9c35('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js
index fb1b2c7..da65e78 100644
--- a/server/api/openchannelMessage/openchannelMessage.socket.js
+++ b/server/api/openchannelMessage/openchannelMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['removeListener','register','length','openchannelMessage:','remove','update'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x3071('0x0'),_0x3071('0x1')];function createListener(_0x27405a,_0x305d85){return function(_0x864539){_0x305d85['emit'](_0x27405a,_0x864539);};}function removeListener(_0x2c547f,_0x7b18a4){return function(){OpenchannelMessageEvents[_0x3071('0x2')](_0x2c547f,_0x7b18a4);};}exports[_0x3071('0x3')]=function(_0xabd7b6){for(var _0x41cf76=0x0,_0x1d3dd6=events[_0x3071('0x4')];_0x41cf76<_0x1d3dd6;_0x41cf76++){var _0xbd737f=events[_0x41cf76];var _0x22274c=createListener(_0x3071('0x5')+_0xbd737f,_0xabd7b6);OpenchannelMessageEvents['on'](_0xbd737f,_0x22274c);}};
\ No newline at end of file
+var _0x54ef=['remove','emit','removeListener','length','./openchannelMessage.events','save'];(function(_0x1b26ee,_0x3e9153){var _0x554d3f=function(_0xc13dab){while(--_0xc13dab){_0x1b26ee['push'](_0x1b26ee['shift']());}};_0x554d3f(++_0x3e9153);}(_0x54ef,0x112));var _0xf54e=function(_0x1cd368,_0x126b24){_0x1cd368=_0x1cd368-0x0;var _0xd52ab8=_0x54ef[_0x1cd368];return _0xd52ab8;};'use strict';var OpenchannelMessageEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){OpenchannelMessageEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('openchannelMessage:'+_0x561870,_0x55e611);OpenchannelMessageEvents['on'](_0x561870,_0x27e69b);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js
index f080b1c..b67a256 100644
--- a/server/api/openchannelQueue/index.js
+++ b/server/api/openchannelQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5e0e=['isAuthenticated','index','get','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller'];(function(_0x506db2,_0x1ab1f3){var _0x2a2ad3=function(_0x3d1b79){while(--_0x3d1b79){_0x506db2['push'](_0x506db2['shift']());}};_0x2a2ad3(++_0x1ab1f3);}(_0x5e0e,0x89));var _0xe5e0=function(_0x3025e0,_0xf2c52d){_0x3025e0=_0x3025e0-0x0;var _0x4ee7c5=_0x5e0e[_0x3025e0];return _0x4ee7c5;};'use strict';var multer=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var path=require('path');var timeout=require(_0xe5e0('0x2'));var express=require(_0xe5e0('0x3'));var router=express[_0xe5e0('0x4')]();var auth=require(_0xe5e0('0x5'));var interaction=require(_0xe5e0('0x6'));var config=require('../../config/environment');var controller=require(_0xe5e0('0x7'));router['get']('/',auth[_0xe5e0('0x8')](),controller[_0xe5e0('0x9')]);router[_0xe5e0('0xa')](_0xe5e0('0xb'),auth[_0xe5e0('0x8')](),controller[_0xe5e0('0xc')]);router['get'](_0xe5e0('0xd'),auth[_0xe5e0('0x8')](),controller['show']);router[_0xe5e0('0xa')](_0xe5e0('0xe'),auth[_0xe5e0('0x8')](),controller[_0xe5e0('0xf')]);router[_0xe5e0('0xa')](_0xe5e0('0x10'),auth[_0xe5e0('0x8')](),controller[_0xe5e0('0x11')]);router[_0xe5e0('0xa')](_0xe5e0('0x12'),auth[_0xe5e0('0x8')](),controller[_0xe5e0('0x13')]);router[_0xe5e0('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe5e0('0x14')](_0xe5e0('0x10'),auth[_0xe5e0('0x8')](),controller[_0xe5e0('0x15')]);router['post'](_0xe5e0('0x12'),auth[_0xe5e0('0x8')](),controller[_0xe5e0('0x16')]);router[_0xe5e0('0x17')](_0xe5e0('0xd'),auth[_0xe5e0('0x8')](),controller[_0xe5e0('0x18')]);router[_0xe5e0('0x19')](_0xe5e0('0xd'),auth['isAuthenticated'](),controller[_0xe5e0('0x1a')]);router['delete'](_0xe5e0('0x10'),auth['isAuthenticated'](),controller[_0xe5e0('0x1b')]);router[_0xe5e0('0x19')]('/:id/users',auth[_0xe5e0('0x8')](),controller['removeAgents']);module[_0xe5e0('0x1c')]=router;
\ No newline at end of file
+var _0xa4dc=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers'];(function(_0x4b6643,_0x9e4308){var _0x3dc376=function(_0x39aab1){while(--_0x39aab1){_0x4b6643['push'](_0x4b6643['shift']());}};_0x3dc376(++_0x9e4308);}(_0xa4dc,0x16a));var _0xca4d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa4dc[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca4d('0x2'));var router=express[_0xca4d('0x3')]();var auth=require(_0xca4d('0x4'));var interaction=require(_0xca4d('0x5'));var config=require(_0xca4d('0x6'));var controller=require('./openchannelQueue.controller');router[_0xca4d('0x7')]('/',auth[_0xca4d('0x8')](),controller[_0xca4d('0x9')]);router['get'](_0xca4d('0xa'),auth['isAuthenticated'](),controller[_0xca4d('0xb')]);router[_0xca4d('0x7')](_0xca4d('0xc'),auth[_0xca4d('0x8')](),controller['show']);router[_0xca4d('0x7')](_0xca4d('0xd'),auth['isAuthenticated'](),controller[_0xca4d('0xe')]);router['get'](_0xca4d('0xf'),auth[_0xca4d('0x8')](),controller[_0xca4d('0x10')]);router[_0xca4d('0x7')](_0xca4d('0x11'),auth[_0xca4d('0x8')](),controller[_0xca4d('0x12')]);router[_0xca4d('0x13')]('/',auth['isAuthenticated'](),controller[_0xca4d('0x14')]);router['post'](_0xca4d('0xf'),auth[_0xca4d('0x8')](),controller[_0xca4d('0x15')]);router['post'](_0xca4d('0x11'),auth['isAuthenticated'](),controller[_0xca4d('0x16')]);router[_0xca4d('0x17')](_0xca4d('0xc'),auth[_0xca4d('0x8')](),controller[_0xca4d('0x18')]);router[_0xca4d('0x19')](_0xca4d('0xc'),auth['isAuthenticated'](),controller[_0xca4d('0x1a')]);router[_0xca4d('0x19')](_0xca4d('0xf'),auth[_0xca4d('0x8')](),controller[_0xca4d('0x1b')]);router[_0xca4d('0x19')](_0xca4d('0x11'),auth[_0xca4d('0x8')](),controller[_0xca4d('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js
index 92b0012..625d0d2 100644
--- a/server/api/openchannelQueue/openchannelQueue.attributes.js
+++ b/server/api/openchannelQueue/openchannelQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4012=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x217372,_0x1822ce){var _0x2715a1=function(_0x5712db){while(--_0x5712db){_0x217372['push'](_0x217372['shift']());}};_0x2715a1(++_0x1822ce);}(_0x4012,0x1bf));var _0x2401=function(_0x8b97b4,_0x382038){_0x8b97b4=_0x8b97b4-0x0;var _0x2ed10e=_0x4012[_0x8b97b4];return _0x2ed10e;};'use strict';var Sequelize=require(_0x2401('0x0'));module[_0x2401('0x1')]={'name':{'type':Sequelize[_0x2401('0x2')],'unique':_0x2401('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2401('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2401('0x4')](_0x2401('0x5'),_0x2401('0x6'),_0x2401('0x7'))}};
\ No newline at end of file
+var _0xdcb9=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x59971f,_0x58d895){var _0x4fc690=function(_0x2c6ac8){while(--_0x2c6ac8){_0x59971f['push'](_0x59971f['shift']());}};_0x4fc690(++_0x58d895);}(_0xdcb9,0x101));var _0x9dcb=function(_0x15179c,_0x1b624f){_0x15179c=_0x15179c-0x0;var _0x11c9b6=_0xdcb9[_0x15179c];return _0x11c9b6;};'use strict';var Sequelize=require(_0x9dcb('0x0'));module[_0x9dcb('0x1')]={'name':{'type':Sequelize[_0x9dcb('0x2')],'unique':_0x9dcb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9dcb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9dcb('0x5')](_0x9dcb('0x6'),'beepall',_0x9dcb('0x7'))}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js
index 318952f..a6fc6aa 100644
--- a/server/api/openchannelQueue/openchannelQueue.controller.js
+++ b/server/api/openchannelQueue/openchannelQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5076=['addAgents','omit','spread','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','stack','name','send','index','OpenchannelQueue','fieldName','type','key','map','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','length','create','body','user','get','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','nolimit','order','OpenchannelQueueId','findAll','User','UserId','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','ids','tq.TeamId','from','team_has_openchannel_queues','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeTeams','isEmpty','removeAgents','forEach'];(function(_0x1a79f1,_0x2a4ae4){var _0x4d373c=function(_0x2841cb){while(--_0x2841cb){_0x1a79f1['push'](_0x1a79f1['shift']());}};_0x4d373c(++_0x2a4ae4);}(_0x5076,0x191));var _0x6507=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0x5076[_0x1b5a5a];return _0x42b32d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6507('0x0'));var rimraf=require(_0x6507('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6507('0x2'));var rp=require(_0x6507('0x3'));var moment=require('moment');var BPromise=require(_0x6507('0x4'));var Mustache=require(_0x6507('0x5'));var util=require(_0x6507('0x6'));var path=require(_0x6507('0x7'));var sox=require(_0x6507('0x8'));var csv=require(_0x6507('0x9'));var ejs=require(_0x6507('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6507('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6507('0x9'));var querystring=require(_0x6507('0xc'));var Papa=require(_0x6507('0xd'));var Redis=require(_0x6507('0xe'));var authService=require(_0x6507('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6507('0x10'));var utils=require('../../config/utils');var config=require(_0x6507('0x11'));var db=require(_0x6507('0x12'))['db'];config[_0x6507('0x13')]=_['defaults'](config[_0x6507('0x13')],{'host':_0x6507('0x14'),'port':0x18eb});var socket=require(_0x6507('0x15'))(new Redis(config[_0x6507('0x13')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x51a622,_0x4168fd){_0x4168fd=_0x4168fd||0xcc;return function(_0x4f01c6){if(_0x4f01c6){return _0x51a622[_0x6507('0x16')](_0x4168fd);}return _0x51a622[_0x6507('0x17')](_0x4168fd)[_0x6507('0x18')]();};}function respondWithResult(_0x3dc6f5,_0x3335ac){_0x3335ac=_0x3335ac||0xc8;return function(_0x24302a){if(_0x24302a){return _0x3dc6f5[_0x6507('0x17')](_0x3335ac)[_0x6507('0x19')](_0x24302a);}};}function respondWithFilteredResult(_0x37d4f3,_0x25b9c4){return function(_0x3e08d8){if(_0x3e08d8){var _0x4a98f6=_0x3e08d8[_0x6507('0x1a')],_0x12c1ea=_0x25b9c4[_0x6507('0x1b')],_0x1095b8=_0x25b9c4[_0x6507('0x1b')]+_0x25b9c4[_0x6507('0x1c')],_0x33d1e9;if(_0x1095b8>=_0x4a98f6){_0x1095b8=_0x4a98f6;_0x33d1e9=0xc8;}else{_0x33d1e9=0xce;}_0x37d4f3['status'](_0x33d1e9);return _0x37d4f3['set'](_0x6507('0x1d'),_0x12c1ea+'-'+_0x1095b8+'/'+_0x4a98f6)[_0x6507('0x19')](_0x3e08d8);}return null;};}function patchUpdates(_0x56f55b){return function(_0xc8d718){try{jsonpatch[_0x6507('0x1e')](_0xc8d718,_0x56f55b,!![]);}catch(_0x5d7127){return BPromise[_0x6507('0x1f')](_0x5d7127);}return _0xc8d718[_0x6507('0x20')]();};}function saveUpdates(_0x16f200,_0x564fe1){return function(_0x43cd21){if(_0x43cd21){return _0x43cd21[_0x6507('0x21')](_0x16f200)[_0x6507('0x22')](function(_0x593696){return _0x593696;});}return null;};}function removeEntity(_0x2ee5e2,_0x5b8ced){return function(_0x3eec77){if(_0x3eec77){return _0x3eec77[_0x6507('0x23')]()[_0x6507('0x22')](function(){var _0x299474=_0x3eec77['get']({'plain':!![]});var _0x5e21c4=_0x6507('0x24');return db[_0x6507('0x25')]['destroy']({'where':{'type':_0x5e21c4,'resourceId':_0x299474['id']}})[_0x6507('0x22')](function(){return _0x3eec77;});})[_0x6507('0x22')](function(){_0x2ee5e2[_0x6507('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d67f3,_0x4caf3d){return function(_0x59c1ea){if(!_0x59c1ea){_0x4d67f3[_0x6507('0x16')](0x194);}return _0x59c1ea;};}function handleError(_0x272eb7,_0x379f12){_0x379f12=_0x379f12||0x1f4;return function(_0x5748d2){logger['error'](_0x5748d2[_0x6507('0x26')]);if(_0x5748d2[_0x6507('0x27')]){delete _0x5748d2[_0x6507('0x27')];}_0x272eb7['status'](_0x379f12)[_0x6507('0x28')](_0x5748d2);};}exports[_0x6507('0x29')]=function(_0x288e4c,_0x174b54){var _0x17eebc={},_0xa1543f={},_0x5e19ae={'count':0x0,'rows':[]};var _0xbda099=_['map'](db[_0x6507('0x2a')]['rawAttributes'],function(_0x1c1c6b){return{'name':_0x1c1c6b[_0x6507('0x2b')],'type':_0x1c1c6b[_0x6507('0x2c')][_0x6507('0x2d')]};});_0xa1543f['model']=_[_0x6507('0x2e')](_0xbda099,_0x6507('0x27'));_0xa1543f['query']=_[_0x6507('0x2f')](_0x288e4c[_0x6507('0x30')]);_0xa1543f[_0x6507('0x31')]=_['intersection'](_0xa1543f[_0x6507('0x32')],_0xa1543f['query']);_0x17eebc['attributes']=_[_0x6507('0x33')](_0xa1543f[_0x6507('0x32')],qs['fields'](_0x288e4c[_0x6507('0x30')][_0x6507('0x34')]));_0x17eebc[_0x6507('0x35')]=_0x17eebc['attributes']['length']?_0x17eebc[_0x6507('0x35')]:_0xa1543f[_0x6507('0x32')];if(!_0x288e4c[_0x6507('0x30')][_0x6507('0x36')]('nolimit')){_0x17eebc['limit']=qs[_0x6507('0x1c')](_0x288e4c[_0x6507('0x30')][_0x6507('0x1c')]);_0x17eebc[_0x6507('0x1b')]=qs[_0x6507('0x1b')](_0x288e4c['query']['offset']);}_0x17eebc['order']=qs[_0x6507('0x37')](_0x288e4c['query'][_0x6507('0x37')]);_0x17eebc[_0x6507('0x38')]=qs['filters'](_[_0x6507('0x39')](_0x288e4c[_0x6507('0x30')],_0xa1543f[_0x6507('0x31')]),_0xbda099);if(_0x288e4c[_0x6507('0x30')][_0x6507('0x3a')]){_0x17eebc[_0x6507('0x38')]=_[_0x6507('0x3b')](_0x17eebc[_0x6507('0x38')],{'$or':_['map'](_0xbda099,function(_0x53c010){if(_0x53c010[_0x6507('0x2c')]!==_0x6507('0x3c')){var _0x47f7eb={};_0x47f7eb[_0x53c010[_0x6507('0x27')]]={'$like':'%'+_0x288e4c[_0x6507('0x30')][_0x6507('0x3a')]+'%'};return _0x47f7eb;}})});}_0x17eebc=_[_0x6507('0x3b')]({},_0x17eebc,_0x288e4c[_0x6507('0x3d')]);var _0x2200e5={'where':_0x17eebc[_0x6507('0x38')]};return db['OpenchannelQueue'][_0x6507('0x1a')](_0x2200e5)[_0x6507('0x22')](function(_0x28b579){_0x5e19ae['count']=_0x28b579;if(_0x288e4c[_0x6507('0x30')][_0x6507('0x3e')]){_0x17eebc[_0x6507('0x3f')]=[{'all':!![]}];}return db[_0x6507('0x2a')]['findAll'](_0x17eebc);})[_0x6507('0x22')](function(_0x158316){_0x5e19ae[_0x6507('0x40')]=_0x158316;return _0x5e19ae;})['then'](respondWithFilteredResult(_0x174b54,_0x17eebc))[_0x6507('0x41')](handleError(_0x174b54,null));};exports['show']=function(_0x4115fc,_0x32eba7){var _0x288c6a={'raw':!![],'where':{'id':_0x4115fc[_0x6507('0x42')]['id']}},_0xf41d06={};_0xf41d06[_0x6507('0x32')]=_[_0x6507('0x2f')](db[_0x6507('0x2a')][_0x6507('0x43')]);_0xf41d06[_0x6507('0x30')]=_[_0x6507('0x2f')](_0x4115fc[_0x6507('0x30')]);_0xf41d06[_0x6507('0x31')]=_[_0x6507('0x33')](_0xf41d06[_0x6507('0x32')],_0xf41d06[_0x6507('0x30')]);_0x288c6a[_0x6507('0x35')]=_[_0x6507('0x33')](_0xf41d06[_0x6507('0x32')],qs[_0x6507('0x34')](_0x4115fc[_0x6507('0x30')][_0x6507('0x34')]));_0x288c6a[_0x6507('0x35')]=_0x288c6a[_0x6507('0x35')][_0x6507('0x44')]?_0x288c6a[_0x6507('0x35')]:_0xf41d06[_0x6507('0x32')];if(_0x4115fc[_0x6507('0x30')][_0x6507('0x3e')]){_0x288c6a[_0x6507('0x3f')]=[{'all':!![]}];}_0x288c6a=_['merge']({},_0x288c6a,_0x4115fc[_0x6507('0x3d')]);return db['OpenchannelQueue']['find'](_0x288c6a)[_0x6507('0x22')](handleEntityNotFound(_0x32eba7,null))[_0x6507('0x22')](respondWithResult(_0x32eba7,null))[_0x6507('0x41')](handleError(_0x32eba7,null));};exports['create']=function(_0x256cef,_0x30edfb){return db[_0x6507('0x2a')][_0x6507('0x45')](_0x256cef[_0x6507('0x46')],{})[_0x6507('0x22')](function(_0x24230d){var _0x3358f8=_0x256cef[_0x6507('0x47')][_0x6507('0x48')]({'plain':!![]});if(!_0x3358f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3358f8[_0x6507('0x49')]===_0x6507('0x47')){var _0x1a5132=_0x24230d[_0x6507('0x48')]({'plain':!![]});var _0x5d059b=_0x6507('0x24');return db[_0x6507('0x4a')][_0x6507('0x4b')]({'where':{'name':_0x5d059b,'userProfileId':_0x3358f8['userProfileId']},'raw':!![]})[_0x6507('0x22')](function(_0x5e6322){if(_0x5e6322&&_0x5e6322[_0x6507('0x4c')]===0x0){return db[_0x6507('0x25')][_0x6507('0x45')]({'name':_0x1a5132[_0x6507('0x27')],'resourceId':_0x1a5132['id'],'type':_0x5e6322[_0x6507('0x27')],'sectionId':_0x5e6322['id']},{})[_0x6507('0x22')](function(){return _0x24230d;});}else{return _0x24230d;}})[_0x6507('0x41')](function(_0x408a09){logger[_0x6507('0x4d')](_0x6507('0x4e'),_0x408a09);throw _0x408a09;});}return _0x24230d;})[_0x6507('0x22')](respondWithResult(_0x30edfb,0xc9))[_0x6507('0x41')](handleError(_0x30edfb,null));};exports['update']=function(_0x550bfd,_0x5ac601){if(_0x550bfd[_0x6507('0x46')]['id']){delete _0x550bfd[_0x6507('0x46')]['id'];}return db[_0x6507('0x2a')]['find']({'where':{'id':_0x550bfd['params']['id']}})['then'](handleEntityNotFound(_0x5ac601,null))[_0x6507('0x22')](saveUpdates(_0x550bfd[_0x6507('0x46')],null))[_0x6507('0x22')](respondWithResult(_0x5ac601,null))[_0x6507('0x41')](handleError(_0x5ac601,null));};exports[_0x6507('0x23')]=function(_0x128d24,_0x42575c){return db[_0x6507('0x2a')][_0x6507('0x4b')]({'where':{'id':_0x128d24['params']['id']}})[_0x6507('0x22')](handleEntityNotFound(_0x42575c,null))[_0x6507('0x22')](removeEntity(_0x42575c,null))['catch'](handleError(_0x42575c,null));};exports[_0x6507('0x4f')]=function(_0x14ddb7,_0x1f8bf8){return db[_0x6507('0x2a')][_0x6507('0x4f')]()[_0x6507('0x22')](respondWithResult(_0x1f8bf8,null))[_0x6507('0x41')](handleError(_0x1f8bf8,null));};exports['getMembers']=function(_0xe84dac,_0x15eb34,_0x42e100){var _0x5bd500={'raw':!![],'where':{}},_0x200151={},_0x23a37f;return db[_0x6507('0x2a')][_0x6507('0x50')]({'where':{'id':_0xe84dac['params']['id']}})[_0x6507('0x22')](handleEntityNotFound(_0x15eb34,null))[_0x6507('0x22')](function(_0x8e85b7){if(_0x8e85b7){_0x23a37f=_0x8e85b7[_0x6507('0x48')]({'plain':!![]});_0x200151[_0x6507('0x32')]=_[_0x6507('0x2f')](db[_0x6507('0x51')][_0x6507('0x43')]);_0x200151[_0x6507('0x30')]=_[_0x6507('0x2f')](_0xe84dac[_0x6507('0x30')]);_0x200151[_0x6507('0x31')]=_[_0x6507('0x33')](_0x200151[_0x6507('0x32')],_0x200151[_0x6507('0x30')]);_0x5bd500[_0x6507('0x35')]=_[_0x6507('0x33')](_0x200151['model'],qs[_0x6507('0x34')](_0xe84dac[_0x6507('0x30')][_0x6507('0x34')]));_0x5bd500['attributes']=_0x5bd500[_0x6507('0x35')][_0x6507('0x44')]?_0x5bd500['attributes']:_0x200151[_0x6507('0x32')];if(!_0xe84dac['query'][_0x6507('0x36')](_0x6507('0x52'))){_0x5bd500[_0x6507('0x1c')]=qs[_0x6507('0x1c')](_0xe84dac['query'][_0x6507('0x1c')]);_0x5bd500['offset']=qs[_0x6507('0x1b')](_0xe84dac[_0x6507('0x30')][_0x6507('0x1b')]);}_0x5bd500[_0x6507('0x53')]=qs[_0x6507('0x37')](_0xe84dac['query'][_0x6507('0x37')]);_0x5bd500['where']=qs[_0x6507('0x31')](_[_0x6507('0x39')](_0xe84dac[_0x6507('0x30')],_0x200151['filters']));_0x5bd500['where'][_0x6507('0x54')]=_0x8e85b7['id'];if(_0xe84dac['query']['filter']){_0x5bd500['where']=_[_0x6507('0x3b')](_0x5bd500['where'],{'$or':_[_0x6507('0x2e')](_0x5bd500[_0x6507('0x35')],function(_0x1cf024){var _0x31270c={};_0x31270c[_0x1cf024]={'$like':'%'+_0xe84dac[_0x6507('0x30')][_0x6507('0x3a')]+'%'};return _0x31270c;})});}_0x5bd500=_[_0x6507('0x3b')]({},_0x5bd500,_0xe84dac[_0x6507('0x3d')]);return db[_0x6507('0x51')][_0x6507('0x55')](_0x5bd500);}})[_0x6507('0x22')](function(_0x28c052){if(_0x28c052){return db[_0x6507('0x56')]['findAndCountAll']({'where':{'id':_[_0x6507('0x2e')](_0x28c052,_0x6507('0x57')),'role':'agent'},'attributes':['id',_0x6507('0x27'),_0x6507('0x58'),_0x6507('0x59'),'createdAt']});}})[_0x6507('0x22')](function(_0x127d46){if(_0x127d46){return{'count':_0x127d46['count'],'rows':_[_0x6507('0x2e')](_0x127d46[_0x6507('0x40')],function(_0x77e649){return{'membername':_0x77e649[_0x6507('0x27')],'UserId':_0x77e649['id'],'queue_name':_0x23a37f['name'],'OpenchannelQueueId':_0x23a37f['id'],'interface':util[_0x6507('0x5a')](_0x6507('0x5b'),_0x6507('0x5c'),_0x77e649['name']),'penalty':0x0,'paused':_0x77e649[_0x6507('0x58')],'createdAt':_0x77e649[_0x6507('0x5d')],'updatedAt':_0x77e649[_0x6507('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x15eb34,_0x5bd500))[_0x6507('0x41')](handleError(_0x15eb34,null));};exports['getTeams']=function(_0x343daa,_0x137f9e,_0x95eff9){var _0x3dd184={};var _0x52fe9b={};var _0x3bd369;var _0x3cd45b;return db[_0x6507('0x2a')][_0x6507('0x50')]({'where':{'id':_0x343daa[_0x6507('0x42')]['id']}})[_0x6507('0x22')](handleEntityNotFound(_0x137f9e,null))['then'](function(_0x5e9e5f){if(_0x5e9e5f){_0x3bd369=_0x5e9e5f;_0x52fe9b['model']=_[_0x6507('0x2f')](db[_0x6507('0x5e')][_0x6507('0x43')]);_0x52fe9b[_0x6507('0x30')]=_[_0x6507('0x2f')](_0x343daa[_0x6507('0x30')]);_0x52fe9b['filters']=_[_0x6507('0x33')](_0x52fe9b[_0x6507('0x32')],_0x52fe9b[_0x6507('0x30')]);_0x3dd184['attributes']=_['intersection'](_0x52fe9b['model'],qs['fields'](_0x343daa['query']['fields']));_0x3dd184[_0x6507('0x35')]=_0x3dd184['attributes'][_0x6507('0x44')]?_0x3dd184[_0x6507('0x35')]:_0x52fe9b[_0x6507('0x32')];_0x3dd184[_0x6507('0x53')]=qs[_0x6507('0x37')](_0x343daa[_0x6507('0x30')][_0x6507('0x37')]);_0x3dd184[_0x6507('0x38')]=qs[_0x6507('0x31')](_[_0x6507('0x39')](_0x343daa[_0x6507('0x30')],_0x52fe9b[_0x6507('0x31')]));if(_0x343daa['query'][_0x6507('0x3a')]){_0x3dd184[_0x6507('0x38')]=_['merge'](_0x3dd184[_0x6507('0x38')],{'$or':_[_0x6507('0x2e')](_0x3dd184[_0x6507('0x35')],function(_0xc62e01){var _0x5f3061={};_0x5f3061[_0xc62e01]={'$like':'%'+_0x343daa[_0x6507('0x30')][_0x6507('0x3a')]+'%'};return _0x5f3061;})});}_0x3dd184=_[_0x6507('0x3b')]({},_0x3dd184,_0x343daa['options']);return _0x3bd369[_0x6507('0x5f')](_0x3dd184);}})[_0x6507('0x22')](function(_0x3c7f9f){if(_0x3c7f9f){_0x3cd45b=_0x3c7f9f[_0x6507('0x44')];if(!_0x343daa['query']['hasOwnProperty'](_0x6507('0x52'))){_0x3dd184[_0x6507('0x1c')]=qs[_0x6507('0x1c')](_0x343daa[_0x6507('0x30')]['limit']);_0x3dd184[_0x6507('0x1b')]=qs[_0x6507('0x1b')](_0x343daa[_0x6507('0x30')]['offset']);}return _0x3bd369[_0x6507('0x5f')](_0x3dd184);}})[_0x6507('0x22')](function(_0x2f62be){if(_0x2f62be){return _0x2f62be?{'count':_0x3cd45b,'rows':_0x2f62be}:null;}})[_0x6507('0x22')](respondWithResult(_0x137f9e,null))[_0x6507('0x41')](handleError(_0x137f9e,null));};exports[_0x6507('0x60')]=function(_0x45b6f5,_0x5a4178,_0x333c0f){var _0x562ddc=_0x45b6f5[_0x6507('0x46')]['ids'];return db[_0x6507('0x5e')][_0x6507('0x55')]({'where':{'id':_0x562ddc},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6507('0x61'),'attributes':['id',_0x6507('0x27'),_0x6507('0x62'),_0x6507('0x63'),_0x6507('0x64')],'raw':!![]}]})[_0x6507('0x22')](function(_0x420c3c){if(_0x420c3c){var _0xca2aa3=_[_0x6507('0x65')](_0x420c3c,function(_0x13d2c3){var _0x5b3216=_0x13d2c3['get']({'plain':!![]});return _0x5b3216[_0x6507('0x61')];});return db[_0x6507('0x2a')][_0x6507('0x4b')]({'where':{'id':_0x45b6f5['params']['id']}})[_0x6507('0x22')](function(_0x35b6f8){return db[_0x6507('0x66')][_0x6507('0x67')](function(_0x3c754a){return _0x35b6f8['addTeams'](_0x562ddc,{'transaction':_0x3c754a})['then'](function(){return BPromise[_0x6507('0x68')](_0xca2aa3,function(_0x154a78){return db[_0x6507('0x51')][_0x6507('0x69')]({'where':{'UserId':_0x154a78['id'],'OpenchannelQueueId':_0x45b6f5[_0x6507('0x42')]['id']},'transaction':_0x3c754a});});})[_0x6507('0x22')](function(){_0xca2aa3['forEach'](function(_0x4b736c){socket[_0x6507('0x6a')]('userOpenchannelQueue:save',{'UserId':_0x4b736c['id'],'OpenchannelQueueId':_0x35b6f8['id']});});});});});}})['then'](respondWithStatusCode(_0x5a4178,null))[_0x6507('0x41')](handleError(_0x5a4178,null));};exports['removeTeams']=function(_0x51df18,_0x2fa2a7,_0x5f400a){return db[_0x6507('0x5e')][_0x6507('0x55')]({'where':{'id':_0x51df18['query'][_0x6507('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x6507('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2fa2a7,null))['then'](function(_0x1c0c31){var _0x1f1208=_['map'](_0x1c0c31,'id');var _0x3bb106=[];var _0x32be86=[];var _0x2f416e=squel['select']();_0x2f416e['field'](_0x6507('0x6c'))[_0x6507('0x6d')](_0x6507('0x6e'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6507('0x38')](_0x6507('0x6f'),_0x51df18[_0x6507('0x42')]['id']);for(var _0x1c0a9e=0x0;_0x1c0a9e<_0x1c0c31['length'];_0x1c0a9e+=0x1){let _0x82e674=_0x1c0c31[_0x1c0a9e];for(var _0x43b658=0x0;_0x43b658<_0x82e674[_0x6507('0x61')][_0x6507('0x44')];_0x43b658+=0x1){let _0x527322=_0x82e674[_0x6507('0x61')][_0x43b658];var _0x4f1834=_0x2f416e[_0x6507('0x70')]();_0x4f1834['where'](_0x6507('0x71'),_0x527322['id']);_0x32be86[_0x6507('0x72')](db['sequelize'][_0x6507('0x30')](_0x4f1834[_0x6507('0x73')](),{'type':db[_0x6507('0x66')][_0x6507('0x74')][_0x6507('0x75')]})[_0x6507('0x22')](function(_0x2f3024){if(_0x2f3024[_0x6507('0x44')]===0x1){return _0x527322['id'];}else{var _0x58c8ef=_[_0x6507('0x76')](_[_0x6507('0x2e')](_0x2f3024,_0x6507('0x77')),function(_0x5bec52){return _[_0x6507('0x78')](_0x1f1208,_0x5bec52);});if(_0x58c8ef){return _0x527322['id'];}}}));}}return BPromise['all'](_0x32be86)[_0x6507('0x22')](function(_0x32003c){_0x3bb106=_(_0x3bb106)[_0x6507('0x79')](_0x32003c)[_0x6507('0x7a')]()['value']();return db[_0x6507('0x2a')][_0x6507('0x4b')]({'where':{'id':_0x51df18[_0x6507('0x42')]['id']}})[_0x6507('0x22')](function(_0x161200){return db[_0x6507('0x66')][_0x6507('0x67')](function(_0x1c8aa3){return _0x161200[_0x6507('0x7b')](_0x51df18[_0x6507('0x30')]['ids'],{'transaction':_0x1c8aa3})[_0x6507('0x22')](function(){if(!_[_0x6507('0x7c')](_0x3bb106)){return _0x161200[_0x6507('0x7d')](_0x3bb106,{'transaction':_0x1c8aa3});}})[_0x6507('0x22')](function(){_0x3bb106[_0x6507('0x7e')](function(_0x56b114){socket[_0x6507('0x6a')]('userOpenchannelQueue:remove',{'UserId':_0x56b114,'OpenchannelQueueId':_0x161200['id']});});});});});});})[_0x6507('0x22')](respondWithStatusCode(_0x2fa2a7,null))[_0x6507('0x41')](handleError(_0x2fa2a7,null));};exports[_0x6507('0x7f')]=function(_0x2d66bb,_0x43226c,_0x1eb329){return db[_0x6507('0x2a')][_0x6507('0x4b')]({'where':{'id':_0x2d66bb[_0x6507('0x42')]['id']}})[_0x6507('0x22')](handleEntityNotFound(_0x43226c,null))['then'](function(_0x1222fe){if(_0x1222fe){return _0x1222fe[_0x6507('0x7f')](_0x2d66bb[_0x6507('0x46')][_0x6507('0x6b')],_[_0x6507('0x80')](_0x2d66bb[_0x6507('0x46')],[_0x6507('0x6b'),'id'])||{})[_0x6507('0x81')](function(_0x4b5e3b){for(var _0x205d32=0x0;_0x205d32<_0x2d66bb[_0x6507('0x46')][_0x6507('0x6b')][_0x6507('0x44')];_0x205d32+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x2d66bb[_0x6507('0x46')][_0x6507('0x6b')][_0x205d32],'OpenchannelQueueId':_0x2d66bb[_0x6507('0x42')]['id']});}return _0x4b5e3b;});}})[_0x6507('0x22')](respondWithResult(_0x43226c,null))[_0x6507('0x41')](handleError(_0x43226c,null));};exports['removeAgents']=function(_0x578dfd,_0x4c8f1e,_0x151925){return db['OpenchannelQueue'][_0x6507('0x4b')]({'where':{'id':_0x578dfd['params']['id']}})[_0x6507('0x22')](handleEntityNotFound(_0x4c8f1e,null))[_0x6507('0x22')](function(_0x2c57aa){if(_0x2c57aa){return _0x2c57aa[_0x6507('0x7d')](_0x578dfd[_0x6507('0x30')][_0x6507('0x6b')])[_0x6507('0x22')](function(){if(_['isArray'](_0x578dfd[_0x6507('0x30')][_0x6507('0x6b')])){for(var _0x3ec6d5=0x0;_0x3ec6d5<_0x578dfd[_0x6507('0x30')][_0x6507('0x6b')][_0x6507('0x44')];_0x3ec6d5+=0x1){socket['emit'](_0x6507('0x82'),{'UserId':Number(_0x578dfd['query'][_0x6507('0x6b')][_0x3ec6d5]),'OpenchannelQueueId':Number(_0x578dfd['params']['id'])});}}else{socket[_0x6507('0x6a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x578dfd[_0x6507('0x30')][_0x6507('0x6b')]),'OpenchannelQueueId':Number(_0x578dfd[_0x6507('0x42')]['id'])});}});}})[_0x6507('0x22')](respondWithStatusCode(_0x4c8f1e,null))[_0x6507('0x41')](handleError(_0x4c8f1e,null));};exports[_0x6507('0x83')]=function(_0x4e27a6,_0x926a40,_0x1a2047){var _0x2384db={};var _0x102871={};var _0x2b46c9;var _0x5567a0;return db[_0x6507('0x2a')][_0x6507('0x50')]({'where':{'id':_0x4e27a6['params']['id']}})['then'](handleEntityNotFound(_0x926a40,null))['then'](function(_0xfbc014){if(_0xfbc014){_0x2b46c9=_0xfbc014;_0x102871['model']=_[_0x6507('0x2f')](db[_0x6507('0x56')][_0x6507('0x43')]);_0x102871['query']=_[_0x6507('0x2f')](_0x4e27a6[_0x6507('0x30')]);_0x102871[_0x6507('0x31')]=_[_0x6507('0x33')](_0x102871[_0x6507('0x32')],_0x102871['query']);_0x2384db[_0x6507('0x35')]=_[_0x6507('0x33')](_0x102871[_0x6507('0x32')],qs['fields'](_0x4e27a6[_0x6507('0x30')][_0x6507('0x34')]));_0x2384db[_0x6507('0x35')]=_0x2384db[_0x6507('0x35')][_0x6507('0x44')]?_0x2384db[_0x6507('0x35')]:_0x102871['model'];_0x2384db[_0x6507('0x53')]=qs[_0x6507('0x37')](_0x4e27a6[_0x6507('0x30')]['sort']);_0x2384db[_0x6507('0x38')]=qs[_0x6507('0x31')](_['pick'](_0x4e27a6['query'],_0x102871['filters']));if(_0x4e27a6['query']['filter']){_0x2384db[_0x6507('0x38')]=_[_0x6507('0x3b')](_0x2384db[_0x6507('0x38')],{'$or':_[_0x6507('0x2e')](_0x2384db[_0x6507('0x35')],function(_0x566524){var _0x1e5c97={};_0x1e5c97[_0x566524]={'$like':'%'+_0x4e27a6[_0x6507('0x30')]['filter']+'%'};return _0x1e5c97;})});}_0x2384db=_[_0x6507('0x3b')]({},_0x2384db,_0x4e27a6[_0x6507('0x3d')]);return _0x2b46c9['getAgents'](_0x2384db);}})['then'](function(_0x3ac387){if(_0x3ac387){_0x5567a0=_0x3ac387[_0x6507('0x44')];if(!_0x4e27a6[_0x6507('0x30')][_0x6507('0x36')](_0x6507('0x52'))){_0x2384db['limit']=qs[_0x6507('0x1c')](_0x4e27a6[_0x6507('0x30')]['limit']);_0x2384db[_0x6507('0x1b')]=qs[_0x6507('0x1b')](_0x4e27a6[_0x6507('0x30')][_0x6507('0x1b')]);}return _0x2b46c9[_0x6507('0x83')](_0x2384db);}})['then'](function(_0x2feae5){if(_0x2feae5){return _0x2feae5?{'count':_0x5567a0,'rows':_0x2feae5}:null;}})[_0x6507('0x22')](respondWithResult(_0x926a40,null))[_0x6507('0x41')](handleError(_0x926a40,null));};
\ No newline at end of file
+var _0x0ec4=['push','QueryTypes','TeamId','includes','all','compact','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','end','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','send','map','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?'];(function(_0x5e9e5f,_0x19aeeb){var _0x4944f5=function(_0x1add77){while(--_0x1add77){_0x5e9e5f['push'](_0x5e9e5f['shift']());}};_0x4944f5(++_0x19aeeb);}(_0x0ec4,0x1a3));var _0x40ec=function(_0x5b06a6,_0x2500f8){_0x5b06a6=_0x5b06a6-0x0;var _0x1969c8=_0x0ec4[_0x5b06a6];return _0x1969c8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x40ec('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x40ec('0x1'));var moment=require(_0x40ec('0x2'));var BPromise=require(_0x40ec('0x3'));var Mustache=require(_0x40ec('0x4'));var util=require(_0x40ec('0x5'));var path=require(_0x40ec('0x6'));var sox=require('sox');var csv=require(_0x40ec('0x7'));var ejs=require(_0x40ec('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x40ec('0x9'));var jsforce=require(_0x40ec('0xa'));var deskjs=require(_0x40ec('0xb'));var toCsv=require(_0x40ec('0x7'));var querystring=require(_0x40ec('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x40ec('0xd'));var qs=require(_0x40ec('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40ec('0xf'));var logger=require(_0x40ec('0x10'))(_0x40ec('0x11'));var utils=require(_0x40ec('0x12'));var config=require(_0x40ec('0x13'));var db=require(_0x40ec('0x14'))['db'];config[_0x40ec('0x15')]=_[_0x40ec('0x16')](config[_0x40ec('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x40ec('0x17'))(new Redis(config[_0x40ec('0x15')]));require(_0x40ec('0x18'))['register'](socket);function respondWithStatusCode(_0x66f63a,_0x550366){_0x550366=_0x550366||0xcc;return function(_0x4e5174){if(_0x4e5174){return _0x66f63a['sendStatus'](_0x550366);}return _0x66f63a['status'](_0x550366)[_0x40ec('0x19')]();};}function respondWithResult(_0x116479,_0x37d118){_0x37d118=_0x37d118||0xc8;return function(_0x40de32){if(_0x40de32){return _0x116479[_0x40ec('0x1a')](_0x37d118)[_0x40ec('0x1b')](_0x40de32);}};}function respondWithFilteredResult(_0x2ba8f,_0x2512cc){return function(_0x4b0750){if(_0x4b0750){var _0x4b9eca=_0x4b0750[_0x40ec('0x1c')],_0x3470c9=_0x2512cc['offset'],_0x17001d=_0x2512cc[_0x40ec('0x1d')]+_0x2512cc[_0x40ec('0x1e')],_0x4f8097;if(_0x17001d>=_0x4b9eca){_0x17001d=_0x4b9eca;_0x4f8097=0xc8;}else{_0x4f8097=0xce;}_0x2ba8f['status'](_0x4f8097);return _0x2ba8f[_0x40ec('0x1f')](_0x40ec('0x20'),_0x3470c9+'-'+_0x17001d+'/'+_0x4b9eca)[_0x40ec('0x1b')](_0x4b0750);}return null;};}function patchUpdates(_0x24dab9){return function(_0x5e0f37){try{jsonpatch[_0x40ec('0x21')](_0x5e0f37,_0x24dab9,!![]);}catch(_0x33e312){return BPromise['reject'](_0x33e312);}return _0x5e0f37[_0x40ec('0x22')]();};}function saveUpdates(_0x1aad8c,_0x264453){return function(_0x504cb1){if(_0x504cb1){return _0x504cb1['update'](_0x1aad8c)[_0x40ec('0x23')](function(_0x366405){return _0x366405;});}return null;};}function removeEntity(_0x44c48b,_0x353498){return function(_0x47bcad){if(_0x47bcad){return _0x47bcad[_0x40ec('0x24')]()[_0x40ec('0x23')](function(){var _0x3979e2=_0x47bcad[_0x40ec('0x25')]({'plain':!![]});var _0x1e941c=_0x40ec('0x26');return db[_0x40ec('0x27')][_0x40ec('0x24')]({'where':{'type':_0x1e941c,'resourceId':_0x3979e2['id']}})[_0x40ec('0x23')](function(){return _0x47bcad;});})[_0x40ec('0x23')](function(){_0x44c48b[_0x40ec('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b26a4,_0xe31865){return function(_0x43c5ee){if(!_0x43c5ee){_0x1b26a4[_0x40ec('0x28')](0x194);}return _0x43c5ee;};}function handleError(_0x284f41,_0x211315){_0x211315=_0x211315||0x1f4;return function(_0x4f0fda){logger[_0x40ec('0x29')](_0x4f0fda[_0x40ec('0x2a')]);if(_0x4f0fda[_0x40ec('0x2b')]){delete _0x4f0fda[_0x40ec('0x2b')];}_0x284f41[_0x40ec('0x1a')](_0x211315)[_0x40ec('0x2c')](_0x4f0fda);};}exports['index']=function(_0x3569e3,_0x5be7bc){var _0x598882={},_0x1d8b78={},_0x5413d5={'count':0x0,'rows':[]};var _0x4fa667=_[_0x40ec('0x2d')](db['OpenchannelQueue']['rawAttributes'],function(_0x9d1872){return{'name':_0x9d1872['fieldName'],'type':_0x9d1872[_0x40ec('0x2e')]['key']};});_0x1d8b78['model']=_[_0x40ec('0x2d')](_0x4fa667,_0x40ec('0x2b'));_0x1d8b78['query']=_['keys'](_0x3569e3[_0x40ec('0x2f')]);_0x1d8b78[_0x40ec('0x30')]=_[_0x40ec('0x31')](_0x1d8b78[_0x40ec('0x32')],_0x1d8b78[_0x40ec('0x2f')]);_0x598882[_0x40ec('0x33')]=_[_0x40ec('0x31')](_0x1d8b78[_0x40ec('0x32')],qs[_0x40ec('0x34')](_0x3569e3[_0x40ec('0x2f')]['fields']));_0x598882[_0x40ec('0x33')]=_0x598882[_0x40ec('0x33')][_0x40ec('0x35')]?_0x598882['attributes']:_0x1d8b78[_0x40ec('0x32')];if(!_0x3569e3[_0x40ec('0x2f')][_0x40ec('0x36')]('nolimit')){_0x598882[_0x40ec('0x1e')]=qs[_0x40ec('0x1e')](_0x3569e3[_0x40ec('0x2f')][_0x40ec('0x1e')]);_0x598882['offset']=qs['offset'](_0x3569e3['query']['offset']);}_0x598882['order']=qs[_0x40ec('0x37')](_0x3569e3[_0x40ec('0x2f')][_0x40ec('0x37')]);_0x598882[_0x40ec('0x38')]=qs[_0x40ec('0x30')](_[_0x40ec('0x39')](_0x3569e3[_0x40ec('0x2f')],_0x1d8b78[_0x40ec('0x30')]),_0x4fa667);if(_0x3569e3['query'][_0x40ec('0x3a')]){_0x598882[_0x40ec('0x38')]=_['merge'](_0x598882[_0x40ec('0x38')],{'$or':_[_0x40ec('0x2d')](_0x4fa667,function(_0x3c503a){if(_0x3c503a[_0x40ec('0x2e')]!==_0x40ec('0x3b')){var _0x565510={};_0x565510[_0x3c503a[_0x40ec('0x2b')]]={'$like':'%'+_0x3569e3[_0x40ec('0x2f')][_0x40ec('0x3a')]+'%'};return _0x565510;}})});}_0x598882=_['merge']({},_0x598882,_0x3569e3[_0x40ec('0x3c')]);var _0x1d36dd={'where':_0x598882[_0x40ec('0x38')]};return db[_0x40ec('0x3d')][_0x40ec('0x1c')](_0x1d36dd)[_0x40ec('0x23')](function(_0x256124){_0x5413d5[_0x40ec('0x1c')]=_0x256124;if(_0x3569e3[_0x40ec('0x2f')][_0x40ec('0x3e')]){_0x598882[_0x40ec('0x3f')]=[{'all':!![]}];}return db[_0x40ec('0x3d')][_0x40ec('0x40')](_0x598882);})[_0x40ec('0x23')](function(_0x1ae8b4){_0x5413d5[_0x40ec('0x41')]=_0x1ae8b4;return _0x5413d5;})['then'](respondWithFilteredResult(_0x5be7bc,_0x598882))[_0x40ec('0x42')](handleError(_0x5be7bc,null));};exports['show']=function(_0x510383,_0x10ad69){var _0x5a9774={'raw':!![],'where':{'id':_0x510383[_0x40ec('0x43')]['id']}},_0x152504={};_0x152504[_0x40ec('0x32')]=_[_0x40ec('0x44')](db[_0x40ec('0x3d')][_0x40ec('0x45')]);_0x152504[_0x40ec('0x2f')]=_[_0x40ec('0x44')](_0x510383[_0x40ec('0x2f')]);_0x152504[_0x40ec('0x30')]=_[_0x40ec('0x31')](_0x152504[_0x40ec('0x32')],_0x152504['query']);_0x5a9774['attributes']=_[_0x40ec('0x31')](_0x152504[_0x40ec('0x32')],qs['fields'](_0x510383[_0x40ec('0x2f')]['fields']));_0x5a9774[_0x40ec('0x33')]=_0x5a9774[_0x40ec('0x33')]['length']?_0x5a9774[_0x40ec('0x33')]:_0x152504[_0x40ec('0x32')];if(_0x510383[_0x40ec('0x2f')][_0x40ec('0x3e')]){_0x5a9774['include']=[{'all':!![]}];}_0x5a9774=_[_0x40ec('0x46')]({},_0x5a9774,_0x510383[_0x40ec('0x3c')]);return db[_0x40ec('0x3d')][_0x40ec('0x47')](_0x5a9774)[_0x40ec('0x23')](handleEntityNotFound(_0x10ad69,null))[_0x40ec('0x23')](respondWithResult(_0x10ad69,null))[_0x40ec('0x42')](handleError(_0x10ad69,null));};exports[_0x40ec('0x48')]=function(_0x41642a,_0x3b3658){return db[_0x40ec('0x3d')][_0x40ec('0x48')](_0x41642a[_0x40ec('0x49')],{})[_0x40ec('0x23')](function(_0x3327f3){var _0xce10bc=_0x41642a[_0x40ec('0x4a')][_0x40ec('0x25')]({'plain':!![]});if(!_0xce10bc)throw new Error(_0x40ec('0x4b'));if(_0xce10bc[_0x40ec('0x4c')]==='user'){var _0x390000=_0x3327f3['get']({'plain':!![]});var _0x5592ee=_0x40ec('0x26');return db[_0x40ec('0x4d')][_0x40ec('0x47')]({'where':{'name':_0x5592ee,'userProfileId':_0xce10bc[_0x40ec('0x4e')]},'raw':!![]})[_0x40ec('0x23')](function(_0x46288a){if(_0x46288a&&_0x46288a[_0x40ec('0x4f')]===0x0){return db['UserProfileResource'][_0x40ec('0x48')]({'name':_0x390000[_0x40ec('0x2b')],'resourceId':_0x390000['id'],'type':_0x46288a[_0x40ec('0x2b')],'sectionId':_0x46288a['id']},{})[_0x40ec('0x23')](function(){return _0x3327f3;});}else{return _0x3327f3;}})[_0x40ec('0x42')](function(_0xcf3216){logger[_0x40ec('0x29')](_0x40ec('0x50'),_0xcf3216);throw _0xcf3216;});}return _0x3327f3;})['then'](respondWithResult(_0x3b3658,0xc9))[_0x40ec('0x42')](handleError(_0x3b3658,null));};exports[_0x40ec('0x51')]=function(_0x5bca60,_0x318934){if(_0x5bca60[_0x40ec('0x49')]['id']){delete _0x5bca60['body']['id'];}return db[_0x40ec('0x3d')][_0x40ec('0x47')]({'where':{'id':_0x5bca60[_0x40ec('0x43')]['id']}})[_0x40ec('0x23')](handleEntityNotFound(_0x318934,null))[_0x40ec('0x23')](saveUpdates(_0x5bca60[_0x40ec('0x49')],null))[_0x40ec('0x23')](respondWithResult(_0x318934,null))[_0x40ec('0x42')](handleError(_0x318934,null));};exports[_0x40ec('0x24')]=function(_0x144c07,_0x283f06){return db[_0x40ec('0x3d')][_0x40ec('0x47')]({'where':{'id':_0x144c07['params']['id']}})['then'](handleEntityNotFound(_0x283f06,null))['then'](removeEntity(_0x283f06,null))[_0x40ec('0x42')](handleError(_0x283f06,null));};exports[_0x40ec('0x52')]=function(_0x591e7e,_0x2fd37c){return db[_0x40ec('0x3d')][_0x40ec('0x52')]()['then'](respondWithResult(_0x2fd37c,null))[_0x40ec('0x42')](handleError(_0x2fd37c,null));};exports[_0x40ec('0x53')]=function(_0x4cfafa,_0x3d22e5,_0x242510){var _0x2b5990={'raw':!![],'where':{}},_0x31d066={},_0x3b22c1;return db['OpenchannelQueue'][_0x40ec('0x54')]({'where':{'id':_0x4cfafa[_0x40ec('0x43')]['id']}})[_0x40ec('0x23')](handleEntityNotFound(_0x3d22e5,null))[_0x40ec('0x23')](function(_0x571dd9){if(_0x571dd9){_0x3b22c1=_0x571dd9[_0x40ec('0x25')]({'plain':!![]});_0x31d066[_0x40ec('0x32')]=_[_0x40ec('0x44')](db[_0x40ec('0x55')][_0x40ec('0x45')]);_0x31d066[_0x40ec('0x2f')]=_[_0x40ec('0x44')](_0x4cfafa[_0x40ec('0x2f')]);_0x31d066[_0x40ec('0x30')]=_[_0x40ec('0x31')](_0x31d066[_0x40ec('0x32')],_0x31d066[_0x40ec('0x2f')]);_0x2b5990[_0x40ec('0x33')]=_[_0x40ec('0x31')](_0x31d066[_0x40ec('0x32')],qs[_0x40ec('0x34')](_0x4cfafa[_0x40ec('0x2f')][_0x40ec('0x34')]));_0x2b5990[_0x40ec('0x33')]=_0x2b5990[_0x40ec('0x33')][_0x40ec('0x35')]?_0x2b5990['attributes']:_0x31d066[_0x40ec('0x32')];if(!_0x4cfafa[_0x40ec('0x2f')][_0x40ec('0x36')](_0x40ec('0x56'))){_0x2b5990[_0x40ec('0x1e')]=qs[_0x40ec('0x1e')](_0x4cfafa[_0x40ec('0x2f')][_0x40ec('0x1e')]);_0x2b5990[_0x40ec('0x1d')]=qs[_0x40ec('0x1d')](_0x4cfafa[_0x40ec('0x2f')]['offset']);}_0x2b5990[_0x40ec('0x57')]=qs[_0x40ec('0x37')](_0x4cfafa[_0x40ec('0x2f')][_0x40ec('0x37')]);_0x2b5990[_0x40ec('0x38')]=qs[_0x40ec('0x30')](_[_0x40ec('0x39')](_0x4cfafa[_0x40ec('0x2f')],_0x31d066[_0x40ec('0x30')]));_0x2b5990[_0x40ec('0x38')][_0x40ec('0x58')]=_0x571dd9['id'];if(_0x4cfafa[_0x40ec('0x2f')]['filter']){_0x2b5990[_0x40ec('0x38')]=_[_0x40ec('0x46')](_0x2b5990['where'],{'$or':_['map'](_0x2b5990[_0x40ec('0x33')],function(_0x25335c){var _0x4bad3c={};_0x4bad3c[_0x25335c]={'$like':'%'+_0x4cfafa['query'][_0x40ec('0x3a')]+'%'};return _0x4bad3c;})});}_0x2b5990=_[_0x40ec('0x46')]({},_0x2b5990,_0x4cfafa[_0x40ec('0x3c')]);return db[_0x40ec('0x55')][_0x40ec('0x40')](_0x2b5990);}})['then'](function(_0xf3c2b1){if(_0xf3c2b1){return db[_0x40ec('0x59')][_0x40ec('0x5a')]({'where':{'id':_[_0x40ec('0x2d')](_0xf3c2b1,_0x40ec('0x5b')),'role':_0x40ec('0x5c')},'attributes':['id','name',_0x40ec('0x5d'),_0x40ec('0x5e'),_0x40ec('0x5f')]});}})[_0x40ec('0x23')](function(_0x5f4589){if(_0x5f4589){return{'count':_0x5f4589[_0x40ec('0x1c')],'rows':_[_0x40ec('0x2d')](_0x5f4589['rows'],function(_0x34587b){return{'membername':_0x34587b['name'],'UserId':_0x34587b['id'],'queue_name':_0x3b22c1[_0x40ec('0x2b')],'OpenchannelQueueId':_0x3b22c1['id'],'interface':util['format'](_0x40ec('0x60'),_0x40ec('0x61'),_0x34587b[_0x40ec('0x2b')]),'penalty':0x0,'paused':_0x34587b[_0x40ec('0x5d')],'createdAt':_0x34587b[_0x40ec('0x5f')],'updatedAt':_0x34587b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x40ec('0x23')](respondWithFilteredResult(_0x3d22e5,_0x2b5990))[_0x40ec('0x42')](handleError(_0x3d22e5,null));};exports[_0x40ec('0x62')]=function(_0x284f47,_0x135fb5,_0x3b7c0a){var _0xa9e2b7={};var _0x11200e={};var _0x5eb4f3;var _0x29acf2;return db[_0x40ec('0x3d')][_0x40ec('0x54')]({'where':{'id':_0x284f47['params']['id']}})['then'](handleEntityNotFound(_0x135fb5,null))['then'](function(_0x208a1b){if(_0x208a1b){_0x5eb4f3=_0x208a1b;_0x11200e[_0x40ec('0x32')]=_[_0x40ec('0x44')](db[_0x40ec('0x63')][_0x40ec('0x45')]);_0x11200e[_0x40ec('0x2f')]=_[_0x40ec('0x44')](_0x284f47['query']);_0x11200e['filters']=_[_0x40ec('0x31')](_0x11200e[_0x40ec('0x32')],_0x11200e[_0x40ec('0x2f')]);_0xa9e2b7['attributes']=_[_0x40ec('0x31')](_0x11200e['model'],qs[_0x40ec('0x34')](_0x284f47[_0x40ec('0x2f')][_0x40ec('0x34')]));_0xa9e2b7['attributes']=_0xa9e2b7[_0x40ec('0x33')]['length']?_0xa9e2b7[_0x40ec('0x33')]:_0x11200e[_0x40ec('0x32')];_0xa9e2b7[_0x40ec('0x57')]=qs[_0x40ec('0x37')](_0x284f47[_0x40ec('0x2f')][_0x40ec('0x37')]);_0xa9e2b7[_0x40ec('0x38')]=qs[_0x40ec('0x30')](_[_0x40ec('0x39')](_0x284f47[_0x40ec('0x2f')],_0x11200e['filters']));if(_0x284f47[_0x40ec('0x2f')][_0x40ec('0x3a')]){_0xa9e2b7[_0x40ec('0x38')]=_['merge'](_0xa9e2b7['where'],{'$or':_[_0x40ec('0x2d')](_0xa9e2b7['attributes'],function(_0x1a919a){var _0x3c8003={};_0x3c8003[_0x1a919a]={'$like':'%'+_0x284f47['query'][_0x40ec('0x3a')]+'%'};return _0x3c8003;})});}_0xa9e2b7=_[_0x40ec('0x46')]({},_0xa9e2b7,_0x284f47[_0x40ec('0x3c')]);return _0x5eb4f3[_0x40ec('0x62')](_0xa9e2b7);}})[_0x40ec('0x23')](function(_0xa875e9){if(_0xa875e9){_0x29acf2=_0xa875e9['length'];if(!_0x284f47[_0x40ec('0x2f')][_0x40ec('0x36')](_0x40ec('0x56'))){_0xa9e2b7[_0x40ec('0x1e')]=qs['limit'](_0x284f47[_0x40ec('0x2f')]['limit']);_0xa9e2b7[_0x40ec('0x1d')]=qs[_0x40ec('0x1d')](_0x284f47['query'][_0x40ec('0x1d')]);}return _0x5eb4f3['getTeams'](_0xa9e2b7);}})['then'](function(_0xb712a6){if(_0xb712a6){return _0xb712a6?{'count':_0x29acf2,'rows':_0xb712a6}:null;}})[_0x40ec('0x23')](respondWithResult(_0x135fb5,null))[_0x40ec('0x42')](handleError(_0x135fb5,null));};exports['addTeams']=function(_0xf42493,_0x2ea9da,_0x3314d3){var _0x260818=_0xf42493[_0x40ec('0x49')][_0x40ec('0x64')];return db[_0x40ec('0x63')][_0x40ec('0x40')]({'where':{'id':_0x260818},'attributes':['id'],'include':[{'model':db['User'],'as':_0x40ec('0x65'),'attributes':['id',_0x40ec('0x2b'),_0x40ec('0x66'),'voicePause','interface'],'raw':!![]}]})[_0x40ec('0x23')](function(_0x39585c){if(_0x39585c){var _0x588937=_[_0x40ec('0x67')](_0x39585c,function(_0x2bf86e){var _0x491777=_0x2bf86e[_0x40ec('0x25')]({'plain':!![]});return _0x491777['Agents'];});return db[_0x40ec('0x3d')][_0x40ec('0x47')]({'where':{'id':_0xf42493[_0x40ec('0x43')]['id']}})[_0x40ec('0x23')](function(_0xd4258d){return db[_0x40ec('0x68')][_0x40ec('0x69')](function(_0x16ca7d){return _0xd4258d['addTeams'](_0x260818,{'transaction':_0x16ca7d})[_0x40ec('0x23')](function(){return BPromise[_0x40ec('0x6a')](_0x588937,function(_0xd4923){return db[_0x40ec('0x55')][_0x40ec('0x6b')]({'where':{'UserId':_0xd4923['id'],'OpenchannelQueueId':_0xf42493[_0x40ec('0x43')]['id']},'transaction':_0x16ca7d});});})['then'](function(){_0x588937[_0x40ec('0x6c')](function(_0x8b9e62){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x8b9e62['id'],'OpenchannelQueueId':_0xd4258d['id']});});});});});}})[_0x40ec('0x23')](respondWithStatusCode(_0x2ea9da,null))[_0x40ec('0x42')](handleError(_0x2ea9da,null));};exports[_0x40ec('0x6d')]=function(_0x5ac640,_0x19e565,_0x427ff0){return db['Team'][_0x40ec('0x40')]({'where':{'id':_0x5ac640[_0x40ec('0x2f')][_0x40ec('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x40ec('0x65'),'attributes':['id'],'raw':!![]}]})[_0x40ec('0x23')](handleEntityNotFound(_0x19e565,null))[_0x40ec('0x23')](function(_0x376146){var _0x3e8aa7=_[_0x40ec('0x2d')](_0x376146,'id');var _0x544db7=[];var _0x4db500=[];var _0x3fef5a=squel[_0x40ec('0x6e')]();_0x3fef5a[_0x40ec('0x6f')](_0x40ec('0x70'))[_0x40ec('0x71')](_0x40ec('0x72'),'tq')[_0x40ec('0x73')](_0x40ec('0x74'),'ut',_0x40ec('0x75'))[_0x40ec('0x38')](_0x40ec('0x76'),_0x5ac640[_0x40ec('0x43')]['id']);for(var _0x312484=0x0;_0x312484<_0x376146[_0x40ec('0x35')];_0x312484+=0x1){let _0x55b1bc=_0x376146[_0x312484];for(var _0x2f2751=0x0;_0x2f2751<_0x55b1bc[_0x40ec('0x65')]['length'];_0x2f2751+=0x1){let _0x11ae2d=_0x55b1bc[_0x40ec('0x65')][_0x2f2751];var _0x12fad1=_0x3fef5a[_0x40ec('0x77')]();_0x12fad1['where'](_0x40ec('0x78'),_0x11ae2d['id']);_0x4db500[_0x40ec('0x79')](db[_0x40ec('0x68')][_0x40ec('0x2f')](_0x12fad1['toString'](),{'type':db[_0x40ec('0x68')][_0x40ec('0x7a')]['SELECT']})[_0x40ec('0x23')](function(_0x3a1133){if(_0x3a1133[_0x40ec('0x35')]===0x1){return _0x11ae2d['id'];}else{var _0x357d03=_['every'](_['map'](_0x3a1133,_0x40ec('0x7b')),function(_0x50c0e0){return _[_0x40ec('0x7c')](_0x3e8aa7,_0x50c0e0);});if(_0x357d03){return _0x11ae2d['id'];}}}));}}return BPromise[_0x40ec('0x7d')](_0x4db500)[_0x40ec('0x23')](function(_0x458c0e){_0x544db7=_(_0x544db7)['union'](_0x458c0e)[_0x40ec('0x7e')]()['value']();return db['OpenchannelQueue'][_0x40ec('0x47')]({'where':{'id':_0x5ac640[_0x40ec('0x43')]['id']}})[_0x40ec('0x23')](function(_0x4c2208){return db['sequelize'][_0x40ec('0x69')](function(_0x138870){return _0x4c2208[_0x40ec('0x6d')](_0x5ac640[_0x40ec('0x2f')][_0x40ec('0x64')],{'transaction':_0x138870})[_0x40ec('0x23')](function(){if(!_['isEmpty'](_0x544db7)){return _0x4c2208[_0x40ec('0x7f')](_0x544db7,{'transaction':_0x138870});}})[_0x40ec('0x23')](function(){_0x544db7[_0x40ec('0x6c')](function(_0x52e77e){socket[_0x40ec('0x80')](_0x40ec('0x81'),{'UserId':_0x52e77e,'OpenchannelQueueId':_0x4c2208['id']});});});});});});})[_0x40ec('0x23')](respondWithStatusCode(_0x19e565,null))['catch'](handleError(_0x19e565,null));};exports[_0x40ec('0x82')]=function(_0x51fa16,_0x126daa,_0x3ff149){return db[_0x40ec('0x3d')]['find']({'where':{'id':_0x51fa16[_0x40ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x126daa,null))[_0x40ec('0x23')](function(_0x456dca){if(_0x456dca){return _0x456dca[_0x40ec('0x82')](_0x51fa16[_0x40ec('0x49')][_0x40ec('0x64')],_[_0x40ec('0x83')](_0x51fa16[_0x40ec('0x49')],[_0x40ec('0x64'),'id'])||{})[_0x40ec('0x84')](function(_0x5be112){for(var _0x2307eb=0x0;_0x2307eb<_0x51fa16['body'][_0x40ec('0x64')][_0x40ec('0x35')];_0x2307eb+=0x1){socket[_0x40ec('0x80')](_0x40ec('0x85'),{'UserId':_0x51fa16[_0x40ec('0x49')][_0x40ec('0x64')][_0x2307eb],'OpenchannelQueueId':_0x51fa16[_0x40ec('0x43')]['id']});}return _0x5be112;});}})['then'](respondWithResult(_0x126daa,null))['catch'](handleError(_0x126daa,null));};exports['removeAgents']=function(_0x31d003,_0x428c36,_0x223669){return db['OpenchannelQueue']['find']({'where':{'id':_0x31d003[_0x40ec('0x43')]['id']}})[_0x40ec('0x23')](handleEntityNotFound(_0x428c36,null))[_0x40ec('0x23')](function(_0x16a758){if(_0x16a758){return _0x16a758[_0x40ec('0x7f')](_0x31d003[_0x40ec('0x2f')][_0x40ec('0x64')])[_0x40ec('0x23')](function(){if(_['isArray'](_0x31d003[_0x40ec('0x2f')][_0x40ec('0x64')])){for(var _0x383d23=0x0;_0x383d23<_0x31d003[_0x40ec('0x2f')][_0x40ec('0x64')][_0x40ec('0x35')];_0x383d23+=0x1){socket[_0x40ec('0x80')](_0x40ec('0x81'),{'UserId':Number(_0x31d003[_0x40ec('0x2f')][_0x40ec('0x64')][_0x383d23]),'OpenchannelQueueId':Number(_0x31d003[_0x40ec('0x43')]['id'])});}}else{socket[_0x40ec('0x80')](_0x40ec('0x81'),{'UserId':Number(_0x31d003[_0x40ec('0x2f')][_0x40ec('0x64')]),'OpenchannelQueueId':Number(_0x31d003['params']['id'])});}});}})['then'](respondWithStatusCode(_0x428c36,null))[_0x40ec('0x42')](handleError(_0x428c36,null));};exports[_0x40ec('0x86')]=function(_0x13f7a6,_0xc927db,_0x1ded86){var _0x1c96ff={};var _0xa748fd={};var _0x3d04a0;var _0x2a2b34;return db[_0x40ec('0x3d')][_0x40ec('0x54')]({'where':{'id':_0x13f7a6['params']['id']}})[_0x40ec('0x23')](handleEntityNotFound(_0xc927db,null))[_0x40ec('0x23')](function(_0x574578){if(_0x574578){_0x3d04a0=_0x574578;_0xa748fd[_0x40ec('0x32')]=_['keys'](db[_0x40ec('0x59')][_0x40ec('0x45')]);_0xa748fd['query']=_[_0x40ec('0x44')](_0x13f7a6[_0x40ec('0x2f')]);_0xa748fd[_0x40ec('0x30')]=_['intersection'](_0xa748fd[_0x40ec('0x32')],_0xa748fd[_0x40ec('0x2f')]);_0x1c96ff['attributes']=_[_0x40ec('0x31')](_0xa748fd[_0x40ec('0x32')],qs[_0x40ec('0x34')](_0x13f7a6['query']['fields']));_0x1c96ff['attributes']=_0x1c96ff[_0x40ec('0x33')][_0x40ec('0x35')]?_0x1c96ff[_0x40ec('0x33')]:_0xa748fd['model'];_0x1c96ff[_0x40ec('0x57')]=qs[_0x40ec('0x37')](_0x13f7a6[_0x40ec('0x2f')]['sort']);_0x1c96ff[_0x40ec('0x38')]=qs[_0x40ec('0x30')](_[_0x40ec('0x39')](_0x13f7a6[_0x40ec('0x2f')],_0xa748fd[_0x40ec('0x30')]));if(_0x13f7a6[_0x40ec('0x2f')][_0x40ec('0x3a')]){_0x1c96ff[_0x40ec('0x38')]=_['merge'](_0x1c96ff[_0x40ec('0x38')],{'$or':_[_0x40ec('0x2d')](_0x1c96ff['attributes'],function(_0x1b27df){var _0x5709d0={};_0x5709d0[_0x1b27df]={'$like':'%'+_0x13f7a6[_0x40ec('0x2f')][_0x40ec('0x3a')]+'%'};return _0x5709d0;})});}_0x1c96ff=_[_0x40ec('0x46')]({},_0x1c96ff,_0x13f7a6[_0x40ec('0x3c')]);return _0x3d04a0[_0x40ec('0x86')](_0x1c96ff);}})['then'](function(_0x3299a7){if(_0x3299a7){_0x2a2b34=_0x3299a7[_0x40ec('0x35')];if(!_0x13f7a6['query']['hasOwnProperty'](_0x40ec('0x56'))){_0x1c96ff[_0x40ec('0x1e')]=qs[_0x40ec('0x1e')](_0x13f7a6['query'][_0x40ec('0x1e')]);_0x1c96ff[_0x40ec('0x1d')]=qs['offset'](_0x13f7a6[_0x40ec('0x2f')][_0x40ec('0x1d')]);}return _0x3d04a0['getAgents'](_0x1c96ff);}})['then'](function(_0x2ff8a3){if(_0x2ff8a3){return _0x2ff8a3?{'count':_0x2a2b34,'rows':_0x2ff8a3}:null;}})['then'](respondWithResult(_0xc927db,null))[_0x40ec('0x42')](handleError(_0xc927db,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js
index c3ab9e8..0f3167a 100644
--- a/server/api/openchannelQueue/openchannelQueue.events.js
+++ b/server/api/openchannelQueue/openchannelQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x043e=['hook','exports','events','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3072f9,_0x547768){var _0x14d2df=function(_0x51984c){while(--_0x51984c){_0x3072f9['push'](_0x3072f9['shift']());}};_0x14d2df(++_0x547768);}(_0x043e,0x1b0));var _0xe043=function(_0x538025,_0x4c466b){_0x538025=_0x538025-0x0;var _0x5abffc=_0x043e[_0x538025];return _0x5abffc;};'use strict';var EventEmitter=require(_0xe043('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xe043('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xe043('0x2')](0x0);var events={'afterCreate':_0xe043('0x3'),'afterUpdate':_0xe043('0x4'),'afterDestroy':_0xe043('0x5')};function emitEvent(_0x26633a){return function(_0x5c710a,_0x53d332,_0x50a6ed){OpenchannelQueueEvents[_0xe043('0x6')](_0x26633a+':'+_0x5c710a['id'],_0x5c710a);OpenchannelQueueEvents[_0xe043('0x6')](_0x26633a,_0x5c710a);_0x50a6ed(null);};}for(var e in events){if(events[_0xe043('0x7')](e)){var event=events[e];OpenchannelQueue[_0xe043('0x8')](e,emitEvent(event));}}module[_0xe043('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x165c=['setMaxListeners','save','update','emit','hook','OpenchannelQueue'];(function(_0x2bbb51,_0x5504f6){var _0x4c7613=function(_0x3ef042){while(--_0x3ef042){_0x2bbb51['push'](_0x2bbb51['shift']());}};_0x4c7613(++_0x5504f6);}(_0x165c,0x125));var _0xc165=function(_0x3dde19,_0xb66635){_0x3dde19=_0x3dde19-0x0;var _0x5090f1=_0x165c[_0x3dde19];return _0x5090f1;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0xc165('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc165('0x1')](0x0);var events={'afterCreate':_0xc165('0x2'),'afterUpdate':_0xc165('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2856df){return function(_0x52865c,_0x287220,_0xb3376f){OpenchannelQueueEvents[_0xc165('0x4')](_0x2856df+':'+_0x52865c['id'],_0x52865c);OpenchannelQueueEvents[_0xc165('0x4')](_0x2856df,_0x52865c);_0xb3376f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xc165('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js
index e892fe8..542c0ca 100644
--- a/server/api/openchannelQueue/openchannelQueue.model.js
+++ b/server/api/openchannelQueue/openchannelQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15f6=['bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment'];(function(_0xf8b747,_0x10e2c4){var _0x2ff996=function(_0x80fd12){while(--_0x80fd12){_0xf8b747['push'](_0xf8b747['shift']());}};_0x2ff996(++_0x10e2c4);}(_0x15f6,0x1d7));var _0x615f=function(_0x52930a,_0x50c6c0){_0x52930a=_0x52930a-0x0;var _0x2719be=_0x15f6[_0x52930a];return _0x2719be;};'use strict';var _=require(_0x615f('0x0'));var util=require(_0x615f('0x1'));var logger=require(_0x615f('0x2'))(_0x615f('0x3'));var moment=require(_0x615f('0x4'));var BPromise=require(_0x615f('0x5'));var rp=require(_0x615f('0x6'));var fs=require('fs');var path=require(_0x615f('0x7'));var rimraf=require(_0x615f('0x8'));var config=require('../../config/environment');var attributes=require(_0x615f('0x9'));module[_0x615f('0xa')]=function(_0x5a699b,_0x980ad1){return _0x5a699b[_0x615f('0xb')](_0x615f('0xc'),attributes,{'tableName':_0x615f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f06=['lodash','util','../../config/logger','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues'];(function(_0x1c5f4a,_0x307808){var _0x2eee6a=function(_0x55b9ab){while(--_0x55b9ab){_0x1c5f4a['push'](_0x1c5f4a['shift']());}};_0x2eee6a(++_0x307808);}(_0x8f06,0x17c));var _0x68f0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8f06[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x68f0('0x0'));var util=require(_0x68f0('0x1'));var logger=require(_0x68f0('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x68f0('0x3'));var fs=require('fs');var path=require(_0x68f0('0x4'));var rimraf=require('rimraf');var config=require(_0x68f0('0x5'));var attributes=require(_0x68f0('0x6'));module[_0x68f0('0x7')]=function(_0x166e83,_0x217873){return _0x166e83[_0x68f0('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x68f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js
index 0407086..b045bbc 100644
--- a/server/api/openchannelQueue/openchannelQueue.rpc.js
+++ b/server/api/openchannelQueue/openchannelQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd225=['ShowOpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','find'];(function(_0x4be650,_0x290115){var _0x4650d1=function(_0x3cd833){while(--_0x3cd833){_0x4be650['push'](_0x4be650['shift']());}};_0x4650d1(++_0x290115);}(_0xd225,0xfd));var _0x5d22=function(_0x19b2e5,_0x3b833b){_0x19b2e5=_0x19b2e5-0x0;var _0x27c139=_0xd225[_0x19b2e5];return _0x27c139;};'use strict';var _=require(_0x5d22('0x0'));var util=require(_0x5d22('0x1'));var moment=require(_0x5d22('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d22('0x3'));var fs=require('fs');var Redis=require(_0x5d22('0x4'));var db=require(_0x5d22('0x5'))['db'];var utils=require(_0x5d22('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5d22('0x7'));var jayson=require(_0x5d22('0x8'));var client=jayson[_0x5d22('0x9')][_0x5d22('0xa')]({'port':0x232a});config['redis']=_[_0x5d22('0xb')](config[_0x5d22('0xc')],{'host':_0x5d22('0xd'),'port':0x18eb});var socket=require(_0x5d22('0xe'))(new Redis(config['redis']));require(_0x5d22('0xf'))[_0x5d22('0x10')](socket);function respondWithRpcPromise(_0x65d957,_0x4067ab,_0xd9edae){return new BPromise(function(_0x56b97c,_0x28d67c){return client[_0x5d22('0x11')](_0x65d957,_0xd9edae)[_0x5d22('0x12')](function(_0x4056d9){logger['info'](_0x5d22('0x13'),_0x4067ab,_0x5d22('0x14'));logger[_0x5d22('0x15')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4067ab,'request\x20sent',JSON['stringify'](_0x4056d9));if(_0x4056d9[_0x5d22('0x16')]){if(_0x4056d9['error'][_0x5d22('0x17')]===0x1f4){logger[_0x5d22('0x16')](_0x5d22('0x13'),_0x4067ab,_0x4056d9['error']['message']);return _0x28d67c(_0x4056d9[_0x5d22('0x16')]['message']);}logger['error'](_0x5d22('0x13'),_0x4067ab,_0x4056d9[_0x5d22('0x16')][_0x5d22('0x18')]);return _0x56b97c(_0x4056d9[_0x5d22('0x16')][_0x5d22('0x18')]);}else{logger[_0x5d22('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0x4067ab,_0x5d22('0x14'));_0x56b97c(_0x4056d9[_0x5d22('0x1a')][_0x5d22('0x18')]);}})[_0x5d22('0x1b')](function(_0x1c9202){logger[_0x5d22('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x4067ab,_0x1c9202);_0x28d67c(_0x1c9202);});});}exports[_0x5d22('0x1c')]=function(_0x10b8f5){var _0x4da4ec=this;return new Promise(function(_0x359f0b,_0x8f0b8c){return db[_0x5d22('0x1d')][_0x5d22('0x1e')]({'raw':_0x10b8f5[_0x5d22('0x1f')]?_0x10b8f5[_0x5d22('0x1f')][_0x5d22('0x20')]===undefined?!![]:![]:!![],'where':_0x10b8f5['options']?_0x10b8f5['options'][_0x5d22('0x21')]||null:null,'attributes':_0x10b8f5['options']?_0x10b8f5[_0x5d22('0x1f')][_0x5d22('0x22')]||null:null,'limit':_0x10b8f5['options']?_0x10b8f5[_0x5d22('0x1f')][_0x5d22('0x23')]||null:null,'include':_0x10b8f5[_0x5d22('0x1f')]?_0x10b8f5[_0x5d22('0x1f')]['include']?_['map'](_0x10b8f5[_0x5d22('0x1f')][_0x5d22('0x24')],function(_0x52e54c){return{'model':db[_0x52e54c['model']],'as':_0x52e54c['as'],'attributes':_0x52e54c[_0x5d22('0x22')],'include':_0x52e54c['include']?_[_0x5d22('0x25')](_0x52e54c['include'],function(_0x6eefaa){return{'model':db[_0x6eefaa[_0x5d22('0x26')]],'as':_0x6eefaa['as'],'attributes':_0x6eefaa[_0x5d22('0x22')],'include':_0x6eefaa[_0x5d22('0x24')]?_[_0x5d22('0x25')](_0x6eefaa[_0x5d22('0x24')],function(_0x2baf70){return{'model':db[_0x2baf70['model']],'as':_0x2baf70['as'],'attributes':_0x2baf70[_0x5d22('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5d22('0x12')](function(_0x2e0962){logger[_0x5d22('0x19')](_0x5d22('0x1c'),_0x10b8f5);logger[_0x5d22('0x15')](_0x5d22('0x1c'),_0x10b8f5,JSON[_0x5d22('0x27')](_0x2e0962));_0x359f0b(_0x2e0962);})[_0x5d22('0x1b')](function(_0x3e3a58){logger[_0x5d22('0x16')](_0x5d22('0x1c'),_0x3e3a58[_0x5d22('0x18')],_0x10b8f5);_0x8f0b8c(_0x4da4ec['error'](0x1f4,_0x3e3a58[_0x5d22('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x30bdae){var _0x157330=this;return new Promise(function(_0x4a4fba,_0x568524){return db[_0x5d22('0x1d')][_0x5d22('0x28')]({'raw':_0x30bdae['options']?_0x30bdae[_0x5d22('0x1f')][_0x5d22('0x20')]===undefined?!![]:![]:!![],'where':_0x30bdae['options']?_0x30bdae[_0x5d22('0x1f')]['where']||null:null,'attributes':_0x30bdae[_0x5d22('0x1f')]?_0x30bdae['options'][_0x5d22('0x22')]||null:null,'include':_0x30bdae[_0x5d22('0x1f')]?_0x30bdae[_0x5d22('0x1f')][_0x5d22('0x24')]?_[_0x5d22('0x25')](_0x30bdae['options'][_0x5d22('0x24')],function(_0x3992ca){return{'model':db[_0x3992ca[_0x5d22('0x26')]],'as':_0x3992ca['as'],'attributes':_0x3992ca[_0x5d22('0x22')],'include':_0x3992ca[_0x5d22('0x24')]?_[_0x5d22('0x25')](_0x3992ca['include'],function(_0x5322e4){return{'model':db[_0x5322e4[_0x5d22('0x26')]],'as':_0x5322e4['as'],'attributes':_0x5322e4['attributes'],'include':_0x5322e4[_0x5d22('0x24')]?_[_0x5d22('0x25')](_0x5322e4[_0x5d22('0x24')],function(_0x5cc171){return{'model':db[_0x5cc171['model']],'as':_0x5cc171['as'],'attributes':_0x5cc171[_0x5d22('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5d22('0x12')](function(_0x14bba6){logger[_0x5d22('0x19')](_0x5d22('0x29'),_0x30bdae);logger['debug'](_0x5d22('0x29'),_0x30bdae,JSON[_0x5d22('0x27')](_0x14bba6));_0x4a4fba(_0x14bba6);})['catch'](function(_0x3ff981){logger[_0x5d22('0x16')](_0x5d22('0x29'),_0x3ff981[_0x5d22('0x18')],_0x30bdae);_0x568524(_0x157330[_0x5d22('0x16')](0x1f4,_0x3ff981['message']));});});};
\ No newline at end of file
+var _0x2e46=['error','message','result','catch','OpenchannelQueue','findAll','options','raw','limit','include','model','attributes','map','then','GetOpenchannelQueue','where','ShowOpenchannelQueue','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x153119,_0x2d8076){var _0xd753d=function(_0x71fa61){while(--_0x71fa61){_0x153119['push'](_0x153119['shift']());}};_0xd753d(++_0x2d8076);}(_0x2e46,0xa1));var _0x62e4=function(_0x2a5fae,_0x2da03f){_0x2a5fae=_0x2a5fae-0x0;var _0x1325bf=_0x2e46[_0x2a5fae];return _0x1325bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x62e4('0x0'));var rs=require(_0x62e4('0x1'));var fs=require('fs');var Redis=require(_0x62e4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x62e4('0x3'));var logger=require(_0x62e4('0x4'))(_0x62e4('0x5'));var config=require(_0x62e4('0x6'));var jayson=require(_0x62e4('0x7'));var client=jayson['client'][_0x62e4('0x8')]({'port':0x232a});config[_0x62e4('0x9')]=_[_0x62e4('0xa')](config[_0x62e4('0x9')],{'host':_0x62e4('0xb'),'port':0x18eb});var socket=require(_0x62e4('0xc'))(new Redis(config['redis']));require(_0x62e4('0xd'))[_0x62e4('0xe')](socket);function respondWithRpcPromise(_0x5e6c8f,_0x3f7c80,_0x24c493){return new BPromise(function(_0x2024b4,_0x2a8f9f){return client['request'](_0x5e6c8f,_0x24c493)['then'](function(_0x1b6cc6){logger[_0x62e4('0xf')](_0x62e4('0x10'),_0x3f7c80,_0x62e4('0x11'));logger[_0x62e4('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x3f7c80,_0x62e4('0x11'),JSON['stringify'](_0x1b6cc6));if(_0x1b6cc6[_0x62e4('0x13')]){if(_0x1b6cc6[_0x62e4('0x13')]['code']===0x1f4){logger[_0x62e4('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x3f7c80,_0x1b6cc6[_0x62e4('0x13')][_0x62e4('0x14')]);return _0x2a8f9f(_0x1b6cc6[_0x62e4('0x13')][_0x62e4('0x14')]);}logger[_0x62e4('0x13')](_0x62e4('0x10'),_0x3f7c80,_0x1b6cc6[_0x62e4('0x13')][_0x62e4('0x14')]);return _0x2024b4(_0x1b6cc6[_0x62e4('0x13')]['message']);}else{logger['info'](_0x62e4('0x10'),_0x3f7c80,'request\x20sent');_0x2024b4(_0x1b6cc6[_0x62e4('0x15')][_0x62e4('0x14')]);}})[_0x62e4('0x16')](function(_0x280c9e){logger[_0x62e4('0x13')](_0x62e4('0x10'),_0x3f7c80,_0x280c9e);_0x2a8f9f(_0x280c9e);});});}exports['GetOpenchannelQueue']=function(_0x5e6aed){var _0x52d632=this;return new Promise(function(_0x4a0784,_0x441927){return db[_0x62e4('0x17')][_0x62e4('0x18')]({'raw':_0x5e6aed[_0x62e4('0x19')]?_0x5e6aed[_0x62e4('0x19')][_0x62e4('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e6aed[_0x62e4('0x19')]?_0x5e6aed['options']['where']||null:null,'attributes':_0x5e6aed['options']?_0x5e6aed['options']['attributes']||null:null,'limit':_0x5e6aed[_0x62e4('0x19')]?_0x5e6aed[_0x62e4('0x19')][_0x62e4('0x1b')]||null:null,'include':_0x5e6aed['options']?_0x5e6aed[_0x62e4('0x19')][_0x62e4('0x1c')]?_['map'](_0x5e6aed[_0x62e4('0x19')][_0x62e4('0x1c')],function(_0x31dbda){return{'model':db[_0x31dbda[_0x62e4('0x1d')]],'as':_0x31dbda['as'],'attributes':_0x31dbda[_0x62e4('0x1e')],'include':_0x31dbda[_0x62e4('0x1c')]?_[_0x62e4('0x1f')](_0x31dbda[_0x62e4('0x1c')],function(_0x4a4521){return{'model':db[_0x4a4521[_0x62e4('0x1d')]],'as':_0x4a4521['as'],'attributes':_0x4a4521[_0x62e4('0x1e')],'include':_0x4a4521[_0x62e4('0x1c')]?_[_0x62e4('0x1f')](_0x4a4521['include'],function(_0x2ba18f){return{'model':db[_0x2ba18f[_0x62e4('0x1d')]],'as':_0x2ba18f['as'],'attributes':_0x2ba18f[_0x62e4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x62e4('0x20')](function(_0x2869c0){logger[_0x62e4('0xf')]('GetOpenchannelQueue',_0x5e6aed);logger['debug'](_0x62e4('0x21'),_0x5e6aed,JSON['stringify'](_0x2869c0));_0x4a0784(_0x2869c0);})['catch'](function(_0x17764d){logger[_0x62e4('0x13')](_0x62e4('0x21'),_0x17764d[_0x62e4('0x14')],_0x5e6aed);_0x441927(_0x52d632[_0x62e4('0x13')](0x1f4,_0x17764d['message']));});});};exports['ShowOpenchannelQueue']=function(_0x551a31){var _0x20aeac=this;return new Promise(function(_0x6c00e7,_0x4d397b){return db[_0x62e4('0x17')]['find']({'raw':_0x551a31[_0x62e4('0x19')]?_0x551a31['options']['raw']===undefined?!![]:![]:!![],'where':_0x551a31['options']?_0x551a31[_0x62e4('0x19')][_0x62e4('0x22')]||null:null,'attributes':_0x551a31['options']?_0x551a31[_0x62e4('0x19')][_0x62e4('0x1e')]||null:null,'include':_0x551a31[_0x62e4('0x19')]?_0x551a31[_0x62e4('0x19')]['include']?_[_0x62e4('0x1f')](_0x551a31[_0x62e4('0x19')][_0x62e4('0x1c')],function(_0x388b15){return{'model':db[_0x388b15[_0x62e4('0x1d')]],'as':_0x388b15['as'],'attributes':_0x388b15[_0x62e4('0x1e')],'include':_0x388b15['include']?_[_0x62e4('0x1f')](_0x388b15[_0x62e4('0x1c')],function(_0x36d97c){return{'model':db[_0x36d97c['model']],'as':_0x36d97c['as'],'attributes':_0x36d97c[_0x62e4('0x1e')],'include':_0x36d97c[_0x62e4('0x1c')]?_[_0x62e4('0x1f')](_0x36d97c[_0x62e4('0x1c')],function(_0xe52e){return{'model':db[_0xe52e[_0x62e4('0x1d')]],'as':_0xe52e['as'],'attributes':_0xe52e[_0x62e4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x62e4('0x20')](function(_0x20f219){logger[_0x62e4('0xf')](_0x62e4('0x23'),_0x551a31);logger[_0x62e4('0x12')](_0x62e4('0x23'),_0x551a31,JSON['stringify'](_0x20f219));_0x6c00e7(_0x20f219);})['catch'](function(_0x3a39d9){logger[_0x62e4('0x13')]('ShowOpenchannelQueue',_0x3a39d9[_0x62e4('0x14')],_0x551a31);_0x4d397b(_0x20aeac['error'](0x1f4,_0x3a39d9[_0x62e4('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js
index e41f626..2b20254 100644
--- a/server/api/openchannelQueue/openchannelQueue.socket.js
+++ b/server/api/openchannelQueue/openchannelQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1d52=['length','openchannelQueue:','remove','update','emit','removeListener','register'];(function(_0x14682d,_0x375996){var _0x5b2046=function(_0x3792bb){while(--_0x3792bb){_0x14682d['push'](_0x14682d['shift']());}};_0x5b2046(++_0x375996);}(_0x1d52,0x19f));var _0x21d5=function(_0x1c31ec,_0x2347dc){_0x1c31ec=_0x1c31ec-0x0;var _0x53d08c=_0x1d52[_0x1c31ec];return _0x53d08c;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x21d5('0x0'),_0x21d5('0x1')];function createListener(_0xa6a9ac,_0x5b8a46){return function(_0x5abed5){_0x5b8a46[_0x21d5('0x2')](_0xa6a9ac,_0x5abed5);};}function removeListener(_0x59b9b6,_0x438542){return function(){OpenchannelQueueEvents[_0x21d5('0x3')](_0x59b9b6,_0x438542);};}exports[_0x21d5('0x4')]=function(_0x4ce3b8){for(var _0x53bd18=0x0,_0x10cbb8=events[_0x21d5('0x5')];_0x53bd18<_0x10cbb8;_0x53bd18++){var _0x25db48=events[_0x53bd18];var _0x5d4aaf=createListener(_0x21d5('0x6')+_0x25db48,_0x4ce3b8);OpenchannelQueueEvents['on'](_0x25db48,_0x5d4aaf);}};
\ No newline at end of file
+var _0xa38c=['removeListener','register','length','./openchannelQueue.events','save','remove','update','emit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa38c,0x1eb));var _0xca38=function(_0x1e41a1,_0x19990f){_0x1e41a1=_0x1e41a1-0x0;var _0x20f948=_0xa38c[_0x1e41a1];return _0x20f948;};'use strict';var OpenchannelQueueEvents=require(_0xca38('0x0'));var events=[_0xca38('0x1'),_0xca38('0x2'),_0xca38('0x3')];function createListener(_0xa7c277,_0x206011){return function(_0x44ba14){_0x206011[_0xca38('0x4')](_0xa7c277,_0x44ba14);};}function removeListener(_0xbd88d,_0x1104d4){return function(){OpenchannelQueueEvents[_0xca38('0x5')](_0xbd88d,_0x1104d4);};}exports[_0xca38('0x6')]=function(_0x564b52){for(var _0x47e83a=0x0,_0x1cffe7=events[_0xca38('0x7')];_0x47e83a<_0x1cffe7;_0x47e83a++){var _0x55054e=events[_0x47e83a];var _0x2a8c49=createListener('openchannelQueue:'+_0x55054e,_0x564b52);OpenchannelQueueEvents['on'](_0x55054e,_0x2a8c49);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js
index 41486f5..5206fd6 100644
--- a/server/api/openchannelQueueReport/index.js
+++ b/server/api/openchannelQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3539=['get','index','/describe','describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3da1f1,_0x209d10){var _0x394a66=function(_0x21c897){while(--_0x21c897){_0x3da1f1['push'](_0x3da1f1['shift']());}};_0x394a66(++_0x209d10);}(_0x3539,0x92));var _0x9353=function(_0x59ca39,_0x20ad2e){_0x59ca39=_0x59ca39-0x0;var _0x504c64=_0x3539[_0x59ca39];return _0x504c64;};'use strict';var multer=require(_0x9353('0x0'));var util=require(_0x9353('0x1'));var path=require('path');var timeout=require(_0x9353('0x2'));var express=require(_0x9353('0x3'));var router=express[_0x9353('0x4')]();var auth=require(_0x9353('0x5'));var interaction=require(_0x9353('0x6'));var config=require(_0x9353('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0x9353('0x8')]('/',auth['isAuthenticated'](),controller[_0x9353('0x9')]);router[_0x9353('0x8')](_0x9353('0xa'),auth['isAuthenticated'](),controller[_0x9353('0xb')]);router[_0x9353('0x8')]('/:id',auth[_0x9353('0xc')](),controller[_0x9353('0xd')]);router[_0x9353('0xe')]('/',auth['isAuthenticated'](),controller[_0x9353('0xf')]);router[_0x9353('0x10')](_0x9353('0x11'),auth[_0x9353('0xc')](),controller[_0x9353('0x12')]);router[_0x9353('0x13')](_0x9353('0x11'),auth[_0x9353('0xc')](),controller[_0x9353('0x14')]);module[_0x9353('0x15')]=router;
\ No newline at end of file
+var _0xbf8b=['../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2cb7fc,_0xa6dfde){var _0x1e24b9=function(_0x56215c){while(--_0x56215c){_0x2cb7fc['push'](_0x2cb7fc['shift']());}};_0x1e24b9(++_0xa6dfde);}(_0xbf8b,0xec));var _0xbbf8=function(_0x561820,_0x2379c8){_0x561820=_0x561820-0x0;var _0x20d88f=_0xbf8b[_0x561820];return _0x20d88f;};'use strict';var multer=require(_0xbbf8('0x0'));var util=require('util');var path=require(_0xbbf8('0x1'));var timeout=require(_0xbbf8('0x2'));var express=require(_0xbbf8('0x3'));var router=express[_0xbbf8('0x4')]();var auth=require(_0xbbf8('0x5'));var interaction=require(_0xbbf8('0x6'));var config=require(_0xbbf8('0x7'));var controller=require(_0xbbf8('0x8'));router[_0xbbf8('0x9')]('/',auth[_0xbbf8('0xa')](),controller[_0xbbf8('0xb')]);router[_0xbbf8('0x9')](_0xbbf8('0xc'),auth[_0xbbf8('0xa')](),controller[_0xbbf8('0xd')]);router[_0xbbf8('0x9')](_0xbbf8('0xe'),auth[_0xbbf8('0xa')](),controller[_0xbbf8('0xf')]);router[_0xbbf8('0x10')]('/',auth['isAuthenticated'](),controller[_0xbbf8('0x11')]);router['put'](_0xbbf8('0xe'),auth[_0xbbf8('0xa')](),controller[_0xbbf8('0x12')]);router[_0xbbf8('0x13')](_0xbbf8('0xe'),auth[_0xbbf8('0xa')](),controller[_0xbbf8('0x14')]);module[_0xbbf8('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
index c53e93c..2e37e60 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x67da=['DATE','STRING'];(function(_0x59a096,_0x4a7af7){var _0x5dee72=function(_0x55fa57){while(--_0x55fa57){_0x59a096['push'](_0x59a096['shift']());}};_0x5dee72(++_0x4a7af7);}(_0x67da,0x109));var _0xa67d=function(_0x1edb37,_0x3af3bc){_0x1edb37=_0x1edb37-0x0;var _0x59139e=_0x67da[_0x1edb37];return _0x59139e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa67d('0x0')]},'joinAt':{'type':Sequelize[_0xa67d('0x1')]},'leaveAt':{'type':Sequelize[_0xa67d('0x1')]},'acceptAt':{'type':Sequelize[_0xa67d('0x1')]},'exitAt':{'type':Sequelize[_0xa67d('0x1')]},'reason':{'type':Sequelize[_0xa67d('0x0')]}};
\ No newline at end of file
+var _0xd531=['STRING','DATE','moment','sequelize'];(function(_0x37b2ce,_0x5a6096){var _0x18e96a=function(_0x12282f){while(--_0x12282f){_0x37b2ce['push'](_0x37b2ce['shift']());}};_0x18e96a(++_0x5a6096);}(_0xd531,0x15a));var _0x1d53=function(_0x2fe51c,_0x5d55b5){_0x2fe51c=_0x2fe51c-0x0;var _0x1ddf0f=_0xd531[_0x2fe51c];return _0x1ddf0f;};'use strict';var moment=require(_0x1d53('0x0'));var Sequelize=require(_0x1d53('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1d53('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1d53('0x2')]},'joinAt':{'type':Sequelize[_0x1d53('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1d53('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
index 1be884e..1554567 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa017=['../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','keys','rawAttributes','length','catch','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xa017,0x1f1));var _0x7a01=function(_0x1554e2,_0x4efeec){_0x1554e2=_0x1554e2-0x0;var _0x51aa70=_0xa017[_0x1554e2];return _0x51aa70;};'use strict';var pdf=require(_0x7a01('0x0'));var emlformat=require(_0x7a01('0x1'));var rimraf=require(_0x7a01('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7a01('0x3'));var moment=require(_0x7a01('0x4'));var BPromise=require(_0x7a01('0x5'));var Mustache=require(_0x7a01('0x6'));var util=require(_0x7a01('0x7'));var path=require(_0x7a01('0x8'));var sox=require(_0x7a01('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7a01('0xa'));var squel=require(_0x7a01('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7a01('0xc'));var querystring=require('querystring');var Papa=require(_0x7a01('0xd'));var Redis=require(_0x7a01('0xe'));var authService=require(_0x7a01('0xf'));var qs=require(_0x7a01('0x10'));var as=require(_0x7a01('0x11'));var hardwareService=require(_0x7a01('0x12'));var logger=require(_0x7a01('0x13'))('api');var utils=require(_0x7a01('0x14'));var config=require('../../config/environment');var db=require(_0x7a01('0x15'))['db'];function respondWithStatusCode(_0x3821cd,_0x1fd634){_0x1fd634=_0x1fd634||0xcc;return function(_0x4e7728){if(_0x4e7728){return _0x3821cd[_0x7a01('0x16')](_0x1fd634);}return _0x3821cd[_0x7a01('0x17')](_0x1fd634)[_0x7a01('0x18')]();};}function respondWithResult(_0x505d46,_0x2781d6){_0x2781d6=_0x2781d6||0xc8;return function(_0xb68cd6){if(_0xb68cd6){return _0x505d46[_0x7a01('0x17')](_0x2781d6)[_0x7a01('0x19')](_0xb68cd6);}};}function respondWithFilteredResult(_0x460ce1,_0x177375){return function(_0x4416ab){if(_0x4416ab){var _0x26c0b2=_0x4416ab[_0x7a01('0x1a')],_0x558d65=_0x177375['offset'],_0x544248=_0x177375[_0x7a01('0x1b')]+_0x177375[_0x7a01('0x1c')],_0x5089df;if(_0x544248>=_0x26c0b2){_0x544248=_0x26c0b2;_0x5089df=0xc8;}else{_0x5089df=0xce;}_0x460ce1[_0x7a01('0x17')](_0x5089df);return _0x460ce1['set'](_0x7a01('0x1d'),_0x558d65+'-'+_0x544248+'/'+_0x26c0b2)[_0x7a01('0x19')](_0x4416ab);}return null;};}function patchUpdates(_0x1f013c){return function(_0x51cec3){try{jsonpatch[_0x7a01('0x1e')](_0x51cec3,_0x1f013c,!![]);}catch(_0x43ce2e){return BPromise[_0x7a01('0x1f')](_0x43ce2e);}return _0x51cec3[_0x7a01('0x20')]();};}function saveUpdates(_0x16238f,_0xba4c92){return function(_0x21571f){if(_0x21571f){return _0x21571f[_0x7a01('0x21')](_0x16238f)[_0x7a01('0x22')](function(_0x1fb08a){return _0x1fb08a;});}return null;};}function removeEntity(_0x9d2609,_0x2f1177){return function(_0x404cc1){if(_0x404cc1){return _0x404cc1[_0x7a01('0x23')]()[_0x7a01('0x22')](function(){_0x9d2609[_0x7a01('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2005bf,_0x5f04bd){return function(_0xb60cb2){if(!_0xb60cb2){_0x2005bf[_0x7a01('0x16')](0x194);}return _0xb60cb2;};}function handleError(_0x391526,_0x436087){_0x436087=_0x436087||0x1f4;return function(_0x5732f8){logger[_0x7a01('0x24')](_0x5732f8[_0x7a01('0x25')]);if(_0x5732f8[_0x7a01('0x26')]){delete _0x5732f8[_0x7a01('0x26')];}_0x391526[_0x7a01('0x17')](_0x436087)[_0x7a01('0x27')](_0x5732f8);};}exports[_0x7a01('0x28')]=function(_0x10d857,_0x2f519f){var _0x5cfb78={},_0x4d5374={},_0xb90835={'count':0x0,'rows':[]};var _0x27f09b=_[_0x7a01('0x29')](db[_0x7a01('0x2a')]['rawAttributes'],function(_0xb219a3){return{'name':_0xb219a3[_0x7a01('0x2b')],'type':_0xb219a3[_0x7a01('0x2c')][_0x7a01('0x2d')]};});_0x4d5374[_0x7a01('0x2e')]=_[_0x7a01('0x29')](_0x27f09b,'name');_0x4d5374[_0x7a01('0x2f')]=_['keys'](_0x10d857[_0x7a01('0x2f')]);_0x4d5374['filters']=_[_0x7a01('0x30')](_0x4d5374['model'],_0x4d5374[_0x7a01('0x2f')]);_0x5cfb78['attributes']=_[_0x7a01('0x30')](_0x4d5374['model'],qs['fields'](_0x10d857[_0x7a01('0x2f')][_0x7a01('0x31')]));_0x5cfb78[_0x7a01('0x32')]=_0x5cfb78[_0x7a01('0x32')]['length']?_0x5cfb78[_0x7a01('0x32')]:_0x4d5374[_0x7a01('0x2e')];if(!_0x10d857[_0x7a01('0x2f')][_0x7a01('0x33')](_0x7a01('0x34'))){_0x5cfb78[_0x7a01('0x1c')]=qs[_0x7a01('0x1c')](_0x10d857[_0x7a01('0x2f')][_0x7a01('0x1c')]);_0x5cfb78[_0x7a01('0x1b')]=qs[_0x7a01('0x1b')](_0x10d857[_0x7a01('0x2f')]['offset']);}_0x5cfb78[_0x7a01('0x35')]=qs[_0x7a01('0x36')](_0x10d857[_0x7a01('0x2f')][_0x7a01('0x36')]);_0x5cfb78[_0x7a01('0x37')]=qs['filters'](_[_0x7a01('0x38')](_0x10d857[_0x7a01('0x2f')],_0x4d5374[_0x7a01('0x39')]),_0x27f09b);if(_0x10d857[_0x7a01('0x2f')][_0x7a01('0x3a')]){_0x5cfb78[_0x7a01('0x37')]=_[_0x7a01('0x3b')](_0x5cfb78[_0x7a01('0x37')],{'$or':_['map'](_0x27f09b,function(_0x3afbbe){if(_0x3afbbe['type']!==_0x7a01('0x3c')){var _0x308ca4={};_0x308ca4[_0x3afbbe['name']]={'$like':'%'+_0x10d857[_0x7a01('0x2f')][_0x7a01('0x3a')]+'%'};return _0x308ca4;}})});}_0x5cfb78=_['merge']({},_0x5cfb78,_0x10d857[_0x7a01('0x3d')]);var _0x46b9ef={'where':_0x5cfb78[_0x7a01('0x37')]};return db[_0x7a01('0x2a')][_0x7a01('0x1a')](_0x46b9ef)[_0x7a01('0x22')](function(_0x109f9e){_0xb90835['count']=_0x109f9e;if(_0x10d857[_0x7a01('0x2f')][_0x7a01('0x3e')]){_0x5cfb78[_0x7a01('0x3f')]=[{'all':!![]}];}return db[_0x7a01('0x2a')][_0x7a01('0x40')](_0x5cfb78);})[_0x7a01('0x22')](function(_0x535df9){_0xb90835[_0x7a01('0x41')]=_0x535df9;return _0xb90835;})[_0x7a01('0x22')](respondWithFilteredResult(_0x2f519f,_0x5cfb78))['catch'](handleError(_0x2f519f,null));};exports['show']=function(_0x52cf9a,_0x1aedd5){var _0x9a0e85={'raw':!![],'where':{'id':_0x52cf9a['params']['id']}},_0x54001e={};_0x54001e[_0x7a01('0x2e')]=_[_0x7a01('0x42')](db['OpenchannelQueueReport'][_0x7a01('0x43')]);_0x54001e[_0x7a01('0x2f')]=_[_0x7a01('0x42')](_0x52cf9a[_0x7a01('0x2f')]);_0x54001e[_0x7a01('0x39')]=_[_0x7a01('0x30')](_0x54001e[_0x7a01('0x2e')],_0x54001e[_0x7a01('0x2f')]);_0x9a0e85[_0x7a01('0x32')]=_[_0x7a01('0x30')](_0x54001e[_0x7a01('0x2e')],qs[_0x7a01('0x31')](_0x52cf9a[_0x7a01('0x2f')][_0x7a01('0x31')]));_0x9a0e85[_0x7a01('0x32')]=_0x9a0e85['attributes'][_0x7a01('0x44')]?_0x9a0e85['attributes']:_0x54001e[_0x7a01('0x2e')];if(_0x52cf9a[_0x7a01('0x2f')][_0x7a01('0x3e')]){_0x9a0e85[_0x7a01('0x3f')]=[{'all':!![]}];}_0x9a0e85=_[_0x7a01('0x3b')]({},_0x9a0e85,_0x52cf9a[_0x7a01('0x3d')]);return db['OpenchannelQueueReport']['find'](_0x9a0e85)[_0x7a01('0x22')](handleEntityNotFound(_0x1aedd5,null))[_0x7a01('0x22')](respondWithResult(_0x1aedd5,null))[_0x7a01('0x45')](handleError(_0x1aedd5,null));};exports['create']=function(_0x539872,_0x358acb){return db[_0x7a01('0x2a')][_0x7a01('0x46')](_0x539872[_0x7a01('0x47')],{})[_0x7a01('0x22')](respondWithResult(_0x358acb,0xc9))['catch'](handleError(_0x358acb,null));};exports[_0x7a01('0x21')]=function(_0x537baa,_0x454abf){if(_0x537baa[_0x7a01('0x47')]['id']){delete _0x537baa[_0x7a01('0x47')]['id'];}return db[_0x7a01('0x2a')]['find']({'where':{'id':_0x537baa[_0x7a01('0x48')]['id']}})[_0x7a01('0x22')](handleEntityNotFound(_0x454abf,null))[_0x7a01('0x22')](saveUpdates(_0x537baa[_0x7a01('0x47')],null))[_0x7a01('0x22')](respondWithResult(_0x454abf,null))[_0x7a01('0x45')](handleError(_0x454abf,null));};exports['destroy']=function(_0x55ec87,_0x5ab710){return db[_0x7a01('0x2a')]['find']({'where':{'id':_0x55ec87[_0x7a01('0x48')]['id']}})[_0x7a01('0x22')](handleEntityNotFound(_0x5ab710,null))[_0x7a01('0x22')](removeEntity(_0x5ab710,null))[_0x7a01('0x45')](handleError(_0x5ab710,null));};exports[_0x7a01('0x49')]=function(_0x4d28e2,_0x7d427b){return db[_0x7a01('0x2a')][_0x7a01('0x49')]()['then'](respondWithResult(_0x7d427b,null))[_0x7a01('0x45')](handleError(_0x7d427b,null));};
\ No newline at end of file
+var _0xcfc9=['fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','create','body','find','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','end','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0xcfc9,0x1b2));var _0x9cfc=function(_0x1b84e7,_0x224f8a){_0x1b84e7=_0x1b84e7-0x0;var _0x2ebf03=_0xcfc9[_0x1b84e7];return _0x2ebf03;};'use strict';var pdf=require(_0x9cfc('0x0'));var emlformat=require(_0x9cfc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9cfc('0x2'));var jsonpatch=require(_0x9cfc('0x3'));var rp=require('request-promise');var moment=require(_0x9cfc('0x4'));var BPromise=require(_0x9cfc('0x5'));var Mustache=require('mustache');var util=require(_0x9cfc('0x6'));var path=require(_0x9cfc('0x7'));var sox=require('sox');var csv=require(_0x9cfc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9cfc('0x9'));var squel=require('squel');var crypto=require(_0x9cfc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9cfc('0xb'));var toCsv=require(_0x9cfc('0x8'));var querystring=require(_0x9cfc('0xc'));var Papa=require('papaparse');var Redis=require(_0x9cfc('0xd'));var authService=require(_0x9cfc('0xe'));var qs=require(_0x9cfc('0xf'));var as=require(_0x9cfc('0x10'));var hardwareService=require(_0x9cfc('0x11'));var logger=require(_0x9cfc('0x12'))(_0x9cfc('0x13'));var utils=require(_0x9cfc('0x14'));var config=require(_0x9cfc('0x15'));var db=require(_0x9cfc('0x16'))['db'];function respondWithStatusCode(_0x25a17d,_0x181340){_0x181340=_0x181340||0xcc;return function(_0x3b66a9){if(_0x3b66a9){return _0x25a17d[_0x9cfc('0x17')](_0x181340);}return _0x25a17d[_0x9cfc('0x18')](_0x181340)['end']();};}function respondWithResult(_0x110859,_0x1b1ed7){_0x1b1ed7=_0x1b1ed7||0xc8;return function(_0x43f13d){if(_0x43f13d){return _0x110859[_0x9cfc('0x18')](_0x1b1ed7)[_0x9cfc('0x19')](_0x43f13d);}};}function respondWithFilteredResult(_0x1ebea5,_0x514b25){return function(_0x59beb6){if(_0x59beb6){var _0x25a599=_0x59beb6[_0x9cfc('0x1a')],_0x17fdfa=_0x514b25[_0x9cfc('0x1b')],_0x4f9c97=_0x514b25[_0x9cfc('0x1b')]+_0x514b25[_0x9cfc('0x1c')],_0xb500e4;if(_0x4f9c97>=_0x25a599){_0x4f9c97=_0x25a599;_0xb500e4=0xc8;}else{_0xb500e4=0xce;}_0x1ebea5['status'](_0xb500e4);return _0x1ebea5[_0x9cfc('0x1d')]('Content-Range',_0x17fdfa+'-'+_0x4f9c97+'/'+_0x25a599)[_0x9cfc('0x19')](_0x59beb6);}return null;};}function patchUpdates(_0x4b3854){return function(_0x14ee49){try{jsonpatch[_0x9cfc('0x1e')](_0x14ee49,_0x4b3854,!![]);}catch(_0x4a1462){return BPromise[_0x9cfc('0x1f')](_0x4a1462);}return _0x14ee49[_0x9cfc('0x20')]();};}function saveUpdates(_0x5263aa,_0xc65cc7){return function(_0x1130e1){if(_0x1130e1){return _0x1130e1[_0x9cfc('0x21')](_0x5263aa)[_0x9cfc('0x22')](function(_0xe20905){return _0xe20905;});}return null;};}function removeEntity(_0x48fbb3,_0xaa7ce6){return function(_0x3c88a2){if(_0x3c88a2){return _0x3c88a2['destroy']()[_0x9cfc('0x22')](function(){_0x48fbb3[_0x9cfc('0x18')](0xcc)[_0x9cfc('0x23')]();});}};}function handleEntityNotFound(_0x55a147,_0x2f55f5){return function(_0x12b05d){if(!_0x12b05d){_0x55a147[_0x9cfc('0x17')](0x194);}return _0x12b05d;};}function handleError(_0x47866f,_0x1e46f7){_0x1e46f7=_0x1e46f7||0x1f4;return function(_0x52a518){logger['error'](_0x52a518['stack']);if(_0x52a518[_0x9cfc('0x24')]){delete _0x52a518['name'];}_0x47866f[_0x9cfc('0x18')](_0x1e46f7)['send'](_0x52a518);};}exports[_0x9cfc('0x25')]=function(_0x19c710,_0x265d5d){var _0x480a04={},_0x64f5c3={},_0x5361ae={'count':0x0,'rows':[]};var _0x1fa84d=_[_0x9cfc('0x26')](db[_0x9cfc('0x27')][_0x9cfc('0x28')],function(_0x170df0){return{'name':_0x170df0[_0x9cfc('0x29')],'type':_0x170df0['type'][_0x9cfc('0x2a')]};});_0x64f5c3[_0x9cfc('0x2b')]=_[_0x9cfc('0x26')](_0x1fa84d,_0x9cfc('0x24'));_0x64f5c3[_0x9cfc('0x2c')]=_[_0x9cfc('0x2d')](_0x19c710['query']);_0x64f5c3[_0x9cfc('0x2e')]=_['intersection'](_0x64f5c3['model'],_0x64f5c3[_0x9cfc('0x2c')]);_0x480a04[_0x9cfc('0x2f')]=_[_0x9cfc('0x30')](_0x64f5c3[_0x9cfc('0x2b')],qs[_0x9cfc('0x31')](_0x19c710[_0x9cfc('0x2c')][_0x9cfc('0x31')]));_0x480a04['attributes']=_0x480a04[_0x9cfc('0x2f')][_0x9cfc('0x32')]?_0x480a04[_0x9cfc('0x2f')]:_0x64f5c3[_0x9cfc('0x2b')];if(!_0x19c710[_0x9cfc('0x2c')]['hasOwnProperty']('nolimit')){_0x480a04['limit']=qs[_0x9cfc('0x1c')](_0x19c710[_0x9cfc('0x2c')][_0x9cfc('0x1c')]);_0x480a04[_0x9cfc('0x1b')]=qs[_0x9cfc('0x1b')](_0x19c710[_0x9cfc('0x2c')][_0x9cfc('0x1b')]);}_0x480a04[_0x9cfc('0x33')]=qs[_0x9cfc('0x34')](_0x19c710[_0x9cfc('0x2c')]['sort']);_0x480a04[_0x9cfc('0x35')]=qs['filters'](_[_0x9cfc('0x36')](_0x19c710[_0x9cfc('0x2c')],_0x64f5c3[_0x9cfc('0x2e')]),_0x1fa84d);if(_0x19c710[_0x9cfc('0x2c')][_0x9cfc('0x37')]){_0x480a04[_0x9cfc('0x35')]=_[_0x9cfc('0x38')](_0x480a04['where'],{'$or':_[_0x9cfc('0x26')](_0x1fa84d,function(_0x3cb616){if(_0x3cb616[_0x9cfc('0x39')]!==_0x9cfc('0x3a')){var _0x2065e1={};_0x2065e1[_0x3cb616['name']]={'$like':'%'+_0x19c710[_0x9cfc('0x2c')]['filter']+'%'};return _0x2065e1;}})});}_0x480a04=_['merge']({},_0x480a04,_0x19c710[_0x9cfc('0x3b')]);var _0x24fbad={'where':_0x480a04[_0x9cfc('0x35')]};return db[_0x9cfc('0x27')][_0x9cfc('0x1a')](_0x24fbad)[_0x9cfc('0x22')](function(_0x2ecca7){_0x5361ae[_0x9cfc('0x1a')]=_0x2ecca7;if(_0x19c710[_0x9cfc('0x2c')]['includeAll']){_0x480a04[_0x9cfc('0x3c')]=[{'all':!![]}];}return db[_0x9cfc('0x27')]['findAll'](_0x480a04);})[_0x9cfc('0x22')](function(_0x16ea28){_0x5361ae[_0x9cfc('0x3d')]=_0x16ea28;return _0x5361ae;})['then'](respondWithFilteredResult(_0x265d5d,_0x480a04))[_0x9cfc('0x3e')](handleError(_0x265d5d,null));};exports[_0x9cfc('0x3f')]=function(_0x51a2f0,_0x30fd3a){var _0x35779e={'raw':!![],'where':{'id':_0x51a2f0[_0x9cfc('0x40')]['id']}},_0x269719={};_0x269719[_0x9cfc('0x2b')]=_['keys'](db[_0x9cfc('0x27')][_0x9cfc('0x28')]);_0x269719[_0x9cfc('0x2c')]=_['keys'](_0x51a2f0['query']);_0x269719[_0x9cfc('0x2e')]=_[_0x9cfc('0x30')](_0x269719[_0x9cfc('0x2b')],_0x269719[_0x9cfc('0x2c')]);_0x35779e['attributes']=_[_0x9cfc('0x30')](_0x269719[_0x9cfc('0x2b')],qs[_0x9cfc('0x31')](_0x51a2f0['query'][_0x9cfc('0x31')]));_0x35779e[_0x9cfc('0x2f')]=_0x35779e[_0x9cfc('0x2f')][_0x9cfc('0x32')]?_0x35779e['attributes']:_0x269719['model'];if(_0x51a2f0[_0x9cfc('0x2c')]['includeAll']){_0x35779e[_0x9cfc('0x3c')]=[{'all':!![]}];}_0x35779e=_['merge']({},_0x35779e,_0x51a2f0['options']);return db[_0x9cfc('0x27')]['find'](_0x35779e)[_0x9cfc('0x22')](handleEntityNotFound(_0x30fd3a,null))['then'](respondWithResult(_0x30fd3a,null))[_0x9cfc('0x3e')](handleError(_0x30fd3a,null));};exports[_0x9cfc('0x41')]=function(_0x51667d,_0x2e20b7){return db[_0x9cfc('0x27')]['create'](_0x51667d[_0x9cfc('0x42')],{})[_0x9cfc('0x22')](respondWithResult(_0x2e20b7,0xc9))[_0x9cfc('0x3e')](handleError(_0x2e20b7,null));};exports[_0x9cfc('0x21')]=function(_0x1edfcd,_0x3520d0){if(_0x1edfcd[_0x9cfc('0x42')]['id']){delete _0x1edfcd[_0x9cfc('0x42')]['id'];}return db['OpenchannelQueueReport'][_0x9cfc('0x43')]({'where':{'id':_0x1edfcd[_0x9cfc('0x40')]['id']}})[_0x9cfc('0x22')](handleEntityNotFound(_0x3520d0,null))['then'](saveUpdates(_0x1edfcd[_0x9cfc('0x42')],null))[_0x9cfc('0x22')](respondWithResult(_0x3520d0,null))[_0x9cfc('0x3e')](handleError(_0x3520d0,null));};exports[_0x9cfc('0x44')]=function(_0x366334,_0x2ff16f){return db['OpenchannelQueueReport'][_0x9cfc('0x43')]({'where':{'id':_0x366334['params']['id']}})[_0x9cfc('0x22')](handleEntityNotFound(_0x2ff16f,null))[_0x9cfc('0x22')](removeEntity(_0x2ff16f,null))[_0x9cfc('0x3e')](handleError(_0x2ff16f,null));};exports['describe']=function(_0x17dbdd,_0x125ebb){return db[_0x9cfc('0x27')]['describe']()[_0x9cfc('0x22')](respondWithResult(_0x125ebb,null))[_0x9cfc('0x3e')](handleError(_0x125ebb,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js
index e22ac50..4445462 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4aa8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_openchannel_queue','uniqueid','../../config/logger'];(function(_0x44776c,_0xf68c35){var _0x590696=function(_0x45ac2b){while(--_0x45ac2b){_0x44776c['push'](_0x44776c['shift']());}};_0x590696(++_0xf68c35);}(_0x4aa8,0x1d3));var _0x84aa=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x4aa8[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x84aa('0x0'))(_0x84aa('0x1'));var moment=require(_0x84aa('0x2'));var BPromise=require(_0x84aa('0x3'));var rp=require(_0x84aa('0x4'));var fs=require('fs');var path=require(_0x84aa('0x5'));var rimraf=require(_0x84aa('0x6'));var config=require(_0x84aa('0x7'));var attributes=require('./openchannelQueueReport.attributes');module[_0x84aa('0x8')]=function(_0x296c02,_0x1fe909){return _0x296c02[_0x84aa('0x9')]('OpenchannelQueueReport',attributes,{'tableName':_0x84aa('0xa'),'paranoid':![],'indexes':[{'name':_0x84aa('0xb'),'fields':[_0x84aa('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x77e1=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports'];(function(_0x477dd3,_0x23ec52){var _0x53ad64=function(_0x1689c5){while(--_0x1689c5){_0x477dd3['push'](_0x477dd3['shift']());}};_0x53ad64(++_0x23ec52);}(_0x77e1,0x18c));var _0x177e=function(_0x489423,_0x1decc9){_0x489423=_0x489423-0x0;var _0x426483=_0x77e1[_0x489423];return _0x426483;};'use strict';var _=require(_0x177e('0x0'));var util=require(_0x177e('0x1'));var logger=require(_0x177e('0x2'))(_0x177e('0x3'));var moment=require(_0x177e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x177e('0x5'));var rimraf=require(_0x177e('0x6'));var config=require(_0x177e('0x7'));var attributes=require(_0x177e('0x8'));module[_0x177e('0x9')]=function(_0x55b844,_0x33b7b8){return _0x55b844[_0x177e('0xa')](_0x177e('0xb'),attributes,{'tableName':_0x177e('0xc'),'paranoid':![],'indexes':[{'name':_0x177e('0xd'),'fields':[_0x177e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
index 55e4485..9a80992 100644
--- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
+++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef66=['request\x20sent','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','debug','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x51e067,_0x4cdb85){var _0x2b82c=function(_0x52d57f){while(--_0x52d57f){_0x51e067['push'](_0x51e067['shift']());}};_0x2b82c(++_0x4cdb85);}(_0xef66,0x1db));var _0x6ef6=function(_0x181514,_0x207e6c){_0x181514=_0x181514-0x0;var _0x1f8866=_0xef66[_0x181514];return _0x1f8866;};'use strict';var _=require(_0x6ef6('0x0'));var util=require(_0x6ef6('0x1'));var moment=require(_0x6ef6('0x2'));var BPromise=require(_0x6ef6('0x3'));var rs=require(_0x6ef6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6ef6('0x5'));var logger=require(_0x6ef6('0x6'))(_0x6ef6('0x7'));var config=require(_0x6ef6('0x8'));var jayson=require(_0x6ef6('0x9'));var client=jayson[_0x6ef6('0xa')][_0x6ef6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1830aa,_0x3755b5,_0x4f06b9){return new BPromise(function(_0x5a7c74,_0xc0d555){return client[_0x6ef6('0xc')](_0x1830aa,_0x4f06b9)[_0x6ef6('0xd')](function(_0x391e0e){logger[_0x6ef6('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3755b5,_0x6ef6('0xf'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3755b5,_0x6ef6('0xf'),JSON['stringify'](_0x391e0e));if(_0x391e0e[_0x6ef6('0x10')]){if(_0x391e0e[_0x6ef6('0x10')][_0x6ef6('0x11')]===0x1f4){logger[_0x6ef6('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3755b5,_0x391e0e[_0x6ef6('0x10')][_0x6ef6('0x12')]);return _0xc0d555(_0x391e0e[_0x6ef6('0x10')][_0x6ef6('0x12')]);}logger['error'](_0x6ef6('0x13'),_0x3755b5,_0x391e0e['error'][_0x6ef6('0x12')]);return _0x5a7c74(_0x391e0e[_0x6ef6('0x10')]['message']);}else{logger[_0x6ef6('0xe')](_0x6ef6('0x13'),_0x3755b5,_0x6ef6('0xf'));_0x5a7c74(_0x391e0e[_0x6ef6('0x14')][_0x6ef6('0x12')]);}})[_0x6ef6('0x15')](function(_0x4ea222){logger[_0x6ef6('0x10')](_0x6ef6('0x13'),_0x3755b5,_0x4ea222);_0xc0d555(_0x4ea222);});});}exports[_0x6ef6('0x16')]=function(_0x53586d){var _0x3fc3d1=this;return new Promise(function(_0x2510be,_0x292af9){return db[_0x6ef6('0x17')][_0x6ef6('0x18')](_0x53586d[_0x6ef6('0x19')],{'raw':_0x53586d[_0x6ef6('0x1a')]?_0x53586d['options'][_0x6ef6('0x1b')]===undefined?!![]:![]:!![]})[_0x6ef6('0xd')](function(_0x2903ea){logger[_0x6ef6('0xe')]('CreateOpenchannelQueueReport',_0x53586d);logger[_0x6ef6('0x1c')](_0x6ef6('0x16'),_0x53586d,JSON[_0x6ef6('0x1d')](_0x2903ea));_0x2510be(_0x2903ea);})['catch'](function(_0x4257d8){logger[_0x6ef6('0x10')]('CreateOpenchannelQueueReport',_0x4257d8[_0x6ef6('0x12')],_0x53586d);_0x292af9(_0x3fc3d1[_0x6ef6('0x10')](0x1f4,_0x4257d8['message']));});});};exports[_0x6ef6('0x1e')]=function(_0xb1c6b0){var _0x2072a1=this;return new Promise(function(_0x414def,_0x43bb8d){return db[_0x6ef6('0x17')][_0x6ef6('0x1f')](_0xb1c6b0['body'],{'raw':_0xb1c6b0[_0x6ef6('0x1a')]?_0xb1c6b0['options'][_0x6ef6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb1c6b0[_0x6ef6('0x1a')]?_0xb1c6b0[_0x6ef6('0x1a')][_0x6ef6('0x20')]||null:null,'attributes':_0xb1c6b0[_0x6ef6('0x1a')]?_0xb1c6b0[_0x6ef6('0x1a')][_0x6ef6('0x21')]||null:null,'limit':_0xb1c6b0[_0x6ef6('0x1a')]?_0xb1c6b0[_0x6ef6('0x1a')][_0x6ef6('0x22')]||null:null})[_0x6ef6('0xd')](function(_0x2d87a8){logger[_0x6ef6('0xe')](_0x6ef6('0x1e'),_0xb1c6b0);logger[_0x6ef6('0x1c')](_0x6ef6('0x1e'),_0xb1c6b0,JSON[_0x6ef6('0x1d')](_0x2d87a8));_0x414def(_0x2d87a8);})[_0x6ef6('0x15')](function(_0x24eeae){logger[_0x6ef6('0x10')]('UpdateOpenchannelQueueReport',_0x24eeae[_0x6ef6('0x12')],_0xb1c6b0);_0x43bb8d(_0x2072a1['error'](0x1f4,_0x24eeae[_0x6ef6('0x12')]));});});};
\ No newline at end of file
+var _0x44fe=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x14d4e5,_0x1efd49){var _0x6d9038=function(_0x482bd7){while(--_0x482bd7){_0x14d4e5['push'](_0x14d4e5['shift']());}};_0x6d9038(++_0x1efd49);}(_0x44fe,0x16f));var _0xe44f=function(_0x338495,_0x288a97){_0x338495=_0x338495-0x0;var _0x5e715f=_0x44fe[_0x338495];return _0x5e715f;};'use strict';var _=require(_0xe44f('0x0'));var util=require(_0xe44f('0x1'));var moment=require(_0xe44f('0x2'));var BPromise=require(_0xe44f('0x3'));var rs=require(_0xe44f('0x4'));var fs=require('fs');var Redis=require(_0xe44f('0x5'));var db=require(_0xe44f('0x6'))['db'];var utils=require(_0xe44f('0x7'));var logger=require(_0xe44f('0x8'))(_0xe44f('0x9'));var config=require(_0xe44f('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe44f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18320f,_0x5c5234,_0x1a4e3b){return new BPromise(function(_0x34e4d5,_0x110de4){return client[_0xe44f('0xc')](_0x18320f,_0x1a4e3b)[_0xe44f('0xd')](function(_0x481156){logger[_0xe44f('0xe')](_0xe44f('0xf'),_0x5c5234,_0xe44f('0x10'));logger[_0xe44f('0x11')](_0xe44f('0x12'),_0x5c5234,_0xe44f('0x10'),JSON[_0xe44f('0x13')](_0x481156));if(_0x481156[_0xe44f('0x14')]){if(_0x481156[_0xe44f('0x14')]['code']===0x1f4){logger[_0xe44f('0x14')](_0xe44f('0xf'),_0x5c5234,_0x481156['error'][_0xe44f('0x15')]);return _0x110de4(_0x481156[_0xe44f('0x14')][_0xe44f('0x15')]);}logger[_0xe44f('0x14')](_0xe44f('0xf'),_0x5c5234,_0x481156[_0xe44f('0x14')][_0xe44f('0x15')]);return _0x34e4d5(_0x481156[_0xe44f('0x14')]['message']);}else{logger[_0xe44f('0xe')](_0xe44f('0xf'),_0x5c5234,_0xe44f('0x10'));_0x34e4d5(_0x481156[_0xe44f('0x16')][_0xe44f('0x15')]);}})[_0xe44f('0x17')](function(_0x3ee3f9){logger[_0xe44f('0x14')](_0xe44f('0xf'),_0x5c5234,_0x3ee3f9);_0x110de4(_0x3ee3f9);});});}exports[_0xe44f('0x18')]=function(_0x163af0){var _0x3e7d5e=this;return new Promise(function(_0x4c70e5,_0x5d027a){return db[_0xe44f('0x19')][_0xe44f('0x1a')](_0x163af0[_0xe44f('0x1b')],{'raw':_0x163af0[_0xe44f('0x1c')]?_0x163af0[_0xe44f('0x1c')][_0xe44f('0x1d')]===undefined?!![]:![]:!![]})[_0xe44f('0xd')](function(_0x239ef5){logger[_0xe44f('0xe')]('CreateOpenchannelQueueReport',_0x163af0);logger['debug'](_0xe44f('0x18'),_0x163af0,JSON[_0xe44f('0x13')](_0x239ef5));_0x4c70e5(_0x239ef5);})[_0xe44f('0x17')](function(_0x3f7ef8){logger[_0xe44f('0x14')]('CreateOpenchannelQueueReport',_0x3f7ef8['message'],_0x163af0);_0x5d027a(_0x3e7d5e[_0xe44f('0x14')](0x1f4,_0x3f7ef8[_0xe44f('0x15')]));});});};exports[_0xe44f('0x1e')]=function(_0x20c7aa){var _0x55b679=this;return new Promise(function(_0x1aa2cf,_0xb84f2d){return db[_0xe44f('0x19')][_0xe44f('0x1f')](_0x20c7aa['body'],{'raw':_0x20c7aa[_0xe44f('0x1c')]?_0x20c7aa[_0xe44f('0x1c')][_0xe44f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20c7aa['options']?_0x20c7aa['options'][_0xe44f('0x20')]||null:null,'attributes':_0x20c7aa[_0xe44f('0x1c')]?_0x20c7aa[_0xe44f('0x1c')]['attributes']||null:null,'limit':_0x20c7aa[_0xe44f('0x1c')]?_0x20c7aa['options'][_0xe44f('0x21')]||null:null})[_0xe44f('0xd')](function(_0x2a1f96){logger['info']('UpdateOpenchannelQueueReport',_0x20c7aa);logger['debug']('UpdateOpenchannelQueueReport',_0x20c7aa,JSON[_0xe44f('0x13')](_0x2a1f96));_0x1aa2cf(_0x2a1f96);})[_0xe44f('0x17')](function(_0x4aea1a){logger[_0xe44f('0x14')](_0xe44f('0x1e'),_0x4aea1a[_0xe44f('0x15')],_0x20c7aa);_0xb84f2d(_0x55b679[_0xe44f('0x14')](0x1f4,_0x4aea1a[_0xe44f('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js
index e4bc659..a2920d6 100644
--- a/server/api/openchannelTransferReport/index.js
+++ b/server/api/openchannelTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
+var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
index 193f8dc..1041785 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc9f=['exports','STRING','ENUM','account','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc9f,0x198));var _0xfbc9=function(_0x57f100,_0xa53aca){_0x57f100=_0x57f100-0x0;var _0x4cac01=_0xbc9f[_0x57f100];return _0x4cac01;};'use strict';var moment=require(_0xfbc9('0x0'));var Sequelize=require(_0xfbc9('0x1'));module[_0xfbc9('0x2')]={'uniqueid':{'type':Sequelize[_0xfbc9('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xfbc9('0x4')](_0xfbc9('0x5'),_0xfbc9('0x6'),'queue'),'allowNull':![],'defaultValue':_0xfbc9('0x7')},'transferredAt':{'type':Sequelize[_0xfbc9('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xfbc9('0x9')]}};
\ No newline at end of file
+var _0x8bf2=['agent','queue','DATE','moment','ENUM'];(function(_0x36ab3e,_0x5aa57a){var _0x404fe5=function(_0xec1bb){while(--_0xec1bb){_0x36ab3e['push'](_0x36ab3e['shift']());}};_0x404fe5(++_0x5aa57a);}(_0x8bf2,0x94));var _0x28bf=function(_0x5dfe1b,_0xa224f7){_0x5dfe1b=_0x5dfe1b-0x0;var _0x26ba40=_0x8bf2[_0x5dfe1b];return _0x26ba40;};'use strict';var moment=require(_0x28bf('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x28bf('0x1')]('account',_0x28bf('0x2'),'queue'),'allowNull':![],'defaultValue':_0x28bf('0x3')},'transferredAt':{'type':Sequelize[_0x28bf('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
index 5932322..2c83b4e 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56f0=['lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','catch','show','keys','create','body','update','find','params','describe','eml-format','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs'];(function(_0x28f6f3,_0x31b11e){var _0xd2273c=function(_0x1a0409){while(--_0x1a0409){_0x28f6f3['push'](_0x28f6f3['shift']());}};_0xd2273c(++_0x31b11e);}(_0x56f0,0x11c));var _0x056f=function(_0x5e32f3,_0x3386c1){_0x5e32f3=_0x5e32f3-0x0;var _0x4d4e03=_0x56f0[_0x5e32f3];return _0x4d4e03;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x056f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x056f('0x1'));var rp=require(_0x056f('0x2'));var moment=require(_0x056f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x056f('0x4'));var util=require('util');var path=require(_0x056f('0x5'));var sox=require('sox');var csv=require(_0x056f('0x6'));var ejs=require(_0x056f('0x7'));var fs=require('fs');var _=require(_0x056f('0x8'));var squel=require(_0x056f('0x9'));var crypto=require(_0x056f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x056f('0xb'));var toCsv=require(_0x056f('0x6'));var querystring=require('querystring');var Papa=require(_0x056f('0xc'));var Redis=require(_0x056f('0xd'));var authService=require(_0x056f('0xe'));var qs=require(_0x056f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x056f('0x10'));var logger=require(_0x056f('0x11'))(_0x056f('0x12'));var utils=require(_0x056f('0x13'));var config=require(_0x056f('0x14'));var db=require(_0x056f('0x15'))['db'];function respondWithStatusCode(_0x4d7c7b,_0x49ac1f){_0x49ac1f=_0x49ac1f||0xcc;return function(_0x3a176b){if(_0x3a176b){return _0x4d7c7b[_0x056f('0x16')](_0x49ac1f);}return _0x4d7c7b[_0x056f('0x17')](_0x49ac1f)[_0x056f('0x18')]();};}function respondWithResult(_0x5b2c54,_0x4cb8d5){_0x4cb8d5=_0x4cb8d5||0xc8;return function(_0x37df0c){if(_0x37df0c){return _0x5b2c54['status'](_0x4cb8d5)['json'](_0x37df0c);}};}function respondWithFilteredResult(_0x58aa66,_0x147066){return function(_0x3638d4){if(_0x3638d4){var _0x583415=_0x3638d4[_0x056f('0x19')],_0x22e954=_0x147066[_0x056f('0x1a')],_0x1eed90=_0x147066[_0x056f('0x1a')]+_0x147066[_0x056f('0x1b')],_0x5cf647;if(_0x1eed90>=_0x583415){_0x1eed90=_0x583415;_0x5cf647=0xc8;}else{_0x5cf647=0xce;}_0x58aa66[_0x056f('0x17')](_0x5cf647);return _0x58aa66[_0x056f('0x1c')](_0x056f('0x1d'),_0x22e954+'-'+_0x1eed90+'/'+_0x583415)['json'](_0x3638d4);}return null;};}function patchUpdates(_0x24c644){return function(_0x10e368){try{jsonpatch[_0x056f('0x1e')](_0x10e368,_0x24c644,!![]);}catch(_0x638c4d){return BPromise['reject'](_0x638c4d);}return _0x10e368[_0x056f('0x1f')]();};}function saveUpdates(_0x10fa9c,_0x333b7c){return function(_0x166ef6){if(_0x166ef6){return _0x166ef6['update'](_0x10fa9c)[_0x056f('0x20')](function(_0x5eefc7){return _0x5eefc7;});}return null;};}function removeEntity(_0x102173,_0x207c44){return function(_0x6cbbdd){if(_0x6cbbdd){return _0x6cbbdd[_0x056f('0x21')]()[_0x056f('0x20')](function(){_0x102173[_0x056f('0x17')](0xcc)[_0x056f('0x18')]();});}};}function handleEntityNotFound(_0x539a50,_0x4b5f39){return function(_0x36f272){if(!_0x36f272){_0x539a50[_0x056f('0x16')](0x194);}return _0x36f272;};}function handleError(_0x1e04f1,_0x123b3c){_0x123b3c=_0x123b3c||0x1f4;return function(_0x36b244){logger[_0x056f('0x22')](_0x36b244[_0x056f('0x23')]);if(_0x36b244['name']){delete _0x36b244[_0x056f('0x24')];}_0x1e04f1[_0x056f('0x17')](_0x123b3c)[_0x056f('0x25')](_0x36b244);};}exports[_0x056f('0x26')]=function(_0x51dd20,_0x284f37){var _0x3b84cf={},_0x39182c={},_0x41cd16={'count':0x0,'rows':[]};var _0x487c34=_[_0x056f('0x27')](db['OpenchannelTransferReport'][_0x056f('0x28')],function(_0x1520d2){return{'name':_0x1520d2[_0x056f('0x29')],'type':_0x1520d2[_0x056f('0x2a')][_0x056f('0x2b')]};});_0x39182c[_0x056f('0x2c')]=_[_0x056f('0x27')](_0x487c34,'name');_0x39182c[_0x056f('0x2d')]=_['keys'](_0x51dd20[_0x056f('0x2d')]);_0x39182c[_0x056f('0x2e')]=_['intersection'](_0x39182c['model'],_0x39182c['query']);_0x3b84cf[_0x056f('0x2f')]=_[_0x056f('0x30')](_0x39182c[_0x056f('0x2c')],qs[_0x056f('0x31')](_0x51dd20[_0x056f('0x2d')]['fields']));_0x3b84cf[_0x056f('0x2f')]=_0x3b84cf['attributes'][_0x056f('0x32')]?_0x3b84cf[_0x056f('0x2f')]:_0x39182c[_0x056f('0x2c')];if(!_0x51dd20[_0x056f('0x2d')][_0x056f('0x33')](_0x056f('0x34'))){_0x3b84cf['limit']=qs[_0x056f('0x1b')](_0x51dd20[_0x056f('0x2d')][_0x056f('0x1b')]);_0x3b84cf[_0x056f('0x1a')]=qs[_0x056f('0x1a')](_0x51dd20[_0x056f('0x2d')][_0x056f('0x1a')]);}_0x3b84cf[_0x056f('0x35')]=qs[_0x056f('0x36')](_0x51dd20[_0x056f('0x2d')][_0x056f('0x36')]);_0x3b84cf[_0x056f('0x37')]=qs['filters'](_['pick'](_0x51dd20[_0x056f('0x2d')],_0x39182c[_0x056f('0x2e')]),_0x487c34);if(_0x51dd20['query'][_0x056f('0x38')]){_0x3b84cf[_0x056f('0x37')]=_[_0x056f('0x39')](_0x3b84cf[_0x056f('0x37')],{'$or':_[_0x056f('0x27')](_0x487c34,function(_0x1d5712){if(_0x1d5712['type']!==_0x056f('0x3a')){var _0x3d6e23={};_0x3d6e23[_0x1d5712[_0x056f('0x24')]]={'$like':'%'+_0x51dd20[_0x056f('0x2d')]['filter']+'%'};return _0x3d6e23;}})});}_0x3b84cf=_[_0x056f('0x39')]({},_0x3b84cf,_0x51dd20[_0x056f('0x3b')]);var _0x572846={'where':_0x3b84cf['where']};return db[_0x056f('0x3c')][_0x056f('0x19')](_0x572846)[_0x056f('0x20')](function(_0x4eeb61){_0x41cd16[_0x056f('0x19')]=_0x4eeb61;if(_0x51dd20[_0x056f('0x2d')][_0x056f('0x3d')]){_0x3b84cf[_0x056f('0x3e')]=[{'all':!![]}];}return db[_0x056f('0x3c')][_0x056f('0x3f')](_0x3b84cf);})[_0x056f('0x20')](function(_0x290479){_0x41cd16['rows']=_0x290479;return _0x41cd16;})[_0x056f('0x20')](respondWithFilteredResult(_0x284f37,_0x3b84cf))[_0x056f('0x40')](handleError(_0x284f37,null));};exports[_0x056f('0x41')]=function(_0x2aec48,_0x180053){var _0xac2a9={'raw':!![],'where':{'id':_0x2aec48['params']['id']}},_0x2165f4={};_0x2165f4[_0x056f('0x2c')]=_[_0x056f('0x42')](db[_0x056f('0x3c')][_0x056f('0x28')]);_0x2165f4[_0x056f('0x2d')]=_['keys'](_0x2aec48[_0x056f('0x2d')]);_0x2165f4[_0x056f('0x2e')]=_[_0x056f('0x30')](_0x2165f4[_0x056f('0x2c')],_0x2165f4[_0x056f('0x2d')]);_0xac2a9[_0x056f('0x2f')]=_['intersection'](_0x2165f4[_0x056f('0x2c')],qs[_0x056f('0x31')](_0x2aec48['query'][_0x056f('0x31')]));_0xac2a9[_0x056f('0x2f')]=_0xac2a9[_0x056f('0x2f')][_0x056f('0x32')]?_0xac2a9[_0x056f('0x2f')]:_0x2165f4[_0x056f('0x2c')];if(_0x2aec48[_0x056f('0x2d')][_0x056f('0x3d')]){_0xac2a9[_0x056f('0x3e')]=[{'all':!![]}];}_0xac2a9=_[_0x056f('0x39')]({},_0xac2a9,_0x2aec48['options']);return db['OpenchannelTransferReport']['find'](_0xac2a9)[_0x056f('0x20')](handleEntityNotFound(_0x180053,null))['then'](respondWithResult(_0x180053,null))[_0x056f('0x40')](handleError(_0x180053,null));};exports['create']=function(_0x5ad046,_0x1c9b88){return db[_0x056f('0x3c')][_0x056f('0x43')](_0x5ad046[_0x056f('0x44')],{})[_0x056f('0x20')](respondWithResult(_0x1c9b88,0xc9))[_0x056f('0x40')](handleError(_0x1c9b88,null));};exports[_0x056f('0x45')]=function(_0x3ecf51,_0x27f6e2){if(_0x3ecf51['body']['id']){delete _0x3ecf51['body']['id'];}return db['OpenchannelTransferReport'][_0x056f('0x46')]({'where':{'id':_0x3ecf51[_0x056f('0x47')]['id']}})['then'](handleEntityNotFound(_0x27f6e2,null))[_0x056f('0x20')](saveUpdates(_0x3ecf51[_0x056f('0x44')],null))[_0x056f('0x20')](respondWithResult(_0x27f6e2,null))['catch'](handleError(_0x27f6e2,null));};exports[_0x056f('0x21')]=function(_0x47275c,_0x572c65){return db['OpenchannelTransferReport'][_0x056f('0x46')]({'where':{'id':_0x47275c[_0x056f('0x47')]['id']}})[_0x056f('0x20')](handleEntityNotFound(_0x572c65,null))[_0x056f('0x20')](removeEntity(_0x572c65,null))[_0x056f('0x40')](handleError(_0x572c65,null));};exports[_0x056f('0x48')]=function(_0xa68cc1,_0x313a0e){return db[_0x056f('0x3c')][_0x056f('0x48')]()['then'](respondWithResult(_0x313a0e,null))[_0x056f('0x40')](handleError(_0x313a0e,null));};
\ No newline at end of file
+var _0x7fc7=['attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','map','OpenchannelTransferReport','type','key','model','query','keys','intersection'];(function(_0x2f8df3,_0x3f8b27){var _0x1e1399=function(_0x41d7c7){while(--_0x41d7c7){_0x2f8df3['push'](_0x2f8df3['shift']());}};_0x1e1399(++_0x3f8b27);}(_0x7fc7,0xaa));var _0x77fc=function(_0x4b57bc,_0x50a31f){_0x4b57bc=_0x4b57bc-0x0;var _0x22b569=_0x7fc7[_0x4b57bc];return _0x22b569;};'use strict';var pdf=require(_0x77fc('0x0'));var emlformat=require(_0x77fc('0x1'));var rimraf=require(_0x77fc('0x2'));var zipdir=require(_0x77fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77fc('0x4'));var BPromise=require(_0x77fc('0x5'));var Mustache=require(_0x77fc('0x6'));var util=require(_0x77fc('0x7'));var path=require('path');var sox=require(_0x77fc('0x8'));var csv=require(_0x77fc('0x9'));var ejs=require(_0x77fc('0xa'));var fs=require('fs');var _=require(_0x77fc('0xb'));var squel=require('squel');var crypto=require(_0x77fc('0xc'));var jsforce=require(_0x77fc('0xd'));var deskjs=require(_0x77fc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x77fc('0xf'));var Papa=require(_0x77fc('0x10'));var Redis=require('ioredis');var authService=require(_0x77fc('0x11'));var qs=require(_0x77fc('0x12'));var as=require(_0x77fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77fc('0x14'))(_0x77fc('0x15'));var utils=require('../../config/utils');var config=require(_0x77fc('0x16'));var db=require(_0x77fc('0x17'))['db'];function respondWithStatusCode(_0x235993,_0x5e4ed4){_0x5e4ed4=_0x5e4ed4||0xcc;return function(_0x1d0117){if(_0x1d0117){return _0x235993[_0x77fc('0x18')](_0x5e4ed4);}return _0x235993[_0x77fc('0x19')](_0x5e4ed4)[_0x77fc('0x1a')]();};}function respondWithResult(_0x567648,_0x4c54b1){_0x4c54b1=_0x4c54b1||0xc8;return function(_0x2a356f){if(_0x2a356f){return _0x567648[_0x77fc('0x19')](_0x4c54b1)[_0x77fc('0x1b')](_0x2a356f);}};}function respondWithFilteredResult(_0x58b69c,_0x1a7e3d){return function(_0xdd8451){if(_0xdd8451){var _0x308cbd=_0xdd8451[_0x77fc('0x1c')],_0x49f68e=_0x1a7e3d[_0x77fc('0x1d')],_0x655836=_0x1a7e3d[_0x77fc('0x1d')]+_0x1a7e3d[_0x77fc('0x1e')],_0x25d246;if(_0x655836>=_0x308cbd){_0x655836=_0x308cbd;_0x25d246=0xc8;}else{_0x25d246=0xce;}_0x58b69c[_0x77fc('0x19')](_0x25d246);return _0x58b69c[_0x77fc('0x1f')](_0x77fc('0x20'),_0x49f68e+'-'+_0x655836+'/'+_0x308cbd)[_0x77fc('0x1b')](_0xdd8451);}return null;};}function patchUpdates(_0x18084e){return function(_0x7db352){try{jsonpatch['apply'](_0x7db352,_0x18084e,!![]);}catch(_0x3ed6d3){return BPromise[_0x77fc('0x21')](_0x3ed6d3);}return _0x7db352[_0x77fc('0x22')]();};}function saveUpdates(_0x1407b0,_0x322317){return function(_0x2fdd84){if(_0x2fdd84){return _0x2fdd84['update'](_0x1407b0)[_0x77fc('0x23')](function(_0xf7f229){return _0xf7f229;});}return null;};}function removeEntity(_0x3b3b0c,_0xb353d9){return function(_0x2f705b){if(_0x2f705b){return _0x2f705b[_0x77fc('0x24')]()[_0x77fc('0x23')](function(){_0x3b3b0c[_0x77fc('0x19')](0xcc)[_0x77fc('0x1a')]();});}};}function handleEntityNotFound(_0x155a46,_0x93e44a){return function(_0x1501aa){if(!_0x1501aa){_0x155a46[_0x77fc('0x18')](0x194);}return _0x1501aa;};}function handleError(_0x2bf45e,_0x297619){_0x297619=_0x297619||0x1f4;return function(_0x4a1c7f){logger[_0x77fc('0x25')](_0x4a1c7f['stack']);if(_0x4a1c7f[_0x77fc('0x26')]){delete _0x4a1c7f[_0x77fc('0x26')];}_0x2bf45e['status'](_0x297619)[_0x77fc('0x27')](_0x4a1c7f);};}exports[_0x77fc('0x28')]=function(_0x396c30,_0x4b0f3f){var _0x425be0={},_0x1fac85={},_0x37a8b5={'count':0x0,'rows':[]};var _0x2f2a53=_[_0x77fc('0x29')](db[_0x77fc('0x2a')]['rawAttributes'],function(_0x5422be){return{'name':_0x5422be['fieldName'],'type':_0x5422be[_0x77fc('0x2b')][_0x77fc('0x2c')]};});_0x1fac85[_0x77fc('0x2d')]=_[_0x77fc('0x29')](_0x2f2a53,_0x77fc('0x26'));_0x1fac85[_0x77fc('0x2e')]=_[_0x77fc('0x2f')](_0x396c30[_0x77fc('0x2e')]);_0x1fac85['filters']=_[_0x77fc('0x30')](_0x1fac85['model'],_0x1fac85['query']);_0x425be0[_0x77fc('0x31')]=_[_0x77fc('0x30')](_0x1fac85['model'],qs[_0x77fc('0x32')](_0x396c30[_0x77fc('0x2e')][_0x77fc('0x32')]));_0x425be0[_0x77fc('0x31')]=_0x425be0[_0x77fc('0x31')][_0x77fc('0x33')]?_0x425be0[_0x77fc('0x31')]:_0x1fac85[_0x77fc('0x2d')];if(!_0x396c30[_0x77fc('0x2e')][_0x77fc('0x34')](_0x77fc('0x35'))){_0x425be0[_0x77fc('0x1e')]=qs[_0x77fc('0x1e')](_0x396c30[_0x77fc('0x2e')][_0x77fc('0x1e')]);_0x425be0['offset']=qs[_0x77fc('0x1d')](_0x396c30[_0x77fc('0x2e')][_0x77fc('0x1d')]);}_0x425be0['order']=qs[_0x77fc('0x36')](_0x396c30[_0x77fc('0x2e')][_0x77fc('0x36')]);_0x425be0['where']=qs[_0x77fc('0x37')](_['pick'](_0x396c30[_0x77fc('0x2e')],_0x1fac85[_0x77fc('0x37')]),_0x2f2a53);if(_0x396c30[_0x77fc('0x2e')][_0x77fc('0x38')]){_0x425be0[_0x77fc('0x39')]=_[_0x77fc('0x3a')](_0x425be0[_0x77fc('0x39')],{'$or':_[_0x77fc('0x29')](_0x2f2a53,function(_0xd7e16){if(_0xd7e16[_0x77fc('0x2b')]!=='VIRTUAL'){var _0x92f118={};_0x92f118[_0xd7e16[_0x77fc('0x26')]]={'$like':'%'+_0x396c30['query']['filter']+'%'};return _0x92f118;}})});}_0x425be0=_[_0x77fc('0x3a')]({},_0x425be0,_0x396c30[_0x77fc('0x3b')]);var _0x1bf237={'where':_0x425be0[_0x77fc('0x39')]};return db[_0x77fc('0x2a')][_0x77fc('0x1c')](_0x1bf237)['then'](function(_0x584cff){_0x37a8b5[_0x77fc('0x1c')]=_0x584cff;if(_0x396c30[_0x77fc('0x2e')][_0x77fc('0x3c')]){_0x425be0[_0x77fc('0x3d')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x77fc('0x3e')](_0x425be0);})['then'](function(_0x3ecc64){_0x37a8b5[_0x77fc('0x3f')]=_0x3ecc64;return _0x37a8b5;})[_0x77fc('0x23')](respondWithFilteredResult(_0x4b0f3f,_0x425be0))[_0x77fc('0x40')](handleError(_0x4b0f3f,null));};exports[_0x77fc('0x41')]=function(_0x49bc3b,_0x1468e3){var _0x4f0601={'raw':!![],'where':{'id':_0x49bc3b['params']['id']}},_0x3d6a42={};_0x3d6a42['model']=_['keys'](db[_0x77fc('0x2a')][_0x77fc('0x42')]);_0x3d6a42[_0x77fc('0x2e')]=_[_0x77fc('0x2f')](_0x49bc3b[_0x77fc('0x2e')]);_0x3d6a42[_0x77fc('0x37')]=_['intersection'](_0x3d6a42[_0x77fc('0x2d')],_0x3d6a42[_0x77fc('0x2e')]);_0x4f0601[_0x77fc('0x31')]=_['intersection'](_0x3d6a42[_0x77fc('0x2d')],qs[_0x77fc('0x32')](_0x49bc3b['query']['fields']));_0x4f0601[_0x77fc('0x31')]=_0x4f0601[_0x77fc('0x31')][_0x77fc('0x33')]?_0x4f0601[_0x77fc('0x31')]:_0x3d6a42[_0x77fc('0x2d')];if(_0x49bc3b['query'][_0x77fc('0x3c')]){_0x4f0601[_0x77fc('0x3d')]=[{'all':!![]}];}_0x4f0601=_[_0x77fc('0x3a')]({},_0x4f0601,_0x49bc3b[_0x77fc('0x3b')]);return db['OpenchannelTransferReport'][_0x77fc('0x43')](_0x4f0601)[_0x77fc('0x23')](handleEntityNotFound(_0x1468e3,null))[_0x77fc('0x23')](respondWithResult(_0x1468e3,null))[_0x77fc('0x40')](handleError(_0x1468e3,null));};exports['create']=function(_0x4d853c,_0x238f15){return db['OpenchannelTransferReport'][_0x77fc('0x44')](_0x4d853c[_0x77fc('0x45')],{})[_0x77fc('0x23')](respondWithResult(_0x238f15,0xc9))['catch'](handleError(_0x238f15,null));};exports[_0x77fc('0x46')]=function(_0x148aac,_0x14ae2e){if(_0x148aac['body']['id']){delete _0x148aac[_0x77fc('0x45')]['id'];}return db[_0x77fc('0x2a')][_0x77fc('0x43')]({'where':{'id':_0x148aac['params']['id']}})[_0x77fc('0x23')](handleEntityNotFound(_0x14ae2e,null))[_0x77fc('0x23')](saveUpdates(_0x148aac[_0x77fc('0x45')],null))[_0x77fc('0x23')](respondWithResult(_0x14ae2e,null))[_0x77fc('0x40')](handleError(_0x14ae2e,null));};exports['destroy']=function(_0x502363,_0x2f3d33){return db[_0x77fc('0x2a')]['find']({'where':{'id':_0x502363[_0x77fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f3d33,null))[_0x77fc('0x23')](removeEntity(_0x2f3d33,null))[_0x77fc('0x40')](handleError(_0x2f3d33,null));};exports[_0x77fc('0x48')]=function(_0x3fac02,_0x5b0886){return db[_0x77fc('0x2a')][_0x77fc('0x48')]()['then'](respondWithResult(_0x5b0886,null))['catch'](handleError(_0x5b0886,null));};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js
index 740b2db..362cacd 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.model.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd101=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd101,0xc1));var _0x1d10=function(_0x3f1625,_0x129be7){_0x3f1625=_0x3f1625-0x0;var _0x23c6b3=_0xd101[_0x3f1625];return _0x23c6b3;};'use strict';var _=require(_0x1d10('0x0'));var util=require('util');var logger=require(_0x1d10('0x1'))(_0x1d10('0x2'));var moment=require(_0x1d10('0x3'));var BPromise=require(_0x1d10('0x4'));var rp=require(_0x1d10('0x5'));var fs=require('fs');var path=require(_0x1d10('0x6'));var rimraf=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0x1d10('0x9')]=function(_0x203072,_0x2a4e2d){return _0x203072[_0x1d10('0xa')](_0x1d10('0xb'),attributes,{'tableName':_0x1d10('0xc'),'paranoid':![],'indexes':[{'name':_0x1d10('0xd'),'fields':[_0x1d10('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe767=['api','moment','bluebird','request-promise','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger'];(function(_0x2ed141,_0x498532){var _0x749ec=function(_0x252028){while(--_0x252028){_0x2ed141['push'](_0x2ed141['shift']());}};_0x749ec(++_0x498532);}(_0xe767,0x11e));var _0x7e76=function(_0x55907b,_0xfd6ded){_0x55907b=_0x55907b-0x0;var _0x4403a8=_0xe767[_0x55907b];return _0x4403a8;};'use strict';var _=require('lodash');var util=require(_0x7e76('0x0'));var logger=require(_0x7e76('0x1'))(_0x7e76('0x2'));var moment=require(_0x7e76('0x3'));var BPromise=require(_0x7e76('0x4'));var rp=require(_0x7e76('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7e76('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x7e76('0x7')]=function(_0x5d179a,_0x333c38){return _0x5d179a[_0x7e76('0x8')](_0x7e76('0x9'),attributes,{'tableName':_0x7e76('0xa'),'paranoid':![],'indexes':[{'name':_0x7e76('0xb'),'fields':[_0x7e76('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
index 69c2ff3..6fddfdc 100644
--- a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
+++ b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49fe=['OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x1720e9,_0x2a58c3){var _0x3dd033=function(_0x113d0a){while(--_0x113d0a){_0x1720e9['push'](_0x1720e9['shift']());}};_0x3dd033(++_0x2a58c3);}(_0x49fe,0x100));var _0xe49f=function(_0x586ebd,_0x46ad6c){_0x586ebd=_0x586ebd-0x0;var _0x27d592=_0x49fe[_0x586ebd];return _0x27d592;};'use strict';var _=require(_0xe49f('0x0'));var util=require(_0xe49f('0x1'));var moment=require(_0xe49f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe49f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe49f('0x4'));var logger=require(_0xe49f('0x5'))(_0xe49f('0x6'));var config=require(_0xe49f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe49f('0x8')][_0xe49f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbef6f5,_0x26eac9,_0x4f9b1f){return new BPromise(function(_0x384c48,_0x18f791){return client[_0xe49f('0xa')](_0xbef6f5,_0x4f9b1f)[_0xe49f('0xb')](function(_0x826f00){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x26eac9,_0xe49f('0xc'));logger[_0xe49f('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x26eac9,'request\x20sent',JSON[_0xe49f('0xe')](_0x826f00));if(_0x826f00[_0xe49f('0xf')]){if(_0x826f00[_0xe49f('0xf')][_0xe49f('0x10')]===0x1f4){logger[_0xe49f('0xf')](_0xe49f('0x11'),_0x26eac9,_0x826f00['error']['message']);return _0x18f791(_0x826f00[_0xe49f('0xf')][_0xe49f('0x12')]);}logger[_0xe49f('0xf')](_0xe49f('0x11'),_0x26eac9,_0x826f00[_0xe49f('0xf')]['message']);return _0x384c48(_0x826f00[_0xe49f('0xf')][_0xe49f('0x12')]);}else{logger[_0xe49f('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x26eac9,_0xe49f('0xc'));_0x384c48(_0x826f00[_0xe49f('0x14')][_0xe49f('0x12')]);}})['catch'](function(_0xcb0d16){logger[_0xe49f('0xf')](_0xe49f('0x11'),_0x26eac9,_0xcb0d16);_0x18f791(_0xcb0d16);});});}
\ No newline at end of file
+var _0x908e=['request\x20sent','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xf44f15,_0x2a03f3){var _0x2f0c7b=function(_0x43b8c4){while(--_0x43b8c4){_0xf44f15['push'](_0xf44f15['shift']());}};_0x2f0c7b(++_0x2a03f3);}(_0x908e,0x182));var _0xe908=function(_0x51f4f1,_0x4035f7){_0x51f4f1=_0x51f4f1-0x0;var _0x2656cb=_0x908e[_0x51f4f1];return _0x2656cb;};'use strict';var _=require(_0xe908('0x0'));var util=require(_0xe908('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe908('0x2'));var fs=require('fs');var Redis=require(_0xe908('0x3'));var db=require(_0xe908('0x4'))['db'];var utils=require(_0xe908('0x5'));var logger=require('../../config/logger')(_0xe908('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe908('0x7')][_0xe908('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2df114,_0x1f6cd2,_0x7a1fdd){return new BPromise(function(_0x6e8920,_0x57dacd){return client[_0xe908('0x9')](_0x2df114,_0x7a1fdd)['then'](function(_0xab6e38){logger[_0xe908('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6cd2,'request\x20sent');logger[_0xe908('0xb')](_0xe908('0xc'),_0x1f6cd2,_0xe908('0xd'),JSON[_0xe908('0xe')](_0xab6e38));if(_0xab6e38[_0xe908('0xf')]){if(_0xab6e38[_0xe908('0xf')][_0xe908('0x10')]===0x1f4){logger[_0xe908('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6cd2,_0xab6e38['error'][_0xe908('0x11')]);return _0x57dacd(_0xab6e38['error'][_0xe908('0x11')]);}logger[_0xe908('0xf')](_0xe908('0x12'),_0x1f6cd2,_0xab6e38[_0xe908('0xf')][_0xe908('0x11')]);return _0x6e8920(_0xab6e38['error'][_0xe908('0x11')]);}else{logger[_0xe908('0xa')](_0xe908('0x12'),_0x1f6cd2,_0xe908('0xd'));_0x6e8920(_0xab6e38['result']['message']);}})['catch'](function(_0x2aead7){logger[_0xe908('0xf')](_0xe908('0x12'),_0x1f6cd2,_0x2aead7);_0x57dacd(_0x2aead7);});});}
\ No newline at end of file
diff --git a/server/api/pause/index.js b/server/api/pause/index.js
index 74600d1..cd1f5a9 100644
--- a/server/api/pause/index.js
+++ b/server/api/pause/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd196=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0xd196,0x185));var _0x6d19=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0xd196[_0x562faa];return _0xc70f59;};'use strict';var multer=require(_0x6d19('0x0'));var util=require(_0x6d19('0x1'));var path=require(_0x6d19('0x2'));var timeout=require(_0x6d19('0x3'));var express=require(_0x6d19('0x4'));var router=express[_0x6d19('0x5')]();var auth=require(_0x6d19('0x6'));var interaction=require(_0x6d19('0x7'));var config=require(_0x6d19('0x8'));var controller=require('./pause.controller');router[_0x6d19('0x9')]('/',auth[_0x6d19('0xa')](),controller[_0x6d19('0xb')]);router[_0x6d19('0x9')](_0x6d19('0xc'),auth[_0x6d19('0xa')](),controller[_0x6d19('0xd')]);router[_0x6d19('0xe')]('/',auth[_0x6d19('0xa')](),controller[_0x6d19('0xf')]);router[_0x6d19('0x10')](_0x6d19('0xc'),auth[_0x6d19('0xa')](),controller[_0x6d19('0x11')]);router[_0x6d19('0x12')]('/:id',auth[_0x6d19('0xa')](),controller[_0x6d19('0x13')]);module[_0x6d19('0x14')]=router;
\ No newline at end of file
+var _0xf4d1=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0xf4d1,0x18c));var _0x1f4d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf4d1[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x1f4d('0x0'));var path=require(_0x1f4d('0x1'));var timeout=require(_0x1f4d('0x2'));var express=require(_0x1f4d('0x3'));var router=express[_0x1f4d('0x4')]();var auth=require(_0x1f4d('0x5'));var interaction=require(_0x1f4d('0x6'));var config=require(_0x1f4d('0x7'));var controller=require(_0x1f4d('0x8'));router[_0x1f4d('0x9')]('/',auth['isAuthenticated'](),controller[_0x1f4d('0xa')]);router['get'](_0x1f4d('0xb'),auth[_0x1f4d('0xc')](),controller[_0x1f4d('0xd')]);router[_0x1f4d('0xe')]('/',auth[_0x1f4d('0xc')](),controller['create']);router[_0x1f4d('0xf')](_0x1f4d('0xb'),auth['isAuthenticated'](),controller[_0x1f4d('0x10')]);router[_0x1f4d('0x11')](_0x1f4d('0xb'),auth['isAuthenticated'](),controller[_0x1f4d('0x12')]);module[_0x1f4d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js
index 0cf2023..cf86993 100644
--- a/server/api/pause/pause.attributes.js
+++ b/server/api/pause/pause.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdcd0=['exports','STRING','name','sequelize'];(function(_0x11cb12,_0x47217b){var _0x1a5214=function(_0x576017){while(--_0x576017){_0x11cb12['push'](_0x11cb12['shift']());}};_0x1a5214(++_0x47217b);}(_0xdcd0,0xef));var _0x0dcd=function(_0x1f61bd,_0x533eb3){_0x1f61bd=_0x1f61bd-0x0;var _0xc1f48=_0xdcd0[_0x1f61bd];return _0xc1f48;};'use strict';var Sequelize=require(_0x0dcd('0x0'));module[_0x0dcd('0x1')]={'name':{'type':Sequelize[_0x0dcd('0x2')],'unique':_0x0dcd('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0dcd('0x2')]}};
\ No newline at end of file
+var _0x4e4e=['name','sequelize'];(function(_0x3a6476,_0x1bc3d5){var _0x19e47a=function(_0x51bd7d){while(--_0x51bd7d){_0x3a6476['push'](_0x3a6476['shift']());}};_0x19e47a(++_0x1bc3d5);}(_0x4e4e,0x199));var _0xe4e4=function(_0x2762e1,_0x57cb14){_0x2762e1=_0x2762e1-0x0;var _0x56ab65=_0x4e4e[_0x2762e1];return _0x56ab65;};'use strict';var Sequelize=require(_0xe4e4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xe4e4('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js
index ccb53b0..77069d9 100644
--- a/server/api/pause/pause.controller.js
+++ b/server/api/pause/pause.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa34b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','Pauses','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','count','includeAll','Pause','findAll','rows','catch','show','params','fields','find','create','body','get','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','ioredis'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa34b,0x16e));var _0xba34=function(_0x2709da,_0x523807){_0x2709da=_0x2709da-0x0;var _0x3ad523=_0xa34b[_0x2709da];return _0x3ad523;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xba34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba34('0x1'));var jsonpatch=require(_0xba34('0x2'));var rp=require(_0xba34('0x3'));var moment=require(_0xba34('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xba34('0x5'));var util=require(_0xba34('0x6'));var path=require(_0xba34('0x7'));var sox=require('sox');var csv=require(_0xba34('0x8'));var ejs=require(_0xba34('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xba34('0xa'));var crypto=require(_0xba34('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xba34('0xc'));var toCsv=require(_0xba34('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xba34('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xba34('0xe'));var as=require(_0xba34('0xf'));var hardwareService=require(_0xba34('0x10'));var logger=require(_0xba34('0x11'))('api');var utils=require(_0xba34('0x12'));var config=require(_0xba34('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d4cbf,_0x5e7958){_0x5e7958=_0x5e7958||0xcc;return function(_0x593d0b){if(_0x593d0b){return _0x1d4cbf[_0xba34('0x14')](_0x5e7958);}return _0x1d4cbf[_0xba34('0x15')](_0x5e7958)[_0xba34('0x16')]();};}function respondWithResult(_0x3acc54,_0x49cec1){_0x49cec1=_0x49cec1||0xc8;return function(_0x395e08){if(_0x395e08){return _0x3acc54[_0xba34('0x15')](_0x49cec1)[_0xba34('0x17')](_0x395e08);}};}function respondWithFilteredResult(_0x82cebc,_0x1573e5){return function(_0x6c24f7){if(_0x6c24f7){var _0x2db3b6=_0x6c24f7['count'],_0xd8070a=_0x1573e5['offset'],_0x36c364=_0x1573e5[_0xba34('0x18')]+_0x1573e5[_0xba34('0x19')],_0x5cac64;if(_0x36c364>=_0x2db3b6){_0x36c364=_0x2db3b6;_0x5cac64=0xc8;}else{_0x5cac64=0xce;}_0x82cebc['status'](_0x5cac64);return _0x82cebc[_0xba34('0x1a')](_0xba34('0x1b'),_0xd8070a+'-'+_0x36c364+'/'+_0x2db3b6)['json'](_0x6c24f7);}return null;};}function patchUpdates(_0x5e19ee){return function(_0x452af8){try{jsonpatch[_0xba34('0x1c')](_0x452af8,_0x5e19ee,!![]);}catch(_0xd8e8e0){return BPromise[_0xba34('0x1d')](_0xd8e8e0);}return _0x452af8[_0xba34('0x1e')]();};}function saveUpdates(_0x2db5bd,_0x45878){return function(_0x20165d){if(_0x20165d){return _0x20165d[_0xba34('0x1f')](_0x2db5bd)[_0xba34('0x20')](function(_0xa02c2e){return _0xa02c2e;});}return null;};}function removeEntity(_0x4a1ecf,_0x320b28){return function(_0x409923){if(_0x409923){return _0x409923['destroy']()[_0xba34('0x20')](function(){var _0x5d80a9=_0x409923['get']({'plain':!![]});var _0x2bca44=_0xba34('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x2bca44,'resourceId':_0x5d80a9['id']}})['then'](function(){return _0x409923;});})[_0xba34('0x20')](function(){_0x4a1ecf[_0xba34('0x15')](0xcc)[_0xba34('0x16')]();});}};}function handleEntityNotFound(_0x5efbe7,_0x2f099d){return function(_0x2baa73){if(!_0x2baa73){_0x5efbe7['sendStatus'](0x194);}return _0x2baa73;};}function handleError(_0x3934a2,_0x1d4e83){_0x1d4e83=_0x1d4e83||0x1f4;return function(_0x3eab91){logger[_0xba34('0x22')](_0x3eab91['stack']);if(_0x3eab91[_0xba34('0x23')]){delete _0x3eab91[_0xba34('0x23')];}_0x3934a2[_0xba34('0x15')](_0x1d4e83)[_0xba34('0x24')](_0x3eab91);};}exports[_0xba34('0x25')]=function(_0x23157e,_0x2de112){var _0xfd758f={},_0x2013cd={},_0x1f57bf={'count':0x0,'rows':[]};var _0x5c6742=_[_0xba34('0x26')](db['Pause'][_0xba34('0x27')],function(_0x645d7b){return{'name':_0x645d7b[_0xba34('0x28')],'type':_0x645d7b[_0xba34('0x29')]['key']};});_0x2013cd[_0xba34('0x2a')]=_[_0xba34('0x26')](_0x5c6742,'name');_0x2013cd[_0xba34('0x2b')]=_[_0xba34('0x2c')](_0x23157e[_0xba34('0x2b')]);_0x2013cd[_0xba34('0x2d')]=_[_0xba34('0x2e')](_0x2013cd[_0xba34('0x2a')],_0x2013cd[_0xba34('0x2b')]);_0xfd758f[_0xba34('0x2f')]=_[_0xba34('0x2e')](_0x2013cd[_0xba34('0x2a')],qs['fields'](_0x23157e[_0xba34('0x2b')]['fields']));_0xfd758f['attributes']=_0xfd758f[_0xba34('0x2f')][_0xba34('0x30')]?_0xfd758f[_0xba34('0x2f')]:_0x2013cd[_0xba34('0x2a')];if(!_0x23157e['query'][_0xba34('0x31')](_0xba34('0x32'))){_0xfd758f['limit']=qs[_0xba34('0x19')](_0x23157e[_0xba34('0x2b')][_0xba34('0x19')]);_0xfd758f[_0xba34('0x18')]=qs['offset'](_0x23157e[_0xba34('0x2b')]['offset']);}_0xfd758f[_0xba34('0x33')]=qs[_0xba34('0x34')](_0x23157e[_0xba34('0x2b')][_0xba34('0x34')]);_0xfd758f['where']=qs[_0xba34('0x2d')](_['pick'](_0x23157e[_0xba34('0x2b')],_0x2013cd[_0xba34('0x2d')]),_0x5c6742);if(_0x23157e[_0xba34('0x2b')][_0xba34('0x35')]){_0xfd758f['where']=_[_0xba34('0x36')](_0xfd758f[_0xba34('0x37')],{'$or':_[_0xba34('0x26')](_0x5c6742,function(_0x2270e7){if(_0x2270e7[_0xba34('0x29')]!=='VIRTUAL'){var _0x171f67={};_0x171f67[_0x2270e7[_0xba34('0x23')]]={'$like':'%'+_0x23157e[_0xba34('0x2b')][_0xba34('0x35')]+'%'};return _0x171f67;}})});}_0xfd758f=_['merge']({},_0xfd758f,_0x23157e[_0xba34('0x38')]);var _0x4527f9={'where':_0xfd758f[_0xba34('0x37')]};return db['Pause'][_0xba34('0x39')](_0x4527f9)[_0xba34('0x20')](function(_0x442c3f){_0x1f57bf[_0xba34('0x39')]=_0x442c3f;if(_0x23157e[_0xba34('0x2b')][_0xba34('0x3a')]){_0xfd758f['include']=[{'all':!![]}];}return db[_0xba34('0x3b')][_0xba34('0x3c')](_0xfd758f);})['then'](function(_0x4f3e8c){_0x1f57bf[_0xba34('0x3d')]=_0x4f3e8c;return _0x1f57bf;})['then'](respondWithFilteredResult(_0x2de112,_0xfd758f))[_0xba34('0x3e')](handleError(_0x2de112,null));};exports[_0xba34('0x3f')]=function(_0x6c5c9a,_0xb8a74d){var _0x39c57e={'raw':!![],'where':{'id':_0x6c5c9a[_0xba34('0x40')]['id']}},_0x4035d3={};_0x4035d3[_0xba34('0x2a')]=_[_0xba34('0x2c')](db[_0xba34('0x3b')][_0xba34('0x27')]);_0x4035d3[_0xba34('0x2b')]=_[_0xba34('0x2c')](_0x6c5c9a[_0xba34('0x2b')]);_0x4035d3[_0xba34('0x2d')]=_[_0xba34('0x2e')](_0x4035d3[_0xba34('0x2a')],_0x4035d3[_0xba34('0x2b')]);_0x39c57e['attributes']=_[_0xba34('0x2e')](_0x4035d3[_0xba34('0x2a')],qs[_0xba34('0x41')](_0x6c5c9a[_0xba34('0x2b')][_0xba34('0x41')]));_0x39c57e[_0xba34('0x2f')]=_0x39c57e[_0xba34('0x2f')][_0xba34('0x30')]?_0x39c57e[_0xba34('0x2f')]:_0x4035d3[_0xba34('0x2a')];if(_0x6c5c9a[_0xba34('0x2b')][_0xba34('0x3a')]){_0x39c57e['include']=[{'all':!![]}];}_0x39c57e=_[_0xba34('0x36')]({},_0x39c57e,_0x6c5c9a['options']);return db[_0xba34('0x3b')][_0xba34('0x42')](_0x39c57e)[_0xba34('0x20')](handleEntityNotFound(_0xb8a74d,null))[_0xba34('0x20')](respondWithResult(_0xb8a74d,null))[_0xba34('0x3e')](handleError(_0xb8a74d,null));};exports[_0xba34('0x43')]=function(_0x2a7213,_0x4e5715){return db[_0xba34('0x3b')][_0xba34('0x43')](_0x2a7213[_0xba34('0x44')],{})['then'](function(_0x2d5f1f){var _0x450350=_0x2a7213['user'][_0xba34('0x45')]({'plain':!![]});if(!_0x450350)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x450350['role']===_0xba34('0x46')){var _0x446b64=_0x2d5f1f['get']({'plain':!![]});var _0x133f9a=_0xba34('0x21');return db[_0xba34('0x47')][_0xba34('0x42')]({'where':{'name':_0x133f9a,'userProfileId':_0x450350[_0xba34('0x48')]},'raw':!![]})[_0xba34('0x20')](function(_0x546a77){if(_0x546a77&&_0x546a77['autoAssociation']===0x0){return db[_0xba34('0x49')][_0xba34('0x43')]({'name':_0x446b64[_0xba34('0x23')],'resourceId':_0x446b64['id'],'type':_0x546a77[_0xba34('0x23')],'sectionId':_0x546a77['id']},{})['then'](function(){return _0x2d5f1f;});}else{return _0x2d5f1f;}})[_0xba34('0x3e')](function(_0x394879){logger[_0xba34('0x22')](_0xba34('0x4a'),_0x394879);throw _0x394879;});}return _0x2d5f1f;})[_0xba34('0x20')](respondWithResult(_0x4e5715,0xc9))[_0xba34('0x3e')](handleError(_0x4e5715,null));};exports['update']=function(_0x18203d,_0x323af0){if(_0x18203d['body']['id']){delete _0x18203d['body']['id'];}return db[_0xba34('0x3b')][_0xba34('0x42')]({'where':{'id':_0x18203d[_0xba34('0x40')]['id']}})[_0xba34('0x20')](handleEntityNotFound(_0x323af0,null))[_0xba34('0x20')](saveUpdates(_0x18203d[_0xba34('0x44')],null))[_0xba34('0x20')](respondWithResult(_0x323af0,null))[_0xba34('0x3e')](handleError(_0x323af0,null));};exports[_0xba34('0x4b')]=function(_0x5a1a8e,_0x1eb316){return db[_0xba34('0x3b')]['find']({'where':{'id':_0x5a1a8e[_0xba34('0x40')]['id']}})['then'](handleEntityNotFound(_0x1eb316,null))['then'](removeEntity(_0x1eb316,null))[_0xba34('0x3e')](handleError(_0x1eb316,null));};
\ No newline at end of file
+var _0xe326=['stack','name','send','index','map','Pause','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','options','include','findAll','rows','catch','show','keys','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Pauses','sendStatus','error'];(function(_0x1282a0,_0x58b2f9){var _0x18af0c=function(_0x5ac73f){while(--_0x5ac73f){_0x1282a0['push'](_0x1282a0['shift']());}};_0x18af0c(++_0x58b2f9);}(_0xe326,0x176));var _0x6e32=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0xe326[_0x532d78];return _0x5990c4;};'use strict';var pdf=require(_0x6e32('0x0'));var emlformat=require(_0x6e32('0x1'));var rimraf=require(_0x6e32('0x2'));var zipdir=require(_0x6e32('0x3'));var jsonpatch=require(_0x6e32('0x4'));var rp=require(_0x6e32('0x5'));var moment=require(_0x6e32('0x6'));var BPromise=require(_0x6e32('0x7'));var Mustache=require(_0x6e32('0x8'));var util=require('util');var path=require(_0x6e32('0x9'));var sox=require(_0x6e32('0xa'));var csv=require(_0x6e32('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6e32('0xc'));var squel=require(_0x6e32('0xd'));var crypto=require(_0x6e32('0xe'));var jsforce=require(_0x6e32('0xf'));var deskjs=require(_0x6e32('0x10'));var toCsv=require(_0x6e32('0xb'));var querystring=require(_0x6e32('0x11'));var Papa=require(_0x6e32('0x12'));var Redis=require(_0x6e32('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6e32('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e32('0x15'))(_0x6e32('0x16'));var utils=require(_0x6e32('0x17'));var config=require(_0x6e32('0x18'));var db=require(_0x6e32('0x19'))['db'];function respondWithStatusCode(_0x267b1b,_0x51e873){_0x51e873=_0x51e873||0xcc;return function(_0x41e472){if(_0x41e472){return _0x267b1b['sendStatus'](_0x51e873);}return _0x267b1b['status'](_0x51e873)['end']();};}function respondWithResult(_0x332f19,_0x5db766){_0x5db766=_0x5db766||0xc8;return function(_0x4279dd){if(_0x4279dd){return _0x332f19[_0x6e32('0x1a')](_0x5db766)['json'](_0x4279dd);}};}function respondWithFilteredResult(_0x39a91f,_0xc6453f){return function(_0xef94e7){if(_0xef94e7){var _0x4df700=_0xef94e7[_0x6e32('0x1b')],_0x28158c=_0xc6453f[_0x6e32('0x1c')],_0x1c0612=_0xc6453f[_0x6e32('0x1c')]+_0xc6453f[_0x6e32('0x1d')],_0x55cd81;if(_0x1c0612>=_0x4df700){_0x1c0612=_0x4df700;_0x55cd81=0xc8;}else{_0x55cd81=0xce;}_0x39a91f[_0x6e32('0x1a')](_0x55cd81);return _0x39a91f[_0x6e32('0x1e')](_0x6e32('0x1f'),_0x28158c+'-'+_0x1c0612+'/'+_0x4df700)['json'](_0xef94e7);}return null;};}function patchUpdates(_0x3a6f41){return function(_0x1f943d){try{jsonpatch[_0x6e32('0x20')](_0x1f943d,_0x3a6f41,!![]);}catch(_0x44c8f9){return BPromise['reject'](_0x44c8f9);}return _0x1f943d[_0x6e32('0x21')]();};}function saveUpdates(_0x444bf1,_0x4a0930){return function(_0x4cb213){if(_0x4cb213){return _0x4cb213[_0x6e32('0x22')](_0x444bf1)[_0x6e32('0x23')](function(_0x1b957d){return _0x1b957d;});}return null;};}function removeEntity(_0x38eef9,_0x97f158){return function(_0x419429){if(_0x419429){return _0x419429[_0x6e32('0x24')]()[_0x6e32('0x23')](function(){var _0x38458e=_0x419429[_0x6e32('0x25')]({'plain':!![]});var _0x4606c7=_0x6e32('0x26');return db['UserProfileResource'][_0x6e32('0x24')]({'where':{'type':_0x4606c7,'resourceId':_0x38458e['id']}})[_0x6e32('0x23')](function(){return _0x419429;});})[_0x6e32('0x23')](function(){_0x38eef9[_0x6e32('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ee08a,_0x418e38){return function(_0x10f077){if(!_0x10f077){_0x4ee08a[_0x6e32('0x27')](0x194);}return _0x10f077;};}function handleError(_0x312212,_0x18e5a1){_0x18e5a1=_0x18e5a1||0x1f4;return function(_0x1e0535){logger[_0x6e32('0x28')](_0x1e0535[_0x6e32('0x29')]);if(_0x1e0535['name']){delete _0x1e0535[_0x6e32('0x2a')];}_0x312212[_0x6e32('0x1a')](_0x18e5a1)[_0x6e32('0x2b')](_0x1e0535);};}exports[_0x6e32('0x2c')]=function(_0x3f579c,_0xe271e1){var _0x296fbd={},_0x35a635={},_0x2a8f40={'count':0x0,'rows':[]};var _0x8aac4b=_[_0x6e32('0x2d')](db[_0x6e32('0x2e')]['rawAttributes'],function(_0x193910){return{'name':_0x193910['fieldName'],'type':_0x193910['type'][_0x6e32('0x2f')]};});_0x35a635[_0x6e32('0x30')]=_[_0x6e32('0x2d')](_0x8aac4b,'name');_0x35a635['query']=_['keys'](_0x3f579c[_0x6e32('0x31')]);_0x35a635['filters']=_[_0x6e32('0x32')](_0x35a635[_0x6e32('0x30')],_0x35a635[_0x6e32('0x31')]);_0x296fbd[_0x6e32('0x33')]=_[_0x6e32('0x32')](_0x35a635[_0x6e32('0x30')],qs['fields'](_0x3f579c[_0x6e32('0x31')][_0x6e32('0x34')]));_0x296fbd[_0x6e32('0x33')]=_0x296fbd['attributes'][_0x6e32('0x35')]?_0x296fbd['attributes']:_0x35a635[_0x6e32('0x30')];if(!_0x3f579c[_0x6e32('0x31')][_0x6e32('0x36')](_0x6e32('0x37'))){_0x296fbd[_0x6e32('0x1d')]=qs[_0x6e32('0x1d')](_0x3f579c[_0x6e32('0x31')][_0x6e32('0x1d')]);_0x296fbd[_0x6e32('0x1c')]=qs[_0x6e32('0x1c')](_0x3f579c[_0x6e32('0x31')]['offset']);}_0x296fbd['order']=qs[_0x6e32('0x38')](_0x3f579c['query'][_0x6e32('0x38')]);_0x296fbd[_0x6e32('0x39')]=qs[_0x6e32('0x3a')](_[_0x6e32('0x3b')](_0x3f579c[_0x6e32('0x31')],_0x35a635[_0x6e32('0x3a')]),_0x8aac4b);if(_0x3f579c[_0x6e32('0x31')][_0x6e32('0x3c')]){_0x296fbd[_0x6e32('0x39')]=_['merge'](_0x296fbd[_0x6e32('0x39')],{'$or':_[_0x6e32('0x2d')](_0x8aac4b,function(_0x4c339c){if(_0x4c339c[_0x6e32('0x3d')]!==_0x6e32('0x3e')){var _0xd183af={};_0xd183af[_0x4c339c[_0x6e32('0x2a')]]={'$like':'%'+_0x3f579c[_0x6e32('0x31')]['filter']+'%'};return _0xd183af;}})});}_0x296fbd=_['merge']({},_0x296fbd,_0x3f579c[_0x6e32('0x3f')]);var _0x9e40f7={'where':_0x296fbd[_0x6e32('0x39')]};return db['Pause'][_0x6e32('0x1b')](_0x9e40f7)[_0x6e32('0x23')](function(_0x5bee95){_0x2a8f40[_0x6e32('0x1b')]=_0x5bee95;if(_0x3f579c[_0x6e32('0x31')]['includeAll']){_0x296fbd[_0x6e32('0x40')]=[{'all':!![]}];}return db[_0x6e32('0x2e')][_0x6e32('0x41')](_0x296fbd);})['then'](function(_0x423784){_0x2a8f40[_0x6e32('0x42')]=_0x423784;return _0x2a8f40;})[_0x6e32('0x23')](respondWithFilteredResult(_0xe271e1,_0x296fbd))[_0x6e32('0x43')](handleError(_0xe271e1,null));};exports[_0x6e32('0x44')]=function(_0x16db3c,_0x1f9e41){var _0x38be0c={'raw':!![],'where':{'id':_0x16db3c['params']['id']}},_0x6fb725={};_0x6fb725['model']=_[_0x6e32('0x45')](db[_0x6e32('0x2e')]['rawAttributes']);_0x6fb725[_0x6e32('0x31')]=_[_0x6e32('0x45')](_0x16db3c[_0x6e32('0x31')]);_0x6fb725['filters']=_[_0x6e32('0x32')](_0x6fb725[_0x6e32('0x30')],_0x6fb725['query']);_0x38be0c[_0x6e32('0x33')]=_[_0x6e32('0x32')](_0x6fb725[_0x6e32('0x30')],qs[_0x6e32('0x34')](_0x16db3c[_0x6e32('0x31')]['fields']));_0x38be0c[_0x6e32('0x33')]=_0x38be0c[_0x6e32('0x33')]['length']?_0x38be0c[_0x6e32('0x33')]:_0x6fb725[_0x6e32('0x30')];if(_0x16db3c[_0x6e32('0x31')]['includeAll']){_0x38be0c[_0x6e32('0x40')]=[{'all':!![]}];}_0x38be0c=_[_0x6e32('0x46')]({},_0x38be0c,_0x16db3c[_0x6e32('0x3f')]);return db[_0x6e32('0x2e')]['find'](_0x38be0c)[_0x6e32('0x23')](handleEntityNotFound(_0x1f9e41,null))['then'](respondWithResult(_0x1f9e41,null))['catch'](handleError(_0x1f9e41,null));};exports['create']=function(_0x392642,_0x37f0f6){return db[_0x6e32('0x2e')][_0x6e32('0x47')](_0x392642[_0x6e32('0x48')],{})[_0x6e32('0x23')](function(_0x13af77){var _0x3f1142=_0x392642['user'][_0x6e32('0x25')]({'plain':!![]});if(!_0x3f1142)throw new Error(_0x6e32('0x49'));if(_0x3f1142[_0x6e32('0x4a')]===_0x6e32('0x4b')){var _0x230200=_0x13af77[_0x6e32('0x25')]({'plain':!![]});var _0x2219d7=_0x6e32('0x26');return db[_0x6e32('0x4c')][_0x6e32('0x4d')]({'where':{'name':_0x2219d7,'userProfileId':_0x3f1142[_0x6e32('0x4e')]},'raw':!![]})['then'](function(_0x57898e){if(_0x57898e&&_0x57898e[_0x6e32('0x4f')]===0x0){return db[_0x6e32('0x50')]['create']({'name':_0x230200[_0x6e32('0x2a')],'resourceId':_0x230200['id'],'type':_0x57898e[_0x6e32('0x2a')],'sectionId':_0x57898e['id']},{})[_0x6e32('0x23')](function(){return _0x13af77;});}else{return _0x13af77;}})[_0x6e32('0x43')](function(_0x1fd0df){logger[_0x6e32('0x28')](_0x6e32('0x51'),_0x1fd0df);throw _0x1fd0df;});}return _0x13af77;})[_0x6e32('0x23')](respondWithResult(_0x37f0f6,0xc9))[_0x6e32('0x43')](handleError(_0x37f0f6,null));};exports[_0x6e32('0x22')]=function(_0x22e8dc,_0x317565){if(_0x22e8dc[_0x6e32('0x48')]['id']){delete _0x22e8dc[_0x6e32('0x48')]['id'];}return db[_0x6e32('0x2e')][_0x6e32('0x4d')]({'where':{'id':_0x22e8dc[_0x6e32('0x52')]['id']}})[_0x6e32('0x23')](handleEntityNotFound(_0x317565,null))[_0x6e32('0x23')](saveUpdates(_0x22e8dc['body'],null))[_0x6e32('0x23')](respondWithResult(_0x317565,null))[_0x6e32('0x43')](handleError(_0x317565,null));};exports[_0x6e32('0x24')]=function(_0x35f337,_0x278485){return db[_0x6e32('0x2e')][_0x6e32('0x4d')]({'where':{'id':_0x35f337[_0x6e32('0x52')]['id']}})[_0x6e32('0x23')](handleEntityNotFound(_0x278485,null))[_0x6e32('0x23')](removeEntity(_0x278485,null))['catch'](handleError(_0x278485,null));};
\ No newline at end of file
diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js
index 9792378..b5cf28f 100644
--- a/server/api/pause/pause.model.js
+++ b/server/api/pause/pause.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4180=['request-promise','path','rimraf','exports','define','Pause','lodash','../../config/logger','api','bluebird'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x4180,0x7e));var _0x0418=function(_0x1e476b,_0x4ac7b3){_0x1e476b=_0x1e476b-0x0;var _0x4a75b2=_0x4180[_0x1e476b];return _0x4a75b2;};'use strict';var _=require(_0x0418('0x0'));var util=require('util');var logger=require(_0x0418('0x1'))(_0x0418('0x2'));var moment=require('moment');var BPromise=require(_0x0418('0x3'));var rp=require(_0x0418('0x4'));var fs=require('fs');var path=require(_0x0418('0x5'));var rimraf=require(_0x0418('0x6'));var config=require('../../config/environment');var attributes=require('./pause.attributes');module[_0x0418('0x7')]=function(_0x4a86f8,_0x5af629){return _0x4a86f8[_0x0418('0x8')](_0x0418('0x9'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc5bd=['request-promise','rimraf','../../config/environment','exports','tools_pauses','util','../../config/logger','api','moment'];(function(_0x460789,_0x42457a){var _0x3049da=function(_0x33b777){while(--_0x33b777){_0x460789['push'](_0x460789['shift']());}};_0x3049da(++_0x42457a);}(_0xc5bd,0x17f));var _0xdc5b=function(_0xab8601,_0xc272ca){_0xab8601=_0xab8601-0x0;var _0x4c28ca=_0xc5bd[_0xab8601];return _0x4c28ca;};'use strict';var _=require('lodash');var util=require(_0xdc5b('0x0'));var logger=require(_0xdc5b('0x1'))(_0xdc5b('0x2'));var moment=require(_0xdc5b('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc5b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc5b('0x5'));var config=require(_0xdc5b('0x6'));var attributes=require('./pause.attributes');module[_0xdc5b('0x7')]=function(_0x505475,_0x5d9408){return _0x505475['define']('Pause',attributes,{'tableName':_0xdc5b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js
index 342422f..da49312 100644
--- a/server/api/pause/pause.rpc.js
+++ b/server/api/pause/pause.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebb1=['options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','client','http','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowPause','Pause','find'];(function(_0xc944b8,_0x70f7e5){var _0x2d2f4c=function(_0x5eaca1){while(--_0x5eaca1){_0xc944b8['push'](_0xc944b8['shift']());}};_0x2d2f4c(++_0x70f7e5);}(_0xebb1,0x1d8));var _0x1ebb=function(_0x5bce5e,_0x54df30){_0x5bce5e=_0x5bce5e-0x0;var _0x4d205e=_0xebb1[_0x5bce5e];return _0x4d205e;};'use strict';var _=require(_0x1ebb('0x0'));var util=require(_0x1ebb('0x1'));var moment=require(_0x1ebb('0x2'));var BPromise=require(_0x1ebb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ebb('0x4'))['db'];var utils=require(_0x1ebb('0x5'));var logger=require('../../config/logger')(_0x1ebb('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ebb('0x7')][_0x1ebb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e8e0a,_0x5cf79e,_0x4eaad1){return new BPromise(function(_0x2e957c,_0x14add6){return client['request'](_0x2e8e0a,_0x4eaad1)[_0x1ebb('0x9')](function(_0x2244fd){logger[_0x1ebb('0xa')](_0x1ebb('0xb'),_0x5cf79e,_0x1ebb('0xc'));logger[_0x1ebb('0xd')](_0x1ebb('0xe'),_0x5cf79e,_0x1ebb('0xc'),JSON[_0x1ebb('0xf')](_0x2244fd));if(_0x2244fd['error']){if(_0x2244fd[_0x1ebb('0x10')][_0x1ebb('0x11')]===0x1f4){logger[_0x1ebb('0x10')](_0x1ebb('0xb'),_0x5cf79e,_0x2244fd[_0x1ebb('0x10')][_0x1ebb('0x12')]);return _0x14add6(_0x2244fd[_0x1ebb('0x10')]['message']);}logger[_0x1ebb('0x10')]('Pause,\x20%s,\x20%s',_0x5cf79e,_0x2244fd[_0x1ebb('0x10')][_0x1ebb('0x12')]);return _0x2e957c(_0x2244fd['error'][_0x1ebb('0x12')]);}else{logger[_0x1ebb('0xa')](_0x1ebb('0xb'),_0x5cf79e,_0x1ebb('0xc'));_0x2e957c(_0x2244fd[_0x1ebb('0x13')][_0x1ebb('0x12')]);}})[_0x1ebb('0x14')](function(_0x2444e1){logger[_0x1ebb('0x10')](_0x1ebb('0xb'),_0x5cf79e,_0x2444e1);_0x14add6(_0x2444e1);});});}exports[_0x1ebb('0x15')]=function(_0x1dc441){var _0x3eb2fc=this;return new Promise(function(_0x5b82cb,_0x10b985){return db[_0x1ebb('0x16')][_0x1ebb('0x17')]({'raw':_0x1dc441[_0x1ebb('0x18')]?_0x1dc441[_0x1ebb('0x18')][_0x1ebb('0x19')]===undefined?!![]:![]:!![],'where':_0x1dc441[_0x1ebb('0x18')]?_0x1dc441[_0x1ebb('0x18')][_0x1ebb('0x1a')]||null:null,'attributes':_0x1dc441[_0x1ebb('0x18')]?_0x1dc441[_0x1ebb('0x18')][_0x1ebb('0x1b')]||null:null,'include':_0x1dc441[_0x1ebb('0x18')]?_0x1dc441[_0x1ebb('0x18')]['include']?_[_0x1ebb('0x1c')](_0x1dc441[_0x1ebb('0x18')][_0x1ebb('0x1d')],function(_0x5e2578){return{'model':db[_0x5e2578['model']],'as':_0x5e2578['as'],'attributes':_0x5e2578['attributes'],'include':_0x5e2578[_0x1ebb('0x1d')]?_[_0x1ebb('0x1c')](_0x5e2578['include'],function(_0x5eb6f){return{'model':db[_0x5eb6f[_0x1ebb('0x1e')]],'as':_0x5eb6f['as'],'attributes':_0x5eb6f['attributes'],'include':_0x5eb6f['include']?_[_0x1ebb('0x1c')](_0x5eb6f[_0x1ebb('0x1d')],function(_0x300c8c){return{'model':db[_0x300c8c[_0x1ebb('0x1e')]],'as':_0x300c8c['as'],'attributes':_0x300c8c[_0x1ebb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1ebb('0x9')](function(_0x46f66f){logger['info'](_0x1ebb('0x15'),_0x1dc441);logger[_0x1ebb('0xd')]('ShowPause',_0x1dc441,JSON[_0x1ebb('0xf')](_0x46f66f));_0x5b82cb(_0x46f66f);})[_0x1ebb('0x14')](function(_0xdb1ebd){logger[_0x1ebb('0x10')]('ShowPause',_0xdb1ebd[_0x1ebb('0x12')],_0x1dc441);_0x10b985(_0x3eb2fc[_0x1ebb('0x10')](0x1f4,_0xdb1ebd['message']));});});};
\ No newline at end of file
+var _0x5573=['attributes','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowPause','find','options','raw','where','map','include','model'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x5573,0x85));var _0x3557=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0x5573[_0x87506e];return _0x5496a4;};'use strict';var _=require(_0x3557('0x0'));var util=require(_0x3557('0x1'));var moment=require(_0x3557('0x2'));var BPromise=require('bluebird');var rs=require(_0x3557('0x3'));var fs=require('fs');var Redis=require(_0x3557('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3557('0x5'))(_0x3557('0x6'));var config=require(_0x3557('0x7'));var jayson=require(_0x3557('0x8'));var client=jayson[_0x3557('0x9')][_0x3557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cfc85,_0x194f3a,_0x3cefd4){return new BPromise(function(_0x2c232f,_0x21e930){return client[_0x3557('0xb')](_0x5cfc85,_0x3cefd4)[_0x3557('0xc')](function(_0x432b12){logger[_0x3557('0xd')](_0x3557('0xe'),_0x194f3a,_0x3557('0xf'));logger[_0x3557('0x10')](_0x3557('0x11'),_0x194f3a,_0x3557('0xf'),JSON[_0x3557('0x12')](_0x432b12));if(_0x432b12['error']){if(_0x432b12[_0x3557('0x13')][_0x3557('0x14')]===0x1f4){logger[_0x3557('0x13')]('Pause,\x20%s,\x20%s',_0x194f3a,_0x432b12[_0x3557('0x13')]['message']);return _0x21e930(_0x432b12['error'][_0x3557('0x15')]);}logger[_0x3557('0x13')](_0x3557('0xe'),_0x194f3a,_0x432b12['error'][_0x3557('0x15')]);return _0x2c232f(_0x432b12[_0x3557('0x13')][_0x3557('0x15')]);}else{logger['info']('Pause,\x20%s,\x20%s',_0x194f3a,'request\x20sent');_0x2c232f(_0x432b12[_0x3557('0x16')]['message']);}})[_0x3557('0x17')](function(_0x40bbaa){logger[_0x3557('0x13')](_0x3557('0xe'),_0x194f3a,_0x40bbaa);_0x21e930(_0x40bbaa);});});}exports[_0x3557('0x18')]=function(_0x4e8738){var _0x55dfc9=this;return new Promise(function(_0x27c5e2,_0x5bbe40){return db['Pause'][_0x3557('0x19')]({'raw':_0x4e8738[_0x3557('0x1a')]?_0x4e8738[_0x3557('0x1a')][_0x3557('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e8738[_0x3557('0x1a')]?_0x4e8738['options'][_0x3557('0x1c')]||null:null,'attributes':_0x4e8738['options']?_0x4e8738[_0x3557('0x1a')]['attributes']||null:null,'include':_0x4e8738[_0x3557('0x1a')]?_0x4e8738[_0x3557('0x1a')]['include']?_[_0x3557('0x1d')](_0x4e8738['options']['include'],function(_0x56ab71){return{'model':db[_0x56ab71['model']],'as':_0x56ab71['as'],'attributes':_0x56ab71['attributes'],'include':_0x56ab71['include']?_[_0x3557('0x1d')](_0x56ab71[_0x3557('0x1e')],function(_0x2e2eee){return{'model':db[_0x2e2eee['model']],'as':_0x2e2eee['as'],'attributes':_0x2e2eee['attributes'],'include':_0x2e2eee[_0x3557('0x1e')]?_['map'](_0x2e2eee[_0x3557('0x1e')],function(_0x4963af){return{'model':db[_0x4963af[_0x3557('0x1f')]],'as':_0x4963af['as'],'attributes':_0x4963af[_0x3557('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37d3ef){logger['info'](_0x3557('0x18'),_0x4e8738);logger[_0x3557('0x10')](_0x3557('0x18'),_0x4e8738,JSON[_0x3557('0x12')](_0x37d3ef));_0x27c5e2(_0x37d3ef);})[_0x3557('0x17')](function(_0x3a7ffd){logger[_0x3557('0x13')]('ShowPause',_0x3a7ffd[_0x3557('0x15')],_0x4e8738);_0x5bbe40(_0x55dfc9[_0x3557('0x13')](0x1f4,_0x3a7ffd['message']));});});};
\ No newline at end of file
diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js
index 3397837..1fc8eac 100644
--- a/server/api/plugin/index.js
+++ b/server/api/plugin/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5abf=['extname','now','post','file','upload','webhookPost','put','update','delete','exports','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s'];(function(_0x599d3e,_0x25b9fa){var _0x48cd9e=function(_0x30e930){while(--_0x30e930){_0x599d3e['push'](_0x599d3e['shift']());}};_0x48cd9e(++_0x25b9fa);}(_0x5abf,0xd5));var _0xf5ab=function(_0x3cba93,_0x5c2fd8){_0x3cba93=_0x3cba93-0x0;var _0x4a2991=_0x5abf[_0x3cba93];return _0x4a2991;};'use strict';var multer=require('multer');var util=require(_0xf5ab('0x0'));var path=require(_0xf5ab('0x1'));var timeout=require(_0xf5ab('0x2'));var express=require('express');var router=express[_0xf5ab('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf5ab('0x4'));var controller=require('./plugin.controller');router[_0xf5ab('0x5')]('/',auth[_0xf5ab('0x6')](),controller['index']);router['get'](_0xf5ab('0x7'),controller['webhookGet']);router[_0xf5ab('0x5')](_0xf5ab('0x8'),auth['isAuthenticated'](),controller[_0xf5ab('0x9')]);router['get'](_0xf5ab('0xa'),auth[_0xf5ab('0x6')](),controller[_0xf5ab('0xb')]);var upload=multer({'storage':multer[_0xf5ab('0xc')]({'destination':function(_0x569723,_0x3c0408,_0x366745){_0x366745(null,path[_0xf5ab('0xd')](config[_0xf5ab('0xe')],_0xf5ab('0xf')));},'filename':function(_0x1fb069,_0x4bb7ab,_0x31983b){_0x4bb7ab['originalname']=_0x4bb7ab[_0xf5ab('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x31983b(null,util[_0xf5ab('0x11')](_0xf5ab('0x12'),path['basename'](_0x4bb7ab['originalname'],path[_0xf5ab('0x13')](_0x4bb7ab[_0xf5ab('0x10')])),Date[_0xf5ab('0x14')](),path[_0xf5ab('0x13')](_0x4bb7ab[_0xf5ab('0x10')])));}})});router[_0xf5ab('0x15')]('/',upload['single'](_0xf5ab('0x16')),controller[_0xf5ab('0x17')]);router[_0xf5ab('0x15')]('/webhook',controller[_0xf5ab('0x18')]);router[_0xf5ab('0x19')](_0xf5ab('0x8'),auth[_0xf5ab('0x6')](),controller[_0xf5ab('0x1a')]);router[_0xf5ab('0x1b')](_0xf5ab('0x8'),auth[_0xf5ab('0x6')](),controller[_0xf5ab('0x1b')]);module[_0xf5ab('0x1c')]=router;
\ No newline at end of file
+var _0xba37=['single','file','upload','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id/download','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post'];(function(_0x13c1ec,_0x31fe45){var _0x3df630=function(_0x2ec0ee){while(--_0x2ec0ee){_0x13c1ec['push'](_0x13c1ec['shift']());}};_0x3df630(++_0x31fe45);}(_0xba37,0xce));var _0x7ba3=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xba37[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0x7ba3('0x0'));var util=require('util');var path=require(_0x7ba3('0x1'));var timeout=require(_0x7ba3('0x2'));var express=require(_0x7ba3('0x3'));var router=express[_0x7ba3('0x4')]();var auth=require(_0x7ba3('0x5'));var interaction=require(_0x7ba3('0x6'));var config=require(_0x7ba3('0x7'));var controller=require(_0x7ba3('0x8'));router[_0x7ba3('0x9')]('/',auth[_0x7ba3('0xa')](),controller[_0x7ba3('0xb')]);router[_0x7ba3('0x9')](_0x7ba3('0xc'),controller[_0x7ba3('0xd')]);router['get']('/:id',auth[_0x7ba3('0xa')](),controller['show']);router[_0x7ba3('0x9')](_0x7ba3('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b5075,_0x170d7d,_0x120508){_0x120508(null,path[_0x7ba3('0xf')](config[_0x7ba3('0x10')],_0x7ba3('0x11')));},'filename':function(_0xaf5892,_0x3983b4,_0x382499){_0x3983b4[_0x7ba3('0x12')]=_0x3983b4[_0x7ba3('0x12')][_0x7ba3('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x382499(null,util[_0x7ba3('0x14')](_0x7ba3('0x15'),path[_0x7ba3('0x16')](_0x3983b4[_0x7ba3('0x12')],path[_0x7ba3('0x17')](_0x3983b4[_0x7ba3('0x12')])),Date['now'](),path[_0x7ba3('0x17')](_0x3983b4[_0x7ba3('0x12')])));}})});router[_0x7ba3('0x18')]('/',upload[_0x7ba3('0x19')](_0x7ba3('0x1a')),controller[_0x7ba3('0x1b')]);router[_0x7ba3('0x18')](_0x7ba3('0xc'),controller['webhookPost']);router[_0x7ba3('0x1c')](_0x7ba3('0x1d'),auth[_0x7ba3('0xa')](),controller[_0x7ba3('0x1e')]);router['delete'](_0x7ba3('0x1d'),auth[_0x7ba3('0xa')](),controller[_0x7ba3('0x1f')]);module[_0x7ba3('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js
index 274d19b..9bd5a3a 100644
--- a/server/api/plugin/plugin.attributes.js
+++ b/server/api/plugin/plugin.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1864=['exports','ENUM','html','TEXT','STRING','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','sequelize'];(function(_0x472ee2,_0x295444){var _0x18387b=function(_0x320611){while(--_0x320611){_0x472ee2['push'](_0x472ee2['shift']());}};_0x18387b(++_0x295444);}(_0x1864,0x17b));var _0x4186=function(_0x32a0e7,_0x3eb0be){_0x32a0e7=_0x32a0e7-0x0;var _0x57c651=_0x1864[_0x32a0e7];return _0x57c651;};'use strict';var Sequelize=require(_0x4186('0x0'));module[_0x4186('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4186('0x2')](_0x4186('0x3'),'script')},'description':{'type':Sequelize[_0x4186('0x4')]},'version':{'type':Sequelize[_0x4186('0x4')]},'path':{'type':Sequelize[_0x4186('0x5')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4186('0x6')},'sidebar':{'type':Sequelize[_0x4186('0x2')](_0x4186('0x7'),_0x4186('0x8'),'always','never'),'defaultValue':_0x4186('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x4186('0x5')]},'adminUrl':{'type':Sequelize[_0x4186('0x5')]},'agentUrl':{'type':Sequelize[_0x4186('0x5')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x4186('0x5')]}};
\ No newline at end of file
+var _0xfd6d=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never'];(function(_0x2e918b,_0x379a7b){var _0x40db6d=function(_0x319a86){while(--_0x319a86){_0x2e918b['push'](_0x2e918b['shift']());}};_0x40db6d(++_0x379a7b);}(_0xfd6d,0x79));var _0xdfd6=function(_0x47fcfa,_0x447258){_0x47fcfa=_0x47fcfa-0x0;var _0x16def2=_0xfd6d[_0x47fcfa];return _0x16def2;};'use strict';var Sequelize=require(_0xdfd6('0x0'));module[_0xdfd6('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdfd6('0x2')](_0xdfd6('0x3'),_0xdfd6('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xdfd6('0x5')]},'path':{'type':Sequelize[_0xdfd6('0x6')],'comment':_0xdfd6('0x7')},'active':{'type':Sequelize[_0xdfd6('0x8')],'defaultValue':0x0,'comment':_0xdfd6('0x9')},'sidebar':{'type':Sequelize[_0xdfd6('0x2')](_0xdfd6('0xa'),_0xdfd6('0xb'),_0xdfd6('0xc'),_0xdfd6('0xd')),'defaultValue':_0xdfd6('0xc'),'comment':_0xdfd6('0xe')},'icon':{'type':Sequelize[_0xdfd6('0x6')]},'adminUrl':{'type':Sequelize[_0xdfd6('0x6')]},'agentUrl':{'type':Sequelize[_0xdfd6('0x6')]},'scriptName':{'type':Sequelize[_0xdfd6('0x6')]},'scriptPath':{'type':Sequelize[_0xdfd6('0x6')]}};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js
index 2e44f8e..80b7b19 100644
--- a/server/api/plugin/plugin.controller.js
+++ b/server/api/plugin/plugin.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x12fd=['../../config/environment','defaults','localhost','socket.io-emitter','redis','./plugin.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','Plugin','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','download','find','params','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','send','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils'];(function(_0x1e01d7,_0x517c3b){var _0x1a44a9=function(_0x3fa15a){while(--_0x3fa15a){_0x1e01d7['push'](_0x1e01d7['shift']());}};_0x1a44a9(++_0x517c3b);}(_0x12fd,0x143));var _0xd12f=function(_0x5c8770,_0x1a6190){_0x5c8770=_0x5c8770-0x0;var _0x365344=_0x12fd[_0x5c8770];return _0x365344;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd12f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd12f('0x1'));var jsonpatch=require(_0xd12f('0x2'));var rp=require(_0xd12f('0x3'));var moment=require(_0xd12f('0x4'));var BPromise=require(_0xd12f('0x5'));var Mustache=require(_0xd12f('0x6'));var util=require('util');var path=require(_0xd12f('0x7'));var sox=require(_0xd12f('0x8'));var csv=require(_0xd12f('0x9'));var ejs=require(_0xd12f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd12f('0xb'));var crypto=require('crypto');var jsforce=require(_0xd12f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd12f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xd12f('0xd'));var rimraf=require(_0xd12f('0xe'));var archiver=require(_0xd12f('0xf'));var Redis=require(_0xd12f('0x10'));var authService=require(_0xd12f('0x11'));var qs=require(_0xd12f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd12f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd12f('0x14'));var config=require(_0xd12f('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd12f('0x16')](config['redis'],{'host':_0xd12f('0x17'),'port':0x18eb});var socket=require(_0xd12f('0x18'))(new Redis(config[_0xd12f('0x19')]));require(_0xd12f('0x1a'))[_0xd12f('0x1b')](socket);function respondWithStatusCode(_0x3dc7bf,_0x224c31){_0x224c31=_0x224c31||0xcc;return function(_0x2188f0){if(_0x2188f0){return _0x3dc7bf[_0xd12f('0x1c')](_0x224c31);}return _0x3dc7bf[_0xd12f('0x1d')](_0x224c31)[_0xd12f('0x1e')]();};}function respondWithResult(_0x7058c,_0x307500){_0x307500=_0x307500||0xc8;return function(_0x4f24e6){if(_0x4f24e6){return _0x7058c[_0xd12f('0x1d')](_0x307500)[_0xd12f('0x1f')](_0x4f24e6);}};}function respondWithFilteredResult(_0x3d9506,_0xc3a388){return function(_0x325b9b){if(_0x325b9b){var _0x16c8dc=_0x325b9b[_0xd12f('0x20')],_0x80b3f2=_0xc3a388[_0xd12f('0x21')],_0x1c0225=_0xc3a388[_0xd12f('0x21')]+_0xc3a388[_0xd12f('0x22')],_0x3e7dd3;if(_0x1c0225>=_0x16c8dc){_0x1c0225=_0x16c8dc;_0x3e7dd3=0xc8;}else{_0x3e7dd3=0xce;}_0x3d9506[_0xd12f('0x1d')](_0x3e7dd3);return _0x3d9506[_0xd12f('0x23')](_0xd12f('0x24'),_0x80b3f2+'-'+_0x1c0225+'/'+_0x16c8dc)[_0xd12f('0x1f')](_0x325b9b);}return null;};}function patchUpdates(_0x365021){return function(_0x312e5b){try{jsonpatch['apply'](_0x312e5b,_0x365021,!![]);}catch(_0x90db71){return BPromise['reject'](_0x90db71);}return _0x312e5b[_0xd12f('0x25')]();};}function saveUpdates(_0x1d37e4,_0x34d6e2){return function(_0x128d32){if(_0x128d32){return _0x128d32[_0xd12f('0x26')](_0x1d37e4)[_0xd12f('0x27')](function(_0x141358){return _0x141358;});}return null;};}function removeEntity(_0x39e6d6,_0x5547b7){return function(_0x2de0f6){if(_0x2de0f6){return _0x2de0f6[_0xd12f('0x28')]()[_0xd12f('0x27')](function(){var _0x40a23f=_0x2de0f6[_0xd12f('0x29')]({'plain':!![]});var _0x40ef64='Plugins';return db[_0xd12f('0x2a')][_0xd12f('0x28')]({'where':{'type':_0x40ef64,'resourceId':_0x40a23f['id']}})['then'](function(){return _0x2de0f6;});})[_0xd12f('0x27')](function(){_0x39e6d6[_0xd12f('0x1d')](0xcc)[_0xd12f('0x1e')]();});}};}function handleEntityNotFound(_0x4f6654,_0x3fef34){return function(_0x134673){if(!_0x134673){_0x4f6654[_0xd12f('0x1c')](0x194);}return _0x134673;};}function handleError(_0x54c1e4,_0x5627eb){_0x5627eb=_0x5627eb||0x1f4;return function(_0x267912){logger[_0xd12f('0x2b')](_0x267912[_0xd12f('0x2c')]);if(_0x267912[_0xd12f('0x2d')]){delete _0x267912[_0xd12f('0x2d')];}_0x54c1e4['status'](_0x5627eb)['send'](_0x267912);};}exports['index']=function(_0x1e52e0,_0x4d0bbc){var _0x16d83c={},_0x3a7cf6={},_0x10f1c6={'count':0x0,'rows':[]};var _0x3aa4b5=_[_0xd12f('0x2e')](db[_0xd12f('0x2f')][_0xd12f('0x30')],function(_0x511814){return{'name':_0x511814[_0xd12f('0x31')],'type':_0x511814['type'][_0xd12f('0x32')]};});_0x3a7cf6[_0xd12f('0x33')]=_['map'](_0x3aa4b5,_0xd12f('0x2d'));_0x3a7cf6[_0xd12f('0x34')]=_[_0xd12f('0x35')](_0x1e52e0[_0xd12f('0x34')]);_0x3a7cf6[_0xd12f('0x36')]=_[_0xd12f('0x37')](_0x3a7cf6[_0xd12f('0x33')],_0x3a7cf6[_0xd12f('0x34')]);_0x16d83c[_0xd12f('0x38')]=_[_0xd12f('0x37')](_0x3a7cf6[_0xd12f('0x33')],qs[_0xd12f('0x39')](_0x1e52e0[_0xd12f('0x34')][_0xd12f('0x39')]));_0x16d83c[_0xd12f('0x38')]=_0x16d83c['attributes'][_0xd12f('0x3a')]?_0x16d83c[_0xd12f('0x38')]:_0x3a7cf6[_0xd12f('0x33')];if(!_0x1e52e0['query'][_0xd12f('0x3b')]('nolimit')){_0x16d83c[_0xd12f('0x22')]=qs[_0xd12f('0x22')](_0x1e52e0[_0xd12f('0x34')][_0xd12f('0x22')]);_0x16d83c[_0xd12f('0x21')]=qs[_0xd12f('0x21')](_0x1e52e0[_0xd12f('0x34')][_0xd12f('0x21')]);}_0x16d83c[_0xd12f('0x3c')]=qs['sort'](_0x1e52e0['query'][_0xd12f('0x3d')]);_0x16d83c[_0xd12f('0x3e')]=qs[_0xd12f('0x36')](_[_0xd12f('0x3f')](_0x1e52e0['query'],_0x3a7cf6[_0xd12f('0x36')]),_0x3aa4b5);if(_0x1e52e0[_0xd12f('0x34')][_0xd12f('0x40')]){_0x16d83c['where']=_[_0xd12f('0x41')](_0x16d83c['where'],{'$or':_['map'](_0x3aa4b5,function(_0x1de3b9){if(_0x1de3b9[_0xd12f('0x42')]!==_0xd12f('0x43')){var _0x5f5549={};_0x5f5549[_0x1de3b9[_0xd12f('0x2d')]]={'$like':'%'+_0x1e52e0[_0xd12f('0x34')]['filter']+'%'};return _0x5f5549;}})});}_0x16d83c=_[_0xd12f('0x41')]({},_0x16d83c,_0x1e52e0[_0xd12f('0x44')]);var _0x149819={'where':_0x16d83c['where']};return db[_0xd12f('0x2f')][_0xd12f('0x20')](_0x149819)['then'](function(_0x357e73){_0x10f1c6['count']=_0x357e73;if(_0x1e52e0[_0xd12f('0x34')][_0xd12f('0x45')]){_0x16d83c['include']=[{'all':!![]}];}return db[_0xd12f('0x2f')][_0xd12f('0x46')](_0x16d83c);})[_0xd12f('0x27')](function(_0x3f95db){_0x10f1c6[_0xd12f('0x47')]=_0x3f95db;return _0x10f1c6;})[_0xd12f('0x27')](respondWithFilteredResult(_0x4d0bbc,_0x16d83c))[_0xd12f('0x48')](handleError(_0x4d0bbc,null));};exports['show']=function(_0x1289b4,_0x45bbd8){var _0x466548={'raw':!![],'where':{'id':_0x1289b4['params']['id']}},_0x1701a7={};_0x1701a7[_0xd12f('0x33')]=_[_0xd12f('0x35')](db[_0xd12f('0x2f')]['rawAttributes']);_0x1701a7['query']=_[_0xd12f('0x35')](_0x1289b4['query']);_0x1701a7[_0xd12f('0x36')]=_[_0xd12f('0x37')](_0x1701a7[_0xd12f('0x33')],_0x1701a7['query']);_0x466548['attributes']=_[_0xd12f('0x37')](_0x1701a7['model'],qs[_0xd12f('0x39')](_0x1289b4[_0xd12f('0x34')][_0xd12f('0x39')]));_0x466548['attributes']=_0x466548[_0xd12f('0x38')][_0xd12f('0x3a')]?_0x466548['attributes']:_0x1701a7[_0xd12f('0x33')];if(_0x1289b4['query']['includeAll']){_0x466548['include']=[{'all':!![]}];}_0x466548=_[_0xd12f('0x41')]({},_0x466548,_0x1289b4[_0xd12f('0x44')]);return db[_0xd12f('0x2f')]['find'](_0x466548)[_0xd12f('0x27')](handleEntityNotFound(_0x45bbd8,null))['then'](respondWithResult(_0x45bbd8,null))['catch'](handleError(_0x45bbd8,null));};exports[_0xd12f('0x49')]=function(_0x59da19,_0x338197,_0x2b8dd8){return db[_0xd12f('0x2f')][_0xd12f('0x4a')]({'where':{'id':_0x59da19[_0xd12f('0x4b')]['id']},'attributes':[_0xd12f('0x2d'),_0xd12f('0x7')],'raw':!![]})[_0xd12f('0x27')](handleEntityNotFound(_0x338197,null))[_0xd12f('0x27')](function(_0x2add3f){if(_0x2add3f){var _0x1e7f34=path[_0xd12f('0x4c')](config[_0xd12f('0x4d')],_0xd12f('0x4e'),util[_0xd12f('0x4f')](_0xd12f('0x50'),path[_0xd12f('0x51')](_0x2add3f['path'])));var _0x4542ab=fs[_0xd12f('0x52')](_0x1e7f34);var _0x48c63e=archiver(_0xd12f('0x53'),{'zlib':{'level':0x9}});_0x48c63e['on'](_0xd12f('0x54'),function(_0x1bca7d){if(_0x1bca7d[_0xd12f('0x55')]==='ENOENT'){logger[_0xd12f('0x2b')](_0x1bca7d);}else{throw new db['Sequelize'][(_0xd12f('0x56'))](_0xd12f('0x57'));}});_0x48c63e['on'](_0xd12f('0x2b'),function(_0x4fafbd){throw new db[(_0xd12f('0x58'))]['Error'](_0xd12f('0x57'));});_0x48c63e[_0xd12f('0x59')](_0x4542ab);_0x48c63e[_0xd12f('0x5a')]('**/*',{'cwd':path[_0xd12f('0x4c')](config[_0xd12f('0x4d')],_0xd12f('0x4e'),path[_0xd12f('0x5b')](_0x2add3f['path'])),'ignore':[path[_0xd12f('0x4c')](path[_0xd12f('0x51')](_0x2add3f[_0xd12f('0x7')]),_0xd12f('0x5c')),path['join'](path[_0xd12f('0x51')](_0x2add3f[_0xd12f('0x7')]),_0xd12f('0x5d'))],'nodir':!![]})[_0xd12f('0x5e')]();_0x4542ab['on'](_0xd12f('0x5f'),function(){if(!fs[_0xd12f('0x60')](_0x1e7f34)){throw new db[(_0xd12f('0x58'))][(_0xd12f('0x56'))](_0xd12f('0x61'));}return _0x338197[_0xd12f('0x49')](_0x1e7f34,util[_0xd12f('0x4f')]('%s.zip',path[_0xd12f('0x51')](_0x2add3f[_0xd12f('0x7')])),function(_0x51e00a){if(_0x51e00a){throw new db['Sequelize'][(_0xd12f('0x56'))](_0xd12f('0x62'));}fs[_0xd12f('0x63')](_0x1e7f34);logger[_0xd12f('0x64')](_0xd12f('0x65'));logger[_0xd12f('0x64')](_0xd12f('0x66'));});});}return null;})[_0xd12f('0x48')](handleError(_0x338197,null));};exports[_0xd12f('0x67')]=function(_0x30bfb0,_0x2083b5,_0x5842db){var _0x419ee2=path['basename'](_0x30bfb0[_0xd12f('0x68')]['filename'],path[_0xd12f('0x69')](_0x30bfb0[_0xd12f('0x68')][_0xd12f('0x6a')]));var _0x8a6cbc=path[_0xd12f('0x4c')](config[_0xd12f('0x4d')],_0xd12f('0x4e'),_0x30bfb0[_0xd12f('0x68')][_0xd12f('0x6a')]);var _0x266788=path[_0xd12f('0x4c')](config['root'],_0xd12f('0x4e'),_0x419ee2);logger[_0xd12f('0x64')](_0xd12f('0x6b'),_0x8a6cbc);logger[_0xd12f('0x64')](_0xd12f('0x6c'),_0x266788);try{fs[_0xd12f('0x6d')](_0x8a6cbc,parseInt('0777',0x8));extract(_0x8a6cbc,{'dir':_0x266788},function(_0x22a23b){if(_0x22a23b){logger[_0xd12f('0x2b')](_0x22a23b);handleError(_0x22a23b,!![]);};var _0x2475c8=fs[_0xd12f('0x6e')](_0x266788);if(_0x2475c8[_0xd12f('0x3a')]>0x1){removeReferences(_0x8a6cbc,_0x266788);logger['error'](_0xd12f('0x6f'));return _0x5842db(new Error('Invalid\x20plugin\x20structure'));}var _0x40ea90=fs[_0xd12f('0x70')](path[_0xd12f('0x4c')](_0x266788,_0x2475c8[0x0]));if(_0x40ea90[_0xd12f('0x71')]()){removeReferences(_0x8a6cbc,_0x266788);logger[_0xd12f('0x2b')](_0xd12f('0x6f'));return _0x5842db(new Error('Invalid\x20plugin\x20structure'));}if(_0x40ea90[_0xd12f('0x72')]()){var _0x42be61=fs[_0xd12f('0x6e')](path[_0xd12f('0x4c')](_0x266788,_0x2475c8[0x0]));if(_0x42be61['length']===0x0){removeReferences(_0x8a6cbc,_0x266788);logger[_0xd12f('0x2b')](_0xd12f('0x6f'));return _0x5842db(new Error(_0xd12f('0x6f')));}var _0x589fb0=_0x42be61['some'](function(_0x4f34bd){return _0x4f34bd===_0xd12f('0x73');});if(!_0x589fb0){return _0x5842db(new Error(_0xd12f('0x74')));}var _0xc7617e=fs[_0xd12f('0x75')](path[_0xd12f('0x4c')](_0x266788,_0x2475c8[0x0],_0xd12f('0x73')));var _0x1cacb9=JSON[_0xd12f('0x76')](_0xc7617e);if(_0xd12f('0x77')==typeof _0x1cacb9[_0xd12f('0x2d')]){return _0x5842db(new Error(_0xd12f('0x78')));}if('undefined'==typeof _0x1cacb9[_0xd12f('0x42')]){return _0x5842db(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xd12f('0x77')==typeof _0x1cacb9[_0xd12f('0x79')]){return _0x5842db(new Error(_0xd12f('0x7a')));}if(_0xd12f('0x77')==typeof _0x1cacb9[_0xd12f('0x7b')]){return _0x5842db(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1cacb9[_0xd12f('0x42')]===_0xd12f('0x7c')){if(_0xd12f('0x77')==typeof _0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x7d')]){return _0x5842db(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xd12f('0x77')==typeof _0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x7d')][_0xd12f('0x7e')]&&_0xd12f('0x77')==typeof _0x1cacb9['parameters'][_0xd12f('0x7d')][_0xd12f('0x7f')]){return _0x5842db(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1cacb9['type']===_0xd12f('0x80')){if(_0xd12f('0x77')==typeof _0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x81')]){return _0x5842db(new Error(_0xd12f('0x82')));}if(_0xd12f('0x77')==typeof _0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x83')]){return _0x5842db(new Error(_0xd12f('0x84')));}}else{return _0x5842db(new Error(_0xd12f('0x85')));}var _0x307c63=_0x1cacb9[_0xd12f('0x2d')];var _0x28af00=_0x1cacb9[_0xd12f('0x86')];var _0xc7f617=_0x1cacb9[_0xd12f('0x42')];var _0x14485a=_0x1cacb9['sidebar']?_0x1cacb9['sidebar']:_0xd12f('0x87');var _0x140bed=_0x1cacb9[_0xd12f('0x88')]?_0x1cacb9[_0xd12f('0x88')]:_0xd12f('0x89');var _0x3c506f='';var _0x23ab77='';var _0x3dd7a8='';var _0x463295='';var _0x2bbd2f=_0x1cacb9[_0xd12f('0x79')];if(_0xc7f617===_0xd12f('0x7c')){if(_0xd12f('0x77')!=typeof _0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x7d')]['admin']){var _0x23186e=_0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x7d')][_0xd12f('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xd12f('0x8a')](_0x23186e)){_0x3c506f=path['join'](_0xd12f('0x8b'),_0x419ee2,_0x2475c8[0x0],_0x23186e);}else{_0x3c506f=_0x23186e;}}else{logger[_0xd12f('0x64')](_0xd12f('0x8c'));}if(_0xd12f('0x77')!=typeof _0x1cacb9[_0xd12f('0x7b')]['views'][_0xd12f('0x7f')]){var _0xbc7b0c=_0x1cacb9[_0xd12f('0x7b')]['views'][_0xd12f('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xd12f('0x8a')](_0xbc7b0c)){_0x23ab77=path[_0xd12f('0x4c')](_0xd12f('0x8b'),_0x419ee2,_0x2475c8[0x0],_0xbc7b0c);}else{_0x23ab77=_0xbc7b0c;}}else{logger[_0xd12f('0x64')](_0xd12f('0x8d'));}}else if(_0xc7f617===_0xd12f('0x80')){_0x3dd7a8=_0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x81')];_0x463295=_0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x83')];if(_0xd12f('0x77')!=typeof _0x1cacb9['parameters'][_0xd12f('0x7d')]){if(_0xd12f('0x77')!=typeof _0x1cacb9[_0xd12f('0x7b')]['views'][_0xd12f('0x7e')]){var _0x23186e=_0x1cacb9['parameters']['views'][_0xd12f('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xd12f('0x8a')](_0x23186e)){_0x3c506f=path[_0xd12f('0x4c')](_0xd12f('0x8b'),_0x419ee2,_0x2475c8[0x0],_0x23186e);}else{_0x3c506f=_0x23186e;}}if(_0xd12f('0x77')!=typeof _0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x7d')][_0xd12f('0x7f')]){var _0xbc7b0c=_0x1cacb9[_0xd12f('0x7b')][_0xd12f('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xd12f('0x8a')](_0xbc7b0c)){_0x23ab77=path[_0xd12f('0x4c')]('plugins',_0x419ee2,_0x2475c8[0x0],_0xbc7b0c);}else{_0x23ab77=_0xbc7b0c;}}}}var _0x4f1171={'name':_0x307c63,'description':_0x28af00,'path':path['join'](_0x419ee2,_0x2475c8[0x0]),'type':_0xc7f617,'sidebar':_0x14485a,'icon':_0x140bed,'adminUrl':_0x3c506f,'agentUrl':_0x23ab77,'scriptName':_0x3dd7a8,'scriptPath':_0x463295,'version':_0x2bbd2f};removeReferences(_0x8a6cbc,null);return db['Plugin']['create'](_0x4f1171)[_0xd12f('0x27')](function(_0x4e4b6e){var _0xc40c92={'role':_0x30bfb0[_0xd12f('0x8e')][_0xd12f('0x8f')],'userProfileId':_0x30bfb0[_0xd12f('0x8e')]['userProfileId']};if(!_0xc40c92)throw new Error(_0xd12f('0x90'));if(_0xc40c92[_0xd12f('0x8f')]===_0xd12f('0x91')){var _0x1bd5ad=_0x4e4b6e['get']({'plain':!![]});return db[_0xd12f('0x92')]['find']({'where':{'name':_0xd12f('0x93'),'userProfileId':_0xc40c92[_0xd12f('0x94')]},'raw':!![]})['then'](function(_0x188c47){if(_0x188c47&&_0x188c47[_0xd12f('0x95')]===0x0){return db[_0xd12f('0x2a')][_0xd12f('0x96')]({'name':_0x1bd5ad['name'],'resourceId':_0x1bd5ad['id'],'type':_0x188c47[_0xd12f('0x2d')],'sectionId':_0x188c47['id']},{})[_0xd12f('0x27')](function(){return _0x4e4b6e;});}else{return _0x4e4b6e;}})['catch'](function(_0xab4e8c){logger[_0xd12f('0x2b')](_0xd12f('0x97'),_0xab4e8c);throw _0xab4e8c;});}return _0x4e4b6e;})['then'](respondWithResult(_0x2083b5,null))['catch'](handleError(_0x2083b5,null));}});}catch(_0x511232){_0x2083b5['status'](0x1f4)['send'](_0x511232);}};function removeReferences(_0x4c3713,_0x1e4a4d){try{if(_0x4c3713){fs[_0xd12f('0x63')](_0x4c3713);logger[_0xd12f('0x64')](_0xd12f('0x98'));}if(_0x1e4a4d){rimraf(_0x1e4a4d,function(){});logger[_0xd12f('0x64')](_0xd12f('0x99'));}}catch(_0x337594){logger[_0xd12f('0x2b')](_0x337594);}}exports['update']=function(_0x5751b1,_0x564721,_0xa2c892){return db[_0xd12f('0x2f')][_0xd12f('0x4a')]({'where':{'id':_0x5751b1[_0xd12f('0x4b')]['id']}})[_0xd12f('0x27')](handleEntityNotFound(_0x564721,null))[_0xd12f('0x27')](saveUpdates(_0x5751b1[_0xd12f('0x8e')],null))[_0xd12f('0x27')](respondWithResult(_0x564721,null))['catch'](handleError(_0x564721,null));};exports[_0xd12f('0x9a')]=function(_0x5a6e14,_0x2aa50f,_0x227ba9){return db[_0xd12f('0x2f')][_0xd12f('0x4a')]({'where':{'id':_0x5a6e14[_0xd12f('0x4b')]['id']}})[_0xd12f('0x27')](function(_0xa01e87){if(_0xa01e87){return _0xa01e87['destroy']();}})['then'](function(_0x61d1ce){rimraf(path[_0xd12f('0x4c')](config[_0xd12f('0x4d')],_0xd12f('0x4e'),path['dirname'](_0x61d1ce[_0xd12f('0x7')])),function(){});return _0x61d1ce;})[_0xd12f('0x27')](handleEntityNotFound(_0x2aa50f,null))[_0xd12f('0x27')](respondWithStatusCode(_0x2aa50f,null))[_0xd12f('0x48')](handleError(_0x2aa50f,null));};exports[_0xd12f('0x9b')]=function(_0x21f4cf,_0x322f88,_0x49aeb6){return BPromise[_0xd12f('0x9c')]()[_0xd12f('0x27')](function(){if(!_0x21f4cf[_0xd12f('0x34')][_0xd12f('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x21f4cf[_0xd12f('0x34')][_0xd12f('0x9d')]){throw new Error(_0xd12f('0x9e'));}var _0x41407a=_0x21f4cf['query']['hostname']?_0x21f4cf[_0xd12f('0x34')][_0xd12f('0x9f')]+':'+_0x21f4cf[_0xd12f('0x34')][_0xd12f('0x9d')]:_0xd12f('0xa0')+_0x21f4cf['query'][_0xd12f('0x9d')];var _0x23bc35=_0x21f4cf[_0xd12f('0x34')][_0xd12f('0x1f')]?_0x21f4cf[_0xd12f('0x34')][_0xd12f('0x1f')]:!![];var _0x52dc7d=_0x21f4cf[_0xd12f('0x34')][_0xd12f('0xa1')]?_0x21f4cf[_0xd12f('0x34')]['encoding']:null;var _0x49f860={'method':_0x21f4cf[_0xd12f('0xa2')],'uri':util['format']('%s%s',_0x41407a,_0x21f4cf[_0xd12f('0x34')][_0xd12f('0x7')]),'json':_0x23bc35,'resolveWithFullResponse':!![],'encoding':_0x52dc7d,'qs':_0x21f4cf[_0xd12f('0x34')]};if(_0x21f4cf[_0xd12f('0xa3')]){_0x49f860[_0xd12f('0xa3')]=_0x21f4cf[_0xd12f('0xa3')];if(_0x49f860['headers'][_0xd12f('0xa4')]){delete _0x49f860[_0xd12f('0xa3')][_0xd12f('0xa4')];}}if(_0x49f860['headers'][_0xd12f('0xa5')]){delete _0x49f860['headers'][_0xd12f('0xa5')];}return rp(_0x49f860);})[_0xd12f('0x27')](function(_0x2cac77){if(_0x2cac77){_0x322f88['set'](_0x2cac77['headers']);logger[_0xd12f('0x64')](_0x2cac77[_0xd12f('0x8e')]);if(_[_0xd12f('0xa6')](_0x21f4cf[_0xd12f('0x34')][_0xd12f('0x7')],_0xd12f('0x49'))&&_0x2cac77[_0xd12f('0xa7')]==0x1f4){return _0x322f88['sendStatus'](_0x2cac77[_0xd12f('0xa7')]);}else{return _0x322f88[_0xd12f('0x1d')](_0x2cac77[_0xd12f('0xa7')])[_0xd12f('0xa8')](_0x2cac77[_0xd12f('0x8e')]);}}else{return _0x322f88[_0xd12f('0x1c')](0xc8);}})[_0xd12f('0x48')](handleError(_0x322f88,null));};exports[_0xd12f('0xa9')]=function(_0x4649af,_0xee73a7,_0x39fca5){return BPromise['resolve']()[_0xd12f('0x27')](function(){if(!_0x4649af[_0xd12f('0x34')][_0xd12f('0x7')]){throw new Error(_0xd12f('0xaa'));}if(!_0x4649af[_0xd12f('0x34')][_0xd12f('0x9d')]){throw new Error(_0xd12f('0x9e'));}var _0x29a697=_0x4649af[_0xd12f('0x34')][_0xd12f('0x9f')]?_0x4649af['query'][_0xd12f('0x9f')]+':'+_0x4649af[_0xd12f('0x34')]['port']:_0xd12f('0xa0')+_0x4649af[_0xd12f('0x34')][_0xd12f('0x9d')];var _0x38813d=_0x4649af[_0xd12f('0x34')][_0xd12f('0x1f')]?_0x4649af[_0xd12f('0x34')][_0xd12f('0x1f')]:!![];var _0x4547c9=_0x4649af[_0xd12f('0x34')][_0xd12f('0xa1')]?_0x4649af['query']['encoding']:null;var _0x5da755={'method':_0x4649af[_0xd12f('0xa2')],'uri':util[_0xd12f('0x4f')](_0xd12f('0xab'),_0x29a697,_0x4649af[_0xd12f('0x34')]['path']),'json':_0x38813d,'resolveWithFullResponse':!![],'encoding':_0x4547c9,'body':_0x4649af['body']};if(_0x4649af[_0xd12f('0xa3')]){_0x5da755['headers']=_0x4649af[_0xd12f('0xa3')];if(_0x5da755[_0xd12f('0xa3')][_0xd12f('0xa4')]){delete _0x5da755[_0xd12f('0xa3')][_0xd12f('0xa4')];}}if(_0x5da755[_0xd12f('0xa3')][_0xd12f('0xa5')]){delete _0x5da755['headers'][_0xd12f('0xa5')];}return rp(_0x5da755);})[_0xd12f('0x27')](function(_0x5efcf2){if(_0x5efcf2){_0xee73a7['set'](_0x5efcf2[_0xd12f('0xa3')]);logger[_0xd12f('0x64')](_0x5efcf2['body']);return _0xee73a7['status'](_0x5efcf2[_0xd12f('0xa7')])['send'](_0x5efcf2[_0xd12f('0x8e')]);}else{return _0xee73a7[_0xd12f('0x1c')](0xc8);}})[_0xd12f('0x48')](handleError(_0xee73a7,null));};
\ No newline at end of file
+var _0x2155=['offset','limit','set','Content-Range','apply','save','update','then','get','Plugins','UserProfileResource','destroy','error','name','index','Plugin','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','model','find','download','server/files/plugins','%s.zip','basename','path','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','root','node_modules/**/*','finalize','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','lstatSync','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','test','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','plugins','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','%s%s','headers','content-length','content-type','send','webhookPost','http://localhost:','method','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count'];(function(_0x544926,_0x2d99e5){var _0xd0e8e2=function(_0x295272){while(--_0x295272){_0x544926['push'](_0x544926['shift']());}};_0xd0e8e2(++_0x2d99e5);}(_0x2155,0x1e0));var _0x5215=function(_0xe2b3bf,_0x8f706e){_0xe2b3bf=_0xe2b3bf-0x0;var _0x2ae4d3=_0x2155[_0xe2b3bf];return _0x2ae4d3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5215('0x0'));var rimraf=require(_0x5215('0x1'));var zipdir=require(_0x5215('0x2'));var jsonpatch=require(_0x5215('0x3'));var rp=require(_0x5215('0x4'));var moment=require(_0x5215('0x5'));var BPromise=require(_0x5215('0x6'));var Mustache=require(_0x5215('0x7'));var util=require(_0x5215('0x8'));var path=require('path');var sox=require(_0x5215('0x9'));var csv=require(_0x5215('0xa'));var ejs=require(_0x5215('0xb'));var fs=require('fs');var _=require(_0x5215('0xc'));var squel=require(_0x5215('0xd'));var crypto=require(_0x5215('0xe'));var jsforce=require(_0x5215('0xf'));var deskjs=require(_0x5215('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5215('0x11'));var Papa=require(_0x5215('0x12'));var extract=require(_0x5215('0x13'));var rimraf=require('rimraf');var archiver=require(_0x5215('0x14'));var Redis=require('ioredis');var authService=require(_0x5215('0x15'));var qs=require(_0x5215('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5215('0x17'))('api');var utils=require(_0x5215('0x18'));var config=require(_0x5215('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5215('0x1a')](config[_0x5215('0x1b')],{'host':_0x5215('0x1c'),'port':0x18eb});var socket=require(_0x5215('0x1d'))(new Redis(config['redis']));require('./plugin.socket')[_0x5215('0x1e')](socket);function respondWithStatusCode(_0xab857a,_0x51185b){_0x51185b=_0x51185b||0xcc;return function(_0x52769c){if(_0x52769c){return _0xab857a[_0x5215('0x1f')](_0x51185b);}return _0xab857a[_0x5215('0x20')](_0x51185b)[_0x5215('0x21')]();};}function respondWithResult(_0x2e4801,_0x4aa384){_0x4aa384=_0x4aa384||0xc8;return function(_0x1ddaee){if(_0x1ddaee){return _0x2e4801['status'](_0x4aa384)[_0x5215('0x22')](_0x1ddaee);}};}function respondWithFilteredResult(_0x1b7ffb,_0x5dd751){return function(_0x42349c){if(_0x42349c){var _0xa808e6=_0x42349c[_0x5215('0x23')],_0x17ffb9=_0x5dd751[_0x5215('0x24')],_0x250fa5=_0x5dd751[_0x5215('0x24')]+_0x5dd751[_0x5215('0x25')],_0x56397d;if(_0x250fa5>=_0xa808e6){_0x250fa5=_0xa808e6;_0x56397d=0xc8;}else{_0x56397d=0xce;}_0x1b7ffb['status'](_0x56397d);return _0x1b7ffb[_0x5215('0x26')](_0x5215('0x27'),_0x17ffb9+'-'+_0x250fa5+'/'+_0xa808e6)[_0x5215('0x22')](_0x42349c);}return null;};}function patchUpdates(_0x1fad12){return function(_0x17ce98){try{jsonpatch[_0x5215('0x28')](_0x17ce98,_0x1fad12,!![]);}catch(_0x1fb2c9){return BPromise['reject'](_0x1fb2c9);}return _0x17ce98[_0x5215('0x29')]();};}function saveUpdates(_0xb7ba78,_0x49f0be){return function(_0x354759){if(_0x354759){return _0x354759[_0x5215('0x2a')](_0xb7ba78)[_0x5215('0x2b')](function(_0x3b52d1){return _0x3b52d1;});}return null;};}function removeEntity(_0x1bc519,_0x3cc93c){return function(_0x367c66){if(_0x367c66){return _0x367c66['destroy']()[_0x5215('0x2b')](function(){var _0x3759e8=_0x367c66[_0x5215('0x2c')]({'plain':!![]});var _0x439991=_0x5215('0x2d');return db[_0x5215('0x2e')][_0x5215('0x2f')]({'where':{'type':_0x439991,'resourceId':_0x3759e8['id']}})[_0x5215('0x2b')](function(){return _0x367c66;});})[_0x5215('0x2b')](function(){_0x1bc519[_0x5215('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x333ed7,_0x158ab2){return function(_0x276a70){if(!_0x276a70){_0x333ed7[_0x5215('0x1f')](0x194);}return _0x276a70;};}function handleError(_0x1de789,_0x59a631){_0x59a631=_0x59a631||0x1f4;return function(_0x370517){logger[_0x5215('0x30')](_0x370517['stack']);if(_0x370517['name']){delete _0x370517[_0x5215('0x31')];}_0x1de789[_0x5215('0x20')](_0x59a631)['send'](_0x370517);};}exports[_0x5215('0x32')]=function(_0x2d921b,_0x570551){var _0x18c089={},_0x177208={},_0x3c4237={'count':0x0,'rows':[]};var _0x49f848=_['map'](db[_0x5215('0x33')][_0x5215('0x34')],function(_0x5ea5db){return{'name':_0x5ea5db[_0x5215('0x35')],'type':_0x5ea5db[_0x5215('0x36')][_0x5215('0x37')]};});_0x177208['model']=_[_0x5215('0x38')](_0x49f848,'name');_0x177208['query']=_[_0x5215('0x39')](_0x2d921b[_0x5215('0x3a')]);_0x177208[_0x5215('0x3b')]=_[_0x5215('0x3c')](_0x177208['model'],_0x177208[_0x5215('0x3a')]);_0x18c089[_0x5215('0x3d')]=_[_0x5215('0x3c')](_0x177208['model'],qs[_0x5215('0x3e')](_0x2d921b[_0x5215('0x3a')][_0x5215('0x3e')]));_0x18c089[_0x5215('0x3d')]=_0x18c089['attributes'][_0x5215('0x3f')]?_0x18c089[_0x5215('0x3d')]:_0x177208['model'];if(!_0x2d921b[_0x5215('0x3a')][_0x5215('0x40')](_0x5215('0x41'))){_0x18c089[_0x5215('0x25')]=qs[_0x5215('0x25')](_0x2d921b[_0x5215('0x3a')][_0x5215('0x25')]);_0x18c089[_0x5215('0x24')]=qs['offset'](_0x2d921b[_0x5215('0x3a')]['offset']);}_0x18c089['order']=qs[_0x5215('0x42')](_0x2d921b['query'][_0x5215('0x42')]);_0x18c089['where']=qs['filters'](_[_0x5215('0x43')](_0x2d921b[_0x5215('0x3a')],_0x177208[_0x5215('0x3b')]),_0x49f848);if(_0x2d921b[_0x5215('0x3a')][_0x5215('0x44')]){_0x18c089[_0x5215('0x45')]=_[_0x5215('0x46')](_0x18c089[_0x5215('0x45')],{'$or':_['map'](_0x49f848,function(_0x53a1f4){if(_0x53a1f4['type']!==_0x5215('0x47')){var _0x37151e={};_0x37151e[_0x53a1f4[_0x5215('0x31')]]={'$like':'%'+_0x2d921b[_0x5215('0x3a')]['filter']+'%'};return _0x37151e;}})});}_0x18c089=_[_0x5215('0x46')]({},_0x18c089,_0x2d921b[_0x5215('0x48')]);var _0x595e3b={'where':_0x18c089['where']};return db[_0x5215('0x33')][_0x5215('0x23')](_0x595e3b)['then'](function(_0x29faba){_0x3c4237[_0x5215('0x23')]=_0x29faba;if(_0x2d921b[_0x5215('0x3a')][_0x5215('0x49')]){_0x18c089[_0x5215('0x4a')]=[{'all':!![]}];}return db[_0x5215('0x33')][_0x5215('0x4b')](_0x18c089);})[_0x5215('0x2b')](function(_0x38f6f5){_0x3c4237[_0x5215('0x4c')]=_0x38f6f5;return _0x3c4237;})[_0x5215('0x2b')](respondWithFilteredResult(_0x570551,_0x18c089))[_0x5215('0x4d')](handleError(_0x570551,null));};exports['show']=function(_0x53f922,_0x478354){var _0x49a674={'raw':!![],'where':{'id':_0x53f922[_0x5215('0x4e')]['id']}},_0x3b8ea6={};_0x3b8ea6['model']=_[_0x5215('0x39')](db['Plugin'][_0x5215('0x34')]);_0x3b8ea6[_0x5215('0x3a')]=_[_0x5215('0x39')](_0x53f922[_0x5215('0x3a')]);_0x3b8ea6[_0x5215('0x3b')]=_['intersection'](_0x3b8ea6[_0x5215('0x4f')],_0x3b8ea6['query']);_0x49a674[_0x5215('0x3d')]=_[_0x5215('0x3c')](_0x3b8ea6['model'],qs[_0x5215('0x3e')](_0x53f922[_0x5215('0x3a')][_0x5215('0x3e')]));_0x49a674['attributes']=_0x49a674[_0x5215('0x3d')][_0x5215('0x3f')]?_0x49a674[_0x5215('0x3d')]:_0x3b8ea6[_0x5215('0x4f')];if(_0x53f922[_0x5215('0x3a')][_0x5215('0x49')]){_0x49a674[_0x5215('0x4a')]=[{'all':!![]}];}_0x49a674=_[_0x5215('0x46')]({},_0x49a674,_0x53f922[_0x5215('0x48')]);return db[_0x5215('0x33')][_0x5215('0x50')](_0x49a674)['then'](handleEntityNotFound(_0x478354,null))['then'](respondWithResult(_0x478354,null))[_0x5215('0x4d')](handleError(_0x478354,null));};exports[_0x5215('0x51')]=function(_0x16dc12,_0xe421cc,_0x54062b){return db['Plugin'][_0x5215('0x50')]({'where':{'id':_0x16dc12['params']['id']},'attributes':['name','path'],'raw':!![]})[_0x5215('0x2b')](handleEntityNotFound(_0xe421cc,null))['then'](function(_0x5b630e){if(_0x5b630e){var _0x524daa=path['join'](config['root'],_0x5215('0x52'),util['format'](_0x5215('0x53'),path[_0x5215('0x54')](_0x5b630e[_0x5215('0x55')])));var _0x9c5950=fs['createWriteStream'](_0x524daa);var _0x4122be=archiver(_0x5215('0x56'),{'zlib':{'level':0x9}});_0x4122be['on'](_0x5215('0x57'),function(_0xf4d0ed){if(_0xf4d0ed['code']===_0x5215('0x58')){logger['error'](_0xf4d0ed);}else{throw new db[(_0x5215('0x59'))][(_0x5215('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4122be['on']('error',function(_0x19ecb6){throw new db[(_0x5215('0x59'))][(_0x5215('0x5a'))](_0x5215('0x5b'));});_0x4122be[_0x5215('0x5c')](_0x9c5950);_0x4122be[_0x5215('0x5d')](_0x5215('0x5e'),{'cwd':path[_0x5215('0x5f')](config[_0x5215('0x60')],_0x5215('0x52'),path['dirname'](_0x5b630e[_0x5215('0x55')])),'ignore':[path[_0x5215('0x5f')](path['basename'](_0x5b630e[_0x5215('0x55')]),_0x5215('0x61')),path[_0x5215('0x5f')](path[_0x5215('0x54')](_0x5b630e[_0x5215('0x55')]),'attachments/**/*')],'nodir':!![]})[_0x5215('0x62')]();_0x9c5950['on']('close',function(){if(!fs[_0x5215('0x63')](_0x524daa)){throw new db[(_0x5215('0x59'))][(_0x5215('0x5a'))](_0x5215('0x64'));}return _0xe421cc[_0x5215('0x51')](_0x524daa,util[_0x5215('0x65')](_0x5215('0x53'),path[_0x5215('0x54')](_0x5b630e[_0x5215('0x55')])),function(_0x153ec2){if(_0x153ec2){throw new db[(_0x5215('0x59'))][(_0x5215('0x5a'))](_0x5215('0x66'));}fs[_0x5215('0x67')](_0x524daa);logger[_0x5215('0x68')](_0x5215('0x69'));logger[_0x5215('0x68')](_0x5215('0x6a'));});});}return null;})[_0x5215('0x4d')](handleError(_0xe421cc,null));};exports['upload']=function(_0x276954,_0x39f8ef,_0x445da1){var _0x17e040=path[_0x5215('0x54')](_0x276954['file'][_0x5215('0x6b')],path[_0x5215('0x6c')](_0x276954[_0x5215('0x6d')][_0x5215('0x6b')]));var _0x710982=path[_0x5215('0x5f')](config[_0x5215('0x60')],_0x5215('0x52'),_0x276954[_0x5215('0x6d')][_0x5215('0x6b')]);var _0x42ba8b=path[_0x5215('0x5f')](config[_0x5215('0x60')],_0x5215('0x52'),_0x17e040);logger[_0x5215('0x68')](_0x5215('0x6e'),_0x710982);logger['info'](_0x5215('0x6f'),_0x42ba8b);try{fs['chmodSync'](_0x710982,parseInt(_0x5215('0x70'),0x8));extract(_0x710982,{'dir':_0x42ba8b},function(_0x5aa515){if(_0x5aa515){logger[_0x5215('0x30')](_0x5aa515);handleError(_0x5aa515,!![]);};var _0x3cf540=fs[_0x5215('0x71')](_0x42ba8b);if(_0x3cf540[_0x5215('0x3f')]>0x1){removeReferences(_0x710982,_0x42ba8b);logger[_0x5215('0x30')]('Invalid\x20plugin\x20structure');return _0x445da1(new Error('Invalid\x20plugin\x20structure'));}var _0x3e6a6a=fs[_0x5215('0x72')](path[_0x5215('0x5f')](_0x42ba8b,_0x3cf540[0x0]));if(_0x3e6a6a['isFile']()){removeReferences(_0x710982,_0x42ba8b);logger[_0x5215('0x30')](_0x5215('0x73'));return _0x445da1(new Error(_0x5215('0x73')));}if(_0x3e6a6a[_0x5215('0x74')]()){var _0xbe7f65=fs[_0x5215('0x71')](path[_0x5215('0x5f')](_0x42ba8b,_0x3cf540[0x0]));if(_0xbe7f65[_0x5215('0x3f')]===0x0){removeReferences(_0x710982,_0x42ba8b);logger[_0x5215('0x30')](_0x5215('0x73'));return _0x445da1(new Error(_0x5215('0x73')));}var _0x1e3d78=_0xbe7f65[_0x5215('0x75')](function(_0xc983d6){return _0xc983d6===_0x5215('0x76');});if(!_0x1e3d78){return _0x445da1(new Error(_0x5215('0x77')));}var _0x3645c8=fs[_0x5215('0x78')](path[_0x5215('0x5f')](_0x42ba8b,_0x3cf540[0x0],'manifest.json'));var _0x23d3e2=JSON[_0x5215('0x79')](_0x3645c8);if(_0x5215('0x7a')==typeof _0x23d3e2[_0x5215('0x31')]){return _0x445da1(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x5215('0x7a')==typeof _0x23d3e2[_0x5215('0x36')]){return _0x445da1(new Error(_0x5215('0x7b')));}if('undefined'==typeof _0x23d3e2[_0x5215('0x7c')]){return _0x445da1(new Error(_0x5215('0x7d')));}if(_0x5215('0x7a')==typeof _0x23d3e2[_0x5215('0x7e')]){return _0x445da1(new Error(_0x5215('0x7f')));}if(_0x23d3e2[_0x5215('0x36')]===_0x5215('0x80')){if(_0x5215('0x7a')==typeof _0x23d3e2[_0x5215('0x7e')][_0x5215('0x81')]){return _0x445da1(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x5215('0x7a')==typeof _0x23d3e2['parameters'][_0x5215('0x81')][_0x5215('0x82')]&&'undefined'==typeof _0x23d3e2[_0x5215('0x7e')][_0x5215('0x81')]['agent']){return _0x445da1(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x23d3e2[_0x5215('0x36')]===_0x5215('0x83')){if('undefined'==typeof _0x23d3e2[_0x5215('0x7e')][_0x5215('0x84')]){return _0x445da1(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x5215('0x7a')==typeof _0x23d3e2['parameters'][_0x5215('0x85')]){return _0x445da1(new Error(_0x5215('0x86')));}}else{return _0x445da1(new Error(_0x5215('0x87')));}var _0x3322c6=_0x23d3e2[_0x5215('0x31')];var _0x4187fa=_0x23d3e2[_0x5215('0x88')];var _0x198e6f=_0x23d3e2['type'];var _0x1a4fde=_0x23d3e2['sidebar']?_0x23d3e2['sidebar']:_0x5215('0x89');var _0x1c7c5f=_0x23d3e2[_0x5215('0x8a')]?_0x23d3e2[_0x5215('0x8a')]:'icon-apps';var _0x148bdb='';var _0x31dbbd='';var _0x3466ed='';var _0x4ae320='';var _0xa109cd=_0x23d3e2[_0x5215('0x7c')];if(_0x198e6f===_0x5215('0x80')){if(_0x5215('0x7a')!=typeof _0x23d3e2[_0x5215('0x7e')][_0x5215('0x81')][_0x5215('0x82')]){var _0x2a40f7=_0x23d3e2[_0x5215('0x7e')][_0x5215('0x81')][_0x5215('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x5215('0x8b')](_0x2a40f7)){_0x148bdb=path[_0x5215('0x5f')]('plugins',_0x17e040,_0x3cf540[0x0],_0x2a40f7);}else{_0x148bdb=_0x2a40f7;}}else{logger[_0x5215('0x68')](_0x5215('0x8c'));}if('undefined'!=typeof _0x23d3e2['parameters'][_0x5215('0x81')]['agent']){var _0x1e92c2=_0x23d3e2['parameters']['views'][_0x5215('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0x5215('0x8b')](_0x1e92c2)){_0x31dbbd=path[_0x5215('0x5f')]('plugins',_0x17e040,_0x3cf540[0x0],_0x1e92c2);}else{_0x31dbbd=_0x1e92c2;}}else{logger['info'](_0x5215('0x8e'));}}else if(_0x198e6f===_0x5215('0x83')){_0x3466ed=_0x23d3e2[_0x5215('0x7e')][_0x5215('0x84')];_0x4ae320=_0x23d3e2[_0x5215('0x7e')][_0x5215('0x85')];if(_0x5215('0x7a')!=typeof _0x23d3e2[_0x5215('0x7e')][_0x5215('0x81')]){if(_0x5215('0x7a')!=typeof _0x23d3e2[_0x5215('0x7e')][_0x5215('0x81')][_0x5215('0x82')]){var _0x2a40f7=_0x23d3e2[_0x5215('0x7e')][_0x5215('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x5215('0x8b')](_0x2a40f7)){_0x148bdb=path[_0x5215('0x5f')](_0x5215('0x8f'),_0x17e040,_0x3cf540[0x0],_0x2a40f7);}else{_0x148bdb=_0x2a40f7;}}if(_0x5215('0x7a')!=typeof _0x23d3e2['parameters'][_0x5215('0x81')][_0x5215('0x8d')]){var _0x1e92c2=_0x23d3e2[_0x5215('0x7e')][_0x5215('0x81')][_0x5215('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0x5215('0x8b')](_0x1e92c2)){_0x31dbbd=path[_0x5215('0x5f')]('plugins',_0x17e040,_0x3cf540[0x0],_0x1e92c2);}else{_0x31dbbd=_0x1e92c2;}}}}var _0x405fba={'name':_0x3322c6,'description':_0x4187fa,'path':path[_0x5215('0x5f')](_0x17e040,_0x3cf540[0x0]),'type':_0x198e6f,'sidebar':_0x1a4fde,'icon':_0x1c7c5f,'adminUrl':_0x148bdb,'agentUrl':_0x31dbbd,'scriptName':_0x3466ed,'scriptPath':_0x4ae320,'version':_0xa109cd};removeReferences(_0x710982,null);return db[_0x5215('0x33')][_0x5215('0x90')](_0x405fba)[_0x5215('0x2b')](function(_0x4c7d5d){var _0xc2608b={'role':_0x276954['body']['role'],'userProfileId':_0x276954[_0x5215('0x91')][_0x5215('0x92')]};if(!_0xc2608b)throw new Error(_0x5215('0x93'));if(_0xc2608b[_0x5215('0x94')]===_0x5215('0x95')){var _0x492c63=_0x4c7d5d[_0x5215('0x2c')]({'plain':!![]});return db[_0x5215('0x96')]['find']({'where':{'name':_0x5215('0x2d'),'userProfileId':_0xc2608b[_0x5215('0x92')]},'raw':!![]})[_0x5215('0x2b')](function(_0x8fb15e){if(_0x8fb15e&&_0x8fb15e['autoAssociation']===0x0){return db[_0x5215('0x2e')][_0x5215('0x90')]({'name':_0x492c63[_0x5215('0x31')],'resourceId':_0x492c63['id'],'type':_0x8fb15e['name'],'sectionId':_0x8fb15e['id']},{})[_0x5215('0x2b')](function(){return _0x4c7d5d;});}else{return _0x4c7d5d;}})[_0x5215('0x4d')](function(_0x4e3e7b){logger['error'](_0x5215('0x97'),_0x4e3e7b);throw _0x4e3e7b;});}return _0x4c7d5d;})[_0x5215('0x2b')](respondWithResult(_0x39f8ef,null))[_0x5215('0x4d')](handleError(_0x39f8ef,null));}});}catch(_0x3bfa29){_0x39f8ef[_0x5215('0x20')](0x1f4)['send'](_0x3bfa29);}};function removeReferences(_0x1c6b71,_0x16d6cd){try{if(_0x1c6b71){fs[_0x5215('0x67')](_0x1c6b71);logger[_0x5215('0x68')](_0x5215('0x98'));}if(_0x16d6cd){rimraf(_0x16d6cd,function(){});logger[_0x5215('0x68')](_0x5215('0x99'));}}catch(_0xdd7d65){logger[_0x5215('0x30')](_0xdd7d65);}}exports[_0x5215('0x2a')]=function(_0x151a7f,_0x36b308,_0x365095){return db[_0x5215('0x33')][_0x5215('0x50')]({'where':{'id':_0x151a7f[_0x5215('0x4e')]['id']}})[_0x5215('0x2b')](handleEntityNotFound(_0x36b308,null))['then'](saveUpdates(_0x151a7f[_0x5215('0x91')],null))[_0x5215('0x2b')](respondWithResult(_0x36b308,null))[_0x5215('0x4d')](handleError(_0x36b308,null));};exports[_0x5215('0x9a')]=function(_0x129044,_0x35bb4f,_0x198c37){return db[_0x5215('0x33')][_0x5215('0x50')]({'where':{'id':_0x129044[_0x5215('0x4e')]['id']}})[_0x5215('0x2b')](function(_0x5db376){if(_0x5db376){return _0x5db376[_0x5215('0x2f')]();}})['then'](function(_0x1d57e0){rimraf(path[_0x5215('0x5f')](config[_0x5215('0x60')],'server/files/plugins',path[_0x5215('0x9b')](_0x1d57e0['path'])),function(){});return _0x1d57e0;})[_0x5215('0x2b')](handleEntityNotFound(_0x35bb4f,null))[_0x5215('0x2b')](respondWithStatusCode(_0x35bb4f,null))[_0x5215('0x4d')](handleError(_0x35bb4f,null));};exports[_0x5215('0x9c')]=function(_0x32af22,_0xa3a812,_0x44dea7){return BPromise[_0x5215('0x9d')]()[_0x5215('0x2b')](function(){if(!_0x32af22[_0x5215('0x3a')][_0x5215('0x55')]){throw new Error(_0x5215('0x9e'));}if(!_0x32af22[_0x5215('0x3a')][_0x5215('0x9f')]){throw new Error(_0x5215('0xa0'));}var _0x248454=_0x32af22[_0x5215('0x3a')][_0x5215('0xa1')]?_0x32af22['query'][_0x5215('0xa1')]+':'+_0x32af22[_0x5215('0x3a')][_0x5215('0x9f')]:'http://localhost:'+_0x32af22[_0x5215('0x3a')][_0x5215('0x9f')];var _0x429753=_0x32af22[_0x5215('0x3a')][_0x5215('0x22')]?_0x32af22[_0x5215('0x3a')][_0x5215('0x22')]:!![];var _0x457a13=_0x32af22[_0x5215('0x3a')]['encoding']?_0x32af22['query'][_0x5215('0xa2')]:null;var _0xa3525b={'method':_0x32af22['method'],'uri':util['format'](_0x5215('0xa3'),_0x248454,_0x32af22[_0x5215('0x3a')]['path']),'json':_0x429753,'resolveWithFullResponse':!![],'encoding':_0x457a13,'qs':_0x32af22[_0x5215('0x3a')]};if(_0x32af22[_0x5215('0xa4')]){_0xa3525b[_0x5215('0xa4')]=_0x32af22[_0x5215('0xa4')];if(_0xa3525b['headers'][_0x5215('0xa5')]){delete _0xa3525b[_0x5215('0xa4')][_0x5215('0xa5')];}}if(_0xa3525b[_0x5215('0xa4')]['content-type']){delete _0xa3525b[_0x5215('0xa4')][_0x5215('0xa6')];}return rp(_0xa3525b);})[_0x5215('0x2b')](function(_0x1f3e0e){if(_0x1f3e0e){_0xa3a812[_0x5215('0x26')](_0x1f3e0e[_0x5215('0xa4')]);logger['info'](_0x1f3e0e['body']);if(_['endsWith'](_0x32af22[_0x5215('0x3a')][_0x5215('0x55')],_0x5215('0x51'))&&_0x1f3e0e['statusCode']==0x1f4){return _0xa3a812[_0x5215('0x1f')](_0x1f3e0e['statusCode']);}else{return _0xa3a812[_0x5215('0x20')](_0x1f3e0e['statusCode'])[_0x5215('0xa7')](_0x1f3e0e[_0x5215('0x91')]);}}else{return _0xa3a812[_0x5215('0x1f')](0xc8);}})[_0x5215('0x4d')](handleError(_0xa3a812,null));};exports[_0x5215('0xa8')]=function(_0x7743bc,_0x2fb841,_0x29b3e1){return BPromise[_0x5215('0x9d')]()['then'](function(){if(!_0x7743bc[_0x5215('0x3a')]['path']){throw new Error(_0x5215('0x9e'));}if(!_0x7743bc['query'][_0x5215('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4b9b44=_0x7743bc['query'][_0x5215('0xa1')]?_0x7743bc[_0x5215('0x3a')][_0x5215('0xa1')]+':'+_0x7743bc[_0x5215('0x3a')][_0x5215('0x9f')]:_0x5215('0xa9')+_0x7743bc[_0x5215('0x3a')][_0x5215('0x9f')];var _0x47e5a9=_0x7743bc[_0x5215('0x3a')]['json']?_0x7743bc[_0x5215('0x3a')][_0x5215('0x22')]:!![];var _0x5a9a9e=_0x7743bc[_0x5215('0x3a')][_0x5215('0xa2')]?_0x7743bc[_0x5215('0x3a')]['encoding']:null;var _0x3c3059={'method':_0x7743bc[_0x5215('0xaa')],'uri':util[_0x5215('0x65')]('%s%s',_0x4b9b44,_0x7743bc[_0x5215('0x3a')]['path']),'json':_0x47e5a9,'resolveWithFullResponse':!![],'encoding':_0x5a9a9e,'body':_0x7743bc['body']};if(_0x7743bc['headers']){_0x3c3059[_0x5215('0xa4')]=_0x7743bc[_0x5215('0xa4')];if(_0x3c3059[_0x5215('0xa4')][_0x5215('0xa5')]){delete _0x3c3059[_0x5215('0xa4')]['content-length'];}}if(_0x3c3059[_0x5215('0xa4')][_0x5215('0xa6')]){delete _0x3c3059[_0x5215('0xa4')]['content-type'];}return rp(_0x3c3059);})[_0x5215('0x2b')](function(_0xdba4c4){if(_0xdba4c4){_0x2fb841[_0x5215('0x26')](_0xdba4c4[_0x5215('0xa4')]);logger['info'](_0xdba4c4['body']);return _0x2fb841[_0x5215('0x20')](_0xdba4c4[_0x5215('0xab')])[_0x5215('0xa7')](_0xdba4c4['body']);}else{return _0x2fb841[_0x5215('0x1f')](0xc8);}})[_0x5215('0x4d')](handleError(_0x2fb841,null));};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js
index a89d512..8cf0d2f 100644
--- a/server/api/plugin/plugin.events.js
+++ b/server/api/plugin/plugin.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['Plugin','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x40ca4a,_0x4365fc){var _0x397d0c=function(_0xc61f77){while(--_0xc61f77){_0x40ca4a['push'](_0x40ca4a['shift']());}};_0x397d0c(++_0x4365fc);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x0b0e[_0x2261ce];return _0x524640;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var Plugin=require('../../mysqldb')['db'][_0xe0b0('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){PluginEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);PluginEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];Plugin[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
+var _0x7096=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x2e611b,_0x458d72){var _0x169d02=function(_0x76fed2){while(--_0x76fed2){_0x2e611b['push'](_0x2e611b['shift']());}};_0x169d02(++_0x458d72);}(_0x7096,0x10c));var _0x6709=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x7096[_0x3ff085];return _0x2b68c3;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x6709('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x6709('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6709('0x2'),'afterDestroy':_0x6709('0x3')};function emitEvent(_0x3e85e4){return function(_0xccdcb5,_0x3cd087,_0x3c8599){PluginEvents[_0x6709('0x4')](_0x3e85e4+':'+_0xccdcb5['id'],_0xccdcb5);PluginEvents[_0x6709('0x4')](_0x3e85e4,_0xccdcb5);_0x3c8599(null);};}for(var e in events){if(events[_0x6709('0x5')](e)){var event=events[e];Plugin[_0x6709('0x6')](e,emitEvent(event));}}module[_0x6709('0x7')]=PluginEvents;
\ No newline at end of file
diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js
index 4465a54..da61485 100644
--- a/server/api/plugin/plugin.model.js
+++ b/server/api/plugin/plugin.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5df0=['plugins','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./plugin.attributes','exports','define'];(function(_0xd6fc48,_0x49aa3b){var _0x5d7be9=function(_0x156515){while(--_0x156515){_0xd6fc48['push'](_0xd6fc48['shift']());}};_0x5d7be9(++_0x49aa3b);}(_0x5df0,0xa6));var _0x05df=function(_0x56ed86,_0x41e7f1){_0x56ed86=_0x56ed86-0x0;var _0xe6f9ac=_0x5df0[_0x56ed86];return _0xe6f9ac;};'use strict';var _=require('lodash');var util=require(_0x05df('0x0'));var logger=require(_0x05df('0x1'))(_0x05df('0x2'));var moment=require(_0x05df('0x3'));var BPromise=require('bluebird');var rp=require(_0x05df('0x4'));var fs=require('fs');var path=require(_0x05df('0x5'));var rimraf=require('rimraf');var config=require(_0x05df('0x6'));var attributes=require(_0x05df('0x7'));module[_0x05df('0x8')]=function(_0x43e43d,_0x2a78f5){return _0x43e43d[_0x05df('0x9')]('Plugin',attributes,{'tableName':_0x05df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x718f=['exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','../../config/environment','./plugin.attributes'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x718f,0x88));var _0xf718=function(_0x450eae,_0x2ad04d){_0x450eae=_0x450eae-0x0;var _0x2379d3=_0x718f[_0x450eae];return _0x2379d3;};'use strict';var _=require(_0xf718('0x0'));var util=require(_0xf718('0x1'));var logger=require(_0xf718('0x2'))(_0xf718('0x3'));var moment=require(_0xf718('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf718('0x5'));var attributes=require(_0xf718('0x6'));module[_0xf718('0x7')]=function(_0x105be2,_0x1884b7){return _0x105be2[_0xf718('0x8')](_0xf718('0x9'),attributes,{'tableName':_0xf718('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js
index 0bce265..6bde557 100644
--- a/server/api/plugin/plugin.rpc.js
+++ b/server/api/plugin/plugin.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2786=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Plugin','create','body','options','CreatePlugin','catch','lodash'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x2786,0x1d0));var _0x6278=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2786[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x6278('0x0'));var util=require('util');var moment=require(_0x6278('0x1'));var BPromise=require(_0x6278('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6278('0x3'));var db=require(_0x6278('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6278('0x5'))('rpc');var config=require(_0x6278('0x6'));var jayson=require(_0x6278('0x7'));var client=jayson[_0x6278('0x8')]['http']({'port':0x232a});config[_0x6278('0x9')]=_[_0x6278('0xa')](config[_0x6278('0x9')],{'host':_0x6278('0xb'),'port':0x18eb});var socket=require(_0x6278('0xc'))(new Redis(config['redis']));require(_0x6278('0xd'))['register'](socket);function respondWithRpcPromise(_0xef930d,_0x21658b,_0xf4b4ed){return new BPromise(function(_0xfb5e15,_0x5329da){return client[_0x6278('0xe')](_0xef930d,_0xf4b4ed)[_0x6278('0xf')](function(_0x13e877){logger[_0x6278('0x10')](_0x6278('0x11'),_0x21658b,_0x6278('0x12'));logger[_0x6278('0x13')](_0x6278('0x14'),_0x21658b,_0x6278('0x12'),JSON[_0x6278('0x15')](_0x13e877));if(_0x13e877[_0x6278('0x16')]){if(_0x13e877[_0x6278('0x16')][_0x6278('0x17')]===0x1f4){logger[_0x6278('0x16')](_0x6278('0x11'),_0x21658b,_0x13e877[_0x6278('0x16')][_0x6278('0x18')]);return _0x5329da(_0x13e877[_0x6278('0x16')][_0x6278('0x18')]);}logger[_0x6278('0x16')](_0x6278('0x11'),_0x21658b,_0x13e877['error'][_0x6278('0x18')]);return _0xfb5e15(_0x13e877[_0x6278('0x16')][_0x6278('0x18')]);}else{logger[_0x6278('0x10')](_0x6278('0x11'),_0x21658b,_0x6278('0x12'));_0xfb5e15(_0x13e877['result']['message']);}})['catch'](function(_0x39b725){logger['error'](_0x6278('0x11'),_0x21658b,_0x39b725);_0x5329da(_0x39b725);});});}exports['CreatePlugin']=function(_0x593b20){var _0x316848=this;return new Promise(function(_0x4ae7e5,_0x856135){return db[_0x6278('0x19')][_0x6278('0x1a')](_0x593b20[_0x6278('0x1b')],{'raw':_0x593b20[_0x6278('0x1c')]?_0x593b20['options']['raw']===undefined?!![]:![]:!![]})[_0x6278('0xf')](function(_0xd5e00b){logger['info'](_0x6278('0x1d'),_0x593b20);logger[_0x6278('0x13')](_0x6278('0x1d'),_0x593b20,JSON[_0x6278('0x15')](_0xd5e00b));_0x4ae7e5(_0xd5e00b);})[_0x6278('0x1e')](function(_0x4b1df9){logger['error'](_0x6278('0x1d'),_0x4b1df9['message'],_0x593b20);_0x856135(_0x316848['error'](0x1f4,_0x4b1df9[_0x6278('0x18')]));});});};
\ No newline at end of file
+var _0xf550=['code','message','CreatePlugin','Plugin','body','options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c6860,_0x501bd6){var _0x70ae2e=function(_0x45b8b8){while(--_0x45b8b8){_0x5c6860['push'](_0x5c6860['shift']());}};_0x70ae2e(++_0x501bd6);}(_0xf550,0x1c8));var _0x0f55=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xf550[_0x117f4c];return _0x2b24e9;};'use strict';var _=require(_0x0f55('0x0'));var util=require(_0x0f55('0x1'));var moment=require(_0x0f55('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f55('0x3'));var db=require(_0x0f55('0x4'))['db'];var utils=require(_0x0f55('0x5'));var logger=require(_0x0f55('0x6'))(_0x0f55('0x7'));var config=require(_0x0f55('0x8'));var jayson=require(_0x0f55('0x9'));var client=jayson[_0x0f55('0xa')][_0x0f55('0xb')]({'port':0x232a});config[_0x0f55('0xc')]=_['defaults'](config[_0x0f55('0xc')],{'host':_0x0f55('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f55('0xc')]));require('./plugin.socket')[_0x0f55('0xe')](socket);function respondWithRpcPromise(_0x46d96c,_0x492857,_0x1a5c96){return new BPromise(function(_0x224d31,_0x410afe){return client[_0x0f55('0xf')](_0x46d96c,_0x1a5c96)[_0x0f55('0x10')](function(_0xebd654){logger[_0x0f55('0x11')](_0x0f55('0x12'),_0x492857,_0x0f55('0x13'));logger[_0x0f55('0x14')](_0x0f55('0x15'),_0x492857,_0x0f55('0x13'),JSON[_0x0f55('0x16')](_0xebd654));if(_0xebd654[_0x0f55('0x17')]){if(_0xebd654[_0x0f55('0x17')][_0x0f55('0x18')]===0x1f4){logger['error'](_0x0f55('0x12'),_0x492857,_0xebd654[_0x0f55('0x17')][_0x0f55('0x19')]);return _0x410afe(_0xebd654[_0x0f55('0x17')][_0x0f55('0x19')]);}logger[_0x0f55('0x17')](_0x0f55('0x12'),_0x492857,_0xebd654['error'][_0x0f55('0x19')]);return _0x224d31(_0xebd654[_0x0f55('0x17')][_0x0f55('0x19')]);}else{logger['info'](_0x0f55('0x12'),_0x492857,_0x0f55('0x13'));_0x224d31(_0xebd654['result'][_0x0f55('0x19')]);}})['catch'](function(_0x46b02e){logger[_0x0f55('0x17')]('Plugin,\x20%s,\x20%s',_0x492857,_0x46b02e);_0x410afe(_0x46b02e);});});}exports[_0x0f55('0x1a')]=function(_0x2848f1){var _0x55fbb1=this;return new Promise(function(_0xe9d595,_0x37aab9){return db[_0x0f55('0x1b')]['create'](_0x2848f1[_0x0f55('0x1c')],{'raw':_0x2848f1[_0x0f55('0x1d')]?_0x2848f1['options']['raw']===undefined?!![]:![]:!![]})[_0x0f55('0x10')](function(_0x30e98a){logger['info'](_0x0f55('0x1a'),_0x2848f1);logger[_0x0f55('0x14')](_0x0f55('0x1a'),_0x2848f1,JSON[_0x0f55('0x16')](_0x30e98a));_0xe9d595(_0x30e98a);})['catch'](function(_0x2d37b3){logger[_0x0f55('0x17')]('CreatePlugin',_0x2d37b3['message'],_0x2848f1);_0x37aab9(_0x55fbb1[_0x0f55('0x17')](0x1f4,_0x2d37b3['message']));});});};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js
index 5fd870d..476d19a 100644
--- a/server/api/plugin/plugin.socket.js
+++ b/server/api/plugin/plugin.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x655c=['./plugin.events','save','update','removeListener','register','length','plugin:'];(function(_0x538542,_0x3456ed){var _0x1ad5ff=function(_0x20e0ba){while(--_0x20e0ba){_0x538542['push'](_0x538542['shift']());}};_0x1ad5ff(++_0x3456ed);}(_0x655c,0x15e));var _0xc655=function(_0x2f132e,_0x327f5d){_0x2f132e=_0x2f132e-0x0;var _0x117010=_0x655c[_0x2f132e];return _0x117010;};'use strict';var PluginEvents=require(_0xc655('0x0'));var events=[_0xc655('0x1'),'remove',_0xc655('0x2')];function createListener(_0x1603fa,_0xa532f4){return function(_0x19e62e){_0xa532f4['emit'](_0x1603fa,_0x19e62e);};}function removeListener(_0x380ab7,_0x27f4fe){return function(){PluginEvents[_0xc655('0x3')](_0x380ab7,_0x27f4fe);};}exports[_0xc655('0x4')]=function(_0x43f195){for(var _0x23af74=0x0,_0xc75a07=events[_0xc655('0x5')];_0x23af74<_0xc75a07;_0x23af74++){var _0xe154e1=events[_0x23af74];var _0xe5c2d6=createListener(_0xc655('0x6')+_0xe154e1,_0x43f195);PluginEvents['on'](_0xe154e1,_0xe5c2d6);}};
\ No newline at end of file
+var _0xa852=['emit','removeListener','register','length','./plugin.events','save','remove','update'];(function(_0x294457,_0x4aa173){var _0x30ce79=function(_0xe1a472){while(--_0xe1a472){_0x294457['push'](_0x294457['shift']());}};_0x30ce79(++_0x4aa173);}(_0xa852,0x1bc));var _0x2a85=function(_0x381dda,_0x104c82){_0x381dda=_0x381dda-0x0;var _0x101588=_0xa852[_0x381dda];return _0x101588;};'use strict';var PluginEvents=require(_0x2a85('0x0'));var events=[_0x2a85('0x1'),_0x2a85('0x2'),_0x2a85('0x3')];function createListener(_0xc68a43,_0x4b24c7){return function(_0xb6fa0f){_0x4b24c7[_0x2a85('0x4')](_0xc68a43,_0xb6fa0f);};}function removeListener(_0x2732bb,_0x2634c3){return function(){PluginEvents[_0x2a85('0x5')](_0x2732bb,_0x2634c3);};}exports[_0x2a85('0x6')]=function(_0xca3655){for(var _0x52d285=0x0,_0x4b5fa3=events[_0x2a85('0x7')];_0x52d285<_0x4b5fa3;_0x52d285++){var _0xcf48e9=events[_0x52d285];var _0xe115e2=createListener('plugin:'+_0xcf48e9,_0xca3655);PluginEvents['on'](_0xcf48e9,_0xe115e2);}};
\ No newline at end of file
diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js
index 7eac62f..513adb8 100644
--- a/server/api/pm2/index.js
+++ b/server/api/pm2/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfeff=['create','put','update','delete','destroy','exports','express','Router','./pm2.controller','get','isAuthenticated','index','/:id','post'];(function(_0x13602f,_0x33369f){var _0x51e639=function(_0x392341){while(--_0x392341){_0x13602f['push'](_0x13602f['shift']());}};_0x51e639(++_0x33369f);}(_0xfeff,0x164));var _0xffef=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xfeff[_0x403c20];return _0x2b271a;};'use strict';var express=require(_0xffef('0x0'));var router=express[_0xffef('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xffef('0x2'));router[_0xffef('0x3')]('/',auth[_0xffef('0x4')](),controller[_0xffef('0x5')]);router[_0xffef('0x3')](_0xffef('0x6'),auth[_0xffef('0x4')](),controller['show']);router[_0xffef('0x7')]('/',auth[_0xffef('0x4')](),controller[_0xffef('0x8')]);router[_0xffef('0x9')](_0xffef('0x6'),auth['isAuthenticated'](),controller[_0xffef('0xa')]);router[_0xffef('0xb')](_0xffef('0x6'),auth['isAuthenticated'](),controller[_0xffef('0xc')]);module[_0xffef('0xd')]=router;
\ No newline at end of file
+var _0xce84=['isAuthenticated','index','/:id','show','update','destroy','exports','express','../../components/auth/service','./pm2.controller','get'];(function(_0x396f00,_0xe41988){var _0x27aeab=function(_0x1ca5c9){while(--_0x1ca5c9){_0x396f00['push'](_0x396f00['shift']());}};_0x27aeab(++_0xe41988);}(_0xce84,0xb7));var _0x4ce8=function(_0x3f5f2a,_0x536aa3){_0x3f5f2a=_0x3f5f2a-0x0;var _0x3ca36b=_0xce84[_0x3f5f2a];return _0x3ca36b;};'use strict';var express=require(_0x4ce8('0x0'));var router=express['Router']();var auth=require(_0x4ce8('0x1'));var controller=require(_0x4ce8('0x2'));router[_0x4ce8('0x3')]('/',auth[_0x4ce8('0x4')](),controller[_0x4ce8('0x5')]);router['get'](_0x4ce8('0x6'),auth['isAuthenticated'](),controller[_0x4ce8('0x7')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4ce8('0x6'),auth[_0x4ce8('0x4')](),controller[_0x4ce8('0x8')]);router['delete'](_0x4ce8('0x6'),auth[_0x4ce8('0x4')](),controller[_0x4ce8('0x9')]);module[_0x4ce8('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js
index 31fa883..82c7bc7 100644
--- a/server/api/pm2/pm2.controller.js
+++ b/server/api/pm2/pm2.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x876c=['restart','stop','Unknown\x20status','delete','path','child_process','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0x876c,0x19b));var _0xc876=function(_0x3ca849,_0x5f1d0d){_0x3ca849=_0x3ca849-0x0;var _0xf30069=_0x876c[_0x3ca849];return _0xf30069;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require('../../config/logger')('api');var path=require(_0xc876('0x0'));var exec=require(_0xc876('0x1'))['exec'];var BPromise=require(_0xc876('0x2'));function handleEntityNotFound(_0x59233f,_0x18d5b1){return function(_0x4adb3f){if(!_0x4adb3f){_0x59233f[_0xc876('0x3')](0x194);;}return _0x4adb3f;};}function respondWithResult(_0x18c4e0,_0x2c3dc2){_0x2c3dc2=_0x2c3dc2||0xc8;return function(_0x2a7dc9){if(_0x2a7dc9){return _0x18c4e0[_0xc876('0x4')](_0x2c3dc2)[_0xc876('0x5')](_0x2a7dc9);}return null;};}function handleError(_0x52acb0,_0x4d4b03){_0x4d4b03=_0x4d4b03||0x1f4;return function(_0x459129){logger[_0xc876('0x6')](_0x459129['stack']);if(_0x459129['name']){delete _0x459129[_0xc876('0x7')];}_0x52acb0[_0xc876('0x4')](_0x4d4b03)[_0xc876('0x8')](_0x459129);};}function execChildProcess(){return new BPromise(function(_0x11e590,_0x39a7af){exec(_0xc876('0x9'),function(_0x48d54c,_0x4c9945,_0x1a794b){logger['info'](_0x4c9945);logger[_0xc876('0xa')](_0x1a794b);if(_0x48d54c){logger[_0xc876('0x6')](_0x48d54c);return _0x39a7af(_0x48d54c);}return _0x11e590(_0x4c9945);});});}exports[_0xc876('0xb')]=function(_0x436a38,_0x12be8f){return pm2[_0xc876('0xc')]()[_0xc876('0xd')](function(_0x33917e){if(_0x33917e){var _0x2a3336=_[_0xc876('0xe')](_0x33917e,function(_0x3d88ec){return _0x3d88ec[_0xc876('0x7')]===_0xc876('0xf')||_0x3d88ec[_0xc876('0x7')]===_0xc876('0x10');});return{'rows':_0x2a3336,'count':_0x2a3336[_0xc876('0x11')]};}return null;})[_0xc876('0xd')](respondWithResult(_0x12be8f,null))[_0xc876('0x12')](handleError(_0x12be8f,null));};exports[_0xc876('0x13')]=function(_0x236020,_0x3dd8e5){return pm2[_0xc876('0x14')](_0x236020[_0xc876('0x15')]['id'])['then'](respondWithResult(_0x3dd8e5,null))[_0xc876('0xd')](handleEntityNotFound(_0x3dd8e5,null))[_0xc876('0x12')](handleError(_0x3dd8e5,null));};exports[_0xc876('0x16')]=function(_0x4ae33b,_0x8d22b4){if(_0x4ae33b[_0xc876('0x17')][_0xc876('0x7')]&&_0x4ae33b['body'][_0xc876('0x18')]){var _0x35bafa=path[_0xc876('0x19')](__dirname,_0xc876('0x1a'),_0x4ae33b[_0xc876('0x17')]['script']);var _0x596f1e=process[_0xc876('0x1b')]();process[_0xc876('0x1c')](path[_0xc876('0x1d')](_0x35bafa));return execChildProcess()[_0xc876('0xd')](function(_0x2f438f){process[_0xc876('0x1c')](_0x596f1e);return pm2[_0xc876('0x1e')]({'name':_0x4ae33b[_0xc876('0x17')][_0xc876('0x7')],'script':_0x35bafa});})['then'](function(_0x2f2110){pm2[_0xc876('0x1f')]();return _0x2f2110[0x0];})[_0xc876('0xd')](respondWithResult(_0x8d22b4,0xc9))[_0xc876('0x12')](handleError(_0x8d22b4,null));}else{return _0x8d22b4['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xc876('0x20')]=function(_0x59cc96,_0x5ab926){if(_0x59cc96['body']['id']){delete _0x59cc96[_0xc876('0x17')]['id'];}var _0x1426f1={'online':_0xc876('0x21'),'stopped':_0xc876('0x22')};if(_0x1426f1['hasOwnProperty'](_0x59cc96[_0xc876('0x17')][_0xc876('0x4')])){return pm2[_0x1426f1[_0x59cc96['body']['status']]](_0x59cc96[_0xc876('0x15')]['id'])[_0xc876('0xd')](respondWithResult(_0x5ab926,0xc8))[_0xc876('0x12')](handleError(_0x5ab926,null));}else{return _0x5ab926[_0xc876('0x4')](0x1f4)[_0xc876('0x8')]({'message':_0xc876('0x23')});}};exports['destroy']=function(_0x30b455,_0x1b012f){if(_0x30b455[_0xc876('0x17')]['id']){delete _0x30b455['body']['id'];}if(_0x30b455['params']['id']){return pm2[_0xc876('0x24')](_0x30b455[_0xc876('0x15')]['id'])['then'](function(_0x5988a8){pm2[_0xc876('0x1f')]();return _0x5988a8[0x0];})[_0xc876('0xd')](respondWithResult(_0x1b012f,null))[_0xc876('0x12')](handleError(_0x1b012f,null));}else{return _0x1b012f[_0xc876('0x4')](0x1f4)[_0xc876('0x8')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0x4d6b=['npm\x20install','info','index','list','then','reject','express','catch','show','describe','params','body','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','api','path','exec','status','error','stack','name','send'];(function(_0x3e5b7b,_0x1ca279){var _0x441af8=function(_0x3931e7){while(--_0x3931e7){_0x3e5b7b['push'](_0x3e5b7b['shift']());}};_0x441af8(++_0x1ca279);}(_0x4d6b,0xfa));var _0xb4d6=function(_0x1c37fe,_0x10a098){_0x1c37fe=_0x1c37fe-0x0;var _0x45e904=_0x4d6b[_0x1c37fe];return _0x45e904;};'use strict';var _=require('lodash');var pm2=require(_0xb4d6('0x0'));var logger=require('../../config/logger')(_0xb4d6('0x1'));var path=require(_0xb4d6('0x2'));var exec=require('child_process')[_0xb4d6('0x3')];var BPromise=require('bluebird');function handleEntityNotFound(_0x8eae2b,_0x329887){return function(_0x3e5b9a){if(!_0x3e5b9a){_0x8eae2b['sendStatus'](0x194);;}return _0x3e5b9a;};}function respondWithResult(_0x55ec07,_0x5580d9){_0x5580d9=_0x5580d9||0xc8;return function(_0x552b87){if(_0x552b87){return _0x55ec07[_0xb4d6('0x4')](_0x5580d9)['json'](_0x552b87);}return null;};}function handleError(_0x1ab56d,_0x3db526){_0x3db526=_0x3db526||0x1f4;return function(_0x21b506){logger[_0xb4d6('0x5')](_0x21b506[_0xb4d6('0x6')]);if(_0x21b506[_0xb4d6('0x7')]){delete _0x21b506['name'];}_0x1ab56d['status'](_0x3db526)[_0xb4d6('0x8')](_0x21b506);};}function execChildProcess(){return new BPromise(function(_0x2ad215,_0x3b3519){exec(_0xb4d6('0x9'),function(_0x647b99,_0x54059b,_0x19745d){logger[_0xb4d6('0xa')](_0x54059b);logger[_0xb4d6('0xa')](_0x19745d);if(_0x647b99){logger[_0xb4d6('0x5')](_0x647b99);return _0x3b3519(_0x647b99);}return _0x2ad215(_0x54059b);});});}exports[_0xb4d6('0xb')]=function(_0x5ac73c,_0x3033f3){return pm2[_0xb4d6('0xc')]()[_0xb4d6('0xd')](function(_0x44bdb1){if(_0x44bdb1){var _0x3baf67=_[_0xb4d6('0xe')](_0x44bdb1,function(_0x145326){return _0x145326[_0xb4d6('0x7')]===_0xb4d6('0xf')||_0x145326['name']==='motion2';});return{'rows':_0x3baf67,'count':_0x3baf67['length']};}return null;})[_0xb4d6('0xd')](respondWithResult(_0x3033f3,null))[_0xb4d6('0x10')](handleError(_0x3033f3,null));};exports[_0xb4d6('0x11')]=function(_0x27a670,_0x295a9d){return pm2[_0xb4d6('0x12')](_0x27a670[_0xb4d6('0x13')]['id'])[_0xb4d6('0xd')](respondWithResult(_0x295a9d,null))['then'](handleEntityNotFound(_0x295a9d,null))[_0xb4d6('0x10')](handleError(_0x295a9d,null));};exports['create']=function(_0x3128e1,_0x39cf12){if(_0x3128e1[_0xb4d6('0x14')][_0xb4d6('0x7')]&&_0x3128e1[_0xb4d6('0x14')]['script']){var _0x3888c7=path[_0xb4d6('0x15')](__dirname,_0xb4d6('0x16'),_0x3128e1['body']['script']);var _0x314497=process[_0xb4d6('0x17')]();process[_0xb4d6('0x18')](path[_0xb4d6('0x19')](_0x3888c7));return execChildProcess()[_0xb4d6('0xd')](function(_0x5f71bd){process[_0xb4d6('0x18')](_0x314497);return pm2[_0xb4d6('0x1a')]({'name':_0x3128e1[_0xb4d6('0x14')][_0xb4d6('0x7')],'script':_0x3888c7});})[_0xb4d6('0xd')](function(_0x33f1be){pm2[_0xb4d6('0x1b')]();return _0x33f1be[0x0];})['then'](respondWithResult(_0x39cf12,0xc9))[_0xb4d6('0x10')](handleError(_0x39cf12,null));}else{return _0x39cf12[_0xb4d6('0x4')](0x1f4)[_0xb4d6('0x8')]({'message':_0xb4d6('0x1c')});}};exports[_0xb4d6('0x1d')]=function(_0x5ecd77,_0x43cc4a){if(_0x5ecd77['body']['id']){delete _0x5ecd77[_0xb4d6('0x14')]['id'];}var _0x3c021f={'online':_0xb4d6('0x1e'),'stopped':_0xb4d6('0x1f')};if(_0x3c021f[_0xb4d6('0x20')](_0x5ecd77['body'][_0xb4d6('0x4')])){return pm2[_0x3c021f[_0x5ecd77[_0xb4d6('0x14')][_0xb4d6('0x4')]]](_0x5ecd77[_0xb4d6('0x13')]['id'])[_0xb4d6('0xd')](respondWithResult(_0x43cc4a,0xc8))[_0xb4d6('0x10')](handleError(_0x43cc4a,null));}else{return _0x43cc4a[_0xb4d6('0x4')](0x1f4)[_0xb4d6('0x8')]({'message':_0xb4d6('0x21')});}};exports[_0xb4d6('0x22')]=function(_0x46e766,_0x581104){if(_0x46e766['body']['id']){delete _0x46e766['body']['id'];}if(_0x46e766['params']['id']){return pm2[_0xb4d6('0x23')](_0x46e766[_0xb4d6('0x13')]['id'])[_0xb4d6('0xd')](function(_0x51e345){pm2[_0xb4d6('0x1b')]();return _0x51e345[0x0];})['then'](respondWithResult(_0x581104,null))[_0xb4d6('0x10')](handleError(_0x581104,null));}else{return _0x581104[_0xb4d6('0x4')](0x1f4)[_0xb4d6('0x8')]({'message':_0xb4d6('0x24')});}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js
index d710483..21464ea 100644
--- a/server/api/reportAgentPreview/index.js
+++ b/server/api/reportAgentPreview/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x972f=['path','connect-timeout','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x17e0ff,_0x4dbd1e){var _0x357979=function(_0x443276){while(--_0x443276){_0x17e0ff['push'](_0x17e0ff['shift']());}};_0x357979(++_0x4dbd1e);}(_0x972f,0x136));var _0xf972=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x972f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf972('0x0'));var util=require(_0xf972('0x1'));var path=require(_0xf972('0x2'));var timeout=require(_0xf972('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf972('0x4'));var config=require(_0xf972('0x5'));module['exports']=router;
\ No newline at end of file
+var _0xfc07=['../../config/environment','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xab9f3d,_0xb336fa){var _0x5283bf=function(_0x505e6c){while(--_0x505e6c){_0xab9f3d['push'](_0xab9f3d['shift']());}};_0x5283bf(++_0xb336fa);}(_0xfc07,0x72));var _0x7fc0=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0xfc07[_0x5b7788];return _0x573871;};'use strict';var multer=require(_0x7fc0('0x0'));var util=require('util');var path=require(_0x7fc0('0x1'));var timeout=require(_0x7fc0('0x2'));var express=require('express');var router=express[_0x7fc0('0x3')]();var auth=require(_0x7fc0('0x4'));var interaction=require(_0x7fc0('0x5'));var config=require(_0x7fc0('0x6'));module[_0x7fc0('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js
index 3385fea..6fd26cf 100644
--- a/server/api/reportAgentPreview/reportAgentPreview.attributes.js
+++ b/server/api/reportAgentPreview/reportAgentPreview.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7727=['DATE','sequelize','exports','STRING'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x7727,0x129));var _0x7772=function(_0x3d7de8,_0x2a2ec4){_0x3d7de8=_0x3d7de8-0x0;var _0x5e9a0c=_0x7727[_0x3d7de8];return _0x5e9a0c;};'use strict';var Sequelize=require(_0x7772('0x0'));module[_0x7772('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x7772('0x2')]},'scheduledat':{'type':Sequelize[_0x7772('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7772('0x3')]},'responsetime':{'type':Sequelize[_0x7772('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7772('0x2')]},'campaigntype':{'type':Sequelize[_0x7772('0x2')]},'membername':{'type':Sequelize[_0x7772('0x2')]}};
\ No newline at end of file
+var _0xdcd8=['STRING','INTEGER','exports','DATE'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0xdcd8,0xc2));var _0x8dcd=function(_0x349c2f,_0x41bd46){_0x349c2f=_0x349c2f-0x0;var _0x5ef6c6=_0xdcd8[_0x349c2f];return _0x5ef6c6;};'use strict';var Sequelize=require('sequelize');module[_0x8dcd('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x8dcd('0x1')]},'uniqueid':{'type':Sequelize[_0x8dcd('0x2')]},'starttime':{'type':Sequelize[_0x8dcd('0x1')]},'responsetime':{'type':Sequelize[_0x8dcd('0x1')]},'ringtime':{'type':Sequelize[_0x8dcd('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8dcd('0x2')]},'campaigntype':{'type':Sequelize[_0x8dcd('0x2')]},'membername':{'type':Sequelize[_0x8dcd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js
index 915baf9..f1267db 100644
--- a/server/api/reportAgentPreview/reportAgentPreview.model.js
+++ b/server/api/reportAgentPreview/reportAgentPreview.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9a24=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview'];(function(_0x506666,_0xce2758){var _0x567a41=function(_0x26a160){while(--_0x26a160){_0x506666['push'](_0x506666['shift']());}};_0x567a41(++_0xce2758);}(_0x9a24,0x134));var _0x49a2=function(_0x5f2481,_0x313fd9){_0x5f2481=_0x5f2481-0x0;var _0x49f81f=_0x9a24[_0x5f2481];return _0x49f81f;};'use strict';var _=require('lodash');var util=require(_0x49a2('0x0'));var logger=require(_0x49a2('0x1'))(_0x49a2('0x2'));var moment=require(_0x49a2('0x3'));var BPromise=require('bluebird');var rp=require(_0x49a2('0x4'));var fs=require('fs');var path=require(_0x49a2('0x5'));var rimraf=require('rimraf');var config=require(_0x49a2('0x6'));var attributes=require(_0x49a2('0x7'));module[_0x49a2('0x8')]=function(_0x1c27a0,_0x1785ac){return _0x1c27a0[_0x49a2('0x9')](_0x49a2('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14f8=['request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','../../config/logger','api','moment','bluebird'];(function(_0x312835,_0xff273e){var _0x1da8b9=function(_0x193c4){while(--_0x193c4){_0x312835['push'](_0x312835['shift']());}};_0x1da8b9(++_0xff273e);}(_0x14f8,0x11a));var _0x814f=function(_0x59d601,_0x4680af){_0x59d601=_0x59d601-0x0;var _0x34404b=_0x14f8[_0x59d601];return _0x34404b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x814f('0x0'))(_0x814f('0x1'));var moment=require(_0x814f('0x2'));var BPromise=require(_0x814f('0x3'));var rp=require(_0x814f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x814f('0x5'));var config=require(_0x814f('0x6'));var attributes=require(_0x814f('0x7'));module[_0x814f('0x8')]=function(_0x4b5b26,_0xd0824c){return _0x4b5b26[_0x814f('0x9')](_0x814f('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js
index 3ac3a1b..ab68457 100644
--- a/server/api/reportAgentPreview/reportAgentPreview.rpc.js
+++ b/server/api/reportAgentPreview/reportAgentPreview.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc8f1=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x4e4a09,_0xe4eac8){var _0x17a756=function(_0x23b5ef){while(--_0x23b5ef){_0x4e4a09['push'](_0x4e4a09['shift']());}};_0x17a756(++_0xe4eac8);}(_0xc8f1,0x72));var _0x1c8f=function(_0x49dcb0,_0x148c64){_0x49dcb0=_0x49dcb0-0x0;var _0xe43e30=_0xc8f1[_0x49dcb0];return _0xe43e30;};'use strict';var _=require(_0x1c8f('0x0'));var util=require(_0x1c8f('0x1'));var moment=require('moment');var BPromise=require(_0x1c8f('0x2'));var rs=require(_0x1c8f('0x3'));var fs=require('fs');var Redis=require(_0x1c8f('0x4'));var db=require(_0x1c8f('0x5'))['db'];var utils=require(_0x1c8f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1c8f('0x7'));var jayson=require(_0x1c8f('0x8'));var client=jayson[_0x1c8f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x154530,_0x13d08a,_0x125068){return new BPromise(function(_0x216a32,_0x1eee6e){return client[_0x1c8f('0xa')](_0x154530,_0x125068)[_0x1c8f('0xb')](function(_0x1b71e1){logger[_0x1c8f('0xc')](_0x1c8f('0xd'),_0x13d08a,_0x1c8f('0xe'));logger[_0x1c8f('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x13d08a,_0x1c8f('0xe'),JSON[_0x1c8f('0x10')](_0x1b71e1));if(_0x1b71e1[_0x1c8f('0x11')]){if(_0x1b71e1[_0x1c8f('0x11')][_0x1c8f('0x12')]===0x1f4){logger['error'](_0x1c8f('0xd'),_0x13d08a,_0x1b71e1[_0x1c8f('0x11')][_0x1c8f('0x13')]);return _0x1eee6e(_0x1b71e1[_0x1c8f('0x11')][_0x1c8f('0x13')]);}logger[_0x1c8f('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x13d08a,_0x1b71e1['error']['message']);return _0x216a32(_0x1b71e1[_0x1c8f('0x11')][_0x1c8f('0x13')]);}else{logger[_0x1c8f('0xc')](_0x1c8f('0xd'),_0x13d08a,_0x1c8f('0xe'));_0x216a32(_0x1b71e1[_0x1c8f('0x14')][_0x1c8f('0x13')]);}})['catch'](function(_0x2983c8){logger[_0x1c8f('0x11')](_0x1c8f('0xd'),_0x13d08a,_0x2983c8);_0x1eee6e(_0x2983c8);});});}exports[_0x1c8f('0x15')]=function(_0x133e10){var _0x4bee45=this;return new Promise(function(_0x2a4842,_0x185a45){return db[_0x1c8f('0x16')][_0x1c8f('0x17')](_0x133e10[_0x1c8f('0x18')],{'raw':_0x133e10[_0x1c8f('0x19')]?_0x133e10['options'][_0x1c8f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1cc61e){logger[_0x1c8f('0xc')](_0x1c8f('0x15'),_0x133e10);logger['debug'](_0x1c8f('0x15'),_0x133e10,JSON[_0x1c8f('0x10')](_0x1cc61e));_0x2a4842(_0x1cc61e);})['catch'](function(_0x130604){logger[_0x1c8f('0x11')](_0x1c8f('0x15'),_0x130604[_0x1c8f('0x13')],_0x133e10);_0x185a45(_0x4bee45[_0x1c8f('0x11')](0x1f4,_0x130604[_0x1c8f('0x13')]));});});};
\ No newline at end of file
+var _0x7ba0=['bluebird','randomstring','ioredis','../../mysqldb','rpc','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','ReportAgentPreview','body','options','raw','CreateReportAgentPreview','stringify','lodash','util','moment'];(function(_0x3a3bde,_0x2e9c4b){var _0x2d8dc7=function(_0x4f2fba){while(--_0x4f2fba){_0x3a3bde['push'](_0x3a3bde['shift']());}};_0x2d8dc7(++_0x2e9c4b);}(_0x7ba0,0xde));var _0x07ba=function(_0x389f26,_0x507f94){_0x389f26=_0x389f26-0x0;var _0x4fd3e6=_0x7ba0[_0x389f26];return _0x4fd3e6;};'use strict';var _=require(_0x07ba('0x0'));var util=require(_0x07ba('0x1'));var moment=require(_0x07ba('0x2'));var BPromise=require(_0x07ba('0x3'));var rs=require(_0x07ba('0x4'));var fs=require('fs');var Redis=require(_0x07ba('0x5'));var db=require(_0x07ba('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x07ba('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x07ba('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22b50b,_0x5e8824,_0x52be30){return new BPromise(function(_0x48a843,_0x333a13){return client[_0x07ba('0x9')](_0x22b50b,_0x52be30)['then'](function(_0x4b5cab){logger[_0x07ba('0xa')](_0x07ba('0xb'),_0x5e8824,_0x07ba('0xc'));logger[_0x07ba('0xd')](_0x07ba('0xe'),_0x5e8824,_0x07ba('0xc'),JSON['stringify'](_0x4b5cab));if(_0x4b5cab['error']){if(_0x4b5cab[_0x07ba('0xf')][_0x07ba('0x10')]===0x1f4){logger[_0x07ba('0xf')](_0x07ba('0xb'),_0x5e8824,_0x4b5cab[_0x07ba('0xf')][_0x07ba('0x11')]);return _0x333a13(_0x4b5cab[_0x07ba('0xf')][_0x07ba('0x11')]);}logger[_0x07ba('0xf')](_0x07ba('0xb'),_0x5e8824,_0x4b5cab[_0x07ba('0xf')][_0x07ba('0x11')]);return _0x48a843(_0x4b5cab[_0x07ba('0xf')][_0x07ba('0x11')]);}else{logger['info'](_0x07ba('0xb'),_0x5e8824,_0x07ba('0xc'));_0x48a843(_0x4b5cab[_0x07ba('0x12')][_0x07ba('0x11')]);}})['catch'](function(_0x2236ba){logger[_0x07ba('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x5e8824,_0x2236ba);_0x333a13(_0x2236ba);});});}exports['CreateReportAgentPreview']=function(_0x5e5a6f){var _0x4a0b9e=this;return new Promise(function(_0x4835b0,_0x2abad9){return db[_0x07ba('0x13')]['create'](_0x5e5a6f[_0x07ba('0x14')],{'raw':_0x5e5a6f[_0x07ba('0x15')]?_0x5e5a6f[_0x07ba('0x15')][_0x07ba('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3ccb8f){logger[_0x07ba('0xa')](_0x07ba('0x17'),_0x5e5a6f);logger[_0x07ba('0xd')]('CreateReportAgentPreview',_0x5e5a6f,JSON[_0x07ba('0x18')](_0x3ccb8f));_0x4835b0(_0x3ccb8f);})['catch'](function(_0x110b60){logger['error']('CreateReportAgentPreview',_0x110b60[_0x07ba('0x11')],_0x5e5a6f);_0x2abad9(_0x4a0b9e[_0x07ba('0xf')](0x1f4,_0x110b60[_0x07ba('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js
index a948d1f..27a6dfc 100644
--- a/server/api/rpc/index.js
+++ b/server/api/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88a4=['fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/:id','/outbound','outbound','/agents','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify'];(function(_0x5312ca,_0x1dd8f7){var _0x4b2505=function(_0xce6860){while(--_0xce6860){_0x5312ca['push'](_0x5312ca['shift']());}};_0x4b2505(++_0x1dd8f7);}(_0x88a4,0x12f));var _0x488a=function(_0x470cfd,_0x47c685){_0x470cfd=_0x470cfd-0x0;var _0x30d77c=_0x88a4[_0x470cfd];return _0x30d77c;};'use strict';var multer=require(_0x488a('0x0'));var util=require(_0x488a('0x1'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require(_0x488a('0x2'));var controller=require(_0x488a('0x3'));router['get'](_0x488a('0x4'),auth[_0x488a('0x5')](),controller[_0x488a('0x6')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x488a('0x5')](),controller[_0x488a('0x7')]);router[_0x488a('0x8')](_0x488a('0x9'),auth[_0x488a('0x5')](),controller['voiceChannelStopMixMonitor']);router[_0x488a('0x8')]('/voice/queues',auth[_0x488a('0x5')](),controller[_0x488a('0xa')]);router[_0x488a('0x8')](_0x488a('0xb'),auth[_0x488a('0x5')](),controller[_0x488a('0xc')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router[_0x488a('0x8')](_0x488a('0xd'),auth[_0x488a('0x5')](),controller[_0x488a('0xe')]);router[_0x488a('0x8')](_0x488a('0xf'),auth['isAuthenticated'](),controller[_0x488a('0x10')]);router[_0x488a('0x8')]('/sms/queues',auth[_0x488a('0x5')](),controller[_0x488a('0x11')]);router[_0x488a('0x8')](_0x488a('0x12'),auth[_0x488a('0x5')](),controller['whatsappQueues']);router[_0x488a('0x8')](_0x488a('0x13'),auth[_0x488a('0x5')](),controller[_0x488a('0x14')]);router[_0x488a('0x8')](_0x488a('0x15'),auth[_0x488a('0x5')](),controller['voiceQueuesPreview']);router[_0x488a('0x8')]('/voice/queues/channels',auth[_0x488a('0x5')](),controller[_0x488a('0x16')]);router[_0x488a('0x8')](_0x488a('0x17'),auth[_0x488a('0x5')](),controller[_0x488a('0x18')]);router[_0x488a('0x8')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x488a('0x5')](),controller[_0x488a('0x19')]);router[_0x488a('0x8')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x488a('0x5')](),controller['voiceQueuesChannelRedirect']);router[_0x488a('0x8')](_0x488a('0x1a'),auth[_0x488a('0x5')](),controller['showVoiceQueues']);router['get'](_0x488a('0x1b'),auth[_0x488a('0x5')](),controller[_0x488a('0x1c')]);router[_0x488a('0x8')]('/outbound/channels',auth[_0x488a('0x5')](),controller['outboundChannels']);router[_0x488a('0x8')](_0x488a('0x1d'),auth['isAuthenticated'](),controller['agents']);router['put']('/agents/:id/capacity',auth[_0x488a('0x5')](),controller['agentCapacity']);router['get'](_0x488a('0x1e'),auth[_0x488a('0x5')](),controller[_0x488a('0x1f')]);router[_0x488a('0x8')](_0x488a('0x20'),auth[_0x488a('0x5')](),controller[_0x488a('0x21')]);router[_0x488a('0x8')](_0x488a('0x22'),auth[_0x488a('0x5')](),controller[_0x488a('0x23')]);router[_0x488a('0x8')]('/fax/accounts',auth[_0x488a('0x5')](),controller[_0x488a('0x24')]);router[_0x488a('0x8')](_0x488a('0x25'),auth[_0x488a('0x5')](),controller[_0x488a('0x26')]);router[_0x488a('0x8')](_0x488a('0x27'),auth[_0x488a('0x5')](),controller[_0x488a('0x28')]);router['get'](_0x488a('0x29'),auth[_0x488a('0x5')](),controller[_0x488a('0x2a')]);router[_0x488a('0x8')]('/sms/queues/waitinginteractions',auth[_0x488a('0x5')](),controller[_0x488a('0x2b')]);router[_0x488a('0x8')](_0x488a('0x2c'),auth[_0x488a('0x5')](),controller[_0x488a('0x2d')]);router[_0x488a('0x8')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x488a('0x2e')]);router[_0x488a('0x2f')]('/mail/queues/:id/notify',auth[_0x488a('0x5')](),controller['queueNotify'](_0x488a('0x30')));router['get'](_0x488a('0x31'),auth[_0x488a('0x5')](),controller[_0x488a('0x32')]);router[_0x488a('0x2f')](_0x488a('0x33'),auth[_0x488a('0x5')](),controller[_0x488a('0x34')](_0x488a('0x35')));router['get'](_0x488a('0x36'),auth[_0x488a('0x5')](),controller[_0x488a('0x37')]);router[_0x488a('0x2f')](_0x488a('0x38'),auth[_0x488a('0x5')](),controller[_0x488a('0x34')](_0x488a('0x39')));router['get'](_0x488a('0x3a'),auth[_0x488a('0x5')](),controller['showFaxQueues']);router['post'](_0x488a('0x3b'),auth[_0x488a('0x5')](),controller[_0x488a('0x34')](_0x488a('0x3c')));router[_0x488a('0x8')](_0x488a('0x3d'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x488a('0x2f')](_0x488a('0x3e'),auth['isAuthenticated'](),controller[_0x488a('0x34')]('sms'));router['post'](_0x488a('0x3f'),auth['isAuthenticated'](),controller[_0x488a('0x34')](_0x488a('0x40')));router['get'](_0x488a('0x41'),auth[_0x488a('0x5')](),controller[_0x488a('0x42')]);router[_0x488a('0x8')](_0x488a('0x43'),auth[_0x488a('0x5')](),controller[_0x488a('0x44')]);router[_0x488a('0x2f')](_0x488a('0x45'),auth['isAuthenticated'](),controller[_0x488a('0x46')]);module[_0x488a('0x47')]=router;
\ No newline at end of file
+var _0xabcd=['voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','/mail/queues/:id','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','../../components/auth/service','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels'];(function(_0xeaf098,_0x303cff){var _0xf04aa7=function(_0x4dda38){while(--_0x4dda38){_0xeaf098['push'](_0xeaf098['shift']());}};_0xf04aa7(++_0x303cff);}(_0xabcd,0x88));var _0xdabc=function(_0x4ee6af,_0x2481ad){_0x4ee6af=_0x4ee6af-0x0;var _0x25d9b2=_0xabcd[_0x4ee6af];return _0x25d9b2;};'use strict';var multer=require(_0xdabc('0x0'));var util=require(_0xdabc('0x1'));var path=require(_0xdabc('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xdabc('0x3'));var controller=require('./rpc.controller');router['get'](_0xdabc('0x4'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x6')]);router[_0xdabc('0x7')](_0xdabc('0x8'),auth['isAuthenticated'](),controller[_0xdabc('0x9')]);router['get'](_0xdabc('0xa'),auth[_0xdabc('0x5')](),controller[_0xdabc('0xb')]);router['get'](_0xdabc('0xc'),auth['isAuthenticated'](),controller[_0xdabc('0xd')]);router[_0xdabc('0x7')](_0xdabc('0xe'),auth[_0xdabc('0x5')](),controller[_0xdabc('0xf')]);router[_0xdabc('0x7')]('/mail/queues',auth[_0xdabc('0x5')](),controller[_0xdabc('0x10')]);router[_0xdabc('0x7')](_0xdabc('0x11'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x12')]);router['get']('/openchannel/queues',auth['isAuthenticated'](),controller['openchannelQueues']);router[_0xdabc('0x7')](_0xdabc('0x13'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x14')]);router[_0xdabc('0x7')](_0xdabc('0x15'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x16')]);router[_0xdabc('0x7')](_0xdabc('0x17'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x18')]);router['get'](_0xdabc('0x19'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x1a')]);router[_0xdabc('0x7')](_0xdabc('0x1b'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x1c')]);router[_0xdabc('0x7')](_0xdabc('0x1d'),auth['isAuthenticated'](),controller[_0xdabc('0x1e')]);router[_0xdabc('0x7')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xdabc('0x5')](),controller['voiceQueuesChannelHangup']);router[_0xdabc('0x7')](_0xdabc('0x1f'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x20')]);router[_0xdabc('0x7')](_0xdabc('0x21'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x22')]);router[_0xdabc('0x7')](_0xdabc('0x23'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x24')]);router['get'](_0xdabc('0x25'),auth['isAuthenticated'](),controller[_0xdabc('0x26')]);router[_0xdabc('0x7')](_0xdabc('0x27'),auth['isAuthenticated'](),controller[_0xdabc('0x28')]);router[_0xdabc('0x29')](_0xdabc('0x2a'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x2b')]);router[_0xdabc('0x7')](_0xdabc('0x2c'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x2d')]);router[_0xdabc('0x7')](_0xdabc('0x2e'),auth[_0xdabc('0x5')](),controller['trunks']);router['get'](_0xdabc('0x2f'),auth['isAuthenticated'](),controller[_0xdabc('0x30')]);router[_0xdabc('0x7')](_0xdabc('0x31'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x32')]);router[_0xdabc('0x7')]('/chat/queues/waitinginteractions',auth[_0xdabc('0x5')](),controller[_0xdabc('0x33')]);router[_0xdabc('0x7')](_0xdabc('0x34'),auth['isAuthenticated'](),controller[_0xdabc('0x35')]);router['get'](_0xdabc('0x36'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x37')]);router['get'](_0xdabc('0x38'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router['get']('/whatsapp/queues/waitinginteractions',auth[_0xdabc('0x5')](),controller[_0xdabc('0x39')]);router[_0xdabc('0x7')](_0xdabc('0x3a'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x3b')]);router[_0xdabc('0x3c')](_0xdabc('0x3d'),auth[_0xdabc('0x5')](),controller['queueNotify']('mail'));router[_0xdabc('0x7')](_0xdabc('0x3e'),auth['isAuthenticated'](),controller['showMailQueues']);router['post'](_0xdabc('0x3f'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x40')](_0xdabc('0x41')));router['get'](_0xdabc('0x42'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x43')]);router['post'](_0xdabc('0x44'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x40')]('fax'));router['get']('/fax/queues/:id',auth[_0xdabc('0x5')](),controller[_0xdabc('0x45')]);router[_0xdabc('0x3c')]('/openchannel/queues/:id/notify',auth[_0xdabc('0x5')](),controller['queueNotify'](_0xdabc('0x46')));router['get'](_0xdabc('0x47'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x48')]);router[_0xdabc('0x3c')](_0xdabc('0x49'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x40')]('sms'));router[_0xdabc('0x3c')]('/whatsapp/queues/:id/notify',auth[_0xdabc('0x5')](),controller[_0xdabc('0x40')](_0xdabc('0x4a')));router['get'](_0xdabc('0x4b'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x4c')]);router[_0xdabc('0x7')](_0xdabc('0x4d'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x4e')]);router[_0xdabc('0x3c')](_0xdabc('0x4f'),auth[_0xdabc('0x5')](),controller[_0xdabc('0x50')]);module[_0xdabc('0x51')]=router;
\ No newline at end of file
diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js
index 477ebfd..d2cd15e 100644
--- a/server/api/rpc/rpc.controller.js
+++ b/server/api/rpc/rpc.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2480=['result','catch','json','name','status','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','body','user','interaction','findAll','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','format','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','From','TransferReport','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','MessageId','create','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','http','client','request','then','error','message'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0x2480,0x1c9));var _0x0248=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2480[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0248('0x0'));var _=require(_0x0248('0x1'));var util=require(_0x0248('0x2'));var db=require(_0x0248('0x3'))['db'];var logger=require(_0x0248('0x4'))('api');var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x0248('0x5')]({'port':0x232a});var mailClient=jayson[_0x0248('0x6')][_0x0248('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x0248('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x31c4e9,_0x50cd43,_0x422dbe){return new BPromise(function(_0x7b9b3,_0x257506){var _0x2ab025=_0x422dbe?_0x422dbe:amiClient;return _0x2ab025[_0x0248('0x7')](_0x31c4e9,_0x50cd43)[_0x0248('0x8')](function(_0x4e0772){if(_0x4e0772[_0x0248('0x9')]){if(_0x4e0772['error']['code']===0x1f4){return _0x257506(_0x4e0772['error'][_0x0248('0xa')]);}return _0x7b9b3(_0x4e0772[_0x0248('0x9')][_0x0248('0xa')]);}else{_0x7b9b3(_0x4e0772[_0x0248('0xb')]);}})[_0x0248('0xc')](function(_0x234663){_0x257506(_0x234663);});});}function respondWithResult(_0x480c1d,_0x1d1f40){_0x1d1f40=_0x1d1f40||0xc8;return function(_0x3b0539){if(_0x3b0539){return _0x480c1d['status'](_0x1d1f40)[_0x0248('0xd')](_0x3b0539);}return _0x480c1d['sendStatus'](0x194);};}function handleError(_0x412920,_0x17f98f){_0x17f98f=_0x17f98f||0x1f4;return function(_0x535776){logger[_0x0248('0x9')](_0x535776['stack']);if(_0x535776[_0x0248('0xe')]){delete _0x535776[_0x0248('0xe')];}_0x412920[_0x0248('0xf')](_0x17f98f)[_0x0248('0x10')](_0x535776);};}function findById(_0x4eb1c4){return function(_0x329f33){if(!_['isNil'](_0x4eb1c4)&&!_[_0x0248('0x11')](_0x329f33)&&!_['isNil'](_0x329f33[_0x0248('0x12')])){return _['find'](_0x329f33[_0x0248('0x12')],function(_0x57a94c){return _0x57a94c['id']==_0x4eb1c4;});}return null;};}exports[_0x0248('0x13')]=function(_0x2e9678,_0x457be0){return respondWithRpcPromise(_0x0248('0x14'),_0x2e9678[_0x0248('0x15')])[_0x0248('0x8')](respondWithResult(_0x457be0,null))[_0x0248('0xc')](handleError(_0x457be0,null));};exports[_0x0248('0x16')]=function(_0x452b50,_0x2e817a){return respondWithRpcPromise(_0x0248('0x17'),_[_0x0248('0x18')](_0x452b50[_0x0248('0x15')],_0x452b50[_0x0248('0x19')]))[_0x0248('0x8')](respondWithResult(_0x2e817a,null))['catch'](handleError(_0x2e817a,null));};exports[_0x0248('0x1a')]=function(_0x1cbcc9,_0x5b4c09){return respondWithRpcPromise(_0x0248('0x1b'),_['merge'](_0x1cbcc9[_0x0248('0x15')],_0x1cbcc9[_0x0248('0x19')]))[_0x0248('0x8')](respondWithResult(_0x5b4c09,null))[_0x0248('0xc')](handleError(_0x5b4c09,null));};exports[_0x0248('0x1c')]=function(_0x5395a6,_0x1a1e3f){return respondWithRpcPromise(_0x0248('0x1d'),_0x5395a6[_0x0248('0x15')])['then'](respondWithResult(_0x1a1e3f,null))[_0x0248('0xc')](handleError(_0x1a1e3f,null));};exports['showVoiceQueues']=function(_0xbd7d2a,_0x41fc4f){return respondWithRpcPromise(_0x0248('0x1d'),_0xbd7d2a[_0x0248('0x15')])[_0x0248('0x8')](findById(_0xbd7d2a['params']['id']))[_0x0248('0x8')](respondWithResult(_0x41fc4f,null))['catch'](handleError(_0x41fc4f,null));};exports[_0x0248('0x1e')]=function(_0x14ecfe,_0x3f8156){return respondWithRpcPromise(_0x0248('0x1f'),_['merge'](_0x14ecfe[_0x0248('0x15')],_0x14ecfe[_0x0248('0x19')]))[_0x0248('0x8')](respondWithResult(_0x3f8156,null))[_0x0248('0xc')](handleError(_0x3f8156,null));};exports[_0x0248('0x20')]=function(_0x497341,_0x130714){return respondWithRpcPromise(_0x0248('0x21'),_0x497341[_0x0248('0x15')])['then'](respondWithResult(_0x130714,null))[_0x0248('0xc')](handleError(_0x130714,null));};exports[_0x0248('0x22')]=function(_0x2b12f3,_0x204490){return respondWithRpcPromise(_0x0248('0x23'),_[_0x0248('0x18')](_0x2b12f3['query'],_0x2b12f3[_0x0248('0x19')]))[_0x0248('0x8')](respondWithResult(_0x204490,null))[_0x0248('0xc')](handleError(_0x204490,null));};exports[_0x0248('0x24')]=function(_0x5c992c,_0x2f08e7){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x0248('0x18')](_0x5c992c[_0x0248('0x15')],_0x5c992c[_0x0248('0x19')]))[_0x0248('0x8')](respondWithResult(_0x2f08e7,null))[_0x0248('0xc')](handleError(_0x2f08e7,null));};exports[_0x0248('0x25')]=function(_0x27c817,_0x142971){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x0248('0x18')](_0x27c817[_0x0248('0x15')],_0x27c817[_0x0248('0x19')]))[_0x0248('0x8')](respondWithResult(_0x142971,null))[_0x0248('0xc')](handleError(_0x142971,null));};exports[_0x0248('0x26')]=function(_0x4dcf14,_0x3ec7c9){return respondWithRpcPromise(_0x0248('0x27'),_0x4dcf14['query'])[_0x0248('0x8')](respondWithResult(_0x3ec7c9,null))[_0x0248('0xc')](handleError(_0x3ec7c9,null));};exports[_0x0248('0x28')]=function(_0x512ec9,_0x19c04a){return respondWithRpcPromise('OutboundChannels',_0x512ec9['query'])[_0x0248('0x8')](respondWithResult(_0x19c04a,null))['catch'](handleError(_0x19c04a,null));};exports[_0x0248('0x29')]=function(_0x378a1f,_0x3ff848){var _0x89ddca;return respondWithRpcPromise('Agents',_0x378a1f[_0x0248('0x15')])[_0x0248('0x8')](function(_0x493b42){_0x89ddca=_0x493b42;return respondWithRpcPromise(_0x0248('0x2a'),_0x378a1f[_0x0248('0x15')],routingClient);})[_0x0248('0x8')](function(_0x41ebea){return _[_0x0248('0x18')]({},_0x41ebea,_0x89ddca);})[_0x0248('0x8')](respondWithResult(_0x3ff848,null))['catch'](handleError(_0x3ff848,null));};exports['agentCapacity']=function(_0x57181e,_0x262af7){if(_0x57181e[_0x0248('0x2b')]&&_0x57181e['body']['interaction']&&_0x57181e[_0x0248('0x2c')]&&_0x57181e[_0x0248('0x2c')][_0x0248('0xe')]){for(var _0x47108f in _0x57181e[_0x0248('0x2b')][_0x0248('0x2d')]){if(_0x57181e[_0x0248('0x2b')][_0x0248('0x2d')]['hasOwnProperty'](_0x47108f)){db['MemberReport'][_0x0248('0x2e')]({'where':{'channel':_0x47108f,'membername':_0x57181e[_0x0248('0x2c')][_0x0248('0xe')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x57181e[_0x0248('0x2b')]['interaction'][_0x47108f]&&_0x57181e['body'][_0x0248('0x2d')][_0x47108f][_0x0248('0x2f')]?{'$notIn':_0x57181e[_0x0248('0x2b')][_0x0248('0x2d')][_0x47108f]}:{'$ne':null}}})['then'](function(_0x394499){var _0x3c51f7=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x333519=0x0,_0x407940=_0x394499[_0x0248('0x2f')];_0x333519<_0x407940;_0x333519+=0x1){_0x394499[_0x333519][_0x0248('0x30')]({'exitAt':_0x3c51f7});}});for(var _0x1bc32d=0x0;_0x1bc32d<_0x57181e['body'][_0x0248('0x2d')][_0x47108f][_0x0248('0x2f')];_0x1bc32d+=0x1){db[_0x0248('0x31')][_0x0248('0x32')]({'where':{'channel':_0x47108f,'membername':_0x57181e[_0x0248('0x2c')][_0x0248('0xe')],'type':_0x0248('0x33'),'uniqueid':_0x57181e[_0x0248('0x2b')][_0x0248('0x2d')][_0x47108f][_0x1bc32d],'exitAt':null},'defaults':{'channel':_0x47108f,'membername':_0x57181e[_0x0248('0x2c')][_0x0248('0xe')],'interface':_[_0x0248('0x11')](_0x57181e[_0x0248('0x2c')][_0x0248('0x34')])?util[_0x0248('0x35')]('SIP/%s',_0x57181e[_0x0248('0x2c')]['name']):_0x57181e[_0x0248('0x2c')][_0x0248('0x34')],'type':_0x0248('0x33'),'enterAt':moment()['format'](_0x0248('0x36')),'role':_0x0248('0x37'),'internal':_0x57181e[_0x0248('0x2c')][_0x0248('0x38')],'uniqueid':_0x57181e[_0x0248('0x2b')]['interaction'][_0x47108f][_0x1bc32d]}});}}}}return respondWithRpcPromise(_0x0248('0x39'),{'id':_0x57181e[_0x0248('0x19')]['id'],'capacity':_0x57181e[_0x0248('0x2b')][_0x0248('0x3a')]},routingClient)[_0x0248('0x8')](respondWithResult(_0x262af7,null))[_0x0248('0xc')](handleError(_0x262af7,null));};exports['telephones']=function(_0x4f7c5c,_0x2357fd){return respondWithRpcPromise('Telephones',_0x4f7c5c['query'])[_0x0248('0x8')](respondWithResult(_0x2357fd,null))[_0x0248('0xc')](handleError(_0x2357fd,null));};exports[_0x0248('0x3b')]=function(_0x1459d1,_0x3a93da){return respondWithRpcPromise('Trunks',_0x1459d1[_0x0248('0x15')])[_0x0248('0x8')](respondWithResult(_0x3a93da,null))[_0x0248('0xc')](handleError(_0x3a93da,null));};exports[_0x0248('0x3c')]=function(_0x279fb0,_0x42b48c){return respondWithRpcPromise(_0x0248('0x3d'),_0x279fb0[_0x0248('0x15')])['then'](respondWithResult(_0x42b48c,null))[_0x0248('0xc')](handleError(_0x42b48c,null));};exports[_0x0248('0x3e')]=function(_0x3c6857,_0x1336f8){return respondWithRpcPromise(_0x0248('0x3f'),_0x3c6857[_0x0248('0x15')],routingClient)[_0x0248('0x8')](respondWithResult(_0x1336f8,null))[_0x0248('0xc')](handleError(_0x1336f8,null));};exports[_0x0248('0x40')]=function(_0x1070c5,_0x5a55c8){return respondWithRpcPromise('ChatQueues',_0x1070c5[_0x0248('0x15')],routingClient)[_0x0248('0x8')](findById(_0x1070c5[_0x0248('0x19')]['id']))['then'](respondWithResult(_0x5a55c8,null))['catch'](handleError(_0x5a55c8,null));};exports[_0x0248('0x41')]=function(_0x362911,_0x1851fc){return respondWithRpcPromise('MailQueues',_0x362911[_0x0248('0x15')],routingClient)[_0x0248('0x8')](respondWithResult(_0x1851fc,null))['catch'](handleError(_0x1851fc,null));};exports[_0x0248('0x42')]=function(_0x4f9cef,_0x311eeb){return respondWithRpcPromise(_0x0248('0x43'),_0x4f9cef[_0x0248('0x15')],routingClient)['then'](findById(_0x4f9cef[_0x0248('0x19')]['id']))[_0x0248('0x8')](respondWithResult(_0x311eeb,null))[_0x0248('0xc')](handleError(_0x311eeb,null));};exports[_0x0248('0x44')]=function(_0x50773b,_0x21b625){return respondWithRpcPromise(_0x0248('0x45'),_0x50773b['query'],mailClient)[_0x0248('0x8')](respondWithResult(_0x21b625,null))[_0x0248('0xc')](handleError(_0x21b625,null));};exports['openchannelQueues']=function(_0xd4b6a,_0x4bead0){return respondWithRpcPromise(_0x0248('0x46'),_0xd4b6a[_0x0248('0x15')],routingClient)[_0x0248('0x8')](respondWithResult(_0x4bead0,null))[_0x0248('0xc')](handleError(_0x4bead0,null));};exports['showOpenchannelQueues']=function(_0x206096,_0x3da5ba){return respondWithRpcPromise(_0x0248('0x46'),_0x206096[_0x0248('0x15')],routingClient)[_0x0248('0x8')](findById(_0x206096[_0x0248('0x19')]['id']))['then'](respondWithResult(_0x3da5ba,null))[_0x0248('0xc')](handleError(_0x3da5ba,null));};exports['smsQueues']=function(_0x307170,_0x577d66){return respondWithRpcPromise(_0x0248('0x47'),_0x307170['query'],routingClient)[_0x0248('0x8')](respondWithResult(_0x577d66,null))['catch'](handleError(_0x577d66,null));};exports['showSmsQueues']=function(_0x27412a,_0x4a70dd){return respondWithRpcPromise(_0x0248('0x47'),_0x27412a[_0x0248('0x15')],routingClient)['then'](findById(_0x27412a[_0x0248('0x19')]['id']))[_0x0248('0x8')](respondWithResult(_0x4a70dd,null))['catch'](handleError(_0x4a70dd,null));};exports[_0x0248('0x48')]=function(_0x2c24f3,_0x42eb08){return respondWithRpcPromise(_0x0248('0x49'),_0x2c24f3['query'],routingClient)[_0x0248('0x8')](respondWithResult(_0x42eb08,null))[_0x0248('0xc')](handleError(_0x42eb08,null));};exports[_0x0248('0x4a')]=function(_0x4e6a12,_0x29289f){return respondWithRpcPromise(_0x0248('0x49'),_0x4e6a12[_0x0248('0x15')],routingClient)[_0x0248('0x8')](findById(_0x4e6a12[_0x0248('0x19')]['id']))[_0x0248('0x8')](respondWithResult(_0x29289f,null))[_0x0248('0xc')](handleError(_0x29289f,null));};exports[_0x0248('0x4b')]=function(_0x11749d,_0x547c48){return respondWithRpcPromise(_0x0248('0x4c'),_0x11749d['query'],routingClient)[_0x0248('0x8')](respondWithResult(_0x547c48,null))[_0x0248('0xc')](handleError(_0x547c48,null));};exports['showFaxQueues']=function(_0x4a0fb0,_0x457ea3){return respondWithRpcPromise(_0x0248('0x4c'),_0x4a0fb0['query'],routingClient)['then'](findById(_0x4a0fb0[_0x0248('0x19')]['id']))[_0x0248('0x8')](respondWithResult(_0x457ea3,null))[_0x0248('0xc')](handleError(_0x457ea3,null));};exports[_0x0248('0x4d')]=function(_0x5f260b,_0x214fd1){return respondWithRpcPromise(_0x0248('0x4e'),_0x5f260b[_0x0248('0x15')])[_0x0248('0x8')](respondWithResult(_0x214fd1,null))[_0x0248('0xc')](handleError(_0x214fd1,null));};exports[_0x0248('0x4f')]=function(_0x19e19c,_0x944d9d){return respondWithRpcPromise(_0x0248('0x50'),_0x19e19c[_0x0248('0x15')],routingClient)[_0x0248('0x8')](respondWithResult(_0x944d9d,null))[_0x0248('0xc')](handleError(_0x944d9d,null));};exports[_0x0248('0x51')]=function(_0x141a88,_0x1aeadf){return respondWithRpcPromise(_0x0248('0x52'),_0x141a88[_0x0248('0x15')],routingClient)[_0x0248('0x8')](respondWithResult(_0x1aeadf,null))[_0x0248('0xc')](handleError(_0x1aeadf,null));};exports[_0x0248('0x53')]=function(_0x4dfa75,_0x23f224){return respondWithRpcPromise(_0x0248('0x54'),_0x4dfa75['query'],routingClient)[_0x0248('0x8')](respondWithResult(_0x23f224,null))[_0x0248('0xc')](handleError(_0x23f224,null));};exports[_0x0248('0x55')]=function(_0x2af8b0,_0x1059fc){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2af8b0[_0x0248('0x15')],routingClient)['then'](respondWithResult(_0x1059fc,null))['catch'](handleError(_0x1059fc,null));};exports[_0x0248('0x56')]=function(_0x358c2d,_0x5d7aa1){return respondWithRpcPromise(_0x0248('0x57'),_0x358c2d['query'],routingClient)[_0x0248('0x8')](respondWithResult(_0x5d7aa1,null))[_0x0248('0xc')](handleError(_0x5d7aa1,null));};exports[_0x0248('0x58')]=function(_0x36c48,_0x3e15e2){return respondWithRpcPromise(_0x0248('0x59'),_0x36c48[_0x0248('0x15')],routingClient)[_0x0248('0x8')](respondWithResult(_0x3e15e2,null))['catch'](handleError(_0x3e15e2,null));};exports[_0x0248('0x5a')]=function(_0x56bd66){return function(_0xe77802,_0x3540e9){var _0x13448c,_0x5a2581;var _0x4840a9=_[_0x0248('0x5b')](_0x56bd66);var _0x3577f6=_0x56bd66===_0x0248('0x5c')?_0x0248('0x5d'):_0x0248('0x5e');return db[_0x4840a9+_0x0248('0x5f')][_0x0248('0x60')]({'raw':!![],'where':{'id':_0xe77802[_0x0248('0x19')]['id']}})[_0x0248('0x8')](function(_0x3e029b){if(_[_0x0248('0x11')](_0x3e029b)){throw new Error(_0x4840a9+_0x0248('0x61'));}_0x13448c=_0x3e029b;return db[_0x4840a9+_0x0248('0x62')]['findOne']({'where':{'id':_0xe77802[_0x0248('0x2b')][_0x0248('0x63')]},'include':[{'model':db[_0x4840a9+_0x0248('0x64')],'as':_0x0248('0x64')},{'model':db[_0x4840a9+_0x3577f6],'as':_0x0248('0x5e')}]});})[_0x0248('0x8')](function(_0x490f3b){if(_['isNil'](_0x490f3b)){throw new Error(_0x4840a9+_0x0248('0x65'));}_0x5a2581=_0x490f3b;return _0x490f3b[_0x0248('0x66')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0248('0x8')](function(){var _0x5874e5={'uniqueid':_0x56bd66+'.'+_0x5a2581['id']+'.'+_0x5a2581[_0x0248('0x64')]['id'],'FromUserId':_0xe77802[_0x0248('0x2c')]['id'],'type':'queue'};_0x5874e5[_0x4840a9+'MessageId']=_0x5a2581['id'];_0x5874e5[_0x4840a9+_0x0248('0x67')]=_0x5a2581[_0x0248('0x64')]['id'];_0x5874e5[_0x0248('0x68')+_0x4840a9+_0x3577f6+'Id']=_0x5a2581[_0x0248('0x5e')]['id'];_0x5874e5['To'+_0x4840a9+'QueueId']=_0x13448c['id'];return db[_0x4840a9+_0x0248('0x69')]['create'](_0x5874e5);})['then'](function(){return respondWithRpcPromise(_0x0248('0x6a'),{'channel':_0x56bd66,'interaction':_0x5a2581[_0x0248('0x64')],'message':_0x5a2581,'account':_0x5a2581['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x0248('0x6b'),'appdata':_0x13448c[_0x0248('0xe')]+','+(_0x5a2581[_0x0248('0x5e')][_0x0248('0x6c')]||0x12c),'interval':_0x0248('0x6d')}]},routingClient);})[_0x0248('0x8')](respondWithResult(_0x3540e9,null))[_0x0248('0xc')](handleError(_0x3540e9,null));};};exports[_0x0248('0x6e')]=function(_0x195e44,_0xa95088){var _0x2fa7f2,_0x5a9b02;if(_[_0x0248('0x11')](_0x195e44['body'][_0x0248('0x6f')])){throw new Error(_0x0248('0x70'));}var _0x111054=_0x195e44[_0x0248('0x2b')][_0x0248('0x6f')];var _0x3fb218=_[_0x0248('0x5b')](_0x111054);var _0x38c89b=_0x111054===_0x0248('0x5c')?_0x0248('0x5d'):_0x0248('0x5e');return db['User'][_0x0248('0x60')]({'raw':!![],'where':{'id':_0x195e44[_0x0248('0x19')]['id'],'role':_0x0248('0x37')}})['then'](function(_0x60d91a){if(_[_0x0248('0x11')](_0x60d91a)){throw new Error(_0x0248('0x71'));}_0x2fa7f2=_0x60d91a;return db[_0x3fb218+_0x0248('0x62')][_0x0248('0x60')]({'where':{'id':_0x195e44['body'][_0x0248('0x63')]},'include':[{'model':db[_0x3fb218+_0x0248('0x64')],'as':'Interaction'},{'model':db[_0x3fb218+_0x38c89b],'as':'Account'}]});})[_0x0248('0x8')](function(_0x465f71){if(_[_0x0248('0x11')](_0x465f71)){throw new Error(_0x3fb218+_0x0248('0x65'));}_0x5a9b02=_0x465f71;return _0x465f71['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0248('0x8')](function(){var _0x3b5685={'uniqueid':_0x111054+'.'+_0x5a9b02['id']+'.'+_0x5a9b02['Interaction']['id'],'FromUserId':_0x195e44[_0x0248('0x2c')]['id'],'type':_0x0248('0x6b'),'ToUserId':_0x2fa7f2['id']};_0x3b5685[_0x3fb218+_0x0248('0x72')]=_0x5a9b02['id'];_0x3b5685[_0x3fb218+_0x0248('0x67')]=_0x5a9b02[_0x0248('0x64')]['id'];_0x3b5685['From'+_0x3fb218+_0x38c89b+'Id']=_0x5a9b02[_0x0248('0x5e')]['id'];return db[_0x3fb218+'TransferReport'][_0x0248('0x73')](_0x3b5685);})[_0x0248('0x8')](function(){return respondWithRpcPromise(_0x0248('0x6a'),{'channel':_0x111054,'interaction':_0x5a9b02['Interaction'],'message':_0x5a9b02,'account':_0x5a9b02['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x0248('0x37'),'appdata':_0x2fa7f2[_0x0248('0xe')]+','+(_0x5a9b02['Account'][_0x0248('0x74')]||0x12c),'interval':_0x0248('0x6d')}]},routingClient);})[_0x0248('0x8')](respondWithResult(_0xa95088,null))[_0x0248('0xc')](handleError(_0xa95088,null));};
\ No newline at end of file
+var _0x1e2e=['faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','messageId','Start','agentTransferTimeout','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','status','json','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','body','user','interaction','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','SIP/%s','agent','internal','AgentCapacity','telephones','Trunks','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues'];(function(_0x162799,_0x438388){var _0x1dd583=function(_0x3b0ef9){while(--_0x3b0ef9){_0x162799['push'](_0x162799['shift']());}};_0x1dd583(++_0x438388);}(_0x1e2e,0x110));var _0xe1e2=function(_0x321d0f,_0xc41539){_0x321d0f=_0x321d0f-0x0;var _0xbe7682=_0x1e2e[_0x321d0f];return _0xbe7682;};'use strict';var BPromise=require('bluebird');var moment=require(_0xe1e2('0x0'));var _=require(_0xe1e2('0x1'));var util=require(_0xe1e2('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xe1e2('0x3'))(_0xe1e2('0x4'));var jayson=require(_0xe1e2('0x5'));var amiClient=jayson[_0xe1e2('0x6')][_0xe1e2('0x7')]({'port':0x232a});var mailClient=jayson[_0xe1e2('0x6')]['http']({'port':0x232b});var routingClient=jayson['client'][_0xe1e2('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x150f7e,_0x768aa5,_0x4e72a0){return new BPromise(function(_0x5dbb45,_0xf5ee2f){var _0x53e1c6=_0x4e72a0?_0x4e72a0:amiClient;return _0x53e1c6[_0xe1e2('0x8')](_0x150f7e,_0x768aa5)[_0xe1e2('0x9')](function(_0x19235d){if(_0x19235d[_0xe1e2('0xa')]){if(_0x19235d[_0xe1e2('0xa')][_0xe1e2('0xb')]===0x1f4){return _0xf5ee2f(_0x19235d['error'][_0xe1e2('0xc')]);}return _0x5dbb45(_0x19235d['error'][_0xe1e2('0xc')]);}else{_0x5dbb45(_0x19235d['result']);}})['catch'](function(_0x421a4f){_0xf5ee2f(_0x421a4f);});});}function respondWithResult(_0x108bc3,_0x186f7e){_0x186f7e=_0x186f7e||0xc8;return function(_0xa58f2b){if(_0xa58f2b){return _0x108bc3[_0xe1e2('0xd')](_0x186f7e)[_0xe1e2('0xe')](_0xa58f2b);}return _0x108bc3['sendStatus'](0x194);};}function handleError(_0x2648b7,_0x2db229){_0x2db229=_0x2db229||0x1f4;return function(_0x28d1e9){logger[_0xe1e2('0xa')](_0x28d1e9[_0xe1e2('0xf')]);if(_0x28d1e9[_0xe1e2('0x10')]){delete _0x28d1e9[_0xe1e2('0x10')];}_0x2648b7[_0xe1e2('0xd')](_0x2db229)[_0xe1e2('0x11')](_0x28d1e9);};}function findById(_0x5415ec){return function(_0x175ae5){if(!_[_0xe1e2('0x12')](_0x5415ec)&&!_[_0xe1e2('0x12')](_0x175ae5)&&!_[_0xe1e2('0x12')](_0x175ae5[_0xe1e2('0x13')])){return _[_0xe1e2('0x14')](_0x175ae5[_0xe1e2('0x13')],function(_0x26380f){return _0x26380f['id']==_0x5415ec;});}return null;};}exports[_0xe1e2('0x15')]=function(_0x5f1cfb,_0x39cd3f){return respondWithRpcPromise(_0xe1e2('0x16'),_0x5f1cfb[_0xe1e2('0x17')])['then'](respondWithResult(_0x39cd3f,null))[_0xe1e2('0x18')](handleError(_0x39cd3f,null));};exports[_0xe1e2('0x19')]=function(_0x37044f,_0x5e072f){return respondWithRpcPromise(_0xe1e2('0x1a'),_[_0xe1e2('0x1b')](_0x37044f[_0xe1e2('0x17')],_0x37044f[_0xe1e2('0x1c')]))[_0xe1e2('0x9')](respondWithResult(_0x5e072f,null))['catch'](handleError(_0x5e072f,null));};exports[_0xe1e2('0x1d')]=function(_0x23eadb,_0x4bc357){return respondWithRpcPromise(_0xe1e2('0x1e'),_[_0xe1e2('0x1b')](_0x23eadb[_0xe1e2('0x17')],_0x23eadb[_0xe1e2('0x1c')]))[_0xe1e2('0x9')](respondWithResult(_0x4bc357,null))[_0xe1e2('0x18')](handleError(_0x4bc357,null));};exports[_0xe1e2('0x1f')]=function(_0x116ef,_0x57cd3a){return respondWithRpcPromise(_0xe1e2('0x20'),_0x116ef['query'])['then'](respondWithResult(_0x57cd3a,null))[_0xe1e2('0x18')](handleError(_0x57cd3a,null));};exports['showVoiceQueues']=function(_0x19b0e4,_0x5ab98f){return respondWithRpcPromise(_0xe1e2('0x20'),_0x19b0e4[_0xe1e2('0x17')])[_0xe1e2('0x9')](findById(_0x19b0e4[_0xe1e2('0x1c')]['id']))[_0xe1e2('0x9')](respondWithResult(_0x5ab98f,null))[_0xe1e2('0x18')](handleError(_0x5ab98f,null));};exports['voiceQueuesPreview']=function(_0x489bac,_0x4c6e32){return respondWithRpcPromise(_0xe1e2('0x21'),_[_0xe1e2('0x1b')](_0x489bac[_0xe1e2('0x17')],_0x489bac['params']))[_0xe1e2('0x9')](respondWithResult(_0x4c6e32,null))[_0xe1e2('0x18')](handleError(_0x4c6e32,null));};exports[_0xe1e2('0x22')]=function(_0x3abfd1,_0x19a078){return respondWithRpcPromise(_0xe1e2('0x23'),_0x3abfd1['query'])[_0xe1e2('0x9')](respondWithResult(_0x19a078,null))[_0xe1e2('0x18')](handleError(_0x19a078,null));};exports[_0xe1e2('0x24')]=function(_0x14ef23,_0x169702){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xe1e2('0x1b')](_0x14ef23[_0xe1e2('0x17')],_0x14ef23['params']))[_0xe1e2('0x9')](respondWithResult(_0x169702,null))[_0xe1e2('0x18')](handleError(_0x169702,null));};exports['voiceQueuesChannelHangup']=function(_0x5290ef,_0x83d875){return respondWithRpcPromise(_0xe1e2('0x25'),_[_0xe1e2('0x1b')](_0x5290ef[_0xe1e2('0x17')],_0x5290ef[_0xe1e2('0x1c')]))[_0xe1e2('0x9')](respondWithResult(_0x83d875,null))[_0xe1e2('0x18')](handleError(_0x83d875,null));};exports[_0xe1e2('0x26')]=function(_0x383ba4,_0x54f0fb){return respondWithRpcPromise(_0xe1e2('0x27'),_[_0xe1e2('0x1b')](_0x383ba4[_0xe1e2('0x17')],_0x383ba4['params']))[_0xe1e2('0x9')](respondWithResult(_0x54f0fb,null))['catch'](handleError(_0x54f0fb,null));};exports['outbound']=function(_0x307b59,_0x3dc1bb){return respondWithRpcPromise(_0xe1e2('0x28'),_0x307b59['query'])[_0xe1e2('0x9')](respondWithResult(_0x3dc1bb,null))[_0xe1e2('0x18')](handleError(_0x3dc1bb,null));};exports[_0xe1e2('0x29')]=function(_0x1ffea,_0x4d84ae){return respondWithRpcPromise('OutboundChannels',_0x1ffea[_0xe1e2('0x17')])[_0xe1e2('0x9')](respondWithResult(_0x4d84ae,null))[_0xe1e2('0x18')](handleError(_0x4d84ae,null));};exports[_0xe1e2('0x2a')]=function(_0x353194,_0x58e92c){var _0x5911a4;return respondWithRpcPromise(_0xe1e2('0x2b'),_0x353194[_0xe1e2('0x17')])[_0xe1e2('0x9')](function(_0x5278cc){_0x5911a4=_0x5278cc;return respondWithRpcPromise(_0xe1e2('0x2b'),_0x353194['query'],routingClient);})[_0xe1e2('0x9')](function(_0x5771f0){return _['merge']({},_0x5771f0,_0x5911a4);})[_0xe1e2('0x9')](respondWithResult(_0x58e92c,null))['catch'](handleError(_0x58e92c,null));};exports[_0xe1e2('0x2c')]=function(_0x185ab4,_0x1fbf45){if(_0x185ab4[_0xe1e2('0x2d')]&&_0x185ab4['body']['interaction']&&_0x185ab4['user']&&_0x185ab4[_0xe1e2('0x2e')][_0xe1e2('0x10')]){for(var _0x2d52d0 in _0x185ab4[_0xe1e2('0x2d')][_0xe1e2('0x2f')]){if(_0x185ab4[_0xe1e2('0x2d')][_0xe1e2('0x2f')]['hasOwnProperty'](_0x2d52d0)){db[_0xe1e2('0x30')][_0xe1e2('0x31')]({'where':{'channel':_0x2d52d0,'membername':_0x185ab4[_0xe1e2('0x2e')][_0xe1e2('0x10')],'type':_0xe1e2('0x32'),'exitAt':null,'uniqueid':_0x185ab4[_0xe1e2('0x2d')][_0xe1e2('0x2f')][_0x2d52d0]&&_0x185ab4[_0xe1e2('0x2d')][_0xe1e2('0x2f')][_0x2d52d0][_0xe1e2('0x33')]?{'$notIn':_0x185ab4[_0xe1e2('0x2d')][_0xe1e2('0x2f')][_0x2d52d0]}:{'$ne':null}}})[_0xe1e2('0x9')](function(_0x2fecbd){var _0x3186de=moment()['format'](_0xe1e2('0x34'));for(var _0x513ac5=0x0,_0x2d18d5=_0x2fecbd[_0xe1e2('0x33')];_0x513ac5<_0x2d18d5;_0x513ac5+=0x1){_0x2fecbd[_0x513ac5][_0xe1e2('0x35')]({'exitAt':_0x3186de});}});for(var _0x3e38c6=0x0;_0x3e38c6<_0x185ab4[_0xe1e2('0x2d')][_0xe1e2('0x2f')][_0x2d52d0]['length'];_0x3e38c6+=0x1){db[_0xe1e2('0x30')][_0xe1e2('0x36')]({'where':{'channel':_0x2d52d0,'membername':_0x185ab4[_0xe1e2('0x2e')][_0xe1e2('0x10')],'type':'INTERACTION','uniqueid':_0x185ab4['body'][_0xe1e2('0x2f')][_0x2d52d0][_0x3e38c6],'exitAt':null},'defaults':{'channel':_0x2d52d0,'membername':_0x185ab4[_0xe1e2('0x2e')][_0xe1e2('0x10')],'interface':_[_0xe1e2('0x12')](_0x185ab4[_0xe1e2('0x2e')][_0xe1e2('0x37')])?util[_0xe1e2('0x38')](_0xe1e2('0x39'),_0x185ab4[_0xe1e2('0x2e')]['name']):_0x185ab4['user'][_0xe1e2('0x37')],'type':_0xe1e2('0x32'),'enterAt':moment()[_0xe1e2('0x38')](_0xe1e2('0x34')),'role':_0xe1e2('0x3a'),'internal':_0x185ab4['user'][_0xe1e2('0x3b')],'uniqueid':_0x185ab4[_0xe1e2('0x2d')]['interaction'][_0x2d52d0][_0x3e38c6]}});}}}}return respondWithRpcPromise(_0xe1e2('0x3c'),{'id':_0x185ab4[_0xe1e2('0x1c')]['id'],'capacity':_0x185ab4[_0xe1e2('0x2d')]['capacity']},routingClient)[_0xe1e2('0x9')](respondWithResult(_0x1fbf45,null))[_0xe1e2('0x18')](handleError(_0x1fbf45,null));};exports[_0xe1e2('0x3d')]=function(_0x567856,_0x50fb5c){return respondWithRpcPromise('Telephones',_0x567856['query'])[_0xe1e2('0x9')](respondWithResult(_0x50fb5c,null))[_0xe1e2('0x18')](handleError(_0x50fb5c,null));};exports['trunks']=function(_0x23ae22,_0x43948e){return respondWithRpcPromise(_0xe1e2('0x3e'),_0x23ae22['query'])[_0xe1e2('0x9')](respondWithResult(_0x43948e,null))[_0xe1e2('0x18')](handleError(_0x43948e,null));};exports['campaigns']=function(_0x12a5c9,_0x1d3fe3){return respondWithRpcPromise('Campaigns',_0x12a5c9[_0xe1e2('0x17')])[_0xe1e2('0x9')](respondWithResult(_0x1d3fe3,null))[_0xe1e2('0x18')](handleError(_0x1d3fe3,null));};exports['chatQueues']=function(_0x149a49,_0x64b8c5){return respondWithRpcPromise(_0xe1e2('0x3f'),_0x149a49['query'],routingClient)[_0xe1e2('0x9')](respondWithResult(_0x64b8c5,null))[_0xe1e2('0x18')](handleError(_0x64b8c5,null));};exports[_0xe1e2('0x40')]=function(_0x1ec775,_0x26910d){return respondWithRpcPromise(_0xe1e2('0x3f'),_0x1ec775[_0xe1e2('0x17')],routingClient)[_0xe1e2('0x9')](findById(_0x1ec775[_0xe1e2('0x1c')]['id']))[_0xe1e2('0x9')](respondWithResult(_0x26910d,null))[_0xe1e2('0x18')](handleError(_0x26910d,null));};exports[_0xe1e2('0x41')]=function(_0x1f526b,_0x19e428){return respondWithRpcPromise('MailQueues',_0x1f526b[_0xe1e2('0x17')],routingClient)['then'](respondWithResult(_0x19e428,null))[_0xe1e2('0x18')](handleError(_0x19e428,null));};exports[_0xe1e2('0x42')]=function(_0x4ac3db,_0x4dcfe7){return respondWithRpcPromise(_0xe1e2('0x43'),_0x4ac3db[_0xe1e2('0x17')],routingClient)[_0xe1e2('0x9')](findById(_0x4ac3db['params']['id']))[_0xe1e2('0x9')](respondWithResult(_0x4dcfe7,null))['catch'](handleError(_0x4dcfe7,null));};exports[_0xe1e2('0x44')]=function(_0x45a603,_0x37b818){return respondWithRpcPromise(_0xe1e2('0x45'),_0x45a603[_0xe1e2('0x17')],mailClient)['then'](respondWithResult(_0x37b818,null))[_0xe1e2('0x18')](handleError(_0x37b818,null));};exports['openchannelQueues']=function(_0x2f5c9a,_0x411ed3){return respondWithRpcPromise(_0xe1e2('0x46'),_0x2f5c9a['query'],routingClient)[_0xe1e2('0x9')](respondWithResult(_0x411ed3,null))[_0xe1e2('0x18')](handleError(_0x411ed3,null));};exports[_0xe1e2('0x47')]=function(_0x3cb3a8,_0x2749de){return respondWithRpcPromise(_0xe1e2('0x46'),_0x3cb3a8['query'],routingClient)[_0xe1e2('0x9')](findById(_0x3cb3a8[_0xe1e2('0x1c')]['id']))[_0xe1e2('0x9')](respondWithResult(_0x2749de,null))[_0xe1e2('0x18')](handleError(_0x2749de,null));};exports['smsQueues']=function(_0x179cfc,_0x341920){return respondWithRpcPromise(_0xe1e2('0x48'),_0x179cfc[_0xe1e2('0x17')],routingClient)[_0xe1e2('0x9')](respondWithResult(_0x341920,null))[_0xe1e2('0x18')](handleError(_0x341920,null));};exports[_0xe1e2('0x49')]=function(_0x487aef,_0x40a75d){return respondWithRpcPromise(_0xe1e2('0x48'),_0x487aef[_0xe1e2('0x17')],routingClient)[_0xe1e2('0x9')](findById(_0x487aef[_0xe1e2('0x1c')]['id']))[_0xe1e2('0x9')](respondWithResult(_0x40a75d,null))['catch'](handleError(_0x40a75d,null));};exports[_0xe1e2('0x4a')]=function(_0x1b2be6,_0x222de3){return respondWithRpcPromise('WhatsappQueues',_0x1b2be6[_0xe1e2('0x17')],routingClient)[_0xe1e2('0x9')](respondWithResult(_0x222de3,null))[_0xe1e2('0x18')](handleError(_0x222de3,null));};exports[_0xe1e2('0x4b')]=function(_0x2e4da3,_0x394d05){return respondWithRpcPromise('WhatsappQueues',_0x2e4da3[_0xe1e2('0x17')],routingClient)[_0xe1e2('0x9')](findById(_0x2e4da3[_0xe1e2('0x1c')]['id']))[_0xe1e2('0x9')](respondWithResult(_0x394d05,null))[_0xe1e2('0x18')](handleError(_0x394d05,null));};exports[_0xe1e2('0x4c')]=function(_0x5b5001,_0x460415){return respondWithRpcPromise(_0xe1e2('0x4d'),_0x5b5001[_0xe1e2('0x17')],routingClient)[_0xe1e2('0x9')](respondWithResult(_0x460415,null))[_0xe1e2('0x18')](handleError(_0x460415,null));};exports[_0xe1e2('0x4e')]=function(_0x5e6853,_0x287588){return respondWithRpcPromise('FaxQueues',_0x5e6853[_0xe1e2('0x17')],routingClient)['then'](findById(_0x5e6853[_0xe1e2('0x1c')]['id']))[_0xe1e2('0x9')](respondWithResult(_0x287588,null))['catch'](handleError(_0x287588,null));};exports[_0xe1e2('0x4f')]=function(_0x30b769,_0x493709){return respondWithRpcPromise(_0xe1e2('0x50'),_0x30b769['query'])[_0xe1e2('0x9')](respondWithResult(_0x493709,null))['catch'](handleError(_0x493709,null));};exports['chatQueuesWaitingInteractions']=function(_0x5861a5,_0x1c111c){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5861a5[_0xe1e2('0x17')],routingClient)['then'](respondWithResult(_0x1c111c,null))[_0xe1e2('0x18')](handleError(_0x1c111c,null));};exports['mailQueuesWaitingInteractions']=function(_0x2a31ea,_0xb9c9e8){return respondWithRpcPromise(_0xe1e2('0x51'),_0x2a31ea[_0xe1e2('0x17')],routingClient)['then'](respondWithResult(_0xb9c9e8,null))[_0xe1e2('0x18')](handleError(_0xb9c9e8,null));};exports[_0xe1e2('0x52')]=function(_0x3a1b4d,_0x583163){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x3a1b4d[_0xe1e2('0x17')],routingClient)['then'](respondWithResult(_0x583163,null))['catch'](handleError(_0x583163,null));};exports[_0xe1e2('0x53')]=function(_0x1bb6fe,_0x7196f0){return respondWithRpcPromise(_0xe1e2('0x54'),_0x1bb6fe[_0xe1e2('0x17')],routingClient)[_0xe1e2('0x9')](respondWithResult(_0x7196f0,null))[_0xe1e2('0x18')](handleError(_0x7196f0,null));};exports[_0xe1e2('0x55')]=function(_0x617662,_0x2161e2){return respondWithRpcPromise(_0xe1e2('0x56'),_0x617662[_0xe1e2('0x17')],routingClient)['then'](respondWithResult(_0x2161e2,null))['catch'](handleError(_0x2161e2,null));};exports[_0xe1e2('0x57')]=function(_0x29b87c,_0x43c89e){return respondWithRpcPromise(_0xe1e2('0x58'),_0x29b87c['query'],routingClient)[_0xe1e2('0x9')](respondWithResult(_0x43c89e,null))[_0xe1e2('0x18')](handleError(_0x43c89e,null));};exports[_0xe1e2('0x59')]=function(_0x5ed847){return function(_0x2ed0e6,_0x33eec9){var _0x434f63,_0x3326d5;var _0x35bbf6=_[_0xe1e2('0x5a')](_0x5ed847);var _0xd14dd2=_0x5ed847===_0xe1e2('0x5b')?_0xe1e2('0x5c'):_0xe1e2('0x5d');return db[_0x35bbf6+_0xe1e2('0x5e')][_0xe1e2('0x5f')]({'raw':!![],'where':{'id':_0x2ed0e6[_0xe1e2('0x1c')]['id']}})['then'](function(_0xe59429){if(_[_0xe1e2('0x12')](_0xe59429)){throw new Error(_0x35bbf6+_0xe1e2('0x60'));}_0x434f63=_0xe59429;return db[_0x35bbf6+_0xe1e2('0x61')][_0xe1e2('0x5f')]({'where':{'id':_0x2ed0e6[_0xe1e2('0x2d')]['messageId']},'include':[{'model':db[_0x35bbf6+_0xe1e2('0x62')],'as':'Interaction'},{'model':db[_0x35bbf6+_0xd14dd2],'as':_0xe1e2('0x5d')}]});})['then'](function(_0x30674c){if(_[_0xe1e2('0x12')](_0x30674c)){throw new Error(_0x35bbf6+_0xe1e2('0x63'));}_0x3326d5=_0x30674c;return _0x30674c[_0xe1e2('0x64')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe1e2('0x9')](function(){var _0x434cde={'uniqueid':_0x5ed847+'.'+_0x3326d5['id']+'.'+_0x3326d5['Interaction']['id'],'FromUserId':_0x2ed0e6[_0xe1e2('0x2e')]['id'],'type':_0xe1e2('0x65')};_0x434cde[_0x35bbf6+_0xe1e2('0x66')]=_0x3326d5['id'];_0x434cde[_0x35bbf6+_0xe1e2('0x67')]=_0x3326d5[_0xe1e2('0x62')]['id'];_0x434cde[_0xe1e2('0x68')+_0x35bbf6+_0xd14dd2+'Id']=_0x3326d5[_0xe1e2('0x5d')]['id'];_0x434cde['To'+_0x35bbf6+_0xe1e2('0x69')]=_0x434f63['id'];return db[_0x35bbf6+_0xe1e2('0x6a')][_0xe1e2('0x6b')](_0x434cde);})[_0xe1e2('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x5ed847,'interaction':_0x3326d5['Interaction'],'message':_0x3326d5,'account':_0x3326d5[_0xe1e2('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x434f63[_0xe1e2('0x10')]+','+(_0x3326d5['Account'][_0xe1e2('0x6c')]||0x12c),'interval':_0xe1e2('0x6d')}]},routingClient);})[_0xe1e2('0x9')](respondWithResult(_0x33eec9,null))[_0xe1e2('0x18')](handleError(_0x33eec9,null));};};exports[_0xe1e2('0x6e')]=function(_0x346b42,_0x41521d){var _0x173b82,_0x416bd3;if(_[_0xe1e2('0x12')](_0x346b42['body'][_0xe1e2('0x6f')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x4e0686=_0x346b42[_0xe1e2('0x2d')][_0xe1e2('0x6f')];var _0x4d979f=_['capitalize'](_0x4e0686);var _0x4117e1=_0x4e0686===_0xe1e2('0x5b')?_0xe1e2('0x5c'):_0xe1e2('0x5d');return db[_0xe1e2('0x70')][_0xe1e2('0x5f')]({'raw':!![],'where':{'id':_0x346b42[_0xe1e2('0x1c')]['id'],'role':_0xe1e2('0x3a')}})[_0xe1e2('0x9')](function(_0x262344){if(_[_0xe1e2('0x12')](_0x262344)){throw new Error('Agent\x20not\x20found');}_0x173b82=_0x262344;return db[_0x4d979f+'Message'][_0xe1e2('0x5f')]({'where':{'id':_0x346b42[_0xe1e2('0x2d')][_0xe1e2('0x71')]},'include':[{'model':db[_0x4d979f+_0xe1e2('0x62')],'as':_0xe1e2('0x62')},{'model':db[_0x4d979f+_0x4117e1],'as':_0xe1e2('0x5d')}]});})[_0xe1e2('0x9')](function(_0x2085a9){if(_[_0xe1e2('0x12')](_0x2085a9)){throw new Error(_0x4d979f+_0xe1e2('0x63'));}_0x416bd3=_0x2085a9;return _0x2085a9['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xe1e2('0x9')](function(){var _0x1601d7={'uniqueid':_0x4e0686+'.'+_0x416bd3['id']+'.'+_0x416bd3[_0xe1e2('0x62')]['id'],'FromUserId':_0x346b42[_0xe1e2('0x2e')]['id'],'type':_0xe1e2('0x65'),'ToUserId':_0x173b82['id']};_0x1601d7[_0x4d979f+'MessageId']=_0x416bd3['id'];_0x1601d7[_0x4d979f+_0xe1e2('0x67')]=_0x416bd3[_0xe1e2('0x62')]['id'];_0x1601d7[_0xe1e2('0x68')+_0x4d979f+_0x4117e1+'Id']=_0x416bd3[_0xe1e2('0x5d')]['id'];return db[_0x4d979f+_0xe1e2('0x6a')][_0xe1e2('0x6b')](_0x1601d7);})[_0xe1e2('0x9')](function(){return respondWithRpcPromise(_0xe1e2('0x72'),{'channel':_0x4e0686,'interaction':_0x416bd3[_0xe1e2('0x62')],'message':_0x416bd3,'account':_0x416bd3[_0xe1e2('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe1e2('0x3a'),'appdata':_0x173b82[_0xe1e2('0x10')]+','+(_0x416bd3[_0xe1e2('0x5d')][_0xe1e2('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe1e2('0x9')](respondWithResult(_0x41521d,null))[_0xe1e2('0x18')](handleError(_0x41521d,null));};
\ No newline at end of file
diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js
index eb3f071..4b3961d 100644
--- a/server/api/schedule/index.js
+++ b/server/api/schedule/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0e9c=['run','post','create','put','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run'];(function(_0x47adb8,_0x591ccc){var _0x4689a8=function(_0x2ba76f){while(--_0x2ba76f){_0x47adb8['push'](_0x47adb8['shift']());}};_0x4689a8(++_0x591ccc);}(_0x0e9c,0x15c));var _0xc0e9=function(_0x421303,_0x4691d3){_0x421303=_0x421303-0x0;var _0x181431=_0x0e9c[_0x421303];return _0x181431;};'use strict';var multer=require(_0xc0e9('0x0'));var util=require(_0xc0e9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc0e9('0x2'));var router=express[_0xc0e9('0x3')]();var auth=require(_0xc0e9('0x4'));var interaction=require(_0xc0e9('0x5'));var config=require(_0xc0e9('0x6'));var controller=require(_0xc0e9('0x7'));router[_0xc0e9('0x8')]('/',auth[_0xc0e9('0x9')](),controller[_0xc0e9('0xa')]);router[_0xc0e9('0x8')](_0xc0e9('0xb'),auth[_0xc0e9('0x9')](),controller['show']);router['get'](_0xc0e9('0xc'),auth[_0xc0e9('0x9')](),controller[_0xc0e9('0xd')]);router[_0xc0e9('0xe')]('/',auth[_0xc0e9('0x9')](),controller[_0xc0e9('0xf')]);router[_0xc0e9('0x10')](_0xc0e9('0xb'),auth[_0xc0e9('0x9')](),controller['update']);router[_0xc0e9('0x11')](_0xc0e9('0xb'),auth[_0xc0e9('0x9')](),controller[_0xc0e9('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x4a6b=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','/:id/run','isAuthenticated','run','post','create','put','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4a6b,0x104));var _0xb4a6=function(_0x2d1470,_0x4805a8){_0x2d1470=_0x2d1470-0x0;var _0xf79376=_0x4a6b[_0x2d1470];return _0xf79376;};'use strict';var multer=require(_0xb4a6('0x0'));var util=require(_0xb4a6('0x1'));var path=require(_0xb4a6('0x2'));var timeout=require(_0xb4a6('0x3'));var express=require(_0xb4a6('0x4'));var router=express[_0xb4a6('0x5')]();var auth=require(_0xb4a6('0x6'));var interaction=require(_0xb4a6('0x7'));var config=require(_0xb4a6('0x8'));var controller=require('./schedule.controller');router[_0xb4a6('0x9')]('/',auth['isAuthenticated'](),controller[_0xb4a6('0xa')]);router[_0xb4a6('0x9')](_0xb4a6('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb4a6('0x9')](_0xb4a6('0xc'),auth[_0xb4a6('0xd')](),controller[_0xb4a6('0xe')]);router[_0xb4a6('0xf')]('/',auth[_0xb4a6('0xd')](),controller[_0xb4a6('0x10')]);router[_0xb4a6('0x11')]('/:id',auth[_0xb4a6('0xd')](),controller['update']);router['delete'](_0xb4a6('0xb'),auth[_0xb4a6('0xd')](),controller[_0xb4a6('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js
index 52ffd2e..3645529 100644
--- a/server/api/schedule/schedule.attributes.js
+++ b/server/api/schedule/schedule.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f47=['weeks','days','minutes','csv','pdf','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months'];(function(_0x4204f9,_0x2a5528){var _0x1f13ee=function(_0x1c7816){while(--_0x1c7816){_0x4204f9['push'](_0x4204f9['shift']());}};_0x1f13ee(++_0x2a5528);}(_0x6f47,0xc7));var _0x76f4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6f47[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x76f4('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x76f4('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x76f4('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x76f4('0x6')](_0x76f4('0x7'),'quarters',_0x76f4('0x8'),_0x76f4('0x9'),_0x76f4('0xa'),'hours',_0x76f4('0xb')),'allowNull':![],'defaultValue':_0x76f4('0xa')},'output':{'type':Sequelize[_0x76f4('0x6')](_0x76f4('0xc'),_0x76f4('0xd'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x76f4('0x6')](_0x76f4('0xe'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x76f4('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x76f4('0x1')]},'cc':{'type':Sequelize[_0x76f4('0xf')]},'bcc':{'type':Sequelize[_0x76f4('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x76f4('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x975b=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','hours','minutes','days','csv','pdf','xlsx','default','TEXT','sequelize','exports','STRING'];(function(_0x4c3ece,_0x57053e){var _0x409c1d=function(_0x411a3b){while(--_0x411a3b){_0x4c3ece['push'](_0x4c3ece['shift']());}};_0x409c1d(++_0x57053e);}(_0x975b,0x1c9));var _0xb975=function(_0x1c941e,_0x29acf){_0x1c941e=_0x1c941e-0x0;var _0x4574b6=_0x975b[_0x1c941e];return _0x4574b6;};'use strict';var Sequelize=require(_0xb975('0x0'));module[_0xb975('0x1')]={'name':{'type':Sequelize[_0xb975('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb975('0x2')]},'active':{'type':Sequelize[_0xb975('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xb975('0x2')],'allowNull':![],'defaultValue':_0xb975('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xb975('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb975('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb975('0x7')](_0xb975('0x8'),_0xb975('0x9'),_0xb975('0xa'),_0xb975('0xb'),'days',_0xb975('0xc'),_0xb975('0xd')),'allowNull':![],'defaultValue':_0xb975('0xe')},'output':{'type':Sequelize['ENUM'](_0xb975('0xf'),_0xb975('0x10'),_0xb975('0x11')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xb975('0x7')]('custom',_0xb975('0x12')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xb975('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xb975('0x13')]},'bcc':{'type':Sequelize[_0xb975('0x13')]},'sendIfEmpty':{'type':Sequelize[_0xb975('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js
index c830111..7a02cc9 100644
--- a/server/api/schedule/schedule.controller.js
+++ b/server/api/schedule/schedule.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd240=['pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','name','index','map','Schedule','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','limit','order','sort','where'];(function(_0x14915a,_0x222f6b){var _0x2f683c=function(_0x28e694){while(--_0x28e694){_0x14915a['push'](_0x14915a['shift']());}};_0x2f683c(++_0x222f6b);}(_0xd240,0x168));var _0x0d24=function(_0x3939d3,_0x2c7e96){_0x3939d3=_0x3939d3-0x0;var _0x2ab170=_0xd240[_0x3939d3];return _0x2ab170;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0d24('0x0'));var rimraf=require(_0x0d24('0x1'));var zipdir=require(_0x0d24('0x2'));var jsonpatch=require(_0x0d24('0x3'));var rp=require(_0x0d24('0x4'));var moment=require(_0x0d24('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0d24('0x6'));var path=require(_0x0d24('0x7'));var sox=require('sox');var csv=require(_0x0d24('0x8'));var ejs=require(_0x0d24('0x9'));var fs=require('fs');var _=require(_0x0d24('0xa'));var squel=require('squel');var crypto=require(_0x0d24('0xb'));var jsforce=require(_0x0d24('0xc'));var deskjs=require(_0x0d24('0xd'));var toCsv=require(_0x0d24('0x8'));var querystring=require(_0x0d24('0xe'));var Papa=require(_0x0d24('0xf'));var Redis=require(_0x0d24('0x10'));var authService=require(_0x0d24('0x11'));var qs=require(_0x0d24('0x12'));var as=require(_0x0d24('0x13'));var hardwareService=require(_0x0d24('0x14'));var logger=require(_0x0d24('0x15'))('api');var utils=require(_0x0d24('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21fd45,_0x32c06c){_0x32c06c=_0x32c06c||0xcc;return function(_0x5581b7){if(_0x5581b7){return _0x21fd45['sendStatus'](_0x32c06c);}return _0x21fd45['status'](_0x32c06c)[_0x0d24('0x17')]();};}function respondWithResult(_0x59820c,_0x4d8a34){_0x4d8a34=_0x4d8a34||0xc8;return function(_0x4c1fdd){if(_0x4c1fdd){return _0x59820c['status'](_0x4d8a34)[_0x0d24('0x18')](_0x4c1fdd);}};}function respondWithFilteredResult(_0x51b29a,_0x133eeb){return function(_0x5daeb7){if(_0x5daeb7){var _0x1ce948=_0x5daeb7[_0x0d24('0x19')],_0x19d6a2=_0x133eeb['offset'],_0x13f2a3=_0x133eeb[_0x0d24('0x1a')]+_0x133eeb['limit'],_0x4cbb5f;if(_0x13f2a3>=_0x1ce948){_0x13f2a3=_0x1ce948;_0x4cbb5f=0xc8;}else{_0x4cbb5f=0xce;}_0x51b29a[_0x0d24('0x1b')](_0x4cbb5f);return _0x51b29a[_0x0d24('0x1c')](_0x0d24('0x1d'),_0x19d6a2+'-'+_0x13f2a3+'/'+_0x1ce948)[_0x0d24('0x18')](_0x5daeb7);}return null;};}function patchUpdates(_0x5793d2){return function(_0x491456){try{jsonpatch[_0x0d24('0x1e')](_0x491456,_0x5793d2,!![]);}catch(_0x68b241){return BPromise[_0x0d24('0x1f')](_0x68b241);}return _0x491456[_0x0d24('0x20')]();};}function saveUpdates(_0x47600c,_0x2f3294){return function(_0x375475){if(_0x375475){return _0x375475[_0x0d24('0x21')](_0x47600c)[_0x0d24('0x22')](function(_0xc8effd){return _0xc8effd;});}return null;};}function removeEntity(_0x1fda41,_0x5aa014){return function(_0xab6ce){if(_0xab6ce){return _0xab6ce[_0x0d24('0x23')]()[_0x0d24('0x22')](function(){var _0x1d30f5=_0xab6ce[_0x0d24('0x24')]({'plain':!![]});var _0x29447e=_0x0d24('0x25');return db[_0x0d24('0x26')]['destroy']({'where':{'type':_0x29447e,'resourceId':_0x1d30f5['id']}})[_0x0d24('0x22')](function(){return _0xab6ce;});})[_0x0d24('0x22')](function(){_0x1fda41['status'](0xcc)[_0x0d24('0x17')]();});}};}function handleEntityNotFound(_0x5da905,_0x2b0943){return function(_0x342b29){if(!_0x342b29){_0x5da905[_0x0d24('0x27')](0x194);}return _0x342b29;};}function handleError(_0x17d90a,_0x387e17){_0x387e17=_0x387e17||0x1f4;return function(_0x1c44d2){logger['error'](_0x1c44d2['stack']);if(_0x1c44d2['name']){delete _0x1c44d2[_0x0d24('0x28')];}_0x17d90a[_0x0d24('0x1b')](_0x387e17)['send'](_0x1c44d2);};}exports[_0x0d24('0x29')]=function(_0xe97728,_0x26b4b5){var _0x338d78={},_0x53490b={},_0x2b5f32={'count':0x0,'rows':[]};var _0x4430a4=_[_0x0d24('0x2a')](db[_0x0d24('0x2b')][_0x0d24('0x2c')],function(_0x3e8fbb){return{'name':_0x3e8fbb[_0x0d24('0x2d')],'type':_0x3e8fbb[_0x0d24('0x2e')][_0x0d24('0x2f')]};});_0x53490b['model']=_[_0x0d24('0x2a')](_0x4430a4,_0x0d24('0x28'));_0x53490b['query']=_['keys'](_0xe97728[_0x0d24('0x30')]);_0x53490b[_0x0d24('0x31')]=_[_0x0d24('0x32')](_0x53490b['model'],_0x53490b[_0x0d24('0x30')]);_0x338d78[_0x0d24('0x33')]=_['intersection'](_0x53490b[_0x0d24('0x34')],qs[_0x0d24('0x35')](_0xe97728[_0x0d24('0x30')][_0x0d24('0x35')]));_0x338d78[_0x0d24('0x33')]=_0x338d78['attributes'][_0x0d24('0x36')]?_0x338d78[_0x0d24('0x33')]:_0x53490b[_0x0d24('0x34')];if(!_0xe97728[_0x0d24('0x30')]['hasOwnProperty'](_0x0d24('0x37'))){_0x338d78['limit']=qs['limit'](_0xe97728[_0x0d24('0x30')][_0x0d24('0x38')]);_0x338d78['offset']=qs['offset'](_0xe97728[_0x0d24('0x30')][_0x0d24('0x1a')]);}_0x338d78[_0x0d24('0x39')]=qs['sort'](_0xe97728[_0x0d24('0x30')][_0x0d24('0x3a')]);_0x338d78[_0x0d24('0x3b')]=qs[_0x0d24('0x31')](_[_0x0d24('0x3c')](_0xe97728[_0x0d24('0x30')],_0x53490b[_0x0d24('0x31')]),_0x4430a4);if(_0xe97728['query'][_0x0d24('0x3d')]){_0x338d78['where']=_['merge'](_0x338d78[_0x0d24('0x3b')],{'$or':_[_0x0d24('0x2a')](_0x4430a4,function(_0x4d7cb9){if(_0x4d7cb9[_0x0d24('0x2e')]!==_0x0d24('0x3e')){var _0x501d9b={};_0x501d9b[_0x4d7cb9[_0x0d24('0x28')]]={'$like':'%'+_0xe97728['query'][_0x0d24('0x3d')]+'%'};return _0x501d9b;}})});}_0x338d78=_[_0x0d24('0x3f')]({},_0x338d78,_0xe97728['options']);var _0x3112ba={'where':_0x338d78[_0x0d24('0x3b')]};return db[_0x0d24('0x2b')][_0x0d24('0x19')](_0x3112ba)[_0x0d24('0x22')](function(_0x5ac0fe){_0x2b5f32[_0x0d24('0x19')]=_0x5ac0fe;if(_0xe97728['query'][_0x0d24('0x40')]){_0x338d78[_0x0d24('0x41')]=[{'all':!![]}];}return db[_0x0d24('0x2b')][_0x0d24('0x42')](_0x338d78);})[_0x0d24('0x22')](function(_0xd5f409){_0x2b5f32['rows']=_0xd5f409;return _0x2b5f32;})[_0x0d24('0x22')](respondWithFilteredResult(_0x26b4b5,_0x338d78))[_0x0d24('0x43')](handleError(_0x26b4b5,null));};exports[_0x0d24('0x44')]=function(_0x2053f9,_0x34e98e){var _0xf61d3a={'raw':![],'where':{'id':_0x2053f9[_0x0d24('0x45')]['id']}},_0x38a6a3={};_0x38a6a3[_0x0d24('0x34')]=_[_0x0d24('0x46')](db['Schedule'][_0x0d24('0x2c')]);_0x38a6a3[_0x0d24('0x30')]=_['keys'](_0x2053f9[_0x0d24('0x30')]);_0x38a6a3[_0x0d24('0x31')]=_[_0x0d24('0x32')](_0x38a6a3[_0x0d24('0x34')],_0x38a6a3[_0x0d24('0x30')]);_0xf61d3a[_0x0d24('0x33')]=_['intersection'](_0x38a6a3[_0x0d24('0x34')],qs[_0x0d24('0x35')](_0x2053f9[_0x0d24('0x30')][_0x0d24('0x35')]));_0xf61d3a[_0x0d24('0x33')]=_0xf61d3a[_0x0d24('0x33')][_0x0d24('0x36')]?_0xf61d3a[_0x0d24('0x33')]:_0x38a6a3['model'];if(_0x2053f9[_0x0d24('0x30')][_0x0d24('0x40')]){_0xf61d3a['include']=[{'all':!![]}];}_0xf61d3a=_[_0x0d24('0x3f')]({},_0xf61d3a,_0x2053f9[_0x0d24('0x47')]);return db[_0x0d24('0x2b')][_0x0d24('0x48')](_0xf61d3a)[_0x0d24('0x22')](handleEntityNotFound(_0x34e98e,null))['then'](respondWithResult(_0x34e98e,null))[_0x0d24('0x43')](handleError(_0x34e98e,null));};exports[_0x0d24('0x49')]=function(_0x3264e3,_0x5b9215){return db[_0x0d24('0x2b')][_0x0d24('0x49')](_0x3264e3[_0x0d24('0x4a')],{})[_0x0d24('0x22')](function(_0x2dadd1){var _0x352037=_0x3264e3[_0x0d24('0x4b')][_0x0d24('0x24')]({'plain':!![]});if(!_0x352037)throw new Error(_0x0d24('0x4c'));if(_0x352037['role']===_0x0d24('0x4b')){var _0xc4048=_0x2dadd1[_0x0d24('0x24')]({'plain':!![]});var _0x5c6ae9=_0x0d24('0x25');return db[_0x0d24('0x4d')][_0x0d24('0x48')]({'where':{'name':_0x5c6ae9,'userProfileId':_0x352037[_0x0d24('0x4e')]},'raw':!![]})[_0x0d24('0x22')](function(_0x55f8de){if(_0x55f8de&&_0x55f8de[_0x0d24('0x4f')]===0x0){return db[_0x0d24('0x26')][_0x0d24('0x49')]({'name':_0xc4048['name'],'resourceId':_0xc4048['id'],'type':_0x55f8de[_0x0d24('0x28')],'sectionId':_0x55f8de['id']},{})[_0x0d24('0x22')](function(){return _0x2dadd1;});}else{return _0x2dadd1;}})[_0x0d24('0x43')](function(_0x5d5609){logger[_0x0d24('0x50')](_0x0d24('0x51'),_0x5d5609);throw _0x5d5609;});}return _0x2dadd1;})[_0x0d24('0x22')](respondWithResult(_0x5b9215,0xc9))[_0x0d24('0x43')](handleError(_0x5b9215,null));};exports[_0x0d24('0x21')]=function(_0xe16258,_0x2adb6a){if(_0xe16258[_0x0d24('0x4a')]['id']){delete _0xe16258[_0x0d24('0x4a')]['id'];}return db[_0x0d24('0x2b')]['find']({'where':{'id':_0xe16258[_0x0d24('0x45')]['id']}})[_0x0d24('0x22')](handleEntityNotFound(_0x2adb6a,null))[_0x0d24('0x22')](saveUpdates(_0xe16258['body'],null))['then'](respondWithResult(_0x2adb6a,null))[_0x0d24('0x43')](handleError(_0x2adb6a,null));};exports[_0x0d24('0x23')]=function(_0x35637,_0x184bc3){return db[_0x0d24('0x2b')][_0x0d24('0x48')]({'where':{'id':_0x35637[_0x0d24('0x45')]['id']}})[_0x0d24('0x22')](handleEntityNotFound(_0x184bc3,null))[_0x0d24('0x22')](removeEntity(_0x184bc3,null))['catch'](handleError(_0x184bc3,null));};exports[_0x0d24('0x52')]=function(_0x2a4ee0,_0x595df8,_0x252b8b){var _0x1f0840=require(_0x0d24('0x53'));return db[_0x0d24('0x2b')]['find']({'where':{'id':_0x2a4ee0[_0x0d24('0x45')]['id']},'raw':!![]})[_0x0d24('0x22')](handleEntityNotFound(_0x595df8,null))['then'](function(){_0x1f0840[_0x0d24('0x52')](_0x2a4ee0['params']['id']);})[_0x0d24('0x22')](respondWithStatusCode(_0x595df8,null))[_0x0d24('0x43')](handleError(_0x595df8,null));};
\ No newline at end of file
+var _0xf612=['end','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','count','include','rows','show','params','find','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','get','Scheduler','UserProfileResource'];(function(_0x129244,_0x229972){var _0x1c4d41=function(_0x28f647){while(--_0x28f647){_0x129244['push'](_0x129244['shift']());}};_0x1c4d41(++_0x229972);}(_0xf612,0x7c));var _0x2f61=function(_0x5d5b3d,_0x26e42a){_0x5d5b3d=_0x5d5b3d-0x0;var _0x397355=_0xf612[_0x5d5b3d];return _0x397355;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2f61('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f61('0x1'));var rp=require('request-promise');var moment=require(_0x2f61('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2f61('0x3'));var util=require(_0x2f61('0x4'));var path=require(_0x2f61('0x5'));var sox=require(_0x2f61('0x6'));var csv=require(_0x2f61('0x7'));var ejs=require(_0x2f61('0x8'));var fs=require('fs');var _=require(_0x2f61('0x9'));var squel=require(_0x2f61('0xa'));var crypto=require('crypto');var jsforce=require(_0x2f61('0xb'));var deskjs=require(_0x2f61('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2f61('0xd'));var Papa=require('papaparse');var Redis=require(_0x2f61('0xe'));var authService=require(_0x2f61('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2f61('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f61('0x11'))(_0x2f61('0x12'));var utils=require(_0x2f61('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d8c34,_0x58b0da){_0x58b0da=_0x58b0da||0xcc;return function(_0x501e1e){if(_0x501e1e){return _0x2d8c34['sendStatus'](_0x58b0da);}return _0x2d8c34[_0x2f61('0x14')](_0x58b0da)['end']();};}function respondWithResult(_0x3a2fe9,_0x1d7206){_0x1d7206=_0x1d7206||0xc8;return function(_0x37812e){if(_0x37812e){return _0x3a2fe9['status'](_0x1d7206)['json'](_0x37812e);}};}function respondWithFilteredResult(_0x3b9524,_0x1d0caf){return function(_0x28da50){if(_0x28da50){var _0x54a474=_0x28da50['count'],_0x33aafb=_0x1d0caf[_0x2f61('0x15')],_0x26cfd8=_0x1d0caf[_0x2f61('0x15')]+_0x1d0caf[_0x2f61('0x16')],_0x3ab32b;if(_0x26cfd8>=_0x54a474){_0x26cfd8=_0x54a474;_0x3ab32b=0xc8;}else{_0x3ab32b=0xce;}_0x3b9524[_0x2f61('0x14')](_0x3ab32b);return _0x3b9524[_0x2f61('0x17')](_0x2f61('0x18'),_0x33aafb+'-'+_0x26cfd8+'/'+_0x54a474)[_0x2f61('0x19')](_0x28da50);}return null;};}function patchUpdates(_0x56f70f){return function(_0x24bbfb){try{jsonpatch[_0x2f61('0x1a')](_0x24bbfb,_0x56f70f,!![]);}catch(_0xa2745e){return BPromise[_0x2f61('0x1b')](_0xa2745e);}return _0x24bbfb[_0x2f61('0x1c')]();};}function saveUpdates(_0x2995de,_0x15d2ae){return function(_0x57cb41){if(_0x57cb41){return _0x57cb41['update'](_0x2995de)['then'](function(_0x12b4ff){return _0x12b4ff;});}return null;};}function removeEntity(_0x4e58df,_0x154cff){return function(_0x1b74fe){if(_0x1b74fe){return _0x1b74fe[_0x2f61('0x1d')]()[_0x2f61('0x1e')](function(){var _0x3da8a7=_0x1b74fe[_0x2f61('0x1f')]({'plain':!![]});var _0x2abb8a=_0x2f61('0x20');return db[_0x2f61('0x21')][_0x2f61('0x1d')]({'where':{'type':_0x2abb8a,'resourceId':_0x3da8a7['id']}})['then'](function(){return _0x1b74fe;});})[_0x2f61('0x1e')](function(){_0x4e58df[_0x2f61('0x14')](0xcc)[_0x2f61('0x22')]();});}};}function handleEntityNotFound(_0xbf2bff,_0x2fa670){return function(_0x3cc01a){if(!_0x3cc01a){_0xbf2bff['sendStatus'](0x194);}return _0x3cc01a;};}function handleError(_0x4d710e,_0x5f232a){_0x5f232a=_0x5f232a||0x1f4;return function(_0x3f4af3){logger[_0x2f61('0x23')](_0x3f4af3[_0x2f61('0x24')]);if(_0x3f4af3[_0x2f61('0x25')]){delete _0x3f4af3[_0x2f61('0x25')];}_0x4d710e[_0x2f61('0x14')](_0x5f232a)[_0x2f61('0x26')](_0x3f4af3);};}exports['index']=function(_0x3c5340,_0x4ac187){var _0x45cb2f={},_0x11bc7e={},_0xa931c9={'count':0x0,'rows':[]};var _0x4d1216=_[_0x2f61('0x27')](db[_0x2f61('0x28')][_0x2f61('0x29')],function(_0x2cd73d){return{'name':_0x2cd73d[_0x2f61('0x2a')],'type':_0x2cd73d[_0x2f61('0x2b')][_0x2f61('0x2c')]};});_0x11bc7e[_0x2f61('0x2d')]=_[_0x2f61('0x27')](_0x4d1216,_0x2f61('0x25'));_0x11bc7e['query']=_[_0x2f61('0x2e')](_0x3c5340[_0x2f61('0x2f')]);_0x11bc7e['filters']=_[_0x2f61('0x30')](_0x11bc7e['model'],_0x11bc7e[_0x2f61('0x2f')]);_0x45cb2f[_0x2f61('0x31')]=_[_0x2f61('0x30')](_0x11bc7e[_0x2f61('0x2d')],qs[_0x2f61('0x32')](_0x3c5340['query'][_0x2f61('0x32')]));_0x45cb2f['attributes']=_0x45cb2f[_0x2f61('0x31')][_0x2f61('0x33')]?_0x45cb2f[_0x2f61('0x31')]:_0x11bc7e[_0x2f61('0x2d')];if(!_0x3c5340[_0x2f61('0x2f')][_0x2f61('0x34')](_0x2f61('0x35'))){_0x45cb2f[_0x2f61('0x16')]=qs[_0x2f61('0x16')](_0x3c5340['query']['limit']);_0x45cb2f[_0x2f61('0x15')]=qs[_0x2f61('0x15')](_0x3c5340['query'][_0x2f61('0x15')]);}_0x45cb2f['order']=qs[_0x2f61('0x36')](_0x3c5340[_0x2f61('0x2f')][_0x2f61('0x36')]);_0x45cb2f[_0x2f61('0x37')]=qs[_0x2f61('0x38')](_[_0x2f61('0x39')](_0x3c5340[_0x2f61('0x2f')],_0x11bc7e[_0x2f61('0x38')]),_0x4d1216);if(_0x3c5340['query'][_0x2f61('0x3a')]){_0x45cb2f[_0x2f61('0x37')]=_[_0x2f61('0x3b')](_0x45cb2f[_0x2f61('0x37')],{'$or':_['map'](_0x4d1216,function(_0x3f5e23){if(_0x3f5e23['type']!=='VIRTUAL'){var _0x316860={};_0x316860[_0x3f5e23[_0x2f61('0x25')]]={'$like':'%'+_0x3c5340['query']['filter']+'%'};return _0x316860;}})});}_0x45cb2f=_[_0x2f61('0x3b')]({},_0x45cb2f,_0x3c5340[_0x2f61('0x3c')]);var _0x2644b4={'where':_0x45cb2f[_0x2f61('0x37')]};return db[_0x2f61('0x28')][_0x2f61('0x3d')](_0x2644b4)['then'](function(_0x371093){_0xa931c9[_0x2f61('0x3d')]=_0x371093;if(_0x3c5340[_0x2f61('0x2f')]['includeAll']){_0x45cb2f[_0x2f61('0x3e')]=[{'all':!![]}];}return db[_0x2f61('0x28')]['findAll'](_0x45cb2f);})['then'](function(_0x51b817){_0xa931c9[_0x2f61('0x3f')]=_0x51b817;return _0xa931c9;})['then'](respondWithFilteredResult(_0x4ac187,_0x45cb2f))['catch'](handleError(_0x4ac187,null));};exports[_0x2f61('0x40')]=function(_0x1cd515,_0x7d2a96){var _0x1ab137={'raw':![],'where':{'id':_0x1cd515[_0x2f61('0x41')]['id']}},_0x5af3b5={};_0x5af3b5[_0x2f61('0x2d')]=_['keys'](db['Schedule']['rawAttributes']);_0x5af3b5['query']=_[_0x2f61('0x2e')](_0x1cd515[_0x2f61('0x2f')]);_0x5af3b5[_0x2f61('0x38')]=_[_0x2f61('0x30')](_0x5af3b5[_0x2f61('0x2d')],_0x5af3b5[_0x2f61('0x2f')]);_0x1ab137['attributes']=_[_0x2f61('0x30')](_0x5af3b5[_0x2f61('0x2d')],qs[_0x2f61('0x32')](_0x1cd515['query'][_0x2f61('0x32')]));_0x1ab137[_0x2f61('0x31')]=_0x1ab137[_0x2f61('0x31')][_0x2f61('0x33')]?_0x1ab137[_0x2f61('0x31')]:_0x5af3b5['model'];if(_0x1cd515[_0x2f61('0x2f')]['includeAll']){_0x1ab137[_0x2f61('0x3e')]=[{'all':!![]}];}_0x1ab137=_[_0x2f61('0x3b')]({},_0x1ab137,_0x1cd515[_0x2f61('0x3c')]);return db['Schedule'][_0x2f61('0x42')](_0x1ab137)[_0x2f61('0x1e')](handleEntityNotFound(_0x7d2a96,null))['then'](respondWithResult(_0x7d2a96,null))[_0x2f61('0x43')](handleError(_0x7d2a96,null));};exports[_0x2f61('0x44')]=function(_0xe7aa90,_0xd3beb){return db[_0x2f61('0x28')][_0x2f61('0x44')](_0xe7aa90[_0x2f61('0x45')],{})[_0x2f61('0x1e')](function(_0x51e2f0){var _0x131985=_0xe7aa90['user'][_0x2f61('0x1f')]({'plain':!![]});if(!_0x131985)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x131985[_0x2f61('0x46')]===_0x2f61('0x47')){var _0x45ab6e=_0x51e2f0[_0x2f61('0x1f')]({'plain':!![]});var _0x37c9f9=_0x2f61('0x20');return db[_0x2f61('0x48')][_0x2f61('0x42')]({'where':{'name':_0x37c9f9,'userProfileId':_0x131985[_0x2f61('0x49')]},'raw':!![]})[_0x2f61('0x1e')](function(_0x1f96f7){if(_0x1f96f7&&_0x1f96f7[_0x2f61('0x4a')]===0x0){return db[_0x2f61('0x21')][_0x2f61('0x44')]({'name':_0x45ab6e[_0x2f61('0x25')],'resourceId':_0x45ab6e['id'],'type':_0x1f96f7[_0x2f61('0x25')],'sectionId':_0x1f96f7['id']},{})[_0x2f61('0x1e')](function(){return _0x51e2f0;});}else{return _0x51e2f0;}})[_0x2f61('0x43')](function(_0x39a36a){logger[_0x2f61('0x23')](_0x2f61('0x4b'),_0x39a36a);throw _0x39a36a;});}return _0x51e2f0;})[_0x2f61('0x1e')](respondWithResult(_0xd3beb,0xc9))[_0x2f61('0x43')](handleError(_0xd3beb,null));};exports[_0x2f61('0x4c')]=function(_0x2df747,_0x24a99b){if(_0x2df747[_0x2f61('0x45')]['id']){delete _0x2df747['body']['id'];}return db[_0x2f61('0x28')][_0x2f61('0x42')]({'where':{'id':_0x2df747[_0x2f61('0x41')]['id']}})['then'](handleEntityNotFound(_0x24a99b,null))[_0x2f61('0x1e')](saveUpdates(_0x2df747[_0x2f61('0x45')],null))[_0x2f61('0x1e')](respondWithResult(_0x24a99b,null))[_0x2f61('0x43')](handleError(_0x24a99b,null));};exports['destroy']=function(_0x34f1b0,_0x459ee1){return db[_0x2f61('0x28')]['find']({'where':{'id':_0x34f1b0[_0x2f61('0x41')]['id']}})[_0x2f61('0x1e')](handleEntityNotFound(_0x459ee1,null))[_0x2f61('0x1e')](removeEntity(_0x459ee1,null))[_0x2f61('0x43')](handleError(_0x459ee1,null));};exports[_0x2f61('0x4d')]=function(_0x3e70cf,_0x403a2f,_0x422b73){var _0x30e44e=require(_0x2f61('0x4e'));return db[_0x2f61('0x28')][_0x2f61('0x42')]({'where':{'id':_0x3e70cf['params']['id']},'raw':!![]})[_0x2f61('0x1e')](handleEntityNotFound(_0x403a2f,null))[_0x2f61('0x1e')](function(){_0x30e44e[_0x2f61('0x4d')](_0x3e70cf[_0x2f61('0x41')]['id']);})['then'](respondWithStatusCode(_0x403a2f,null))[_0x2f61('0x43')](handleError(_0x403a2f,null));};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js
index 89f6c24..a6419c4 100644
--- a/server/api/schedule/schedule.model.js
+++ b/server/api/schedule/schedule.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3dfe=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash'];(function(_0x3c609d,_0x2edac5){var _0x42702d=function(_0x42f481){while(--_0x42f481){_0x3c609d['push'](_0x3c609d['shift']());}};_0x42702d(++_0x2edac5);}(_0x3dfe,0xcf));var _0xe3df=function(_0x13f900,_0x257137){_0x13f900=_0x13f900-0x0;var _0x3d2786=_0x3dfe[_0x13f900];return _0x3d2786;};'use strict';var _=require(_0xe3df('0x0'));var util=require(_0xe3df('0x1'));var logger=require(_0xe3df('0x2'))(_0xe3df('0x3'));var moment=require(_0xe3df('0x4'));var BPromise=require(_0xe3df('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3df('0x6'));var rimraf=require('rimraf');var config=require(_0xe3df('0x7'));var attributes=require(_0xe3df('0x8'));module[_0xe3df('0x9')]=function(_0x57783d,_0x29b53a){return _0x57783d[_0xe3df('0xa')](_0xe3df('0xb'),attributes,{'tableName':_0xe3df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ae8=['define','tools_schedules','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x414815,_0x3b9381){var _0x143e0d=function(_0xa131da){while(--_0xa131da){_0x414815['push'](_0x414815['shift']());}};_0x143e0d(++_0x3b9381);}(_0x4ae8,0x1cd));var _0x84ae=function(_0x1cf820,_0x91233c){_0x1cf820=_0x1cf820-0x0;var _0x4028c4=_0x4ae8[_0x1cf820];return _0x4028c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x84ae('0x0'));var moment=require(_0x84ae('0x1'));var BPromise=require(_0x84ae('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84ae('0x3'));var rimraf=require(_0x84ae('0x4'));var config=require(_0x84ae('0x5'));var attributes=require('./schedule.attributes');module[_0x84ae('0x6')]=function(_0x21956d,_0x39fd64){return _0x21956d[_0x84ae('0x7')]('Schedule',attributes,{'tableName':_0x84ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js
index d32d24e..c49efd5 100644
--- a/server/api/schedule/schedule.rpc.js
+++ b/server/api/schedule/schedule.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4172=['../../config/logger','rpc','client','request','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','util','bluebird','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4172,0x1bc));var _0x2417=function(_0x5b32c5,_0x160e25){_0x5b32c5=_0x5b32c5-0x0;var _0x30e8e4=_0x4172[_0x5b32c5];return _0x30e8e4;};'use strict';var _=require('lodash');var util=require(_0x2417('0x0'));var moment=require('moment');var BPromise=require(_0x2417('0x1'));var rs=require(_0x2417('0x2'));var fs=require('fs');var Redis=require(_0x2417('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2417('0x4'))(_0x2417('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2417('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ccc3f,_0x12f82f,_0x448635){return new BPromise(function(_0x3cc2ef,_0x3845b0){return client[_0x2417('0x7')](_0x3ccc3f,_0x448635)['then'](function(_0x36327f){logger['info'](_0x2417('0x8'),_0x12f82f,'request\x20sent');logger[_0x2417('0x9')](_0x2417('0xa'),_0x12f82f,'request\x20sent',JSON['stringify'](_0x36327f));if(_0x36327f['error']){if(_0x36327f['error']['code']===0x1f4){logger[_0x2417('0xb')](_0x2417('0x8'),_0x12f82f,_0x36327f[_0x2417('0xb')]['message']);return _0x3845b0(_0x36327f[_0x2417('0xb')][_0x2417('0xc')]);}logger[_0x2417('0xb')](_0x2417('0x8'),_0x12f82f,_0x36327f[_0x2417('0xb')][_0x2417('0xc')]);return _0x3cc2ef(_0x36327f[_0x2417('0xb')][_0x2417('0xc')]);}else{logger[_0x2417('0xd')]('Schedule,\x20%s,\x20%s',_0x12f82f,_0x2417('0xe'));_0x3cc2ef(_0x36327f[_0x2417('0xf')][_0x2417('0xc')]);}})['catch'](function(_0x136cdf){logger['error']('Schedule,\x20%s,\x20%s',_0x12f82f,_0x136cdf);_0x3845b0(_0x136cdf);});});}
\ No newline at end of file
+var _0x279b=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3a4028,_0x512e41){var _0x2971df=function(_0x3ba30a){while(--_0x3ba30a){_0x3a4028['push'](_0x3a4028['shift']());}};_0x2971df(++_0x512e41);}(_0x279b,0x1b7));var _0xb279=function(_0xb9404d,_0xb9c541){_0xb9404d=_0xb9404d-0x0;var _0x5cfcf7=_0x279b[_0xb9404d];return _0x5cfcf7;};'use strict';var _=require(_0xb279('0x0'));var util=require(_0xb279('0x1'));var moment=require(_0xb279('0x2'));var BPromise=require(_0xb279('0x3'));var rs=require(_0xb279('0x4'));var fs=require('fs');var Redis=require(_0xb279('0x5'));var db=require(_0xb279('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb279('0x7'))(_0xb279('0x8'));var config=require(_0xb279('0x9'));var jayson=require(_0xb279('0xa'));var client=jayson[_0xb279('0xb')][_0xb279('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35d8e2,_0x1eccc4,_0x53db7e){return new BPromise(function(_0x390b1e,_0xc96c42){return client['request'](_0x35d8e2,_0x53db7e)[_0xb279('0xd')](function(_0x319e54){logger[_0xb279('0xe')](_0xb279('0xf'),_0x1eccc4,'request\x20sent');logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x1eccc4,_0xb279('0x10'),JSON[_0xb279('0x11')](_0x319e54));if(_0x319e54[_0xb279('0x12')]){if(_0x319e54[_0xb279('0x12')][_0xb279('0x13')]===0x1f4){logger[_0xb279('0x12')](_0xb279('0xf'),_0x1eccc4,_0x319e54[_0xb279('0x12')][_0xb279('0x14')]);return _0xc96c42(_0x319e54['error'][_0xb279('0x14')]);}logger[_0xb279('0x12')](_0xb279('0xf'),_0x1eccc4,_0x319e54['error']['message']);return _0x390b1e(_0x319e54['error'][_0xb279('0x14')]);}else{logger[_0xb279('0xe')]('Schedule,\x20%s,\x20%s',_0x1eccc4,_0xb279('0x10'));_0x390b1e(_0x319e54[_0xb279('0x15')][_0xb279('0x14')]);}})[_0xb279('0x16')](function(_0x191270){logger[_0xb279('0x12')](_0xb279('0xf'),_0x1eccc4,_0x191270);_0xc96c42(_0x191270);});});}
\ No newline at end of file
diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js
index 3dee0ab..0c79345 100644
--- a/server/api/screenRecording/index.js
+++ b/server/api/screenRecording/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46fb=['isAuthenticated','index','/describe','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x2fc338,_0x43d279){var _0x316084=function(_0xe43e14){while(--_0xe43e14){_0x2fc338['push'](_0x2fc338['shift']());}};_0x316084(++_0x43d279);}(_0x46fb,0x13c));var _0xb46f=function(_0x4c4829,_0x397dc2){_0x4c4829=_0x4c4829-0x0;var _0x4cd664=_0x46fb[_0x4c4829];return _0x4cd664;};'use strict';var multer=require(_0xb46f('0x0'));var util=require('util');var path=require(_0xb46f('0x1'));var timeout=require(_0xb46f('0x2'));var express=require(_0xb46f('0x3'));var router=express[_0xb46f('0x4')]();var auth=require(_0xb46f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb46f('0x6'));var controller=require('./screenRecording.controller');router[_0xb46f('0x7')]('/',auth[_0xb46f('0x8')](),controller[_0xb46f('0x9')]);router[_0xb46f('0x7')](_0xb46f('0xa'),auth[_0xb46f('0x8')](),controller['describe']);router['get']('/:id',auth[_0xb46f('0x8')](),controller['show']);router[_0xb46f('0x7')]('/:id/download',auth[_0xb46f('0x8')](),controller['download']);router[_0xb46f('0xb')]('/',auth['isAuthenticated'](),controller[_0xb46f('0xc')]);router[_0xb46f('0xd')](_0xb46f('0xe'),auth[_0xb46f('0x8')](),controller[_0xb46f('0xf')]);router['delete'](_0xb46f('0xe'),auth['isAuthenticated'](),controller[_0xb46f('0x10')]);module[_0xb46f('0x11')]=router;
\ No newline at end of file
+var _0xc373=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','isAuthenticated','/:id/download','download','post','create','put'];(function(_0x44a329,_0x45f280){var _0x45f2a3=function(_0x272e62){while(--_0x272e62){_0x44a329['push'](_0x44a329['shift']());}};_0x45f2a3(++_0x45f280);}(_0xc373,0xdd));var _0x3c37=function(_0x21b706,_0x1022f4){_0x21b706=_0x21b706-0x0;var _0x13b94a=_0xc373[_0x21b706];return _0x13b94a;};'use strict';var multer=require(_0x3c37('0x0'));var util=require(_0x3c37('0x1'));var path=require(_0x3c37('0x2'));var timeout=require(_0x3c37('0x3'));var express=require(_0x3c37('0x4'));var router=express[_0x3c37('0x5')]();var auth=require(_0x3c37('0x6'));var interaction=require(_0x3c37('0x7'));var config=require(_0x3c37('0x8'));var controller=require('./screenRecording.controller');router[_0x3c37('0x9')]('/',auth['isAuthenticated'](),controller[_0x3c37('0xa')]);router[_0x3c37('0x9')](_0x3c37('0xb'),auth['isAuthenticated'](),controller[_0x3c37('0xc')]);router[_0x3c37('0x9')]('/:id',auth[_0x3c37('0xd')](),controller['show']);router[_0x3c37('0x9')](_0x3c37('0xe'),auth[_0x3c37('0xd')](),controller[_0x3c37('0xf')]);router[_0x3c37('0x10')]('/',auth[_0x3c37('0xd')](),controller[_0x3c37('0x11')]);router[_0x3c37('0x12')](_0x3c37('0x13'),auth[_0x3c37('0xd')](),controller[_0x3c37('0x14')]);router[_0x3c37('0x15')](_0x3c37('0x13'),auth[_0x3c37('0xd')](),controller[_0x3c37('0x16')]);module[_0x3c37('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js
index 2fdaaa6..3121c84 100644
--- a/server/api/screenRecording/screenRecording.attributes.js
+++ b/server/api/screenRecording/screenRecording.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4bc3=['setDataValue','INTEGER','closedAt','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','../../config/environment','exports','getDataValue','value','extname','STRING'];(function(_0x28c343,_0x19e9e5){var _0x481e0d=function(_0xa0344c){while(--_0xa0344c){_0x28c343['push'](_0x28c343['shift']());}};_0x481e0d(++_0x19e9e5);}(_0x4bc3,0x16e));var _0x34bc=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x4bc3[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0x34bc('0x0'));var moment=require(_0x34bc('0x1'));var path=require('path');var config=require(_0x34bc('0x2'));module[_0x34bc('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x34bc('0x4')](_0x34bc('0x5'))?path[_0x34bc('0x6')](this[_0x34bc('0x4')](_0x34bc('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x34bc('0x7')]},'channel':{'type':Sequelize[_0x34bc('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x21451b){var _0x50320d=_0x21451b['replace'](/\\/g,'/');this[_0x34bc('0x8')](_0x34bc('0x5'),_0x50320d);}},'rating':{'type':Sequelize[_0x34bc('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x34bc('0x9')],'set':function(_0x409105){this[_0x34bc('0x8')]('startedAt',moment()['subtract'](_0x409105,'ms'));this[_0x34bc('0x8')](_0x34bc('0xa'),moment());this[_0x34bc('0x8')]('duration',_0x409105);}},'startedAt':{'type':Sequelize[_0x34bc('0xb')],'get':function(){return moment(this['getDataValue'](_0x34bc('0xc')))[_0x34bc('0xd')](_0x34bc('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0x34bc('0xb')],'get':function(){return moment(this['getDataValue'](_0x34bc('0xa')))[_0x34bc('0xd')](_0x34bc('0xe'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x34bc('0x4')]('createdAt'))[_0x34bc('0xd')](_0x34bc('0xe'))[_0x34bc('0xf')]();}},'updatedAt':{'type':Sequelize[_0x34bc('0xb')],'get':function(){return moment(this[_0x34bc('0x4')](_0x34bc('0x10')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}};
\ No newline at end of file
+var _0x038b=['value','extname','STRING','replace','INTEGER','startedAt','subtract','closedAt','setDataValue','duration','DATE','getDataValue','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','../../config/environment','VIRTUAL'];(function(_0xe34eb8,_0x339eb1){var _0x1c9b49=function(_0x25f3a9){while(--_0x25f3a9){_0xe34eb8['push'](_0xe34eb8['shift']());}};_0x1c9b49(++_0x339eb1);}(_0x038b,0x114));var _0xb038=function(_0x24ad02,_0x324801){_0x24ad02=_0x24ad02-0x0;var _0x3e79ed=_0x038b[_0x24ad02];return _0x3e79ed;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var config=require(_0xb038('0x2'));module['exports']={'format':{'type':Sequelize[_0xb038('0x3')],'get':function(){return this['getDataValue'](_0xb038('0x4'))?path[_0xb038('0x5')](this['getDataValue'](_0xb038('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xb038('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x2e3e64){var _0x1b077a=_0x2e3e64[_0xb038('0x7')](/\\/g,'/');this['setDataValue']('value',_0x1b077a);}},'rating':{'type':Sequelize[_0xb038('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb038('0x8')],'set':function(_0x4d85b4){this['setDataValue'](_0xb038('0x9'),moment()[_0xb038('0xa')](_0x4d85b4,'ms'));this['setDataValue'](_0xb038('0xb'),moment());this[_0xb038('0xc')](_0xb038('0xd'),_0x4d85b4);}},'startedAt':{'type':Sequelize[_0xb038('0xe')],'get':function(){return moment(this[_0xb038('0xf')](_0xb038('0x9')))[_0xb038('0x10')](_0xb038('0x11'))[_0xb038('0x12')]();}},'closedAt':{'type':Sequelize[_0xb038('0xe')],'get':function(){return moment(this[_0xb038('0xf')](_0xb038('0xb')))[_0xb038('0x10')](_0xb038('0x11'))[_0xb038('0x12')]();}},'createdAt':{'type':Sequelize[_0xb038('0xe')],'get':function(){return moment(this[_0xb038('0xf')]('createdAt'))[_0xb038('0x10')](_0xb038('0x11'))[_0xb038('0x12')]();}},'updatedAt':{'type':Sequelize[_0xb038('0xe')],'get':function(){return moment(this[_0xb038('0xf')](_0xb038('0x13')))['format'](_0xb038('0x11'))[_0xb038('0x12')]();}}};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js
index 7fc3bd9..f22f6d8 100644
--- a/server/api/screenRecording/screenRecording.controller.js
+++ b/server/api/screenRecording/screenRecording.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ca8=['unlinkSync','.cypher','end','eml-format','rimraf','fast-json-patch','moment','bluebird','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','show','merge','find','catch','create','body','update','createdAt','value','describe','download','../../components/encryptor','uniqueid','params','join','root','format','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0x4ca8,0x18f));var _0x84ca=function(_0x52715d,_0x58ff54){_0x52715d=_0x52715d-0x0;var _0x125509=_0x4ca8[_0x52715d];return _0x125509;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x84ca('0x0'));var rimraf=require(_0x84ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84ca('0x2'));var rp=require('request-promise');var moment=require(_0x84ca('0x3'));var BPromise=require(_0x84ca('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x84ca('0x5'));var ejs=require(_0x84ca('0x6'));var fs=require('fs');var _=require(_0x84ca('0x7'));var squel=require(_0x84ca('0x8'));var crypto=require(_0x84ca('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x84ca('0xa'));var toCsv=require(_0x84ca('0x5'));var querystring=require(_0x84ca('0xb'));var Papa=require(_0x84ca('0xc'));var Redis=require(_0x84ca('0xd'));var authService=require(_0x84ca('0xe'));var qs=require(_0x84ca('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x84ca('0x10'))(_0x84ca('0x11'));var utils=require(_0x84ca('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56efd9,_0x2f70ce){_0x2f70ce=_0x2f70ce||0xcc;return function(_0x59ba3a){if(_0x59ba3a){return _0x56efd9[_0x84ca('0x13')](_0x2f70ce);}return _0x56efd9[_0x84ca('0x14')](_0x2f70ce)['end']();};}function respondWithResult(_0x106b4b,_0x33b419){_0x33b419=_0x33b419||0xc8;return function(_0x4cfbaf){if(_0x4cfbaf){return _0x106b4b[_0x84ca('0x14')](_0x33b419)['json'](_0x4cfbaf);}};}function respondWithFilteredResult(_0x49e96a,_0xe797f6){return function(_0x26a776){if(_0x26a776){var _0x389ae6=_0x26a776[_0x84ca('0x15')],_0x510177=_0xe797f6[_0x84ca('0x16')],_0x1865d5=_0xe797f6['offset']+_0xe797f6[_0x84ca('0x17')],_0x22b085;if(_0x1865d5>=_0x389ae6){_0x1865d5=_0x389ae6;_0x22b085=0xc8;}else{_0x22b085=0xce;}_0x49e96a['status'](_0x22b085);return _0x49e96a[_0x84ca('0x18')](_0x84ca('0x19'),_0x510177+'-'+_0x1865d5+'/'+_0x389ae6)[_0x84ca('0x1a')](_0x26a776);}return null;};}function patchUpdates(_0x5ba3d8){return function(_0x2d0fdc){try{jsonpatch[_0x84ca('0x1b')](_0x2d0fdc,_0x5ba3d8,!![]);}catch(_0x4fa625){return BPromise[_0x84ca('0x1c')](_0x4fa625);}return _0x2d0fdc['save']();};}function saveUpdates(_0x552146,_0x204bd8){return function(_0x4fd6f9){if(_0x4fd6f9){return _0x4fd6f9['update'](_0x552146)[_0x84ca('0x1d')](function(_0xfd241c){return _0xfd241c;});}return null;};}function removeEntity(_0x124c78,_0x176a84){return function(_0x41bc72){if(_0x41bc72){return _0x41bc72[_0x84ca('0x1e')]()[_0x84ca('0x1d')](function(){_0x124c78[_0x84ca('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x547291,_0x452904){return function(_0x3e0121){if(!_0x3e0121){_0x547291[_0x84ca('0x13')](0x194);}return _0x3e0121;};}function handleError(_0x4124c8,_0x144ddc){_0x144ddc=_0x144ddc||0x1f4;return function(_0xb473eb){logger[_0x84ca('0x1f')](_0xb473eb[_0x84ca('0x20')]);if(_0xb473eb['name']){delete _0xb473eb[_0x84ca('0x21')];}_0x4124c8[_0x84ca('0x14')](_0x144ddc)[_0x84ca('0x22')](_0xb473eb);};}exports['index']=function(_0x246ab8,_0x428412){var _0x1df5c7={},_0x44ea55={},_0x52384e={'count':0x0,'rows':[]};var _0x16a0d=_[_0x84ca('0x23')](db[_0x84ca('0x24')]['rawAttributes'],function(_0x666f20){return{'name':_0x666f20[_0x84ca('0x25')],'type':_0x666f20[_0x84ca('0x26')][_0x84ca('0x27')]};});_0x44ea55[_0x84ca('0x28')]=_['differenceBy'](_[_0x84ca('0x23')](_0x16a0d,_0x84ca('0x21')),['format']);_0x44ea55[_0x84ca('0x29')]=_[_0x84ca('0x2a')](_0x246ab8['query']);_0x44ea55[_0x84ca('0x2b')]=_[_0x84ca('0x2c')](_0x44ea55[_0x84ca('0x28')],_0x44ea55[_0x84ca('0x29')]);_0x1df5c7[_0x84ca('0x2d')]=_['intersection'](_0x44ea55[_0x84ca('0x28')],qs[_0x84ca('0x2e')](_0x246ab8['query'][_0x84ca('0x2e')]));_0x1df5c7['attributes']=_0x1df5c7[_0x84ca('0x2d')][_0x84ca('0x2f')]?_0x1df5c7[_0x84ca('0x2d')]:_0x44ea55['model'];if(!_0x246ab8['query'][_0x84ca('0x30')](_0x84ca('0x31'))){_0x1df5c7[_0x84ca('0x17')]=qs[_0x84ca('0x17')](_0x246ab8[_0x84ca('0x29')][_0x84ca('0x17')]);_0x1df5c7['offset']=qs['offset'](_0x246ab8[_0x84ca('0x29')]['offset']);}_0x1df5c7[_0x84ca('0x32')]=qs[_0x84ca('0x33')](_0x246ab8['query'][_0x84ca('0x33')]);_0x1df5c7['where']=qs['filters'](_[_0x84ca('0x34')](_0x246ab8[_0x84ca('0x29')],_0x44ea55['filters']),_0x16a0d);if(_0x246ab8['query'][_0x84ca('0x35')]){_0x1df5c7[_0x84ca('0x36')]=_['merge'](_0x1df5c7[_0x84ca('0x36')],{'$or':_[_0x84ca('0x23')](_0x16a0d,function(_0xf8428d){if(_0xf8428d[_0x84ca('0x26')]!==_0x84ca('0x37')){var _0x47a8d8={};_0x47a8d8[_0xf8428d[_0x84ca('0x21')]]={'$like':'%'+_0x246ab8[_0x84ca('0x29')][_0x84ca('0x35')]+'%'};return _0x47a8d8;}})});}_0x1df5c7=_['merge']({},_0x1df5c7,_0x246ab8[_0x84ca('0x38')]);var _0x1b8670={'where':_0x1df5c7[_0x84ca('0x36')]};return db['ScreenRecording'][_0x84ca('0x15')](_0x1b8670)[_0x84ca('0x1d')](function(_0x420d56){_0x52384e[_0x84ca('0x15')]=_0x420d56;if(_0x246ab8[_0x84ca('0x29')][_0x84ca('0x39')]){_0x1df5c7[_0x84ca('0x3a')]=[{'all':!![]}];}return db[_0x84ca('0x24')]['findAll'](_0x1df5c7);})[_0x84ca('0x1d')](function(_0x52307a){_0x52384e[_0x84ca('0x3b')]=_0x52307a;return _0x52384e;})[_0x84ca('0x1d')](respondWithFilteredResult(_0x428412,_0x1df5c7))['catch'](handleError(_0x428412,null));};exports[_0x84ca('0x3c')]=function(_0x18089e,_0x46b7e6){var _0x2d7944={'raw':![],'where':{'id':_0x18089e['params']['id']}},_0x1272aa={};_0x1272aa[_0x84ca('0x28')]=_[_0x84ca('0x2a')](db[_0x84ca('0x24')]['rawAttributes']);_0x1272aa[_0x84ca('0x29')]=_['keys'](_0x18089e[_0x84ca('0x29')]);_0x1272aa[_0x84ca('0x2b')]=_[_0x84ca('0x2c')](_0x1272aa['model'],_0x1272aa[_0x84ca('0x29')]);_0x2d7944[_0x84ca('0x2d')]=_[_0x84ca('0x2c')](_0x1272aa[_0x84ca('0x28')],qs['fields'](_0x18089e[_0x84ca('0x29')]['fields']));_0x2d7944[_0x84ca('0x2d')]=_0x2d7944[_0x84ca('0x2d')][_0x84ca('0x2f')]?_0x2d7944[_0x84ca('0x2d')]:_0x1272aa['model'];if(_0x18089e['query'][_0x84ca('0x39')]){_0x2d7944[_0x84ca('0x3a')]=[{'all':!![]}];}_0x2d7944=_[_0x84ca('0x3d')]({},_0x2d7944,_0x18089e[_0x84ca('0x38')]);return db[_0x84ca('0x24')][_0x84ca('0x3e')](_0x2d7944)[_0x84ca('0x1d')](handleEntityNotFound(_0x46b7e6,null))[_0x84ca('0x1d')](respondWithResult(_0x46b7e6,null))[_0x84ca('0x3f')](handleError(_0x46b7e6,null));};exports[_0x84ca('0x40')]=function(_0x121a88,_0x30a85a){return db[_0x84ca('0x24')][_0x84ca('0x40')](_0x121a88[_0x84ca('0x41')],{})['then'](respondWithResult(_0x30a85a,0xc9))[_0x84ca('0x3f')](handleError(_0x30a85a,null));};exports[_0x84ca('0x42')]=function(_0x4e6f87,_0x775dae){if(_0x4e6f87['body']['id']){delete _0x4e6f87[_0x84ca('0x41')]['id'];}delete _0x4e6f87[_0x84ca('0x41')]['duration'];delete _0x4e6f87[_0x84ca('0x41')][_0x84ca('0x43')];delete _0x4e6f87['body']['closedAt'];delete _0x4e6f87[_0x84ca('0x41')][_0x84ca('0x44')];return db['ScreenRecording']['find']({'where':{'id':_0x4e6f87['params']['id']}})[_0x84ca('0x1d')](handleEntityNotFound(_0x775dae,null))['then'](saveUpdates(_0x4e6f87['body'],null))[_0x84ca('0x1d')](respondWithResult(_0x775dae,null))[_0x84ca('0x3f')](handleError(_0x775dae,null));};exports[_0x84ca('0x45')]=function(_0xafcb6e,_0x3a2fbd){return db[_0x84ca('0x24')][_0x84ca('0x45')]()[_0x84ca('0x1d')](respondWithResult(_0x3a2fbd,null))[_0x84ca('0x3f')](handleError(_0x3a2fbd,null));};exports[_0x84ca('0x46')]=function(_0x528c60,_0x489ba5,_0x52a4aa){var _0x1f95bb=require(_0x84ca('0x47'));var _0xe37fc=![];var _0x2fcb42={};if(_0x528c60[_0x84ca('0x29')][_0x84ca('0x26')]&&_0x528c60[_0x84ca('0x29')][_0x84ca('0x26')]===_0x84ca('0x48')){_0x2fcb42['uniqueid']=_0x528c60[_0x84ca('0x49')]['id'];}else{_0x2fcb42['id']=_0x528c60[_0x84ca('0x49')]['id'];}return db[_0x84ca('0x24')][_0x84ca('0x3e')]({'where':_0x2fcb42,'attributes':['id','value'],'raw':!![]})[_0x84ca('0x1d')](handleEntityNotFound(_0x489ba5,null))[_0x84ca('0x1d')](function(_0x16398c){if(_0x16398c){var _0xf83495=path[_0x84ca('0x4a')](config[_0x84ca('0x4b')],'server/files/screen_recordings',_0x16398c[_0x84ca('0x44')]);var _0x8c2a6d=util[_0x84ca('0x4c')]('%s.cypher',_0xf83495);if(fs[_0x84ca('0x4d')](_0x8c2a6d)){_0xe37fc=!![];return _0x1f95bb[_0x84ca('0x4e')](_0x8c2a6d,_0xf83495,config[_0x84ca('0x4f')][_0x84ca('0x50')])[_0x84ca('0x1d')](function(){return _0x16398c;});}return _0x16398c;}})[_0x84ca('0x1d')](function(_0x196773){if(_0x196773){var _0x166f3a=path[_0x84ca('0x4a')](config['root'],_0x84ca('0x51'),_0x196773['value']);if(!fs[_0x84ca('0x4d')](_0x166f3a)){throw new db[(_0x84ca('0x52'))][(_0x84ca('0x53'))](_0x84ca('0x54'));}if(_0x196773[_0x84ca('0x55')]){return _0x489ba5[_0x84ca('0x46')](_0x166f3a,_0x196773[_0x84ca('0x55')]+path[_0x84ca('0x56')](_0x166f3a),function(){if(_0xe37fc){fs['unlink'](_0x166f3a);}});}else{return _0x489ba5[_0x84ca('0x46')](_0x166f3a,function(_0x1d32f){if(_0xe37fc){fs[_0x84ca('0x57')](_0x166f3a);}});}}})[_0x84ca('0x3f')](function(_0x12bf29){if(_0x12bf29[_0x84ca('0x58')]===_0x84ca('0x54')){_0x489ba5['status'](0x194)[_0x84ca('0x22')](_0x84ca('0x59'));}else{return handleError(_0x489ba5,null);}});};exports[_0x84ca('0x1e')]=function(_0x5b5289,_0x57e84b){return db[_0x84ca('0x24')][_0x84ca('0x3e')]({'where':{'id':_0x5b5289[_0x84ca('0x49')]['id']}})[_0x84ca('0x1d')](function(_0x1c05de){if(!_0x1c05de)throw new ReferenceError(_0x84ca('0x5a'));return _0x1c05de;})[_0x84ca('0x1d')](function(_0x2109de){var _0x46014e=path['join'](config[_0x84ca('0x4b')],_0x84ca('0x51'),_0x2109de[_0x84ca('0x44')]);logger['info'](_0x84ca('0x5b'),_0x46014e);if(!_[_0x84ca('0x5c')](_0x2109de['value'])&&fs['existsSync'](_0x46014e)){logger[_0x84ca('0x5d')](_0x84ca('0x5e')+_0x46014e+_0x84ca('0x5f'));fs[_0x84ca('0x60')](_0x46014e);}_0x46014e=_0x46014e+_0x84ca('0x61');if(!_[_0x84ca('0x5c')](_0x2109de[_0x84ca('0x44')])&&fs[_0x84ca('0x4d')](_0x46014e)){logger['info'](_0x84ca('0x5e')+_0x46014e+_0x84ca('0x5f'));fs[_0x84ca('0x60')](_0x46014e);}return _0x2109de;})[_0x84ca('0x1d')](function(_0x3d8142){if(!_0x3d8142)throw new InternalError();return _0x3d8142[_0x84ca('0x1e')]();})['then'](function(){_0x57e84b[_0x84ca('0x14')](0xcc)[_0x84ca('0x62')]();})[_0x84ca('0x3f')](handleError(_0x57e84b,null));};
\ No newline at end of file
+var _0x183d=['order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','offset','set','json','reject','update','then','destroy','end','sendStatus','error','stack','name','send','ScreenRecording','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x183d,0x92));var _0xd183=function(_0x456f5c,_0x592a90){_0x456f5c=_0x456f5c-0x0;var _0x11d7fd=_0x183d[_0x456f5c];return _0x11d7fd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd183('0x0'));var rimraf=require(_0xd183('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd183('0x2'));var rp=require(_0xd183('0x3'));var moment=require(_0xd183('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd183('0x5'));var util=require(_0xd183('0x6'));var path=require(_0xd183('0x7'));var sox=require(_0xd183('0x8'));var csv=require('to-csv');var ejs=require(_0xd183('0x9'));var fs=require('fs');var _=require(_0xd183('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd183('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd183('0xc'));var querystring=require(_0xd183('0xd'));var Papa=require(_0xd183('0xe'));var Redis=require(_0xd183('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd183('0x10'));var as=require(_0xd183('0x11'));var hardwareService=require(_0xd183('0x12'));var logger=require(_0xd183('0x13'))(_0xd183('0x14'));var utils=require(_0xd183('0x15'));var config=require(_0xd183('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2abc7b,_0x5dd34a){_0x5dd34a=_0x5dd34a||0xcc;return function(_0x26bb43){if(_0x26bb43){return _0x2abc7b['sendStatus'](_0x5dd34a);}return _0x2abc7b[_0xd183('0x17')](_0x5dd34a)['end']();};}function respondWithResult(_0x135704,_0x506676){_0x506676=_0x506676||0xc8;return function(_0x187a24){if(_0x187a24){return _0x135704[_0xd183('0x17')](_0x506676)['json'](_0x187a24);}};}function respondWithFilteredResult(_0x2718e4,_0x4ebc0b){return function(_0x498707){if(_0x498707){var _0x29c2b0=_0x498707['count'],_0x3444b6=_0x4ebc0b[_0xd183('0x18')],_0x3aa56e=_0x4ebc0b[_0xd183('0x18')]+_0x4ebc0b['limit'],_0x170e63;if(_0x3aa56e>=_0x29c2b0){_0x3aa56e=_0x29c2b0;_0x170e63=0xc8;}else{_0x170e63=0xce;}_0x2718e4[_0xd183('0x17')](_0x170e63);return _0x2718e4[_0xd183('0x19')]('Content-Range',_0x3444b6+'-'+_0x3aa56e+'/'+_0x29c2b0)[_0xd183('0x1a')](_0x498707);}return null;};}function patchUpdates(_0x28083e){return function(_0x2cd386){try{jsonpatch['apply'](_0x2cd386,_0x28083e,!![]);}catch(_0x560c64){return BPromise[_0xd183('0x1b')](_0x560c64);}return _0x2cd386['save']();};}function saveUpdates(_0x5adee8,_0x454273){return function(_0x91228d){if(_0x91228d){return _0x91228d[_0xd183('0x1c')](_0x5adee8)[_0xd183('0x1d')](function(_0x7b8ee0){return _0x7b8ee0;});}return null;};}function removeEntity(_0x4e021c,_0x8f1ff6){return function(_0x2aadf2){if(_0x2aadf2){return _0x2aadf2[_0xd183('0x1e')]()['then'](function(){_0x4e021c[_0xd183('0x17')](0xcc)[_0xd183('0x1f')]();});}};}function handleEntityNotFound(_0x1882df,_0xe2a795){return function(_0xfbcd1a){if(!_0xfbcd1a){_0x1882df[_0xd183('0x20')](0x194);}return _0xfbcd1a;};}function handleError(_0x407a05,_0x5509c3){_0x5509c3=_0x5509c3||0x1f4;return function(_0x2d7e18){logger[_0xd183('0x21')](_0x2d7e18[_0xd183('0x22')]);if(_0x2d7e18[_0xd183('0x23')]){delete _0x2d7e18[_0xd183('0x23')];}_0x407a05[_0xd183('0x17')](_0x5509c3)[_0xd183('0x24')](_0x2d7e18);};}exports['index']=function(_0x5b60d6,_0x520f3a){var _0x28e56a={},_0x2763b7={},_0x4c8532={'count':0x0,'rows':[]};var _0x5e0dc7=_['map'](db[_0xd183('0x25')][_0xd183('0x26')],function(_0x5bf15a){return{'name':_0x5bf15a[_0xd183('0x27')],'type':_0x5bf15a[_0xd183('0x28')][_0xd183('0x29')]};});_0x2763b7[_0xd183('0x2a')]=_['differenceBy'](_[_0xd183('0x2b')](_0x5e0dc7,_0xd183('0x23')),['format']);_0x2763b7[_0xd183('0x2c')]=_[_0xd183('0x2d')](_0x5b60d6[_0xd183('0x2c')]);_0x2763b7[_0xd183('0x2e')]=_[_0xd183('0x2f')](_0x2763b7[_0xd183('0x2a')],_0x2763b7['query']);_0x28e56a[_0xd183('0x30')]=_[_0xd183('0x2f')](_0x2763b7['model'],qs[_0xd183('0x31')](_0x5b60d6[_0xd183('0x2c')][_0xd183('0x31')]));_0x28e56a[_0xd183('0x30')]=_0x28e56a[_0xd183('0x30')][_0xd183('0x32')]?_0x28e56a[_0xd183('0x30')]:_0x2763b7[_0xd183('0x2a')];if(!_0x5b60d6[_0xd183('0x2c')][_0xd183('0x33')](_0xd183('0x34'))){_0x28e56a[_0xd183('0x35')]=qs[_0xd183('0x35')](_0x5b60d6[_0xd183('0x2c')][_0xd183('0x35')]);_0x28e56a[_0xd183('0x18')]=qs[_0xd183('0x18')](_0x5b60d6[_0xd183('0x2c')]['offset']);}_0x28e56a[_0xd183('0x36')]=qs[_0xd183('0x37')](_0x5b60d6['query'][_0xd183('0x37')]);_0x28e56a[_0xd183('0x38')]=qs[_0xd183('0x2e')](_[_0xd183('0x39')](_0x5b60d6[_0xd183('0x2c')],_0x2763b7[_0xd183('0x2e')]),_0x5e0dc7);if(_0x5b60d6[_0xd183('0x2c')][_0xd183('0x3a')]){_0x28e56a[_0xd183('0x38')]=_[_0xd183('0x3b')](_0x28e56a['where'],{'$or':_[_0xd183('0x2b')](_0x5e0dc7,function(_0x16dd62){if(_0x16dd62[_0xd183('0x28')]!==_0xd183('0x3c')){var _0x2b6a62={};_0x2b6a62[_0x16dd62[_0xd183('0x23')]]={'$like':'%'+_0x5b60d6[_0xd183('0x2c')][_0xd183('0x3a')]+'%'};return _0x2b6a62;}})});}_0x28e56a=_['merge']({},_0x28e56a,_0x5b60d6[_0xd183('0x3d')]);var _0x469b17={'where':_0x28e56a['where']};return db[_0xd183('0x25')][_0xd183('0x3e')](_0x469b17)[_0xd183('0x1d')](function(_0x9ae3cf){_0x4c8532[_0xd183('0x3e')]=_0x9ae3cf;if(_0x5b60d6[_0xd183('0x2c')][_0xd183('0x3f')]){_0x28e56a[_0xd183('0x40')]=[{'all':!![]}];}return db[_0xd183('0x25')][_0xd183('0x41')](_0x28e56a);})[_0xd183('0x1d')](function(_0x147df0){_0x4c8532[_0xd183('0x42')]=_0x147df0;return _0x4c8532;})[_0xd183('0x1d')](respondWithFilteredResult(_0x520f3a,_0x28e56a))[_0xd183('0x43')](handleError(_0x520f3a,null));};exports[_0xd183('0x44')]=function(_0x3c21a4,_0x5ca5f1){var _0x59572a={'raw':![],'where':{'id':_0x3c21a4[_0xd183('0x45')]['id']}},_0x159671={};_0x159671[_0xd183('0x2a')]=_[_0xd183('0x2d')](db['ScreenRecording'][_0xd183('0x26')]);_0x159671['query']=_[_0xd183('0x2d')](_0x3c21a4['query']);_0x159671['filters']=_[_0xd183('0x2f')](_0x159671[_0xd183('0x2a')],_0x159671[_0xd183('0x2c')]);_0x59572a[_0xd183('0x30')]=_['intersection'](_0x159671[_0xd183('0x2a')],qs['fields'](_0x3c21a4['query'][_0xd183('0x31')]));_0x59572a[_0xd183('0x30')]=_0x59572a[_0xd183('0x30')]['length']?_0x59572a[_0xd183('0x30')]:_0x159671['model'];if(_0x3c21a4[_0xd183('0x2c')][_0xd183('0x3f')]){_0x59572a[_0xd183('0x40')]=[{'all':!![]}];}_0x59572a=_[_0xd183('0x3b')]({},_0x59572a,_0x3c21a4['options']);return db[_0xd183('0x25')][_0xd183('0x46')](_0x59572a)['then'](handleEntityNotFound(_0x5ca5f1,null))['then'](respondWithResult(_0x5ca5f1,null))['catch'](handleError(_0x5ca5f1,null));};exports[_0xd183('0x47')]=function(_0xd929af,_0x3cff13){return db[_0xd183('0x25')][_0xd183('0x47')](_0xd929af['body'],{})[_0xd183('0x1d')](respondWithResult(_0x3cff13,0xc9))[_0xd183('0x43')](handleError(_0x3cff13,null));};exports[_0xd183('0x1c')]=function(_0x331950,_0x5a7310){if(_0x331950['body']['id']){delete _0x331950['body']['id'];}delete _0x331950['body']['duration'];delete _0x331950['body']['createdAt'];delete _0x331950[_0xd183('0x48')][_0xd183('0x49')];delete _0x331950[_0xd183('0x48')][_0xd183('0x4a')];return db[_0xd183('0x25')]['find']({'where':{'id':_0x331950['params']['id']}})[_0xd183('0x1d')](handleEntityNotFound(_0x5a7310,null))['then'](saveUpdates(_0x331950[_0xd183('0x48')],null))[_0xd183('0x1d')](respondWithResult(_0x5a7310,null))[_0xd183('0x43')](handleError(_0x5a7310,null));};exports[_0xd183('0x4b')]=function(_0x5bdbae,_0x3bc734){return db[_0xd183('0x25')][_0xd183('0x4b')]()[_0xd183('0x1d')](respondWithResult(_0x3bc734,null))['catch'](handleError(_0x3bc734,null));};exports[_0xd183('0x4c')]=function(_0x459252,_0x202fb,_0x2e8714){var _0x3f2b7b=require(_0xd183('0x4d'));var _0x4be826=![];var _0x46db80={};if(_0x459252[_0xd183('0x2c')][_0xd183('0x28')]&&_0x459252[_0xd183('0x2c')][_0xd183('0x28')]===_0xd183('0x4e')){_0x46db80[_0xd183('0x4e')]=_0x459252[_0xd183('0x45')]['id'];}else{_0x46db80['id']=_0x459252['params']['id'];}return db['ScreenRecording'][_0xd183('0x46')]({'where':_0x46db80,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x202fb,null))[_0xd183('0x1d')](function(_0x12b300){if(_0x12b300){var _0x4f8a9f=path[_0xd183('0x4f')](config[_0xd183('0x50')],_0xd183('0x51'),_0x12b300[_0xd183('0x4a')]);var _0x52bdb8=util[_0xd183('0x52')]('%s.cypher',_0x4f8a9f);if(fs[_0xd183('0x53')](_0x52bdb8)){_0x4be826=!![];return _0x3f2b7b[_0xd183('0x54')](_0x52bdb8,_0x4f8a9f,config['secrets'][_0xd183('0x55')])[_0xd183('0x1d')](function(){return _0x12b300;});}return _0x12b300;}})[_0xd183('0x1d')](function(_0x50e46f){if(_0x50e46f){var _0xfb0b44=path[_0xd183('0x4f')](config[_0xd183('0x50')],'server/files/screen_recordings',_0x50e46f[_0xd183('0x4a')]);if(!fs[_0xd183('0x53')](_0xfb0b44)){throw new db[(_0xd183('0x56'))][(_0xd183('0x57'))](_0xd183('0x58'));}if(_0x50e46f[_0xd183('0x59')]){return _0x202fb['download'](_0xfb0b44,_0x50e46f['filename']+path[_0xd183('0x5a')](_0xfb0b44),function(){if(_0x4be826){fs[_0xd183('0x5b')](_0xfb0b44);}});}else{return _0x202fb[_0xd183('0x4c')](_0xfb0b44,function(_0x180a0f){if(_0x4be826){fs[_0xd183('0x5b')](_0xfb0b44);}});}}})[_0xd183('0x43')](function(_0x164642){if(_0x164642[_0xd183('0x5c')]===_0xd183('0x58')){_0x202fb['status'](0x194)[_0xd183('0x24')]('Not\x20found');}else{return handleError(_0x202fb,null);}});};exports[_0xd183('0x1e')]=function(_0x230ffc,_0x3fd878){return db[_0xd183('0x25')][_0xd183('0x46')]({'where':{'id':_0x230ffc['params']['id']}})[_0xd183('0x1d')](function(_0x43d58d){if(!_0x43d58d)throw new ReferenceError(_0xd183('0x5d'));return _0x43d58d;})[_0xd183('0x1d')](function(_0x3a1d9e){var _0x24149f=path[_0xd183('0x4f')](config[_0xd183('0x50')],'server/files/screen_recordings',_0x3a1d9e['value']);logger['info'](_0xd183('0x5e'),_0x24149f);if(!_[_0xd183('0x5f')](_0x3a1d9e[_0xd183('0x4a')])&&fs[_0xd183('0x53')](_0x24149f)){logger[_0xd183('0x60')](_0xd183('0x61')+_0x24149f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x24149f);}_0x24149f=_0x24149f+'.cypher';if(!_[_0xd183('0x5f')](_0x3a1d9e[_0xd183('0x4a')])&&fs['existsSync'](_0x24149f)){logger[_0xd183('0x60')]('File:\x20\x22'+_0x24149f+_0xd183('0x62'));fs[_0xd183('0x63')](_0x24149f);}return _0x3a1d9e;})[_0xd183('0x1d')](function(_0x3c4339){if(!_0x3c4339)throw new InternalError();return _0x3c4339['destroy']();})[_0xd183('0x1d')](function(){_0x3fd878[_0xd183('0x17')](0xcc)['end']();})[_0xd183('0x43')](handleError(_0x3fd878,null));};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js
index d853510..ce79c2f 100644
--- a/server/api/screenRecording/screenRecording.model.js
+++ b/server/api/screenRecording/screenRecording.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa977=['bluebird','request-promise','path','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api'];(function(_0x50f9e5,_0x4f90d6){var _0x548d6b=function(_0x5404c7){while(--_0x5404c7){_0x50f9e5['push'](_0x50f9e5['shift']());}};_0x548d6b(++_0x4f90d6);}(_0xa977,0x7e));var _0x7a97=function(_0x5a9981,_0xa5d339){_0x5a9981=_0x5a9981-0x0;var _0x4ae80d=_0xa977[_0x5a9981];return _0x4ae80d;};'use strict';var _=require(_0x7a97('0x0'));var util=require(_0x7a97('0x1'));var logger=require(_0x7a97('0x2'))(_0x7a97('0x3'));var moment=require('moment');var BPromise=require(_0x7a97('0x4'));var rp=require(_0x7a97('0x5'));var fs=require('fs');var path=require(_0x7a97('0x6'));var rimraf=require('rimraf');var config=require(_0x7a97('0x7'));var attributes=require('./screenRecording.attributes');module[_0x7a97('0x8')]=function(_0x5260c4,_0x391bfc){return _0x5260c4[_0x7a97('0x9')](_0x7a97('0xa'),attributes,{'tableName':_0x7a97('0xb'),'paranoid':![],'indexes':[{'name':_0x7a97('0xc'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x48a1=['path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x10affc,_0x3139a6){var _0x3cb505=function(_0x51aeaa){while(--_0x51aeaa){_0x10affc['push'](_0x10affc['shift']());}};_0x3cb505(++_0x3139a6);}(_0x48a1,0xf5));var _0x148a=function(_0x3f0f2e,_0xf2b92d){_0x3f0f2e=_0x3f0f2e-0x0;var _0x49fc6f=_0x48a1[_0x3f0f2e];return _0x49fc6f;};'use strict';var _=require(_0x148a('0x0'));var util=require(_0x148a('0x1'));var logger=require(_0x148a('0x2'))(_0x148a('0x3'));var moment=require(_0x148a('0x4'));var BPromise=require(_0x148a('0x5'));var rp=require(_0x148a('0x6'));var fs=require('fs');var path=require(_0x148a('0x7'));var rimraf=require(_0x148a('0x8'));var config=require(_0x148a('0x9'));var attributes=require(_0x148a('0xa'));module[_0x148a('0xb')]=function(_0x4f3872,_0x3503cc){return _0x4f3872[_0x148a('0xc')]('ScreenRecording',attributes,{'tableName':_0x148a('0xd'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js
index f7a0ece..31473d2 100644
--- a/server/api/screenRecording/screenRecording.rpc.js
+++ b/server/api/screenRecording/screenRecording.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1e42a3,_0x1558fe){var _0xa2e0c=function(_0x4d4ac3){while(--_0x4d4ac3){_0x1e42a3['push'](_0x1e42a3['shift']());}};_0xa2e0c(++_0x1558fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4467f4,_0x53993e){var _0x4b7d77=function(_0x20df48){while(--_0x20df48){_0x4467f4['push'](_0x4467f4['shift']());}};_0x4b7d77(++_0x53993e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/setting/index.js b/server/api/setting/index.js
index 6d16307..221e74d 100644
--- a/server/api/setting/index.js
+++ b/server/api/setting/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfe79=['isAuthenticated','index','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','extname','post','single','file','addLogo','%s%s','logologin','originalname','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get'];(function(_0x3c5ad6,_0x47b7bf){var _0x3154f2=function(_0x3a24de){while(--_0x3a24de){_0x3c5ad6['push'](_0x3c5ad6['shift']());}};_0x3154f2(++_0x47b7bf);}(_0xfe79,0x72));var _0x9fe7=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0xfe79[_0x1af5b2];return _0xf1aa2d;};'use strict';var multer=require('multer');var util=require(_0x9fe7('0x0'));var path=require(_0x9fe7('0x1'));var timeout=require(_0x9fe7('0x2'));var express=require(_0x9fe7('0x3'));var router=express[_0x9fe7('0x4')]();var auth=require(_0x9fe7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9fe7('0x6'));var controller=require(_0x9fe7('0x7'));router[_0x9fe7('0x8')]('/',auth[_0x9fe7('0x9')](),controller[_0x9fe7('0xa')]);router[_0x9fe7('0x8')](_0x9fe7('0xb'),controller[_0x9fe7('0xc')]);router[_0x9fe7('0x8')](_0x9fe7('0xd'),controller[_0x9fe7('0xe')]);router[_0x9fe7('0x8')]('/:id/logo_login',controller[_0x9fe7('0xf')]);router[_0x9fe7('0x8')](_0x9fe7('0x10'),controller[_0x9fe7('0x11')]);router[_0x9fe7('0x8')]('/:id/preferred',controller['getPreferred']);router['get'](_0x9fe7('0x12'),controller[_0x9fe7('0x13')]);var upload=multer({'storage':multer[_0x9fe7('0x14')]({'destination':function(_0x5c5499,_0x27ced5,_0x2599fc){_0x2599fc(null,path[_0x9fe7('0x15')](config[_0x9fe7('0x16')],_0x9fe7('0x17')));},'filename':function(_0xbeac1,_0x5b2db5,_0x48e9a3){_0x48e9a3(null,util[_0x9fe7('0x18')]('%s%s',_0x9fe7('0x19'),path[_0x9fe7('0x1a')](_0x5b2db5['originalname'])));}})});router[_0x9fe7('0x1b')](_0x9fe7('0xd'),upload[_0x9fe7('0x1c')](_0x9fe7('0x1d')),controller[_0x9fe7('0x1e')]);var upload=multer({'storage':multer[_0x9fe7('0x14')]({'destination':function(_0x5df83f,_0x1a6b15,_0x245bbf){_0x245bbf(null,path[_0x9fe7('0x15')](config[_0x9fe7('0x16')],_0x9fe7('0x17')));},'filename':function(_0x340a2d,_0x311bac,_0x4dbe8c){_0x4dbe8c(null,util[_0x9fe7('0x18')](_0x9fe7('0x1f'),_0x9fe7('0x20'),path['extname'](_0x311bac[_0x9fe7('0x21')])));}})});router[_0x9fe7('0x1b')]('/:id/logo_login',upload[_0x9fe7('0x1c')](_0x9fe7('0x1d')),controller[_0x9fe7('0x22')]);var upload=multer({'storage':multer[_0x9fe7('0x14')]({'destination':function(_0x622bf4,_0x140cc5,_0x3e4e81){_0x3e4e81(null,path[_0x9fe7('0x15')](config[_0x9fe7('0x16')],_0x9fe7('0x17')));},'filename':function(_0x238d8d,_0x278370,_0x12c2c2){_0x12c2c2(null,util[_0x9fe7('0x18')](_0x9fe7('0x1f'),_0x9fe7('0x23'),path[_0x9fe7('0x1a')](_0x278370[_0x9fe7('0x21')])));}})});router[_0x9fe7('0x1b')](_0x9fe7('0x24'),upload[_0x9fe7('0x1c')](_0x9fe7('0x1d')),controller[_0x9fe7('0x25')]);var upload=multer({'storage':multer[_0x9fe7('0x14')]({'destination':function(_0x157eb6,_0x3add02,_0x58a830){_0x58a830(null,path[_0x9fe7('0x15')](config['root'],_0x9fe7('0x17')));},'filename':function(_0x508a56,_0x399c45,_0xcc0a4a){_0xcc0a4a(null,util[_0x9fe7('0x18')](_0x9fe7('0x1f'),_0x9fe7('0x26'),path[_0x9fe7('0x1a')](_0x399c45[_0x9fe7('0x21')])));}})});router[_0x9fe7('0x1b')](_0x9fe7('0x12'),upload[_0x9fe7('0x1c')]('file'),controller[_0x9fe7('0x27')]);router[_0x9fe7('0x28')](_0x9fe7('0xb'),auth[_0x9fe7('0x9')](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0x752a=['/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','addLogo','logologin','post','addLogoLogin','addPreferred','favicon','addFavicon','put','update','exports','util','connect-timeout','express','Router','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show'];(function(_0x150195,_0x1f8c94){var _0x2b449a=function(_0x28a00a){while(--_0x28a00a){_0x150195['push'](_0x150195['shift']());}};_0x2b449a(++_0x1f8c94);}(_0x752a,0x1ad));var _0xa752=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x752a[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require(_0xa752('0x0'));var path=require('path');var timeout=require(_0xa752('0x1'));var express=require(_0xa752('0x2'));var router=express[_0xa752('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa752('0x4'));var controller=require(_0xa752('0x5'));router[_0xa752('0x6')]('/',auth[_0xa752('0x7')](),controller[_0xa752('0x8')]);router[_0xa752('0x6')](_0xa752('0x9'),controller[_0xa752('0xa')]);router[_0xa752('0x6')](_0xa752('0xb'),controller['getLogo']);router[_0xa752('0x6')](_0xa752('0xc'),controller[_0xa752('0xd')]);router[_0xa752('0x6')](_0xa752('0xe'),controller[_0xa752('0xf')]);router['get'](_0xa752('0x10'),controller['getPreferred']);router[_0xa752('0x6')](_0xa752('0x11'),controller[_0xa752('0x12')]);var upload=multer({'storage':multer[_0xa752('0x13')]({'destination':function(_0x4719ef,_0x49bd28,_0x5e3e8b){_0x5e3e8b(null,path[_0xa752('0x14')](config[_0xa752('0x15')],_0xa752('0x16')));},'filename':function(_0xf3c004,_0x40ae41,_0x303085){_0x303085(null,util[_0xa752('0x17')](_0xa752('0x18'),_0xa752('0x19'),path[_0xa752('0x1a')](_0x40ae41[_0xa752('0x1b')])));}})});router['post']('/:id/logo',upload[_0xa752('0x1c')](_0xa752('0x1d')),controller[_0xa752('0x1e')]);var upload=multer({'storage':multer[_0xa752('0x13')]({'destination':function(_0x9bb5bb,_0x1ea727,_0x36c17c){_0x36c17c(null,path[_0xa752('0x14')](config[_0xa752('0x15')],'server/files/images/logos/'));},'filename':function(_0x20434f,_0x432660,_0x5d0420){_0x5d0420(null,util[_0xa752('0x17')](_0xa752('0x18'),_0xa752('0x1f'),path[_0xa752('0x1a')](_0x432660[_0xa752('0x1b')])));}})});router[_0xa752('0x20')](_0xa752('0xc'),upload[_0xa752('0x1c')]('file'),controller[_0xa752('0x21')]);var upload=multer({'storage':multer[_0xa752('0x13')]({'destination':function(_0x590fe1,_0x583795,_0x128ca4){_0x128ca4(null,path['join'](config['root'],_0xa752('0x16')));},'filename':function(_0x5e1f0a,_0x1dbe5d,_0x1f19d5){_0x1f19d5(null,util[_0xa752('0x17')](_0xa752('0x18'),'preferred',path[_0xa752('0x1a')](_0x1dbe5d[_0xa752('0x1b')])));}})});router[_0xa752('0x20')](_0xa752('0x10'),upload['single']('file'),controller[_0xa752('0x22')]);var upload=multer({'storage':multer[_0xa752('0x13')]({'destination':function(_0x118f7d,_0x41b7f6,_0x1b4863){_0x1b4863(null,path[_0xa752('0x14')](config[_0xa752('0x15')],_0xa752('0x16')));},'filename':function(_0x2a29c8,_0x4ee1e8,_0x164f4c){_0x164f4c(null,util['format'](_0xa752('0x18'),_0xa752('0x23'),path[_0xa752('0x1a')](_0x4ee1e8[_0xa752('0x1b')])));}})});router[_0xa752('0x20')](_0xa752('0x11'),upload[_0xa752('0x1c')]('file'),controller[_0xa752('0x24')]);router[_0xa752('0x25')]('/:id',auth[_0xa752('0x7')](),controller[_0xa752('0x26')]);module[_0xa752('0x27')]=router;
\ No newline at end of file
diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js
index a178ab3..2ec5ac0 100644
--- a/server/api/setting/setting.attributes.js
+++ b/server/api/setting/setting.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6818=['STRING','BOOLEAN','alternate','exports','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted'];(function(_0x1fda3c,_0xefd4cb){var _0x1a2d1e=function(_0x31a6c3){while(--_0x31a6c3){_0x1fda3c['push'](_0x1fda3c['shift']());}};_0x1a2d1e(++_0xefd4cb);}(_0x6818,0x9b));var _0x8681=function(_0x5af886,_0xec826d){_0x5af886=_0x5af886-0x0;var _0x4ff2f9=_0x6818[_0x5af886];return _0x4ff2f9;};'use strict';var Sequelize=require('sequelize');module[_0x8681('0x0')]={'min_internal':{'type':Sequelize[_0x8681('0x1')](0xb),'unique':_0x8681('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x8681('0x1')](0xb),'unique':_0x8681('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8681('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x8681('0x4')},'logo':{'type':Sequelize[_0x8681('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8681('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x8681('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8681('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8681('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8681('0x5')]},'turnaddr':{'type':Sequelize[_0x8681('0x5')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8681('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x8681('0x5')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x8681('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x8681('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8681('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8681('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x8681('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x8681('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8681('0x5')]},'defaultPreferred':{'type':Sequelize[_0x8681('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8681('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x8681('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8681('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x8681('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8681('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8681('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x8681('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8681('0x1')]},'transcribeRegion':{'type':Sequelize[_0x8681('0x5')]},'sentiment':{'type':Sequelize[_0x8681('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8681('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8681('0x1')]},'sentimentRegion':{'type':Sequelize[_0x8681('0x5')]},'language':{'type':Sequelize[_0x8681('0x5')]},'bucket':{'type':Sequelize[_0x8681('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x8681('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2c55=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','sequelize','exports','INTEGER','min_mailbox','STRING'];(function(_0xa5fd3c,_0x44ce96){var _0x545edc=function(_0x5b9399){while(--_0x5b9399){_0xa5fd3c['push'](_0xa5fd3c['shift']());}};_0x545edc(++_0x44ce96);}(_0x2c55,0xd4));var _0x52c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c55[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x52c5('0x0'));module[_0x52c5('0x1')]={'min_internal':{'type':Sequelize[_0x52c5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x52c5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x52c5('0x4')],'defaultValue':_0x52c5('0x5')},'logo':{'type':Sequelize[_0x52c5('0x4')]},'defaultLogo':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x52c5('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x52c5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x52c5('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x52c5('0x4')]},'turnpassword':{'type':Sequelize[_0x52c5('0x4')]},'pageTitle':{'type':Sequelize[_0x52c5('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x52c5('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x52c5('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x52c5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x52c5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x52c5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x52c5('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x52c5('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x52c5('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x52c5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x52c5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x52c5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x52c5('0x4')]},'defaultFavicon':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x52c5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x52c5('0x4')]},'sentiment':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x52c5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x52c5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x52c5('0x6')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js
index 66375a3..8e08086 100644
--- a/server/api/setting/setting.controller.js
+++ b/server/api/setting/setting.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x11af=['download','../../config/license/util','getLogoLogin','server/files/images/logos','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','sendStatus','stack','name','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','body','addLogo','file','filename','logo','addLogoLogin','getLogo','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','\x20not\x20found'];(function(_0xdd2d2d,_0x3326cd){var _0x37953e=function(_0x2c55ff){while(--_0x2c55ff){_0xdd2d2d['push'](_0xdd2d2d['shift']());}};_0x37953e(++_0x3326cd);}(_0x11af,0x82));var _0xf11a=function(_0x132da1,_0x3119ec){_0x132da1=_0x132da1-0x0;var _0x4d5c27=_0x11af[_0x132da1];return _0x4d5c27;};'use strict';var pdf=require(_0xf11a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf11a('0x1'));var zipdir=require(_0xf11a('0x2'));var jsonpatch=require(_0xf11a('0x3'));var rp=require(_0xf11a('0x4'));var moment=require(_0xf11a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf11a('0x6'));var util=require(_0xf11a('0x7'));var path=require(_0xf11a('0x8'));var sox=require('sox');var csv=require(_0xf11a('0x9'));var ejs=require(_0xf11a('0xa'));var fs=require('fs');var _=require(_0xf11a('0xb'));var squel=require(_0xf11a('0xc'));var crypto=require(_0xf11a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf11a('0xe'));var Redis=require(_0xf11a('0xf'));var authService=require(_0xf11a('0x10'));var qs=require(_0xf11a('0x11'));var as=require(_0xf11a('0x12'));var hardwareService=require(_0xf11a('0x13'));var logger=require('../../config/logger')(_0xf11a('0x14'));var utils=require(_0xf11a('0x15'));var config=require(_0xf11a('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf11a('0x17'));var client=jayson[_0xf11a('0x18')][_0xf11a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4644e8,_0x413778,_0x336292){if(_0x336292){var _0x29229f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29229f[_0xf11a('0x1a')](_0x413778)){return _0x4644e8;}else{throw new db[(_0xf11a('0x1b'))][(_0xf11a('0x1c'))](_0xf11a('0x1d'));}}else{return _0x4644e8;}}function respondWithRpcPromise(_0xccf9cf,_0x3b1554,_0x16a7d7,_0x1a11e7){return new BPromise(function(_0x460c46,_0x2537d3){var _0x1e0f91=_0x1a11e7||client;return _0x1e0f91['request'](_0xccf9cf,_0x16a7d7)[_0xf11a('0x1e')](function(_0x236ab4){logger['info'](_0xf11a('0x1f'),_0x3b1554,_0xf11a('0x20'));logger[_0xf11a('0x21')](_0xf11a('0x22'),_0x3b1554,_0xf11a('0x20'),JSON['stringify'](_0x236ab4));if(_0x236ab4['error']){if(_0x236ab4['error']['code']===0x1f4){logger['error'](_0xf11a('0x1f'),_0x3b1554,_0x236ab4[_0xf11a('0x23')][_0xf11a('0x24')]);return _0x2537d3(_0x236ab4[_0xf11a('0x23')][_0xf11a('0x24')]);}logger['error'](_0xf11a('0x1f'),_0x3b1554,_0x236ab4[_0xf11a('0x23')][_0xf11a('0x24')]);return _0x460c46(_0x236ab4[_0xf11a('0x23')][_0xf11a('0x24')]);}else{logger[_0xf11a('0x25')]('Setting,\x20%s,\x20%s',_0x3b1554,_0xf11a('0x20'));_0x460c46(_0x236ab4[_0xf11a('0x26')][_0xf11a('0x24')]);}})[_0xf11a('0x27')](function(_0x2251a6){logger['error']('Setting,\x20%s,\x20%s',_0x3b1554,_0x2251a6);_0x2537d3(_0x2251a6);});});}function respondWithStatusCode(_0x4dd82a,_0x57947b){_0x57947b=_0x57947b||0xcc;return function(_0x52c7e5){if(_0x52c7e5){return _0x4dd82a['sendStatus'](_0x57947b);}return _0x4dd82a[_0xf11a('0x28')](_0x57947b)[_0xf11a('0x29')]();};}function respondWithResult(_0x2791a1,_0x3e81b3){_0x3e81b3=_0x3e81b3||0xc8;return function(_0x41609f){if(_0x41609f){return _0x2791a1[_0xf11a('0x28')](_0x3e81b3)[_0xf11a('0x2a')](_0x41609f);}};}function respondWithFilteredResult(_0x289b68,_0x3de340){return function(_0x4ae7e6){if(_0x4ae7e6){var _0x448556=_0x4ae7e6[_0xf11a('0x2b')],_0x3e5454=_0x3de340[_0xf11a('0x2c')],_0x367d26=_0x3de340['offset']+_0x3de340[_0xf11a('0x2d')],_0x1a0e40;if(_0x367d26>=_0x448556){_0x367d26=_0x448556;_0x1a0e40=0xc8;}else{_0x1a0e40=0xce;}_0x289b68[_0xf11a('0x28')](_0x1a0e40);return _0x289b68['set'](_0xf11a('0x2e'),_0x3e5454+'-'+_0x367d26+'/'+_0x448556)[_0xf11a('0x2a')](_0x4ae7e6);}return null;};}function patchUpdates(_0x266167){return function(_0x206f71){try{jsonpatch[_0xf11a('0x2f')](_0x206f71,_0x266167,!![]);}catch(_0x54b640){return BPromise[_0xf11a('0x30')](_0x54b640);}return _0x206f71[_0xf11a('0x31')]();};}function saveUpdates(_0x23b804,_0x3fdc8c){return function(_0x157648){if(_0x157648){return _0x157648[_0xf11a('0x32')](_0x23b804)[_0xf11a('0x1e')](function(_0x2a1129){return _0x2a1129;});}return null;};}function removeEntity(_0x3dffbf,_0xe2a050){return function(_0x525ba9){if(_0x525ba9){return _0x525ba9['destroy']()[_0xf11a('0x1e')](function(){_0x3dffbf[_0xf11a('0x28')](0xcc)[_0xf11a('0x29')]();});}};}function handleEntityNotFound(_0x2f865c,_0x234446){return function(_0x1e4a36){if(!_0x1e4a36){_0x2f865c[_0xf11a('0x33')](0x194);}return _0x1e4a36;};}function handleError(_0x474c5e,_0x5b077c){_0x5b077c=_0x5b077c||0x1f4;return function(_0x50e448){logger['error'](_0x50e448[_0xf11a('0x34')]);if(_0x50e448[_0xf11a('0x35')]){delete _0x50e448[_0xf11a('0x35')];}_0x474c5e['status'](_0x5b077c)['send'](_0x50e448);};}exports['index']=function(_0x316a7a,_0x56bc35){var _0x6aab5b={},_0x4fa0b4={},_0x8c15e5={'count':0x0,'rows':[]};var _0x3e4478=_[_0xf11a('0x36')](db[_0xf11a('0x37')][_0xf11a('0x38')],function(_0x2447bd){return{'name':_0x2447bd[_0xf11a('0x39')],'type':_0x2447bd[_0xf11a('0x3a')][_0xf11a('0x3b')]};});_0x4fa0b4[_0xf11a('0x3c')]=_[_0xf11a('0x36')](_0x3e4478,_0xf11a('0x35'));_0x4fa0b4[_0xf11a('0x3d')]=_['keys'](_0x316a7a[_0xf11a('0x3d')]);_0x4fa0b4[_0xf11a('0x3e')]=_[_0xf11a('0x3f')](_0x4fa0b4[_0xf11a('0x3c')],_0x4fa0b4['query']);_0x6aab5b[_0xf11a('0x40')]=_['intersection'](_0x4fa0b4['model'],qs['fields'](_0x316a7a[_0xf11a('0x3d')][_0xf11a('0x41')]));_0x6aab5b['attributes']=_0x6aab5b[_0xf11a('0x40')][_0xf11a('0x42')]?_0x6aab5b['attributes']:_0x4fa0b4[_0xf11a('0x3c')];if(!_0x316a7a['query']['hasOwnProperty'](_0xf11a('0x43'))){_0x6aab5b[_0xf11a('0x2d')]=qs[_0xf11a('0x2d')](_0x316a7a[_0xf11a('0x3d')]['limit']);_0x6aab5b[_0xf11a('0x2c')]=qs[_0xf11a('0x2c')](_0x316a7a[_0xf11a('0x3d')][_0xf11a('0x2c')]);}_0x6aab5b['order']=qs[_0xf11a('0x44')](_0x316a7a['query'][_0xf11a('0x44')]);_0x6aab5b[_0xf11a('0x45')]=qs[_0xf11a('0x3e')](_[_0xf11a('0x46')](_0x316a7a['query'],_0x4fa0b4['filters']),_0x3e4478);if(_0x316a7a[_0xf11a('0x3d')][_0xf11a('0x47')]){_0x6aab5b['where']=_[_0xf11a('0x48')](_0x6aab5b[_0xf11a('0x45')],{'$or':_['map'](_0x3e4478,function(_0x531217){if(_0x531217[_0xf11a('0x3a')]!==_0xf11a('0x49')){var _0xd80023={};_0xd80023[_0x531217[_0xf11a('0x35')]]={'$like':'%'+_0x316a7a['query'][_0xf11a('0x47')]+'%'};return _0xd80023;}})});}_0x6aab5b=_[_0xf11a('0x48')]({},_0x6aab5b,_0x316a7a[_0xf11a('0x4a')]);var _0x205a4f={'where':_0x6aab5b[_0xf11a('0x45')]};return db[_0xf11a('0x37')][_0xf11a('0x2b')](_0x205a4f)['then'](function(_0x455581){_0x8c15e5[_0xf11a('0x2b')]=_0x455581;if(_0x316a7a['query'][_0xf11a('0x4b')]){_0x6aab5b[_0xf11a('0x4c')]=[{'all':!![]}];}return db[_0xf11a('0x37')][_0xf11a('0x4d')](_0x6aab5b);})[_0xf11a('0x1e')](function(_0x3a02de){_0x8c15e5[_0xf11a('0x4e')]=_0x3a02de;return _0x8c15e5;})['then'](respondWithFilteredResult(_0x56bc35,_0x6aab5b))[_0xf11a('0x27')](handleError(_0x56bc35,null));};exports['show']=function(_0x1f34f8,_0x5a4498){var _0x3171eb={'raw':![],'where':{'id':_0x1f34f8[_0xf11a('0x4f')]['id']}},_0x318d9d={};_0x318d9d[_0xf11a('0x3c')]=_['keys'](db[_0xf11a('0x37')][_0xf11a('0x38')]);_0x318d9d[_0xf11a('0x3d')]=_[_0xf11a('0x50')](_0x1f34f8[_0xf11a('0x3d')]);_0x318d9d[_0xf11a('0x3e')]=_[_0xf11a('0x3f')](_0x318d9d[_0xf11a('0x3c')],_0x318d9d[_0xf11a('0x3d')]);_0x3171eb[_0xf11a('0x40')]=_['intersection'](_0x318d9d[_0xf11a('0x3c')],qs[_0xf11a('0x41')](_0x1f34f8[_0xf11a('0x3d')][_0xf11a('0x41')]));_0x3171eb['attributes']=_0x3171eb[_0xf11a('0x40')][_0xf11a('0x42')]?_0x3171eb[_0xf11a('0x40')]:_0x318d9d[_0xf11a('0x3c')];if(_0x1f34f8[_0xf11a('0x3d')][_0xf11a('0x4b')]){_0x3171eb['include']=[{'all':!![]}];}_0x3171eb=_[_0xf11a('0x48')]({},_0x3171eb,_0x1f34f8[_0xf11a('0x4a')]);return db[_0xf11a('0x37')][_0xf11a('0x51')](_0x3171eb)[_0xf11a('0x1e')](handleEntityNotFound(_0x5a4498,null))[_0xf11a('0x1e')](respondWithResult(_0x5a4498,null))[_0xf11a('0x27')](handleError(_0x5a4498,null));};exports[_0xf11a('0x32')]=function(_0x492d00,_0x16b275){if(_0x492d00[_0xf11a('0x52')]['id']){delete _0x492d00[_0xf11a('0x52')]['id'];}return db[_0xf11a('0x37')][_0xf11a('0x51')]({'where':{'id':_0x492d00[_0xf11a('0x4f')]['id']}})[_0xf11a('0x1e')](handleEntityNotFound(_0x16b275,null))[_0xf11a('0x1e')](saveUpdates(_0x492d00[_0xf11a('0x52')],null))[_0xf11a('0x1e')](respondWithResult(_0x16b275,null))[_0xf11a('0x27')](handleError(_0x16b275,null));};exports[_0xf11a('0x53')]=function(_0x34f320,_0x39dce3,_0x1f8306){if(_0x34f320[_0xf11a('0x54')]&&_0x34f320[_0xf11a('0x54')][_0xf11a('0x55')]){_0x34f320[_0xf11a('0x52')][_0xf11a('0x56')]=_0x34f320[_0xf11a('0x54')]['filename'];}return db['Setting']['find']({'where':{'id':_0x34f320[_0xf11a('0x4f')]['id']}})[_0xf11a('0x1e')](handleEntityNotFound(_0x39dce3,null))[_0xf11a('0x1e')](saveUpdates(_0x34f320[_0xf11a('0x52')],null))[_0xf11a('0x1e')](respondWithResult(_0x39dce3,null))[_0xf11a('0x27')](handleError(_0x39dce3,null));};exports[_0xf11a('0x57')]=function(_0x3af1fe,_0x4690f8,_0x2c4a8f){if(_0x3af1fe['file']&&_0x3af1fe[_0xf11a('0x54')][_0xf11a('0x55')]){_0x3af1fe[_0xf11a('0x52')]['loginLogo']=_0x3af1fe['file'][_0xf11a('0x55')];}return db[_0xf11a('0x37')][_0xf11a('0x51')]({'where':{'id':_0x3af1fe[_0xf11a('0x4f')]['id']}})[_0xf11a('0x1e')](handleEntityNotFound(_0x4690f8,null))[_0xf11a('0x1e')](saveUpdates(_0x3af1fe[_0xf11a('0x52')],null))['then'](respondWithResult(_0x4690f8,null))[_0xf11a('0x27')](handleError(_0x4690f8,null));};var utilLicense=require('../../config/license/util');exports[_0xf11a('0x58')]=function(_0xc2995b,_0x2df2ea,_0x4f69ac){var _0x2c5f56='server/files/images/logos';var _0x25fd04={'custom':![]};return utilLicense[_0xf11a('0x59')]()['then'](function(_0x1f6054){if(_0x1f6054){_0x25fd04=_0x1f6054;}return db[_0xf11a('0x37')][_0xf11a('0x51')]({'where':{'id':_0xc2995b[_0xf11a('0x4f')]['id']},'attributes':[_0xf11a('0x56'),_0xf11a('0x5a'),_0xf11a('0x5b'),_0xf11a('0x5c'),_0xf11a('0x5d'),'defaultLoginLogo','defaultPreferred',_0xf11a('0x5e')],'raw':!![]});})[_0xf11a('0x1e')](handleEntityNotFound(_0x2df2ea,null))[_0xf11a('0x1e')](function(_0x534df7){if(_0x534df7){var _0x1c2961=_0x534df7[_0xf11a('0x56')]&&fs[_0xf11a('0x5f')](path[_0xf11a('0x60')](config[_0xf11a('0x61')],_0x2c5f56,_[_0xf11a('0x62')](_0x534df7[_0xf11a('0x56')])))?path[_0xf11a('0x60')](config[_0xf11a('0x61')],_0x2c5f56,_[_0xf11a('0x62')](_0x534df7[_0xf11a('0x56')])):path[_0xf11a('0x60')](config['root'],_0x2c5f56,_[_0xf11a('0x62')]('default_logo.svg'));var _0x16e4e3=_0xf11a('0x63')+_[_0xf11a('0x64')](_0xf11a('0x56'));if(_0x534df7[_0x16e4e3]||!_0x25fd04[_0xf11a('0x65')]){_0x1c2961=path['join'](config[_0xf11a('0x61')],_0x2c5f56,_[_0xf11a('0x62')](_0xf11a('0x66')));}if(!fs[_0xf11a('0x5f')](_0x1c2961)){throw new db[(_0xf11a('0x1b'))][(_0xf11a('0x1c'))](_[_0xf11a('0x64')]('logo')+_0xf11a('0x67'));}return _0x2df2ea[_0xf11a('0x68')](_0x1c2961);}})[_0xf11a('0x27')](handleError(_0x2df2ea,null));};var utilLicense=require(_0xf11a('0x69'));exports[_0xf11a('0x6a')]=function(_0x5e3def,_0x29eb62,_0x1bfa2e){var _0x463c39=_0xf11a('0x6b');var _0x24cce5={'custom':![]};return utilLicense[_0xf11a('0x59')]()[_0xf11a('0x1e')](function(_0x5c1a1e){if(_0x5c1a1e){_0x24cce5=_0x5c1a1e;}return db[_0xf11a('0x37')][_0xf11a('0x51')]({'where':{'id':_0x5e3def[_0xf11a('0x4f')]['id']},'attributes':['logo','loginLogo',_0xf11a('0x5b'),'favicon','defaultLogo',_0xf11a('0x6c'),_0xf11a('0x6d'),_0xf11a('0x5e')],'raw':!![]});})[_0xf11a('0x1e')](handleEntityNotFound(_0x29eb62,null))['then'](function(_0x441fc8){if(_0x441fc8){var _0x7ecd64=_0x441fc8[_0xf11a('0x5a')]&&fs['existsSync'](path['join'](config[_0xf11a('0x61')],_0x463c39,_[_0xf11a('0x62')](_0x441fc8[_0xf11a('0x5a')])))?path[_0xf11a('0x60')](config[_0xf11a('0x61')],_0x463c39,_[_0xf11a('0x62')](_0x441fc8[_0xf11a('0x5a')])):path[_0xf11a('0x60')](config['root'],_0x463c39,_[_0xf11a('0x62')](_0xf11a('0x6e')));var _0x464142=_0xf11a('0x63')+_[_0xf11a('0x64')](_0xf11a('0x5a'));if(_0x441fc8[_0x464142]||!_0x24cce5[_0xf11a('0x65')]){_0x7ecd64=path['join'](config[_0xf11a('0x61')],_0x463c39,_[_0xf11a('0x62')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x7ecd64)){throw new db['Sequelize'][(_0xf11a('0x1c'))](_[_0xf11a('0x64')](_0xf11a('0x5a'))+'\x20not\x20found');}return _0x29eb62[_0xf11a('0x68')](_0x7ecd64);}})['catch'](handleError(_0x29eb62,null));};exports['gdpr']=function(_0x494915,_0x457e10){return db[_0xf11a('0x37')][_0xf11a('0x51')]({'where':{'id':_0x494915[_0xf11a('0x4f')]['id']},'attributes':[_0xf11a('0x6f')]})['then'](respondWithResult(_0x457e10,null))['catch'](handleError(_0x457e10,null));};exports[_0xf11a('0x70')]=function(_0x128bb,_0x132143,_0x4bf2a3){if(_0x128bb[_0xf11a('0x54')]&&_0x128bb[_0xf11a('0x54')][_0xf11a('0x55')]){_0x128bb['body']['preferred']=_0x128bb['file'][_0xf11a('0x55')];}return db[_0xf11a('0x37')]['find']({'where':{'id':_0x128bb[_0xf11a('0x4f')]['id']}})[_0xf11a('0x1e')](handleEntityNotFound(_0x132143,null))[_0xf11a('0x1e')](saveUpdates(_0x128bb['body'],null))['then'](respondWithResult(_0x132143,null))[_0xf11a('0x27')](handleError(_0x132143,null));};var utilLicense=require(_0xf11a('0x69'));exports[_0xf11a('0x71')]=function(_0x2da230,_0x268771,_0x39e7d0){var _0x1bb375=_0xf11a('0x6b');var _0x518841={'custom':![]};return utilLicense['getLicense']()[_0xf11a('0x1e')](function(_0x3d1d40){if(_0x3d1d40){_0x518841=_0x3d1d40;}return db[_0xf11a('0x37')][_0xf11a('0x51')]({'where':{'id':_0x2da230[_0xf11a('0x4f')]['id']},'attributes':['logo',_0xf11a('0x5a'),_0xf11a('0x5b'),_0xf11a('0x5c'),_0xf11a('0x5d'),_0xf11a('0x6c'),'defaultPreferred',_0xf11a('0x5e')],'raw':!![]});})[_0xf11a('0x1e')](handleEntityNotFound(_0x268771,null))['then'](function(_0x4ed068){if(_0x4ed068){var _0x615e95=_0x4ed068[_0xf11a('0x5b')]&&fs['existsSync'](path[_0xf11a('0x60')](config[_0xf11a('0x61')],_0x1bb375,_[_0xf11a('0x62')](_0x4ed068[_0xf11a('0x5b')])))?path[_0xf11a('0x60')](config[_0xf11a('0x61')],_0x1bb375,_[_0xf11a('0x62')](_0x4ed068[_0xf11a('0x5b')])):path['join'](config[_0xf11a('0x61')],_0x1bb375,_['toLower'](_0xf11a('0x72')));var _0x5c52f5=_0xf11a('0x63')+_[_0xf11a('0x64')](_0xf11a('0x5b'));if(_0x4ed068[_0x5c52f5]||!_0x518841[_0xf11a('0x65')]||!_0x518841[_0xf11a('0x5b')]){_0x615e95=path[_0xf11a('0x60')](config[_0xf11a('0x61')],_0x1bb375,_[_0xf11a('0x62')](_0xf11a('0x72')));}if(!fs[_0xf11a('0x5f')](_0x615e95)){throw new db[(_0xf11a('0x1b'))][(_0xf11a('0x1c'))](_[_0xf11a('0x64')](_0xf11a('0x5b'))+_0xf11a('0x67'));}return _0x268771[_0xf11a('0x68')](_0x615e95);}})['catch'](handleError(_0x268771,null));};exports[_0xf11a('0x73')]=function(_0x472438,_0x3fb78a,_0x51845d){if(_0x472438[_0xf11a('0x54')]&&_0x472438[_0xf11a('0x54')][_0xf11a('0x55')]){_0x472438['body'][_0xf11a('0x5c')]=_0x472438[_0xf11a('0x54')][_0xf11a('0x55')];}return db[_0xf11a('0x37')]['find']({'where':{'id':_0x472438[_0xf11a('0x4f')]['id']}})[_0xf11a('0x1e')](handleEntityNotFound(_0x3fb78a,null))['then'](saveUpdates(_0x472438[_0xf11a('0x52')],null))[_0xf11a('0x1e')](respondWithResult(_0x3fb78a,null))[_0xf11a('0x27')](handleError(_0x3fb78a,null));};var utilLicense=require(_0xf11a('0x69'));exports['getFavicon']=function(_0x13be32,_0x3874bc,_0x2b6a9c){var _0x204e5c=_0xf11a('0x6b');var _0x4c7639={'custom':![]};return utilLicense[_0xf11a('0x59')]()[_0xf11a('0x1e')](function(_0x22fbfd){if(_0x22fbfd){_0x4c7639=_0x22fbfd;}return db[_0xf11a('0x37')][_0xf11a('0x51')]({'where':{'id':_0x13be32[_0xf11a('0x4f')]['id']},'attributes':[_0xf11a('0x56'),_0xf11a('0x5a'),_0xf11a('0x5b'),_0xf11a('0x5c'),_0xf11a('0x5d'),_0xf11a('0x6c'),_0xf11a('0x6d'),'defaultFavicon'],'raw':!![]});})[_0xf11a('0x1e')](handleEntityNotFound(_0x3874bc,null))[_0xf11a('0x1e')](function(_0x5af029){if(_0x5af029){var _0x469e33=_0x5af029['favicon']&&fs[_0xf11a('0x5f')](path[_0xf11a('0x60')](config[_0xf11a('0x61')],_0x204e5c,_[_0xf11a('0x62')](_0x5af029['favicon'])))?path[_0xf11a('0x60')](config[_0xf11a('0x61')],_0x204e5c,_['toLower'](_0x5af029[_0xf11a('0x5c')])):path[_0xf11a('0x60')](config[_0xf11a('0x61')],_0x204e5c,_[_0xf11a('0x62')](_0xf11a('0x74')));var _0x11ccfd='default'+_[_0xf11a('0x64')](_0xf11a('0x5c'));if(_0x5af029[_0x11ccfd]||!_0x4c7639[_0xf11a('0x65')]){_0x469e33=path['join'](config['root'],_0x204e5c,_[_0xf11a('0x62')]('default_favicon.ico'));}if(!fs[_0xf11a('0x5f')](_0x469e33)){throw new db['Sequelize']['ValidationError'](_[_0xf11a('0x64')](_0xf11a('0x5c'))+'\x20not\x20found');}return _0x3874bc[_0xf11a('0x68')](_0x469e33);}})[_0xf11a('0x27')](handleError(_0x3874bc,null));};
\ No newline at end of file
+var _0x16aa=['limit','order','where','pick','filter','merge','options','include','findAll','rows','show','keys','length','body','find','params','addLogo','file','filename','logo','../../config/license/util','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','upperFirst','custom','existsSync','\x20not\x20found','download','default_loginLogo.svg','default','securePassword','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','map','Setting','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes'];(function(_0x3a38e1,_0x216e3f){var _0x1f8950=function(_0x5c7665){while(--_0x5c7665){_0x3a38e1['push'](_0x3a38e1['shift']());}};_0x1f8950(++_0x216e3f);}(_0x16aa,0x116));var _0xa16a=function(_0x54eefa,_0x5c821a){_0x54eefa=_0x54eefa-0x0;var _0x550886=_0x16aa[_0x54eefa];return _0x550886;};'use strict';var pdf=require(_0xa16a('0x0'));var emlformat=require(_0xa16a('0x1'));var rimraf=require(_0xa16a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa16a('0x3'));var rp=require(_0xa16a('0x4'));var moment=require('moment');var BPromise=require(_0xa16a('0x5'));var Mustache=require(_0xa16a('0x6'));var util=require(_0xa16a('0x7'));var path=require(_0xa16a('0x8'));var sox=require(_0xa16a('0x9'));var csv=require(_0xa16a('0xa'));var ejs=require(_0xa16a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa16a('0xc'));var crypto=require(_0xa16a('0xd'));var jsforce=require(_0xa16a('0xe'));var deskjs=require(_0xa16a('0xf'));var toCsv=require(_0xa16a('0xa'));var querystring=require(_0xa16a('0x10'));var Papa=require('papaparse');var Redis=require(_0xa16a('0x11'));var authService=require(_0xa16a('0x12'));var qs=require(_0xa16a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa16a('0x14'));var logger=require('../../config/logger')(_0xa16a('0x15'));var utils=require(_0xa16a('0x16'));var config=require(_0xa16a('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa16a('0x18'));var client=jayson[_0xa16a('0x19')][_0xa16a('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5baa0f,_0xae4c2b,_0x4c8512){if(_0x4c8512){var _0x103cee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x103cee[_0xa16a('0x1b')](_0xae4c2b)){return _0x5baa0f;}else{throw new db[(_0xa16a('0x1c'))][(_0xa16a('0x1d'))](_0xa16a('0x1e'));}}else{return _0x5baa0f;}}function respondWithRpcPromise(_0x362de3,_0x4ea1cd,_0x4883ac,_0x54054c){return new BPromise(function(_0x22b7fe,_0x1bb908){var _0x538c69=_0x54054c||client;return _0x538c69[_0xa16a('0x1f')](_0x362de3,_0x4883ac)[_0xa16a('0x20')](function(_0x56f8a1){logger[_0xa16a('0x21')](_0xa16a('0x22'),_0x4ea1cd,'request\x20sent');logger[_0xa16a('0x23')](_0xa16a('0x24'),_0x4ea1cd,_0xa16a('0x25'),JSON['stringify'](_0x56f8a1));if(_0x56f8a1[_0xa16a('0x26')]){if(_0x56f8a1['error']['code']===0x1f4){logger[_0xa16a('0x26')]('Setting,\x20%s,\x20%s',_0x4ea1cd,_0x56f8a1[_0xa16a('0x26')]['message']);return _0x1bb908(_0x56f8a1[_0xa16a('0x26')][_0xa16a('0x27')]);}logger[_0xa16a('0x26')]('Setting,\x20%s,\x20%s',_0x4ea1cd,_0x56f8a1[_0xa16a('0x26')][_0xa16a('0x27')]);return _0x22b7fe(_0x56f8a1[_0xa16a('0x26')]['message']);}else{logger['info'](_0xa16a('0x22'),_0x4ea1cd,_0xa16a('0x25'));_0x22b7fe(_0x56f8a1[_0xa16a('0x28')][_0xa16a('0x27')]);}})[_0xa16a('0x29')](function(_0x5e4e99){logger[_0xa16a('0x26')](_0xa16a('0x22'),_0x4ea1cd,_0x5e4e99);_0x1bb908(_0x5e4e99);});});}function respondWithStatusCode(_0x453d22,_0xf0fdbf){_0xf0fdbf=_0xf0fdbf||0xcc;return function(_0xedd8e3){if(_0xedd8e3){return _0x453d22[_0xa16a('0x2a')](_0xf0fdbf);}return _0x453d22[_0xa16a('0x2b')](_0xf0fdbf)[_0xa16a('0x2c')]();};}function respondWithResult(_0x188a2d,_0x227e63){_0x227e63=_0x227e63||0xc8;return function(_0x16d300){if(_0x16d300){return _0x188a2d['status'](_0x227e63)[_0xa16a('0x2d')](_0x16d300);}};}function respondWithFilteredResult(_0x76fcb4,_0x1a475c){return function(_0x2c095d){if(_0x2c095d){var _0x4826ba=_0x2c095d[_0xa16a('0x2e')],_0x3551d3=_0x1a475c[_0xa16a('0x2f')],_0x450dc6=_0x1a475c['offset']+_0x1a475c['limit'],_0x18ea4b;if(_0x450dc6>=_0x4826ba){_0x450dc6=_0x4826ba;_0x18ea4b=0xc8;}else{_0x18ea4b=0xce;}_0x76fcb4[_0xa16a('0x2b')](_0x18ea4b);return _0x76fcb4['set'](_0xa16a('0x30'),_0x3551d3+'-'+_0x450dc6+'/'+_0x4826ba)[_0xa16a('0x2d')](_0x2c095d);}return null;};}function patchUpdates(_0x57c08c){return function(_0x289ce6){try{jsonpatch[_0xa16a('0x31')](_0x289ce6,_0x57c08c,!![]);}catch(_0x2a9e88){return BPromise[_0xa16a('0x32')](_0x2a9e88);}return _0x289ce6[_0xa16a('0x33')]();};}function saveUpdates(_0x1640f3,_0x9b5c83){return function(_0x4641df){if(_0x4641df){return _0x4641df[_0xa16a('0x34')](_0x1640f3)[_0xa16a('0x20')](function(_0x5265b5){return _0x5265b5;});}return null;};}function removeEntity(_0x18e91d,_0x28307f){return function(_0x4cb394){if(_0x4cb394){return _0x4cb394[_0xa16a('0x35')]()[_0xa16a('0x20')](function(){_0x18e91d[_0xa16a('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x198e68,_0x1f4acf){return function(_0x425df9){if(!_0x425df9){_0x198e68['sendStatus'](0x194);}return _0x425df9;};}function handleError(_0x2c1a60,_0x18e198){_0x18e198=_0x18e198||0x1f4;return function(_0x3f0d4b){logger[_0xa16a('0x26')](_0x3f0d4b[_0xa16a('0x36')]);if(_0x3f0d4b[_0xa16a('0x37')]){delete _0x3f0d4b[_0xa16a('0x37')];}_0x2c1a60[_0xa16a('0x2b')](_0x18e198)['send'](_0x3f0d4b);};}exports['index']=function(_0x4b1554,_0x1310e8){var _0x42ea5c={},_0x3bd0de={},_0x3488c1={'count':0x0,'rows':[]};var _0x1106be=_[_0xa16a('0x38')](db[_0xa16a('0x39')][_0xa16a('0x3a')],function(_0x2d470a){return{'name':_0x2d470a[_0xa16a('0x3b')],'type':_0x2d470a[_0xa16a('0x3c')]['key']};});_0x3bd0de['model']=_['map'](_0x1106be,_0xa16a('0x37'));_0x3bd0de['query']=_['keys'](_0x4b1554[_0xa16a('0x3d')]);_0x3bd0de[_0xa16a('0x3e')]=_[_0xa16a('0x3f')](_0x3bd0de[_0xa16a('0x40')],_0x3bd0de[_0xa16a('0x3d')]);_0x42ea5c['attributes']=_['intersection'](_0x3bd0de[_0xa16a('0x40')],qs[_0xa16a('0x41')](_0x4b1554[_0xa16a('0x3d')][_0xa16a('0x41')]));_0x42ea5c[_0xa16a('0x42')]=_0x42ea5c['attributes']['length']?_0x42ea5c[_0xa16a('0x42')]:_0x3bd0de[_0xa16a('0x40')];if(!_0x4b1554['query']['hasOwnProperty']('nolimit')){_0x42ea5c['limit']=qs[_0xa16a('0x43')](_0x4b1554['query'][_0xa16a('0x43')]);_0x42ea5c[_0xa16a('0x2f')]=qs[_0xa16a('0x2f')](_0x4b1554[_0xa16a('0x3d')][_0xa16a('0x2f')]);}_0x42ea5c[_0xa16a('0x44')]=qs['sort'](_0x4b1554[_0xa16a('0x3d')]['sort']);_0x42ea5c[_0xa16a('0x45')]=qs[_0xa16a('0x3e')](_[_0xa16a('0x46')](_0x4b1554['query'],_0x3bd0de[_0xa16a('0x3e')]),_0x1106be);if(_0x4b1554[_0xa16a('0x3d')][_0xa16a('0x47')]){_0x42ea5c[_0xa16a('0x45')]=_['merge'](_0x42ea5c[_0xa16a('0x45')],{'$or':_['map'](_0x1106be,function(_0x3c3404){if(_0x3c3404[_0xa16a('0x3c')]!=='VIRTUAL'){var _0x33d363={};_0x33d363[_0x3c3404[_0xa16a('0x37')]]={'$like':'%'+_0x4b1554['query'][_0xa16a('0x47')]+'%'};return _0x33d363;}})});}_0x42ea5c=_[_0xa16a('0x48')]({},_0x42ea5c,_0x4b1554[_0xa16a('0x49')]);var _0x1a1aa8={'where':_0x42ea5c[_0xa16a('0x45')]};return db[_0xa16a('0x39')][_0xa16a('0x2e')](_0x1a1aa8)[_0xa16a('0x20')](function(_0x34bbb0){_0x3488c1[_0xa16a('0x2e')]=_0x34bbb0;if(_0x4b1554[_0xa16a('0x3d')]['includeAll']){_0x42ea5c[_0xa16a('0x4a')]=[{'all':!![]}];}return db[_0xa16a('0x39')][_0xa16a('0x4b')](_0x42ea5c);})[_0xa16a('0x20')](function(_0x315460){_0x3488c1[_0xa16a('0x4c')]=_0x315460;return _0x3488c1;})[_0xa16a('0x20')](respondWithFilteredResult(_0x1310e8,_0x42ea5c))[_0xa16a('0x29')](handleError(_0x1310e8,null));};exports[_0xa16a('0x4d')]=function(_0x18cb4e,_0x224be){var _0x38638c={'raw':![],'where':{'id':_0x18cb4e['params']['id']}},_0x4de07b={};_0x4de07b['model']=_[_0xa16a('0x4e')](db[_0xa16a('0x39')][_0xa16a('0x3a')]);_0x4de07b[_0xa16a('0x3d')]=_[_0xa16a('0x4e')](_0x18cb4e[_0xa16a('0x3d')]);_0x4de07b[_0xa16a('0x3e')]=_[_0xa16a('0x3f')](_0x4de07b[_0xa16a('0x40')],_0x4de07b['query']);_0x38638c[_0xa16a('0x42')]=_['intersection'](_0x4de07b[_0xa16a('0x40')],qs[_0xa16a('0x41')](_0x18cb4e[_0xa16a('0x3d')][_0xa16a('0x41')]));_0x38638c[_0xa16a('0x42')]=_0x38638c[_0xa16a('0x42')][_0xa16a('0x4f')]?_0x38638c[_0xa16a('0x42')]:_0x4de07b[_0xa16a('0x40')];if(_0x18cb4e[_0xa16a('0x3d')]['includeAll']){_0x38638c[_0xa16a('0x4a')]=[{'all':!![]}];}_0x38638c=_['merge']({},_0x38638c,_0x18cb4e[_0xa16a('0x49')]);return db['Setting']['find'](_0x38638c)[_0xa16a('0x20')](handleEntityNotFound(_0x224be,null))['then'](respondWithResult(_0x224be,null))[_0xa16a('0x29')](handleError(_0x224be,null));};exports[_0xa16a('0x34')]=function(_0x1bf0d8,_0x2284a2){if(_0x1bf0d8[_0xa16a('0x50')]['id']){delete _0x1bf0d8[_0xa16a('0x50')]['id'];}return db['Setting'][_0xa16a('0x51')]({'where':{'id':_0x1bf0d8[_0xa16a('0x52')]['id']}})[_0xa16a('0x20')](handleEntityNotFound(_0x2284a2,null))[_0xa16a('0x20')](saveUpdates(_0x1bf0d8[_0xa16a('0x50')],null))['then'](respondWithResult(_0x2284a2,null))[_0xa16a('0x29')](handleError(_0x2284a2,null));};exports[_0xa16a('0x53')]=function(_0x410d96,_0x4ba5c5,_0x31ea3b){if(_0x410d96[_0xa16a('0x54')]&&_0x410d96[_0xa16a('0x54')][_0xa16a('0x55')]){_0x410d96[_0xa16a('0x50')][_0xa16a('0x56')]=_0x410d96[_0xa16a('0x54')][_0xa16a('0x55')];}return db[_0xa16a('0x39')][_0xa16a('0x51')]({'where':{'id':_0x410d96['params']['id']}})[_0xa16a('0x20')](handleEntityNotFound(_0x4ba5c5,null))[_0xa16a('0x20')](saveUpdates(_0x410d96[_0xa16a('0x50')],null))[_0xa16a('0x20')](respondWithResult(_0x4ba5c5,null))['catch'](handleError(_0x4ba5c5,null));};exports['addLogoLogin']=function(_0x9d4f8d,_0xeb3c01,_0x33664a){if(_0x9d4f8d['file']&&_0x9d4f8d[_0xa16a('0x54')][_0xa16a('0x55')]){_0x9d4f8d[_0xa16a('0x50')]['loginLogo']=_0x9d4f8d[_0xa16a('0x54')][_0xa16a('0x55')];}return db[_0xa16a('0x39')][_0xa16a('0x51')]({'where':{'id':_0x9d4f8d[_0xa16a('0x52')]['id']}})['then'](handleEntityNotFound(_0xeb3c01,null))[_0xa16a('0x20')](saveUpdates(_0x9d4f8d[_0xa16a('0x50')],null))[_0xa16a('0x20')](respondWithResult(_0xeb3c01,null))[_0xa16a('0x29')](handleError(_0xeb3c01,null));};var utilLicense=require(_0xa16a('0x57'));exports[_0xa16a('0x58')]=function(_0x4489f9,_0x17c4f8,_0x55893c){var _0x493919=_0xa16a('0x59');var _0x1f7388={'custom':![]};return utilLicense[_0xa16a('0x5a')]()[_0xa16a('0x20')](function(_0x5f01d8){if(_0x5f01d8){_0x1f7388=_0x5f01d8;}return db[_0xa16a('0x39')][_0xa16a('0x51')]({'where':{'id':_0x4489f9[_0xa16a('0x52')]['id']},'attributes':[_0xa16a('0x56'),_0xa16a('0x5b'),_0xa16a('0x5c'),_0xa16a('0x5d'),_0xa16a('0x5e'),_0xa16a('0x5f'),_0xa16a('0x60'),_0xa16a('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x17c4f8,null))[_0xa16a('0x20')](function(_0x1105b0){if(_0x1105b0){var _0x136a82=_0x1105b0['logo']&&fs['existsSync'](path[_0xa16a('0x62')](config['root'],_0x493919,_['toLower'](_0x1105b0[_0xa16a('0x56')])))?path[_0xa16a('0x62')](config[_0xa16a('0x63')],_0x493919,_[_0xa16a('0x64')](_0x1105b0['logo'])):path[_0xa16a('0x62')](config[_0xa16a('0x63')],_0x493919,_['toLower'](_0xa16a('0x65')));var _0x4d0231='default'+_[_0xa16a('0x66')](_0xa16a('0x56'));if(_0x1105b0[_0x4d0231]||!_0x1f7388[_0xa16a('0x67')]){_0x136a82=path['join'](config[_0xa16a('0x63')],_0x493919,_[_0xa16a('0x64')](_0xa16a('0x65')));}if(!fs[_0xa16a('0x68')](_0x136a82)){throw new db['Sequelize'][(_0xa16a('0x1d'))](_[_0xa16a('0x66')]('logo')+_0xa16a('0x69'));}return _0x17c4f8[_0xa16a('0x6a')](_0x136a82);}})[_0xa16a('0x29')](handleError(_0x17c4f8,null));};var utilLicense=require(_0xa16a('0x57'));exports['getLogoLogin']=function(_0xe55577,_0x119d99,_0x352839){var _0x5b7ce7=_0xa16a('0x59');var _0x1b28b3={'custom':![]};return utilLicense[_0xa16a('0x5a')]()['then'](function(_0x3208ca){if(_0x3208ca){_0x1b28b3=_0x3208ca;}return db[_0xa16a('0x39')]['find']({'where':{'id':_0xe55577[_0xa16a('0x52')]['id']},'attributes':['logo',_0xa16a('0x5b'),_0xa16a('0x5c'),'favicon',_0xa16a('0x5e'),'defaultLoginLogo','defaultPreferred',_0xa16a('0x61')],'raw':!![]});})[_0xa16a('0x20')](handleEntityNotFound(_0x119d99,null))['then'](function(_0x2eb1da){if(_0x2eb1da){var _0x24c3d6=_0x2eb1da[_0xa16a('0x5b')]&&fs[_0xa16a('0x68')](path['join'](config[_0xa16a('0x63')],_0x5b7ce7,_[_0xa16a('0x64')](_0x2eb1da[_0xa16a('0x5b')])))?path[_0xa16a('0x62')](config[_0xa16a('0x63')],_0x5b7ce7,_[_0xa16a('0x64')](_0x2eb1da[_0xa16a('0x5b')])):path[_0xa16a('0x62')](config['root'],_0x5b7ce7,_[_0xa16a('0x64')](_0xa16a('0x6b')));var _0x377e55=_0xa16a('0x6c')+_['upperFirst'](_0xa16a('0x5b'));if(_0x2eb1da[_0x377e55]||!_0x1b28b3[_0xa16a('0x67')]){_0x24c3d6=path[_0xa16a('0x62')](config[_0xa16a('0x63')],_0x5b7ce7,_[_0xa16a('0x64')](_0xa16a('0x6b')));}if(!fs[_0xa16a('0x68')](_0x24c3d6)){throw new db[(_0xa16a('0x1c'))][(_0xa16a('0x1d'))](_[_0xa16a('0x66')](_0xa16a('0x5b'))+'\x20not\x20found');}return _0x119d99[_0xa16a('0x6a')](_0x24c3d6);}})['catch'](handleError(_0x119d99,null));};exports['gdpr']=function(_0x147356,_0x542ad2){return db[_0xa16a('0x39')][_0xa16a('0x51')]({'where':{'id':_0x147356[_0xa16a('0x52')]['id']},'attributes':[_0xa16a('0x6d')]})[_0xa16a('0x20')](respondWithResult(_0x542ad2,null))[_0xa16a('0x29')](handleError(_0x542ad2,null));};exports[_0xa16a('0x6e')]=function(_0x1e2c38,_0x4e5ebd,_0x560648){if(_0x1e2c38[_0xa16a('0x54')]&&_0x1e2c38['file'][_0xa16a('0x55')]){_0x1e2c38[_0xa16a('0x50')][_0xa16a('0x5c')]=_0x1e2c38[_0xa16a('0x54')][_0xa16a('0x55')];}return db[_0xa16a('0x39')][_0xa16a('0x51')]({'where':{'id':_0x1e2c38[_0xa16a('0x52')]['id']}})[_0xa16a('0x20')](handleEntityNotFound(_0x4e5ebd,null))['then'](saveUpdates(_0x1e2c38['body'],null))[_0xa16a('0x20')](respondWithResult(_0x4e5ebd,null))[_0xa16a('0x29')](handleError(_0x4e5ebd,null));};var utilLicense=require('../../config/license/util');exports[_0xa16a('0x6f')]=function(_0x4c3589,_0x961851,_0x4e3a71){var _0x14ceeb='server/files/images/logos';var _0x26f1fc={'custom':![]};return utilLicense[_0xa16a('0x5a')]()['then'](function(_0x2e280b){if(_0x2e280b){_0x26f1fc=_0x2e280b;}return db[_0xa16a('0x39')][_0xa16a('0x51')]({'where':{'id':_0x4c3589['params']['id']},'attributes':[_0xa16a('0x56'),_0xa16a('0x5b'),_0xa16a('0x5c'),_0xa16a('0x5d'),'defaultLogo',_0xa16a('0x5f'),_0xa16a('0x60'),_0xa16a('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x961851,null))[_0xa16a('0x20')](function(_0x9ce58f){if(_0x9ce58f){var _0x13bc4a=_0x9ce58f[_0xa16a('0x5c')]&&fs[_0xa16a('0x68')](path[_0xa16a('0x62')](config['root'],_0x14ceeb,_[_0xa16a('0x64')](_0x9ce58f[_0xa16a('0x5c')])))?path['join'](config['root'],_0x14ceeb,_[_0xa16a('0x64')](_0x9ce58f[_0xa16a('0x5c')])):path[_0xa16a('0x62')](config[_0xa16a('0x63')],_0x14ceeb,_[_0xa16a('0x64')](_0xa16a('0x70')));var _0x190cb5=_0xa16a('0x6c')+_[_0xa16a('0x66')](_0xa16a('0x5c'));if(_0x9ce58f[_0x190cb5]||!_0x26f1fc[_0xa16a('0x67')]||!_0x26f1fc['preferred']){_0x13bc4a=path[_0xa16a('0x62')](config['root'],_0x14ceeb,_['toLower'](_0xa16a('0x70')));}if(!fs['existsSync'](_0x13bc4a)){throw new db[(_0xa16a('0x1c'))][(_0xa16a('0x1d'))](_['upperFirst'](_0xa16a('0x5c'))+_0xa16a('0x69'));}return _0x961851[_0xa16a('0x6a')](_0x13bc4a);}})['catch'](handleError(_0x961851,null));};exports['addFavicon']=function(_0x54f42a,_0x5663b2,_0x3ce94d){if(_0x54f42a[_0xa16a('0x54')]&&_0x54f42a[_0xa16a('0x54')][_0xa16a('0x55')]){_0x54f42a[_0xa16a('0x50')][_0xa16a('0x5d')]=_0x54f42a[_0xa16a('0x54')]['filename'];}return db[_0xa16a('0x39')]['find']({'where':{'id':_0x54f42a[_0xa16a('0x52')]['id']}})[_0xa16a('0x20')](handleEntityNotFound(_0x5663b2,null))[_0xa16a('0x20')](saveUpdates(_0x54f42a[_0xa16a('0x50')],null))[_0xa16a('0x20')](respondWithResult(_0x5663b2,null))[_0xa16a('0x29')](handleError(_0x5663b2,null));};var utilLicense=require(_0xa16a('0x57'));exports[_0xa16a('0x71')]=function(_0x3c341f,_0x183ab4,_0x2e8012){var _0x1e14ac='server/files/images/logos';var _0xcb5ece={'custom':![]};return utilLicense[_0xa16a('0x5a')]()['then'](function(_0x627715){if(_0x627715){_0xcb5ece=_0x627715;}return db[_0xa16a('0x39')][_0xa16a('0x51')]({'where':{'id':_0x3c341f[_0xa16a('0x52')]['id']},'attributes':[_0xa16a('0x56'),_0xa16a('0x5b'),_0xa16a('0x5c'),_0xa16a('0x5d'),_0xa16a('0x5e'),_0xa16a('0x5f'),'defaultPreferred',_0xa16a('0x61')],'raw':!![]});})[_0xa16a('0x20')](handleEntityNotFound(_0x183ab4,null))[_0xa16a('0x20')](function(_0x23d2a5){if(_0x23d2a5){var _0x44df7c=_0x23d2a5[_0xa16a('0x5d')]&&fs[_0xa16a('0x68')](path['join'](config[_0xa16a('0x63')],_0x1e14ac,_[_0xa16a('0x64')](_0x23d2a5[_0xa16a('0x5d')])))?path[_0xa16a('0x62')](config[_0xa16a('0x63')],_0x1e14ac,_[_0xa16a('0x64')](_0x23d2a5[_0xa16a('0x5d')])):path['join'](config[_0xa16a('0x63')],_0x1e14ac,_[_0xa16a('0x64')](_0xa16a('0x72')));var _0xaf1a6f='default'+_['upperFirst']('favicon');if(_0x23d2a5[_0xaf1a6f]||!_0xcb5ece[_0xa16a('0x67')]){_0x44df7c=path['join'](config[_0xa16a('0x63')],_0x1e14ac,_[_0xa16a('0x64')](_0xa16a('0x72')));}if(!fs[_0xa16a('0x68')](_0x44df7c)){throw new db[(_0xa16a('0x1c'))][(_0xa16a('0x1d'))](_[_0xa16a('0x66')]('favicon')+'\x20not\x20found');}return _0x183ab4[_0xa16a('0x6a')](_0x44df7c);}})['catch'](handleError(_0x183ab4,null));};
\ No newline at end of file
diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js
index 843291f..b84dc7f 100644
--- a/server/api/setting/setting.model.js
+++ b/server/api/setting/setting.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x157e=['define','settings','lodash','util','../../config/logger','api','path','rimraf','./setting.attributes','exports'];(function(_0x2800c5,_0x57752f){var _0x505906=function(_0x5a503c){while(--_0x5a503c){_0x2800c5['push'](_0x2800c5['shift']());}};_0x505906(++_0x57752f);}(_0x157e,0x17e));var _0xe157=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x157e[_0x1acc2d];return _0xabfa6d;};'use strict';var _=require(_0xe157('0x0'));var util=require(_0xe157('0x1'));var logger=require(_0xe157('0x2'))(_0xe157('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe157('0x4'));var rimraf=require(_0xe157('0x5'));var config=require('../../config/environment');var attributes=require(_0xe157('0x6'));module[_0xe157('0x7')]=function(_0x189b22,_0x440914){return _0x189b22[_0xe157('0x8')]('Setting',attributes,{'tableName':_0xe157('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x640d=['rimraf','../../config/environment','./setting.attributes','exports','define','Setting','../../config/logger','api','bluebird','path'];(function(_0xcdc154,_0x42d0f0){var _0x351f5e=function(_0x42ed4d){while(--_0x42ed4d){_0xcdc154['push'](_0xcdc154['shift']());}};_0x351f5e(++_0x42d0f0);}(_0x640d,0x1a0));var _0xd640=function(_0x2d367f,_0x28e1f1){_0x2d367f=_0x2d367f-0x0;var _0x5e6225=_0x640d[_0x2d367f];return _0x5e6225;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd640('0x0'))(_0xd640('0x1'));var moment=require('moment');var BPromise=require(_0xd640('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd640('0x3'));var rimraf=require(_0xd640('0x4'));var config=require(_0xd640('0x5'));var attributes=require(_0xd640('0x6'));module[_0xd640('0x7')]=function(_0x2b7ebf,_0x58c89a){return _0x2b7ebf[_0xd640('0x8')](_0xd640('0x9'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js
index 138ee0e..c1a714f 100644
--- a/server/api/setting/setting.rpc.js
+++ b/server/api/setting/setting.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4763=['catch','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x406699,_0x1201fe){var _0x3d066e=function(_0x281ec6){while(--_0x281ec6){_0x406699['push'](_0x406699['shift']());}};_0x3d066e(++_0x1201fe);}(_0x4763,0x18d));var _0x3476=function(_0x1ba62e,_0xe7764){_0x1ba62e=_0x1ba62e-0x0;var _0x496db0=_0x4763[_0x1ba62e];return _0x496db0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3476('0x0'));var BPromise=require(_0x3476('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3476('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3476('0x3'))(_0x3476('0x4'));var config=require(_0x3476('0x5'));var jayson=require(_0x3476('0x6'));var client=jayson['client'][_0x3476('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x214d87,_0x3fbedc,_0x3b43b0){return new BPromise(function(_0x54cc91,_0x1fcc78){return client[_0x3476('0x8')](_0x214d87,_0x3b43b0)[_0x3476('0x9')](function(_0x4041e4){logger[_0x3476('0xa')](_0x3476('0xb'),_0x3fbedc,_0x3476('0xc'));logger['debug'](_0x3476('0xd'),_0x3fbedc,_0x3476('0xc'),JSON['stringify'](_0x4041e4));if(_0x4041e4[_0x3476('0xe')]){if(_0x4041e4[_0x3476('0xe')]['code']===0x1f4){logger[_0x3476('0xe')](_0x3476('0xb'),_0x3fbedc,_0x4041e4[_0x3476('0xe')][_0x3476('0xf')]);return _0x1fcc78(_0x4041e4[_0x3476('0xe')]['message']);}logger[_0x3476('0xe')](_0x3476('0xb'),_0x3fbedc,_0x4041e4['error'][_0x3476('0xf')]);return _0x54cc91(_0x4041e4[_0x3476('0xe')][_0x3476('0xf')]);}else{logger[_0x3476('0xa')](_0x3476('0xb'),_0x3fbedc,_0x3476('0xc'));_0x54cc91(_0x4041e4[_0x3476('0x10')][_0x3476('0xf')]);}})[_0x3476('0x11')](function(_0x977e49){logger[_0x3476('0xe')](_0x3476('0xb'),_0x3fbedc,_0x977e49);_0x1fcc78(_0x977e49);});});}
\ No newline at end of file
+var _0xc813=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','Setting,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring'];(function(_0x423085,_0x748702){var _0x2e271e=function(_0x62b10d){while(--_0x62b10d){_0x423085['push'](_0x423085['shift']());}};_0x2e271e(++_0x748702);}(_0xc813,0x19a));var _0x3c81=function(_0x17ac37,_0x596886){_0x17ac37=_0x17ac37-0x0;var _0x4fc5cf=_0xc813[_0x17ac37];return _0x4fc5cf;};'use strict';var _=require(_0x3c81('0x0'));var util=require(_0x3c81('0x1'));var moment=require(_0x3c81('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c81('0x3'));var fs=require('fs');var Redis=require(_0x3c81('0x4'));var db=require(_0x3c81('0x5'))['db'];var utils=require(_0x3c81('0x6'));var logger=require(_0x3c81('0x7'))(_0x3c81('0x8'));var config=require(_0x3c81('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3c81('0xa')][_0x3c81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c3ab5,_0xe0f19b,_0x1439f1){return new BPromise(function(_0x337c56,_0x512543){return client[_0x3c81('0xc')](_0x3c3ab5,_0x1439f1)['then'](function(_0x19d094){logger[_0x3c81('0xd')]('Setting,\x20%s,\x20%s',_0xe0f19b,_0x3c81('0xe'));logger[_0x3c81('0xf')](_0x3c81('0x10'),_0xe0f19b,_0x3c81('0xe'),JSON['stringify'](_0x19d094));if(_0x19d094[_0x3c81('0x11')]){if(_0x19d094[_0x3c81('0x11')][_0x3c81('0x12')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0xe0f19b,_0x19d094['error'][_0x3c81('0x13')]);return _0x512543(_0x19d094[_0x3c81('0x11')][_0x3c81('0x13')]);}logger[_0x3c81('0x11')](_0x3c81('0x14'),_0xe0f19b,_0x19d094['error'][_0x3c81('0x13')]);return _0x337c56(_0x19d094[_0x3c81('0x11')][_0x3c81('0x13')]);}else{logger[_0x3c81('0xd')](_0x3c81('0x14'),_0xe0f19b,_0x3c81('0xe'));_0x337c56(_0x19d094[_0x3c81('0x15')][_0x3c81('0x13')]);}})[_0x3c81('0x16')](function(_0x24fa91){logger[_0x3c81('0x11')]('Setting,\x20%s,\x20%s',_0xe0f19b,_0x24fa91);_0x512543(_0x24fa91);});});}
\ No newline at end of file
diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js
index c838bda..3a1a1eb 100644
--- a/server/api/smsAccount/index.js
+++ b/server/api/smsAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd845=['/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','getInteractions','statusGet','getAgents','post','create','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/send','send','/:id/status','/:id/users','addAgents','put','delete','/:id','destroy','removeDispositions','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','show'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xd845,0x1e1));var _0x5d84=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xd845[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x5d84('0x0'));var util=require(_0x5d84('0x1'));var path=require(_0x5d84('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d84('0x3'));var router=express[_0x5d84('0x4')]();var auth=require(_0x5d84('0x5'));var interaction=require(_0x5d84('0x6'));var config=require('../../config/environment');var controller=require(_0x5d84('0x7'));router[_0x5d84('0x8')]('/',auth[_0x5d84('0x9')](),controller[_0x5d84('0xa')]);router[_0x5d84('0x8')](_0x5d84('0xb'),auth[_0x5d84('0x9')](),controller['describe']);router[_0x5d84('0x8')]('/:id',auth[_0x5d84('0x9')](),controller[_0x5d84('0xc')]);router[_0x5d84('0x8')](_0x5d84('0xd'),auth[_0x5d84('0x9')](),controller[_0x5d84('0xe')]);router[_0x5d84('0x8')](_0x5d84('0xf'),auth[_0x5d84('0x9')](),controller['getAnswers']);router[_0x5d84('0x8')]('/:id/applications',auth[_0x5d84('0x9')](),controller[_0x5d84('0x10')]);router[_0x5d84('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x5d84('0x11')]);router[_0x5d84('0x8')]('/:id/status',controller[_0x5d84('0x12')]);router[_0x5d84('0x8')]('/:id/users',auth[_0x5d84('0x9')](),controller[_0x5d84('0x13')]);router[_0x5d84('0x14')]('/',auth[_0x5d84('0x9')](),controller[_0x5d84('0x15')]);router[_0x5d84('0x14')](_0x5d84('0xd'),auth[_0x5d84('0x9')](),controller['addDisposition']);router[_0x5d84('0x14')](_0x5d84('0xf'),auth[_0x5d84('0x9')](),controller[_0x5d84('0x16')]);router[_0x5d84('0x14')](_0x5d84('0x17'),controller[_0x5d84('0x18')]);router[_0x5d84('0x14')](_0x5d84('0x19'),auth[_0x5d84('0x9')](),controller[_0x5d84('0x1a')]);router['post'](_0x5d84('0x1b'),auth[_0x5d84('0x9')](),controller[_0x5d84('0x1c')]);router[_0x5d84('0x14')](_0x5d84('0x1d'),controller['status']);router[_0x5d84('0x14')](_0x5d84('0x1e'),auth[_0x5d84('0x9')](),controller[_0x5d84('0x1f')]);router[_0x5d84('0x20')]('/:id',auth[_0x5d84('0x9')](),controller['update']);router[_0x5d84('0x21')](_0x5d84('0x22'),auth[_0x5d84('0x9')](),controller[_0x5d84('0x23')]);router[_0x5d84('0x21')]('/:id/dispositions',auth[_0x5d84('0x9')](),controller[_0x5d84('0x24')]);router['delete'](_0x5d84('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x5d84('0x21')](_0x5d84('0x1e'),auth['isAuthenticated'](),controller[_0x5d84('0x25')]);module['exports']=router;
\ No newline at end of file
+var _0xf334=['../../config/environment','./smsAccount.controller','index','get','/describe','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','notify','addApplications','send','addAgents','update','delete','destroy','removeDispositions','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x4330ab,_0x141abd){var _0x1d764d=function(_0x187d84){while(--_0x187d84){_0x4330ab['push'](_0x4330ab['shift']());}};_0x1d764d(++_0x141abd);}(_0xf334,0x19d));var _0x4f33=function(_0x12749c,_0x3e1320){_0x12749c=_0x12749c-0x0;var _0x5812e3=_0xf334[_0x12749c];return _0x5812e3;};'use strict';var multer=require(_0x4f33('0x0'));var util=require('util');var path=require(_0x4f33('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f33('0x2'));var router=express[_0x4f33('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4f33('0x4'));var config=require(_0x4f33('0x5'));var controller=require(_0x4f33('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4f33('0x7')]);router[_0x4f33('0x8')](_0x4f33('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x4f33('0x8')](_0x4f33('0xa'),auth['isAuthenticated'](),controller[_0x4f33('0xb')]);router[_0x4f33('0x8')](_0x4f33('0xc'),auth[_0x4f33('0xd')](),controller[_0x4f33('0xe')]);router[_0x4f33('0x8')]('/:id/canned_answers',auth[_0x4f33('0xd')](),controller[_0x4f33('0xf')]);router[_0x4f33('0x8')](_0x4f33('0x10'),auth['isAuthenticated'](),controller[_0x4f33('0x11')]);router['get'](_0x4f33('0x12'),auth['isAuthenticated'](),controller[_0x4f33('0x13')]);router[_0x4f33('0x8')](_0x4f33('0x14'),controller[_0x4f33('0x15')]);router['get'](_0x4f33('0x16'),auth[_0x4f33('0xd')](),controller[_0x4f33('0x17')]);router[_0x4f33('0x18')]('/',auth[_0x4f33('0xd')](),controller[_0x4f33('0x19')]);router[_0x4f33('0x18')](_0x4f33('0xc'),auth[_0x4f33('0xd')](),controller[_0x4f33('0x1a')]);router[_0x4f33('0x18')](_0x4f33('0x1b'),auth[_0x4f33('0xd')](),controller[_0x4f33('0x1c')]);router[_0x4f33('0x18')]('/:id/notify',controller[_0x4f33('0x1d')]);router[_0x4f33('0x18')](_0x4f33('0x10'),auth[_0x4f33('0xd')](),controller[_0x4f33('0x1e')]);router[_0x4f33('0x18')]('/:id/send',auth['isAuthenticated'](),controller[_0x4f33('0x1f')]);router[_0x4f33('0x18')](_0x4f33('0x14'),controller['status']);router[_0x4f33('0x18')]('/:id/users',auth[_0x4f33('0xd')](),controller[_0x4f33('0x20')]);router['put']('/:id',auth[_0x4f33('0xd')](),controller[_0x4f33('0x21')]);router[_0x4f33('0x22')](_0x4f33('0xa'),auth[_0x4f33('0xd')](),controller[_0x4f33('0x23')]);router[_0x4f33('0x22')](_0x4f33('0xc'),auth[_0x4f33('0xd')](),controller[_0x4f33('0x24')]);router[_0x4f33('0x22')](_0x4f33('0x1b'),auth[_0x4f33('0xd')](),controller['removeAnswers']);router['delete'](_0x4f33('0x16'),auth[_0x4f33('0xd')](),controller['removeAgents']);module[_0x4f33('0x25')]=router;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js
index 384ea04..0fd4934 100644
--- a/server/api/smsAccount/smsAccount.attributes.js
+++ b/server/api/smsAccount/smsAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb84=['name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x499325,_0x5988a7){var _0x1d81d5=function(_0x1f0e78){while(--_0x1f0e78){_0x499325['push'](_0x499325['shift']());}};_0x1d81d5(++_0x5988a7);}(_0xdb84,0xec));var _0x4db8=function(_0x249627,_0xe19704){_0x249627=_0x249627-0x0;var _0x17b190=_0xdb84[_0x249627];return _0x17b190;};'use strict';var Sequelize=require(_0x4db8('0x0'));var rs=require(_0x4db8('0x1'));module[_0x4db8('0x2')]={'name':{'type':Sequelize[_0x4db8('0x3')],'unique':_0x4db8('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x4db8('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x4db8('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x4db8('0x3')],'defaultValue':function(){return rs[_0x4db8('0x5')]();}},'phone':{'type':Sequelize[_0x4db8('0x3')]},'type':{'type':Sequelize[_0x4db8('0x6')](_0x4db8('0x7'),_0x4db8('0x8'),_0x4db8('0x9'),_0x4db8('0xa'),_0x4db8('0xb'),_0x4db8('0xc'),_0x4db8('0xd'),_0x4db8('0xe'),_0x4db8('0xf'))},'accountSid':{'type':Sequelize[_0x4db8('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x4db8('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x4db8('0x3')]},'password':{'type':Sequelize[_0x4db8('0x3')]},'apiKey':{'type':Sequelize[_0x4db8('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x4db8('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0x4db8('0x3')]},'notificationTemplate':{'type':Sequelize[_0x4db8('0x11')],'defaultValue':function(){return _0x4db8('0x12');}},'notificationSound':{'type':Sequelize[_0x4db8('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4db8('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4db8('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4db8('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4db8('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4db8('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4db8('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4db8('0x13')],'comment':_0x4db8('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x495252){if(!_0x495252)this[_0x4db8('0x15')](_0x4db8('0x16'),null);this['setDataValue'](_0x4db8('0x17'),_0x495252);}}};
\ No newline at end of file
+var _0x104f=['intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','ENUM','twilio','skebby','clicksend','clickatell','csc'];(function(_0x15896c,_0x11d3b5){var _0xa69bdb=function(_0x49b6ee){while(--_0x49b6ee){_0x15896c['push'](_0x15896c['shift']());}};_0xa69bdb(++_0x11d3b5);}(_0x104f,0xff));var _0xf104=function(_0x55d15f,_0x32be3d){_0x55d15f=_0x55d15f-0x0;var _0x23e543=_0x104f[_0x55d15f];return _0x23e543;};'use strict';var Sequelize=require(_0xf104('0x0'));var rs=require(_0xf104('0x1'));module['exports']={'name':{'type':Sequelize[_0xf104('0x2')],'unique':_0xf104('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xf104('0x2')],'defaultValue':function(){return rs[_0xf104('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf104('0x5')](_0xf104('0x6'),_0xf104('0x7'),'connectel',_0xf104('0x8'),'plivo',_0xf104('0x9'),_0xf104('0xa'),'infobip',_0xf104('0xb'))},'accountSid':{'type':Sequelize[_0xf104('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xf104('0x2')]},'smsMethod':{'type':Sequelize[_0xf104('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xf104('0x2')]},'password':{'type':Sequelize[_0xf104('0x2')]},'apiKey':{'type':Sequelize[_0xf104('0x2')]},'senderString':{'type':Sequelize[_0xf104('0x2')]},'deliveryReport':{'type':Sequelize[_0xf104('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf104('0xd')],'defaultValue':function(){return _0xf104('0xe');}},'notificationSound':{'type':Sequelize[_0xf104('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf104('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf104('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf104('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf104('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf104('0xf')],'comment':_0xf104('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xf104('0xc')],'defaultValue':![],'comment':_0xf104('0x11'),'set':function(_0x404fab){if(!_0x404fab)this['setDataValue'](_0xf104('0x12'),null);this['setDataValue']('mandatoryDisposition',_0x404fab);}}};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js
index 9972817..ae1abd0 100644
--- a/server/api/smsAccount/smsAccount.controller.js
+++ b/server/api/smsAccount/smsAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','log','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','SmsAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','Body','messageId','skebby','from','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','SmsInteraction','interaction','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a ','addApplications','sequelize','bulkCreate'];(function(_0x239cac,_0x15a3b4){var _0x22befe=function(_0x5bc700){while(--_0x5bc700){_0x239cac['push'](_0x239cac['shift']());}};_0x22befe(++_0x15a3b4);}(_0x7a54,0x106));var _0x47a5=function(_0x33f307,_0x3e84d7){_0x33f307=_0x33f307-0x0;var _0x4ba2b2=_0x7a54[_0x33f307];return _0x4ba2b2;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086='SmsAccounts';return db[_0x47a5('0x33')]['destroy']({'where':{'type':_0x50c086,'resourceId':_0x52749b['id']}})[_0x47a5('0x21')](function(){return _0x403028;});})['then'](function(){_0x274e34[_0x47a5('0x2a')](0xcc)[_0x47a5('0x2b')]();});}};}function handleEntityNotFound(_0x38c8d4,_0x199698){return function(_0x36add5){if(!_0x36add5){_0x38c8d4[_0x47a5('0x29')](0x194);}return _0x36add5;};}function handleError(_0xee582c,_0x452be5){_0x452be5=_0x452be5||0x1f4;return function(_0x1a0d23){logger['error'](_0x1a0d23[_0x47a5('0x34')]);if(_0x1a0d23[_0x47a5('0x35')]){delete _0x1a0d23['name'];}_0xee582c[_0x47a5('0x2a')](_0x452be5)[_0x47a5('0x36')](_0x1a0d23);};}exports[_0x47a5('0x37')]=function(_0x49c4b5,_0x101f70){var _0x10f660={'include':[{'model':db[_0x47a5('0x38')],'as':'mandatoryDispositionPause'}]},_0x596097={},_0x2ebba0={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x39')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x3a')],'type':_0x9b5eaf[_0x47a5('0x3b')][_0x47a5('0x3c')]};});_0x596097[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x55c5eb,_0x47a5('0x35'));_0x596097[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3f')]);_0x596097[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],_0x596097['query']);_0x10f660[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x49c4b5['query'][_0x47a5('0x44')]));_0x10f660['attributes']=_0x10f660['attributes']['length']?_0x10f660['attributes']:_0x596097[_0x47a5('0x3d')];if(!_0x49c4b5['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x10f660[_0x47a5('0x2e')]=qs['limit'](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x10f660['offset']=qs['offset'](_0x49c4b5[_0x47a5('0x3f')]['offset']);}_0x10f660[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x10f660[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x49c4b5[_0x47a5('0x3f')],_0x596097[_0x47a5('0x41')]),_0x55c5eb);if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x4b')]){_0x10f660[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x10f660[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x55c5eb,function(_0x3a2b38){if(_0x3a2b38['type']!==_0x47a5('0x4d')){var _0x23bb04={};_0x23bb04[_0x3a2b38['name']]={'$like':'%'+_0x49c4b5['query'][_0x47a5('0x4b')]+'%'};return _0x23bb04;}})});}_0x10f660=_['merge']({},_0x10f660,_0x49c4b5[_0x47a5('0x4e')]);var _0xd93e37={'where':_0x10f660['where']};return db['SmsAccount'][_0x47a5('0x4f')](_0xd93e37)['then'](function(_0x2d147c){_0x2ebba0[_0x47a5('0x4f')]=_0x2d147c;if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x10f660[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x39')][_0x47a5('0x52')](_0x10f660);})['then'](function(_0x48a0ef){_0x2ebba0[_0x47a5('0x53')]=_0x48a0ef;return _0x2ebba0;})[_0x47a5('0x21')](respondWithFilteredResult(_0x101f70,_0x10f660))[_0x47a5('0x54')](handleError(_0x101f70,null));};exports[_0x47a5('0x55')]=function(_0x2c7020,_0x2c0c86){var _0x249de5={'raw':![],'where':{'id':_0x2c7020[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]},_0x492cf7={};_0x492cf7['model']=_[_0x47a5('0x40')](db['SmsAccount'][_0x47a5('0x58')]);_0x492cf7[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2c7020[_0x47a5('0x3f')]);_0x492cf7['filters']=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],_0x492cf7[_0x47a5('0x3f')]);_0x249de5[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x2c7020['query'][_0x47a5('0x44')]));_0x249de5[_0x47a5('0x43')]=_0x249de5[_0x47a5('0x43')][_0x47a5('0x59')]?_0x249de5[_0x47a5('0x43')]:_0x492cf7[_0x47a5('0x3d')];if(_0x2c7020['query'][_0x47a5('0x50')]){_0x249de5[_0x47a5('0x51')]=[{'all':!![]}];}_0x249de5=_[_0x47a5('0x4c')]({},_0x249de5,_0x2c7020['options']);return db[_0x47a5('0x39')][_0x47a5('0x5a')](_0x249de5)[_0x47a5('0x21')](handleEntityNotFound(_0x2c0c86,null))['then'](respondWithResult(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};exports[_0x47a5('0x5b')]=function(_0x376e1d,_0x4fa1da){return db['SmsAccount'][_0x47a5('0x5b')](_0x376e1d['body'],{})[_0x47a5('0x21')](function(_0x5d383d){var _0x482de6=_0x376e1d[_0x47a5('0x5c')][_0x47a5('0x32')]({'plain':!![]});if(!_0x482de6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482de6[_0x47a5('0x5d')]===_0x47a5('0x5c')){var _0x4b706a=_0x5d383d['get']({'plain':!![]});var _0x16b4fd=_0x47a5('0x5e');return db[_0x47a5('0x5f')][_0x47a5('0x5a')]({'where':{'name':_0x16b4fd,'userProfileId':_0x482de6['userProfileId']},'raw':!![]})[_0x47a5('0x21')](function(_0x2b4255){if(_0x2b4255&&_0x2b4255[_0x47a5('0x60')]===0x0){return db['UserProfileResource'][_0x47a5('0x5b')]({'name':_0x4b706a['name'],'resourceId':_0x4b706a['id'],'type':_0x2b4255[_0x47a5('0x35')],'sectionId':_0x2b4255['id']},{})[_0x47a5('0x21')](function(){return _0x5d383d;});}else{return _0x5d383d;}})[_0x47a5('0x54')](function(_0x1c485b){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c485b);throw _0x1c485b;});}return _0x5d383d;})[_0x47a5('0x21')](respondWithResult(_0x4fa1da,0xc9))['catch'](handleError(_0x4fa1da,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')]['find']({'where':{'id':_0x5eb150['params']['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x54')](handleError(_0x4f8564,null));};exports['destroy']=function(_0x22c886,_0x274d31){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x22c886[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x274d31,null))[_0x47a5('0x21')](removeEntity(_0x274d31,null))[_0x47a5('0x54')](handleError(_0x274d31,null));};exports[_0x47a5('0x62')]=function(_0x35cca8,_0x3ac38c){return db['SmsAccount'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x3ac38c,null))[_0x47a5('0x54')](handleError(_0x3ac38c,null));};exports[_0x47a5('0x63')]=function(_0x396cb0,_0x4bbe14,_0xbec033){if(_0x396cb0[_0x47a5('0x61')]['id']){delete _0x396cb0[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x396cb0[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x21')](function(_0x350af8){if(_0x350af8){_0x396cb0[_0x47a5('0x61')][_0x47a5('0x64')]=_0x350af8['id'];return db[_0x47a5('0x65')][_0x47a5('0x5b')](_0x396cb0[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x4bbe14,null))['catch'](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x284fb8,_0x30504e,_0x4b42f3){var _0x37ac59={'raw':![],'where':{}};var _0x2e46af={};var _0x36c67={'count':0x0,'rows':[]};return db[_0x47a5('0x39')]['findOne']({'where':{'id':_0x284fb8[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x30504e,null))[_0x47a5('0x21')](function(_0x487e21){if(_0x487e21){_0x2e46af[_0x47a5('0x3d')]=_['keys'](db[_0x47a5('0x65')][_0x47a5('0x58')]);_0x2e46af[_0x47a5('0x3f')]=_['keys'](_0x284fb8['query']);_0x2e46af['filters']=_[_0x47a5('0x42')](_0x2e46af[_0x47a5('0x3d')],_0x2e46af[_0x47a5('0x3f')]);_0x37ac59[_0x47a5('0x43')]=_['intersection'](_0x2e46af[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x37ac59[_0x47a5('0x43')]=_0x37ac59[_0x47a5('0x43')][_0x47a5('0x59')]?_0x37ac59[_0x47a5('0x43')]:_0x2e46af[_0x47a5('0x3d')];if(!_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x45')](_0x47a5('0x46'))){_0x37ac59['limit']=qs[_0x47a5('0x2e')](_0x284fb8['query'][_0x47a5('0x2e')]);_0x37ac59[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x37ac59[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x37ac59[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x284fb8[_0x47a5('0x3f')],_0x2e46af[_0x47a5('0x41')]));_0x37ac59[_0x47a5('0x49')]['SmsAccountId']=_0x487e21['id'];if(_0x284fb8['query']['filter']){_0x37ac59['where']=_[_0x47a5('0x4c')](_0x37ac59[_0x47a5('0x49')],{'$or':_['map'](_0x37ac59[_0x47a5('0x43')],function(_0x44dda2){var _0x1baa5a={};_0x1baa5a[_0x44dda2]={'$like':'%'+_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1baa5a;})});}_0x37ac59=_[_0x47a5('0x4c')]({},_0x37ac59,_0x284fb8[_0x47a5('0x4e')]);return db[_0x47a5('0x65')][_0x47a5('0x4f')]({'where':_0x37ac59[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x5e5f16){_0x36c67[_0x47a5('0x4f')]=_0x5e5f16;if(_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x37ac59['include']=[{'all':!![]}];}return db[_0x47a5('0x65')][_0x47a5('0x52')](_0x37ac59);})[_0x47a5('0x21')](function(_0x5d41d8){_0x36c67[_0x47a5('0x53')]=_0x5d41d8;return _0x36c67;});}})['then'](respondWithFilteredResult(_0x30504e,_0x37ac59))['catch'](handleError(_0x30504e,null));};exports[_0x47a5('0x67')]=function(_0x292d9c,_0x277486,_0x27333e){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x292d9c['params']['id']}})['then'](handleEntityNotFound(_0x277486,null))[_0x47a5('0x21')](function(_0x4f2361){if(_0x4f2361){return _0x4f2361[_0x47a5('0x67')](_0x292d9c[_0x47a5('0x3f')][_0x47a5('0x68')]);}})[_0x47a5('0x21')](respondWithStatusCode(_0x277486,null))['catch'](handleError(_0x277486,null));};exports[_0x47a5('0x69')]=function(_0x550bde,_0x5f3a04,_0x139c79){if(_0x550bde[_0x47a5('0x61')]['id']){delete _0x550bde['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x550bde[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f3a04,null))[_0x47a5('0x21')](function(_0x578e27){if(_0x578e27){_0x550bde[_0x47a5('0x61')][_0x47a5('0x64')]=_0x578e27['id'];return db[_0x47a5('0x6a')]['create'](_0x550bde[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x5f3a04,null))[_0x47a5('0x54')](handleError(_0x5f3a04,null));};exports['getAnswers']=function(_0x3525e7,_0x4f2fbb,_0x3c012b){var _0x491bb4={'raw':![],'where':{}};var _0x135d2e={};var _0x20d8bd={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x3525e7['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f2fbb,null))[_0x47a5('0x21')](function(_0x23c393){if(_0x23c393){_0x135d2e[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db['CannedAnswer']['rawAttributes']);_0x135d2e[_0x47a5('0x3f')]=_['keys'](_0x3525e7[_0x47a5('0x3f')]);_0x135d2e[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x135d2e['model'],_0x135d2e[_0x47a5('0x3f')]);_0x491bb4[_0x47a5('0x43')]=_['intersection'](_0x135d2e[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x491bb4['attributes']=_0x491bb4['attributes'][_0x47a5('0x59')]?_0x491bb4[_0x47a5('0x43')]:_0x135d2e['model'];if(!_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x45')]('nolimit')){_0x491bb4[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3525e7[_0x47a5('0x3f')]['limit']);_0x491bb4[_0x47a5('0x2d')]=qs['offset'](_0x3525e7[_0x47a5('0x3f')]['offset']);}_0x491bb4[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x3525e7['query'][_0x47a5('0x48')]);_0x491bb4['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x3525e7[_0x47a5('0x3f')],_0x135d2e[_0x47a5('0x41')]));_0x491bb4['where'][_0x47a5('0x64')]=_0x23c393['id'];if(_0x3525e7['query']['filter']){_0x491bb4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x491bb4[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x491bb4[_0x47a5('0x43')],function(_0x5b1f5e){var _0x1522a6={};_0x1522a6[_0x5b1f5e]={'$like':'%'+_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1522a6;})});}_0x491bb4=_[_0x47a5('0x4c')]({},_0x491bb4,_0x3525e7['options']);return db[_0x47a5('0x6a')]['count']({'where':_0x491bb4[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x3f93f0){_0x20d8bd[_0x47a5('0x4f')]=_0x3f93f0;if(_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x491bb4[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x6a')][_0x47a5('0x52')](_0x491bb4);})['then'](function(_0x36796e){_0x20d8bd[_0x47a5('0x53')]=_0x36796e;return _0x20d8bd;});}})['then'](respondWithFilteredResult(_0x4f2fbb,_0x491bb4))[_0x47a5('0x54')](handleError(_0x4f2fbb,null));};exports[_0x47a5('0x6c')]=function(_0x6d6a5,_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x6d6a5['params']['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x21')](function(_0x17f82d){if(_0x17f82d){return _0x17f82d['removeAnswers'](_0x6d6a5[_0x47a5('0x3f')][_0x47a5('0x68')]);}})['then'](respondWithStatusCode(_0x5b85cd,null))[_0x47a5('0x54')](handleError(_0x5b85cd,null));};exports[_0x47a5('0x6d')]=function(_0x109805,_0x70c8a6,_0x364bb0){var _0x1371e4={'channel':'sms'};var _0x4c9894=[];var _0x5bd86e=[];var _0x133b7a={};return db[_0x47a5('0x39')]['find']({'where':{'id':_0x109805[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6f')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x5084d6){_0x1371e4[_0x47a5('0x70')]=_0x5084d6;_0x1371e4['applications']=_['orderBy'](_0x5084d6['Applications'],[_0x47a5('0x71')],['asc']);if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x6f')]){delete _0x1371e4[_0x47a5('0x70')]['Applications'];}return db[_0x47a5('0x72')][_0x47a5('0x62')]();})[_0x47a5('0x21')](function(_0x121750){if(!_0x121750){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x73'));}_0x4c9894=_[_0x47a5('0x74')](_['keys'](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76')]);_0x5bd86e=_[_0x47a5('0x74')](_[_0x47a5('0x40')](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76'),'CompanyId',_0x47a5('0x77')]);_0x1371e4[_0x47a5('0x61')]={'mapKey':'mobile'};if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){switch(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){case'twilio':_0x1371e4['body']['from']=_0x109805['body'][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x79')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['MessageSid'];break;case _0x47a5('0x7b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['sender'];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body']['text'];break;case _0x47a5('0x7d'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805[_0x47a5('0x61')][_0x47a5('0x28')];break;case'clicksend':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x61')];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7e')];break;case _0x47a5('0x7f'):_0x1371e4['body'][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x80')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x81')];break;case _0x47a5('0x82'):_0x1371e4['body'][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['results'][0x0][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0]['text'];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0][_0x47a5('0x7a')];break;case _0x47a5('0x84'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805['body'][_0x47a5('0x85')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x86')][_0x47a5('0x28')];break;case _0x47a5('0x87'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x88')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805['body'][_0x47a5('0x89')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x8a')];break;case _0x47a5('0x8b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805['body'][_0x47a5('0x7c')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')]['message'];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['refid'];break;}}if(_0x1371e4[_0x47a5('0x61')]['id']){delete _0x1371e4[_0x47a5('0x61')]['id'];}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')]['from'])){throw new db[(_0x47a5('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x1371e4[_0x47a5('0x61')]['body'])||_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8f')+_0x5bd86e);}if(!_[_0x47a5('0x90')](_0x5bd86e,_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x91')+_0x5bd86e);}_0x133b7a[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db[_0x47a5('0x92')]['find']({'where':{'id':_0x1371e4[_0x47a5('0x70')]['ListId']},'include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':_0x133b7a,'limit':0x1,'order':[[_0x47a5('0x76'),'DESC']]}]});})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x14771b){if(_0x14771b){_0x1371e4['list']=_['omit'](_0x14771b,[_0x47a5('0x93')]);if(_0x14771b[_0x47a5('0x93')][_0x47a5('0x59')]){return _0x14771b[_0x47a5('0x93')][0x0];}var _0x204bd6=_['defaults'](_0x1371e4[_0x47a5('0x61')],{'firstName':_0x1371e4['body'][_0x47a5('0x7c')],'ListId':_0x14771b['id']});_0x204bd6[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db['CmContact'][_0x47a5('0x5b')](_0x204bd6,{'fields':_0x4c9894,'raw':!![]});}})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x4339d4){if(_0x4339d4){_0x1371e4[_0x47a5('0x94')]=_0x4339d4;var _0x36a44c={'ContactId':_0x4339d4['id'],'phone':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')],'SmsAccountId':_0x109805[_0x47a5('0x56')]['id']};var _0x481bc3={'ContactId':_0x4339d4['id'],'SmsAccountId':_0x109805['params']['id'],'closed':![]};return db[_0x47a5('0x95')]['find']({'where':_0x481bc3})[_0x47a5('0x21')](function(_0x2d0b67){if(_0x2d0b67){return[_0x2d0b67,![]];}return db[_0x47a5('0x95')]['create'](_0x36a44c)[_0x47a5('0x21')](function(_0x26d629){return[_0x26d629,!![]];});});}})['spread'](function(_0xcb6714,_0x51f6cf){_0x1371e4[_0x47a5('0x96')]=_0xcb6714[_0x47a5('0x32')]({'plain':!![]});_0x1371e4[_0x47a5('0x96')]['created']=![];if(_0x51f6cf){if(_0x1371e4['account']['autoclose']){_0x1371e4['applications']['push']({'id':0x0,'priority':_0x1371e4[_0x47a5('0x97')]['length']+0x1,'app':_0x47a5('0x98'),'appdata':_0x47a5('0x99'),'interval':'*,*,*,*'});}_0x1371e4['interaction']['created']=!![];}return db[_0x47a5('0x9a')]['create']({'phone':_0x1371e4['body']['from'],'messageId':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')],'body':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')],'SmsAccountId':_0x109805['params']['id'],'SmsInteractionId':_0xcb6714['id'],'direction':'in','ContactId':_0xcb6714[_0x47a5('0x9b')],'AttachmentId':_0x1371e4['body'][_0x47a5('0x9c')]});})['then'](function(_0x2de924){_0x1371e4[_0x47a5('0x28')]=_0x2de924;if(_0x1371e4[_0x47a5('0x96')]['UserId']){return db[_0x47a5('0x9d')][_0x47a5('0x5a')]({'attributes':['id',_0x47a5('0x35')],'where':{'id':_0x1371e4[_0x47a5('0x96')]['UserId']}})[_0x47a5('0x21')](function(_0x9a7edc){if(_0x9a7edc){_0x1371e4[_0x47a5('0x97')][_0x47a5('0x9e')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x9f'),'appdata':_0x9a7edc[_0x47a5('0x35')]+','+(_0x1371e4['account'][_0x47a5('0xa0')]||0xa),'interval':_0x47a5('0xa1')});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);})[_0x47a5('0x21')](function(_0x2697df){if(_0x2697df){var _0x408887=0xc8;var _0x34fde3=_0x47a5('0xa4');logger[_0x47a5('0x22')](_0x47a5('0x25'),_0x34fde3,_0x408887,_0x47a5('0xa5'));logger[_0x47a5('0xa6')](_0x47a5('0xa7'),_0x34fde3,_0x408887,_0x47a5('0xa5'),JSON['stringify'](_0x2697df));if(_0x1371e4[_0x47a5('0x70')]['type']==='twilio'){return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0xa8')](_0x47a5('0xa9'),'text/xml')[_0x47a5('0x36')](_0x47a5('0xaa'));}else{return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0x2c')](_0x2697df);}}})[_0x47a5('0x54')](handleError(_0x70c8a6,null));};exports[_0x47a5('0xab')]=function(_0x1b1f86,_0x46cb3a,_0x176e71){return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1b1f86[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46cb3a,null))['then'](function(_0x4aad5f){if(_0x4aad5f){return db[_0x47a5('0xac')]['transaction'](function(_0x249339){return db[_0x47a5('0x6e')][_0x47a5('0x31')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'transaction':_0x249339})[_0x47a5('0x21')](function(_0x3708ea){var _0x583b37=_[_0x47a5('0x3e')](_0x1b1f86[_0x47a5('0x61')],function(_0x380eca){_0x380eca['SmsAccountId']=_0x1b1f86[_0x47a5('0x56')]['id'];return _0x380eca;});return db[_0x47a5('0x6e')][_0x47a5('0xad')](_0x583b37,{'transaction':_0x249339});});})[_0x47a5('0x21')](function(){return db[_0x47a5('0x6e')][_0x47a5('0xae')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'order':_0x47a5('0x71')});});}})[_0x47a5('0x21')](respondWithResult(_0x46cb3a,null))[_0x47a5('0x54')](handleError(_0x46cb3a,null));};exports[_0x47a5('0xaf')]=function(_0x40b7a5,_0x28e998,_0x2ac386){var _0x578983={};var _0x3f7fdc={};var _0x272cd0;var _0x150cff;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x40b7a5[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x28e998,null))['then'](function(_0x185104){if(_0x185104){_0x272cd0=_0x185104;_0x3f7fdc['model']=_[_0x47a5('0x40')](db[_0x47a5('0x6e')][_0x47a5('0x58')]);_0x3f7fdc[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x40b7a5[_0x47a5('0x3f')]);_0x3f7fdc[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],_0x3f7fdc[_0x47a5('0x3f')]);_0x578983[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],qs[_0x47a5('0x44')](_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x578983[_0x47a5('0x43')]=_0x578983['attributes'][_0x47a5('0x59')]?_0x578983[_0x47a5('0x43')]:_0x3f7fdc[_0x47a5('0x3d')];_0x578983[_0x47a5('0x47')]=qs['sort'](_0x40b7a5[_0x47a5('0x3f')]['sort']);_0x578983['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x40b7a5[_0x47a5('0x3f')],_0x3f7fdc[_0x47a5('0x41')]));if(_0x40b7a5['query'][_0x47a5('0x4b')]){_0x578983[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x578983[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x578983[_0x47a5('0x43')],function(_0x5eae8d){var _0x1da268={};_0x1da268[_0x5eae8d]={'$like':'%'+_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1da268;})});}_0x578983=_[_0x47a5('0x4c')]({},_0x578983,_0x40b7a5[_0x47a5('0x4e')]);return _0x272cd0['getApplications'](_0x578983);}})[_0x47a5('0x21')](function(_0x4c7627){if(_0x4c7627){_0x150cff=_0x4c7627[_0x47a5('0x59')];if(!_0x40b7a5['query'][_0x47a5('0x45')]('nolimit')){_0x578983['limit']=qs[_0x47a5('0x2e')](_0x40b7a5[_0x47a5('0x3f')]['limit']);_0x578983[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x40b7a5['query'][_0x47a5('0x2d')]);}return _0x272cd0[_0x47a5('0xaf')](_0x578983);}})[_0x47a5('0x21')](function(_0x508622){if(_0x508622){return _0x508622?{'count':_0x150cff,'rows':_0x508622}:null;}})[_0x47a5('0x21')](respondWithResult(_0x28e998,null))[_0x47a5('0x54')](handleError(_0x28e998,null));};exports[_0x47a5('0xb0')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={'raw':![],'where':{}};var _0x2678cb={};var _0x56808d={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x30b0f9['params']['id']}})['then'](handleEntityNotFound(_0x37721c,null))[_0x47a5('0x21')](function(_0x4997bc){if(_0x4997bc){_0x2678cb[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x95')][_0x47a5('0x58')]);_0x2678cb[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x30b0f9[_0x47a5('0x3f')]);_0x2678cb['filters']=_[_0x47a5('0x42')](_0x2678cb['model'],_0x2678cb[_0x47a5('0x3f')]);_0x5973d4[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x2678cb[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x5973d4[_0x47a5('0x43')]=_0x5973d4[_0x47a5('0x43')][_0x47a5('0x59')]?_0x5973d4[_0x47a5('0x43')]:_0x2678cb[_0x47a5('0x3d')];if(!_0x30b0f9['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x5973d4[_0x47a5('0x2e')]=qs['limit'](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x5973d4['order']=qs[_0x47a5('0x48')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x5973d4[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x30b0f9[_0x47a5('0x3f')],_0x2678cb[_0x47a5('0x41')]));_0x5973d4[_0x47a5('0x49')][_0x47a5('0x64')]=_0x4997bc['id'];if(_0x30b0f9['query']['filter']){_0x5973d4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x5973d4[_0x47a5('0x49')],{'$or':_['map'](_0x5973d4[_0x47a5('0x43')],function(_0x50b7fc){var _0x522345={};_0x522345[_0x50b7fc]={'$like':'%'+_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x522345;})});}_0x5973d4=_[_0x47a5('0x4c')]({},_0x5973d4,_0x30b0f9[_0x47a5('0x4e')]);return db['SmsInteraction'][_0x47a5('0x4f')]({'where':_0x5973d4[_0x47a5('0x49')]})['then'](function(_0x59ba59){_0x56808d['count']=_0x59ba59;if(_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x5973d4[_0x47a5('0x51')]=[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x47a5('0x35'),_0x47a5('0xb2'),_0x47a5('0xb3')],'required':![]},{'model':db[_0x47a5('0xb4')],'as':'Tags','attributes':['id',_0x47a5('0x35'),_0x47a5('0xb5')],'where':_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0xb6')]?{'id':_0x30b0f9['query']['tag']}:undefined,'required':_0x30b0f9['query'][_0x47a5('0xb6')]?!![]:![]}];}return db[_0x47a5('0x95')][_0x47a5('0x52')](_0x5973d4);})[_0x47a5('0x21')](function(_0x242006){_0x56808d[_0x47a5('0x53')]=_0x242006;return _0x56808d;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x37721c,_0x5973d4))[_0x47a5('0x54')](handleError(_0x37721c,null));};exports[_0x47a5('0x36')]=function(_0x5b48d0,_0x40fe75,_0x7b5348){var _0x50b482,_0x34ff37,_0x2bbf95;if(_[_0x47a5('0x8c')](_0x5b48d0[_0x47a5('0x61')]['body'])||_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x47a5('0x8c')](_0x5b48d0['body']['to'])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0xb7'));}_0x50b482=_0x5b48d0[_0x47a5('0x61')]['to'];return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x5b48d0[_0x47a5('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':{'mobile':_0x50b482},'limit':0x1,'order':[[_0x47a5('0x76'),_0x47a5('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x40fe75,null))['then'](function(_0x3222e4){if(_0x3222e4&&_0x3222e4['List']){_0x34ff37=_0x3222e4[_0x47a5('0x32')]({'plain':!![]});if(_0x34ff37['List']&&_0x34ff37[_0x47a5('0xb9')]['Contacts'][_0x47a5('0x59')]){return _0x34ff37[_0x47a5('0xb9')][_0x47a5('0x93')][0x0];}return db[_0x47a5('0x72')][_0x47a5('0x5b')](_[_0x47a5('0x16')](_0x5b48d0[_0x47a5('0x61')],{'firstName':_0x50b482,'mobile':_0x50b482,'phone':_0x50b482,'ListId':_0x34ff37[_0x47a5('0x77')]}));}})['then'](handleEntityNotFound(_0x40fe75,null))[_0x47a5('0x21')](function(_0x4394f0){if(_0x4394f0){_0x2bbf95=_0x4394f0;return db['SmsInteraction'][_0x47a5('0x5a')]({'where':{'ContactId':_0x2bbf95['id'],'closed':![],'SmsAccountId':_0x34ff37['id']}})[_0x47a5('0x21')](function(_0x54f283){if(_0x54f283){return[_0x54f283,![]];}return db['SmsInteraction'][_0x47a5('0x5b')]({'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id'],'SmsAccountId':_0x34ff37['id'],'phone':_0x50b482,'firstMsgDirection':_0x47a5('0xba'),'Messages':[_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0['body'][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'UserId':_0x5b48d0[_0x47a5('0x5c')]['id'],'ContactId':_0x2bbf95['id']})]},{'include':[{'model':db[_0x47a5('0x9a')],'as':_0x47a5('0xbb')}]})[_0x47a5('0x21')](function(_0x454609){return[_0x454609,!![]];});});}})[_0x47a5('0xbc')](function(_0x5c4301,_0x2bc0d8){if(_0x2bc0d8){return _0x5c4301;}return db[_0x47a5('0x9a')][_0x47a5('0x5b')](_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'SmsInteractionId':_0x5c4301['id'],'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id']}))['then'](function(_0x11d87b){_0x5c4301[_0x47a5('0xbd')][_0x47a5('0xbb')]=[];_0x5c4301['dataValues']['Messages'][_0x47a5('0xbe')](_0x11d87b[_0x47a5('0xbd')]);return _0x5c4301;});})[_0x47a5('0x21')](respondWithResult(_0x40fe75,null))[_0x47a5('0x54')](handleError(_0x40fe75,null));};exports[_0x47a5('0x2a')]=function(_0x4121c1,_0x2e0add,_0x58e85b){if(_0x4121c1[_0x47a5('0x61')]['id']){delete _0x4121c1[_0x47a5('0x61')]['id'];}console[_0x47a5('0xbf')]('endpoint\x20/status\x20POST\x20/',_0x4121c1[_0x47a5('0x61')]);var _0x611b40,_0x144bc9,_0x278b42;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x4121c1[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x9ced85){if(_0x9ced85){_0x278b42=_0x9ced85;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),'received\x20delivery\x20report\x20from',_0x9ced85[_0x47a5('0x3b')],util['inspect'](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x9ced85['type']){case _0x47a5('0x7b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc0')]&&_0x4121c1['body'][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1['body'][_0x47a5('0x2a')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['skebby_dispatch_id']}});}break;case _0x47a5('0x7d'):if(_0x4121c1['body']['requestid']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc2')]}});}break;case _0x47a5('0xc3'):if(_0x4121c1['body']['message_id']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')];return db[_0x47a5('0x9a')]['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0x7e')]}});}break;case _0x47a5('0x82'):var _0x50ff41=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x50ff41[_0x47a5('0x7a')]&&_0x50ff41['status'][_0x47a5('0xc5')]===_0x47a5('0xc6')){_0x144bc9=_0x50ff41[_0x47a5('0x2a')]['groupName'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x50ff41[_0x47a5('0x7a')]}});}break;case _0x47a5('0x87'):if(_0x4121c1[_0x47a5('0x61')]['messageId']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['messageId']}});}break;case _0x47a5('0x8b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc7')]&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')]['status'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x4ebe30){if(_0x4ebe30){_0x611b40=_0x4ebe30;switch(_0x278b42[_0x47a5('0x3b')]){case _0x47a5('0x7b'):if(_0x144bc9===_0x47a5('0xc6')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7d'):if(_0x144bc9==='1'){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc9')]&&_0x144bc9>=0xc8&&_0x144bc9<=0xce){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xc3'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x82'):var _0x2cc493=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x2cc493[_0x47a5('0x2a')][_0x47a5('0xc5')]===_0x47a5('0xc6')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),'infobip',util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x144bc9==_0x47a5('0xca')||_0x144bc9==_0x47a5('0xcb')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),'status',_0x47a5('0x87'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x8b'):if(_0x144bc9===_0x47a5('0xcc')||_0x144bc9===_0x47a5('0xcd')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),_0x47a5('0x8b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x611b40;}})[_0x47a5('0x21')](respondWithResult(_0x2e0add,null))[_0x47a5('0x54')](handleError(_0x2e0add,null));};exports[_0x47a5('0xce')]=function(_0x138b92,_0x232c36,_0x25954e){var _0x277061,_0x3917e0,_0x1c7695;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x138b92[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x46b82a){if(_0x46b82a){_0x1c7695=_0x46b82a;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xcf'),_0x46b82a[_0x47a5('0x3b')],util[_0x47a5('0xc8')](_0x138b92['query'],{'showHidden':![],'depth':null}));switch(_0x46b82a[_0x47a5('0x3b')]){case'csc':if(_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]&&_0x138b92['query'][_0x47a5('0xd1')]){_0x3917e0=_0x138b92['query'][_0x47a5('0xd1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x9a2f87){if(_0x9a2f87){_0x277061=_0x9a2f87;switch(_0x1c7695[_0x47a5('0x3b')]){case'csc':if(_0x3917e0==='2'||_0x3917e0==='6'){return _0x277061['update']({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),'csc',util[_0x47a5('0xc8')](_0x138b92[_0x47a5('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x277061;}})[_0x47a5('0x21')](respondWithResult(_0x232c36,null))['catch'](handleError(_0x232c36,null));};exports[_0x47a5('0xd2')]=function(_0x3136f9,_0x3ecc43,_0xf4b1df){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x3136f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x3ecc43,null))[_0x47a5('0x21')](function(_0xdc5eac){if(_0xdc5eac){return _0xdc5eac[_0x47a5('0xd2')](_0x3136f9['body'][_0x47a5('0x68')],_[_0x47a5('0xd3')](_0x3136f9[_0x47a5('0x61')],[_0x47a5('0x68'),'id'])||{})[_0x47a5('0xbc')](function(_0x4c2b0c){for(var _0xbe3a38=0x0;_0xbe3a38<_0x3136f9[_0x47a5('0x61')][_0x47a5('0x68')][_0x47a5('0x59')];_0xbe3a38+=0x1){socket[_0x47a5('0xd4')](_0x47a5('0xd5'),{'UserId':_0x3136f9['body'][_0x47a5('0x68')][_0xbe3a38],'SmsAccountId':_0x3136f9[_0x47a5('0x56')]['id']});}return _0x4c2b0c;});}})['then'](respondWithResult(_0x3ecc43,null))['catch'](handleError(_0x3ecc43,null));};exports[_0x47a5('0xd6')]=function(_0x32d299,_0x20d99b,_0x3964f8){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x32d299['params']['id']}})['then'](handleEntityNotFound(_0x20d99b,null))[_0x47a5('0x21')](function(_0xa3a516){if(_0xa3a516){return _0xa3a516['removeAgents'](_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')])['then'](function(){if(_[_0x47a5('0xd7')](_0x32d299['query']['ids'])){for(var _0x4aeaff=0x0;_0x4aeaff<_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')][_0x47a5('0x59')];_0x4aeaff+=0x1){socket['emit'](_0x47a5('0xd8'),{'UserId':Number(_0x32d299['query'][_0x47a5('0x68')][_0x4aeaff]),'SmsAccountId':Number(_0x32d299['params']['id'])});}}else{socket[_0x47a5('0xd4')](_0x47a5('0xd8'),{'UserId':Number(_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')]),'SmsAccountId':Number(_0x32d299[_0x47a5('0x56')]['id'])});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x20d99b,null))[_0x47a5('0x54')](handleError(_0x20d99b,null));};exports[_0x47a5('0xd9')]=function(_0x1396c2,_0x5c9091,_0x4f1e24){var _0x24c88e={};var _0xa859a={};var _0x5270cc;var _0x2a0f45;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1396c2[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x5c9091,null))[_0x47a5('0x21')](function(_0x969d4b){if(_0x969d4b){_0x5270cc=_0x969d4b;_0xa859a[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x9d')]['rawAttributes']);_0xa859a['query']=_['keys'](_0x1396c2['query']);_0xa859a[_0x47a5('0x41')]=_['intersection'](_0xa859a[_0x47a5('0x3d')],_0xa859a[_0x47a5('0x3f')]);_0x24c88e['attributes']=_[_0x47a5('0x42')](_0xa859a[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x24c88e[_0x47a5('0x43')]=_0x24c88e['attributes'][_0x47a5('0x59')]?_0x24c88e[_0x47a5('0x43')]:_0xa859a['model'];_0x24c88e[_0x47a5('0x47')]=qs['sort'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x24c88e[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x1396c2[_0x47a5('0x3f')],_0xa859a[_0x47a5('0x41')]));if(_0x1396c2['query'][_0x47a5('0x4b')]){_0x24c88e[_0x47a5('0x49')]=_['merge'](_0x24c88e[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x24c88e['attributes'],function(_0x14c968){var _0x5a7920={};_0x5a7920[_0x14c968]={'$like':'%'+_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x5a7920;})});}_0x24c88e=_[_0x47a5('0x4c')]({},_0x24c88e,_0x1396c2[_0x47a5('0x4e')]);return _0x5270cc[_0x47a5('0xd9')](_0x24c88e);}})['then'](function(_0x4b8b65){if(_0x4b8b65){_0x2a0f45=_0x4b8b65[_0x47a5('0x59')];if(!_0x1396c2['query']['hasOwnProperty']('nolimit')){_0x24c88e[_0x47a5('0x2e')]=qs['limit'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x24c88e[_0x47a5('0x2d')]=qs['offset'](_0x1396c2['query'][_0x47a5('0x2d')]);}return _0x5270cc['getAgents'](_0x24c88e);}})['then'](function(_0xe87e6e){if(_0xe87e6e){return _0xe87e6e?{'count':_0x2a0f45,'rows':_0xe87e6e}:null;}})['then'](respondWithResult(_0x5c9091,null))['catch'](handleError(_0x5c9091,null));};
\ No newline at end of file
+var _0x7a54=['findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','log','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','SmsAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','Body','messageId','skebby','from','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','SmsInteraction','interaction','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a ','addApplications','sequelize','bulkCreate'];(function(_0x5a7a1a,_0x3eede2){var _0x4fd198=function(_0x1d1329){while(--_0x1d1329){_0x5a7a1a['push'](_0x5a7a1a['shift']());}};_0x4fd198(++_0x3eede2);}(_0x7a54,0x106));var _0x47a5=function(_0x4b703a,_0x22c54f){_0x4b703a=_0x4b703a-0x0;var _0x2823e5=_0x7a54[_0x4b703a];return _0x2823e5;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086='SmsAccounts';return db[_0x47a5('0x33')]['destroy']({'where':{'type':_0x50c086,'resourceId':_0x52749b['id']}})[_0x47a5('0x21')](function(){return _0x403028;});})['then'](function(){_0x274e34[_0x47a5('0x2a')](0xcc)[_0x47a5('0x2b')]();});}};}function handleEntityNotFound(_0x38c8d4,_0x199698){return function(_0x36add5){if(!_0x36add5){_0x38c8d4[_0x47a5('0x29')](0x194);}return _0x36add5;};}function handleError(_0xee582c,_0x452be5){_0x452be5=_0x452be5||0x1f4;return function(_0x1a0d23){logger['error'](_0x1a0d23[_0x47a5('0x34')]);if(_0x1a0d23[_0x47a5('0x35')]){delete _0x1a0d23['name'];}_0xee582c[_0x47a5('0x2a')](_0x452be5)[_0x47a5('0x36')](_0x1a0d23);};}exports[_0x47a5('0x37')]=function(_0x49c4b5,_0x101f70){var _0x10f660={'include':[{'model':db[_0x47a5('0x38')],'as':'mandatoryDispositionPause'}]},_0x596097={},_0x2ebba0={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x39')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x3a')],'type':_0x9b5eaf[_0x47a5('0x3b')][_0x47a5('0x3c')]};});_0x596097[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x55c5eb,_0x47a5('0x35'));_0x596097[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3f')]);_0x596097[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],_0x596097['query']);_0x10f660[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x49c4b5['query'][_0x47a5('0x44')]));_0x10f660['attributes']=_0x10f660['attributes']['length']?_0x10f660['attributes']:_0x596097[_0x47a5('0x3d')];if(!_0x49c4b5['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x10f660[_0x47a5('0x2e')]=qs['limit'](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x10f660['offset']=qs['offset'](_0x49c4b5[_0x47a5('0x3f')]['offset']);}_0x10f660[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x10f660[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x49c4b5[_0x47a5('0x3f')],_0x596097[_0x47a5('0x41')]),_0x55c5eb);if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x4b')]){_0x10f660[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x10f660[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x55c5eb,function(_0x3a2b38){if(_0x3a2b38['type']!==_0x47a5('0x4d')){var _0x23bb04={};_0x23bb04[_0x3a2b38['name']]={'$like':'%'+_0x49c4b5['query'][_0x47a5('0x4b')]+'%'};return _0x23bb04;}})});}_0x10f660=_['merge']({},_0x10f660,_0x49c4b5[_0x47a5('0x4e')]);var _0xd93e37={'where':_0x10f660['where']};return db['SmsAccount'][_0x47a5('0x4f')](_0xd93e37)['then'](function(_0x2d147c){_0x2ebba0[_0x47a5('0x4f')]=_0x2d147c;if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x10f660[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x39')][_0x47a5('0x52')](_0x10f660);})['then'](function(_0x48a0ef){_0x2ebba0[_0x47a5('0x53')]=_0x48a0ef;return _0x2ebba0;})[_0x47a5('0x21')](respondWithFilteredResult(_0x101f70,_0x10f660))[_0x47a5('0x54')](handleError(_0x101f70,null));};exports[_0x47a5('0x55')]=function(_0x2c7020,_0x2c0c86){var _0x249de5={'raw':![],'where':{'id':_0x2c7020[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]},_0x492cf7={};_0x492cf7['model']=_[_0x47a5('0x40')](db['SmsAccount'][_0x47a5('0x58')]);_0x492cf7[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2c7020[_0x47a5('0x3f')]);_0x492cf7['filters']=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],_0x492cf7[_0x47a5('0x3f')]);_0x249de5[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x2c7020['query'][_0x47a5('0x44')]));_0x249de5[_0x47a5('0x43')]=_0x249de5[_0x47a5('0x43')][_0x47a5('0x59')]?_0x249de5[_0x47a5('0x43')]:_0x492cf7[_0x47a5('0x3d')];if(_0x2c7020['query'][_0x47a5('0x50')]){_0x249de5[_0x47a5('0x51')]=[{'all':!![]}];}_0x249de5=_[_0x47a5('0x4c')]({},_0x249de5,_0x2c7020['options']);return db[_0x47a5('0x39')][_0x47a5('0x5a')](_0x249de5)[_0x47a5('0x21')](handleEntityNotFound(_0x2c0c86,null))['then'](respondWithResult(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};exports[_0x47a5('0x5b')]=function(_0x376e1d,_0x4fa1da){return db['SmsAccount'][_0x47a5('0x5b')](_0x376e1d['body'],{})[_0x47a5('0x21')](function(_0x5d383d){var _0x482de6=_0x376e1d[_0x47a5('0x5c')][_0x47a5('0x32')]({'plain':!![]});if(!_0x482de6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482de6[_0x47a5('0x5d')]===_0x47a5('0x5c')){var _0x4b706a=_0x5d383d['get']({'plain':!![]});var _0x16b4fd=_0x47a5('0x5e');return db[_0x47a5('0x5f')][_0x47a5('0x5a')]({'where':{'name':_0x16b4fd,'userProfileId':_0x482de6['userProfileId']},'raw':!![]})[_0x47a5('0x21')](function(_0x2b4255){if(_0x2b4255&&_0x2b4255[_0x47a5('0x60')]===0x0){return db['UserProfileResource'][_0x47a5('0x5b')]({'name':_0x4b706a['name'],'resourceId':_0x4b706a['id'],'type':_0x2b4255[_0x47a5('0x35')],'sectionId':_0x2b4255['id']},{})[_0x47a5('0x21')](function(){return _0x5d383d;});}else{return _0x5d383d;}})[_0x47a5('0x54')](function(_0x1c485b){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c485b);throw _0x1c485b;});}return _0x5d383d;})[_0x47a5('0x21')](respondWithResult(_0x4fa1da,0xc9))['catch'](handleError(_0x4fa1da,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')]['find']({'where':{'id':_0x5eb150['params']['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x54')](handleError(_0x4f8564,null));};exports['destroy']=function(_0x22c886,_0x274d31){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x22c886[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x274d31,null))[_0x47a5('0x21')](removeEntity(_0x274d31,null))[_0x47a5('0x54')](handleError(_0x274d31,null));};exports[_0x47a5('0x62')]=function(_0x35cca8,_0x3ac38c){return db['SmsAccount'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x3ac38c,null))[_0x47a5('0x54')](handleError(_0x3ac38c,null));};exports[_0x47a5('0x63')]=function(_0x396cb0,_0x4bbe14,_0xbec033){if(_0x396cb0[_0x47a5('0x61')]['id']){delete _0x396cb0[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x396cb0[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x21')](function(_0x350af8){if(_0x350af8){_0x396cb0[_0x47a5('0x61')][_0x47a5('0x64')]=_0x350af8['id'];return db[_0x47a5('0x65')][_0x47a5('0x5b')](_0x396cb0[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x4bbe14,null))['catch'](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x284fb8,_0x30504e,_0x4b42f3){var _0x37ac59={'raw':![],'where':{}};var _0x2e46af={};var _0x36c67={'count':0x0,'rows':[]};return db[_0x47a5('0x39')]['findOne']({'where':{'id':_0x284fb8[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x30504e,null))[_0x47a5('0x21')](function(_0x487e21){if(_0x487e21){_0x2e46af[_0x47a5('0x3d')]=_['keys'](db[_0x47a5('0x65')][_0x47a5('0x58')]);_0x2e46af[_0x47a5('0x3f')]=_['keys'](_0x284fb8['query']);_0x2e46af['filters']=_[_0x47a5('0x42')](_0x2e46af[_0x47a5('0x3d')],_0x2e46af[_0x47a5('0x3f')]);_0x37ac59[_0x47a5('0x43')]=_['intersection'](_0x2e46af[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x37ac59[_0x47a5('0x43')]=_0x37ac59[_0x47a5('0x43')][_0x47a5('0x59')]?_0x37ac59[_0x47a5('0x43')]:_0x2e46af[_0x47a5('0x3d')];if(!_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x45')](_0x47a5('0x46'))){_0x37ac59['limit']=qs[_0x47a5('0x2e')](_0x284fb8['query'][_0x47a5('0x2e')]);_0x37ac59[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x37ac59[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x37ac59[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x284fb8[_0x47a5('0x3f')],_0x2e46af[_0x47a5('0x41')]));_0x37ac59[_0x47a5('0x49')]['SmsAccountId']=_0x487e21['id'];if(_0x284fb8['query']['filter']){_0x37ac59['where']=_[_0x47a5('0x4c')](_0x37ac59[_0x47a5('0x49')],{'$or':_['map'](_0x37ac59[_0x47a5('0x43')],function(_0x44dda2){var _0x1baa5a={};_0x1baa5a[_0x44dda2]={'$like':'%'+_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1baa5a;})});}_0x37ac59=_[_0x47a5('0x4c')]({},_0x37ac59,_0x284fb8[_0x47a5('0x4e')]);return db[_0x47a5('0x65')][_0x47a5('0x4f')]({'where':_0x37ac59[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x5e5f16){_0x36c67[_0x47a5('0x4f')]=_0x5e5f16;if(_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x37ac59['include']=[{'all':!![]}];}return db[_0x47a5('0x65')][_0x47a5('0x52')](_0x37ac59);})[_0x47a5('0x21')](function(_0x5d41d8){_0x36c67[_0x47a5('0x53')]=_0x5d41d8;return _0x36c67;});}})['then'](respondWithFilteredResult(_0x30504e,_0x37ac59))['catch'](handleError(_0x30504e,null));};exports[_0x47a5('0x67')]=function(_0x292d9c,_0x277486,_0x27333e){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x292d9c['params']['id']}})['then'](handleEntityNotFound(_0x277486,null))[_0x47a5('0x21')](function(_0x4f2361){if(_0x4f2361){return _0x4f2361[_0x47a5('0x67')](_0x292d9c[_0x47a5('0x3f')][_0x47a5('0x68')]);}})[_0x47a5('0x21')](respondWithStatusCode(_0x277486,null))['catch'](handleError(_0x277486,null));};exports[_0x47a5('0x69')]=function(_0x550bde,_0x5f3a04,_0x139c79){if(_0x550bde[_0x47a5('0x61')]['id']){delete _0x550bde['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x550bde[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f3a04,null))[_0x47a5('0x21')](function(_0x578e27){if(_0x578e27){_0x550bde[_0x47a5('0x61')][_0x47a5('0x64')]=_0x578e27['id'];return db[_0x47a5('0x6a')]['create'](_0x550bde[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x5f3a04,null))[_0x47a5('0x54')](handleError(_0x5f3a04,null));};exports['getAnswers']=function(_0x3525e7,_0x4f2fbb,_0x3c012b){var _0x491bb4={'raw':![],'where':{}};var _0x135d2e={};var _0x20d8bd={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x3525e7['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f2fbb,null))[_0x47a5('0x21')](function(_0x23c393){if(_0x23c393){_0x135d2e[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db['CannedAnswer']['rawAttributes']);_0x135d2e[_0x47a5('0x3f')]=_['keys'](_0x3525e7[_0x47a5('0x3f')]);_0x135d2e[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x135d2e['model'],_0x135d2e[_0x47a5('0x3f')]);_0x491bb4[_0x47a5('0x43')]=_['intersection'](_0x135d2e[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x491bb4['attributes']=_0x491bb4['attributes'][_0x47a5('0x59')]?_0x491bb4[_0x47a5('0x43')]:_0x135d2e['model'];if(!_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x45')]('nolimit')){_0x491bb4[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3525e7[_0x47a5('0x3f')]['limit']);_0x491bb4[_0x47a5('0x2d')]=qs['offset'](_0x3525e7[_0x47a5('0x3f')]['offset']);}_0x491bb4[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x3525e7['query'][_0x47a5('0x48')]);_0x491bb4['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x3525e7[_0x47a5('0x3f')],_0x135d2e[_0x47a5('0x41')]));_0x491bb4['where'][_0x47a5('0x64')]=_0x23c393['id'];if(_0x3525e7['query']['filter']){_0x491bb4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x491bb4[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x491bb4[_0x47a5('0x43')],function(_0x5b1f5e){var _0x1522a6={};_0x1522a6[_0x5b1f5e]={'$like':'%'+_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1522a6;})});}_0x491bb4=_[_0x47a5('0x4c')]({},_0x491bb4,_0x3525e7['options']);return db[_0x47a5('0x6a')]['count']({'where':_0x491bb4[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x3f93f0){_0x20d8bd[_0x47a5('0x4f')]=_0x3f93f0;if(_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x491bb4[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x6a')][_0x47a5('0x52')](_0x491bb4);})['then'](function(_0x36796e){_0x20d8bd[_0x47a5('0x53')]=_0x36796e;return _0x20d8bd;});}})['then'](respondWithFilteredResult(_0x4f2fbb,_0x491bb4))[_0x47a5('0x54')](handleError(_0x4f2fbb,null));};exports[_0x47a5('0x6c')]=function(_0x6d6a5,_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x6d6a5['params']['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x21')](function(_0x17f82d){if(_0x17f82d){return _0x17f82d['removeAnswers'](_0x6d6a5[_0x47a5('0x3f')][_0x47a5('0x68')]);}})['then'](respondWithStatusCode(_0x5b85cd,null))[_0x47a5('0x54')](handleError(_0x5b85cd,null));};exports[_0x47a5('0x6d')]=function(_0x109805,_0x70c8a6,_0x364bb0){var _0x1371e4={'channel':'sms'};var _0x4c9894=[];var _0x5bd86e=[];var _0x133b7a={};return db[_0x47a5('0x39')]['find']({'where':{'id':_0x109805[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6f')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x5084d6){_0x1371e4[_0x47a5('0x70')]=_0x5084d6;_0x1371e4['applications']=_['orderBy'](_0x5084d6['Applications'],[_0x47a5('0x71')],['asc']);if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x6f')]){delete _0x1371e4[_0x47a5('0x70')]['Applications'];}return db[_0x47a5('0x72')][_0x47a5('0x62')]();})[_0x47a5('0x21')](function(_0x121750){if(!_0x121750){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x73'));}_0x4c9894=_[_0x47a5('0x74')](_['keys'](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76')]);_0x5bd86e=_[_0x47a5('0x74')](_[_0x47a5('0x40')](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76'),'CompanyId',_0x47a5('0x77')]);_0x1371e4[_0x47a5('0x61')]={'mapKey':'mobile'};if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){switch(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){case'twilio':_0x1371e4['body']['from']=_0x109805['body'][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x79')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['MessageSid'];break;case _0x47a5('0x7b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['sender'];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body']['text'];break;case _0x47a5('0x7d'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805[_0x47a5('0x61')][_0x47a5('0x28')];break;case'clicksend':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x61')];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7e')];break;case _0x47a5('0x7f'):_0x1371e4['body'][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x80')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x81')];break;case _0x47a5('0x82'):_0x1371e4['body'][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['results'][0x0][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0]['text'];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0][_0x47a5('0x7a')];break;case _0x47a5('0x84'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805['body'][_0x47a5('0x85')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x86')][_0x47a5('0x28')];break;case _0x47a5('0x87'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x88')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805['body'][_0x47a5('0x89')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x8a')];break;case _0x47a5('0x8b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805['body'][_0x47a5('0x7c')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')]['message'];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['refid'];break;}}if(_0x1371e4[_0x47a5('0x61')]['id']){delete _0x1371e4[_0x47a5('0x61')]['id'];}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')]['from'])){throw new db[(_0x47a5('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x1371e4[_0x47a5('0x61')]['body'])||_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8f')+_0x5bd86e);}if(!_[_0x47a5('0x90')](_0x5bd86e,_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x91')+_0x5bd86e);}_0x133b7a[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db[_0x47a5('0x92')]['find']({'where':{'id':_0x1371e4[_0x47a5('0x70')]['ListId']},'include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':_0x133b7a,'limit':0x1,'order':[[_0x47a5('0x76'),'DESC']]}]});})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x14771b){if(_0x14771b){_0x1371e4['list']=_['omit'](_0x14771b,[_0x47a5('0x93')]);if(_0x14771b[_0x47a5('0x93')][_0x47a5('0x59')]){return _0x14771b[_0x47a5('0x93')][0x0];}var _0x204bd6=_['defaults'](_0x1371e4[_0x47a5('0x61')],{'firstName':_0x1371e4['body'][_0x47a5('0x7c')],'ListId':_0x14771b['id']});_0x204bd6[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db['CmContact'][_0x47a5('0x5b')](_0x204bd6,{'fields':_0x4c9894,'raw':!![]});}})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x4339d4){if(_0x4339d4){_0x1371e4[_0x47a5('0x94')]=_0x4339d4;var _0x36a44c={'ContactId':_0x4339d4['id'],'phone':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')],'SmsAccountId':_0x109805[_0x47a5('0x56')]['id']};var _0x481bc3={'ContactId':_0x4339d4['id'],'SmsAccountId':_0x109805['params']['id'],'closed':![]};return db[_0x47a5('0x95')]['find']({'where':_0x481bc3})[_0x47a5('0x21')](function(_0x2d0b67){if(_0x2d0b67){return[_0x2d0b67,![]];}return db[_0x47a5('0x95')]['create'](_0x36a44c)[_0x47a5('0x21')](function(_0x26d629){return[_0x26d629,!![]];});});}})['spread'](function(_0xcb6714,_0x51f6cf){_0x1371e4[_0x47a5('0x96')]=_0xcb6714[_0x47a5('0x32')]({'plain':!![]});_0x1371e4[_0x47a5('0x96')]['created']=![];if(_0x51f6cf){if(_0x1371e4['account']['autoclose']){_0x1371e4['applications']['push']({'id':0x0,'priority':_0x1371e4[_0x47a5('0x97')]['length']+0x1,'app':_0x47a5('0x98'),'appdata':_0x47a5('0x99'),'interval':'*,*,*,*'});}_0x1371e4['interaction']['created']=!![];}return db[_0x47a5('0x9a')]['create']({'phone':_0x1371e4['body']['from'],'messageId':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')],'body':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')],'SmsAccountId':_0x109805['params']['id'],'SmsInteractionId':_0xcb6714['id'],'direction':'in','ContactId':_0xcb6714[_0x47a5('0x9b')],'AttachmentId':_0x1371e4['body'][_0x47a5('0x9c')]});})['then'](function(_0x2de924){_0x1371e4[_0x47a5('0x28')]=_0x2de924;if(_0x1371e4[_0x47a5('0x96')]['UserId']){return db[_0x47a5('0x9d')][_0x47a5('0x5a')]({'attributes':['id',_0x47a5('0x35')],'where':{'id':_0x1371e4[_0x47a5('0x96')]['UserId']}})[_0x47a5('0x21')](function(_0x9a7edc){if(_0x9a7edc){_0x1371e4[_0x47a5('0x97')][_0x47a5('0x9e')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x9f'),'appdata':_0x9a7edc[_0x47a5('0x35')]+','+(_0x1371e4['account'][_0x47a5('0xa0')]||0xa),'interval':_0x47a5('0xa1')});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);})[_0x47a5('0x21')](function(_0x2697df){if(_0x2697df){var _0x408887=0xc8;var _0x34fde3=_0x47a5('0xa4');logger[_0x47a5('0x22')](_0x47a5('0x25'),_0x34fde3,_0x408887,_0x47a5('0xa5'));logger[_0x47a5('0xa6')](_0x47a5('0xa7'),_0x34fde3,_0x408887,_0x47a5('0xa5'),JSON['stringify'](_0x2697df));if(_0x1371e4[_0x47a5('0x70')]['type']==='twilio'){return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0xa8')](_0x47a5('0xa9'),'text/xml')[_0x47a5('0x36')](_0x47a5('0xaa'));}else{return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0x2c')](_0x2697df);}}})[_0x47a5('0x54')](handleError(_0x70c8a6,null));};exports[_0x47a5('0xab')]=function(_0x1b1f86,_0x46cb3a,_0x176e71){return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1b1f86[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46cb3a,null))['then'](function(_0x4aad5f){if(_0x4aad5f){return db[_0x47a5('0xac')]['transaction'](function(_0x249339){return db[_0x47a5('0x6e')][_0x47a5('0x31')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'transaction':_0x249339})[_0x47a5('0x21')](function(_0x3708ea){var _0x583b37=_[_0x47a5('0x3e')](_0x1b1f86[_0x47a5('0x61')],function(_0x380eca){_0x380eca['SmsAccountId']=_0x1b1f86[_0x47a5('0x56')]['id'];return _0x380eca;});return db[_0x47a5('0x6e')][_0x47a5('0xad')](_0x583b37,{'transaction':_0x249339});});})[_0x47a5('0x21')](function(){return db[_0x47a5('0x6e')][_0x47a5('0xae')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'order':_0x47a5('0x71')});});}})[_0x47a5('0x21')](respondWithResult(_0x46cb3a,null))[_0x47a5('0x54')](handleError(_0x46cb3a,null));};exports[_0x47a5('0xaf')]=function(_0x40b7a5,_0x28e998,_0x2ac386){var _0x578983={};var _0x3f7fdc={};var _0x272cd0;var _0x150cff;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x40b7a5[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x28e998,null))['then'](function(_0x185104){if(_0x185104){_0x272cd0=_0x185104;_0x3f7fdc['model']=_[_0x47a5('0x40')](db[_0x47a5('0x6e')][_0x47a5('0x58')]);_0x3f7fdc[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x40b7a5[_0x47a5('0x3f')]);_0x3f7fdc[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],_0x3f7fdc[_0x47a5('0x3f')]);_0x578983[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],qs[_0x47a5('0x44')](_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x578983[_0x47a5('0x43')]=_0x578983['attributes'][_0x47a5('0x59')]?_0x578983[_0x47a5('0x43')]:_0x3f7fdc[_0x47a5('0x3d')];_0x578983[_0x47a5('0x47')]=qs['sort'](_0x40b7a5[_0x47a5('0x3f')]['sort']);_0x578983['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x40b7a5[_0x47a5('0x3f')],_0x3f7fdc[_0x47a5('0x41')]));if(_0x40b7a5['query'][_0x47a5('0x4b')]){_0x578983[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x578983[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x578983[_0x47a5('0x43')],function(_0x5eae8d){var _0x1da268={};_0x1da268[_0x5eae8d]={'$like':'%'+_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1da268;})});}_0x578983=_[_0x47a5('0x4c')]({},_0x578983,_0x40b7a5[_0x47a5('0x4e')]);return _0x272cd0['getApplications'](_0x578983);}})[_0x47a5('0x21')](function(_0x4c7627){if(_0x4c7627){_0x150cff=_0x4c7627[_0x47a5('0x59')];if(!_0x40b7a5['query'][_0x47a5('0x45')]('nolimit')){_0x578983['limit']=qs[_0x47a5('0x2e')](_0x40b7a5[_0x47a5('0x3f')]['limit']);_0x578983[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x40b7a5['query'][_0x47a5('0x2d')]);}return _0x272cd0[_0x47a5('0xaf')](_0x578983);}})[_0x47a5('0x21')](function(_0x508622){if(_0x508622){return _0x508622?{'count':_0x150cff,'rows':_0x508622}:null;}})[_0x47a5('0x21')](respondWithResult(_0x28e998,null))[_0x47a5('0x54')](handleError(_0x28e998,null));};exports[_0x47a5('0xb0')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={'raw':![],'where':{}};var _0x2678cb={};var _0x56808d={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x30b0f9['params']['id']}})['then'](handleEntityNotFound(_0x37721c,null))[_0x47a5('0x21')](function(_0x4997bc){if(_0x4997bc){_0x2678cb[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x95')][_0x47a5('0x58')]);_0x2678cb[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x30b0f9[_0x47a5('0x3f')]);_0x2678cb['filters']=_[_0x47a5('0x42')](_0x2678cb['model'],_0x2678cb[_0x47a5('0x3f')]);_0x5973d4[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x2678cb[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x5973d4[_0x47a5('0x43')]=_0x5973d4[_0x47a5('0x43')][_0x47a5('0x59')]?_0x5973d4[_0x47a5('0x43')]:_0x2678cb[_0x47a5('0x3d')];if(!_0x30b0f9['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x5973d4[_0x47a5('0x2e')]=qs['limit'](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x5973d4['order']=qs[_0x47a5('0x48')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x5973d4[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x30b0f9[_0x47a5('0x3f')],_0x2678cb[_0x47a5('0x41')]));_0x5973d4[_0x47a5('0x49')][_0x47a5('0x64')]=_0x4997bc['id'];if(_0x30b0f9['query']['filter']){_0x5973d4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x5973d4[_0x47a5('0x49')],{'$or':_['map'](_0x5973d4[_0x47a5('0x43')],function(_0x50b7fc){var _0x522345={};_0x522345[_0x50b7fc]={'$like':'%'+_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x522345;})});}_0x5973d4=_[_0x47a5('0x4c')]({},_0x5973d4,_0x30b0f9[_0x47a5('0x4e')]);return db['SmsInteraction'][_0x47a5('0x4f')]({'where':_0x5973d4[_0x47a5('0x49')]})['then'](function(_0x59ba59){_0x56808d['count']=_0x59ba59;if(_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x5973d4[_0x47a5('0x51')]=[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x47a5('0x35'),_0x47a5('0xb2'),_0x47a5('0xb3')],'required':![]},{'model':db[_0x47a5('0xb4')],'as':'Tags','attributes':['id',_0x47a5('0x35'),_0x47a5('0xb5')],'where':_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0xb6')]?{'id':_0x30b0f9['query']['tag']}:undefined,'required':_0x30b0f9['query'][_0x47a5('0xb6')]?!![]:![]}];}return db[_0x47a5('0x95')][_0x47a5('0x52')](_0x5973d4);})[_0x47a5('0x21')](function(_0x242006){_0x56808d[_0x47a5('0x53')]=_0x242006;return _0x56808d;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x37721c,_0x5973d4))[_0x47a5('0x54')](handleError(_0x37721c,null));};exports[_0x47a5('0x36')]=function(_0x5b48d0,_0x40fe75,_0x7b5348){var _0x50b482,_0x34ff37,_0x2bbf95;if(_[_0x47a5('0x8c')](_0x5b48d0[_0x47a5('0x61')]['body'])||_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x47a5('0x8c')](_0x5b48d0['body']['to'])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0xb7'));}_0x50b482=_0x5b48d0[_0x47a5('0x61')]['to'];return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x5b48d0[_0x47a5('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':{'mobile':_0x50b482},'limit':0x1,'order':[[_0x47a5('0x76'),_0x47a5('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x40fe75,null))['then'](function(_0x3222e4){if(_0x3222e4&&_0x3222e4['List']){_0x34ff37=_0x3222e4[_0x47a5('0x32')]({'plain':!![]});if(_0x34ff37['List']&&_0x34ff37[_0x47a5('0xb9')]['Contacts'][_0x47a5('0x59')]){return _0x34ff37[_0x47a5('0xb9')][_0x47a5('0x93')][0x0];}return db[_0x47a5('0x72')][_0x47a5('0x5b')](_[_0x47a5('0x16')](_0x5b48d0[_0x47a5('0x61')],{'firstName':_0x50b482,'mobile':_0x50b482,'phone':_0x50b482,'ListId':_0x34ff37[_0x47a5('0x77')]}));}})['then'](handleEntityNotFound(_0x40fe75,null))[_0x47a5('0x21')](function(_0x4394f0){if(_0x4394f0){_0x2bbf95=_0x4394f0;return db['SmsInteraction'][_0x47a5('0x5a')]({'where':{'ContactId':_0x2bbf95['id'],'closed':![],'SmsAccountId':_0x34ff37['id']}})[_0x47a5('0x21')](function(_0x54f283){if(_0x54f283){return[_0x54f283,![]];}return db['SmsInteraction'][_0x47a5('0x5b')]({'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id'],'SmsAccountId':_0x34ff37['id'],'phone':_0x50b482,'firstMsgDirection':_0x47a5('0xba'),'Messages':[_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0['body'][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'UserId':_0x5b48d0[_0x47a5('0x5c')]['id'],'ContactId':_0x2bbf95['id']})]},{'include':[{'model':db[_0x47a5('0x9a')],'as':_0x47a5('0xbb')}]})[_0x47a5('0x21')](function(_0x454609){return[_0x454609,!![]];});});}})[_0x47a5('0xbc')](function(_0x5c4301,_0x2bc0d8){if(_0x2bc0d8){return _0x5c4301;}return db[_0x47a5('0x9a')][_0x47a5('0x5b')](_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'SmsInteractionId':_0x5c4301['id'],'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id']}))['then'](function(_0x11d87b){_0x5c4301[_0x47a5('0xbd')][_0x47a5('0xbb')]=[];_0x5c4301['dataValues']['Messages'][_0x47a5('0xbe')](_0x11d87b[_0x47a5('0xbd')]);return _0x5c4301;});})[_0x47a5('0x21')](respondWithResult(_0x40fe75,null))[_0x47a5('0x54')](handleError(_0x40fe75,null));};exports[_0x47a5('0x2a')]=function(_0x4121c1,_0x2e0add,_0x58e85b){if(_0x4121c1[_0x47a5('0x61')]['id']){delete _0x4121c1[_0x47a5('0x61')]['id'];}console[_0x47a5('0xbf')]('endpoint\x20/status\x20POST\x20/',_0x4121c1[_0x47a5('0x61')]);var _0x611b40,_0x144bc9,_0x278b42;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x4121c1[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x9ced85){if(_0x9ced85){_0x278b42=_0x9ced85;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),'received\x20delivery\x20report\x20from',_0x9ced85[_0x47a5('0x3b')],util['inspect'](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x9ced85['type']){case _0x47a5('0x7b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc0')]&&_0x4121c1['body'][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1['body'][_0x47a5('0x2a')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['skebby_dispatch_id']}});}break;case _0x47a5('0x7d'):if(_0x4121c1['body']['requestid']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc2')]}});}break;case _0x47a5('0xc3'):if(_0x4121c1['body']['message_id']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')];return db[_0x47a5('0x9a')]['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0x7e')]}});}break;case _0x47a5('0x82'):var _0x50ff41=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x50ff41[_0x47a5('0x7a')]&&_0x50ff41['status'][_0x47a5('0xc5')]===_0x47a5('0xc6')){_0x144bc9=_0x50ff41[_0x47a5('0x2a')]['groupName'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x50ff41[_0x47a5('0x7a')]}});}break;case _0x47a5('0x87'):if(_0x4121c1[_0x47a5('0x61')]['messageId']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['messageId']}});}break;case _0x47a5('0x8b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc7')]&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')]['status'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x4ebe30){if(_0x4ebe30){_0x611b40=_0x4ebe30;switch(_0x278b42[_0x47a5('0x3b')]){case _0x47a5('0x7b'):if(_0x144bc9===_0x47a5('0xc6')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7d'):if(_0x144bc9==='1'){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc9')]&&_0x144bc9>=0xc8&&_0x144bc9<=0xce){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xc3'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x82'):var _0x2cc493=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x2cc493[_0x47a5('0x2a')][_0x47a5('0xc5')]===_0x47a5('0xc6')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),'infobip',util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x144bc9==_0x47a5('0xca')||_0x144bc9==_0x47a5('0xcb')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),'status',_0x47a5('0x87'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x8b'):if(_0x144bc9===_0x47a5('0xcc')||_0x144bc9===_0x47a5('0xcd')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),_0x47a5('0x8b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x611b40;}})[_0x47a5('0x21')](respondWithResult(_0x2e0add,null))[_0x47a5('0x54')](handleError(_0x2e0add,null));};exports[_0x47a5('0xce')]=function(_0x138b92,_0x232c36,_0x25954e){var _0x277061,_0x3917e0,_0x1c7695;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x138b92[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x46b82a){if(_0x46b82a){_0x1c7695=_0x46b82a;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xcf'),_0x46b82a[_0x47a5('0x3b')],util[_0x47a5('0xc8')](_0x138b92['query'],{'showHidden':![],'depth':null}));switch(_0x46b82a[_0x47a5('0x3b')]){case'csc':if(_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]&&_0x138b92['query'][_0x47a5('0xd1')]){_0x3917e0=_0x138b92['query'][_0x47a5('0xd1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x9a2f87){if(_0x9a2f87){_0x277061=_0x9a2f87;switch(_0x1c7695[_0x47a5('0x3b')]){case'csc':if(_0x3917e0==='2'||_0x3917e0==='6'){return _0x277061['update']({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),'csc',util[_0x47a5('0xc8')](_0x138b92[_0x47a5('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x277061;}})[_0x47a5('0x21')](respondWithResult(_0x232c36,null))['catch'](handleError(_0x232c36,null));};exports[_0x47a5('0xd2')]=function(_0x3136f9,_0x3ecc43,_0xf4b1df){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x3136f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x3ecc43,null))[_0x47a5('0x21')](function(_0xdc5eac){if(_0xdc5eac){return _0xdc5eac[_0x47a5('0xd2')](_0x3136f9['body'][_0x47a5('0x68')],_[_0x47a5('0xd3')](_0x3136f9[_0x47a5('0x61')],[_0x47a5('0x68'),'id'])||{})[_0x47a5('0xbc')](function(_0x4c2b0c){for(var _0xbe3a38=0x0;_0xbe3a38<_0x3136f9[_0x47a5('0x61')][_0x47a5('0x68')][_0x47a5('0x59')];_0xbe3a38+=0x1){socket[_0x47a5('0xd4')](_0x47a5('0xd5'),{'UserId':_0x3136f9['body'][_0x47a5('0x68')][_0xbe3a38],'SmsAccountId':_0x3136f9[_0x47a5('0x56')]['id']});}return _0x4c2b0c;});}})['then'](respondWithResult(_0x3ecc43,null))['catch'](handleError(_0x3ecc43,null));};exports[_0x47a5('0xd6')]=function(_0x32d299,_0x20d99b,_0x3964f8){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x32d299['params']['id']}})['then'](handleEntityNotFound(_0x20d99b,null))[_0x47a5('0x21')](function(_0xa3a516){if(_0xa3a516){return _0xa3a516['removeAgents'](_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')])['then'](function(){if(_[_0x47a5('0xd7')](_0x32d299['query']['ids'])){for(var _0x4aeaff=0x0;_0x4aeaff<_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')][_0x47a5('0x59')];_0x4aeaff+=0x1){socket['emit'](_0x47a5('0xd8'),{'UserId':Number(_0x32d299['query'][_0x47a5('0x68')][_0x4aeaff]),'SmsAccountId':Number(_0x32d299['params']['id'])});}}else{socket[_0x47a5('0xd4')](_0x47a5('0xd8'),{'UserId':Number(_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')]),'SmsAccountId':Number(_0x32d299[_0x47a5('0x56')]['id'])});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x20d99b,null))[_0x47a5('0x54')](handleError(_0x20d99b,null));};exports[_0x47a5('0xd9')]=function(_0x1396c2,_0x5c9091,_0x4f1e24){var _0x24c88e={};var _0xa859a={};var _0x5270cc;var _0x2a0f45;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1396c2[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x5c9091,null))[_0x47a5('0x21')](function(_0x969d4b){if(_0x969d4b){_0x5270cc=_0x969d4b;_0xa859a[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x9d')]['rawAttributes']);_0xa859a['query']=_['keys'](_0x1396c2['query']);_0xa859a[_0x47a5('0x41')]=_['intersection'](_0xa859a[_0x47a5('0x3d')],_0xa859a[_0x47a5('0x3f')]);_0x24c88e['attributes']=_[_0x47a5('0x42')](_0xa859a[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x24c88e[_0x47a5('0x43')]=_0x24c88e['attributes'][_0x47a5('0x59')]?_0x24c88e[_0x47a5('0x43')]:_0xa859a['model'];_0x24c88e[_0x47a5('0x47')]=qs['sort'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x24c88e[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x1396c2[_0x47a5('0x3f')],_0xa859a[_0x47a5('0x41')]));if(_0x1396c2['query'][_0x47a5('0x4b')]){_0x24c88e[_0x47a5('0x49')]=_['merge'](_0x24c88e[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x24c88e['attributes'],function(_0x14c968){var _0x5a7920={};_0x5a7920[_0x14c968]={'$like':'%'+_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x5a7920;})});}_0x24c88e=_[_0x47a5('0x4c')]({},_0x24c88e,_0x1396c2[_0x47a5('0x4e')]);return _0x5270cc[_0x47a5('0xd9')](_0x24c88e);}})['then'](function(_0x4b8b65){if(_0x4b8b65){_0x2a0f45=_0x4b8b65[_0x47a5('0x59')];if(!_0x1396c2['query']['hasOwnProperty']('nolimit')){_0x24c88e[_0x47a5('0x2e')]=qs['limit'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x24c88e[_0x47a5('0x2d')]=qs['offset'](_0x1396c2['query'][_0x47a5('0x2d')]);}return _0x5270cc['getAgents'](_0x24c88e);}})['then'](function(_0xe87e6e){if(_0xe87e6e){return _0xe87e6e?{'count':_0x2a0f45,'rows':_0xe87e6e}:null;}})['then'](respondWithResult(_0x5c9091,null))['catch'](handleError(_0x5c9091,null));};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js
index 822c633..e73250d 100644
--- a/server/api/smsAccount/smsAccount.events.js
+++ b/server/api/smsAccount/smsAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6017=['SmsAccount','setMaxListeners','save','update','remove','emit','exports'];(function(_0x45fcf7,_0x5cfb08){var _0x1b4a8e=function(_0x481e69){while(--_0x481e69){_0x45fcf7['push'](_0x45fcf7['shift']());}};_0x1b4a8e(++_0x5cfb08);}(_0x6017,0x12d));var _0x7601=function(_0x12d7b5,_0xe588d){_0x12d7b5=_0x12d7b5-0x0;var _0x27067d=_0x6017[_0x12d7b5];return _0x27067d;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0x7601('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7601('0x1')](0x0);var events={'afterCreate':_0x7601('0x2'),'afterUpdate':_0x7601('0x3'),'afterDestroy':_0x7601('0x4')};function emitEvent(_0x2214cf){return function(_0x576a6f,_0x1f4b36,_0x51561f){SmsAccountEvents['emit'](_0x2214cf+':'+_0x576a6f['id'],_0x576a6f);SmsAccountEvents[_0x7601('0x5')](_0x2214cf,_0x576a6f);_0x51561f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x7601('0x6')]=SmsAccountEvents;
\ No newline at end of file
+var _0xbcbc=['exports','../../mysqldb','update','emit','hook'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0xbcbc,0xa1));var _0xcbcb=function(_0x484592,_0x49abf1){_0x484592=_0x484592-0x0;var _0x1abb63=_0xbcbc[_0x484592];return _0x1abb63;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xcbcb('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcbcb('0x1'),'afterDestroy':'remove'};function emitEvent(_0x5add15){return function(_0x367765,_0x47e8ef,_0x39aa2){SmsAccountEvents['emit'](_0x5add15+':'+_0x367765['id'],_0x367765);SmsAccountEvents[_0xcbcb('0x2')](_0x5add15,_0x367765);_0x39aa2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xcbcb('0x3')](e,emitEvent(event));}}module[_0xcbcb('0x4')]=SmsAccountEvents;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js
index 0b69d1c..f31d8e2 100644
--- a/server/api/smsAccount/smsAccount.model.js
+++ b/server/api/smsAccount/smsAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1df362,_0x1a2467){var _0x3697d1=function(_0x348c46){while(--_0x348c46){_0x1df362['push'](_0x1df362['shift']());}};_0x3697d1(++_0x1a2467);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x44d522,_0x454d23){var _0x464f8c=function(_0x4af61d){while(--_0x4af61d){_0x44d522['push'](_0x44d522['shift']());}};_0x464f8c(++_0x454d23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js
index 9fc62b4..b366722 100644
--- a/server/api/smsAccount/smsAccount.rpc.js
+++ b/server/api/smsAccount/smsAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf0c4=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','ShowSmsAccount','options','raw','where','attributes','include','map','model','then','debug','catch','lodash','util','moment','bluebird'];(function(_0x49e8ce,_0x1870e5){var _0x24ed93=function(_0x31e460){while(--_0x31e460){_0x49e8ce['push'](_0x49e8ce['shift']());}};_0x24ed93(++_0x1870e5);}(_0xf0c4,0x164));var _0x4f0c=function(_0x4a599b,_0x1d2125){_0x4a599b=_0x4a599b-0x0;var _0x2d53d3=_0xf0c4[_0x4a599b];return _0x2d53d3;};'use strict';var _=require(_0x4f0c('0x0'));var util=require(_0x4f0c('0x1'));var moment=require(_0x4f0c('0x2'));var BPromise=require(_0x4f0c('0x3'));var rs=require(_0x4f0c('0x4'));var fs=require('fs');var Redis=require(_0x4f0c('0x5'));var db=require(_0x4f0c('0x6'))['db'];var utils=require(_0x4f0c('0x7'));var logger=require(_0x4f0c('0x8'))(_0x4f0c('0x9'));var config=require(_0x4f0c('0xa'));var jayson=require(_0x4f0c('0xb'));var client=jayson[_0x4f0c('0xc')][_0x4f0c('0xd')]({'port':0x232a});config[_0x4f0c('0xe')]=_[_0x4f0c('0xf')](config['redis'],{'host':_0x4f0c('0x10'),'port':0x18eb});var socket=require(_0x4f0c('0x11'))(new Redis(config[_0x4f0c('0xe')]));require(_0x4f0c('0x12'))[_0x4f0c('0x13')](socket);function respondWithRpcPromise(_0x4b6c38,_0x313a59,_0x31724b){return new BPromise(function(_0x2f36ba,_0x14f9e6){return client[_0x4f0c('0x14')](_0x4b6c38,_0x31724b)['then'](function(_0x12191f){logger['info']('SmsAccount,\x20%s,\x20%s',_0x313a59,_0x4f0c('0x15'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x313a59,_0x4f0c('0x15'),JSON[_0x4f0c('0x16')](_0x12191f));if(_0x12191f[_0x4f0c('0x17')]){if(_0x12191f['error'][_0x4f0c('0x18')]===0x1f4){logger['error'](_0x4f0c('0x19'),_0x313a59,_0x12191f[_0x4f0c('0x17')][_0x4f0c('0x1a')]);return _0x14f9e6(_0x12191f[_0x4f0c('0x17')][_0x4f0c('0x1a')]);}logger[_0x4f0c('0x17')]('SmsAccount,\x20%s,\x20%s',_0x313a59,_0x12191f[_0x4f0c('0x17')][_0x4f0c('0x1a')]);return _0x2f36ba(_0x12191f[_0x4f0c('0x17')]['message']);}else{logger[_0x4f0c('0x1b')](_0x4f0c('0x19'),_0x313a59,_0x4f0c('0x15'));_0x2f36ba(_0x12191f[_0x4f0c('0x1c')][_0x4f0c('0x1a')]);}})['catch'](function(_0x5355fd){logger[_0x4f0c('0x17')](_0x4f0c('0x19'),_0x313a59,_0x5355fd);_0x14f9e6(_0x5355fd);});});}exports[_0x4f0c('0x1d')]=function(_0x579e2d){var _0x4be262=this;return new Promise(function(_0xfdd236,_0x441632){return db['SmsAccount']['find']({'raw':_0x579e2d[_0x4f0c('0x1e')]?_0x579e2d[_0x4f0c('0x1e')][_0x4f0c('0x1f')]===undefined?!![]:![]:!![],'where':_0x579e2d[_0x4f0c('0x1e')]?_0x579e2d[_0x4f0c('0x1e')][_0x4f0c('0x20')]||null:null,'attributes':_0x579e2d[_0x4f0c('0x1e')]?_0x579e2d['options'][_0x4f0c('0x21')]||null:null,'include':_0x579e2d[_0x4f0c('0x1e')]?_0x579e2d[_0x4f0c('0x1e')][_0x4f0c('0x22')]?_[_0x4f0c('0x23')](_0x579e2d[_0x4f0c('0x1e')]['include'],function(_0x8417d9){return{'model':db[_0x8417d9[_0x4f0c('0x24')]],'as':_0x8417d9['as'],'attributes':_0x8417d9[_0x4f0c('0x21')],'include':_0x8417d9[_0x4f0c('0x22')]?_[_0x4f0c('0x23')](_0x8417d9[_0x4f0c('0x22')],function(_0x8c80cd){return{'model':db[_0x8c80cd[_0x4f0c('0x24')]],'as':_0x8c80cd['as'],'attributes':_0x8c80cd['attributes'],'include':_0x8c80cd[_0x4f0c('0x22')]?_['map'](_0x8c80cd[_0x4f0c('0x22')],function(_0x460d21){return{'model':db[_0x460d21[_0x4f0c('0x24')]],'as':_0x460d21['as'],'attributes':_0x460d21['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f0c('0x25')](function(_0x35d60a){logger[_0x4f0c('0x1b')]('ShowSmsAccount',_0x579e2d);logger[_0x4f0c('0x26')](_0x4f0c('0x1d'),_0x579e2d,JSON[_0x4f0c('0x16')](_0x35d60a));_0xfdd236(_0x35d60a);})[_0x4f0c('0x27')](function(_0x2a961e){logger[_0x4f0c('0x17')]('ShowSmsAccount',_0x2a961e['message'],_0x579e2d);_0x441632(_0x4be262[_0x4f0c('0x17')](0x1f4,_0x2a961e[_0x4f0c('0x1a')]));});});};
\ No newline at end of file
+var _0x3163=['SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','where','map','include','model','attributes','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info'];(function(_0x3d6ef8,_0x42f199){var _0x4d36ff=function(_0x5bea7b){while(--_0x5bea7b){_0x3d6ef8['push'](_0x3d6ef8['shift']());}};_0x4d36ff(++_0x42f199);}(_0x3163,0x1d8));var _0x3316=function(_0x210f95,_0x1eaa6e){_0x210f95=_0x210f95-0x0;var _0x398af6=_0x3163[_0x210f95];return _0x398af6;};'use strict';var _=require('lodash');var util=require(_0x3316('0x0'));var moment=require(_0x3316('0x1'));var BPromise=require(_0x3316('0x2'));var rs=require(_0x3316('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3316('0x4'))['db'];var utils=require(_0x3316('0x5'));var logger=require('../../config/logger')(_0x3316('0x6'));var config=require('../../config/environment');var jayson=require(_0x3316('0x7'));var client=jayson[_0x3316('0x8')]['http']({'port':0x232a});config[_0x3316('0x9')]=_[_0x3316('0xa')](config['redis'],{'host':_0x3316('0xb'),'port':0x18eb});var socket=require(_0x3316('0xc'))(new Redis(config[_0x3316('0x9')]));require(_0x3316('0xd'))[_0x3316('0xe')](socket);function respondWithRpcPromise(_0x366211,_0xa0a873,_0x3a6807){return new BPromise(function(_0x42070d,_0x469268){return client[_0x3316('0xf')](_0x366211,_0x3a6807)[_0x3316('0x10')](function(_0x1f7757){logger[_0x3316('0x11')](_0x3316('0x12'),_0xa0a873,_0x3316('0x13'));logger[_0x3316('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa0a873,_0x3316('0x13'),JSON['stringify'](_0x1f7757));if(_0x1f7757[_0x3316('0x15')]){if(_0x1f7757[_0x3316('0x15')]['code']===0x1f4){logger[_0x3316('0x15')](_0x3316('0x12'),_0xa0a873,_0x1f7757[_0x3316('0x15')][_0x3316('0x16')]);return _0x469268(_0x1f7757[_0x3316('0x15')]['message']);}logger[_0x3316('0x15')](_0x3316('0x12'),_0xa0a873,_0x1f7757[_0x3316('0x15')][_0x3316('0x16')]);return _0x42070d(_0x1f7757['error'][_0x3316('0x16')]);}else{logger[_0x3316('0x11')](_0x3316('0x12'),_0xa0a873,_0x3316('0x13'));_0x42070d(_0x1f7757[_0x3316('0x17')][_0x3316('0x16')]);}})[_0x3316('0x18')](function(_0x10922e){logger['error'](_0x3316('0x12'),_0xa0a873,_0x10922e);_0x469268(_0x10922e);});});}exports[_0x3316('0x19')]=function(_0x5bdcf5){var _0x357692=this;return new Promise(function(_0x4db546,_0x5e8ad4){return db[_0x3316('0x1a')][_0x3316('0x1b')]({'raw':_0x5bdcf5[_0x3316('0x1c')]?_0x5bdcf5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5bdcf5[_0x3316('0x1c')]?_0x5bdcf5[_0x3316('0x1c')][_0x3316('0x1d')]||null:null,'attributes':_0x5bdcf5['options']?_0x5bdcf5['options']['attributes']||null:null,'include':_0x5bdcf5[_0x3316('0x1c')]?_0x5bdcf5[_0x3316('0x1c')]['include']?_[_0x3316('0x1e')](_0x5bdcf5[_0x3316('0x1c')][_0x3316('0x1f')],function(_0x352bfd){return{'model':db[_0x352bfd[_0x3316('0x20')]],'as':_0x352bfd['as'],'attributes':_0x352bfd['attributes'],'include':_0x352bfd['include']?_[_0x3316('0x1e')](_0x352bfd[_0x3316('0x1f')],function(_0x42a3eb){return{'model':db[_0x42a3eb[_0x3316('0x20')]],'as':_0x42a3eb['as'],'attributes':_0x42a3eb[_0x3316('0x21')],'include':_0x42a3eb['include']?_[_0x3316('0x1e')](_0x42a3eb[_0x3316('0x1f')],function(_0x83a4c8){return{'model':db[_0x83a4c8[_0x3316('0x20')]],'as':_0x83a4c8['as'],'attributes':_0x83a4c8[_0x3316('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26888f){logger[_0x3316('0x11')](_0x3316('0x19'),_0x5bdcf5);logger[_0x3316('0x14')](_0x3316('0x19'),_0x5bdcf5,JSON[_0x3316('0x22')](_0x26888f));_0x4db546(_0x26888f);})['catch'](function(_0xc1fb54){logger['error']('ShowSmsAccount',_0xc1fb54[_0x3316('0x16')],_0x5bdcf5);_0x5e8ad4(_0x357692[_0x3316('0x15')](0x1f4,_0xc1fb54[_0x3316('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js
index b57fb14..56efce8 100644
--- a/server/api/smsAccount/smsAccount.socket.js
+++ b/server/api/smsAccount/smsAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5e1d=['remove','update','emit','removeListener','register','length','./smsAccount.events','save'];(function(_0x416876,_0x466503){var _0x2a0315=function(_0x33bc8a){while(--_0x33bc8a){_0x416876['push'](_0x416876['shift']());}};_0x2a0315(++_0x466503);}(_0x5e1d,0x1b6));var _0xd5e1=function(_0x25d5e9,_0x340fda){_0x25d5e9=_0x25d5e9-0x0;var _0xa351e2=_0x5e1d[_0x25d5e9];return _0xa351e2;};'use strict';var SmsAccountEvents=require(_0xd5e1('0x0'));var events=[_0xd5e1('0x1'),_0xd5e1('0x2'),_0xd5e1('0x3')];function createListener(_0x360a89,_0x7a6135){return function(_0x164b2e){_0x7a6135[_0xd5e1('0x4')](_0x360a89,_0x164b2e);};}function removeListener(_0x3c5d84,_0x249c0b){return function(){SmsAccountEvents[_0xd5e1('0x5')](_0x3c5d84,_0x249c0b);};}exports[_0xd5e1('0x6')]=function(_0xc9e6e9){for(var _0x360b64=0x0,_0x22259e=events[_0xd5e1('0x7')];_0x360b64<_0x22259e;_0x360b64++){var _0x204f43=events[_0x360b64];var _0x4d6e1b=createListener('smsAccount:'+_0x204f43,_0xc9e6e9);SmsAccountEvents['on'](_0x204f43,_0x4d6e1b);}};
\ No newline at end of file
+var _0x5525=['register','smsAccount:','./smsAccount.events','save','remove','update','emit','removeListener'];(function(_0x492d18,_0x19f50c){var _0x15a913=function(_0x3eece3){while(--_0x3eece3){_0x492d18['push'](_0x492d18['shift']());}};_0x15a913(++_0x19f50c);}(_0x5525,0xda));var _0x5552=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5525[_0x57b54c];return _0x59cc19;};'use strict';var SmsAccountEvents=require(_0x5552('0x0'));var events=[_0x5552('0x1'),_0x5552('0x2'),_0x5552('0x3')];function createListener(_0x2e51ad,_0x2b77dd){return function(_0xad6cd4){_0x2b77dd[_0x5552('0x4')](_0x2e51ad,_0xad6cd4);};}function removeListener(_0x1af1f0,_0x3f471a){return function(){SmsAccountEvents[_0x5552('0x5')](_0x1af1f0,_0x3f471a);};}exports[_0x5552('0x6')]=function(_0x4781b3){for(var _0x139ea7=0x0,_0x11abb1=events['length'];_0x139ea7<_0x11abb1;_0x139ea7++){var _0x30458e=events[_0x139ea7];var _0x343023=createListener(_0x5552('0x7')+_0x30458e,_0x4781b3);SmsAccountEvents['on'](_0x30458e,_0x343023);}};
\ No newline at end of file
diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js
index a059bba..74d6502 100644
--- a/server/api/smsApplication/index.js
+++ b/server/api/smsApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4b2=['get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','isAuthenticated','index'];(function(_0x43dcbd,_0x4ba47){var _0x326cac=function(_0x37da95){while(--_0x37da95){_0x43dcbd['push'](_0x43dcbd['shift']());}};_0x326cac(++_0x4ba47);}(_0xb4b2,0x14a));var _0x2b4b=function(_0x511c13,_0x526f29){_0x511c13=_0x511c13-0x0;var _0x5ecb1d=_0xb4b2[_0x511c13];return _0x5ecb1d;};'use strict';var multer=require(_0x2b4b('0x0'));var util=require(_0x2b4b('0x1'));var path=require('path');var timeout=require(_0x2b4b('0x2'));var express=require('express');var router=express[_0x2b4b('0x3')]();var auth=require(_0x2b4b('0x4'));var interaction=require(_0x2b4b('0x5'));var config=require(_0x2b4b('0x6'));var controller=require(_0x2b4b('0x7'));router['get']('/',auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x9')]);router[_0x2b4b('0xa')](_0x2b4b('0xb'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0xc')]);router[_0x2b4b('0xd')]('/',auth[_0x2b4b('0x8')](),controller[_0x2b4b('0xe')]);router[_0x2b4b('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2b4b('0x10')]);router[_0x2b4b('0x11')](_0x2b4b('0xb'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x12')]);module[_0x2b4b('0x13')]=router;
\ No newline at end of file
+var _0x1b36=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','isAuthenticated','index','/:id','show','post'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x1b36,0x122));var _0x61b3=function(_0x5a1cb0,_0x12e675){_0x5a1cb0=_0x5a1cb0-0x0;var _0x1fc059=_0x1b36[_0x5a1cb0];return _0x1fc059;};'use strict';var multer=require(_0x61b3('0x0'));var util=require(_0x61b3('0x1'));var path=require('path');var timeout=require(_0x61b3('0x2'));var express=require(_0x61b3('0x3'));var router=express[_0x61b3('0x4')]();var auth=require(_0x61b3('0x5'));var interaction=require(_0x61b3('0x6'));var config=require(_0x61b3('0x7'));var controller=require(_0x61b3('0x8'));router['get']('/',auth[_0x61b3('0x9')](),controller[_0x61b3('0xa')]);router['get'](_0x61b3('0xb'),auth[_0x61b3('0x9')](),controller[_0x61b3('0xc')]);router[_0x61b3('0xd')]('/',auth[_0x61b3('0x9')](),controller['create']);router[_0x61b3('0xe')](_0x61b3('0xb'),auth[_0x61b3('0x9')](),controller[_0x61b3('0xf')]);router[_0x61b3('0x10')](_0x61b3('0xb'),auth[_0x61b3('0x9')](),controller[_0x61b3('0x11')]);module[_0x61b3('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js
index c449401..59a5a0f 100644
--- a/server/api/smsApplication/smsApplication.attributes.js
+++ b/server/api/smsApplication/smsApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x84e6=['TEXT','*,*,*,*','exports','STRING','noop'];(function(_0x4ab560,_0x5e8fe2){var _0xfe1853=function(_0x154fa7){while(--_0x154fa7){_0x4ab560['push'](_0x4ab560['shift']());}};_0xfe1853(++_0x5e8fe2);}(_0x84e6,0x160));var _0x684e=function(_0x594600,_0x49f399){_0x594600=_0x594600-0x0;var _0x449c1a=_0x84e6[_0x594600];return _0x449c1a;};'use strict';var Sequelize=require('sequelize');module[_0x684e('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x684e('0x1')],'allowNull':![],'defaultValue':_0x684e('0x2')},'appdata':{'type':Sequelize[_0x684e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x684e('0x1')],'defaultValue':_0x684e('0x4')}};
\ No newline at end of file
+var _0x8790=['TEXT','*,*,*,*','INTEGER','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8790,0x1be));var _0x0879=function(_0x38c589,_0x507adc){_0x38c589=_0x38c589-0x0;var _0x1a9db3=_0x8790[_0x38c589];return _0x1a9db3;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x0879('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x0879('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0879('0x2')]()},'description':{'type':Sequelize[_0x0879('0x1')]},'interval':{'type':Sequelize[_0x0879('0x1')],'defaultValue':_0x0879('0x3')}};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js
index 5a310c7..a68a5f1 100644
--- a/server/api/smsApplication/smsApplication.controller.js
+++ b/server/api/smsApplication/smsApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5423=['attributes','intersection','fields','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','count','then','includeAll','catch','params','length','include','options','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','reject','save','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','type','key','model','query','keys'];(function(_0x5896eb,_0x50a650){var _0x149c01=function(_0x237317){while(--_0x237317){_0x5896eb['push'](_0x5896eb['shift']());}};_0x149c01(++_0x50a650);}(_0x5423,0xe3));var _0x3542=function(_0xca02f2,_0x445a8e){_0xca02f2=_0xca02f2-0x0;var _0x1705f1=_0x5423[_0xca02f2];return _0x1705f1;};'use strict';var pdf=require(_0x3542('0x0'));var emlformat=require(_0x3542('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3542('0x2'));var jsonpatch=require(_0x3542('0x3'));var rp=require('request-promise');var moment=require(_0x3542('0x4'));var BPromise=require(_0x3542('0x5'));var Mustache=require(_0x3542('0x6'));var util=require(_0x3542('0x7'));var path=require('path');var sox=require(_0x3542('0x8'));var csv=require(_0x3542('0x9'));var ejs=require(_0x3542('0xa'));var fs=require('fs');var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x9'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var db=require(_0x3542('0x16'))['db'];function respondWithStatusCode(_0x3bb6a0,_0x1cf710){_0x1cf710=_0x1cf710||0xcc;return function(_0x43e977){if(_0x43e977){return _0x3bb6a0[_0x3542('0x17')](_0x1cf710);}return _0x3bb6a0[_0x3542('0x18')](_0x1cf710)[_0x3542('0x19')]();};}function respondWithResult(_0x14d7c3,_0x15863d){_0x15863d=_0x15863d||0xc8;return function(_0x4bac5b){if(_0x4bac5b){return _0x14d7c3[_0x3542('0x18')](_0x15863d)['json'](_0x4bac5b);}};}function respondWithFilteredResult(_0x3bfb33,_0x13fe0b){return function(_0xc33d42){if(_0xc33d42){var _0x546fbd=_0xc33d42['count'],_0x270312=_0x13fe0b[_0x3542('0x1a')],_0x177fb9=_0x13fe0b[_0x3542('0x1a')]+_0x13fe0b[_0x3542('0x1b')],_0x347ac8;if(_0x177fb9>=_0x546fbd){_0x177fb9=_0x546fbd;_0x347ac8=0xc8;}else{_0x347ac8=0xce;}_0x3bfb33[_0x3542('0x18')](_0x347ac8);return _0x3bfb33['set'](_0x3542('0x1c'),_0x270312+'-'+_0x177fb9+'/'+_0x546fbd)['json'](_0xc33d42);}return null;};}function patchUpdates(_0x2fa983){return function(_0x369e0c){try{jsonpatch['apply'](_0x369e0c,_0x2fa983,!![]);}catch(_0x1c6403){return BPromise[_0x3542('0x1d')](_0x1c6403);}return _0x369e0c[_0x3542('0x1e')]();};}function saveUpdates(_0x1302fb,_0x212950){return function(_0x4a7695){if(_0x4a7695){return _0x4a7695['update'](_0x1302fb)['then'](function(_0x17e3cf){return _0x17e3cf;});}return null;};}function removeEntity(_0x527222,_0x1d5488){return function(_0x551645){if(_0x551645){return _0x551645[_0x3542('0x1f')]()['then'](function(){_0x527222['status'](0xcc)[_0x3542('0x19')]();});}};}function handleEntityNotFound(_0xe3f983,_0x5ae097){return function(_0x5d05b2){if(!_0x5d05b2){_0xe3f983[_0x3542('0x17')](0x194);}return _0x5d05b2;};}function handleError(_0x5123f0,_0x160caa){_0x160caa=_0x160caa||0x1f4;return function(_0x367146){logger[_0x3542('0x20')](_0x367146[_0x3542('0x21')]);if(_0x367146[_0x3542('0x22')]){delete _0x367146[_0x3542('0x22')];}_0x5123f0[_0x3542('0x18')](_0x160caa)[_0x3542('0x23')](_0x367146);};}exports[_0x3542('0x24')]=function(_0x2841a1,_0xfdfe62){var _0x4462c4={},_0x220021={},_0x9d9ca4={'count':0x0,'rows':[]};var _0x1cab35=_[_0x3542('0x25')](db[_0x3542('0x26')][_0x3542('0x27')],function(_0x3bd666){return{'name':_0x3bd666['fieldName'],'type':_0x3bd666[_0x3542('0x28')][_0x3542('0x29')]};});_0x220021[_0x3542('0x2a')]=_['map'](_0x1cab35,_0x3542('0x22'));_0x220021[_0x3542('0x2b')]=_[_0x3542('0x2c')](_0x2841a1[_0x3542('0x2b')]);_0x220021['filters']=_['intersection'](_0x220021[_0x3542('0x2a')],_0x220021[_0x3542('0x2b')]);_0x4462c4[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x220021[_0x3542('0x2a')],qs[_0x3542('0x2f')](_0x2841a1[_0x3542('0x2b')]['fields']));_0x4462c4['attributes']=_0x4462c4[_0x3542('0x2d')]['length']?_0x4462c4['attributes']:_0x220021[_0x3542('0x2a')];if(!_0x2841a1['query']['hasOwnProperty'](_0x3542('0x30'))){_0x4462c4[_0x3542('0x1b')]=qs[_0x3542('0x1b')](_0x2841a1['query'][_0x3542('0x1b')]);_0x4462c4['offset']=qs[_0x3542('0x1a')](_0x2841a1[_0x3542('0x2b')]['offset']);}_0x4462c4[_0x3542('0x31')]=qs['sort'](_0x2841a1[_0x3542('0x2b')][_0x3542('0x32')]);_0x4462c4[_0x3542('0x33')]=qs['filters'](_[_0x3542('0x34')](_0x2841a1['query'],_0x220021[_0x3542('0x35')]),_0x1cab35);if(_0x2841a1[_0x3542('0x2b')][_0x3542('0x36')]){_0x4462c4[_0x3542('0x33')]=_[_0x3542('0x37')](_0x4462c4[_0x3542('0x33')],{'$or':_[_0x3542('0x25')](_0x1cab35,function(_0x1cbd5f){if(_0x1cbd5f[_0x3542('0x28')]!==_0x3542('0x38')){var _0x372fe0={};_0x372fe0[_0x1cbd5f[_0x3542('0x22')]]={'$like':'%'+_0x2841a1[_0x3542('0x2b')]['filter']+'%'};return _0x372fe0;}})});}_0x4462c4=_[_0x3542('0x37')]({},_0x4462c4,_0x2841a1['options']);var _0x5ee295={'where':_0x4462c4[_0x3542('0x33')]};return db[_0x3542('0x26')][_0x3542('0x39')](_0x5ee295)[_0x3542('0x3a')](function(_0xb83c25){_0x9d9ca4[_0x3542('0x39')]=_0xb83c25;if(_0x2841a1[_0x3542('0x2b')][_0x3542('0x3b')]){_0x4462c4['include']=[{'all':!![]}];}return db[_0x3542('0x26')]['findAll'](_0x4462c4);})[_0x3542('0x3a')](function(_0x2baa01){_0x9d9ca4['rows']=_0x2baa01;return _0x9d9ca4;})[_0x3542('0x3a')](respondWithFilteredResult(_0xfdfe62,_0x4462c4))[_0x3542('0x3c')](handleError(_0xfdfe62,null));};exports['show']=function(_0xc25e8,_0x39f5b0){var _0x5e1b29={'raw':!![],'where':{'id':_0xc25e8[_0x3542('0x3d')]['id']}},_0x2682d0={};_0x2682d0[_0x3542('0x2a')]=_[_0x3542('0x2c')](db[_0x3542('0x26')][_0x3542('0x27')]);_0x2682d0[_0x3542('0x2b')]=_['keys'](_0xc25e8['query']);_0x2682d0[_0x3542('0x35')]=_[_0x3542('0x2e')](_0x2682d0[_0x3542('0x2a')],_0x2682d0[_0x3542('0x2b')]);_0x5e1b29[_0x3542('0x2d')]=_['intersection'](_0x2682d0[_0x3542('0x2a')],qs['fields'](_0xc25e8[_0x3542('0x2b')][_0x3542('0x2f')]));_0x5e1b29[_0x3542('0x2d')]=_0x5e1b29['attributes'][_0x3542('0x3e')]?_0x5e1b29[_0x3542('0x2d')]:_0x2682d0['model'];if(_0xc25e8[_0x3542('0x2b')][_0x3542('0x3b')]){_0x5e1b29[_0x3542('0x3f')]=[{'all':!![]}];}_0x5e1b29=_[_0x3542('0x37')]({},_0x5e1b29,_0xc25e8[_0x3542('0x40')]);return db[_0x3542('0x26')][_0x3542('0x41')](_0x5e1b29)[_0x3542('0x3a')](handleEntityNotFound(_0x39f5b0,null))['then'](respondWithResult(_0x39f5b0,null))['catch'](handleError(_0x39f5b0,null));};exports['create']=function(_0x3b3719,_0x3b48a4){return db[_0x3542('0x26')][_0x3542('0x42')](_0x3b3719[_0x3542('0x43')],{})[_0x3542('0x3a')](respondWithResult(_0x3b48a4,0xc9))[_0x3542('0x3c')](handleError(_0x3b48a4,null));};exports['update']=function(_0x157683,_0x14b960){if(_0x157683[_0x3542('0x43')]['id']){delete _0x157683[_0x3542('0x43')]['id'];}return db['SmsApplication'][_0x3542('0x41')]({'where':{'id':_0x157683[_0x3542('0x3d')]['id']}})['then'](handleEntityNotFound(_0x14b960,null))['then'](saveUpdates(_0x157683[_0x3542('0x43')],null))[_0x3542('0x3a')](respondWithResult(_0x14b960,null))[_0x3542('0x3c')](handleError(_0x14b960,null));};exports[_0x3542('0x1f')]=function(_0x244f3a,_0x1a2ecf){return db[_0x3542('0x26')]['find']({'where':{'id':_0x244f3a[_0x3542('0x3d')]['id']}})[_0x3542('0x3a')](handleEntityNotFound(_0x1a2ecf,null))[_0x3542('0x3a')](removeEntity(_0x1a2ecf,null))[_0x3542('0x3c')](handleError(_0x1a2ecf,null));};
\ No newline at end of file
+var _0x0598=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','filter','rows','catch','show','includeAll','include','create','body','params','html-pdf','eml-format','zip-dir','moment','bluebird','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','map','SmsApplication','rawAttributes','type','model'];(function(_0x2286e9,_0x4c5d08){var _0x4c6253=function(_0x31b081){while(--_0x31b081){_0x2286e9['push'](_0x2286e9['shift']());}};_0x4c6253(++_0x4c5d08);}(_0x0598,0x92));var _0x8059=function(_0x2f3959,_0x47fb8c){_0x2f3959=_0x2f3959-0x0;var _0x390e08=_0x0598[_0x2f3959];return _0x390e08;};'use strict';var pdf=require(_0x8059('0x0'));var emlformat=require(_0x8059('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8059('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8059('0x3'));var BPromise=require(_0x8059('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8059('0x5'));var csv=require(_0x8059('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f98b8,_0x1ead10){_0x1ead10=_0x1ead10||0xcc;return function(_0x2d26e2){if(_0x2d26e2){return _0x4f98b8[_0x8059('0x12')](_0x1ead10);}return _0x4f98b8[_0x8059('0x13')](_0x1ead10)[_0x8059('0x14')]();};}function respondWithResult(_0x4eb4c5,_0x11218f){_0x11218f=_0x11218f||0xc8;return function(_0x5480a5){if(_0x5480a5){return _0x4eb4c5[_0x8059('0x13')](_0x11218f)['json'](_0x5480a5);}};}function respondWithFilteredResult(_0x3e4f08,_0x13bf07){return function(_0x4810fd){if(_0x4810fd){var _0x4d3873=_0x4810fd[_0x8059('0x15')],_0x516c1f=_0x13bf07[_0x8059('0x16')],_0x5cda43=_0x13bf07[_0x8059('0x16')]+_0x13bf07[_0x8059('0x17')],_0x3b8f18;if(_0x5cda43>=_0x4d3873){_0x5cda43=_0x4d3873;_0x3b8f18=0xc8;}else{_0x3b8f18=0xce;}_0x3e4f08['status'](_0x3b8f18);return _0x3e4f08[_0x8059('0x18')](_0x8059('0x19'),_0x516c1f+'-'+_0x5cda43+'/'+_0x4d3873)[_0x8059('0x1a')](_0x4810fd);}return null;};}function patchUpdates(_0x1c4566){return function(_0x58675f){try{jsonpatch[_0x8059('0x1b')](_0x58675f,_0x1c4566,!![]);}catch(_0x4f2eb3){return BPromise[_0x8059('0x1c')](_0x4f2eb3);}return _0x58675f['save']();};}function saveUpdates(_0x1857c1,_0x56d794){return function(_0x466a88){if(_0x466a88){return _0x466a88[_0x8059('0x1d')](_0x1857c1)[_0x8059('0x1e')](function(_0x5a6bd3){return _0x5a6bd3;});}return null;};}function removeEntity(_0x4c9741,_0x21a80f){return function(_0x232f1b){if(_0x232f1b){return _0x232f1b[_0x8059('0x1f')]()[_0x8059('0x1e')](function(){_0x4c9741['status'](0xcc)[_0x8059('0x14')]();});}};}function handleEntityNotFound(_0x21ac82,_0x3da080){return function(_0x5449d9){if(!_0x5449d9){_0x21ac82[_0x8059('0x12')](0x194);}return _0x5449d9;};}function handleError(_0x2256b1,_0x3e1067){_0x3e1067=_0x3e1067||0x1f4;return function(_0x2852d1){logger['error'](_0x2852d1[_0x8059('0x20')]);if(_0x2852d1[_0x8059('0x21')]){delete _0x2852d1[_0x8059('0x21')];}_0x2256b1[_0x8059('0x13')](_0x3e1067)[_0x8059('0x22')](_0x2852d1);};}exports['index']=function(_0x387350,_0x19b95a){var _0xd1fa7e={},_0x4a294f={},_0x582321={'count':0x0,'rows':[]};var _0x5d5b45=_[_0x8059('0x23')](db[_0x8059('0x24')][_0x8059('0x25')],function(_0x1009af){return{'name':_0x1009af['fieldName'],'type':_0x1009af[_0x8059('0x26')]['key']};});_0x4a294f[_0x8059('0x27')]=_[_0x8059('0x23')](_0x5d5b45,'name');_0x4a294f[_0x8059('0x28')]=_[_0x8059('0x29')](_0x387350[_0x8059('0x28')]);_0x4a294f[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x4a294f[_0x8059('0x27')],_0x4a294f[_0x8059('0x28')]);_0xd1fa7e[_0x8059('0x2c')]=_['intersection'](_0x4a294f[_0x8059('0x27')],qs[_0x8059('0x2d')](_0x387350[_0x8059('0x28')][_0x8059('0x2d')]));_0xd1fa7e[_0x8059('0x2c')]=_0xd1fa7e['attributes'][_0x8059('0x2e')]?_0xd1fa7e[_0x8059('0x2c')]:_0x4a294f[_0x8059('0x27')];if(!_0x387350[_0x8059('0x28')][_0x8059('0x2f')](_0x8059('0x30'))){_0xd1fa7e[_0x8059('0x17')]=qs[_0x8059('0x17')](_0x387350[_0x8059('0x28')][_0x8059('0x17')]);_0xd1fa7e['offset']=qs[_0x8059('0x16')](_0x387350['query'][_0x8059('0x16')]);}_0xd1fa7e['order']=qs['sort'](_0x387350[_0x8059('0x28')]['sort']);_0xd1fa7e[_0x8059('0x31')]=qs['filters'](_[_0x8059('0x32')](_0x387350['query'],_0x4a294f[_0x8059('0x2a')]),_0x5d5b45);if(_0x387350[_0x8059('0x28')]['filter']){_0xd1fa7e[_0x8059('0x31')]=_[_0x8059('0x33')](_0xd1fa7e[_0x8059('0x31')],{'$or':_['map'](_0x5d5b45,function(_0x241403){if(_0x241403['type']!==_0x8059('0x34')){var _0x50a685={};_0x50a685[_0x241403[_0x8059('0x21')]]={'$like':'%'+_0x387350[_0x8059('0x28')][_0x8059('0x35')]+'%'};return _0x50a685;}})});}_0xd1fa7e=_[_0x8059('0x33')]({},_0xd1fa7e,_0x387350['options']);var _0x26b623={'where':_0xd1fa7e['where']};return db['SmsApplication'][_0x8059('0x15')](_0x26b623)[_0x8059('0x1e')](function(_0x438291){_0x582321[_0x8059('0x15')]=_0x438291;if(_0x387350[_0x8059('0x28')]['includeAll']){_0xd1fa7e['include']=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0xd1fa7e);})[_0x8059('0x1e')](function(_0x126ec1){_0x582321[_0x8059('0x36')]=_0x126ec1;return _0x582321;})['then'](respondWithFilteredResult(_0x19b95a,_0xd1fa7e))[_0x8059('0x37')](handleError(_0x19b95a,null));};exports[_0x8059('0x38')]=function(_0x52919a,_0xd6688b){var _0x2980cb={'raw':!![],'where':{'id':_0x52919a['params']['id']}},_0x12c5fa={};_0x12c5fa[_0x8059('0x27')]=_[_0x8059('0x29')](db['SmsApplication'][_0x8059('0x25')]);_0x12c5fa[_0x8059('0x28')]=_[_0x8059('0x29')](_0x52919a[_0x8059('0x28')]);_0x12c5fa[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x12c5fa[_0x8059('0x27')],_0x12c5fa[_0x8059('0x28')]);_0x2980cb[_0x8059('0x2c')]=_[_0x8059('0x2b')](_0x12c5fa[_0x8059('0x27')],qs[_0x8059('0x2d')](_0x52919a[_0x8059('0x28')][_0x8059('0x2d')]));_0x2980cb[_0x8059('0x2c')]=_0x2980cb[_0x8059('0x2c')][_0x8059('0x2e')]?_0x2980cb[_0x8059('0x2c')]:_0x12c5fa[_0x8059('0x27')];if(_0x52919a[_0x8059('0x28')][_0x8059('0x39')]){_0x2980cb[_0x8059('0x3a')]=[{'all':!![]}];}_0x2980cb=_[_0x8059('0x33')]({},_0x2980cb,_0x52919a['options']);return db[_0x8059('0x24')]['find'](_0x2980cb)['then'](handleEntityNotFound(_0xd6688b,null))[_0x8059('0x1e')](respondWithResult(_0xd6688b,null))['catch'](handleError(_0xd6688b,null));};exports[_0x8059('0x3b')]=function(_0x5e5c2c,_0xf4bc19){return db[_0x8059('0x24')][_0x8059('0x3b')](_0x5e5c2c[_0x8059('0x3c')],{})[_0x8059('0x1e')](respondWithResult(_0xf4bc19,0xc9))[_0x8059('0x37')](handleError(_0xf4bc19,null));};exports['update']=function(_0x301dca,_0x518517){if(_0x301dca[_0x8059('0x3c')]['id']){delete _0x301dca[_0x8059('0x3c')]['id'];}return db[_0x8059('0x24')]['find']({'where':{'id':_0x301dca[_0x8059('0x3d')]['id']}})[_0x8059('0x1e')](handleEntityNotFound(_0x518517,null))[_0x8059('0x1e')](saveUpdates(_0x301dca[_0x8059('0x3c')],null))['then'](respondWithResult(_0x518517,null))[_0x8059('0x37')](handleError(_0x518517,null));};exports[_0x8059('0x1f')]=function(_0x109748,_0x48e3bb){return db[_0x8059('0x24')]['find']({'where':{'id':_0x109748['params']['id']}})[_0x8059('0x1e')](handleEntityNotFound(_0x48e3bb,null))['then'](removeEntity(_0x48e3bb,null))[_0x8059('0x37')](handleError(_0x48e3bb,null));};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js
index f3c5b53..210381d 100644
--- a/server/api/smsApplication/smsApplication.model.js
+++ b/server/api/smsApplication/smsApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf0f8=['bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x12253a,_0x2727d4){var _0x4f88c3=function(_0x2f11bb){while(--_0x2f11bb){_0x12253a['push'](_0x12253a['shift']());}};_0x4f88c3(++_0x2727d4);}(_0xf0f8,0x87));var _0x8f0f=function(_0xcc8680,_0x2a9a62){_0xcc8680=_0xcc8680-0x0;var _0xe5136f=_0xf0f8[_0xcc8680];return _0xe5136f;};'use strict';var _=require(_0x8f0f('0x0'));var util=require(_0x8f0f('0x1'));var logger=require(_0x8f0f('0x2'))(_0x8f0f('0x3'));var moment=require(_0x8f0f('0x4'));var BPromise=require(_0x8f0f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f0f('0x6'));var rimraf=require(_0x8f0f('0x7'));var config=require(_0x8f0f('0x8'));var attributes=require(_0x8f0f('0x9'));module['exports']=function(_0x4264e5,_0x24140e){return _0x4264e5[_0x8f0f('0xa')](_0x8f0f('0xb'),attributes,{'tableName':_0x8f0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8f0f('0xd')});};
\ No newline at end of file
+var _0x7f6f=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','define','sms_applications','utf8mb4'];(function(_0x1b2cd4,_0x220d18){var _0x3e2ff5=function(_0x5ef59c){while(--_0x5ef59c){_0x1b2cd4['push'](_0x1b2cd4['shift']());}};_0x3e2ff5(++_0x220d18);}(_0x7f6f,0xf2));var _0xf7f6=function(_0x3382e2,_0x6fbda2){_0x3382e2=_0x3382e2-0x0;var _0x25381b=_0x7f6f[_0x3382e2];return _0x25381b;};'use strict';var _=require(_0xf7f6('0x0'));var util=require(_0xf7f6('0x1'));var logger=require('../../config/logger')(_0xf7f6('0x2'));var moment=require('moment');var BPromise=require(_0xf7f6('0x3'));var rp=require(_0xf7f6('0x4'));var fs=require('fs');var path=require(_0xf7f6('0x5'));var rimraf=require('rimraf');var config=require(_0xf7f6('0x6'));var attributes=require(_0xf7f6('0x7'));module['exports']=function(_0xe7796b,_0x4639ef){return _0xe7796b[_0xf7f6('0x8')]('SmsApplication',attributes,{'tableName':_0xf7f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf7f6('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js
index 6af6fc6..38a06f9 100644
--- a/server/api/smsApplication/smsApplication.rpc.js
+++ b/server/api/smsApplication/smsApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaab2=['jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3eb348,_0xecc0bf){var _0x1fccf3=function(_0x360d20){while(--_0x360d20){_0x3eb348['push'](_0x3eb348['shift']());}};_0x1fccf3(++_0xecc0bf);}(_0xaab2,0xca));var _0x2aab=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xaab2[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0x2aab('0x0'));var moment=require(_0x2aab('0x1'));var BPromise=require(_0x2aab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2aab('0x3'));var db=require(_0x2aab('0x4'))['db'];var utils=require(_0x2aab('0x5'));var logger=require(_0x2aab('0x6'))(_0x2aab('0x7'));var config=require('../../config/environment');var jayson=require(_0x2aab('0x8'));var client=jayson['client'][_0x2aab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x276906,_0x4fe8a5,_0x2970cb){return new BPromise(function(_0x494216,_0xf6602a){return client[_0x2aab('0xa')](_0x276906,_0x2970cb)[_0x2aab('0xb')](function(_0x5d47ad){logger[_0x2aab('0xc')](_0x2aab('0xd'),_0x4fe8a5,'request\x20sent');logger['debug'](_0x2aab('0xe'),_0x4fe8a5,_0x2aab('0xf'),JSON['stringify'](_0x5d47ad));if(_0x5d47ad[_0x2aab('0x10')]){if(_0x5d47ad[_0x2aab('0x10')][_0x2aab('0x11')]===0x1f4){logger['error'](_0x2aab('0xd'),_0x4fe8a5,_0x5d47ad[_0x2aab('0x10')][_0x2aab('0x12')]);return _0xf6602a(_0x5d47ad[_0x2aab('0x10')][_0x2aab('0x12')]);}logger[_0x2aab('0x10')]('SmsApplication,\x20%s,\x20%s',_0x4fe8a5,_0x5d47ad['error'][_0x2aab('0x12')]);return _0x494216(_0x5d47ad['error']['message']);}else{logger[_0x2aab('0xc')](_0x2aab('0xd'),_0x4fe8a5,_0x2aab('0xf'));_0x494216(_0x5d47ad[_0x2aab('0x13')][_0x2aab('0x12')]);}})[_0x2aab('0x14')](function(_0x543ca0){logger[_0x2aab('0x10')]('SmsApplication,\x20%s,\x20%s',_0x4fe8a5,_0x543ca0);_0xf6602a(_0x543ca0);});});}
\ No newline at end of file
+var _0x4be6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x33457e,_0x2887a5){var _0x23f975=function(_0x40d6e1){while(--_0x40d6e1){_0x33457e['push'](_0x33457e['shift']());}};_0x23f975(++_0x2887a5);}(_0x4be6,0xb5));var _0x64be=function(_0x2c5315,_0x3696d8){_0x2c5315=_0x2c5315-0x0;var _0x934ff9=_0x4be6[_0x2c5315];return _0x934ff9;};'use strict';var _=require('lodash');var util=require(_0x64be('0x0'));var moment=require(_0x64be('0x1'));var BPromise=require(_0x64be('0x2'));var rs=require(_0x64be('0x3'));var fs=require('fs');var Redis=require(_0x64be('0x4'));var db=require(_0x64be('0x5'))['db'];var utils=require(_0x64be('0x6'));var logger=require(_0x64be('0x7'))(_0x64be('0x8'));var config=require(_0x64be('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x64be('0xa')][_0x64be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e8639,_0x5b00b4,_0x19bdb3){return new BPromise(function(_0x21fcb7,_0x50d57f){return client[_0x64be('0xc')](_0x3e8639,_0x19bdb3)['then'](function(_0x44895b){logger[_0x64be('0xd')]('SmsApplication,\x20%s,\x20%s',_0x5b00b4,_0x64be('0xe'));logger[_0x64be('0xf')](_0x64be('0x10'),_0x5b00b4,_0x64be('0xe'),JSON['stringify'](_0x44895b));if(_0x44895b[_0x64be('0x11')]){if(_0x44895b['error'][_0x64be('0x12')]===0x1f4){logger[_0x64be('0x11')](_0x64be('0x13'),_0x5b00b4,_0x44895b[_0x64be('0x11')][_0x64be('0x14')]);return _0x50d57f(_0x44895b['error'][_0x64be('0x14')]);}logger['error'](_0x64be('0x13'),_0x5b00b4,_0x44895b[_0x64be('0x11')][_0x64be('0x14')]);return _0x21fcb7(_0x44895b[_0x64be('0x11')][_0x64be('0x14')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x5b00b4,_0x64be('0xe'));_0x21fcb7(_0x44895b[_0x64be('0x15')][_0x64be('0x14')]);}})[_0x64be('0x16')](function(_0x5035bd){logger['error'](_0x64be('0x13'),_0x5b00b4,_0x5035bd);_0x50d57f(_0x5035bd);});});}
\ No newline at end of file
diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js
index 6934654..2812ecd 100644
--- a/server/api/smsInteraction/index.js
+++ b/server/api/smsInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1184=['smsinteraction:update','delete','destroy','removeTags','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','getMessages','download','/:id/messages','post','/:id/tags','sms','smsinteraction:addtags','addTags','/:id','tracked'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1184,0xa0));var _0x4118=function(_0x5e658f,_0x5e3925){_0x5e658f=_0x5e658f-0x0;var _0x1bf1c7=_0x1184[_0x5e658f];return _0x1bf1c7;};'use strict';var multer=require(_0x4118('0x0'));var util=require('util');var path=require(_0x4118('0x1'));var timeout=require(_0x4118('0x2'));var express=require('express');var router=express[_0x4118('0x3')]();var auth=require(_0x4118('0x4'));var interaction=require(_0x4118('0x5'));var config=require(_0x4118('0x6'));var controller=require('./smsInteraction.controller');router[_0x4118('0x7')]('/',auth[_0x4118('0x8')](),controller[_0x4118('0x9')]);router[_0x4118('0x7')]('/describe',auth[_0x4118('0x8')](),controller[_0x4118('0xa')]);router[_0x4118('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4118('0xb')]);router['get']('/:id/messages',auth[_0x4118('0x8')](),controller[_0x4118('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x4118('0xd')]);router['post']('/',auth[_0x4118('0x8')](),controller['create']);router['post'](_0x4118('0xe'),auth['isAuthenticated'](),controller['addMessage']);router[_0x4118('0xf')](_0x4118('0x10'),auth[_0x4118('0x8')](),interaction['tracked'](_0x4118('0x11'),_0x4118('0x12')),controller[_0x4118('0x13')]);router['put'](_0x4118('0x14'),auth['isAuthenticated'](),interaction[_0x4118('0x15')](_0x4118('0x11'),_0x4118('0x16')),controller['update']);router[_0x4118('0x17')](_0x4118('0x14'),auth[_0x4118('0x8')](),interaction[_0x4118('0x15')](_0x4118('0x11'),'smsinteraction:destroy'),controller[_0x4118('0x18')]);router[_0x4118('0x17')](_0x4118('0x10'),auth[_0x4118('0x8')](),controller[_0x4118('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x0e56=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','sms','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout'];(function(_0x15c261,_0x4b7295){var _0x395393=function(_0x30b535){while(--_0x30b535){_0x15c261['push'](_0x15c261['shift']());}};_0x395393(++_0x4b7295);}(_0x0e56,0xf5));var _0x60e5=function(_0x2dd25a,_0x473907){_0x2dd25a=_0x2dd25a-0x0;var _0x59f26c=_0x0e56[_0x2dd25a];return _0x59f26c;};'use strict';var multer=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var path=require('path');var timeout=require(_0x60e5('0x2'));var express=require(_0x60e5('0x3'));var router=express['Router']();var auth=require(_0x60e5('0x4'));var interaction=require(_0x60e5('0x5'));var config=require(_0x60e5('0x6'));var controller=require(_0x60e5('0x7'));router[_0x60e5('0x8')]('/',auth[_0x60e5('0x9')](),controller[_0x60e5('0xa')]);router['get'](_0x60e5('0xb'),auth[_0x60e5('0x9')](),controller[_0x60e5('0xc')]);router[_0x60e5('0x8')]('/:id',auth[_0x60e5('0x9')](),controller[_0x60e5('0xd')]);router[_0x60e5('0x8')](_0x60e5('0xe'),auth[_0x60e5('0x9')](),controller[_0x60e5('0xf')]);router[_0x60e5('0x8')](_0x60e5('0x10'),auth[_0x60e5('0x9')](),controller[_0x60e5('0x11')]);router[_0x60e5('0x12')]('/',auth[_0x60e5('0x9')](),controller[_0x60e5('0x13')]);router[_0x60e5('0x12')](_0x60e5('0xe'),auth[_0x60e5('0x9')](),controller['addMessage']);router[_0x60e5('0x12')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x60e5('0x14')](_0x60e5('0x15'),'smsinteraction:addtags'),controller[_0x60e5('0x16')]);router[_0x60e5('0x17')](_0x60e5('0x18'),auth[_0x60e5('0x9')](),interaction['tracked'](_0x60e5('0x15'),_0x60e5('0x19')),controller[_0x60e5('0x1a')]);router[_0x60e5('0x1b')](_0x60e5('0x18'),auth[_0x60e5('0x9')](),interaction[_0x60e5('0x14')](_0x60e5('0x15'),_0x60e5('0x1c')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x60e5('0x1d')]);module[_0x60e5('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js
index 6988858..971d010 100644
--- a/server/api/smsInteraction/smsInteraction.attributes.js
+++ b/server/api/smsInteraction/smsInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x3071('0x0')]={'closed':{'type':Sequelize[_0x3071('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3071('0x2')]},'disposition':{'type':Sequelize[_0x3071('0x3')]},'note':{'type':Sequelize[_0x3071('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3071('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3071('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xbaf0=['DATE','STRING','ENUM','out','moment','exports','BOOLEAN'];(function(_0x5971af,_0x302312){var _0x367da3=function(_0x30cedd){while(--_0x30cedd){_0x5971af['push'](_0x5971af['shift']());}};_0x367da3(++_0x302312);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'closed':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0baf('0x3')]},'disposition':{'type':Sequelize[_0x0baf('0x4')]},'note':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0baf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js
index 6b2b751..7a1727f 100644
--- a/server/api/smsInteraction/smsInteraction.controller.js
+++ b/server/api/smsInteraction/smsInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb94=['type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','select','field','from','u.id','ui.SmsInteractionId','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','having','`\x20=\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','some','compact','isEmpty','SmsAccountId','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20>\x200','isArray','tag','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','merge','Account.key','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','show','params','includeAll','include','options','create','destroy','describe','addMessage','SmsMessage','ids','omit','findOne','format','findAll','rows','addTags','setTags','spread','color','smsInteractionTags:save','removeTags','download','root','files','tmp','join','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Messages','secret','SmsAccount','Account','Owner','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','System','direction','renderFile','server','views','downloadInteraction.html','toFile','transcript-','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','socket.io-emitter','redis','register','end','status','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','SmsInteraction','rawAttributes'];(function(_0xae06d3,_0x572d98){var _0x284f15=function(_0x28c18a){while(--_0x28c18a){_0xae06d3['push'](_0xae06d3['shift']());}};_0x284f15(++_0x572d98);}(_0xdb94,0xab));var _0x4db9=function(_0x23fe6f,_0x52f60e){_0x23fe6f=_0x23fe6f-0x0;var _0x111a64=_0xdb94[_0x23fe6f];return _0x111a64;};'use strict';var pdf=require(_0x4db9('0x0'));var emlformat=require(_0x4db9('0x1'));var rimraf=require(_0x4db9('0x2'));var zipdir=require(_0x4db9('0x3'));var jsonpatch=require(_0x4db9('0x4'));var rp=require('request-promise');var moment=require(_0x4db9('0x5'));var BPromise=require(_0x4db9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4db9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4db9('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4db9('0x18'))(new Redis(config[_0x4db9('0x19')]));require('./smsInteraction.socket')[_0x4db9('0x1a')](socket);function respondWithStatusCode(_0x1f9638,_0x452896){_0x452896=_0x452896||0xcc;return function(_0x22667c){if(_0x22667c){return _0x1f9638['sendStatus'](_0x452896);}return _0x1f9638['status'](_0x452896)[_0x4db9('0x1b')]();};}function respondWithResult(_0x34de1a,_0x4a037f){_0x4a037f=_0x4a037f||0xc8;return function(_0xadc104){if(_0xadc104){return _0x34de1a[_0x4db9('0x1c')](_0x4a037f)['json'](_0xadc104);}};}function respondWithFilteredResult(_0x5a85c4,_0x250a80){return function(_0x143b88){if(_0x143b88){var _0x462af3=_0x143b88[_0x4db9('0x1d')],_0xa693c4=_0x250a80[_0x4db9('0x1e')],_0x1d3c33=_0x250a80[_0x4db9('0x1e')]+_0x250a80['limit'],_0x55494a;if(_0x1d3c33>=_0x462af3){_0x1d3c33=_0x462af3;_0x55494a=0xc8;}else{_0x55494a=0xce;}_0x5a85c4[_0x4db9('0x1c')](_0x55494a);return _0x5a85c4[_0x4db9('0x1f')](_0x4db9('0x20'),_0xa693c4+'-'+_0x1d3c33+'/'+_0x462af3)['json'](_0x143b88);}return null;};}function patchUpdates(_0x46b522){return function(_0x2e8f95){try{jsonpatch[_0x4db9('0x21')](_0x2e8f95,_0x46b522,!![]);}catch(_0x46fc3d){return BPromise[_0x4db9('0x22')](_0x46fc3d);}return _0x2e8f95[_0x4db9('0x23')]();};}function saveUpdates(_0x3585d5,_0x5aef3b){return function(_0x4ceb0c){if(_0x4ceb0c){return _0x4ceb0c[_0x4db9('0x24')](_0x3585d5)[_0x4db9('0x25')](function(_0x319475){return _0x319475;});}return null;};}function removeEntity(_0x4aaa84,_0x213daa){return function(_0xdac966){if(_0xdac966){return _0xdac966['destroy']()[_0x4db9('0x25')](function(){_0x4aaa84[_0x4db9('0x1c')](0xcc)[_0x4db9('0x1b')]();});}};}function handleEntityNotFound(_0x4dbb1b,_0x3c8237){return function(_0xd250c5){if(!_0xd250c5){_0x4dbb1b[_0x4db9('0x26')](0x194);}return _0xd250c5;};}function handleError(_0x2d330e,_0x3f9f7e){_0x3f9f7e=_0x3f9f7e||0x1f4;return function(_0x385e22){logger[_0x4db9('0x27')](_0x385e22[_0x4db9('0x28')]);if(_0x385e22[_0x4db9('0x29')]){delete _0x385e22[_0x4db9('0x29')];}_0x2d330e[_0x4db9('0x1c')](_0x3f9f7e)[_0x4db9('0x2a')](_0x385e22);};}function getInteractionUsers(_0x2d646d,_0x20f133){return new BPromise(function(_0x583861,_0x5031fe){try{if(_0x20f133[_0x2d646d['id']]){_0x2d646d[_0x4db9('0x2b')]=_[_0x4db9('0x2c')](_0x20f133[_0x2d646d['id']],function(_0x119371){return{'id':_0x119371['id'],'fullname':_0x119371[_0x4db9('0x2d')]};});}}catch(_0x2af884){_0x5031fe(_0x2af884);}_0x583861(_0x2d646d);});}function getInteractionTags(_0x459131,_0x4dc946){return new BPromise(function(_0x375834,_0x554eef){try{if(_0x459131[_0x4db9('0x2e')]){_0x459131[_0x4db9('0x2f')]=[];_0x459131[_0x4db9('0x2e')][_0x4db9('0x30')](',')[_0x4db9('0x31')](function(_0x515f3a){_0x459131['Tags'][_0x4db9('0x32')](_0x4dc946[_0x515f3a]);});}delete _0x459131['TagIds'];}catch(_0x337d74){_0x554eef(_0x337d74);}_0x375834(_0x459131);});}function updateSmsInteraction(_0xddc8b1,_0x4f5b57,_0x430711){return new BPromise(function(_0x3131ba,_0x32c12d){return getInteractionUsers(_0xddc8b1,_0x430711)['then'](function(_0x34f480){return getInteractionTags(_0x34f480,_0x4f5b57);})['then'](function(_0x40226c){_0x3131ba(_0x40226c);})[_0x4db9('0x33')](function(_0x1f4959){_0x32c12d(_0x1f4959);});});}exports['index']=function(_0x4f17a0,_0x2a9b6b){var _0x1494bc={},_0x12a208={},_0x3aec38={'count':0x0,'rows':[]};var _0x2dca24=_[_0x4db9('0x2c')](db[_0x4db9('0x34')][_0x4db9('0x35')],function(_0x4289f3){return{'name':_0x4289f3['fieldName'],'type':_0x4289f3[_0x4db9('0x36')][_0x4db9('0x37')]};});_0x12a208[_0x4db9('0x38')]=_[_0x4db9('0x2c')](_0x2dca24,'name');_0x12a208[_0x4db9('0x39')]=_[_0x4db9('0x3a')](_0x4f17a0[_0x4db9('0x39')]);_0x12a208['filters']=_[_0x4db9('0x3b')](_0x12a208[_0x4db9('0x38')],_0x12a208[_0x4db9('0x39')]);_0x1494bc[_0x4db9('0x3c')]=_['intersection'](_0x12a208['model'],qs[_0x4db9('0x3d')](_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x3d')]));_0x1494bc[_0x4db9('0x3c')]=_0x1494bc[_0x4db9('0x3c')]['length']?_0x1494bc[_0x4db9('0x3c')]:_0x12a208[_0x4db9('0x38')];if(!_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x3e')](_0x4db9('0x3f'))){_0x1494bc['limit']=qs[_0x4db9('0x40')](_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x40')]);_0x1494bc['offset']=qs[_0x4db9('0x1e')](_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x1e')]);}_0x1494bc[_0x4db9('0x41')]=qs[_0x4db9('0x42')](_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x42')]);_0x1494bc[_0x4db9('0x43')]=qs[_0x4db9('0x44')](_[_0x4db9('0x45')](_0x4f17a0['query'],_0x12a208['filters']),_0x2dca24);var _0x48aaf5=[];var _0x22a021=squel[_0x4db9('0x46')]()['field']('id')[_0x4db9('0x47')](_0x4db9('0x29'))['field']('color')[_0x4db9('0x48')]('tools_tags');var _0x16be76=squel[_0x4db9('0x46')]()['field'](_0x4db9('0x49'))[_0x4db9('0x47')]('u.fullname')[_0x4db9('0x47')](_0x4db9('0x4a'))[_0x4db9('0x48')]('user_has_sms_interactions','ui')['left_join'](_0x4db9('0x4b'),'u',_0x4db9('0x4c'));var _0x719001=squel[_0x4db9('0x46')]()[_0x4db9('0x48')](_0x4db9('0x4d'),'i')[_0x4db9('0x4e')](_0x4db9('0x4f'),'c',_0x4db9('0x50'))[_0x4db9('0x4e')](_0x4db9('0x4b'),'o',_0x4db9('0x51'))[_0x4db9('0x4e')]('sms_accounts','a',_0x4db9('0x52'))[_0x4db9('0x4e')](_0x4db9('0x53'),'me',_0x4db9('0x54'))[_0x4db9('0x4e')](_0x4db9('0x55'),'it',_0x4db9('0x56'))[_0x4db9('0x4e')](_0x4db9('0x57'),'t',_0x4db9('0x58'));var _0x10dccb=squel['expr']();var _0x4f2e54=[];var _0x36cd58=squel[_0x4db9('0x59')]();var _0x34b366;if(_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x5a')]){_0x34b366=as[_0x4db9('0x5b')](_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x5a')]);var _0x4f1e36=_0x34b366[_0x4db9('0x5c')];for(var _0xcb832e=0x0;_0xcb832e<_0x34b366[_0x4db9('0x5d')][_0x4db9('0x5e')];_0xcb832e++){var _0x3c1ad2=_0x34b366[_0x4db9('0x5d')][_0xcb832e];var _0x1226ea='i';var _0x3db087=_['find'](_0x2dca24,[_0x4db9('0x29'),_0x3c1ad2[_0x4db9('0x47')]]);if(!_0x3db087){switch(_0x3c1ad2[_0x4db9('0x47')]){case _0x4db9('0x5f'):if(_0x3c1ad2[_0x4db9('0x60')]==0x1){_0x719001[_0x4db9('0x61')]('`'+_0x3c1ad2['field']+_0x4db9('0x62'));}else{_0x719001['having']('`'+_0x3c1ad2[_0x4db9('0x47')]+'`\x20>\x200');}break;case'Contact':if(_0x3c1ad2[_0x4db9('0x63')]==='$substring'){if(_0x3c1ad2[_0x4db9('0x60')][_0x4db9('0x30')]('\x20')[_0x4db9('0x5e')]>0x1){_0x10dccb[_0x4f1e36](_0x4db9('0x64'),qs['getFullTextValue'](_0x3c1ad2[_0x4db9('0x60')]),null);}else{var _0x543301='%'+_0x3c1ad2[_0x4db9('0x60')]+'%';_0x10dccb[_0x4f1e36](_0x4db9('0x65'),_0x543301,_0x543301,_0x543301);}}else{_0x3db087=_['find'](_0x2dca24,[_0x4db9('0x29'),'ContactId']);_0x3c1ad2[_0x4db9('0x47')]=_0x4db9('0x66');_0x5bafe4=as[_0x4db9('0x67')](_0x1226ea,_0x3db087[_0x4db9('0x36')],_0x3c1ad2);_0x10dccb[_0x4f1e36](_0x5bafe4[_0x4db9('0x68')],_0x5bafe4[_0x4db9('0x60')][_0x4db9('0x69')],_0x5bafe4[_0x4db9('0x60')][_0x4db9('0x1b')]);}break;case _0x4db9('0x6a'):var _0x19649c=_0x3c1ad2[_0x4db9('0x60')][_0x4db9('0x30')](',')[_0x4db9('0x2c')](function(_0x125b69){return Number(_0x125b69);});_0x19649c['forEach'](function(_0x225382){_0x36cd58['or'](_0x4db9('0x6b'),'%,'+_0x225382+',%');});_0x4f2e54=_['union'](_0x4f2e54,_0x19649c);break;case _0x4db9('0x6c'):if(_0x3c1ad2[_0x4db9('0x63')]===_0x4db9('0x6d')){_0x10dccb[_0x4f1e36](_0x4db9('0x6e'),'%'+_0x3c1ad2[_0x4db9('0x60')]+'%',null);}else{_0x3db087=_[_0x4db9('0x6f')](_0x2dca24,[_0x4db9('0x29'),_0x4db9('0x70')]);_0x3c1ad2[_0x4db9('0x47')]='UserId';_0x5bafe4=as['buildExpression'](_0x1226ea,_0x3db087[_0x4db9('0x36')],_0x3c1ad2);_0x10dccb[_0x4f1e36](_0x5bafe4[_0x4db9('0x68')],_0x5bafe4[_0x4db9('0x60')][_0x4db9('0x69')],_0x5bafe4[_0x4db9('0x60')][_0x4db9('0x1b')]);}break;case _0x4db9('0x71'):_0x5bafe4=as[_0x4db9('0x67')]('me',null,_0x3c1ad2);_0x10dccb[_0x4f1e36](_0x5bafe4[_0x4db9('0x68')],_0x5bafe4[_0x4db9('0x60')]['start'],_0x5bafe4[_0x4db9('0x60')]['end']);break;}}else{var _0x5bafe4=as['buildExpression'](_0x1226ea,_0x3db087['type'],_0x3c1ad2);_0x10dccb[_0x4f1e36](_0x5bafe4[_0x4db9('0x68')],_0x5bafe4['value']['start'],_0x5bafe4[_0x4db9('0x60')][_0x4db9('0x1b')]);}}}else{var _0xf1e173=_(_0x4f17a0[_0x4db9('0x39')])[_0x4db9('0x3a')]()[_0x4db9('0x2c')](function(_0xaea8ff){return _[_0x4db9('0x72')](_0x2dca24,[_0x4db9('0x29'),_0xaea8ff])?_0xaea8ff:undefined;})[_0x4db9('0x73')]()[_0x4db9('0x60')]();if(!_[_0x4db9('0x74')](_0xf1e173)){_0xf1e173[_0x4db9('0x31')](function(_0x1080ab){if(_0x1080ab===_0x4db9('0x75')){_0x719001[_0x4db9('0x43')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x4f17a0['query'][_0x1080ab]));}else if(_0x1080ab===_0x4db9('0x76')){var _0x4de478=JSON[_0x4db9('0x77')](_0x4f17a0[_0x4db9('0x39')][_0x1080ab])[_0x4db9('0x78')];var _0x4ad693=JSON['parse'](_0x4f17a0[_0x4db9('0x39')][_0x1080ab])['$lte'];_0x719001[_0x4db9('0x43')](_0x4db9('0x79'),_0x4de478,_0x4ad693);}else{if(_0x4f17a0[_0x4db9('0x39')][_0x1080ab]===_0x4db9('0x7a')){_0x719001[_0x4db9('0x43')]('i.'+_0x1080ab+'\x20IS\x20NULL');}else{_0x719001[_0x4db9('0x43')]('i.'+_0x1080ab+'\x20=\x20?',_0x4f17a0[_0x4db9('0x39')][_0x1080ab]);}}});}if(_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x7b')]){if(_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x7b')]==0x1){_0x719001['having']('`unreadMessages`\x20=\x200');}else{_0x719001[_0x4db9('0x61')](_0x4db9('0x7c'));}}if(_0x4f17a0['query']['tag']){_0x4f2e54=_[_0x4db9('0x7d')](_0x4f17a0['query'][_0x4db9('0x7e')])?_0x4f17a0['query'][_0x4db9('0x7e')]:new Array(_0x4f17a0[_0x4db9('0x39')]['tag']);_0x4f2e54['forEach'](function(_0x3de95c){_0x36cd58['or'](_0x4db9('0x6b'),'%,'+_0x3de95c+',%');});}if(_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x7f')]){var _0x3e85aa=_0x4f17a0['query']['filter']['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x4db9('0x80'));if(qs[_0x4db9('0x81')](_0x3e85aa)){_0x10dccb['or'](_0x4db9('0x82'),_0x3e85aa+'%')['or'](_0x4db9('0x83'),_0x3e85aa+'%');}else{_0x10dccb['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4db9('0x84')](_0x3e85aa))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3e85aa+'%');}}}_0x719001[_0x4db9('0x43')](_0x10dccb);_0x719001[_0x4db9('0x85')](_0x4db9('0x86'));var _0x372573={'type':db[_0x4db9('0x87')][_0x4db9('0x88')][_0x4db9('0x89')],'raw':!![]};var _0x521622=_0x719001[_0x4db9('0x8a')]();_0x521622[_0x4db9('0x47')](_0x4db9('0x86'));_0x521622['field'](_0x4db9('0x8b'),_0x4db9('0x5f'));if(_0x1494bc['order']){_0x1494bc['order'][_0x4db9('0x31')](function(_0x5aa698){_0x719001['order']('i.'+_0x5aa698[0x0],_0x5aa698[0x1]===_0x4db9('0x8c')?![]:!![]);});}if(!_[_0x4db9('0x74')](_0x4f2e54)){_0x719001[_0x4db9('0x61')](_0x36cd58);_0x521622['where']('t.id\x20IN\x20?',_0x4f2e54);}BPromise['resolve']()['then'](function(){if(!_0x34b366){if(_0x4f17a0['query'][_0x4db9('0x75')]||_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x8d')])return;_0x521622[_0x4db9('0x43')](_0x4db9('0x8e'));_0x719001[_0x4db9('0x43')](_0x4db9('0x8e'));return;}return _0x4f17a0[_0x4db9('0x8f')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x4db9('0x25')](function(_0x427434){if(_[_0x4db9('0x74')](_0x427434)){_0x521622[_0x4db9('0x43')](_0x4db9('0x90'));_0x719001[_0x4db9('0x43')](_0x4db9('0x90'));}else{_0x521622[_0x4db9('0x43')]('i.SmsAccountId\x20IN\x20?',_[_0x4db9('0x2c')](_0x427434,'id'));_0x719001['where'](_0x4db9('0x91'),_[_0x4db9('0x2c')](_0x427434,'id'));}});})[_0x4db9('0x25')](function(){db[_0x4db9('0x92')]['query'](_0x521622['toString'](),_0x372573)[_0x4db9('0x25')](function(_0x5912c9){_0x3aec38[_0x4db9('0x1d')]=_0x5912c9[_0x4db9('0x5e')];if(_0x3aec38[_0x4db9('0x1d')]===0x0)return[];return db[_0x4db9('0x92')][_0x4db9('0x39')](_0x22a021[_0x4db9('0x93')](),_0x372573)[_0x4db9('0x25')](function(_0xdd8823){_0x48aaf5=_['keyBy'](_0xdd8823,'id');_0x372573=_[_0x4db9('0x94')](_0x372573,{'model':db[_0x4db9('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f17a0[_0x4db9('0x39')][_0x4db9('0x3d')]){_0x1494bc['attributes'][_0x4db9('0x31')](function(_0x18391e){_0x719001['field']('i.'+_0x18391e);});}else{_0x719001[_0x4db9('0x47')](_0x4db9('0x8b'),_0x4db9('0x5f'));_0x719001['field']('a.key',_0x4db9('0x95'));_0x719001[_0x4db9('0x47')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x719001[_0x4db9('0x47')](_0x4db9('0x96'));_0x719001[_0x4db9('0x47')](_0x4db9('0x97'),_0x4db9('0x98'));_0x719001[_0x4db9('0x47')](_0x4db9('0x99'),_0x4db9('0x9a'));_0x719001[_0x4db9('0x47')](_0x4db9('0x9b'),_0x4db9('0x9c'));_0x719001[_0x4db9('0x47')](_0x4db9('0x9d'),_0x4db9('0x9e'));_0x719001[_0x4db9('0x47')]('c.mobile',_0x4db9('0x9f'));_0x719001['field'](_0x4db9('0xa0'),'Contact.fax');_0x719001[_0x4db9('0x47')](_0x4db9('0xa1'),_0x4db9('0xa2'));_0x719001[_0x4db9('0x47')](_0x4db9('0xa3'),_0x4db9('0xa4'));_0x719001[_0x4db9('0x47')](_0x4db9('0xa5'),_0x4db9('0x2e'));}if(_0x1494bc[_0x4db9('0x40')])_0x719001[_0x4db9('0x40')](_0x1494bc[_0x4db9('0x40')]);if(_0x1494bc['offset'])_0x719001[_0x4db9('0x1e')](_0x1494bc[_0x4db9('0x1e')]);return db['sequelize'][_0x4db9('0x39')](_0x719001[_0x4db9('0x93')](),_0x372573);})[_0x4db9('0x25')](function(_0x29e429){_0x16be76['where']('ui.SmsInteractionId\x20IN\x20?',_[_0x4db9('0x2c')](_0x29e429,'id'));return db['sequelize'][_0x4db9('0x39')](_0x16be76[_0x4db9('0x93')](),_0x372573)[_0x4db9('0x25')](function(_0x27eeca){var _0x44a9e8=_[_0x4db9('0xa6')](_0x27eeca,'SmsInteractionId');var _0xe17e8e=[];_0x29e429[_0x4db9('0x31')](function(_0x3d02c1){_0xe17e8e[_0x4db9('0x32')](updateSmsInteraction(_0x3d02c1,_0x48aaf5,_0x44a9e8));});return BPromise[_0x4db9('0xa7')](_0xe17e8e);});});})[_0x4db9('0x25')](function(_0x41bde3){_0x3aec38['rows']=_0x41bde3;return _0x3aec38;})[_0x4db9('0x25')](respondWithFilteredResult(_0x2a9b6b,_0x1494bc));})[_0x4db9('0x33')](handleError(_0x2a9b6b,null));};exports[_0x4db9('0xa8')]=function(_0x1e47b3,_0x5ed0fe){var _0x49594a={'raw':![],'where':{'id':_0x1e47b3[_0x4db9('0xa9')]['id']}},_0x564dcf={};_0x564dcf[_0x4db9('0x38')]=_[_0x4db9('0x3a')](db['SmsInteraction']['rawAttributes']);_0x564dcf[_0x4db9('0x39')]=_[_0x4db9('0x3a')](_0x1e47b3['query']);_0x564dcf['filters']=_[_0x4db9('0x3b')](_0x564dcf[_0x4db9('0x38')],_0x564dcf['query']);_0x49594a['attributes']=_[_0x4db9('0x3b')](_0x564dcf['model'],qs['fields'](_0x1e47b3[_0x4db9('0x39')][_0x4db9('0x3d')]));_0x49594a[_0x4db9('0x3c')]=_0x49594a['attributes'][_0x4db9('0x5e')]?_0x49594a['attributes']:_0x564dcf[_0x4db9('0x38')];if(_0x1e47b3['query'][_0x4db9('0xaa')]){_0x49594a[_0x4db9('0xab')]=[{'all':!![]}];}_0x49594a=_[_0x4db9('0x94')]({},_0x49594a,_0x1e47b3[_0x4db9('0xac')]);return db[_0x4db9('0x34')][_0x4db9('0x6f')](_0x49594a)[_0x4db9('0x25')](handleEntityNotFound(_0x5ed0fe,null))['then'](respondWithResult(_0x5ed0fe,null))['catch'](handleError(_0x5ed0fe,null));};exports['create']=function(_0x5dc771,_0x1de02e){return db['SmsInteraction'][_0x4db9('0xad')](_0x5dc771['body'],{})['then'](respondWithResult(_0x1de02e,0xc9))[_0x4db9('0x33')](handleError(_0x1de02e,null));};exports['update']=function(_0x47512a,_0x3495ec){if(_0x47512a[_0x4db9('0x71')]['id']){delete _0x47512a[_0x4db9('0x71')]['id'];}return db[_0x4db9('0x34')][_0x4db9('0x6f')]({'where':{'id':_0x47512a[_0x4db9('0xa9')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x3495ec,null))[_0x4db9('0x25')](saveUpdates(_0x47512a[_0x4db9('0x71')],null))[_0x4db9('0x25')](respondWithResult(_0x3495ec,null))[_0x4db9('0x33')](handleError(_0x3495ec,null));};exports[_0x4db9('0xae')]=function(_0x2f19a6,_0x2f1200){return db['SmsInteraction'][_0x4db9('0x6f')]({'where':{'id':_0x2f19a6[_0x4db9('0xa9')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x2f1200,null))[_0x4db9('0x25')](removeEntity(_0x2f1200,null))[_0x4db9('0x33')](handleError(_0x2f1200,null));};exports[_0x4db9('0xaf')]=function(_0x16f72f,_0x5dc000){return db[_0x4db9('0x34')][_0x4db9('0xaf')]()['then'](respondWithResult(_0x5dc000,null))[_0x4db9('0x33')](handleError(_0x5dc000,null));};exports[_0x4db9('0xb0')]=function(_0x43f030,_0x5e293f,_0x5059ed){return db[_0x4db9('0xb1')][_0x4db9('0x6f')]({'where':{'id':_0x43f030[_0x4db9('0xa9')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x5e293f,null))['then'](function(_0x11de91){if(_0x11de91){return _0x11de91[_0x4db9('0xb0')](_0x43f030[_0x4db9('0x71')][_0x4db9('0xb2')],_[_0x4db9('0xb3')](_0x43f030['body'],[_0x4db9('0xb2'),'id'])||{});}})[_0x4db9('0x25')](respondWithResult(_0x5e293f,null))[_0x4db9('0x33')](handleError(_0x5e293f,null));};exports['getMessages']=function(_0xcf3981,_0x518d8b,_0x5ddae1){var _0x25577b={'raw':![],'where':{}};var _0x22d686={};var _0x12a0c0={'count':0x0,'rows':[]};return db[_0x4db9('0x34')][_0x4db9('0xb4')]({'where':{'id':_0xcf3981[_0x4db9('0xa9')]['id']}})['then'](handleEntityNotFound(_0x518d8b,null))[_0x4db9('0x25')](function(_0x474fb0){if(_0x474fb0){_0x22d686['model']=_[_0x4db9('0x3a')](db[_0x4db9('0xb1')][_0x4db9('0x35')]);_0x22d686['query']=_[_0x4db9('0x3a')](_0xcf3981[_0x4db9('0x39')]);_0x22d686[_0x4db9('0x44')]=_[_0x4db9('0x3b')](_0x22d686[_0x4db9('0x38')],_0x22d686[_0x4db9('0x39')]);_0x25577b[_0x4db9('0x3c')]=_['intersection'](_0x22d686[_0x4db9('0x38')],qs[_0x4db9('0x3d')](_0xcf3981['query'][_0x4db9('0x3d')]));_0x25577b[_0x4db9('0x3c')]=_0x25577b[_0x4db9('0x3c')][_0x4db9('0x5e')]?_0x25577b[_0x4db9('0x3c')]:_0x22d686[_0x4db9('0x38')];if(!_0xcf3981['query']['hasOwnProperty'](_0x4db9('0x3f'))){_0x25577b[_0x4db9('0x40')]=qs[_0x4db9('0x40')](_0xcf3981[_0x4db9('0x39')][_0x4db9('0x40')]);_0x25577b['offset']=qs[_0x4db9('0x1e')](_0xcf3981[_0x4db9('0x39')][_0x4db9('0x1e')]);}_0x25577b['order']=qs[_0x4db9('0x42')](_0xcf3981[_0x4db9('0x39')]['sort']);_0x25577b[_0x4db9('0x43')]=qs[_0x4db9('0x44')](_['pick'](_0xcf3981[_0x4db9('0x39')],_0x22d686[_0x4db9('0x44')]));_0x25577b[_0x4db9('0x43')]['SmsInteractionId']=_0x474fb0['id'];if(_0xcf3981['query']['filter']){_0x25577b[_0x4db9('0x43')]=_[_0x4db9('0x94')](_0x25577b['where'],{'$or':_[_0x4db9('0x2c')](_0x25577b[_0x4db9('0x3c')],function(_0x6dc7ac){var _0x39c33a={};_0x39c33a[_0x6dc7ac]={'$like':'%'+_0xcf3981[_0x4db9('0x39')][_0x4db9('0x7f')]+'%'};return _0x39c33a;})});}if(_0xcf3981[_0x4db9('0x39')]['$gte']){var _0x22ba86=_0xcf3981['query']['$gte'][_0x4db9('0x30')](',');var _0x509b91={};_0x509b91[_0x22ba86[0x0]]={'$gte':moment(_0x22ba86[0x1])[_0x4db9('0xb5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x25577b['where']=_['merge'](_0x25577b['where'],_0x509b91);}_0x25577b=_[_0x4db9('0x94')]({},_0x25577b,_0xcf3981[_0x4db9('0xac')]);return db[_0x4db9('0xb1')][_0x4db9('0x1d')]({'where':_0x25577b['where']})[_0x4db9('0x25')](function(_0x28d14c){_0x12a0c0['count']=_0x28d14c;if(_0xcf3981[_0x4db9('0x39')][_0x4db9('0xaa')]){_0x25577b[_0x4db9('0xab')]=[{'all':!![]}];}return db[_0x4db9('0xb1')][_0x4db9('0xb6')](_0x25577b);})[_0x4db9('0x25')](function(_0x5c35f0){_0x12a0c0[_0x4db9('0xb7')]=_0x5c35f0;return _0x12a0c0;});}})[_0x4db9('0x25')](respondWithFilteredResult(_0x518d8b,_0x25577b))['catch'](handleError(_0x518d8b,null));};exports[_0x4db9('0xb8')]=function(_0x131e92,_0x2e89cb,_0x19e6be){return db[_0x4db9('0x34')][_0x4db9('0x6f')]({'where':{'id':_0x131e92[_0x4db9('0xa9')]['id']}})['then'](handleEntityNotFound(_0x2e89cb,null))[_0x4db9('0x25')](function(_0x1270f9){if(_0x1270f9){return _0x1270f9[_0x4db9('0xb9')](_0x131e92['body'][_0x4db9('0xb2')],_['omit'](_0x131e92[_0x4db9('0x71')],[_0x4db9('0xb2'),'id'])||{})[_0x4db9('0xba')](function(){return db[_0x4db9('0x6a')][_0x4db9('0xb6')]({'attributes':['id','name',_0x4db9('0xbb')],'where':{'id':_0x131e92[_0x4db9('0x71')]['ids']}});})[_0x4db9('0x25')](function(_0x5d5132){socket['emit'](_0x4db9('0xbc'),{'id':Number(_0x131e92[_0x4db9('0xa9')]['id']),'tags':_0x5d5132||[]});return{'id':Number(_0x131e92[_0x4db9('0xa9')]['id']),'tags':_0x5d5132||[]};});}})[_0x4db9('0x25')](respondWithResult(_0x2e89cb,null))[_0x4db9('0x33')](handleError(_0x2e89cb,null));};exports[_0x4db9('0xbd')]=function(_0x1a0de2,_0x3bebc3,_0x56de0e){return db[_0x4db9('0x34')][_0x4db9('0x6f')]({'where':{'id':_0x1a0de2[_0x4db9('0xa9')]['id']}})[_0x4db9('0x25')](handleEntityNotFound(_0x3bebc3,null))[_0x4db9('0x25')](function(_0x4bfe67){if(_0x4bfe67){return _0x4bfe67['removeTags'](_0x1a0de2['query'][_0x4db9('0xb2')]);}})['then'](respondWithStatusCode(_0x3bebc3,null))[_0x4db9('0x33')](handleError(_0x3bebc3,null));};exports[_0x4db9('0xbe')]=function(_0x3b7bdf,_0x5bba48){var _0x205751=moment()['unix']()[_0x4db9('0x93')]();var _0x10e60f=path['join'](config[_0x4db9('0xbf')],'server',_0x4db9('0xc0'),_0x4db9('0xc1'));var _0x30bde3=path[_0x4db9('0xc2')](config[_0x4db9('0xbf')],'server','files','attachments');var _0x2860d6=path[_0x4db9('0xc2')](_0x10e60f,_0x205751);var _0x3ac397=util[_0x4db9('0xb5')](_0x4db9('0xc3'),_0x3b7bdf[_0x4db9('0xa9')]['id'],_0x205751);var _0x3f36a0=path[_0x4db9('0xc2')](_0x10e60f,_0x3ac397);var _0x1d0751=[];_0x1d0751[_0x4db9('0x32')]({'model':db[_0x4db9('0x6c')],'as':_0x4db9('0x6c'),'attributes':['id',_0x4db9('0x2d')],'raw':!![]});_0x1d0751[_0x4db9('0x32')]({'model':db[_0x4db9('0xc4')],'as':_0x4db9('0xc5'),'attributes':['id',_0x4db9('0xc6'),_0x4db9('0xc7')],'raw':!![]});var _0x8a5442=[{'model':db[_0x4db9('0xb1')],'as':_0x4db9('0xc8'),'attributes':['id','body',_0x4db9('0x76'),'direction',_0x4db9('0xc9'),'read'],'include':_0x1d0751}];_0x8a5442[_0x4db9('0x32')]({'model':db[_0x4db9('0xca')],'as':_0x4db9('0xcb'),'attributes':['id',_0x4db9('0x29')]});_0x8a5442['push']({'model':db[_0x4db9('0x6c')],'as':_0x4db9('0xcc'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x4db9('0x6f')]({'where':{'id':_0x3b7bdf[_0x4db9('0xa9')]['id']},'include':_0x8a5442})[_0x4db9('0x25')](handleEntityNotFound(_0x5bba48,null))[_0x4db9('0x25')](function(_0x419cf1){if(_0x419cf1){var _0x161048=_0x419cf1['get']({'plain':!![]});fs[_0x4db9('0xcd')](_0x2860d6);var _0x15956b={'format':'A4','border':_0x4db9('0xce'),'header':{'height':'40px','contents':{'first':_0x4db9('0xcf')}},'footer':{'height':'30px','contents':{'default':util[_0x4db9('0xb5')](_0x4db9('0xd0'),util[_0x4db9('0xb5')](_0x4db9('0xd1'),_0x4db9('0xd2'),_0x161048['id']),moment()[_0x4db9('0xb5')](_0x4db9('0xd3'))[_0x4db9('0x93')]())}}};var _0x18ffad={'channel':_0x4db9('0xd2'),'account':_0x161048['Account'][_0x4db9('0x29')],'agent':_0x161048[_0x4db9('0xcc')]?_0x161048[_0x4db9('0xcc')][_0x4db9('0x2d')]:_0x4db9('0xd4'),'createdAt':moment(_0x161048[_0x4db9('0x76')])[_0x4db9('0xb5')](_0x4db9('0xd5'))['toString'](),'closedAt':_0x161048['closed']?moment(_0x161048['closedAt'])['format'](_0x4db9('0xd5'))['toString']():'','disposition':_0x161048[_0x4db9('0xd6')],'messages':_(_0x161048[_0x4db9('0xc8')])[_0x4db9('0x7f')]({'secret':![]})[_0x4db9('0x2c')](function(_0xae69a1){return{'date':moment(_0xae69a1[_0x4db9('0x76')])[_0x4db9('0xb5')](_0x4db9('0xd5'))[_0x4db9('0x93')](),'sender':_0xae69a1['direction']==='out'?_0xae69a1[_0x4db9('0x6c')]?_0xae69a1[_0x4db9('0x6c')][_0x4db9('0x2d')]:_0x4db9('0xd7'):_0xae69a1[_0x4db9('0xc5')][_0x4db9('0xc6')]+(_0xae69a1[_0x4db9('0xc5')][_0x4db9('0xc7')]?'\x20'+_0xae69a1[_0x4db9('0xc5')][_0x4db9('0xc7')]:''),'body':_0xae69a1[_0x4db9('0x71')],'direction':_0xae69a1[_0x4db9('0xd8')]==='out'?'A':'C','secret':_0xae69a1[_0x4db9('0xc9')],'read':_0xae69a1[_0x4db9('0x7b')]};})[_0x4db9('0x60')]()};return ejs[_0x4db9('0xd9')](path['join'](config['root'],_0x4db9('0xda'),_0x4db9('0xdb'),_0x4db9('0xdc')),{'interaction':_0x18ffad})['then'](function(_0x115964){return new BPromise(function(_0xde1699,_0x4ef644){pdf[_0x4db9('0xad')](_0x115964,_0x15956b)[_0x4db9('0xdd')](path['join'](_0x2860d6,_0x4db9('0xde')+_0x161048['id']+'-'+_0x205751+'.pdf'),function(_0x5750ab,_0x4ae593){if(_0x5750ab)return _0x4ef644(_0x5750ab);_0xde1699(_0x4ae593);});});})['then'](function(){return new BPromise(function(_0x2a8b0e,_0x78de3){zipdir(_0x2860d6,{'saveTo':_0x3f36a0},function(_0x2c5afb,_0x41b8b3){if(_0x2c5afb)return _0x78de3(_0x2c5afb);return _0x2a8b0e(_0x41b8b3);});})[_0x4db9('0x25')](function(){return new BPromise(function(_0x2527f5,_0x4754f3){rimraf(_0x2860d6,function(_0x35599b){if(_0x35599b)_0x4754f3(_0x35599b);return _0x2527f5();});});})[_0x4db9('0x25')](function(){return _0x5bba48['download'](_0x3f36a0,_0x3ac397,function(_0x4df2a7){if(_0x4df2a7){console[_0x4db9('0xdf')]('err',_0x4df2a7);}else{fs[_0x4db9('0xe0')](_0x3f36a0);}});});});}else{return _0x5bba48[_0x4db9('0x26')](0xc8);}})[_0x4db9('0x33')](handleError(_0x5bba48,null));};
\ No newline at end of file
+var _0x70e0=['u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','start','end','keys','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','show','params','includeAll','include','create','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','files','tmp','join','server','transcript-%d-%s.zip','CmContact','lastName','Messages','SmsAccount','Account','Owner','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','%s\x20#%d','Sms','closed','direction','out','System','firstName','renderFile','root','views','toFile','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','sendStatus','status','count','offset','limit','apply','reject','update','then','destroy','error','name','send','map','fullname','Tags','TagIds','split','forEach','catch','index','SmsInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','field','color','from','tools_tags','select'];(function(_0x3295de,_0xa8af13){var _0x138a06=function(_0x124725){while(--_0x124725){_0x3295de['push'](_0x3295de['shift']());}};_0x138a06(++_0xa8af13);}(_0x70e0,0x17b));var _0x070e=function(_0x1dfc97,_0x198024){_0x1dfc97=_0x1dfc97-0x0;var _0x2800bc=_0x70e0[_0x1dfc97];return _0x2800bc;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];config[_0x070e('0x16')]=_[_0x070e('0x17')](config[_0x070e('0x16')],{'host':_0x070e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x070e('0x19'))['register'](socket);function respondWithStatusCode(_0x4a33d2,_0x5bae0f){_0x5bae0f=_0x5bae0f||0xcc;return function(_0x11d2ce){if(_0x11d2ce){return _0x4a33d2[_0x070e('0x1a')](_0x5bae0f);}return _0x4a33d2['status'](_0x5bae0f)['end']();};}function respondWithResult(_0x373d86,_0xeae1a5){_0xeae1a5=_0xeae1a5||0xc8;return function(_0x180897){if(_0x180897){return _0x373d86[_0x070e('0x1b')](_0xeae1a5)['json'](_0x180897);}};}function respondWithFilteredResult(_0x49861b,_0x17e2e4){return function(_0x2bd937){if(_0x2bd937){var _0x38f6e6=_0x2bd937[_0x070e('0x1c')],_0x2060cc=_0x17e2e4[_0x070e('0x1d')],_0x364b3f=_0x17e2e4[_0x070e('0x1d')]+_0x17e2e4[_0x070e('0x1e')],_0x5037eb;if(_0x364b3f>=_0x38f6e6){_0x364b3f=_0x38f6e6;_0x5037eb=0xc8;}else{_0x5037eb=0xce;}_0x49861b[_0x070e('0x1b')](_0x5037eb);return _0x49861b['set']('Content-Range',_0x2060cc+'-'+_0x364b3f+'/'+_0x38f6e6)['json'](_0x2bd937);}return null;};}function patchUpdates(_0x9907cf){return function(_0x3004f0){try{jsonpatch[_0x070e('0x1f')](_0x3004f0,_0x9907cf,!![]);}catch(_0x4be0d7){return BPromise[_0x070e('0x20')](_0x4be0d7);}return _0x3004f0['save']();};}function saveUpdates(_0xf8dd5d,_0x3f6985){return function(_0x27a01e){if(_0x27a01e){return _0x27a01e[_0x070e('0x21')](_0xf8dd5d)[_0x070e('0x22')](function(_0xa86797){return _0xa86797;});}return null;};}function removeEntity(_0xe405e,_0x164cdf){return function(_0x595c7e){if(_0x595c7e){return _0x595c7e[_0x070e('0x23')]()[_0x070e('0x22')](function(){_0xe405e[_0x070e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf17c56,_0x5f3e9d){return function(_0x4a2dbd){if(!_0x4a2dbd){_0xf17c56[_0x070e('0x1a')](0x194);}return _0x4a2dbd;};}function handleError(_0x25f6e,_0x41deb1){_0x41deb1=_0x41deb1||0x1f4;return function(_0x1743cc){logger[_0x070e('0x24')](_0x1743cc['stack']);if(_0x1743cc[_0x070e('0x25')]){delete _0x1743cc[_0x070e('0x25')];}_0x25f6e[_0x070e('0x1b')](_0x41deb1)[_0x070e('0x26')](_0x1743cc);};}function getInteractionUsers(_0x43dd96,_0x28d7f2){return new BPromise(function(_0x1a1892,_0x26373b){try{if(_0x28d7f2[_0x43dd96['id']]){_0x43dd96['Users']=_[_0x070e('0x27')](_0x28d7f2[_0x43dd96['id']],function(_0x351641){return{'id':_0x351641['id'],'fullname':_0x351641[_0x070e('0x28')]};});}}catch(_0x56fc12){_0x26373b(_0x56fc12);}_0x1a1892(_0x43dd96);});}function getInteractionTags(_0x5c5f0d,_0x13097f){return new BPromise(function(_0x46065c,_0xa6c0ab){try{if(_0x5c5f0d['TagIds']){_0x5c5f0d[_0x070e('0x29')]=[];_0x5c5f0d[_0x070e('0x2a')][_0x070e('0x2b')](',')[_0x070e('0x2c')](function(_0x53d473){_0x5c5f0d['Tags']['push'](_0x13097f[_0x53d473]);});}delete _0x5c5f0d['TagIds'];}catch(_0xdf8945){_0xa6c0ab(_0xdf8945);}_0x46065c(_0x5c5f0d);});}function updateSmsInteraction(_0x4e0a7d,_0x1dff97,_0x323cf1){return new BPromise(function(_0x4f8130,_0x47a739){return getInteractionUsers(_0x4e0a7d,_0x323cf1)[_0x070e('0x22')](function(_0x3454c7){return getInteractionTags(_0x3454c7,_0x1dff97);})['then'](function(_0x546a16){_0x4f8130(_0x546a16);})[_0x070e('0x2d')](function(_0x27dd1f){_0x47a739(_0x27dd1f);});});}exports[_0x070e('0x2e')]=function(_0x31fdc5,_0x18f0ad){var _0x5f530d={},_0x482cc2={},_0x24d17d={'count':0x0,'rows':[]};var _0x3011c4=_[_0x070e('0x27')](db[_0x070e('0x2f')][_0x070e('0x30')],function(_0x4deaf8){return{'name':_0x4deaf8[_0x070e('0x31')],'type':_0x4deaf8[_0x070e('0x32')]['key']};});_0x482cc2[_0x070e('0x33')]=_[_0x070e('0x27')](_0x3011c4,'name');_0x482cc2['query']=_['keys'](_0x31fdc5[_0x070e('0x34')]);_0x482cc2[_0x070e('0x35')]=_[_0x070e('0x36')](_0x482cc2[_0x070e('0x33')],_0x482cc2[_0x070e('0x34')]);_0x5f530d['attributes']=_[_0x070e('0x36')](_0x482cc2[_0x070e('0x33')],qs[_0x070e('0x37')](_0x31fdc5['query'][_0x070e('0x37')]));_0x5f530d[_0x070e('0x38')]=_0x5f530d[_0x070e('0x38')]['length']?_0x5f530d[_0x070e('0x38')]:_0x482cc2[_0x070e('0x33')];if(!_0x31fdc5['query'][_0x070e('0x39')]('nolimit')){_0x5f530d[_0x070e('0x1e')]=qs[_0x070e('0x1e')](_0x31fdc5[_0x070e('0x34')][_0x070e('0x1e')]);_0x5f530d[_0x070e('0x1d')]=qs['offset'](_0x31fdc5[_0x070e('0x34')]['offset']);}_0x5f530d['order']=qs[_0x070e('0x3a')](_0x31fdc5[_0x070e('0x34')][_0x070e('0x3a')]);_0x5f530d['where']=qs[_0x070e('0x35')](_[_0x070e('0x3b')](_0x31fdc5[_0x070e('0x34')],_0x482cc2[_0x070e('0x35')]),_0x3011c4);var _0x4a4ee3=[];var _0x13e4e0=squel['select']()['field']('id')['field'](_0x070e('0x25'))[_0x070e('0x3c')](_0x070e('0x3d'))[_0x070e('0x3e')](_0x070e('0x3f'));var _0x562aa4=squel[_0x070e('0x40')]()['field'](_0x070e('0x41'))[_0x070e('0x3c')](_0x070e('0x42'))['field']('ui.SmsInteractionId')[_0x070e('0x3e')]('user_has_sms_interactions','ui')[_0x070e('0x43')](_0x070e('0x44'),'u',_0x070e('0x45'));var _0x5f5675=squel[_0x070e('0x40')]()[_0x070e('0x3e')]('sms_interactions','i')['left_join'](_0x070e('0x46'),'c',_0x070e('0x47'))[_0x070e('0x43')](_0x070e('0x44'),'o',_0x070e('0x48'))['left_join'](_0x070e('0x49'),'a',_0x070e('0x4a'))[_0x070e('0x43')](_0x070e('0x4b'),'me',_0x070e('0x4c'))[_0x070e('0x43')](_0x070e('0x4d'),'it',_0x070e('0x4e'))[_0x070e('0x43')](_0x070e('0x3f'),'t',_0x070e('0x4f'));var _0x3be553=squel[_0x070e('0x50')]();var _0x216d27=[];var _0x402c82=squel['expr']();var _0x171621;if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x51')]){_0x171621=as[_0x070e('0x52')](_0x31fdc5[_0x070e('0x34')][_0x070e('0x51')]);var _0x3f0763=_0x171621[_0x070e('0x53')];for(var _0x1c64d2=0x0;_0x1c64d2<_0x171621['conditions'][_0x070e('0x54')];_0x1c64d2++){var _0x4c22da=_0x171621[_0x070e('0x55')][_0x1c64d2];var _0x2be643='i';var _0x4abbe9=_[_0x070e('0x56')](_0x3011c4,[_0x070e('0x25'),_0x4c22da[_0x070e('0x3c')]]);if(!_0x4abbe9){switch(_0x4c22da[_0x070e('0x3c')]){case _0x070e('0x57'):if(_0x4c22da[_0x070e('0x58')]==0x1){_0x5f5675[_0x070e('0x59')]('`'+_0x4c22da['field']+_0x070e('0x5a'));}else{_0x5f5675['having']('`'+_0x4c22da['field']+_0x070e('0x5b'));}break;case _0x070e('0x5c'):if(_0x4c22da[_0x070e('0x5d')]===_0x070e('0x5e')){if(_0x4c22da[_0x070e('0x58')][_0x070e('0x2b')]('\x20')[_0x070e('0x54')]>0x1){_0x3be553[_0x3f0763](_0x070e('0x5f'),qs['getFullTextValue'](_0x4c22da[_0x070e('0x58')]),null);}else{var _0x51d27d='%'+_0x4c22da['value']+'%';_0x3be553[_0x3f0763](_0x070e('0x60'),_0x51d27d,_0x51d27d,_0x51d27d);}}else{_0x4abbe9=_[_0x070e('0x56')](_0x3011c4,['name',_0x070e('0x61')]);_0x4c22da[_0x070e('0x3c')]=_0x070e('0x61');_0x841c89=as[_0x070e('0x62')](_0x2be643,_0x4abbe9[_0x070e('0x32')],_0x4c22da);_0x3be553[_0x3f0763](_0x841c89[_0x070e('0x63')],_0x841c89[_0x070e('0x58')]['start'],_0x841c89['value']['end']);}break;case _0x070e('0x64'):var _0x1948a5=_0x4c22da[_0x070e('0x58')][_0x070e('0x2b')](',')['map'](function(_0x25f34c){return Number(_0x25f34c);});_0x1948a5['forEach'](function(_0x212710){_0x402c82['or'](_0x070e('0x65'),'%,'+_0x212710+',%');});_0x216d27=_[_0x070e('0x66')](_0x216d27,_0x1948a5);break;case _0x070e('0x67'):if(_0x4c22da[_0x070e('0x5d')]===_0x070e('0x5e')){_0x3be553[_0x3f0763]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4c22da[_0x070e('0x58')]+'%',null);}else{_0x4abbe9=_[_0x070e('0x56')](_0x3011c4,[_0x070e('0x25'),'UserId']);_0x4c22da[_0x070e('0x3c')]=_0x070e('0x68');_0x841c89=as['buildExpression'](_0x2be643,_0x4abbe9[_0x070e('0x32')],_0x4c22da);_0x3be553[_0x3f0763](_0x841c89['text'],_0x841c89[_0x070e('0x58')]['start'],_0x841c89['value']['end']);}break;case _0x070e('0x69'):_0x841c89=as[_0x070e('0x62')]('me',null,_0x4c22da);_0x3be553[_0x3f0763](_0x841c89[_0x070e('0x63')],_0x841c89[_0x070e('0x58')][_0x070e('0x6a')],_0x841c89[_0x070e('0x58')]['end']);break;}}else{var _0x841c89=as['buildExpression'](_0x2be643,_0x4abbe9[_0x070e('0x32')],_0x4c22da);_0x3be553[_0x3f0763](_0x841c89['text'],_0x841c89[_0x070e('0x58')][_0x070e('0x6a')],_0x841c89['value'][_0x070e('0x6b')]);}}}else{var _0x50399e=_(_0x31fdc5[_0x070e('0x34')])[_0x070e('0x6c')]()[_0x070e('0x27')](function(_0x2b172a){return _[_0x070e('0x6d')](_0x3011c4,[_0x070e('0x25'),_0x2b172a])?_0x2b172a:undefined;})[_0x070e('0x6e')]()[_0x070e('0x58')]();if(!_[_0x070e('0x6f')](_0x50399e)){_0x50399e[_0x070e('0x2c')](function(_0x40c560){if(_0x40c560===_0x070e('0x70')){_0x5f5675[_0x070e('0x71')](_0x070e('0x72'),[]['concat'](_0x31fdc5[_0x070e('0x34')][_0x40c560]));}else if(_0x40c560===_0x070e('0x73')){var _0x381c83=JSON[_0x070e('0x74')](_0x31fdc5['query'][_0x40c560])[_0x070e('0x75')];var _0x4e8e58=JSON[_0x070e('0x74')](_0x31fdc5[_0x070e('0x34')][_0x40c560])[_0x070e('0x76')];_0x5f5675[_0x070e('0x71')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x381c83,_0x4e8e58);}else{if(_0x31fdc5[_0x070e('0x34')][_0x40c560]===_0x070e('0x77')){_0x5f5675[_0x070e('0x71')]('i.'+_0x40c560+_0x070e('0x78'));}else{_0x5f5675['where']('i.'+_0x40c560+_0x070e('0x79'),_0x31fdc5['query'][_0x40c560]);}}});}if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x7a')]){if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x7a')]==0x1){_0x5f5675[_0x070e('0x59')]('`unreadMessages`\x20=\x200');}else{_0x5f5675[_0x070e('0x59')](_0x070e('0x7b'));}}if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x7c')]){_0x216d27=_['isArray'](_0x31fdc5[_0x070e('0x34')]['tag'])?_0x31fdc5[_0x070e('0x34')][_0x070e('0x7c')]:new Array(_0x31fdc5[_0x070e('0x34')]['tag']);_0x216d27[_0x070e('0x2c')](function(_0x4d344c){_0x402c82['or'](_0x070e('0x65'),'%,'+_0x4d344c+',%');});}if(_0x31fdc5['query'][_0x070e('0x7d')]){var _0x17b28c=_0x31fdc5['query'][_0x070e('0x7d')]['replace']('\x5c','\x5c\x5c')[_0x070e('0x7e')]('\x27\x27',_0x070e('0x7f'));if(qs['isNumeric'](_0x17b28c)){_0x3be553['or']('i.id\x20LIKE\x20?',_0x17b28c+'%')['or'](_0x070e('0x80'),_0x17b28c+'%');}else{_0x3be553['or'](_0x070e('0x81'),qs[_0x070e('0x82')](_0x17b28c))['or'](_0x070e('0x83'),_0x17b28c+'%');}}}_0x5f5675[_0x070e('0x71')](_0x3be553);_0x5f5675[_0x070e('0x84')](_0x070e('0x85'));var _0x332c8a={'type':db[_0x070e('0x86')][_0x070e('0x87')][_0x070e('0x88')],'raw':!![]};var _0x25670e=_0x5f5675[_0x070e('0x89')]();_0x25670e['field'](_0x070e('0x85'));_0x25670e[_0x070e('0x3c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5f530d[_0x070e('0x8a')]){_0x5f530d[_0x070e('0x8a')][_0x070e('0x2c')](function(_0x24bbc7){_0x5f5675[_0x070e('0x8a')]('i.'+_0x24bbc7[0x0],_0x24bbc7[0x1]===_0x070e('0x8b')?![]:!![]);});}if(!_[_0x070e('0x6f')](_0x216d27)){_0x5f5675[_0x070e('0x59')](_0x402c82);_0x25670e[_0x070e('0x71')](_0x070e('0x8c'),_0x216d27);}BPromise[_0x070e('0x8d')]()[_0x070e('0x22')](function(){if(!_0x171621){if(_0x31fdc5[_0x070e('0x34')]['SmsAccountId']||_0x31fdc5['query']['journey'])return;_0x25670e[_0x070e('0x71')](_0x070e('0x8e'));_0x5f5675[_0x070e('0x71')](_0x070e('0x8e'));return;}return _0x31fdc5['user'][_0x070e('0x8f')]({'attributes':['id'],'raw':!![]})[_0x070e('0x22')](function(_0x416dde){if(_[_0x070e('0x6f')](_0x416dde)){_0x25670e[_0x070e('0x71')](_0x070e('0x90'));_0x5f5675['where'](_0x070e('0x90'));}else{_0x25670e['where'](_0x070e('0x72'),_[_0x070e('0x27')](_0x416dde,'id'));_0x5f5675[_0x070e('0x71')](_0x070e('0x72'),_[_0x070e('0x27')](_0x416dde,'id'));}});})['then'](function(){db[_0x070e('0x91')][_0x070e('0x34')](_0x25670e['toString'](),_0x332c8a)[_0x070e('0x22')](function(_0x1e1d27){_0x24d17d['count']=_0x1e1d27[_0x070e('0x54')];if(_0x24d17d[_0x070e('0x1c')]===0x0)return[];return db[_0x070e('0x91')]['query'](_0x13e4e0[_0x070e('0x92')](),_0x332c8a)[_0x070e('0x22')](function(_0x134b72){_0x4a4ee3=_[_0x070e('0x93')](_0x134b72,'id');_0x332c8a=_[_0x070e('0x94')](_0x332c8a,{'model':db[_0x070e('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x37')]){_0x5f530d[_0x070e('0x38')][_0x070e('0x2c')](function(_0x1b1a0c){_0x5f5675[_0x070e('0x3c')]('i.'+_0x1b1a0c);});}else{_0x5f5675[_0x070e('0x3c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x070e('0x57'));_0x5f5675[_0x070e('0x3c')](_0x070e('0x95'),_0x070e('0x96'));_0x5f5675[_0x070e('0x3c')](_0x070e('0x97'),'Account.mandatoryDisposition');_0x5f5675['field']('i.*');_0x5f5675[_0x070e('0x3c')](_0x070e('0x98'),_0x070e('0x99'));_0x5f5675[_0x070e('0x3c')]('c.lastName',_0x070e('0x9a'));_0x5f5675[_0x070e('0x3c')](_0x070e('0x9b'),'Contact.email');_0x5f5675[_0x070e('0x3c')]('c.phone',_0x070e('0x9c'));_0x5f5675[_0x070e('0x3c')]('c.mobile','Contact.mobile');_0x5f5675[_0x070e('0x3c')](_0x070e('0x9d'),'Contact.fax');_0x5f5675[_0x070e('0x3c')]('o.fullname','Owner.fullname');_0x5f5675['field'](_0x070e('0x9e'),_0x070e('0x9f'));_0x5f5675[_0x070e('0x3c')](_0x070e('0xa0'),_0x070e('0x2a'));}if(_0x5f530d[_0x070e('0x1e')])_0x5f5675[_0x070e('0x1e')](_0x5f530d[_0x070e('0x1e')]);if(_0x5f530d[_0x070e('0x1d')])_0x5f5675[_0x070e('0x1d')](_0x5f530d[_0x070e('0x1d')]);return db[_0x070e('0x91')][_0x070e('0x34')](_0x5f5675[_0x070e('0x92')](),_0x332c8a);})[_0x070e('0x22')](function(_0x3f2bb5){_0x562aa4[_0x070e('0x71')](_0x070e('0xa1'),_[_0x070e('0x27')](_0x3f2bb5,'id'));return db[_0x070e('0x91')][_0x070e('0x34')](_0x562aa4[_0x070e('0x92')](),_0x332c8a)['then'](function(_0x4124cc){var _0x276e6e=_[_0x070e('0xa2')](_0x4124cc,_0x070e('0xa3'));var _0x495403=[];_0x3f2bb5[_0x070e('0x2c')](function(_0x32fa3b){_0x495403[_0x070e('0xa4')](updateSmsInteraction(_0x32fa3b,_0x4a4ee3,_0x276e6e));});return BPromise[_0x070e('0xa5')](_0x495403);});});})[_0x070e('0x22')](function(_0x2ceb4f){_0x24d17d['rows']=_0x2ceb4f;return _0x24d17d;})['then'](respondWithFilteredResult(_0x18f0ad,_0x5f530d));})['catch'](handleError(_0x18f0ad,null));};exports[_0x070e('0xa6')]=function(_0x5a482f,_0x26e9c1){var _0x42f6df={'raw':![],'where':{'id':_0x5a482f[_0x070e('0xa7')]['id']}},_0x4dba5f={};_0x4dba5f[_0x070e('0x33')]=_['keys'](db['SmsInteraction'][_0x070e('0x30')]);_0x4dba5f[_0x070e('0x34')]=_[_0x070e('0x6c')](_0x5a482f[_0x070e('0x34')]);_0x4dba5f[_0x070e('0x35')]=_['intersection'](_0x4dba5f[_0x070e('0x33')],_0x4dba5f['query']);_0x42f6df[_0x070e('0x38')]=_[_0x070e('0x36')](_0x4dba5f['model'],qs[_0x070e('0x37')](_0x5a482f[_0x070e('0x34')][_0x070e('0x37')]));_0x42f6df[_0x070e('0x38')]=_0x42f6df[_0x070e('0x38')][_0x070e('0x54')]?_0x42f6df['attributes']:_0x4dba5f[_0x070e('0x33')];if(_0x5a482f[_0x070e('0x34')][_0x070e('0xa8')]){_0x42f6df[_0x070e('0xa9')]=[{'all':!![]}];}_0x42f6df=_[_0x070e('0x94')]({},_0x42f6df,_0x5a482f['options']);return db[_0x070e('0x2f')][_0x070e('0x56')](_0x42f6df)[_0x070e('0x22')](handleEntityNotFound(_0x26e9c1,null))[_0x070e('0x22')](respondWithResult(_0x26e9c1,null))[_0x070e('0x2d')](handleError(_0x26e9c1,null));};exports[_0x070e('0xaa')]=function(_0x248347,_0x4546eb){return db[_0x070e('0x2f')][_0x070e('0xaa')](_0x248347[_0x070e('0x69')],{})[_0x070e('0x22')](respondWithResult(_0x4546eb,0xc9))[_0x070e('0x2d')](handleError(_0x4546eb,null));};exports[_0x070e('0x21')]=function(_0xf0fde5,_0x3ecfe5){if(_0xf0fde5['body']['id']){delete _0xf0fde5['body']['id'];}return db[_0x070e('0x2f')][_0x070e('0x56')]({'where':{'id':_0xf0fde5['params']['id']}})['then'](handleEntityNotFound(_0x3ecfe5,null))['then'](saveUpdates(_0xf0fde5['body'],null))[_0x070e('0x22')](respondWithResult(_0x3ecfe5,null))[_0x070e('0x2d')](handleError(_0x3ecfe5,null));};exports[_0x070e('0x23')]=function(_0x12ea06,_0x409811){return db[_0x070e('0x2f')][_0x070e('0x56')]({'where':{'id':_0x12ea06[_0x070e('0xa7')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x409811,null))[_0x070e('0x22')](removeEntity(_0x409811,null))['catch'](handleError(_0x409811,null));};exports[_0x070e('0xab')]=function(_0x36cfe2,_0x49c66a){return db[_0x070e('0x2f')][_0x070e('0xab')]()[_0x070e('0x22')](respondWithResult(_0x49c66a,null))[_0x070e('0x2d')](handleError(_0x49c66a,null));};exports['addMessage']=function(_0x2d46fb,_0x36a689,_0x214bea){return db[_0x070e('0xac')]['find']({'where':{'id':_0x2d46fb[_0x070e('0xa7')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x36a689,null))[_0x070e('0x22')](function(_0xebbb53){if(_0xebbb53){return _0xebbb53[_0x070e('0xad')](_0x2d46fb[_0x070e('0x69')][_0x070e('0xae')],_[_0x070e('0xaf')](_0x2d46fb[_0x070e('0x69')],[_0x070e('0xae'),'id'])||{});}})[_0x070e('0x22')](respondWithResult(_0x36a689,null))['catch'](handleError(_0x36a689,null));};exports[_0x070e('0xb0')]=function(_0x2b5210,_0x5e3263,_0x5ccb8d){var _0x6ac3c9={'raw':![],'where':{}};var _0x53f6e7={};var _0x2c759a={'count':0x0,'rows':[]};return db[_0x070e('0x2f')][_0x070e('0xb1')]({'where':{'id':_0x2b5210[_0x070e('0xa7')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x5e3263,null))[_0x070e('0x22')](function(_0x3dc050){if(_0x3dc050){_0x53f6e7['model']=_[_0x070e('0x6c')](db[_0x070e('0xac')][_0x070e('0x30')]);_0x53f6e7[_0x070e('0x34')]=_['keys'](_0x2b5210['query']);_0x53f6e7[_0x070e('0x35')]=_[_0x070e('0x36')](_0x53f6e7[_0x070e('0x33')],_0x53f6e7['query']);_0x6ac3c9[_0x070e('0x38')]=_[_0x070e('0x36')](_0x53f6e7['model'],qs[_0x070e('0x37')](_0x2b5210[_0x070e('0x34')][_0x070e('0x37')]));_0x6ac3c9[_0x070e('0x38')]=_0x6ac3c9[_0x070e('0x38')][_0x070e('0x54')]?_0x6ac3c9['attributes']:_0x53f6e7['model'];if(!_0x2b5210[_0x070e('0x34')]['hasOwnProperty'](_0x070e('0xb2'))){_0x6ac3c9[_0x070e('0x1e')]=qs['limit'](_0x2b5210[_0x070e('0x34')]['limit']);_0x6ac3c9[_0x070e('0x1d')]=qs[_0x070e('0x1d')](_0x2b5210[_0x070e('0x34')][_0x070e('0x1d')]);}_0x6ac3c9[_0x070e('0x8a')]=qs[_0x070e('0x3a')](_0x2b5210['query'][_0x070e('0x3a')]);_0x6ac3c9[_0x070e('0x71')]=qs['filters'](_['pick'](_0x2b5210[_0x070e('0x34')],_0x53f6e7[_0x070e('0x35')]));_0x6ac3c9[_0x070e('0x71')][_0x070e('0xa3')]=_0x3dc050['id'];if(_0x2b5210[_0x070e('0x34')][_0x070e('0x7d')]){_0x6ac3c9[_0x070e('0x71')]=_[_0x070e('0x94')](_0x6ac3c9['where'],{'$or':_[_0x070e('0x27')](_0x6ac3c9[_0x070e('0x38')],function(_0x26a0be){var _0x2f5597={};_0x2f5597[_0x26a0be]={'$like':'%'+_0x2b5210[_0x070e('0x34')][_0x070e('0x7d')]+'%'};return _0x2f5597;})});}if(_0x2b5210[_0x070e('0x34')][_0x070e('0x75')]){var _0x522513=_0x2b5210[_0x070e('0x34')][_0x070e('0x75')][_0x070e('0x2b')](',');var _0xbc61f2={};_0xbc61f2[_0x522513[0x0]]={'$gte':moment(_0x522513[0x1])[_0x070e('0xb3')](_0x070e('0xb4'))};_0x6ac3c9[_0x070e('0x71')]=_[_0x070e('0x94')](_0x6ac3c9[_0x070e('0x71')],_0xbc61f2);}_0x6ac3c9=_[_0x070e('0x94')]({},_0x6ac3c9,_0x2b5210['options']);return db['SmsMessage'][_0x070e('0x1c')]({'where':_0x6ac3c9[_0x070e('0x71')]})[_0x070e('0x22')](function(_0x567202){_0x2c759a[_0x070e('0x1c')]=_0x567202;if(_0x2b5210[_0x070e('0x34')]['includeAll']){_0x6ac3c9[_0x070e('0xa9')]=[{'all':!![]}];}return db[_0x070e('0xac')][_0x070e('0xb5')](_0x6ac3c9);})[_0x070e('0x22')](function(_0x3af8fe){_0x2c759a[_0x070e('0xb6')]=_0x3af8fe;return _0x2c759a;});}})['then'](respondWithFilteredResult(_0x5e3263,_0x6ac3c9))['catch'](handleError(_0x5e3263,null));};exports[_0x070e('0xb7')]=function(_0x3f3d7e,_0x532f83,_0x4055ba){return db[_0x070e('0x2f')][_0x070e('0x56')]({'where':{'id':_0x3f3d7e[_0x070e('0xa7')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x532f83,null))[_0x070e('0x22')](function(_0x4870da){if(_0x4870da){return _0x4870da[_0x070e('0xb8')](_0x3f3d7e[_0x070e('0x69')]['ids'],_[_0x070e('0xaf')](_0x3f3d7e[_0x070e('0x69')],[_0x070e('0xae'),'id'])||{})[_0x070e('0xb9')](function(){return db['Tag']['findAll']({'attributes':['id',_0x070e('0x25'),_0x070e('0x3d')],'where':{'id':_0x3f3d7e[_0x070e('0x69')][_0x070e('0xae')]}});})[_0x070e('0x22')](function(_0x32f1e7){socket[_0x070e('0xba')](_0x070e('0xbb'),{'id':Number(_0x3f3d7e[_0x070e('0xa7')]['id']),'tags':_0x32f1e7||[]});return{'id':Number(_0x3f3d7e[_0x070e('0xa7')]['id']),'tags':_0x32f1e7||[]};});}})['then'](respondWithResult(_0x532f83,null))[_0x070e('0x2d')](handleError(_0x532f83,null));};exports[_0x070e('0xbc')]=function(_0x1de175,_0x205fc7,_0x49f3df){return db[_0x070e('0x2f')][_0x070e('0x56')]({'where':{'id':_0x1de175['params']['id']}})['then'](handleEntityNotFound(_0x205fc7,null))[_0x070e('0x22')](function(_0x4684c7){if(_0x4684c7){return _0x4684c7[_0x070e('0xbc')](_0x1de175['query'][_0x070e('0xae')]);}})[_0x070e('0x22')](respondWithStatusCode(_0x205fc7,null))[_0x070e('0x2d')](handleError(_0x205fc7,null));};exports[_0x070e('0xbd')]=function(_0x34b5ae,_0x5605da){var _0x271bb9=moment()[_0x070e('0xbe')]()['toString']();var _0x2a94f9=path['join'](config['root'],'server',_0x070e('0xbf'),_0x070e('0xc0'));var _0x118a77=path[_0x070e('0xc1')](config['root'],_0x070e('0xc2'),_0x070e('0xbf'),'attachments');var _0x3c6a6e=path[_0x070e('0xc1')](_0x2a94f9,_0x271bb9);var _0x24448e=util[_0x070e('0xb3')](_0x070e('0xc3'),_0x34b5ae[_0x070e('0xa7')]['id'],_0x271bb9);var _0x50fbb4=path[_0x070e('0xc1')](_0x2a94f9,_0x24448e);var _0x4c35db=[];_0x4c35db[_0x070e('0xa4')]({'model':db[_0x070e('0x67')],'as':_0x070e('0x67'),'attributes':['id','fullname'],'raw':!![]});_0x4c35db[_0x070e('0xa4')]({'model':db[_0x070e('0xc4')],'as':_0x070e('0x5c'),'attributes':['id','firstName',_0x070e('0xc5')],'raw':!![]});var _0x3a5086=[{'model':db['SmsMessage'],'as':_0x070e('0xc6'),'attributes':['id',_0x070e('0x69'),'createdAt','direction','secret','read'],'include':_0x4c35db}];_0x3a5086[_0x070e('0xa4')]({'model':db[_0x070e('0xc7')],'as':_0x070e('0xc8'),'attributes':['id',_0x070e('0x25')]});_0x3a5086[_0x070e('0xa4')]({'model':db[_0x070e('0x67')],'as':_0x070e('0xc9'),'attributes':['id',_0x070e('0x28')]});return db['SmsInteraction']['find']({'where':{'id':_0x34b5ae['params']['id']},'include':_0x3a5086})['then'](handleEntityNotFound(_0x5605da,null))[_0x070e('0x22')](function(_0x41e59b){if(_0x41e59b){var _0x28208d=_0x41e59b[_0x070e('0xca')]({'plain':!![]});fs[_0x070e('0xcb')](_0x3c6a6e);var _0x4a07aa={'format':'A4','border':'10px','header':{'height':_0x070e('0xcc'),'contents':{'first':_0x070e('0xcd')}},'footer':{'height':'30px','contents':{'default':util[_0x070e('0xb3')](_0x070e('0xce'),util[_0x070e('0xb3')](_0x070e('0xcf'),_0x070e('0xd0'),_0x28208d['id']),moment()[_0x070e('0xb3')]('YYYY-MM-DD')[_0x070e('0x92')]())}}};var _0x1d48a9={'channel':_0x070e('0xd0'),'account':_0x28208d['Account'][_0x070e('0x25')],'agent':_0x28208d[_0x070e('0xc9')]?_0x28208d[_0x070e('0xc9')][_0x070e('0x28')]:'N.A.','createdAt':moment(_0x28208d[_0x070e('0x73')])[_0x070e('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x070e('0x92')](),'closedAt':_0x28208d[_0x070e('0xd1')]?moment(_0x28208d['closedAt'])[_0x070e('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x070e('0x92')]():'','disposition':_0x28208d['disposition'],'messages':_(_0x28208d[_0x070e('0xc6')])['filter']({'secret':![]})['map'](function(_0x1c4f6c){return{'date':moment(_0x1c4f6c['createdAt'])['format'](_0x070e('0xb4'))[_0x070e('0x92')](),'sender':_0x1c4f6c[_0x070e('0xd2')]===_0x070e('0xd3')?_0x1c4f6c[_0x070e('0x67')]?_0x1c4f6c['User'][_0x070e('0x28')]:_0x070e('0xd4'):_0x1c4f6c[_0x070e('0x5c')][_0x070e('0xd5')]+(_0x1c4f6c[_0x070e('0x5c')][_0x070e('0xc5')]?'\x20'+_0x1c4f6c['Contact'][_0x070e('0xc5')]:''),'body':_0x1c4f6c[_0x070e('0x69')],'direction':_0x1c4f6c[_0x070e('0xd2')]===_0x070e('0xd3')?'A':'C','secret':_0x1c4f6c['secret'],'read':_0x1c4f6c['read']};})[_0x070e('0x58')]()};return ejs[_0x070e('0xd6')](path[_0x070e('0xc1')](config[_0x070e('0xd7')],_0x070e('0xc2'),_0x070e('0xd8'),'downloadInteraction.html'),{'interaction':_0x1d48a9})[_0x070e('0x22')](function(_0x32f28b){return new BPromise(function(_0x1e05c9,_0x3a894e){pdf[_0x070e('0xaa')](_0x32f28b,_0x4a07aa)[_0x070e('0xd9')](path['join'](_0x3c6a6e,'transcript-'+_0x28208d['id']+'-'+_0x271bb9+_0x070e('0xda')),function(_0x43e514,_0x193c72){if(_0x43e514)return _0x3a894e(_0x43e514);_0x1e05c9(_0x193c72);});});})[_0x070e('0x22')](function(){return new BPromise(function(_0x3a8dd7,_0x167139){zipdir(_0x3c6a6e,{'saveTo':_0x50fbb4},function(_0x257569,_0x5d69bc){if(_0x257569)return _0x167139(_0x257569);return _0x3a8dd7(_0x5d69bc);});})[_0x070e('0x22')](function(){return new BPromise(function(_0x5e244a,_0xfe12a6){rimraf(_0x3c6a6e,function(_0x5dc059){if(_0x5dc059)_0xfe12a6(_0x5dc059);return _0x5e244a();});});})['then'](function(){return _0x5605da['download'](_0x50fbb4,_0x24448e,function(_0x383f39){if(_0x383f39){console[_0x070e('0xdb')](_0x070e('0xdc'),_0x383f39);}else{fs[_0x070e('0xdd')](_0x50fbb4);}});});});}else{return _0x5605da[_0x070e('0x1a')](0xc8);}})[_0x070e('0x2d')](handleError(_0x5605da,null));};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js
index c38af7b..98618cd 100644
--- a/server/api/smsInteraction/smsInteraction.events.js
+++ b/server/api/smsInteraction/smsInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb647=['save','update','getUsers','then','setDataValue','Users','map','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners'];(function(_0x50132c,_0x217229){var _0x1b094a=function(_0x11adfd){while(--_0x11adfd){_0x50132c['push'](_0x50132c['shift']());}};_0x1b094a(++_0x217229);}(_0xb647,0xdb));var _0x7b64=function(_0x2daf87,_0x19034e){_0x2daf87=_0x2daf87-0x0;var _0x20b943=_0xb647[_0x2daf87];return _0x20b943;};'use strict';var EventEmitter=require(_0x7b64('0x0'));var SmsInteraction=require(_0x7b64('0x1'))['db'][_0x7b64('0x2')];var SmsMessage=require(_0x7b64('0x1'))['db'][_0x7b64('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7b64('0x4')](0x0);var events={'afterCreate':_0x7b64('0x5'),'afterUpdate':_0x7b64('0x6'),'afterDestroy':'remove'};function emitEvent(_0x36ff12){return function(_0x4aaa21,_0x1daa28,_0x38ebf7){_0x4aaa21[_0x7b64('0x7')]({'attributes':['id'],'raw':!![]})[_0x7b64('0x8')](function(_0xcdec41){_0x4aaa21[_0x7b64('0x9')](_0x7b64('0xa'),_0xcdec41[_0x7b64('0xb')](function(_0x432ced){return{'id':_0x432ced['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x4aaa21['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7b64('0x8')](function(_0x49718f){_0x4aaa21[_0x7b64('0x9')]('unreadMessages',_0x49718f['length']);SmsInteractionEvents[_0x7b64('0xc')](_0x36ff12+':'+_0x4aaa21['id'],_0x4aaa21);SmsInteractionEvents[_0x7b64('0xc')](_0x36ff12,_0x4aaa21);_0x38ebf7(null);})['catch'](_0x38ebf7(null));};}for(var e in events){if(events[_0x7b64('0xd')](e)){var event=events[e];SmsInteraction[_0x7b64('0xe')](e,emitEvent(event));}}module[_0x7b64('0xf')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x9649=['remove','getUsers','then','setDataValue','map','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save'];(function(_0xa64e22,_0x55964f){var _0x1b524b=function(_0x337bca){while(--_0x337bca){_0xa64e22['push'](_0xa64e22['shift']());}};_0x1b524b(++_0x55964f);}(_0x9649,0x19f));var _0x9964=function(_0xddb121,_0x48e80b){_0xddb121=_0xddb121-0x0;var _0x305fc7=_0x9649[_0xddb121];return _0x305fc7;};'use strict';var EventEmitter=require(_0x9964('0x0'));var SmsInteraction=require(_0x9964('0x1'))['db'][_0x9964('0x2')];var SmsMessage=require(_0x9964('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x9964('0x3')](0x0);var events={'afterCreate':_0x9964('0x4'),'afterUpdate':'update','afterDestroy':_0x9964('0x5')};function emitEvent(_0x4b5a66){return function(_0xa0afe,_0x32aeb4,_0x12dd14){_0xa0afe[_0x9964('0x6')]({'attributes':['id'],'raw':!![]})[_0x9964('0x7')](function(_0x1338e7){_0xa0afe[_0x9964('0x8')]('Users',_0x1338e7[_0x9964('0x9')](function(_0x67291b){return{'id':_0x67291b['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0xa0afe['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9964('0x7')](function(_0x3fbce9){_0xa0afe['setDataValue']('unreadMessages',_0x3fbce9[_0x9964('0xa')]);SmsInteractionEvents[_0x9964('0xb')](_0x4b5a66+':'+_0xa0afe['id'],_0xa0afe);SmsInteractionEvents[_0x9964('0xb')](_0x4b5a66,_0xa0afe);_0x12dd14(null);})[_0x9964('0xc')](_0x12dd14(null));};}for(var e in events){if(events[_0x9964('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x9964('0xe')]=SmsInteractionEvents;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js
index cc9aaf1..8f9015a 100644
--- a/server/api/smsInteraction/smsInteraction.model.js
+++ b/server/api/smsInteraction/smsInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3385=['define','sms_interactions','changed','closedAt','format','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x46889a,_0xa25854){var _0x6969a1=function(_0x51857d){while(--_0x51857d){_0x46889a['push'](_0x46889a['shift']());}};_0x6969a1(++_0xa25854);}(_0x3385,0x65));var _0x5338=function(_0x51d71a,_0x596fda){_0x51d71a=_0x51d71a-0x0;var _0xff01f1=_0x3385[_0x51d71a];return _0xff01f1;};'use strict';var _=require(_0x5338('0x0'));var util=require(_0x5338('0x1'));var logger=require('../../config/logger')(_0x5338('0x2'));var moment=require(_0x5338('0x3'));var BPromise=require(_0x5338('0x4'));var rp=require(_0x5338('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5338('0x6'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x3138e0,_0x2dab81){return _0x3138e0[_0x5338('0x7')]('SmsInteraction',attributes,{'tableName':_0x5338('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f7019,_0x5ed6bd,_0x293f4e){if(_0x2f7019[_0x5338('0x9')]('closed')){_0x2f7019[_0x5338('0xa')]=moment()[_0x5338('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x293f4e(null,_0x2f7019);}}});};
\ No newline at end of file
+var _0xb69f=['format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','sms_interactions','changed','closed','closedAt'];(function(_0x248f6b,_0x401324){var _0x54b829=function(_0x51ad90){while(--_0x51ad90){_0x248f6b['push'](_0x248f6b['shift']());}};_0x54b829(++_0x401324);}(_0xb69f,0x81));var _0xfb69=function(_0x13973d,_0x516b45){_0x13973d=_0x13973d-0x0;var _0x9d8a38=_0xb69f[_0x13973d];return _0x9d8a38;};'use strict';var _=require(_0xfb69('0x0'));var util=require(_0xfb69('0x1'));var logger=require(_0xfb69('0x2'))(_0xfb69('0x3'));var moment=require(_0xfb69('0x4'));var BPromise=require(_0xfb69('0x5'));var rp=require(_0xfb69('0x6'));var fs=require('fs');var path=require(_0xfb69('0x7'));var rimraf=require('rimraf');var config=require(_0xfb69('0x8'));var attributes=require(_0xfb69('0x9'));module[_0xfb69('0xa')]=function(_0x4f6436,_0x43bfd9){return _0x4f6436['define']('SmsInteraction',attributes,{'tableName':_0xfb69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cac55,_0x28087e,_0x1476b4){if(_0x3cac55[_0xfb69('0xc')](_0xfb69('0xd'))){_0x3cac55[_0xfb69('0xe')]=moment()[_0xfb69('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1476b4(null,_0x3cac55);}}});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js
index bf12734..bedd866 100644
--- a/server/api/smsInteraction/smsInteraction.rpc.js
+++ b/server/api/smsInteraction/smsInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x903f=['body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags'];(function(_0x5a5b3c,_0x35ba42){var _0x463b09=function(_0x3d1cd9){while(--_0x3d1cd9){_0x5a5b3c['push'](_0x5a5b3c['shift']());}};_0x463b09(++_0x35ba42);}(_0x903f,0x8f));var _0xf903=function(_0xcd3dfc,_0x5710f0){_0xcd3dfc=_0xcd3dfc-0x0;var _0x41013e=_0x903f[_0xcd3dfc];return _0x41013e;};'use strict';var _=require(_0xf903('0x0'));var util=require(_0xf903('0x1'));var moment=require(_0xf903('0x2'));var BPromise=require(_0xf903('0x3'));var rs=require(_0xf903('0x4'));var fs=require('fs');var Redis=require(_0xf903('0x5'));var db=require(_0xf903('0x6'))['db'];var utils=require(_0xf903('0x7'));var logger=require(_0xf903('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf903('0x9'));var client=jayson['client'][_0xf903('0xa')]({'port':0x232a});config[_0xf903('0xb')]=_[_0xf903('0xc')](config[_0xf903('0xb')],{'host':_0xf903('0xd'),'port':0x18eb});var socket=require(_0xf903('0xe'))(new Redis(config['redis']));require(_0xf903('0xf'))[_0xf903('0x10')](socket);function respondWithRpcPromise(_0x529896,_0xf79aa4,_0x437298){return new BPromise(function(_0x27b772,_0x1a5967){return client[_0xf903('0x11')](_0x529896,_0x437298)[_0xf903('0x12')](function(_0x385aaf){logger[_0xf903('0x13')](_0xf903('0x14'),_0xf79aa4,_0xf903('0x15'));logger[_0xf903('0x16')](_0xf903('0x17'),_0xf79aa4,'request\x20sent',JSON[_0xf903('0x18')](_0x385aaf));if(_0x385aaf[_0xf903('0x19')]){if(_0x385aaf['error'][_0xf903('0x1a')]===0x1f4){logger[_0xf903('0x19')](_0xf903('0x14'),_0xf79aa4,_0x385aaf[_0xf903('0x19')][_0xf903('0x1b')]);return _0x1a5967(_0x385aaf[_0xf903('0x19')][_0xf903('0x1b')]);}logger[_0xf903('0x19')](_0xf903('0x14'),_0xf79aa4,_0x385aaf[_0xf903('0x19')][_0xf903('0x1b')]);return _0x27b772(_0x385aaf[_0xf903('0x19')]['message']);}else{logger[_0xf903('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xf79aa4,_0xf903('0x15'));_0x27b772(_0x385aaf[_0xf903('0x1c')][_0xf903('0x1b')]);}})[_0xf903('0x1d')](function(_0x4077f6){logger[_0xf903('0x19')](_0xf903('0x14'),_0xf79aa4,_0x4077f6);_0x1a5967(_0x4077f6);});});}exports[_0xf903('0x1e')]=function(_0x4e5fc){var _0x5a146a=this;return new Promise(function(_0x24e93b,_0x18ad74){return db[_0xf903('0x1f')][_0xf903('0x20')](_0x4e5fc['body'],{'raw':_0x4e5fc[_0xf903('0x21')]?_0x4e5fc['options'][_0xf903('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e5fc[_0xf903('0x21')]?_0x4e5fc['options'][_0xf903('0x23')]||null:null,'attributes':_0x4e5fc[_0xf903('0x21')]?_0x4e5fc[_0xf903('0x21')][_0xf903('0x24')]||null:null,'limit':_0x4e5fc[_0xf903('0x21')]?_0x4e5fc[_0xf903('0x21')][_0xf903('0x25')]||null:null})[_0xf903('0x12')](function(_0xf65c48){logger[_0xf903('0x13')]('UpdateSmsInteraction',_0x4e5fc);logger[_0xf903('0x16')](_0xf903('0x1e'),_0x4e5fc,JSON[_0xf903('0x18')](_0xf65c48));_0x24e93b(_0xf65c48);})[_0xf903('0x1d')](function(_0x142e06){logger[_0xf903('0x19')](_0xf903('0x1e'),_0x142e06[_0xf903('0x1b')],_0x4e5fc);_0x18ad74(_0x5a146a[_0xf903('0x19')](0x1f4,_0x142e06['message']));});});};exports[_0xf903('0x26')]=function(_0x2c97c7){return new Promise(function(_0x4c6ce8,_0x34a093){return db[_0xf903('0x1f')][_0xf903('0x27')]({'where':_0x2c97c7[_0xf903('0x21')]?_0x2c97c7[_0xf903('0x21')][_0xf903('0x23')]||null:null})['then'](function(_0x2847bb){if(_0x2847bb){return _0x2847bb[_0xf903('0x28')](_0x2c97c7[_0xf903('0x29')][_0xf903('0x2a')],_[_0xf903('0x2b')](_0x2c97c7[_0xf903('0x29')],[_0xf903('0x2a'),'id'])||{});}})[_0xf903('0x2c')](function(_0x5699a9){logger[_0xf903('0x13')]('AddTags',_0x2c97c7);logger['debug']('AddTags',_0x2c97c7,JSON[_0xf903('0x18')](_0x5699a9));_0x4c6ce8(_0x5699a9);})[_0xf903('0x1d')](function(_0x5b6f61){logger[_0xf903('0x19')](_0xf903('0x2d'),_0x5b6f61['message'],_0x2c97c7);_0x34a093(_this[_0xf903('0x19')](0x1f4,_0x5b6f61[_0xf903('0x1b')]));});});};
\ No newline at end of file
+var _0xdb68=['SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','stringify','catch','AddTagsToSmsInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb68,0xc2));var _0x8db6=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0xdb68[_0x3c59fc];return _0x2b78d4;};'use strict';var _=require(_0x8db6('0x0'));var util=require(_0x8db6('0x1'));var moment=require(_0x8db6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db6('0x3'));var db=require(_0x8db6('0x4'))['db'];var utils=require(_0x8db6('0x5'));var logger=require(_0x8db6('0x6'))(_0x8db6('0x7'));var config=require(_0x8db6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8db6('0x9')][_0x8db6('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8db6('0xb')],{'host':_0x8db6('0xc'),'port':0x18eb});var socket=require(_0x8db6('0xd'))(new Redis(config[_0x8db6('0xb')]));require(_0x8db6('0xe'))[_0x8db6('0xf')](socket);function respondWithRpcPromise(_0x3c7838,_0x36c3a7,_0x1cd254){return new BPromise(function(_0x1bf8ff,_0x151290){return client[_0x8db6('0x10')](_0x3c7838,_0x1cd254)['then'](function(_0x4af7a4){logger[_0x8db6('0x11')](_0x8db6('0x12'),_0x36c3a7,_0x8db6('0x13'));logger[_0x8db6('0x14')](_0x8db6('0x15'),_0x36c3a7,_0x8db6('0x13'),JSON['stringify'](_0x4af7a4));if(_0x4af7a4[_0x8db6('0x16')]){if(_0x4af7a4[_0x8db6('0x16')][_0x8db6('0x17')]===0x1f4){logger[_0x8db6('0x16')](_0x8db6('0x12'),_0x36c3a7,_0x4af7a4[_0x8db6('0x16')]['message']);return _0x151290(_0x4af7a4['error'][_0x8db6('0x18')]);}logger[_0x8db6('0x16')](_0x8db6('0x12'),_0x36c3a7,_0x4af7a4[_0x8db6('0x16')][_0x8db6('0x18')]);return _0x1bf8ff(_0x4af7a4[_0x8db6('0x16')][_0x8db6('0x18')]);}else{logger[_0x8db6('0x11')](_0x8db6('0x12'),_0x36c3a7,_0x8db6('0x13'));_0x1bf8ff(_0x4af7a4['result'][_0x8db6('0x18')]);}})['catch'](function(_0x70faa1){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x36c3a7,_0x70faa1);_0x151290(_0x70faa1);});});}exports[_0x8db6('0x19')]=function(_0x414bc3){var _0x4050a4=this;return new Promise(function(_0x312527,_0x3b528e){return db[_0x8db6('0x1a')][_0x8db6('0x1b')](_0x414bc3[_0x8db6('0x1c')],{'raw':_0x414bc3[_0x8db6('0x1d')]?_0x414bc3[_0x8db6('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x414bc3[_0x8db6('0x1d')]?_0x414bc3[_0x8db6('0x1d')][_0x8db6('0x1e')]||null:null,'attributes':_0x414bc3['options']?_0x414bc3[_0x8db6('0x1d')][_0x8db6('0x1f')]||null:null,'limit':_0x414bc3['options']?_0x414bc3[_0x8db6('0x1d')][_0x8db6('0x20')]||null:null})['then'](function(_0xde23f7){logger['info'](_0x8db6('0x19'),_0x414bc3);logger[_0x8db6('0x14')](_0x8db6('0x19'),_0x414bc3,JSON[_0x8db6('0x21')](_0xde23f7));_0x312527(_0xde23f7);})[_0x8db6('0x22')](function(_0x4a88a5){logger[_0x8db6('0x16')](_0x8db6('0x19'),_0x4a88a5[_0x8db6('0x18')],_0x414bc3);_0x3b528e(_0x4050a4[_0x8db6('0x16')](0x1f4,_0x4a88a5[_0x8db6('0x18')]));});});};exports[_0x8db6('0x23')]=function(_0x3f3360){return new Promise(function(_0x3a6829,_0x49de37){return db[_0x8db6('0x1a')][_0x8db6('0x24')]({'where':_0x3f3360[_0x8db6('0x1d')]?_0x3f3360['options'][_0x8db6('0x1e')]||null:null})[_0x8db6('0x25')](function(_0x24fb3a){if(_0x24fb3a){return _0x24fb3a[_0x8db6('0x26')](_0x3f3360[_0x8db6('0x1c')][_0x8db6('0x27')],_[_0x8db6('0x28')](_0x3f3360[_0x8db6('0x1c')],[_0x8db6('0x27'),'id'])||{});}})[_0x8db6('0x29')](function(_0x54e4f4){logger[_0x8db6('0x11')]('AddTags',_0x3f3360);logger[_0x8db6('0x14')](_0x8db6('0x2a'),_0x3f3360,JSON[_0x8db6('0x21')](_0x54e4f4));_0x3a6829(_0x54e4f4);})['catch'](function(_0x2bf1e2){logger[_0x8db6('0x16')]('AddTags',_0x2bf1e2[_0x8db6('0x18')],_0x3f3360);_0x49de37(_this[_0x8db6('0x16')](0x1f4,_0x2bf1e2[_0x8db6('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js
index 8494ac4..a2e2d2d 100644
--- a/server/api/smsInteraction/smsInteraction.socket.js
+++ b/server/api/smsInteraction/smsInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x240350,_0x210c35){var _0x46a33d=function(_0x13a9e7){while(--_0x13a9e7){_0x240350['push'](_0x240350['shift']());}};_0x46a33d(++_0x210c35);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}};
\ No newline at end of file
+var _0x757a=['save','remove','emit','removeListener','register','smsInteraction:'];(function(_0x504f35,_0x382230){var _0x4c6266=function(_0x33d3d9){while(--_0x33d3d9){_0x504f35['push'](_0x504f35['shift']());}};_0x4c6266(++_0x382230);}(_0x757a,0xde));var _0xa757=function(_0x5e8a5f,_0x291749){_0x5e8a5f=_0x5e8a5f-0x0;var _0xe50913=_0x757a[_0x5e8a5f];return _0xe50913;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa757('0x0'),_0xa757('0x1'),'update'];function createListener(_0x5c03c3,_0x5709ed){return function(_0x32be3b){_0x5709ed[_0xa757('0x2')](_0x5c03c3,_0x32be3b);};}function removeListener(_0x1c2932,_0x453d07){return function(){SmsInteractionEvents[_0xa757('0x3')](_0x1c2932,_0x453d07);};}exports[_0xa757('0x4')]=function(_0x5edca8){for(var _0xae0e7c=0x0,_0x4343b6=events['length'];_0xae0e7c<_0x4343b6;_0xae0e7c++){var _0x2930fa=events[_0xae0e7c];var _0x2f7793=createListener(_0xa757('0x5')+_0x2930fa,_0x5edca8);SmsInteractionEvents['on'](_0x2930fa,_0x2f7793);}};
\ No newline at end of file
diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js
index f1455fb..56ac83e 100644
--- a/server/api/smsMessage/index.js
+++ b/server/api/smsMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f09=['/describe','isAuthenticated','describe','/:id','post','smsmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4f09,0x1d2));var _0x94f0=function(_0x276167,_0x21086e){_0x276167=_0x276167-0x0;var _0x27a866=_0x4f09[_0x276167];return _0x27a866;};'use strict';var multer=require(_0x94f0('0x0'));var util=require(_0x94f0('0x1'));var path=require(_0x94f0('0x2'));var timeout=require('connect-timeout');var express=require(_0x94f0('0x3'));var router=express['Router']();var auth=require(_0x94f0('0x4'));var interaction=require(_0x94f0('0x5'));var config=require(_0x94f0('0x6'));var controller=require(_0x94f0('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x94f0('0x8')](_0x94f0('0x9'),auth[_0x94f0('0xa')](),controller[_0x94f0('0xb')]);router[_0x94f0('0x8')](_0x94f0('0xc'),auth[_0x94f0('0xa')](),controller['show']);router[_0x94f0('0xd')]('/',auth[_0x94f0('0xa')](),interaction['tracked']('sms',_0x94f0('0xe')),controller[_0x94f0('0xf')]);router[_0x94f0('0xd')](_0x94f0('0x10'),controller[_0x94f0('0x11')]);router[_0x94f0('0x12')](_0x94f0('0xc'),auth[_0x94f0('0xa')](),controller[_0x94f0('0x13')]);router['put']('/:id/accept',auth[_0x94f0('0xa')](),controller[_0x94f0('0x14')]);router['put'](_0x94f0('0x15'),auth[_0x94f0('0xa')](),controller['reject']);router[_0x94f0('0x16')](_0x94f0('0xc'),auth[_0x94f0('0xa')](),controller[_0x94f0('0x17')]);module[_0x94f0('0x18')]=router;
\ No newline at end of file
+var _0xcad2=['update','/:id/accept','accept','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','post','smsmessage:create','create','/:id/status','put','/:id'];(function(_0x763486,_0xab9300){var _0x56572b=function(_0x8f6618){while(--_0x8f6618){_0x763486['push'](_0x763486['shift']());}};_0x56572b(++_0xab9300);}(_0xcad2,0x156));var _0x2cad=function(_0x5d2dde,_0x5511b9){_0x5d2dde=_0x5d2dde-0x0;var _0x10f319=_0xcad2[_0x5d2dde];return _0x10f319;};'use strict';var multer=require(_0x2cad('0x0'));var util=require(_0x2cad('0x1'));var path=require(_0x2cad('0x2'));var timeout=require(_0x2cad('0x3'));var express=require(_0x2cad('0x4'));var router=express[_0x2cad('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2cad('0x6'));var controller=require('./smsMessage.controller');router[_0x2cad('0x7')]('/',auth[_0x2cad('0x8')](),controller[_0x2cad('0x9')]);router[_0x2cad('0x7')](_0x2cad('0xa'),auth['isAuthenticated'](),controller[_0x2cad('0xb')]);router[_0x2cad('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2cad('0xc')]('/',auth['isAuthenticated'](),interaction['tracked']('sms',_0x2cad('0xd')),controller[_0x2cad('0xe')]);router['post'](_0x2cad('0xf'),controller['status']);router[_0x2cad('0x10')](_0x2cad('0x11'),auth[_0x2cad('0x8')](),controller[_0x2cad('0x12')]);router['put'](_0x2cad('0x13'),auth[_0x2cad('0x8')](),controller[_0x2cad('0x14')]);router[_0x2cad('0x10')]('/:id/reject',auth[_0x2cad('0x8')](),controller[_0x2cad('0x15')]);router['delete'](_0x2cad('0x11'),auth[_0x2cad('0x8')](),controller[_0x2cad('0x16')]);module[_0x2cad('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js
index cd6f55f..72de9bb 100644
--- a/server/api/smsMessage/smsMessage.attributes.js
+++ b/server/api/smsMessage/smsMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x777d=['TEXT','medium','ENUM','out','DATE','exports'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x777d,0xe9));var _0xd777=function(_0x153846,_0x1227ad){_0x153846=_0x153846-0x0;var _0x3ee557=_0x777d[_0x153846];return _0x3ee557;};'use strict';var Sequelize=require('sequelize');module[_0xd777('0x0')]={'body':{'type':Sequelize[_0xd777('0x1')](_0xd777('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd777('0x3')]('in',_0xd777('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xd777('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x9c3e=['BOOLEAN','out','STRING','DATE','exports','medium'];(function(_0x5c8c94,_0x21256d){var _0x5c8846=function(_0x29f0b2){while(--_0x29f0b2){_0x5c8c94['push'](_0x5c8c94['shift']());}};_0x5c8846(++_0x21256d);}(_0x9c3e,0x1b4));var _0xe9c3=function(_0x3032a0,_0x543967){_0x3032a0=_0x3032a0-0x0;var _0x4a308d=_0x9c3e[_0x3032a0];return _0x4a308d;};'use strict';var Sequelize=require('sequelize');module[_0xe9c3('0x0')]={'body':{'type':Sequelize['TEXT'](_0xe9c3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xe9c3('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe9c3('0x3')),'defaultValue':_0xe9c3('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe9c3('0x4')](0xbe)},'phone':{'type':Sequelize[_0xe9c3('0x4')]},'readAt':{'type':Sequelize[_0xe9c3('0x5')]},'secret':{'type':Sequelize[_0xe9c3('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js
index 7d9de0f..e3ee07e 100644
--- a/server/api/smsMessage/smsMessage.controller.js
+++ b/server/api/smsMessage/smsMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x24e9=['util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','Sequelize','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','length','options','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2137a0,_0x3fc562){var _0x17b245=function(_0x29d8eb){while(--_0x29d8eb){_0x2137a0['push'](_0x2137a0['shift']());}};_0x17b245(++_0x3fc562);}(_0x24e9,0x85));var _0x924e=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x24e9[_0x469a3c];return _0x968f4;};'use strict';var pdf=require(_0x924e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x924e('0x1'));var zipdir=require(_0x924e('0x2'));var jsonpatch=require(_0x924e('0x3'));var rp=require(_0x924e('0x4'));var moment=require(_0x924e('0x5'));var BPromise=require(_0x924e('0x6'));var Mustache=require(_0x924e('0x7'));var util=require(_0x924e('0x8'));var path=require('path');var sox=require(_0x924e('0x9'));var csv=require(_0x924e('0xa'));var ejs=require(_0x924e('0xb'));var fs=require('fs');var _=require(_0x924e('0xc'));var squel=require(_0x924e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x924e('0xe'));var toCsv=require(_0x924e('0xa'));var querystring=require(_0x924e('0xf'));var Papa=require(_0x924e('0x10'));var Redis=require('ioredis');var authService=require(_0x924e('0x11'));var qs=require(_0x924e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x924e('0x13'));var logger=require('../../config/logger')(_0x924e('0x14'));var utils=require(_0x924e('0x15'));var config=require(_0x924e('0x16'));var db=require(_0x924e('0x17'))['db'];config[_0x924e('0x18')]=_[_0x924e('0x19')](config[_0x924e('0x18')],{'host':_0x924e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x924e('0x18')]));require('./smsMessage.socket')[_0x924e('0x1b')](socket);var jayson=require(_0x924e('0x1c'));var client=jayson[_0x924e('0x1d')][_0x924e('0x1e')]({'port':0x232c});var client9002=jayson[_0x924e('0x1d')][_0x924e('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x4dff17,_0x4df52c,_0x8328a5){if(_0x8328a5){var _0x463d18=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x463d18['test'](_0x4df52c)){return _0x4dff17;}else{throw new db[(_0x924e('0x1f'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4dff17;}}function respondWithRpcPromise(_0x1a04d7,_0x5abe8c,_0x50272c,_0x331cdc){return new BPromise(function(_0x4715f8,_0x1b6549){var _0x29bf41=_0x331cdc||client;return _0x29bf41[_0x924e('0x20')](_0x1a04d7,_0x50272c)['then'](function(_0x2ef3b2){logger[_0x924e('0x21')]('SmsMessage,\x20%s,\x20%s',_0x5abe8c,_0x924e('0x22'));logger[_0x924e('0x23')](_0x924e('0x24'),_0x5abe8c,_0x924e('0x22'),JSON['stringify'](_0x2ef3b2));if(_0x2ef3b2[_0x924e('0x25')]){if(_0x2ef3b2[_0x924e('0x25')]['code']===0x1f4){logger[_0x924e('0x25')](_0x924e('0x26'),_0x5abe8c,_0x2ef3b2['error'][_0x924e('0x27')]);return _0x1b6549(_0x2ef3b2[_0x924e('0x25')][_0x924e('0x27')]);}logger[_0x924e('0x25')](_0x924e('0x26'),_0x5abe8c,_0x2ef3b2[_0x924e('0x25')][_0x924e('0x27')]);return _0x4715f8(_0x2ef3b2[_0x924e('0x25')][_0x924e('0x27')]);}else{logger[_0x924e('0x21')]('SmsMessage,\x20%s,\x20%s',_0x5abe8c,'request\x20sent');_0x4715f8(_0x2ef3b2[_0x924e('0x28')]['message']);}})['catch'](function(_0x1ea892){logger[_0x924e('0x25')](_0x924e('0x26'),_0x5abe8c,_0x1ea892);_0x1b6549(_0x1ea892);});});}function respondWithStatusCode(_0x134622,_0x4c5fb6){_0x4c5fb6=_0x4c5fb6||0xcc;return function(_0x52d47d){if(_0x52d47d){return _0x134622[_0x924e('0x29')](_0x4c5fb6);}return _0x134622['status'](_0x4c5fb6)[_0x924e('0x2a')]();};}function respondWithResult(_0x4258e7,_0x1dc3fd){_0x1dc3fd=_0x1dc3fd||0xc8;return function(_0x352d42){if(_0x352d42){return _0x4258e7['status'](_0x1dc3fd)[_0x924e('0x2b')](_0x352d42);}};}function respondWithFilteredResult(_0x321246,_0x3d66b2){return function(_0x1b4e22){if(_0x1b4e22){var _0xb88fb5=_0x1b4e22[_0x924e('0x2c')],_0x31c053=_0x3d66b2[_0x924e('0x2d')],_0x25869c=_0x3d66b2[_0x924e('0x2d')]+_0x3d66b2[_0x924e('0x2e')],_0x22edd7;if(_0x25869c>=_0xb88fb5){_0x25869c=_0xb88fb5;_0x22edd7=0xc8;}else{_0x22edd7=0xce;}_0x321246[_0x924e('0x2f')](_0x22edd7);return _0x321246[_0x924e('0x30')](_0x924e('0x31'),_0x31c053+'-'+_0x25869c+'/'+_0xb88fb5)[_0x924e('0x2b')](_0x1b4e22);}return null;};}function patchUpdates(_0xb5b5ea){return function(_0x4d7f12){try{jsonpatch[_0x924e('0x32')](_0x4d7f12,_0xb5b5ea,!![]);}catch(_0x14d46e){return BPromise['reject'](_0x14d46e);}return _0x4d7f12[_0x924e('0x33')]();};}function saveUpdates(_0x59b53a,_0x12deb5){return function(_0xf9e19){if(_0xf9e19){return _0xf9e19[_0x924e('0x34')](_0x59b53a)[_0x924e('0x35')](function(_0x238301){return _0x238301;});}return null;};}function removeEntity(_0x4b76e9,_0x360bfa){return function(_0x319890){if(_0x319890){return _0x319890[_0x924e('0x36')]()[_0x924e('0x35')](function(){_0x4b76e9[_0x924e('0x2f')](0xcc)[_0x924e('0x2a')]();});}};}function handleEntityNotFound(_0x40ac90,_0x439495){return function(_0x43a969){if(!_0x43a969){_0x40ac90[_0x924e('0x29')](0x194);}return _0x43a969;};}function handleError(_0x145af5,_0x358f21){_0x358f21=_0x358f21||0x1f4;return function(_0x12174b){logger['error'](_0x12174b[_0x924e('0x37')]);if(_0x12174b['name']){delete _0x12174b[_0x924e('0x38')];}_0x145af5[_0x924e('0x2f')](_0x358f21)[_0x924e('0x39')](_0x12174b);};}exports[_0x924e('0x3a')]=function(_0x2f71d0,_0x30c1b9){var _0x12bb91={},_0x38b9ae={},_0x1794e2={'count':0x0,'rows':[]};var _0x221b86=_[_0x924e('0x3b')](db[_0x924e('0x3c')][_0x924e('0x3d')],function(_0x6d050c){return{'name':_0x6d050c['fieldName'],'type':_0x6d050c[_0x924e('0x3e')][_0x924e('0x3f')]};});_0x38b9ae['model']=_[_0x924e('0x3b')](_0x221b86,'name');_0x38b9ae[_0x924e('0x40')]=_[_0x924e('0x41')](_0x2f71d0[_0x924e('0x40')]);_0x38b9ae[_0x924e('0x42')]=_[_0x924e('0x43')](_0x38b9ae[_0x924e('0x44')],_0x38b9ae[_0x924e('0x40')]);_0x12bb91[_0x924e('0x45')]=_[_0x924e('0x43')](_0x38b9ae[_0x924e('0x44')],qs[_0x924e('0x46')](_0x2f71d0[_0x924e('0x40')][_0x924e('0x46')]));_0x12bb91[_0x924e('0x45')]=_0x12bb91[_0x924e('0x45')]['length']?_0x12bb91[_0x924e('0x45')]:_0x38b9ae[_0x924e('0x44')];if(!_0x2f71d0[_0x924e('0x40')][_0x924e('0x47')](_0x924e('0x48'))){_0x12bb91['limit']=qs[_0x924e('0x2e')](_0x2f71d0[_0x924e('0x40')][_0x924e('0x2e')]);_0x12bb91['offset']=qs[_0x924e('0x2d')](_0x2f71d0[_0x924e('0x40')]['offset']);}_0x12bb91['order']=qs['sort'](_0x2f71d0[_0x924e('0x40')][_0x924e('0x49')]);_0x12bb91[_0x924e('0x4a')]=qs[_0x924e('0x42')](_[_0x924e('0x4b')](_0x2f71d0[_0x924e('0x40')],_0x38b9ae[_0x924e('0x42')]),_0x221b86);if(_0x2f71d0[_0x924e('0x40')]['filter']){_0x12bb91[_0x924e('0x4a')]=_[_0x924e('0x4c')](_0x12bb91['where'],{'$or':_[_0x924e('0x3b')](_0x221b86,function(_0x232bad){if(_0x232bad[_0x924e('0x3e')]!==_0x924e('0x4d')){var _0x5de6b7={};_0x5de6b7[_0x232bad[_0x924e('0x38')]]={'$like':'%'+_0x2f71d0[_0x924e('0x40')][_0x924e('0x4e')]+'%'};return _0x5de6b7;}})});}_0x12bb91=_[_0x924e('0x4c')]({},_0x12bb91,_0x2f71d0['options']);var _0x5bff5c={'where':_0x12bb91[_0x924e('0x4a')]};return db[_0x924e('0x3c')][_0x924e('0x2c')](_0x5bff5c)[_0x924e('0x35')](function(_0x5213d8){_0x1794e2[_0x924e('0x2c')]=_0x5213d8;if(_0x2f71d0[_0x924e('0x40')][_0x924e('0x4f')]){_0x12bb91[_0x924e('0x50')]=[{'all':!![]}];}return db[_0x924e('0x3c')][_0x924e('0x51')](_0x12bb91);})[_0x924e('0x35')](function(_0x3ab3ce){_0x1794e2['rows']=_0x3ab3ce;return _0x1794e2;})[_0x924e('0x35')](respondWithFilteredResult(_0x30c1b9,_0x12bb91))[_0x924e('0x52')](handleError(_0x30c1b9,null));};exports[_0x924e('0x53')]=function(_0x18525c,_0x107035){var _0x301d1c={'raw':!![],'where':{'id':_0x18525c[_0x924e('0x54')]['id']}},_0xa8b1bd={};_0xa8b1bd['model']=_[_0x924e('0x41')](db[_0x924e('0x3c')][_0x924e('0x3d')]);_0xa8b1bd[_0x924e('0x40')]=_['keys'](_0x18525c['query']);_0xa8b1bd[_0x924e('0x42')]=_['intersection'](_0xa8b1bd[_0x924e('0x44')],_0xa8b1bd[_0x924e('0x40')]);_0x301d1c['attributes']=_[_0x924e('0x43')](_0xa8b1bd['model'],qs[_0x924e('0x46')](_0x18525c[_0x924e('0x40')][_0x924e('0x46')]));_0x301d1c['attributes']=_0x301d1c['attributes'][_0x924e('0x55')]?_0x301d1c[_0x924e('0x45')]:_0xa8b1bd[_0x924e('0x44')];if(_0x18525c['query'][_0x924e('0x4f')]){_0x301d1c[_0x924e('0x50')]=[{'all':!![]}];}_0x301d1c=_[_0x924e('0x4c')]({},_0x301d1c,_0x18525c[_0x924e('0x56')]);return db[_0x924e('0x3c')][_0x924e('0x57')](_0x301d1c)['then'](handleEntityNotFound(_0x107035,null))[_0x924e('0x35')](respondWithResult(_0x107035,null))['catch'](handleError(_0x107035,null));};exports[_0x924e('0x58')]=function(_0x3ce402,_0x18556b){return db[_0x924e('0x3c')][_0x924e('0x58')](_0x3ce402[_0x924e('0x59')],{})[_0x924e('0x35')](respondWithResult(_0x18556b,0xc9))['catch'](handleError(_0x18556b,null));};exports[_0x924e('0x34')]=function(_0x4fbedd,_0x46dffa){if(_0x4fbedd[_0x924e('0x59')]['id']){delete _0x4fbedd['body']['id'];}return db['SmsMessage']['find']({'where':{'id':_0x4fbedd[_0x924e('0x54')]['id']}})[_0x924e('0x35')](handleEntityNotFound(_0x46dffa,null))[_0x924e('0x35')](saveUpdates(_0x4fbedd[_0x924e('0x59')],null))[_0x924e('0x35')](respondWithResult(_0x46dffa,null))['catch'](handleError(_0x46dffa,null));};exports[_0x924e('0x36')]=function(_0x2e5756,_0x321a3c){return db['SmsMessage'][_0x924e('0x57')]({'where':{'id':_0x2e5756['params']['id']}})[_0x924e('0x35')](handleEntityNotFound(_0x321a3c,null))[_0x924e('0x35')](removeEntity(_0x321a3c,null))[_0x924e('0x52')](handleError(_0x321a3c,null));};exports[_0x924e('0x5a')]=function(_0x5862c9,_0x430198){return db[_0x924e('0x3c')][_0x924e('0x5a')]()[_0x924e('0x35')](respondWithResult(_0x430198,null))['catch'](handleError(_0x430198,null));};var interaction_log=require(_0x924e('0x5b'))(_0x924e('0x5c'));exports[_0x924e('0x5d')]=function(_0x1c9174,_0x4bc258,_0xb6de0e){var _0x42de64={'channel':_0x924e('0x5e')};if(_0x1c9174[_0x924e('0x59')]['id']){delete _0x1c9174[_0x924e('0x59')]['id'];}_0x1c9174['body']['read']=!![];_0x1c9174[_0x924e('0x59')][_0x924e('0x5f')]=moment()[_0x924e('0x60')](_0x924e('0x61'));_0x1c9174[_0x924e('0x59')]['UserId']=_0x1c9174[_0x924e('0x59')][_0x924e('0x62')]||_0x1c9174['user']['id'];return db['SmsMessage'][_0x924e('0x57')]({'where':{'id':_0x1c9174[_0x924e('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x924e('0x63')}]})['then'](handleEntityNotFound(_0x4bc258,null))[_0x924e('0x35')](saveUpdates(_0x1c9174[_0x924e('0x59')],null))[_0x924e('0x35')](function(_0x26a3bc){if(_0x26a3bc){_0x42de64[_0x924e('0x27')]=_0x26a3bc[_0x924e('0x64')]({'plain':!![]});return db['SmsInteraction'][_0x924e('0x57')]({'where':{'id':_0x26a3bc[_0x924e('0x65')]}});}return null;})[_0x924e('0x35')](handleEntityNotFound(_0x4bc258,null))['then'](function(_0xb465ec){if(_0xb465ec){return _0xb465ec[_0x924e('0x34')]({'UserId':_0x1c9174[_0x924e('0x59')][_0x924e('0x62')],'read1stAt':_[_0x924e('0x66')](_0xb465ec[_0x924e('0x67')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x20640a){if(_0x20640a){_0x42de64[_0x924e('0x68')]=_0x20640a[_0x924e('0x64')]({'plain':!![]});interaction_log['info'](_0x924e('0x69'),_0x1c9174[_0x924e('0x6a')]['id'],_0x1c9174[_0x924e('0x6a')][_0x924e('0x38')],_0x1c9174['user'][_0x924e('0x6b')],_0x42de64[_0x924e('0x68')]['id'],_0x1c9174[_0x924e('0x59')]?JSON[_0x924e('0x6c')](_0x1c9174[_0x924e('0x59')]):_0x924e('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x924e('0x6e'),_0x42de64);}return null;})[_0x924e('0x35')](function(_0x5a2d53){if(_0x5a2d53){if(_0x1c9174[_0x924e('0x59')][_0x924e('0x6f')]){_0x42de64[_0x924e('0x27')]['interface']=util['format'](_0x924e('0x70'),_0x1c9174[_0x924e('0x6a')]['name']);_0x42de64[_0x924e('0x27')][_0x924e('0x71')]=_0x42de64[_0x924e('0x71')];_0x42de64[_0x924e('0x27')][_0x924e('0x72')]='accept';return respondWithRpcPromise(_0x924e('0x73'),'EventManager',{'event':_0x924e('0x74'),'message':_0x42de64['message']},client9002)['then'](function(){return _0x42de64;});}return _0x42de64;}return null;})[_0x924e('0x35')](respondWithResult(_0x4bc258,null))['catch'](handleError(_0x4bc258,null));};var interaction_log=require(_0x924e('0x5b'))(_0x924e('0x5c'));exports[_0x924e('0x75')]=function(_0x1ee350,_0x585282,_0x1ab506){var _0x304c5c={'agent':{},'channel':_0x924e('0x5e')};if(_0x1ee350[_0x924e('0x59')]['id']){delete _0x1ee350['body']['id'];}_0x1ee350['body'][_0x924e('0x62')]=_0x1ee350[_0x924e('0x59')][_0x924e('0x62')]||_0x1ee350['user']['id'];_0x304c5c[_0x924e('0x76')]['id']=_0x1ee350[_0x924e('0x59')][_0x924e('0x62')];return db[_0x924e('0x3c')][_0x924e('0x57')]({'where':{'id':_0x1ee350[_0x924e('0x54')]['id'],'UserId':null}})[_0x924e('0x35')](handleEntityNotFound(_0x585282,null))['then'](function(_0x17f8ca){if(_0x17f8ca){_0x304c5c[_0x924e('0x27')]=_0x17f8ca['get']({'plain':!![]});return db['SmsInteraction'][_0x924e('0x57')]({'where':{'id':_0x17f8ca[_0x924e('0x65')]}});}return null;})[_0x924e('0x35')](handleEntityNotFound(_0x585282,null))[_0x924e('0x35')](function(_0x425d45){if(_0x425d45){_0x304c5c[_0x924e('0x68')]=_0x425d45[_0x924e('0x64')]({'plain':!![]});interaction_log['info'](_0x924e('0x77'),_0x1ee350[_0x924e('0x6a')]['id'],_0x1ee350[_0x924e('0x6a')]['name'],_0x1ee350['user']['role'],_0x304c5c['interaction']['id'],_0x1ee350[_0x924e('0x59')]?JSON[_0x924e('0x6c')](_0x1ee350[_0x924e('0x59')]):_0x924e('0x6d'));return respondWithRpcPromise(_0x924e('0x78'),_0x924e('0x79'),_0x304c5c);}return null;})['then'](function(_0x273232){if(_0x273232){_0x273232[_0x924e('0x27')][_0x924e('0x7a')]=util['format']('SIP/%s',_0x1ee350[_0x924e('0x6a')][_0x924e('0x38')]);_0x273232[_0x924e('0x27')][_0x924e('0x71')]=_0x304c5c[_0x924e('0x71')];_0x273232[_0x924e('0x27')][_0x924e('0x72')]=_0x924e('0x75');respondWithRpcPromise(_0x924e('0x73'),_0x924e('0x73'),{'event':_0x924e('0x7b'),'message':_0x273232['message']},client9002);return _0x304c5c;}return null;})[_0x924e('0x35')](respondWithResult(_0x585282,null))[_0x924e('0x52')](handleError(_0x585282,null));};exports[_0x924e('0x2f')]=function(_0x49cb74,_0x5d04f5,_0x5ce9f5){if(_0x49cb74['body']['id']){delete _0x49cb74[_0x924e('0x59')]['id'];}var _0x12c7b4;return db[_0x924e('0x3c')]['find']({'where':{'id':_0x49cb74[_0x924e('0x54')]['id']}})[_0x924e('0x35')](handleEntityNotFound(_0x5d04f5,null))[_0x924e('0x35')](function(_0x5389b3){if(_0x5389b3){_0x12c7b4=_0x5389b3;return db[_0x924e('0x7c')][_0x924e('0x57')]({'where':{'id':_0x5389b3['SmsAccountId']}});}})[_0x924e('0x35')](handleEntityNotFound(_0x5d04f5,null))[_0x924e('0x35')](function(_0x706c75){if(_0x706c75){logger[_0x924e('0x23')](_0x924e('0x24'),_0x924e('0x2f'),_0x924e('0x7d'),_0x706c75[_0x924e('0x3e')],util['inspect'](_0x49cb74['body'],{'showHidden':![],'depth':null}));switch(_0x706c75[_0x924e('0x3e')]){case _0x924e('0x7e'):if(_0x49cb74[_0x924e('0x59')][_0x924e('0x7f')]&&_0x49cb74[_0x924e('0x59')][_0x924e('0x7f')]===_0x12c7b4[_0x924e('0x80')]){return _0x12c7b4[_0x924e('0x34')]({'read':!![]});}else{logger[_0x924e('0x25')](_0x924e('0x81'),'status',_0x924e('0x7e'),util[_0x924e('0x82')](_0x49cb74[_0x924e('0x59')],{'showHidden':![],'depth':null}));}break;case _0x924e('0x83'):if(_0x49cb74['body'][_0x924e('0x84')]&&_0x49cb74[_0x924e('0x59')]['MessageUUID']===_0x12c7b4[_0x924e('0x80')]&&_[_0x924e('0x85')](['sent',_0x924e('0x86')],_0x49cb74['body'][_0x924e('0x87')])>=0x0){return _0x12c7b4['update']({'read':!![]});}else{logger['error'](_0x924e('0x81'),_0x924e('0x2f'),_0x924e('0x88'),util[_0x924e('0x82')](_0x49cb74[_0x924e('0x59')],{'showHidden':![],'depth':null}));}break;case _0x924e('0x89'):var _0x3f3a36=_0x49cb74[_0x924e('0x59')][_0x924e('0x8a')][0x0];if(_0x3f3a36[_0x924e('0x2f')][_0x924e('0x8b')]===_0x924e('0x8c')){return _0x12c7b4[_0x924e('0x34')]({'read':!![]});}else{logger[_0x924e('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x924e('0x2f'),_0x924e('0x89'),util[_0x924e('0x82')](_0x49cb74[_0x924e('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x12c7b4;}})[_0x924e('0x35')](respondWithResult(_0x5d04f5,null))[_0x924e('0x52')](handleError(_0x5d04f5,null));};
\ No newline at end of file
+var _0x1c8a=['merge','options','includeAll','include','rows','params','rawAttributes','fields','create','body','find','sms-interactions','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SIP/%s','channel','event','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','messageId','plivo','MessageUUID','indexOf','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','test','ValidationError','then','info','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','SmsMessage','fieldName','type','key','map','keys','query','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1c8a,0x140));var _0xa1c8=function(_0x168422,_0x6a9ee8){_0x168422=_0x168422-0x0;var _0x1866cd=_0x1c8a[_0x168422];return _0x1866cd;};'use strict';var pdf=require(_0xa1c8('0x0'));var emlformat=require(_0xa1c8('0x1'));var rimraf=require(_0xa1c8('0x2'));var zipdir=require(_0xa1c8('0x3'));var jsonpatch=require(_0xa1c8('0x4'));var rp=require('request-promise');var moment=require(_0xa1c8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa1c8('0x6'));var util=require(_0xa1c8('0x7'));var path=require(_0xa1c8('0x8'));var sox=require('sox');var csv=require(_0xa1c8('0x9'));var ejs=require(_0xa1c8('0xa'));var fs=require('fs');var _=require(_0xa1c8('0xb'));var squel=require('squel');var crypto=require(_0xa1c8('0xc'));var jsforce=require(_0xa1c8('0xd'));var deskjs=require(_0xa1c8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1c8('0xf'));var Papa=require(_0xa1c8('0x10'));var Redis=require(_0xa1c8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1c8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1c8('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa1c8('0x14'))['db'];config[_0xa1c8('0x15')]=_[_0xa1c8('0x16')](config[_0xa1c8('0x15')],{'host':_0xa1c8('0x17'),'port':0x18eb});var socket=require(_0xa1c8('0x18'))(new Redis(config['redis']));require(_0xa1c8('0x19'))[_0xa1c8('0x1a')](socket);var jayson=require(_0xa1c8('0x1b'));var client=jayson[_0xa1c8('0x1c')][_0xa1c8('0x1d')]({'port':0x232c});var client9002=jayson[_0xa1c8('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x7f1128,_0x51b1c3,_0x17d4d2){if(_0x17d4d2){var _0x2ef438=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ef438[_0xa1c8('0x1e')](_0x51b1c3)){return _0x7f1128;}else{throw new db['Sequelize'][(_0xa1c8('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x7f1128;}}function respondWithRpcPromise(_0x55caa7,_0x1fe87f,_0x112ab0,_0x57fe23){return new BPromise(function(_0x3c66c3,_0x367094){var _0x3e1284=_0x57fe23||client;return _0x3e1284['request'](_0x55caa7,_0x112ab0)[_0xa1c8('0x20')](function(_0xe84191){logger[_0xa1c8('0x21')]('SmsMessage,\x20%s,\x20%s',_0x1fe87f,_0xa1c8('0x22'));logger[_0xa1c8('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1fe87f,_0xa1c8('0x22'),JSON[_0xa1c8('0x24')](_0xe84191));if(_0xe84191[_0xa1c8('0x25')]){if(_0xe84191[_0xa1c8('0x25')][_0xa1c8('0x26')]===0x1f4){logger[_0xa1c8('0x25')](_0xa1c8('0x27'),_0x1fe87f,_0xe84191[_0xa1c8('0x25')][_0xa1c8('0x28')]);return _0x367094(_0xe84191[_0xa1c8('0x25')][_0xa1c8('0x28')]);}logger[_0xa1c8('0x25')](_0xa1c8('0x27'),_0x1fe87f,_0xe84191[_0xa1c8('0x25')][_0xa1c8('0x28')]);return _0x3c66c3(_0xe84191[_0xa1c8('0x25')]['message']);}else{logger[_0xa1c8('0x21')]('SmsMessage,\x20%s,\x20%s',_0x1fe87f,_0xa1c8('0x22'));_0x3c66c3(_0xe84191['result'][_0xa1c8('0x28')]);}})[_0xa1c8('0x29')](function(_0x22eec1){logger['error'](_0xa1c8('0x27'),_0x1fe87f,_0x22eec1);_0x367094(_0x22eec1);});});}function respondWithStatusCode(_0x914018,_0x384b52){_0x384b52=_0x384b52||0xcc;return function(_0xa067ae){if(_0xa067ae){return _0x914018['sendStatus'](_0x384b52);}return _0x914018[_0xa1c8('0x2a')](_0x384b52)[_0xa1c8('0x2b')]();};}function respondWithResult(_0x28b9e5,_0x4d0a4f){_0x4d0a4f=_0x4d0a4f||0xc8;return function(_0x5f43bc){if(_0x5f43bc){return _0x28b9e5[_0xa1c8('0x2a')](_0x4d0a4f)[_0xa1c8('0x2c')](_0x5f43bc);}};}function respondWithFilteredResult(_0x4c67ba,_0x348356){return function(_0x42326b){if(_0x42326b){var _0xeadfdd=_0x42326b[_0xa1c8('0x2d')],_0x560b55=_0x348356['offset'],_0x4bd7cf=_0x348356[_0xa1c8('0x2e')]+_0x348356[_0xa1c8('0x2f')],_0x5c78eb;if(_0x4bd7cf>=_0xeadfdd){_0x4bd7cf=_0xeadfdd;_0x5c78eb=0xc8;}else{_0x5c78eb=0xce;}_0x4c67ba[_0xa1c8('0x2a')](_0x5c78eb);return _0x4c67ba[_0xa1c8('0x30')](_0xa1c8('0x31'),_0x560b55+'-'+_0x4bd7cf+'/'+_0xeadfdd)[_0xa1c8('0x2c')](_0x42326b);}return null;};}function patchUpdates(_0x58d21c){return function(_0x16573f){try{jsonpatch[_0xa1c8('0x32')](_0x16573f,_0x58d21c,!![]);}catch(_0x469bd1){return BPromise[_0xa1c8('0x33')](_0x469bd1);}return _0x16573f['save']();};}function saveUpdates(_0x5bd684,_0x3019f5){return function(_0x55c481){if(_0x55c481){return _0x55c481[_0xa1c8('0x34')](_0x5bd684)[_0xa1c8('0x20')](function(_0x50d9b){return _0x50d9b;});}return null;};}function removeEntity(_0x20ab0d,_0x104232){return function(_0x3607ce){if(_0x3607ce){return _0x3607ce[_0xa1c8('0x35')]()[_0xa1c8('0x20')](function(){_0x20ab0d['status'](0xcc)[_0xa1c8('0x2b')]();});}};}function handleEntityNotFound(_0xa83ff8,_0x179a57){return function(_0x10a801){if(!_0x10a801){_0xa83ff8[_0xa1c8('0x36')](0x194);}return _0x10a801;};}function handleError(_0x2cb15a,_0x4750a8){_0x4750a8=_0x4750a8||0x1f4;return function(_0x173fff){logger[_0xa1c8('0x25')](_0x173fff[_0xa1c8('0x37')]);if(_0x173fff[_0xa1c8('0x38')]){delete _0x173fff[_0xa1c8('0x38')];}_0x2cb15a[_0xa1c8('0x2a')](_0x4750a8)[_0xa1c8('0x39')](_0x173fff);};}exports['index']=function(_0x5805dc,_0x322971){var _0x45ae8c={},_0x19a013={},_0x498799={'count':0x0,'rows':[]};var _0x48dbef=_['map'](db[_0xa1c8('0x3a')]['rawAttributes'],function(_0x580963){return{'name':_0x580963[_0xa1c8('0x3b')],'type':_0x580963[_0xa1c8('0x3c')][_0xa1c8('0x3d')]};});_0x19a013['model']=_[_0xa1c8('0x3e')](_0x48dbef,_0xa1c8('0x38'));_0x19a013['query']=_[_0xa1c8('0x3f')](_0x5805dc[_0xa1c8('0x40')]);_0x19a013[_0xa1c8('0x41')]=_['intersection'](_0x19a013[_0xa1c8('0x42')],_0x19a013[_0xa1c8('0x40')]);_0x45ae8c[_0xa1c8('0x43')]=_[_0xa1c8('0x44')](_0x19a013[_0xa1c8('0x42')],qs['fields'](_0x5805dc[_0xa1c8('0x40')]['fields']));_0x45ae8c['attributes']=_0x45ae8c['attributes'][_0xa1c8('0x45')]?_0x45ae8c[_0xa1c8('0x43')]:_0x19a013[_0xa1c8('0x42')];if(!_0x5805dc[_0xa1c8('0x40')][_0xa1c8('0x46')]('nolimit')){_0x45ae8c['limit']=qs[_0xa1c8('0x2f')](_0x5805dc[_0xa1c8('0x40')][_0xa1c8('0x2f')]);_0x45ae8c['offset']=qs['offset'](_0x5805dc[_0xa1c8('0x40')][_0xa1c8('0x2e')]);}_0x45ae8c[_0xa1c8('0x47')]=qs[_0xa1c8('0x48')](_0x5805dc[_0xa1c8('0x40')][_0xa1c8('0x48')]);_0x45ae8c[_0xa1c8('0x49')]=qs['filters'](_[_0xa1c8('0x4a')](_0x5805dc['query'],_0x19a013[_0xa1c8('0x41')]),_0x48dbef);if(_0x5805dc[_0xa1c8('0x40')][_0xa1c8('0x4b')]){_0x45ae8c['where']=_[_0xa1c8('0x4c')](_0x45ae8c['where'],{'$or':_[_0xa1c8('0x3e')](_0x48dbef,function(_0xe5e4da){if(_0xe5e4da[_0xa1c8('0x3c')]!=='VIRTUAL'){var _0x2c0fbf={};_0x2c0fbf[_0xe5e4da[_0xa1c8('0x38')]]={'$like':'%'+_0x5805dc['query'][_0xa1c8('0x4b')]+'%'};return _0x2c0fbf;}})});}_0x45ae8c=_[_0xa1c8('0x4c')]({},_0x45ae8c,_0x5805dc[_0xa1c8('0x4d')]);var _0x144dd4={'where':_0x45ae8c[_0xa1c8('0x49')]};return db[_0xa1c8('0x3a')][_0xa1c8('0x2d')](_0x144dd4)[_0xa1c8('0x20')](function(_0x16389f){_0x498799['count']=_0x16389f;if(_0x5805dc[_0xa1c8('0x40')][_0xa1c8('0x4e')]){_0x45ae8c[_0xa1c8('0x4f')]=[{'all':!![]}];}return db[_0xa1c8('0x3a')]['findAll'](_0x45ae8c);})[_0xa1c8('0x20')](function(_0x404de4){_0x498799[_0xa1c8('0x50')]=_0x404de4;return _0x498799;})[_0xa1c8('0x20')](respondWithFilteredResult(_0x322971,_0x45ae8c))[_0xa1c8('0x29')](handleError(_0x322971,null));};exports['show']=function(_0x1ea9bd,_0x23805b){var _0x461bb3={'raw':!![],'where':{'id':_0x1ea9bd[_0xa1c8('0x51')]['id']}},_0x2f39d0={};_0x2f39d0['model']=_['keys'](db[_0xa1c8('0x3a')][_0xa1c8('0x52')]);_0x2f39d0[_0xa1c8('0x40')]=_['keys'](_0x1ea9bd[_0xa1c8('0x40')]);_0x2f39d0[_0xa1c8('0x41')]=_[_0xa1c8('0x44')](_0x2f39d0[_0xa1c8('0x42')],_0x2f39d0[_0xa1c8('0x40')]);_0x461bb3[_0xa1c8('0x43')]=_[_0xa1c8('0x44')](_0x2f39d0[_0xa1c8('0x42')],qs[_0xa1c8('0x53')](_0x1ea9bd[_0xa1c8('0x40')][_0xa1c8('0x53')]));_0x461bb3[_0xa1c8('0x43')]=_0x461bb3[_0xa1c8('0x43')]['length']?_0x461bb3[_0xa1c8('0x43')]:_0x2f39d0[_0xa1c8('0x42')];if(_0x1ea9bd[_0xa1c8('0x40')][_0xa1c8('0x4e')]){_0x461bb3[_0xa1c8('0x4f')]=[{'all':!![]}];}_0x461bb3=_[_0xa1c8('0x4c')]({},_0x461bb3,_0x1ea9bd[_0xa1c8('0x4d')]);return db[_0xa1c8('0x3a')]['find'](_0x461bb3)[_0xa1c8('0x20')](handleEntityNotFound(_0x23805b,null))[_0xa1c8('0x20')](respondWithResult(_0x23805b,null))[_0xa1c8('0x29')](handleError(_0x23805b,null));};exports[_0xa1c8('0x54')]=function(_0x56a432,_0x50dfd1){return db[_0xa1c8('0x3a')]['create'](_0x56a432[_0xa1c8('0x55')],{})[_0xa1c8('0x20')](respondWithResult(_0x50dfd1,0xc9))[_0xa1c8('0x29')](handleError(_0x50dfd1,null));};exports[_0xa1c8('0x34')]=function(_0x2484af,_0x90503e){if(_0x2484af['body']['id']){delete _0x2484af[_0xa1c8('0x55')]['id'];}return db['SmsMessage'][_0xa1c8('0x56')]({'where':{'id':_0x2484af['params']['id']}})[_0xa1c8('0x20')](handleEntityNotFound(_0x90503e,null))[_0xa1c8('0x20')](saveUpdates(_0x2484af[_0xa1c8('0x55')],null))[_0xa1c8('0x20')](respondWithResult(_0x90503e,null))['catch'](handleError(_0x90503e,null));};exports[_0xa1c8('0x35')]=function(_0x1ff204,_0x9b4865){return db[_0xa1c8('0x3a')][_0xa1c8('0x56')]({'where':{'id':_0x1ff204['params']['id']}})['then'](handleEntityNotFound(_0x9b4865,null))[_0xa1c8('0x20')](removeEntity(_0x9b4865,null))[_0xa1c8('0x29')](handleError(_0x9b4865,null));};exports['describe']=function(_0x3e1c84,_0x4a1304){return db['SmsMessage']['describe']()[_0xa1c8('0x20')](respondWithResult(_0x4a1304,null))['catch'](handleError(_0x4a1304,null));};var interaction_log=require('../../config/logger')(_0xa1c8('0x57'));exports['accept']=function(_0x4050a9,_0x53d4dc,_0x48ef16){var _0x419bbe={'channel':_0xa1c8('0x58')};if(_0x4050a9[_0xa1c8('0x55')]['id']){delete _0x4050a9['body']['id'];}_0x4050a9[_0xa1c8('0x55')][_0xa1c8('0x59')]=!![];_0x4050a9[_0xa1c8('0x55')]['readAt']=moment()[_0xa1c8('0x5a')](_0xa1c8('0x5b'));_0x4050a9['body'][_0xa1c8('0x5c')]=_0x4050a9[_0xa1c8('0x55')][_0xa1c8('0x5c')]||_0x4050a9['user']['id'];return db[_0xa1c8('0x3a')][_0xa1c8('0x56')]({'where':{'id':_0x4050a9['params']['id'],'UserId':null},'include':[{'model':db[_0xa1c8('0x5d')],'as':'Contact'}]})[_0xa1c8('0x20')](handleEntityNotFound(_0x53d4dc,null))['then'](saveUpdates(_0x4050a9[_0xa1c8('0x55')],null))[_0xa1c8('0x20')](function(_0xc7e013){if(_0xc7e013){_0x419bbe[_0xa1c8('0x28')]=_0xc7e013[_0xa1c8('0x5e')]({'plain':!![]});return db[_0xa1c8('0x5f')][_0xa1c8('0x56')]({'where':{'id':_0xc7e013[_0xa1c8('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x53d4dc,null))[_0xa1c8('0x20')](function(_0x1f9fff){if(_0x1f9fff){return _0x1f9fff[_0xa1c8('0x34')]({'UserId':_0x4050a9[_0xa1c8('0x55')][_0xa1c8('0x5c')],'read1stAt':_[_0xa1c8('0x61')](_0x1f9fff[_0xa1c8('0x62')])?moment()[_0xa1c8('0x5a')](_0xa1c8('0x5b')):undefined});}return null;})[_0xa1c8('0x20')](function(_0x4191d3){if(_0x4191d3){_0x419bbe[_0xa1c8('0x63')]=_0x4191d3[_0xa1c8('0x5e')]({'plain':!![]});interaction_log[_0xa1c8('0x21')](_0xa1c8('0x64'),_0x4050a9[_0xa1c8('0x65')]['id'],_0x4050a9[_0xa1c8('0x65')][_0xa1c8('0x38')],_0x4050a9[_0xa1c8('0x65')][_0xa1c8('0x66')],_0x419bbe[_0xa1c8('0x63')]['id'],_0x4050a9[_0xa1c8('0x55')]?JSON[_0xa1c8('0x24')](_0x4050a9[_0xa1c8('0x55')]):_0xa1c8('0x67'));return respondWithRpcPromise('AcceptMessage',_0xa1c8('0x68'),_0x419bbe);}return null;})[_0xa1c8('0x20')](function(_0x422d22){if(_0x422d22){if(_0x4050a9[_0xa1c8('0x55')]['manual']){_0x419bbe[_0xa1c8('0x28')]['interface']=util[_0xa1c8('0x5a')](_0xa1c8('0x69'),_0x4050a9[_0xa1c8('0x65')][_0xa1c8('0x38')]);_0x419bbe[_0xa1c8('0x28')][_0xa1c8('0x6a')]=_0x419bbe[_0xa1c8('0x6a')];_0x419bbe[_0xa1c8('0x28')][_0xa1c8('0x6b')]=_0xa1c8('0x6c');return respondWithRpcPromise('EventManager',_0xa1c8('0x6d'),{'event':_0xa1c8('0x6e'),'message':_0x419bbe[_0xa1c8('0x28')]},client9002)[_0xa1c8('0x20')](function(){return _0x419bbe;});}return _0x419bbe;}return null;})[_0xa1c8('0x20')](respondWithResult(_0x53d4dc,null))[_0xa1c8('0x29')](handleError(_0x53d4dc,null));};var interaction_log=require(_0xa1c8('0x13'))(_0xa1c8('0x57'));exports[_0xa1c8('0x33')]=function(_0x51db7c,_0x56489d,_0x2ae2da){var _0x22cb8a={'agent':{},'channel':'sms'};if(_0x51db7c[_0xa1c8('0x55')]['id']){delete _0x51db7c['body']['id'];}_0x51db7c['body'][_0xa1c8('0x5c')]=_0x51db7c['body'][_0xa1c8('0x5c')]||_0x51db7c[_0xa1c8('0x65')]['id'];_0x22cb8a['agent']['id']=_0x51db7c['body'][_0xa1c8('0x5c')];return db[_0xa1c8('0x3a')]['find']({'where':{'id':_0x51db7c['params']['id'],'UserId':null}})[_0xa1c8('0x20')](handleEntityNotFound(_0x56489d,null))[_0xa1c8('0x20')](function(_0x23f2c6){if(_0x23f2c6){_0x22cb8a[_0xa1c8('0x28')]=_0x23f2c6[_0xa1c8('0x5e')]({'plain':!![]});return db[_0xa1c8('0x5f')][_0xa1c8('0x56')]({'where':{'id':_0x23f2c6['SmsInteractionId']}});}return null;})[_0xa1c8('0x20')](handleEntityNotFound(_0x56489d,null))[_0xa1c8('0x20')](function(_0x1bed6d){if(_0x1bed6d){_0x22cb8a[_0xa1c8('0x63')]=_0x1bed6d[_0xa1c8('0x5e')]({'plain':!![]});interaction_log[_0xa1c8('0x21')](_0xa1c8('0x6f'),_0x51db7c[_0xa1c8('0x65')]['id'],_0x51db7c[_0xa1c8('0x65')][_0xa1c8('0x38')],_0x51db7c[_0xa1c8('0x65')]['role'],_0x22cb8a['interaction']['id'],_0x51db7c[_0xa1c8('0x55')]?JSON[_0xa1c8('0x24')](_0x51db7c[_0xa1c8('0x55')]):_0xa1c8('0x67'));return respondWithRpcPromise('RejectMessage',_0xa1c8('0x70'),_0x22cb8a);}return null;})[_0xa1c8('0x20')](function(_0x54f3b9){if(_0x54f3b9){_0x54f3b9[_0xa1c8('0x28')][_0xa1c8('0x71')]=util[_0xa1c8('0x5a')](_0xa1c8('0x69'),_0x51db7c[_0xa1c8('0x65')][_0xa1c8('0x38')]);_0x54f3b9[_0xa1c8('0x28')]['channel']=_0x22cb8a['channel'];_0x54f3b9[_0xa1c8('0x28')]['event']=_0xa1c8('0x33');respondWithRpcPromise(_0xa1c8('0x6d'),_0xa1c8('0x6d'),{'event':_0xa1c8('0x72'),'message':_0x54f3b9['message']},client9002);return _0x22cb8a;}return null;})['then'](respondWithResult(_0x56489d,null))['catch'](handleError(_0x56489d,null));};exports[_0xa1c8('0x2a')]=function(_0x4a497e,_0x16c4e3,_0xdbe9b5){if(_0x4a497e[_0xa1c8('0x55')]['id']){delete _0x4a497e[_0xa1c8('0x55')]['id'];}var _0x543948;return db[_0xa1c8('0x3a')][_0xa1c8('0x56')]({'where':{'id':_0x4a497e[_0xa1c8('0x51')]['id']}})[_0xa1c8('0x20')](handleEntityNotFound(_0x16c4e3,null))['then'](function(_0x541233){if(_0x541233){_0x543948=_0x541233;return db[_0xa1c8('0x73')][_0xa1c8('0x56')]({'where':{'id':_0x541233[_0xa1c8('0x74')]}});}})[_0xa1c8('0x20')](handleEntityNotFound(_0x16c4e3,null))[_0xa1c8('0x20')](function(_0x2e4297){if(_0x2e4297){logger[_0xa1c8('0x23')](_0xa1c8('0x75'),_0xa1c8('0x2a'),_0xa1c8('0x76'),_0x2e4297[_0xa1c8('0x3c')],util[_0xa1c8('0x77')](_0x4a497e[_0xa1c8('0x55')],{'showHidden':![],'depth':null}));switch(_0x2e4297[_0xa1c8('0x3c')]){case _0xa1c8('0x78'):if(_0x4a497e[_0xa1c8('0x55')]['MessageSid']&&_0x4a497e['body']['MessageSid']===_0x543948[_0xa1c8('0x79')]){return _0x543948[_0xa1c8('0x34')]({'read':!![]});}else{logger[_0xa1c8('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa1c8('0x2a'),_0xa1c8('0x78'),util[_0xa1c8('0x77')](_0x4a497e[_0xa1c8('0x55')],{'showHidden':![],'depth':null}));}break;case _0xa1c8('0x7a'):if(_0x4a497e['body'][_0xa1c8('0x7b')]&&_0x4a497e[_0xa1c8('0x55')][_0xa1c8('0x7b')]===_0x543948[_0xa1c8('0x79')]&&_[_0xa1c8('0x7c')](['sent',_0xa1c8('0x7d')],_0x4a497e[_0xa1c8('0x55')][_0xa1c8('0x7e')])>=0x0){return _0x543948['update']({'read':!![]});}else{logger[_0xa1c8('0x25')](_0xa1c8('0x7f'),'status',_0xa1c8('0x80'),util[_0xa1c8('0x77')](_0x4a497e['body'],{'showHidden':![],'depth':null}));}break;case _0xa1c8('0x81'):var _0x55ecf6=_0x4a497e[_0xa1c8('0x55')]['results'][0x0];if(_0x55ecf6[_0xa1c8('0x2a')][_0xa1c8('0x82')]===_0xa1c8('0x83')){return _0x543948[_0xa1c8('0x34')]({'read':!![]});}else{logger[_0xa1c8('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa1c8('0x81'),util[_0xa1c8('0x77')](_0x4a497e[_0xa1c8('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x543948;}})[_0xa1c8('0x20')](respondWithResult(_0x16c4e3,null))[_0xa1c8('0x29')](handleError(_0x16c4e3,null));};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js
index 28f9cc0..4c54ea1 100644
--- a/server/api/smsMessage/smsMessage.events.js
+++ b/server/api/smsMessage/smsMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1053=['hook','../../mysqldb','SmsMessage','setMaxListeners','save','update','emit'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x1053,0x1e4));var _0x3105=function(_0x84dbc9,_0x804160){_0x84dbc9=_0x84dbc9-0x0;var _0x365eea=_0x1053[_0x84dbc9];return _0x365eea;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x3105('0x0'))['db'][_0x3105('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3105('0x2')](0x0);var events={'afterCreate':_0x3105('0x3'),'afterUpdate':_0x3105('0x4'),'afterDestroy':'remove'};function emitEvent(_0x9ffc30){return function(_0x47ce47,_0x5342b4,_0x366cbc){SmsMessageEvents[_0x3105('0x5')](_0x9ffc30+':'+_0x47ce47['id'],_0x47ce47);SmsMessageEvents[_0x3105('0x5')](_0x9ffc30,_0x47ce47);_0x366cbc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x3105('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
+var _0xc668=['hasOwnProperty','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x27fabc,_0x344f70){var _0x438720=function(_0x5ccc9f){while(--_0x5ccc9f){_0x27fabc['push'](_0x27fabc['shift']());}};_0x438720(++_0x344f70);}(_0xc668,0xc0));var _0x8c66=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc668[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x8c66('0x0'));var SmsMessage=require(_0x8c66('0x1'))['db'][_0x8c66('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8c66('0x3')](0x0);var events={'afterCreate':_0x8c66('0x4'),'afterUpdate':_0x8c66('0x5'),'afterDestroy':_0x8c66('0x6')};function emitEvent(_0x5e5671){return function(_0x5db505,_0x12becf,_0x114ab1){SmsMessageEvents[_0x8c66('0x7')](_0x5e5671+':'+_0x5db505['id'],_0x5db505);SmsMessageEvents[_0x8c66('0x7')](_0x5e5671,_0x5db505);_0x114ab1(null);};}for(var e in events){if(events[_0x8c66('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x8c66('0x9')]=SmsMessageEvents;
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js
index ac8c2b1..a974569 100644
--- a/server/api/smsMessage/smsMessage.model.js
+++ b/server/api/smsMessage/smsMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca66=['SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','create','phone','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms','user_key','session_key','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','senderString','POST','https://smsapi.connectel.se/api/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','/api/sms/messages/','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','/auth/1/session','application/json','Missing\x20parameters:\x20base_url','csc','login','sender','text','timestamp','keys','sort','createHash','md5','digest','hex','signature=','baseUrl','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','get','direction','toLowerCase','out','isNil','UserId'];(function(_0x1fc3ef,_0x2976f3){var _0x5f1e66=function(_0x172451){while(--_0x172451){_0x1fc3ef['push'](_0x1fc3ef['shift']());}};_0x5f1e66(++_0x2976f3);}(_0xca66,0x1d7));var _0x6ca6=function(_0x449dfe,_0x156cd4){_0x449dfe=_0x449dfe-0x0;var _0x2da103=_0xca66[_0x449dfe];return _0x2da103;};'use strict';var _=require(_0x6ca6('0x0'));var util=require(_0x6ca6('0x1'));var logger=require(_0x6ca6('0x2'))(_0x6ca6('0x3'));var moment=require('moment');var BPromise=require(_0x6ca6('0x4'));var rp=require(_0x6ca6('0x5'));var fs=require('fs');var path=require(_0x6ca6('0x6'));var rimraf=require(_0x6ca6('0x7'));var config=require('../../config/environment');var attributes=require(_0x6ca6('0x8'));module[_0x6ca6('0x9')]=function(_0x15f1ec,_0x25a267){return _0x15f1ec[_0x6ca6('0xa')](_0x6ca6('0xb'),attributes,{'tableName':_0x6ca6('0xc'),'paranoid':![],'indexes':[{'name':_0x6ca6('0xd'),'fields':[_0x6ca6('0xd')]},{'name':'fti_sms_messages','fields':[_0x6ca6('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14ace6,_0x3aa496,_0x567fcf){var _0x4c27b6=_0x15f1ec['models'];var _0x49c1ca=_0x14ace6[_0x6ca6('0xf')]({'plain':!![]});if(_0x49c1ca[_0x6ca6('0x10')]['toLowerCase']()==='in'||_0x49c1ca[_0x6ca6('0x10')][_0x6ca6('0x11')]()===_0x6ca6('0x12')&&!_0x49c1ca['secret']&&!_[_0x6ca6('0x13')](_0x49c1ca[_0x6ca6('0x14')])){_0x4c27b6[_0x6ca6('0x15')][_0x6ca6('0x16')]({'where':{'id':_0x49c1ca[_0x6ca6('0x17')]}})[_0x6ca6('0x18')](function(_0x4b6f59){if(_0x4b6f59){_0x4b6f59[_0x6ca6('0x19')]({'lastMsgAt':_0x49c1ca[_0x6ca6('0x1a')],'lastMsgDirection':_0x49c1ca[_0x6ca6('0x10')][_0x6ca6('0x11')]()});}})[_0x6ca6('0x1b')](function(_0x16f802){console[_0x6ca6('0x1c')](_0x16f802);});}if(_0x49c1ca['direction']===_0x6ca6('0x12')&&!_0x49c1ca[_0x6ca6('0x1d')]){var _0x133217;_0x4c27b6[_0x6ca6('0x1e')][_0x6ca6('0x1f')]({'where':{'id':_0x49c1ca[_0x6ca6('0x20')]},'raw':!![]})[_0x6ca6('0x18')](function(_0x47fed2){_0x133217=_0x47fed2;if(_0x133217&&_0x133217[_0x6ca6('0x21')]){switch(_0x133217['type']){case _0x6ca6('0x22'):var _0x4792ff=require(_0x6ca6('0x22'));if(_0x133217[_0x6ca6('0x23')]&&_0x133217[_0x6ca6('0x24')]&&_0x133217['phone']){var _0x310b9e=new _0x4792ff(_0x133217[_0x6ca6('0x23')],_0x133217['authToken']);_0x310b9e['messages'][_0x6ca6('0x25')]({'body':_0x49c1ca[_0x6ca6('0xe')],'to':_0x49c1ca['phone'],'from':_0x133217[_0x6ca6('0x26')],'statusCallback':_0x133217['remote']+'/api/sms/messages/'+_0x49c1ca['id']+_0x6ca6('0x27')+_0x133217[_0x6ca6('0x28')]})[_0x6ca6('0x18')](function(_0x353f53){if(_0x353f53[_0x6ca6('0x29')]){return _0x14ace6[_0x6ca6('0x19')]({'messageId':_0x353f53[_0x6ca6('0x29')]});}})[_0x6ca6('0x1b')](function(_0x59f388){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6ca6('0x2a'),'twilio',util[_0x6ca6('0x2b')](_0x59f388,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x22'),_0x6ca6('0x2d'));}break;case'skebby':var _0x21f04a=_0x6ca6('0x2e');if(_0x133217[_0x6ca6('0x2f')]&&_0x133217[_0x6ca6('0x30')]){var _0x5c366d={'recipient':[_0x49c1ca[_0x6ca6('0x26')]],'message':_0x49c1ca[_0x6ca6('0xe')],'message_type':_0x133217[_0x6ca6('0x31')]};if(_0x133217[_0x6ca6('0x31')]&&_0x133217[_0x6ca6('0x31')]!=='SI'){_0x5c366d['sender']=_0x133217[_0x6ca6('0x26')];}var _0x2325d1={'url':_0x21f04a+_0x6ca6('0x32')+_0x133217[_0x6ca6('0x2f')]+_0x6ca6('0x33')+_0x133217['password'],'method':_0x6ca6('0x34')};rp(_0x2325d1)['then'](function(_0x58611e){var _0x534f28=_0x58611e[_0x6ca6('0x35')](';');var _0x51c3e6={'user_key':_0x534f28[0x0],'session_key':_0x534f28[0x1]};_0x2325d1={'url':_0x21f04a+_0x6ca6('0x36'),'method':'POST','headers':{'user_key':_0x51c3e6[_0x6ca6('0x37')],'Session_key':_0x51c3e6[_0x6ca6('0x38')]},'json':!![],'body':_0x5c366d};return rp(_0x2325d1);})[_0x6ca6('0x18')](function(_0x2aea14){if(_0x2aea14['total_sent']>=0x1){var _0x218e89={'messageId':_0x2aea14[_0x6ca6('0x39')]};if(_0x133217[_0x6ca6('0x31')]!=='GP'||!_0x133217[_0x6ca6('0x3a')]){_0x218e89[_0x6ca6('0x3b')]=!![];}return _0x14ace6[_0x6ca6('0x19')](_0x218e89);}else{return logger[_0x6ca6('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6ca6('0x2a'),_0x6ca6('0x3c'),util[_0x6ca6('0x2b')](_0x2aea14,{'showHidden':![],'depth':null}));}})[_0x6ca6('0x1b')](function(_0x3cbaf8){return logger[_0x6ca6('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6ca6('0x2a'),'skebby',util['inspect'](_0x3cbaf8,{'showHidden':![],'depth':null}));});}else{logger[_0x6ca6('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby',_0x6ca6('0x3d'));}break;case'connectel':if(_0x133217[_0x6ca6('0x24')]){var _0x49f10b={'recipient':_0x49c1ca[_0x6ca6('0x26')],'message':_0x49c1ca[_0x6ca6('0xe')],'sender':_0x133217[_0x6ca6('0x3e')]||_0x133217[_0x6ca6('0x26')],'authorization':_0x133217[_0x6ca6('0x24')]};var _0x3aa496={'method':_0x6ca6('0x3f'),'uri':_0x6ca6('0x40'),'body':_0x49f10b,'json':!![]};rp(_0x3aa496)[_0x6ca6('0x18')](function(_0x481a73){var _0x521542={'messageId':_0x481a73['requestid']};if(!_0x133217[_0x6ca6('0x3a')]){_0x521542[_0x6ca6('0x3b')]=!![];}return _0x14ace6['update'](_0x521542);})['catch'](function(_0x3f78ac){logger[_0x6ca6('0x1c')](_0x6ca6('0x2c'),_0x6ca6('0x2a'),'connectel',util[_0x6ca6('0x2b')](_0x3f78ac,{'showHidden':![],'depth':null}));});}else{logger[_0x6ca6('0x1c')](_0x6ca6('0x2c'),_0x6ca6('0x2a'),'connectel',_0x6ca6('0x41'));}break;case _0x6ca6('0x42'):if(_0x133217[_0x6ca6('0x2f')]&&_0x133217[_0x6ca6('0x30')]){var _0x49f10b={'messages':[{'source':_0x6ca6('0x43'),'to':_0x49c1ca[_0x6ca6('0x26')],'body':_0x49c1ca[_0x6ca6('0xe')],'from':_0x133217[_0x6ca6('0x3e')]||_0x133217[_0x6ca6('0x26')]}]};var _0x243cf3=util[_0x6ca6('0x44')]('%s:%s',_0x133217[_0x6ca6('0x2f')],_0x133217[_0x6ca6('0x30')]);var _0x3aa496={'method':_0x6ca6('0x3f'),'uri':_0x6ca6('0x45'),'body':_0x49f10b,'headers':{'Authorization':util[_0x6ca6('0x44')](_0x6ca6('0x46'),new Buffer(_0x243cf3)['toString'](_0x6ca6('0x47')))},'json':!![]};rp(_0x3aa496)[_0x6ca6('0x18')](function(_0x236245){if(_0x236245[_0x6ca6('0x48')]>=0xc8&&_0x236245['http_code']<=0xce){if(_0x236245[_0x6ca6('0x49')]&&_0x236245[_0x6ca6('0x49')][_0x6ca6('0x4a')]>0x0){var _0x5754ca=_[_0x6ca6('0x4b')](_0x236245[_0x6ca6('0x49')][_0x6ca6('0x4c')]);var _0x47392e={'messageId':_0x5754ca[_0x6ca6('0x4d')]};if(!_0x133217[_0x6ca6('0x3a')]){_0x47392e[_0x6ca6('0x3b')]=!![];}return _0x14ace6['update'](_0x47392e);}else{logger[_0x6ca6('0x1c')](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x4e'),util[_0x6ca6('0x2b')](_0x236245,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x4e'),util[_0x6ca6('0x2b')](_0x236245,{'showHidden':![],'depth':null}));}})['catch'](function(_0x481b26){logger[_0x6ca6('0x1c')](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x4e'),util[_0x6ca6('0x2b')](_0x481b26,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x6ca6('0x4f'):if(_0x133217['authId']&&_0x133217[_0x6ca6('0x24')]){var _0x49f10b={'dst':_0x49c1ca[_0x6ca6('0x26')],'text':_0x49c1ca[_0x6ca6('0xe')],'src':_0x133217[_0x6ca6('0x3e')]||_0x133217[_0x6ca6('0x26')],'url':_0x133217['remote']+_0x6ca6('0x50')+_0x49c1ca['id']+_0x6ca6('0x27')+_0x133217['token']};var _0x243cf3=util[_0x6ca6('0x44')](_0x6ca6('0x51'),_0x133217['authId'],_0x133217[_0x6ca6('0x24')]);var _0x3aa496={'method':_0x6ca6('0x3f'),'uri':util[_0x6ca6('0x44')](_0x6ca6('0x52'),_0x133217['authId']),'body':_0x49f10b,'headers':{'Authorization':util[_0x6ca6('0x44')](_0x6ca6('0x46'),new Buffer(_0x243cf3)['toString'](_0x6ca6('0x47')))},'json':!![]};rp(_0x3aa496)['then'](function(_0x30c015){var _0x54a3ce={'messageId':_0x30c015[_0x6ca6('0x53')][0x0]};return _0x14ace6[_0x6ca6('0x19')](_0x54a3ce);})['catch'](function(_0xc4c029){logger[_0x6ca6('0x1c')](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x4f'),util['inspect'](_0xc4c029,{'showHidden':![],'depth':null}));});}else{logger[_0x6ca6('0x1c')](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x4f'),_0x6ca6('0x54'));}break;case _0x6ca6('0x55'):if(_0x133217[_0x6ca6('0x2f')]&&_0x133217['password']){if(_0x133217['baseUrl']){var _0x4aa734={'method':'POST','uri':_0x133217['baseUrl']+_0x6ca6('0x56'),'body':{'username':_0x133217[_0x6ca6('0x2f')],'password':_0x133217[_0x6ca6('0x30')]},'json':!![]};return rp(_0x4aa734)[_0x6ca6('0x18')](function(_0x445030){var _0x496f2d={'method':_0x6ca6('0x3f'),'uri':_0x133217['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x133217[_0x6ca6('0x26')],'destinations':[{'to':_0x49c1ca[_0x6ca6('0x26')]}],'text':_0x49c1ca[_0x6ca6('0xe')],'notifyUrl':_0x133217['remote']+_0x6ca6('0x50')+_0x49c1ca['id']+_0x6ca6('0x27')+_0x133217['token'],'notifyContentType':_0x6ca6('0x57'),'callbackData':_0x133217['phone']+';'+_0x49c1ca['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x445030[_0x6ca6('0x28')]},'json':!![]};return rp(_0x496f2d)[_0x6ca6('0x18')](function(_0x4ea574){if(_0x4ea574[_0x6ca6('0x4c')]){var _0xe9fe9c={'messageId':_0x4ea574[_0x6ca6('0x4c')][0x0][_0x6ca6('0xd')]};if(!_0x133217[_0x6ca6('0x3a')]){_0xe9fe9c[_0x6ca6('0x3b')]=!![];}return _0x14ace6[_0x6ca6('0x19')](_0xe9fe9c);}else{return logger[_0x6ca6('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6ca6('0x55'),util[_0x6ca6('0x2b')](_0x4ea574,{'showHidden':![],'depth':null}));}});})[_0x6ca6('0x1b')](function(_0x590543){return logger[_0x6ca6('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6ca6('0x2a'),_0x6ca6('0x55'),util[_0x6ca6('0x2b')](_0x590543,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6ca6('0x2c'),'afterCreate','infobip',_0x6ca6('0x58'));}}else{logger[_0x6ca6('0x1c')](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x55'),_0x6ca6('0x3d'));}break;case _0x6ca6('0x59'):var _0x1ad3f5=require('crypto');if(_0x133217['apiKey']){var _0x3dfd3a={};_0x3dfd3a[_0x6ca6('0x5a')]=_0x133217[_0x6ca6('0x2f')];_0x3dfd3a[_0x6ca6('0x26')]=_0x49c1ca[_0x6ca6('0x26')];_0x3dfd3a[_0x6ca6('0x5b')]=_0x133217[_0x6ca6('0x26')];_0x3dfd3a[_0x6ca6('0x5c')]=_0x49c1ca['body'];_0x3dfd3a[_0x6ca6('0x5d')]=+new Date();var _0x1b27c6='';var _0xf9e3ef='';var _0x16bad4=Object[_0x6ca6('0x5e')](_0x3dfd3a);_0x16bad4[_0x6ca6('0x5f')]();for(var _0x288e01=0x0;_0x288e01<_0x16bad4['length'];_0x288e01++){if(_0x1b27c6!=''){_0x1b27c6+='&';}_0x1b27c6+=_0x16bad4[_0x288e01]+'='+encodeURIComponent(_0x3dfd3a[_0x16bad4[_0x288e01]]);_0xf9e3ef+=_0x3dfd3a[_0x16bad4[_0x288e01]];}_0xf9e3ef+=_0x133217['apiKey'];_0xf9e3ef=_0x1ad3f5[_0x6ca6('0x60')](_0x6ca6('0x61'))[_0x6ca6('0x19')](_0xf9e3ef)[_0x6ca6('0x62')](_0x6ca6('0x63'));if(_0x1b27c6!==''){_0x1b27c6+='&';}_0x1b27c6+=_0x6ca6('0x64')+_0xf9e3ef;var _0x2325d1={'method':_0x6ca6('0x34'),'uri':_0x133217[_0x6ca6('0x65')]+_0x6ca6('0x66')+_0x1b27c6,'json':!![]};return rp(_0x2325d1)['then'](function(_0x23d8cd){var _0x3a1e32=Object['keys'](_0x23d8cd);if(_0x23d8cd[_0x3a1e32[0x0]][_0x6ca6('0x1c')]&&parseInt(_0x23d8cd[_0x3a1e32[0x0]]['error'])===0x0){var _0x1fc670={'messageId':_0x23d8cd[_0x3a1e32[0x0]][_0x6ca6('0x67')]};if(!_0x133217[_0x6ca6('0x3a')]){_0x1fc670['read']=!![];}return _0x14ace6[_0x6ca6('0x19')](_0x1fc670);}else{return logger['error'](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x59'),util[_0x6ca6('0x2b')](_0x23d8cd[_0x6ca6('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x59b6dc){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6ca6('0x59'),util[_0x6ca6('0x2b')](_0x59b6dc,{'showHidden':![],'depth':null}));});}else{logger[_0x6ca6('0x1c')](_0x6ca6('0x2c'),_0x6ca6('0x2a'),'csc',_0x6ca6('0x68'));}break;case _0x6ca6('0x69'):if(_0x133217[_0x6ca6('0x6a')]){var _0x5e3ad0={'method':'POST','uri':_0x6ca6('0x6b'),'headers':{'Authorization':_0x133217['apiKey']},'body':{'content':_0x49c1ca[_0x6ca6('0xe')],'to':[_0x49c1ca['phone']],'from':_0x133217[_0x6ca6('0x26')],'binary':![],'clientMessageId':_0x6ca6('0x6c'),'charset':_0x6ca6('0x6d')},'json':!![]};rp(_0x5e3ad0)[_0x6ca6('0x18')](function(_0x1becc0){if(!_0x1becc0['error']){var _0x1394ea={'messageId':_0x1becc0[_0x6ca6('0x4c')][0x0][_0x6ca6('0x6e')]};if(!_0x133217[_0x6ca6('0x3a')]){_0x1394ea[_0x6ca6('0x3b')]=!![];}return _0x14ace6[_0x6ca6('0x19')](_0x1394ea);}else{return logger[_0x6ca6('0x1c')](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x69'),util[_0x6ca6('0x2b')](_0x1becc0['error'],{'showHidden':![],'depth':null}));}})[_0x6ca6('0x1b')](function(_0x29a556){return logger[_0x6ca6('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6ca6('0x2a'),'clickatell',util[_0x6ca6('0x2b')](_0x29a556,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6ca6('0x2a'),_0x6ca6('0x69'),_0x6ca6('0x68'));}break;case _0x6ca6('0x6f'):if(_0x133217[_0x6ca6('0x6a')]){var _0x2a21b6={};var _0x2325d1={'method':_0x6ca6('0x3f'),'uri':_0x6ca6('0x70'),'headers':{'Authorization':_0x6ca6('0x71')+_0x133217['apiKey'],'Content-Type':_0x6ca6('0x57')},'body':{'from':_0x133217[_0x6ca6('0x26')],'to':_0x49c1ca[_0x6ca6('0x26')],'text':_0x49c1ca[_0x6ca6('0xe')]},'json':!![]};return rp(_0x2325d1)[_0x6ca6('0x18')](function(_0x5dcc40){if(_0x5dcc40[_0x6ca6('0x72')]==0xca){_0x2a21b6[_0x6ca6('0x73')]=_0x5dcc40;var _0x375de0={'method':_0x6ca6('0x3f'),'uri':_0x6ca6('0x74'),'headers':{'Authorization':_0x6ca6('0x71')+_0x133217[_0x6ca6('0x6a')],'Content-Type':_0x6ca6('0x57')},'body':{'refid':_0x2a21b6[_0x6ca6('0x73')][_0x6ca6('0x75')]},'json':!![]};return rp(_0x375de0)[_0x6ca6('0x18')](function(_0x12162b){_0x2a21b6[_0x6ca6('0x76')]=_0x12162b;var _0xa8c684={'messageId':_0x2a21b6[_0x6ca6('0x73')][_0x6ca6('0x75')],'read':!![]};return _0x14ace6[_0x6ca6('0x19')](_0xa8c684);});}else{return logger['error'](_0x6ca6('0x2c'),_0x6ca6('0x2a'),_0x6ca6('0x6f'),util['inspect'](_0x5dcc40,{'showHidden':![],'depth':null}));}})[_0x6ca6('0x1b')](function(_0x5bfeab){return logger[_0x6ca6('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6ca6('0x2a'),_0x6ca6('0x6f'),util[_0x6ca6('0x2b')](_0x5bfeab,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x6ca6('0x2c'),'afterCreate',_0x6ca6('0x6f'),_0x6ca6('0x77'));}break;}}})[_0x6ca6('0x78')](function(){_0x567fcf();});}else{_0x567fcf();}}},'charset':_0x6ca6('0x79'),'collate':_0x6ca6('0x7a')});};
\ No newline at end of file
+var _0x0aef=['length','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','secret','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','token','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','sms','POST','user_key','session_key','total_sent','deliveryReport','Missing\x20parameters:\x20username,\x20password','requestid','read','connectel','Missing\x20parameters:\x20authToken','clicksend','senderString','format','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','message_id','clickSend','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','plivo','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','csc','crypto','apiKey','text','timestamp','sort'];(function(_0x1f909a,_0x15d56f){var _0x543f16=function(_0x17a991){while(--_0x17a991){_0x1f909a['push'](_0x1f909a['shift']());}};_0x543f16(++_0x15d56f);}(_0x0aef,0x107));var _0xf0ae=function(_0x582048,_0xa9ee92){_0x582048=_0x582048-0x0;var _0x1e57c4=_0x0aef[_0x582048];return _0x1e57c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf0ae('0x0'))('api');var moment=require(_0xf0ae('0x1'));var BPromise=require(_0xf0ae('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0ae('0x3'));var rimraf=require(_0xf0ae('0x4'));var config=require(_0xf0ae('0x5'));var attributes=require('./smsMessage.attributes');module[_0xf0ae('0x6')]=function(_0x78348e,_0x38f6ee){return _0x78348e['define'](_0xf0ae('0x7'),attributes,{'tableName':_0xf0ae('0x8'),'paranoid':![],'indexes':[{'name':_0xf0ae('0x9'),'fields':[_0xf0ae('0x9')]},{'name':_0xf0ae('0xa'),'fields':['body'],'type':_0xf0ae('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x11861d,_0x2835cf,_0x47cdad){var _0x4e4052=_0x78348e[_0xf0ae('0xc')];var _0x3e527e=_0x11861d[_0xf0ae('0xd')]({'plain':!![]});if(_0x3e527e['direction']['toLowerCase']()==='in'||_0x3e527e[_0xf0ae('0xe')][_0xf0ae('0xf')]()===_0xf0ae('0x10')&&!_0x3e527e['secret']&&!_[_0xf0ae('0x11')](_0x3e527e[_0xf0ae('0x12')])){_0x4e4052[_0xf0ae('0x13')][_0xf0ae('0x14')]({'where':{'id':_0x3e527e[_0xf0ae('0x15')]}})['then'](function(_0x1f049c){if(_0x1f049c){_0x1f049c[_0xf0ae('0x16')]({'lastMsgAt':_0x3e527e[_0xf0ae('0x17')],'lastMsgDirection':_0x3e527e[_0xf0ae('0xe')][_0xf0ae('0xf')]()});}})[_0xf0ae('0x18')](function(_0x1dfafd){console['error'](_0x1dfafd);});}if(_0x3e527e[_0xf0ae('0xe')]===_0xf0ae('0x10')&&!_0x3e527e[_0xf0ae('0x19')]){var _0xfc7d7b;_0x4e4052[_0xf0ae('0x1a')][_0xf0ae('0x1b')]({'where':{'id':_0x3e527e[_0xf0ae('0x1c')]},'raw':!![]})[_0xf0ae('0x1d')](function(_0x57fafb){_0xfc7d7b=_0x57fafb;if(_0xfc7d7b&&_0xfc7d7b[_0xf0ae('0x1e')]){switch(_0xfc7d7b[_0xf0ae('0x1e')]){case _0xf0ae('0x1f'):var _0x2314da=require('twilio');if(_0xfc7d7b[_0xf0ae('0x20')]&&_0xfc7d7b[_0xf0ae('0x21')]&&_0xfc7d7b[_0xf0ae('0x22')]){var _0x23f892=new _0x2314da(_0xfc7d7b[_0xf0ae('0x20')],_0xfc7d7b[_0xf0ae('0x21')]);_0x23f892[_0xf0ae('0x23')][_0xf0ae('0x24')]({'body':_0x3e527e[_0xf0ae('0x25')],'to':_0x3e527e[_0xf0ae('0x22')],'from':_0xfc7d7b['phone'],'statusCallback':_0xfc7d7b[_0xf0ae('0x26')]+_0xf0ae('0x27')+_0x3e527e['id']+_0xf0ae('0x28')+_0xfc7d7b[_0xf0ae('0x29')]})[_0xf0ae('0x1d')](function(_0x4d0d48){if(_0x4d0d48['sid']){return _0x11861d[_0xf0ae('0x16')]({'messageId':_0x4d0d48['sid']});}})[_0xf0ae('0x18')](function(_0x45c698){logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),'twilio',util[_0xf0ae('0x2d')](_0x45c698,{'showHidden':![],'depth':null}));});}else{logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xf0ae('0x2e'):var _0x45e425=_0xf0ae('0x2f');if(_0xfc7d7b[_0xf0ae('0x30')]&&_0xfc7d7b[_0xf0ae('0x31')]){var _0x132050={'recipient':[_0x3e527e[_0xf0ae('0x22')]],'message':_0x3e527e['body'],'message_type':_0xfc7d7b[_0xf0ae('0x32')]};if(_0xfc7d7b[_0xf0ae('0x32')]&&_0xfc7d7b[_0xf0ae('0x32')]!=='SI'){_0x132050[_0xf0ae('0x33')]=_0xfc7d7b[_0xf0ae('0x22')];}var _0x25c55a={'url':_0x45e425+_0xf0ae('0x34')+_0xfc7d7b[_0xf0ae('0x30')]+'&password='+_0xfc7d7b[_0xf0ae('0x31')],'method':_0xf0ae('0x35')};rp(_0x25c55a)[_0xf0ae('0x1d')](function(_0x42b241){var _0xc4e416=_0x42b241['split'](';');var _0x437ab1={'user_key':_0xc4e416[0x0],'session_key':_0xc4e416[0x1]};_0x25c55a={'url':_0x45e425+_0xf0ae('0x36'),'method':_0xf0ae('0x37'),'headers':{'user_key':_0x437ab1[_0xf0ae('0x38')],'Session_key':_0x437ab1[_0xf0ae('0x39')]},'json':!![],'body':_0x132050};return rp(_0x25c55a);})[_0xf0ae('0x1d')](function(_0x49ceb0){if(_0x49ceb0[_0xf0ae('0x3a')]>=0x1){var _0x4d53d7={'messageId':_0x49ceb0['internal_order_id']};if(_0xfc7d7b[_0xf0ae('0x32')]!=='GP'||!_0xfc7d7b[_0xf0ae('0x3b')]){_0x4d53d7['read']=!![];}return _0x11861d[_0xf0ae('0x16')](_0x4d53d7);}else{return logger['error'](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x2e'),util[_0xf0ae('0x2d')](_0x49ceb0,{'showHidden':![],'depth':null}));}})[_0xf0ae('0x18')](function(_0x3ca4e9){return logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x2e'),util[_0xf0ae('0x2d')](_0x3ca4e9,{'showHidden':![],'depth':null}));});}else{logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),'afterCreate',_0xf0ae('0x2e'),_0xf0ae('0x3c'));}break;case'connectel':if(_0xfc7d7b[_0xf0ae('0x21')]){var _0x8e13bc={'recipient':_0x3e527e['phone'],'message':_0x3e527e['body'],'sender':_0xfc7d7b['senderString']||_0xfc7d7b[_0xf0ae('0x22')],'authorization':_0xfc7d7b[_0xf0ae('0x21')]};var _0x2835cf={'method':_0xf0ae('0x37'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x8e13bc,'json':!![]};rp(_0x2835cf)[_0xf0ae('0x1d')](function(_0x239de3){var _0x56db7a={'messageId':_0x239de3[_0xf0ae('0x3d')]};if(!_0xfc7d7b[_0xf0ae('0x3b')]){_0x56db7a[_0xf0ae('0x3e')]=!![];}return _0x11861d[_0xf0ae('0x16')](_0x56db7a);})['catch'](function(_0x25f0f9){logger['error'](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x3f'),util['inspect'](_0x25f0f9,{'showHidden':![],'depth':null}));});}else{logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),'afterCreate','connectel',_0xf0ae('0x40'));}break;case _0xf0ae('0x41'):if(_0xfc7d7b[_0xf0ae('0x30')]&&_0xfc7d7b[_0xf0ae('0x31')]){var _0x8e13bc={'messages':[{'source':'xCALLY\x20Motion','to':_0x3e527e['phone'],'body':_0x3e527e[_0xf0ae('0x25')],'from':_0xfc7d7b[_0xf0ae('0x42')]||_0xfc7d7b[_0xf0ae('0x22')]}]};var _0x267c16=util[_0xf0ae('0x43')]('%s:%s',_0xfc7d7b[_0xf0ae('0x30')],_0xfc7d7b[_0xf0ae('0x31')]);var _0x2835cf={'method':_0xf0ae('0x37'),'uri':_0xf0ae('0x44'),'body':_0x8e13bc,'headers':{'Authorization':util[_0xf0ae('0x43')]('Basic\x20%s',new Buffer(_0x267c16)['toString'](_0xf0ae('0x45')))},'json':!![]};rp(_0x2835cf)['then'](function(_0x5d8b7f){if(_0x5d8b7f[_0xf0ae('0x46')]>=0xc8&&_0x5d8b7f[_0xf0ae('0x46')]<=0xce){if(_0x5d8b7f[_0xf0ae('0x47')]&&_0x5d8b7f[_0xf0ae('0x47')]['queued_count']>0x0){var _0x22a82d=_['head'](_0x5d8b7f[_0xf0ae('0x47')][_0xf0ae('0x23')]);var _0x138795={'messageId':_0x22a82d[_0xf0ae('0x48')]};if(!_0xfc7d7b[_0xf0ae('0x3b')]){_0x138795[_0xf0ae('0x3e')]=!![];}return _0x11861d[_0xf0ae('0x16')](_0x138795);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0ae('0x2c'),_0xf0ae('0x49'),util[_0xf0ae('0x2d')](_0x5d8b7f,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x49'),util[_0xf0ae('0x2d')](_0x5d8b7f,{'showHidden':![],'depth':null}));}})[_0xf0ae('0x18')](function(_0x22b8d5){logger[_0xf0ae('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0ae('0x2c'),'clickSend',util[_0xf0ae('0x2d')](_0x22b8d5,{'showHidden':![],'depth':null}));});}else{logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),'clickSend',_0xf0ae('0x3c'));}break;case'plivo':if(_0xfc7d7b[_0xf0ae('0x4a')]&&_0xfc7d7b['authToken']){var _0x8e13bc={'dst':_0x3e527e[_0xf0ae('0x22')],'text':_0x3e527e[_0xf0ae('0x25')],'src':_0xfc7d7b[_0xf0ae('0x42')]||_0xfc7d7b[_0xf0ae('0x22')],'url':_0xfc7d7b[_0xf0ae('0x26')]+_0xf0ae('0x27')+_0x3e527e['id']+'/status?token='+_0xfc7d7b[_0xf0ae('0x29')]};var _0x267c16=util['format'](_0xf0ae('0x4b'),_0xfc7d7b[_0xf0ae('0x4a')],_0xfc7d7b[_0xf0ae('0x21')]);var _0x2835cf={'method':_0xf0ae('0x37'),'uri':util['format'](_0xf0ae('0x4c'),_0xfc7d7b[_0xf0ae('0x4a')]),'body':_0x8e13bc,'headers':{'Authorization':util['format'](_0xf0ae('0x4d'),new Buffer(_0x267c16)['toString']('base64'))},'json':!![]};rp(_0x2835cf)[_0xf0ae('0x1d')](function(_0x5d90c4){var _0x17d522={'messageId':_0x5d90c4[_0xf0ae('0x4e')][0x0]};return _0x11861d[_0xf0ae('0x16')](_0x17d522);})[_0xf0ae('0x18')](function(_0x5d0fe9){logger['error'](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x4f'),util[_0xf0ae('0x2d')](_0x5d0fe9,{'showHidden':![],'depth':null}));});}else{logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x4f'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xf0ae('0x50'):if(_0xfc7d7b[_0xf0ae('0x30')]&&_0xfc7d7b['password']){if(_0xfc7d7b[_0xf0ae('0x51')]){var _0x439975={'method':_0xf0ae('0x37'),'uri':_0xfc7d7b[_0xf0ae('0x51')]+_0xf0ae('0x52'),'body':{'username':_0xfc7d7b[_0xf0ae('0x30')],'password':_0xfc7d7b[_0xf0ae('0x31')]},'json':!![]};return rp(_0x439975)[_0xf0ae('0x1d')](function(_0x4c8c50){var _0x1d8a1f={'method':_0xf0ae('0x37'),'uri':_0xfc7d7b[_0xf0ae('0x51')]+_0xf0ae('0x53'),'body':{'messages':[{'from':_0xfc7d7b[_0xf0ae('0x22')],'destinations':[{'to':_0x3e527e[_0xf0ae('0x22')]}],'text':_0x3e527e['body'],'notifyUrl':_0xfc7d7b['remote']+_0xf0ae('0x27')+_0x3e527e['id']+'/status?token='+_0xfc7d7b[_0xf0ae('0x29')],'notifyContentType':'application/json','callbackData':_0xfc7d7b['phone']+';'+_0x3e527e[_0xf0ae('0x25')]}]},'headers':{'Authorization':_0xf0ae('0x54')+_0x4c8c50['token']},'json':!![]};return rp(_0x1d8a1f)[_0xf0ae('0x1d')](function(_0x13570f){if(_0x13570f[_0xf0ae('0x23')]){var _0x3569f3={'messageId':_0x13570f[_0xf0ae('0x23')][0x0][_0xf0ae('0x9')]};if(!_0xfc7d7b['deliveryReport']){_0x3569f3[_0xf0ae('0x3e')]=!![];}return _0x11861d[_0xf0ae('0x16')](_0x3569f3);}else{return logger['error'](_0xf0ae('0x2b'),_0xf0ae('0x2c'),'infobip',util[_0xf0ae('0x2d')](_0x13570f,{'showHidden':![],'depth':null}));}});})[_0xf0ae('0x18')](function(_0x13cf83){return logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x50'),util[_0xf0ae('0x2d')](_0x13cf83,{'showHidden':![],'depth':null}));});}else{logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x50'),'Missing\x20parameters:\x20base_url');}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0ae('0x2c'),_0xf0ae('0x50'),_0xf0ae('0x3c'));}break;case _0xf0ae('0x55'):var _0x44936c=require(_0xf0ae('0x56'));if(_0xfc7d7b[_0xf0ae('0x57')]){var _0x2148d9={};_0x2148d9['login']=_0xfc7d7b[_0xf0ae('0x30')];_0x2148d9[_0xf0ae('0x22')]=_0x3e527e[_0xf0ae('0x22')];_0x2148d9['sender']=_0xfc7d7b[_0xf0ae('0x22')];_0x2148d9[_0xf0ae('0x58')]=_0x3e527e[_0xf0ae('0x25')];_0x2148d9[_0xf0ae('0x59')]=+new Date();var _0x1bd61e='';var _0x2b6e12='';var _0x411199=Object['keys'](_0x2148d9);_0x411199[_0xf0ae('0x5a')]();for(var _0x55dc64=0x0;_0x55dc64<_0x411199[_0xf0ae('0x5b')];_0x55dc64++){if(_0x1bd61e!=''){_0x1bd61e+='&';}_0x1bd61e+=_0x411199[_0x55dc64]+'='+encodeURIComponent(_0x2148d9[_0x411199[_0x55dc64]]);_0x2b6e12+=_0x2148d9[_0x411199[_0x55dc64]];}_0x2b6e12+=_0xfc7d7b[_0xf0ae('0x57')];_0x2b6e12=_0x44936c[_0xf0ae('0x5c')](_0xf0ae('0x5d'))['update'](_0x2b6e12)[_0xf0ae('0x5e')](_0xf0ae('0x5f'));if(_0x1bd61e!==''){_0x1bd61e+='&';}_0x1bd61e+=_0xf0ae('0x60')+_0x2b6e12;var _0x25c55a={'method':'GET','uri':_0xfc7d7b[_0xf0ae('0x51')]+_0xf0ae('0x61')+_0x1bd61e,'json':!![]};return rp(_0x25c55a)[_0xf0ae('0x1d')](function(_0xe42b9c){var _0x9bd481=Object[_0xf0ae('0x62')](_0xe42b9c);if(_0xe42b9c[_0x9bd481[0x0]][_0xf0ae('0x2a')]&&parseInt(_0xe42b9c[_0x9bd481[0x0]][_0xf0ae('0x2a')])===0x0){var _0x81b211={'messageId':_0xe42b9c[_0x9bd481[0x0]]['id_sms']};if(!_0xfc7d7b[_0xf0ae('0x3b')]){_0x81b211[_0xf0ae('0x3e')]=!![];}return _0x11861d['update'](_0x81b211);}else{return logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x55'),util[_0xf0ae('0x2d')](_0xe42b9c[_0xf0ae('0x2a')],{'showHidden':![],'depth':null}));}})[_0xf0ae('0x18')](function(_0x214c4b){return logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),'csc',util[_0xf0ae('0x2d')](_0x214c4b,{'showHidden':![],'depth':null}));});}else{logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),'afterCreate','csc',_0xf0ae('0x63'));}break;case _0xf0ae('0x64'):if(_0xfc7d7b[_0xf0ae('0x57')]){var _0x53ea8b={'method':_0xf0ae('0x37'),'uri':_0xf0ae('0x65'),'headers':{'Authorization':_0xfc7d7b[_0xf0ae('0x57')]},'body':{'content':_0x3e527e[_0xf0ae('0x25')],'to':[_0x3e527e[_0xf0ae('0x22')]],'from':_0xfc7d7b[_0xf0ae('0x22')],'binary':![],'clientMessageId':_0xf0ae('0x66'),'charset':_0xf0ae('0x67')},'json':!![]};rp(_0x53ea8b)[_0xf0ae('0x1d')](function(_0x305f56){if(!_0x305f56[_0xf0ae('0x2a')]){var _0x1d3489={'messageId':_0x305f56[_0xf0ae('0x23')][0x0][_0xf0ae('0x68')]};if(!_0xfc7d7b[_0xf0ae('0x3b')]){_0x1d3489[_0xf0ae('0x3e')]=!![];}return _0x11861d[_0xf0ae('0x16')](_0x1d3489);}else{return logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x64'),util[_0xf0ae('0x2d')](_0x305f56[_0xf0ae('0x2a')],{'showHidden':![],'depth':null}));}})[_0xf0ae('0x18')](function(_0x24b9af){return logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x64'),util[_0xf0ae('0x2d')](_0x24b9af,{'showHidden':![],'depth':null}));});}else{logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),'clickatell',_0xf0ae('0x63'));}break;case'intelepeer':if(_0xfc7d7b[_0xf0ae('0x57')]){var _0x29be8e={};var _0x25c55a={'method':'POST','uri':_0xf0ae('0x69'),'headers':{'Authorization':'Bearer\x20'+_0xfc7d7b[_0xf0ae('0x57')],'Content-Type':_0xf0ae('0x6a')},'body':{'from':_0xfc7d7b['phone'],'to':_0x3e527e[_0xf0ae('0x22')],'text':_0x3e527e['body']},'json':!![]};return rp(_0x25c55a)[_0xf0ae('0x1d')](function(_0x49adbc){if(_0x49adbc[_0xf0ae('0x6b')]==0xca){_0x29be8e[_0xf0ae('0x6c')]=_0x49adbc;var _0x5d9c1e={'method':_0xf0ae('0x37'),'uri':_0xf0ae('0x6d'),'headers':{'Authorization':_0xf0ae('0x6e')+_0xfc7d7b[_0xf0ae('0x57')],'Content-Type':_0xf0ae('0x6a')},'body':{'refid':_0x29be8e[_0xf0ae('0x6c')][_0xf0ae('0x6f')]},'json':!![]};return rp(_0x5d9c1e)['then'](function(_0x11b490){_0x29be8e[_0xf0ae('0x70')]=_0x11b490;var _0x9acb05={'messageId':_0x29be8e[_0xf0ae('0x6c')][_0xf0ae('0x6f')],'read':!![]};return _0x11861d[_0xf0ae('0x16')](_0x9acb05);});}else{return logger[_0xf0ae('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf0ae('0x71'),util['inspect'](_0x49adbc,{'showHidden':![],'depth':null}));}})[_0xf0ae('0x18')](function(_0xbe80f6){return logger[_0xf0ae('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf0ae('0x2c'),_0xf0ae('0x71'),util[_0xf0ae('0x2d')](_0xbe80f6,{'showHidden':![],'depth':null}));});}else{return logger[_0xf0ae('0x2a')](_0xf0ae('0x2b'),_0xf0ae('0x2c'),_0xf0ae('0x71'),_0xf0ae('0x72'));}break;}}})[_0xf0ae('0x73')](function(){_0x47cdad();});}else{_0x47cdad();}}},'charset':_0xf0ae('0x74'),'collate':_0xf0ae('0x75')});};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js
index 45c1e24..825f756 100644
--- a/server/api/smsMessage/smsMessage.rpc.js
+++ b/server/api/smsMessage/smsMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fc2=['message','info','result','catch','CreateSmsMessage','SmsMessage','body','options','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x4fc2,0x111));var _0x24fc=function(_0x1d2a9e,_0x33fd9d){_0x1d2a9e=_0x1d2a9e-0x0;var _0x5e8a64=_0x4fc2[_0x1d2a9e];return _0x5e8a64;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});config['redis']=_[_0x24fc('0xb')](config[_0x24fc('0xc')],{'host':_0x24fc('0xd'),'port':0x18eb});var socket=require(_0x24fc('0xe'))(new Redis(config[_0x24fc('0xc')]));require(_0x24fc('0xf'))['register'](socket);function respondWithRpcPromise(_0x44caca,_0x1819a5,_0x1a4462){return new BPromise(function(_0x133438,_0x24998d){return client[_0x24fc('0x10')](_0x44caca,_0x1a4462)[_0x24fc('0x11')](function(_0x9a1673){logger['info'](_0x24fc('0x12'),_0x1819a5,_0x24fc('0x13'));logger['debug'](_0x24fc('0x14'),_0x1819a5,_0x24fc('0x13'),JSON[_0x24fc('0x15')](_0x9a1673));if(_0x9a1673[_0x24fc('0x16')]){if(_0x9a1673[_0x24fc('0x16')][_0x24fc('0x17')]===0x1f4){logger['error'](_0x24fc('0x12'),_0x1819a5,_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);return _0x24998d(_0x9a1673[_0x24fc('0x16')]['message']);}logger[_0x24fc('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1819a5,_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);return _0x133438(_0x9a1673[_0x24fc('0x16')][_0x24fc('0x18')]);}else{logger[_0x24fc('0x19')]('SmsMessage,\x20%s,\x20%s',_0x1819a5,_0x24fc('0x13'));_0x133438(_0x9a1673[_0x24fc('0x1a')][_0x24fc('0x18')]);}})[_0x24fc('0x1b')](function(_0x4c5a43){logger[_0x24fc('0x16')](_0x24fc('0x12'),_0x1819a5,_0x4c5a43);_0x24998d(_0x4c5a43);});});}exports[_0x24fc('0x1c')]=function(_0x5b0516){var _0x32a57d=this;return new Promise(function(_0x36a771,_0xbf1d6b){return db[_0x24fc('0x1d')]['create'](_0x5b0516[_0x24fc('0x1e')],{'raw':_0x5b0516['options']?_0x5b0516[_0x24fc('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x24fc('0x11')](function(_0x44c121){logger[_0x24fc('0x19')]('CreateSmsMessage',_0x5b0516);logger[_0x24fc('0x20')]('CreateSmsMessage',_0x5b0516,JSON[_0x24fc('0x15')](_0x44c121));_0x36a771(_0x44c121);})[_0x24fc('0x1b')](function(_0x36a9b4){logger[_0x24fc('0x16')](_0x24fc('0x1c'),_0x36a9b4[_0x24fc('0x18')],_0x5b0516);_0xbf1d6b(_0x32a57d[_0x24fc('0x16')](0x1f4,_0x36a9b4[_0x24fc('0x18')]));});});};
\ No newline at end of file
+var _0x0b0e=['message','result','SmsMessage','create','body','options','CreateSmsMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s'];(function(_0x47bce4,_0x2140fd){var _0x5b4baf=function(_0x21c568){while(--_0x21c568){_0x47bce4['push'](_0x47bce4['shift']());}};_0x5b4baf(++_0x2140fd);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4fe77d,_0xaad1f1){_0x4fe77d=_0x4fe77d-0x0;var _0x296a48=_0x0b0e[_0x4fe77d];return _0x296a48;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateSmsMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateSmsMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js
index a434404..d823f55 100644
--- a/server/api/smsMessage/smsMessage.socket.js
+++ b/server/api/smsMessage/smsMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe6ca=['update','register','smsMessage:','./smsMessage.events','save','remove'];(function(_0x43daa5,_0xc401f6){var _0x4e3463=function(_0x893019){while(--_0x893019){_0x43daa5['push'](_0x43daa5['shift']());}};_0x4e3463(++_0xc401f6);}(_0xe6ca,0x129));var _0xae6c=function(_0x48e5ba,_0x85a926){_0x48e5ba=_0x48e5ba-0x0;var _0x1e2771=_0xe6ca[_0x48e5ba];return _0x1e2771;};'use strict';var SmsMessageEvents=require(_0xae6c('0x0'));var events=[_0xae6c('0x1'),_0xae6c('0x2'),_0xae6c('0x3')];function createListener(_0x2c28e3,_0x1d3e5f){return function(_0x3dc3b8){_0x1d3e5f['emit'](_0x2c28e3,_0x3dc3b8);};}function removeListener(_0x3722fb,_0x3cb53){return function(){SmsMessageEvents['removeListener'](_0x3722fb,_0x3cb53);};}exports[_0xae6c('0x4')]=function(_0x39e7c9){for(var _0x321b70=0x0,_0x416208=events['length'];_0x321b70<_0x416208;_0x321b70++){var _0x333f65=events[_0x321b70];var _0x87fee3=createListener(_0xae6c('0x5')+_0x333f65,_0x39e7c9);SmsMessageEvents['on'](_0x333f65,_0x87fee3);}};
\ No newline at end of file
+var _0xa82e=['save','remove','update','emit','removeListener','register','length','./smsMessage.events'];(function(_0x323d82,_0x316942){var _0x2cc0ce=function(_0x21c3ba){while(--_0x21c3ba){_0x323d82['push'](_0x323d82['shift']());}};_0x2cc0ce(++_0x316942);}(_0xa82e,0x1d7));var _0xea82=function(_0x49a17f,_0x56c547){_0x49a17f=_0x49a17f-0x0;var _0x19beb8=_0xa82e[_0x49a17f];return _0x19beb8;};'use strict';var SmsMessageEvents=require(_0xea82('0x0'));var events=[_0xea82('0x1'),_0xea82('0x2'),_0xea82('0x3')];function createListener(_0x568657,_0x4d97ee){return function(_0x3a73cd){_0x4d97ee[_0xea82('0x4')](_0x568657,_0x3a73cd);};}function removeListener(_0x17511c,_0x355ee7){return function(){SmsMessageEvents[_0xea82('0x5')](_0x17511c,_0x355ee7);};}exports[_0xea82('0x6')]=function(_0x4851f2){for(var _0x2284d4=0x0,_0x536be3=events[_0xea82('0x7')];_0x2284d4<_0x536be3;_0x2284d4++){var _0x487980=events[_0x2284d4];var _0x406f94=createListener('smsMessage:'+_0x487980,_0x4851f2);SmsMessageEvents['on'](_0x487980,_0x406f94);}};
\ No newline at end of file
diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js
index bcdebfa..b3fce20 100644
--- a/server/api/smsQueue/index.js
+++ b/server/api/smsQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a6b=['put','update','delete','destroy','removeTeams','removeAgents','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create'];(function(_0x2076ef,_0xe0f939){var _0x280dfe=function(_0x3cd256){while(--_0x3cd256){_0x2076ef['push'](_0x2076ef['shift']());}};_0x280dfe(++_0xe0f939);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x2226c1,_0x2bed75){_0x2226c1=_0x2226c1-0x0;var _0x178716=_0x0a6b[_0x2226c1];return _0x178716;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var auth=require(_0xb0a6('0x2'));var interaction=require(_0xb0a6('0x3'));var config=require(_0xb0a6('0x4'));var controller=require('./smsQueue.controller');router[_0xb0a6('0x5')]('/',auth['isAuthenticated'](),controller[_0xb0a6('0x6')]);router[_0xb0a6('0x5')]('/describe',auth[_0xb0a6('0x7')](),controller[_0xb0a6('0x8')]);router[_0xb0a6('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb0a6('0x5')](_0xb0a6('0x9'),auth[_0xb0a6('0x7')](),controller[_0xb0a6('0xa')]);router['get'](_0xb0a6('0xb'),auth[_0xb0a6('0x7')](),controller['getTeams']);router[_0xb0a6('0x5')](_0xb0a6('0xc'),auth[_0xb0a6('0x7')](),controller[_0xb0a6('0xd')]);router[_0xb0a6('0xe')]('/',auth[_0xb0a6('0x7')](),controller[_0xb0a6('0xf')]);router[_0xb0a6('0xe')](_0xb0a6('0xb'),auth[_0xb0a6('0x7')](),controller['addTeams']);router[_0xb0a6('0xe')]('/:id/users',auth[_0xb0a6('0x7')](),controller['addAgents']);router[_0xb0a6('0x10')]('/:id',auth[_0xb0a6('0x7')](),controller[_0xb0a6('0x11')]);router[_0xb0a6('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb0a6('0x13')]);router[_0xb0a6('0x12')](_0xb0a6('0xb'),auth[_0xb0a6('0x7')](),controller[_0xb0a6('0x14')]);router[_0xb0a6('0x12')]('/:id/users',auth[_0xb0a6('0x7')](),controller[_0xb0a6('0x15')]);module[_0xb0a6('0x16')]=router;
\ No newline at end of file
+var _0xdedd=['removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','show','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','put','/:id','delete','destroy','removeTeams'];(function(_0x1e46fa,_0x1c51ba){var _0x44b698=function(_0x1009ad){while(--_0x1009ad){_0x1e46fa['push'](_0x1e46fa['shift']());}};_0x44b698(++_0x1c51ba);}(_0xdedd,0x197));var _0xdded=function(_0x274043,_0x3c1e8c){_0x274043=_0x274043-0x0;var _0x2605af=_0xdedd[_0x274043];return _0x2605af;};'use strict';var multer=require(_0xdded('0x0'));var util=require(_0xdded('0x1'));var path=require(_0xdded('0x2'));var timeout=require(_0xdded('0x3'));var express=require(_0xdded('0x4'));var router=express['Router']();var auth=require(_0xdded('0x5'));var interaction=require(_0xdded('0x6'));var config=require(_0xdded('0x7'));var controller=require(_0xdded('0x8'));router[_0xdded('0x9')]('/',auth[_0xdded('0xa')](),controller[_0xdded('0xb')]);router[_0xdded('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xdded('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdded('0xc')]);router[_0xdded('0x9')](_0xdded('0xd'),auth[_0xdded('0xa')](),controller['getMembers']);router[_0xdded('0x9')]('/:id/teams',auth[_0xdded('0xa')](),controller[_0xdded('0xe')]);router[_0xdded('0x9')](_0xdded('0xf'),auth[_0xdded('0xa')](),controller[_0xdded('0x10')]);router[_0xdded('0x11')]('/',auth[_0xdded('0xa')](),controller[_0xdded('0x12')]);router['post'](_0xdded('0x13'),auth[_0xdded('0xa')](),controller['addTeams']);router[_0xdded('0x11')]('/:id/users',auth[_0xdded('0xa')](),controller['addAgents']);router[_0xdded('0x14')](_0xdded('0x15'),auth[_0xdded('0xa')](),controller['update']);router[_0xdded('0x16')](_0xdded('0x15'),auth[_0xdded('0xa')](),controller[_0xdded('0x17')]);router[_0xdded('0x16')](_0xdded('0x13'),auth[_0xdded('0xa')](),controller[_0xdded('0x18')]);router['delete'](_0xdded('0xf'),auth[_0xdded('0xa')](),controller[_0xdded('0x19')]);module[_0xdded('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js
index f887dd0..b177325 100644
--- a/server/api/smsQueue/smsQueue.attributes.js
+++ b/server/api/smsQueue/smsQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x733c=['STRING','name','ENUM','beepall','roundrobin','sequelize'];(function(_0x4b9806,_0x1517c0){var _0x12f4d4=function(_0x2f0984){while(--_0x2f0984){_0x4b9806['push'](_0x4b9806['shift']());}};_0x12f4d4(++_0x1517c0);}(_0x733c,0xdd));var _0xc733=function(_0x53d4ae,_0x2df89d){_0x53d4ae=_0x53d4ae-0x0;var _0x1a2741=_0x733c[_0x53d4ae];return _0x1a2741;};'use strict';var Sequelize=require(_0xc733('0x0'));module['exports']={'name':{'type':Sequelize[_0xc733('0x1')],'unique':_0xc733('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc733('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc733('0x3')]('rrmemory',_0xc733('0x4'),_0xc733('0x5'))}};
\ No newline at end of file
+var _0x33f3=['INTEGER','ENUM','beepall','STRING','name'];(function(_0x29df66,_0x4f67d0){var _0x4e92f4=function(_0x3cab59){while(--_0x3cab59){_0x29df66['push'](_0x29df66['shift']());}};_0x4e92f4(++_0x4f67d0);}(_0x33f3,0x189));var _0x333f=function(_0x1d6845,_0xdf6e20){_0x1d6845=_0x1d6845-0x0;var _0x5d7d5f=_0x33f3[_0x1d6845];return _0x5d7d5f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x333f('0x0')],'unique':_0x333f('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x333f('0x0')]},'timeout':{'type':Sequelize[_0x333f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x333f('0x3')]('rrmemory',_0x333f('0x4'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js
index adc0d1f..10b8b0c 100644
--- a/server/api/smsQueue/smsQueue.controller.js
+++ b/server/api/smsQueue/smsQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf5ab=['../../mysqldb','defaults','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','SmsQueues','UserProfileResource','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','includeAll','include','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','error','body','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','value','transaction','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2948bb,_0x3756a7){var _0x9bd815=function(_0x1ab480){while(--_0x1ab480){_0x2948bb['push'](_0x2948bb['shift']());}};_0x9bd815(++_0x3756a7);}(_0xf5ab,0x100));var _0xbf5a=function(_0xa4471d,_0x30dc1c){_0xa4471d=_0xa4471d-0x0;var _0x50f1e1=_0xf5ab[_0xa4471d];return _0x50f1e1;};'use strict';var pdf=require(_0xbf5a('0x0'));var emlformat=require(_0xbf5a('0x1'));var rimraf=require(_0xbf5a('0x2'));var zipdir=require(_0xbf5a('0x3'));var jsonpatch=require(_0xbf5a('0x4'));var rp=require(_0xbf5a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf5a('0x6'));var util=require(_0xbf5a('0x7'));var path=require('path');var sox=require(_0xbf5a('0x8'));var csv=require(_0xbf5a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbf5a('0xa'));var squel=require(_0xbf5a('0xb'));var crypto=require(_0xbf5a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf5a('0xd'));var toCsv=require(_0xbf5a('0x9'));var querystring=require(_0xbf5a('0xe'));var Papa=require(_0xbf5a('0xf'));var Redis=require(_0xbf5a('0x10'));var authService=require(_0xbf5a('0x11'));var qs=require(_0xbf5a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf5a('0x13'))('api');var utils=require(_0xbf5a('0x14'));var config=require(_0xbf5a('0x15'));var db=require(_0xbf5a('0x16'))['db'];config['redis']=_[_0xbf5a('0x17')](config[_0xbf5a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf5a('0x19'))(new Redis(config['redis']));require(_0xbf5a('0x1a'))[_0xbf5a('0x1b')](socket);function respondWithStatusCode(_0x12a8be,_0x3c566f){_0x3c566f=_0x3c566f||0xcc;return function(_0x2558cf){if(_0x2558cf){return _0x12a8be[_0xbf5a('0x1c')](_0x3c566f);}return _0x12a8be[_0xbf5a('0x1d')](_0x3c566f)[_0xbf5a('0x1e')]();};}function respondWithResult(_0x394447,_0x13b101){_0x13b101=_0x13b101||0xc8;return function(_0x4c6ff4){if(_0x4c6ff4){return _0x394447['status'](_0x13b101)[_0xbf5a('0x1f')](_0x4c6ff4);}};}function respondWithFilteredResult(_0x8756f2,_0x2f1644){return function(_0x501a69){if(_0x501a69){var _0x52f69c=_0x501a69[_0xbf5a('0x20')],_0x46d41a=_0x2f1644['offset'],_0x5f56b4=_0x2f1644[_0xbf5a('0x21')]+_0x2f1644[_0xbf5a('0x22')],_0x4a5668;if(_0x5f56b4>=_0x52f69c){_0x5f56b4=_0x52f69c;_0x4a5668=0xc8;}else{_0x4a5668=0xce;}_0x8756f2[_0xbf5a('0x1d')](_0x4a5668);return _0x8756f2[_0xbf5a('0x23')](_0xbf5a('0x24'),_0x46d41a+'-'+_0x5f56b4+'/'+_0x52f69c)[_0xbf5a('0x1f')](_0x501a69);}return null;};}function patchUpdates(_0x11f191){return function(_0xd2efb2){try{jsonpatch[_0xbf5a('0x25')](_0xd2efb2,_0x11f191,!![]);}catch(_0x1da121){return BPromise[_0xbf5a('0x26')](_0x1da121);}return _0xd2efb2['save']();};}function saveUpdates(_0x409c27,_0x23f17c){return function(_0x3ab582){if(_0x3ab582){return _0x3ab582[_0xbf5a('0x27')](_0x409c27)[_0xbf5a('0x28')](function(_0x3c3fe4){return _0x3c3fe4;});}return null;};}function removeEntity(_0x23e7d4,_0x26e04d){return function(_0x26140d){if(_0x26140d){return _0x26140d[_0xbf5a('0x29')]()[_0xbf5a('0x28')](function(){var _0x39dda4=_0x26140d['get']({'plain':!![]});var _0x24286e=_0xbf5a('0x2a');return db[_0xbf5a('0x2b')][_0xbf5a('0x29')]({'where':{'type':_0x24286e,'resourceId':_0x39dda4['id']}})[_0xbf5a('0x28')](function(){return _0x26140d;});})[_0xbf5a('0x28')](function(){_0x23e7d4[_0xbf5a('0x1d')](0xcc)[_0xbf5a('0x1e')]();});}};}function handleEntityNotFound(_0xfbd2e2,_0x1d6a73){return function(_0x2ee837){if(!_0x2ee837){_0xfbd2e2['sendStatus'](0x194);}return _0x2ee837;};}function handleError(_0x6b9eb5,_0x45ef60){_0x45ef60=_0x45ef60||0x1f4;return function(_0x1711b2){logger['error'](_0x1711b2[_0xbf5a('0x2c')]);if(_0x1711b2[_0xbf5a('0x2d')]){delete _0x1711b2[_0xbf5a('0x2d')];}_0x6b9eb5[_0xbf5a('0x1d')](_0x45ef60)[_0xbf5a('0x2e')](_0x1711b2);};}exports[_0xbf5a('0x2f')]=function(_0x59e18a,_0x1cf167){var _0x1e1edb={},_0x4631f7={},_0x15deea={'count':0x0,'rows':[]};var _0x1ff49e=_[_0xbf5a('0x30')](db[_0xbf5a('0x31')][_0xbf5a('0x32')],function(_0x182e62){return{'name':_0x182e62[_0xbf5a('0x33')],'type':_0x182e62[_0xbf5a('0x34')][_0xbf5a('0x35')]};});_0x4631f7[_0xbf5a('0x36')]=_['map'](_0x1ff49e,_0xbf5a('0x2d'));_0x4631f7[_0xbf5a('0x37')]=_[_0xbf5a('0x38')](_0x59e18a[_0xbf5a('0x37')]);_0x4631f7[_0xbf5a('0x39')]=_[_0xbf5a('0x3a')](_0x4631f7[_0xbf5a('0x36')],_0x4631f7[_0xbf5a('0x37')]);_0x1e1edb[_0xbf5a('0x3b')]=_[_0xbf5a('0x3a')](_0x4631f7[_0xbf5a('0x36')],qs['fields'](_0x59e18a[_0xbf5a('0x37')][_0xbf5a('0x3c')]));_0x1e1edb[_0xbf5a('0x3b')]=_0x1e1edb[_0xbf5a('0x3b')][_0xbf5a('0x3d')]?_0x1e1edb[_0xbf5a('0x3b')]:_0x4631f7[_0xbf5a('0x36')];if(!_0x59e18a[_0xbf5a('0x37')][_0xbf5a('0x3e')]('nolimit')){_0x1e1edb[_0xbf5a('0x22')]=qs[_0xbf5a('0x22')](_0x59e18a['query'][_0xbf5a('0x22')]);_0x1e1edb[_0xbf5a('0x21')]=qs[_0xbf5a('0x21')](_0x59e18a[_0xbf5a('0x37')][_0xbf5a('0x21')]);}_0x1e1edb[_0xbf5a('0x3f')]=qs[_0xbf5a('0x40')](_0x59e18a[_0xbf5a('0x37')][_0xbf5a('0x40')]);_0x1e1edb[_0xbf5a('0x41')]=qs[_0xbf5a('0x39')](_['pick'](_0x59e18a[_0xbf5a('0x37')],_0x4631f7[_0xbf5a('0x39')]),_0x1ff49e);if(_0x59e18a[_0xbf5a('0x37')]['filter']){_0x1e1edb['where']=_[_0xbf5a('0x42')](_0x1e1edb[_0xbf5a('0x41')],{'$or':_[_0xbf5a('0x30')](_0x1ff49e,function(_0x2052ca){if(_0x2052ca[_0xbf5a('0x34')]!=='VIRTUAL'){var _0x3d18c1={};_0x3d18c1[_0x2052ca['name']]={'$like':'%'+_0x59e18a[_0xbf5a('0x37')][_0xbf5a('0x43')]+'%'};return _0x3d18c1;}})});}_0x1e1edb=_[_0xbf5a('0x42')]({},_0x1e1edb,_0x59e18a[_0xbf5a('0x44')]);var _0x1dfb23={'where':_0x1e1edb[_0xbf5a('0x41')]};return db[_0xbf5a('0x31')][_0xbf5a('0x20')](_0x1dfb23)[_0xbf5a('0x28')](function(_0x47621e){_0x15deea[_0xbf5a('0x20')]=_0x47621e;if(_0x59e18a['query'][_0xbf5a('0x45')]){_0x1e1edb[_0xbf5a('0x46')]=[{'all':!![]}];}return db[_0xbf5a('0x31')]['findAll'](_0x1e1edb);})[_0xbf5a('0x28')](function(_0x336e89){_0x15deea[_0xbf5a('0x47')]=_0x336e89;return _0x15deea;})[_0xbf5a('0x28')](respondWithFilteredResult(_0x1cf167,_0x1e1edb))[_0xbf5a('0x48')](handleError(_0x1cf167,null));};exports['show']=function(_0x45699f,_0x92c13d){var _0x4a4c9a={'raw':!![],'where':{'id':_0x45699f[_0xbf5a('0x49')]['id']}},_0x1c0a55={};_0x1c0a55[_0xbf5a('0x36')]=_[_0xbf5a('0x38')](db[_0xbf5a('0x31')][_0xbf5a('0x32')]);_0x1c0a55[_0xbf5a('0x37')]=_['keys'](_0x45699f[_0xbf5a('0x37')]);_0x1c0a55[_0xbf5a('0x39')]=_[_0xbf5a('0x3a')](_0x1c0a55['model'],_0x1c0a55[_0xbf5a('0x37')]);_0x4a4c9a['attributes']=_[_0xbf5a('0x3a')](_0x1c0a55['model'],qs[_0xbf5a('0x3c')](_0x45699f[_0xbf5a('0x37')][_0xbf5a('0x3c')]));_0x4a4c9a[_0xbf5a('0x3b')]=_0x4a4c9a['attributes'][_0xbf5a('0x3d')]?_0x4a4c9a['attributes']:_0x1c0a55[_0xbf5a('0x36')];if(_0x45699f['query'][_0xbf5a('0x45')]){_0x4a4c9a[_0xbf5a('0x46')]=[{'all':!![]}];}_0x4a4c9a=_['merge']({},_0x4a4c9a,_0x45699f[_0xbf5a('0x44')]);return db[_0xbf5a('0x31')][_0xbf5a('0x4a')](_0x4a4c9a)[_0xbf5a('0x28')](handleEntityNotFound(_0x92c13d,null))['then'](respondWithResult(_0x92c13d,null))[_0xbf5a('0x48')](handleError(_0x92c13d,null));};exports[_0xbf5a('0x4b')]=function(_0x1cfd2e,_0x1bb094){return db[_0xbf5a('0x31')]['create'](_0x1cfd2e['body'],{})[_0xbf5a('0x28')](function(_0x3ce00c){var _0x326a8a=_0x1cfd2e['user']['get']({'plain':!![]});if(!_0x326a8a)throw new Error(_0xbf5a('0x4c'));if(_0x326a8a[_0xbf5a('0x4d')]===_0xbf5a('0x4e')){var _0xb54221=_0x3ce00c[_0xbf5a('0x4f')]({'plain':!![]});var _0x159a74=_0xbf5a('0x2a');return db['UserProfileSection'][_0xbf5a('0x4a')]({'where':{'name':_0x159a74,'userProfileId':_0x326a8a['userProfileId']},'raw':!![]})[_0xbf5a('0x28')](function(_0x43e905){if(_0x43e905&&_0x43e905['autoAssociation']===0x0){return db[_0xbf5a('0x2b')][_0xbf5a('0x4b')]({'name':_0xb54221[_0xbf5a('0x2d')],'resourceId':_0xb54221['id'],'type':_0x43e905[_0xbf5a('0x2d')],'sectionId':_0x43e905['id']},{})[_0xbf5a('0x28')](function(){return _0x3ce00c;});}else{return _0x3ce00c;}})[_0xbf5a('0x48')](function(_0x3355e1){logger[_0xbf5a('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3355e1);throw _0x3355e1;});}return _0x3ce00c;})['then'](respondWithResult(_0x1bb094,0xc9))['catch'](handleError(_0x1bb094,null));};exports[_0xbf5a('0x27')]=function(_0x4773ce,_0x562704){if(_0x4773ce['body']['id']){delete _0x4773ce[_0xbf5a('0x51')]['id'];}return db['SmsQueue'][_0xbf5a('0x4a')]({'where':{'id':_0x4773ce[_0xbf5a('0x49')]['id']}})[_0xbf5a('0x28')](handleEntityNotFound(_0x562704,null))[_0xbf5a('0x28')](saveUpdates(_0x4773ce[_0xbf5a('0x51')],null))[_0xbf5a('0x28')](respondWithResult(_0x562704,null))[_0xbf5a('0x48')](handleError(_0x562704,null));};exports[_0xbf5a('0x29')]=function(_0x3c3986,_0x1f66b1){return db[_0xbf5a('0x31')][_0xbf5a('0x4a')]({'where':{'id':_0x3c3986[_0xbf5a('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f66b1,null))[_0xbf5a('0x28')](removeEntity(_0x1f66b1,null))[_0xbf5a('0x48')](handleError(_0x1f66b1,null));};exports[_0xbf5a('0x52')]=function(_0x68e209,_0x609307){return db['SmsQueue']['describe']()[_0xbf5a('0x28')](respondWithResult(_0x609307,null))[_0xbf5a('0x48')](handleError(_0x609307,null));};exports[_0xbf5a('0x53')]=function(_0xcc56a7,_0x47cf9c,_0x409281){var _0x78cebf={'raw':!![],'where':{}},_0x452fcd={},_0x2c3958;return db['SmsQueue'][_0xbf5a('0x54')]({'where':{'id':_0xcc56a7['params']['id']}})[_0xbf5a('0x28')](handleEntityNotFound(_0x47cf9c,null))['then'](function(_0x94699f){if(_0x94699f){_0x2c3958=_0x94699f['get']({'plain':!![]});_0x452fcd[_0xbf5a('0x36')]=_[_0xbf5a('0x38')](db[_0xbf5a('0x55')][_0xbf5a('0x32')]);_0x452fcd[_0xbf5a('0x37')]=_[_0xbf5a('0x38')](_0xcc56a7[_0xbf5a('0x37')]);_0x452fcd[_0xbf5a('0x39')]=_[_0xbf5a('0x3a')](_0x452fcd[_0xbf5a('0x36')],_0x452fcd[_0xbf5a('0x37')]);_0x78cebf[_0xbf5a('0x3b')]=_[_0xbf5a('0x3a')](_0x452fcd['model'],qs[_0xbf5a('0x3c')](_0xcc56a7['query'][_0xbf5a('0x3c')]));_0x78cebf[_0xbf5a('0x3b')]=_0x78cebf['attributes'][_0xbf5a('0x3d')]?_0x78cebf[_0xbf5a('0x3b')]:_0x452fcd['model'];if(!_0xcc56a7[_0xbf5a('0x37')][_0xbf5a('0x3e')]('nolimit')){_0x78cebf[_0xbf5a('0x22')]=qs[_0xbf5a('0x22')](_0xcc56a7[_0xbf5a('0x37')]['limit']);_0x78cebf[_0xbf5a('0x21')]=qs[_0xbf5a('0x21')](_0xcc56a7[_0xbf5a('0x37')][_0xbf5a('0x21')]);}_0x78cebf['order']=qs[_0xbf5a('0x40')](_0xcc56a7[_0xbf5a('0x37')][_0xbf5a('0x40')]);_0x78cebf[_0xbf5a('0x41')]=qs[_0xbf5a('0x39')](_[_0xbf5a('0x56')](_0xcc56a7['query'],_0x452fcd[_0xbf5a('0x39')]));_0x78cebf[_0xbf5a('0x41')][_0xbf5a('0x57')]=_0x94699f['id'];if(_0xcc56a7[_0xbf5a('0x37')][_0xbf5a('0x43')]){_0x78cebf[_0xbf5a('0x41')]=_[_0xbf5a('0x42')](_0x78cebf[_0xbf5a('0x41')],{'$or':_['map'](_0x78cebf[_0xbf5a('0x3b')],function(_0x316e05){var _0x4a0f45={};_0x4a0f45[_0x316e05]={'$like':'%'+_0xcc56a7['query'][_0xbf5a('0x43')]+'%'};return _0x4a0f45;})});}_0x78cebf=_[_0xbf5a('0x42')]({},_0x78cebf,_0xcc56a7[_0xbf5a('0x44')]);return db[_0xbf5a('0x55')][_0xbf5a('0x58')](_0x78cebf);}})[_0xbf5a('0x28')](function(_0x210a0c){if(_0x210a0c){return db[_0xbf5a('0x59')][_0xbf5a('0x5a')]({'where':{'id':_[_0xbf5a('0x30')](_0x210a0c,_0xbf5a('0x5b')),'role':_0xbf5a('0x5c')},'attributes':['id',_0xbf5a('0x2d'),'smsPause',_0xbf5a('0x5d'),_0xbf5a('0x5e')]});}})[_0xbf5a('0x28')](function(_0x31c2fd){if(_0x31c2fd){return{'count':_0x31c2fd[_0xbf5a('0x20')],'rows':_[_0xbf5a('0x30')](_0x31c2fd['rows'],function(_0x14ffb1){return{'membername':_0x14ffb1[_0xbf5a('0x2d')],'UserId':_0x14ffb1['id'],'queue_name':_0x2c3958[_0xbf5a('0x2d')],'SmsQueueId':_0x2c3958['id'],'interface':util[_0xbf5a('0x5f')](_0xbf5a('0x60'),_0xbf5a('0x61'),_0x14ffb1[_0xbf5a('0x2d')]),'penalty':0x0,'paused':_0x14ffb1['smsPause'],'createdAt':_0x14ffb1[_0xbf5a('0x5e')],'updatedAt':_0x14ffb1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbf5a('0x28')](respondWithFilteredResult(_0x47cf9c,_0x78cebf))[_0xbf5a('0x48')](handleError(_0x47cf9c,null));};exports[_0xbf5a('0x62')]=function(_0x44381b,_0x204bf6,_0x900273){var _0x4cce9c={};var _0x7b1c4e={};var _0x8fc83b;var _0x206f04;return db[_0xbf5a('0x31')][_0xbf5a('0x54')]({'where':{'id':_0x44381b[_0xbf5a('0x49')]['id']}})['then'](handleEntityNotFound(_0x204bf6,null))['then'](function(_0x551f47){if(_0x551f47){_0x8fc83b=_0x551f47;_0x7b1c4e[_0xbf5a('0x36')]=_[_0xbf5a('0x38')](db[_0xbf5a('0x63')][_0xbf5a('0x32')]);_0x7b1c4e['query']=_[_0xbf5a('0x38')](_0x44381b[_0xbf5a('0x37')]);_0x7b1c4e[_0xbf5a('0x39')]=_[_0xbf5a('0x3a')](_0x7b1c4e[_0xbf5a('0x36')],_0x7b1c4e[_0xbf5a('0x37')]);_0x4cce9c['attributes']=_[_0xbf5a('0x3a')](_0x7b1c4e[_0xbf5a('0x36')],qs['fields'](_0x44381b[_0xbf5a('0x37')]['fields']));_0x4cce9c[_0xbf5a('0x3b')]=_0x4cce9c[_0xbf5a('0x3b')][_0xbf5a('0x3d')]?_0x4cce9c['attributes']:_0x7b1c4e[_0xbf5a('0x36')];_0x4cce9c['order']=qs[_0xbf5a('0x40')](_0x44381b[_0xbf5a('0x37')][_0xbf5a('0x40')]);_0x4cce9c[_0xbf5a('0x41')]=qs[_0xbf5a('0x39')](_['pick'](_0x44381b[_0xbf5a('0x37')],_0x7b1c4e[_0xbf5a('0x39')]));if(_0x44381b['query'][_0xbf5a('0x43')]){_0x4cce9c[_0xbf5a('0x41')]=_[_0xbf5a('0x42')](_0x4cce9c[_0xbf5a('0x41')],{'$or':_[_0xbf5a('0x30')](_0x4cce9c[_0xbf5a('0x3b')],function(_0x25fff1){var _0x13f54c={};_0x13f54c[_0x25fff1]={'$like':'%'+_0x44381b['query'][_0xbf5a('0x43')]+'%'};return _0x13f54c;})});}_0x4cce9c=_['merge']({},_0x4cce9c,_0x44381b[_0xbf5a('0x44')]);return _0x8fc83b[_0xbf5a('0x62')](_0x4cce9c);}})[_0xbf5a('0x28')](function(_0x3d4b98){if(_0x3d4b98){_0x206f04=_0x3d4b98['length'];if(!_0x44381b[_0xbf5a('0x37')]['hasOwnProperty']('nolimit')){_0x4cce9c['limit']=qs[_0xbf5a('0x22')](_0x44381b[_0xbf5a('0x37')][_0xbf5a('0x22')]);_0x4cce9c[_0xbf5a('0x21')]=qs[_0xbf5a('0x21')](_0x44381b[_0xbf5a('0x37')][_0xbf5a('0x21')]);}return _0x8fc83b[_0xbf5a('0x62')](_0x4cce9c);}})['then'](function(_0x1bee56){if(_0x1bee56){return _0x1bee56?{'count':_0x206f04,'rows':_0x1bee56}:null;}})[_0xbf5a('0x28')](respondWithResult(_0x204bf6,null))[_0xbf5a('0x48')](handleError(_0x204bf6,null));};exports[_0xbf5a('0x64')]=function(_0x3d23ab,_0x22b241,_0x1025a1){var _0x16b4a1=_0x3d23ab[_0xbf5a('0x51')][_0xbf5a('0x65')];return db[_0xbf5a('0x63')][_0xbf5a('0x58')]({'where':{'id':_0x16b4a1},'attributes':['id'],'include':[{'model':db[_0xbf5a('0x59')],'as':_0xbf5a('0x66'),'attributes':['id','name',_0xbf5a('0x67'),_0xbf5a('0x68'),_0xbf5a('0x69')],'raw':!![]}]})[_0xbf5a('0x28')](function(_0x5bb5c9){if(_0x5bb5c9){var _0x290ef2=_[_0xbf5a('0x6a')](_0x5bb5c9,function(_0x3cf5f9){var _0x28e99f=_0x3cf5f9[_0xbf5a('0x4f')]({'plain':!![]});return _0x28e99f['Agents'];});return db[_0xbf5a('0x31')][_0xbf5a('0x4a')]({'where':{'id':_0x3d23ab[_0xbf5a('0x49')]['id']}})[_0xbf5a('0x28')](function(_0x2f9983){return db[_0xbf5a('0x6b')]['transaction'](function(_0x19f6b1){return _0x2f9983['addTeams'](_0x16b4a1,{'transaction':_0x19f6b1})[_0xbf5a('0x28')](function(){return BPromise[_0xbf5a('0x6c')](_0x290ef2,function(_0x28e912){return db['UserSmsQueue'][_0xbf5a('0x6d')]({'where':{'UserId':_0x28e912['id'],'SmsQueueId':_0x3d23ab['params']['id']},'transaction':_0x19f6b1});});})[_0xbf5a('0x28')](function(){_0x290ef2[_0xbf5a('0x6e')](function(_0xc5db87){socket[_0xbf5a('0x6f')](_0xbf5a('0x70'),{'UserId':_0xc5db87['id'],'SmsQueueId':_0x2f9983['id']});});});});});}})[_0xbf5a('0x28')](respondWithStatusCode(_0x22b241,null))[_0xbf5a('0x48')](handleError(_0x22b241,null));};exports['removeTeams']=function(_0x150046,_0x398213,_0x38dab){return db[_0xbf5a('0x63')][_0xbf5a('0x58')]({'where':{'id':_0x150046['query'][_0xbf5a('0x65')]},'attributes':['id'],'include':[{'model':db[_0xbf5a('0x59')],'as':_0xbf5a('0x66'),'attributes':['id'],'raw':!![]}]})[_0xbf5a('0x28')](handleEntityNotFound(_0x398213,null))[_0xbf5a('0x28')](function(_0x2b5550){var _0x5496ea=_[_0xbf5a('0x30')](_0x2b5550,'id');var _0x29a39a=[];var _0x5ccf8d=[];var _0x4834b2=squel[_0xbf5a('0x71')]();_0x4834b2[_0xbf5a('0x72')](_0xbf5a('0x73'))[_0xbf5a('0x74')](_0xbf5a('0x75'),'tq')['join'](_0xbf5a('0x76'),'ut',_0xbf5a('0x77'))[_0xbf5a('0x41')](_0xbf5a('0x78'),_0x150046[_0xbf5a('0x49')]['id']);for(var _0x5a2b94=0x0;_0x5a2b94<_0x2b5550['length'];_0x5a2b94+=0x1){let _0x395926=_0x2b5550[_0x5a2b94];for(var _0x5019a1=0x0;_0x5019a1<_0x395926[_0xbf5a('0x66')]['length'];_0x5019a1+=0x1){let _0x723d22=_0x395926['Agents'][_0x5019a1];var _0x26c741=_0x4834b2['clone']();_0x26c741[_0xbf5a('0x41')](_0xbf5a('0x79'),_0x723d22['id']);_0x5ccf8d[_0xbf5a('0x7a')](db[_0xbf5a('0x6b')][_0xbf5a('0x37')](_0x26c741[_0xbf5a('0x7b')](),{'type':db[_0xbf5a('0x6b')][_0xbf5a('0x7c')]['SELECT']})[_0xbf5a('0x28')](function(_0x4e0987){if(_0x4e0987[_0xbf5a('0x3d')]===0x1){return _0x723d22['id'];}else{var _0x1e6376=_[_0xbf5a('0x7d')](_[_0xbf5a('0x30')](_0x4e0987,_0xbf5a('0x7e')),function(_0x4b23a5){return _[_0xbf5a('0x7f')](_0x5496ea,_0x4b23a5);});if(_0x1e6376){return _0x723d22['id'];}}}));}}return BPromise['all'](_0x5ccf8d)['then'](function(_0x439811){_0x29a39a=_(_0x29a39a)['union'](_0x439811)['compact']()[_0xbf5a('0x80')]();return db[_0xbf5a('0x31')]['find']({'where':{'id':_0x150046[_0xbf5a('0x49')]['id']}})[_0xbf5a('0x28')](function(_0x39da44){return db[_0xbf5a('0x6b')][_0xbf5a('0x81')](function(_0x308337){return _0x39da44[_0xbf5a('0x82')](_0x150046[_0xbf5a('0x37')][_0xbf5a('0x65')],{'transaction':_0x308337})[_0xbf5a('0x28')](function(){if(!_[_0xbf5a('0x83')](_0x29a39a)){return _0x39da44[_0xbf5a('0x84')](_0x29a39a,{'transaction':_0x308337});}})[_0xbf5a('0x28')](function(){_0x29a39a[_0xbf5a('0x6e')](function(_0x4613fc){socket[_0xbf5a('0x6f')](_0xbf5a('0x85'),{'UserId':_0x4613fc,'SmsQueueId':_0x39da44['id']});});});});});});})[_0xbf5a('0x28')](respondWithStatusCode(_0x398213,null))[_0xbf5a('0x48')](handleError(_0x398213,null));};exports[_0xbf5a('0x86')]=function(_0x11d1f6,_0x2cfbfe,_0x50d50d){return db[_0xbf5a('0x31')][_0xbf5a('0x4a')]({'where':{'id':_0x11d1f6[_0xbf5a('0x49')]['id']}})[_0xbf5a('0x28')](handleEntityNotFound(_0x2cfbfe,null))[_0xbf5a('0x28')](function(_0x59caab){if(_0x59caab){return _0x59caab[_0xbf5a('0x86')](_0x11d1f6['body'][_0xbf5a('0x65')],_[_0xbf5a('0x87')](_0x11d1f6[_0xbf5a('0x51')],[_0xbf5a('0x65'),'id'])||{})[_0xbf5a('0x88')](function(_0x2f73e3){for(var _0x259afb=0x0;_0x259afb<_0x11d1f6[_0xbf5a('0x51')][_0xbf5a('0x65')][_0xbf5a('0x3d')];_0x259afb+=0x1){socket[_0xbf5a('0x6f')](_0xbf5a('0x70'),{'UserId':_0x11d1f6['body'][_0xbf5a('0x65')][_0x259afb],'SmsQueueId':_0x11d1f6[_0xbf5a('0x49')]['id']});}return _0x2f73e3;});}})[_0xbf5a('0x28')](respondWithResult(_0x2cfbfe,null))[_0xbf5a('0x48')](handleError(_0x2cfbfe,null));};exports[_0xbf5a('0x84')]=function(_0x2c2a8b,_0x45b478,_0x7bb32e){return db[_0xbf5a('0x31')][_0xbf5a('0x4a')]({'where':{'id':_0x2c2a8b['params']['id']}})[_0xbf5a('0x28')](handleEntityNotFound(_0x45b478,null))[_0xbf5a('0x28')](function(_0xc1d707){if(_0xc1d707){return _0xc1d707[_0xbf5a('0x84')](_0x2c2a8b[_0xbf5a('0x37')][_0xbf5a('0x65')])['then'](function(){if(_[_0xbf5a('0x89')](_0x2c2a8b[_0xbf5a('0x37')]['ids'])){for(var _0x108546=0x0;_0x108546<_0x2c2a8b['query'][_0xbf5a('0x65')][_0xbf5a('0x3d')];_0x108546+=0x1){socket[_0xbf5a('0x6f')](_0xbf5a('0x85'),{'UserId':Number(_0x2c2a8b[_0xbf5a('0x37')][_0xbf5a('0x65')][_0x108546]),'SmsQueueId':Number(_0x2c2a8b['params']['id'])});}}else{socket[_0xbf5a('0x6f')](_0xbf5a('0x85'),{'UserId':Number(_0x2c2a8b[_0xbf5a('0x37')][_0xbf5a('0x65')]),'SmsQueueId':Number(_0x2c2a8b[_0xbf5a('0x49')]['id'])});}});}})[_0xbf5a('0x28')](respondWithStatusCode(_0x45b478,null))[_0xbf5a('0x48')](handleError(_0x45b478,null));};exports[_0xbf5a('0x8a')]=function(_0x5acc80,_0x47ef22,_0x61961){var _0x224a22={};var _0xb24e69={};var _0x82ef45;var _0x5d5728;return db[_0xbf5a('0x31')]['findOne']({'where':{'id':_0x5acc80['params']['id']}})[_0xbf5a('0x28')](handleEntityNotFound(_0x47ef22,null))[_0xbf5a('0x28')](function(_0x483e8e){if(_0x483e8e){_0x82ef45=_0x483e8e;_0xb24e69[_0xbf5a('0x36')]=_[_0xbf5a('0x38')](db[_0xbf5a('0x59')]['rawAttributes']);_0xb24e69[_0xbf5a('0x37')]=_[_0xbf5a('0x38')](_0x5acc80['query']);_0xb24e69[_0xbf5a('0x39')]=_[_0xbf5a('0x3a')](_0xb24e69['model'],_0xb24e69['query']);_0x224a22[_0xbf5a('0x3b')]=_['intersection'](_0xb24e69[_0xbf5a('0x36')],qs[_0xbf5a('0x3c')](_0x5acc80['query'][_0xbf5a('0x3c')]));_0x224a22[_0xbf5a('0x3b')]=_0x224a22[_0xbf5a('0x3b')][_0xbf5a('0x3d')]?_0x224a22[_0xbf5a('0x3b')]:_0xb24e69[_0xbf5a('0x36')];_0x224a22[_0xbf5a('0x3f')]=qs['sort'](_0x5acc80[_0xbf5a('0x37')]['sort']);_0x224a22[_0xbf5a('0x41')]=qs['filters'](_[_0xbf5a('0x56')](_0x5acc80[_0xbf5a('0x37')],_0xb24e69[_0xbf5a('0x39')]));if(_0x5acc80[_0xbf5a('0x37')]['filter']){_0x224a22['where']=_[_0xbf5a('0x42')](_0x224a22['where'],{'$or':_[_0xbf5a('0x30')](_0x224a22[_0xbf5a('0x3b')],function(_0x5490fd){var _0x15a99c={};_0x15a99c[_0x5490fd]={'$like':'%'+_0x5acc80[_0xbf5a('0x37')][_0xbf5a('0x43')]+'%'};return _0x15a99c;})});}_0x224a22=_[_0xbf5a('0x42')]({},_0x224a22,_0x5acc80[_0xbf5a('0x44')]);return _0x82ef45[_0xbf5a('0x8a')](_0x224a22);}})[_0xbf5a('0x28')](function(_0x4aa230){if(_0x4aa230){_0x5d5728=_0x4aa230[_0xbf5a('0x3d')];if(!_0x5acc80[_0xbf5a('0x37')][_0xbf5a('0x3e')]('nolimit')){_0x224a22[_0xbf5a('0x22')]=qs[_0xbf5a('0x22')](_0x5acc80['query'][_0xbf5a('0x22')]);_0x224a22[_0xbf5a('0x21')]=qs[_0xbf5a('0x21')](_0x5acc80[_0xbf5a('0x37')][_0xbf5a('0x21')]);}return _0x82ef45['getAgents'](_0x224a22);}})['then'](function(_0x4ead9d){if(_0x4ead9d){return _0x4ead9d?{'count':_0x5d5728,'rows':_0x4ead9d}:null;}})[_0xbf5a('0x28')](respondWithResult(_0x47ef22,null))[_0xbf5a('0x48')](handleError(_0x47ef22,null));};
\ No newline at end of file
+var _0x71e8=['sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','end','status','json','count','offset','set','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','SmsQueue','includeAll','include','findAll','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','UserSmsQueue','length','nolimit','SmsQueueId','User','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','online','voicePause','interface','Agents'];(function(_0x3b1d1e,_0x10d8d9){var _0x5670b7=function(_0x2ed53a){while(--_0x2ed53a){_0x3b1d1e['push'](_0x3b1d1e['shift']());}};_0x5670b7(++_0x10d8d9);}(_0x71e8,0x1bf));var _0x871e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71e8[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x871e('0x0'));var rimraf=require(_0x871e('0x1'));var zipdir=require(_0x871e('0x2'));var jsonpatch=require(_0x871e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x871e('0x4'));var util=require('util');var path=require(_0x871e('0x5'));var sox=require(_0x871e('0x6'));var csv=require('to-csv');var ejs=require(_0x871e('0x7'));var fs=require('fs');var _=require(_0x871e('0x8'));var squel=require(_0x871e('0x9'));var crypto=require(_0x871e('0xa'));var jsforce=require(_0x871e('0xb'));var deskjs=require(_0x871e('0xc'));var toCsv=require(_0x871e('0xd'));var querystring=require('querystring');var Papa=require(_0x871e('0xe'));var Redis=require(_0x871e('0xf'));var authService=require(_0x871e('0x10'));var qs=require(_0x871e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x871e('0x12'));var logger=require(_0x871e('0x13'))(_0x871e('0x14'));var utils=require(_0x871e('0x15'));var config=require(_0x871e('0x16'));var db=require(_0x871e('0x17'))['db'];config[_0x871e('0x18')]=_['defaults'](config[_0x871e('0x18')],{'host':_0x871e('0x19'),'port':0x18eb});var socket=require(_0x871e('0x1a'))(new Redis(config[_0x871e('0x18')]));require(_0x871e('0x1b'))['register'](socket);function respondWithStatusCode(_0x4075ad,_0x5e0624){_0x5e0624=_0x5e0624||0xcc;return function(_0x53ddb1){if(_0x53ddb1){return _0x4075ad[_0x871e('0x1c')](_0x5e0624);}return _0x4075ad['status'](_0x5e0624)[_0x871e('0x1d')]();};}function respondWithResult(_0x41886d,_0x4bc961){_0x4bc961=_0x4bc961||0xc8;return function(_0x1133a9){if(_0x1133a9){return _0x41886d[_0x871e('0x1e')](_0x4bc961)[_0x871e('0x1f')](_0x1133a9);}};}function respondWithFilteredResult(_0x24b19d,_0x1f7b15){return function(_0x3982a2){if(_0x3982a2){var _0x5dc333=_0x3982a2[_0x871e('0x20')],_0x4ef181=_0x1f7b15[_0x871e('0x21')],_0x391377=_0x1f7b15[_0x871e('0x21')]+_0x1f7b15['limit'],_0x42fe61;if(_0x391377>=_0x5dc333){_0x391377=_0x5dc333;_0x42fe61=0xc8;}else{_0x42fe61=0xce;}_0x24b19d[_0x871e('0x1e')](_0x42fe61);return _0x24b19d[_0x871e('0x22')]('Content-Range',_0x4ef181+'-'+_0x391377+'/'+_0x5dc333)[_0x871e('0x1f')](_0x3982a2);}return null;};}function patchUpdates(_0x6cc33f){return function(_0x4eb18d){try{jsonpatch[_0x871e('0x23')](_0x4eb18d,_0x6cc33f,!![]);}catch(_0x461cc1){return BPromise[_0x871e('0x24')](_0x461cc1);}return _0x4eb18d[_0x871e('0x25')]();};}function saveUpdates(_0x59ea8a,_0x40cb4c){return function(_0x589d45){if(_0x589d45){return _0x589d45[_0x871e('0x26')](_0x59ea8a)[_0x871e('0x27')](function(_0x37223a){return _0x37223a;});}return null;};}function removeEntity(_0xbffc73,_0x150784){return function(_0x405c89){if(_0x405c89){return _0x405c89[_0x871e('0x28')]()[_0x871e('0x27')](function(){var _0x2ea49b=_0x405c89[_0x871e('0x29')]({'plain':!![]});var _0x261112=_0x871e('0x2a');return db[_0x871e('0x2b')][_0x871e('0x28')]({'where':{'type':_0x261112,'resourceId':_0x2ea49b['id']}})[_0x871e('0x27')](function(){return _0x405c89;});})[_0x871e('0x27')](function(){_0xbffc73[_0x871e('0x1e')](0xcc)[_0x871e('0x1d')]();});}};}function handleEntityNotFound(_0x4544bf,_0x41c9d6){return function(_0x2adaaa){if(!_0x2adaaa){_0x4544bf['sendStatus'](0x194);}return _0x2adaaa;};}function handleError(_0x3736a5,_0x51f63a){_0x51f63a=_0x51f63a||0x1f4;return function(_0x2550c1){logger[_0x871e('0x2c')](_0x2550c1[_0x871e('0x2d')]);if(_0x2550c1['name']){delete _0x2550c1[_0x871e('0x2e')];}_0x3736a5[_0x871e('0x1e')](_0x51f63a)['send'](_0x2550c1);};}exports[_0x871e('0x2f')]=function(_0x7bfd01,_0x108ed3){var _0x4a4d5e={},_0x32652c={},_0x516930={'count':0x0,'rows':[]};var _0x2ab806=_['map'](db['SmsQueue'][_0x871e('0x30')],function(_0x5bc5a5){return{'name':_0x5bc5a5[_0x871e('0x31')],'type':_0x5bc5a5[_0x871e('0x32')][_0x871e('0x33')]};});_0x32652c[_0x871e('0x34')]=_[_0x871e('0x35')](_0x2ab806,_0x871e('0x2e'));_0x32652c[_0x871e('0x36')]=_[_0x871e('0x37')](_0x7bfd01['query']);_0x32652c[_0x871e('0x38')]=_[_0x871e('0x39')](_0x32652c[_0x871e('0x34')],_0x32652c[_0x871e('0x36')]);_0x4a4d5e[_0x871e('0x3a')]=_['intersection'](_0x32652c['model'],qs[_0x871e('0x3b')](_0x7bfd01['query'][_0x871e('0x3b')]));_0x4a4d5e[_0x871e('0x3a')]=_0x4a4d5e[_0x871e('0x3a')]['length']?_0x4a4d5e[_0x871e('0x3a')]:_0x32652c[_0x871e('0x34')];if(!_0x7bfd01[_0x871e('0x36')][_0x871e('0x3c')]('nolimit')){_0x4a4d5e[_0x871e('0x3d')]=qs[_0x871e('0x3d')](_0x7bfd01[_0x871e('0x36')][_0x871e('0x3d')]);_0x4a4d5e[_0x871e('0x21')]=qs['offset'](_0x7bfd01[_0x871e('0x36')]['offset']);}_0x4a4d5e[_0x871e('0x3e')]=qs[_0x871e('0x3f')](_0x7bfd01[_0x871e('0x36')][_0x871e('0x3f')]);_0x4a4d5e[_0x871e('0x40')]=qs[_0x871e('0x38')](_[_0x871e('0x41')](_0x7bfd01[_0x871e('0x36')],_0x32652c[_0x871e('0x38')]),_0x2ab806);if(_0x7bfd01[_0x871e('0x36')][_0x871e('0x42')]){_0x4a4d5e[_0x871e('0x40')]=_[_0x871e('0x43')](_0x4a4d5e[_0x871e('0x40')],{'$or':_[_0x871e('0x35')](_0x2ab806,function(_0x4f9856){if(_0x4f9856[_0x871e('0x32')]!=='VIRTUAL'){var _0x10ad97={};_0x10ad97[_0x4f9856[_0x871e('0x2e')]]={'$like':'%'+_0x7bfd01['query'][_0x871e('0x42')]+'%'};return _0x10ad97;}})});}_0x4a4d5e=_['merge']({},_0x4a4d5e,_0x7bfd01[_0x871e('0x44')]);var _0x2bf8f7={'where':_0x4a4d5e[_0x871e('0x40')]};return db[_0x871e('0x45')][_0x871e('0x20')](_0x2bf8f7)[_0x871e('0x27')](function(_0x9fc04){_0x516930[_0x871e('0x20')]=_0x9fc04;if(_0x7bfd01[_0x871e('0x36')][_0x871e('0x46')]){_0x4a4d5e[_0x871e('0x47')]=[{'all':!![]}];}return db['SmsQueue'][_0x871e('0x48')](_0x4a4d5e);})[_0x871e('0x27')](function(_0x10a393){_0x516930['rows']=_0x10a393;return _0x516930;})[_0x871e('0x27')](respondWithFilteredResult(_0x108ed3,_0x4a4d5e))[_0x871e('0x49')](handleError(_0x108ed3,null));};exports['show']=function(_0x475d2c,_0x1af708){var _0x251642={'raw':!![],'where':{'id':_0x475d2c['params']['id']}},_0x243813={};_0x243813[_0x871e('0x34')]=_[_0x871e('0x37')](db[_0x871e('0x45')][_0x871e('0x30')]);_0x243813['query']=_[_0x871e('0x37')](_0x475d2c['query']);_0x243813[_0x871e('0x38')]=_[_0x871e('0x39')](_0x243813[_0x871e('0x34')],_0x243813[_0x871e('0x36')]);_0x251642[_0x871e('0x3a')]=_[_0x871e('0x39')](_0x243813[_0x871e('0x34')],qs[_0x871e('0x3b')](_0x475d2c[_0x871e('0x36')]['fields']));_0x251642[_0x871e('0x3a')]=_0x251642[_0x871e('0x3a')]['length']?_0x251642[_0x871e('0x3a')]:_0x243813[_0x871e('0x34')];if(_0x475d2c[_0x871e('0x36')][_0x871e('0x46')]){_0x251642[_0x871e('0x47')]=[{'all':!![]}];}_0x251642=_['merge']({},_0x251642,_0x475d2c['options']);return db[_0x871e('0x45')]['find'](_0x251642)[_0x871e('0x27')](handleEntityNotFound(_0x1af708,null))['then'](respondWithResult(_0x1af708,null))[_0x871e('0x49')](handleError(_0x1af708,null));};exports[_0x871e('0x4a')]=function(_0x236930,_0x5723cc){return db[_0x871e('0x45')]['create'](_0x236930['body'],{})[_0x871e('0x27')](function(_0x1a5910){var _0x263caf=_0x236930['user'][_0x871e('0x29')]({'plain':!![]});if(!_0x263caf)throw new Error(_0x871e('0x4b'));if(_0x263caf[_0x871e('0x4c')]==='user'){var _0x55d380=_0x1a5910[_0x871e('0x29')]({'plain':!![]});var _0x3636ba=_0x871e('0x2a');return db[_0x871e('0x4d')][_0x871e('0x4e')]({'where':{'name':_0x3636ba,'userProfileId':_0x263caf[_0x871e('0x4f')]},'raw':!![]})['then'](function(_0x273829){if(_0x273829&&_0x273829[_0x871e('0x50')]===0x0){return db[_0x871e('0x2b')][_0x871e('0x4a')]({'name':_0x55d380[_0x871e('0x2e')],'resourceId':_0x55d380['id'],'type':_0x273829[_0x871e('0x2e')],'sectionId':_0x273829['id']},{})[_0x871e('0x27')](function(){return _0x1a5910;});}else{return _0x1a5910;}})[_0x871e('0x49')](function(_0xf51311){logger[_0x871e('0x2c')](_0x871e('0x51'),_0xf51311);throw _0xf51311;});}return _0x1a5910;})[_0x871e('0x27')](respondWithResult(_0x5723cc,0xc9))[_0x871e('0x49')](handleError(_0x5723cc,null));};exports[_0x871e('0x26')]=function(_0x494c69,_0x2a0f25){if(_0x494c69['body']['id']){delete _0x494c69[_0x871e('0x52')]['id'];}return db[_0x871e('0x45')]['find']({'where':{'id':_0x494c69[_0x871e('0x53')]['id']}})[_0x871e('0x27')](handleEntityNotFound(_0x2a0f25,null))['then'](saveUpdates(_0x494c69[_0x871e('0x52')],null))['then'](respondWithResult(_0x2a0f25,null))[_0x871e('0x49')](handleError(_0x2a0f25,null));};exports['destroy']=function(_0x2b71f7,_0x3f23de){return db['SmsQueue'][_0x871e('0x4e')]({'where':{'id':_0x2b71f7[_0x871e('0x53')]['id']}})[_0x871e('0x27')](handleEntityNotFound(_0x3f23de,null))['then'](removeEntity(_0x3f23de,null))['catch'](handleError(_0x3f23de,null));};exports[_0x871e('0x54')]=function(_0x303d2c,_0x404009){return db[_0x871e('0x45')]['describe']()['then'](respondWithResult(_0x404009,null))['catch'](handleError(_0x404009,null));};exports['getMembers']=function(_0xd1fa57,_0x5f4442,_0x54d312){var _0x4e3b73={'raw':!![],'where':{}},_0x339e15={},_0x2c87b3;return db['SmsQueue'][_0x871e('0x55')]({'where':{'id':_0xd1fa57[_0x871e('0x53')]['id']}})[_0x871e('0x27')](handleEntityNotFound(_0x5f4442,null))['then'](function(_0xc5a5c5){if(_0xc5a5c5){_0x2c87b3=_0xc5a5c5[_0x871e('0x29')]({'plain':!![]});_0x339e15[_0x871e('0x34')]=_[_0x871e('0x37')](db[_0x871e('0x56')]['rawAttributes']);_0x339e15[_0x871e('0x36')]=_[_0x871e('0x37')](_0xd1fa57[_0x871e('0x36')]);_0x339e15[_0x871e('0x38')]=_[_0x871e('0x39')](_0x339e15[_0x871e('0x34')],_0x339e15[_0x871e('0x36')]);_0x4e3b73[_0x871e('0x3a')]=_['intersection'](_0x339e15[_0x871e('0x34')],qs[_0x871e('0x3b')](_0xd1fa57['query'][_0x871e('0x3b')]));_0x4e3b73[_0x871e('0x3a')]=_0x4e3b73['attributes'][_0x871e('0x57')]?_0x4e3b73[_0x871e('0x3a')]:_0x339e15[_0x871e('0x34')];if(!_0xd1fa57[_0x871e('0x36')]['hasOwnProperty'](_0x871e('0x58'))){_0x4e3b73[_0x871e('0x3d')]=qs[_0x871e('0x3d')](_0xd1fa57[_0x871e('0x36')]['limit']);_0x4e3b73[_0x871e('0x21')]=qs['offset'](_0xd1fa57[_0x871e('0x36')][_0x871e('0x21')]);}_0x4e3b73['order']=qs[_0x871e('0x3f')](_0xd1fa57[_0x871e('0x36')]['sort']);_0x4e3b73[_0x871e('0x40')]=qs[_0x871e('0x38')](_[_0x871e('0x41')](_0xd1fa57['query'],_0x339e15[_0x871e('0x38')]));_0x4e3b73[_0x871e('0x40')][_0x871e('0x59')]=_0xc5a5c5['id'];if(_0xd1fa57[_0x871e('0x36')][_0x871e('0x42')]){_0x4e3b73[_0x871e('0x40')]=_[_0x871e('0x43')](_0x4e3b73['where'],{'$or':_['map'](_0x4e3b73[_0x871e('0x3a')],function(_0x2b06f4){var _0x33963f={};_0x33963f[_0x2b06f4]={'$like':'%'+_0xd1fa57['query']['filter']+'%'};return _0x33963f;})});}_0x4e3b73=_[_0x871e('0x43')]({},_0x4e3b73,_0xd1fa57[_0x871e('0x44')]);return db[_0x871e('0x56')]['findAll'](_0x4e3b73);}})[_0x871e('0x27')](function(_0x39b7f2){if(_0x39b7f2){return db[_0x871e('0x5a')]['findAndCountAll']({'where':{'id':_[_0x871e('0x35')](_0x39b7f2,'UserId'),'role':'agent'},'attributes':['id',_0x871e('0x2e'),_0x871e('0x5b'),_0x871e('0x5c'),_0x871e('0x5d')]});}})['then'](function(_0x1cd748){if(_0x1cd748){return{'count':_0x1cd748[_0x871e('0x20')],'rows':_[_0x871e('0x35')](_0x1cd748[_0x871e('0x5e')],function(_0x10a219){return{'membername':_0x10a219['name'],'UserId':_0x10a219['id'],'queue_name':_0x2c87b3['name'],'SmsQueueId':_0x2c87b3['id'],'interface':util[_0x871e('0x5f')](_0x871e('0x60'),_0x871e('0x61'),_0x10a219[_0x871e('0x2e')]),'penalty':0x0,'paused':_0x10a219[_0x871e('0x5b')],'createdAt':_0x10a219[_0x871e('0x5d')],'updatedAt':_0x10a219[_0x871e('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5f4442,_0x4e3b73))['catch'](handleError(_0x5f4442,null));};exports[_0x871e('0x62')]=function(_0x4ce68d,_0xc31c73,_0x50c325){var _0x534c48={};var _0x66acb3={};var _0x546b2c;var _0x1e8770;return db[_0x871e('0x45')][_0x871e('0x55')]({'where':{'id':_0x4ce68d[_0x871e('0x53')]['id']}})[_0x871e('0x27')](handleEntityNotFound(_0xc31c73,null))['then'](function(_0x4f5314){if(_0x4f5314){_0x546b2c=_0x4f5314;_0x66acb3[_0x871e('0x34')]=_[_0x871e('0x37')](db[_0x871e('0x63')][_0x871e('0x30')]);_0x66acb3[_0x871e('0x36')]=_[_0x871e('0x37')](_0x4ce68d[_0x871e('0x36')]);_0x66acb3[_0x871e('0x38')]=_[_0x871e('0x39')](_0x66acb3[_0x871e('0x34')],_0x66acb3[_0x871e('0x36')]);_0x534c48['attributes']=_[_0x871e('0x39')](_0x66acb3[_0x871e('0x34')],qs[_0x871e('0x3b')](_0x4ce68d[_0x871e('0x36')][_0x871e('0x3b')]));_0x534c48['attributes']=_0x534c48[_0x871e('0x3a')][_0x871e('0x57')]?_0x534c48[_0x871e('0x3a')]:_0x66acb3[_0x871e('0x34')];_0x534c48[_0x871e('0x3e')]=qs[_0x871e('0x3f')](_0x4ce68d['query']['sort']);_0x534c48['where']=qs[_0x871e('0x38')](_[_0x871e('0x41')](_0x4ce68d['query'],_0x66acb3[_0x871e('0x38')]));if(_0x4ce68d[_0x871e('0x36')][_0x871e('0x42')]){_0x534c48[_0x871e('0x40')]=_['merge'](_0x534c48[_0x871e('0x40')],{'$or':_['map'](_0x534c48[_0x871e('0x3a')],function(_0x5cf911){var _0x5cbad9={};_0x5cbad9[_0x5cf911]={'$like':'%'+_0x4ce68d[_0x871e('0x36')][_0x871e('0x42')]+'%'};return _0x5cbad9;})});}_0x534c48=_[_0x871e('0x43')]({},_0x534c48,_0x4ce68d['options']);return _0x546b2c[_0x871e('0x62')](_0x534c48);}})[_0x871e('0x27')](function(_0x4c76ea){if(_0x4c76ea){_0x1e8770=_0x4c76ea[_0x871e('0x57')];if(!_0x4ce68d[_0x871e('0x36')][_0x871e('0x3c')](_0x871e('0x58'))){_0x534c48[_0x871e('0x3d')]=qs[_0x871e('0x3d')](_0x4ce68d['query'][_0x871e('0x3d')]);_0x534c48[_0x871e('0x21')]=qs[_0x871e('0x21')](_0x4ce68d[_0x871e('0x36')][_0x871e('0x21')]);}return _0x546b2c['getTeams'](_0x534c48);}})[_0x871e('0x27')](function(_0x357364){if(_0x357364){return _0x357364?{'count':_0x1e8770,'rows':_0x357364}:null;}})[_0x871e('0x27')](respondWithResult(_0xc31c73,null))['catch'](handleError(_0xc31c73,null));};exports[_0x871e('0x64')]=function(_0x23d2e0,_0x35c17d,_0x75ca5d){var _0x2a2771=_0x23d2e0[_0x871e('0x52')]['ids'];return db[_0x871e('0x63')][_0x871e('0x48')]({'where':{'id':_0x2a2771},'attributes':['id'],'include':[{'model':db[_0x871e('0x5a')],'as':'Agents','attributes':['id',_0x871e('0x2e'),_0x871e('0x65'),_0x871e('0x66'),_0x871e('0x67')],'raw':!![]}]})[_0x871e('0x27')](function(_0x377b60){if(_0x377b60){var _0x44a1d9=_['flatMap'](_0x377b60,function(_0x44e8a8){var _0x34b377=_0x44e8a8[_0x871e('0x29')]({'plain':!![]});return _0x34b377[_0x871e('0x68')];});return db[_0x871e('0x45')][_0x871e('0x4e')]({'where':{'id':_0x23d2e0[_0x871e('0x53')]['id']}})['then'](function(_0x1ff3c1){return db[_0x871e('0x69')][_0x871e('0x6a')](function(_0xd2b0d4){return _0x1ff3c1[_0x871e('0x64')](_0x2a2771,{'transaction':_0xd2b0d4})['then'](function(){return BPromise[_0x871e('0x6b')](_0x44a1d9,function(_0x274114){return db['UserSmsQueue'][_0x871e('0x6c')]({'where':{'UserId':_0x274114['id'],'SmsQueueId':_0x23d2e0['params']['id']},'transaction':_0xd2b0d4});});})[_0x871e('0x27')](function(){_0x44a1d9[_0x871e('0x6d')](function(_0x17124c){socket['emit'](_0x871e('0x6e'),{'UserId':_0x17124c['id'],'SmsQueueId':_0x1ff3c1['id']});});});});});}})[_0x871e('0x27')](respondWithStatusCode(_0x35c17d,null))[_0x871e('0x49')](handleError(_0x35c17d,null));};exports[_0x871e('0x6f')]=function(_0x5603b4,_0x4f2b20,_0x265aa5){return db[_0x871e('0x63')][_0x871e('0x48')]({'where':{'id':_0x5603b4['query'][_0x871e('0x70')]},'attributes':['id'],'include':[{'model':db[_0x871e('0x5a')],'as':_0x871e('0x68'),'attributes':['id'],'raw':!![]}]})[_0x871e('0x27')](handleEntityNotFound(_0x4f2b20,null))[_0x871e('0x27')](function(_0x325706){var _0x479da1=_[_0x871e('0x35')](_0x325706,'id');var _0x28b57e=[];var _0x4b4a42=[];var _0x4cfb08=squel['select']();_0x4cfb08[_0x871e('0x71')](_0x871e('0x72'))[_0x871e('0x73')](_0x871e('0x74'),'tq')[_0x871e('0x75')](_0x871e('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x871e('0x40')](_0x871e('0x77'),_0x5603b4[_0x871e('0x53')]['id']);for(var _0x5de3af=0x0;_0x5de3af<_0x325706[_0x871e('0x57')];_0x5de3af+=0x1){let _0x482371=_0x325706[_0x5de3af];for(var _0x3b7547=0x0;_0x3b7547<_0x482371[_0x871e('0x68')]['length'];_0x3b7547+=0x1){let _0x5466b2=_0x482371[_0x871e('0x68')][_0x3b7547];var _0x283fa9=_0x4cfb08[_0x871e('0x78')]();_0x283fa9['where']('ut.UserId\x20=\x20?',_0x5466b2['id']);_0x4b4a42[_0x871e('0x79')](db[_0x871e('0x69')]['query'](_0x283fa9['toString'](),{'type':db[_0x871e('0x69')][_0x871e('0x7a')][_0x871e('0x7b')]})[_0x871e('0x27')](function(_0x4b30ff){if(_0x4b30ff['length']===0x1){return _0x5466b2['id'];}else{var _0x3774a2=_[_0x871e('0x7c')](_[_0x871e('0x35')](_0x4b30ff,_0x871e('0x7d')),function(_0x298553){return _[_0x871e('0x7e')](_0x479da1,_0x298553);});if(_0x3774a2){return _0x5466b2['id'];}}}));}}return BPromise[_0x871e('0x7f')](_0x4b4a42)[_0x871e('0x27')](function(_0x514c15){_0x28b57e=_(_0x28b57e)['union'](_0x514c15)[_0x871e('0x80')]()[_0x871e('0x81')]();return db[_0x871e('0x45')][_0x871e('0x4e')]({'where':{'id':_0x5603b4[_0x871e('0x53')]['id']}})[_0x871e('0x27')](function(_0x1d48f3){return db[_0x871e('0x69')]['transaction'](function(_0x48e2fe){return _0x1d48f3['removeTeams'](_0x5603b4[_0x871e('0x36')]['ids'],{'transaction':_0x48e2fe})[_0x871e('0x27')](function(){if(!_['isEmpty'](_0x28b57e)){return _0x1d48f3[_0x871e('0x82')](_0x28b57e,{'transaction':_0x48e2fe});}})[_0x871e('0x27')](function(){_0x28b57e[_0x871e('0x6d')](function(_0x23a723){socket[_0x871e('0x83')](_0x871e('0x84'),{'UserId':_0x23a723,'SmsQueueId':_0x1d48f3['id']});});});});});});})[_0x871e('0x27')](respondWithStatusCode(_0x4f2b20,null))[_0x871e('0x49')](handleError(_0x4f2b20,null));};exports[_0x871e('0x85')]=function(_0x47a0d7,_0x165a95,_0x1e1f3e){return db[_0x871e('0x45')][_0x871e('0x4e')]({'where':{'id':_0x47a0d7[_0x871e('0x53')]['id']}})['then'](handleEntityNotFound(_0x165a95,null))[_0x871e('0x27')](function(_0x43eb2f){if(_0x43eb2f){return _0x43eb2f['addAgents'](_0x47a0d7[_0x871e('0x52')][_0x871e('0x70')],_[_0x871e('0x86')](_0x47a0d7[_0x871e('0x52')],[_0x871e('0x70'),'id'])||{})[_0x871e('0x87')](function(_0x349536){for(var _0x569f60=0x0;_0x569f60<_0x47a0d7[_0x871e('0x52')][_0x871e('0x70')][_0x871e('0x57')];_0x569f60+=0x1){socket[_0x871e('0x83')](_0x871e('0x6e'),{'UserId':_0x47a0d7[_0x871e('0x52')][_0x871e('0x70')][_0x569f60],'SmsQueueId':_0x47a0d7['params']['id']});}return _0x349536;});}})[_0x871e('0x27')](respondWithResult(_0x165a95,null))[_0x871e('0x49')](handleError(_0x165a95,null));};exports[_0x871e('0x82')]=function(_0x47cfa0,_0x3a1dce,_0x3a4b31){return db[_0x871e('0x45')][_0x871e('0x4e')]({'where':{'id':_0x47cfa0['params']['id']}})[_0x871e('0x27')](handleEntityNotFound(_0x3a1dce,null))[_0x871e('0x27')](function(_0x272094){if(_0x272094){return _0x272094[_0x871e('0x82')](_0x47cfa0['query'][_0x871e('0x70')])[_0x871e('0x27')](function(){if(_[_0x871e('0x88')](_0x47cfa0[_0x871e('0x36')][_0x871e('0x70')])){for(var _0x5e7ed3=0x0;_0x5e7ed3<_0x47cfa0[_0x871e('0x36')][_0x871e('0x70')]['length'];_0x5e7ed3+=0x1){socket['emit'](_0x871e('0x84'),{'UserId':Number(_0x47cfa0[_0x871e('0x36')]['ids'][_0x5e7ed3]),'SmsQueueId':Number(_0x47cfa0[_0x871e('0x53')]['id'])});}}else{socket['emit'](_0x871e('0x84'),{'UserId':Number(_0x47cfa0[_0x871e('0x36')][_0x871e('0x70')]),'SmsQueueId':Number(_0x47cfa0[_0x871e('0x53')]['id'])});}});}})[_0x871e('0x27')](respondWithStatusCode(_0x3a1dce,null))[_0x871e('0x49')](handleError(_0x3a1dce,null));};exports[_0x871e('0x89')]=function(_0x79b013,_0x39ac5c,_0x22ed8e){var _0x2e8726={};var _0x38a019={};var _0xd495e;var _0x39490f;return db[_0x871e('0x45')]['findOne']({'where':{'id':_0x79b013[_0x871e('0x53')]['id']}})['then'](handleEntityNotFound(_0x39ac5c,null))[_0x871e('0x27')](function(_0x2dc262){if(_0x2dc262){_0xd495e=_0x2dc262;_0x38a019[_0x871e('0x34')]=_[_0x871e('0x37')](db[_0x871e('0x5a')]['rawAttributes']);_0x38a019[_0x871e('0x36')]=_[_0x871e('0x37')](_0x79b013['query']);_0x38a019[_0x871e('0x38')]=_[_0x871e('0x39')](_0x38a019[_0x871e('0x34')],_0x38a019['query']);_0x2e8726[_0x871e('0x3a')]=_['intersection'](_0x38a019['model'],qs['fields'](_0x79b013[_0x871e('0x36')][_0x871e('0x3b')]));_0x2e8726[_0x871e('0x3a')]=_0x2e8726[_0x871e('0x3a')][_0x871e('0x57')]?_0x2e8726[_0x871e('0x3a')]:_0x38a019[_0x871e('0x34')];_0x2e8726[_0x871e('0x3e')]=qs[_0x871e('0x3f')](_0x79b013[_0x871e('0x36')][_0x871e('0x3f')]);_0x2e8726[_0x871e('0x40')]=qs[_0x871e('0x38')](_[_0x871e('0x41')](_0x79b013[_0x871e('0x36')],_0x38a019['filters']));if(_0x79b013[_0x871e('0x36')][_0x871e('0x42')]){_0x2e8726[_0x871e('0x40')]=_[_0x871e('0x43')](_0x2e8726['where'],{'$or':_[_0x871e('0x35')](_0x2e8726[_0x871e('0x3a')],function(_0x4560e7){var _0x2b35df={};_0x2b35df[_0x4560e7]={'$like':'%'+_0x79b013[_0x871e('0x36')][_0x871e('0x42')]+'%'};return _0x2b35df;})});}_0x2e8726=_['merge']({},_0x2e8726,_0x79b013[_0x871e('0x44')]);return _0xd495e[_0x871e('0x89')](_0x2e8726);}})['then'](function(_0x27d454){if(_0x27d454){_0x39490f=_0x27d454[_0x871e('0x57')];if(!_0x79b013[_0x871e('0x36')][_0x871e('0x3c')](_0x871e('0x58'))){_0x2e8726[_0x871e('0x3d')]=qs['limit'](_0x79b013[_0x871e('0x36')]['limit']);_0x2e8726['offset']=qs[_0x871e('0x21')](_0x79b013[_0x871e('0x36')][_0x871e('0x21')]);}return _0xd495e['getAgents'](_0x2e8726);}})[_0x871e('0x27')](function(_0x7a8025){if(_0x7a8025){return _0x7a8025?{'count':_0x39490f,'rows':_0x7a8025}:null;}})[_0x871e('0x27')](respondWithResult(_0x39ac5c,null))[_0x871e('0x49')](handleError(_0x39ac5c,null));};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js
index e001235..74c1be5 100644
--- a/server/api/smsQueue/smsQueue.events.js
+++ b/server/api/smsQueue/smsQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb77c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb77c,0x101));var _0xcb77=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xb77c[_0x263a74];return _0x2aa86c;};'use strict';var EventEmitter=require(_0xcb77('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xcb77('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xcb77('0x2')](0x0);var events={'afterCreate':_0xcb77('0x3'),'afterUpdate':_0xcb77('0x4'),'afterDestroy':_0xcb77('0x5')};function emitEvent(_0x2cd4ab){return function(_0x422238,_0x4c156a,_0x3e124a){SmsQueueEvents[_0xcb77('0x6')](_0x2cd4ab+':'+_0x422238['id'],_0x422238);SmsQueueEvents[_0xcb77('0x6')](_0x2cd4ab,_0x422238);_0x3e124a(null);};}for(var e in events){if(events[_0xcb77('0x7')](e)){var event=events[e];SmsQueue[_0xcb77('0x8')](e,emitEvent(event));}}module[_0xcb77('0x9')]=SmsQueueEvents;
\ No newline at end of file
+var _0x2800=['events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','exports'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2800,0xd8));var _0x0280=function(_0x145d76,_0xe57873){_0x145d76=_0x145d76-0x0;var _0x24fcd5=_0x2800[_0x145d76];return _0x24fcd5;};'use strict';var EventEmitter=require(_0x0280('0x0'));var SmsQueue=require(_0x0280('0x1'))['db'][_0x0280('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x0280('0x3')](0x0);var events={'afterCreate':_0x0280('0x4'),'afterUpdate':_0x0280('0x5'),'afterDestroy':_0x0280('0x6')};function emitEvent(_0x54357b){return function(_0x2a35c7,_0x18f661,_0x14f4de){SmsQueueEvents[_0x0280('0x7')](_0x54357b+':'+_0x2a35c7['id'],_0x2a35c7);SmsQueueEvents[_0x0280('0x7')](_0x54357b,_0x2a35c7);_0x14f4de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x0280('0x8')]=SmsQueueEvents;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js
index 516518d..7d5f79f 100644
--- a/server/api/smsQueue/smsQueue.model.js
+++ b/server/api/smsQueue/smsQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x544a=['util','../../config/logger','bluebird','path','rimraf','./smsQueue.attributes','exports','define','sms_queues','lodash'];(function(_0x4729f1,_0x1c7f0e){var _0x75481b=function(_0x192664){while(--_0x192664){_0x4729f1['push'](_0x4729f1['shift']());}};_0x75481b(++_0x1c7f0e);}(_0x544a,0xbd));var _0xa544=function(_0xfef794,_0x21db68){_0xfef794=_0xfef794-0x0;var _0xf1cffa=_0x544a[_0xfef794];return _0xf1cffa;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var logger=require(_0xa544('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa544('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa544('0x4'));var rimraf=require(_0xa544('0x5'));var config=require('../../config/environment');var attributes=require(_0xa544('0x6'));module[_0xa544('0x7')]=function(_0x2f5992,_0x15a604){return _0x2f5992[_0xa544('0x8')]('SmsQueue',attributes,{'tableName':_0xa544('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x60c2=['define','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports'];(function(_0x372d32,_0x7c8858){var _0x2a71c2=function(_0x153df6){while(--_0x153df6){_0x372d32['push'](_0x372d32['shift']());}};_0x2a71c2(++_0x7c8858);}(_0x60c2,0x8f));var _0x260c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x60c2[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x260c('0x0'));var logger=require(_0x260c('0x1'))(_0x260c('0x2'));var moment=require(_0x260c('0x3'));var BPromise=require(_0x260c('0x4'));var rp=require(_0x260c('0x5'));var fs=require('fs');var path=require(_0x260c('0x6'));var rimraf=require(_0x260c('0x7'));var config=require(_0x260c('0x8'));var attributes=require(_0x260c('0x9'));module[_0x260c('0xa')]=function(_0x13c7d0,_0x558b0c){return _0x13c7d0[_0x260c('0xb')](_0x260c('0xc'),attributes,{'tableName':_0x260c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js
index 9b67fda..ce530a4 100644
--- a/server/api/smsQueue/smsQueue.rpc.js
+++ b/server/api/smsQueue/smsQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb3d8=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowSmsQueue','find','lodash'];(function(_0x467213,_0x2aaf37){var _0x31042d=function(_0x61ec7b){while(--_0x61ec7b){_0x467213['push'](_0x467213['shift']());}};_0x31042d(++_0x2aaf37);}(_0xb3d8,0x7a));var _0x8b3d=function(_0x3ceceb,_0x37c377){_0x3ceceb=_0x3ceceb-0x0;var _0x5007ae=_0xb3d8[_0x3ceceb];return _0x5007ae;};'use strict';var _=require(_0x8b3d('0x0'));var util=require('util');var moment=require(_0x8b3d('0x1'));var BPromise=require(_0x8b3d('0x2'));var rs=require(_0x8b3d('0x3'));var fs=require('fs');var Redis=require(_0x8b3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b3d('0x5'));var logger=require(_0x8b3d('0x6'))(_0x8b3d('0x7'));var config=require(_0x8b3d('0x8'));var jayson=require(_0x8b3d('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x8b3d('0xa')]=_[_0x8b3d('0xb')](config[_0x8b3d('0xa')],{'host':_0x8b3d('0xc'),'port':0x18eb});var socket=require(_0x8b3d('0xd'))(new Redis(config[_0x8b3d('0xa')]));require(_0x8b3d('0xe'))[_0x8b3d('0xf')](socket);function respondWithRpcPromise(_0xe20c73,_0x2d9623,_0x3c2a8b){return new BPromise(function(_0x5b94e0,_0x5cdf49){return client[_0x8b3d('0x10')](_0xe20c73,_0x3c2a8b)[_0x8b3d('0x11')](function(_0x4352f8){logger['info'](_0x8b3d('0x12'),_0x2d9623,_0x8b3d('0x13'));logger[_0x8b3d('0x14')](_0x8b3d('0x15'),_0x2d9623,_0x8b3d('0x13'),JSON['stringify'](_0x4352f8));if(_0x4352f8[_0x8b3d('0x16')]){if(_0x4352f8['error'][_0x8b3d('0x17')]===0x1f4){logger['error'](_0x8b3d('0x12'),_0x2d9623,_0x4352f8[_0x8b3d('0x16')][_0x8b3d('0x18')]);return _0x5cdf49(_0x4352f8['error'][_0x8b3d('0x18')]);}logger['error'](_0x8b3d('0x12'),_0x2d9623,_0x4352f8['error'][_0x8b3d('0x18')]);return _0x5b94e0(_0x4352f8[_0x8b3d('0x16')]['message']);}else{logger[_0x8b3d('0x19')](_0x8b3d('0x12'),_0x2d9623,'request\x20sent');_0x5b94e0(_0x4352f8['result'][_0x8b3d('0x18')]);}})[_0x8b3d('0x1a')](function(_0x1b7b6f){logger[_0x8b3d('0x16')](_0x8b3d('0x12'),_0x2d9623,_0x1b7b6f);_0x5cdf49(_0x1b7b6f);});});}exports[_0x8b3d('0x1b')]=function(_0x1ef45b){var _0x19b30f=this;return new Promise(function(_0x51b560,_0x2683e7){return db[_0x8b3d('0x1c')][_0x8b3d('0x1d')]({'raw':_0x1ef45b['options']?_0x1ef45b[_0x8b3d('0x1e')][_0x8b3d('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ef45b[_0x8b3d('0x1e')]?_0x1ef45b[_0x8b3d('0x1e')][_0x8b3d('0x20')]||null:null,'attributes':_0x1ef45b[_0x8b3d('0x1e')]?_0x1ef45b[_0x8b3d('0x1e')][_0x8b3d('0x21')]||null:null,'limit':_0x1ef45b['options']?_0x1ef45b['options'][_0x8b3d('0x22')]||null:null,'include':_0x1ef45b['options']?_0x1ef45b[_0x8b3d('0x1e')]['include']?_[_0x8b3d('0x23')](_0x1ef45b[_0x8b3d('0x1e')]['include'],function(_0x52a9fc){return{'model':db[_0x52a9fc['model']],'as':_0x52a9fc['as'],'attributes':_0x52a9fc['attributes'],'include':_0x52a9fc[_0x8b3d('0x24')]?_['map'](_0x52a9fc[_0x8b3d('0x24')],function(_0x239edc){return{'model':db[_0x239edc[_0x8b3d('0x25')]],'as':_0x239edc['as'],'attributes':_0x239edc['attributes'],'include':_0x239edc[_0x8b3d('0x24')]?_[_0x8b3d('0x23')](_0x239edc[_0x8b3d('0x24')],function(_0x3d35ff){return{'model':db[_0x3d35ff['model']],'as':_0x3d35ff['as'],'attributes':_0x3d35ff['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b3d('0x11')](function(_0x473cda){logger['info'](_0x8b3d('0x1b'),_0x1ef45b);logger['debug'](_0x8b3d('0x1b'),_0x1ef45b,JSON[_0x8b3d('0x26')](_0x473cda));_0x51b560(_0x473cda);})[_0x8b3d('0x1a')](function(_0x4e1c34){logger[_0x8b3d('0x16')]('GetSmsQueue',_0x4e1c34[_0x8b3d('0x18')],_0x1ef45b);_0x2683e7(_0x19b30f[_0x8b3d('0x16')](0x1f4,_0x4e1c34[_0x8b3d('0x18')]));});});};exports[_0x8b3d('0x27')]=function(_0x12ef44){var _0x197d06=this;return new Promise(function(_0x5c65a4,_0x58acaa){return db[_0x8b3d('0x1c')][_0x8b3d('0x28')]({'raw':_0x12ef44['options']?_0x12ef44[_0x8b3d('0x1e')][_0x8b3d('0x1f')]===undefined?!![]:![]:!![],'where':_0x12ef44['options']?_0x12ef44[_0x8b3d('0x1e')][_0x8b3d('0x20')]||null:null,'attributes':_0x12ef44[_0x8b3d('0x1e')]?_0x12ef44[_0x8b3d('0x1e')][_0x8b3d('0x21')]||null:null,'include':_0x12ef44[_0x8b3d('0x1e')]?_0x12ef44[_0x8b3d('0x1e')][_0x8b3d('0x24')]?_[_0x8b3d('0x23')](_0x12ef44[_0x8b3d('0x1e')]['include'],function(_0x359225){return{'model':db[_0x359225['model']],'as':_0x359225['as'],'attributes':_0x359225[_0x8b3d('0x21')],'include':_0x359225[_0x8b3d('0x24')]?_['map'](_0x359225[_0x8b3d('0x24')],function(_0x58cf3a){return{'model':db[_0x58cf3a[_0x8b3d('0x25')]],'as':_0x58cf3a['as'],'attributes':_0x58cf3a[_0x8b3d('0x21')],'include':_0x58cf3a[_0x8b3d('0x24')]?_[_0x8b3d('0x23')](_0x58cf3a[_0x8b3d('0x24')],function(_0x3fdd10){return{'model':db[_0x3fdd10[_0x8b3d('0x25')]],'as':_0x3fdd10['as'],'attributes':_0x3fdd10['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b3d('0x11')](function(_0x311415){logger[_0x8b3d('0x19')](_0x8b3d('0x27'),_0x12ef44);logger[_0x8b3d('0x14')](_0x8b3d('0x27'),_0x12ef44,JSON['stringify'](_0x311415));_0x5c65a4(_0x311415);})[_0x8b3d('0x1a')](function(_0x494ba6){logger['error'](_0x8b3d('0x27'),_0x494ba6[_0x8b3d('0x18')],_0x12ef44);_0x58acaa(_0x197d06[_0x8b3d('0x16')](0x1f4,_0x494ba6[_0x8b3d('0x18')]));});});};
\ No newline at end of file
+var _0xf70c=['request\x20sent','result','catch','GetSmsQueue','findAll','options','raw','attributes','limit','map','model','include','ShowSmsQueue','SmsQueue','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message'];(function(_0x331a4d,_0x408462){var _0x44944a=function(_0x37941b){while(--_0x37941b){_0x331a4d['push'](_0x331a4d['shift']());}};_0x44944a(++_0x408462);}(_0xf70c,0x1dd));var _0xcf70=function(_0x358370,_0x5ef179){_0x358370=_0x358370-0x0;var _0x210896=_0xf70c[_0x358370];return _0x210896;};'use strict';var _=require(_0xcf70('0x0'));var util=require(_0xcf70('0x1'));var moment=require(_0xcf70('0x2'));var BPromise=require(_0xcf70('0x3'));var rs=require(_0xcf70('0x4'));var fs=require('fs');var Redis=require(_0xcf70('0x5'));var db=require(_0xcf70('0x6'))['db'];var utils=require(_0xcf70('0x7'));var logger=require(_0xcf70('0x8'))(_0xcf70('0x9'));var config=require(_0xcf70('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcf70('0xb')][_0xcf70('0xc')]({'port':0x232a});config[_0xcf70('0xd')]=_['defaults'](config[_0xcf70('0xd')],{'host':_0xcf70('0xe'),'port':0x18eb});var socket=require(_0xcf70('0xf'))(new Redis(config['redis']));require(_0xcf70('0x10'))[_0xcf70('0x11')](socket);function respondWithRpcPromise(_0xcc9426,_0x23743d,_0x14e7c5){return new BPromise(function(_0x5e1e17,_0x4f07a9){return client[_0xcf70('0x12')](_0xcc9426,_0x14e7c5)['then'](function(_0x1c765b){logger[_0xcf70('0x13')]('SmsQueue,\x20%s,\x20%s',_0x23743d,'request\x20sent');logger[_0xcf70('0x14')](_0xcf70('0x15'),_0x23743d,'request\x20sent',JSON[_0xcf70('0x16')](_0x1c765b));if(_0x1c765b[_0xcf70('0x17')]){if(_0x1c765b[_0xcf70('0x17')][_0xcf70('0x18')]===0x1f4){logger[_0xcf70('0x17')](_0xcf70('0x19'),_0x23743d,_0x1c765b[_0xcf70('0x17')]['message']);return _0x4f07a9(_0x1c765b[_0xcf70('0x17')][_0xcf70('0x1a')]);}logger[_0xcf70('0x17')](_0xcf70('0x19'),_0x23743d,_0x1c765b[_0xcf70('0x17')][_0xcf70('0x1a')]);return _0x5e1e17(_0x1c765b[_0xcf70('0x17')][_0xcf70('0x1a')]);}else{logger[_0xcf70('0x13')](_0xcf70('0x19'),_0x23743d,_0xcf70('0x1b'));_0x5e1e17(_0x1c765b[_0xcf70('0x1c')][_0xcf70('0x1a')]);}})[_0xcf70('0x1d')](function(_0x355a3d){logger[_0xcf70('0x17')](_0xcf70('0x19'),_0x23743d,_0x355a3d);_0x4f07a9(_0x355a3d);});});}exports[_0xcf70('0x1e')]=function(_0x385c59){var _0x3a48c5=this;return new Promise(function(_0x29a800,_0x7c6cb9){return db['SmsQueue'][_0xcf70('0x1f')]({'raw':_0x385c59[_0xcf70('0x20')]?_0x385c59['options'][_0xcf70('0x21')]===undefined?!![]:![]:!![],'where':_0x385c59[_0xcf70('0x20')]?_0x385c59[_0xcf70('0x20')]['where']||null:null,'attributes':_0x385c59[_0xcf70('0x20')]?_0x385c59[_0xcf70('0x20')][_0xcf70('0x22')]||null:null,'limit':_0x385c59[_0xcf70('0x20')]?_0x385c59[_0xcf70('0x20')][_0xcf70('0x23')]||null:null,'include':_0x385c59[_0xcf70('0x20')]?_0x385c59['options']['include']?_[_0xcf70('0x24')](_0x385c59[_0xcf70('0x20')]['include'],function(_0x51e537){return{'model':db[_0x51e537[_0xcf70('0x25')]],'as':_0x51e537['as'],'attributes':_0x51e537[_0xcf70('0x22')],'include':_0x51e537[_0xcf70('0x26')]?_['map'](_0x51e537[_0xcf70('0x26')],function(_0xc8a5c8){return{'model':db[_0xc8a5c8['model']],'as':_0xc8a5c8['as'],'attributes':_0xc8a5c8['attributes'],'include':_0xc8a5c8[_0xcf70('0x26')]?_[_0xcf70('0x24')](_0xc8a5c8[_0xcf70('0x26')],function(_0x4ae736){return{'model':db[_0x4ae736['model']],'as':_0x4ae736['as'],'attributes':_0x4ae736[_0xcf70('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c1b9c){logger[_0xcf70('0x13')](_0xcf70('0x1e'),_0x385c59);logger['debug']('GetSmsQueue',_0x385c59,JSON[_0xcf70('0x16')](_0x3c1b9c));_0x29a800(_0x3c1b9c);})[_0xcf70('0x1d')](function(_0x4d9f34){logger['error'](_0xcf70('0x1e'),_0x4d9f34[_0xcf70('0x1a')],_0x385c59);_0x7c6cb9(_0x3a48c5[_0xcf70('0x17')](0x1f4,_0x4d9f34[_0xcf70('0x1a')]));});});};exports[_0xcf70('0x27')]=function(_0x3d81f7){var _0x35655a=this;return new Promise(function(_0x5e4fc1,_0x8e1ba4){return db[_0xcf70('0x28')]['find']({'raw':_0x3d81f7[_0xcf70('0x20')]?_0x3d81f7[_0xcf70('0x20')][_0xcf70('0x21')]===undefined?!![]:![]:!![],'where':_0x3d81f7[_0xcf70('0x20')]?_0x3d81f7['options'][_0xcf70('0x29')]||null:null,'attributes':_0x3d81f7[_0xcf70('0x20')]?_0x3d81f7[_0xcf70('0x20')]['attributes']||null:null,'include':_0x3d81f7['options']?_0x3d81f7['options'][_0xcf70('0x26')]?_['map'](_0x3d81f7['options'][_0xcf70('0x26')],function(_0x294813){return{'model':db[_0x294813['model']],'as':_0x294813['as'],'attributes':_0x294813['attributes'],'include':_0x294813[_0xcf70('0x26')]?_['map'](_0x294813[_0xcf70('0x26')],function(_0x3eb5dd){return{'model':db[_0x3eb5dd['model']],'as':_0x3eb5dd['as'],'attributes':_0x3eb5dd[_0xcf70('0x22')],'include':_0x3eb5dd[_0xcf70('0x26')]?_['map'](_0x3eb5dd[_0xcf70('0x26')],function(_0x3d3887){return{'model':db[_0x3d3887[_0xcf70('0x25')]],'as':_0x3d3887['as'],'attributes':_0x3d3887['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x488e95){logger[_0xcf70('0x13')](_0xcf70('0x27'),_0x3d81f7);logger[_0xcf70('0x14')](_0xcf70('0x27'),_0x3d81f7,JSON[_0xcf70('0x16')](_0x488e95));_0x5e4fc1(_0x488e95);})[_0xcf70('0x1d')](function(_0x3a6563){logger[_0xcf70('0x17')](_0xcf70('0x27'),_0x3a6563[_0xcf70('0x1a')],_0x3d81f7);_0x8e1ba4(_0x35655a[_0xcf70('0x17')](0x1f4,_0x3a6563[_0xcf70('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js
index f8a502e..aecf426 100644
--- a/server/api/smsQueue/smsQueue.socket.js
+++ b/server/api/smsQueue/smsQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a56=['./smsQueue.events','remove','removeListener','register','smsQueue:'];(function(_0x493a97,_0x50a93e){var _0x51f171=function(_0x26a0bb){while(--_0x26a0bb){_0x493a97['push'](_0x493a97['shift']());}};_0x51f171(++_0x50a93e);}(_0x0a56,0xb9));var _0x60a5=function(_0x454c4f,_0x332429){_0x454c4f=_0x454c4f-0x0;var _0x5336bf=_0x0a56[_0x454c4f];return _0x5336bf;};'use strict';var SmsQueueEvents=require(_0x60a5('0x0'));var events=['save',_0x60a5('0x1'),'update'];function createListener(_0x4f7543,_0x41e2d9){return function(_0x18e725){_0x41e2d9['emit'](_0x4f7543,_0x18e725);};}function removeListener(_0x42a6c8,_0x5be80b){return function(){SmsQueueEvents[_0x60a5('0x2')](_0x42a6c8,_0x5be80b);};}exports[_0x60a5('0x3')]=function(_0x4e65cc){for(var _0x353189=0x0,_0xf6d45e=events['length'];_0x353189<_0xf6d45e;_0x353189++){var _0x339aba=events[_0x353189];var _0x2766a7=createListener(_0x60a5('0x4')+_0x339aba,_0x4e65cc);SmsQueueEvents['on'](_0x339aba,_0x2766a7);}};
\ No newline at end of file
+var _0x774b=['removeListener','register','./smsQueue.events','save','remove','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x774b,0x1de));var _0xb774=function(_0x2c80cf,_0x55071b){_0x2c80cf=_0x2c80cf-0x0;var _0x484a9d=_0x774b[_0x2c80cf];return _0x484a9d;};'use strict';var SmsQueueEvents=require(_0xb774('0x0'));var events=[_0xb774('0x1'),_0xb774('0x2'),_0xb774('0x3')];function createListener(_0x37aa7a,_0x44111d){return function(_0x5a7e2c){_0x44111d[_0xb774('0x4')](_0x37aa7a,_0x5a7e2c);};}function removeListener(_0x4bcb31,_0x4ccd56){return function(){SmsQueueEvents[_0xb774('0x5')](_0x4bcb31,_0x4ccd56);};}exports[_0xb774('0x6')]=function(_0x360045){for(var _0x5763ae=0x0,_0x492b50=events['length'];_0x5763ae<_0x492b50;_0x5763ae++){var _0x14ed24=events[_0x5763ae];var _0x551448=createListener('smsQueue:'+_0x14ed24,_0x360045);SmsQueueEvents['on'](_0x14ed24,_0x551448);}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js
index 1bd36fd..cd1978c 100644
--- a/server/api/smsQueueReport/index.js
+++ b/server/api/smsQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfcd4=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','put','/:id','delete','destroy','exports','multer','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfcd4,0x141));var _0x4fcd=function(_0x52ac6b,_0xb00fc8){_0x52ac6b=_0x52ac6b-0x0;var _0x2473af=_0xfcd4[_0x52ac6b];return _0x2473af;};'use strict';var multer=require(_0x4fcd('0x0'));var util=require(_0x4fcd('0x1'));var path=require(_0x4fcd('0x2'));var timeout=require(_0x4fcd('0x3'));var express=require(_0x4fcd('0x4'));var router=express[_0x4fcd('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4fcd('0x6'));var config=require(_0x4fcd('0x7'));var controller=require('./smsQueueReport.controller');router[_0x4fcd('0x8')]('/',auth[_0x4fcd('0x9')](),controller['index']);router[_0x4fcd('0x8')](_0x4fcd('0xa'),auth[_0x4fcd('0x9')](),controller[_0x4fcd('0xb')]);router[_0x4fcd('0x8')]('/:id',auth[_0x4fcd('0x9')](),controller[_0x4fcd('0xc')]);router[_0x4fcd('0xd')]('/',auth[_0x4fcd('0x9')](),controller['create']);router[_0x4fcd('0xe')](_0x4fcd('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x4fcd('0x10')](_0x4fcd('0xf'),auth[_0x4fcd('0x9')](),controller[_0x4fcd('0x11')]);module[_0x4fcd('0x12')]=router;
\ No newline at end of file
+var _0x36fb=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','show','post','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x36fb,0x115));var _0xb36f=function(_0x345458,_0x2b1c17){_0x345458=_0x345458-0x0;var _0x5d814f=_0x36fb[_0x345458];return _0x5d814f;};'use strict';var multer=require(_0xb36f('0x0'));var util=require(_0xb36f('0x1'));var path=require(_0xb36f('0x2'));var timeout=require(_0xb36f('0x3'));var express=require(_0xb36f('0x4'));var router=express['Router']();var auth=require(_0xb36f('0x5'));var interaction=require(_0xb36f('0x6'));var config=require(_0xb36f('0x7'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0xb36f('0x8')](),controller[_0xb36f('0x9')]);router['get'](_0xb36f('0xa'),auth[_0xb36f('0x8')](),controller[_0xb36f('0xb')]);router[_0xb36f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xb36f('0xd')]);router[_0xb36f('0xe')]('/',auth[_0xb36f('0x8')](),controller['create']);router[_0xb36f('0xf')](_0xb36f('0x10'),auth[_0xb36f('0x8')](),controller['update']);router[_0xb36f('0x11')]('/:id',auth[_0xb36f('0x8')](),controller[_0xb36f('0x12')]);module[_0xb36f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js
index f98f2da..8554e7d 100644
--- a/server/api/smsQueueReport/smsQueueReport.attributes.js
+++ b/server/api/smsQueueReport/smsQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7326=['exports','DATE','STRING','moment','sequelize'];(function(_0x2cb6a1,_0x189341){var _0x97f446=function(_0x2ebb49){while(--_0x2ebb49){_0x2cb6a1['push'](_0x2cb6a1['shift']());}};_0x97f446(++_0x189341);}(_0x7326,0x1e3));var _0x6732=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7326[_0x5447fd];return _0x15b28a;};'use strict';var moment=require(_0x6732('0x0'));var Sequelize=require(_0x6732('0x1'));module[_0x6732('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6732('0x3')]},'leaveAt':{'type':Sequelize[_0x6732('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6732('0x3')]},'reason':{'type':Sequelize[_0x6732('0x4')]}};
\ No newline at end of file
+var _0x8c9b=['STRING','DATE','moment','sequelize','exports'];(function(_0x5399f9,_0xf60b21){var _0x514abb=function(_0x293727){while(--_0x293727){_0x5399f9['push'](_0x5399f9['shift']());}};_0x514abb(++_0xf60b21);}(_0x8c9b,0x115));var _0xb8c9=function(_0x4d81e3,_0xe78a19){_0x4d81e3=_0x4d81e3-0x0;var _0x2442c7=_0x8c9b[_0x4d81e3];return _0x2442c7;};'use strict';var moment=require(_0xb8c9('0x0'));var Sequelize=require(_0xb8c9('0x1'));module[_0xb8c9('0x2')]={'uniqueid':{'type':Sequelize[_0xb8c9('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb8c9('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb8c9('0x4')]},'exitAt':{'type':Sequelize[_0xb8c9('0x4')]},'reason':{'type':Sequelize[_0xb8c9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js
index 8e51e57..d95df96 100644
--- a/server/api/smsQueueReport/smsQueueReport.controller.js
+++ b/server/api/smsQueueReport/smsQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','SmsQueueReport','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x5df5e1,_0x3e0305){var _0x2fffd3=function(_0x532a7c){while(--_0x532a7c){_0x5df5e1['push'](_0x5df5e1['shift']());}};_0x2fffd3(++_0x3e0305);}(_0x814b,0x1a2));var _0xb814=function(_0x3d1996,_0x1f08f0){_0x3d1996=_0x3d1996-0x0;var _0x550afd=_0x814b[_0x3d1996];return _0x550afd;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['SmsQueueReport'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['SmsQueueReport'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['SmsQueueReport'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));};
\ No newline at end of file
+var _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','SmsQueueReport','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x4a6362,_0x9e782a){var _0x2653a5=function(_0x52b12b){while(--_0x52b12b){_0x4a6362['push'](_0x4a6362['shift']());}};_0x2653a5(++_0x9e782a);}(_0x814b,0x1a2));var _0xb814=function(_0x5c96eb,_0x5404da){_0x5c96eb=_0x5c96eb-0x0;var _0x4ddbad=_0x814b[_0x5c96eb];return _0x4ddbad;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['SmsQueueReport'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['SmsQueueReport'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['SmsQueueReport'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js
index 4239b7a..5856720 100644
--- a/server/api/smsQueueReport/smsQueueReport.model.js
+++ b/server/api/smsQueueReport/smsQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0000=['path','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3c99b1,_0x5aef54){var _0x4f8a11=function(_0x135a55){while(--_0x135a55){_0x3c99b1['push'](_0x3c99b1['shift']());}};_0x4f8a11(++_0x5aef54);}(_0x0000,0xad));var _0x0000=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0000[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0000('0x0'));var util=require(_0x0000('0x1'));var logger=require(_0x0000('0x2'))(_0x0000('0x3'));var moment=require(_0x0000('0x4'));var BPromise=require(_0x0000('0x5'));var rp=require(_0x0000('0x6'));var fs=require('fs');var path=require(_0x0000('0x7'));var rimraf=require(_0x0000('0x8'));var config=require(_0x0000('0x9'));var attributes=require(_0x0000('0xa'));module['exports']=function(_0x1a4d13,_0x58e52e){return _0x1a4d13[_0x0000('0xb')](_0x0000('0xc'),attributes,{'tableName':_0x0000('0xd'),'paranoid':![],'indexes':[{'name':_0x0000('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x396f=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash'];(function(_0x1dd298,_0x481148){var _0x48ecb9=function(_0x733931){while(--_0x733931){_0x1dd298['push'](_0x1dd298['shift']());}};_0x48ecb9(++_0x481148);}(_0x396f,0x7d));var _0xf396=function(_0x21cf53,_0x1e73f5){_0x21cf53=_0x21cf53-0x0;var _0x3d271a=_0x396f[_0x21cf53];return _0x3d271a;};'use strict';var _=require(_0xf396('0x0'));var util=require(_0xf396('0x1'));var logger=require('../../config/logger')(_0xf396('0x2'));var moment=require('moment');var BPromise=require(_0xf396('0x3'));var rp=require(_0xf396('0x4'));var fs=require('fs');var path=require(_0xf396('0x5'));var rimraf=require(_0xf396('0x6'));var config=require(_0xf396('0x7'));var attributes=require(_0xf396('0x8'));module[_0xf396('0x9')]=function(_0x3b6928,_0x124889){return _0x3b6928[_0xf396('0xa')](_0xf396('0xb'),attributes,{'tableName':_0xf396('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf396('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js
index 99fc9bf..9477499 100644
--- a/server/api/smsQueueReport/smsQueueReport.rpc.js
+++ b/server/api/smsQueueReport/smsQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x64fc=['stringify','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','debug','update','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x1f8335,_0x5ecc10){var _0x2d7e31=function(_0x1ccc5a){while(--_0x1ccc5a){_0x1f8335['push'](_0x1f8335['shift']());}};_0x2d7e31(++_0x5ecc10);}(_0x64fc,0xe9));var _0xc64f=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x64fc[_0x187ee1];return _0x388160;};'use strict';var _=require(_0xc64f('0x0'));var util=require(_0xc64f('0x1'));var moment=require(_0xc64f('0x2'));var BPromise=require(_0xc64f('0x3'));var rs=require(_0xc64f('0x4'));var fs=require('fs');var Redis=require(_0xc64f('0x5'));var db=require(_0xc64f('0x6'))['db'];var utils=require(_0xc64f('0x7'));var logger=require(_0xc64f('0x8'))(_0xc64f('0x9'));var config=require(_0xc64f('0xa'));var jayson=require(_0xc64f('0xb'));var client=jayson[_0xc64f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2892b5,_0x18a4f9,_0x1b6acc){return new BPromise(function(_0xd8e6eb,_0xa4347){return client[_0xc64f('0xd')](_0x2892b5,_0x1b6acc)[_0xc64f('0xe')](function(_0x2ae10b){logger[_0xc64f('0xf')](_0xc64f('0x10'),_0x18a4f9,_0xc64f('0x11'));logger['debug'](_0xc64f('0x12'),_0x18a4f9,_0xc64f('0x11'),JSON[_0xc64f('0x13')](_0x2ae10b));if(_0x2ae10b['error']){if(_0x2ae10b[_0xc64f('0x14')][_0xc64f('0x15')]===0x1f4){logger[_0xc64f('0x14')](_0xc64f('0x10'),_0x18a4f9,_0x2ae10b[_0xc64f('0x14')]['message']);return _0xa4347(_0x2ae10b[_0xc64f('0x14')]['message']);}logger['error'](_0xc64f('0x10'),_0x18a4f9,_0x2ae10b[_0xc64f('0x14')][_0xc64f('0x16')]);return _0xd8e6eb(_0x2ae10b[_0xc64f('0x14')][_0xc64f('0x16')]);}else{logger[_0xc64f('0xf')](_0xc64f('0x10'),_0x18a4f9,_0xc64f('0x11'));_0xd8e6eb(_0x2ae10b['result'][_0xc64f('0x16')]);}})[_0xc64f('0x17')](function(_0x43e3c5){logger[_0xc64f('0x14')](_0xc64f('0x10'),_0x18a4f9,_0x43e3c5);_0xa4347(_0x43e3c5);});});}exports[_0xc64f('0x18')]=function(_0xc26330){var _0x5709fc=this;return new Promise(function(_0x12829e,_0x1eeaf0){return db[_0xc64f('0x19')][_0xc64f('0x1a')](_0xc26330[_0xc64f('0x1b')],{'raw':_0xc26330[_0xc64f('0x1c')]?_0xc26330['options'][_0xc64f('0x1d')]===undefined?!![]:![]:!![]})[_0xc64f('0xe')](function(_0x2a2148){logger[_0xc64f('0xf')](_0xc64f('0x18'),_0xc26330);logger[_0xc64f('0x1e')](_0xc64f('0x18'),_0xc26330,JSON[_0xc64f('0x13')](_0x2a2148));_0x12829e(_0x2a2148);})['catch'](function(_0x272951){logger[_0xc64f('0x14')]('CreateSmsQueueReport',_0x272951['message'],_0xc26330);_0x1eeaf0(_0x5709fc[_0xc64f('0x14')](0x1f4,_0x272951['message']));});});};exports['UpdateSmsQueueReport']=function(_0x1c2fc6){var _0x33df3a=this;return new Promise(function(_0x402b24,_0x77f831){return db[_0xc64f('0x19')][_0xc64f('0x1f')](_0x1c2fc6[_0xc64f('0x1b')],{'raw':_0x1c2fc6[_0xc64f('0x1c')]?_0x1c2fc6[_0xc64f('0x1c')][_0xc64f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c2fc6[_0xc64f('0x1c')]?_0x1c2fc6[_0xc64f('0x1c')][_0xc64f('0x20')]||null:null,'attributes':_0x1c2fc6[_0xc64f('0x1c')]?_0x1c2fc6[_0xc64f('0x1c')][_0xc64f('0x21')]||null:null,'limit':_0x1c2fc6[_0xc64f('0x1c')]?_0x1c2fc6['options'][_0xc64f('0x22')]||null:null})[_0xc64f('0xe')](function(_0x43f8d9){logger[_0xc64f('0xf')](_0xc64f('0x23'),_0x1c2fc6);logger[_0xc64f('0x1e')]('UpdateSmsQueueReport',_0x1c2fc6,JSON[_0xc64f('0x13')](_0x43f8d9));_0x402b24(_0x43f8d9);})[_0xc64f('0x17')](function(_0x159055){logger[_0xc64f('0x14')](_0xc64f('0x23'),_0x159055[_0xc64f('0x16')],_0x1c2fc6);_0x77f831(_0x33df3a['error'](0x1f4,_0x159055['message']));});});};
\ No newline at end of file
+var _0x520a=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsQueueReport','create','body','options','then','CreateSmsQueueReport','catch','UpdateSmsQueueReport','update','raw','where','attributes','limit'];(function(_0x3ccbc7,_0x3093c8){var _0x50c97a=function(_0x4af44d){while(--_0x4af44d){_0x3ccbc7['push'](_0x3ccbc7['shift']());}};_0x50c97a(++_0x3093c8);}(_0x520a,0xe7));var _0xa520=function(_0x570044,_0x3c20a5){_0x570044=_0x570044-0x0;var _0x382a99=_0x520a[_0x570044];return _0x382a99;};'use strict';var _=require(_0xa520('0x0'));var util=require(_0xa520('0x1'));var moment=require('moment');var BPromise=require(_0xa520('0x2'));var rs=require(_0xa520('0x3'));var fs=require('fs');var Redis=require(_0xa520('0x4'));var db=require(_0xa520('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa520('0x6'))(_0xa520('0x7'));var config=require('../../config/environment');var jayson=require(_0xa520('0x8'));var client=jayson[_0xa520('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e69bd,_0x5a9b03,_0x374bdb){return new BPromise(function(_0x560553,_0x58b2be){return client[_0xa520('0xa')](_0x1e69bd,_0x374bdb)['then'](function(_0x329461){logger[_0xa520('0xb')](_0xa520('0xc'),_0x5a9b03,'request\x20sent');logger[_0xa520('0xd')](_0xa520('0xe'),_0x5a9b03,_0xa520('0xf'),JSON[_0xa520('0x10')](_0x329461));if(_0x329461[_0xa520('0x11')]){if(_0x329461[_0xa520('0x11')][_0xa520('0x12')]===0x1f4){logger[_0xa520('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x5a9b03,_0x329461[_0xa520('0x11')][_0xa520('0x13')]);return _0x58b2be(_0x329461['error'][_0xa520('0x13')]);}logger['error'](_0xa520('0xc'),_0x5a9b03,_0x329461[_0xa520('0x11')][_0xa520('0x13')]);return _0x560553(_0x329461['error'][_0xa520('0x13')]);}else{logger['info'](_0xa520('0xc'),_0x5a9b03,_0xa520('0xf'));_0x560553(_0x329461['result']['message']);}})['catch'](function(_0x5849c5){logger[_0xa520('0x11')](_0xa520('0xc'),_0x5a9b03,_0x5849c5);_0x58b2be(_0x5849c5);});});}exports['CreateSmsQueueReport']=function(_0x5b0d5e){var _0x140576=this;return new Promise(function(_0x15e7f9,_0x5a3cd4){return db[_0xa520('0x14')][_0xa520('0x15')](_0x5b0d5e[_0xa520('0x16')],{'raw':_0x5b0d5e[_0xa520('0x17')]?_0x5b0d5e['options']['raw']===undefined?!![]:![]:!![]})[_0xa520('0x18')](function(_0x24beb5){logger[_0xa520('0xb')]('CreateSmsQueueReport',_0x5b0d5e);logger[_0xa520('0xd')](_0xa520('0x19'),_0x5b0d5e,JSON['stringify'](_0x24beb5));_0x15e7f9(_0x24beb5);})[_0xa520('0x1a')](function(_0x4abdde){logger[_0xa520('0x11')]('CreateSmsQueueReport',_0x4abdde[_0xa520('0x13')],_0x5b0d5e);_0x5a3cd4(_0x140576['error'](0x1f4,_0x4abdde[_0xa520('0x13')]));});});};exports[_0xa520('0x1b')]=function(_0x1eae2b){var _0x5b7f0b=this;return new Promise(function(_0x2c8de9,_0x3db0ef){return db['SmsQueueReport'][_0xa520('0x1c')](_0x1eae2b['body'],{'raw':_0x1eae2b[_0xa520('0x17')]?_0x1eae2b[_0xa520('0x17')][_0xa520('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eae2b['options']?_0x1eae2b[_0xa520('0x17')][_0xa520('0x1e')]||null:null,'attributes':_0x1eae2b['options']?_0x1eae2b['options'][_0xa520('0x1f')]||null:null,'limit':_0x1eae2b[_0xa520('0x17')]?_0x1eae2b[_0xa520('0x17')][_0xa520('0x20')]||null:null})[_0xa520('0x18')](function(_0x4067a3){logger[_0xa520('0xb')](_0xa520('0x1b'),_0x1eae2b);logger[_0xa520('0xd')](_0xa520('0x1b'),_0x1eae2b,JSON['stringify'](_0x4067a3));_0x2c8de9(_0x4067a3);})[_0xa520('0x1a')](function(_0x5cdaf4){logger[_0xa520('0x11')](_0xa520('0x1b'),_0x5cdaf4[_0xa520('0x13')],_0x1eae2b);_0x3db0ef(_0x5b7f0b[_0xa520('0x11')](0x1f4,_0x5cdaf4[_0xa520('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js
index 0cbc8d7..cf06a7c 100644
--- a/server/api/smsTransferReport/index.js
+++ b/server/api/smsTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd7d1=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x1beac8,_0xd2736c){_0x1beac8=_0x1beac8-0x0;var _0x2e41d0=_0xd7d1[_0x1beac8];return _0x2e41d0;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var auth=require(_0x1d7d('0x6'));var interaction=require(_0x1d7d('0x7'));var config=require(_0x1d7d('0x8'));var controller=require(_0x1d7d('0x9'));router[_0x1d7d('0xa')]('/',auth[_0x1d7d('0xb')](),controller[_0x1d7d('0xc')]);router['get'](_0x1d7d('0xd'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xa')](_0x1d7d('0xf'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')]('/',auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/:id',auth[_0x1d7d('0xb')](),controller['update']);router[_0x1d7d('0x14')](_0x1d7d('0xf'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x1775=['./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a99e1,_0x5831fe){var _0x10b047=function(_0x450a54){while(--_0x450a54){_0x5a99e1['push'](_0x5a99e1['shift']());}};_0x10b047(++_0x5831fe);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var auth=require(_0x5177('0x5'));var interaction=require(_0x5177('0x6'));var config=require(_0x5177('0x7'));var controller=require(_0x5177('0x8'));router[_0x5177('0x9')]('/',auth[_0x5177('0xa')](),controller[_0x5177('0xb')]);router[_0x5177('0x9')](_0x5177('0xc'),auth[_0x5177('0xa')](),controller[_0x5177('0xd')]);router[_0x5177('0x9')](_0x5177('0xe'),auth[_0x5177('0xa')](),controller[_0x5177('0xf')]);router[_0x5177('0x10')]('/',auth[_0x5177('0xa')](),controller['create']);router['put'](_0x5177('0xe'),auth[_0x5177('0xa')](),controller[_0x5177('0x11')]);router[_0x5177('0x12')](_0x5177('0xe'),auth['isAuthenticated'](),controller[_0x5177('0x13')]);module[_0x5177('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js
index 2e37113..6d6de08 100644
--- a/server/api/smsTransferReport/smsTransferReport.attributes.js
+++ b/server/api/smsTransferReport/smsTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7d2b=['sequelize','exports','STRING','ENUM','account','agent','queue','DATE','moment'];(function(_0x1e63f1,_0xe3c3cc){var _0x5bc880=function(_0x106961){while(--_0x106961){_0x1e63f1['push'](_0x1e63f1['shift']());}};_0x5bc880(++_0xe3c3cc);}(_0x7d2b,0x194));var _0xb7d2=function(_0x1f7d92,_0x4dfc15){_0x1f7d92=_0x1f7d92-0x0;var _0x397aea=_0x7d2b[_0x1f7d92];return _0x397aea;};'use strict';var moment=require(_0xb7d2('0x0'));var Sequelize=require(_0xb7d2('0x1'));module[_0xb7d2('0x2')]={'uniqueid':{'type':Sequelize[_0xb7d2('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb7d2('0x4')](_0xb7d2('0x5'),_0xb7d2('0x6'),_0xb7d2('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb7d2('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x7180=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x5555f8,_0x292686){var _0x23355e=function(_0x1238c2){while(--_0x1238c2){_0x5555f8['push'](_0x5555f8['shift']());}};_0x23355e(++_0x292686);}(_0x7180,0x9b));var _0x0718=function(_0x4ecf81,_0x3e0c9a){_0x4ecf81=_0x4ecf81-0x0;var _0x3f6f46=_0x7180[_0x4ecf81];return _0x3f6f46;};'use strict';var moment=require(_0x0718('0x0'));var Sequelize=require(_0x0718('0x1'));module[_0x0718('0x2')]={'uniqueid':{'type':Sequelize[_0x0718('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0718('0x4')](_0x0718('0x5'),_0x0718('0x6'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x0718('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x0718('0x8')]}};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js
index 607e5da..710ed90 100644
--- a/server/api/smsTransferReport/smsTransferReport.controller.js
+++ b/server/api/smsTransferReport/smsTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SmsTransferReport','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x32eb9c,_0x527a9f){var _0x45864c=function(_0x2c01c5){while(--_0x2c01c5){_0x32eb9c['push'](_0x32eb9c['shift']());}};_0x45864c(++_0x527a9f);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var as=require(_0x49c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x11'))(_0x49c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c4('0x13'))['db'];function respondWithStatusCode(_0x6d1b08,_0x5487cd){_0x5487cd=_0x5487cd||0xcc;return function(_0x7df3a9){if(_0x7df3a9){return _0x6d1b08[_0x49c4('0x14')](_0x5487cd);}return _0x6d1b08['status'](_0x5487cd)[_0x49c4('0x15')]();};}function respondWithResult(_0x280996,_0x21f15a){_0x21f15a=_0x21f15a||0xc8;return function(_0x2decee){if(_0x2decee){return _0x280996[_0x49c4('0x16')](_0x21f15a)[_0x49c4('0x17')](_0x2decee);}};}function respondWithFilteredResult(_0x75ea8,_0x3de397){return function(_0x58d177){if(_0x58d177){var _0x3acd06=_0x58d177[_0x49c4('0x18')],_0x141003=_0x3de397['offset'],_0x13a2db=_0x3de397[_0x49c4('0x19')]+_0x3de397[_0x49c4('0x1a')],_0x81e831;if(_0x13a2db>=_0x3acd06){_0x13a2db=_0x3acd06;_0x81e831=0xc8;}else{_0x81e831=0xce;}_0x75ea8['status'](_0x81e831);return _0x75ea8['set'](_0x49c4('0x1b'),_0x141003+'-'+_0x13a2db+'/'+_0x3acd06)[_0x49c4('0x17')](_0x58d177);}return null;};}function patchUpdates(_0x3addb2){return function(_0x59f29b){try{jsonpatch[_0x49c4('0x1c')](_0x59f29b,_0x3addb2,!![]);}catch(_0x50b151){return BPromise[_0x49c4('0x1d')](_0x50b151);}return _0x59f29b[_0x49c4('0x1e')]();};}function saveUpdates(_0xe31fcc,_0x291526){return function(_0x382040){if(_0x382040){return _0x382040[_0x49c4('0x1f')](_0xe31fcc)[_0x49c4('0x20')](function(_0x46e475){return _0x46e475;});}return null;};}function removeEntity(_0x2197d2,_0x578447){return function(_0x527126){if(_0x527126){return _0x527126['destroy']()[_0x49c4('0x20')](function(){_0x2197d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2263ae,_0x15581b){return function(_0x26c640){if(!_0x26c640){_0x2263ae[_0x49c4('0x14')](0x194);}return _0x26c640;};}function handleError(_0x4811c4,_0x5850f2){_0x5850f2=_0x5850f2||0x1f4;return function(_0x180276){logger[_0x49c4('0x21')](_0x180276['stack']);if(_0x180276[_0x49c4('0x22')]){delete _0x180276[_0x49c4('0x22')];}_0x4811c4[_0x49c4('0x16')](_0x5850f2)[_0x49c4('0x23')](_0x180276);};}exports['index']=function(_0x543ea2,_0x449960){var _0x53c199={},_0x3800b7={},_0x3852b2={'count':0x0,'rows':[]};var _0x3f1708=_[_0x49c4('0x24')](db['SmsTransferReport'][_0x49c4('0x25')],function(_0x2b2793){return{'name':_0x2b2793[_0x49c4('0x26')],'type':_0x2b2793[_0x49c4('0x27')][_0x49c4('0x28')]};});_0x3800b7[_0x49c4('0x29')]=_[_0x49c4('0x24')](_0x3f1708,_0x49c4('0x22'));_0x3800b7[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](_0x543ea2[_0x49c4('0x2a')]);_0x3800b7['filters']=_['intersection'](_0x3800b7['model'],_0x3800b7[_0x49c4('0x2a')]);_0x53c199[_0x49c4('0x2c')]=_[_0x49c4('0x2d')](_0x3800b7[_0x49c4('0x29')],qs[_0x49c4('0x2e')](_0x543ea2['query'][_0x49c4('0x2e')]));_0x53c199[_0x49c4('0x2c')]=_0x53c199[_0x49c4('0x2c')][_0x49c4('0x2f')]?_0x53c199['attributes']:_0x3800b7['model'];if(!_0x543ea2[_0x49c4('0x2a')][_0x49c4('0x30')](_0x49c4('0x31'))){_0x53c199[_0x49c4('0x1a')]=qs[_0x49c4('0x1a')](_0x543ea2['query'][_0x49c4('0x1a')]);_0x53c199[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x543ea2['query']['offset']);}_0x53c199[_0x49c4('0x32')]=qs[_0x49c4('0x33')](_0x543ea2[_0x49c4('0x2a')][_0x49c4('0x33')]);_0x53c199[_0x49c4('0x34')]=qs[_0x49c4('0x35')](_[_0x49c4('0x36')](_0x543ea2[_0x49c4('0x2a')],_0x3800b7[_0x49c4('0x35')]),_0x3f1708);if(_0x543ea2['query'][_0x49c4('0x37')]){_0x53c199['where']=_[_0x49c4('0x38')](_0x53c199[_0x49c4('0x34')],{'$or':_[_0x49c4('0x24')](_0x3f1708,function(_0x1c2830){if(_0x1c2830['type']!==_0x49c4('0x39')){var _0x31f3ff={};_0x31f3ff[_0x1c2830[_0x49c4('0x22')]]={'$like':'%'+_0x543ea2['query'][_0x49c4('0x37')]+'%'};return _0x31f3ff;}})});}_0x53c199=_[_0x49c4('0x38')]({},_0x53c199,_0x543ea2[_0x49c4('0x3a')]);var _0x5e5366={'where':_0x53c199[_0x49c4('0x34')]};return db[_0x49c4('0x3b')][_0x49c4('0x18')](_0x5e5366)[_0x49c4('0x20')](function(_0x70e552){_0x3852b2[_0x49c4('0x18')]=_0x70e552;if(_0x543ea2[_0x49c4('0x2a')]['includeAll']){_0x53c199[_0x49c4('0x3c')]=[{'all':!![]}];}return db[_0x49c4('0x3b')][_0x49c4('0x3d')](_0x53c199);})[_0x49c4('0x20')](function(_0x41ad28){_0x3852b2[_0x49c4('0x3e')]=_0x41ad28;return _0x3852b2;})[_0x49c4('0x20')](respondWithFilteredResult(_0x449960,_0x53c199))[_0x49c4('0x3f')](handleError(_0x449960,null));};exports[_0x49c4('0x40')]=function(_0x2668ed,_0x2dffb4){var _0xa3d59e={'raw':!![],'where':{'id':_0x2668ed['params']['id']}},_0x326142={};_0x326142[_0x49c4('0x29')]=_['keys'](db[_0x49c4('0x3b')][_0x49c4('0x25')]);_0x326142[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](_0x2668ed[_0x49c4('0x2a')]);_0x326142[_0x49c4('0x35')]=_['intersection'](_0x326142['model'],_0x326142[_0x49c4('0x2a')]);_0xa3d59e[_0x49c4('0x2c')]=_[_0x49c4('0x2d')](_0x326142[_0x49c4('0x29')],qs['fields'](_0x2668ed[_0x49c4('0x2a')][_0x49c4('0x2e')]));_0xa3d59e[_0x49c4('0x2c')]=_0xa3d59e[_0x49c4('0x2c')][_0x49c4('0x2f')]?_0xa3d59e[_0x49c4('0x2c')]:_0x326142[_0x49c4('0x29')];if(_0x2668ed[_0x49c4('0x2a')][_0x49c4('0x41')]){_0xa3d59e['include']=[{'all':!![]}];}_0xa3d59e=_[_0x49c4('0x38')]({},_0xa3d59e,_0x2668ed['options']);return db[_0x49c4('0x3b')][_0x49c4('0x42')](_0xa3d59e)[_0x49c4('0x20')](handleEntityNotFound(_0x2dffb4,null))[_0x49c4('0x20')](respondWithResult(_0x2dffb4,null))[_0x49c4('0x3f')](handleError(_0x2dffb4,null));};exports['create']=function(_0x592e8e,_0x15b674){return db[_0x49c4('0x3b')][_0x49c4('0x43')](_0x592e8e[_0x49c4('0x44')],{})[_0x49c4('0x20')](respondWithResult(_0x15b674,0xc9))[_0x49c4('0x3f')](handleError(_0x15b674,null));};exports['update']=function(_0x3bac1b,_0x5cfff9){if(_0x3bac1b[_0x49c4('0x44')]['id']){delete _0x3bac1b[_0x49c4('0x44')]['id'];}return db[_0x49c4('0x3b')][_0x49c4('0x42')]({'where':{'id':_0x3bac1b[_0x49c4('0x45')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x5cfff9,null))[_0x49c4('0x20')](saveUpdates(_0x3bac1b['body'],null))[_0x49c4('0x20')](respondWithResult(_0x5cfff9,null))[_0x49c4('0x3f')](handleError(_0x5cfff9,null));};exports['destroy']=function(_0x1e1ac4,_0xaece5f){return db[_0x49c4('0x3b')][_0x49c4('0x42')]({'where':{'id':_0x1e1ac4['params']['id']}})['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x20')](removeEntity(_0xaece5f,null))['catch'](handleError(_0xaece5f,null));};exports[_0x49c4('0x46')]=function(_0x1f941f,_0x3811b2){return db[_0x49c4('0x3b')][_0x49c4('0x46')]()[_0x49c4('0x20')](respondWithResult(_0x3811b2,null))[_0x49c4('0x3f')](handleError(_0x3811b2,null));};
\ No newline at end of file
+var _0x9c44=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SmsTransferReport','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x2f6fe8,_0x137519){var _0x31b95f=function(_0x5d43bd){while(--_0x5d43bd){_0x2f6fe8['push'](_0x2f6fe8['shift']());}};_0x31b95f(++_0x137519);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var as=require(_0x49c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x11'))(_0x49c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c4('0x13'))['db'];function respondWithStatusCode(_0x6d1b08,_0x5487cd){_0x5487cd=_0x5487cd||0xcc;return function(_0x7df3a9){if(_0x7df3a9){return _0x6d1b08[_0x49c4('0x14')](_0x5487cd);}return _0x6d1b08['status'](_0x5487cd)[_0x49c4('0x15')]();};}function respondWithResult(_0x280996,_0x21f15a){_0x21f15a=_0x21f15a||0xc8;return function(_0x2decee){if(_0x2decee){return _0x280996[_0x49c4('0x16')](_0x21f15a)[_0x49c4('0x17')](_0x2decee);}};}function respondWithFilteredResult(_0x75ea8,_0x3de397){return function(_0x58d177){if(_0x58d177){var _0x3acd06=_0x58d177[_0x49c4('0x18')],_0x141003=_0x3de397['offset'],_0x13a2db=_0x3de397[_0x49c4('0x19')]+_0x3de397[_0x49c4('0x1a')],_0x81e831;if(_0x13a2db>=_0x3acd06){_0x13a2db=_0x3acd06;_0x81e831=0xc8;}else{_0x81e831=0xce;}_0x75ea8['status'](_0x81e831);return _0x75ea8['set'](_0x49c4('0x1b'),_0x141003+'-'+_0x13a2db+'/'+_0x3acd06)[_0x49c4('0x17')](_0x58d177);}return null;};}function patchUpdates(_0x3addb2){return function(_0x59f29b){try{jsonpatch[_0x49c4('0x1c')](_0x59f29b,_0x3addb2,!![]);}catch(_0x50b151){return BPromise[_0x49c4('0x1d')](_0x50b151);}return _0x59f29b[_0x49c4('0x1e')]();};}function saveUpdates(_0xe31fcc,_0x291526){return function(_0x382040){if(_0x382040){return _0x382040[_0x49c4('0x1f')](_0xe31fcc)[_0x49c4('0x20')](function(_0x46e475){return _0x46e475;});}return null;};}function removeEntity(_0x2197d2,_0x578447){return function(_0x527126){if(_0x527126){return _0x527126['destroy']()[_0x49c4('0x20')](function(){_0x2197d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2263ae,_0x15581b){return function(_0x26c640){if(!_0x26c640){_0x2263ae[_0x49c4('0x14')](0x194);}return _0x26c640;};}function handleError(_0x4811c4,_0x5850f2){_0x5850f2=_0x5850f2||0x1f4;return function(_0x180276){logger[_0x49c4('0x21')](_0x180276['stack']);if(_0x180276[_0x49c4('0x22')]){delete _0x180276[_0x49c4('0x22')];}_0x4811c4[_0x49c4('0x16')](_0x5850f2)[_0x49c4('0x23')](_0x180276);};}exports['index']=function(_0x543ea2,_0x449960){var _0x53c199={},_0x3800b7={},_0x3852b2={'count':0x0,'rows':[]};var _0x3f1708=_[_0x49c4('0x24')](db['SmsTransferReport'][_0x49c4('0x25')],function(_0x2b2793){return{'name':_0x2b2793[_0x49c4('0x26')],'type':_0x2b2793[_0x49c4('0x27')][_0x49c4('0x28')]};});_0x3800b7[_0x49c4('0x29')]=_[_0x49c4('0x24')](_0x3f1708,_0x49c4('0x22'));_0x3800b7[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](_0x543ea2[_0x49c4('0x2a')]);_0x3800b7['filters']=_['intersection'](_0x3800b7['model'],_0x3800b7[_0x49c4('0x2a')]);_0x53c199[_0x49c4('0x2c')]=_[_0x49c4('0x2d')](_0x3800b7[_0x49c4('0x29')],qs[_0x49c4('0x2e')](_0x543ea2['query'][_0x49c4('0x2e')]));_0x53c199[_0x49c4('0x2c')]=_0x53c199[_0x49c4('0x2c')][_0x49c4('0x2f')]?_0x53c199['attributes']:_0x3800b7['model'];if(!_0x543ea2[_0x49c4('0x2a')][_0x49c4('0x30')](_0x49c4('0x31'))){_0x53c199[_0x49c4('0x1a')]=qs[_0x49c4('0x1a')](_0x543ea2['query'][_0x49c4('0x1a')]);_0x53c199[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x543ea2['query']['offset']);}_0x53c199[_0x49c4('0x32')]=qs[_0x49c4('0x33')](_0x543ea2[_0x49c4('0x2a')][_0x49c4('0x33')]);_0x53c199[_0x49c4('0x34')]=qs[_0x49c4('0x35')](_[_0x49c4('0x36')](_0x543ea2[_0x49c4('0x2a')],_0x3800b7[_0x49c4('0x35')]),_0x3f1708);if(_0x543ea2['query'][_0x49c4('0x37')]){_0x53c199['where']=_[_0x49c4('0x38')](_0x53c199[_0x49c4('0x34')],{'$or':_[_0x49c4('0x24')](_0x3f1708,function(_0x1c2830){if(_0x1c2830['type']!==_0x49c4('0x39')){var _0x31f3ff={};_0x31f3ff[_0x1c2830[_0x49c4('0x22')]]={'$like':'%'+_0x543ea2['query'][_0x49c4('0x37')]+'%'};return _0x31f3ff;}})});}_0x53c199=_[_0x49c4('0x38')]({},_0x53c199,_0x543ea2[_0x49c4('0x3a')]);var _0x5e5366={'where':_0x53c199[_0x49c4('0x34')]};return db[_0x49c4('0x3b')][_0x49c4('0x18')](_0x5e5366)[_0x49c4('0x20')](function(_0x70e552){_0x3852b2[_0x49c4('0x18')]=_0x70e552;if(_0x543ea2[_0x49c4('0x2a')]['includeAll']){_0x53c199[_0x49c4('0x3c')]=[{'all':!![]}];}return db[_0x49c4('0x3b')][_0x49c4('0x3d')](_0x53c199);})[_0x49c4('0x20')](function(_0x41ad28){_0x3852b2[_0x49c4('0x3e')]=_0x41ad28;return _0x3852b2;})[_0x49c4('0x20')](respondWithFilteredResult(_0x449960,_0x53c199))[_0x49c4('0x3f')](handleError(_0x449960,null));};exports[_0x49c4('0x40')]=function(_0x2668ed,_0x2dffb4){var _0xa3d59e={'raw':!![],'where':{'id':_0x2668ed['params']['id']}},_0x326142={};_0x326142[_0x49c4('0x29')]=_['keys'](db[_0x49c4('0x3b')][_0x49c4('0x25')]);_0x326142[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](_0x2668ed[_0x49c4('0x2a')]);_0x326142[_0x49c4('0x35')]=_['intersection'](_0x326142['model'],_0x326142[_0x49c4('0x2a')]);_0xa3d59e[_0x49c4('0x2c')]=_[_0x49c4('0x2d')](_0x326142[_0x49c4('0x29')],qs['fields'](_0x2668ed[_0x49c4('0x2a')][_0x49c4('0x2e')]));_0xa3d59e[_0x49c4('0x2c')]=_0xa3d59e[_0x49c4('0x2c')][_0x49c4('0x2f')]?_0xa3d59e[_0x49c4('0x2c')]:_0x326142[_0x49c4('0x29')];if(_0x2668ed[_0x49c4('0x2a')][_0x49c4('0x41')]){_0xa3d59e['include']=[{'all':!![]}];}_0xa3d59e=_[_0x49c4('0x38')]({},_0xa3d59e,_0x2668ed['options']);return db[_0x49c4('0x3b')][_0x49c4('0x42')](_0xa3d59e)[_0x49c4('0x20')](handleEntityNotFound(_0x2dffb4,null))[_0x49c4('0x20')](respondWithResult(_0x2dffb4,null))[_0x49c4('0x3f')](handleError(_0x2dffb4,null));};exports['create']=function(_0x592e8e,_0x15b674){return db[_0x49c4('0x3b')][_0x49c4('0x43')](_0x592e8e[_0x49c4('0x44')],{})[_0x49c4('0x20')](respondWithResult(_0x15b674,0xc9))[_0x49c4('0x3f')](handleError(_0x15b674,null));};exports['update']=function(_0x3bac1b,_0x5cfff9){if(_0x3bac1b[_0x49c4('0x44')]['id']){delete _0x3bac1b[_0x49c4('0x44')]['id'];}return db[_0x49c4('0x3b')][_0x49c4('0x42')]({'where':{'id':_0x3bac1b[_0x49c4('0x45')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x5cfff9,null))[_0x49c4('0x20')](saveUpdates(_0x3bac1b['body'],null))[_0x49c4('0x20')](respondWithResult(_0x5cfff9,null))[_0x49c4('0x3f')](handleError(_0x5cfff9,null));};exports['destroy']=function(_0x1e1ac4,_0xaece5f){return db[_0x49c4('0x3b')][_0x49c4('0x42')]({'where':{'id':_0x1e1ac4['params']['id']}})['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x20')](removeEntity(_0xaece5f,null))['catch'](handleError(_0xaece5f,null));};exports[_0x49c4('0x46')]=function(_0x1f941f,_0x3811b2){return db[_0x49c4('0x3b')][_0x49c4('0x46')]()[_0x49c4('0x20')](respondWithResult(_0x3811b2,null))[_0x49c4('0x3f')](handleError(_0x3811b2,null));};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js
index a397f3f..7e0d7ac 100644
--- a/server/api/smsTransferReport/smsTransferReport.model.js
+++ b/server/api/smsTransferReport/smsTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd65e=['SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd65e,0x91));var _0xed65=function(_0x32fef5,_0x16b595){_0x32fef5=_0x32fef5-0x0;var _0x2a6980=_0xd65e[_0x32fef5];return _0x2a6980;};'use strict';var _=require(_0xed65('0x0'));var util=require(_0xed65('0x1'));var logger=require(_0xed65('0x2'))(_0xed65('0x3'));var moment=require(_0xed65('0x4'));var BPromise=require(_0xed65('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xed65('0x6'));var config=require(_0xed65('0x7'));var attributes=require(_0xed65('0x8'));module['exports']=function(_0x109571,_0x3dd68f){return _0x109571['define'](_0xed65('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xed65('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xce35=['path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2b4bae,_0xf2ad5d){var _0x4b73c9=function(_0x294f34){while(--_0x294f34){_0x2b4bae['push'](_0x2b4bae['shift']());}};_0x4b73c9(++_0xf2ad5d);}(_0xce35,0xb0));var _0x5ce3=function(_0x394f71,_0x3f85fe){_0x394f71=_0x394f71-0x0;var _0x490d2c=_0xce35[_0x394f71];return _0x490d2c;};'use strict';var _=require('lodash');var util=require(_0x5ce3('0x0'));var logger=require(_0x5ce3('0x1'))(_0x5ce3('0x2'));var moment=require(_0x5ce3('0x3'));var BPromise=require(_0x5ce3('0x4'));var rp=require(_0x5ce3('0x5'));var fs=require('fs');var path=require(_0x5ce3('0x6'));var rimraf=require(_0x5ce3('0x7'));var config=require(_0x5ce3('0x8'));var attributes=require(_0x5ce3('0x9'));module['exports']=function(_0x1ec5d2,_0x336cad){return _0x1ec5d2[_0x5ce3('0xa')](_0x5ce3('0xb'),attributes,{'tableName':_0x5ce3('0xc'),'paranoid':![],'indexes':[{'name':_0x5ce3('0xd'),'fields':[_0x5ce3('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js
index 6a661d6..0bcaa27 100644
--- a/server/api/smsTransferReport/smsTransferReport.rpc.js
+++ b/server/api/smsTransferReport/smsTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2bdb=['jayson/promise','client','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x56c351,_0x19e28e){var _0x57d687=function(_0x37a13f){while(--_0x37a13f){_0x56c351['push'](_0x56c351['shift']());}};_0x57d687(++_0x19e28e);}(_0x2bdb,0x6f));var _0xb2bd=function(_0x549829,_0x3b5bd5){_0x549829=_0x549829-0x0;var _0x554e92=_0x2bdb[_0x549829];return _0x554e92;};'use strict';var _=require(_0xb2bd('0x0'));var util=require(_0xb2bd('0x1'));var moment=require(_0xb2bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xb2bd('0x3'));var fs=require('fs');var Redis=require(_0xb2bd('0x4'));var db=require(_0xb2bd('0x5'))['db'];var utils=require(_0xb2bd('0x6'));var logger=require('../../config/logger')(_0xb2bd('0x7'));var config=require(_0xb2bd('0x8'));var jayson=require(_0xb2bd('0x9'));var client=jayson[_0xb2bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b3cab,_0x9aaed4,_0x3e8b6a){return new BPromise(function(_0x4429ea,_0x22628d){return client[_0xb2bd('0xb')](_0x3b3cab,_0x3e8b6a)['then'](function(_0x5a6e8b){logger[_0xb2bd('0xc')](_0xb2bd('0xd'),_0x9aaed4,_0xb2bd('0xe'));logger[_0xb2bd('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x9aaed4,_0xb2bd('0xe'),JSON['stringify'](_0x5a6e8b));if(_0x5a6e8b[_0xb2bd('0x10')]){if(_0x5a6e8b['error'][_0xb2bd('0x11')]===0x1f4){logger['error'](_0xb2bd('0xd'),_0x9aaed4,_0x5a6e8b[_0xb2bd('0x10')]['message']);return _0x22628d(_0x5a6e8b[_0xb2bd('0x10')][_0xb2bd('0x12')]);}logger[_0xb2bd('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x9aaed4,_0x5a6e8b[_0xb2bd('0x10')][_0xb2bd('0x12')]);return _0x4429ea(_0x5a6e8b[_0xb2bd('0x10')][_0xb2bd('0x12')]);}else{logger['info'](_0xb2bd('0xd'),_0x9aaed4,_0xb2bd('0xe'));_0x4429ea(_0x5a6e8b[_0xb2bd('0x13')][_0xb2bd('0x12')]);}})['catch'](function(_0x547e87){logger[_0xb2bd('0x10')](_0xb2bd('0xd'),_0x9aaed4,_0x547e87);_0x22628d(_0x547e87);});});}
\ No newline at end of file
+var _0xfbee=['request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x5c1e49,_0x234aa8){var _0x3d98f5=function(_0x2e3539){while(--_0x2e3539){_0x5c1e49['push'](_0x5c1e49['shift']());}};_0x3d98f5(++_0x234aa8);}(_0xfbee,0x1cf));var _0xefbe=function(_0xf9915a,_0xb99b97){_0xf9915a=_0xf9915a-0x0;var _0x5b7fda=_0xfbee[_0xf9915a];return _0x5b7fda;};'use strict';var _=require('lodash');var util=require(_0xefbe('0x0'));var moment=require(_0xefbe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefbe('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefbe('0x3'))(_0xefbe('0x4'));var config=require(_0xefbe('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xefbe('0x6')][_0xefbe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13d454,_0x3fdd50,_0x182d13){return new BPromise(function(_0x492879,_0x446c17){return client[_0xefbe('0x8')](_0x13d454,_0x182d13)[_0xefbe('0x9')](function(_0x4528f9){logger[_0xefbe('0xa')](_0xefbe('0xb'),_0x3fdd50,_0xefbe('0xc'));logger['debug'](_0xefbe('0xd'),_0x3fdd50,_0xefbe('0xc'),JSON[_0xefbe('0xe')](_0x4528f9));if(_0x4528f9[_0xefbe('0xf')]){if(_0x4528f9['error']['code']===0x1f4){logger['error'](_0xefbe('0xb'),_0x3fdd50,_0x4528f9['error']['message']);return _0x446c17(_0x4528f9[_0xefbe('0xf')][_0xefbe('0x10')]);}logger['error'](_0xefbe('0xb'),_0x3fdd50,_0x4528f9[_0xefbe('0xf')][_0xefbe('0x10')]);return _0x492879(_0x4528f9['error'][_0xefbe('0x10')]);}else{logger[_0xefbe('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x3fdd50,'request\x20sent');_0x492879(_0x4528f9[_0xefbe('0x11')][_0xefbe('0x10')]);}})[_0xefbe('0x12')](function(_0x50444d){logger[_0xefbe('0xf')](_0xefbe('0xb'),_0x3fdd50,_0x50444d);_0x446c17(_0x50444d);});});}
\ No newline at end of file
diff --git a/server/api/sound/index.js b/server/api/sound/index.js
index 8b81296..07a15db 100644
--- a/server/api/sound/index.js
+++ b/server/api/sound/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb5c=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','create','put','update'];(function(_0x5d1a48,_0x2837b9){var _0x46c88e=function(_0x245c9e){while(--_0x245c9e){_0x5d1a48['push'](_0x5d1a48['shift']());}};_0x46c88e(++_0x2837b9);}(_0xcb5c,0x137));var _0xccb5=function(_0x12341e,_0x2830e1){_0x12341e=_0x12341e-0x0;var _0x51d848=_0xcb5c[_0x12341e];return _0x51d848;};'use strict';var multer=require(_0xccb5('0x0'));var util=require(_0xccb5('0x1'));var path=require(_0xccb5('0x2'));var timeout=require(_0xccb5('0x3'));var express=require(_0xccb5('0x4'));var router=express[_0xccb5('0x5')]();var auth=require(_0xccb5('0x6'));var interaction=require(_0xccb5('0x7'));var config=require('../../config/environment');var controller=require(_0xccb5('0x8'));router[_0xccb5('0x9')]('/',auth[_0xccb5('0xa')](),controller['index']);router[_0xccb5('0x9')](_0xccb5('0xb'),auth[_0xccb5('0xa')](),controller[_0xccb5('0xc')]);router[_0xccb5('0x9')](_0xccb5('0xd'),auth[_0xccb5('0xa')](),controller[_0xccb5('0xe')]);var upload=multer({'storage':multer[_0xccb5('0xf')]({'destination':function(_0x48d5f5,_0x3b3053,_0x6080ed){_0x6080ed(null,path[_0xccb5('0x10')](config['root'],_0xccb5('0x11')));},'filename':function(_0x497a12,_0x57ae2f,_0x273c45){_0x57ae2f[_0xccb5('0x12')]=_0x57ae2f[_0xccb5('0x12')][_0xccb5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x273c45(null,util[_0xccb5('0x14')](_0xccb5('0x15'),path[_0xccb5('0x16')](_0x57ae2f[_0xccb5('0x12')],path[_0xccb5('0x17')](_0x57ae2f[_0xccb5('0x12')])),Date[_0xccb5('0x18')](),path['extname'](_0x57ae2f[_0xccb5('0x12')])));}})});router['post']('/',upload[_0xccb5('0x19')](_0xccb5('0x1a')),controller[_0xccb5('0x1b')]);router[_0xccb5('0x1c')](_0xccb5('0xb'),auth[_0xccb5('0xa')](),controller[_0xccb5('0x1d')]);router['delete']('/:id',auth[_0xccb5('0xa')](),controller['delete']);module[_0xccb5('0x1e')]=router;
\ No newline at end of file
+var _0x0d38=['create','put','delete','util','path','express','Router','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','now','post','single'];(function(_0x37f9fa,_0x4acb2d){var _0x3e4ffe=function(_0x802327){while(--_0x802327){_0x37f9fa['push'](_0x37f9fa['shift']());}};_0x3e4ffe(++_0x4acb2d);}(_0x0d38,0x9f));var _0x80d3=function(_0x2cb435,_0x511a17){_0x2cb435=_0x2cb435-0x0;var _0x3b4ea0=_0x0d38[_0x2cb435];return _0x3b4ea0;};'use strict';var multer=require('multer');var util=require(_0x80d3('0x0'));var path=require(_0x80d3('0x1'));var timeout=require('connect-timeout');var express=require(_0x80d3('0x2'));var router=express[_0x80d3('0x3')]();var auth=require(_0x80d3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x80d3('0x5')]('/',auth['isAuthenticated'](),controller[_0x80d3('0x6')]);router[_0x80d3('0x5')](_0x80d3('0x7'),auth[_0x80d3('0x8')](),controller[_0x80d3('0x9')]);router[_0x80d3('0x5')](_0x80d3('0xa'),auth['isAuthenticated'](),controller[_0x80d3('0xb')]);var upload=multer({'storage':multer[_0x80d3('0xc')]({'destination':function(_0x43f9cb,_0x50bae4,_0x4231bb){_0x4231bb(null,path[_0x80d3('0xd')](config[_0x80d3('0xe')],'server/files/sounds/original/'));},'filename':function(_0x1f210f,_0x15d712,_0x27e01c){_0x15d712[_0x80d3('0xf')]=_0x15d712[_0x80d3('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x27e01c(null,util[_0x80d3('0x10')](_0x80d3('0x11'),path[_0x80d3('0x12')](_0x15d712[_0x80d3('0xf')],path[_0x80d3('0x13')](_0x15d712['originalname'])),Date[_0x80d3('0x14')](),path[_0x80d3('0x13')](_0x15d712[_0x80d3('0xf')])));}})});router[_0x80d3('0x15')]('/',upload[_0x80d3('0x16')]('file'),controller[_0x80d3('0x17')]);router[_0x80d3('0x18')](_0x80d3('0x7'),auth[_0x80d3('0x8')](),controller['update']);router[_0x80d3('0x19')]('/:id',auth['isAuthenticated'](),controller['delete']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js
index 2cfe1a6..5337775 100644
--- a/server/api/sound/sound.attributes.js
+++ b/server/api/sound/sound.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc6c=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xbc6c,0x1df));var _0xcbc6=function(_0x334259,_0x190ab9){_0x334259=_0x334259-0x0;var _0x5940ed=_0xbc6c[_0x334259];return _0x5940ed;};'use strict';var Sequelize=require(_0xcbc6('0x0'));module[_0xcbc6('0x1')]={'name':{'type':Sequelize[_0xcbc6('0x2')],'unique':_0xcbc6('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xcbc6('0x2')]},'display_name':{'type':Sequelize[_0xcbc6('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xcbc6('0x2')]},'original_format':{'type':Sequelize[_0xcbc6('0x2')]},'original_duration':{'type':Sequelize[_0xcbc6('0x4')]},'original_sampleCount':{'type':Sequelize[_0xcbc6('0x5')]},'original_channelCount':{'type':Sequelize[_0xcbc6('0x6')]},'original_bitRate':{'type':Sequelize[_0xcbc6('0x5')]},'original_sampleRate':{'type':Sequelize[_0xcbc6('0x6')]},'converted_format':{'type':Sequelize[_0xcbc6('0x2')]},'converted_duration':{'type':Sequelize[_0xcbc6('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xcbc6('0x5')]},'converted_channelCount':{'type':Sequelize[_0xcbc6('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xcbc6('0x6')]}};
\ No newline at end of file
+var _0x5c7d=['INTEGER','FLOAT','BIGINT','exports','name','STRING'];(function(_0x1e3373,_0x371278){var _0x462fd5=function(_0xeb9815){while(--_0xeb9815){_0x1e3373['push'](_0x1e3373['shift']());}};_0x462fd5(++_0x371278);}(_0x5c7d,0x135));var _0xd5c7=function(_0x447785,_0xf6b3b9){_0x447785=_0x447785-0x0;var _0x1693f6=_0x5c7d[_0x447785];return _0x1693f6;};'use strict';var Sequelize=require('sequelize');module[_0xd5c7('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd5c7('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd5c7('0x2')]},'display_name':{'type':Sequelize[_0xd5c7('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xd5c7('0x2')]},'original_format':{'type':Sequelize[_0xd5c7('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xd5c7('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xd5c7('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xd5c7('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xd5c7('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xd5c7('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xd5c7('0x3')]}};
\ No newline at end of file
diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js
index 62601e0..e9dd511 100644
--- a/server/api/sound/sound.controller.js
+++ b/server/api/sound/sound.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb701=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Sound','count','include','findAll','show','find','catch','download','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','chmodSync','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','delete','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Sounds','UserProfileResource','then','error','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xb701,0x1c6));var _0x1b70=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xb701[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0x1b70('0x0'));var emlformat=require(_0x1b70('0x1'));var rimraf=require(_0x1b70('0x2'));var zipdir=require(_0x1b70('0x3'));var jsonpatch=require(_0x1b70('0x4'));var rp=require(_0x1b70('0x5'));var moment=require(_0x1b70('0x6'));var BPromise=require(_0x1b70('0x7'));var Mustache=require(_0x1b70('0x8'));var util=require(_0x1b70('0x9'));var path=require(_0x1b70('0xa'));var sox=require('sox');var csv=require(_0x1b70('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1b70('0xc'));var crypto=require(_0x1b70('0xd'));var jsforce=require(_0x1b70('0xe'));var deskjs=require(_0x1b70('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1b70('0x10'));var Papa=require(_0x1b70('0x11'));var Redis=require(_0x1b70('0x12'));var authService=require(_0x1b70('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1b70('0x14'));var hardwareService=require(_0x1b70('0x15'));var logger=require('../../config/logger')(_0x1b70('0x16'));var utils=require(_0x1b70('0x17'));var config=require(_0x1b70('0x18'));var db=require(_0x1b70('0x19'))['db'];function respondWithStatusCode(_0x2cee82,_0x252222){_0x252222=_0x252222||0xcc;return function(_0x3c78b2){if(_0x3c78b2){return _0x2cee82[_0x1b70('0x1a')](_0x252222);}return _0x2cee82[_0x1b70('0x1b')](_0x252222)[_0x1b70('0x1c')]();};}function respondWithResult(_0x13c413,_0x475932){_0x475932=_0x475932||0xc8;return function(_0x572972){if(_0x572972){return _0x13c413[_0x1b70('0x1b')](_0x475932)[_0x1b70('0x1d')](_0x572972);}};}function respondWithFilteredResult(_0xe386c8,_0x847339){return function(_0x401c01){if(_0x401c01){var _0x291622=_0x401c01['count'],_0x4f90d5=_0x847339['offset'],_0x3b3b39=_0x847339[_0x1b70('0x1e')]+_0x847339[_0x1b70('0x1f')],_0x38f301;if(_0x3b3b39>=_0x291622){_0x3b3b39=_0x291622;_0x38f301=0xc8;}else{_0x38f301=0xce;}_0xe386c8[_0x1b70('0x1b')](_0x38f301);return _0xe386c8[_0x1b70('0x20')](_0x1b70('0x21'),_0x4f90d5+'-'+_0x3b3b39+'/'+_0x291622)[_0x1b70('0x1d')](_0x401c01);}return null;};}function patchUpdates(_0x55cf73){return function(_0x40c271){try{jsonpatch[_0x1b70('0x22')](_0x40c271,_0x55cf73,!![]);}catch(_0x35e6d5){return BPromise[_0x1b70('0x23')](_0x35e6d5);}return _0x40c271[_0x1b70('0x24')]();};}function saveUpdates(_0x25d282,_0x20a64c){return function(_0x4261d5){if(_0x4261d5){return _0x4261d5['update'](_0x25d282)['then'](function(_0x57abe2){return _0x57abe2;});}return null;};}function removeEntity(_0x2b1e08,_0x522256){return function(_0x595802){if(_0x595802){return _0x595802[_0x1b70('0x25')]()['then'](function(){var _0x415cb2=_0x595802[_0x1b70('0x26')]({'plain':!![]});var _0x1fecea=_0x1b70('0x27');return db[_0x1b70('0x28')][_0x1b70('0x25')]({'where':{'type':_0x1fecea,'resourceId':_0x415cb2['id']}})[_0x1b70('0x29')](function(){return _0x595802;});})['then'](function(){_0x2b1e08['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c0e70,_0x5f5120){return function(_0x557ae8){if(!_0x557ae8){_0x4c0e70[_0x1b70('0x1a')](0x194);}return _0x557ae8;};}function handleError(_0x35c340,_0xc63698){_0xc63698=_0xc63698||0x1f4;return function(_0x43d8e6){logger[_0x1b70('0x2a')](_0x43d8e6['stack']);if(_0x43d8e6[_0x1b70('0x2b')]){delete _0x43d8e6[_0x1b70('0x2b')];}_0x35c340[_0x1b70('0x1b')](_0xc63698)[_0x1b70('0x2c')](_0x43d8e6);};}exports[_0x1b70('0x2d')]=function(_0x5bf6fb,_0x3b74f6){var _0x42e9bc={},_0xe46b7={},_0x592d28={'count':0x0,'rows':[]};var _0x6f6ef6=_[_0x1b70('0x2e')](db['Sound'][_0x1b70('0x2f')],function(_0x14cb63){return{'name':_0x14cb63[_0x1b70('0x30')],'type':_0x14cb63[_0x1b70('0x31')][_0x1b70('0x32')]};});_0xe46b7[_0x1b70('0x33')]=_['map'](_0x6f6ef6,_0x1b70('0x2b'));_0xe46b7[_0x1b70('0x34')]=_[_0x1b70('0x35')](_0x5bf6fb[_0x1b70('0x34')]);_0xe46b7[_0x1b70('0x36')]=_[_0x1b70('0x37')](_0xe46b7[_0x1b70('0x33')],_0xe46b7['query']);_0x42e9bc[_0x1b70('0x38')]=_[_0x1b70('0x37')](_0xe46b7[_0x1b70('0x33')],qs[_0x1b70('0x39')](_0x5bf6fb[_0x1b70('0x34')]['fields']));_0x42e9bc[_0x1b70('0x38')]=_0x42e9bc[_0x1b70('0x38')][_0x1b70('0x3a')]?_0x42e9bc[_0x1b70('0x38')]:_0xe46b7[_0x1b70('0x33')];if(!_0x5bf6fb['query'][_0x1b70('0x3b')](_0x1b70('0x3c'))){_0x42e9bc[_0x1b70('0x1f')]=qs[_0x1b70('0x1f')](_0x5bf6fb[_0x1b70('0x34')][_0x1b70('0x1f')]);_0x42e9bc['offset']=qs[_0x1b70('0x1e')](_0x5bf6fb['query']['offset']);}_0x42e9bc[_0x1b70('0x3d')]=qs[_0x1b70('0x3e')](_0x5bf6fb[_0x1b70('0x34')][_0x1b70('0x3e')]);_0x42e9bc[_0x1b70('0x3f')]=qs[_0x1b70('0x36')](_[_0x1b70('0x40')](_0x5bf6fb['query'],_0xe46b7['filters']),_0x6f6ef6);if(_0x5bf6fb[_0x1b70('0x34')]['filter']){_0x42e9bc[_0x1b70('0x3f')]=_[_0x1b70('0x41')](_0x42e9bc[_0x1b70('0x3f')],{'$or':_['map'](_0x6f6ef6,function(_0x3b3fad){if(_0x3b3fad[_0x1b70('0x31')]!==_0x1b70('0x42')){var _0x12cb30={};_0x12cb30[_0x3b3fad[_0x1b70('0x2b')]]={'$like':'%'+_0x5bf6fb['query'][_0x1b70('0x43')]+'%'};return _0x12cb30;}})});}_0x42e9bc=_[_0x1b70('0x41')]({},_0x42e9bc,_0x5bf6fb[_0x1b70('0x44')]);var _0x2b5daf={'where':_0x42e9bc[_0x1b70('0x3f')]};return db[_0x1b70('0x45')]['count'](_0x2b5daf)['then'](function(_0x1c166e){_0x592d28[_0x1b70('0x46')]=_0x1c166e;if(_0x5bf6fb[_0x1b70('0x34')]['includeAll']){_0x42e9bc[_0x1b70('0x47')]=[{'all':!![]}];}return db[_0x1b70('0x45')][_0x1b70('0x48')](_0x42e9bc);})[_0x1b70('0x29')](function(_0x274bb4){_0x592d28['rows']=_0x274bb4;return _0x592d28;})[_0x1b70('0x29')](respondWithFilteredResult(_0x3b74f6,_0x42e9bc))['catch'](handleError(_0x3b74f6,null));};exports[_0x1b70('0x49')]=function(_0xa4c06e,_0x33c79f){var _0xa2ea47={'raw':!![],'where':{'id':_0xa4c06e['params']['id']}},_0x5a88b8={};_0x5a88b8[_0x1b70('0x33')]=_[_0x1b70('0x35')](db[_0x1b70('0x45')]['rawAttributes']);_0x5a88b8[_0x1b70('0x34')]=_[_0x1b70('0x35')](_0xa4c06e[_0x1b70('0x34')]);_0x5a88b8['filters']=_[_0x1b70('0x37')](_0x5a88b8[_0x1b70('0x33')],_0x5a88b8[_0x1b70('0x34')]);_0xa2ea47[_0x1b70('0x38')]=_[_0x1b70('0x37')](_0x5a88b8[_0x1b70('0x33')],qs[_0x1b70('0x39')](_0xa4c06e[_0x1b70('0x34')]['fields']));_0xa2ea47[_0x1b70('0x38')]=_0xa2ea47[_0x1b70('0x38')]['length']?_0xa2ea47['attributes']:_0x5a88b8['model'];if(_0xa4c06e['query']['includeAll']){_0xa2ea47[_0x1b70('0x47')]=[{'all':!![]}];}_0xa2ea47=_[_0x1b70('0x41')]({},_0xa2ea47,_0xa4c06e[_0x1b70('0x44')]);return db[_0x1b70('0x45')][_0x1b70('0x4a')](_0xa2ea47)[_0x1b70('0x29')](handleEntityNotFound(_0x33c79f,null))['then'](respondWithResult(_0x33c79f,null))[_0x1b70('0x4b')](handleError(_0x33c79f,null));};exports[_0x1b70('0x4c')]=function(_0xffc2d6,_0x4b26be,_0x1beb12){return db[_0x1b70('0x45')]['find']({'where':{'id':_0xffc2d6[_0x1b70('0x4d')]['id']},'attributes':[_0x1b70('0x2b'),_0x1b70('0x4e'),_0x1b70('0x4f')],'raw':!![]})[_0x1b70('0x29')](handleEntityNotFound(_0x4b26be,null))['then'](function(_0x1d11e3){if(_0x1d11e3){if(!fs[_0x1b70('0x50')](path[_0x1b70('0x51')](config[_0x1b70('0x52')],_0x1b70('0x53'),_0x1d11e3[_0x1b70('0x4e')]+'.'+_0x1d11e3[_0x1b70('0x4f')]))){throw new db[(_0x1b70('0x54'))]['ValidationError'](_0x1b70('0x55'));}return _0x4b26be[_0x1b70('0x4c')](path[_0x1b70('0x51')](config[_0x1b70('0x52')],_0x1b70('0x53'),util[_0x1b70('0x56')](_0x1b70('0x57'),_0x1d11e3[_0x1b70('0x4e')],_0x1d11e3[_0x1b70('0x4f')])),util['format'](_0x1b70('0x57'),_0x1d11e3[_0x1b70('0x2b')],_0x1d11e3[_0x1b70('0x4f')]));}return null;})[_0x1b70('0x4b')](handleError(_0x4b26be,null));};exports[_0x1b70('0x58')]=function(_0x59b91e,_0x2657ec,_0x3259c9){var _0x408425={'name':path[_0x1b70('0x59')](_0x59b91e[_0x1b70('0x5a')][_0x1b70('0x5b')],path[_0x1b70('0x5c')](_0x59b91e[_0x1b70('0x5a')][_0x1b70('0x5b')])),'save_name':path[_0x1b70('0x59')](_0x59b91e[_0x1b70('0x5a')]['filename'],path[_0x1b70('0x5c')](_0x59b91e[_0x1b70('0x5a')][_0x1b70('0x5d')])),'original_format':path[_0x1b70('0x5c')](_0x59b91e[_0x1b70('0x5a')][_0x1b70('0x5b')])['substring'](0x1),'converted_format':_0x1b70('0x5e')};var _0x6d1dd=path['join'](config[_0x1b70('0x52')],_0x1b70('0x5f'),_0x59b91e['file']['filename']);var _0x19b839=path[_0x1b70('0x51')](config[_0x1b70('0x52')],_0x1b70('0x53'),util['format'](_0x1b70('0x57'),path[_0x1b70('0x59')](_0x59b91e[_0x1b70('0x5a')][_0x1b70('0x5d')],path['extname'](_0x59b91e[_0x1b70('0x5a')][_0x1b70('0x5d')])),_0x408425[_0x1b70('0x4f')]));logger[_0x1b70('0x60')]('Sound\x20upload\x20filepath:\x20%s',_0x6d1dd);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x19b839);try{fs[_0x1b70('0x61')](_0x6d1dd,parseInt(_0x1b70('0x62'),0x8));var _0x4d47f8=sox[_0x1b70('0x63')](_0x6d1dd,_0x19b839,{'sampleRate':0x1f40,'format':_0x1b70('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4d47f8['on'](_0x1b70('0x2a'),function(_0x3c65f9){fs[_0x1b70('0x64')](_0x6d1dd);_0x2657ec[_0x1b70('0x1b')](0x1f4)[_0x1b70('0x2c')](_0x3c65f9);});_0x4d47f8['on'](_0x1b70('0x65'),function(_0x5de1f8){_0x408425['original_duration']=isNaN(_0x5de1f8[_0x1b70('0x66')])?null:_0x5de1f8[_0x1b70('0x66')]*0x3e8;_0x408425[_0x1b70('0x67')]=isNaN(_0x5de1f8['sampleCount'])?null:_0x5de1f8[_0x1b70('0x68')];_0x408425[_0x1b70('0x69')]=isNaN(_0x5de1f8['channelCount'])?null:_0x5de1f8[_0x1b70('0x6a')];_0x408425[_0x1b70('0x6b')]=isNaN(_0x5de1f8[_0x1b70('0x6c')])?null:_0x5de1f8[_0x1b70('0x6c')];_0x408425['original_sampleRate']=isNaN(_0x5de1f8[_0x1b70('0x6d')])?null:_0x5de1f8[_0x1b70('0x6d')];});_0x4d47f8['on'](_0x1b70('0x6e'),function(_0x5e1482){_0x408425[_0x1b70('0x6f')]=isNaN(_0x5e1482['duration'])?null:_0x5e1482['duration']*0x3e8;_0x408425['converted_sampleCount']=isNaN(_0x5e1482[_0x1b70('0x68')])?null:_0x5e1482[_0x1b70('0x68')];_0x408425[_0x1b70('0x70')]=isNaN(_0x5e1482['channelCount'])?null:_0x5e1482[_0x1b70('0x6a')];_0x408425[_0x1b70('0x71')]=isNaN(_0x5e1482[_0x1b70('0x6c')])?null:_0x5e1482[_0x1b70('0x6c')];_0x408425[_0x1b70('0x72')]=isNaN(_0x5e1482[_0x1b70('0x6d')])?null:_0x5e1482[_0x1b70('0x6d')];});_0x4d47f8['on'](_0x1b70('0x1c'),function(){fs[_0x1b70('0x61')](_0x19b839,parseInt('0777',0x8));return db[_0x1b70('0x45')][_0x1b70('0x58')](_0x408425)[_0x1b70('0x29')](function(_0x3aca7b){var _0x448501={'role':_0x59b91e[_0x1b70('0x73')][_0x1b70('0x74')],'userProfileId':_0x59b91e['body'][_0x1b70('0x75')]};if(!_0x448501)throw new Error(_0x1b70('0x76'));if(_0x448501[_0x1b70('0x74')]===_0x1b70('0x77')){var _0x4e2322=_0x3aca7b['get']({'plain':!![]});return db['UserProfileSection'][_0x1b70('0x4a')]({'where':{'name':_0x1b70('0x27'),'userProfileId':_0x448501[_0x1b70('0x75')]},'raw':!![]})['then'](function(_0x414423){if(_0x414423&&_0x414423[_0x1b70('0x78')]===0x0){return db[_0x1b70('0x28')]['create']({'name':_0x4e2322[_0x1b70('0x2b')],'resourceId':_0x4e2322['id'],'type':_0x414423[_0x1b70('0x2b')],'sectionId':_0x414423['id']},{})[_0x1b70('0x29')](function(){return _0x3aca7b;});}else{return _0x3aca7b;}})['catch'](function(_0x218c58){logger['error'](_0x1b70('0x79'),_0x218c58);throw _0x218c58;});}return _0x3aca7b;})[_0x1b70('0x29')](respondWithResult(_0x2657ec,null))['catch'](handleError(_0x2657ec,null));});_0x4d47f8[_0x1b70('0x7a')]();}catch(_0xf82dfe){_0x2657ec[_0x1b70('0x1b')](0x1f4)['send'](_0xf82dfe);}};exports[_0x1b70('0x7b')]=function(_0xcf840e,_0xd8e238,_0x3a5437){return db[_0x1b70('0x45')]['find']({'where':{'id':_0xcf840e[_0x1b70('0x4d')]['id']}})[_0x1b70('0x29')](handleEntityNotFound(_0xd8e238,null))[_0x1b70('0x29')](saveUpdates(_[_0x1b70('0x40')](_0xcf840e[_0x1b70('0x73')],[_0x1b70('0x2b'),'description']),null))[_0x1b70('0x29')](respondWithResult(_0xd8e238,null))[_0x1b70('0x4b')](handleError(_0xd8e238,null));};exports[_0x1b70('0x7c')]=function(_0x303a32,_0x53088d,_0x1cfa94){return db[_0x1b70('0x45')][_0x1b70('0x4a')]({'where':{'id':_0x303a32[_0x1b70('0x4d')]['id']}})[_0x1b70('0x29')](function(_0x5cd24c){if(_0x5cd24c){return _0x5cd24c[_0x1b70('0x25')]();}})[_0x1b70('0x29')](function(_0x3ef814){var _0x4a9808=path[_0x1b70('0x51')](config[_0x1b70('0x52')],_0x1b70('0x5f'),util[_0x1b70('0x56')](_0x1b70('0x57'),_0x3ef814[_0x1b70('0x4e')],_0x3ef814[_0x1b70('0x7d')]));var _0x25d73e=path[_0x1b70('0x51')](config[_0x1b70('0x52')],_0x1b70('0x53'),util[_0x1b70('0x56')](_0x1b70('0x57'),_0x3ef814[_0x1b70('0x4e')],_0x3ef814['converted_format']));fs[_0x1b70('0x64')](_0x4a9808);fs[_0x1b70('0x64')](_0x25d73e);return _0x3ef814;})[_0x1b70('0x29')](function(_0x2544b9){if(_0x2544b9){return _0x53088d[_0x1b70('0x1b')](0xcc)[_0x1b70('0x1c')]();}})[_0x1b70('0x29')](handleEntityNotFound(_0x53088d,null))[_0x1b70('0x4b')](handleError(_0x53088d,null));};
\ No newline at end of file
+var _0x528e=['ValidationError','%s.%s','format','create','basename','file','originalname','extname','filename','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','wav','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','start','description','delete','original_format','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','Sounds','UserProfileResource','end','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize'];(function(_0x24ee25,_0x495d96){var _0x3ed660=function(_0x10772f){while(--_0x10772f){_0x24ee25['push'](_0x24ee25['shift']());}};_0x3ed660(++_0x495d96);}(_0x528e,0xa6));var _0xe528=function(_0x14bcd8,_0xfdcdcc){_0x14bcd8=_0x14bcd8-0x0;var _0x4ae514=_0x528e[_0x14bcd8];return _0x4ae514;};'use strict';var pdf=require(_0xe528('0x0'));var emlformat=require(_0xe528('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe528('0x2'));var jsonpatch=require(_0xe528('0x3'));var rp=require(_0xe528('0x4'));var moment=require(_0xe528('0x5'));var BPromise=require(_0xe528('0x6'));var Mustache=require(_0xe528('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe528('0x8'));var crypto=require(_0xe528('0x9'));var jsforce=require(_0xe528('0xa'));var deskjs=require(_0xe528('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe528('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe528('0xd'));var qs=require(_0xe528('0xe'));var as=require(_0xe528('0xf'));var hardwareService=require(_0xe528('0x10'));var logger=require(_0xe528('0x11'))(_0xe528('0x12'));var utils=require(_0xe528('0x13'));var config=require('../../config/environment');var db=require(_0xe528('0x14'))['db'];function respondWithStatusCode(_0xe1ffd4,_0x34a96f){_0x34a96f=_0x34a96f||0xcc;return function(_0xa8b52b){if(_0xa8b52b){return _0xe1ffd4[_0xe528('0x15')](_0x34a96f);}return _0xe1ffd4['status'](_0x34a96f)['end']();};}function respondWithResult(_0x500607,_0x412e67){_0x412e67=_0x412e67||0xc8;return function(_0x4c7faf){if(_0x4c7faf){return _0x500607[_0xe528('0x16')](_0x412e67)[_0xe528('0x17')](_0x4c7faf);}};}function respondWithFilteredResult(_0x3bf648,_0x2f649d){return function(_0x80b040){if(_0x80b040){var _0x163338=_0x80b040[_0xe528('0x18')],_0x2a8288=_0x2f649d['offset'],_0x56fae5=_0x2f649d[_0xe528('0x19')]+_0x2f649d[_0xe528('0x1a')],_0x24e6c3;if(_0x56fae5>=_0x163338){_0x56fae5=_0x163338;_0x24e6c3=0xc8;}else{_0x24e6c3=0xce;}_0x3bf648['status'](_0x24e6c3);return _0x3bf648['set'](_0xe528('0x1b'),_0x2a8288+'-'+_0x56fae5+'/'+_0x163338)[_0xe528('0x17')](_0x80b040);}return null;};}function patchUpdates(_0x59afe9){return function(_0x121ddb){try{jsonpatch['apply'](_0x121ddb,_0x59afe9,!![]);}catch(_0xb8586a){return BPromise[_0xe528('0x1c')](_0xb8586a);}return _0x121ddb[_0xe528('0x1d')]();};}function saveUpdates(_0x1d3d5e,_0x523ab5){return function(_0x28ea36){if(_0x28ea36){return _0x28ea36[_0xe528('0x1e')](_0x1d3d5e)[_0xe528('0x1f')](function(_0x5c0ba1){return _0x5c0ba1;});}return null;};}function removeEntity(_0x37cb76,_0x5a25b4){return function(_0x2ca8c8){if(_0x2ca8c8){return _0x2ca8c8[_0xe528('0x20')]()[_0xe528('0x1f')](function(){var _0x5b2b1d=_0x2ca8c8['get']({'plain':!![]});var _0x3e1369=_0xe528('0x21');return db[_0xe528('0x22')][_0xe528('0x20')]({'where':{'type':_0x3e1369,'resourceId':_0x5b2b1d['id']}})[_0xe528('0x1f')](function(){return _0x2ca8c8;});})[_0xe528('0x1f')](function(){_0x37cb76['status'](0xcc)[_0xe528('0x23')]();});}};}function handleEntityNotFound(_0x5a48ab,_0x39cf60){return function(_0x3d74b5){if(!_0x3d74b5){_0x5a48ab[_0xe528('0x15')](0x194);}return _0x3d74b5;};}function handleError(_0x12832b,_0x5addf2){_0x5addf2=_0x5addf2||0x1f4;return function(_0x55a790){logger[_0xe528('0x24')](_0x55a790[_0xe528('0x25')]);if(_0x55a790['name']){delete _0x55a790[_0xe528('0x26')];}_0x12832b[_0xe528('0x16')](_0x5addf2)[_0xe528('0x27')](_0x55a790);};}exports[_0xe528('0x28')]=function(_0x4f85c7,_0x54d8af){var _0x535dc6={},_0x4eb654={},_0x7e933d={'count':0x0,'rows':[]};var _0x2e04ee=_[_0xe528('0x29')](db[_0xe528('0x2a')][_0xe528('0x2b')],function(_0x35b117){return{'name':_0x35b117[_0xe528('0x2c')],'type':_0x35b117[_0xe528('0x2d')][_0xe528('0x2e')]};});_0x4eb654[_0xe528('0x2f')]=_['map'](_0x2e04ee,'name');_0x4eb654[_0xe528('0x30')]=_[_0xe528('0x31')](_0x4f85c7[_0xe528('0x30')]);_0x4eb654[_0xe528('0x32')]=_['intersection'](_0x4eb654[_0xe528('0x2f')],_0x4eb654[_0xe528('0x30')]);_0x535dc6['attributes']=_[_0xe528('0x33')](_0x4eb654['model'],qs['fields'](_0x4f85c7['query'][_0xe528('0x34')]));_0x535dc6[_0xe528('0x35')]=_0x535dc6[_0xe528('0x35')][_0xe528('0x36')]?_0x535dc6[_0xe528('0x35')]:_0x4eb654[_0xe528('0x2f')];if(!_0x4f85c7[_0xe528('0x30')][_0xe528('0x37')](_0xe528('0x38'))){_0x535dc6['limit']=qs[_0xe528('0x1a')](_0x4f85c7['query'][_0xe528('0x1a')]);_0x535dc6['offset']=qs[_0xe528('0x19')](_0x4f85c7[_0xe528('0x30')][_0xe528('0x19')]);}_0x535dc6[_0xe528('0x39')]=qs['sort'](_0x4f85c7[_0xe528('0x30')][_0xe528('0x3a')]);_0x535dc6[_0xe528('0x3b')]=qs[_0xe528('0x32')](_[_0xe528('0x3c')](_0x4f85c7['query'],_0x4eb654[_0xe528('0x32')]),_0x2e04ee);if(_0x4f85c7[_0xe528('0x30')][_0xe528('0x3d')]){_0x535dc6[_0xe528('0x3b')]=_[_0xe528('0x3e')](_0x535dc6[_0xe528('0x3b')],{'$or':_[_0xe528('0x29')](_0x2e04ee,function(_0x5df50a){if(_0x5df50a[_0xe528('0x2d')]!==_0xe528('0x3f')){var _0x55a7cd={};_0x55a7cd[_0x5df50a[_0xe528('0x26')]]={'$like':'%'+_0x4f85c7[_0xe528('0x30')][_0xe528('0x3d')]+'%'};return _0x55a7cd;}})});}_0x535dc6=_[_0xe528('0x3e')]({},_0x535dc6,_0x4f85c7['options']);var _0x206d8c={'where':_0x535dc6[_0xe528('0x3b')]};return db[_0xe528('0x2a')][_0xe528('0x18')](_0x206d8c)['then'](function(_0x229d9f){_0x7e933d[_0xe528('0x18')]=_0x229d9f;if(_0x4f85c7[_0xe528('0x30')][_0xe528('0x40')]){_0x535dc6[_0xe528('0x41')]=[{'all':!![]}];}return db['Sound'][_0xe528('0x42')](_0x535dc6);})[_0xe528('0x1f')](function(_0xff67da){_0x7e933d[_0xe528('0x43')]=_0xff67da;return _0x7e933d;})['then'](respondWithFilteredResult(_0x54d8af,_0x535dc6))[_0xe528('0x44')](handleError(_0x54d8af,null));};exports[_0xe528('0x45')]=function(_0x21ce54,_0x4fcf19){var _0x59cfd8={'raw':!![],'where':{'id':_0x21ce54[_0xe528('0x46')]['id']}},_0x14b663={};_0x14b663['model']=_[_0xe528('0x31')](db[_0xe528('0x2a')][_0xe528('0x2b')]);_0x14b663[_0xe528('0x30')]=_[_0xe528('0x31')](_0x21ce54['query']);_0x14b663[_0xe528('0x32')]=_[_0xe528('0x33')](_0x14b663[_0xe528('0x2f')],_0x14b663[_0xe528('0x30')]);_0x59cfd8[_0xe528('0x35')]=_[_0xe528('0x33')](_0x14b663['model'],qs[_0xe528('0x34')](_0x21ce54['query'][_0xe528('0x34')]));_0x59cfd8[_0xe528('0x35')]=_0x59cfd8['attributes'][_0xe528('0x36')]?_0x59cfd8[_0xe528('0x35')]:_0x14b663[_0xe528('0x2f')];if(_0x21ce54[_0xe528('0x30')][_0xe528('0x40')]){_0x59cfd8[_0xe528('0x41')]=[{'all':!![]}];}_0x59cfd8=_[_0xe528('0x3e')]({},_0x59cfd8,_0x21ce54[_0xe528('0x47')]);return db[_0xe528('0x2a')][_0xe528('0x48')](_0x59cfd8)['then'](handleEntityNotFound(_0x4fcf19,null))['then'](respondWithResult(_0x4fcf19,null))[_0xe528('0x44')](handleError(_0x4fcf19,null));};exports[_0xe528('0x49')]=function(_0x5be82f,_0x4c9ae0,_0x24b21d){return db[_0xe528('0x2a')]['find']({'where':{'id':_0x5be82f['params']['id']},'attributes':[_0xe528('0x26'),_0xe528('0x4a'),_0xe528('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x4c9ae0,null))[_0xe528('0x1f')](function(_0x4e5db7){if(_0x4e5db7){if(!fs['existsSync'](path[_0xe528('0x4c')](config[_0xe528('0x4d')],_0xe528('0x4e'),_0x4e5db7[_0xe528('0x4a')]+'.'+_0x4e5db7[_0xe528('0x4b')]))){throw new db[(_0xe528('0x4f'))][(_0xe528('0x50'))]('Sound\x20not\x20found');}return _0x4c9ae0[_0xe528('0x49')](path[_0xe528('0x4c')](config[_0xe528('0x4d')],_0xe528('0x4e'),util['format'](_0xe528('0x51'),_0x4e5db7[_0xe528('0x4a')],_0x4e5db7['converted_format'])),util[_0xe528('0x52')](_0xe528('0x51'),_0x4e5db7[_0xe528('0x26')],_0x4e5db7[_0xe528('0x4b')]));}return null;})['catch'](handleError(_0x4c9ae0,null));};exports[_0xe528('0x53')]=function(_0x4d2b5d,_0x16d6df,_0x2a5548){var _0x15508c={'name':path[_0xe528('0x54')](_0x4d2b5d[_0xe528('0x55')][_0xe528('0x56')],path[_0xe528('0x57')](_0x4d2b5d[_0xe528('0x55')][_0xe528('0x56')])),'save_name':path[_0xe528('0x54')](_0x4d2b5d[_0xe528('0x55')][_0xe528('0x58')],path[_0xe528('0x57')](_0x4d2b5d[_0xe528('0x55')]['filename'])),'original_format':path[_0xe528('0x57')](_0x4d2b5d['file'][_0xe528('0x56')])['substring'](0x1),'converted_format':'wav'};var _0xfb255b=path[_0xe528('0x4c')](config[_0xe528('0x4d')],_0xe528('0x59'),_0x4d2b5d[_0xe528('0x55')][_0xe528('0x58')]);var _0x438fb5=path[_0xe528('0x4c')](config[_0xe528('0x4d')],_0xe528('0x4e'),util['format'](_0xe528('0x51'),path[_0xe528('0x54')](_0x4d2b5d['file'][_0xe528('0x58')],path[_0xe528('0x57')](_0x4d2b5d['file']['filename'])),_0x15508c[_0xe528('0x4b')]));logger[_0xe528('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0xfb255b);logger[_0xe528('0x5a')](_0xe528('0x5b'),_0x438fb5);try{fs[_0xe528('0x5c')](_0xfb255b,parseInt('0777',0x8));var _0x18e72e=sox[_0xe528('0x5d')](_0xfb255b,_0x438fb5,{'sampleRate':0x1f40,'format':_0xe528('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x18e72e['on'](_0xe528('0x24'),function(_0x203f95){fs['unlinkSync'](_0xfb255b);_0x16d6df[_0xe528('0x16')](0x1f4)[_0xe528('0x27')](_0x203f95);});_0x18e72e['on'](_0xe528('0x5f'),function(_0x3f81b0){_0x15508c[_0xe528('0x60')]=isNaN(_0x3f81b0[_0xe528('0x61')])?null:_0x3f81b0[_0xe528('0x61')]*0x3e8;_0x15508c[_0xe528('0x62')]=isNaN(_0x3f81b0[_0xe528('0x63')])?null:_0x3f81b0[_0xe528('0x63')];_0x15508c['original_channelCount']=isNaN(_0x3f81b0[_0xe528('0x64')])?null:_0x3f81b0[_0xe528('0x64')];_0x15508c[_0xe528('0x65')]=isNaN(_0x3f81b0['bitRate'])?null:_0x3f81b0['bitRate'];_0x15508c[_0xe528('0x66')]=isNaN(_0x3f81b0[_0xe528('0x67')])?null:_0x3f81b0[_0xe528('0x67')];});_0x18e72e['on'](_0xe528('0x68'),function(_0x3bb682){_0x15508c[_0xe528('0x69')]=isNaN(_0x3bb682[_0xe528('0x61')])?null:_0x3bb682[_0xe528('0x61')]*0x3e8;_0x15508c[_0xe528('0x6a')]=isNaN(_0x3bb682[_0xe528('0x63')])?null:_0x3bb682['sampleCount'];_0x15508c[_0xe528('0x6b')]=isNaN(_0x3bb682[_0xe528('0x64')])?null:_0x3bb682[_0xe528('0x64')];_0x15508c[_0xe528('0x6c')]=isNaN(_0x3bb682[_0xe528('0x6d')])?null:_0x3bb682[_0xe528('0x6d')];_0x15508c[_0xe528('0x6e')]=isNaN(_0x3bb682[_0xe528('0x67')])?null:_0x3bb682['sampleRate'];});_0x18e72e['on'](_0xe528('0x23'),function(){fs[_0xe528('0x5c')](_0x438fb5,parseInt('0777',0x8));return db[_0xe528('0x2a')]['create'](_0x15508c)[_0xe528('0x1f')](function(_0xdbc048){var _0x4162fd={'role':_0x4d2b5d[_0xe528('0x6f')][_0xe528('0x70')],'userProfileId':_0x4d2b5d[_0xe528('0x6f')][_0xe528('0x71')]};if(!_0x4162fd)throw new Error(_0xe528('0x72'));if(_0x4162fd[_0xe528('0x70')]===_0xe528('0x73')){var _0x20e802=_0xdbc048[_0xe528('0x74')]({'plain':!![]});return db[_0xe528('0x75')][_0xe528('0x48')]({'where':{'name':_0xe528('0x21'),'userProfileId':_0x4162fd[_0xe528('0x71')]},'raw':!![]})[_0xe528('0x1f')](function(_0x1042f9){if(_0x1042f9&&_0x1042f9['autoAssociation']===0x0){return db['UserProfileResource'][_0xe528('0x53')]({'name':_0x20e802[_0xe528('0x26')],'resourceId':_0x20e802['id'],'type':_0x1042f9[_0xe528('0x26')],'sectionId':_0x1042f9['id']},{})[_0xe528('0x1f')](function(){return _0xdbc048;});}else{return _0xdbc048;}})[_0xe528('0x44')](function(_0x307119){logger[_0xe528('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x307119);throw _0x307119;});}return _0xdbc048;})[_0xe528('0x1f')](respondWithResult(_0x16d6df,null))[_0xe528('0x44')](handleError(_0x16d6df,null));});_0x18e72e[_0xe528('0x76')]();}catch(_0x5b25bf){_0x16d6df[_0xe528('0x16')](0x1f4)[_0xe528('0x27')](_0x5b25bf);}};exports[_0xe528('0x1e')]=function(_0x2623f9,_0x3c2b6e,_0x23b554){return db[_0xe528('0x2a')]['find']({'where':{'id':_0x2623f9[_0xe528('0x46')]['id']}})[_0xe528('0x1f')](handleEntityNotFound(_0x3c2b6e,null))[_0xe528('0x1f')](saveUpdates(_['pick'](_0x2623f9[_0xe528('0x6f')],['name',_0xe528('0x77')]),null))[_0xe528('0x1f')](respondWithResult(_0x3c2b6e,null))['catch'](handleError(_0x3c2b6e,null));};exports[_0xe528('0x78')]=function(_0x10b6e7,_0x3012c4,_0x383ceb){return db[_0xe528('0x2a')][_0xe528('0x48')]({'where':{'id':_0x10b6e7[_0xe528('0x46')]['id']}})[_0xe528('0x1f')](function(_0x403e2b){if(_0x403e2b){return _0x403e2b[_0xe528('0x20')]();}})[_0xe528('0x1f')](function(_0x560d38){var _0x4b2527=path[_0xe528('0x4c')](config['root'],_0xe528('0x59'),util[_0xe528('0x52')](_0xe528('0x51'),_0x560d38[_0xe528('0x4a')],_0x560d38[_0xe528('0x79')]));var _0x581f95=path['join'](config[_0xe528('0x4d')],_0xe528('0x4e'),util['format'](_0xe528('0x51'),_0x560d38[_0xe528('0x4a')],_0x560d38[_0xe528('0x4b')]));fs[_0xe528('0x7a')](_0x4b2527);fs[_0xe528('0x7a')](_0x581f95);return _0x560d38;})[_0xe528('0x1f')](function(_0x3a75ea){if(_0x3a75ea){return _0x3012c4[_0xe528('0x16')](0xcc)[_0xe528('0x23')]();}})[_0xe528('0x1f')](handleEntityNotFound(_0x3012c4,null))[_0xe528('0x44')](handleError(_0x3012c4,null));};
\ No newline at end of file
diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js
index a2597c5..561540b 100644
--- a/server/api/sound/sound.model.js
+++ b/server/api/sound/sound.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x060c=['util','moment','request-promise','path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x060c,0xd0));var _0xc060=function(_0x1d5f3b,_0x41961c){_0x1d5f3b=_0x1d5f3b-0x0;var _0x27d1af=_0x060c[_0x1d5f3b];return _0x27d1af;};'use strict';var _=require(_0xc060('0x0'));var util=require(_0xc060('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc060('0x2'));var BPromise=require('bluebird');var rp=require(_0xc060('0x3'));var fs=require('fs');var path=require(_0xc060('0x4'));var rimraf=require(_0xc060('0x5'));var config=require('../../config/environment');var attributes=require(_0xc060('0x6'));module[_0xc060('0x7')]=function(_0x5ab3da,_0x24e48f){return _0x5ab3da[_0xc060('0x8')](_0xc060('0x9'),attributes,{'tableName':_0xc060('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x075a=['./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x075a,0x198));var _0xa075=function(_0x1b6001,_0x296e02){_0x1b6001=_0x1b6001-0x0;var _0x32ce3b=_0x075a[_0x1b6001];return _0x32ce3b;};'use strict';var _=require(_0xa075('0x0'));var util=require(_0xa075('0x1'));var logger=require(_0xa075('0x2'))(_0xa075('0x3'));var moment=require('moment');var BPromise=require(_0xa075('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa075('0x5'));var rimraf=require(_0xa075('0x6'));var config=require(_0xa075('0x7'));var attributes=require(_0xa075('0x8'));module[_0xa075('0x9')]=function(_0x742de0,_0x203b10){return _0x742de0[_0xa075('0xa')](_0xa075('0xb'),attributes,{'tableName':_0xa075('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js
index 701848c..7e76089 100644
--- a/server/api/sound/sound.rpc.js
+++ b/server/api/sound/sound.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x743b=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','lodash','util','moment'];(function(_0x4d5d8c,_0x9a68bd){var _0x24bb52=function(_0x244e4a){while(--_0x244e4a){_0x4d5d8c['push'](_0x4d5d8c['shift']());}};_0x24bb52(++_0x9a68bd);}(_0x743b,0x189));var _0xb743=function(_0x35b89a,_0x1e3622){_0x35b89a=_0x35b89a-0x0;var _0x3be55f=_0x743b[_0x35b89a];return _0x3be55f;};'use strict';var _=require(_0xb743('0x0'));var util=require(_0xb743('0x1'));var moment=require(_0xb743('0x2'));var BPromise=require(_0xb743('0x3'));var rs=require(_0xb743('0x4'));var fs=require('fs');var Redis=require(_0xb743('0x5'));var db=require(_0xb743('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb743('0x7'));var config=require(_0xb743('0x8'));var jayson=require(_0xb743('0x9'));var client=jayson[_0xb743('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d6618,_0x132ab5,_0x394d51){return new BPromise(function(_0x3290b1,_0x24b525){return client[_0xb743('0xb')](_0x5d6618,_0x394d51)[_0xb743('0xc')](function(_0x50b4fc){logger[_0xb743('0xd')](_0xb743('0xe'),_0x132ab5,'request\x20sent');logger[_0xb743('0xf')](_0xb743('0x10'),_0x132ab5,'request\x20sent',JSON[_0xb743('0x11')](_0x50b4fc));if(_0x50b4fc[_0xb743('0x12')]){if(_0x50b4fc['error'][_0xb743('0x13')]===0x1f4){logger[_0xb743('0x12')](_0xb743('0xe'),_0x132ab5,_0x50b4fc[_0xb743('0x12')][_0xb743('0x14')]);return _0x24b525(_0x50b4fc[_0xb743('0x12')][_0xb743('0x14')]);}logger[_0xb743('0x12')](_0xb743('0xe'),_0x132ab5,_0x50b4fc[_0xb743('0x12')]['message']);return _0x3290b1(_0x50b4fc[_0xb743('0x12')][_0xb743('0x14')]);}else{logger[_0xb743('0xd')]('Sound,\x20%s,\x20%s',_0x132ab5,'request\x20sent');_0x3290b1(_0x50b4fc[_0xb743('0x15')][_0xb743('0x14')]);}})[_0xb743('0x16')](function(_0x5b56c8){logger[_0xb743('0x12')](_0xb743('0xe'),_0x132ab5,_0x5b56c8);_0x24b525(_0x5b56c8);});});}exports[_0xb743('0x17')]=function(_0x1159d6){var _0x1a686b=this;return new Promise(function(_0x148535,_0x337b44){return db[_0xb743('0x18')][_0xb743('0x19')]({'raw':_0x1159d6[_0xb743('0x1a')]?_0x1159d6['options'][_0xb743('0x1b')]===undefined?!![]:![]:!![],'where':_0x1159d6[_0xb743('0x1a')]?_0x1159d6[_0xb743('0x1a')][_0xb743('0x1c')]||null:null,'attributes':_0x1159d6['options']?_0x1159d6[_0xb743('0x1a')][_0xb743('0x1d')]||null:null,'include':_0x1159d6[_0xb743('0x1a')]?_0x1159d6[_0xb743('0x1a')]['include']?_[_0xb743('0x1e')](_0x1159d6['options'][_0xb743('0x1f')],function(_0x20d109){return{'model':db[_0x20d109[_0xb743('0x20')]],'as':_0x20d109['as'],'attributes':_0x20d109[_0xb743('0x1d')],'include':_0x20d109[_0xb743('0x1f')]?_['map'](_0x20d109[_0xb743('0x1f')],function(_0x1dcc3b){return{'model':db[_0x1dcc3b[_0xb743('0x20')]],'as':_0x1dcc3b['as'],'attributes':_0x1dcc3b[_0xb743('0x1d')],'include':_0x1dcc3b[_0xb743('0x1f')]?_[_0xb743('0x1e')](_0x1dcc3b['include'],function(_0x1d3a98){return{'model':db[_0x1d3a98[_0xb743('0x20')]],'as':_0x1d3a98['as'],'attributes':_0x1d3a98[_0xb743('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb743('0xc')](function(_0x4b0852){logger[_0xb743('0xd')](_0xb743('0x17'),_0x1159d6);logger[_0xb743('0xf')](_0xb743('0x17'),_0x1159d6,JSON['stringify'](_0x4b0852));_0x148535(_0x4b0852);})[_0xb743('0x16')](function(_0x2028e2){logger[_0xb743('0x12')](_0xb743('0x17'),_0x2028e2['message'],_0x1159d6);_0x337b44(_0x1a686b[_0xb743('0x12')](0x1f4,_0x2028e2['message']));});});};
\ No newline at end of file
+var _0x06d7=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','Sound,\x20%s,\x20%s','catch','Sound','find','options','where','attributes','include','map','model','ShowSound'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x06d7,0xb4));var _0x706d=function(_0x59a482,_0x283736){_0x59a482=_0x59a482-0x0;var _0x535530=_0x06d7[_0x59a482];return _0x535530;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x706d('0x0'));var BPromise=require(_0x706d('0x1'));var rs=require(_0x706d('0x2'));var fs=require('fs');var Redis=require(_0x706d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x706d('0x4'));var logger=require(_0x706d('0x5'))('rpc');var config=require(_0x706d('0x6'));var jayson=require(_0x706d('0x7'));var client=jayson[_0x706d('0x8')][_0x706d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14bbbd,_0x483997,_0x301a13){return new BPromise(function(_0x29093a,_0x4be8d5){return client[_0x706d('0xa')](_0x14bbbd,_0x301a13)[_0x706d('0xb')](function(_0x486864){logger[_0x706d('0xc')]('Sound,\x20%s,\x20%s',_0x483997,_0x706d('0xd'));logger[_0x706d('0xe')](_0x706d('0xf'),_0x483997,_0x706d('0xd'),JSON[_0x706d('0x10')](_0x486864));if(_0x486864[_0x706d('0x11')]){if(_0x486864[_0x706d('0x11')]['code']===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x483997,_0x486864[_0x706d('0x11')]['message']);return _0x4be8d5(_0x486864[_0x706d('0x11')][_0x706d('0x12')]);}logger[_0x706d('0x11')](_0x706d('0x13'),_0x483997,_0x486864['error'][_0x706d('0x12')]);return _0x29093a(_0x486864[_0x706d('0x11')][_0x706d('0x12')]);}else{logger[_0x706d('0xc')](_0x706d('0x13'),_0x483997,_0x706d('0xd'));_0x29093a(_0x486864['result']['message']);}})[_0x706d('0x14')](function(_0x31b86d){logger['error'](_0x706d('0x13'),_0x483997,_0x31b86d);_0x4be8d5(_0x31b86d);});});}exports['ShowSound']=function(_0x2a18e1){var _0x48964c=this;return new Promise(function(_0x129131,_0x1f88df){return db[_0x706d('0x15')][_0x706d('0x16')]({'raw':_0x2a18e1['options']?_0x2a18e1[_0x706d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2a18e1['options']?_0x2a18e1['options'][_0x706d('0x18')]||null:null,'attributes':_0x2a18e1['options']?_0x2a18e1[_0x706d('0x17')][_0x706d('0x19')]||null:null,'include':_0x2a18e1['options']?_0x2a18e1[_0x706d('0x17')][_0x706d('0x1a')]?_[_0x706d('0x1b')](_0x2a18e1[_0x706d('0x17')]['include'],function(_0x3cb8aa){return{'model':db[_0x3cb8aa[_0x706d('0x1c')]],'as':_0x3cb8aa['as'],'attributes':_0x3cb8aa[_0x706d('0x19')],'include':_0x3cb8aa['include']?_[_0x706d('0x1b')](_0x3cb8aa[_0x706d('0x1a')],function(_0x58aec2){return{'model':db[_0x58aec2[_0x706d('0x1c')]],'as':_0x58aec2['as'],'attributes':_0x58aec2[_0x706d('0x19')],'include':_0x58aec2['include']?_[_0x706d('0x1b')](_0x58aec2[_0x706d('0x1a')],function(_0x1a4f42){return{'model':db[_0x1a4f42[_0x706d('0x1c')]],'as':_0x1a4f42['as'],'attributes':_0x1a4f42[_0x706d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x706d('0xb')](function(_0x5e5759){logger[_0x706d('0xc')](_0x706d('0x1d'),_0x2a18e1);logger[_0x706d('0xe')](_0x706d('0x1d'),_0x2a18e1,JSON[_0x706d('0x10')](_0x5e5759));_0x129131(_0x5e5759);})['catch'](function(_0xe0b28a){logger['error'](_0x706d('0x1d'),_0xe0b28a[_0x706d('0x12')],_0x2a18e1);_0x1f88df(_0x48964c[_0x706d('0x11')](0x1f4,_0xe0b28a['message']));});});};
\ No newline at end of file
diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js
index 8844a81..2efecb6 100644
--- a/server/api/squareMessage/index.js
+++ b/server/api/squareMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x611f=['get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller'];(function(_0x437910,_0x38287c){var _0x29afbc=function(_0x5c0312){while(--_0x5c0312){_0x437910['push'](_0x437910['shift']());}};_0x29afbc(++_0x38287c);}(_0x611f,0x1c4));var _0xf611=function(_0x23cc84,_0xb537ca){_0x23cc84=_0x23cc84-0x0;var _0x321ba4=_0x611f[_0x23cc84];return _0x321ba4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf611('0x0'));var timeout=require(_0xf611('0x1'));var express=require('express');var router=express[_0xf611('0x2')]();var auth=require(_0xf611('0x3'));var interaction=require(_0xf611('0x4'));var config=require(_0xf611('0x5'));var controller=require(_0xf611('0x6'));router[_0xf611('0x7')]('/',auth[_0xf611('0x8')](),controller[_0xf611('0x9')]);router[_0xf611('0x7')](_0xf611('0xa'),auth['isAuthenticated'](),controller[_0xf611('0xb')]);router[_0xf611('0xc')]('/',auth[_0xf611('0x8')](),controller['create']);router[_0xf611('0xd')](_0xf611('0xa'),auth['isAuthenticated'](),controller[_0xf611('0xe')]);router['delete'](_0xf611('0xa'),auth[_0xf611('0x8')](),controller[_0xf611('0xf')]);module[_0xf611('0x10')]=router;
\ No newline at end of file
+var _0x8b48=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete','multer'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8b48,0xfb));var _0x88b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b48[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x88b4('0x0'));var util=require('util');var path=require(_0x88b4('0x1'));var timeout=require(_0x88b4('0x2'));var express=require(_0x88b4('0x3'));var router=express[_0x88b4('0x4')]();var auth=require(_0x88b4('0x5'));var interaction=require(_0x88b4('0x6'));var config=require(_0x88b4('0x7'));var controller=require(_0x88b4('0x8'));router['get']('/',auth[_0x88b4('0x9')](),controller[_0x88b4('0xa')]);router[_0x88b4('0xb')]('/:id',auth[_0x88b4('0x9')](),controller['show']);router[_0x88b4('0xc')]('/',auth['isAuthenticated'](),controller[_0x88b4('0xd')]);router[_0x88b4('0xe')](_0x88b4('0xf'),auth[_0x88b4('0x9')](),controller[_0x88b4('0x10')]);router[_0x88b4('0x11')]('/:id',auth[_0x88b4('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js
index ecd5ca9..b9cf1a8 100644
--- a/server/api/squareMessage/squareMessage.attributes.js
+++ b/server/api/squareMessage/squareMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3243=['ENUM','out','STRING','TEXT','medium'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x3243,0x115));var _0x3324=function(_0x3d8790,_0xb14aef){_0x3d8790=_0x3d8790-0x0;var _0x4b66d9=_0x3243[_0x3d8790];return _0x4b66d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3324('0x0')]},'body':{'type':Sequelize[_0x3324('0x1')](_0x3324('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x3324('0x3')]('in',_0x3324('0x4')),'defaultValue':_0x3324('0x4'),'allowNull':![]}};
\ No newline at end of file
+var _0xe2c5=['exports','STRING','TEXT','medium','out','sequelize'];(function(_0x222cc4,_0x3b27cb){var _0x1ae066=function(_0x7c8ff5){while(--_0x7c8ff5){_0x222cc4['push'](_0x222cc4['shift']());}};_0x1ae066(++_0x3b27cb);}(_0xe2c5,0x1df));var _0x5e2c=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xe2c5[_0x4ea413];return _0x51cf25;};'use strict';var Sequelize=require(_0x5e2c('0x0'));module[_0x5e2c('0x1')]={'uniqueid':{'type':Sequelize[_0x5e2c('0x2')]},'body':{'type':Sequelize[_0x5e2c('0x3')](_0x5e2c('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5e2c('0x5')),'defaultValue':_0x5e2c('0x5'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js
index d81366f..45e929a 100644
--- a/server/api/squareMessage/squareMessage.controller.js
+++ b/server/api/squareMessage/squareMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x80b1=['end','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','params','SquareMessage','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x4d35f3,_0x19ba66){var _0x382fea=function(_0x2c2390){while(--_0x2c2390){_0x4d35f3['push'](_0x4d35f3['shift']());}};_0x382fea(++_0x19ba66);}(_0x80b1,0xc5));var _0x180b=function(_0x466dd0,_0xca4783){_0x466dd0=_0x466dd0-0x0;var _0x4c452a=_0x80b1[_0x466dd0];return _0x4c452a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x180b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x180b('0x1'));var jsonpatch=require(_0x180b('0x2'));var rp=require(_0x180b('0x3'));var moment=require(_0x180b('0x4'));var BPromise=require(_0x180b('0x5'));var Mustache=require(_0x180b('0x6'));var util=require(_0x180b('0x7'));var path=require(_0x180b('0x8'));var sox=require(_0x180b('0x9'));var csv=require(_0x180b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x180b('0xb'));var squel=require('squel');var crypto=require(_0x180b('0xc'));var jsforce=require(_0x180b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x180b('0xe'));var Papa=require(_0x180b('0xf'));var Redis=require(_0x180b('0x10'));var authService=require(_0x180b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x180b('0x12'));var hardwareService=require(_0x180b('0x13'));var logger=require(_0x180b('0x14'))('api');var utils=require(_0x180b('0x15'));var config=require('../../config/environment');var db=require(_0x180b('0x16'))['db'];function respondWithStatusCode(_0x90af1,_0x366d10){_0x366d10=_0x366d10||0xcc;return function(_0x5bfe00){if(_0x5bfe00){return _0x90af1[_0x180b('0x17')](_0x366d10);}return _0x90af1[_0x180b('0x18')](_0x366d10)[_0x180b('0x19')]();};}function respondWithResult(_0x661c8c,_0x3ebd5c){_0x3ebd5c=_0x3ebd5c||0xc8;return function(_0x1f3e69){if(_0x1f3e69){return _0x661c8c['status'](_0x3ebd5c)['json'](_0x1f3e69);}};}function respondWithFilteredResult(_0x332770,_0x1fff4e){return function(_0x1620b3){if(_0x1620b3){var _0x5971d2=_0x1620b3['count'],_0x589ca7=_0x1fff4e[_0x180b('0x1a')],_0x1e6686=_0x1fff4e['offset']+_0x1fff4e[_0x180b('0x1b')],_0x2de686;if(_0x1e6686>=_0x5971d2){_0x1e6686=_0x5971d2;_0x2de686=0xc8;}else{_0x2de686=0xce;}_0x332770[_0x180b('0x18')](_0x2de686);return _0x332770[_0x180b('0x1c')](_0x180b('0x1d'),_0x589ca7+'-'+_0x1e6686+'/'+_0x5971d2)['json'](_0x1620b3);}return null;};}function patchUpdates(_0x4e123b){return function(_0x1f2dae){try{jsonpatch[_0x180b('0x1e')](_0x1f2dae,_0x4e123b,!![]);}catch(_0x1ee25b){return BPromise[_0x180b('0x1f')](_0x1ee25b);}return _0x1f2dae[_0x180b('0x20')]();};}function saveUpdates(_0x139592,_0x6415de){return function(_0x10274a){if(_0x10274a){return _0x10274a[_0x180b('0x21')](_0x139592)[_0x180b('0x22')](function(_0x35f968){return _0x35f968;});}return null;};}function removeEntity(_0x53eac1,_0x5dc85c){return function(_0x51c284){if(_0x51c284){return _0x51c284[_0x180b('0x23')]()[_0x180b('0x22')](function(){_0x53eac1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d30bd,_0x2370ae){return function(_0x9dee82){if(!_0x9dee82){_0x5d30bd[_0x180b('0x17')](0x194);}return _0x9dee82;};}function handleError(_0x415fe0,_0x2700ce){_0x2700ce=_0x2700ce||0x1f4;return function(_0x2dcbb4){logger[_0x180b('0x24')](_0x2dcbb4[_0x180b('0x25')]);if(_0x2dcbb4[_0x180b('0x26')]){delete _0x2dcbb4[_0x180b('0x26')];}_0x415fe0[_0x180b('0x18')](_0x2700ce)[_0x180b('0x27')](_0x2dcbb4);};}exports[_0x180b('0x28')]=function(_0x41446d,_0x90a01e){var _0x5c735c={},_0x4d6fe6={},_0x111e90={'count':0x0,'rows':[]};var _0x4b6c72=_[_0x180b('0x29')](db['SquareMessage'][_0x180b('0x2a')],function(_0x44e2b0){return{'name':_0x44e2b0[_0x180b('0x2b')],'type':_0x44e2b0['type'][_0x180b('0x2c')]};});_0x4d6fe6[_0x180b('0x2d')]=_[_0x180b('0x29')](_0x4b6c72,'name');_0x4d6fe6[_0x180b('0x2e')]=_[_0x180b('0x2f')](_0x41446d[_0x180b('0x2e')]);_0x4d6fe6[_0x180b('0x30')]=_[_0x180b('0x31')](_0x4d6fe6['model'],_0x4d6fe6[_0x180b('0x2e')]);_0x5c735c['attributes']=_[_0x180b('0x31')](_0x4d6fe6[_0x180b('0x2d')],qs[_0x180b('0x32')](_0x41446d[_0x180b('0x2e')][_0x180b('0x32')]));_0x5c735c[_0x180b('0x33')]=_0x5c735c[_0x180b('0x33')][_0x180b('0x34')]?_0x5c735c['attributes']:_0x4d6fe6[_0x180b('0x2d')];if(!_0x41446d[_0x180b('0x2e')][_0x180b('0x35')](_0x180b('0x36'))){_0x5c735c[_0x180b('0x1b')]=qs[_0x180b('0x1b')](_0x41446d['query']['limit']);_0x5c735c[_0x180b('0x1a')]=qs[_0x180b('0x1a')](_0x41446d[_0x180b('0x2e')][_0x180b('0x1a')]);}_0x5c735c[_0x180b('0x37')]=qs[_0x180b('0x38')](_0x41446d[_0x180b('0x2e')][_0x180b('0x38')]);_0x5c735c['where']=qs[_0x180b('0x30')](_[_0x180b('0x39')](_0x41446d[_0x180b('0x2e')],_0x4d6fe6[_0x180b('0x30')]),_0x4b6c72);if(_0x41446d['query']['filter']){_0x5c735c[_0x180b('0x3a')]=_[_0x180b('0x3b')](_0x5c735c['where'],{'$or':_['map'](_0x4b6c72,function(_0x3a9f2f){if(_0x3a9f2f[_0x180b('0x3c')]!==_0x180b('0x3d')){var _0x48b0c9={};_0x48b0c9[_0x3a9f2f[_0x180b('0x26')]]={'$like':'%'+_0x41446d['query'][_0x180b('0x3e')]+'%'};return _0x48b0c9;}})});}_0x5c735c=_[_0x180b('0x3b')]({},_0x5c735c,_0x41446d[_0x180b('0x3f')]);var _0x4cea01={'where':_0x5c735c[_0x180b('0x3a')]};return db['SquareMessage'][_0x180b('0x40')](_0x4cea01)[_0x180b('0x22')](function(_0x4d4227){_0x111e90[_0x180b('0x40')]=_0x4d4227;if(_0x41446d[_0x180b('0x2e')][_0x180b('0x41')]){_0x5c735c[_0x180b('0x42')]=[{'all':!![]}];}return db['SquareMessage'][_0x180b('0x43')](_0x5c735c);})['then'](function(_0x202293){_0x111e90['rows']=_0x202293;return _0x111e90;})[_0x180b('0x22')](respondWithFilteredResult(_0x90a01e,_0x5c735c))[_0x180b('0x44')](handleError(_0x90a01e,null));};exports['show']=function(_0x174605,_0x4ca008){var _0x412c4a={'raw':!![],'where':{'id':_0x174605[_0x180b('0x45')]['id']}},_0x1a1c47={};_0x1a1c47[_0x180b('0x2d')]=_[_0x180b('0x2f')](db[_0x180b('0x46')][_0x180b('0x2a')]);_0x1a1c47[_0x180b('0x2e')]=_['keys'](_0x174605[_0x180b('0x2e')]);_0x1a1c47[_0x180b('0x30')]=_[_0x180b('0x31')](_0x1a1c47['model'],_0x1a1c47[_0x180b('0x2e')]);_0x412c4a['attributes']=_[_0x180b('0x31')](_0x1a1c47[_0x180b('0x2d')],qs[_0x180b('0x32')](_0x174605[_0x180b('0x2e')][_0x180b('0x32')]));_0x412c4a['attributes']=_0x412c4a[_0x180b('0x33')][_0x180b('0x34')]?_0x412c4a[_0x180b('0x33')]:_0x1a1c47['model'];if(_0x174605[_0x180b('0x2e')]['includeAll']){_0x412c4a['include']=[{'all':!![]}];}_0x412c4a=_['merge']({},_0x412c4a,_0x174605[_0x180b('0x3f')]);return db[_0x180b('0x46')][_0x180b('0x47')](_0x412c4a)[_0x180b('0x22')](handleEntityNotFound(_0x4ca008,null))['then'](respondWithResult(_0x4ca008,null))['catch'](handleError(_0x4ca008,null));};exports[_0x180b('0x48')]=function(_0x18af4d,_0x1cc8b4){return db[_0x180b('0x46')][_0x180b('0x48')](_0x18af4d['body'],{})[_0x180b('0x22')](respondWithResult(_0x1cc8b4,0xc9))['catch'](handleError(_0x1cc8b4,null));};exports[_0x180b('0x21')]=function(_0x110c7a,_0xad17da){if(_0x110c7a['body']['id']){delete _0x110c7a[_0x180b('0x49')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x110c7a[_0x180b('0x45')]['id']}})[_0x180b('0x22')](handleEntityNotFound(_0xad17da,null))[_0x180b('0x22')](saveUpdates(_0x110c7a[_0x180b('0x49')],null))[_0x180b('0x22')](respondWithResult(_0xad17da,null))['catch'](handleError(_0xad17da,null));};exports[_0x180b('0x23')]=function(_0x23abf0,_0x51ad1e){return db[_0x180b('0x46')][_0x180b('0x47')]({'where':{'id':_0x23abf0[_0x180b('0x45')]['id']}})[_0x180b('0x22')](handleEntityNotFound(_0x51ad1e,null))['then'](removeEntity(_0x51ad1e,null))[_0x180b('0x44')](handleError(_0x51ad1e,null));};
\ No newline at end of file
+var _0xf32c=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','map','SquareMessage','rawAttributes','fieldName','key','model','query'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xf32c,0x148));var _0xcf32=function(_0x147e9f,_0x57b3cb){_0x147e9f=_0x147e9f-0x0;var _0x321585=_0xf32c[_0x147e9f];return _0x321585;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcf32('0x0'));var rimraf=require(_0xcf32('0x1'));var zipdir=require(_0xcf32('0x2'));var jsonpatch=require(_0xcf32('0x3'));var rp=require(_0xcf32('0x4'));var moment=require(_0xcf32('0x5'));var BPromise=require(_0xcf32('0x6'));var Mustache=require(_0xcf32('0x7'));var util=require(_0xcf32('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcf32('0x9'));var ejs=require(_0xcf32('0xa'));var fs=require('fs');var _=require(_0xcf32('0xb'));var squel=require(_0xcf32('0xc'));var crypto=require('crypto');var jsforce=require(_0xcf32('0xd'));var deskjs=require(_0xcf32('0xe'));var toCsv=require(_0xcf32('0x9'));var querystring=require(_0xcf32('0xf'));var Papa=require(_0xcf32('0x10'));var Redis=require('ioredis');var authService=require(_0xcf32('0x11'));var qs=require(_0xcf32('0x12'));var as=require(_0xcf32('0x13'));var hardwareService=require(_0xcf32('0x14'));var logger=require('../../config/logger')(_0xcf32('0x15'));var utils=require(_0xcf32('0x16'));var config=require('../../config/environment');var db=require(_0xcf32('0x17'))['db'];function respondWithStatusCode(_0x3bd528,_0x3d0e31){_0x3d0e31=_0x3d0e31||0xcc;return function(_0x5bf245){if(_0x5bf245){return _0x3bd528[_0xcf32('0x18')](_0x3d0e31);}return _0x3bd528[_0xcf32('0x19')](_0x3d0e31)['end']();};}function respondWithResult(_0x17eaf1,_0x4f7f1b){_0x4f7f1b=_0x4f7f1b||0xc8;return function(_0x3fe5ae){if(_0x3fe5ae){return _0x17eaf1[_0xcf32('0x19')](_0x4f7f1b)[_0xcf32('0x1a')](_0x3fe5ae);}};}function respondWithFilteredResult(_0x431ea2,_0x2b0cbe){return function(_0xa9768){if(_0xa9768){var _0xfd600c=_0xa9768['count'],_0x18f623=_0x2b0cbe[_0xcf32('0x1b')],_0x6237f3=_0x2b0cbe['offset']+_0x2b0cbe[_0xcf32('0x1c')],_0x17cc29;if(_0x6237f3>=_0xfd600c){_0x6237f3=_0xfd600c;_0x17cc29=0xc8;}else{_0x17cc29=0xce;}_0x431ea2['status'](_0x17cc29);return _0x431ea2[_0xcf32('0x1d')](_0xcf32('0x1e'),_0x18f623+'-'+_0x6237f3+'/'+_0xfd600c)[_0xcf32('0x1a')](_0xa9768);}return null;};}function patchUpdates(_0x363d7b){return function(_0x25ba84){try{jsonpatch[_0xcf32('0x1f')](_0x25ba84,_0x363d7b,!![]);}catch(_0x1f5366){return BPromise[_0xcf32('0x20')](_0x1f5366);}return _0x25ba84['save']();};}function saveUpdates(_0xdf895,_0x244c81){return function(_0xdade77){if(_0xdade77){return _0xdade77[_0xcf32('0x21')](_0xdf895)[_0xcf32('0x22')](function(_0x5ba76c){return _0x5ba76c;});}return null;};}function removeEntity(_0x58553c,_0x309a87){return function(_0x3fb9fb){if(_0x3fb9fb){return _0x3fb9fb[_0xcf32('0x23')]()[_0xcf32('0x22')](function(){_0x58553c[_0xcf32('0x19')](0xcc)[_0xcf32('0x24')]();});}};}function handleEntityNotFound(_0x2e001f,_0xe897b2){return function(_0x240acf){if(!_0x240acf){_0x2e001f[_0xcf32('0x18')](0x194);}return _0x240acf;};}function handleError(_0x18dfbf,_0x2d0950){_0x2d0950=_0x2d0950||0x1f4;return function(_0x59a98a){logger[_0xcf32('0x25')](_0x59a98a['stack']);if(_0x59a98a[_0xcf32('0x26')]){delete _0x59a98a['name'];}_0x18dfbf[_0xcf32('0x19')](_0x2d0950)[_0xcf32('0x27')](_0x59a98a);};}exports['index']=function(_0x134678,_0x48e682){var _0x3d9205={},_0x5aa454={},_0x554f34={'count':0x0,'rows':[]};var _0x442e7b=_[_0xcf32('0x28')](db[_0xcf32('0x29')][_0xcf32('0x2a')],function(_0x5093fa){return{'name':_0x5093fa[_0xcf32('0x2b')],'type':_0x5093fa['type'][_0xcf32('0x2c')]};});_0x5aa454[_0xcf32('0x2d')]=_[_0xcf32('0x28')](_0x442e7b,_0xcf32('0x26'));_0x5aa454[_0xcf32('0x2e')]=_[_0xcf32('0x2f')](_0x134678[_0xcf32('0x2e')]);_0x5aa454[_0xcf32('0x30')]=_[_0xcf32('0x31')](_0x5aa454[_0xcf32('0x2d')],_0x5aa454[_0xcf32('0x2e')]);_0x3d9205[_0xcf32('0x32')]=_['intersection'](_0x5aa454['model'],qs[_0xcf32('0x33')](_0x134678[_0xcf32('0x2e')][_0xcf32('0x33')]));_0x3d9205['attributes']=_0x3d9205[_0xcf32('0x32')][_0xcf32('0x34')]?_0x3d9205['attributes']:_0x5aa454['model'];if(!_0x134678[_0xcf32('0x2e')][_0xcf32('0x35')](_0xcf32('0x36'))){_0x3d9205[_0xcf32('0x1c')]=qs[_0xcf32('0x1c')](_0x134678[_0xcf32('0x2e')][_0xcf32('0x1c')]);_0x3d9205[_0xcf32('0x1b')]=qs['offset'](_0x134678['query'][_0xcf32('0x1b')]);}_0x3d9205[_0xcf32('0x37')]=qs[_0xcf32('0x38')](_0x134678[_0xcf32('0x2e')][_0xcf32('0x38')]);_0x3d9205[_0xcf32('0x39')]=qs[_0xcf32('0x30')](_[_0xcf32('0x3a')](_0x134678[_0xcf32('0x2e')],_0x5aa454[_0xcf32('0x30')]),_0x442e7b);if(_0x134678[_0xcf32('0x2e')][_0xcf32('0x3b')]){_0x3d9205[_0xcf32('0x39')]=_[_0xcf32('0x3c')](_0x3d9205[_0xcf32('0x39')],{'$or':_['map'](_0x442e7b,function(_0x126ca6){if(_0x126ca6[_0xcf32('0x3d')]!==_0xcf32('0x3e')){var _0x14584d={};_0x14584d[_0x126ca6[_0xcf32('0x26')]]={'$like':'%'+_0x134678[_0xcf32('0x2e')][_0xcf32('0x3b')]+'%'};return _0x14584d;}})});}_0x3d9205=_['merge']({},_0x3d9205,_0x134678[_0xcf32('0x3f')]);var _0x55b73b={'where':_0x3d9205[_0xcf32('0x39')]};return db['SquareMessage'][_0xcf32('0x40')](_0x55b73b)[_0xcf32('0x22')](function(_0x4e7618){_0x554f34[_0xcf32('0x40')]=_0x4e7618;if(_0x134678[_0xcf32('0x2e')]['includeAll']){_0x3d9205[_0xcf32('0x41')]=[{'all':!![]}];}return db[_0xcf32('0x29')][_0xcf32('0x42')](_0x3d9205);})['then'](function(_0x528284){_0x554f34[_0xcf32('0x43')]=_0x528284;return _0x554f34;})[_0xcf32('0x22')](respondWithFilteredResult(_0x48e682,_0x3d9205))[_0xcf32('0x44')](handleError(_0x48e682,null));};exports[_0xcf32('0x45')]=function(_0x245d9c,_0x4af8f5){var _0x52892a={'raw':!![],'where':{'id':_0x245d9c['params']['id']}},_0x40fc50={};_0x40fc50[_0xcf32('0x2d')]=_['keys'](db[_0xcf32('0x29')][_0xcf32('0x2a')]);_0x40fc50[_0xcf32('0x2e')]=_[_0xcf32('0x2f')](_0x245d9c['query']);_0x40fc50['filters']=_['intersection'](_0x40fc50[_0xcf32('0x2d')],_0x40fc50[_0xcf32('0x2e')]);_0x52892a[_0xcf32('0x32')]=_[_0xcf32('0x31')](_0x40fc50[_0xcf32('0x2d')],qs['fields'](_0x245d9c[_0xcf32('0x2e')][_0xcf32('0x33')]));_0x52892a[_0xcf32('0x32')]=_0x52892a['attributes'][_0xcf32('0x34')]?_0x52892a[_0xcf32('0x32')]:_0x40fc50[_0xcf32('0x2d')];if(_0x245d9c[_0xcf32('0x2e')][_0xcf32('0x46')]){_0x52892a[_0xcf32('0x41')]=[{'all':!![]}];}_0x52892a=_[_0xcf32('0x3c')]({},_0x52892a,_0x245d9c['options']);return db[_0xcf32('0x29')][_0xcf32('0x47')](_0x52892a)['then'](handleEntityNotFound(_0x4af8f5,null))[_0xcf32('0x22')](respondWithResult(_0x4af8f5,null))[_0xcf32('0x44')](handleError(_0x4af8f5,null));};exports[_0xcf32('0x48')]=function(_0x23c78a,_0x2fbb9f){return db[_0xcf32('0x29')]['create'](_0x23c78a[_0xcf32('0x49')],{})[_0xcf32('0x22')](respondWithResult(_0x2fbb9f,0xc9))[_0xcf32('0x44')](handleError(_0x2fbb9f,null));};exports['update']=function(_0x44b707,_0x1901bb){if(_0x44b707[_0xcf32('0x49')]['id']){delete _0x44b707['body']['id'];}return db[_0xcf32('0x29')][_0xcf32('0x47')]({'where':{'id':_0x44b707['params']['id']}})[_0xcf32('0x22')](handleEntityNotFound(_0x1901bb,null))[_0xcf32('0x22')](saveUpdates(_0x44b707[_0xcf32('0x49')],null))['then'](respondWithResult(_0x1901bb,null))[_0xcf32('0x44')](handleError(_0x1901bb,null));};exports[_0xcf32('0x23')]=function(_0x3e30b6,_0x59416e){return db[_0xcf32('0x29')][_0xcf32('0x47')]({'where':{'id':_0x3e30b6[_0xcf32('0x4a')]['id']}})['then'](handleEntityNotFound(_0x59416e,null))[_0xcf32('0x22')](removeEntity(_0x59416e,null))['catch'](handleError(_0x59416e,null));};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js
index bdbe74c..6611295 100644
--- a/server/api/squareMessage/squareMessage.model.js
+++ b/server/api/squareMessage/squareMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x31f0=['./squareMessage.attributes','define','square_messages','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4de3fe,_0x5dc460){var _0x3759eb=function(_0x504572){while(--_0x504572){_0x4de3fe['push'](_0x4de3fe['shift']());}};_0x3759eb(++_0x5dc460);}(_0x31f0,0xb7));var _0x031f=function(_0x33a5b8,_0x3fb2eb){_0x33a5b8=_0x33a5b8-0x0;var _0x26985e=_0x31f0[_0x33a5b8];return _0x26985e;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('SquareMessage',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3776b4,_0x19a1e3){_0x3776b4=_0x3776b4-0x0;var _0x1636d9=_0x7fbe[_0x3776b4];return _0x1636d9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js
index a087e0d..6d92c63 100644
--- a/server/api/squareMessage/squareMessage.rpc.js
+++ b/server/api/squareMessage/squareMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x27a0=['moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateSquareMessage','SquareMessage','options','raw','catch','util'];(function(_0x1fbf00,_0x13db44){var _0x32b3e9=function(_0x5a941d){while(--_0x5a941d){_0x1fbf00['push'](_0x1fbf00['shift']());}};_0x32b3e9(++_0x13db44);}(_0x27a0,0xbf));var _0x027a=function(_0x4578fc,_0x43756c){_0x4578fc=_0x4578fc-0x0;var _0xbe02f4=_0x27a0[_0x4578fc];return _0xbe02f4;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require(_0x027a('0x2'));var rs=require(_0x027a('0x3'));var fs=require('fs');var Redis=require(_0x027a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x027a('0x5'));var jayson=require(_0x027a('0x6'));var client=jayson[_0x027a('0x7')][_0x027a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe233ed,_0x3c7d67,_0x550fbb){return new BPromise(function(_0x3d1429,_0x271dfe){return client[_0x027a('0x9')](_0xe233ed,_0x550fbb)['then'](function(_0x44c56a){logger[_0x027a('0xa')](_0x027a('0xb'),_0x3c7d67,'request\x20sent');logger[_0x027a('0xc')](_0x027a('0xd'),_0x3c7d67,_0x027a('0xe'),JSON[_0x027a('0xf')](_0x44c56a));if(_0x44c56a[_0x027a('0x10')]){if(_0x44c56a[_0x027a('0x10')][_0x027a('0x11')]===0x1f4){logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x271dfe(_0x44c56a['error'][_0x027a('0x12')]);}logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x3d1429(_0x44c56a['error']['message']);}else{logger[_0x027a('0xa')]('SquareMessage,\x20%s,\x20%s',_0x3c7d67,_0x027a('0xe'));_0x3d1429(_0x44c56a['result'][_0x027a('0x12')]);}})['catch'](function(_0x4dc3ab){logger['error'](_0x027a('0xb'),_0x3c7d67,_0x4dc3ab);_0x271dfe(_0x4dc3ab);});});}exports[_0x027a('0x13')]=function(_0x826d19){var _0x1fb40b=this;return new Promise(function(_0x52125e,_0x282e70){return db[_0x027a('0x14')]['create'](_0x826d19['body'],{'raw':_0x826d19[_0x027a('0x15')]?_0x826d19['options'][_0x027a('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x59511c){logger['info']('CreateSquareMessage',_0x826d19);logger[_0x027a('0xc')](_0x027a('0x13'),_0x826d19,JSON[_0x027a('0xf')](_0x59511c));_0x52125e(_0x59511c);})[_0x027a('0x17')](function(_0x51b870){logger[_0x027a('0x10')](_0x027a('0x13'),_0x51b870[_0x027a('0x12')],_0x826d19);_0x282e70(_0x1fb40b[_0x027a('0x10')](0x1f4,_0x51b870[_0x027a('0x12')]));});});};
\ No newline at end of file
+var _0x6455=['create','options','raw','debug','catch','CreateSquareMessage','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5fbb8f,_0x16f5ff){var _0x525f9f=function(_0x4a34f7){while(--_0x4a34f7){_0x5fbb8f['push'](_0x5fbb8f['shift']());}};_0x525f9f(++_0x16f5ff);}(_0x6455,0x97));var _0x5645=function(_0xda69e4,_0x207473){_0xda69e4=_0xda69e4-0x0;var _0x3529aa=_0x6455[_0xda69e4];return _0x3529aa;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d672,_0xa14a06,_0x278d86){return new BPromise(function(_0x518a28,_0x5f4037){return client[_0x5645('0xc')](_0x37d672,_0x278d86)[_0x5645('0xd')](function(_0x38c07a){logger[_0x5645('0xe')](_0x5645('0xf'),_0xa14a06,_0x5645('0x10'));logger['debug'](_0x5645('0x11'),_0xa14a06,_0x5645('0x10'),JSON[_0x5645('0x12')](_0x38c07a));if(_0x38c07a[_0x5645('0x13')]){if(_0x38c07a['error'][_0x5645('0x14')]===0x1f4){logger['error'](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);return _0x5f4037(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')]['message']);return _0x518a28(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}else{logger[_0x5645('0xe')]('SquareMessage,\x20%s,\x20%s',_0xa14a06,'request\x20sent');_0x518a28(_0x38c07a[_0x5645('0x16')][_0x5645('0x15')]);}})['catch'](function(_0x35e0c7){logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x35e0c7);_0x5f4037(_0x35e0c7);});});}exports['CreateSquareMessage']=function(_0x35bc6f){var _0x1d519d=this;return new Promise(function(_0x22a6cf,_0x102c19){return db['SquareMessage'][_0x5645('0x17')](_0x35bc6f['body'],{'raw':_0x35bc6f['options']?_0x35bc6f[_0x5645('0x18')][_0x5645('0x19')]===undefined?!![]:![]:!![]})[_0x5645('0xd')](function(_0x59a491){logger[_0x5645('0xe')]('CreateSquareMessage',_0x35bc6f);logger[_0x5645('0x1a')]('CreateSquareMessage',_0x35bc6f,JSON['stringify'](_0x59a491));_0x22a6cf(_0x59a491);})[_0x5645('0x1b')](function(_0x53d763){logger[_0x5645('0x13')](_0x5645('0x1c'),_0x53d763['message'],_0x35bc6f);_0x102c19(_0x1d519d[_0x5645('0x13')](0x1f4,_0x53d763[_0x5645('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js
index 36af315..f5189fe 100644
--- a/server/api/squareOdbc/index.js
+++ b/server/api/squareOdbc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e25=['../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','destroy','exports','multer','util','path','express','../../components/auth/service'];(function(_0x43666b,_0x36e883){var _0x4a0f79=function(_0x5a9ae9){while(--_0x5a9ae9){_0x43666b['push'](_0x43666b['shift']());}};_0x4a0f79(++_0x36e883);}(_0x3e25,0x14f));var _0x53e2=function(_0x33748e,_0x60cf5){_0x33748e=_0x33748e-0x0;var _0x3383bd=_0x3e25[_0x33748e];return _0x3383bd;};'use strict';var multer=require(_0x53e2('0x0'));var util=require(_0x53e2('0x1'));var path=require(_0x53e2('0x2'));var timeout=require('connect-timeout');var express=require(_0x53e2('0x3'));var router=express['Router']();var auth=require(_0x53e2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x53e2('0x5'));var controller=require(_0x53e2('0x6'));router[_0x53e2('0x7')]('/',auth[_0x53e2('0x8')](),controller[_0x53e2('0x9')]);router[_0x53e2('0x7')](_0x53e2('0xa'),auth[_0x53e2('0x8')](),controller[_0x53e2('0xb')]);router[_0x53e2('0x7')](_0x53e2('0xc'),auth[_0x53e2('0x8')](),timeout(_0x53e2('0xd')),controller[_0x53e2('0xe')]);router[_0x53e2('0xf')]('/',auth[_0x53e2('0x8')](),controller[_0x53e2('0x10')]);router[_0x53e2('0x11')]('/:id',auth[_0x53e2('0x8')](),controller['update']);router['delete']('/:id',auth[_0x53e2('0x8')](),controller[_0x53e2('0x12')]);module[_0x53e2('0x13')]=router;
\ No newline at end of file
+var _0xba78=['/:id','destroy','exports','multer','path','connect-timeout','Router','../../config/environment','./squareOdbc.controller','index','get','isAuthenticated','show','/:id/test','test','post','create','put','delete'];(function(_0x165834,_0x49e6d7){var _0x2f8df1=function(_0x224230){while(--_0x224230){_0x165834['push'](_0x165834['shift']());}};_0x2f8df1(++_0x49e6d7);}(_0xba78,0x159));var _0x8ba7=function(_0x125680,_0x19bb61){_0x125680=_0x125680-0x0;var _0x37d4a9=_0xba78[_0x125680];return _0x37d4a9;};'use strict';var multer=require(_0x8ba7('0x0'));var util=require('util');var path=require(_0x8ba7('0x1'));var timeout=require(_0x8ba7('0x2'));var express=require('express');var router=express[_0x8ba7('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8ba7('0x4'));var controller=require(_0x8ba7('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x8ba7('0x6')]);router[_0x8ba7('0x7')]('/:id',auth[_0x8ba7('0x8')](),controller[_0x8ba7('0x9')]);router[_0x8ba7('0x7')](_0x8ba7('0xa'),auth[_0x8ba7('0x8')](),timeout('15s'),controller[_0x8ba7('0xb')]);router[_0x8ba7('0xc')]('/',auth[_0x8ba7('0x8')](),controller[_0x8ba7('0xd')]);router[_0x8ba7('0xe')]('/:id',auth[_0x8ba7('0x8')](),controller['update']);router[_0x8ba7('0xf')](_0x8ba7('0x10'),auth[_0x8ba7('0x8')](),controller[_0x8ba7('0x11')]);module[_0x8ba7('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js
index 85502af..057b296 100644
--- a/server/api/squareOdbc/squareOdbc.attributes.js
+++ b/server/api/squareOdbc/squareOdbc.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3b4a=['name','sequelize','exports','STRING'];(function(_0x4ae874,_0x33b4e2){var _0x4156f7=function(_0x3b6e22){while(--_0x3b6e22){_0x4ae874['push'](_0x4ae874['shift']());}};_0x4156f7(++_0x33b4e2);}(_0x3b4a,0x105));var _0xa3b4=function(_0x53bef4,_0x3faddf){_0x53bef4=_0x53bef4-0x0;var _0xc5c4f0=_0x3b4a[_0x53bef4];return _0xc5c4f0;};'use strict';var Sequelize=require(_0xa3b4('0x0'));module[_0xa3b4('0x1')]={'name':{'type':Sequelize[_0xa3b4('0x2')],'unique':_0xa3b4('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa3b4('0x2')]}};
\ No newline at end of file
+var _0xd6d5=['name','sequelize','STRING'];(function(_0x1247a8,_0x16755c){var _0x2daeaf=function(_0x28db82){while(--_0x28db82){_0x1247a8['push'](_0x1247a8['shift']());}};_0x2daeaf(++_0x16755c);}(_0xd6d5,0x1c9));var _0x5d6d=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0xd6d5[_0x32e649];return _0x14d386;};'use strict';var Sequelize=require(_0x5d6d('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d6d('0x1')],'unique':_0x5d6d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x5d6d('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js
index b0d7919..576a6bf 100644
--- a/server/api/squareOdbc/squareOdbc.controller.js
+++ b/server/api/squareOdbc/squareOdbc.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf5c=['ioredis','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','send','map','SquareOdbc','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x23a173,_0x4c4dbf){var _0x2b80cd=function(_0x250d54){while(--_0x250d54){_0x23a173['push'](_0x23a173['shift']());}};_0x2b80cd(++_0x4c4dbf);}(_0xbf5c,0xf2));var _0xcbf5=function(_0x4b60c8,_0x39577c){_0x4b60c8=_0x4b60c8-0x0;var _0x23036f=_0xbf5c[_0x4b60c8];return _0x23036f;};'use strict';var pdf=require(_0xcbf5('0x0'));var emlformat=require(_0xcbf5('0x1'));var rimraf=require(_0xcbf5('0x2'));var zipdir=require(_0xcbf5('0x3'));var jsonpatch=require(_0xcbf5('0x4'));var rp=require(_0xcbf5('0x5'));var moment=require(_0xcbf5('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xcbf5('0x7'));var util=require('util');var path=require(_0xcbf5('0x8'));var sox=require(_0xcbf5('0x9'));var csv=require(_0xcbf5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcbf5('0xb'));var squel=require('squel');var crypto=require(_0xcbf5('0xc'));var jsforce=require(_0xcbf5('0xd'));var deskjs=require(_0xcbf5('0xe'));var toCsv=require(_0xcbf5('0xa'));var querystring=require('querystring');var Papa=require(_0xcbf5('0xf'));var Redis=require(_0xcbf5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcbf5('0x11'));var logger=require(_0xcbf5('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcbf5('0x13'))['db'];function respondWithStatusCode(_0x2aa5d1,_0x1228f7){_0x1228f7=_0x1228f7||0xcc;return function(_0xf87311){if(_0xf87311){return _0x2aa5d1[_0xcbf5('0x14')](_0x1228f7);}return _0x2aa5d1[_0xcbf5('0x15')](_0x1228f7)[_0xcbf5('0x16')]();};}function respondWithResult(_0x1c36ab,_0x1e80f1){_0x1e80f1=_0x1e80f1||0xc8;return function(_0x2ed848){if(_0x2ed848){return _0x1c36ab['status'](_0x1e80f1)['json'](_0x2ed848);}};}function respondWithFilteredResult(_0x25f3e6,_0xa03917){return function(_0x436f7f){if(_0x436f7f){var _0x181fb0=_0x436f7f[_0xcbf5('0x17')],_0x4b9da8=_0xa03917[_0xcbf5('0x18')],_0x23dd15=_0xa03917[_0xcbf5('0x18')]+_0xa03917[_0xcbf5('0x19')],_0x4cad9b;if(_0x23dd15>=_0x181fb0){_0x23dd15=_0x181fb0;_0x4cad9b=0xc8;}else{_0x4cad9b=0xce;}_0x25f3e6['status'](_0x4cad9b);return _0x25f3e6[_0xcbf5('0x1a')](_0xcbf5('0x1b'),_0x4b9da8+'-'+_0x23dd15+'/'+_0x181fb0)[_0xcbf5('0x1c')](_0x436f7f);}return null;};}function patchUpdates(_0x3a4a00){return function(_0x264b9d){try{jsonpatch[_0xcbf5('0x1d')](_0x264b9d,_0x3a4a00,!![]);}catch(_0x45df05){return BPromise['reject'](_0x45df05);}return _0x264b9d[_0xcbf5('0x1e')]();};}function saveUpdates(_0x52071d,_0x40e7e7){return function(_0x27c12d){if(_0x27c12d){return _0x27c12d[_0xcbf5('0x1f')](_0x52071d)[_0xcbf5('0x20')](function(_0x8e62b0){return _0x8e62b0;});}return null;};}function removeEntity(_0x305ecf,_0x3487e5){return function(_0x6a2567){if(_0x6a2567){return _0x6a2567[_0xcbf5('0x21')]()[_0xcbf5('0x20')](function(){var _0x3ad5b9=_0x6a2567[_0xcbf5('0x22')]({'plain':!![]});var _0x5705d8=_0xcbf5('0x23');return db[_0xcbf5('0x24')][_0xcbf5('0x21')]({'where':{'type':_0x5705d8,'resourceId':_0x3ad5b9['id']}})[_0xcbf5('0x20')](function(){return _0x6a2567;});})[_0xcbf5('0x20')](function(){_0x305ecf['status'](0xcc)[_0xcbf5('0x16')]();});}};}function handleEntityNotFound(_0x3ab67b,_0x472f7a){return function(_0x37c5ff){if(!_0x37c5ff){_0x3ab67b[_0xcbf5('0x14')](0x194);}return _0x37c5ff;};}function handleError(_0x49b016,_0x57ddd4){_0x57ddd4=_0x57ddd4||0x1f4;return function(_0x1b8bec){logger[_0xcbf5('0x25')](_0x1b8bec[_0xcbf5('0x26')]);if(_0x1b8bec['name']){delete _0x1b8bec['name'];}_0x49b016[_0xcbf5('0x15')](_0x57ddd4)[_0xcbf5('0x27')](_0x1b8bec);};}exports['index']=function(_0xe257d4,_0x6de7b){var _0x10b5ca={},_0xf8fc5e={},_0x583183={'count':0x0,'rows':[]};var _0x26f2d0=_[_0xcbf5('0x28')](db[_0xcbf5('0x29')]['rawAttributes'],function(_0x39a291){return{'name':_0x39a291[_0xcbf5('0x2a')],'type':_0x39a291[_0xcbf5('0x2b')][_0xcbf5('0x2c')]};});_0xf8fc5e[_0xcbf5('0x2d')]=_[_0xcbf5('0x28')](_0x26f2d0,_0xcbf5('0x2e'));_0xf8fc5e[_0xcbf5('0x2f')]=_[_0xcbf5('0x30')](_0xe257d4[_0xcbf5('0x2f')]);_0xf8fc5e[_0xcbf5('0x31')]=_[_0xcbf5('0x32')](_0xf8fc5e[_0xcbf5('0x2d')],_0xf8fc5e[_0xcbf5('0x2f')]);_0x10b5ca[_0xcbf5('0x33')]=_['intersection'](_0xf8fc5e[_0xcbf5('0x2d')],qs['fields'](_0xe257d4['query']['fields']));_0x10b5ca[_0xcbf5('0x33')]=_0x10b5ca[_0xcbf5('0x33')][_0xcbf5('0x34')]?_0x10b5ca['attributes']:_0xf8fc5e[_0xcbf5('0x2d')];if(!_0xe257d4[_0xcbf5('0x2f')][_0xcbf5('0x35')](_0xcbf5('0x36'))){_0x10b5ca[_0xcbf5('0x19')]=qs[_0xcbf5('0x19')](_0xe257d4['query'][_0xcbf5('0x19')]);_0x10b5ca[_0xcbf5('0x18')]=qs[_0xcbf5('0x18')](_0xe257d4[_0xcbf5('0x2f')]['offset']);}_0x10b5ca[_0xcbf5('0x37')]=qs['sort'](_0xe257d4[_0xcbf5('0x2f')][_0xcbf5('0x38')]);_0x10b5ca[_0xcbf5('0x39')]=qs[_0xcbf5('0x31')](_[_0xcbf5('0x3a')](_0xe257d4[_0xcbf5('0x2f')],_0xf8fc5e['filters']),_0x26f2d0);if(_0xe257d4['query']['filter']){_0x10b5ca[_0xcbf5('0x39')]=_[_0xcbf5('0x3b')](_0x10b5ca['where'],{'$or':_[_0xcbf5('0x28')](_0x26f2d0,function(_0x1dae8a){if(_0x1dae8a['type']!==_0xcbf5('0x3c')){var _0xb25bc={};_0xb25bc[_0x1dae8a[_0xcbf5('0x2e')]]={'$like':'%'+_0xe257d4[_0xcbf5('0x2f')][_0xcbf5('0x3d')]+'%'};return _0xb25bc;}})});}_0x10b5ca=_[_0xcbf5('0x3b')]({},_0x10b5ca,_0xe257d4[_0xcbf5('0x3e')]);var _0x31c85c={'where':_0x10b5ca[_0xcbf5('0x39')]};return db[_0xcbf5('0x29')]['count'](_0x31c85c)['then'](function(_0x1a6071){_0x583183[_0xcbf5('0x17')]=_0x1a6071;if(_0xe257d4[_0xcbf5('0x2f')][_0xcbf5('0x3f')]){_0x10b5ca[_0xcbf5('0x40')]=[{'all':!![]}];}return db[_0xcbf5('0x29')][_0xcbf5('0x41')](_0x10b5ca);})['then'](function(_0x2de14a){_0x583183[_0xcbf5('0x42')]=_0x2de14a;return _0x583183;})[_0xcbf5('0x20')](respondWithFilteredResult(_0x6de7b,_0x10b5ca))['catch'](handleError(_0x6de7b,null));};exports[_0xcbf5('0x43')]=function(_0x23dc65,_0x30c528){var _0x4a92ba={'raw':!![],'where':{'id':_0x23dc65[_0xcbf5('0x44')]['id']}},_0x3a12ac={};_0x3a12ac[_0xcbf5('0x2d')]=_['keys'](db[_0xcbf5('0x29')][_0xcbf5('0x45')]);_0x3a12ac[_0xcbf5('0x2f')]=_[_0xcbf5('0x30')](_0x23dc65['query']);_0x3a12ac[_0xcbf5('0x31')]=_[_0xcbf5('0x32')](_0x3a12ac[_0xcbf5('0x2d')],_0x3a12ac['query']);_0x4a92ba[_0xcbf5('0x33')]=_[_0xcbf5('0x32')](_0x3a12ac[_0xcbf5('0x2d')],qs['fields'](_0x23dc65[_0xcbf5('0x2f')][_0xcbf5('0x46')]));_0x4a92ba['attributes']=_0x4a92ba[_0xcbf5('0x33')][_0xcbf5('0x34')]?_0x4a92ba[_0xcbf5('0x33')]:_0x3a12ac[_0xcbf5('0x2d')];if(_0x23dc65[_0xcbf5('0x2f')]['includeAll']){_0x4a92ba[_0xcbf5('0x40')]=[{'all':!![]}];}_0x4a92ba=_[_0xcbf5('0x3b')]({},_0x4a92ba,_0x23dc65[_0xcbf5('0x3e')]);return db['SquareOdbc'][_0xcbf5('0x47')](_0x4a92ba)[_0xcbf5('0x20')](handleEntityNotFound(_0x30c528,null))['then'](respondWithResult(_0x30c528,null))[_0xcbf5('0x48')](handleError(_0x30c528,null));};exports[_0xcbf5('0x49')]=function(_0x393a89,_0x31e0c5){return db[_0xcbf5('0x29')][_0xcbf5('0x49')](_0x393a89[_0xcbf5('0x4a')],{})[_0xcbf5('0x20')](function(_0x2ae599){var _0x1c8694=_0x393a89[_0xcbf5('0x4b')][_0xcbf5('0x22')]({'plain':!![]});if(!_0x1c8694)throw new Error(_0xcbf5('0x4c'));if(_0x1c8694[_0xcbf5('0x4d')]==='user'){var _0x3412f2=_0x2ae599[_0xcbf5('0x22')]({'plain':!![]});var _0x5d4796=_0xcbf5('0x23');return db[_0xcbf5('0x4e')]['find']({'where':{'name':_0x5d4796,'userProfileId':_0x1c8694['userProfileId']},'raw':!![]})[_0xcbf5('0x20')](function(_0xe7ed51){if(_0xe7ed51&&_0xe7ed51[_0xcbf5('0x4f')]===0x0){return db[_0xcbf5('0x24')]['create']({'name':_0x3412f2[_0xcbf5('0x2e')],'resourceId':_0x3412f2['id'],'type':_0xe7ed51[_0xcbf5('0x2e')],'sectionId':_0xe7ed51['id']},{})['then'](function(){return _0x2ae599;});}else{return _0x2ae599;}})[_0xcbf5('0x48')](function(_0x472d3f){logger[_0xcbf5('0x25')](_0xcbf5('0x50'),_0x472d3f);throw _0x472d3f;});}return _0x2ae599;})[_0xcbf5('0x20')](respondWithResult(_0x31e0c5,0xc9))['catch'](handleError(_0x31e0c5,null));};exports[_0xcbf5('0x1f')]=function(_0xb13ba3,_0xf6cdb8){if(_0xb13ba3['body']['id']){delete _0xb13ba3['body']['id'];}return db[_0xcbf5('0x29')][_0xcbf5('0x47')]({'where':{'id':_0xb13ba3[_0xcbf5('0x44')]['id']}})[_0xcbf5('0x20')](handleEntityNotFound(_0xf6cdb8,null))[_0xcbf5('0x20')](saveUpdates(_0xb13ba3[_0xcbf5('0x4a')],null))['then'](respondWithResult(_0xf6cdb8,null))[_0xcbf5('0x48')](handleError(_0xf6cdb8,null));};exports[_0xcbf5('0x21')]=function(_0x52dd38,_0xae85d0){return db[_0xcbf5('0x29')]['find']({'where':{'id':_0x52dd38['params']['id']}})[_0xcbf5('0x20')](handleEntityNotFound(_0xae85d0,null))['then'](removeEntity(_0xae85d0,null))[_0xcbf5('0x48')](handleError(_0xae85d0,null));};exports[_0xcbf5('0x51')]=function(_0xcc1a47,_0x32f7a1,_0x1d2fde){var _0x45a8a3;return db[_0xcbf5('0x29')][_0xcbf5('0x47')]({'where':{'id':_0xcc1a47['params']['id']},'attributes':['id',_0xcbf5('0x52')]})['then'](handleEntityNotFound(_0x32f7a1,null))[_0xcbf5('0x20')](function(_0x2351a9){if(_0x2351a9){var _0x2cdf83=require(_0xcbf5('0x53'))();_0x2cdf83[_0xcbf5('0x54')](_0x2351a9[_0xcbf5('0x52')]);_0x2cdf83[_0xcbf5('0x55')]();return _0x2351a9;}})[_0xcbf5('0x20')](respondWithResult(_0x32f7a1,null))[_0xcbf5('0x48')](handleError(_0x32f7a1,null));};
\ No newline at end of file
+var _0xdf52=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','ODBC','error','stack','name','send','index','map','SquareOdbc','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','destroy','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','fast-json-patch','moment'];(function(_0x3975cd,_0x49c190){var _0x2a5d5b=function(_0x2ab345){while(--_0x2ab345){_0x3975cd['push'](_0x3975cd['shift']());}};_0x2a5d5b(++_0x49c190);}(_0xdf52,0x106));var _0x2df5=function(_0x35a5a1,_0xaca631){_0x35a5a1=_0x35a5a1-0x0;var _0x227793=_0xdf52[_0x35a5a1];return _0x227793;};'use strict';var pdf=require(_0x2df5('0x0'));var emlformat=require(_0x2df5('0x1'));var rimraf=require(_0x2df5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2df5('0x3'));var rp=require('request-promise');var moment=require(_0x2df5('0x4'));var BPromise=require(_0x2df5('0x5'));var Mustache=require(_0x2df5('0x6'));var util=require(_0x2df5('0x7'));var path=require(_0x2df5('0x8'));var sox=require(_0x2df5('0x9'));var csv=require(_0x2df5('0xa'));var ejs=require(_0x2df5('0xb'));var fs=require('fs');var _=require(_0x2df5('0xc'));var squel=require(_0x2df5('0xd'));var crypto=require('crypto');var jsforce=require(_0x2df5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2df5('0xa'));var querystring=require(_0x2df5('0xf'));var Papa=require(_0x2df5('0x10'));var Redis=require(_0x2df5('0x11'));var authService=require(_0x2df5('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2df5('0x13'));var logger=require('../../config/logger')(_0x2df5('0x14'));var utils=require(_0x2df5('0x15'));var config=require(_0x2df5('0x16'));var db=require(_0x2df5('0x17'))['db'];function respondWithStatusCode(_0x5ba199,_0x1811de){_0x1811de=_0x1811de||0xcc;return function(_0x593877){if(_0x593877){return _0x5ba199[_0x2df5('0x18')](_0x1811de);}return _0x5ba199[_0x2df5('0x19')](_0x1811de)[_0x2df5('0x1a')]();};}function respondWithResult(_0x3774aa,_0x46e070){_0x46e070=_0x46e070||0xc8;return function(_0x1c508f){if(_0x1c508f){return _0x3774aa[_0x2df5('0x19')](_0x46e070)[_0x2df5('0x1b')](_0x1c508f);}};}function respondWithFilteredResult(_0x3004d8,_0x232eea){return function(_0x30fabe){if(_0x30fabe){var _0x59e51c=_0x30fabe[_0x2df5('0x1c')],_0x53ad12=_0x232eea[_0x2df5('0x1d')],_0xaaf920=_0x232eea[_0x2df5('0x1d')]+_0x232eea[_0x2df5('0x1e')],_0x69afb5;if(_0xaaf920>=_0x59e51c){_0xaaf920=_0x59e51c;_0x69afb5=0xc8;}else{_0x69afb5=0xce;}_0x3004d8['status'](_0x69afb5);return _0x3004d8[_0x2df5('0x1f')](_0x2df5('0x20'),_0x53ad12+'-'+_0xaaf920+'/'+_0x59e51c)[_0x2df5('0x1b')](_0x30fabe);}return null;};}function patchUpdates(_0x2f2b6a){return function(_0x10e0fb){try{jsonpatch[_0x2df5('0x21')](_0x10e0fb,_0x2f2b6a,!![]);}catch(_0x1aa13e){return BPromise[_0x2df5('0x22')](_0x1aa13e);}return _0x10e0fb[_0x2df5('0x23')]();};}function saveUpdates(_0x23c270,_0x53062c){return function(_0x40ff31){if(_0x40ff31){return _0x40ff31[_0x2df5('0x24')](_0x23c270)['then'](function(_0x4cebda){return _0x4cebda;});}return null;};}function removeEntity(_0x502a82,_0x2679dd){return function(_0x482a10){if(_0x482a10){return _0x482a10['destroy']()[_0x2df5('0x25')](function(){var _0x508df3=_0x482a10['get']({'plain':!![]});var _0x27766b=_0x2df5('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x27766b,'resourceId':_0x508df3['id']}})[_0x2df5('0x25')](function(){return _0x482a10;});})[_0x2df5('0x25')](function(){_0x502a82[_0x2df5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f7c82,_0x398c87){return function(_0x58df0b){if(!_0x58df0b){_0x3f7c82[_0x2df5('0x18')](0x194);}return _0x58df0b;};}function handleError(_0x193203,_0x21992b){_0x21992b=_0x21992b||0x1f4;return function(_0x3960ac){logger[_0x2df5('0x27')](_0x3960ac[_0x2df5('0x28')]);if(_0x3960ac[_0x2df5('0x29')]){delete _0x3960ac[_0x2df5('0x29')];}_0x193203[_0x2df5('0x19')](_0x21992b)[_0x2df5('0x2a')](_0x3960ac);};}exports[_0x2df5('0x2b')]=function(_0xe84cf0,_0x513793){var _0x258a6f={},_0xbf3243={},_0x248f62={'count':0x0,'rows':[]};var _0x50046f=_[_0x2df5('0x2c')](db[_0x2df5('0x2d')]['rawAttributes'],function(_0x40274f){return{'name':_0x40274f[_0x2df5('0x2e')],'type':_0x40274f[_0x2df5('0x2f')][_0x2df5('0x30')]};});_0xbf3243[_0x2df5('0x31')]=_[_0x2df5('0x2c')](_0x50046f,_0x2df5('0x29'));_0xbf3243[_0x2df5('0x32')]=_['keys'](_0xe84cf0[_0x2df5('0x32')]);_0xbf3243[_0x2df5('0x33')]=_['intersection'](_0xbf3243[_0x2df5('0x31')],_0xbf3243[_0x2df5('0x32')]);_0x258a6f[_0x2df5('0x34')]=_[_0x2df5('0x35')](_0xbf3243[_0x2df5('0x31')],qs[_0x2df5('0x36')](_0xe84cf0[_0x2df5('0x32')][_0x2df5('0x36')]));_0x258a6f['attributes']=_0x258a6f['attributes'][_0x2df5('0x37')]?_0x258a6f[_0x2df5('0x34')]:_0xbf3243[_0x2df5('0x31')];if(!_0xe84cf0['query']['hasOwnProperty']('nolimit')){_0x258a6f[_0x2df5('0x1e')]=qs[_0x2df5('0x1e')](_0xe84cf0[_0x2df5('0x32')][_0x2df5('0x1e')]);_0x258a6f[_0x2df5('0x1d')]=qs['offset'](_0xe84cf0[_0x2df5('0x32')][_0x2df5('0x1d')]);}_0x258a6f[_0x2df5('0x38')]=qs['sort'](_0xe84cf0[_0x2df5('0x32')][_0x2df5('0x39')]);_0x258a6f[_0x2df5('0x3a')]=qs[_0x2df5('0x33')](_[_0x2df5('0x3b')](_0xe84cf0[_0x2df5('0x32')],_0xbf3243[_0x2df5('0x33')]),_0x50046f);if(_0xe84cf0[_0x2df5('0x32')][_0x2df5('0x3c')]){_0x258a6f[_0x2df5('0x3a')]=_[_0x2df5('0x3d')](_0x258a6f[_0x2df5('0x3a')],{'$or':_[_0x2df5('0x2c')](_0x50046f,function(_0x246146){if(_0x246146['type']!==_0x2df5('0x3e')){var _0x4ccacb={};_0x4ccacb[_0x246146[_0x2df5('0x29')]]={'$like':'%'+_0xe84cf0[_0x2df5('0x32')][_0x2df5('0x3c')]+'%'};return _0x4ccacb;}})});}_0x258a6f=_[_0x2df5('0x3d')]({},_0x258a6f,_0xe84cf0[_0x2df5('0x3f')]);var _0x5bfecf={'where':_0x258a6f[_0x2df5('0x3a')]};return db[_0x2df5('0x2d')][_0x2df5('0x1c')](_0x5bfecf)['then'](function(_0x423cae){_0x248f62[_0x2df5('0x1c')]=_0x423cae;if(_0xe84cf0[_0x2df5('0x32')][_0x2df5('0x40')]){_0x258a6f[_0x2df5('0x41')]=[{'all':!![]}];}return db[_0x2df5('0x2d')][_0x2df5('0x42')](_0x258a6f);})[_0x2df5('0x25')](function(_0x3145a5){_0x248f62[_0x2df5('0x43')]=_0x3145a5;return _0x248f62;})['then'](respondWithFilteredResult(_0x513793,_0x258a6f))[_0x2df5('0x44')](handleError(_0x513793,null));};exports[_0x2df5('0x45')]=function(_0x357f7c,_0x25242b){var _0x3bd808={'raw':!![],'where':{'id':_0x357f7c[_0x2df5('0x46')]['id']}},_0x16eec5={};_0x16eec5[_0x2df5('0x31')]=_[_0x2df5('0x47')](db['SquareOdbc'][_0x2df5('0x48')]);_0x16eec5[_0x2df5('0x32')]=_[_0x2df5('0x47')](_0x357f7c[_0x2df5('0x32')]);_0x16eec5['filters']=_[_0x2df5('0x35')](_0x16eec5[_0x2df5('0x31')],_0x16eec5[_0x2df5('0x32')]);_0x3bd808[_0x2df5('0x34')]=_['intersection'](_0x16eec5['model'],qs['fields'](_0x357f7c[_0x2df5('0x32')]['fields']));_0x3bd808[_0x2df5('0x34')]=_0x3bd808[_0x2df5('0x34')][_0x2df5('0x37')]?_0x3bd808[_0x2df5('0x34')]:_0x16eec5[_0x2df5('0x31')];if(_0x357f7c[_0x2df5('0x32')][_0x2df5('0x40')]){_0x3bd808[_0x2df5('0x41')]=[{'all':!![]}];}_0x3bd808=_['merge']({},_0x3bd808,_0x357f7c['options']);return db[_0x2df5('0x2d')]['find'](_0x3bd808)[_0x2df5('0x25')](handleEntityNotFound(_0x25242b,null))[_0x2df5('0x25')](respondWithResult(_0x25242b,null))[_0x2df5('0x44')](handleError(_0x25242b,null));};exports[_0x2df5('0x49')]=function(_0x13f1b9,_0x4ba732){return db[_0x2df5('0x2d')][_0x2df5('0x49')](_0x13f1b9[_0x2df5('0x4a')],{})[_0x2df5('0x25')](function(_0x182649){var _0x471a8d=_0x13f1b9[_0x2df5('0x4b')][_0x2df5('0x4c')]({'plain':!![]});if(!_0x471a8d)throw new Error(_0x2df5('0x4d'));if(_0x471a8d[_0x2df5('0x4e')]===_0x2df5('0x4b')){var _0x105cbb=_0x182649[_0x2df5('0x4c')]({'plain':!![]});var _0x3df8b4=_0x2df5('0x26');return db[_0x2df5('0x4f')][_0x2df5('0x50')]({'where':{'name':_0x3df8b4,'userProfileId':_0x471a8d[_0x2df5('0x51')]},'raw':!![]})[_0x2df5('0x25')](function(_0x58bf61){if(_0x58bf61&&_0x58bf61[_0x2df5('0x52')]===0x0){return db[_0x2df5('0x53')]['create']({'name':_0x105cbb[_0x2df5('0x29')],'resourceId':_0x105cbb['id'],'type':_0x58bf61[_0x2df5('0x29')],'sectionId':_0x58bf61['id']},{})[_0x2df5('0x25')](function(){return _0x182649;});}else{return _0x182649;}})['catch'](function(_0x549948){logger[_0x2df5('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x549948);throw _0x549948;});}return _0x182649;})[_0x2df5('0x25')](respondWithResult(_0x4ba732,0xc9))[_0x2df5('0x44')](handleError(_0x4ba732,null));};exports[_0x2df5('0x24')]=function(_0x22f51d,_0x5bfbb9){if(_0x22f51d[_0x2df5('0x4a')]['id']){delete _0x22f51d[_0x2df5('0x4a')]['id'];}return db[_0x2df5('0x2d')]['find']({'where':{'id':_0x22f51d[_0x2df5('0x46')]['id']}})[_0x2df5('0x25')](handleEntityNotFound(_0x5bfbb9,null))[_0x2df5('0x25')](saveUpdates(_0x22f51d[_0x2df5('0x4a')],null))[_0x2df5('0x25')](respondWithResult(_0x5bfbb9,null))[_0x2df5('0x44')](handleError(_0x5bfbb9,null));};exports[_0x2df5('0x54')]=function(_0x5dbee1,_0x15d326){return db['SquareOdbc'][_0x2df5('0x50')]({'where':{'id':_0x5dbee1[_0x2df5('0x46')]['id']}})[_0x2df5('0x25')](handleEntityNotFound(_0x15d326,null))[_0x2df5('0x25')](removeEntity(_0x15d326,null))[_0x2df5('0x44')](handleError(_0x15d326,null));};exports['test']=function(_0x5c8df6,_0x3f6b8f,_0x449440){var _0x5712aa;return db[_0x2df5('0x2d')][_0x2df5('0x50')]({'where':{'id':_0x5c8df6['params']['id']},'attributes':['id',_0x2df5('0x55')]})[_0x2df5('0x25')](handleEntityNotFound(_0x3f6b8f,null))[_0x2df5('0x25')](function(_0x2a16d6){if(_0x2a16d6){var _0x5389ab=require(_0x2df5('0x56'))();_0x5389ab[_0x2df5('0x57')](_0x2a16d6[_0x2df5('0x55')]);_0x5389ab[_0x2df5('0x58')]();return _0x2a16d6;}})[_0x2df5('0x25')](respondWithResult(_0x3f6b8f,null))['catch'](handleError(_0x3f6b8f,null));};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js
index 247936e..e5cc354 100644
--- a/server/api/squareOdbc/squareOdbc.model.js
+++ b/server/api/squareOdbc/squareOdbc.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf65=['request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api','bluebird'];(function(_0x4d02c0,_0x432cc6){var _0x5660f6=function(_0xa177aa){while(--_0xa177aa){_0x4d02c0['push'](_0x4d02c0['shift']());}};_0x5660f6(++_0x432cc6);}(_0xbf65,0x158));var _0x5bf6=function(_0x3bbb66,_0x280aa2){_0x3bbb66=_0x3bbb66-0x0;var _0x872225=_0xbf65[_0x3bbb66];return _0x872225;};'use strict';var _=require(_0x5bf6('0x0'));var util=require(_0x5bf6('0x1'));var logger=require('../../config/logger')(_0x5bf6('0x2'));var moment=require('moment');var BPromise=require(_0x5bf6('0x3'));var rp=require(_0x5bf6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bf6('0x5'));var config=require(_0x5bf6('0x6'));var attributes=require(_0x5bf6('0x7'));module[_0x5bf6('0x8')]=function(_0x3853b9,_0xe20271){return _0x3853b9[_0x5bf6('0x9')](_0x5bf6('0xa'),attributes,{'tableName':_0x5bf6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8726=['request-promise','rimraf','../../config/environment','exports','define','square_odbc','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2de0cb,_0x572968){var _0xa3367c=function(_0x5935ea){while(--_0x5935ea){_0x2de0cb['push'](_0x2de0cb['shift']());}};_0xa3367c(++_0x572968);}(_0x8726,0x13a));var _0x6872=function(_0x4e93bb,_0x2a8417){_0x4e93bb=_0x4e93bb-0x0;var _0x52da93=_0x8726[_0x4e93bb];return _0x52da93;};'use strict';var _=require(_0x6872('0x0'));var util=require(_0x6872('0x1'));var logger=require(_0x6872('0x2'))('api');var moment=require(_0x6872('0x3'));var BPromise=require(_0x6872('0x4'));var rp=require(_0x6872('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6872('0x6'));var config=require(_0x6872('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x6872('0x8')]=function(_0x828a86,_0x229a5c){return _0x828a86[_0x6872('0x9')]('SquareOdbc',attributes,{'tableName':_0x6872('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js
index bacea86..7fa9ffd 100644
--- a/server/api/squareOdbc/squareOdbc.rpc.js
+++ b/server/api/squareOdbc/squareOdbc.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0x5fc3,0xa8));var _0x35fc=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x5fc3[_0xa8883];return _0x479426;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['SquareOdbc'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});};
\ No newline at end of file
+var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','options','where','include','map','attributes'];(function(_0x387016,_0x51cfb7){var _0x40041f=function(_0x462bb5){while(--_0x462bb5){_0x387016['push'](_0x387016['shift']());}};_0x40041f(++_0x51cfb7);}(_0x814b,0x1a2));var _0xb814=function(_0x33314d,_0x499628){_0x33314d=_0x33314d-0x0;var _0x4ffe8e=_0x814b[_0x33314d];return _0x4ffe8e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['SquareOdbc']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowSquareOdbc',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js
index c539168..4840aaf 100644
--- a/server/api/squareProject/index.js
+++ b/server/api/squareProject/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7916=['destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','getUsers','post','create','/:id/users','addUsers','put','/:id','update','delete'];(function(_0x1998bb,_0x1f1da1){var _0x4ae4c9=function(_0x4741e8){while(--_0x4741e8){_0x1998bb['push'](_0x1998bb['shift']());}};_0x4ae4c9(++_0x1f1da1);}(_0x7916,0x128));var _0x6791=function(_0x4630c9,_0xd229d3){_0x4630c9=_0x4630c9-0x0;var _0x10b8bd=_0x7916[_0x4630c9];return _0x10b8bd;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var auth=require(_0x6791('0x4'));var interaction=require(_0x6791('0x5'));var config=require(_0x6791('0x6'));var controller=require('./squareProject.controller');router[_0x6791('0x7')]('/',auth['isAuthenticated'](),controller[_0x6791('0x8')]);router[_0x6791('0x7')]('/:id',auth[_0x6791('0x9')](),controller['show']);router[_0x6791('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x6791('0xa')]);router[_0x6791('0xb')]('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xb')](_0x6791('0xd'),auth['isAuthenticated'](),controller[_0x6791('0xe')]);router[_0x6791('0xf')](_0x6791('0x10'),auth[_0x6791('0x9')](),controller[_0x6791('0x11')]);router[_0x6791('0x12')](_0x6791('0x10'),auth[_0x6791('0x9')](),controller[_0x6791('0x13')]);router[_0x6791('0x12')](_0x6791('0xd'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x6791('0x14')]=router;
\ No newline at end of file
+var _0x8f4c=['removeUsers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get','/:id/users','getUsers','post','create','put','update','delete','/:id'];(function(_0x347c3c,_0x28788f){var _0x45908c=function(_0x85fa79){while(--_0x85fa79){_0x347c3c['push'](_0x347c3c['shift']());}};_0x45908c(++_0x28788f);}(_0x8f4c,0x113));var _0xc8f4=function(_0x421673,_0x364b94){_0x421673=_0x421673-0x0;var _0x100326=_0x8f4c[_0x421673];return _0x100326;};'use strict';var multer=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var path=require(_0xc8f4('0x2'));var timeout=require(_0xc8f4('0x3'));var express=require(_0xc8f4('0x4'));var router=express[_0xc8f4('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc8f4('0x6'));var config=require(_0xc8f4('0x7'));var controller=require(_0xc8f4('0x8'));router['get']('/',auth[_0xc8f4('0x9')](),controller['index']);router['get']('/:id',auth[_0xc8f4('0x9')](),controller['show']);router[_0xc8f4('0xa')](_0xc8f4('0xb'),auth[_0xc8f4('0x9')](),controller[_0xc8f4('0xc')]);router[_0xc8f4('0xd')]('/',auth['isAuthenticated'](),controller[_0xc8f4('0xe')]);router[_0xc8f4('0xd')](_0xc8f4('0xb'),auth[_0xc8f4('0x9')](),controller['addUsers']);router[_0xc8f4('0xf')]('/:id',auth[_0xc8f4('0x9')](),controller[_0xc8f4('0x10')]);router[_0xc8f4('0x11')](_0xc8f4('0x12'),auth[_0xc8f4('0x9')](),controller['destroy']);router[_0xc8f4('0x11')](_0xc8f4('0xb'),auth[_0xc8f4('0x9')](),controller[_0xc8f4('0x13')]);module[_0xc8f4('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js
index 584483d..dca37d1 100644
--- a/server/api/squareProject/squareProject.attributes.js
+++ b/server/api/squareProject/squareProject.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x04fc=['toString','utf8','production','sequelize','STRING','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x404a07,_0x115023){var _0xfb1c31=function(_0x22fb5f){while(--_0x22fb5f){_0x404a07['push'](_0x404a07['shift']());}};_0xfb1c31(++_0x115023);}(_0x04fc,0xb7));var _0xc04f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x04fc[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc04f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc04f('0x1')]},'notes':{'type':Sequelize[_0xc04f('0x2')]},'preproduction':{'type':Sequelize[_0xc04f('0x3')](_0xc04f('0x4')),'get':function(){if(this[_0xc04f('0x5')](_0xc04f('0x6'))){return this['getDataValue'](_0xc04f('0x6'))[_0xc04f('0x7')](_0xc04f('0x8'));}}},'production':{'type':Sequelize[_0xc04f('0x3')]('long'),'get':function(){if(this[_0xc04f('0x5')](_0xc04f('0x9'))){return this[_0xc04f('0x5')]('production')['toString'](_0xc04f('0x8'));}}}};
\ No newline at end of file
+var _0x0148=['TEXT','long','getDataValue','preproduction','toString','utf8','BLOB','production','STRING','name'];(function(_0x96a5af,_0xce3d6e){var _0x63200c=function(_0x1e94d7){while(--_0x1e94d7){_0x96a5af['push'](_0x96a5af['shift']());}};_0x63200c(++_0xce3d6e);}(_0x0148,0x12a));var _0x8014=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x0148[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8014('0x0')],'unique':_0x8014('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x8014('0x0')]},'notes':{'type':Sequelize[_0x8014('0x2')]},'preproduction':{'type':Sequelize['BLOB'](_0x8014('0x3')),'get':function(){if(this[_0x8014('0x4')](_0x8014('0x5'))){return this[_0x8014('0x4')](_0x8014('0x5'))[_0x8014('0x6')](_0x8014('0x7'));}}},'production':{'type':Sequelize[_0x8014('0x8')](_0x8014('0x3')),'get':function(){if(this[_0x8014('0x4')](_0x8014('0x9'))){return this['getDataValue'](_0x8014('0x9'))[_0x8014('0x6')](_0x8014('0x7'));}}}};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js
index 239ad0a..792cc1e 100644
--- a/server/api/squareProject/squareProject.controller.js
+++ b/server/api/squareProject/squareProject.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f3c=['index','map','SquareProject','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','merge','where','options','include','rows','catch','show','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','get','destroy','then','error','stack','name','send'];(function(_0x259f97,_0x2a17ac){var _0x26b146=function(_0x20612f){while(--_0x20612f){_0x259f97['push'](_0x259f97['shift']());}};_0x26b146(++_0x2a17ac);}(_0x2f3c,0x1b0));var _0xc2f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f3c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc2f3('0x0'));var emlformat=require(_0xc2f3('0x1'));var rimraf=require(_0xc2f3('0x2'));var zipdir=require(_0xc2f3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc2f3('0x4'));var BPromise=require(_0xc2f3('0x5'));var Mustache=require('mustache');var util=require(_0xc2f3('0x6'));var path=require(_0xc2f3('0x7'));var sox=require(_0xc2f3('0x8'));var csv=require('to-csv');var ejs=require(_0xc2f3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc2f3('0xa'));var jsforce=require(_0xc2f3('0xb'));var deskjs=require(_0xc2f3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc2f3('0xd'));var Redis=require(_0xc2f3('0xe'));var authService=require(_0xc2f3('0xf'));var qs=require(_0xc2f3('0x10'));var as=require(_0xc2f3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc2f3('0x12'))(_0xc2f3('0x13'));var utils=require(_0xc2f3('0x14'));var config=require('../../config/environment');var db=require(_0xc2f3('0x15'))['db'];config[_0xc2f3('0x16')]=_[_0xc2f3('0x17')](config[_0xc2f3('0x16')],{'host':_0xc2f3('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')[_0xc2f3('0x19')](socket);function respondWithStatusCode(_0x43ec57,_0x5510f1){_0x5510f1=_0x5510f1||0xcc;return function(_0x41173d){if(_0x41173d){return _0x43ec57[_0xc2f3('0x1a')](_0x5510f1);}return _0x43ec57[_0xc2f3('0x1b')](_0x5510f1)[_0xc2f3('0x1c')]();};}function respondWithResult(_0x100f1b,_0xb00073){_0xb00073=_0xb00073||0xc8;return function(_0x475c41){if(_0x475c41){return _0x100f1b[_0xc2f3('0x1b')](_0xb00073)[_0xc2f3('0x1d')](_0x475c41);}};}function respondWithFilteredResult(_0x32005c,_0x40d752){return function(_0x4b574c){if(_0x4b574c){var _0x59d9b5=_0x4b574c[_0xc2f3('0x1e')],_0x22c4aa=_0x40d752['offset'],_0xabb27c=_0x40d752[_0xc2f3('0x1f')]+_0x40d752['limit'],_0x5ea253;if(_0xabb27c>=_0x59d9b5){_0xabb27c=_0x59d9b5;_0x5ea253=0xc8;}else{_0x5ea253=0xce;}_0x32005c[_0xc2f3('0x1b')](_0x5ea253);return _0x32005c['set'](_0xc2f3('0x20'),_0x22c4aa+'-'+_0xabb27c+'/'+_0x59d9b5)[_0xc2f3('0x1d')](_0x4b574c);}return null;};}function patchUpdates(_0x40a01d){return function(_0x17d8fa){try{jsonpatch[_0xc2f3('0x21')](_0x17d8fa,_0x40a01d,!![]);}catch(_0x17bd38){return BPromise[_0xc2f3('0x22')](_0x17bd38);}return _0x17d8fa[_0xc2f3('0x23')]();};}function saveUpdates(_0x23aaa4,_0x5a7a1b){return function(_0x13eb2e){if(_0x13eb2e){return _0x13eb2e['update'](_0x23aaa4)['then'](function(_0x717b63){return _0x717b63;});}return null;};}function removeEntity(_0x5d18fc,_0x2d127a){return function(_0x20ae1d){if(_0x20ae1d){return _0x20ae1d['destroy']()['then'](function(){var _0x531ead=_0x20ae1d[_0xc2f3('0x24')]({'plain':!![]});var _0x3f47c2='SquareProjects';return db['UserProfileResource'][_0xc2f3('0x25')]({'where':{'type':_0x3f47c2,'resourceId':_0x531ead['id']}})[_0xc2f3('0x26')](function(){return _0x20ae1d;});})[_0xc2f3('0x26')](function(){_0x5d18fc[_0xc2f3('0x1b')](0xcc)[_0xc2f3('0x1c')]();});}};}function handleEntityNotFound(_0x54eb72,_0xfec034){return function(_0x45102c){if(!_0x45102c){_0x54eb72[_0xc2f3('0x1a')](0x194);}return _0x45102c;};}function handleError(_0x30f70d,_0x12940b){_0x12940b=_0x12940b||0x1f4;return function(_0x5325d4){logger[_0xc2f3('0x27')](_0x5325d4[_0xc2f3('0x28')]);if(_0x5325d4[_0xc2f3('0x29')]){delete _0x5325d4[_0xc2f3('0x29')];}_0x30f70d[_0xc2f3('0x1b')](_0x12940b)[_0xc2f3('0x2a')](_0x5325d4);};}exports[_0xc2f3('0x2b')]=function(_0x1d4463,_0x3f6918){var _0x485ab4={},_0xaae420={},_0xf0f98f={'count':0x0,'rows':[]};var _0x20ab72=_[_0xc2f3('0x2c')](db[_0xc2f3('0x2d')][_0xc2f3('0x2e')],function(_0x255f34){return{'name':_0x255f34['fieldName'],'type':_0x255f34[_0xc2f3('0x2f')][_0xc2f3('0x30')]};});_0xaae420[_0xc2f3('0x31')]=_[_0xc2f3('0x2c')](_0x20ab72,_0xc2f3('0x29'));_0xaae420['query']=_['keys'](_0x1d4463[_0xc2f3('0x32')]);_0xaae420[_0xc2f3('0x33')]=_[_0xc2f3('0x34')](_0xaae420[_0xc2f3('0x31')],_0xaae420[_0xc2f3('0x32')]);_0x485ab4[_0xc2f3('0x35')]=_[_0xc2f3('0x34')](_0xaae420['model'],qs[_0xc2f3('0x36')](_0x1d4463[_0xc2f3('0x32')]['fields']));_0x485ab4[_0xc2f3('0x35')]=_0x485ab4['attributes'][_0xc2f3('0x37')]?_0x485ab4['attributes']:_0xaae420[_0xc2f3('0x31')];if(!_0x1d4463[_0xc2f3('0x32')][_0xc2f3('0x38')]('nolimit')){_0x485ab4['limit']=qs[_0xc2f3('0x39')](_0x1d4463[_0xc2f3('0x32')]['limit']);_0x485ab4['offset']=qs[_0xc2f3('0x1f')](_0x1d4463[_0xc2f3('0x32')][_0xc2f3('0x1f')]);}_0x485ab4[_0xc2f3('0x3a')]=qs[_0xc2f3('0x3b')](_0x1d4463[_0xc2f3('0x32')][_0xc2f3('0x3b')]);_0x485ab4['where']=qs[_0xc2f3('0x33')](_[_0xc2f3('0x3c')](_0x1d4463[_0xc2f3('0x32')],_0xaae420[_0xc2f3('0x33')]),_0x20ab72);if(_0x1d4463[_0xc2f3('0x32')][_0xc2f3('0x3d')]){_0x485ab4['where']=_[_0xc2f3('0x3e')](_0x485ab4[_0xc2f3('0x3f')],{'$or':_[_0xc2f3('0x2c')](_0x20ab72,function(_0x4127bc){if(_0x4127bc[_0xc2f3('0x2f')]!=='VIRTUAL'){var _0x2129d9={};_0x2129d9[_0x4127bc['name']]={'$like':'%'+_0x1d4463['query'][_0xc2f3('0x3d')]+'%'};return _0x2129d9;}})});}_0x485ab4=_[_0xc2f3('0x3e')]({},_0x485ab4,_0x1d4463[_0xc2f3('0x40')]);var _0x279518={'where':_0x485ab4['where']};return db['SquareProject'][_0xc2f3('0x1e')](_0x279518)['then'](function(_0x547f8b){_0xf0f98f[_0xc2f3('0x1e')]=_0x547f8b;if(_0x1d4463[_0xc2f3('0x32')]['includeAll']){_0x485ab4[_0xc2f3('0x41')]=[{'all':!![]}];}return db[_0xc2f3('0x2d')]['findAll'](_0x485ab4);})[_0xc2f3('0x26')](function(_0x58bc29){_0xf0f98f[_0xc2f3('0x42')]=_0x58bc29;return _0xf0f98f;})[_0xc2f3('0x26')](respondWithFilteredResult(_0x3f6918,_0x485ab4))[_0xc2f3('0x43')](handleError(_0x3f6918,null));};exports[_0xc2f3('0x44')]=function(_0x2d8694,_0x590dc2){var _0x299425={'raw':![],'where':{'id':_0x2d8694['params']['id']}},_0x2f29a1={};_0x2f29a1[_0xc2f3('0x31')]=_[_0xc2f3('0x45')](db[_0xc2f3('0x2d')]['rawAttributes']);_0x2f29a1[_0xc2f3('0x32')]=_['keys'](_0x2d8694[_0xc2f3('0x32')]);_0x2f29a1[_0xc2f3('0x33')]=_[_0xc2f3('0x34')](_0x2f29a1['model'],_0x2f29a1['query']);_0x299425['attributes']=_[_0xc2f3('0x34')](_0x2f29a1[_0xc2f3('0x31')],qs[_0xc2f3('0x36')](_0x2d8694[_0xc2f3('0x32')]['fields']));_0x299425[_0xc2f3('0x35')]=_0x299425['attributes'][_0xc2f3('0x37')]?_0x299425[_0xc2f3('0x35')]:_0x2f29a1['model'];if(_0x2d8694[_0xc2f3('0x32')][_0xc2f3('0x46')]){_0x299425['include']=[{'all':!![]}];}_0x299425=_[_0xc2f3('0x3e')]({},_0x299425,_0x2d8694[_0xc2f3('0x40')]);return db[_0xc2f3('0x2d')]['find'](_0x299425)[_0xc2f3('0x26')](handleEntityNotFound(_0x590dc2,null))['then'](respondWithResult(_0x590dc2,null))[_0xc2f3('0x43')](handleError(_0x590dc2,null));};exports[_0xc2f3('0x47')]=function(_0x5c9d4a,_0x2e82d1){return db[_0xc2f3('0x2d')][_0xc2f3('0x47')](_0x5c9d4a[_0xc2f3('0x48')],{})[_0xc2f3('0x26')](function(_0x504a4b){var _0x3cc6e2=_0x5c9d4a[_0xc2f3('0x49')][_0xc2f3('0x24')]({'plain':!![]});if(!_0x3cc6e2)throw new Error(_0xc2f3('0x4a'));if(_0x3cc6e2['role']==='user'){var _0x42a7af=_0x504a4b[_0xc2f3('0x24')]({'plain':!![]});var _0x20e777=_0xc2f3('0x4b');return db[_0xc2f3('0x4c')][_0xc2f3('0x4d')]({'where':{'name':_0x20e777,'userProfileId':_0x3cc6e2[_0xc2f3('0x4e')]},'raw':!![]})[_0xc2f3('0x26')](function(_0x5008b0){if(_0x5008b0&&_0x5008b0[_0xc2f3('0x4f')]===0x0){return db[_0xc2f3('0x50')][_0xc2f3('0x47')]({'name':_0x42a7af[_0xc2f3('0x29')],'resourceId':_0x42a7af['id'],'type':_0x5008b0[_0xc2f3('0x29')],'sectionId':_0x5008b0['id']},{})[_0xc2f3('0x26')](function(){return _0x504a4b;});}else{return _0x504a4b;}})[_0xc2f3('0x43')](function(_0x416cd9){logger['error'](_0xc2f3('0x51'),_0x416cd9);throw _0x416cd9;});}return _0x504a4b;})[_0xc2f3('0x26')](respondWithResult(_0x2e82d1,0xc9))[_0xc2f3('0x43')](handleError(_0x2e82d1,null));};exports[_0xc2f3('0x52')]=function(_0x2ad0fa,_0x4bd91a){if(_0x2ad0fa[_0xc2f3('0x48')]['id']){delete _0x2ad0fa[_0xc2f3('0x48')]['id'];}return db['SquareProject'][_0xc2f3('0x4d')]({'where':{'id':_0x2ad0fa[_0xc2f3('0x53')]['id']}})[_0xc2f3('0x26')](handleEntityNotFound(_0x4bd91a,null))['then'](saveUpdates(_0x2ad0fa[_0xc2f3('0x48')],null))[_0xc2f3('0x26')](respondWithResult(_0x4bd91a,null))[_0xc2f3('0x43')](handleError(_0x4bd91a,null));};exports[_0xc2f3('0x25')]=function(_0x19bfa6,_0x41fb86){return db[_0xc2f3('0x2d')][_0xc2f3('0x4d')]({'where':{'id':_0x19bfa6[_0xc2f3('0x53')]['id']}})[_0xc2f3('0x26')](handleEntityNotFound(_0x41fb86,null))[_0xc2f3('0x26')](removeEntity(_0x41fb86,null))['catch'](handleError(_0x41fb86,null));};exports[_0xc2f3('0x54')]=function(_0x1cd1fa,_0x3c7e2d,_0x5998ab){return db[_0xc2f3('0x2d')][_0xc2f3('0x4d')]({'where':{'id':_0x1cd1fa[_0xc2f3('0x53')]['id']}})[_0xc2f3('0x26')](handleEntityNotFound(_0x3c7e2d,null))[_0xc2f3('0x26')](function(_0x110f80){if(_0x110f80){return _0x110f80['addUsers'](_0x1cd1fa[_0xc2f3('0x48')][_0xc2f3('0x55')],_[_0xc2f3('0x56')](_0x1cd1fa[_0xc2f3('0x48')],[_0xc2f3('0x55'),'id'])||{});}})[_0xc2f3('0x26')](respondWithResult(_0x3c7e2d,null))['catch'](handleError(_0x3c7e2d,null));};exports['removeUsers']=function(_0x17714a,_0x3c289d,_0x40bc54){return db['SquareProject'][_0xc2f3('0x4d')]({'where':{'id':_0x17714a[_0xc2f3('0x53')]['id']}})[_0xc2f3('0x26')](handleEntityNotFound(_0x3c289d,null))[_0xc2f3('0x26')](function(_0x39c789){if(_0x39c789){return _0x39c789[_0xc2f3('0x57')](_0x17714a[_0xc2f3('0x32')][_0xc2f3('0x55')])[_0xc2f3('0x26')](function(){if(_[_0xc2f3('0x58')](_0x17714a[_0xc2f3('0x32')][_0xc2f3('0x55')])){for(var _0x40ecac=0x0;_0x40ecac<_0x17714a['query'][_0xc2f3('0x55')][_0xc2f3('0x37')];_0x40ecac+=0x1){socket[_0xc2f3('0x59')](_0xc2f3('0x5a'),{'UserId':Number(_0x17714a['query']['ids'][_0x40ecac]),'SquareProjectId':Number(_0x17714a['params']['id'])});}}else{socket['emit'](_0xc2f3('0x5a'),{'UserId':Number(_0x17714a[_0xc2f3('0x32')][_0xc2f3('0x55')]),'SquareProjectId':Number(_0x17714a[_0xc2f3('0x53')]['id'])});}});}})[_0xc2f3('0x26')](respondWithStatusCode(_0x3c289d,null))['catch'](handleError(_0x3c289d,null));};exports[_0xc2f3('0x5b')]=function(_0x529e00,_0x4dc2fa,_0x517ad1){var _0x179bb6={};var _0x32ac5e={};var _0xba8c3a;var _0x39d50f;return db[_0xc2f3('0x2d')][_0xc2f3('0x5c')]({'where':{'id':_0x529e00[_0xc2f3('0x53')]['id']}})[_0xc2f3('0x26')](handleEntityNotFound(_0x4dc2fa,null))[_0xc2f3('0x26')](function(_0x2f9677){if(_0x2f9677){_0xba8c3a=_0x2f9677;_0x32ac5e[_0xc2f3('0x31')]=_['keys'](db[_0xc2f3('0x5d')][_0xc2f3('0x2e')]);_0x32ac5e[_0xc2f3('0x32')]=_[_0xc2f3('0x45')](_0x529e00['query']);_0x32ac5e[_0xc2f3('0x33')]=_[_0xc2f3('0x34')](_0x32ac5e[_0xc2f3('0x31')],_0x32ac5e['query']);_0x179bb6[_0xc2f3('0x35')]=_['intersection'](_0x32ac5e[_0xc2f3('0x31')],qs[_0xc2f3('0x36')](_0x529e00[_0xc2f3('0x32')]['fields']));_0x179bb6['attributes']=_0x179bb6[_0xc2f3('0x35')][_0xc2f3('0x37')]?_0x179bb6[_0xc2f3('0x35')]:_0x32ac5e['model'];_0x179bb6[_0xc2f3('0x3a')]=qs[_0xc2f3('0x3b')](_0x529e00['query'][_0xc2f3('0x3b')]);_0x179bb6[_0xc2f3('0x3f')]=qs[_0xc2f3('0x33')](_['pick'](_0x529e00[_0xc2f3('0x32')],_0x32ac5e['filters']));if(_0x529e00['query'][_0xc2f3('0x3d')]){_0x179bb6['where']=_[_0xc2f3('0x3e')](_0x179bb6[_0xc2f3('0x3f')],{'$or':_['map'](_0x179bb6[_0xc2f3('0x35')],function(_0x50c647){var _0x225605={};_0x225605[_0x50c647]={'$like':'%'+_0x529e00['query'][_0xc2f3('0x3d')]+'%'};return _0x225605;})});}_0x179bb6=_[_0xc2f3('0x3e')]({},_0x179bb6,_0x529e00['options']);return _0xba8c3a['getUsers'](_0x179bb6);}})['then'](function(_0x54bcbb){if(_0x54bcbb){_0x39d50f=_0x54bcbb[_0xc2f3('0x37')];if(!_0x529e00[_0xc2f3('0x32')][_0xc2f3('0x38')](_0xc2f3('0x5e'))){_0x179bb6['limit']=qs[_0xc2f3('0x39')](_0x529e00[_0xc2f3('0x32')][_0xc2f3('0x39')]);_0x179bb6[_0xc2f3('0x1f')]=qs[_0xc2f3('0x1f')](_0x529e00[_0xc2f3('0x32')]['offset']);}return _0xba8c3a[_0xc2f3('0x5b')](_0x179bb6);}})[_0xc2f3('0x26')](function(_0x196326){if(_0x196326){return _0x196326?{'count':_0x39d50f,'rows':_0x196326}:null;}})[_0xc2f3('0x26')](respondWithResult(_0x4dc2fa,null))['catch'](handleError(_0x4dc2fa,null));};
\ No newline at end of file
+var _0xb981=['end','status','json','count','offset','limit','apply','reject','update','then','get','SquareProjects','UserProfileResource','destroy','name','send','index','map','SquareProject','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','sort','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus'];(function(_0x4bae0a,_0x16c57d){var _0xfc451b=function(_0x3c076c){while(--_0x3c076c){_0x4bae0a['push'](_0x4bae0a['shift']());}};_0xfc451b(++_0x16c57d);}(_0xb981,0xa2));var _0x1b98=function(_0x5be892,_0x68238a){_0x5be892=_0x5be892-0x0;var _0x53fc35=_0xb981[_0x5be892];return _0x53fc35;};'use strict';var pdf=require(_0x1b98('0x0'));var emlformat=require(_0x1b98('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1b98('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b98('0x3'));var BPromise=require(_0x1b98('0x4'));var Mustache=require(_0x1b98('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1b98('0x6'));var csv=require('to-csv');var ejs=require(_0x1b98('0x7'));var fs=require('fs');var _=require(_0x1b98('0x8'));var squel=require(_0x1b98('0x9'));var crypto=require(_0x1b98('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b98('0xb'));var toCsv=require(_0x1b98('0xc'));var querystring=require('querystring');var Papa=require(_0x1b98('0xd'));var Redis=require(_0x1b98('0xe'));var authService=require(_0x1b98('0xf'));var qs=require(_0x1b98('0x10'));var as=require(_0x1b98('0x11'));var hardwareService=require(_0x1b98('0x12'));var logger=require(_0x1b98('0x13'))(_0x1b98('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1b98('0x15')]=_[_0x1b98('0x16')](config[_0x1b98('0x15')],{'host':_0x1b98('0x17'),'port':0x18eb});var socket=require(_0x1b98('0x18'))(new Redis(config['redis']));require(_0x1b98('0x19'))[_0x1b98('0x1a')](socket);function respondWithStatusCode(_0xec259,_0x2bdc97){_0x2bdc97=_0x2bdc97||0xcc;return function(_0x37dac9){if(_0x37dac9){return _0xec259[_0x1b98('0x1b')](_0x2bdc97);}return _0xec259['status'](_0x2bdc97)[_0x1b98('0x1c')]();};}function respondWithResult(_0x2df365,_0xbd5d73){_0xbd5d73=_0xbd5d73||0xc8;return function(_0x261233){if(_0x261233){return _0x2df365[_0x1b98('0x1d')](_0xbd5d73)[_0x1b98('0x1e')](_0x261233);}};}function respondWithFilteredResult(_0x51ed13,_0x51f457){return function(_0x4c34db){if(_0x4c34db){var _0x1151f6=_0x4c34db[_0x1b98('0x1f')],_0x346c70=_0x51f457[_0x1b98('0x20')],_0x274b4b=_0x51f457[_0x1b98('0x20')]+_0x51f457[_0x1b98('0x21')],_0x13f9ed;if(_0x274b4b>=_0x1151f6){_0x274b4b=_0x1151f6;_0x13f9ed=0xc8;}else{_0x13f9ed=0xce;}_0x51ed13[_0x1b98('0x1d')](_0x13f9ed);return _0x51ed13['set']('Content-Range',_0x346c70+'-'+_0x274b4b+'/'+_0x1151f6)[_0x1b98('0x1e')](_0x4c34db);}return null;};}function patchUpdates(_0x161f06){return function(_0x76c5de){try{jsonpatch[_0x1b98('0x22')](_0x76c5de,_0x161f06,!![]);}catch(_0x369018){return BPromise[_0x1b98('0x23')](_0x369018);}return _0x76c5de['save']();};}function saveUpdates(_0x323509,_0xf3a5a){return function(_0x590c16){if(_0x590c16){return _0x590c16[_0x1b98('0x24')](_0x323509)[_0x1b98('0x25')](function(_0x302c0e){return _0x302c0e;});}return null;};}function removeEntity(_0x3f458f,_0x1677df){return function(_0x13751e){if(_0x13751e){return _0x13751e['destroy']()['then'](function(){var _0x2301dc=_0x13751e[_0x1b98('0x26')]({'plain':!![]});var _0x20b42d=_0x1b98('0x27');return db[_0x1b98('0x28')][_0x1b98('0x29')]({'where':{'type':_0x20b42d,'resourceId':_0x2301dc['id']}})[_0x1b98('0x25')](function(){return _0x13751e;});})['then'](function(){_0x3f458f[_0x1b98('0x1d')](0xcc)[_0x1b98('0x1c')]();});}};}function handleEntityNotFound(_0x2c0de2,_0x293ce5){return function(_0x4c38bd){if(!_0x4c38bd){_0x2c0de2['sendStatus'](0x194);}return _0x4c38bd;};}function handleError(_0x1f4812,_0x367d94){_0x367d94=_0x367d94||0x1f4;return function(_0x512760){logger['error'](_0x512760['stack']);if(_0x512760[_0x1b98('0x2a')]){delete _0x512760[_0x1b98('0x2a')];}_0x1f4812[_0x1b98('0x1d')](_0x367d94)[_0x1b98('0x2b')](_0x512760);};}exports[_0x1b98('0x2c')]=function(_0x286df1,_0x2f467b){var _0x7926fa={},_0x263c27={},_0x58328e={'count':0x0,'rows':[]};var _0xb60096=_[_0x1b98('0x2d')](db[_0x1b98('0x2e')][_0x1b98('0x2f')],function(_0x2159a9){return{'name':_0x2159a9[_0x1b98('0x30')],'type':_0x2159a9['type'][_0x1b98('0x31')]};});_0x263c27[_0x1b98('0x32')]=_['map'](_0xb60096,'name');_0x263c27[_0x1b98('0x33')]=_['keys'](_0x286df1[_0x1b98('0x33')]);_0x263c27[_0x1b98('0x34')]=_[_0x1b98('0x35')](_0x263c27[_0x1b98('0x32')],_0x263c27['query']);_0x7926fa[_0x1b98('0x36')]=_[_0x1b98('0x35')](_0x263c27['model'],qs[_0x1b98('0x37')](_0x286df1[_0x1b98('0x33')][_0x1b98('0x37')]));_0x7926fa[_0x1b98('0x36')]=_0x7926fa['attributes'][_0x1b98('0x38')]?_0x7926fa[_0x1b98('0x36')]:_0x263c27[_0x1b98('0x32')];if(!_0x286df1[_0x1b98('0x33')][_0x1b98('0x39')]('nolimit')){_0x7926fa[_0x1b98('0x21')]=qs[_0x1b98('0x21')](_0x286df1[_0x1b98('0x33')][_0x1b98('0x21')]);_0x7926fa[_0x1b98('0x20')]=qs[_0x1b98('0x20')](_0x286df1[_0x1b98('0x33')][_0x1b98('0x20')]);}_0x7926fa[_0x1b98('0x3a')]=qs['sort'](_0x286df1[_0x1b98('0x33')]['sort']);_0x7926fa[_0x1b98('0x3b')]=qs[_0x1b98('0x34')](_[_0x1b98('0x3c')](_0x286df1[_0x1b98('0x33')],_0x263c27[_0x1b98('0x34')]),_0xb60096);if(_0x286df1[_0x1b98('0x33')][_0x1b98('0x3d')]){_0x7926fa[_0x1b98('0x3b')]=_[_0x1b98('0x3e')](_0x7926fa[_0x1b98('0x3b')],{'$or':_[_0x1b98('0x2d')](_0xb60096,function(_0x44f21f){if(_0x44f21f[_0x1b98('0x3f')]!==_0x1b98('0x40')){var _0xff21ea={};_0xff21ea[_0x44f21f[_0x1b98('0x2a')]]={'$like':'%'+_0x286df1[_0x1b98('0x33')][_0x1b98('0x3d')]+'%'};return _0xff21ea;}})});}_0x7926fa=_[_0x1b98('0x3e')]({},_0x7926fa,_0x286df1[_0x1b98('0x41')]);var _0x272828={'where':_0x7926fa[_0x1b98('0x3b')]};return db[_0x1b98('0x2e')]['count'](_0x272828)[_0x1b98('0x25')](function(_0x21d4fd){_0x58328e['count']=_0x21d4fd;if(_0x286df1[_0x1b98('0x33')][_0x1b98('0x42')]){_0x7926fa[_0x1b98('0x43')]=[{'all':!![]}];}return db[_0x1b98('0x2e')][_0x1b98('0x44')](_0x7926fa);})[_0x1b98('0x25')](function(_0x52f28){_0x58328e[_0x1b98('0x45')]=_0x52f28;return _0x58328e;})[_0x1b98('0x25')](respondWithFilteredResult(_0x2f467b,_0x7926fa))[_0x1b98('0x46')](handleError(_0x2f467b,null));};exports[_0x1b98('0x47')]=function(_0xc68fc2,_0x5d4ef4){var _0x1055d6={'raw':![],'where':{'id':_0xc68fc2[_0x1b98('0x48')]['id']}},_0x4e28dd={};_0x4e28dd[_0x1b98('0x32')]=_[_0x1b98('0x49')](db[_0x1b98('0x2e')][_0x1b98('0x2f')]);_0x4e28dd[_0x1b98('0x33')]=_[_0x1b98('0x49')](_0xc68fc2[_0x1b98('0x33')]);_0x4e28dd[_0x1b98('0x34')]=_[_0x1b98('0x35')](_0x4e28dd[_0x1b98('0x32')],_0x4e28dd[_0x1b98('0x33')]);_0x1055d6['attributes']=_[_0x1b98('0x35')](_0x4e28dd[_0x1b98('0x32')],qs[_0x1b98('0x37')](_0xc68fc2['query'][_0x1b98('0x37')]));_0x1055d6[_0x1b98('0x36')]=_0x1055d6[_0x1b98('0x36')][_0x1b98('0x38')]?_0x1055d6[_0x1b98('0x36')]:_0x4e28dd[_0x1b98('0x32')];if(_0xc68fc2['query'][_0x1b98('0x42')]){_0x1055d6['include']=[{'all':!![]}];}_0x1055d6=_['merge']({},_0x1055d6,_0xc68fc2[_0x1b98('0x41')]);return db['SquareProject'][_0x1b98('0x4a')](_0x1055d6)[_0x1b98('0x25')](handleEntityNotFound(_0x5d4ef4,null))[_0x1b98('0x25')](respondWithResult(_0x5d4ef4,null))[_0x1b98('0x46')](handleError(_0x5d4ef4,null));};exports[_0x1b98('0x4b')]=function(_0x57f9dd,_0x5ac0a7){return db[_0x1b98('0x2e')]['create'](_0x57f9dd[_0x1b98('0x4c')],{})[_0x1b98('0x25')](function(_0x1d0a37){var _0x53b524=_0x57f9dd[_0x1b98('0x4d')]['get']({'plain':!![]});if(!_0x53b524)throw new Error(_0x1b98('0x4e'));if(_0x53b524[_0x1b98('0x4f')]===_0x1b98('0x4d')){var _0x150284=_0x1d0a37['get']({'plain':!![]});var _0x4373ee=_0x1b98('0x27');return db[_0x1b98('0x50')][_0x1b98('0x4a')]({'where':{'name':_0x4373ee,'userProfileId':_0x53b524[_0x1b98('0x51')]},'raw':!![]})[_0x1b98('0x25')](function(_0x33bb2c){if(_0x33bb2c&&_0x33bb2c[_0x1b98('0x52')]===0x0){return db[_0x1b98('0x28')][_0x1b98('0x4b')]({'name':_0x150284['name'],'resourceId':_0x150284['id'],'type':_0x33bb2c['name'],'sectionId':_0x33bb2c['id']},{})['then'](function(){return _0x1d0a37;});}else{return _0x1d0a37;}})[_0x1b98('0x46')](function(_0x41f9a4){logger['error'](_0x1b98('0x53'),_0x41f9a4);throw _0x41f9a4;});}return _0x1d0a37;})[_0x1b98('0x25')](respondWithResult(_0x5ac0a7,0xc9))[_0x1b98('0x46')](handleError(_0x5ac0a7,null));};exports[_0x1b98('0x24')]=function(_0x5acda9,_0x5ec501){if(_0x5acda9[_0x1b98('0x4c')]['id']){delete _0x5acda9[_0x1b98('0x4c')]['id'];}return db[_0x1b98('0x2e')]['find']({'where':{'id':_0x5acda9[_0x1b98('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ec501,null))[_0x1b98('0x25')](saveUpdates(_0x5acda9['body'],null))[_0x1b98('0x25')](respondWithResult(_0x5ec501,null))[_0x1b98('0x46')](handleError(_0x5ec501,null));};exports[_0x1b98('0x29')]=function(_0x247dd1,_0x1205f5){return db[_0x1b98('0x2e')][_0x1b98('0x4a')]({'where':{'id':_0x247dd1[_0x1b98('0x48')]['id']}})[_0x1b98('0x25')](handleEntityNotFound(_0x1205f5,null))['then'](removeEntity(_0x1205f5,null))['catch'](handleError(_0x1205f5,null));};exports['addUsers']=function(_0x5dd8dc,_0x2bf161,_0x1214c8){return db[_0x1b98('0x2e')][_0x1b98('0x4a')]({'where':{'id':_0x5dd8dc[_0x1b98('0x48')]['id']}})[_0x1b98('0x25')](handleEntityNotFound(_0x2bf161,null))[_0x1b98('0x25')](function(_0x1b79f0){if(_0x1b79f0){return _0x1b79f0[_0x1b98('0x54')](_0x5dd8dc[_0x1b98('0x4c')][_0x1b98('0x55')],_[_0x1b98('0x56')](_0x5dd8dc[_0x1b98('0x4c')],[_0x1b98('0x55'),'id'])||{});}})[_0x1b98('0x25')](respondWithResult(_0x2bf161,null))['catch'](handleError(_0x2bf161,null));};exports[_0x1b98('0x57')]=function(_0x5af4d4,_0xf14e8f,_0x559c55){return db[_0x1b98('0x2e')][_0x1b98('0x4a')]({'where':{'id':_0x5af4d4[_0x1b98('0x48')]['id']}})[_0x1b98('0x25')](handleEntityNotFound(_0xf14e8f,null))[_0x1b98('0x25')](function(_0x5eb71b){if(_0x5eb71b){return _0x5eb71b[_0x1b98('0x57')](_0x5af4d4[_0x1b98('0x33')]['ids'])[_0x1b98('0x25')](function(){if(_[_0x1b98('0x58')](_0x5af4d4[_0x1b98('0x33')]['ids'])){for(var _0x56cde1=0x0;_0x56cde1<_0x5af4d4['query'][_0x1b98('0x55')][_0x1b98('0x38')];_0x56cde1+=0x1){socket[_0x1b98('0x59')](_0x1b98('0x5a'),{'UserId':Number(_0x5af4d4[_0x1b98('0x33')][_0x1b98('0x55')][_0x56cde1]),'SquareProjectId':Number(_0x5af4d4[_0x1b98('0x48')]['id'])});}}else{socket['emit'](_0x1b98('0x5a'),{'UserId':Number(_0x5af4d4[_0x1b98('0x33')][_0x1b98('0x55')]),'SquareProjectId':Number(_0x5af4d4[_0x1b98('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0xf14e8f,null))[_0x1b98('0x46')](handleError(_0xf14e8f,null));};exports[_0x1b98('0x5b')]=function(_0x3d7099,_0xdfbf87,_0xfdbe74){var _0x4c0a30={};var _0x130d75={};var _0x1b0a0d;var _0x35e1d3;return db['SquareProject'][_0x1b98('0x5c')]({'where':{'id':_0x3d7099['params']['id']}})[_0x1b98('0x25')](handleEntityNotFound(_0xdfbf87,null))[_0x1b98('0x25')](function(_0x234c83){if(_0x234c83){_0x1b0a0d=_0x234c83;_0x130d75['model']=_['keys'](db[_0x1b98('0x5d')]['rawAttributes']);_0x130d75[_0x1b98('0x33')]=_[_0x1b98('0x49')](_0x3d7099[_0x1b98('0x33')]);_0x130d75['filters']=_[_0x1b98('0x35')](_0x130d75[_0x1b98('0x32')],_0x130d75['query']);_0x4c0a30[_0x1b98('0x36')]=_[_0x1b98('0x35')](_0x130d75[_0x1b98('0x32')],qs['fields'](_0x3d7099[_0x1b98('0x33')][_0x1b98('0x37')]));_0x4c0a30['attributes']=_0x4c0a30[_0x1b98('0x36')]['length']?_0x4c0a30['attributes']:_0x130d75[_0x1b98('0x32')];_0x4c0a30[_0x1b98('0x3a')]=qs[_0x1b98('0x5e')](_0x3d7099['query']['sort']);_0x4c0a30['where']=qs[_0x1b98('0x34')](_['pick'](_0x3d7099[_0x1b98('0x33')],_0x130d75['filters']));if(_0x3d7099[_0x1b98('0x33')][_0x1b98('0x3d')]){_0x4c0a30[_0x1b98('0x3b')]=_[_0x1b98('0x3e')](_0x4c0a30['where'],{'$or':_[_0x1b98('0x2d')](_0x4c0a30[_0x1b98('0x36')],function(_0x30c816){var _0xc70c1c={};_0xc70c1c[_0x30c816]={'$like':'%'+_0x3d7099['query'][_0x1b98('0x3d')]+'%'};return _0xc70c1c;})});}_0x4c0a30=_['merge']({},_0x4c0a30,_0x3d7099['options']);return _0x1b0a0d[_0x1b98('0x5b')](_0x4c0a30);}})['then'](function(_0x360c2a){if(_0x360c2a){_0x35e1d3=_0x360c2a[_0x1b98('0x38')];if(!_0x3d7099[_0x1b98('0x33')][_0x1b98('0x39')]('nolimit')){_0x4c0a30[_0x1b98('0x21')]=qs[_0x1b98('0x21')](_0x3d7099[_0x1b98('0x33')][_0x1b98('0x21')]);_0x4c0a30[_0x1b98('0x20')]=qs['offset'](_0x3d7099[_0x1b98('0x33')][_0x1b98('0x20')]);}return _0x1b0a0d[_0x1b98('0x5b')](_0x4c0a30);}})[_0x1b98('0x25')](function(_0x55f6fa){if(_0x55f6fa){return _0x55f6fa?{'count':_0x35e1d3,'rows':_0x55f6fa}:null;}})[_0x1b98('0x25')](respondWithResult(_0xdfbf87,null))['catch'](handleError(_0xdfbf87,null));};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js
index a2e26ea..ab099de 100644
--- a/server/api/squareProject/squareProject.events.js
+++ b/server/api/squareProject/squareProject.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfd36=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x269fe2,_0x553e2c){var _0x1c5586=function(_0x16420b){while(--_0x16420b){_0x269fe2['push'](_0x269fe2['shift']());}};_0x1c5586(++_0x553e2c);}(_0xfd36,0xc4));var _0x6fd3=function(_0x2e5660,_0x3a3bac){_0x2e5660=_0x2e5660-0x0;var _0x4a2adc=_0xfd36[_0x2e5660];return _0x4a2adc;};'use strict';var EventEmitter=require(_0x6fd3('0x0'));var SquareProject=require(_0x6fd3('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x6fd3('0x2')](0x0);var events={'afterCreate':_0x6fd3('0x3'),'afterUpdate':_0x6fd3('0x4'),'afterDestroy':_0x6fd3('0x5')};function emitEvent(_0x44923a){return function(_0x24facf,_0x441d43,_0x136c8d){SquareProjectEvents[_0x6fd3('0x6')](_0x44923a+':'+_0x24facf['id'],_0x24facf);SquareProjectEvents['emit'](_0x44923a,_0x24facf);_0x136c8d(null);};}for(var e in events){if(events[_0x6fd3('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x6fd3('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0x8ca7=['hasOwnProperty','hook','exports','events','save','update','remove','emit'];(function(_0x10da82,_0x413bda){var _0x59678f=function(_0x37b490){while(--_0x37b490){_0x10da82['push'](_0x10da82['shift']());}};_0x59678f(++_0x413bda);}(_0x8ca7,0x9b));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x78ca('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x78ca('0x1'),'afterUpdate':_0x78ca('0x2'),'afterDestroy':_0x78ca('0x3')};function emitEvent(_0x2e9f35){return function(_0x3beb43,_0x38a093,_0x4fd806){SquareProjectEvents[_0x78ca('0x4')](_0x2e9f35+':'+_0x3beb43['id'],_0x3beb43);SquareProjectEvents[_0x78ca('0x4')](_0x2e9f35,_0x3beb43);_0x4fd806(null);};}for(var e in events){if(events[_0x78ca('0x5')](e)){var event=events[e];SquareProject[_0x78ca('0x6')](e,emitEvent(event));}}module[_0x78ca('0x7')]=SquareProjectEvents;
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js
index f410a61..0a351fe 100644
--- a/server/api/squareProject/squareProject.model.js
+++ b/server/api/squareProject/squareProject.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['square_projects','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x3b851d,_0x2452c3){var _0xe96a9c=function(_0x287b80){while(--_0x287b80){_0x3b851d['push'](_0x3b851d['shift']());}};_0xe96a9c(++_0x2452c3);}(_0x2032,0xd9));var _0x2203=function(_0x48210c,_0x527dbe){_0x48210c=_0x48210c-0x0;var _0x59dfe1=_0x2032[_0x48210c];return _0x59dfe1;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66fa=['define','SquareProject','square_projects','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x66fa,0x117));var _0xa66f=function(_0x3a541c,_0x49c2b2){_0x3a541c=_0x3a541c-0x0;var _0xb5b71e=_0x66fa[_0x3a541c];return _0xb5b71e;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js
index a47fe49..5b643dc 100644
--- a/server/api/squareProject/squareProject.rpc.js
+++ b/server/api/squareProject/squareProject.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x67ba=['ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x456db4,_0x3657eb){var _0x19c03d=function(_0x30d22e){while(--_0x30d22e){_0x456db4['push'](_0x456db4['shift']());}};_0x19c03d(++_0x3657eb);}(_0x67ba,0x1a1));var _0xa67b=function(_0x15d554,_0x2dade6){_0x15d554=_0x15d554-0x0;var _0x1e3580=_0x67ba[_0x15d554];return _0x1e3580;};'use strict';var _=require(_0xa67b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa67b('0x1'));var rs=require(_0xa67b('0x2'));var fs=require('fs');var Redis=require(_0xa67b('0x3'));var db=require(_0xa67b('0x4'))['db'];var utils=require(_0xa67b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa67b('0x6'));var jayson=require(_0xa67b('0x7'));var client=jayson[_0xa67b('0x8')][_0xa67b('0x9')]({'port':0x232a});config[_0xa67b('0xa')]=_[_0xa67b('0xb')](config[_0xa67b('0xa')],{'host':_0xa67b('0xc'),'port':0x18eb});var socket=require(_0xa67b('0xd'))(new Redis(config[_0xa67b('0xa')]));require(_0xa67b('0xe'))[_0xa67b('0xf')](socket);function respondWithRpcPromise(_0x5ffc23,_0x47ceae,_0x1e942b){return new BPromise(function(_0x27899c,_0xc1c177){return client['request'](_0x5ffc23,_0x1e942b)[_0xa67b('0x10')](function(_0x4077b0){logger['info'](_0xa67b('0x11'),_0x47ceae,_0xa67b('0x12'));logger[_0xa67b('0x13')](_0xa67b('0x14'),_0x47ceae,_0xa67b('0x12'),JSON[_0xa67b('0x15')](_0x4077b0));if(_0x4077b0[_0xa67b('0x16')]){if(_0x4077b0[_0xa67b('0x16')][_0xa67b('0x17')]===0x1f4){logger[_0xa67b('0x16')](_0xa67b('0x11'),_0x47ceae,_0x4077b0[_0xa67b('0x16')][_0xa67b('0x18')]);return _0xc1c177(_0x4077b0[_0xa67b('0x16')][_0xa67b('0x18')]);}logger['error']('SquareProject,\x20%s,\x20%s',_0x47ceae,_0x4077b0[_0xa67b('0x16')][_0xa67b('0x18')]);return _0x27899c(_0x4077b0[_0xa67b('0x16')]['message']);}else{logger[_0xa67b('0x19')](_0xa67b('0x11'),_0x47ceae,_0xa67b('0x12'));_0x27899c(_0x4077b0['result'][_0xa67b('0x18')]);}})[_0xa67b('0x1a')](function(_0x4b6084){logger[_0xa67b('0x16')](_0xa67b('0x11'),_0x47ceae,_0x4b6084);_0xc1c177(_0x4b6084);});});}exports[_0xa67b('0x1b')]=function(_0x12392b){var _0x1d672d=this;return new Promise(function(_0x4b4b19,_0x1c7617){return db[_0xa67b('0x1c')][_0xa67b('0x1d')]({'raw':_0x12392b[_0xa67b('0x1e')]?_0x12392b[_0xa67b('0x1e')][_0xa67b('0x1f')]===undefined?!![]:![]:!![],'where':_0x12392b['options']?_0x12392b[_0xa67b('0x1e')][_0xa67b('0x20')]||null:null,'attributes':_0x12392b[_0xa67b('0x1e')]?_0x12392b[_0xa67b('0x1e')][_0xa67b('0x21')]||null:null,'include':_0x12392b[_0xa67b('0x1e')]?_0x12392b[_0xa67b('0x1e')][_0xa67b('0x22')]?_[_0xa67b('0x23')](_0x12392b[_0xa67b('0x1e')][_0xa67b('0x22')],function(_0x5eb600){return{'model':db[_0x5eb600[_0xa67b('0x24')]],'as':_0x5eb600['as'],'attributes':_0x5eb600[_0xa67b('0x21')],'include':_0x5eb600[_0xa67b('0x22')]?_[_0xa67b('0x23')](_0x5eb600[_0xa67b('0x22')],function(_0xfc873f){return{'model':db[_0xfc873f['model']],'as':_0xfc873f['as'],'attributes':_0xfc873f[_0xa67b('0x21')],'include':_0xfc873f['include']?_[_0xa67b('0x23')](_0xfc873f[_0xa67b('0x22')],function(_0x195099){return{'model':db[_0x195099[_0xa67b('0x24')]],'as':_0x195099['as'],'attributes':_0x195099[_0xa67b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa67b('0x10')](function(_0x1050fb){logger['info'](_0xa67b('0x1b'),_0x12392b);logger[_0xa67b('0x13')](_0xa67b('0x1b'),_0x12392b,JSON['stringify'](_0x1050fb));_0x4b4b19(_0x1050fb);})['catch'](function(_0xc2274c){logger[_0xa67b('0x16')]('ShowSquareProject',_0xc2274c['message'],_0x12392b);_0x1c7617(_0x1d672d[_0xa67b('0x16')](0x1f4,_0xc2274c[_0xa67b('0x18')]));});});};
\ No newline at end of file
+var _0x53ed=['find','options','where','attributes','include','map','model','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','SquareProject,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','ShowSquareProject','SquareProject'];(function(_0x4c2bdc,_0x5915d7){var _0x5a3222=function(_0x2262dd){while(--_0x2262dd){_0x4c2bdc['push'](_0x4c2bdc['shift']());}};_0x5a3222(++_0x5915d7);}(_0x53ed,0x1d5));var _0xd53e=function(_0x21debf,_0x5bab7b){_0x21debf=_0x21debf-0x0;var _0x324608=_0x53ed[_0x21debf];return _0x324608;};'use strict';var _=require('lodash');var util=require(_0xd53e('0x0'));var moment=require(_0xd53e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd53e('0x2'));var logger=require(_0xd53e('0x3'))(_0xd53e('0x4'));var config=require(_0xd53e('0x5'));var jayson=require(_0xd53e('0x6'));var client=jayson['client'][_0xd53e('0x7')]({'port':0x232a});config[_0xd53e('0x8')]=_[_0xd53e('0x9')](config[_0xd53e('0x8')],{'host':_0xd53e('0xa'),'port':0x18eb});var socket=require(_0xd53e('0xb'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x273a2d,_0x3e2411,_0x322ccd){return new BPromise(function(_0x315045,_0x3a62f1){return client[_0xd53e('0xc')](_0x273a2d,_0x322ccd)[_0xd53e('0xd')](function(_0x50e41){logger[_0xd53e('0xe')](_0xd53e('0xf'),_0x3e2411,'request\x20sent');logger[_0xd53e('0x10')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x3e2411,'request\x20sent',JSON[_0xd53e('0x11')](_0x50e41));if(_0x50e41[_0xd53e('0x12')]){if(_0x50e41['error'][_0xd53e('0x13')]===0x1f4){logger['error'](_0xd53e('0xf'),_0x3e2411,_0x50e41[_0xd53e('0x12')][_0xd53e('0x14')]);return _0x3a62f1(_0x50e41[_0xd53e('0x12')]['message']);}logger[_0xd53e('0x12')](_0xd53e('0xf'),_0x3e2411,_0x50e41[_0xd53e('0x12')][_0xd53e('0x14')]);return _0x315045(_0x50e41[_0xd53e('0x12')]['message']);}else{logger['info'](_0xd53e('0xf'),_0x3e2411,_0xd53e('0x15'));_0x315045(_0x50e41[_0xd53e('0x16')][_0xd53e('0x14')]);}})[_0xd53e('0x17')](function(_0x2c3251){logger[_0xd53e('0x12')]('SquareProject,\x20%s,\x20%s',_0x3e2411,_0x2c3251);_0x3a62f1(_0x2c3251);});});}exports[_0xd53e('0x18')]=function(_0xbe51ef){var _0x351c31=this;return new Promise(function(_0x2efb32,_0x47f1dc){return db[_0xd53e('0x19')][_0xd53e('0x1a')]({'raw':_0xbe51ef[_0xd53e('0x1b')]?_0xbe51ef[_0xd53e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xbe51ef[_0xd53e('0x1b')]?_0xbe51ef[_0xd53e('0x1b')][_0xd53e('0x1c')]||null:null,'attributes':_0xbe51ef[_0xd53e('0x1b')]?_0xbe51ef[_0xd53e('0x1b')][_0xd53e('0x1d')]||null:null,'include':_0xbe51ef[_0xd53e('0x1b')]?_0xbe51ef[_0xd53e('0x1b')][_0xd53e('0x1e')]?_[_0xd53e('0x1f')](_0xbe51ef[_0xd53e('0x1b')]['include'],function(_0x34f409){return{'model':db[_0x34f409['model']],'as':_0x34f409['as'],'attributes':_0x34f409[_0xd53e('0x1d')],'include':_0x34f409['include']?_[_0xd53e('0x1f')](_0x34f409[_0xd53e('0x1e')],function(_0x3b9da){return{'model':db[_0x3b9da[_0xd53e('0x20')]],'as':_0x3b9da['as'],'attributes':_0x3b9da['attributes'],'include':_0x3b9da[_0xd53e('0x1e')]?_[_0xd53e('0x1f')](_0x3b9da[_0xd53e('0x1e')],function(_0x5630dd){return{'model':db[_0x5630dd[_0xd53e('0x20')]],'as':_0x5630dd['as'],'attributes':_0x5630dd[_0xd53e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42b9ec){logger[_0xd53e('0xe')](_0xd53e('0x18'),_0xbe51ef);logger[_0xd53e('0x10')](_0xd53e('0x18'),_0xbe51ef,JSON['stringify'](_0x42b9ec));_0x2efb32(_0x42b9ec);})[_0xd53e('0x17')](function(_0x3871e9){logger[_0xd53e('0x12')](_0xd53e('0x18'),_0x3871e9['message'],_0xbe51ef);_0x47f1dc(_0x351c31[_0xd53e('0x12')](0x1f4,_0x3871e9['message']));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js
index 367cf0b..bcdaa8d 100644
--- a/server/api/squareProject/squareProject.socket.js
+++ b/server/api/squareProject/squareProject.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5d58=['register'];(function(_0x48036f,_0x34d2e5){var _0x11ee74=function(_0x320d6c){while(--_0x320d6c){_0x48036f['push'](_0x48036f['shift']());}};_0x11ee74(++_0x34d2e5);}(_0x5d58,0x187));var _0x85d5=function(_0x46e231,_0x3c0e59){_0x46e231=_0x46e231-0x0;var _0x22f1d6=_0x5d58[_0x46e231];return _0x22f1d6;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove','update'];function createListener(_0x501631,_0x64d32c){return function(_0x1eff3b){_0x64d32c['emit'](_0x501631,_0x1eff3b);};}function removeListener(_0x1469fc,_0x30bfe8){return function(){SquareProjectEvents['removeListener'](_0x1469fc,_0x30bfe8);};}exports[_0x85d5('0x0')]=function(_0x2d457a){for(var _0x578fad=0x0,_0x46e7b4=events['length'];_0x578fad<_0x46e7b4;_0x578fad++){var _0x98c963=events[_0x578fad];var _0x3fecca=createListener('squareProject:'+_0x98c963,_0x2d457a);SquareProjectEvents['on'](_0x98c963,_0x3fecca);}};
\ No newline at end of file
+var _0xeff8=['update','emit','removeListener','length','squareProject:','./squareProject.events','save'];(function(_0x11c5a7,_0x2f3588){var _0x18f557=function(_0x53f692){while(--_0x53f692){_0x11c5a7['push'](_0x11c5a7['shift']());}};_0x18f557(++_0x2f3588);}(_0xeff8,0x186));var _0x8eff=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xeff8[_0x2ff238];return _0x204a56;};'use strict';var SquareProjectEvents=require(_0x8eff('0x0'));var events=[_0x8eff('0x1'),'remove',_0x8eff('0x2')];function createListener(_0x354ff4,_0x1e55a0){return function(_0x55e437){_0x1e55a0[_0x8eff('0x3')](_0x354ff4,_0x55e437);};}function removeListener(_0x2a6581,_0x4ba2bf){return function(){SquareProjectEvents[_0x8eff('0x4')](_0x2a6581,_0x4ba2bf);};}exports['register']=function(_0x469641){for(var _0xb54063=0x0,_0x3409bc=events[_0x8eff('0x5')];_0xb54063<_0x3409bc;_0xb54063++){var _0x491f01=events[_0xb54063];var _0x3fb9ee=createListener(_0x8eff('0x6')+_0x491f01,_0x469641);SquareProjectEvents['on'](_0x491f01,_0x3fb9ee);}};
\ No newline at end of file
diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js
index ce68f58..793a1da 100644
--- a/server/api/squareRecording/index.js
+++ b/server/api/squareRecording/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd7da=['destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','post','create','put','update','delete','/:id/delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7da,0x8e));var _0xad7d=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0xd7da[_0xc20f22];return _0x1535d5;};'use strict';var multer=require('multer');var util=require(_0xad7d('0x0'));var path=require(_0xad7d('0x1'));var timeout=require(_0xad7d('0x2'));var express=require(_0xad7d('0x3'));var router=express[_0xad7d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xad7d('0x5'));var config=require('../../config/environment');var controller=require(_0xad7d('0x6'));router[_0xad7d('0x7')]('/',auth[_0xad7d('0x8')](),controller[_0xad7d('0x9')]);router[_0xad7d('0x7')](_0xad7d('0xa'),auth[_0xad7d('0x8')](),controller['show']);router[_0xad7d('0x7')](_0xad7d('0xb'),auth[_0xad7d('0x8')](),controller['download']);router[_0xad7d('0xc')]('/',auth['isAuthenticated'](),controller[_0xad7d('0xd')]);router[_0xad7d('0xe')]('/:id',auth[_0xad7d('0x8')](),controller[_0xad7d('0xf')]);router[_0xad7d('0x10')](_0xad7d('0x11'),auth[_0xad7d('0x8')](),controller[_0xad7d('0x12')]);module[_0xad7d('0x13')]=router;
\ No newline at end of file
+var _0xff81=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','/:id/delete','destroy','exports'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xff81,0x1c8));var _0x1ff8=function(_0x12aba8,_0x40a036){_0x12aba8=_0x12aba8-0x0;var _0x2aac66=_0xff81[_0x12aba8];return _0x2aac66;};'use strict';var multer=require(_0x1ff8('0x0'));var util=require(_0x1ff8('0x1'));var path=require(_0x1ff8('0x2'));var timeout=require(_0x1ff8('0x3'));var express=require(_0x1ff8('0x4'));var router=express[_0x1ff8('0x5')]();var auth=require(_0x1ff8('0x6'));var interaction=require(_0x1ff8('0x7'));var config=require(_0x1ff8('0x8'));var controller=require(_0x1ff8('0x9'));router[_0x1ff8('0xa')]('/',auth[_0x1ff8('0xb')](),controller['index']);router[_0x1ff8('0xa')](_0x1ff8('0xc'),auth['isAuthenticated'](),controller[_0x1ff8('0xd')]);router[_0x1ff8('0xa')](_0x1ff8('0xe'),auth['isAuthenticated'](),controller[_0x1ff8('0xf')]);router[_0x1ff8('0x10')]('/',auth[_0x1ff8('0xb')](),controller[_0x1ff8('0x11')]);router[_0x1ff8('0x12')](_0x1ff8('0xc'),auth[_0x1ff8('0xb')](),controller[_0x1ff8('0x13')]);router[_0x1ff8('0x14')](_0x1ff8('0x15'),auth['isAuthenticated'](),controller[_0x1ff8('0x16')]);module[_0x1ff8('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js
index 37bb3ea..1aa7e8f 100644
--- a/server/api/squareRecording/squareRecording.attributes.js
+++ b/server/api/squareRecording/squareRecording.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9264=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4926('0x0'));module[_0x4926('0x1')]={'uniqueid':{'type':Sequelize[_0x4926('0x2')]},'callerid':{'type':Sequelize[_0x4926('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4926('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x4926('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x4926('0x2')]},'format':{'type':Sequelize[_0x4926('0x3')],'get':function(){var _0x57c13c='';var _0x1299c8=this[_0x4926('0x4')]('savePath');if(_0x1299c8){_0x57c13c=_0x1299c8[_0x4926('0x5')](_0x1299c8[_0x4926('0x6')]('.'));}return _0x57c13c;}}};
\ No newline at end of file
+var _0x6e73=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring'];(function(_0xdc5a08,_0x4eab21){var _0x3f6e2e=function(_0x3cb5ca){while(--_0x3cb5ca){_0xdc5a08['push'](_0xdc5a08['shift']());}};_0x3f6e2e(++_0x4eab21);}(_0x6e73,0x13b));var _0x36e7=function(_0x3d76c6,_0x14e4f2){_0x3d76c6=_0x3d76c6-0x0;var _0x15a838=_0x6e73[_0x3d76c6];return _0x15a838;};'use strict';var Sequelize=require(_0x36e7('0x0'));module[_0x36e7('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x36e7('0x2')]},'calleridname':{'type':Sequelize[_0x36e7('0x2')]},'context':{'type':Sequelize[_0x36e7('0x2')]},'extension':{'type':Sequelize[_0x36e7('0x2')]},'priority':{'type':Sequelize[_0x36e7('0x2')]},'accountcode':{'type':Sequelize[_0x36e7('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x36e7('0x2')]},'saveName':{'type':Sequelize[_0x36e7('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x36e7('0x3')],'get':function(){var _0x1d2fac='';var _0x552219=this[_0x36e7('0x4')](_0x36e7('0x5'));if(_0x552219){_0x1d2fac=_0x552219[_0x36e7('0x6')](_0x552219['lastIndexOf']('.'));}return _0x1d2fac;}}};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js
index 0aa2d49..21a9695 100644
--- a/server/api/squareRecording/squareRecording.controller.js
+++ b/server/api/squareRecording/squareRecording.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4d6a=['pick','filter','merge','findAll','rows','catch','params','includeAll','include','options','find','create','body','download','uniqueid','savePath','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x38a685,_0x55f482){var _0x1fd0f9=function(_0x523844){while(--_0x523844){_0x38a685['push'](_0x38a685['shift']());}};_0x1fd0f9(++_0x55f482);}(_0x4d6a,0x83));var _0xa4d6=function(_0x3ee54f,_0x2e7cdd){_0x3ee54f=_0x3ee54f-0x0;var _0x3bed47=_0x4d6a[_0x3ee54f];return _0x3bed47;};'use strict';var pdf=require(_0xa4d6('0x0'));var emlformat=require(_0xa4d6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa4d6('0x2'));var jsonpatch=require(_0xa4d6('0x3'));var rp=require('request-promise');var moment=require(_0xa4d6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa4d6('0x5'));var path=require(_0xa4d6('0x6'));var sox=require(_0xa4d6('0x7'));var csv=require('to-csv');var ejs=require(_0xa4d6('0x8'));var fs=require('fs');var _=require(_0xa4d6('0x9'));var squel=require(_0xa4d6('0xa'));var crypto=require(_0xa4d6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa4d6('0xc'));var toCsv=require(_0xa4d6('0xd'));var querystring=require('querystring');var Papa=require(_0xa4d6('0xe'));var Redis=require(_0xa4d6('0xf'));var authService=require(_0xa4d6('0x10'));var qs=require(_0xa4d6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4d6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa4d6('0x13'));var db=require(_0xa4d6('0x14'))['db'];function respondWithStatusCode(_0x551c48,_0x14cb0d){_0x14cb0d=_0x14cb0d||0xcc;return function(_0x4947f3){if(_0x4947f3){return _0x551c48[_0xa4d6('0x15')](_0x14cb0d);}return _0x551c48['status'](_0x14cb0d)[_0xa4d6('0x16')]();};}function respondWithResult(_0x21c36c,_0x2d7e10){_0x2d7e10=_0x2d7e10||0xc8;return function(_0x2efc33){if(_0x2efc33){return _0x21c36c[_0xa4d6('0x17')](_0x2d7e10)[_0xa4d6('0x18')](_0x2efc33);}};}function respondWithFilteredResult(_0x3a6b47,_0x5c919a){return function(_0x4e3708){if(_0x4e3708){var _0x5c588e=_0x4e3708[_0xa4d6('0x19')],_0x2b407c=_0x5c919a[_0xa4d6('0x1a')],_0x45a4b4=_0x5c919a['offset']+_0x5c919a[_0xa4d6('0x1b')],_0x589a35;if(_0x45a4b4>=_0x5c588e){_0x45a4b4=_0x5c588e;_0x589a35=0xc8;}else{_0x589a35=0xce;}_0x3a6b47[_0xa4d6('0x17')](_0x589a35);return _0x3a6b47['set'](_0xa4d6('0x1c'),_0x2b407c+'-'+_0x45a4b4+'/'+_0x5c588e)[_0xa4d6('0x18')](_0x4e3708);}return null;};}function patchUpdates(_0x40d5f9){return function(_0x2893d2){try{jsonpatch['apply'](_0x2893d2,_0x40d5f9,!![]);}catch(_0x19a3ae){return BPromise[_0xa4d6('0x1d')](_0x19a3ae);}return _0x2893d2[_0xa4d6('0x1e')]();};}function saveUpdates(_0x27b46f,_0x6cec1e){return function(_0x58e3fe){if(_0x58e3fe){return _0x58e3fe[_0xa4d6('0x1f')](_0x27b46f)[_0xa4d6('0x20')](function(_0x24416a){return _0x24416a;});}return null;};}function removeEntity(_0x3d6d07,_0x88494f){return function(_0x451cd3){if(_0x451cd3){return _0x451cd3['destroy']()['then'](function(){_0x3d6d07[_0xa4d6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5500ff,_0x387e13){return function(_0xcb6978){if(!_0xcb6978){_0x5500ff[_0xa4d6('0x15')](0x194);}return _0xcb6978;};}function handleError(_0x5a0973,_0x12cad5){_0x12cad5=_0x12cad5||0x1f4;return function(_0x2dd227){logger['error'](_0x2dd227[_0xa4d6('0x21')]);if(_0x2dd227[_0xa4d6('0x22')]){delete _0x2dd227[_0xa4d6('0x22')];}_0x5a0973['status'](_0x12cad5)[_0xa4d6('0x23')](_0x2dd227);};}exports[_0xa4d6('0x24')]=function(_0x1c88c7,_0x35e0bd){var _0x25a06b={},_0x2a3a49={},_0x222272={'count':0x0,'rows':[]};var _0x8f604e=_[_0xa4d6('0x25')](db[_0xa4d6('0x26')][_0xa4d6('0x27')],function(_0x27aae5){return{'name':_0x27aae5['fieldName'],'type':_0x27aae5[_0xa4d6('0x28')][_0xa4d6('0x29')]};});_0x2a3a49[_0xa4d6('0x2a')]=_['map'](_0x8f604e,_0xa4d6('0x22'));_0x2a3a49[_0xa4d6('0x2b')]=_[_0xa4d6('0x2c')](_0x1c88c7[_0xa4d6('0x2b')]);_0x2a3a49[_0xa4d6('0x2d')]=_[_0xa4d6('0x2e')](_0x2a3a49['model'],_0x2a3a49['query']);_0x25a06b[_0xa4d6('0x2f')]=_[_0xa4d6('0x2e')](_0x2a3a49[_0xa4d6('0x2a')],qs[_0xa4d6('0x30')](_0x1c88c7['query'][_0xa4d6('0x30')]));_0x25a06b[_0xa4d6('0x2f')]=_0x25a06b[_0xa4d6('0x2f')][_0xa4d6('0x31')]?_0x25a06b[_0xa4d6('0x2f')]:_0x2a3a49[_0xa4d6('0x2a')];if(!_0x1c88c7[_0xa4d6('0x2b')][_0xa4d6('0x32')](_0xa4d6('0x33'))){_0x25a06b[_0xa4d6('0x1b')]=qs['limit'](_0x1c88c7[_0xa4d6('0x2b')][_0xa4d6('0x1b')]);_0x25a06b[_0xa4d6('0x1a')]=qs[_0xa4d6('0x1a')](_0x1c88c7['query'][_0xa4d6('0x1a')]);}_0x25a06b[_0xa4d6('0x34')]=qs[_0xa4d6('0x35')](_0x1c88c7[_0xa4d6('0x2b')][_0xa4d6('0x35')]);_0x25a06b[_0xa4d6('0x36')]=qs[_0xa4d6('0x2d')](_[_0xa4d6('0x37')](_0x1c88c7[_0xa4d6('0x2b')],_0x2a3a49['filters']),_0x8f604e);if(_0x1c88c7[_0xa4d6('0x2b')][_0xa4d6('0x38')]){_0x25a06b[_0xa4d6('0x36')]=_['merge'](_0x25a06b[_0xa4d6('0x36')],{'$or':_[_0xa4d6('0x25')](_0x8f604e,function(_0x259521){if(_0x259521['type']!=='VIRTUAL'){var _0x5c2b90={};_0x5c2b90[_0x259521[_0xa4d6('0x22')]]={'$like':'%'+_0x1c88c7['query'][_0xa4d6('0x38')]+'%'};return _0x5c2b90;}})});}_0x25a06b=_[_0xa4d6('0x39')]({},_0x25a06b,_0x1c88c7['options']);var _0x47c0e0={'where':_0x25a06b['where']};return db[_0xa4d6('0x26')][_0xa4d6('0x19')](_0x47c0e0)[_0xa4d6('0x20')](function(_0x313f41){_0x222272[_0xa4d6('0x19')]=_0x313f41;if(_0x1c88c7['query']['includeAll']){_0x25a06b['include']=[{'all':!![]}];}return db[_0xa4d6('0x26')][_0xa4d6('0x3a')](_0x25a06b);})['then'](function(_0x2b7716){_0x222272[_0xa4d6('0x3b')]=_0x2b7716;return _0x222272;})[_0xa4d6('0x20')](respondWithFilteredResult(_0x35e0bd,_0x25a06b))[_0xa4d6('0x3c')](handleError(_0x35e0bd,null));};exports['show']=function(_0x98c0ff,_0x4bfccf){var _0x430dec={'raw':!![],'where':{'id':_0x98c0ff[_0xa4d6('0x3d')]['id']}},_0x1ae00d={};_0x1ae00d[_0xa4d6('0x2a')]=_[_0xa4d6('0x2c')](db[_0xa4d6('0x26')][_0xa4d6('0x27')]);_0x1ae00d[_0xa4d6('0x2b')]=_[_0xa4d6('0x2c')](_0x98c0ff['query']);_0x1ae00d[_0xa4d6('0x2d')]=_[_0xa4d6('0x2e')](_0x1ae00d['model'],_0x1ae00d[_0xa4d6('0x2b')]);_0x430dec[_0xa4d6('0x2f')]=_[_0xa4d6('0x2e')](_0x1ae00d['model'],qs[_0xa4d6('0x30')](_0x98c0ff[_0xa4d6('0x2b')][_0xa4d6('0x30')]));_0x430dec[_0xa4d6('0x2f')]=_0x430dec[_0xa4d6('0x2f')][_0xa4d6('0x31')]?_0x430dec[_0xa4d6('0x2f')]:_0x1ae00d[_0xa4d6('0x2a')];if(_0x98c0ff[_0xa4d6('0x2b')][_0xa4d6('0x3e')]){_0x430dec[_0xa4d6('0x3f')]=[{'all':!![]}];}_0x430dec=_[_0xa4d6('0x39')]({},_0x430dec,_0x98c0ff[_0xa4d6('0x40')]);return db[_0xa4d6('0x26')][_0xa4d6('0x41')](_0x430dec)[_0xa4d6('0x20')](handleEntityNotFound(_0x4bfccf,null))['then'](respondWithResult(_0x4bfccf,null))[_0xa4d6('0x3c')](handleError(_0x4bfccf,null));};exports[_0xa4d6('0x42')]=function(_0x3905d3,_0xabd609){return db[_0xa4d6('0x26')][_0xa4d6('0x42')](_0x3905d3[_0xa4d6('0x43')],{})['then'](respondWithResult(_0xabd609,0xc9))['catch'](handleError(_0xabd609,null));};exports[_0xa4d6('0x1f')]=function(_0x10a4e3,_0x2d49d7){if(_0x10a4e3[_0xa4d6('0x43')]['id']){delete _0x10a4e3[_0xa4d6('0x43')]['id'];}return db[_0xa4d6('0x26')][_0xa4d6('0x41')]({'where':{'id':_0x10a4e3[_0xa4d6('0x3d')]['id']}})[_0xa4d6('0x20')](handleEntityNotFound(_0x2d49d7,null))[_0xa4d6('0x20')](saveUpdates(_0x10a4e3['body'],null))[_0xa4d6('0x20')](respondWithResult(_0x2d49d7,null))[_0xa4d6('0x3c')](handleError(_0x2d49d7,null));};exports[_0xa4d6('0x44')]=function(_0x5cd15c,_0x5ec11d,_0x2f83cf){var _0x1f25ba=require('../../components/encryptor');var _0x5a8252=![];var _0x23a91e={};if(_0x5cd15c['query']['type']&&_0x5cd15c[_0xa4d6('0x2b')][_0xa4d6('0x28')]===_0xa4d6('0x45')){_0x23a91e['uniqueid']=_0x5cd15c[_0xa4d6('0x3d')]['id'];}else{_0x23a91e['id']=_0x5cd15c[_0xa4d6('0x3d')]['id'];}return db[_0xa4d6('0x26')][_0xa4d6('0x41')]({'where':_0x23a91e,'attributes':['id',_0xa4d6('0x46'),'filename'],'raw':!![]})[_0xa4d6('0x20')](handleEntityNotFound(_0x5ec11d,null))[_0xa4d6('0x20')](function(_0x29d255){if(_0x29d255){var _0x2fb956=_0x29d255[_0xa4d6('0x46')];var _0x5da52f=util[_0xa4d6('0x47')](_0xa4d6('0x48'),_0x2fb956);if(fs['existsSync'](_0x5da52f)){_0x5a8252=!![];return _0x1f25ba[_0xa4d6('0x49')](_0x5da52f,_0x2fb956,config[_0xa4d6('0x4a')][_0xa4d6('0x4b')])[_0xa4d6('0x20')](function(){return _0x29d255;});}return _0x29d255;}})[_0xa4d6('0x20')](function(_0x5c9c8e){if(_0x5c9c8e){var _0x593ba4=_0x5c9c8e[_0xa4d6('0x46')];if(!fs[_0xa4d6('0x4c')](_0x593ba4)){throw new db[(_0xa4d6('0x4d'))]['ValidationError'](_0xa4d6('0x4e'));}if(_0x5c9c8e[_0xa4d6('0x4f')]){return _0x5ec11d[_0xa4d6('0x44')](_0x593ba4,_0x5c9c8e[_0xa4d6('0x4f')]+path[_0xa4d6('0x50')](_0x593ba4),function(){if(_0x5a8252){fs[_0xa4d6('0x51')](_0x593ba4);}});}else{return _0x5ec11d['download'](_0x593ba4,function(_0x3867b7){if(_0x5a8252){fs[_0xa4d6('0x51')](_0x593ba4);}});}}})[_0xa4d6('0x3c')](function(_0x517fac){if(_0x517fac[_0xa4d6('0x52')]===_0xa4d6('0x4e')){_0x5ec11d[_0xa4d6('0x17')](0x194)[_0xa4d6('0x23')](_0xa4d6('0x53'));}else{return handleError(_0x5ec11d,null);}});};exports[_0xa4d6('0x54')]=function(_0x422b3a,_0x42dec3){return db[_0xa4d6('0x26')][_0xa4d6('0x41')]({'where':{'id':_0x422b3a[_0xa4d6('0x3d')]['id']}})[_0xa4d6('0x20')](function(_0x2b5fce){if(!_0x2b5fce)throw new ReferenceError(_0xa4d6('0x55'));return _0x2b5fce;})[_0xa4d6('0x20')](function(_0x52442b){var _0x2f2767=_0x52442b[_0xa4d6('0x46')];logger[_0xa4d6('0x56')](_0xa4d6('0x57'),_0x2f2767);if(!_[_0xa4d6('0x58')](_0x52442b[_0xa4d6('0x46')])&&fs['existsSync'](_0x2f2767)){logger[_0xa4d6('0x56')](_0xa4d6('0x59')+_0x2f2767+_0xa4d6('0x5a'));fs[_0xa4d6('0x5b')](_0x2f2767);}_0x2f2767=_0x2f2767+_0xa4d6('0x5c');if(!_[_0xa4d6('0x58')](_0x52442b[_0xa4d6('0x46')])&&fs['existsSync'](_0x2f2767)){logger[_0xa4d6('0x56')]('File:\x20\x22'+_0x2f2767+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa4d6('0x5b')](_0x2f2767);}return _0x52442b;})[_0xa4d6('0x20')](function(_0x4df01b){if(!_0x4df01b)throw new InternalError();return _0x4df01b[_0xa4d6('0x54')]();})['then'](function(){_0x42dec3[_0xa4d6('0x17')](0xcc)[_0xa4d6('0x16')]();})['catch'](handleError(_0x42dec3,null));};
\ No newline at end of file
+var _0xf305=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','SquareRecording','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf305,0xaf));var _0x5f30=function(_0x79a6e8,_0x1c2b24){_0x79a6e8=_0x79a6e8-0x0;var _0xeeb993=_0xf305[_0x79a6e8];return _0xeeb993;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5f30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f30('0x1'));var jsonpatch=require(_0x5f30('0x2'));var rp=require(_0x5f30('0x3'));var moment=require(_0x5f30('0x4'));var BPromise=require(_0x5f30('0x5'));var Mustache=require(_0x5f30('0x6'));var util=require(_0x5f30('0x7'));var path=require(_0x5f30('0x8'));var sox=require('sox');var csv=require(_0x5f30('0x9'));var ejs=require(_0x5f30('0xa'));var fs=require('fs');var _=require(_0x5f30('0xb'));var squel=require(_0x5f30('0xc'));var crypto=require('crypto');var jsforce=require(_0x5f30('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5f30('0x9'));var querystring=require(_0x5f30('0xe'));var Papa=require(_0x5f30('0xf'));var Redis=require(_0x5f30('0x10'));var authService=require(_0x5f30('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5f30('0x12'));var hardwareService=require(_0x5f30('0x13'));var logger=require(_0x5f30('0x14'))(_0x5f30('0x15'));var utils=require(_0x5f30('0x16'));var config=require(_0x5f30('0x17'));var db=require(_0x5f30('0x18'))['db'];function respondWithStatusCode(_0x25e605,_0x20c58e){_0x20c58e=_0x20c58e||0xcc;return function(_0x4d9ec2){if(_0x4d9ec2){return _0x25e605[_0x5f30('0x19')](_0x20c58e);}return _0x25e605[_0x5f30('0x1a')](_0x20c58e)[_0x5f30('0x1b')]();};}function respondWithResult(_0x49adf4,_0x389cbe){_0x389cbe=_0x389cbe||0xc8;return function(_0x351c0b){if(_0x351c0b){return _0x49adf4[_0x5f30('0x1a')](_0x389cbe)[_0x5f30('0x1c')](_0x351c0b);}};}function respondWithFilteredResult(_0x49a043,_0x147ac1){return function(_0x8178a5){if(_0x8178a5){var _0x228115=_0x8178a5[_0x5f30('0x1d')],_0x1d626d=_0x147ac1[_0x5f30('0x1e')],_0x4d09d8=_0x147ac1['offset']+_0x147ac1[_0x5f30('0x1f')],_0x3cfbfe;if(_0x4d09d8>=_0x228115){_0x4d09d8=_0x228115;_0x3cfbfe=0xc8;}else{_0x3cfbfe=0xce;}_0x49a043[_0x5f30('0x1a')](_0x3cfbfe);return _0x49a043[_0x5f30('0x20')](_0x5f30('0x21'),_0x1d626d+'-'+_0x4d09d8+'/'+_0x228115)['json'](_0x8178a5);}return null;};}function patchUpdates(_0x1a59fa){return function(_0x3dbd6a){try{jsonpatch[_0x5f30('0x22')](_0x3dbd6a,_0x1a59fa,!![]);}catch(_0xc71220){return BPromise[_0x5f30('0x23')](_0xc71220);}return _0x3dbd6a['save']();};}function saveUpdates(_0x19c39f,_0x5ebe14){return function(_0x1eb337){if(_0x1eb337){return _0x1eb337[_0x5f30('0x24')](_0x19c39f)[_0x5f30('0x25')](function(_0xd4b4ec){return _0xd4b4ec;});}return null;};}function removeEntity(_0x49d7da,_0x1ccd61){return function(_0x36f136){if(_0x36f136){return _0x36f136[_0x5f30('0x26')]()[_0x5f30('0x25')](function(){_0x49d7da['status'](0xcc)[_0x5f30('0x1b')]();});}};}function handleEntityNotFound(_0x927536,_0x215b83){return function(_0x5055b0){if(!_0x5055b0){_0x927536[_0x5f30('0x19')](0x194);}return _0x5055b0;};}function handleError(_0x3a7a89,_0x13b077){_0x13b077=_0x13b077||0x1f4;return function(_0x90000d){logger[_0x5f30('0x27')](_0x90000d[_0x5f30('0x28')]);if(_0x90000d[_0x5f30('0x29')]){delete _0x90000d['name'];}_0x3a7a89[_0x5f30('0x1a')](_0x13b077)[_0x5f30('0x2a')](_0x90000d);};}exports['index']=function(_0x5156ef,_0x39287f){var _0x17c35b={},_0x454193={},_0x35305b={'count':0x0,'rows':[]};var _0x43f823=_['map'](db[_0x5f30('0x2b')][_0x5f30('0x2c')],function(_0x93716e){return{'name':_0x93716e[_0x5f30('0x2d')],'type':_0x93716e['type']['key']};});_0x454193[_0x5f30('0x2e')]=_[_0x5f30('0x2f')](_0x43f823,'name');_0x454193[_0x5f30('0x30')]=_[_0x5f30('0x31')](_0x5156ef[_0x5f30('0x30')]);_0x454193[_0x5f30('0x32')]=_[_0x5f30('0x33')](_0x454193[_0x5f30('0x2e')],_0x454193[_0x5f30('0x30')]);_0x17c35b[_0x5f30('0x34')]=_[_0x5f30('0x33')](_0x454193[_0x5f30('0x2e')],qs[_0x5f30('0x35')](_0x5156ef[_0x5f30('0x30')][_0x5f30('0x35')]));_0x17c35b['attributes']=_0x17c35b['attributes'][_0x5f30('0x36')]?_0x17c35b['attributes']:_0x454193[_0x5f30('0x2e')];if(!_0x5156ef['query'][_0x5f30('0x37')](_0x5f30('0x38'))){_0x17c35b['limit']=qs[_0x5f30('0x1f')](_0x5156ef[_0x5f30('0x30')][_0x5f30('0x1f')]);_0x17c35b[_0x5f30('0x1e')]=qs['offset'](_0x5156ef['query']['offset']);}_0x17c35b[_0x5f30('0x39')]=qs[_0x5f30('0x3a')](_0x5156ef[_0x5f30('0x30')]['sort']);_0x17c35b[_0x5f30('0x3b')]=qs[_0x5f30('0x32')](_[_0x5f30('0x3c')](_0x5156ef['query'],_0x454193[_0x5f30('0x32')]),_0x43f823);if(_0x5156ef['query'][_0x5f30('0x3d')]){_0x17c35b['where']=_[_0x5f30('0x3e')](_0x17c35b[_0x5f30('0x3b')],{'$or':_[_0x5f30('0x2f')](_0x43f823,function(_0x352783){if(_0x352783['type']!==_0x5f30('0x3f')){var _0x46151a={};_0x46151a[_0x352783['name']]={'$like':'%'+_0x5156ef[_0x5f30('0x30')][_0x5f30('0x3d')]+'%'};return _0x46151a;}})});}_0x17c35b=_[_0x5f30('0x3e')]({},_0x17c35b,_0x5156ef[_0x5f30('0x40')]);var _0x2eb959={'where':_0x17c35b[_0x5f30('0x3b')]};return db[_0x5f30('0x2b')]['count'](_0x2eb959)['then'](function(_0x5b42a0){_0x35305b[_0x5f30('0x1d')]=_0x5b42a0;if(_0x5156ef[_0x5f30('0x30')][_0x5f30('0x41')]){_0x17c35b[_0x5f30('0x42')]=[{'all':!![]}];}return db[_0x5f30('0x2b')][_0x5f30('0x43')](_0x17c35b);})[_0x5f30('0x25')](function(_0x493e85){_0x35305b[_0x5f30('0x44')]=_0x493e85;return _0x35305b;})[_0x5f30('0x25')](respondWithFilteredResult(_0x39287f,_0x17c35b))[_0x5f30('0x45')](handleError(_0x39287f,null));};exports[_0x5f30('0x46')]=function(_0x104261,_0x2f734d){var _0x4eaf2d={'raw':!![],'where':{'id':_0x104261[_0x5f30('0x47')]['id']}},_0x402029={};_0x402029[_0x5f30('0x2e')]=_[_0x5f30('0x31')](db[_0x5f30('0x2b')]['rawAttributes']);_0x402029[_0x5f30('0x30')]=_[_0x5f30('0x31')](_0x104261['query']);_0x402029[_0x5f30('0x32')]=_[_0x5f30('0x33')](_0x402029[_0x5f30('0x2e')],_0x402029[_0x5f30('0x30')]);_0x4eaf2d['attributes']=_['intersection'](_0x402029['model'],qs[_0x5f30('0x35')](_0x104261[_0x5f30('0x30')]['fields']));_0x4eaf2d[_0x5f30('0x34')]=_0x4eaf2d[_0x5f30('0x34')][_0x5f30('0x36')]?_0x4eaf2d[_0x5f30('0x34')]:_0x402029['model'];if(_0x104261[_0x5f30('0x30')][_0x5f30('0x41')]){_0x4eaf2d['include']=[{'all':!![]}];}_0x4eaf2d=_[_0x5f30('0x3e')]({},_0x4eaf2d,_0x104261['options']);return db[_0x5f30('0x2b')][_0x5f30('0x48')](_0x4eaf2d)[_0x5f30('0x25')](handleEntityNotFound(_0x2f734d,null))['then'](respondWithResult(_0x2f734d,null))[_0x5f30('0x45')](handleError(_0x2f734d,null));};exports[_0x5f30('0x49')]=function(_0x1b22f4,_0xbbc8e7){return db[_0x5f30('0x2b')][_0x5f30('0x49')](_0x1b22f4['body'],{})[_0x5f30('0x25')](respondWithResult(_0xbbc8e7,0xc9))[_0x5f30('0x45')](handleError(_0xbbc8e7,null));};exports['update']=function(_0x2cc02a,_0x328c55){if(_0x2cc02a[_0x5f30('0x4a')]['id']){delete _0x2cc02a['body']['id'];}return db[_0x5f30('0x2b')][_0x5f30('0x48')]({'where':{'id':_0x2cc02a[_0x5f30('0x47')]['id']}})[_0x5f30('0x25')](handleEntityNotFound(_0x328c55,null))['then'](saveUpdates(_0x2cc02a[_0x5f30('0x4a')],null))[_0x5f30('0x25')](respondWithResult(_0x328c55,null))['catch'](handleError(_0x328c55,null));};exports[_0x5f30('0x4b')]=function(_0x47a1d4,_0x2f07fe,_0x568dda){var _0x460166=require(_0x5f30('0x4c'));var _0x5404b3=![];var _0x4beafe={};if(_0x47a1d4['query']['type']&&_0x47a1d4[_0x5f30('0x30')]['type']==='uniqueid'){_0x4beafe[_0x5f30('0x4d')]=_0x47a1d4[_0x5f30('0x47')]['id'];}else{_0x4beafe['id']=_0x47a1d4[_0x5f30('0x47')]['id'];}return db[_0x5f30('0x2b')][_0x5f30('0x48')]({'where':_0x4beafe,'attributes':['id',_0x5f30('0x4e'),_0x5f30('0x4f')],'raw':!![]})[_0x5f30('0x25')](handleEntityNotFound(_0x2f07fe,null))[_0x5f30('0x25')](function(_0x2831ce){if(_0x2831ce){var _0x2a6446=_0x2831ce[_0x5f30('0x4e')];var _0x5d7fa2=util[_0x5f30('0x50')]('%s.cypher',_0x2a6446);if(fs[_0x5f30('0x51')](_0x5d7fa2)){_0x5404b3=!![];return _0x460166['decryptFile'](_0x5d7fa2,_0x2a6446,config[_0x5f30('0x52')][_0x5f30('0x53')])[_0x5f30('0x25')](function(){return _0x2831ce;});}return _0x2831ce;}})[_0x5f30('0x25')](function(_0x32710e){if(_0x32710e){var _0x3a8d33=_0x32710e[_0x5f30('0x4e')];if(!fs[_0x5f30('0x51')](_0x3a8d33)){throw new db[(_0x5f30('0x54'))][(_0x5f30('0x55'))](_0x5f30('0x56'));}if(_0x32710e[_0x5f30('0x4f')]){return _0x2f07fe['download'](_0x3a8d33,_0x32710e['filename']+path[_0x5f30('0x57')](_0x3a8d33),function(){if(_0x5404b3){fs['unlink'](_0x3a8d33);}});}else{return _0x2f07fe[_0x5f30('0x4b')](_0x3a8d33,function(_0x2f7bab){if(_0x5404b3){fs['unlink'](_0x3a8d33);}});}}})['catch'](function(_0x5ac1d9){if(_0x5ac1d9[_0x5f30('0x58')]===_0x5f30('0x56')){_0x2f07fe[_0x5f30('0x1a')](0x194)[_0x5f30('0x2a')](_0x5f30('0x59'));}else{return handleError(_0x2f07fe,null);}});};exports[_0x5f30('0x26')]=function(_0xd3a65a,_0x266c1e){return db['SquareRecording'][_0x5f30('0x48')]({'where':{'id':_0xd3a65a[_0x5f30('0x47')]['id']}})[_0x5f30('0x25')](function(_0x493739){if(!_0x493739)throw new ReferenceError(_0x5f30('0x5a'));return _0x493739;})[_0x5f30('0x25')](function(_0x54b5a9){var _0x555e34=_0x54b5a9[_0x5f30('0x4e')];logger['info'](_0x5f30('0x5b'),_0x555e34);if(!_[_0x5f30('0x5c')](_0x54b5a9['savePath'])&&fs[_0x5f30('0x51')](_0x555e34)){logger[_0x5f30('0x5d')](_0x5f30('0x5e')+_0x555e34+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x5f30('0x5f')](_0x555e34);}_0x555e34=_0x555e34+_0x5f30('0x60');if(!_[_0x5f30('0x5c')](_0x54b5a9[_0x5f30('0x4e')])&&fs[_0x5f30('0x51')](_0x555e34)){logger[_0x5f30('0x5d')](_0x5f30('0x5e')+_0x555e34+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x5f30('0x5f')](_0x555e34);}return _0x54b5a9;})[_0x5f30('0x25')](function(_0x36d061){if(!_0x36d061)throw new InternalError();return _0x36d061[_0x5f30('0x26')]();})[_0x5f30('0x25')](function(){_0x266c1e[_0x5f30('0x1a')](0xcc)[_0x5f30('0x1b')]();})[_0x5f30('0x45')](handleError(_0x266c1e,null));};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js
index b841fb1..3ba69ac 100644
--- a/server/api/squareRecording/squareRecording.model.js
+++ b/server/api/squareRecording/squareRecording.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee3c=['lodash','util','moment','request-promise','path','rimraf','exports','define','SquareRecording','square_recordings'];(function(_0x3c9f6a,_0x50f33c){var _0x1f679b=function(_0x373871){while(--_0x373871){_0x3c9f6a['push'](_0x3c9f6a['shift']());}};_0x1f679b(++_0x50f33c);}(_0xee3c,0x1a4));var _0xcee3=function(_0xa4ff0e,_0x577247){_0xa4ff0e=_0xa4ff0e-0x0;var _0x397ab=_0xee3c[_0xa4ff0e];return _0x397ab;};'use strict';var _=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcee3('0x2'));var BPromise=require('bluebird');var rp=require(_0xcee3('0x3'));var fs=require('fs');var path=require(_0xcee3('0x4'));var rimraf=require(_0xcee3('0x5'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0xcee3('0x6')]=function(_0x4aa568,_0x5ceb51){return _0x4aa568[_0xcee3('0x7')](_0xcee3('0x8'),attributes,{'tableName':_0xcee3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcaaf=['../../config/logger','api','moment','bluebird','path','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util'];(function(_0x40ffe7,_0x59b4a6){var _0x39cdf3=function(_0x6dcf2){while(--_0x6dcf2){_0x40ffe7['push'](_0x40ffe7['shift']());}};_0x39cdf3(++_0x59b4a6);}(_0xcaaf,0x172));var _0xfcaa=function(_0xfb960d,_0x3aa089){_0xfb960d=_0xfb960d-0x0;var _0x2b55fb=_0xcaaf[_0xfb960d];return _0x2b55fb;};'use strict';var _=require(_0xfcaa('0x0'));var util=require(_0xfcaa('0x1'));var logger=require(_0xfcaa('0x2'))(_0xfcaa('0x3'));var moment=require(_0xfcaa('0x4'));var BPromise=require(_0xfcaa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfcaa('0x6'));var rimraf=require('rimraf');var config=require(_0xfcaa('0x7'));var attributes=require(_0xfcaa('0x8'));module['exports']=function(_0x426899,_0x55d559){return _0x426899[_0xfcaa('0x9')](_0xfcaa('0xa'),attributes,{'tableName':_0xfcaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js
index aa04d04..1329305 100644
--- a/server/api/squareRecording/squareRecording.rpc.js
+++ b/server/api/squareRecording/squareRecording.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2045=['create','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SquareRecording,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','CreateSquareRecording','SquareRecording'];(function(_0x5d967b,_0x32b32b){var _0x319e03=function(_0x2d014e){while(--_0x2d014e){_0x5d967b['push'](_0x5d967b['shift']());}};_0x319e03(++_0x32b32b);}(_0x2045,0x189));var _0x5204=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2045[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x5204('0x0'));var util=require(_0x5204('0x1'));var moment=require(_0x5204('0x2'));var BPromise=require(_0x5204('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5204('0x4'));var db=require(_0x5204('0x5'))['db'];var utils=require(_0x5204('0x6'));var logger=require('../../config/logger')(_0x5204('0x7'));var config=require(_0x5204('0x8'));var jayson=require(_0x5204('0x9'));var client=jayson[_0x5204('0xa')][_0x5204('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x257084,_0x28d783,_0x24769a){return new BPromise(function(_0x98fe3a,_0x4d1d20){return client['request'](_0x257084,_0x24769a)['then'](function(_0x250c02){logger[_0x5204('0xc')](_0x5204('0xd'),_0x28d783,'request\x20sent');logger[_0x5204('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x28d783,'request\x20sent',JSON[_0x5204('0xf')](_0x250c02));if(_0x250c02[_0x5204('0x10')]){if(_0x250c02['error'][_0x5204('0x11')]===0x1f4){logger['error'](_0x5204('0xd'),_0x28d783,_0x250c02[_0x5204('0x10')][_0x5204('0x12')]);return _0x4d1d20(_0x250c02[_0x5204('0x10')][_0x5204('0x12')]);}logger[_0x5204('0x10')](_0x5204('0xd'),_0x28d783,_0x250c02[_0x5204('0x10')][_0x5204('0x12')]);return _0x98fe3a(_0x250c02[_0x5204('0x10')][_0x5204('0x12')]);}else{logger[_0x5204('0xc')](_0x5204('0xd'),_0x28d783,_0x5204('0x13'));_0x98fe3a(_0x250c02['result'][_0x5204('0x12')]);}})[_0x5204('0x14')](function(_0x124020){logger[_0x5204('0x10')](_0x5204('0xd'),_0x28d783,_0x124020);_0x4d1d20(_0x124020);});});}exports[_0x5204('0x15')]=function(_0x2ed7f3){var _0x5ed8be=this;return new Promise(function(_0x561568,_0x57db55){return db[_0x5204('0x16')][_0x5204('0x17')](_0x2ed7f3['body'],{'raw':_0x2ed7f3[_0x5204('0x18')]?_0x2ed7f3['options'][_0x5204('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x50926f){logger['info'](_0x5204('0x15'),_0x2ed7f3);logger[_0x5204('0xe')](_0x5204('0x15'),_0x2ed7f3,JSON[_0x5204('0xf')](_0x50926f));_0x561568(_0x50926f);})[_0x5204('0x14')](function(_0x2b79e8){logger[_0x5204('0x10')]('CreateSquareRecording',_0x2b79e8[_0x5204('0x12')],_0x2ed7f3);_0x57db55(_0x5ed8be[_0x5204('0x10')](0x1f4,_0x2b79e8[_0x5204('0x12')]));});});};
\ No newline at end of file
+var _0x3c29=['request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x5913c2,_0x256993){var _0x42c069=function(_0x3b32ea){while(--_0x3b32ea){_0x5913c2['push'](_0x5913c2['shift']());}};_0x42c069(++_0x256993);}(_0x3c29,0x1dc));var _0x93c2=function(_0x4fcf7c,_0x2be8e6){_0x4fcf7c=_0x4fcf7c-0x0;var _0x2f2255=_0x3c29[_0x4fcf7c];return _0x2f2255;};'use strict';var _=require('lodash');var util=require(_0x93c2('0x0'));var moment=require(_0x93c2('0x1'));var BPromise=require(_0x93c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93c2('0x3'));var db=require(_0x93c2('0x4'))['db'];var utils=require(_0x93c2('0x5'));var logger=require(_0x93c2('0x6'))(_0x93c2('0x7'));var config=require('../../config/environment');var jayson=require(_0x93c2('0x8'));var client=jayson['client'][_0x93c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ed055,_0x333241,_0x4bc6e3){return new BPromise(function(_0x426b74,_0xb15604){return client[_0x93c2('0xa')](_0x3ed055,_0x4bc6e3)['then'](function(_0x560a8c){logger[_0x93c2('0xb')](_0x93c2('0xc'),_0x333241,_0x93c2('0xd'));logger[_0x93c2('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x333241,_0x93c2('0xd'),JSON[_0x93c2('0xf')](_0x560a8c));if(_0x560a8c[_0x93c2('0x10')]){if(_0x560a8c['error']['code']===0x1f4){logger[_0x93c2('0x10')](_0x93c2('0xc'),_0x333241,_0x560a8c[_0x93c2('0x10')][_0x93c2('0x11')]);return _0xb15604(_0x560a8c['error'][_0x93c2('0x11')]);}logger[_0x93c2('0x10')](_0x93c2('0xc'),_0x333241,_0x560a8c['error']['message']);return _0x426b74(_0x560a8c['error'][_0x93c2('0x11')]);}else{logger[_0x93c2('0xb')](_0x93c2('0xc'),_0x333241,_0x93c2('0xd'));_0x426b74(_0x560a8c[_0x93c2('0x12')][_0x93c2('0x11')]);}})[_0x93c2('0x13')](function(_0x50fec6){logger[_0x93c2('0x10')](_0x93c2('0xc'),_0x333241,_0x50fec6);_0xb15604(_0x50fec6);});});}exports[_0x93c2('0x14')]=function(_0x3eb81c){var _0x6cdf79=this;return new Promise(function(_0x25f963,_0x3c39a3){return db[_0x93c2('0x15')][_0x93c2('0x16')](_0x3eb81c[_0x93c2('0x17')],{'raw':_0x3eb81c[_0x93c2('0x18')]?_0x3eb81c[_0x93c2('0x18')][_0x93c2('0x19')]===undefined?!![]:![]:!![]})[_0x93c2('0x1a')](function(_0x422550){logger[_0x93c2('0xb')]('CreateSquareRecording',_0x3eb81c);logger[_0x93c2('0xe')](_0x93c2('0x14'),_0x3eb81c,JSON[_0x93c2('0xf')](_0x422550));_0x25f963(_0x422550);})['catch'](function(_0x2ef177){logger[_0x93c2('0x10')](_0x93c2('0x14'),_0x2ef177['message'],_0x3eb81c);_0x3c39a3(_0x6cdf79[_0x93c2('0x10')](0x1f4,_0x2ef177[_0x93c2('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js
index 4439f5f..99635f6 100644
--- a/server/api/squareReport/index.js
+++ b/server/api/squareReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ffd=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','exports','multer','path','connect-timeout'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x0ffd,0x153));var _0xd0ff=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x0ffd[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0xd0ff('0x0'));var util=require('util');var path=require(_0xd0ff('0x1'));var timeout=require(_0xd0ff('0x2'));var express=require('express');var router=express[_0xd0ff('0x3')]();var auth=require(_0xd0ff('0x4'));var interaction=require(_0xd0ff('0x5'));var config=require(_0xd0ff('0x6'));var controller=require(_0xd0ff('0x7'));router[_0xd0ff('0x8')]('/',auth[_0xd0ff('0x9')](),controller[_0xd0ff('0xa')]);router[_0xd0ff('0x8')](_0xd0ff('0xb'),auth['isAuthenticated'](),controller[_0xd0ff('0xc')]);router[_0xd0ff('0x8')](_0xd0ff('0xd'),auth[_0xd0ff('0x9')](),controller[_0xd0ff('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd0ff('0xf')](_0xd0ff('0xd'),auth['isAuthenticated'](),controller[_0xd0ff('0x10')]);router['delete'](_0xd0ff('0xd'),auth[_0xd0ff('0x9')](),controller['destroy']);module[_0xd0ff('0x11')]=router;
\ No newline at end of file
+var _0xe678=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5f3a49,_0x462795){var _0x6d0877=function(_0x7445b2){while(--_0x7445b2){_0x5f3a49['push'](_0x5f3a49['shift']());}};_0x6d0877(++_0x462795);}(_0xe678,0x130));var _0x8e67=function(_0xb96404,_0x30f28b){_0xb96404=_0xb96404-0x0;var _0x1992df=_0xe678[_0xb96404];return _0x1992df;};'use strict';var multer=require(_0x8e67('0x0'));var util=require(_0x8e67('0x1'));var path=require(_0x8e67('0x2'));var timeout=require(_0x8e67('0x3'));var express=require(_0x8e67('0x4'));var router=express[_0x8e67('0x5')]();var auth=require(_0x8e67('0x6'));var interaction=require(_0x8e67('0x7'));var config=require(_0x8e67('0x8'));var controller=require(_0x8e67('0x9'));router[_0x8e67('0xa')]('/',auth[_0x8e67('0xb')](),controller[_0x8e67('0xc')]);router[_0x8e67('0xa')]('/describe',auth[_0x8e67('0xb')](),controller[_0x8e67('0xd')]);router[_0x8e67('0xa')](_0x8e67('0xe'),auth[_0x8e67('0xb')](),controller[_0x8e67('0xf')]);router[_0x8e67('0x10')]('/',auth[_0x8e67('0xb')](),controller[_0x8e67('0x11')]);router[_0x8e67('0x12')](_0x8e67('0xe'),auth['isAuthenticated'](),controller[_0x8e67('0x13')]);router[_0x8e67('0x14')](_0x8e67('0xe'),auth[_0x8e67('0xb')](),controller[_0x8e67('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js
index 6a21040..7ace0f8 100644
--- a/server/api/squareReport/squareReport.attributes.js
+++ b/server/api/squareReport/squareReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1297=['STRING','DATE','BOOLEAN','exports'];(function(_0x13b230,_0x5c16e4){var _0x1b8ce2=function(_0x536630){while(--_0x536630){_0x13b230['push'](_0x13b230['shift']());}};_0x1b8ce2(++_0x5c16e4);}(_0x1297,0x17f));var _0x7129=function(_0x32feeb,_0x2a65bd){_0x32feeb=_0x32feeb-0x0;var _0x52b366=_0x1297[_0x32feeb];return _0x52b366;};'use strict';var Sequelize=require('sequelize');module[_0x7129('0x0')]={'network':{'type':Sequelize[_0x7129('0x1')]},'network_script':{'type':Sequelize[_0x7129('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7129('0x1')]},'language':{'type':Sequelize[_0x7129('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x7129('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7129('0x1')]},'callingpres':{'type':Sequelize[_0x7129('0x1')]},'callingani2':{'type':Sequelize[_0x7129('0x1')]},'callington':{'type':Sequelize[_0x7129('0x1')]},'callingtns':{'type':Sequelize[_0x7129('0x1')]},'dnid':{'type':Sequelize[_0x7129('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7129('0x1')]},'extension':{'type':Sequelize[_0x7129('0x1')]},'priority':{'type':Sequelize[_0x7129('0x1')]},'enhanced':{'type':Sequelize[_0x7129('0x1')]},'accountcode':{'type':Sequelize[_0x7129('0x1')]},'threadid':{'type':Sequelize[_0x7129('0x1')]},'project_name':{'type':Sequelize[_0x7129('0x1')]},'joinAt':{'type':Sequelize[_0x7129('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x7129('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x52b7=['STRING','DATE','BOOLEAN','exports'];(function(_0x49f6c8,_0x52e4de){var _0x1ab8e3=function(_0x52af02){while(--_0x52af02){_0x49f6c8['push'](_0x49f6c8['shift']());}};_0x1ab8e3(++_0x52e4de);}(_0x52b7,0x6b));var _0x752b=function(_0x67d4ca,_0x455f15){_0x67d4ca=_0x67d4ca-0x0;var _0xc53c24=_0x52b7[_0x67d4ca];return _0xc53c24;};'use strict';var Sequelize=require('sequelize');module[_0x752b('0x0')]={'network':{'type':Sequelize[_0x752b('0x1')]},'network_script':{'type':Sequelize[_0x752b('0x1')]},'request':{'type':Sequelize[_0x752b('0x1')]},'channel':{'type':Sequelize[_0x752b('0x1')]},'language':{'type':Sequelize[_0x752b('0x1')]},'type':{'type':Sequelize[_0x752b('0x1')]},'uniqueid':{'type':Sequelize[_0x752b('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x752b('0x1')]},'calleridname':{'type':Sequelize[_0x752b('0x1')]},'callingpres':{'type':Sequelize[_0x752b('0x1')]},'callingani2':{'type':Sequelize[_0x752b('0x1')]},'callington':{'type':Sequelize[_0x752b('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x752b('0x1')]},'rdnis':{'type':Sequelize[_0x752b('0x1')]},'context':{'type':Sequelize[_0x752b('0x1')]},'extension':{'type':Sequelize[_0x752b('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x752b('0x1')]},'accountcode':{'type':Sequelize[_0x752b('0x1')]},'threadid':{'type':Sequelize[_0x752b('0x1')]},'project_name':{'type':Sequelize[_0x752b('0x1')]},'joinAt':{'type':Sequelize[_0x752b('0x2')]},'leaveAt':{'type':Sequelize[_0x752b('0x2')]},'bot':{'type':Sequelize[_0x752b('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js
index 2081da5..0341880 100644
--- a/server/api/squareReport/squareReport.controller.js
+++ b/server/api/squareReport/squareReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x356e=['index','map','SquareReport','rawAttributes','key','name','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','params','length','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','count','offset','limit','set','Content-Range','json','apply','save','destroy','then','sendStatus','error','stack'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x356e,0x1d2));var _0xe356=function(_0x4e7987,_0x2b665b){_0x4e7987=_0x4e7987-0x0;var _0x153cbe=_0x356e[_0x4e7987];return _0x153cbe;};'use strict';var pdf=require(_0xe356('0x0'));var emlformat=require(_0xe356('0x1'));var rimraf=require(_0xe356('0x2'));var zipdir=require(_0xe356('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe356('0x4'));var moment=require('moment');var BPromise=require(_0xe356('0x5'));var Mustache=require(_0xe356('0x6'));var util=require(_0xe356('0x7'));var path=require(_0xe356('0x8'));var sox=require(_0xe356('0x9'));var csv=require(_0xe356('0xa'));var ejs=require(_0xe356('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe356('0xc'));var crypto=require(_0xe356('0xd'));var jsforce=require(_0xe356('0xe'));var deskjs=require(_0xe356('0xf'));var toCsv=require(_0xe356('0xa'));var querystring=require(_0xe356('0x10'));var Papa=require(_0xe356('0x11'));var Redis=require(_0xe356('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe356('0x13'));var as=require(_0xe356('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe356('0x15'))(_0xe356('0x16'));var utils=require(_0xe356('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10dde7,_0x27a819){_0x27a819=_0x27a819||0xcc;return function(_0x1f068c){if(_0x1f068c){return _0x10dde7['sendStatus'](_0x27a819);}return _0x10dde7[_0xe356('0x18')](_0x27a819)['end']();};}function respondWithResult(_0x4aae00,_0x2f0d19){_0x2f0d19=_0x2f0d19||0xc8;return function(_0x1a4b2c){if(_0x1a4b2c){return _0x4aae00['status'](_0x2f0d19)['json'](_0x1a4b2c);}};}function respondWithFilteredResult(_0x3b3c93,_0xc7ebed){return function(_0x3a7ab5){if(_0x3a7ab5){var _0x33b6dc=_0x3a7ab5[_0xe356('0x19')],_0xce9a7c=_0xc7ebed[_0xe356('0x1a')],_0x359cd7=_0xc7ebed['offset']+_0xc7ebed[_0xe356('0x1b')],_0x18f7e5;if(_0x359cd7>=_0x33b6dc){_0x359cd7=_0x33b6dc;_0x18f7e5=0xc8;}else{_0x18f7e5=0xce;}_0x3b3c93['status'](_0x18f7e5);return _0x3b3c93[_0xe356('0x1c')](_0xe356('0x1d'),_0xce9a7c+'-'+_0x359cd7+'/'+_0x33b6dc)[_0xe356('0x1e')](_0x3a7ab5);}return null;};}function patchUpdates(_0x40b74b){return function(_0x1b14a8){try{jsonpatch[_0xe356('0x1f')](_0x1b14a8,_0x40b74b,!![]);}catch(_0x67753a){return BPromise['reject'](_0x67753a);}return _0x1b14a8[_0xe356('0x20')]();};}function saveUpdates(_0x18af38,_0x1fa892){return function(_0x21360d){if(_0x21360d){return _0x21360d['update'](_0x18af38)['then'](function(_0x7beaaa){return _0x7beaaa;});}return null;};}function removeEntity(_0x37d261,_0x37c7fd){return function(_0x489ccd){if(_0x489ccd){return _0x489ccd[_0xe356('0x21')]()[_0xe356('0x22')](function(){_0x37d261[_0xe356('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ea2a,_0x244e9d){return function(_0x1c03e2){if(!_0x1c03e2){_0x20ea2a[_0xe356('0x23')](0x194);}return _0x1c03e2;};}function handleError(_0x4caf5a,_0x3eccee){_0x3eccee=_0x3eccee||0x1f4;return function(_0x4779fc){logger[_0xe356('0x24')](_0x4779fc[_0xe356('0x25')]);if(_0x4779fc['name']){delete _0x4779fc['name'];}_0x4caf5a[_0xe356('0x18')](_0x3eccee)['send'](_0x4779fc);};}exports[_0xe356('0x26')]=function(_0xd10d25,_0x8aa094){var _0xa6f906={},_0x4481b9={},_0x569afd={'count':0x0,'rows':[]};var _0xc5abee=_[_0xe356('0x27')](db[_0xe356('0x28')][_0xe356('0x29')],function(_0x4eab73){return{'name':_0x4eab73['fieldName'],'type':_0x4eab73['type'][_0xe356('0x2a')]};});_0x4481b9['model']=_[_0xe356('0x27')](_0xc5abee,_0xe356('0x2b'));_0x4481b9[_0xe356('0x2c')]=_[_0xe356('0x2d')](_0xd10d25[_0xe356('0x2c')]);_0x4481b9[_0xe356('0x2e')]=_['intersection'](_0x4481b9['model'],_0x4481b9[_0xe356('0x2c')]);_0xa6f906[_0xe356('0x2f')]=_[_0xe356('0x30')](_0x4481b9['model'],qs[_0xe356('0x31')](_0xd10d25[_0xe356('0x2c')]['fields']));_0xa6f906['attributes']=_0xa6f906[_0xe356('0x2f')]['length']?_0xa6f906[_0xe356('0x2f')]:_0x4481b9[_0xe356('0x32')];if(!_0xd10d25['query'][_0xe356('0x33')](_0xe356('0x34'))){_0xa6f906[_0xe356('0x1b')]=qs[_0xe356('0x1b')](_0xd10d25[_0xe356('0x2c')][_0xe356('0x1b')]);_0xa6f906['offset']=qs['offset'](_0xd10d25['query'][_0xe356('0x1a')]);}_0xa6f906[_0xe356('0x35')]=qs[_0xe356('0x36')](_0xd10d25[_0xe356('0x2c')]['sort']);_0xa6f906[_0xe356('0x37')]=qs['filters'](_['pick'](_0xd10d25[_0xe356('0x2c')],_0x4481b9[_0xe356('0x2e')]),_0xc5abee);if(_0xd10d25['query']['filter']){_0xa6f906[_0xe356('0x37')]=_[_0xe356('0x38')](_0xa6f906[_0xe356('0x37')],{'$or':_[_0xe356('0x27')](_0xc5abee,function(_0x575007){if(_0x575007[_0xe356('0x39')]!==_0xe356('0x3a')){var _0x4b7ff5={};_0x4b7ff5[_0x575007[_0xe356('0x2b')]]={'$like':'%'+_0xd10d25[_0xe356('0x2c')][_0xe356('0x3b')]+'%'};return _0x4b7ff5;}})});}_0xa6f906=_['merge']({},_0xa6f906,_0xd10d25['options']);var _0x36b11e={'where':_0xa6f906[_0xe356('0x37')]};return db[_0xe356('0x28')][_0xe356('0x19')](_0x36b11e)[_0xe356('0x22')](function(_0x4b24e6){_0x569afd['count']=_0x4b24e6;if(_0xd10d25[_0xe356('0x2c')][_0xe356('0x3c')]){_0xa6f906[_0xe356('0x3d')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0xa6f906);})['then'](function(_0x16d908){_0x569afd[_0xe356('0x3e')]=_0x16d908;return _0x569afd;})['then'](respondWithFilteredResult(_0x8aa094,_0xa6f906))[_0xe356('0x3f')](handleError(_0x8aa094,null));};exports['show']=function(_0x886c4b,_0x4ef68c){var _0x4e0f79={'raw':!![],'where':{'id':_0x886c4b[_0xe356('0x40')]['id']}},_0x5be087={};_0x5be087[_0xe356('0x32')]=_[_0xe356('0x2d')](db[_0xe356('0x28')]['rawAttributes']);_0x5be087['query']=_[_0xe356('0x2d')](_0x886c4b[_0xe356('0x2c')]);_0x5be087[_0xe356('0x2e')]=_[_0xe356('0x30')](_0x5be087[_0xe356('0x32')],_0x5be087['query']);_0x4e0f79['attributes']=_[_0xe356('0x30')](_0x5be087[_0xe356('0x32')],qs[_0xe356('0x31')](_0x886c4b[_0xe356('0x2c')][_0xe356('0x31')]));_0x4e0f79[_0xe356('0x2f')]=_0x4e0f79[_0xe356('0x2f')][_0xe356('0x41')]?_0x4e0f79[_0xe356('0x2f')]:_0x5be087[_0xe356('0x32')];if(_0x886c4b[_0xe356('0x2c')][_0xe356('0x3c')]){_0x4e0f79[_0xe356('0x3d')]=[{'all':!![]}];}_0x4e0f79=_[_0xe356('0x38')]({},_0x4e0f79,_0x886c4b[_0xe356('0x42')]);return db[_0xe356('0x28')][_0xe356('0x43')](_0x4e0f79)[_0xe356('0x22')](handleEntityNotFound(_0x4ef68c,null))[_0xe356('0x22')](respondWithResult(_0x4ef68c,null))[_0xe356('0x3f')](handleError(_0x4ef68c,null));};exports[_0xe356('0x44')]=function(_0x6a4771,_0x25e9b7){return db['SquareReport'][_0xe356('0x44')](_0x6a4771[_0xe356('0x45')],{})[_0xe356('0x22')](respondWithResult(_0x25e9b7,0xc9))[_0xe356('0x3f')](handleError(_0x25e9b7,null));};exports[_0xe356('0x46')]=function(_0x39f360,_0x118d51){if(_0x39f360['body']['id']){delete _0x39f360[_0xe356('0x45')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x39f360[_0xe356('0x40')]['id']}})[_0xe356('0x22')](handleEntityNotFound(_0x118d51,null))[_0xe356('0x22')](saveUpdates(_0x39f360[_0xe356('0x45')],null))[_0xe356('0x22')](respondWithResult(_0x118d51,null))[_0xe356('0x3f')](handleError(_0x118d51,null));};exports['destroy']=function(_0x3d4142,_0xc95dd9){return db[_0xe356('0x28')]['find']({'where':{'id':_0x3d4142[_0xe356('0x40')]['id']}})[_0xe356('0x22')](handleEntityNotFound(_0xc95dd9,null))[_0xe356('0x22')](removeEntity(_0xc95dd9,null))['catch'](handleError(_0xc95dd9,null));};exports[_0xe356('0x47')]=function(_0x313de0,_0x17c018){return db['SquareReport'][_0xe356('0x47')]()[_0xe356('0x22')](respondWithResult(_0x17c018,null))[_0xe356('0x3f')](handleError(_0x17c018,null));};
\ No newline at end of file
+var _0xfbf9=['hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','SquareReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x4e3656,_0x36b315){var _0x313a1a=function(_0x417421){while(--_0x417421){_0x4e3656['push'](_0x4e3656['shift']());}};_0x313a1a(++_0x36b315);}(_0xfbf9,0xa6));var _0x9fbf=function(_0x481c41,_0x48ba3c){_0x481c41=_0x481c41-0x0;var _0xf91fd=_0xfbf9[_0x481c41];return _0xf91fd;};'use strict';var pdf=require(_0x9fbf('0x0'));var emlformat=require(_0x9fbf('0x1'));var rimraf=require(_0x9fbf('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fbf('0x3'));var rp=require(_0x9fbf('0x4'));var moment=require(_0x9fbf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9fbf('0x6'));var util=require(_0x9fbf('0x7'));var path=require(_0x9fbf('0x8'));var sox=require('sox');var csv=require(_0x9fbf('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9fbf('0xa'));var squel=require('squel');var crypto=require(_0x9fbf('0xb'));var jsforce=require(_0x9fbf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9fbf('0x9'));var querystring=require('querystring');var Papa=require(_0x9fbf('0xd'));var Redis=require(_0x9fbf('0xe'));var authService=require(_0x9fbf('0xf'));var qs=require(_0x9fbf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9fbf('0x11'));var logger=require('../../config/logger')(_0x9fbf('0x12'));var utils=require(_0x9fbf('0x13'));var config=require(_0x9fbf('0x14'));var db=require(_0x9fbf('0x15'))['db'];function respondWithStatusCode(_0xe56287,_0x32581a){_0x32581a=_0x32581a||0xcc;return function(_0x4ae5b1){if(_0x4ae5b1){return _0xe56287[_0x9fbf('0x16')](_0x32581a);}return _0xe56287['status'](_0x32581a)[_0x9fbf('0x17')]();};}function respondWithResult(_0x283245,_0x50d037){_0x50d037=_0x50d037||0xc8;return function(_0x3778e6){if(_0x3778e6){return _0x283245[_0x9fbf('0x18')](_0x50d037)[_0x9fbf('0x19')](_0x3778e6);}};}function respondWithFilteredResult(_0x27e72e,_0x5b874b){return function(_0x1b06f8){if(_0x1b06f8){var _0x45403e=_0x1b06f8[_0x9fbf('0x1a')],_0x5b5d5d=_0x5b874b[_0x9fbf('0x1b')],_0xc01db4=_0x5b874b[_0x9fbf('0x1b')]+_0x5b874b[_0x9fbf('0x1c')],_0x4679aa;if(_0xc01db4>=_0x45403e){_0xc01db4=_0x45403e;_0x4679aa=0xc8;}else{_0x4679aa=0xce;}_0x27e72e[_0x9fbf('0x18')](_0x4679aa);return _0x27e72e['set'](_0x9fbf('0x1d'),_0x5b5d5d+'-'+_0xc01db4+'/'+_0x45403e)[_0x9fbf('0x19')](_0x1b06f8);}return null;};}function patchUpdates(_0x5babc9){return function(_0x386872){try{jsonpatch['apply'](_0x386872,_0x5babc9,!![]);}catch(_0xffd4fc){return BPromise[_0x9fbf('0x1e')](_0xffd4fc);}return _0x386872[_0x9fbf('0x1f')]();};}function saveUpdates(_0x4df859,_0x4350a0){return function(_0x3fff29){if(_0x3fff29){return _0x3fff29[_0x9fbf('0x20')](_0x4df859)[_0x9fbf('0x21')](function(_0x12fe2e){return _0x12fe2e;});}return null;};}function removeEntity(_0x13df57,_0x4d604c){return function(_0x51af17){if(_0x51af17){return _0x51af17[_0x9fbf('0x22')]()[_0x9fbf('0x21')](function(){_0x13df57['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ac3d3,_0x571c58){return function(_0x68dbde){if(!_0x68dbde){_0x1ac3d3['sendStatus'](0x194);}return _0x68dbde;};}function handleError(_0x168074,_0x225dfe){_0x225dfe=_0x225dfe||0x1f4;return function(_0x340411){logger[_0x9fbf('0x23')](_0x340411[_0x9fbf('0x24')]);if(_0x340411['name']){delete _0x340411[_0x9fbf('0x25')];}_0x168074[_0x9fbf('0x18')](_0x225dfe)['send'](_0x340411);};}exports[_0x9fbf('0x26')]=function(_0x5cbc9b,_0x29e62f){var _0x167f21={},_0x3a47ed={},_0x1bb3bb={'count':0x0,'rows':[]};var _0x200f75=_[_0x9fbf('0x27')](db[_0x9fbf('0x28')][_0x9fbf('0x29')],function(_0x163e85){return{'name':_0x163e85[_0x9fbf('0x2a')],'type':_0x163e85[_0x9fbf('0x2b')][_0x9fbf('0x2c')]};});_0x3a47ed[_0x9fbf('0x2d')]=_[_0x9fbf('0x27')](_0x200f75,_0x9fbf('0x25'));_0x3a47ed['query']=_[_0x9fbf('0x2e')](_0x5cbc9b[_0x9fbf('0x2f')]);_0x3a47ed[_0x9fbf('0x30')]=_[_0x9fbf('0x31')](_0x3a47ed[_0x9fbf('0x2d')],_0x3a47ed[_0x9fbf('0x2f')]);_0x167f21[_0x9fbf('0x32')]=_[_0x9fbf('0x31')](_0x3a47ed['model'],qs[_0x9fbf('0x33')](_0x5cbc9b[_0x9fbf('0x2f')][_0x9fbf('0x33')]));_0x167f21['attributes']=_0x167f21[_0x9fbf('0x32')][_0x9fbf('0x34')]?_0x167f21[_0x9fbf('0x32')]:_0x3a47ed['model'];if(!_0x5cbc9b['query'][_0x9fbf('0x35')](_0x9fbf('0x36'))){_0x167f21[_0x9fbf('0x1c')]=qs[_0x9fbf('0x1c')](_0x5cbc9b['query']['limit']);_0x167f21[_0x9fbf('0x1b')]=qs[_0x9fbf('0x1b')](_0x5cbc9b['query']['offset']);}_0x167f21['order']=qs[_0x9fbf('0x37')](_0x5cbc9b[_0x9fbf('0x2f')][_0x9fbf('0x37')]);_0x167f21['where']=qs['filters'](_[_0x9fbf('0x38')](_0x5cbc9b[_0x9fbf('0x2f')],_0x3a47ed[_0x9fbf('0x30')]),_0x200f75);if(_0x5cbc9b[_0x9fbf('0x2f')][_0x9fbf('0x39')]){_0x167f21[_0x9fbf('0x3a')]=_[_0x9fbf('0x3b')](_0x167f21['where'],{'$or':_[_0x9fbf('0x27')](_0x200f75,function(_0x24c7f5){if(_0x24c7f5[_0x9fbf('0x2b')]!==_0x9fbf('0x3c')){var _0x458759={};_0x458759[_0x24c7f5[_0x9fbf('0x25')]]={'$like':'%'+_0x5cbc9b[_0x9fbf('0x2f')][_0x9fbf('0x39')]+'%'};return _0x458759;}})});}_0x167f21=_[_0x9fbf('0x3b')]({},_0x167f21,_0x5cbc9b['options']);var _0x50c75c={'where':_0x167f21['where']};return db[_0x9fbf('0x28')][_0x9fbf('0x1a')](_0x50c75c)['then'](function(_0x20ce32){_0x1bb3bb[_0x9fbf('0x1a')]=_0x20ce32;if(_0x5cbc9b[_0x9fbf('0x2f')]['includeAll']){_0x167f21[_0x9fbf('0x3d')]=[{'all':!![]}];}return db['SquareReport'][_0x9fbf('0x3e')](_0x167f21);})['then'](function(_0x3ef002){_0x1bb3bb[_0x9fbf('0x3f')]=_0x3ef002;return _0x1bb3bb;})[_0x9fbf('0x21')](respondWithFilteredResult(_0x29e62f,_0x167f21))[_0x9fbf('0x40')](handleError(_0x29e62f,null));};exports[_0x9fbf('0x41')]=function(_0x478d36,_0x182102){var _0x193168={'raw':!![],'where':{'id':_0x478d36[_0x9fbf('0x42')]['id']}},_0x58f830={};_0x58f830[_0x9fbf('0x2d')]=_[_0x9fbf('0x2e')](db[_0x9fbf('0x28')][_0x9fbf('0x29')]);_0x58f830[_0x9fbf('0x2f')]=_[_0x9fbf('0x2e')](_0x478d36['query']);_0x58f830[_0x9fbf('0x30')]=_[_0x9fbf('0x31')](_0x58f830[_0x9fbf('0x2d')],_0x58f830[_0x9fbf('0x2f')]);_0x193168[_0x9fbf('0x32')]=_['intersection'](_0x58f830[_0x9fbf('0x2d')],qs[_0x9fbf('0x33')](_0x478d36[_0x9fbf('0x2f')][_0x9fbf('0x33')]));_0x193168[_0x9fbf('0x32')]=_0x193168[_0x9fbf('0x32')][_0x9fbf('0x34')]?_0x193168[_0x9fbf('0x32')]:_0x58f830[_0x9fbf('0x2d')];if(_0x478d36[_0x9fbf('0x2f')][_0x9fbf('0x43')]){_0x193168[_0x9fbf('0x3d')]=[{'all':!![]}];}_0x193168=_[_0x9fbf('0x3b')]({},_0x193168,_0x478d36[_0x9fbf('0x44')]);return db[_0x9fbf('0x28')][_0x9fbf('0x45')](_0x193168)[_0x9fbf('0x21')](handleEntityNotFound(_0x182102,null))[_0x9fbf('0x21')](respondWithResult(_0x182102,null))[_0x9fbf('0x40')](handleError(_0x182102,null));};exports[_0x9fbf('0x46')]=function(_0xf920ad,_0x335ab9){return db[_0x9fbf('0x28')][_0x9fbf('0x46')](_0xf920ad[_0x9fbf('0x47')],{})[_0x9fbf('0x21')](respondWithResult(_0x335ab9,0xc9))[_0x9fbf('0x40')](handleError(_0x335ab9,null));};exports['update']=function(_0x2b38dd,_0x3d3f92){if(_0x2b38dd[_0x9fbf('0x47')]['id']){delete _0x2b38dd[_0x9fbf('0x47')]['id'];}return db[_0x9fbf('0x28')][_0x9fbf('0x45')]({'where':{'id':_0x2b38dd['params']['id']}})[_0x9fbf('0x21')](handleEntityNotFound(_0x3d3f92,null))['then'](saveUpdates(_0x2b38dd[_0x9fbf('0x47')],null))[_0x9fbf('0x21')](respondWithResult(_0x3d3f92,null))['catch'](handleError(_0x3d3f92,null));};exports['destroy']=function(_0xb408a6,_0x202b89){return db[_0x9fbf('0x28')][_0x9fbf('0x45')]({'where':{'id':_0xb408a6[_0x9fbf('0x42')]['id']}})[_0x9fbf('0x21')](handleEntityNotFound(_0x202b89,null))[_0x9fbf('0x21')](removeEntity(_0x202b89,null))[_0x9fbf('0x40')](handleError(_0x202b89,null));};exports[_0x9fbf('0x48')]=function(_0x3993ae,_0x2f735e){return db[_0x9fbf('0x28')]['describe']()[_0x9fbf('0x21')](respondWithResult(_0x2f735e,null))[_0x9fbf('0x40')](handleError(_0x2f735e,null));};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js
index 5997955..fa12c3d 100644
--- a/server/api/squareReport/squareReport.model.js
+++ b/server/api/squareReport/squareReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x910c=['path','rimraf','../../config/environment','./squareReport.attributes','exports','define','uniqueid','project_name','leaveAt','lodash','util','moment'];(function(_0x5d967b,_0x32b32b){var _0x319e03=function(_0x2d014e){while(--_0x2d014e){_0x5d967b['push'](_0x5d967b['shift']());}};_0x319e03(++_0x32b32b);}(_0x910c,0xa5));var _0xc910=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x910c[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0xc910('0x0'));var util=require(_0xc910('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc910('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc910('0x3'));var rimraf=require(_0xc910('0x4'));var config=require(_0xc910('0x5'));var attributes=require(_0xc910('0x6'));module[_0xc910('0x7')]=function(_0x31462a,_0x35a77f){return _0x31462a[_0xc910('0x8')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xc910('0x9'),_0xc910('0xa')]},{'name':_0xc910('0xb'),'fields':[_0xc910('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d84=['./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','util','moment','request-promise','rimraf'];(function(_0x50e117,_0x21aa13){var _0x44bd14=function(_0x348b16){while(--_0x348b16){_0x50e117['push'](_0x50e117['shift']());}};_0x44bd14(++_0x21aa13);}(_0x6d84,0x1d0));var _0x46d8=function(_0x21c0fa,_0x220a53){_0x21c0fa=_0x21c0fa-0x0;var _0x5a1c6e=_0x6d84[_0x21c0fa];return _0x5a1c6e;};'use strict';var _=require('lodash');var util=require(_0x46d8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x46d8('0x1'));var BPromise=require('bluebird');var rp=require(_0x46d8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46d8('0x3'));var config=require('../../config/environment');var attributes=require(_0x46d8('0x4'));module[_0x46d8('0x5')]=function(_0x285394,_0x212c14){return _0x285394[_0x46d8('0x6')](_0x46d8('0x7'),attributes,{'tableName':_0x46d8('0x8'),'paranoid':![],'indexes':[{'name':_0x46d8('0x9'),'fields':[_0x46d8('0xa'),_0x46d8('0xb')]},{'name':_0x46d8('0xc'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js
index 14b7bc7..f377e0e 100644
--- a/server/api/squareReport/squareReport.rpc.js
+++ b/server/api/squareReport/squareReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9eab=['SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareReport','body','options','then','CreateSquareReport','update','where','attributes','limit','UpdateSquareReport','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x9eab,0x185));var _0xb9ea=function(_0x4780c6,_0xda74ff){_0x4780c6=_0x4780c6-0x0;var _0x1a4182=_0x9eab[_0x4780c6];return _0x1a4182;};'use strict';var _=require('lodash');var util=require(_0xb9ea('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb9ea('0x1'));var fs=require('fs');var Redis=require(_0xb9ea('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9ea('0x3'));var logger=require(_0xb9ea('0x4'))(_0xb9ea('0x5'));var config=require('../../config/environment');var jayson=require(_0xb9ea('0x6'));var client=jayson[_0xb9ea('0x7')][_0xb9ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e3edc,_0x4beafb,_0x322ae4){return new BPromise(function(_0x26b1f5,_0x3b756c){return client[_0xb9ea('0x9')](_0x5e3edc,_0x322ae4)['then'](function(_0x32b6e2){logger[_0xb9ea('0xa')](_0xb9ea('0xb'),_0x4beafb,_0xb9ea('0xc'));logger[_0xb9ea('0xd')](_0xb9ea('0xe'),_0x4beafb,_0xb9ea('0xc'),JSON[_0xb9ea('0xf')](_0x32b6e2));if(_0x32b6e2['error']){if(_0x32b6e2[_0xb9ea('0x10')][_0xb9ea('0x11')]===0x1f4){logger[_0xb9ea('0x10')](_0xb9ea('0xb'),_0x4beafb,_0x32b6e2['error'][_0xb9ea('0x12')]);return _0x3b756c(_0x32b6e2[_0xb9ea('0x10')][_0xb9ea('0x12')]);}logger[_0xb9ea('0x10')](_0xb9ea('0xb'),_0x4beafb,_0x32b6e2[_0xb9ea('0x10')]['message']);return _0x26b1f5(_0x32b6e2[_0xb9ea('0x10')][_0xb9ea('0x12')]);}else{logger[_0xb9ea('0xa')](_0xb9ea('0xb'),_0x4beafb,_0xb9ea('0xc'));_0x26b1f5(_0x32b6e2[_0xb9ea('0x13')]['message']);}})[_0xb9ea('0x14')](function(_0x21e106){logger['error'](_0xb9ea('0xb'),_0x4beafb,_0x21e106);_0x3b756c(_0x21e106);});});}exports['CreateSquareReport']=function(_0x418b6b){var _0x489e75=this;return new Promise(function(_0x2b5561,_0x4a5338){return db[_0xb9ea('0x15')]['create'](_0x418b6b[_0xb9ea('0x16')],{'raw':_0x418b6b[_0xb9ea('0x17')]?_0x418b6b[_0xb9ea('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xb9ea('0x18')](function(_0x303f55){logger[_0xb9ea('0xa')](_0xb9ea('0x19'),_0x418b6b);logger[_0xb9ea('0xd')]('CreateSquareReport',_0x418b6b,JSON[_0xb9ea('0xf')](_0x303f55));_0x2b5561(_0x303f55);})[_0xb9ea('0x14')](function(_0x1bac17){logger[_0xb9ea('0x10')](_0xb9ea('0x19'),_0x1bac17[_0xb9ea('0x12')],_0x418b6b);_0x4a5338(_0x489e75[_0xb9ea('0x10')](0x1f4,_0x1bac17['message']));});});};exports['UpdateSquareReport']=function(_0x3f5234){var _0x2e1a7a=this;return new Promise(function(_0x4ec7c7,_0x24c1e4){return db['SquareReport'][_0xb9ea('0x1a')](_0x3f5234[_0xb9ea('0x16')],{'raw':_0x3f5234['options']?_0x3f5234['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f5234[_0xb9ea('0x17')]?_0x3f5234[_0xb9ea('0x17')][_0xb9ea('0x1b')]||null:null,'attributes':_0x3f5234[_0xb9ea('0x17')]?_0x3f5234[_0xb9ea('0x17')][_0xb9ea('0x1c')]||null:null,'limit':_0x3f5234[_0xb9ea('0x17')]?_0x3f5234[_0xb9ea('0x17')][_0xb9ea('0x1d')]||null:null})[_0xb9ea('0x18')](function(_0x13e736){logger[_0xb9ea('0xa')]('UpdateSquareReport',_0x3f5234);logger[_0xb9ea('0xd')](_0xb9ea('0x1e'),_0x3f5234,JSON[_0xb9ea('0xf')](_0x13e736));_0x4ec7c7(_0x13e736);})['catch'](function(_0x4b17a2){logger[_0xb9ea('0x10')](_0xb9ea('0x1e'),_0x4b17a2['message'],_0x3f5234);_0x24c1e4(_0x2e1a7a[_0xb9ea('0x10')](0x1f4,_0x4b17a2[_0xb9ea('0x12')]));});});};
\ No newline at end of file
+var _0xcc8a=['result','catch','CreateSquareReport','SquareReport','create','options','debug','UpdateSquareReport','body','raw','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5dc8b6,_0x119839){var _0xae0825=function(_0x3801a8){while(--_0x3801a8){_0x5dc8b6['push'](_0x5dc8b6['shift']());}};_0xae0825(++_0x119839);}(_0xcc8a,0x74));var _0xacc8=function(_0x3a603f,_0x5dd75c){_0x3a603f=_0x3a603f-0x0;var _0x12d8e0=_0xcc8a[_0x3a603f];return _0x12d8e0;};'use strict';var _=require(_0xacc8('0x0'));var util=require(_0xacc8('0x1'));var moment=require(_0xacc8('0x2'));var BPromise=require(_0xacc8('0x3'));var rs=require(_0xacc8('0x4'));var fs=require('fs');var Redis=require(_0xacc8('0x5'));var db=require(_0xacc8('0x6'))['db'];var utils=require(_0xacc8('0x7'));var logger=require(_0xacc8('0x8'))(_0xacc8('0x9'));var config=require(_0xacc8('0xa'));var jayson=require(_0xacc8('0xb'));var client=jayson[_0xacc8('0xc')][_0xacc8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1a109b,_0xb9c323,_0x30e050){return new BPromise(function(_0x2225ff,_0x3731d0){return client[_0xacc8('0xe')](_0x1a109b,_0x30e050)[_0xacc8('0xf')](function(_0x2e91c2){logger['info'](_0xacc8('0x10'),_0xb9c323,_0xacc8('0x11'));logger['debug'](_0xacc8('0x12'),_0xb9c323,_0xacc8('0x11'),JSON[_0xacc8('0x13')](_0x2e91c2));if(_0x2e91c2[_0xacc8('0x14')]){if(_0x2e91c2[_0xacc8('0x14')][_0xacc8('0x15')]===0x1f4){logger[_0xacc8('0x14')](_0xacc8('0x10'),_0xb9c323,_0x2e91c2[_0xacc8('0x14')][_0xacc8('0x16')]);return _0x3731d0(_0x2e91c2[_0xacc8('0x14')][_0xacc8('0x16')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0xb9c323,_0x2e91c2[_0xacc8('0x14')][_0xacc8('0x16')]);return _0x2225ff(_0x2e91c2[_0xacc8('0x14')]['message']);}else{logger[_0xacc8('0x17')](_0xacc8('0x10'),_0xb9c323,_0xacc8('0x11'));_0x2225ff(_0x2e91c2[_0xacc8('0x18')][_0xacc8('0x16')]);}})[_0xacc8('0x19')](function(_0x3a631c){logger[_0xacc8('0x14')](_0xacc8('0x10'),_0xb9c323,_0x3a631c);_0x3731d0(_0x3a631c);});});}exports[_0xacc8('0x1a')]=function(_0x2364cd){var _0x6aa327=this;return new Promise(function(_0x39e4ec,_0x5302e1){return db[_0xacc8('0x1b')][_0xacc8('0x1c')](_0x2364cd['body'],{'raw':_0x2364cd[_0xacc8('0x1d')]?_0x2364cd['options']['raw']===undefined?!![]:![]:!![]})[_0xacc8('0xf')](function(_0x3f5feb){logger[_0xacc8('0x17')](_0xacc8('0x1a'),_0x2364cd);logger[_0xacc8('0x1e')](_0xacc8('0x1a'),_0x2364cd,JSON[_0xacc8('0x13')](_0x3f5feb));_0x39e4ec(_0x3f5feb);})[_0xacc8('0x19')](function(_0x5d5110){logger['error'](_0xacc8('0x1a'),_0x5d5110['message'],_0x2364cd);_0x5302e1(_0x6aa327[_0xacc8('0x14')](0x1f4,_0x5d5110[_0xacc8('0x16')]));});});};exports[_0xacc8('0x1f')]=function(_0x311936){var _0x1f229e=this;return new Promise(function(_0x1247dd,_0x366e40){return db['SquareReport']['update'](_0x311936[_0xacc8('0x20')],{'raw':_0x311936['options']?_0x311936[_0xacc8('0x1d')][_0xacc8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x311936[_0xacc8('0x1d')]?_0x311936[_0xacc8('0x1d')]['where']||null:null,'attributes':_0x311936['options']?_0x311936['options']['attributes']||null:null,'limit':_0x311936[_0xacc8('0x1d')]?_0x311936['options'][_0xacc8('0x22')]||null:null})['then'](function(_0x5a4acc){logger[_0xacc8('0x17')]('UpdateSquareReport',_0x311936);logger[_0xacc8('0x1e')]('UpdateSquareReport',_0x311936,JSON[_0xacc8('0x13')](_0x5a4acc));_0x1247dd(_0x5a4acc);})[_0xacc8('0x19')](function(_0x314ed5){logger[_0xacc8('0x14')](_0xacc8('0x1f'),_0x314ed5[_0xacc8('0x16')],_0x311936);_0x366e40(_0x1f229e[_0xacc8('0x14')](0x1f4,_0x314ed5[_0xacc8('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js
index cccdb5a..182fb15 100644
--- a/server/api/squareReportDetail/index.js
+++ b/server/api/squareReportDetail/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x814b,0x1a2));var _0xb814=function(_0x42d1c8,_0xc13c44){_0x42d1c8=_0x42d1c8-0x0;var _0x22f990=_0x814b[_0x42d1c8];return _0x22f990;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router;
\ No newline at end of file
+var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x19b00a,_0x1b0753){var _0x40eee6=function(_0x599dfa){while(--_0x599dfa){_0x19b00a['push'](_0x19b00a['shift']());}};_0x40eee6(++_0x1b0753);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a7bae,_0x4725c6){_0x5a7bae=_0x5a7bae-0x0;var _0x43c6c2=_0x5f2f[_0x5a7bae];return _0x43c6c2;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js
index 5ba5fd0..96c867a 100644
--- a/server/api/squareReportDetail/squareReportDetail.attributes.js
+++ b/server/api/squareReportDetail/squareReportDetail.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7d9=['exports','STRING','sequelize'];(function(_0x302601,_0x5e65f8){var _0x526400=function(_0x1d1e8f){while(--_0x1d1e8f){_0x302601['push'](_0x302601['shift']());}};_0x526400(++_0x5e65f8);}(_0xf7d9,0xd4));var _0x9f7d=function(_0x4495ea,_0x2cad8f){_0x4495ea=_0x4495ea-0x0;var _0x58a19d=_0xf7d9[_0x4495ea];return _0x58a19d;};'use strict';var Sequelize=require(_0x9f7d('0x0'));module[_0x9f7d('0x1')]={'uniqueid':{'type':Sequelize[_0x9f7d('0x2')]},'node':{'type':Sequelize[_0x9f7d('0x2')]},'application':{'type':Sequelize[_0x9f7d('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x9f7d('0x2')]},'callerid':{'type':Sequelize[_0x9f7d('0x2')]}};
\ No newline at end of file
+var _0xfe94=['exports','STRING','TEXT'];(function(_0x5a25d0,_0xcfc044){var _0x4b2eb4=function(_0x4b83df){while(--_0x4b83df){_0x5a25d0['push'](_0x5a25d0['shift']());}};_0x4b2eb4(++_0xcfc044);}(_0xfe94,0x78));var _0x4fe9=function(_0x5ac96c,_0x412d59){_0x5ac96c=_0x5ac96c-0x0;var _0x9195f8=_0xfe94[_0x5ac96c];return _0x9195f8;};'use strict';var Sequelize=require('sequelize');module[_0x4fe9('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x4fe9('0x1')]},'application':{'type':Sequelize[_0x4fe9('0x1')]},'data':{'type':Sequelize[_0x4fe9('0x2')]},'project_name':{'type':Sequelize[_0x4fe9('0x1')]},'callerid':{'type':Sequelize[_0x4fe9('0x1')]}};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js
index 055768b..21d8333 100644
--- a/server/api/squareReportDetail/squareReportDetail.controller.js
+++ b/server/api/squareReportDetail/squareReportDetail.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x06f0=['where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','reject','then','end','error','stack','name','send','map','SquareDetailsReport','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1bee73,_0x5b8829){var _0x1abf52=function(_0x38e606){while(--_0x38e606){_0x1bee73['push'](_0x1bee73['shift']());}};_0x1abf52(++_0x5b8829);}(_0x06f0,0x132));var _0x006f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06f0[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x006f('0x0'));var rimraf=require(_0x006f('0x1'));var zipdir=require(_0x006f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x006f('0x3'));var moment=require('moment');var BPromise=require(_0x006f('0x4'));var Mustache=require(_0x006f('0x5'));var util=require(_0x006f('0x6'));var path=require(_0x006f('0x7'));var sox=require(_0x006f('0x8'));var csv=require(_0x006f('0x9'));var ejs=require(_0x006f('0xa'));var fs=require('fs');var _=require(_0x006f('0xb'));var squel=require(_0x006f('0xc'));var crypto=require(_0x006f('0xd'));var jsforce=require(_0x006f('0xe'));var deskjs=require(_0x006f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x006f('0x10'));var Papa=require('papaparse');var Redis=require(_0x006f('0x11'));var authService=require(_0x006f('0x12'));var qs=require(_0x006f('0x13'));var as=require(_0x006f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x006f('0x15'))(_0x006f('0x16'));var utils=require(_0x006f('0x17'));var config=require(_0x006f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x290be8,_0x2308df){_0x2308df=_0x2308df||0xcc;return function(_0x370945){if(_0x370945){return _0x290be8[_0x006f('0x19')](_0x2308df);}return _0x290be8[_0x006f('0x1a')](_0x2308df)['end']();};}function respondWithResult(_0x2b709c,_0x3c33d7){_0x3c33d7=_0x3c33d7||0xc8;return function(_0x58bd47){if(_0x58bd47){return _0x2b709c[_0x006f('0x1a')](_0x3c33d7)[_0x006f('0x1b')](_0x58bd47);}};}function respondWithFilteredResult(_0x224bb0,_0x36ae31){return function(_0x3a3ba9){if(_0x3a3ba9){var _0x2bd20d=_0x3a3ba9[_0x006f('0x1c')],_0x5ef450=_0x36ae31[_0x006f('0x1d')],_0x477053=_0x36ae31['offset']+_0x36ae31[_0x006f('0x1e')],_0x1c7dbf;if(_0x477053>=_0x2bd20d){_0x477053=_0x2bd20d;_0x1c7dbf=0xc8;}else{_0x1c7dbf=0xce;}_0x224bb0[_0x006f('0x1a')](_0x1c7dbf);return _0x224bb0['set'](_0x006f('0x1f'),_0x5ef450+'-'+_0x477053+'/'+_0x2bd20d)[_0x006f('0x1b')](_0x3a3ba9);}return null;};}function patchUpdates(_0x3066e5){return function(_0x34b35d){try{jsonpatch['apply'](_0x34b35d,_0x3066e5,!![]);}catch(_0x3d7505){return BPromise[_0x006f('0x20')](_0x3d7505);}return _0x34b35d['save']();};}function saveUpdates(_0x42f652,_0x275645){return function(_0x477588){if(_0x477588){return _0x477588['update'](_0x42f652)[_0x006f('0x21')](function(_0x36fba8){return _0x36fba8;});}return null;};}function removeEntity(_0x3e464b,_0x4d673b){return function(_0x58c627){if(_0x58c627){return _0x58c627['destroy']()[_0x006f('0x21')](function(){_0x3e464b[_0x006f('0x1a')](0xcc)[_0x006f('0x22')]();});}};}function handleEntityNotFound(_0x32b468,_0x1eeaf2){return function(_0x17488c){if(!_0x17488c){_0x32b468[_0x006f('0x19')](0x194);}return _0x17488c;};}function handleError(_0x27b3a9,_0x4533aa){_0x4533aa=_0x4533aa||0x1f4;return function(_0x4224b4){logger[_0x006f('0x23')](_0x4224b4[_0x006f('0x24')]);if(_0x4224b4[_0x006f('0x25')]){delete _0x4224b4[_0x006f('0x25')];}_0x27b3a9['status'](_0x4533aa)[_0x006f('0x26')](_0x4224b4);};}exports['index']=function(_0x34583f,_0x28b6d7){var _0x192862={},_0x3dfb42={},_0x569b19={'count':0x0,'rows':[]};var _0x497e77=_[_0x006f('0x27')](db[_0x006f('0x28')]['rawAttributes'],function(_0x371405){return{'name':_0x371405['fieldName'],'type':_0x371405[_0x006f('0x29')][_0x006f('0x2a')]};});_0x3dfb42[_0x006f('0x2b')]=_[_0x006f('0x27')](_0x497e77,_0x006f('0x25'));_0x3dfb42[_0x006f('0x2c')]=_['keys'](_0x34583f[_0x006f('0x2c')]);_0x3dfb42[_0x006f('0x2d')]=_['intersection'](_0x3dfb42['model'],_0x3dfb42[_0x006f('0x2c')]);_0x192862[_0x006f('0x2e')]=_[_0x006f('0x2f')](_0x3dfb42[_0x006f('0x2b')],qs[_0x006f('0x30')](_0x34583f[_0x006f('0x2c')]['fields']));_0x192862[_0x006f('0x2e')]=_0x192862[_0x006f('0x2e')][_0x006f('0x31')]?_0x192862[_0x006f('0x2e')]:_0x3dfb42['model'];if(!_0x34583f[_0x006f('0x2c')][_0x006f('0x32')](_0x006f('0x33'))){_0x192862[_0x006f('0x1e')]=qs[_0x006f('0x1e')](_0x34583f['query'][_0x006f('0x1e')]);_0x192862[_0x006f('0x1d')]=qs[_0x006f('0x1d')](_0x34583f['query']['offset']);}_0x192862[_0x006f('0x34')]=qs[_0x006f('0x35')](_0x34583f[_0x006f('0x2c')][_0x006f('0x35')]);_0x192862[_0x006f('0x36')]=qs[_0x006f('0x2d')](_[_0x006f('0x37')](_0x34583f[_0x006f('0x2c')],_0x3dfb42[_0x006f('0x2d')]),_0x497e77);if(_0x34583f['query'][_0x006f('0x38')]){_0x192862['where']=_[_0x006f('0x39')](_0x192862[_0x006f('0x36')],{'$or':_[_0x006f('0x27')](_0x497e77,function(_0x1b21ff){if(_0x1b21ff[_0x006f('0x29')]!==_0x006f('0x3a')){var _0x2a761b={};_0x2a761b[_0x1b21ff[_0x006f('0x25')]]={'$like':'%'+_0x34583f[_0x006f('0x2c')][_0x006f('0x38')]+'%'};return _0x2a761b;}})});}_0x192862=_['merge']({},_0x192862,_0x34583f[_0x006f('0x3b')]);var _0xceef31={'where':_0x192862['where']};return db[_0x006f('0x28')][_0x006f('0x1c')](_0xceef31)[_0x006f('0x21')](function(_0x54556e){_0x569b19['count']=_0x54556e;if(_0x34583f['query']['includeAll']){_0x192862[_0x006f('0x3c')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x192862);})[_0x006f('0x21')](function(_0x26434e){_0x569b19[_0x006f('0x3d')]=_0x26434e;return _0x569b19;})[_0x006f('0x21')](respondWithFilteredResult(_0x28b6d7,_0x192862))[_0x006f('0x3e')](handleError(_0x28b6d7,null));};exports[_0x006f('0x3f')]=function(_0x437c1e,_0x18d0b0){var _0xbb8071={'raw':!![],'where':{'id':_0x437c1e[_0x006f('0x40')]['id']}},_0x2868dd={};_0x2868dd[_0x006f('0x2b')]=_[_0x006f('0x41')](db['SquareDetailsReport']['rawAttributes']);_0x2868dd[_0x006f('0x2c')]=_[_0x006f('0x41')](_0x437c1e[_0x006f('0x2c')]);_0x2868dd[_0x006f('0x2d')]=_[_0x006f('0x2f')](_0x2868dd['model'],_0x2868dd[_0x006f('0x2c')]);_0xbb8071['attributes']=_[_0x006f('0x2f')](_0x2868dd[_0x006f('0x2b')],qs['fields'](_0x437c1e['query'][_0x006f('0x30')]));_0xbb8071[_0x006f('0x2e')]=_0xbb8071['attributes'][_0x006f('0x31')]?_0xbb8071[_0x006f('0x2e')]:_0x2868dd['model'];if(_0x437c1e[_0x006f('0x2c')]['includeAll']){_0xbb8071[_0x006f('0x3c')]=[{'all':!![]}];}_0xbb8071=_['merge']({},_0xbb8071,_0x437c1e[_0x006f('0x3b')]);return db['SquareDetailsReport'][_0x006f('0x42')](_0xbb8071)[_0x006f('0x21')](handleEntityNotFound(_0x18d0b0,null))['then'](respondWithResult(_0x18d0b0,null))[_0x006f('0x3e')](handleError(_0x18d0b0,null));};exports[_0x006f('0x43')]=function(_0x855c95,_0x448a50){return db[_0x006f('0x28')]['create'](_0x855c95[_0x006f('0x44')],{})['then'](respondWithResult(_0x448a50,0xc9))[_0x006f('0x3e')](handleError(_0x448a50,null));};exports[_0x006f('0x45')]=function(_0x4857b0,_0xa0f4cb){if(_0x4857b0[_0x006f('0x44')]['id']){delete _0x4857b0['body']['id'];}return db['SquareDetailsReport'][_0x006f('0x42')]({'where':{'id':_0x4857b0['params']['id']}})[_0x006f('0x21')](handleEntityNotFound(_0xa0f4cb,null))[_0x006f('0x21')](saveUpdates(_0x4857b0[_0x006f('0x44')],null))[_0x006f('0x21')](respondWithResult(_0xa0f4cb,null))['catch'](handleError(_0xa0f4cb,null));};exports[_0x006f('0x46')]=function(_0x59d964,_0x3a169e){return db['SquareDetailsReport'][_0x006f('0x42')]({'where':{'id':_0x59d964[_0x006f('0x40')]['id']}})['then'](handleEntityNotFound(_0x3a169e,null))[_0x006f('0x21')](removeEntity(_0x3a169e,null))[_0x006f('0x3e')](handleError(_0x3a169e,null));};exports[_0x006f('0x47')]=function(_0x445c45,_0x27ef95){return db['SquareDetailsReport'][_0x006f('0x47')]()[_0x006f('0x21')](respondWithResult(_0x27ef95,null))[_0x006f('0x3e')](handleError(_0x27ef95,null));};
\ No newline at end of file
+var _0x65cd=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','end','error','stack','index','map','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','fields','attributes','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','include','findAll','catch','show','includeAll','find','create','body','params','destroy','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x65cd,0xc0));var _0xd65c=function(_0x2cbb74,_0x241c10){_0x2cbb74=_0x2cbb74-0x0;var _0xa6d18=_0x65cd[_0x2cbb74];return _0xa6d18;};'use strict';var pdf=require(_0xd65c('0x0'));var emlformat=require(_0xd65c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd65c('0x2'));var rp=require(_0xd65c('0x3'));var moment=require(_0xd65c('0x4'));var BPromise=require(_0xd65c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd65c('0x6'));var csv=require('to-csv');var ejs=require(_0xd65c('0x7'));var fs=require('fs');var _=require(_0xd65c('0x8'));var squel=require(_0xd65c('0x9'));var crypto=require('crypto');var jsforce=require(_0xd65c('0xa'));var deskjs=require(_0xd65c('0xb'));var toCsv=require(_0xd65c('0xc'));var querystring=require(_0xd65c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd65c('0xe'));var qs=require(_0xd65c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd65c('0x10'))(_0xd65c('0x11'));var utils=require(_0xd65c('0x12'));var config=require(_0xd65c('0x13'));var db=require(_0xd65c('0x14'))['db'];function respondWithStatusCode(_0x494201,_0xdcbb6b){_0xdcbb6b=_0xdcbb6b||0xcc;return function(_0x47c713){if(_0x47c713){return _0x494201[_0xd65c('0x15')](_0xdcbb6b);}return _0x494201['status'](_0xdcbb6b)['end']();};}function respondWithResult(_0x11f789,_0x455600){_0x455600=_0x455600||0xc8;return function(_0x29b1de){if(_0x29b1de){return _0x11f789[_0xd65c('0x16')](_0x455600)[_0xd65c('0x17')](_0x29b1de);}};}function respondWithFilteredResult(_0x2de85d,_0x184964){return function(_0x4addeb){if(_0x4addeb){var _0x16941f=_0x4addeb[_0xd65c('0x18')],_0x3c24b6=_0x184964[_0xd65c('0x19')],_0x37d0b4=_0x184964[_0xd65c('0x19')]+_0x184964[_0xd65c('0x1a')],_0x4ab93b;if(_0x37d0b4>=_0x16941f){_0x37d0b4=_0x16941f;_0x4ab93b=0xc8;}else{_0x4ab93b=0xce;}_0x2de85d[_0xd65c('0x16')](_0x4ab93b);return _0x2de85d[_0xd65c('0x1b')](_0xd65c('0x1c'),_0x3c24b6+'-'+_0x37d0b4+'/'+_0x16941f)[_0xd65c('0x17')](_0x4addeb);}return null;};}function patchUpdates(_0x474e9b){return function(_0x505195){try{jsonpatch[_0xd65c('0x1d')](_0x505195,_0x474e9b,!![]);}catch(_0xb2ebf){return BPromise[_0xd65c('0x1e')](_0xb2ebf);}return _0x505195['save']();};}function saveUpdates(_0x46732d,_0x58d664){return function(_0x199522){if(_0x199522){return _0x199522[_0xd65c('0x1f')](_0x46732d)[_0xd65c('0x20')](function(_0xed656d){return _0xed656d;});}return null;};}function removeEntity(_0x25ce91,_0x36ed2a){return function(_0x2632e0){if(_0x2632e0){return _0x2632e0['destroy']()['then'](function(){_0x25ce91[_0xd65c('0x16')](0xcc)[_0xd65c('0x21')]();});}};}function handleEntityNotFound(_0x434a36,_0x57bac3){return function(_0x4fa159){if(!_0x4fa159){_0x434a36[_0xd65c('0x15')](0x194);}return _0x4fa159;};}function handleError(_0x48f5d4,_0x4f1417){_0x4f1417=_0x4f1417||0x1f4;return function(_0x5a0f0a){logger[_0xd65c('0x22')](_0x5a0f0a[_0xd65c('0x23')]);if(_0x5a0f0a['name']){delete _0x5a0f0a['name'];}_0x48f5d4[_0xd65c('0x16')](_0x4f1417)['send'](_0x5a0f0a);};}exports[_0xd65c('0x24')]=function(_0x3a33c3,_0x3004a7){var _0xe71d98={},_0x255cde={},_0x2d6b25={'count':0x0,'rows':[]};var _0x2ffc5f=_[_0xd65c('0x25')](db['SquareDetailsReport'][_0xd65c('0x26')],function(_0x653a6d){return{'name':_0x653a6d[_0xd65c('0x27')],'type':_0x653a6d[_0xd65c('0x28')][_0xd65c('0x29')]};});_0x255cde['model']=_[_0xd65c('0x25')](_0x2ffc5f,_0xd65c('0x2a'));_0x255cde[_0xd65c('0x2b')]=_[_0xd65c('0x2c')](_0x3a33c3['query']);_0x255cde['filters']=_[_0xd65c('0x2d')](_0x255cde['model'],_0x255cde[_0xd65c('0x2b')]);_0xe71d98['attributes']=_[_0xd65c('0x2d')](_0x255cde[_0xd65c('0x2e')],qs['fields'](_0x3a33c3[_0xd65c('0x2b')][_0xd65c('0x2f')]));_0xe71d98[_0xd65c('0x30')]=_0xe71d98[_0xd65c('0x30')][_0xd65c('0x31')]?_0xe71d98[_0xd65c('0x30')]:_0x255cde[_0xd65c('0x2e')];if(!_0x3a33c3[_0xd65c('0x2b')]['hasOwnProperty']('nolimit')){_0xe71d98[_0xd65c('0x1a')]=qs[_0xd65c('0x1a')](_0x3a33c3[_0xd65c('0x2b')][_0xd65c('0x1a')]);_0xe71d98[_0xd65c('0x19')]=qs[_0xd65c('0x19')](_0x3a33c3[_0xd65c('0x2b')][_0xd65c('0x19')]);}_0xe71d98['order']=qs[_0xd65c('0x32')](_0x3a33c3['query']['sort']);_0xe71d98[_0xd65c('0x33')]=qs[_0xd65c('0x34')](_[_0xd65c('0x35')](_0x3a33c3[_0xd65c('0x2b')],_0x255cde[_0xd65c('0x34')]),_0x2ffc5f);if(_0x3a33c3['query'][_0xd65c('0x36')]){_0xe71d98[_0xd65c('0x33')]=_[_0xd65c('0x37')](_0xe71d98['where'],{'$or':_[_0xd65c('0x25')](_0x2ffc5f,function(_0x2a24da){if(_0x2a24da[_0xd65c('0x28')]!==_0xd65c('0x38')){var _0x1977a9={};_0x1977a9[_0x2a24da[_0xd65c('0x2a')]]={'$like':'%'+_0x3a33c3['query']['filter']+'%'};return _0x1977a9;}})});}_0xe71d98=_['merge']({},_0xe71d98,_0x3a33c3[_0xd65c('0x39')]);var _0xebaf72={'where':_0xe71d98[_0xd65c('0x33')]};return db[_0xd65c('0x3a')][_0xd65c('0x18')](_0xebaf72)[_0xd65c('0x20')](function(_0x29c3d6){_0x2d6b25[_0xd65c('0x18')]=_0x29c3d6;if(_0x3a33c3[_0xd65c('0x2b')]['includeAll']){_0xe71d98[_0xd65c('0x3b')]=[{'all':!![]}];}return db[_0xd65c('0x3a')][_0xd65c('0x3c')](_0xe71d98);})[_0xd65c('0x20')](function(_0x1c3da6){_0x2d6b25['rows']=_0x1c3da6;return _0x2d6b25;})[_0xd65c('0x20')](respondWithFilteredResult(_0x3004a7,_0xe71d98))[_0xd65c('0x3d')](handleError(_0x3004a7,null));};exports[_0xd65c('0x3e')]=function(_0x2de434,_0x806a3c){var _0x137866={'raw':!![],'where':{'id':_0x2de434['params']['id']}},_0x2f3199={};_0x2f3199['model']=_[_0xd65c('0x2c')](db[_0xd65c('0x3a')][_0xd65c('0x26')]);_0x2f3199[_0xd65c('0x2b')]=_['keys'](_0x2de434[_0xd65c('0x2b')]);_0x2f3199[_0xd65c('0x34')]=_[_0xd65c('0x2d')](_0x2f3199['model'],_0x2f3199[_0xd65c('0x2b')]);_0x137866[_0xd65c('0x30')]=_[_0xd65c('0x2d')](_0x2f3199['model'],qs[_0xd65c('0x2f')](_0x2de434[_0xd65c('0x2b')][_0xd65c('0x2f')]));_0x137866[_0xd65c('0x30')]=_0x137866[_0xd65c('0x30')][_0xd65c('0x31')]?_0x137866[_0xd65c('0x30')]:_0x2f3199['model'];if(_0x2de434['query'][_0xd65c('0x3f')]){_0x137866[_0xd65c('0x3b')]=[{'all':!![]}];}_0x137866=_['merge']({},_0x137866,_0x2de434[_0xd65c('0x39')]);return db['SquareDetailsReport'][_0xd65c('0x40')](_0x137866)['then'](handleEntityNotFound(_0x806a3c,null))['then'](respondWithResult(_0x806a3c,null))[_0xd65c('0x3d')](handleError(_0x806a3c,null));};exports[_0xd65c('0x41')]=function(_0x2c3dc7,_0x275d02){return db[_0xd65c('0x3a')][_0xd65c('0x41')](_0x2c3dc7[_0xd65c('0x42')],{})['then'](respondWithResult(_0x275d02,0xc9))[_0xd65c('0x3d')](handleError(_0x275d02,null));};exports[_0xd65c('0x1f')]=function(_0x316964,_0xf7632a){if(_0x316964[_0xd65c('0x42')]['id']){delete _0x316964['body']['id'];}return db[_0xd65c('0x3a')]['find']({'where':{'id':_0x316964[_0xd65c('0x43')]['id']}})[_0xd65c('0x20')](handleEntityNotFound(_0xf7632a,null))[_0xd65c('0x20')](saveUpdates(_0x316964[_0xd65c('0x42')],null))['then'](respondWithResult(_0xf7632a,null))[_0xd65c('0x3d')](handleError(_0xf7632a,null));};exports[_0xd65c('0x44')]=function(_0x13b1e3,_0xd8b601){return db[_0xd65c('0x3a')][_0xd65c('0x40')]({'where':{'id':_0x13b1e3[_0xd65c('0x43')]['id']}})[_0xd65c('0x20')](handleEntityNotFound(_0xd8b601,null))[_0xd65c('0x20')](removeEntity(_0xd8b601,null))[_0xd65c('0x3d')](handleError(_0xd8b601,null));};exports['describe']=function(_0x4af916,_0x3f8877){return db[_0xd65c('0x3a')]['describe']()[_0xd65c('0x20')](respondWithResult(_0x3f8877,null))[_0xd65c('0x3d')](handleError(_0x3f8877,null));};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js
index 50a02f8..c765765 100644
--- a/server/api/squareReportDetail/squareReportDetail.model.js
+++ b/server/api/squareReportDetail/squareReportDetail.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf121=['bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','../../config/logger','api'];(function(_0x21b888,_0x437537){var _0x2267ca=function(_0x308d4e){while(--_0x308d4e){_0x21b888['push'](_0x21b888['shift']());}};_0x2267ca(++_0x437537);}(_0xf121,0x134));var _0x1f12=function(_0x5817a2,_0x1057ba){_0x5817a2=_0x5817a2-0x0;var _0x45fbe5=_0xf121[_0x5817a2];return _0x45fbe5;};'use strict';var _=require(_0x1f12('0x0'));var util=require(_0x1f12('0x1'));var logger=require(_0x1f12('0x2'))(_0x1f12('0x3'));var moment=require('moment');var BPromise=require(_0x1f12('0x4'));var rp=require(_0x1f12('0x5'));var fs=require('fs');var path=require(_0x1f12('0x6'));var rimraf=require(_0x1f12('0x7'));var config=require(_0x1f12('0x8'));var attributes=require(_0x1f12('0x9'));module[_0x1f12('0xa')]=function(_0x4511e8,_0x16ef3f){return _0x4511e8[_0x1f12('0xb')](_0x1f12('0xc'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe4b=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x7d0a57,_0x47a45e){var _0x3bde7a=function(_0x38d0bc){while(--_0x38d0bc){_0x7d0a57['push'](_0x7d0a57['shift']());}};_0x3bde7a(++_0x47a45e);}(_0xfe4b,0x1bc));var _0xbfe4=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0xfe4b[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require(_0xbfe4('0x0'));var util=require(_0xbfe4('0x1'));var logger=require(_0xbfe4('0x2'))(_0xbfe4('0x3'));var moment=require(_0xbfe4('0x4'));var BPromise=require(_0xbfe4('0x5'));var rp=require(_0xbfe4('0x6'));var fs=require('fs');var path=require(_0xbfe4('0x7'));var rimraf=require(_0xbfe4('0x8'));var config=require(_0xbfe4('0x9'));var attributes=require(_0xbfe4('0xa'));module[_0xbfe4('0xb')]=function(_0xbc031c,_0x331c8c){return _0xbc031c[_0xbfe4('0xc')](_0xbfe4('0xd'),attributes,{'tableName':_0xbfe4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js
index 1ee3a96..53b5553 100644
--- a/server/api/squareReportDetail/squareReportDetail.rpc.js
+++ b/server/api/squareReportDetail/squareReportDetail.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf647=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x382d98,_0x2b92f3){var _0xc7ec28=function(_0x3a3661){while(--_0x3a3661){_0x382d98['push'](_0x382d98['shift']());}};_0xc7ec28(++_0x2b92f3);}(_0xf647,0x1e7));var _0x7f64=function(_0xfd2d14,_0x3baca2){_0xfd2d14=_0xfd2d14-0x0;var _0x3477cc=_0xf647[_0xfd2d14];return _0x3477cc;};'use strict';var _=require(_0x7f64('0x0'));var util=require(_0x7f64('0x1'));var moment=require(_0x7f64('0x2'));var BPromise=require(_0x7f64('0x3'));var rs=require(_0x7f64('0x4'));var fs=require('fs');var Redis=require(_0x7f64('0x5'));var db=require(_0x7f64('0x6'))['db'];var utils=require(_0x7f64('0x7'));var logger=require(_0x7f64('0x8'))(_0x7f64('0x9'));var config=require(_0x7f64('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7f64('0xb')][_0x7f64('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d85a0,_0x49c4a7,_0x2d9a02){return new BPromise(function(_0x2b8689,_0x17cf75){return client['request'](_0x5d85a0,_0x2d9a02)['then'](function(_0x42c611){logger[_0x7f64('0xd')](_0x7f64('0xe'),_0x49c4a7,_0x7f64('0xf'));logger[_0x7f64('0x10')](_0x7f64('0x11'),_0x49c4a7,_0x7f64('0xf'),JSON['stringify'](_0x42c611));if(_0x42c611[_0x7f64('0x12')]){if(_0x42c611[_0x7f64('0x12')][_0x7f64('0x13')]===0x1f4){logger[_0x7f64('0x12')](_0x7f64('0xe'),_0x49c4a7,_0x42c611[_0x7f64('0x12')][_0x7f64('0x14')]);return _0x17cf75(_0x42c611[_0x7f64('0x12')][_0x7f64('0x14')]);}logger[_0x7f64('0x12')](_0x7f64('0xe'),_0x49c4a7,_0x42c611[_0x7f64('0x12')][_0x7f64('0x14')]);return _0x2b8689(_0x42c611['error']['message']);}else{logger[_0x7f64('0xd')](_0x7f64('0xe'),_0x49c4a7,_0x7f64('0xf'));_0x2b8689(_0x42c611['result'][_0x7f64('0x14')]);}})['catch'](function(_0xebc95f){logger[_0x7f64('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x49c4a7,_0xebc95f);_0x17cf75(_0xebc95f);});});}exports[_0x7f64('0x15')]=function(_0x47f814){var _0x3270d1=this;return new Promise(function(_0x11b576,_0x428f40){return db[_0x7f64('0x16')][_0x7f64('0x17')](_0x47f814[_0x7f64('0x18')],{'raw':_0x47f814[_0x7f64('0x19')]?_0x47f814[_0x7f64('0x19')][_0x7f64('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1e706f){logger[_0x7f64('0xd')](_0x7f64('0x15'),_0x47f814);logger[_0x7f64('0x10')]('CreateSquareDetailsReport',_0x47f814,JSON[_0x7f64('0x1b')](_0x1e706f));_0x11b576(_0x1e706f);})[_0x7f64('0x1c')](function(_0x2c1fcd){logger[_0x7f64('0x12')](_0x7f64('0x15'),_0x2c1fcd[_0x7f64('0x14')],_0x47f814);_0x428f40(_0x3270d1['error'](0x1f4,_0x2c1fcd['message']));});});};
\ No newline at end of file
+var _0xe821=['raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options'];(function(_0x110e11,_0x2386fb){var _0x16d509=function(_0x58d8e7){while(--_0x58d8e7){_0x110e11['push'](_0x110e11['shift']());}};_0x16d509(++_0x2386fb);}(_0xe821,0x1ee));var _0x1e82=function(_0x24ff8d,_0x3c0f94){_0x24ff8d=_0x24ff8d-0x0;var _0x549cb5=_0xe821[_0x24ff8d];return _0x549cb5;};'use strict';var _=require(_0x1e82('0x0'));var util=require(_0x1e82('0x1'));var moment=require('moment');var BPromise=require(_0x1e82('0x2'));var rs=require(_0x1e82('0x3'));var fs=require('fs');var Redis=require(_0x1e82('0x4'));var db=require(_0x1e82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e82('0x6'))('rpc');var config=require(_0x1e82('0x7'));var jayson=require(_0x1e82('0x8'));var client=jayson[_0x1e82('0x9')][_0x1e82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d632d,_0x39cd1b,_0x255445){return new BPromise(function(_0x3f019e,_0x1d2a9d){return client[_0x1e82('0xb')](_0x4d632d,_0x255445)[_0x1e82('0xc')](function(_0x381552){logger[_0x1e82('0xd')](_0x1e82('0xe'),_0x39cd1b,'request\x20sent');logger[_0x1e82('0xf')](_0x1e82('0x10'),_0x39cd1b,_0x1e82('0x11'),JSON[_0x1e82('0x12')](_0x381552));if(_0x381552[_0x1e82('0x13')]){if(_0x381552[_0x1e82('0x13')][_0x1e82('0x14')]===0x1f4){logger[_0x1e82('0x13')](_0x1e82('0xe'),_0x39cd1b,_0x381552['error'][_0x1e82('0x15')]);return _0x1d2a9d(_0x381552[_0x1e82('0x13')][_0x1e82('0x15')]);}logger[_0x1e82('0x13')](_0x1e82('0xe'),_0x39cd1b,_0x381552[_0x1e82('0x13')][_0x1e82('0x15')]);return _0x3f019e(_0x381552['error']['message']);}else{logger[_0x1e82('0xd')](_0x1e82('0xe'),_0x39cd1b,_0x1e82('0x11'));_0x3f019e(_0x381552[_0x1e82('0x16')]['message']);}})[_0x1e82('0x17')](function(_0x16a370){logger[_0x1e82('0x13')](_0x1e82('0xe'),_0x39cd1b,_0x16a370);_0x1d2a9d(_0x16a370);});});}exports[_0x1e82('0x18')]=function(_0x2cee15){var _0x1de820=this;return new Promise(function(_0x5c6f05,_0x2fe45c){return db[_0x1e82('0x19')][_0x1e82('0x1a')](_0x2cee15['body'],{'raw':_0x2cee15[_0x1e82('0x1b')]?_0x2cee15[_0x1e82('0x1b')][_0x1e82('0x1c')]===undefined?!![]:![]:!![]})[_0x1e82('0xc')](function(_0x456aa4){logger[_0x1e82('0xd')](_0x1e82('0x18'),_0x2cee15);logger[_0x1e82('0xf')](_0x1e82('0x18'),_0x2cee15,JSON['stringify'](_0x456aa4));_0x5c6f05(_0x456aa4);})['catch'](function(_0x570749){logger[_0x1e82('0x13')]('CreateSquareDetailsReport',_0x570749[_0x1e82('0x15')],_0x2cee15);_0x2fe45c(_0x1de820[_0x1e82('0x13')](0x1f4,_0x570749[_0x1e82('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/system/index.js b/server/api/system/index.js
index f5004d7..a3b42de 100644
--- a/server/api/system/index.js
+++ b/server/api/system/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d65=['../../components/auth/service','./system.controller','get','index','killProcess','exports','express','Router'];(function(_0x8a6f3f,_0x5ed954){var _0x5804ac=function(_0x465d75){while(--_0x465d75){_0x8a6f3f['push'](_0x8a6f3f['shift']());}};_0x5804ac(++_0x5ed954);}(_0x6d65,0x1de));var _0x56d6=function(_0x5f17ae,_0x58d378){_0x5f17ae=_0x5f17ae-0x0;var _0x5114ab=_0x6d65[_0x5f17ae];return _0x5114ab;};'use strict';var express=require(_0x56d6('0x0'));var router=express[_0x56d6('0x1')]();var auth=require(_0x56d6('0x2'));var controller=require(_0x56d6('0x3'));router[_0x56d6('0x4')]('/',auth['isAuthenticated'](),controller[_0x56d6('0x5')]);router[_0x56d6('0x4')]('/process/:pid/kill',auth['isAuthenticated'](),controller[_0x56d6('0x6')]);module[_0x56d6('0x7')]=router;
\ No newline at end of file
+var _0x4f7c=['killProcess','exports','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x4f7c,0x185));var _0xc4f7=function(_0x5b16b8,_0x22acf2){_0x5b16b8=_0x5b16b8-0x0;var _0x3dabcb=_0x4f7c[_0x5b16b8];return _0x3dabcb;};'use strict';var express=require('express');var router=express[_0xc4f7('0x0')]();var auth=require(_0xc4f7('0x1'));var controller=require(_0xc4f7('0x2'));router[_0xc4f7('0x3')]('/',auth[_0xc4f7('0x4')](),controller[_0xc4f7('0x5')]);router[_0xc4f7('0x3')](_0xc4f7('0x6'),auth[_0xc4f7('0x4')](),controller[_0xc4f7('0x7')]);module[_0xc4f7('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js
index 019a888..f64c492 100644
--- a/server/api/system/system.controller.js
+++ b/server/api/system/system.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x97db=['kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','exec','../../config/logger','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','then','json','catch','components/import/cm','format','params','pid','split','length','indexOf'];(function(_0x8b2208,_0x268679){var _0x2d1b39=function(_0x2cc02a){while(--_0x2cc02a){_0x8b2208['push'](_0x8b2208['shift']());}};_0x2d1b39(++_0x268679);}(_0x97db,0x18a));var _0xb97d=function(_0x31e89b,_0x17514f){_0x31e89b=_0x31e89b-0x0;var _0x1d2beb=_0x97db[_0x31e89b];return _0x1d2beb;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0xb97d('0x0')];var logger=require(_0xb97d('0x1'))('api');var util=require(_0xb97d('0x2'));var BPromise=require(_0xb97d('0x3'));var _=require('lodash');function handleError(_0x51f9e4,_0x9e0944,_0x4e575c){_0x9e0944=_0x9e0944||0x1f4;return function(_0x1a4360){logger[_0xb97d('0x4')](_0xb97d('0x5'),_0x4e575c,_0x9e0944,util['inspect'](_0x1a4360,{'showHidden':![],'depth':null}));delete _0x1a4360[_0xb97d('0x6')];_0x51f9e4[_0xb97d('0x7')](_0x9e0944)[_0xb97d('0x8')](_0x1a4360);};}exports[_0xb97d('0x9')]=function(_0x361f6a,_0x1ebc2c){return info['getAllData']()[_0xb97d('0xa')](function(_0x3deb3c){return _0x1ebc2c[_0xb97d('0x7')](0xc8)[_0xb97d('0xb')](_0x3deb3c);})[_0xb97d('0xc')](function(_0x42349f){return _0x1ebc2c[_0xb97d('0x7')](0x1f4)['json'](_0x42349f);});};exports['killProcess']=function(_0x1764f1,_0x593db8){var _0x22976f=[_0xb97d('0xd')];return new BPromise(function(_0x5c44f6,_0x2fbf97){return exec(util[_0xb97d('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1764f1[_0xb97d('0xf')][_0xb97d('0x10')]),function(_0x30ce7e,_0x230450,_0x464a43){if(_0x30ce7e){return _0x2fbf97(_0x30ce7e);}return _0x5c44f6(_0x230450);});})['then'](function(_0x32f216){var _0xa361fd=![];var _0x5563db=_0x32f216[_0xb97d('0x11')](/\n/);for(var _0x28a639=0x0,_0x5aa31b=_0x22976f[_0xb97d('0x12')];_0x28a639<_0x5aa31b,_0xa361fd===![];_0x28a639+=0x1){if(_0x32f216[_0xb97d('0x13')](_0x22976f[_0x28a639])>=0x0){_0xa361fd=!![];}}if(!_0xa361fd){throw new Error(util[_0xb97d('0xe')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1764f1[_0xb97d('0xf')]['pid']));}process[_0xb97d('0x14')](_0x1764f1[_0xb97d('0xf')][_0xb97d('0x10')],'SIGINT');return _0x593db8[_0xb97d('0x7')](0xc8)[_0xb97d('0xb')]({'message':util['format'](_0xb97d('0x15'),_0x1764f1['params'][_0xb97d('0x10')])});})[_0xb97d('0xc')](handleError(_0x593db8,null,_0xb97d('0x16')));};
\ No newline at end of file
+var _0x4b69=['error','inspect','send','index','getAllData','then','status','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','bluebird','lodash'];(function(_0x760c95,_0x55da20){var _0x299387=function(_0x53e94c){while(--_0x53e94c){_0x760c95['push'](_0x760c95['shift']());}};_0x299387(++_0x55da20);}(_0x4b69,0xb8));var _0x94b6=function(_0x44d720,_0x5e82de){_0x44d720=_0x44d720-0x0;var _0x46d103=_0x4b69[_0x44d720];return _0x46d103;};'use strict';var info=require(_0x94b6('0x0'));var exec=require('child_process')[_0x94b6('0x1')];var logger=require(_0x94b6('0x2'))('api');var util=require('util');var BPromise=require(_0x94b6('0x3'));var _=require(_0x94b6('0x4'));function handleError(_0x227bdc,_0x1cf541,_0x284740){_0x1cf541=_0x1cf541||0x1f4;return function(_0xd5ead){logger[_0x94b6('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x284740,_0x1cf541,util[_0x94b6('0x6')](_0xd5ead,{'showHidden':![],'depth':null}));delete _0xd5ead['name'];_0x227bdc['status'](_0x1cf541)[_0x94b6('0x7')](_0xd5ead);};}exports[_0x94b6('0x8')]=function(_0x39c655,_0x4104bf){return info[_0x94b6('0x9')]()[_0x94b6('0xa')](function(_0x3191d5){return _0x4104bf[_0x94b6('0xb')](0xc8)[_0x94b6('0xc')](_0x3191d5);})[_0x94b6('0xd')](function(_0x37ba79){return _0x4104bf['status'](0x1f4)[_0x94b6('0xc')](_0x37ba79);});};exports[_0x94b6('0xe')]=function(_0x34b8c1,_0x5cf3ee){var _0x29ce3f=[_0x94b6('0xf')];return new BPromise(function(_0x4aaec7,_0x2b5314){return exec(util['format'](_0x94b6('0x10'),_0x34b8c1['params'][_0x94b6('0x11')]),function(_0x181b20,_0x37ee0d,_0x18104c){if(_0x181b20){return _0x2b5314(_0x181b20);}return _0x4aaec7(_0x37ee0d);});})['then'](function(_0x42926c){var _0x30b9c2=![];var _0x2bb688=_0x42926c[_0x94b6('0x12')](/\n/);for(var _0x457415=0x0,_0xb8390=_0x29ce3f[_0x94b6('0x13')];_0x457415<_0xb8390,_0x30b9c2===![];_0x457415+=0x1){if(_0x42926c[_0x94b6('0x14')](_0x29ce3f[_0x457415])>=0x0){_0x30b9c2=!![];}}if(!_0x30b9c2){throw new Error(util[_0x94b6('0x15')](_0x94b6('0x16'),_0x34b8c1[_0x94b6('0x17')][_0x94b6('0x11')]));}process[_0x94b6('0x18')](_0x34b8c1[_0x94b6('0x17')][_0x94b6('0x11')],_0x94b6('0x19'));return _0x5cf3ee[_0x94b6('0xb')](0xc8)[_0x94b6('0xc')]({'message':util[_0x94b6('0x15')](_0x94b6('0x1a'),_0x34b8c1[_0x94b6('0x17')][_0x94b6('0x11')])});})[_0x94b6('0xd')](handleError(_0x5cf3ee,null,_0x94b6('0xe')));};
\ No newline at end of file
diff --git a/server/api/tag/index.js b/server/api/tag/index.js
index b3363a6..d6698fc 100644
--- a/server/api/tag/index.js
+++ b/server/api/tag/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1339=['./tag.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33c808,_0x1d206b){var _0xdbd11c=function(_0x23f18c){while(--_0x23f18c){_0x33c808['push'](_0x33c808['shift']());}};_0xdbd11c(++_0x1d206b);}(_0x1339,0x1ed));var _0x9133=function(_0x3d1d7a,_0x49004f){_0x3d1d7a=_0x3d1d7a-0x0;var _0x15250b=_0x1339[_0x3d1d7a];return _0x15250b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var auth=require(_0x9133('0x4'));var interaction=require(_0x9133('0x5'));var config=require(_0x9133('0x6'));var controller=require(_0x9133('0x7'));router['get']('/',auth[_0x9133('0x8')](),controller[_0x9133('0x9')]);router[_0x9133('0xa')]('/:id',auth[_0x9133('0x8')](),controller[_0x9133('0xb')]);router[_0x9133('0xc')]('/',auth[_0x9133('0x8')](),controller[_0x9133('0xd')]);router[_0x9133('0xe')](_0x9133('0xf'),auth[_0x9133('0x8')](),controller[_0x9133('0x10')]);router[_0x9133('0x11')]('/:id',auth[_0x9133('0x8')](),controller[_0x9133('0x12')]);module[_0x9133('0x13')]=router;
\ No newline at end of file
+var _0x5c12=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x28958c,_0x4cf771){var _0x31c1a7=function(_0x2a542c){while(--_0x2a542c){_0x28958c['push'](_0x28958c['shift']());}};_0x31c1a7(++_0x4cf771);}(_0x5c12,0x188));var _0x25c1=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0x5c12[_0x41382c];return _0x4da35b;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var auth=require(_0x25c1('0x4'));var interaction=require(_0x25c1('0x5'));var config=require(_0x25c1('0x6'));var controller=require(_0x25c1('0x7'));router[_0x25c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x25c1('0x9')]);router[_0x25c1('0x8')](_0x25c1('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x25c1('0xb')]('/',auth[_0x25c1('0xc')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xe')](_0x25c1('0xa'),auth['isAuthenticated'](),controller[_0x25c1('0xf')]);router[_0x25c1('0x10')](_0x25c1('0xa'),auth[_0x25c1('0xc')](),controller[_0x25c1('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js
index 84bcfea..3888f4c 100644
--- a/server/api/tag/tag.attributes.js
+++ b/server/api/tag/tag.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['#0091EA','STRING','name'];(function(_0x3a5bdb,_0x2816ca){var _0x574e0d=function(_0x526fe2){while(--_0x526fe2){_0x3a5bdb['push'](_0x3a5bdb['shift']());}};_0x574e0d(++_0x2816ca);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'unique':_0x3071('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3071('0x0')],'defaultValue':_0x3071('0x2')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
+var _0xd8b0=['STRING','sequelize','exports','#0091EA'];(function(_0x331639,_0x3ceeaa){var _0x5420ea=function(_0x175c36){while(--_0x175c36){_0x331639['push'](_0x331639['shift']());}};_0x5420ea(++_0x3ceeaa);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0x2')},'description':{'type':Sequelize[_0x0d8b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js
index 0955b28..b0e1baa 100644
--- a/server/api/tag/tag.controller.js
+++ b/server/api/tag/tag.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd3cc=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','Tag','rawAttributes','fieldName','key','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','type','filter','count','includeAll','include','catch','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','crypto','jsforce'];(function(_0xf145ca,_0x3401ee){var _0x4dffc2=function(_0x587156){while(--_0x587156){_0xf145ca['push'](_0xf145ca['shift']());}};_0x4dffc2(++_0x3401ee);}(_0xd3cc,0x8d));var _0xcd3c=function(_0x9d05ad,_0xb0ab3c){_0x9d05ad=_0x9d05ad-0x0;var _0xff824f=_0xd3cc[_0x9d05ad];return _0xff824f;};'use strict';var pdf=require(_0xcd3c('0x0'));var emlformat=require(_0xcd3c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcd3c('0x2'));var jsonpatch=require(_0xcd3c('0x3'));var rp=require(_0xcd3c('0x4'));var moment=require(_0xcd3c('0x5'));var BPromise=require(_0xcd3c('0x6'));var Mustache=require('mustache');var util=require(_0xcd3c('0x7'));var path=require('path');var sox=require(_0xcd3c('0x8'));var csv=require(_0xcd3c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcd3c('0xa'));var squel=require('squel');var crypto=require(_0xcd3c('0xb'));var jsforce=require(_0xcd3c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcd3c('0x9'));var querystring=require(_0xcd3c('0xd'));var Papa=require('papaparse');var Redis=require(_0xcd3c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcd3c('0xf'));var as=require(_0xcd3c('0x10'));var hardwareService=require(_0xcd3c('0x11'));var logger=require(_0xcd3c('0x12'))(_0xcd3c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcd3c('0x14'))['db'];function respondWithStatusCode(_0x1f28b1,_0x29be34){_0x29be34=_0x29be34||0xcc;return function(_0x51e8c8){if(_0x51e8c8){return _0x1f28b1[_0xcd3c('0x15')](_0x29be34);}return _0x1f28b1[_0xcd3c('0x16')](_0x29be34)[_0xcd3c('0x17')]();};}function respondWithResult(_0x23c984,_0x2e3414){_0x2e3414=_0x2e3414||0xc8;return function(_0x3ba435){if(_0x3ba435){return _0x23c984[_0xcd3c('0x16')](_0x2e3414)[_0xcd3c('0x18')](_0x3ba435);}};}function respondWithFilteredResult(_0x4b1343,_0x2deb7a){return function(_0x894df5){if(_0x894df5){var _0x3ae8fc=_0x894df5['count'],_0x2e200b=_0x2deb7a[_0xcd3c('0x19')],_0x241182=_0x2deb7a['offset']+_0x2deb7a[_0xcd3c('0x1a')],_0x4b2988;if(_0x241182>=_0x3ae8fc){_0x241182=_0x3ae8fc;_0x4b2988=0xc8;}else{_0x4b2988=0xce;}_0x4b1343[_0xcd3c('0x16')](_0x4b2988);return _0x4b1343[_0xcd3c('0x1b')](_0xcd3c('0x1c'),_0x2e200b+'-'+_0x241182+'/'+_0x3ae8fc)[_0xcd3c('0x18')](_0x894df5);}return null;};}function patchUpdates(_0x3d67fa){return function(_0x2cbe9f){try{jsonpatch['apply'](_0x2cbe9f,_0x3d67fa,!![]);}catch(_0xafc52f){return BPromise[_0xcd3c('0x1d')](_0xafc52f);}return _0x2cbe9f[_0xcd3c('0x1e')]();};}function saveUpdates(_0x206aca,_0x508439){return function(_0x5c8bd5){if(_0x5c8bd5){return _0x5c8bd5['update'](_0x206aca)['then'](function(_0x4687a0){return _0x4687a0;});}return null;};}function removeEntity(_0x24a812,_0x2c0a73){return function(_0x159ab5){if(_0x159ab5){return _0x159ab5['destroy']()[_0xcd3c('0x1f')](function(){var _0x68a86c=_0x159ab5[_0xcd3c('0x20')]({'plain':!![]});var _0x28260a='Tags';return db[_0xcd3c('0x21')][_0xcd3c('0x22')]({'where':{'type':_0x28260a,'resourceId':_0x68a86c['id']}})['then'](function(){return _0x159ab5;});})[_0xcd3c('0x1f')](function(){_0x24a812[_0xcd3c('0x16')](0xcc)[_0xcd3c('0x17')]();});}};}function handleEntityNotFound(_0x435f9e,_0x609999){return function(_0x51a506){if(!_0x51a506){_0x435f9e[_0xcd3c('0x15')](0x194);}return _0x51a506;};}function handleError(_0x3bf2f7,_0x439645){_0x439645=_0x439645||0x1f4;return function(_0x520d64){logger[_0xcd3c('0x23')](_0x520d64[_0xcd3c('0x24')]);if(_0x520d64[_0xcd3c('0x25')]){delete _0x520d64[_0xcd3c('0x25')];}_0x3bf2f7['status'](_0x439645)[_0xcd3c('0x26')](_0x520d64);};}exports[_0xcd3c('0x27')]=function(_0x175a2b,_0x540211){var _0x2d6348={},_0xe45fb2={},_0x4db3c2={'count':0x0,'rows':[]};var _0x3d78b5=_['map'](db[_0xcd3c('0x28')][_0xcd3c('0x29')],function(_0xa0678d){return{'name':_0xa0678d[_0xcd3c('0x2a')],'type':_0xa0678d['type'][_0xcd3c('0x2b')]};});_0xe45fb2['model']=_[_0xcd3c('0x2c')](_0x3d78b5,_0xcd3c('0x25'));_0xe45fb2[_0xcd3c('0x2d')]=_[_0xcd3c('0x2e')](_0x175a2b[_0xcd3c('0x2d')]);_0xe45fb2['filters']=_[_0xcd3c('0x2f')](_0xe45fb2['model'],_0xe45fb2['query']);_0x2d6348[_0xcd3c('0x30')]=_[_0xcd3c('0x2f')](_0xe45fb2[_0xcd3c('0x31')],qs[_0xcd3c('0x32')](_0x175a2b['query'][_0xcd3c('0x32')]));_0x2d6348[_0xcd3c('0x30')]=_0x2d6348[_0xcd3c('0x30')][_0xcd3c('0x33')]?_0x2d6348[_0xcd3c('0x30')]:_0xe45fb2['model'];if(!_0x175a2b[_0xcd3c('0x2d')][_0xcd3c('0x34')]('nolimit')){_0x2d6348[_0xcd3c('0x1a')]=qs['limit'](_0x175a2b[_0xcd3c('0x2d')][_0xcd3c('0x1a')]);_0x2d6348[_0xcd3c('0x19')]=qs[_0xcd3c('0x19')](_0x175a2b[_0xcd3c('0x2d')][_0xcd3c('0x19')]);}_0x2d6348[_0xcd3c('0x35')]=qs[_0xcd3c('0x36')](_0x175a2b[_0xcd3c('0x2d')][_0xcd3c('0x36')]);_0x2d6348['where']=qs[_0xcd3c('0x37')](_[_0xcd3c('0x38')](_0x175a2b['query'],_0xe45fb2[_0xcd3c('0x37')]),_0x3d78b5);if(_0x175a2b[_0xcd3c('0x2d')]['filter']){_0x2d6348[_0xcd3c('0x39')]=_[_0xcd3c('0x3a')](_0x2d6348['where'],{'$or':_[_0xcd3c('0x2c')](_0x3d78b5,function(_0x52d43b){if(_0x52d43b[_0xcd3c('0x3b')]!=='VIRTUAL'){var _0x18f557={};_0x18f557[_0x52d43b[_0xcd3c('0x25')]]={'$like':'%'+_0x175a2b[_0xcd3c('0x2d')][_0xcd3c('0x3c')]+'%'};return _0x18f557;}})});}_0x2d6348=_['merge']({},_0x2d6348,_0x175a2b['options']);var _0x36ac97={'where':_0x2d6348['where']};return db[_0xcd3c('0x28')][_0xcd3c('0x3d')](_0x36ac97)['then'](function(_0x4b1e10){_0x4db3c2[_0xcd3c('0x3d')]=_0x4b1e10;if(_0x175a2b[_0xcd3c('0x2d')][_0xcd3c('0x3e')]){_0x2d6348[_0xcd3c('0x3f')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x2d6348);})['then'](function(_0x100afe){_0x4db3c2['rows']=_0x100afe;return _0x4db3c2;})[_0xcd3c('0x1f')](respondWithFilteredResult(_0x540211,_0x2d6348))[_0xcd3c('0x40')](handleError(_0x540211,null));};exports[_0xcd3c('0x41')]=function(_0x413228,_0x1a953a){var _0x131947={'raw':!![],'where':{'id':_0x413228['params']['id']}},_0x4e80b8={};_0x4e80b8[_0xcd3c('0x31')]=_[_0xcd3c('0x2e')](db['Tag'][_0xcd3c('0x29')]);_0x4e80b8['query']=_[_0xcd3c('0x2e')](_0x413228[_0xcd3c('0x2d')]);_0x4e80b8[_0xcd3c('0x37')]=_[_0xcd3c('0x2f')](_0x4e80b8[_0xcd3c('0x31')],_0x4e80b8[_0xcd3c('0x2d')]);_0x131947[_0xcd3c('0x30')]=_['intersection'](_0x4e80b8[_0xcd3c('0x31')],qs[_0xcd3c('0x32')](_0x413228[_0xcd3c('0x2d')]['fields']));_0x131947['attributes']=_0x131947[_0xcd3c('0x30')]['length']?_0x131947[_0xcd3c('0x30')]:_0x4e80b8[_0xcd3c('0x31')];if(_0x413228[_0xcd3c('0x2d')][_0xcd3c('0x3e')]){_0x131947[_0xcd3c('0x3f')]=[{'all':!![]}];}_0x131947=_['merge']({},_0x131947,_0x413228['options']);return db['Tag'][_0xcd3c('0x42')](_0x131947)['then'](handleEntityNotFound(_0x1a953a,null))['then'](respondWithResult(_0x1a953a,null))['catch'](handleError(_0x1a953a,null));};exports[_0xcd3c('0x43')]=function(_0x151f59,_0x13953c){return db[_0xcd3c('0x28')][_0xcd3c('0x43')](_0x151f59['body'],{})[_0xcd3c('0x1f')](function(_0x32790d){var _0x4ec6e5=_0x151f59['user'][_0xcd3c('0x20')]({'plain':!![]});if(!_0x4ec6e5)throw new Error(_0xcd3c('0x44'));if(_0x4ec6e5[_0xcd3c('0x45')]==='user'){var _0x4781a2=_0x32790d[_0xcd3c('0x20')]({'plain':!![]});var _0x490a64='Tags';return db[_0xcd3c('0x46')][_0xcd3c('0x42')]({'where':{'name':_0x490a64,'userProfileId':_0x4ec6e5[_0xcd3c('0x47')]},'raw':!![]})[_0xcd3c('0x1f')](function(_0x4b0274){if(_0x4b0274&&_0x4b0274[_0xcd3c('0x48')]===0x0){return db['UserProfileResource'][_0xcd3c('0x43')]({'name':_0x4781a2[_0xcd3c('0x25')],'resourceId':_0x4781a2['id'],'type':_0x4b0274[_0xcd3c('0x25')],'sectionId':_0x4b0274['id']},{})[_0xcd3c('0x1f')](function(){return _0x32790d;});}else{return _0x32790d;}})[_0xcd3c('0x40')](function(_0x36ff28){logger[_0xcd3c('0x23')](_0xcd3c('0x49'),_0x36ff28);throw _0x36ff28;});}return _0x32790d;})[_0xcd3c('0x1f')](respondWithResult(_0x13953c,0xc9))[_0xcd3c('0x40')](handleError(_0x13953c,null));};exports[_0xcd3c('0x4a')]=function(_0x4bd7d1,_0x4a738d){if(_0x4bd7d1['body']['id']){delete _0x4bd7d1[_0xcd3c('0x4b')]['id'];}return db['Tag'][_0xcd3c('0x42')]({'where':{'id':_0x4bd7d1[_0xcd3c('0x4c')]['id']}})[_0xcd3c('0x1f')](handleEntityNotFound(_0x4a738d,null))[_0xcd3c('0x1f')](saveUpdates(_0x4bd7d1[_0xcd3c('0x4b')],null))[_0xcd3c('0x1f')](respondWithResult(_0x4a738d,null))[_0xcd3c('0x40')](handleError(_0x4a738d,null));};exports[_0xcd3c('0x22')]=function(_0xac393,_0x52566c){return db['Tag'][_0xcd3c('0x42')]({'where':{'id':_0xac393['params']['id']}})[_0xcd3c('0x1f')](handleEntityNotFound(_0x52566c,null))[_0xcd3c('0x1f')](removeEntity(_0x52566c,null))['catch'](handleError(_0x52566c,null));};
\ No newline at end of file
+var _0x3bec=['nolimit','order','sort','where','filters','pick','filter','VIRTUAL','include','findAll','rows','catch','show','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Tags','error','stack','name','send','map','Tag','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x4faa4c,_0x19d32c){var _0x35e6fb=function(_0x59e190){while(--_0x59e190){_0x4faa4c['push'](_0x4faa4c['shift']());}};_0x35e6fb(++_0x19d32c);}(_0x3bec,0x113));var _0xc3be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3bec[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xc3be('0x0'));var emlformat=require(_0xc3be('0x1'));var rimraf=require(_0xc3be('0x2'));var zipdir=require(_0xc3be('0x3'));var jsonpatch=require(_0xc3be('0x4'));var rp=require(_0xc3be('0x5'));var moment=require(_0xc3be('0x6'));var BPromise=require(_0xc3be('0x7'));var Mustache=require(_0xc3be('0x8'));var util=require(_0xc3be('0x9'));var path=require(_0xc3be('0xa'));var sox=require(_0xc3be('0xb'));var csv=require('to-csv');var ejs=require(_0xc3be('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc3be('0xd'));var crypto=require(_0xc3be('0xe'));var jsforce=require(_0xc3be('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc3be('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc3be('0x11'));var authService=require(_0xc3be('0x12'));var qs=require(_0xc3be('0x13'));var as=require(_0xc3be('0x14'));var hardwareService=require(_0xc3be('0x15'));var logger=require('../../config/logger')(_0xc3be('0x16'));var utils=require(_0xc3be('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bfde2,_0x41c56b){_0x41c56b=_0x41c56b||0xcc;return function(_0x489157){if(_0x489157){return _0x4bfde2[_0xc3be('0x18')](_0x41c56b);}return _0x4bfde2['status'](_0x41c56b)[_0xc3be('0x19')]();};}function respondWithResult(_0x59b1c2,_0x22ed55){_0x22ed55=_0x22ed55||0xc8;return function(_0x5af93c){if(_0x5af93c){return _0x59b1c2[_0xc3be('0x1a')](_0x22ed55)[_0xc3be('0x1b')](_0x5af93c);}};}function respondWithFilteredResult(_0x12dff2,_0xeb1d73){return function(_0x2bd4ce){if(_0x2bd4ce){var _0x2542cf=_0x2bd4ce[_0xc3be('0x1c')],_0x241b93=_0xeb1d73[_0xc3be('0x1d')],_0x4c588a=_0xeb1d73[_0xc3be('0x1d')]+_0xeb1d73[_0xc3be('0x1e')],_0x568ff4;if(_0x4c588a>=_0x2542cf){_0x4c588a=_0x2542cf;_0x568ff4=0xc8;}else{_0x568ff4=0xce;}_0x12dff2[_0xc3be('0x1a')](_0x568ff4);return _0x12dff2[_0xc3be('0x1f')](_0xc3be('0x20'),_0x241b93+'-'+_0x4c588a+'/'+_0x2542cf)[_0xc3be('0x1b')](_0x2bd4ce);}return null;};}function patchUpdates(_0x50725f){return function(_0x715b2){try{jsonpatch[_0xc3be('0x21')](_0x715b2,_0x50725f,!![]);}catch(_0x358ad6){return BPromise['reject'](_0x358ad6);}return _0x715b2[_0xc3be('0x22')]();};}function saveUpdates(_0x2ef18f,_0x26106e){return function(_0x496cdd){if(_0x496cdd){return _0x496cdd[_0xc3be('0x23')](_0x2ef18f)[_0xc3be('0x24')](function(_0x415ef2){return _0x415ef2;});}return null;};}function removeEntity(_0x25386f,_0x155020){return function(_0xff4cfc){if(_0xff4cfc){return _0xff4cfc[_0xc3be('0x25')]()[_0xc3be('0x24')](function(){var _0x5f2d29=_0xff4cfc[_0xc3be('0x26')]({'plain':!![]});var _0x3bd16f=_0xc3be('0x27');return db['UserProfileResource'][_0xc3be('0x25')]({'where':{'type':_0x3bd16f,'resourceId':_0x5f2d29['id']}})[_0xc3be('0x24')](function(){return _0xff4cfc;});})[_0xc3be('0x24')](function(){_0x25386f[_0xc3be('0x1a')](0xcc)[_0xc3be('0x19')]();});}};}function handleEntityNotFound(_0x34bbf4,_0x25d998){return function(_0xc5f3b3){if(!_0xc5f3b3){_0x34bbf4[_0xc3be('0x18')](0x194);}return _0xc5f3b3;};}function handleError(_0x46ae7b,_0x6c9e23){_0x6c9e23=_0x6c9e23||0x1f4;return function(_0x50a092){logger[_0xc3be('0x28')](_0x50a092[_0xc3be('0x29')]);if(_0x50a092[_0xc3be('0x2a')]){delete _0x50a092[_0xc3be('0x2a')];}_0x46ae7b[_0xc3be('0x1a')](_0x6c9e23)[_0xc3be('0x2b')](_0x50a092);};}exports['index']=function(_0x41b856,_0x16bb7d){var _0x58cec6={},_0x5264bb={},_0x44f54d={'count':0x0,'rows':[]};var _0x5225ef=_[_0xc3be('0x2c')](db[_0xc3be('0x2d')][_0xc3be('0x2e')],function(_0x102ec4){return{'name':_0x102ec4[_0xc3be('0x2f')],'type':_0x102ec4[_0xc3be('0x30')]['key']};});_0x5264bb[_0xc3be('0x31')]=_[_0xc3be('0x2c')](_0x5225ef,_0xc3be('0x2a'));_0x5264bb[_0xc3be('0x32')]=_[_0xc3be('0x33')](_0x41b856[_0xc3be('0x32')]);_0x5264bb['filters']=_['intersection'](_0x5264bb[_0xc3be('0x31')],_0x5264bb[_0xc3be('0x32')]);_0x58cec6['attributes']=_[_0xc3be('0x34')](_0x5264bb[_0xc3be('0x31')],qs[_0xc3be('0x35')](_0x41b856[_0xc3be('0x32')][_0xc3be('0x35')]));_0x58cec6[_0xc3be('0x36')]=_0x58cec6[_0xc3be('0x36')][_0xc3be('0x37')]?_0x58cec6['attributes']:_0x5264bb[_0xc3be('0x31')];if(!_0x41b856[_0xc3be('0x32')][_0xc3be('0x38')](_0xc3be('0x39'))){_0x58cec6[_0xc3be('0x1e')]=qs[_0xc3be('0x1e')](_0x41b856[_0xc3be('0x32')][_0xc3be('0x1e')]);_0x58cec6[_0xc3be('0x1d')]=qs[_0xc3be('0x1d')](_0x41b856[_0xc3be('0x32')][_0xc3be('0x1d')]);}_0x58cec6[_0xc3be('0x3a')]=qs[_0xc3be('0x3b')](_0x41b856[_0xc3be('0x32')][_0xc3be('0x3b')]);_0x58cec6[_0xc3be('0x3c')]=qs[_0xc3be('0x3d')](_[_0xc3be('0x3e')](_0x41b856['query'],_0x5264bb[_0xc3be('0x3d')]),_0x5225ef);if(_0x41b856['query'][_0xc3be('0x3f')]){_0x58cec6[_0xc3be('0x3c')]=_['merge'](_0x58cec6[_0xc3be('0x3c')],{'$or':_['map'](_0x5225ef,function(_0x2230fd){if(_0x2230fd['type']!==_0xc3be('0x40')){var _0x2d0daa={};_0x2d0daa[_0x2230fd[_0xc3be('0x2a')]]={'$like':'%'+_0x41b856['query'][_0xc3be('0x3f')]+'%'};return _0x2d0daa;}})});}_0x58cec6=_['merge']({},_0x58cec6,_0x41b856['options']);var _0x417ddf={'where':_0x58cec6[_0xc3be('0x3c')]};return db[_0xc3be('0x2d')][_0xc3be('0x1c')](_0x417ddf)[_0xc3be('0x24')](function(_0x4041ac){_0x44f54d['count']=_0x4041ac;if(_0x41b856[_0xc3be('0x32')]['includeAll']){_0x58cec6[_0xc3be('0x41')]=[{'all':!![]}];}return db[_0xc3be('0x2d')][_0xc3be('0x42')](_0x58cec6);})['then'](function(_0x4e2109){_0x44f54d[_0xc3be('0x43')]=_0x4e2109;return _0x44f54d;})[_0xc3be('0x24')](respondWithFilteredResult(_0x16bb7d,_0x58cec6))[_0xc3be('0x44')](handleError(_0x16bb7d,null));};exports[_0xc3be('0x45')]=function(_0x5c8126,_0x32f513){var _0x3662d8={'raw':!![],'where':{'id':_0x5c8126['params']['id']}},_0x2924c6={};_0x2924c6[_0xc3be('0x31')]=_[_0xc3be('0x33')](db['Tag'][_0xc3be('0x2e')]);_0x2924c6[_0xc3be('0x32')]=_['keys'](_0x5c8126[_0xc3be('0x32')]);_0x2924c6[_0xc3be('0x3d')]=_['intersection'](_0x2924c6['model'],_0x2924c6['query']);_0x3662d8[_0xc3be('0x36')]=_[_0xc3be('0x34')](_0x2924c6[_0xc3be('0x31')],qs[_0xc3be('0x35')](_0x5c8126[_0xc3be('0x32')][_0xc3be('0x35')]));_0x3662d8[_0xc3be('0x36')]=_0x3662d8['attributes'][_0xc3be('0x37')]?_0x3662d8[_0xc3be('0x36')]:_0x2924c6[_0xc3be('0x31')];if(_0x5c8126['query']['includeAll']){_0x3662d8[_0xc3be('0x41')]=[{'all':!![]}];}_0x3662d8=_[_0xc3be('0x46')]({},_0x3662d8,_0x5c8126['options']);return db[_0xc3be('0x2d')][_0xc3be('0x47')](_0x3662d8)[_0xc3be('0x24')](handleEntityNotFound(_0x32f513,null))['then'](respondWithResult(_0x32f513,null))[_0xc3be('0x44')](handleError(_0x32f513,null));};exports[_0xc3be('0x48')]=function(_0x34a3c2,_0x1fe313){return db['Tag']['create'](_0x34a3c2[_0xc3be('0x49')],{})[_0xc3be('0x24')](function(_0x1f13e8){var _0x14c720=_0x34a3c2[_0xc3be('0x4a')][_0xc3be('0x26')]({'plain':!![]});if(!_0x14c720)throw new Error(_0xc3be('0x4b'));if(_0x14c720[_0xc3be('0x4c')]===_0xc3be('0x4a')){var _0x2e4b04=_0x1f13e8[_0xc3be('0x26')]({'plain':!![]});var _0xa076d=_0xc3be('0x27');return db[_0xc3be('0x4d')]['find']({'where':{'name':_0xa076d,'userProfileId':_0x14c720[_0xc3be('0x4e')]},'raw':!![]})['then'](function(_0x4ad417){if(_0x4ad417&&_0x4ad417[_0xc3be('0x4f')]===0x0){return db[_0xc3be('0x50')]['create']({'name':_0x2e4b04[_0xc3be('0x2a')],'resourceId':_0x2e4b04['id'],'type':_0x4ad417['name'],'sectionId':_0x4ad417['id']},{})[_0xc3be('0x24')](function(){return _0x1f13e8;});}else{return _0x1f13e8;}})['catch'](function(_0x5cd574){logger['error'](_0xc3be('0x51'),_0x5cd574);throw _0x5cd574;});}return _0x1f13e8;})[_0xc3be('0x24')](respondWithResult(_0x1fe313,0xc9))[_0xc3be('0x44')](handleError(_0x1fe313,null));};exports[_0xc3be('0x23')]=function(_0x211c6b,_0x2a9798){if(_0x211c6b['body']['id']){delete _0x211c6b[_0xc3be('0x49')]['id'];}return db[_0xc3be('0x2d')]['find']({'where':{'id':_0x211c6b[_0xc3be('0x52')]['id']}})['then'](handleEntityNotFound(_0x2a9798,null))[_0xc3be('0x24')](saveUpdates(_0x211c6b['body'],null))['then'](respondWithResult(_0x2a9798,null))[_0xc3be('0x44')](handleError(_0x2a9798,null));};exports[_0xc3be('0x25')]=function(_0x14b07b,_0x3ba2b5){return db[_0xc3be('0x2d')][_0xc3be('0x47')]({'where':{'id':_0x14b07b[_0xc3be('0x52')]['id']}})['then'](handleEntityNotFound(_0x3ba2b5,null))[_0xc3be('0x24')](removeEntity(_0x3ba2b5,null))[_0xc3be('0x44')](handleError(_0x3ba2b5,null));};
\ No newline at end of file
diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js
index 2191c7f..9f7ec25 100644
--- a/server/api/tag/tag.model.js
+++ b/server/api/tag/tag.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x71c6=['request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','Tag','tools_tags','lodash','util','../../config/logger','api','bluebird'];(function(_0x239837,_0x138cd6){var _0x3eb5c8=function(_0x495bba){while(--_0x495bba){_0x239837['push'](_0x239837['shift']());}};_0x3eb5c8(++_0x138cd6);}(_0x71c6,0x1dc));var _0x671c=function(_0x203e63,_0xa0af57){_0x203e63=_0x203e63-0x0;var _0x9baecd=_0x71c6[_0x203e63];return _0x9baecd;};'use strict';var _=require(_0x671c('0x0'));var util=require(_0x671c('0x1'));var logger=require(_0x671c('0x2'))(_0x671c('0x3'));var moment=require('moment');var BPromise=require(_0x671c('0x4'));var rp=require(_0x671c('0x5'));var fs=require('fs');var path=require(_0x671c('0x6'));var rimraf=require(_0x671c('0x7'));var config=require(_0x671c('0x8'));var attributes=require(_0x671c('0x9'));module[_0x671c('0xa')]=function(_0x3192a9,_0x4db48c){return _0x3192a9['define'](_0x671c('0xb'),attributes,{'tableName':_0x671c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6fd7=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util'];(function(_0x46a63b,_0x514479){var _0x5af952=function(_0x2d7b08){while(--_0x2d7b08){_0x46a63b['push'](_0x46a63b['shift']());}};_0x5af952(++_0x514479);}(_0x6fd7,0x14e));var _0x76fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76fd('0x0'));var util=require(_0x76fd('0x1'));var logger=require(_0x76fd('0x2'))('api');var moment=require(_0x76fd('0x3'));var BPromise=require(_0x76fd('0x4'));var rp=require(_0x76fd('0x5'));var fs=require('fs');var path=require(_0x76fd('0x6'));var rimraf=require(_0x76fd('0x7'));var config=require(_0x76fd('0x8'));var attributes=require(_0x76fd('0x9'));module[_0x76fd('0xa')]=function(_0x1166a1,_0x137cde){return _0x1166a1[_0x76fd('0xb')](_0x76fd('0xc'),attributes,{'tableName':_0x76fd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js
index 63886aa..7af43df 100644
--- a/server/api/tag/tag.rpc.js
+++ b/server/api/tag/tag.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa74f=['result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x2c3c23,_0x3609b5){var _0x24e0ee=function(_0x510410){while(--_0x510410){_0x2c3c23['push'](_0x2c3c23['shift']());}};_0x24e0ee(++_0x3609b5);}(_0xa74f,0x9a));var _0xfa74=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0xa74f[_0x402c8f];return _0x11e809;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});}
\ No newline at end of file
+var _0x3f8c=['Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','then','info'];(function(_0x1feaea,_0x1228f4){var _0x1c15ff=function(_0x224606){while(--_0x224606){_0x1feaea['push'](_0x1feaea['shift']());}};_0x1c15ff(++_0x1228f4);}(_0x3f8c,0x104));var _0xc3f8=function(_0x9b1745,_0x474894){_0x9b1745=_0x9b1745-0x0;var _0x49711e=_0x3f8c[_0x9b1745];return _0x49711e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3f8('0x0'));var BPromise=require(_0xc3f8('0x1'));var rs=require(_0xc3f8('0x2'));var fs=require('fs');var Redis=require(_0xc3f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc3f8('0x4'));var client=jayson[_0xc3f8('0x5')][_0xc3f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44c25d,_0x2bbaa5,_0x15512a){return new BPromise(function(_0x51093a,_0x28397e){return client[_0xc3f8('0x7')](_0x44c25d,_0x15512a)[_0xc3f8('0x8')](function(_0x3c340c){logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));logger['debug'](_0xc3f8('0xc'),_0x2bbaa5,_0xc3f8('0xb'),JSON[_0xc3f8('0xd')](_0x3c340c));if(_0x3c340c[_0xc3f8('0xe')]){if(_0x3c340c['error'][_0xc3f8('0xf')]===0x1f4){logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')]['message']);return _0x28397e(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);return _0x51093a(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}else{logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));_0x51093a(_0x3c340c[_0xc3f8('0x11')][_0xc3f8('0x10')]);}})['catch'](function(_0x14b3ed){logger['error']('Tag,\x20%s,\x20%s',_0x2bbaa5,_0x14b3ed);_0x28397e(_0x14b3ed);});});}
\ No newline at end of file
diff --git a/server/api/team/index.js b/server/api/team/index.js
index 27d6d13..1febe3e 100644
--- a/server/api/team/index.js
+++ b/server/api/team/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe9f8=['getQueues','getAgents','post','/:id/users','addAgents','put','/:id','update','delete','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','/:id/queues'];(function(_0x57b1c7,_0x1a9018){var _0x2b26a4=function(_0x4c91da){while(--_0x4c91da){_0x57b1c7['push'](_0x57b1c7['shift']());}};_0x2b26a4(++_0x1a9018);}(_0xe9f8,0xbe));var _0x8e9f=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xe9f8[_0x15bc81];return _0x59440e;};'use strict';var multer=require(_0x8e9f('0x0'));var util=require(_0x8e9f('0x1'));var path=require(_0x8e9f('0x2'));var timeout=require('connect-timeout');var express=require(_0x8e9f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8e9f('0x4'));var config=require(_0x8e9f('0x5'));var controller=require(_0x8e9f('0x6'));router[_0x8e9f('0x7')]('/',auth[_0x8e9f('0x8')](),controller['index']);router[_0x8e9f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8e9f('0x7')](_0x8e9f('0x9'),auth[_0x8e9f('0x8')](),controller[_0x8e9f('0xa')]);router[_0x8e9f('0x7')]('/:id/users',auth[_0x8e9f('0x8')](),controller[_0x8e9f('0xb')]);router[_0x8e9f('0xc')]('/',auth[_0x8e9f('0x8')](),controller['create']);router[_0x8e9f('0xc')]('/:id/queues',auth[_0x8e9f('0x8')](),controller['addQueues']);router[_0x8e9f('0xc')](_0x8e9f('0xd'),auth['isAuthenticated'](),controller[_0x8e9f('0xe')]);router[_0x8e9f('0xf')](_0x8e9f('0x10'),auth[_0x8e9f('0x8')](),controller[_0x8e9f('0x11')]);router[_0x8e9f('0x12')](_0x8e9f('0x10'),auth[_0x8e9f('0x8')](),controller['destroy']);router[_0x8e9f('0x12')](_0x8e9f('0x9'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x8e9f('0x12')](_0x8e9f('0xd'),auth[_0x8e9f('0x8')](),controller['removeAgents']);module[_0x8e9f('0x13')]=router;
\ No newline at end of file
+var _0x9e0c=['update','delete','removeQueues','removeAgents','path','../../components/auth/service','get','index','/:id','/:id/queues','isAuthenticated','getAgents','post','create','addQueues','/:id/users','addAgents','put'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x9e0c,0x70));var _0xc9e0=function(_0x89ec8e,_0x432d5b){_0x89ec8e=_0x89ec8e-0x0;var _0x3e5cab=_0x9e0c[_0x89ec8e];return _0x3e5cab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc9e0('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xc9e0('0x1'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./team.controller');router[_0xc9e0('0x2')]('/',auth['isAuthenticated'](),controller[_0xc9e0('0x3')]);router[_0xc9e0('0x2')](_0xc9e0('0x4'),auth['isAuthenticated'](),controller['show']);router[_0xc9e0('0x2')](_0xc9e0('0x5'),auth[_0xc9e0('0x6')](),controller['getQueues']);router['get']('/:id/users',auth[_0xc9e0('0x6')](),controller[_0xc9e0('0x7')]);router[_0xc9e0('0x8')]('/',auth[_0xc9e0('0x6')](),controller[_0xc9e0('0x9')]);router[_0xc9e0('0x8')](_0xc9e0('0x5'),auth[_0xc9e0('0x6')](),controller[_0xc9e0('0xa')]);router['post'](_0xc9e0('0xb'),auth['isAuthenticated'](),controller[_0xc9e0('0xc')]);router[_0xc9e0('0xd')](_0xc9e0('0x4'),auth['isAuthenticated'](),controller[_0xc9e0('0xe')]);router[_0xc9e0('0xf')](_0xc9e0('0x4'),auth[_0xc9e0('0x6')](),controller['destroy']);router[_0xc9e0('0xf')](_0xc9e0('0x5'),auth['isAuthenticated'](),controller[_0xc9e0('0x10')]);router[_0xc9e0('0xf')](_0xc9e0('0xb'),auth[_0xc9e0('0x6')](),controller[_0xc9e0('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js
index 880f4c3..590ad15 100644
--- a/server/api/team/team.attributes.js
+++ b/server/api/team/team.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fbc=['exports','STRING','sequelize'];(function(_0x1f954d,_0x26cb29){var _0x512984=function(_0x1801b1){while(--_0x1801b1){_0x1f954d['push'](_0x1f954d['shift']());}};_0x512984(++_0x26cb29);}(_0x5fbc,0x8f));var _0xc5fb=function(_0x33018d,_0x2be566){_0x33018d=_0x33018d-0x0;var _0x2f9d4f=_0x5fbc[_0x33018d];return _0x2f9d4f;};'use strict';var Sequelize=require(_0xc5fb('0x0'));module[_0xc5fb('0x1')]={'name':{'type':Sequelize[_0xc5fb('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0xc5fb('0x2')]}};
\ No newline at end of file
+var _0x986e=['STRING','name','exports'];(function(_0x553c78,_0x4656c2){var _0x2f68c5=function(_0x4b9fac){while(--_0x4b9fac){_0x553c78['push'](_0x553c78['shift']());}};_0x2f68c5(++_0x4656c2);}(_0x986e,0x167));var _0xe986=function(_0x29a8f7,_0x2441f8){_0x29a8f7=_0x29a8f7-0x0;var _0x37a48c=_0x986e[_0x29a8f7];return _0x37a48c;};'use strict';var Sequelize=require('sequelize');module[_0xe986('0x0')]={'name':{'type':Sequelize[_0xe986('0x1')],'allowNull':![],'unique':_0xe986('0x2')},'description':{'type':Sequelize[_0xe986('0x1')]}};
\ No newline at end of file
diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js
index 38aeef5..0444653 100644
--- a/server/api/team/team.controller.js
+++ b/server/api/team/team.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2787=['error','stack','name','send','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','count','includeAll','Team','findAll','catch','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','Queue','toLowerCase','Queues','addQueues','ids','removeQueues','remove','addAgents','Mail','Sms','Fax','Openchannel','Whatsapp','each','Voice','online','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','voicePause','spread','emit','removeAgents','voice','chat','sms','fax','openchannel','whatsapp','isArray','userTeam:remove','getAgents','User','nolimit','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','./team.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource'];(function(_0x26c904,_0x1b7db6){var _0x505d76=function(_0x2123cd){while(--_0x2123cd){_0x26c904['push'](_0x26c904['shift']());}};_0x505d76(++_0x1b7db6);}(_0x2787,0x15e));var _0x7278=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2787[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0x7278('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7278('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7278('0x2'));var rp=require(_0x7278('0x3'));var moment=require(_0x7278('0x4'));var BPromise=require(_0x7278('0x5'));var Mustache=require(_0x7278('0x6'));var util=require(_0x7278('0x7'));var path=require('path');var sox=require(_0x7278('0x8'));var csv=require(_0x7278('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7278('0xa'));var squel=require(_0x7278('0xb'));var crypto=require('crypto');var jsforce=require(_0x7278('0xc'));var deskjs=require(_0x7278('0xd'));var toCsv=require(_0x7278('0x9'));var querystring=require(_0x7278('0xe'));var Papa=require(_0x7278('0xf'));var Redis=require(_0x7278('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7278('0x11'));var as=require(_0x7278('0x12'));var hardwareService=require(_0x7278('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7278('0x14'));var config=require('../../config/environment');var db=require(_0x7278('0x15'))['db'];config[_0x7278('0x16')]=_['defaults'](config[_0x7278('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7278('0x17'))[_0x7278('0x18')](socket);function respondWithStatusCode(_0x1c2728,_0x77fab4){_0x77fab4=_0x77fab4||0xcc;return function(_0x553b07){if(_0x553b07){return _0x1c2728[_0x7278('0x19')](_0x77fab4);}return _0x1c2728[_0x7278('0x1a')](_0x77fab4)[_0x7278('0x1b')]();};}function respondWithResult(_0x3b883c,_0x5f1839){_0x5f1839=_0x5f1839||0xc8;return function(_0x271604){if(_0x271604){return _0x3b883c[_0x7278('0x1a')](_0x5f1839)[_0x7278('0x1c')](_0x271604);}};}function respondWithFilteredResult(_0x271a51,_0x12a521){return function(_0x280bc3){if(_0x280bc3){var _0x5f2e1a=_0x280bc3['count'],_0x41d83b=_0x12a521[_0x7278('0x1d')],_0x366fec=_0x12a521[_0x7278('0x1d')]+_0x12a521[_0x7278('0x1e')],_0x2e0216;if(_0x366fec>=_0x5f2e1a){_0x366fec=_0x5f2e1a;_0x2e0216=0xc8;}else{_0x2e0216=0xce;}_0x271a51[_0x7278('0x1a')](_0x2e0216);return _0x271a51[_0x7278('0x1f')](_0x7278('0x20'),_0x41d83b+'-'+_0x366fec+'/'+_0x5f2e1a)['json'](_0x280bc3);}return null;};}function patchUpdates(_0x1aef38){return function(_0x5f2b05){try{jsonpatch[_0x7278('0x21')](_0x5f2b05,_0x1aef38,!![]);}catch(_0x35fa24){return BPromise[_0x7278('0x22')](_0x35fa24);}return _0x5f2b05[_0x7278('0x23')]();};}function saveUpdates(_0x523b02,_0x2b2743){return function(_0xb038d){if(_0xb038d){return _0xb038d['update'](_0x523b02)['then'](function(_0x4beeee){return _0x4beeee;});}return null;};}function removeEntity(_0x4e307b,_0x597670){return function(_0x38b90f){if(_0x38b90f){return _0x38b90f[_0x7278('0x24')]()[_0x7278('0x25')](function(){var _0x4123ad=_0x38b90f[_0x7278('0x26')]({'plain':!![]});var _0x12e4ca='Teams';return db[_0x7278('0x27')]['destroy']({'where':{'type':_0x12e4ca,'resourceId':_0x4123ad['id']}})[_0x7278('0x25')](function(){return _0x38b90f;});})[_0x7278('0x25')](function(){_0x4e307b[_0x7278('0x1a')](0xcc)[_0x7278('0x1b')]();});}};}function handleEntityNotFound(_0xb21818,_0x56ecb7){return function(_0xbe3221){if(!_0xbe3221){_0xb21818[_0x7278('0x19')](0x194);}return _0xbe3221;};}function handleError(_0x1b9098,_0x239e44){_0x239e44=_0x239e44||0x1f4;return function(_0x2e8195){logger[_0x7278('0x28')](_0x2e8195[_0x7278('0x29')]);if(_0x2e8195[_0x7278('0x2a')]){delete _0x2e8195[_0x7278('0x2a')];}_0x1b9098[_0x7278('0x1a')](_0x239e44)[_0x7278('0x2b')](_0x2e8195);};}exports['index']=function(_0xaedfae,_0x3b204a){var _0x566dbb={},_0x5f0125={},_0x701173={'count':0x0,'rows':[]};var _0x3a693b=_['map'](db['Team'][_0x7278('0x2c')],function(_0x265c57){return{'name':_0x265c57[_0x7278('0x2d')],'type':_0x265c57[_0x7278('0x2e')][_0x7278('0x2f')]};});_0x5f0125[_0x7278('0x30')]=_['map'](_0x3a693b,_0x7278('0x2a'));_0x5f0125[_0x7278('0x31')]=_[_0x7278('0x32')](_0xaedfae['query']);_0x5f0125['filters']=_[_0x7278('0x33')](_0x5f0125[_0x7278('0x30')],_0x5f0125[_0x7278('0x31')]);_0x566dbb[_0x7278('0x34')]=_[_0x7278('0x33')](_0x5f0125[_0x7278('0x30')],qs[_0x7278('0x35')](_0xaedfae[_0x7278('0x31')][_0x7278('0x35')]));_0x566dbb['attributes']=_0x566dbb[_0x7278('0x34')][_0x7278('0x36')]?_0x566dbb[_0x7278('0x34')]:_0x5f0125[_0x7278('0x30')];if(!_0xaedfae[_0x7278('0x31')][_0x7278('0x37')]('nolimit')){_0x566dbb['limit']=qs[_0x7278('0x1e')](_0xaedfae['query']['limit']);_0x566dbb['offset']=qs[_0x7278('0x1d')](_0xaedfae[_0x7278('0x31')][_0x7278('0x1d')]);}_0x566dbb[_0x7278('0x38')]=qs[_0x7278('0x39')](_0xaedfae[_0x7278('0x31')][_0x7278('0x39')]);_0x566dbb[_0x7278('0x3a')]=qs[_0x7278('0x3b')](_[_0x7278('0x3c')](_0xaedfae[_0x7278('0x31')],_0x5f0125['filters']),_0x3a693b);if(_0xaedfae[_0x7278('0x31')][_0x7278('0x3d')]){_0x566dbb[_0x7278('0x3a')]=_[_0x7278('0x3e')](_0x566dbb[_0x7278('0x3a')],{'$or':_[_0x7278('0x3f')](_0x3a693b,function(_0x1c944b){if(_0x1c944b[_0x7278('0x2e')]!==_0x7278('0x40')){var _0x386fbc={};_0x386fbc[_0x1c944b[_0x7278('0x2a')]]={'$like':'%'+_0xaedfae['query'][_0x7278('0x3d')]+'%'};return _0x386fbc;}})});}_0x566dbb=_['merge']({},_0x566dbb,_0xaedfae[_0x7278('0x41')]);var _0x1f855b={'where':_0x566dbb[_0x7278('0x3a')]};return db['Team']['count'](_0x1f855b)['then'](function(_0x2d1a3e){_0x701173[_0x7278('0x42')]=_0x2d1a3e;if(_0xaedfae[_0x7278('0x31')][_0x7278('0x43')]){_0x566dbb['include']=[{'all':!![]}];}return db[_0x7278('0x44')][_0x7278('0x45')](_0x566dbb);})['then'](function(_0x56a919){_0x701173['rows']=_0x56a919;return _0x701173;})[_0x7278('0x25')](respondWithFilteredResult(_0x3b204a,_0x566dbb))[_0x7278('0x46')](handleError(_0x3b204a,null));};exports['show']=function(_0x445883,_0x2b353c){var _0x2fd8ee={'raw':![],'where':{'id':_0x445883[_0x7278('0x47')]['id']}},_0x2504dd={};_0x2504dd['model']=_[_0x7278('0x32')](db[_0x7278('0x44')][_0x7278('0x2c')]);_0x2504dd[_0x7278('0x31')]=_['keys'](_0x445883[_0x7278('0x31')]);_0x2504dd[_0x7278('0x3b')]=_['intersection'](_0x2504dd[_0x7278('0x30')],_0x2504dd[_0x7278('0x31')]);_0x2fd8ee[_0x7278('0x34')]=_[_0x7278('0x33')](_0x2504dd[_0x7278('0x30')],qs['fields'](_0x445883[_0x7278('0x31')]['fields']));_0x2fd8ee[_0x7278('0x34')]=_0x2fd8ee[_0x7278('0x34')][_0x7278('0x36')]?_0x2fd8ee[_0x7278('0x34')]:_0x2504dd['model'];if(_0x445883[_0x7278('0x31')][_0x7278('0x43')]){_0x2fd8ee[_0x7278('0x48')]=[{'all':!![]}];}_0x2fd8ee=_['merge']({},_0x2fd8ee,_0x445883['options']);return db[_0x7278('0x44')]['find'](_0x2fd8ee)[_0x7278('0x25')](handleEntityNotFound(_0x2b353c,null))[_0x7278('0x25')](respondWithResult(_0x2b353c,null))[_0x7278('0x46')](handleError(_0x2b353c,null));};exports[_0x7278('0x49')]=function(_0x2c3990,_0x28e4b9){return db['Team']['create'](_0x2c3990['body'],{})[_0x7278('0x25')](function(_0x198d53){var _0x3d90cd=_0x2c3990[_0x7278('0x4a')][_0x7278('0x26')]({'plain':!![]});if(!_0x3d90cd)throw new Error(_0x7278('0x4b'));if(_0x3d90cd[_0x7278('0x4c')]===_0x7278('0x4a')){var _0xbbc78e=_0x198d53[_0x7278('0x26')]({'plain':!![]});var _0x491068=_0x7278('0x4d');return db[_0x7278('0x4e')][_0x7278('0x4f')]({'where':{'name':_0x491068,'userProfileId':_0x3d90cd[_0x7278('0x50')]},'raw':!![]})['then'](function(_0x8db8b1){if(_0x8db8b1&&_0x8db8b1[_0x7278('0x51')]===0x0){return db[_0x7278('0x27')][_0x7278('0x49')]({'name':_0xbbc78e['name'],'resourceId':_0xbbc78e['id'],'type':_0x8db8b1[_0x7278('0x2a')],'sectionId':_0x8db8b1['id']},{})[_0x7278('0x25')](function(){return _0x198d53;});}else{return _0x198d53;}})[_0x7278('0x46')](function(_0x230c0e){logger[_0x7278('0x28')](_0x7278('0x52'),_0x230c0e);throw _0x230c0e;});}return _0x198d53;})[_0x7278('0x25')](respondWithResult(_0x28e4b9,0xc9))['catch'](handleError(_0x28e4b9,null));};exports[_0x7278('0x53')]=function(_0x5275c1,_0x432963){if(_0x5275c1[_0x7278('0x54')]['id']){delete _0x5275c1[_0x7278('0x54')]['id'];}return db[_0x7278('0x44')][_0x7278('0x4f')]({'where':{'id':_0x5275c1['params']['id']}})[_0x7278('0x25')](handleEntityNotFound(_0x432963,null))['then'](saveUpdates(_0x5275c1['body'],null))[_0x7278('0x25')](respondWithResult(_0x432963,null))[_0x7278('0x46')](handleError(_0x432963,null));};exports['destroy']=function(_0x41c5ad,_0x5c0204){return db[_0x7278('0x44')][_0x7278('0x4f')]({'where':{'id':_0x41c5ad[_0x7278('0x47')]['id']}})[_0x7278('0x25')](handleEntityNotFound(_0x5c0204,null))[_0x7278('0x25')](removeEntity(_0x5c0204,null))['catch'](handleError(_0x5c0204,null));};exports[_0x7278('0x55')]=function(_0x337f72,_0x4bfbc9,_0x20b293){return db['Team'][_0x7278('0x56')]({'where':{'id':_0x337f72['params']['id']}})[_0x7278('0x25')](handleEntityNotFound(_0x4bfbc9,null))[_0x7278('0x25')](function(_0x9709b7){if(!_0x337f72[_0x7278('0x31')][_0x7278('0x57')]||!utils[_0x7278('0x58')](_0x337f72[_0x7278('0x31')]['channel'])){throw new db[(_0x7278('0x59'))][(_0x7278('0x5a'))](_0x7278('0x5b'));}var _0x5b2ead={};var _0xad5a76={};_0xad5a76['model']=_['keys'](db[_[_0x7278('0x5c')](_0x337f72[_0x7278('0x31')][_0x7278('0x57')]['toLowerCase']())+_0x7278('0x5d')][_0x7278('0x2c')]);_0xad5a76[_0x7278('0x31')]=_[_0x7278('0x32')](_0x337f72[_0x7278('0x31')]);_0xad5a76[_0x7278('0x3b')]=_[_0x7278('0x33')](_0xad5a76[_0x7278('0x30')],_0xad5a76['query']);_0x5b2ead[_0x7278('0x34')]=_[_0x7278('0x33')](_0xad5a76[_0x7278('0x30')],qs[_0x7278('0x35')](_0x337f72[_0x7278('0x31')][_0x7278('0x35')]));_0x5b2ead[_0x7278('0x34')]=_0x5b2ead['attributes']['length']?_0x5b2ead[_0x7278('0x34')]:_0xad5a76[_0x7278('0x30')];_0x5b2ead['limit']=qs[_0x7278('0x1e')](_0x337f72[_0x7278('0x31')][_0x7278('0x1e')]);_0x5b2ead[_0x7278('0x1d')]=qs['offset'](_0x337f72[_0x7278('0x31')][_0x7278('0x1d')]);_0x5b2ead[_0x7278('0x38')]=qs['sort'](_0x337f72[_0x7278('0x31')][_0x7278('0x39')]);_0x5b2ead[_0x7278('0x3a')]=qs['filters'](_[_0x7278('0x3c')](_0x337f72[_0x7278('0x31')],_0xad5a76[_0x7278('0x3b')]));_0x5b2ead=_['merge']({},_0x5b2ead,_0x337f72[_0x7278('0x41')]);return _0x9709b7[_0x7278('0x26')+_[_0x7278('0x5c')](_0x337f72['query'][_0x7278('0x57')][_0x7278('0x5e')]())+_0x7278('0x5f')](_0x5b2ead);})[_0x7278('0x25')](respondWithResult(_0x4bfbc9,null))[_0x7278('0x46')](handleError(_0x4bfbc9,null));};exports[_0x7278('0x60')]=function(_0x461fb1,_0x39d0fb,_0x2658fb){return db[_0x7278('0x44')][_0x7278('0x56')]({'where':{'id':_0x461fb1[_0x7278('0x47')]['id']}})[_0x7278('0x25')](function(_0x58a444){if(_0x58a444){if(!_0x461fb1[_0x7278('0x54')][_0x7278('0x57')]||!utils[_0x7278('0x58')](_0x461fb1['body']['channel'])){throw new db[(_0x7278('0x59'))][(_0x7278('0x5a'))]('Unknown\x20channel');}return _0x58a444['add'+_[_0x7278('0x5c')](_0x461fb1[_0x7278('0x54')]['channel'][_0x7278('0x5e')]())+_0x7278('0x5f')](_0x461fb1[_0x7278('0x54')][_0x7278('0x61')]);}return null;})[_0x7278('0x25')](handleEntityNotFound(_0x39d0fb,null))[_0x7278('0x25')](respondWithStatusCode(_0x39d0fb,null))['catch'](handleError(_0x39d0fb,null));};exports[_0x7278('0x62')]=function(_0x25af22,_0x5dfe78,_0x24426f){return db[_0x7278('0x44')]['findOne']({'where':{'id':_0x25af22[_0x7278('0x47')]['id']}})[_0x7278('0x25')](function(_0x1b21f8){if(_0x1b21f8){if(!_0x25af22['query'][_0x7278('0x57')]||!utils['isValidChannel'](_0x25af22[_0x7278('0x31')][_0x7278('0x57')])){throw new db[(_0x7278('0x59'))][(_0x7278('0x5a'))](_0x7278('0x5b'));}return _0x1b21f8[_0x7278('0x63')+_[_0x7278('0x5c')](_0x25af22[_0x7278('0x31')][_0x7278('0x57')][_0x7278('0x5e')]())+'Queues'](_0x25af22[_0x7278('0x31')]['ids']);}return null;})[_0x7278('0x25')](handleEntityNotFound(_0x5dfe78,null))[_0x7278('0x25')](respondWithStatusCode(_0x5dfe78,null))[_0x7278('0x46')](handleError(_0x5dfe78,null));};exports[_0x7278('0x64')]=function(_0x2d11ab,_0x5a91fc,_0x1fa6c1){return db[_0x7278('0x44')]['find']({'where':{'id':_0x2d11ab[_0x7278('0x47')]['id']}})[_0x7278('0x25')](handleEntityNotFound(_0x5a91fc,null))[_0x7278('0x25')](function(_0x513836){if(_0x513836){var _0x14ffed=['Voice','Chat',_0x7278('0x65'),_0x7278('0x66'),_0x7278('0x67'),_0x7278('0x68'),_0x7278('0x69')];return BPromise[_0x7278('0x6a')](_0x14ffed,function(_0x4a8af1){return _0x513836['get'+_0x4a8af1+_0x7278('0x5f')]({'attributes':['id',_0x7278('0x2a')]})[_0x7278('0x25')](function(_0x3e70b6){return BPromise[_0x7278('0x6a')](_0x3e70b6,function(_0x1bd72c){return _0x1bd72c[_0x7278('0x64')](_0x2d11ab[_0x7278('0x54')][_0x7278('0x61')])['then'](function(){if(_0x4a8af1===_0x7278('0x6b')){return db['User'][_0x7278('0x45')]({'where':{'id':_0x2d11ab[_0x7278('0x54')]['ids']},'attributes':['id','name',_0x7278('0x6c'),'voicePause','interface'],'raw':!![]})[_0x7278('0x25')](function(_0x2ddee7){return BPromise[_0x7278('0x6a')](_[_0x7278('0x3d')](_0x2ddee7,{'online':0x1}),function(_0x5a85c2){return db[_0x7278('0x6d')][_0x7278('0x6e')]({'membername':_0x5a85c2[_0x7278('0x2a')],'UserId':_0x5a85c2['id'],'queue_name':_0x1bd72c[_0x7278('0x2a')],'VoiceQueueId':_0x1bd72c['id'],'interface':_[_0x7278('0x6f')](_0x5a85c2[_0x7278('0x70')])?util[_0x7278('0x71')](_0x7278('0x72'),_0x5a85c2[_0x7278('0x2a')]):_0x5a85c2['interface'],'paused':_0x5a85c2[_0x7278('0x73')]||![],'penalty':0x0});});});}});});})[_0x7278('0x25')](function(){return _0x513836;});})[_0x7278('0x25')](function(){return _0x513836;});}})[_0x7278('0x25')](function(_0x3f5303){if(_0x3f5303){return _0x3f5303['addAgents'](_0x2d11ab[_0x7278('0x54')][_0x7278('0x61')],_['omit'](_0x2d11ab[_0x7278('0x54')],[_0x7278('0x61'),'id'])||{})[_0x7278('0x74')](function(_0x1c1b57){for(var _0x238e74=0x0;_0x238e74<_0x2d11ab[_0x7278('0x54')][_0x7278('0x61')][_0x7278('0x36')];_0x238e74+=0x1){socket[_0x7278('0x75')]('userTeam:save',{'UserId':_0x2d11ab['body']['ids'][_0x238e74],'TeamId':_0x2d11ab[_0x7278('0x47')]['id']});}return _0x1c1b57;});}})[_0x7278('0x25')](respondWithResult(_0x5a91fc,null))['catch'](handleError(_0x5a91fc,null));};exports[_0x7278('0x76')]=function(_0x3dc95a,_0x4079bd,_0x3a3aab){return db[_0x7278('0x44')][_0x7278('0x4f')]({'where':{'id':_0x3dc95a['params']['id']}})[_0x7278('0x25')](handleEntityNotFound(_0x4079bd,null))[_0x7278('0x25')](function(_0xd1b951){if(_0xd1b951){return BPromise[_0x7278('0x6a')]([_0x7278('0x77'),_0x7278('0x78'),'mail',_0x7278('0x79'),_0x7278('0x7a'),_0x7278('0x7b'),_0x7278('0x7c')],function(_0x289915){return _0xd1b951['get'+_[_0x7278('0x5c')](_0x289915)+_0x7278('0x5f')]({'attributes':['id','name']})[_0x7278('0x25')](function(_0x1713e7){return BPromise['each'](_0x1713e7,function(_0x1b7b0b){return _0x1b7b0b[_0x7278('0x76')](_0x3dc95a[_0x7278('0x31')]['ids'])[_0x7278('0x25')](function(){if(_0x289915===_0x7278('0x77')){return db[_0x7278('0x6d')][_0x7278('0x24')]({'where':{'VoiceQueueId':_0x1b7b0b['id'],'UserId':_0x3dc95a[_0x7278('0x31')][_0x7278('0x61')]}});}});});})['then'](function(){return _0xd1b951;});})['then'](function(){return _0xd1b951;});}})[_0x7278('0x25')](function(_0x194c97){if(_0x194c97){return _0x194c97[_0x7278('0x76')](_0x3dc95a[_0x7278('0x31')][_0x7278('0x61')])['then'](function(){if(_[_0x7278('0x7d')](_0x3dc95a['query']['ids'])){for(var _0x476ad6=0x0;_0x476ad6<_0x3dc95a[_0x7278('0x31')][_0x7278('0x61')][_0x7278('0x36')];_0x476ad6+=0x1){socket['emit'](_0x7278('0x7e'),{'UserId':Number(_0x3dc95a[_0x7278('0x31')][_0x7278('0x61')][_0x476ad6]),'TeamId':Number(_0x3dc95a[_0x7278('0x47')]['id'])});}}else{socket['emit'](_0x7278('0x7e'),{'UserId':Number(_0x3dc95a[_0x7278('0x31')]['ids']),'TeamId':Number(_0x3dc95a[_0x7278('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x4079bd,null))['catch'](handleError(_0x4079bd,null));};exports[_0x7278('0x7f')]=function(_0x311fc4,_0x1ccb08,_0x241752){var _0x9f9ae={};var _0x25e1be={};var _0xf85baa;var _0x404bc2;return db[_0x7278('0x44')][_0x7278('0x56')]({'where':{'id':_0x311fc4[_0x7278('0x47')]['id']}})[_0x7278('0x25')](handleEntityNotFound(_0x1ccb08,null))[_0x7278('0x25')](function(_0x48a4ac){if(_0x48a4ac){_0xf85baa=_0x48a4ac;_0x25e1be[_0x7278('0x30')]=_[_0x7278('0x32')](db[_0x7278('0x80')][_0x7278('0x2c')]);_0x25e1be[_0x7278('0x31')]=_[_0x7278('0x32')](_0x311fc4[_0x7278('0x31')]);_0x25e1be[_0x7278('0x3b')]=_[_0x7278('0x33')](_0x25e1be[_0x7278('0x30')],_0x25e1be[_0x7278('0x31')]);_0x9f9ae['attributes']=_[_0x7278('0x33')](_0x25e1be['model'],qs[_0x7278('0x35')](_0x311fc4[_0x7278('0x31')]['fields']));_0x9f9ae[_0x7278('0x34')]=_0x9f9ae['attributes'][_0x7278('0x36')]?_0x9f9ae[_0x7278('0x34')]:_0x25e1be['model'];_0x9f9ae['order']=qs['sort'](_0x311fc4[_0x7278('0x31')][_0x7278('0x39')]);_0x9f9ae[_0x7278('0x3a')]=qs[_0x7278('0x3b')](_[_0x7278('0x3c')](_0x311fc4[_0x7278('0x31')],_0x25e1be[_0x7278('0x3b')]));if(_0x311fc4[_0x7278('0x31')]['filter']){_0x9f9ae[_0x7278('0x3a')]=_[_0x7278('0x3e')](_0x9f9ae['where'],{'$or':_['map'](_0x9f9ae[_0x7278('0x34')],function(_0x1ca4c5){var _0x1b476d={};_0x1b476d[_0x1ca4c5]={'$like':'%'+_0x311fc4[_0x7278('0x31')][_0x7278('0x3d')]+'%'};return _0x1b476d;})});}_0x9f9ae=_[_0x7278('0x3e')]({},_0x9f9ae,_0x311fc4[_0x7278('0x41')]);return _0xf85baa['getAgents'](_0x9f9ae);}})[_0x7278('0x25')](function(_0x4f7d54){if(_0x4f7d54){_0x404bc2=_0x4f7d54['length'];if(!_0x311fc4[_0x7278('0x31')][_0x7278('0x37')](_0x7278('0x81'))){_0x9f9ae[_0x7278('0x1e')]=qs[_0x7278('0x1e')](_0x311fc4['query'][_0x7278('0x1e')]);_0x9f9ae[_0x7278('0x1d')]=qs[_0x7278('0x1d')](_0x311fc4[_0x7278('0x31')][_0x7278('0x1d')]);}return _0xf85baa['getAgents'](_0x9f9ae);}})['then'](function(_0x18dc8e){if(_0x18dc8e){return _0x18dc8e?{'count':_0x404bc2,'rows':_0x18dc8e}:null;}})[_0x7278('0x25')](respondWithResult(_0x1ccb08,null))[_0x7278('0x46')](handleError(_0x1ccb08,null));};
\ No newline at end of file
+var _0x89c9=['findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','each','User','findAll','online','voicePause','interface','upsert','format','omit','emit','userTeam:save','removeAgents','chat','mail','sms','fax','openchannel','whatsapp','voice','UserVoiceQueueRt','isArray','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','Content-Range','apply','reject','then','UserProfileResource','destroy','error','send','index','map','Team','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','create','body','user','get','Teams','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getQueues'];(function(_0x21cb65,_0x34dfcb){var _0x37b13c=function(_0xfcaca){while(--_0xfcaca){_0x21cb65['push'](_0x21cb65['shift']());}};_0x37b13c(++_0x34dfcb);}(_0x89c9,0xb0));var _0x989c=function(_0x57643b,_0x1706fe){_0x57643b=_0x57643b-0x0;var _0x53a35b=_0x89c9[_0x57643b];return _0x53a35b;};'use strict';var pdf=require(_0x989c('0x0'));var emlformat=require(_0x989c('0x1'));var rimraf=require(_0x989c('0x2'));var zipdir=require(_0x989c('0x3'));var jsonpatch=require(_0x989c('0x4'));var rp=require(_0x989c('0x5'));var moment=require(_0x989c('0x6'));var BPromise=require(_0x989c('0x7'));var Mustache=require(_0x989c('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x989c('0x9'));var ejs=require(_0x989c('0xa'));var fs=require('fs');var _=require(_0x989c('0xb'));var squel=require(_0x989c('0xc'));var crypto=require(_0x989c('0xd'));var jsforce=require(_0x989c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x989c('0x9'));var querystring=require(_0x989c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x989c('0x10'));var qs=require(_0x989c('0x11'));var as=require(_0x989c('0x12'));var hardwareService=require(_0x989c('0x13'));var logger=require(_0x989c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x989c('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x989c('0x16')],{'host':_0x989c('0x17'),'port':0x18eb});var socket=require(_0x989c('0x18'))(new Redis(config[_0x989c('0x16')]));require(_0x989c('0x19'))[_0x989c('0x1a')](socket);function respondWithStatusCode(_0x2bec9f,_0x4c1f44){_0x4c1f44=_0x4c1f44||0xcc;return function(_0x4db588){if(_0x4db588){return _0x2bec9f[_0x989c('0x1b')](_0x4c1f44);}return _0x2bec9f[_0x989c('0x1c')](_0x4c1f44)[_0x989c('0x1d')]();};}function respondWithResult(_0x462397,_0x2d3381){_0x2d3381=_0x2d3381||0xc8;return function(_0xbcba12){if(_0xbcba12){return _0x462397[_0x989c('0x1c')](_0x2d3381)[_0x989c('0x1e')](_0xbcba12);}};}function respondWithFilteredResult(_0x1ea711,_0x254283){return function(_0x1626cd){if(_0x1626cd){var _0x489def=_0x1626cd['count'],_0x5760f4=_0x254283['offset'],_0x5acdfe=_0x254283[_0x989c('0x1f')]+_0x254283['limit'],_0x1837f6;if(_0x5acdfe>=_0x489def){_0x5acdfe=_0x489def;_0x1837f6=0xc8;}else{_0x1837f6=0xce;}_0x1ea711[_0x989c('0x1c')](_0x1837f6);return _0x1ea711['set'](_0x989c('0x20'),_0x5760f4+'-'+_0x5acdfe+'/'+_0x489def)[_0x989c('0x1e')](_0x1626cd);}return null;};}function patchUpdates(_0x36c3e1){return function(_0x14c37e){try{jsonpatch[_0x989c('0x21')](_0x14c37e,_0x36c3e1,!![]);}catch(_0x38f9f3){return BPromise[_0x989c('0x22')](_0x38f9f3);}return _0x14c37e['save']();};}function saveUpdates(_0x55716e,_0xeb1d9d){return function(_0x1ebded){if(_0x1ebded){return _0x1ebded['update'](_0x55716e)[_0x989c('0x23')](function(_0x3e5e17){return _0x3e5e17;});}return null;};}function removeEntity(_0x14aaf1,_0x33303f){return function(_0x41d36e){if(_0x41d36e){return _0x41d36e['destroy']()['then'](function(){var _0x30c6df=_0x41d36e['get']({'plain':!![]});var _0x1c6d38='Teams';return db[_0x989c('0x24')][_0x989c('0x25')]({'where':{'type':_0x1c6d38,'resourceId':_0x30c6df['id']}})['then'](function(){return _0x41d36e;});})[_0x989c('0x23')](function(){_0x14aaf1[_0x989c('0x1c')](0xcc)[_0x989c('0x1d')]();});}};}function handleEntityNotFound(_0x2027ee,_0x32cef8){return function(_0x2e026f){if(!_0x2e026f){_0x2027ee[_0x989c('0x1b')](0x194);}return _0x2e026f;};}function handleError(_0x13e973,_0xdc49d6){_0xdc49d6=_0xdc49d6||0x1f4;return function(_0x5cadb6){logger[_0x989c('0x26')](_0x5cadb6['stack']);if(_0x5cadb6['name']){delete _0x5cadb6['name'];}_0x13e973[_0x989c('0x1c')](_0xdc49d6)[_0x989c('0x27')](_0x5cadb6);};}exports[_0x989c('0x28')]=function(_0x3306c8,_0x39e5d1){var _0xcd538a={},_0xad445d={},_0x311433={'count':0x0,'rows':[]};var _0x53aa83=_[_0x989c('0x29')](db[_0x989c('0x2a')][_0x989c('0x2b')],function(_0x3b9bac){return{'name':_0x3b9bac[_0x989c('0x2c')],'type':_0x3b9bac[_0x989c('0x2d')][_0x989c('0x2e')]};});_0xad445d[_0x989c('0x2f')]=_[_0x989c('0x29')](_0x53aa83,_0x989c('0x30'));_0xad445d[_0x989c('0x31')]=_[_0x989c('0x32')](_0x3306c8[_0x989c('0x31')]);_0xad445d[_0x989c('0x33')]=_[_0x989c('0x34')](_0xad445d[_0x989c('0x2f')],_0xad445d[_0x989c('0x31')]);_0xcd538a['attributes']=_['intersection'](_0xad445d['model'],qs[_0x989c('0x35')](_0x3306c8[_0x989c('0x31')][_0x989c('0x35')]));_0xcd538a['attributes']=_0xcd538a[_0x989c('0x36')][_0x989c('0x37')]?_0xcd538a[_0x989c('0x36')]:_0xad445d[_0x989c('0x2f')];if(!_0x3306c8[_0x989c('0x31')][_0x989c('0x38')](_0x989c('0x39'))){_0xcd538a[_0x989c('0x3a')]=qs[_0x989c('0x3a')](_0x3306c8[_0x989c('0x31')][_0x989c('0x3a')]);_0xcd538a[_0x989c('0x1f')]=qs[_0x989c('0x1f')](_0x3306c8['query'][_0x989c('0x1f')]);}_0xcd538a[_0x989c('0x3b')]=qs[_0x989c('0x3c')](_0x3306c8[_0x989c('0x31')][_0x989c('0x3c')]);_0xcd538a[_0x989c('0x3d')]=qs[_0x989c('0x33')](_['pick'](_0x3306c8[_0x989c('0x31')],_0xad445d[_0x989c('0x33')]),_0x53aa83);if(_0x3306c8[_0x989c('0x31')][_0x989c('0x3e')]){_0xcd538a['where']=_[_0x989c('0x3f')](_0xcd538a['where'],{'$or':_[_0x989c('0x29')](_0x53aa83,function(_0x12a2db){if(_0x12a2db['type']!==_0x989c('0x40')){var _0x297032={};_0x297032[_0x12a2db[_0x989c('0x30')]]={'$like':'%'+_0x3306c8[_0x989c('0x31')][_0x989c('0x3e')]+'%'};return _0x297032;}})});}_0xcd538a=_['merge']({},_0xcd538a,_0x3306c8[_0x989c('0x41')]);var _0x30f945={'where':_0xcd538a[_0x989c('0x3d')]};return db[_0x989c('0x2a')][_0x989c('0x42')](_0x30f945)[_0x989c('0x23')](function(_0x33fc3a){_0x311433[_0x989c('0x42')]=_0x33fc3a;if(_0x3306c8[_0x989c('0x31')][_0x989c('0x43')]){_0xcd538a[_0x989c('0x44')]=[{'all':!![]}];}return db[_0x989c('0x2a')]['findAll'](_0xcd538a);})['then'](function(_0x18b441){_0x311433[_0x989c('0x45')]=_0x18b441;return _0x311433;})[_0x989c('0x23')](respondWithFilteredResult(_0x39e5d1,_0xcd538a))[_0x989c('0x46')](handleError(_0x39e5d1,null));};exports[_0x989c('0x47')]=function(_0x3e2754,_0x51cdb3){var _0x2596f6={'raw':![],'where':{'id':_0x3e2754['params']['id']}},_0x5705ba={};_0x5705ba[_0x989c('0x2f')]=_[_0x989c('0x32')](db[_0x989c('0x2a')][_0x989c('0x2b')]);_0x5705ba[_0x989c('0x31')]=_[_0x989c('0x32')](_0x3e2754['query']);_0x5705ba['filters']=_[_0x989c('0x34')](_0x5705ba[_0x989c('0x2f')],_0x5705ba['query']);_0x2596f6[_0x989c('0x36')]=_[_0x989c('0x34')](_0x5705ba['model'],qs[_0x989c('0x35')](_0x3e2754[_0x989c('0x31')]['fields']));_0x2596f6[_0x989c('0x36')]=_0x2596f6[_0x989c('0x36')][_0x989c('0x37')]?_0x2596f6[_0x989c('0x36')]:_0x5705ba[_0x989c('0x2f')];if(_0x3e2754[_0x989c('0x31')]['includeAll']){_0x2596f6[_0x989c('0x44')]=[{'all':!![]}];}_0x2596f6=_[_0x989c('0x3f')]({},_0x2596f6,_0x3e2754[_0x989c('0x41')]);return db[_0x989c('0x2a')]['find'](_0x2596f6)[_0x989c('0x23')](handleEntityNotFound(_0x51cdb3,null))['then'](respondWithResult(_0x51cdb3,null))[_0x989c('0x46')](handleError(_0x51cdb3,null));};exports[_0x989c('0x48')]=function(_0xd65433,_0x2519a5){return db[_0x989c('0x2a')][_0x989c('0x48')](_0xd65433[_0x989c('0x49')],{})[_0x989c('0x23')](function(_0x4017fb){var _0x16df6d=_0xd65433[_0x989c('0x4a')]['get']({'plain':!![]});if(!_0x16df6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16df6d['role']===_0x989c('0x4a')){var _0x50acf4=_0x4017fb[_0x989c('0x4b')]({'plain':!![]});var _0x1d7290=_0x989c('0x4c');return db[_0x989c('0x4d')][_0x989c('0x4e')]({'where':{'name':_0x1d7290,'userProfileId':_0x16df6d['userProfileId']},'raw':!![]})[_0x989c('0x23')](function(_0x23dfa2){if(_0x23dfa2&&_0x23dfa2[_0x989c('0x4f')]===0x0){return db['UserProfileResource'][_0x989c('0x48')]({'name':_0x50acf4[_0x989c('0x30')],'resourceId':_0x50acf4['id'],'type':_0x23dfa2['name'],'sectionId':_0x23dfa2['id']},{})[_0x989c('0x23')](function(){return _0x4017fb;});}else{return _0x4017fb;}})['catch'](function(_0x20f38c){logger[_0x989c('0x26')](_0x989c('0x50'),_0x20f38c);throw _0x20f38c;});}return _0x4017fb;})[_0x989c('0x23')](respondWithResult(_0x2519a5,0xc9))[_0x989c('0x46')](handleError(_0x2519a5,null));};exports[_0x989c('0x51')]=function(_0xa8733e,_0x1fb9d2){if(_0xa8733e[_0x989c('0x49')]['id']){delete _0xa8733e[_0x989c('0x49')]['id'];}return db[_0x989c('0x2a')][_0x989c('0x4e')]({'where':{'id':_0xa8733e[_0x989c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1fb9d2,null))[_0x989c('0x23')](saveUpdates(_0xa8733e[_0x989c('0x49')],null))[_0x989c('0x23')](respondWithResult(_0x1fb9d2,null))[_0x989c('0x46')](handleError(_0x1fb9d2,null));};exports[_0x989c('0x25')]=function(_0x15fa8f,_0x171df8){return db[_0x989c('0x2a')]['find']({'where':{'id':_0x15fa8f[_0x989c('0x52')]['id']}})[_0x989c('0x23')](handleEntityNotFound(_0x171df8,null))['then'](removeEntity(_0x171df8,null))[_0x989c('0x46')](handleError(_0x171df8,null));};exports[_0x989c('0x53')]=function(_0x3c8ce1,_0x115d72,_0x16b4d8){return db['Team'][_0x989c('0x54')]({'where':{'id':_0x3c8ce1[_0x989c('0x52')]['id']}})[_0x989c('0x23')](handleEntityNotFound(_0x115d72,null))[_0x989c('0x23')](function(_0x40a70e){if(!_0x3c8ce1['query'][_0x989c('0x55')]||!utils[_0x989c('0x56')](_0x3c8ce1['query'][_0x989c('0x55')])){throw new db[(_0x989c('0x57'))][(_0x989c('0x58'))](_0x989c('0x59'));}var _0x7331e3={};var _0x283165={};_0x283165[_0x989c('0x2f')]=_[_0x989c('0x32')](db[_[_0x989c('0x5a')](_0x3c8ce1[_0x989c('0x31')][_0x989c('0x55')][_0x989c('0x5b')]())+_0x989c('0x5c')][_0x989c('0x2b')]);_0x283165[_0x989c('0x31')]=_[_0x989c('0x32')](_0x3c8ce1[_0x989c('0x31')]);_0x283165[_0x989c('0x33')]=_[_0x989c('0x34')](_0x283165[_0x989c('0x2f')],_0x283165['query']);_0x7331e3[_0x989c('0x36')]=_['intersection'](_0x283165['model'],qs[_0x989c('0x35')](_0x3c8ce1['query'][_0x989c('0x35')]));_0x7331e3[_0x989c('0x36')]=_0x7331e3[_0x989c('0x36')][_0x989c('0x37')]?_0x7331e3[_0x989c('0x36')]:_0x283165[_0x989c('0x2f')];_0x7331e3[_0x989c('0x3a')]=qs['limit'](_0x3c8ce1['query'][_0x989c('0x3a')]);_0x7331e3[_0x989c('0x1f')]=qs['offset'](_0x3c8ce1[_0x989c('0x31')][_0x989c('0x1f')]);_0x7331e3[_0x989c('0x3b')]=qs[_0x989c('0x3c')](_0x3c8ce1['query'][_0x989c('0x3c')]);_0x7331e3['where']=qs['filters'](_[_0x989c('0x5d')](_0x3c8ce1['query'],_0x283165[_0x989c('0x33')]));_0x7331e3=_['merge']({},_0x7331e3,_0x3c8ce1['options']);return _0x40a70e[_0x989c('0x4b')+_['capitalize'](_0x3c8ce1[_0x989c('0x31')][_0x989c('0x55')][_0x989c('0x5b')]())+_0x989c('0x5e')](_0x7331e3);})[_0x989c('0x23')](respondWithResult(_0x115d72,null))[_0x989c('0x46')](handleError(_0x115d72,null));};exports[_0x989c('0x5f')]=function(_0x4d67ee,_0xae9558,_0x2d2f4e){return db[_0x989c('0x2a')][_0x989c('0x54')]({'where':{'id':_0x4d67ee['params']['id']}})[_0x989c('0x23')](function(_0x2030ca){if(_0x2030ca){if(!_0x4d67ee[_0x989c('0x49')][_0x989c('0x55')]||!utils[_0x989c('0x56')](_0x4d67ee[_0x989c('0x49')][_0x989c('0x55')])){throw new db['Sequelize'][(_0x989c('0x58'))](_0x989c('0x59'));}return _0x2030ca[_0x989c('0x60')+_[_0x989c('0x5a')](_0x4d67ee['body']['channel']['toLowerCase']())+_0x989c('0x5e')](_0x4d67ee[_0x989c('0x49')][_0x989c('0x61')]);}return null;})[_0x989c('0x23')](handleEntityNotFound(_0xae9558,null))['then'](respondWithStatusCode(_0xae9558,null))['catch'](handleError(_0xae9558,null));};exports[_0x989c('0x62')]=function(_0x144b10,_0x9f7cc5,_0x429308){return db[_0x989c('0x2a')]['findOne']({'where':{'id':_0x144b10[_0x989c('0x52')]['id']}})['then'](function(_0x503687){if(_0x503687){if(!_0x144b10[_0x989c('0x31')][_0x989c('0x55')]||!utils[_0x989c('0x56')](_0x144b10[_0x989c('0x31')][_0x989c('0x55')])){throw new db['Sequelize'][(_0x989c('0x58'))]('Unknown\x20channel');}return _0x503687[_0x989c('0x63')+_['capitalize'](_0x144b10[_0x989c('0x31')][_0x989c('0x55')][_0x989c('0x5b')]())+_0x989c('0x5e')](_0x144b10['query']['ids']);}return null;})[_0x989c('0x23')](handleEntityNotFound(_0x9f7cc5,null))[_0x989c('0x23')](respondWithStatusCode(_0x9f7cc5,null))[_0x989c('0x46')](handleError(_0x9f7cc5,null));};exports[_0x989c('0x64')]=function(_0x50b647,_0x36e327,_0x26a82e){return db[_0x989c('0x2a')][_0x989c('0x4e')]({'where':{'id':_0x50b647[_0x989c('0x52')]['id']}})[_0x989c('0x23')](handleEntityNotFound(_0x36e327,null))[_0x989c('0x23')](function(_0x3382b6){if(_0x3382b6){var _0x2684cf=[_0x989c('0x65'),_0x989c('0x66'),_0x989c('0x67'),_0x989c('0x68'),_0x989c('0x69'),_0x989c('0x6a'),'Whatsapp'];return BPromise[_0x989c('0x6b')](_0x2684cf,function(_0x3fd65f){return _0x3382b6['get'+_0x3fd65f+_0x989c('0x5e')]({'attributes':['id',_0x989c('0x30')]})[_0x989c('0x23')](function(_0x225977){return BPromise[_0x989c('0x6b')](_0x225977,function(_0x408565){return _0x408565['addAgents'](_0x50b647[_0x989c('0x49')][_0x989c('0x61')])[_0x989c('0x23')](function(){if(_0x3fd65f===_0x989c('0x65')){return db[_0x989c('0x6c')][_0x989c('0x6d')]({'where':{'id':_0x50b647['body'][_0x989c('0x61')]},'attributes':['id',_0x989c('0x30'),_0x989c('0x6e'),_0x989c('0x6f'),_0x989c('0x70')],'raw':!![]})[_0x989c('0x23')](function(_0x409844){return BPromise[_0x989c('0x6b')](_['filter'](_0x409844,{'online':0x1}),function(_0x473d16){return db['UserVoiceQueueRt'][_0x989c('0x71')]({'membername':_0x473d16['name'],'UserId':_0x473d16['id'],'queue_name':_0x408565['name'],'VoiceQueueId':_0x408565['id'],'interface':_['isNil'](_0x473d16[_0x989c('0x70')])?util[_0x989c('0x72')]('SIP/%s',_0x473d16['name']):_0x473d16[_0x989c('0x70')],'paused':_0x473d16[_0x989c('0x6f')]||![],'penalty':0x0});});});}});});})[_0x989c('0x23')](function(){return _0x3382b6;});})[_0x989c('0x23')](function(){return _0x3382b6;});}})['then'](function(_0x52185a){if(_0x52185a){return _0x52185a[_0x989c('0x64')](_0x50b647[_0x989c('0x49')]['ids'],_[_0x989c('0x73')](_0x50b647[_0x989c('0x49')],[_0x989c('0x61'),'id'])||{})['spread'](function(_0x1aaf29){for(var _0x4507e9=0x0;_0x4507e9<_0x50b647[_0x989c('0x49')][_0x989c('0x61')][_0x989c('0x37')];_0x4507e9+=0x1){socket[_0x989c('0x74')](_0x989c('0x75'),{'UserId':_0x50b647[_0x989c('0x49')][_0x989c('0x61')][_0x4507e9],'TeamId':_0x50b647[_0x989c('0x52')]['id']});}return _0x1aaf29;});}})[_0x989c('0x23')](respondWithResult(_0x36e327,null))[_0x989c('0x46')](handleError(_0x36e327,null));};exports[_0x989c('0x76')]=function(_0x4d8e54,_0x42355d,_0x46fc7f){return db[_0x989c('0x2a')][_0x989c('0x4e')]({'where':{'id':_0x4d8e54[_0x989c('0x52')]['id']}})[_0x989c('0x23')](handleEntityNotFound(_0x42355d,null))[_0x989c('0x23')](function(_0xbb2870){if(_0xbb2870){return BPromise[_0x989c('0x6b')](['voice',_0x989c('0x77'),_0x989c('0x78'),_0x989c('0x79'),_0x989c('0x7a'),_0x989c('0x7b'),_0x989c('0x7c')],function(_0x4bd44f){return _0xbb2870[_0x989c('0x4b')+_[_0x989c('0x5a')](_0x4bd44f)+'Queues']({'attributes':['id',_0x989c('0x30')]})[_0x989c('0x23')](function(_0x3467e6){return BPromise['each'](_0x3467e6,function(_0xe11b95){return _0xe11b95[_0x989c('0x76')](_0x4d8e54[_0x989c('0x31')][_0x989c('0x61')])[_0x989c('0x23')](function(){if(_0x4bd44f===_0x989c('0x7d')){return db[_0x989c('0x7e')][_0x989c('0x25')]({'where':{'VoiceQueueId':_0xe11b95['id'],'UserId':_0x4d8e54[_0x989c('0x31')][_0x989c('0x61')]}});}});});})[_0x989c('0x23')](function(){return _0xbb2870;});})[_0x989c('0x23')](function(){return _0xbb2870;});}})[_0x989c('0x23')](function(_0x4f7755){if(_0x4f7755){return _0x4f7755[_0x989c('0x76')](_0x4d8e54[_0x989c('0x31')]['ids'])[_0x989c('0x23')](function(){if(_[_0x989c('0x7f')](_0x4d8e54[_0x989c('0x31')][_0x989c('0x61')])){for(var _0x5ac2b4=0x0;_0x5ac2b4<_0x4d8e54['query'][_0x989c('0x61')]['length'];_0x5ac2b4+=0x1){socket['emit'](_0x989c('0x80'),{'UserId':Number(_0x4d8e54[_0x989c('0x31')]['ids'][_0x5ac2b4]),'TeamId':Number(_0x4d8e54['params']['id'])});}}else{socket[_0x989c('0x74')](_0x989c('0x80'),{'UserId':Number(_0x4d8e54[_0x989c('0x31')]['ids']),'TeamId':Number(_0x4d8e54['params']['id'])});}});}})['then'](respondWithStatusCode(_0x42355d,null))[_0x989c('0x46')](handleError(_0x42355d,null));};exports[_0x989c('0x81')]=function(_0x7a178c,_0x7b6519,_0x17540f){var _0x2b4adb={};var _0x4689ea={};var _0x2775a7;var _0x20bfb3;return db[_0x989c('0x2a')][_0x989c('0x54')]({'where':{'id':_0x7a178c[_0x989c('0x52')]['id']}})['then'](handleEntityNotFound(_0x7b6519,null))[_0x989c('0x23')](function(_0x27a0af){if(_0x27a0af){_0x2775a7=_0x27a0af;_0x4689ea[_0x989c('0x2f')]=_['keys'](db[_0x989c('0x6c')]['rawAttributes']);_0x4689ea[_0x989c('0x31')]=_[_0x989c('0x32')](_0x7a178c[_0x989c('0x31')]);_0x4689ea['filters']=_[_0x989c('0x34')](_0x4689ea[_0x989c('0x2f')],_0x4689ea[_0x989c('0x31')]);_0x2b4adb[_0x989c('0x36')]=_[_0x989c('0x34')](_0x4689ea[_0x989c('0x2f')],qs['fields'](_0x7a178c[_0x989c('0x31')][_0x989c('0x35')]));_0x2b4adb['attributes']=_0x2b4adb[_0x989c('0x36')][_0x989c('0x37')]?_0x2b4adb['attributes']:_0x4689ea[_0x989c('0x2f')];_0x2b4adb[_0x989c('0x3b')]=qs['sort'](_0x7a178c[_0x989c('0x31')][_0x989c('0x3c')]);_0x2b4adb[_0x989c('0x3d')]=qs[_0x989c('0x33')](_[_0x989c('0x5d')](_0x7a178c['query'],_0x4689ea['filters']));if(_0x7a178c['query'][_0x989c('0x3e')]){_0x2b4adb[_0x989c('0x3d')]=_[_0x989c('0x3f')](_0x2b4adb[_0x989c('0x3d')],{'$or':_[_0x989c('0x29')](_0x2b4adb['attributes'],function(_0x4e1e8c){var _0x55f22d={};_0x55f22d[_0x4e1e8c]={'$like':'%'+_0x7a178c[_0x989c('0x31')]['filter']+'%'};return _0x55f22d;})});}_0x2b4adb=_[_0x989c('0x3f')]({},_0x2b4adb,_0x7a178c[_0x989c('0x41')]);return _0x2775a7[_0x989c('0x81')](_0x2b4adb);}})[_0x989c('0x23')](function(_0x3fc594){if(_0x3fc594){_0x20bfb3=_0x3fc594[_0x989c('0x37')];if(!_0x7a178c[_0x989c('0x31')][_0x989c('0x38')]('nolimit')){_0x2b4adb[_0x989c('0x3a')]=qs['limit'](_0x7a178c[_0x989c('0x31')][_0x989c('0x3a')]);_0x2b4adb[_0x989c('0x1f')]=qs['offset'](_0x7a178c[_0x989c('0x31')][_0x989c('0x1f')]);}return _0x2775a7[_0x989c('0x81')](_0x2b4adb);}})[_0x989c('0x23')](function(_0x3ba5c6){if(_0x3ba5c6){return _0x3ba5c6?{'count':_0x20bfb3,'rows':_0x3ba5c6}:null;}})[_0x989c('0x23')](respondWithResult(_0x7b6519,null))[_0x989c('0x46')](handleError(_0x7b6519,null));};
\ No newline at end of file
diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js
index 13b48f7..1e7275f 100644
--- a/server/api/team/team.events.js
+++ b/server/api/team/team.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdfd5=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x5f2edf,_0x5cb8fb){var _0x546962=function(_0x1ca619){while(--_0x1ca619){_0x5f2edf['push'](_0x5f2edf['shift']());}};_0x546962(++_0x5cb8fb);}(_0xdfd5,0x1ee));var _0x5dfd=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xdfd5[_0x51c819];return _0x15c5d2;};'use strict';var EventEmitter=require(_0x5dfd('0x0'));var Team=require(_0x5dfd('0x1'))['db'][_0x5dfd('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x5dfd('0x3')](0x0);var events={'afterCreate':_0x5dfd('0x4'),'afterUpdate':_0x5dfd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x430b23){return function(_0x23519e,_0x5b6b8e,_0x5a8abf){TeamEvents[_0x5dfd('0x6')](_0x430b23+':'+_0x23519e['id'],_0x23519e);TeamEvents[_0x5dfd('0x6')](_0x430b23,_0x23519e);_0x5a8abf(null);};}for(var e in events){if(events[_0x5dfd('0x7')](e)){var event=events[e];Team[_0x5dfd('0x8')](e,emitEvent(event));}}module[_0x5dfd('0x9')]=TeamEvents;
\ No newline at end of file
+var _0xdf6a=['hook','exports','Team','setMaxListeners','save','emit'];(function(_0x17ab13,_0x20dfb8){var _0x2498dd=function(_0x31e799){while(--_0x31e799){_0x17ab13['push'](_0x17ab13['shift']());}};_0x2498dd(++_0x20dfb8);}(_0xdf6a,0x68));var _0xadf6=function(_0x53773e,_0x64b483){_0x53773e=_0x53773e-0x0;var _0x3ce7b3=_0xdf6a[_0x53773e];return _0x3ce7b3;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0xadf6('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0xadf6('0x1')](0x0);var events={'afterCreate':_0xadf6('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x42583f){return function(_0x3fa7c5,_0x3d5227,_0x1ba3b8){TeamEvents[_0xadf6('0x3')](_0x42583f+':'+_0x3fa7c5['id'],_0x3fa7c5);TeamEvents[_0xadf6('0x3')](_0x42583f,_0x3fa7c5);_0x1ba3b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xadf6('0x4')](e,emitEvent(event));}}module[_0xadf6('0x5')]=TeamEvents;
\ No newline at end of file
diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js
index 178da3d..3ec3bfb 100644
--- a/server/api/team/team.model.js
+++ b/server/api/team/team.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcefd=['Team','teams','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x358fb5,_0x4407b8){var _0x4abfeb=function(_0x55c45d){while(--_0x55c45d){_0x358fb5['push'](_0x358fb5['shift']());}};_0x4abfeb(++_0x4407b8);}(_0xcefd,0x120));var _0xdcef=function(_0x43a12f,_0x3d0108){_0x43a12f=_0x43a12f-0x0;var _0x36994d=_0xcefd[_0x43a12f];return _0x36994d;};'use strict';var _=require(_0xdcef('0x0'));var util=require(_0xdcef('0x1'));var logger=require('../../config/logger')(_0xdcef('0x2'));var moment=require(_0xdcef('0x3'));var BPromise=require(_0xdcef('0x4'));var rp=require(_0xdcef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdcef('0x6'));var config=require(_0xdcef('0x7'));var attributes=require('./team.attributes');module[_0xdcef('0x8')]=function(_0x1caa2b,_0x241e13){return _0x1caa2b['define'](_0xdcef('0x9'),attributes,{'tableName':_0xdcef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8901=['exports','define','teams','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./team.attributes'];(function(_0x4bdc76,_0x45445a){var _0x5c9298=function(_0x25393a){while(--_0x25393a){_0x4bdc76['push'](_0x4bdc76['shift']());}};_0x5c9298(++_0x45445a);}(_0x8901,0x123));var _0x1890=function(_0x15cc1c,_0x3e8a24){_0x15cc1c=_0x15cc1c-0x0;var _0x56bc3b=_0x8901[_0x15cc1c];return _0x56bc3b;};'use strict';var _=require(_0x1890('0x0'));var util=require(_0x1890('0x1'));var logger=require(_0x1890('0x2'))(_0x1890('0x3'));var moment=require('moment');var BPromise=require(_0x1890('0x4'));var rp=require(_0x1890('0x5'));var fs=require('fs');var path=require(_0x1890('0x6'));var rimraf=require('rimraf');var config=require(_0x1890('0x7'));var attributes=require(_0x1890('0x8'));module[_0x1890('0x9')]=function(_0x3c725d,_0x389fa6){return _0x3c725d[_0x1890('0xa')]('Team',attributes,{'tableName':_0x1890('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js
index 371395f..eb5fe4e 100644
--- a/server/api/team/team.rpc.js
+++ b/server/api/team/team.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebd6=['localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x590b61,_0x4c4335){var _0x1a14dc=function(_0x2ff4f6){while(--_0x2ff4f6){_0x590b61['push'](_0x590b61['shift']());}};_0x1a14dc(++_0x4c4335);}(_0xebd6,0x1d1));var _0x6ebd=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xebd6[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6ebd('0x0'));var rs=require(_0x6ebd('0x1'));var fs=require('fs');var Redis=require(_0x6ebd('0x2'));var db=require(_0x6ebd('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6ebd('0x4'));var jayson=require(_0x6ebd('0x5'));var client=jayson[_0x6ebd('0x6')][_0x6ebd('0x7')]({'port':0x232a});config[_0x6ebd('0x8')]=_[_0x6ebd('0x9')](config[_0x6ebd('0x8')],{'host':_0x6ebd('0xa'),'port':0x18eb});var socket=require(_0x6ebd('0xb'))(new Redis(config[_0x6ebd('0x8')]));require(_0x6ebd('0xc'))[_0x6ebd('0xd')](socket);function respondWithRpcPromise(_0x272ee4,_0x17c97f,_0x2d7c86){return new BPromise(function(_0x385d6e,_0x3a0952){return client[_0x6ebd('0xe')](_0x272ee4,_0x2d7c86)[_0x6ebd('0xf')](function(_0x217cf9){logger[_0x6ebd('0x10')](_0x6ebd('0x11'),_0x17c97f,_0x6ebd('0x12'));logger[_0x6ebd('0x13')](_0x6ebd('0x14'),_0x17c97f,_0x6ebd('0x12'),JSON['stringify'](_0x217cf9));if(_0x217cf9['error']){if(_0x217cf9['error']['code']===0x1f4){logger[_0x6ebd('0x15')](_0x6ebd('0x11'),_0x17c97f,_0x217cf9[_0x6ebd('0x15')][_0x6ebd('0x16')]);return _0x3a0952(_0x217cf9[_0x6ebd('0x15')][_0x6ebd('0x16')]);}logger['error'](_0x6ebd('0x11'),_0x17c97f,_0x217cf9[_0x6ebd('0x15')][_0x6ebd('0x16')]);return _0x385d6e(_0x217cf9[_0x6ebd('0x15')][_0x6ebd('0x16')]);}else{logger['info'](_0x6ebd('0x11'),_0x17c97f,_0x6ebd('0x12'));_0x385d6e(_0x217cf9[_0x6ebd('0x17')]['message']);}})[_0x6ebd('0x18')](function(_0x474b0b){logger[_0x6ebd('0x15')](_0x6ebd('0x11'),_0x17c97f,_0x474b0b);_0x3a0952(_0x474b0b);});});}
\ No newline at end of file
+var _0x28a8=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x360558,_0x419a1c){var _0x1f789e=function(_0x43ed05){while(--_0x43ed05){_0x360558['push'](_0x360558['shift']());}};_0x1f789e(++_0x419a1c);}(_0x28a8,0xc6));var _0x828a=function(_0x723288,_0x361804){_0x723288=_0x723288-0x0;var _0x45fecf=_0x28a8[_0x723288];return _0x45fecf;};'use strict';var _=require('lodash');var util=require(_0x828a('0x0'));var moment=require(_0x828a('0x1'));var BPromise=require(_0x828a('0x2'));var rs=require(_0x828a('0x3'));var fs=require('fs');var Redis=require(_0x828a('0x4'));var db=require(_0x828a('0x5'))['db'];var utils=require(_0x828a('0x6'));var logger=require(_0x828a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x828a('0x8')][_0x828a('0x9')]({'port':0x232a});config[_0x828a('0xa')]=_[_0x828a('0xb')](config[_0x828a('0xa')],{'host':_0x828a('0xc'),'port':0x18eb});var socket=require(_0x828a('0xd'))(new Redis(config['redis']));require(_0x828a('0xe'))[_0x828a('0xf')](socket);function respondWithRpcPromise(_0x1a6107,_0x2579f6,_0x24dc76){return new BPromise(function(_0x5154bc,_0x35f059){return client[_0x828a('0x10')](_0x1a6107,_0x24dc76)[_0x828a('0x11')](function(_0x3e61c4){logger[_0x828a('0x12')](_0x828a('0x13'),_0x2579f6,_0x828a('0x14'));logger['debug'](_0x828a('0x15'),_0x2579f6,'request\x20sent',JSON[_0x828a('0x16')](_0x3e61c4));if(_0x3e61c4[_0x828a('0x17')]){if(_0x3e61c4[_0x828a('0x17')][_0x828a('0x18')]===0x1f4){logger['error'](_0x828a('0x13'),_0x2579f6,_0x3e61c4['error']['message']);return _0x35f059(_0x3e61c4[_0x828a('0x17')][_0x828a('0x19')]);}logger['error'](_0x828a('0x13'),_0x2579f6,_0x3e61c4[_0x828a('0x17')][_0x828a('0x19')]);return _0x5154bc(_0x3e61c4[_0x828a('0x17')]['message']);}else{logger[_0x828a('0x12')]('Team,\x20%s,\x20%s',_0x2579f6,_0x828a('0x14'));_0x5154bc(_0x3e61c4[_0x828a('0x1a')][_0x828a('0x19')]);}})[_0x828a('0x1b')](function(_0x43eb1e){logger['error']('Team,\x20%s,\x20%s',_0x2579f6,_0x43eb1e);_0x35f059(_0x43eb1e);});});}
\ No newline at end of file
diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js
index 0cab2c8..28f34fa 100644
--- a/server/api/team/team.socket.js
+++ b/server/api/team/team.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ace=['emit','removeListener','register','length','./team.events','save','remove','update'];(function(_0x3efa94,_0x3530c2){var _0x3363f8=function(_0x5178bc){while(--_0x5178bc){_0x3efa94['push'](_0x3efa94['shift']());}};_0x3363f8(++_0x3530c2);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x12ed67,_0x1a5083){_0x12ed67=_0x12ed67-0x0;var _0x197263=_0x8ace[_0x12ed67];return _0x197263;};'use strict';var TeamEvents=require(_0xe8ac('0x0'));var events=[_0xe8ac('0x1'),_0xe8ac('0x2'),_0xe8ac('0x3')];function createListener(_0x3896f9,_0x142625){return function(_0x2dd17e){_0x142625[_0xe8ac('0x4')](_0x3896f9,_0x2dd17e);};}function removeListener(_0x114351,_0xf6af00){return function(){TeamEvents[_0xe8ac('0x5')](_0x114351,_0xf6af00);};}exports[_0xe8ac('0x6')]=function(_0x170e14){for(var _0x2b48ec=0x0,_0x4eb087=events[_0xe8ac('0x7')];_0x2b48ec<_0x4eb087;_0x2b48ec++){var _0x1357ed=events[_0x2b48ec];var _0x4f9233=createListener('team:'+_0x1357ed,_0x170e14);TeamEvents['on'](_0x1357ed,_0x4f9233);}};
\ No newline at end of file
+var _0x6822=['save','remove','update','emit','removeListener','team:','./team.events'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x6822,0xca));var _0x2682=function(_0x11726c,_0x1235f0){_0x11726c=_0x11726c-0x0;var _0x11e3fc=_0x6822[_0x11726c];return _0x11e3fc;};'use strict';var TeamEvents=require(_0x2682('0x0'));var events=[_0x2682('0x1'),_0x2682('0x2'),_0x2682('0x3')];function createListener(_0x3f1772,_0x3dd710){return function(_0x297e73){_0x3dd710[_0x2682('0x4')](_0x3f1772,_0x297e73);};}function removeListener(_0xff78d8,_0x521b6b){return function(){TeamEvents[_0x2682('0x5')](_0xff78d8,_0x521b6b);};}exports['register']=function(_0x30fcd9){for(var _0x39d4f7=0x0,_0x45e895=events['length'];_0x39d4f7<_0x45e895;_0x39d4f7++){var _0x5bfb13=events[_0x39d4f7];var _0x582d30=createListener(_0x2682('0x6')+_0x5bfb13,_0x30fcd9);TeamEvents['on'](_0x5bfb13,_0x582d30);}};
\ No newline at end of file
diff --git a/server/api/template/index.js b/server/api/template/index.js
index 0e97602..0b4cb0e 100644
--- a/server/api/template/index.js
+++ b/server/api/template/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c2e=['index','get','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x8c2e,0x1d6));var _0xe8c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c2e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe8c2('0x0'));var util=require('util');var path=require(_0xe8c2('0x1'));var timeout=require(_0xe8c2('0x2'));var express=require(_0xe8c2('0x3'));var router=express[_0xe8c2('0x4')]();var auth=require(_0xe8c2('0x5'));var interaction=require(_0xe8c2('0x6'));var config=require(_0xe8c2('0x7'));var controller=require(_0xe8c2('0x8'));router['get']('/',auth[_0xe8c2('0x9')](),controller[_0xe8c2('0xa')]);router[_0xe8c2('0xb')](_0xe8c2('0xc'),auth[_0xe8c2('0x9')](),controller[_0xe8c2('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe8c2('0xe')]);router[_0xe8c2('0xf')]('/:id',auth[_0xe8c2('0x9')](),controller[_0xe8c2('0x10')]);router[_0xe8c2('0x11')](_0xe8c2('0xc'),auth[_0xe8c2('0x9')](),controller[_0xe8c2('0x12')]);module[_0xe8c2('0x13')]=router;
\ No newline at end of file
+var _0x61a9=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete'];(function(_0x474972,_0xed4278){var _0x356929=function(_0x1189a0){while(--_0x1189a0){_0x474972['push'](_0x474972['shift']());}};_0x356929(++_0xed4278);}(_0x61a9,0x145));var _0x961a=function(_0x34818a,_0x295495){_0x34818a=_0x34818a-0x0;var _0x9bdbe5=_0x61a9[_0x34818a];return _0x9bdbe5;};'use strict';var multer=require(_0x961a('0x0'));var util=require(_0x961a('0x1'));var path=require('path');var timeout=require(_0x961a('0x2'));var express=require(_0x961a('0x3'));var router=express[_0x961a('0x4')]();var auth=require(_0x961a('0x5'));var interaction=require(_0x961a('0x6'));var config=require(_0x961a('0x7'));var controller=require('./template.controller');router[_0x961a('0x8')]('/',auth[_0x961a('0x9')](),controller[_0x961a('0xa')]);router['get'](_0x961a('0xb'),auth[_0x961a('0x9')](),controller[_0x961a('0xc')]);router[_0x961a('0xd')]('/',auth[_0x961a('0x9')](),controller[_0x961a('0xe')]);router[_0x961a('0xf')]('/:id',auth[_0x961a('0x9')](),controller['update']);router[_0x961a('0x10')](_0x961a('0xb'),auth[_0x961a('0x9')](),controller['destroy']);module[_0x961a('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js
index 7a0b4a4..a31bbae 100644
--- a/server/api/template/template.attributes.js
+++ b/server/api/template/template.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8116=['sequelize','exports','STRING','TEXT'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x8116,0x1ec));var _0x6811=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8116[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x6811('0x0'));module[_0x6811('0x1')]={'name':{'type':Sequelize[_0x6811('0x2')]},'description':{'type':Sequelize[_0x6811('0x2')]},'html':{'type':Sequelize[_0x6811('0x3')]}};
\ No newline at end of file
+var _0x8ea4=['sequelize','STRING'];(function(_0xc9eaca,_0x5d2183){var _0x1ac519=function(_0xbfae37){while(--_0xbfae37){_0xc9eaca['push'](_0xc9eaca['shift']());}};_0x1ac519(++_0x5d2183);}(_0x8ea4,0x1d2));var _0x48ea=function(_0x21b74b,_0x543c76){_0x21b74b=_0x21b74b-0x0;var _0x518cc6=_0x8ea4[_0x21b74b];return _0x518cc6;};'use strict';var Sequelize=require(_0x48ea('0x0'));module['exports']={'name':{'type':Sequelize[_0x48ea('0x1')]},'description':{'type':Sequelize[_0x48ea('0x1')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js
index 07be150..94fa818 100644
--- a/server/api/template/template.controller.js
+++ b/server/api/template/template.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdc4b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','include','findAll','rows','show','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse'];(function(_0x43f097,_0x39e6f6){var _0x374992=function(_0x578d56){while(--_0x578d56){_0x43f097['push'](_0x43f097['shift']());}};_0x374992(++_0x39e6f6);}(_0xdc4b,0x194));var _0xbdc4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdc4b[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0xbdc4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbdc4('0x1'));var zipdir=require(_0xbdc4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbdc4('0x3'));var moment=require(_0xbdc4('0x4'));var BPromise=require(_0xbdc4('0x5'));var Mustache=require(_0xbdc4('0x6'));var util=require(_0xbdc4('0x7'));var path=require('path');var sox=require(_0xbdc4('0x8'));var csv=require('to-csv');var ejs=require(_0xbdc4('0x9'));var fs=require('fs');var _=require(_0xbdc4('0xa'));var squel=require(_0xbdc4('0xb'));var crypto=require(_0xbdc4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbdc4('0xd'));var querystring=require(_0xbdc4('0xe'));var Papa=require(_0xbdc4('0xf'));var Redis=require(_0xbdc4('0x10'));var authService=require(_0xbdc4('0x11'));var qs=require(_0xbdc4('0x12'));var as=require(_0xbdc4('0x13'));var hardwareService=require(_0xbdc4('0x14'));var logger=require(_0xbdc4('0x15'))(_0xbdc4('0x16'));var utils=require('../../config/utils');var config=require(_0xbdc4('0x17'));var db=require(_0xbdc4('0x18'))['db'];function respondWithStatusCode(_0x205799,_0x5a4966){_0x5a4966=_0x5a4966||0xcc;return function(_0x515eeb){if(_0x515eeb){return _0x205799[_0xbdc4('0x19')](_0x5a4966);}return _0x205799[_0xbdc4('0x1a')](_0x5a4966)[_0xbdc4('0x1b')]();};}function respondWithResult(_0x47fdc0,_0x133edb){_0x133edb=_0x133edb||0xc8;return function(_0x4b1e0a){if(_0x4b1e0a){return _0x47fdc0[_0xbdc4('0x1a')](_0x133edb)[_0xbdc4('0x1c')](_0x4b1e0a);}};}function respondWithFilteredResult(_0x2b4df9,_0x2a1a69){return function(_0xffffa2){if(_0xffffa2){var _0x1ff73=_0xffffa2[_0xbdc4('0x1d')],_0x35b8cc=_0x2a1a69[_0xbdc4('0x1e')],_0x1d1fb4=_0x2a1a69['offset']+_0x2a1a69[_0xbdc4('0x1f')],_0x140fa5;if(_0x1d1fb4>=_0x1ff73){_0x1d1fb4=_0x1ff73;_0x140fa5=0xc8;}else{_0x140fa5=0xce;}_0x2b4df9[_0xbdc4('0x1a')](_0x140fa5);return _0x2b4df9['set'](_0xbdc4('0x20'),_0x35b8cc+'-'+_0x1d1fb4+'/'+_0x1ff73)[_0xbdc4('0x1c')](_0xffffa2);}return null;};}function patchUpdates(_0x4b0e67){return function(_0x2dc2a8){try{jsonpatch['apply'](_0x2dc2a8,_0x4b0e67,!![]);}catch(_0x32cbe9){return BPromise[_0xbdc4('0x21')](_0x32cbe9);}return _0x2dc2a8[_0xbdc4('0x22')]();};}function saveUpdates(_0x5ec6b5,_0x1951f6){return function(_0x5bc2e2){if(_0x5bc2e2){return _0x5bc2e2[_0xbdc4('0x23')](_0x5ec6b5)[_0xbdc4('0x24')](function(_0x33f066){return _0x33f066;});}return null;};}function removeEntity(_0x462e3e,_0x150974){return function(_0x113e2b){if(_0x113e2b){return _0x113e2b[_0xbdc4('0x25')]()[_0xbdc4('0x24')](function(){var _0x2e2d59=_0x113e2b[_0xbdc4('0x26')]({'plain':!![]});var _0x241d9c=_0xbdc4('0x27');return db[_0xbdc4('0x28')][_0xbdc4('0x25')]({'where':{'type':_0x241d9c,'resourceId':_0x2e2d59['id']}})[_0xbdc4('0x24')](function(){return _0x113e2b;});})[_0xbdc4('0x24')](function(){_0x462e3e[_0xbdc4('0x1a')](0xcc)[_0xbdc4('0x1b')]();});}};}function handleEntityNotFound(_0x4209bc,_0x82a50f){return function(_0x43887a){if(!_0x43887a){_0x4209bc[_0xbdc4('0x19')](0x194);}return _0x43887a;};}function handleError(_0x24fd66,_0x45831c){_0x45831c=_0x45831c||0x1f4;return function(_0x3e12c8){logger[_0xbdc4('0x29')](_0x3e12c8[_0xbdc4('0x2a')]);if(_0x3e12c8[_0xbdc4('0x2b')]){delete _0x3e12c8[_0xbdc4('0x2b')];}_0x24fd66['status'](_0x45831c)[_0xbdc4('0x2c')](_0x3e12c8);};}exports[_0xbdc4('0x2d')]=function(_0x22b927,_0x5e51f2){var _0x2b9ebe={},_0x386ecb={},_0x4ac284={'count':0x0,'rows':[]};var _0x250d84=_[_0xbdc4('0x2e')](db[_0xbdc4('0x2f')][_0xbdc4('0x30')],function(_0x798991){return{'name':_0x798991[_0xbdc4('0x31')],'type':_0x798991[_0xbdc4('0x32')]['key']};});_0x386ecb[_0xbdc4('0x33')]=_[_0xbdc4('0x2e')](_0x250d84,_0xbdc4('0x2b'));_0x386ecb[_0xbdc4('0x34')]=_[_0xbdc4('0x35')](_0x22b927[_0xbdc4('0x34')]);_0x386ecb['filters']=_['intersection'](_0x386ecb[_0xbdc4('0x33')],_0x386ecb[_0xbdc4('0x34')]);_0x2b9ebe[_0xbdc4('0x36')]=_[_0xbdc4('0x37')](_0x386ecb[_0xbdc4('0x33')],qs[_0xbdc4('0x38')](_0x22b927[_0xbdc4('0x34')][_0xbdc4('0x38')]));_0x2b9ebe['attributes']=_0x2b9ebe['attributes'][_0xbdc4('0x39')]?_0x2b9ebe[_0xbdc4('0x36')]:_0x386ecb['model'];if(!_0x22b927[_0xbdc4('0x34')][_0xbdc4('0x3a')](_0xbdc4('0x3b'))){_0x2b9ebe[_0xbdc4('0x1f')]=qs[_0xbdc4('0x1f')](_0x22b927['query']['limit']);_0x2b9ebe[_0xbdc4('0x1e')]=qs[_0xbdc4('0x1e')](_0x22b927['query'][_0xbdc4('0x1e')]);}_0x2b9ebe[_0xbdc4('0x3c')]=qs[_0xbdc4('0x3d')](_0x22b927[_0xbdc4('0x34')][_0xbdc4('0x3d')]);_0x2b9ebe[_0xbdc4('0x3e')]=qs[_0xbdc4('0x3f')](_['pick'](_0x22b927[_0xbdc4('0x34')],_0x386ecb[_0xbdc4('0x3f')]),_0x250d84);if(_0x22b927[_0xbdc4('0x34')]['filter']){_0x2b9ebe['where']=_[_0xbdc4('0x40')](_0x2b9ebe[_0xbdc4('0x3e')],{'$or':_[_0xbdc4('0x2e')](_0x250d84,function(_0x42efa8){if(_0x42efa8[_0xbdc4('0x32')]!==_0xbdc4('0x41')){var _0x3ac5a5={};_0x3ac5a5[_0x42efa8[_0xbdc4('0x2b')]]={'$like':'%'+_0x22b927[_0xbdc4('0x34')][_0xbdc4('0x42')]+'%'};return _0x3ac5a5;}})});}_0x2b9ebe=_[_0xbdc4('0x40')]({},_0x2b9ebe,_0x22b927['options']);var _0x3a5a9c={'where':_0x2b9ebe['where']};return db[_0xbdc4('0x2f')][_0xbdc4('0x1d')](_0x3a5a9c)[_0xbdc4('0x24')](function(_0x416acb){_0x4ac284[_0xbdc4('0x1d')]=_0x416acb;if(_0x22b927[_0xbdc4('0x34')]['includeAll']){_0x2b9ebe[_0xbdc4('0x43')]=[{'all':!![]}];}return db[_0xbdc4('0x2f')][_0xbdc4('0x44')](_0x2b9ebe);})[_0xbdc4('0x24')](function(_0x59b188){_0x4ac284[_0xbdc4('0x45')]=_0x59b188;return _0x4ac284;})['then'](respondWithFilteredResult(_0x5e51f2,_0x2b9ebe))['catch'](handleError(_0x5e51f2,null));};exports[_0xbdc4('0x46')]=function(_0x3d7682,_0x371c36){var _0x2b5ff2={'raw':!![],'where':{'id':_0x3d7682['params']['id']}},_0x13e98a={};_0x13e98a[_0xbdc4('0x33')]=_[_0xbdc4('0x35')](db[_0xbdc4('0x2f')][_0xbdc4('0x30')]);_0x13e98a[_0xbdc4('0x34')]=_[_0xbdc4('0x35')](_0x3d7682[_0xbdc4('0x34')]);_0x13e98a[_0xbdc4('0x3f')]=_['intersection'](_0x13e98a[_0xbdc4('0x33')],_0x13e98a[_0xbdc4('0x34')]);_0x2b5ff2[_0xbdc4('0x36')]=_[_0xbdc4('0x37')](_0x13e98a[_0xbdc4('0x33')],qs[_0xbdc4('0x38')](_0x3d7682[_0xbdc4('0x34')]['fields']));_0x2b5ff2[_0xbdc4('0x36')]=_0x2b5ff2[_0xbdc4('0x36')]['length']?_0x2b5ff2[_0xbdc4('0x36')]:_0x13e98a[_0xbdc4('0x33')];if(_0x3d7682[_0xbdc4('0x34')][_0xbdc4('0x47')]){_0x2b5ff2[_0xbdc4('0x43')]=[{'all':!![]}];}_0x2b5ff2=_[_0xbdc4('0x40')]({},_0x2b5ff2,_0x3d7682[_0xbdc4('0x48')]);return db['Template'][_0xbdc4('0x49')](_0x2b5ff2)[_0xbdc4('0x24')](handleEntityNotFound(_0x371c36,null))['then'](respondWithResult(_0x371c36,null))['catch'](handleError(_0x371c36,null));};exports[_0xbdc4('0x4a')]=function(_0x1d63a1,_0x35c80b){return db['Template'][_0xbdc4('0x4a')](_0x1d63a1['body'],{})[_0xbdc4('0x24')](function(_0x479e54){var _0x486d55=_0x1d63a1[_0xbdc4('0x4b')][_0xbdc4('0x26')]({'plain':!![]});if(!_0x486d55)throw new Error(_0xbdc4('0x4c'));if(_0x486d55[_0xbdc4('0x4d')]==='user'){var _0x54fd63=_0x479e54['get']({'plain':!![]});var _0x1e5538='Templates';return db[_0xbdc4('0x4e')][_0xbdc4('0x49')]({'where':{'name':_0x1e5538,'userProfileId':_0x486d55[_0xbdc4('0x4f')]},'raw':!![]})['then'](function(_0x3bbd8c){if(_0x3bbd8c&&_0x3bbd8c[_0xbdc4('0x50')]===0x0){return db[_0xbdc4('0x28')][_0xbdc4('0x4a')]({'name':_0x54fd63[_0xbdc4('0x2b')],'resourceId':_0x54fd63['id'],'type':_0x3bbd8c['name'],'sectionId':_0x3bbd8c['id']},{})[_0xbdc4('0x24')](function(){return _0x479e54;});}else{return _0x479e54;}})['catch'](function(_0x47ede5){logger[_0xbdc4('0x29')](_0xbdc4('0x51'),_0x47ede5);throw _0x47ede5;});}return _0x479e54;})['then'](respondWithResult(_0x35c80b,0xc9))[_0xbdc4('0x52')](handleError(_0x35c80b,null));};exports['update']=function(_0x5259ef,_0x1b7744){if(_0x5259ef['body']['id']){delete _0x5259ef['body']['id'];}return db[_0xbdc4('0x2f')][_0xbdc4('0x49')]({'where':{'id':_0x5259ef[_0xbdc4('0x53')]['id']}})[_0xbdc4('0x24')](handleEntityNotFound(_0x1b7744,null))['then'](saveUpdates(_0x5259ef['body'],null))['then'](respondWithResult(_0x1b7744,null))[_0xbdc4('0x52')](handleError(_0x1b7744,null));};exports[_0xbdc4('0x25')]=function(_0x3a6e82,_0xa8c2ac){return db[_0xbdc4('0x2f')][_0xbdc4('0x49')]({'where':{'id':_0x3a6e82[_0xbdc4('0x53')]['id']}})['then'](handleEntityNotFound(_0xa8c2ac,null))[_0xbdc4('0x24')](removeEntity(_0xa8c2ac,null))[_0xbdc4('0x52')](handleError(_0xa8c2ac,null));};
\ No newline at end of file
+var _0x41da=['autoAssociation','catch','params','destroy','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','end','error','stack','name','send','Template','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','show','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','userProfileId'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x41da,0x14c));var _0xa41d=function(_0x45c536,_0x52a556){_0x45c536=_0x45c536-0x0;var _0x10e06d=_0x41da[_0x45c536];return _0x10e06d;};'use strict';var pdf=require(_0xa41d('0x0'));var emlformat=require(_0xa41d('0x1'));var rimraf=require(_0xa41d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa41d('0x3'));var BPromise=require(_0xa41d('0x4'));var Mustache=require(_0xa41d('0x5'));var util=require(_0xa41d('0x6'));var path=require(_0xa41d('0x7'));var sox=require(_0xa41d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa41d('0x9'));var squel=require(_0xa41d('0xa'));var crypto=require('crypto');var jsforce=require(_0xa41d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa41d('0xc'));var querystring=require(_0xa41d('0xd'));var Papa=require(_0xa41d('0xe'));var Redis=require(_0xa41d('0xf'));var authService=require(_0xa41d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa41d('0x11'));var hardwareService=require(_0xa41d('0x12'));var logger=require(_0xa41d('0x13'))(_0xa41d('0x14'));var utils=require(_0xa41d('0x15'));var config=require(_0xa41d('0x16'));var db=require(_0xa41d('0x17'))['db'];function respondWithStatusCode(_0xda94a2,_0x406f07){_0x406f07=_0x406f07||0xcc;return function(_0x500b22){if(_0x500b22){return _0xda94a2[_0xa41d('0x18')](_0x406f07);}return _0xda94a2[_0xa41d('0x19')](_0x406f07)['end']();};}function respondWithResult(_0x1fd45c,_0x3d7167){_0x3d7167=_0x3d7167||0xc8;return function(_0x2578c8){if(_0x2578c8){return _0x1fd45c[_0xa41d('0x19')](_0x3d7167)[_0xa41d('0x1a')](_0x2578c8);}};}function respondWithFilteredResult(_0x147b00,_0x210d4d){return function(_0x5ee8a8){if(_0x5ee8a8){var _0x4c8414=_0x5ee8a8[_0xa41d('0x1b')],_0x527c7b=_0x210d4d[_0xa41d('0x1c')],_0x5081b0=_0x210d4d['offset']+_0x210d4d[_0xa41d('0x1d')],_0x292833;if(_0x5081b0>=_0x4c8414){_0x5081b0=_0x4c8414;_0x292833=0xc8;}else{_0x292833=0xce;}_0x147b00[_0xa41d('0x19')](_0x292833);return _0x147b00[_0xa41d('0x1e')](_0xa41d('0x1f'),_0x527c7b+'-'+_0x5081b0+'/'+_0x4c8414)[_0xa41d('0x1a')](_0x5ee8a8);}return null;};}function patchUpdates(_0x2d8072){return function(_0x1ce9a6){try{jsonpatch[_0xa41d('0x20')](_0x1ce9a6,_0x2d8072,!![]);}catch(_0x557ba9){return BPromise[_0xa41d('0x21')](_0x557ba9);}return _0x1ce9a6[_0xa41d('0x22')]();};}function saveUpdates(_0x2d1a34,_0x1280c3){return function(_0x53525d){if(_0x53525d){return _0x53525d[_0xa41d('0x23')](_0x2d1a34)[_0xa41d('0x24')](function(_0x3217c1){return _0x3217c1;});}return null;};}function removeEntity(_0x5f2212,_0x2bf845){return function(_0x2d0efe){if(_0x2d0efe){return _0x2d0efe['destroy']()[_0xa41d('0x24')](function(){var _0x500537=_0x2d0efe[_0xa41d('0x25')]({'plain':!![]});var _0x5a9af0='Templates';return db[_0xa41d('0x26')]['destroy']({'where':{'type':_0x5a9af0,'resourceId':_0x500537['id']}})['then'](function(){return _0x2d0efe;});})[_0xa41d('0x24')](function(){_0x5f2212[_0xa41d('0x19')](0xcc)[_0xa41d('0x27')]();});}};}function handleEntityNotFound(_0x53458a,_0x41835d){return function(_0xa82ccc){if(!_0xa82ccc){_0x53458a[_0xa41d('0x18')](0x194);}return _0xa82ccc;};}function handleError(_0x46536f,_0x5c1104){_0x5c1104=_0x5c1104||0x1f4;return function(_0x2c0537){logger[_0xa41d('0x28')](_0x2c0537[_0xa41d('0x29')]);if(_0x2c0537[_0xa41d('0x2a')]){delete _0x2c0537[_0xa41d('0x2a')];}_0x46536f[_0xa41d('0x19')](_0x5c1104)[_0xa41d('0x2b')](_0x2c0537);};}exports['index']=function(_0x5bc82d,_0x34282a){var _0x4cfbe6={},_0x876387={},_0x25bda1={'count':0x0,'rows':[]};var _0x4ed16a=_['map'](db[_0xa41d('0x2c')][_0xa41d('0x2d')],function(_0x304bce){return{'name':_0x304bce['fieldName'],'type':_0x304bce[_0xa41d('0x2e')][_0xa41d('0x2f')]};});_0x876387[_0xa41d('0x30')]=_['map'](_0x4ed16a,_0xa41d('0x2a'));_0x876387[_0xa41d('0x31')]=_[_0xa41d('0x32')](_0x5bc82d['query']);_0x876387[_0xa41d('0x33')]=_[_0xa41d('0x34')](_0x876387[_0xa41d('0x30')],_0x876387['query']);_0x4cfbe6['attributes']=_[_0xa41d('0x34')](_0x876387['model'],qs[_0xa41d('0x35')](_0x5bc82d[_0xa41d('0x31')][_0xa41d('0x35')]));_0x4cfbe6[_0xa41d('0x36')]=_0x4cfbe6[_0xa41d('0x36')]['length']?_0x4cfbe6[_0xa41d('0x36')]:_0x876387[_0xa41d('0x30')];if(!_0x5bc82d[_0xa41d('0x31')][_0xa41d('0x37')](_0xa41d('0x38'))){_0x4cfbe6[_0xa41d('0x1d')]=qs['limit'](_0x5bc82d[_0xa41d('0x31')][_0xa41d('0x1d')]);_0x4cfbe6['offset']=qs[_0xa41d('0x1c')](_0x5bc82d[_0xa41d('0x31')]['offset']);}_0x4cfbe6[_0xa41d('0x39')]=qs['sort'](_0x5bc82d[_0xa41d('0x31')][_0xa41d('0x3a')]);_0x4cfbe6[_0xa41d('0x3b')]=qs['filters'](_[_0xa41d('0x3c')](_0x5bc82d[_0xa41d('0x31')],_0x876387[_0xa41d('0x33')]),_0x4ed16a);if(_0x5bc82d[_0xa41d('0x31')][_0xa41d('0x3d')]){_0x4cfbe6[_0xa41d('0x3b')]=_[_0xa41d('0x3e')](_0x4cfbe6[_0xa41d('0x3b')],{'$or':_['map'](_0x4ed16a,function(_0x48e3e0){if(_0x48e3e0[_0xa41d('0x2e')]!==_0xa41d('0x3f')){var _0x4e8914={};_0x4e8914[_0x48e3e0[_0xa41d('0x2a')]]={'$like':'%'+_0x5bc82d['query'][_0xa41d('0x3d')]+'%'};return _0x4e8914;}})});}_0x4cfbe6=_[_0xa41d('0x3e')]({},_0x4cfbe6,_0x5bc82d[_0xa41d('0x40')]);var _0x22d6ae={'where':_0x4cfbe6[_0xa41d('0x3b')]};return db[_0xa41d('0x2c')][_0xa41d('0x1b')](_0x22d6ae)['then'](function(_0xbae3f7){_0x25bda1[_0xa41d('0x1b')]=_0xbae3f7;if(_0x5bc82d[_0xa41d('0x31')]['includeAll']){_0x4cfbe6['include']=[{'all':!![]}];}return db[_0xa41d('0x2c')]['findAll'](_0x4cfbe6);})[_0xa41d('0x24')](function(_0x1aa7b8){_0x25bda1[_0xa41d('0x41')]=_0x1aa7b8;return _0x25bda1;})[_0xa41d('0x24')](respondWithFilteredResult(_0x34282a,_0x4cfbe6))['catch'](handleError(_0x34282a,null));};exports[_0xa41d('0x42')]=function(_0x501cd1,_0x5c5285){var _0x4bda8b={'raw':!![],'where':{'id':_0x501cd1['params']['id']}},_0x5e3f0e={};_0x5e3f0e['model']=_[_0xa41d('0x32')](db[_0xa41d('0x2c')][_0xa41d('0x2d')]);_0x5e3f0e[_0xa41d('0x31')]=_[_0xa41d('0x32')](_0x501cd1[_0xa41d('0x31')]);_0x5e3f0e[_0xa41d('0x33')]=_[_0xa41d('0x34')](_0x5e3f0e[_0xa41d('0x30')],_0x5e3f0e[_0xa41d('0x31')]);_0x4bda8b[_0xa41d('0x36')]=_[_0xa41d('0x34')](_0x5e3f0e['model'],qs['fields'](_0x501cd1['query']['fields']));_0x4bda8b['attributes']=_0x4bda8b['attributes'][_0xa41d('0x43')]?_0x4bda8b[_0xa41d('0x36')]:_0x5e3f0e[_0xa41d('0x30')];if(_0x501cd1[_0xa41d('0x31')][_0xa41d('0x44')]){_0x4bda8b['include']=[{'all':!![]}];}_0x4bda8b=_[_0xa41d('0x3e')]({},_0x4bda8b,_0x501cd1['options']);return db['Template'][_0xa41d('0x45')](_0x4bda8b)['then'](handleEntityNotFound(_0x5c5285,null))['then'](respondWithResult(_0x5c5285,null))['catch'](handleError(_0x5c5285,null));};exports[_0xa41d('0x46')]=function(_0x41129a,_0x259db1){return db[_0xa41d('0x2c')][_0xa41d('0x46')](_0x41129a[_0xa41d('0x47')],{})[_0xa41d('0x24')](function(_0x2fc96b){var _0x1cbc8a=_0x41129a['user'][_0xa41d('0x25')]({'plain':!![]});if(!_0x1cbc8a)throw new Error(_0xa41d('0x48'));if(_0x1cbc8a[_0xa41d('0x49')]===_0xa41d('0x4a')){var _0x1d1970=_0x2fc96b[_0xa41d('0x25')]({'plain':!![]});var _0x295584=_0xa41d('0x4b');return db[_0xa41d('0x4c')][_0xa41d('0x45')]({'where':{'name':_0x295584,'userProfileId':_0x1cbc8a[_0xa41d('0x4d')]},'raw':!![]})['then'](function(_0x44aff4){if(_0x44aff4&&_0x44aff4[_0xa41d('0x4e')]===0x0){return db[_0xa41d('0x26')][_0xa41d('0x46')]({'name':_0x1d1970['name'],'resourceId':_0x1d1970['id'],'type':_0x44aff4[_0xa41d('0x2a')],'sectionId':_0x44aff4['id']},{})['then'](function(){return _0x2fc96b;});}else{return _0x2fc96b;}})[_0xa41d('0x4f')](function(_0x2d916b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d916b);throw _0x2d916b;});}return _0x2fc96b;})[_0xa41d('0x24')](respondWithResult(_0x259db1,0xc9))[_0xa41d('0x4f')](handleError(_0x259db1,null));};exports[_0xa41d('0x23')]=function(_0x60aa64,_0x421fd4){if(_0x60aa64[_0xa41d('0x47')]['id']){delete _0x60aa64[_0xa41d('0x47')]['id'];}return db[_0xa41d('0x2c')][_0xa41d('0x45')]({'where':{'id':_0x60aa64[_0xa41d('0x50')]['id']}})[_0xa41d('0x24')](handleEntityNotFound(_0x421fd4,null))[_0xa41d('0x24')](saveUpdates(_0x60aa64[_0xa41d('0x47')],null))[_0xa41d('0x24')](respondWithResult(_0x421fd4,null))[_0xa41d('0x4f')](handleError(_0x421fd4,null));};exports[_0xa41d('0x51')]=function(_0x335a88,_0x1c03e6){return db[_0xa41d('0x2c')][_0xa41d('0x45')]({'where':{'id':_0x335a88[_0xa41d('0x50')]['id']}})[_0xa41d('0x24')](handleEntityNotFound(_0x1c03e6,null))['then'](removeEntity(_0x1c03e6,null))[_0xa41d('0x4f')](handleError(_0x1c03e6,null));};
\ No newline at end of file
diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js
index b4dc77c..1befea9 100644
--- a/server/api/template/template.model.js
+++ b/server/api/template/template.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x247c=['define','Template','tools_templates','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports'];(function(_0x3a4acc,_0x1de058){var _0x52f597=function(_0x68eef2){while(--_0x68eef2){_0x3a4acc['push'](_0x3a4acc['shift']());}};_0x52f597(++_0x1de058);}(_0x247c,0x162));var _0xc247=function(_0x1658af,_0x5dbcab){_0x1658af=_0x1658af-0x0;var _0x30d065=_0x247c[_0x1658af];return _0x30d065;};'use strict';var _=require('lodash');var util=require(_0xc247('0x0'));var logger=require('../../config/logger')(_0xc247('0x1'));var moment=require(_0xc247('0x2'));var BPromise=require(_0xc247('0x3'));var rp=require(_0xc247('0x4'));var fs=require('fs');var path=require(_0xc247('0x5'));var rimraf=require(_0xc247('0x6'));var config=require(_0xc247('0x7'));var attributes=require(_0xc247('0x8'));module[_0xc247('0x9')]=function(_0x38289c,_0x43b5b3){return _0x38289c[_0xc247('0xa')](_0xc247('0xb'),attributes,{'tableName':_0xc247('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x54dd=['./template.attributes','define','Template','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x54dd,0x19a));var _0xd54d=function(_0xca72d8,_0xf84cd1){_0xca72d8=_0xca72d8-0x0;var _0x965195=_0x54dd[_0xca72d8];return _0x965195;};'use strict';var _=require(_0xd54d('0x0'));var util=require(_0xd54d('0x1'));var logger=require(_0xd54d('0x2'))(_0xd54d('0x3'));var moment=require(_0xd54d('0x4'));var BPromise=require(_0xd54d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd54d('0x6'));var rimraf=require(_0xd54d('0x7'));var config=require('../../config/environment');var attributes=require(_0xd54d('0x8'));module['exports']=function(_0x415d23,_0x210d6f){return _0x415d23[_0xd54d('0x9')](_0xd54d('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js
index 28d17e7..9ecf622 100644
--- a/server/api/template/template.rpc.js
+++ b/server/api/template/template.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2407=['message','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x2407,0x16a));var _0x7240=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0x2407[_0x34f701];return _0x3e2429;};'use strict';var _=require(_0x7240('0x0'));var util=require(_0x7240('0x1'));var moment=require(_0x7240('0x2'));var BPromise=require(_0x7240('0x3'));var rs=require(_0x7240('0x4'));var fs=require('fs');var Redis=require(_0x7240('0x5'));var db=require(_0x7240('0x6'))['db'];var utils=require(_0x7240('0x7'));var logger=require(_0x7240('0x8'))(_0x7240('0x9'));var config=require(_0x7240('0xa'));var jayson=require(_0x7240('0xb'));var client=jayson[_0x7240('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1affcb,_0x3a815d,_0x18aa30){return new BPromise(function(_0x7d7b31,_0x40ec57){return client[_0x7240('0xd')](_0x1affcb,_0x18aa30)[_0x7240('0xe')](function(_0x1d6a34){logger[_0x7240('0xf')]('Template,\x20%s,\x20%s',_0x3a815d,_0x7240('0x10'));logger[_0x7240('0x11')](_0x7240('0x12'),_0x3a815d,_0x7240('0x10'),JSON[_0x7240('0x13')](_0x1d6a34));if(_0x1d6a34[_0x7240('0x14')]){if(_0x1d6a34[_0x7240('0x14')][_0x7240('0x15')]===0x1f4){logger[_0x7240('0x14')](_0x7240('0x16'),_0x3a815d,_0x1d6a34[_0x7240('0x14')][_0x7240('0x17')]);return _0x40ec57(_0x1d6a34['error']['message']);}logger[_0x7240('0x14')](_0x7240('0x16'),_0x3a815d,_0x1d6a34[_0x7240('0x14')][_0x7240('0x17')]);return _0x7d7b31(_0x1d6a34['error']['message']);}else{logger[_0x7240('0xf')]('Template,\x20%s,\x20%s',_0x3a815d,_0x7240('0x10'));_0x7d7b31(_0x1d6a34['result'][_0x7240('0x17')]);}})[_0x7240('0x18')](function(_0x42b6dd){logger[_0x7240('0x14')](_0x7240('0x16'),_0x3a815d,_0x42b6dd);_0x40ec57(_0x42b6dd);});});}exports[_0x7240('0x19')]=function(_0x1abfff){var _0x1aea06=this;return new Promise(function(_0x219597,_0x57dec1){return db[_0x7240('0x1a')]['findAll']({'raw':_0x1abfff[_0x7240('0x1b')]?_0x1abfff[_0x7240('0x1b')][_0x7240('0x1c')]===undefined?!![]:![]:!![],'where':_0x1abfff['options']?_0x1abfff[_0x7240('0x1b')][_0x7240('0x1d')]||null:null,'attributes':_0x1abfff[_0x7240('0x1b')]?_0x1abfff[_0x7240('0x1b')][_0x7240('0x1e')]||null:null,'limit':_0x1abfff['options']?_0x1abfff[_0x7240('0x1b')][_0x7240('0x1f')]||null:null,'include':_0x1abfff[_0x7240('0x1b')]?_0x1abfff[_0x7240('0x1b')][_0x7240('0x20')]?_[_0x7240('0x21')](_0x1abfff[_0x7240('0x1b')]['include'],function(_0x514191){return{'model':db[_0x514191[_0x7240('0x22')]],'as':_0x514191['as'],'attributes':_0x514191[_0x7240('0x1e')],'include':_0x514191[_0x7240('0x20')]?_['map'](_0x514191[_0x7240('0x20')],function(_0x4371c9){return{'model':db[_0x4371c9[_0x7240('0x22')]],'as':_0x4371c9['as'],'attributes':_0x4371c9[_0x7240('0x1e')],'include':_0x4371c9[_0x7240('0x20')]?_[_0x7240('0x21')](_0x4371c9['include'],function(_0x228e3b){return{'model':db[_0x228e3b[_0x7240('0x22')]],'as':_0x228e3b['as'],'attributes':_0x228e3b[_0x7240('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7240('0xe')](function(_0x3e72b4){logger[_0x7240('0xf')](_0x7240('0x19'),_0x1abfff);logger[_0x7240('0x11')](_0x7240('0x19'),_0x1abfff,JSON['stringify'](_0x3e72b4));_0x219597(_0x3e72b4);})[_0x7240('0x18')](function(_0x496542){logger[_0x7240('0x14')]('GetTemplate',_0x496542[_0x7240('0x17')],_0x1abfff);_0x57dec1(_0x1aea06[_0x7240('0x14')](0x1f4,_0x496542[_0x7240('0x17')]));});});};
\ No newline at end of file
+var _0xeda1=['message','result','catch','GetTemplate','Template','options','raw','where','limit','map','include','model','attributes','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x16f9b8,_0x487d0c){var _0x221472=function(_0xbd5247){while(--_0xbd5247){_0x16f9b8['push'](_0x16f9b8['shift']());}};_0x221472(++_0x487d0c);}(_0xeda1,0x1de));var _0x1eda=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0xeda1[_0x2650e9];return _0x3511c8;};'use strict';var _=require('lodash');var util=require(_0x1eda('0x0'));var moment=require(_0x1eda('0x1'));var BPromise=require(_0x1eda('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1eda('0x3'))['db'];var utils=require(_0x1eda('0x4'));var logger=require('../../config/logger')(_0x1eda('0x5'));var config=require(_0x1eda('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1eda('0x7')][_0x1eda('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x111c68,_0x2e854e,_0x51d3bc){return new BPromise(function(_0x5c276,_0x43c206){return client['request'](_0x111c68,_0x51d3bc)[_0x1eda('0x9')](function(_0x3707fd){logger[_0x1eda('0xa')](_0x1eda('0xb'),_0x2e854e,'request\x20sent');logger[_0x1eda('0xc')](_0x1eda('0xd'),_0x2e854e,_0x1eda('0xe'),JSON[_0x1eda('0xf')](_0x3707fd));if(_0x3707fd[_0x1eda('0x10')]){if(_0x3707fd[_0x1eda('0x10')][_0x1eda('0x11')]===0x1f4){logger['error'](_0x1eda('0xb'),_0x2e854e,_0x3707fd[_0x1eda('0x10')]['message']);return _0x43c206(_0x3707fd[_0x1eda('0x10')][_0x1eda('0x12')]);}logger[_0x1eda('0x10')](_0x1eda('0xb'),_0x2e854e,_0x3707fd[_0x1eda('0x10')][_0x1eda('0x12')]);return _0x5c276(_0x3707fd['error']['message']);}else{logger[_0x1eda('0xa')]('Template,\x20%s,\x20%s',_0x2e854e,'request\x20sent');_0x5c276(_0x3707fd[_0x1eda('0x13')][_0x1eda('0x12')]);}})[_0x1eda('0x14')](function(_0x5acd06){logger[_0x1eda('0x10')](_0x1eda('0xb'),_0x2e854e,_0x5acd06);_0x43c206(_0x5acd06);});});}exports[_0x1eda('0x15')]=function(_0x35b1e0){var _0x73ef55=this;return new Promise(function(_0x2b6b2a,_0x1466a4){return db[_0x1eda('0x16')]['findAll']({'raw':_0x35b1e0[_0x1eda('0x17')]?_0x35b1e0['options'][_0x1eda('0x18')]===undefined?!![]:![]:!![],'where':_0x35b1e0[_0x1eda('0x17')]?_0x35b1e0[_0x1eda('0x17')][_0x1eda('0x19')]||null:null,'attributes':_0x35b1e0[_0x1eda('0x17')]?_0x35b1e0['options']['attributes']||null:null,'limit':_0x35b1e0[_0x1eda('0x17')]?_0x35b1e0['options'][_0x1eda('0x1a')]||null:null,'include':_0x35b1e0[_0x1eda('0x17')]?_0x35b1e0['options']['include']?_[_0x1eda('0x1b')](_0x35b1e0[_0x1eda('0x17')][_0x1eda('0x1c')],function(_0x1e33aa){return{'model':db[_0x1e33aa[_0x1eda('0x1d')]],'as':_0x1e33aa['as'],'attributes':_0x1e33aa[_0x1eda('0x1e')],'include':_0x1e33aa[_0x1eda('0x1c')]?_['map'](_0x1e33aa[_0x1eda('0x1c')],function(_0x4e77c0){return{'model':db[_0x4e77c0['model']],'as':_0x4e77c0['as'],'attributes':_0x4e77c0[_0x1eda('0x1e')],'include':_0x4e77c0['include']?_['map'](_0x4e77c0['include'],function(_0x58f200){return{'model':db[_0x58f200[_0x1eda('0x1d')]],'as':_0x58f200['as'],'attributes':_0x58f200[_0x1eda('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1eda('0x9')](function(_0x2580c0){logger['info'](_0x1eda('0x15'),_0x35b1e0);logger[_0x1eda('0xc')](_0x1eda('0x15'),_0x35b1e0,JSON['stringify'](_0x2580c0));_0x2b6b2a(_0x2580c0);})[_0x1eda('0x14')](function(_0x54273a){logger[_0x1eda('0x10')](_0x1eda('0x15'),_0x54273a[_0x1eda('0x12')],_0x35b1e0);_0x1466a4(_0x73ef55[_0x1eda('0x10')](0x1f4,_0x54273a['message']));});});};
\ No newline at end of file
diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js
index 99c0ae1..24ddfef 100644
--- a/server/api/trigger/index.js
+++ b/server/api/trigger/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f8e=['getActions','post','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','util','path','express','Router','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5f8e,0x1a3));var _0xe5f8=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x5f8e[_0x3712e2];return _0x1faff4;};'use strict';var multer=require('multer');var util=require(_0xe5f8('0x0'));var path=require(_0xe5f8('0x1'));var timeout=require('connect-timeout');var express=require(_0xe5f8('0x2'));var router=express[_0xe5f8('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe5f8('0x4'));var controller=require(_0xe5f8('0x5'));router[_0xe5f8('0x6')]('/',auth[_0xe5f8('0x7')](),controller[_0xe5f8('0x8')]);router[_0xe5f8('0x6')](_0xe5f8('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/all_conditions',auth['isAuthenticated'](),controller['getAllConditions']);router['get'](_0xe5f8('0xa'),auth[_0xe5f8('0x7')](),controller[_0xe5f8('0xb')]);router[_0xe5f8('0x6')](_0xe5f8('0xc'),auth['isAuthenticated'](),controller[_0xe5f8('0xd')]);router[_0xe5f8('0xe')]('/',auth[_0xe5f8('0x7')](),controller['create']);router['post'](_0xe5f8('0xf'),auth[_0xe5f8('0x7')](),controller[_0xe5f8('0x10')]);router[_0xe5f8('0xe')](_0xe5f8('0xa'),auth['isAuthenticated'](),controller[_0xe5f8('0x11')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller[_0xe5f8('0x12')]);router[_0xe5f8('0x13')](_0xe5f8('0x9'),auth['isAuthenticated'](),controller[_0xe5f8('0x14')]);router[_0xe5f8('0x15')](_0xe5f8('0x9'),auth[_0xe5f8('0x7')](),controller[_0xe5f8('0x16')]);module[_0xe5f8('0x17')]=router;
\ No newline at end of file
+var _0x419e=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','/:id/any_conditions','addAnyCondition','put'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x419e,0x67));var _0xe419=function(_0x199b64,_0x5d1120){_0x199b64=_0x199b64-0x0;var _0x42b220=_0x419e[_0x199b64];return _0x42b220;};'use strict';var multer=require(_0xe419('0x0'));var util=require(_0xe419('0x1'));var path=require(_0xe419('0x2'));var timeout=require(_0xe419('0x3'));var express=require(_0xe419('0x4'));var router=express[_0xe419('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe419('0x6'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xe419('0x7')]('/',auth[_0xe419('0x8')](),controller[_0xe419('0x9')]);router[_0xe419('0x7')](_0xe419('0xa'),auth[_0xe419('0x8')](),controller[_0xe419('0xb')]);router[_0xe419('0x7')](_0xe419('0xc'),auth[_0xe419('0x8')](),controller[_0xe419('0xd')]);router[_0xe419('0x7')]('/:id/any_conditions',auth[_0xe419('0x8')](),controller[_0xe419('0xe')]);router[_0xe419('0x7')](_0xe419('0xf'),auth['isAuthenticated'](),controller[_0xe419('0x10')]);router[_0xe419('0x11')]('/',auth[_0xe419('0x8')](),controller['create']);router[_0xe419('0x11')]('/:id/all_conditions',auth[_0xe419('0x8')](),controller[_0xe419('0x12')]);router[_0xe419('0x11')](_0xe419('0x13'),auth['isAuthenticated'](),controller[_0xe419('0x14')]);router['post'](_0xe419('0xf'),auth[_0xe419('0x8')](),controller['addAction']);router[_0xe419('0x15')]('/:id',auth[_0xe419('0x8')](),controller[_0xe419('0x16')]);router[_0xe419('0x17')](_0xe419('0xa'),auth['isAuthenticated'](),controller[_0xe419('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js
index 568c3d9..613762f 100644
--- a/server/api/trigger/trigger.attributes.js
+++ b/server/api/trigger/trigger.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b9d=['BOOLEAN','sequelize','exports','STRING'];(function(_0xee68ea,_0x3ba428){var _0x24e34a=function(_0x2c212a){while(--_0x2c212a){_0xee68ea['push'](_0xee68ea['shift']());}};_0x24e34a(++_0x3ba428);}(_0x0b9d,0x145));var _0xd0b9=function(_0xddf898,_0x505284){_0xddf898=_0xddf898-0x0;var _0x1017c3=_0x0b9d[_0xddf898];return _0x1017c3;};'use strict';var Sequelize=require(_0xd0b9('0x0'));module[_0xd0b9('0x1')]={'name':{'type':Sequelize[_0xd0b9('0x2')]},'channel':{'type':Sequelize[_0xd0b9('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xd0b9('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6e54=['exports','STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6e54,0xa7));var _0x46e5=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x6e54[_0x119280];return _0x481797;};'use strict';var Sequelize=require(_0x46e5('0x0'));module[_0x46e5('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x46e5('0x2')]},'description':{'type':Sequelize[_0x46e5('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js
index 911d887..33c4497 100644
--- a/server/api/trigger/trigger.controller.js
+++ b/server/api/trigger/trigger.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3bbd=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','Content-Range','json','apply','reject','save','update','then','Triggers','UserProfileResource','destroy','stack','name','send','map','Trigger','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','count','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3bbd,0xce));var _0xd3bb=function(_0x3b83d4,_0x1938c8){_0x3b83d4=_0x3b83d4-0x0;var _0x479130=_0x3bbd[_0x3b83d4];return _0x479130;};'use strict';var pdf=require(_0xd3bb('0x0'));var emlformat=require(_0xd3bb('0x1'));var rimraf=require(_0xd3bb('0x2'));var zipdir=require(_0xd3bb('0x3'));var jsonpatch=require(_0xd3bb('0x4'));var rp=require(_0xd3bb('0x5'));var moment=require(_0xd3bb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd3bb('0x7'));var util=require('util');var path=require(_0xd3bb('0x8'));var sox=require(_0xd3bb('0x9'));var csv=require(_0xd3bb('0xa'));var ejs=require(_0xd3bb('0xb'));var fs=require('fs');var _=require(_0xd3bb('0xc'));var squel=require(_0xd3bb('0xd'));var crypto=require('crypto');var jsforce=require(_0xd3bb('0xe'));var deskjs=require(_0xd3bb('0xf'));var toCsv=require(_0xd3bb('0xa'));var querystring=require(_0xd3bb('0x10'));var Papa=require(_0xd3bb('0x11'));var Redis=require(_0xd3bb('0x12'));var authService=require(_0xd3bb('0x13'));var qs=require(_0xd3bb('0x14'));var as=require(_0xd3bb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3bb('0x16'))(_0xd3bb('0x17'));var utils=require(_0xd3bb('0x18'));var config=require(_0xd3bb('0x19'));var db=require(_0xd3bb('0x1a'))['db'];function respondWithStatusCode(_0x53cc1c,_0x5c982a){_0x5c982a=_0x5c982a||0xcc;return function(_0x114d86){if(_0x114d86){return _0x53cc1c[_0xd3bb('0x1b')](_0x5c982a);}return _0x53cc1c['status'](_0x5c982a)[_0xd3bb('0x1c')]();};}function respondWithResult(_0x1a22e6,_0x54c11e){_0x54c11e=_0x54c11e||0xc8;return function(_0x3bf44e){if(_0x3bf44e){return _0x1a22e6[_0xd3bb('0x1d')](_0x54c11e)['json'](_0x3bf44e);}};}function respondWithFilteredResult(_0x4f668d,_0x51c674){return function(_0x4dd8c3){if(_0x4dd8c3){var _0x589a8d=_0x4dd8c3['count'],_0x4b0b72=_0x51c674['offset'],_0x28b100=_0x51c674[_0xd3bb('0x1e')]+_0x51c674[_0xd3bb('0x1f')],_0x905665;if(_0x28b100>=_0x589a8d){_0x28b100=_0x589a8d;_0x905665=0xc8;}else{_0x905665=0xce;}_0x4f668d['status'](_0x905665);return _0x4f668d['set'](_0xd3bb('0x20'),_0x4b0b72+'-'+_0x28b100+'/'+_0x589a8d)[_0xd3bb('0x21')](_0x4dd8c3);}return null;};}function patchUpdates(_0x20d6b0){return function(_0x31c19b){try{jsonpatch[_0xd3bb('0x22')](_0x31c19b,_0x20d6b0,!![]);}catch(_0x45d8a6){return BPromise[_0xd3bb('0x23')](_0x45d8a6);}return _0x31c19b[_0xd3bb('0x24')]();};}function saveUpdates(_0x303e2d,_0x167a3f){return function(_0xd7e998){if(_0xd7e998){return _0xd7e998[_0xd3bb('0x25')](_0x303e2d)[_0xd3bb('0x26')](function(_0x57015b){return _0x57015b;});}return null;};}function removeEntity(_0x467e9c,_0x577280){return function(_0x977807){if(_0x977807){return _0x977807['destroy']()[_0xd3bb('0x26')](function(){var _0x3eb066=_0x977807['get']({'plain':!![]});var _0x81c487=_0xd3bb('0x27');return db[_0xd3bb('0x28')][_0xd3bb('0x29')]({'where':{'type':_0x81c487,'resourceId':_0x3eb066['id']}})[_0xd3bb('0x26')](function(){return _0x977807;});})[_0xd3bb('0x26')](function(){_0x467e9c[_0xd3bb('0x1d')](0xcc)[_0xd3bb('0x1c')]();});}};}function handleEntityNotFound(_0xae3585,_0x4c6734){return function(_0x44b597){if(!_0x44b597){_0xae3585[_0xd3bb('0x1b')](0x194);}return _0x44b597;};}function handleError(_0x1b03a8,_0x4ee524){_0x4ee524=_0x4ee524||0x1f4;return function(_0x149e0b){logger['error'](_0x149e0b[_0xd3bb('0x2a')]);if(_0x149e0b[_0xd3bb('0x2b')]){delete _0x149e0b['name'];}_0x1b03a8[_0xd3bb('0x1d')](_0x4ee524)[_0xd3bb('0x2c')](_0x149e0b);};}exports['index']=function(_0xe98e5b,_0x1de4eb){var _0x1024b6={},_0x71b03b={},_0x20b7e8={'count':0x0,'rows':[]};var _0x3c964b=_[_0xd3bb('0x2d')](db[_0xd3bb('0x2e')][_0xd3bb('0x2f')],function(_0x1498de){return{'name':_0x1498de[_0xd3bb('0x30')],'type':_0x1498de['type'][_0xd3bb('0x31')]};});_0x71b03b[_0xd3bb('0x32')]=_[_0xd3bb('0x2d')](_0x3c964b,_0xd3bb('0x2b'));_0x71b03b[_0xd3bb('0x33')]=_[_0xd3bb('0x34')](_0xe98e5b[_0xd3bb('0x33')]);_0x71b03b[_0xd3bb('0x35')]=_[_0xd3bb('0x36')](_0x71b03b[_0xd3bb('0x32')],_0x71b03b[_0xd3bb('0x33')]);_0x1024b6[_0xd3bb('0x37')]=_[_0xd3bb('0x36')](_0x71b03b[_0xd3bb('0x32')],qs['fields'](_0xe98e5b[_0xd3bb('0x33')]['fields']));_0x1024b6[_0xd3bb('0x37')]=_0x1024b6[_0xd3bb('0x37')][_0xd3bb('0x38')]?_0x1024b6[_0xd3bb('0x37')]:_0x71b03b[_0xd3bb('0x32')];if(!_0xe98e5b[_0xd3bb('0x33')][_0xd3bb('0x39')](_0xd3bb('0x3a'))){_0x1024b6[_0xd3bb('0x1f')]=qs[_0xd3bb('0x1f')](_0xe98e5b['query'][_0xd3bb('0x1f')]);_0x1024b6['offset']=qs['offset'](_0xe98e5b[_0xd3bb('0x33')][_0xd3bb('0x1e')]);}_0x1024b6[_0xd3bb('0x3b')]=qs[_0xd3bb('0x3c')](_0xe98e5b['query']['sort']);_0x1024b6[_0xd3bb('0x3d')]=qs['filters'](_[_0xd3bb('0x3e')](_0xe98e5b[_0xd3bb('0x33')],_0x71b03b[_0xd3bb('0x35')]),_0x3c964b);if(_0xe98e5b[_0xd3bb('0x33')][_0xd3bb('0x3f')]){_0x1024b6[_0xd3bb('0x3d')]=_[_0xd3bb('0x40')](_0x1024b6['where'],{'$or':_[_0xd3bb('0x2d')](_0x3c964b,function(_0x2acf0b){if(_0x2acf0b[_0xd3bb('0x41')]!=='VIRTUAL'){var _0x1163f9={};_0x1163f9[_0x2acf0b[_0xd3bb('0x2b')]]={'$like':'%'+_0xe98e5b[_0xd3bb('0x33')][_0xd3bb('0x3f')]+'%'};return _0x1163f9;}})});}_0x1024b6=_[_0xd3bb('0x40')]({},_0x1024b6,_0xe98e5b['options']);var _0x16f324={'where':_0x1024b6[_0xd3bb('0x3d')]};return db[_0xd3bb('0x2e')][_0xd3bb('0x42')](_0x16f324)[_0xd3bb('0x26')](function(_0x561689){_0x20b7e8[_0xd3bb('0x42')]=_0x561689;if(_0xe98e5b[_0xd3bb('0x33')][_0xd3bb('0x43')]){_0x1024b6[_0xd3bb('0x44')]=[{'all':!![]}];}return db['Trigger'][_0xd3bb('0x45')](_0x1024b6);})['then'](function(_0x588dd5){_0x20b7e8[_0xd3bb('0x46')]=_0x588dd5;return _0x20b7e8;})['then'](respondWithFilteredResult(_0x1de4eb,_0x1024b6))[_0xd3bb('0x47')](handleError(_0x1de4eb,null));};exports[_0xd3bb('0x48')]=function(_0xcc9d3,_0x4daa20){var _0x2c983d={'raw':![],'where':{'id':_0xcc9d3[_0xd3bb('0x49')]['id']}},_0x313b84={};_0x313b84[_0xd3bb('0x32')]=_[_0xd3bb('0x34')](db[_0xd3bb('0x2e')][_0xd3bb('0x2f')]);_0x313b84[_0xd3bb('0x33')]=_[_0xd3bb('0x34')](_0xcc9d3[_0xd3bb('0x33')]);_0x313b84['filters']=_[_0xd3bb('0x36')](_0x313b84[_0xd3bb('0x32')],_0x313b84[_0xd3bb('0x33')]);_0x2c983d[_0xd3bb('0x37')]=_[_0xd3bb('0x36')](_0x313b84[_0xd3bb('0x32')],qs[_0xd3bb('0x4a')](_0xcc9d3[_0xd3bb('0x33')][_0xd3bb('0x4a')]));_0x2c983d[_0xd3bb('0x37')]=_0x2c983d[_0xd3bb('0x37')][_0xd3bb('0x38')]?_0x2c983d[_0xd3bb('0x37')]:_0x313b84[_0xd3bb('0x32')];if(_0xcc9d3[_0xd3bb('0x33')][_0xd3bb('0x43')]){_0x2c983d['include']=[{'all':!![]}];}_0x2c983d=_[_0xd3bb('0x40')]({},_0x2c983d,_0xcc9d3[_0xd3bb('0x4b')]);return db[_0xd3bb('0x2e')][_0xd3bb('0x4c')](_0x2c983d)['then'](handleEntityNotFound(_0x4daa20,null))[_0xd3bb('0x26')](respondWithResult(_0x4daa20,null))[_0xd3bb('0x47')](handleError(_0x4daa20,null));};exports[_0xd3bb('0x4d')]=function(_0x23a349,_0x2a3bfe){return db[_0xd3bb('0x2e')][_0xd3bb('0x4d')](_0x23a349['body'],{})[_0xd3bb('0x26')](function(_0x2c1c7e){var _0x1544f2=_0x23a349[_0xd3bb('0x4e')][_0xd3bb('0x4f')]({'plain':!![]});if(!_0x1544f2)throw new Error(_0xd3bb('0x50'));if(_0x1544f2[_0xd3bb('0x51')]===_0xd3bb('0x4e')){var _0x242fcc=_0x2c1c7e['get']({'plain':!![]});var _0x10e633=_0xd3bb('0x27');return db[_0xd3bb('0x52')][_0xd3bb('0x4c')]({'where':{'name':_0x10e633,'userProfileId':_0x1544f2[_0xd3bb('0x53')]},'raw':!![]})[_0xd3bb('0x26')](function(_0x129098){if(_0x129098&&_0x129098[_0xd3bb('0x54')]===0x0){return db[_0xd3bb('0x28')][_0xd3bb('0x4d')]({'name':_0x242fcc[_0xd3bb('0x2b')],'resourceId':_0x242fcc['id'],'type':_0x129098[_0xd3bb('0x2b')],'sectionId':_0x129098['id']},{})['then'](function(){return _0x2c1c7e;});}else{return _0x2c1c7e;}})['catch'](function(_0x4a97d9){logger['error'](_0xd3bb('0x55'),_0x4a97d9);throw _0x4a97d9;});}return _0x2c1c7e;})[_0xd3bb('0x26')](respondWithResult(_0x2a3bfe,0xc9))[_0xd3bb('0x47')](handleError(_0x2a3bfe,null));};exports[_0xd3bb('0x25')]=function(_0x188cff,_0x22812c){if(_0x188cff[_0xd3bb('0x56')]['id']){delete _0x188cff['body']['id'];}return db[_0xd3bb('0x2e')][_0xd3bb('0x4c')]({'where':{'id':_0x188cff[_0xd3bb('0x49')]['id']}})['then'](handleEntityNotFound(_0x22812c,null))[_0xd3bb('0x26')](saveUpdates(_0x188cff[_0xd3bb('0x56')],null))[_0xd3bb('0x26')](respondWithResult(_0x22812c,null))['catch'](handleError(_0x22812c,null));};exports['destroy']=function(_0x4bc7a0,_0x16fd76){return db[_0xd3bb('0x2e')][_0xd3bb('0x4c')]({'where':{'id':_0x4bc7a0[_0xd3bb('0x49')]['id']}})[_0xd3bb('0x26')](handleEntityNotFound(_0x16fd76,null))[_0xd3bb('0x26')](removeEntity(_0x16fd76,null))[_0xd3bb('0x47')](handleError(_0x16fd76,null));};exports['addAllCondition']=function(_0x2c3500,_0x25fd13,_0x4f99e1){if(_0x2c3500['body']['id']){delete _0x2c3500['body']['id'];}return db[_0xd3bb('0x2e')][_0xd3bb('0x4c')]({'where':{'id':_0x2c3500[_0xd3bb('0x49')]['id']}})[_0xd3bb('0x26')](handleEntityNotFound(_0x25fd13,null))[_0xd3bb('0x26')](function(_0x3dc5ca){if(_0x3dc5ca){_0x2c3500[_0xd3bb('0x56')][_0xd3bb('0x57')]=_0x3dc5ca['id'];return db[_0xd3bb('0x58')]['create'](_0x2c3500[_0xd3bb('0x56')]);}})[_0xd3bb('0x26')](respondWithResult(_0x25fd13,null))[_0xd3bb('0x47')](handleError(_0x25fd13,null));};exports[_0xd3bb('0x59')]=function(_0x5b9844,_0x2cb142,_0x6e96ad){if(_0x5b9844[_0xd3bb('0x56')]['id']){delete _0x5b9844['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x5b9844[_0xd3bb('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cb142,null))[_0xd3bb('0x26')](function(_0x3fb13a){if(_0x3fb13a){_0x5b9844[_0xd3bb('0x56')]['TriggerAnyId']=_0x3fb13a['id'];return db['Condition'][_0xd3bb('0x4d')](_0x5b9844['body']);}})[_0xd3bb('0x26')](respondWithResult(_0x2cb142,null))['catch'](handleError(_0x2cb142,null));};exports['getAllConditions']=function(_0x360a84,_0x4020ca,_0x6a7294){var _0x1c3bbd={};var _0x26802d={};var _0x40ae30;var _0x59f2c0;return db[_0xd3bb('0x2e')]['findOne']({'where':{'id':_0x360a84[_0xd3bb('0x49')]['id']}})[_0xd3bb('0x26')](handleEntityNotFound(_0x4020ca,null))[_0xd3bb('0x26')](function(_0x2c86f2){if(_0x2c86f2){_0x40ae30=_0x2c86f2;_0x26802d['model']=_[_0xd3bb('0x34')](db[_0xd3bb('0x58')][_0xd3bb('0x2f')]);_0x26802d[_0xd3bb('0x33')]=_['keys'](_0x360a84[_0xd3bb('0x33')]);_0x26802d[_0xd3bb('0x35')]=_[_0xd3bb('0x36')](_0x26802d[_0xd3bb('0x32')],_0x26802d[_0xd3bb('0x33')]);_0x1c3bbd['attributes']=_[_0xd3bb('0x36')](_0x26802d[_0xd3bb('0x32')],qs['fields'](_0x360a84[_0xd3bb('0x33')][_0xd3bb('0x4a')]));_0x1c3bbd[_0xd3bb('0x37')]=_0x1c3bbd[_0xd3bb('0x37')][_0xd3bb('0x38')]?_0x1c3bbd['attributes']:_0x26802d[_0xd3bb('0x32')];_0x1c3bbd[_0xd3bb('0x3b')]=qs[_0xd3bb('0x3c')](_0x360a84[_0xd3bb('0x33')]['sort']);_0x1c3bbd[_0xd3bb('0x3d')]=qs[_0xd3bb('0x35')](_['pick'](_0x360a84[_0xd3bb('0x33')],_0x26802d[_0xd3bb('0x35')]));if(_0x360a84[_0xd3bb('0x33')]['filter']){_0x1c3bbd[_0xd3bb('0x3d')]=_['merge'](_0x1c3bbd[_0xd3bb('0x3d')],{'$or':_[_0xd3bb('0x2d')](_0x1c3bbd[_0xd3bb('0x37')],function(_0x15c310){var _0x580b55={};_0x580b55[_0x15c310]={'$like':'%'+_0x360a84[_0xd3bb('0x33')][_0xd3bb('0x3f')]+'%'};return _0x580b55;})});}_0x1c3bbd=_[_0xd3bb('0x40')]({},_0x1c3bbd,_0x360a84[_0xd3bb('0x4b')]);return _0x40ae30[_0xd3bb('0x5a')](_0x1c3bbd);}})['then'](function(_0x43e466){if(_0x43e466){_0x59f2c0=_0x43e466[_0xd3bb('0x38')];if(!_0x360a84[_0xd3bb('0x33')]['hasOwnProperty']('nolimit')){_0x1c3bbd[_0xd3bb('0x1f')]=qs[_0xd3bb('0x1f')](_0x360a84['query'][_0xd3bb('0x1f')]);_0x1c3bbd['offset']=qs[_0xd3bb('0x1e')](_0x360a84['query']['offset']);}return _0x40ae30['getAllConditions'](_0x1c3bbd);}})[_0xd3bb('0x26')](function(_0x3b5189){if(_0x3b5189){return _0x3b5189?{'count':_0x59f2c0,'rows':_0x3b5189}:null;}})[_0xd3bb('0x26')](respondWithResult(_0x4020ca,null))[_0xd3bb('0x47')](handleError(_0x4020ca,null));};exports['getAnyConditions']=function(_0xfe6222,_0xe5de64,_0x1f3341){var _0x1c3647={};var _0x372685={};var _0x24bff8;var _0x3ef6dc;return db[_0xd3bb('0x2e')][_0xd3bb('0x5b')]({'where':{'id':_0xfe6222[_0xd3bb('0x49')]['id']}})[_0xd3bb('0x26')](handleEntityNotFound(_0xe5de64,null))[_0xd3bb('0x26')](function(_0x480243){if(_0x480243){_0x24bff8=_0x480243;_0x372685[_0xd3bb('0x32')]=_[_0xd3bb('0x34')](db[_0xd3bb('0x58')][_0xd3bb('0x2f')]);_0x372685['query']=_['keys'](_0xfe6222[_0xd3bb('0x33')]);_0x372685['filters']=_[_0xd3bb('0x36')](_0x372685[_0xd3bb('0x32')],_0x372685[_0xd3bb('0x33')]);_0x1c3647[_0xd3bb('0x37')]=_['intersection'](_0x372685['model'],qs[_0xd3bb('0x4a')](_0xfe6222[_0xd3bb('0x33')][_0xd3bb('0x4a')]));_0x1c3647[_0xd3bb('0x37')]=_0x1c3647['attributes']['length']?_0x1c3647[_0xd3bb('0x37')]:_0x372685['model'];_0x1c3647[_0xd3bb('0x3b')]=qs[_0xd3bb('0x3c')](_0xfe6222[_0xd3bb('0x33')][_0xd3bb('0x3c')]);_0x1c3647[_0xd3bb('0x3d')]=qs[_0xd3bb('0x35')](_[_0xd3bb('0x3e')](_0xfe6222[_0xd3bb('0x33')],_0x372685[_0xd3bb('0x35')]));if(_0xfe6222['query']['filter']){_0x1c3647['where']=_['merge'](_0x1c3647[_0xd3bb('0x3d')],{'$or':_[_0xd3bb('0x2d')](_0x1c3647[_0xd3bb('0x37')],function(_0x5a1376){var _0xc0f9d1={};_0xc0f9d1[_0x5a1376]={'$like':'%'+_0xfe6222[_0xd3bb('0x33')]['filter']+'%'};return _0xc0f9d1;})});}_0x1c3647=_[_0xd3bb('0x40')]({},_0x1c3647,_0xfe6222[_0xd3bb('0x4b')]);return _0x24bff8[_0xd3bb('0x5c')](_0x1c3647);}})[_0xd3bb('0x26')](function(_0x2a53b7){if(_0x2a53b7){_0x3ef6dc=_0x2a53b7[_0xd3bb('0x38')];if(!_0xfe6222[_0xd3bb('0x33')]['hasOwnProperty'](_0xd3bb('0x3a'))){_0x1c3647[_0xd3bb('0x1f')]=qs[_0xd3bb('0x1f')](_0xfe6222[_0xd3bb('0x33')]['limit']);_0x1c3647[_0xd3bb('0x1e')]=qs['offset'](_0xfe6222[_0xd3bb('0x33')]['offset']);}return _0x24bff8['getAnyConditions'](_0x1c3647);}})[_0xd3bb('0x26')](function(_0x532d1e){if(_0x532d1e){return _0x532d1e?{'count':_0x3ef6dc,'rows':_0x532d1e}:null;}})['then'](respondWithResult(_0xe5de64,null))[_0xd3bb('0x47')](handleError(_0xe5de64,null));};exports[_0xd3bb('0x5d')]=function(_0x4223d6,_0x1ea5fc,_0x35c6a7){if(_0x4223d6['body']['id']){delete _0x4223d6[_0xd3bb('0x56')]['id'];}return db[_0xd3bb('0x2e')][_0xd3bb('0x4c')]({'where':{'id':_0x4223d6[_0xd3bb('0x49')]['id']}})[_0xd3bb('0x26')](handleEntityNotFound(_0x1ea5fc,null))[_0xd3bb('0x26')](function(_0xe3bd0e){if(_0xe3bd0e){_0x4223d6[_0xd3bb('0x56')]['TriggerId']=_0xe3bd0e['id'];return db[_0xd3bb('0x5e')]['create'](_0x4223d6[_0xd3bb('0x56')]);}})[_0xd3bb('0x26')](respondWithResult(_0x1ea5fc,null))[_0xd3bb('0x47')](handleError(_0x1ea5fc,null));};exports[_0xd3bb('0x5f')]=function(_0x838f4e,_0x56d790,_0x4ac4e2){var _0x4f3753={};var _0x4d1e94={};var _0x5a60df;var _0xf25d89;return db['Trigger'][_0xd3bb('0x5b')]({'where':{'id':_0x838f4e['params']['id']}})[_0xd3bb('0x26')](handleEntityNotFound(_0x56d790,null))[_0xd3bb('0x26')](function(_0x303557){if(_0x303557){_0x5a60df=_0x303557;_0x4d1e94['model']=_[_0xd3bb('0x34')](db[_0xd3bb('0x5e')][_0xd3bb('0x2f')]);_0x4d1e94[_0xd3bb('0x33')]=_['keys'](_0x838f4e[_0xd3bb('0x33')]);_0x4d1e94[_0xd3bb('0x35')]=_['intersection'](_0x4d1e94[_0xd3bb('0x32')],_0x4d1e94['query']);_0x4f3753[_0xd3bb('0x37')]=_[_0xd3bb('0x36')](_0x4d1e94[_0xd3bb('0x32')],qs[_0xd3bb('0x4a')](_0x838f4e['query'][_0xd3bb('0x4a')]));_0x4f3753[_0xd3bb('0x37')]=_0x4f3753[_0xd3bb('0x37')]['length']?_0x4f3753['attributes']:_0x4d1e94[_0xd3bb('0x32')];_0x4f3753[_0xd3bb('0x3b')]=qs['sort'](_0x838f4e['query'][_0xd3bb('0x3c')]);_0x4f3753[_0xd3bb('0x3d')]=qs[_0xd3bb('0x35')](_[_0xd3bb('0x3e')](_0x838f4e[_0xd3bb('0x33')],_0x4d1e94[_0xd3bb('0x35')]));if(_0x838f4e[_0xd3bb('0x33')]['filter']){_0x4f3753[_0xd3bb('0x3d')]=_[_0xd3bb('0x40')](_0x4f3753[_0xd3bb('0x3d')],{'$or':_['map'](_0x4f3753[_0xd3bb('0x37')],function(_0x2a2d01){var _0x2b89e6={};_0x2b89e6[_0x2a2d01]={'$like':'%'+_0x838f4e[_0xd3bb('0x33')][_0xd3bb('0x3f')]+'%'};return _0x2b89e6;})});}_0x4f3753=_[_0xd3bb('0x40')]({},_0x4f3753,_0x838f4e[_0xd3bb('0x4b')]);return _0x5a60df[_0xd3bb('0x5f')](_0x4f3753);}})[_0xd3bb('0x26')](function(_0x15751e){if(_0x15751e){_0xf25d89=_0x15751e[_0xd3bb('0x38')];if(!_0x838f4e[_0xd3bb('0x33')]['hasOwnProperty'](_0xd3bb('0x3a'))){_0x4f3753[_0xd3bb('0x1f')]=qs[_0xd3bb('0x1f')](_0x838f4e[_0xd3bb('0x33')][_0xd3bb('0x1f')]);_0x4f3753[_0xd3bb('0x1e')]=qs[_0xd3bb('0x1e')](_0x838f4e[_0xd3bb('0x33')][_0xd3bb('0x1e')]);}return _0x5a60df['getActions'](_0x4f3753);}})[_0xd3bb('0x26')](function(_0x4fef5e){if(_0x4fef5e){return _0x4fef5e?{'count':_0xf25d89,'rows':_0x4fef5e}:null;}})[_0xd3bb('0x26')](respondWithResult(_0x56d790,null))[_0xd3bb('0x47')](handleError(_0x56d790,null));};
\ No newline at end of file
+var _0xaed0=['addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','Trigger','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','rawAttributes','catch','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition'];(function(_0x5644b4,_0x26a7fd){var _0x13f655=function(_0x5d27f3){while(--_0x5d27f3){_0x5644b4['push'](_0x5644b4['shift']());}};_0x13f655(++_0x26a7fd);}(_0xaed0,0x123));var _0x0aed=function(_0x5750d0,_0x22a018){_0x5750d0=_0x5750d0-0x0;var _0x3f3f29=_0xaed0[_0x5750d0];return _0x3f3f29;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0aed('0x0'));var rimraf=require(_0x0aed('0x1'));var zipdir=require(_0x0aed('0x2'));var jsonpatch=require(_0x0aed('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0aed('0x4'));var Mustache=require(_0x0aed('0x5'));var util=require(_0x0aed('0x6'));var path=require(_0x0aed('0x7'));var sox=require(_0x0aed('0x8'));var csv=require('to-csv');var ejs=require(_0x0aed('0x9'));var fs=require('fs');var _=require(_0x0aed('0xa'));var squel=require(_0x0aed('0xb'));var crypto=require(_0x0aed('0xc'));var jsforce=require(_0x0aed('0xd'));var deskjs=require(_0x0aed('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0aed('0xf'));var Redis=require(_0x0aed('0x10'));var authService=require(_0x0aed('0x11'));var qs=require(_0x0aed('0x12'));var as=require(_0x0aed('0x13'));var hardwareService=require(_0x0aed('0x14'));var logger=require(_0x0aed('0x15'))(_0x0aed('0x16'));var utils=require(_0x0aed('0x17'));var config=require(_0x0aed('0x18'));var db=require(_0x0aed('0x19'))['db'];function respondWithStatusCode(_0x55c226,_0x349c61){_0x349c61=_0x349c61||0xcc;return function(_0x54ea81){if(_0x54ea81){return _0x55c226[_0x0aed('0x1a')](_0x349c61);}return _0x55c226['status'](_0x349c61)[_0x0aed('0x1b')]();};}function respondWithResult(_0x1fa582,_0x499e7f){_0x499e7f=_0x499e7f||0xc8;return function(_0x51ea39){if(_0x51ea39){return _0x1fa582['status'](_0x499e7f)[_0x0aed('0x1c')](_0x51ea39);}};}function respondWithFilteredResult(_0x24e68a,_0xa9efc4){return function(_0x22762e){if(_0x22762e){var _0xc5c469=_0x22762e['count'],_0x3a9076=_0xa9efc4[_0x0aed('0x1d')],_0x55b3a1=_0xa9efc4[_0x0aed('0x1d')]+_0xa9efc4[_0x0aed('0x1e')],_0x9155;if(_0x55b3a1>=_0xc5c469){_0x55b3a1=_0xc5c469;_0x9155=0xc8;}else{_0x9155=0xce;}_0x24e68a['status'](_0x9155);return _0x24e68a[_0x0aed('0x1f')](_0x0aed('0x20'),_0x3a9076+'-'+_0x55b3a1+'/'+_0xc5c469)[_0x0aed('0x1c')](_0x22762e);}return null;};}function patchUpdates(_0x56b282){return function(_0xbc2248){try{jsonpatch[_0x0aed('0x21')](_0xbc2248,_0x56b282,!![]);}catch(_0x16eba8){return BPromise[_0x0aed('0x22')](_0x16eba8);}return _0xbc2248[_0x0aed('0x23')]();};}function saveUpdates(_0x30c301,_0x56687b){return function(_0x133dc2){if(_0x133dc2){return _0x133dc2[_0x0aed('0x24')](_0x30c301)[_0x0aed('0x25')](function(_0x28e867){return _0x28e867;});}return null;};}function removeEntity(_0x18520e,_0x408ce0){return function(_0x240a91){if(_0x240a91){return _0x240a91[_0x0aed('0x26')]()[_0x0aed('0x25')](function(){var _0x14dc74=_0x240a91[_0x0aed('0x27')]({'plain':!![]});var _0x22f567=_0x0aed('0x28');return db[_0x0aed('0x29')]['destroy']({'where':{'type':_0x22f567,'resourceId':_0x14dc74['id']}})['then'](function(){return _0x240a91;});})[_0x0aed('0x25')](function(){_0x18520e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1edf1,_0x4461db){return function(_0x1f7d5d){if(!_0x1f7d5d){_0x1edf1['sendStatus'](0x194);}return _0x1f7d5d;};}function handleError(_0x5a1df8,_0x29c111){_0x29c111=_0x29c111||0x1f4;return function(_0x5745ac){logger[_0x0aed('0x2a')](_0x5745ac[_0x0aed('0x2b')]);if(_0x5745ac[_0x0aed('0x2c')]){delete _0x5745ac[_0x0aed('0x2c')];}_0x5a1df8['status'](_0x29c111)[_0x0aed('0x2d')](_0x5745ac);};}exports[_0x0aed('0x2e')]=function(_0xff9269,_0x4cdaa4){var _0x381e15={},_0x491ba7={},_0x3557ec={'count':0x0,'rows':[]};var _0x30a540=_['map'](db[_0x0aed('0x2f')]['rawAttributes'],function(_0xb6140e){return{'name':_0xb6140e['fieldName'],'type':_0xb6140e['type'][_0x0aed('0x30')]};});_0x491ba7[_0x0aed('0x31')]=_[_0x0aed('0x32')](_0x30a540,_0x0aed('0x2c'));_0x491ba7[_0x0aed('0x33')]=_['keys'](_0xff9269[_0x0aed('0x33')]);_0x491ba7['filters']=_[_0x0aed('0x34')](_0x491ba7['model'],_0x491ba7[_0x0aed('0x33')]);_0x381e15[_0x0aed('0x35')]=_[_0x0aed('0x34')](_0x491ba7[_0x0aed('0x31')],qs['fields'](_0xff9269[_0x0aed('0x33')][_0x0aed('0x36')]));_0x381e15['attributes']=_0x381e15[_0x0aed('0x35')][_0x0aed('0x37')]?_0x381e15['attributes']:_0x491ba7[_0x0aed('0x31')];if(!_0xff9269[_0x0aed('0x33')][_0x0aed('0x38')](_0x0aed('0x39'))){_0x381e15[_0x0aed('0x1e')]=qs['limit'](_0xff9269[_0x0aed('0x33')][_0x0aed('0x1e')]);_0x381e15[_0x0aed('0x1d')]=qs['offset'](_0xff9269['query'][_0x0aed('0x1d')]);}_0x381e15['order']=qs[_0x0aed('0x3a')](_0xff9269[_0x0aed('0x33')]['sort']);_0x381e15['where']=qs[_0x0aed('0x3b')](_[_0x0aed('0x3c')](_0xff9269[_0x0aed('0x33')],_0x491ba7[_0x0aed('0x3b')]),_0x30a540);if(_0xff9269[_0x0aed('0x33')][_0x0aed('0x3d')]){_0x381e15[_0x0aed('0x3e')]=_[_0x0aed('0x3f')](_0x381e15[_0x0aed('0x3e')],{'$or':_[_0x0aed('0x32')](_0x30a540,function(_0x39d0a2){if(_0x39d0a2['type']!==_0x0aed('0x40')){var _0x3825b9={};_0x3825b9[_0x39d0a2['name']]={'$like':'%'+_0xff9269[_0x0aed('0x33')][_0x0aed('0x3d')]+'%'};return _0x3825b9;}})});}_0x381e15=_[_0x0aed('0x3f')]({},_0x381e15,_0xff9269[_0x0aed('0x41')]);var _0xefaab2={'where':_0x381e15[_0x0aed('0x3e')]};return db[_0x0aed('0x2f')][_0x0aed('0x42')](_0xefaab2)['then'](function(_0x2565d0){_0x3557ec[_0x0aed('0x42')]=_0x2565d0;if(_0xff9269[_0x0aed('0x33')][_0x0aed('0x43')]){_0x381e15[_0x0aed('0x44')]=[{'all':!![]}];}return db[_0x0aed('0x2f')]['findAll'](_0x381e15);})['then'](function(_0x4bdb22){_0x3557ec[_0x0aed('0x45')]=_0x4bdb22;return _0x3557ec;})[_0x0aed('0x25')](respondWithFilteredResult(_0x4cdaa4,_0x381e15))['catch'](handleError(_0x4cdaa4,null));};exports[_0x0aed('0x46')]=function(_0xc1bee4,_0x3a8cc1){var _0xbfca0b={'raw':![],'where':{'id':_0xc1bee4[_0x0aed('0x47')]['id']}},_0x12c9d1={};_0x12c9d1[_0x0aed('0x31')]=_[_0x0aed('0x48')](db[_0x0aed('0x2f')][_0x0aed('0x49')]);_0x12c9d1[_0x0aed('0x33')]=_[_0x0aed('0x48')](_0xc1bee4[_0x0aed('0x33')]);_0x12c9d1['filters']=_[_0x0aed('0x34')](_0x12c9d1[_0x0aed('0x31')],_0x12c9d1[_0x0aed('0x33')]);_0xbfca0b[_0x0aed('0x35')]=_[_0x0aed('0x34')](_0x12c9d1[_0x0aed('0x31')],qs[_0x0aed('0x36')](_0xc1bee4['query'][_0x0aed('0x36')]));_0xbfca0b[_0x0aed('0x35')]=_0xbfca0b['attributes'][_0x0aed('0x37')]?_0xbfca0b['attributes']:_0x12c9d1[_0x0aed('0x31')];if(_0xc1bee4[_0x0aed('0x33')][_0x0aed('0x43')]){_0xbfca0b[_0x0aed('0x44')]=[{'all':!![]}];}_0xbfca0b=_[_0x0aed('0x3f')]({},_0xbfca0b,_0xc1bee4[_0x0aed('0x41')]);return db[_0x0aed('0x2f')]['find'](_0xbfca0b)[_0x0aed('0x25')](handleEntityNotFound(_0x3a8cc1,null))['then'](respondWithResult(_0x3a8cc1,null))[_0x0aed('0x4a')](handleError(_0x3a8cc1,null));};exports[_0x0aed('0x4b')]=function(_0xb9380f,_0x286b0a){return db[_0x0aed('0x2f')]['create'](_0xb9380f[_0x0aed('0x4c')],{})[_0x0aed('0x25')](function(_0x511355){var _0x230ab6=_0xb9380f[_0x0aed('0x4d')][_0x0aed('0x27')]({'plain':!![]});if(!_0x230ab6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x230ab6['role']===_0x0aed('0x4d')){var _0x1c1439=_0x511355[_0x0aed('0x27')]({'plain':!![]});var _0x1d619a=_0x0aed('0x28');return db[_0x0aed('0x4e')][_0x0aed('0x4f')]({'where':{'name':_0x1d619a,'userProfileId':_0x230ab6[_0x0aed('0x50')]},'raw':!![]})['then'](function(_0x46d205){if(_0x46d205&&_0x46d205[_0x0aed('0x51')]===0x0){return db['UserProfileResource'][_0x0aed('0x4b')]({'name':_0x1c1439['name'],'resourceId':_0x1c1439['id'],'type':_0x46d205[_0x0aed('0x2c')],'sectionId':_0x46d205['id']},{})[_0x0aed('0x25')](function(){return _0x511355;});}else{return _0x511355;}})['catch'](function(_0x2d0db5){logger[_0x0aed('0x2a')](_0x0aed('0x52'),_0x2d0db5);throw _0x2d0db5;});}return _0x511355;})[_0x0aed('0x25')](respondWithResult(_0x286b0a,0xc9))['catch'](handleError(_0x286b0a,null));};exports[_0x0aed('0x24')]=function(_0x3cc84c,_0x5a2cd2){if(_0x3cc84c[_0x0aed('0x4c')]['id']){delete _0x3cc84c[_0x0aed('0x4c')]['id'];}return db[_0x0aed('0x2f')][_0x0aed('0x4f')]({'where':{'id':_0x3cc84c[_0x0aed('0x47')]['id']}})[_0x0aed('0x25')](handleEntityNotFound(_0x5a2cd2,null))[_0x0aed('0x25')](saveUpdates(_0x3cc84c[_0x0aed('0x4c')],null))[_0x0aed('0x25')](respondWithResult(_0x5a2cd2,null))[_0x0aed('0x4a')](handleError(_0x5a2cd2,null));};exports[_0x0aed('0x26')]=function(_0x44c273,_0x283b10){return db[_0x0aed('0x2f')][_0x0aed('0x4f')]({'where':{'id':_0x44c273[_0x0aed('0x47')]['id']}})[_0x0aed('0x25')](handleEntityNotFound(_0x283b10,null))[_0x0aed('0x25')](removeEntity(_0x283b10,null))[_0x0aed('0x4a')](handleError(_0x283b10,null));};exports['addAllCondition']=function(_0x3842e8,_0x146f8a,_0xab357){if(_0x3842e8[_0x0aed('0x4c')]['id']){delete _0x3842e8[_0x0aed('0x4c')]['id'];}return db[_0x0aed('0x2f')]['find']({'where':{'id':_0x3842e8[_0x0aed('0x47')]['id']}})[_0x0aed('0x25')](handleEntityNotFound(_0x146f8a,null))[_0x0aed('0x25')](function(_0x1217c3){if(_0x1217c3){_0x3842e8[_0x0aed('0x4c')][_0x0aed('0x53')]=_0x1217c3['id'];return db[_0x0aed('0x54')][_0x0aed('0x4b')](_0x3842e8[_0x0aed('0x4c')]);}})[_0x0aed('0x25')](respondWithResult(_0x146f8a,null))[_0x0aed('0x4a')](handleError(_0x146f8a,null));};exports[_0x0aed('0x55')]=function(_0x5d6503,_0x47195c,_0x51b532){if(_0x5d6503[_0x0aed('0x4c')]['id']){delete _0x5d6503['body']['id'];}return db[_0x0aed('0x2f')][_0x0aed('0x4f')]({'where':{'id':_0x5d6503[_0x0aed('0x47')]['id']}})[_0x0aed('0x25')](handleEntityNotFound(_0x47195c,null))['then'](function(_0x221b13){if(_0x221b13){_0x5d6503['body'][_0x0aed('0x56')]=_0x221b13['id'];return db['Condition'][_0x0aed('0x4b')](_0x5d6503[_0x0aed('0x4c')]);}})[_0x0aed('0x25')](respondWithResult(_0x47195c,null))[_0x0aed('0x4a')](handleError(_0x47195c,null));};exports[_0x0aed('0x57')]=function(_0x49b558,_0x838b7a,_0x379390){var _0x475622={};var _0x5bf050={};var _0x4f1789;var _0x4c71b7;return db[_0x0aed('0x2f')][_0x0aed('0x58')]({'where':{'id':_0x49b558[_0x0aed('0x47')]['id']}})['then'](handleEntityNotFound(_0x838b7a,null))[_0x0aed('0x25')](function(_0xf5e2d4){if(_0xf5e2d4){_0x4f1789=_0xf5e2d4;_0x5bf050['model']=_[_0x0aed('0x48')](db[_0x0aed('0x54')][_0x0aed('0x49')]);_0x5bf050['query']=_[_0x0aed('0x48')](_0x49b558[_0x0aed('0x33')]);_0x5bf050['filters']=_[_0x0aed('0x34')](_0x5bf050['model'],_0x5bf050[_0x0aed('0x33')]);_0x475622[_0x0aed('0x35')]=_[_0x0aed('0x34')](_0x5bf050[_0x0aed('0x31')],qs[_0x0aed('0x36')](_0x49b558[_0x0aed('0x33')][_0x0aed('0x36')]));_0x475622['attributes']=_0x475622[_0x0aed('0x35')][_0x0aed('0x37')]?_0x475622[_0x0aed('0x35')]:_0x5bf050['model'];_0x475622[_0x0aed('0x59')]=qs[_0x0aed('0x3a')](_0x49b558['query']['sort']);_0x475622[_0x0aed('0x3e')]=qs[_0x0aed('0x3b')](_[_0x0aed('0x3c')](_0x49b558[_0x0aed('0x33')],_0x5bf050[_0x0aed('0x3b')]));if(_0x49b558[_0x0aed('0x33')]['filter']){_0x475622[_0x0aed('0x3e')]=_[_0x0aed('0x3f')](_0x475622[_0x0aed('0x3e')],{'$or':_[_0x0aed('0x32')](_0x475622[_0x0aed('0x35')],function(_0x1efac2){var _0x521d66={};_0x521d66[_0x1efac2]={'$like':'%'+_0x49b558[_0x0aed('0x33')][_0x0aed('0x3d')]+'%'};return _0x521d66;})});}_0x475622=_['merge']({},_0x475622,_0x49b558['options']);return _0x4f1789[_0x0aed('0x57')](_0x475622);}})['then'](function(_0x6ee791){if(_0x6ee791){_0x4c71b7=_0x6ee791[_0x0aed('0x37')];if(!_0x49b558[_0x0aed('0x33')][_0x0aed('0x38')]('nolimit')){_0x475622[_0x0aed('0x1e')]=qs[_0x0aed('0x1e')](_0x49b558[_0x0aed('0x33')][_0x0aed('0x1e')]);_0x475622['offset']=qs['offset'](_0x49b558[_0x0aed('0x33')][_0x0aed('0x1d')]);}return _0x4f1789[_0x0aed('0x57')](_0x475622);}})[_0x0aed('0x25')](function(_0x5bf354){if(_0x5bf354){return _0x5bf354?{'count':_0x4c71b7,'rows':_0x5bf354}:null;}})[_0x0aed('0x25')](respondWithResult(_0x838b7a,null))[_0x0aed('0x4a')](handleError(_0x838b7a,null));};exports[_0x0aed('0x5a')]=function(_0x12d600,_0x386cbb,_0x23c4ec){var _0x178896={};var _0x4ab96b={};var _0x27b1f1;var _0x4017eb;return db[_0x0aed('0x2f')][_0x0aed('0x58')]({'where':{'id':_0x12d600[_0x0aed('0x47')]['id']}})['then'](handleEntityNotFound(_0x386cbb,null))[_0x0aed('0x25')](function(_0x1c6ed7){if(_0x1c6ed7){_0x27b1f1=_0x1c6ed7;_0x4ab96b[_0x0aed('0x31')]=_[_0x0aed('0x48')](db[_0x0aed('0x54')]['rawAttributes']);_0x4ab96b[_0x0aed('0x33')]=_[_0x0aed('0x48')](_0x12d600['query']);_0x4ab96b[_0x0aed('0x3b')]=_[_0x0aed('0x34')](_0x4ab96b['model'],_0x4ab96b[_0x0aed('0x33')]);_0x178896['attributes']=_['intersection'](_0x4ab96b[_0x0aed('0x31')],qs[_0x0aed('0x36')](_0x12d600[_0x0aed('0x33')]['fields']));_0x178896[_0x0aed('0x35')]=_0x178896['attributes'][_0x0aed('0x37')]?_0x178896[_0x0aed('0x35')]:_0x4ab96b['model'];_0x178896[_0x0aed('0x59')]=qs[_0x0aed('0x3a')](_0x12d600['query'][_0x0aed('0x3a')]);_0x178896[_0x0aed('0x3e')]=qs[_0x0aed('0x3b')](_[_0x0aed('0x3c')](_0x12d600[_0x0aed('0x33')],_0x4ab96b['filters']));if(_0x12d600[_0x0aed('0x33')]['filter']){_0x178896[_0x0aed('0x3e')]=_[_0x0aed('0x3f')](_0x178896[_0x0aed('0x3e')],{'$or':_['map'](_0x178896[_0x0aed('0x35')],function(_0x29bcc4){var _0x360d23={};_0x360d23[_0x29bcc4]={'$like':'%'+_0x12d600[_0x0aed('0x33')]['filter']+'%'};return _0x360d23;})});}_0x178896=_[_0x0aed('0x3f')]({},_0x178896,_0x12d600[_0x0aed('0x41')]);return _0x27b1f1[_0x0aed('0x5a')](_0x178896);}})[_0x0aed('0x25')](function(_0x21d072){if(_0x21d072){_0x4017eb=_0x21d072[_0x0aed('0x37')];if(!_0x12d600[_0x0aed('0x33')][_0x0aed('0x38')](_0x0aed('0x39'))){_0x178896[_0x0aed('0x1e')]=qs['limit'](_0x12d600[_0x0aed('0x33')][_0x0aed('0x1e')]);_0x178896[_0x0aed('0x1d')]=qs[_0x0aed('0x1d')](_0x12d600['query'][_0x0aed('0x1d')]);}return _0x27b1f1[_0x0aed('0x5a')](_0x178896);}})[_0x0aed('0x25')](function(_0x369cfb){if(_0x369cfb){return _0x369cfb?{'count':_0x4017eb,'rows':_0x369cfb}:null;}})[_0x0aed('0x25')](respondWithResult(_0x386cbb,null))['catch'](handleError(_0x386cbb,null));};exports['addAction']=function(_0x1a547d,_0x21d82d,_0x57c827){if(_0x1a547d[_0x0aed('0x4c')]['id']){delete _0x1a547d[_0x0aed('0x4c')]['id'];}return db[_0x0aed('0x2f')][_0x0aed('0x4f')]({'where':{'id':_0x1a547d[_0x0aed('0x47')]['id']}})[_0x0aed('0x25')](handleEntityNotFound(_0x21d82d,null))[_0x0aed('0x25')](function(_0x151370){if(_0x151370){_0x1a547d[_0x0aed('0x4c')][_0x0aed('0x5b')]=_0x151370['id'];return db[_0x0aed('0x5c')]['create'](_0x1a547d[_0x0aed('0x4c')]);}})[_0x0aed('0x25')](respondWithResult(_0x21d82d,null))[_0x0aed('0x4a')](handleError(_0x21d82d,null));};exports[_0x0aed('0x5d')]=function(_0x32d031,_0x8697dc,_0xacc3b6){var _0x30f436={};var _0x54ac42={};var _0x45eb7c;var _0xff7ab9;return db[_0x0aed('0x2f')][_0x0aed('0x58')]({'where':{'id':_0x32d031[_0x0aed('0x47')]['id']}})[_0x0aed('0x25')](handleEntityNotFound(_0x8697dc,null))[_0x0aed('0x25')](function(_0x3dbe1c){if(_0x3dbe1c){_0x45eb7c=_0x3dbe1c;_0x54ac42[_0x0aed('0x31')]=_[_0x0aed('0x48')](db[_0x0aed('0x5c')][_0x0aed('0x49')]);_0x54ac42[_0x0aed('0x33')]=_['keys'](_0x32d031[_0x0aed('0x33')]);_0x54ac42[_0x0aed('0x3b')]=_[_0x0aed('0x34')](_0x54ac42['model'],_0x54ac42[_0x0aed('0x33')]);_0x30f436[_0x0aed('0x35')]=_[_0x0aed('0x34')](_0x54ac42[_0x0aed('0x31')],qs['fields'](_0x32d031['query']['fields']));_0x30f436['attributes']=_0x30f436[_0x0aed('0x35')][_0x0aed('0x37')]?_0x30f436[_0x0aed('0x35')]:_0x54ac42[_0x0aed('0x31')];_0x30f436['order']=qs[_0x0aed('0x3a')](_0x32d031[_0x0aed('0x33')][_0x0aed('0x3a')]);_0x30f436[_0x0aed('0x3e')]=qs[_0x0aed('0x3b')](_[_0x0aed('0x3c')](_0x32d031['query'],_0x54ac42[_0x0aed('0x3b')]));if(_0x32d031[_0x0aed('0x33')][_0x0aed('0x3d')]){_0x30f436[_0x0aed('0x3e')]=_[_0x0aed('0x3f')](_0x30f436[_0x0aed('0x3e')],{'$or':_['map'](_0x30f436[_0x0aed('0x35')],function(_0x109f9c){var _0x56e61d={};_0x56e61d[_0x109f9c]={'$like':'%'+_0x32d031['query'][_0x0aed('0x3d')]+'%'};return _0x56e61d;})});}_0x30f436=_[_0x0aed('0x3f')]({},_0x30f436,_0x32d031[_0x0aed('0x41')]);return _0x45eb7c[_0x0aed('0x5d')](_0x30f436);}})[_0x0aed('0x25')](function(_0xc663a2){if(_0xc663a2){_0xff7ab9=_0xc663a2['length'];if(!_0x32d031[_0x0aed('0x33')]['hasOwnProperty']('nolimit')){_0x30f436[_0x0aed('0x1e')]=qs['limit'](_0x32d031[_0x0aed('0x33')]['limit']);_0x30f436[_0x0aed('0x1d')]=qs[_0x0aed('0x1d')](_0x32d031['query']['offset']);}return _0x45eb7c[_0x0aed('0x5d')](_0x30f436);}})[_0x0aed('0x25')](function(_0xb62dde){if(_0xb62dde){return _0xb62dde?{'count':_0xff7ab9,'rows':_0xb62dde}:null;}})['then'](respondWithResult(_0x8697dc,null))['catch'](handleError(_0x8697dc,null));};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js
index f701258..42db5a7 100644
--- a/server/api/trigger/trigger.model.js
+++ b/server/api/trigger/trigger.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['request-promise','path','../../config/environment','exports','Trigger','tools_triggers','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./trigger.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ef3=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./trigger.attributes'];(function(_0x42e31c,_0x19261e){var _0x2af6de=function(_0x2c4b6b){while(--_0x2c4b6b){_0x42e31c['push'](_0x42e31c['shift']());}};_0x2af6de(++_0x19261e);}(_0x2ef3,0xba));var _0x32ef=function(_0x3f36b1,_0x360f4e){_0x3f36b1=_0x3f36b1-0x0;var _0x564080=_0x2ef3[_0x3f36b1];return _0x564080;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js
index ed65c16..4e32960 100644
--- a/server/api/trigger/trigger.rpc.js
+++ b/server/api/trigger/trigger.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb58b=['model','map','debug','catch','ShowTrigger','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0xb58b,0x1f1));var _0xbb58=function(_0x3befd3,_0x45bd8a){_0x3befd3=_0x3befd3-0x0;var _0x1218bf=_0xb58b[_0x3befd3];return _0x1218bf;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb58('0x3'));var db=require(_0xbb58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb58('0x5'))('rpc');var config=require(_0xbb58('0x6'));var jayson=require(_0xbb58('0x7'));var client=jayson[_0xbb58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27cbda,_0x323066,_0xe874f2){return new BPromise(function(_0x5d7fe8,_0xd94f1){return client[_0xbb58('0x9')](_0x27cbda,_0xe874f2)[_0xbb58('0xa')](function(_0x36ca50){logger[_0xbb58('0xb')](_0xbb58('0xc'),_0x323066,_0xbb58('0xd'));logger['debug'](_0xbb58('0xe'),_0x323066,'request\x20sent',JSON[_0xbb58('0xf')](_0x36ca50));if(_0x36ca50[_0xbb58('0x10')]){if(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x11')]===0x1f4){logger['error'](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0xd94f1(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}logger[_0xbb58('0x10')](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0x5d7fe8(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x323066,_0xbb58('0xd'));_0x5d7fe8(_0x36ca50[_0xbb58('0x13')][_0xbb58('0x12')]);}})['catch'](function(_0x5edc97){logger['error']('Trigger,\x20%s,\x20%s',_0x323066,_0x5edc97);_0xd94f1(_0x5edc97);});});}exports[_0xbb58('0x14')]=function(_0x3134ea){var _0x48f3e0=this;return new Promise(function(_0xbee66,_0x497653){return db[_0xbb58('0x15')][_0xbb58('0x16')]({'raw':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x18')]===undefined?!![]:![]:!![],'where':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')]['where']||null:null,'attributes':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x19')]||null:null,'limit':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x1a')]||null:null,'include':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x1b')]?_['map'](_0x3134ea[_0xbb58('0x17')]['include'],function(_0x21964d){return{'model':db[_0x21964d[_0xbb58('0x1c')]],'as':_0x21964d['as'],'attributes':_0x21964d[_0xbb58('0x19')],'include':_0x21964d[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x21964d[_0xbb58('0x1b')],function(_0x2d556a){return{'model':db[_0x2d556a[_0xbb58('0x1c')]],'as':_0x2d556a['as'],'attributes':_0x2d556a['attributes'],'include':_0x2d556a[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x2d556a[_0xbb58('0x1b')],function(_0x129094){return{'model':db[_0x129094[_0xbb58('0x1c')]],'as':_0x129094['as'],'attributes':_0x129094[_0xbb58('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbb58('0xa')](function(_0x2ce7c3){logger[_0xbb58('0xb')](_0xbb58('0x14'),_0x3134ea);logger[_0xbb58('0x1e')](_0xbb58('0x14'),_0x3134ea,JSON[_0xbb58('0xf')](_0x2ce7c3));_0xbee66(_0x2ce7c3);})[_0xbb58('0x1f')](function(_0x3559b6){logger['error'](_0xbb58('0x14'),_0x3559b6[_0xbb58('0x12')],_0x3134ea);_0x497653(_0x48f3e0[_0xbb58('0x10')](0x1f4,_0x3559b6[_0xbb58('0x12')]));});});};exports[_0xbb58('0x20')]=function(_0x9d379f){var _0x1ba526=this;return new Promise(function(_0x643e0e,_0x3f8db3){return db['Trigger'][_0xbb58('0x21')]({'raw':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x18')]===undefined?!![]:![]:!![],'where':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x22')]||null:null,'attributes':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x19')]||null:null,'include':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x1b')]?_['map'](_0x9d379f['options']['include'],function(_0x1def9f){return{'model':db[_0x1def9f[_0xbb58('0x1c')]],'as':_0x1def9f['as'],'attributes':_0x1def9f[_0xbb58('0x19')],'include':_0x1def9f[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x1def9f[_0xbb58('0x1b')],function(_0x3093bf){return{'model':db[_0x3093bf[_0xbb58('0x1c')]],'as':_0x3093bf['as'],'attributes':_0x3093bf['attributes'],'include':_0x3093bf[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x3093bf['include'],function(_0x33ec68){return{'model':db[_0x33ec68['model']],'as':_0x33ec68['as'],'attributes':_0x33ec68[_0xbb58('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x86372e){logger[_0xbb58('0xb')]('ShowTrigger',_0x9d379f);logger[_0xbb58('0x1e')](_0xbb58('0x20'),_0x9d379f,JSON[_0xbb58('0xf')](_0x86372e));_0x643e0e(_0x86372e);})[_0xbb58('0x1f')](function(_0x1b86a6){logger[_0xbb58('0x10')](_0xbb58('0x20'),_0x1b86a6[_0xbb58('0x12')],_0x9d379f);_0x3f8db3(_0x1ba526['error'](0x1f4,_0x1b86a6[_0xbb58('0x12')]));});});};
\ No newline at end of file
+var _0x1c9a=['limit','include','map','attributes','model','ShowTrigger','find','where','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw'];(function(_0x3caa43,_0x2e178b){var _0x1bb66e=function(_0x4a1a86){while(--_0x4a1a86){_0x3caa43['push'](_0x3caa43['shift']());}};_0x1bb66e(++_0x2e178b);}(_0x1c9a,0x98));var _0xa1c9=function(_0x175459,_0x53ef22){_0x175459=_0x175459-0x0;var _0x3ab8d0=_0x1c9a[_0x175459];return _0x3ab8d0;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('Trigger,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});}exports[_0xa1c9('0x17')]=function(_0x224ae4){var _0x50db9b=this;return new Promise(function(_0x2fb81e,_0x5ab911){return db[_0xa1c9('0x18')][_0xa1c9('0x19')]({'raw':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4['options'][_0xa1c9('0x1b')]===undefined?!![]:![]:!![],'where':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')]['where']||null:null,'attributes':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')]['attributes']||null:null,'limit':_0x224ae4[_0xa1c9('0x1a')]?_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1c')]||null:null,'include':_0x224ae4['options']?_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1d')]?_[_0xa1c9('0x1e')](_0x224ae4[_0xa1c9('0x1a')][_0xa1c9('0x1d')],function(_0x4a0a0c){return{'model':db[_0x4a0a0c['model']],'as':_0x4a0a0c['as'],'attributes':_0x4a0a0c[_0xa1c9('0x1f')],'include':_0x4a0a0c['include']?_[_0xa1c9('0x1e')](_0x4a0a0c[_0xa1c9('0x1d')],function(_0x1c6f37){return{'model':db[_0x1c6f37[_0xa1c9('0x20')]],'as':_0x1c6f37['as'],'attributes':_0x1c6f37[_0xa1c9('0x1f')],'include':_0x1c6f37['include']?_[_0xa1c9('0x1e')](_0x1c6f37[_0xa1c9('0x1d')],function(_0x20cbe1){return{'model':db[_0x20cbe1['model']],'as':_0x20cbe1['as'],'attributes':_0x20cbe1[_0xa1c9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xb')](function(_0x1ca443){logger['info'](_0xa1c9('0x17'),_0x224ae4);logger[_0xa1c9('0xe')]('GetTrigger',_0x224ae4,JSON[_0xa1c9('0x10')](_0x1ca443));_0x2fb81e(_0x1ca443);})['catch'](function(_0xdf6d0c){logger[_0xa1c9('0x11')](_0xa1c9('0x17'),_0xdf6d0c[_0xa1c9('0x14')],_0x224ae4);_0x5ab911(_0x50db9b[_0xa1c9('0x11')](0x1f4,_0xdf6d0c[_0xa1c9('0x14')]));});});};exports[_0xa1c9('0x21')]=function(_0x58b900){var _0x5648b8=this;return new Promise(function(_0x4d23cd,_0x1c7038){return db[_0xa1c9('0x18')][_0xa1c9('0x22')]({'raw':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x58b900['options']?_0x58b900['options'][_0xa1c9('0x23')]||null:null,'attributes':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')][_0xa1c9('0x1f')]||null:null,'include':_0x58b900[_0xa1c9('0x1a')]?_0x58b900[_0xa1c9('0x1a')][_0xa1c9('0x1d')]?_['map'](_0x58b900[_0xa1c9('0x1a')]['include'],function(_0x1b8707){return{'model':db[_0x1b8707['model']],'as':_0x1b8707['as'],'attributes':_0x1b8707[_0xa1c9('0x1f')],'include':_0x1b8707[_0xa1c9('0x1d')]?_[_0xa1c9('0x1e')](_0x1b8707['include'],function(_0x39818f){return{'model':db[_0x39818f[_0xa1c9('0x20')]],'as':_0x39818f['as'],'attributes':_0x39818f[_0xa1c9('0x1f')],'include':_0x39818f[_0xa1c9('0x1d')]?_['map'](_0x39818f['include'],function(_0x1f1612){return{'model':db[_0x1f1612[_0xa1c9('0x20')]],'as':_0x1f1612['as'],'attributes':_0x1f1612[_0xa1c9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xb')](function(_0x1c0cce){logger[_0xa1c9('0xc')](_0xa1c9('0x21'),_0x58b900);logger[_0xa1c9('0xe')](_0xa1c9('0x21'),_0x58b900,JSON[_0xa1c9('0x10')](_0x1c0cce));_0x4d23cd(_0x1c0cce);})['catch'](function(_0x3e6ec0){logger[_0xa1c9('0x11')](_0xa1c9('0x21'),_0x3e6ec0[_0xa1c9('0x14')],_0x58b900);_0x1c7038(_0x5648b8[_0xa1c9('0x11')](0x1f4,_0x3e6ec0[_0xa1c9('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js
index fabf174..db8c923 100644
--- a/server/api/trunk/index.js
+++ b/server/api/trunk/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x54ef=['isAuthenticated','post','clone','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','/:id'];(function(_0x46ab67,_0x302f5f){var _0x42cf9b=function(_0x3aaa3d){while(--_0x3aaa3d){_0x46ab67['push'](_0x46ab67['shift']());}};_0x42cf9b(++_0x302f5f);}(_0x54ef,0x112));var _0xf54e=function(_0x1f5a54,_0xc5af01){_0x1f5a54=_0x1f5a54-0x0;var _0x4954e4=_0x54ef[_0x1f5a54];return _0x4954e4;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var auth=require(_0xf54e('0x5'));var interaction=require(_0xf54e('0x6'));var config=require(_0xf54e('0x7'));var controller=require(_0xf54e('0x8'));router[_0xf54e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf54e('0x9')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['show']);router[_0xf54e('0xc')]('/:id/clone',auth[_0xf54e('0xb')](),controller[_0xf54e('0xd')]);router['post']('/',auth[_0xf54e('0xb')](),controller[_0xf54e('0xe')]);router[_0xf54e('0xf')](_0xf54e('0xa'),auth['isAuthenticated'](),controller[_0xf54e('0x10')]);router[_0xf54e('0x11')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['destroy']);module[_0xf54e('0x12')]=router;
\ No newline at end of file
+var _0xa41a=['../../config/environment','./trunk.controller','get','index','show','post','isAuthenticated','clone','create','put','/:id','update','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2159ae,_0x31040c){var _0x4649d1=function(_0x528ca1){while(--_0x528ca1){_0x2159ae['push'](_0x2159ae['shift']());}};_0x4649d1(++_0x31040c);}(_0xa41a,0x6b));var _0xaa41=function(_0x5edf28,_0x16c6b5){_0x5edf28=_0x5edf28-0x0;var _0x2cfdf9=_0xa41a[_0x5edf28];return _0x2cfdf9;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var auth=require(_0xaa41('0x5'));var interaction=require(_0xaa41('0x6'));var config=require(_0xaa41('0x7'));var controller=require(_0xaa41('0x8'));router[_0xaa41('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa41('0xa')]);router[_0xaa41('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xaa41('0xb')]);router[_0xaa41('0xc')]('/:id/clone',auth[_0xaa41('0xd')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xc')]('/',auth[_0xaa41('0xd')](),controller[_0xaa41('0xf')]);router[_0xaa41('0x10')](_0xaa41('0x11'),auth[_0xaa41('0xd')](),controller[_0xaa41('0x12')]);router['delete'](_0xaa41('0x11'),auth[_0xaa41('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js
index 1f6b858..f8b9ea6 100644
--- a/server/api/trunk/trunk.attributes.js
+++ b/server/api/trunk/trunk.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd9c7=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','INTEGER','accept','refuse','originate','uac','uas','pai','fingerprint','active','actpass','dynamic','sequelize','exports','name','ENUM','friend','peer','STRING','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','rfc2833','shortinfo','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure'];(function(_0x5bbbe1,_0x12bbc4){var _0xc27b6f=function(_0x181891){while(--_0x181891){_0x5bbbe1['push'](_0x5bbbe1['shift']());}};_0xc27b6f(++_0x12bbc4);}(_0xd9c7,0xcb));var _0x7d9c=function(_0x24c8fe,_0x436a94){_0x24c8fe=_0x24c8fe-0x0;var _0x55c496=_0xd9c7[_0x24c8fe];return _0x55c496;};'use strict';var Sequelize=require(_0x7d9c('0x0'));module[_0x7d9c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d9c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x4'),'user',_0x7d9c('0x5')),'allowNull':![],'defaultValue':_0x7d9c('0x4')},'context':{'type':Sequelize[_0x7d9c('0x6')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x7d9c('0x7'),_0x7d9c('0x8'),_0x7d9c('0x9'),'ALLOWED',_0x7d9c('0xa'),'PROHIB_PASSED_SCREEN',_0x7d9c('0xb'),_0x7d9c('0xc'))},'deny':{'type':Sequelize[_0x7d9c('0x6')]},'permit':{'type':Sequelize[_0x7d9c('0x6')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x7d9c('0x6')]},'remotesecret':{'type':Sequelize[_0x7d9c('0x6')]},'transport':{'type':Sequelize[_0x7d9c('0x6')],'defaultValue':_0x7d9c('0xd'),'set':function(_0x5d7701){this[_0x7d9c('0xe')](_0x7d9c('0xf'),_0x5d7701?_0x5d7701[_0x7d9c('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x7d9c('0xf'))?this[_0x7d9c('0x11')](_0x7d9c('0xf'))[_0x7d9c('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x13'),'info',_0x7d9c('0x14'),'inband','auto'),'defaultValue':_0x7d9c('0x13')},'directmedia':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no',_0x7d9c('0x16'),_0x7d9c('0x17'),_0x7d9c('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7d9c('0x6')]},'directmediadeny':{'type':Sequelize[_0x7d9c('0x6')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x7d9c('0x19'),'set':function(_0x3a9adb){this['setDataValue'](_0x7d9c('0x1a'),_0x3a9adb?_0x3a9adb[_0x7d9c('0x10')](','):null);},'get':function(){return this[_0x7d9c('0x11')](_0x7d9c('0x1a'))?this[_0x7d9c('0x11')](_0x7d9c('0x1a'))[_0x7d9c('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x7d9c('0x6')]},'namedcallgroup':{'type':Sequelize[_0x7d9c('0x6')]},'pickupgroup':{'type':Sequelize[_0x7d9c('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x7d9c('0x6')]},'language':{'type':Sequelize[_0x7d9c('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7d9c('0x6')],'defaultValue':_0x7d9c('0x1b')},'allow':{'type':Sequelize[_0x7d9c('0x6')],'allowNull':![],'defaultValue':_0x7d9c('0x1c'),'set':function(_0x559967){this[_0x7d9c('0xe')]('allow',_0x559967?_0x559967['join'](';'):_0x7d9c('0x1c'));},'get':function(){return this[_0x7d9c('0x11')]('allow')?this[_0x7d9c('0x11')](_0x7d9c('0x1d'))[_0x7d9c('0x12')](';'):null;},'comment':_0x7d9c('0x1e')},'autoframing':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x243984){this['setDataValue']('insecure',_0x243984?_0x243984[_0x7d9c('0x10')](','):null);},'get':function(){return this[_0x7d9c('0x11')](_0x7d9c('0x1f'))?this['getDataValue'](_0x7d9c('0x1f'))['split'](','):null;},'comment':_0x7d9c('0x20')},'trustrpid':{'type':Sequelize['ENUM'](_0x7d9c('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x7d9c('0x15'),'no',_0x7d9c('0x21'))},'promiscredir':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'useclientcode':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x7d9c('0x6')]},'callerid':{'type':Sequelize[_0x7d9c('0x6')],'defaultValue':_0x7d9c('0x22')},'amaflags':{'type':Sequelize[_0x7d9c('0x6')]},'callcounter':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no'),'defaultValue':_0x7d9c('0x15')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0x7d9c('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x7d9c('0x15'),'no',_0x7d9c('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7d9c('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'mailbox':{'type':Sequelize[_0x7d9c('0x6')]},'session_timers':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x25'),_0x7d9c('0x26'),_0x7d9c('0x27'))},'session_expires':{'type':Sequelize[_0x7d9c('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x7d9c('0x28'),_0x7d9c('0x29')),'defaultValue':_0x7d9c('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x7d9c('0x6')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x7d9c('0x6')]},'fromuser':{'type':Sequelize[_0x7d9c('0x6')]},'port':{'type':Sequelize[_0x7d9c('0x24')](0x5)},'qualify':{'type':Sequelize[_0x7d9c('0x3')]('yes','no'),'defaultValue':_0x7d9c('0x15')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x7d9c('0x6')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7d9c('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no',_0x7d9c('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7d9c('0x6')]},'callbackextension':{'type':Sequelize[_0x7d9c('0x6')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x7d9c('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7d9c('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x7d9c('0x6')]},'contactdeny':{'type':Sequelize[_0x7d9c('0x6')]},'contactacl':{'type':Sequelize[_0x7d9c('0x6')]},'unsolicited_mailbox':{'type':Sequelize[_0x7d9c('0x6')]},'use_q850_reason':{'type':Sequelize[_0x7d9c('0x6')]},'maxforwards':{'type':Sequelize[_0x7d9c('0x24')](0xb)},'encryption':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'force_avp':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'icesupport':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x7d9c('0x3')]('yes','no',_0x7d9c('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x7d9c('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x7d9c('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x7d9c('0x6')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x7d9c('0x6')]},'dtlssetup':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x2c'),'passive',_0x7d9c('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7d9c('0x6')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x7d9c('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0x7d9c('0x3')](_0x7d9c('0x15'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x7d9c('0x6')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7d9c('0x6')],'defaultValue':_0x7d9c('0x2e')},'canreinvite':{'type':Sequelize[_0x7d9c('0x3')]('yes','no','nonat','update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7d9c('0x6')]},'otherFields':{'type':Sequelize[_0x7d9c('0x6')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7d9c('0x6')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x1349=['originate','uac','uas','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','refuse'];(function(_0x1380da,_0x1b173a){var _0x3efa00=function(_0x24c00b){while(--_0x24c00b){_0x1380da['push'](_0x1380da['shift']());}};_0x3efa00(++_0x1b173a);}(_0x1349,0xaa));var _0x9134=function(_0x5b0522,_0x3ec811){_0x5b0522=_0x5b0522-0x0;var _0x180407=_0x1349[_0x5b0522];return _0x180407;};'use strict';var Sequelize=require(_0x9134('0x0'));module['exports']={'name':{'type':Sequelize[_0x9134('0x1')],'allowNull':![],'unique':_0x9134('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x9134('0x3'),_0x9134('0x4'),_0x9134('0x5')),'allowNull':![],'defaultValue':_0x9134('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9134('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x9134('0x7'),_0x9134('0x8'),_0x9134('0x9'),'ALLOWED',_0x9134('0xa'),_0x9134('0xb'),_0x9134('0xc'),_0x9134('0xd'))},'deny':{'type':Sequelize[_0x9134('0x1')]},'permit':{'type':Sequelize[_0x9134('0x1')]},'secret':{'type':Sequelize[_0x9134('0x1')]},'md5secret':{'type':Sequelize[_0x9134('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x9134('0x1')],'defaultValue':'udp','set':function(_0x2b08ab){this[_0x9134('0xe')]('transport',_0x2b08ab?_0x2b08ab[_0x9134('0xf')](','):null);},'get':function(){return this[_0x9134('0x10')]('transport')?this[_0x9134('0x10')](_0x9134('0x11'))[_0x9134('0x12')](','):null;},'comment':_0x9134('0x13')},'dtmfmode':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x15'),_0x9134('0x16'),_0x9134('0x17'),'inband',_0x9134('0x18')),'defaultValue':_0x9134('0x15')},'directmedia':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no',_0x9134('0x1a'),_0x9134('0x1b'),_0x9134('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9134('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x9134('0x1')],'defaultValue':_0x9134('0x1d'),'set':function(_0x5de5ae){this['setDataValue']('nat',_0x5de5ae?_0x5de5ae[_0x9134('0xf')](','):null);},'get':function(){return this['getDataValue'](_0x9134('0x1e'))?this[_0x9134('0x10')](_0x9134('0x1e'))['split'](','):null;},'comment':_0x9134('0x1f')},'callgroup':{'type':Sequelize[_0x9134('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9134('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9134('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0x9134('0x1')],'allowNull':![],'defaultValue':_0x9134('0x20'),'set':function(_0x5b984d){this[_0x9134('0xe')](_0x9134('0x21'),_0x5b984d?_0x5b984d['join'](';'):_0x9134('0x20'));},'get':function(){return this[_0x9134('0x10')](_0x9134('0x21'))?this[_0x9134('0x10')]('allow')['split'](';'):null;},'comment':_0x9134('0x22')},'autoframing':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no')},'insecure':{'type':Sequelize[_0x9134('0x1')],'defaultValue':_0x9134('0x23'),'set':function(_0x27a355){this[_0x9134('0xe')](_0x9134('0x24'),_0x27a355?_0x27a355['join'](','):null);},'get':function(){return this[_0x9134('0x10')](_0x9134('0x24'))?this[_0x9134('0x10')](_0x9134('0x24'))[_0x9134('0x12')](','):null;},'comment':_0x9134('0x25')},'trustrpid':{'type':Sequelize[_0x9134('0x14')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no',_0x9134('0x26'))},'promiscredir':{'type':Sequelize[_0x9134('0x14')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x9134('0x19'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x9134('0x1')]},'callerid':{'type':Sequelize[_0x9134('0x1')],'defaultValue':_0x9134('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x9134('0x19'),'no'),'defaultValue':_0x9134('0x19')},'busylevel':{'type':Sequelize[_0x9134('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9134('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x9134('0x14')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x9134('0x14')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x9134('0x1')]},'videosupport':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9134('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x9134('0x14')]('accept',_0x9134('0x29'),_0x9134('0x2a'))},'session_expires':{'type':Sequelize[_0x9134('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x9134('0x28')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x9134('0x2b'),_0x9134('0x2c')),'defaultValue':_0x9134('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x9134('0x1')]},'regexten':{'type':Sequelize[_0x9134('0x1')]},'fromdomain':{'type':Sequelize[_0x9134('0x1')]},'fromuser':{'type':Sequelize[_0x9134('0x1')]},'port':{'type':Sequelize[_0x9134('0x28')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x9134('0x19'),'no'),'defaultValue':_0x9134('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x9134('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x9134('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9134('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9134('0x1')]},'callbackextension':{'type':Sequelize[_0x9134('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x9134('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x9134('0x1')]},'contactdeny':{'type':Sequelize[_0x9134('0x1')]},'contactacl':{'type':Sequelize[_0x9134('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x9134('0x1')]},'use_q850_reason':{'type':Sequelize[_0x9134('0x1')]},'maxforwards':{'type':Sequelize[_0x9134('0x28')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no')},'icesupport':{'type':Sequelize[_0x9134('0x14')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x9134('0x14')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no',_0x9134('0x2d'),_0x9134('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x9134('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9134('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x9134('0x1')]},'dtlscipher':{'type':Sequelize[_0x9134('0x1')]},'dtlscafile':{'type':Sequelize[_0x9134('0x1')]},'dtlscapath':{'type':Sequelize[_0x9134('0x1')]},'dtlssetup':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x2f'),_0x9134('0x30'),_0x9134('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9134('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0x9134('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9134('0x1')]},'recordofffeature':{'type':Sequelize[_0x9134('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x9134('0x14')](_0x9134('0x19'),'no')},'vmexten':{'type':Sequelize[_0x9134('0x1')]},'mohinterpret':{'type':Sequelize[_0x9134('0x1')]},'mohsuggest':{'type':Sequelize[_0x9134('0x1')]},'parkinglot':{'type':Sequelize[_0x9134('0x1')]},'description':{'type':Sequelize[_0x9134('0x1')]},'host':{'type':Sequelize[_0x9134('0x1')],'defaultValue':_0x9134('0x32')},'canreinvite':{'type':Sequelize[_0x9134('0x14')]('yes','no',_0x9134('0x1a'),_0x9134('0x1b'),_0x9134('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9134('0x1')]},'otherFields':{'type':Sequelize[_0x9134('0x1')]},'active':{'type':Sequelize[_0x9134('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js
index 0a59f08..5c42ef2 100644
--- a/server/api/trunk/trunk.controller.js
+++ b/server/api/trunk/trunk.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9434=['where','filter','merge','options','Trunk','includeAll','include','catch','params','clone','find','omit','createdAt','updatedAt','body','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','utf8','server/files/templates/registry.ejs','render','writeFileSync','registry','Reload','chan_sip.so','findAll','root','server/files/templates/trunk.ejs','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','get','Trunks','UserProfileResource','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort'];(function(_0x427e6a,_0x2557dc){var _0x15b818=function(_0x31f517){while(--_0x31f517){_0x427e6a['push'](_0x427e6a['shift']());}};_0x15b818(++_0x2557dc);}(_0x9434,0x168));var _0x4943=function(_0x87dc57,_0x3660cb){_0x87dc57=_0x87dc57-0x0;var _0x705d02=_0x9434[_0x87dc57];return _0x705d02;};'use strict';var pdf=require(_0x4943('0x0'));var emlformat=require(_0x4943('0x1'));var rimraf=require(_0x4943('0x2'));var zipdir=require(_0x4943('0x3'));var jsonpatch=require(_0x4943('0x4'));var rp=require(_0x4943('0x5'));var moment=require('moment');var BPromise=require(_0x4943('0x6'));var Mustache=require(_0x4943('0x7'));var util=require('util');var path=require(_0x4943('0x8'));var sox=require(_0x4943('0x9'));var csv=require('to-csv');var ejs=require(_0x4943('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4943('0xb'));var jsforce=require(_0x4943('0xc'));var deskjs=require(_0x4943('0xd'));var toCsv=require(_0x4943('0xe'));var querystring=require(_0x4943('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4943('0x10'));var qs=require(_0x4943('0x11'));var as=require(_0x4943('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4943('0x13'))(_0x4943('0x14'));var utils=require('../../config/utils');var config=require(_0x4943('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x4943('0x16')][_0x4943('0x17')]({'port':0x232a});function checkPasswordPattern(_0x33fd73,_0x37a0f2,_0x2763cb){if(_0x2763cb){var _0x24bdd7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24bdd7[_0x4943('0x18')](_0x37a0f2)){return _0x33fd73;}else{throw new db['Sequelize'][(_0x4943('0x19'))](_0x4943('0x1a'));}}else{return _0x33fd73;}}function respondWithRpcPromise(_0x2ae9b5,_0x13d758,_0x37c843,_0x39b4e3){return new BPromise(function(_0x4b075e,_0x26b707){var _0x407485=_0x39b4e3||client;return _0x407485[_0x4943('0x1b')](_0x2ae9b5,_0x37c843)['then'](function(_0x53377c){logger[_0x4943('0x1c')]('Trunk,\x20%s,\x20%s',_0x13d758,_0x4943('0x1d'));logger[_0x4943('0x1e')]('Trunk,\x20%s,\x20%s,\x20%s',_0x13d758,_0x4943('0x1d'),JSON[_0x4943('0x1f')](_0x53377c));if(_0x53377c[_0x4943('0x20')]){if(_0x53377c['error'][_0x4943('0x21')]===0x1f4){logger['error'](_0x4943('0x22'),_0x13d758,_0x53377c[_0x4943('0x20')][_0x4943('0x23')]);return _0x26b707(_0x53377c[_0x4943('0x20')][_0x4943('0x23')]);}logger[_0x4943('0x20')]('Trunk,\x20%s,\x20%s',_0x13d758,_0x53377c[_0x4943('0x20')][_0x4943('0x23')]);return _0x4b075e(_0x53377c[_0x4943('0x20')][_0x4943('0x23')]);}else{logger[_0x4943('0x1c')](_0x4943('0x22'),_0x13d758,_0x4943('0x1d'));_0x4b075e(_0x53377c[_0x4943('0x24')]['message']);}})['catch'](function(_0x315c7f){logger[_0x4943('0x20')](_0x4943('0x22'),_0x13d758,_0x315c7f);_0x26b707(_0x315c7f);});});}function respondWithStatusCode(_0x5d8cbe,_0x41f98d){_0x41f98d=_0x41f98d||0xcc;return function(_0xd49582){if(_0xd49582){return _0x5d8cbe['sendStatus'](_0x41f98d);}return _0x5d8cbe[_0x4943('0x25')](_0x41f98d)[_0x4943('0x26')]();};}function respondWithResult(_0x43cbfe,_0x24e6e1){_0x24e6e1=_0x24e6e1||0xc8;return function(_0x35f393){if(_0x35f393){return _0x43cbfe[_0x4943('0x25')](_0x24e6e1)[_0x4943('0x27')](_0x35f393);}};}function respondWithFilteredResult(_0x169ced,_0x3c1c15){return function(_0x3443ca){if(_0x3443ca){var _0x170e78=_0x3443ca[_0x4943('0x28')],_0x3b733f=_0x3c1c15[_0x4943('0x29')],_0xa71fec=_0x3c1c15[_0x4943('0x29')]+_0x3c1c15[_0x4943('0x2a')],_0x83bbd8;if(_0xa71fec>=_0x170e78){_0xa71fec=_0x170e78;_0x83bbd8=0xc8;}else{_0x83bbd8=0xce;}_0x169ced['status'](_0x83bbd8);return _0x169ced[_0x4943('0x2b')]('Content-Range',_0x3b733f+'-'+_0xa71fec+'/'+_0x170e78)[_0x4943('0x27')](_0x3443ca);}return null;};}function patchUpdates(_0x36999c){return function(_0x2957d2){try{jsonpatch[_0x4943('0x2c')](_0x2957d2,_0x36999c,!![]);}catch(_0x3b7788){return BPromise[_0x4943('0x2d')](_0x3b7788);}return _0x2957d2[_0x4943('0x2e')]();};}function saveUpdates(_0x315581,_0x571df7){return function(_0x322a94){if(_0x322a94){return _0x322a94[_0x4943('0x2f')](_0x315581)['then'](function(_0x267dd5){return _0x267dd5;});}return null;};}function removeEntity(_0x32558f,_0x50b275){return function(_0x45a5e0){if(_0x45a5e0){return _0x45a5e0[_0x4943('0x30')]()[_0x4943('0x31')](function(){var _0x4f0076=_0x45a5e0[_0x4943('0x32')]({'plain':!![]});var _0x181860=_0x4943('0x33');return db[_0x4943('0x34')][_0x4943('0x30')]({'where':{'type':_0x181860,'resourceId':_0x4f0076['id']}})['then'](function(){return _0x45a5e0;});})[_0x4943('0x31')](function(){_0x32558f[_0x4943('0x25')](0xcc)[_0x4943('0x26')]();});}};}function handleEntityNotFound(_0x70e36,_0x178cc9){return function(_0x1e7e7a){if(!_0x1e7e7a){_0x70e36[_0x4943('0x35')](0x194);}return _0x1e7e7a;};}function handleError(_0x33b12f,_0xe5f46b){_0xe5f46b=_0xe5f46b||0x1f4;return function(_0x221ea6){logger[_0x4943('0x20')](_0x221ea6['stack']);if(_0x221ea6[_0x4943('0x36')]){delete _0x221ea6[_0x4943('0x36')];}_0x33b12f[_0x4943('0x25')](_0xe5f46b)[_0x4943('0x37')](_0x221ea6);};}exports[_0x4943('0x38')]=function(_0x4d63b3,_0x51cd0f){var _0x4ac894={},_0x3bd2a9={},_0x2c7647={'count':0x0,'rows':[]};var _0x5876f6=_[_0x4943('0x39')](db['Trunk'][_0x4943('0x3a')],function(_0x2e9a00){return{'name':_0x2e9a00[_0x4943('0x3b')],'type':_0x2e9a00[_0x4943('0x3c')][_0x4943('0x3d')]};});_0x3bd2a9[_0x4943('0x3e')]=_[_0x4943('0x39')](_0x5876f6,_0x4943('0x36'));_0x3bd2a9[_0x4943('0x3f')]=_[_0x4943('0x40')](_0x4d63b3[_0x4943('0x3f')]);_0x3bd2a9[_0x4943('0x41')]=_[_0x4943('0x42')](_0x3bd2a9[_0x4943('0x3e')],_0x3bd2a9[_0x4943('0x3f')]);_0x4ac894[_0x4943('0x43')]=_[_0x4943('0x42')](_0x3bd2a9[_0x4943('0x3e')],qs[_0x4943('0x44')](_0x4d63b3[_0x4943('0x3f')][_0x4943('0x44')]));_0x4ac894[_0x4943('0x43')]=_0x4ac894[_0x4943('0x43')][_0x4943('0x45')]?_0x4ac894[_0x4943('0x43')]:_0x3bd2a9[_0x4943('0x3e')];if(!_0x4d63b3[_0x4943('0x3f')]['hasOwnProperty'](_0x4943('0x46'))){_0x4ac894[_0x4943('0x2a')]=qs['limit'](_0x4d63b3['query'][_0x4943('0x2a')]);_0x4ac894['offset']=qs[_0x4943('0x29')](_0x4d63b3['query'][_0x4943('0x29')]);}_0x4ac894['order']=qs[_0x4943('0x47')](_0x4d63b3['query'][_0x4943('0x47')]);_0x4ac894[_0x4943('0x48')]=qs[_0x4943('0x41')](_['pick'](_0x4d63b3['query'],_0x3bd2a9[_0x4943('0x41')]),_0x5876f6);if(_0x4d63b3['query'][_0x4943('0x49')]){_0x4ac894['where']=_[_0x4943('0x4a')](_0x4ac894[_0x4943('0x48')],{'$or':_[_0x4943('0x39')](_0x5876f6,function(_0x3235b6){if(_0x3235b6['type']!=='VIRTUAL'){var _0x4021b0={};_0x4021b0[_0x3235b6['name']]={'$like':'%'+_0x4d63b3['query'][_0x4943('0x49')]+'%'};return _0x4021b0;}})});}_0x4ac894=_[_0x4943('0x4a')]({},_0x4ac894,_0x4d63b3[_0x4943('0x4b')]);var _0x4586c6={'where':_0x4ac894[_0x4943('0x48')]};return db[_0x4943('0x4c')][_0x4943('0x28')](_0x4586c6)['then'](function(_0x207fcb){_0x2c7647[_0x4943('0x28')]=_0x207fcb;if(_0x4d63b3['query'][_0x4943('0x4d')]){_0x4ac894[_0x4943('0x4e')]=[{'all':!![]}];}return db[_0x4943('0x4c')]['findAll'](_0x4ac894);})[_0x4943('0x31')](function(_0x31aa3c){_0x2c7647['rows']=_0x31aa3c;return _0x2c7647;})[_0x4943('0x31')](respondWithFilteredResult(_0x51cd0f,_0x4ac894))[_0x4943('0x4f')](handleError(_0x51cd0f,null));};exports['show']=function(_0x445908,_0x346a6d){var _0x289af4={'raw':![],'where':{'id':_0x445908[_0x4943('0x50')]['id']}},_0x52f4a6={};_0x52f4a6['model']=_['keys'](db[_0x4943('0x4c')][_0x4943('0x3a')]);_0x52f4a6[_0x4943('0x3f')]=_['keys'](_0x445908['query']);_0x52f4a6['filters']=_[_0x4943('0x42')](_0x52f4a6['model'],_0x52f4a6['query']);_0x289af4[_0x4943('0x43')]=_['intersection'](_0x52f4a6['model'],qs['fields'](_0x445908[_0x4943('0x3f')][_0x4943('0x44')]));_0x289af4[_0x4943('0x43')]=_0x289af4['attributes'][_0x4943('0x45')]?_0x289af4[_0x4943('0x43')]:_0x52f4a6[_0x4943('0x3e')];if(_0x445908['query'][_0x4943('0x4d')]){_0x289af4[_0x4943('0x4e')]=[{'all':!![]}];}_0x289af4=_['merge']({},_0x289af4,_0x445908['options']);return db['Trunk']['find'](_0x289af4)[_0x4943('0x31')](handleEntityNotFound(_0x346a6d,null))[_0x4943('0x31')](respondWithResult(_0x346a6d,null))[_0x4943('0x4f')](handleError(_0x346a6d,null));};exports[_0x4943('0x51')]=function(_0x490a65,_0x10f06b){var _0x558de8={'where':{'id':_0x490a65[_0x4943('0x50')]['id']}},_0x574e4b={};_0x574e4b[_0x4943('0x3e')]=_[_0x4943('0x40')](db['Trunk'][_0x4943('0x3a')]);_0x558de8[_0x4943('0x43')]=_[_0x4943('0x42')](_0x574e4b[_0x4943('0x3e')],qs[_0x4943('0x44')](_0x490a65['query'][_0x4943('0x44')]));_0x558de8[_0x4943('0x43')]=_0x558de8[_0x4943('0x43')][_0x4943('0x45')]?_0x558de8['attributes']:_0x574e4b['model'];if(_0x490a65[_0x4943('0x3f')][_0x4943('0x4d')]){_0x558de8[_0x4943('0x4e')]=[{'all':!![]}];}_0x558de8=_['merge']({},_0x558de8,_0x490a65[_0x4943('0x4b')]);return db[_0x4943('0x4c')][_0x4943('0x52')](_0x558de8)[_0x4943('0x31')](handleEntityNotFound(_0x10f06b,null))[_0x4943('0x31')](function(_0x2b8a57){if(_0x2b8a57){var _0x4c70b9=_0x2b8a57[_0x4943('0x32')]({'plain':!![]});_0x4c70b9=qs[_0x4943('0x53')](_0x4c70b9,['id',_0x4943('0x54'),_0x4943('0x55')]);_0x490a65[_0x4943('0x56')]=_[_0x4943('0x53')](_0x490a65[_0x4943('0x56')],['id',_0x4943('0x54'),_0x4943('0x55')]);return db['Trunk']['create'](_[_0x4943('0x4a')](_0x4c70b9,_0x490a65['body']),{'include':_0x490a65[_0x4943('0x3f')][_0x4943('0x4d')]?[{'all':!![]}]:undefined})['then'](function(_0x31df2d){var _0x5b958f=_0x490a65['user']['get']({'plain':!![]});if(!_0x5b958f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b958f[_0x4943('0x57')]===_0x4943('0x58')){var _0x421f65=_0x31df2d[_0x4943('0x32')]({'plain':!![]});var _0x2b7583=_0x4943('0x33');return db[_0x4943('0x59')][_0x4943('0x52')]({'where':{'name':_0x2b7583,'userProfileId':_0x5b958f[_0x4943('0x5a')]},'raw':!![]})[_0x4943('0x31')](function(_0x272627){if(_0x272627&&_0x272627[_0x4943('0x5b')]===0x0){return db[_0x4943('0x34')][_0x4943('0x5c')]({'name':_0x421f65[_0x4943('0x36')],'resourceId':_0x421f65['id'],'type':_0x272627[_0x4943('0x36')],'sectionId':_0x272627['id']},{})[_0x4943('0x31')](function(){return _0x31df2d;});}else{return _0x31df2d;}})[_0x4943('0x4f')](function(_0x32ea69){logger['error'](_0x4943('0x5d'),_0x32ea69);throw _0x32ea69;});}return _0x31df2d;});}})[_0x4943('0x31')](respondWithResult(_0x10f06b,0xc9))[_0x4943('0x4f')](handleError(_0x10f06b,null));};exports[_0x4943('0x5c')]=function(_0x1d0f31,_0x3ac03a,_0x53e8cd){var _0x57fc09;return db[_0x4943('0x4c')][_0x4943('0x5c')](_0x1d0f31[_0x4943('0x56')],{'raw':!![]})[_0x4943('0x31')](function(_0x2b2ae9){_0x57fc09=_0x2b2ae9;return db[_0x4943('0x4c')]['findAll']({'raw':!![]});})[_0x4943('0x31')](function(_0x21ebf4){var _0x48cea8=fs[_0x4943('0x5e')](path[_0x4943('0x5f')](config['root'],'server/files/templates/trunk.ejs'),_0x4943('0x60'));var _0x1681d1=fs['readFileSync'](path[_0x4943('0x5f')](config['root'],_0x4943('0x61')),_0x4943('0x60'));var _0x403ba7=ejs[_0x4943('0x62')](_0x48cea8,{'trunks':_0x21ebf4||[]});fs[_0x4943('0x63')]('/etc/asterisk/sip_xcally_trunks.conf',_0x403ba7);if(_0x57fc09[_0x4943('0x64')]){var _0xf109bf=ejs[_0x4943('0x62')](_0x1681d1,{'trunks':_0x21ebf4||[]});fs[_0x4943('0x63')]('/etc/asterisk/sip_xcally_registers.conf',_0xf109bf);}})[_0x4943('0x31')](function(){return respondWithRpcPromise(_0x4943('0x65'),'create',{'module':_0x4943('0x66')});})[_0x4943('0x31')](function(){var _0x55822d=_0x1d0f31[_0x4943('0x58')][_0x4943('0x32')]({'plain':!![]});if(!_0x55822d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55822d['role']==='user'){var _0x588ef6=_0x57fc09[_0x4943('0x32')]({'plain':!![]});return db[_0x4943('0x59')][_0x4943('0x52')]({'where':{'name':'Trunks','userProfileId':_0x55822d[_0x4943('0x5a')]},'raw':!![]})['then'](function(_0x106240){if(_0x106240&&_0x106240[_0x4943('0x5b')]===0x0){return db[_0x4943('0x34')]['create']({'name':_0x588ef6['name'],'resourceId':_0x588ef6['id'],'type':_0x106240['name'],'sectionId':_0x106240['id']},{})[_0x4943('0x31')](function(){return _0x57fc09;});}else{return _0x57fc09;}})[_0x4943('0x4f')](function(_0x4e424a){logger[_0x4943('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e424a);throw _0x4e424a;});}return _0x57fc09;})[_0x4943('0x31')](respondWithResult(_0x3ac03a,0xc9))[_0x4943('0x4f')](handleError(_0x3ac03a,null));};exports[_0x4943('0x2f')]=function(_0x55ffa7,_0x2e15ae,_0x15eaeb){var _0x208687;return db[_0x4943('0x4c')]['find']({'where':{'id':_0x55ffa7['params']['id']}})['then'](handleEntityNotFound(_0x2e15ae,null))['then'](saveUpdates(_0x55ffa7[_0x4943('0x56')],null))[_0x4943('0x31')](function(_0x888a9a){if(_0x888a9a){_0x208687=_0x888a9a;return db['Trunk'][_0x4943('0x67')]({'raw':!![]});}})['then'](function(_0x271844){if(_0x271844){var _0x180a85=fs[_0x4943('0x5e')](path[_0x4943('0x5f')](config[_0x4943('0x68')],_0x4943('0x69')),_0x4943('0x60'));var _0x5281a3=fs[_0x4943('0x5e')](path[_0x4943('0x5f')](config[_0x4943('0x68')],_0x4943('0x61')),_0x4943('0x60'));var _0x2846ad=ejs[_0x4943('0x62')](_0x180a85,{'trunks':_0x271844||[]});fs[_0x4943('0x63')](_0x4943('0x6a'),_0x2846ad);var _0x52d96e=ejs['render'](_0x5281a3,{'trunks':_0x271844||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x52d96e);return respondWithRpcPromise(_0x4943('0x65'),'update',{'module':'chan_sip.so'});}return null;})['then'](function(_0x47ce2a){if(_0x47ce2a){return _0x208687;}})['then'](respondWithResult(_0x2e15ae,null))[_0x4943('0x4f')](handleError(_0x2e15ae,null));};exports[_0x4943('0x30')]=function(_0x27a1b8,_0x4ae248,_0x1eaf2f){var _0x2f2580;return db[_0x4943('0x4c')][_0x4943('0x52')]({'where':{'id':_0x27a1b8['params']['id']}})[_0x4943('0x31')](handleEntityNotFound(_0x4ae248,null))[_0x4943('0x31')](removeEntity(_0x4ae248,null))[_0x4943('0x31')](function(){return db['Trunk'][_0x4943('0x67')]({'raw':!![]});})[_0x4943('0x31')](function(_0x46000f){var _0xd23b93=fs[_0x4943('0x5e')](path[_0x4943('0x5f')](config[_0x4943('0x68')],_0x4943('0x69')),'utf8');var _0x6d85f4=fs[_0x4943('0x5e')](path['join'](config[_0x4943('0x68')],'server/files/templates/registry.ejs'),'utf8');var _0x5117d3=ejs[_0x4943('0x62')](_0xd23b93,{'trunks':_0x46000f});var _0x5d6e4d=ejs[_0x4943('0x62')](_0x6d85f4,{'trunks':_0x46000f});fs[_0x4943('0x63')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5117d3);fs[_0x4943('0x63')](_0x4943('0x6b'),_0x5d6e4d);return respondWithRpcPromise(_0x4943('0x65'),_0x4943('0x30'),{'module':_0x4943('0x66')});})[_0x4943('0x4f')](handleError(_0x4ae248,null));};
\ No newline at end of file
+var _0x1ba2=['set','Content-Range','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','merge','where','filter','includeAll','include','rows','show','params','find','options','omit','updatedAt','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','role','userProfileId','/etc/asterisk/sip_xcally_registers.conf','server/files/templates/registry.ejs','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit'];(function(_0x3724e2,_0x41d318){var _0x5c5ab2=function(_0x4c57ae){while(--_0x4c57ae){_0x3724e2['push'](_0x3724e2['shift']());}};_0x5c5ab2(++_0x41d318);}(_0x1ba2,0xb4));var _0x21ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ba2[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x21ba('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x21ba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21ba('0x2'));var rp=require(_0x21ba('0x3'));var moment=require(_0x21ba('0x4'));var BPromise=require(_0x21ba('0x5'));var Mustache=require(_0x21ba('0x6'));var util=require('util');var path=require(_0x21ba('0x7'));var sox=require(_0x21ba('0x8'));var csv=require('to-csv');var ejs=require(_0x21ba('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x21ba('0xa'));var crypto=require(_0x21ba('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x21ba('0xc'));var toCsv=require('to-csv');var querystring=require(_0x21ba('0xd'));var Papa=require(_0x21ba('0xe'));var Redis=require('ioredis');var authService=require(_0x21ba('0xf'));var qs=require(_0x21ba('0x10'));var as=require(_0x21ba('0x11'));var hardwareService=require(_0x21ba('0x12'));var logger=require(_0x21ba('0x13'))(_0x21ba('0x14'));var utils=require(_0x21ba('0x15'));var config=require(_0x21ba('0x16'));var db=require(_0x21ba('0x17'))['db'];var jayson=require(_0x21ba('0x18'));var client=jayson[_0x21ba('0x19')][_0x21ba('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x48f552,_0x4deda3,_0x183154){if(_0x183154){var _0x1838b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1838b5[_0x21ba('0x1b')](_0x4deda3)){return _0x48f552;}else{throw new db['Sequelize']['ValidationError'](_0x21ba('0x1c'));}}else{return _0x48f552;}}function respondWithRpcPromise(_0x5dfab3,_0x3591cd,_0x494588,_0x179063){return new BPromise(function(_0x2e7b03,_0x17df0e){var _0x1c2bac=_0x179063||client;return _0x1c2bac[_0x21ba('0x1d')](_0x5dfab3,_0x494588)['then'](function(_0x1ab5ed){logger['info'](_0x21ba('0x1e'),_0x3591cd,_0x21ba('0x1f'));logger[_0x21ba('0x20')](_0x21ba('0x21'),_0x3591cd,_0x21ba('0x1f'),JSON[_0x21ba('0x22')](_0x1ab5ed));if(_0x1ab5ed[_0x21ba('0x23')]){if(_0x1ab5ed[_0x21ba('0x23')]['code']===0x1f4){logger[_0x21ba('0x23')](_0x21ba('0x1e'),_0x3591cd,_0x1ab5ed['error'][_0x21ba('0x24')]);return _0x17df0e(_0x1ab5ed['error'][_0x21ba('0x24')]);}logger['error'](_0x21ba('0x1e'),_0x3591cd,_0x1ab5ed[_0x21ba('0x23')][_0x21ba('0x24')]);return _0x2e7b03(_0x1ab5ed[_0x21ba('0x23')]['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x3591cd,'request\x20sent');_0x2e7b03(_0x1ab5ed[_0x21ba('0x25')][_0x21ba('0x24')]);}})[_0x21ba('0x26')](function(_0x1e62f7){logger[_0x21ba('0x23')](_0x21ba('0x1e'),_0x3591cd,_0x1e62f7);_0x17df0e(_0x1e62f7);});});}function respondWithStatusCode(_0x2f4d96,_0x3ab7d3){_0x3ab7d3=_0x3ab7d3||0xcc;return function(_0x97ed7d){if(_0x97ed7d){return _0x2f4d96[_0x21ba('0x27')](_0x3ab7d3);}return _0x2f4d96[_0x21ba('0x28')](_0x3ab7d3)[_0x21ba('0x29')]();};}function respondWithResult(_0x2f7414,_0x32b602){_0x32b602=_0x32b602||0xc8;return function(_0x1aca0c){if(_0x1aca0c){return _0x2f7414[_0x21ba('0x28')](_0x32b602)[_0x21ba('0x2a')](_0x1aca0c);}};}function respondWithFilteredResult(_0x2dccbf,_0x2567f9){return function(_0x33800c){if(_0x33800c){var _0x3d8dff=_0x33800c[_0x21ba('0x2b')],_0x9535d8=_0x2567f9[_0x21ba('0x2c')],_0x3e19cf=_0x2567f9[_0x21ba('0x2c')]+_0x2567f9[_0x21ba('0x2d')],_0x1b4ebe;if(_0x3e19cf>=_0x3d8dff){_0x3e19cf=_0x3d8dff;_0x1b4ebe=0xc8;}else{_0x1b4ebe=0xce;}_0x2dccbf[_0x21ba('0x28')](_0x1b4ebe);return _0x2dccbf[_0x21ba('0x2e')](_0x21ba('0x2f'),_0x9535d8+'-'+_0x3e19cf+'/'+_0x3d8dff)[_0x21ba('0x2a')](_0x33800c);}return null;};}function patchUpdates(_0x56bd9f){return function(_0x29fbb6){try{jsonpatch[_0x21ba('0x30')](_0x29fbb6,_0x56bd9f,!![]);}catch(_0x46f581){return BPromise[_0x21ba('0x31')](_0x46f581);}return _0x29fbb6['save']();};}function saveUpdates(_0x4c4472,_0x120760){return function(_0x1b6b44){if(_0x1b6b44){return _0x1b6b44[_0x21ba('0x32')](_0x4c4472)[_0x21ba('0x33')](function(_0x62f424){return _0x62f424;});}return null;};}function removeEntity(_0x5c1403,_0x1c6277){return function(_0x58671e){if(_0x58671e){return _0x58671e[_0x21ba('0x34')]()[_0x21ba('0x33')](function(){var _0x367c2f=_0x58671e[_0x21ba('0x35')]({'plain':!![]});var _0xc6d08=_0x21ba('0x36');return db[_0x21ba('0x37')][_0x21ba('0x34')]({'where':{'type':_0xc6d08,'resourceId':_0x367c2f['id']}})[_0x21ba('0x33')](function(){return _0x58671e;});})['then'](function(){_0x5c1403['status'](0xcc)[_0x21ba('0x29')]();});}};}function handleEntityNotFound(_0x18023d,_0x161b32){return function(_0x34d144){if(!_0x34d144){_0x18023d['sendStatus'](0x194);}return _0x34d144;};}function handleError(_0x298c48,_0x2f681e){_0x2f681e=_0x2f681e||0x1f4;return function(_0x5c7af5){logger[_0x21ba('0x23')](_0x5c7af5[_0x21ba('0x38')]);if(_0x5c7af5[_0x21ba('0x39')]){delete _0x5c7af5[_0x21ba('0x39')];}_0x298c48[_0x21ba('0x28')](_0x2f681e)[_0x21ba('0x3a')](_0x5c7af5);};}exports[_0x21ba('0x3b')]=function(_0x4e1d8a,_0x2376f9){var _0x4e66c0={},_0xcd9609={},_0x579176={'count':0x0,'rows':[]};var _0x3a471c=_[_0x21ba('0x3c')](db[_0x21ba('0x3d')][_0x21ba('0x3e')],function(_0x1aeaff){return{'name':_0x1aeaff[_0x21ba('0x3f')],'type':_0x1aeaff[_0x21ba('0x40')][_0x21ba('0x41')]};});_0xcd9609[_0x21ba('0x42')]=_[_0x21ba('0x3c')](_0x3a471c,_0x21ba('0x39'));_0xcd9609[_0x21ba('0x43')]=_[_0x21ba('0x44')](_0x4e1d8a['query']);_0xcd9609[_0x21ba('0x45')]=_[_0x21ba('0x46')](_0xcd9609[_0x21ba('0x42')],_0xcd9609[_0x21ba('0x43')]);_0x4e66c0[_0x21ba('0x47')]=_['intersection'](_0xcd9609[_0x21ba('0x42')],qs['fields'](_0x4e1d8a[_0x21ba('0x43')][_0x21ba('0x48')]));_0x4e66c0[_0x21ba('0x47')]=_0x4e66c0[_0x21ba('0x47')][_0x21ba('0x49')]?_0x4e66c0[_0x21ba('0x47')]:_0xcd9609[_0x21ba('0x42')];if(!_0x4e1d8a['query']['hasOwnProperty'](_0x21ba('0x4a'))){_0x4e66c0['limit']=qs[_0x21ba('0x2d')](_0x4e1d8a[_0x21ba('0x43')][_0x21ba('0x2d')]);_0x4e66c0[_0x21ba('0x2c')]=qs[_0x21ba('0x2c')](_0x4e1d8a[_0x21ba('0x43')]['offset']);}_0x4e66c0[_0x21ba('0x4b')]=qs[_0x21ba('0x4c')](_0x4e1d8a['query'][_0x21ba('0x4c')]);_0x4e66c0['where']=qs[_0x21ba('0x45')](_['pick'](_0x4e1d8a['query'],_0xcd9609[_0x21ba('0x45')]),_0x3a471c);if(_0x4e1d8a[_0x21ba('0x43')]['filter']){_0x4e66c0['where']=_[_0x21ba('0x4d')](_0x4e66c0[_0x21ba('0x4e')],{'$or':_[_0x21ba('0x3c')](_0x3a471c,function(_0x20cb26){if(_0x20cb26['type']!=='VIRTUAL'){var _0x1769c1={};_0x1769c1[_0x20cb26[_0x21ba('0x39')]]={'$like':'%'+_0x4e1d8a[_0x21ba('0x43')][_0x21ba('0x4f')]+'%'};return _0x1769c1;}})});}_0x4e66c0=_[_0x21ba('0x4d')]({},_0x4e66c0,_0x4e1d8a['options']);var _0x1d1d44={'where':_0x4e66c0[_0x21ba('0x4e')]};return db[_0x21ba('0x3d')]['count'](_0x1d1d44)['then'](function(_0x5b913b){_0x579176[_0x21ba('0x2b')]=_0x5b913b;if(_0x4e1d8a[_0x21ba('0x43')][_0x21ba('0x50')]){_0x4e66c0[_0x21ba('0x51')]=[{'all':!![]}];}return db[_0x21ba('0x3d')]['findAll'](_0x4e66c0);})[_0x21ba('0x33')](function(_0x1f806e){_0x579176[_0x21ba('0x52')]=_0x1f806e;return _0x579176;})['then'](respondWithFilteredResult(_0x2376f9,_0x4e66c0))[_0x21ba('0x26')](handleError(_0x2376f9,null));};exports[_0x21ba('0x53')]=function(_0x58698a,_0x3aa8fc){var _0x1fc47d={'raw':![],'where':{'id':_0x58698a[_0x21ba('0x54')]['id']}},_0x25e24a={};_0x25e24a['model']=_[_0x21ba('0x44')](db[_0x21ba('0x3d')][_0x21ba('0x3e')]);_0x25e24a[_0x21ba('0x43')]=_[_0x21ba('0x44')](_0x58698a[_0x21ba('0x43')]);_0x25e24a[_0x21ba('0x45')]=_[_0x21ba('0x46')](_0x25e24a[_0x21ba('0x42')],_0x25e24a[_0x21ba('0x43')]);_0x1fc47d[_0x21ba('0x47')]=_[_0x21ba('0x46')](_0x25e24a['model'],qs[_0x21ba('0x48')](_0x58698a['query'][_0x21ba('0x48')]));_0x1fc47d['attributes']=_0x1fc47d[_0x21ba('0x47')][_0x21ba('0x49')]?_0x1fc47d[_0x21ba('0x47')]:_0x25e24a[_0x21ba('0x42')];if(_0x58698a[_0x21ba('0x43')][_0x21ba('0x50')]){_0x1fc47d[_0x21ba('0x51')]=[{'all':!![]}];}_0x1fc47d=_['merge']({},_0x1fc47d,_0x58698a['options']);return db[_0x21ba('0x3d')][_0x21ba('0x55')](_0x1fc47d)[_0x21ba('0x33')](handleEntityNotFound(_0x3aa8fc,null))[_0x21ba('0x33')](respondWithResult(_0x3aa8fc,null))['catch'](handleError(_0x3aa8fc,null));};exports['clone']=function(_0x30ee5f,_0x17b277){var _0x1b23f0={'where':{'id':_0x30ee5f[_0x21ba('0x54')]['id']}},_0x56689b={};_0x56689b[_0x21ba('0x42')]=_[_0x21ba('0x44')](db[_0x21ba('0x3d')][_0x21ba('0x3e')]);_0x1b23f0[_0x21ba('0x47')]=_[_0x21ba('0x46')](_0x56689b[_0x21ba('0x42')],qs[_0x21ba('0x48')](_0x30ee5f[_0x21ba('0x43')]['fields']));_0x1b23f0['attributes']=_0x1b23f0['attributes']['length']?_0x1b23f0[_0x21ba('0x47')]:_0x56689b['model'];if(_0x30ee5f['query'][_0x21ba('0x50')]){_0x1b23f0[_0x21ba('0x51')]=[{'all':!![]}];}_0x1b23f0=_[_0x21ba('0x4d')]({},_0x1b23f0,_0x30ee5f[_0x21ba('0x56')]);return db[_0x21ba('0x3d')][_0x21ba('0x55')](_0x1b23f0)['then'](handleEntityNotFound(_0x17b277,null))['then'](function(_0x4f9551){if(_0x4f9551){var _0x23b030=_0x4f9551[_0x21ba('0x35')]({'plain':!![]});_0x23b030=qs[_0x21ba('0x57')](_0x23b030,['id','createdAt',_0x21ba('0x58')]);_0x30ee5f[_0x21ba('0x59')]=_[_0x21ba('0x57')](_0x30ee5f['body'],['id',_0x21ba('0x5a'),_0x21ba('0x58')]);return db[_0x21ba('0x3d')][_0x21ba('0x5b')](_[_0x21ba('0x4d')](_0x23b030,_0x30ee5f[_0x21ba('0x59')]),{'include':_0x30ee5f['query'][_0x21ba('0x50')]?[{'all':!![]}]:undefined})[_0x21ba('0x33')](function(_0x1071f9){var _0x58ce4a=_0x30ee5f[_0x21ba('0x5c')]['get']({'plain':!![]});if(!_0x58ce4a)throw new Error(_0x21ba('0x5d'));if(_0x58ce4a['role']===_0x21ba('0x5c')){var _0x47253b=_0x1071f9['get']({'plain':!![]});var _0x5e9ef8=_0x21ba('0x36');return db[_0x21ba('0x5e')]['find']({'where':{'name':_0x5e9ef8,'userProfileId':_0x58ce4a['userProfileId']},'raw':!![]})['then'](function(_0x330c5c){if(_0x330c5c&&_0x330c5c[_0x21ba('0x5f')]===0x0){return db[_0x21ba('0x37')][_0x21ba('0x5b')]({'name':_0x47253b['name'],'resourceId':_0x47253b['id'],'type':_0x330c5c[_0x21ba('0x39')],'sectionId':_0x330c5c['id']},{})[_0x21ba('0x33')](function(){return _0x1071f9;});}else{return _0x1071f9;}})[_0x21ba('0x26')](function(_0x52aa36){logger[_0x21ba('0x23')](_0x21ba('0x60'),_0x52aa36);throw _0x52aa36;});}return _0x1071f9;});}})[_0x21ba('0x33')](respondWithResult(_0x17b277,0xc9))[_0x21ba('0x26')](handleError(_0x17b277,null));};exports[_0x21ba('0x5b')]=function(_0x4c3e71,_0x588140,_0x1f9023){var _0x5454c4;return db[_0x21ba('0x3d')][_0x21ba('0x5b')](_0x4c3e71[_0x21ba('0x59')],{'raw':!![]})[_0x21ba('0x33')](function(_0x2624ba){_0x5454c4=_0x2624ba;return db['Trunk'][_0x21ba('0x61')]({'raw':!![]});})[_0x21ba('0x33')](function(_0x66fa78){var _0x394ea9=fs[_0x21ba('0x62')](path[_0x21ba('0x63')](config['root'],_0x21ba('0x64')),_0x21ba('0x65'));var _0x3b1b1d=fs[_0x21ba('0x62')](path['join'](config[_0x21ba('0x66')],'server/files/templates/registry.ejs'),'utf8');var _0x29ceff=ejs[_0x21ba('0x67')](_0x394ea9,{'trunks':_0x66fa78||[]});fs[_0x21ba('0x68')](_0x21ba('0x69'),_0x29ceff);if(_0x5454c4[_0x21ba('0x6a')]){var _0xec7105=ejs[_0x21ba('0x67')](_0x3b1b1d,{'trunks':_0x66fa78||[]});fs[_0x21ba('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0xec7105);}})[_0x21ba('0x33')](function(){return respondWithRpcPromise(_0x21ba('0x6b'),_0x21ba('0x5b'),{'module':_0x21ba('0x6c')});})['then'](function(){var _0x39414a=_0x4c3e71['user'][_0x21ba('0x35')]({'plain':!![]});if(!_0x39414a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39414a[_0x21ba('0x6d')]===_0x21ba('0x5c')){var _0x3d88f7=_0x5454c4['get']({'plain':!![]});return db[_0x21ba('0x5e')][_0x21ba('0x55')]({'where':{'name':_0x21ba('0x36'),'userProfileId':_0x39414a[_0x21ba('0x6e')]},'raw':!![]})['then'](function(_0x1d9491){if(_0x1d9491&&_0x1d9491[_0x21ba('0x5f')]===0x0){return db[_0x21ba('0x37')]['create']({'name':_0x3d88f7[_0x21ba('0x39')],'resourceId':_0x3d88f7['id'],'type':_0x1d9491[_0x21ba('0x39')],'sectionId':_0x1d9491['id']},{})[_0x21ba('0x33')](function(){return _0x5454c4;});}else{return _0x5454c4;}})[_0x21ba('0x26')](function(_0x178b2f){logger[_0x21ba('0x23')](_0x21ba('0x60'),_0x178b2f);throw _0x178b2f;});}return _0x5454c4;})[_0x21ba('0x33')](respondWithResult(_0x588140,0xc9))[_0x21ba('0x26')](handleError(_0x588140,null));};exports['update']=function(_0x2487c0,_0x3cff82,_0x339d80){var _0x66ad49;return db[_0x21ba('0x3d')][_0x21ba('0x55')]({'where':{'id':_0x2487c0[_0x21ba('0x54')]['id']}})[_0x21ba('0x33')](handleEntityNotFound(_0x3cff82,null))[_0x21ba('0x33')](saveUpdates(_0x2487c0[_0x21ba('0x59')],null))[_0x21ba('0x33')](function(_0x40ebf6){if(_0x40ebf6){_0x66ad49=_0x40ebf6;return db[_0x21ba('0x3d')][_0x21ba('0x61')]({'raw':!![]});}})[_0x21ba('0x33')](function(_0x289db8){if(_0x289db8){var _0x45a7a5=fs[_0x21ba('0x62')](path[_0x21ba('0x63')](config[_0x21ba('0x66')],'server/files/templates/trunk.ejs'),_0x21ba('0x65'));var _0x27535f=fs[_0x21ba('0x62')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0x21ba('0x65'));var _0x463f48=ejs[_0x21ba('0x67')](_0x45a7a5,{'trunks':_0x289db8||[]});fs[_0x21ba('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x463f48);var _0x2d20f7=ejs[_0x21ba('0x67')](_0x27535f,{'trunks':_0x289db8||[]});fs[_0x21ba('0x68')](_0x21ba('0x6f'),_0x2d20f7);return respondWithRpcPromise(_0x21ba('0x6b'),_0x21ba('0x32'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x1ee0a8){if(_0x1ee0a8){return _0x66ad49;}})[_0x21ba('0x33')](respondWithResult(_0x3cff82,null))[_0x21ba('0x26')](handleError(_0x3cff82,null));};exports[_0x21ba('0x34')]=function(_0x37830c,_0xc85716,_0x41d6a8){var _0x3234ff;return db[_0x21ba('0x3d')][_0x21ba('0x55')]({'where':{'id':_0x37830c[_0x21ba('0x54')]['id']}})['then'](handleEntityNotFound(_0xc85716,null))[_0x21ba('0x33')](removeEntity(_0xc85716,null))[_0x21ba('0x33')](function(){return db[_0x21ba('0x3d')][_0x21ba('0x61')]({'raw':!![]});})[_0x21ba('0x33')](function(_0x51b106){var _0x40f470=fs[_0x21ba('0x62')](path[_0x21ba('0x63')](config[_0x21ba('0x66')],_0x21ba('0x64')),'utf8');var _0xc57189=fs[_0x21ba('0x62')](path[_0x21ba('0x63')](config['root'],_0x21ba('0x70')),_0x21ba('0x65'));var _0x244b12=ejs['render'](_0x40f470,{'trunks':_0x51b106});var _0xebacbc=ejs[_0x21ba('0x67')](_0xc57189,{'trunks':_0x51b106});fs[_0x21ba('0x68')](_0x21ba('0x69'),_0x244b12);fs['writeFileSync'](_0x21ba('0x6f'),_0xebacbc);return respondWithRpcPromise('Reload',_0x21ba('0x34'),{'module':_0x21ba('0x6c')});})[_0x21ba('0x26')](handleError(_0xc85716,null));};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js
index cf61e50..0d06a0f 100644
--- a/server/api/trunk/trunk.model.js
+++ b/server/api/trunk/trunk.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x65f1=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util'];(function(_0x8355ea,_0x5bb62e){var _0x51d1f4=function(_0x245419){while(--_0x245419){_0x8355ea['push'](_0x8355ea['shift']());}};_0x51d1f4(++_0x5bb62e);}(_0x65f1,0xde));var _0x165f=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0x65f1[_0x540133];return _0x26b6e9;};'use strict';var _=require(_0x165f('0x0'));var util=require(_0x165f('0x1'));var logger=require(_0x165f('0x2'))(_0x165f('0x3'));var moment=require(_0x165f('0x4'));var BPromise=require(_0x165f('0x5'));var rp=require(_0x165f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x165f('0x7'));var config=require(_0x165f('0x8'));var attributes=require(_0x165f('0x9'));module[_0x165f('0xa')]=function(_0x3b3fdb,_0x174c7c){return _0x3b3fdb[_0x165f('0xb')](_0x165f('0xc'),attributes,{'tableName':_0x165f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x980f=['api','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','lodash','util','../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x980f,0x194));var _0xf980=function(_0x3f2abd,_0x23b3a9){_0x3f2abd=_0x3f2abd-0x0;var _0x3d8338=_0x980f[_0x3f2abd];return _0x3d8338;};'use strict';var _=require(_0xf980('0x0'));var util=require(_0xf980('0x1'));var logger=require(_0xf980('0x2'))(_0xf980('0x3'));var moment=require('moment');var BPromise=require(_0xf980('0x4'));var rp=require(_0xf980('0x5'));var fs=require('fs');var path=require(_0xf980('0x6'));var rimraf=require(_0xf980('0x7'));var config=require(_0xf980('0x8'));var attributes=require(_0xf980('0x9'));module[_0xf980('0xa')]=function(_0x1ade56,_0x785222){return _0x1ade56['define']('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js
index c4a512f..2478f01 100644
--- a/server/api/trunk/trunk.rpc.js
+++ b/server/api/trunk/trunk.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','ShowTrunk','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x5f5946,_0x244557){var _0x48a655=function(_0x38853a){while(--_0x38853a){_0x5f5946['push'](_0x5f5946['shift']());}};_0x48a655(++_0x244557);}(_0x757a,0xde));var _0xa757=function(_0x5d3517,_0x23480c){_0x5d3517=_0x5d3517-0x0;var _0x4d40ea=_0x757a[_0x5d3517];return _0x4d40ea;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetTrunk',_0x4d9f58);logger['debug']('GetTrunk',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetTrunk',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});};
\ No newline at end of file
+var _0x4fc2=['rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','include','model','map','GetTrunk','Trunk','find','raw','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xd1bd2b,_0x43ead3){var _0x466676=function(_0x4062eb){while(--_0x4062eb){_0xd1bd2b['push'](_0xd1bd2b['shift']());}};_0x466676(++_0x43ead3);}(_0x4fc2,0x111));var _0x24fc=function(_0x41db4d,_0xad6d70){_0x41db4d=_0x41db4d-0x0;var _0x17047b=_0x4fc2[_0x41db4d];return _0x17047b;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('Trunk,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('Trunk,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['GetTrunk']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['Trunk'][_0x24fc('0x17')]({'raw':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x23873c[_0x24fc('0x18')]?_0x23873c['options'][_0x24fc('0x1a')]||null:null,'limit':_0x23873c['options']?_0x23873c[_0x24fc('0x18')]['limit']||null:null,'include':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x23873c[_0x24fc('0x18')]['include'],function(_0x35a9c7){return{'model':db[_0x35a9c7[_0x24fc('0x1c')]],'as':_0x35a9c7['as'],'attributes':_0x35a9c7[_0x24fc('0x1a')],'include':_0x35a9c7[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x35a9c7[_0x24fc('0x1b')],function(_0x3f0875){return{'model':db[_0x3f0875[_0x24fc('0x1c')]],'as':_0x3f0875['as'],'attributes':_0x3f0875[_0x24fc('0x1a')],'include':_0x3f0875[_0x24fc('0x1b')]?_['map'](_0x3f0875[_0x24fc('0x1b')],function(_0x16f27f){return{'model':db[_0x16f27f[_0x24fc('0x1c')]],'as':_0x16f27f['as'],'attributes':_0x16f27f['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x3d1ec8){logger[_0x24fc('0xd')](_0x24fc('0x1e'),_0x23873c);logger[_0x24fc('0x10')](_0x24fc('0x1e'),_0x23873c,JSON['stringify'](_0x3d1ec8));_0x6cfa0a(_0x3d1ec8);})[_0x24fc('0x16')](function(_0x29a461){logger[_0x24fc('0x13')](_0x24fc('0x1e'),_0x29a461[_0x24fc('0x15')],_0x23873c);_0x8ac114(_0x1cb3d0['error'](0x1f4,_0x29a461['message']));});});};exports['ShowTrunk']=function(_0x3df6f4){var _0x574ba3=this;return new Promise(function(_0x3f2464,_0x3e6389){return db[_0x24fc('0x1f')][_0x24fc('0x20')]({'raw':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x21')]===undefined?!![]:![]:!![],'where':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x3df6f4['options']?_0x3df6f4['options'][_0x24fc('0x1a')]||null:null,'include':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')],function(_0x3b2862){return{'model':db[_0x3b2862[_0x24fc('0x1c')]],'as':_0x3b2862['as'],'attributes':_0x3b2862[_0x24fc('0x1a')],'include':_0x3b2862[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x3b2862[_0x24fc('0x1b')],function(_0x379a4a){return{'model':db[_0x379a4a['model']],'as':_0x379a4a['as'],'attributes':_0x379a4a[_0x24fc('0x1a')],'include':_0x379a4a[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x379a4a[_0x24fc('0x1b')],function(_0x242bd5){return{'model':db[_0x242bd5['model']],'as':_0x242bd5['as'],'attributes':_0x242bd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x5d48fe){logger[_0x24fc('0xd')](_0x24fc('0x22'),_0x3df6f4);logger[_0x24fc('0x10')](_0x24fc('0x22'),_0x3df6f4,JSON['stringify'](_0x5d48fe));_0x3f2464(_0x5d48fe);})[_0x24fc('0x16')](function(_0x4f4ec8){logger[_0x24fc('0x13')](_0x24fc('0x22'),_0x4f4ec8[_0x24fc('0x15')],_0x3df6f4);_0x3e6389(_0x574ba3[_0x24fc('0x13')](0x1f4,_0x4f4ec8[_0x24fc('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/user/index.js b/server/api/user/index.js
index 4c81740..73e96dd 100644
--- a/server/api/user/index.js
+++ b/server/api/user/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa3e=['/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','/:id','show','getAvatar','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','server/files/images/','format','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addSmsAccounts','addWhatsappAccounts','/:id/square_projects','addSquareProjects','createApiKey','put','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfa3e,0x156));var _0xefa3=function(_0x26fae2,_0x145c68){_0x26fae2=_0x26fae2-0x0;var _0x57d487=_0xfa3e[_0x26fae2];return _0x57d487;};'use strict';var multer=require(_0xefa3('0x0'));var util=require(_0xefa3('0x1'));var path=require(_0xefa3('0x2'));var timeout=require('connect-timeout');var express=require(_0xefa3('0x3'));var router=express[_0xefa3('0x4')]();var auth=require(_0xefa3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xefa3('0x6'));var controller=require(_0xefa3('0x7'));router['get']('/',auth[_0xefa3('0x8')](),controller[_0xefa3('0x9')]);router[_0xefa3('0xa')](_0xefa3('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xefa3('0xa')]('/whoami',auth[_0xefa3('0x8')](),controller['whoami']);router[_0xefa3('0xa')](_0xefa3('0xc'),auth[_0xefa3('0x8')](),controller[_0xefa3('0xd')]);router[_0xefa3('0xa')]('/:id/avatar',controller[_0xefa3('0xe')]);router['get'](_0xefa3('0xf'),auth[_0xefa3('0x8')](),controller['getContacts']);router[_0xefa3('0xa')](_0xefa3('0x10'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x11')]);router[_0xefa3('0xa')](_0xefa3('0x12'),auth[_0xefa3('0x8')](),controller['getVoiceQueuesRt']);router[_0xefa3('0xa')](_0xefa3('0x13'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x14')]);router[_0xefa3('0xa')](_0xefa3('0x15'),auth[_0xefa3('0x8')](),controller['getRecordings']);router[_0xefa3('0xa')](_0xefa3('0x16'),auth[_0xefa3('0x8')](),controller['getScreenRecordings']);router[_0xefa3('0xa')](_0xefa3('0x17'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x18')]);router[_0xefa3('0xa')](_0xefa3('0x19'),auth['isAuthenticated'](),controller[_0xefa3('0x1a')]);router[_0xefa3('0xa')](_0xefa3('0x1b'),auth[_0xefa3('0x8')](),controller['getMailInteractions']);router[_0xefa3('0xa')](_0xefa3('0x1c'),auth['isAuthenticated'](),controller[_0xefa3('0x1d')]);router[_0xefa3('0xa')]('/:id/fax/interactions',auth[_0xefa3('0x8')](),controller['getFaxInteractions']);router[_0xefa3('0xa')]('/:id/whatsapp/interactions',auth[_0xefa3('0x8')](),controller[_0xefa3('0x1e')]);router[_0xefa3('0xa')](_0xefa3('0x1f'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x20')]);router[_0xefa3('0xa')](_0xefa3('0x21'),auth[_0xefa3('0x8')](),controller['getLists']);router[_0xefa3('0xa')]('/:id/agents',auth[_0xefa3('0x8')](),controller[_0xefa3('0x22')]);router[_0xefa3('0xa')](_0xefa3('0x23'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0xefa3('0xa')]('/:id/fax_accounts',auth[_0xefa3('0x8')](),controller[_0xefa3('0x24')]);router[_0xefa3('0xa')](_0xefa3('0x25'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x26')]);router[_0xefa3('0xa')](_0xefa3('0x27'),auth[_0xefa3('0x8')](),controller['getOpenchannelAccounts']);router[_0xefa3('0xa')](_0xefa3('0x28'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x29')]);router[_0xefa3('0xa')](_0xefa3('0x2a'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0xefa3('0xa')](_0xefa3('0x2b'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x2c')]);router['get']('/:id/square_projects',auth[_0xefa3('0x8')](),controller[_0xefa3('0x2d')]);router[_0xefa3('0xa')](_0xefa3('0x2e'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x2f')]);router['get'](_0xefa3('0x30'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x31')]);router[_0xefa3('0x32')](_0xefa3('0x33'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x34')]);router[_0xefa3('0x32')](_0xefa3('0xf'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x35')]);router['post']('/',auth['isAuthenticated'](),controller[_0xefa3('0x36')]);router[_0xefa3('0x32')](_0xefa3('0x10'),auth['isAuthenticated'](),controller[_0xefa3('0x37')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f4c01,_0x564909,_0x3a7db7){_0x3a7db7(null,path['join'](config['root'],_0xefa3('0x38')));},'filename':function(_0x22a3d8,_0x5c83c3,_0x1f0223){_0x1f0223(null,util[_0xefa3('0x39')]('%s-%s',Date[_0xefa3('0x3a')](),_0x5c83c3[_0xefa3('0x3b')]));}})});router[_0xefa3('0x32')](_0xefa3('0x3c'),upload[_0xefa3('0x3d')](_0xefa3('0x3e')),controller[_0xefa3('0x3f')]);router[_0xefa3('0x32')](_0xefa3('0x40'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x41')]);router['post'](_0xefa3('0x42'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x43')]);router[_0xefa3('0x32')](_0xefa3('0x44'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x45')]);router[_0xefa3('0x32')](_0xefa3('0x46'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x47')]);router[_0xefa3('0x32')](_0xefa3('0x1f'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x48')]);router[_0xefa3('0x32')](_0xefa3('0x49'),auth[_0xefa3('0x8')](),controller['addChatInteractions']);router[_0xefa3('0x32')](_0xefa3('0x4a'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x4b')]);router[_0xefa3('0x32')](_0xefa3('0x4c'),auth[_0xefa3('0x8')](),controller['addFaxInteractions']);router[_0xefa3('0x32')](_0xefa3('0x4d'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0xefa3('0x32')](_0xefa3('0x4e'),auth[_0xefa3('0x8')](),controller['addOpenchannelInteractions']);router[_0xefa3('0x32')]('/:id/whatsapp_interactions',auth[_0xefa3('0x8')](),controller[_0xefa3('0x4f')]);router[_0xefa3('0x32')](_0xefa3('0x50'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x51')]);router['post'](_0xefa3('0x25'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x52')]);router[_0xefa3('0x32')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0xefa3('0x32')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xefa3('0x53')]);router['post'](_0xefa3('0x2a'),auth[_0xefa3('0x8')](),controller['addChatWebsites']);router[_0xefa3('0x32')](_0xefa3('0x2b'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x54')]);router[_0xefa3('0x32')](_0xefa3('0x55'),auth['isAuthenticated'](),controller[_0xefa3('0x56')]);router[_0xefa3('0x32')](_0xefa3('0x30'),auth['isAuthenticated'](),controller[_0xefa3('0x57')]);router[_0xefa3('0x58')](_0xefa3('0xc'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x59')]);router[_0xefa3('0x58')](_0xefa3('0x5a'),auth[_0xefa3('0x8')](),controller['changePassword']);router[_0xefa3('0x5b')]('/:id/queues',auth['isAuthenticated'](),controller[_0xefa3('0x5c')]);router[_0xefa3('0x5b')](_0xefa3('0x1f'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x5d')]);router[_0xefa3('0x5b')](_0xefa3('0xc'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x5e')]);router[_0xefa3('0x5b')]('/:id/chat_interactions',auth[_0xefa3('0x8')](),controller[_0xefa3('0x5f')]);router[_0xefa3('0x5b')](_0xefa3('0x4a'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x60')]);router[_0xefa3('0x5b')](_0xefa3('0x4c'),auth['isAuthenticated'](),controller[_0xefa3('0x61')]);router[_0xefa3('0x5b')](_0xefa3('0x4d'),auth[_0xefa3('0x8')](),controller['removeSmsInteractions']);router[_0xefa3('0x5b')](_0xefa3('0x4e'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x62')]);router[_0xefa3('0x5b')]('/:id/whatsapp_interactions',auth[_0xefa3('0x8')](),controller[_0xefa3('0x63')]);router['delete'](_0xefa3('0x50'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x64')]);router[_0xefa3('0x5b')]('/:id/mail_accounts',auth[_0xefa3('0x8')](),controller[_0xefa3('0x65')]);router[_0xefa3('0x5b')](_0xefa3('0x27'),auth[_0xefa3('0x8')](),controller[_0xefa3('0x66')]);router[_0xefa3('0x5b')](_0xefa3('0x28'),auth['isAuthenticated'](),controller[_0xefa3('0x67')]);router[_0xefa3('0x5b')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xefa3('0x68')]);router['delete'](_0xefa3('0x2b'),auth[_0xefa3('0x8')](),controller['removeWhatsappAccounts']);router[_0xefa3('0x5b')](_0xefa3('0x55'),auth['isAuthenticated'](),controller[_0xefa3('0x69')]);router['delete'](_0xefa3('0x30'),auth['isAuthenticated'](),controller[_0xefa3('0x6a')]);module[_0xefa3('0x6b')]=router;
\ No newline at end of file
+var _0x9920=['/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','/:id/openchannel_accounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','delete','/:id/teams','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','describe','/whoami','whoami','/:id','show','/:id/avatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','/create_many','bulkCreate','post','addContacts','addQueues','join','root','server/files/images/','now','originalname','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause'];(function(_0x1d034c,_0x6e3173){var _0x5a80a9=function(_0x724359){while(--_0x724359){_0x1d034c['push'](_0x1d034c['shift']());}};_0x5a80a9(++_0x6e3173);}(_0x9920,0x1f0));var _0x0992=function(_0x22cdc2,_0x4460d5){_0x22cdc2=_0x22cdc2-0x0;var _0x38653b=_0x9920[_0x22cdc2];return _0x38653b;};'use strict';var multer=require(_0x0992('0x0'));var util=require(_0x0992('0x1'));var path=require(_0x0992('0x2'));var timeout=require('connect-timeout');var express=require(_0x0992('0x3'));var router=express[_0x0992('0x4')]();var auth=require(_0x0992('0x5'));var interaction=require(_0x0992('0x6'));var config=require(_0x0992('0x7'));var controller=require(_0x0992('0x8'));router[_0x0992('0x9')]('/',auth[_0x0992('0xa')](),controller['index']);router[_0x0992('0x9')]('/describe',auth[_0x0992('0xa')](),controller[_0x0992('0xb')]);router[_0x0992('0x9')](_0x0992('0xc'),auth[_0x0992('0xa')](),controller[_0x0992('0xd')]);router[_0x0992('0x9')](_0x0992('0xe'),auth[_0x0992('0xa')](),controller[_0x0992('0xf')]);router[_0x0992('0x9')](_0x0992('0x10'),controller['getAvatar']);router[_0x0992('0x9')](_0x0992('0x11'),auth[_0x0992('0xa')](),controller[_0x0992('0x12')]);router[_0x0992('0x9')](_0x0992('0x13'),auth[_0x0992('0xa')](),controller[_0x0992('0x14')]);router[_0x0992('0x9')](_0x0992('0x15'),auth[_0x0992('0xa')](),controller['getVoiceQueuesRt']);router[_0x0992('0x9')](_0x0992('0x16'),auth[_0x0992('0xa')](),controller[_0x0992('0x17')]);router[_0x0992('0x9')](_0x0992('0x18'),auth['isAuthenticated'](),controller[_0x0992('0x19')]);router[_0x0992('0x9')](_0x0992('0x1a'),auth['isAuthenticated'](),controller[_0x0992('0x1b')]);router[_0x0992('0x9')](_0x0992('0x1c'),auth[_0x0992('0xa')](),controller[_0x0992('0x1d')]);router[_0x0992('0x9')](_0x0992('0x1e'),auth[_0x0992('0xa')](),controller[_0x0992('0x1f')]);router[_0x0992('0x9')](_0x0992('0x20'),auth[_0x0992('0xa')](),controller[_0x0992('0x21')]);router[_0x0992('0x9')](_0x0992('0x22'),auth[_0x0992('0xa')](),controller[_0x0992('0x23')]);router[_0x0992('0x9')]('/:id/fax/interactions',auth[_0x0992('0xa')](),controller[_0x0992('0x24')]);router['get'](_0x0992('0x25'),auth[_0x0992('0xa')](),controller['getWhatsappInteractions']);router[_0x0992('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x0992('0x26')]);router['get'](_0x0992('0x27'),auth[_0x0992('0xa')](),controller[_0x0992('0x28')]);router[_0x0992('0x9')]('/:id/agents',auth[_0x0992('0xa')](),controller[_0x0992('0x29')]);router[_0x0992('0x9')](_0x0992('0x2a'),auth['isAuthenticated'](),controller[_0x0992('0x2b')]);router[_0x0992('0x9')](_0x0992('0x2c'),auth[_0x0992('0xa')](),controller[_0x0992('0x2d')]);router[_0x0992('0x9')](_0x0992('0x2e'),auth[_0x0992('0xa')](),controller[_0x0992('0x2f')]);router[_0x0992('0x9')]('/:id/openchannel_accounts',auth[_0x0992('0xa')](),controller[_0x0992('0x30')]);router[_0x0992('0x9')](_0x0992('0x31'),auth[_0x0992('0xa')](),controller[_0x0992('0x32')]);router[_0x0992('0x9')]('/:id/chat_websites',auth[_0x0992('0xa')](),controller[_0x0992('0x33')]);router[_0x0992('0x9')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x0992('0x34')]);router[_0x0992('0x9')](_0x0992('0x35'),auth['isAuthenticated'](),controller[_0x0992('0x36')]);router[_0x0992('0x9')](_0x0992('0x37'),auth[_0x0992('0xa')](),controller[_0x0992('0x38')]);router[_0x0992('0x9')]('/:id/api_key',auth[_0x0992('0xa')](),controller[_0x0992('0x39')]);router['post'](_0x0992('0x3a'),auth[_0x0992('0xa')](),controller[_0x0992('0x3b')]);router[_0x0992('0x3c')]('/:id/contacts',auth[_0x0992('0xa')](),controller[_0x0992('0x3d')]);router[_0x0992('0x3c')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0992('0x3c')](_0x0992('0x13'),auth[_0x0992('0xa')](),controller[_0x0992('0x3e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dc4a4,_0x1ff4f8,_0x3c23c5){_0x3c23c5(null,path[_0x0992('0x3f')](config[_0x0992('0x40')],_0x0992('0x41')));},'filename':function(_0x360f75,_0x3e5192,_0x5387d7){_0x5387d7(null,util['format']('%s-%s',Date[_0x0992('0x42')](),_0x3e5192[_0x0992('0x43')]));}})});router['post']('/:id/avatar',upload['single']('file'),controller[_0x0992('0x44')]);router[_0x0992('0x3c')](_0x0992('0x45'),auth[_0x0992('0xa')](),controller[_0x0992('0x46')]);router[_0x0992('0x3c')](_0x0992('0x47'),auth[_0x0992('0xa')](),controller[_0x0992('0x48')]);router[_0x0992('0x3c')](_0x0992('0x49'),auth['isAuthenticated'](),controller['pause']);router[_0x0992('0x3c')](_0x0992('0x4a'),auth[_0x0992('0xa')](),controller[_0x0992('0x4b')]);router[_0x0992('0x3c')]('/:id/teams',auth[_0x0992('0xa')](),controller[_0x0992('0x4c')]);router[_0x0992('0x3c')]('/:id/chat_interactions',auth[_0x0992('0xa')](),controller[_0x0992('0x4d')]);router['post'](_0x0992('0x4e'),auth[_0x0992('0xa')](),controller['addMailInteractions']);router[_0x0992('0x3c')](_0x0992('0x4f'),auth[_0x0992('0xa')](),controller['addFaxInteractions']);router['post']('/:id/sms_interactions',auth[_0x0992('0xa')](),controller[_0x0992('0x50')]);router[_0x0992('0x3c')](_0x0992('0x51'),auth[_0x0992('0xa')](),controller[_0x0992('0x52')]);router['post'](_0x0992('0x53'),auth[_0x0992('0xa')](),controller[_0x0992('0x54')]);router[_0x0992('0x3c')](_0x0992('0x2c'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0x0992('0x3c')](_0x0992('0x2e'),auth[_0x0992('0xa')](),controller[_0x0992('0x55')]);router[_0x0992('0x3c')](_0x0992('0x56'),auth[_0x0992('0xa')](),controller['addOpenchannelAccounts']);router['post']('/:id/sms_accounts',auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x0992('0x3c')](_0x0992('0x57'),auth[_0x0992('0xa')](),controller[_0x0992('0x58')]);router[_0x0992('0x3c')](_0x0992('0x59'),auth['isAuthenticated'](),controller[_0x0992('0x5a')]);router['post'](_0x0992('0x35'),auth[_0x0992('0xa')](),controller[_0x0992('0x5b')]);router[_0x0992('0x3c')](_0x0992('0x5c'),auth['isAuthenticated'](),controller[_0x0992('0x5d')]);router[_0x0992('0x5e')](_0x0992('0xe'),auth[_0x0992('0xa')](),controller[_0x0992('0x5f')]);router[_0x0992('0x5e')](_0x0992('0x60'),auth[_0x0992('0xa')](),controller[_0x0992('0x61')]);router[_0x0992('0x62')]('/:id/queues',auth[_0x0992('0xa')](),controller['removeQueues']);router['delete'](_0x0992('0x63'),auth['isAuthenticated'](),controller[_0x0992('0x64')]);router[_0x0992('0x62')]('/:id',auth[_0x0992('0xa')](),controller[_0x0992('0x65')]);router[_0x0992('0x62')](_0x0992('0x66'),auth['isAuthenticated'](),controller[_0x0992('0x67')]);router[_0x0992('0x62')](_0x0992('0x4e'),auth['isAuthenticated'](),controller[_0x0992('0x68')]);router['delete'](_0x0992('0x4f'),auth['isAuthenticated'](),controller[_0x0992('0x69')]);router[_0x0992('0x62')](_0x0992('0x6a'),auth[_0x0992('0xa')](),controller[_0x0992('0x6b')]);router[_0x0992('0x62')](_0x0992('0x51'),auth[_0x0992('0xa')](),controller['removeOpenchannelInteractions']);router[_0x0992('0x62')](_0x0992('0x53'),auth[_0x0992('0xa')](),controller[_0x0992('0x6c')]);router[_0x0992('0x62')](_0x0992('0x2c'),auth[_0x0992('0xa')](),controller[_0x0992('0x6d')]);router[_0x0992('0x62')]('/:id/mail_accounts',auth[_0x0992('0xa')](),controller['removeMailAccounts']);router[_0x0992('0x62')](_0x0992('0x56'),auth[_0x0992('0xa')](),controller[_0x0992('0x6e')]);router['delete'](_0x0992('0x31'),auth[_0x0992('0xa')](),controller['removeSmsAccounts']);router[_0x0992('0x62')](_0x0992('0x57'),auth[_0x0992('0xa')](),controller['removeChatWebsites']);router[_0x0992('0x62')](_0x0992('0x59'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0x0992('0x62')]('/:id/square_projects',auth[_0x0992('0xa')](),controller[_0x0992('0x6f')]);router[_0x0992('0x62')](_0x0992('0x5c'),auth[_0x0992('0xa')](),controller[_0x0992('0x70')]);module[_0x0992('0x71')]=router;
\ No newline at end of file
diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js
index 5ae1f90..54947a5 100644
--- a/server/api/user/user.attributes.js
+++ b/server/api/user/user.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x50b4=['avpf','force_avp','dtlssetup','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','ENUM','admin','user','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','transport','join','split','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','active','passive','actpass','update,nonat','showWebBar','get','isArray','encryption','icesupport','dtlsenable','dtlscertfile','rtcp_mux','wss'];(function(_0x70ef92,_0x402685){var _0x54b65b=function(_0x26c96b){while(--_0x26c96b){_0x70ef92['push'](_0x70ef92['shift']());}};_0x54b65b(++_0x402685);}(_0x50b4,0x1b3));var _0x450b=function(_0xa6050a,_0x368a6b){_0xa6050a=_0xa6050a-0x0;var _0x542b24=_0x50b4[_0xa6050a];return _0x542b24;};'use strict';var Sequelize=require(_0x450b('0x0'));var moment=require(_0x450b('0x1'));var util=require(_0x450b('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x450b('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2deac3){this[_0x450b('0x4')]('name',_0x2deac3);this[_0x450b('0x4')](_0x450b('0x5'),_0x2deac3);},'comment':_0x450b('0x6')},'fullname':{'type':Sequelize[_0x450b('0x3')],'allowNull':![],'set':function(_0x4ac7b8){this['setDataValue'](_0x450b('0x7'),_0x4ac7b8);this[_0x450b('0x4')](_0x450b('0x8'),util[_0x450b('0x9')](_0x450b('0xa'),_0x4ac7b8,this[_0x450b('0xb')]('internal')));}},'alias':{'type':Sequelize[_0x450b('0x3')]},'email':{'type':Sequelize[_0x450b('0x3')],'allowNull':![],'unique':_0x450b('0xc'),'validate':{'isEmail':!![]},'set':function(_0x4aaa8b){if(_0x4aaa8b){this['setDataValue']('email',_0x4aaa8b['toLowerCase']());}}},'role':{'type':Sequelize[_0x450b('0xd')](_0x450b('0xe'),_0x450b('0xf'),_0x450b('0x10'),_0x450b('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x450b('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x450b('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x1b9a8a){this[_0x450b('0x4')]('internal',_0x1b9a8a);this[_0x450b('0x4')](_0x450b('0x13'),_0x1b9a8a);this[_0x450b('0x4')](_0x450b('0x8'),util[_0x450b('0x9')](_0x450b('0xa'),this['getDataValue'](_0x450b('0x7')),_0x1b9a8a));}},'salt':{'type':Sequelize[_0x450b('0x3')]},'phone':{'type':Sequelize[_0x450b('0x3')]},'mobile':{'type':Sequelize[_0x450b('0x3')]},'address':{'type':Sequelize[_0x450b('0x3')]},'zipcode':{'type':Sequelize[_0x450b('0x3')]},'userpic':{'type':Sequelize[_0x450b('0x3')]},'city':{'type':Sequelize[_0x450b('0x3')]},'country':{'type':Sequelize[_0x450b('0x3')]},'online':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x450b('0x15')]},'voicePause':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x450b('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x450b('0x15')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x450b('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x450b('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x450b('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x450b('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x450b('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x450b('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x450b('0xd')]('friend','user',_0x450b('0x16')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![],'defaultValue':_0x450b('0x17')},'callingpres':{'type':Sequelize[_0x450b('0xd')]('ALLOWED_NOT_SCREENED',_0x450b('0x18'),_0x450b('0x19'),_0x450b('0x1a'),_0x450b('0x1b'),_0x450b('0x1c'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![],'defaultValue':_0x450b('0x1d'),'set':function(_0xba9983){this[_0x450b('0x4')](_0x450b('0x1e'),_0xba9983?_0xba9983[_0x450b('0x1f')](','):null);},'get':function(){return this[_0x450b('0xb')](_0x450b('0x1e'))?this[_0x450b('0xb')]('transport')[_0x450b('0x20')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x21'),_0x450b('0x22'),_0x450b('0x23'),_0x450b('0x24'),'auto'),'allowNull':!![],'defaultValue':_0x450b('0x21')},'directmedia':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no',_0x450b('0x26'),_0x450b('0x27'),_0x450b('0x28')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x44ba21){this[_0x450b('0x4')](_0x450b('0x29'),_0x44ba21?_0x44ba21[_0x450b('0x1f')](','):null);},'get':function(){return this['getDataValue'](_0x450b('0x29'))?this[_0x450b('0xb')](_0x450b('0x29'))[_0x450b('0x20')](','):null;},'comment':_0x450b('0x2a')},'callgroup':{'type':Sequelize[_0x450b('0x3')]},'namedcallgroup':{'type':Sequelize[_0x450b('0x3')]},'pickupgroup':{'type':Sequelize[_0x450b('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x450b('0x3')]},'language':{'type':Sequelize[_0x450b('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x450b('0x3')]},'disallow':{'type':Sequelize[_0x450b('0x3')],'allowNull':![],'defaultValue':_0x450b('0x2b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x450b('0x2c'),'set':function(_0x55fa38){this[_0x450b('0x4')](_0x450b('0x2d'),_0x55fa38?_0x55fa38[_0x450b('0x1f')](';'):_0x450b('0x2c'));},'get':function(){return this[_0x450b('0xb')](_0x450b('0x2d'))?this[_0x450b('0xb')](_0x450b('0x2d'))[_0x450b('0x20')](';'):null;},'comment':_0x450b('0x2e')},'autoframing':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x23dd6e){this[_0x450b('0x4')](_0x450b('0x2f'),_0x23dd6e?_0x23dd6e[_0x450b('0x1f')](','):null);},'get':function(){return this['getDataValue']('insecure')?this['getDataValue']('insecure')['split'](','):null;},'comment':_0x450b('0x30')},'trustrpid':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no',_0x450b('0x31')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x450b('0x25'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x450b('0x32')},'amaflags':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x450b('0x25'),'no'),'allowNull':!![],'defaultValue':_0x450b('0x25')},'busylevel':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x450b('0xd')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x450b('0x25'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x450b('0x25'),'no',_0x450b('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x450b('0xd')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x34'),_0x450b('0x35'),_0x450b('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x450b('0xd')]('uac','uas'),'allowNull':!![],'defaultValue':_0x450b('0x37')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![],'defaultValue':_0x450b('0x25')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x450b('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x450b('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x450b('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x450b('0xd')]('yes','no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x38'),_0x450b('0x39'),_0x450b('0x3a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x450b('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x450b('0xd')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no',_0x450b('0x26'),'update',_0x450b('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x450b('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x450b('0x15')]},'showWebBar':{'type':Sequelize[_0x450b('0x12')],'defaultValue':0x0,'set':function(_0x293c5a){this[_0x450b('0x4')](_0x450b('0x3c'),_0x293c5a);var _0x3e94ab=this[_0x450b('0x3d')]({'plain':!![]});switch(_0x293c5a){case 0x0:case 0x1:var _0x4fff7e=_0x3e94ab[_0x450b('0x1e')]?_[_0x450b('0x3e')](_0x3e94ab[_0x450b('0x1e')])?_0x3e94ab[_0x450b('0x1e')][_0x450b('0x1f')]():_0x3e94ab[_0x450b('0x1e')]:_0x450b('0x1d');if(_0x4fff7e==='wss'){_0x4fff7e=_0x450b('0x1d');}this[_0x450b('0x4')]('transport',_0x4fff7e);this[_0x450b('0x4')](_0x450b('0x3f'),'no');this[_0x450b('0x4')]('avpf',null);this[_0x450b('0x4')]('force_avp',null);this[_0x450b('0x4')](_0x450b('0x40'),null);this[_0x450b('0x4')](_0x450b('0x41'),null);this['setDataValue']('dtlsverify',null);this[_0x450b('0x4')]('dtlssetup',null);this[_0x450b('0x4')](_0x450b('0x42'),null);this[_0x450b('0x4')]('dtlsprivatekey',null);this[_0x450b('0x4')](_0x450b('0x43'),'no');break;case 0x2:this['setDataValue']('transport',_0x450b('0x44'));this[_0x450b('0x4')](_0x450b('0x3f'),_0x450b('0x25'));this['setDataValue'](_0x450b('0x45'),'yes');this[_0x450b('0x4')](_0x450b('0x46'),'yes');this['setDataValue']('icesupport','yes');this[_0x450b('0x4')](_0x450b('0x41'),_0x450b('0x25'));this[_0x450b('0x4')]('dtlsverify','no');this['setDataValue'](_0x450b('0x47'),_0x450b('0x3a'));this[_0x450b('0x4')](_0x450b('0x42'),_0x3e94ab[_0x450b('0x42')]||_0x450b('0x48'));this[_0x450b('0x4')]('dtlsprivatekey',_0x3e94ab[_0x450b('0x49')]||_0x450b('0x4a'));this[_0x450b('0x4')]('rtcp_mux',_0x450b('0x25'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x127fb2){this[_0x450b('0x4')](_0x450b('0x4b'),_0x127fb2?_0x127fb2['join'](','):[]);},'get':function(){return this[_0x450b('0xb')](_0x450b('0x4b'))?_[_0x450b('0x4c')](this[_0x450b('0xb')](_0x450b('0x4b'))[_0x450b('0x20')](','),function(_0x3a58dc){return parseInt(_0x3a58dc,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x450b('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x450b('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x450b('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x450b('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x450b('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x450b('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x450b('0xd')](_0x450b('0x25'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x450b('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x450b('0x3')]},'passwordResetAt':{'type':Sequelize[_0x450b('0x15')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x450b('0x4d')],'get':function(){return this[_0x450b('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0x450b('0xb')](_0x450b('0x4e')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0x450b('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x450b('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![],'set':function(_0x11c4c0){if(typeof _0x11c4c0==='string'){var _0x9b584b=_0x11c4c0==='1'?!![]:_0x11c4c0==='0'?![]:_0x11c4c0===_0x450b('0x4f')?!![]:_0x11c4c0==='false'?![]:![];this[_0x450b('0x4')](_0x450b('0x50'),_0x9b584b);}else{this['setDataValue']('screenrecording',_0x11c4c0);}}},'blocked':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![],'set':function(_0xbf68fa){this[_0x450b('0x4')](_0x450b('0x51'),_0xbf68fa);if(_0xbf68fa===!![]){this[_0x450b('0x4')](_0x450b('0x52'),moment());this[_0x450b('0x4')](_0x450b('0x53'),0x0);}else{this[_0x450b('0x4')](_0x450b('0x52'),null);}}},'blockedAt':{'type':Sequelize[_0x450b('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x450b('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x450b('0x14')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4f8f=['phoneBarEnableScreenRecordingByAgent','screenrecording','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','toLowerCase','ENUM','user','agent','telephone','local','INTEGER','BOOLEAN','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','inband','auto','yes','nonat','update','force_rport,comedia','nat','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','map'];(function(_0x5dff87,_0x4dda1e){var _0x130b6c=function(_0x311a69){while(--_0x311a69){_0x5dff87['push'](_0x5dff87['shift']());}};_0x130b6c(++_0x4dda1e);}(_0x4f8f,0x1e4));var _0xf4f8=function(_0x4c8f63,_0x3e08b7){_0x4c8f63=_0x4c8f63-0x0;var _0x1f7b59=_0x4f8f[_0x4c8f63];return _0x1f7b59;};'use strict';var Sequelize=require(_0xf4f8('0x0'));var moment=require(_0xf4f8('0x1'));var util=require(_0xf4f8('0x2'));var _=require(_0xf4f8('0x3'));module[_0xf4f8('0x4')]={'name':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':![],'unique':_0xf4f8('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x38ba68){this[_0xf4f8('0x7')](_0xf4f8('0x6'),_0x38ba68);this[_0xf4f8('0x7')](_0xf4f8('0x8'),_0x38ba68);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':![],'set':function(_0xfc8a38){this[_0xf4f8('0x7')](_0xf4f8('0x9'),_0xfc8a38);this[_0xf4f8('0x7')](_0xf4f8('0xa'),util[_0xf4f8('0xb')](_0xf4f8('0xc'),_0xfc8a38,this[_0xf4f8('0xd')](_0xf4f8('0xe'))));}},'alias':{'type':Sequelize[_0xf4f8('0x5')]},'email':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3b3cea){if(_0x3b3cea){this[_0xf4f8('0x7')]('email',_0x3b3cea[_0xf4f8('0xf')]());}}},'role':{'type':Sequelize[_0xf4f8('0x10')]('admin',_0xf4f8('0x11'),_0xf4f8('0x12'),_0xf4f8('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf4f8('0x5')],'defaultValue':_0xf4f8('0x14')},'internal':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':![],'unique':_0xf4f8('0xe'),'set':function(_0x2df400){this[_0xf4f8('0x7')](_0xf4f8('0xe'),_0x2df400);this[_0xf4f8('0x7')]('accountcode',_0x2df400);this[_0xf4f8('0x7')](_0xf4f8('0xa'),util['format'](_0xf4f8('0xc'),this[_0xf4f8('0xd')](_0xf4f8('0x9')),_0x2df400));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf4f8('0x5')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xf4f8('0x5')]},'zipcode':{'type':Sequelize[_0xf4f8('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf4f8('0x5')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xf4f8('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xf4f8('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf4f8('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf4f8('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf4f8('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf4f8('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xf4f8('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf4f8('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xf4f8('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xf4f8('0x19'),_0xf4f8('0x11'),'peer'),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf4f8('0x1a')},'callingpres':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x1b'),'ALLOWED_PASSED_SCREEN',_0xf4f8('0x1c'),_0xf4f8('0x1d'),_0xf4f8('0x1e'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xf4f8('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![],'defaultValue':_0xf4f8('0x20'),'set':function(_0x21d234){this[_0xf4f8('0x7')]('transport',_0x21d234?_0x21d234[_0xf4f8('0x21')](','):null);},'get':function(){return this['getDataValue'](_0xf4f8('0x22'))?this['getDataValue'](_0xf4f8('0x22'))[_0xf4f8('0x23')](','):null;},'comment':_0xf4f8('0x24')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info','shortinfo',_0xf4f8('0x25'),_0xf4f8('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no',_0xf4f8('0x28'),_0xf4f8('0x29'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![],'defaultValue':_0xf4f8('0x2a'),'set':function(_0x45799d){this[_0xf4f8('0x7')](_0xf4f8('0x2b'),_0x45799d?_0x45799d[_0xf4f8('0x21')](','):null);},'get':function(){return this[_0xf4f8('0xd')]('nat')?this[_0xf4f8('0xd')]('nat')[_0xf4f8('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xf4f8('0x5')]},'namedcallgroup':{'type':Sequelize[_0xf4f8('0x5')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf4f8('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf4f8('0x5')]},'disallow':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4cb6ce){this['setDataValue'](_0xf4f8('0x2c'),_0x4cb6ce?_0x4cb6ce[_0xf4f8('0x21')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0xf4f8('0xd')](_0xf4f8('0x2c'))['split'](';'):null;},'comment':_0xf4f8('0x2d')},'autoframing':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x4941c9){this[_0xf4f8('0x7')](_0xf4f8('0x2e'),_0x4941c9?_0x4941c9[_0xf4f8('0x21')](','):null);},'get':function(){return this['getDataValue'](_0xf4f8('0x2e'))?this['getDataValue'](_0xf4f8('0x2e'))[_0xf4f8('0x23')](','):null;},'comment':_0xf4f8('0x2f')},'trustrpid':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no',_0xf4f8('0x30')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xf4f8('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf4f8('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf4f8('0x31')},'amaflags':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![],'defaultValue':_0xf4f8('0x27')},'busylevel':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf4f8('0x10')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xf4f8('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x32'),_0xf4f8('0x33'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xf4f8('0x34'),_0xf4f8('0x35')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xf4f8('0x27'),'no'),'allowNull':!![],'defaultValue':_0xf4f8('0x27')},'keepalive':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf4f8('0x10')]('yes','no',_0xf4f8('0x36'),_0xf4f8('0x37')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x38'),_0xf4f8('0x39'),_0xf4f8('0x3a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf4f8('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no','nonat','update',_0xf4f8('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf4f8('0x5')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0xf4f8('0x15')],'defaultValue':0x0,'set':function(_0x4b9d4c){this[_0xf4f8('0x7')](_0xf4f8('0x3c'),_0x4b9d4c);var _0x138cfd=this['get']({'plain':!![]});switch(_0x4b9d4c){case 0x0:case 0x1:var _0x5c4e5f=_0x138cfd['transport']?_['isArray'](_0x138cfd[_0xf4f8('0x22')])?_0x138cfd[_0xf4f8('0x22')]['join']():_0x138cfd[_0xf4f8('0x22')]:_0xf4f8('0x20');if(_0x5c4e5f===_0xf4f8('0x3d')){_0x5c4e5f=_0xf4f8('0x20');}this[_0xf4f8('0x7')](_0xf4f8('0x22'),_0x5c4e5f);this[_0xf4f8('0x7')](_0xf4f8('0x3e'),'no');this[_0xf4f8('0x7')](_0xf4f8('0x3f'),null);this[_0xf4f8('0x7')](_0xf4f8('0x40'),null);this[_0xf4f8('0x7')](_0xf4f8('0x41'),null);this['setDataValue'](_0xf4f8('0x42'),null);this[_0xf4f8('0x7')](_0xf4f8('0x43'),null);this[_0xf4f8('0x7')](_0xf4f8('0x44'),null);this[_0xf4f8('0x7')](_0xf4f8('0x45'),null);this[_0xf4f8('0x7')](_0xf4f8('0x46'),null);this['setDataValue'](_0xf4f8('0x47'),'no');break;case 0x2:this[_0xf4f8('0x7')](_0xf4f8('0x22'),_0xf4f8('0x3d'));this[_0xf4f8('0x7')](_0xf4f8('0x3e'),_0xf4f8('0x27'));this['setDataValue'](_0xf4f8('0x3f'),_0xf4f8('0x27'));this[_0xf4f8('0x7')](_0xf4f8('0x40'),'yes');this[_0xf4f8('0x7')]('icesupport',_0xf4f8('0x27'));this[_0xf4f8('0x7')](_0xf4f8('0x42'),_0xf4f8('0x27'));this[_0xf4f8('0x7')](_0xf4f8('0x43'),'no');this[_0xf4f8('0x7')]('dtlssetup',_0xf4f8('0x3a'));this[_0xf4f8('0x7')](_0xf4f8('0x45'),_0x138cfd[_0xf4f8('0x45')]||_0xf4f8('0x48'));this['setDataValue'](_0xf4f8('0x46'),_0x138cfd[_0xf4f8('0x46')]||_0xf4f8('0x49'));this[_0xf4f8('0x7')](_0xf4f8('0x47'),_0xf4f8('0x27'));break;default:}}},'permissions':{'type':Sequelize[_0xf4f8('0x4a')],'set':function(_0x34c578){this[_0xf4f8('0x7')]('permissions',_0x34c578?_0x34c578[_0xf4f8('0x21')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0xf4f8('0x4b')](this['getDataValue']('permissions')[_0xf4f8('0x23')](','),function(_0x5f0566){return parseInt(_0x5f0566,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf4f8('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf4f8('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf4f8('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf4f8('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf4f8('0x10')](_0xf4f8('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf4f8('0x5')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf4f8('0xd')](_0xf4f8('0x4c'))?this[_0xf4f8('0xd')](_0xf4f8('0x4c')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xf4f8('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf4f8('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![],'set':function(_0x22c85f){if(typeof _0x22c85f==='string'){var _0x19255b=_0x22c85f==='1'?!![]:_0x22c85f==='0'?![]:_0x22c85f==='true'?!![]:_0x22c85f==='false'?![]:![];this[_0xf4f8('0x7')](_0xf4f8('0x4d'),_0x19255b);}else{this[_0xf4f8('0x7')]('screenrecording',_0x22c85f);}}},'blocked':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![],'set':function(_0x603ff8){this[_0xf4f8('0x7')]('blocked',_0x603ff8);if(_0x603ff8===!![]){this[_0xf4f8('0x7')](_0xf4f8('0x4e'),moment());this[_0xf4f8('0x7')](_0xf4f8('0x4f'),0x0);}else{this['setDataValue'](_0xf4f8('0x4e'),null);}}},'blockedAt':{'type':Sequelize[_0xf4f8('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf4f8('0x16')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js
index e542a43..8897785 100644
--- a/server/api/user/user.controller.js
+++ b/server/api/user/user.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf30=['spread','QueueId','emit','Queue:save','voice','push','interface','format','SIP/%s','each','upsert','removeQueues','remove','Queues','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getContacts','CmContact','sort','CmList','List','Tag','Tags','color','tag','getQueues','pick','Queue','Unknown\x20role','hasOwnProperty','UserVoiceQueueRt','getVoiceQueuesRt','getGroups','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','forEach','device','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','PAUSE','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','mail','chat','fax','sms','whatsapp','Pause','getTeams','Team','addTeams','getVoiceQueues','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','getWhatsappQueues','getFaxQueues','Openchannel','flatten','transaction','getDataValue','removeTeams','Sms','Whatsapp','Fax','removeAgent','Queue:remove','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','CmHopper','concat','$or','$gt','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','firstName','lastName','Contact','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./user.socket','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','update','then','destroy','user','agent','Telephones','filter','ignore','map','value','role','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','type','key','model','differenceBy','salt','query','keys','intersection','attributes','fields','length','nolimit','order','where','filters','VIRTUAL','sequelize','lower','col','merge','options','includeAll','include','findAll','rows','show','password','find','bulkCreate','body','params','describe','addContacts','omit','telephone','admin','../../config/license/util','getLicense','users','isNil','License\x20limit\x20reached','create','internal','findById','min_internal','max','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','106','107','108','109','111','114','get','Agents','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','Setting','findOne','securePassword','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','online','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','ids','penalty'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xaf30,0xd0));var _0x0af3=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xaf30[_0x1c8c28];return _0x1f59b4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0af3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0af3('0x1'));var jsonpatch=require(_0x0af3('0x2'));var rp=require(_0x0af3('0x3'));var moment=require('moment');var BPromise=require(_0x0af3('0x4'));var Mustache=require(_0x0af3('0x5'));var util=require(_0x0af3('0x6'));var path=require(_0x0af3('0x7'));var sox=require(_0x0af3('0x8'));var csv=require(_0x0af3('0x9'));var ejs=require(_0x0af3('0xa'));var fs=require('fs');var _=require(_0x0af3('0xb'));var squel=require(_0x0af3('0xc'));var crypto=require(_0x0af3('0xd'));var jsforce=require(_0x0af3('0xe'));var deskjs=require(_0x0af3('0xf'));var toCsv=require(_0x0af3('0x9'));var querystring=require(_0x0af3('0x10'));var Papa=require(_0x0af3('0x11'));var Redis=require(_0x0af3('0x12'));var authService=require(_0x0af3('0x13'));var qs=require(_0x0af3('0x14'));var as=require(_0x0af3('0x15'));var hardwareService=require(_0x0af3('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0af3('0x17'));var db=require(_0x0af3('0x18'))['db'];config[_0x0af3('0x19')]=_[_0x0af3('0x1a')](config[_0x0af3('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0af3('0x1b'))(new Redis(config[_0x0af3('0x19')]));require(_0x0af3('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0af3('0x1d')][_0x0af3('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3d1cfc,_0x5c3b8d,_0x393152){if(_0x393152){var _0x11b6c5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11b6c5[_0x0af3('0x1f')](_0x5c3b8d)){return _0x3d1cfc;}else{throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))](_0x0af3('0x22'));}}else{return _0x3d1cfc;}}function respondWithRpcPromise(_0x44d2b0,_0x307f1a,_0x41b0d0,_0x1d82b4){return new BPromise(function(_0x117af9,_0x44471d){var _0x438aa=_0x1d82b4||client;return _0x438aa[_0x0af3('0x23')](_0x44d2b0,_0x41b0d0)['then'](function(_0x157031){logger[_0x0af3('0x24')](_0x0af3('0x25'),_0x307f1a,_0x0af3('0x26'));logger[_0x0af3('0x27')](_0x0af3('0x28'),_0x307f1a,'request\x20sent',JSON[_0x0af3('0x29')](_0x157031));if(_0x157031['error']){if(_0x157031[_0x0af3('0x2a')][_0x0af3('0x2b')]===0x1f4){logger[_0x0af3('0x2a')](_0x0af3('0x25'),_0x307f1a,_0x157031[_0x0af3('0x2a')][_0x0af3('0x2c')]);return _0x44471d(_0x157031[_0x0af3('0x2a')]['message']);}logger[_0x0af3('0x2a')](_0x0af3('0x25'),_0x307f1a,_0x157031[_0x0af3('0x2a')]['message']);return _0x117af9(_0x157031[_0x0af3('0x2a')][_0x0af3('0x2c')]);}else{logger[_0x0af3('0x24')](_0x0af3('0x25'),_0x307f1a,_0x0af3('0x26'));_0x117af9(_0x157031[_0x0af3('0x2d')]['message']);}})[_0x0af3('0x2e')](function(_0x49b947){logger[_0x0af3('0x2a')]('User,\x20%s,\x20%s',_0x307f1a,_0x49b947);_0x44471d(_0x49b947);});});}function respondWithStatusCode(_0x511b4d,_0x40980b){_0x40980b=_0x40980b||0xcc;return function(_0x25a387){if(_0x25a387){return _0x511b4d[_0x0af3('0x2f')](_0x40980b);}return _0x511b4d[_0x0af3('0x30')](_0x40980b)['end']();};}function respondWithResult(_0x108f6f,_0x1b78ef){_0x1b78ef=_0x1b78ef||0xc8;return function(_0x19d044){if(_0x19d044){return _0x108f6f[_0x0af3('0x30')](_0x1b78ef)[_0x0af3('0x31')](_0x19d044);}};}function respondWithFilteredResult(_0x2505a3,_0x440f0a){return function(_0x32a025){if(_0x32a025){var _0x57f227=_0x32a025[_0x0af3('0x32')],_0x439a4c=_0x440f0a[_0x0af3('0x33')],_0x3a9345=_0x440f0a[_0x0af3('0x33')]+_0x440f0a[_0x0af3('0x34')],_0x3c4948;if(_0x3a9345>=_0x57f227){_0x3a9345=_0x57f227;_0x3c4948=0xc8;}else{_0x3c4948=0xce;}_0x2505a3[_0x0af3('0x30')](_0x3c4948);return _0x2505a3[_0x0af3('0x35')](_0x0af3('0x36'),_0x439a4c+'-'+_0x3a9345+'/'+_0x57f227)[_0x0af3('0x31')](_0x32a025);}return null;};}function patchUpdates(_0xba63db){return function(_0x14da02){try{jsonpatch['apply'](_0x14da02,_0xba63db,!![]);}catch(_0x18f4d5){return BPromise['reject'](_0x18f4d5);}return _0x14da02['save']();};}function saveUpdates(_0x2ff405,_0x420828){return function(_0xd0730){if(_0xd0730){return _0xd0730[_0x0af3('0x37')](_0x2ff405)[_0x0af3('0x38')](function(_0x4cf978){return _0x4cf978;});}return null;};}function removeEntity(_0x3e0420,_0x412ecb){return function(_0x545583){if(_0x545583){return _0x545583[_0x0af3('0x39')]()[_0x0af3('0x38')](function(){var _0x190941=_0x545583['get']({'plain':!![]});var _0x25475c=[{'name':'Users','value':_0x0af3('0x3a'),'ignore':!![]},{'name':'Agents','value':_0x0af3('0x3b'),'ignore':![]},{'name':_0x0af3('0x3c'),'value':'telephone','ignore':![]}];var _0xd802f7=_(_0x25475c)[_0x0af3('0x3d')](_0x0af3('0x3e'))[_0x0af3('0x3f')]('value')[_0x0af3('0x40')]();if(_['includes'](_0xd802f7,_0x190941[_0x0af3('0x41')])){return;}var _0x1ceb61=_['find'](_0x25475c,['value',_0x190941['role']])[_0x0af3('0x42')];return db[_0x0af3('0x43')][_0x0af3('0x39')]({'where':{'type':_0x1ceb61,'resourceId':_0x190941['id']}})[_0x0af3('0x38')](function(){return _0x545583;});})[_0x0af3('0x38')](function(){_0x3e0420[_0x0af3('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x352b09,_0x47e1cc){return function(_0xc538d){if(!_0xc538d){_0x352b09[_0x0af3('0x2f')](0x194);}return _0xc538d;};}function handleError(_0x101a08,_0x57d608){_0x57d608=_0x57d608||0x1f4;return function(_0x3b3ca4){logger['error'](_0x3b3ca4[_0x0af3('0x44')]);if(_0x3b3ca4[_0x0af3('0x42')]){delete _0x3b3ca4['name'];}_0x101a08['status'](_0x57d608)[_0x0af3('0x45')](_0x3b3ca4);};}exports[_0x0af3('0x46')]=function(_0x283e4f,_0x4452ff){var _0x282b21={},_0x3fa016={},_0x5acb52={'count':0x0,'rows':[]};var _0x1d8283=_['map'](db[_0x0af3('0x47')][_0x0af3('0x48')],function(_0x2a2be0){return{'name':_0x2a2be0[_0x0af3('0x49')],'type':_0x2a2be0[_0x0af3('0x4a')][_0x0af3('0x4b')]};});_0x3fa016[_0x0af3('0x4c')]=_[_0x0af3('0x4d')](_[_0x0af3('0x3f')](_0x1d8283,_0x0af3('0x42')),['password',_0x0af3('0x4e')]);_0x3fa016[_0x0af3('0x4f')]=_[_0x0af3('0x50')](_0x283e4f[_0x0af3('0x4f')]);_0x3fa016['filters']=_[_0x0af3('0x51')](_0x3fa016[_0x0af3('0x4c')],_0x3fa016[_0x0af3('0x4f')]);_0x282b21[_0x0af3('0x52')]=_['intersection'](_0x3fa016['model'],qs[_0x0af3('0x53')](_0x283e4f[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x282b21['attributes']=_0x282b21[_0x0af3('0x52')][_0x0af3('0x54')]?_0x282b21[_0x0af3('0x52')]:_0x3fa016[_0x0af3('0x4c')];if(!_0x283e4f[_0x0af3('0x4f')]['hasOwnProperty'](_0x0af3('0x55'))){_0x282b21['limit']=qs[_0x0af3('0x34')](_0x283e4f[_0x0af3('0x4f')][_0x0af3('0x34')]);_0x282b21[_0x0af3('0x33')]=qs['offset'](_0x283e4f[_0x0af3('0x4f')][_0x0af3('0x33')]);}_0x282b21[_0x0af3('0x56')]=qs['sort'](_0x283e4f[_0x0af3('0x4f')]['sort']);_0x282b21[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_['pick'](_0x283e4f[_0x0af3('0x4f')],_0x3fa016[_0x0af3('0x58')]),_0x1d8283);if(_0x283e4f['query'][_0x0af3('0x3d')]){_0x282b21['where']=_['merge'](_0x282b21['where'],{'$or':_[_0x0af3('0x3f')](_0x1d8283,function(_0x492cfa){if(_0x492cfa[_0x0af3('0x4a')]!==_0x0af3('0x59')){return db[_0x0af3('0x5a')]['where'](db['sequelize']['fn'](_0x0af3('0x5b'),db[_0x0af3('0x5a')][_0x0af3('0x5c')](_0x492cfa['name'])),{'$like':db['sequelize']['fn'](_0x0af3('0x5b'),'%'+_0x283e4f[_0x0af3('0x4f')][_0x0af3('0x3d')]+'%')});}})});}_0x282b21=_[_0x0af3('0x5d')]({},_0x282b21,_0x283e4f[_0x0af3('0x5e')]);var _0x460ef6={'where':_0x282b21[_0x0af3('0x57')]};return db[_0x0af3('0x47')][_0x0af3('0x32')](_0x460ef6)[_0x0af3('0x38')](function(_0x17729e){_0x5acb52[_0x0af3('0x32')]=_0x17729e;if(_0x283e4f[_0x0af3('0x4f')][_0x0af3('0x5f')]){_0x282b21[_0x0af3('0x60')]=[{'all':!![]}];}return db[_0x0af3('0x47')][_0x0af3('0x61')](_0x282b21);})['then'](function(_0xefb90a){_0x5acb52[_0x0af3('0x62')]=_0xefb90a;return _0x5acb52;})['then'](respondWithFilteredResult(_0x4452ff,_0x282b21))[_0x0af3('0x2e')](handleError(_0x4452ff,null));};exports[_0x0af3('0x63')]=function(_0x353c96,_0x51e8e5){var _0x2280cd={'raw':![],'where':{'id':_0x353c96['params']['id']}},_0x5c8eef={};_0x5c8eef[_0x0af3('0x4c')]=_[_0x0af3('0x4d')](_[_0x0af3('0x50')](db['User'][_0x0af3('0x48')]),[_0x0af3('0x64'),_0x0af3('0x4e')]);_0x5c8eef['query']=_[_0x0af3('0x50')](_0x353c96['query']);_0x5c8eef[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x5c8eef[_0x0af3('0x4c')],_0x5c8eef['query']);_0x2280cd['attributes']=_[_0x0af3('0x51')](_0x5c8eef['model'],qs[_0x0af3('0x53')](_0x353c96[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x2280cd[_0x0af3('0x52')]=_0x2280cd['attributes'][_0x0af3('0x54')]?_0x2280cd[_0x0af3('0x52')]:_0x5c8eef[_0x0af3('0x4c')];if(_0x353c96['query'][_0x0af3('0x5f')]){_0x2280cd['include']=[{'all':!![]}];}_0x2280cd=_['merge']({},_0x2280cd,_0x353c96[_0x0af3('0x5e')]);return db['User'][_0x0af3('0x65')](_0x2280cd)[_0x0af3('0x38')](handleEntityNotFound(_0x51e8e5,null))['then'](respondWithResult(_0x51e8e5,null))[_0x0af3('0x2e')](handleError(_0x51e8e5,null));};exports['bulkCreate']=function(_0x3e0a01,_0x3d6919){return db[_0x0af3('0x47')][_0x0af3('0x66')](_0x3e0a01[_0x0af3('0x67')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3d6919,0xc9))['catch'](handleError(_0x3d6919,null));};exports[_0x0af3('0x37')]=function(_0x396dd7,_0x5a274c){if(_0x396dd7[_0x0af3('0x67')]['id']){delete _0x396dd7[_0x0af3('0x67')]['id'];}delete _0x396dd7[_0x0af3('0x67')][_0x0af3('0x41')];return db['User'][_0x0af3('0x65')]({'where':{'id':_0x396dd7[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x5a274c,null))[_0x0af3('0x38')](saveUpdates(_0x396dd7['body'],null))[_0x0af3('0x38')](respondWithResult(_0x5a274c,null))[_0x0af3('0x2e')](handleError(_0x5a274c,null));};exports[_0x0af3('0x69')]=function(_0x1b7f1e,_0x2db26f){return db['User']['describe']()[_0x0af3('0x38')](respondWithResult(_0x2db26f,null))['catch'](handleError(_0x2db26f,null));};exports[_0x0af3('0x6a')]=function(_0x18b843,_0x5dff89,_0x3a6ff7){return db[_0x0af3('0x47')][_0x0af3('0x65')]({'where':{'id':_0x18b843[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x5dff89,null))[_0x0af3('0x38')](function(_0x1f2a3c){if(_0x1f2a3c){return _0x1f2a3c[_0x0af3('0x6a')](_0x18b843[_0x0af3('0x67')]['ids'],_[_0x0af3('0x6b')](_0x18b843[_0x0af3('0x67')],['ids','id'])||{});}})[_0x0af3('0x38')](respondWithResult(_0x5dff89,null))[_0x0af3('0x2e')](handleError(_0x5dff89,null));};var getLicense=function(_0x59152c){return new BPromise(function(_0x2f8969,_0x39b9bc){var _0x2d43bd=0x0;_0x59152c['body'][_0x0af3('0x41')]===_0x0af3('0x3b')&&_0x2f8969('agent\x20role');return db[_0x0af3('0x47')]['count']({'where':{'$or':[{'role':_0x59152c[_0x0af3('0x67')][_0x0af3('0x41')]===_0x0af3('0x6c')?_0x0af3('0x6c'):[_0x0af3('0x6d'),'user']}]}})[_0x0af3('0x38')](function(_0x5a9a94){_0x2d43bd=_0x5a9a94;return require(_0x0af3('0x6e'))[_0x0af3('0x6f')]();})[_0x0af3('0x38')](function(_0x28bec8){var _0x158627=_0x59152c[_0x0af3('0x67')][_0x0af3('0x41')]==='telephone'?'telephones':_0x0af3('0x70');if(!_[_0x0af3('0x71')](_0x28bec8[_0x158627])&&_0x2d43bd>=_0x28bec8[_0x158627]){return _0x39b9bc({'message':_0x0af3('0x72')});}return _0x2f8969(util['format']('count\x20%s:\x20%s',_0x158627,_0x2d43bd));})[_0x0af3('0x2e')](function(_0x6be2fa){return _0x39b9bc(_0x6be2fa);});});};exports[_0x0af3('0x73')]=function(_0x54dd68,_0x4367ad){return getLicense(_0x54dd68)[_0x0af3('0x38')](function(_0x43fcf9){if(!_0x54dd68[_0x0af3('0x67')][_0x0af3('0x74')]){var _0x214313;return db['Setting'][_0x0af3('0x75')](0x1)[_0x0af3('0x38')](function(_0x439dc6){return checkPasswordPattern(_0x439dc6,_0x54dd68[_0x0af3('0x67')]['password'],_0x439dc6['securePassword']);})['then'](function(_0x49c6b0){_0x214313=_0x49c6b0[_0x0af3('0x76')];return db[_0x0af3('0x47')][_0x0af3('0x77')](_0x0af3('0x74'));})[_0x0af3('0x38')](function(_0x428919){if(_[_0x0af3('0x71')](_0x428919)){if(_0x214313){_0x54dd68[_0x0af3('0x67')][_0x0af3('0x74')]=_0x214313;}else{_0x54dd68[_0x0af3('0x67')][_0x0af3('0x74')]=0x1;}}else{if(_['isNil'](_0x214313)||_0x214313==_0x428919){_0x54dd68[_0x0af3('0x67')]['internal']=_0x428919+0x1;}else if(_0x214313>_0x428919){_0x54dd68[_0x0af3('0x67')][_0x0af3('0x74')]=_0x214313;}else{return db['sequelize'][_0x0af3('0x4f')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x0af3('0x5a')][_0x0af3('0x78')][_0x0af3('0x79')]})[_0x0af3('0x38')](function(_0x885294){if(_0x885294&&_0x885294['length']){for(var _0x4120c2=0x0,_0xbf3e34=_0x885294[_0x0af3('0x54')];_0x4120c2<_0xbf3e34&&_[_0x0af3('0x71')](_0x54dd68[_0x0af3('0x67')]['internal']);_0x4120c2++){if(_0x214313<=_0x885294[_0x4120c2][_0x0af3('0x7a')]){_0x54dd68['body'][_0x0af3('0x74')]=_0x885294[_0x4120c2]['from'];}else if(_0x214313>_0x885294[_0x4120c2]['from']&&_0x214313<=_0x885294[_0x4120c2]['to']){_0x54dd68[_0x0af3('0x67')][_0x0af3('0x74')]=_0x214313;}}}if(_[_0x0af3('0x71')](_0x54dd68[_0x0af3('0x67')]['internal'])){_0x54dd68[_0x0af3('0x67')]['internal']=_0x428919+0x1;}});}}});}})[_0x0af3('0x38')](function(){if(_0x54dd68[_0x0af3('0x67')][_0x0af3('0x7b')]){_0x54dd68[_0x0af3('0x67')][_0x0af3('0x7c')]=_0x54dd68['body'][_0x0af3('0x74')];_0x54dd68[_0x0af3('0x67')][_0x0af3('0x7d')]={'mailbox':_0x54dd68[_0x0af3('0x67')][_0x0af3('0x74')],'password':_0x54dd68[_0x0af3('0x67')][_0x0af3('0x64')],'fullname':_0x54dd68[_0x0af3('0x67')][_0x0af3('0x7e')],'email':_0x54dd68[_0x0af3('0x67')][_0x0af3('0x7f')]};}if(_0x54dd68[_0x0af3('0x67')]&&_0x54dd68['body'][_0x0af3('0x41')]===_0x0af3('0x3b')){if(!_0x54dd68[_0x0af3('0x67')]['permissions']){_0x54dd68[_0x0af3('0x67')][_0x0af3('0x80')]=[_0x0af3('0x81'),_0x0af3('0x82'),_0x0af3('0x83'),_0x0af3('0x84'),_0x0af3('0x85'),'104','105',_0x0af3('0x86'),_0x0af3('0x87'),_0x0af3('0x88'),_0x0af3('0x89'),'100',_0x0af3('0x8a'),_0x0af3('0x8b')];}}return db[_0x0af3('0x47')][_0x0af3('0x73')](_0x54dd68[_0x0af3('0x67')],{'include':[{'model':db['VoiceMail'],'as':_0x0af3('0x7d')}]});})['then'](function(_0x1b91fb){if(_0x54dd68['body'][_0x0af3('0x41')]==='user')return _0x1b91fb;var _0x1d25c7=_0x54dd68['user'][_0x0af3('0x8c')]({'plain':!![]});if(!_0x1d25c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d25c7[_0x0af3('0x41')]===_0x0af3('0x3a')){var _0x1ce049=_0x1b91fb[_0x0af3('0x8c')]({'plain':!![]});var _0x3dd31f=[{'name':_0x0af3('0x8d'),'value':_0x0af3('0x3b')},{'name':_0x0af3('0x3c'),'value':_0x0af3('0x6c')}];var _0x1db7fb=_[_0x0af3('0x65')](_0x3dd31f,['value',_0x1ce049[_0x0af3('0x41')]])[_0x0af3('0x42')];return db[_0x0af3('0x8e')][_0x0af3('0x65')]({'where':{'name':_0x1db7fb,'userProfileId':_0x1d25c7[_0x0af3('0x8f')]},'raw':!![]})['then'](function(_0x5da2bc){if(_0x5da2bc&&_0x5da2bc[_0x0af3('0x90')]===0x0){return db[_0x0af3('0x43')]['create']({'name':_0x1ce049[_0x0af3('0x42')],'resourceId':_0x1ce049['id'],'type':_0x5da2bc[_0x0af3('0x42')],'sectionId':_0x5da2bc['id']},{})[_0x0af3('0x38')](function(){return _0x1b91fb;});}else{return _0x1b91fb;}})['catch'](function(_0x51bb9a){logger[_0x0af3('0x2a')](_0x0af3('0x91'),_0x51bb9a);throw _0x51bb9a;});}return _0x1b91fb;})[_0x0af3('0x38')](respondWithResult(_0x4367ad,0xc9))['catch'](handleError(_0x4367ad,null));};exports[_0x0af3('0x92')]=function(_0x2f62d4,_0x664caf,_0x3f55d3){var _0x4f0107=![];if(_0x2f62d4[_0x0af3('0x67')]['id']){delete _0x2f62d4['body']['id'];}return db[_0x0af3('0x93')][_0x0af3('0x94')]({'attributes':['id',_0x0af3('0x95')]})['then'](function(_0x2d1195){_0x4f0107=_0x2d1195[_0x0af3('0x95')];return db['User']['find']({'where':{'id':_0x2f62d4['params']['id']}});})[_0x0af3('0x38')](function(_0xef39f8){if(_0xef39f8){if(_0xef39f8['id']==_0x2f62d4[_0x0af3('0x3a')]['id']){if(!_0x2f62d4[_0x0af3('0x67')][_0x0af3('0x96')]||!_0x2f62d4[_0x0af3('0x67')][_0x0af3('0x97')]){throw new db['Sequelize'][(_0x0af3('0x21'))](_0x0af3('0x98'));}if(!_0xef39f8[_0x0af3('0x99')](_0x2f62d4[_0x0af3('0x67')]['oldPassword'])){throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))](_0x0af3('0x9a'));}if(_0x2f62d4[_0x0af3('0x67')][_0x0af3('0x96')]==_0x2f62d4[_0x0af3('0x67')][_0x0af3('0x97')]){throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))](_0x0af3('0x9b'));}return _0xef39f8;}else if(_0x2f62d4[_0x0af3('0x3a')]['role']=='admin'){if(!_0x2f62d4['body']['newPassword']){throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))](_0x0af3('0x9c'));}return _0xef39f8;}else if(_0x2f62d4[_0x0af3('0x3a')][_0x0af3('0x41')]==_0x0af3('0x3a')){if(!_0x2f62d4[_0x0af3('0x67')][_0x0af3('0x97')]){throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))](_0x0af3('0x9c'));}if(_0xef39f8[_0x0af3('0x41')]!=_0x0af3('0x3b')){throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))](_0x0af3('0x9d'));}return _0xef39f8;}else{throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))](_0x0af3('0x9d'));}}return null;})['then'](handleEntityNotFound(_0x664caf,null))[_0x0af3('0x38')](function(_0x4c7266){return checkPasswordPattern(_0x4c7266,_0x2f62d4[_0x0af3('0x67')][_0x0af3('0x97')],_0x4f0107);})[_0x0af3('0x38')](saveUpdates({'password':_0x2f62d4[_0x0af3('0x67')]['newPassword'],'passwordResetAt':_0x2f62d4[_0x0af3('0x3a')]['id']==_0x2f62d4[_0x0af3('0x68')]['id']?moment():null},null))[_0x0af3('0x38')](respondWithResult(_0x664caf,null))[_0x0af3('0x2e')](handleError(_0x664caf,null));};exports['addQueues']=function(_0x1607cb,_0x54cd31,_0x23e8d4){var _0xf37f32=_0x1607cb['body'][_0x0af3('0x9e')];return db['User'][_0x0af3('0x65')]({'where':{'id':_0x1607cb[_0x0af3('0x68')]['id']},'attributes':['id',_0x0af3('0x42'),'role',_0x0af3('0x9f'),_0x0af3('0xa0'),_0x0af3('0xa1'),'interface']})['then'](handleEntityNotFound(_0x54cd31,null))['then'](function(_0x29e34d){if(_0x29e34d){if(!utils[_0x0af3('0xa2')](_0xf37f32)){throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))](_0x0af3('0xa3'));}return _0x29e34d[_0x0af3('0xa4')+_[_0x0af3('0xa5')](_0xf37f32[_0x0af3('0xa6')]())+'Queues'](_0x1607cb['body'][_0x0af3('0xa7')],{'penalty':_0x1607cb[_0x0af3('0x67')][_0x0af3('0xa8')]||0x0})[_0x0af3('0xa9')](function(_0x3a50b8){for(var _0x251c8e=0x0;_0x251c8e<_0x1607cb[_0x0af3('0x67')]['ids']['length'];_0x251c8e+=0x1){var _0x3c41ad={'UserId':_0x1607cb[_0x0af3('0x68')]['id']};_0x3c41ad[_['capitalize'](_0xf37f32['toLowerCase']())+_0x0af3('0xaa')]=_0x1607cb[_0x0af3('0x67')]['ids'][_0x251c8e];socket[_0x0af3('0xab')](_0x0af3('0x3a')+_[_0x0af3('0xa5')](_0xf37f32['toLowerCase']())+_0x0af3('0xac'),_0x3c41ad);}return _0x3a50b8;})['then'](function(){if(_0xf37f32===_0x0af3('0xad')){return db['VoiceQueue']['findAll']({'where':{'id':_0x1607cb[_0x0af3('0x67')]['ids']||[]},'raw':!![],'attributes':['id',_0x0af3('0x42')]});}})['then'](function(_0x56357f){var _0xc806fe=_0x29e34d[_0x0af3('0x8c')]({'plain':!![]});var _0x109cda=[];if(_0xf37f32===_0x0af3('0xad')&&_0xc806fe[_0x0af3('0x41')]===_0x0af3('0x3b')&&_0xc806fe[_0x0af3('0x9f')]){for(var _0x18fe32=0x0;_0x18fe32<_0x56357f[_0x0af3('0x54')];_0x18fe32+=0x1){_0x109cda[_0x0af3('0xae')]({'membername':_0xc806fe[_0x0af3('0x42')],'UserId':_0xc806fe['id'],'queue_name':_0x56357f[_0x18fe32][_0x0af3('0x42')],'VoiceQueueId':_0x56357f[_0x18fe32]['id'],'interface':_[_0x0af3('0x71')](_0xc806fe[_0x0af3('0xaf')])?util[_0x0af3('0xb0')](_0x0af3('0xb1'),_0xc806fe[_0x0af3('0x42')]):_0xc806fe[_0x0af3('0xaf')],'paused':_0xc806fe['voicePause']||![],'penalty':_0x1607cb[_0x0af3('0x67')][_0x0af3('0xa8')]||0x0});}return BPromise[_0x0af3('0xb2')](_0x109cda,function(_0x814ae8){return db['UserVoiceQueueRt'][_0x0af3('0xb3')](_0x814ae8);});}return _0x29e34d;});}})['then'](respondWithStatusCode(_0x54cd31,null))[_0x0af3('0x2e')](handleError(_0x54cd31,null));};exports[_0x0af3('0xb4')]=function(_0x3c76d9,_0x2d3576,_0x3eb9dc){var _0x1e86d0;return db[_0x0af3('0x47')]['find']({'where':{'id':_0x3c76d9[_0x0af3('0x68')]['id']},'attributes':['id',_0x0af3('0x42'),_0x0af3('0x41')]})['then'](handleEntityNotFound(_0x2d3576,null))['then'](function(_0x15cd15){if(_0x15cd15){_0x1e86d0=_0x15cd15;if(!_0x3c76d9[_0x0af3('0x4f')][_0x0af3('0x9e')]||!utils['isValidChannel'](_0x3c76d9[_0x0af3('0x4f')][_0x0af3('0x9e')])){throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))]('Unknown\x20channel');}return _0x15cd15[_0x0af3('0xb5')+_['capitalize'](_0x3c76d9['query'][_0x0af3('0x9e')]['toLowerCase']())+_0x0af3('0xb6')](_0x3c76d9['query']['ids']);}})[_0x0af3('0x38')](function(_0x473230){for(var _0x598ac4=0x0;_0x598ac4<_0x3c76d9[_0x0af3('0x4f')][_0x0af3('0xa7')]['length'];_0x598ac4+=0x1){var _0x2d56cf={'UserId':_0x3c76d9['params']['id']};_0x2d56cf[_[_0x0af3('0xa5')](_0x3c76d9['query'][_0x0af3('0x9e')][_0x0af3('0xa6')]())+'QueueId']=_0x3c76d9[_0x0af3('0x4f')]['ids'][_0x598ac4];socket[_0x0af3('0xab')](_0x0af3('0x3a')+_[_0x0af3('0xa5')](_0x3c76d9[_0x0af3('0x4f')][_0x0af3('0x9e')][_0x0af3('0xa6')]())+'Queue:remove',_0x2d56cf);}return _0x473230;})['then'](function(){if(_0x3c76d9['query'][_0x0af3('0x9e')]==='voice'){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x3c76d9['params']['id'],'VoiceQueueId':_0x3c76d9[_0x0af3('0x4f')]['ids']},'individualHooks':!![]})[_0x0af3('0x38')](function(){return _0x1e86d0;});}return _0x1e86d0;})[_0x0af3('0x38')](respondWithStatusCode(_0x2d3576,null))[_0x0af3('0x2e')](handleError(_0x2d3576,null));};exports['addAvatar']=function(_0x587c6c,_0x2dd743,_0x31a442){_0x587c6c[_0x0af3('0x67')][_0x0af3('0xb7')]=_0x587c6c[_0x0af3('0xb8')]['filename'];return db[_0x0af3('0x47')][_0x0af3('0x65')]({'where':{'id':_0x587c6c[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x2dd743,null))['then'](saveUpdates(_0x587c6c[_0x0af3('0x67')],null))[_0x0af3('0x38')](respondWithResult(_0x2dd743,null))['catch'](handleError(_0x2dd743,null));};exports[_0x0af3('0xb9')]=function(_0x5bde16,_0x5aef6e,_0x33772e){var _0x2cf59a=path[_0x0af3('0xba')](config[_0x0af3('0xbb')],_0x0af3('0xbc'));return db[_0x0af3('0x47')]['find']({'where':{'id':_0x5bde16[_0x0af3('0x68')]['id']},'attributes':['id',_0x0af3('0xb7')],'raw':!![]})[_0x0af3('0x38')](handleEntityNotFound(_0x5aef6e,null))[_0x0af3('0x38')](function(_0x2bd77a){if(_0x2bd77a){if(_[_0x0af3('0x71')](_0x2bd77a[_0x0af3('0xb7')])){return _0x5aef6e[_0x0af3('0xbd')](_0x2cf59a);}else{if(!fs['existsSync'](path[_0x0af3('0xba')](config[_0x0af3('0xbb')],'server/files/images/',_0x2bd77a[_0x0af3('0xb7')]))){return _0x5aef6e[_0x0af3('0xbd')](_0x2cf59a);}return _0x5aef6e[_0x0af3('0xbd')](path[_0x0af3('0xba')](config[_0x0af3('0xbb')],_0x0af3('0xbe'),_0x2bd77a[_0x0af3('0xb7')]));}}})[_0x0af3('0x2e')](handleError(_0x5aef6e,null));};exports[_0x0af3('0xbf')]=function(_0x3718b4,_0x1be3e4,_0x359fef){var _0x3d3a97={};var _0x1bae92={};var _0x3492e5;var _0x3db448;return db[_0x0af3('0x47')][_0x0af3('0x94')]({'where':{'id':_0x3718b4[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x1be3e4,null))[_0x0af3('0x38')](function(_0x76dea1){if(_0x76dea1){_0x3492e5=_0x76dea1;_0x1bae92['model']=_[_0x0af3('0x50')](db[_0x0af3('0xc0')][_0x0af3('0x48')]);_0x1bae92[_0x0af3('0x4f')]=_[_0x0af3('0x50')](_0x3718b4['query']);_0x1bae92[_0x0af3('0x58')]=_['intersection'](_0x1bae92[_0x0af3('0x4c')],_0x1bae92[_0x0af3('0x4f')]);_0x3d3a97[_0x0af3('0x52')]=_['intersection'](_0x1bae92[_0x0af3('0x4c')],qs[_0x0af3('0x53')](_0x3718b4['query'][_0x0af3('0x53')]));_0x3d3a97[_0x0af3('0x52')]=_0x3d3a97[_0x0af3('0x52')][_0x0af3('0x54')]?_0x3d3a97[_0x0af3('0x52')]:_0x1bae92[_0x0af3('0x4c')];_0x3d3a97[_0x0af3('0x56')]=qs[_0x0af3('0xc1')](_0x3718b4[_0x0af3('0x4f')][_0x0af3('0xc1')]);_0x3d3a97[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_['pick'](_0x3718b4[_0x0af3('0x4f')],_0x1bae92['filters']));if(_0x3718b4[_0x0af3('0x4f')]['filter']){_0x3d3a97[_0x0af3('0x57')]=_['merge'](_0x3d3a97[_0x0af3('0x57')],{'$or':_[_0x0af3('0x3f')](_0x3d3a97[_0x0af3('0x52')],function(_0x23d2ca){var _0x55e9ea={};_0x55e9ea[_0x23d2ca]={'$like':'%'+_0x3718b4[_0x0af3('0x4f')][_0x0af3('0x3d')]+'%'};return _0x55e9ea;})});}_0x3d3a97=_['merge']({},_0x3d3a97,_0x3718b4[_0x0af3('0x5e')]);return _0x3492e5['getContacts'](_0x3d3a97);}})[_0x0af3('0x38')](function(_0x1e2dcc){if(_0x1e2dcc){_0x3db448=_0x1e2dcc[_0x0af3('0x54')];if(_0x3718b4[_0x0af3('0x4f')]['hasOwnProperty'](_0x0af3('0x5f'))){_0x3d3a97['include']=[{'model':db[_0x0af3('0xc2')],'as':_0x0af3('0xc3'),'required':![]},{'model':db[_0x0af3('0xc4')],'as':_0x0af3('0xc5'),'attributes':['id',_0x0af3('0x42'),_0x0af3('0xc6')],'where':_0x3718b4[_0x0af3('0x4f')][_0x0af3('0xc7')]?{'id':_0x3718b4['query'][_0x0af3('0xc7')]}:undefined,'required':_0x3718b4['query'][_0x0af3('0xc7')]?!![]:![]}];}if(!_0x3718b4[_0x0af3('0x4f')]['hasOwnProperty'](_0x0af3('0x55'))){_0x3d3a97[_0x0af3('0x34')]=qs[_0x0af3('0x34')](_0x3718b4['query'][_0x0af3('0x34')]);_0x3d3a97[_0x0af3('0x33')]=qs[_0x0af3('0x33')](_0x3718b4[_0x0af3('0x4f')][_0x0af3('0x33')]);}return _0x3492e5[_0x0af3('0xbf')](_0x3d3a97);}})['then'](function(_0x5c2390){if(_0x5c2390){return _0x5c2390?{'count':_0x3db448,'rows':_0x5c2390}:null;}})[_0x0af3('0x38')](respondWithResult(_0x1be3e4,null))[_0x0af3('0x2e')](handleError(_0x1be3e4,null));};exports[_0x0af3('0xc8')]=function(_0x17be8e,_0x5bd0eb,_0xd364c){var _0x4ff05f;var _0x2f7875;var _0x26e440={};var _0x5f0a7a;return db['User'][_0x0af3('0x94')]({'where':{'id':_0x17be8e[_0x0af3('0x68')]['id']},'attributes':['id','name',_0x0af3('0x41')]})[_0x0af3('0x38')](handleEntityNotFound(_0x5bd0eb,null))[_0x0af3('0x38')](function(_0x24d7d4){if(!utils[_0x0af3('0xa2')](_0x17be8e[_0x0af3('0x4f')][_0x0af3('0x9e')])){throw new db[(_0x0af3('0x20'))][(_0x0af3('0x21'))](_0x0af3('0xa3'));}_0x4ff05f=_0x24d7d4;var _0x4c1536={};_0x4c1536[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_[_0x0af3('0xa5')](_0x17be8e[_0x0af3('0x4f')][_0x0af3('0x9e')])+'Queue'][_0x0af3('0x48')]);_0x4c1536[_0x0af3('0x4f')]=_[_0x0af3('0x50')](_0x17be8e['query']);_0x4c1536[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x4c1536['model'],_0x4c1536['query']);_0x26e440['attributes']=_[_0x0af3('0x51')](_0x4c1536['model'],qs[_0x0af3('0x53')](_0x17be8e[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x26e440[_0x0af3('0x52')]=_0x26e440[_0x0af3('0x52')][_0x0af3('0x54')]?_0x26e440['attributes']:_0x4c1536['model'];_0x26e440[_0x0af3('0x56')]=qs['sort'](_0x17be8e[_0x0af3('0x4f')][_0x0af3('0xc1')]);_0x26e440['where']=qs[_0x0af3('0x58')](_[_0x0af3('0xc9')](_0x17be8e[_0x0af3('0x4f')],_0x4c1536['filters']));if(_0x17be8e[_0x0af3('0x4f')]['filter']){_0x26e440[_0x0af3('0x57')]=_['merge'](_0x26e440['where'],{'$or':_['map'](_0x26e440[_0x0af3('0x52')],function(_0x13e8ca){var _0x3ec246={};_0x3ec246[_0x13e8ca]={'$like':'%'+_0x17be8e[_0x0af3('0x4f')][_0x0af3('0x3d')]+'%'};return _0x3ec246;})});}_0x26e440=_[_0x0af3('0x5d')]({},_0x26e440,_0x17be8e[_0x0af3('0x5e')]);switch(_0x4ff05f[_0x0af3('0x41')]){case'admin':return db[_['capitalize'](_0x17be8e[_0x0af3('0x4f')][_0x0af3('0x9e')])+_0x0af3('0xca')][_0x0af3('0x61')](_0x26e440);case _0x0af3('0x3a'):case _0x0af3('0x3b'):return _0x4ff05f[_0x0af3('0x8c')+_['capitalize'](_0x17be8e[_0x0af3('0x4f')][_0x0af3('0x9e')])+'Queues'](_0x26e440);default:throw new db[(_0x0af3('0x20'))]['ValidationError'](_0x0af3('0xcb'));}})['then'](function(_0x4838ac){_0x5f0a7a=_0x4838ac['length'];if(!_0x17be8e[_0x0af3('0x4f')][_0x0af3('0xcc')](_0x0af3('0x55'))){_0x26e440[_0x0af3('0x34')]=qs[_0x0af3('0x34')](_0x17be8e[_0x0af3('0x4f')][_0x0af3('0x34')]);_0x26e440['offset']=qs[_0x0af3('0x33')](_0x17be8e[_0x0af3('0x4f')][_0x0af3('0x33')]);}switch(_0x4ff05f[_0x0af3('0x41')]){case _0x0af3('0x6d'):return db[_[_0x0af3('0xa5')](_0x17be8e[_0x0af3('0x4f')]['channel'])+_0x0af3('0xca')]['findAll'](_0x26e440);case _0x0af3('0x3a'):case _0x0af3('0x3b'):return _0x4ff05f[_0x0af3('0x8c')+_[_0x0af3('0xa5')](_0x17be8e[_0x0af3('0x4f')][_0x0af3('0x9e')])+_0x0af3('0xb6')](_0x26e440);}})[_0x0af3('0x38')](function(_0x1b4ef9){return{'count':_0x5f0a7a,'rows':_0x1b4ef9};})['then'](respondWithResult(_0x5bd0eb,null))[_0x0af3('0x2e')](handleError(_0x5bd0eb,null));};exports['getVoiceQueuesRt']=function(_0x28aed0,_0xf252f7,_0x151947){var _0x13c513={};var _0x33dca8={};var _0x248b6a;var _0x25609b;return db[_0x0af3('0x47')][_0x0af3('0x94')]({'where':{'id':_0x28aed0['params']['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0xf252f7,null))[_0x0af3('0x38')](function(_0x11d915){if(_0x11d915){_0x248b6a=_0x11d915;_0x33dca8[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_0x0af3('0xcd')]['rawAttributes']);_0x33dca8[_0x0af3('0x4f')]=_[_0x0af3('0x50')](_0x28aed0[_0x0af3('0x4f')]);_0x33dca8[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x33dca8['model'],_0x33dca8[_0x0af3('0x4f')]);_0x13c513[_0x0af3('0x52')]=_['intersection'](_0x33dca8[_0x0af3('0x4c')],qs[_0x0af3('0x53')](_0x28aed0[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x13c513['attributes']=_0x13c513['attributes'][_0x0af3('0x54')]?_0x13c513[_0x0af3('0x52')]:_0x33dca8[_0x0af3('0x4c')];_0x13c513['order']=qs[_0x0af3('0xc1')](_0x28aed0['query']['sort']);_0x13c513[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_[_0x0af3('0xc9')](_0x28aed0[_0x0af3('0x4f')],_0x33dca8['filters']));if(_0x28aed0[_0x0af3('0x4f')]['filter']){_0x13c513[_0x0af3('0x57')]=_[_0x0af3('0x5d')](_0x13c513[_0x0af3('0x57')],{'$or':_['map'](_0x13c513[_0x0af3('0x52')],function(_0x3b06e0){var _0x28b497={};_0x28b497[_0x3b06e0]={'$like':'%'+_0x28aed0[_0x0af3('0x4f')]['filter']+'%'};return _0x28b497;})});}_0x13c513=_[_0x0af3('0x5d')]({},_0x13c513,_0x28aed0[_0x0af3('0x5e')]);return _0x248b6a[_0x0af3('0xce')](_0x13c513);}})[_0x0af3('0x38')](function(_0x4d9ce8){if(_0x4d9ce8){_0x25609b=_0x4d9ce8[_0x0af3('0x54')];if(!_0x28aed0[_0x0af3('0x4f')]['hasOwnProperty']('nolimit')){_0x13c513['limit']=qs[_0x0af3('0x34')](_0x28aed0[_0x0af3('0x4f')][_0x0af3('0x34')]);_0x13c513[_0x0af3('0x33')]=qs[_0x0af3('0x33')](_0x28aed0['query'][_0x0af3('0x33')]);}return _0x248b6a[_0x0af3('0xce')](_0x13c513);}})['then'](function(_0x28a79b){if(_0x28a79b){return _0x28a79b?{'count':_0x25609b,'rows':_0x28a79b}:null;}})[_0x0af3('0x38')](respondWithResult(_0xf252f7,null))[_0x0af3('0x2e')](handleError(_0xf252f7,null));};exports[_0x0af3('0xcf')]=function(_0x4a65b7,_0x436a63,_0x24e110){var _0xd38de6={};var _0x130f0c={};var _0x58afca;var _0x42d2de;return db[_0x0af3('0x47')]['findOne']({'where':{'id':_0x4a65b7[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x436a63,null))[_0x0af3('0x38')](function(_0x383fec){if(_0x383fec){_0x58afca=_0x383fec;_0x130f0c[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db['ChatGroup'][_0x0af3('0x48')]);_0x130f0c['query']=_['keys'](_0x4a65b7[_0x0af3('0x4f')]);_0x130f0c[_0x0af3('0x58')]=_['intersection'](_0x130f0c[_0x0af3('0x4c')],_0x130f0c[_0x0af3('0x4f')]);_0xd38de6[_0x0af3('0x52')]=_[_0x0af3('0x51')](_0x130f0c[_0x0af3('0x4c')],qs[_0x0af3('0x53')](_0x4a65b7[_0x0af3('0x4f')][_0x0af3('0x53')]));_0xd38de6[_0x0af3('0x52')]=_0xd38de6[_0x0af3('0x52')][_0x0af3('0x54')]?_0xd38de6['attributes']:_0x130f0c[_0x0af3('0x4c')];_0xd38de6[_0x0af3('0x56')]=qs[_0x0af3('0xc1')](_0x4a65b7[_0x0af3('0x4f')][_0x0af3('0xc1')]);_0xd38de6[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_['pick'](_0x4a65b7[_0x0af3('0x4f')],_0x130f0c['filters']));if(_0x4a65b7[_0x0af3('0x4f')][_0x0af3('0x3d')]){_0xd38de6[_0x0af3('0x57')]=_[_0x0af3('0x5d')](_0xd38de6['where'],{'$or':_[_0x0af3('0x3f')](_0xd38de6[_0x0af3('0x52')],function(_0x51c6ba){var _0xf65ce={};_0xf65ce[_0x51c6ba]={'$like':'%'+_0x4a65b7['query']['filter']+'%'};return _0xf65ce;})});}_0xd38de6=_['merge']({},_0xd38de6,_0x4a65b7['options']);return _0x58afca[_0x0af3('0xcf')](_0xd38de6);}})[_0x0af3('0x38')](function(_0x1b3c81){if(_0x1b3c81){_0x42d2de=_0x1b3c81['length'];if(!_0x4a65b7[_0x0af3('0x4f')][_0x0af3('0xcc')](_0x0af3('0x55'))){_0xd38de6['limit']=qs[_0x0af3('0x34')](_0x4a65b7[_0x0af3('0x4f')][_0x0af3('0x34')]);_0xd38de6[_0x0af3('0x33')]=qs['offset'](_0x4a65b7[_0x0af3('0x4f')]['offset']);}return _0x58afca[_0x0af3('0xcf')](_0xd38de6);}})['then'](function(_0x106067){if(_0x106067){return _0x106067?{'count':_0x42d2de,'rows':_0x106067}:null;}})[_0x0af3('0x38')](respondWithResult(_0x436a63,null))[_0x0af3('0x2e')](handleError(_0x436a63,null));};exports['getRecordings']=function(_0x3e99ca,_0x40976c,_0x5a322c){var _0x38f6df={'raw':!![],'where':{}};var _0x2dd8b8={};var _0x363756={'count':0x0,'rows':[]};return db[_0x0af3('0x47')][_0x0af3('0x94')]({'where':{'id':_0x3e99ca[_0x0af3('0x68')]['id']}})['then'](handleEntityNotFound(_0x40976c,null))[_0x0af3('0x38')](function(_0x207e01){if(_0x207e01){_0x2dd8b8[_0x0af3('0x4c')]=_['keys'](db[_0x0af3('0xd0')][_0x0af3('0x48')]);_0x2dd8b8[_0x0af3('0x4f')]=_['keys'](_0x3e99ca[_0x0af3('0x4f')]);_0x2dd8b8['filters']=_['intersection'](_0x2dd8b8['model'],_0x2dd8b8[_0x0af3('0x4f')]);_0x38f6df[_0x0af3('0x52')]=_[_0x0af3('0x51')](_0x2dd8b8[_0x0af3('0x4c')],qs[_0x0af3('0x53')](_0x3e99ca['query']['fields']));_0x38f6df[_0x0af3('0x52')]=_0x38f6df['attributes'][_0x0af3('0x54')]?_0x38f6df[_0x0af3('0x52')]:_0x2dd8b8[_0x0af3('0x4c')];if(!_0x3e99ca[_0x0af3('0x4f')][_0x0af3('0xcc')](_0x0af3('0x55'))){_0x38f6df[_0x0af3('0x34')]=qs[_0x0af3('0x34')](_0x3e99ca['query'][_0x0af3('0x34')]);_0x38f6df[_0x0af3('0x33')]=qs[_0x0af3('0x33')](_0x3e99ca['query']['offset']);}_0x38f6df[_0x0af3('0x56')]=qs[_0x0af3('0xc1')](_0x3e99ca['query']['sort']);_0x38f6df[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_[_0x0af3('0xc9')](_0x3e99ca['query'],_0x2dd8b8['filters']));_0x38f6df[_0x0af3('0x57')][_0x0af3('0xd1')]=_0x207e01['id'];if(_0x3e99ca[_0x0af3('0x4f')][_0x0af3('0x3d')]){_0x38f6df[_0x0af3('0x57')]=_[_0x0af3('0x5d')](_0x38f6df[_0x0af3('0x57')],{'$or':_[_0x0af3('0x3f')](_0x38f6df[_0x0af3('0x52')],function(_0xa8af23){var _0x3c1d7e={};_0x3c1d7e[_0xa8af23]={'$like':'%'+_0x3e99ca[_0x0af3('0x4f')][_0x0af3('0x3d')]+'%'};return _0x3c1d7e;})});}_0x38f6df=_[_0x0af3('0x5d')]({},_0x38f6df,_0x3e99ca['options']);return db[_0x0af3('0xd0')][_0x0af3('0x32')]({'where':_0x38f6df[_0x0af3('0x57')]})['then'](function(_0x5e736a){_0x363756[_0x0af3('0x32')]=_0x5e736a;if(_0x3e99ca[_0x0af3('0x4f')][_0x0af3('0x5f')]){_0x38f6df['include']=[{'all':!![]}];}return db[_0x0af3('0xd0')][_0x0af3('0x61')](_0x38f6df);})['then'](function(_0x3bc018){_0x363756[_0x0af3('0x62')]=_0x3bc018;return _0x363756;});}})[_0x0af3('0x38')](respondWithFilteredResult(_0x40976c,_0x38f6df))['catch'](handleError(_0x40976c,null));};exports[_0x0af3('0xd2')]=function(_0x5d04b4,_0x1f1ef8,_0x156df1){var _0x530180={'raw':!![],'where':{}};var _0x4cef19={};var _0x4abaa5={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x5d04b4[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x1f1ef8,null))[_0x0af3('0x38')](function(_0x204567){if(_0x204567){_0x4cef19[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_0x0af3('0xd3')][_0x0af3('0x48')]);_0x4cef19[_0x0af3('0x4f')]=_[_0x0af3('0x50')](_0x5d04b4[_0x0af3('0x4f')]);_0x4cef19[_0x0af3('0x58')]=_['intersection'](_0x4cef19[_0x0af3('0x4c')],_0x4cef19['query']);_0x530180[_0x0af3('0x52')]=_[_0x0af3('0x51')](_0x4cef19['model'],qs[_0x0af3('0x53')](_0x5d04b4[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x530180['attributes']=_0x530180[_0x0af3('0x52')]['length']?_0x530180['attributes']:_0x4cef19['model'];if(!_0x5d04b4[_0x0af3('0x4f')]['hasOwnProperty'](_0x0af3('0x55'))){_0x530180[_0x0af3('0x34')]=qs[_0x0af3('0x34')](_0x5d04b4['query']['limit']);_0x530180['offset']=qs['offset'](_0x5d04b4['query'][_0x0af3('0x33')]);}_0x530180[_0x0af3('0x56')]=qs[_0x0af3('0xc1')](_0x5d04b4[_0x0af3('0x4f')][_0x0af3('0xc1')]);_0x530180[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_[_0x0af3('0xc9')](_0x5d04b4[_0x0af3('0x4f')],_0x4cef19[_0x0af3('0x58')]));_0x530180[_0x0af3('0x57')][_0x0af3('0xd1')]=_0x204567['id'];if(_0x5d04b4[_0x0af3('0x4f')][_0x0af3('0x3d')]){_0x530180['where']=_[_0x0af3('0x5d')](_0x530180[_0x0af3('0x57')],{'$or':_[_0x0af3('0x3f')](_0x530180[_0x0af3('0x52')],function(_0x42c54d){var _0x30bc3f={};_0x30bc3f[_0x42c54d]={'$like':'%'+_0x5d04b4[_0x0af3('0x4f')][_0x0af3('0x3d')]+'%'};return _0x30bc3f;})});}_0x530180=_[_0x0af3('0x5d')]({},_0x530180,_0x5d04b4[_0x0af3('0x5e')]);return db[_0x0af3('0xd3')][_0x0af3('0x32')]({'where':_0x530180[_0x0af3('0x57')]})['then'](function(_0x1744ae){_0x4abaa5[_0x0af3('0x32')]=_0x1744ae;if(_0x5d04b4[_0x0af3('0x4f')][_0x0af3('0x5f')]){_0x530180[_0x0af3('0x60')]=[{'all':!![]}];}return db[_0x0af3('0xd3')][_0x0af3('0x61')](_0x530180);})[_0x0af3('0x38')](function(_0x3e20f5){_0x4abaa5[_0x0af3('0x62')]=_0x3e20f5;return _0x4abaa5;});}})[_0x0af3('0x38')](respondWithFilteredResult(_0x1f1ef8,_0x530180))['catch'](handleError(_0x1f1ef8,null));};exports[_0x0af3('0xd4')]=function(_0xaf6125,_0x308d15,_0x489753){var _0x20a397={};var _0x1e66d2={};var _0x4b7eba;var _0xb60543;return db['User'][_0x0af3('0x94')]({'where':{'id':_0xaf6125[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x308d15,null))[_0x0af3('0x38')](function(_0x255af0){if(_0x255af0){_0x4b7eba=_0x255af0;_0x1e66d2[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_0x0af3('0xd5')][_0x0af3('0x48')]);_0x1e66d2[_0x0af3('0x4f')]=_['keys'](_0xaf6125['query']);_0x1e66d2[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x1e66d2[_0x0af3('0x4c')],_0x1e66d2[_0x0af3('0x4f')]);_0x20a397[_0x0af3('0x52')]=_[_0x0af3('0x51')](_0x1e66d2['model'],qs[_0x0af3('0x53')](_0xaf6125[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x20a397['attributes']=_0x20a397[_0x0af3('0x52')]['length']?_0x20a397[_0x0af3('0x52')]:_0x1e66d2[_0x0af3('0x4c')];_0x20a397['order']=qs[_0x0af3('0xc1')](_0xaf6125['query'][_0x0af3('0xc1')]);_0x20a397[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_[_0x0af3('0xc9')](_0xaf6125[_0x0af3('0x4f')],_0x1e66d2['filters']));if(_0xaf6125[_0x0af3('0x4f')][_0x0af3('0x3d')]){_0x20a397[_0x0af3('0x57')]=_[_0x0af3('0x5d')](_0x20a397[_0x0af3('0x57')],{'$or':_[_0x0af3('0x3f')](_0x20a397[_0x0af3('0x52')],function(_0x4c110f){var _0xb918af={};_0xb918af[_0x4c110f]={'$like':'%'+_0xaf6125['query']['filter']+'%'};return _0xb918af;})});}_0x20a397=_[_0x0af3('0x5d')]({},_0x20a397,_0xaf6125[_0x0af3('0x5e')]);return _0x4b7eba[_0x0af3('0xd4')](_0x20a397);}})[_0x0af3('0x38')](function(_0x2a7817){if(_0x2a7817){_0xb60543=_0x2a7817[_0x0af3('0x54')];if(!_0xaf6125[_0x0af3('0x4f')][_0x0af3('0xcc')](_0x0af3('0x55'))){_0x20a397['limit']=qs[_0x0af3('0x34')](_0xaf6125[_0x0af3('0x4f')]['limit']);_0x20a397[_0x0af3('0x33')]=qs[_0x0af3('0x33')](_0xaf6125[_0x0af3('0x4f')]['offset']);}return _0x4b7eba[_0x0af3('0xd4')](_0x20a397);}})[_0x0af3('0x38')](function(_0x543c16){if(_0x543c16){return _0x543c16?{'count':_0xb60543,'rows':_0x543c16}:null;}})[_0x0af3('0x38')](respondWithResult(_0x308d15,null))['catch'](handleError(_0x308d15,null));};exports[_0x0af3('0xd6')]=function(_0x325052,_0x460466,_0x1288df){var _0xf56e7d={};var _0x2736e5={};var _0x497a65;var _0x499143;return db[_0x0af3('0x47')][_0x0af3('0x94')]({'where':{'id':_0x325052[_0x0af3('0x68')]['id']}})['then'](handleEntityNotFound(_0x460466,null))[_0x0af3('0x38')](function(_0x437fbd){if(_0x437fbd){_0x497a65=_0x437fbd;_0x2736e5[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_0x0af3('0xd7')][_0x0af3('0x48')]);_0x2736e5[_0x0af3('0x4f')]=_[_0x0af3('0x50')](_0x325052['query']);_0x2736e5[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x2736e5['model'],_0x2736e5[_0x0af3('0x4f')]);_0xf56e7d['attributes']=_[_0x0af3('0x51')](_0x2736e5[_0x0af3('0x4c')],qs['fields'](_0x325052['query'][_0x0af3('0x53')]));_0xf56e7d['attributes']=_0xf56e7d[_0x0af3('0x52')]['length']?_0xf56e7d[_0x0af3('0x52')]:_0x2736e5[_0x0af3('0x4c')];_0xf56e7d[_0x0af3('0x56')]=qs[_0x0af3('0xc1')](_0x325052[_0x0af3('0x4f')][_0x0af3('0xc1')]);_0xf56e7d[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_[_0x0af3('0xc9')](_0x325052[_0x0af3('0x4f')],_0x2736e5[_0x0af3('0x58')]));if(_0x325052[_0x0af3('0x4f')][_0x0af3('0x3d')]){_0xf56e7d[_0x0af3('0x57')]=_[_0x0af3('0x5d')](_0xf56e7d['where'],{'$or':_[_0x0af3('0x3f')](_0xf56e7d[_0x0af3('0x52')],function(_0x576fe1){var _0xf35cd8={};_0xf35cd8[_0x576fe1]={'$like':'%'+_0x325052[_0x0af3('0x4f')][_0x0af3('0x3d')]+'%'};return _0xf35cd8;})});}_0xf56e7d=_[_0x0af3('0x5d')]({},_0xf56e7d,_0x325052[_0x0af3('0x5e')]);return _0x497a65[_0x0af3('0xd6')](_0xf56e7d);}})[_0x0af3('0x38')](function(_0x272c1a){if(_0x272c1a){_0x499143=_0x272c1a['length'];if(!_0x325052[_0x0af3('0x4f')][_0x0af3('0xcc')]('nolimit')){_0xf56e7d[_0x0af3('0x34')]=qs[_0x0af3('0x34')](_0x325052['query'][_0x0af3('0x34')]);_0xf56e7d[_0x0af3('0x33')]=qs[_0x0af3('0x33')](_0x325052[_0x0af3('0x4f')][_0x0af3('0x33')]);}return _0x497a65[_0x0af3('0xd6')](_0xf56e7d);}})[_0x0af3('0x38')](function(_0x1443b2){if(_0x1443b2){return _0x1443b2?{'count':_0x499143,'rows':_0x1443b2}:null;}})['then'](respondWithResult(_0x460466,null))[_0x0af3('0x2e')](handleError(_0x460466,null));};exports[_0x0af3('0xd8')]=function(_0x20c713,_0x4a72db,_0x5a1054){var _0x5ba79b={'raw':!![],'where':{}};var _0x5b7a7b={};var _0x1510d1={'count':0x0,'rows':[]};return db[_0x0af3('0x47')]['findOne']({'where':{'id':_0x20c713[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x4a72db,null))[_0x0af3('0x38')](function(_0x1883ce){if(_0x1883ce){_0x5b7a7b[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_0x0af3('0xd9')][_0x0af3('0x48')]);_0x5b7a7b['query']=_[_0x0af3('0x50')](_0x20c713[_0x0af3('0x4f')]);_0x5b7a7b[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x5b7a7b[_0x0af3('0x4c')],_0x5b7a7b[_0x0af3('0x4f')]);_0x5ba79b[_0x0af3('0x52')]=_['intersection'](_0x5b7a7b[_0x0af3('0x4c')],qs['fields'](_0x20c713[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x5ba79b['attributes']=_0x5ba79b[_0x0af3('0x52')]['length']?_0x5ba79b[_0x0af3('0x52')]:_0x5b7a7b['model'];if(!_0x20c713[_0x0af3('0x4f')][_0x0af3('0xcc')](_0x0af3('0x55'))){_0x5ba79b['limit']=qs[_0x0af3('0x34')](_0x20c713['query'][_0x0af3('0x34')]);_0x5ba79b['offset']=qs[_0x0af3('0x33')](_0x20c713[_0x0af3('0x4f')][_0x0af3('0x33')]);}_0x5ba79b['order']=qs[_0x0af3('0xc1')](_0x20c713[_0x0af3('0x4f')]['sort']);_0x5ba79b[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_[_0x0af3('0xc9')](_0x20c713[_0x0af3('0x4f')],_0x5b7a7b[_0x0af3('0x58')]));_0x5ba79b[_0x0af3('0x57')]['UserId']=_0x1883ce['id'];if(_0x20c713[_0x0af3('0x4f')][_0x0af3('0x3d')]){_0x5ba79b[_0x0af3('0x57')]=_['merge'](_0x5ba79b[_0x0af3('0x57')],{'$or':_['map'](_0x5ba79b['attributes'],function(_0x15ff9a){var _0x20172f={};_0x20172f[_0x15ff9a]={'$like':'%'+_0x20c713['query'][_0x0af3('0x3d')]+'%'};return _0x20172f;})});}_0x5ba79b=_[_0x0af3('0x5d')]({},_0x5ba79b,_0x20c713[_0x0af3('0x5e')]);return db[_0x0af3('0xd9')]['count']({'where':_0x5ba79b[_0x0af3('0x57')]})['then'](function(_0x51c269){_0x1510d1[_0x0af3('0x32')]=_0x51c269;if(_0x20c713[_0x0af3('0x4f')][_0x0af3('0x5f')]){_0x5ba79b[_0x0af3('0x60')]=[{'all':!![]}];}return db[_0x0af3('0xd9')][_0x0af3('0x61')](_0x5ba79b);})[_0x0af3('0x38')](function(_0x1c9595){_0x1510d1['rows']=_0x1c9595;return _0x1510d1;});}})[_0x0af3('0x38')](respondWithFilteredResult(_0x4a72db,_0x5ba79b))[_0x0af3('0x2e')](handleError(_0x4a72db,null));};exports[_0x0af3('0xda')]=function(_0x38846d,_0x3dab65,_0x84c4dc){var _0x224cad={};var _0x36f853={};var _0x1ab35a;var _0x367914;return db[_0x0af3('0x47')][_0x0af3('0x94')]({'where':{'id':_0x38846d['params']['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x3dab65,null))['then'](function(_0x37c413){if(_0x37c413){_0x1ab35a=_0x37c413;_0x36f853[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_0x0af3('0xdb')][_0x0af3('0x48')]);_0x36f853[_0x0af3('0x4f')]=_['keys'](_0x38846d['query']);_0x36f853[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x36f853[_0x0af3('0x4c')],_0x36f853[_0x0af3('0x4f')]);_0x224cad[_0x0af3('0x52')]=_[_0x0af3('0x51')](_0x36f853[_0x0af3('0x4c')],qs[_0x0af3('0x53')](_0x38846d[_0x0af3('0x4f')]['fields']));_0x224cad[_0x0af3('0x52')]=_0x224cad[_0x0af3('0x52')][_0x0af3('0x54')]?_0x224cad['attributes']:_0x36f853[_0x0af3('0x4c')];_0x224cad[_0x0af3('0x56')]=qs[_0x0af3('0xc1')](_0x38846d[_0x0af3('0x4f')]['sort']);_0x224cad[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_['pick'](_0x38846d[_0x0af3('0x4f')],_0x36f853['filters']));if(_0x38846d[_0x0af3('0x4f')][_0x0af3('0x3d')]){_0x224cad[_0x0af3('0x57')]=_[_0x0af3('0x5d')](_0x224cad[_0x0af3('0x57')],{'$or':_[_0x0af3('0x3f')](_0x224cad[_0x0af3('0x52')],function(_0x1869db){var _0x5412b4={};_0x5412b4[_0x1869db]={'$like':'%'+_0x38846d[_0x0af3('0x4f')][_0x0af3('0x3d')]+'%'};return _0x5412b4;})});}_0x224cad=_[_0x0af3('0x5d')]({},_0x224cad,_0x38846d[_0x0af3('0x5e')]);return _0x1ab35a[_0x0af3('0xda')](_0x224cad);}})['then'](function(_0x4e4ae4){if(_0x4e4ae4){_0x367914=_0x4e4ae4[_0x0af3('0x54')];if(!_0x38846d[_0x0af3('0x4f')][_0x0af3('0xcc')](_0x0af3('0x55'))){_0x224cad['limit']=qs[_0x0af3('0x34')](_0x38846d[_0x0af3('0x4f')][_0x0af3('0x34')]);_0x224cad[_0x0af3('0x33')]=qs['offset'](_0x38846d[_0x0af3('0x4f')]['offset']);}return _0x1ab35a[_0x0af3('0xda')](_0x224cad);}})['then'](function(_0xc8540c){if(_0xc8540c){return _0xc8540c?{'count':_0x367914,'rows':_0xc8540c}:null;}})[_0x0af3('0x38')](respondWithResult(_0x3dab65,null))[_0x0af3('0x2e')](handleError(_0x3dab65,null));};exports[_0x0af3('0xdc')]=function(_0x862d6c,_0x2029d8,_0x370fae){var _0x262148={};var _0x288bdd={};var _0x399779;var _0x433ead;return db[_0x0af3('0x47')]['findOne']({'where':{'id':_0x862d6c[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x2029d8,null))[_0x0af3('0x38')](function(_0xec1f3b){if(_0xec1f3b){_0x399779=_0xec1f3b;_0x288bdd[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_0x0af3('0xdd')]['rawAttributes']);_0x288bdd[_0x0af3('0x4f')]=_[_0x0af3('0x50')](_0x862d6c[_0x0af3('0x4f')]);_0x288bdd[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x288bdd[_0x0af3('0x4c')],_0x288bdd['query']);_0x262148[_0x0af3('0x52')]=_[_0x0af3('0x51')](_0x288bdd[_0x0af3('0x4c')],qs[_0x0af3('0x53')](_0x862d6c[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x262148['attributes']=_0x262148['attributes']['length']?_0x262148[_0x0af3('0x52')]:_0x288bdd['model'];_0x262148[_0x0af3('0x56')]=qs[_0x0af3('0xc1')](_0x862d6c['query']['sort']);_0x262148[_0x0af3('0x57')]=qs['filters'](_[_0x0af3('0xc9')](_0x862d6c['query'],_0x288bdd[_0x0af3('0x58')]));if(_0x862d6c[_0x0af3('0x4f')]['filter']){_0x262148['where']=_[_0x0af3('0x5d')](_0x262148[_0x0af3('0x57')],{'$or':_['map'](_0x262148['attributes'],function(_0x2a992f){var _0x287452={};_0x287452[_0x2a992f]={'$like':'%'+_0x862d6c['query'][_0x0af3('0x3d')]+'%'};return _0x287452;})});}_0x262148=_[_0x0af3('0x5d')]({},_0x262148,_0x862d6c['options']);return _0x399779[_0x0af3('0xdc')](_0x262148);}})[_0x0af3('0x38')](function(_0x15e440){if(_0x15e440){_0x433ead=_0x15e440[_0x0af3('0x54')];if(!_0x862d6c[_0x0af3('0x4f')][_0x0af3('0xcc')](_0x0af3('0x55'))){_0x262148['limit']=qs[_0x0af3('0x34')](_0x862d6c['query'][_0x0af3('0x34')]);_0x262148['offset']=qs[_0x0af3('0x33')](_0x862d6c[_0x0af3('0x4f')][_0x0af3('0x33')]);}return _0x399779[_0x0af3('0xdc')](_0x262148);}})[_0x0af3('0x38')](function(_0x5e10e2){if(_0x5e10e2){return _0x5e10e2?{'count':_0x433ead,'rows':_0x5e10e2}:null;}})['then'](respondWithResult(_0x2029d8,null))[_0x0af3('0x2e')](handleError(_0x2029d8,null));};exports[_0x0af3('0xde')]=function(_0xad6c57,_0x207dbd,_0x3d0267){var _0x30d6b1={};var _0x2e099f={};var _0x22f9de;var _0x7380cd;return db[_0x0af3('0x47')]['findOne']({'where':{'id':_0xad6c57[_0x0af3('0x68')]['id']}})['then'](handleEntityNotFound(_0x207dbd,null))['then'](function(_0x4080b5){if(_0x4080b5){_0x22f9de=_0x4080b5;_0x2e099f['model']=_[_0x0af3('0x50')](db[_0x0af3('0xdf')][_0x0af3('0x48')]);_0x2e099f['query']=_[_0x0af3('0x50')](_0xad6c57[_0x0af3('0x4f')]);_0x2e099f['filters']=_[_0x0af3('0x51')](_0x2e099f[_0x0af3('0x4c')],_0x2e099f[_0x0af3('0x4f')]);_0x30d6b1[_0x0af3('0x52')]=_['intersection'](_0x2e099f[_0x0af3('0x4c')],qs['fields'](_0xad6c57['query']['fields']));_0x30d6b1[_0x0af3('0x52')]=_0x30d6b1[_0x0af3('0x52')][_0x0af3('0x54')]?_0x30d6b1[_0x0af3('0x52')]:_0x2e099f[_0x0af3('0x4c')];_0x30d6b1[_0x0af3('0x56')]=qs['sort'](_0xad6c57[_0x0af3('0x4f')][_0x0af3('0xc1')]);_0x30d6b1[_0x0af3('0x57')]=qs['filters'](_[_0x0af3('0xc9')](_0xad6c57['query'],_0x2e099f[_0x0af3('0x58')]));if(_0xad6c57[_0x0af3('0x4f')]['filter']){_0x30d6b1['where']=_[_0x0af3('0x5d')](_0x30d6b1['where'],{'$or':_['map'](_0x30d6b1['attributes'],function(_0x2bc07a){var _0x365f2c={};_0x365f2c[_0x2bc07a]={'$like':'%'+_0xad6c57['query']['filter']+'%'};return _0x365f2c;})});}_0x30d6b1=_[_0x0af3('0x5d')]({},_0x30d6b1,_0xad6c57[_0x0af3('0x5e')]);return _0x22f9de['getWhatsappInteractions'](_0x30d6b1);}})[_0x0af3('0x38')](function(_0x2b011b){if(_0x2b011b){_0x7380cd=_0x2b011b[_0x0af3('0x54')];if(!_0xad6c57['query']['hasOwnProperty']('nolimit')){_0x30d6b1['limit']=qs['limit'](_0xad6c57[_0x0af3('0x4f')][_0x0af3('0x34')]);_0x30d6b1['offset']=qs['offset'](_0xad6c57[_0x0af3('0x4f')][_0x0af3('0x33')]);}return _0x22f9de[_0x0af3('0xde')](_0x30d6b1);}})[_0x0af3('0x38')](function(_0x55bc5b){if(_0x55bc5b){return _0x55bc5b?{'count':_0x7380cd,'rows':_0x55bc5b}:null;}})[_0x0af3('0x38')](respondWithResult(_0x207dbd,null))[_0x0af3('0x2e')](handleError(_0x207dbd,null));};exports['login']=function(_0x2056ea,_0xb62e95,_0x1f3e21){var _0x2ecf2e;var _0x356c52;var _0x4ffff0;var _0x6793cb=!_[_0x0af3('0x71')](_0x2056ea[_0x0af3('0x68')]['id'])?_0x2056ea['params']['id']:!_[_0x0af3('0x71')](_0x2056ea[_0x0af3('0x3a')]['id'])?_0x2056ea[_0x0af3('0x3a')]['id']:null;return db[_0x0af3('0x47')]['find']({'where':{'id':_0x6793cb,'role':{'$or':['admin',_0x0af3('0x3a'),_0x0af3('0x3b')]}},'attributes':['id',_0x0af3('0x42'),_0x0af3('0xe0'),_0x0af3('0xe1'),_0x0af3('0x41'),'internal','loginInPause']})[_0x0af3('0x38')](function(_0x3f562b){if(_0x3f562b){if(_0x3f562b[_0x0af3('0x41')]===_0x0af3('0x3b')){_0x2ecf2e=_0x3f562b;if(_0x2056ea[_0x0af3('0x67')][_0x0af3('0xaf')]){_0x4ffff0=util['format'](_0x0af3('0xe2'),_0x2ecf2e[_0x2056ea[_0x0af3('0x67')][_0x0af3('0xaf')]]);}else if(_0x2056ea[_0x0af3('0x67')][_0x0af3('0xe3')]){_0x4ffff0=util[_0x0af3('0xb0')](_0x0af3('0xb1'),_0x2056ea[_0x0af3('0x67')][_0x0af3('0xe3')]);}else{_0x4ffff0=util[_0x0af3('0xb0')](_0x0af3('0xb1'),_0x2ecf2e['name']);}socket['to'](util['format'](_0x0af3('0xe4'),_0x2ecf2e[_0x0af3('0x42')]))[_0x0af3('0xab')](_0x0af3('0xe5'),{'ip':_0x2056ea[_0x0af3('0xe6')]['x-forwarded-for']||_0x2056ea[_0x0af3('0xe7')]['remoteAddress']||_0x2056ea[_0x0af3('0xe8')]['remoteAddress']||_0x2056ea[_0x0af3('0xe7')]['socket'][_0x0af3('0xe9')]});return db['UserVoiceQueueRt'][_0x0af3('0x39')]({'where':{'membername':_0x2ecf2e[_0x0af3('0x42')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x0af3('0x21'))](_0x0af3('0xea'));}})[_0x0af3('0x38')](function(){if(_0x2ecf2e){return _0x2ecf2e['getVoiceQueues']({'raw':!![]});}})[_0x0af3('0x38')](function(_0x2b694c){if(_0x2ecf2e){var _0x59eb36=[];if(_0x2b694c){_0x356c52=_0x2b694c;if(_0x356c52[_0x0af3('0x54')]){for(var _0x1abbe2=0x0;_0x1abbe2<_0x356c52[_0x0af3('0x54')];_0x1abbe2++){_0x59eb36[_0x0af3('0xae')]({'membername':_0x2ecf2e[_0x0af3('0x42')],'UserId':_0x2ecf2e['id'],'queue_name':_0x356c52[_0x1abbe2][_0x0af3('0x42')],'VoiceQueueId':_0x356c52[_0x1abbe2]['id'],'interface':_0x4ffff0,'paused':_0x2ecf2e['loginInPause']||![],'penalty':_0x356c52[_0x1abbe2][_0x0af3('0xeb')]||0x0});}return BPromise[_0x0af3('0xb2')](_0x59eb36,function(_0x515a5c){return db[_0x0af3('0xcd')][_0x0af3('0xb3')](_0x515a5c);});}}}})[_0x0af3('0x38')](function(){if(_0x2ecf2e){return db[_0x0af3('0xec')][_0x0af3('0x61')]({'where':{'membername':_0x2ecf2e[_0x0af3('0x42')],'exitAt':null}});}})['then'](function(_0x46ecc5){if(_0x2ecf2e){var _0x590aa0=[];_0x46ecc5['forEach'](function(_0x280b61){_0x590aa0[_0x0af3('0xae')](_0x280b61['update']({'exitAt':moment()[_0x0af3('0xb0')](_0x0af3('0xed'))}));});return BPromise[_0x0af3('0xee')](_0x590aa0);}})[_0x0af3('0x38')](function(){if(_0x2ecf2e){var _0xd4fb42=[];var _0x1942ee=[];var _0x56c4c2=utils[_0x0af3('0xef')]();var _0x23b41={'membername':_0x2ecf2e['name'],'interface':_0x4ffff0,'enterAt':moment()['format'](_0x0af3('0xed')),'role':_0x2ecf2e['role'],'internal':_0x2ecf2e[_0x0af3('0x74')]};_0x56c4c2[_0x0af3('0xf0')](function(_0x2ed523){_0xd4fb42[_0x0af3('0xae')](_[_0x0af3('0x5d')]({'channel':_0x2ed523,'type':'LOGIN','data1':_0x2056ea['body'][_0x0af3('0xf1')],'data2':_0x4ffff0},_0x23b41));if(_0x2ecf2e[_0x0af3('0xa0')]){_0x1942ee[_0x0af3('0xae')](_[_0x0af3('0x5d')]({'channel':_0x2ed523,'type':'PAUSE','data1':_0x0af3('0xf2')},_0x23b41));}});return db['MemberReport'][_0x0af3('0x66')](_0xd4fb42['concat'](_0x1942ee),{'individualHooks':!![]});}})['then'](function(){if(_0x2ecf2e){return _0x2ecf2e[_0x0af3('0x37')]({'online':!![],'lastLoginAt':moment()[_0x0af3('0xb0')](_0x0af3('0xed')),'voicePause':_0x2ecf2e[_0x0af3('0xa0')]||![],'mailPause':_0x2ecf2e[_0x0af3('0xa0')]||![],'chatPause':_0x2ecf2e[_0x0af3('0xa0')]||![],'faxPause':_0x2ecf2e[_0x0af3('0xa0')]||![],'smsPause':_0x2ecf2e[_0x0af3('0xa0')]||![],'openchannelPause':_0x2ecf2e[_0x0af3('0xa0')]||![],'whatsappPause':_0x2ecf2e['loginInPause']||![],'pauseType':_0x2ecf2e[_0x0af3('0xa0')]?'LOGININPAUSE':null,'interface':_0x4ffff0,'lastPauseAt':moment()[_0x0af3('0xb0')](_0x0af3('0xed'))});}})[_0x0af3('0x38')](function(_0x3d3877){if(_0x2056ea[_0x0af3('0xf3')]){return _0x1f3e21();}else{return BPromise[_0x0af3('0xf4')](_0x3d3877)['then'](respondWithResult(_0xb62e95,null));}})[_0x0af3('0x2e')](handleError(_0xb62e95,null));};exports[_0x0af3('0xf5')]=function(_0x470fcc,_0x24c7b3,_0x3df766){var _0x25e549;return db[_0x0af3('0x47')][_0x0af3('0x65')]({'where':{'id':_0x470fcc[_0x0af3('0x68')]['id'],'role':_0x0af3('0x3b')},'attributes':['id',_0x0af3('0x42'),_0x0af3('0x41')]})[_0x0af3('0x38')](handleEntityNotFound(_0x24c7b3,null))[_0x0af3('0x38')](function(_0x3c1297){if(_0x3c1297){_0x25e549=_0x3c1297;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x25e549[_0x0af3('0x42')]},'individualHooks':!![]});}})[_0x0af3('0x38')](function(){return db[_0x0af3('0xec')]['findAll']({'where':{'membername':_0x25e549[_0x0af3('0x42')],'exitAt':null}});})[_0x0af3('0x38')](function(_0x181221){var _0x1a8642=[];_0x181221[_0x0af3('0xf0')](function(_0x27f2b1){_0x1a8642[_0x0af3('0xae')](_0x27f2b1['update']({'exitAt':moment()['format'](_0x0af3('0xed'))}));});return BPromise[_0x0af3('0xee')](_0x1a8642);})[_0x0af3('0x38')](function(){return _0x25e549[_0x0af3('0x37')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x0af3('0x38')](respondWithResult(_0x24c7b3,null))[_0x0af3('0x2e')](handleError(_0x24c7b3,null));};exports[_0x0af3('0xf6')]=function(_0x575436,_0x14bef3,_0x1e5ffb){var _0x18e349;return db[_0x0af3('0xcd')][_0x0af3('0x37')]({'paused':0x1},{'where':{'UserId':_0x575436['params']['id']},'individualHooks':!![]})[_0x0af3('0x38')](function(){return db[_0x0af3('0x47')]['find']({'where':{'id':_0x575436[_0x0af3('0x68')]['id'],'role':_0x0af3('0x3b')},'attributes':['id',_0x0af3('0x42'),_0x0af3('0x41'),_0x0af3('0x74'),_0x0af3('0xaf')]});})[_0x0af3('0x38')](handleEntityNotFound(_0x14bef3,null))[_0x0af3('0x38')](function(_0x128b71){if(_0x128b71){_0x18e349=_0x128b71;return respondWithRpcPromise(_0x0af3('0xf7'),'pause',{'id':_0x18e349['id'],'name':_0x18e349[_0x0af3('0x42')],'pause':!![]});}})[_0x0af3('0x38')](function(){if(_0x18e349){return db[_0x0af3('0xec')]['findAll']({'where':{'membername':_0x18e349['name'],'type':'PAUSE','exitAt':null}});}})[_0x0af3('0x38')](function(_0x4abc70){if(_0x4abc70[_0x0af3('0x54')]){var _0x376765=moment()[_0x0af3('0xb0')](_0x0af3('0xed'));for(var _0x629b91=0x0,_0x2c6bdf=_0x4abc70['length'];_0x629b91<_0x2c6bdf;_0x629b91++){_0x4abc70[_0x629b91][_0x0af3('0xf8')]({'exitAt':_0x376765});}}})[_0x0af3('0x38')](function(){var _0x5789ae=[];var _0x10f8f7=utils['getChannels']();_0x10f8f7['forEach'](function(_0x297fdb){_0x5789ae['push']({'channel':_0x297fdb,'membername':_0x18e349['name'],'interface':_[_0x0af3('0x71')](_0x18e349[_0x0af3('0xaf')])?util[_0x0af3('0xb0')](_0x0af3('0xb1'),_0x18e349['name']):_0x18e349[_0x0af3('0xaf')],'type':_0x0af3('0xf9'),'enterAt':moment()[_0x0af3('0xb0')](_0x0af3('0xed')),'data1':_0x575436[_0x0af3('0x67')][_0x0af3('0x4a')]||_0x0af3('0xfa'),'role':_0x18e349['role'],'internal':_0x18e349[_0x0af3('0x74')]});});return db[_0x0af3('0xec')][_0x0af3('0x66')](_0x5789ae,{'individualHooks':!![]});})[_0x0af3('0x38')](function(){return _0x18e349[_0x0af3('0x37')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x575436['body'][_0x0af3('0x4a')]||_0x0af3('0xfa'),'lastPauseAt':moment()['format'](_0x0af3('0xed'))});})[_0x0af3('0x38')](respondWithResult(_0x14bef3,null))[_0x0af3('0x2e')](handleError(_0x14bef3,null));};exports[_0x0af3('0xfb')]=function(_0x2ac43d,_0x553464,_0x39c386){var _0x922378;return db[_0x0af3('0x47')][_0x0af3('0x65')]({'where':{'id':_0x2ac43d[_0x0af3('0x68')]['id']},'attributes':['id','name',_0x0af3('0x41'),'voicePause',_0x0af3('0xfc'),_0x0af3('0xfd'),_0x0af3('0xfe'),_0x0af3('0xff'),_0x0af3('0x100'),_0x0af3('0x101'),_0x0af3('0x102'),_0x0af3('0x103')]})[_0x0af3('0x38')](handleEntityNotFound(_0x553464,null))['then'](function(_0x5f3865){if(_0x5f3865){_0x922378=_0x5f3865;if(_0x2ac43d[_0x0af3('0x67')][_0x0af3('0x9e')]&&!utils[_0x0af3('0xa2')](_0x2ac43d[_0x0af3('0x67')][_0x0af3('0x9e')])){throw new db[(_0x0af3('0x20'))]['ValidationError']('Unknown\x20channel');}switch(_0x2ac43d[_0x0af3('0x67')][_0x0af3('0x9e')]){case _0x0af3('0xad'):return respondWithRpcPromise(_0x0af3('0xf7'),_0x0af3('0xfb'),{'id':_0x922378['id'],'name':_0x922378[_0x0af3('0x42')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt'][_0x0af3('0x37')]({'paused':0x0},{'where':{'UserId':_0x922378['id']},'individualHooks':!![]});})[_0x0af3('0x38')](function(){return db[_0x0af3('0xec')]['find']({'where':{'channel':_0x2ac43d[_0x0af3('0x67')][_0x0af3('0x9e')],'membername':_0x922378['name'],'type':_0x0af3('0xf9'),'exitAt':null}});})[_0x0af3('0x38')](function(_0x4ad8ea){if(_0x4ad8ea){return _0x4ad8ea[_0x0af3('0x37')]({'exitAt':moment()[_0x0af3('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x0af3('0x104')},{'individualHooks':!![]});}return null;})[_0x0af3('0x38')](function(){return _0x922378[_0x0af3('0x37')]({'voicePause':![]});});case _0x0af3('0x105'):case _0x0af3('0x106'):case _0x0af3('0x107'):case _0x0af3('0x108'):case _0x0af3('0x109'):case'openchannel':return db[_0x0af3('0xec')]['find']({'where':{'channel':_0x2ac43d['body']['channel'],'membername':_0x922378[_0x0af3('0x42')],'type':'PAUSE','exitAt':null}})[_0x0af3('0x38')](function(_0x25156c){if(_0x25156c){return _0x25156c['update']({'exitAt':moment()[_0x0af3('0xb0')](_0x0af3('0xed')),'data2':_0x0af3('0x104')},{'individualHooks':!![]});}return null;})[_0x0af3('0x38')](function(){var _0xb0d323={};_[_0x0af3('0x35')](_0xb0d323,util['format']('%s%s',_0x2ac43d[_0x0af3('0x67')][_0x0af3('0x9e')],_0x0af3('0x10a')),![]);return _0x922378[_0x0af3('0x37')](_0xb0d323);});default:return respondWithRpcPromise(_0x0af3('0xf7'),_0x0af3('0xfb'),{'id':_0x922378['id'],'name':_0x922378[_0x0af3('0x42')],'pause':![]})['then'](function(){return db[_0x0af3('0xcd')][_0x0af3('0x37')]({'paused':0x0},{'where':{'UserId':_0x922378['id']}});})[_0x0af3('0x38')](function(){return db['MemberReport'][_0x0af3('0x61')]({'where':{'membername':_0x922378['name'],'type':_0x0af3('0xf9'),'exitAt':null}});})[_0x0af3('0x38')](function(_0x169a40){var _0x4e0bb6=[];_0x169a40[_0x0af3('0xf0')](function(_0x47409){_0x4e0bb6['push'](_0x47409['update']({'exitAt':moment()['format'](_0x0af3('0xed')),'data2':_0x0af3('0x104')}));});return BPromise['all'](_0x4e0bb6);})[_0x0af3('0x38')](function(){return _0x922378[_0x0af3('0x37')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x0af3('0x38')](respondWithResult(_0x553464,null))['catch'](handleError(_0x553464,null));};exports[_0x0af3('0x10b')]=function(_0x43ad61,_0x5ec30d,_0x26730b){var _0x351ca7={};var _0x224e7e={};var _0x5d8d9b;var _0x549254;return db[_0x0af3('0x47')][_0x0af3('0x94')]({'where':{'id':_0x43ad61['params']['id']}})['then'](handleEntityNotFound(_0x5ec30d,null))[_0x0af3('0x38')](function(_0x1f080f){if(_0x1f080f){_0x5d8d9b=_0x1f080f;_0x224e7e[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_0x0af3('0x10c')]['rawAttributes']);_0x224e7e['query']=_['keys'](_0x43ad61['query']);_0x224e7e[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x224e7e['model'],_0x224e7e[_0x0af3('0x4f')]);_0x351ca7[_0x0af3('0x52')]=_[_0x0af3('0x51')](_0x224e7e[_0x0af3('0x4c')],qs[_0x0af3('0x53')](_0x43ad61[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x351ca7['attributes']=_0x351ca7['attributes']['length']?_0x351ca7['attributes']:_0x224e7e[_0x0af3('0x4c')];_0x351ca7['order']=qs[_0x0af3('0xc1')](_0x43ad61['query']['sort']);_0x351ca7[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_['pick'](_0x43ad61[_0x0af3('0x4f')],_0x224e7e[_0x0af3('0x58')]));if(_0x43ad61[_0x0af3('0x4f')]['filter']){_0x351ca7[_0x0af3('0x57')]=_[_0x0af3('0x5d')](_0x351ca7[_0x0af3('0x57')],{'$or':_[_0x0af3('0x3f')](_0x351ca7['attributes'],function(_0x1c6a82){var _0x3e4e39={};_0x3e4e39[_0x1c6a82]={'$like':'%'+_0x43ad61[_0x0af3('0x4f')][_0x0af3('0x3d')]+'%'};return _0x3e4e39;})});}_0x351ca7=_[_0x0af3('0x5d')]({},_0x351ca7,_0x43ad61[_0x0af3('0x5e')]);return _0x5d8d9b[_0x0af3('0x10b')](_0x351ca7);}})[_0x0af3('0x38')](function(_0x42667c){if(_0x42667c){_0x549254=_0x42667c[_0x0af3('0x54')];if(!_0x43ad61['query'][_0x0af3('0xcc')](_0x0af3('0x55'))){_0x351ca7['limit']=qs[_0x0af3('0x34')](_0x43ad61[_0x0af3('0x4f')][_0x0af3('0x34')]);_0x351ca7['offset']=qs[_0x0af3('0x33')](_0x43ad61['query']['offset']);}return _0x5d8d9b['getTeams'](_0x351ca7);}})[_0x0af3('0x38')](function(_0x56c587){if(_0x56c587){return _0x56c587?{'count':_0x549254,'rows':_0x56c587}:null;}})[_0x0af3('0x38')](respondWithResult(_0x5ec30d,null))[_0x0af3('0x2e')](handleError(_0x5ec30d,null));};exports[_0x0af3('0x10d')]=function(_0x5245e4,_0x491b07){return db['User']['find']({'where':{'id':_0x5245e4['params']['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x491b07,null))[_0x0af3('0x38')](function(_0x126ae2){if(_0x126ae2){var _0x5ab442=_0x126ae2['get']({'plain':!![]});return _0x126ae2[_0x0af3('0x10d')](_0x5245e4[_0x0af3('0x67')][_0x0af3('0xa7')],_['omit'](_0x5245e4[_0x0af3('0x67')],[_0x0af3('0xa7'),'id'])||{})[_0x0af3('0x38')](function(){for(var _0x553a03=0x0;_0x553a03<_0x5245e4[_0x0af3('0x67')][_0x0af3('0xa7')][_0x0af3('0x54')];_0x553a03++){var _0x5d4f8f=[];db['Team']['findOne']({'where':{'id':_0x5245e4[_0x0af3('0x67')][_0x0af3('0xa7')][_0x553a03]}})['then'](function(_0x2c042c){_0x5d4f8f[_0x0af3('0xae')](_0x2c042c[_0x0af3('0x10e')]()['then'](function(_0xc55184){for(var _0x107ecd=0x0;_0x107ecd<_0xc55184['length'];_0x107ecd++){_0xc55184[_0x107ecd][_0x0af3('0x10f')](_0x0af3('0x9e'),_0x0af3('0x110'));}return _0xc55184;}));_0x5d4f8f['push'](_0x2c042c[_0x0af3('0x111')]()[_0x0af3('0x38')](function(_0x1f6dab){for(var _0x464045=0x0;_0x464045<_0x1f6dab[_0x0af3('0x54')];_0x464045++){_0x1f6dab[_0x464045][_0x0af3('0x10f')]('channel',_0x0af3('0x112'));}return _0x1f6dab;}));_0x5d4f8f[_0x0af3('0xae')](_0x2c042c[_0x0af3('0x113')]()[_0x0af3('0x38')](function(_0x3d3598){for(var _0x3215cf=0x0;_0x3215cf<_0x3d3598[_0x0af3('0x54')];_0x3215cf++){_0x3d3598[_0x3215cf][_0x0af3('0x10f')](_0x0af3('0x9e'),_0x0af3('0x114'));}return _0x3d3598;}));_0x5d4f8f['push'](_0x2c042c[_0x0af3('0x115')]()[_0x0af3('0x38')](function(_0x21abca){for(var _0x206b44=0x0;_0x206b44<_0x21abca[_0x0af3('0x54')];_0x206b44++){_0x21abca[_0x206b44]['setDataValue'](_0x0af3('0x9e'),'Sms');}return _0x21abca;}));_0x5d4f8f['push'](_0x2c042c[_0x0af3('0x116')]()[_0x0af3('0x38')](function(_0xe02b6b){for(var _0x6c7e11=0x0;_0x6c7e11<_0xe02b6b['length'];_0x6c7e11++){_0xe02b6b[_0x6c7e11][_0x0af3('0x10f')]('channel','Whatsapp');}return _0xe02b6b;}));_0x5d4f8f['push'](_0x2c042c[_0x0af3('0x117')]()[_0x0af3('0x38')](function(_0xb8af58){for(var _0x500dd0=0x0;_0x500dd0<_0xb8af58[_0x0af3('0x54')];_0x500dd0++){_0xb8af58[_0x500dd0][_0x0af3('0x10f')](_0x0af3('0x9e'),'Fax');}return _0xb8af58;}));_0x5d4f8f[_0x0af3('0xae')](_0x2c042c['getOpenchannelQueues']()[_0x0af3('0x38')](function(_0x534e88){for(var _0xc7acc=0x0;_0xc7acc<_0x534e88['length'];_0xc7acc++){_0x534e88[_0xc7acc]['setDataValue'](_0x0af3('0x9e'),_0x0af3('0x118'));}return _0x534e88;}));return BPromise[_0x0af3('0xee')](_0x5d4f8f);})[_0x0af3('0x38')](function(_0x358245){var _0x4fedbf=_[_0x0af3('0x119')](_0x358245);_0x5d4f8f=[];return db[_0x0af3('0x5a')][_0x0af3('0x11a')](function(_0x31c085){for(var _0x2ce1e9=0x0;_0x2ce1e9<_0x4fedbf['length'];_0x2ce1e9++){_0x5d4f8f[_0x0af3('0xae')](_0x4fedbf[_0x2ce1e9]['addAgent'](_0x5ab442['id']),{'transaction':_0x31c085});}return BPromise['all'](_0x5d4f8f)[_0x0af3('0x38')](function(){if(_0x5ab442[_0x0af3('0x9f')]){return BPromise[_0x0af3('0xb2')](_[_0x0af3('0x3d')](_0x4fedbf,function(_0x5c7d29){return _0x5c7d29['getDataValue'](_0x0af3('0x9e'))===_0x0af3('0x110');}),function(_0x1d3f29){return db[_0x0af3('0xcd')]['upsert']({'membername':_0x5ab442['name'],'UserId':_0x5ab442['id'],'queue_name':_0x1d3f29[_0x0af3('0x42')],'VoiceQueueId':_0x1d3f29['id'],'interface':_['isNil'](_0x5ab442[_0x0af3('0xaf')])?util[_0x0af3('0xb0')]('SIP/%s',_0x5ab442[_0x0af3('0x42')]):_0x5ab442[_0x0af3('0xaf')],'paused':_0x5ab442['voicePause']||![],'penalty':_0x5ab442[_0x0af3('0xa8')]},{'transaction':_0x31c085});});}else{return;}})[_0x0af3('0x38')](function(){for(var _0x2f1967=0x0;_0x2f1967<_0x4fedbf[_0x0af3('0x54')];_0x2f1967++){var _0x20d232=_0x4fedbf[_0x2f1967][_0x0af3('0x11b')](_0x0af3('0x9e'));var _0x32300d=_0x20d232+_0x0af3('0xaa');socket[_0x0af3('0xab')](_0x0af3('0x3a')+_0x20d232+_0x0af3('0xac'),{'UserId':_0x5ab442['id'],['queueField']:_0x4fedbf[_0x2f1967]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x491b07,null))['catch'](handleError(_0x491b07,null));};exports[_0x0af3('0x11c')]=function(_0x26b821,_0x5e6428){return db['User'][_0x0af3('0x94')]({'where':{'id':_0x26b821[_0x0af3('0x68')]['id']}})[_0x0af3('0x38')](handleEntityNotFound(_0x5e6428,null))[_0x0af3('0x38')](function(_0x117c27){if(_0x117c27){var _0x58d58b=_0x117c27[_0x0af3('0x8c')]({'plain':!![]});var _0xbbaadb=_0x26b821['query'][_0x0af3('0xa7')];return _0x117c27[_0x0af3('0x11c')](_0xbbaadb)[_0x0af3('0x38')](function(){for(var _0x47491d=0x0;_0x47491d<_0xbbaadb['length'];_0x47491d++){var _0x50764d=[];db[_0x0af3('0x10c')][_0x0af3('0x94')]({'where':{'id':_0xbbaadb[_0x47491d]}})['then'](function(_0x1f27f4){_0x50764d['push'](_0x1f27f4['getVoiceQueues']()[_0x0af3('0x38')](function(_0x1d520a){for(var _0x567a04=0x0;_0x567a04<_0x1d520a[_0x0af3('0x54')];_0x567a04++){_0x1d520a[_0x567a04][_0x0af3('0x10f')]('channel',_0x0af3('0x110'));}return _0x1d520a;}));_0x50764d[_0x0af3('0xae')](_0x1f27f4[_0x0af3('0x111')]()[_0x0af3('0x38')](function(_0x13c00a){for(var _0x3dcf49=0x0;_0x3dcf49<_0x13c00a[_0x0af3('0x54')];_0x3dcf49++){_0x13c00a[_0x3dcf49]['setDataValue'](_0x0af3('0x9e'),_0x0af3('0x112'));}return _0x13c00a;}));_0x50764d['push'](_0x1f27f4[_0x0af3('0x113')]()[_0x0af3('0x38')](function(_0x3ce6c2){for(var _0x19cbf1=0x0;_0x19cbf1<_0x3ce6c2[_0x0af3('0x54')];_0x19cbf1++){_0x3ce6c2[_0x19cbf1][_0x0af3('0x10f')]('channel','Mail');}return _0x3ce6c2;}));_0x50764d[_0x0af3('0xae')](_0x1f27f4[_0x0af3('0x115')]()[_0x0af3('0x38')](function(_0x25d8f7){for(var _0x2f4a0f=0x0;_0x2f4a0f<_0x25d8f7[_0x0af3('0x54')];_0x2f4a0f++){_0x25d8f7[_0x2f4a0f]['setDataValue'](_0x0af3('0x9e'),_0x0af3('0x11d'));}return _0x25d8f7;}));_0x50764d['push'](_0x1f27f4[_0x0af3('0x116')]()['then'](function(_0x2f92fc){for(var _0x44366f=0x0;_0x44366f<_0x2f92fc[_0x0af3('0x54')];_0x44366f++){_0x2f92fc[_0x44366f][_0x0af3('0x10f')](_0x0af3('0x9e'),_0x0af3('0x11e'));}return _0x2f92fc;}));_0x50764d[_0x0af3('0xae')](_0x1f27f4['getFaxQueues']()[_0x0af3('0x38')](function(_0x574d81){for(var _0x37f8ca=0x0;_0x37f8ca<_0x574d81[_0x0af3('0x54')];_0x37f8ca++){_0x574d81[_0x37f8ca][_0x0af3('0x10f')](_0x0af3('0x9e'),_0x0af3('0x11f'));}return _0x574d81;}));_0x50764d[_0x0af3('0xae')](_0x1f27f4['getOpenchannelQueues']()['then'](function(_0x401369){for(var _0x410420=0x0;_0x410420<_0x401369['length'];_0x410420++){_0x401369[_0x410420][_0x0af3('0x10f')](_0x0af3('0x9e'),_0x0af3('0x118'));}return _0x401369;}));return BPromise[_0x0af3('0xee')](_0x50764d);})[_0x0af3('0x38')](function(_0x48e167){var _0x197348=_[_0x0af3('0x119')](_0x48e167);_0x50764d=[];return db['sequelize'][_0x0af3('0x11a')](function(_0x27479b){for(var _0x11c3db=0x0;_0x11c3db<_0x197348['length'];_0x11c3db++){_0x50764d[_0x0af3('0xae')](_0x197348[_0x11c3db][_0x0af3('0x120')](_0x58d58b['id']),{'transaction':_0x27479b});}return BPromise[_0x0af3('0xee')](_0x50764d)[_0x0af3('0x38')](function(){if(_0x58d58b[_0x0af3('0x9f')]){return BPromise['each'](_[_0x0af3('0x3d')](_0x197348,function(_0x2b2673){return _0x2b2673['getDataValue'](_0x0af3('0x9e'))==='Voice';}),function(_0x5627f3){return db['UserVoiceQueueRt'][_0x0af3('0x39')]({'where':{'VoiceQueueId':_0x5627f3['id'],'UserId':_0x58d58b['id']},'transaction':_0x27479b});});}else{return;}})['then'](function(){for(var _0x4b7dfa=0x0;_0x4b7dfa<_0x197348['length'];_0x4b7dfa++){var _0xa4d96f=_0x197348[_0x4b7dfa]['getDataValue'](_0x0af3('0x9e'));var _0x102af2=_0xa4d96f+_0x0af3('0xaa');socket[_0x0af3('0xab')]('user'+_0xa4d96f+_0x0af3('0x121'),{'UserId':_0x58d58b['id'],['queueField']:_0x197348[_0x4b7dfa]['id']});}});});});}});}})[_0x0af3('0x38')](respondWithStatusCode(_0x5e6428,null))[_0x0af3('0x2e')](handleError(_0x5e6428,null));};exports[_0x0af3('0x122')]=function(_0x377053,_0x1637c9,_0x1cd24e){var _0x5e4934={};var _0x198053={};var _0xb82bd;var _0xb2a9eb;return db['User'][_0x0af3('0x94')]({'where':{'id':_0x377053[_0x0af3('0x68')]['id']}})['then'](handleEntityNotFound(_0x1637c9,null))[_0x0af3('0x38')](function(_0x236081){if(_0x236081){_0xb82bd=_0x236081;_0x198053[_0x0af3('0x4c')]=_['keys'](db[_0x0af3('0xc2')][_0x0af3('0x48')]);_0x198053[_0x0af3('0x4f')]=_[_0x0af3('0x50')](_0x377053[_0x0af3('0x4f')]);_0x198053[_0x0af3('0x58')]=_[_0x0af3('0x51')](_0x198053[_0x0af3('0x4c')],_0x198053['query']);_0x5e4934[_0x0af3('0x52')]=_[_0x0af3('0x51')](_0x198053[_0x0af3('0x4c')],qs[_0x0af3('0x53')](_0x377053['query'][_0x0af3('0x53')]));_0x5e4934[_0x0af3('0x52')]=_0x5e4934[_0x0af3('0x52')][_0x0af3('0x54')]?_0x5e4934[_0x0af3('0x52')]:_0x198053[_0x0af3('0x4c')];_0x5e4934[_0x0af3('0x56')]=qs[_0x0af3('0xc1')](_0x377053[_0x0af3('0x4f')]['sort']);_0x5e4934[_0x0af3('0x57')]=qs['filters'](_['pick'](_0x377053['query'],_0x198053['filters']));if(_0x377053[_0x0af3('0x4f')][_0x0af3('0x3d')]){_0x5e4934[_0x0af3('0x57')]=_[_0x0af3('0x5d')](_0x5e4934['where'],{'$or':_[_0x0af3('0x3f')](_0x5e4934['attributes'],function(_0x3b82d7){var _0x3c7d25={};_0x3c7d25[_0x3b82d7]={'$like':'%'+_0x377053[_0x0af3('0x4f')][_0x0af3('0x3d')]+'%'};return _0x3c7d25;})});}_0x5e4934=_[_0x0af3('0x5d')]({},_0x5e4934,_0x377053[_0x0af3('0x5e')]);return _0xb82bd['getLists'](_0x5e4934);}})[_0x0af3('0x38')](function(_0x5381fc){if(_0x5381fc){_0xb2a9eb=_0x5381fc['length'];if(!_0x377053[_0x0af3('0x4f')][_0x0af3('0xcc')](_0x0af3('0x55'))){_0x5e4934[_0x0af3('0x34')]=qs['limit'](_0x377053[_0x0af3('0x4f')]['limit']);_0x5e4934['offset']=qs[_0x0af3('0x33')](_0x377053[_0x0af3('0x4f')][_0x0af3('0x33')]);}return _0xb82bd[_0x0af3('0x122')](_0x5e4934);}})[_0x0af3('0x38')](function(_0x136f5d){if(_0x136f5d){return _0x136f5d?{'count':_0xb2a9eb,'rows':_0x136f5d}:null;}})['then'](respondWithResult(_0x1637c9,null))[_0x0af3('0x2e')](handleError(_0x1637c9,null));};exports[_0x0af3('0x123')]=function(_0x6a76e4,_0x13e387,_0x3f79f2){var _0x5b81b7={};var _0x4432fc={};var _0x60ff7a;var _0x5a4713;return db[_0x0af3('0x47')][_0x0af3('0x94')]({'where':{'id':_0x6a76e4[_0x0af3('0x68')]['id']}})['then'](handleEntityNotFound(_0x13e387,null))[_0x0af3('0x38')](function(_0x4b43c7){if(_0x4b43c7){_0x60ff7a=_0x4b43c7;_0x4432fc[_0x0af3('0x4c')]=_[_0x0af3('0x50')](db[_0x0af3('0x47')][_0x0af3('0x48')]);_0x4432fc[_0x0af3('0x4f')]=_[_0x0af3('0x50')](_0x6a76e4[_0x0af3('0x4f')]);_0x4432fc[_0x0af3('0x58')]=_['intersection'](_0x4432fc[_0x0af3('0x4c')],_0x4432fc[_0x0af3('0x4f')]);_0x5b81b7[_0x0af3('0x52')]=_[_0x0af3('0x51')](_0x4432fc[_0x0af3('0x4c')],qs[_0x0af3('0x53')](_0x6a76e4[_0x0af3('0x4f')][_0x0af3('0x53')]));_0x5b81b7['attributes']=_0x5b81b7[_0x0af3('0x52')][_0x0af3('0x54')]?_0x5b81b7[_0x0af3('0x52')]:_0x4432fc[_0x0af3('0x4c')];_0x5b81b7[_0x0af3('0x56')]=qs['sort'](_0x6a76e4[_0x0af3('0x4f')]['sort']);_0x5b81b7[_0x0af3('0x57')]=qs[_0x0af3('0x58')](_['pick'](_0x6a76e4['query'],_0x4432fc[_0x0af3('0x58')]));if(_0x6a76e4[_0x0af3('0x4f')][_0x0af3('0x3d')]){_0x5b81b7['where']=_[_0x0af3('0x5d')](_0x5b81b7[_0x0af3('0x57')],{'$or':_[_0x0af3('0x3f')](_0x5b81b7[_0x0af3('0x52')],function(_0x5cabbb){var _0x43dcfe={};_0x43dcfe[_0x5cabbb]={'$like':'%'+_0x6a76e4['query'][_0x0af3('0x3d')]+'%'};return _0x43dcfe;})});}_0x5b81b7[_0x0af3('0x4c')]=db['User'];_0x5b81b7['as']=_0x0af3('0x8d');_0x5b81b7=_[_0x0af3('0x5d')]({},_0x5b81b7,_0x6a76e4['options']);return _0x60ff7a['getVoiceQueues']({'include':[_0x5b81b7]});}})['then'](function(_0x6233a0){if(_0x6233a0){var _0x3b83b7={},_0x2df586=[],_0x5409e9=0x0;for(var _0x293f1b=0x0;_0x293f1b<_0x6233a0[_0x0af3('0x54')];_0x293f1b+=0x1){for(var _0x2bdf79=0x0,_0x56f4f9;_0x2bdf79<_0x6233a0[_0x293f1b][_0x0af3('0x8d')][_0x0af3('0x54')];_0x2bdf79+=0x1){_0x56f4f9=_0x6233a0[_0x293f1b][_0x0af3('0x8d')][_0x2bdf79][_0x0af3('0x8c')]({'plain':!![]});_0x3b83b7[_0x56f4f9['id']]=_0x56f4f9;}}_0x3b83b7=_[_0x0af3('0x124')](_0x3b83b7);for(var _0x6ef96c=qs[_0x0af3('0x33')](_0x6a76e4['query'][_0x0af3('0x33')]);_0x6ef96c<_0x3b83b7[_0x0af3('0x54')]&&_0x2df586[_0x0af3('0x54')]=_0x18e127){_0x5c2107=_0x18e127;_0x3d92b6=0xc8;}else{_0x3d92b6=0xce;}_0x52636e[_0x0a07('0x2d')](_0x3d92b6);return _0x52636e['set']('Content-Range',_0x134013+'-'+_0x5c2107+'/'+_0x18e127)[_0x0a07('0x2e')](_0x3aeb71);}return null;};}function patchUpdates(_0x1c88bc){return function(_0x15122c){try{jsonpatch[_0x0a07('0x32')](_0x15122c,_0x1c88bc,!![]);}catch(_0x416759){return BPromise[_0x0a07('0x33')](_0x416759);}return _0x15122c[_0x0a07('0x34')]();};}function saveUpdates(_0x5ae06e,_0x1e7f6a){return function(_0x49db3d){if(_0x49db3d){return _0x49db3d[_0x0a07('0x35')](_0x5ae06e)[_0x0a07('0x22')](function(_0x4d42b3){return _0x4d42b3;});}return null;};}function removeEntity(_0x2522f6,_0x5ed18d){return function(_0x221b0e){if(_0x221b0e){return _0x221b0e[_0x0a07('0x36')]()[_0x0a07('0x22')](function(){var _0x157836=_0x221b0e[_0x0a07('0x37')]({'plain':!![]});var _0x5ea6e9=[{'name':_0x0a07('0x38'),'value':'user','ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0xf48857=_(_0x5ea6e9)[_0x0a07('0x39')](_0x0a07('0x3a'))[_0x0a07('0x3b')]('value')[_0x0a07('0x3c')]();if(_['includes'](_0xf48857,_0x157836[_0x0a07('0x3d')])){return;}var _0x312752=_[_0x0a07('0x3e')](_0x5ea6e9,[_0x0a07('0x3c'),_0x157836[_0x0a07('0x3d')]])[_0x0a07('0x3f')];return db[_0x0a07('0x40')][_0x0a07('0x36')]({'where':{'type':_0x312752,'resourceId':_0x157836['id']}})[_0x0a07('0x22')](function(){return _0x221b0e;});})['then'](function(){_0x2522f6[_0x0a07('0x2d')](0xcc)[_0x0a07('0x41')]();});}};}function handleEntityNotFound(_0x20eab9,_0x2efd77){return function(_0x57f4d4){if(!_0x57f4d4){_0x20eab9['sendStatus'](0x194);}return _0x57f4d4;};}function handleError(_0x7fd96f,_0x121776){_0x121776=_0x121776||0x1f4;return function(_0x43d7b4){logger[_0x0a07('0x27')](_0x43d7b4['stack']);if(_0x43d7b4['name']){delete _0x43d7b4[_0x0a07('0x3f')];}_0x7fd96f[_0x0a07('0x2d')](_0x121776)[_0x0a07('0x42')](_0x43d7b4);};}exports['index']=function(_0x29c73d,_0x47bc0f){var _0x692b64={},_0x18337f={},_0x97d66a={'count':0x0,'rows':[]};var _0x4e646a=_[_0x0a07('0x3b')](db[_0x0a07('0x43')][_0x0a07('0x44')],function(_0x574d2b){return{'name':_0x574d2b[_0x0a07('0x45')],'type':_0x574d2b[_0x0a07('0x46')]['key']};});_0x18337f[_0x0a07('0x47')]=_[_0x0a07('0x48')](_[_0x0a07('0x3b')](_0x4e646a,_0x0a07('0x3f')),['password','salt']);_0x18337f['query']=_[_0x0a07('0x49')](_0x29c73d[_0x0a07('0x4a')]);_0x18337f['filters']=_['intersection'](_0x18337f[_0x0a07('0x47')],_0x18337f[_0x0a07('0x4a')]);_0x692b64[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0x18337f[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x29c73d[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x692b64[_0x0a07('0x4b')]=_0x692b64[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x692b64[_0x0a07('0x4b')]:_0x18337f[_0x0a07('0x47')];if(!_0x29c73d['query']['hasOwnProperty']('nolimit')){_0x692b64['limit']=qs[_0x0a07('0x31')](_0x29c73d['query'][_0x0a07('0x31')]);_0x692b64['offset']=qs['offset'](_0x29c73d[_0x0a07('0x4a')][_0x0a07('0x30')]);}_0x692b64['order']=qs[_0x0a07('0x4f')](_0x29c73d[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x692b64[_0x0a07('0x50')]=qs[_0x0a07('0x51')](_[_0x0a07('0x52')](_0x29c73d['query'],_0x18337f[_0x0a07('0x51')]),_0x4e646a);if(_0x29c73d['query'][_0x0a07('0x39')]){_0x692b64[_0x0a07('0x50')]=_[_0x0a07('0x53')](_0x692b64[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x4e646a,function(_0x369609){if(_0x369609['type']!==_0x0a07('0x54')){return db[_0x0a07('0x55')][_0x0a07('0x50')](db[_0x0a07('0x55')]['fn']('lower',db['sequelize'][_0x0a07('0x56')](_0x369609[_0x0a07('0x3f')])),{'$like':db[_0x0a07('0x55')]['fn'](_0x0a07('0x57'),'%'+_0x29c73d['query']['filter']+'%')});}})});}_0x692b64=_[_0x0a07('0x53')]({},_0x692b64,_0x29c73d[_0x0a07('0x58')]);var _0x5d54fd={'where':_0x692b64[_0x0a07('0x50')]};return db[_0x0a07('0x43')][_0x0a07('0x2f')](_0x5d54fd)[_0x0a07('0x22')](function(_0x5b5419){_0x97d66a['count']=_0x5b5419;if(_0x29c73d[_0x0a07('0x4a')][_0x0a07('0x59')]){_0x692b64['include']=[{'all':!![]}];}return db[_0x0a07('0x43')]['findAll'](_0x692b64);})[_0x0a07('0x22')](function(_0x27da82){_0x97d66a['rows']=_0x27da82;return _0x97d66a;})[_0x0a07('0x22')](respondWithFilteredResult(_0x47bc0f,_0x692b64))[_0x0a07('0x2c')](handleError(_0x47bc0f,null));};exports[_0x0a07('0x5a')]=function(_0x51c566,_0x16c596){var _0x534a56={'raw':![],'where':{'id':_0x51c566[_0x0a07('0x5b')]['id']}},_0xe03752={};_0xe03752['model']=_[_0x0a07('0x48')](_[_0x0a07('0x49')](db['User'][_0x0a07('0x44')]),['password','salt']);_0xe03752['query']=_[_0x0a07('0x49')](_0x51c566[_0x0a07('0x4a')]);_0xe03752[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0xe03752[_0x0a07('0x47')],_0xe03752[_0x0a07('0x4a')]);_0x534a56[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0xe03752[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x51c566[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x534a56[_0x0a07('0x4b')]=_0x534a56[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x534a56[_0x0a07('0x4b')]:_0xe03752[_0x0a07('0x47')];if(_0x51c566['query'][_0x0a07('0x59')]){_0x534a56['include']=[{'all':!![]}];}_0x534a56=_['merge']({},_0x534a56,_0x51c566[_0x0a07('0x58')]);return db[_0x0a07('0x43')]['find'](_0x534a56)[_0x0a07('0x22')](handleEntityNotFound(_0x16c596,null))[_0x0a07('0x22')](respondWithResult(_0x16c596,null))[_0x0a07('0x2c')](handleError(_0x16c596,null));};exports[_0x0a07('0x5c')]=function(_0x199ebb,_0x380547){return db[_0x0a07('0x43')][_0x0a07('0x5c')](_0x199ebb[_0x0a07('0x5d')],{'raw':![],'individualHooks':!![]})[_0x0a07('0x22')](respondWithResult(_0x380547,0xc9))[_0x0a07('0x2c')](handleError(_0x380547,null));};exports['update']=function(_0x127aeb,_0x38eac7){if(_0x127aeb[_0x0a07('0x5d')]['id']){delete _0x127aeb[_0x0a07('0x5d')]['id'];}delete _0x127aeb[_0x0a07('0x5d')][_0x0a07('0x3d')];return db[_0x0a07('0x43')][_0x0a07('0x3e')]({'where':{'id':_0x127aeb[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x38eac7,null))['then'](saveUpdates(_0x127aeb['body'],null))[_0x0a07('0x22')](respondWithResult(_0x38eac7,null))['catch'](handleError(_0x38eac7,null));};exports[_0x0a07('0x5e')]=function(_0x38eeed,_0xe42847){return db[_0x0a07('0x43')][_0x0a07('0x5e')]()[_0x0a07('0x22')](respondWithResult(_0xe42847,null))[_0x0a07('0x2c')](handleError(_0xe42847,null));};exports[_0x0a07('0x5f')]=function(_0x2c8b02,_0x127886,_0xa33dd){return db[_0x0a07('0x43')]['find']({'where':{'id':_0x2c8b02[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x127886,null))[_0x0a07('0x22')](function(_0xa208d6){if(_0xa208d6){return _0xa208d6[_0x0a07('0x5f')](_0x2c8b02['body'][_0x0a07('0x60')],_[_0x0a07('0x61')](_0x2c8b02[_0x0a07('0x5d')],[_0x0a07('0x60'),'id'])||{});}})['then'](respondWithResult(_0x127886,null))[_0x0a07('0x2c')](handleError(_0x127886,null));};var getLicense=function(_0x11a5eb){return new BPromise(function(_0x1f9600,_0x220937){var _0x181afe=0x0;_0x11a5eb[_0x0a07('0x5d')][_0x0a07('0x3d')]===_0x0a07('0x62')&&_0x1f9600('agent\x20role');return db[_0x0a07('0x43')][_0x0a07('0x2f')]({'where':{'$or':[{'role':_0x11a5eb[_0x0a07('0x5d')][_0x0a07('0x3d')]===_0x0a07('0x63')?_0x0a07('0x63'):['admin','user']}]}})['then'](function(_0x3e0686){_0x181afe=_0x3e0686;return require(_0x0a07('0x64'))[_0x0a07('0x65')]();})[_0x0a07('0x22')](function(_0xc11272){var _0x3b8f6b=_0x11a5eb[_0x0a07('0x5d')]['role']===_0x0a07('0x63')?_0x0a07('0x66'):'users';if(!_[_0x0a07('0x67')](_0xc11272[_0x3b8f6b])&&_0x181afe>=_0xc11272[_0x3b8f6b]){return _0x220937({'message':_0x0a07('0x68')});}return _0x1f9600(util[_0x0a07('0x69')]('count\x20%s:\x20%s',_0x3b8f6b,_0x181afe));})[_0x0a07('0x2c')](function(_0x567da4){return _0x220937(_0x567da4);});});};exports[_0x0a07('0x6a')]=function(_0x279519,_0x43fac3){return getLicense(_0x279519)['then'](function(_0x7f82da){if(!_0x279519[_0x0a07('0x5d')][_0x0a07('0x6b')]){var _0x1da7f9;return db[_0x0a07('0x6c')][_0x0a07('0x6d')](0x1)[_0x0a07('0x22')](function(_0x47bc1c){return checkPasswordPattern(_0x47bc1c,_0x279519['body']['password'],_0x47bc1c['securePassword']);})[_0x0a07('0x22')](function(_0x20d72e){_0x1da7f9=_0x20d72e[_0x0a07('0x6e')];return db[_0x0a07('0x43')]['max'](_0x0a07('0x6b'));})[_0x0a07('0x22')](function(_0x3193ea){if(_[_0x0a07('0x67')](_0x3193ea)){if(_0x1da7f9){_0x279519[_0x0a07('0x5d')][_0x0a07('0x6b')]=_0x1da7f9;}else{_0x279519['body']['internal']=0x1;}}else{if(_[_0x0a07('0x67')](_0x1da7f9)||_0x1da7f9==_0x3193ea){_0x279519[_0x0a07('0x5d')][_0x0a07('0x6b')]=_0x3193ea+0x1;}else if(_0x1da7f9>_0x3193ea){_0x279519[_0x0a07('0x5d')]['internal']=_0x1da7f9;}else{return db[_0x0a07('0x55')]['query'](_0x0a07('0x6f'),{'type':db['sequelize'][_0x0a07('0x70')][_0x0a07('0x71')]})[_0x0a07('0x22')](function(_0x200934){if(_0x200934&&_0x200934['length']){for(var _0x238661=0x0,_0x424138=_0x200934['length'];_0x238661<_0x424138&&_['isNil'](_0x279519[_0x0a07('0x5d')][_0x0a07('0x6b')]);_0x238661++){if(_0x1da7f9<=_0x200934[_0x238661][_0x0a07('0x72')]){_0x279519[_0x0a07('0x5d')][_0x0a07('0x6b')]=_0x200934[_0x238661][_0x0a07('0x72')];}else if(_0x1da7f9>_0x200934[_0x238661][_0x0a07('0x72')]&&_0x1da7f9<=_0x200934[_0x238661]['to']){_0x279519[_0x0a07('0x5d')][_0x0a07('0x6b')]=_0x1da7f9;}}}if(_[_0x0a07('0x67')](_0x279519[_0x0a07('0x5d')][_0x0a07('0x6b')])){_0x279519['body'][_0x0a07('0x6b')]=_0x3193ea+0x1;}});}}});}})['then'](function(){if(_0x279519[_0x0a07('0x5d')][_0x0a07('0x73')]){_0x279519[_0x0a07('0x5d')][_0x0a07('0x74')]=_0x279519[_0x0a07('0x5d')][_0x0a07('0x6b')];_0x279519[_0x0a07('0x5d')]['VoiceMail']={'mailbox':_0x279519[_0x0a07('0x5d')][_0x0a07('0x6b')],'password':_0x279519[_0x0a07('0x5d')][_0x0a07('0x75')],'fullname':_0x279519[_0x0a07('0x5d')][_0x0a07('0x76')],'email':_0x279519[_0x0a07('0x5d')][_0x0a07('0x77')]};}if(_0x279519['body']&&_0x279519[_0x0a07('0x5d')][_0x0a07('0x3d')]===_0x0a07('0x62')){if(!_0x279519[_0x0a07('0x5d')][_0x0a07('0x78')]){_0x279519['body'][_0x0a07('0x78')]=[_0x0a07('0x79'),_0x0a07('0x7a'),_0x0a07('0x7b'),'113',_0x0a07('0x7c'),'104',_0x0a07('0x7d'),'106',_0x0a07('0x7e'),_0x0a07('0x7f'),_0x0a07('0x80'),_0x0a07('0x81'),_0x0a07('0x82'),_0x0a07('0x83')];}}return db[_0x0a07('0x43')]['create'](_0x279519[_0x0a07('0x5d')],{'include':[{'model':db[_0x0a07('0x84')],'as':_0x0a07('0x84')}]});})[_0x0a07('0x22')](function(_0x30c342){if(_0x279519[_0x0a07('0x5d')]['role']===_0x0a07('0x85'))return _0x30c342;var _0x514d7a=_0x279519[_0x0a07('0x85')][_0x0a07('0x37')]({'plain':!![]});if(!_0x514d7a)throw new Error(_0x0a07('0x86'));if(_0x514d7a[_0x0a07('0x3d')]==='user'){var _0x531bb4=_0x30c342[_0x0a07('0x37')]({'plain':!![]});var _0x51907e=[{'name':_0x0a07('0x87'),'value':_0x0a07('0x62')},{'name':_0x0a07('0x88'),'value':_0x0a07('0x63')}];var _0x788231=_[_0x0a07('0x3e')](_0x51907e,['value',_0x531bb4['role']])[_0x0a07('0x3f')];return db['UserProfileSection'][_0x0a07('0x3e')]({'where':{'name':_0x788231,'userProfileId':_0x514d7a[_0x0a07('0x89')]},'raw':!![]})[_0x0a07('0x22')](function(_0x2a54a4){if(_0x2a54a4&&_0x2a54a4[_0x0a07('0x8a')]===0x0){return db[_0x0a07('0x40')][_0x0a07('0x6a')]({'name':_0x531bb4[_0x0a07('0x3f')],'resourceId':_0x531bb4['id'],'type':_0x2a54a4[_0x0a07('0x3f')],'sectionId':_0x2a54a4['id']},{})[_0x0a07('0x22')](function(){return _0x30c342;});}else{return _0x30c342;}})['catch'](function(_0x149ef5){logger[_0x0a07('0x27')](_0x0a07('0x8b'),_0x149ef5);throw _0x149ef5;});}return _0x30c342;})['then'](respondWithResult(_0x43fac3,0xc9))[_0x0a07('0x2c')](handleError(_0x43fac3,null));};exports[_0x0a07('0x8c')]=function(_0x88f444,_0x88d62,_0x308e6b){var _0x28510a=![];if(_0x88f444[_0x0a07('0x5d')]['id']){delete _0x88f444[_0x0a07('0x5d')]['id'];}return db['Setting'][_0x0a07('0x8d')]({'attributes':['id','securePassword']})[_0x0a07('0x22')](function(_0x3d58fa){_0x28510a=_0x3d58fa[_0x0a07('0x8e')];return db[_0x0a07('0x43')][_0x0a07('0x3e')]({'where':{'id':_0x88f444[_0x0a07('0x5b')]['id']}});})[_0x0a07('0x22')](function(_0x129265){if(_0x129265){if(_0x129265['id']==_0x88f444[_0x0a07('0x85')]['id']){if(!_0x88f444[_0x0a07('0x5d')]['oldPassword']||!_0x88f444[_0x0a07('0x5d')][_0x0a07('0x8f')]){throw new db['Sequelize'][(_0x0a07('0x1f'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x129265[_0x0a07('0x90')](_0x88f444[_0x0a07('0x5d')]['oldPassword'])){throw new db['Sequelize'][(_0x0a07('0x1f'))](_0x0a07('0x91'));}if(_0x88f444['body'][_0x0a07('0x92')]==_0x88f444[_0x0a07('0x5d')]['newPassword']){throw new db[(_0x0a07('0x1e'))][(_0x0a07('0x1f'))](_0x0a07('0x93'));}return _0x129265;}else if(_0x88f444[_0x0a07('0x85')][_0x0a07('0x3d')]==_0x0a07('0x94')){if(!_0x88f444[_0x0a07('0x5d')][_0x0a07('0x8f')]){throw new db[(_0x0a07('0x1e'))]['ValidationError'](_0x0a07('0x95'));}return _0x129265;}else if(_0x88f444[_0x0a07('0x85')][_0x0a07('0x3d')]==_0x0a07('0x85')){if(!_0x88f444[_0x0a07('0x5d')][_0x0a07('0x8f')]){throw new db[(_0x0a07('0x1e'))][(_0x0a07('0x1f'))](_0x0a07('0x95'));}if(_0x129265[_0x0a07('0x3d')]!='agent'){throw new db[(_0x0a07('0x1e'))][(_0x0a07('0x1f'))]('Unauthorized');}return _0x129265;}else{throw new db[(_0x0a07('0x1e'))][(_0x0a07('0x1f'))]('Unauthorized');}}return null;})[_0x0a07('0x22')](handleEntityNotFound(_0x88d62,null))[_0x0a07('0x22')](function(_0x55b514){return checkPasswordPattern(_0x55b514,_0x88f444[_0x0a07('0x5d')][_0x0a07('0x8f')],_0x28510a);})['then'](saveUpdates({'password':_0x88f444[_0x0a07('0x5d')][_0x0a07('0x8f')],'passwordResetAt':_0x88f444['user']['id']==_0x88f444[_0x0a07('0x5b')]['id']?moment():null},null))[_0x0a07('0x22')](respondWithResult(_0x88d62,null))[_0x0a07('0x2c')](handleError(_0x88d62,null));};exports[_0x0a07('0x96')]=function(_0x32fc1e,_0x475060,_0x3682d8){var _0x18964f=_0x32fc1e[_0x0a07('0x5d')][_0x0a07('0x97')];return db[_0x0a07('0x43')][_0x0a07('0x3e')]({'where':{'id':_0x32fc1e[_0x0a07('0x5b')]['id']},'attributes':['id',_0x0a07('0x3f'),'role','online','loginInPause',_0x0a07('0x98'),_0x0a07('0x99')]})[_0x0a07('0x22')](handleEntityNotFound(_0x475060,null))[_0x0a07('0x22')](function(_0x1426fb){if(_0x1426fb){if(!utils[_0x0a07('0x9a')](_0x18964f)){throw new db[(_0x0a07('0x1e'))][(_0x0a07('0x1f'))]('Unknown\x20channel');}return _0x1426fb['add'+_[_0x0a07('0x9b')](_0x18964f[_0x0a07('0x9c')]())+'Queues'](_0x32fc1e['body'][_0x0a07('0x60')],{'penalty':_0x32fc1e[_0x0a07('0x5d')][_0x0a07('0x9d')]||0x0})[_0x0a07('0x9e')](function(_0x4f93ef){for(var _0x208499=0x0;_0x208499<_0x32fc1e[_0x0a07('0x5d')][_0x0a07('0x60')]['length'];_0x208499+=0x1){var _0x459d5e={'UserId':_0x32fc1e[_0x0a07('0x5b')]['id']};_0x459d5e[_[_0x0a07('0x9b')](_0x18964f[_0x0a07('0x9c')]())+_0x0a07('0x9f')]=_0x32fc1e[_0x0a07('0x5d')]['ids'][_0x208499];socket['emit'](_0x0a07('0x85')+_[_0x0a07('0x9b')](_0x18964f['toLowerCase']())+_0x0a07('0xa0'),_0x459d5e);}return _0x4f93ef;})['then'](function(){if(_0x18964f===_0x0a07('0xa1')){return db['VoiceQueue'][_0x0a07('0xa2')]({'where':{'id':_0x32fc1e[_0x0a07('0x5d')][_0x0a07('0x60')]||[]},'raw':!![],'attributes':['id',_0x0a07('0x3f')]});}})[_0x0a07('0x22')](function(_0x29b081){var _0x5b978a=_0x1426fb['get']({'plain':!![]});var _0x4cbf63=[];if(_0x18964f===_0x0a07('0xa1')&&_0x5b978a[_0x0a07('0x3d')]==='agent'&&_0x5b978a[_0x0a07('0xa3')]){for(var _0xb17bad=0x0;_0xb17bad<_0x29b081['length'];_0xb17bad+=0x1){_0x4cbf63[_0x0a07('0xa4')]({'membername':_0x5b978a[_0x0a07('0x3f')],'UserId':_0x5b978a['id'],'queue_name':_0x29b081[_0xb17bad][_0x0a07('0x3f')],'VoiceQueueId':_0x29b081[_0xb17bad]['id'],'interface':_[_0x0a07('0x67')](_0x5b978a[_0x0a07('0x99')])?util[_0x0a07('0x69')](_0x0a07('0xa5'),_0x5b978a[_0x0a07('0x3f')]):_0x5b978a['interface'],'paused':_0x5b978a['voicePause']||![],'penalty':_0x32fc1e[_0x0a07('0x5d')][_0x0a07('0x9d')]||0x0});}return BPromise[_0x0a07('0xa6')](_0x4cbf63,function(_0xf183e6){return db[_0x0a07('0xa7')][_0x0a07('0xa8')](_0xf183e6);});}return _0x1426fb;});}})['then'](respondWithStatusCode(_0x475060,null))[_0x0a07('0x2c')](handleError(_0x475060,null));};exports[_0x0a07('0xa9')]=function(_0x44cf2d,_0x34dc59,_0x4d0bcf){var _0x31d30a;return db[_0x0a07('0x43')][_0x0a07('0x3e')]({'where':{'id':_0x44cf2d[_0x0a07('0x5b')]['id']},'attributes':['id',_0x0a07('0x3f'),_0x0a07('0x3d')]})[_0x0a07('0x22')](handleEntityNotFound(_0x34dc59,null))[_0x0a07('0x22')](function(_0x4559c3){if(_0x4559c3){_0x31d30a=_0x4559c3;if(!_0x44cf2d['query']['channel']||!utils[_0x0a07('0x9a')](_0x44cf2d[_0x0a07('0x4a')][_0x0a07('0x97')])){throw new db[(_0x0a07('0x1e'))][(_0x0a07('0x1f'))](_0x0a07('0xaa'));}return _0x4559c3[_0x0a07('0xab')+_[_0x0a07('0x9b')](_0x44cf2d['query'][_0x0a07('0x97')]['toLowerCase']())+_0x0a07('0xac')](_0x44cf2d[_0x0a07('0x4a')][_0x0a07('0x60')]);}})[_0x0a07('0x22')](function(_0x17703b){for(var _0x84f930=0x0;_0x84f930<_0x44cf2d[_0x0a07('0x4a')]['ids'][_0x0a07('0x4e')];_0x84f930+=0x1){var _0x5c1321={'UserId':_0x44cf2d[_0x0a07('0x5b')]['id']};_0x5c1321[_['capitalize'](_0x44cf2d[_0x0a07('0x4a')][_0x0a07('0x97')][_0x0a07('0x9c')]())+_0x0a07('0x9f')]=_0x44cf2d[_0x0a07('0x4a')]['ids'][_0x84f930];socket[_0x0a07('0xad')](_0x0a07('0x85')+_[_0x0a07('0x9b')](_0x44cf2d[_0x0a07('0x4a')]['channel'][_0x0a07('0x9c')]())+'Queue:remove',_0x5c1321);}return _0x17703b;})['then'](function(){if(_0x44cf2d[_0x0a07('0x4a')][_0x0a07('0x97')]==='voice'){return db[_0x0a07('0xa7')]['destroy']({'where':{'UserId':_0x44cf2d['params']['id'],'VoiceQueueId':_0x44cf2d[_0x0a07('0x4a')][_0x0a07('0x60')]},'individualHooks':!![]})['then'](function(){return _0x31d30a;});}return _0x31d30a;})[_0x0a07('0x22')](respondWithStatusCode(_0x34dc59,null))[_0x0a07('0x2c')](handleError(_0x34dc59,null));};exports[_0x0a07('0xae')]=function(_0x446df6,_0x332832,_0x585446){_0x446df6[_0x0a07('0x5d')]['userpic']=_0x446df6['file']['filename'];return db[_0x0a07('0x43')][_0x0a07('0x3e')]({'where':{'id':_0x446df6[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x332832,null))['then'](saveUpdates(_0x446df6['body'],null))['then'](respondWithResult(_0x332832,null))['catch'](handleError(_0x332832,null));};exports[_0x0a07('0xaf')]=function(_0x4cc3b9,_0x87e969,_0x5a7320){var _0x5910f3=path['join'](config[_0x0a07('0xb0')],'server/files/images/logos/default_profile.png');return db['User'][_0x0a07('0x3e')]({'where':{'id':_0x4cc3b9[_0x0a07('0x5b')]['id']},'attributes':['id',_0x0a07('0xb1')],'raw':!![]})[_0x0a07('0x22')](handleEntityNotFound(_0x87e969,null))[_0x0a07('0x22')](function(_0x59cc21){if(_0x59cc21){if(_[_0x0a07('0x67')](_0x59cc21[_0x0a07('0xb1')])){return _0x87e969[_0x0a07('0xb2')](_0x5910f3);}else{if(!fs['existsSync'](path[_0x0a07('0xb3')](config[_0x0a07('0xb0')],_0x0a07('0xb4'),_0x59cc21[_0x0a07('0xb1')]))){return _0x87e969[_0x0a07('0xb2')](_0x5910f3);}return _0x87e969[_0x0a07('0xb2')](path[_0x0a07('0xb3')](config[_0x0a07('0xb0')],_0x0a07('0xb4'),_0x59cc21[_0x0a07('0xb1')]));}}})[_0x0a07('0x2c')](handleError(_0x87e969,null));};exports[_0x0a07('0xb5')]=function(_0x23c445,_0x10e13e,_0x3a1b3d){var _0x5596f9={};var _0x1809cb={};var _0x261474;var _0x1155df;return db[_0x0a07('0x43')]['findOne']({'where':{'id':_0x23c445['params']['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x10e13e,null))[_0x0a07('0x22')](function(_0x3958a9){if(_0x3958a9){_0x261474=_0x3958a9;_0x1809cb['model']=_[_0x0a07('0x49')](db[_0x0a07('0xb6')]['rawAttributes']);_0x1809cb[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x23c445[_0x0a07('0x4a')]);_0x1809cb[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x1809cb[_0x0a07('0x47')],_0x1809cb['query']);_0x5596f9[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0x1809cb[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x23c445[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x5596f9[_0x0a07('0x4b')]=_0x5596f9[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x5596f9['attributes']:_0x1809cb[_0x0a07('0x47')];_0x5596f9[_0x0a07('0xb7')]=qs['sort'](_0x23c445['query']['sort']);_0x5596f9[_0x0a07('0x50')]=qs[_0x0a07('0x51')](_['pick'](_0x23c445[_0x0a07('0x4a')],_0x1809cb['filters']));if(_0x23c445[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x5596f9['where']=_['merge'](_0x5596f9[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x5596f9[_0x0a07('0x4b')],function(_0x4c5644){var _0x26f1c9={};_0x26f1c9[_0x4c5644]={'$like':'%'+_0x23c445[_0x0a07('0x4a')]['filter']+'%'};return _0x26f1c9;})});}_0x5596f9=_[_0x0a07('0x53')]({},_0x5596f9,_0x23c445[_0x0a07('0x58')]);return _0x261474[_0x0a07('0xb5')](_0x5596f9);}})['then'](function(_0x56f287){if(_0x56f287){_0x1155df=_0x56f287[_0x0a07('0x4e')];if(_0x23c445[_0x0a07('0x4a')][_0x0a07('0xb8')]('includeAll')){_0x5596f9[_0x0a07('0xb9')]=[{'model':db[_0x0a07('0xba')],'as':_0x0a07('0xbb'),'required':![]},{'model':db[_0x0a07('0xbc')],'as':_0x0a07('0xbd'),'attributes':['id','name',_0x0a07('0xbe')],'where':_0x23c445[_0x0a07('0x4a')][_0x0a07('0xbf')]?{'id':_0x23c445[_0x0a07('0x4a')][_0x0a07('0xbf')]}:undefined,'required':_0x23c445['query'][_0x0a07('0xbf')]?!![]:![]}];}if(!_0x23c445['query'][_0x0a07('0xb8')](_0x0a07('0xc0'))){_0x5596f9[_0x0a07('0x31')]=qs[_0x0a07('0x31')](_0x23c445['query'][_0x0a07('0x31')]);_0x5596f9[_0x0a07('0x30')]=qs['offset'](_0x23c445[_0x0a07('0x4a')][_0x0a07('0x30')]);}return _0x261474[_0x0a07('0xb5')](_0x5596f9);}})['then'](function(_0x4a337c){if(_0x4a337c){return _0x4a337c?{'count':_0x1155df,'rows':_0x4a337c}:null;}})[_0x0a07('0x22')](respondWithResult(_0x10e13e,null))[_0x0a07('0x2c')](handleError(_0x10e13e,null));};exports['getQueues']=function(_0x447163,_0x284394,_0x3d93b6){var _0x25e87c;var _0x19fe9c;var _0x3d3459={};var _0xe57d03;return db['User'][_0x0a07('0x8d')]({'where':{'id':_0x447163['params']['id']},'attributes':['id','name',_0x0a07('0x3d')]})[_0x0a07('0x22')](handleEntityNotFound(_0x284394,null))['then'](function(_0x4b9989){if(!utils[_0x0a07('0x9a')](_0x447163['query'][_0x0a07('0x97')])){throw new db[(_0x0a07('0x1e'))]['ValidationError'](_0x0a07('0xaa'));}_0x25e87c=_0x4b9989;var _0xf86183={};_0xf86183[_0x0a07('0x47')]=_[_0x0a07('0x49')](db[_[_0x0a07('0x9b')](_0x447163['query'][_0x0a07('0x97')])+'Queue']['rawAttributes']);_0xf86183[_0x0a07('0x4a')]=_['keys'](_0x447163[_0x0a07('0x4a')]);_0xf86183[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0xf86183[_0x0a07('0x47')],_0xf86183[_0x0a07('0x4a')]);_0x3d3459['attributes']=_[_0x0a07('0x4c')](_0xf86183[_0x0a07('0x47')],qs['fields'](_0x447163[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x3d3459[_0x0a07('0x4b')]=_0x3d3459['attributes'][_0x0a07('0x4e')]?_0x3d3459['attributes']:_0xf86183['model'];_0x3d3459['order']=qs['sort'](_0x447163[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x3d3459[_0x0a07('0x50')]=qs['filters'](_[_0x0a07('0x52')](_0x447163[_0x0a07('0x4a')],_0xf86183[_0x0a07('0x51')]));if(_0x447163[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x3d3459['where']=_['merge'](_0x3d3459[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x3d3459['attributes'],function(_0x228950){var _0x284e86={};_0x284e86[_0x228950]={'$like':'%'+_0x447163[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x284e86;})});}_0x3d3459=_['merge']({},_0x3d3459,_0x447163['options']);switch(_0x25e87c[_0x0a07('0x3d')]){case _0x0a07('0x94'):return db[_[_0x0a07('0x9b')](_0x447163[_0x0a07('0x4a')][_0x0a07('0x97')])+_0x0a07('0xc1')][_0x0a07('0xa2')](_0x3d3459);case'user':case _0x0a07('0x62'):return _0x25e87c['get'+_[_0x0a07('0x9b')](_0x447163[_0x0a07('0x4a')][_0x0a07('0x97')])+_0x0a07('0xac')](_0x3d3459);default:throw new db['Sequelize'][(_0x0a07('0x1f'))](_0x0a07('0xc2'));}})[_0x0a07('0x22')](function(_0x438c7f){_0xe57d03=_0x438c7f[_0x0a07('0x4e')];if(!_0x447163[_0x0a07('0x4a')][_0x0a07('0xb8')](_0x0a07('0xc0'))){_0x3d3459[_0x0a07('0x31')]=qs[_0x0a07('0x31')](_0x447163[_0x0a07('0x4a')][_0x0a07('0x31')]);_0x3d3459[_0x0a07('0x30')]=qs[_0x0a07('0x30')](_0x447163[_0x0a07('0x4a')]['offset']);}switch(_0x25e87c[_0x0a07('0x3d')]){case _0x0a07('0x94'):return db[_[_0x0a07('0x9b')](_0x447163[_0x0a07('0x4a')][_0x0a07('0x97')])+_0x0a07('0xc1')]['findAll'](_0x3d3459);case _0x0a07('0x85'):case _0x0a07('0x62'):return _0x25e87c[_0x0a07('0x37')+_[_0x0a07('0x9b')](_0x447163[_0x0a07('0x4a')][_0x0a07('0x97')])+_0x0a07('0xac')](_0x3d3459);}})['then'](function(_0x51fcf6){return{'count':_0xe57d03,'rows':_0x51fcf6};})[_0x0a07('0x22')](respondWithResult(_0x284394,null))[_0x0a07('0x2c')](handleError(_0x284394,null));};exports[_0x0a07('0xc3')]=function(_0x136029,_0x51e06c,_0xef9c1e){var _0x1aad8e={};var _0x16f821={};var _0x141361;var _0x3da07e;return db[_0x0a07('0x43')][_0x0a07('0x8d')]({'where':{'id':_0x136029[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x51e06c,null))[_0x0a07('0x22')](function(_0x354864){if(_0x354864){_0x141361=_0x354864;_0x16f821[_0x0a07('0x47')]=_['keys'](db['UserVoiceQueueRt'][_0x0a07('0x44')]);_0x16f821[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x136029[_0x0a07('0x4a')]);_0x16f821[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x16f821[_0x0a07('0x47')],_0x16f821[_0x0a07('0x4a')]);_0x1aad8e[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0x16f821[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x136029['query'][_0x0a07('0x4d')]));_0x1aad8e['attributes']=_0x1aad8e[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x1aad8e[_0x0a07('0x4b')]:_0x16f821[_0x0a07('0x47')];_0x1aad8e[_0x0a07('0xb7')]=qs[_0x0a07('0x4f')](_0x136029['query'][_0x0a07('0x4f')]);_0x1aad8e[_0x0a07('0x50')]=qs[_0x0a07('0x51')](_['pick'](_0x136029[_0x0a07('0x4a')],_0x16f821['filters']));if(_0x136029[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x1aad8e[_0x0a07('0x50')]=_['merge'](_0x1aad8e[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x1aad8e['attributes'],function(_0x1a37be){var _0x2d0a94={};_0x2d0a94[_0x1a37be]={'$like':'%'+_0x136029[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x2d0a94;})});}_0x1aad8e=_[_0x0a07('0x53')]({},_0x1aad8e,_0x136029[_0x0a07('0x58')]);return _0x141361[_0x0a07('0xc3')](_0x1aad8e);}})[_0x0a07('0x22')](function(_0x1251a5){if(_0x1251a5){_0x3da07e=_0x1251a5[_0x0a07('0x4e')];if(!_0x136029[_0x0a07('0x4a')][_0x0a07('0xb8')](_0x0a07('0xc0'))){_0x1aad8e[_0x0a07('0x31')]=qs[_0x0a07('0x31')](_0x136029[_0x0a07('0x4a')]['limit']);_0x1aad8e[_0x0a07('0x30')]=qs['offset'](_0x136029[_0x0a07('0x4a')][_0x0a07('0x30')]);}return _0x141361['getVoiceQueuesRt'](_0x1aad8e);}})['then'](function(_0x256f3a){if(_0x256f3a){return _0x256f3a?{'count':_0x3da07e,'rows':_0x256f3a}:null;}})[_0x0a07('0x22')](respondWithResult(_0x51e06c,null))[_0x0a07('0x2c')](handleError(_0x51e06c,null));};exports[_0x0a07('0xc4')]=function(_0x164764,_0x533af7,_0x2854e6){var _0x21a3ca={};var _0x27fa1b={};var _0x153cca;var _0x2a97f0;return db['User'][_0x0a07('0x8d')]({'where':{'id':_0x164764[_0x0a07('0x5b')]['id']}})['then'](handleEntityNotFound(_0x533af7,null))[_0x0a07('0x22')](function(_0x441f38){if(_0x441f38){_0x153cca=_0x441f38;_0x27fa1b[_0x0a07('0x47')]=_[_0x0a07('0x49')](db[_0x0a07('0xc5')][_0x0a07('0x44')]);_0x27fa1b[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x164764['query']);_0x27fa1b[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x27fa1b[_0x0a07('0x47')],_0x27fa1b[_0x0a07('0x4a')]);_0x21a3ca['attributes']=_[_0x0a07('0x4c')](_0x27fa1b['model'],qs[_0x0a07('0x4d')](_0x164764[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x21a3ca[_0x0a07('0x4b')]=_0x21a3ca['attributes'][_0x0a07('0x4e')]?_0x21a3ca[_0x0a07('0x4b')]:_0x27fa1b[_0x0a07('0x47')];_0x21a3ca[_0x0a07('0xb7')]=qs[_0x0a07('0x4f')](_0x164764[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x21a3ca[_0x0a07('0x50')]=qs[_0x0a07('0x51')](_['pick'](_0x164764[_0x0a07('0x4a')],_0x27fa1b[_0x0a07('0x51')]));if(_0x164764['query']['filter']){_0x21a3ca['where']=_[_0x0a07('0x53')](_0x21a3ca[_0x0a07('0x50')],{'$or':_['map'](_0x21a3ca[_0x0a07('0x4b')],function(_0x32f1ec){var _0x166926={};_0x166926[_0x32f1ec]={'$like':'%'+_0x164764[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x166926;})});}_0x21a3ca=_[_0x0a07('0x53')]({},_0x21a3ca,_0x164764[_0x0a07('0x58')]);return _0x153cca[_0x0a07('0xc4')](_0x21a3ca);}})[_0x0a07('0x22')](function(_0x43fac5){if(_0x43fac5){_0x2a97f0=_0x43fac5[_0x0a07('0x4e')];if(!_0x164764['query'][_0x0a07('0xb8')]('nolimit')){_0x21a3ca[_0x0a07('0x31')]=qs[_0x0a07('0x31')](_0x164764['query'][_0x0a07('0x31')]);_0x21a3ca[_0x0a07('0x30')]=qs['offset'](_0x164764[_0x0a07('0x4a')][_0x0a07('0x30')]);}return _0x153cca[_0x0a07('0xc4')](_0x21a3ca);}})[_0x0a07('0x22')](function(_0x571168){if(_0x571168){return _0x571168?{'count':_0x2a97f0,'rows':_0x571168}:null;}})[_0x0a07('0x22')](respondWithResult(_0x533af7,null))[_0x0a07('0x2c')](handleError(_0x533af7,null));};exports['getRecordings']=function(_0x24b407,_0x10250b,_0x368094){var _0x524020={'raw':!![],'where':{}};var _0x11cad7={};var _0xe36ef9={'count':0x0,'rows':[]};return db[_0x0a07('0x43')][_0x0a07('0x8d')]({'where':{'id':_0x24b407[_0x0a07('0x5b')]['id']}})['then'](handleEntityNotFound(_0x10250b,null))['then'](function(_0x588378){if(_0x588378){_0x11cad7[_0x0a07('0x47')]=_[_0x0a07('0x49')](db[_0x0a07('0xc6')][_0x0a07('0x44')]);_0x11cad7[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x24b407['query']);_0x11cad7[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x11cad7['model'],_0x11cad7['query']);_0x524020[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0x11cad7[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x24b407[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x524020['attributes']=_0x524020[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x524020['attributes']:_0x11cad7[_0x0a07('0x47')];if(!_0x24b407['query'][_0x0a07('0xb8')](_0x0a07('0xc0'))){_0x524020[_0x0a07('0x31')]=qs[_0x0a07('0x31')](_0x24b407[_0x0a07('0x4a')][_0x0a07('0x31')]);_0x524020[_0x0a07('0x30')]=qs['offset'](_0x24b407[_0x0a07('0x4a')][_0x0a07('0x30')]);}_0x524020['order']=qs[_0x0a07('0x4f')](_0x24b407[_0x0a07('0x4a')]['sort']);_0x524020['where']=qs[_0x0a07('0x51')](_['pick'](_0x24b407[_0x0a07('0x4a')],_0x11cad7['filters']));_0x524020[_0x0a07('0x50')][_0x0a07('0xc7')]=_0x588378['id'];if(_0x24b407[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x524020[_0x0a07('0x50')]=_['merge'](_0x524020['where'],{'$or':_['map'](_0x524020[_0x0a07('0x4b')],function(_0x50df24){var _0x53f5e4={};_0x53f5e4[_0x50df24]={'$like':'%'+_0x24b407[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x53f5e4;})});}_0x524020=_[_0x0a07('0x53')]({},_0x524020,_0x24b407[_0x0a07('0x58')]);return db[_0x0a07('0xc6')][_0x0a07('0x2f')]({'where':_0x524020[_0x0a07('0x50')]})[_0x0a07('0x22')](function(_0x943062){_0xe36ef9[_0x0a07('0x2f')]=_0x943062;if(_0x24b407[_0x0a07('0x4a')][_0x0a07('0x59')]){_0x524020['include']=[{'all':!![]}];}return db[_0x0a07('0xc6')][_0x0a07('0xa2')](_0x524020);})[_0x0a07('0x22')](function(_0x33a0b7){_0xe36ef9[_0x0a07('0xc8')]=_0x33a0b7;return _0xe36ef9;});}})[_0x0a07('0x22')](respondWithFilteredResult(_0x10250b,_0x524020))[_0x0a07('0x2c')](handleError(_0x10250b,null));};exports[_0x0a07('0xc9')]=function(_0x4d649d,_0x37019a,_0x30e534){var _0x3569cf={'raw':!![],'where':{}};var _0x2003bb={};var _0x257dad={'count':0x0,'rows':[]};return db[_0x0a07('0x43')][_0x0a07('0x8d')]({'where':{'id':_0x4d649d[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x37019a,null))[_0x0a07('0x22')](function(_0x301a96){if(_0x301a96){_0x2003bb['model']=_[_0x0a07('0x49')](db[_0x0a07('0xca')]['rawAttributes']);_0x2003bb[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x4d649d[_0x0a07('0x4a')]);_0x2003bb[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x2003bb[_0x0a07('0x47')],_0x2003bb['query']);_0x3569cf[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0x2003bb[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x4d649d[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x3569cf['attributes']=_0x3569cf[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x3569cf[_0x0a07('0x4b')]:_0x2003bb[_0x0a07('0x47')];if(!_0x4d649d['query'][_0x0a07('0xb8')]('nolimit')){_0x3569cf['limit']=qs[_0x0a07('0x31')](_0x4d649d[_0x0a07('0x4a')][_0x0a07('0x31')]);_0x3569cf[_0x0a07('0x30')]=qs[_0x0a07('0x30')](_0x4d649d['query'][_0x0a07('0x30')]);}_0x3569cf[_0x0a07('0xb7')]=qs[_0x0a07('0x4f')](_0x4d649d[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x3569cf[_0x0a07('0x50')]=qs['filters'](_[_0x0a07('0x52')](_0x4d649d[_0x0a07('0x4a')],_0x2003bb[_0x0a07('0x51')]));_0x3569cf['where'][_0x0a07('0xc7')]=_0x301a96['id'];if(_0x4d649d[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x3569cf[_0x0a07('0x50')]=_[_0x0a07('0x53')](_0x3569cf[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x3569cf[_0x0a07('0x4b')],function(_0x4ffa4b){var _0x4b5bec={};_0x4b5bec[_0x4ffa4b]={'$like':'%'+_0x4d649d[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x4b5bec;})});}_0x3569cf=_[_0x0a07('0x53')]({},_0x3569cf,_0x4d649d[_0x0a07('0x58')]);return db[_0x0a07('0xca')][_0x0a07('0x2f')]({'where':_0x3569cf['where']})[_0x0a07('0x22')](function(_0x9bfd3b){_0x257dad[_0x0a07('0x2f')]=_0x9bfd3b;if(_0x4d649d[_0x0a07('0x4a')]['includeAll']){_0x3569cf[_0x0a07('0xb9')]=[{'all':!![]}];}return db[_0x0a07('0xca')][_0x0a07('0xa2')](_0x3569cf);})[_0x0a07('0x22')](function(_0x65125f){_0x257dad[_0x0a07('0xc8')]=_0x65125f;return _0x257dad;});}})[_0x0a07('0x22')](respondWithFilteredResult(_0x37019a,_0x3569cf))[_0x0a07('0x2c')](handleError(_0x37019a,null));};exports[_0x0a07('0xcb')]=function(_0x3fffc0,_0x11815c,_0x165056){var _0x1396d2={};var _0x2f9faa={};var _0x9509cf;var _0x4bce08;return db['User'][_0x0a07('0x8d')]({'where':{'id':_0x3fffc0[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x11815c,null))['then'](function(_0x37d8f7){if(_0x37d8f7){_0x9509cf=_0x37d8f7;_0x2f9faa[_0x0a07('0x47')]=_[_0x0a07('0x49')](db[_0x0a07('0xcc')][_0x0a07('0x44')]);_0x2f9faa[_0x0a07('0x4a')]=_['keys'](_0x3fffc0[_0x0a07('0x4a')]);_0x2f9faa[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x2f9faa['model'],_0x2f9faa['query']);_0x1396d2['attributes']=_[_0x0a07('0x4c')](_0x2f9faa['model'],qs[_0x0a07('0x4d')](_0x3fffc0[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x1396d2['attributes']=_0x1396d2[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x1396d2[_0x0a07('0x4b')]:_0x2f9faa[_0x0a07('0x47')];_0x1396d2[_0x0a07('0xb7')]=qs[_0x0a07('0x4f')](_0x3fffc0[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x1396d2[_0x0a07('0x50')]=qs['filters'](_[_0x0a07('0x52')](_0x3fffc0[_0x0a07('0x4a')],_0x2f9faa[_0x0a07('0x51')]));if(_0x3fffc0[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x1396d2['where']=_[_0x0a07('0x53')](_0x1396d2[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x1396d2[_0x0a07('0x4b')],function(_0x45a05e){var _0x2843a7={};_0x2843a7[_0x45a05e]={'$like':'%'+_0x3fffc0['query'][_0x0a07('0x39')]+'%'};return _0x2843a7;})});}_0x1396d2=_[_0x0a07('0x53')]({},_0x1396d2,_0x3fffc0[_0x0a07('0x58')]);return _0x9509cf['getChatInteractions'](_0x1396d2);}})['then'](function(_0x4f885f){if(_0x4f885f){_0x4bce08=_0x4f885f['length'];if(!_0x3fffc0['query'][_0x0a07('0xb8')]('nolimit')){_0x1396d2[_0x0a07('0x31')]=qs[_0x0a07('0x31')](_0x3fffc0[_0x0a07('0x4a')][_0x0a07('0x31')]);_0x1396d2[_0x0a07('0x30')]=qs[_0x0a07('0x30')](_0x3fffc0[_0x0a07('0x4a')][_0x0a07('0x30')]);}return _0x9509cf[_0x0a07('0xcb')](_0x1396d2);}})[_0x0a07('0x22')](function(_0x239809){if(_0x239809){return _0x239809?{'count':_0x4bce08,'rows':_0x239809}:null;}})['then'](respondWithResult(_0x11815c,null))[_0x0a07('0x2c')](handleError(_0x11815c,null));};exports[_0x0a07('0xcd')]=function(_0xbc4393,_0x4622ff,_0x5180f1){var _0xb8aea1={};var _0x98d54a={};var _0x38233b;var _0x4ba09e;return db['User'][_0x0a07('0x8d')]({'where':{'id':_0xbc4393['params']['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x4622ff,null))[_0x0a07('0x22')](function(_0x608574){if(_0x608574){_0x38233b=_0x608574;_0x98d54a['model']=_[_0x0a07('0x49')](db['OpenchannelInteraction'][_0x0a07('0x44')]);_0x98d54a[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0xbc4393[_0x0a07('0x4a')]);_0x98d54a[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x98d54a[_0x0a07('0x47')],_0x98d54a[_0x0a07('0x4a')]);_0xb8aea1['attributes']=_[_0x0a07('0x4c')](_0x98d54a['model'],qs[_0x0a07('0x4d')](_0xbc4393[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0xb8aea1[_0x0a07('0x4b')]=_0xb8aea1[_0x0a07('0x4b')]['length']?_0xb8aea1['attributes']:_0x98d54a[_0x0a07('0x47')];_0xb8aea1[_0x0a07('0xb7')]=qs['sort'](_0xbc4393[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0xb8aea1[_0x0a07('0x50')]=qs[_0x0a07('0x51')](_[_0x0a07('0x52')](_0xbc4393['query'],_0x98d54a[_0x0a07('0x51')]));if(_0xbc4393[_0x0a07('0x4a')][_0x0a07('0x39')]){_0xb8aea1['where']=_[_0x0a07('0x53')](_0xb8aea1[_0x0a07('0x50')],{'$or':_['map'](_0xb8aea1['attributes'],function(_0x453264){var _0x52b0c9={};_0x52b0c9[_0x453264]={'$like':'%'+_0xbc4393[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x52b0c9;})});}_0xb8aea1=_[_0x0a07('0x53')]({},_0xb8aea1,_0xbc4393[_0x0a07('0x58')]);return _0x38233b['getOpenchannelInteractions'](_0xb8aea1);}})[_0x0a07('0x22')](function(_0x3deebc){if(_0x3deebc){_0x4ba09e=_0x3deebc['length'];if(!_0xbc4393[_0x0a07('0x4a')]['hasOwnProperty'](_0x0a07('0xc0'))){_0xb8aea1[_0x0a07('0x31')]=qs['limit'](_0xbc4393[_0x0a07('0x4a')][_0x0a07('0x31')]);_0xb8aea1[_0x0a07('0x30')]=qs['offset'](_0xbc4393[_0x0a07('0x4a')][_0x0a07('0x30')]);}return _0x38233b['getOpenchannelInteractions'](_0xb8aea1);}})[_0x0a07('0x22')](function(_0x1ff029){if(_0x1ff029){return _0x1ff029?{'count':_0x4ba09e,'rows':_0x1ff029}:null;}})['then'](respondWithResult(_0x4622ff,null))['catch'](handleError(_0x4622ff,null));};exports[_0x0a07('0xce')]=function(_0x2c26a4,_0x390d57,_0xd5ab07){var _0x3204db={'raw':!![],'where':{}};var _0x53fe54={};var _0x49f114={'count':0x0,'rows':[]};return db[_0x0a07('0x43')][_0x0a07('0x8d')]({'where':{'id':_0x2c26a4[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x390d57,null))['then'](function(_0x1de380){if(_0x1de380){_0x53fe54[_0x0a07('0x47')]=_['keys'](db['MailInteraction'][_0x0a07('0x44')]);_0x53fe54[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x2c26a4[_0x0a07('0x4a')]);_0x53fe54[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x53fe54[_0x0a07('0x47')],_0x53fe54[_0x0a07('0x4a')]);_0x3204db[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0x53fe54[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x2c26a4[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x3204db[_0x0a07('0x4b')]=_0x3204db[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x3204db[_0x0a07('0x4b')]:_0x53fe54[_0x0a07('0x47')];if(!_0x2c26a4['query']['hasOwnProperty']('nolimit')){_0x3204db['limit']=qs[_0x0a07('0x31')](_0x2c26a4[_0x0a07('0x4a')][_0x0a07('0x31')]);_0x3204db[_0x0a07('0x30')]=qs['offset'](_0x2c26a4[_0x0a07('0x4a')][_0x0a07('0x30')]);}_0x3204db[_0x0a07('0xb7')]=qs[_0x0a07('0x4f')](_0x2c26a4[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x3204db[_0x0a07('0x50')]=qs['filters'](_[_0x0a07('0x52')](_0x2c26a4[_0x0a07('0x4a')],_0x53fe54[_0x0a07('0x51')]));_0x3204db[_0x0a07('0x50')][_0x0a07('0xc7')]=_0x1de380['id'];if(_0x2c26a4[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x3204db[_0x0a07('0x50')]=_[_0x0a07('0x53')](_0x3204db[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x3204db[_0x0a07('0x4b')],function(_0x47c130){var _0x47b0ea={};_0x47b0ea[_0x47c130]={'$like':'%'+_0x2c26a4[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x47b0ea;})});}_0x3204db=_['merge']({},_0x3204db,_0x2c26a4[_0x0a07('0x58')]);return db[_0x0a07('0xcf')]['count']({'where':_0x3204db[_0x0a07('0x50')]})['then'](function(_0x17778c){_0x49f114[_0x0a07('0x2f')]=_0x17778c;if(_0x2c26a4[_0x0a07('0x4a')][_0x0a07('0x59')]){_0x3204db[_0x0a07('0xb9')]=[{'all':!![]}];}return db[_0x0a07('0xcf')]['findAll'](_0x3204db);})[_0x0a07('0x22')](function(_0x300621){_0x49f114[_0x0a07('0xc8')]=_0x300621;return _0x49f114;});}})['then'](respondWithFilteredResult(_0x390d57,_0x3204db))[_0x0a07('0x2c')](handleError(_0x390d57,null));};exports[_0x0a07('0xd0')]=function(_0x5c9542,_0x28e59e,_0x3cda3f){var _0x42072f={};var _0x49b52f={};var _0x4be8e5;var _0x2c0a1e;return db[_0x0a07('0x43')][_0x0a07('0x8d')]({'where':{'id':_0x5c9542['params']['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x28e59e,null))[_0x0a07('0x22')](function(_0x37e5a8){if(_0x37e5a8){_0x4be8e5=_0x37e5a8;_0x49b52f[_0x0a07('0x47')]=_[_0x0a07('0x49')](db['SmsInteraction'][_0x0a07('0x44')]);_0x49b52f[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x5c9542[_0x0a07('0x4a')]);_0x49b52f['filters']=_[_0x0a07('0x4c')](_0x49b52f[_0x0a07('0x47')],_0x49b52f[_0x0a07('0x4a')]);_0x42072f['attributes']=_[_0x0a07('0x4c')](_0x49b52f[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x5c9542['query'][_0x0a07('0x4d')]));_0x42072f[_0x0a07('0x4b')]=_0x42072f[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x42072f['attributes']:_0x49b52f[_0x0a07('0x47')];_0x42072f[_0x0a07('0xb7')]=qs[_0x0a07('0x4f')](_0x5c9542[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x42072f[_0x0a07('0x50')]=qs['filters'](_[_0x0a07('0x52')](_0x5c9542[_0x0a07('0x4a')],_0x49b52f[_0x0a07('0x51')]));if(_0x5c9542[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x42072f[_0x0a07('0x50')]=_[_0x0a07('0x53')](_0x42072f[_0x0a07('0x50')],{'$or':_['map'](_0x42072f[_0x0a07('0x4b')],function(_0x3e0439){var _0x361a35={};_0x361a35[_0x3e0439]={'$like':'%'+_0x5c9542[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x361a35;})});}_0x42072f=_['merge']({},_0x42072f,_0x5c9542['options']);return _0x4be8e5[_0x0a07('0xd0')](_0x42072f);}})[_0x0a07('0x22')](function(_0x215179){if(_0x215179){_0x2c0a1e=_0x215179[_0x0a07('0x4e')];if(!_0x5c9542[_0x0a07('0x4a')]['hasOwnProperty'](_0x0a07('0xc0'))){_0x42072f['limit']=qs[_0x0a07('0x31')](_0x5c9542['query'][_0x0a07('0x31')]);_0x42072f['offset']=qs[_0x0a07('0x30')](_0x5c9542[_0x0a07('0x4a')]['offset']);}return _0x4be8e5[_0x0a07('0xd0')](_0x42072f);}})[_0x0a07('0x22')](function(_0x5dd141){if(_0x5dd141){return _0x5dd141?{'count':_0x2c0a1e,'rows':_0x5dd141}:null;}})['then'](respondWithResult(_0x28e59e,null))[_0x0a07('0x2c')](handleError(_0x28e59e,null));};exports[_0x0a07('0xd1')]=function(_0x260526,_0x2af3ff,_0x60104e){var _0x2335bc={};var _0x512b77={};var _0x5329ba;var _0x2db98f;return db[_0x0a07('0x43')][_0x0a07('0x8d')]({'where':{'id':_0x260526[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x2af3ff,null))['then'](function(_0x49fc37){if(_0x49fc37){_0x5329ba=_0x49fc37;_0x512b77['model']=_[_0x0a07('0x49')](db[_0x0a07('0xd2')][_0x0a07('0x44')]);_0x512b77[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x260526[_0x0a07('0x4a')]);_0x512b77[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x512b77[_0x0a07('0x47')],_0x512b77['query']);_0x2335bc['attributes']=_[_0x0a07('0x4c')](_0x512b77['model'],qs['fields'](_0x260526[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x2335bc[_0x0a07('0x4b')]=_0x2335bc[_0x0a07('0x4b')]['length']?_0x2335bc[_0x0a07('0x4b')]:_0x512b77[_0x0a07('0x47')];_0x2335bc[_0x0a07('0xb7')]=qs['sort'](_0x260526['query'][_0x0a07('0x4f')]);_0x2335bc[_0x0a07('0x50')]=qs[_0x0a07('0x51')](_[_0x0a07('0x52')](_0x260526[_0x0a07('0x4a')],_0x512b77[_0x0a07('0x51')]));if(_0x260526[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x2335bc['where']=_[_0x0a07('0x53')](_0x2335bc[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x2335bc[_0x0a07('0x4b')],function(_0x3c50b2){var _0x4a6c3d={};_0x4a6c3d[_0x3c50b2]={'$like':'%'+_0x260526[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x4a6c3d;})});}_0x2335bc=_[_0x0a07('0x53')]({},_0x2335bc,_0x260526[_0x0a07('0x58')]);return _0x5329ba[_0x0a07('0xd1')](_0x2335bc);}})[_0x0a07('0x22')](function(_0x4901ce){if(_0x4901ce){_0x2db98f=_0x4901ce[_0x0a07('0x4e')];if(!_0x260526[_0x0a07('0x4a')][_0x0a07('0xb8')](_0x0a07('0xc0'))){_0x2335bc['limit']=qs[_0x0a07('0x31')](_0x260526[_0x0a07('0x4a')][_0x0a07('0x31')]);_0x2335bc[_0x0a07('0x30')]=qs['offset'](_0x260526[_0x0a07('0x4a')]['offset']);}return _0x5329ba[_0x0a07('0xd1')](_0x2335bc);}})['then'](function(_0x455603){if(_0x455603){return _0x455603?{'count':_0x2db98f,'rows':_0x455603}:null;}})['then'](respondWithResult(_0x2af3ff,null))[_0x0a07('0x2c')](handleError(_0x2af3ff,null));};exports['getWhatsappInteractions']=function(_0x1d2804,_0x36ee83,_0x3b7dab){var _0x4da7f0={};var _0x38573d={};var _0x575244;var _0x412b78;return db['User'][_0x0a07('0x8d')]({'where':{'id':_0x1d2804[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x36ee83,null))[_0x0a07('0x22')](function(_0x2cf84d){if(_0x2cf84d){_0x575244=_0x2cf84d;_0x38573d[_0x0a07('0x47')]=_[_0x0a07('0x49')](db[_0x0a07('0xd3')][_0x0a07('0x44')]);_0x38573d[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x1d2804[_0x0a07('0x4a')]);_0x38573d['filters']=_[_0x0a07('0x4c')](_0x38573d['model'],_0x38573d['query']);_0x4da7f0[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0x38573d['model'],qs['fields'](_0x1d2804[_0x0a07('0x4a')]['fields']));_0x4da7f0[_0x0a07('0x4b')]=_0x4da7f0[_0x0a07('0x4b')]['length']?_0x4da7f0['attributes']:_0x38573d[_0x0a07('0x47')];_0x4da7f0[_0x0a07('0xb7')]=qs[_0x0a07('0x4f')](_0x1d2804[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x4da7f0[_0x0a07('0x50')]=qs[_0x0a07('0x51')](_[_0x0a07('0x52')](_0x1d2804[_0x0a07('0x4a')],_0x38573d['filters']));if(_0x1d2804[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x4da7f0['where']=_[_0x0a07('0x53')](_0x4da7f0[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x4da7f0[_0x0a07('0x4b')],function(_0x5b20e6){var _0x1cb252={};_0x1cb252[_0x5b20e6]={'$like':'%'+_0x1d2804[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x1cb252;})});}_0x4da7f0=_[_0x0a07('0x53')]({},_0x4da7f0,_0x1d2804[_0x0a07('0x58')]);return _0x575244[_0x0a07('0xd4')](_0x4da7f0);}})[_0x0a07('0x22')](function(_0x5e0f4b){if(_0x5e0f4b){_0x412b78=_0x5e0f4b[_0x0a07('0x4e')];if(!_0x1d2804['query'][_0x0a07('0xb8')](_0x0a07('0xc0'))){_0x4da7f0[_0x0a07('0x31')]=qs[_0x0a07('0x31')](_0x1d2804[_0x0a07('0x4a')][_0x0a07('0x31')]);_0x4da7f0[_0x0a07('0x30')]=qs[_0x0a07('0x30')](_0x1d2804[_0x0a07('0x4a')][_0x0a07('0x30')]);}return _0x575244[_0x0a07('0xd4')](_0x4da7f0);}})[_0x0a07('0x22')](function(_0x46db5f){if(_0x46db5f){return _0x46db5f?{'count':_0x412b78,'rows':_0x46db5f}:null;}})[_0x0a07('0x22')](respondWithResult(_0x36ee83,null))[_0x0a07('0x2c')](handleError(_0x36ee83,null));};exports[_0x0a07('0xd5')]=function(_0x3f02bf,_0x3e2e02,_0x4ffd41){var _0x3d05d8;var _0x131abe;var _0x524a03;var _0x22c32a=!_[_0x0a07('0x67')](_0x3f02bf[_0x0a07('0x5b')]['id'])?_0x3f02bf[_0x0a07('0x5b')]['id']:!_[_0x0a07('0x67')](_0x3f02bf[_0x0a07('0x85')]['id'])?_0x3f02bf[_0x0a07('0x85')]['id']:null;return db[_0x0a07('0x43')][_0x0a07('0x3e')]({'where':{'id':_0x22c32a,'role':{'$or':[_0x0a07('0x94'),'user',_0x0a07('0x62')]}},'attributes':['id','name',_0x0a07('0xd6'),'mobile',_0x0a07('0x3d'),_0x0a07('0x6b'),_0x0a07('0xd7')]})['then'](function(_0x3d6850){if(_0x3d6850){if(_0x3d6850[_0x0a07('0x3d')]===_0x0a07('0x62')){_0x3d05d8=_0x3d6850;if(_0x3f02bf['body'][_0x0a07('0x99')]){_0x524a03=util['format'](_0x0a07('0xd8'),_0x3d05d8[_0x3f02bf['body']['interface']]);}else if(_0x3f02bf[_0x0a07('0x5d')][_0x0a07('0xd9')]){_0x524a03=util[_0x0a07('0x69')](_0x0a07('0xa5'),_0x3f02bf[_0x0a07('0x5d')][_0x0a07('0xd9')]);}else{_0x524a03=util[_0x0a07('0x69')](_0x0a07('0xa5'),_0x3d05d8[_0x0a07('0x3f')]);}socket['to'](util[_0x0a07('0x69')](_0x0a07('0xda'),_0x3d05d8['name']))['emit'](_0x0a07('0xdb'),{'ip':_0x3f02bf['headers'][_0x0a07('0xdc')]||_0x3f02bf['connection'][_0x0a07('0xdd')]||_0x3f02bf['socket'][_0x0a07('0xdd')]||_0x3f02bf[_0x0a07('0xde')][_0x0a07('0xdf')][_0x0a07('0xdd')]});return db[_0x0a07('0xa7')][_0x0a07('0x36')]({'where':{'membername':_0x3d05d8[_0x0a07('0x3f')]},'individualHooks':!![]});}}else{throw new db[(_0x0a07('0x1e'))]['ValidationError'](_0x0a07('0xe0'));}})['then'](function(){if(_0x3d05d8){return _0x3d05d8[_0x0a07('0xe1')]({'raw':!![]});}})['then'](function(_0x56e51e){if(_0x3d05d8){var _0x3232cf=[];if(_0x56e51e){_0x131abe=_0x56e51e;if(_0x131abe[_0x0a07('0x4e')]){for(var _0x12c6fa=0x0;_0x12c6fa<_0x131abe[_0x0a07('0x4e')];_0x12c6fa++){_0x3232cf[_0x0a07('0xa4')]({'membername':_0x3d05d8[_0x0a07('0x3f')],'UserId':_0x3d05d8['id'],'queue_name':_0x131abe[_0x12c6fa]['name'],'VoiceQueueId':_0x131abe[_0x12c6fa]['id'],'interface':_0x524a03,'paused':_0x3d05d8[_0x0a07('0xd7')]||![],'penalty':_0x131abe[_0x12c6fa][_0x0a07('0xe2')]||0x0});}return BPromise[_0x0a07('0xa6')](_0x3232cf,function(_0x4cc317){return db[_0x0a07('0xa7')]['upsert'](_0x4cc317);});}}}})['then'](function(){if(_0x3d05d8){return db[_0x0a07('0xe3')][_0x0a07('0xa2')]({'where':{'membername':_0x3d05d8[_0x0a07('0x3f')],'exitAt':null}});}})[_0x0a07('0x22')](function(_0x226cb8){if(_0x3d05d8){var _0x14e5fd=[];_0x226cb8[_0x0a07('0xe4')](function(_0x104845){_0x14e5fd[_0x0a07('0xa4')](_0x104845[_0x0a07('0x35')]({'exitAt':moment()['format'](_0x0a07('0xe5'))}));});return BPromise['all'](_0x14e5fd);}})['then'](function(){if(_0x3d05d8){var _0x9cd797=[];var _0x523a35=[];var _0x4a876b=utils['getChannels']();var _0x1d7633={'membername':_0x3d05d8[_0x0a07('0x3f')],'interface':_0x524a03,'enterAt':moment()[_0x0a07('0x69')](_0x0a07('0xe5')),'role':_0x3d05d8[_0x0a07('0x3d')],'internal':_0x3d05d8[_0x0a07('0x6b')]};_0x4a876b[_0x0a07('0xe4')](function(_0x4d0d17){_0x9cd797[_0x0a07('0xa4')](_['merge']({'channel':_0x4d0d17,'type':_0x0a07('0xe6'),'data1':_0x3f02bf[_0x0a07('0x5d')]['device'],'data2':_0x524a03},_0x1d7633));if(_0x3d05d8['loginInPause']){_0x523a35[_0x0a07('0xa4')](_[_0x0a07('0x53')]({'channel':_0x4d0d17,'type':_0x0a07('0xe7'),'data1':_0x0a07('0xe8')},_0x1d7633));}});return db[_0x0a07('0xe3')]['bulkCreate'](_0x9cd797[_0x0a07('0xe9')](_0x523a35),{'individualHooks':!![]});}})[_0x0a07('0x22')](function(){if(_0x3d05d8){return _0x3d05d8[_0x0a07('0x35')]({'online':!![],'lastLoginAt':moment()[_0x0a07('0x69')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3d05d8['loginInPause']||![],'mailPause':_0x3d05d8[_0x0a07('0xd7')]||![],'chatPause':_0x3d05d8[_0x0a07('0xd7')]||![],'faxPause':_0x3d05d8[_0x0a07('0xd7')]||![],'smsPause':_0x3d05d8[_0x0a07('0xd7')]||![],'openchannelPause':_0x3d05d8[_0x0a07('0xd7')]||![],'whatsappPause':_0x3d05d8[_0x0a07('0xd7')]||![],'pauseType':_0x3d05d8[_0x0a07('0xd7')]?'LOGININPAUSE':null,'interface':_0x524a03,'lastPauseAt':moment()['format'](_0x0a07('0xe5'))});}})[_0x0a07('0x22')](function(_0x179c8){if(_0x3f02bf[_0x0a07('0xea')]){return _0x4ffd41();}else{return BPromise[_0x0a07('0xeb')](_0x179c8)[_0x0a07('0x22')](respondWithResult(_0x3e2e02,null));}})['catch'](handleError(_0x3e2e02,null));};exports[_0x0a07('0xec')]=function(_0x464fec,_0x32ddea,_0x46b85c){var _0x342e55;return db[_0x0a07('0x43')][_0x0a07('0x3e')]({'where':{'id':_0x464fec['params']['id'],'role':_0x0a07('0x62')},'attributes':['id',_0x0a07('0x3f'),'role']})['then'](handleEntityNotFound(_0x32ddea,null))[_0x0a07('0x22')](function(_0x2e7a04){if(_0x2e7a04){_0x342e55=_0x2e7a04;return db['UserVoiceQueueRt'][_0x0a07('0x36')]({'where':{'membername':_0x342e55['name']},'individualHooks':!![]});}})[_0x0a07('0x22')](function(){return db[_0x0a07('0xe3')][_0x0a07('0xa2')]({'where':{'membername':_0x342e55[_0x0a07('0x3f')],'exitAt':null}});})[_0x0a07('0x22')](function(_0x3eb4ea){var _0x376e5a=[];_0x3eb4ea['forEach'](function(_0x527ca8){_0x376e5a[_0x0a07('0xa4')](_0x527ca8[_0x0a07('0x35')]({'exitAt':moment()['format'](_0x0a07('0xe5'))}));});return BPromise[_0x0a07('0xed')](_0x376e5a);})['then'](function(){return _0x342e55[_0x0a07('0x35')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x32ddea,null))[_0x0a07('0x2c')](handleError(_0x32ddea,null));};exports['pause']=function(_0x509a24,_0x3e131e,_0x378814){var _0x406e42;return db[_0x0a07('0xa7')][_0x0a07('0x35')]({'paused':0x1},{'where':{'UserId':_0x509a24[_0x0a07('0x5b')]['id']},'individualHooks':!![]})[_0x0a07('0x22')](function(){return db[_0x0a07('0x43')][_0x0a07('0x3e')]({'where':{'id':_0x509a24[_0x0a07('0x5b')]['id'],'role':_0x0a07('0x62')},'attributes':['id',_0x0a07('0x3f'),_0x0a07('0x3d'),_0x0a07('0x6b'),_0x0a07('0x99')]});})['then'](handleEntityNotFound(_0x3e131e,null))[_0x0a07('0x22')](function(_0x331f6a){if(_0x331f6a){_0x406e42=_0x331f6a;return respondWithRpcPromise(_0x0a07('0xee'),_0x0a07('0xef'),{'id':_0x406e42['id'],'name':_0x406e42['name'],'pause':!![]});}})[_0x0a07('0x22')](function(){if(_0x406e42){return db['MemberReport']['findAll']({'where':{'membername':_0x406e42['name'],'type':_0x0a07('0xe7'),'exitAt':null}});}})['then'](function(_0x11931f){if(_0x11931f[_0x0a07('0x4e')]){var _0x3ac038=moment()[_0x0a07('0x69')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3c01a3=0x0,_0x370b80=_0x11931f['length'];_0x3c01a3<_0x370b80;_0x3c01a3++){_0x11931f[_0x3c01a3][_0x0a07('0xf0')]({'exitAt':_0x3ac038});}}})[_0x0a07('0x22')](function(){var _0x430fb0=[];var _0x45f18e=utils[_0x0a07('0xf1')]();_0x45f18e['forEach'](function(_0x580f5b){_0x430fb0['push']({'channel':_0x580f5b,'membername':_0x406e42[_0x0a07('0x3f')],'interface':_[_0x0a07('0x67')](_0x406e42[_0x0a07('0x99')])?util['format']('SIP/%s',_0x406e42[_0x0a07('0x3f')]):_0x406e42[_0x0a07('0x99')],'type':'PAUSE','enterAt':moment()[_0x0a07('0x69')](_0x0a07('0xe5')),'data1':_0x509a24[_0x0a07('0x5d')][_0x0a07('0x46')]||_0x0a07('0xf2'),'role':_0x406e42[_0x0a07('0x3d')],'internal':_0x406e42[_0x0a07('0x6b')]});});return db[_0x0a07('0xe3')][_0x0a07('0x5c')](_0x430fb0,{'individualHooks':!![]});})[_0x0a07('0x22')](function(){return _0x406e42[_0x0a07('0x35')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x509a24[_0x0a07('0x5d')][_0x0a07('0x46')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x0a07('0x69')](_0x0a07('0xe5'))});})[_0x0a07('0x22')](respondWithResult(_0x3e131e,null))[_0x0a07('0x2c')](handleError(_0x3e131e,null));};exports['unpause']=function(_0x40bf35,_0x8cd53b,_0x385918){var _0xbaed85;return db['User']['find']({'where':{'id':_0x40bf35[_0x0a07('0x5b')]['id']},'attributes':['id',_0x0a07('0x3f'),_0x0a07('0x3d'),'voicePause',_0x0a07('0xf3'),_0x0a07('0xf4'),_0x0a07('0xf5'),'openchannelPause',_0x0a07('0xf6'),_0x0a07('0xf7'),_0x0a07('0xf8'),_0x0a07('0xf9')]})['then'](handleEntityNotFound(_0x8cd53b,null))[_0x0a07('0x22')](function(_0x1ea8bd){if(_0x1ea8bd){_0xbaed85=_0x1ea8bd;if(_0x40bf35[_0x0a07('0x5d')]['channel']&&!utils['isValidChannel'](_0x40bf35['body']['channel'])){throw new db[(_0x0a07('0x1e'))][(_0x0a07('0x1f'))](_0x0a07('0xaa'));}switch(_0x40bf35[_0x0a07('0x5d')][_0x0a07('0x97')]){case _0x0a07('0xa1'):return respondWithRpcPromise(_0x0a07('0xee'),'unpause',{'id':_0xbaed85['id'],'name':_0xbaed85[_0x0a07('0x3f')],'pause':![]})['then'](function(){return db[_0x0a07('0xa7')][_0x0a07('0x35')]({'paused':0x0},{'where':{'UserId':_0xbaed85['id']},'individualHooks':!![]});})[_0x0a07('0x22')](function(){return db[_0x0a07('0xe3')][_0x0a07('0x3e')]({'where':{'channel':_0x40bf35['body']['channel'],'membername':_0xbaed85[_0x0a07('0x3f')],'type':_0x0a07('0xe7'),'exitAt':null}});})[_0x0a07('0x22')](function(_0x2ad6ba){if(_0x2ad6ba){return _0x2ad6ba[_0x0a07('0x35')]({'exitAt':moment()['format'](_0x0a07('0xe5')),'data2':_0x0a07('0xfa')},{'individualHooks':!![]});}return null;})[_0x0a07('0x22')](function(){return _0xbaed85['update']({'voicePause':![]});});case _0x0a07('0xfb'):case _0x0a07('0xfc'):case _0x0a07('0xfd'):case _0x0a07('0xfe'):case _0x0a07('0xff'):case'openchannel':return db[_0x0a07('0xe3')][_0x0a07('0x3e')]({'where':{'channel':_0x40bf35[_0x0a07('0x5d')]['channel'],'membername':_0xbaed85[_0x0a07('0x3f')],'type':_0x0a07('0xe7'),'exitAt':null}})[_0x0a07('0x22')](function(_0x2aa5c1){if(_0x2aa5c1){return _0x2aa5c1['update']({'exitAt':moment()[_0x0a07('0x69')](_0x0a07('0xe5')),'data2':_0x0a07('0xfa')},{'individualHooks':!![]});}return null;})[_0x0a07('0x22')](function(){var _0x235148={};_[_0x0a07('0x100')](_0x235148,util[_0x0a07('0x69')](_0x0a07('0x101'),_0x40bf35[_0x0a07('0x5d')][_0x0a07('0x97')],_0x0a07('0x102')),![]);return _0xbaed85['update'](_0x235148);});default:return respondWithRpcPromise(_0x0a07('0xee'),_0x0a07('0x103'),{'id':_0xbaed85['id'],'name':_0xbaed85[_0x0a07('0x3f')],'pause':![]})[_0x0a07('0x22')](function(){return db[_0x0a07('0xa7')][_0x0a07('0x35')]({'paused':0x0},{'where':{'UserId':_0xbaed85['id']}});})['then'](function(){return db[_0x0a07('0xe3')][_0x0a07('0xa2')]({'where':{'membername':_0xbaed85[_0x0a07('0x3f')],'type':_0x0a07('0xe7'),'exitAt':null}});})[_0x0a07('0x22')](function(_0x151c2e){var _0x4bd0b8=[];_0x151c2e[_0x0a07('0xe4')](function(_0x5930bc){_0x4bd0b8[_0x0a07('0xa4')](_0x5930bc['update']({'exitAt':moment()[_0x0a07('0x69')](_0x0a07('0xe5')),'data2':_0x0a07('0xfa')}));});return BPromise[_0x0a07('0xed')](_0x4bd0b8);})[_0x0a07('0x22')](function(){return _0xbaed85[_0x0a07('0x35')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x8cd53b,null))[_0x0a07('0x2c')](handleError(_0x8cd53b,null));};exports[_0x0a07('0x104')]=function(_0x472540,_0x218ced,_0x1f878e){var _0x1d0766={};var _0xb41331={};var _0x362c62;var _0x2b912f;return db[_0x0a07('0x43')][_0x0a07('0x8d')]({'where':{'id':_0x472540['params']['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x218ced,null))['then'](function(_0x1612a0){if(_0x1612a0){_0x362c62=_0x1612a0;_0xb41331['model']=_[_0x0a07('0x49')](db['Team'][_0x0a07('0x44')]);_0xb41331[_0x0a07('0x4a')]=_[_0x0a07('0x49')](_0x472540[_0x0a07('0x4a')]);_0xb41331[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0xb41331[_0x0a07('0x47')],_0xb41331[_0x0a07('0x4a')]);_0x1d0766[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0xb41331[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x472540[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x1d0766['attributes']=_0x1d0766[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x1d0766[_0x0a07('0x4b')]:_0xb41331[_0x0a07('0x47')];_0x1d0766[_0x0a07('0xb7')]=qs['sort'](_0x472540['query'][_0x0a07('0x4f')]);_0x1d0766['where']=qs[_0x0a07('0x51')](_[_0x0a07('0x52')](_0x472540[_0x0a07('0x4a')],_0xb41331[_0x0a07('0x51')]));if(_0x472540[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x1d0766[_0x0a07('0x50')]=_[_0x0a07('0x53')](_0x1d0766[_0x0a07('0x50')],{'$or':_[_0x0a07('0x3b')](_0x1d0766['attributes'],function(_0x5c1aff){var _0x3f6ef1={};_0x3f6ef1[_0x5c1aff]={'$like':'%'+_0x472540[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x3f6ef1;})});}_0x1d0766=_[_0x0a07('0x53')]({},_0x1d0766,_0x472540[_0x0a07('0x58')]);return _0x362c62[_0x0a07('0x104')](_0x1d0766);}})[_0x0a07('0x22')](function(_0x1fe985){if(_0x1fe985){_0x2b912f=_0x1fe985[_0x0a07('0x4e')];if(!_0x472540[_0x0a07('0x4a')][_0x0a07('0xb8')](_0x0a07('0xc0'))){_0x1d0766[_0x0a07('0x31')]=qs[_0x0a07('0x31')](_0x472540[_0x0a07('0x4a')][_0x0a07('0x31')]);_0x1d0766[_0x0a07('0x30')]=qs[_0x0a07('0x30')](_0x472540[_0x0a07('0x4a')][_0x0a07('0x30')]);}return _0x362c62[_0x0a07('0x104')](_0x1d0766);}})[_0x0a07('0x22')](function(_0x1b304f){if(_0x1b304f){return _0x1b304f?{'count':_0x2b912f,'rows':_0x1b304f}:null;}})[_0x0a07('0x22')](respondWithResult(_0x218ced,null))[_0x0a07('0x2c')](handleError(_0x218ced,null));};exports['addTeams']=function(_0x4de587,_0xe91178){return db['User'][_0x0a07('0x3e')]({'where':{'id':_0x4de587[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0xe91178,null))[_0x0a07('0x22')](function(_0x57b72d){if(_0x57b72d){var _0xc1ba61=_0x57b72d[_0x0a07('0x37')]({'plain':!![]});return _0x57b72d['addTeams'](_0x4de587['body'][_0x0a07('0x60')],_[_0x0a07('0x61')](_0x4de587['body'],[_0x0a07('0x60'),'id'])||{})[_0x0a07('0x22')](function(){for(var _0xedba8b=0x0;_0xedba8b<_0x4de587[_0x0a07('0x5d')][_0x0a07('0x60')]['length'];_0xedba8b++){var _0x2a6817=[];db[_0x0a07('0x105')]['findOne']({'where':{'id':_0x4de587[_0x0a07('0x5d')][_0x0a07('0x60')][_0xedba8b]}})[_0x0a07('0x22')](function(_0x311fe3){_0x2a6817[_0x0a07('0xa4')](_0x311fe3['getVoiceQueues']()[_0x0a07('0x22')](function(_0x3495e0){for(var _0x19f850=0x0;_0x19f850<_0x3495e0[_0x0a07('0x4e')];_0x19f850++){_0x3495e0[_0x19f850]['setDataValue'](_0x0a07('0x97'),_0x0a07('0x106'));}return _0x3495e0;}));_0x2a6817['push'](_0x311fe3[_0x0a07('0x107')]()['then'](function(_0x113cb5){for(var _0x333139=0x0;_0x333139<_0x113cb5[_0x0a07('0x4e')];_0x333139++){_0x113cb5[_0x333139][_0x0a07('0x108')](_0x0a07('0x97'),_0x0a07('0x109'));}return _0x113cb5;}));_0x2a6817[_0x0a07('0xa4')](_0x311fe3[_0x0a07('0x10a')]()[_0x0a07('0x22')](function(_0x3479f3){for(var _0x55cf73=0x0;_0x55cf73<_0x3479f3[_0x0a07('0x4e')];_0x55cf73++){_0x3479f3[_0x55cf73][_0x0a07('0x108')](_0x0a07('0x97'),_0x0a07('0x10b'));}return _0x3479f3;}));_0x2a6817['push'](_0x311fe3[_0x0a07('0x10c')]()['then'](function(_0x453d4d){for(var _0x4a7974=0x0;_0x4a7974<_0x453d4d['length'];_0x4a7974++){_0x453d4d[_0x4a7974][_0x0a07('0x108')](_0x0a07('0x97'),'Sms');}return _0x453d4d;}));_0x2a6817[_0x0a07('0xa4')](_0x311fe3[_0x0a07('0x10d')]()['then'](function(_0x458f42){for(var _0x166b35=0x0;_0x166b35<_0x458f42['length'];_0x166b35++){_0x458f42[_0x166b35][_0x0a07('0x108')](_0x0a07('0x97'),'Whatsapp');}return _0x458f42;}));_0x2a6817[_0x0a07('0xa4')](_0x311fe3['getFaxQueues']()['then'](function(_0x1004ab){for(var _0x9ec796=0x0;_0x9ec796<_0x1004ab['length'];_0x9ec796++){_0x1004ab[_0x9ec796][_0x0a07('0x108')](_0x0a07('0x97'),_0x0a07('0x10e'));}return _0x1004ab;}));_0x2a6817[_0x0a07('0xa4')](_0x311fe3[_0x0a07('0x10f')]()[_0x0a07('0x22')](function(_0x2da9ce){for(var _0xc22831=0x0;_0xc22831<_0x2da9ce[_0x0a07('0x4e')];_0xc22831++){_0x2da9ce[_0xc22831]['setDataValue'](_0x0a07('0x97'),_0x0a07('0x110'));}return _0x2da9ce;}));return BPromise[_0x0a07('0xed')](_0x2a6817);})[_0x0a07('0x22')](function(_0x5b7d8a){var _0x5bcae0=_[_0x0a07('0x111')](_0x5b7d8a);_0x2a6817=[];return db[_0x0a07('0x55')][_0x0a07('0x112')](function(_0x46affd){for(var _0x1744f0=0x0;_0x1744f0<_0x5bcae0[_0x0a07('0x4e')];_0x1744f0++){_0x2a6817['push'](_0x5bcae0[_0x1744f0]['addAgent'](_0xc1ba61['id']),{'transaction':_0x46affd});}return BPromise[_0x0a07('0xed')](_0x2a6817)[_0x0a07('0x22')](function(){if(_0xc1ba61[_0x0a07('0xa3')]){return BPromise['each'](_[_0x0a07('0x39')](_0x5bcae0,function(_0x4fc4a4){return _0x4fc4a4['getDataValue']('channel')===_0x0a07('0x106');}),function(_0x45397f){return db[_0x0a07('0xa7')]['upsert']({'membername':_0xc1ba61[_0x0a07('0x3f')],'UserId':_0xc1ba61['id'],'queue_name':_0x45397f[_0x0a07('0x3f')],'VoiceQueueId':_0x45397f['id'],'interface':_[_0x0a07('0x67')](_0xc1ba61[_0x0a07('0x99')])?util[_0x0a07('0x69')](_0x0a07('0xa5'),_0xc1ba61[_0x0a07('0x3f')]):_0xc1ba61['interface'],'paused':_0xc1ba61['voicePause']||![],'penalty':_0xc1ba61[_0x0a07('0x9d')]},{'transaction':_0x46affd});});}else{return;}})[_0x0a07('0x22')](function(){for(var _0x47a4d0=0x0;_0x47a4d0<_0x5bcae0[_0x0a07('0x4e')];_0x47a4d0++){var _0x2a5688=_0x5bcae0[_0x47a4d0][_0x0a07('0x113')](_0x0a07('0x97'));var _0x47162b=_0x2a5688+_0x0a07('0x9f');socket[_0x0a07('0xad')](_0x0a07('0x85')+_0x2a5688+_0x0a07('0xa0'),{'UserId':_0xc1ba61['id'],['queueField']:_0x5bcae0[_0x47a4d0]['id']});}});});});}});}})[_0x0a07('0x22')](respondWithStatusCode(_0xe91178,null))[_0x0a07('0x2c')](handleError(_0xe91178,null));};exports[_0x0a07('0x114')]=function(_0x456a3c,_0x27bd5d){return db[_0x0a07('0x43')]['findOne']({'where':{'id':_0x456a3c[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x27bd5d,null))['then'](function(_0x508c94){if(_0x508c94){var _0x5c5b85=_0x508c94['get']({'plain':!![]});var _0x3fe517=_0x456a3c[_0x0a07('0x4a')][_0x0a07('0x60')];return _0x508c94[_0x0a07('0x114')](_0x3fe517)['then'](function(){for(var _0x37a2cb=0x0;_0x37a2cb<_0x3fe517['length'];_0x37a2cb++){var _0x572c12=[];db[_0x0a07('0x105')][_0x0a07('0x8d')]({'where':{'id':_0x3fe517[_0x37a2cb]}})[_0x0a07('0x22')](function(_0x454d7f){_0x572c12[_0x0a07('0xa4')](_0x454d7f[_0x0a07('0xe1')]()[_0x0a07('0x22')](function(_0x3a4c63){for(var _0x4b823c=0x0;_0x4b823c<_0x3a4c63[_0x0a07('0x4e')];_0x4b823c++){_0x3a4c63[_0x4b823c][_0x0a07('0x108')]('channel',_0x0a07('0x106'));}return _0x3a4c63;}));_0x572c12[_0x0a07('0xa4')](_0x454d7f[_0x0a07('0x107')]()[_0x0a07('0x22')](function(_0x2a20ad){for(var _0x53903d=0x0;_0x53903d<_0x2a20ad[_0x0a07('0x4e')];_0x53903d++){_0x2a20ad[_0x53903d][_0x0a07('0x108')](_0x0a07('0x97'),_0x0a07('0x109'));}return _0x2a20ad;}));_0x572c12['push'](_0x454d7f[_0x0a07('0x10a')]()[_0x0a07('0x22')](function(_0x22210f){for(var _0x17f40d=0x0;_0x17f40d<_0x22210f['length'];_0x17f40d++){_0x22210f[_0x17f40d][_0x0a07('0x108')]('channel','Mail');}return _0x22210f;}));_0x572c12[_0x0a07('0xa4')](_0x454d7f[_0x0a07('0x10c')]()[_0x0a07('0x22')](function(_0x43abd2){for(var _0x57d9f0=0x0;_0x57d9f0<_0x43abd2[_0x0a07('0x4e')];_0x57d9f0++){_0x43abd2[_0x57d9f0][_0x0a07('0x108')]('channel','Sms');}return _0x43abd2;}));_0x572c12[_0x0a07('0xa4')](_0x454d7f[_0x0a07('0x10d')]()[_0x0a07('0x22')](function(_0x51835e){for(var _0xeaecc5=0x0;_0xeaecc5<_0x51835e[_0x0a07('0x4e')];_0xeaecc5++){_0x51835e[_0xeaecc5]['setDataValue'](_0x0a07('0x97'),'Whatsapp');}return _0x51835e;}));_0x572c12[_0x0a07('0xa4')](_0x454d7f[_0x0a07('0x115')]()['then'](function(_0x1d261d){for(var _0x2b517e=0x0;_0x2b517e<_0x1d261d['length'];_0x2b517e++){_0x1d261d[_0x2b517e]['setDataValue'](_0x0a07('0x97'),_0x0a07('0x10e'));}return _0x1d261d;}));_0x572c12[_0x0a07('0xa4')](_0x454d7f['getOpenchannelQueues']()['then'](function(_0x1edf89){for(var _0x4eb1e7=0x0;_0x4eb1e7<_0x1edf89[_0x0a07('0x4e')];_0x4eb1e7++){_0x1edf89[_0x4eb1e7][_0x0a07('0x108')](_0x0a07('0x97'),_0x0a07('0x110'));}return _0x1edf89;}));return BPromise[_0x0a07('0xed')](_0x572c12);})[_0x0a07('0x22')](function(_0x561c5a){var _0x24e95b=_[_0x0a07('0x111')](_0x561c5a);_0x572c12=[];return db['sequelize'][_0x0a07('0x112')](function(_0x4c9d63){for(var _0x545d0d=0x0;_0x545d0d<_0x24e95b[_0x0a07('0x4e')];_0x545d0d++){_0x572c12[_0x0a07('0xa4')](_0x24e95b[_0x545d0d]['removeAgent'](_0x5c5b85['id']),{'transaction':_0x4c9d63});}return BPromise[_0x0a07('0xed')](_0x572c12)['then'](function(){if(_0x5c5b85[_0x0a07('0xa3')]){return BPromise[_0x0a07('0xa6')](_[_0x0a07('0x39')](_0x24e95b,function(_0x6d032b){return _0x6d032b['getDataValue']('channel')===_0x0a07('0x106');}),function(_0x31c358){return db['UserVoiceQueueRt'][_0x0a07('0x36')]({'where':{'VoiceQueueId':_0x31c358['id'],'UserId':_0x5c5b85['id']},'transaction':_0x4c9d63});});}else{return;}})[_0x0a07('0x22')](function(){for(var _0x1c4d26=0x0;_0x1c4d26<_0x24e95b[_0x0a07('0x4e')];_0x1c4d26++){var _0x598532=_0x24e95b[_0x1c4d26][_0x0a07('0x113')](_0x0a07('0x97'));var _0x3ad1f=_0x598532+_0x0a07('0x9f');socket[_0x0a07('0xad')](_0x0a07('0x85')+_0x598532+'Queue:remove',{'UserId':_0x5c5b85['id'],['queueField']:_0x24e95b[_0x1c4d26]['id']});}});});});}});}})[_0x0a07('0x22')](respondWithStatusCode(_0x27bd5d,null))[_0x0a07('0x2c')](handleError(_0x27bd5d,null));};exports[_0x0a07('0x116')]=function(_0x45626b,_0x267f2d,_0x225af3){var _0x292a75={};var _0x4d0246={};var _0x3dcb72;var _0x2c7a72;return db[_0x0a07('0x43')]['findOne']({'where':{'id':_0x45626b[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x267f2d,null))[_0x0a07('0x22')](function(_0x2a08aa){if(_0x2a08aa){_0x3dcb72=_0x2a08aa;_0x4d0246[_0x0a07('0x47')]=_[_0x0a07('0x49')](db[_0x0a07('0xba')][_0x0a07('0x44')]);_0x4d0246[_0x0a07('0x4a')]=_['keys'](_0x45626b[_0x0a07('0x4a')]);_0x4d0246['filters']=_[_0x0a07('0x4c')](_0x4d0246[_0x0a07('0x47')],_0x4d0246[_0x0a07('0x4a')]);_0x292a75[_0x0a07('0x4b')]=_[_0x0a07('0x4c')](_0x4d0246[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x45626b[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x292a75[_0x0a07('0x4b')]=_0x292a75[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x292a75['attributes']:_0x4d0246['model'];_0x292a75[_0x0a07('0xb7')]=qs['sort'](_0x45626b[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x292a75['where']=qs[_0x0a07('0x51')](_[_0x0a07('0x52')](_0x45626b[_0x0a07('0x4a')],_0x4d0246[_0x0a07('0x51')]));if(_0x45626b[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x292a75['where']=_[_0x0a07('0x53')](_0x292a75[_0x0a07('0x50')],{'$or':_['map'](_0x292a75[_0x0a07('0x4b')],function(_0x447408){var _0xab1a49={};_0xab1a49[_0x447408]={'$like':'%'+_0x45626b[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0xab1a49;})});}_0x292a75=_[_0x0a07('0x53')]({},_0x292a75,_0x45626b[_0x0a07('0x58')]);return _0x3dcb72[_0x0a07('0x116')](_0x292a75);}})[_0x0a07('0x22')](function(_0xdbe112){if(_0xdbe112){_0x2c7a72=_0xdbe112['length'];if(!_0x45626b[_0x0a07('0x4a')]['hasOwnProperty'](_0x0a07('0xc0'))){_0x292a75[_0x0a07('0x31')]=qs[_0x0a07('0x31')](_0x45626b['query'][_0x0a07('0x31')]);_0x292a75[_0x0a07('0x30')]=qs[_0x0a07('0x30')](_0x45626b[_0x0a07('0x4a')]['offset']);}return _0x3dcb72[_0x0a07('0x116')](_0x292a75);}})[_0x0a07('0x22')](function(_0x5a2434){if(_0x5a2434){return _0x5a2434?{'count':_0x2c7a72,'rows':_0x5a2434}:null;}})[_0x0a07('0x22')](respondWithResult(_0x267f2d,null))['catch'](handleError(_0x267f2d,null));};exports[_0x0a07('0x117')]=function(_0x51b33a,_0x42ec2a,_0x3c76c6){var _0x28a403={};var _0x189574={};var _0x502572;var _0x525f48;return db[_0x0a07('0x43')][_0x0a07('0x8d')]({'where':{'id':_0x51b33a[_0x0a07('0x5b')]['id']}})[_0x0a07('0x22')](handleEntityNotFound(_0x42ec2a,null))['then'](function(_0x4050fa){if(_0x4050fa){_0x502572=_0x4050fa;_0x189574[_0x0a07('0x47')]=_[_0x0a07('0x49')](db['User'][_0x0a07('0x44')]);_0x189574[_0x0a07('0x4a')]=_['keys'](_0x51b33a['query']);_0x189574[_0x0a07('0x51')]=_[_0x0a07('0x4c')](_0x189574['model'],_0x189574[_0x0a07('0x4a')]);_0x28a403[_0x0a07('0x4b')]=_['intersection'](_0x189574[_0x0a07('0x47')],qs[_0x0a07('0x4d')](_0x51b33a[_0x0a07('0x4a')][_0x0a07('0x4d')]));_0x28a403[_0x0a07('0x4b')]=_0x28a403[_0x0a07('0x4b')][_0x0a07('0x4e')]?_0x28a403['attributes']:_0x189574[_0x0a07('0x47')];_0x28a403[_0x0a07('0xb7')]=qs[_0x0a07('0x4f')](_0x51b33a[_0x0a07('0x4a')][_0x0a07('0x4f')]);_0x28a403[_0x0a07('0x50')]=qs['filters'](_[_0x0a07('0x52')](_0x51b33a[_0x0a07('0x4a')],_0x189574[_0x0a07('0x51')]));if(_0x51b33a[_0x0a07('0x4a')][_0x0a07('0x39')]){_0x28a403[_0x0a07('0x50')]=_[_0x0a07('0x53')](_0x28a403['where'],{'$or':_[_0x0a07('0x3b')](_0x28a403['attributes'],function(_0x20dbef){var _0x128b1b={};_0x128b1b[_0x20dbef]={'$like':'%'+_0x51b33a[_0x0a07('0x4a')][_0x0a07('0x39')]+'%'};return _0x128b1b;})});}_0x28a403['model']=db['User'];_0x28a403['as']='Agents';_0x28a403=_[_0x0a07('0x53')]({},_0x28a403,_0x51b33a[_0x0a07('0x58')]);return _0x502572['getVoiceQueues']({'include':[_0x28a403]});}})[_0x0a07('0x22')](function(_0x255b41){if(_0x255b41){var _0x31e08d={},_0x36efba=[],_0x4c75e9=0x0;for(var _0x14351d=0x0;_0x14351d<_0x255b41[_0x0a07('0x4e')];_0x14351d+=0x1){for(var _0x4fa80b=0x0,_0xb6c85e;_0x4fa80b<_0x255b41[_0x14351d]['Agents']['length'];_0x4fa80b+=0x1){_0xb6c85e=_0x255b41[_0x14351d][_0x0a07('0x87')][_0x4fa80b][_0x0a07('0x37')]({'plain':!![]});_0x31e08d[_0xb6c85e['id']]=_0xb6c85e;}}_0x31e08d=_[_0x0a07('0x118')](_0x31e08d);for(var _0x45872c=qs[_0x0a07('0x30')](_0x51b33a[_0x0a07('0x4a')][_0x0a07('0x30')]);_0x45872c<_0x31e08d[_0x0a07('0x4e')]&&_0x36efba[_0x0a07('0x4e')]=_0x4f4a99[_0xdd35('0x50')]){throw new Error(_0xdd35('0x51'));}})[_0xdd35('0x23')](function(){if(_0x1f1b0f){return db['UserVoiceQueueRt'][_0xdd35('0x4a')]({'where':{'membername':_0x1f1b0f['name']},'individualHooks':!![]});}})[_0xdd35('0x23')](function(){if(_0x1f1b0f){return _0x1f1b0f['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x27268c){if(_0x1f1b0f){if(_0x27268c){var _0x43f73a=[];_0xa2659d=_0x27268c;if(_0xa2659d['length']){for(var _0xa69dd5=0x0;_0xa69dd5<_0xa2659d[_0xdd35('0x31')];_0xa69dd5++){_0x43f73a[_0xdd35('0x37')](db[_0xdd35('0x2d')]['upsert']({'membername':_0x1f1b0f[_0xdd35('0x29')],'UserId':_0x1f1b0f['id'],'queue_name':_0xa2659d[_0xa69dd5][_0xdd35('0x29')],'VoiceQueueId':_0xa2659d[_0xa69dd5]['id'],'interface':_0x5e65bb,'paused':_0x1f1b0f[_0xdd35('0x52')]||![],'penalty':_0xa2659d[_0xa69dd5][_0xdd35('0x53')]||0x0}));}return BPromise[_0xdd35('0x48')](_0x43f73a);}}}})['then'](function(){if(_0x1f1b0f){return db[_0xdd35('0x2f')][_0xdd35('0x1b')]({'where':{'membername':_0x1f1b0f[_0xdd35('0x29')],'exitAt':null}});}})[_0xdd35('0x23')](function(_0x3cf1eb){if(_0x1f1b0f){if(_0x3cf1eb&&_0x3cf1eb[_0xdd35('0x31')]){var _0x4287e6=[];_0x3cf1eb[_0xdd35('0x36')](function(_0x1cb4ac){_0x4287e6['push'](_0x1cb4ac[_0xdd35('0x2e')]({'exitAt':moment()[_0xdd35('0x32')](_0xdd35('0x33'))}));});return BPromise[_0xdd35('0x48')](_0x4287e6);}}})[_0xdd35('0x23')](function(_0x1694ba){if(_0x1f1b0f){var _0x9bc8d5=[];var _0x3dbbfd=[];var _0x521730=utils[_0xdd35('0x35')]();var _0x3c9fb6={'membername':_0x1f1b0f[_0xdd35('0x29')],'interface':_0x5e65bb,'enterAt':moment()[_0xdd35('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1f1b0f[_0xdd35('0x2a')],'internal':_0x1f1b0f[_0xdd35('0x2b')]};_0x521730[_0xdd35('0x36')](function(_0x27faee){_0x9bc8d5[_0xdd35('0x37')](_['merge']({'channel':_0x27faee,'type':_0xdd35('0x54'),'data1':'callysquare','data2':_0x5e65bb},_0x3c9fb6));if(_0x1f1b0f['loginInPause']){_0x3dbbfd[_0xdd35('0x37')](_[_0xdd35('0x55')]({'channel':_0x27faee,'type':_0xdd35('0x30'),'data1':_0xdd35('0x56')},_0x3c9fb6));}});return db[_0xdd35('0x2f')][_0xdd35('0x3c')](_0x9bc8d5['concat'](_0x3dbbfd),{'individualHooks':!![]});}})[_0xdd35('0x23')](function(){if(_0x1f1b0f){return _0x1f1b0f[_0xdd35('0x2e')]({'online':!![],'lastLoginAt':moment()[_0xdd35('0x32')](_0xdd35('0x33')),'voicePause':_0x1f1b0f[_0xdd35('0x52')]||![],'mailPause':_0x1f1b0f[_0xdd35('0x52')]||![],'chatPause':_0x1f1b0f[_0xdd35('0x52')]||![],'faxPause':_0x1f1b0f[_0xdd35('0x52')]||![],'smsPause':_0x1f1b0f['loginInPause']||![],'openchannelPause':_0x1f1b0f[_0xdd35('0x52')]||![],'pauseType':_0x1f1b0f[_0xdd35('0x52')]?_0xdd35('0x56'):null,'lastPauseAt':moment()[_0xdd35('0x32')](_0xdd35('0x33')),'interface':_0x5e65bb});}})['then'](function(_0x2a01fb){_0x2ad568(_0x2a01fb);})[_0xdd35('0x24')](function(_0x32dbdb){_0x73bc7b(_0x52f9ff[_0xdd35('0x16')](0x1f4,_0x32dbdb['message']));});});};
\ No newline at end of file
+var _0x1696=['mobile','phone','loginInPause','SIP/%s','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','length','upsert','UserVoiceQueue.penalty','all','merge','LOGIN','callysquare','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./user.socket','register','then','info','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','User,\x20%s,\x20%s','message','GetUser','options','where','attributes','limit','include','model','map','debug','catch','ShowUser','User','raw','PauseUser','find','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','findAll','PAUSE','updateAttributes','getChannels','forEach','push','isNil','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','uniqueid','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','format','system','chat','fax','sms','openchannel','set','%s%s','Pause','LogoutUser','destroy','LoginUser'];(function(_0x32ae3b,_0x58303f){var _0x509912=function(_0x2e3190){while(--_0x2e3190){_0x32ae3b['push'](_0x32ae3b['shift']());}};_0x509912(++_0x58303f);}(_0x1696,0x72));var _0x6169=function(_0x36ea29,_0x5847e6){_0x36ea29=_0x36ea29-0x0;var _0x49e2bf=_0x1696[_0x36ea29];return _0x49e2bf;};'use strict';var _=require(_0x6169('0x0'));var util=require(_0x6169('0x1'));var moment=require(_0x6169('0x2'));var BPromise=require(_0x6169('0x3'));var rs=require(_0x6169('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6169('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6169('0x6'))(_0x6169('0x7'));var config=require(_0x6169('0x8'));var jayson=require(_0x6169('0x9'));var client=jayson[_0x6169('0xa')][_0x6169('0xb')]({'port':0x232a});config['redis']=_[_0x6169('0xc')](config[_0x6169('0xd')],{'host':_0x6169('0xe'),'port':0x18eb});var socket=require(_0x6169('0xf'))(new Redis(config['redis']));require(_0x6169('0x10'))[_0x6169('0x11')](socket);function respondWithRpcPromise(_0x3b0bbd,_0x3a9d11,_0x34241a){return new BPromise(function(_0x32c93e,_0x42725b){return client['request'](_0x3b0bbd,_0x34241a)[_0x6169('0x12')](function(_0x43639f){logger[_0x6169('0x13')]('User,\x20%s,\x20%s',_0x3a9d11,_0x6169('0x14'));logger['debug'](_0x6169('0x15'),_0x3a9d11,_0x6169('0x14'),JSON[_0x6169('0x16')](_0x43639f));if(_0x43639f[_0x6169('0x17')]){if(_0x43639f['error']['code']===0x1f4){logger[_0x6169('0x17')](_0x6169('0x18'),_0x3a9d11,_0x43639f[_0x6169('0x17')][_0x6169('0x19')]);return _0x42725b(_0x43639f[_0x6169('0x17')][_0x6169('0x19')]);}logger[_0x6169('0x17')](_0x6169('0x18'),_0x3a9d11,_0x43639f[_0x6169('0x17')][_0x6169('0x19')]);return _0x32c93e(_0x43639f[_0x6169('0x17')][_0x6169('0x19')]);}else{logger['info']('User,\x20%s,\x20%s',_0x3a9d11,_0x6169('0x14'));_0x32c93e(_0x43639f['result']['message']);}})['catch'](function(_0x451301){logger[_0x6169('0x17')](_0x6169('0x18'),_0x3a9d11,_0x451301);_0x42725b(_0x451301);});});}exports[_0x6169('0x1a')]=function(_0x3c67a2){var _0x352eb0=this;return new Promise(function(_0x40832b,_0x53cfc3){return db['User']['findAll']({'raw':_0x3c67a2[_0x6169('0x1b')]?_0x3c67a2[_0x6169('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3c67a2[_0x6169('0x1b')]?_0x3c67a2['options'][_0x6169('0x1c')]||null:null,'attributes':_0x3c67a2[_0x6169('0x1b')]?_0x3c67a2[_0x6169('0x1b')][_0x6169('0x1d')]||null:null,'limit':_0x3c67a2[_0x6169('0x1b')]?_0x3c67a2['options'][_0x6169('0x1e')]||null:null,'include':_0x3c67a2['options']?_0x3c67a2['options'][_0x6169('0x1f')]?_['map'](_0x3c67a2[_0x6169('0x1b')][_0x6169('0x1f')],function(_0x1d7687){return{'model':db[_0x1d7687[_0x6169('0x20')]],'as':_0x1d7687['as'],'attributes':_0x1d7687['attributes'],'include':_0x1d7687['include']?_[_0x6169('0x21')](_0x1d7687[_0x6169('0x1f')],function(_0x4de0c9){return{'model':db[_0x4de0c9['model']],'as':_0x4de0c9['as'],'attributes':_0x4de0c9[_0x6169('0x1d')],'include':_0x4de0c9[_0x6169('0x1f')]?_[_0x6169('0x21')](_0x4de0c9[_0x6169('0x1f')],function(_0x282bad){return{'model':db[_0x282bad[_0x6169('0x20')]],'as':_0x282bad['as'],'attributes':_0x282bad[_0x6169('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6169('0x12')](function(_0x3c8d82){logger[_0x6169('0x13')](_0x6169('0x1a'),_0x3c67a2);logger[_0x6169('0x22')](_0x6169('0x1a'),_0x3c67a2,JSON[_0x6169('0x16')](_0x3c8d82));_0x40832b(_0x3c8d82);})[_0x6169('0x23')](function(_0x516ea3){logger[_0x6169('0x17')](_0x6169('0x1a'),_0x516ea3[_0x6169('0x19')],_0x3c67a2);_0x53cfc3(_0x352eb0[_0x6169('0x17')](0x1f4,_0x516ea3['message']));});});};exports[_0x6169('0x24')]=function(_0x24d7ab){var _0x37f433=this;return new Promise(function(_0x50df70,_0x523288){return db[_0x6169('0x25')]['find']({'raw':_0x24d7ab[_0x6169('0x1b')]?_0x24d7ab[_0x6169('0x1b')][_0x6169('0x26')]===undefined?!![]:![]:!![],'where':_0x24d7ab[_0x6169('0x1b')]?_0x24d7ab[_0x6169('0x1b')][_0x6169('0x1c')]||null:null,'attributes':_0x24d7ab[_0x6169('0x1b')]?_0x24d7ab[_0x6169('0x1b')][_0x6169('0x1d')]||null:null,'include':_0x24d7ab[_0x6169('0x1b')]?_0x24d7ab[_0x6169('0x1b')]['include']?_['map'](_0x24d7ab[_0x6169('0x1b')][_0x6169('0x1f')],function(_0x94bba1){return{'model':db[_0x94bba1['model']],'as':_0x94bba1['as'],'attributes':_0x94bba1[_0x6169('0x1d')],'include':_0x94bba1[_0x6169('0x1f')]?_[_0x6169('0x21')](_0x94bba1[_0x6169('0x1f')],function(_0x280b29){return{'model':db[_0x280b29['model']],'as':_0x280b29['as'],'attributes':_0x280b29[_0x6169('0x1d')],'include':_0x280b29['include']?_[_0x6169('0x21')](_0x280b29[_0x6169('0x1f')],function(_0x199d4a){return{'model':db[_0x199d4a[_0x6169('0x20')]],'as':_0x199d4a['as'],'attributes':_0x199d4a[_0x6169('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6169('0x12')](function(_0x1b98a6){logger[_0x6169('0x13')](_0x6169('0x24'),_0x24d7ab);logger['debug'](_0x6169('0x24'),_0x24d7ab,JSON[_0x6169('0x16')](_0x1b98a6));_0x50df70(_0x1b98a6);})[_0x6169('0x23')](function(_0x5af692){logger['error'](_0x6169('0x24'),_0x5af692['message'],_0x24d7ab);_0x523288(_0x37f433['error'](0x1f4,_0x5af692[_0x6169('0x19')]));});});};exports[_0x6169('0x27')]=function(_0xfd1e14){var _0x322320=this;return new Promise(function(_0x46793f,_0x45ca32){var _0x2c78a8;return db[_0x6169('0x25')][_0x6169('0x28')]({'where':_0xfd1e14['options'][_0x6169('0x1c')]||{},'attributes':['id',_0x6169('0x29'),_0x6169('0x2a'),_0x6169('0x2b'),_0x6169('0x2c')]})['then'](function(_0x530785){if(_0x530785){_0x2c78a8=_0x530785;return db[_0x6169('0x2d')][_0x6169('0x2e')]({'paused':0x1},{'where':{'UserId':_0x2c78a8['id']},'individualHooks':!![]});}})[_0x6169('0x12')](function(){if(_0x2c78a8){return db[_0x6169('0x2f')][_0x6169('0x30')]({'where':{'membername':_0x2c78a8[_0x6169('0x29')],'type':_0x6169('0x31'),'exitAt':null}});}})[_0x6169('0x12')](function(_0x2d0271){if(_0x2c78a8){if(_0x2d0271&&_0x2d0271['length']){var _0x333faa=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x10f4c5=0x0,_0x5139fc=_0x2d0271['length'];_0x10f4c5<_0x5139fc;_0x10f4c5++){_0x2d0271[_0x10f4c5][_0x6169('0x32')]({'exitAt':_0x333faa});}}}})[_0x6169('0x12')](function(){if(_0x2c78a8){var _0x410eba=[];var _0x307d85=utils[_0x6169('0x33')]();_0x307d85[_0x6169('0x34')](function(_0x1faf5c){_0x410eba[_0x6169('0x35')]({'channel':_0x1faf5c,'membername':_0x2c78a8[_0x6169('0x29')],'interface':_[_0x6169('0x36')](_0x2c78a8[_0x6169('0x2c')])?util['format']('SIP/%s',_0x2c78a8[_0x6169('0x29')]):_0x2c78a8[_0x6169('0x2c')],'type':_0x6169('0x31'),'enterAt':moment()['format'](_0x6169('0x37')),'data1':_0xfd1e14[_0x6169('0x38')][_0x6169('0x39')]||_0x6169('0x3a'),'role':_0x2c78a8[_0x6169('0x2a')],'internal':_0x2c78a8[_0x6169('0x2b')],'uniqueid':_0xfd1e14[_0x6169('0x38')][_0x6169('0x3b')]||null});});return db[_0x6169('0x2f')]['bulkCreate'](_0x410eba,{'individualHooks':!![]});}})[_0x6169('0x12')](function(){if(_0x2c78a8){return _0x2c78a8[_0x6169('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xfd1e14['body'][_0x6169('0x39')]||_0x6169('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x6169('0x12')](function(_0x3e1dbb){_0x46793f(_0x3e1dbb);})['catch'](function(_0x3ab515){_0x45ca32(_0x322320[_0x6169('0x17')](0x1f4,_0x3ab515['message']));});});};exports[_0x6169('0x3c')]=function(_0x300460){var _0x42c5bf=this;return new Promise(function(_0x53e6b1,_0x3b2202){var _0x32f783;return db[_0x6169('0x25')][_0x6169('0x3d')]({'where':_0x300460[_0x6169('0x1b')]['where']||{},'attributes':['id',_0x6169('0x29')]})[_0x6169('0x12')](function(_0x586b80){if(_0x586b80){_0x32f783=_0x586b80;if(_0x300460[_0x6169('0x38')][_0x6169('0x3e')]&&!utils[_0x6169('0x3f')](_0x300460[_0x6169('0x38')][_0x6169('0x3e')])){throw new Error(_0x6169('0x40'));}switch(_0x300460[_0x6169('0x38')][_0x6169('0x3e')]){case _0x6169('0x41'):return db['UserVoiceQueueRt'][_0x6169('0x2e')]({'paused':0x0},{'where':{'UserId':_0x32f783['id']}})[_0x6169('0x12')](function(){return db[_0x6169('0x2f')][_0x6169('0x28')]({'where':{'channel':_0x300460[_0x6169('0x38')][_0x6169('0x3e')],'membername':_0x32f783['name'],'type':'PAUSE','exitAt':null}});})[_0x6169('0x12')](function(_0x5f2bba){if(_0x5f2bba){return _0x5f2bba['update']({'exitAt':moment()[_0x6169('0x42')](_0x6169('0x37')),'data2':_0x6169('0x43')},{'individualHooks':!![]});}return null;})[_0x6169('0x12')](function(){return _0x32f783[_0x6169('0x2e')]({'voicePause':![]});});case'mail':case _0x6169('0x44'):case _0x6169('0x45'):case _0x6169('0x46'):case _0x6169('0x47'):return db[_0x6169('0x2f')][_0x6169('0x28')]({'where':{'channel':_0x300460[_0x6169('0x38')][_0x6169('0x3e')],'membername':_0x32f783[_0x6169('0x29')],'type':'PAUSE','exitAt':null}})['then'](function(_0x131d5f){return _0x131d5f[_0x6169('0x2e')]({'exitAt':moment()[_0x6169('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6169('0x43')},{'individualHooks':!![]});})[_0x6169('0x12')](function(){var _0x204c2d={};_[_0x6169('0x48')](_0x204c2d,util[_0x6169('0x42')](_0x6169('0x49'),_0x300460[_0x6169('0x38')][_0x6169('0x3e')],_0x6169('0x4a')),![]);return _0x32f783['update'](_0x204c2d);});default:return db[_0x6169('0x2d')][_0x6169('0x2e')]({'paused':0x0},{'where':{'UserId':_0x32f783['id']}})[_0x6169('0x12')](function(){return db[_0x6169('0x2f')]['findAll']({'where':{'membername':_0x32f783[_0x6169('0x29')],'type':_0x6169('0x31'),'exitAt':null}});})[_0x6169('0x12')](function(_0x5d8198){var _0x5e5c61=[];_0x5d8198[_0x6169('0x34')](function(_0x3f2a0f){_0x5e5c61['push'](_0x3f2a0f[_0x6169('0x2e')]({'exitAt':moment()['format'](_0x6169('0x37')),'data2':_0x6169('0x43')}));});return BPromise['all'](_0x5e5c61);})['then'](function(){return _0x32f783[_0x6169('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x450862){_0x53e6b1(_0x450862);})[_0x6169('0x23')](function(_0x3d88c9){_0x3b2202(_0x42c5bf['error'](0x1f4,_0x3d88c9[_0x6169('0x19')]));});});};exports[_0x6169('0x4b')]=function(_0x12b0df){var _0x131e34=this;return new Promise(function(_0x5df100,_0x220427){var _0x28dabf;return db[_0x6169('0x25')][_0x6169('0x3d')]({'where':_0x12b0df[_0x6169('0x1b')][_0x6169('0x1c')]||{},'attributes':['id',_0x6169('0x29')]})['then'](function(_0x5093e7){if(_0x5093e7){_0x28dabf=_0x5093e7;return db['UserVoiceQueueRt'][_0x6169('0x4c')]({'where':{'membername':_0x28dabf[_0x6169('0x29')]},'individualHooks':!![]});}})[_0x6169('0x12')](function(){if(_0x28dabf){return db[_0x6169('0x2f')][_0x6169('0x30')]({'where':{'membername':_0x28dabf[_0x6169('0x29')],'exitAt':null}});}})[_0x6169('0x12')](function(_0x180f8c){if(_0x28dabf){if(_0x180f8c&&_0x180f8c['length']){var _0x2d9094=[];_0x180f8c['forEach'](function(_0x54d235){_0x2d9094[_0x6169('0x35')](_0x54d235[_0x6169('0x2e')]({'exitAt':moment()[_0x6169('0x42')](_0x6169('0x37'))}));});return BPromise['all'](_0x2d9094);}}})[_0x6169('0x12')](function(){if(_0x28dabf){return _0x28dabf[_0x6169('0x2e')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6169('0x12')](function(_0x363691){_0x5df100(_0x363691);})[_0x6169('0x23')](function(_0xd6821f){_0x220427(_0x131e34[_0x6169('0x17')](0x1f4,_0xd6821f[_0x6169('0x19')]));});});};exports[_0x6169('0x4d')]=function(_0x21d732){var _0x2ff731=this;return new Promise(function(_0x563b62,_0x98a12b){var _0x5d163d;var _0x58ab7e;var _0x17ce7d;var _0x5a0a8b;return db[_0x6169('0x25')][_0x6169('0x3d')]({'where':_0x21d732[_0x6169('0x1b')][_0x6169('0x1c')]||{},'attributes':['id',_0x6169('0x29'),_0x6169('0x2a'),_0x6169('0x4e'),_0x6169('0x4f'),_0x6169('0x2b'),_0x6169('0x50'),_0x6169('0x2c')]})[_0x6169('0x12')](function(_0x41c82d){if(_0x41c82d){_0x5d163d=_0x41c82d;_0x5a0a8b=_0x21d732[_0x6169('0x38')][_0x6169('0x2c')]?_0x21d732[_0x6169('0x38')][_0x6169('0x2c')]:util[_0x6169('0x42')](_0x6169('0x51'),_0x5d163d['name']);return db[_0x6169('0x25')][_0x6169('0x52')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5d163d['id']}}});}})[_0x6169('0x12')](function(_0x1974df){if(_0x1974df){_0x17ce7d=_0x1974df;return require(_0x6169('0x53'))[_0x6169('0x54')]();}})[_0x6169('0x12')](function(_0x419211){if(_0x419211&&_0x419211['agents']&&_0x17ce7d>=_0x419211[_0x6169('0x55')]){throw new Error(_0x6169('0x56'));}})[_0x6169('0x12')](function(){if(_0x5d163d){return db[_0x6169('0x2d')][_0x6169('0x4c')]({'where':{'membername':_0x5d163d[_0x6169('0x29')]},'individualHooks':!![]});}})[_0x6169('0x12')](function(){if(_0x5d163d){return _0x5d163d[_0x6169('0x57')]({'raw':!![]});}})[_0x6169('0x12')](function(_0x2af7f2){if(_0x5d163d){if(_0x2af7f2){var _0x151f9b=[];_0x58ab7e=_0x2af7f2;if(_0x58ab7e['length']){for(var _0x35289a=0x0;_0x35289a<_0x58ab7e[_0x6169('0x58')];_0x35289a++){_0x151f9b['push'](db[_0x6169('0x2d')][_0x6169('0x59')]({'membername':_0x5d163d[_0x6169('0x29')],'UserId':_0x5d163d['id'],'queue_name':_0x58ab7e[_0x35289a][_0x6169('0x29')],'VoiceQueueId':_0x58ab7e[_0x35289a]['id'],'interface':_0x5a0a8b,'paused':_0x5d163d[_0x6169('0x50')]||![],'penalty':_0x58ab7e[_0x35289a][_0x6169('0x5a')]||0x0}));}return BPromise[_0x6169('0x5b')](_0x151f9b);}}}})[_0x6169('0x12')](function(){if(_0x5d163d){return db[_0x6169('0x2f')][_0x6169('0x30')]({'where':{'membername':_0x5d163d['name'],'exitAt':null}});}})[_0x6169('0x12')](function(_0x21ad7c){if(_0x5d163d){if(_0x21ad7c&&_0x21ad7c[_0x6169('0x58')]){var _0x4c1496=[];_0x21ad7c[_0x6169('0x34')](function(_0x11016e){_0x4c1496[_0x6169('0x35')](_0x11016e[_0x6169('0x2e')]({'exitAt':moment()['format'](_0x6169('0x37'))}));});return BPromise[_0x6169('0x5b')](_0x4c1496);}}})['then'](function(_0x1bdb03){if(_0x5d163d){var _0x41e6e9=[];var _0x33dcc0=[];var _0x5b245d=utils['getChannels']();var _0x2fd2e2={'membername':_0x5d163d['name'],'interface':_0x5a0a8b,'enterAt':moment()[_0x6169('0x42')](_0x6169('0x37')),'role':_0x5d163d['role'],'internal':_0x5d163d[_0x6169('0x2b')]};_0x5b245d[_0x6169('0x34')](function(_0x5eb6ce){_0x41e6e9[_0x6169('0x35')](_[_0x6169('0x5c')]({'channel':_0x5eb6ce,'type':_0x6169('0x5d'),'data1':_0x6169('0x5e'),'data2':_0x5a0a8b},_0x2fd2e2));if(_0x5d163d[_0x6169('0x50')]){_0x33dcc0[_0x6169('0x35')](_[_0x6169('0x5c')]({'channel':_0x5eb6ce,'type':'PAUSE','data1':_0x6169('0x5f')},_0x2fd2e2));}});return db[_0x6169('0x2f')]['bulkCreate'](_0x41e6e9['concat'](_0x33dcc0),{'individualHooks':!![]});}})[_0x6169('0x12')](function(){if(_0x5d163d){return _0x5d163d[_0x6169('0x2e')]({'online':!![],'lastLoginAt':moment()[_0x6169('0x42')](_0x6169('0x37')),'voicePause':_0x5d163d[_0x6169('0x50')]||![],'mailPause':_0x5d163d[_0x6169('0x50')]||![],'chatPause':_0x5d163d['loginInPause']||![],'faxPause':_0x5d163d['loginInPause']||![],'smsPause':_0x5d163d['loginInPause']||![],'openchannelPause':_0x5d163d[_0x6169('0x50')]||![],'pauseType':_0x5d163d[_0x6169('0x50')]?_0x6169('0x5f'):null,'lastPauseAt':moment()[_0x6169('0x42')](_0x6169('0x37')),'interface':_0x5a0a8b});}})[_0x6169('0x12')](function(_0xdffdb8){_0x563b62(_0xdffdb8);})['catch'](function(_0x49f5fd){_0x98a12b(_0x2ff731['error'](0x1f4,_0x49f5fd[_0x6169('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js
index 9ba89c8..2cac8fc 100644
--- a/server/api/user/user.socket.js
+++ b/server/api/user/user.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5074=['update','emit','length','user:','./user.events','save','remove'];(function(_0x408e21,_0x407fcd){var _0x162aec=function(_0x52632f){while(--_0x52632f){_0x408e21['push'](_0x408e21['shift']());}};_0x162aec(++_0x407fcd);}(_0x5074,0xdd));var _0x4507=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x5074[_0x1a3e23];return _0x5ee0d8;};'use strict';var UserEvents=require(_0x4507('0x0'));var events=[_0x4507('0x1'),_0x4507('0x2'),_0x4507('0x3')];function createListener(_0x4b36e3,_0x47fe6d){return function(_0x26a47a){_0x47fe6d[_0x4507('0x4')](_0x4b36e3,_0x26a47a);};}function removeListener(_0x4e2462,_0x5e2490){return function(){UserEvents['removeListener'](_0x4e2462,_0x5e2490);};}exports['register']=function(_0x5a117a){for(var _0x53f911=0x0,_0x1ac65f=events[_0x4507('0x5')];_0x53f911<_0x1ac65f;_0x53f911++){var _0x405ef7=events[_0x53f911];var _0x29d721=createListener(_0x4507('0x6')+_0x405ef7,_0x5a117a);UserEvents['on'](_0x405ef7,_0x29d721);}};
\ No newline at end of file
+var _0x255b=['register','user:','./user.events','remove','update','emit','removeListener'];(function(_0x971c8b,_0x5a8f72){var _0x556923=function(_0xba7d26){while(--_0xba7d26){_0x971c8b['push'](_0x971c8b['shift']());}};_0x556923(++_0x5a8f72);}(_0x255b,0xcd));var _0xb255=function(_0x1c333d,_0x530ffc){_0x1c333d=_0x1c333d-0x0;var _0x2aa0ba=_0x255b[_0x1c333d];return _0x2aa0ba;};'use strict';var UserEvents=require(_0xb255('0x0'));var events=['save',_0xb255('0x1'),_0xb255('0x2')];function createListener(_0x793d32,_0x11ad64){return function(_0x5462d0){_0x11ad64[_0xb255('0x3')](_0x793d32,_0x5462d0);};}function removeListener(_0x4cea87,_0x5c1221){return function(){UserEvents[_0xb255('0x4')](_0x4cea87,_0x5c1221);};}exports[_0xb255('0x5')]=function(_0x2cc780){for(var _0x32f03b=0x0,_0x3c59a2=events['length'];_0x32f03b<_0x3c59a2;_0x32f03b++){var _0x2dcab7=events[_0x32f03b];var _0x429601=createListener(_0xb255('0x6')+_0x2dcab7,_0x2cc780);UserEvents['on'](_0x2dcab7,_0x429601);}};
\ No newline at end of file
diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js
index d43885f..262665a 100644
--- a/server/api/userChatQueue/index.js
+++ b/server/api/userChatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa26e=['util','path','express','Router','../../components/interaction/service','../../config/environment','multer'];(function(_0x4af45e,_0xa921ff){var _0x20e6da=function(_0x502525){while(--_0x502525){_0x4af45e['push'](_0x4af45e['shift']());}};_0x20e6da(++_0xa921ff);}(_0xa26e,0x11e));var _0xea26=function(_0x2a5d91,_0x1ab2be){_0x2a5d91=_0x2a5d91-0x0;var _0x174723=_0xa26e[_0x2a5d91];return _0x174723;};'use strict';var multer=require(_0xea26('0x0'));var util=require(_0xea26('0x1'));var path=require(_0xea26('0x2'));var timeout=require('connect-timeout');var express=require(_0xea26('0x3'));var router=express[_0xea26('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xea26('0x5'));var config=require(_0xea26('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x363e=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x50e4c3,_0x369471){var _0x2a1ce4=function(_0x56f502){while(--_0x56f502){_0x50e4c3['push'](_0x50e4c3['shift']());}};_0x2a1ce4(++_0x369471);}(_0x363e,0x179));var _0xe363=function(_0x4892b4,_0x418ca6){_0x4892b4=_0x4892b4-0x0;var _0x2f739c=_0x363e[_0x4892b4];return _0x2f739c;};'use strict';var multer=require(_0xe363('0x0'));var util=require(_0xe363('0x1'));var path=require('path');var timeout=require(_0xe363('0x2'));var express=require(_0xe363('0x3'));var router=express[_0xe363('0x4')]();var auth=require(_0xe363('0x5'));var interaction=require(_0xe363('0x6'));var config=require(_0xe363('0x7'));module[_0xe363('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js
index 702a964..88bf729 100644
--- a/server/api/userChatQueue/userChatQueue.attributes.js
+++ b/server/api/userChatQueue/userChatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x42456d,_0x3c719a){var _0x55c359=function(_0x58b95b){while(--_0x58b95b){_0x42456d['push'](_0x42456d['shift']());}};_0x55c359(++_0x3c719a);}(_0xe706,0xa3));var _0x6e70=function(_0x3b6d96,_0x5d3241){_0x3b6d96=_0x3b6d96-0x0;var _0x1e6b1c=_0xe706[_0x3b6d96];return _0x1e6b1c;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x506c98,_0x3f56b8){var _0x5ccce0=function(_0x7f9ac8){while(--_0x7f9ac8){_0x506c98['push'](_0x506c98['shift']());}};_0x5ccce0(++_0x3f56b8);}(_0xe706,0xa3));var _0x6e70=function(_0x5e7979,_0x4175c0){_0x5e7979=_0x5e7979-0x0;var _0x50f569=_0xe706[_0x5e7979];return _0x50f569;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js
index 1737c11..030721e 100644
--- a/server/api/userChatQueue/userChatQueue.model.js
+++ b/server/api/userChatQueue/userChatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1c62=['user_has_chat_queues','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x1c62,0xb5));var _0x21c6=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x1c62[_0xc82d1a];return _0x32fad2;};'use strict';var _=require(_0x21c6('0x0'));var util=require(_0x21c6('0x1'));var logger=require(_0x21c6('0x2'))(_0x21c6('0x3'));var moment=require('moment');var BPromise=require(_0x21c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x21c6('0x5'));var config=require(_0x21c6('0x6'));var attributes=require(_0x21c6('0x7'));module[_0x21c6('0x8')]=function(_0x3dd8fd,_0x24d477){return _0x3dd8fd[_0x21c6('0x9')](_0x21c6('0xa'),attributes,{'tableName':_0x21c6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4485=['rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x5ab3ae,_0x462330){var _0xb8d8fa=function(_0x28ab5a){while(--_0x28ab5a){_0x5ab3ae['push'](_0x5ab3ae['shift']());}};_0xb8d8fa(++_0x462330);}(_0x4485,0x96));var _0x5448=function(_0x51eb91,_0x4799d5){_0x51eb91=_0x51eb91-0x0;var _0x1c4fc4=_0x4485[_0x51eb91];return _0x1c4fc4;};'use strict';var _=require(_0x5448('0x0'));var util=require(_0x5448('0x1'));var logger=require(_0x5448('0x2'))('api');var moment=require(_0x5448('0x3'));var BPromise=require('bluebird');var rp=require(_0x5448('0x4'));var fs=require('fs');var path=require(_0x5448('0x5'));var rimraf=require(_0x5448('0x6'));var config=require(_0x5448('0x7'));var attributes=require(_0x5448('0x8'));module[_0x5448('0x9')]=function(_0xfa80a5,_0x49db07){return _0xfa80a5['define'](_0x5448('0xa'),attributes,{'tableName':_0x5448('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js
index 16514b6..b006195 100644
--- a/server/api/userChatQueue/userChatQueue.rpc.js
+++ b/server/api/userChatQueue/userChatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x907a=['stringify','error','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1b65fa,_0x525365){var _0x2e3e6b=function(_0x2affef){while(--_0x2affef){_0x1b65fa['push'](_0x1b65fa['shift']());}};_0x2e3e6b(++_0x525365);}(_0x907a,0xb6));var _0xa907=function(_0x36c9fa,_0x26d8fd){_0x36c9fa=_0x36c9fa-0x0;var _0x44a286=_0x907a[_0x36c9fa];return _0x44a286;};'use strict';var _=require('lodash');var util=require(_0xa907('0x0'));var moment=require(_0xa907('0x1'));var BPromise=require(_0xa907('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa907('0x3'));var db=require(_0xa907('0x4'))['db'];var utils=require(_0xa907('0x5'));var logger=require(_0xa907('0x6'))(_0xa907('0x7'));var config=require(_0xa907('0x8'));var jayson=require(_0xa907('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x254762,_0x6d3ed5,_0x37e673){return new BPromise(function(_0x38a036,_0x31a1e9){return client[_0xa907('0xa')](_0x254762,_0x37e673)[_0xa907('0xb')](function(_0x33f53b){logger['info'](_0xa907('0xc'),_0x6d3ed5,_0xa907('0xd'));logger[_0xa907('0xe')](_0xa907('0xf'),_0x6d3ed5,'request\x20sent',JSON[_0xa907('0x10')](_0x33f53b));if(_0x33f53b[_0xa907('0x11')]){if(_0x33f53b[_0xa907('0x11')]['code']===0x1f4){logger[_0xa907('0x11')](_0xa907('0xc'),_0x6d3ed5,_0x33f53b[_0xa907('0x11')][_0xa907('0x12')]);return _0x31a1e9(_0x33f53b['error'][_0xa907('0x12')]);}logger[_0xa907('0x11')](_0xa907('0xc'),_0x6d3ed5,_0x33f53b[_0xa907('0x11')][_0xa907('0x12')]);return _0x38a036(_0x33f53b[_0xa907('0x11')][_0xa907('0x12')]);}else{logger[_0xa907('0x13')](_0xa907('0xc'),_0x6d3ed5,_0xa907('0xd'));_0x38a036(_0x33f53b[_0xa907('0x14')][_0xa907('0x12')]);}})[_0xa907('0x15')](function(_0xe41a90){logger[_0xa907('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x6d3ed5,_0xe41a90);_0x31a1e9(_0xe41a90);});});}
\ No newline at end of file
+var _0x7429=['client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2fcf6b,_0xd140ff){var _0x155073=function(_0x5a9157){while(--_0x5a9157){_0x2fcf6b['push'](_0x2fcf6b['shift']());}};_0x155073(++_0xd140ff);}(_0x7429,0xab));var _0x9742=function(_0x501ca0,_0x12e2aa){_0x501ca0=_0x501ca0-0x0;var _0x4fabbe=_0x7429[_0x501ca0];return _0x4fabbe;};'use strict';var _=require(_0x9742('0x0'));var util=require('util');var moment=require(_0x9742('0x1'));var BPromise=require(_0x9742('0x2'));var rs=require(_0x9742('0x3'));var fs=require('fs');var Redis=require(_0x9742('0x4'));var db=require(_0x9742('0x5'))['db'];var utils=require(_0x9742('0x6'));var logger=require(_0x9742('0x7'))(_0x9742('0x8'));var config=require(_0x9742('0x9'));var jayson=require(_0x9742('0xa'));var client=jayson[_0x9742('0xb')][_0x9742('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f738f,_0x3196da,_0x21adae){return new BPromise(function(_0x5276fa,_0x3b56f1){return client[_0x9742('0xd')](_0x4f738f,_0x21adae)[_0x9742('0xe')](function(_0x5778d9){logger[_0x9742('0xf')](_0x9742('0x10'),_0x3196da,_0x9742('0x11'));logger[_0x9742('0x12')](_0x9742('0x13'),_0x3196da,_0x9742('0x11'),JSON[_0x9742('0x14')](_0x5778d9));if(_0x5778d9[_0x9742('0x15')]){if(_0x5778d9[_0x9742('0x15')][_0x9742('0x16')]===0x1f4){logger[_0x9742('0x15')](_0x9742('0x10'),_0x3196da,_0x5778d9[_0x9742('0x15')][_0x9742('0x17')]);return _0x3b56f1(_0x5778d9[_0x9742('0x15')][_0x9742('0x17')]);}logger[_0x9742('0x15')]('UserChatQueue,\x20%s,\x20%s',_0x3196da,_0x5778d9[_0x9742('0x15')][_0x9742('0x17')]);return _0x5276fa(_0x5778d9[_0x9742('0x15')][_0x9742('0x17')]);}else{logger[_0x9742('0xf')](_0x9742('0x10'),_0x3196da,_0x9742('0x11'));_0x5276fa(_0x5778d9[_0x9742('0x18')][_0x9742('0x17')]);}})[_0x9742('0x19')](function(_0x39d72a){logger[_0x9742('0x15')](_0x9742('0x10'),_0x3196da,_0x39d72a);_0x3b56f1(_0x39d72a);});});}
\ No newline at end of file
diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js
index d409f16..93abf71 100644
--- a/server/api/userFaxQueue/index.js
+++ b/server/api/userFaxQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x75c7=['connect-timeout','express','Router','../../components/auth/service','exports','multer','util','path'];(function(_0x3fa53a,_0x2f7c6a){var _0x470a3a=function(_0x4dcbfd){while(--_0x4dcbfd){_0x3fa53a['push'](_0x3fa53a['shift']());}};_0x470a3a(++_0x2f7c6a);}(_0x75c7,0x155));var _0x775c=function(_0x4f0da6,_0xe671a1){_0x4f0da6=_0x4f0da6-0x0;var _0x4dd88f=_0x75c7[_0x4f0da6];return _0x4dd88f;};'use strict';var multer=require(_0x775c('0x0'));var util=require(_0x775c('0x1'));var path=require(_0x775c('0x2'));var timeout=require(_0x775c('0x3'));var express=require(_0x775c('0x4'));var router=express[_0x775c('0x5')]();var auth=require(_0x775c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x775c('0x7')]=router;
\ No newline at end of file
+var _0xfad7=['../../config/environment','multer','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x54ad56,_0x39e8cd){var _0xdd6437=function(_0x1cc684){while(--_0x1cc684){_0x54ad56['push'](_0x54ad56['shift']());}};_0xdd6437(++_0x39e8cd);}(_0xfad7,0xc7));var _0x7fad=function(_0x3528e5,_0x39783f){_0x3528e5=_0x3528e5-0x0;var _0x514917=_0xfad7[_0x3528e5];return _0x514917;};'use strict';var multer=require(_0x7fad('0x0'));var util=require('util');var path=require(_0x7fad('0x1'));var timeout=require('connect-timeout');var express=require(_0x7fad('0x2'));var router=express['Router']();var auth=require(_0x7fad('0x3'));var interaction=require(_0x7fad('0x4'));var config=require(_0x7fad('0x5'));module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js
index 3614753..b2deb71 100644
--- a/server/api/userFaxQueue/userFaxQueue.attributes.js
+++ b/server/api/userFaxQueue/userFaxQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb62e=['INTEGER','sequelize','exports'];(function(_0x2508c1,_0x2c8c3a){var _0x32c5f7=function(_0x165271){while(--_0x165271){_0x2508c1['push'](_0x2508c1['shift']());}};_0x32c5f7(++_0x2c8c3a);}(_0xb62e,0x1de));var _0xeb62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb62e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'penalty':{'type':Sequelize[_0xeb62('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xeb62('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0972=['exports','INTEGER'];(function(_0x3863e8,_0x11ebdb){var _0x34186c=function(_0x15baae){while(--_0x15baae){_0x3863e8['push'](_0x3863e8['shift']());}};_0x34186c(++_0x11ebdb);}(_0x0972,0x64));var _0x2097=function(_0x5de9c0,_0x235f62){_0x5de9c0=_0x5de9c0-0x0;var _0x585f94=_0x0972[_0x5de9c0];return _0x585f94;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2097('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js
index d163516..dc35960 100644
--- a/server/api/userFaxQueue/userFaxQueue.model.js
+++ b/server/api/userFaxQueue/userFaxQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['bluebird','request-promise','path','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0x1e9930,_0x343df5){var _0xe769fd=function(_0x26588f){while(--_0x26588f){_0x1e9930['push'](_0x1e9930['shift']());}};_0xe769fd(++_0x343df5);}(_0x5f2f,0x73));var _0xf5f2=function(_0xc91b5c,_0x3468c4){_0xc91b5c=_0xc91b5c-0x0;var _0x43352c=_0x5f2f[_0xc91b5c];return _0x43352c;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','user_has_fax_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1d1f52,_0x3c7f24){var _0x4d5c74=function(_0x10014d){while(--_0x10014d){_0x1d1f52['push'](_0x1d1f52['shift']());}};_0x4d5c74(++_0x3c7f24);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserFaxQueue',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js
index 60c9b98..3af841a 100644
--- a/server/api/userFaxQueue/userFaxQueue.rpc.js
+++ b/server/api/userFaxQueue/userFaxQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8102=['message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8102,0x9c));var _0x2810=function(_0x402475,_0x4a0afc){_0x402475=_0x402475-0x0;var _0x21b5a4=_0x8102[_0x402475];return _0x21b5a4;};'use strict';var _=require(_0x2810('0x0'));var util=require(_0x2810('0x1'));var moment=require('moment');var BPromise=require(_0x2810('0x2'));var rs=require(_0x2810('0x3'));var fs=require('fs');var Redis=require(_0x2810('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2810('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2810('0x6'));var client=jayson[_0x2810('0x7')][_0x2810('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c3bee,_0xcb3add,_0x3a8290){return new BPromise(function(_0x54ed2d,_0x2e5fff){return client[_0x2810('0x9')](_0x5c3bee,_0x3a8290)[_0x2810('0xa')](function(_0x8e33e0){logger[_0x2810('0xb')](_0x2810('0xc'),_0xcb3add,'request\x20sent');logger[_0x2810('0xd')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xcb3add,'request\x20sent',JSON['stringify'](_0x8e33e0));if(_0x8e33e0[_0x2810('0xe')]){if(_0x8e33e0['error']['code']===0x1f4){logger['error'](_0x2810('0xc'),_0xcb3add,_0x8e33e0['error'][_0x2810('0xf')]);return _0x2e5fff(_0x8e33e0[_0x2810('0xe')][_0x2810('0xf')]);}logger[_0x2810('0xe')](_0x2810('0xc'),_0xcb3add,_0x8e33e0[_0x2810('0xe')][_0x2810('0xf')]);return _0x54ed2d(_0x8e33e0['error']['message']);}else{logger[_0x2810('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0xcb3add,_0x2810('0x10'));_0x54ed2d(_0x8e33e0[_0x2810('0x11')][_0x2810('0xf')]);}})[_0x2810('0x12')](function(_0x5a72b1){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xcb3add,_0x5a72b1);_0x2e5fff(_0x5a72b1);});});}
\ No newline at end of file
+var _0x9370=['error','code','UserFaxQueue,\x20%s,\x20%s','message','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2fa440,_0x3cf4a6){var _0x3720c9=function(_0x560255){while(--_0x560255){_0x2fa440['push'](_0x2fa440['shift']());}};_0x3720c9(++_0x3cf4a6);}(_0x9370,0x158));var _0x0937=function(_0x4f0402,_0x2e9220){_0x4f0402=_0x4f0402-0x0;var _0x290f45=_0x9370[_0x4f0402];return _0x290f45;};'use strict';var _=require('lodash');var util=require(_0x0937('0x0'));var moment=require('moment');var BPromise=require(_0x0937('0x1'));var rs=require(_0x0937('0x2'));var fs=require('fs');var Redis=require(_0x0937('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0937('0x4'));var logger=require(_0x0937('0x5'))(_0x0937('0x6'));var config=require(_0x0937('0x7'));var jayson=require(_0x0937('0x8'));var client=jayson[_0x0937('0x9')][_0x0937('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2102b4,_0x2b1766,_0x238cb0){return new BPromise(function(_0xa2eec9,_0xc03188){return client[_0x0937('0xb')](_0x2102b4,_0x238cb0)[_0x0937('0xc')](function(_0x311e7c){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x2b1766,_0x0937('0xd'));logger['debug'](_0x0937('0xe'),_0x2b1766,_0x0937('0xd'),JSON[_0x0937('0xf')](_0x311e7c));if(_0x311e7c[_0x0937('0x10')]){if(_0x311e7c[_0x0937('0x10')][_0x0937('0x11')]===0x1f4){logger[_0x0937('0x10')](_0x0937('0x12'),_0x2b1766,_0x311e7c['error']['message']);return _0xc03188(_0x311e7c[_0x0937('0x10')]['message']);}logger[_0x0937('0x10')](_0x0937('0x12'),_0x2b1766,_0x311e7c[_0x0937('0x10')][_0x0937('0x13')]);return _0xa2eec9(_0x311e7c['error'][_0x0937('0x13')]);}else{logger['info'](_0x0937('0x12'),_0x2b1766,_0x0937('0xd'));_0xa2eec9(_0x311e7c['result']['message']);}})['catch'](function(_0x4dfcd6){logger['error'](_0x0937('0x12'),_0x2b1766,_0x4dfcd6);_0xc03188(_0x4dfcd6);});});}
\ No newline at end of file
diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js
index b450efe..cd6f71c 100644
--- a/server/api/userMailQueue/index.js
+++ b/server/api/userMailQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa7f4=['express','Router','../../components/auth/service','exports','multer','connect-timeout'];(function(_0x5856be,_0x2c2b1e){var _0x5a4af6=function(_0x263a97){while(--_0x263a97){_0x5856be['push'](_0x5856be['shift']());}};_0x5a4af6(++_0x2c2b1e);}(_0xa7f4,0xb2));var _0x4a7f=function(_0x577749,_0x3499aa){_0x577749=_0x577749-0x0;var _0x4d406f=_0xa7f4[_0x577749];return _0x4d406f;};'use strict';var multer=require(_0x4a7f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4a7f('0x1'));var express=require(_0x4a7f('0x2'));var router=express[_0x4a7f('0x3')]();var auth=require(_0x4a7f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x4a7f('0x5')]=router;
\ No newline at end of file
+var _0x65eb=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x3c28e7,_0x169024){var _0x557b3a=function(_0x42bf71){while(--_0x42bf71){_0x3c28e7['push'](_0x3c28e7['shift']());}};_0x557b3a(++_0x169024);}(_0x65eb,0xd7));var _0xb65e=function(_0x339672,_0x57120f){_0x339672=_0x339672-0x0;var _0x36be28=_0x65eb[_0x339672];return _0x36be28;};'use strict';var multer=require(_0xb65e('0x0'));var util=require(_0xb65e('0x1'));var path=require(_0xb65e('0x2'));var timeout=require(_0xb65e('0x3'));var express=require(_0xb65e('0x4'));var router=express[_0xb65e('0x5')]();var auth=require(_0xb65e('0x6'));var interaction=require(_0xb65e('0x7'));var config=require('../../config/environment');module[_0xb65e('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js
index fe9c3f7..2f7e954 100644
--- a/server/api/userMailQueue/userMailQueue.attributes.js
+++ b/server/api/userMailQueue/userMailQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['exports','INTEGER'];(function(_0x3dd92b,_0x4d1139){var _0x5e1d23=function(_0x5d866f){while(--_0x5d866f){_0x3dd92b['push'](_0x3dd92b['shift']());}};_0x5e1d23(++_0x4d1139);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x209cc0,_0x59bb37){var _0x3c5029=function(_0x39c02f){while(--_0x39c02f){_0x209cc0['push'](_0x209cc0['shift']());}};_0x3c5029(++_0x59bb37);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js
index 9ee39e6..c05549d 100644
--- a/server/api/userMailQueue/userMailQueue.model.js
+++ b/server/api/userMailQueue/userMailQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x30a4e1,_0x3e4acf){var _0x42a2c6=function(_0x1cefdf){while(--_0x1cefdf){_0x30a4e1['push'](_0x30a4e1['shift']());}};_0x42a2c6(++_0x3e4acf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3f2d94,_0x3ca8b6){var _0x8ea46d=function(_0x5a735d){while(--_0x5a735d){_0x3f2d94['push'](_0x3f2d94['shift']());}};_0x8ea46d(++_0x3ca8b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js
index 3196c7c..e1d36f0 100644
--- a/server/api/userMailQueue/userMailQueue.rpc.js
+++ b/server/api/userMailQueue/userMailQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f74=['http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2ca482,_0x96795a){var _0x3caff5=function(_0x40f539){while(--_0x40f539){_0x2ca482['push'](_0x2ca482['shift']());}};_0x3caff5(++_0x96795a);}(_0x2f74,0x7b));var _0x42f7=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0x2f74[_0x351b46];return _0x1515df;};'use strict';var _=require(_0x42f7('0x0'));var util=require('util');var moment=require(_0x42f7('0x1'));var BPromise=require(_0x42f7('0x2'));var rs=require(_0x42f7('0x3'));var fs=require('fs');var Redis=require(_0x42f7('0x4'));var db=require(_0x42f7('0x5'))['db'];var utils=require(_0x42f7('0x6'));var logger=require(_0x42f7('0x7'))(_0x42f7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x42f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cb6e0,_0x20ff46,_0x36b55e){return new BPromise(function(_0x2c64b2,_0x28fc83){return client[_0x42f7('0xa')](_0x1cb6e0,_0x36b55e)[_0x42f7('0xb')](function(_0x5772a8){logger[_0x42f7('0xc')](_0x42f7('0xd'),_0x20ff46,_0x42f7('0xe'));logger[_0x42f7('0xf')](_0x42f7('0x10'),_0x20ff46,_0x42f7('0xe'),JSON['stringify'](_0x5772a8));if(_0x5772a8[_0x42f7('0x11')]){if(_0x5772a8[_0x42f7('0x11')][_0x42f7('0x12')]===0x1f4){logger[_0x42f7('0x11')](_0x42f7('0xd'),_0x20ff46,_0x5772a8[_0x42f7('0x11')][_0x42f7('0x13')]);return _0x28fc83(_0x5772a8[_0x42f7('0x11')]['message']);}logger['error'](_0x42f7('0xd'),_0x20ff46,_0x5772a8[_0x42f7('0x11')][_0x42f7('0x13')]);return _0x2c64b2(_0x5772a8[_0x42f7('0x11')][_0x42f7('0x13')]);}else{logger['info'](_0x42f7('0xd'),_0x20ff46,'request\x20sent');_0x2c64b2(_0x5772a8[_0x42f7('0x14')][_0x42f7('0x13')]);}})[_0x42f7('0x15')](function(_0x19eff3){logger[_0x42f7('0x11')](_0x42f7('0xd'),_0x20ff46,_0x19eff3);_0x28fc83(_0x19eff3);});});}
\ No newline at end of file
+var _0xe191=['stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xe191,0x98));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e19('0x0'));var util=require(_0x1e19('0x1'));var moment=require(_0x1e19('0x2'));var BPromise=require(_0x1e19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e19('0x4'))['db'];var utils=require(_0x1e19('0x5'));var logger=require(_0x1e19('0x6'))('rpc');var config=require(_0x1e19('0x7'));var jayson=require(_0x1e19('0x8'));var client=jayson[_0x1e19('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa12ca7,_0x5996db,_0x4e99a3){return new BPromise(function(_0x61606d,_0xd0e526){return client[_0x1e19('0xa')](_0xa12ca7,_0x4e99a3)['then'](function(_0x95d51a){logger[_0x1e19('0xb')](_0x1e19('0xc'),_0x5996db,_0x1e19('0xd'));logger[_0x1e19('0xe')](_0x1e19('0xf'),_0x5996db,_0x1e19('0xd'),JSON[_0x1e19('0x10')](_0x95d51a));if(_0x95d51a[_0x1e19('0x11')]){if(_0x95d51a[_0x1e19('0x11')][_0x1e19('0x12')]===0x1f4){logger[_0x1e19('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x5996db,_0x95d51a[_0x1e19('0x11')]['message']);return _0xd0e526(_0x95d51a['error']['message']);}logger[_0x1e19('0x11')](_0x1e19('0xc'),_0x5996db,_0x95d51a['error']['message']);return _0x61606d(_0x95d51a[_0x1e19('0x11')][_0x1e19('0x13')]);}else{logger[_0x1e19('0xb')](_0x1e19('0xc'),_0x5996db,_0x1e19('0xd'));_0x61606d(_0x95d51a['result']['message']);}})[_0x1e19('0x14')](function(_0x3e9604){logger[_0x1e19('0x11')](_0x1e19('0xc'),_0x5996db,_0x3e9604);_0xd0e526(_0x3e9604);});});}
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js
index 9104aa9..208f549 100644
--- a/server/api/userOpenchannelQueue/index.js
+++ b/server/api/userOpenchannelQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5e2f=['exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x164d16,_0x2f39a9){var _0x2cff6b=function(_0x32f3c7){while(--_0x32f3c7){_0x164d16['push'](_0x164d16['shift']());}};_0x2cff6b(++_0x2f39a9);}(_0x5e2f,0x14b));var _0xf5e2=function(_0x31603f,_0x5240f3){_0x31603f=_0x31603f-0x0;var _0x4d0d60=_0x5e2f[_0x31603f];return _0x4d0d60;};'use strict';var multer=require(_0xf5e2('0x0'));var util=require('util');var path=require(_0xf5e2('0x1'));var timeout=require(_0xf5e2('0x2'));var express=require(_0xf5e2('0x3'));var router=express['Router']();var auth=require(_0xf5e2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xf5e2('0x5')]=router;
\ No newline at end of file
+var _0xf2a4=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x33cf0f,_0x23e998){var _0x48fd96=function(_0x2b12e0){while(--_0x2b12e0){_0x33cf0f['push'](_0x33cf0f['shift']());}};_0x48fd96(++_0x23e998);}(_0xf2a4,0x10b));var _0x4f2a=function(_0x1bab8f,_0x18edbc){_0x1bab8f=_0x1bab8f-0x0;var _0x1861ac=_0xf2a4[_0x1bab8f];return _0x1861ac;};'use strict';var multer=require(_0x4f2a('0x0'));var util=require('util');var path=require(_0x4f2a('0x1'));var timeout=require(_0x4f2a('0x2'));var express=require('express');var router=express[_0x4f2a('0x3')]();var auth=require(_0x4f2a('0x4'));var interaction=require(_0x4f2a('0x5'));var config=require('../../config/environment');module[_0x4f2a('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
index ab0bd25..81576c4 100644
--- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
+++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x5a4154,_0x55dfd8){var _0x1f4746=function(_0x559225){while(--_0x559225){_0x5a4154['push'](_0x5a4154['shift']());}};_0x1f4746(++_0x55dfd8);}(_0xe706,0xa3));var _0x6e70=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0xe706[_0xd0cd0b];return _0x59cced;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbaf0=['exports','INTEGER'];(function(_0x545a3a,_0x3123aa){var _0x5a5493=function(_0x4e6bce){while(--_0x4e6bce){_0x545a3a['push'](_0x545a3a['shift']());}};_0x5a5493(++_0x3123aa);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
index 11878cf..d58b058 100644
--- a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
+++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x76f6=['api','moment','bluebird','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','lodash','util'];(function(_0x92d83a,_0x13ce86){var _0x416fdd=function(_0x33e4f6){while(--_0x33e4f6){_0x92d83a['push'](_0x92d83a['shift']());}};_0x416fdd(++_0x13ce86);}(_0x76f6,0x1b7));var _0x676f=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x76f6[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0x676f('0x0'));var util=require(_0x676f('0x1'));var logger=require('../../config/logger')(_0x676f('0x2'));var moment=require(_0x676f('0x3'));var BPromise=require(_0x676f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x676f('0x5'));var config=require(_0x676f('0x6'));var attributes=require(_0x676f('0x7'));module[_0x676f('0x8')]=function(_0x2f6e05,_0x5de28a){return _0x2f6e05['define']('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x20bf=['user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0x20bf,0x160));var _0xf20b=function(_0x315ba2,_0x3f2673){_0x315ba2=_0x315ba2-0x0;var _0x4faa16=_0x20bf[_0x315ba2];return _0x4faa16;};'use strict';var _=require(_0xf20b('0x0'));var util=require(_0xf20b('0x1'));var logger=require(_0xf20b('0x2'))(_0xf20b('0x3'));var moment=require('moment');var BPromise=require(_0xf20b('0x4'));var rp=require(_0xf20b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf20b('0x6'));var config=require(_0xf20b('0x7'));var attributes=require(_0xf20b('0x8'));module[_0xf20b('0x9')]=function(_0x24a6df,_0x157141){return _0x24a6df[_0xf20b('0xa')](_0xf20b('0xb'),attributes,{'tableName':_0xf20b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
index 7c5e1cb..4ac401a 100644
--- a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
+++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x94f4=['jayson/promise','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x94f4,0xa7));var _0x494f=function(_0x11f49a,_0x321122){_0x11f49a=_0x11f49a-0x0;var _0x34054e=_0x94f4[_0x11f49a];return _0x34054e;};'use strict';var _=require(_0x494f('0x0'));var util=require(_0x494f('0x1'));var moment=require('moment');var BPromise=require(_0x494f('0x2'));var rs=require(_0x494f('0x3'));var fs=require('fs');var Redis=require(_0x494f('0x4'));var db=require(_0x494f('0x5'))['db'];var utils=require(_0x494f('0x6'));var logger=require(_0x494f('0x7'))('rpc');var config=require(_0x494f('0x8'));var jayson=require(_0x494f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e5c16,_0x1f698b,_0x45c7a6){return new BPromise(function(_0x44f80d,_0x467fd9){return client[_0x494f('0xa')](_0x3e5c16,_0x45c7a6)[_0x494f('0xb')](function(_0x296efb){logger[_0x494f('0xc')](_0x494f('0xd'),_0x1f698b,'request\x20sent');logger[_0x494f('0xe')](_0x494f('0xf'),_0x1f698b,_0x494f('0x10'),JSON[_0x494f('0x11')](_0x296efb));if(_0x296efb[_0x494f('0x12')]){if(_0x296efb['error']['code']===0x1f4){logger[_0x494f('0x12')](_0x494f('0xd'),_0x1f698b,_0x296efb[_0x494f('0x12')]['message']);return _0x467fd9(_0x296efb[_0x494f('0x12')]['message']);}logger[_0x494f('0x12')](_0x494f('0xd'),_0x1f698b,_0x296efb[_0x494f('0x12')][_0x494f('0x13')]);return _0x44f80d(_0x296efb[_0x494f('0x12')]['message']);}else{logger[_0x494f('0xc')](_0x494f('0xd'),_0x1f698b,_0x494f('0x10'));_0x44f80d(_0x296efb[_0x494f('0x14')][_0x494f('0x13')]);}})[_0x494f('0x15')](function(_0x161317){logger[_0x494f('0x12')](_0x494f('0xd'),_0x1f698b,_0x161317);_0x467fd9(_0x161317);});});}
\ No newline at end of file
+var _0x8db9=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0x8db9,0xac));var _0x98db=function(_0x37f067,_0x48960b){_0x37f067=_0x37f067-0x0;var _0x31f16f=_0x8db9[_0x37f067];return _0x31f16f;};'use strict';var _=require(_0x98db('0x0'));var util=require(_0x98db('0x1'));var moment=require(_0x98db('0x2'));var BPromise=require(_0x98db('0x3'));var rs=require(_0x98db('0x4'));var fs=require('fs');var Redis=require(_0x98db('0x5'));var db=require(_0x98db('0x6'))['db'];var utils=require(_0x98db('0x7'));var logger=require(_0x98db('0x8'))('rpc');var config=require(_0x98db('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98db('0xa')][_0x98db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11faac,_0x12886e,_0xf3d2ce){return new BPromise(function(_0x4a48af,_0x15cdaf){return client[_0x98db('0xc')](_0x11faac,_0xf3d2ce)[_0x98db('0xd')](function(_0xe8b2fa){logger[_0x98db('0xe')](_0x98db('0xf'),_0x12886e,_0x98db('0x10'));logger[_0x98db('0x11')](_0x98db('0x12'),_0x12886e,_0x98db('0x10'),JSON['stringify'](_0xe8b2fa));if(_0xe8b2fa['error']){if(_0xe8b2fa[_0x98db('0x13')]['code']===0x1f4){logger[_0x98db('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x12886e,_0xe8b2fa[_0x98db('0x13')][_0x98db('0x14')]);return _0x15cdaf(_0xe8b2fa[_0x98db('0x13')][_0x98db('0x14')]);}logger[_0x98db('0x13')](_0x98db('0xf'),_0x12886e,_0xe8b2fa[_0x98db('0x13')][_0x98db('0x14')]);return _0x4a48af(_0xe8b2fa[_0x98db('0x13')][_0x98db('0x14')]);}else{logger[_0x98db('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x12886e,_0x98db('0x10'));_0x4a48af(_0xe8b2fa[_0x98db('0x15')]['message']);}})[_0x98db('0x16')](function(_0x3076b7){logger[_0x98db('0x13')](_0x98db('0xf'),_0x12886e,_0x3076b7);_0x15cdaf(_0x3076b7);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js
index 10d52fe..40bdce0 100644
--- a/server/api/userProfile/index.js
+++ b/server/api/userProfile/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa331=['/describe','describe','/:id','isAuthenticated','show','/:id/sections','getSections','/:id/resources','post','addSections','addResources','put','update','delete','destroy','removeSections','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./userProfile.controller','index','get'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa331,0x1eb));var _0x1a33=function(_0x37f0ef,_0x4911c9){_0x37f0ef=_0x37f0ef-0x0;var _0x452c30=_0xa331[_0x37f0ef];return _0x452c30;};'use strict';var multer=require(_0x1a33('0x0'));var util=require('util');var path=require(_0x1a33('0x1'));var timeout=require(_0x1a33('0x2'));var express=require(_0x1a33('0x3'));var router=express['Router']();var auth=require(_0x1a33('0x4'));var interaction=require(_0x1a33('0x5'));var config=require('../../config/environment');var controller=require(_0x1a33('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1a33('0x7')]);router[_0x1a33('0x8')](_0x1a33('0x9'),auth['isAuthenticated'](),controller[_0x1a33('0xa')]);router[_0x1a33('0x8')](_0x1a33('0xb'),auth[_0x1a33('0xc')](),controller[_0x1a33('0xd')]);router['get'](_0x1a33('0xe'),auth[_0x1a33('0xc')](),controller[_0x1a33('0xf')]);router[_0x1a33('0x8')](_0x1a33('0x10'),auth[_0x1a33('0xc')](),controller['getResources']);router[_0x1a33('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1a33('0x11')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router['post'](_0x1a33('0xe'),auth[_0x1a33('0xc')](),controller[_0x1a33('0x12')]);router[_0x1a33('0x11')](_0x1a33('0x10'),auth[_0x1a33('0xc')](),controller[_0x1a33('0x13')]);router[_0x1a33('0x14')](_0x1a33('0xb'),auth[_0x1a33('0xc')](),controller[_0x1a33('0x15')]);router[_0x1a33('0x16')](_0x1a33('0xb'),auth['isAuthenticated'](),controller[_0x1a33('0x17')]);router[_0x1a33('0x16')]('/:id/sections',auth['isAuthenticated'](),controller[_0x1a33('0x18')]);router[_0x1a33('0x16')](_0x1a33('0x10'),auth[_0x1a33('0xc')](),controller['removeResources']);module['exports']=router;
\ No newline at end of file
+var _0xe098=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe098,0x10a));var _0x8e09=function(_0x2e2018,_0x291a21){_0x2e2018=_0x2e2018-0x0;var _0xfa6cac=_0xe098[_0x2e2018];return _0xfa6cac;};'use strict';var multer=require(_0x8e09('0x0'));var util=require(_0x8e09('0x1'));var path=require(_0x8e09('0x2'));var timeout=require(_0x8e09('0x3'));var express=require('express');var router=express[_0x8e09('0x4')]();var auth=require(_0x8e09('0x5'));var interaction=require(_0x8e09('0x6'));var config=require(_0x8e09('0x7'));var controller=require(_0x8e09('0x8'));router[_0x8e09('0x9')]('/',auth[_0x8e09('0xa')](),controller[_0x8e09('0xb')]);router[_0x8e09('0x9')]('/describe',auth[_0x8e09('0xa')](),controller[_0x8e09('0xc')]);router['get'](_0x8e09('0xd'),auth[_0x8e09('0xa')](),controller['show']);router[_0x8e09('0x9')](_0x8e09('0xe'),auth['isAuthenticated'](),controller[_0x8e09('0xf')]);router['get'](_0x8e09('0x10'),auth[_0x8e09('0xa')](),controller[_0x8e09('0x11')]);router[_0x8e09('0x12')]('/',auth['isAuthenticated'](),controller[_0x8e09('0x13')]);router[_0x8e09('0x12')](_0x8e09('0x14'),auth[_0x8e09('0xa')](),controller[_0x8e09('0x15')]);router[_0x8e09('0x12')](_0x8e09('0xe'),auth[_0x8e09('0xa')](),controller[_0x8e09('0x16')]);router[_0x8e09('0x12')](_0x8e09('0x10'),auth[_0x8e09('0xa')](),controller[_0x8e09('0x17')]);router[_0x8e09('0x18')](_0x8e09('0xd'),auth[_0x8e09('0xa')](),controller['update']);router[_0x8e09('0x19')](_0x8e09('0xd'),auth['isAuthenticated'](),controller[_0x8e09('0x1a')]);router[_0x8e09('0x19')](_0x8e09('0xe'),auth[_0x8e09('0xa')](),controller[_0x8e09('0x1b')]);router['delete'](_0x8e09('0x10'),auth[_0x8e09('0xa')](),controller[_0x8e09('0x1c')]);module[_0x8e09('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js
index f384118..4400112 100644
--- a/server/api/userProfile/userProfile.attributes.js
+++ b/server/api/userProfile/userProfile.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3609=['crudPermissions','sequelize','exports','STRING','name','setDataValue','join','getDataValue'];(function(_0x2e25db,_0x16e096){var _0x4e5253=function(_0x2d2e61){while(--_0x2d2e61){_0x2e25db['push'](_0x2e25db['shift']());}};_0x4e5253(++_0x16e096);}(_0x3609,0x101));var _0x9360=function(_0x1a2f00,_0x431624){_0x1a2f00=_0x1a2f00-0x0;var _0x41c560=_0x3609[_0x1a2f00];return _0x41c560;};'use strict';var Sequelize=require(_0x9360('0x0'));module[_0x9360('0x1')]={'name':{'type':Sequelize[_0x9360('0x2')],'allowNull':![],'unique':_0x9360('0x3')},'crudPermissions':{'type':Sequelize[_0x9360('0x2')],'set':function(_0x42aad5){this[_0x9360('0x4')]('crudPermissions',_0x42aad5?_0x42aad5[_0x9360('0x5')](''):[]);},'get':function(){return this[_0x9360('0x6')](_0x9360('0x7'))?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9360('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xc474=['sequelize','exports','name','STRING','setDataValue','crudPermissions','getDataValue','split'];(function(_0x3a72a4,_0x5c9292){var _0x556f7f=function(_0x1da2c6){while(--_0x1da2c6){_0x3a72a4['push'](_0x3a72a4['shift']());}};_0x556f7f(++_0x5c9292);}(_0xc474,0xe8));var _0x4c47=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xc474[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x4c47('0x0'));module[_0x4c47('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4c47('0x2')},'crudPermissions':{'type':Sequelize[_0x4c47('0x3')],'set':function(_0x14ba6b){this[_0x4c47('0x4')](_0x4c47('0x5'),_0x14ba6b?_0x14ba6b['join'](''):[]);},'get':function(){return this[_0x4c47('0x6')](_0x4c47('0x5'))?this[_0x4c47('0x6')](_0x4c47('0x5'))[_0x4c47('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x4c47('0x3')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js
index 032f531..ce421ab 100644
--- a/server/api/userProfile/userProfile.controller.js
+++ b/server/api/userProfile/userProfile.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98e8=['ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Interval','pauses','Pause','sounds','Sound','tags','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','UserProfile','includeAll','include','findAll','catch','show','params','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','each','autoAssociation','sectionId','userProfileId','UserProfileSection','UserProfileResource','Resources','find','describe','sequelize','transaction','push','removeSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','ids','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','all','ignore','union','hasOwnProperty','order','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','DefaultReports','CustomReports','CmContact','Tags','color','tag','Tag','rows','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','voicemails','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','OpenchannelQueue','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts'];(function(_0x33e738,_0x4746e7){var _0x2e5d3a=function(_0x114da4){while(--_0x114da4){_0x33e738['push'](_0x33e738['shift']());}};_0x2e5d3a(++_0x4746e7);}(_0x98e8,0x109));var _0x898e=function(_0x3c1f25,_0x295d40){_0x3c1f25=_0x3c1f25-0x0;var _0x403fc2=_0x98e8[_0x3c1f25];return _0x403fc2;};'use strict';var pdf=require(_0x898e('0x0'));var emlformat=require(_0x898e('0x1'));var rimraf=require(_0x898e('0x2'));var zipdir=require(_0x898e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x898e('0x4'));var moment=require(_0x898e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x898e('0x6'));var path=require('path');var sox=require(_0x898e('0x7'));var csv=require(_0x898e('0x8'));var ejs=require(_0x898e('0x9'));var fs=require('fs');var _=require(_0x898e('0xa'));var squel=require(_0x898e('0xb'));var crypto=require(_0x898e('0xc'));var jsforce=require(_0x898e('0xd'));var deskjs=require(_0x898e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x898e('0xf'));var Papa=require(_0x898e('0x10'));var Redis=require(_0x898e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x898e('0x12'));var as=require(_0x898e('0x13'));var hardwareService=require(_0x898e('0x14'));var logger=require(_0x898e('0x15'))(_0x898e('0x16'));var utils=require(_0x898e('0x17'));var config=require('../../config/environment');var db=require(_0x898e('0x18'))['db'];config['redis']=_['defaults'](config[_0x898e('0x19')],{'host':_0x898e('0x1a'),'port':0x18eb});var socket=require(_0x898e('0x1b'))(new Redis(config[_0x898e('0x19')]));require(_0x898e('0x1c'))['register'](socket);function respondWithStatusCode(_0x2dff71,_0x494838){_0x494838=_0x494838||0xcc;return function(_0x21761d){if(_0x21761d){return _0x2dff71[_0x898e('0x1d')](_0x494838);}return _0x2dff71[_0x898e('0x1e')](_0x494838)[_0x898e('0x1f')]();};}function respondWithResult(_0x3b7afb,_0x44ac32){_0x44ac32=_0x44ac32||0xc8;return function(_0x1952d0){if(_0x1952d0){return _0x3b7afb[_0x898e('0x1e')](_0x44ac32)[_0x898e('0x20')](_0x1952d0);}};}function respondWithFilteredResult(_0x101344,_0x364bf7){return function(_0x5c8470){if(_0x5c8470){var _0xcd9dd6=_0x5c8470[_0x898e('0x21')],_0x6c3f71=_0x364bf7[_0x898e('0x22')],_0x28cdbb=_0x364bf7['offset']+_0x364bf7[_0x898e('0x23')],_0x139d8a;if(_0x28cdbb>=_0xcd9dd6){_0x28cdbb=_0xcd9dd6;_0x139d8a=0xc8;}else{_0x139d8a=0xce;}_0x101344[_0x898e('0x1e')](_0x139d8a);return _0x101344[_0x898e('0x24')](_0x898e('0x25'),_0x6c3f71+'-'+_0x28cdbb+'/'+_0xcd9dd6)[_0x898e('0x20')](_0x5c8470);}return null;};}function patchUpdates(_0x28a602){return function(_0x1937e9){try{jsonpatch[_0x898e('0x26')](_0x1937e9,_0x28a602,!![]);}catch(_0x135695){return BPromise['reject'](_0x135695);}return _0x1937e9[_0x898e('0x27')]();};}function saveUpdates(_0x1d766d,_0x518407){return function(_0x5d1618){if(_0x5d1618){return _0x5d1618[_0x898e('0x28')](_0x1d766d)[_0x898e('0x29')](function(_0x40dfc2){return _0x40dfc2;});}return null;};}function removeEntity(_0x4db6db,_0x374e4d){return function(_0x43980a){if(_0x43980a){return _0x43980a[_0x898e('0x2a')]()['then'](function(){_0x4db6db['status'](0xcc)[_0x898e('0x1f')]();});}};}function handleEntityNotFound(_0x265702,_0x3f2ee1){return function(_0x2a4ab2){if(!_0x2a4ab2){_0x265702['sendStatus'](0x194);}return _0x2a4ab2;};}function handleError(_0x15eb19,_0x3eba7f){_0x3eba7f=_0x3eba7f||0x1f4;return function(_0xb99b1c){logger[_0x898e('0x2b')](_0xb99b1c['stack']);if(_0xb99b1c[_0x898e('0x2c')]){delete _0xb99b1c[_0x898e('0x2c')];}_0x15eb19[_0x898e('0x1e')](_0x3eba7f)[_0x898e('0x2d')](_0xb99b1c);};}exports[_0x898e('0x2e')]=function(_0x5b87ef,_0x44a93c){var _0x4af1f7={},_0xabb3e1={},_0x1129ee={'count':0x0,'rows':[]};var _0x1300be=_[_0x898e('0x2f')](db['UserProfile'][_0x898e('0x30')],function(_0x5592bb){return{'name':_0x5592bb['fieldName'],'type':_0x5592bb['type']['key']};});_0xabb3e1[_0x898e('0x31')]=_[_0x898e('0x2f')](_0x1300be,'name');_0xabb3e1[_0x898e('0x32')]=_[_0x898e('0x33')](_0x5b87ef['query']);_0xabb3e1[_0x898e('0x34')]=_['intersection'](_0xabb3e1[_0x898e('0x31')],_0xabb3e1[_0x898e('0x32')]);_0x4af1f7[_0x898e('0x35')]=_[_0x898e('0x36')](_0xabb3e1[_0x898e('0x31')],qs[_0x898e('0x37')](_0x5b87ef[_0x898e('0x32')][_0x898e('0x37')]));_0x4af1f7[_0x898e('0x35')]=_0x4af1f7[_0x898e('0x35')][_0x898e('0x38')]?_0x4af1f7[_0x898e('0x35')]:_0xabb3e1[_0x898e('0x31')];if(!_0x5b87ef[_0x898e('0x32')]['hasOwnProperty'](_0x898e('0x39'))){_0x4af1f7[_0x898e('0x23')]=qs[_0x898e('0x23')](_0x5b87ef[_0x898e('0x32')][_0x898e('0x23')]);_0x4af1f7[_0x898e('0x22')]=qs[_0x898e('0x22')](_0x5b87ef[_0x898e('0x32')][_0x898e('0x22')]);}_0x4af1f7['order']=qs[_0x898e('0x3a')](_0x5b87ef[_0x898e('0x32')][_0x898e('0x3a')]);_0x4af1f7[_0x898e('0x3b')]=qs['filters'](_[_0x898e('0x3c')](_0x5b87ef[_0x898e('0x32')],_0xabb3e1[_0x898e('0x34')]),_0x1300be);if(_0x5b87ef[_0x898e('0x32')][_0x898e('0x3d')]){_0x4af1f7[_0x898e('0x3b')]=_['merge'](_0x4af1f7[_0x898e('0x3b')],{'$or':_[_0x898e('0x2f')](_0x1300be,function(_0x45418e){if(_0x45418e[_0x898e('0x3e')]!==_0x898e('0x3f')){var _0x5f7d8c={};_0x5f7d8c[_0x45418e[_0x898e('0x2c')]]={'$like':'%'+_0x5b87ef[_0x898e('0x32')]['filter']+'%'};return _0x5f7d8c;}})});}_0x4af1f7=_[_0x898e('0x40')]({},_0x4af1f7,_0x5b87ef[_0x898e('0x41')]);var _0x35e169={'where':_0x4af1f7['where']};return db[_0x898e('0x42')][_0x898e('0x21')](_0x35e169)['then'](function(_0x3ac703){_0x1129ee['count']=_0x3ac703;if(_0x5b87ef[_0x898e('0x32')][_0x898e('0x43')]){_0x4af1f7[_0x898e('0x44')]=[{'all':!![]}];}return db[_0x898e('0x42')][_0x898e('0x45')](_0x4af1f7);})['then'](function(_0x2ca3de){_0x1129ee['rows']=_0x2ca3de;return _0x1129ee;})['then'](respondWithFilteredResult(_0x44a93c,_0x4af1f7))[_0x898e('0x46')](handleError(_0x44a93c,null));};exports[_0x898e('0x47')]=function(_0x283653,_0x46a53b){var _0x2601f2={'raw':![],'where':{'id':_0x283653[_0x898e('0x48')]['id']}},_0x5e26a2={};_0x5e26a2['model']=_['keys'](db[_0x898e('0x42')]['rawAttributes']);_0x5e26a2[_0x898e('0x32')]=_[_0x898e('0x33')](_0x283653[_0x898e('0x32')]);_0x5e26a2[_0x898e('0x34')]=_['intersection'](_0x5e26a2['model'],_0x5e26a2[_0x898e('0x32')]);_0x2601f2[_0x898e('0x35')]=_[_0x898e('0x36')](_0x5e26a2[_0x898e('0x31')],qs[_0x898e('0x37')](_0x283653[_0x898e('0x32')]['fields']));_0x2601f2[_0x898e('0x35')]=_0x2601f2['attributes'][_0x898e('0x38')]?_0x2601f2[_0x898e('0x35')]:_0x5e26a2[_0x898e('0x31')];if(_0x283653['query']['includeAll']){_0x2601f2['include']=[{'all':!![]}];}_0x2601f2=_[_0x898e('0x40')]({},_0x2601f2,_0x283653['options']);return db['UserProfile']['find'](_0x2601f2)[_0x898e('0x29')](handleEntityNotFound(_0x46a53b,null))['then'](respondWithResult(_0x46a53b,null))[_0x898e('0x46')](handleError(_0x46a53b,null));};exports[_0x898e('0x49')]=function(_0x596ec0,_0x547b41){return db[_0x898e('0x42')][_0x898e('0x49')](_0x596ec0[_0x898e('0x4a')],{})[_0x898e('0x29')](respondWithResult(_0x547b41,0xc9))[_0x898e('0x46')](handleError(_0x547b41,null));};exports[_0x898e('0x4b')]=function(_0x549163,_0x39e5b7){var _0x3bd80e={'where':{'id':_0x549163[_0x898e('0x48')]['id']}},_0x23cdbd={};_0x23cdbd[_0x898e('0x31')]=_[_0x898e('0x33')](db['UserProfile'][_0x898e('0x30')]);_0x3bd80e[_0x898e('0x35')]=_[_0x898e('0x36')](_0x23cdbd[_0x898e('0x31')],qs['fields'](_0x549163[_0x898e('0x32')][_0x898e('0x37')]));_0x3bd80e['attributes']=_0x3bd80e[_0x898e('0x35')][_0x898e('0x38')]?_0x3bd80e[_0x898e('0x35')]:_0x23cdbd[_0x898e('0x31')];if(_0x549163[_0x898e('0x32')][_0x898e('0x43')]){_0x3bd80e[_0x898e('0x44')]=[{'all':!![]}];}_0x3bd80e=_[_0x898e('0x40')]({},_0x3bd80e,_0x549163['options']);return db['UserProfile']['find'](_0x3bd80e)[_0x898e('0x29')](handleEntityNotFound(_0x39e5b7,null))[_0x898e('0x29')](function(_0x315207){if(_0x315207){var _0x17e10a=_0x315207[_0x898e('0x4c')]({'plain':!![]});_0x17e10a=qs[_0x898e('0x4d')](_0x17e10a,['id',_0x898e('0x4e'),_0x898e('0x4f'),_0x898e('0x50')]);_0x549163[_0x898e('0x4a')]=_[_0x898e('0x4d')](_0x549163[_0x898e('0x4a')],['id',_0x898e('0x4e'),_0x898e('0x4f')]);return db['sequelize']['transaction'](function(_0x24d0bb){return db[_0x898e('0x42')][_0x898e('0x49')](_[_0x898e('0x40')](_0x17e10a,_0x549163[_0x898e('0x4a')]),{'include':_0x549163[_0x898e('0x32')][_0x898e('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x24d0bb})['then'](function(_0x4679c1){var _0x3e76fe=_0x4679c1[_0x898e('0x4c')]({'plain':!![]});return db['UserProfileSection'][_0x898e('0x45')]({'where':{'userProfileId':_0x549163[_0x898e('0x48')]['id']},'raw':!![]})['then'](function(_0x23d14e){if(_0x23d14e){return BPromise[_0x898e('0x51')](_0x23d14e,function(_0x19f0a5){return new BPromise(function(_0x12ab4e,_0x6e3b1){if(_0x19f0a5[_0x898e('0x52')]===null||_0x19f0a5[_0x898e('0x52')]===0x1)_0x12ab4e(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x19f0a5['id']},'raw':!![]})['then'](function(_0x16f32d){var _0x1c182b=_[_0x898e('0x2f')](_0x16f32d,function(_0x3a4cc8){return qs['omit'](_0x3a4cc8,['id',_0x898e('0x4e'),_0x898e('0x4f'),_0x898e('0x53')]);});_0x12ab4e(_0x1c182b);})[_0x898e('0x46')](function(_0x1aada9){_0x6e3b1(_0x1aada9);});})[_0x898e('0x29')](function(_0x35cff1){var _0x18340e=qs['omit'](_0x19f0a5,['id','createdAt',_0x898e('0x4f')]);_0x18340e[_0x898e('0x54')]=_0x3e76fe['id'];if(_0x35cff1)_0x18340e['Resources']=_0x35cff1;return _0x18340e;})[_0x898e('0x29')](function(_0x41d8d7){return db[_0x898e('0x55')][_0x898e('0x49')](_0x41d8d7,{'include':[{'model':db[_0x898e('0x56')],'as':_0x898e('0x57')}],'raw':!![],'transaction':_0x24d0bb});});})[_0x898e('0x29')](function(){return _0x3e76fe;});}});});});}})['then'](respondWithResult(_0x39e5b7,0xc9))[_0x898e('0x46')](handleError(_0x39e5b7,null));};exports[_0x898e('0x28')]=function(_0xc9a20c,_0x185787){if(_0xc9a20c['body']['id']){delete _0xc9a20c[_0x898e('0x4a')]['id'];}return db[_0x898e('0x42')][_0x898e('0x58')]({'where':{'id':_0xc9a20c[_0x898e('0x48')]['id']}})[_0x898e('0x29')](handleEntityNotFound(_0x185787,null))['then'](saveUpdates(_0xc9a20c[_0x898e('0x4a')],null))['then'](respondWithResult(_0x185787,null))[_0x898e('0x46')](handleError(_0x185787,null));};exports[_0x898e('0x2a')]=function(_0x28155f,_0x3b1ece){return db[_0x898e('0x42')][_0x898e('0x58')]({'where':{'id':_0x28155f['params']['id']}})[_0x898e('0x29')](handleEntityNotFound(_0x3b1ece,null))['then'](removeEntity(_0x3b1ece,null))[_0x898e('0x46')](handleError(_0x3b1ece,null));};exports[_0x898e('0x59')]=function(_0x2ba1c6,_0x5d44e3){return db[_0x898e('0x42')][_0x898e('0x59')]()[_0x898e('0x29')](respondWithResult(_0x5d44e3,null))['catch'](handleError(_0x5d44e3,null));};exports['addSections']=function(_0xf9bf52,_0x2197eb){var _0x2d5323=_0xf9bf52[_0x898e('0x4a')];return db[_0x898e('0x42')][_0x898e('0x58')]({'where':{'id':_0xf9bf52[_0x898e('0x48')]['id']}})['then'](handleEntityNotFound(_0x2197eb,null))[_0x898e('0x29')](function(_0xeb813){if(_0xeb813){return db[_0x898e('0x5a')][_0x898e('0x5b')](function(_0x24358a){return db[_0x898e('0x55')]['destroy']({'where':{'userProfileId':_0xf9bf52['params']['id'],'sectionId':_[_0x898e('0x2f')](_0x2d5323,function(_0x3f512c){return _0x3f512c[_0x898e('0x53')];})},'transaction':_0x24358a})['then'](function(){var _0x57d246=_[_0x898e('0x2f')](_0x2d5323,function(_0x3a4da8){_0x3a4da8[_0x898e('0x54')]=_0xf9bf52[_0x898e('0x48')]['id'];return _0x3a4da8;});var _0x2ba5c2=[];return BPromise[_0x898e('0x51')](_0x57d246,function(_0x394cc8){return db[_0x898e('0x55')]['create'](_0x394cc8,{'include':[{'model':db[_0x898e('0x56')],'as':_0x898e('0x57')}],'raw':!![],'transaction':_0x24358a})[_0x898e('0x29')](function(_0xf9b63d){_0x2ba5c2[_0x898e('0x5c')](_0xf9b63d['get']({'plain':!![]}));});})[_0x898e('0x29')](function(){return _0x2ba5c2;});});});}})[_0x898e('0x29')](function(_0x39c625){return _0x39c625;})['then'](respondWithResult(_0x2197eb,null))[_0x898e('0x46')](handleError(_0x2197eb,null));};exports[_0x898e('0x5d')]=function(_0x207458,_0x290a1f){var _0x455876;return db[_0x898e('0x42')][_0x898e('0x58')]({'where':{'id':_0x207458[_0x898e('0x48')]['id']},'attributes':['id',_0x898e('0x2c')]})[_0x898e('0x29')](handleEntityNotFound(_0x290a1f,null))['then'](function(_0x2fb1cb){if(_0x2fb1cb){_0x455876=_0x2fb1cb;return db[_0x898e('0x55')]['destroy']({'where':{'userProfileId':_0x207458[_0x898e('0x48')]['id'],'sectionId':_0x207458[_0x898e('0x32')]['ids']}});}})[_0x898e('0x29')](function(){return _0x455876;})[_0x898e('0x29')](respondWithStatusCode(_0x290a1f,null))[_0x898e('0x46')](handleError(_0x290a1f,null));};exports['getSections']=function(_0x504a75,_0x7c0c74){var _0x465d65=[];var _0x4a44a7=[];return db['UserProfileSection'][_0x898e('0x45')]({'where':{'userProfileId':_0x504a75[_0x898e('0x48')]['id']},'raw':!![]})['then'](function(_0x25173c){_0x465d65=_[_0x898e('0x3d')](_0x25173c,function(_0x29cf3a){return _0x29cf3a[_0x898e('0x5e')]===0x1||_[_0x898e('0x5f')]([0x3eb,0x709],_0x29cf3a['sectionId']);});if(!_[_0x898e('0x60')](_0x465d65)){return _[_0x898e('0x2f')](_0x465d65,function(_0x548bd1){return _0x548bd1[_0x898e('0x53')];});}else{return;}})[_0x898e('0x29')](function(_0x2d69ae){if(_0x2d69ae)_0x4a44a7=_0x2d69ae;if(_[_0x898e('0x5f')](_0x4a44a7,0x64)){var _0x610c23=_[_0x898e('0x58')](_0x465d65,{'sectionId':0x64});return hasDefaultDashboard(_0x610c23)['then'](function(_0x505878){return _[_0x898e('0x2f')](_0x465d65,function(_0x2b1b09){if(_0x2b1b09[_0x898e('0x53')]===0x64){_0x2b1b09[_0x898e('0x61')]=_0x505878;}return _0x2b1b09;});});}else{return;}})['then'](function(_0x57b545){if(_0x57b545)_0x465d65=_0x57b545;if(_[_0x898e('0x5f')](_0x4a44a7,0x3eb)){var _0x2f305c=_[_0x898e('0x58')](_0x465d65,{'sectionId':0x3eb});return getCustomDashboards(_0x2f305c)['then'](function(_0x2aeeb1){return _[_0x898e('0x2f')](_0x465d65,function(_0x254ef3){if(_0x2f305c['enabled']){if(_0x254ef3[_0x898e('0x53')]===0x3eb){_0x254ef3[_0x898e('0x61')]=_0x2aeeb1;}}else{if(_0x254ef3[_0x898e('0x53')]===0x64){_0x254ef3[_0x898e('0x61')]=_0x2aeeb1;}}return _0x254ef3;});});}else{return;}})[_0x898e('0x29')](function(_0x23fff4){if(_0x23fff4)_0x465d65=_0x23fff4;if(_[_0x898e('0x5f')](_0x4a44a7,0x709)){var _0x27b05f=_[_0x898e('0x58')](_0x465d65,{'sectionId':0x709});return getPlugins(_0x27b05f)['then'](function(_0x40ec20){if(_0x27b05f[_0x898e('0x5e')]){return _[_0x898e('0x2f')](_0x465d65,function(_0x239a6e){if(_0x239a6e[_0x898e('0x53')]===0x709){_0x239a6e[_0x898e('0x61')]=_0x40ec20;}return _0x239a6e;});}else{var _0x432646={'sectionId':0x76c,'enabled':0x1,'subsections':_0x40ec20};var _0x44678a=_[_0x898e('0x2f')](_0x465d65);_0x44678a[_0x898e('0x5c')](_0x432646);return _0x44678a;}});}else{return;}})[_0x898e('0x29')](function(_0x5c47d6){if(_0x5c47d6)_0x465d65=_0x5c47d6;return _['filter'](_0x465d65,['enabled',0x1]);})[_0x898e('0x29')](respondWithResult(_0x7c0c74,null))[_0x898e('0x46')](handleError(_0x7c0c74,null));};function hasDefaultDashboard(_0x591d84){var _0x1ee618=[0x65];return new BPromise(function(_0x2d763e,_0x257702){try{if(_0x591d84[_0x898e('0x52')]){_0x2d763e(_0x1ee618);}else{return db[_0x898e('0x56')][_0x898e('0x62')]({'where':{'sectionId':_0x591d84['id']},'raw':!![]})[_0x898e('0x29')](function(_0x50bbeb){_0x50bbeb?_0x2d763e(_0x1ee618):_0x2d763e();});}}catch(_0xafbdb1){_0x257702(_0xafbdb1);}});}function getCustomDashboards(_0x24027e){var _0x133a56=[];return new BPromise(function(_0x169ec3,_0x50cab9){try{if(_0x24027e[_0x898e('0x52')]){return db[_0x898e('0x63')][_0x898e('0x45')]({'raw':!![]})[_0x898e('0x29')](function(_0x32f259){_0x32f259['forEach'](function(_0x3773e8){_0x133a56[_0x898e('0x5c')](_0x3773e8['id']+0x1869f);});_0x169ec3(_0x133a56);});}else{return db['UserProfileResource'][_0x898e('0x45')]({'where':{'sectionId':_0x24027e['id']},'raw':!![]})[_0x898e('0x29')](function(_0x1a7ae1){_0x1a7ae1[_0x898e('0x64')](function(_0x18e3ea){_0x133a56[_0x898e('0x5c')](_0x18e3ea['resourceId']+0x1869f);});_0x169ec3(_0x133a56);});}}catch(_0x3b75c7){_0x50cab9(_0x3b75c7);}});}function getPlugins(_0x27a785){var _0xc66409=[];return new BPromise(function(_0x22fe59,_0xe53506){try{if(_0x27a785[_0x898e('0x52')]){return db[_0x898e('0x65')][_0x898e('0x45')]({'raw':!![]})[_0x898e('0x29')](function(_0x32a0ec){_0x32a0ec[_0x898e('0x64')](function(_0x5a8645){_0xc66409[_0x898e('0x5c')](_0x5a8645['id']+0x15b38);});_0x22fe59(_0xc66409);});}else{return db[_0x898e('0x56')][_0x898e('0x45')]({'where':{'sectionId':_0x27a785['id']},'raw':!![]})[_0x898e('0x29')](function(_0x2e34de){_0x2e34de[_0x898e('0x64')](function(_0x1c4ed1){_0xc66409[_0x898e('0x5c')](_0x1c4ed1[_0x898e('0x66')]+0x15b38);});_0x22fe59(_0xc66409);});}}catch(_0x39418c){_0xe53506(_0x39418c);}});}exports[_0x898e('0x67')]=function(_0x3c4aa1,_0x4321b5){return db[_0x898e('0x42')][_0x898e('0x58')]({'where':{'id':_0x3c4aa1[_0x898e('0x48')]['id']}})[_0x898e('0x29')](handleEntityNotFound(_0x4321b5,null))['then'](function(_0xf2a2fa){if(_0xf2a2fa){return db[_0x898e('0x5a')][_0x898e('0x5b')](function(_0x5d26b0){return db[_0x898e('0x55')][_0x898e('0x45')]({'where':{'userProfileId':_0x3c4aa1['params']['id']},'attributes':['id'],'raw':!![]})[_0x898e('0x29')](function(_0x407f4c){if(_0x407f4c){return db[_0x898e('0x55')][_0x898e('0x2a')]({'where':{'userProfileId':_0x3c4aa1[_0x898e('0x48')]['id'],'id':_['map'](_0x407f4c,function(_0xd640d9){return _0xd640d9['id'];})},'transaction':_0x5d26b0});}})[_0x898e('0x29')](function(_0x56415f){var _0x3de71b=_['map'](_0x3c4aa1[_0x898e('0x4a')],function(_0xbe6110){_0xbe6110[_0x898e('0x54')]=_0x3c4aa1[_0x898e('0x48')]['id'];return _0xbe6110;});return db[_0x898e('0x55')][_0x898e('0x68')](_0x3de71b,{'raw':!![],'transaction':_0x5d26b0});})[_0x898e('0x29')](function(_0x1a46d3){var _0x2fe7e5=_['filter'](_['map'](_0x1a46d3,function(_0x23c72c){return _0x23c72c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2fe7e5){return db[_0x898e('0x55')]['findAll']({'where':{'userProfileId':_0x3c4aa1[_0x898e('0x48')]['id'],'sectionId':_['map'](_0x2fe7e5,function(_0x226b47){return _0x226b47[_0x898e('0x53')];})},'attributes':['id',_0x898e('0x53')],'raw':!![]})[_0x898e('0x29')](function(_0x47cbc6){var _0x163bef=_[_0x898e('0x2f')](_0x3c4aa1[_0x898e('0x4a')],function(_0x4170b3){_0x4170b3['userProfileId']=_0x3c4aa1[_0x898e('0x48')]['id'];return _0x4170b3;});return db['UserProfileResource']['bulkCreate'](_0x163bef,{'raw':!![],'transaction':_0x5d26b0});});}})[_0x898e('0x46')](handleError(_0x4321b5,null));});}})[_0x898e('0x29')](function(_0x2a2ca0){var _0x1d8baa=_[_0x898e('0x2f')](_0x2a2ca0,function(_0x199c09){return _0x199c09[_0x898e('0x4c')]({'plain':!![]});});})[_0x898e('0x29')](respondWithResult(_0x4321b5,null))[_0x898e('0x46')](handleError(_0x4321b5,null));};exports[_0x898e('0x69')]=function(_0xd8d265,_0x219637,_0x4de4b8){return db[_0x898e('0x42')]['find']({'where':{'id':_0xd8d265[_0x898e('0x48')]['id']}})['then'](handleEntityNotFound(_0x219637,null))[_0x898e('0x29')](function(_0x298d12){if(_0x298d12){return _0x298d12['removeResources'](_0xd8d265[_0x898e('0x32')][_0x898e('0x6a')]);}})[_0x898e('0x29')](respondWithStatusCode(_0x219637,null))['catch'](handleError(_0x219637,null));};exports[_0x898e('0x6b')]=function(_0x1d7817,_0x47ab64){var _0x556120={'raw':![],'where':{}};var _0x2c847a={};var _0x35c624={'count':0x0,'rows':[]};var _0x507323=_0x1d7817[_0x898e('0x32')][_0x898e('0x6c')];if(typeof _0x507323===_0x898e('0x6d')){throw new db[(_0x898e('0x6e'))][(_0x898e('0x6f'))](_0x898e('0x70'));}var _0x19c9de=_0x1d7817[_0x898e('0x32')][_0x898e('0x71')]||![];var _0xebaec1=getQueryModels(_0x507323,_0x19c9de);if(typeof _0xebaec1[_0x898e('0x72')]===_0x898e('0x6d')){throw new db[(_0x898e('0x6e'))][(_0x898e('0x6f'))](_0x898e('0x73')+_0x507323+'\x27');}var _0x478f87=[];if(!_[_0x898e('0x60')](_0xebaec1[_0x898e('0x74')])){_0x478f87=_0xebaec1[_0x898e('0x74')];}else{_0x478f87=[{'name':_0x507323}];}return db[_0x898e('0x42')][_0x898e('0x62')]({'where':{'id':_0x1d7817[_0x898e('0x48')]['id']}})[_0x898e('0x29')](handleEntityNotFound(_0x47ab64,null))[_0x898e('0x29')](function(_0x1638be){if(_0x1638be){var _0x138819=[];for(var _0x6c96c9=0x0;_0x6c96c9<_0x478f87[_0x898e('0x38')];_0x6c96c9++){_0x138819['push'](db['UserProfileSection'][_0x898e('0x62')]({'where':{'userProfileId':_0x1638be['id'],'name':_0x478f87[_0x6c96c9][_0x898e('0x2c')]},'raw':!![]}));}return BPromise[_0x898e('0x75')](_0x138819);}})[_0x898e('0x29')](function(_0x564ea2){var _0x1aff35=_[_0x898e('0x3d')](_0x564ea2,function(_0x2635aa){return _0x2635aa?_0x2635aa:undefined;});var _0x8e80e6=_[_0x898e('0x3d')](_0x478f87,[_0x898e('0x76'),!![]]);var _0x2fe4e9=_[_0x898e('0x60')](_0x1aff35)&&_['isEmpty'](_0x8e80e6)?null:_[_0x898e('0x77')](_0x8e80e6,_0x1aff35);if(_0x2fe4e9){var _0x4fd66d=[];for(var _0x147614=0x0;_0x147614<_0x2fe4e9[_0x898e('0x38')];_0x147614++){var _0x5bcc4=_[_0x898e('0x58')](_0x478f87,function(_0x54ee37){return _0x2fe4e9[_0x147614]?_0x54ee37['name']===_0x2fe4e9[_0x147614][_0x898e('0x2c')]:null;});if(_0x5bcc4){if(_0x2fe4e9[_0x147614]['ignore']){_0x4fd66d[_0x898e('0x5c')](getAllResources(_0xebaec1[_0x898e('0x72')],_0x2fe4e9[_0x147614]));}else{if(!_0x2fe4e9[_0x147614][_0x898e('0x52')]){_0x4fd66d[_0x898e('0x5c')](getAllowedResources(_0x5bcc4,_0x2fe4e9[_0x147614],_0xebaec1[_0x898e('0x72')]));}else{if(_0x5bcc4['model']){_0x4fd66d[_0x898e('0x5c')](getAllFilteredResources(_0x5bcc4,_0x2fe4e9[_0x147614]));}}}}}return BPromise[_0x898e('0x75')](_0x4fd66d);}else{return null;}})[_0x898e('0x29')](function(_0x432efd){var _0xbe144b=_0x432efd;var _0x501676=null;if(_0xbe144b){_0x501676=_0xbe144b[_0x898e('0x38')]===0x1?_0xbe144b[0x0]:null;}if(_0x501676||_0xbe144b){var _0xa39fd=db[_0xebaec1[_0x898e('0x72')]]['rawAttributes'];_0x2c847a[_0x898e('0x31')]=_[_0x898e('0x33')](_0xa39fd);_0x2c847a[_0x898e('0x32')]=_[_0x898e('0x33')](_0x1d7817[_0x898e('0x32')]);_0x2c847a[_0x898e('0x34')]=_[_0x898e('0x36')](_0x2c847a['model'],_0x2c847a[_0x898e('0x32')]);_0x556120['attributes']=_[_0x898e('0x36')](_0x2c847a[_0x898e('0x31')],qs['fields'](_0x1d7817[_0x898e('0x32')][_0x898e('0x37')]));_0x556120[_0x898e('0x35')]=_0x556120['attributes'][_0x898e('0x38')]?_0x556120[_0x898e('0x35')]:_0x2c847a[_0x898e('0x31')];if(!_0x1d7817['query'][_0x898e('0x78')](_0x898e('0x39'))){_0x556120[_0x898e('0x23')]=qs[_0x898e('0x23')](_0x1d7817[_0x898e('0x32')][_0x898e('0x23')]);_0x556120[_0x898e('0x22')]=qs[_0x898e('0x22')](_0x1d7817['query']['offset']);}_0x556120[_0x898e('0x79')]=qs['sort'](_0x1d7817['query'][_0x898e('0x3a')]);_0x556120[_0x898e('0x3b')]=qs[_0x898e('0x34')](_['pick'](_0x1d7817[_0x898e('0x32')],_0x2c847a[_0x898e('0x34')]));if(_0x1d7817[_0x898e('0x32')][_0x898e('0x3d')]){_0x556120['where']=_[_0x898e('0x40')](_0x556120[_0x898e('0x3b')],{'$or':_[_0x898e('0x2f')](_0xa39fd,function(_0x3e256f){if(_0x3e256f[_0x898e('0x3e')]['key']!==_0x898e('0x3f')){var _0x276831={};_0x276831[_0x3e256f['field']]={'$like':'%'+_0x1d7817[_0x898e('0x32')][_0x898e('0x3d')]+'%'};return _0x276831;}})});}var _0x2b57ee=[];if(_0x501676){var _0x114456=_[_0x898e('0x58')](_0x478f87,[_0x898e('0x2c'),_0x501676[_0x898e('0x2c')]]);if(_0x114456[_0x898e('0x7a')]){var _0x3c1539={};if(_0xebaec1[_0x898e('0x72')]===_0x898e('0x7b')){_0x3c1539[_0x114456[_0x898e('0x7c')]]=_['map'](_0x501676[_0x898e('0x7d')],'id');}else{_0x3c1539[_0x114456[_0x898e('0x7c')]]=_0x501676[_0x898e('0x7d')];}_0x2b57ee['push'](_0x3c1539);}else{_0x556120['where']['id']=_0x501676[_0x898e('0x7d')];}}else{for(var _0x2761f6=0x0;_0x2761f6<_0xbe144b[_0x898e('0x38')];_0x2761f6++){var _0x114456=_[_0x898e('0x58')](_0x478f87,['name',_0xbe144b[_0x2761f6][_0x898e('0x2c')]]);if(_0x114456[_0x898e('0x7a')]){var _0x3c1539={};_0x3c1539[_0x114456[_0x898e('0x7c')]]=_0xbe144b[_0x2761f6]['associatedResources'];_0x2b57ee[_0x898e('0x5c')](_0x3c1539);}else{if(!_0x556120[_0x898e('0x3b')]['id'])_0x556120[_0x898e('0x3b')]['id']=[];_0xbe144b[_0x2761f6]['associatedResources']['forEach'](function(_0x4993b3){_0x556120[_0x898e('0x3b')]['id'][_0x898e('0x5c')](_0x4993b3);});}}}if(!_['isEmpty'](_0x2b57ee)){_0x556120['where']=_[_0x898e('0x40')](_0x556120[_0x898e('0x3b')],{'$and':{'$or':_0x2b57ee}});}_0x556120=_[_0x898e('0x40')]({},_0x556120,_0x1d7817['options']);if(_0x501676&&!_0x501676[_0x898e('0x52')]&&_0xebaec1[_0x898e('0x72')]===_0x898e('0x7b')){if(_0x1d7817[_0x898e('0x32')][_0x898e('0x43')]){_0x556120['include']=[{'all':!![]}];}return db[_0xebaec1[_0x898e('0x72')]][_0x898e('0x45')](_0x556120)['then'](function(_0x279a95){var _0x3b09a4=[];_0x279a95['forEach'](function(_0x610c71){var _0x224906;switch(_0x610c71[_0x898e('0x7e')]){case _0x898e('0x7f'):_0x224906=_['find'](_0x501676[_0x898e('0x7d')],function(_0x315876){return _0x315876['id']===_0x610c71[_0x898e('0x80')]&&_0x315876[_0x898e('0x3e')]===_0x898e('0x81');});break;case'custom':_0x224906=_[_0x898e('0x58')](_0x501676[_0x898e('0x7d')],function(_0x32f44b){return _0x32f44b['id']===_0x610c71[_0x898e('0x80')]&&_0x32f44b[_0x898e('0x3e')]===_0x898e('0x82');});break;}if(_0x224906)_0x3b09a4[_0x898e('0x5c')](_0x610c71);});_0x35c624[_0x898e('0x21')]=_0x3b09a4[_0x898e('0x38')];_0x35c624['rows']=_0x3b09a4;return _0x35c624;});}else{return db[_0xebaec1[_0x898e('0x72')]]['count']({'where':_0x556120[_0x898e('0x3b')]})[_0x898e('0x29')](function(_0x585cc3){_0x35c624['count']=_0x585cc3;if(_0x1d7817['query'][_0x898e('0x43')]){if(_0xebaec1[_0x898e('0x72')]===_0x898e('0x83')){_0x556120['include']=[{'model':db['Tag'],'as':_0x898e('0x84'),'attributes':['id',_0x898e('0x2c'),_0x898e('0x85')],'required':_0x1d7817[_0x898e('0x32')][_0x898e('0x86')]?!![]:![]},{'model':db[_0x898e('0x87')],'as':'ThroughTags','attributes':['id',_0x898e('0x2c'),'color'],'through':_0x1d7817[_0x898e('0x32')][_0x898e('0x86')]?{'attributes':[],'where':{'TagId':_0x1d7817[_0x898e('0x32')]['tag']||undefined}}:{},'required':_0x1d7817[_0x898e('0x32')]['tag']?!![]:![]}];}else{_0x556120[_0x898e('0x44')]=[{'all':!![]}];}}return db[_0xebaec1[_0x898e('0x72')]]['findAll'](_0x556120);})[_0x898e('0x29')](function(_0x436422){_0x35c624[_0x898e('0x88')]=_0x436422;return _0x35c624;});}}else{return _0x35c624;}})['then'](respondWithFilteredResult(_0x47ab64,_0x556120))[_0x898e('0x46')](handleError(_0x47ab64,null));};function getAllResources(_0x4cf7a4,_0x17ce92){return new BPromise(function(_0x46819,_0x24ea5f){if(_0x17ce92){var _0x30fd73=_0x17ce92['filter']?{[_0x17ce92[_0x898e('0x3d')][_0x898e('0x7a')]]:_0x17ce92[_0x898e('0x3d')][_0x898e('0x89')]}:undefined;return db[_0x4cf7a4][_0x898e('0x45')]({'where':_0x30fd73,'raw':!![]})[_0x898e('0x29')](function(_0x485117){_0x17ce92[_0x898e('0x7d')]=_[_0x898e('0x2f')](_0x485117,'id');_0x46819(_0x17ce92);})[_0x898e('0x46')](function(_0x568e27){_0x24ea5f(_0x568e27);});}else{_0x46819(null);}});}function getAllFilteredResources(_0x2d43ae,_0x52440e){return new BPromise(function(_0x5bb7f5,_0x9400e5){var _0x12421d=_0x2d43ae[_0x898e('0x3d')]?{[_0x2d43ae['filter']['field']]:_0x2d43ae[_0x898e('0x3d')]['value']}:undefined;return db[_0x2d43ae[_0x898e('0x31')]]['findAll']({'where':_0x12421d,'raw':!![]})['then'](function(_0xb17657){_0x52440e[_0x898e('0x7d')]=_[_0x898e('0x2f')](_0xb17657,function(_0x4c898c){return _0x4c898c[_0x898e('0x2c')];});_0x5bb7f5(_0x52440e);})[_0x898e('0x46')](function(_0x5862a1){_0x9400e5(_0x5862a1);});});}function getAllowedResources(_0x1c96a8,_0x403dd6,_0x49c316){return new BPromise(function(_0x3d7a36,_0x4dcdbc){if(_0x403dd6){return db[_0x898e('0x56')][_0x898e('0x45')]({'where':{'sectionId':_0x403dd6['id']},'raw':!![]})['then'](function(_0x1f6557){if(_0x1c96a8[_0x898e('0x7a')]&&_0x1c96a8[_0x898e('0x7a')]!=='id'){_0x403dd6[_0x898e('0x7d')]=_[_0x898e('0x2f')](_0x1f6557,function(_0x48a95a){return _0x48a95a[_0x1c96a8[_0x898e('0x7a')]];});}else{if(_0x49c316==='AnalyticExtractedReport'){_0x403dd6[_0x898e('0x7d')]=_['map'](_0x1f6557,function(_0xcb1ce4){return{'id':_0xcb1ce4[_0x898e('0x66')],'type':_0xcb1ce4[_0x898e('0x3e')]};});}else{_0x403dd6[_0x898e('0x7d')]=_[_0x898e('0x2f')](_0x1f6557,function(_0x2eadb1){return _0x2eadb1[_0x898e('0x66')];});}}_0x3d7a36(_0x403dd6);})[_0x898e('0x46')](function(_0x551e7c){_0x4dcdbc(_0x551e7c);});}else{_0x3d7a36(null);}});}function getQueryModels(_0x522757,_0x253a5f){var _0x7dcb40=_0x522757[_0x898e('0x8a')]();var _0x49745d={'childModel':undefined,'parentSections':[]};switch(_0x7dcb40){case _0x898e('0x8b'):_0x49745d[_0x898e('0x72')]=_0x898e('0x8c');break;case _0x898e('0x8d'):_0x49745d[_0x898e('0x72')]=_0x898e('0x8e');break;case _0x898e('0x8f'):_0x49745d[_0x898e('0x72')]=_0x898e('0x90');_0x49745d[_0x898e('0x74')]=[{'name':_0x898e('0x91'),'field':_0x898e('0x2c'),'foreignKey':_0x898e('0x92')}];break;case _0x898e('0x93'):_0x49745d['childModel']=_0x898e('0x94');break;case _0x898e('0x95'):_0x49745d[_0x898e('0x72')]=_0x898e('0x83');_0x49745d[_0x898e('0x74')]=[{'name':_0x898e('0x96'),'field':'id','foreignKey':'ListId'}];break;case'lists':_0x49745d[_0x898e('0x72')]='CmList';break;case _0x898e('0x97'):_0x49745d[_0x898e('0x72')]=_0x898e('0x98');break;case _0x898e('0x99'):_0x49745d['childModel']=_0x898e('0x9a');break;case'chatqueues':_0x49745d[_0x898e('0x72')]=_0x898e('0x9b');break;case _0x898e('0x9c'):_0x49745d[_0x898e('0x72')]='ChatWebsite';break;case _0x898e('0x9d'):_0x49745d['childModel']='FaxQueue';break;case _0x898e('0x9e'):_0x49745d[_0x898e('0x72')]=_0x898e('0x9f');break;case _0x898e('0xa0'):case'internalroutes':case'outboundroutes':_0x49745d[_0x898e('0x72')]=_0x898e('0xa1');break;case'contexts':_0x49745d[_0x898e('0x72')]='VoiceContext';break;case _0x898e('0xa2'):_0x49745d[_0x898e('0x72')]='VoiceMail';break;case'voicerecordings':_0x49745d[_0x898e('0x72')]=_0x898e('0xa3');_0x49745d[_0x898e('0x74')]=[{'name':_0x898e('0xa4'),'field':_0x898e('0x2c'),'foreignKey':_0x898e('0xa5'),'model':_0x898e('0xa6'),'filter':{'field':_0x898e('0xa7'),'value':[_0x898e('0xa8')]}},{'name':_0x898e('0xa9'),'field':_0x898e('0x2c'),'foreignKey':_0x898e('0xa5'),'model':_0x898e('0xa6'),'filter':{'field':'role','value':[_0x898e('0xaa')]}},{'name':_0x898e('0xab'),'field':'name','foreignKey':'queue','model':_0x898e('0xac'),'filter':{'field':'type','value':['inbound']}},{'name':_0x898e('0xad'),'field':_0x898e('0x2c'),'foreignKey':_0x898e('0xae'),'model':_0x898e('0xac'),'filter':{'field':_0x898e('0x3e'),'value':[_0x898e('0xaf')]}}];break;case'musiconholds':_0x49745d[_0x898e('0x72')]=_0x898e('0xb0');break;case _0x898e('0xb1'):_0x49745d['childModel']=_0x898e('0xb2');break;case'voiceprefixes':_0x49745d[_0x898e('0x72')]=_0x898e('0xb3');break;case _0x898e('0xb4'):_0x49745d[_0x898e('0x72')]=_0x898e('0xb5');break;case _0x898e('0xb6'):_0x49745d[_0x898e('0x72')]=_0x898e('0xb7');break;case'mailaccounts':_0x49745d[_0x898e('0x72')]=_0x898e('0xb8');break;case _0x898e('0xb9'):_0x49745d['childModel']='MailSubstatus';break;case'openchannelqueues':_0x49745d[_0x898e('0x72')]=_0x898e('0xba');break;case'openchannelaccounts':_0x49745d[_0x898e('0x72')]=_0x898e('0xbb');break;case _0x898e('0xbc'):_0x49745d[_0x898e('0x72')]='SmsQueue';break;case _0x898e('0xbd'):_0x49745d[_0x898e('0x72')]=_0x898e('0xbe');break;case'whatsappqueues':_0x49745d[_0x898e('0x72')]=_0x898e('0xbf');break;case _0x898e('0xc0'):_0x49745d['childModel']='WhatsappAccount';break;case _0x898e('0xc1'):_0x49745d['childModel']=_0x898e('0xc2');break;case _0x898e('0xc3'):case _0x898e('0xc4'):_0x49745d[_0x898e('0x72')]=_0x898e('0xac');if(_0x253a5f){_0x49745d[_0x898e('0x74')]=[{'name':_0x898e('0xab')},{'name':'QueueCampaigns'}];}break;case _0x898e('0xc5'):case _0x898e('0xc6'):case _0x898e('0xc7'):_0x49745d['childModel']=_0x898e('0xa6');if(_0x253a5f){_0x49745d[_0x898e('0x74')]=[{'name':'Users','filter':{'field':_0x898e('0xa7'),'value':[_0x898e('0xc8'),_0x898e('0xc9')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x898e('0xca'):_0x49745d['childModel']=_0x898e('0xcb');break;case _0x898e('0xcc'):_0x49745d[_0x898e('0x72')]=_0x898e('0xcd');break;case _0x898e('0xce'):_0x49745d[_0x898e('0x72')]=_0x898e('0xcf');break;case'sugarcrmaccounts':_0x49745d[_0x898e('0x72')]=_0x898e('0xd0');break;case'deskaccounts':_0x49745d[_0x898e('0x72')]=_0x898e('0xd1');break;case _0x898e('0xd2'):_0x49745d[_0x898e('0x72')]=_0x898e('0xd3');break;case _0x898e('0xd4'):_0x49745d['childModel']='User';break;case _0x898e('0xd5'):_0x49745d['childModel']=_0x898e('0xd6');break;case _0x898e('0xd7'):_0x49745d[_0x898e('0x72')]=_0x898e('0xd8');break;case _0x898e('0xd9'):_0x49745d['childModel']='Dashboard';break;case'intervals':_0x49745d[_0x898e('0x72')]=_0x898e('0xda');break;case _0x898e('0xdb'):_0x49745d[_0x898e('0x72')]=_0x898e('0xdc');break;case'scheduler':_0x49745d['childModel']='Schedule';break;case _0x898e('0xdd'):_0x49745d[_0x898e('0x72')]=_0x898e('0xde');break;case _0x898e('0xdf'):_0x49745d[_0x898e('0x72')]='Tag';break;case'templates':_0x49745d[_0x898e('0x72')]='Template';break;case _0x898e('0xe0'):_0x49745d[_0x898e('0x72')]=_0x898e('0xe1');break;case _0x898e('0xe2'):_0x49745d[_0x898e('0x72')]=_0x898e('0xe3');break;case _0x898e('0xe4'):_0x49745d[_0x898e('0x72')]=_0x898e('0xe5');break;case _0x898e('0xe6'):_0x49745d['childModel']=_0x898e('0x65');break;case _0x898e('0xe7'):_0x49745d['childModel']='AnalyticExtractedReport';_0x49745d[_0x898e('0x74')]=[{'name':_0x898e('0xe8'),'field':'id','foreignKey':_0x898e('0x80')}];break;case _0x898e('0xe9'):_0x49745d['childModel']='AnalyticMetric';break;case _0x898e('0xc0'):_0x49745d[_0x898e('0x72')]='WhatsappAccount';break;default:return _0x49745d;}return _0x49745d;}
\ No newline at end of file
+var _0x115f=['openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','SmsAccount','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','templates','triggers','Trigger','Trunk','Variable','plugins','extractedreports','metrics','AnalyticMetric','WhatsappAccount','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./userProfile.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','UserProfile','includeAll','include','show','length','find','create','body','catch','get','omit','createdAt','crudPermissions','updatedAt','transaction','findAll','params','autoAssociation','UserProfileResource','userProfileId','Resources','addSections','sequelize','UserProfileSection','each','removeSections','ids','getSections','includes','sectionId','isEmpty','subsections','enabled','findOne','Dashboard','forEach','push','resourceId','Plugin','addResources','removeResources','getResources','undefined','ValidationError','Unknown\x20section','mergeResources','childModel','Sequelize','parentSections','all','ignore','union','pick','field','foreignKey','associatedResources','AnalyticExtractedReport','default','reportId','DefaultReports','CustomReports','color','Tag','ThroughTags','tag','rows','value','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','companies','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','contexts','voicemails','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x115f,0x118));var _0xf115=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x115f[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0xf115('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf115('0x1'));var zipdir=require(_0xf115('0x2'));var jsonpatch=require(_0xf115('0x3'));var rp=require('request-promise');var moment=require(_0xf115('0x4'));var BPromise=require(_0xf115('0x5'));var Mustache=require(_0xf115('0x6'));var util=require(_0xf115('0x7'));var path=require('path');var sox=require(_0xf115('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf115('0x9'));var crypto=require(_0xf115('0xa'));var jsforce=require(_0xf115('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf115('0xc'));var querystring=require('querystring');var Papa=require(_0xf115('0xd'));var Redis=require(_0xf115('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf115('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf115('0x10'))(_0xf115('0x11'));var utils=require(_0xf115('0x12'));var config=require(_0xf115('0x13'));var db=require(_0xf115('0x14'))['db'];config['redis']=_[_0xf115('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf115('0x16')]));require(_0xf115('0x17'))[_0xf115('0x18')](socket);function respondWithStatusCode(_0x4dee27,_0x21e400){_0x21e400=_0x21e400||0xcc;return function(_0x50f9c5){if(_0x50f9c5){return _0x4dee27['sendStatus'](_0x21e400);}return _0x4dee27[_0xf115('0x19')](_0x21e400)[_0xf115('0x1a')]();};}function respondWithResult(_0x4db5ac,_0x3d1c69){_0x3d1c69=_0x3d1c69||0xc8;return function(_0x43ba45){if(_0x43ba45){return _0x4db5ac[_0xf115('0x19')](_0x3d1c69)[_0xf115('0x1b')](_0x43ba45);}};}function respondWithFilteredResult(_0x245098,_0x40e535){return function(_0x4a4a61){if(_0x4a4a61){var _0x2ff79d=_0x4a4a61[_0xf115('0x1c')],_0x4f3f2b=_0x40e535[_0xf115('0x1d')],_0x34c758=_0x40e535['offset']+_0x40e535[_0xf115('0x1e')],_0x3bf0b7;if(_0x34c758>=_0x2ff79d){_0x34c758=_0x2ff79d;_0x3bf0b7=0xc8;}else{_0x3bf0b7=0xce;}_0x245098[_0xf115('0x19')](_0x3bf0b7);return _0x245098[_0xf115('0x1f')](_0xf115('0x20'),_0x4f3f2b+'-'+_0x34c758+'/'+_0x2ff79d)[_0xf115('0x1b')](_0x4a4a61);}return null;};}function patchUpdates(_0x426ff8){return function(_0xc3d3da){try{jsonpatch[_0xf115('0x21')](_0xc3d3da,_0x426ff8,!![]);}catch(_0x3a4e8d){return BPromise[_0xf115('0x22')](_0x3a4e8d);}return _0xc3d3da[_0xf115('0x23')]();};}function saveUpdates(_0x48f563,_0x156db4){return function(_0x111d9d){if(_0x111d9d){return _0x111d9d[_0xf115('0x24')](_0x48f563)[_0xf115('0x25')](function(_0x5da6e0){return _0x5da6e0;});}return null;};}function removeEntity(_0x56e18d,_0x198e77){return function(_0x3794ee){if(_0x3794ee){return _0x3794ee[_0xf115('0x26')]()['then'](function(){_0x56e18d[_0xf115('0x19')](0xcc)[_0xf115('0x1a')]();});}};}function handleEntityNotFound(_0x196f2d,_0x4554c9){return function(_0x52addf){if(!_0x52addf){_0x196f2d['sendStatus'](0x194);}return _0x52addf;};}function handleError(_0x7bc38a,_0x5bb59a){_0x5bb59a=_0x5bb59a||0x1f4;return function(_0x59d1fc){logger[_0xf115('0x27')](_0x59d1fc[_0xf115('0x28')]);if(_0x59d1fc[_0xf115('0x29')]){delete _0x59d1fc[_0xf115('0x29')];}_0x7bc38a[_0xf115('0x19')](_0x5bb59a)['send'](_0x59d1fc);};}exports['index']=function(_0xcc174d,_0x17f68b){var _0x496824={},_0x437a57={},_0x45456c={'count':0x0,'rows':[]};var _0x5cd277=_[_0xf115('0x2a')](db['UserProfile'][_0xf115('0x2b')],function(_0x3b678e){return{'name':_0x3b678e[_0xf115('0x2c')],'type':_0x3b678e[_0xf115('0x2d')][_0xf115('0x2e')]};});_0x437a57['model']=_[_0xf115('0x2a')](_0x5cd277,_0xf115('0x29'));_0x437a57[_0xf115('0x2f')]=_[_0xf115('0x30')](_0xcc174d[_0xf115('0x2f')]);_0x437a57[_0xf115('0x31')]=_[_0xf115('0x32')](_0x437a57[_0xf115('0x33')],_0x437a57[_0xf115('0x2f')]);_0x496824['attributes']=_[_0xf115('0x32')](_0x437a57[_0xf115('0x33')],qs['fields'](_0xcc174d[_0xf115('0x2f')][_0xf115('0x34')]));_0x496824[_0xf115('0x35')]=_0x496824[_0xf115('0x35')]['length']?_0x496824[_0xf115('0x35')]:_0x437a57[_0xf115('0x33')];if(!_0xcc174d[_0xf115('0x2f')][_0xf115('0x36')](_0xf115('0x37'))){_0x496824[_0xf115('0x1e')]=qs['limit'](_0xcc174d[_0xf115('0x2f')][_0xf115('0x1e')]);_0x496824[_0xf115('0x1d')]=qs[_0xf115('0x1d')](_0xcc174d['query']['offset']);}_0x496824[_0xf115('0x38')]=qs[_0xf115('0x39')](_0xcc174d[_0xf115('0x2f')][_0xf115('0x39')]);_0x496824[_0xf115('0x3a')]=qs[_0xf115('0x31')](_['pick'](_0xcc174d[_0xf115('0x2f')],_0x437a57[_0xf115('0x31')]),_0x5cd277);if(_0xcc174d['query']['filter']){_0x496824[_0xf115('0x3a')]=_['merge'](_0x496824[_0xf115('0x3a')],{'$or':_[_0xf115('0x2a')](_0x5cd277,function(_0xa74b0e){if(_0xa74b0e[_0xf115('0x2d')]!==_0xf115('0x3b')){var _0x1231e9={};_0x1231e9[_0xa74b0e[_0xf115('0x29')]]={'$like':'%'+_0xcc174d[_0xf115('0x2f')][_0xf115('0x3c')]+'%'};return _0x1231e9;}})});}_0x496824=_[_0xf115('0x3d')]({},_0x496824,_0xcc174d[_0xf115('0x3e')]);var _0x5d264c={'where':_0x496824[_0xf115('0x3a')]};return db[_0xf115('0x3f')][_0xf115('0x1c')](_0x5d264c)[_0xf115('0x25')](function(_0x4ce4d7){_0x45456c[_0xf115('0x1c')]=_0x4ce4d7;if(_0xcc174d[_0xf115('0x2f')][_0xf115('0x40')]){_0x496824[_0xf115('0x41')]=[{'all':!![]}];}return db[_0xf115('0x3f')]['findAll'](_0x496824);})[_0xf115('0x25')](function(_0x30f2f4){_0x45456c['rows']=_0x30f2f4;return _0x45456c;})[_0xf115('0x25')](respondWithFilteredResult(_0x17f68b,_0x496824))['catch'](handleError(_0x17f68b,null));};exports[_0xf115('0x42')]=function(_0x208823,_0x28cf8f){var _0x15f321={'raw':![],'where':{'id':_0x208823['params']['id']}},_0x359815={};_0x359815[_0xf115('0x33')]=_[_0xf115('0x30')](db['UserProfile'][_0xf115('0x2b')]);_0x359815[_0xf115('0x2f')]=_[_0xf115('0x30')](_0x208823[_0xf115('0x2f')]);_0x359815[_0xf115('0x31')]=_['intersection'](_0x359815[_0xf115('0x33')],_0x359815['query']);_0x15f321[_0xf115('0x35')]=_[_0xf115('0x32')](_0x359815[_0xf115('0x33')],qs[_0xf115('0x34')](_0x208823[_0xf115('0x2f')][_0xf115('0x34')]));_0x15f321[_0xf115('0x35')]=_0x15f321[_0xf115('0x35')][_0xf115('0x43')]?_0x15f321[_0xf115('0x35')]:_0x359815[_0xf115('0x33')];if(_0x208823[_0xf115('0x2f')][_0xf115('0x40')]){_0x15f321[_0xf115('0x41')]=[{'all':!![]}];}_0x15f321=_[_0xf115('0x3d')]({},_0x15f321,_0x208823['options']);return db['UserProfile'][_0xf115('0x44')](_0x15f321)['then'](handleEntityNotFound(_0x28cf8f,null))[_0xf115('0x25')](respondWithResult(_0x28cf8f,null))['catch'](handleError(_0x28cf8f,null));};exports[_0xf115('0x45')]=function(_0x18d65b,_0x596ebc){return db[_0xf115('0x3f')]['create'](_0x18d65b[_0xf115('0x46')],{})[_0xf115('0x25')](respondWithResult(_0x596ebc,0xc9))[_0xf115('0x47')](handleError(_0x596ebc,null));};exports['clone']=function(_0x5c388c,_0x2b0f4d){var _0x28f430={'where':{'id':_0x5c388c['params']['id']}},_0x272855={};_0x272855['model']=_[_0xf115('0x30')](db[_0xf115('0x3f')][_0xf115('0x2b')]);_0x28f430[_0xf115('0x35')]=_[_0xf115('0x32')](_0x272855[_0xf115('0x33')],qs[_0xf115('0x34')](_0x5c388c[_0xf115('0x2f')][_0xf115('0x34')]));_0x28f430[_0xf115('0x35')]=_0x28f430[_0xf115('0x35')][_0xf115('0x43')]?_0x28f430[_0xf115('0x35')]:_0x272855['model'];if(_0x5c388c[_0xf115('0x2f')][_0xf115('0x40')]){_0x28f430[_0xf115('0x41')]=[{'all':!![]}];}_0x28f430=_[_0xf115('0x3d')]({},_0x28f430,_0x5c388c[_0xf115('0x3e')]);return db[_0xf115('0x3f')]['find'](_0x28f430)[_0xf115('0x25')](handleEntityNotFound(_0x2b0f4d,null))['then'](function(_0x588ab7){if(_0x588ab7){var _0x3a43ed=_0x588ab7[_0xf115('0x48')]({'plain':!![]});_0x3a43ed=qs[_0xf115('0x49')](_0x3a43ed,['id',_0xf115('0x4a'),'updatedAt',_0xf115('0x4b')]);_0x5c388c[_0xf115('0x46')]=_[_0xf115('0x49')](_0x5c388c[_0xf115('0x46')],['id',_0xf115('0x4a'),_0xf115('0x4c')]);return db['sequelize'][_0xf115('0x4d')](function(_0x2a3ed9){return db[_0xf115('0x3f')][_0xf115('0x45')](_[_0xf115('0x3d')](_0x3a43ed,_0x5c388c[_0xf115('0x46')]),{'include':_0x5c388c[_0xf115('0x2f')][_0xf115('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x2a3ed9})[_0xf115('0x25')](function(_0x2a18ad){var _0x2c6868=_0x2a18ad[_0xf115('0x48')]({'plain':!![]});return db['UserProfileSection'][_0xf115('0x4e')]({'where':{'userProfileId':_0x5c388c[_0xf115('0x4f')]['id']},'raw':!![]})[_0xf115('0x25')](function(_0x353b49){if(_0x353b49){return BPromise['each'](_0x353b49,function(_0x44a60f){return new BPromise(function(_0x5a93e8,_0x7bb7b9){if(_0x44a60f[_0xf115('0x50')]===null||_0x44a60f[_0xf115('0x50')]===0x1)_0x5a93e8(null);return db[_0xf115('0x51')][_0xf115('0x4e')]({'where':{'sectionId':_0x44a60f['id']},'raw':!![]})[_0xf115('0x25')](function(_0xa3b9e1){var _0x1db479=_[_0xf115('0x2a')](_0xa3b9e1,function(_0x1398d1){return qs['omit'](_0x1398d1,['id',_0xf115('0x4a'),_0xf115('0x4c'),'sectionId']);});_0x5a93e8(_0x1db479);})[_0xf115('0x47')](function(_0x33d464){_0x7bb7b9(_0x33d464);});})['then'](function(_0x1afbc6){var _0x1209eb=qs[_0xf115('0x49')](_0x44a60f,['id',_0xf115('0x4a'),_0xf115('0x4c')]);_0x1209eb[_0xf115('0x52')]=_0x2c6868['id'];if(_0x1afbc6)_0x1209eb['Resources']=_0x1afbc6;return _0x1209eb;})[_0xf115('0x25')](function(_0x3c3fe4){return db['UserProfileSection']['create'](_0x3c3fe4,{'include':[{'model':db[_0xf115('0x51')],'as':_0xf115('0x53')}],'raw':!![],'transaction':_0x2a3ed9});});})['then'](function(){return _0x2c6868;});}});});});}})[_0xf115('0x25')](respondWithResult(_0x2b0f4d,0xc9))[_0xf115('0x47')](handleError(_0x2b0f4d,null));};exports['update']=function(_0x3a6523,_0xb1b73){if(_0x3a6523[_0xf115('0x46')]['id']){delete _0x3a6523[_0xf115('0x46')]['id'];}return db[_0xf115('0x3f')][_0xf115('0x44')]({'where':{'id':_0x3a6523[_0xf115('0x4f')]['id']}})['then'](handleEntityNotFound(_0xb1b73,null))[_0xf115('0x25')](saveUpdates(_0x3a6523[_0xf115('0x46')],null))[_0xf115('0x25')](respondWithResult(_0xb1b73,null))[_0xf115('0x47')](handleError(_0xb1b73,null));};exports['destroy']=function(_0x42b7aa,_0x4da754){return db[_0xf115('0x3f')][_0xf115('0x44')]({'where':{'id':_0x42b7aa[_0xf115('0x4f')]['id']}})[_0xf115('0x25')](handleEntityNotFound(_0x4da754,null))[_0xf115('0x25')](removeEntity(_0x4da754,null))[_0xf115('0x47')](handleError(_0x4da754,null));};exports['describe']=function(_0x53decd,_0x42b250){return db[_0xf115('0x3f')]['describe']()[_0xf115('0x25')](respondWithResult(_0x42b250,null))[_0xf115('0x47')](handleError(_0x42b250,null));};exports[_0xf115('0x54')]=function(_0x1c2855,_0x32158e){var _0x1094b1=_0x1c2855['body'];return db[_0xf115('0x3f')]['find']({'where':{'id':_0x1c2855[_0xf115('0x4f')]['id']}})[_0xf115('0x25')](handleEntityNotFound(_0x32158e,null))[_0xf115('0x25')](function(_0x3bee63){if(_0x3bee63){return db[_0xf115('0x55')][_0xf115('0x4d')](function(_0x17583e){return db[_0xf115('0x56')][_0xf115('0x26')]({'where':{'userProfileId':_0x1c2855[_0xf115('0x4f')]['id'],'sectionId':_[_0xf115('0x2a')](_0x1094b1,function(_0x4997a3){return _0x4997a3['sectionId'];})},'transaction':_0x17583e})[_0xf115('0x25')](function(){var _0x5c91ad=_[_0xf115('0x2a')](_0x1094b1,function(_0x3e59fc){_0x3e59fc['userProfileId']=_0x1c2855['params']['id'];return _0x3e59fc;});var _0x453d81=[];return BPromise[_0xf115('0x57')](_0x5c91ad,function(_0x5ea580){return db[_0xf115('0x56')]['create'](_0x5ea580,{'include':[{'model':db[_0xf115('0x51')],'as':'Resources'}],'raw':!![],'transaction':_0x17583e})['then'](function(_0x381121){_0x453d81['push'](_0x381121['get']({'plain':!![]}));});})[_0xf115('0x25')](function(){return _0x453d81;});});});}})[_0xf115('0x25')](function(_0x318d8f){return _0x318d8f;})[_0xf115('0x25')](respondWithResult(_0x32158e,null))[_0xf115('0x47')](handleError(_0x32158e,null));};exports[_0xf115('0x58')]=function(_0x3a2771,_0x2da27a){var _0x3f97c2;return db[_0xf115('0x3f')][_0xf115('0x44')]({'where':{'id':_0x3a2771[_0xf115('0x4f')]['id']},'attributes':['id','name']})[_0xf115('0x25')](handleEntityNotFound(_0x2da27a,null))[_0xf115('0x25')](function(_0x431d87){if(_0x431d87){_0x3f97c2=_0x431d87;return db[_0xf115('0x56')]['destroy']({'where':{'userProfileId':_0x3a2771[_0xf115('0x4f')]['id'],'sectionId':_0x3a2771[_0xf115('0x2f')][_0xf115('0x59')]}});}})[_0xf115('0x25')](function(){return _0x3f97c2;})[_0xf115('0x25')](respondWithStatusCode(_0x2da27a,null))[_0xf115('0x47')](handleError(_0x2da27a,null));};exports[_0xf115('0x5a')]=function(_0x37b27e,_0x3a9323){var _0x3b754f=[];var _0x45fd7b=[];return db[_0xf115('0x56')][_0xf115('0x4e')]({'where':{'userProfileId':_0x37b27e[_0xf115('0x4f')]['id']},'raw':!![]})[_0xf115('0x25')](function(_0x148e00){_0x3b754f=_['filter'](_0x148e00,function(_0x2f8fed){return _0x2f8fed['enabled']===0x1||_[_0xf115('0x5b')]([0x3eb,0x709],_0x2f8fed[_0xf115('0x5c')]);});if(!_[_0xf115('0x5d')](_0x3b754f)){return _['map'](_0x3b754f,function(_0x1c5f25){return _0x1c5f25['sectionId'];});}else{return;}})[_0xf115('0x25')](function(_0x15427f){if(_0x15427f)_0x45fd7b=_0x15427f;if(_[_0xf115('0x5b')](_0x45fd7b,0x64)){var _0x532866=_['find'](_0x3b754f,{'sectionId':0x64});return hasDefaultDashboard(_0x532866)[_0xf115('0x25')](function(_0x57488b){return _[_0xf115('0x2a')](_0x3b754f,function(_0x57c05){if(_0x57c05[_0xf115('0x5c')]===0x64){_0x57c05[_0xf115('0x5e')]=_0x57488b;}return _0x57c05;});});}else{return;}})[_0xf115('0x25')](function(_0x22cf7d){if(_0x22cf7d)_0x3b754f=_0x22cf7d;if(_[_0xf115('0x5b')](_0x45fd7b,0x3eb)){var _0x44659a=_[_0xf115('0x44')](_0x3b754f,{'sectionId':0x3eb});return getCustomDashboards(_0x44659a)['then'](function(_0xa84655){return _[_0xf115('0x2a')](_0x3b754f,function(_0x1d3cb4){if(_0x44659a[_0xf115('0x5f')]){if(_0x1d3cb4[_0xf115('0x5c')]===0x3eb){_0x1d3cb4[_0xf115('0x5e')]=_0xa84655;}}else{if(_0x1d3cb4[_0xf115('0x5c')]===0x64){_0x1d3cb4[_0xf115('0x5e')]=_0xa84655;}}return _0x1d3cb4;});});}else{return;}})[_0xf115('0x25')](function(_0x3d133d){if(_0x3d133d)_0x3b754f=_0x3d133d;if(_['includes'](_0x45fd7b,0x709)){var _0x285de4=_[_0xf115('0x44')](_0x3b754f,{'sectionId':0x709});return getPlugins(_0x285de4)['then'](function(_0x5be7ed){if(_0x285de4[_0xf115('0x5f')]){return _[_0xf115('0x2a')](_0x3b754f,function(_0x2fb33e){if(_0x2fb33e[_0xf115('0x5c')]===0x709){_0x2fb33e[_0xf115('0x5e')]=_0x5be7ed;}return _0x2fb33e;});}else{var _0x1fcad1={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5be7ed};var _0x510856=_[_0xf115('0x2a')](_0x3b754f);_0x510856['push'](_0x1fcad1);return _0x510856;}});}else{return;}})[_0xf115('0x25')](function(_0x1dcc58){if(_0x1dcc58)_0x3b754f=_0x1dcc58;return _[_0xf115('0x3c')](_0x3b754f,['enabled',0x1]);})[_0xf115('0x25')](respondWithResult(_0x3a9323,null))[_0xf115('0x47')](handleError(_0x3a9323,null));};function hasDefaultDashboard(_0x42cfd1){var _0x289cf6=[0x65];return new BPromise(function(_0x3bf676,_0xe427fa){try{if(_0x42cfd1[_0xf115('0x50')]){_0x3bf676(_0x289cf6);}else{return db[_0xf115('0x51')][_0xf115('0x60')]({'where':{'sectionId':_0x42cfd1['id']},'raw':!![]})[_0xf115('0x25')](function(_0x2379f1){_0x2379f1?_0x3bf676(_0x289cf6):_0x3bf676();});}}catch(_0x2b91f9){_0xe427fa(_0x2b91f9);}});}function getCustomDashboards(_0x4c7f9e){var _0x3c8523=[];return new BPromise(function(_0x4763e1,_0x474441){try{if(_0x4c7f9e['autoAssociation']){return db[_0xf115('0x61')][_0xf115('0x4e')]({'raw':!![]})['then'](function(_0x3d5e41){_0x3d5e41[_0xf115('0x62')](function(_0x4dbb6a){_0x3c8523[_0xf115('0x63')](_0x4dbb6a['id']+0x1869f);});_0x4763e1(_0x3c8523);});}else{return db[_0xf115('0x51')][_0xf115('0x4e')]({'where':{'sectionId':_0x4c7f9e['id']},'raw':!![]})[_0xf115('0x25')](function(_0xa5c7e3){_0xa5c7e3[_0xf115('0x62')](function(_0x47a1d5){_0x3c8523[_0xf115('0x63')](_0x47a1d5[_0xf115('0x64')]+0x1869f);});_0x4763e1(_0x3c8523);});}}catch(_0x176d51){_0x474441(_0x176d51);}});}function getPlugins(_0x1788ac){var _0x44866b=[];return new BPromise(function(_0x204245,_0x167e6c){try{if(_0x1788ac[_0xf115('0x50')]){return db[_0xf115('0x65')][_0xf115('0x4e')]({'raw':!![]})[_0xf115('0x25')](function(_0x23a979){_0x23a979[_0xf115('0x62')](function(_0x2d32e3){_0x44866b[_0xf115('0x63')](_0x2d32e3['id']+0x15b38);});_0x204245(_0x44866b);});}else{return db[_0xf115('0x51')]['findAll']({'where':{'sectionId':_0x1788ac['id']},'raw':!![]})[_0xf115('0x25')](function(_0x1d5260){_0x1d5260['forEach'](function(_0x1e45c9){_0x44866b[_0xf115('0x63')](_0x1e45c9[_0xf115('0x64')]+0x15b38);});_0x204245(_0x44866b);});}}catch(_0x235db5){_0x167e6c(_0x235db5);}});}exports[_0xf115('0x66')]=function(_0x5c9be0,_0x5e1657){return db[_0xf115('0x3f')][_0xf115('0x44')]({'where':{'id':_0x5c9be0['params']['id']}})[_0xf115('0x25')](handleEntityNotFound(_0x5e1657,null))['then'](function(_0x5e9eaf){if(_0x5e9eaf){return db['sequelize']['transaction'](function(_0x42ac03){return db[_0xf115('0x56')][_0xf115('0x4e')]({'where':{'userProfileId':_0x5c9be0[_0xf115('0x4f')]['id']},'attributes':['id'],'raw':!![]})[_0xf115('0x25')](function(_0x55f977){if(_0x55f977){return db[_0xf115('0x56')][_0xf115('0x26')]({'where':{'userProfileId':_0x5c9be0['params']['id'],'id':_['map'](_0x55f977,function(_0x2504d0){return _0x2504d0['id'];})},'transaction':_0x42ac03});}})[_0xf115('0x25')](function(_0x238ce0){var _0x396547=_[_0xf115('0x2a')](_0x5c9be0[_0xf115('0x46')],function(_0x19edfc){_0x19edfc[_0xf115('0x52')]=_0x5c9be0[_0xf115('0x4f')]['id'];return _0x19edfc;});return db[_0xf115('0x56')]['bulkCreate'](_0x396547,{'raw':!![],'transaction':_0x42ac03});})[_0xf115('0x25')](function(_0xb7c19d){var _0x462af3=_[_0xf115('0x3c')](_[_0xf115('0x2a')](_0xb7c19d,function(_0x393a71){return _0x393a71[_0xf115('0x48')]({'plain':!![]});}),{'includeAll':![]});if(_0x462af3){return db[_0xf115('0x56')]['findAll']({'where':{'userProfileId':_0x5c9be0['params']['id'],'sectionId':_[_0xf115('0x2a')](_0x462af3,function(_0x5d23fd){return _0x5d23fd['sectionId'];})},'attributes':['id',_0xf115('0x5c')],'raw':!![]})[_0xf115('0x25')](function(_0x42c4e4){var _0xc59346=_[_0xf115('0x2a')](_0x5c9be0[_0xf115('0x46')],function(_0x5eed63){_0x5eed63[_0xf115('0x52')]=_0x5c9be0[_0xf115('0x4f')]['id'];return _0x5eed63;});return db[_0xf115('0x51')]['bulkCreate'](_0xc59346,{'raw':!![],'transaction':_0x42ac03});});}})[_0xf115('0x47')](handleError(_0x5e1657,null));});}})[_0xf115('0x25')](function(_0x2be7ef){var _0x425c9c=_[_0xf115('0x2a')](_0x2be7ef,function(_0x131762){return _0x131762[_0xf115('0x48')]({'plain':!![]});});})[_0xf115('0x25')](respondWithResult(_0x5e1657,null))[_0xf115('0x47')](handleError(_0x5e1657,null));};exports[_0xf115('0x67')]=function(_0x138971,_0x458bd4,_0x44a053){return db[_0xf115('0x3f')][_0xf115('0x44')]({'where':{'id':_0x138971[_0xf115('0x4f')]['id']}})[_0xf115('0x25')](handleEntityNotFound(_0x458bd4,null))[_0xf115('0x25')](function(_0x1520ec){if(_0x1520ec){return _0x1520ec[_0xf115('0x67')](_0x138971[_0xf115('0x2f')][_0xf115('0x59')]);}})[_0xf115('0x25')](respondWithStatusCode(_0x458bd4,null))[_0xf115('0x47')](handleError(_0x458bd4,null));};exports[_0xf115('0x68')]=function(_0x4425cd,_0xfe3e07){var _0x1105fa={'raw':![],'where':{}};var _0x3487e0={};var _0x2eb654={'count':0x0,'rows':[]};var _0x2bbd5f=_0x4425cd[_0xf115('0x2f')]['section'];if(typeof _0x2bbd5f===_0xf115('0x69')){throw new db['Sequelize'][(_0xf115('0x6a'))](_0xf115('0x6b'));}var _0x1619c0=_0x4425cd['query'][_0xf115('0x6c')]||![];var _0x4952d0=getQueryModels(_0x2bbd5f,_0x1619c0);if(typeof _0x4952d0[_0xf115('0x6d')]===_0xf115('0x69')){throw new db[(_0xf115('0x6e'))]['ValidationError']('Invalid\x20section\x20\x27'+_0x2bbd5f+'\x27');}var _0x40d1db=[];if(!_[_0xf115('0x5d')](_0x4952d0[_0xf115('0x6f')])){_0x40d1db=_0x4952d0[_0xf115('0x6f')];}else{_0x40d1db=[{'name':_0x2bbd5f}];}return db['UserProfile'][_0xf115('0x60')]({'where':{'id':_0x4425cd['params']['id']}})[_0xf115('0x25')](handleEntityNotFound(_0xfe3e07,null))[_0xf115('0x25')](function(_0x24800c){if(_0x24800c){var _0x195aa5=[];for(var _0x4f6edc=0x0;_0x4f6edc<_0x40d1db[_0xf115('0x43')];_0x4f6edc++){_0x195aa5[_0xf115('0x63')](db[_0xf115('0x56')][_0xf115('0x60')]({'where':{'userProfileId':_0x24800c['id'],'name':_0x40d1db[_0x4f6edc][_0xf115('0x29')]},'raw':!![]}));}return BPromise[_0xf115('0x70')](_0x195aa5);}})[_0xf115('0x25')](function(_0x1e86a2){var _0x270290=_[_0xf115('0x3c')](_0x1e86a2,function(_0x21dc7b){return _0x21dc7b?_0x21dc7b:undefined;});var _0x3db09b=_[_0xf115('0x3c')](_0x40d1db,[_0xf115('0x71'),!![]]);var _0x4cc11f=_[_0xf115('0x5d')](_0x270290)&&_[_0xf115('0x5d')](_0x3db09b)?null:_[_0xf115('0x72')](_0x3db09b,_0x270290);if(_0x4cc11f){var _0x1fd43d=[];for(var _0x68409f=0x0;_0x68409f<_0x4cc11f[_0xf115('0x43')];_0x68409f++){var _0x35cfd3=_[_0xf115('0x44')](_0x40d1db,function(_0x136583){return _0x4cc11f[_0x68409f]?_0x136583[_0xf115('0x29')]===_0x4cc11f[_0x68409f][_0xf115('0x29')]:null;});if(_0x35cfd3){if(_0x4cc11f[_0x68409f][_0xf115('0x71')]){_0x1fd43d[_0xf115('0x63')](getAllResources(_0x4952d0[_0xf115('0x6d')],_0x4cc11f[_0x68409f]));}else{if(!_0x4cc11f[_0x68409f]['autoAssociation']){_0x1fd43d[_0xf115('0x63')](getAllowedResources(_0x35cfd3,_0x4cc11f[_0x68409f],_0x4952d0[_0xf115('0x6d')]));}else{if(_0x35cfd3[_0xf115('0x33')]){_0x1fd43d[_0xf115('0x63')](getAllFilteredResources(_0x35cfd3,_0x4cc11f[_0x68409f]));}}}}}return BPromise[_0xf115('0x70')](_0x1fd43d);}else{return null;}})[_0xf115('0x25')](function(_0xc9353b){var _0x3323f2=_0xc9353b;var _0x2ff1b3=null;if(_0x3323f2){_0x2ff1b3=_0x3323f2[_0xf115('0x43')]===0x1?_0x3323f2[0x0]:null;}if(_0x2ff1b3||_0x3323f2){var _0x48c7fa=db[_0x4952d0[_0xf115('0x6d')]][_0xf115('0x2b')];_0x3487e0[_0xf115('0x33')]=_[_0xf115('0x30')](_0x48c7fa);_0x3487e0[_0xf115('0x2f')]=_['keys'](_0x4425cd['query']);_0x3487e0[_0xf115('0x31')]=_[_0xf115('0x32')](_0x3487e0[_0xf115('0x33')],_0x3487e0['query']);_0x1105fa[_0xf115('0x35')]=_[_0xf115('0x32')](_0x3487e0['model'],qs[_0xf115('0x34')](_0x4425cd[_0xf115('0x2f')]['fields']));_0x1105fa['attributes']=_0x1105fa[_0xf115('0x35')]['length']?_0x1105fa[_0xf115('0x35')]:_0x3487e0[_0xf115('0x33')];if(!_0x4425cd[_0xf115('0x2f')]['hasOwnProperty'](_0xf115('0x37'))){_0x1105fa[_0xf115('0x1e')]=qs[_0xf115('0x1e')](_0x4425cd[_0xf115('0x2f')][_0xf115('0x1e')]);_0x1105fa['offset']=qs[_0xf115('0x1d')](_0x4425cd[_0xf115('0x2f')][_0xf115('0x1d')]);}_0x1105fa[_0xf115('0x38')]=qs[_0xf115('0x39')](_0x4425cd[_0xf115('0x2f')][_0xf115('0x39')]);_0x1105fa[_0xf115('0x3a')]=qs['filters'](_[_0xf115('0x73')](_0x4425cd[_0xf115('0x2f')],_0x3487e0[_0xf115('0x31')]));if(_0x4425cd[_0xf115('0x2f')][_0xf115('0x3c')]){_0x1105fa[_0xf115('0x3a')]=_[_0xf115('0x3d')](_0x1105fa[_0xf115('0x3a')],{'$or':_[_0xf115('0x2a')](_0x48c7fa,function(_0x504dce){if(_0x504dce[_0xf115('0x2d')][_0xf115('0x2e')]!==_0xf115('0x3b')){var _0x23b38b={};_0x23b38b[_0x504dce[_0xf115('0x74')]]={'$like':'%'+_0x4425cd[_0xf115('0x2f')][_0xf115('0x3c')]+'%'};return _0x23b38b;}})});}var _0x16c8b8=[];if(_0x2ff1b3){var _0x6158ea=_[_0xf115('0x44')](_0x40d1db,[_0xf115('0x29'),_0x2ff1b3[_0xf115('0x29')]]);if(_0x6158ea['field']){var _0xa419c1={};if(_0x4952d0[_0xf115('0x6d')]==='AnalyticExtractedReport'){_0xa419c1[_0x6158ea[_0xf115('0x75')]]=_[_0xf115('0x2a')](_0x2ff1b3[_0xf115('0x76')],'id');}else{_0xa419c1[_0x6158ea[_0xf115('0x75')]]=_0x2ff1b3['associatedResources'];}_0x16c8b8[_0xf115('0x63')](_0xa419c1);}else{_0x1105fa['where']['id']=_0x2ff1b3[_0xf115('0x76')];}}else{for(var _0x4aa5ae=0x0;_0x4aa5ae<_0x3323f2[_0xf115('0x43')];_0x4aa5ae++){var _0x6158ea=_[_0xf115('0x44')](_0x40d1db,['name',_0x3323f2[_0x4aa5ae]['name']]);if(_0x6158ea['field']){var _0xa419c1={};_0xa419c1[_0x6158ea[_0xf115('0x75')]]=_0x3323f2[_0x4aa5ae][_0xf115('0x76')];_0x16c8b8[_0xf115('0x63')](_0xa419c1);}else{if(!_0x1105fa[_0xf115('0x3a')]['id'])_0x1105fa[_0xf115('0x3a')]['id']=[];_0x3323f2[_0x4aa5ae]['associatedResources'][_0xf115('0x62')](function(_0x12e6d8){_0x1105fa['where']['id'][_0xf115('0x63')](_0x12e6d8);});}}}if(!_['isEmpty'](_0x16c8b8)){_0x1105fa[_0xf115('0x3a')]=_[_0xf115('0x3d')](_0x1105fa[_0xf115('0x3a')],{'$and':{'$or':_0x16c8b8}});}_0x1105fa=_[_0xf115('0x3d')]({},_0x1105fa,_0x4425cd[_0xf115('0x3e')]);if(_0x2ff1b3&&!_0x2ff1b3[_0xf115('0x50')]&&_0x4952d0[_0xf115('0x6d')]===_0xf115('0x77')){if(_0x4425cd[_0xf115('0x2f')][_0xf115('0x40')]){_0x1105fa[_0xf115('0x41')]=[{'all':!![]}];}return db[_0x4952d0[_0xf115('0x6d')]]['findAll'](_0x1105fa)[_0xf115('0x25')](function(_0x4b38df){var _0x154dca=[];_0x4b38df[_0xf115('0x62')](function(_0x73d485){var _0x26c2fa;switch(_0x73d485['reportType']){case _0xf115('0x78'):_0x26c2fa=_[_0xf115('0x44')](_0x2ff1b3['associatedResources'],function(_0x5f532c){return _0x5f532c['id']===_0x73d485[_0xf115('0x79')]&&_0x5f532c[_0xf115('0x2d')]===_0xf115('0x7a');});break;case'custom':_0x26c2fa=_[_0xf115('0x44')](_0x2ff1b3[_0xf115('0x76')],function(_0x540635){return _0x540635['id']===_0x73d485[_0xf115('0x79')]&&_0x540635['type']===_0xf115('0x7b');});break;}if(_0x26c2fa)_0x154dca['push'](_0x73d485);});_0x2eb654[_0xf115('0x1c')]=_0x154dca[_0xf115('0x43')];_0x2eb654['rows']=_0x154dca;return _0x2eb654;});}else{return db[_0x4952d0[_0xf115('0x6d')]][_0xf115('0x1c')]({'where':_0x1105fa['where']})[_0xf115('0x25')](function(_0x32cd6b){_0x2eb654[_0xf115('0x1c')]=_0x32cd6b;if(_0x4425cd[_0xf115('0x2f')][_0xf115('0x40')]){if(_0x4952d0[_0xf115('0x6d')]==='CmContact'){_0x1105fa[_0xf115('0x41')]=[{'model':db['Tag'],'as':'Tags','attributes':['id',_0xf115('0x29'),_0xf115('0x7c')],'required':_0x4425cd[_0xf115('0x2f')]['tag']?!![]:![]},{'model':db[_0xf115('0x7d')],'as':_0xf115('0x7e'),'attributes':['id',_0xf115('0x29'),_0xf115('0x7c')],'through':_0x4425cd[_0xf115('0x2f')]['tag']?{'attributes':[],'where':{'TagId':_0x4425cd[_0xf115('0x2f')][_0xf115('0x7f')]||undefined}}:{},'required':_0x4425cd[_0xf115('0x2f')][_0xf115('0x7f')]?!![]:![]}];}else{_0x1105fa[_0xf115('0x41')]=[{'all':!![]}];}}return db[_0x4952d0[_0xf115('0x6d')]][_0xf115('0x4e')](_0x1105fa);})['then'](function(_0x117dfb){_0x2eb654[_0xf115('0x80')]=_0x117dfb;return _0x2eb654;});}}else{return _0x2eb654;}})[_0xf115('0x25')](respondWithFilteredResult(_0xfe3e07,_0x1105fa))[_0xf115('0x47')](handleError(_0xfe3e07,null));};function getAllResources(_0x170c58,_0x3eb2d5){return new BPromise(function(_0x31a72b,_0xad2136){if(_0x3eb2d5){var _0x25219f=_0x3eb2d5['filter']?{[_0x3eb2d5['filter'][_0xf115('0x74')]]:_0x3eb2d5[_0xf115('0x3c')]['value']}:undefined;return db[_0x170c58][_0xf115('0x4e')]({'where':_0x25219f,'raw':!![]})['then'](function(_0x2854f3){_0x3eb2d5[_0xf115('0x76')]=_[_0xf115('0x2a')](_0x2854f3,'id');_0x31a72b(_0x3eb2d5);})[_0xf115('0x47')](function(_0x2f52d0){_0xad2136(_0x2f52d0);});}else{_0x31a72b(null);}});}function getAllFilteredResources(_0x326d63,_0x2ed757){return new BPromise(function(_0x10e771,_0x511b2f){var _0x27ac84=_0x326d63[_0xf115('0x3c')]?{[_0x326d63[_0xf115('0x3c')][_0xf115('0x74')]]:_0x326d63[_0xf115('0x3c')][_0xf115('0x81')]}:undefined;return db[_0x326d63['model']][_0xf115('0x4e')]({'where':_0x27ac84,'raw':!![]})[_0xf115('0x25')](function(_0x269003){_0x2ed757[_0xf115('0x76')]=_[_0xf115('0x2a')](_0x269003,function(_0x1979b7){return _0x1979b7[_0xf115('0x29')];});_0x10e771(_0x2ed757);})['catch'](function(_0x40da4f){_0x511b2f(_0x40da4f);});});}function getAllowedResources(_0x50f3e5,_0x1a1cf8,_0x264175){return new BPromise(function(_0x10c2ec,_0x519b02){if(_0x1a1cf8){return db[_0xf115('0x51')][_0xf115('0x4e')]({'where':{'sectionId':_0x1a1cf8['id']},'raw':!![]})['then'](function(_0x48f073){if(_0x50f3e5[_0xf115('0x74')]&&_0x50f3e5['field']!=='id'){_0x1a1cf8[_0xf115('0x76')]=_[_0xf115('0x2a')](_0x48f073,function(_0x350c3e){return _0x350c3e[_0x50f3e5[_0xf115('0x74')]];});}else{if(_0x264175===_0xf115('0x77')){_0x1a1cf8['associatedResources']=_[_0xf115('0x2a')](_0x48f073,function(_0x50e07e){return{'id':_0x50e07e[_0xf115('0x64')],'type':_0x50e07e[_0xf115('0x2d')]};});}else{_0x1a1cf8[_0xf115('0x76')]=_['map'](_0x48f073,function(_0x3e2806){return _0x3e2806[_0xf115('0x64')];});}}_0x10c2ec(_0x1a1cf8);})[_0xf115('0x47')](function(_0x3b8aa4){_0x519b02(_0x3b8aa4);});}else{_0x10c2ec(null);}});}function getQueryModels(_0x5079cd,_0x1c6b6d){var _0x2f22b5=_0x5079cd['toLowerCase']();var _0x4f5507={'childModel':undefined,'parentSections':[]};switch(_0x2f22b5){case _0xf115('0x82'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x83');break;case _0xf115('0x84'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x85');break;case _0xf115('0x86'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x87');_0x4f5507[_0xf115('0x6f')]=[{'name':_0xf115('0x88'),'field':_0xf115('0x29'),'foreignKey':_0xf115('0x89')}];break;case _0xf115('0x8a'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x8b');break;case _0xf115('0x8c'):_0x4f5507['childModel']=_0xf115('0x8d');_0x4f5507['parentSections']=[{'name':_0xf115('0x8e'),'field':'id','foreignKey':_0xf115('0x8f')}];break;case'lists':_0x4f5507[_0xf115('0x6d')]='CmList';break;case _0xf115('0x90'):_0x4f5507[_0xf115('0x6d')]='CmCompany';break;case'globalcustomfields':_0x4f5507[_0xf115('0x6d')]=_0xf115('0x91');break;case'chatqueues':_0x4f5507[_0xf115('0x6d')]=_0xf115('0x92');break;case _0xf115('0x93'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x94');break;case _0xf115('0x95'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x96');break;case _0xf115('0x97'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x98');break;case _0xf115('0x99'):case'internalroutes':case _0xf115('0x9a'):_0x4f5507[_0xf115('0x6d')]='VoiceExtension';break;case _0xf115('0x9b'):_0x4f5507[_0xf115('0x6d')]='VoiceContext';break;case _0xf115('0x9c'):_0x4f5507[_0xf115('0x6d')]='VoiceMail';break;case'voicerecordings':_0x4f5507[_0xf115('0x6d')]='VoiceRecording';_0x4f5507[_0xf115('0x6f')]=[{'name':_0xf115('0x9d'),'field':_0xf115('0x29'),'foreignKey':_0xf115('0x9e'),'model':_0xf115('0x9f'),'filter':{'field':'role','value':[_0xf115('0xa0')]}},{'name':_0xf115('0xa1'),'field':'name','foreignKey':_0xf115('0x9e'),'model':'User','filter':{'field':_0xf115('0xa2'),'value':[_0xf115('0xa3')]}},{'name':_0xf115('0xa4'),'field':_0xf115('0x29'),'foreignKey':_0xf115('0xa5'),'model':_0xf115('0xa6'),'filter':{'field':_0xf115('0x2d'),'value':[_0xf115('0xa7')]}},{'name':'QueueCampaigns','field':_0xf115('0x29'),'foreignKey':_0xf115('0xa5'),'model':'VoiceQueue','filter':{'field':'type','value':['outbound']}}];break;case _0xf115('0xa8'):_0x4f5507['childModel']=_0xf115('0xa9');break;case _0xf115('0xaa'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xab');break;case _0xf115('0xac'):_0x4f5507['childModel']=_0xf115('0xad');break;case _0xf115('0xae'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xaf');break;case _0xf115('0xb0'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xb1');break;case _0xf115('0xb2'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xb3');break;case _0xf115('0xb4'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xb5');break;case _0xf115('0xb6'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xb7');break;case _0xf115('0xb8'):_0x4f5507['childModel']='OpenchannelAccount';break;case _0xf115('0xb9'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xba');break;case'smsaccounts':_0x4f5507['childModel']=_0xf115('0xbb');break;case'whatsappqueues':_0x4f5507[_0xf115('0x6d')]=_0xf115('0xbc');break;case _0xf115('0xbd'):_0x4f5507['childModel']='WhatsappAccount';break;case _0xf115('0xbe'):_0x4f5507['childModel']=_0xf115('0xbf');break;case _0xf115('0xc0'):case _0xf115('0xc1'):_0x4f5507[_0xf115('0x6d')]='VoiceQueue';if(_0x1c6b6d){_0x4f5507[_0xf115('0x6f')]=[{'name':_0xf115('0xa4')},{'name':_0xf115('0xc2')}];}break;case _0xf115('0xc3'):case _0xf115('0xc4'):case'telephones':_0x4f5507[_0xf115('0x6d')]=_0xf115('0x9f');if(_0x1c6b6d){_0x4f5507[_0xf115('0x6f')]=[{'name':'Users','filter':{'field':_0xf115('0xa2'),'value':[_0xf115('0xc5'),_0xf115('0xc6')]},'ignore':!![]},{'name':_0xf115('0x9d')},{'name':_0xf115('0xa1')}];}break;case _0xf115('0xc7'):_0x4f5507['childModel']='ZendeskAccount';break;case _0xf115('0xc8'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xc9');break;case'freshdeskaccounts':_0x4f5507[_0xf115('0x6d')]=_0xf115('0xca');break;case _0xf115('0xcb'):_0x4f5507['childModel']=_0xf115('0xcc');break;case _0xf115('0xcd'):_0x4f5507['childModel']=_0xf115('0xce');break;case _0xf115('0xcf'):_0x4f5507[_0xf115('0x6d')]='ZohoAccount';break;case _0xf115('0xd0'):_0x4f5507[_0xf115('0x6d')]='User';break;case _0xf115('0xd1'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xd2');break;case _0xf115('0xd3'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xd4');break;case _0xf115('0xd5'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x61');break;case'intervals':_0x4f5507['childModel']=_0xf115('0xd6');break;case _0xf115('0xd7'):_0x4f5507['childModel']='Pause';break;case _0xf115('0xd8'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xd9');break;case _0xf115('0xda'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xdb');break;case _0xf115('0xdc'):_0x4f5507[_0xf115('0x6d')]='Tag';break;case _0xf115('0xdd'):_0x4f5507['childModel']='Template';break;case _0xf115('0xde'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xdf');break;case'trunks':_0x4f5507['childModel']=_0xf115('0xe0');break;case'variables':_0x4f5507[_0xf115('0x6d')]=_0xf115('0xe1');break;case _0xf115('0xe2'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x65');break;case _0xf115('0xe3'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0x77');_0x4f5507['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xf115('0xe4'):_0x4f5507[_0xf115('0x6d')]=_0xf115('0xe5');break;case _0xf115('0xbd'):_0x4f5507['childModel']=_0xf115('0xe6');break;default:return _0x4f5507;}return _0x4f5507;}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js
index cac1d0e..86f5601 100644
--- a/server/api/userProfile/userProfile.events.js
+++ b/server/api/userProfile/userProfile.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc13c=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x4cdfbf,_0x3c58fa){var _0x22e845=function(_0x3a48fc){while(--_0x3a48fc){_0x4cdfbf['push'](_0x4cdfbf['shift']());}};_0x22e845(++_0x3c58fa);}(_0xc13c,0x71));var _0xcc13=function(_0x1a8770,_0x344224){_0x1a8770=_0x1a8770-0x0;var _0x1528ef=_0xc13c[_0x1a8770];return _0x1528ef;};'use strict';var EventEmitter=require(_0xcc13('0x0'));var UserProfile=require(_0xcc13('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc13('0x2'),'afterUpdate':_0xcc13('0x3'),'afterDestroy':_0xcc13('0x4')};function emitEvent(_0x174360){return function(_0x225427,_0x3641e1,_0x487e66){UserProfileEvents[_0xcc13('0x5')](_0x174360+':'+_0x225427['id'],_0x225427);UserProfileEvents[_0xcc13('0x5')](_0x174360,_0x225427);_0x487e66(null);};}for(var e in events){if(events[_0xcc13('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xcc13('0x7')]=UserProfileEvents;
\ No newline at end of file
+var _0x3387=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x3387,0x11d));var _0x7338=function(_0xdb9019,_0x1fef22){_0xdb9019=_0xdb9019-0x0;var _0x298894=_0x3387[_0xdb9019];return _0x298894;};'use strict';var EventEmitter=require(_0x7338('0x0'));var UserProfile=require(_0x7338('0x1'))['db'][_0x7338('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7338('0x3'),'afterUpdate':_0x7338('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ab6be){return function(_0x575171,_0x1689d3,_0x201f5c){UserProfileEvents['emit'](_0x3ab6be+':'+_0x575171['id'],_0x575171);UserProfileEvents[_0x7338('0x5')](_0x3ab6be,_0x575171);_0x201f5c(null);};}for(var e in events){if(events[_0x7338('0x6')](e)){var event=events[e];UserProfile[_0x7338('0x7')](e,emitEvent(event));}}module[_0x7338('0x8')]=UserProfileEvents;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js
index 8df7c8d..70ae2b7 100644
--- a/server/api/userProfile/userProfile.model.js
+++ b/server/api/userProfile/userProfile.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3cc8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','define','UserProfile','user_profiles','lodash','util','../../config/logger','api'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x3cc8,0x164));var _0x83cc=function(_0x107426,_0x7af5cc){_0x107426=_0x107426-0x0;var _0x21f9f0=_0x3cc8[_0x107426];return _0x21f9f0;};'use strict';var _=require(_0x83cc('0x0'));var util=require(_0x83cc('0x1'));var logger=require(_0x83cc('0x2'))(_0x83cc('0x3'));var moment=require(_0x83cc('0x4'));var BPromise=require(_0x83cc('0x5'));var rp=require(_0x83cc('0x6'));var fs=require('fs');var path=require(_0x83cc('0x7'));var rimraf=require(_0x83cc('0x8'));var config=require(_0x83cc('0x9'));var attributes=require(_0x83cc('0xa'));module[_0x83cc('0xb')]=function(_0x2b83f6,_0x2add67){return _0x2b83f6[_0x83cc('0xc')](_0x83cc('0xd'),attributes,{'tableName':_0x83cc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1013=['request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','user_profiles','lodash','util','../../config/logger','moment'];(function(_0x68289d,_0x8b97a9){var _0x4a71c1=function(_0x18336a){while(--_0x18336a){_0x68289d['push'](_0x68289d['shift']());}};_0x4a71c1(++_0x8b97a9);}(_0x1013,0x188));var _0x3101=function(_0x553038,_0x38db28){_0x553038=_0x553038-0x0;var _0x590672=_0x1013[_0x553038];return _0x590672;};'use strict';var _=require(_0x3101('0x0'));var util=require(_0x3101('0x1'));var logger=require(_0x3101('0x2'))('api');var moment=require(_0x3101('0x3'));var BPromise=require('bluebird');var rp=require(_0x3101('0x4'));var fs=require('fs');var path=require(_0x3101('0x5'));var rimraf=require(_0x3101('0x6'));var config=require(_0x3101('0x7'));var attributes=require(_0x3101('0x8'));module[_0x3101('0x9')]=function(_0x27693d,_0x5367e1){return _0x27693d['define']('UserProfile',attributes,{'tableName':_0x3101('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js
index 709276e..39bc7ae 100644
--- a/server/api/userProfile/userProfile.rpc.js
+++ b/server/api/userProfile/userProfile.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x71ab=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','request\x20sent','stringify','error','message','UserProfile,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x30a512,_0x2779ac){var _0xd668f=function(_0x2b0a45){while(--_0x2b0a45){_0x30a512['push'](_0x30a512['shift']());}};_0xd668f(++_0x2779ac);}(_0x71ab,0x64));var _0xb71a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x71ab[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});config[_0xb71a('0xb')]=_[_0xb71a('0xc')](config[_0xb71a('0xb')],{'host':_0xb71a('0xd'),'port':0x18eb});var socket=require(_0xb71a('0xe'))(new Redis(config[_0xb71a('0xb')]));require(_0xb71a('0xf'))[_0xb71a('0x10')](socket);function respondWithRpcPromise(_0x2e8883,_0x517eed,_0xfec897){return new BPromise(function(_0x58956d,_0x3d7bd7){return client[_0xb71a('0x11')](_0x2e8883,_0xfec897)[_0xb71a('0x12')](function(_0x591311){logger[_0xb71a('0x13')]('UserProfile,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'),JSON[_0xb71a('0x15')](_0x591311));if(_0x591311[_0xb71a('0x16')]){if(_0x591311[_0xb71a('0x16')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x3d7bd7(_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);}logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x58956d(_0x591311[_0xb71a('0x16')]['message']);}else{logger[_0xb71a('0x13')](_0xb71a('0x18'),_0x517eed,_0xb71a('0x14'));_0x58956d(_0x591311[_0xb71a('0x19')][_0xb71a('0x17')]);}})[_0xb71a('0x1a')](function(_0x349de1){logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x349de1);_0x3d7bd7(_0x349de1);});});}
\ No newline at end of file
+var _0xeff8=['./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x47410f,_0x5ee094){var _0x587f4d=function(_0x340933){while(--_0x340933){_0x47410f['push'](_0x47410f['shift']());}};_0x587f4d(++_0x5ee094);}(_0xeff8,0x186));var _0x8eff=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xeff8[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});config[_0x8eff('0xb')]=_[_0x8eff('0xc')](config['redis'],{'host':_0x8eff('0xd'),'port':0x18eb});var socket=require(_0x8eff('0xe'))(new Redis(config[_0x8eff('0xb')]));require(_0x8eff('0xf'))['register'](socket);function respondWithRpcPromise(_0x56f120,_0x359d62,_0x430b45){return new BPromise(function(_0xb2117e,_0x52d250){return client[_0x8eff('0x10')](_0x56f120,_0x430b45)[_0x8eff('0x11')](function(_0x5172a5){logger[_0x8eff('0x12')](_0x8eff('0x13'),_0x359d62,'request\x20sent');logger['debug'](_0x8eff('0x14'),_0x359d62,_0x8eff('0x15'),JSON[_0x8eff('0x16')](_0x5172a5));if(_0x5172a5[_0x8eff('0x17')]){if(_0x5172a5[_0x8eff('0x17')]['code']===0x1f4){logger[_0x8eff('0x17')](_0x8eff('0x13'),_0x359d62,_0x5172a5[_0x8eff('0x17')][_0x8eff('0x18')]);return _0x52d250(_0x5172a5[_0x8eff('0x17')][_0x8eff('0x18')]);}logger[_0x8eff('0x17')](_0x8eff('0x13'),_0x359d62,_0x5172a5[_0x8eff('0x17')][_0x8eff('0x18')]);return _0xb2117e(_0x5172a5[_0x8eff('0x17')]['message']);}else{logger[_0x8eff('0x12')](_0x8eff('0x13'),_0x359d62,_0x8eff('0x15'));_0xb2117e(_0x5172a5[_0x8eff('0x19')][_0x8eff('0x18')]);}})[_0x8eff('0x1a')](function(_0x38f5ee){logger[_0x8eff('0x17')](_0x8eff('0x13'),_0x359d62,_0x38f5ee);_0x52d250(_0x38f5ee);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js
index aa702fb..ba395d2 100644
--- a/server/api/userProfile/userProfile.socket.js
+++ b/server/api/userProfile/userProfile.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf64e=['register','length','./userProfile.events','save','remove','update','emit','removeListener'];(function(_0xc5b411,_0x32de1d){var _0xffa167=function(_0x2d6ec0){while(--_0x2d6ec0){_0xc5b411['push'](_0xc5b411['shift']());}};_0xffa167(++_0x32de1d);}(_0xf64e,0xf2));var _0xef64=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf64e[_0x57b54c];return _0x59cc19;};'use strict';var UserProfileEvents=require(_0xef64('0x0'));var events=[_0xef64('0x1'),_0xef64('0x2'),_0xef64('0x3')];function createListener(_0x183004,_0x213220){return function(_0x39f290){_0x213220[_0xef64('0x4')](_0x183004,_0x39f290);};}function removeListener(_0x9b598,_0x551fc3){return function(){UserProfileEvents[_0xef64('0x5')](_0x9b598,_0x551fc3);};}exports[_0xef64('0x6')]=function(_0x3ba2cd){for(var _0xe46bbd=0x0,_0x6aebf8=events[_0xef64('0x7')];_0xe46bbd<_0x6aebf8;_0xe46bbd++){var _0xbbb9e1=events[_0xe46bbd];var _0xd745db=createListener('userProfile:'+_0xbbb9e1,_0x3ba2cd);UserProfileEvents['on'](_0xbbb9e1,_0xd745db);}};
\ No newline at end of file
+var _0xfa66=['emit','removeListener','register','length','userProfile:','./userProfile.events','remove'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xfa66,0x140));var _0x6fa6=function(_0x2b9383,_0x36f0fa){_0x2b9383=_0x2b9383-0x0;var _0x439c95=_0xfa66[_0x2b9383];return _0x439c95;};'use strict';var UserProfileEvents=require(_0x6fa6('0x0'));var events=['save',_0x6fa6('0x1'),'update'];function createListener(_0x298884,_0x2ffc31){return function(_0x3829dd){_0x2ffc31[_0x6fa6('0x2')](_0x298884,_0x3829dd);};}function removeListener(_0x44057b,_0x3c0a48){return function(){UserProfileEvents[_0x6fa6('0x3')](_0x44057b,_0x3c0a48);};}exports[_0x6fa6('0x4')]=function(_0x56c6f1){for(var _0xa698bb=0x0,_0x5282b8=events[_0x6fa6('0x5')];_0xa698bb<_0x5282b8;_0xa698bb++){var _0x55ec1c=events[_0xa698bb];var _0x10ca06=createListener(_0x6fa6('0x6')+_0x55ec1c,_0x56c6f1);UserProfileEvents['on'](_0x55ec1c,_0x10ca06);}};
\ No newline at end of file
diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js
index 88f4ecf..0057cb3 100644
--- a/server/api/userProfileResource/index.js
+++ b/server/api/userProfileResource/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x60d7=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x2baa0f,_0x8c18bd){var _0x46d1b0=function(_0x573864){while(--_0x573864){_0x2baa0f['push'](_0x2baa0f['shift']());}};_0x46d1b0(++_0x8c18bd);}(_0x60d7,0x149));var _0x760d=function(_0x119f8f,_0x3a3ddc){_0x119f8f=_0x119f8f-0x0;var _0x3759c9=_0x60d7[_0x119f8f];return _0x3759c9;};'use strict';var multer=require(_0x760d('0x0'));var util=require(_0x760d('0x1'));var path=require(_0x760d('0x2'));var timeout=require(_0x760d('0x3'));var express=require(_0x760d('0x4'));var router=express[_0x760d('0x5')]();var auth=require(_0x760d('0x6'));var interaction=require(_0x760d('0x7'));var config=require(_0x760d('0x8'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x760d('0x9')](),controller[_0x760d('0xa')]);router[_0x760d('0xb')](_0x760d('0xc'),auth[_0x760d('0x9')](),controller[_0x760d('0xd')]);router[_0x760d('0xb')](_0x760d('0xe'),auth[_0x760d('0x9')](),controller[_0x760d('0xf')]);router[_0x760d('0x10')]('/',auth[_0x760d('0x9')](),controller[_0x760d('0x11')]);router['put'](_0x760d('0xe'),auth[_0x760d('0x9')](),controller[_0x760d('0x12')]);router[_0x760d('0x13')](_0x760d('0xe'),auth['isAuthenticated'](),controller[_0x760d('0x14')]);module[_0x760d('0x15')]=router;
\ No newline at end of file
+var _0x8e11=['Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','describe','/:id','post','put','update','destroy','util','path','connect-timeout','express'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8e11,0x11d));var _0x18e1=function(_0x421b62,_0x462715){_0x421b62=_0x421b62-0x0;var _0x1ca612=_0x8e11[_0x421b62];return _0x1ca612;};'use strict';var multer=require('multer');var util=require(_0x18e1('0x0'));var path=require(_0x18e1('0x1'));var timeout=require(_0x18e1('0x2'));var express=require(_0x18e1('0x3'));var router=express[_0x18e1('0x4')]();var auth=require(_0x18e1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x18e1('0x6'));var controller=require(_0x18e1('0x7'));router[_0x18e1('0x8')]('/',auth[_0x18e1('0x9')](),controller[_0x18e1('0xa')]);router[_0x18e1('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x18e1('0xb')]);router[_0x18e1('0x8')](_0x18e1('0xc'),auth[_0x18e1('0x9')](),controller['show']);router[_0x18e1('0xd')]('/',auth[_0x18e1('0x9')](),controller['create']);router[_0x18e1('0xe')](_0x18e1('0xc'),auth['isAuthenticated'](),controller[_0x18e1('0xf')]);router['delete'](_0x18e1('0xc'),auth[_0x18e1('0x9')](),controller[_0x18e1('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js
index fa7e7c5..09806cc 100644
--- a/server/api/userProfileResource/userProfileResource.attributes.js
+++ b/server/api/userProfileResource/userProfileResource.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc6f0=['STRING','sequelize','exports'];(function(_0x93b766,_0x20896e){var _0x4e4302=function(_0x3299a4){while(--_0x3299a4){_0x93b766['push'](_0x93b766['shift']());}};_0x4e4302(++_0x20896e);}(_0xc6f0,0x7f));var _0x0c6f=function(_0x2c417e,_0x191875){_0x2c417e=_0x2c417e-0x0;var _0x21d476=_0xc6f0[_0x2c417e];return _0x21d476;};'use strict';var Sequelize=require(_0x0c6f('0x0'));module[_0x0c6f('0x1')]={'name':{'type':Sequelize[_0x0c6f('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x0c6f('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x227b=['exports','STRING','sequelize'];(function(_0xf9905d,_0x2bc320){var _0x3d2f35=function(_0x5e0686){while(--_0x5e0686){_0xf9905d['push'](_0xf9905d['shift']());}};_0x3d2f35(++_0x2bc320);}(_0x227b,0x9e));var _0xb227=function(_0x4759cc,_0x3720ad){_0x4759cc=_0x4759cc-0x0;var _0x9f92e7=_0x227b[_0x4759cc];return _0x9f92e7;};'use strict';var Sequelize=require(_0xb227('0x0'));module[_0xb227('0x1')]={'name':{'type':Sequelize[_0xb227('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js
index 31bd2f0..456729b 100644
--- a/server/api/userProfileResource/userProfileResource.controller.js
+++ b/server/api/userProfileResource/userProfileResource.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','destroy','then','name','send','index','map','UserProfileResource','fieldName','type','key','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x11c052,_0x5163a1){var _0x9af51b=function(_0x461c50){while(--_0x461c50){_0x11c052['push'](_0x11c052['shift']());}};_0x9af51b(++_0x5163a1);}(_0x008c,0x188));var _0xc008=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x008c[_0x43c8b8];return _0x413be3;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];function respondWithStatusCode(_0x2a5b4e,_0x9ffa93){_0x9ffa93=_0x9ffa93||0xcc;return function(_0x1819c6){if(_0x1819c6){return _0x2a5b4e[_0xc008('0x17')](_0x9ffa93);}return _0x2a5b4e['status'](_0x9ffa93)['end']();};}function respondWithResult(_0x33f44c,_0x50c1ab){_0x50c1ab=_0x50c1ab||0xc8;return function(_0x25e13f){if(_0x25e13f){return _0x33f44c[_0xc008('0x18')](_0x50c1ab)[_0xc008('0x19')](_0x25e13f);}};}function respondWithFilteredResult(_0x339ffc,_0x3f0ecf){return function(_0x5ee00b){if(_0x5ee00b){var _0x5e894e=_0x5ee00b[_0xc008('0x1a')],_0x4bd0f4=_0x3f0ecf[_0xc008('0x1b')],_0x11ef38=_0x3f0ecf['offset']+_0x3f0ecf['limit'],_0x15a6ad;if(_0x11ef38>=_0x5e894e){_0x11ef38=_0x5e894e;_0x15a6ad=0xc8;}else{_0x15a6ad=0xce;}_0x339ffc['status'](_0x15a6ad);return _0x339ffc['set'](_0xc008('0x1c'),_0x4bd0f4+'-'+_0x11ef38+'/'+_0x5e894e)[_0xc008('0x19')](_0x5ee00b);}return null;};}function patchUpdates(_0x501137){return function(_0x813397){try{jsonpatch['apply'](_0x813397,_0x501137,!![]);}catch(_0x4bd611){return BPromise['reject'](_0x4bd611);}return _0x813397['save']();};}function saveUpdates(_0x5754a0,_0x4b9726){return function(_0x5560b1){if(_0x5560b1){return _0x5560b1['update'](_0x5754a0)['then'](function(_0x5a58bd){return _0x5a58bd;});}return null;};}function removeEntity(_0x13a263,_0x4777a6){return function(_0x251db2){if(_0x251db2){return _0x251db2[_0xc008('0x1d')]()[_0xc008('0x1e')](function(){_0x13a263[_0xc008('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(!_0x58a6ea){_0x459fd9[_0xc008('0x17')](0x194);}return _0x58a6ea;};}function handleError(_0x36f358,_0x2e3cfb){_0x2e3cfb=_0x2e3cfb||0x1f4;return function(_0x3cb28c){logger['error'](_0x3cb28c['stack']);if(_0x3cb28c['name']){delete _0x3cb28c[_0xc008('0x1f')];}_0x36f358[_0xc008('0x18')](_0x2e3cfb)[_0xc008('0x20')](_0x3cb28c);};}exports[_0xc008('0x21')]=function(_0x5bebd9,_0x5e2aca){var _0x4fce9c={},_0x4adbab={},_0x4caaf4={'count':0x0,'rows':[]};var _0x3865c0=_[_0xc008('0x22')](db[_0xc008('0x23')]['rawAttributes'],function(_0x24c14c){return{'name':_0x24c14c[_0xc008('0x24')],'type':_0x24c14c[_0xc008('0x25')][_0xc008('0x26')]};});_0x4adbab['model']=_[_0xc008('0x22')](_0x3865c0,_0xc008('0x1f'));_0x4adbab['query']=_['keys'](_0x5bebd9['query']);_0x4adbab[_0xc008('0x27')]=_[_0xc008('0x28')](_0x4adbab[_0xc008('0x29')],_0x4adbab[_0xc008('0x2a')]);_0x4fce9c[_0xc008('0x2b')]=_[_0xc008('0x28')](_0x4adbab[_0xc008('0x29')],qs[_0xc008('0x2c')](_0x5bebd9[_0xc008('0x2a')][_0xc008('0x2c')]));_0x4fce9c[_0xc008('0x2b')]=_0x4fce9c[_0xc008('0x2b')]['length']?_0x4fce9c[_0xc008('0x2b')]:_0x4adbab[_0xc008('0x29')];if(!_0x5bebd9['query'][_0xc008('0x2d')](_0xc008('0x2e'))){_0x4fce9c[_0xc008('0x2f')]=qs[_0xc008('0x2f')](_0x5bebd9[_0xc008('0x2a')][_0xc008('0x2f')]);_0x4fce9c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x5bebd9[_0xc008('0x2a')]['offset']);}_0x4fce9c[_0xc008('0x30')]=qs[_0xc008('0x31')](_0x5bebd9[_0xc008('0x2a')][_0xc008('0x31')]);_0x4fce9c[_0xc008('0x32')]=qs[_0xc008('0x27')](_[_0xc008('0x33')](_0x5bebd9['query'],_0x4adbab[_0xc008('0x27')]),_0x3865c0);if(_0x5bebd9[_0xc008('0x2a')]['filter']){_0x4fce9c[_0xc008('0x32')]=_[_0xc008('0x34')](_0x4fce9c['where'],{'$or':_[_0xc008('0x22')](_0x3865c0,function(_0x2e4ae1){if(_0x2e4ae1[_0xc008('0x25')]!=='VIRTUAL'){var _0x53b353={};_0x53b353[_0x2e4ae1['name']]={'$like':'%'+_0x5bebd9[_0xc008('0x2a')]['filter']+'%'};return _0x53b353;}})});}_0x4fce9c=_[_0xc008('0x34')]({},_0x4fce9c,_0x5bebd9[_0xc008('0x35')]);var _0x6a4ccb={'where':_0x4fce9c[_0xc008('0x32')]};return db[_0xc008('0x23')][_0xc008('0x1a')](_0x6a4ccb)[_0xc008('0x1e')](function(_0x35b496){_0x4caaf4[_0xc008('0x1a')]=_0x35b496;if(_0x5bebd9[_0xc008('0x2a')][_0xc008('0x36')]){_0x4fce9c[_0xc008('0x37')]=[{'all':!![]}];}return db[_0xc008('0x23')][_0xc008('0x38')](_0x4fce9c);})['then'](function(_0x3238b4){_0x4caaf4[_0xc008('0x39')]=_0x3238b4;return _0x4caaf4;})[_0xc008('0x1e')](respondWithFilteredResult(_0x5e2aca,_0x4fce9c))[_0xc008('0x3a')](handleError(_0x5e2aca,null));};exports['show']=function(_0x2c4964,_0x15396b){var _0xc8cb91={'raw':![],'where':{'id':_0x2c4964[_0xc008('0x3b')]['id']}},_0x36e7ae={};_0x36e7ae['model']=_[_0xc008('0x3c')](db[_0xc008('0x23')][_0xc008('0x3d')]);_0x36e7ae[_0xc008('0x2a')]=_[_0xc008('0x3c')](_0x2c4964['query']);_0x36e7ae[_0xc008('0x27')]=_[_0xc008('0x28')](_0x36e7ae[_0xc008('0x29')],_0x36e7ae[_0xc008('0x2a')]);_0xc8cb91['attributes']=_[_0xc008('0x28')](_0x36e7ae[_0xc008('0x29')],qs[_0xc008('0x2c')](_0x2c4964['query'][_0xc008('0x2c')]));_0xc8cb91['attributes']=_0xc8cb91[_0xc008('0x2b')]['length']?_0xc8cb91[_0xc008('0x2b')]:_0x36e7ae[_0xc008('0x29')];if(_0x2c4964['query'][_0xc008('0x36')]){_0xc8cb91[_0xc008('0x37')]=[{'all':!![]}];}_0xc8cb91=_[_0xc008('0x34')]({},_0xc8cb91,_0x2c4964['options']);return db[_0xc008('0x23')][_0xc008('0x3e')](_0xc8cb91)[_0xc008('0x1e')](handleEntityNotFound(_0x15396b,null))[_0xc008('0x1e')](respondWithResult(_0x15396b,null))[_0xc008('0x3a')](handleError(_0x15396b,null));};exports[_0xc008('0x3f')]=function(_0x59ca2b,_0x47cafa){return db['UserProfileResource'][_0xc008('0x3f')](_0x59ca2b[_0xc008('0x40')],{})[_0xc008('0x1e')](respondWithResult(_0x47cafa,0xc9))[_0xc008('0x3a')](handleError(_0x47cafa,null));};exports[_0xc008('0x41')]=function(_0x24f6a4,_0x2cf641){if(_0x24f6a4[_0xc008('0x40')]['id']){delete _0x24f6a4['body']['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x24f6a4[_0xc008('0x3b')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x2cf641,null))[_0xc008('0x1e')](saveUpdates(_0x24f6a4['body'],null))[_0xc008('0x1e')](respondWithResult(_0x2cf641,null))[_0xc008('0x3a')](handleError(_0x2cf641,null));};exports[_0xc008('0x1d')]=function(_0x1c2c50,_0x4981b4){return db[_0xc008('0x23')][_0xc008('0x3e')]({'where':{'id':_0x1c2c50[_0xc008('0x3b')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x4981b4,null))[_0xc008('0x1e')](removeEntity(_0x4981b4,null))['catch'](handleError(_0x4981b4,null));};exports['describe']=function(_0x223056,_0x51cb14){return db[_0xc008('0x23')][_0xc008('0x42')]()[_0xc008('0x1e')](respondWithResult(_0x51cb14,null))['catch'](handleError(_0x51cb14,null));};
\ No newline at end of file
+var _0x46ed=['sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','UserProfileResource','includeAll','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3ecc83,_0x1d339c){var _0x27b25f=function(_0x22e7d2){while(--_0x22e7d2){_0x3ecc83['push'](_0x3ecc83['shift']());}};_0x27b25f(++_0x1d339c);}(_0x46ed,0x168));var _0xd46e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46ed[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xd46e('0x0'));var emlformat=require(_0xd46e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd46e('0x2'));var jsonpatch=require(_0xd46e('0x3'));var rp=require(_0xd46e('0x4'));var moment=require('moment');var BPromise=require(_0xd46e('0x5'));var Mustache=require(_0xd46e('0x6'));var util=require('util');var path=require(_0xd46e('0x7'));var sox=require(_0xd46e('0x8'));var csv=require(_0xd46e('0x9'));var ejs=require(_0xd46e('0xa'));var fs=require('fs');var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x9'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24c54b,_0x5bc1da){_0x5bc1da=_0x5bc1da||0xcc;return function(_0x48550b){if(_0x48550b){return _0x24c54b[_0xd46e('0x19')](_0x5bc1da);}return _0x24c54b[_0xd46e('0x1a')](_0x5bc1da)['end']();};}function respondWithResult(_0x5a3076,_0xacd799){_0xacd799=_0xacd799||0xc8;return function(_0x4688ae){if(_0x4688ae){return _0x5a3076[_0xd46e('0x1a')](_0xacd799)[_0xd46e('0x1b')](_0x4688ae);}};}function respondWithFilteredResult(_0x50c7c3,_0x3b6d25){return function(_0x44a620){if(_0x44a620){var _0x417402=_0x44a620[_0xd46e('0x1c')],_0x3d72ce=_0x3b6d25[_0xd46e('0x1d')],_0x36a317=_0x3b6d25[_0xd46e('0x1d')]+_0x3b6d25['limit'],_0x47fa8f;if(_0x36a317>=_0x417402){_0x36a317=_0x417402;_0x47fa8f=0xc8;}else{_0x47fa8f=0xce;}_0x50c7c3['status'](_0x47fa8f);return _0x50c7c3[_0xd46e('0x1e')](_0xd46e('0x1f'),_0x3d72ce+'-'+_0x36a317+'/'+_0x417402)['json'](_0x44a620);}return null;};}function patchUpdates(_0x4fd1f2){return function(_0x2d6f2c){try{jsonpatch[_0xd46e('0x20')](_0x2d6f2c,_0x4fd1f2,!![]);}catch(_0x362885){return BPromise[_0xd46e('0x21')](_0x362885);}return _0x2d6f2c[_0xd46e('0x22')]();};}function saveUpdates(_0x312d6f,_0x3b5fa4){return function(_0x327b7e){if(_0x327b7e){return _0x327b7e[_0xd46e('0x23')](_0x312d6f)[_0xd46e('0x24')](function(_0x468aba){return _0x468aba;});}return null;};}function removeEntity(_0x5ba94d,_0x259072){return function(_0x1c83fa){if(_0x1c83fa){return _0x1c83fa[_0xd46e('0x25')]()[_0xd46e('0x24')](function(){_0x5ba94d[_0xd46e('0x1a')](0xcc)[_0xd46e('0x26')]();});}};}function handleEntityNotFound(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(!_0x62dea5){_0x33c2e0['sendStatus'](0x194);}return _0x62dea5;};}function handleError(_0x314570,_0x5424e5){_0x5424e5=_0x5424e5||0x1f4;return function(_0x4b8f6a){logger[_0xd46e('0x27')](_0x4b8f6a[_0xd46e('0x28')]);if(_0x4b8f6a[_0xd46e('0x29')]){delete _0x4b8f6a[_0xd46e('0x29')];}_0x314570[_0xd46e('0x1a')](_0x5424e5)[_0xd46e('0x2a')](_0x4b8f6a);};}exports[_0xd46e('0x2b')]=function(_0x4dab6a,_0x45d789){var _0x3c301a={},_0xddbce9={},_0x17db79={'count':0x0,'rows':[]};var _0x96f15c=_[_0xd46e('0x2c')](db['UserProfileResource'][_0xd46e('0x2d')],function(_0x3a1ced){return{'name':_0x3a1ced[_0xd46e('0x2e')],'type':_0x3a1ced[_0xd46e('0x2f')][_0xd46e('0x30')]};});_0xddbce9[_0xd46e('0x31')]=_[_0xd46e('0x2c')](_0x96f15c,_0xd46e('0x29'));_0xddbce9[_0xd46e('0x32')]=_[_0xd46e('0x33')](_0x4dab6a[_0xd46e('0x32')]);_0xddbce9[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0xddbce9['model'],_0xddbce9[_0xd46e('0x32')]);_0x3c301a[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0xddbce9[_0xd46e('0x31')],qs['fields'](_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x37')]));_0x3c301a['attributes']=_0x3c301a[_0xd46e('0x36')][_0xd46e('0x38')]?_0x3c301a['attributes']:_0xddbce9[_0xd46e('0x31')];if(!_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x39')]('nolimit')){_0x3c301a['limit']=qs[_0xd46e('0x3a')](_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x3a')]);_0x3c301a[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x1d')]);}_0x3c301a[_0xd46e('0x3b')]=qs['sort'](_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x3c')]);_0x3c301a[_0xd46e('0x3d')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3e')](_0x4dab6a[_0xd46e('0x32')],_0xddbce9[_0xd46e('0x34')]),_0x96f15c);if(_0x4dab6a['query'][_0xd46e('0x3f')]){_0x3c301a[_0xd46e('0x3d')]=_['merge'](_0x3c301a[_0xd46e('0x3d')],{'$or':_[_0xd46e('0x2c')](_0x96f15c,function(_0x12ccf8){if(_0x12ccf8[_0xd46e('0x2f')]!=='VIRTUAL'){var _0x3ab607={};_0x3ab607[_0x12ccf8[_0xd46e('0x29')]]={'$like':'%'+_0x4dab6a[_0xd46e('0x32')][_0xd46e('0x3f')]+'%'};return _0x3ab607;}})});}_0x3c301a=_[_0xd46e('0x40')]({},_0x3c301a,_0x4dab6a[_0xd46e('0x41')]);var _0x220c57={'where':_0x3c301a[_0xd46e('0x3d')]};return db['UserProfileResource'][_0xd46e('0x1c')](_0x220c57)[_0xd46e('0x24')](function(_0xc83ea1){_0x17db79[_0xd46e('0x1c')]=_0xc83ea1;if(_0x4dab6a[_0xd46e('0x32')]['includeAll']){_0x3c301a[_0xd46e('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x3c301a);})['then'](function(_0x55098d){_0x17db79[_0xd46e('0x43')]=_0x55098d;return _0x17db79;})['then'](respondWithFilteredResult(_0x45d789,_0x3c301a))[_0xd46e('0x44')](handleError(_0x45d789,null));};exports[_0xd46e('0x45')]=function(_0x57f803,_0x462477){var _0x4114e6={'raw':![],'where':{'id':_0x57f803[_0xd46e('0x46')]['id']}},_0x3bd5e9={};_0x3bd5e9[_0xd46e('0x31')]=_[_0xd46e('0x33')](db[_0xd46e('0x47')][_0xd46e('0x2d')]);_0x3bd5e9[_0xd46e('0x32')]=_[_0xd46e('0x33')](_0x57f803[_0xd46e('0x32')]);_0x3bd5e9['filters']=_['intersection'](_0x3bd5e9['model'],_0x3bd5e9[_0xd46e('0x32')]);_0x4114e6['attributes']=_[_0xd46e('0x35')](_0x3bd5e9[_0xd46e('0x31')],qs[_0xd46e('0x37')](_0x57f803[_0xd46e('0x32')][_0xd46e('0x37')]));_0x4114e6[_0xd46e('0x36')]=_0x4114e6[_0xd46e('0x36')][_0xd46e('0x38')]?_0x4114e6['attributes']:_0x3bd5e9[_0xd46e('0x31')];if(_0x57f803['query'][_0xd46e('0x48')]){_0x4114e6[_0xd46e('0x42')]=[{'all':!![]}];}_0x4114e6=_[_0xd46e('0x40')]({},_0x4114e6,_0x57f803[_0xd46e('0x41')]);return db[_0xd46e('0x47')]['find'](_0x4114e6)[_0xd46e('0x24')](handleEntityNotFound(_0x462477,null))[_0xd46e('0x24')](respondWithResult(_0x462477,null))[_0xd46e('0x44')](handleError(_0x462477,null));};exports[_0xd46e('0x49')]=function(_0x2f1278,_0x587784){return db[_0xd46e('0x47')][_0xd46e('0x49')](_0x2f1278[_0xd46e('0x4a')],{})[_0xd46e('0x24')](respondWithResult(_0x587784,0xc9))[_0xd46e('0x44')](handleError(_0x587784,null));};exports['update']=function(_0x341d9f,_0x3ea9e6){if(_0x341d9f[_0xd46e('0x4a')]['id']){delete _0x341d9f[_0xd46e('0x4a')]['id'];}return db[_0xd46e('0x47')][_0xd46e('0x4b')]({'where':{'id':_0x341d9f[_0xd46e('0x46')]['id']}})[_0xd46e('0x24')](handleEntityNotFound(_0x3ea9e6,null))['then'](saveUpdates(_0x341d9f[_0xd46e('0x4a')],null))[_0xd46e('0x24')](respondWithResult(_0x3ea9e6,null))[_0xd46e('0x44')](handleError(_0x3ea9e6,null));};exports[_0xd46e('0x25')]=function(_0x1f1941,_0x4e84c8){return db['UserProfileResource'][_0xd46e('0x4b')]({'where':{'id':_0x1f1941[_0xd46e('0x46')]['id']}})[_0xd46e('0x24')](handleEntityNotFound(_0x4e84c8,null))['then'](removeEntity(_0x4e84c8,null))['catch'](handleError(_0x4e84c8,null));};exports[_0xd46e('0x4c')]=function(_0x9d8638,_0x52354f){return db[_0xd46e('0x47')][_0xd46e('0x4c')]()[_0xd46e('0x24')](respondWithResult(_0x52354f,null))[_0xd46e('0x44')](handleError(_0x52354f,null));};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js
index 8d5be88..383e08e 100644
--- a/server/api/userProfileResource/userProfileResource.model.js
+++ b/server/api/userProfileResource/userProfileResource.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe605=['exports','define','user_profile_has_resources','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x404c35,_0xedfe89){var _0x28c900=function(_0x2dc0ab){while(--_0x2dc0ab){_0x404c35['push'](_0x404c35['shift']());}};_0x28c900(++_0xedfe89);}(_0xe605,0x92));var _0x5e60=function(_0x3cea53,_0x10ef54){_0x3cea53=_0x3cea53-0x0;var _0x3aba53=_0xe605[_0x3cea53];return _0x3aba53;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var logger=require('../../config/logger')(_0x5e60('0x2'));var moment=require(_0x5e60('0x3'));var BPromise=require(_0x5e60('0x4'));var rp=require(_0x5e60('0x5'));var fs=require('fs');var path=require(_0x5e60('0x6'));var rimraf=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var attributes=require(_0x5e60('0x9'));module[_0x5e60('0xa')]=function(_0xc41535,_0x1d4a08){return _0xc41535[_0x5e60('0xb')]('UserProfileResource',attributes,{'tableName':_0x5e60('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['define','UserProfileResource','resourceId','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x4d354a,_0x349890){var _0x3e4fe7=function(_0x1a7113){while(--_0x1a7113){_0x4d354a['push'](_0x4d354a['shift']());}};_0x3e4fe7(++_0x349890);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x0a9e('0xb'),'sectionId']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js
index 632f693..00c3aa0 100644
--- a/server/api/userProfileResource/userProfileResource.rpc.js
+++ b/server/api/userProfileResource/userProfileResource.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd014=['../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','../../config/logger'];(function(_0xe56865,_0x125547){var _0x3376ae=function(_0x50df30){while(--_0x50df30){_0xe56865['push'](_0xe56865['shift']());}};_0x3376ae(++_0x125547);}(_0xd014,0x188));var _0x4d01=function(_0x154389,_0x15397f){_0x154389=_0x154389-0x0;var _0x16dd13=_0xd014[_0x154389];return _0x16dd13;};'use strict';var _=require(_0x4d01('0x0'));var util=require(_0x4d01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4d01('0x3'))('rpc');var config=require(_0x4d01('0x4'));var jayson=require(_0x4d01('0x5'));var client=jayson[_0x4d01('0x6')][_0x4d01('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f93df,_0x5c4320,_0x363b35){return new BPromise(function(_0x1ea857,_0x18d670){return client['request'](_0x4f93df,_0x363b35)[_0x4d01('0x8')](function(_0x4672a1){logger[_0x4d01('0x9')](_0x4d01('0xa'),_0x5c4320,_0x4d01('0xb'));logger[_0x4d01('0xc')](_0x4d01('0xd'),_0x5c4320,_0x4d01('0xb'),JSON[_0x4d01('0xe')](_0x4672a1));if(_0x4672a1[_0x4d01('0xf')]){if(_0x4672a1['error']['code']===0x1f4){logger['error'](_0x4d01('0xa'),_0x5c4320,_0x4672a1['error'][_0x4d01('0x10')]);return _0x18d670(_0x4672a1[_0x4d01('0xf')]['message']);}logger[_0x4d01('0xf')](_0x4d01('0xa'),_0x5c4320,_0x4672a1[_0x4d01('0xf')][_0x4d01('0x10')]);return _0x1ea857(_0x4672a1[_0x4d01('0xf')][_0x4d01('0x10')]);}else{logger[_0x4d01('0x9')](_0x4d01('0xa'),_0x5c4320,'request\x20sent');_0x1ea857(_0x4672a1['result'][_0x4d01('0x10')]);}})[_0x4d01('0x11')](function(_0x2e61c7){logger[_0x4d01('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x5c4320,_0x2e61c7);_0x18d670(_0x2e61c7);});});}
\ No newline at end of file
+var _0xcb26=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb26,0x133));var _0x6cb2=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xcb26[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x6cb2('0x0'));var util=require(_0x6cb2('0x1'));var moment=require(_0x6cb2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cb2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6cb2('0x4'));var logger=require(_0x6cb2('0x5'))(_0x6cb2('0x6'));var config=require(_0x6cb2('0x7'));var jayson=require(_0x6cb2('0x8'));var client=jayson[_0x6cb2('0x9')][_0x6cb2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xddf01,_0x5d2eb5,_0x2244d8){return new BPromise(function(_0x9748db,_0x4b484d){return client['request'](_0xddf01,_0x2244d8)[_0x6cb2('0xb')](function(_0x165d4d){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x5d2eb5,_0x6cb2('0xc'));logger['debug'](_0x6cb2('0xd'),_0x5d2eb5,'request\x20sent',JSON[_0x6cb2('0xe')](_0x165d4d));if(_0x165d4d['error']){if(_0x165d4d[_0x6cb2('0xf')][_0x6cb2('0x10')]===0x1f4){logger['error'](_0x6cb2('0x11'),_0x5d2eb5,_0x165d4d[_0x6cb2('0xf')][_0x6cb2('0x12')]);return _0x4b484d(_0x165d4d[_0x6cb2('0xf')][_0x6cb2('0x12')]);}logger['error'](_0x6cb2('0x11'),_0x5d2eb5,_0x165d4d[_0x6cb2('0xf')][_0x6cb2('0x12')]);return _0x9748db(_0x165d4d[_0x6cb2('0xf')]['message']);}else{logger[_0x6cb2('0x13')](_0x6cb2('0x11'),_0x5d2eb5,_0x6cb2('0xc'));_0x9748db(_0x165d4d[_0x6cb2('0x14')][_0x6cb2('0x12')]);}})[_0x6cb2('0x15')](function(_0x58e168){logger['error'](_0x6cb2('0x11'),_0x5d2eb5,_0x58e168);_0x4b484d(_0x58e168);});});}
\ No newline at end of file
diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js
index f7f93cc..bdd5a06 100644
--- a/server/api/userProfileSection/index.js
+++ b/server/api/userProfileSection/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf864=['connect-timeout','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','exports','multer','path'];(function(_0x14a5af,_0x59c3c0){var _0x52c808=function(_0x500b91){while(--_0x500b91){_0x14a5af['push'](_0x14a5af['shift']());}};_0x52c808(++_0x59c3c0);}(_0xf864,0x11f));var _0x4f86=function(_0x1808e2,_0x1b308d){_0x1808e2=_0x1808e2-0x0;var _0x2d9c4f=_0xf864[_0x1808e2];return _0x2d9c4f;};'use strict';var multer=require(_0x4f86('0x0'));var util=require('util');var path=require(_0x4f86('0x1'));var timeout=require(_0x4f86('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4f86('0x3'));var config=require(_0x4f86('0x4'));var controller=require(_0x4f86('0x5'));router[_0x4f86('0x6')]('/',auth[_0x4f86('0x7')](),controller[_0x4f86('0x8')]);router[_0x4f86('0x6')](_0x4f86('0x9'),auth[_0x4f86('0x7')](),controller['describe']);router[_0x4f86('0x6')]('/:id',auth[_0x4f86('0x7')](),controller[_0x4f86('0xa')]);router[_0x4f86('0xb')]('/',auth[_0x4f86('0x7')](),controller[_0x4f86('0xc')]);router[_0x4f86('0xd')](_0x4f86('0xe'),auth[_0x4f86('0x7')](),controller[_0x4f86('0xf')]);router['delete'](_0x4f86('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4f86('0x10')]=router;
\ No newline at end of file
+var _0x0853=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x215c32,_0xf641a4){var _0x59660b=function(_0x52c6bf){while(--_0x52c6bf){_0x215c32['push'](_0x215c32['shift']());}};_0x59660b(++_0xf641a4);}(_0x0853,0x101));var _0x3085=function(_0x163132,_0x24620e){_0x163132=_0x163132-0x0;var _0x2653d2=_0x0853[_0x163132];return _0x2653d2;};'use strict';var multer=require(_0x3085('0x0'));var util=require(_0x3085('0x1'));var path=require(_0x3085('0x2'));var timeout=require(_0x3085('0x3'));var express=require(_0x3085('0x4'));var router=express[_0x3085('0x5')]();var auth=require(_0x3085('0x6'));var interaction=require(_0x3085('0x7'));var config=require(_0x3085('0x8'));var controller=require(_0x3085('0x9'));router[_0x3085('0xa')]('/',auth[_0x3085('0xb')](),controller['index']);router[_0x3085('0xa')](_0x3085('0xc'),auth[_0x3085('0xb')](),controller['describe']);router[_0x3085('0xa')](_0x3085('0xd'),auth[_0x3085('0xb')](),controller[_0x3085('0xe')]);router[_0x3085('0xf')]('/',auth[_0x3085('0xb')](),controller[_0x3085('0x10')]);router['put'](_0x3085('0xd'),auth['isAuthenticated'](),controller[_0x3085('0x11')]);router[_0x3085('0x12')](_0x3085('0xd'),auth[_0x3085('0xb')](),controller[_0x3085('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js
index 9a7966c..111827d 100644
--- a/server/api/userProfileSection/userProfileSection.attributes.js
+++ b/server/api/userProfileSection/userProfileSection.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x97ed=['exports','INTEGER','BOOLEAN','STRING','setDataValue','crudPermissions','getDataValue','sequelize'];(function(_0x3adf4e,_0x26d25f){var _0x4dc28b=function(_0x38d031){while(--_0x38d031){_0x3adf4e['push'](_0x3adf4e['shift']());}};_0x4dc28b(++_0x26d25f);}(_0x97ed,0x1e7));var _0xd97e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x97ed[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xd97e('0x0'));module[_0xd97e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd97e('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd97e('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd97e('0x4')],'set':function(_0x27b80c){this[_0xd97e('0x5')](_0xd97e('0x6'),_0x27b80c?_0x27b80c['join'](''):[]);},'get':function(){return this[_0xd97e('0x7')](_0xd97e('0x6'))?this['getDataValue'](_0xd97e('0x6'))['split'](''):[];}}};
\ No newline at end of file
+var _0x6824=['sequelize','exports','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions','split'];(function(_0x1cb29e,_0x57023e){var _0x421381=function(_0xae0ce0){while(--_0xae0ce0){_0x1cb29e['push'](_0x1cb29e['shift']());}};_0x421381(++_0x57023e);}(_0x6824,0x80));var _0x4682=function(_0x732a9f,_0x3479cf){_0x732a9f=_0x732a9f-0x0;var _0x99e9e7=_0x6824[_0x732a9f];return _0x99e9e7;};'use strict';var Sequelize=require(_0x4682('0x0'));module[_0x4682('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4682('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4682('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x43ff56){this[_0x4682('0x4')]('crudPermissions',_0x43ff56?_0x43ff56['join'](''):[]);},'get':function(){return this[_0x4682('0x5')](_0x4682('0x6'))?this[_0x4682('0x5')]('crudPermissions')[_0x4682('0x7')](''):[];}}};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js
index b10535c..0586f2a 100644
--- a/server/api/userProfileSection/userProfileSection.controller.js
+++ b/server/api/userProfileSection/userProfileSection.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab05=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','catch','params','keys','find','create','update','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x28b088,_0xddb75e){var _0x4b329e=function(_0x1944bb){while(--_0x1944bb){_0x28b088['push'](_0x28b088['shift']());}};_0x4b329e(++_0xddb75e);}(_0xab05,0x1b6));var _0x5ab0=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xab05[_0x4e9628];return _0x27bc8c;};'use strict';var pdf=require(_0x5ab0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5ab0('0x1'));var zipdir=require(_0x5ab0('0x2'));var jsonpatch=require(_0x5ab0('0x3'));var rp=require(_0x5ab0('0x4'));var moment=require(_0x5ab0('0x5'));var BPromise=require(_0x5ab0('0x6'));var Mustache=require(_0x5ab0('0x7'));var util=require(_0x5ab0('0x8'));var path=require(_0x5ab0('0x9'));var sox=require(_0x5ab0('0xa'));var csv=require(_0x5ab0('0xb'));var ejs=require(_0x5ab0('0xc'));var fs=require('fs');var _=require(_0x5ab0('0xd'));var squel=require(_0x5ab0('0xe'));var crypto=require(_0x5ab0('0xf'));var jsforce=require(_0x5ab0('0x10'));var deskjs=require(_0x5ab0('0x11'));var toCsv=require(_0x5ab0('0xb'));var querystring=require(_0x5ab0('0x12'));var Papa=require(_0x5ab0('0x13'));var Redis=require('ioredis');var authService=require(_0x5ab0('0x14'));var qs=require(_0x5ab0('0x15'));var as=require(_0x5ab0('0x16'));var hardwareService=require(_0x5ab0('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5ab0('0x18'))['db'];function respondWithStatusCode(_0x29886e,_0x202815){_0x202815=_0x202815||0xcc;return function(_0x3e2817){if(_0x3e2817){return _0x29886e[_0x5ab0('0x19')](_0x202815);}return _0x29886e[_0x5ab0('0x1a')](_0x202815)[_0x5ab0('0x1b')]();};}function respondWithResult(_0x4c80c9,_0x58f239){_0x58f239=_0x58f239||0xc8;return function(_0x2378f8){if(_0x2378f8){return _0x4c80c9['status'](_0x58f239)[_0x5ab0('0x1c')](_0x2378f8);}};}function respondWithFilteredResult(_0x3a210c,_0x55b0b5){return function(_0x42e500){if(_0x42e500){var _0x2a382d=_0x42e500[_0x5ab0('0x1d')],_0x475b82=_0x55b0b5['offset'],_0x54a1fc=_0x55b0b5['offset']+_0x55b0b5['limit'],_0xbc3efa;if(_0x54a1fc>=_0x2a382d){_0x54a1fc=_0x2a382d;_0xbc3efa=0xc8;}else{_0xbc3efa=0xce;}_0x3a210c[_0x5ab0('0x1a')](_0xbc3efa);return _0x3a210c[_0x5ab0('0x1e')](_0x5ab0('0x1f'),_0x475b82+'-'+_0x54a1fc+'/'+_0x2a382d)[_0x5ab0('0x1c')](_0x42e500);}return null;};}function patchUpdates(_0xdc2607){return function(_0x23d784){try{jsonpatch['apply'](_0x23d784,_0xdc2607,!![]);}catch(_0x4795ec){return BPromise[_0x5ab0('0x20')](_0x4795ec);}return _0x23d784['save']();};}function saveUpdates(_0x41b971,_0x2b3e67){return function(_0x350682){if(_0x350682){return _0x350682['update'](_0x41b971)[_0x5ab0('0x21')](function(_0x4a583a){return _0x4a583a;});}return null;};}function removeEntity(_0x3fce1b,_0x3d3762){return function(_0x7ae3fa){if(_0x7ae3fa){return _0x7ae3fa[_0x5ab0('0x22')]()[_0x5ab0('0x21')](function(){_0x3fce1b[_0x5ab0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f4cf6,_0x549841){return function(_0x48ef57){if(!_0x48ef57){_0x2f4cf6[_0x5ab0('0x19')](0x194);}return _0x48ef57;};}function handleError(_0x4081e1,_0x4a473a){_0x4a473a=_0x4a473a||0x1f4;return function(_0x3628a6){logger[_0x5ab0('0x23')](_0x3628a6[_0x5ab0('0x24')]);if(_0x3628a6[_0x5ab0('0x25')]){delete _0x3628a6[_0x5ab0('0x25')];}_0x4081e1[_0x5ab0('0x1a')](_0x4a473a)[_0x5ab0('0x26')](_0x3628a6);};}exports[_0x5ab0('0x27')]=function(_0x5e0b03,_0x29b146){var _0x458c9b={},_0x291e82={},_0x94fa1={'count':0x0,'rows':[]};var _0x39d000=_[_0x5ab0('0x28')](db['UserProfileSection'][_0x5ab0('0x29')],function(_0x4985be){return{'name':_0x4985be[_0x5ab0('0x2a')],'type':_0x4985be[_0x5ab0('0x2b')][_0x5ab0('0x2c')]};});_0x291e82[_0x5ab0('0x2d')]=_[_0x5ab0('0x28')](_0x39d000,_0x5ab0('0x25'));_0x291e82[_0x5ab0('0x2e')]=_['keys'](_0x5e0b03[_0x5ab0('0x2e')]);_0x291e82[_0x5ab0('0x2f')]=_[_0x5ab0('0x30')](_0x291e82[_0x5ab0('0x2d')],_0x291e82['query']);_0x458c9b[_0x5ab0('0x31')]=_[_0x5ab0('0x30')](_0x291e82['model'],qs['fields'](_0x5e0b03[_0x5ab0('0x2e')][_0x5ab0('0x32')]));_0x458c9b[_0x5ab0('0x31')]=_0x458c9b['attributes'][_0x5ab0('0x33')]?_0x458c9b[_0x5ab0('0x31')]:_0x291e82['model'];if(!_0x5e0b03[_0x5ab0('0x2e')][_0x5ab0('0x34')](_0x5ab0('0x35'))){_0x458c9b[_0x5ab0('0x36')]=qs[_0x5ab0('0x36')](_0x5e0b03[_0x5ab0('0x2e')][_0x5ab0('0x36')]);_0x458c9b['offset']=qs[_0x5ab0('0x37')](_0x5e0b03[_0x5ab0('0x2e')][_0x5ab0('0x37')]);}_0x458c9b[_0x5ab0('0x38')]=qs[_0x5ab0('0x39')](_0x5e0b03['query'][_0x5ab0('0x39')]);_0x458c9b['where']=qs[_0x5ab0('0x2f')](_[_0x5ab0('0x3a')](_0x5e0b03[_0x5ab0('0x2e')],_0x291e82[_0x5ab0('0x2f')]),_0x39d000);if(_0x5e0b03[_0x5ab0('0x2e')][_0x5ab0('0x3b')]){_0x458c9b[_0x5ab0('0x3c')]=_[_0x5ab0('0x3d')](_0x458c9b[_0x5ab0('0x3c')],{'$or':_[_0x5ab0('0x28')](_0x39d000,function(_0x2426f1){if(_0x2426f1['type']!==_0x5ab0('0x3e')){var _0x130f93={};_0x130f93[_0x2426f1[_0x5ab0('0x25')]]={'$like':'%'+_0x5e0b03[_0x5ab0('0x2e')][_0x5ab0('0x3b')]+'%'};return _0x130f93;}})});}_0x458c9b=_[_0x5ab0('0x3d')]({},_0x458c9b,_0x5e0b03[_0x5ab0('0x3f')]);var _0x53d218={'where':_0x458c9b[_0x5ab0('0x3c')]};return db[_0x5ab0('0x40')][_0x5ab0('0x1d')](_0x53d218)[_0x5ab0('0x21')](function(_0x5372d5){_0x94fa1[_0x5ab0('0x1d')]=_0x5372d5;if(_0x5e0b03[_0x5ab0('0x2e')][_0x5ab0('0x41')]){_0x458c9b[_0x5ab0('0x42')]=[{'all':!![]}];}return db['UserProfileSection'][_0x5ab0('0x43')](_0x458c9b);})['then'](function(_0x4e8b2a){_0x94fa1['rows']=_0x4e8b2a;return _0x94fa1;})[_0x5ab0('0x21')](respondWithFilteredResult(_0x29b146,_0x458c9b))[_0x5ab0('0x44')](handleError(_0x29b146,null));};exports['show']=function(_0x306e86,_0xeb9624){var _0x17e115={'raw':![],'where':{'id':_0x306e86[_0x5ab0('0x45')]['id']}},_0x2e54c4={};_0x2e54c4[_0x5ab0('0x2d')]=_[_0x5ab0('0x46')](db[_0x5ab0('0x40')][_0x5ab0('0x29')]);_0x2e54c4[_0x5ab0('0x2e')]=_[_0x5ab0('0x46')](_0x306e86[_0x5ab0('0x2e')]);_0x2e54c4[_0x5ab0('0x2f')]=_[_0x5ab0('0x30')](_0x2e54c4[_0x5ab0('0x2d')],_0x2e54c4['query']);_0x17e115[_0x5ab0('0x31')]=_[_0x5ab0('0x30')](_0x2e54c4[_0x5ab0('0x2d')],qs[_0x5ab0('0x32')](_0x306e86[_0x5ab0('0x2e')][_0x5ab0('0x32')]));_0x17e115[_0x5ab0('0x31')]=_0x17e115[_0x5ab0('0x31')]['length']?_0x17e115[_0x5ab0('0x31')]:_0x2e54c4[_0x5ab0('0x2d')];if(_0x306e86[_0x5ab0('0x2e')]['includeAll']){_0x17e115[_0x5ab0('0x42')]=[{'all':!![]}];}_0x17e115=_['merge']({},_0x17e115,_0x306e86[_0x5ab0('0x3f')]);return db[_0x5ab0('0x40')][_0x5ab0('0x47')](_0x17e115)[_0x5ab0('0x21')](handleEntityNotFound(_0xeb9624,null))['then'](respondWithResult(_0xeb9624,null))[_0x5ab0('0x44')](handleError(_0xeb9624,null));};exports['create']=function(_0x27add1,_0x3c5de2){return db[_0x5ab0('0x40')][_0x5ab0('0x48')](_0x27add1['body'],{})['then'](respondWithResult(_0x3c5de2,0xc9))[_0x5ab0('0x44')](handleError(_0x3c5de2,null));};exports[_0x5ab0('0x49')]=function(_0xa617ca,_0x2dd043){if(_0xa617ca[_0x5ab0('0x4a')]['id']){delete _0xa617ca[_0x5ab0('0x4a')]['id'];}return db[_0x5ab0('0x40')][_0x5ab0('0x47')]({'where':{'id':_0xa617ca[_0x5ab0('0x45')]['id']}})[_0x5ab0('0x21')](handleEntityNotFound(_0x2dd043,null))['then'](saveUpdates(_0xa617ca['body'],null))['then'](respondWithResult(_0x2dd043,null))[_0x5ab0('0x44')](handleError(_0x2dd043,null));};exports[_0x5ab0('0x22')]=function(_0x1dc63d,_0x3771b6){return db[_0x5ab0('0x40')][_0x5ab0('0x47')]({'where':{'id':_0x1dc63d['params']['id']}})[_0x5ab0('0x21')](handleEntityNotFound(_0x3771b6,null))['then'](removeEntity(_0x3771b6,null))[_0x5ab0('0x44')](handleError(_0x3771b6,null));};exports[_0x5ab0('0x4b')]=function(_0xf6bdc3,_0x57cc7d){return db[_0x5ab0('0x40')][_0x5ab0('0x4b')]()[_0x5ab0('0x21')](respondWithResult(_0x57cc7d,null))[_0x5ab0('0x44')](handleError(_0x57cc7d,null));};
\ No newline at end of file
+var _0x6c98=['../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','UserProfileSection','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x4d12c6,_0x1b5acc){var _0x2a8ee6=function(_0x3cdf5f){while(--_0x3cdf5f){_0x4d12c6['push'](_0x4d12c6['shift']());}};_0x2a8ee6(++_0x1b5acc);}(_0x6c98,0x1dc));var _0x86c9=function(_0x5737b7,_0x5b4a68){_0x5737b7=_0x5737b7-0x0;var _0x41bd6e=_0x6c98[_0x5737b7];return _0x41bd6e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x86c9('0x0'));var rimraf=require(_0x86c9('0x1'));var zipdir=require(_0x86c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86c9('0x3'));var moment=require(_0x86c9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x86c9('0x5'));var util=require(_0x86c9('0x6'));var path=require(_0x86c9('0x7'));var sox=require(_0x86c9('0x8'));var csv=require(_0x86c9('0x9'));var ejs=require(_0x86c9('0xa'));var fs=require('fs');var _=require(_0x86c9('0xb'));var squel=require(_0x86c9('0xc'));var crypto=require(_0x86c9('0xd'));var jsforce=require(_0x86c9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x86c9('0x9'));var querystring=require(_0x86c9('0xf'));var Papa=require(_0x86c9('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86c9('0x11'));var as=require(_0x86c9('0x12'));var hardwareService=require(_0x86c9('0x13'));var logger=require('../../config/logger')(_0x86c9('0x14'));var utils=require(_0x86c9('0x15'));var config=require(_0x86c9('0x16'));var db=require(_0x86c9('0x17'))['db'];function respondWithStatusCode(_0x350c0,_0xdab6ff){_0xdab6ff=_0xdab6ff||0xcc;return function(_0x263cbb){if(_0x263cbb){return _0x350c0['sendStatus'](_0xdab6ff);}return _0x350c0[_0x86c9('0x18')](_0xdab6ff)['end']();};}function respondWithResult(_0x1deeb5,_0x3c9e7c){_0x3c9e7c=_0x3c9e7c||0xc8;return function(_0x2dbc9e){if(_0x2dbc9e){return _0x1deeb5[_0x86c9('0x18')](_0x3c9e7c)[_0x86c9('0x19')](_0x2dbc9e);}};}function respondWithFilteredResult(_0xdf01ac,_0x54d772){return function(_0x178a8e){if(_0x178a8e){var _0x901d0=_0x178a8e[_0x86c9('0x1a')],_0x31f906=_0x54d772[_0x86c9('0x1b')],_0x4dfb99=_0x54d772['offset']+_0x54d772[_0x86c9('0x1c')],_0x55a2cb;if(_0x4dfb99>=_0x901d0){_0x4dfb99=_0x901d0;_0x55a2cb=0xc8;}else{_0x55a2cb=0xce;}_0xdf01ac[_0x86c9('0x18')](_0x55a2cb);return _0xdf01ac[_0x86c9('0x1d')](_0x86c9('0x1e'),_0x31f906+'-'+_0x4dfb99+'/'+_0x901d0)[_0x86c9('0x19')](_0x178a8e);}return null;};}function patchUpdates(_0x12286d){return function(_0x3a9806){try{jsonpatch[_0x86c9('0x1f')](_0x3a9806,_0x12286d,!![]);}catch(_0x23c1da){return BPromise[_0x86c9('0x20')](_0x23c1da);}return _0x3a9806['save']();};}function saveUpdates(_0x2c502b,_0x5c345a){return function(_0xb5525b){if(_0xb5525b){return _0xb5525b[_0x86c9('0x21')](_0x2c502b)[_0x86c9('0x22')](function(_0xf672d8){return _0xf672d8;});}return null;};}function removeEntity(_0xe5ea81,_0x5e723f){return function(_0x4e01b7){if(_0x4e01b7){return _0x4e01b7[_0x86c9('0x23')]()[_0x86c9('0x22')](function(){_0xe5ea81[_0x86c9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10efb8,_0xaf0386){return function(_0x5b6453){if(!_0x5b6453){_0x10efb8['sendStatus'](0x194);}return _0x5b6453;};}function handleError(_0x2bfa28,_0x1123f2){_0x1123f2=_0x1123f2||0x1f4;return function(_0x463884){logger[_0x86c9('0x24')](_0x463884[_0x86c9('0x25')]);if(_0x463884[_0x86c9('0x26')]){delete _0x463884[_0x86c9('0x26')];}_0x2bfa28['status'](_0x1123f2)['send'](_0x463884);};}exports[_0x86c9('0x27')]=function(_0x90900c,_0x375ec6){var _0x5b6ecb={},_0x945c26={},_0x28ad83={'count':0x0,'rows':[]};var _0x2fac7a=_[_0x86c9('0x28')](db[_0x86c9('0x29')][_0x86c9('0x2a')],function(_0xba6cd0){return{'name':_0xba6cd0['fieldName'],'type':_0xba6cd0[_0x86c9('0x2b')]['key']};});_0x945c26[_0x86c9('0x2c')]=_[_0x86c9('0x28')](_0x2fac7a,_0x86c9('0x26'));_0x945c26[_0x86c9('0x2d')]=_[_0x86c9('0x2e')](_0x90900c[_0x86c9('0x2d')]);_0x945c26[_0x86c9('0x2f')]=_['intersection'](_0x945c26[_0x86c9('0x2c')],_0x945c26[_0x86c9('0x2d')]);_0x5b6ecb[_0x86c9('0x30')]=_[_0x86c9('0x31')](_0x945c26[_0x86c9('0x2c')],qs[_0x86c9('0x32')](_0x90900c[_0x86c9('0x2d')][_0x86c9('0x32')]));_0x5b6ecb['attributes']=_0x5b6ecb[_0x86c9('0x30')][_0x86c9('0x33')]?_0x5b6ecb[_0x86c9('0x30')]:_0x945c26[_0x86c9('0x2c')];if(!_0x90900c[_0x86c9('0x2d')][_0x86c9('0x34')](_0x86c9('0x35'))){_0x5b6ecb[_0x86c9('0x1c')]=qs[_0x86c9('0x1c')](_0x90900c['query'][_0x86c9('0x1c')]);_0x5b6ecb[_0x86c9('0x1b')]=qs[_0x86c9('0x1b')](_0x90900c[_0x86c9('0x2d')][_0x86c9('0x1b')]);}_0x5b6ecb[_0x86c9('0x36')]=qs['sort'](_0x90900c[_0x86c9('0x2d')]['sort']);_0x5b6ecb[_0x86c9('0x37')]=qs[_0x86c9('0x2f')](_[_0x86c9('0x38')](_0x90900c['query'],_0x945c26['filters']),_0x2fac7a);if(_0x90900c['query'][_0x86c9('0x39')]){_0x5b6ecb['where']=_[_0x86c9('0x3a')](_0x5b6ecb['where'],{'$or':_[_0x86c9('0x28')](_0x2fac7a,function(_0x5e6783){if(_0x5e6783['type']!==_0x86c9('0x3b')){var _0x5de971={};_0x5de971[_0x5e6783[_0x86c9('0x26')]]={'$like':'%'+_0x90900c[_0x86c9('0x2d')][_0x86c9('0x39')]+'%'};return _0x5de971;}})});}_0x5b6ecb=_[_0x86c9('0x3a')]({},_0x5b6ecb,_0x90900c['options']);var _0xd42078={'where':_0x5b6ecb['where']};return db[_0x86c9('0x29')][_0x86c9('0x1a')](_0xd42078)[_0x86c9('0x22')](function(_0x27d619){_0x28ad83[_0x86c9('0x1a')]=_0x27d619;if(_0x90900c[_0x86c9('0x2d')][_0x86c9('0x3c')]){_0x5b6ecb[_0x86c9('0x3d')]=[{'all':!![]}];}return db['UserProfileSection'][_0x86c9('0x3e')](_0x5b6ecb);})[_0x86c9('0x22')](function(_0x57d8c){_0x28ad83[_0x86c9('0x3f')]=_0x57d8c;return _0x28ad83;})[_0x86c9('0x22')](respondWithFilteredResult(_0x375ec6,_0x5b6ecb))[_0x86c9('0x40')](handleError(_0x375ec6,null));};exports[_0x86c9('0x41')]=function(_0x5936f4,_0x1152a8){var _0x4e0982={'raw':![],'where':{'id':_0x5936f4['params']['id']}},_0x4ee9bd={};_0x4ee9bd['model']=_['keys'](db['UserProfileSection'][_0x86c9('0x2a')]);_0x4ee9bd['query']=_[_0x86c9('0x2e')](_0x5936f4[_0x86c9('0x2d')]);_0x4ee9bd['filters']=_[_0x86c9('0x31')](_0x4ee9bd[_0x86c9('0x2c')],_0x4ee9bd[_0x86c9('0x2d')]);_0x4e0982[_0x86c9('0x30')]=_[_0x86c9('0x31')](_0x4ee9bd[_0x86c9('0x2c')],qs['fields'](_0x5936f4[_0x86c9('0x2d')][_0x86c9('0x32')]));_0x4e0982[_0x86c9('0x30')]=_0x4e0982['attributes'][_0x86c9('0x33')]?_0x4e0982[_0x86c9('0x30')]:_0x4ee9bd['model'];if(_0x5936f4[_0x86c9('0x2d')][_0x86c9('0x3c')]){_0x4e0982[_0x86c9('0x3d')]=[{'all':!![]}];}_0x4e0982=_['merge']({},_0x4e0982,_0x5936f4['options']);return db[_0x86c9('0x29')]['find'](_0x4e0982)[_0x86c9('0x22')](handleEntityNotFound(_0x1152a8,null))[_0x86c9('0x22')](respondWithResult(_0x1152a8,null))[_0x86c9('0x40')](handleError(_0x1152a8,null));};exports[_0x86c9('0x42')]=function(_0x4f1419,_0x1d649e){return db[_0x86c9('0x29')][_0x86c9('0x42')](_0x4f1419[_0x86c9('0x43')],{})[_0x86c9('0x22')](respondWithResult(_0x1d649e,0xc9))['catch'](handleError(_0x1d649e,null));};exports[_0x86c9('0x21')]=function(_0x591e46,_0x4d29ae){if(_0x591e46[_0x86c9('0x43')]['id']){delete _0x591e46[_0x86c9('0x43')]['id'];}return db['UserProfileSection'][_0x86c9('0x44')]({'where':{'id':_0x591e46['params']['id']}})[_0x86c9('0x22')](handleEntityNotFound(_0x4d29ae,null))['then'](saveUpdates(_0x591e46[_0x86c9('0x43')],null))[_0x86c9('0x22')](respondWithResult(_0x4d29ae,null))[_0x86c9('0x40')](handleError(_0x4d29ae,null));};exports[_0x86c9('0x23')]=function(_0x230d73,_0x3ea365){return db[_0x86c9('0x29')]['find']({'where':{'id':_0x230d73[_0x86c9('0x45')]['id']}})[_0x86c9('0x22')](handleEntityNotFound(_0x3ea365,null))[_0x86c9('0x22')](removeEntity(_0x3ea365,null))['catch'](handleError(_0x3ea365,null));};exports['describe']=function(_0xfc57ee,_0x53cb51){return db[_0x86c9('0x29')][_0x86c9('0x46')]()[_0x86c9('0x22')](respondWithResult(_0x53cb51,null))[_0x86c9('0x40')](handleError(_0x53cb51,null));};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js
index 7f70b10..7335633 100644
--- a/server/api/userProfileSection/userProfileSection.model.js
+++ b/server/api/userProfileSection/userProfileSection.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1da9=['moment','bluebird','request-promise','rimraf','../../config/environment','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x48912a,_0x3466bd){var _0x360c2c=function(_0x4759f9){while(--_0x4759f9){_0x48912a['push'](_0x48912a['shift']());}};_0x360c2c(++_0x3466bd);}(_0x1da9,0xea));var _0x91da=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1da9[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x91da('0x0'));var util=require(_0x91da('0x1'));var logger=require(_0x91da('0x2'))(_0x91da('0x3'));var moment=require(_0x91da('0x4'));var BPromise=require(_0x91da('0x5'));var rp=require(_0x91da('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91da('0x7'));var config=require(_0x91da('0x8'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x3fad9d,_0x1571c3){return _0x3fad9d['define'](_0x91da('0x9'),attributes,{'tableName':_0x91da('0xa'),'paranoid':![],'indexes':[{'name':_0x91da('0xb'),'fields':[_0x91da('0xc'),_0x91da('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x40ae=['bluebird','request-promise','path','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','moment'];(function(_0x1c8cff,_0x2e2180){var _0x35ff68=function(_0x4e5d55){while(--_0x4e5d55){_0x1c8cff['push'](_0x1c8cff['shift']());}};_0x35ff68(++_0x2e2180);}(_0x40ae,0x98));var _0xe40a=function(_0x5ca026,_0x23e2f9){_0x5ca026=_0x5ca026-0x0;var _0x4f7350=_0x40ae[_0x5ca026];return _0x4f7350;};'use strict';var _=require(_0xe40a('0x0'));var util=require(_0xe40a('0x1'));var logger=require(_0xe40a('0x2'))('api');var moment=require(_0xe40a('0x3'));var BPromise=require(_0xe40a('0x4'));var rp=require(_0xe40a('0x5'));var fs=require('fs');var path=require(_0xe40a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0xe40a('0x7')]=function(_0x31c56a,_0x4e27a5){return _0x31c56a[_0xe40a('0x8')](_0xe40a('0x9'),attributes,{'tableName':_0xe40a('0xa'),'paranoid':![],'indexes':[{'name':_0xe40a('0xb'),'fields':['sectionId',_0xe40a('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js
index f86efc0..658601d 100644
--- a/server/api/userProfileSection/userProfileSection.rpc.js
+++ b/server/api/userProfileSection/userProfileSection.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf078=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3d4a6b,_0x20dbcb){var _0x55d64a=function(_0x220a50){while(--_0x220a50){_0x3d4a6b['push'](_0x3d4a6b['shift']());}};_0x55d64a(++_0x20dbcb);}(_0xf078,0xda));var _0x8f07=function(_0x2fec29,_0x151f71){_0x2fec29=_0x2fec29-0x0;var _0x35c66a=_0xf078[_0x2fec29];return _0x35c66a;};'use strict';var _=require(_0x8f07('0x0'));var util=require('util');var moment=require(_0x8f07('0x1'));var BPromise=require(_0x8f07('0x2'));var rs=require(_0x8f07('0x3'));var fs=require('fs');var Redis=require(_0x8f07('0x4'));var db=require(_0x8f07('0x5'))['db'];var utils=require(_0x8f07('0x6'));var logger=require(_0x8f07('0x7'))(_0x8f07('0x8'));var config=require(_0x8f07('0x9'));var jayson=require(_0x8f07('0xa'));var client=jayson[_0x8f07('0xb')][_0x8f07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x322237,_0x484cc4,_0x2e367f){return new BPromise(function(_0x54d72f,_0x5835d3){return client[_0x8f07('0xd')](_0x322237,_0x2e367f)[_0x8f07('0xe')](function(_0x62c740){logger[_0x8f07('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x484cc4,_0x8f07('0x10'));logger[_0x8f07('0x11')](_0x8f07('0x12'),_0x484cc4,_0x8f07('0x10'),JSON[_0x8f07('0x13')](_0x62c740));if(_0x62c740[_0x8f07('0x14')]){if(_0x62c740[_0x8f07('0x14')][_0x8f07('0x15')]===0x1f4){logger[_0x8f07('0x14')](_0x8f07('0x16'),_0x484cc4,_0x62c740[_0x8f07('0x14')][_0x8f07('0x17')]);return _0x5835d3(_0x62c740['error']['message']);}logger['error'](_0x8f07('0x16'),_0x484cc4,_0x62c740[_0x8f07('0x14')][_0x8f07('0x17')]);return _0x54d72f(_0x62c740['error'][_0x8f07('0x17')]);}else{logger[_0x8f07('0xf')](_0x8f07('0x16'),_0x484cc4,'request\x20sent');_0x54d72f(_0x62c740[_0x8f07('0x18')][_0x8f07('0x17')]);}})[_0x8f07('0x19')](function(_0x145dc8){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x484cc4,_0x145dc8);_0x5835d3(_0x145dc8);});});}
\ No newline at end of file
+var _0x52d1=['http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x507965,_0x4944f4){var _0x3608fc=function(_0x14c8d0){while(--_0x14c8d0){_0x507965['push'](_0x507965['shift']());}};_0x3608fc(++_0x4944f4);}(_0x52d1,0xc5));var _0x152d=function(_0x3feb66,_0x2cf25a){_0x3feb66=_0x3feb66-0x0;var _0x18b77b=_0x52d1[_0x3feb66];return _0x18b77b;};'use strict';var _=require(_0x152d('0x0'));var util=require(_0x152d('0x1'));var moment=require(_0x152d('0x2'));var BPromise=require(_0x152d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x152d('0x4'));var db=require(_0x152d('0x5'))['db'];var utils=require(_0x152d('0x6'));var logger=require(_0x152d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x152d('0x8'));var client=jayson[_0x152d('0x9')][_0x152d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b7e43,_0x25f9fe,_0x1fca71){return new BPromise(function(_0xa46043,_0x3a36a3){return client['request'](_0x4b7e43,_0x1fca71)[_0x152d('0xb')](function(_0x5874dd){logger['info'](_0x152d('0xc'),_0x25f9fe,_0x152d('0xd'));logger[_0x152d('0xe')](_0x152d('0xf'),_0x25f9fe,_0x152d('0xd'),JSON[_0x152d('0x10')](_0x5874dd));if(_0x5874dd[_0x152d('0x11')]){if(_0x5874dd[_0x152d('0x11')][_0x152d('0x12')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x25f9fe,_0x5874dd[_0x152d('0x11')][_0x152d('0x13')]);return _0x3a36a3(_0x5874dd[_0x152d('0x11')][_0x152d('0x13')]);}logger[_0x152d('0x11')](_0x152d('0xc'),_0x25f9fe,_0x5874dd['error'][_0x152d('0x13')]);return _0xa46043(_0x5874dd[_0x152d('0x11')][_0x152d('0x13')]);}else{logger[_0x152d('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x25f9fe,_0x152d('0xd'));_0xa46043(_0x5874dd[_0x152d('0x15')]['message']);}})[_0x152d('0x16')](function(_0x507d74){logger[_0x152d('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x25f9fe,_0x507d74);_0x3a36a3(_0x507d74);});});}
\ No newline at end of file
diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js
index a31c5e1..2dd15b2 100644
--- a/server/api/userSmsQueue/index.js
+++ b/server/api/userSmsQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb0f=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports','util'];(function(_0x735da9,_0x38b186){var _0x39160b=function(_0x5cb870){while(--_0x5cb870){_0x735da9['push'](_0x735da9['shift']());}};_0x39160b(++_0x38b186);}(_0xcb0f,0x1d9));var _0xfcb0=function(_0x1e7634,_0x37d8e2){_0x1e7634=_0x1e7634-0x0;var _0x50a829=_0xcb0f[_0x1e7634];return _0x50a829;};'use strict';var multer=require('multer');var util=require(_0xfcb0('0x0'));var path=require('path');var timeout=require(_0xfcb0('0x1'));var express=require('express');var router=express[_0xfcb0('0x2')]();var auth=require(_0xfcb0('0x3'));var interaction=require(_0xfcb0('0x4'));var config=require('../../config/environment');module[_0xfcb0('0x5')]=router;
\ No newline at end of file
+var _0xe193=['multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x34dc5c,_0x3a1077){var _0x1af497=function(_0x551180){while(--_0x551180){_0x34dc5c['push'](_0x34dc5c['shift']());}};_0x1af497(++_0x3a1077);}(_0xe193,0x17a));var _0x3e19=function(_0x347452,_0x5e890d){_0x347452=_0x347452-0x0;var _0x41e5bd=_0xe193[_0x347452];return _0x41e5bd;};'use strict';var multer=require(_0x3e19('0x0'));var util=require(_0x3e19('0x1'));var path=require('path');var timeout=require(_0x3e19('0x2'));var express=require('express');var router=express[_0x3e19('0x3')]();var auth=require(_0x3e19('0x4'));var interaction=require(_0x3e19('0x5'));var config=require('../../config/environment');module[_0x3e19('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js
index 6dc8228..530f201 100644
--- a/server/api/userSmsQueue/userSmsQueue.attributes.js
+++ b/server/api/userSmsQueue/userSmsQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['sequelize','INTEGER'];(function(_0x4e5421,_0x2f0eca){var _0x277430=function(_0x449164){while(--_0x449164){_0x4e5421['push'](_0x4e5421['shift']());}};_0x277430(++_0x2f0eca);}(_0xb10b,0x12a));var _0xbb10=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0xb10b[_0x58547b];return _0x1d3fd2;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x28389e,_0x40c0b0){var _0x23638f=function(_0x4933b9){while(--_0x4933b9){_0x28389e['push'](_0x28389e['shift']());}};_0x23638f(++_0x40c0b0);}(_0xe706,0xa3));var _0x6e70=function(_0x16eb13,_0x3d592f){_0x16eb13=_0x16eb13-0x0;var _0x2b6230=_0xe706[_0x16eb13];return _0x2b6230;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js
index 11767c8..19d70c9 100644
--- a/server/api/userSmsQueue/userSmsQueue.model.js
+++ b/server/api/userSmsQueue/userSmsQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb945=['path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','moment'];(function(_0x4ba999,_0xe41814){var _0x2e226d=function(_0x4a93b4){while(--_0x4a93b4){_0x4ba999['push'](_0x4ba999['shift']());}};_0x2e226d(++_0xe41814);}(_0xb945,0x97));var _0x5b94=function(_0x3c2d1f,_0x404906){_0x3c2d1f=_0x3c2d1f-0x0;var _0x412a38=_0xb945[_0x3c2d1f];return _0x412a38;};'use strict';var _=require(_0x5b94('0x0'));var util=require('util');var logger=require(_0x5b94('0x1'))('api');var moment=require(_0x5b94('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b94('0x3'));var rimraf=require(_0x5b94('0x4'));var config=require(_0x5b94('0x5'));var attributes=require(_0x5b94('0x6'));module[_0x5b94('0x7')]=function(_0x4bef06,_0x492388){return _0x4bef06[_0x5b94('0x8')](_0x5b94('0x9'),attributes,{'tableName':_0x5b94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97a2=['exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2c4440,_0x4fe366){var _0x20f1dd=function(_0x7495a5){while(--_0x7495a5){_0x2c4440['push'](_0x2c4440['shift']());}};_0x20f1dd(++_0x4fe366);}(_0x97a2,0x1b1));var _0x297a=function(_0x236b32,_0x69225){_0x236b32=_0x236b32-0x0;var _0xacbd0b=_0x97a2[_0x236b32];return _0xacbd0b;};'use strict';var _=require(_0x297a('0x0'));var util=require('util');var logger=require(_0x297a('0x1'))(_0x297a('0x2'));var moment=require(_0x297a('0x3'));var BPromise=require(_0x297a('0x4'));var rp=require(_0x297a('0x5'));var fs=require('fs');var path=require(_0x297a('0x6'));var rimraf=require(_0x297a('0x7'));var config=require(_0x297a('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x297a('0x9')]=function(_0x2a420b,_0x2c1f41){return _0x2a420b[_0x297a('0xa')](_0x297a('0xb'),attributes,{'tableName':_0x297a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js
index 54e8185..4085d1f 100644
--- a/server/api/userSmsQueue/userSmsQueue.rpc.js
+++ b/server/api/userSmsQueue/userSmsQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a0c=['debug','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2a0c,0x64));var _0xc2a0=function(_0x19be12,_0x53c296){_0x19be12=_0x19be12-0x0;var _0x2b41db=_0x2a0c[_0x19be12];return _0x2b41db;};'use strict';var _=require('lodash');var util=require(_0xc2a0('0x0'));var moment=require(_0xc2a0('0x1'));var BPromise=require(_0xc2a0('0x2'));var rs=require(_0xc2a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2a0('0x4'))['db'];var utils=require(_0xc2a0('0x5'));var logger=require(_0xc2a0('0x6'))(_0xc2a0('0x7'));var config=require(_0xc2a0('0x8'));var jayson=require(_0xc2a0('0x9'));var client=jayson['client'][_0xc2a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14444f,_0x5f05ab,_0x115070){return new BPromise(function(_0xb594d2,_0x204f6f){return client[_0xc2a0('0xb')](_0x14444f,_0x115070)[_0xc2a0('0xc')](function(_0x79288d){logger[_0xc2a0('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x5f05ab,_0xc2a0('0xe'));logger[_0xc2a0('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5f05ab,_0xc2a0('0xe'),JSON[_0xc2a0('0x10')](_0x79288d));if(_0x79288d[_0xc2a0('0x11')]){if(_0x79288d[_0xc2a0('0x11')][_0xc2a0('0x12')]===0x1f4){logger[_0xc2a0('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x5f05ab,_0x79288d[_0xc2a0('0x11')][_0xc2a0('0x13')]);return _0x204f6f(_0x79288d[_0xc2a0('0x11')]['message']);}logger['error'](_0xc2a0('0x14'),_0x5f05ab,_0x79288d[_0xc2a0('0x11')][_0xc2a0('0x13')]);return _0xb594d2(_0x79288d['error'][_0xc2a0('0x13')]);}else{logger[_0xc2a0('0xd')](_0xc2a0('0x14'),_0x5f05ab,'request\x20sent');_0xb594d2(_0x79288d[_0xc2a0('0x15')][_0xc2a0('0x13')]);}})[_0xc2a0('0x16')](function(_0x56a925){logger[_0xc2a0('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x5f05ab,_0x56a925);_0x204f6f(_0x56a925);});});}
\ No newline at end of file
+var _0x6f3a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch'];(function(_0x1ab0b5,_0x3cf535){var _0x41ffef=function(_0x4f2eb3){while(--_0x4f2eb3){_0x1ab0b5['push'](_0x1ab0b5['shift']());}};_0x41ffef(++_0x3cf535);}(_0x6f3a,0x168));var _0xa6f3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x6f3a[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa6f3('0x0'));var rs=require(_0xa6f3('0x1'));var fs=require('fs');var Redis=require(_0xa6f3('0x2'));var db=require(_0xa6f3('0x3'))['db'];var utils=require(_0xa6f3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa6f3('0x5'));var jayson=require(_0xa6f3('0x6'));var client=jayson[_0xa6f3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e84bf,_0xf1b0dd,_0x550c21){return new BPromise(function(_0xb52d3d,_0x137add){return client['request'](_0x4e84bf,_0x550c21)[_0xa6f3('0x8')](function(_0x38c108){logger['info'](_0xa6f3('0x9'),_0xf1b0dd,'request\x20sent');logger[_0xa6f3('0xa')](_0xa6f3('0xb'),_0xf1b0dd,'request\x20sent',JSON[_0xa6f3('0xc')](_0x38c108));if(_0x38c108[_0xa6f3('0xd')]){if(_0x38c108[_0xa6f3('0xd')][_0xa6f3('0xe')]===0x1f4){logger[_0xa6f3('0xd')](_0xa6f3('0x9'),_0xf1b0dd,_0x38c108[_0xa6f3('0xd')][_0xa6f3('0xf')]);return _0x137add(_0x38c108['error'][_0xa6f3('0xf')]);}logger[_0xa6f3('0xd')](_0xa6f3('0x9'),_0xf1b0dd,_0x38c108[_0xa6f3('0xd')]['message']);return _0xb52d3d(_0x38c108[_0xa6f3('0xd')][_0xa6f3('0xf')]);}else{logger[_0xa6f3('0x10')](_0xa6f3('0x9'),_0xf1b0dd,_0xa6f3('0x11'));_0xb52d3d(_0x38c108[_0xa6f3('0x12')][_0xa6f3('0xf')]);}})[_0xa6f3('0x13')](function(_0x2dcee3){logger[_0xa6f3('0xd')](_0xa6f3('0x9'),_0xf1b0dd,_0x2dcee3);_0x137add(_0x2dcee3);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js
index f526c75..f4cf34a 100644
--- a/server/api/userVoiceQueue/index.js
+++ b/server/api/userVoiceQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa861=['../../config/environment','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1a2ee0,_0x23814f){var _0x5172c1=function(_0x4dbd66){while(--_0x4dbd66){_0x1a2ee0['push'](_0x1a2ee0['shift']());}};_0x5172c1(++_0x23814f);}(_0xa861,0x1c4));var _0x1a86=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xa861[_0x403c20];return _0x2b271a;};'use strict';var multer=require(_0x1a86('0x0'));var util=require(_0x1a86('0x1'));var path=require(_0x1a86('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a86('0x3'));var router=express[_0x1a86('0x4')]();var auth=require(_0x1a86('0x5'));var interaction=require(_0x1a86('0x6'));var config=require(_0x1a86('0x7'));module[_0x1a86('0x8')]=router;
\ No newline at end of file
+var _0xdf85=['util','path','connect-timeout','express','Router','../../components/auth/service','exports','multer'];(function(_0x4fe03b,_0x218ec7){var _0x5a48cb=function(_0x35138b){while(--_0x35138b){_0x4fe03b['push'](_0x4fe03b['shift']());}};_0x5a48cb(++_0x218ec7);}(_0xdf85,0x1ef));var _0x5df8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xdf85[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0x5df8('0x0'));var util=require(_0x5df8('0x1'));var path=require(_0x5df8('0x2'));var timeout=require(_0x5df8('0x3'));var express=require(_0x5df8('0x4'));var router=express[_0x5df8('0x5')]();var auth=require(_0x5df8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x5df8('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js
index 6d8bfe3..7745863 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['exports','INTEGER'];(function(_0x138b2c,_0x142181){var _0xa8b921=function(_0xc1799e){while(--_0xc1799e){_0x138b2c['push'](_0x138b2c['shift']());}};_0xa8b921(++_0x142181);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb10b=['sequelize','INTEGER'];(function(_0x412401,_0x42d4e5){var _0xd6ef6=function(_0x832fdd){while(--_0x832fdd){_0x412401['push'](_0x412401['shift']());}};_0xd6ef6(++_0x42d4e5);}(_0xb10b,0x12a));var _0xbb10=function(_0x123450,_0x491c01){_0x123450=_0x123450-0x0;var _0x23b29d=_0xb10b[_0x123450];return _0x23b29d;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js
index 9492092..8654b66 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.model.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb751=['exports','define','UserVoiceQueue','user_has_voice_queues','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x4c8d2a,_0x5416b0){var _0x1034d6=function(_0x110d19){while(--_0x110d19){_0x4c8d2a['push'](_0x4c8d2a['shift']());}};_0x1034d6(++_0x5416b0);}(_0xb751,0x1d8));var _0x1b75=function(_0x3afe68,_0x40add6){_0x3afe68=_0x3afe68-0x0;var _0x5bf75e=_0xb751[_0x3afe68];return _0x5bf75e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b75('0x0'))(_0x1b75('0x1'));var moment=require('moment');var BPromise=require(_0x1b75('0x2'));var rp=require(_0x1b75('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b75('0x4'));var attributes=require('./userVoiceQueue.attributes');module[_0x1b75('0x5')]=function(_0x45a962,_0x51aa01){return _0x45a962[_0x1b75('0x6')](_0x1b75('0x7'),attributes,{'tableName':_0x1b75('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xabfe=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x151343,_0x1575c7){var _0x12f811=function(_0x2a815f){while(--_0x2a815f){_0x151343['push'](_0x151343['shift']());}};_0x12f811(++_0x1575c7);}(_0xabfe,0x174));var _0xeabf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabfe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xeabf('0x0'));var util=require(_0xeabf('0x1'));var logger=require(_0xeabf('0x2'))(_0xeabf('0x3'));var moment=require(_0xeabf('0x4'));var BPromise=require('bluebird');var rp=require(_0xeabf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeabf('0x6'));var config=require('../../config/environment');var attributes=require(_0xeabf('0x7'));module[_0xeabf('0x8')]=function(_0x28e6c7,_0x5b8f8a){return _0x28e6c7[_0xeabf('0x9')](_0xeabf('0xa'),attributes,{'tableName':_0xeabf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js
index f566016..6e801d4 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.rpc.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x52f4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0xcc9dee,_0x1e7aaf){var _0x2123ba=function(_0x640a70){while(--_0x640a70){_0xcc9dee['push'](_0xcc9dee['shift']());}};_0x2123ba(++_0x1e7aaf);}(_0x52f4,0x69));var _0x452f=function(_0x3c3793,_0x50e7fd){_0x3c3793=_0x3c3793-0x0;var _0x3e7872=_0x52f4[_0x3c3793];return _0x3e7872;};'use strict';var _=require(_0x452f('0x0'));var util=require('util');var moment=require(_0x452f('0x1'));var BPromise=require(_0x452f('0x2'));var rs=require(_0x452f('0x3'));var fs=require('fs');var Redis=require(_0x452f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x452f('0x5'));var logger=require(_0x452f('0x6'))(_0x452f('0x7'));var config=require(_0x452f('0x8'));var jayson=require(_0x452f('0x9'));var client=jayson[_0x452f('0xa')][_0x452f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e82fe,_0x2593e4,_0x1654ce){return new BPromise(function(_0x516c77,_0x3eaa90){return client[_0x452f('0xc')](_0x3e82fe,_0x1654ce)[_0x452f('0xd')](function(_0x336f3f){logger[_0x452f('0xe')](_0x452f('0xf'),_0x2593e4,_0x452f('0x10'));logger['debug'](_0x452f('0x11'),_0x2593e4,_0x452f('0x10'),JSON['stringify'](_0x336f3f));if(_0x336f3f['error']){if(_0x336f3f['error'][_0x452f('0x12')]===0x1f4){logger['error'](_0x452f('0xf'),_0x2593e4,_0x336f3f['error']['message']);return _0x3eaa90(_0x336f3f[_0x452f('0x13')]['message']);}logger[_0x452f('0x13')](_0x452f('0xf'),_0x2593e4,_0x336f3f[_0x452f('0x13')][_0x452f('0x14')]);return _0x516c77(_0x336f3f[_0x452f('0x13')][_0x452f('0x14')]);}else{logger[_0x452f('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x2593e4,_0x452f('0x10'));_0x516c77(_0x336f3f[_0x452f('0x15')][_0x452f('0x14')]);}})['catch'](function(_0x3f096d){logger[_0x452f('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x2593e4,_0x3f096d);_0x3eaa90(_0x3f096d);});});}
\ No newline at end of file
+var _0x0127=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment'];(function(_0x56f40f,_0x2f93c3){var _0x178750=function(_0xb851a2){while(--_0xb851a2){_0x56f40f['push'](_0x56f40f['shift']());}};_0x178750(++_0x2f93c3);}(_0x0127,0x87));var _0x7012=function(_0x1e2570,_0x53e877){_0x1e2570=_0x1e2570-0x0;var _0xba7b2d=_0x0127[_0x1e2570];return _0xba7b2d;};'use strict';var _=require(_0x7012('0x0'));var util=require(_0x7012('0x1'));var moment=require(_0x7012('0x2'));var BPromise=require(_0x7012('0x3'));var rs=require(_0x7012('0x4'));var fs=require('fs');var Redis=require(_0x7012('0x5'));var db=require(_0x7012('0x6'))['db'];var utils=require(_0x7012('0x7'));var logger=require(_0x7012('0x8'))(_0x7012('0x9'));var config=require(_0x7012('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7012('0xb')][_0x7012('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e63e8,_0x233387,_0x4af649){return new BPromise(function(_0x141db1,_0x1e69d8){return client[_0x7012('0xd')](_0x5e63e8,_0x4af649)[_0x7012('0xe')](function(_0x16fe90){logger[_0x7012('0xf')](_0x7012('0x10'),_0x233387,_0x7012('0x11'));logger['debug'](_0x7012('0x12'),_0x233387,'request\x20sent',JSON[_0x7012('0x13')](_0x16fe90));if(_0x16fe90['error']){if(_0x16fe90[_0x7012('0x14')][_0x7012('0x15')]===0x1f4){logger[_0x7012('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x233387,_0x16fe90['error'][_0x7012('0x16')]);return _0x1e69d8(_0x16fe90[_0x7012('0x14')][_0x7012('0x16')]);}logger['error'](_0x7012('0x10'),_0x233387,_0x16fe90[_0x7012('0x14')][_0x7012('0x16')]);return _0x141db1(_0x16fe90[_0x7012('0x14')][_0x7012('0x16')]);}else{logger['info'](_0x7012('0x10'),_0x233387,_0x7012('0x11'));_0x141db1(_0x16fe90['result']['message']);}})['catch'](function(_0x46211a){logger[_0x7012('0x14')](_0x7012('0x10'),_0x233387,_0x46211a);_0x1e69d8(_0x46211a);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js
index 310eb4d..7d95d15 100644
--- a/server/api/userVoiceQueueRt/index.js
+++ b/server/api/userVoiceQueueRt/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1e81=['../../components/auth/service','exports','util','path','express','Router'];(function(_0x2daad9,_0x35277d){var _0x524553=function(_0xb99dc2){while(--_0xb99dc2){_0x2daad9['push'](_0x2daad9['shift']());}};_0x524553(++_0x35277d);}(_0x1e81,0x16a));var _0x11e8=function(_0x5425f3,_0x579060){_0x5425f3=_0x5425f3-0x0;var _0x2293fc=_0x1e81[_0x5425f3];return _0x2293fc;};'use strict';var multer=require('multer');var util=require(_0x11e8('0x0'));var path=require(_0x11e8('0x1'));var timeout=require('connect-timeout');var express=require(_0x11e8('0x2'));var router=express[_0x11e8('0x3')]();var auth=require(_0x11e8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x11e8('0x5')]=router;
\ No newline at end of file
+var _0x0734=['../../components/interaction/service','../../config/environment','express','Router','../../components/auth/service'];(function(_0x1fec40,_0x39f69f){var _0x30c87d=function(_0x36e824){while(--_0x36e824){_0x1fec40['push'](_0x1fec40['shift']());}};_0x30c87d(++_0x39f69f);}(_0x0734,0xd4));var _0x4073=function(_0x2ef892,_0x57b96f){_0x2ef892=_0x2ef892-0x0;var _0x1f4a55=_0x0734[_0x2ef892];return _0x1f4a55;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4073('0x0'));var router=express[_0x4073('0x1')]();var auth=require(_0x4073('0x2'));var interaction=require(_0x4073('0x3'));var config=require(_0x4073('0x4'));module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
index 74a18f5..80cb616 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7eb0=['STRING','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x7eb0,0x155));var _0x07eb=function(_0x3e382d,_0x28224d){_0x3e382d=_0x3e382d-0x0;var _0x21cf3e=_0x7eb0[_0x3e382d];return _0x21cf3e;};'use strict';var Sequelize=require(_0x07eb('0x0'));module[_0x07eb('0x1')]={'uniqueid':{'type':Sequelize[_0x07eb('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x07eb('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x07eb('0x3')},'UserId':{'type':Sequelize[_0x07eb('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x07eb('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x07eb('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x07eb('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x07eb('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x07eb('0x3')},'paused':{'type':Sequelize[_0x07eb('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
+var _0xca64=['STRING','queue_interface','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x20dec8,_0x55294c){var _0x4278c6=function(_0x3c1b1d){while(--_0x3c1b1d){_0x20dec8['push'](_0x20dec8['shift']());}};_0x4278c6(++_0x55294c);}(_0xca64,0x110));var _0x4ca6=function(_0x206ec3,_0x18cda4){_0x206ec3=_0x206ec3-0x0;var _0x1c57fa=_0xca64[_0x206ec3];return _0x1c57fa;};'use strict';var Sequelize=require('sequelize');module[_0x4ca6('0x0')]={'uniqueid':{'type':Sequelize[_0x4ca6('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4ca6('0x2')},'membername':{'type':Sequelize[_0x4ca6('0x3')],'allowNull':![],'comment':_0x4ca6('0x2')},'UserId':{'type':Sequelize[_0x4ca6('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4ca6('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x4ca6('0x2')},'VoiceQueueId':{'type':Sequelize[_0x4ca6('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x4ca6('0x3')],'allowNull':![],'unique':_0x4ca6('0x4'),'comment':_0x4ca6('0x2')},'penalty':{'type':Sequelize[_0x4ca6('0x1')](0xb),'defaultValue':0x0,'comment':_0x4ca6('0x2')},'paused':{'type':Sequelize[_0x4ca6('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
index aaa7f7c..7acff55 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd6e6=['update','remove','emit','hook','events','UserVoiceQueueRt','setMaxListeners','save'];(function(_0xaa97cd,_0x4543f4){var _0x248972=function(_0x79e00a){while(--_0x79e00a){_0xaa97cd['push'](_0xaa97cd['shift']());}};_0x248972(++_0x4543f4);}(_0xd6e6,0xcc));var _0x6d6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd6e6[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x6d6e('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x6d6e('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6d6e('0x2')](0x0);var events={'afterCreate':_0x6d6e('0x3'),'afterUpdate':_0x6d6e('0x4'),'afterDestroy':_0x6d6e('0x5')};function emitEvent(_0x32e471){return function(_0x459307,_0x572643,_0x435bb7){UserVoiceQueueRtEvents[_0x6d6e('0x6')](_0x32e471+':'+_0x459307['id'],_0x459307);UserVoiceQueueRtEvents[_0x6d6e('0x6')](_0x32e471,_0x459307);_0x435bb7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x6d6e('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xc94e=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x4e836a,_0x11fc61){var _0x40ee7c=function(_0x559e7c){while(--_0x559e7c){_0x4e836a['push'](_0x4e836a['shift']());}};_0x40ee7c(++_0x11fc61);}(_0xc94e,0x172));var _0xec94=function(_0x5cd6a9,_0x184b72){_0x5cd6a9=_0x5cd6a9-0x0;var _0x21dc05=_0xc94e[_0x5cd6a9];return _0x21dc05;};'use strict';var EventEmitter=require(_0xec94('0x0'));var UserVoiceQueueRt=require(_0xec94('0x1'))['db'][_0xec94('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xec94('0x3')](0x0);var events={'afterCreate':_0xec94('0x4'),'afterUpdate':_0xec94('0x5'),'afterDestroy':_0xec94('0x6')};function emitEvent(_0xf2d9d9){return function(_0x17c7ab,_0x5f2c4f,_0xce13c8){UserVoiceQueueRtEvents['emit'](_0xf2d9d9+':'+_0x17c7ab['id'],_0x17c7ab);UserVoiceQueueRtEvents[_0xec94('0x7')](_0xf2d9d9,_0x17c7ab);_0xce13c8(null);};}for(var e in events){if(events[_0xec94('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xec94('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
index a9400ee..1fa9845 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdcd3=['UserVoiceQueueRt','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x121408,_0x584344){var _0x3d5573=function(_0x41a00a){while(--_0x41a00a){_0x121408['push'](_0x121408['shift']());}};_0x3d5573(++_0x584344);}(_0xdcd3,0x105));var _0x3dcd=function(_0x30c30c,_0x35466c){_0x30c30c=_0x30c30c-0x0;var _0x2c9a91=_0xdcd3[_0x30c30c];return _0x2c9a91;};'use strict';var _=require(_0x3dcd('0x0'));var util=require(_0x3dcd('0x1'));var logger=require(_0x3dcd('0x2'))(_0x3dcd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3dcd('0x4'));var fs=require('fs');var path=require(_0x3dcd('0x5'));var rimraf=require(_0x3dcd('0x6'));var config=require(_0x3dcd('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x3dcd('0x8')]=function(_0x28f0b4,_0x4c0650){return _0x28f0b4['define'](_0x3dcd('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x74e4=['util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','lodash'];(function(_0x5b8c76,_0x14285e){var _0x43ad34=function(_0x4ccb27){while(--_0x4ccb27){_0x5b8c76['push'](_0x5b8c76['shift']());}};_0x43ad34(++_0x14285e);}(_0x74e4,0xe5));var _0x474e=function(_0x1fd59f,_0x3a6c20){_0x1fd59f=_0x1fd59f-0x0;var _0x527ebf=_0x74e4[_0x1fd59f];return _0x527ebf;};'use strict';var _=require(_0x474e('0x0'));var util=require(_0x474e('0x1'));var logger=require(_0x474e('0x2'))('api');var moment=require(_0x474e('0x3'));var BPromise=require(_0x474e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x474e('0x5'));var config=require(_0x474e('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x474e('0x7')]=function(_0x41c77f,_0x2abcbb){return _0x41c77f[_0x474e('0x8')](_0x474e('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
index b6575ce..f595841 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdecb=['then','info','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','request'];(function(_0x144626,_0xb87c16){var _0x73c7d9=function(_0x1b5d84){while(--_0x1b5d84){_0x144626['push'](_0x144626['shift']());}};_0x73c7d9(++_0xb87c16);}(_0xdecb,0x134));var _0xbdec=function(_0x5ae313,_0x46d22d){_0x5ae313=_0x5ae313-0x0;var _0x29c112=_0xdecb[_0x5ae313];return _0x29c112;};'use strict';var _=require(_0xbdec('0x0'));var util=require(_0xbdec('0x1'));var moment=require(_0xbdec('0x2'));var BPromise=require(_0xbdec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdec('0x4'));var db=require(_0xbdec('0x5'))['db'];var utils=require(_0xbdec('0x6'));var logger=require(_0xbdec('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbdec('0x8'));var client=jayson[_0xbdec('0x9')][_0xbdec('0xa')]({'port':0x232a});config[_0xbdec('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbdec('0xc'))(new Redis(config[_0xbdec('0xb')]));require(_0xbdec('0xd'))[_0xbdec('0xe')](socket);function respondWithRpcPromise(_0x62e3c1,_0x456ed7,_0x317ae8){return new BPromise(function(_0x362c8c,_0x54dcef){return client[_0xbdec('0xf')](_0x62e3c1,_0x317ae8)[_0xbdec('0x10')](function(_0x40588a){logger[_0xbdec('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x456ed7,'request\x20sent');logger['debug'](_0xbdec('0x12'),_0x456ed7,_0xbdec('0x13'),JSON['stringify'](_0x40588a));if(_0x40588a[_0xbdec('0x14')]){if(_0x40588a['error'][_0xbdec('0x15')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x456ed7,_0x40588a['error']['message']);return _0x54dcef(_0x40588a[_0xbdec('0x14')][_0xbdec('0x16')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x456ed7,_0x40588a['error'][_0xbdec('0x16')]);return _0x362c8c(_0x40588a[_0xbdec('0x14')][_0xbdec('0x16')]);}else{logger['info'](_0xbdec('0x17'),_0x456ed7,_0xbdec('0x13'));_0x362c8c(_0x40588a[_0xbdec('0x18')]['message']);}})[_0xbdec('0x19')](function(_0x5d726e){logger['error'](_0xbdec('0x17'),_0x456ed7,_0x5d726e);_0x54dcef(_0x5d726e);});});}exports[_0xbdec('0x1a')]=function(_0x9c402e){var _0x3defdf=this;return new Promise(function(_0x366884,_0x1721b1){return db[_0xbdec('0x1b')][_0xbdec('0x1c')]({'raw':_0x9c402e[_0xbdec('0x1d')]?_0x9c402e[_0xbdec('0x1d')][_0xbdec('0x1e')]===undefined?!![]:![]:!![],'where':_0x9c402e[_0xbdec('0x1d')]?_0x9c402e['options'][_0xbdec('0x1f')]||null:null,'attributes':[[db[_0xbdec('0x20')]['fn'](_0xbdec('0x21'),db[_0xbdec('0x20')]['fn']('IF',db[_0xbdec('0x20')][_0xbdec('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})['then'](function(_0x3939ac){logger[_0xbdec('0x11')](_0xbdec('0x1a'),_0x9c402e);logger['debug'](_0xbdec('0x1a'),_0x9c402e,JSON[_0xbdec('0x23')](_0x3939ac));_0x366884(_0x3939ac);})[_0xbdec('0x19')](function(_0x7bc676){logger[_0xbdec('0x14')](_0xbdec('0x1a'),_0x7bc676[_0xbdec('0x16')],_0x9c402e);_0x1721b1(_0x3defdf[_0xbdec('0x14')](0x1f4,_0x7bc676[_0xbdec('0x16')]));});});};
\ No newline at end of file
+var _0xc5a3=['UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','info'];(function(_0x54820b,_0x22f140){var _0x3d6618=function(_0xc1a33d){while(--_0xc1a33d){_0x54820b['push'](_0x54820b['shift']());}};_0x3d6618(++_0x22f140);}(_0xc5a3,0xd8));var _0x3c5a=function(_0x585ffc,_0x2df5d8){_0x585ffc=_0x585ffc-0x0;var _0x23a791=_0xc5a3[_0x585ffc];return _0x23a791;};'use strict';var _=require('lodash');var util=require(_0x3c5a('0x0'));var moment=require('moment');var BPromise=require(_0x3c5a('0x1'));var rs=require(_0x3c5a('0x2'));var fs=require('fs');var Redis=require(_0x3c5a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c5a('0x4'));var logger=require('../../config/logger')(_0x3c5a('0x5'));var config=require(_0x3c5a('0x6'));var jayson=require(_0x3c5a('0x7'));var client=jayson['client'][_0x3c5a('0x8')]({'port':0x232a});config[_0x3c5a('0x9')]=_[_0x3c5a('0xa')](config[_0x3c5a('0x9')],{'host':_0x3c5a('0xb'),'port':0x18eb});var socket=require(_0x3c5a('0xc'))(new Redis(config[_0x3c5a('0x9')]));require('./userVoiceQueueRt.socket')[_0x3c5a('0xd')](socket);function respondWithRpcPromise(_0x36f8de,_0x44ee65,_0x564764){return new BPromise(function(_0x560f8f,_0x458ad8){return client['request'](_0x36f8de,_0x564764)['then'](function(_0x15f159){logger[_0x3c5a('0xe')](_0x3c5a('0xf'),_0x44ee65,_0x3c5a('0x10'));logger[_0x3c5a('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x44ee65,_0x3c5a('0x10'),JSON[_0x3c5a('0x12')](_0x15f159));if(_0x15f159[_0x3c5a('0x13')]){if(_0x15f159['error'][_0x3c5a('0x14')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x44ee65,_0x15f159['error']['message']);return _0x458ad8(_0x15f159[_0x3c5a('0x13')][_0x3c5a('0x15')]);}logger[_0x3c5a('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x44ee65,_0x15f159[_0x3c5a('0x13')][_0x3c5a('0x15')]);return _0x560f8f(_0x15f159[_0x3c5a('0x13')][_0x3c5a('0x15')]);}else{logger[_0x3c5a('0xe')](_0x3c5a('0xf'),_0x44ee65,_0x3c5a('0x10'));_0x560f8f(_0x15f159[_0x3c5a('0x16')][_0x3c5a('0x15')]);}})[_0x3c5a('0x17')](function(_0x1ea6b2){logger[_0x3c5a('0x13')](_0x3c5a('0xf'),_0x44ee65,_0x1ea6b2);_0x458ad8(_0x1ea6b2);});});}exports[_0x3c5a('0x18')]=function(_0x593f91){var _0x1305d2=this;return new Promise(function(_0x462134,_0x49767d){return db['UserVoiceQueueRt'][_0x3c5a('0x19')]({'raw':_0x593f91[_0x3c5a('0x1a')]?_0x593f91[_0x3c5a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x593f91[_0x3c5a('0x1a')]?_0x593f91[_0x3c5a('0x1a')][_0x3c5a('0x1b')]||null:null,'attributes':[[db[_0x3c5a('0x1c')]['fn'](_0x3c5a('0x1d'),db[_0x3c5a('0x1c')]['fn']('IF',db['sequelize'][_0x3c5a('0x1e')](_0x3c5a('0x1f')))),_0x3c5a('0x20')]]})['then'](function(_0x44093b){logger[_0x3c5a('0xe')](_0x3c5a('0x18'),_0x593f91);logger[_0x3c5a('0x11')]('GetVoiceQueueRtPauses',_0x593f91,JSON[_0x3c5a('0x12')](_0x44093b));_0x462134(_0x44093b);})[_0x3c5a('0x17')](function(_0x29a069){logger[_0x3c5a('0x13')](_0x3c5a('0x18'),_0x29a069[_0x3c5a('0x15')],_0x593f91);_0x49767d(_0x1305d2[_0x3c5a('0x13')](0x1f4,_0x29a069[_0x3c5a('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
index bddbc7e..72783f2 100644
--- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
+++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x66ea=['save','remove','update','emit','register','length','userVoiceQueueRt:'];(function(_0x2df91e,_0x578877){var _0x567737=function(_0x36ae6a){while(--_0x36ae6a){_0x2df91e['push'](_0x2df91e['shift']());}};_0x567737(++_0x578877);}(_0x66ea,0x1dc));var _0xa66e=function(_0x18084e,_0x1556c8){_0x18084e=_0x18084e-0x0;var _0x47905c=_0x66ea[_0x18084e];return _0x47905c;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xa66e('0x0'),_0xa66e('0x1'),_0xa66e('0x2')];function createListener(_0x55b438,_0x3c09f1){return function(_0x86438b){_0x3c09f1[_0xa66e('0x3')](_0x55b438,_0x86438b);};}function removeListener(_0x2944e2,_0x10dff0){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2944e2,_0x10dff0);};}exports[_0xa66e('0x4')]=function(_0x30c2ef){for(var _0x9a05e1=0x0,_0x51601d=events[_0xa66e('0x5')];_0x9a05e1<_0x51601d;_0x9a05e1++){var _0x4a8874=events[_0x9a05e1];var _0x30c99c=createListener(_0xa66e('0x6')+_0x4a8874,_0x30c2ef);UserVoiceQueueRtEvents['on'](_0x4a8874,_0x30c99c);}};
\ No newline at end of file
+var _0x4fd9=['save','remove','update','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x4fd9,0x1ef));var _0x94fd=function(_0x4599ad,_0x3219fd){_0x4599ad=_0x4599ad-0x0;var _0x40d6d7=_0x4fd9[_0x4599ad];return _0x40d6d7;};'use strict';var UserVoiceQueueRtEvents=require(_0x94fd('0x0'));var events=[_0x94fd('0x1'),_0x94fd('0x2'),_0x94fd('0x3')];function createListener(_0x52ee1a,_0x2c9af3){return function(_0x1ced20){_0x2c9af3[_0x94fd('0x4')](_0x52ee1a,_0x1ced20);};}function removeListener(_0x2c0cb3,_0x2c7288){return function(){UserVoiceQueueRtEvents[_0x94fd('0x5')](_0x2c0cb3,_0x2c7288);};}exports['register']=function(_0x43f4d2){for(var _0x48121d=0x0,_0x22bca3=events[_0x94fd('0x6')];_0x48121d<_0x22bca3;_0x48121d++){var _0x1e9262=events[_0x48121d];var _0x5b75fe=createListener(_0x94fd('0x7')+_0x1e9262,_0x43f4d2);UserVoiceQueueRtEvents['on'](_0x1e9262,_0x5b75fe);}};
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js
index ee74d0a..5c3f0a2 100644
--- a/server/api/userWhatsappQueue/index.js
+++ b/server/api/userWhatsappQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2c7=['multer','util','path','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x525093,_0x36c946){var _0x3cb674=function(_0x1211c9){while(--_0x1211c9){_0x525093['push'](_0x525093['shift']());}};_0x3cb674(++_0x36c946);}(_0xf2c7,0x168));var _0x7f2c=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0xf2c7[_0x218ca4];return _0x1b3ff9;};'use strict';var multer=require(_0x7f2c('0x0'));var util=require(_0x7f2c('0x1'));var path=require(_0x7f2c('0x2'));var timeout=require(_0x7f2c('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x7f2c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7f2c('0x5'));module['exports']=router;
\ No newline at end of file
+var _0x150a=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x150a,0x148));var _0xa150=function(_0x4f7519,_0x457a82){_0x4f7519=_0x4f7519-0x0;var _0x1d66be=_0x150a[_0x4f7519];return _0x1d66be;};'use strict';var multer=require(_0xa150('0x0'));var util=require(_0xa150('0x1'));var path=require(_0xa150('0x2'));var timeout=require(_0xa150('0x3'));var express=require(_0xa150('0x4'));var router=express[_0xa150('0x5')]();var auth=require(_0xa150('0x6'));var interaction=require(_0xa150('0x7'));var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
index 6402aa3..9744525 100644
--- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
+++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x33f269,_0x5998a3){var _0x4e94ff=function(_0x3d8c95){while(--_0x3d8c95){_0x33f269['push'](_0x33f269['shift']());}};_0x4e94ff(++_0x5998a3);}(_0xe706,0xa3));var _0x6e70=function(_0x1c44d7,_0x21dafd){_0x1c44d7=_0x1c44d7-0x0;var _0xc485e5=_0xe706[_0x1c44d7];return _0xc485e5;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbaf0=['exports','INTEGER'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js
index 6aaedf3..095807c 100644
--- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js
+++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x918b=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserWhatsappQueue','lodash'];(function(_0x29fb70,_0x2d1ad9){var _0x5f55fb=function(_0x490f62){while(--_0x490f62){_0x29fb70['push'](_0x29fb70['shift']());}};_0x5f55fb(++_0x2d1ad9);}(_0x918b,0x8e));var _0xb918=function(_0x5a4a1e,_0x5f014c){_0x5a4a1e=_0x5a4a1e-0x0;var _0x13b91d=_0x918b[_0x5a4a1e];return _0x13b91d;};'use strict';var _=require(_0xb918('0x0'));var util=require(_0xb918('0x1'));var logger=require(_0xb918('0x2'))('api');var moment=require(_0xb918('0x3'));var BPromise=require(_0xb918('0x4'));var rp=require(_0xb918('0x5'));var fs=require('fs');var path=require(_0xb918('0x6'));var rimraf=require(_0xb918('0x7'));var config=require(_0xb918('0x8'));var attributes=require('./userWhatsappQueue.attributes');module[_0xb918('0x9')]=function(_0x24ed1d,_0x376a58){return _0x24ed1d['define'](_0xb918('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b18=['api','moment','bluebird','path','rimraf','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x4e51fd,_0x41fa03){var _0x15893a=function(_0x4a09a2){while(--_0x4a09a2){_0x4e51fd['push'](_0x4e51fd['shift']());}};_0x15893a(++_0x41fa03);}(_0x3b18,0x1d4));var _0x83b1=function(_0x42a8eb,_0xa605eb){_0x42a8eb=_0x42a8eb-0x0;var _0x584d0a=_0x3b18[_0x42a8eb];return _0x584d0a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x83b1('0x0'));var moment=require(_0x83b1('0x1'));var BPromise=require(_0x83b1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x83b1('0x3'));var rimraf=require(_0x83b1('0x4'));var config=require('../../config/environment');var attributes=require(_0x83b1('0x5'));module['exports']=function(_0x50137b,_0x57d83b){return _0x50137b[_0x83b1('0x6')](_0x83b1('0x7'),attributes,{'tableName':_0x83b1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
index 95df59f..5ee0738 100644
--- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
+++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x62186b,_0x273f46){var _0x2bab2a=function(_0x296f61){while(--_0x296f61){_0x62186b['push'](_0x62186b['shift']());}};_0x2bab2a(++_0x273f46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5f5675,_0xe8457d){var _0x4ce3bf=function(_0x5e7b46){while(--_0x5e7b46){_0x5f5675['push'](_0x5f5675['shift']());}};_0x4ce3bf(++_0xe8457d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/variable/index.js b/server/api/variable/index.js
index 02c6181..78a3249 100644
--- a/server/api/variable/index.js
+++ b/server/api/variable/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xae7d=['./variable.controller','isAuthenticated','index','get','create','put','update','delete','destroy','multer','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x3c9487,_0x1316d5){var _0x1149c0=function(_0xda3e3f){while(--_0xda3e3f){_0x3c9487['push'](_0x3c9487['shift']());}};_0x1149c0(++_0x1316d5);}(_0xae7d,0x19f));var _0xdae7=function(_0xfeb2ca,_0x4ca7a4){_0xfeb2ca=_0xfeb2ca-0x0;var _0xb50fa9=_0xae7d[_0xfeb2ca];return _0xb50fa9;};'use strict';var multer=require(_0xdae7('0x0'));var util=require('util');var path=require(_0xdae7('0x1'));var timeout=require(_0xdae7('0x2'));var express=require('express');var router=express[_0xdae7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xdae7('0x4'));var config=require('../../config/environment');var controller=require(_0xdae7('0x5'));router['get']('/',auth[_0xdae7('0x6')](),controller[_0xdae7('0x7')]);router[_0xdae7('0x8')]('/:id',auth[_0xdae7('0x6')](),controller['show']);router['post']('/',auth[_0xdae7('0x6')](),controller[_0xdae7('0x9')]);router[_0xdae7('0xa')]('/:id',auth[_0xdae7('0x6')](),controller[_0xdae7('0xb')]);router[_0xdae7('0xc')]('/:id',auth[_0xdae7('0x6')](),controller[_0xdae7('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x4bfb=['post','create','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','index','get','/:id','show'];(function(_0x3de6c1,_0x4cb097){var _0x4453c8=function(_0x198e77){while(--_0x198e77){_0x3de6c1['push'](_0x3de6c1['shift']());}};_0x4453c8(++_0x4cb097);}(_0x4bfb,0x1b3));var _0xb4bf=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x4bfb[_0x210718];return _0x541bfc;};'use strict';var multer=require('multer');var util=require(_0xb4bf('0x0'));var path=require(_0xb4bf('0x1'));var timeout=require(_0xb4bf('0x2'));var express=require(_0xb4bf('0x3'));var router=express[_0xb4bf('0x4')]();var auth=require(_0xb4bf('0x5'));var interaction=require(_0xb4bf('0x6'));var config=require('../../config/environment');var controller=require(_0xb4bf('0x7'));router['get']('/',auth[_0xb4bf('0x8')](),controller[_0xb4bf('0x9')]);router[_0xb4bf('0xa')](_0xb4bf('0xb'),auth['isAuthenticated'](),controller[_0xb4bf('0xc')]);router[_0xb4bf('0xd')]('/',auth[_0xb4bf('0x8')](),controller[_0xb4bf('0xe')]);router['put'](_0xb4bf('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb4bf('0xb'),auth[_0xb4bf('0x8')](),controller['destroy']);module[_0xb4bf('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js
index b1e0f28..1d12663 100644
--- a/server/api/variable/variable.attributes.js
+++ b/server/api/variable/variable.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x06f8=['name','exports','STRING'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x06f8,0xbe));var _0x806f=function(_0x2a4212,_0x2fbd11){_0x2a4212=_0x2a4212-0x0;var _0x122547=_0x06f8[_0x2a4212];return _0x122547;};'use strict';var Sequelize=require('sequelize');module[_0x806f('0x0')]={'name':{'type':Sequelize[_0x806f('0x1')],'unique':_0x806f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x806f('0x1')]}};
\ No newline at end of file
+var _0x04b3=['sequelize','STRING','name'];(function(_0x36df3c,_0x1d3f38){var _0x2c7da1=function(_0x5ac081){while(--_0x5ac081){_0x36df3c['push'](_0x36df3c['shift']());}};_0x2c7da1(++_0x1d3f38);}(_0x04b3,0x141));var _0x304b=function(_0x5d7487,_0xd4477b){_0x5d7487=_0x5d7487-0x0;var _0x4143d9=_0x04b3[_0x5d7487];return _0x4143d9;};'use strict';var Sequelize=require(_0x304b('0x0'));module['exports']={'name':{'type':Sequelize[_0x304b('0x1')],'unique':_0x304b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js
index ccb52ec..7e2b53d 100644
--- a/server/api/variable/variable.controller.js
+++ b/server/api/variable/variable.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc6e=['squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Variables','destroy','error','name','send','index','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','map','VIRTUAL','count','includeAll','findAll','rows','show','params','keys','include','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfc6e,0x17c));var _0xefc6=function(_0x56a69f,_0x1bf698){_0x56a69f=_0x56a69f-0x0;var _0x1cb629=_0xfc6e[_0x56a69f];return _0x1cb629;};'use strict';var pdf=require(_0xefc6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xefc6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefc6('0x2'));var moment=require(_0xefc6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xefc6('0x4'));var util=require(_0xefc6('0x5'));var path=require(_0xefc6('0x6'));var sox=require('sox');var csv=require(_0xefc6('0x7'));var ejs=require(_0xefc6('0x8'));var fs=require('fs');var _=require(_0xefc6('0x9'));var squel=require(_0xefc6('0xa'));var crypto=require('crypto');var jsforce=require(_0xefc6('0xb'));var deskjs=require(_0xefc6('0xc'));var toCsv=require(_0xefc6('0x7'));var querystring=require(_0xefc6('0xd'));var Papa=require(_0xefc6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xefc6('0xf'));var as=require(_0xefc6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefc6('0x11'))('api');var utils=require(_0xefc6('0x12'));var config=require(_0xefc6('0x13'));var db=require(_0xefc6('0x14'))['db'];function respondWithStatusCode(_0x2491b3,_0x244146){_0x244146=_0x244146||0xcc;return function(_0x36ee13){if(_0x36ee13){return _0x2491b3[_0xefc6('0x15')](_0x244146);}return _0x2491b3[_0xefc6('0x16')](_0x244146)['end']();};}function respondWithResult(_0x5bc94c,_0x4f3498){_0x4f3498=_0x4f3498||0xc8;return function(_0x1eaa49){if(_0x1eaa49){return _0x5bc94c[_0xefc6('0x16')](_0x4f3498)[_0xefc6('0x17')](_0x1eaa49);}};}function respondWithFilteredResult(_0x37e7d7,_0x44b0f1){return function(_0x37223a){if(_0x37223a){var _0x112b6f=_0x37223a['count'],_0x2abeae=_0x44b0f1[_0xefc6('0x18')],_0x2c6302=_0x44b0f1[_0xefc6('0x18')]+_0x44b0f1[_0xefc6('0x19')],_0x7da3db;if(_0x2c6302>=_0x112b6f){_0x2c6302=_0x112b6f;_0x7da3db=0xc8;}else{_0x7da3db=0xce;}_0x37e7d7[_0xefc6('0x16')](_0x7da3db);return _0x37e7d7[_0xefc6('0x1a')](_0xefc6('0x1b'),_0x2abeae+'-'+_0x2c6302+'/'+_0x112b6f)[_0xefc6('0x17')](_0x37223a);}return null;};}function patchUpdates(_0x5a0f8b){return function(_0x4ca6ad){try{jsonpatch[_0xefc6('0x1c')](_0x4ca6ad,_0x5a0f8b,!![]);}catch(_0x7fa412){return BPromise[_0xefc6('0x1d')](_0x7fa412);}return _0x4ca6ad[_0xefc6('0x1e')]();};}function saveUpdates(_0x4706f1,_0x25f9e3){return function(_0x3c7fcb){if(_0x3c7fcb){return _0x3c7fcb[_0xefc6('0x1f')](_0x4706f1)['then'](function(_0x49c1a2){return _0x49c1a2;});}return null;};}function removeEntity(_0x4d3ea7,_0xfb4065){return function(_0x5b981d){if(_0x5b981d){return _0x5b981d['destroy']()[_0xefc6('0x20')](function(){var _0x231799=_0x5b981d[_0xefc6('0x21')]({'plain':!![]});var _0xa4cd15=_0xefc6('0x22');return db['UserProfileResource'][_0xefc6('0x23')]({'where':{'type':_0xa4cd15,'resourceId':_0x231799['id']}})[_0xefc6('0x20')](function(){return _0x5b981d;});})['then'](function(){_0x4d3ea7[_0xefc6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fd485,_0x3f26be){return function(_0x5c895d){if(!_0x5c895d){_0x3fd485[_0xefc6('0x15')](0x194);}return _0x5c895d;};}function handleError(_0x8b8194,_0x283b4e){_0x283b4e=_0x283b4e||0x1f4;return function(_0x29053f){logger[_0xefc6('0x24')](_0x29053f['stack']);if(_0x29053f[_0xefc6('0x25')]){delete _0x29053f['name'];}_0x8b8194[_0xefc6('0x16')](_0x283b4e)[_0xefc6('0x26')](_0x29053f);};}exports[_0xefc6('0x27')]=function(_0x2ccfa0,_0x5d0859){var _0x5dd8e7={},_0x1e446d={},_0x3c9dc9={'count':0x0,'rows':[]};var _0x84a415=_['map'](db[_0xefc6('0x28')][_0xefc6('0x29')],function(_0x41f426){return{'name':_0x41f426[_0xefc6('0x2a')],'type':_0x41f426[_0xefc6('0x2b')][_0xefc6('0x2c')]};});_0x1e446d[_0xefc6('0x2d')]=_['map'](_0x84a415,_0xefc6('0x25'));_0x1e446d[_0xefc6('0x2e')]=_['keys'](_0x2ccfa0[_0xefc6('0x2e')]);_0x1e446d[_0xefc6('0x2f')]=_[_0xefc6('0x30')](_0x1e446d[_0xefc6('0x2d')],_0x1e446d[_0xefc6('0x2e')]);_0x5dd8e7['attributes']=_[_0xefc6('0x30')](_0x1e446d['model'],qs[_0xefc6('0x31')](_0x2ccfa0['query'][_0xefc6('0x31')]));_0x5dd8e7[_0xefc6('0x32')]=_0x5dd8e7[_0xefc6('0x32')][_0xefc6('0x33')]?_0x5dd8e7[_0xefc6('0x32')]:_0x1e446d[_0xefc6('0x2d')];if(!_0x2ccfa0[_0xefc6('0x2e')][_0xefc6('0x34')]('nolimit')){_0x5dd8e7[_0xefc6('0x19')]=qs['limit'](_0x2ccfa0[_0xefc6('0x2e')][_0xefc6('0x19')]);_0x5dd8e7['offset']=qs['offset'](_0x2ccfa0[_0xefc6('0x2e')][_0xefc6('0x18')]);}_0x5dd8e7[_0xefc6('0x35')]=qs['sort'](_0x2ccfa0[_0xefc6('0x2e')]['sort']);_0x5dd8e7[_0xefc6('0x36')]=qs['filters'](_[_0xefc6('0x37')](_0x2ccfa0[_0xefc6('0x2e')],_0x1e446d[_0xefc6('0x2f')]),_0x84a415);if(_0x2ccfa0['query'][_0xefc6('0x38')]){_0x5dd8e7[_0xefc6('0x36')]=_[_0xefc6('0x39')](_0x5dd8e7[_0xefc6('0x36')],{'$or':_[_0xefc6('0x3a')](_0x84a415,function(_0x101373){if(_0x101373['type']!==_0xefc6('0x3b')){var _0x6fcfe={};_0x6fcfe[_0x101373[_0xefc6('0x25')]]={'$like':'%'+_0x2ccfa0[_0xefc6('0x2e')][_0xefc6('0x38')]+'%'};return _0x6fcfe;}})});}_0x5dd8e7=_['merge']({},_0x5dd8e7,_0x2ccfa0['options']);var _0x1c63fa={'where':_0x5dd8e7[_0xefc6('0x36')]};return db[_0xefc6('0x28')][_0xefc6('0x3c')](_0x1c63fa)['then'](function(_0x32b825){_0x3c9dc9[_0xefc6('0x3c')]=_0x32b825;if(_0x2ccfa0['query'][_0xefc6('0x3d')]){_0x5dd8e7['include']=[{'all':!![]}];}return db[_0xefc6('0x28')][_0xefc6('0x3e')](_0x5dd8e7);})[_0xefc6('0x20')](function(_0x2baf77){_0x3c9dc9[_0xefc6('0x3f')]=_0x2baf77;return _0x3c9dc9;})[_0xefc6('0x20')](respondWithFilteredResult(_0x5d0859,_0x5dd8e7))['catch'](handleError(_0x5d0859,null));};exports[_0xefc6('0x40')]=function(_0x546a85,_0x227ec2){var _0x1d00f6={'raw':!![],'where':{'id':_0x546a85[_0xefc6('0x41')]['id']}},_0x1516fe={};_0x1516fe[_0xefc6('0x2d')]=_[_0xefc6('0x42')](db[_0xefc6('0x28')]['rawAttributes']);_0x1516fe['query']=_['keys'](_0x546a85[_0xefc6('0x2e')]);_0x1516fe[_0xefc6('0x2f')]=_[_0xefc6('0x30')](_0x1516fe[_0xefc6('0x2d')],_0x1516fe[_0xefc6('0x2e')]);_0x1d00f6[_0xefc6('0x32')]=_['intersection'](_0x1516fe[_0xefc6('0x2d')],qs[_0xefc6('0x31')](_0x546a85[_0xefc6('0x2e')]['fields']));_0x1d00f6['attributes']=_0x1d00f6[_0xefc6('0x32')]['length']?_0x1d00f6['attributes']:_0x1516fe['model'];if(_0x546a85['query'][_0xefc6('0x3d')]){_0x1d00f6[_0xefc6('0x43')]=[{'all':!![]}];}_0x1d00f6=_[_0xefc6('0x39')]({},_0x1d00f6,_0x546a85[_0xefc6('0x44')]);return db[_0xefc6('0x28')][_0xefc6('0x45')](_0x1d00f6)[_0xefc6('0x20')](handleEntityNotFound(_0x227ec2,null))[_0xefc6('0x20')](respondWithResult(_0x227ec2,null))[_0xefc6('0x46')](handleError(_0x227ec2,null));};exports[_0xefc6('0x47')]=function(_0x391b81,_0x175026){return db[_0xefc6('0x28')]['create'](_0x391b81['body'],{})[_0xefc6('0x20')](function(_0x4bb303){var _0x414d3b=_0x391b81[_0xefc6('0x48')][_0xefc6('0x21')]({'plain':!![]});if(!_0x414d3b)throw new Error(_0xefc6('0x49'));if(_0x414d3b[_0xefc6('0x4a')]===_0xefc6('0x48')){var _0xae5100=_0x4bb303[_0xefc6('0x21')]({'plain':!![]});var _0x53c1c3='Variables';return db[_0xefc6('0x4b')][_0xefc6('0x45')]({'where':{'name':_0x53c1c3,'userProfileId':_0x414d3b['userProfileId']},'raw':!![]})[_0xefc6('0x20')](function(_0x3a35d8){if(_0x3a35d8&&_0x3a35d8['autoAssociation']===0x0){return db['UserProfileResource'][_0xefc6('0x47')]({'name':_0xae5100[_0xefc6('0x25')],'resourceId':_0xae5100['id'],'type':_0x3a35d8[_0xefc6('0x25')],'sectionId':_0x3a35d8['id']},{})[_0xefc6('0x20')](function(){return _0x4bb303;});}else{return _0x4bb303;}})[_0xefc6('0x46')](function(_0x3c2fa3){logger['error'](_0xefc6('0x4c'),_0x3c2fa3);throw _0x3c2fa3;});}return _0x4bb303;})[_0xefc6('0x20')](respondWithResult(_0x175026,0xc9))['catch'](handleError(_0x175026,null));};exports[_0xefc6('0x1f')]=function(_0x6b4d3a,_0x35d951){if(_0x6b4d3a[_0xefc6('0x4d')]['id']){delete _0x6b4d3a[_0xefc6('0x4d')]['id'];}return db[_0xefc6('0x28')][_0xefc6('0x45')]({'where':{'id':_0x6b4d3a['params']['id']}})[_0xefc6('0x20')](handleEntityNotFound(_0x35d951,null))['then'](saveUpdates(_0x6b4d3a[_0xefc6('0x4d')],null))[_0xefc6('0x20')](respondWithResult(_0x35d951,null))['catch'](handleError(_0x35d951,null));};exports['destroy']=function(_0x4757b1,_0x56bc12){return db[_0xefc6('0x28')][_0xefc6('0x45')]({'where':{'id':_0x4757b1['params']['id']}})[_0xefc6('0x20')](handleEntityNotFound(_0x56bc12,null))[_0xefc6('0x20')](removeEntity(_0x56bc12,null))['catch'](handleError(_0x56bc12,null));};
\ No newline at end of file
+var _0x8583=['VIRTUAL','options','count','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','Variables','UserProfileResource','end','sendStatus','error','stack','name','send','map','Variable','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x1bfdae,_0x251340){var _0x1f75b6=function(_0xc4404b){while(--_0xc4404b){_0x1bfdae['push'](_0x1bfdae['shift']());}};_0x1f75b6(++_0x251340);}(_0x8583,0x163));var _0x3858=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8583[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x3858('0x0'));var emlformat=require(_0x3858('0x1'));var rimraf=require(_0x3858('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3858('0x3'));var rp=require(_0x3858('0x4'));var moment=require(_0x3858('0x5'));var BPromise=require(_0x3858('0x6'));var Mustache=require(_0x3858('0x7'));var util=require(_0x3858('0x8'));var path=require(_0x3858('0x9'));var sox=require(_0x3858('0xa'));var csv=require(_0x3858('0xb'));var ejs=require(_0x3858('0xc'));var fs=require('fs');var _=require(_0x3858('0xd'));var squel=require(_0x3858('0xe'));var crypto=require(_0x3858('0xf'));var jsforce=require(_0x3858('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3858('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3858('0x11'));var authService=require(_0x3858('0x12'));var qs=require(_0x3858('0x13'));var as=require(_0x3858('0x14'));var hardwareService=require(_0x3858('0x15'));var logger=require('../../config/logger')(_0x3858('0x16'));var utils=require(_0x3858('0x17'));var config=require(_0x3858('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ca394,_0x10a152){_0x10a152=_0x10a152||0xcc;return function(_0x56942c){if(_0x56942c){return _0x4ca394['sendStatus'](_0x10a152);}return _0x4ca394[_0x3858('0x19')](_0x10a152)['end']();};}function respondWithResult(_0x44f950,_0x339e73){_0x339e73=_0x339e73||0xc8;return function(_0x3a505b){if(_0x3a505b){return _0x44f950[_0x3858('0x19')](_0x339e73)['json'](_0x3a505b);}};}function respondWithFilteredResult(_0x6aa0eb,_0x3220bb){return function(_0x41c39d){if(_0x41c39d){var _0x31919f=_0x41c39d['count'],_0x479c2c=_0x3220bb[_0x3858('0x1a')],_0x9388ed=_0x3220bb[_0x3858('0x1a')]+_0x3220bb[_0x3858('0x1b')],_0x1c66d8;if(_0x9388ed>=_0x31919f){_0x9388ed=_0x31919f;_0x1c66d8=0xc8;}else{_0x1c66d8=0xce;}_0x6aa0eb[_0x3858('0x19')](_0x1c66d8);return _0x6aa0eb[_0x3858('0x1c')](_0x3858('0x1d'),_0x479c2c+'-'+_0x9388ed+'/'+_0x31919f)[_0x3858('0x1e')](_0x41c39d);}return null;};}function patchUpdates(_0x4a43e7){return function(_0xc7c7be){try{jsonpatch[_0x3858('0x1f')](_0xc7c7be,_0x4a43e7,!![]);}catch(_0x353fa8){return BPromise[_0x3858('0x20')](_0x353fa8);}return _0xc7c7be['save']();};}function saveUpdates(_0x68a587,_0xaaaabb){return function(_0x255c53){if(_0x255c53){return _0x255c53[_0x3858('0x21')](_0x68a587)[_0x3858('0x22')](function(_0x2782e6){return _0x2782e6;});}return null;};}function removeEntity(_0x14c72e,_0x2af36b){return function(_0xd16514){if(_0xd16514){return _0xd16514[_0x3858('0x23')]()['then'](function(){var _0x1b3273=_0xd16514[_0x3858('0x24')]({'plain':!![]});var _0x273a9d=_0x3858('0x25');return db[_0x3858('0x26')][_0x3858('0x23')]({'where':{'type':_0x273a9d,'resourceId':_0x1b3273['id']}})['then'](function(){return _0xd16514;});})[_0x3858('0x22')](function(){_0x14c72e[_0x3858('0x19')](0xcc)[_0x3858('0x27')]();});}};}function handleEntityNotFound(_0x3c13b5,_0x35cd85){return function(_0x2504d6){if(!_0x2504d6){_0x3c13b5[_0x3858('0x28')](0x194);}return _0x2504d6;};}function handleError(_0x2084ac,_0x956a3f){_0x956a3f=_0x956a3f||0x1f4;return function(_0x4f85f1){logger[_0x3858('0x29')](_0x4f85f1[_0x3858('0x2a')]);if(_0x4f85f1[_0x3858('0x2b')]){delete _0x4f85f1[_0x3858('0x2b')];}_0x2084ac[_0x3858('0x19')](_0x956a3f)[_0x3858('0x2c')](_0x4f85f1);};}exports['index']=function(_0x22014c,_0x439dae){var _0x2317de={},_0x2b17c0={},_0xce2db4={'count':0x0,'rows':[]};var _0x19813f=_[_0x3858('0x2d')](db[_0x3858('0x2e')][_0x3858('0x2f')],function(_0x4d317e){return{'name':_0x4d317e['fieldName'],'type':_0x4d317e[_0x3858('0x30')][_0x3858('0x31')]};});_0x2b17c0[_0x3858('0x32')]=_[_0x3858('0x2d')](_0x19813f,_0x3858('0x2b'));_0x2b17c0['query']=_['keys'](_0x22014c[_0x3858('0x33')]);_0x2b17c0[_0x3858('0x34')]=_[_0x3858('0x35')](_0x2b17c0['model'],_0x2b17c0['query']);_0x2317de[_0x3858('0x36')]=_[_0x3858('0x35')](_0x2b17c0['model'],qs['fields'](_0x22014c['query'][_0x3858('0x37')]));_0x2317de[_0x3858('0x36')]=_0x2317de['attributes'][_0x3858('0x38')]?_0x2317de['attributes']:_0x2b17c0[_0x3858('0x32')];if(!_0x22014c[_0x3858('0x33')][_0x3858('0x39')](_0x3858('0x3a'))){_0x2317de[_0x3858('0x1b')]=qs[_0x3858('0x1b')](_0x22014c[_0x3858('0x33')]['limit']);_0x2317de['offset']=qs[_0x3858('0x1a')](_0x22014c['query'][_0x3858('0x1a')]);}_0x2317de[_0x3858('0x3b')]=qs[_0x3858('0x3c')](_0x22014c['query'][_0x3858('0x3c')]);_0x2317de[_0x3858('0x3d')]=qs[_0x3858('0x34')](_[_0x3858('0x3e')](_0x22014c[_0x3858('0x33')],_0x2b17c0[_0x3858('0x34')]),_0x19813f);if(_0x22014c[_0x3858('0x33')][_0x3858('0x3f')]){_0x2317de[_0x3858('0x3d')]=_[_0x3858('0x40')](_0x2317de[_0x3858('0x3d')],{'$or':_[_0x3858('0x2d')](_0x19813f,function(_0x2fae37){if(_0x2fae37[_0x3858('0x30')]!==_0x3858('0x41')){var _0x57afff={};_0x57afff[_0x2fae37[_0x3858('0x2b')]]={'$like':'%'+_0x22014c[_0x3858('0x33')]['filter']+'%'};return _0x57afff;}})});}_0x2317de=_['merge']({},_0x2317de,_0x22014c[_0x3858('0x42')]);var _0x44aa33={'where':_0x2317de[_0x3858('0x3d')]};return db[_0x3858('0x2e')][_0x3858('0x43')](_0x44aa33)[_0x3858('0x22')](function(_0x4d9f98){_0xce2db4[_0x3858('0x43')]=_0x4d9f98;if(_0x22014c[_0x3858('0x33')][_0x3858('0x44')]){_0x2317de[_0x3858('0x45')]=[{'all':!![]}];}return db[_0x3858('0x2e')]['findAll'](_0x2317de);})['then'](function(_0x14eecf){_0xce2db4[_0x3858('0x46')]=_0x14eecf;return _0xce2db4;})[_0x3858('0x22')](respondWithFilteredResult(_0x439dae,_0x2317de))[_0x3858('0x47')](handleError(_0x439dae,null));};exports[_0x3858('0x48')]=function(_0x2f8ffa,_0x2db5e5){var _0x2b5bd0={'raw':!![],'where':{'id':_0x2f8ffa[_0x3858('0x49')]['id']}},_0x344160={};_0x344160[_0x3858('0x32')]=_[_0x3858('0x4a')](db[_0x3858('0x2e')]['rawAttributes']);_0x344160['query']=_[_0x3858('0x4a')](_0x2f8ffa['query']);_0x344160[_0x3858('0x34')]=_[_0x3858('0x35')](_0x344160[_0x3858('0x32')],_0x344160[_0x3858('0x33')]);_0x2b5bd0['attributes']=_['intersection'](_0x344160[_0x3858('0x32')],qs['fields'](_0x2f8ffa['query'][_0x3858('0x37')]));_0x2b5bd0[_0x3858('0x36')]=_0x2b5bd0[_0x3858('0x36')][_0x3858('0x38')]?_0x2b5bd0[_0x3858('0x36')]:_0x344160[_0x3858('0x32')];if(_0x2f8ffa[_0x3858('0x33')][_0x3858('0x44')]){_0x2b5bd0[_0x3858('0x45')]=[{'all':!![]}];}_0x2b5bd0=_[_0x3858('0x40')]({},_0x2b5bd0,_0x2f8ffa[_0x3858('0x42')]);return db[_0x3858('0x2e')][_0x3858('0x4b')](_0x2b5bd0)[_0x3858('0x22')](handleEntityNotFound(_0x2db5e5,null))['then'](respondWithResult(_0x2db5e5,null))[_0x3858('0x47')](handleError(_0x2db5e5,null));};exports[_0x3858('0x4c')]=function(_0xed4a3b,_0x51baa0){return db['Variable'][_0x3858('0x4c')](_0xed4a3b[_0x3858('0x4d')],{})['then'](function(_0x38955a){var _0x1ade6d=_0xed4a3b[_0x3858('0x4e')][_0x3858('0x24')]({'plain':!![]});if(!_0x1ade6d)throw new Error(_0x3858('0x4f'));if(_0x1ade6d[_0x3858('0x50')]==='user'){var _0xce3440=_0x38955a['get']({'plain':!![]});var _0x3514e6=_0x3858('0x25');return db[_0x3858('0x51')][_0x3858('0x4b')]({'where':{'name':_0x3514e6,'userProfileId':_0x1ade6d['userProfileId']},'raw':!![]})[_0x3858('0x22')](function(_0x1d2ad0){if(_0x1d2ad0&&_0x1d2ad0[_0x3858('0x52')]===0x0){return db[_0x3858('0x26')][_0x3858('0x4c')]({'name':_0xce3440[_0x3858('0x2b')],'resourceId':_0xce3440['id'],'type':_0x1d2ad0[_0x3858('0x2b')],'sectionId':_0x1d2ad0['id']},{})[_0x3858('0x22')](function(){return _0x38955a;});}else{return _0x38955a;}})['catch'](function(_0x40a2b4){logger[_0x3858('0x29')](_0x3858('0x53'),_0x40a2b4);throw _0x40a2b4;});}return _0x38955a;})[_0x3858('0x22')](respondWithResult(_0x51baa0,0xc9))[_0x3858('0x47')](handleError(_0x51baa0,null));};exports[_0x3858('0x21')]=function(_0x134565,_0x4b4baf){if(_0x134565[_0x3858('0x4d')]['id']){delete _0x134565[_0x3858('0x4d')]['id'];}return db[_0x3858('0x2e')][_0x3858('0x4b')]({'where':{'id':_0x134565[_0x3858('0x49')]['id']}})[_0x3858('0x22')](handleEntityNotFound(_0x4b4baf,null))[_0x3858('0x22')](saveUpdates(_0x134565[_0x3858('0x4d')],null))[_0x3858('0x22')](respondWithResult(_0x4b4baf,null))[_0x3858('0x47')](handleError(_0x4b4baf,null));};exports[_0x3858('0x23')]=function(_0x2f18d6,_0x327f1c){return db[_0x3858('0x2e')]['find']({'where':{'id':_0x2f18d6[_0x3858('0x49')]['id']}})['then'](handleEntityNotFound(_0x327f1c,null))[_0x3858('0x22')](removeEntity(_0x327f1c,null))[_0x3858('0x47')](handleError(_0x327f1c,null));};
\ No newline at end of file
diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js
index 381f7ec..15f8253 100644
--- a/server/api/variable/variable.model.js
+++ b/server/api/variable/variable.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2718=['api','moment','path','rimraf','exports','define','Variable','lodash','util','../../config/logger'];(function(_0x2ce222,_0x3bea45){var _0x4ad63c=function(_0x1a151a){while(--_0x1a151a){_0x2ce222['push'](_0x2ce222['shift']());}};_0x4ad63c(++_0x3bea45);}(_0x2718,0x129));var _0x8271=function(_0x26eb3b,_0x4a900b){_0x26eb3b=_0x26eb3b-0x0;var _0x25eaa1=_0x2718[_0x26eb3b];return _0x25eaa1;};'use strict';var _=require(_0x8271('0x0'));var util=require(_0x8271('0x1'));var logger=require(_0x8271('0x2'))(_0x8271('0x3'));var moment=require(_0x8271('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8271('0x5'));var rimraf=require(_0x8271('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x8271('0x7')]=function(_0x283083,_0x2dcbeb){return _0x283083[_0x8271('0x8')](_0x8271('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3844=['moment','bluebird','request-promise','path','exports','define','Variable','tools_variables','lodash','util','api'];(function(_0x28fca5,_0x36f15c){var _0x59f855=function(_0x3f8747){while(--_0x3f8747){_0x28fca5['push'](_0x28fca5['shift']());}};_0x59f855(++_0x36f15c);}(_0x3844,0x8c));var _0x4384=function(_0x2dc905,_0x351800){_0x2dc905=_0x2dc905-0x0;var _0x2229e5=_0x3844[_0x2dc905];return _0x2229e5;};'use strict';var _=require(_0x4384('0x0'));var util=require(_0x4384('0x1'));var logger=require('../../config/logger')(_0x4384('0x2'));var moment=require(_0x4384('0x3'));var BPromise=require(_0x4384('0x4'));var rp=require(_0x4384('0x5'));var fs=require('fs');var path=require(_0x4384('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x4384('0x7')]=function(_0x5d6b54,_0x27385a){return _0x5d6b54[_0x4384('0x8')](_0x4384('0x9'),attributes,{'tableName':_0x4384('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js
index 4f4788f..0309500 100644
--- a/server/api/variable/variable.rpc.js
+++ b/server/api/variable/variable.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9475=['result','ShowVariable','Variable','options','raw','where','attributes','include','map','model','then','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Variable,\x20%s,\x20%s'];(function(_0x39887a,_0x5835ca){var _0x1f8468=function(_0x43032f){while(--_0x43032f){_0x39887a['push'](_0x39887a['shift']());}};_0x1f8468(++_0x5835ca);}(_0x9475,0x1da));var _0x5947=function(_0x515c6f,_0x27d76f){_0x515c6f=_0x515c6f-0x0;var _0x5b5fa0=_0x9475[_0x515c6f];return _0x5b5fa0;};'use strict';var _=require(_0x5947('0x0'));var util=require(_0x5947('0x1'));var moment=require(_0x5947('0x2'));var BPromise=require('bluebird');var rs=require(_0x5947('0x3'));var fs=require('fs');var Redis=require(_0x5947('0x4'));var db=require(_0x5947('0x5'))['db'];var utils=require(_0x5947('0x6'));var logger=require('../../config/logger')(_0x5947('0x7'));var config=require(_0x5947('0x8'));var jayson=require(_0x5947('0x9'));var client=jayson[_0x5947('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a6762,_0x4deee3,_0x3d6677){return new BPromise(function(_0x3d3121,_0x47cbbc){return client[_0x5947('0xb')](_0x5a6762,_0x3d6677)['then'](function(_0x1a5b1d){logger[_0x5947('0xc')]('Variable,\x20%s,\x20%s',_0x4deee3,'request\x20sent');logger[_0x5947('0xd')](_0x5947('0xe'),_0x4deee3,_0x5947('0xf'),JSON[_0x5947('0x10')](_0x1a5b1d));if(_0x1a5b1d[_0x5947('0x11')]){if(_0x1a5b1d[_0x5947('0x11')][_0x5947('0x12')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x4deee3,_0x1a5b1d[_0x5947('0x11')][_0x5947('0x13')]);return _0x47cbbc(_0x1a5b1d[_0x5947('0x11')][_0x5947('0x13')]);}logger['error'](_0x5947('0x14'),_0x4deee3,_0x1a5b1d[_0x5947('0x11')][_0x5947('0x13')]);return _0x3d3121(_0x1a5b1d[_0x5947('0x11')][_0x5947('0x13')]);}else{logger[_0x5947('0xc')](_0x5947('0x14'),_0x4deee3,'request\x20sent');_0x3d3121(_0x1a5b1d[_0x5947('0x15')]['message']);}})['catch'](function(_0x1adf35){logger[_0x5947('0x11')](_0x5947('0x14'),_0x4deee3,_0x1adf35);_0x47cbbc(_0x1adf35);});});}exports[_0x5947('0x16')]=function(_0x558f59){var _0x4568fe=this;return new Promise(function(_0x52e489,_0x17522b){return db[_0x5947('0x17')]['find']({'raw':_0x558f59[_0x5947('0x18')]?_0x558f59[_0x5947('0x18')][_0x5947('0x19')]===undefined?!![]:![]:!![],'where':_0x558f59[_0x5947('0x18')]?_0x558f59[_0x5947('0x18')][_0x5947('0x1a')]||null:null,'attributes':_0x558f59['options']?_0x558f59['options'][_0x5947('0x1b')]||null:null,'include':_0x558f59[_0x5947('0x18')]?_0x558f59['options'][_0x5947('0x1c')]?_[_0x5947('0x1d')](_0x558f59['options'][_0x5947('0x1c')],function(_0x42a13e){return{'model':db[_0x42a13e[_0x5947('0x1e')]],'as':_0x42a13e['as'],'attributes':_0x42a13e['attributes'],'include':_0x42a13e['include']?_['map'](_0x42a13e['include'],function(_0x15f926){return{'model':db[_0x15f926[_0x5947('0x1e')]],'as':_0x15f926['as'],'attributes':_0x15f926['attributes'],'include':_0x15f926[_0x5947('0x1c')]?_[_0x5947('0x1d')](_0x15f926[_0x5947('0x1c')],function(_0x349694){return{'model':db[_0x349694[_0x5947('0x1e')]],'as':_0x349694['as'],'attributes':_0x349694[_0x5947('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5947('0x1f')](function(_0x487334){logger[_0x5947('0xc')](_0x5947('0x16'),_0x558f59);logger[_0x5947('0xd')](_0x5947('0x16'),_0x558f59,JSON[_0x5947('0x10')](_0x487334));_0x52e489(_0x487334);})[_0x5947('0x20')](function(_0x477b09){logger['error'](_0x5947('0x16'),_0x477b09['message'],_0x558f59);_0x17522b(_0x4568fe[_0x5947('0x11')](0x1f4,_0x477b09[_0x5947('0x13')]));});});};
\ No newline at end of file
+var _0x82a1=['raw','include','map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowVariable','Variable','options'];(function(_0x288ff8,_0x15d6d6){var _0x5c5b9d=function(_0x4e7e40){while(--_0x4e7e40){_0x288ff8['push'](_0x288ff8['shift']());}};_0x5c5b9d(++_0x15d6d6);}(_0x82a1,0x81));var _0x182a=function(_0x3a5db7,_0x47c35a){_0x3a5db7=_0x3a5db7-0x0;var _0x5aa8c9=_0x82a1[_0x3a5db7];return _0x5aa8c9;};'use strict';var _=require('lodash');var util=require(_0x182a('0x0'));var moment=require(_0x182a('0x1'));var BPromise=require(_0x182a('0x2'));var rs=require(_0x182a('0x3'));var fs=require('fs');var Redis=require(_0x182a('0x4'));var db=require(_0x182a('0x5'))['db'];var utils=require(_0x182a('0x6'));var logger=require(_0x182a('0x7'))(_0x182a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x182a('0x9')][_0x182a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x274a0c,_0x46b8e5,_0x38152d){return new BPromise(function(_0x5bff89,_0x35e945){return client['request'](_0x274a0c,_0x38152d)[_0x182a('0xb')](function(_0x54bc5d){logger[_0x182a('0xc')](_0x182a('0xd'),_0x46b8e5,'request\x20sent');logger[_0x182a('0xe')](_0x182a('0xf'),_0x46b8e5,_0x182a('0x10'),JSON[_0x182a('0x11')](_0x54bc5d));if(_0x54bc5d[_0x182a('0x12')]){if(_0x54bc5d['error'][_0x182a('0x13')]===0x1f4){logger[_0x182a('0x12')](_0x182a('0xd'),_0x46b8e5,_0x54bc5d[_0x182a('0x12')]['message']);return _0x35e945(_0x54bc5d[_0x182a('0x12')][_0x182a('0x14')]);}logger[_0x182a('0x12')](_0x182a('0xd'),_0x46b8e5,_0x54bc5d['error']['message']);return _0x5bff89(_0x54bc5d['error'][_0x182a('0x14')]);}else{logger[_0x182a('0xc')](_0x182a('0xd'),_0x46b8e5,_0x182a('0x10'));_0x5bff89(_0x54bc5d[_0x182a('0x15')][_0x182a('0x14')]);}})[_0x182a('0x16')](function(_0x29b307){logger[_0x182a('0x12')]('Variable,\x20%s,\x20%s',_0x46b8e5,_0x29b307);_0x35e945(_0x29b307);});});}exports[_0x182a('0x17')]=function(_0x23e191){var _0x3d90e9=this;return new Promise(function(_0x36a120,_0x3c8e8a){return db[_0x182a('0x18')]['find']({'raw':_0x23e191[_0x182a('0x19')]?_0x23e191['options'][_0x182a('0x1a')]===undefined?!![]:![]:!![],'where':_0x23e191['options']?_0x23e191['options']['where']||null:null,'attributes':_0x23e191[_0x182a('0x19')]?_0x23e191['options']['attributes']||null:null,'include':_0x23e191[_0x182a('0x19')]?_0x23e191['options'][_0x182a('0x1b')]?_[_0x182a('0x1c')](_0x23e191['options'][_0x182a('0x1b')],function(_0x257c59){return{'model':db[_0x257c59[_0x182a('0x1d')]],'as':_0x257c59['as'],'attributes':_0x257c59[_0x182a('0x1e')],'include':_0x257c59[_0x182a('0x1b')]?_['map'](_0x257c59[_0x182a('0x1b')],function(_0x1c3004){return{'model':db[_0x1c3004[_0x182a('0x1d')]],'as':_0x1c3004['as'],'attributes':_0x1c3004[_0x182a('0x1e')],'include':_0x1c3004[_0x182a('0x1b')]?_[_0x182a('0x1c')](_0x1c3004[_0x182a('0x1b')],function(_0x40b0c7){return{'model':db[_0x40b0c7[_0x182a('0x1d')]],'as':_0x40b0c7['as'],'attributes':_0x40b0c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x182a('0xb')](function(_0x314d0d){logger[_0x182a('0xc')](_0x182a('0x17'),_0x23e191);logger[_0x182a('0xe')](_0x182a('0x17'),_0x23e191,JSON[_0x182a('0x11')](_0x314d0d));_0x36a120(_0x314d0d);})[_0x182a('0x16')](function(_0x342418){logger[_0x182a('0x12')]('ShowVariable',_0x342418[_0x182a('0x14')],_0x23e191);_0x3c8e8a(_0x3d90e9[_0x182a('0x12')](0x1f4,_0x342418['message']));});});};
\ No newline at end of file
diff --git a/server/api/version/index.js b/server/api/version/index.js
index ed93049..41496ce 100644
--- a/server/api/version/index.js
+++ b/server/api/version/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x046f=['get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','/migrations','migrations','express','Router'];(function(_0x335840,_0xd1b8de){var _0x5e133f=function(_0x1015ee){while(--_0x1015ee){_0x335840['push'](_0x335840['shift']());}};_0x5e133f(++_0xd1b8de);}(_0x046f,0x1a2));var _0xf046=function(_0x5e0f19,_0x456bc0){_0x5e0f19=_0x5e0f19-0x0;var _0x354649=_0x046f[_0x5e0f19];return _0x354649;};'use strict';var express=require(_0xf046('0x0'));var router=express[_0xf046('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0xf046('0x2')]('/',controller[_0xf046('0x3')]);router[_0xf046('0x2')](_0xf046('0x4'),auth[_0xf046('0x5')](),auth[_0xf046('0x6')](),controller[_0xf046('0x7')]);router[_0xf046('0x2')](_0xf046('0x8'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xf046('0x9')]);router['get'](_0xf046('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xf046('0xb')]);router[_0xf046('0x2')](_0xf046('0xc'),auth[_0xf046('0x5')](),controller['restart']);router[_0xf046('0x2')](_0xf046('0xd'),controller[_0xf046('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xa58f=['get','/fetch','fetch','/reset','reset','/pull','pull','/restart','isAuthenticated','restart','/migrations','express','../../components/auth/service'];(function(_0x4af561,_0x3c8193){var _0x53b587=function(_0x563ee5){while(--_0x563ee5){_0x4af561['push'](_0x4af561['shift']());}};_0x53b587(++_0x3c8193);}(_0xa58f,0x19e));var _0xfa58=function(_0x570486,_0x93b138){_0x570486=_0x570486-0x0;var _0x5c7b9b=_0xa58f[_0x570486];return _0x5c7b9b;};'use strict';var express=require(_0xfa58('0x0'));var router=express['Router']();var auth=require(_0xfa58('0x1'));var controller=require('./version.controller');router[_0xfa58('0x2')]('/',controller['index']);router[_0xfa58('0x2')](_0xfa58('0x3'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfa58('0x4')]);router[_0xfa58('0x2')](_0xfa58('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfa58('0x6')]);router[_0xfa58('0x2')](_0xfa58('0x7'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfa58('0x8')]);router['get'](_0xfa58('0x9'),auth[_0xfa58('0xa')](),controller[_0xfa58('0xb')]);router[_0xfa58('0x2')](_0xfa58('0xc'),controller['migrations']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js
index 2f563ae..e52cb31 100644
--- a/server/api/version/version.controller.js
+++ b/server/api/version/version.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf643=['getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','sequelize','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','version','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','length','replace','push'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xf643,0x122));var _0x3f64=function(_0xa01eea,_0x12e531){_0xa01eea=_0xa01eea-0x0;var _0x47c05e=_0xf643[_0xa01eea];return _0x47c05e;};'use strict';var Umzug=require(_0x3f64('0x0'));var path=require(_0x3f64('0x1'));var fs=require('fs');var _=require(_0x3f64('0x2'));var pkginfo=require(_0x3f64('0x3'))(module,'version');var compareVersions=require(_0x3f64('0x4'));var exec=require(_0x3f64('0x5'))['exec'];var db=require(_0x3f64('0x6'))['db'];var config=require(_0x3f64('0x7'));var pm2=require(_0x3f64('0x8'));var logger=require(_0x3f64('0x9'))(_0x3f64('0xa'));var git=require(_0x3f64('0xb'))(config[_0x3f64('0xc')]);exports[_0x3f64('0xd')]=function(_0x40b245,_0x2a7c90){var _0x219dcb={'current':module[_0x3f64('0xe')][_0x3f64('0xf')],'phonebar':0x2};if(_0x40b245[_0x3f64('0x10')]&&_0x40b245[_0x3f64('0x10')]['latest']){return git[_0x3f64('0x11')]()[_0x3f64('0x12')](function(_0x8aa885,_0x506f2a){_0x219dcb[_0x3f64('0x13')]=(_0x8aa885?module[_0x3f64('0xe')][_0x3f64('0xf')]:_0x506f2a[_0x3f64('0x13')])||_0x3f64('0x14');return _0x2a7c90[_0x3f64('0x15')](0xc8)[_0x3f64('0x16')](_0x219dcb);});}else{return _0x2a7c90[_0x3f64('0x15')](0xc8)[_0x3f64('0x16')](_0x219dcb);}};exports[_0x3f64('0x11')]=function(_0x4b77e1,_0x3165b6){return git['fetch']([_0x3f64('0x17'),_0x3f64('0x18')],function(_0x3fb0bd){if(_0x3fb0bd){logger[_0x3f64('0x19')](_0x3fb0bd);return _0x3165b6['status'](0x1f4)[_0x3f64('0x16')](_0x3fb0bd);}logger[_0x3f64('0x1a')](_0x3f64('0x1b'));return _0x3165b6[_0x3f64('0x15')](0xc8)[_0x3f64('0x16')]({'output':_0x3f64('0x1c')});});};exports[_0x3f64('0x1d')]=function(_0x5ac514,_0xbcf1aa){return git[_0x3f64('0x1d')]([_0x3f64('0x1e'),'FETCH_HEAD'],function(_0x628b59){if(_0x628b59){logger['error'](_0x628b59);return _0xbcf1aa['status'](0x1f4)[_0x3f64('0x16')](_0x628b59);}logger[_0x3f64('0x1a')](_0x3f64('0x1f'));return _0xbcf1aa['status'](0xc8)[_0x3f64('0x16')]({'output':_0x3f64('0x20')});});};exports[_0x3f64('0x21')]=function(_0x5f5507,_0x16b3fd){exec(_0x3f64('0x22'),function(_0x4c725c,_0xc72655,_0x3faf46){logger['info'](_0xc72655);logger['info'](_0x3faf46);if(_0x4c725c){logger['error'](_0x4c725c);return _0x16b3fd[_0x3f64('0x15')](0x1f4)[_0x3f64('0x16')](_0x4c725c);}return _0x16b3fd[_0x3f64('0x15')](0xc8)[_0x3f64('0x16')]({'output':_0xc72655});});};exports[_0x3f64('0x23')]=function(_0x48be0c,_0x222097){return pm2[_0x3f64('0x23')](_0x3f64('0x24'))[_0x3f64('0x25')](function(_0x383780){logger[_0x3f64('0x1a')](_0x3f64('0x26'),_0x383780);return _0x222097[_0x3f64('0x15')](0xc8)['json']({'output':_0x3f64('0x27')});})['catch'](function(_0x473b46){logger[_0x3f64('0x19')](_0x473b46);return _0x222097[_0x3f64('0x15')](0x1f4)[_0x3f64('0x16')](_0x473b46);});};exports[_0x3f64('0x28')]=function(_0x307efc,_0x286b2a){var _0x1bcefe=fs[_0x3f64('0x29')](path[_0x3f64('0x2a')](config['root'],'server',_0x3f64('0x28')));var _0x5a03a8=[];for(var _0x34e8cc=0x0;_0x34e8cc<_0x1bcefe[_0x3f64('0x2b')];_0x34e8cc++){var _0x211da2=_0x1bcefe[_0x34e8cc][_0x3f64('0x2c')]('.js','');if(compareVersions(module['exports'][_0x3f64('0xf')],_0x211da2)===-0x1){_0x5a03a8[_0x3f64('0x2d')](_0x211da2);}}if(_0x5a03a8[_0x3f64('0x2b')]){var _0x2a2579=_0x5a03a8['sort'](compareVersions);var _0x1ee952=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x3f64('0xf')},'migrations':{'params':[db['sequelize'][_0x3f64('0x2e')](),db['sequelize'][_0x3f64('0x2f')],function(){throw new Error(_0x3f64('0x30'));}],'path':path[_0x3f64('0x2a')](config[_0x3f64('0xc')],'server',_0x3f64('0x28')),'pattern':/\.js$/}});_0x1ee952['up']({'migrations':_[_0x3f64('0x31')](_0x2a2579,function(_0x2fe6b5){return _0x2fe6b5+'.js';})})['then'](function(){return _0x286b2a[_0x3f64('0x15')](0xc8)['json']({'output':_0x3f64('0x32')+module[_0x3f64('0xe')][_0x3f64('0xf')]+'\x20to\x20'+_[_0x3f64('0x33')](_0x2a2579),'migrations':_[_0x3f64('0x2a')](_0x2a2579)});})[_0x3f64('0x34')](function(_0x4210c6){if(_0x4210c6 instanceof db[_0x3f64('0x35')][_0x3f64('0x36')]){return _0x286b2a[_0x3f64('0x15')](0xc8)[_0x3f64('0x16')]({'output':_0x3f64('0x37')});}else{return _0x286b2a[_0x3f64('0x15')](0x1f4)[_0x3f64('0x16')](_0x4210c6);}});}else{return _0x286b2a[_0x3f64('0x15')](0xc8)[_0x3f64('0x16')]({'output':_0x3f64('0x37')});}};
\ No newline at end of file
+var _0xf277=['length','.js','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','exports','version','query','tags','latest','2.0.0','json','status','fetch','origin','master','error','info','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join','server','migrations'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xf277,0x1e1));var _0x7f27=function(_0x23a6f4,_0x1d1af9){_0x23a6f4=_0x23a6f4-0x0;var _0xaded9e=_0xf277[_0x23a6f4];return _0xaded9e;};'use strict';var Umzug=require(_0x7f27('0x0'));var path=require(_0x7f27('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x7f27('0x2'))(module,'version');var compareVersions=require(_0x7f27('0x3'));var exec=require(_0x7f27('0x4'))[_0x7f27('0x5')];var db=require(_0x7f27('0x6'))['db'];var config=require(_0x7f27('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x7f27('0x8'))('update');var git=require(_0x7f27('0x9'))(config[_0x7f27('0xa')]);exports['index']=function(_0x23dbcc,_0x25c4dc){var _0x5c0dbb={'current':module[_0x7f27('0xb')][_0x7f27('0xc')],'phonebar':0x2};if(_0x23dbcc[_0x7f27('0xd')]&&_0x23dbcc[_0x7f27('0xd')]['latest']){return git['fetch']()[_0x7f27('0xe')](function(_0x5c7996,_0x252be9){_0x5c0dbb[_0x7f27('0xf')]=(_0x5c7996?module[_0x7f27('0xb')][_0x7f27('0xc')]:_0x252be9[_0x7f27('0xf')])||_0x7f27('0x10');return _0x25c4dc['status'](0xc8)[_0x7f27('0x11')](_0x5c0dbb);});}else{return _0x25c4dc[_0x7f27('0x12')](0xc8)['json'](_0x5c0dbb);}};exports[_0x7f27('0x13')]=function(_0x389514,_0x15f52a){return git[_0x7f27('0x13')]([_0x7f27('0x14'),_0x7f27('0x15')],function(_0x3aeb70){if(_0x3aeb70){logger[_0x7f27('0x16')](_0x3aeb70);return _0x15f52a['status'](0x1f4)[_0x7f27('0x11')](_0x3aeb70);}logger[_0x7f27('0x17')]('git\x20fetch');return _0x15f52a[_0x7f27('0x12')](0xc8)[_0x7f27('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x7f27('0x18')]=function(_0x30a56b,_0x9ec445){return git[_0x7f27('0x18')](['--hard',_0x7f27('0x19')],function(_0x27ea35){if(_0x27ea35){logger[_0x7f27('0x16')](_0x27ea35);return _0x9ec445[_0x7f27('0x12')](0x1f4)[_0x7f27('0x11')](_0x27ea35);}logger[_0x7f27('0x17')](_0x7f27('0x1a'));return _0x9ec445[_0x7f27('0x12')](0xc8)[_0x7f27('0x11')]({'output':_0x7f27('0x1b')});});};exports['pull']=function(_0x1c0238,_0x25f252){exec(_0x7f27('0x1c'),function(_0x43e9e8,_0x27b8cb,_0x2c1b12){logger[_0x7f27('0x17')](_0x27b8cb);logger['info'](_0x2c1b12);if(_0x43e9e8){logger[_0x7f27('0x16')](_0x43e9e8);return _0x25f252[_0x7f27('0x12')](0x1f4)[_0x7f27('0x11')](_0x43e9e8);}return _0x25f252[_0x7f27('0x12')](0xc8)['json']({'output':_0x27b8cb});});};exports['restart']=function(_0x1a9e04,_0x32197){return pm2['restart']('motion2')[_0x7f27('0x1d')](function(_0x2701d9){logger[_0x7f27('0x17')](_0x7f27('0x1e'),_0x2701d9);return _0x32197[_0x7f27('0x12')](0xc8)[_0x7f27('0x11')]({'output':_0x7f27('0x1f')});})['catch'](function(_0x5d13d9){logger[_0x7f27('0x16')](_0x5d13d9);return _0x32197[_0x7f27('0x12')](0x1f4)['json'](_0x5d13d9);});};exports['migrations']=function(_0x41a2b2,_0x10895d){var _0x2284de=fs[_0x7f27('0x20')](path[_0x7f27('0x21')](config[_0x7f27('0xa')],_0x7f27('0x22'),_0x7f27('0x23')));var _0x368fc3=[];for(var _0x6838ef=0x0;_0x6838ef<_0x2284de[_0x7f27('0x24')];_0x6838ef++){var _0x142581=_0x2284de[_0x6838ef]['replace'](_0x7f27('0x25'),'');if(compareVersions(module[_0x7f27('0xb')][_0x7f27('0xc')],_0x142581)===-0x1){_0x368fc3['push'](_0x142581);}}if(_0x368fc3[_0x7f27('0x24')]){var _0x7d094a=_0x368fc3['sort'](compareVersions);var _0x154591=new Umzug({'storage':_0x7f27('0x26'),'storageOptions':{'model':db[_0x7f27('0x27')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x7f27('0x26')]['getQueryInterface'](),db[_0x7f27('0x26')][_0x7f27('0x28')],function(){throw new Error(_0x7f27('0x29'));}],'path':path[_0x7f27('0x21')](config['root'],'server',_0x7f27('0x23')),'pattern':/\.js$/}});_0x154591['up']({'migrations':_[_0x7f27('0x2a')](_0x7d094a,function(_0x5acc87){return _0x5acc87+_0x7f27('0x25');})})['then'](function(){return _0x10895d[_0x7f27('0x12')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x7f27('0xb')][_0x7f27('0xc')]+'\x20to\x20'+_[_0x7f27('0x2b')](_0x7d094a),'migrations':_[_0x7f27('0x21')](_0x7d094a)});})[_0x7f27('0x2c')](function(_0x283aab){if(_0x283aab instanceof db[_0x7f27('0x26')][_0x7f27('0x2d')]){return _0x10895d[_0x7f27('0x12')](0xc8)['json']({'output':_0x7f27('0x2e')});}else{return _0x10895d[_0x7f27('0x12')](0x1f4)['json'](_0x283aab);}});}else{return _0x10895d[_0x7f27('0x12')](0xc8)['json']({'output':_0x7f27('0x2e')});}};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js
index 0c9db2b..81b865c 100644
--- a/server/api/voiceAgentReport/index.js
+++ b/server/api/voiceAgentReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe06c=['create','put','/:id','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','index','get','/describe','isAuthenticated','describe','post'];(function(_0x24b605,_0x13fdcb){var _0x27e13d=function(_0x2b7716){while(--_0x2b7716){_0x24b605['push'](_0x24b605['shift']());}};_0x27e13d(++_0x13fdcb);}(_0xe06c,0xe9));var _0xce06=function(_0x30c70f,_0x3d7f8c){_0x30c70f=_0x30c70f-0x0;var _0x4b2165=_0xe06c[_0x30c70f];return _0x4b2165;};'use strict';var multer=require('multer');var util=require(_0xce06('0x0'));var path=require(_0xce06('0x1'));var timeout=require(_0xce06('0x2'));var express=require(_0xce06('0x3'));var router=express[_0xce06('0x4')]();var auth=require(_0xce06('0x5'));var interaction=require(_0xce06('0x6'));var config=require('../../config/environment');var controller=require(_0xce06('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xce06('0x8')]);router[_0xce06('0x9')](_0xce06('0xa'),auth[_0xce06('0xb')](),controller[_0xce06('0xc')]);router[_0xce06('0x9')]('/:id',auth[_0xce06('0xb')](),controller['show']);router[_0xce06('0xd')]('/',auth['isAuthenticated'](),controller[_0xce06('0xe')]);router[_0xce06('0xf')](_0xce06('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xce06('0x11')]('/:id',auth[_0xce06('0xb')](),controller[_0xce06('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xfadd=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','delete','destroy'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xfadd,0x79));var _0xdfad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfadd[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdfad('0x0'));var util=require(_0xdfad('0x1'));var path=require(_0xdfad('0x2'));var timeout=require(_0xdfad('0x3'));var express=require('express');var router=express[_0xdfad('0x4')]();var auth=require(_0xdfad('0x5'));var interaction=require(_0xdfad('0x6'));var config=require(_0xdfad('0x7'));var controller=require(_0xdfad('0x8'));router[_0xdfad('0x9')]('/',auth['isAuthenticated'](),controller[_0xdfad('0xa')]);router[_0xdfad('0x9')]('/describe',auth[_0xdfad('0xb')](),controller[_0xdfad('0xc')]);router['get'](_0xdfad('0xd'),auth[_0xdfad('0xb')](),controller[_0xdfad('0xe')]);router[_0xdfad('0xf')]('/',auth[_0xdfad('0xb')](),controller['create']);router['put'](_0xdfad('0xd'),auth[_0xdfad('0xb')](),controller[_0xdfad('0x10')]);router[_0xdfad('0x11')](_0xdfad('0xd'),auth['isAuthenticated'](),controller[_0xdfad('0x12')]);module[_0xdfad('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js
index 7f30073..4606d1a 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.attributes.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7dfd=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x514078,_0x3ab9f3){var _0x31b7fc=function(_0x26906d){while(--_0x26906d){_0x514078['push'](_0x514078['shift']());}};_0x31b7fc(++_0x3ab9f3);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'type':{'type':Sequelize[_0xd7df('0x2')]},'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'calleridnum':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'queue':{'type':Sequelize[_0xd7df('0x2')]},'interface':{'type':Sequelize[_0xd7df('0x2')]},'membername':{'type':Sequelize[_0xd7df('0x2')]},'agentcalledAt':{'type':Sequelize[_0xd7df('0x3')]},'agentconnectAt':{'type':Sequelize[_0xd7df('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xd7df('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xd7df('0x3')]},'agentdumpAt':{'type':Sequelize[_0xd7df('0x3')]},'holdtime':{'type':Sequelize[_0xd7df('0x4')]},'agentcomplete':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd7df('0x4')]},'agentacw':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd7df('0x4')]},'reason':{'type':Sequelize[_0xd7df('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd7df('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd7df('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd7df('0x2')]},'language':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'exten':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'destchannel':{'type':Sequelize[_0xd7df('0x2')]},'destchannelstate':{'type':Sequelize[_0xd7df('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xd7df('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd7df('0x2')]},'destcalleridname':{'type':Sequelize[_0xd7df('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd7df('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd7df('0x2')]},'destlanguage':{'type':Sequelize[_0xd7df('0x2')]},'destaccountcode':{'type':Sequelize[_0xd7df('0x2')]},'destcontext':{'type':Sequelize[_0xd7df('0x2')]},'destexten':{'type':Sequelize[_0xd7df('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd7df('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd7df('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'agententerreason':{'type':Sequelize[_0xd7df('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8d0e=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x5ac026,_0x480e7f){var _0x336687=function(_0x125887){while(--_0x125887){_0x5ac026['push'](_0x5ac026['shift']());}};_0x336687(++_0x480e7f);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x49694b,_0x259c85){_0x49694b=_0x49694b-0x0;var _0xf8aae1=_0x8d0e[_0x49694b];return _0xf8aae1;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'type':{'type':Sequelize[_0xe8d0('0x2')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'queue':{'type':Sequelize[_0xe8d0('0x2')]},'interface':{'type':Sequelize[_0xe8d0('0x2')]},'membername':{'type':Sequelize[_0xe8d0('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xe8d0('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xe8d0('0x3')]},'holdtime':{'type':Sequelize[_0xe8d0('0x4')]},'agentcomplete':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe8d0('0x4')]},'agentacw':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe8d0('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize[_0xe8d0('0x2')]},'context':{'type':Sequelize[_0xe8d0('0x2')]},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe8d0('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize[_0xe8d0('0x2')]},'destcontext':{'type':Sequelize[_0xe8d0('0x2')]},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x2')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xe8d0('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe8d0('0x2')],'comment':_0xe8d0('0x6')},'transferexten':{'type':Sequelize[_0xe8d0('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js
index 45212f3..5f037c7 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.controller.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5e04=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','VoiceAgentReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x29ed7c,_0x1e04c9){var _0x3c20ab=function(_0x1d94f8){while(--_0x1d94f8){_0x29ed7c['push'](_0x29ed7c['shift']());}};_0x3c20ab(++_0x1e04c9);}(_0x5e04,0xd2));var _0x45e0=function(_0xdc4996,_0x15bedc){_0xdc4996=_0xdc4996-0x0;var _0x20fbb9=_0x5e04[_0xdc4996];return _0x20fbb9;};'use strict';var pdf=require(_0x45e0('0x0'));var emlformat=require(_0x45e0('0x1'));var rimraf=require(_0x45e0('0x2'));var zipdir=require(_0x45e0('0x3'));var jsonpatch=require(_0x45e0('0x4'));var rp=require(_0x45e0('0x5'));var moment=require(_0x45e0('0x6'));var BPromise=require(_0x45e0('0x7'));var Mustache=require(_0x45e0('0x8'));var util=require('util');var path=require(_0x45e0('0x9'));var sox=require(_0x45e0('0xa'));var csv=require(_0x45e0('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x45e0('0xc'));var squel=require(_0x45e0('0xd'));var crypto=require(_0x45e0('0xe'));var jsforce=require(_0x45e0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x45e0('0xb'));var querystring=require(_0x45e0('0x10'));var Papa=require(_0x45e0('0x11'));var Redis=require(_0x45e0('0x12'));var authService=require(_0x45e0('0x13'));var qs=require(_0x45e0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45e0('0x15'));var logger=require(_0x45e0('0x16'))('api');var utils=require(_0x45e0('0x17'));var config=require(_0x45e0('0x18'));var db=require(_0x45e0('0x19'))['db'];function respondWithStatusCode(_0x272801,_0x23bd09){_0x23bd09=_0x23bd09||0xcc;return function(_0x10f3ac){if(_0x10f3ac){return _0x272801['sendStatus'](_0x23bd09);}return _0x272801[_0x45e0('0x1a')](_0x23bd09)[_0x45e0('0x1b')]();};}function respondWithResult(_0x531653,_0x51ceff){_0x51ceff=_0x51ceff||0xc8;return function(_0x537506){if(_0x537506){return _0x531653[_0x45e0('0x1a')](_0x51ceff)[_0x45e0('0x1c')](_0x537506);}};}function respondWithFilteredResult(_0x5b54f0,_0x22b637){return function(_0x59e955){if(_0x59e955){var _0x30f638=_0x59e955['count'],_0x542a58=_0x22b637[_0x45e0('0x1d')],_0xd68be3=_0x22b637[_0x45e0('0x1d')]+_0x22b637[_0x45e0('0x1e')],_0x5d63e1;if(_0xd68be3>=_0x30f638){_0xd68be3=_0x30f638;_0x5d63e1=0xc8;}else{_0x5d63e1=0xce;}_0x5b54f0[_0x45e0('0x1a')](_0x5d63e1);return _0x5b54f0[_0x45e0('0x1f')](_0x45e0('0x20'),_0x542a58+'-'+_0xd68be3+'/'+_0x30f638)[_0x45e0('0x1c')](_0x59e955);}return null;};}function patchUpdates(_0x569ee1){return function(_0x591c38){try{jsonpatch[_0x45e0('0x21')](_0x591c38,_0x569ee1,!![]);}catch(_0x53fc5b){return BPromise[_0x45e0('0x22')](_0x53fc5b);}return _0x591c38[_0x45e0('0x23')]();};}function saveUpdates(_0x48dc55,_0x513df6){return function(_0x104724){if(_0x104724){return _0x104724[_0x45e0('0x24')](_0x48dc55)[_0x45e0('0x25')](function(_0x546dfe){return _0x546dfe;});}return null;};}function removeEntity(_0x416918,_0xbc2482){return function(_0x1a81ee){if(_0x1a81ee){return _0x1a81ee[_0x45e0('0x26')]()[_0x45e0('0x25')](function(){_0x416918['status'](0xcc)[_0x45e0('0x1b')]();});}};}function handleEntityNotFound(_0x9a3926,_0x2b4350){return function(_0x3e3b2d){if(!_0x3e3b2d){_0x9a3926[_0x45e0('0x27')](0x194);}return _0x3e3b2d;};}function handleError(_0x297ffc,_0x1f9474){_0x1f9474=_0x1f9474||0x1f4;return function(_0x15b21a){logger['error'](_0x15b21a['stack']);if(_0x15b21a[_0x45e0('0x28')]){delete _0x15b21a[_0x45e0('0x28')];}_0x297ffc[_0x45e0('0x1a')](_0x1f9474)[_0x45e0('0x29')](_0x15b21a);};}exports[_0x45e0('0x2a')]=function(_0x42b445,_0x188137){var _0x320cbc={},_0x13f94c={},_0x4664f8={'count':0x0,'rows':[]};var _0x4e225a=_['map'](db[_0x45e0('0x2b')][_0x45e0('0x2c')],function(_0x22211e){return{'name':_0x22211e[_0x45e0('0x2d')],'type':_0x22211e[_0x45e0('0x2e')][_0x45e0('0x2f')]};});_0x13f94c[_0x45e0('0x30')]=_[_0x45e0('0x31')](_0x4e225a,_0x45e0('0x28'));_0x13f94c['query']=_[_0x45e0('0x32')](_0x42b445[_0x45e0('0x33')]);_0x13f94c[_0x45e0('0x34')]=_[_0x45e0('0x35')](_0x13f94c[_0x45e0('0x30')],_0x13f94c['query']);_0x320cbc['attributes']=_[_0x45e0('0x35')](_0x13f94c[_0x45e0('0x30')],qs[_0x45e0('0x36')](_0x42b445[_0x45e0('0x33')][_0x45e0('0x36')]));_0x320cbc[_0x45e0('0x37')]=_0x320cbc[_0x45e0('0x37')][_0x45e0('0x38')]?_0x320cbc[_0x45e0('0x37')]:_0x13f94c[_0x45e0('0x30')];if(!_0x42b445['query']['hasOwnProperty'](_0x45e0('0x39'))){_0x320cbc[_0x45e0('0x1e')]=qs[_0x45e0('0x1e')](_0x42b445[_0x45e0('0x33')][_0x45e0('0x1e')]);_0x320cbc[_0x45e0('0x1d')]=qs[_0x45e0('0x1d')](_0x42b445[_0x45e0('0x33')]['offset']);}_0x320cbc[_0x45e0('0x3a')]=qs[_0x45e0('0x3b')](_0x42b445[_0x45e0('0x33')]['sort']);_0x320cbc['where']=qs[_0x45e0('0x34')](_[_0x45e0('0x3c')](_0x42b445['query'],_0x13f94c[_0x45e0('0x34')]),_0x4e225a);if(_0x42b445[_0x45e0('0x33')][_0x45e0('0x3d')]){_0x320cbc[_0x45e0('0x3e')]=_[_0x45e0('0x3f')](_0x320cbc[_0x45e0('0x3e')],{'$or':_[_0x45e0('0x31')](_0x4e225a,function(_0xaa0eab){if(_0xaa0eab[_0x45e0('0x2e')]!==_0x45e0('0x40')){var _0x352c2f={};_0x352c2f[_0xaa0eab[_0x45e0('0x28')]]={'$like':'%'+_0x42b445['query'][_0x45e0('0x3d')]+'%'};return _0x352c2f;}})});}_0x320cbc=_[_0x45e0('0x3f')]({},_0x320cbc,_0x42b445['options']);var _0x6c99ec={'where':_0x320cbc[_0x45e0('0x3e')]};return db[_0x45e0('0x2b')][_0x45e0('0x41')](_0x6c99ec)['then'](function(_0x1170b1){_0x4664f8[_0x45e0('0x41')]=_0x1170b1;if(_0x42b445['query'][_0x45e0('0x42')]){_0x320cbc[_0x45e0('0x43')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x45e0('0x44')](_0x320cbc);})[_0x45e0('0x25')](function(_0x343c52){_0x4664f8['rows']=_0x343c52;return _0x4664f8;})[_0x45e0('0x25')](respondWithFilteredResult(_0x188137,_0x320cbc))[_0x45e0('0x45')](handleError(_0x188137,null));};exports[_0x45e0('0x46')]=function(_0x549624,_0x3fc587){var _0x5be72f={'raw':![],'where':{'id':_0x549624[_0x45e0('0x47')]['id']}},_0x492f20={};_0x492f20[_0x45e0('0x30')]=_[_0x45e0('0x32')](db[_0x45e0('0x2b')]['rawAttributes']);_0x492f20[_0x45e0('0x33')]=_[_0x45e0('0x32')](_0x549624[_0x45e0('0x33')]);_0x492f20[_0x45e0('0x34')]=_['intersection'](_0x492f20[_0x45e0('0x30')],_0x492f20['query']);_0x5be72f[_0x45e0('0x37')]=_[_0x45e0('0x35')](_0x492f20[_0x45e0('0x30')],qs['fields'](_0x549624[_0x45e0('0x33')][_0x45e0('0x36')]));_0x5be72f[_0x45e0('0x37')]=_0x5be72f['attributes'][_0x45e0('0x38')]?_0x5be72f['attributes']:_0x492f20[_0x45e0('0x30')];if(_0x549624[_0x45e0('0x33')][_0x45e0('0x42')]){_0x5be72f[_0x45e0('0x43')]=[{'all':!![]}];}_0x5be72f=_['merge']({},_0x5be72f,_0x549624[_0x45e0('0x48')]);return db['VoiceAgentReport'][_0x45e0('0x49')](_0x5be72f)[_0x45e0('0x25')](handleEntityNotFound(_0x3fc587,null))['then'](respondWithResult(_0x3fc587,null))[_0x45e0('0x45')](handleError(_0x3fc587,null));};exports[_0x45e0('0x4a')]=function(_0x21c136,_0xb33521){return db[_0x45e0('0x2b')]['create'](_0x21c136[_0x45e0('0x4b')],{})[_0x45e0('0x25')](respondWithResult(_0xb33521,0xc9))[_0x45e0('0x45')](handleError(_0xb33521,null));};exports[_0x45e0('0x24')]=function(_0x4d1dfe,_0x275fe2){if(_0x4d1dfe['body']['id']){delete _0x4d1dfe['body']['id'];}return db[_0x45e0('0x2b')]['find']({'where':{'id':_0x4d1dfe['params']['id']}})[_0x45e0('0x25')](handleEntityNotFound(_0x275fe2,null))[_0x45e0('0x25')](saveUpdates(_0x4d1dfe[_0x45e0('0x4b')],null))[_0x45e0('0x25')](respondWithResult(_0x275fe2,null))[_0x45e0('0x45')](handleError(_0x275fe2,null));};exports[_0x45e0('0x26')]=function(_0x3514ca,_0x23780c){return db[_0x45e0('0x2b')][_0x45e0('0x49')]({'where':{'id':_0x3514ca['params']['id']}})[_0x45e0('0x25')](handleEntityNotFound(_0x23780c,null))[_0x45e0('0x25')](removeEntity(_0x23780c,null))['catch'](handleError(_0x23780c,null));};exports[_0x45e0('0x4c')]=function(_0x16a022,_0x2ce465){return db['VoiceAgentReport'][_0x45e0('0x4c')]()[_0x45e0('0x25')](respondWithResult(_0x2ce465,null))['catch'](handleError(_0x2ce465,null));};
\ No newline at end of file
+var _0xaa32=['map','VoiceAgentReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0xaa32,0xf9));var _0x2aa3=function(_0x2f1ae9,_0x11ce9a){_0x2f1ae9=_0x2f1ae9-0x0;var _0x2420e7=_0xaa32[_0x2f1ae9];return _0x2420e7;};'use strict';var pdf=require(_0x2aa3('0x0'));var emlformat=require(_0x2aa3('0x1'));var rimraf=require(_0x2aa3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2aa3('0x3'));var moment=require(_0x2aa3('0x4'));var BPromise=require(_0x2aa3('0x5'));var Mustache=require('mustache');var util=require(_0x2aa3('0x6'));var path=require(_0x2aa3('0x7'));var sox=require(_0x2aa3('0x8'));var csv=require('to-csv');var ejs=require(_0x2aa3('0x9'));var fs=require('fs');var _=require(_0x2aa3('0xa'));var squel=require(_0x2aa3('0xb'));var crypto=require(_0x2aa3('0xc'));var jsforce=require(_0x2aa3('0xd'));var deskjs=require(_0x2aa3('0xe'));var toCsv=require(_0x2aa3('0xf'));var querystring=require(_0x2aa3('0x10'));var Papa=require('papaparse');var Redis=require(_0x2aa3('0x11'));var authService=require(_0x2aa3('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2aa3('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2aa3('0x14'));var config=require(_0x2aa3('0x15'));var db=require(_0x2aa3('0x16'))['db'];function respondWithStatusCode(_0x200066,_0x4b4b2c){_0x4b4b2c=_0x4b4b2c||0xcc;return function(_0x378f7f){if(_0x378f7f){return _0x200066[_0x2aa3('0x17')](_0x4b4b2c);}return _0x200066[_0x2aa3('0x18')](_0x4b4b2c)[_0x2aa3('0x19')]();};}function respondWithResult(_0x563437,_0x2a5100){_0x2a5100=_0x2a5100||0xc8;return function(_0xfe4b9e){if(_0xfe4b9e){return _0x563437[_0x2aa3('0x18')](_0x2a5100)['json'](_0xfe4b9e);}};}function respondWithFilteredResult(_0x5be3b0,_0x18a2e3){return function(_0x2035ad){if(_0x2035ad){var _0x1fee76=_0x2035ad[_0x2aa3('0x1a')],_0x5825b6=_0x18a2e3['offset'],_0x31fe1e=_0x18a2e3['offset']+_0x18a2e3[_0x2aa3('0x1b')],_0x1421bd;if(_0x31fe1e>=_0x1fee76){_0x31fe1e=_0x1fee76;_0x1421bd=0xc8;}else{_0x1421bd=0xce;}_0x5be3b0[_0x2aa3('0x18')](_0x1421bd);return _0x5be3b0['set'](_0x2aa3('0x1c'),_0x5825b6+'-'+_0x31fe1e+'/'+_0x1fee76)['json'](_0x2035ad);}return null;};}function patchUpdates(_0x324171){return function(_0x31c61b){try{jsonpatch[_0x2aa3('0x1d')](_0x31c61b,_0x324171,!![]);}catch(_0x5ae856){return BPromise[_0x2aa3('0x1e')](_0x5ae856);}return _0x31c61b[_0x2aa3('0x1f')]();};}function saveUpdates(_0x4ef9ff,_0x4d2b40){return function(_0x1d0157){if(_0x1d0157){return _0x1d0157['update'](_0x4ef9ff)['then'](function(_0x5d3557){return _0x5d3557;});}return null;};}function removeEntity(_0x1db2a1,_0x37e78f){return function(_0x326163){if(_0x326163){return _0x326163[_0x2aa3('0x20')]()[_0x2aa3('0x21')](function(){_0x1db2a1[_0x2aa3('0x18')](0xcc)[_0x2aa3('0x19')]();});}};}function handleEntityNotFound(_0x2e4dba,_0x6bcd4e){return function(_0x4eaea5){if(!_0x4eaea5){_0x2e4dba['sendStatus'](0x194);}return _0x4eaea5;};}function handleError(_0x49aa45,_0x4f7a02){_0x4f7a02=_0x4f7a02||0x1f4;return function(_0x443e86){logger[_0x2aa3('0x22')](_0x443e86[_0x2aa3('0x23')]);if(_0x443e86[_0x2aa3('0x24')]){delete _0x443e86[_0x2aa3('0x24')];}_0x49aa45[_0x2aa3('0x18')](_0x4f7a02)[_0x2aa3('0x25')](_0x443e86);};}exports[_0x2aa3('0x26')]=function(_0xe73ec8,_0x33cb35){var _0x45a97d={},_0x472824={},_0x5e740e={'count':0x0,'rows':[]};var _0x90f7c7=_[_0x2aa3('0x27')](db[_0x2aa3('0x28')][_0x2aa3('0x29')],function(_0x2dfda7){return{'name':_0x2dfda7[_0x2aa3('0x2a')],'type':_0x2dfda7[_0x2aa3('0x2b')][_0x2aa3('0x2c')]};});_0x472824[_0x2aa3('0x2d')]=_[_0x2aa3('0x27')](_0x90f7c7,_0x2aa3('0x24'));_0x472824[_0x2aa3('0x2e')]=_[_0x2aa3('0x2f')](_0xe73ec8[_0x2aa3('0x2e')]);_0x472824['filters']=_[_0x2aa3('0x30')](_0x472824['model'],_0x472824[_0x2aa3('0x2e')]);_0x45a97d[_0x2aa3('0x31')]=_[_0x2aa3('0x30')](_0x472824[_0x2aa3('0x2d')],qs[_0x2aa3('0x32')](_0xe73ec8[_0x2aa3('0x2e')][_0x2aa3('0x32')]));_0x45a97d[_0x2aa3('0x31')]=_0x45a97d['attributes'][_0x2aa3('0x33')]?_0x45a97d['attributes']:_0x472824[_0x2aa3('0x2d')];if(!_0xe73ec8['query']['hasOwnProperty'](_0x2aa3('0x34'))){_0x45a97d['limit']=qs[_0x2aa3('0x1b')](_0xe73ec8[_0x2aa3('0x2e')]['limit']);_0x45a97d[_0x2aa3('0x35')]=qs['offset'](_0xe73ec8[_0x2aa3('0x2e')][_0x2aa3('0x35')]);}_0x45a97d[_0x2aa3('0x36')]=qs[_0x2aa3('0x37')](_0xe73ec8['query'][_0x2aa3('0x37')]);_0x45a97d[_0x2aa3('0x38')]=qs['filters'](_['pick'](_0xe73ec8['query'],_0x472824[_0x2aa3('0x39')]),_0x90f7c7);if(_0xe73ec8[_0x2aa3('0x2e')][_0x2aa3('0x3a')]){_0x45a97d[_0x2aa3('0x38')]=_[_0x2aa3('0x3b')](_0x45a97d[_0x2aa3('0x38')],{'$or':_['map'](_0x90f7c7,function(_0x4dc506){if(_0x4dc506[_0x2aa3('0x2b')]!==_0x2aa3('0x3c')){var _0x502a97={};_0x502a97[_0x4dc506[_0x2aa3('0x24')]]={'$like':'%'+_0xe73ec8[_0x2aa3('0x2e')][_0x2aa3('0x3a')]+'%'};return _0x502a97;}})});}_0x45a97d=_[_0x2aa3('0x3b')]({},_0x45a97d,_0xe73ec8[_0x2aa3('0x3d')]);var _0x37c2b9={'where':_0x45a97d[_0x2aa3('0x38')]};return db[_0x2aa3('0x28')][_0x2aa3('0x1a')](_0x37c2b9)[_0x2aa3('0x21')](function(_0x4d85bd){_0x5e740e[_0x2aa3('0x1a')]=_0x4d85bd;if(_0xe73ec8[_0x2aa3('0x2e')]['includeAll']){_0x45a97d[_0x2aa3('0x3e')]=[{'all':!![]}];}return db[_0x2aa3('0x28')][_0x2aa3('0x3f')](_0x45a97d);})[_0x2aa3('0x21')](function(_0x5e2fa0){_0x5e740e[_0x2aa3('0x40')]=_0x5e2fa0;return _0x5e740e;})['then'](respondWithFilteredResult(_0x33cb35,_0x45a97d))[_0x2aa3('0x41')](handleError(_0x33cb35,null));};exports['show']=function(_0x238a4e,_0x59ea16){var _0x161b3a={'raw':![],'where':{'id':_0x238a4e[_0x2aa3('0x42')]['id']}},_0x358245={};_0x358245[_0x2aa3('0x2d')]=_['keys'](db['VoiceAgentReport'][_0x2aa3('0x29')]);_0x358245[_0x2aa3('0x2e')]=_[_0x2aa3('0x2f')](_0x238a4e[_0x2aa3('0x2e')]);_0x358245['filters']=_[_0x2aa3('0x30')](_0x358245[_0x2aa3('0x2d')],_0x358245['query']);_0x161b3a[_0x2aa3('0x31')]=_[_0x2aa3('0x30')](_0x358245[_0x2aa3('0x2d')],qs[_0x2aa3('0x32')](_0x238a4e[_0x2aa3('0x2e')]['fields']));_0x161b3a['attributes']=_0x161b3a[_0x2aa3('0x31')][_0x2aa3('0x33')]?_0x161b3a[_0x2aa3('0x31')]:_0x358245['model'];if(_0x238a4e[_0x2aa3('0x2e')]['includeAll']){_0x161b3a[_0x2aa3('0x3e')]=[{'all':!![]}];}_0x161b3a=_[_0x2aa3('0x3b')]({},_0x161b3a,_0x238a4e[_0x2aa3('0x3d')]);return db[_0x2aa3('0x28')][_0x2aa3('0x43')](_0x161b3a)[_0x2aa3('0x21')](handleEntityNotFound(_0x59ea16,null))[_0x2aa3('0x21')](respondWithResult(_0x59ea16,null))[_0x2aa3('0x41')](handleError(_0x59ea16,null));};exports[_0x2aa3('0x44')]=function(_0x33c85f,_0x2ec974){return db[_0x2aa3('0x28')][_0x2aa3('0x44')](_0x33c85f[_0x2aa3('0x45')],{})['then'](respondWithResult(_0x2ec974,0xc9))['catch'](handleError(_0x2ec974,null));};exports[_0x2aa3('0x46')]=function(_0x1f639c,_0x231036){if(_0x1f639c['body']['id']){delete _0x1f639c[_0x2aa3('0x45')]['id'];}return db[_0x2aa3('0x28')][_0x2aa3('0x43')]({'where':{'id':_0x1f639c[_0x2aa3('0x42')]['id']}})[_0x2aa3('0x21')](handleEntityNotFound(_0x231036,null))[_0x2aa3('0x21')](saveUpdates(_0x1f639c[_0x2aa3('0x45')],null))[_0x2aa3('0x21')](respondWithResult(_0x231036,null))[_0x2aa3('0x41')](handleError(_0x231036,null));};exports[_0x2aa3('0x20')]=function(_0x32aeca,_0x3265a2){return db['VoiceAgentReport'][_0x2aa3('0x43')]({'where':{'id':_0x32aeca[_0x2aa3('0x42')]['id']}})[_0x2aa3('0x21')](handleEntityNotFound(_0x3265a2,null))[_0x2aa3('0x21')](removeEntity(_0x3265a2,null))[_0x2aa3('0x41')](handleError(_0x3265a2,null));};exports[_0x2aa3('0x47')]=function(_0x50e7e9,_0x19cd5f){return db[_0x2aa3('0x28')]['describe']()['then'](respondWithResult(_0x19cd5f,null))['catch'](handleError(_0x19cd5f,null));};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js
index 31552e6..f02a6e5 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.model.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['path','rimraf','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x413f1e,_0x2ed046){var _0x319bd2=function(_0x28411c){while(--_0x28411c){_0x413f1e['push'](_0x413f1e['shift']());}};_0x319bd2(++_0x2ed046);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xcb91[_0x4c7935];return _0x30651d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1cb9('0xa'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport'];(function(_0x13d71e,_0x1ab6a1){var _0x2dc8aa=function(_0x466e63){while(--_0x466e63){_0x13d71e['push'](_0x13d71e['shift']());}};_0x2dc8aa(++_0x1ab6a1);}(_0xe706,0xa3));var _0x6e70=function(_0x36aad0,_0x3d2e17){_0x36aad0=_0x36aad0-0x0;var _0x31e987=_0xe706[_0x36aad0];return _0x31e987;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'fields':[_0x6e70('0xe'),_0x6e70('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js
index a0afd51..61faa6b 100644
--- a/server/api/voiceAgentReport/voiceAgentReport.rpc.js
+++ b/server/api/voiceAgentReport/voiceAgentReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4788=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x1c0f41,_0x26d95d){var _0x369a9f=function(_0x251234){while(--_0x251234){_0x1c0f41['push'](_0x1c0f41['shift']());}};_0x369a9f(++_0x26d95d);}(_0x4788,0x13e));var _0x8478=function(_0x208218,_0x3fc62e){_0x208218=_0x208218-0x0;var _0x4ecec8=_0x4788[_0x208218];return _0x4ecec8;};'use strict';var _=require(_0x8478('0x0'));var util=require(_0x8478('0x1'));var moment=require(_0x8478('0x2'));var BPromise=require('bluebird');var rs=require(_0x8478('0x3'));var fs=require('fs');var Redis=require(_0x8478('0x4'));var db=require(_0x8478('0x5'))['db'];var utils=require(_0x8478('0x6'));var logger=require(_0x8478('0x7'))(_0x8478('0x8'));var config=require(_0x8478('0x9'));var jayson=require(_0x8478('0xa'));var client=jayson[_0x8478('0xb')][_0x8478('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5dd28c,_0x42570d,_0xe93107){return new BPromise(function(_0x24ebd5,_0x903882){return client[_0x8478('0xd')](_0x5dd28c,_0xe93107)['then'](function(_0x3b00cd){logger[_0x8478('0xe')](_0x8478('0xf'),_0x42570d,_0x8478('0x10'));logger[_0x8478('0x11')](_0x8478('0x12'),_0x42570d,_0x8478('0x10'),JSON[_0x8478('0x13')](_0x3b00cd));if(_0x3b00cd[_0x8478('0x14')]){if(_0x3b00cd[_0x8478('0x14')][_0x8478('0x15')]===0x1f4){logger[_0x8478('0x14')](_0x8478('0xf'),_0x42570d,_0x3b00cd[_0x8478('0x14')][_0x8478('0x16')]);return _0x903882(_0x3b00cd[_0x8478('0x14')][_0x8478('0x16')]);}logger[_0x8478('0x14')](_0x8478('0xf'),_0x42570d,_0x3b00cd[_0x8478('0x14')][_0x8478('0x16')]);return _0x24ebd5(_0x3b00cd[_0x8478('0x14')][_0x8478('0x16')]);}else{logger['info'](_0x8478('0xf'),_0x42570d,_0x8478('0x10'));_0x24ebd5(_0x3b00cd[_0x8478('0x17')][_0x8478('0x16')]);}})[_0x8478('0x18')](function(_0x461384){logger[_0x8478('0x14')](_0x8478('0xf'),_0x42570d,_0x461384);_0x903882(_0x461384);});});}exports[_0x8478('0x19')]=function(_0x47a7ca){var _0x1f2299=this;return new Promise(function(_0x398675,_0x106475){return db[_0x8478('0x1a')][_0x8478('0x1b')](_0x47a7ca[_0x8478('0x1c')],{'raw':_0x47a7ca[_0x8478('0x1d')]?_0x47a7ca['options'][_0x8478('0x1e')]===undefined?!![]:![]:!![]})[_0x8478('0x1f')](function(_0x177454){logger['info'](_0x8478('0x19'),_0x47a7ca);logger[_0x8478('0x11')](_0x8478('0x19'),_0x47a7ca,JSON[_0x8478('0x13')](_0x177454));_0x398675(_0x177454);})[_0x8478('0x18')](function(_0x362bac){logger[_0x8478('0x14')](_0x8478('0x19'),_0x362bac[_0x8478('0x16')],_0x47a7ca);_0x106475(_0x1f2299[_0x8478('0x14')](0x1f4,_0x362bac['message']));});});};exports[_0x8478('0x20')]=function(_0x37efe6){var _0x55051d=this;return new Promise(function(_0x4e8a00,_0x210ff8){return db['VoiceAgentReport'][_0x8478('0x21')](_0x37efe6[_0x8478('0x1c')],{'raw':_0x37efe6[_0x8478('0x1d')]?_0x37efe6[_0x8478('0x1d')][_0x8478('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37efe6['options']?_0x37efe6[_0x8478('0x1d')][_0x8478('0x22')]||null:null,'attributes':_0x37efe6[_0x8478('0x1d')]?_0x37efe6[_0x8478('0x1d')][_0x8478('0x23')]||null:null,'limit':_0x37efe6[_0x8478('0x1d')]?_0x37efe6[_0x8478('0x1d')][_0x8478('0x24')]||null:null})[_0x8478('0x1f')](function(_0x1239a3){logger[_0x8478('0xe')](_0x8478('0x20'),_0x37efe6);logger['debug'](_0x8478('0x20'),_0x37efe6,JSON[_0x8478('0x13')](_0x1239a3));_0x4e8a00(_0x1239a3);})[_0x8478('0x18')](function(_0x178145){logger['error']('UpdateVoiceAgentReport',_0x178145[_0x8478('0x16')],_0x37efe6);_0x210ff8(_0x55051d[_0x8478('0x14')](0x1f4,_0x178145[_0x8478('0x16')]));});});};
\ No newline at end of file
+var _0xbe03=['jayson/promise','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateVoiceAgentReport','body','raw','then','catch','UpdateVoiceAgentReport','VoiceAgentReport','options','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x16874e,_0x5a3ad7){var _0x18e5ff=function(_0x297cca){while(--_0x297cca){_0x16874e['push'](_0x16874e['shift']());}};_0x18e5ff(++_0x5a3ad7);}(_0xbe03,0x1e8));var _0x3be0=function(_0x23cea2,_0x1b3a2a){_0x23cea2=_0x23cea2-0x0;var _0x1da0e6=_0xbe03[_0x23cea2];return _0x1da0e6;};'use strict';var _=require(_0x3be0('0x0'));var util=require(_0x3be0('0x1'));var moment=require(_0x3be0('0x2'));var BPromise=require(_0x3be0('0x3'));var rs=require(_0x3be0('0x4'));var fs=require('fs');var Redis=require(_0x3be0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3be0('0x6'));var logger=require('../../config/logger')(_0x3be0('0x7'));var config=require('../../config/environment');var jayson=require(_0x3be0('0x8'));var client=jayson[_0x3be0('0x9')][_0x3be0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x246c56,_0x525866,_0x3f522c){return new BPromise(function(_0x184e4e,_0x57e543){return client[_0x3be0('0xb')](_0x246c56,_0x3f522c)['then'](function(_0xf813be){logger[_0x3be0('0xc')](_0x3be0('0xd'),_0x525866,'request\x20sent');logger[_0x3be0('0xe')](_0x3be0('0xf'),_0x525866,_0x3be0('0x10'),JSON[_0x3be0('0x11')](_0xf813be));if(_0xf813be[_0x3be0('0x12')]){if(_0xf813be[_0x3be0('0x12')][_0x3be0('0x13')]===0x1f4){logger[_0x3be0('0x12')](_0x3be0('0xd'),_0x525866,_0xf813be['error'][_0x3be0('0x14')]);return _0x57e543(_0xf813be[_0x3be0('0x12')][_0x3be0('0x14')]);}logger[_0x3be0('0x12')](_0x3be0('0xd'),_0x525866,_0xf813be[_0x3be0('0x12')][_0x3be0('0x14')]);return _0x184e4e(_0xf813be[_0x3be0('0x12')][_0x3be0('0x14')]);}else{logger[_0x3be0('0xc')](_0x3be0('0xd'),_0x525866,'request\x20sent');_0x184e4e(_0xf813be['result'][_0x3be0('0x14')]);}})['catch'](function(_0x1c0e89){logger[_0x3be0('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x525866,_0x1c0e89);_0x57e543(_0x1c0e89);});});}exports[_0x3be0('0x15')]=function(_0x3fcceb){var _0x22adb4=this;return new Promise(function(_0x45239a,_0xb98a92){return db['VoiceAgentReport']['create'](_0x3fcceb[_0x3be0('0x16')],{'raw':_0x3fcceb['options']?_0x3fcceb['options'][_0x3be0('0x17')]===undefined?!![]:![]:!![]})[_0x3be0('0x18')](function(_0x255e52){logger[_0x3be0('0xc')](_0x3be0('0x15'),_0x3fcceb);logger[_0x3be0('0xe')](_0x3be0('0x15'),_0x3fcceb,JSON['stringify'](_0x255e52));_0x45239a(_0x255e52);})[_0x3be0('0x19')](function(_0x5b483e){logger[_0x3be0('0x12')](_0x3be0('0x15'),_0x5b483e[_0x3be0('0x14')],_0x3fcceb);_0xb98a92(_0x22adb4[_0x3be0('0x12')](0x1f4,_0x5b483e[_0x3be0('0x14')]));});});};exports[_0x3be0('0x1a')]=function(_0x9a6b44){var _0x1e360a=this;return new Promise(function(_0x269ec1,_0x3142fa){return db[_0x3be0('0x1b')]['update'](_0x9a6b44[_0x3be0('0x16')],{'raw':_0x9a6b44[_0x3be0('0x1c')]?_0x9a6b44[_0x3be0('0x1c')][_0x3be0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9a6b44[_0x3be0('0x1c')]?_0x9a6b44[_0x3be0('0x1c')][_0x3be0('0x1d')]||null:null,'attributes':_0x9a6b44[_0x3be0('0x1c')]?_0x9a6b44[_0x3be0('0x1c')]['attributes']||null:null,'limit':_0x9a6b44[_0x3be0('0x1c')]?_0x9a6b44[_0x3be0('0x1c')][_0x3be0('0x1e')]||null:null})['then'](function(_0x1eb072){logger[_0x3be0('0xc')]('UpdateVoiceAgentReport',_0x9a6b44);logger[_0x3be0('0xe')](_0x3be0('0x1a'),_0x9a6b44,JSON[_0x3be0('0x11')](_0x1eb072));_0x269ec1(_0x1eb072);})[_0x3be0('0x19')](function(_0x256b54){logger[_0x3be0('0x12')]('UpdateVoiceAgentReport',_0x256b54[_0x3be0('0x14')],_0x9a6b44);_0x3142fa(_0x1e360a[_0x3be0('0x12')](0x1f4,_0x256b54['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js
index 84ba008..87acf36 100644
--- a/server/api/voiceCallReport/index.js
+++ b/server/api/voiceCallReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe21b=['describe','/:id','show','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated'];(function(_0x3352ec,_0x419090){var _0x6ed0cc=function(_0x46f52e){while(--_0x46f52e){_0x3352ec['push'](_0x3352ec['shift']());}};_0x6ed0cc(++_0x419090);}(_0xe21b,0x105));var _0xbe21=function(_0x8fde1,_0x469626){_0x8fde1=_0x8fde1-0x0;var _0x3bf22c=_0xe21b[_0x8fde1];return _0x3bf22c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbe21('0x0'));var timeout=require(_0xbe21('0x1'));var express=require(_0xbe21('0x2'));var router=express[_0xbe21('0x3')]();var auth=require(_0xbe21('0x4'));var interaction=require(_0xbe21('0x5'));var config=require(_0xbe21('0x6'));var controller=require(_0xbe21('0x7'));router[_0xbe21('0x8')]('/',auth['isAuthenticated'](),controller[_0xbe21('0x9')]);router[_0xbe21('0x8')](_0xbe21('0xa'),auth[_0xbe21('0xb')](),controller[_0xbe21('0xc')]);router[_0xbe21('0x8')](_0xbe21('0xd'),auth[_0xbe21('0xb')](),controller[_0xbe21('0xe')]);router[_0xbe21('0xf')]('/',auth[_0xbe21('0xb')](),controller[_0xbe21('0x10')]);router[_0xbe21('0x11')](_0xbe21('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xbe21('0x12')](_0xbe21('0xd'),auth[_0xbe21('0xb')](),controller[_0xbe21('0x13')]);module[_0xbe21('0x14')]=router;
\ No newline at end of file
+var _0x79d4=['../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','delete','destroy','exports','util','connect-timeout'];(function(_0x56dc26,_0x356261){var _0x338ccb=function(_0x49db2e){while(--_0x49db2e){_0x56dc26['push'](_0x56dc26['shift']());}};_0x338ccb(++_0x356261);}(_0x79d4,0xce));var _0x479d=function(_0xaa6e7d,_0x5c2d01){_0xaa6e7d=_0xaa6e7d-0x0;var _0x3cf1cc=_0x79d4[_0xaa6e7d];return _0x3cf1cc;};'use strict';var multer=require('multer');var util=require(_0x479d('0x0'));var path=require('path');var timeout=require(_0x479d('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x479d('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x479d('0x3'));var controller=require(_0x479d('0x4'));router[_0x479d('0x5')]('/',auth[_0x479d('0x6')](),controller['index']);router[_0x479d('0x5')](_0x479d('0x7'),auth[_0x479d('0x6')](),controller[_0x479d('0x8')]);router[_0x479d('0x5')](_0x479d('0x9'),auth[_0x479d('0x6')](),controller[_0x479d('0xa')]);router[_0x479d('0xb')]('/',auth[_0x479d('0x6')](),controller['create']);router[_0x479d('0xc')](_0x479d('0x9'),auth[_0x479d('0x6')](),controller['update']);router[_0x479d('0xd')](_0x479d('0x9'),auth['isAuthenticated'](),controller[_0x479d('0xe')]);module[_0x479d('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js
index eb25584..c7cde53 100644
--- a/server/api/voiceCallReport/voiceCallReport.attributes.js
+++ b/server/api/voiceCallReport/voiceCallReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x90b357,_0x7779ba){var _0x2b86d9=function(_0x9abe3){while(--_0x9abe3){_0x90b357['push'](_0x90b357['shift']());}};_0x2b86d9(++_0x7779ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}};
\ No newline at end of file
+var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x381a28,_0x4eb359){var _0x5e572d=function(_0x46b8bf){while(--_0x46b8bf){_0x381a28['push'](_0x381a28['shift']());}};_0x5e572d(++_0x4eb359);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js
index b1fd7d1..88bbbf5 100644
--- a/server/api/voiceCallReport/voiceCallReport.controller.js
+++ b/server/api/voiceCallReport/voiceCallReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb469=['merge','VIRTUAL','options','includeAll','include','User','findAll','rows','show','params','rawAttributes','keys','create','catch','describe','uniqueid','body','find','user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','model','map','query','filters','intersection','fields','length','attributes','nolimit','offset','order','sort','where','pick','filter'];(function(_0x284eb1,_0x47c046){var _0x379df6=function(_0x95b200){while(--_0x95b200){_0x284eb1['push'](_0x284eb1['shift']());}};_0x379df6(++_0x47c046);}(_0xb469,0x64));var _0x9b46=function(_0x5a98ab,_0x106ec2){_0x5a98ab=_0x5a98ab-0x0;var _0x3fe136=_0xb469[_0x5a98ab];return _0x3fe136;};'use strict';var pdf=require(_0x9b46('0x0'));var emlformat=require(_0x9b46('0x1'));var rimraf=require(_0x9b46('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b46('0x3'));var rp=require(_0x9b46('0x4'));var moment=require('moment');var BPromise=require(_0x9b46('0x5'));var Mustache=require(_0x9b46('0x6'));var util=require(_0x9b46('0x7'));var path=require(_0x9b46('0x8'));var sox=require(_0x9b46('0x9'));var csv=require(_0x9b46('0xa'));var ejs=require(_0x9b46('0xb'));var fs=require('fs');var _=require(_0x9b46('0xc'));var squel=require(_0x9b46('0xd'));var crypto=require(_0x9b46('0xe'));var jsforce=require(_0x9b46('0xf'));var deskjs=require(_0x9b46('0x10'));var toCsv=require(_0x9b46('0xa'));var querystring=require('querystring');var Papa=require(_0x9b46('0x11'));var Redis=require(_0x9b46('0x12'));var authService=require(_0x9b46('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b46('0x14'));var logger=require(_0x9b46('0x15'))(_0x9b46('0x16'));var utils=require(_0x9b46('0x17'));var config=require(_0x9b46('0x18'));var db=require(_0x9b46('0x19'))['db'];function respondWithStatusCode(_0x2ec49b,_0xeedbc5){_0xeedbc5=_0xeedbc5||0xcc;return function(_0x5f0ea7){if(_0x5f0ea7){return _0x2ec49b[_0x9b46('0x1a')](_0xeedbc5);}return _0x2ec49b[_0x9b46('0x1b')](_0xeedbc5)[_0x9b46('0x1c')]();};}function respondWithResult(_0x39cdea,_0x2e31b3){_0x2e31b3=_0x2e31b3||0xc8;return function(_0x1c427e){if(_0x1c427e){return _0x39cdea[_0x9b46('0x1b')](_0x2e31b3)[_0x9b46('0x1d')](_0x1c427e);}};}function respondWithFilteredResult(_0x46ca3c,_0x16d20c){return function(_0x5eedd2){if(_0x5eedd2){var _0x2dc423=_0x5eedd2[_0x9b46('0x1e')],_0xd5d72e=_0x16d20c['offset'],_0x2fccb0=_0x16d20c['offset']+_0x16d20c[_0x9b46('0x1f')],_0x4dcbda;if(_0x2fccb0>=_0x2dc423){_0x2fccb0=_0x2dc423;_0x4dcbda=0xc8;}else{_0x4dcbda=0xce;}_0x46ca3c['status'](_0x4dcbda);return _0x46ca3c[_0x9b46('0x20')](_0x9b46('0x21'),_0xd5d72e+'-'+_0x2fccb0+'/'+_0x2dc423)[_0x9b46('0x1d')](_0x5eedd2);}return null;};}function patchUpdates(_0x4558d6){return function(_0x13ae1a){try{jsonpatch[_0x9b46('0x22')](_0x13ae1a,_0x4558d6,!![]);}catch(_0x56a211){return BPromise['reject'](_0x56a211);}return _0x13ae1a[_0x9b46('0x23')]();};}function saveUpdates(_0x209fc0,_0x1e8d79){return function(_0x8ed24e){if(_0x8ed24e){return _0x8ed24e['update'](_0x209fc0)[_0x9b46('0x24')](function(_0x54d386){return _0x54d386;});}return null;};}function removeEntity(_0x5eb8c7,_0x115439){return function(_0xc99e28){if(_0xc99e28){return _0xc99e28[_0x9b46('0x25')]()[_0x9b46('0x24')](function(){_0x5eb8c7[_0x9b46('0x1b')](0xcc)[_0x9b46('0x1c')]();});}};}function handleEntityNotFound(_0x4bd7c7,_0x4eca86){return function(_0x53f245){if(!_0x53f245){_0x4bd7c7['sendStatus'](0x194);}return _0x53f245;};}function handleError(_0x40487a,_0x58488a){_0x58488a=_0x58488a||0x1f4;return function(_0x4d35f7){logger[_0x9b46('0x26')](_0x4d35f7[_0x9b46('0x27')]);if(_0x4d35f7[_0x9b46('0x28')]){delete _0x4d35f7[_0x9b46('0x28')];}_0x40487a['status'](_0x58488a)[_0x9b46('0x29')](_0x4d35f7);};}exports[_0x9b46('0x2a')]=function(_0x159cb8,_0x1ffe4e){var _0x212f09={},_0xb86f32={},_0x139673={'count':0x0,'rows':[]};var _0xf6cfe2=_['map'](db[_0x9b46('0x2b')]['rawAttributes'],function(_0x17d4ba){return{'name':_0x17d4ba[_0x9b46('0x2c')],'type':_0x17d4ba[_0x9b46('0x2d')][_0x9b46('0x2e')]};});_0xb86f32[_0x9b46('0x2f')]=_[_0x9b46('0x30')](_0xf6cfe2,_0x9b46('0x28'));_0xb86f32[_0x9b46('0x31')]=_['keys'](_0x159cb8['query']);_0xb86f32[_0x9b46('0x32')]=_[_0x9b46('0x33')](_0xb86f32[_0x9b46('0x2f')],_0xb86f32['query']);_0x212f09['attributes']=_[_0x9b46('0x33')](_0xb86f32[_0x9b46('0x2f')],qs[_0x9b46('0x34')](_0x159cb8[_0x9b46('0x31')][_0x9b46('0x34')]));_0x212f09['attributes']=_0x212f09['attributes'][_0x9b46('0x35')]?_0x212f09[_0x9b46('0x36')]:_0xb86f32[_0x9b46('0x2f')];if(!_0x159cb8[_0x9b46('0x31')]['hasOwnProperty'](_0x9b46('0x37'))){_0x212f09[_0x9b46('0x1f')]=qs['limit'](_0x159cb8[_0x9b46('0x31')][_0x9b46('0x1f')]);_0x212f09[_0x9b46('0x38')]=qs[_0x9b46('0x38')](_0x159cb8[_0x9b46('0x31')][_0x9b46('0x38')]);}_0x212f09[_0x9b46('0x39')]=qs[_0x9b46('0x3a')](_0x159cb8[_0x9b46('0x31')][_0x9b46('0x3a')]);_0x212f09[_0x9b46('0x3b')]=qs[_0x9b46('0x32')](_[_0x9b46('0x3c')](_0x159cb8[_0x9b46('0x31')],_0xb86f32[_0x9b46('0x32')]),_0xf6cfe2);if(_0x159cb8[_0x9b46('0x31')][_0x9b46('0x3d')]){_0x212f09[_0x9b46('0x3b')]=_[_0x9b46('0x3e')](_0x212f09['where'],{'$or':_[_0x9b46('0x30')](_0xf6cfe2,function(_0x4f64a4){if(_0x4f64a4[_0x9b46('0x2d')]!==_0x9b46('0x3f')){var _0x4d4de0={};_0x4d4de0[_0x4f64a4[_0x9b46('0x28')]]={'$like':'%'+_0x159cb8['query'][_0x9b46('0x3d')]+'%'};return _0x4d4de0;}})});}_0x212f09=_[_0x9b46('0x3e')]({},_0x212f09,_0x159cb8[_0x9b46('0x40')]);var _0x1f1a5a={'where':_0x212f09[_0x9b46('0x3b')]};return db['VoiceCallReport'][_0x9b46('0x1e')](_0x1f1a5a)[_0x9b46('0x24')](function(_0xee7bfc){_0x139673['count']=_0xee7bfc;if(_0x159cb8[_0x9b46('0x31')][_0x9b46('0x41')]){_0x212f09[_0x9b46('0x42')]=[{'attributes':['id',_0x9b46('0x28'),'fullname','alias'],'model':db[_0x9b46('0x43')],'as':'User'}];}return db[_0x9b46('0x2b')][_0x9b46('0x44')](_0x212f09);})[_0x9b46('0x24')](function(_0x5059ba){_0x139673[_0x9b46('0x45')]=_0x5059ba;return _0x139673;})[_0x9b46('0x24')](respondWithFilteredResult(_0x1ffe4e,_0x212f09))['catch'](handleError(_0x1ffe4e,null));};exports[_0x9b46('0x46')]=function(_0x14ea98,_0x3b8fd0){var _0x400e70={'raw':!![],'where':{'id':_0x14ea98[_0x9b46('0x47')]['id']}},_0xc79917={};_0xc79917[_0x9b46('0x2f')]=_['keys'](db['VoiceCallReport'][_0x9b46('0x48')]);_0xc79917[_0x9b46('0x31')]=_[_0x9b46('0x49')](_0x14ea98['query']);_0xc79917[_0x9b46('0x32')]=_['intersection'](_0xc79917[_0x9b46('0x2f')],_0xc79917[_0x9b46('0x31')]);_0x400e70['attributes']=_[_0x9b46('0x33')](_0xc79917[_0x9b46('0x2f')],qs[_0x9b46('0x34')](_0x14ea98[_0x9b46('0x31')][_0x9b46('0x34')]));_0x400e70['attributes']=_0x400e70[_0x9b46('0x36')][_0x9b46('0x35')]?_0x400e70['attributes']:_0xc79917['model'];if(_0x14ea98[_0x9b46('0x31')]['includeAll']){_0x400e70[_0x9b46('0x42')]=[{'all':!![]}];}_0x400e70=_[_0x9b46('0x3e')]({},_0x400e70,_0x14ea98[_0x9b46('0x40')]);return db[_0x9b46('0x2b')]['find'](_0x400e70)[_0x9b46('0x24')](handleEntityNotFound(_0x3b8fd0,null))[_0x9b46('0x24')](respondWithResult(_0x3b8fd0,null))['catch'](handleError(_0x3b8fd0,null));};exports[_0x9b46('0x4a')]=function(_0x3f7575,_0xc60189){return db[_0x9b46('0x2b')][_0x9b46('0x4a')](_0x3f7575['body'],{})['then'](respondWithResult(_0xc60189,0xc9))['catch'](handleError(_0xc60189,null));};exports['destroy']=function(_0x31af66,_0x164145){return db[_0x9b46('0x2b')]['find']({'where':{'id':_0x31af66['params']['id']}})['then'](handleEntityNotFound(_0x164145,null))[_0x9b46('0x24')](removeEntity(_0x164145,null))[_0x9b46('0x4b')](handleError(_0x164145,null));};exports['describe']=function(_0x2cd7cc,_0xecd4b8){return db['VoiceCallReport'][_0x9b46('0x4c')]()[_0x9b46('0x24')](respondWithResult(_0xecd4b8,null))[_0x9b46('0x4b')](handleError(_0xecd4b8,null));};exports['update']=function(_0x562894,_0x97173d){if(_0x562894['body'][_0x9b46('0x4d')]){delete _0x562894[_0x9b46('0x4e')][_0x9b46('0x4d')];}return db['VoiceCallReport'][_0x9b46('0x4f')]({'where':{'uniqueid':_0x562894[_0x9b46('0x47')]['id'],'UserId':{'$or':[null,_0x562894[_0x9b46('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x97173d,null))[_0x9b46('0x24')](saveUpdates(_0x562894[_0x9b46('0x4e')],null))[_0x9b46('0x24')](respondWithResult(_0x97173d,null))[_0x9b46('0x4b')](handleError(_0x97173d,null));};
\ No newline at end of file
+var _0xde85=['count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','merge','includeAll','include','fullname','alias','User','findAll','rows','show','params','rawAttributes','options','find','catch','create','describe','body','uniqueid','user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xde85,0x16e));var _0x5de8=function(_0x359b1f,_0x5b45a9){_0x359b1f=_0x359b1f-0x0;var _0x35c553=_0xde85[_0x359b1f];return _0x35c553;};'use strict';var pdf=require(_0x5de8('0x0'));var emlformat=require(_0x5de8('0x1'));var rimraf=require(_0x5de8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5de8('0x3'));var rp=require(_0x5de8('0x4'));var moment=require(_0x5de8('0x5'));var BPromise=require(_0x5de8('0x6'));var Mustache=require(_0x5de8('0x7'));var util=require(_0x5de8('0x8'));var path=require(_0x5de8('0x9'));var sox=require('sox');var csv=require(_0x5de8('0xa'));var ejs=require(_0x5de8('0xb'));var fs=require('fs');var _=require(_0x5de8('0xc'));var squel=require(_0x5de8('0xd'));var crypto=require('crypto');var jsforce=require(_0x5de8('0xe'));var deskjs=require(_0x5de8('0xf'));var toCsv=require(_0x5de8('0xa'));var querystring=require(_0x5de8('0x10'));var Papa=require(_0x5de8('0x11'));var Redis=require(_0x5de8('0x12'));var authService=require(_0x5de8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5de8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5de8('0x15'))('api');var utils=require(_0x5de8('0x16'));var config=require(_0x5de8('0x17'));var db=require(_0x5de8('0x18'))['db'];function respondWithStatusCode(_0x3943d1,_0x28aec2){_0x28aec2=_0x28aec2||0xcc;return function(_0x37e45d){if(_0x37e45d){return _0x3943d1[_0x5de8('0x19')](_0x28aec2);}return _0x3943d1[_0x5de8('0x1a')](_0x28aec2)[_0x5de8('0x1b')]();};}function respondWithResult(_0x3ecb37,_0xe1071e){_0xe1071e=_0xe1071e||0xc8;return function(_0x430dd6){if(_0x430dd6){return _0x3ecb37[_0x5de8('0x1a')](_0xe1071e)[_0x5de8('0x1c')](_0x430dd6);}};}function respondWithFilteredResult(_0x3bd4d0,_0x30d09b){return function(_0x30f0e0){if(_0x30f0e0){var _0x477f41=_0x30f0e0[_0x5de8('0x1d')],_0x52f2d1=_0x30d09b[_0x5de8('0x1e')],_0x33ab24=_0x30d09b[_0x5de8('0x1e')]+_0x30d09b[_0x5de8('0x1f')],_0x49a84c;if(_0x33ab24>=_0x477f41){_0x33ab24=_0x477f41;_0x49a84c=0xc8;}else{_0x49a84c=0xce;}_0x3bd4d0[_0x5de8('0x1a')](_0x49a84c);return _0x3bd4d0['set'](_0x5de8('0x20'),_0x52f2d1+'-'+_0x33ab24+'/'+_0x477f41)[_0x5de8('0x1c')](_0x30f0e0);}return null;};}function patchUpdates(_0x4a8e7d){return function(_0x4d35ab){try{jsonpatch[_0x5de8('0x21')](_0x4d35ab,_0x4a8e7d,!![]);}catch(_0x538337){return BPromise[_0x5de8('0x22')](_0x538337);}return _0x4d35ab[_0x5de8('0x23')]();};}function saveUpdates(_0x511d44,_0x3250be){return function(_0x4c34b5){if(_0x4c34b5){return _0x4c34b5[_0x5de8('0x24')](_0x511d44)['then'](function(_0x5f2f88){return _0x5f2f88;});}return null;};}function removeEntity(_0x445382,_0x46c5ce){return function(_0x4e2aa0){if(_0x4e2aa0){return _0x4e2aa0[_0x5de8('0x25')]()[_0x5de8('0x26')](function(){_0x445382[_0x5de8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7095,_0x93fced){return function(_0x11734d){if(!_0x11734d){_0x2c7095['sendStatus'](0x194);}return _0x11734d;};}function handleError(_0x1919e8,_0x12c33e){_0x12c33e=_0x12c33e||0x1f4;return function(_0x5cd688){logger[_0x5de8('0x27')](_0x5cd688[_0x5de8('0x28')]);if(_0x5cd688[_0x5de8('0x29')]){delete _0x5cd688['name'];}_0x1919e8[_0x5de8('0x1a')](_0x12c33e)['send'](_0x5cd688);};}exports[_0x5de8('0x2a')]=function(_0x4216b0,_0x26ab2c){var _0x24109a={},_0x50be9c={},_0x4b673c={'count':0x0,'rows':[]};var _0x2a53fe=_[_0x5de8('0x2b')](db[_0x5de8('0x2c')]['rawAttributes'],function(_0x370986){return{'name':_0x370986[_0x5de8('0x2d')],'type':_0x370986[_0x5de8('0x2e')][_0x5de8('0x2f')]};});_0x50be9c[_0x5de8('0x30')]=_['map'](_0x2a53fe,_0x5de8('0x29'));_0x50be9c[_0x5de8('0x31')]=_[_0x5de8('0x32')](_0x4216b0[_0x5de8('0x31')]);_0x50be9c[_0x5de8('0x33')]=_['intersection'](_0x50be9c['model'],_0x50be9c[_0x5de8('0x31')]);_0x24109a[_0x5de8('0x34')]=_[_0x5de8('0x35')](_0x50be9c[_0x5de8('0x30')],qs[_0x5de8('0x36')](_0x4216b0[_0x5de8('0x31')][_0x5de8('0x36')]));_0x24109a[_0x5de8('0x34')]=_0x24109a[_0x5de8('0x34')]['length']?_0x24109a['attributes']:_0x50be9c[_0x5de8('0x30')];if(!_0x4216b0[_0x5de8('0x31')]['hasOwnProperty'](_0x5de8('0x37'))){_0x24109a['limit']=qs[_0x5de8('0x1f')](_0x4216b0[_0x5de8('0x31')][_0x5de8('0x1f')]);_0x24109a[_0x5de8('0x1e')]=qs[_0x5de8('0x1e')](_0x4216b0[_0x5de8('0x31')]['offset']);}_0x24109a[_0x5de8('0x38')]=qs[_0x5de8('0x39')](_0x4216b0['query'][_0x5de8('0x39')]);_0x24109a[_0x5de8('0x3a')]=qs[_0x5de8('0x33')](_['pick'](_0x4216b0[_0x5de8('0x31')],_0x50be9c[_0x5de8('0x33')]),_0x2a53fe);if(_0x4216b0['query']['filter']){_0x24109a['where']=_['merge'](_0x24109a[_0x5de8('0x3a')],{'$or':_[_0x5de8('0x2b')](_0x2a53fe,function(_0x5170d1){if(_0x5170d1[_0x5de8('0x2e')]!=='VIRTUAL'){var _0x2c2f6b={};_0x2c2f6b[_0x5170d1[_0x5de8('0x29')]]={'$like':'%'+_0x4216b0[_0x5de8('0x31')][_0x5de8('0x3b')]+'%'};return _0x2c2f6b;}})});}_0x24109a=_[_0x5de8('0x3c')]({},_0x24109a,_0x4216b0['options']);var _0x281d14={'where':_0x24109a[_0x5de8('0x3a')]};return db[_0x5de8('0x2c')]['count'](_0x281d14)['then'](function(_0x3e2feb){_0x4b673c[_0x5de8('0x1d')]=_0x3e2feb;if(_0x4216b0[_0x5de8('0x31')][_0x5de8('0x3d')]){_0x24109a[_0x5de8('0x3e')]=[{'attributes':['id','name',_0x5de8('0x3f'),_0x5de8('0x40')],'model':db[_0x5de8('0x41')],'as':_0x5de8('0x41')}];}return db[_0x5de8('0x2c')][_0x5de8('0x42')](_0x24109a);})[_0x5de8('0x26')](function(_0x19b723){_0x4b673c[_0x5de8('0x43')]=_0x19b723;return _0x4b673c;})['then'](respondWithFilteredResult(_0x26ab2c,_0x24109a))['catch'](handleError(_0x26ab2c,null));};exports[_0x5de8('0x44')]=function(_0x2dae02,_0x25b26b){var _0x3564d4={'raw':!![],'where':{'id':_0x2dae02[_0x5de8('0x45')]['id']}},_0x55ec15={};_0x55ec15[_0x5de8('0x30')]=_[_0x5de8('0x32')](db[_0x5de8('0x2c')][_0x5de8('0x46')]);_0x55ec15[_0x5de8('0x31')]=_[_0x5de8('0x32')](_0x2dae02[_0x5de8('0x31')]);_0x55ec15['filters']=_['intersection'](_0x55ec15['model'],_0x55ec15[_0x5de8('0x31')]);_0x3564d4[_0x5de8('0x34')]=_[_0x5de8('0x35')](_0x55ec15[_0x5de8('0x30')],qs[_0x5de8('0x36')](_0x2dae02[_0x5de8('0x31')][_0x5de8('0x36')]));_0x3564d4['attributes']=_0x3564d4[_0x5de8('0x34')]['length']?_0x3564d4['attributes']:_0x55ec15[_0x5de8('0x30')];if(_0x2dae02[_0x5de8('0x31')][_0x5de8('0x3d')]){_0x3564d4['include']=[{'all':!![]}];}_0x3564d4=_[_0x5de8('0x3c')]({},_0x3564d4,_0x2dae02[_0x5de8('0x47')]);return db[_0x5de8('0x2c')][_0x5de8('0x48')](_0x3564d4)[_0x5de8('0x26')](handleEntityNotFound(_0x25b26b,null))[_0x5de8('0x26')](respondWithResult(_0x25b26b,null))[_0x5de8('0x49')](handleError(_0x25b26b,null));};exports[_0x5de8('0x4a')]=function(_0xcaf359,_0xfc2003){return db['VoiceCallReport'][_0x5de8('0x4a')](_0xcaf359['body'],{})['then'](respondWithResult(_0xfc2003,0xc9))[_0x5de8('0x49')](handleError(_0xfc2003,null));};exports[_0x5de8('0x25')]=function(_0x477015,_0x1f17d5){return db[_0x5de8('0x2c')][_0x5de8('0x48')]({'where':{'id':_0x477015[_0x5de8('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f17d5,null))[_0x5de8('0x26')](removeEntity(_0x1f17d5,null))[_0x5de8('0x49')](handleError(_0x1f17d5,null));};exports[_0x5de8('0x4b')]=function(_0x3c30fd,_0x4e41a0){return db[_0x5de8('0x2c')][_0x5de8('0x4b')]()[_0x5de8('0x26')](respondWithResult(_0x4e41a0,null))['catch'](handleError(_0x4e41a0,null));};exports['update']=function(_0x52d83b,_0x34e5d0){if(_0x52d83b[_0x5de8('0x4c')]['uniqueid']){delete _0x52d83b['body'][_0x5de8('0x4d')];}return db['VoiceCallReport'][_0x5de8('0x48')]({'where':{'uniqueid':_0x52d83b[_0x5de8('0x45')]['id'],'UserId':{'$or':[null,_0x52d83b[_0x5de8('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x34e5d0,null))['then'](saveUpdates(_0x52d83b['body'],null))[_0x5de8('0x26')](respondWithResult(_0x34e5d0,null))[_0x5de8('0x49')](handleError(_0x34e5d0,null));};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js
index 9f51314..70d8f02 100644
--- a/server/api/voiceCallReport/voiceCallReport.model.js
+++ b/server/api/voiceCallReport/voiceCallReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe919=['moment','bluebird','path','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4df7a5,_0x1a2c38){var _0x493b96=function(_0x1fb436){while(--_0x1fb436){_0x4df7a5['push'](_0x4df7a5['shift']());}};_0x493b96(++_0x1a2c38);}(_0xe919,0xec));var _0x9e91=function(_0x1d1f80,_0x2c87c0){_0x1d1f80=_0x1d1f80-0x0;var _0x380d8b=_0xe919[_0x1d1f80];return _0x380d8b;};'use strict';var _=require(_0x9e91('0x0'));var util=require(_0x9e91('0x1'));var logger=require(_0x9e91('0x2'))(_0x9e91('0x3'));var moment=require(_0x9e91('0x4'));var BPromise=require(_0x9e91('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e91('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e91('0x7'));module[_0x9e91('0x8')]=function(_0x42be85,_0x284ba2){return _0x42be85[_0x9e91('0x9')](_0x9e91('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x9e91('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2cbb=['rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x58bc1b,_0x302eb1){var _0xae0db4=function(_0x4c0846){while(--_0x4c0846){_0x58bc1b['push'](_0x58bc1b['shift']());}};_0xae0db4(++_0x302eb1);}(_0x2cbb,0xc9));var _0xb2cb=function(_0x6cf622,_0x146e67){_0x6cf622=_0x6cf622-0x0;var _0x1887fe=_0x2cbb[_0x6cf622];return _0x1887fe;};'use strict';var _=require(_0xb2cb('0x0'));var util=require(_0xb2cb('0x1'));var logger=require(_0xb2cb('0x2'))('api');var moment=require(_0xb2cb('0x3'));var BPromise=require(_0xb2cb('0x4'));var rp=require(_0xb2cb('0x5'));var fs=require('fs');var path=require(_0xb2cb('0x6'));var rimraf=require(_0xb2cb('0x7'));var config=require(_0xb2cb('0x8'));var attributes=require(_0xb2cb('0x9'));module['exports']=function(_0x5a44a9,_0x1ab9f8){return _0x5a44a9[_0xb2cb('0xa')](_0xb2cb('0xb'),attributes,{'tableName':_0xb2cb('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js
index 999436d..8df9b11 100644
--- a/server/api/voiceCallReport/voiceCallReport.rpc.js
+++ b/server/api/voiceCallReport/voiceCallReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7d04=['info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','raw','options','where','limit','include','map','model','attributes','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xf02334,_0x486b5e){var _0x235e23=function(_0x18eb5a){while(--_0x18eb5a){_0xf02334['push'](_0xf02334['shift']());}};_0x235e23(++_0x486b5e);}(_0x7d04,0x1ed));var _0x47d0=function(_0x506912,_0x221002){_0x506912=_0x506912-0x0;var _0x23d3eb=_0x7d04[_0x506912];return _0x23d3eb;};'use strict';var _=require(_0x47d0('0x0'));var util=require(_0x47d0('0x1'));var moment=require(_0x47d0('0x2'));var BPromise=require(_0x47d0('0x3'));var rs=require(_0x47d0('0x4'));var fs=require('fs');var Redis=require(_0x47d0('0x5'));var db=require(_0x47d0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47d0('0x7'))(_0x47d0('0x8'));var config=require('../../config/environment');var jayson=require(_0x47d0('0x9'));var client=jayson[_0x47d0('0xa')][_0x47d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42067b,_0x26dabd,_0x18f75b){return new BPromise(function(_0x4214c4,_0x4d1eb4){return client[_0x47d0('0xc')](_0x42067b,_0x18f75b)[_0x47d0('0xd')](function(_0x292433){logger[_0x47d0('0xe')](_0x47d0('0xf'),_0x26dabd,_0x47d0('0x10'));logger[_0x47d0('0x11')](_0x47d0('0x12'),_0x26dabd,_0x47d0('0x10'),JSON[_0x47d0('0x13')](_0x292433));if(_0x292433[_0x47d0('0x14')]){if(_0x292433['error']['code']===0x1f4){logger['error'](_0x47d0('0xf'),_0x26dabd,_0x292433[_0x47d0('0x14')][_0x47d0('0x15')]);return _0x4d1eb4(_0x292433[_0x47d0('0x14')][_0x47d0('0x15')]);}logger[_0x47d0('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x26dabd,_0x292433[_0x47d0('0x14')][_0x47d0('0x15')]);return _0x4214c4(_0x292433['error']['message']);}else{logger[_0x47d0('0xe')](_0x47d0('0xf'),_0x26dabd,_0x47d0('0x10'));_0x4214c4(_0x292433[_0x47d0('0x16')][_0x47d0('0x15')]);}})[_0x47d0('0x17')](function(_0x122552){logger['error'](_0x47d0('0xf'),_0x26dabd,_0x122552);_0x4d1eb4(_0x122552);});});}exports[_0x47d0('0x18')]=function(_0x5628fe){var _0x3b3984=this;return new Promise(function(_0x3587f4,_0xb0244f){return db[_0x47d0('0x19')]['findAll']({'raw':_0x5628fe['options']?_0x5628fe['options'][_0x47d0('0x1a')]===undefined?!![]:![]:!![],'where':_0x5628fe[_0x47d0('0x1b')]?_0x5628fe[_0x47d0('0x1b')][_0x47d0('0x1c')]||null:null,'attributes':_0x5628fe['options']?_0x5628fe['options']['attributes']||null:null,'limit':_0x5628fe[_0x47d0('0x1b')]?_0x5628fe[_0x47d0('0x1b')][_0x47d0('0x1d')]||null:null,'include':_0x5628fe[_0x47d0('0x1b')]?_0x5628fe[_0x47d0('0x1b')][_0x47d0('0x1e')]?_[_0x47d0('0x1f')](_0x5628fe[_0x47d0('0x1b')][_0x47d0('0x1e')],function(_0x186d05){return{'model':db[_0x186d05[_0x47d0('0x20')]],'as':_0x186d05['as'],'attributes':_0x186d05[_0x47d0('0x21')],'include':_0x186d05[_0x47d0('0x1e')]?_[_0x47d0('0x1f')](_0x186d05[_0x47d0('0x1e')],function(_0x5d46bb){return{'model':db[_0x5d46bb[_0x47d0('0x20')]],'as':_0x5d46bb['as'],'attributes':_0x5d46bb[_0x47d0('0x21')],'include':_0x5d46bb[_0x47d0('0x1e')]?_[_0x47d0('0x1f')](_0x5d46bb[_0x47d0('0x1e')],function(_0xd1ce84){return{'model':db[_0xd1ce84[_0x47d0('0x20')]],'as':_0xd1ce84['as'],'attributes':_0xd1ce84[_0x47d0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x47d0('0xd')](function(_0x49d79a){logger[_0x47d0('0xe')](_0x47d0('0x18'),_0x5628fe);logger[_0x47d0('0x11')]('GetVoiceCallReport',_0x5628fe,JSON[_0x47d0('0x13')](_0x49d79a));_0x3587f4(_0x49d79a);})[_0x47d0('0x17')](function(_0x1c90df){logger[_0x47d0('0x14')](_0x47d0('0x18'),_0x1c90df[_0x47d0('0x15')],_0x5628fe);_0xb0244f(_0x3b3984[_0x47d0('0x14')](0x1f4,_0x1c90df['message']));});});};exports[_0x47d0('0x22')]=function(_0x260ea3){var _0x757a17=this;return new Promise(function(_0xc92629,_0x5c259b){return db[_0x47d0('0x19')][_0x47d0('0x23')](_0x260ea3[_0x47d0('0x24')],{'raw':_0x260ea3[_0x47d0('0x1b')]?_0x260ea3['options'][_0x47d0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2bb4b1){logger['info']('CreateVoiceCallReport',_0x260ea3);logger[_0x47d0('0x11')](_0x47d0('0x22'),_0x260ea3,JSON['stringify'](_0x2bb4b1));_0xc92629(_0x2bb4b1);})[_0x47d0('0x17')](function(_0x44da78){logger[_0x47d0('0x14')](_0x47d0('0x22'),_0x44da78[_0x47d0('0x15')],_0x260ea3);_0x5c259b(_0x757a17[_0x47d0('0x14')](0x1f4,_0x44da78[_0x47d0('0x15')]));});});};exports[_0x47d0('0x25')]=function(_0x424740){var _0x588721=this;return new Promise(function(_0x20fae5,_0x1ac11e){return db['VoiceCallReport'][_0x47d0('0x26')](_0x424740['body'],{'raw':_0x424740[_0x47d0('0x1b')]?_0x424740[_0x47d0('0x1b')][_0x47d0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x424740[_0x47d0('0x1b')]?_0x424740[_0x47d0('0x1b')][_0x47d0('0x1c')]||null:null,'attributes':_0x424740['options']?_0x424740[_0x47d0('0x1b')]['attributes']||null:null,'limit':_0x424740[_0x47d0('0x1b')]?_0x424740[_0x47d0('0x1b')][_0x47d0('0x1d')]||null:null})[_0x47d0('0xd')](function(_0x47cf55){logger[_0x47d0('0xe')](_0x47d0('0x25'),_0x424740);logger['debug']('UpdateVoiceCallReport',_0x424740,JSON['stringify'](_0x47cf55));_0x20fae5(_0x47cf55);})[_0x47d0('0x17')](function(_0x4d9d53){logger[_0x47d0('0x14')](_0x47d0('0x25'),_0x4d9d53[_0x47d0('0x15')],_0x424740);_0x1ac11e(_0x588721[_0x47d0('0x14')](0x1f4,_0x4d9d53[_0x47d0('0x15')]));});});};
\ No newline at end of file
+var _0x5043=['attributes','limit','include','map','model','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where'];(function(_0x2e8802,_0x59ad8c){var _0x4617aa=function(_0x4380b4){while(--_0x4380b4){_0x2e8802['push'](_0x2e8802['shift']());}};_0x4617aa(++_0x59ad8c);}(_0x5043,0x1ec));var _0x3504=function(_0x2e181a,_0x216d84){_0x2e181a=_0x2e181a-0x0;var _0x27857e=_0x5043[_0x2e181a];return _0x27857e;};'use strict';var _=require('lodash');var util=require(_0x3504('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3504('0x1'));var fs=require('fs');var Redis=require(_0x3504('0x2'));var db=require(_0x3504('0x3'))['db'];var utils=require(_0x3504('0x4'));var logger=require(_0x3504('0x5'))(_0x3504('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3504('0x7')][_0x3504('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b1dc7,_0x349576,_0x51da29){return new BPromise(function(_0x3db12c,_0x5440d6){return client[_0x3504('0x9')](_0x1b1dc7,_0x51da29)[_0x3504('0xa')](function(_0x4b0603){logger[_0x3504('0xb')](_0x3504('0xc'),_0x349576,_0x3504('0xd'));logger[_0x3504('0xe')](_0x3504('0xf'),_0x349576,_0x3504('0xd'),JSON[_0x3504('0x10')](_0x4b0603));if(_0x4b0603[_0x3504('0x11')]){if(_0x4b0603[_0x3504('0x11')][_0x3504('0x12')]===0x1f4){logger[_0x3504('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x349576,_0x4b0603[_0x3504('0x11')][_0x3504('0x13')]);return _0x5440d6(_0x4b0603[_0x3504('0x11')][_0x3504('0x13')]);}logger[_0x3504('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x349576,_0x4b0603['error'][_0x3504('0x13')]);return _0x3db12c(_0x4b0603[_0x3504('0x11')][_0x3504('0x13')]);}else{logger['info'](_0x3504('0xc'),_0x349576,_0x3504('0xd'));_0x3db12c(_0x4b0603['result'][_0x3504('0x13')]);}})['catch'](function(_0x545ec4){logger[_0x3504('0x11')](_0x3504('0xc'),_0x349576,_0x545ec4);_0x5440d6(_0x545ec4);});});}exports[_0x3504('0x14')]=function(_0x9e2f68){var _0x2f06b6=this;return new Promise(function(_0x34c130,_0xfbdc9c){return db[_0x3504('0x15')][_0x3504('0x16')]({'raw':_0x9e2f68[_0x3504('0x17')]?_0x9e2f68[_0x3504('0x17')][_0x3504('0x18')]===undefined?!![]:![]:!![],'where':_0x9e2f68[_0x3504('0x17')]?_0x9e2f68['options'][_0x3504('0x19')]||null:null,'attributes':_0x9e2f68['options']?_0x9e2f68['options'][_0x3504('0x1a')]||null:null,'limit':_0x9e2f68[_0x3504('0x17')]?_0x9e2f68['options'][_0x3504('0x1b')]||null:null,'include':_0x9e2f68[_0x3504('0x17')]?_0x9e2f68[_0x3504('0x17')][_0x3504('0x1c')]?_[_0x3504('0x1d')](_0x9e2f68[_0x3504('0x17')][_0x3504('0x1c')],function(_0x50f00b){return{'model':db[_0x50f00b[_0x3504('0x1e')]],'as':_0x50f00b['as'],'attributes':_0x50f00b[_0x3504('0x1a')],'include':_0x50f00b[_0x3504('0x1c')]?_[_0x3504('0x1d')](_0x50f00b[_0x3504('0x1c')],function(_0x4dfaf3){return{'model':db[_0x4dfaf3[_0x3504('0x1e')]],'as':_0x4dfaf3['as'],'attributes':_0x4dfaf3['attributes'],'include':_0x4dfaf3[_0x3504('0x1c')]?_[_0x3504('0x1d')](_0x4dfaf3['include'],function(_0x2f96fe){return{'model':db[_0x2f96fe[_0x3504('0x1e')]],'as':_0x2f96fe['as'],'attributes':_0x2f96fe[_0x3504('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3504('0xa')](function(_0x5543b0){logger[_0x3504('0xb')]('GetVoiceCallReport',_0x9e2f68);logger['debug'](_0x3504('0x14'),_0x9e2f68,JSON[_0x3504('0x10')](_0x5543b0));_0x34c130(_0x5543b0);})[_0x3504('0x1f')](function(_0x18aa0f){logger[_0x3504('0x11')](_0x3504('0x14'),_0x18aa0f['message'],_0x9e2f68);_0xfbdc9c(_0x2f06b6[_0x3504('0x11')](0x1f4,_0x18aa0f[_0x3504('0x13')]));});});};exports[_0x3504('0x20')]=function(_0x379e72){var _0x433c20=this;return new Promise(function(_0x2cf0e0,_0x233e8d){return db['VoiceCallReport'][_0x3504('0x21')](_0x379e72[_0x3504('0x22')],{'raw':_0x379e72['options']?_0x379e72[_0x3504('0x17')][_0x3504('0x18')]===undefined?!![]:![]:!![]})[_0x3504('0xa')](function(_0x3a839b){logger[_0x3504('0xb')]('CreateVoiceCallReport',_0x379e72);logger[_0x3504('0xe')](_0x3504('0x20'),_0x379e72,JSON[_0x3504('0x10')](_0x3a839b));_0x2cf0e0(_0x3a839b);})['catch'](function(_0x29654e){logger['error'](_0x3504('0x20'),_0x29654e['message'],_0x379e72);_0x233e8d(_0x433c20[_0x3504('0x11')](0x1f4,_0x29654e[_0x3504('0x13')]));});});};exports[_0x3504('0x23')]=function(_0x129a5f){var _0x2e3d51=this;return new Promise(function(_0xe0e83,_0x4d1c67){return db[_0x3504('0x15')][_0x3504('0x24')](_0x129a5f['body'],{'raw':_0x129a5f[_0x3504('0x17')]?_0x129a5f[_0x3504('0x17')][_0x3504('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x129a5f['options']?_0x129a5f[_0x3504('0x17')][_0x3504('0x19')]||null:null,'attributes':_0x129a5f[_0x3504('0x17')]?_0x129a5f[_0x3504('0x17')][_0x3504('0x1a')]||null:null,'limit':_0x129a5f['options']?_0x129a5f[_0x3504('0x17')][_0x3504('0x1b')]||null:null})[_0x3504('0xa')](function(_0x1e0108){logger[_0x3504('0xb')](_0x3504('0x23'),_0x129a5f);logger['debug'](_0x3504('0x23'),_0x129a5f,JSON[_0x3504('0x10')](_0x1e0108));_0xe0e83(_0x1e0108);})['catch'](function(_0x25b39c){logger[_0x3504('0x11')](_0x3504('0x23'),_0x25b39c[_0x3504('0x13')],_0x129a5f);_0x4d1c67(_0x2e3d51['error'](0x1f4,_0x25b39c['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js
index 2607fd6..d0464d7 100644
--- a/server/api/voiceChanSpy/index.js
+++ b/server/api/voiceChanSpy/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f4a=['./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','../../config/environment'];(function(_0x55d0fd,_0x1b1bdd){var _0x40ce6f=function(_0x282df9){while(--_0x282df9){_0x55d0fd['push'](_0x55d0fd['shift']());}};_0x40ce6f(++_0x1b1bdd);}(_0x5f4a,0x1bc));var _0xa5f4=function(_0x233efd,_0x10c29a){_0x233efd=_0x233efd-0x0;var _0x26d821=_0x5f4a[_0x233efd];return _0x26d821;};'use strict';var multer=require(_0xa5f4('0x0'));var util=require(_0xa5f4('0x1'));var path=require('path');var timeout=require(_0xa5f4('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5f4('0x3'));var controller=require(_0xa5f4('0x4'));router[_0xa5f4('0x5')]('/',auth[_0xa5f4('0x6')](),controller[_0xa5f4('0x7')]);router[_0xa5f4('0x5')](_0xa5f4('0x8'),auth[_0xa5f4('0x6')](),controller[_0xa5f4('0x9')]);router[_0xa5f4('0xa')]('/',auth[_0xa5f4('0x6')](),controller[_0xa5f4('0xb')]);router['put'](_0xa5f4('0x8'),auth[_0xa5f4('0x6')](),controller[_0xa5f4('0xc')]);router[_0xa5f4('0xd')](_0xa5f4('0x8'),auth['isAuthenticated'](),controller[_0xa5f4('0xe')]);module[_0xa5f4('0xf')]=router;
\ No newline at end of file
+var _0x908e=['destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','index','get','/:id','isAuthenticated','show','post','create'];(function(_0x188e96,_0x1cb37e){var _0x34912d=function(_0x1e9a7a){while(--_0x1e9a7a){_0x188e96['push'](_0x188e96['shift']());}};_0x34912d(++_0x1cb37e);}(_0x908e,0x182));var _0xe908=function(_0x528654,_0x4b2116){_0x528654=_0x528654-0x0;var _0x13dd98=_0x908e[_0x528654];return _0x13dd98;};'use strict';var multer=require(_0xe908('0x0'));var util=require(_0xe908('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe908('0x2'));var router=express[_0xe908('0x3')]();var auth=require(_0xe908('0x4'));var interaction=require(_0xe908('0x5'));var config=require('../../config/environment');var controller=require(_0xe908('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xe908('0x7')]);router[_0xe908('0x8')](_0xe908('0x9'),auth[_0xe908('0xa')](),controller[_0xe908('0xb')]);router[_0xe908('0xc')]('/',auth['isAuthenticated'](),controller[_0xe908('0xd')]);router['put'](_0xe908('0x9'),auth[_0xe908('0xa')](),controller['update']);router['delete'](_0xe908('0x9'),auth[_0xe908('0xa')](),controller[_0xe908('0xe')]);module[_0xe908('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js
index 6c94219..9ed2556 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.attributes.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x489a=['STRING','name','join','getDataValue','options','split','sequelize','exports'];(function(_0x53f90a,_0x2bb140){var _0x1106c4=function(_0x3be148){while(--_0x3be148){_0x53f90a['push'](_0x53f90a['shift']());}};_0x1106c4(++_0x2bb140);}(_0x489a,0x66));var _0xa489=function(_0x5a2b99,_0xb0e62){_0x5a2b99=_0x5a2b99-0x0;var _0x46b640=_0x489a[_0x5a2b99];return _0x46b640;};'use strict';var Sequelize=require(_0xa489('0x0'));module[_0xa489('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xa489('0x2')],'unique':_0xa489('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xa489('0x2')],'set':function(_0x178628){this['setDataValue']('options',_0x178628?_0x178628[_0xa489('0x4')](''):[]);},'get':function(){return this[_0xa489('0x5')](_0xa489('0x6'))?this['getDataValue'](_0xa489('0x6'))[_0xa489('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa489('0x2')]},'description':{'type':Sequelize[_0xa489('0x2')]}};
\ No newline at end of file
+var _0x46c9=['name','setDataValue','options','BOOLEAN','exports','STRING'];(function(_0x4baeff,_0x44790c){var _0x4d78c5=function(_0x132f18){while(--_0x132f18){_0x4baeff['push'](_0x4baeff['shift']());}};_0x4d78c5(++_0x44790c);}(_0x46c9,0x1f0));var _0x946c=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0x46c9[_0x1c8cc6];return _0x522936;};'use strict';var Sequelize=require('sequelize');module[_0x946c('0x0')]={'name':{'type':Sequelize[_0x946c('0x1')]},'prefix':{'type':Sequelize[_0x946c('0x1')],'unique':_0x946c('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x946c('0x1')],'set':function(_0x121ab5){this[_0x946c('0x3')](_0x946c('0x4'),_0x121ab5?_0x121ab5['join'](''):[]);},'get':function(){return this['getDataValue'](_0x946c('0x4'))?this['getDataValue'](_0x946c('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x946c('0x5')],'defaultValue':![]},'password':{'type':Sequelize[_0x946c('0x1')]},'record':{'type':Sequelize[_0x946c('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x946c('0x1')]},'description':{'type':Sequelize[_0x946c('0x1')]}};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js
index 93f7fb0..47c111c 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.controller.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9baa=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','get','ChanSpies','UserProfileResource','destroy','name','index','map','VoiceChanSpy','rawAttributes','fieldName','type','model'];(function(_0x1a3c9b,_0x3eb0cb){var _0x57f1d8=function(_0x53662d){while(--_0x53662d){_0x1a3c9b['push'](_0x1a3c9b['shift']());}};_0x57f1d8(++_0x3eb0cb);}(_0x9baa,0x1a9));var _0xa9ba=function(_0xb36adc,_0x1ed5cd){_0xb36adc=_0xb36adc-0x0;var _0x1dedd7=_0x9baa[_0xb36adc];return _0x1dedd7;};'use strict';var pdf=require(_0xa9ba('0x0'));var emlformat=require(_0xa9ba('0x1'));var rimraf=require(_0xa9ba('0x2'));var zipdir=require(_0xa9ba('0x3'));var jsonpatch=require(_0xa9ba('0x4'));var rp=require(_0xa9ba('0x5'));var moment=require(_0xa9ba('0x6'));var BPromise=require(_0xa9ba('0x7'));var Mustache=require(_0xa9ba('0x8'));var util=require(_0xa9ba('0x9'));var path=require(_0xa9ba('0xa'));var sox=require(_0xa9ba('0xb'));var csv=require(_0xa9ba('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa9ba('0xd'));var squel=require(_0xa9ba('0xe'));var crypto=require(_0xa9ba('0xf'));var jsforce=require(_0xa9ba('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa9ba('0xc'));var querystring=require(_0xa9ba('0x11'));var Papa=require(_0xa9ba('0x12'));var Redis=require('ioredis');var authService=require(_0xa9ba('0x13'));var qs=require(_0xa9ba('0x14'));var as=require(_0xa9ba('0x15'));var hardwareService=require(_0xa9ba('0x16'));var logger=require(_0xa9ba('0x17'))(_0xa9ba('0x18'));var utils=require(_0xa9ba('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2737d6,_0x466ff6){_0x466ff6=_0x466ff6||0xcc;return function(_0x253feb){if(_0x253feb){return _0x2737d6[_0xa9ba('0x1a')](_0x466ff6);}return _0x2737d6[_0xa9ba('0x1b')](_0x466ff6)['end']();};}function respondWithResult(_0x1f5899,_0x34f9a4){_0x34f9a4=_0x34f9a4||0xc8;return function(_0x24bbe5){if(_0x24bbe5){return _0x1f5899[_0xa9ba('0x1b')](_0x34f9a4)[_0xa9ba('0x1c')](_0x24bbe5);}};}function respondWithFilteredResult(_0x434c00,_0x5a0b4a){return function(_0x2d9429){if(_0x2d9429){var _0x8c80fd=_0x2d9429[_0xa9ba('0x1d')],_0x116216=_0x5a0b4a['offset'],_0x437fe0=_0x5a0b4a[_0xa9ba('0x1e')]+_0x5a0b4a[_0xa9ba('0x1f')],_0x1ef176;if(_0x437fe0>=_0x8c80fd){_0x437fe0=_0x8c80fd;_0x1ef176=0xc8;}else{_0x1ef176=0xce;}_0x434c00['status'](_0x1ef176);return _0x434c00[_0xa9ba('0x20')](_0xa9ba('0x21'),_0x116216+'-'+_0x437fe0+'/'+_0x8c80fd)['json'](_0x2d9429);}return null;};}function patchUpdates(_0xe145bb){return function(_0x29e557){try{jsonpatch['apply'](_0x29e557,_0xe145bb,!![]);}catch(_0x5d0de1){return BPromise[_0xa9ba('0x22')](_0x5d0de1);}return _0x29e557['save']();};}function saveUpdates(_0x24a897,_0x5e8064){return function(_0x1bdcc2){if(_0x1bdcc2){return _0x1bdcc2[_0xa9ba('0x23')](_0x24a897)[_0xa9ba('0x24')](function(_0x56d60e){return _0x56d60e;});}return null;};}function removeEntity(_0xa38c16,_0x437ac5){return function(_0x2491c2){if(_0x2491c2){return _0x2491c2['destroy']()[_0xa9ba('0x24')](function(){var _0x344303=_0x2491c2[_0xa9ba('0x25')]({'plain':!![]});var _0xe283c2=_0xa9ba('0x26');return db[_0xa9ba('0x27')][_0xa9ba('0x28')]({'where':{'type':_0xe283c2,'resourceId':_0x344303['id']}})['then'](function(){return _0x2491c2;});})[_0xa9ba('0x24')](function(){_0xa38c16[_0xa9ba('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc189c7,_0xf0972d){return function(_0xbda073){if(!_0xbda073){_0xc189c7[_0xa9ba('0x1a')](0x194);}return _0xbda073;};}function handleError(_0x2d0463,_0x4cb829){_0x4cb829=_0x4cb829||0x1f4;return function(_0x88ac36){logger['error'](_0x88ac36['stack']);if(_0x88ac36[_0xa9ba('0x29')]){delete _0x88ac36[_0xa9ba('0x29')];}_0x2d0463[_0xa9ba('0x1b')](_0x4cb829)['send'](_0x88ac36);};}exports[_0xa9ba('0x2a')]=function(_0x5b2a0a,_0x41baa8){var _0x5175c6={},_0x186f14={},_0x40fd80={'count':0x0,'rows':[]};var _0x4b8c5b=_[_0xa9ba('0x2b')](db[_0xa9ba('0x2c')][_0xa9ba('0x2d')],function(_0x88c9af){return{'name':_0x88c9af[_0xa9ba('0x2e')],'type':_0x88c9af[_0xa9ba('0x2f')]['key']};});_0x186f14[_0xa9ba('0x30')]=_['map'](_0x4b8c5b,_0xa9ba('0x29'));_0x186f14[_0xa9ba('0x31')]=_[_0xa9ba('0x32')](_0x5b2a0a['query']);_0x186f14['filters']=_[_0xa9ba('0x33')](_0x186f14['model'],_0x186f14[_0xa9ba('0x31')]);_0x5175c6[_0xa9ba('0x34')]=_['intersection'](_0x186f14[_0xa9ba('0x30')],qs[_0xa9ba('0x35')](_0x5b2a0a[_0xa9ba('0x31')]['fields']));_0x5175c6[_0xa9ba('0x34')]=_0x5175c6['attributes'][_0xa9ba('0x36')]?_0x5175c6['attributes']:_0x186f14[_0xa9ba('0x30')];if(!_0x5b2a0a[_0xa9ba('0x31')][_0xa9ba('0x37')](_0xa9ba('0x38'))){_0x5175c6[_0xa9ba('0x1f')]=qs[_0xa9ba('0x1f')](_0x5b2a0a[_0xa9ba('0x31')][_0xa9ba('0x1f')]);_0x5175c6[_0xa9ba('0x1e')]=qs[_0xa9ba('0x1e')](_0x5b2a0a['query'][_0xa9ba('0x1e')]);}_0x5175c6[_0xa9ba('0x39')]=qs[_0xa9ba('0x3a')](_0x5b2a0a['query']['sort']);_0x5175c6[_0xa9ba('0x3b')]=qs[_0xa9ba('0x3c')](_[_0xa9ba('0x3d')](_0x5b2a0a['query'],_0x186f14['filters']),_0x4b8c5b);if(_0x5b2a0a['query']['filter']){_0x5175c6[_0xa9ba('0x3b')]=_[_0xa9ba('0x3e')](_0x5175c6[_0xa9ba('0x3b')],{'$or':_[_0xa9ba('0x2b')](_0x4b8c5b,function(_0x37e2e0){if(_0x37e2e0['type']!==_0xa9ba('0x3f')){var _0x1360fb={};_0x1360fb[_0x37e2e0[_0xa9ba('0x29')]]={'$like':'%'+_0x5b2a0a[_0xa9ba('0x31')]['filter']+'%'};return _0x1360fb;}})});}_0x5175c6=_[_0xa9ba('0x3e')]({},_0x5175c6,_0x5b2a0a[_0xa9ba('0x40')]);var _0x2cdf21={'where':_0x5175c6[_0xa9ba('0x3b')]};return db['VoiceChanSpy']['count'](_0x2cdf21)[_0xa9ba('0x24')](function(_0x59158a){_0x40fd80[_0xa9ba('0x1d')]=_0x59158a;if(_0x5b2a0a['query'][_0xa9ba('0x41')]){_0x5175c6[_0xa9ba('0x42')]=[{'all':!![]}];}return db[_0xa9ba('0x2c')][_0xa9ba('0x43')](_0x5175c6);})['then'](function(_0x159573){_0x40fd80[_0xa9ba('0x44')]=_0x159573;return _0x40fd80;})['then'](respondWithFilteredResult(_0x41baa8,_0x5175c6))[_0xa9ba('0x45')](handleError(_0x41baa8,null));};exports[_0xa9ba('0x46')]=function(_0x13bbdd,_0x1f6f3a){var _0x4a7ccc={'raw':![],'where':{'id':_0x13bbdd[_0xa9ba('0x47')]['id']}},_0x150d49={};_0x150d49[_0xa9ba('0x30')]=_[_0xa9ba('0x32')](db[_0xa9ba('0x2c')]['rawAttributes']);_0x150d49[_0xa9ba('0x31')]=_[_0xa9ba('0x32')](_0x13bbdd[_0xa9ba('0x31')]);_0x150d49[_0xa9ba('0x3c')]=_[_0xa9ba('0x33')](_0x150d49[_0xa9ba('0x30')],_0x150d49[_0xa9ba('0x31')]);_0x4a7ccc[_0xa9ba('0x34')]=_['intersection'](_0x150d49['model'],qs[_0xa9ba('0x35')](_0x13bbdd[_0xa9ba('0x31')][_0xa9ba('0x35')]));_0x4a7ccc[_0xa9ba('0x34')]=_0x4a7ccc[_0xa9ba('0x34')][_0xa9ba('0x36')]?_0x4a7ccc[_0xa9ba('0x34')]:_0x150d49['model'];if(_0x13bbdd[_0xa9ba('0x31')][_0xa9ba('0x41')]){_0x4a7ccc[_0xa9ba('0x42')]=[{'all':!![]}];}_0x4a7ccc=_['merge']({},_0x4a7ccc,_0x13bbdd[_0xa9ba('0x40')]);return db[_0xa9ba('0x2c')][_0xa9ba('0x48')](_0x4a7ccc)[_0xa9ba('0x24')](handleEntityNotFound(_0x1f6f3a,null))['then'](respondWithResult(_0x1f6f3a,null))[_0xa9ba('0x45')](handleError(_0x1f6f3a,null));};exports[_0xa9ba('0x49')]=function(_0x4e6292,_0x17a6ca){return db['VoiceChanSpy'][_0xa9ba('0x49')](_0x4e6292[_0xa9ba('0x4a')],{})[_0xa9ba('0x24')](function(_0x2b38d9){var _0x482fc1=_0x4e6292[_0xa9ba('0x4b')][_0xa9ba('0x25')]({'plain':!![]});if(!_0x482fc1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482fc1[_0xa9ba('0x4c')]===_0xa9ba('0x4b')){var _0x3ad2be=_0x2b38d9[_0xa9ba('0x25')]({'plain':!![]});var _0x22b098=_0xa9ba('0x26');return db['UserProfileSection'][_0xa9ba('0x48')]({'where':{'name':_0x22b098,'userProfileId':_0x482fc1['userProfileId']},'raw':!![]})[_0xa9ba('0x24')](function(_0x4b34f8){if(_0x4b34f8&&_0x4b34f8[_0xa9ba('0x4d')]===0x0){return db['UserProfileResource'][_0xa9ba('0x49')]({'name':_0x3ad2be[_0xa9ba('0x29')],'resourceId':_0x3ad2be['id'],'type':_0x4b34f8[_0xa9ba('0x29')],'sectionId':_0x4b34f8['id']},{})[_0xa9ba('0x24')](function(){return _0x2b38d9;});}else{return _0x2b38d9;}})['catch'](function(_0x3feec3){logger['error'](_0xa9ba('0x4e'),_0x3feec3);throw _0x3feec3;});}return _0x2b38d9;})['then'](respondWithResult(_0x17a6ca,0xc9))['catch'](handleError(_0x17a6ca,null));};exports[_0xa9ba('0x23')]=function(_0x2e8b48,_0x10eef1){if(_0x2e8b48['body']['id']){delete _0x2e8b48[_0xa9ba('0x4a')]['id'];}return db[_0xa9ba('0x2c')][_0xa9ba('0x48')]({'where':{'id':_0x2e8b48['params']['id']}})[_0xa9ba('0x24')](handleEntityNotFound(_0x10eef1,null))[_0xa9ba('0x24')](saveUpdates(_0x2e8b48[_0xa9ba('0x4a')],null))['then'](respondWithResult(_0x10eef1,null))[_0xa9ba('0x45')](handleError(_0x10eef1,null));};exports[_0xa9ba('0x28')]=function(_0x521f7f,_0x3d7cdc){return db[_0xa9ba('0x2c')][_0xa9ba('0x48')]({'where':{'id':_0x521f7f['params']['id']}})['then'](handleEntityNotFound(_0x3d7cdc,null))[_0xa9ba('0x24')](removeEntity(_0x3d7cdc,null))['catch'](handleError(_0x3d7cdc,null));};
\ No newline at end of file
+var _0x0c5d=['desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','then','destroy','get','ChanSpies','error','stack','name','index','map','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x0c5d,0x133));var _0xd0c5=function(_0x55705f,_0x2fa2ce){_0x55705f=_0x55705f-0x0;var _0x13c1b3=_0x0c5d[_0x55705f];return _0x13c1b3;};'use strict';var pdf=require(_0xd0c5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd0c5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd0c5('0x2'));var BPromise=require(_0xd0c5('0x3'));var Mustache=require(_0xd0c5('0x4'));var util=require(_0xd0c5('0x5'));var path=require(_0xd0c5('0x6'));var sox=require(_0xd0c5('0x7'));var csv=require(_0xd0c5('0x8'));var ejs=require(_0xd0c5('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd0c5('0xa'));var crypto=require(_0xd0c5('0xb'));var jsforce=require(_0xd0c5('0xc'));var deskjs=require(_0xd0c5('0xd'));var toCsv=require(_0xd0c5('0x8'));var querystring=require('querystring');var Papa=require(_0xd0c5('0xe'));var Redis=require('ioredis');var authService=require(_0xd0c5('0xf'));var qs=require(_0xd0c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0c5('0x11'));var logger=require(_0xd0c5('0x12'))(_0xd0c5('0x13'));var utils=require(_0xd0c5('0x14'));var config=require(_0xd0c5('0x15'));var db=require(_0xd0c5('0x16'))['db'];function respondWithStatusCode(_0x5bee80,_0x5ef1f7){_0x5ef1f7=_0x5ef1f7||0xcc;return function(_0x229730){if(_0x229730){return _0x5bee80[_0xd0c5('0x17')](_0x5ef1f7);}return _0x5bee80['status'](_0x5ef1f7)[_0xd0c5('0x18')]();};}function respondWithResult(_0x2ca456,_0xc3a68e){_0xc3a68e=_0xc3a68e||0xc8;return function(_0x56a020){if(_0x56a020){return _0x2ca456[_0xd0c5('0x19')](_0xc3a68e)[_0xd0c5('0x1a')](_0x56a020);}};}function respondWithFilteredResult(_0x3d7286,_0x209558){return function(_0x49cf1c){if(_0x49cf1c){var _0x441087=_0x49cf1c['count'],_0x469a8e=_0x209558['offset'],_0x34800=_0x209558[_0xd0c5('0x1b')]+_0x209558[_0xd0c5('0x1c')],_0x10684f;if(_0x34800>=_0x441087){_0x34800=_0x441087;_0x10684f=0xc8;}else{_0x10684f=0xce;}_0x3d7286[_0xd0c5('0x19')](_0x10684f);return _0x3d7286[_0xd0c5('0x1d')](_0xd0c5('0x1e'),_0x469a8e+'-'+_0x34800+'/'+_0x441087)[_0xd0c5('0x1a')](_0x49cf1c);}return null;};}function patchUpdates(_0x2a5245){return function(_0x47867f){try{jsonpatch['apply'](_0x47867f,_0x2a5245,!![]);}catch(_0x1e408a){return BPromise[_0xd0c5('0x1f')](_0x1e408a);}return _0x47867f[_0xd0c5('0x20')]();};}function saveUpdates(_0x336aa1,_0x57fb7d){return function(_0x2d4b78){if(_0x2d4b78){return _0x2d4b78['update'](_0x336aa1)[_0xd0c5('0x21')](function(_0x40d930){return _0x40d930;});}return null;};}function removeEntity(_0x42104d,_0x552d04){return function(_0x167c0f){if(_0x167c0f){return _0x167c0f[_0xd0c5('0x22')]()['then'](function(){var _0x123e16=_0x167c0f[_0xd0c5('0x23')]({'plain':!![]});var _0x15e4b2=_0xd0c5('0x24');return db['UserProfileResource'][_0xd0c5('0x22')]({'where':{'type':_0x15e4b2,'resourceId':_0x123e16['id']}})['then'](function(){return _0x167c0f;});})['then'](function(){_0x42104d[_0xd0c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38c30a,_0x40a1f9){return function(_0x53ec2c){if(!_0x53ec2c){_0x38c30a[_0xd0c5('0x17')](0x194);}return _0x53ec2c;};}function handleError(_0x1a1b36,_0x46eb9e){_0x46eb9e=_0x46eb9e||0x1f4;return function(_0x12f7d2){logger[_0xd0c5('0x25')](_0x12f7d2[_0xd0c5('0x26')]);if(_0x12f7d2[_0xd0c5('0x27')]){delete _0x12f7d2[_0xd0c5('0x27')];}_0x1a1b36[_0xd0c5('0x19')](_0x46eb9e)['send'](_0x12f7d2);};}exports[_0xd0c5('0x28')]=function(_0x1c4138,_0x2f5ecf){var _0xfb36e0={},_0x366d48={},_0x1e2198={'count':0x0,'rows':[]};var _0x4d1c49=_[_0xd0c5('0x29')](db['VoiceChanSpy']['rawAttributes'],function(_0x2c2275){return{'name':_0x2c2275[_0xd0c5('0x2a')],'type':_0x2c2275[_0xd0c5('0x2b')][_0xd0c5('0x2c')]};});_0x366d48['model']=_[_0xd0c5('0x29')](_0x4d1c49,_0xd0c5('0x27'));_0x366d48[_0xd0c5('0x2d')]=_['keys'](_0x1c4138[_0xd0c5('0x2d')]);_0x366d48[_0xd0c5('0x2e')]=_[_0xd0c5('0x2f')](_0x366d48[_0xd0c5('0x30')],_0x366d48[_0xd0c5('0x2d')]);_0xfb36e0['attributes']=_[_0xd0c5('0x2f')](_0x366d48[_0xd0c5('0x30')],qs[_0xd0c5('0x31')](_0x1c4138[_0xd0c5('0x2d')][_0xd0c5('0x31')]));_0xfb36e0[_0xd0c5('0x32')]=_0xfb36e0[_0xd0c5('0x32')][_0xd0c5('0x33')]?_0xfb36e0[_0xd0c5('0x32')]:_0x366d48[_0xd0c5('0x30')];if(!_0x1c4138[_0xd0c5('0x2d')][_0xd0c5('0x34')](_0xd0c5('0x35'))){_0xfb36e0[_0xd0c5('0x1c')]=qs[_0xd0c5('0x1c')](_0x1c4138[_0xd0c5('0x2d')][_0xd0c5('0x1c')]);_0xfb36e0['offset']=qs[_0xd0c5('0x1b')](_0x1c4138[_0xd0c5('0x2d')][_0xd0c5('0x1b')]);}_0xfb36e0['order']=qs[_0xd0c5('0x36')](_0x1c4138[_0xd0c5('0x2d')]['sort']);_0xfb36e0[_0xd0c5('0x37')]=qs[_0xd0c5('0x2e')](_[_0xd0c5('0x38')](_0x1c4138[_0xd0c5('0x2d')],_0x366d48[_0xd0c5('0x2e')]),_0x4d1c49);if(_0x1c4138[_0xd0c5('0x2d')][_0xd0c5('0x39')]){_0xfb36e0['where']=_[_0xd0c5('0x3a')](_0xfb36e0['where'],{'$or':_[_0xd0c5('0x29')](_0x4d1c49,function(_0x1d7b75){if(_0x1d7b75[_0xd0c5('0x2b')]!==_0xd0c5('0x3b')){var _0xb4d0be={};_0xb4d0be[_0x1d7b75[_0xd0c5('0x27')]]={'$like':'%'+_0x1c4138[_0xd0c5('0x2d')][_0xd0c5('0x39')]+'%'};return _0xb4d0be;}})});}_0xfb36e0=_[_0xd0c5('0x3a')]({},_0xfb36e0,_0x1c4138[_0xd0c5('0x3c')]);var _0x7040b8={'where':_0xfb36e0[_0xd0c5('0x37')]};return db[_0xd0c5('0x3d')]['count'](_0x7040b8)[_0xd0c5('0x21')](function(_0x4f86c4){_0x1e2198['count']=_0x4f86c4;if(_0x1c4138['query'][_0xd0c5('0x3e')]){_0xfb36e0[_0xd0c5('0x3f')]=[{'all':!![]}];}return db[_0xd0c5('0x3d')]['findAll'](_0xfb36e0);})[_0xd0c5('0x21')](function(_0x593a33){_0x1e2198[_0xd0c5('0x40')]=_0x593a33;return _0x1e2198;})[_0xd0c5('0x21')](respondWithFilteredResult(_0x2f5ecf,_0xfb36e0))['catch'](handleError(_0x2f5ecf,null));};exports[_0xd0c5('0x41')]=function(_0x2f4879,_0x385ee6){var _0x2078bc={'raw':![],'where':{'id':_0x2f4879[_0xd0c5('0x42')]['id']}},_0x131d56={};_0x131d56['model']=_[_0xd0c5('0x43')](db['VoiceChanSpy'][_0xd0c5('0x44')]);_0x131d56['query']=_[_0xd0c5('0x43')](_0x2f4879[_0xd0c5('0x2d')]);_0x131d56[_0xd0c5('0x2e')]=_[_0xd0c5('0x2f')](_0x131d56['model'],_0x131d56[_0xd0c5('0x2d')]);_0x2078bc[_0xd0c5('0x32')]=_[_0xd0c5('0x2f')](_0x131d56[_0xd0c5('0x30')],qs[_0xd0c5('0x31')](_0x2f4879[_0xd0c5('0x2d')]['fields']));_0x2078bc['attributes']=_0x2078bc[_0xd0c5('0x32')][_0xd0c5('0x33')]?_0x2078bc[_0xd0c5('0x32')]:_0x131d56[_0xd0c5('0x30')];if(_0x2f4879[_0xd0c5('0x2d')][_0xd0c5('0x3e')]){_0x2078bc[_0xd0c5('0x3f')]=[{'all':!![]}];}_0x2078bc=_[_0xd0c5('0x3a')]({},_0x2078bc,_0x2f4879[_0xd0c5('0x3c')]);return db[_0xd0c5('0x3d')][_0xd0c5('0x45')](_0x2078bc)[_0xd0c5('0x21')](handleEntityNotFound(_0x385ee6,null))[_0xd0c5('0x21')](respondWithResult(_0x385ee6,null))[_0xd0c5('0x46')](handleError(_0x385ee6,null));};exports[_0xd0c5('0x47')]=function(_0x2b77f1,_0x590db0){return db[_0xd0c5('0x3d')][_0xd0c5('0x47')](_0x2b77f1[_0xd0c5('0x48')],{})['then'](function(_0x3fe6d6){var _0x172d1e=_0x2b77f1[_0xd0c5('0x49')][_0xd0c5('0x23')]({'plain':!![]});if(!_0x172d1e)throw new Error(_0xd0c5('0x4a'));if(_0x172d1e['role']===_0xd0c5('0x49')){var _0x16630b=_0x3fe6d6[_0xd0c5('0x23')]({'plain':!![]});var _0x57dc97=_0xd0c5('0x24');return db['UserProfileSection'][_0xd0c5('0x45')]({'where':{'name':_0x57dc97,'userProfileId':_0x172d1e[_0xd0c5('0x4b')]},'raw':!![]})[_0xd0c5('0x21')](function(_0x151a33){if(_0x151a33&&_0x151a33[_0xd0c5('0x4c')]===0x0){return db[_0xd0c5('0x4d')]['create']({'name':_0x16630b[_0xd0c5('0x27')],'resourceId':_0x16630b['id'],'type':_0x151a33[_0xd0c5('0x27')],'sectionId':_0x151a33['id']},{})[_0xd0c5('0x21')](function(){return _0x3fe6d6;});}else{return _0x3fe6d6;}})[_0xd0c5('0x46')](function(_0x2b4ca4){logger['error'](_0xd0c5('0x4e'),_0x2b4ca4);throw _0x2b4ca4;});}return _0x3fe6d6;})[_0xd0c5('0x21')](respondWithResult(_0x590db0,0xc9))[_0xd0c5('0x46')](handleError(_0x590db0,null));};exports[_0xd0c5('0x4f')]=function(_0x1eb10f,_0x3d3dd5){if(_0x1eb10f['body']['id']){delete _0x1eb10f['body']['id'];}return db[_0xd0c5('0x3d')][_0xd0c5('0x45')]({'where':{'id':_0x1eb10f[_0xd0c5('0x42')]['id']}})[_0xd0c5('0x21')](handleEntityNotFound(_0x3d3dd5,null))[_0xd0c5('0x21')](saveUpdates(_0x1eb10f[_0xd0c5('0x48')],null))[_0xd0c5('0x21')](respondWithResult(_0x3d3dd5,null))['catch'](handleError(_0x3d3dd5,null));};exports[_0xd0c5('0x22')]=function(_0x12a2cf,_0x6bce35){return db['VoiceChanSpy']['find']({'where':{'id':_0x12a2cf['params']['id']}})[_0xd0c5('0x21')](handleEntityNotFound(_0x6bce35,null))[_0xd0c5('0x21')](removeEntity(_0x6bce35,null))['catch'](handleError(_0x6bce35,null));};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js
index fc9a79c..6b7a3c1 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.model.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf75=['Authenticate','password','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','format','${UNIQUEID}.%s,a','auth'];(function(_0x1891e6,_0x1e6527){var _0x48ddbf=function(_0x1ab9ca){while(--_0x1ab9ca){_0x1891e6['push'](_0x1891e6['shift']());}};_0x48ddbf(++_0x1e6527);}(_0xcf75,0x83));var _0x5cf7=function(_0x257b5a,_0x360f51){_0x257b5a=_0x257b5a-0x0;var _0x5828f3=_0xcf75[_0x257b5a];return _0x5828f3;};'use strict';var _=require('lodash');var util=require(_0x5cf7('0x0'));var BPromise=require(_0x5cf7('0x1'));var attributes=require(_0x5cf7('0x2'));var getUserApplications=function(_0x50a52c,_0x49518b,_0x38652e){var _0x33c651=0x1;var _0x5ef72f=[];var _0x4e4b1e={'context':_0x49518b[_0x5cf7('0x3')]||_0x5cf7('0x4'),'exten':util['format'](_0x5cf7('0x5'),_0x50a52c[_0x5cf7('0x6')],_0x38652e),'type':'system','isApp':![],'ChanSpyId':_0x50a52c['id'],'UserId':_0x49518b['id']};_0x5ef72f[_0x5cf7('0x7')](_[_0x5cf7('0x8')]({'app':_0x5cf7('0x9'),'appdata':util['format'](_0x5cf7('0xa'),_0x5cf7('0xb')),'priority':_0x33c651++},_0x4e4b1e));if(_0x50a52c[_0x5cf7('0xc')]){_0x5ef72f[_0x5cf7('0x7')](_['merge']({'app':_0x5cf7('0xd'),'appdata':util[_0x5cf7('0xe')](_0x5cf7('0xf'),_0x50a52c['recordingFormat']),'priority':_0x33c651++},_0x4e4b1e));}if(_0x50a52c[_0x5cf7('0x10')]){_0x5ef72f[_0x5cf7('0x7')](_[_0x5cf7('0x8')]({'app':_0x5cf7('0x11'),'appdata':_0x50a52c[_0x5cf7('0x12')],'priority':_0x33c651++},_0x4e4b1e));}_0x5ef72f[_0x5cf7('0x7')](_[_0x5cf7('0x8')]({'app':'ChanSpy','appdata':util[_0x5cf7('0xe')]('SIP/%s,%s',_0x49518b[_0x5cf7('0x13')],_0x50a52c[_0x5cf7('0x14')]?_0x50a52c['options'][_0x5cf7('0x15')](''):''),'priority':_0x33c651++},_0x4e4b1e));if(_0x50a52c[_0x5cf7('0xc')]){_0x5ef72f[_0x5cf7('0x7')](_['merge']({'app':_0x5cf7('0x16'),'priority':_0x33c651++},_0x4e4b1e));}return _0x5ef72f;};var getChanSpyApplications=function(_0x173334,_0x203307){var _0x166469=[];for(var _0x43d644=0x0,_0x15657f=0x1;_0x43d644<_0x203307[_0x5cf7('0x17')];_0x43d644++,_0x15657f=0x1){_0x166469=_0x166469[_0x5cf7('0x18')](getUserApplications(_0x173334,_0x203307[_0x43d644],_0x203307[_0x43d644][_0x5cf7('0x19')]));if(_0x203307[_0x43d644][_0x5cf7('0x19')]!=_0x203307[_0x43d644][_0x5cf7('0x13')]){_0x166469=_0x166469['concat'](getUserApplications(_0x173334,_0x203307[_0x43d644],_0x203307[_0x43d644][_0x5cf7('0x13')]));}}return _0x166469;};var getChanSpyPromise=function(_0x1543ee,_0x5751d4){return new BPromise(function(_0x12c654,_0x2d5a14){return _0x1543ee[_0x5cf7('0x1a')][_0x5cf7('0x1b')]({'attributes':['id',_0x5cf7('0x13'),'internal'],'where':{'role':_0x5cf7('0x1c'),'chanspy':!![]},'raw':!![]})[_0x5cf7('0x1d')](function(_0x24065d){if(_0x24065d){return _0x12c654(getChanSpyApplications(_0x5751d4,_0x24065d));}return _0x12c654([]);})[_0x5cf7('0x1e')](function(_0x12bda3){_0x2d5a14(_0x12bda3);});});};module['exports']=function(_0x1f6435,_0x1867cb){var _0x1d92dc=_0x1f6435['models'];return _0x1f6435[_0x5cf7('0x1f')](_0x5cf7('0x20'),attributes,{'tableName':_0x5cf7('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fd3aa,_0x30f4ce,_0x3c357d){return getChanSpyPromise(_0x1d92dc,_0x1fd3aa)['then'](function(_0x3ba3aa){if(_0x3ba3aa&&_0x3ba3aa[_0x5cf7('0x17')]){return _0x1d92dc[_0x5cf7('0x22')][_0x5cf7('0x23')](_0x3ba3aa);}})[_0x5cf7('0x1d')](function(){_0x3c357d();})[_0x5cf7('0x1e')](function(_0x3fec44){_0x3c357d(_0x3fec44);});},'afterUpdate':function(_0x5b94dd,_0x8f77f1,_0x38f7fa){return _0x1d92dc['VoiceExtension'][_0x5cf7('0x24')]({'where':{'ChanSpyId':_0x5b94dd['id']}})['then'](function(){return getChanSpyPromise(_0x1d92dc,_0x5b94dd);})['then'](function(_0x3abf5e){if(_0x3abf5e&&_0x3abf5e[_0x5cf7('0x17')]){return _0x1d92dc[_0x5cf7('0x22')]['bulkCreate'](_0x3abf5e);}})[_0x5cf7('0x1d')](function(){_0x38f7fa();})['catch'](function(_0x206426){_0x38f7fa(_0x206426);});},'afterDestroy':function(_0xf02208,_0x5dd808,_0x58277f){return _0x1d92dc[_0x5cf7('0x22')]['destroy']({'where':{'ChanSpyId':_0xf02208['id']}})[_0x5cf7('0x1d')](function(){_0x58277f();})[_0x5cf7('0x1e')](function(_0x45c423){_0x58277f(_0x45c423);});}}});};
\ No newline at end of file
+var _0xe9f9=['concat','User','findAll','catch','exports','define','VoiceChanSpy','length','bulkCreate','then','VoiceExtension','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','system','push','merge','format','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','internal','name'];(function(_0x639501,_0x13c193){var _0x5219b1=function(_0x356ab1){while(--_0x356ab1){_0x639501['push'](_0x639501['shift']());}};_0x5219b1(++_0x13c193);}(_0xe9f9,0x174));var _0x9e9f=function(_0x1c7136,_0x4bb9c4){_0x1c7136=_0x1c7136-0x0;var _0x401f8c=_0xe9f9[_0x1c7136];return _0x401f8c;};'use strict';var _=require(_0x9e9f('0x0'));var util=require('util');var BPromise=require(_0x9e9f('0x1'));var attributes=require(_0x9e9f('0x2'));var getUserApplications=function(_0x24e489,_0x439590,_0x15d8d0){var _0x4b8f3c=0x1;var _0x2020b3=[];var _0x47f4c7={'context':_0x439590[_0x9e9f('0x3')]||_0x9e9f('0x4'),'exten':util['format'](_0x9e9f('0x5'),_0x24e489['prefix'],_0x15d8d0),'type':_0x9e9f('0x6'),'isApp':![],'ChanSpyId':_0x24e489['id'],'UserId':_0x439590['id']};_0x2020b3[_0x9e9f('0x7')](_[_0x9e9f('0x8')]({'app':'Set','appdata':util[_0x9e9f('0x9')](_0x9e9f('0xa'),_0x9e9f('0xb')),'priority':_0x4b8f3c++},_0x47f4c7));if(_0x24e489[_0x9e9f('0xc')]){_0x2020b3[_0x9e9f('0x7')](_[_0x9e9f('0x8')]({'app':'MixMonitor','appdata':util[_0x9e9f('0x9')](_0x9e9f('0xd'),_0x24e489[_0x9e9f('0xe')]),'priority':_0x4b8f3c++},_0x47f4c7));}if(_0x24e489['auth']){_0x2020b3[_0x9e9f('0x7')](_[_0x9e9f('0x8')]({'app':_0x9e9f('0xf'),'appdata':_0x24e489[_0x9e9f('0x10')],'priority':_0x4b8f3c++},_0x47f4c7));}_0x2020b3[_0x9e9f('0x7')](_[_0x9e9f('0x8')]({'app':_0x9e9f('0x11'),'appdata':util[_0x9e9f('0x9')](_0x9e9f('0x12'),_0x439590['name'],_0x24e489['options']?_0x24e489[_0x9e9f('0x13')][_0x9e9f('0x14')](''):''),'priority':_0x4b8f3c++},_0x47f4c7));if(_0x24e489[_0x9e9f('0xc')]){_0x2020b3[_0x9e9f('0x7')](_[_0x9e9f('0x8')]({'app':_0x9e9f('0x15'),'priority':_0x4b8f3c++},_0x47f4c7));}return _0x2020b3;};var getChanSpyApplications=function(_0x4c5d54,_0x29cf83){var _0x5be4ee=[];for(var _0x38897c=0x0,_0x5c8040=0x1;_0x38897c<_0x29cf83['length'];_0x38897c++,_0x5c8040=0x1){_0x5be4ee=_0x5be4ee['concat'](getUserApplications(_0x4c5d54,_0x29cf83[_0x38897c],_0x29cf83[_0x38897c][_0x9e9f('0x16')]));if(_0x29cf83[_0x38897c][_0x9e9f('0x16')]!=_0x29cf83[_0x38897c][_0x9e9f('0x17')]){_0x5be4ee=_0x5be4ee[_0x9e9f('0x18')](getUserApplications(_0x4c5d54,_0x29cf83[_0x38897c],_0x29cf83[_0x38897c]['name']));}}return _0x5be4ee;};var getChanSpyPromise=function(_0x17c6b3,_0x35f4f1){return new BPromise(function(_0x584168,_0x5dcf08){return _0x17c6b3[_0x9e9f('0x19')][_0x9e9f('0x1a')]({'attributes':['id',_0x9e9f('0x17'),_0x9e9f('0x16')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x369f47){if(_0x369f47){return _0x584168(getChanSpyApplications(_0x35f4f1,_0x369f47));}return _0x584168([]);})[_0x9e9f('0x1b')](function(_0x54f288){_0x5dcf08(_0x54f288);});});};module[_0x9e9f('0x1c')]=function(_0x24df03,_0x376ea7){var _0x400a3e=_0x24df03['models'];return _0x24df03[_0x9e9f('0x1d')](_0x9e9f('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ac94e,_0x2926fd,_0x2ea441){return getChanSpyPromise(_0x400a3e,_0x4ac94e)['then'](function(_0x172dd1){if(_0x172dd1&&_0x172dd1[_0x9e9f('0x1f')]){return _0x400a3e['VoiceExtension'][_0x9e9f('0x20')](_0x172dd1);}})[_0x9e9f('0x21')](function(){_0x2ea441();})['catch'](function(_0x5cdfe6){_0x2ea441(_0x5cdfe6);});},'afterUpdate':function(_0x4744a0,_0x72485b,_0x3938c6){return _0x400a3e[_0x9e9f('0x22')]['destroy']({'where':{'ChanSpyId':_0x4744a0['id']}})[_0x9e9f('0x21')](function(){return getChanSpyPromise(_0x400a3e,_0x4744a0);})[_0x9e9f('0x21')](function(_0x2c8020){if(_0x2c8020&&_0x2c8020['length']){return _0x400a3e[_0x9e9f('0x22')][_0x9e9f('0x20')](_0x2c8020);}})[_0x9e9f('0x21')](function(){_0x3938c6();})['catch'](function(_0x1229f4){_0x3938c6(_0x1229f4);});},'afterDestroy':function(_0x88811d,_0x129e8b,_0x41ee84){return _0x400a3e[_0x9e9f('0x22')][_0x9e9f('0x23')]({'where':{'ChanSpyId':_0x88811d['id']}})[_0x9e9f('0x21')](function(){_0x41ee84();})[_0x9e9f('0x1b')](function(_0x5673c9){_0x41ee84(_0x5673c9);});}}});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js
index c0ad3f2..ffb9e25 100644
--- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js
+++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x388b=['moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x388b,0x109));var _0xb388=function(_0x1146f7,_0x475356){_0x1146f7=_0x1146f7-0x0;var _0x2e5725=_0x388b[_0x1146f7];return _0x2e5725;};'use strict';var _=require('lodash');var util=require(_0xb388('0x0'));var moment=require(_0xb388('0x1'));var BPromise=require(_0xb388('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb388('0x3'));var db=require(_0xb388('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb388('0x5'));var config=require(_0xb388('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb388('0x7')][_0xb388('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15eec6,_0x2abd58,_0xa2ea83){return new BPromise(function(_0x580774,_0x17f324){return client['request'](_0x15eec6,_0xa2ea83)[_0xb388('0x9')](function(_0x28aeb8){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x2abd58,'request\x20sent');logger['debug'](_0xb388('0xa'),_0x2abd58,_0xb388('0xb'),JSON[_0xb388('0xc')](_0x28aeb8));if(_0x28aeb8['error']){if(_0x28aeb8['error'][_0xb388('0xd')]===0x1f4){logger[_0xb388('0xe')](_0xb388('0xf'),_0x2abd58,_0x28aeb8[_0xb388('0xe')][_0xb388('0x10')]);return _0x17f324(_0x28aeb8[_0xb388('0xe')]['message']);}logger[_0xb388('0xe')](_0xb388('0xf'),_0x2abd58,_0x28aeb8[_0xb388('0xe')][_0xb388('0x10')]);return _0x580774(_0x28aeb8[_0xb388('0xe')][_0xb388('0x10')]);}else{logger['info'](_0xb388('0xf'),_0x2abd58,'request\x20sent');_0x580774(_0x28aeb8[_0xb388('0x11')][_0xb388('0x10')]);}})[_0xb388('0x12')](function(_0x128d82){logger['error'](_0xb388('0xf'),_0x2abd58,_0x128d82);_0x17f324(_0x128d82);});});}
\ No newline at end of file
+var _0x356c=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x30f8ed,_0x1309da){var _0x43bee0=function(_0x5795bb){while(--_0x5795bb){_0x30f8ed['push'](_0x30f8ed['shift']());}};_0x43bee0(++_0x1309da);}(_0x356c,0x1d9));var _0xc356=function(_0x1bcce6,_0x3d9fcb){_0x1bcce6=_0x1bcce6-0x0;var _0x444330=_0x356c[_0x1bcce6];return _0x444330;};'use strict';var _=require(_0xc356('0x0'));var util=require('util');var moment=require(_0xc356('0x1'));var BPromise=require(_0xc356('0x2'));var rs=require(_0xc356('0x3'));var fs=require('fs');var Redis=require(_0xc356('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc356('0x5'));var logger=require(_0xc356('0x6'))('rpc');var config=require(_0xc356('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc356('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x223110,_0x2eba9f,_0x556cdf){return new BPromise(function(_0x309f88,_0x5559c0){return client[_0xc356('0x9')](_0x223110,_0x556cdf)['then'](function(_0x409f2c){logger[_0xc356('0xa')](_0xc356('0xb'),_0x2eba9f,_0xc356('0xc'));logger[_0xc356('0xd')](_0xc356('0xe'),_0x2eba9f,_0xc356('0xc'),JSON[_0xc356('0xf')](_0x409f2c));if(_0x409f2c[_0xc356('0x10')]){if(_0x409f2c['error'][_0xc356('0x11')]===0x1f4){logger[_0xc356('0x10')](_0xc356('0xb'),_0x2eba9f,_0x409f2c[_0xc356('0x10')][_0xc356('0x12')]);return _0x5559c0(_0x409f2c[_0xc356('0x10')][_0xc356('0x12')]);}logger['error'](_0xc356('0xb'),_0x2eba9f,_0x409f2c[_0xc356('0x10')][_0xc356('0x12')]);return _0x309f88(_0x409f2c[_0xc356('0x10')][_0xc356('0x12')]);}else{logger['info'](_0xc356('0xb'),_0x2eba9f,_0xc356('0xc'));_0x309f88(_0x409f2c[_0xc356('0x13')][_0xc356('0x12')]);}})[_0xc356('0x14')](function(_0x44653d){logger['error'](_0xc356('0xb'),_0x2eba9f,_0x44653d);_0x5559c0(_0x44653d);});});}
\ No newline at end of file
diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js
index d3652c0..35bf220 100644
--- a/server/api/voiceContext/index.js
+++ b/server/api/voiceContext/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd80b=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x5d324b,_0x315e3b){var _0x564188=function(_0x5ca3ce){while(--_0x5ca3ce){_0x5d324b['push'](_0x5d324b['shift']());}};_0x564188(++_0x315e3b);}(_0xd80b,0x130));var _0xbd80=function(_0x5839e1,_0x25ee11){_0x5839e1=_0x5839e1-0x0;var _0x85a8b8=_0xd80b[_0x5839e1];return _0x85a8b8;};'use strict';var multer=require(_0xbd80('0x0'));var util=require('util');var path=require(_0xbd80('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd80('0x2'));var router=express[_0xbd80('0x3')]();var auth=require(_0xbd80('0x4'));var interaction=require(_0xbd80('0x5'));var config=require(_0xbd80('0x6'));var controller=require(_0xbd80('0x7'));router[_0xbd80('0x8')]('/',auth['isAuthenticated'](),controller[_0xbd80('0x9')]);router[_0xbd80('0x8')]('/:id',auth[_0xbd80('0xa')](),controller[_0xbd80('0xb')]);router[_0xbd80('0xc')]('/',auth[_0xbd80('0xa')](),controller[_0xbd80('0xd')]);router[_0xbd80('0xe')](_0xbd80('0xf'),auth[_0xbd80('0xa')](),controller['update']);router[_0xbd80('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xbd80('0x11')]);module[_0xbd80('0x12')]=router;
\ No newline at end of file
+var _0x212a=['show','post','create','put','update','/:id','destroy','multer','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x212a,0x1d8));var _0xa212=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x212a[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0xa212('0x0'));var util=require('util');var path=require(_0xa212('0x1'));var timeout=require('connect-timeout');var express=require(_0xa212('0x2'));var router=express[_0xa212('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa212('0x4'));var config=require(_0xa212('0x5'));var controller=require('./voiceContext.controller');router[_0xa212('0x6')]('/',auth[_0xa212('0x7')](),controller['index']);router[_0xa212('0x6')]('/:id',auth[_0xa212('0x7')](),controller[_0xa212('0x8')]);router[_0xa212('0x9')]('/',auth[_0xa212('0x7')](),controller[_0xa212('0xa')]);router[_0xa212('0xb')]('/:id',auth[_0xa212('0x7')](),controller[_0xa212('0xc')]);router['delete'](_0xa212('0xd'),auth['isAuthenticated'](),controller[_0xa212('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js
index 221cf0e..ab8bd72 100644
--- a/server/api/voiceContext/voiceContext.attributes.js
+++ b/server/api/voiceContext/voiceContext.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x180b93,_0x55d306){var _0x102f51=function(_0xb7074d){while(--_0xb7074d){_0x180b93['push'](_0x180b93['shift']());}};_0x102f51(++_0x55d306);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3e74=['name','sequelize','STRING'];(function(_0x2d5818,_0xc9aa8b){var _0x1d1e9d=function(_0xdea9e8){while(--_0xdea9e8){_0x2d5818['push'](_0x2d5818['shift']());}};_0x1d1e9d(++_0xc9aa8b);}(_0x3e74,0x175));var _0x43e7=function(_0x4f1e79,_0x16e55b){_0x4f1e79=_0x4f1e79-0x0;var _0x8862c3=_0x3e74[_0x4f1e79];return _0x8862c3;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js
index 50d40e0..b5fe6c0 100644
--- a/server/api/voiceContext/voiceContext.controller.js
+++ b/server/api/voiceContext/voiceContext.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['VoiceContext','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','readFileSync','join','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','create','update','params','root','utf8','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Contexts','UserProfileResource','stack','name','send','index'];(function(_0x4ef849,_0x32516c){var _0xe59988=function(_0x56b10c){while(--_0x56b10c){_0x4ef849['push'](_0x4ef849['shift']());}};_0xe59988(++_0x32516c);}(_0xedd9,0xfc));var _0x9edd=function(_0x456392,_0x1b2b72){_0x456392=_0x456392-0x0;var _0x4a8c6b=_0xedd9[_0x456392];return _0x4a8c6b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var db=require(_0x9edd('0x16'))['db'];var jayson=require(_0x9edd('0x17'));var client=jayson[_0x9edd('0x18')][_0x9edd('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3a7b84,_0xfca576,_0xef5498){if(_0xef5498){var _0x47eb64=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x47eb64[_0x9edd('0x1a')](_0xfca576)){return _0x3a7b84;}else{throw new db[(_0x9edd('0x1b'))][(_0x9edd('0x1c'))](_0x9edd('0x1d'));}}else{return _0x3a7b84;}}function respondWithRpcPromise(_0x13b6b6,_0x338f3c,_0x1042aa,_0x75a4ab){return new BPromise(function(_0x4ea60f,_0x5f5bf4){var _0x448996=_0x75a4ab||client;return _0x448996[_0x9edd('0x1e')](_0x13b6b6,_0x1042aa)['then'](function(_0x1b54c0){logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0x338f3c,'request\x20sent');logger[_0x9edd('0x21')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x338f3c,_0x9edd('0x22'),JSON[_0x9edd('0x23')](_0x1b54c0));if(_0x1b54c0['error']){if(_0x1b54c0['error'][_0x9edd('0x24')]===0x1f4){logger['error'](_0x9edd('0x20'),_0x338f3c,_0x1b54c0['error']['message']);return _0x5f5bf4(_0x1b54c0[_0x9edd('0x25')][_0x9edd('0x26')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x338f3c,_0x1b54c0[_0x9edd('0x25')][_0x9edd('0x26')]);return _0x4ea60f(_0x1b54c0[_0x9edd('0x25')]['message']);}else{logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0x338f3c,_0x9edd('0x22'));_0x4ea60f(_0x1b54c0[_0x9edd('0x27')][_0x9edd('0x26')]);}})['catch'](function(_0x46c383){logger[_0x9edd('0x25')](_0x9edd('0x20'),_0x338f3c,_0x46c383);_0x5f5bf4(_0x46c383);});});}function respondWithStatusCode(_0x2f9f86,_0x310a4d){_0x310a4d=_0x310a4d||0xcc;return function(_0x4d507f){if(_0x4d507f){return _0x2f9f86['sendStatus'](_0x310a4d);}return _0x2f9f86[_0x9edd('0x28')](_0x310a4d)[_0x9edd('0x29')]();};}function respondWithResult(_0x8d67aa,_0x25e135){_0x25e135=_0x25e135||0xc8;return function(_0x3c2227){if(_0x3c2227){return _0x8d67aa['status'](_0x25e135)['json'](_0x3c2227);}};}function respondWithFilteredResult(_0x214d0a,_0x257a26){return function(_0x1c762c){if(_0x1c762c){var _0x52746a=_0x1c762c[_0x9edd('0x2a')],_0x238b22=_0x257a26['offset'],_0x28cfae=_0x257a26[_0x9edd('0x2b')]+_0x257a26[_0x9edd('0x2c')],_0x2ae8dd;if(_0x28cfae>=_0x52746a){_0x28cfae=_0x52746a;_0x2ae8dd=0xc8;}else{_0x2ae8dd=0xce;}_0x214d0a[_0x9edd('0x28')](_0x2ae8dd);return _0x214d0a[_0x9edd('0x2d')](_0x9edd('0x2e'),_0x238b22+'-'+_0x28cfae+'/'+_0x52746a)[_0x9edd('0x2f')](_0x1c762c);}return null;};}function patchUpdates(_0x209aba){return function(_0x1fba7b){try{jsonpatch[_0x9edd('0x30')](_0x1fba7b,_0x209aba,!![]);}catch(_0x1c2e2b){return BPromise[_0x9edd('0x31')](_0x1c2e2b);}return _0x1fba7b[_0x9edd('0x32')]();};}function saveUpdates(_0x6907a5,_0xa55906){return function(_0x1a6c23){if(_0x1a6c23){return _0x1a6c23['update'](_0x6907a5)[_0x9edd('0x33')](function(_0x259259){return _0x259259;});}return null;};}function removeEntity(_0x267c74,_0x5d1707){return function(_0x2d2f88){if(_0x2d2f88){return _0x2d2f88[_0x9edd('0x34')]()[_0x9edd('0x33')](function(){var _0x38a7be=_0x2d2f88[_0x9edd('0x35')]({'plain':!![]});var _0x2bc4ed=_0x9edd('0x36');return db[_0x9edd('0x37')][_0x9edd('0x34')]({'where':{'type':_0x2bc4ed,'resourceId':_0x38a7be['id']}})[_0x9edd('0x33')](function(){return _0x2d2f88;});})[_0x9edd('0x33')](function(){_0x267c74[_0x9edd('0x28')](0xcc)[_0x9edd('0x29')]();});}};}function handleEntityNotFound(_0x14f780,_0x5757fc){return function(_0x37fcb2){if(!_0x37fcb2){_0x14f780['sendStatus'](0x194);}return _0x37fcb2;};}function handleError(_0x968303,_0x148630){_0x148630=_0x148630||0x1f4;return function(_0x10d6fd){logger[_0x9edd('0x25')](_0x10d6fd[_0x9edd('0x38')]);if(_0x10d6fd['name']){delete _0x10d6fd[_0x9edd('0x39')];}_0x968303[_0x9edd('0x28')](_0x148630)[_0x9edd('0x3a')](_0x10d6fd);};}exports[_0x9edd('0x3b')]=function(_0x1be77f,_0x337e6c){var _0x5c0627={},_0x1cbbac={},_0x1ccee8={'count':0x0,'rows':[]};var _0x35c16f=_['map'](db[_0x9edd('0x3c')]['rawAttributes'],function(_0x3ef1d5){return{'name':_0x3ef1d5['fieldName'],'type':_0x3ef1d5[_0x9edd('0x3d')][_0x9edd('0x3e')]};});_0x1cbbac[_0x9edd('0x3f')]=_['map'](_0x35c16f,_0x9edd('0x39'));_0x1cbbac[_0x9edd('0x40')]=_[_0x9edd('0x41')](_0x1be77f['query']);_0x1cbbac[_0x9edd('0x42')]=_['intersection'](_0x1cbbac[_0x9edd('0x3f')],_0x1cbbac[_0x9edd('0x40')]);_0x5c0627['attributes']=_[_0x9edd('0x43')](_0x1cbbac[_0x9edd('0x3f')],qs[_0x9edd('0x44')](_0x1be77f[_0x9edd('0x40')]['fields']));_0x5c0627[_0x9edd('0x45')]=_0x5c0627['attributes'][_0x9edd('0x46')]?_0x5c0627[_0x9edd('0x45')]:_0x1cbbac['model'];if(!_0x1be77f[_0x9edd('0x40')]['hasOwnProperty']('nolimit')){_0x5c0627[_0x9edd('0x2c')]=qs[_0x9edd('0x2c')](_0x1be77f[_0x9edd('0x40')][_0x9edd('0x2c')]);_0x5c0627[_0x9edd('0x2b')]=qs[_0x9edd('0x2b')](_0x1be77f[_0x9edd('0x40')][_0x9edd('0x2b')]);}_0x5c0627[_0x9edd('0x47')]=qs[_0x9edd('0x48')](_0x1be77f[_0x9edd('0x40')][_0x9edd('0x48')]);_0x5c0627[_0x9edd('0x49')]=qs[_0x9edd('0x42')](_[_0x9edd('0x4a')](_0x1be77f['query'],_0x1cbbac[_0x9edd('0x42')]),_0x35c16f);if(_0x1be77f[_0x9edd('0x40')][_0x9edd('0x4b')]){_0x5c0627[_0x9edd('0x49')]=_[_0x9edd('0x4c')](_0x5c0627[_0x9edd('0x49')],{'$or':_[_0x9edd('0x4d')](_0x35c16f,function(_0x4e9ad1){if(_0x4e9ad1['type']!=='VIRTUAL'){var _0x4a7dc9={};_0x4a7dc9[_0x4e9ad1['name']]={'$like':'%'+_0x1be77f[_0x9edd('0x40')][_0x9edd('0x4b')]+'%'};return _0x4a7dc9;}})});}_0x5c0627=_[_0x9edd('0x4c')]({},_0x5c0627,_0x1be77f[_0x9edd('0x4e')]);var _0x367791={'where':_0x5c0627['where']};return db[_0x9edd('0x3c')][_0x9edd('0x2a')](_0x367791)[_0x9edd('0x33')](function(_0x4a89ae){_0x1ccee8[_0x9edd('0x2a')]=_0x4a89ae;if(_0x1be77f[_0x9edd('0x40')][_0x9edd('0x4f')]){_0x5c0627[_0x9edd('0x50')]=[{'all':!![]}];}return db[_0x9edd('0x3c')][_0x9edd('0x51')](_0x5c0627);})['then'](function(_0x441e4a){_0x1ccee8[_0x9edd('0x52')]=_0x441e4a;return _0x1ccee8;})['then'](respondWithFilteredResult(_0x337e6c,_0x5c0627))[_0x9edd('0x53')](handleError(_0x337e6c,null));};exports[_0x9edd('0x54')]=function(_0x4bb324,_0x2bd089){var _0x8134cd={'raw':![],'where':{'id':_0x4bb324['params']['id']}},_0x468239={};_0x468239[_0x9edd('0x3f')]=_[_0x9edd('0x41')](db[_0x9edd('0x3c')][_0x9edd('0x55')]);_0x468239['query']=_[_0x9edd('0x41')](_0x4bb324[_0x9edd('0x40')]);_0x468239[_0x9edd('0x42')]=_['intersection'](_0x468239[_0x9edd('0x3f')],_0x468239[_0x9edd('0x40')]);_0x8134cd['attributes']=_[_0x9edd('0x43')](_0x468239['model'],qs[_0x9edd('0x44')](_0x4bb324[_0x9edd('0x40')][_0x9edd('0x44')]));_0x8134cd[_0x9edd('0x45')]=_0x8134cd[_0x9edd('0x45')][_0x9edd('0x46')]?_0x8134cd[_0x9edd('0x45')]:_0x468239[_0x9edd('0x3f')];if(_0x4bb324[_0x9edd('0x40')][_0x9edd('0x4f')]){_0x8134cd[_0x9edd('0x50')]=[{'all':!![]}];}_0x8134cd=_['merge']({},_0x8134cd,_0x4bb324[_0x9edd('0x4e')]);return db[_0x9edd('0x3c')][_0x9edd('0x56')](_0x8134cd)['then'](handleEntityNotFound(_0x2bd089,null))[_0x9edd('0x33')](respondWithResult(_0x2bd089,null))['catch'](handleError(_0x2bd089,null));};exports['create']=function(_0x54ecfa,_0x1348a7,_0x45f47c){var _0x366316;return db[_0x9edd('0x3c')]['create'](_0x54ecfa['body'],{'raw':!![]})['then'](function(_0x71820f){_0x366316=_0x71820f;return db[_0x9edd('0x3c')][_0x9edd('0x51')]({'raw':!![]});})[_0x9edd('0x33')](function(_0x2e2920){var _0x41ec97=fs[_0x9edd('0x57')](path[_0x9edd('0x58')](config['root'],_0x9edd('0x59')),'utf8');var _0x421e82=ejs[_0x9edd('0x5a')](_0x41ec97,{'contexts':_0x2e2920||[]});fs['writeFileSync'](_0x9edd('0x5b'),_0x421e82);})[_0x9edd('0x33')](function(){return respondWithRpcPromise(_0x9edd('0x5c'),'create',{'module':_0x9edd('0x5d')});})[_0x9edd('0x33')](function(){var _0x430eb4=_0x54ecfa[_0x9edd('0x5e')][_0x9edd('0x35')]({'plain':!![]});if(!_0x430eb4)throw new Error(_0x9edd('0x5f'));if(_0x430eb4['role']==='user'){var _0x452ca5=_0x366316['get']({'plain':!![]});return db[_0x9edd('0x60')][_0x9edd('0x56')]({'where':{'name':_0x9edd('0x36'),'userProfileId':_0x430eb4[_0x9edd('0x61')]},'raw':!![]})['then'](function(_0x21ead2){if(_0x21ead2&&_0x21ead2['autoAssociation']===0x0){return db[_0x9edd('0x37')][_0x9edd('0x62')]({'name':_0x452ca5[_0x9edd('0x39')],'resourceId':_0x452ca5['id'],'type':_0x21ead2['name'],'sectionId':_0x21ead2['id']},{})[_0x9edd('0x33')](function(){return _0x366316;});}else{return _0x366316;}})['catch'](function(_0x37e603){logger[_0x9edd('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37e603);throw _0x37e603;});}return _0x366316;})[_0x9edd('0x33')](respondWithResult(_0x1348a7,0xc9))['catch'](handleError(_0x1348a7,null));};exports[_0x9edd('0x63')]=function(_0x134c9c,_0x307a61,_0x50f4fc){var _0x4181b9;return db[_0x9edd('0x3c')][_0x9edd('0x56')]({'where':{'id':_0x134c9c[_0x9edd('0x64')]['id']}})[_0x9edd('0x33')](handleEntityNotFound(_0x307a61,null))['then'](saveUpdates(_0x134c9c['body'],null))[_0x9edd('0x33')](function(_0x211526){if(_0x211526){_0x4181b9=_0x211526;return db['VoiceContext']['findAll']({'raw':!![]});}})['then'](function(_0x1bc89b){var _0x4e003a=fs['readFileSync'](path[_0x9edd('0x58')](config[_0x9edd('0x65')],'server/files/templates/context.ejs'),_0x9edd('0x66'));var _0x11e082=ejs[_0x9edd('0x5a')](_0x4e003a,{'contexts':_0x1bc89b||[]});fs['writeFileSync'](_0x9edd('0x5b'),_0x11e082);})['then'](function(){return respondWithRpcPromise(_0x9edd('0x5c'),_0x9edd('0x63'),{'module':'chan_sip.so'});})[_0x9edd('0x33')](function(){return _0x4181b9;})[_0x9edd('0x33')](respondWithResult(_0x307a61,null))['catch'](handleError(_0x307a61,null));};exports[_0x9edd('0x34')]=function(_0x475dc3,_0x460a92,_0x1d9536){var _0x5ce70b;return db[_0x9edd('0x3c')]['find']({'where':{'id':_0x475dc3[_0x9edd('0x64')]['id']}})[_0x9edd('0x33')](handleEntityNotFound(_0x460a92,null))[_0x9edd('0x33')](removeEntity(_0x460a92,null))['then'](function(){return db[_0x9edd('0x3c')][_0x9edd('0x51')]({'raw':!![]});})[_0x9edd('0x33')](function(_0x383cb9){var _0x25626a=fs[_0x9edd('0x57')](path[_0x9edd('0x58')](config['root'],'server/files/templates/context.ejs'),_0x9edd('0x66'));var _0x3c7874=ejs[_0x9edd('0x5a')](_0x25626a,{'contexts':_0x383cb9});fs[_0x9edd('0x67')](_0x9edd('0x5b'),_0x3c7874);return respondWithRpcPromise('Reload',_0x9edd('0x34'),{'module':_0x9edd('0x5d')});})[_0x9edd('0x53')](handleError(_0x460a92,null));};
\ No newline at end of file
+var _0x34e8=['http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','Contexts','sendStatus','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','VoiceContext','includeAll','include','findAll','rows','show','length','create','body','join','root','utf8','render','writeFileSync','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client'];(function(_0x10eddd,_0x7f3b03){var _0x32a756=function(_0x4ce997){while(--_0x4ce997){_0x10eddd['push'](_0x10eddd['shift']());}};_0x32a756(++_0x7f3b03);}(_0x34e8,0x12c));var _0x834e=function(_0x60eae7,_0x27dde4){_0x60eae7=_0x60eae7-0x0;var _0x5662fd=_0x34e8[_0x60eae7];return _0x5662fd;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x834e('0x1d')][_0x834e('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x58a27e,_0x23848e,_0x2d95f2){if(_0x2d95f2){var _0x28e659=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28e659[_0x834e('0x1f')](_0x23848e)){return _0x58a27e;}else{throw new db['Sequelize'][(_0x834e('0x20'))](_0x834e('0x21'));}}else{return _0x58a27e;}}function respondWithRpcPromise(_0x57274a,_0x316205,_0x4a9cdc,_0x38a8cd){return new BPromise(function(_0x36d443,_0x478afe){var _0x43ac41=_0x38a8cd||client;return _0x43ac41[_0x834e('0x22')](_0x57274a,_0x4a9cdc)[_0x834e('0x23')](function(_0x50b3f6){logger[_0x834e('0x24')](_0x834e('0x25'),_0x316205,_0x834e('0x26'));logger[_0x834e('0x27')](_0x834e('0x28'),_0x316205,_0x834e('0x26'),JSON[_0x834e('0x29')](_0x50b3f6));if(_0x50b3f6['error']){if(_0x50b3f6[_0x834e('0x2a')][_0x834e('0x2b')]===0x1f4){logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6['error'][_0x834e('0x2c')]);return _0x478afe(_0x50b3f6[_0x834e('0x2a')]['message']);}logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6[_0x834e('0x2a')]['message']);return _0x36d443(_0x50b3f6['error'][_0x834e('0x2c')]);}else{logger[_0x834e('0x24')]('VoiceContext,\x20%s,\x20%s',_0x316205,_0x834e('0x26'));_0x36d443(_0x50b3f6[_0x834e('0x2d')]['message']);}})[_0x834e('0x2e')](function(_0x2e1983){logger[_0x834e('0x2a')]('VoiceContext,\x20%s,\x20%s',_0x316205,_0x2e1983);_0x478afe(_0x2e1983);});});}function respondWithStatusCode(_0x24fcf7,_0x3e310f){_0x3e310f=_0x3e310f||0xcc;return function(_0x5e1cc5){if(_0x5e1cc5){return _0x24fcf7['sendStatus'](_0x3e310f);}return _0x24fcf7[_0x834e('0x2f')](_0x3e310f)['end']();};}function respondWithResult(_0x2826ec,_0x3f1b0b){_0x3f1b0b=_0x3f1b0b||0xc8;return function(_0x3db026){if(_0x3db026){return _0x2826ec[_0x834e('0x2f')](_0x3f1b0b)[_0x834e('0x30')](_0x3db026);}};}function respondWithFilteredResult(_0x130cc5,_0x491919){return function(_0x510780){if(_0x510780){var _0x4dc64a=_0x510780[_0x834e('0x31')],_0x58c1d7=_0x491919['offset'],_0x2c7a8d=_0x491919[_0x834e('0x32')]+_0x491919[_0x834e('0x33')],_0x567cea;if(_0x2c7a8d>=_0x4dc64a){_0x2c7a8d=_0x4dc64a;_0x567cea=0xc8;}else{_0x567cea=0xce;}_0x130cc5[_0x834e('0x2f')](_0x567cea);return _0x130cc5[_0x834e('0x34')](_0x834e('0x35'),_0x58c1d7+'-'+_0x2c7a8d+'/'+_0x4dc64a)[_0x834e('0x30')](_0x510780);}return null;};}function patchUpdates(_0x3d149d){return function(_0xfaf716){try{jsonpatch[_0x834e('0x36')](_0xfaf716,_0x3d149d,!![]);}catch(_0x493289){return BPromise[_0x834e('0x37')](_0x493289);}return _0xfaf716['save']();};}function saveUpdates(_0x2c75c2,_0x3787b0){return function(_0x9ab921){if(_0x9ab921){return _0x9ab921[_0x834e('0x38')](_0x2c75c2)[_0x834e('0x23')](function(_0x4689c2){return _0x4689c2;});}return null;};}function removeEntity(_0x4696a1,_0x38cd29){return function(_0x358c31){if(_0x358c31){return _0x358c31[_0x834e('0x39')]()['then'](function(){var _0x2a3c7f=_0x358c31[_0x834e('0x3a')]({'plain':!![]});var _0x24a9df=_0x834e('0x3b');return db['UserProfileResource'][_0x834e('0x39')]({'where':{'type':_0x24a9df,'resourceId':_0x2a3c7f['id']}})[_0x834e('0x23')](function(){return _0x358c31;});})['then'](function(){_0x4696a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e58fa,_0x41bf4d){return function(_0x20c6ae){if(!_0x20c6ae){_0x3e58fa[_0x834e('0x3c')](0x194);}return _0x20c6ae;};}function handleError(_0x339e28,_0x1b76dd){_0x1b76dd=_0x1b76dd||0x1f4;return function(_0x4c2ef6){logger[_0x834e('0x2a')](_0x4c2ef6['stack']);if(_0x4c2ef6[_0x834e('0x3d')]){delete _0x4c2ef6[_0x834e('0x3d')];}_0x339e28['status'](_0x1b76dd)[_0x834e('0x3e')](_0x4c2ef6);};}exports[_0x834e('0x3f')]=function(_0x491c28,_0x481f70){var _0x388711={},_0xd0d43a={},_0x2e9383={'count':0x0,'rows':[]};var _0x130c23=_[_0x834e('0x40')](db['VoiceContext'][_0x834e('0x41')],function(_0x548d1d){return{'name':_0x548d1d['fieldName'],'type':_0x548d1d[_0x834e('0x42')]['key']};});_0xd0d43a[_0x834e('0x43')]=_[_0x834e('0x40')](_0x130c23,_0x834e('0x3d'));_0xd0d43a[_0x834e('0x44')]=_[_0x834e('0x45')](_0x491c28['query']);_0xd0d43a[_0x834e('0x46')]=_[_0x834e('0x47')](_0xd0d43a[_0x834e('0x43')],_0xd0d43a['query']);_0x388711[_0x834e('0x48')]=_[_0x834e('0x47')](_0xd0d43a['model'],qs[_0x834e('0x49')](_0x491c28['query'][_0x834e('0x49')]));_0x388711[_0x834e('0x48')]=_0x388711['attributes']['length']?_0x388711[_0x834e('0x48')]:_0xd0d43a[_0x834e('0x43')];if(!_0x491c28[_0x834e('0x44')][_0x834e('0x4a')](_0x834e('0x4b'))){_0x388711[_0x834e('0x33')]=qs[_0x834e('0x33')](_0x491c28['query'][_0x834e('0x33')]);_0x388711['offset']=qs[_0x834e('0x32')](_0x491c28['query'][_0x834e('0x32')]);}_0x388711['order']=qs[_0x834e('0x4c')](_0x491c28[_0x834e('0x44')]['sort']);_0x388711[_0x834e('0x4d')]=qs[_0x834e('0x46')](_[_0x834e('0x4e')](_0x491c28[_0x834e('0x44')],_0xd0d43a[_0x834e('0x46')]),_0x130c23);if(_0x491c28[_0x834e('0x44')][_0x834e('0x4f')]){_0x388711[_0x834e('0x4d')]=_[_0x834e('0x50')](_0x388711[_0x834e('0x4d')],{'$or':_['map'](_0x130c23,function(_0x3124be){if(_0x3124be[_0x834e('0x42')]!=='VIRTUAL'){var _0x112306={};_0x112306[_0x3124be[_0x834e('0x3d')]]={'$like':'%'+_0x491c28[_0x834e('0x44')][_0x834e('0x4f')]+'%'};return _0x112306;}})});}_0x388711=_[_0x834e('0x50')]({},_0x388711,_0x491c28[_0x834e('0x51')]);var _0x4eab06={'where':_0x388711['where']};return db[_0x834e('0x52')][_0x834e('0x31')](_0x4eab06)[_0x834e('0x23')](function(_0x40ff5a){_0x2e9383[_0x834e('0x31')]=_0x40ff5a;if(_0x491c28[_0x834e('0x44')][_0x834e('0x53')]){_0x388711[_0x834e('0x54')]=[{'all':!![]}];}return db[_0x834e('0x52')][_0x834e('0x55')](_0x388711);})[_0x834e('0x23')](function(_0x385435){_0x2e9383[_0x834e('0x56')]=_0x385435;return _0x2e9383;})[_0x834e('0x23')](respondWithFilteredResult(_0x481f70,_0x388711))[_0x834e('0x2e')](handleError(_0x481f70,null));};exports[_0x834e('0x57')]=function(_0x3df078,_0x32b8f7){var _0x420841={'raw':![],'where':{'id':_0x3df078['params']['id']}},_0x1adf86={};_0x1adf86[_0x834e('0x43')]=_[_0x834e('0x45')](db['VoiceContext'][_0x834e('0x41')]);_0x1adf86[_0x834e('0x44')]=_['keys'](_0x3df078[_0x834e('0x44')]);_0x1adf86[_0x834e('0x46')]=_[_0x834e('0x47')](_0x1adf86[_0x834e('0x43')],_0x1adf86[_0x834e('0x44')]);_0x420841[_0x834e('0x48')]=_[_0x834e('0x47')](_0x1adf86['model'],qs[_0x834e('0x49')](_0x3df078[_0x834e('0x44')][_0x834e('0x49')]));_0x420841[_0x834e('0x48')]=_0x420841[_0x834e('0x48')][_0x834e('0x58')]?_0x420841[_0x834e('0x48')]:_0x1adf86[_0x834e('0x43')];if(_0x3df078['query'][_0x834e('0x53')]){_0x420841['include']=[{'all':!![]}];}_0x420841=_[_0x834e('0x50')]({},_0x420841,_0x3df078['options']);return db[_0x834e('0x52')]['find'](_0x420841)['then'](handleEntityNotFound(_0x32b8f7,null))[_0x834e('0x23')](respondWithResult(_0x32b8f7,null))[_0x834e('0x2e')](handleError(_0x32b8f7,null));};exports['create']=function(_0x5be43d,_0x2c8155,_0x2452b4){var _0x138ed2;return db[_0x834e('0x52')][_0x834e('0x59')](_0x5be43d[_0x834e('0x5a')],{'raw':!![]})[_0x834e('0x23')](function(_0x4273f1){_0x138ed2=_0x4273f1;return db['VoiceContext'][_0x834e('0x55')]({'raw':!![]});})[_0x834e('0x23')](function(_0x5d5ac2){var _0x281342=fs['readFileSync'](path[_0x834e('0x5b')](config[_0x834e('0x5c')],'server/files/templates/context.ejs'),_0x834e('0x5d'));var _0x37ee0e=ejs[_0x834e('0x5e')](_0x281342,{'contexts':_0x5d5ac2||[]});fs[_0x834e('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x37ee0e);})[_0x834e('0x23')](function(){return respondWithRpcPromise(_0x834e('0x60'),_0x834e('0x59'),{'module':'chan_sip.so'});})[_0x834e('0x23')](function(){var _0x1fcae9=_0x5be43d[_0x834e('0x61')][_0x834e('0x3a')]({'plain':!![]});if(!_0x1fcae9)throw new Error(_0x834e('0x62'));if(_0x1fcae9[_0x834e('0x63')]===_0x834e('0x61')){var _0x1def00=_0x138ed2[_0x834e('0x3a')]({'plain':!![]});return db[_0x834e('0x64')][_0x834e('0x65')]({'where':{'name':_0x834e('0x3b'),'userProfileId':_0x1fcae9[_0x834e('0x66')]},'raw':!![]})[_0x834e('0x23')](function(_0x460a7a){if(_0x460a7a&&_0x460a7a[_0x834e('0x67')]===0x0){return db[_0x834e('0x68')][_0x834e('0x59')]({'name':_0x1def00[_0x834e('0x3d')],'resourceId':_0x1def00['id'],'type':_0x460a7a[_0x834e('0x3d')],'sectionId':_0x460a7a['id']},{})[_0x834e('0x23')](function(){return _0x138ed2;});}else{return _0x138ed2;}})[_0x834e('0x2e')](function(_0x5c83eb){logger[_0x834e('0x2a')](_0x834e('0x69'),_0x5c83eb);throw _0x5c83eb;});}return _0x138ed2;})[_0x834e('0x23')](respondWithResult(_0x2c8155,0xc9))[_0x834e('0x2e')](handleError(_0x2c8155,null));};exports['update']=function(_0x30faa8,_0x5a9c70,_0x56a152){var _0x2fdb1b;return db[_0x834e('0x52')][_0x834e('0x65')]({'where':{'id':_0x30faa8[_0x834e('0x6a')]['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x5a9c70,null))[_0x834e('0x23')](saveUpdates(_0x30faa8[_0x834e('0x5a')],null))[_0x834e('0x23')](function(_0x525ed3){if(_0x525ed3){_0x2fdb1b=_0x525ed3;return db[_0x834e('0x52')]['findAll']({'raw':!![]});}})[_0x834e('0x23')](function(_0xd35dda){var _0x514fe5=fs['readFileSync'](path[_0x834e('0x5b')](config[_0x834e('0x5c')],_0x834e('0x6b')),_0x834e('0x5d'));var _0x2c41bd=ejs['render'](_0x514fe5,{'contexts':_0xd35dda||[]});fs[_0x834e('0x5f')](_0x834e('0x6c'),_0x2c41bd);})[_0x834e('0x23')](function(){return respondWithRpcPromise(_0x834e('0x60'),_0x834e('0x38'),{'module':_0x834e('0x6d')});})[_0x834e('0x23')](function(){return _0x2fdb1b;})[_0x834e('0x23')](respondWithResult(_0x5a9c70,null))[_0x834e('0x2e')](handleError(_0x5a9c70,null));};exports[_0x834e('0x39')]=function(_0x5b2bf6,_0x1b158b,_0x2e4d80){var _0x42fc96;return db[_0x834e('0x52')]['find']({'where':{'id':_0x5b2bf6[_0x834e('0x6a')]['id']}})['then'](handleEntityNotFound(_0x1b158b,null))['then'](removeEntity(_0x1b158b,null))['then'](function(){return db[_0x834e('0x52')][_0x834e('0x55')]({'raw':!![]});})['then'](function(_0x2645df){var _0x1b200d=fs['readFileSync'](path[_0x834e('0x5b')](config[_0x834e('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x346be5=ejs[_0x834e('0x5e')](_0x1b200d,{'contexts':_0x2645df});fs[_0x834e('0x5f')](_0x834e('0x6c'),_0x346be5);return respondWithRpcPromise(_0x834e('0x60'),'destroy',{'module':_0x834e('0x6d')});})['catch'](handleError(_0x1b158b,null));};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js
index 5cf550a..9650e36 100644
--- a/server/api/voiceContext/voiceContext.model.js
+++ b/server/api/voiceContext/voiceContext.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3ed8df,_0x5e0047){var _0x2858cd=function(_0x1b0111){while(--_0x1b0111){_0x3ed8df['push'](_0x3ed8df['shift']());}};_0x2858cd(++_0x5e0047);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x48aca7,_0x4ef8d6){var _0x4afd89=function(_0xe92a5c){while(--_0xe92a5c){_0x48aca7['push'](_0x48aca7['shift']());}};_0x4afd89(++_0x4ef8d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js
index 40a3035..792cf32 100644
--- a/server/api/voiceContext/voiceContext.rpc.js
+++ b/server/api/voiceContext/voiceContext.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6480=['message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c5708,_0x34b1f9){var _0x37fa9b=function(_0x534dc4){while(--_0x534dc4){_0x4c5708['push'](_0x4c5708['shift']());}};_0x37fa9b(++_0x34b1f9);}(_0x6480,0x1e7));var _0x0648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6480[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0648('0x0'));var rs=require(_0x0648('0x1'));var fs=require('fs');var Redis=require(_0x0648('0x2'));var db=require(_0x0648('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0648('0x4'))('rpc');var config=require(_0x0648('0x5'));var jayson=require(_0x0648('0x6'));var client=jayson[_0x0648('0x7')][_0x0648('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d2c18,_0x3b63a1,_0x297b96){return new BPromise(function(_0x288d9e,_0x2e8fff){return client[_0x0648('0x9')](_0x4d2c18,_0x297b96)[_0x0648('0xa')](function(_0x1ba4a1){logger[_0x0648('0xb')](_0x0648('0xc'),_0x3b63a1,_0x0648('0xd'));logger[_0x0648('0xe')](_0x0648('0xf'),_0x3b63a1,_0x0648('0xd'),JSON[_0x0648('0x10')](_0x1ba4a1));if(_0x1ba4a1[_0x0648('0x11')]){if(_0x1ba4a1[_0x0648('0x11')][_0x0648('0x12')]===0x1f4){logger[_0x0648('0x11')]('VoiceContext,\x20%s,\x20%s',_0x3b63a1,_0x1ba4a1[_0x0648('0x11')][_0x0648('0x13')]);return _0x2e8fff(_0x1ba4a1[_0x0648('0x11')][_0x0648('0x13')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x3b63a1,_0x1ba4a1[_0x0648('0x11')][_0x0648('0x13')]);return _0x288d9e(_0x1ba4a1[_0x0648('0x11')][_0x0648('0x13')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x3b63a1,_0x0648('0xd'));_0x288d9e(_0x1ba4a1[_0x0648('0x14')][_0x0648('0x13')]);}})[_0x0648('0x15')](function(_0x5567e9){logger[_0x0648('0x11')]('VoiceContext,\x20%s,\x20%s',_0x3b63a1,_0x5567e9);_0x2e8fff(_0x5567e9);});});}
\ No newline at end of file
+var _0x281a=['rpc','../../config/environment','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x281a,0xcc));var _0xa281=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x281a[_0x29d915];return _0x160f86;};'use strict';var _=require('lodash');var util=require(_0xa281('0x0'));var moment=require(_0xa281('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa281('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa281('0x3'));var logger=require(_0xa281('0x4'))(_0xa281('0x5'));var config=require(_0xa281('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa281('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4373ca,_0x581368,_0x4b2a34){return new BPromise(function(_0x2ad01f,_0x1d449b){return client[_0xa281('0x8')](_0x4373ca,_0x4b2a34)['then'](function(_0x10b5f6){logger[_0xa281('0x9')](_0xa281('0xa'),_0x581368,_0xa281('0xb'));logger['debug'](_0xa281('0xc'),_0x581368,_0xa281('0xb'),JSON[_0xa281('0xd')](_0x10b5f6));if(_0x10b5f6['error']){if(_0x10b5f6['error'][_0xa281('0xe')]===0x1f4){logger[_0xa281('0xf')](_0xa281('0xa'),_0x581368,_0x10b5f6[_0xa281('0xf')]['message']);return _0x1d449b(_0x10b5f6[_0xa281('0xf')][_0xa281('0x10')]);}logger[_0xa281('0xf')](_0xa281('0xa'),_0x581368,_0x10b5f6[_0xa281('0xf')]['message']);return _0x2ad01f(_0x10b5f6[_0xa281('0xf')]['message']);}else{logger[_0xa281('0x9')](_0xa281('0xa'),_0x581368,'request\x20sent');_0x2ad01f(_0x10b5f6[_0xa281('0x11')][_0xa281('0x10')]);}})[_0xa281('0x12')](function(_0x755494){logger['error'](_0xa281('0xa'),_0x581368,_0x755494);_0x1d449b(_0x755494);});});}
\ No newline at end of file
diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js
index 456cf3c..401d19e 100644
--- a/server/api/voiceDialReport/index.js
+++ b/server/api/voiceDialReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x183e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','create','/:id'];(function(_0x4167d0,_0x56d592){var _0x33cc61=function(_0x3801fc){while(--_0x3801fc){_0x4167d0['push'](_0x4167d0['shift']());}};_0x33cc61(++_0x56d592);}(_0x183e,0x186));var _0xe183=function(_0x420458,_0x55bbb8){_0x420458=_0x420458-0x0;var _0x4da7bf=_0x183e[_0x420458];return _0x4da7bf;};'use strict';var multer=require(_0xe183('0x0'));var util=require('util');var path=require(_0xe183('0x1'));var timeout=require('connect-timeout');var express=require(_0xe183('0x2'));var router=express[_0xe183('0x3')]();var auth=require(_0xe183('0x4'));var interaction=require(_0xe183('0x5'));var config=require('../../config/environment');var controller=require(_0xe183('0x6'));router[_0xe183('0x7')]('/',auth[_0xe183('0x8')](),controller[_0xe183('0x9')]);router[_0xe183('0x7')](_0xe183('0xa'),auth[_0xe183('0x8')](),controller['describe']);router['get']('/:id',auth[_0xe183('0x8')](),controller['show']);router['post']('/',auth[_0xe183('0x8')](),controller[_0xe183('0xb')]);router['put'](_0xe183('0xc'),auth[_0xe183('0x8')](),controller['update']);router['delete']('/:id',auth[_0xe183('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x56d9=['isAuthenticated','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0x56d9,0xbf));var _0x956d=function(_0x564b0a,_0x4dd651){_0x564b0a=_0x564b0a-0x0;var _0x350a24=_0x56d9[_0x564b0a];return _0x350a24;};'use strict';var multer=require(_0x956d('0x0'));var util=require(_0x956d('0x1'));var path=require(_0x956d('0x2'));var timeout=require('connect-timeout');var express=require(_0x956d('0x3'));var router=express[_0x956d('0x4')]();var auth=require(_0x956d('0x5'));var interaction=require(_0x956d('0x6'));var config=require('../../config/environment');var controller=require(_0x956d('0x7'));router[_0x956d('0x8')]('/',auth[_0x956d('0x9')](),controller['index']);router[_0x956d('0x8')](_0x956d('0xa'),auth['isAuthenticated'](),controller[_0x956d('0xb')]);router[_0x956d('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x956d('0xc')]('/',auth['isAuthenticated'](),controller[_0x956d('0xd')]);router[_0x956d('0xe')](_0x956d('0xf'),auth[_0x956d('0x9')](),controller[_0x956d('0x10')]);router[_0x956d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x956d('0x12')]);module[_0x956d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js
index bedb796..d4a7ff5 100644
--- a/server/api/voiceDialReport/voiceDialReport.attributes.js
+++ b/server/api/voiceDialReport/voiceDialReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d27=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x420c89,_0x30fd57){var _0x4a4fb7=function(_0x1c84b1){while(--_0x1c84b1){_0x420c89['push'](_0x420c89['shift']());}};_0x4a4fb7(++_0x30fd57);}(_0x0d27,0x82));var _0x70d2=function(_0x23cd88,_0x40573a){_0x23cd88=_0x23cd88-0x0;var _0x264636=_0x0d27[_0x23cd88];return _0x264636;};'use strict';var Sequelize=require(_0x70d2('0x0'));module[_0x70d2('0x1')]={'privilege':{'type':Sequelize[_0x70d2('0x2')]},'channel':{'type':Sequelize[_0x70d2('0x2')]},'channelstate':{'type':Sequelize[_0x70d2('0x3')]},'channelstatedesc':{'type':Sequelize[_0x70d2('0x2')]},'calleridnum':{'type':Sequelize[_0x70d2('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x70d2('0x2')]},'connectedlinename':{'type':Sequelize[_0x70d2('0x2')]},'language':{'type':Sequelize[_0x70d2('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x70d2('0x2')]},'exten':{'type':Sequelize[_0x70d2('0x2')]},'priority':{'type':Sequelize[_0x70d2('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x70d2('0x2')]},'destchannel':{'type':Sequelize[_0x70d2('0x2')]},'destchannelstate':{'type':Sequelize[_0x70d2('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x70d2('0x2')]},'destcalleridnum':{'type':Sequelize[_0x70d2('0x2')]},'destcalleridname':{'type':Sequelize[_0x70d2('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x70d2('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x70d2('0x2')]},'destlanguage':{'type':Sequelize[_0x70d2('0x2')]},'destaccountcode':{'type':Sequelize[_0x70d2('0x2')]},'destcontext':{'type':Sequelize[_0x70d2('0x2')]},'destexten':{'type':Sequelize[_0x70d2('0x2')]},'destpriority':{'type':Sequelize[_0x70d2('0x3')]},'destuniqueid':{'type':Sequelize[_0x70d2('0x2')]},'destlinkedid':{'type':Sequelize[_0x70d2('0x2')]},'dialstring':{'type':Sequelize[_0x70d2('0x2')]},'dialstatus':{'type':Sequelize[_0x70d2('0x2')]},'starttime':{'type':Sequelize[_0x70d2('0x4')]},'answertime':{'type':Sequelize[_0x70d2('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x70d2('0x2')],'comment':_0x70d2('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x70d2('0x3')]},'holdtime':{'type':Sequelize[_0x70d2('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x2f32=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x7eee15,_0x3fe21a){var _0x7ad23=function(_0x2de173){while(--_0x2de173){_0x7eee15['push'](_0x7eee15['shift']());}};_0x7ad23(++_0x3fe21a);}(_0x2f32,0x14e));var _0x22f3=function(_0x140f4b,_0x1b3629){_0x140f4b=_0x140f4b-0x0;var _0x30014f=_0x2f32[_0x140f4b];return _0x30014f;};'use strict';var Sequelize=require(_0x22f3('0x0'));module[_0x22f3('0x1')]={'privilege':{'type':Sequelize[_0x22f3('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x22f3('0x3')]},'channelstatedesc':{'type':Sequelize[_0x22f3('0x2')]},'calleridnum':{'type':Sequelize[_0x22f3('0x2')]},'calleridname':{'type':Sequelize[_0x22f3('0x2')]},'connectedlinenum':{'type':Sequelize[_0x22f3('0x2')]},'connectedlinename':{'type':Sequelize[_0x22f3('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x22f3('0x2')]},'exten':{'type':Sequelize[_0x22f3('0x2')]},'priority':{'type':Sequelize[_0x22f3('0x3')]},'uniqueid':{'type':Sequelize[_0x22f3('0x2')]},'linkedid':{'type':Sequelize[_0x22f3('0x2')]},'destchannel':{'type':Sequelize[_0x22f3('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x22f3('0x2')]},'destcalleridname':{'type':Sequelize[_0x22f3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x22f3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x22f3('0x2')]},'destlanguage':{'type':Sequelize[_0x22f3('0x2')]},'destaccountcode':{'type':Sequelize[_0x22f3('0x2')]},'destcontext':{'type':Sequelize[_0x22f3('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x22f3('0x3')]},'destuniqueid':{'type':Sequelize[_0x22f3('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x22f3('0x2')]},'dialstatus':{'type':Sequelize[_0x22f3('0x2')]},'starttime':{'type':Sequelize[_0x22f3('0x4')]},'answertime':{'type':Sequelize[_0x22f3('0x4')]},'endtime':{'type':Sequelize[_0x22f3('0x4')]},'lastevent':{'type':Sequelize[_0x22f3('0x2')],'comment':_0x22f3('0x5')},'routeId':{'type':Sequelize[_0x22f3('0x3')]},'duration':{'type':Sequelize[_0x22f3('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x22f3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js
index a9f39da..e92203f 100644
--- a/server/api/voiceDialReport/voiceDialReport.controller.js
+++ b/server/api/voiceDialReport/voiceDialReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x64d9=['where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','limit','set','save','update','then','sendStatus','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','sort','pick','filter'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x64d9,0x1d9));var _0x964d=function(_0x373abd,_0x22ee01){_0x373abd=_0x373abd-0x0;var _0x7a9421=_0x64d9[_0x373abd];return _0x7a9421;};'use strict';var pdf=require(_0x964d('0x0'));var emlformat=require(_0x964d('0x1'));var rimraf=require(_0x964d('0x2'));var zipdir=require(_0x964d('0x3'));var jsonpatch=require(_0x964d('0x4'));var rp=require('request-promise');var moment=require(_0x964d('0x5'));var BPromise=require(_0x964d('0x6'));var Mustache=require(_0x964d('0x7'));var util=require(_0x964d('0x8'));var path=require(_0x964d('0x9'));var sox=require(_0x964d('0xa'));var csv=require('to-csv');var ejs=require(_0x964d('0xb'));var fs=require('fs');var _=require(_0x964d('0xc'));var squel=require('squel');var crypto=require(_0x964d('0xd'));var jsforce=require(_0x964d('0xe'));var deskjs=require(_0x964d('0xf'));var toCsv=require(_0x964d('0x10'));var querystring=require(_0x964d('0x11'));var Papa=require(_0x964d('0x12'));var Redis=require(_0x964d('0x13'));var authService=require(_0x964d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x964d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x964d('0x16'))(_0x964d('0x17'));var utils=require(_0x964d('0x18'));var config=require(_0x964d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a223f,_0x37496d){_0x37496d=_0x37496d||0xcc;return function(_0x5eed6d){if(_0x5eed6d){return _0x2a223f['sendStatus'](_0x37496d);}return _0x2a223f[_0x964d('0x1a')](_0x37496d)[_0x964d('0x1b')]();};}function respondWithResult(_0x42ca54,_0x580786){_0x580786=_0x580786||0xc8;return function(_0x3f3a6d){if(_0x3f3a6d){return _0x42ca54['status'](_0x580786)[_0x964d('0x1c')](_0x3f3a6d);}};}function respondWithFilteredResult(_0x3fb4de,_0x222361){return function(_0x3e0971){if(_0x3e0971){var _0x4c929d=_0x3e0971[_0x964d('0x1d')],_0x4aef26=_0x222361['offset'],_0x27d5c8=_0x222361['offset']+_0x222361[_0x964d('0x1e')],_0x53fe3c;if(_0x27d5c8>=_0x4c929d){_0x27d5c8=_0x4c929d;_0x53fe3c=0xc8;}else{_0x53fe3c=0xce;}_0x3fb4de['status'](_0x53fe3c);return _0x3fb4de[_0x964d('0x1f')]('Content-Range',_0x4aef26+'-'+_0x27d5c8+'/'+_0x4c929d)[_0x964d('0x1c')](_0x3e0971);}return null;};}function patchUpdates(_0x5cf880){return function(_0x433f20){try{jsonpatch['apply'](_0x433f20,_0x5cf880,!![]);}catch(_0x443f96){return BPromise['reject'](_0x443f96);}return _0x433f20[_0x964d('0x20')]();};}function saveUpdates(_0x4fd82a,_0x1fb440){return function(_0x48d84d){if(_0x48d84d){return _0x48d84d[_0x964d('0x21')](_0x4fd82a)[_0x964d('0x22')](function(_0x5cb717){return _0x5cb717;});}return null;};}function removeEntity(_0x2d2a69,_0x22e357){return function(_0x21e509){if(_0x21e509){return _0x21e509['destroy']()['then'](function(){_0x2d2a69[_0x964d('0x1a')](0xcc)[_0x964d('0x1b')]();});}};}function handleEntityNotFound(_0x2ac3db,_0x677b0d){return function(_0x5d7048){if(!_0x5d7048){_0x2ac3db[_0x964d('0x23')](0x194);}return _0x5d7048;};}function handleError(_0x4f971e,_0xf14bee){_0xf14bee=_0xf14bee||0x1f4;return function(_0x3d06ec){logger[_0x964d('0x24')](_0x3d06ec[_0x964d('0x25')]);if(_0x3d06ec[_0x964d('0x26')]){delete _0x3d06ec[_0x964d('0x26')];}_0x4f971e[_0x964d('0x1a')](_0xf14bee)[_0x964d('0x27')](_0x3d06ec);};}exports['index']=function(_0x2da5a0,_0x23dfb6){var _0x54c67c={},_0x4d2377={},_0x31fc1c={'count':0x0,'rows':[]};var _0x5dbb5c=_[_0x964d('0x28')](db[_0x964d('0x29')][_0x964d('0x2a')],function(_0x5c7471){return{'name':_0x5c7471[_0x964d('0x2b')],'type':_0x5c7471['type'][_0x964d('0x2c')]};});_0x4d2377[_0x964d('0x2d')]=_[_0x964d('0x28')](_0x5dbb5c,'name');_0x4d2377[_0x964d('0x2e')]=_[_0x964d('0x2f')](_0x2da5a0[_0x964d('0x2e')]);_0x4d2377[_0x964d('0x30')]=_['intersection'](_0x4d2377[_0x964d('0x2d')],_0x4d2377['query']);_0x54c67c[_0x964d('0x31')]=_[_0x964d('0x32')](_0x4d2377['model'],qs[_0x964d('0x33')](_0x2da5a0[_0x964d('0x2e')]['fields']));_0x54c67c[_0x964d('0x31')]=_0x54c67c['attributes']['length']?_0x54c67c[_0x964d('0x31')]:_0x4d2377[_0x964d('0x2d')];if(!_0x2da5a0['query'][_0x964d('0x34')](_0x964d('0x35'))){_0x54c67c['limit']=qs[_0x964d('0x1e')](_0x2da5a0[_0x964d('0x2e')][_0x964d('0x1e')]);_0x54c67c[_0x964d('0x36')]=qs[_0x964d('0x36')](_0x2da5a0[_0x964d('0x2e')][_0x964d('0x36')]);}_0x54c67c[_0x964d('0x37')]=qs[_0x964d('0x38')](_0x2da5a0['query'][_0x964d('0x38')]);_0x54c67c['where']=qs[_0x964d('0x30')](_[_0x964d('0x39')](_0x2da5a0[_0x964d('0x2e')],_0x4d2377[_0x964d('0x30')]),_0x5dbb5c);if(_0x2da5a0[_0x964d('0x2e')][_0x964d('0x3a')]){_0x54c67c[_0x964d('0x3b')]=_[_0x964d('0x3c')](_0x54c67c[_0x964d('0x3b')],{'$or':_['map'](_0x5dbb5c,function(_0x19154b){if(_0x19154b[_0x964d('0x3d')]!==_0x964d('0x3e')){var _0x595803={};_0x595803[_0x19154b[_0x964d('0x26')]]={'$like':'%'+_0x2da5a0[_0x964d('0x2e')][_0x964d('0x3a')]+'%'};return _0x595803;}})});}_0x54c67c=_[_0x964d('0x3c')]({},_0x54c67c,_0x2da5a0[_0x964d('0x3f')]);var _0x512ab0={'where':_0x54c67c[_0x964d('0x3b')]};return db[_0x964d('0x29')][_0x964d('0x1d')](_0x512ab0)[_0x964d('0x22')](function(_0x410833){_0x31fc1c[_0x964d('0x1d')]=_0x410833;if(_0x2da5a0[_0x964d('0x2e')]['includeAll']){_0x54c67c[_0x964d('0x40')]=[{'all':!![]}];}return db[_0x964d('0x29')][_0x964d('0x41')](_0x54c67c);})[_0x964d('0x22')](function(_0x2d2d9c){_0x31fc1c[_0x964d('0x42')]=_0x2d2d9c;return _0x31fc1c;})['then'](respondWithFilteredResult(_0x23dfb6,_0x54c67c))[_0x964d('0x43')](handleError(_0x23dfb6,null));};exports[_0x964d('0x44')]=function(_0x241c95,_0x4bd8b5){var _0x300a9b={'raw':!![],'where':{'id':_0x241c95[_0x964d('0x45')]['id']}},_0xbeb515={};_0xbeb515[_0x964d('0x2d')]=_[_0x964d('0x2f')](db[_0x964d('0x29')][_0x964d('0x2a')]);_0xbeb515[_0x964d('0x2e')]=_['keys'](_0x241c95[_0x964d('0x2e')]);_0xbeb515[_0x964d('0x30')]=_['intersection'](_0xbeb515[_0x964d('0x2d')],_0xbeb515[_0x964d('0x2e')]);_0x300a9b[_0x964d('0x31')]=_[_0x964d('0x32')](_0xbeb515[_0x964d('0x2d')],qs['fields'](_0x241c95[_0x964d('0x2e')][_0x964d('0x33')]));_0x300a9b[_0x964d('0x31')]=_0x300a9b[_0x964d('0x31')][_0x964d('0x46')]?_0x300a9b['attributes']:_0xbeb515[_0x964d('0x2d')];if(_0x241c95[_0x964d('0x2e')]['includeAll']){_0x300a9b[_0x964d('0x40')]=[{'all':!![]}];}_0x300a9b=_[_0x964d('0x3c')]({},_0x300a9b,_0x241c95[_0x964d('0x3f')]);return db[_0x964d('0x29')][_0x964d('0x47')](_0x300a9b)[_0x964d('0x22')](handleEntityNotFound(_0x4bd8b5,null))[_0x964d('0x22')](respondWithResult(_0x4bd8b5,null))[_0x964d('0x43')](handleError(_0x4bd8b5,null));};exports[_0x964d('0x48')]=function(_0x29f752,_0x106df2){return db[_0x964d('0x29')][_0x964d('0x48')](_0x29f752['body'],{})[_0x964d('0x22')](respondWithResult(_0x106df2,0xc9))[_0x964d('0x43')](handleError(_0x106df2,null));};exports[_0x964d('0x21')]=function(_0x226f61,_0x42e453){if(_0x226f61['body']['id']){delete _0x226f61[_0x964d('0x49')]['id'];}return db[_0x964d('0x29')][_0x964d('0x47')]({'where':{'id':_0x226f61['params']['id']}})[_0x964d('0x22')](handleEntityNotFound(_0x42e453,null))[_0x964d('0x22')](saveUpdates(_0x226f61[_0x964d('0x49')],null))['then'](respondWithResult(_0x42e453,null))[_0x964d('0x43')](handleError(_0x42e453,null));};exports[_0x964d('0x4a')]=function(_0x46a974,_0x1da12f){return db[_0x964d('0x29')][_0x964d('0x47')]({'where':{'id':_0x46a974[_0x964d('0x45')]['id']}})['then'](handleEntityNotFound(_0x1da12f,null))[_0x964d('0x22')](removeEntity(_0x1da12f,null))[_0x964d('0x43')](handleError(_0x1da12f,null));};exports[_0x964d('0x4b')]=function(_0x5a8b0d,_0x2af82d){return db[_0x964d('0x29')][_0x964d('0x4b')]()['then'](respondWithResult(_0x2af82d,null))['catch'](handleError(_0x2af82d,null));};
\ No newline at end of file
+var _0x4717=['error','name','send','index','VoiceDialReport','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x254418,_0x3bb764){var _0x1aa988=function(_0x5a0012){while(--_0x5a0012){_0x254418['push'](_0x254418['shift']());}};_0x1aa988(++_0x3bb764);}(_0x4717,0x1e1));var _0x7471=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x4717[_0x1d9aa0];return _0x226868;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7471('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7471('0x1'));var rp=require(_0x7471('0x2'));var moment=require(_0x7471('0x3'));var BPromise=require(_0x7471('0x4'));var Mustache=require(_0x7471('0x5'));var util=require(_0x7471('0x6'));var path=require(_0x7471('0x7'));var sox=require(_0x7471('0x8'));var csv=require(_0x7471('0x9'));var ejs=require(_0x7471('0xa'));var fs=require('fs');var _=require(_0x7471('0xb'));var squel=require(_0x7471('0xc'));var crypto=require('crypto');var jsforce=require(_0x7471('0xd'));var deskjs=require(_0x7471('0xe'));var toCsv=require(_0x7471('0x9'));var querystring=require(_0x7471('0xf'));var Papa=require(_0x7471('0x10'));var Redis=require(_0x7471('0x11'));var authService=require(_0x7471('0x12'));var qs=require(_0x7471('0x13'));var as=require(_0x7471('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7471('0x15'));var utils=require(_0x7471('0x16'));var config=require('../../config/environment');var db=require(_0x7471('0x17'))['db'];function respondWithStatusCode(_0x33f07f,_0x53dbbd){_0x53dbbd=_0x53dbbd||0xcc;return function(_0x4c7a7b){if(_0x4c7a7b){return _0x33f07f['sendStatus'](_0x53dbbd);}return _0x33f07f[_0x7471('0x18')](_0x53dbbd)[_0x7471('0x19')]();};}function respondWithResult(_0x1e117,_0x2a2666){_0x2a2666=_0x2a2666||0xc8;return function(_0x1aeb7e){if(_0x1aeb7e){return _0x1e117[_0x7471('0x18')](_0x2a2666)[_0x7471('0x1a')](_0x1aeb7e);}};}function respondWithFilteredResult(_0x42054c,_0x17ddd4){return function(_0x4c006b){if(_0x4c006b){var _0x49f518=_0x4c006b[_0x7471('0x1b')],_0x2417bc=_0x17ddd4[_0x7471('0x1c')],_0x5d754e=_0x17ddd4[_0x7471('0x1c')]+_0x17ddd4['limit'],_0x1e4ec2;if(_0x5d754e>=_0x49f518){_0x5d754e=_0x49f518;_0x1e4ec2=0xc8;}else{_0x1e4ec2=0xce;}_0x42054c[_0x7471('0x18')](_0x1e4ec2);return _0x42054c[_0x7471('0x1d')](_0x7471('0x1e'),_0x2417bc+'-'+_0x5d754e+'/'+_0x49f518)[_0x7471('0x1a')](_0x4c006b);}return null;};}function patchUpdates(_0xc824b8){return function(_0x9d2743){try{jsonpatch[_0x7471('0x1f')](_0x9d2743,_0xc824b8,!![]);}catch(_0x27ea7d){return BPromise[_0x7471('0x20')](_0x27ea7d);}return _0x9d2743[_0x7471('0x21')]();};}function saveUpdates(_0x504c74,_0x145b2a){return function(_0x212ad5){if(_0x212ad5){return _0x212ad5[_0x7471('0x22')](_0x504c74)[_0x7471('0x23')](function(_0x50082c){return _0x50082c;});}return null;};}function removeEntity(_0x1bbad9,_0x3fc111){return function(_0x4343c1){if(_0x4343c1){return _0x4343c1[_0x7471('0x24')]()[_0x7471('0x23')](function(){_0x1bbad9[_0x7471('0x18')](0xcc)[_0x7471('0x19')]();});}};}function handleEntityNotFound(_0x55ffd9,_0x72fc62){return function(_0x354cb1){if(!_0x354cb1){_0x55ffd9['sendStatus'](0x194);}return _0x354cb1;};}function handleError(_0x1ab7e6,_0x5468ac){_0x5468ac=_0x5468ac||0x1f4;return function(_0x5f0ea7){logger[_0x7471('0x25')](_0x5f0ea7['stack']);if(_0x5f0ea7[_0x7471('0x26')]){delete _0x5f0ea7[_0x7471('0x26')];}_0x1ab7e6[_0x7471('0x18')](_0x5468ac)[_0x7471('0x27')](_0x5f0ea7);};}exports[_0x7471('0x28')]=function(_0x90bbf2,_0x59431f){var _0x2cb971={},_0x48caf4={},_0x3065e1={'count':0x0,'rows':[]};var _0x308a65=_['map'](db[_0x7471('0x29')]['rawAttributes'],function(_0x2b6af0){return{'name':_0x2b6af0['fieldName'],'type':_0x2b6af0['type'][_0x7471('0x2a')]};});_0x48caf4[_0x7471('0x2b')]=_[_0x7471('0x2c')](_0x308a65,_0x7471('0x26'));_0x48caf4[_0x7471('0x2d')]=_[_0x7471('0x2e')](_0x90bbf2['query']);_0x48caf4[_0x7471('0x2f')]=_['intersection'](_0x48caf4[_0x7471('0x2b')],_0x48caf4[_0x7471('0x2d')]);_0x2cb971[_0x7471('0x30')]=_['intersection'](_0x48caf4[_0x7471('0x2b')],qs[_0x7471('0x31')](_0x90bbf2[_0x7471('0x2d')]['fields']));_0x2cb971[_0x7471('0x30')]=_0x2cb971[_0x7471('0x30')][_0x7471('0x32')]?_0x2cb971['attributes']:_0x48caf4[_0x7471('0x2b')];if(!_0x90bbf2['query'][_0x7471('0x33')](_0x7471('0x34'))){_0x2cb971[_0x7471('0x35')]=qs['limit'](_0x90bbf2['query'][_0x7471('0x35')]);_0x2cb971[_0x7471('0x1c')]=qs[_0x7471('0x1c')](_0x90bbf2['query'][_0x7471('0x1c')]);}_0x2cb971[_0x7471('0x36')]=qs[_0x7471('0x37')](_0x90bbf2['query'][_0x7471('0x37')]);_0x2cb971[_0x7471('0x38')]=qs[_0x7471('0x2f')](_[_0x7471('0x39')](_0x90bbf2[_0x7471('0x2d')],_0x48caf4[_0x7471('0x2f')]),_0x308a65);if(_0x90bbf2['query']['filter']){_0x2cb971[_0x7471('0x38')]=_[_0x7471('0x3a')](_0x2cb971[_0x7471('0x38')],{'$or':_['map'](_0x308a65,function(_0x4e4437){if(_0x4e4437[_0x7471('0x3b')]!==_0x7471('0x3c')){var _0x14a753={};_0x14a753[_0x4e4437[_0x7471('0x26')]]={'$like':'%'+_0x90bbf2[_0x7471('0x2d')][_0x7471('0x3d')]+'%'};return _0x14a753;}})});}_0x2cb971=_['merge']({},_0x2cb971,_0x90bbf2[_0x7471('0x3e')]);var _0x1e155f={'where':_0x2cb971['where']};return db['VoiceDialReport'][_0x7471('0x1b')](_0x1e155f)[_0x7471('0x23')](function(_0x526d1b){_0x3065e1['count']=_0x526d1b;if(_0x90bbf2[_0x7471('0x2d')]['includeAll']){_0x2cb971[_0x7471('0x3f')]=[{'all':!![]}];}return db[_0x7471('0x29')][_0x7471('0x40')](_0x2cb971);})[_0x7471('0x23')](function(_0x56b568){_0x3065e1['rows']=_0x56b568;return _0x3065e1;})[_0x7471('0x23')](respondWithFilteredResult(_0x59431f,_0x2cb971))[_0x7471('0x41')](handleError(_0x59431f,null));};exports[_0x7471('0x42')]=function(_0x4b9edc,_0x2efe03){var _0x1787db={'raw':!![],'where':{'id':_0x4b9edc[_0x7471('0x43')]['id']}},_0x134397={};_0x134397['model']=_['keys'](db['VoiceDialReport'][_0x7471('0x44')]);_0x134397['query']=_['keys'](_0x4b9edc[_0x7471('0x2d')]);_0x134397[_0x7471('0x2f')]=_[_0x7471('0x45')](_0x134397[_0x7471('0x2b')],_0x134397[_0x7471('0x2d')]);_0x1787db[_0x7471('0x30')]=_['intersection'](_0x134397[_0x7471('0x2b')],qs[_0x7471('0x31')](_0x4b9edc[_0x7471('0x2d')][_0x7471('0x31')]));_0x1787db[_0x7471('0x30')]=_0x1787db[_0x7471('0x30')][_0x7471('0x32')]?_0x1787db[_0x7471('0x30')]:_0x134397['model'];if(_0x4b9edc[_0x7471('0x2d')][_0x7471('0x46')]){_0x1787db['include']=[{'all':!![]}];}_0x1787db=_[_0x7471('0x3a')]({},_0x1787db,_0x4b9edc['options']);return db[_0x7471('0x29')][_0x7471('0x47')](_0x1787db)['then'](handleEntityNotFound(_0x2efe03,null))[_0x7471('0x23')](respondWithResult(_0x2efe03,null))['catch'](handleError(_0x2efe03,null));};exports[_0x7471('0x48')]=function(_0x2ef6de,_0x2b1529){return db[_0x7471('0x29')][_0x7471('0x48')](_0x2ef6de[_0x7471('0x49')],{})['then'](respondWithResult(_0x2b1529,0xc9))[_0x7471('0x41')](handleError(_0x2b1529,null));};exports[_0x7471('0x22')]=function(_0xeb4e87,_0x56da4b){if(_0xeb4e87[_0x7471('0x49')]['id']){delete _0xeb4e87[_0x7471('0x49')]['id'];}return db['VoiceDialReport'][_0x7471('0x47')]({'where':{'id':_0xeb4e87[_0x7471('0x43')]['id']}})[_0x7471('0x23')](handleEntityNotFound(_0x56da4b,null))[_0x7471('0x23')](saveUpdates(_0xeb4e87[_0x7471('0x49')],null))[_0x7471('0x23')](respondWithResult(_0x56da4b,null))['catch'](handleError(_0x56da4b,null));};exports[_0x7471('0x24')]=function(_0xa40cb3,_0x162e37){return db[_0x7471('0x29')][_0x7471('0x47')]({'where':{'id':_0xa40cb3[_0x7471('0x43')]['id']}})['then'](handleEntityNotFound(_0x162e37,null))[_0x7471('0x23')](removeEntity(_0x162e37,null))[_0x7471('0x41')](handleError(_0x162e37,null));};exports['describe']=function(_0x2007d9,_0x30957e){return db[_0x7471('0x29')]['describe']()[_0x7471('0x23')](respondWithResult(_0x30957e,null))[_0x7471('0x41')](handleError(_0x30957e,null));};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js
index 807e2b9..0bd1657 100644
--- a/server/api/voiceDialReport/voiceDialReport.model.js
+++ b/server/api/voiceDialReport/voiceDialReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf85f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceDialReport','report_dial','uniqueid'];(function(_0x251e59,_0x1f1371){var _0x1bc6d1=function(_0x2e1597){while(--_0x2e1597){_0x251e59['push'](_0x251e59['shift']());}};_0x1bc6d1(++_0x1f1371);}(_0xf85f,0x1ea));var _0xff85=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xf85f[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0xff85('0x0'));var util=require(_0xff85('0x1'));var logger=require(_0xff85('0x2'))(_0xff85('0x3'));var moment=require(_0xff85('0x4'));var BPromise=require('bluebird');var rp=require(_0xff85('0x5'));var fs=require('fs');var path=require(_0xff85('0x6'));var rimraf=require(_0xff85('0x7'));var config=require(_0xff85('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0xff85('0x9')]=function(_0x34793d,_0x87bb50){return _0x34793d[_0xff85('0xa')](_0xff85('0xb'),attributes,{'tableName':_0xff85('0xc'),'paranoid':![],'indexes':[{'fields':[_0xff85('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf5c0=['VoiceDialReport','report_dial','uniqueid','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define'];(function(_0x5bb2cf,_0x3ced8e){var _0x30b2d4=function(_0x24677e){while(--_0x24677e){_0x5bb2cf['push'](_0x5bb2cf['shift']());}};_0x30b2d4(++_0x3ced8e);}(_0xf5c0,0xcf));var _0x0f5c=function(_0x3af4e5,_0x3009b0){_0x3af4e5=_0x3af4e5-0x0;var _0x31d2be=_0xf5c0[_0x3af4e5];return _0x31d2be;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f5c('0x0'))(_0x0f5c('0x1'));var moment=require('moment');var BPromise=require(_0x0f5c('0x2'));var rp=require(_0x0f5c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f5c('0x4'));var config=require(_0x0f5c('0x5'));var attributes=require(_0x0f5c('0x6'));module[_0x0f5c('0x7')]=function(_0x20f700,_0x128c22){return _0x20f700[_0x0f5c('0x8')](_0x0f5c('0x9'),attributes,{'tableName':_0x0f5c('0xa'),'paranoid':![],'indexes':[{'fields':[_0x0f5c('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js
index 3c1e6cd..f61b6b8 100644
--- a/server/api/voiceDialReport/voiceDialReport.rpc.js
+++ b/server/api/voiceDialReport/voiceDialReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x35aa=['info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','VoiceDialReport,\x20%s,\x20%s','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport','update','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x329709,_0x462041){var _0x42a910=function(_0x57ffb5){while(--_0x57ffb5){_0x329709['push'](_0x329709['shift']());}};_0x42a910(++_0x462041);}(_0x35aa,0xbe));var _0xa35a=function(_0x2211d4,_0x592254){_0x2211d4=_0x2211d4-0x0;var _0x565b56=_0x35aa[_0x2211d4];return _0x565b56;};'use strict';var _=require('lodash');var util=require(_0xa35a('0x0'));var moment=require(_0xa35a('0x1'));var BPromise=require(_0xa35a('0x2'));var rs=require(_0xa35a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa35a('0x4'))['db'];var utils=require(_0xa35a('0x5'));var logger=require(_0xa35a('0x6'))(_0xa35a('0x7'));var config=require(_0xa35a('0x8'));var jayson=require(_0xa35a('0x9'));var client=jayson[_0xa35a('0xa')][_0xa35a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x563deb,_0x4053fb,_0x4e5d71){return new BPromise(function(_0x476134,_0xe2919c){return client[_0xa35a('0xc')](_0x563deb,_0x4e5d71)[_0xa35a('0xd')](function(_0x42ec44){logger[_0xa35a('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x4053fb,_0xa35a('0xf'));logger[_0xa35a('0x10')](_0xa35a('0x11'),_0x4053fb,_0xa35a('0xf'),JSON['stringify'](_0x42ec44));if(_0x42ec44[_0xa35a('0x12')]){if(_0x42ec44[_0xa35a('0x12')]['code']===0x1f4){logger[_0xa35a('0x12')](_0xa35a('0x13'),_0x4053fb,_0x42ec44[_0xa35a('0x12')][_0xa35a('0x14')]);return _0xe2919c(_0x42ec44[_0xa35a('0x12')][_0xa35a('0x14')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x4053fb,_0x42ec44[_0xa35a('0x12')]['message']);return _0x476134(_0x42ec44[_0xa35a('0x12')][_0xa35a('0x14')]);}else{logger['info'](_0xa35a('0x13'),_0x4053fb,_0xa35a('0xf'));_0x476134(_0x42ec44['result']['message']);}})[_0xa35a('0x15')](function(_0x41c38a){logger[_0xa35a('0x12')](_0xa35a('0x13'),_0x4053fb,_0x41c38a);_0xe2919c(_0x41c38a);});});}exports[_0xa35a('0x16')]=function(_0x223b82){var _0x474cbd=this;return new Promise(function(_0x4fd3e3,_0xdfc2){return db[_0xa35a('0x17')][_0xa35a('0x18')](_0x223b82[_0xa35a('0x19')],{'raw':_0x223b82[_0xa35a('0x1a')]?_0x223b82[_0xa35a('0x1a')][_0xa35a('0x1b')]===undefined?!![]:![]:!![]})[_0xa35a('0xd')](function(_0x8c8b91){logger[_0xa35a('0xe')](_0xa35a('0x16'),_0x223b82);logger[_0xa35a('0x10')]('CreateVoiceDialReport',_0x223b82,JSON[_0xa35a('0x1c')](_0x8c8b91));_0x4fd3e3(_0x8c8b91);})[_0xa35a('0x15')](function(_0x5269e9){logger['error'](_0xa35a('0x16'),_0x5269e9['message'],_0x223b82);_0xdfc2(_0x474cbd[_0xa35a('0x12')](0x1f4,_0x5269e9['message']));});});};exports[_0xa35a('0x1d')]=function(_0x31610f){var _0x454e45=this;return new Promise(function(_0x496ad4,_0x29ae08){return db[_0xa35a('0x17')][_0xa35a('0x1e')](_0x31610f[_0xa35a('0x19')],{'raw':_0x31610f['options']?_0x31610f['options'][_0xa35a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31610f[_0xa35a('0x1a')]?_0x31610f[_0xa35a('0x1a')][_0xa35a('0x1f')]||null:null,'attributes':_0x31610f[_0xa35a('0x1a')]?_0x31610f[_0xa35a('0x1a')][_0xa35a('0x20')]||null:null,'limit':_0x31610f['options']?_0x31610f[_0xa35a('0x1a')][_0xa35a('0x21')]||null:null})[_0xa35a('0xd')](function(_0x3e8a68){logger['info']('UpdateVoiceDialReport',_0x31610f);logger[_0xa35a('0x10')](_0xa35a('0x1d'),_0x31610f,JSON[_0xa35a('0x1c')](_0x3e8a68));_0x496ad4(_0x3e8a68);})[_0xa35a('0x15')](function(_0x431934){logger[_0xa35a('0x12')](_0xa35a('0x1d'),_0x431934[_0xa35a('0x14')],_0x31610f);_0x29ae08(_0x454e45[_0xa35a('0x12')](0x1f4,_0x431934[_0xa35a('0x14')]));});});};
\ No newline at end of file
+var _0x80df=['then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','update','body','raw','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3989b7,_0x3c0053){var _0x10c6ee=function(_0x246429){while(--_0x246429){_0x3989b7['push'](_0x3989b7['shift']());}};_0x10c6ee(++_0x3c0053);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x62e50f,_0x5068d4,_0x30e2b3){return new BPromise(function(_0x16b219,_0x2f56b3){return client[_0xf80d('0xd')](_0x62e50f,_0x30e2b3)[_0xf80d('0xe')](function(_0x186339){logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));logger[_0xf80d('0x12')](_0xf80d('0x13'),_0x5068d4,_0xf80d('0x11'),JSON[_0xf80d('0x14')](_0x186339));if(_0x186339[_0xf80d('0x15')]){if(_0x186339['error']['code']===0x1f4){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x2f56b3(_0x186339['error'][_0xf80d('0x16')]);}logger['error'](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x16b219(_0x186339[_0xf80d('0x15')][_0xf80d('0x16')]);}else{logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));_0x16b219(_0x186339[_0xf80d('0x17')][_0xf80d('0x16')]);}})[_0xf80d('0x18')](function(_0x3b8a82){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x3b8a82);_0x2f56b3(_0x3b8a82);});});}exports[_0xf80d('0x19')]=function(_0x1d104a){var _0x34b49d=this;return new Promise(function(_0x2ea2c1,_0x7ba89c){return db[_0xf80d('0x1a')][_0xf80d('0x1b')](_0x1d104a['body'],{'raw':_0x1d104a[_0xf80d('0x1c')]?_0x1d104a[_0xf80d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf80d('0xe')](function(_0x539c80){logger[_0xf80d('0xf')](_0xf80d('0x19'),_0x1d104a);logger[_0xf80d('0x12')](_0xf80d('0x19'),_0x1d104a,JSON[_0xf80d('0x14')](_0x539c80));_0x2ea2c1(_0x539c80);})[_0xf80d('0x18')](function(_0x446153){logger[_0xf80d('0x15')](_0xf80d('0x19'),_0x446153[_0xf80d('0x16')],_0x1d104a);_0x7ba89c(_0x34b49d[_0xf80d('0x15')](0x1f4,_0x446153[_0xf80d('0x16')]));});});};exports['UpdateVoiceDialReport']=function(_0x32ad42){var _0x1dce73=this;return new Promise(function(_0x5906fa,_0x3353a3){return db[_0xf80d('0x1a')][_0xf80d('0x1d')](_0x32ad42[_0xf80d('0x1e')],{'raw':_0x32ad42['options']?_0x32ad42[_0xf80d('0x1c')][_0xf80d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32ad42[_0xf80d('0x1c')]?_0x32ad42[_0xf80d('0x1c')][_0xf80d('0x20')]||null:null,'attributes':_0x32ad42[_0xf80d('0x1c')]?_0x32ad42[_0xf80d('0x1c')][_0xf80d('0x21')]||null:null,'limit':_0x32ad42[_0xf80d('0x1c')]?_0x32ad42['options'][_0xf80d('0x22')]||null:null})[_0xf80d('0xe')](function(_0x3e2c8c){logger[_0xf80d('0xf')](_0xf80d('0x23'),_0x32ad42);logger[_0xf80d('0x12')](_0xf80d('0x23'),_0x32ad42,JSON['stringify'](_0x3e2c8c));_0x5906fa(_0x3e2c8c);})[_0xf80d('0x18')](function(_0x27887e){logger[_0xf80d('0x15')](_0xf80d('0x23'),_0x27887e['message'],_0x32ad42);_0x3353a3(_0x1dce73['error'](0x1f4,_0x27887e[_0xf80d('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js
index b1e19bf..bdc2bb9 100644
--- a/server/api/voiceExtension/index.js
+++ b/server/api/voiceExtension/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b3c=['index','/:id','post','create','/:id/applications','addApplications','exports','multer','util','path','../../components/auth/service','./voiceExtension.controller','get','isAuthenticated'];(function(_0x241760,_0x3b4a1f){var _0x1a1d7f=function(_0x5cd96f){while(--_0x5cd96f){_0x241760['push'](_0x241760['shift']());}};_0x1a1d7f(++_0x3b4a1f);}(_0x5b3c,0xcb));var _0xc5b3=function(_0x5af97f,_0x4be6a2){_0x5af97f=_0x5af97f-0x0;var _0x1e1495=_0x5b3c[_0x5af97f];return _0x1e1495;};'use strict';var multer=require(_0xc5b3('0x0'));var util=require(_0xc5b3('0x1'));var path=require(_0xc5b3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xc5b3('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc5b3('0x4'));router[_0xc5b3('0x5')]('/',auth[_0xc5b3('0x6')](),controller[_0xc5b3('0x7')]);router['get'](_0xc5b3('0x8'),auth[_0xc5b3('0x6')](),controller['show']);router[_0xc5b3('0x9')]('/',auth['isAuthenticated'](),controller[_0xc5b3('0xa')]);router[_0xc5b3('0x9')](_0xc5b3('0xb'),auth['isAuthenticated'](),controller[_0xc5b3('0xc')]);router['put'](_0xc5b3('0x8'),auth[_0xc5b3('0x6')](),controller['update']);router['delete']('/:id',auth[_0xc5b3('0x6')](),controller['destroy']);module[_0xc5b3('0xd')]=router;
\ No newline at end of file
+var _0x6f16=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','addApplications','put','/:id','update','delete','destroy'];(function(_0x3c8ca1,_0x1698b4){var _0x1be0dc=function(_0x32abda){while(--_0x32abda){_0x3c8ca1['push'](_0x3c8ca1['shift']());}};_0x1be0dc(++_0x1698b4);}(_0x6f16,0x151));var _0x66f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f16[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x66f1('0x0'));var util=require(_0x66f1('0x1'));var path=require(_0x66f1('0x2'));var timeout=require(_0x66f1('0x3'));var express=require(_0x66f1('0x4'));var router=express[_0x66f1('0x5')]();var auth=require(_0x66f1('0x6'));var interaction=require(_0x66f1('0x7'));var config=require(_0x66f1('0x8'));var controller=require('./voiceExtension.controller');router[_0x66f1('0x9')]('/',auth[_0x66f1('0xa')](),controller[_0x66f1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x66f1('0xc')]('/',auth[_0x66f1('0xa')](),controller[_0x66f1('0xd')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x66f1('0xe')]);router[_0x66f1('0xf')](_0x66f1('0x10'),auth[_0x66f1('0xa')](),controller[_0x66f1('0x11')]);router[_0x66f1('0x12')](_0x66f1('0x10'),auth[_0x66f1('0xa')](),controller[_0x66f1('0x13')]);module[_0x66f1('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js
index b36219e..73f897a 100644
--- a/server/api/voiceExtension/voiceExtension.attributes.js
+++ b/server/api/voiceExtension/voiceExtension.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x169374,_0x26c937){var _0x1c2d16=function(_0x370ff1){while(--_0x370ff1){_0x169374['push'](_0x169374['shift']());}};_0x1c2d16(++_0x26c937);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}};
\ No newline at end of file
+var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x4f3b0e,_0x1c0179){var _0x200642=function(_0x12f06a){while(--_0x12f06a){_0x4f3b0e['push'](_0x4f3b0e['shift']());}};_0x200642(++_0x1c0179);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js
index c7e3853..bde8fee 100644
--- a/server/api/voiceExtension/voiceExtension.controller.js
+++ b/server/api/voiceExtension/voiceExtension.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['includeAll','include','rows','params','catch','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','recordingFormat','mandatoryDisposition','transaction','VoiceExtensionId','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','set','Content-Range','reject','save','update','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','map','value','includes','type','find','UserProfileResource','error','stack','name','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','count'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1261,0x144));var _0x1126=function(_0x55bd12,_0x3ccb52){_0x55bd12=_0x55bd12-0x0;var _0x1941dd=_0x1261[_0x55bd12];return _0x1941dd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var db=require(_0x1126('0x16'))['db'];config[_0x1126('0x17')]=_[_0x1126('0x18')](config[_0x1126('0x17')],{'host':_0x1126('0x19'),'port':0x18eb});var socket=require(_0x1126('0x1a'))(new Redis(config[_0x1126('0x17')]));require(_0x1126('0x1b'))[_0x1126('0x1c')](socket);function respondWithStatusCode(_0x53a8f0,_0x5de9a7){_0x5de9a7=_0x5de9a7||0xcc;return function(_0x1af673){if(_0x1af673){return _0x53a8f0[_0x1126('0x1d')](_0x5de9a7);}return _0x53a8f0[_0x1126('0x1e')](_0x5de9a7)['end']();};}function respondWithResult(_0x45149c,_0x4794a7){_0x4794a7=_0x4794a7||0xc8;return function(_0x35fe9f){if(_0x35fe9f){return _0x45149c[_0x1126('0x1e')](_0x4794a7)[_0x1126('0x1f')](_0x35fe9f);}};}function respondWithFilteredResult(_0x4e1c97,_0x245cd7){return function(_0x1695f6){if(_0x1695f6){var _0x4a7b49=_0x1695f6['count'],_0x4d2b38=_0x245cd7['offset'],_0x22ae0b=_0x245cd7[_0x1126('0x20')]+_0x245cd7['limit'],_0x2b2487;if(_0x22ae0b>=_0x4a7b49){_0x22ae0b=_0x4a7b49;_0x2b2487=0xc8;}else{_0x2b2487=0xce;}_0x4e1c97[_0x1126('0x1e')](_0x2b2487);return _0x4e1c97[_0x1126('0x21')](_0x1126('0x22'),_0x4d2b38+'-'+_0x22ae0b+'/'+_0x4a7b49)['json'](_0x1695f6);}return null;};}function patchUpdates(_0x2a08ba){return function(_0x49d209){try{jsonpatch['apply'](_0x49d209,_0x2a08ba,!![]);}catch(_0x30f6b3){return BPromise[_0x1126('0x23')](_0x30f6b3);}return _0x49d209[_0x1126('0x24')]();};}function saveUpdates(_0x36d254,_0x526ca1){return function(_0x29ab60){if(_0x29ab60){return _0x29ab60[_0x1126('0x25')](_0x36d254)['then'](function(_0x2175fa){return _0x2175fa;});}return null;};}function removeEntity(_0x59cd8e,_0x529dd9){return function(_0x4b57ab){if(_0x4b57ab){return _0x4b57ab[_0x1126('0x26')]()[_0x1126('0x27')](function(){var _0x329914=_0x4b57ab[_0x1126('0x28')]({'plain':!![]});var _0x566c09=[{'name':_0x1126('0x29'),'value':_0x1126('0x2a'),'ignore':![]},{'name':_0x1126('0x2b'),'value':'outbound','ignore':![]},{'name':_0x1126('0x2c'),'value':_0x1126('0x2d'),'ignore':![]}];var _0xa293f4=_(_0x566c09)['filter']('ignore')[_0x1126('0x2e')](_0x1126('0x2f'))['value']();if(_[_0x1126('0x30')](_0xa293f4,_0x329914[_0x1126('0x31')])){return;}var _0x4a334a=_[_0x1126('0x32')](_0x566c09,['value',_0x329914[_0x1126('0x31')]])['name'];return db[_0x1126('0x33')]['destroy']({'where':{'type':_0x4a334a,'resourceId':_0x329914['id']}})[_0x1126('0x27')](function(){return _0x4b57ab;});})['then'](function(){_0x59cd8e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17646e,_0xa8906d){return function(_0x1cef48){if(!_0x1cef48){_0x17646e['sendStatus'](0x194);}return _0x1cef48;};}function handleError(_0x2a3055,_0x226afb){_0x226afb=_0x226afb||0x1f4;return function(_0x56f7f8){logger[_0x1126('0x34')](_0x56f7f8[_0x1126('0x35')]);if(_0x56f7f8[_0x1126('0x36')]){delete _0x56f7f8[_0x1126('0x36')];}_0x2a3055['status'](_0x226afb)['send'](_0x56f7f8);};}exports[_0x1126('0x37')]=function(_0x19e6e4,_0x2d9bd2){var _0x2c67eb={},_0x55244a={},_0x145314={'count':0x0,'rows':[]};var _0x6f4312=_[_0x1126('0x2e')](db[_0x1126('0x38')][_0x1126('0x39')],function(_0x5df232){return{'name':_0x5df232[_0x1126('0x3a')],'type':_0x5df232[_0x1126('0x31')][_0x1126('0x3b')]};});_0x55244a[_0x1126('0x3c')]=_['map'](_0x6f4312,'name');_0x55244a[_0x1126('0x3d')]=_[_0x1126('0x3e')](_0x19e6e4['query']);_0x55244a[_0x1126('0x3f')]=_[_0x1126('0x40')](_0x55244a[_0x1126('0x3c')],_0x55244a['query']);_0x2c67eb['attributes']=_[_0x1126('0x40')](_0x55244a[_0x1126('0x3c')],qs[_0x1126('0x41')](_0x19e6e4[_0x1126('0x3d')]['fields']));_0x2c67eb[_0x1126('0x42')]=_0x2c67eb['attributes'][_0x1126('0x43')]?_0x2c67eb[_0x1126('0x42')]:_0x55244a[_0x1126('0x3c')];if(!_0x19e6e4[_0x1126('0x3d')][_0x1126('0x44')]('nolimit')){_0x2c67eb[_0x1126('0x45')]=qs[_0x1126('0x45')](_0x19e6e4[_0x1126('0x3d')][_0x1126('0x45')]);_0x2c67eb[_0x1126('0x20')]=qs[_0x1126('0x20')](_0x19e6e4[_0x1126('0x3d')]['offset']);}_0x2c67eb[_0x1126('0x46')]=qs[_0x1126('0x47')](_0x19e6e4[_0x1126('0x3d')][_0x1126('0x47')]);_0x2c67eb[_0x1126('0x48')]=qs['filters'](_['pick'](_0x19e6e4[_0x1126('0x3d')],_0x55244a[_0x1126('0x3f')]),_0x6f4312);if(_0x19e6e4[_0x1126('0x3d')][_0x1126('0x49')]){_0x2c67eb[_0x1126('0x48')]=_[_0x1126('0x4a')](_0x2c67eb['where'],{'$or':_['map'](_0x6f4312,function(_0x4cb1db){if(_0x4cb1db[_0x1126('0x31')]!=='VIRTUAL'){var _0xf84005={};_0xf84005[_0x4cb1db[_0x1126('0x36')]]={'$like':'%'+_0x19e6e4[_0x1126('0x3d')][_0x1126('0x49')]+'%'};return _0xf84005;}})});}_0x2c67eb=_['merge']({},_0x2c67eb,_0x19e6e4['options']);var _0x353042={'where':_0x2c67eb[_0x1126('0x48')]};return db[_0x1126('0x38')]['count'](_0x353042)[_0x1126('0x27')](function(_0x5f35fa){_0x145314[_0x1126('0x4b')]=_0x5f35fa;if(_0x19e6e4['query'][_0x1126('0x4c')]){_0x2c67eb[_0x1126('0x4d')]=[{'all':!![]}];}return db[_0x1126('0x38')]['findAll'](_0x2c67eb);})[_0x1126('0x27')](function(_0x2ffccc){_0x145314[_0x1126('0x4e')]=_0x2ffccc;return _0x145314;})['then'](respondWithFilteredResult(_0x2d9bd2,_0x2c67eb))['catch'](handleError(_0x2d9bd2,null));};exports['show']=function(_0x6e78cf,_0x520b62){var _0x1e197e={'raw':![],'where':{'id':_0x6e78cf[_0x1126('0x4f')]['id']}},_0x507568={};_0x507568[_0x1126('0x3c')]=_[_0x1126('0x3e')](db[_0x1126('0x38')][_0x1126('0x39')]);_0x507568['query']=_[_0x1126('0x3e')](_0x6e78cf[_0x1126('0x3d')]);_0x507568['filters']=_[_0x1126('0x40')](_0x507568[_0x1126('0x3c')],_0x507568['query']);_0x1e197e[_0x1126('0x42')]=_[_0x1126('0x40')](_0x507568['model'],qs[_0x1126('0x41')](_0x6e78cf[_0x1126('0x3d')][_0x1126('0x41')]));_0x1e197e['attributes']=_0x1e197e[_0x1126('0x42')][_0x1126('0x43')]?_0x1e197e[_0x1126('0x42')]:_0x507568[_0x1126('0x3c')];if(_0x6e78cf[_0x1126('0x3d')][_0x1126('0x4c')]){_0x1e197e[_0x1126('0x4d')]=[{'all':!![]}];}_0x1e197e=_[_0x1126('0x4a')]({},_0x1e197e,_0x6e78cf['options']);return db[_0x1126('0x38')]['find'](_0x1e197e)[_0x1126('0x27')](handleEntityNotFound(_0x520b62,null))[_0x1126('0x27')](respondWithResult(_0x520b62,null))['catch'](handleError(_0x520b62,null));};exports['destroy']=function(_0x324995,_0x3c1d16){return db[_0x1126('0x38')]['find']({'where':{'id':_0x324995[_0x1126('0x4f')]['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x3c1d16,null))[_0x1126('0x27')](removeEntity(_0x3c1d16,null))[_0x1126('0x50')](handleError(_0x3c1d16,null));};exports['create']=function(_0x30d1b3,_0x46551f){if(_0x30d1b3['body']['type']==='outbound'&&!_['startsWith'](_0x30d1b3[_0x1126('0x51')][_0x1126('0x52')],'_')){_0x30d1b3['body'][_0x1126('0x52')]='_'[_0x1126('0x53')](_0x30d1b3[_0x1126('0x51')][_0x1126('0x52')]);}return db[_0x1126('0x38')]['create'](_0x30d1b3[_0x1126('0x51')],{'raw':![]})[_0x1126('0x27')](function(_0x5d6414){var _0x322016=_0x30d1b3[_0x1126('0x54')][_0x1126('0x28')]({'plain':!![]});if(!_0x322016)throw new Error(_0x1126('0x55'));if(_0x322016[_0x1126('0x56')]==='user'){var _0x673c09=_0x5d6414['get']({'plain':!![]});var _0x868b2c=[{'name':_0x1126('0x29'),'value':_0x1126('0x2a')},{'name':'OutboundRoutes','value':_0x1126('0x57')},{'name':_0x1126('0x2c'),'value':'internal'}];var _0x30812d=_[_0x1126('0x32')](_0x868b2c,[_0x1126('0x2f'),_0x673c09['type']])[_0x1126('0x36')];return db[_0x1126('0x58')][_0x1126('0x32')]({'where':{'name':_0x30812d,'userProfileId':_0x322016[_0x1126('0x59')]},'raw':!![]})[_0x1126('0x27')](function(_0x26949c){if(_0x26949c&&_0x26949c[_0x1126('0x5a')]===0x0){return db[_0x1126('0x33')]['create']({'name':_0x673c09[_0x1126('0x36')],'resourceId':_0x673c09['id'],'type':_0x26949c[_0x1126('0x36')],'sectionId':_0x26949c['id']},{})[_0x1126('0x27')](function(){return _0x5d6414;});}else{return _0x5d6414;}})[_0x1126('0x50')](function(_0x425193){logger['error'](_0x1126('0x5b'),_0x425193);throw _0x425193;});}return _0x5d6414;})[_0x1126('0x27')](respondWithResult(_0x46551f,0xc9))['catch'](handleError(_0x46551f,null));};exports[_0x1126('0x25')]=function(_0x5246aa,_0x272274){if(_0x5246aa[_0x1126('0x51')]['id']){delete _0x5246aa['body']['id'];}return db[_0x1126('0x38')][_0x1126('0x32')]({'where':{'id':_0x5246aa[_0x1126('0x4f')]['id']}})['then'](handleEntityNotFound(_0x272274,null))[_0x1126('0x27')](function(_0x4c1384){if(_0x4c1384){return db['VoiceExtension'][_0x1126('0x25')](_[_0x1126('0x5c')](_0x5246aa[_0x1126('0x51')],[_0x1126('0x52'),_0x1126('0x5d'),_0x1126('0x5e'),_0x1126('0x5f'),'cutdigits',_0x1126('0x60')]),{'where':{'context':_0x4c1384[_0x1126('0x5d')],'exten':_0x4c1384[_0x1126('0x52')]},'individualHooks':!![]})[_0x1126('0x27')](function(_0x3f87aa){return _0x3f87aa;});}return null;})[_0x1126('0x27')](respondWithStatusCode(_0x272274,null))['catch'](handleError(_0x272274,null));};exports['addApplications']=function(_0x16a343,_0x3921c2,_0x4bf2b3){return db['VoiceExtension']['findOne']({'where':{'id':_0x16a343['params']['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x3921c2,null))[_0x1126('0x27')](function(_0x3440c5){if(_0x3440c5){return db['sequelize'][_0x1126('0x61')](function(_0x45c782){return db[_0x1126('0x38')][_0x1126('0x26')]({'where':{'VoiceExtensionId':_0x16a343[_0x1126('0x4f')]['id']},'transaction':_0x45c782})[_0x1126('0x27')](function(_0x131056){var _0x49a0a3=_[_0x1126('0x2e')](_0x16a343[_0x1126('0x51')],function(_0x43bd70){_0x43bd70[_0x1126('0x62')]=_0x16a343[_0x1126('0x4f')]['id'];return _0x43bd70;});return db['VoiceExtension']['bulkCreate'](_0x49a0a3,{'transaction':_0x45c782});});})[_0x1126('0x27')](function(){return db[_0x1126('0x38')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x16a343[_0x1126('0x4f')]['id']},'order':_0x1126('0x63')});});}})[_0x1126('0x27')](respondWithResult(_0x3921c2,null))[_0x1126('0x50')](handleError(_0x3921c2,null));};
\ No newline at end of file
+var _0x5f2f=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','findOne','sequelize','transaction','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','count','offset','set','reject','save','update','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','find','UserProfileResource','destroy','sendStatus','error','stack','name','send','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','keys','startsWith','body','exten','create','user','role','internal'];(function(_0x15d181,_0x50748e){var _0x21ba43=function(_0x2c6993){while(--_0x2c6993){_0x15d181['push'](_0x15d181['shift']());}};_0x21ba43(++_0x50748e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x295a85,_0x225aa6){_0x295a85=_0x295a85-0x0;var _0x313f77=_0x5f2f[_0x295a85];return _0x313f77;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];config[_0xf5f2('0x17')]=_[_0xf5f2('0x18')](config[_0xf5f2('0x17')],{'host':_0xf5f2('0x19'),'port':0x18eb});var socket=require(_0xf5f2('0x1a'))(new Redis(config['redis']));require(_0xf5f2('0x1b'))[_0xf5f2('0x1c')](socket);function respondWithStatusCode(_0x269909,_0x1c1a5c){_0x1c1a5c=_0x1c1a5c||0xcc;return function(_0x422b55){if(_0x422b55){return _0x269909['sendStatus'](_0x1c1a5c);}return _0x269909[_0xf5f2('0x1d')](_0x1c1a5c)[_0xf5f2('0x1e')]();};}function respondWithResult(_0x17d656,_0x1b6dd2){_0x1b6dd2=_0x1b6dd2||0xc8;return function(_0x23e23a){if(_0x23e23a){return _0x17d656[_0xf5f2('0x1d')](_0x1b6dd2)[_0xf5f2('0x1f')](_0x23e23a);}};}function respondWithFilteredResult(_0x395a5a,_0x11f702){return function(_0x228ace){if(_0x228ace){var _0x20fccd=_0x228ace[_0xf5f2('0x20')],_0x28e097=_0x11f702[_0xf5f2('0x21')],_0x4ff59b=_0x11f702[_0xf5f2('0x21')]+_0x11f702['limit'],_0x3ee69;if(_0x4ff59b>=_0x20fccd){_0x4ff59b=_0x20fccd;_0x3ee69=0xc8;}else{_0x3ee69=0xce;}_0x395a5a[_0xf5f2('0x1d')](_0x3ee69);return _0x395a5a[_0xf5f2('0x22')]('Content-Range',_0x28e097+'-'+_0x4ff59b+'/'+_0x20fccd)['json'](_0x228ace);}return null;};}function patchUpdates(_0x2d2805){return function(_0x388e6c){try{jsonpatch['apply'](_0x388e6c,_0x2d2805,!![]);}catch(_0x45b74f){return BPromise[_0xf5f2('0x23')](_0x45b74f);}return _0x388e6c[_0xf5f2('0x24')]();};}function saveUpdates(_0x39c024,_0x36f1cb){return function(_0x4c691a){if(_0x4c691a){return _0x4c691a[_0xf5f2('0x25')](_0x39c024)[_0xf5f2('0x26')](function(_0x4e8bda){return _0x4e8bda;});}return null;};}function removeEntity(_0x2833fe,_0x287ad5){return function(_0x5bdf4a){if(_0x5bdf4a){return _0x5bdf4a['destroy']()[_0xf5f2('0x26')](function(){var _0x3f79d5=_0x5bdf4a[_0xf5f2('0x27')]({'plain':!![]});var _0x1a5bb3=[{'name':_0xf5f2('0x28'),'value':_0xf5f2('0x29'),'ignore':![]},{'name':_0xf5f2('0x2a'),'value':_0xf5f2('0x2b'),'ignore':![]},{'name':_0xf5f2('0x2c'),'value':'internal','ignore':![]}];var _0xaa2602=_(_0x1a5bb3)[_0xf5f2('0x2d')](_0xf5f2('0x2e'))[_0xf5f2('0x2f')](_0xf5f2('0x30'))[_0xf5f2('0x30')]();if(_['includes'](_0xaa2602,_0x3f79d5['type'])){return;}var _0x22c826=_[_0xf5f2('0x31')](_0x1a5bb3,[_0xf5f2('0x30'),_0x3f79d5['type']])['name'];return db[_0xf5f2('0x32')][_0xf5f2('0x33')]({'where':{'type':_0x22c826,'resourceId':_0x3f79d5['id']}})[_0xf5f2('0x26')](function(){return _0x5bdf4a;});})[_0xf5f2('0x26')](function(){_0x2833fe[_0xf5f2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e959,_0x2f4778){return function(_0x4e19cb){if(!_0x4e19cb){_0x52e959[_0xf5f2('0x34')](0x194);}return _0x4e19cb;};}function handleError(_0x58a4df,_0x45b643){_0x45b643=_0x45b643||0x1f4;return function(_0x31087c){logger[_0xf5f2('0x35')](_0x31087c[_0xf5f2('0x36')]);if(_0x31087c[_0xf5f2('0x37')]){delete _0x31087c[_0xf5f2('0x37')];}_0x58a4df[_0xf5f2('0x1d')](_0x45b643)[_0xf5f2('0x38')](_0x31087c);};}exports['index']=function(_0x4149e6,_0x43e4ff){var _0x4590ec={},_0x43c77d={},_0x1408b9={'count':0x0,'rows':[]};var _0x27c0e7=_[_0xf5f2('0x2f')](db['VoiceExtension'][_0xf5f2('0x39')],function(_0xf503e8){return{'name':_0xf503e8['fieldName'],'type':_0xf503e8[_0xf5f2('0x3a')]['key']};});_0x43c77d[_0xf5f2('0x3b')]=_[_0xf5f2('0x2f')](_0x27c0e7,_0xf5f2('0x37'));_0x43c77d[_0xf5f2('0x3c')]=_['keys'](_0x4149e6['query']);_0x43c77d[_0xf5f2('0x3d')]=_[_0xf5f2('0x3e')](_0x43c77d[_0xf5f2('0x3b')],_0x43c77d['query']);_0x4590ec[_0xf5f2('0x3f')]=_['intersection'](_0x43c77d[_0xf5f2('0x3b')],qs['fields'](_0x4149e6[_0xf5f2('0x3c')][_0xf5f2('0x40')]));_0x4590ec['attributes']=_0x4590ec[_0xf5f2('0x3f')][_0xf5f2('0x41')]?_0x4590ec[_0xf5f2('0x3f')]:_0x43c77d[_0xf5f2('0x3b')];if(!_0x4149e6['query']['hasOwnProperty'](_0xf5f2('0x42'))){_0x4590ec[_0xf5f2('0x43')]=qs[_0xf5f2('0x43')](_0x4149e6[_0xf5f2('0x3c')][_0xf5f2('0x43')]);_0x4590ec[_0xf5f2('0x21')]=qs[_0xf5f2('0x21')](_0x4149e6['query'][_0xf5f2('0x21')]);}_0x4590ec[_0xf5f2('0x44')]=qs['sort'](_0x4149e6[_0xf5f2('0x3c')][_0xf5f2('0x45')]);_0x4590ec[_0xf5f2('0x46')]=qs[_0xf5f2('0x3d')](_[_0xf5f2('0x47')](_0x4149e6[_0xf5f2('0x3c')],_0x43c77d[_0xf5f2('0x3d')]),_0x27c0e7);if(_0x4149e6[_0xf5f2('0x3c')]['filter']){_0x4590ec[_0xf5f2('0x46')]=_[_0xf5f2('0x48')](_0x4590ec[_0xf5f2('0x46')],{'$or':_['map'](_0x27c0e7,function(_0x509dbc){if(_0x509dbc['type']!==_0xf5f2('0x49')){var _0x2ad13c={};_0x2ad13c[_0x509dbc['name']]={'$like':'%'+_0x4149e6[_0xf5f2('0x3c')][_0xf5f2('0x2d')]+'%'};return _0x2ad13c;}})});}_0x4590ec=_[_0xf5f2('0x48')]({},_0x4590ec,_0x4149e6[_0xf5f2('0x4a')]);var _0x354c34={'where':_0x4590ec[_0xf5f2('0x46')]};return db[_0xf5f2('0x4b')][_0xf5f2('0x20')](_0x354c34)[_0xf5f2('0x26')](function(_0x106062){_0x1408b9[_0xf5f2('0x20')]=_0x106062;if(_0x4149e6[_0xf5f2('0x3c')][_0xf5f2('0x4c')]){_0x4590ec[_0xf5f2('0x4d')]=[{'all':!![]}];}return db['VoiceExtension'][_0xf5f2('0x4e')](_0x4590ec);})['then'](function(_0x3d62c1){_0x1408b9[_0xf5f2('0x4f')]=_0x3d62c1;return _0x1408b9;})[_0xf5f2('0x26')](respondWithFilteredResult(_0x43e4ff,_0x4590ec))[_0xf5f2('0x50')](handleError(_0x43e4ff,null));};exports[_0xf5f2('0x51')]=function(_0x3721c4,_0x55a633){var _0x3e89e8={'raw':![],'where':{'id':_0x3721c4[_0xf5f2('0x52')]['id']}},_0x2e7193={};_0x2e7193[_0xf5f2('0x3b')]=_[_0xf5f2('0x53')](db[_0xf5f2('0x4b')][_0xf5f2('0x39')]);_0x2e7193[_0xf5f2('0x3c')]=_['keys'](_0x3721c4[_0xf5f2('0x3c')]);_0x2e7193[_0xf5f2('0x3d')]=_[_0xf5f2('0x3e')](_0x2e7193['model'],_0x2e7193[_0xf5f2('0x3c')]);_0x3e89e8[_0xf5f2('0x3f')]=_[_0xf5f2('0x3e')](_0x2e7193['model'],qs['fields'](_0x3721c4[_0xf5f2('0x3c')][_0xf5f2('0x40')]));_0x3e89e8['attributes']=_0x3e89e8[_0xf5f2('0x3f')]['length']?_0x3e89e8[_0xf5f2('0x3f')]:_0x2e7193['model'];if(_0x3721c4[_0xf5f2('0x3c')]['includeAll']){_0x3e89e8[_0xf5f2('0x4d')]=[{'all':!![]}];}_0x3e89e8=_[_0xf5f2('0x48')]({},_0x3e89e8,_0x3721c4[_0xf5f2('0x4a')]);return db[_0xf5f2('0x4b')]['find'](_0x3e89e8)[_0xf5f2('0x26')](handleEntityNotFound(_0x55a633,null))[_0xf5f2('0x26')](respondWithResult(_0x55a633,null))['catch'](handleError(_0x55a633,null));};exports['destroy']=function(_0xc3d4f,_0x3dc0c4){return db['VoiceExtension'][_0xf5f2('0x31')]({'where':{'id':_0xc3d4f[_0xf5f2('0x52')]['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x3dc0c4,null))[_0xf5f2('0x26')](removeEntity(_0x3dc0c4,null))['catch'](handleError(_0x3dc0c4,null));};exports['create']=function(_0x12550f,_0xa3cc67){if(_0x12550f['body'][_0xf5f2('0x3a')]===_0xf5f2('0x2b')&&!_[_0xf5f2('0x54')](_0x12550f[_0xf5f2('0x55')][_0xf5f2('0x56')],'_')){_0x12550f[_0xf5f2('0x55')][_0xf5f2('0x56')]='_'['concat'](_0x12550f['body'][_0xf5f2('0x56')]);}return db[_0xf5f2('0x4b')][_0xf5f2('0x57')](_0x12550f[_0xf5f2('0x55')],{'raw':![]})[_0xf5f2('0x26')](function(_0x5a861d){var _0xdb1106=_0x12550f[_0xf5f2('0x58')][_0xf5f2('0x27')]({'plain':!![]});if(!_0xdb1106)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdb1106[_0xf5f2('0x59')]==='user'){var _0x78f1d2=_0x5a861d[_0xf5f2('0x27')]({'plain':!![]});var _0x28cce5=[{'name':_0xf5f2('0x28'),'value':'inbound'},{'name':'OutboundRoutes','value':_0xf5f2('0x2b')},{'name':'InternalRoutes','value':_0xf5f2('0x5a')}];var _0x1f1916=_['find'](_0x28cce5,[_0xf5f2('0x30'),_0x78f1d2[_0xf5f2('0x3a')]])[_0xf5f2('0x37')];return db['UserProfileSection'][_0xf5f2('0x31')]({'where':{'name':_0x1f1916,'userProfileId':_0xdb1106[_0xf5f2('0x5b')]},'raw':!![]})[_0xf5f2('0x26')](function(_0x4579f4){if(_0x4579f4&&_0x4579f4['autoAssociation']===0x0){return db[_0xf5f2('0x32')]['create']({'name':_0x78f1d2[_0xf5f2('0x37')],'resourceId':_0x78f1d2['id'],'type':_0x4579f4[_0xf5f2('0x37')],'sectionId':_0x4579f4['id']},{})[_0xf5f2('0x26')](function(){return _0x5a861d;});}else{return _0x5a861d;}})[_0xf5f2('0x50')](function(_0x9f210e){logger['error'](_0xf5f2('0x5c'),_0x9f210e);throw _0x9f210e;});}return _0x5a861d;})[_0xf5f2('0x26')](respondWithResult(_0xa3cc67,0xc9))[_0xf5f2('0x50')](handleError(_0xa3cc67,null));};exports[_0xf5f2('0x25')]=function(_0x2c5733,_0x5359b5){if(_0x2c5733[_0xf5f2('0x55')]['id']){delete _0x2c5733['body']['id'];}return db['VoiceExtension'][_0xf5f2('0x31')]({'where':{'id':_0x2c5733['params']['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x5359b5,null))[_0xf5f2('0x26')](function(_0x420784){if(_0x420784){return db[_0xf5f2('0x4b')]['update'](_[_0xf5f2('0x47')](_0x2c5733[_0xf5f2('0x55')],[_0xf5f2('0x56'),_0xf5f2('0x5d'),_0xf5f2('0x5e'),_0xf5f2('0x5f'),_0xf5f2('0x60'),'mandatoryDisposition']),{'where':{'context':_0x420784[_0xf5f2('0x5d')],'exten':_0x420784[_0xf5f2('0x56')]},'individualHooks':!![]})[_0xf5f2('0x26')](function(_0x45c7c1){return _0x45c7c1;});}return null;})['then'](respondWithStatusCode(_0x5359b5,null))[_0xf5f2('0x50')](handleError(_0x5359b5,null));};exports['addApplications']=function(_0x410866,_0x1c7f06,_0x5588cf){return db[_0xf5f2('0x4b')][_0xf5f2('0x61')]({'where':{'id':_0x410866[_0xf5f2('0x52')]['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x1c7f06,null))[_0xf5f2('0x26')](function(_0x4bd113){if(_0x4bd113){return db[_0xf5f2('0x62')][_0xf5f2('0x63')](function(_0x3a0e75){return db[_0xf5f2('0x4b')][_0xf5f2('0x33')]({'where':{'VoiceExtensionId':_0x410866[_0xf5f2('0x52')]['id']},'transaction':_0x3a0e75})['then'](function(_0x321d4d){var _0x3f475e=_['map'](_0x410866[_0xf5f2('0x55')],function(_0x36503c){_0x36503c[_0xf5f2('0x64')]=_0x410866['params']['id'];return _0x36503c;});return db['VoiceExtension']['bulkCreate'](_0x3f475e,{'transaction':_0x3a0e75});});})[_0xf5f2('0x26')](function(){return db[_0xf5f2('0x4b')][_0xf5f2('0x65')]({'where':{'isApp':!![],'VoiceExtensionId':_0x410866[_0xf5f2('0x52')]['id']},'order':_0xf5f2('0x66')});});}})['then'](respondWithResult(_0x1c7f06,null))[_0xf5f2('0x50')](handleError(_0x1c7f06,null));};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js
index c45d11e..c6fa290 100644
--- a/server/api/voiceExtension/voiceExtension.events.js
+++ b/server/api/voiceExtension/voiceExtension.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d91=['hasOwnProperty','hook','exports','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x1b91f5,_0x4717a4){var _0x3c20e1=function(_0x4b86b0){while(--_0x4b86b0){_0x1b91f5['push'](_0x1b91f5['shift']());}};_0x3c20e1(++_0x4717a4);}(_0x0d91,0x1f2));var _0x10d9=function(_0x14a34a,_0x424129){_0x14a34a=_0x14a34a-0x0;var _0x4d921e=_0x0d91[_0x14a34a];return _0x4d921e;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x10d9('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x10d9('0x1')](0x0);var events={'afterCreate':_0x10d9('0x2'),'afterUpdate':_0x10d9('0x3'),'afterDestroy':_0x10d9('0x4')};function emitEvent(_0x24a66a){return function(_0x54eb95,_0x3dc5bb,_0x5787e5){VoiceExtensionEvents['emit'](_0x24a66a+':'+_0x54eb95['id'],_0x54eb95);VoiceExtensionEvents[_0x10d9('0x5')](_0x24a66a,_0x54eb95);_0x5787e5(null);};}for(var e in events){if(events[_0x10d9('0x6')](e)){var event=events[e];VoiceExtension[_0x10d9('0x7')](e,emitEvent(event));}}module[_0x10d9('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x556a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension'];(function(_0x3da675,_0x4b7c68){var _0x42e9ea=function(_0x2b57d1){while(--_0x2b57d1){_0x3da675['push'](_0x3da675['shift']());}};_0x42e9ea(++_0x4b7c68);}(_0x556a,0x1dd));var _0xa556=function(_0x1ff38f,_0x77afc8){_0x1ff38f=_0x1ff38f-0x0;var _0x5c394a=_0x556a[_0x1ff38f];return _0x5c394a;};'use strict';var EventEmitter=require(_0xa556('0x0'));var VoiceExtension=require(_0xa556('0x1'))['db'][_0xa556('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa556('0x3')](0x0);var events={'afterCreate':_0xa556('0x4'),'afterUpdate':_0xa556('0x5'),'afterDestroy':_0xa556('0x6')};function emitEvent(_0x2a76f6){return function(_0x425bc3,_0x5b0832,_0x1f302d){VoiceExtensionEvents[_0xa556('0x7')](_0x2a76f6+':'+_0x425bc3['id'],_0x425bc3);VoiceExtensionEvents[_0xa556('0x7')](_0x2a76f6,_0x425bc3);_0x1f302d(null);};}for(var e in events){if(events[_0xa556('0x8')](e)){var event=events[e];VoiceExtension[_0xa556('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js
index 2125ffb..612faee 100644
--- a/server/api/voiceExtension/voiceExtension.model.js
+++ b/server/api/voiceExtension/voiceExtension.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4975=['./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x49eba0,_0x56f747){var _0x7bda6c=function(_0x7cb572){while(--_0x7cb572){_0x49eba0['push'](_0x49eba0['shift']());}};_0x7bda6c(++_0x56f747);}(_0x4975,0x86));var _0x5497=function(_0x5a25e1,_0x6a17e8){_0x5a25e1=_0x5a25e1-0x0;var _0x5e76c7=_0x4975[_0x5a25e1];return _0x5e76c7;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0295=['define','lodash','api','request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','exports'];(function(_0x453434,_0x5a8626){var _0x48745b=function(_0x5de887){while(--_0x5de887){_0x453434['push'](_0x453434['shift']());}};_0x48745b(++_0x5a8626);}(_0x0295,0x1f0));var _0x5029=function(_0x4ce46c,_0x3002e5){_0x4ce46c=_0x4ce46c-0x0;var _0x132542=_0x0295[_0x4ce46c];return _0x132542;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js
index d998c60..3957b8c 100644
--- a/server/api/voiceExtension/voiceExtension.rpc.js
+++ b/server/api/voiceExtension/voiceExtension.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x37e7=['raw','where','limit','include','map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options'];(function(_0x1661d7,_0x1316fe){var _0x1cd427=function(_0xc4aed){while(--_0xc4aed){_0x1661d7['push'](_0x1661d7['shift']());}};_0x1cd427(++_0x1316fe);}(_0x37e7,0x73));var _0x737e=function(_0x425022,_0x428c9b){_0x425022=_0x425022-0x0;var _0x4bb839=_0x37e7[_0x425022];return _0x4bb839;};'use strict';var _=require('lodash');var util=require(_0x737e('0x0'));var moment=require(_0x737e('0x1'));var BPromise=require(_0x737e('0x2'));var rs=require(_0x737e('0x3'));var fs=require('fs');var Redis=require(_0x737e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x737e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x737e('0x6'));var jayson=require(_0x737e('0x7'));var client=jayson['client'][_0x737e('0x8')]({'port':0x232a});config['redis']=_[_0x737e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x737e('0xa'))(new Redis(config[_0x737e('0xb')]));require(_0x737e('0xc'))['register'](socket);function respondWithRpcPromise(_0x41ae48,_0x351c87,_0x40e852){return new BPromise(function(_0x39323b,_0x190a56){return client['request'](_0x41ae48,_0x40e852)[_0x737e('0xd')](function(_0x36aea5){logger[_0x737e('0xe')](_0x737e('0xf'),_0x351c87,_0x737e('0x10'));logger[_0x737e('0x11')](_0x737e('0x12'),_0x351c87,'request\x20sent',JSON[_0x737e('0x13')](_0x36aea5));if(_0x36aea5[_0x737e('0x14')]){if(_0x36aea5[_0x737e('0x14')][_0x737e('0x15')]===0x1f4){logger[_0x737e('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x351c87,_0x36aea5['error']['message']);return _0x190a56(_0x36aea5[_0x737e('0x14')]['message']);}logger[_0x737e('0x14')](_0x737e('0xf'),_0x351c87,_0x36aea5['error'][_0x737e('0x16')]);return _0x39323b(_0x36aea5[_0x737e('0x14')][_0x737e('0x16')]);}else{logger[_0x737e('0xe')]('VoiceExtension,\x20%s,\x20%s',_0x351c87,_0x737e('0x10'));_0x39323b(_0x36aea5[_0x737e('0x17')][_0x737e('0x16')]);}})[_0x737e('0x18')](function(_0x1f36bb){logger[_0x737e('0x14')](_0x737e('0xf'),_0x351c87,_0x1f36bb);_0x190a56(_0x1f36bb);});});}exports[_0x737e('0x19')]=function(_0x2f9283){var _0x79ec94=this;return new Promise(function(_0x41399f,_0xe90855){return db[_0x737e('0x1a')][_0x737e('0x1b')]({'raw':_0x2f9283['options']?_0x2f9283[_0x737e('0x1c')][_0x737e('0x1d')]===undefined?!![]:![]:!![],'where':_0x2f9283[_0x737e('0x1c')]?_0x2f9283['options'][_0x737e('0x1e')]||null:null,'attributes':_0x2f9283['options']?_0x2f9283[_0x737e('0x1c')]['attributes']||null:null,'limit':_0x2f9283[_0x737e('0x1c')]?_0x2f9283[_0x737e('0x1c')][_0x737e('0x1f')]||null:null,'include':_0x2f9283[_0x737e('0x1c')]?_0x2f9283[_0x737e('0x1c')][_0x737e('0x20')]?_[_0x737e('0x21')](_0x2f9283[_0x737e('0x1c')][_0x737e('0x20')],function(_0x4d44e3){return{'model':db[_0x4d44e3[_0x737e('0x22')]],'as':_0x4d44e3['as'],'attributes':_0x4d44e3[_0x737e('0x23')],'include':_0x4d44e3[_0x737e('0x20')]?_['map'](_0x4d44e3['include'],function(_0x41ef9a){return{'model':db[_0x41ef9a[_0x737e('0x22')]],'as':_0x41ef9a['as'],'attributes':_0x41ef9a[_0x737e('0x23')],'include':_0x41ef9a[_0x737e('0x20')]?_[_0x737e('0x21')](_0x41ef9a[_0x737e('0x20')],function(_0x5889b6){return{'model':db[_0x5889b6[_0x737e('0x22')]],'as':_0x5889b6['as'],'attributes':_0x5889b6[_0x737e('0x23')]};}):[]};}):[]};}):[]:[]})[_0x737e('0xd')](function(_0x135c1c){logger[_0x737e('0xe')](_0x737e('0x19'),_0x2f9283);logger[_0x737e('0x11')](_0x737e('0x19'),_0x2f9283,JSON[_0x737e('0x13')](_0x135c1c));_0x41399f(_0x135c1c);})[_0x737e('0x18')](function(_0x16e9fc){logger[_0x737e('0x14')](_0x737e('0x19'),_0x16e9fc[_0x737e('0x16')],_0x2f9283);_0xe90855(_0x79ec94[_0x737e('0x14')](0x1f4,_0x16e9fc['message']));});});};
\ No newline at end of file
+var _0x1299=['info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','map','model','include','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1fc034,_0x56fd41){var _0xfbc45e=function(_0x103036){while(--_0x103036){_0x1fc034['push'](_0x1fc034['shift']());}};_0xfbc45e(++_0x56fd41);}(_0x1299,0x1d4));var _0x9129=function(_0x383e5a,_0xbda9dd){_0x383e5a=_0x383e5a-0x0;var _0x39ea79=_0x1299[_0x383e5a];return _0x39ea79;};'use strict';var _=require(_0x9129('0x0'));var util=require(_0x9129('0x1'));var moment=require(_0x9129('0x2'));var BPromise=require(_0x9129('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9129('0x4'));var db=require(_0x9129('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9129('0x6'))(_0x9129('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9129('0x8')][_0x9129('0x9')]({'port':0x232a});config[_0x9129('0xa')]=_[_0x9129('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9129('0xa')]));require(_0x9129('0xc'))[_0x9129('0xd')](socket);function respondWithRpcPromise(_0x586c11,_0x38c1f9,_0x1ecfc2){return new BPromise(function(_0x7a1f1a,_0x276860){return client[_0x9129('0xe')](_0x586c11,_0x1ecfc2)[_0x9129('0xf')](function(_0x2ba8a7){logger['info'](_0x9129('0x10'),_0x38c1f9,_0x9129('0x11'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x38c1f9,_0x9129('0x11'),JSON[_0x9129('0x12')](_0x2ba8a7));if(_0x2ba8a7[_0x9129('0x13')]){if(_0x2ba8a7[_0x9129('0x13')][_0x9129('0x14')]===0x1f4){logger['error'](_0x9129('0x10'),_0x38c1f9,_0x2ba8a7[_0x9129('0x13')][_0x9129('0x15')]);return _0x276860(_0x2ba8a7[_0x9129('0x13')][_0x9129('0x15')]);}logger[_0x9129('0x13')](_0x9129('0x10'),_0x38c1f9,_0x2ba8a7[_0x9129('0x13')][_0x9129('0x15')]);return _0x7a1f1a(_0x2ba8a7[_0x9129('0x13')][_0x9129('0x15')]);}else{logger[_0x9129('0x16')](_0x9129('0x10'),_0x38c1f9,_0x9129('0x11'));_0x7a1f1a(_0x2ba8a7[_0x9129('0x17')][_0x9129('0x15')]);}})[_0x9129('0x18')](function(_0x11b12e){logger[_0x9129('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x38c1f9,_0x11b12e);_0x276860(_0x11b12e);});});}exports[_0x9129('0x19')]=function(_0x1abe6d){var _0x315f35=this;return new Promise(function(_0x508f8e,_0x347a20){return db[_0x9129('0x1a')][_0x9129('0x1b')]({'raw':_0x1abe6d[_0x9129('0x1c')]?_0x1abe6d[_0x9129('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1abe6d['options']?_0x1abe6d[_0x9129('0x1c')][_0x9129('0x1d')]||null:null,'attributes':_0x1abe6d[_0x9129('0x1c')]?_0x1abe6d[_0x9129('0x1c')][_0x9129('0x1e')]||null:null,'limit':_0x1abe6d['options']?_0x1abe6d['options'][_0x9129('0x1f')]||null:null,'include':_0x1abe6d[_0x9129('0x1c')]?_0x1abe6d['options']['include']?_[_0x9129('0x20')](_0x1abe6d[_0x9129('0x1c')]['include'],function(_0x1b87ac){return{'model':db[_0x1b87ac[_0x9129('0x21')]],'as':_0x1b87ac['as'],'attributes':_0x1b87ac[_0x9129('0x1e')],'include':_0x1b87ac['include']?_['map'](_0x1b87ac[_0x9129('0x22')],function(_0x24a28a){return{'model':db[_0x24a28a[_0x9129('0x21')]],'as':_0x24a28a['as'],'attributes':_0x24a28a['attributes'],'include':_0x24a28a[_0x9129('0x22')]?_[_0x9129('0x20')](_0x24a28a['include'],function(_0x270a6b){return{'model':db[_0x270a6b[_0x9129('0x21')]],'as':_0x270a6b['as'],'attributes':_0x270a6b[_0x9129('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11cbe3){logger[_0x9129('0x16')](_0x9129('0x19'),_0x1abe6d);logger['debug'](_0x9129('0x19'),_0x1abe6d,JSON['stringify'](_0x11cbe3));_0x508f8e(_0x11cbe3);})[_0x9129('0x18')](function(_0x40bc7a){logger[_0x9129('0x13')]('GetVoiceExtension',_0x40bc7a[_0x9129('0x15')],_0x1abe6d);_0x347a20(_0x315f35[_0x9129('0x13')](0x1f4,_0x40bc7a['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js
index fdef4f0..79cd877 100644
--- a/server/api/voiceExtension/voiceExtension.socket.js
+++ b/server/api/voiceExtension/voiceExtension.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a85=['voiceExtension:','./voiceExtension.events','save','remove','update','register','length'];(function(_0x4dd695,_0x3ef4c9){var _0x3ac72b=function(_0x48864b){while(--_0x48864b){_0x4dd695['push'](_0x4dd695['shift']());}};_0x3ac72b(++_0x3ef4c9);}(_0x5a85,0xbe));var _0x55a8=function(_0x24e447,_0x9b1441){_0x24e447=_0x24e447-0x0;var _0x46f26f=_0x5a85[_0x24e447];return _0x46f26f;};'use strict';var VoiceExtensionEvents=require(_0x55a8('0x0'));var events=[_0x55a8('0x1'),_0x55a8('0x2'),_0x55a8('0x3')];function createListener(_0xe4472f,_0x4743d4){return function(_0x6a5ae0){_0x4743d4['emit'](_0xe4472f,_0x6a5ae0);};}function removeListener(_0x31512a,_0x2d9512){return function(){VoiceExtensionEvents['removeListener'](_0x31512a,_0x2d9512);};}exports[_0x55a8('0x4')]=function(_0x2c0690){for(var _0x2584fb=0x0,_0x39fdc5=events[_0x55a8('0x5')];_0x2584fb<_0x39fdc5;_0x2584fb++){var _0xc944d=events[_0x2584fb];var _0xdfde1d=createListener(_0x55a8('0x6')+_0xc944d,_0x2c0690);VoiceExtensionEvents['on'](_0xc944d,_0xdfde1d);}};
\ No newline at end of file
+var _0x1ed6=['./voiceExtension.events','save','update','emit','register','length','voiceExtension:'];(function(_0x38f614,_0x99e156){var _0x313129=function(_0x24ce89){while(--_0x24ce89){_0x38f614['push'](_0x38f614['shift']());}};_0x313129(++_0x99e156);}(_0x1ed6,0x70));var _0x61ed=function(_0x5b599b,_0x5277a2){_0x5b599b=_0x5b599b-0x0;var _0x3dda76=_0x1ed6[_0x5b599b];return _0x3dda76;};'use strict';var VoiceExtensionEvents=require(_0x61ed('0x0'));var events=[_0x61ed('0x1'),'remove',_0x61ed('0x2')];function createListener(_0x358f1f,_0xc5e8c8){return function(_0x110ecc){_0xc5e8c8[_0x61ed('0x3')](_0x358f1f,_0x110ecc);};}function removeListener(_0x11d32b,_0x215524){return function(){VoiceExtensionEvents['removeListener'](_0x11d32b,_0x215524);};}exports[_0x61ed('0x4')]=function(_0x25d83a){for(var _0xe292aa=0x0,_0x24e1e0=events[_0x61ed('0x5')];_0xe292aa<_0x24e1e0;_0xe292aa++){var _0x44a27c=events[_0xe292aa];var _0xf9055d=createListener(_0x61ed('0x6')+_0x44a27c,_0x25d83a);VoiceExtensionEvents['on'](_0x44a27c,_0xf9055d);}};
\ No newline at end of file
diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js
index d729a59..5da238a 100644
--- a/server/api/voiceMail/index.js
+++ b/server/api/voiceMail/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xab7d=['/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','show','/:id/messages','post','put','update','delete'];(function(_0x488cc5,_0x48b79a){var _0x3a0371=function(_0xe8b2d0){while(--_0xe8b2d0){_0x488cc5['push'](_0x488cc5['shift']());}};_0x3a0371(++_0x48b79a);}(_0xab7d,0xea));var _0xdab7=function(_0x5de75e,_0x150b5a){_0x5de75e=_0x5de75e-0x0;var _0x2448b5=_0xab7d[_0x5de75e];return _0x2448b5;};'use strict';var multer=require(_0xdab7('0x0'));var util=require(_0xdab7('0x1'));var path=require('path');var timeout=require(_0xdab7('0x2'));var express=require(_0xdab7('0x3'));var router=express[_0xdab7('0x4')]();var auth=require(_0xdab7('0x5'));var interaction=require(_0xdab7('0x6'));var config=require(_0xdab7('0x7'));var controller=require(_0xdab7('0x8'));router[_0xdab7('0x9')]('/',auth[_0xdab7('0xa')](),controller[_0xdab7('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdab7('0xc')]);router['get'](_0xdab7('0xd'),auth[_0xdab7('0xa')](),controller['getMessages']);router[_0xdab7('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdab7('0xf')]('/:id',auth[_0xdab7('0xa')](),controller[_0xdab7('0x10')]);router[_0xdab7('0x11')](_0xdab7('0x12'),auth[_0xdab7('0xa')](),controller[_0xdab7('0x13')]);module[_0xdab7('0x14')]=router;
\ No newline at end of file
+var _0x21f1=['post','create','put','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages'];(function(_0x3ddd72,_0x4d98a4){var _0xe916b8=function(_0x6b8839){while(--_0x6b8839){_0x3ddd72['push'](_0x3ddd72['shift']());}};_0xe916b8(++_0x4d98a4);}(_0x21f1,0x137));var _0x121f=function(_0x174105,_0x744398){_0x174105=_0x174105-0x0;var _0x3489a7=_0x21f1[_0x174105];return _0x3489a7;};'use strict';var multer=require(_0x121f('0x0'));var util=require(_0x121f('0x1'));var path=require('path');var timeout=require(_0x121f('0x2'));var express=require('express');var router=express[_0x121f('0x3')]();var auth=require(_0x121f('0x4'));var interaction=require(_0x121f('0x5'));var config=require(_0x121f('0x6'));var controller=require(_0x121f('0x7'));router[_0x121f('0x8')]('/',auth[_0x121f('0x9')](),controller[_0x121f('0xa')]);router[_0x121f('0x8')](_0x121f('0xb'),auth[_0x121f('0x9')](),controller['show']);router[_0x121f('0x8')](_0x121f('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0x121f('0xd')]('/',auth[_0x121f('0x9')](),controller[_0x121f('0xe')]);router[_0x121f('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x121f('0xb'),auth[_0x121f('0x9')](),controller[_0x121f('0x10')]);module[_0x121f('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js
index eba9d26..1c45d70 100644
--- a/server/api/voiceMail/voiceMail.attributes.js
+++ b/server/api/voiceMail/voiceMail.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6cb4=['fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','yes','ENUM','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0x198a68,_0x3cca6b){var _0x20278a=function(_0x2e91ec){while(--_0x2e91ec){_0x198a68['push'](_0x198a68['shift']());}};_0x20278a(++_0x3cca6b);}(_0x6cb4,0xff));var _0x46cb=function(_0x1dace3,_0xd80764){_0x1dace3=_0x1dace3-0x0;var _0x381c29=_0x6cb4[_0x1dace3];return _0x381c29;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'customer_id':{'type':Sequelize[_0x46cb('0x2')]},'context':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':_0x46cb('0x3'),'unique':_0x46cb('0x4')},'mailbox':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':'','allowNull':![],'unique':_0x46cb('0x4')},'password':{'type':Sequelize[_0x46cb('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x46cb('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5cb9a4){this[_0x46cb('0x5')]('email',typeof _0x5cb9a4===_0x46cb('0x6')&&_0x5cb9a4[_0x46cb('0x7')]()?_0x5cb9a4[_0x46cb('0x7')]():null);}},'pager':{'type':Sequelize[_0x46cb('0x2')]},'tz':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':_0x46cb('0x8')},'attach':{'type':Sequelize['ENUM'](_0x46cb('0x9'),'no'),'defaultValue':_0x46cb('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x46cb('0x9'),'no'),'defaultValue':_0x46cb('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x46cb('0x2')]},'review':{'type':Sequelize[_0x46cb('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x46cb('0xa')](_0x46cb('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x46cb('0xa')](_0x46cb('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x46cb('0xa')](_0x46cb('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x46cb('0xa')](_0x46cb('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x46cb('0xa')](_0x46cb('0x9'),'no'),'defaultValue':_0x46cb('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x46cb('0xa')](_0x46cb('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x46cb('0xa')](_0x46cb('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x46cb('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x46cb('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x46cb('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x46cb('0xd')],'get':function(){return this[_0x46cb('0xe')](_0x46cb('0xf'))+_0x46cb('0x10')+this[_0x46cb('0xe')](_0x46cb('0x11'));}}};
\ No newline at end of file
+var _0x4483=['email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0x31e9eb,_0x588a45){var _0x2215ee=function(_0x51c4b2){while(--_0x51c4b2){_0x31e9eb['push'](_0x31e9eb['shift']());}};_0x2215ee(++_0x588a45);}(_0x4483,0x1a3));var _0x3448=function(_0x4eb66f,_0x3dd35a){_0x4eb66f=_0x4eb66f-0x0;var _0x39a95d=_0x4483[_0x4eb66f];return _0x39a95d;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'customer_id':{'type':Sequelize[_0x3448('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x3448('0x3'),'unique':_0x3448('0x4')},'mailbox':{'type':Sequelize[_0x3448('0x2')],'defaultValue':'','allowNull':![],'unique':_0x3448('0x4')},'password':{'type':Sequelize[_0x3448('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3448('0x2')],'validate':{'isEmail':!![]},'set':function(_0x6a89b){this[_0x3448('0x5')](_0x3448('0x6'),typeof _0x6a89b===_0x3448('0x7')&&_0x6a89b[_0x3448('0x8')]()?_0x6a89b[_0x3448('0x8')]():null);}},'pager':{'type':Sequelize[_0x3448('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0x3448('0x9')](_0x3448('0xa'),'no'),'defaultValue':_0x3448('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3448('0x9')](_0x3448('0xa'),'no'),'defaultValue':_0x3448('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3448('0x2')]},'callback':{'type':Sequelize[_0x3448('0x2')]},'review':{'type':Sequelize[_0x3448('0x9')](_0x3448('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3448('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3448('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3448('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3448('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3448('0x9')](_0x3448('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x3448('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3448('0x9')]('yes','no'),'defaultValue':_0x3448('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3448('0x9')](_0x3448('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x3448('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3448('0x9')](_0x3448('0xa'),'no'),'defaultValue':_0x3448('0xa'),'allowNull':![]},'stamp':{'type':_0x3448('0xc')},'emailsubject':{'type':Sequelize[_0x3448('0x2')]},'emailbody':{'type':Sequelize[_0x3448('0x2')]},'maxsecs':{'type':Sequelize[_0x3448('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3448('0xe')],'get':function(){return this['getDataValue']('fullname')+'\x20-\x20'+this[_0x3448('0xf')](_0x3448('0x10'));}}};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js
index 5c061fe..6a132ca 100644
--- a/server/api/voiceMail/voiceMail.controller.js
+++ b/server/api/voiceMail/voiceMail.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x42af=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','get','Voicemails','UserProfileResource','destroy','error','stack','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','name','options','count','includeAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','order','mailbox','VoiceMailMessage','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x58273d,_0x2fefaf){var _0x8708b=function(_0x44088e){while(--_0x44088e){_0x58273d['push'](_0x58273d['shift']());}};_0x8708b(++_0x2fefaf);}(_0x42af,0x103));var _0xf42a=function(_0x21b367,_0x4b3024){_0x21b367=_0x21b367-0x0;var _0x45f247=_0x42af[_0x21b367];return _0x45f247;};'use strict';var pdf=require(_0xf42a('0x0'));var emlformat=require(_0xf42a('0x1'));var rimraf=require(_0xf42a('0x2'));var zipdir=require(_0xf42a('0x3'));var jsonpatch=require(_0xf42a('0x4'));var rp=require(_0xf42a('0x5'));var moment=require('moment');var BPromise=require(_0xf42a('0x6'));var Mustache=require(_0xf42a('0x7'));var util=require(_0xf42a('0x8'));var path=require(_0xf42a('0x9'));var sox=require(_0xf42a('0xa'));var csv=require(_0xf42a('0xb'));var ejs=require(_0xf42a('0xc'));var fs=require('fs');var _=require(_0xf42a('0xd'));var squel=require(_0xf42a('0xe'));var crypto=require(_0xf42a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf42a('0x10'));var toCsv=require(_0xf42a('0xb'));var querystring=require(_0xf42a('0x11'));var Papa=require('papaparse');var Redis=require(_0xf42a('0x12'));var authService=require(_0xf42a('0x13'));var qs=require(_0xf42a('0x14'));var as=require(_0xf42a('0x15'));var hardwareService=require(_0xf42a('0x16'));var logger=require(_0xf42a('0x17'))(_0xf42a('0x18'));var utils=require(_0xf42a('0x19'));var config=require(_0xf42a('0x1a'));var db=require(_0xf42a('0x1b'))['db'];function respondWithStatusCode(_0x653903,_0x130d44){_0x130d44=_0x130d44||0xcc;return function(_0x603c14){if(_0x603c14){return _0x653903[_0xf42a('0x1c')](_0x130d44);}return _0x653903[_0xf42a('0x1d')](_0x130d44)[_0xf42a('0x1e')]();};}function respondWithResult(_0x221ad2,_0x10a305){_0x10a305=_0x10a305||0xc8;return function(_0x55ec8d){if(_0x55ec8d){return _0x221ad2[_0xf42a('0x1d')](_0x10a305)[_0xf42a('0x1f')](_0x55ec8d);}};}function respondWithFilteredResult(_0xd0df5c,_0x22501f){return function(_0x44c750){if(_0x44c750){var _0x52f2d1=_0x44c750['count'],_0x67bb20=_0x22501f[_0xf42a('0x20')],_0x2a4aa9=_0x22501f[_0xf42a('0x20')]+_0x22501f[_0xf42a('0x21')],_0x19011f;if(_0x2a4aa9>=_0x52f2d1){_0x2a4aa9=_0x52f2d1;_0x19011f=0xc8;}else{_0x19011f=0xce;}_0xd0df5c[_0xf42a('0x1d')](_0x19011f);return _0xd0df5c['set']('Content-Range',_0x67bb20+'-'+_0x2a4aa9+'/'+_0x52f2d1)[_0xf42a('0x1f')](_0x44c750);}return null;};}function patchUpdates(_0x2f5c94){return function(_0x24a072){try{jsonpatch[_0xf42a('0x22')](_0x24a072,_0x2f5c94,!![]);}catch(_0x43a56f){return BPromise[_0xf42a('0x23')](_0x43a56f);}return _0x24a072[_0xf42a('0x24')]();};}function saveUpdates(_0x580f2e,_0x33dccd){return function(_0xccb521){if(_0xccb521){return _0xccb521[_0xf42a('0x25')](_0x580f2e)['then'](function(_0x446d17){return _0x446d17;});}return null;};}function removeEntity(_0x5878aa,_0x27d045){return function(_0x24d560){if(_0x24d560){return _0x24d560['destroy']()[_0xf42a('0x26')](function(){var _0x1b2c96=_0x24d560[_0xf42a('0x27')]({'plain':!![]});var _0x7d249e=_0xf42a('0x28');return db[_0xf42a('0x29')][_0xf42a('0x2a')]({'where':{'type':_0x7d249e,'resourceId':_0x1b2c96['id']}})[_0xf42a('0x26')](function(){return _0x24d560;});})[_0xf42a('0x26')](function(){_0x5878aa[_0xf42a('0x1d')](0xcc)[_0xf42a('0x1e')]();});}};}function handleEntityNotFound(_0x550d42,_0x5633be){return function(_0x1d8206){if(!_0x1d8206){_0x550d42[_0xf42a('0x1c')](0x194);}return _0x1d8206;};}function handleError(_0x21cb80,_0x5acb7f){_0x5acb7f=_0x5acb7f||0x1f4;return function(_0x16debf){logger[_0xf42a('0x2b')](_0x16debf[_0xf42a('0x2c')]);if(_0x16debf['name']){delete _0x16debf['name'];}_0x21cb80[_0xf42a('0x1d')](_0x5acb7f)[_0xf42a('0x2d')](_0x16debf);};}exports[_0xf42a('0x2e')]=function(_0x593e34,_0x53593c){var _0x566560={},_0x2567f={},_0x4f1a44={'count':0x0,'rows':[]};var _0x5cef7b=_[_0xf42a('0x2f')](db[_0xf42a('0x30')][_0xf42a('0x31')],function(_0x20b526){return{'name':_0x20b526[_0xf42a('0x32')],'type':_0x20b526[_0xf42a('0x33')][_0xf42a('0x34')]};});_0x2567f[_0xf42a('0x35')]=_[_0xf42a('0x2f')](_0x5cef7b,'name');_0x2567f[_0xf42a('0x36')]=_[_0xf42a('0x37')](_0x593e34[_0xf42a('0x36')]);_0x2567f[_0xf42a('0x38')]=_[_0xf42a('0x39')](_0x2567f[_0xf42a('0x35')],_0x2567f['query']);_0x566560[_0xf42a('0x3a')]=_['intersection'](_0x2567f[_0xf42a('0x35')],qs[_0xf42a('0x3b')](_0x593e34[_0xf42a('0x36')]['fields']));_0x566560['attributes']=_0x566560[_0xf42a('0x3a')][_0xf42a('0x3c')]?_0x566560['attributes']:_0x2567f[_0xf42a('0x35')];if(!_0x593e34['query'][_0xf42a('0x3d')](_0xf42a('0x3e'))){_0x566560[_0xf42a('0x21')]=qs[_0xf42a('0x21')](_0x593e34[_0xf42a('0x36')][_0xf42a('0x21')]);_0x566560[_0xf42a('0x20')]=qs[_0xf42a('0x20')](_0x593e34[_0xf42a('0x36')][_0xf42a('0x20')]);}_0x566560['order']=qs['sort'](_0x593e34[_0xf42a('0x36')][_0xf42a('0x3f')]);_0x566560['where']=qs[_0xf42a('0x38')](_[_0xf42a('0x40')](_0x593e34['query'],_0x2567f[_0xf42a('0x38')]),_0x5cef7b);if(_0x593e34[_0xf42a('0x36')][_0xf42a('0x41')]){_0x566560[_0xf42a('0x42')]=_[_0xf42a('0x43')](_0x566560['where'],{'$or':_[_0xf42a('0x2f')](_0x5cef7b,function(_0x8693be){if(_0x8693be[_0xf42a('0x33')]!=='VIRTUAL'){var _0x6a9171={};_0x6a9171[_0x8693be[_0xf42a('0x44')]]={'$like':'%'+_0x593e34[_0xf42a('0x36')][_0xf42a('0x41')]+'%'};return _0x6a9171;}})});}_0x566560=_[_0xf42a('0x43')]({},_0x566560,_0x593e34[_0xf42a('0x45')]);var _0x98c8e8={'where':_0x566560[_0xf42a('0x42')]};return db['VoiceMail'][_0xf42a('0x46')](_0x98c8e8)[_0xf42a('0x26')](function(_0x12c687){_0x4f1a44[_0xf42a('0x46')]=_0x12c687;if(_0x593e34['query'][_0xf42a('0x47')]){_0x566560['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x566560);})[_0xf42a('0x26')](function(_0x4331ea){_0x4f1a44['rows']=_0x4331ea;return _0x4f1a44;})[_0xf42a('0x26')](respondWithFilteredResult(_0x53593c,_0x566560))[_0xf42a('0x48')](handleError(_0x53593c,null));};exports[_0xf42a('0x49')]=function(_0x2b5343,_0x33a8ef){var _0x36a78d={'raw':!![],'where':{'id':_0x2b5343[_0xf42a('0x4a')]['id']}},_0x2bd8b9={};_0x2bd8b9[_0xf42a('0x35')]=_[_0xf42a('0x37')](db[_0xf42a('0x30')][_0xf42a('0x31')]);_0x2bd8b9['query']=_[_0xf42a('0x37')](_0x2b5343['query']);_0x2bd8b9[_0xf42a('0x38')]=_['intersection'](_0x2bd8b9[_0xf42a('0x35')],_0x2bd8b9[_0xf42a('0x36')]);_0x36a78d[_0xf42a('0x3a')]=_[_0xf42a('0x39')](_0x2bd8b9[_0xf42a('0x35')],qs[_0xf42a('0x3b')](_0x2b5343[_0xf42a('0x36')][_0xf42a('0x3b')]));_0x36a78d[_0xf42a('0x3a')]=_0x36a78d['attributes'][_0xf42a('0x3c')]?_0x36a78d[_0xf42a('0x3a')]:_0x2bd8b9[_0xf42a('0x35')];if(_0x2b5343[_0xf42a('0x36')]['includeAll']){_0x36a78d[_0xf42a('0x4b')]=[{'all':!![]}];}_0x36a78d=_[_0xf42a('0x43')]({},_0x36a78d,_0x2b5343[_0xf42a('0x45')]);return db[_0xf42a('0x30')][_0xf42a('0x4c')](_0x36a78d)[_0xf42a('0x26')](handleEntityNotFound(_0x33a8ef,null))['then'](respondWithResult(_0x33a8ef,null))[_0xf42a('0x48')](handleError(_0x33a8ef,null));};exports[_0xf42a('0x4d')]=function(_0x98dd8f,_0x5ccbb0){return db[_0xf42a('0x30')][_0xf42a('0x4d')](_0x98dd8f[_0xf42a('0x4e')],{})['then'](function(_0x3aef08){var _0x577f67=_0x98dd8f[_0xf42a('0x4f')][_0xf42a('0x27')]({'plain':!![]});if(!_0x577f67)throw new Error(_0xf42a('0x50'));if(_0x577f67[_0xf42a('0x51')]==='user'){var _0x4d0bbe=_0x3aef08[_0xf42a('0x27')]({'plain':!![]});var _0x51e2e2=_0xf42a('0x28');return db[_0xf42a('0x52')][_0xf42a('0x4c')]({'where':{'name':_0x51e2e2,'userProfileId':_0x577f67['userProfileId']},'raw':!![]})['then'](function(_0x20d02f){if(_0x20d02f&&_0x20d02f['autoAssociation']===0x0){return db[_0xf42a('0x29')][_0xf42a('0x4d')]({'name':_0x4d0bbe[_0xf42a('0x44')],'resourceId':_0x4d0bbe['id'],'type':_0x20d02f[_0xf42a('0x44')],'sectionId':_0x20d02f['id']},{})[_0xf42a('0x26')](function(){return _0x3aef08;});}else{return _0x3aef08;}})[_0xf42a('0x48')](function(_0x547aed){logger[_0xf42a('0x2b')](_0xf42a('0x53'),_0x547aed);throw _0x547aed;});}return _0x3aef08;})[_0xf42a('0x26')](respondWithResult(_0x5ccbb0,0xc9))['catch'](handleError(_0x5ccbb0,null));};exports[_0xf42a('0x25')]=function(_0x53eae0,_0x450822){if(_0x53eae0[_0xf42a('0x4e')]['id']){delete _0x53eae0[_0xf42a('0x4e')]['id'];}return db[_0xf42a('0x30')][_0xf42a('0x4c')]({'where':{'id':_0x53eae0['params']['id']}})['then'](handleEntityNotFound(_0x450822,null))['then'](saveUpdates(_0x53eae0[_0xf42a('0x4e')],null))[_0xf42a('0x26')](respondWithResult(_0x450822,null))[_0xf42a('0x48')](handleError(_0x450822,null));};exports[_0xf42a('0x2a')]=function(_0xdf6be0,_0x133cd8){return db['VoiceMail'][_0xf42a('0x4c')]({'where':{'id':_0xdf6be0[_0xf42a('0x4a')]['id']}})[_0xf42a('0x26')](handleEntityNotFound(_0x133cd8,null))[_0xf42a('0x26')](removeEntity(_0x133cd8,null))[_0xf42a('0x48')](handleError(_0x133cd8,null));};exports[_0xf42a('0x54')]=function(_0x2dbc10,_0x2991a3,_0x4d8f81){return db[_0xf42a('0x30')][_0xf42a('0x55')]({'where':{'id':_0x2dbc10[_0xf42a('0x4a')]['id']}})[_0xf42a('0x26')](handleEntityNotFound(_0x2991a3,null))[_0xf42a('0x26')](function(_0x27aa00){var _0x334371;var _0x277cca={},_0x5144b7={};_0x5144b7[_0xf42a('0x35')]=_['keys'](db['VoiceMailMessage'][_0xf42a('0x31')]);_0x5144b7[_0xf42a('0x36')]=_[_0xf42a('0x37')](_0x2dbc10['query']);_0x5144b7[_0xf42a('0x38')]=_['intersection'](_0x5144b7[_0xf42a('0x35')],_0x5144b7['query']);_0x277cca[_0xf42a('0x3a')]=_[_0xf42a('0x39')](_0x5144b7[_0xf42a('0x35')],qs[_0xf42a('0x3b')](_0x2dbc10[_0xf42a('0x36')][_0xf42a('0x3b')]));_0x277cca[_0xf42a('0x3a')]=_0x277cca['attributes'][_0xf42a('0x3c')]?_0x277cca[_0xf42a('0x3a')]:_0x5144b7[_0xf42a('0x35')];if(!_0x2dbc10[_0xf42a('0x36')][_0xf42a('0x3d')](_0xf42a('0x3e'))){_0x277cca[_0xf42a('0x21')]=qs[_0xf42a('0x21')](_0x2dbc10[_0xf42a('0x36')][_0xf42a('0x21')]);_0x277cca[_0xf42a('0x20')]=qs[_0xf42a('0x20')](_0x2dbc10[_0xf42a('0x36')][_0xf42a('0x20')]);}_0x277cca[_0xf42a('0x56')]=qs['sort'](_0x2dbc10[_0xf42a('0x36')]['sort']);_0x277cca[_0xf42a('0x42')]=qs[_0xf42a('0x38')](_[_0xf42a('0x40')](_0x2dbc10['query'],_0x5144b7['filters']));if(_0x2dbc10[_0xf42a('0x36')][_0xf42a('0x41')]){_0x277cca[_0xf42a('0x42')]=_[_0xf42a('0x43')](_0x277cca[_0xf42a('0x42')],{'$or':_[_0xf42a('0x2f')](_0x277cca['attributes'],function(_0x1092e2){var _0x34e5dc={};_0x34e5dc[_0x1092e2]={'$like':'%'+_0x2dbc10[_0xf42a('0x36')][_0xf42a('0x41')]+'%'};return _0x34e5dc;})});}_0x277cca[_0xf42a('0x42')]=_[_0xf42a('0x43')](_0x277cca['where'],{'mailboxuser':_0x27aa00[_0xf42a('0x57')]});_0x277cca=_['merge']({},_0x277cca,_0x2dbc10[_0xf42a('0x45')]);return db[_0xf42a('0x58')][_0xf42a('0x59')](_0x277cca)['then'](respondWithFilteredResult(_0x2991a3,_0x277cca));})[_0xf42a('0x48')](handleError(_0x2991a3,null));};
\ No newline at end of file
+var _0x96ee=['status','count','offset','limit','set','json','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','VoiceMail','rawAttributes','key','model','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','mailbox','findAndCountAll','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x33a24d,_0x17448d){var _0x41b276=function(_0x5ebae5){while(--_0x5ebae5){_0x33a24d['push'](_0x33a24d['shift']());}};_0x41b276(++_0x17448d);}(_0x96ee,0x90));var _0xe96e=function(_0x1c101f,_0x52141d){_0x1c101f=_0x1c101f-0x0;var _0xe02ee4=_0x96ee[_0x1c101f];return _0xe02ee4;};'use strict';var pdf=require(_0xe96e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe96e('0x1'));var zipdir=require(_0xe96e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe96e('0x3'));var moment=require(_0xe96e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe96e('0x5'));var util=require(_0xe96e('0x6'));var path=require(_0xe96e('0x7'));var sox=require(_0xe96e('0x8'));var csv=require(_0xe96e('0x9'));var ejs=require(_0xe96e('0xa'));var fs=require('fs');var _=require(_0xe96e('0xb'));var squel=require(_0xe96e('0xc'));var crypto=require(_0xe96e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe96e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe96e('0xf'));var Redis=require(_0xe96e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe96e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe96e('0x12'));var logger=require(_0xe96e('0x13'))('api');var utils=require(_0xe96e('0x14'));var config=require(_0xe96e('0x15'));var db=require(_0xe96e('0x16'))['db'];function respondWithStatusCode(_0x264c20,_0x30765a){_0x30765a=_0x30765a||0xcc;return function(_0x3178cf){if(_0x3178cf){return _0x264c20[_0xe96e('0x17')](_0x30765a);}return _0x264c20[_0xe96e('0x18')](_0x30765a)['end']();};}function respondWithResult(_0x521e1d,_0x3eba0c){_0x3eba0c=_0x3eba0c||0xc8;return function(_0x554abd){if(_0x554abd){return _0x521e1d[_0xe96e('0x18')](_0x3eba0c)['json'](_0x554abd);}};}function respondWithFilteredResult(_0x118c57,_0x563bb7){return function(_0x438041){if(_0x438041){var _0x4de18f=_0x438041[_0xe96e('0x19')],_0x479f23=_0x563bb7['offset'],_0x5c4da7=_0x563bb7[_0xe96e('0x1a')]+_0x563bb7[_0xe96e('0x1b')],_0x12e9a5;if(_0x5c4da7>=_0x4de18f){_0x5c4da7=_0x4de18f;_0x12e9a5=0xc8;}else{_0x12e9a5=0xce;}_0x118c57[_0xe96e('0x18')](_0x12e9a5);return _0x118c57[_0xe96e('0x1c')]('Content-Range',_0x479f23+'-'+_0x5c4da7+'/'+_0x4de18f)[_0xe96e('0x1d')](_0x438041);}return null;};}function patchUpdates(_0x4f9eb7){return function(_0x518f8d){try{jsonpatch['apply'](_0x518f8d,_0x4f9eb7,!![]);}catch(_0xb063c9){return BPromise[_0xe96e('0x1e')](_0xb063c9);}return _0x518f8d[_0xe96e('0x1f')]();};}function saveUpdates(_0x337296,_0x230f39){return function(_0x48d42a){if(_0x48d42a){return _0x48d42a[_0xe96e('0x20')](_0x337296)[_0xe96e('0x21')](function(_0x4edb0a){return _0x4edb0a;});}return null;};}function removeEntity(_0x1be947,_0x4c6d60){return function(_0x9c885c){if(_0x9c885c){return _0x9c885c[_0xe96e('0x22')]()['then'](function(){var _0x2ff4ef=_0x9c885c[_0xe96e('0x23')]({'plain':!![]});var _0x1b69c1='Voicemails';return db[_0xe96e('0x24')][_0xe96e('0x22')]({'where':{'type':_0x1b69c1,'resourceId':_0x2ff4ef['id']}})['then'](function(){return _0x9c885c;});})[_0xe96e('0x21')](function(){_0x1be947[_0xe96e('0x18')](0xcc)[_0xe96e('0x25')]();});}};}function handleEntityNotFound(_0xd7bbd2,_0x124d6a){return function(_0x3e17e0){if(!_0x3e17e0){_0xd7bbd2['sendStatus'](0x194);}return _0x3e17e0;};}function handleError(_0xc40239,_0x1ff817){_0x1ff817=_0x1ff817||0x1f4;return function(_0x693124){logger['error'](_0x693124[_0xe96e('0x26')]);if(_0x693124[_0xe96e('0x27')]){delete _0x693124[_0xe96e('0x27')];}_0xc40239[_0xe96e('0x18')](_0x1ff817)[_0xe96e('0x28')](_0x693124);};}exports[_0xe96e('0x29')]=function(_0x14ea01,_0x51a8ea){var _0x56a4f8={},_0x10dd4d={},_0xac4e55={'count':0x0,'rows':[]};var _0x5b54c1=_[_0xe96e('0x2a')](db[_0xe96e('0x2b')][_0xe96e('0x2c')],function(_0x26de4e){return{'name':_0x26de4e['fieldName'],'type':_0x26de4e['type'][_0xe96e('0x2d')]};});_0x10dd4d[_0xe96e('0x2e')]=_['map'](_0x5b54c1,_0xe96e('0x27'));_0x10dd4d['query']=_[_0xe96e('0x2f')](_0x14ea01['query']);_0x10dd4d['filters']=_[_0xe96e('0x30')](_0x10dd4d['model'],_0x10dd4d['query']);_0x56a4f8[_0xe96e('0x31')]=_['intersection'](_0x10dd4d[_0xe96e('0x2e')],qs[_0xe96e('0x32')](_0x14ea01['query'][_0xe96e('0x32')]));_0x56a4f8[_0xe96e('0x31')]=_0x56a4f8[_0xe96e('0x31')][_0xe96e('0x33')]?_0x56a4f8[_0xe96e('0x31')]:_0x10dd4d[_0xe96e('0x2e')];if(!_0x14ea01['query'][_0xe96e('0x34')](_0xe96e('0x35'))){_0x56a4f8[_0xe96e('0x1b')]=qs[_0xe96e('0x1b')](_0x14ea01['query'][_0xe96e('0x1b')]);_0x56a4f8['offset']=qs['offset'](_0x14ea01[_0xe96e('0x36')]['offset']);}_0x56a4f8[_0xe96e('0x37')]=qs[_0xe96e('0x38')](_0x14ea01['query'][_0xe96e('0x38')]);_0x56a4f8['where']=qs[_0xe96e('0x39')](_[_0xe96e('0x3a')](_0x14ea01[_0xe96e('0x36')],_0x10dd4d['filters']),_0x5b54c1);if(_0x14ea01['query'][_0xe96e('0x3b')]){_0x56a4f8[_0xe96e('0x3c')]=_[_0xe96e('0x3d')](_0x56a4f8[_0xe96e('0x3c')],{'$or':_[_0xe96e('0x2a')](_0x5b54c1,function(_0x53179a){if(_0x53179a['type']!==_0xe96e('0x3e')){var _0x122513={};_0x122513[_0x53179a[_0xe96e('0x27')]]={'$like':'%'+_0x14ea01[_0xe96e('0x36')][_0xe96e('0x3b')]+'%'};return _0x122513;}})});}_0x56a4f8=_[_0xe96e('0x3d')]({},_0x56a4f8,_0x14ea01[_0xe96e('0x3f')]);var _0x454cbd={'where':_0x56a4f8[_0xe96e('0x3c')]};return db[_0xe96e('0x2b')]['count'](_0x454cbd)[_0xe96e('0x21')](function(_0x32eb51){_0xac4e55[_0xe96e('0x19')]=_0x32eb51;if(_0x14ea01['query'][_0xe96e('0x40')]){_0x56a4f8[_0xe96e('0x41')]=[{'all':!![]}];}return db['VoiceMail'][_0xe96e('0x42')](_0x56a4f8);})['then'](function(_0x28a17c){_0xac4e55['rows']=_0x28a17c;return _0xac4e55;})[_0xe96e('0x21')](respondWithFilteredResult(_0x51a8ea,_0x56a4f8))[_0xe96e('0x43')](handleError(_0x51a8ea,null));};exports['show']=function(_0x47329b,_0x1b22f7){var _0x48f077={'raw':!![],'where':{'id':_0x47329b[_0xe96e('0x44')]['id']}},_0x4e0aa2={};_0x4e0aa2[_0xe96e('0x2e')]=_[_0xe96e('0x2f')](db['VoiceMail'][_0xe96e('0x2c')]);_0x4e0aa2[_0xe96e('0x36')]=_[_0xe96e('0x2f')](_0x47329b['query']);_0x4e0aa2[_0xe96e('0x39')]=_[_0xe96e('0x30')](_0x4e0aa2[_0xe96e('0x2e')],_0x4e0aa2[_0xe96e('0x36')]);_0x48f077[_0xe96e('0x31')]=_[_0xe96e('0x30')](_0x4e0aa2[_0xe96e('0x2e')],qs[_0xe96e('0x32')](_0x47329b[_0xe96e('0x36')][_0xe96e('0x32')]));_0x48f077['attributes']=_0x48f077[_0xe96e('0x31')][_0xe96e('0x33')]?_0x48f077[_0xe96e('0x31')]:_0x4e0aa2[_0xe96e('0x2e')];if(_0x47329b[_0xe96e('0x36')]['includeAll']){_0x48f077['include']=[{'all':!![]}];}_0x48f077=_[_0xe96e('0x3d')]({},_0x48f077,_0x47329b['options']);return db[_0xe96e('0x2b')]['find'](_0x48f077)[_0xe96e('0x21')](handleEntityNotFound(_0x1b22f7,null))[_0xe96e('0x21')](respondWithResult(_0x1b22f7,null))[_0xe96e('0x43')](handleError(_0x1b22f7,null));};exports[_0xe96e('0x45')]=function(_0x3e9c40,_0xe0afa6){return db['VoiceMail'][_0xe96e('0x45')](_0x3e9c40[_0xe96e('0x46')],{})[_0xe96e('0x21')](function(_0x26615c){var _0x71bdb4=_0x3e9c40[_0xe96e('0x47')][_0xe96e('0x23')]({'plain':!![]});if(!_0x71bdb4)throw new Error(_0xe96e('0x48'));if(_0x71bdb4['role']===_0xe96e('0x47')){var _0x34f5d1=_0x26615c['get']({'plain':!![]});var _0x2d59c4=_0xe96e('0x49');return db[_0xe96e('0x4a')][_0xe96e('0x4b')]({'where':{'name':_0x2d59c4,'userProfileId':_0x71bdb4[_0xe96e('0x4c')]},'raw':!![]})[_0xe96e('0x21')](function(_0x132e60){if(_0x132e60&&_0x132e60[_0xe96e('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x34f5d1[_0xe96e('0x27')],'resourceId':_0x34f5d1['id'],'type':_0x132e60[_0xe96e('0x27')],'sectionId':_0x132e60['id']},{})['then'](function(){return _0x26615c;});}else{return _0x26615c;}})[_0xe96e('0x43')](function(_0x576be6){logger[_0xe96e('0x4e')](_0xe96e('0x4f'),_0x576be6);throw _0x576be6;});}return _0x26615c;})[_0xe96e('0x21')](respondWithResult(_0xe0afa6,0xc9))['catch'](handleError(_0xe0afa6,null));};exports[_0xe96e('0x20')]=function(_0x48bc0f,_0xb818e2){if(_0x48bc0f[_0xe96e('0x46')]['id']){delete _0x48bc0f[_0xe96e('0x46')]['id'];}return db[_0xe96e('0x2b')]['find']({'where':{'id':_0x48bc0f[_0xe96e('0x44')]['id']}})[_0xe96e('0x21')](handleEntityNotFound(_0xb818e2,null))[_0xe96e('0x21')](saveUpdates(_0x48bc0f[_0xe96e('0x46')],null))[_0xe96e('0x21')](respondWithResult(_0xb818e2,null))[_0xe96e('0x43')](handleError(_0xb818e2,null));};exports[_0xe96e('0x22')]=function(_0x8ee0f9,_0x271ff5){return db[_0xe96e('0x2b')][_0xe96e('0x4b')]({'where':{'id':_0x8ee0f9[_0xe96e('0x44')]['id']}})[_0xe96e('0x21')](handleEntityNotFound(_0x271ff5,null))[_0xe96e('0x21')](removeEntity(_0x271ff5,null))['catch'](handleError(_0x271ff5,null));};exports[_0xe96e('0x50')]=function(_0x104e97,_0x383eb6,_0x1c0be8){return db['VoiceMail'][_0xe96e('0x51')]({'where':{'id':_0x104e97[_0xe96e('0x44')]['id']}})[_0xe96e('0x21')](handleEntityNotFound(_0x383eb6,null))[_0xe96e('0x21')](function(_0x2b4716){var _0x3ea49d;var _0x485705={},_0x4834a5={};_0x4834a5['model']=_[_0xe96e('0x2f')](db['VoiceMailMessage']['rawAttributes']);_0x4834a5[_0xe96e('0x36')]=_[_0xe96e('0x2f')](_0x104e97[_0xe96e('0x36')]);_0x4834a5['filters']=_[_0xe96e('0x30')](_0x4834a5[_0xe96e('0x2e')],_0x4834a5['query']);_0x485705['attributes']=_[_0xe96e('0x30')](_0x4834a5[_0xe96e('0x2e')],qs[_0xe96e('0x32')](_0x104e97[_0xe96e('0x36')]['fields']));_0x485705['attributes']=_0x485705[_0xe96e('0x31')][_0xe96e('0x33')]?_0x485705[_0xe96e('0x31')]:_0x4834a5[_0xe96e('0x2e')];if(!_0x104e97['query'][_0xe96e('0x34')](_0xe96e('0x35'))){_0x485705['limit']=qs[_0xe96e('0x1b')](_0x104e97[_0xe96e('0x36')][_0xe96e('0x1b')]);_0x485705[_0xe96e('0x1a')]=qs['offset'](_0x104e97[_0xe96e('0x36')]['offset']);}_0x485705[_0xe96e('0x37')]=qs[_0xe96e('0x38')](_0x104e97[_0xe96e('0x36')][_0xe96e('0x38')]);_0x485705[_0xe96e('0x3c')]=qs[_0xe96e('0x39')](_[_0xe96e('0x3a')](_0x104e97[_0xe96e('0x36')],_0x4834a5[_0xe96e('0x39')]));if(_0x104e97[_0xe96e('0x36')]['filter']){_0x485705[_0xe96e('0x3c')]=_[_0xe96e('0x3d')](_0x485705[_0xe96e('0x3c')],{'$or':_['map'](_0x485705[_0xe96e('0x31')],function(_0x5e17d9){var _0x4a9bac={};_0x4a9bac[_0x5e17d9]={'$like':'%'+_0x104e97[_0xe96e('0x36')][_0xe96e('0x3b')]+'%'};return _0x4a9bac;})});}_0x485705[_0xe96e('0x3c')]=_[_0xe96e('0x3d')](_0x485705['where'],{'mailboxuser':_0x2b4716[_0xe96e('0x52')]});_0x485705=_[_0xe96e('0x3d')]({},_0x485705,_0x104e97[_0xe96e('0x3f')]);return db['VoiceMailMessage'][_0xe96e('0x53')](_0x485705)[_0xe96e('0x21')](respondWithFilteredResult(_0x383eb6,_0x485705));})[_0xe96e('0x43')](handleError(_0x383eb6,null));};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js
index 79f135b..c8c652c 100644
--- a/server/api/voiceMail/voiceMail.model.js
+++ b/server/api/voiceMail/voiceMail.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4254=['../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4254,0x13c));var _0x4425=function(_0x130c7b,_0x4a29cb){_0x130c7b=_0x130c7b-0x0;var _0x735554=_0x4254[_0x130c7b];return _0x735554;};'use strict';var _=require(_0x4425('0x0'));var util=require(_0x4425('0x1'));var logger=require(_0x4425('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4425('0x3'));var rp=require(_0x4425('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4425('0x5'));var config=require(_0x4425('0x6'));var attributes=require(_0x4425('0x7'));module[_0x4425('0x8')]=function(_0x113f98,_0x4c5b86){return _0x113f98[_0x4425('0x9')]('VoiceMail',attributes,{'tableName':_0x4425('0xa'),'paranoid':![],'indexes':[{'name':_0x4425('0xb'),'fields':[_0x4425('0xc'),_0x4425('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xffcf=['rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','api','bluebird','request-promise','path'];(function(_0x288e69,_0x1f96a5){var _0x81f7e=function(_0x1ecce5){while(--_0x1ecce5){_0x288e69['push'](_0x288e69['shift']());}};_0x81f7e(++_0x1f96a5);}(_0xffcf,0x180));var _0xfffc=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0xffcf[_0x26d6d9];return _0x1b4875;};'use strict';var _=require(_0xfffc('0x0'));var util=require(_0xfffc('0x1'));var logger=require('../../config/logger')(_0xfffc('0x2'));var moment=require('moment');var BPromise=require(_0xfffc('0x3'));var rp=require(_0xfffc('0x4'));var fs=require('fs');var path=require(_0xfffc('0x5'));var rimraf=require(_0xfffc('0x6'));var config=require(_0xfffc('0x7'));var attributes=require(_0xfffc('0x8'));module['exports']=function(_0x339792,_0x58f2fc){return _0x339792[_0xfffc('0x9')](_0xfffc('0xa'),attributes,{'tableName':_0xfffc('0xb'),'paranoid':![],'indexes':[{'name':_0xfffc('0xc'),'fields':[_0xfffc('0xd'),_0xfffc('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js
index 3588b73..6fb1c0e 100644
--- a/server/api/voiceMail/voiceMail.rpc.js
+++ b/server/api/voiceMail/voiceMail.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc931=['info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceMail,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x56805a,_0xa665c8){var _0x5d6a4e=function(_0x56ac92){while(--_0x56ac92){_0x56805a['push'](_0x56805a['shift']());}};_0x5d6a4e(++_0xa665c8);}(_0xc931,0x80));var _0x1c93=function(_0x163776,_0x336cf7){_0x163776=_0x163776-0x0;var _0x240470=_0xc931[_0x163776];return _0x240470;};'use strict';var _=require(_0x1c93('0x0'));var util=require(_0x1c93('0x1'));var moment=require(_0x1c93('0x2'));var BPromise=require('bluebird');var rs=require(_0x1c93('0x3'));var fs=require('fs');var Redis=require(_0x1c93('0x4'));var db=require(_0x1c93('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c93('0x6'))(_0x1c93('0x7'));var config=require(_0x1c93('0x8'));var jayson=require(_0x1c93('0x9'));var client=jayson['client'][_0x1c93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ceff3,_0x5b08c9,_0x4dd859){return new BPromise(function(_0x532fc4,_0x573df0){return client[_0x1c93('0xb')](_0x3ceff3,_0x4dd859)['then'](function(_0x57e960){logger[_0x1c93('0xc')]('VoiceMail,\x20%s,\x20%s',_0x5b08c9,_0x1c93('0xd'));logger[_0x1c93('0xe')](_0x1c93('0xf'),_0x5b08c9,'request\x20sent',JSON[_0x1c93('0x10')](_0x57e960));if(_0x57e960[_0x1c93('0x11')]){if(_0x57e960[_0x1c93('0x11')]['code']===0x1f4){logger[_0x1c93('0x11')]('VoiceMail,\x20%s,\x20%s',_0x5b08c9,_0x57e960[_0x1c93('0x11')][_0x1c93('0x12')]);return _0x573df0(_0x57e960[_0x1c93('0x11')]['message']);}logger[_0x1c93('0x11')]('VoiceMail,\x20%s,\x20%s',_0x5b08c9,_0x57e960[_0x1c93('0x11')][_0x1c93('0x12')]);return _0x532fc4(_0x57e960[_0x1c93('0x11')][_0x1c93('0x12')]);}else{logger['info'](_0x1c93('0x13'),_0x5b08c9,_0x1c93('0xd'));_0x532fc4(_0x57e960['result'][_0x1c93('0x12')]);}})['catch'](function(_0x292828){logger[_0x1c93('0x11')]('VoiceMail,\x20%s,\x20%s',_0x5b08c9,_0x292828);_0x573df0(_0x292828);});});}
\ No newline at end of file
+var _0x69a1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x1be800,_0x29e7a0){var _0x14624d=function(_0x1cfcf1){while(--_0x1cfcf1){_0x1be800['push'](_0x1be800['shift']());}};_0x14624d(++_0x29e7a0);}(_0x69a1,0x182));var _0x169a=function(_0x2952c2,_0x51a712){_0x2952c2=_0x2952c2-0x0;var _0x590f7c=_0x69a1[_0x2952c2];return _0x590f7c;};'use strict';var _=require(_0x169a('0x0'));var util=require(_0x169a('0x1'));var moment=require(_0x169a('0x2'));var BPromise=require('bluebird');var rs=require(_0x169a('0x3'));var fs=require('fs');var Redis=require(_0x169a('0x4'));var db=require(_0x169a('0x5'))['db'];var utils=require(_0x169a('0x6'));var logger=require(_0x169a('0x7'))(_0x169a('0x8'));var config=require(_0x169a('0x9'));var jayson=require(_0x169a('0xa'));var client=jayson['client'][_0x169a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3698e8,_0x1758c6,_0x11f6f5){return new BPromise(function(_0x5941e4,_0x506034){return client[_0x169a('0xc')](_0x3698e8,_0x11f6f5)[_0x169a('0xd')](function(_0x34c641){logger['info'](_0x169a('0xe'),_0x1758c6,_0x169a('0xf'));logger[_0x169a('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x1758c6,_0x169a('0xf'),JSON[_0x169a('0x11')](_0x34c641));if(_0x34c641[_0x169a('0x12')]){if(_0x34c641[_0x169a('0x12')]['code']===0x1f4){logger[_0x169a('0x12')](_0x169a('0xe'),_0x1758c6,_0x34c641[_0x169a('0x12')][_0x169a('0x13')]);return _0x506034(_0x34c641[_0x169a('0x12')][_0x169a('0x13')]);}logger['error'](_0x169a('0xe'),_0x1758c6,_0x34c641[_0x169a('0x12')][_0x169a('0x13')]);return _0x5941e4(_0x34c641[_0x169a('0x12')][_0x169a('0x13')]);}else{logger[_0x169a('0x14')](_0x169a('0xe'),_0x1758c6,_0x169a('0xf'));_0x5941e4(_0x34c641[_0x169a('0x15')]['message']);}})[_0x169a('0x16')](function(_0x5f35c1){logger[_0x169a('0x12')](_0x169a('0xe'),_0x1758c6,_0x5f35c1);_0x506034(_0x5f35c1);});});}
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js
index b0b87dc..1009c77 100644
--- a/server/api/voiceMailMessage/index.js
+++ b/server/api/voiceMailMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download','post','create','put','update'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x9')]);router[_0xac4a('0x7')](_0xac4a('0xa'),auth[_0xac4a('0x8')](),controller[_0xac4a('0xb')]);router['get']('/:id/download',auth[_0xac4a('0x8')](),controller[_0xac4a('0xc')]);router[_0xac4a('0xd')]('/',auth['isAuthenticated'](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('0x10')]);router['delete'](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router;
\ No newline at end of file
+var _0x9c5a=['get','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated'];(function(_0x5c6fa0,_0x429d2a){var _0xbff8fb=function(_0x4cc8f5){while(--_0x4cc8f5){_0x5c6fa0['push'](_0x5c6fa0['shift']());}};_0xbff8fb(++_0x429d2a);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x437fd9,_0x3e807b){_0x437fd9=_0x437fd9-0x0;var _0x39628b=_0x9c5a[_0x437fd9];return _0x39628b;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get']('/',auth[_0xa9c5('0x8')](),controller['index']);router[_0xa9c5('0x9')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa9c5('0x9')](_0xa9c5('0xb'),auth['isAuthenticated'](),controller[_0xa9c5('0xc')]);router[_0xa9c5('0xd')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0xe')]);router[_0xa9c5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa9c5('0x10')]);router[_0xa9c5('0x11')](_0xa9c5('0xa'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x12')]);module[_0xa9c5('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js
index 79180a1..ef097b6 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.attributes.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88af=['INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize','VIRTUAL','getDataValue'];(function(_0x1fa287,_0xb138f3){var _0x39c533=function(_0x436c8d){while(--_0x436c8d){_0x1fa287['push'](_0x1fa287['shift']());}};_0x39c533(++_0xb138f3);}(_0x88af,0x125));var _0xf88a=function(_0x541a67,_0x50728d){_0x541a67=_0x541a67-0x0;var _0x45da2a=_0x88af[_0x541a67];return _0x45da2a;};'use strict';var Sequelize=require(_0xf88a('0x0'));module['exports']={'name':{'type':Sequelize[_0xf88a('0x1')],'get':function(_0x482764){return this[_0xf88a('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xf88a('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf88a('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xf88a('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf88a('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf88a('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xf88a('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf88a('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf88a('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xf88a('0x5')](_0xf88a('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xf88a('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xf88a('0x7'),'allowNull':![]}};
\ No newline at end of file
+var _0x39e0=['STRING','long','TIMESTAMP','sequelize','VIRTUAL','getDataValue'];(function(_0x5b73f5,_0x51b25f){var _0x3d662a=function(_0x3c45b7){while(--_0x3c45b7){_0x5b73f5['push'](_0x5b73f5['shift']());}};_0x3d662a(++_0x51b25f);}(_0x39e0,0x1e9));var _0x039e=function(_0xb3a977,_0x5808f7){_0xb3a977=_0xb3a977-0x0;var _0x30b779=_0x39e0[_0xb3a977];return _0x30b779;};'use strict';var Sequelize=require(_0x039e('0x0'));module['exports']={'name':{'type':Sequelize[_0x039e('0x1')],'get':function(_0x384ea8){return this[_0x039e('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x039e('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x039e('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x039e('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x039e('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x039e('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x039e('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x039e('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x039e('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x039e('0x3')],'defaultValue':''},'stamp':{'type':_0x039e('0x5'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js
index 53b0fac..908dc0f 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.controller.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x777d=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','set','Content-Range','json','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceMailMessage','count','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','path','to-csv','lodash','desk.js','querystring'];(function(_0x527387,_0x331638){var _0x22032f=function(_0x48fa3c){while(--_0x48fa3c){_0x527387['push'](_0x527387['shift']());}};_0x22032f(++_0x331638);}(_0x777d,0xe9));var _0xd777=function(_0x46d8b2,_0x3829c4){_0x46d8b2=_0x46d8b2-0x0;var _0x1a351f=_0x777d[_0x46d8b2];return _0x1a351f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd777('0x0'));var rimraf=require(_0xd777('0x1'));var zipdir=require(_0xd777('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd777('0x3'));var moment=require(_0xd777('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd777('0x5'));var sox=require('sox');var csv=require(_0xd777('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd777('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd777('0x8'));var toCsv=require(_0xd777('0x6'));var querystring=require(_0xd777('0x9'));var Papa=require(_0xd777('0xa'));var Redis=require(_0xd777('0xb'));var authService=require(_0xd777('0xc'));var qs=require(_0xd777('0xd'));var as=require(_0xd777('0xe'));var hardwareService=require(_0xd777('0xf'));var logger=require(_0xd777('0x10'))(_0xd777('0x11'));var utils=require(_0xd777('0x12'));var config=require(_0xd777('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59dc27,_0x25f574){_0x25f574=_0x25f574||0xcc;return function(_0x560778){if(_0x560778){return _0x59dc27[_0xd777('0x14')](_0x25f574);}return _0x59dc27[_0xd777('0x15')](_0x25f574)[_0xd777('0x16')]();};}function respondWithResult(_0x2f310c,_0x2ac82f){_0x2ac82f=_0x2ac82f||0xc8;return function(_0x5d0ded){if(_0x5d0ded){return _0x2f310c[_0xd777('0x15')](_0x2ac82f)['json'](_0x5d0ded);}};}function respondWithFilteredResult(_0x23b61a,_0x2cd014){return function(_0x1e5ecb){if(_0x1e5ecb){var _0x1ef016=_0x1e5ecb['count'],_0x25e3f2=_0x2cd014[_0xd777('0x17')],_0x4f4af5=_0x2cd014['offset']+_0x2cd014[_0xd777('0x18')],_0x24cd59;if(_0x4f4af5>=_0x1ef016){_0x4f4af5=_0x1ef016;_0x24cd59=0xc8;}else{_0x24cd59=0xce;}_0x23b61a[_0xd777('0x15')](_0x24cd59);return _0x23b61a[_0xd777('0x19')](_0xd777('0x1a'),_0x25e3f2+'-'+_0x4f4af5+'/'+_0x1ef016)[_0xd777('0x1b')](_0x1e5ecb);}return null;};}function patchUpdates(_0x201175){return function(_0x48d5f0){try{jsonpatch['apply'](_0x48d5f0,_0x201175,!![]);}catch(_0x20ffde){return BPromise['reject'](_0x20ffde);}return _0x48d5f0[_0xd777('0x1c')]();};}function saveUpdates(_0x560121,_0x58a079){return function(_0x5b2204){if(_0x5b2204){return _0x5b2204[_0xd777('0x1d')](_0x560121)['then'](function(_0x4cb07a){return _0x4cb07a;});}return null;};}function removeEntity(_0x49d7fa,_0x48d18c){return function(_0x55b975){if(_0x55b975){return _0x55b975[_0xd777('0x1e')]()[_0xd777('0x1f')](function(){_0x49d7fa[_0xd777('0x15')](0xcc)[_0xd777('0x16')]();});}};}function handleEntityNotFound(_0xfebc2f,_0x33c3d4){return function(_0x2ff8d3){if(!_0x2ff8d3){_0xfebc2f[_0xd777('0x14')](0x194);}return _0x2ff8d3;};}function handleError(_0x188a3a,_0x3e637a){_0x3e637a=_0x3e637a||0x1f4;return function(_0x1ff306){logger['error'](_0x1ff306[_0xd777('0x20')]);if(_0x1ff306[_0xd777('0x21')]){delete _0x1ff306[_0xd777('0x21')];}_0x188a3a[_0xd777('0x15')](_0x3e637a)[_0xd777('0x22')](_0x1ff306);};}exports['index']=function(_0x141e68,_0x5e752b){var _0x482ad1={},_0x2ff04b={},_0x21e38c={'count':0x0,'rows':[]};var _0x2dae46=_[_0xd777('0x23')](db['VoiceMailMessage'][_0xd777('0x24')],function(_0x141baa){return{'name':_0x141baa[_0xd777('0x25')],'type':_0x141baa[_0xd777('0x26')][_0xd777('0x27')]};});_0x2ff04b[_0xd777('0x28')]=_[_0xd777('0x29')](_[_0xd777('0x23')](_0x2dae46,'name'),[_0xd777('0x21')]);_0x2ff04b['query']=_['keys'](_0x141e68[_0xd777('0x2a')]);_0x2ff04b[_0xd777('0x2b')]=_[_0xd777('0x2c')](_0x2ff04b[_0xd777('0x28')],_0x2ff04b['query']);_0x482ad1['attributes']=_[_0xd777('0x2c')](_0x2ff04b[_0xd777('0x28')],qs[_0xd777('0x2d')](_0x141e68[_0xd777('0x2a')][_0xd777('0x2d')]));_0x482ad1[_0xd777('0x2e')]=_0x482ad1['attributes']['length']?_0x482ad1[_0xd777('0x2e')]:_0x2ff04b[_0xd777('0x28')];if(!_0x141e68[_0xd777('0x2a')][_0xd777('0x2f')](_0xd777('0x30'))){_0x482ad1[_0xd777('0x18')]=qs[_0xd777('0x18')](_0x141e68[_0xd777('0x2a')]['limit']);_0x482ad1['offset']=qs[_0xd777('0x17')](_0x141e68['query'][_0xd777('0x17')]);}_0x482ad1[_0xd777('0x31')]=qs[_0xd777('0x32')](_0x141e68[_0xd777('0x2a')]['sort']);_0x482ad1[_0xd777('0x33')]=qs['filters'](_[_0xd777('0x34')](_0x141e68['query'],_0x2ff04b['filters']),_0x2dae46);if(_0x141e68['query']['filter']){_0x482ad1[_0xd777('0x33')]=_[_0xd777('0x35')](_0x482ad1[_0xd777('0x33')],{'$or':_['map'](_0x2dae46,function(_0x51adbd){if(_0x51adbd['type']!==_0xd777('0x36')){var _0x21466={};_0x21466[_0x51adbd[_0xd777('0x21')]]={'$like':'%'+_0x141e68[_0xd777('0x2a')][_0xd777('0x37')]+'%'};return _0x21466;}})});}_0x482ad1=_[_0xd777('0x35')]({},_0x482ad1,_0x141e68[_0xd777('0x38')]);var _0x22b014={'where':_0x482ad1[_0xd777('0x33')]};return db[_0xd777('0x39')]['count'](_0x22b014)[_0xd777('0x1f')](function(_0x11a5f7){_0x21e38c[_0xd777('0x3a')]=_0x11a5f7;if(_0x141e68[_0xd777('0x2a')][_0xd777('0x3b')]){_0x482ad1[_0xd777('0x3c')]=[{'all':!![]}];}return db[_0xd777('0x39')][_0xd777('0x3d')](_0x482ad1);})[_0xd777('0x1f')](function(_0x34381b){_0x21e38c[_0xd777('0x3e')]=_0x34381b;return _0x21e38c;})[_0xd777('0x1f')](respondWithFilteredResult(_0x5e752b,_0x482ad1))['catch'](handleError(_0x5e752b,null));};exports[_0xd777('0x3f')]=function(_0x52b3d0,_0x45e831){var _0x30c9ec={'raw':!![],'where':{'id':_0x52b3d0[_0xd777('0x40')]['id']}},_0xc6297b={};_0xc6297b[_0xd777('0x28')]=_[_0xd777('0x41')](db['VoiceMailMessage'][_0xd777('0x24')]);_0xc6297b[_0xd777('0x2a')]=_[_0xd777('0x41')](_0x52b3d0['query']);_0xc6297b[_0xd777('0x2b')]=_[_0xd777('0x2c')](_0xc6297b[_0xd777('0x28')],_0xc6297b[_0xd777('0x2a')]);_0x30c9ec[_0xd777('0x2e')]=_[_0xd777('0x2c')](_0xc6297b[_0xd777('0x28')],qs['fields'](_0x52b3d0[_0xd777('0x2a')][_0xd777('0x2d')]));_0x30c9ec['attributes']=_0x30c9ec['attributes'][_0xd777('0x42')]?_0x30c9ec[_0xd777('0x2e')]:_0xc6297b[_0xd777('0x28')];if(_0x52b3d0[_0xd777('0x2a')][_0xd777('0x3b')]){_0x30c9ec[_0xd777('0x3c')]=[{'all':!![]}];}_0x30c9ec=_[_0xd777('0x35')]({},_0x30c9ec,_0x52b3d0[_0xd777('0x38')]);return db[_0xd777('0x39')][_0xd777('0x43')](_0x30c9ec)[_0xd777('0x1f')](handleEntityNotFound(_0x45e831,null))['then'](respondWithResult(_0x45e831,null))[_0xd777('0x44')](handleError(_0x45e831,null));};exports[_0xd777('0x45')]=function(_0x56c8e5,_0x478ae2){return db['VoiceMailMessage'][_0xd777('0x45')](_0x56c8e5[_0xd777('0x46')],{})[_0xd777('0x1f')](respondWithResult(_0x478ae2,0xc9))[_0xd777('0x44')](handleError(_0x478ae2,null));};exports[_0xd777('0x1d')]=function(_0x305c1c,_0x477626){if(_0x305c1c[_0xd777('0x46')]['id']){delete _0x305c1c['body']['id'];}return db[_0xd777('0x39')]['find']({'where':{'id':_0x305c1c['params']['id']}})[_0xd777('0x1f')](handleEntityNotFound(_0x477626,null))[_0xd777('0x1f')](saveUpdates(_0x305c1c['body'],null))[_0xd777('0x1f')](respondWithResult(_0x477626,null))[_0xd777('0x44')](handleError(_0x477626,null));};exports[_0xd777('0x1e')]=function(_0x25486b,_0x47efa6){return db['VoiceMailMessage'][_0xd777('0x43')]({'where':{'id':_0x25486b['params']['id']}})[_0xd777('0x1f')](handleEntityNotFound(_0x47efa6,null))[_0xd777('0x1f')](removeEntity(_0x47efa6,null))[_0xd777('0x44')](handleError(_0x47efa6,null));};exports[_0xd777('0x47')]=function(_0x22a472,_0x57113d,_0x19204f){return db[_0xd777('0x39')][_0xd777('0x43')]({'where':{'id':_0x22a472['params']['id']},'attributes':['id',_0xd777('0x48'),_0xd777('0x49')]})['then'](handleEntityNotFound(_0x57113d,null))[_0xd777('0x1f')](function(_0x2d2848){if(_0x2d2848){if(!_0x2d2848[_0xd777('0x48')]){throw new db['Sequelize'][(_0xd777('0x4a'))](_0xd777('0x4b'));}var _0x2c5c08={'Content-Type':_0xd777('0x4c'),'Content-Disposition':_0xd777('0x4d')};if(_0x2d2848[_0xd777('0x49')]){_0x2c5c08[_0xd777('0x4e')]=_0xd777('0x4f')+_0x2d2848[_0xd777('0x49')]+_0xd777('0x50');}_0x57113d[_0xd777('0x19')](_0x2c5c08);return _0x57113d[_0xd777('0x22')](new Buffer(_0x2d2848[_0xd777('0x48')]));}})[_0xd777('0x44')](handleError(_0x57113d,null));};
\ No newline at end of file
+var _0x5b02=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','length','includeAll','create','body','find','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','attachment;\x20filename=\x22','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis'];(function(_0x3d2b6d,_0x1c710e){var _0x268764=function(_0x3777d5){while(--_0x3777d5){_0x3d2b6d['push'](_0x3d2b6d['shift']());}};_0x268764(++_0x1c710e);}(_0x5b02,0xe9));var _0x25b0=function(_0x4965d0,_0x3da1b7){_0x4965d0=_0x4965d0-0x0;var _0x2d778a=_0x5b02[_0x4965d0];return _0x2d778a;};'use strict';var pdf=require(_0x25b0('0x0'));var emlformat=require(_0x25b0('0x1'));var rimraf=require(_0x25b0('0x2'));var zipdir=require(_0x25b0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x25b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x25b0('0x5'));var util=require(_0x25b0('0x6'));var path=require(_0x25b0('0x7'));var sox=require(_0x25b0('0x8'));var csv=require(_0x25b0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x25b0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x25b0('0xd'));var Papa=require(_0x25b0('0xe'));var Redis=require(_0x25b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b0('0x10'));var as=require(_0x25b0('0x11'));var hardwareService=require(_0x25b0('0x12'));var logger=require(_0x25b0('0x13'))(_0x25b0('0x14'));var utils=require(_0x25b0('0x15'));var config=require(_0x25b0('0x16'));var db=require(_0x25b0('0x17'))['db'];function respondWithStatusCode(_0x193c2b,_0x1d3178){_0x1d3178=_0x1d3178||0xcc;return function(_0x184452){if(_0x184452){return _0x193c2b[_0x25b0('0x18')](_0x1d3178);}return _0x193c2b[_0x25b0('0x19')](_0x1d3178)[_0x25b0('0x1a')]();};}function respondWithResult(_0x1ceeb1,_0x42cc07){_0x42cc07=_0x42cc07||0xc8;return function(_0x293203){if(_0x293203){return _0x1ceeb1[_0x25b0('0x19')](_0x42cc07)[_0x25b0('0x1b')](_0x293203);}};}function respondWithFilteredResult(_0x3b89e7,_0x40071c){return function(_0x5ac18d){if(_0x5ac18d){var _0x51542b=_0x5ac18d[_0x25b0('0x1c')],_0xfe1ea6=_0x40071c[_0x25b0('0x1d')],_0x4b2357=_0x40071c[_0x25b0('0x1d')]+_0x40071c['limit'],_0xa8280a;if(_0x4b2357>=_0x51542b){_0x4b2357=_0x51542b;_0xa8280a=0xc8;}else{_0xa8280a=0xce;}_0x3b89e7[_0x25b0('0x19')](_0xa8280a);return _0x3b89e7[_0x25b0('0x1e')](_0x25b0('0x1f'),_0xfe1ea6+'-'+_0x4b2357+'/'+_0x51542b)[_0x25b0('0x1b')](_0x5ac18d);}return null;};}function patchUpdates(_0xe750bf){return function(_0x25872d){try{jsonpatch['apply'](_0x25872d,_0xe750bf,!![]);}catch(_0x348d36){return BPromise[_0x25b0('0x20')](_0x348d36);}return _0x25872d[_0x25b0('0x21')]();};}function saveUpdates(_0x1507b5,_0x1dc691){return function(_0xea4162){if(_0xea4162){return _0xea4162[_0x25b0('0x22')](_0x1507b5)[_0x25b0('0x23')](function(_0x7bdaf9){return _0x7bdaf9;});}return null;};}function removeEntity(_0x35939f,_0x2b2eda){return function(_0x3ce1da){if(_0x3ce1da){return _0x3ce1da['destroy']()[_0x25b0('0x23')](function(){_0x35939f[_0x25b0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d7c17,_0x2023d8){return function(_0x3546f0){if(!_0x3546f0){_0x2d7c17['sendStatus'](0x194);}return _0x3546f0;};}function handleError(_0x4b87c9,_0x50089e){_0x50089e=_0x50089e||0x1f4;return function(_0x3fe815){logger[_0x25b0('0x24')](_0x3fe815[_0x25b0('0x25')]);if(_0x3fe815[_0x25b0('0x26')]){delete _0x3fe815[_0x25b0('0x26')];}_0x4b87c9[_0x25b0('0x19')](_0x50089e)[_0x25b0('0x27')](_0x3fe815);};}exports[_0x25b0('0x28')]=function(_0x22e024,_0x596d14){var _0x2ea408={},_0xbfba84={},_0x5ed7d2={'count':0x0,'rows':[]};var _0x567775=_['map'](db[_0x25b0('0x29')][_0x25b0('0x2a')],function(_0x251fad){return{'name':_0x251fad[_0x25b0('0x2b')],'type':_0x251fad[_0x25b0('0x2c')][_0x25b0('0x2d')]};});_0xbfba84[_0x25b0('0x2e')]=_[_0x25b0('0x2f')](_[_0x25b0('0x30')](_0x567775,_0x25b0('0x26')),[_0x25b0('0x26')]);_0xbfba84[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x22e024['query']);_0xbfba84['filters']=_[_0x25b0('0x33')](_0xbfba84['model'],_0xbfba84['query']);_0x2ea408[_0x25b0('0x34')]=_[_0x25b0('0x33')](_0xbfba84[_0x25b0('0x2e')],qs[_0x25b0('0x35')](_0x22e024[_0x25b0('0x31')]['fields']));_0x2ea408[_0x25b0('0x34')]=_0x2ea408[_0x25b0('0x34')]['length']?_0x2ea408[_0x25b0('0x34')]:_0xbfba84[_0x25b0('0x2e')];if(!_0x22e024['query'][_0x25b0('0x36')]('nolimit')){_0x2ea408[_0x25b0('0x37')]=qs[_0x25b0('0x37')](_0x22e024[_0x25b0('0x31')][_0x25b0('0x37')]);_0x2ea408[_0x25b0('0x1d')]=qs[_0x25b0('0x1d')](_0x22e024[_0x25b0('0x31')][_0x25b0('0x1d')]);}_0x2ea408[_0x25b0('0x38')]=qs['sort'](_0x22e024[_0x25b0('0x31')][_0x25b0('0x39')]);_0x2ea408[_0x25b0('0x3a')]=qs[_0x25b0('0x3b')](_[_0x25b0('0x3c')](_0x22e024[_0x25b0('0x31')],_0xbfba84[_0x25b0('0x3b')]),_0x567775);if(_0x22e024[_0x25b0('0x31')][_0x25b0('0x3d')]){_0x2ea408[_0x25b0('0x3a')]=_['merge'](_0x2ea408[_0x25b0('0x3a')],{'$or':_[_0x25b0('0x30')](_0x567775,function(_0x42a7af){if(_0x42a7af['type']!==_0x25b0('0x3e')){var _0x42a0ed={};_0x42a0ed[_0x42a7af[_0x25b0('0x26')]]={'$like':'%'+_0x22e024[_0x25b0('0x31')][_0x25b0('0x3d')]+'%'};return _0x42a0ed;}})});}_0x2ea408=_[_0x25b0('0x3f')]({},_0x2ea408,_0x22e024[_0x25b0('0x40')]);var _0x391493={'where':_0x2ea408['where']};return db['VoiceMailMessage'][_0x25b0('0x1c')](_0x391493)[_0x25b0('0x23')](function(_0x3f4ae0){_0x5ed7d2['count']=_0x3f4ae0;if(_0x22e024[_0x25b0('0x31')]['includeAll']){_0x2ea408[_0x25b0('0x41')]=[{'all':!![]}];}return db[_0x25b0('0x29')][_0x25b0('0x42')](_0x2ea408);})[_0x25b0('0x23')](function(_0x8a2eeb){_0x5ed7d2['rows']=_0x8a2eeb;return _0x5ed7d2;})[_0x25b0('0x23')](respondWithFilteredResult(_0x596d14,_0x2ea408))[_0x25b0('0x43')](handleError(_0x596d14,null));};exports[_0x25b0('0x44')]=function(_0x376d8a,_0x428799){var _0x5a9e86={'raw':!![],'where':{'id':_0x376d8a[_0x25b0('0x45')]['id']}},_0x327659={};_0x327659[_0x25b0('0x2e')]=_[_0x25b0('0x32')](db[_0x25b0('0x29')][_0x25b0('0x2a')]);_0x327659[_0x25b0('0x31')]=_[_0x25b0('0x32')](_0x376d8a[_0x25b0('0x31')]);_0x327659[_0x25b0('0x3b')]=_[_0x25b0('0x33')](_0x327659['model'],_0x327659[_0x25b0('0x31')]);_0x5a9e86['attributes']=_[_0x25b0('0x33')](_0x327659[_0x25b0('0x2e')],qs[_0x25b0('0x35')](_0x376d8a[_0x25b0('0x31')]['fields']));_0x5a9e86[_0x25b0('0x34')]=_0x5a9e86[_0x25b0('0x34')][_0x25b0('0x46')]?_0x5a9e86['attributes']:_0x327659[_0x25b0('0x2e')];if(_0x376d8a[_0x25b0('0x31')][_0x25b0('0x47')]){_0x5a9e86[_0x25b0('0x41')]=[{'all':!![]}];}_0x5a9e86=_[_0x25b0('0x3f')]({},_0x5a9e86,_0x376d8a[_0x25b0('0x40')]);return db[_0x25b0('0x29')]['find'](_0x5a9e86)[_0x25b0('0x23')](handleEntityNotFound(_0x428799,null))[_0x25b0('0x23')](respondWithResult(_0x428799,null))[_0x25b0('0x43')](handleError(_0x428799,null));};exports['create']=function(_0xbaeb06,_0xda629){return db[_0x25b0('0x29')][_0x25b0('0x48')](_0xbaeb06[_0x25b0('0x49')],{})['then'](respondWithResult(_0xda629,0xc9))[_0x25b0('0x43')](handleError(_0xda629,null));};exports[_0x25b0('0x22')]=function(_0x23de77,_0x524e9a){if(_0x23de77[_0x25b0('0x49')]['id']){delete _0x23de77[_0x25b0('0x49')]['id'];}return db[_0x25b0('0x29')][_0x25b0('0x4a')]({'where':{'id':_0x23de77[_0x25b0('0x45')]['id']}})[_0x25b0('0x23')](handleEntityNotFound(_0x524e9a,null))['then'](saveUpdates(_0x23de77['body'],null))['then'](respondWithResult(_0x524e9a,null))[_0x25b0('0x43')](handleError(_0x524e9a,null));};exports['destroy']=function(_0x48bc07,_0x2c5b9e){return db['VoiceMailMessage'][_0x25b0('0x4a')]({'where':{'id':_0x48bc07['params']['id']}})['then'](handleEntityNotFound(_0x2c5b9e,null))[_0x25b0('0x23')](removeEntity(_0x2c5b9e,null))[_0x25b0('0x43')](handleError(_0x2c5b9e,null));};exports[_0x25b0('0x4b')]=function(_0x34ded7,_0x42d139,_0xf3aef8){return db[_0x25b0('0x29')][_0x25b0('0x4a')]({'where':{'id':_0x34ded7[_0x25b0('0x45')]['id']},'attributes':['id',_0x25b0('0x4c'),'msg_id']})['then'](handleEntityNotFound(_0x42d139,null))['then'](function(_0xf1e6bf){if(_0xf1e6bf){if(!_0xf1e6bf[_0x25b0('0x4c')]){throw new db[(_0x25b0('0x4d'))][(_0x25b0('0x4e'))](_0x25b0('0x4f'));}var _0x3f460f={'Content-Type':_0x25b0('0x50'),'Content-Disposition':'attachment'};if(_0xf1e6bf[_0x25b0('0x51')]){_0x3f460f['Content-Disposition']=_0x25b0('0x52')+_0xf1e6bf['msg_id']+'.wav\x22';}_0x42d139[_0x25b0('0x1e')](_0x3f460f);return _0x42d139['send'](new Buffer(_0xf1e6bf['recording']));}})[_0x25b0('0x43')](handleError(_0x42d139,null));};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js
index d8ac70a..f33340d 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.model.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x75ea=['path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','api','moment','request-promise'];(function(_0x1c0a51,_0x57c225){var _0x13ac3c=function(_0x39ffb6){while(--_0x39ffb6){_0x1c0a51['push'](_0x1c0a51['shift']());}};_0x13ac3c(++_0x57c225);}(_0x75ea,0x7d));var _0xa75e=function(_0x8a57dc,_0x20fa26){_0x8a57dc=_0x8a57dc-0x0;var _0x4e8f22=_0x75ea[_0x8a57dc];return _0x4e8f22;};'use strict';var _=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var logger=require('../../config/logger')(_0xa75e('0x2'));var moment=require(_0xa75e('0x3'));var BPromise=require('bluebird');var rp=require(_0xa75e('0x4'));var fs=require('fs');var path=require(_0xa75e('0x5'));var rimraf=require(_0xa75e('0x6'));var config=require(_0xa75e('0x7'));var attributes=require(_0xa75e('0x8'));module['exports']=function(_0x2a3364,_0x1f9627){return _0x2a3364[_0xa75e('0x9')](_0xa75e('0xa'),attributes,{'tableName':_0xa75e('0xb'),'paranoid':![],'indexes':[{'name':_0xa75e('0xc'),'fields':[_0xa75e('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xcce8=['voice_voicemail_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage'];(function(_0x198add,_0x239d3c){var _0x35bfaa=function(_0x30eed2){while(--_0x30eed2){_0x198add['push'](_0x198add['shift']());}};_0x35bfaa(++_0x239d3c);}(_0xcce8,0x1a5));var _0x8cce=function(_0x42fa1f,_0x1abc4b){_0x42fa1f=_0x42fa1f-0x0;var _0x1d70e6=_0xcce8[_0x42fa1f];return _0x1d70e6;};'use strict';var _=require(_0x8cce('0x0'));var util=require(_0x8cce('0x1'));var logger=require(_0x8cce('0x2'))(_0x8cce('0x3'));var moment=require(_0x8cce('0x4'));var BPromise=require(_0x8cce('0x5'));var rp=require(_0x8cce('0x6'));var fs=require('fs');var path=require(_0x8cce('0x7'));var rimraf=require(_0x8cce('0x8'));var config=require(_0x8cce('0x9'));var attributes=require('./voiceMailMessage.attributes');module[_0x8cce('0xa')]=function(_0x30554a,_0x2a008a){return _0x30554a[_0x8cce('0xb')](_0x8cce('0xc'),attributes,{'tableName':_0x8cce('0xd'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js
index a8704c6..1c5cf70 100644
--- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js
+++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x4975,0x86));var _0x5497=function(_0x5ba866,_0x529606){_0x5ba866=_0x5ba866-0x0;var _0x597ed2=_0x4975[_0x5ba866];return _0x597ed2;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0x0295=['client','http','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x480bf9,_0x5b4a70){var _0x1678a0=function(_0x2155ca){while(--_0x2155ca){_0x480bf9['push'](_0x480bf9['shift']());}};_0x1678a0(++_0x5b4a70);}(_0x0295,0x1f0));var _0x5029=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x0295[_0x11155f];return _0xd07e48;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js
index 6386365..9c3d518 100644
--- a/server/api/voiceMusicOnHold/index.js
+++ b/server/api/voiceMusicOnHold/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xefb0=['post','create','/:id/sounds','addSound','delete','destroy','/:id/sounds/:id2','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','show','isAuthenticated','getSounds'];(function(_0x56d67e,_0x2a6d3e){var _0x3d52f0=function(_0x5ebabb){while(--_0x5ebabb){_0x56d67e['push'](_0x56d67e['shift']());}};_0x3d52f0(++_0x2a6d3e);}(_0xefb0,0x143));var _0x0efb=function(_0x118f56,_0x16bf9c){_0x118f56=_0x118f56-0x0;var _0x5a23ec=_0xefb0[_0x118f56];return _0x5a23ec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0efb('0x0'));var timeout=require(_0x0efb('0x1'));var express=require(_0x0efb('0x2'));var router=express['Router']();var auth=require(_0x0efb('0x3'));var interaction=require(_0x0efb('0x4'));var config=require(_0x0efb('0x5'));var controller=require(_0x0efb('0x6'));router[_0x0efb('0x7')]('/',auth['isAuthenticated'](),controller[_0x0efb('0x8')]);router['get'](_0x0efb('0x9'),auth['isAuthenticated'](),controller[_0x0efb('0xa')]);router[_0x0efb('0x7')]('/:id/sounds',auth[_0x0efb('0xb')](),controller[_0x0efb('0xc')]);router[_0x0efb('0xd')]('/',auth[_0x0efb('0xb')](),controller[_0x0efb('0xe')]);router[_0x0efb('0xd')](_0x0efb('0xf'),auth[_0x0efb('0xb')](),controller[_0x0efb('0x10')]);router['put'](_0x0efb('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x0efb('0x11')](_0x0efb('0x9'),auth[_0x0efb('0xb')](),controller[_0x0efb('0x12')]);router[_0x0efb('0x11')](_0x0efb('0x13'),auth[_0x0efb('0xb')](),controller['removeSound']);module[_0x0efb('0x14')]=router;
\ No newline at end of file
+var _0x536c=['isAuthenticated','/:id','show','/:id/sounds','create','post','addSound','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x536c,0x17d));var _0xc536=function(_0x15d477,_0x110f8b){_0x15d477=_0x15d477-0x0;var _0x9774c7=_0x536c[_0x15d477];return _0x9774c7;};'use strict';var multer=require(_0xc536('0x0'));var util=require('util');var path=require(_0xc536('0x1'));var timeout=require(_0xc536('0x2'));var express=require(_0xc536('0x3'));var router=express[_0xc536('0x4')]();var auth=require(_0xc536('0x5'));var interaction=require(_0xc536('0x6'));var config=require(_0xc536('0x7'));var controller=require(_0xc536('0x8'));router[_0xc536('0x9')]('/',auth[_0xc536('0xa')](),controller['index']);router['get'](_0xc536('0xb'),auth[_0xc536('0xa')](),controller[_0xc536('0xc')]);router[_0xc536('0x9')](_0xc536('0xd'),auth[_0xc536('0xa')](),controller['getSounds']);router['post']('/',auth[_0xc536('0xa')](),controller[_0xc536('0xe')]);router[_0xc536('0xf')](_0xc536('0xd'),auth['isAuthenticated'](),controller[_0xc536('0x10')]);router['put']('/:id',auth[_0xc536('0xa')](),controller[_0xc536('0x11')]);router['delete'](_0xc536('0xb'),auth[_0xc536('0xa')](),controller[_0xc536('0x12')]);router[_0xc536('0x13')](_0xc536('0x14'),auth[_0xc536('0xa')](),controller[_0xc536('0x15')]);module[_0xc536('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
index efa2630..25adad7 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5242=['sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','mp3','alpha','BOOLEAN'];(function(_0x5183aa,_0x54277c){var _0x73ac67=function(_0x14759c){while(--_0x14759c){_0x5183aa['push'](_0x5183aa['shift']());}};_0x73ac67(++_0x54277c);}(_0x5242,0x1a4));var _0x2524=function(_0x534314,_0x22687e){_0x534314=_0x534314-0x0;var _0x5866e4=_0x5242[_0x534314];return _0x5866e4;};'use strict';var Sequelize=require(_0x2524('0x0'));module[_0x2524('0x1')]={'name':{'type':Sequelize[_0x2524('0x2')],'allowNull':![],'unique':_0x2524('0x3')},'mode':{'type':Sequelize[_0x2524('0x4')](_0x2524('0x5'),_0x2524('0x6'),_0x2524('0x7'),_0x2524('0x8'),'quietmp3',_0x2524('0x9')),'allowNull':!![],'defaultValue':_0x2524('0x6')},'directory':{'type':Sequelize[_0x2524('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x2524('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2524('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2524('0xa')},'format':{'type':Sequelize[_0x2524('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x2524('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4cb1=['quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb'];(function(_0x27f71d,_0x5a1c15){var _0x147961=function(_0x43e957){while(--_0x43e957){_0x27f71d['push'](_0x27f71d['shift']());}};_0x147961(++_0x5a1c15);}(_0x4cb1,0xae));var _0x14cb=function(_0x1b49db,_0x1b3097){_0x1b49db=_0x1b49db-0x0;var _0x144279=_0x4cb1[_0x1b49db];return _0x144279;};'use strict';var Sequelize=require(_0x14cb('0x0'));module[_0x14cb('0x1')]={'name':{'type':Sequelize[_0x14cb('0x2')],'allowNull':![],'unique':_0x14cb('0x3')},'mode':{'type':Sequelize[_0x14cb('0x4')](_0x14cb('0x5'),_0x14cb('0x6'),_0x14cb('0x7'),_0x14cb('0x8'),_0x14cb('0x9'),'mp3'),'allowNull':!![],'defaultValue':_0x14cb('0x6')},'directory':{'type':Sequelize[_0x14cb('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x14cb('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x14cb('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x14cb('0x2')],'allowNull':!![],'defaultValue':_0x14cb('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x14cb('0xb')},'defaultEntry':{'type':Sequelize[_0x14cb('0xc')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
index e205592..385d185 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['stack','name','send','VoiceMusicOnHold','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','Sequelize','removeSound','Sound','getSounds','rawAttributes','pick','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error'];(function(_0x5ac99a,_0x3fd986){var _0x2af49b=function(_0x41c082){while(--_0x41c082){_0x5ac99a['push'](_0x5ac99a['shift']());}};_0x2af49b(++_0x3fd986);}(_0xb10b,0x12a));var _0xbb10=function(_0x36f5ae,_0x53960b){_0x36f5ae=_0x36f5ae-0x0;var _0x10c86c=_0xb10b[_0x36f5ae];return _0x10c86c;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){var _0x317da4=_0x8e2b97[_0xbb10('0x25')]({'plain':!![]});var _0x1824b7=_0xbb10('0x26');return db[_0xbb10('0x27')][_0xbb10('0x24')]({'where':{'type':_0x1824b7,'resourceId':_0x317da4['id']}})[_0xbb10('0x23')](function(){return _0x8e2b97;});})[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x18')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x28')](_0x2fdde9[_0xbb10('0x29')]);if(_0x2fdde9[_0xbb10('0x2a')]){delete _0x2fdde9[_0xbb10('0x2a')];}_0x2c89b9[_0xbb10('0x19')](_0x4e25ff)[_0xbb10('0x2b')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2c')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2d')][_0xbb10('0x2e')]};});_0x2e0249[_0xbb10('0x2f')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],qs['fields'](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x35')]));_0xfc3595[_0xbb10('0x34')]=_0xfc3595[_0xbb10('0x34')][_0xbb10('0x36')]?_0xfc3595[_0xbb10('0x34')]:_0x2e0249[_0xbb10('0x2f')];if(!_0x3796c7[_0xbb10('0x30')][_0xbb10('0x37')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x1d')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x39')]);_0xfc3595[_0xbb10('0x3a')]=qs[_0xbb10('0x32')](_['pick'](_0x3796c7[_0xbb10('0x30')],_0x2e0249[_0xbb10('0x32')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3b')](_0xfc3595[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3c')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2d')]!==_0xbb10('0x3d')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3b')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3f')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x3a')]};return db[_0xbb10('0x2c')]['count'](_0x4f1cdd)[_0xbb10('0x23')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1c')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x30')][_0xbb10('0x40')]){_0xfc3595[_0xbb10('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xbb10('0x42')](_0xfc3595);})[_0xbb10('0x23')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x43')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x44')](handleError(_0x21ac54,null));};exports[_0xbb10('0x45')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x46')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2c')]['rawAttributes']);_0x351484[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x23dc18['query']);_0x351484[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],qs[_0xbb10('0x35')](_0x23dc18[_0xbb10('0x30')][_0xbb10('0x35')]));_0x5e2cfa[_0xbb10('0x34')]=_0x5e2cfa[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5e2cfa[_0xbb10('0x34')]:_0x351484[_0xbb10('0x2f')];if(_0x23dc18[_0xbb10('0x30')]['includeAll']){_0x5e2cfa[_0xbb10('0x41')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3b')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2c')][_0xbb10('0x47')](_0x5e2cfa)[_0xbb10('0x23')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x23')](respondWithResult(_0x403beb,null))[_0xbb10('0x44')](handleError(_0x403beb,null));};exports[_0xbb10('0x48')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x44')](handleError(_0x5be85e,null));};exports[_0xbb10('0x4a')]=function(_0x22b315,_0x2f2552,_0x460788){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x550111){if(_0x22b315['body'][_0xbb10('0x4d')]===_0xbb10('0x4e')){_0x22b315[_0xbb10('0x49')][_0xbb10('0x4f')]=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x52'),_0x22b315[_0xbb10('0x49')][_0xbb10('0x2a')]);}return db[_0xbb10('0x2c')][_0xbb10('0x4a')](_0x22b315[_0xbb10('0x49')],{'transaction':_0x550111})[_0xbb10('0x23')](function(_0x2e6fd9){if(_0x22b315[_0xbb10('0x49')]['mode']===_0xbb10('0x4e')){fs['mkdirSync'](_0x2e6fd9[_0xbb10('0x4f')],parseInt(_0xbb10('0x53'),0x8));}var _0x1ffe20=_0x22b315[_0xbb10('0x54')][_0xbb10('0x25')]({'plain':!![]});if(!_0x1ffe20)throw new Error(_0xbb10('0x55'));if(_0x1ffe20[_0xbb10('0x56')]===_0xbb10('0x54')){var _0x180400=_0x2e6fd9[_0xbb10('0x25')]({'plain':!![]});return db[_0xbb10('0x57')][_0xbb10('0x47')]({'where':{'name':_0xbb10('0x26'),'userProfileId':_0x1ffe20[_0xbb10('0x58')]},'raw':!![]})[_0xbb10('0x23')](function(_0x5de0cc){if(_0x5de0cc&&_0x5de0cc[_0xbb10('0x59')]===0x0){return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'name':_0x180400[_0xbb10('0x2a')],'resourceId':_0x180400['id'],'type':_0x5de0cc[_0xbb10('0x2a')],'sectionId':_0x5de0cc['id']},{})[_0xbb10('0x23')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})['catch'](function(_0x120bda){logger[_0xbb10('0x28')](_0xbb10('0x5a'),_0x120bda);});}return _0x2e6fd9;});})[_0xbb10('0x23')](respondWithResult(_0x2f2552,0xc9))[_0xbb10('0x44')](handleError(_0x2f2552,null));};exports[_0xbb10('0x24')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb;return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x175872[_0xbb10('0x46')]['id']}})['then'](function(_0x4ea1a6){if(_0x4ea1a6){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x3d0cb7){return _0x4ea1a6[_0xbb10('0x24')]({'transaction':_0x3d0cb7,'raw':!![]})['then'](function(_0x506498){if(_0x506498[_0xbb10('0x4f')]){fs[_0xbb10('0x5b')](_0x506498[_0xbb10('0x4f')])[_0xbb10('0x5c')](function(_0x412f13){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x506498['directory'],_0x412f13));});fs[_0xbb10('0x5e')](_0x506498[_0xbb10('0x4f')]);}return _0x506498;});})['catch'](function(_0x5e03cb){throw new db['Sequelize'][(_0xbb10('0x5f'))](_0x5e03cb[_0xbb10('0x60')]);});}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))['then'](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['addSound']=function(_0x3ebc5f,_0x249b33,_0x45167a){return db['sequelize'][_0xbb10('0x4c')](function(_0x13131c){var _0x5a6538;return db['VoiceMusicOnHold'][_0xbb10('0x47')]({'where':{'id':_0x3ebc5f[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x5a6538=_0x237246;return _0x237246['addSound'](_0x3ebc5f[_0xbb10('0x49')]['id'],{'transaction':_0x13131c});}})[_0xbb10('0x23')](function(_0xa7179d){if(_0xa7179d){return db['Sound'][_0xbb10('0x61')]({'where':{'id':_0x3ebc5f[_0xbb10('0x49')]['id']},'attributes':['id',_0xbb10('0x2a'),'save_name',_0xbb10('0x62'),_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x37b65f){if(_0x37b65f){var _0x5e4a6e=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x64'),util[_0xbb10('0x65')]('%s.%s',path[_0xbb10('0x66')](_0x37b65f[_0xbb10('0x67')],path[_0xbb10('0x68')](_0x37b65f[_0xbb10('0x67')])),_0x37b65f[_0xbb10('0x62')]));var _0x17807e=path[_0xbb10('0x50')](config['root'],'server/files/moh',_0x5a6538['name'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x37b65f[_0xbb10('0x2a')],_0x37b65f['converted_format']));fs['symlinkSync'](_0x5e4a6e,_0x17807e);return _0x37b65f;}})[_0xbb10('0x44')](function(_0x1b11c0){throw new db[(_0xbb10('0x6a'))][(_0xbb10('0x5f'))](_0x1b11c0[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x249b33,null))['then'](respondWithResult(_0x249b33,0xc9))[_0xbb10('0x44')](handleError(_0x249b33,null));};exports[_0xbb10('0x6b')]=function(_0x270fdb,_0x14f16b,_0x2aaaa6){return db['sequelize']['transaction'](function(_0x5ad6ad){var _0x329da7;return db[_0xbb10('0x2c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](function(_0x5d942d){if(_0x5d942d){_0x329da7=_0x5d942d;return _0x5d942d[_0xbb10('0x6b')](_0x270fdb['params']['id2']);}})['then'](function(_0xdf634f){if(_0xdf634f){return db[_0xbb10('0x6c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id2']},'attributes':['id',_0xbb10('0x2a'),'save_name','converted_format',_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x29529c){if(_0x29529c){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x329da7['directory'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x29529c[_0xbb10('0x2a')],_0x29529c[_0xbb10('0x62')])));return _0x29529c;}})[_0xbb10('0x44')](function(_0x27f42f){throw new db[(_0xbb10('0x6a'))]['ValidationError'](_0x27f42f[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](respondWithStatusCode(_0x14f16b,0xcc))[_0xbb10('0x44')](handleError(_0x14f16b,null));};exports[_0xbb10('0x6d')]=function(_0x172be3,_0xa3b23,_0x312a08){var _0x5a4429={};var _0x428146={};var _0x218690;var _0x145baf;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x172be3['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xa3b23,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){_0x218690=_0x4e3d6a;_0x428146[_0xbb10('0x2f')]=_[_0xbb10('0x31')](db[_0xbb10('0x6c')][_0xbb10('0x6e')]);_0x428146[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x172be3[_0xbb10('0x30')]);_0x428146[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x428146['model'],_0x428146[_0xbb10('0x30')]);_0x5a4429[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x428146[_0xbb10('0x2f')],qs['fields'](_0x172be3['query'][_0xbb10('0x35')]));_0x5a4429[_0xbb10('0x34')]=_0x5a4429[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5a4429['attributes']:_0x428146[_0xbb10('0x2f')];_0x5a4429[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x39')]);_0x5a4429['where']=qs['filters'](_[_0xbb10('0x6f')](_0x172be3[_0xbb10('0x30')],_0x428146[_0xbb10('0x32')]));if(_0x172be3['query'][_0xbb10('0x3e')]){_0x5a4429[_0xbb10('0x3a')]=_['merge'](_0x5a4429['where'],{'$or':_[_0xbb10('0x3c')](_0x5a4429[_0xbb10('0x34')],function(_0x177f77){var _0x4d64ff={};_0x4d64ff[_0x177f77]={'$like':'%'+_0x172be3[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4d64ff;})});}_0x5a4429=_[_0xbb10('0x3b')]({},_0x5a4429,_0x172be3[_0xbb10('0x3f')]);return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x45bd4e){if(_0x45bd4e){_0x145baf=_0x45bd4e[_0xbb10('0x36')];if(!_0x172be3[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x70'))){_0x5a4429[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x5a4429[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1d')]);}return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x2a4278){if(_0x2a4278){return _0x2a4278?{'count':_0x145baf,'rows':_0x2a4278}:null;}})['then'](respondWithResult(_0xa3b23,null))['catch'](handleError(_0xa3b23,null));};
\ No newline at end of file
+var _0xd8b0=['map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','VoiceMusicOnHold','count','includeAll','include','findAll','rows','catch','params','keys','find','body','create','transaction','mode','directory','join','root','server/files/moh','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','sequelize','forEach','unlinkSync','rmdirSync','Sequelize','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','save_name','symlinkSync','ValidationError','removeSound','id2','message','getSounds','options','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','name','send'];(function(_0x209711,_0x374010){var _0x42eeaf=function(_0x94fcb8){while(--_0x94fcb8){_0x209711['push'](_0x209711['shift']());}};_0x42eeaf(++_0x374010);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){var _0x2b924f=_0x56c729[_0x0d8b('0x23')]({'plain':!![]});var _0x38efc8=_0x0d8b('0x24');return db[_0x0d8b('0x25')][_0x0d8b('0x26')]({'where':{'type':_0x38efc8,'resourceId':_0x2b924f['id']}})[_0x0d8b('0x22')](function(){return _0x56c729;});})[_0x0d8b('0x22')](function(){_0x33fb87['status'](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x4463ee,_0x5363e3){return function(_0xe1ef20){if(!_0xe1ef20){_0x4463ee['sendStatus'](0x194);}return _0xe1ef20;};}function handleError(_0x3dd149,_0x234bdd){_0x234bdd=_0x234bdd||0x1f4;return function(_0xa2af02){logger['error'](_0xa2af02['stack']);if(_0xa2af02[_0x0d8b('0x27')]){delete _0xa2af02[_0x0d8b('0x27')];}_0x3dd149['status'](_0x234bdd)[_0x0d8b('0x28')](_0xa2af02);};}exports['index']=function(_0x1b2b59,_0x4b59e5){var _0x97050a={},_0x48f24f={},_0x2ab00d={'count':0x0,'rows':[]};var _0x546bf6=_[_0x0d8b('0x29')](db['VoiceMusicOnHold'][_0x0d8b('0x2a')],function(_0x106e4c){return{'name':_0x106e4c[_0x0d8b('0x2b')],'type':_0x106e4c['type']['key']};});_0x48f24f['model']=_[_0x0d8b('0x29')](_0x546bf6,'name');_0x48f24f[_0x0d8b('0x2c')]=_['keys'](_0x1b2b59['query']);_0x48f24f[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],_0x48f24f[_0x0d8b('0x2c')]);_0x97050a[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],qs[_0x0d8b('0x31')](_0x1b2b59['query'][_0x0d8b('0x31')]));_0x97050a[_0x0d8b('0x30')]=_0x97050a['attributes'][_0x0d8b('0x32')]?_0x97050a[_0x0d8b('0x30')]:_0x48f24f[_0x0d8b('0x2f')];if(!_0x1b2b59['query'][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x97050a[_0x0d8b('0x1b')]=qs[_0x0d8b('0x1b')](_0x1b2b59[_0x0d8b('0x2c')]['limit']);_0x97050a[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x1b2b59['query'][_0x0d8b('0x1a')]);}_0x97050a[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x36')]);_0x97050a['where']=qs['filters'](_[_0x0d8b('0x37')](_0x1b2b59['query'],_0x48f24f['filters']),_0x546bf6);if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x97050a[_0x0d8b('0x39')]=_[_0x0d8b('0x3a')](_0x97050a[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x546bf6,function(_0x579324){if(_0x579324[_0x0d8b('0x3b')]!==_0x0d8b('0x3c')){var _0x28fd82={};_0x28fd82[_0x579324[_0x0d8b('0x27')]]={'$like':'%'+_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x28fd82;}})});}_0x97050a=_[_0x0d8b('0x3a')]({},_0x97050a,_0x1b2b59['options']);var _0x1d06b6={'where':_0x97050a[_0x0d8b('0x39')]};return db[_0x0d8b('0x3d')][_0x0d8b('0x3e')](_0x1d06b6)['then'](function(_0xe0bf42){_0x2ab00d['count']=_0xe0bf42;if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x3f')]){_0x97050a[_0x0d8b('0x40')]=[{'all':!![]}];}return db[_0x0d8b('0x3d')][_0x0d8b('0x41')](_0x97050a);})[_0x0d8b('0x22')](function(_0x1ff17d){_0x2ab00d[_0x0d8b('0x42')]=_0x1ff17d;return _0x2ab00d;})[_0x0d8b('0x22')](respondWithFilteredResult(_0x4b59e5,_0x97050a))[_0x0d8b('0x43')](handleError(_0x4b59e5,null));};exports['show']=function(_0x571acf,_0x576050){var _0x4d0811={'raw':![],'where':{'id':_0x571acf[_0x0d8b('0x44')]['id']}},_0x524d79={};_0x524d79[_0x0d8b('0x2f')]=_[_0x0d8b('0x45')](db['VoiceMusicOnHold']['rawAttributes']);_0x524d79[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x571acf[_0x0d8b('0x2c')]);_0x524d79['filters']=_[_0x0d8b('0x2e')](_0x524d79[_0x0d8b('0x2f')],_0x524d79['query']);_0x4d0811['attributes']=_[_0x0d8b('0x2e')](_0x524d79['model'],qs[_0x0d8b('0x31')](_0x571acf['query']['fields']));_0x4d0811[_0x0d8b('0x30')]=_0x4d0811[_0x0d8b('0x30')]['length']?_0x4d0811['attributes']:_0x524d79['model'];if(_0x571acf['query'][_0x0d8b('0x3f')]){_0x4d0811[_0x0d8b('0x40')]=[{'all':!![]}];}_0x4d0811=_[_0x0d8b('0x3a')]({},_0x4d0811,_0x571acf['options']);return db[_0x0d8b('0x3d')][_0x0d8b('0x46')](_0x4d0811)[_0x0d8b('0x22')](handleEntityNotFound(_0x576050,null))[_0x0d8b('0x22')](respondWithResult(_0x576050,null))[_0x0d8b('0x43')](handleError(_0x576050,null));};exports[_0x0d8b('0x21')]=function(_0x11d22b,_0x1d5067){if(_0x11d22b[_0x0d8b('0x47')]['id']){delete _0x11d22b[_0x0d8b('0x47')]['id'];}return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x11d22b[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x1d5067,null))[_0x0d8b('0x22')](saveUpdates(_0x11d22b[_0x0d8b('0x47')],null))[_0x0d8b('0x22')](respondWithResult(_0x1d5067,null))[_0x0d8b('0x43')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x48')]=function(_0x574b90,_0x371fa0,_0x4d8850){return db['sequelize'][_0x0d8b('0x49')](function(_0x113fb7){if(_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4a')]==='files'){_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4b')]=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x4e'),_0x574b90['body']['name']);}return db['VoiceMusicOnHold']['create'](_0x574b90[_0x0d8b('0x47')],{'transaction':_0x113fb7})[_0x0d8b('0x22')](function(_0x5e3bb4){if(_0x574b90['body'][_0x0d8b('0x4a')]===_0x0d8b('0x4f')){fs['mkdirSync'](_0x5e3bb4['directory'],parseInt(_0x0d8b('0x50'),0x8));}var _0xeeefd4=_0x574b90[_0x0d8b('0x51')][_0x0d8b('0x23')]({'plain':!![]});if(!_0xeeefd4)throw new Error(_0x0d8b('0x52'));if(_0xeeefd4['role']===_0x0d8b('0x51')){var _0x2afe34=_0x5e3bb4['get']({'plain':!![]});return db['UserProfileSection'][_0x0d8b('0x46')]({'where':{'name':_0x0d8b('0x24'),'userProfileId':_0xeeefd4['userProfileId']},'raw':!![]})['then'](function(_0xb8be3b){if(_0xb8be3b&&_0xb8be3b[_0x0d8b('0x53')]===0x0){return db[_0x0d8b('0x25')][_0x0d8b('0x48')]({'name':_0x2afe34['name'],'resourceId':_0x2afe34['id'],'type':_0xb8be3b[_0x0d8b('0x27')],'sectionId':_0xb8be3b['id']},{})['then'](function(){return _0x5e3bb4;});}else{return _0x5e3bb4;}})['catch'](function(_0x38c24e){logger[_0x0d8b('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38c24e);});}return _0x5e3bb4;});})['then'](respondWithResult(_0x371fa0,0xc9))[_0x0d8b('0x43')](handleError(_0x371fa0,null));};exports[_0x0d8b('0x26')]=function(_0xccc2a9,_0x2c1eb0,_0x3afc3a){var _0xb66e76;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0xccc2a9['params']['id']}})[_0x0d8b('0x22')](function(_0x37dc9f){if(_0x37dc9f){return db[_0x0d8b('0x55')][_0x0d8b('0x49')](function(_0x3fb9ea){return _0x37dc9f[_0x0d8b('0x26')]({'transaction':_0x3fb9ea,'raw':!![]})[_0x0d8b('0x22')](function(_0x1c78b6){if(_0x1c78b6[_0x0d8b('0x4b')]){fs['readdirSync'](_0x1c78b6[_0x0d8b('0x4b')])[_0x0d8b('0x56')](function(_0x180b7b){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x1c78b6['directory'],_0x180b7b));});fs[_0x0d8b('0x58')](_0x1c78b6[_0x0d8b('0x4b')]);}return _0x1c78b6;});})[_0x0d8b('0x43')](function(_0x17a87f){throw new db[(_0x0d8b('0x59'))]['ValidationError'](_0x17a87f['message']);});}})[_0x0d8b('0x22')](handleEntityNotFound(_0x2c1eb0,null))[_0x0d8b('0x22')](removeEntity(_0x2c1eb0,null))[_0x0d8b('0x43')](handleError(_0x2c1eb0,null));};exports[_0x0d8b('0x5a')]=function(_0x5a70bd,_0x199122,_0x12aef7){return db[_0x0d8b('0x55')]['transaction'](function(_0x2f19f4){var _0x532a85;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x5a70bd[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](function(_0x2b6eb6){if(_0x2b6eb6){_0x532a85=_0x2b6eb6;return _0x2b6eb6[_0x0d8b('0x5a')](_0x5a70bd['body']['id'],{'transaction':_0x2f19f4});}})[_0x0d8b('0x22')](function(_0x4c074d){if(_0x4c074d){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x5a70bd[_0x0d8b('0x47')]['id']},'attributes':['id',_0x0d8b('0x27'),'save_name',_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2332fc){if(_0x2332fc){var _0x2ccdae=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x5f'),util[_0x0d8b('0x60')](_0x0d8b('0x61'),path['basename'](_0x2332fc['save_name'],path[_0x0d8b('0x62')](_0x2332fc[_0x0d8b('0x63')])),_0x2332fc['converted_format']));var _0xb1aa96=path['join'](config['root'],_0x0d8b('0x4e'),_0x532a85[_0x0d8b('0x27')],util['format']('%s.%s',_0x2332fc[_0x0d8b('0x27')],_0x2332fc[_0x0d8b('0x5d')]));fs[_0x0d8b('0x64')](_0x2ccdae,_0xb1aa96);return _0x2332fc;}})[_0x0d8b('0x43')](function(_0x2ab72b){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x2ab72b['message']);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x199122,null))['then'](respondWithResult(_0x199122,0xc9))[_0x0d8b('0x43')](handleError(_0x199122,null));};exports[_0x0d8b('0x66')]=function(_0x2bb690,_0x14a34b,_0x49f610){return db[_0x0d8b('0x55')]['transaction'](function(_0x3a356b){var _0x2c6c5f;return db[_0x0d8b('0x3d')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](function(_0x91aa89){if(_0x91aa89){_0x2c6c5f=_0x91aa89;return _0x91aa89[_0x0d8b('0x66')](_0x2bb690[_0x0d8b('0x44')]['id2']);}})[_0x0d8b('0x22')](function(_0x54c28b){if(_0x54c28b){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690['params'][_0x0d8b('0x67')]},'attributes':['id','name',_0x0d8b('0x63'),_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2242cd){if(_0x2242cd){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x2c6c5f[_0x0d8b('0x4b')],util['format'](_0x0d8b('0x61'),_0x2242cd[_0x0d8b('0x27')],_0x2242cd['converted_format'])));return _0x2242cd;}})[_0x0d8b('0x43')](function(_0x105df9){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x105df9[_0x0d8b('0x68')]);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](respondWithStatusCode(_0x14a34b,0xcc))[_0x0d8b('0x43')](handleError(_0x14a34b,null));};exports[_0x0d8b('0x69')]=function(_0x5007c0,_0xe35028,_0x16df83){var _0x50c0ff={};var _0x1ece98={};var _0x93fc55;var _0x3acffa;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5007c0[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0xe35028,null))[_0x0d8b('0x22')](function(_0x5b76af){if(_0x5b76af){_0x93fc55=_0x5b76af;_0x1ece98['model']=_[_0x0d8b('0x45')](db[_0x0d8b('0x5b')][_0x0d8b('0x2a')]);_0x1ece98[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x5007c0[_0x0d8b('0x2c')]);_0x1ece98[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],_0x1ece98[_0x0d8b('0x2c')]);_0x50c0ff[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],qs['fields'](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x31')]));_0x50c0ff['attributes']=_0x50c0ff['attributes'][_0x0d8b('0x32')]?_0x50c0ff[_0x0d8b('0x30')]:_0x1ece98[_0x0d8b('0x2f')];_0x50c0ff[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x5007c0[_0x0d8b('0x2c')]['sort']);_0x50c0ff['where']=qs['filters'](_[_0x0d8b('0x37')](_0x5007c0[_0x0d8b('0x2c')],_0x1ece98[_0x0d8b('0x2d')]));if(_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x50c0ff[_0x0d8b('0x39')]=_['merge'](_0x50c0ff[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x50c0ff['attributes'],function(_0x30a69d){var _0x57e3c2={};_0x57e3c2[_0x30a69d]={'$like':'%'+_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x57e3c2;})});}_0x50c0ff=_[_0x0d8b('0x3a')]({},_0x50c0ff,_0x5007c0[_0x0d8b('0x6a')]);return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x424f9d){if(_0x424f9d){_0x3acffa=_0x424f9d[_0x0d8b('0x32')];if(!_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x50c0ff[_0x0d8b('0x1b')]=qs['limit'](_0x5007c0['query'][_0x0d8b('0x1b')]);_0x50c0ff[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x54674f){if(_0x54674f){return _0x54674f?{'count':_0x3acffa,'rows':_0x54674f}:null;}})[_0x0d8b('0x22')](respondWithResult(_0xe35028,null))['catch'](handleError(_0xe35028,null));};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
index 444ed5a..91d4bfd 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4f75=['VoiceMusicOnHold','voice_musiconhold','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfcbf57,_0x4b05fd){var _0x1078fa=function(_0xb65856){while(--_0xb65856){_0xfcbf57['push'](_0xfcbf57['shift']());}};_0x1078fa(++_0x4b05fd);}(_0x4f75,0x1e6));var _0x54f7=function(_0x2ff497,_0x5a1137){_0x2ff497=_0x2ff497-0x0;var _0x95778a=_0x4f75[_0x2ff497];return _0x95778a;};'use strict';var _=require(_0x54f7('0x0'));var util=require(_0x54f7('0x1'));var logger=require('../../config/logger')(_0x54f7('0x2'));var moment=require(_0x54f7('0x3'));var BPromise=require(_0x54f7('0x4'));var rp=require(_0x54f7('0x5'));var fs=require('fs');var path=require(_0x54f7('0x6'));var rimraf=require(_0x54f7('0x7'));var config=require(_0x54f7('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x261095,_0x510358){return _0x261095['define'](_0x54f7('0x9'),attributes,{'tableName':_0x54f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0cbb=['define','voice_musiconhold','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x246a10,_0x588a45){var _0x91df47=function(_0x2421b8){while(--_0x2421b8){_0x246a10['push'](_0x246a10['shift']());}};_0x91df47(++_0x588a45);}(_0x0cbb,0x12d));var _0xb0cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cbb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb0cb('0x0'));var util=require('util');var logger=require(_0xb0cb('0x1'))(_0xb0cb('0x2'));var moment=require(_0xb0cb('0x3'));var BPromise=require(_0xb0cb('0x4'));var rp=require(_0xb0cb('0x5'));var fs=require('fs');var path=require(_0xb0cb('0x6'));var rimraf=require(_0xb0cb('0x7'));var config=require(_0xb0cb('0x8'));var attributes=require(_0xb0cb('0x9'));module[_0xb0cb('0xa')]=function(_0x54e0dd,_0x3cc510){return _0x54e0dd[_0xb0cb('0xb')]('VoiceMusicOnHold',attributes,{'tableName':_0xb0cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
index 7a4868d..2438a51 100644
--- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
+++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4237=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','VoiceMusicOnHold,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4237,0x1b3));var _0x7423=function(_0x4a8a92,_0x4d3a85){_0x4a8a92=_0x4a8a92-0x0;var _0x30585f=_0x4237[_0x4a8a92];return _0x30585f;};'use strict';var _=require(_0x7423('0x0'));var util=require('util');var moment=require(_0x7423('0x1'));var BPromise=require(_0x7423('0x2'));var rs=require(_0x7423('0x3'));var fs=require('fs');var Redis=require(_0x7423('0x4'));var db=require(_0x7423('0x5'))['db'];var utils=require(_0x7423('0x6'));var logger=require(_0x7423('0x7'))(_0x7423('0x8'));var config=require(_0x7423('0x9'));var jayson=require(_0x7423('0xa'));var client=jayson[_0x7423('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28f073,_0x146857,_0x512732){return new BPromise(function(_0x42b947,_0x3150dc){return client[_0x7423('0xc')](_0x28f073,_0x512732)['then'](function(_0x28b82c){logger['info'](_0x7423('0xd'),_0x146857,'request\x20sent');logger[_0x7423('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x146857,'request\x20sent',JSON[_0x7423('0xf')](_0x28b82c));if(_0x28b82c[_0x7423('0x10')]){if(_0x28b82c['error'][_0x7423('0x11')]===0x1f4){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x146857,_0x28b82c[_0x7423('0x10')][_0x7423('0x12')]);return _0x3150dc(_0x28b82c[_0x7423('0x10')][_0x7423('0x12')]);}logger[_0x7423('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x146857,_0x28b82c[_0x7423('0x10')][_0x7423('0x12')]);return _0x42b947(_0x28b82c[_0x7423('0x10')][_0x7423('0x12')]);}else{logger[_0x7423('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x146857,'request\x20sent');_0x42b947(_0x28b82c['result'][_0x7423('0x12')]);}})[_0x7423('0x14')](function(_0x1540ff){logger[_0x7423('0x10')](_0x7423('0xd'),_0x146857,_0x1540ff);_0x3150dc(_0x1540ff);});});}
\ No newline at end of file
+var _0x8567=['then','info','request\x20sent','error','code','message','VoiceMusicOnHold,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8567,0x144));var _0x7856=function(_0xf4fbc3,_0x4111ad){_0xf4fbc3=_0xf4fbc3-0x0;var _0x49a541=_0x8567[_0xf4fbc3];return _0x49a541;};'use strict';var _=require(_0x7856('0x0'));var util=require('util');var moment=require(_0x7856('0x1'));var BPromise=require(_0x7856('0x2'));var rs=require(_0x7856('0x3'));var fs=require('fs');var Redis=require(_0x7856('0x4'));var db=require(_0x7856('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7856('0x6'))(_0x7856('0x7'));var config=require(_0x7856('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7856('0x9')][_0x7856('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x93120b,_0x2fb038,_0x2b6ed3){return new BPromise(function(_0x5565df,_0x4e518f){return client[_0x7856('0xb')](_0x93120b,_0x2b6ed3)[_0x7856('0xc')](function(_0x452c67){logger[_0x7856('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2fb038,_0x7856('0xe'));logger['debug']('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2fb038,'request\x20sent',JSON['stringify'](_0x452c67));if(_0x452c67[_0x7856('0xf')]){if(_0x452c67[_0x7856('0xf')][_0x7856('0x10')]===0x1f4){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2fb038,_0x452c67[_0x7856('0xf')][_0x7856('0x11')]);return _0x4e518f(_0x452c67[_0x7856('0xf')][_0x7856('0x11')]);}logger[_0x7856('0xf')](_0x7856('0x12'),_0x2fb038,_0x452c67[_0x7856('0xf')][_0x7856('0x11')]);return _0x5565df(_0x452c67[_0x7856('0xf')][_0x7856('0x11')]);}else{logger[_0x7856('0xd')](_0x7856('0x12'),_0x2fb038,_0x7856('0xe'));_0x5565df(_0x452c67[_0x7856('0x13')]['message']);}})[_0x7856('0x14')](function(_0x480346){logger[_0x7856('0xf')](_0x7856('0x12'),_0x2fb038,_0x480346);_0x4e518f(_0x480346);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js
index 77f6455..fb427d3 100644
--- a/server/api/voicePrefix/index.js
+++ b/server/api/voicePrefix/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x598d=['/describe','describe','show','/:id/users','create','post','/:id','delete','destroy','removeAgents','exports','multer','util','connect-timeout','express','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index'];(function(_0x29f95e,_0x5b5277){var _0x187daf=function(_0x5b8bd4){while(--_0x5b8bd4){_0x29f95e['push'](_0x29f95e['shift']());}};_0x187daf(++_0x5b5277);}(_0x598d,0x1c3));var _0xd598=function(_0xd2f750,_0x143f2a){_0xd2f750=_0xd2f750-0x0;var _0x515863=_0x598d[_0xd2f750];return _0x515863;};'use strict';var multer=require(_0xd598('0x0'));var util=require(_0xd598('0x1'));var path=require('path');var timeout=require(_0xd598('0x2'));var express=require(_0xd598('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd598('0x4'));var controller=require(_0xd598('0x5'));router[_0xd598('0x6')]('/',auth[_0xd598('0x7')](),controller[_0xd598('0x8')]);router[_0xd598('0x6')](_0xd598('0x9'),auth[_0xd598('0x7')](),controller[_0xd598('0xa')]);router[_0xd598('0x6')]('/:id',auth[_0xd598('0x7')](),controller[_0xd598('0xb')]);router[_0xd598('0x6')](_0xd598('0xc'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xd598('0x7')](),controller[_0xd598('0xd')]);router[_0xd598('0xe')](_0xd598('0xc'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xd598('0xf'),auth[_0xd598('0x7')](),controller['update']);router[_0xd598('0x10')](_0xd598('0xf'),auth[_0xd598('0x7')](),controller[_0xd598('0x11')]);router[_0xd598('0x10')]('/:id/users',auth[_0xd598('0x7')](),controller[_0xd598('0x12')]);module[_0xd598('0x13')]=router;
\ No newline at end of file
+var _0xef0f=['delete','destroy','removeAgents','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','/describe','describe','show','/:id/users','getAgents','create','post','put','/:id','update'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xef0f,0x163));var _0xfef0=function(_0x1bca89,_0x555310){_0x1bca89=_0x1bca89-0x0;var _0x28f163=_0xef0f[_0x1bca89];return _0x28f163;};'use strict';var multer=require(_0xfef0('0x0'));var util=require(_0xfef0('0x1'));var path=require(_0xfef0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfef0('0x3')]();var auth=require(_0xfef0('0x4'));var interaction=require(_0xfef0('0x5'));var config=require('../../config/environment');var controller=require(_0xfef0('0x6'));router[_0xfef0('0x7')]('/',auth[_0xfef0('0x8')](),controller['index']);router['get'](_0xfef0('0x9'),auth[_0xfef0('0x8')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x7')]('/:id',auth[_0xfef0('0x8')](),controller[_0xfef0('0xb')]);router[_0xfef0('0x7')](_0xfef0('0xc'),auth[_0xfef0('0x8')](),controller[_0xfef0('0xd')]);router['post']('/',auth[_0xfef0('0x8')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')](_0xfef0('0xc'),auth['isAuthenticated'](),controller['addAgents']);router[_0xfef0('0x10')](_0xfef0('0x11'),auth[_0xfef0('0x8')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')]('/:id',auth[_0xfef0('0x8')](),controller[_0xfef0('0x14')]);router[_0xfef0('0x13')]('/:id/users',auth[_0xfef0('0x8')](),controller[_0xfef0('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js
index 73945a3..5cf1617 100644
--- a/server/api/voicePrefix/voicePrefix.attributes.js
+++ b/server/api/voicePrefix/voicePrefix.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd26=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xcd26,0x106));var _0x6cd2=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xcd26[_0x4a7843];return _0x2c57fe;};'use strict';var Sequelize=require(_0x6cd2('0x0'));module[_0x6cd2('0x1')]={'name':{'type':Sequelize[_0x6cd2('0x2')],'allowNull':![],'unique':_0x6cd2('0x3')},'prefix':{'type':Sequelize[_0x6cd2('0x4')],'get':function(_0x178c95){return _0x6cd2('0x5')+this[_0x6cd2('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0x6cd2('0x2')]},'callerIdAll':{'type':Sequelize[_0x6cd2('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x6cd2('0x7')]}};
\ No newline at end of file
+var _0xe3dc=['name','VIRTUAL','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x44c628,_0x497cef){var _0x2a7b15=function(_0x100cc8){while(--_0x100cc8){_0x44c628['push'](_0x44c628['shift']());}};_0x2a7b15(++_0x497cef);}(_0xe3dc,0x1e7));var _0xce3d=function(_0x46afbc,_0xa6aae6){_0x46afbc=_0x46afbc-0x0;var _0x3045a7=_0xe3dc[_0x46afbc];return _0x3045a7;};'use strict';var Sequelize=require(_0xce3d('0x0'));module[_0xce3d('0x1')]={'name':{'type':Sequelize[_0xce3d('0x2')],'allowNull':![],'unique':_0xce3d('0x3')},'prefix':{'type':Sequelize[_0xce3d('0x4')],'get':function(_0x457227){return'system-'+this[_0xce3d('0x5')](_0xce3d('0x3'))+'-';}},'description':{'type':Sequelize[_0xce3d('0x2')]},'callerIdAll':{'type':Sequelize[_0xce3d('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xce3d('0x6')]}};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js
index 8713df5..cae3300 100644
--- a/server/api/voicePrefix/voicePrefix.controller.js
+++ b/server/api/voicePrefix/voicePrefix.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0132=['pick','merge','type','VIRTUAL','options','VoicePrefix','count','include','findAll','catch','params','keys','includeAll','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','length','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','order','filter','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','limit','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','sort','where'];(function(_0x7e544f,_0x111b3a){var _0x2c628c=function(_0x35ef8a){while(--_0x35ef8a){_0x7e544f['push'](_0x7e544f['shift']());}};_0x2c628c(++_0x111b3a);}(_0x0132,0x1ba));var _0x2013=function(_0x3ba642,_0x5a1f17){_0x3ba642=_0x3ba642-0x0;var _0x296bb6=_0x0132[_0x3ba642];return _0x296bb6;};'use strict';var pdf=require(_0x2013('0x0'));var emlformat=require(_0x2013('0x1'));var rimraf=require(_0x2013('0x2'));var zipdir=require(_0x2013('0x3'));var jsonpatch=require(_0x2013('0x4'));var rp=require(_0x2013('0x5'));var moment=require(_0x2013('0x6'));var BPromise=require(_0x2013('0x7'));var Mustache=require(_0x2013('0x8'));var util=require('util');var path=require(_0x2013('0x9'));var sox=require(_0x2013('0xa'));var csv=require(_0x2013('0xb'));var ejs=require(_0x2013('0xc'));var fs=require('fs');var _=require(_0x2013('0xd'));var squel=require('squel');var crypto=require(_0x2013('0xe'));var jsforce=require(_0x2013('0xf'));var deskjs=require(_0x2013('0x10'));var toCsv=require(_0x2013('0xb'));var querystring=require(_0x2013('0x11'));var Papa=require(_0x2013('0x12'));var Redis=require(_0x2013('0x13'));var authService=require(_0x2013('0x14'));var qs=require(_0x2013('0x15'));var as=require(_0x2013('0x16'));var hardwareService=require(_0x2013('0x17'));var logger=require(_0x2013('0x18'))(_0x2013('0x19'));var utils=require('../../config/utils');var config=require(_0x2013('0x1a'));var db=require(_0x2013('0x1b'))['db'];config['redis']=_[_0x2013('0x1c')](config[_0x2013('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x2013('0x1e'))(new Redis(config['redis']));require(_0x2013('0x1f'))['register'](socket);function respondWithStatusCode(_0x1f1c30,_0x3ab4ee){_0x3ab4ee=_0x3ab4ee||0xcc;return function(_0xcfd3a6){if(_0xcfd3a6){return _0x1f1c30[_0x2013('0x20')](_0x3ab4ee);}return _0x1f1c30[_0x2013('0x21')](_0x3ab4ee)[_0x2013('0x22')]();};}function respondWithResult(_0x23d5f0,_0x164f4c){_0x164f4c=_0x164f4c||0xc8;return function(_0x4c06e7){if(_0x4c06e7){return _0x23d5f0[_0x2013('0x21')](_0x164f4c)[_0x2013('0x23')](_0x4c06e7);}};}function respondWithFilteredResult(_0x2db740,_0x1a0c47){return function(_0x4ece1a){if(_0x4ece1a){var _0x553599=_0x4ece1a['count'],_0x1e50a7=_0x1a0c47['offset'],_0x444b34=_0x1a0c47['offset']+_0x1a0c47[_0x2013('0x24')],_0x3b85db;if(_0x444b34>=_0x553599){_0x444b34=_0x553599;_0x3b85db=0xc8;}else{_0x3b85db=0xce;}_0x2db740[_0x2013('0x21')](_0x3b85db);return _0x2db740['set'](_0x2013('0x25'),_0x1e50a7+'-'+_0x444b34+'/'+_0x553599)[_0x2013('0x23')](_0x4ece1a);}return null;};}function patchUpdates(_0x2109c1){return function(_0x4ce84c){try{jsonpatch[_0x2013('0x26')](_0x4ce84c,_0x2109c1,!![]);}catch(_0x3ba15c){return BPromise[_0x2013('0x27')](_0x3ba15c);}return _0x4ce84c[_0x2013('0x28')]();};}function saveUpdates(_0x5d05e9,_0x3ef1b6){return function(_0x2986f7){if(_0x2986f7){return _0x2986f7[_0x2013('0x29')](_0x5d05e9)[_0x2013('0x2a')](function(_0x3ba5fc){return _0x3ba5fc;});}return null;};}function removeEntity(_0x27b3e8,_0x2a49c8){return function(_0x5ac771){if(_0x5ac771){return _0x5ac771[_0x2013('0x2b')]()[_0x2013('0x2a')](function(){var _0x18c501=_0x5ac771[_0x2013('0x2c')]({'plain':!![]});var _0x3cabeb=_0x2013('0x2d');return db[_0x2013('0x2e')][_0x2013('0x2b')]({'where':{'type':_0x3cabeb,'resourceId':_0x18c501['id']}})['then'](function(){return _0x5ac771;});})['then'](function(){_0x27b3e8['status'](0xcc)[_0x2013('0x22')]();});}};}function handleEntityNotFound(_0x50bcc6,_0x463d88){return function(_0x469290){if(!_0x469290){_0x50bcc6[_0x2013('0x20')](0x194);}return _0x469290;};}function handleError(_0x5a4491,_0x20864c){_0x20864c=_0x20864c||0x1f4;return function(_0xf898d8){logger[_0x2013('0x2f')](_0xf898d8[_0x2013('0x30')]);if(_0xf898d8[_0x2013('0x31')]){delete _0xf898d8['name'];}_0x5a4491[_0x2013('0x21')](_0x20864c)['send'](_0xf898d8);};}exports[_0x2013('0x32')]=function(_0x43526b,_0x3ca397){var _0x4f4959={},_0x414e42={},_0x2aca9b={'count':0x0,'rows':[]};var _0xd721e1=_[_0x2013('0x33')](db['VoicePrefix'][_0x2013('0x34')],function(_0x19488c){return{'name':_0x19488c[_0x2013('0x35')],'type':_0x19488c['type'][_0x2013('0x36')]};});_0x414e42[_0x2013('0x37')]=_['map'](_0xd721e1,_0x2013('0x31'));_0x414e42[_0x2013('0x38')]=_['keys'](_0x43526b[_0x2013('0x38')]);_0x414e42[_0x2013('0x39')]=_['intersection'](_0x414e42[_0x2013('0x37')],_0x414e42[_0x2013('0x38')]);_0x4f4959[_0x2013('0x3a')]=_[_0x2013('0x3b')](_0x414e42[_0x2013('0x37')],qs[_0x2013('0x3c')](_0x43526b[_0x2013('0x38')][_0x2013('0x3c')]));_0x4f4959[_0x2013('0x3a')]=_0x4f4959[_0x2013('0x3a')]['length']?_0x4f4959[_0x2013('0x3a')]:_0x414e42['model'];if(!_0x43526b['query'][_0x2013('0x3d')](_0x2013('0x3e'))){_0x4f4959[_0x2013('0x24')]=qs[_0x2013('0x24')](_0x43526b['query'][_0x2013('0x24')]);_0x4f4959[_0x2013('0x3f')]=qs['offset'](_0x43526b[_0x2013('0x38')][_0x2013('0x3f')]);}_0x4f4959['order']=qs[_0x2013('0x40')](_0x43526b[_0x2013('0x38')][_0x2013('0x40')]);_0x4f4959[_0x2013('0x41')]=qs['filters'](_[_0x2013('0x42')](_0x43526b['query'],_0x414e42[_0x2013('0x39')]),_0xd721e1);if(_0x43526b['query']['filter']){_0x4f4959[_0x2013('0x41')]=_[_0x2013('0x43')](_0x4f4959['where'],{'$or':_[_0x2013('0x33')](_0xd721e1,function(_0x4a7950){if(_0x4a7950[_0x2013('0x44')]!==_0x2013('0x45')){var _0x5509e7={};_0x5509e7[_0x4a7950[_0x2013('0x31')]]={'$like':'%'+_0x43526b['query']['filter']+'%'};return _0x5509e7;}})});}_0x4f4959=_[_0x2013('0x43')]({},_0x4f4959,_0x43526b[_0x2013('0x46')]);var _0x563f43={'where':_0x4f4959[_0x2013('0x41')]};return db[_0x2013('0x47')][_0x2013('0x48')](_0x563f43)[_0x2013('0x2a')](function(_0xd826f9){_0x2aca9b[_0x2013('0x48')]=_0xd826f9;if(_0x43526b['query']['includeAll']){_0x4f4959[_0x2013('0x49')]=[{'all':!![]}];}return db[_0x2013('0x47')][_0x2013('0x4a')](_0x4f4959);})[_0x2013('0x2a')](function(_0x44422a){_0x2aca9b['rows']=_0x44422a;return _0x2aca9b;})[_0x2013('0x2a')](respondWithFilteredResult(_0x3ca397,_0x4f4959))[_0x2013('0x4b')](handleError(_0x3ca397,null));};exports['show']=function(_0x421489,_0x40c760){var _0x2c6e5d={'raw':![],'where':{'id':_0x421489[_0x2013('0x4c')]['id']}},_0x55f013={};_0x55f013[_0x2013('0x37')]=_[_0x2013('0x4d')](db[_0x2013('0x47')][_0x2013('0x34')]);_0x55f013['query']=_['keys'](_0x421489[_0x2013('0x38')]);_0x55f013['filters']=_[_0x2013('0x3b')](_0x55f013[_0x2013('0x37')],_0x55f013['query']);_0x2c6e5d[_0x2013('0x3a')]=_['intersection'](_0x55f013[_0x2013('0x37')],qs['fields'](_0x421489[_0x2013('0x38')]['fields']));_0x2c6e5d[_0x2013('0x3a')]=_0x2c6e5d[_0x2013('0x3a')]['length']?_0x2c6e5d[_0x2013('0x3a')]:_0x55f013['model'];if(_0x421489[_0x2013('0x38')][_0x2013('0x4e')]){_0x2c6e5d[_0x2013('0x49')]=[{'all':!![]}];}_0x2c6e5d=_['merge']({},_0x2c6e5d,_0x421489['options']);return db[_0x2013('0x47')][_0x2013('0x4f')](_0x2c6e5d)[_0x2013('0x2a')](handleEntityNotFound(_0x40c760,null))[_0x2013('0x2a')](respondWithResult(_0x40c760,null))[_0x2013('0x4b')](handleError(_0x40c760,null));};exports['destroy']=function(_0x5add00,_0x4e99db){return db[_0x2013('0x47')][_0x2013('0x4f')]({'where':{'id':_0x5add00[_0x2013('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e99db,null))[_0x2013('0x2a')](removeEntity(_0x4e99db,null))[_0x2013('0x4b')](handleError(_0x4e99db,null));};exports[_0x2013('0x50')]=function(_0x328bc2,_0x11b7c3){return db[_0x2013('0x47')][_0x2013('0x50')]()[_0x2013('0x2a')](respondWithResult(_0x11b7c3,null))['catch'](handleError(_0x11b7c3,null));};exports[_0x2013('0x51')]=function(_0x5a1b40,_0x243dc5){var _0x16adf8;return db[_0x2013('0x52')][_0x2013('0x53')](function(_0x50fb9a){return db[_0x2013('0x47')][_0x2013('0x51')](_0x5a1b40[_0x2013('0x54')],{'transaction':_0x50fb9a})[_0x2013('0x2a')](function(_0x150371){_0x16adf8=_0x150371[_0x2013('0x2c')]({'plain':!![]});return db[_0x2013('0x55')][_0x2013('0x4f')]({'where':{'id':_0x16adf8[_0x2013('0x56')]},'raw':!![]})['then'](function(_0x47200a){return createVoicePrefixExtensions(_0x16adf8,_0x47200a,_0x50fb9a);});});})[_0x2013('0x2a')](function(){var _0x3e49bb=_0x5a1b40['user']['get']({'plain':!![]});if(!_0x3e49bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e49bb[_0x2013('0x57')]===_0x2013('0x58')){var _0x246b4f=_0x16adf8;return db[_0x2013('0x59')]['find']({'where':{'name':_0x2013('0x2d'),'userProfileId':_0x3e49bb[_0x2013('0x5a')]},'raw':!![]})[_0x2013('0x2a')](function(_0x5dc881){if(_0x5dc881&&_0x5dc881[_0x2013('0x5b')]===0x0){return db[_0x2013('0x2e')][_0x2013('0x51')]({'name':_0x246b4f['name'],'resourceId':_0x246b4f['id'],'type':_0x5dc881[_0x2013('0x31')],'sectionId':_0x5dc881['id']},{})[_0x2013('0x2a')](function(){return _0x16adf8;});}else{return _0x16adf8;}})['catch'](function(_0x3db572){logger[_0x2013('0x2f')](_0x2013('0x5c'),_0x3db572);throw _0x3db572;});}return _0x16adf8;})[_0x2013('0x2a')](respondWithResult(_0x243dc5,null))['catch'](handleError(_0x243dc5,null));};function Extension(_0x156b56,_0x4836f4,_0x32876f,_0x5828d3){this[_0x2013('0x5d')]=_0x2013('0x5e');this[_0x2013('0x5f')]=_0x156b56;this[_0x2013('0x60')]=_0x32876f;this[_0x2013('0x44')]='system';this['description']=_0x2013('0x61');this[_0x2013('0x62')]=_0x4836f4;this[_0x2013('0x63')]=_0x5828d3;}function createVoicePrefixExtensions(_0x1e8b61,_0xfefcc2,_0x14e155){return new BPromise(function(_0xcbb22f,_0x457c23){var _0x4f0794=new Extension(formatPrefixName(_0x1e8b61[_0x2013('0x64')]),0x1,_0x2013('0x65'),_0x2013('0x66'));_0x4f0794['VoicePrefixId']=_0x1e8b61['id'];return db[_0x2013('0x55')][_0x2013('0x51')](_0x4f0794,{'transaction':_0x14e155})['then'](function(_0x42ce2e){var _0x5b9348=_0x42ce2e[_0x2013('0x2c')]({'plain':!![]});var _0x19c392=_[_0x2013('0x33')](addVoicePrefixExtensions(_0x1e8b61,_0xfefcc2),function(_0x2342ae){_0x2342ae[_0x2013('0x56')]=_0x5b9348['id'];_0x2342ae[_0x2013('0x67')]=_0x1e8b61['id'];return _0x2342ae;});return db[_0x2013('0x55')][_0x2013('0x68')](_0x19c392,{'transaction':_0x14e155})[_0x2013('0x2a')](function(_0x1e88f8){if(!_0x1e88f8){return _0x457c23(_0x2013('0x69'));}else{return _0xcbb22f(_0x1e88f8);}})[_0x2013('0x4b')](function(_0x108db3){return _0x457c23(_0x108db3);});});;});};function addVoicePrefixExtensions(_0x52adb6,_0x3fa2e2){var _0x55c7f3=[];var _0xb9801=formatPrefixName(_0x52adb6['prefix']);_0x55c7f3[_0x2013('0x6a')](new Extension(_0xb9801,0x2,_0x2013('0x6b'),'CDR(prefix)='+_0x52adb6[_0x2013('0x31')]));if(_0x52adb6[_0x2013('0x6c')]){_0x55c7f3[_0x2013('0x6a')](new Extension(_0xb9801,0x3,'Set',_0x2013('0x6d')+_0x52adb6[_0x2013('0x6c')]));}else{_0x55c7f3[_0x2013('0x6a')](new Extension(_0xb9801,0x3,'NoOp',_0x2013('0x6e')));}_0x55c7f3['push'](new Extension(_0xb9801,0x4,_0x2013('0x6f'),_0x3fa2e2[_0x2013('0x5d')]+','+'${EXTEN:'+(0x8+_0x52adb6[_0x2013('0x31')][_0x2013('0x70')])+'}'+','+0x1));return _0x55c7f3;}function formatPrefixName(_0x5ec90b){var _0x60c4bf='_';for(var _0x21cacb=0x0;_0x21cacb<_0x5ec90b[_0x2013('0x70')];_0x21cacb++){if(_0x5ec90b['charAt'](_0x21cacb)=='-'){_0x60c4bf+=_0x5ec90b[_0x2013('0x71')](_0x21cacb);}else{_0x60c4bf+='['+_0x5ec90b[_0x2013('0x71')](_0x21cacb)+']';}}_0x60c4bf+='.';return _0x60c4bf;}exports['update']=function(_0x30c955,_0x3a66db,_0x563ff0){var _0x3d2e1a=_0x30c955['body'];_0x3d2e1a[_0x2013('0x64')]=_0x2013('0x72')+_0x3d2e1a[_0x2013('0x31')]+'-';return db[_0x2013('0x52')][_0x2013('0x53')](function(_0x1a6f59){return db[_0x2013('0x47')]['update'](_0x3d2e1a,{'where':{'id':_0x3d2e1a['id']},'transaction':_0x1a6f59})[_0x2013('0x2a')](function(){return db[_0x2013('0x55')][_0x2013('0x2b')]({'where':{'VoicePrefixId':_0x3d2e1a['id']},'transaction':_0x1a6f59})['then'](function(){return db[_0x2013('0x55')]['find']({'where':{'id':_0x3d2e1a['VoiceExtensionId']},'raw':!![]})[_0x2013('0x2a')](function(_0x1bbfa5){return createVoicePrefixExtensions(_0x3d2e1a,_0x1bbfa5,_0x1a6f59);});});});})['then'](function(){return db[_0x2013('0x47')][_0x2013('0x73')](_0x3d2e1a['id']);})[_0x2013('0x2a')](respondWithResult(_0x3a66db,null))[_0x2013('0x4b')](handleError(_0x3a66db,null));};exports[_0x2013('0x74')]=function(_0x4ceccd,_0x6fe59e,_0x291092){return db['VoicePrefix'][_0x2013('0x4f')]({'where':{'id':_0x4ceccd[_0x2013('0x4c')]['id']}})[_0x2013('0x2a')](handleEntityNotFound(_0x6fe59e,null))[_0x2013('0x2a')](function(_0x25fcfb){if(_0x25fcfb){return _0x25fcfb['addAgents'](_0x4ceccd['body']['ids'],_['omit'](_0x4ceccd[_0x2013('0x54')],[_0x2013('0x75'),'id'])||{})[_0x2013('0x76')](function(_0x741643){for(var _0x2f3929=0x0;_0x2f3929<_0x4ceccd['body'][_0x2013('0x75')][_0x2013('0x70')];_0x2f3929+=0x1){socket[_0x2013('0x77')](_0x2013('0x78'),{'UserId':_0x4ceccd[_0x2013('0x54')][_0x2013('0x75')][_0x2f3929],'VoicePrefixId':_0x4ceccd[_0x2013('0x4c')]['id']});}return _0x741643;});}})[_0x2013('0x2a')](respondWithResult(_0x6fe59e,null))[_0x2013('0x4b')](handleError(_0x6fe59e,null));};exports[_0x2013('0x79')]=function(_0x2836f6,_0x1754e3,_0x599d74){return db[_0x2013('0x47')][_0x2013('0x4f')]({'where':{'id':_0x2836f6[_0x2013('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1754e3,null))[_0x2013('0x2a')](function(_0x17f1e0){if(_0x17f1e0){return _0x17f1e0[_0x2013('0x79')](_0x2836f6[_0x2013('0x38')]['ids'])[_0x2013('0x2a')](function(){if(_['isArray'](_0x2836f6[_0x2013('0x38')][_0x2013('0x75')])){for(var _0xa0b564=0x0;_0xa0b564<_0x2836f6[_0x2013('0x38')]['ids'][_0x2013('0x70')];_0xa0b564+=0x1){socket[_0x2013('0x77')](_0x2013('0x7a'),{'UserId':Number(_0x2836f6['query'][_0x2013('0x75')][_0xa0b564]),'VoicePrefixId':Number(_0x2836f6[_0x2013('0x4c')]['id'])});}}else{socket[_0x2013('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x2836f6[_0x2013('0x38')][_0x2013('0x75')]),'VoicePrefixId':Number(_0x2836f6[_0x2013('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x1754e3,null))[_0x2013('0x4b')](handleError(_0x1754e3,null));};exports[_0x2013('0x7b')]=function(_0x2cd88b,_0x63e238,_0x320b00){var _0x4be745={};var _0x372357={};var _0x1272dc;var _0x3edebf;return db[_0x2013('0x47')][_0x2013('0x7c')]({'where':{'id':_0x2cd88b['params']['id']}})[_0x2013('0x2a')](handleEntityNotFound(_0x63e238,null))['then'](function(_0x32aa13){if(_0x32aa13){_0x1272dc=_0x32aa13;_0x372357[_0x2013('0x37')]=_[_0x2013('0x4d')](db['User'][_0x2013('0x34')]);_0x372357[_0x2013('0x38')]=_['keys'](_0x2cd88b['query']);_0x372357[_0x2013('0x39')]=_['intersection'](_0x372357[_0x2013('0x37')],_0x372357[_0x2013('0x38')]);_0x4be745[_0x2013('0x3a')]=_[_0x2013('0x3b')](_0x372357[_0x2013('0x37')],qs['fields'](_0x2cd88b[_0x2013('0x38')][_0x2013('0x3c')]));_0x4be745[_0x2013('0x3a')]=_0x4be745['attributes']['length']?_0x4be745[_0x2013('0x3a')]:_0x372357[_0x2013('0x37')];_0x4be745[_0x2013('0x7d')]=qs[_0x2013('0x40')](_0x2cd88b[_0x2013('0x38')][_0x2013('0x40')]);_0x4be745[_0x2013('0x41')]=qs[_0x2013('0x39')](_[_0x2013('0x42')](_0x2cd88b[_0x2013('0x38')],_0x372357[_0x2013('0x39')]));if(_0x2cd88b[_0x2013('0x38')][_0x2013('0x7e')]){_0x4be745[_0x2013('0x41')]=_['merge'](_0x4be745[_0x2013('0x41')],{'$or':_[_0x2013('0x33')](_0x4be745[_0x2013('0x3a')],function(_0x23c7b5){var _0x4f968c={};_0x4f968c[_0x23c7b5]={'$like':'%'+_0x2cd88b[_0x2013('0x38')][_0x2013('0x7e')]+'%'};return _0x4f968c;})});}_0x4be745=_[_0x2013('0x43')]({},_0x4be745,_0x2cd88b[_0x2013('0x46')]);return _0x1272dc[_0x2013('0x7b')](_0x4be745);}})['then'](function(_0x2e5b60){if(_0x2e5b60){_0x3edebf=_0x2e5b60[_0x2013('0x70')];if(!_0x2cd88b['query'][_0x2013('0x3d')](_0x2013('0x3e'))){_0x4be745[_0x2013('0x24')]=qs['limit'](_0x2cd88b[_0x2013('0x38')][_0x2013('0x24')]);_0x4be745[_0x2013('0x3f')]=qs[_0x2013('0x3f')](_0x2cd88b[_0x2013('0x38')]['offset']);}return _0x1272dc[_0x2013('0x7b')](_0x4be745);}})[_0x2013('0x2a')](function(_0x1741b8){if(_0x1741b8){return _0x1741b8?{'count':_0x3edebf,'rows':_0x1741b8}:null;}})[_0x2013('0x2a')](respondWithResult(_0x63e238,null))[_0x2013('0x4b')](handleError(_0x63e238,null));};
\ No newline at end of file
+var _0x599c=['save','update','then','get','VoicePrefixes','UserProfileResource','destroy','end','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','describe','create','transaction','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoiceExtensionId','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','sequelize','findById','addAgents','body','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','status','json','count','offset','limit','Content-Range','apply','reject'];(function(_0x457ac1,_0x137b40){var _0x205858=function(_0x44ad30){while(--_0x44ad30){_0x457ac1['push'](_0x457ac1['shift']());}};_0x205858(++_0x137b40);}(_0x599c,0x155));var _0xc599=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x599c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc599('0x0'));var emlformat=require(_0xc599('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc599('0x2'));var jsonpatch=require(_0xc599('0x3'));var rp=require(_0xc599('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc599('0x5'));var util=require(_0xc599('0x6'));var path=require(_0xc599('0x7'));var sox=require(_0xc599('0x8'));var csv=require(_0xc599('0x9'));var ejs=require(_0xc599('0xa'));var fs=require('fs');var _=require(_0xc599('0xb'));var squel=require(_0xc599('0xc'));var crypto=require(_0xc599('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc599('0xe'));var toCsv=require(_0xc599('0x9'));var querystring=require(_0xc599('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc599('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc599('0x11'))(_0xc599('0x12'));var utils=require(_0xc599('0x13'));var config=require('../../config/environment');var db=require(_0xc599('0x14'))['db'];config['redis']=_[_0xc599('0x15')](config[_0xc599('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xc599('0x17'))(new Redis(config[_0xc599('0x16')]));require(_0xc599('0x18'))[_0xc599('0x19')](socket);function respondWithStatusCode(_0x274132,_0x21c36a){_0x21c36a=_0x21c36a||0xcc;return function(_0x241028){if(_0x241028){return _0x274132['sendStatus'](_0x21c36a);}return _0x274132['status'](_0x21c36a)['end']();};}function respondWithResult(_0x95c3e3,_0x35de5f){_0x35de5f=_0x35de5f||0xc8;return function(_0x21a36b){if(_0x21a36b){return _0x95c3e3[_0xc599('0x1a')](_0x35de5f)[_0xc599('0x1b')](_0x21a36b);}};}function respondWithFilteredResult(_0xeeb9d2,_0x3fc3d8){return function(_0x2472a7){if(_0x2472a7){var _0x21302d=_0x2472a7[_0xc599('0x1c')],_0x2b84e1=_0x3fc3d8[_0xc599('0x1d')],_0x10f35d=_0x3fc3d8[_0xc599('0x1d')]+_0x3fc3d8[_0xc599('0x1e')],_0x54646a;if(_0x10f35d>=_0x21302d){_0x10f35d=_0x21302d;_0x54646a=0xc8;}else{_0x54646a=0xce;}_0xeeb9d2[_0xc599('0x1a')](_0x54646a);return _0xeeb9d2['set'](_0xc599('0x1f'),_0x2b84e1+'-'+_0x10f35d+'/'+_0x21302d)['json'](_0x2472a7);}return null;};}function patchUpdates(_0x4413fa){return function(_0x51134f){try{jsonpatch[_0xc599('0x20')](_0x51134f,_0x4413fa,!![]);}catch(_0x2b3935){return BPromise[_0xc599('0x21')](_0x2b3935);}return _0x51134f[_0xc599('0x22')]();};}function saveUpdates(_0x426ef8,_0x3bc4d6){return function(_0xb88b7c){if(_0xb88b7c){return _0xb88b7c[_0xc599('0x23')](_0x426ef8)[_0xc599('0x24')](function(_0x4ea674){return _0x4ea674;});}return null;};}function removeEntity(_0x24e15e,_0x522898){return function(_0x261d9c){if(_0x261d9c){return _0x261d9c['destroy']()[_0xc599('0x24')](function(){var _0x26fc08=_0x261d9c[_0xc599('0x25')]({'plain':!![]});var _0x3f4db2=_0xc599('0x26');return db[_0xc599('0x27')][_0xc599('0x28')]({'where':{'type':_0x3f4db2,'resourceId':_0x26fc08['id']}})[_0xc599('0x24')](function(){return _0x261d9c;});})[_0xc599('0x24')](function(){_0x24e15e[_0xc599('0x1a')](0xcc)[_0xc599('0x29')]();});}};}function handleEntityNotFound(_0x333f42,_0x39d9e5){return function(_0x41b273){if(!_0x41b273){_0x333f42['sendStatus'](0x194);}return _0x41b273;};}function handleError(_0x461193,_0x5527b2){_0x5527b2=_0x5527b2||0x1f4;return function(_0x2840ac){logger['error'](_0x2840ac[_0xc599('0x2a')]);if(_0x2840ac[_0xc599('0x2b')]){delete _0x2840ac[_0xc599('0x2b')];}_0x461193[_0xc599('0x1a')](_0x5527b2)[_0xc599('0x2c')](_0x2840ac);};}exports[_0xc599('0x2d')]=function(_0x322eb9,_0x328e80){var _0x18ab49={},_0x5126e5={},_0x269c8b={'count':0x0,'rows':[]};var _0x106438=_[_0xc599('0x2e')](db[_0xc599('0x2f')][_0xc599('0x30')],function(_0xa332f0){return{'name':_0xa332f0[_0xc599('0x31')],'type':_0xa332f0[_0xc599('0x32')][_0xc599('0x33')]};});_0x5126e5[_0xc599('0x34')]=_[_0xc599('0x2e')](_0x106438,'name');_0x5126e5[_0xc599('0x35')]=_[_0xc599('0x36')](_0x322eb9[_0xc599('0x35')]);_0x5126e5[_0xc599('0x37')]=_['intersection'](_0x5126e5[_0xc599('0x34')],_0x5126e5['query']);_0x18ab49[_0xc599('0x38')]=_[_0xc599('0x39')](_0x5126e5['model'],qs[_0xc599('0x3a')](_0x322eb9[_0xc599('0x35')][_0xc599('0x3a')]));_0x18ab49[_0xc599('0x38')]=_0x18ab49[_0xc599('0x38')]['length']?_0x18ab49[_0xc599('0x38')]:_0x5126e5['model'];if(!_0x322eb9['query'][_0xc599('0x3b')](_0xc599('0x3c'))){_0x18ab49['limit']=qs[_0xc599('0x1e')](_0x322eb9[_0xc599('0x35')]['limit']);_0x18ab49[_0xc599('0x1d')]=qs[_0xc599('0x1d')](_0x322eb9[_0xc599('0x35')][_0xc599('0x1d')]);}_0x18ab49[_0xc599('0x3d')]=qs[_0xc599('0x3e')](_0x322eb9[_0xc599('0x35')]['sort']);_0x18ab49[_0xc599('0x3f')]=qs[_0xc599('0x37')](_[_0xc599('0x40')](_0x322eb9[_0xc599('0x35')],_0x5126e5[_0xc599('0x37')]),_0x106438);if(_0x322eb9['query'][_0xc599('0x41')]){_0x18ab49[_0xc599('0x3f')]=_['merge'](_0x18ab49[_0xc599('0x3f')],{'$or':_[_0xc599('0x2e')](_0x106438,function(_0x3cd8ab){if(_0x3cd8ab[_0xc599('0x32')]!==_0xc599('0x42')){var _0x3d434e={};_0x3d434e[_0x3cd8ab[_0xc599('0x2b')]]={'$like':'%'+_0x322eb9[_0xc599('0x35')][_0xc599('0x41')]+'%'};return _0x3d434e;}})});}_0x18ab49=_[_0xc599('0x43')]({},_0x18ab49,_0x322eb9[_0xc599('0x44')]);var _0x5df015={'where':_0x18ab49[_0xc599('0x3f')]};return db[_0xc599('0x2f')]['count'](_0x5df015)[_0xc599('0x24')](function(_0x4e84fc){_0x269c8b['count']=_0x4e84fc;if(_0x322eb9[_0xc599('0x35')][_0xc599('0x45')]){_0x18ab49[_0xc599('0x46')]=[{'all':!![]}];}return db['VoicePrefix'][_0xc599('0x47')](_0x18ab49);})['then'](function(_0x50da7b){_0x269c8b[_0xc599('0x48')]=_0x50da7b;return _0x269c8b;})['then'](respondWithFilteredResult(_0x328e80,_0x18ab49))['catch'](handleError(_0x328e80,null));};exports[_0xc599('0x49')]=function(_0x1f263d,_0x11fad5){var _0x41f5c4={'raw':![],'where':{'id':_0x1f263d[_0xc599('0x4a')]['id']}},_0x1a2358={};_0x1a2358[_0xc599('0x34')]=_[_0xc599('0x36')](db[_0xc599('0x2f')][_0xc599('0x30')]);_0x1a2358[_0xc599('0x35')]=_[_0xc599('0x36')](_0x1f263d[_0xc599('0x35')]);_0x1a2358[_0xc599('0x37')]=_[_0xc599('0x39')](_0x1a2358[_0xc599('0x34')],_0x1a2358[_0xc599('0x35')]);_0x41f5c4[_0xc599('0x38')]=_[_0xc599('0x39')](_0x1a2358[_0xc599('0x34')],qs[_0xc599('0x3a')](_0x1f263d['query'][_0xc599('0x3a')]));_0x41f5c4[_0xc599('0x38')]=_0x41f5c4[_0xc599('0x38')][_0xc599('0x4b')]?_0x41f5c4[_0xc599('0x38')]:_0x1a2358[_0xc599('0x34')];if(_0x1f263d[_0xc599('0x35')]['includeAll']){_0x41f5c4['include']=[{'all':!![]}];}_0x41f5c4=_[_0xc599('0x43')]({},_0x41f5c4,_0x1f263d['options']);return db['VoicePrefix'][_0xc599('0x4c')](_0x41f5c4)[_0xc599('0x24')](handleEntityNotFound(_0x11fad5,null))[_0xc599('0x24')](respondWithResult(_0x11fad5,null))['catch'](handleError(_0x11fad5,null));};exports['destroy']=function(_0x37dba7,_0x340513){return db['VoicePrefix']['find']({'where':{'id':_0x37dba7[_0xc599('0x4a')]['id']}})['then'](handleEntityNotFound(_0x340513,null))['then'](removeEntity(_0x340513,null))[_0xc599('0x4d')](handleError(_0x340513,null));};exports[_0xc599('0x4e')]=function(_0x177718,_0x2020ee){return db['VoicePrefix']['describe']()[_0xc599('0x24')](respondWithResult(_0x2020ee,null))[_0xc599('0x4d')](handleError(_0x2020ee,null));};exports[_0xc599('0x4f')]=function(_0x1a99a4,_0x24bf48){var _0x51e4ed;return db['sequelize'][_0xc599('0x50')](function(_0x2fbf20){return db[_0xc599('0x2f')][_0xc599('0x4f')](_0x1a99a4['body'],{'transaction':_0x2fbf20})[_0xc599('0x24')](function(_0x2991ae){_0x51e4ed=_0x2991ae['get']({'plain':!![]});return db['VoiceExtension'][_0xc599('0x4c')]({'where':{'id':_0x51e4ed['VoiceExtensionId']},'raw':!![]})['then'](function(_0x49c9c3){return createVoicePrefixExtensions(_0x51e4ed,_0x49c9c3,_0x2fbf20);});});})['then'](function(){var _0x29af76=_0x1a99a4['user'][_0xc599('0x25')]({'plain':!![]});if(!_0x29af76)throw new Error(_0xc599('0x51'));if(_0x29af76['role']===_0xc599('0x52')){var _0x26302a=_0x51e4ed;return db[_0xc599('0x53')][_0xc599('0x4c')]({'where':{'name':_0xc599('0x26'),'userProfileId':_0x29af76[_0xc599('0x54')]},'raw':!![]})[_0xc599('0x24')](function(_0x2c15b9){if(_0x2c15b9&&_0x2c15b9[_0xc599('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x26302a[_0xc599('0x2b')],'resourceId':_0x26302a['id'],'type':_0x2c15b9['name'],'sectionId':_0x2c15b9['id']},{})['then'](function(){return _0x51e4ed;});}else{return _0x51e4ed;}})[_0xc599('0x4d')](function(_0x27130f){logger[_0xc599('0x56')](_0xc599('0x57'),_0x27130f);throw _0x27130f;});}return _0x51e4ed;})[_0xc599('0x24')](respondWithResult(_0x24bf48,null))[_0xc599('0x4d')](handleError(_0x24bf48,null));};function Extension(_0x36c6a1,_0x562583,_0x554321,_0x2012fe){this[_0xc599('0x58')]=_0xc599('0x59');this[_0xc599('0x5a')]=_0x36c6a1;this[_0xc599('0x5b')]=_0x554321;this[_0xc599('0x32')]=_0xc599('0x5c');this[_0xc599('0x5d')]=_0xc599('0x5e');this[_0xc599('0x5f')]=_0x562583;this[_0xc599('0x60')]=_0x2012fe;}function createVoicePrefixExtensions(_0x173596,_0x4d06d1,_0x2d6b34){return new BPromise(function(_0x4975f9,_0x5ce2f6){var _0x1a4da2=new Extension(formatPrefixName(_0x173596[_0xc599('0x61')]),0x1,_0xc599('0x62'),'Voice\x20Prefix');_0x1a4da2['VoicePrefixId']=_0x173596['id'];return db['VoiceExtension'][_0xc599('0x4f')](_0x1a4da2,{'transaction':_0x2d6b34})[_0xc599('0x24')](function(_0x3ce9eb){var _0x47674b=_0x3ce9eb[_0xc599('0x25')]({'plain':!![]});var _0x4e172b=_[_0xc599('0x2e')](addVoicePrefixExtensions(_0x173596,_0x4d06d1),function(_0x57bcf3){_0x57bcf3[_0xc599('0x63')]=_0x47674b['id'];_0x57bcf3[_0xc599('0x64')]=_0x173596['id'];return _0x57bcf3;});return db[_0xc599('0x65')][_0xc599('0x66')](_0x4e172b,{'transaction':_0x2d6b34})[_0xc599('0x24')](function(_0x25060a){if(!_0x25060a){return _0x5ce2f6(_0xc599('0x67'));}else{return _0x4975f9(_0x25060a);}})[_0xc599('0x4d')](function(_0x5c6a0e){return _0x5ce2f6(_0x5c6a0e);});});;});};function addVoicePrefixExtensions(_0x576006,_0x180c30){var _0x58fe73=[];var _0x2415c4=formatPrefixName(_0x576006[_0xc599('0x61')]);_0x58fe73[_0xc599('0x68')](new Extension(_0x2415c4,0x2,'Set',_0xc599('0x69')+_0x576006[_0xc599('0x2b')]));if(_0x576006[_0xc599('0x6a')]){_0x58fe73[_0xc599('0x68')](new Extension(_0x2415c4,0x3,'Set',_0xc599('0x6b')+_0x576006[_0xc599('0x6a')]));}else{_0x58fe73[_0xc599('0x68')](new Extension(_0x2415c4,0x3,'NoOp',_0xc599('0x6c')));}_0x58fe73['push'](new Extension(_0x2415c4,0x4,'goto',_0x180c30[_0xc599('0x58')]+','+_0xc599('0x6d')+(0x8+_0x576006[_0xc599('0x2b')][_0xc599('0x4b')])+'}'+','+0x1));return _0x58fe73;}function formatPrefixName(_0x485f77){var _0x51888d='_';for(var _0x345131=0x0;_0x345131<_0x485f77['length'];_0x345131++){if(_0x485f77[_0xc599('0x6e')](_0x345131)=='-'){_0x51888d+=_0x485f77[_0xc599('0x6e')](_0x345131);}else{_0x51888d+='['+_0x485f77[_0xc599('0x6e')](_0x345131)+']';}}_0x51888d+='.';return _0x51888d;}exports[_0xc599('0x23')]=function(_0x463a04,_0x2008aa,_0x2508bb){var _0x3e5e5f=_0x463a04['body'];_0x3e5e5f[_0xc599('0x61')]='system-'+_0x3e5e5f[_0xc599('0x2b')]+'-';return db[_0xc599('0x6f')][_0xc599('0x50')](function(_0x963ef9){return db[_0xc599('0x2f')][_0xc599('0x23')](_0x3e5e5f,{'where':{'id':_0x3e5e5f['id']},'transaction':_0x963ef9})[_0xc599('0x24')](function(){return db['VoiceExtension'][_0xc599('0x28')]({'where':{'VoicePrefixId':_0x3e5e5f['id']},'transaction':_0x963ef9})['then'](function(){return db[_0xc599('0x65')][_0xc599('0x4c')]({'where':{'id':_0x3e5e5f[_0xc599('0x63')]},'raw':!![]})[_0xc599('0x24')](function(_0x51df76){return createVoicePrefixExtensions(_0x3e5e5f,_0x51df76,_0x963ef9);});});});})[_0xc599('0x24')](function(){return db['VoicePrefix'][_0xc599('0x70')](_0x3e5e5f['id']);})[_0xc599('0x24')](respondWithResult(_0x2008aa,null))['catch'](handleError(_0x2008aa,null));};exports[_0xc599('0x71')]=function(_0x2d945f,_0x6b0ad5,_0x2e9d68){return db[_0xc599('0x2f')][_0xc599('0x4c')]({'where':{'id':_0x2d945f[_0xc599('0x4a')]['id']}})[_0xc599('0x24')](handleEntityNotFound(_0x6b0ad5,null))['then'](function(_0x4e2ec0){if(_0x4e2ec0){return _0x4e2ec0['addAgents'](_0x2d945f[_0xc599('0x72')][_0xc599('0x73')],_['omit'](_0x2d945f['body'],[_0xc599('0x73'),'id'])||{})[_0xc599('0x74')](function(_0x4ff8fd){for(var _0x3af4b9=0x0;_0x3af4b9<_0x2d945f['body'][_0xc599('0x73')]['length'];_0x3af4b9+=0x1){socket[_0xc599('0x75')](_0xc599('0x76'),{'UserId':_0x2d945f['body'][_0xc599('0x73')][_0x3af4b9],'VoicePrefixId':_0x2d945f['params']['id']});}return _0x4ff8fd;});}})[_0xc599('0x24')](respondWithResult(_0x6b0ad5,null))[_0xc599('0x4d')](handleError(_0x6b0ad5,null));};exports[_0xc599('0x77')]=function(_0x33b4ae,_0x4b2197,_0x4fe830){return db[_0xc599('0x2f')][_0xc599('0x4c')]({'where':{'id':_0x33b4ae[_0xc599('0x4a')]['id']}})[_0xc599('0x24')](handleEntityNotFound(_0x4b2197,null))[_0xc599('0x24')](function(_0x4654c7){if(_0x4654c7){return _0x4654c7[_0xc599('0x77')](_0x33b4ae[_0xc599('0x35')][_0xc599('0x73')])[_0xc599('0x24')](function(){if(_[_0xc599('0x78')](_0x33b4ae[_0xc599('0x35')][_0xc599('0x73')])){for(var _0xd04f36=0x0;_0xd04f36<_0x33b4ae[_0xc599('0x35')][_0xc599('0x73')]['length'];_0xd04f36+=0x1){socket[_0xc599('0x75')](_0xc599('0x79'),{'UserId':Number(_0x33b4ae['query']['ids'][_0xd04f36]),'VoicePrefixId':Number(_0x33b4ae[_0xc599('0x4a')]['id'])});}}else{socket[_0xc599('0x75')](_0xc599('0x79'),{'UserId':Number(_0x33b4ae[_0xc599('0x35')][_0xc599('0x73')]),'VoicePrefixId':Number(_0x33b4ae[_0xc599('0x4a')]['id'])});}});}})[_0xc599('0x24')](respondWithStatusCode(_0x4b2197,null))['catch'](handleError(_0x4b2197,null));};exports[_0xc599('0x7a')]=function(_0x213b26,_0x1c9521,_0x3cafb6){var _0x312a9b={};var _0x5d7d65={};var _0x14659b;var _0x11ed36;return db[_0xc599('0x2f')][_0xc599('0x7b')]({'where':{'id':_0x213b26['params']['id']}})[_0xc599('0x24')](handleEntityNotFound(_0x1c9521,null))[_0xc599('0x24')](function(_0x40284b){if(_0x40284b){_0x14659b=_0x40284b;_0x5d7d65['model']=_[_0xc599('0x36')](db[_0xc599('0x7c')][_0xc599('0x30')]);_0x5d7d65[_0xc599('0x35')]=_[_0xc599('0x36')](_0x213b26[_0xc599('0x35')]);_0x5d7d65['filters']=_[_0xc599('0x39')](_0x5d7d65['model'],_0x5d7d65['query']);_0x312a9b[_0xc599('0x38')]=_[_0xc599('0x39')](_0x5d7d65[_0xc599('0x34')],qs[_0xc599('0x3a')](_0x213b26[_0xc599('0x35')][_0xc599('0x3a')]));_0x312a9b[_0xc599('0x38')]=_0x312a9b['attributes']['length']?_0x312a9b[_0xc599('0x38')]:_0x5d7d65[_0xc599('0x34')];_0x312a9b['order']=qs[_0xc599('0x3e')](_0x213b26[_0xc599('0x35')][_0xc599('0x3e')]);_0x312a9b[_0xc599('0x3f')]=qs[_0xc599('0x37')](_[_0xc599('0x40')](_0x213b26['query'],_0x5d7d65['filters']));if(_0x213b26[_0xc599('0x35')][_0xc599('0x41')]){_0x312a9b[_0xc599('0x3f')]=_['merge'](_0x312a9b[_0xc599('0x3f')],{'$or':_[_0xc599('0x2e')](_0x312a9b[_0xc599('0x38')],function(_0x517622){var _0x5327e6={};_0x5327e6[_0x517622]={'$like':'%'+_0x213b26[_0xc599('0x35')]['filter']+'%'};return _0x5327e6;})});}_0x312a9b=_[_0xc599('0x43')]({},_0x312a9b,_0x213b26[_0xc599('0x44')]);return _0x14659b[_0xc599('0x7a')](_0x312a9b);}})['then'](function(_0x1a8504){if(_0x1a8504){_0x11ed36=_0x1a8504[_0xc599('0x4b')];if(!_0x213b26['query']['hasOwnProperty']('nolimit')){_0x312a9b[_0xc599('0x1e')]=qs['limit'](_0x213b26[_0xc599('0x35')][_0xc599('0x1e')]);_0x312a9b['offset']=qs[_0xc599('0x1d')](_0x213b26['query']['offset']);}return _0x14659b['getAgents'](_0x312a9b);}})[_0xc599('0x24')](function(_0x4b83f8){if(_0x4b83f8){return _0x4b83f8?{'count':_0x11ed36,'rows':_0x4b83f8}:null;}})[_0xc599('0x24')](respondWithResult(_0x1c9521,null))[_0xc599('0x4d')](handleError(_0x1c9521,null));};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js
index 4eab708..17ac91a 100644
--- a/server/api/voicePrefix/voicePrefix.events.js
+++ b/server/api/voicePrefix/voicePrefix.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x34e8,0x12c));var _0x834e=function(_0x56005e,_0x2a3626){_0x56005e=_0x56005e-0x0;var _0x1780ae=_0x34e8[_0x56005e];return _0x1780ae;};'use strict';var EventEmitter=require(_0x834e('0x0'));var VoicePrefix=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){VoicePrefixEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);VoicePrefixEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=VoicePrefixEvents;
\ No newline at end of file
+var _0xedd9=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xedd9,0xfc));var _0x9edd=function(_0x366f84,_0x18c02e){_0x366f84=_0x366f84-0x0;var _0x20e553=_0xedd9[_0x366f84];return _0x20e553;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x9edd('0x0'))['db'][_0x9edd('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9edd('0x2')](0x0);var events={'afterCreate':_0x9edd('0x3'),'afterUpdate':_0x9edd('0x4'),'afterDestroy':_0x9edd('0x5')};function emitEvent(_0x3e6d3a){return function(_0x36b53f,_0x5943b3,_0x33679f){VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a+':'+_0x36b53f['id'],_0x36b53f);VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a,_0x36b53f);_0x33679f(null);};}for(var e in events){if(events[_0x9edd('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x9edd('0x8')]=VoicePrefixEvents;
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js
index ecc5678..42441e2 100644
--- a/server/api/voicePrefix/voicePrefix.model.js
+++ b/server/api/voicePrefix/voicePrefix.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbe3=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcbe3,0xae));var _0x3cbe=function(_0x266b0f,_0x1535a9){_0x266b0f=_0x266b0f-0x0;var _0x3aeebc=_0xcbe3[_0x266b0f];return _0x3aeebc;};'use strict';var _=require(_0x3cbe('0x0'));var util=require(_0x3cbe('0x1'));var logger=require(_0x3cbe('0x2'))(_0x3cbe('0x3'));var moment=require(_0x3cbe('0x4'));var BPromise=require(_0x3cbe('0x5'));var rp=require(_0x3cbe('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3cbe('0x7'));var attributes=require(_0x3cbe('0x8'));module['exports']=function(_0xfb8b52,_0x27e5f5){return _0xfb8b52[_0x3cbe('0x9')](_0x3cbe('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7af7=['path','rimraf','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x7af7,0x1e7));var _0x77af=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x7af7[_0x11155f];return _0xd07e48;};'use strict';var _=require(_0x77af('0x0'));var util=require(_0x77af('0x1'));var logger=require(_0x77af('0x2'))(_0x77af('0x3'));var moment=require(_0x77af('0x4'));var BPromise=require(_0x77af('0x5'));var rp=require(_0x77af('0x6'));var fs=require('fs');var path=require(_0x77af('0x7'));var rimraf=require(_0x77af('0x8'));var config=require('../../config/environment');var attributes=require(_0x77af('0x9'));module[_0x77af('0xa')]=function(_0x1f0b93,_0x44f91d){return _0x1f0b93['define'](_0x77af('0xb'),attributes,{'tableName':_0x77af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js
index e5aa53b..60837dc 100644
--- a/server/api/voicePrefix/voicePrefix.rpc.js
+++ b/server/api/voicePrefix/voicePrefix.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fd6=['redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3d1807,_0x4fabc2){var _0x2b15c0=function(_0x15311e){while(--_0x15311e){_0x3d1807['push'](_0x3d1807['shift']());}};_0x2b15c0(++_0x4fabc2);}(_0x4fd6,0x84));var _0x64fd=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x4fd6[_0x57add2];return _0x4e3670;};'use strict';var _=require(_0x64fd('0x0'));var util=require(_0x64fd('0x1'));var moment=require(_0x64fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x64fd('0x3'));var fs=require('fs');var Redis=require(_0x64fd('0x4'));var db=require(_0x64fd('0x5'))['db'];var utils=require(_0x64fd('0x6'));var logger=require(_0x64fd('0x7'))(_0x64fd('0x8'));var config=require(_0x64fd('0x9'));var jayson=require(_0x64fd('0xa'));var client=jayson[_0x64fd('0xb')][_0x64fd('0xc')]({'port':0x232a});config[_0x64fd('0xd')]=_[_0x64fd('0xe')](config['redis'],{'host':_0x64fd('0xf'),'port':0x18eb});var socket=require(_0x64fd('0x10'))(new Redis(config['redis']));require(_0x64fd('0x11'))['register'](socket);function respondWithRpcPromise(_0x3519db,_0x98b249,_0x434146){return new BPromise(function(_0x1ddb9a,_0x3a6850){return client[_0x64fd('0x12')](_0x3519db,_0x434146)['then'](function(_0x1c305c){logger[_0x64fd('0x13')](_0x64fd('0x14'),_0x98b249,_0x64fd('0x15'));logger[_0x64fd('0x16')](_0x64fd('0x17'),_0x98b249,_0x64fd('0x15'),JSON[_0x64fd('0x18')](_0x1c305c));if(_0x1c305c[_0x64fd('0x19')]){if(_0x1c305c['error'][_0x64fd('0x1a')]===0x1f4){logger['error'](_0x64fd('0x14'),_0x98b249,_0x1c305c['error'][_0x64fd('0x1b')]);return _0x3a6850(_0x1c305c[_0x64fd('0x19')][_0x64fd('0x1b')]);}logger[_0x64fd('0x19')](_0x64fd('0x14'),_0x98b249,_0x1c305c[_0x64fd('0x19')][_0x64fd('0x1b')]);return _0x1ddb9a(_0x1c305c['error'][_0x64fd('0x1b')]);}else{logger[_0x64fd('0x13')](_0x64fd('0x14'),_0x98b249,_0x64fd('0x15'));_0x1ddb9a(_0x1c305c['result'][_0x64fd('0x1b')]);}})[_0x64fd('0x1c')](function(_0x591129){logger[_0x64fd('0x19')](_0x64fd('0x14'),_0x98b249,_0x591129);_0x3a6850(_0x591129);});});}
\ No newline at end of file
+var _0x42cd=['util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash'];(function(_0x5ca3d6,_0x5c7599){var _0x3a1032=function(_0x2b70fb){while(--_0x2b70fb){_0x5ca3d6['push'](_0x5ca3d6['shift']());}};_0x3a1032(++_0x5c7599);}(_0x42cd,0x19f));var _0xd42c=function(_0x453705,_0x1f3175){_0x453705=_0x453705-0x0;var _0x2f9c07=_0x42cd[_0x453705];return _0x2f9c07;};'use strict';var _=require(_0xd42c('0x0'));var util=require(_0xd42c('0x1'));var moment=require(_0xd42c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd42c('0x3'));var db=require(_0xd42c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd42c('0x5'))(_0xd42c('0x6'));var config=require(_0xd42c('0x7'));var jayson=require(_0xd42c('0x8'));var client=jayson[_0xd42c('0x9')][_0xd42c('0xa')]({'port':0x232a});config['redis']=_[_0xd42c('0xb')](config['redis'],{'host':_0xd42c('0xc'),'port':0x18eb});var socket=require(_0xd42c('0xd'))(new Redis(config['redis']));require(_0xd42c('0xe'))[_0xd42c('0xf')](socket);function respondWithRpcPromise(_0x173567,_0x406d7c,_0x31e7cd){return new BPromise(function(_0x1efe72,_0x312432){return client['request'](_0x173567,_0x31e7cd)[_0xd42c('0x10')](function(_0x3a0a18){logger[_0xd42c('0x11')](_0xd42c('0x12'),_0x406d7c,'request\x20sent');logger['debug'](_0xd42c('0x13'),_0x406d7c,'request\x20sent',JSON['stringify'](_0x3a0a18));if(_0x3a0a18[_0xd42c('0x14')]){if(_0x3a0a18[_0xd42c('0x14')][_0xd42c('0x15')]===0x1f4){logger[_0xd42c('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x406d7c,_0x3a0a18[_0xd42c('0x14')][_0xd42c('0x16')]);return _0x312432(_0x3a0a18['error']['message']);}logger['error'](_0xd42c('0x12'),_0x406d7c,_0x3a0a18['error'][_0xd42c('0x16')]);return _0x1efe72(_0x3a0a18[_0xd42c('0x14')]['message']);}else{logger[_0xd42c('0x11')](_0xd42c('0x12'),_0x406d7c,_0xd42c('0x17'));_0x1efe72(_0x3a0a18[_0xd42c('0x18')]['message']);}})[_0xd42c('0x19')](function(_0x1101d4){logger[_0xd42c('0x14')](_0xd42c('0x12'),_0x406d7c,_0x1101d4);_0x312432(_0x1101d4);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js
index de7bf12..1a09f82 100644
--- a/server/api/voicePrefix/voicePrefix.socket.js
+++ b/server/api/voicePrefix/voicePrefix.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x654a=['save','remove','emit','register','length','voicePrefix:'];(function(_0x17b16c,_0xa9b1a2){var _0x218e8c=function(_0xeb1b25){while(--_0xeb1b25){_0x17b16c['push'](_0x17b16c['shift']());}};_0x218e8c(++_0xa9b1a2);}(_0x654a,0x1d4));var _0xa654=function(_0x3ee5df,_0x583073){_0x3ee5df=_0x3ee5df-0x0;var _0x446d24=_0x654a[_0x3ee5df];return _0x446d24;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xa654('0x0'),_0xa654('0x1'),'update'];function createListener(_0x1b79e0,_0x463187){return function(_0x41b6a1){_0x463187[_0xa654('0x2')](_0x1b79e0,_0x41b6a1);};}function removeListener(_0x49abea,_0x3d404c){return function(){VoicePrefixEvents['removeListener'](_0x49abea,_0x3d404c);};}exports[_0xa654('0x3')]=function(_0x53d1e1){for(var _0x5671c3=0x0,_0x39542d=events[_0xa654('0x4')];_0x5671c3<_0x39542d;_0x5671c3++){var _0x8e688a=events[_0x5671c3];var _0x3b0d5c=createListener(_0xa654('0x5')+_0x8e688a,_0x53d1e1);VoicePrefixEvents['on'](_0x8e688a,_0x3b0d5c);}};
\ No newline at end of file
+var _0x689d=['voicePrefix:','./voicePrefix.events','remove','update','emit','removeListener','register','length'];(function(_0x1b5cc2,_0x4321c2){var _0x375f3b=function(_0x265ddb){while(--_0x265ddb){_0x1b5cc2['push'](_0x1b5cc2['shift']());}};_0x375f3b(++_0x4321c2);}(_0x689d,0x1f1));var _0xd689=function(_0x17e411,_0x56449d){_0x17e411=_0x17e411-0x0;var _0x30b83d=_0x689d[_0x17e411];return _0x30b83d;};'use strict';var VoicePrefixEvents=require(_0xd689('0x0'));var events=['save',_0xd689('0x1'),_0xd689('0x2')];function createListener(_0x49ad5a,_0x413a7f){return function(_0x2b6a89){_0x413a7f[_0xd689('0x3')](_0x49ad5a,_0x2b6a89);};}function removeListener(_0x3072fd,_0x9d962c){return function(){VoicePrefixEvents[_0xd689('0x4')](_0x3072fd,_0x9d962c);};}exports[_0xd689('0x5')]=function(_0x5d149d){for(var _0x152086=0x0,_0x2b8c8f=events[_0xd689('0x6')];_0x152086<_0x2b8c8f;_0x152086++){var _0x2c1c53=events[_0x152086];var _0x2356b2=createListener(_0xd689('0x7')+_0x2c1c53,_0x5d149d);VoicePrefixEvents['on'](_0x2c1c53,_0x2356b2);}};
\ No newline at end of file
diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js
index b7535b6..c21b7e6 100644
--- a/server/api/voiceQueue/index.js
+++ b/server/api/voiceQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x83ae=['/:id/teams','getTeams','/:id/users','/:id/members','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','delete','destroy','removeTeams','removeAgents','removeLists','/:id/blacklists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black'];(function(_0x2f278a,_0x46ba22){var _0x4e13b1=function(_0x4c1ce8){while(--_0x4c1ce8){_0x2f278a['push'](_0x2f278a['shift']());}};_0x4e13b1(++_0x46ba22);}(_0x83ae,0x192));var _0xe83a=function(_0x6d7b48,_0x344d5e){_0x6d7b48=_0x6d7b48-0x0;var _0x5d38f9=_0x83ae[_0x6d7b48];return _0x5d38f9;};'use strict';var multer=require(_0xe83a('0x0'));var util=require('util');var path=require(_0xe83a('0x1'));var timeout=require(_0xe83a('0x2'));var express=require(_0xe83a('0x3'));var router=express[_0xe83a('0x4')]();var auth=require(_0xe83a('0x5'));var interaction=require(_0xe83a('0x6'));var config=require(_0xe83a('0x7'));var controller=require(_0xe83a('0x8'));router[_0xe83a('0x9')]('/',auth['isAuthenticated'](),controller[_0xe83a('0xa')]);router[_0xe83a('0x9')]('/:id',auth[_0xe83a('0xb')](),controller[_0xe83a('0xc')]);router['get'](_0xe83a('0xd'),auth['isAuthenticated'](),controller[_0xe83a('0xe')]);router['get']('/:id/hopper_histories',auth[_0xe83a('0xb')](),controller[_0xe83a('0xf')]);router['get']('/:id/hopper_finals',auth[_0xe83a('0xb')](),controller[_0xe83a('0x10')]);router[_0xe83a('0x9')](_0xe83a('0x11'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xe83a('0x9')](_0xe83a('0x12'),auth[_0xe83a('0xb')](),controller[_0xe83a('0x13')]);router[_0xe83a('0x9')](_0xe83a('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0xe83a('0x9')](_0xe83a('0x15'),auth[_0xe83a('0xb')](),controller['getMembers']);router[_0xe83a('0x9')](_0xe83a('0x16'),auth[_0xe83a('0xb')](),controller[_0xe83a('0x17')]);router[_0xe83a('0x9')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xe83a('0x18')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe83a('0x19')]);router[_0xe83a('0x1a')](_0xe83a('0x1b'),auth[_0xe83a('0xb')](),controller['clone']);router[_0xe83a('0x1a')](_0xe83a('0x12'),auth[_0xe83a('0xb')](),controller[_0xe83a('0x1c')]);router[_0xe83a('0x1a')](_0xe83a('0x14'),auth[_0xe83a('0xb')](),controller[_0xe83a('0x1d')]);router['post'](_0xe83a('0x16'),auth['isAuthenticated'](),controller[_0xe83a('0x1e')]);router[_0xe83a('0x1a')]('/:id/blacklists',auth[_0xe83a('0xb')](),controller[_0xe83a('0x1f')]);router[_0xe83a('0x20')](_0xe83a('0x21'),auth['isAuthenticated'](),controller['update']);router[_0xe83a('0x22')](_0xe83a('0x21'),auth[_0xe83a('0xb')](),controller[_0xe83a('0x23')]);router[_0xe83a('0x22')]('/:id/teams',auth[_0xe83a('0xb')](),controller[_0xe83a('0x24')]);router[_0xe83a('0x22')](_0xe83a('0x14'),auth[_0xe83a('0xb')](),controller[_0xe83a('0x25')]);router[_0xe83a('0x22')](_0xe83a('0x16'),auth[_0xe83a('0xb')](),controller[_0xe83a('0x26')]);router[_0xe83a('0x22')](_0xe83a('0x27'),auth['isAuthenticated'](),controller[_0xe83a('0x28')]);module[_0xe83a('0x29')]=router;
\ No newline at end of file
+var _0x63ba=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getMembers','/:id/lists','getLists','getBlackLists','post','create','clone','addTeams','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','/:id/blacklists','removeBlackLists'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x63ba,0x135));var _0xa63b=function(_0x4a7cc5,_0x58314e){_0x4a7cc5=_0x4a7cc5-0x0;var _0x5be6bd=_0x63ba[_0x4a7cc5];return _0x5be6bd;};'use strict';var multer=require('multer');var util=require(_0xa63b('0x0'));var path=require(_0xa63b('0x1'));var timeout=require(_0xa63b('0x2'));var express=require(_0xa63b('0x3'));var router=express[_0xa63b('0x4')]();var auth=require(_0xa63b('0x5'));var interaction=require(_0xa63b('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router['get']('/',auth[_0xa63b('0x7')](),controller[_0xa63b('0x8')]);router[_0xa63b('0x9')](_0xa63b('0xa'),auth[_0xa63b('0x7')](),controller[_0xa63b('0xb')]);router['get'](_0xa63b('0xc'),auth[_0xa63b('0x7')](),controller[_0xa63b('0xd')]);router[_0xa63b('0x9')](_0xa63b('0xe'),auth[_0xa63b('0x7')](),controller[_0xa63b('0xf')]);router['get'](_0xa63b('0x10'),auth[_0xa63b('0x7')](),controller[_0xa63b('0x11')]);router[_0xa63b('0x9')](_0xa63b('0x12'),auth[_0xa63b('0x7')](),controller[_0xa63b('0x13')]);router[_0xa63b('0x9')](_0xa63b('0x14'),auth[_0xa63b('0x7')](),controller[_0xa63b('0x15')]);router['get'](_0xa63b('0x16'),auth[_0xa63b('0x7')](),controller['getAgents']);router['get']('/:id/members',auth[_0xa63b('0x7')](),controller[_0xa63b('0x17')]);router[_0xa63b('0x9')](_0xa63b('0x18'),auth['isAuthenticated'](),controller[_0xa63b('0x19')]);router['get']('/:id/blacklists',auth[_0xa63b('0x7')](),controller[_0xa63b('0x1a')]);router[_0xa63b('0x1b')]('/',auth[_0xa63b('0x7')](),controller[_0xa63b('0x1c')]);router[_0xa63b('0x1b')]('/:id/clone',auth[_0xa63b('0x7')](),controller[_0xa63b('0x1d')]);router[_0xa63b('0x1b')](_0xa63b('0x14'),auth[_0xa63b('0x7')](),controller[_0xa63b('0x1e')]);router[_0xa63b('0x1b')]('/:id/users',auth[_0xa63b('0x7')](),controller[_0xa63b('0x1f')]);router[_0xa63b('0x1b')](_0xa63b('0x18'),auth[_0xa63b('0x7')](),controller[_0xa63b('0x20')]);router[_0xa63b('0x1b')]('/:id/blacklists',auth[_0xa63b('0x7')](),controller[_0xa63b('0x21')]);router[_0xa63b('0x22')](_0xa63b('0xa'),auth[_0xa63b('0x7')](),controller[_0xa63b('0x23')]);router[_0xa63b('0x24')](_0xa63b('0xa'),auth[_0xa63b('0x7')](),controller[_0xa63b('0x25')]);router['delete'](_0xa63b('0x14'),auth[_0xa63b('0x7')](),controller[_0xa63b('0x26')]);router[_0xa63b('0x24')]('/:id/users',auth[_0xa63b('0x7')](),controller[_0xa63b('0x27')]);router[_0xa63b('0x24')]('/:id/lists',auth[_0xa63b('0x7')](),controller[_0xa63b('0x28')]);router[_0xa63b('0x24')](_0xa63b('0x29'),auth[_0xa63b('0x7')](),controller[_0xa63b('0x2a')]);module[_0xa63b('0x2b')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js
index 7745d90..e7df890 100644
--- a/server/api/voiceQueue/voiceQueue.attributes.js
+++ b/server/api/voiceQueue/voiceQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x59ab65,_0x410a52){var _0x57db9b=function(_0x19dc31){while(--_0x19dc31){_0x59ab65['push'](_0x59ab65['shift']());}};_0x57db9b(++_0x410a52);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x29fc45,_0x1d010b){var _0x512a89=function(_0x3722f2){while(--_0x3722f2){_0x29fc45['push'](_0x29fc45['shift']());}};_0x512a89(++_0x1d010b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js
index fac64cb..849f9b8 100644
--- a/server/api/voiceQueue/voiceQueue.controller.js
+++ b/server/api/voiceQueue/voiceQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x88c7=['ContactId','field','CmListId','ListId','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','VoiceQueue','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','autoAssociation','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','ids','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','removeTeams','isEmpty','addAgents','spread','all','removeAgents','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt'];(function(_0x965b4f,_0x304fe9){var _0x57f071=function(_0x52b82e){while(--_0x52b82e){_0x965b4f['push'](_0x965b4f['shift']());}};_0x57f071(++_0x304fe9);}(_0x88c7,0x185));var _0x788c=function(_0x3ee1d4,_0x4029b7){_0x3ee1d4=_0x3ee1d4-0x0;var _0x578206=_0x88c7[_0x3ee1d4];return _0x578206;};'use strict';var pdf=require(_0x788c('0x0'));var emlformat=require(_0x788c('0x1'));var rimraf=require(_0x788c('0x2'));var zipdir=require(_0x788c('0x3'));var jsonpatch=require(_0x788c('0x4'));var rp=require(_0x788c('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x788c('0x6'));var util=require(_0x788c('0x7'));var path=require(_0x788c('0x8'));var sox=require('sox');var csv=require(_0x788c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x788c('0xa'));var crypto=require(_0x788c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x788c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x788c('0xd'));var Papa=require(_0x788c('0xe'));var Redis=require(_0x788c('0xf'));var authService=require(_0x788c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x788c('0x11'));var hardwareService=require(_0x788c('0x12'));var logger=require(_0x788c('0x13'))(_0x788c('0x14'));var utils=require(_0x788c('0x15'));var config=require('../../config/environment');var db=require(_0x788c('0x16'))['db'];config[_0x788c('0x17')]=_[_0x788c('0x18')](config[_0x788c('0x17')],{'host':_0x788c('0x19'),'port':0x18eb});var socket=require(_0x788c('0x1a'))(new Redis(config[_0x788c('0x17')]));require('./voiceQueue.socket')[_0x788c('0x1b')](socket);function respondWithStatusCode(_0x3e68ed,_0x1c0bc1){_0x1c0bc1=_0x1c0bc1||0xcc;return function(_0x1d6b99){if(_0x1d6b99){return _0x3e68ed[_0x788c('0x1c')](_0x1c0bc1);}return _0x3e68ed[_0x788c('0x1d')](_0x1c0bc1)['end']();};}function respondWithResult(_0x4b320f,_0x10acf1){_0x10acf1=_0x10acf1||0xc8;return function(_0xbbf263){if(_0xbbf263){return _0x4b320f[_0x788c('0x1d')](_0x10acf1)[_0x788c('0x1e')](_0xbbf263);}};}function respondWithFilteredResult(_0x2826bd,_0x41fb6d){return function(_0x93f738){if(_0x93f738){var _0x46470c=_0x93f738[_0x788c('0x1f')],_0x5bbdb6=_0x41fb6d[_0x788c('0x20')],_0x193e89=_0x41fb6d[_0x788c('0x20')]+_0x41fb6d[_0x788c('0x21')],_0x2ed83a;if(_0x193e89>=_0x46470c){_0x193e89=_0x46470c;_0x2ed83a=0xc8;}else{_0x2ed83a=0xce;}_0x2826bd[_0x788c('0x1d')](_0x2ed83a);return _0x2826bd['set'](_0x788c('0x22'),_0x5bbdb6+'-'+_0x193e89+'/'+_0x46470c)[_0x788c('0x1e')](_0x93f738);}return null;};}function patchUpdates(_0xa75f1c){return function(_0x301207){try{jsonpatch[_0x788c('0x23')](_0x301207,_0xa75f1c,!![]);}catch(_0xef764){return BPromise[_0x788c('0x24')](_0xef764);}return _0x301207['save']();};}function saveUpdates(_0x308ea8,_0x1e104f){return function(_0xf2ba15){if(_0xf2ba15){return _0xf2ba15[_0x788c('0x25')](_0x308ea8)[_0x788c('0x26')](function(_0x58dbb4){return _0x58dbb4;});}return null;};}function removeEntity(_0x20d3b0,_0x48f7cd){return function(_0x3d3831){if(_0x3d3831){return _0x3d3831[_0x788c('0x27')]()[_0x788c('0x26')](function(){var _0x1a69e3=_0x3d3831['get']({'plain':!![]});var _0x195bba=[{'name':'VoiceQueues','value':_0x788c('0x28'),'ignore':![]},{'name':_0x788c('0x29'),'value':_0x788c('0x2a'),'ignore':![]}];var _0x4d72b5=_(_0x195bba)[_0x788c('0x2b')](_0x788c('0x2c'))[_0x788c('0x2d')](_0x788c('0x2e'))[_0x788c('0x2e')]();if(_['includes'](_0x4d72b5,_0x1a69e3[_0x788c('0x2f')])){return;}var _0x6431a6=_[_0x788c('0x30')](_0x195bba,['value',_0x1a69e3[_0x788c('0x2f')]])['name'];return db[_0x788c('0x31')][_0x788c('0x27')]({'where':{'type':_0x6431a6,'resourceId':_0x1a69e3['id']}})[_0x788c('0x26')](function(){return _0x3d3831;});})[_0x788c('0x26')](function(){_0x20d3b0['status'](0xcc)[_0x788c('0x32')]();});}};}function handleEntityNotFound(_0x31c523,_0x564d7e){return function(_0x8843a1){if(!_0x8843a1){_0x31c523['sendStatus'](0x194);}return _0x8843a1;};}function handleError(_0x2e08f8,_0x174ae7){_0x174ae7=_0x174ae7||0x1f4;return function(_0x5d9092){logger[_0x788c('0x33')](_0x5d9092['stack']);if(_0x5d9092[_0x788c('0x34')]){delete _0x5d9092['name'];}_0x2e08f8[_0x788c('0x1d')](_0x174ae7)[_0x788c('0x35')](_0x5d9092);};}exports[_0x788c('0x36')]=function(_0x3bd4e9,_0x15ec56){var _0x3d9e7a={},_0x42accd={},_0x5ce618={'count':0x0,'rows':[]};var _0xf50eec=_[_0x788c('0x2d')](db['VoiceQueue'][_0x788c('0x37')],function(_0x110455){return{'name':_0x110455[_0x788c('0x38')],'type':_0x110455[_0x788c('0x2f')][_0x788c('0x39')]};});_0x42accd[_0x788c('0x3a')]=_[_0x788c('0x2d')](_0xf50eec,_0x788c('0x34'));_0x42accd[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x3bd4e9[_0x788c('0x3b')]);_0x42accd[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x42accd[_0x788c('0x3a')],_0x42accd[_0x788c('0x3b')]);_0x3d9e7a[_0x788c('0x3f')]=_[_0x788c('0x3e')](_0x42accd[_0x788c('0x3a')],qs[_0x788c('0x40')](_0x3bd4e9[_0x788c('0x3b')]['fields']));_0x3d9e7a['attributes']=_0x3d9e7a[_0x788c('0x3f')][_0x788c('0x41')]?_0x3d9e7a['attributes']:_0x42accd[_0x788c('0x3a')];if(!_0x3bd4e9['query'][_0x788c('0x42')](_0x788c('0x43'))){_0x3d9e7a[_0x788c('0x21')]=qs[_0x788c('0x21')](_0x3bd4e9[_0x788c('0x3b')][_0x788c('0x21')]);_0x3d9e7a['offset']=qs[_0x788c('0x20')](_0x3bd4e9[_0x788c('0x3b')][_0x788c('0x20')]);}_0x3d9e7a[_0x788c('0x44')]=qs['sort'](_0x3bd4e9[_0x788c('0x3b')][_0x788c('0x45')]);_0x3d9e7a[_0x788c('0x46')]=qs[_0x788c('0x3d')](_[_0x788c('0x47')](_0x3bd4e9[_0x788c('0x3b')],_0x42accd[_0x788c('0x3d')]),_0xf50eec);if(_0x3bd4e9[_0x788c('0x3b')][_0x788c('0x2b')]){_0x3d9e7a['where']=_[_0x788c('0x48')](_0x3d9e7a['where'],{'$or':_[_0x788c('0x2d')](_0xf50eec,function(_0x144ec9){if(_0x144ec9[_0x788c('0x2f')]!==_0x788c('0x49')){var _0x35a1cb={};_0x35a1cb[_0x144ec9['name']]={'$like':'%'+_0x3bd4e9[_0x788c('0x3b')][_0x788c('0x2b')]+'%'};return _0x35a1cb;}})});}_0x3d9e7a=_['merge']({},_0x3d9e7a,_0x3bd4e9['options']);var _0x546a62={'where':_0x3d9e7a[_0x788c('0x46')]};return db[_0x788c('0x4a')][_0x788c('0x1f')](_0x546a62)[_0x788c('0x26')](function(_0x1930c3){_0x5ce618[_0x788c('0x1f')]=_0x1930c3;if(_0x3bd4e9['query'][_0x788c('0x4b')]){_0x3d9e7a[_0x788c('0x4c')]=[{'all':!![]}];}return db[_0x788c('0x4a')][_0x788c('0x4d')](_0x3d9e7a);})[_0x788c('0x26')](function(_0x2eea70){_0x5ce618[_0x788c('0x4e')]=_0x2eea70;return _0x5ce618;})[_0x788c('0x26')](respondWithFilteredResult(_0x15ec56,_0x3d9e7a))[_0x788c('0x4f')](handleError(_0x15ec56,null));};exports[_0x788c('0x50')]=function(_0x34dc3f,_0x1d05a){var _0x759417={'raw':![],'where':{'id':_0x34dc3f[_0x788c('0x51')]['id']}},_0x164d42={};_0x164d42[_0x788c('0x3a')]=_[_0x788c('0x3c')](db[_0x788c('0x4a')][_0x788c('0x37')]);_0x164d42[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x34dc3f[_0x788c('0x3b')]);_0x164d42[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x164d42[_0x788c('0x3a')],_0x164d42[_0x788c('0x3b')]);_0x759417['attributes']=_[_0x788c('0x3e')](_0x164d42[_0x788c('0x3a')],qs[_0x788c('0x40')](_0x34dc3f[_0x788c('0x3b')]['fields']));_0x759417[_0x788c('0x3f')]=_0x759417['attributes']['length']?_0x759417[_0x788c('0x3f')]:_0x164d42[_0x788c('0x3a')];if(_0x34dc3f[_0x788c('0x3b')][_0x788c('0x4b')]){_0x759417['include']=[{'all':!![]}];}_0x759417=_[_0x788c('0x48')]({},_0x759417,_0x34dc3f[_0x788c('0x52')]);return db['VoiceQueue'][_0x788c('0x30')](_0x759417)['then'](handleEntityNotFound(_0x1d05a,null))[_0x788c('0x26')](respondWithResult(_0x1d05a,null))[_0x788c('0x4f')](handleError(_0x1d05a,null));};exports['create']=function(_0x4066dc,_0x49a869){return db[_0x788c('0x4a')][_0x788c('0x53')](_0x4066dc[_0x788c('0x54')],{})[_0x788c('0x26')](function(_0x176efd){var _0x119ac2=_0x4066dc[_0x788c('0x55')][_0x788c('0x56')]({'plain':!![]});if(!_0x119ac2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x119ac2[_0x788c('0x57')]==='user'){var _0x5708c5=_0x176efd[_0x788c('0x56')]({'plain':!![]});var _0x333f26=[{'name':'VoiceQueues','value':_0x788c('0x28')},{'name':_0x788c('0x29'),'value':'outbound'}];var _0x3c9b4c=_[_0x788c('0x30')](_0x333f26,[_0x788c('0x2e'),_0x5708c5[_0x788c('0x2f')]])['name'];return db[_0x788c('0x58')][_0x788c('0x30')]({'where':{'name':_0x3c9b4c,'userProfileId':_0x119ac2[_0x788c('0x59')]},'raw':!![]})[_0x788c('0x26')](function(_0x320aeb){if(_0x320aeb&&_0x320aeb['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5708c5[_0x788c('0x34')],'resourceId':_0x5708c5['id'],'type':_0x320aeb[_0x788c('0x34')],'sectionId':_0x320aeb['id']},{})[_0x788c('0x26')](function(){return _0x176efd;});}else{return _0x176efd;}})[_0x788c('0x4f')](function(_0x5ee41c){logger[_0x788c('0x33')](_0x788c('0x5a'),_0x5ee41c);throw _0x5ee41c;});}return _0x176efd;})[_0x788c('0x26')](respondWithResult(_0x49a869,0xc9))[_0x788c('0x4f')](handleError(_0x49a869,null));};exports['clone']=function(_0x5dbe4f,_0x47b7e6){var _0x4d1fa4={'where':{'id':_0x5dbe4f[_0x788c('0x51')]['id']}},_0x25b0d3={};_0x25b0d3[_0x788c('0x3a')]=_['keys'](db[_0x788c('0x4a')][_0x788c('0x37')]);_0x4d1fa4['attributes']=_[_0x788c('0x3e')](_0x25b0d3[_0x788c('0x3a')],qs[_0x788c('0x40')](_0x5dbe4f[_0x788c('0x3b')][_0x788c('0x40')]));_0x4d1fa4[_0x788c('0x3f')]=_0x4d1fa4[_0x788c('0x3f')][_0x788c('0x41')]?_0x4d1fa4[_0x788c('0x3f')]:_0x25b0d3[_0x788c('0x3a')];if(_0x5dbe4f['query'][_0x788c('0x4b')]){_0x4d1fa4[_0x788c('0x4c')]=[{'all':!![]}];}_0x4d1fa4=_[_0x788c('0x48')]({},_0x4d1fa4,_0x5dbe4f[_0x788c('0x52')]);return db[_0x788c('0x4a')][_0x788c('0x30')](_0x4d1fa4)['then'](handleEntityNotFound(_0x47b7e6,null))[_0x788c('0x26')](function(_0x4651bd){if(_0x4651bd){var _0x5d082c=_0x4651bd[_0x788c('0x56')]({'plain':!![]});_0x5d082c=qs[_0x788c('0x5b')](_0x5d082c,['id',_0x788c('0x5c'),_0x788c('0x5d')]);_0x5dbe4f[_0x788c('0x54')]=_[_0x788c('0x5b')](_0x5dbe4f[_0x788c('0x54')],['id',_0x788c('0x5c'),_0x788c('0x5d')]);return db[_0x788c('0x4a')][_0x788c('0x53')](_[_0x788c('0x48')](_0x5d082c,_0x5dbe4f['body']),{'include':_0x5dbe4f[_0x788c('0x3b')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x173ec0){var _0x50a164=_0x5dbe4f['user'][_0x788c('0x56')]({'plain':!![]});if(!_0x50a164)throw new Error(_0x788c('0x5e'));if(_0x50a164[_0x788c('0x57')]===_0x788c('0x55')){var _0x3c6ca5=_0x173ec0[_0x788c('0x56')]({'plain':!![]});var _0x36c0aa=[{'name':_0x788c('0x5f'),'value':_0x788c('0x28')},{'name':_0x788c('0x29'),'value':'outbound'}];var _0x3cd66e=_[_0x788c('0x30')](_0x36c0aa,[_0x788c('0x2e'),_0x3c6ca5[_0x788c('0x2f')]])[_0x788c('0x34')];return db[_0x788c('0x58')]['find']({'where':{'name':_0x3cd66e,'userProfileId':_0x50a164[_0x788c('0x59')]},'raw':!![]})['then'](function(_0x114634){if(_0x114634&&_0x114634[_0x788c('0x60')]===0x0){return db['UserProfileResource'][_0x788c('0x53')]({'name':_0x3c6ca5[_0x788c('0x34')],'resourceId':_0x3c6ca5['id'],'type':_0x114634[_0x788c('0x34')],'sectionId':_0x114634['id']},{})[_0x788c('0x26')](function(){return _0x173ec0;});}else{return _0x173ec0;}})[_0x788c('0x4f')](function(_0x21cde2){logger[_0x788c('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21cde2);throw _0x21cde2;});}return _0x173ec0;});}})[_0x788c('0x26')](respondWithResult(_0x47b7e6,0xc9))['catch'](handleError(_0x47b7e6,null));};exports[_0x788c('0x25')]=function(_0x26d53c,_0xd601c5){if(_0x26d53c[_0x788c('0x54')]['id']){delete _0x26d53c['body']['id'];}return db[_0x788c('0x4a')][_0x788c('0x30')]({'where':{'id':_0x26d53c[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0xd601c5,null))['then'](saveUpdates(_0x26d53c[_0x788c('0x54')],null))[_0x788c('0x26')](respondWithResult(_0xd601c5,null))[_0x788c('0x4f')](handleError(_0xd601c5,null));};exports[_0x788c('0x27')]=function(_0x5c86fe,_0x360572){return db[_0x788c('0x4a')]['find']({'where':{'id':_0x5c86fe[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x360572,null))[_0x788c('0x26')](removeEntity(_0x360572,null))[_0x788c('0x4f')](handleError(_0x360572,null));};exports[_0x788c('0x61')]=function(_0x1b791f,_0xe7b87a,_0x3e31fc){var _0x269758={'raw':![],'where':{}};var _0x151455={};var _0x215c71={'count':0x0,'rows':[]};return db[_0x788c('0x4a')][_0x788c('0x62')]({'where':{'id':_0x1b791f['params']['id']}})['then'](handleEntityNotFound(_0xe7b87a,null))[_0x788c('0x26')](function(_0x4695a2){if(_0x4695a2){_0x151455['model']=_['keys'](db[_0x788c('0x63')]['rawAttributes']);_0x151455[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x1b791f[_0x788c('0x3b')]);_0x151455[_0x788c('0x3d')]=_['intersection'](_0x151455[_0x788c('0x3a')],_0x151455[_0x788c('0x3b')]);_0x269758[_0x788c('0x3f')]=_[_0x788c('0x3e')](_0x151455[_0x788c('0x3a')],qs[_0x788c('0x40')](_0x1b791f['query'][_0x788c('0x40')]));_0x269758[_0x788c('0x3f')]=_0x269758[_0x788c('0x3f')]['length']?_0x269758[_0x788c('0x3f')]:_0x151455[_0x788c('0x3a')];if(!_0x1b791f[_0x788c('0x3b')][_0x788c('0x42')](_0x788c('0x43'))){_0x269758[_0x788c('0x21')]=qs['limit'](_0x1b791f[_0x788c('0x3b')][_0x788c('0x21')]);_0x269758[_0x788c('0x20')]=qs[_0x788c('0x20')](_0x1b791f[_0x788c('0x3b')]['offset']);}_0x269758['order']=qs[_0x788c('0x45')](_0x1b791f[_0x788c('0x3b')]['sort']);_0x269758[_0x788c('0x46')]=qs[_0x788c('0x3d')](_[_0x788c('0x47')](_0x1b791f[_0x788c('0x3b')],_0x151455[_0x788c('0x3d')]));_0x269758[_0x788c('0x46')][_0x788c('0x64')]=_0x4695a2['id'];if(_0x1b791f['query']['filter']){_0x269758['where']=_[_0x788c('0x48')](_0x269758[_0x788c('0x46')],{'$or':_[_0x788c('0x2d')](_0x269758['attributes'],function(_0x117a1f){var _0x2122b1={};_0x2122b1[_0x117a1f]={'$like':'%'+_0x1b791f['query'][_0x788c('0x2b')]+'%'};return _0x2122b1;})});}_0x269758=_[_0x788c('0x48')]({},_0x269758,_0x1b791f['options']);return db[_0x788c('0x63')][_0x788c('0x1f')]({'where':_0x269758[_0x788c('0x46')]})[_0x788c('0x26')](function(_0x383186){_0x215c71[_0x788c('0x1f')]=_0x383186;if(_0x1b791f[_0x788c('0x3b')]['includeAll']){_0x269758[_0x788c('0x4c')]=[{'all':!![]}];}return db[_0x788c('0x63')][_0x788c('0x4d')](_0x269758);})['then'](function(_0x4a981e){_0x215c71[_0x788c('0x4e')]=_0x4a981e;return _0x215c71;});}})[_0x788c('0x26')](respondWithFilteredResult(_0xe7b87a,_0x269758))[_0x788c('0x4f')](handleError(_0xe7b87a,null));};exports['getHopperHistories']=function(_0x2ca145,_0x5e640b,_0x4152a6){var _0x308d9a={'raw':!![],'where':{}};var _0x5e4f0e={};var _0x1f77ab={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x788c('0x62')]({'where':{'id':_0x2ca145[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x5e640b,null))[_0x788c('0x26')](function(_0x17c4b3){if(_0x17c4b3){_0x5e4f0e[_0x788c('0x3a')]=_[_0x788c('0x3c')](db[_0x788c('0x65')][_0x788c('0x37')]);_0x5e4f0e[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x2ca145[_0x788c('0x3b')]);_0x5e4f0e[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x5e4f0e[_0x788c('0x3a')],_0x5e4f0e[_0x788c('0x3b')]);_0x308d9a[_0x788c('0x3f')]=_[_0x788c('0x3e')](_0x5e4f0e['model'],qs[_0x788c('0x40')](_0x2ca145[_0x788c('0x3b')][_0x788c('0x40')]));_0x308d9a[_0x788c('0x3f')]=_0x308d9a[_0x788c('0x3f')][_0x788c('0x41')]?_0x308d9a['attributes']:_0x5e4f0e[_0x788c('0x3a')];if(!_0x2ca145[_0x788c('0x3b')][_0x788c('0x42')](_0x788c('0x43'))){_0x308d9a[_0x788c('0x21')]=qs[_0x788c('0x21')](_0x2ca145[_0x788c('0x3b')][_0x788c('0x21')]);_0x308d9a[_0x788c('0x20')]=qs[_0x788c('0x20')](_0x2ca145[_0x788c('0x3b')][_0x788c('0x20')]);}_0x308d9a[_0x788c('0x44')]=qs[_0x788c('0x45')](_0x2ca145[_0x788c('0x3b')]['sort']);_0x308d9a[_0x788c('0x46')]=qs[_0x788c('0x3d')](_['pick'](_0x2ca145[_0x788c('0x3b')],_0x5e4f0e[_0x788c('0x3d')]));_0x308d9a[_0x788c('0x46')][_0x788c('0x64')]=_0x17c4b3['id'];if(_0x2ca145[_0x788c('0x3b')][_0x788c('0x2b')]){_0x308d9a[_0x788c('0x46')]=_[_0x788c('0x48')](_0x308d9a[_0x788c('0x46')],{'$or':_[_0x788c('0x2d')](_0x308d9a['attributes'],function(_0x3bc4f9){var _0x26ea64={};_0x26ea64[_0x3bc4f9]={'$like':'%'+_0x2ca145[_0x788c('0x3b')][_0x788c('0x2b')]+'%'};return _0x26ea64;})});}_0x308d9a=_[_0x788c('0x48')]({},_0x308d9a,_0x2ca145['options']);return db[_0x788c('0x65')][_0x788c('0x1f')]({'where':_0x308d9a[_0x788c('0x46')]})[_0x788c('0x26')](function(_0x5075c3){_0x1f77ab['count']=_0x5075c3;if(_0x2ca145[_0x788c('0x3b')][_0x788c('0x4b')]){_0x308d9a[_0x788c('0x4c')]=[{'all':!![]}];}return db[_0x788c('0x65')][_0x788c('0x4d')](_0x308d9a);})[_0x788c('0x26')](function(_0x4818c3){_0x1f77ab[_0x788c('0x4e')]=_0x4818c3;return _0x1f77ab;});}})[_0x788c('0x26')](respondWithFilteredResult(_0x5e640b,_0x308d9a))[_0x788c('0x4f')](handleError(_0x5e640b,null));};exports[_0x788c('0x66')]=function(_0x2b6dba,_0x477332,_0x36e873){var _0x72be80={'raw':!![],'where':{}};var _0x35bfee={};var _0x3a0e7d={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x2b6dba[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x477332,null))[_0x788c('0x26')](function(_0x32953d){if(_0x32953d){_0x35bfee[_0x788c('0x3a')]=_[_0x788c('0x3c')](db[_0x788c('0x67')][_0x788c('0x37')]);_0x35bfee[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x2b6dba[_0x788c('0x3b')]);_0x35bfee[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x35bfee[_0x788c('0x3a')],_0x35bfee[_0x788c('0x3b')]);_0x72be80[_0x788c('0x3f')]=_[_0x788c('0x3e')](_0x35bfee[_0x788c('0x3a')],qs[_0x788c('0x40')](_0x2b6dba[_0x788c('0x3b')][_0x788c('0x40')]));_0x72be80[_0x788c('0x3f')]=_0x72be80[_0x788c('0x3f')][_0x788c('0x41')]?_0x72be80[_0x788c('0x3f')]:_0x35bfee[_0x788c('0x3a')];if(!_0x2b6dba[_0x788c('0x3b')][_0x788c('0x42')](_0x788c('0x43'))){_0x72be80[_0x788c('0x21')]=qs[_0x788c('0x21')](_0x2b6dba['query'][_0x788c('0x21')]);_0x72be80[_0x788c('0x20')]=qs[_0x788c('0x20')](_0x2b6dba[_0x788c('0x3b')][_0x788c('0x20')]);}_0x72be80['order']=qs[_0x788c('0x45')](_0x2b6dba[_0x788c('0x3b')]['sort']);_0x72be80[_0x788c('0x46')]=qs[_0x788c('0x3d')](_[_0x788c('0x47')](_0x2b6dba[_0x788c('0x3b')],_0x35bfee[_0x788c('0x3d')]));_0x72be80[_0x788c('0x46')][_0x788c('0x64')]=_0x32953d['id'];if(_0x2b6dba[_0x788c('0x3b')][_0x788c('0x2b')]){_0x72be80[_0x788c('0x46')]=_[_0x788c('0x48')](_0x72be80[_0x788c('0x46')],{'$or':_[_0x788c('0x2d')](_0x72be80['attributes'],function(_0x1363ba){var _0x1e9a3d={};_0x1e9a3d[_0x1363ba]={'$like':'%'+_0x2b6dba[_0x788c('0x3b')]['filter']+'%'};return _0x1e9a3d;})});}_0x72be80=_['merge']({},_0x72be80,_0x2b6dba[_0x788c('0x52')]);return db[_0x788c('0x67')][_0x788c('0x1f')]({'where':_0x72be80[_0x788c('0x46')]})[_0x788c('0x26')](function(_0x3af27a){_0x3a0e7d[_0x788c('0x1f')]=_0x3af27a;if(_0x2b6dba[_0x788c('0x3b')]['includeAll']){_0x72be80[_0x788c('0x4c')]=[{'all':!![]}];}return db[_0x788c('0x67')][_0x788c('0x4d')](_0x72be80);})['then'](function(_0x426103){_0x3a0e7d[_0x788c('0x4e')]=_0x426103;return _0x3a0e7d;});}})[_0x788c('0x26')](respondWithFilteredResult(_0x477332,_0x72be80))[_0x788c('0x4f')](handleError(_0x477332,null));};exports[_0x788c('0x68')]=function(_0x25a83d,_0x1181f8,_0x4e4745){var _0xc9aa4b={'raw':!![],'where':{}};var _0x2dc214={};var _0x5b185e={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x25a83d['params']['id']}})['then'](handleEntityNotFound(_0x1181f8,null))[_0x788c('0x26')](function(_0x2e4dd6){if(_0x2e4dd6){_0x2dc214[_0x788c('0x3a')]=_[_0x788c('0x3c')](db[_0x788c('0x69')][_0x788c('0x37')]);_0x2dc214[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x25a83d[_0x788c('0x3b')]);_0x2dc214[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x2dc214['model'],_0x2dc214['query']);_0xc9aa4b[_0x788c('0x3f')]=_[_0x788c('0x3e')](_0x2dc214[_0x788c('0x3a')],qs['fields'](_0x25a83d['query'][_0x788c('0x40')]));_0xc9aa4b['attributes']=_0xc9aa4b[_0x788c('0x3f')][_0x788c('0x41')]?_0xc9aa4b['attributes']:_0x2dc214['model'];if(!_0x25a83d['query'][_0x788c('0x42')]('nolimit')){_0xc9aa4b[_0x788c('0x21')]=qs['limit'](_0x25a83d['query']['limit']);_0xc9aa4b[_0x788c('0x20')]=qs[_0x788c('0x20')](_0x25a83d[_0x788c('0x3b')][_0x788c('0x20')]);}_0xc9aa4b[_0x788c('0x44')]=qs[_0x788c('0x45')](_0x25a83d['query']['sort']);_0xc9aa4b[_0x788c('0x46')]=qs[_0x788c('0x3d')](_[_0x788c('0x47')](_0x25a83d[_0x788c('0x3b')],_0x2dc214[_0x788c('0x3d')]));_0xc9aa4b[_0x788c('0x46')][_0x788c('0x64')]=_0x2e4dd6['id'];if(_0x25a83d[_0x788c('0x3b')][_0x788c('0x2b')]){_0xc9aa4b[_0x788c('0x46')]=_['merge'](_0xc9aa4b[_0x788c('0x46')],{'$or':_[_0x788c('0x2d')](_0xc9aa4b[_0x788c('0x3f')],function(_0x5c2ca1){var _0x46b5b5={};_0x46b5b5[_0x5c2ca1]={'$like':'%'+_0x25a83d[_0x788c('0x3b')][_0x788c('0x2b')]+'%'};return _0x46b5b5;})});}_0xc9aa4b=_[_0x788c('0x48')]({},_0xc9aa4b,_0x25a83d[_0x788c('0x52')]);return db[_0x788c('0x69')][_0x788c('0x1f')]({'where':_0xc9aa4b[_0x788c('0x46')]})[_0x788c('0x26')](function(_0x2f6733){_0x5b185e['count']=_0x2f6733;if(_0x25a83d[_0x788c('0x3b')]['includeAll']){_0xc9aa4b[_0x788c('0x4c')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x788c('0x4d')](_0xc9aa4b);})[_0x788c('0x26')](function(_0x20d467){_0x5b185e[_0x788c('0x4e')]=_0x20d467;return _0x5b185e;});}})[_0x788c('0x26')](respondWithFilteredResult(_0x1181f8,_0xc9aa4b))[_0x788c('0x4f')](handleError(_0x1181f8,null));};exports[_0x788c('0x6a')]=function(_0x434bc7,_0x3ff88d,_0x473990){var _0x1c0b82={};var _0x54cbf8={};var _0x1f6bbd;var _0x4553ee;return db[_0x788c('0x4a')][_0x788c('0x62')]({'where':{'id':_0x434bc7[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x3ff88d,null))[_0x788c('0x26')](function(_0x4733e8){if(_0x4733e8){_0x1f6bbd=_0x4733e8;_0x54cbf8[_0x788c('0x3a')]=_[_0x788c('0x3c')](db[_0x788c('0x6b')][_0x788c('0x37')]);_0x54cbf8[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x434bc7[_0x788c('0x3b')]);_0x54cbf8['filters']=_[_0x788c('0x3e')](_0x54cbf8[_0x788c('0x3a')],_0x54cbf8['query']);_0x1c0b82[_0x788c('0x3f')]=_['intersection'](_0x54cbf8[_0x788c('0x3a')],qs[_0x788c('0x40')](_0x434bc7[_0x788c('0x3b')][_0x788c('0x40')]));_0x1c0b82[_0x788c('0x3f')]=_0x1c0b82[_0x788c('0x3f')][_0x788c('0x41')]?_0x1c0b82[_0x788c('0x3f')]:_0x54cbf8[_0x788c('0x3a')];_0x1c0b82[_0x788c('0x44')]=qs['sort'](_0x434bc7[_0x788c('0x3b')][_0x788c('0x45')]);_0x1c0b82['where']=qs[_0x788c('0x3d')](_[_0x788c('0x47')](_0x434bc7['query'],_0x54cbf8['filters']));if(_0x434bc7[_0x788c('0x3b')][_0x788c('0x2b')]){_0x1c0b82[_0x788c('0x46')]=_[_0x788c('0x48')](_0x1c0b82['where'],{'$or':_[_0x788c('0x2d')](_0x1c0b82[_0x788c('0x3f')],function(_0x43e51d){var _0x1a1929={};_0x1a1929[_0x43e51d]={'$like':'%'+_0x434bc7[_0x788c('0x3b')]['filter']+'%'};return _0x1a1929;})});}_0x1c0b82=_[_0x788c('0x48')]({},_0x1c0b82,_0x434bc7[_0x788c('0x52')]);return _0x1f6bbd['getTeams'](_0x1c0b82);}})[_0x788c('0x26')](function(_0x206cd2){if(_0x206cd2){_0x4553ee=_0x206cd2['length'];if(!_0x434bc7[_0x788c('0x3b')][_0x788c('0x42')](_0x788c('0x43'))){_0x1c0b82['limit']=qs[_0x788c('0x21')](_0x434bc7[_0x788c('0x3b')][_0x788c('0x21')]);_0x1c0b82[_0x788c('0x20')]=qs[_0x788c('0x20')](_0x434bc7[_0x788c('0x3b')]['offset']);}return _0x1f6bbd[_0x788c('0x6a')](_0x1c0b82);}})['then'](function(_0x50f6f4){if(_0x50f6f4){return _0x50f6f4?{'count':_0x4553ee,'rows':_0x50f6f4}:null;}})[_0x788c('0x26')](respondWithResult(_0x3ff88d,null))['catch'](handleError(_0x3ff88d,null));};exports[_0x788c('0x6c')]=function(_0x558b5d,_0x1a1e23,_0x14ec29){var _0x250b00=_0x558b5d[_0x788c('0x54')][_0x788c('0x6d')];var _0x3def38=_[_0x788c('0x2d')](_0x250b00,'id');return db[_0x788c('0x6b')][_0x788c('0x4d')]({'where':{'id':_0x3def38},'attributes':['id'],'include':[{'model':db[_0x788c('0x6e')],'as':_0x788c('0x6f'),'attributes':['id',_0x788c('0x34'),_0x788c('0x70'),_0x788c('0x71'),_0x788c('0x72')],'raw':!![]}]})[_0x788c('0x26')](function(_0x3fab76){if(_0x3fab76){var _0x380915=_[_0x788c('0x73')](_0x3fab76,function(_0x231028){var _0x5200d2=_0x231028[_0x788c('0x56')]({'plain':!![]});_0x5200d2[_0x788c('0x6f')][_0x788c('0x74')](function(_0x3a81d8){_0x3a81d8['penalty']=_[_0x788c('0x30')](_0x250b00,{'id':_0x5200d2['id']})[_0x788c('0x75')];});return _0x5200d2[_0x788c('0x6f')];});return db[_0x788c('0x4a')][_0x788c('0x30')]({'where':{'id':_0x558b5d[_0x788c('0x51')]['id']}})[_0x788c('0x26')](function(_0x30352e){return db[_0x788c('0x76')][_0x788c('0x77')](function(_0x4e757d){return _0x30352e[_0x788c('0x6c')](_0x3def38,{'transaction':_0x4e757d})[_0x788c('0x26')](function(){return BPromise[_0x788c('0x78')](_0x380915,function(_0x1c9eab){return db[_0x788c('0x79')]['findOrCreate']({'where':{'UserId':_0x1c9eab['id'],'VoiceQueueId':_0x558b5d[_0x788c('0x51')]['id']},'defaults':{'penalty':_0x1c9eab[_0x788c('0x75')]},'transaction':_0x4e757d});});})[_0x788c('0x26')](function(){return BPromise[_0x788c('0x78')](_[_0x788c('0x2b')](_0x380915,{'online':!![]}),function(_0x1542ae){return db[_0x788c('0x7a')][_0x788c('0x7b')]({'membername':_0x1542ae[_0x788c('0x34')],'UserId':_0x1542ae['id'],'queue_name':_0x30352e[_0x788c('0x34')],'VoiceQueueId':_0x30352e['id'],'interface':_[_0x788c('0x7c')](_0x1542ae['interface'])?util[_0x788c('0x7d')](_0x788c('0x7e'),_0x1542ae['name']):_0x1542ae[_0x788c('0x72')],'paused':_0x1542ae[_0x788c('0x71')]||![],'penalty':_0x1542ae[_0x788c('0x75')]},{'transaction':_0x4e757d});});})[_0x788c('0x26')](function(){_0x380915['forEach'](function(_0x4b9ffb){socket[_0x788c('0x7f')]('userVoiceQueue:save',{'UserId':_0x4b9ffb['id'],'VoiceQueueId':_0x30352e['id']});});});});});}})['then'](respondWithStatusCode(_0x1a1e23,null))[_0x788c('0x4f')](handleError(_0x1a1e23,null));};exports['removeTeams']=function(_0x333ab4,_0x444744,_0x211e14){return db[_0x788c('0x6b')][_0x788c('0x4d')]({'where':{'id':_0x333ab4[_0x788c('0x3b')][_0x788c('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x788c('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x788c('0x26')](handleEntityNotFound(_0x444744,null))['then'](function(_0x22af88){var _0x32f726=_[_0x788c('0x2d')](_0x22af88,'id');var _0x402705=[];var _0x39ec2a=[];var _0x13148a=squel[_0x788c('0x81')]();_0x13148a['field'](_0x788c('0x82'))[_0x788c('0x83')](_0x788c('0x84'),'tq')[_0x788c('0x85')](_0x788c('0x86'),'ut',_0x788c('0x87'))[_0x788c('0x46')](_0x788c('0x88'),_0x333ab4[_0x788c('0x51')]['id']);for(var _0x34bb55=0x0;_0x34bb55<_0x22af88[_0x788c('0x41')];_0x34bb55+=0x1){let _0x1814ca=_0x22af88[_0x34bb55];for(var _0x23073b=0x0;_0x23073b<_0x1814ca[_0x788c('0x6f')][_0x788c('0x41')];_0x23073b+=0x1){let _0x60adc0=_0x1814ca[_0x788c('0x6f')][_0x23073b];var _0x13e2f5=_0x13148a[_0x788c('0x89')]();_0x13e2f5[_0x788c('0x46')](_0x788c('0x8a'),_0x60adc0['id']);_0x39ec2a[_0x788c('0x8b')](db['sequelize'][_0x788c('0x3b')](_0x13e2f5[_0x788c('0x8c')](),{'type':db[_0x788c('0x76')][_0x788c('0x8d')][_0x788c('0x8e')]})[_0x788c('0x26')](function(_0x436654){if(_0x436654[_0x788c('0x41')]===0x1){return _0x60adc0['id'];}else{var _0x2449bd=_['every'](_[_0x788c('0x2d')](_0x436654,_0x788c('0x8f')),function(_0x2ec097){return _[_0x788c('0x90')](_0x32f726,_0x2ec097);});if(_0x2449bd){return _0x60adc0['id'];}}}));}}return BPromise['all'](_0x39ec2a)[_0x788c('0x26')](function(_0x20d641){_0x402705=_(_0x402705)[_0x788c('0x91')](_0x20d641)[_0x788c('0x92')]()[_0x788c('0x2e')]();return db[_0x788c('0x4a')][_0x788c('0x30')]({'where':{'id':_0x333ab4[_0x788c('0x51')]['id']}})[_0x788c('0x26')](function(_0x1879ee){return db[_0x788c('0x76')][_0x788c('0x77')](function(_0x3a1ee2){return _0x1879ee[_0x788c('0x93')](_0x333ab4['query'][_0x788c('0x80')],{'transaction':_0x3a1ee2})['then'](function(){if(!_[_0x788c('0x94')](_0x402705)){return _0x1879ee['removeAgents'](_0x402705,{'transaction':_0x3a1ee2})['then'](function(){return db[_0x788c('0x7a')][_0x788c('0x27')]({'where':{'VoiceQueueId':_0x333ab4[_0x788c('0x51')]['id'],'UserId':_0x402705},'transaction':_0x3a1ee2});});}})[_0x788c('0x26')](function(){_0x402705[_0x788c('0x74')](function(_0x107fab){socket[_0x788c('0x7f')]('userVoiceQueue:remove',{'UserId':_0x107fab,'VoiceQueueId':_0x1879ee['id']});});});});});});})['then'](respondWithStatusCode(_0x444744,null))[_0x788c('0x4f')](handleError(_0x444744,null));};exports['addAgents']=function(_0x41433f,_0x29b1a4,_0x2ae74e){var _0x52120,_0x4d92ff;return db[_0x788c('0x4a')][_0x788c('0x30')]({'where':{'id':_0x41433f['params']['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x29b1a4,null))[_0x788c('0x26')](function(_0x150733){if(_0x150733){_0x4d92ff=_0x150733;return _0x150733[_0x788c('0x95')](_0x41433f[_0x788c('0x54')][_0x788c('0x80')],_[_0x788c('0x5b')](_0x41433f[_0x788c('0x54')],['ids','id'])||{})[_0x788c('0x96')](function(_0x3aecd2){for(var _0x3312d8=0x0;_0x3312d8<_0x41433f[_0x788c('0x54')]['ids']['length'];_0x3312d8+=0x1){socket[_0x788c('0x7f')]('userVoiceQueue:save',{'UserId':_0x41433f[_0x788c('0x54')][_0x788c('0x80')][_0x3312d8],'VoiceQueueId':_0x41433f[_0x788c('0x51')]['id']});}return _0x3aecd2;});}})[_0x788c('0x26')](function(_0x57d36e){_0x52120=_0x57d36e||[];if(_0x4d92ff){return db[_0x788c('0x6e')][_0x788c('0x4d')]({'where':{'id':_0x41433f[_0x788c('0x54')][_0x788c('0x80')]},'attributes':['id',_0x788c('0x34'),_0x788c('0x70'),_0x788c('0x71'),_0x788c('0x72')],'raw':!![]});}})[_0x788c('0x26')](function(_0x52a618){if(!_['isEmpty'](_0x52a618)){var _0x87c2ee=[];for(var _0x8d3484=0x0;_0x8d3484<_0x52a618[_0x788c('0x41')];_0x8d3484++){if(_0x52a618[_0x8d3484]['online']){_0x87c2ee[_0x788c('0x8b')](db[_0x788c('0x7a')][_0x788c('0x7b')]({'membername':_0x52a618[_0x8d3484][_0x788c('0x34')],'UserId':_0x52a618[_0x8d3484]['id'],'queue_name':_0x4d92ff['name'],'VoiceQueueId':_0x4d92ff['id'],'interface':_[_0x788c('0x7c')](_0x52a618[_0x8d3484][_0x788c('0x72')])?util['format'](_0x788c('0x7e'),_0x52a618[_0x8d3484][_0x788c('0x34')]):_0x52a618[_0x8d3484][_0x788c('0x72')],'paused':_0x52a618[_0x8d3484]['voicePause']||![],'penalty':_0x41433f['body'][_0x788c('0x75')]||0x0}));}}return BPromise[_0x788c('0x97')](_0x87c2ee);}})[_0x788c('0x26')](function(){return _0x52120;})[_0x788c('0x26')](respondWithResult(_0x29b1a4,null))[_0x788c('0x4f')](handleError(_0x29b1a4,null));};exports[_0x788c('0x98')]=function(_0x3bfbdd,_0x28194a,_0x341902){return db[_0x788c('0x4a')][_0x788c('0x30')]({'where':{'id':_0x3bfbdd['params']['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x28194a,null))[_0x788c('0x26')](function(_0x516ed5){if(_0x516ed5){return _0x516ed5[_0x788c('0x98')](_0x3bfbdd[_0x788c('0x3b')][_0x788c('0x80')])[_0x788c('0x26')](function(){if(_['isArray'](_0x3bfbdd[_0x788c('0x3b')][_0x788c('0x80')])){for(var _0x492b0c=0x0;_0x492b0c<_0x3bfbdd[_0x788c('0x3b')][_0x788c('0x80')][_0x788c('0x41')];_0x492b0c+=0x1){socket['emit'](_0x788c('0x99'),{'UserId':Number(_0x3bfbdd['query']['ids'][_0x492b0c]),'VoiceQueueId':Number(_0x3bfbdd[_0x788c('0x51')]['id'])});}}else{socket['emit'](_0x788c('0x99'),{'UserId':Number(_0x3bfbdd[_0x788c('0x3b')]['ids']),'VoiceQueueId':Number(_0x3bfbdd[_0x788c('0x51')]['id'])});}});}})['then'](function(_0x3e3cd3){return db[_0x788c('0x7a')]['destroy']({'where':{'VoiceQueueId':_0x3bfbdd['params']['id'],'UserId':_0x3bfbdd[_0x788c('0x3b')][_0x788c('0x80')]}})[_0x788c('0x26')](function(){return _0x3e3cd3;});})[_0x788c('0x26')](respondWithStatusCode(_0x28194a,null))[_0x788c('0x4f')](handleError(_0x28194a,null));};exports[_0x788c('0x9a')]=function(_0x54936c,_0x470b3a,_0x4d0046){var _0x41c804={};var _0x2c534e={};var _0xeb81ee;var _0x24a699;return db[_0x788c('0x4a')][_0x788c('0x62')]({'where':{'id':_0x54936c[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x470b3a,null))['then'](function(_0x35633f){if(_0x35633f){_0xeb81ee=_0x35633f;_0x2c534e[_0x788c('0x3a')]=_[_0x788c('0x3c')](db[_0x788c('0x6e')][_0x788c('0x37')]);_0x2c534e[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x54936c[_0x788c('0x3b')]);_0x2c534e['filters']=_['intersection'](_0x2c534e[_0x788c('0x3a')],_0x2c534e[_0x788c('0x3b')]);_0x41c804['attributes']=_[_0x788c('0x3e')](_0x2c534e[_0x788c('0x3a')],qs[_0x788c('0x40')](_0x54936c[_0x788c('0x3b')]['fields']));_0x41c804[_0x788c('0x3f')]=_0x41c804[_0x788c('0x3f')][_0x788c('0x41')]?_0x41c804[_0x788c('0x3f')]:_0x2c534e[_0x788c('0x3a')];_0x41c804[_0x788c('0x44')]=qs[_0x788c('0x45')](_0x54936c[_0x788c('0x3b')][_0x788c('0x45')]);_0x41c804[_0x788c('0x46')]=qs['filters'](_[_0x788c('0x47')](_0x54936c[_0x788c('0x3b')],_0x2c534e[_0x788c('0x3d')]));if(_0x54936c[_0x788c('0x3b')][_0x788c('0x2b')]){_0x41c804[_0x788c('0x46')]=_[_0x788c('0x48')](_0x41c804[_0x788c('0x46')],{'$or':_[_0x788c('0x2d')](_0x41c804[_0x788c('0x3f')],function(_0x18b6b6){var _0x104616={};_0x104616[_0x18b6b6]={'$like':'%'+_0x54936c[_0x788c('0x3b')]['filter']+'%'};return _0x104616;})});}_0x41c804=_[_0x788c('0x48')]({},_0x41c804,_0x54936c[_0x788c('0x52')]);return _0xeb81ee[_0x788c('0x9a')](_0x41c804);}})[_0x788c('0x26')](function(_0x3fb6d2){if(_0x3fb6d2){_0x24a699=_0x3fb6d2[_0x788c('0x41')];if(!_0x54936c[_0x788c('0x3b')][_0x788c('0x42')](_0x788c('0x43'))){_0x41c804[_0x788c('0x21')]=qs[_0x788c('0x21')](_0x54936c[_0x788c('0x3b')]['limit']);_0x41c804[_0x788c('0x20')]=qs[_0x788c('0x20')](_0x54936c[_0x788c('0x3b')][_0x788c('0x20')]);}return _0xeb81ee['getAgents'](_0x41c804);}})['then'](function(_0x53db51){if(_0x53db51){return _0x53db51?{'count':_0x24a699,'rows':_0x53db51}:null;}})[_0x788c('0x26')](respondWithResult(_0x470b3a,null))['catch'](handleError(_0x470b3a,null));};exports['getMembers']=function(_0x3f5dc1,_0x416be3,_0x267313){var _0x59e4ec={};var _0x4105c3={};var _0x9cd95c;var _0x2cddba;return db['VoiceQueue'][_0x788c('0x62')]({'where':{'id':_0x3f5dc1[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x416be3,null))['then'](function(_0x52e22e){if(_0x52e22e){_0x9cd95c=_0x52e22e;_0x4105c3[_0x788c('0x3a')]=_[_0x788c('0x3c')](db[_0x788c('0x7a')][_0x788c('0x37')]);_0x4105c3['query']=_[_0x788c('0x3c')](_0x3f5dc1['query']);_0x4105c3[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x4105c3[_0x788c('0x3a')],_0x4105c3[_0x788c('0x3b')]);_0x59e4ec['attributes']=_[_0x788c('0x3e')](_0x4105c3[_0x788c('0x3a')],qs[_0x788c('0x40')](_0x3f5dc1[_0x788c('0x3b')][_0x788c('0x40')]));_0x59e4ec['attributes']=_0x59e4ec['attributes'][_0x788c('0x41')]?_0x59e4ec['attributes']:_0x4105c3[_0x788c('0x3a')];_0x59e4ec[_0x788c('0x44')]=qs['sort'](_0x3f5dc1[_0x788c('0x3b')][_0x788c('0x45')]);_0x59e4ec[_0x788c('0x46')]=qs['filters'](_['pick'](_0x3f5dc1[_0x788c('0x3b')],_0x4105c3[_0x788c('0x3d')]));if(_0x3f5dc1[_0x788c('0x3b')][_0x788c('0x2b')]){_0x59e4ec[_0x788c('0x46')]=_['merge'](_0x59e4ec[_0x788c('0x46')],{'$or':_[_0x788c('0x2d')](_0x59e4ec[_0x788c('0x3f')],function(_0x1a933a){var _0x261b39={};_0x261b39[_0x1a933a]={'$like':'%'+_0x3f5dc1[_0x788c('0x3b')][_0x788c('0x2b')]+'%'};return _0x261b39;})});}_0x59e4ec=_['merge']({},_0x59e4ec,_0x3f5dc1[_0x788c('0x52')]);return _0x9cd95c[_0x788c('0x9b')](_0x59e4ec);}})['then'](function(_0x3bc037){if(_0x3bc037){_0x2cddba=_0x3bc037['length'];if(!_0x3f5dc1['query'][_0x788c('0x42')]('nolimit')){_0x59e4ec[_0x788c('0x21')]=qs['limit'](_0x3f5dc1[_0x788c('0x3b')][_0x788c('0x21')]);_0x59e4ec[_0x788c('0x20')]=qs[_0x788c('0x20')](_0x3f5dc1['query']['offset']);}return _0x9cd95c[_0x788c('0x9b')](_0x59e4ec);}})[_0x788c('0x26')](function(_0x3f224e){return _0x3f224e?{'count':_0x2cddba,'rows':_0x3f224e}:null;})[_0x788c('0x26')](respondWithResult(_0x416be3,null))['catch'](handleError(_0x416be3,null));};exports[_0x788c('0x9c')]=function(_0x210ea9,_0x136c0a,_0x1ebd22){var _0x4bc143={};var _0x5da1d1={};var _0x55a737;var _0x36eccc;return db[_0x788c('0x4a')]['findOne']({'where':{'id':_0x210ea9[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x136c0a,null))[_0x788c('0x26')](function(_0x476c8d){if(_0x476c8d){_0x55a737=_0x476c8d;_0x5da1d1[_0x788c('0x3a')]=_['keys'](db[_0x788c('0x9d')][_0x788c('0x37')]);_0x5da1d1[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x210ea9[_0x788c('0x3b')]);_0x5da1d1[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x5da1d1['model'],_0x5da1d1[_0x788c('0x3b')]);_0x4bc143[_0x788c('0x3f')]=_[_0x788c('0x3e')](_0x5da1d1['model'],qs[_0x788c('0x40')](_0x210ea9[_0x788c('0x3b')][_0x788c('0x40')]));_0x4bc143[_0x788c('0x3f')]=_0x4bc143[_0x788c('0x3f')][_0x788c('0x41')]?_0x4bc143['attributes']:_0x5da1d1[_0x788c('0x3a')];_0x4bc143[_0x788c('0x44')]=qs[_0x788c('0x45')](_0x210ea9[_0x788c('0x3b')][_0x788c('0x45')]);_0x4bc143[_0x788c('0x46')]=qs[_0x788c('0x3d')](_[_0x788c('0x47')](_0x210ea9['query'],_0x5da1d1[_0x788c('0x3d')]));if(_0x210ea9['query']['filter']){_0x4bc143[_0x788c('0x46')]=_[_0x788c('0x48')](_0x4bc143['where'],{'$or':_[_0x788c('0x2d')](_0x4bc143[_0x788c('0x3f')],function(_0x3e6812){var _0x2f2317={};_0x2f2317[_0x3e6812]={'$like':'%'+_0x210ea9[_0x788c('0x3b')][_0x788c('0x2b')]+'%'};return _0x2f2317;})});}_0x4bc143=_[_0x788c('0x48')]({},_0x4bc143,_0x210ea9[_0x788c('0x52')]);return _0x55a737['getLists'](_0x4bc143);}})[_0x788c('0x26')](function(_0x2a9ac5){if(_0x2a9ac5){_0x36eccc=_0x2a9ac5['length'];if(!_0x210ea9[_0x788c('0x3b')]['hasOwnProperty']('nolimit')){_0x4bc143[_0x788c('0x21')]=qs[_0x788c('0x21')](_0x210ea9[_0x788c('0x3b')]['limit']);_0x4bc143[_0x788c('0x20')]=qs[_0x788c('0x20')](_0x210ea9['query'][_0x788c('0x20')]);}return _0x55a737[_0x788c('0x9c')](_0x4bc143);}})['then'](function(_0x2f7a1c){if(_0x2f7a1c){return _0x2f7a1c?{'count':_0x36eccc,'rows':_0x2f7a1c}:null;}})[_0x788c('0x26')](respondWithResult(_0x136c0a,null))[_0x788c('0x4f')](handleError(_0x136c0a,null));};exports[_0x788c('0x9e')]=function(_0x2ef77f,_0x330215,_0x2e5f86){var _0x2e9ff0,_0x4a88ea;return db['VoiceQueue']['find']({'where':{'id':_0x2ef77f[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x330215,null))[_0x788c('0x26')](function(_0x2ea80b){if(_0x2ea80b){_0x4a88ea=_0x2ea80b;return _0x2ea80b['addLists'](_0x2ef77f[_0x788c('0x54')][_0x788c('0x80')],_[_0x788c('0x5b')](_0x2ef77f[_0x788c('0x54')],['ids','id'])||{});}return null;})[_0x788c('0x96')](function(_0x1a0f09){var _0xb414d4;_0x2e9ff0=_0x1a0f09||[];var _0xb14bd9=[];if(_0x1a0f09){for(var _0x43c655=0x0;_0x43c655<_0x1a0f09[_0x788c('0x41')];_0x43c655+=0x1){var _0x980bc8=_0x1a0f09[_0x43c655][_0x788c('0x56')]({'plain':!![]});_0x4a88ea[_0x788c('0x9f')]=_0x2ef77f[_0x788c('0x54')]['dialCheckDuplicateType']?_0x2ef77f[_0x788c('0x54')]['dialCheckDuplicateType']:_0x4a88ea['dialCheckDuplicateType'];switch(_0x4a88ea[_0x788c('0x9f')]){case _0x788c('0xa0'):_0xb414d4=squel[_0x788c('0xa1')]()['into'](_0x788c('0xa2'))[_0x788c('0xa3')]([_0x788c('0xa4'),_0x788c('0xa5'),_0x788c('0xa6'),'ListId',_0x788c('0x64'),_0x788c('0x5c'),'updatedAt'],squel['select']()[_0x788c('0xa7')](_0x788c('0xa4'),_0x788c('0xa4'))['field']('NOW()',_0x788c('0xa5'))['field']('id',_0x788c('0xa6'))['field'](_0x980bc8[_0x788c('0xa8')][_0x788c('0x8c')](),_0x788c('0xa9'))[_0x788c('0xa7')](_0x2ef77f[_0x788c('0x51')]['id'][_0x788c('0x8c')](),_0x788c('0x64'))[_0x788c('0xa7')]('NOW()',_0x788c('0x5c'))[_0x788c('0xa7')](_0x788c('0xaa'),'updatedAt')[_0x788c('0x83')](_0x788c('0xab'))[_0x788c('0x46')]('deletedAt\x20IS\x20NULL')[_0x788c('0x46')](_0x788c('0xac'),_0x980bc8[_0x788c('0xa8')][_0x788c('0x8c')]())[_0x788c('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0x788c('0x46')](_0x788c('0xad'),squel['select']()[_0x788c('0xa7')](_0x788c('0xae'))[_0x788c('0x83')](_0x788c('0xaf'))[_0x788c('0x46')]('VoiceQueueId\x20=\x20?',_0x2ef77f[_0x788c('0x51')]['id'][_0x788c('0x8c')]()))[_0x788c('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0x788c('0x81')]()[_0x788c('0xa7')](_0x788c('0xb0'))['from'](_0x788c('0xa2'))[_0x788c('0x46')](_0x788c('0x88'),_0x2ef77f[_0x788c('0x51')]['id'][_0x788c('0x8c')]())))[_0x788c('0x8c')]();break;case _0x788c('0xb1'):_0xb414d4=squel[_0x788c('0xa1')]()[_0x788c('0xb2')](_0x788c('0xa2'))[_0x788c('0xa3')]([_0x788c('0xa4'),_0x788c('0xa5'),_0x788c('0xa6'),_0x788c('0xa9'),'VoiceQueueId',_0x788c('0x5c'),'updatedAt'],squel[_0x788c('0x81')]()[_0x788c('0xa7')]('phone',_0x788c('0xa4'))[_0x788c('0xa7')]('NOW()',_0x788c('0xa5'))['field']('id',_0x788c('0xa6'))[_0x788c('0xa7')](_0x980bc8[_0x788c('0xa8')][_0x788c('0x8c')](),_0x788c('0xa9'))['field'](_0x2ef77f[_0x788c('0x51')]['id'][_0x788c('0x8c')](),_0x788c('0x64'))[_0x788c('0xa7')]('NOW()',_0x788c('0x5c'))[_0x788c('0xa7')](_0x788c('0xaa'),'updatedAt')[_0x788c('0x83')](_0x788c('0xab'))[_0x788c('0x46')](_0x788c('0xb3'))['where'](_0x788c('0xac'),_0x980bc8['CmListId'][_0x788c('0x8c')]())[_0x788c('0x46')](_0x788c('0xb4'))[_0x788c('0x46')](_0x788c('0xad'),squel[_0x788c('0x81')]()[_0x788c('0xa7')](_0x788c('0xb0'))['from']('cm_hopper')[_0x788c('0x46')]('VoiceQueueId\x20=\x20?',_0x2ef77f['params']['id']['toString']())))[_0x788c('0x8c')]();break;default:_0xb414d4=squel[_0x788c('0xa1')]()[_0x788c('0xb2')](_0x788c('0xa2'))[_0x788c('0xa3')]([_0x788c('0xa4'),_0x788c('0xa5'),'ContactId','ListId',_0x788c('0x64'),'createdAt','updatedAt'],squel[_0x788c('0x81')]()[_0x788c('0xa7')](_0x788c('0xa4'),_0x788c('0xa4'))['field'](_0x788c('0xaa'),_0x788c('0xa5'))['field']('id',_0x788c('0xa6'))['field'](_0x980bc8[_0x788c('0xa8')][_0x788c('0x8c')](),_0x788c('0xa9'))[_0x788c('0xa7')](_0x2ef77f['params']['id'][_0x788c('0x8c')](),'VoiceQueueId')[_0x788c('0xa7')](_0x788c('0xaa'),_0x788c('0x5c'))['field'](_0x788c('0xaa'),_0x788c('0x5d'))[_0x788c('0x83')](_0x788c('0xab'))[_0x788c('0x46')]('deletedAt\x20IS\x20NULL')[_0x788c('0x46')](_0x788c('0xac'),_0x980bc8['CmListId'][_0x788c('0x8c')]())[_0x788c('0x46')](_0x788c('0xb4')))[_0x788c('0x8c')]();}_0xb14bd9[_0x788c('0x8b')](db[_0x788c('0x76')]['query'](_0xb414d4));}return BPromise[_0x788c('0x97')](_0xb14bd9);}})[_0x788c('0x26')](function(){return _0x2e9ff0;})['then'](respondWithResult(_0x330215,null))[_0x788c('0x4f')](handleError(_0x330215,null));};exports['removeLists']=function(_0x2fa610,_0x5aa8f5,_0x3086b8){return db[_0x788c('0x4a')][_0x788c('0x30')]({'where':{'id':_0x2fa610['params']['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x5aa8f5,null))[_0x788c('0x26')](function(_0x2526a8){if(_0x2526a8){return _0x2526a8[_0x788c('0xb5')](_0x2fa610[_0x788c('0x3b')][_0x788c('0x80')]);}})['then'](function(_0x46fc63){if(_0x46fc63){return db[_0x788c('0x63')][_0x788c('0x27')]({'where':{'ListId':_0x2fa610[_0x788c('0x3b')][_0x788c('0x80')],'VoiceQueueId':_0x2fa610[_0x788c('0x51')]['id']}})[_0x788c('0x26')](function(){return _0x46fc63;});}})[_0x788c('0x26')](respondWithStatusCode(_0x5aa8f5,null))[_0x788c('0x4f')](handleError(_0x5aa8f5,null));};exports[_0x788c('0xb6')]=function(_0x49a5ad,_0x433a6d,_0x1e664c){var _0x3cada1={};var _0xebcb6={};var _0x29fa30;var _0x1d7a1f;return db[_0x788c('0x4a')][_0x788c('0x62')]({'where':{'id':_0x49a5ad[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x433a6d,null))[_0x788c('0x26')](function(_0x28899){if(_0x28899){_0x29fa30=_0x28899;_0xebcb6[_0x788c('0x3a')]=_['keys'](db[_0x788c('0x9d')]['rawAttributes']);_0xebcb6[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x49a5ad[_0x788c('0x3b')]);_0xebcb6['filters']=_[_0x788c('0x3e')](_0xebcb6[_0x788c('0x3a')],_0xebcb6[_0x788c('0x3b')]);_0x3cada1[_0x788c('0x3f')]=_['intersection'](_0xebcb6[_0x788c('0x3a')],qs[_0x788c('0x40')](_0x49a5ad[_0x788c('0x3b')]['fields']));_0x3cada1[_0x788c('0x3f')]=_0x3cada1[_0x788c('0x3f')][_0x788c('0x41')]?_0x3cada1['attributes']:_0xebcb6[_0x788c('0x3a')];_0x3cada1[_0x788c('0x44')]=qs[_0x788c('0x45')](_0x49a5ad[_0x788c('0x3b')][_0x788c('0x45')]);_0x3cada1[_0x788c('0x46')]=qs[_0x788c('0x3d')](_[_0x788c('0x47')](_0x49a5ad[_0x788c('0x3b')],_0xebcb6[_0x788c('0x3d')]));if(_0x49a5ad['query']['filter']){_0x3cada1['where']=_['merge'](_0x3cada1[_0x788c('0x46')],{'$or':_[_0x788c('0x2d')](_0x3cada1[_0x788c('0x3f')],function(_0x3c2cc7){var _0x4992f6={};_0x4992f6[_0x3c2cc7]={'$like':'%'+_0x49a5ad[_0x788c('0x3b')][_0x788c('0x2b')]+'%'};return _0x4992f6;})});}_0x3cada1=_[_0x788c('0x48')]({},_0x3cada1,_0x49a5ad['options']);return _0x29fa30['getBlackLists'](_0x3cada1);}})[_0x788c('0x26')](function(_0x160ac2){if(_0x160ac2){_0x1d7a1f=_0x160ac2[_0x788c('0x41')];if(!_0x49a5ad[_0x788c('0x3b')]['hasOwnProperty'](_0x788c('0x43'))){_0x3cada1[_0x788c('0x21')]=qs[_0x788c('0x21')](_0x49a5ad['query'][_0x788c('0x21')]);_0x3cada1['offset']=qs[_0x788c('0x20')](_0x49a5ad['query']['offset']);}return _0x29fa30[_0x788c('0xb6')](_0x3cada1);}})['then'](function(_0x30f627){if(_0x30f627){return _0x30f627?{'count':_0x1d7a1f,'rows':_0x30f627}:null;}})[_0x788c('0x26')](respondWithResult(_0x433a6d,null))[_0x788c('0x4f')](handleError(_0x433a6d,null));};exports[_0x788c('0xb7')]=function(_0x7ad92,_0x3cb295,_0x4d56bf){var _0x528e29,_0x18b6bc;return db[_0x788c('0x4a')][_0x788c('0x30')]({'where':{'id':_0x7ad92[_0x788c('0x51')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x3cb295,null))[_0x788c('0x26')](function(_0x23d6a2){if(_0x23d6a2){_0x18b6bc=_0x23d6a2;return _0x23d6a2[_0x788c('0xb7')](_0x7ad92[_0x788c('0x54')][_0x788c('0x80')],_[_0x788c('0x5b')](_0x7ad92[_0x788c('0x54')],[_0x788c('0x80'),'id'])||{});}return null;})[_0x788c('0x96')](function(_0x140a8c){var _0x79113d;_0x528e29=_0x140a8c||[];var _0x5ab90e=[];if(_0x140a8c){for(var _0x299826=0x0;_0x299826<_0x140a8c['length'];_0x299826+=0x1){var _0x145409=_0x140a8c[_0x299826][_0x788c('0x56')]({'plain':!![]});_0x79113d=squel['insert']()[_0x788c('0xb2')]('cm_hopper_black')['fromQuery']([_0x788c('0xa4'),_0x788c('0xa6'),'ListId','VoiceQueueId',_0x788c('0x5c'),_0x788c('0x5d')],squel['select']()[_0x788c('0xa7')](_0x788c('0xa4'),_0x788c('0xa4'))[_0x788c('0xa7')]('id','ContactId')[_0x788c('0xa7')](_0x145409[_0x788c('0xa8')][_0x788c('0x8c')](),_0x788c('0xa9'))['field'](_0x7ad92['params']['id'][_0x788c('0x8c')](),_0x788c('0x64'))[_0x788c('0xa7')]('NOW()',_0x788c('0x5c'))[_0x788c('0xa7')](_0x788c('0xaa'),_0x788c('0x5d'))[_0x788c('0x83')](_0x788c('0xab'))['where']('deletedAt\x20IS\x20NULL')[_0x788c('0x46')](_0x788c('0xac'),_0x145409['CmListId'][_0x788c('0x8c')]())[_0x788c('0x46')](_0x788c('0xb4')))[_0x788c('0x8c')]();_0x5ab90e[_0x788c('0x8b')](db[_0x788c('0x76')][_0x788c('0x3b')](_0x79113d));}return BPromise[_0x788c('0x97')](_0x5ab90e);}})[_0x788c('0x26')](function(){return _0x528e29;})[_0x788c('0x26')](respondWithResult(_0x3cb295,null))[_0x788c('0x4f')](handleError(_0x3cb295,null));};exports['removeBlackLists']=function(_0x1bb962,_0x40b522,_0x42750e){return db[_0x788c('0x4a')][_0x788c('0x30')]({'where':{'id':_0x1bb962['params']['id']}})['then'](handleEntityNotFound(_0x40b522,null))[_0x788c('0x26')](function(_0x58d138){if(_0x58d138){return _0x58d138[_0x788c('0xb8')](_0x1bb962['query']['ids']);}})[_0x788c('0x26')](function(_0x5bfe9a){if(_0x5bfe9a){return db[_0x788c('0x69')][_0x788c('0x27')]({'where':{'ListId':_0x1bb962[_0x788c('0x3b')][_0x788c('0x80')],'VoiceQueueId':_0x1bb962[_0x788c('0x51')]['id']}})[_0x788c('0x26')](function(){return _0x5bfe9a;});}})[_0x788c('0x26')](respondWithStatusCode(_0x40b522,null))[_0x788c('0x4f')](handleError(_0x40b522,null));};
\ No newline at end of file
+var _0xbe69=['interface','forEach','penalty','transaction','addTeams','findOrCreate','each','UserVoiceQueueRt','upsert','format','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','union','compact','isEmpty','emit','userVoiceQueue:remove','addAgents','userVoiceQueue:save','SIP/%s','all','removeAgents','isArray','getAgents','getMembers','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','phone','NOW()','ContactId','ListId\x20=\x20?','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','sendStatus','stack','name','send','index','VoiceQueue','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','inbound','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','online','voicePause'];(function(_0x20c2f4,_0x470117){var _0x2c4823=function(_0x581e46){while(--_0x581e46){_0x20c2f4['push'](_0x20c2f4['shift']());}};_0x2c4823(++_0x470117);}(_0xbe69,0xfb));var _0x9be6=function(_0x5096cf,_0x128082){_0x5096cf=_0x5096cf-0x0;var _0xbb3a7=_0xbe69[_0x5096cf];return _0xbb3a7;};'use strict';var pdf=require(_0x9be6('0x0'));var emlformat=require(_0x9be6('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9be6('0x2'));var rp=require(_0x9be6('0x3'));var moment=require(_0x9be6('0x4'));var BPromise=require(_0x9be6('0x5'));var Mustache=require(_0x9be6('0x6'));var util=require(_0x9be6('0x7'));var path=require('path');var sox=require(_0x9be6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9be6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9be6('0xa'));var toCsv=require(_0x9be6('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9be6('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9be6('0xd'));var as=require(_0x9be6('0xe'));var hardwareService=require(_0x9be6('0xf'));var logger=require(_0x9be6('0x10'))('api');var utils=require(_0x9be6('0x11'));var config=require(_0x9be6('0x12'));var db=require(_0x9be6('0x13'))['db'];config['redis']=_[_0x9be6('0x14')](config[_0x9be6('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x9be6('0x16'))(new Redis(config[_0x9be6('0x15')]));require('./voiceQueue.socket')[_0x9be6('0x17')](socket);function respondWithStatusCode(_0x52105b,_0x5a65a4){_0x5a65a4=_0x5a65a4||0xcc;return function(_0x4ac4bf){if(_0x4ac4bf){return _0x52105b['sendStatus'](_0x5a65a4);}return _0x52105b['status'](_0x5a65a4)['end']();};}function respondWithResult(_0x184ce0,_0xe8a101){_0xe8a101=_0xe8a101||0xc8;return function(_0xb390b4){if(_0xb390b4){return _0x184ce0[_0x9be6('0x18')](_0xe8a101)[_0x9be6('0x19')](_0xb390b4);}};}function respondWithFilteredResult(_0x3f00f0,_0x4f6ce7){return function(_0x2a1cf0){if(_0x2a1cf0){var _0x484d74=_0x2a1cf0[_0x9be6('0x1a')],_0x133f86=_0x4f6ce7[_0x9be6('0x1b')],_0x2e33d8=_0x4f6ce7[_0x9be6('0x1b')]+_0x4f6ce7[_0x9be6('0x1c')],_0x724194;if(_0x2e33d8>=_0x484d74){_0x2e33d8=_0x484d74;_0x724194=0xc8;}else{_0x724194=0xce;}_0x3f00f0[_0x9be6('0x18')](_0x724194);return _0x3f00f0[_0x9be6('0x1d')](_0x9be6('0x1e'),_0x133f86+'-'+_0x2e33d8+'/'+_0x484d74)[_0x9be6('0x19')](_0x2a1cf0);}return null;};}function patchUpdates(_0x8a931){return function(_0x476a44){try{jsonpatch[_0x9be6('0x1f')](_0x476a44,_0x8a931,!![]);}catch(_0x507d17){return BPromise[_0x9be6('0x20')](_0x507d17);}return _0x476a44['save']();};}function saveUpdates(_0x150f33,_0x137bd5){return function(_0xcea015){if(_0xcea015){return _0xcea015[_0x9be6('0x21')](_0x150f33)[_0x9be6('0x22')](function(_0x50d0a1){return _0x50d0a1;});}return null;};}function removeEntity(_0x41eeec,_0x20eecd){return function(_0x72ed0d){if(_0x72ed0d){return _0x72ed0d[_0x9be6('0x23')]()[_0x9be6('0x22')](function(){var _0x53111b=_0x72ed0d[_0x9be6('0x24')]({'plain':!![]});var _0x37a4da=[{'name':_0x9be6('0x25'),'value':'inbound','ignore':![]},{'name':_0x9be6('0x26'),'value':_0x9be6('0x27'),'ignore':![]}];var _0x953278=_(_0x37a4da)[_0x9be6('0x28')](_0x9be6('0x29'))[_0x9be6('0x2a')](_0x9be6('0x2b'))[_0x9be6('0x2b')]();if(_[_0x9be6('0x2c')](_0x953278,_0x53111b[_0x9be6('0x2d')])){return;}var _0x415fe4=_[_0x9be6('0x2e')](_0x37a4da,[_0x9be6('0x2b'),_0x53111b[_0x9be6('0x2d')]])['name'];return db[_0x9be6('0x2f')]['destroy']({'where':{'type':_0x415fe4,'resourceId':_0x53111b['id']}})[_0x9be6('0x22')](function(){return _0x72ed0d;});})[_0x9be6('0x22')](function(){_0x41eeec[_0x9be6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a23c3,_0x16d584){return function(_0x31a37c){if(!_0x31a37c){_0x4a23c3[_0x9be6('0x30')](0x194);}return _0x31a37c;};}function handleError(_0x133301,_0x744ac3){_0x744ac3=_0x744ac3||0x1f4;return function(_0x5795cd){logger['error'](_0x5795cd[_0x9be6('0x31')]);if(_0x5795cd[_0x9be6('0x32')]){delete _0x5795cd[_0x9be6('0x32')];}_0x133301[_0x9be6('0x18')](_0x744ac3)[_0x9be6('0x33')](_0x5795cd);};}exports[_0x9be6('0x34')]=function(_0x7f6afe,_0xe2e42){var _0x3f01a8={},_0xec99dd={},_0xb7f9fe={'count':0x0,'rows':[]};var _0x5af406=_[_0x9be6('0x2a')](db[_0x9be6('0x35')][_0x9be6('0x36')],function(_0x21e000){return{'name':_0x21e000[_0x9be6('0x37')],'type':_0x21e000[_0x9be6('0x2d')][_0x9be6('0x38')]};});_0xec99dd[_0x9be6('0x39')]=_[_0x9be6('0x2a')](_0x5af406,_0x9be6('0x32'));_0xec99dd['query']=_[_0x9be6('0x3a')](_0x7f6afe['query']);_0xec99dd[_0x9be6('0x3b')]=_['intersection'](_0xec99dd[_0x9be6('0x39')],_0xec99dd[_0x9be6('0x3c')]);_0x3f01a8[_0x9be6('0x3d')]=_[_0x9be6('0x3e')](_0xec99dd[_0x9be6('0x39')],qs[_0x9be6('0x3f')](_0x7f6afe['query'][_0x9be6('0x3f')]));_0x3f01a8[_0x9be6('0x3d')]=_0x3f01a8[_0x9be6('0x3d')][_0x9be6('0x40')]?_0x3f01a8[_0x9be6('0x3d')]:_0xec99dd[_0x9be6('0x39')];if(!_0x7f6afe[_0x9be6('0x3c')][_0x9be6('0x41')]('nolimit')){_0x3f01a8[_0x9be6('0x1c')]=qs[_0x9be6('0x1c')](_0x7f6afe['query'][_0x9be6('0x1c')]);_0x3f01a8[_0x9be6('0x1b')]=qs[_0x9be6('0x1b')](_0x7f6afe[_0x9be6('0x3c')][_0x9be6('0x1b')]);}_0x3f01a8[_0x9be6('0x42')]=qs[_0x9be6('0x43')](_0x7f6afe[_0x9be6('0x3c')][_0x9be6('0x43')]);_0x3f01a8[_0x9be6('0x44')]=qs[_0x9be6('0x3b')](_[_0x9be6('0x45')](_0x7f6afe[_0x9be6('0x3c')],_0xec99dd[_0x9be6('0x3b')]),_0x5af406);if(_0x7f6afe[_0x9be6('0x3c')][_0x9be6('0x28')]){_0x3f01a8[_0x9be6('0x44')]=_['merge'](_0x3f01a8[_0x9be6('0x44')],{'$or':_[_0x9be6('0x2a')](_0x5af406,function(_0x1d1180){if(_0x1d1180[_0x9be6('0x2d')]!==_0x9be6('0x46')){var _0x68abcd={};_0x68abcd[_0x1d1180[_0x9be6('0x32')]]={'$like':'%'+_0x7f6afe[_0x9be6('0x3c')]['filter']+'%'};return _0x68abcd;}})});}_0x3f01a8=_['merge']({},_0x3f01a8,_0x7f6afe[_0x9be6('0x47')]);var _0x607fe={'where':_0x3f01a8[_0x9be6('0x44')]};return db[_0x9be6('0x35')]['count'](_0x607fe)['then'](function(_0x28da74){_0xb7f9fe[_0x9be6('0x1a')]=_0x28da74;if(_0x7f6afe[_0x9be6('0x3c')][_0x9be6('0x48')]){_0x3f01a8[_0x9be6('0x49')]=[{'all':!![]}];}return db[_0x9be6('0x35')][_0x9be6('0x4a')](_0x3f01a8);})[_0x9be6('0x22')](function(_0x5c22be){_0xb7f9fe[_0x9be6('0x4b')]=_0x5c22be;return _0xb7f9fe;})[_0x9be6('0x22')](respondWithFilteredResult(_0xe2e42,_0x3f01a8))[_0x9be6('0x4c')](handleError(_0xe2e42,null));};exports[_0x9be6('0x4d')]=function(_0x28a2cf,_0x354e65){var _0x285938={'raw':![],'where':{'id':_0x28a2cf[_0x9be6('0x4e')]['id']}},_0x5822cf={};_0x5822cf['model']=_[_0x9be6('0x3a')](db['VoiceQueue']['rawAttributes']);_0x5822cf['query']=_['keys'](_0x28a2cf['query']);_0x5822cf[_0x9be6('0x3b')]=_['intersection'](_0x5822cf[_0x9be6('0x39')],_0x5822cf['query']);_0x285938[_0x9be6('0x3d')]=_[_0x9be6('0x3e')](_0x5822cf[_0x9be6('0x39')],qs[_0x9be6('0x3f')](_0x28a2cf[_0x9be6('0x3c')][_0x9be6('0x3f')]));_0x285938[_0x9be6('0x3d')]=_0x285938[_0x9be6('0x3d')][_0x9be6('0x40')]?_0x285938[_0x9be6('0x3d')]:_0x5822cf['model'];if(_0x28a2cf['query'][_0x9be6('0x48')]){_0x285938[_0x9be6('0x49')]=[{'all':!![]}];}_0x285938=_[_0x9be6('0x4f')]({},_0x285938,_0x28a2cf['options']);return db[_0x9be6('0x35')][_0x9be6('0x2e')](_0x285938)[_0x9be6('0x22')](handleEntityNotFound(_0x354e65,null))[_0x9be6('0x22')](respondWithResult(_0x354e65,null))['catch'](handleError(_0x354e65,null));};exports[_0x9be6('0x50')]=function(_0x50f831,_0x107c7a){return db['VoiceQueue']['create'](_0x50f831[_0x9be6('0x51')],{})['then'](function(_0x2f4c9d){var _0x4d5b9f=_0x50f831[_0x9be6('0x52')]['get']({'plain':!![]});if(!_0x4d5b9f)throw new Error(_0x9be6('0x53'));if(_0x4d5b9f[_0x9be6('0x54')]===_0x9be6('0x52')){var _0x1f47f8=_0x2f4c9d[_0x9be6('0x24')]({'plain':!![]});var _0x314121=[{'name':_0x9be6('0x25'),'value':'inbound'},{'name':_0x9be6('0x26'),'value':_0x9be6('0x27')}];var _0x11365a=_['find'](_0x314121,[_0x9be6('0x2b'),_0x1f47f8[_0x9be6('0x2d')]])[_0x9be6('0x32')];return db[_0x9be6('0x55')][_0x9be6('0x2e')]({'where':{'name':_0x11365a,'userProfileId':_0x4d5b9f[_0x9be6('0x56')]},'raw':!![]})[_0x9be6('0x22')](function(_0x122d0f){if(_0x122d0f&&_0x122d0f[_0x9be6('0x57')]===0x0){return db[_0x9be6('0x2f')][_0x9be6('0x50')]({'name':_0x1f47f8[_0x9be6('0x32')],'resourceId':_0x1f47f8['id'],'type':_0x122d0f[_0x9be6('0x32')],'sectionId':_0x122d0f['id']},{})['then'](function(){return _0x2f4c9d;});}else{return _0x2f4c9d;}})[_0x9be6('0x4c')](function(_0x1dc0fc){logger[_0x9be6('0x58')](_0x9be6('0x59'),_0x1dc0fc);throw _0x1dc0fc;});}return _0x2f4c9d;})[_0x9be6('0x22')](respondWithResult(_0x107c7a,0xc9))[_0x9be6('0x4c')](handleError(_0x107c7a,null));};exports[_0x9be6('0x5a')]=function(_0x34550f,_0xdf89de){var _0x588de6={'where':{'id':_0x34550f[_0x9be6('0x4e')]['id']}},_0x2d9698={};_0x2d9698['model']=_[_0x9be6('0x3a')](db[_0x9be6('0x35')][_0x9be6('0x36')]);_0x588de6[_0x9be6('0x3d')]=_[_0x9be6('0x3e')](_0x2d9698[_0x9be6('0x39')],qs[_0x9be6('0x3f')](_0x34550f[_0x9be6('0x3c')][_0x9be6('0x3f')]));_0x588de6['attributes']=_0x588de6['attributes'][_0x9be6('0x40')]?_0x588de6[_0x9be6('0x3d')]:_0x2d9698[_0x9be6('0x39')];if(_0x34550f[_0x9be6('0x3c')][_0x9be6('0x48')]){_0x588de6['include']=[{'all':!![]}];}_0x588de6=_[_0x9be6('0x4f')]({},_0x588de6,_0x34550f[_0x9be6('0x47')]);return db['VoiceQueue'][_0x9be6('0x2e')](_0x588de6)[_0x9be6('0x22')](handleEntityNotFound(_0xdf89de,null))['then'](function(_0x131557){if(_0x131557){var _0x274d88=_0x131557[_0x9be6('0x24')]({'plain':!![]});_0x274d88=qs[_0x9be6('0x5b')](_0x274d88,['id','createdAt',_0x9be6('0x5c')]);_0x34550f['body']=_[_0x9be6('0x5b')](_0x34550f[_0x9be6('0x51')],['id',_0x9be6('0x5d'),'updatedAt']);return db[_0x9be6('0x35')][_0x9be6('0x50')](_[_0x9be6('0x4f')](_0x274d88,_0x34550f[_0x9be6('0x51')]),{'include':_0x34550f['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x5311f8){var _0x15a129=_0x34550f['user'][_0x9be6('0x24')]({'plain':!![]});if(!_0x15a129)throw new Error(_0x9be6('0x53'));if(_0x15a129[_0x9be6('0x54')]===_0x9be6('0x52')){var _0x1fcee7=_0x5311f8['get']({'plain':!![]});var _0x1838b6=[{'name':_0x9be6('0x25'),'value':_0x9be6('0x5e')},{'name':_0x9be6('0x26'),'value':_0x9be6('0x27')}];var _0xfa894f=_[_0x9be6('0x2e')](_0x1838b6,['value',_0x1fcee7[_0x9be6('0x2d')]])[_0x9be6('0x32')];return db[_0x9be6('0x55')][_0x9be6('0x2e')]({'where':{'name':_0xfa894f,'userProfileId':_0x15a129[_0x9be6('0x56')]},'raw':!![]})[_0x9be6('0x22')](function(_0x382668){if(_0x382668&&_0x382668[_0x9be6('0x57')]===0x0){return db[_0x9be6('0x2f')][_0x9be6('0x50')]({'name':_0x1fcee7[_0x9be6('0x32')],'resourceId':_0x1fcee7['id'],'type':_0x382668['name'],'sectionId':_0x382668['id']},{})[_0x9be6('0x22')](function(){return _0x5311f8;});}else{return _0x5311f8;}})['catch'](function(_0x527ed5){logger[_0x9be6('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x527ed5);throw _0x527ed5;});}return _0x5311f8;});}})[_0x9be6('0x22')](respondWithResult(_0xdf89de,0xc9))[_0x9be6('0x4c')](handleError(_0xdf89de,null));};exports[_0x9be6('0x21')]=function(_0x4525f3,_0x515632){if(_0x4525f3[_0x9be6('0x51')]['id']){delete _0x4525f3[_0x9be6('0x51')]['id'];}return db[_0x9be6('0x35')]['find']({'where':{'id':_0x4525f3[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x515632,null))[_0x9be6('0x22')](saveUpdates(_0x4525f3[_0x9be6('0x51')],null))[_0x9be6('0x22')](respondWithResult(_0x515632,null))[_0x9be6('0x4c')](handleError(_0x515632,null));};exports[_0x9be6('0x23')]=function(_0x3cd307,_0x346067){return db[_0x9be6('0x35')][_0x9be6('0x2e')]({'where':{'id':_0x3cd307[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x346067,null))[_0x9be6('0x22')](removeEntity(_0x346067,null))[_0x9be6('0x4c')](handleError(_0x346067,null));};exports[_0x9be6('0x5f')]=function(_0x54d2dd,_0xd4d386,_0x156f3a){var _0x22ae88={'raw':![],'where':{}};var _0x47c7a0={};var _0xd32042={'count':0x0,'rows':[]};return db[_0x9be6('0x35')][_0x9be6('0x60')]({'where':{'id':_0x54d2dd[_0x9be6('0x4e')]['id']}})['then'](handleEntityNotFound(_0xd4d386,null))[_0x9be6('0x22')](function(_0x418861){if(_0x418861){_0x47c7a0[_0x9be6('0x39')]=_['keys'](db[_0x9be6('0x61')]['rawAttributes']);_0x47c7a0[_0x9be6('0x3c')]=_['keys'](_0x54d2dd[_0x9be6('0x3c')]);_0x47c7a0[_0x9be6('0x3b')]=_[_0x9be6('0x3e')](_0x47c7a0[_0x9be6('0x39')],_0x47c7a0[_0x9be6('0x3c')]);_0x22ae88[_0x9be6('0x3d')]=_['intersection'](_0x47c7a0[_0x9be6('0x39')],qs['fields'](_0x54d2dd[_0x9be6('0x3c')][_0x9be6('0x3f')]));_0x22ae88[_0x9be6('0x3d')]=_0x22ae88[_0x9be6('0x3d')]['length']?_0x22ae88[_0x9be6('0x3d')]:_0x47c7a0[_0x9be6('0x39')];if(!_0x54d2dd[_0x9be6('0x3c')][_0x9be6('0x41')]('nolimit')){_0x22ae88[_0x9be6('0x1c')]=qs[_0x9be6('0x1c')](_0x54d2dd['query'][_0x9be6('0x1c')]);_0x22ae88[_0x9be6('0x1b')]=qs[_0x9be6('0x1b')](_0x54d2dd[_0x9be6('0x3c')][_0x9be6('0x1b')]);}_0x22ae88['order']=qs[_0x9be6('0x43')](_0x54d2dd[_0x9be6('0x3c')][_0x9be6('0x43')]);_0x22ae88[_0x9be6('0x44')]=qs[_0x9be6('0x3b')](_[_0x9be6('0x45')](_0x54d2dd[_0x9be6('0x3c')],_0x47c7a0[_0x9be6('0x3b')]));_0x22ae88['where'][_0x9be6('0x62')]=_0x418861['id'];if(_0x54d2dd[_0x9be6('0x3c')][_0x9be6('0x28')]){_0x22ae88[_0x9be6('0x44')]=_['merge'](_0x22ae88['where'],{'$or':_[_0x9be6('0x2a')](_0x22ae88[_0x9be6('0x3d')],function(_0x523bf5){var _0x53fb5e={};_0x53fb5e[_0x523bf5]={'$like':'%'+_0x54d2dd[_0x9be6('0x3c')]['filter']+'%'};return _0x53fb5e;})});}_0x22ae88=_[_0x9be6('0x4f')]({},_0x22ae88,_0x54d2dd[_0x9be6('0x47')]);return db[_0x9be6('0x61')][_0x9be6('0x1a')]({'where':_0x22ae88[_0x9be6('0x44')]})[_0x9be6('0x22')](function(_0x350dbd){_0xd32042['count']=_0x350dbd;if(_0x54d2dd[_0x9be6('0x3c')][_0x9be6('0x48')]){_0x22ae88['include']=[{'all':!![]}];}return db[_0x9be6('0x61')][_0x9be6('0x4a')](_0x22ae88);})[_0x9be6('0x22')](function(_0x17179b){_0xd32042['rows']=_0x17179b;return _0xd32042;});}})[_0x9be6('0x22')](respondWithFilteredResult(_0xd4d386,_0x22ae88))[_0x9be6('0x4c')](handleError(_0xd4d386,null));};exports[_0x9be6('0x63')]=function(_0x2a6883,_0x247394,_0x556166){var _0x1da18b={'raw':!![],'where':{}};var _0x3b8524={};var _0x87e111={'count':0x0,'rows':[]};return db[_0x9be6('0x35')][_0x9be6('0x60')]({'where':{'id':_0x2a6883['params']['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x247394,null))['then'](function(_0x4a0fa0){if(_0x4a0fa0){_0x3b8524[_0x9be6('0x39')]=_[_0x9be6('0x3a')](db[_0x9be6('0x64')][_0x9be6('0x36')]);_0x3b8524['query']=_[_0x9be6('0x3a')](_0x2a6883['query']);_0x3b8524[_0x9be6('0x3b')]=_[_0x9be6('0x3e')](_0x3b8524[_0x9be6('0x39')],_0x3b8524[_0x9be6('0x3c')]);_0x1da18b[_0x9be6('0x3d')]=_['intersection'](_0x3b8524[_0x9be6('0x39')],qs[_0x9be6('0x3f')](_0x2a6883[_0x9be6('0x3c')][_0x9be6('0x3f')]));_0x1da18b[_0x9be6('0x3d')]=_0x1da18b['attributes'][_0x9be6('0x40')]?_0x1da18b[_0x9be6('0x3d')]:_0x3b8524[_0x9be6('0x39')];if(!_0x2a6883[_0x9be6('0x3c')][_0x9be6('0x41')](_0x9be6('0x65'))){_0x1da18b[_0x9be6('0x1c')]=qs[_0x9be6('0x1c')](_0x2a6883[_0x9be6('0x3c')][_0x9be6('0x1c')]);_0x1da18b[_0x9be6('0x1b')]=qs[_0x9be6('0x1b')](_0x2a6883[_0x9be6('0x3c')][_0x9be6('0x1b')]);}_0x1da18b[_0x9be6('0x42')]=qs[_0x9be6('0x43')](_0x2a6883[_0x9be6('0x3c')][_0x9be6('0x43')]);_0x1da18b[_0x9be6('0x44')]=qs[_0x9be6('0x3b')](_[_0x9be6('0x45')](_0x2a6883[_0x9be6('0x3c')],_0x3b8524['filters']));_0x1da18b[_0x9be6('0x44')][_0x9be6('0x62')]=_0x4a0fa0['id'];if(_0x2a6883[_0x9be6('0x3c')][_0x9be6('0x28')]){_0x1da18b[_0x9be6('0x44')]=_[_0x9be6('0x4f')](_0x1da18b[_0x9be6('0x44')],{'$or':_[_0x9be6('0x2a')](_0x1da18b['attributes'],function(_0x5404cb){var _0x124a1c={};_0x124a1c[_0x5404cb]={'$like':'%'+_0x2a6883[_0x9be6('0x3c')][_0x9be6('0x28')]+'%'};return _0x124a1c;})});}_0x1da18b=_[_0x9be6('0x4f')]({},_0x1da18b,_0x2a6883[_0x9be6('0x47')]);return db[_0x9be6('0x64')][_0x9be6('0x1a')]({'where':_0x1da18b[_0x9be6('0x44')]})[_0x9be6('0x22')](function(_0xdc0532){_0x87e111['count']=_0xdc0532;if(_0x2a6883[_0x9be6('0x3c')]['includeAll']){_0x1da18b['include']=[{'all':!![]}];}return db[_0x9be6('0x64')][_0x9be6('0x4a')](_0x1da18b);})[_0x9be6('0x22')](function(_0x56efda){_0x87e111[_0x9be6('0x4b')]=_0x56efda;return _0x87e111;});}})[_0x9be6('0x22')](respondWithFilteredResult(_0x247394,_0x1da18b))[_0x9be6('0x4c')](handleError(_0x247394,null));};exports[_0x9be6('0x66')]=function(_0x2ff945,_0x38029e,_0xa4435a){var _0x3e35da={'raw':!![],'where':{}};var _0x34a08d={};var _0x32132b={'count':0x0,'rows':[]};return db[_0x9be6('0x35')][_0x9be6('0x60')]({'where':{'id':_0x2ff945[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x38029e,null))[_0x9be6('0x22')](function(_0x479802){if(_0x479802){_0x34a08d['model']=_[_0x9be6('0x3a')](db[_0x9be6('0x67')]['rawAttributes']);_0x34a08d[_0x9be6('0x3c')]=_[_0x9be6('0x3a')](_0x2ff945[_0x9be6('0x3c')]);_0x34a08d[_0x9be6('0x3b')]=_[_0x9be6('0x3e')](_0x34a08d[_0x9be6('0x39')],_0x34a08d[_0x9be6('0x3c')]);_0x3e35da['attributes']=_[_0x9be6('0x3e')](_0x34a08d[_0x9be6('0x39')],qs[_0x9be6('0x3f')](_0x2ff945[_0x9be6('0x3c')][_0x9be6('0x3f')]));_0x3e35da[_0x9be6('0x3d')]=_0x3e35da[_0x9be6('0x3d')]['length']?_0x3e35da[_0x9be6('0x3d')]:_0x34a08d[_0x9be6('0x39')];if(!_0x2ff945[_0x9be6('0x3c')][_0x9be6('0x41')](_0x9be6('0x65'))){_0x3e35da['limit']=qs[_0x9be6('0x1c')](_0x2ff945[_0x9be6('0x3c')][_0x9be6('0x1c')]);_0x3e35da[_0x9be6('0x1b')]=qs[_0x9be6('0x1b')](_0x2ff945[_0x9be6('0x3c')][_0x9be6('0x1b')]);}_0x3e35da[_0x9be6('0x42')]=qs['sort'](_0x2ff945['query'][_0x9be6('0x43')]);_0x3e35da['where']=qs[_0x9be6('0x3b')](_[_0x9be6('0x45')](_0x2ff945['query'],_0x34a08d[_0x9be6('0x3b')]));_0x3e35da[_0x9be6('0x44')][_0x9be6('0x62')]=_0x479802['id'];if(_0x2ff945[_0x9be6('0x3c')][_0x9be6('0x28')]){_0x3e35da['where']=_[_0x9be6('0x4f')](_0x3e35da[_0x9be6('0x44')],{'$or':_['map'](_0x3e35da[_0x9be6('0x3d')],function(_0x484651){var _0x1eca02={};_0x1eca02[_0x484651]={'$like':'%'+_0x2ff945[_0x9be6('0x3c')]['filter']+'%'};return _0x1eca02;})});}_0x3e35da=_['merge']({},_0x3e35da,_0x2ff945[_0x9be6('0x47')]);return db[_0x9be6('0x67')]['count']({'where':_0x3e35da['where']})[_0x9be6('0x22')](function(_0x26493e){_0x32132b[_0x9be6('0x1a')]=_0x26493e;if(_0x2ff945['query'][_0x9be6('0x48')]){_0x3e35da[_0x9be6('0x49')]=[{'all':!![]}];}return db[_0x9be6('0x67')][_0x9be6('0x4a')](_0x3e35da);})[_0x9be6('0x22')](function(_0x13345d){_0x32132b['rows']=_0x13345d;return _0x32132b;});}})[_0x9be6('0x22')](respondWithFilteredResult(_0x38029e,_0x3e35da))[_0x9be6('0x4c')](handleError(_0x38029e,null));};exports[_0x9be6('0x68')]=function(_0x4268a1,_0x42a99e,_0x53d155){var _0x48f1dd={'raw':!![],'where':{}};var _0x1687f0={};var _0x29473f={'count':0x0,'rows':[]};return db[_0x9be6('0x35')]['findOne']({'where':{'id':_0x4268a1[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x42a99e,null))[_0x9be6('0x22')](function(_0x1722ea){if(_0x1722ea){_0x1687f0['model']=_[_0x9be6('0x3a')](db[_0x9be6('0x69')][_0x9be6('0x36')]);_0x1687f0[_0x9be6('0x3c')]=_[_0x9be6('0x3a')](_0x4268a1[_0x9be6('0x3c')]);_0x1687f0[_0x9be6('0x3b')]=_[_0x9be6('0x3e')](_0x1687f0[_0x9be6('0x39')],_0x1687f0['query']);_0x48f1dd[_0x9be6('0x3d')]=_['intersection'](_0x1687f0[_0x9be6('0x39')],qs['fields'](_0x4268a1[_0x9be6('0x3c')][_0x9be6('0x3f')]));_0x48f1dd[_0x9be6('0x3d')]=_0x48f1dd['attributes'][_0x9be6('0x40')]?_0x48f1dd[_0x9be6('0x3d')]:_0x1687f0['model'];if(!_0x4268a1[_0x9be6('0x3c')][_0x9be6('0x41')](_0x9be6('0x65'))){_0x48f1dd['limit']=qs[_0x9be6('0x1c')](_0x4268a1[_0x9be6('0x3c')][_0x9be6('0x1c')]);_0x48f1dd[_0x9be6('0x1b')]=qs[_0x9be6('0x1b')](_0x4268a1[_0x9be6('0x3c')][_0x9be6('0x1b')]);}_0x48f1dd[_0x9be6('0x42')]=qs[_0x9be6('0x43')](_0x4268a1[_0x9be6('0x3c')][_0x9be6('0x43')]);_0x48f1dd[_0x9be6('0x44')]=qs['filters'](_[_0x9be6('0x45')](_0x4268a1['query'],_0x1687f0[_0x9be6('0x3b')]));_0x48f1dd[_0x9be6('0x44')][_0x9be6('0x62')]=_0x1722ea['id'];if(_0x4268a1[_0x9be6('0x3c')][_0x9be6('0x28')]){_0x48f1dd[_0x9be6('0x44')]=_['merge'](_0x48f1dd[_0x9be6('0x44')],{'$or':_[_0x9be6('0x2a')](_0x48f1dd[_0x9be6('0x3d')],function(_0x2fe918){var _0x30ac22={};_0x30ac22[_0x2fe918]={'$like':'%'+_0x4268a1[_0x9be6('0x3c')][_0x9be6('0x28')]+'%'};return _0x30ac22;})});}_0x48f1dd=_[_0x9be6('0x4f')]({},_0x48f1dd,_0x4268a1[_0x9be6('0x47')]);return db[_0x9be6('0x69')]['count']({'where':_0x48f1dd[_0x9be6('0x44')]})[_0x9be6('0x22')](function(_0x717574){_0x29473f['count']=_0x717574;if(_0x4268a1['query'][_0x9be6('0x48')]){_0x48f1dd[_0x9be6('0x49')]=[{'all':!![]}];}return db[_0x9be6('0x69')][_0x9be6('0x4a')](_0x48f1dd);})[_0x9be6('0x22')](function(_0x569866){_0x29473f['rows']=_0x569866;return _0x29473f;});}})[_0x9be6('0x22')](respondWithFilteredResult(_0x42a99e,_0x48f1dd))[_0x9be6('0x4c')](handleError(_0x42a99e,null));};exports[_0x9be6('0x6a')]=function(_0x63908a,_0x3c73d5,_0x4caab2){var _0x2e6bfe={};var _0x22c598={};var _0x423587;var _0x44e4e7;return db['VoiceQueue'][_0x9be6('0x60')]({'where':{'id':_0x63908a[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x3c73d5,null))['then'](function(_0xd821d9){if(_0xd821d9){_0x423587=_0xd821d9;_0x22c598[_0x9be6('0x39')]=_[_0x9be6('0x3a')](db[_0x9be6('0x6b')]['rawAttributes']);_0x22c598[_0x9be6('0x3c')]=_[_0x9be6('0x3a')](_0x63908a[_0x9be6('0x3c')]);_0x22c598[_0x9be6('0x3b')]=_[_0x9be6('0x3e')](_0x22c598['model'],_0x22c598[_0x9be6('0x3c')]);_0x2e6bfe['attributes']=_[_0x9be6('0x3e')](_0x22c598[_0x9be6('0x39')],qs[_0x9be6('0x3f')](_0x63908a[_0x9be6('0x3c')][_0x9be6('0x3f')]));_0x2e6bfe[_0x9be6('0x3d')]=_0x2e6bfe[_0x9be6('0x3d')][_0x9be6('0x40')]?_0x2e6bfe[_0x9be6('0x3d')]:_0x22c598[_0x9be6('0x39')];_0x2e6bfe[_0x9be6('0x42')]=qs[_0x9be6('0x43')](_0x63908a['query'][_0x9be6('0x43')]);_0x2e6bfe[_0x9be6('0x44')]=qs[_0x9be6('0x3b')](_[_0x9be6('0x45')](_0x63908a[_0x9be6('0x3c')],_0x22c598['filters']));if(_0x63908a[_0x9be6('0x3c')][_0x9be6('0x28')]){_0x2e6bfe[_0x9be6('0x44')]=_[_0x9be6('0x4f')](_0x2e6bfe[_0x9be6('0x44')],{'$or':_[_0x9be6('0x2a')](_0x2e6bfe[_0x9be6('0x3d')],function(_0x7b3314){var _0x53b49e={};_0x53b49e[_0x7b3314]={'$like':'%'+_0x63908a[_0x9be6('0x3c')][_0x9be6('0x28')]+'%'};return _0x53b49e;})});}_0x2e6bfe=_[_0x9be6('0x4f')]({},_0x2e6bfe,_0x63908a['options']);return _0x423587['getTeams'](_0x2e6bfe);}})[_0x9be6('0x22')](function(_0x12ff72){if(_0x12ff72){_0x44e4e7=_0x12ff72[_0x9be6('0x40')];if(!_0x63908a[_0x9be6('0x3c')]['hasOwnProperty'](_0x9be6('0x65'))){_0x2e6bfe['limit']=qs['limit'](_0x63908a[_0x9be6('0x3c')][_0x9be6('0x1c')]);_0x2e6bfe[_0x9be6('0x1b')]=qs[_0x9be6('0x1b')](_0x63908a[_0x9be6('0x3c')][_0x9be6('0x1b')]);}return _0x423587[_0x9be6('0x6a')](_0x2e6bfe);}})[_0x9be6('0x22')](function(_0x566932){if(_0x566932){return _0x566932?{'count':_0x44e4e7,'rows':_0x566932}:null;}})[_0x9be6('0x22')](respondWithResult(_0x3c73d5,null))[_0x9be6('0x4c')](handleError(_0x3c73d5,null));};exports['addTeams']=function(_0x46bf94,_0x57c2b3,_0x64e534){var _0x22face=_0x46bf94[_0x9be6('0x51')][_0x9be6('0x6c')];var _0x255ba8=_[_0x9be6('0x2a')](_0x22face,'id');return db['Team'][_0x9be6('0x4a')]({'where':{'id':_0x255ba8},'attributes':['id'],'include':[{'model':db[_0x9be6('0x6d')],'as':_0x9be6('0x6e'),'attributes':['id','name',_0x9be6('0x6f'),_0x9be6('0x70'),_0x9be6('0x71')],'raw':!![]}]})[_0x9be6('0x22')](function(_0x2860eb){if(_0x2860eb){var _0x4c011c=_['flatMap'](_0x2860eb,function(_0x4ffbf8){var _0x4a4143=_0x4ffbf8[_0x9be6('0x24')]({'plain':!![]});_0x4a4143['Agents'][_0x9be6('0x72')](function(_0x95d719){_0x95d719[_0x9be6('0x73')]=_[_0x9be6('0x2e')](_0x22face,{'id':_0x4a4143['id']})[_0x9be6('0x73')];});return _0x4a4143[_0x9be6('0x6e')];});return db[_0x9be6('0x35')][_0x9be6('0x2e')]({'where':{'id':_0x46bf94[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](function(_0x62da8a){return db['sequelize'][_0x9be6('0x74')](function(_0x5b8686){return _0x62da8a[_0x9be6('0x75')](_0x255ba8,{'transaction':_0x5b8686})[_0x9be6('0x22')](function(){return BPromise['each'](_0x4c011c,function(_0xf1024){return db['UserVoiceQueue'][_0x9be6('0x76')]({'where':{'UserId':_0xf1024['id'],'VoiceQueueId':_0x46bf94[_0x9be6('0x4e')]['id']},'defaults':{'penalty':_0xf1024[_0x9be6('0x73')]},'transaction':_0x5b8686});});})[_0x9be6('0x22')](function(){return BPromise[_0x9be6('0x77')](_['filter'](_0x4c011c,{'online':!![]}),function(_0x16304c){return db[_0x9be6('0x78')][_0x9be6('0x79')]({'membername':_0x16304c['name'],'UserId':_0x16304c['id'],'queue_name':_0x62da8a[_0x9be6('0x32')],'VoiceQueueId':_0x62da8a['id'],'interface':_['isNil'](_0x16304c[_0x9be6('0x71')])?util[_0x9be6('0x7a')]('SIP/%s',_0x16304c[_0x9be6('0x32')]):_0x16304c[_0x9be6('0x71')],'paused':_0x16304c['voicePause']||![],'penalty':_0x16304c[_0x9be6('0x73')]},{'transaction':_0x5b8686});});})[_0x9be6('0x22')](function(){_0x4c011c[_0x9be6('0x72')](function(_0x3478df){socket['emit']('userVoiceQueue:save',{'UserId':_0x3478df['id'],'VoiceQueueId':_0x62da8a['id']});});});});});}})[_0x9be6('0x22')](respondWithStatusCode(_0x57c2b3,null))[_0x9be6('0x4c')](handleError(_0x57c2b3,null));};exports[_0x9be6('0x7b')]=function(_0x17713,_0x4c0b02,_0x29914f){return db[_0x9be6('0x6b')]['findAll']({'where':{'id':_0x17713[_0x9be6('0x3c')][_0x9be6('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x9be6('0x6d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9be6('0x22')](handleEntityNotFound(_0x4c0b02,null))[_0x9be6('0x22')](function(_0x5224da){var _0x1d866b=_[_0x9be6('0x2a')](_0x5224da,'id');var _0x3fb36f=[];var _0x54ce04=[];var _0x18624f=squel[_0x9be6('0x7d')]();_0x18624f[_0x9be6('0x7e')](_0x9be6('0x7f'))[_0x9be6('0x80')](_0x9be6('0x81'),'tq')['join'](_0x9be6('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9be6('0x44')](_0x9be6('0x83'),_0x17713[_0x9be6('0x4e')]['id']);for(var _0x376e9d=0x0;_0x376e9d<_0x5224da[_0x9be6('0x40')];_0x376e9d+=0x1){let _0x29a277=_0x5224da[_0x376e9d];for(var _0x40ae96=0x0;_0x40ae96<_0x29a277[_0x9be6('0x6e')][_0x9be6('0x40')];_0x40ae96+=0x1){let _0x26c17e=_0x29a277[_0x9be6('0x6e')][_0x40ae96];var _0x5b02ae=_0x18624f['clone']();_0x5b02ae[_0x9be6('0x44')](_0x9be6('0x84'),_0x26c17e['id']);_0x54ce04[_0x9be6('0x85')](db[_0x9be6('0x86')][_0x9be6('0x3c')](_0x5b02ae[_0x9be6('0x87')](),{'type':db[_0x9be6('0x86')][_0x9be6('0x88')][_0x9be6('0x89')]})['then'](function(_0x4c67d5){if(_0x4c67d5['length']===0x1){return _0x26c17e['id'];}else{var _0x1d8b37=_[_0x9be6('0x8a')](_[_0x9be6('0x2a')](_0x4c67d5,_0x9be6('0x8b')),function(_0x3a695e){return _[_0x9be6('0x2c')](_0x1d866b,_0x3a695e);});if(_0x1d8b37){return _0x26c17e['id'];}}}));}}return BPromise['all'](_0x54ce04)[_0x9be6('0x22')](function(_0x1d770b){_0x3fb36f=_(_0x3fb36f)[_0x9be6('0x8c')](_0x1d770b)[_0x9be6('0x8d')]()[_0x9be6('0x2b')]();return db[_0x9be6('0x35')]['find']({'where':{'id':_0x17713[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](function(_0x118f6e){return db[_0x9be6('0x86')]['transaction'](function(_0xbfebb9){return _0x118f6e[_0x9be6('0x7b')](_0x17713[_0x9be6('0x3c')][_0x9be6('0x7c')],{'transaction':_0xbfebb9})[_0x9be6('0x22')](function(){if(!_[_0x9be6('0x8e')](_0x3fb36f)){return _0x118f6e['removeAgents'](_0x3fb36f,{'transaction':_0xbfebb9})[_0x9be6('0x22')](function(){return db['UserVoiceQueueRt'][_0x9be6('0x23')]({'where':{'VoiceQueueId':_0x17713[_0x9be6('0x4e')]['id'],'UserId':_0x3fb36f},'transaction':_0xbfebb9});});}})[_0x9be6('0x22')](function(){_0x3fb36f['forEach'](function(_0x3faeb0){socket[_0x9be6('0x8f')](_0x9be6('0x90'),{'UserId':_0x3faeb0,'VoiceQueueId':_0x118f6e['id']});});});});});});})[_0x9be6('0x22')](respondWithStatusCode(_0x4c0b02,null))[_0x9be6('0x4c')](handleError(_0x4c0b02,null));};exports[_0x9be6('0x91')]=function(_0x2df739,_0x16d842,_0x1a3a0b){var _0x3a645b,_0x541847;return db[_0x9be6('0x35')][_0x9be6('0x2e')]({'where':{'id':_0x2df739[_0x9be6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x16d842,null))[_0x9be6('0x22')](function(_0x442cd1){if(_0x442cd1){_0x541847=_0x442cd1;return _0x442cd1[_0x9be6('0x91')](_0x2df739[_0x9be6('0x51')]['ids'],_[_0x9be6('0x5b')](_0x2df739[_0x9be6('0x51')],[_0x9be6('0x7c'),'id'])||{})['spread'](function(_0x8e1b87){for(var _0x1d9b46=0x0;_0x1d9b46<_0x2df739['body'][_0x9be6('0x7c')]['length'];_0x1d9b46+=0x1){socket[_0x9be6('0x8f')](_0x9be6('0x92'),{'UserId':_0x2df739[_0x9be6('0x51')][_0x9be6('0x7c')][_0x1d9b46],'VoiceQueueId':_0x2df739[_0x9be6('0x4e')]['id']});}return _0x8e1b87;});}})[_0x9be6('0x22')](function(_0xf4c59d){_0x3a645b=_0xf4c59d||[];if(_0x541847){return db[_0x9be6('0x6d')][_0x9be6('0x4a')]({'where':{'id':_0x2df739[_0x9be6('0x51')][_0x9be6('0x7c')]},'attributes':['id',_0x9be6('0x32'),_0x9be6('0x6f'),_0x9be6('0x70'),_0x9be6('0x71')],'raw':!![]});}})['then'](function(_0x499d9a){if(!_[_0x9be6('0x8e')](_0x499d9a)){var _0x3c2687=[];for(var _0x354f67=0x0;_0x354f67<_0x499d9a[_0x9be6('0x40')];_0x354f67++){if(_0x499d9a[_0x354f67][_0x9be6('0x6f')]){_0x3c2687['push'](db[_0x9be6('0x78')]['upsert']({'membername':_0x499d9a[_0x354f67][_0x9be6('0x32')],'UserId':_0x499d9a[_0x354f67]['id'],'queue_name':_0x541847[_0x9be6('0x32')],'VoiceQueueId':_0x541847['id'],'interface':_['isNil'](_0x499d9a[_0x354f67][_0x9be6('0x71')])?util[_0x9be6('0x7a')](_0x9be6('0x93'),_0x499d9a[_0x354f67][_0x9be6('0x32')]):_0x499d9a[_0x354f67][_0x9be6('0x71')],'paused':_0x499d9a[_0x354f67][_0x9be6('0x70')]||![],'penalty':_0x2df739[_0x9be6('0x51')][_0x9be6('0x73')]||0x0}));}}return BPromise[_0x9be6('0x94')](_0x3c2687);}})['then'](function(){return _0x3a645b;})[_0x9be6('0x22')](respondWithResult(_0x16d842,null))[_0x9be6('0x4c')](handleError(_0x16d842,null));};exports[_0x9be6('0x95')]=function(_0x198559,_0xb4b892,_0xa12459){return db[_0x9be6('0x35')][_0x9be6('0x2e')]({'where':{'id':_0x198559[_0x9be6('0x4e')]['id']}})['then'](handleEntityNotFound(_0xb4b892,null))['then'](function(_0x4109a2){if(_0x4109a2){return _0x4109a2[_0x9be6('0x95')](_0x198559['query'][_0x9be6('0x7c')])['then'](function(){if(_[_0x9be6('0x96')](_0x198559[_0x9be6('0x3c')]['ids'])){for(var _0x5e942b=0x0;_0x5e942b<_0x198559[_0x9be6('0x3c')]['ids']['length'];_0x5e942b+=0x1){socket[_0x9be6('0x8f')](_0x9be6('0x90'),{'UserId':Number(_0x198559[_0x9be6('0x3c')]['ids'][_0x5e942b]),'VoiceQueueId':Number(_0x198559['params']['id'])});}}else{socket[_0x9be6('0x8f')](_0x9be6('0x90'),{'UserId':Number(_0x198559[_0x9be6('0x3c')][_0x9be6('0x7c')]),'VoiceQueueId':Number(_0x198559[_0x9be6('0x4e')]['id'])});}});}})[_0x9be6('0x22')](function(_0x2ee01c){return db['UserVoiceQueueRt'][_0x9be6('0x23')]({'where':{'VoiceQueueId':_0x198559['params']['id'],'UserId':_0x198559['query']['ids']}})[_0x9be6('0x22')](function(){return _0x2ee01c;});})[_0x9be6('0x22')](respondWithStatusCode(_0xb4b892,null))[_0x9be6('0x4c')](handleError(_0xb4b892,null));};exports[_0x9be6('0x97')]=function(_0x3fccff,_0x2a486b,_0x2dabaa){var _0x1fe08c={};var _0x142d0b={};var _0x52c388;var _0x94e69b;return db['VoiceQueue'][_0x9be6('0x60')]({'where':{'id':_0x3fccff[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x2a486b,null))[_0x9be6('0x22')](function(_0x54fed4){if(_0x54fed4){_0x52c388=_0x54fed4;_0x142d0b[_0x9be6('0x39')]=_['keys'](db[_0x9be6('0x6d')][_0x9be6('0x36')]);_0x142d0b['query']=_[_0x9be6('0x3a')](_0x3fccff[_0x9be6('0x3c')]);_0x142d0b[_0x9be6('0x3b')]=_['intersection'](_0x142d0b[_0x9be6('0x39')],_0x142d0b[_0x9be6('0x3c')]);_0x1fe08c[_0x9be6('0x3d')]=_[_0x9be6('0x3e')](_0x142d0b[_0x9be6('0x39')],qs[_0x9be6('0x3f')](_0x3fccff['query'][_0x9be6('0x3f')]));_0x1fe08c[_0x9be6('0x3d')]=_0x1fe08c['attributes'][_0x9be6('0x40')]?_0x1fe08c[_0x9be6('0x3d')]:_0x142d0b['model'];_0x1fe08c[_0x9be6('0x42')]=qs[_0x9be6('0x43')](_0x3fccff[_0x9be6('0x3c')]['sort']);_0x1fe08c[_0x9be6('0x44')]=qs[_0x9be6('0x3b')](_[_0x9be6('0x45')](_0x3fccff[_0x9be6('0x3c')],_0x142d0b['filters']));if(_0x3fccff['query'][_0x9be6('0x28')]){_0x1fe08c[_0x9be6('0x44')]=_[_0x9be6('0x4f')](_0x1fe08c[_0x9be6('0x44')],{'$or':_[_0x9be6('0x2a')](_0x1fe08c['attributes'],function(_0x5a16ba){var _0xe63915={};_0xe63915[_0x5a16ba]={'$like':'%'+_0x3fccff[_0x9be6('0x3c')][_0x9be6('0x28')]+'%'};return _0xe63915;})});}_0x1fe08c=_['merge']({},_0x1fe08c,_0x3fccff[_0x9be6('0x47')]);return _0x52c388[_0x9be6('0x97')](_0x1fe08c);}})[_0x9be6('0x22')](function(_0x51ac5d){if(_0x51ac5d){_0x94e69b=_0x51ac5d[_0x9be6('0x40')];if(!_0x3fccff[_0x9be6('0x3c')]['hasOwnProperty'](_0x9be6('0x65'))){_0x1fe08c[_0x9be6('0x1c')]=qs[_0x9be6('0x1c')](_0x3fccff[_0x9be6('0x3c')][_0x9be6('0x1c')]);_0x1fe08c[_0x9be6('0x1b')]=qs[_0x9be6('0x1b')](_0x3fccff[_0x9be6('0x3c')][_0x9be6('0x1b')]);}return _0x52c388[_0x9be6('0x97')](_0x1fe08c);}})[_0x9be6('0x22')](function(_0x4053fc){if(_0x4053fc){return _0x4053fc?{'count':_0x94e69b,'rows':_0x4053fc}:null;}})[_0x9be6('0x22')](respondWithResult(_0x2a486b,null))[_0x9be6('0x4c')](handleError(_0x2a486b,null));};exports[_0x9be6('0x98')]=function(_0x27c28c,_0x257bc8,_0x2ee2c8){var _0x1422e2={};var _0x30f09c={};var _0x5bd2ee;var _0xb8934f;return db['VoiceQueue'][_0x9be6('0x60')]({'where':{'id':_0x27c28c[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x257bc8,null))[_0x9be6('0x22')](function(_0x1fe837){if(_0x1fe837){_0x5bd2ee=_0x1fe837;_0x30f09c[_0x9be6('0x39')]=_[_0x9be6('0x3a')](db[_0x9be6('0x78')][_0x9be6('0x36')]);_0x30f09c[_0x9be6('0x3c')]=_[_0x9be6('0x3a')](_0x27c28c[_0x9be6('0x3c')]);_0x30f09c[_0x9be6('0x3b')]=_[_0x9be6('0x3e')](_0x30f09c[_0x9be6('0x39')],_0x30f09c[_0x9be6('0x3c')]);_0x1422e2[_0x9be6('0x3d')]=_[_0x9be6('0x3e')](_0x30f09c[_0x9be6('0x39')],qs['fields'](_0x27c28c['query'][_0x9be6('0x3f')]));_0x1422e2['attributes']=_0x1422e2[_0x9be6('0x3d')]['length']?_0x1422e2[_0x9be6('0x3d')]:_0x30f09c[_0x9be6('0x39')];_0x1422e2[_0x9be6('0x42')]=qs['sort'](_0x27c28c[_0x9be6('0x3c')]['sort']);_0x1422e2[_0x9be6('0x44')]=qs[_0x9be6('0x3b')](_[_0x9be6('0x45')](_0x27c28c[_0x9be6('0x3c')],_0x30f09c[_0x9be6('0x3b')]));if(_0x27c28c[_0x9be6('0x3c')][_0x9be6('0x28')]){_0x1422e2[_0x9be6('0x44')]=_['merge'](_0x1422e2[_0x9be6('0x44')],{'$or':_[_0x9be6('0x2a')](_0x1422e2[_0x9be6('0x3d')],function(_0x88ee40){var _0xf047c4={};_0xf047c4[_0x88ee40]={'$like':'%'+_0x27c28c[_0x9be6('0x3c')]['filter']+'%'};return _0xf047c4;})});}_0x1422e2=_['merge']({},_0x1422e2,_0x27c28c[_0x9be6('0x47')]);return _0x5bd2ee[_0x9be6('0x98')](_0x1422e2);}})[_0x9be6('0x22')](function(_0x2170c3){if(_0x2170c3){_0xb8934f=_0x2170c3[_0x9be6('0x40')];if(!_0x27c28c[_0x9be6('0x3c')][_0x9be6('0x41')]('nolimit')){_0x1422e2[_0x9be6('0x1c')]=qs[_0x9be6('0x1c')](_0x27c28c[_0x9be6('0x3c')][_0x9be6('0x1c')]);_0x1422e2[_0x9be6('0x1b')]=qs[_0x9be6('0x1b')](_0x27c28c[_0x9be6('0x3c')][_0x9be6('0x1b')]);}return _0x5bd2ee[_0x9be6('0x98')](_0x1422e2);}})['then'](function(_0x42e519){return _0x42e519?{'count':_0xb8934f,'rows':_0x42e519}:null;})['then'](respondWithResult(_0x257bc8,null))[_0x9be6('0x4c')](handleError(_0x257bc8,null));};exports['getLists']=function(_0x3d2e6b,_0x117318,_0x238d3b){var _0x4d1800={};var _0x35f568={};var _0x526477;var _0x7663f2;return db[_0x9be6('0x35')][_0x9be6('0x60')]({'where':{'id':_0x3d2e6b[_0x9be6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x117318,null))[_0x9be6('0x22')](function(_0x11648c){if(_0x11648c){_0x526477=_0x11648c;_0x35f568[_0x9be6('0x39')]=_[_0x9be6('0x3a')](db[_0x9be6('0x99')][_0x9be6('0x36')]);_0x35f568['query']=_[_0x9be6('0x3a')](_0x3d2e6b[_0x9be6('0x3c')]);_0x35f568[_0x9be6('0x3b')]=_[_0x9be6('0x3e')](_0x35f568[_0x9be6('0x39')],_0x35f568[_0x9be6('0x3c')]);_0x4d1800[_0x9be6('0x3d')]=_[_0x9be6('0x3e')](_0x35f568[_0x9be6('0x39')],qs[_0x9be6('0x3f')](_0x3d2e6b[_0x9be6('0x3c')]['fields']));_0x4d1800[_0x9be6('0x3d')]=_0x4d1800[_0x9be6('0x3d')]['length']?_0x4d1800[_0x9be6('0x3d')]:_0x35f568[_0x9be6('0x39')];_0x4d1800[_0x9be6('0x42')]=qs['sort'](_0x3d2e6b[_0x9be6('0x3c')][_0x9be6('0x43')]);_0x4d1800[_0x9be6('0x44')]=qs[_0x9be6('0x3b')](_[_0x9be6('0x45')](_0x3d2e6b['query'],_0x35f568[_0x9be6('0x3b')]));if(_0x3d2e6b[_0x9be6('0x3c')]['filter']){_0x4d1800[_0x9be6('0x44')]=_['merge'](_0x4d1800[_0x9be6('0x44')],{'$or':_['map'](_0x4d1800['attributes'],function(_0x13496c){var _0x9f9b1b={};_0x9f9b1b[_0x13496c]={'$like':'%'+_0x3d2e6b[_0x9be6('0x3c')][_0x9be6('0x28')]+'%'};return _0x9f9b1b;})});}_0x4d1800=_['merge']({},_0x4d1800,_0x3d2e6b[_0x9be6('0x47')]);return _0x526477['getLists'](_0x4d1800);}})['then'](function(_0xb5ddcd){if(_0xb5ddcd){_0x7663f2=_0xb5ddcd[_0x9be6('0x40')];if(!_0x3d2e6b[_0x9be6('0x3c')]['hasOwnProperty']('nolimit')){_0x4d1800[_0x9be6('0x1c')]=qs[_0x9be6('0x1c')](_0x3d2e6b[_0x9be6('0x3c')][_0x9be6('0x1c')]);_0x4d1800[_0x9be6('0x1b')]=qs['offset'](_0x3d2e6b[_0x9be6('0x3c')]['offset']);}return _0x526477['getLists'](_0x4d1800);}})['then'](function(_0x9280fe){if(_0x9280fe){return _0x9280fe?{'count':_0x7663f2,'rows':_0x9280fe}:null;}})[_0x9be6('0x22')](respondWithResult(_0x117318,null))[_0x9be6('0x4c')](handleError(_0x117318,null));};exports[_0x9be6('0x9a')]=function(_0x3aaad4,_0x49ac88,_0x388071){var _0x1a1067,_0xe5f5e7;return db['VoiceQueue']['find']({'where':{'id':_0x3aaad4['params']['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x49ac88,null))['then'](function(_0x59dd27){if(_0x59dd27){_0xe5f5e7=_0x59dd27;return _0x59dd27[_0x9be6('0x9a')](_0x3aaad4[_0x9be6('0x51')][_0x9be6('0x7c')],_[_0x9be6('0x5b')](_0x3aaad4['body'],[_0x9be6('0x7c'),'id'])||{});}return null;})[_0x9be6('0x9b')](function(_0x30922d){var _0x533e45;_0x1a1067=_0x30922d||[];var _0x51d200=[];if(_0x30922d){for(var _0x28ead7=0x0;_0x28ead7<_0x30922d[_0x9be6('0x40')];_0x28ead7+=0x1){var _0x39db62=_0x30922d[_0x28ead7][_0x9be6('0x24')]({'plain':!![]});_0xe5f5e7[_0x9be6('0x9c')]=_0x3aaad4[_0x9be6('0x51')]['dialCheckDuplicateType']?_0x3aaad4[_0x9be6('0x51')][_0x9be6('0x9c')]:_0xe5f5e7[_0x9be6('0x9c')];switch(_0xe5f5e7[_0x9be6('0x9c')]){case _0x9be6('0x9d'):_0x533e45=squel[_0x9be6('0x9e')]()[_0x9be6('0x9f')](_0x9be6('0xa0'))[_0x9be6('0xa1')](['phone',_0x9be6('0xa2'),'ContactId',_0x9be6('0xa3'),'VoiceQueueId','createdAt',_0x9be6('0x5c')],squel[_0x9be6('0x7d')]()[_0x9be6('0x7e')](_0x9be6('0xa4'),'phone')[_0x9be6('0x7e')](_0x9be6('0xa5'),_0x9be6('0xa2'))['field']('id',_0x9be6('0xa6'))['field'](_0x39db62['CmListId'][_0x9be6('0x87')](),'ListId')[_0x9be6('0x7e')](_0x3aaad4[_0x9be6('0x4e')]['id'][_0x9be6('0x87')](),_0x9be6('0x62'))[_0x9be6('0x7e')](_0x9be6('0xa5'),_0x9be6('0x5d'))['field'](_0x9be6('0xa5'),_0x9be6('0x5c'))[_0x9be6('0x80')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x9be6('0x44')](_0x9be6('0xa7'),_0x39db62[_0x9be6('0xa8')][_0x9be6('0x87')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x9be6('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9be6('0x7d')]()[_0x9be6('0x7e')](_0x9be6('0xa9'))[_0x9be6('0x80')](_0x9be6('0xaa'))[_0x9be6('0x44')](_0x9be6('0x83'),_0x3aaad4[_0x9be6('0x4e')]['id']['toString']()))[_0x9be6('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9be6('0x7d')]()[_0x9be6('0x7e')]('COALESCE(phone,\x27\x27)')[_0x9be6('0x80')](_0x9be6('0xa0'))[_0x9be6('0x44')]('VoiceQueueId\x20=\x20?',_0x3aaad4['params']['id'][_0x9be6('0x87')]())))[_0x9be6('0x87')]();break;case _0x9be6('0xab'):_0x533e45=squel[_0x9be6('0x9e')]()['into'](_0x9be6('0xa0'))[_0x9be6('0xa1')]([_0x9be6('0xa4'),_0x9be6('0xa2'),_0x9be6('0xa6'),_0x9be6('0xa3'),_0x9be6('0x62'),_0x9be6('0x5d'),_0x9be6('0x5c')],squel[_0x9be6('0x7d')]()['field'](_0x9be6('0xa4'),'phone')[_0x9be6('0x7e')](_0x9be6('0xa5'),'scheduledAt')[_0x9be6('0x7e')]('id','ContactId')['field'](_0x39db62[_0x9be6('0xa8')][_0x9be6('0x87')](),_0x9be6('0xa3'))['field'](_0x3aaad4[_0x9be6('0x4e')]['id'][_0x9be6('0x87')](),'VoiceQueueId')['field'](_0x9be6('0xa5'),_0x9be6('0x5d'))['field'](_0x9be6('0xa5'),'updatedAt')['from'](_0x9be6('0xac'))[_0x9be6('0x44')](_0x9be6('0xad'))[_0x9be6('0x44')](_0x9be6('0xa7'),_0x39db62[_0x9be6('0xa8')][_0x9be6('0x87')]())[_0x9be6('0x44')](_0x9be6('0xae'))[_0x9be6('0x44')](_0x9be6('0xaf'),squel['select']()[_0x9be6('0x7e')](_0x9be6('0xb0'))[_0x9be6('0x80')](_0x9be6('0xa0'))[_0x9be6('0x44')]('VoiceQueueId\x20=\x20?',_0x3aaad4[_0x9be6('0x4e')]['id'][_0x9be6('0x87')]())))[_0x9be6('0x87')]();break;default:_0x533e45=squel[_0x9be6('0x9e')]()['into'](_0x9be6('0xa0'))[_0x9be6('0xa1')]([_0x9be6('0xa4'),'scheduledAt','ContactId',_0x9be6('0xa3'),_0x9be6('0x62'),_0x9be6('0x5d'),_0x9be6('0x5c')],squel[_0x9be6('0x7d')]()[_0x9be6('0x7e')]('phone',_0x9be6('0xa4'))['field'](_0x9be6('0xa5'),'scheduledAt')[_0x9be6('0x7e')]('id',_0x9be6('0xa6'))[_0x9be6('0x7e')](_0x39db62[_0x9be6('0xa8')]['toString'](),_0x9be6('0xa3'))['field'](_0x3aaad4['params']['id'][_0x9be6('0x87')](),_0x9be6('0x62'))[_0x9be6('0x7e')](_0x9be6('0xa5'),_0x9be6('0x5d'))[_0x9be6('0x7e')](_0x9be6('0xa5'),'updatedAt')[_0x9be6('0x80')](_0x9be6('0xac'))[_0x9be6('0x44')](_0x9be6('0xad'))['where']('ListId\x20=\x20?',_0x39db62[_0x9be6('0xa8')]['toString']())[_0x9be6('0x44')](_0x9be6('0xae')))[_0x9be6('0x87')]();}_0x51d200[_0x9be6('0x85')](db['sequelize']['query'](_0x533e45));}return BPromise[_0x9be6('0x94')](_0x51d200);}})[_0x9be6('0x22')](function(){return _0x1a1067;})['then'](respondWithResult(_0x49ac88,null))[_0x9be6('0x4c')](handleError(_0x49ac88,null));};exports['removeLists']=function(_0x585400,_0x5bcf7a,_0x450c71){return db[_0x9be6('0x35')]['find']({'where':{'id':_0x585400[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x5bcf7a,null))[_0x9be6('0x22')](function(_0x22ff0b){if(_0x22ff0b){return _0x22ff0b[_0x9be6('0xb1')](_0x585400['query'][_0x9be6('0x7c')]);}})[_0x9be6('0x22')](function(_0x155fd){if(_0x155fd){return db[_0x9be6('0x61')]['destroy']({'where':{'ListId':_0x585400[_0x9be6('0x3c')][_0x9be6('0x7c')],'VoiceQueueId':_0x585400[_0x9be6('0x4e')]['id']}})['then'](function(){return _0x155fd;});}})[_0x9be6('0x22')](respondWithStatusCode(_0x5bcf7a,null))[_0x9be6('0x4c')](handleError(_0x5bcf7a,null));};exports['getBlackLists']=function(_0x555a09,_0x24b4b3,_0x1442d6){var _0x2a5f7a={};var _0x594c37={};var _0x33a718;var _0x3f2dd3;return db['VoiceQueue'][_0x9be6('0x60')]({'where':{'id':_0x555a09[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x24b4b3,null))[_0x9be6('0x22')](function(_0x5e840f){if(_0x5e840f){_0x33a718=_0x5e840f;_0x594c37[_0x9be6('0x39')]=_['keys'](db[_0x9be6('0x99')]['rawAttributes']);_0x594c37[_0x9be6('0x3c')]=_[_0x9be6('0x3a')](_0x555a09[_0x9be6('0x3c')]);_0x594c37[_0x9be6('0x3b')]=_[_0x9be6('0x3e')](_0x594c37[_0x9be6('0x39')],_0x594c37['query']);_0x2a5f7a['attributes']=_[_0x9be6('0x3e')](_0x594c37['model'],qs['fields'](_0x555a09[_0x9be6('0x3c')][_0x9be6('0x3f')]));_0x2a5f7a[_0x9be6('0x3d')]=_0x2a5f7a['attributes'][_0x9be6('0x40')]?_0x2a5f7a[_0x9be6('0x3d')]:_0x594c37[_0x9be6('0x39')];_0x2a5f7a['order']=qs['sort'](_0x555a09[_0x9be6('0x3c')]['sort']);_0x2a5f7a[_0x9be6('0x44')]=qs['filters'](_[_0x9be6('0x45')](_0x555a09[_0x9be6('0x3c')],_0x594c37['filters']));if(_0x555a09[_0x9be6('0x3c')][_0x9be6('0x28')]){_0x2a5f7a[_0x9be6('0x44')]=_[_0x9be6('0x4f')](_0x2a5f7a[_0x9be6('0x44')],{'$or':_[_0x9be6('0x2a')](_0x2a5f7a[_0x9be6('0x3d')],function(_0x3b9bc9){var _0x2073f6={};_0x2073f6[_0x3b9bc9]={'$like':'%'+_0x555a09[_0x9be6('0x3c')][_0x9be6('0x28')]+'%'};return _0x2073f6;})});}_0x2a5f7a=_[_0x9be6('0x4f')]({},_0x2a5f7a,_0x555a09[_0x9be6('0x47')]);return _0x33a718[_0x9be6('0xb2')](_0x2a5f7a);}})['then'](function(_0x5c9aef){if(_0x5c9aef){_0x3f2dd3=_0x5c9aef[_0x9be6('0x40')];if(!_0x555a09[_0x9be6('0x3c')][_0x9be6('0x41')](_0x9be6('0x65'))){_0x2a5f7a[_0x9be6('0x1c')]=qs['limit'](_0x555a09['query']['limit']);_0x2a5f7a[_0x9be6('0x1b')]=qs[_0x9be6('0x1b')](_0x555a09[_0x9be6('0x3c')][_0x9be6('0x1b')]);}return _0x33a718['getBlackLists'](_0x2a5f7a);}})[_0x9be6('0x22')](function(_0x5297b7){if(_0x5297b7){return _0x5297b7?{'count':_0x3f2dd3,'rows':_0x5297b7}:null;}})['then'](respondWithResult(_0x24b4b3,null))[_0x9be6('0x4c')](handleError(_0x24b4b3,null));};exports[_0x9be6('0xb3')]=function(_0x199dc5,_0x1e4f5f,_0xba9c82){var _0x5028eb,_0x4e80c4;return db[_0x9be6('0x35')]['find']({'where':{'id':_0x199dc5[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x1e4f5f,null))[_0x9be6('0x22')](function(_0xc6dee6){if(_0xc6dee6){_0x4e80c4=_0xc6dee6;return _0xc6dee6[_0x9be6('0xb3')](_0x199dc5[_0x9be6('0x51')]['ids'],_['omit'](_0x199dc5['body'],[_0x9be6('0x7c'),'id'])||{});}return null;})[_0x9be6('0x9b')](function(_0x5885f2){var _0x48c428;_0x5028eb=_0x5885f2||[];var _0x1cd088=[];if(_0x5885f2){for(var _0x35a124=0x0;_0x35a124<_0x5885f2['length'];_0x35a124+=0x1){var _0xc34d15=_0x5885f2[_0x35a124][_0x9be6('0x24')]({'plain':!![]});_0x48c428=squel[_0x9be6('0x9e')]()['into'](_0x9be6('0xb4'))['fromQuery']([_0x9be6('0xa4'),_0x9be6('0xa6'),_0x9be6('0xa3'),_0x9be6('0x62'),_0x9be6('0x5d'),_0x9be6('0x5c')],squel[_0x9be6('0x7d')]()[_0x9be6('0x7e')](_0x9be6('0xa4'),_0x9be6('0xa4'))[_0x9be6('0x7e')]('id',_0x9be6('0xa6'))[_0x9be6('0x7e')](_0xc34d15[_0x9be6('0xa8')][_0x9be6('0x87')](),_0x9be6('0xa3'))[_0x9be6('0x7e')](_0x199dc5[_0x9be6('0x4e')]['id'][_0x9be6('0x87')](),_0x9be6('0x62'))['field'](_0x9be6('0xa5'),_0x9be6('0x5d'))[_0x9be6('0x7e')](_0x9be6('0xa5'),_0x9be6('0x5c'))['from'](_0x9be6('0xac'))[_0x9be6('0x44')](_0x9be6('0xad'))[_0x9be6('0x44')](_0x9be6('0xa7'),_0xc34d15['CmListId'][_0x9be6('0x87')]())['where'](_0x9be6('0xae')))[_0x9be6('0x87')]();_0x1cd088[_0x9be6('0x85')](db['sequelize'][_0x9be6('0x3c')](_0x48c428));}return BPromise[_0x9be6('0x94')](_0x1cd088);}})[_0x9be6('0x22')](function(){return _0x5028eb;})[_0x9be6('0x22')](respondWithResult(_0x1e4f5f,null))[_0x9be6('0x4c')](handleError(_0x1e4f5f,null));};exports[_0x9be6('0xb5')]=function(_0x5c71f2,_0x11db5e,_0xf74561){return db[_0x9be6('0x35')][_0x9be6('0x2e')]({'where':{'id':_0x5c71f2[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](handleEntityNotFound(_0x11db5e,null))['then'](function(_0x8991f6){if(_0x8991f6){return _0x8991f6[_0x9be6('0xb5')](_0x5c71f2[_0x9be6('0x3c')][_0x9be6('0x7c')]);}})[_0x9be6('0x22')](function(_0x11df61){if(_0x11df61){return db[_0x9be6('0x69')]['destroy']({'where':{'ListId':_0x5c71f2['query'][_0x9be6('0x7c')],'VoiceQueueId':_0x5c71f2[_0x9be6('0x4e')]['id']}})[_0x9be6('0x22')](function(){return _0x11df61;});}})['then'](respondWithStatusCode(_0x11db5e,null))[_0x9be6('0x4c')](handleError(_0x11db5e,null));};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js
index c8785e1..242018a 100644
--- a/server/api/voiceQueue/voiceQueue.events.js
+++ b/server/api/voiceQueue/voiceQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x98cb=['setMaxListeners','update','remove','emit','hook','events','VoiceQueue'];(function(_0x158df0,_0x3b5e6c){var _0x5af4c1=function(_0x537074){while(--_0x537074){_0x158df0['push'](_0x158df0['shift']());}};_0x5af4c1(++_0x3b5e6c);}(_0x98cb,0x8a));var _0xb98c=function(_0xe68bb7,_0x16c6c7){_0xe68bb7=_0xe68bb7-0x0;var _0x254b6f=_0x98cb[_0xe68bb7];return _0x254b6f;};'use strict';var EventEmitter=require(_0xb98c('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xb98c('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb98c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb98c('0x3'),'afterDestroy':_0xb98c('0x4')};function emitEvent(_0x21be33){return function(_0x5a6c20,_0x5aed3e,_0x3dd0fd){VoiceQueueEvents['emit'](_0x21be33+':'+_0x5a6c20['id'],_0x5a6c20);VoiceQueueEvents[_0xb98c('0x5')](_0x21be33,_0x5a6c20);_0x3dd0fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xb98c('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0xf681=['VoiceQueue','setMaxListeners','save','emit','hook','events','../../mysqldb'];(function(_0x358c73,_0x2f8cfc){var _0x4de898=function(_0x2402b1){while(--_0x2402b1){_0x358c73['push'](_0x358c73['shift']());}};_0x4de898(++_0x2f8cfc);}(_0xf681,0x1c5));var _0x1f68=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf681[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x1f68('0x0'));var VoiceQueue=require(_0x1f68('0x1'))['db'][_0x1f68('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1f68('0x3')](0x0);var events={'afterCreate':_0x1f68('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21af70){return function(_0x38a156,_0xaecf78,_0x213a52){VoiceQueueEvents[_0x1f68('0x5')](_0x21af70+':'+_0x38a156['id'],_0x38a156);VoiceQueueEvents['emit'](_0x21af70,_0x38a156);_0x213a52(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1f68('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js
index b56a1d3..07349c4 100644
--- a/server/api/voiceQueue/voiceQueue.model.js
+++ b/server/api/voiceQueue/voiceQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa73f=['./voiceQueue.attributes','define','util','api','bluebird','request-promise','rimraf'];(function(_0x2a029e,_0x487180){var _0x28daa2=function(_0x2d5f3f){while(--_0x2d5f3f){_0x2a029e['push'](_0x2a029e['shift']());}};_0x28daa2(++_0x487180);}(_0xa73f,0x1b4));var _0xfa73=function(_0x3dad74,_0x4a2a83){_0x3dad74=_0x3dad74-0x0;var _0x1ad290=_0xa73f[_0x3dad74];return _0x1ad290;};'use strict';var _=require('lodash');var util=require(_0xfa73('0x0'));var logger=require('../../config/logger')(_0xfa73('0x1'));var moment=require('moment');var BPromise=require(_0xfa73('0x2'));var rp=require(_0xfa73('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa73('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa73('0x5'));module['exports']=function(_0x3966cf,_0x3417d9){return _0x3966cf[_0xfa73('0x6')]('VoiceQueue',attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x77b5=['rimraf','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','../../config/logger','moment','request-promise','path'];(function(_0x287f17,_0x5b7b15){var _0x6c3af6=function(_0x509c4b){while(--_0x509c4b){_0x287f17['push'](_0x287f17['shift']());}};_0x6c3af6(++_0x5b7b15);}(_0x77b5,0x1e0));var _0x577b=function(_0x5a966d,_0x20e481){_0x5a966d=_0x5a966d-0x0;var _0x2657e7=_0x77b5[_0x5a966d];return _0x2657e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x577b('0x0'))('api');var moment=require(_0x577b('0x1'));var BPromise=require('bluebird');var rp=require(_0x577b('0x2'));var fs=require('fs');var path=require(_0x577b('0x3'));var rimraf=require(_0x577b('0x4'));var config=require(_0x577b('0x5'));var attributes=require(_0x577b('0x6'));module[_0x577b('0x7')]=function(_0x38b2ab,_0x2025a7){return _0x38b2ab[_0x577b('0x8')](_0x577b('0x9'),attributes,{'tableName':_0x577b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js
index 6078e7f..c4ab88d 100644
--- a/server/api/voiceQueue/voiceQueue.rpc.js
+++ b/server/api/voiceQueue/voiceQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b7d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','VoiceQueue','options','raw','where','include','model','attributes','map','GetVoiceQueue','stringify','debug','ShowVoiceQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2b7d,0x1b6));var _0xd2b7=function(_0x236f1a,_0x3e03c4){_0x236f1a=_0x236f1a-0x0;var _0x4e3071=_0x2b7d[_0x236f1a];return _0x4e3071;};'use strict';var _=require('lodash');var util=require(_0xd2b7('0x0'));var moment=require(_0xd2b7('0x1'));var BPromise=require(_0xd2b7('0x2'));var rs=require(_0xd2b7('0x3'));var fs=require('fs');var Redis=require(_0xd2b7('0x4'));var db=require(_0xd2b7('0x5'))['db'];var utils=require(_0xd2b7('0x6'));var logger=require(_0xd2b7('0x7'))('rpc');var config=require(_0xd2b7('0x8'));var jayson=require(_0xd2b7('0x9'));var client=jayson['client'][_0xd2b7('0xa')]({'port':0x232a});config[_0xd2b7('0xb')]=_['defaults'](config['redis'],{'host':_0xd2b7('0xc'),'port':0x18eb});var socket=require(_0xd2b7('0xd'))(new Redis(config[_0xd2b7('0xb')]));require('./voiceQueue.socket')[_0xd2b7('0xe')](socket);function respondWithRpcPromise(_0x5cde5b,_0x3bfc1e,_0x274ae1){return new BPromise(function(_0x28ad39,_0xfde217){return client[_0xd2b7('0xf')](_0x5cde5b,_0x274ae1)[_0xd2b7('0x10')](function(_0x3e8d3e){logger[_0xd2b7('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x3bfc1e,_0xd2b7('0x12'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3bfc1e,'request\x20sent',JSON['stringify'](_0x3e8d3e));if(_0x3e8d3e[_0xd2b7('0x13')]){if(_0x3e8d3e[_0xd2b7('0x13')][_0xd2b7('0x14')]===0x1f4){logger[_0xd2b7('0x13')](_0xd2b7('0x15'),_0x3bfc1e,_0x3e8d3e[_0xd2b7('0x13')][_0xd2b7('0x16')]);return _0xfde217(_0x3e8d3e[_0xd2b7('0x13')][_0xd2b7('0x16')]);}logger[_0xd2b7('0x13')](_0xd2b7('0x15'),_0x3bfc1e,_0x3e8d3e[_0xd2b7('0x13')]['message']);return _0x28ad39(_0x3e8d3e[_0xd2b7('0x13')][_0xd2b7('0x16')]);}else{logger['info'](_0xd2b7('0x15'),_0x3bfc1e,_0xd2b7('0x12'));_0x28ad39(_0x3e8d3e[_0xd2b7('0x17')][_0xd2b7('0x16')]);}})[_0xd2b7('0x18')](function(_0x5909c7){logger[_0xd2b7('0x13')](_0xd2b7('0x15'),_0x3bfc1e,_0x5909c7);_0xfde217(_0x5909c7);});});}exports['GetVoiceQueue']=function(_0x46f8c3){var _0xa28459=this;return new Promise(function(_0x50c54f,_0x313955){return db[_0xd2b7('0x19')]['findAll']({'raw':_0x46f8c3['options']?_0x46f8c3[_0xd2b7('0x1a')][_0xd2b7('0x1b')]===undefined?!![]:![]:!![],'where':_0x46f8c3[_0xd2b7('0x1a')]?_0x46f8c3[_0xd2b7('0x1a')][_0xd2b7('0x1c')]||null:null,'attributes':_0x46f8c3[_0xd2b7('0x1a')]?_0x46f8c3[_0xd2b7('0x1a')]['attributes']||null:null,'limit':_0x46f8c3[_0xd2b7('0x1a')]?_0x46f8c3[_0xd2b7('0x1a')]['limit']||null:null,'include':_0x46f8c3[_0xd2b7('0x1a')]?_0x46f8c3[_0xd2b7('0x1a')][_0xd2b7('0x1d')]?_['map'](_0x46f8c3['options'][_0xd2b7('0x1d')],function(_0x43506f){return{'model':db[_0x43506f[_0xd2b7('0x1e')]],'as':_0x43506f['as'],'attributes':_0x43506f['attributes'],'include':_0x43506f['include']?_['map'](_0x43506f[_0xd2b7('0x1d')],function(_0x5b0737){return{'model':db[_0x5b0737[_0xd2b7('0x1e')]],'as':_0x5b0737['as'],'attributes':_0x5b0737[_0xd2b7('0x1f')],'include':_0x5b0737[_0xd2b7('0x1d')]?_[_0xd2b7('0x20')](_0x5b0737[_0xd2b7('0x1d')],function(_0xa4bdc6){return{'model':db[_0xa4bdc6[_0xd2b7('0x1e')]],'as':_0xa4bdc6['as'],'attributes':_0xa4bdc6[_0xd2b7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ec798){logger[_0xd2b7('0x11')](_0xd2b7('0x21'),_0x46f8c3);logger['debug'](_0xd2b7('0x21'),_0x46f8c3,JSON[_0xd2b7('0x22')](_0x2ec798));_0x50c54f(_0x2ec798);})[_0xd2b7('0x18')](function(_0x25d939){logger[_0xd2b7('0x13')](_0xd2b7('0x21'),_0x25d939['message'],_0x46f8c3);_0x313955(_0xa28459[_0xd2b7('0x13')](0x1f4,_0x25d939[_0xd2b7('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x14a254){var _0x1e4676=this;return new Promise(function(_0x507b54,_0x4c7f9e){return db[_0xd2b7('0x19')]['find']({'raw':_0x14a254['options']?_0x14a254[_0xd2b7('0x1a')][_0xd2b7('0x1b')]===undefined?!![]:![]:!![],'where':_0x14a254[_0xd2b7('0x1a')]?_0x14a254[_0xd2b7('0x1a')][_0xd2b7('0x1c')]||null:null,'attributes':_0x14a254[_0xd2b7('0x1a')]?_0x14a254[_0xd2b7('0x1a')][_0xd2b7('0x1f')]||null:null,'include':_0x14a254[_0xd2b7('0x1a')]?_0x14a254['options'][_0xd2b7('0x1d')]?_['map'](_0x14a254[_0xd2b7('0x1a')][_0xd2b7('0x1d')],function(_0x4b2930){return{'model':db[_0x4b2930[_0xd2b7('0x1e')]],'as':_0x4b2930['as'],'attributes':_0x4b2930[_0xd2b7('0x1f')],'include':_0x4b2930[_0xd2b7('0x1d')]?_[_0xd2b7('0x20')](_0x4b2930[_0xd2b7('0x1d')],function(_0x56d28b){return{'model':db[_0x56d28b['model']],'as':_0x56d28b['as'],'attributes':_0x56d28b[_0xd2b7('0x1f')],'include':_0x56d28b[_0xd2b7('0x1d')]?_[_0xd2b7('0x20')](_0x56d28b[_0xd2b7('0x1d')],function(_0x358f5e){return{'model':db[_0x358f5e[_0xd2b7('0x1e')]],'as':_0x358f5e['as'],'attributes':_0x358f5e[_0xd2b7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd2b7('0x10')](function(_0x4fdc65){logger[_0xd2b7('0x11')]('ShowVoiceQueue',_0x14a254);logger[_0xd2b7('0x23')]('ShowVoiceQueue',_0x14a254,JSON[_0xd2b7('0x22')](_0x4fdc65));_0x507b54(_0x4fdc65);})[_0xd2b7('0x18')](function(_0x2727c6){logger['error'](_0xd2b7('0x24'),_0x2727c6[_0xd2b7('0x16')],_0x14a254);_0x4c7f9e(_0x1e4676[_0xd2b7('0x13')](0x1f4,_0x2727c6[_0xd2b7('0x16')]));});});};
\ No newline at end of file
+var _0xf433=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','include','map','model','attributes','debug','raw','where','stringify','ShowVoiceQueue','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x4ecd76,_0x79f1f3){var _0x240f34=function(_0x563f79){while(--_0x563f79){_0x4ecd76['push'](_0x4ecd76['shift']());}};_0x240f34(++_0x79f1f3);}(_0xf433,0x1cd));var _0x3f43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf433[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3f43('0x0'));var util=require(_0x3f43('0x1'));var moment=require('moment');var BPromise=require(_0x3f43('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f43('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f43('0x4'));var logger=require('../../config/logger')(_0x3f43('0x5'));var config=require(_0x3f43('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f43('0x7')]({'port':0x232a});config[_0x3f43('0x8')]=_[_0x3f43('0x9')](config['redis'],{'host':_0x3f43('0xa'),'port':0x18eb});var socket=require(_0x3f43('0xb'))(new Redis(config[_0x3f43('0x8')]));require(_0x3f43('0xc'))['register'](socket);function respondWithRpcPromise(_0xe4e9f7,_0x1e522b,_0x45b632){return new BPromise(function(_0x298190,_0x45b7dd){return client[_0x3f43('0xd')](_0xe4e9f7,_0x45b632)[_0x3f43('0xe')](function(_0x28e763){logger[_0x3f43('0xf')](_0x3f43('0x10'),_0x1e522b,_0x3f43('0x11'));logger['debug'](_0x3f43('0x12'),_0x1e522b,_0x3f43('0x11'),JSON['stringify'](_0x28e763));if(_0x28e763[_0x3f43('0x13')]){if(_0x28e763[_0x3f43('0x13')]['code']===0x1f4){logger[_0x3f43('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x1e522b,_0x28e763[_0x3f43('0x13')][_0x3f43('0x14')]);return _0x45b7dd(_0x28e763[_0x3f43('0x13')][_0x3f43('0x14')]);}logger['error'](_0x3f43('0x10'),_0x1e522b,_0x28e763['error'][_0x3f43('0x14')]);return _0x298190(_0x28e763[_0x3f43('0x13')]['message']);}else{logger[_0x3f43('0xf')](_0x3f43('0x10'),_0x1e522b,_0x3f43('0x11'));_0x298190(_0x28e763[_0x3f43('0x15')][_0x3f43('0x14')]);}})[_0x3f43('0x16')](function(_0x5addc7){logger['error'](_0x3f43('0x10'),_0x1e522b,_0x5addc7);_0x45b7dd(_0x5addc7);});});}exports[_0x3f43('0x17')]=function(_0x44a7cd){var _0x123537=this;return new Promise(function(_0x20febf,_0x50ef62){return db[_0x3f43('0x18')][_0x3f43('0x19')]({'raw':_0x44a7cd['options']?_0x44a7cd[_0x3f43('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x44a7cd[_0x3f43('0x1a')]?_0x44a7cd[_0x3f43('0x1a')]['where']||null:null,'attributes':_0x44a7cd['options']?_0x44a7cd[_0x3f43('0x1a')]['attributes']||null:null,'limit':_0x44a7cd[_0x3f43('0x1a')]?_0x44a7cd[_0x3f43('0x1a')]['limit']||null:null,'include':_0x44a7cd[_0x3f43('0x1a')]?_0x44a7cd[_0x3f43('0x1a')][_0x3f43('0x1b')]?_[_0x3f43('0x1c')](_0x44a7cd[_0x3f43('0x1a')][_0x3f43('0x1b')],function(_0x5a8a4a){return{'model':db[_0x5a8a4a[_0x3f43('0x1d')]],'as':_0x5a8a4a['as'],'attributes':_0x5a8a4a[_0x3f43('0x1e')],'include':_0x5a8a4a[_0x3f43('0x1b')]?_[_0x3f43('0x1c')](_0x5a8a4a[_0x3f43('0x1b')],function(_0x2443fb){return{'model':db[_0x2443fb[_0x3f43('0x1d')]],'as':_0x2443fb['as'],'attributes':_0x2443fb[_0x3f43('0x1e')],'include':_0x2443fb[_0x3f43('0x1b')]?_[_0x3f43('0x1c')](_0x2443fb[_0x3f43('0x1b')],function(_0x297481){return{'model':db[_0x297481[_0x3f43('0x1d')]],'as':_0x297481['as'],'attributes':_0x297481[_0x3f43('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3f43('0xe')](function(_0x1650e0){logger[_0x3f43('0xf')](_0x3f43('0x17'),_0x44a7cd);logger[_0x3f43('0x1f')](_0x3f43('0x17'),_0x44a7cd,JSON['stringify'](_0x1650e0));_0x20febf(_0x1650e0);})[_0x3f43('0x16')](function(_0x374cca){logger[_0x3f43('0x13')]('GetVoiceQueue',_0x374cca[_0x3f43('0x14')],_0x44a7cd);_0x50ef62(_0x123537[_0x3f43('0x13')](0x1f4,_0x374cca[_0x3f43('0x14')]));});});};exports['ShowVoiceQueue']=function(_0x3ab7fa){var _0xf0448=this;return new Promise(function(_0x2ba229,_0x45066a){return db[_0x3f43('0x18')]['find']({'raw':_0x3ab7fa[_0x3f43('0x1a')]?_0x3ab7fa['options'][_0x3f43('0x20')]===undefined?!![]:![]:!![],'where':_0x3ab7fa[_0x3f43('0x1a')]?_0x3ab7fa[_0x3f43('0x1a')][_0x3f43('0x21')]||null:null,'attributes':_0x3ab7fa[_0x3f43('0x1a')]?_0x3ab7fa['options'][_0x3f43('0x1e')]||null:null,'include':_0x3ab7fa[_0x3f43('0x1a')]?_0x3ab7fa[_0x3f43('0x1a')][_0x3f43('0x1b')]?_[_0x3f43('0x1c')](_0x3ab7fa[_0x3f43('0x1a')][_0x3f43('0x1b')],function(_0x7d19fb){return{'model':db[_0x7d19fb[_0x3f43('0x1d')]],'as':_0x7d19fb['as'],'attributes':_0x7d19fb['attributes'],'include':_0x7d19fb[_0x3f43('0x1b')]?_['map'](_0x7d19fb[_0x3f43('0x1b')],function(_0x19bdba){return{'model':db[_0x19bdba[_0x3f43('0x1d')]],'as':_0x19bdba['as'],'attributes':_0x19bdba[_0x3f43('0x1e')],'include':_0x19bdba['include']?_[_0x3f43('0x1c')](_0x19bdba[_0x3f43('0x1b')],function(_0x14928a){return{'model':db[_0x14928a['model']],'as':_0x14928a['as'],'attributes':_0x14928a[_0x3f43('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3f43('0xe')](function(_0x10da39){logger[_0x3f43('0xf')]('ShowVoiceQueue',_0x3ab7fa);logger['debug']('ShowVoiceQueue',_0x3ab7fa,JSON[_0x3f43('0x22')](_0x10da39));_0x2ba229(_0x10da39);})[_0x3f43('0x16')](function(_0x37272c){logger['error'](_0x3f43('0x23'),_0x37272c['message'],_0x3ab7fa);_0x45066a(_0xf0448[_0x3f43('0x13')](0x1f4,_0x37272c['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js
index 7655923..2b3c09f 100644
--- a/server/api/voiceQueue/voiceQueue.socket.js
+++ b/server/api/voiceQueue/voiceQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8bf7=['voiceQueue:','./voiceQueue.events','save','remove','emit','removeListener','register','length'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0x8bf7,0x139));var _0x78bf=function(_0x35895c,_0x74e456){_0x35895c=_0x35895c-0x0;var _0x1a1c8e=_0x8bf7[_0x35895c];return _0x1a1c8e;};'use strict';var VoiceQueueEvents=require(_0x78bf('0x0'));var events=[_0x78bf('0x1'),_0x78bf('0x2'),'update'];function createListener(_0x25975b,_0xaf9f0f){return function(_0x382157){_0xaf9f0f[_0x78bf('0x3')](_0x25975b,_0x382157);};}function removeListener(_0x3ea947,_0x3e93c7){return function(){VoiceQueueEvents[_0x78bf('0x4')](_0x3ea947,_0x3e93c7);};}exports[_0x78bf('0x5')]=function(_0x2d8b0a){for(var _0x85fc98=0x0,_0x2d4cf9=events[_0x78bf('0x6')];_0x85fc98<_0x2d4cf9;_0x85fc98++){var _0x20c683=events[_0x85fc98];var _0x29ec01=createListener(_0x78bf('0x7')+_0x20c683,_0x2d8b0a);VoiceQueueEvents['on'](_0x20c683,_0x29ec01);}};
\ No newline at end of file
+var _0x7a85=['length','./voiceQueue.events','remove','emit','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a85,0x16e));var _0x57a8=function(_0x4d69d1,_0x211712){_0x4d69d1=_0x4d69d1-0x0;var _0x4950ad=_0x7a85[_0x4d69d1];return _0x4950ad;};'use strict';var VoiceQueueEvents=require(_0x57a8('0x0'));var events=['save',_0x57a8('0x1'),'update'];function createListener(_0x7aa7d,_0x2c80c9){return function(_0x563aa2){_0x2c80c9[_0x57a8('0x2')](_0x7aa7d,_0x563aa2);};}function removeListener(_0x1e716f,_0x29865a){return function(){VoiceQueueEvents['removeListener'](_0x1e716f,_0x29865a);};}exports[_0x57a8('0x3')]=function(_0x42a9d4){for(var _0x5f5568=0x0,_0xe7e5ce=events[_0x57a8('0x4')];_0x5f5568<_0xe7e5ce;_0x5f5568++){var _0x51146d=events[_0x5f5568];var _0x282af6=createListener('voiceQueue:'+_0x51146d,_0x42a9d4);VoiceQueueEvents['on'](_0x51146d,_0x282af6);}};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js
index 432726f..5091942 100644
--- a/server/api/voiceQueueReport/index.js
+++ b/server/api/voiceQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe944=['../../components/auth/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x25f057,_0x55d359){var _0x52a865=function(_0x38e96f){while(--_0x38e96f){_0x25f057['push'](_0x25f057['shift']());}};_0x52a865(++_0x55d359);}(_0xe944,0x174));var _0x4e94=function(_0x2fe74b,_0x10c52c){_0x2fe74b=_0x2fe74b-0x0;var _0x5798f8=_0xe944[_0x2fe74b];return _0x5798f8;};'use strict';var multer=require(_0x4e94('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4e94('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x4e94('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4e94('0x3'));router[_0x4e94('0x4')]('/',auth[_0x4e94('0x5')](),controller[_0x4e94('0x6')]);router['get'](_0x4e94('0x7'),auth[_0x4e94('0x5')](),controller[_0x4e94('0x8')]);router[_0x4e94('0x4')]('/index',auth[_0x4e94('0x5')](),controller['getVoiceQueuesReport']);router[_0x4e94('0x4')](_0x4e94('0x9'),auth[_0x4e94('0x5')](),controller[_0x4e94('0xa')]);router['post']('/',auth[_0x4e94('0x5')](),controller[_0x4e94('0xb')]);router[_0x4e94('0xc')](_0x4e94('0x9'),auth[_0x4e94('0x5')](),controller[_0x4e94('0xd')]);router[_0x4e94('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x4e94('0xf')]);module[_0x4e94('0x10')]=router;
\ No newline at end of file
+var _0x0af5=['./voiceQueueReport.controller','get','isAuthenticated','index','describe','getVoiceQueuesReport','show','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x0af5,0x158));var _0x50af=function(_0x4f3236,_0x4ff0d3){_0x4f3236=_0x4f3236-0x0;var _0x344b6e=_0x0af5[_0x4f3236];return _0x344b6e;};'use strict';var multer=require('multer');var util=require(_0x50af('0x0'));var path=require(_0x50af('0x1'));var timeout=require(_0x50af('0x2'));var express=require(_0x50af('0x3'));var router=express[_0x50af('0x4')]();var auth=require(_0x50af('0x5'));var interaction=require(_0x50af('0x6'));var config=require(_0x50af('0x7'));var controller=require(_0x50af('0x8'));router[_0x50af('0x9')]('/',auth[_0x50af('0xa')](),controller[_0x50af('0xb')]);router['get']('/describe',auth[_0x50af('0xa')](),controller[_0x50af('0xc')]);router['get']('/index',auth[_0x50af('0xa')](),controller[_0x50af('0xd')]);router['get']('/:id',auth[_0x50af('0xa')](),controller[_0x50af('0xe')]);router['post']('/',auth[_0x50af('0xa')](),controller[_0x50af('0xf')]);router[_0x50af('0x10')](_0x50af('0x11'),auth['isAuthenticated'](),controller[_0x50af('0x12')]);router[_0x50af('0x13')](_0x50af('0x11'),auth[_0x50af('0xa')](),controller[_0x50af('0x14')]);module[_0x50af('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js
index 39f69ea..7aeb8b4 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.attributes.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1c63=['DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0x1c63,0xdc));var _0x31c6=function(_0x2a0dc9,_0x3802f4){_0x2a0dc9=_0x2a0dc9-0x0;var _0x198be1=_0x1c63[_0x2a0dc9];return _0x198be1;};'use strict';var Sequelize=require(_0x31c6('0x0'));var moment=require(_0x31c6('0x1'));module[_0x31c6('0x2')]={'type':{'type':Sequelize[_0x31c6('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x31c6('0x3')]},'calleridname':{'type':Sequelize[_0x31c6('0x3')]},'queue':{'type':Sequelize[_0x31c6('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x31c6('0x4')],'set':function(_0x3c1288){var _0x472d52=moment(_0x3c1288);var _0x1f4994=moment(this[_0x31c6('0x5')]('queuecallerjoinAt'))['format'](_0x31c6('0x6'));var _0x184d7d=_0x472d52[_0x31c6('0x7')](_0x1f4994,_0x31c6('0x8'));this[_0x31c6('0x9')]('queuecallerleaveAt',_0x3c1288);this[_0x31c6('0x9')](_0x31c6('0xa'),_0x184d7d||null);}},'position':{'type':Sequelize[_0x31c6('0xb')]},'count':{'type':Sequelize[_0x31c6('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x31c6('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x31c6('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x31c6('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x31c6('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x31c6('0xd')},'originalposition':{'type':Sequelize[_0x31c6('0xb')]},'channel':{'type':Sequelize[_0x31c6('0x3')]},'connectedlinenum':{'type':Sequelize[_0x31c6('0x3')]},'connectedlinename':{'type':Sequelize[_0x31c6('0x3')]},'accountcode':{'type':Sequelize[_0x31c6('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x31c6('0x3')]},'priority':{'type':Sequelize[_0x31c6('0x3')]},'holdtime':{'type':Sequelize[_0x31c6('0xb')]},'mohtime':{'type':Sequelize[_0x31c6('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x31c6('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x31c6('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x31c6('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x31c6('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4c84=['DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4c84,0x14d));var _0x44c8=function(_0x167025,_0x548608){_0x167025=_0x167025-0x0;var _0x103782=_0x4c84[_0x167025];return _0x103782;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x44c8('0x0'));module[_0x44c8('0x1')]={'type':{'type':Sequelize[_0x44c8('0x2')]},'uniqueid':{'type':Sequelize[_0x44c8('0x2')]},'calleridnum':{'type':Sequelize[_0x44c8('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x44c8('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x44c8('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x44c8('0x3')],'set':function(_0x4d8d30){var _0x5161b5=moment(_0x4d8d30);var _0x5471bf=moment(this[_0x44c8('0x4')]('queuecallerjoinAt'))[_0x44c8('0x5')](_0x44c8('0x6'));var _0x262aaf=_0x5161b5[_0x44c8('0x7')](_0x5471bf,_0x44c8('0x8'));this[_0x44c8('0x9')](_0x44c8('0xa'),_0x4d8d30);this[_0x44c8('0x9')](_0x44c8('0xb'),_0x262aaf||null);}},'position':{'type':Sequelize[_0x44c8('0xc')]},'count':{'type':Sequelize[_0x44c8('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x44c8('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x44c8('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x44c8('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x44c8('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x44c8('0x2')],'comment':_0x44c8('0xe')},'originalposition':{'type':Sequelize[_0x44c8('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x44c8('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x44c8('0x2')]},'context':{'type':Sequelize[_0x44c8('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x44c8('0x2')]},'holdtime':{'type':Sequelize[_0x44c8('0xc')]},'mohtime':{'type':Sequelize[_0x44c8('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x44c8('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x44c8('0x2')]},'transfer':{'type':Sequelize[_0x44c8('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x44c8('0xf')},'transferexten':{'type':Sequelize[_0x44c8('0x2')]},'transferuniqueid':{'type':Sequelize[_0x44c8('0x2')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x44c8('0xc')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js
index 8f20cb1..b76e0a4 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.controller.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','VoiceQueueReport','count','include','catch','show','params','keys','length','includeAll','find','create','body','describe','getVoiceQueuesReport','fields','limit','rows','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x2b4e94,_0x2233dd){_0x2233dd=_0x2233dd||0xcc;return function(_0x24b5bb){if(_0x24b5bb){return _0x2b4e94[_0x7995('0x1e')](_0x2233dd);}return _0x2b4e94[_0x7995('0x1f')](_0x2233dd)[_0x7995('0x20')]();};}function respondWithResult(_0x2202ce,_0x41cbf0){_0x41cbf0=_0x41cbf0||0xc8;return function(_0x5377e5){if(_0x5377e5){return _0x2202ce[_0x7995('0x1f')](_0x41cbf0)['json'](_0x5377e5);}};}function respondWithFilteredResult(_0x2f832e,_0x37f297){return function(_0x43d4b8){if(_0x43d4b8){var _0x291317=_0x43d4b8['count'],_0x1e1415=_0x37f297[_0x7995('0x21')],_0x37a7d4=_0x37f297['offset']+_0x37f297['limit'],_0x4faa60;if(_0x37a7d4>=_0x291317){_0x37a7d4=_0x291317;_0x4faa60=0xc8;}else{_0x4faa60=0xce;}_0x2f832e[_0x7995('0x1f')](_0x4faa60);return _0x2f832e[_0x7995('0x22')]('Content-Range',_0x1e1415+'-'+_0x37a7d4+'/'+_0x291317)[_0x7995('0x23')](_0x43d4b8);}return null;};}function patchUpdates(_0x51f276){return function(_0x4b1a8e){try{jsonpatch[_0x7995('0x24')](_0x4b1a8e,_0x51f276,!![]);}catch(_0x327b1f){return BPromise[_0x7995('0x25')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x26')]();};}function saveUpdates(_0x460924,_0x1c278a){return function(_0x5d40ae){if(_0x5d40ae){return _0x5d40ae[_0x7995('0x27')](_0x460924)[_0x7995('0x28')](function(_0x204507){return _0x204507;});}return null;};}function removeEntity(_0x285437,_0x563799){return function(_0x13bc35){if(_0x13bc35){return _0x13bc35[_0x7995('0x29')]()[_0x7995('0x28')](function(){_0x285437['status'](0xcc)[_0x7995('0x20')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1e')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x2a')]);if(_0x47625f[_0x7995('0x2b')]){delete _0x47625f[_0x7995('0x2b')];}_0x2a307e[_0x7995('0x1f')](_0x56691a)[_0x7995('0x2c')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['VoiceQueueReport'][_0x7995('0x2d')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2e')],'type':_0xe6b0b3[_0x7995('0x2f')][_0x7995('0x30')]};});_0x3250e0[_0x7995('0x31')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x32')]=_['keys'](_0x9b2a15[_0x7995('0x32')]);_0x3250e0[_0x7995('0x33')]=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]);_0x456a28['attributes']=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x35')]=_0x456a28[_0x7995('0x35')]['length']?_0x456a28[_0x7995('0x35')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x32')][_0x7995('0x36')](_0x7995('0x37'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x32')]['limit']);_0x456a28['offset']=qs[_0x7995('0x21')](_0x9b2a15[_0x7995('0x32')]['offset']);}_0x456a28[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x9b2a15[_0x7995('0x32')][_0x7995('0x39')]);_0x456a28[_0x7995('0x3a')]=qs['filters'](_[_0x7995('0x3b')](_0x9b2a15[_0x7995('0x32')],_0x3250e0[_0x7995('0x33')]),_0x574574);if(_0x9b2a15[_0x7995('0x32')]['filter']){_0x456a28[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x456a28[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2f')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2b')]]={'$like':'%'+_0x9b2a15[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3c')]({},_0x456a28,_0x9b2a15[_0x7995('0x3f')]);var _0x14d638={'where':_0x456a28[_0x7995('0x3a')]};return db[_0x7995('0x40')][_0x7995('0x41')](_0x14d638)[_0x7995('0x28')](function(_0x270d52){_0x4253e5[_0x7995('0x41')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x42')]=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x43')](handleError(_0x514445,null));};exports[_0x7995('0x44')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':![],'where':{'id':_0x35c8ff[_0x7995('0x45')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x40')][_0x7995('0x2d')]);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x46')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x33')]=_[_0x7995('0x34')](_0x5e85b9[_0x7995('0x31')],_0x5e85b9[_0x7995('0x32')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x31')],qs['fields'](_0x35c8ff[_0x7995('0x32')]['fields']));_0x46ac4f[_0x7995('0x35')]=_0x46ac4f['attributes'][_0x7995('0x47')]?_0x46ac4f[_0x7995('0x35')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x32')][_0x7995('0x48')]){_0x46ac4f[_0x7995('0x42')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3c')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x40')][_0x7995('0x49')](_0x46ac4f)[_0x7995('0x28')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x43')](handleError(_0x576b96,null));};exports[_0x7995('0x4a')]=function(_0x511567,_0x3d8ae3){return db[_0x7995('0x40')]['create'](_0x511567[_0x7995('0x4b')],{})[_0x7995('0x28')](respondWithResult(_0x3d8ae3,0xc9))['catch'](handleError(_0x3d8ae3,null));};exports[_0x7995('0x27')]=function(_0x5843ba,_0x1d87f9){if(_0x5843ba[_0x7995('0x4b')]['id']){delete _0x5843ba[_0x7995('0x4b')]['id'];}return db[_0x7995('0x40')][_0x7995('0x49')]({'where':{'id':_0x5843ba[_0x7995('0x45')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x1d87f9,null))['then'](saveUpdates(_0x5843ba[_0x7995('0x4b')],null))[_0x7995('0x28')](respondWithResult(_0x1d87f9,null))[_0x7995('0x43')](handleError(_0x1d87f9,null));};exports['destroy']=function(_0x19da63,_0x1fe77e){return db[_0x7995('0x40')]['find']({'where':{'id':_0x19da63['params']['id']}})['then'](handleEntityNotFound(_0x1fe77e,null))[_0x7995('0x28')](removeEntity(_0x1fe77e,null))[_0x7995('0x43')](handleError(_0x1fe77e,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x28')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x4d')]=function(_0x4ab09f,_0x14fe7f){var _0x33c801={},_0x206d2a={},_0x50c7b5={'count':0x0,'rows':[]};_0x206d2a['model']=_['keys'](db['VoiceQueueReport'][_0x7995('0x2d')]);_0x206d2a[_0x7995('0x32')]=_[_0x7995('0x46')](_0x4ab09f[_0x7995('0x32')]);_0x206d2a[_0x7995('0x33')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],_0x206d2a[_0x7995('0x32')]);_0x33c801[_0x7995('0x35')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],qs[_0x7995('0x4e')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x4e')]));_0x33c801[_0x7995('0x35')]=_0x33c801[_0x7995('0x35')][_0x7995('0x47')]?_0x33c801[_0x7995('0x35')]:_0x206d2a[_0x7995('0x31')];if(!_0x4ab09f['query'][_0x7995('0x36')](_0x7995('0x37'))){_0x33c801[_0x7995('0x4f')]=qs[_0x7995('0x4f')](_0x4ab09f['query']['limit']);_0x33c801[_0x7995('0x21')]=qs[_0x7995('0x21')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x21')]);}_0x33c801['order']=qs[_0x7995('0x39')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x39')]);_0x33c801[_0x7995('0x3a')]=qs['filters'](_['pick'](_0x4ab09f[_0x7995('0x32')],_0x206d2a[_0x7995('0x33')]));if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]){_0x33c801[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x33c801[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x33c801[_0x7995('0x35')],function(_0x50caf5){var _0x18f230={};_0x18f230[_0x50caf5]={'$like':'%'+_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x18f230;})});}_0x33c801=_[_0x7995('0x3c')]({},_0x33c801,_0x4ab09f['options']);var _0x51bf6a={'where':_0x33c801[_0x7995('0x3a')]};return db[_0x7995('0x40')]['count'](_0x51bf6a)[_0x7995('0x28')](function(_0x375fc9){_0x50c7b5[_0x7995('0x41')]=_0x375fc9;if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x48')]){_0x33c801['include']=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x33c801);})[_0x7995('0x28')](function(_0xe31dcb){_0x50c7b5[_0x7995('0x50')]=_0xe31dcb;return _0x50c7b5;})[_0x7995('0x28')](respondWithFilteredResult(_0x14fe7f,_0x33c801,_0x7995('0x4d')))[_0x7995('0x43')](handleError(_0x14fe7f,null,_0x7995('0x4d')));};
\ No newline at end of file
+var _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x7a54,0x106));var _0x47a5=function(_0x34433a,_0x27d582){_0x34433a=_0x34433a-0x0;var _0x1c7272=_0x7a54[_0x34433a];return _0x1c7272;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']),_0x528582);if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js
index 57df95d..81f2f34 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.events.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x52e1=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x30d114,_0x425e94){var _0x5a1229=function(_0x990ae4){while(--_0x990ae4){_0x30d114['push'](_0x30d114['shift']());}};_0x5a1229(++_0x425e94);}(_0x52e1,0xad));var _0x152e=function(_0x44769c,_0x4b2cc6){_0x44769c=_0x44769c-0x0;var _0x216eb5=_0x52e1[_0x44769c];return _0x216eb5;};'use strict';var EventEmitter=require(_0x152e('0x0'));var VoiceQueueReport=require(_0x152e('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x152e('0x2')](0x0);var events={'afterCreate':_0x152e('0x3'),'afterUpdate':_0x152e('0x4'),'afterDestroy':_0x152e('0x5')};function emitEvent(_0x24d058){return function(_0x31b16e,_0x25ee4b,_0x4b6747){VoiceQueueReportEvents[_0x152e('0x6')](_0x24d058+':'+_0x31b16e['id'],_0x31b16e);VoiceQueueReportEvents[_0x152e('0x6')](_0x24d058,_0x31b16e);_0x4b6747(null);};}for(var e in events){if(events[_0x152e('0x7')](e)){var event=events[e];VoiceQueueReport[_0x152e('0x8')](e,emitEvent(event));}}module[_0x152e('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x9114=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x9114,0x1d9));var _0x4911=function(_0x539c59,_0x1aaba3){_0x539c59=_0x539c59-0x0;var _0x5c7b63=_0x9114[_0x539c59];return _0x5c7b63;};'use strict';var EventEmitter=require(_0x4911('0x0'));var VoiceQueueReport=require(_0x4911('0x1'))['db'][_0x4911('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x4911('0x3')](0x0);var events={'afterCreate':_0x4911('0x4'),'afterUpdate':_0x4911('0x5'),'afterDestroy':'remove'};function emitEvent(_0x7d5ff5){return function(_0xc9420f,_0x2462b4,_0x5a4968){VoiceQueueReportEvents[_0x4911('0x6')](_0x7d5ff5+':'+_0xc9420f['id'],_0xc9420f);VoiceQueueReportEvents[_0x4911('0x6')](_0x7d5ff5,_0xc9420f);_0x5a4968(null);};}for(var e in events){if(events[_0x4911('0x7')](e)){var event=events[e];VoiceQueueReport[_0x4911('0x8')](e,emitEvent(event));}}module[_0x4911('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js
index eb40b12..2afbb4d 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.model.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf79d=['./voiceQueueReport.attributes','exports','VoiceQueueReport','uniqueid','calleridnum','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x59ba26,_0xe68a46){var _0x2e731a=function(_0x4e2b39){while(--_0x4e2b39){_0x59ba26['push'](_0x59ba26['shift']());}};_0x2e731a(++_0xe68a46);}(_0xf79d,0x1e6));var _0xdf79=function(_0xfcdeaf,_0x411ae8){_0xfcdeaf=_0xfcdeaf-0x0;var _0x19b8b0=_0xf79d[_0xfcdeaf];return _0x19b8b0;};'use strict';var _=require('lodash');var util=require(_0xdf79('0x0'));var logger=require(_0xdf79('0x1'))(_0xdf79('0x2'));var moment=require('moment');var BPromise=require(_0xdf79('0x3'));var rp=require(_0xdf79('0x4'));var fs=require('fs');var path=require(_0xdf79('0x5'));var rimraf=require(_0xdf79('0x6'));var config=require(_0xdf79('0x7'));var attributes=require(_0xdf79('0x8'));module[_0xdf79('0x9')]=function(_0x5e8c27,_0x1abaf3){return _0x5e8c27['define'](_0xdf79('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xdf79('0xb')]},{'fields':[_0xdf79('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2fcb=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','VoiceQueueReport','report_queue','uniqueid'];(function(_0x5031b2,_0x188a59){var _0x600dae=function(_0x3b2c56){while(--_0x3b2c56){_0x5031b2['push'](_0x5031b2['shift']());}};_0x600dae(++_0x188a59);}(_0x2fcb,0x176));var _0xb2fc=function(_0xc55430,_0x5a935e){_0xc55430=_0xc55430-0x0;var _0x34060c=_0x2fcb[_0xc55430];return _0x34060c;};'use strict';var _=require(_0xb2fc('0x0'));var util=require(_0xb2fc('0x1'));var logger=require(_0xb2fc('0x2'))(_0xb2fc('0x3'));var moment=require(_0xb2fc('0x4'));var BPromise=require(_0xb2fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2fc('0x6'));var rimraf=require(_0xb2fc('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x49ad5f,_0x53095f){return _0x49ad5f['define'](_0xb2fc('0x8'),attributes,{'tableName':_0xb2fc('0x9'),'paranoid':![],'indexes':[{'fields':[_0xb2fc('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js
index 7bc94f2..f47f2e4 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.rpc.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a1f=['UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateVoiceQueueReport','VoiceQueueReport','create','body'];(function(_0xc99259,_0x1fd7ab){var _0x4339b5=function(_0x2b4187){while(--_0x2b4187){_0xc99259['push'](_0xc99259['shift']());}};_0x4339b5(++_0x1fd7ab);}(_0x4a1f,0x1e5));var _0xf4a1=function(_0x40a0a4,_0x4269e1){_0x40a0a4=_0x40a0a4-0x0;var _0x115c37=_0x4a1f[_0x40a0a4];return _0x115c37;};'use strict';var _=require(_0xf4a1('0x0'));var util=require(_0xf4a1('0x1'));var moment=require(_0xf4a1('0x2'));var BPromise=require('bluebird');var rs=require(_0xf4a1('0x3'));var fs=require('fs');var Redis=require(_0xf4a1('0x4'));var db=require(_0xf4a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4a1('0x6'))(_0xf4a1('0x7'));var config=require(_0xf4a1('0x8'));var jayson=require(_0xf4a1('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xf4a1('0xa')]=_[_0xf4a1('0xb')](config[_0xf4a1('0xa')],{'host':_0xf4a1('0xc'),'port':0x18eb});var socket=require(_0xf4a1('0xd'))(new Redis(config[_0xf4a1('0xa')]));require(_0xf4a1('0xe'))[_0xf4a1('0xf')](socket);function respondWithRpcPromise(_0x53c716,_0x4bfe3c,_0x4ef4fc){return new BPromise(function(_0x2c664b,_0x8e1255){return client[_0xf4a1('0x10')](_0x53c716,_0x4ef4fc)[_0xf4a1('0x11')](function(_0x284451){logger['info'](_0xf4a1('0x12'),_0x4bfe3c,_0xf4a1('0x13'));logger[_0xf4a1('0x14')](_0xf4a1('0x15'),_0x4bfe3c,'request\x20sent',JSON[_0xf4a1('0x16')](_0x284451));if(_0x284451['error']){if(_0x284451[_0xf4a1('0x17')][_0xf4a1('0x18')]===0x1f4){logger[_0xf4a1('0x17')](_0xf4a1('0x12'),_0x4bfe3c,_0x284451['error'][_0xf4a1('0x19')]);return _0x8e1255(_0x284451[_0xf4a1('0x17')][_0xf4a1('0x19')]);}logger['error'](_0xf4a1('0x12'),_0x4bfe3c,_0x284451[_0xf4a1('0x17')][_0xf4a1('0x19')]);return _0x2c664b(_0x284451[_0xf4a1('0x17')]['message']);}else{logger[_0xf4a1('0x1a')](_0xf4a1('0x12'),_0x4bfe3c,_0xf4a1('0x13'));_0x2c664b(_0x284451[_0xf4a1('0x1b')]['message']);}})[_0xf4a1('0x1c')](function(_0x553bdf){logger[_0xf4a1('0x17')](_0xf4a1('0x12'),_0x4bfe3c,_0x553bdf);_0x8e1255(_0x553bdf);});});}exports[_0xf4a1('0x1d')]=function(_0x1a2d77){var _0x172473=this;return new Promise(function(_0x5ccf45,_0x48f3e6){return db['VoiceQueueReport'][_0xf4a1('0x1e')]({'raw':_0x1a2d77['options']?_0x1a2d77[_0xf4a1('0x1f')][_0xf4a1('0x20')]===undefined?!![]:![]:!![],'where':_0x1a2d77[_0xf4a1('0x1f')]?_0x1a2d77[_0xf4a1('0x1f')][_0xf4a1('0x21')]||null:null,'attributes':_0x1a2d77[_0xf4a1('0x1f')]?_0x1a2d77[_0xf4a1('0x1f')][_0xf4a1('0x22')]||null:null,'limit':_0x1a2d77[_0xf4a1('0x1f')]?_0x1a2d77[_0xf4a1('0x1f')][_0xf4a1('0x23')]||null:null,'include':_0x1a2d77[_0xf4a1('0x1f')]?_0x1a2d77['options']['include']?_[_0xf4a1('0x24')](_0x1a2d77['options'][_0xf4a1('0x25')],function(_0x21b971){return{'model':db[_0x21b971[_0xf4a1('0x26')]],'as':_0x21b971['as'],'attributes':_0x21b971[_0xf4a1('0x22')],'include':_0x21b971['include']?_[_0xf4a1('0x24')](_0x21b971[_0xf4a1('0x25')],function(_0x1e7069){return{'model':db[_0x1e7069[_0xf4a1('0x26')]],'as':_0x1e7069['as'],'attributes':_0x1e7069[_0xf4a1('0x22')],'include':_0x1e7069['include']?_[_0xf4a1('0x24')](_0x1e7069[_0xf4a1('0x25')],function(_0x4f7d31){return{'model':db[_0x4f7d31[_0xf4a1('0x26')]],'as':_0x4f7d31['as'],'attributes':_0x4f7d31[_0xf4a1('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b1ca2){logger['info'](_0xf4a1('0x1d'),_0x1a2d77);logger[_0xf4a1('0x14')]('GetVoiceQueueReport',_0x1a2d77,JSON['stringify'](_0x3b1ca2));_0x5ccf45(_0x3b1ca2);})[_0xf4a1('0x1c')](function(_0x42fd08){logger[_0xf4a1('0x17')](_0xf4a1('0x1d'),_0x42fd08[_0xf4a1('0x19')],_0x1a2d77);_0x48f3e6(_0x172473[_0xf4a1('0x17')](0x1f4,_0x42fd08[_0xf4a1('0x19')]));});});};exports[_0xf4a1('0x27')]=function(_0x275586){var _0x5491fd=this;return new Promise(function(_0x1d9fe8,_0x8e0a4a){return db[_0xf4a1('0x28')][_0xf4a1('0x29')](_0x275586['body'],{'raw':_0x275586[_0xf4a1('0x1f')]?_0x275586[_0xf4a1('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2bf86b){logger[_0xf4a1('0x1a')](_0xf4a1('0x27'),_0x275586);logger['debug'](_0xf4a1('0x27'),_0x275586,JSON['stringify'](_0x2bf86b));_0x1d9fe8(_0x2bf86b);})[_0xf4a1('0x1c')](function(_0x35c350){logger[_0xf4a1('0x17')](_0xf4a1('0x27'),_0x35c350[_0xf4a1('0x19')],_0x275586);_0x8e0a4a(_0x5491fd['error'](0x1f4,_0x35c350[_0xf4a1('0x19')]));});});};exports['UpdateVoiceQueueReport']=function(_0x2f71aa){var _0xa9bf58=this;return new Promise(function(_0x9c14c3,_0x342929){return db[_0xf4a1('0x28')]['update'](_0x2f71aa[_0xf4a1('0x2a')],{'raw':_0x2f71aa['options']?_0x2f71aa[_0xf4a1('0x1f')][_0xf4a1('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f71aa[_0xf4a1('0x1f')]?_0x2f71aa[_0xf4a1('0x1f')][_0xf4a1('0x21')]||null:null,'attributes':_0x2f71aa[_0xf4a1('0x1f')]?_0x2f71aa['options'][_0xf4a1('0x22')]||null:null,'limit':_0x2f71aa[_0xf4a1('0x1f')]?_0x2f71aa[_0xf4a1('0x1f')]['limit']||null:null})[_0xf4a1('0x11')](function(_0x3228ce){logger[_0xf4a1('0x1a')](_0xf4a1('0x2b'),_0x2f71aa);logger[_0xf4a1('0x14')]('UpdateVoiceQueueReport',_0x2f71aa,JSON[_0xf4a1('0x16')](_0x3228ce));_0x9c14c3(_0x3228ce);})['catch'](function(_0x30fb70){logger[_0xf4a1('0x17')](_0xf4a1('0x2b'),_0x30fb70[_0xf4a1('0x19')],_0x2f71aa);_0x342929(_0xa9bf58[_0xf4a1('0x17')](0x1f4,_0x30fb70[_0xf4a1('0x19')]));});});};
\ No newline at end of file
+var _0x0f64=['body','UpdateVoiceQueueReport','update','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','model','map','CreateVoiceQueueReport','create'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0x0f64,0x143));var _0x40f6=function(_0xd85e0f,_0x585f36){_0xd85e0f=_0xd85e0f-0x0;var _0x46febd=_0x0f64[_0xd85e0f];return _0x46febd;};'use strict';var _=require(_0x40f6('0x0'));var util=require('util');var moment=require(_0x40f6('0x1'));var BPromise=require(_0x40f6('0x2'));var rs=require(_0x40f6('0x3'));var fs=require('fs');var Redis=require(_0x40f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40f6('0x5'));var logger=require(_0x40f6('0x6'))(_0x40f6('0x7'));var config=require('../../config/environment');var jayson=require(_0x40f6('0x8'));var client=jayson['client'][_0x40f6('0x9')]({'port':0x232a});config[_0x40f6('0xa')]=_[_0x40f6('0xb')](config[_0x40f6('0xa')],{'host':_0x40f6('0xc'),'port':0x18eb});var socket=require(_0x40f6('0xd'))(new Redis(config[_0x40f6('0xa')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x5ad309,_0x3c56a7,_0x1c4aa1){return new BPromise(function(_0x46ee2f,_0x552146){return client['request'](_0x5ad309,_0x1c4aa1)[_0x40f6('0xe')](function(_0x1ff81e){logger[_0x40f6('0xf')](_0x40f6('0x10'),_0x3c56a7,_0x40f6('0x11'));logger[_0x40f6('0x12')](_0x40f6('0x13'),_0x3c56a7,_0x40f6('0x11'),JSON['stringify'](_0x1ff81e));if(_0x1ff81e[_0x40f6('0x14')]){if(_0x1ff81e[_0x40f6('0x14')][_0x40f6('0x15')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3c56a7,_0x1ff81e[_0x40f6('0x14')][_0x40f6('0x16')]);return _0x552146(_0x1ff81e[_0x40f6('0x14')][_0x40f6('0x16')]);}logger[_0x40f6('0x14')](_0x40f6('0x10'),_0x3c56a7,_0x1ff81e[_0x40f6('0x14')][_0x40f6('0x16')]);return _0x46ee2f(_0x1ff81e[_0x40f6('0x14')][_0x40f6('0x16')]);}else{logger[_0x40f6('0xf')](_0x40f6('0x10'),_0x3c56a7,'request\x20sent');_0x46ee2f(_0x1ff81e[_0x40f6('0x17')][_0x40f6('0x16')]);}})[_0x40f6('0x18')](function(_0xa23e43){logger[_0x40f6('0x14')](_0x40f6('0x10'),_0x3c56a7,_0xa23e43);_0x552146(_0xa23e43);});});}exports[_0x40f6('0x19')]=function(_0x4d775e){var _0x268c07=this;return new Promise(function(_0x256f91,_0x56fe51){return db[_0x40f6('0x1a')][_0x40f6('0x1b')]({'raw':_0x4d775e['options']?_0x4d775e[_0x40f6('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4d775e[_0x40f6('0x1c')]?_0x4d775e[_0x40f6('0x1c')][_0x40f6('0x1d')]||null:null,'attributes':_0x4d775e[_0x40f6('0x1c')]?_0x4d775e[_0x40f6('0x1c')][_0x40f6('0x1e')]||null:null,'limit':_0x4d775e[_0x40f6('0x1c')]?_0x4d775e[_0x40f6('0x1c')][_0x40f6('0x1f')]||null:null,'include':_0x4d775e[_0x40f6('0x1c')]?_0x4d775e['options'][_0x40f6('0x20')]?_['map'](_0x4d775e[_0x40f6('0x1c')][_0x40f6('0x20')],function(_0x5590b7){return{'model':db[_0x5590b7[_0x40f6('0x21')]],'as':_0x5590b7['as'],'attributes':_0x5590b7[_0x40f6('0x1e')],'include':_0x5590b7['include']?_[_0x40f6('0x22')](_0x5590b7[_0x40f6('0x20')],function(_0x28bc00){return{'model':db[_0x28bc00[_0x40f6('0x21')]],'as':_0x28bc00['as'],'attributes':_0x28bc00[_0x40f6('0x1e')],'include':_0x28bc00[_0x40f6('0x20')]?_[_0x40f6('0x22')](_0x28bc00[_0x40f6('0x20')],function(_0x50d567){return{'model':db[_0x50d567['model']],'as':_0x50d567['as'],'attributes':_0x50d567[_0x40f6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x40f6('0xe')](function(_0x1e707a){logger[_0x40f6('0xf')]('GetVoiceQueueReport',_0x4d775e);logger[_0x40f6('0x12')](_0x40f6('0x19'),_0x4d775e,JSON['stringify'](_0x1e707a));_0x256f91(_0x1e707a);})[_0x40f6('0x18')](function(_0x17d93b){logger[_0x40f6('0x14')]('GetVoiceQueueReport',_0x17d93b['message'],_0x4d775e);_0x56fe51(_0x268c07[_0x40f6('0x14')](0x1f4,_0x17d93b['message']));});});};exports[_0x40f6('0x23')]=function(_0x4aa83e){var _0x3629fb=this;return new Promise(function(_0x397558,_0x1f7608){return db[_0x40f6('0x1a')][_0x40f6('0x24')](_0x4aa83e[_0x40f6('0x25')],{'raw':_0x4aa83e[_0x40f6('0x1c')]?_0x4aa83e[_0x40f6('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x40f6('0xe')](function(_0x477216){logger[_0x40f6('0xf')]('CreateVoiceQueueReport',_0x4aa83e);logger['debug'](_0x40f6('0x23'),_0x4aa83e,JSON['stringify'](_0x477216));_0x397558(_0x477216);})[_0x40f6('0x18')](function(_0x3bf718){logger['error'](_0x40f6('0x23'),_0x3bf718['message'],_0x4aa83e);_0x1f7608(_0x3629fb[_0x40f6('0x14')](0x1f4,_0x3bf718[_0x40f6('0x16')]));});});};exports[_0x40f6('0x26')]=function(_0x2c2f51){var _0x4caffd=this;return new Promise(function(_0x5f361d,_0xa1c3e3){return db['VoiceQueueReport'][_0x40f6('0x27')](_0x2c2f51[_0x40f6('0x25')],{'raw':_0x2c2f51[_0x40f6('0x1c')]?_0x2c2f51['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c2f51['options']?_0x2c2f51['options'][_0x40f6('0x1d')]||null:null,'attributes':_0x2c2f51[_0x40f6('0x1c')]?_0x2c2f51[_0x40f6('0x1c')][_0x40f6('0x1e')]||null:null,'limit':_0x2c2f51['options']?_0x2c2f51[_0x40f6('0x1c')][_0x40f6('0x1f')]||null:null})[_0x40f6('0xe')](function(_0x1fe5f0){logger[_0x40f6('0xf')](_0x40f6('0x26'),_0x2c2f51);logger[_0x40f6('0x12')](_0x40f6('0x26'),_0x2c2f51,JSON['stringify'](_0x1fe5f0));_0x5f361d(_0x1fe5f0);})[_0x40f6('0x18')](function(_0x38056b){logger[_0x40f6('0x14')](_0x40f6('0x26'),_0x38056b[_0x40f6('0x16')],_0x2c2f51);_0xa1c3e3(_0x4caffd['error'](0x1f4,_0x38056b['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js
index d054d04..fad5ce5 100644
--- a/server/api/voiceQueueReport/voiceQueueReport.socket.js
+++ b/server/api/voiceQueueReport/voiceQueueReport.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe40=['remove','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x351e57,_0x6f6f4b){var _0x3698a5=function(_0x39ca2b){while(--_0x39ca2b){_0x351e57['push'](_0x351e57['shift']());}};_0x3698a5(++_0x6f6f4b);}(_0xbe40,0x96));var _0x0be4=function(_0x4bddde,_0x4fa378){_0x4bddde=_0x4bddde-0x0;var _0x18b46d=_0xbe40[_0x4bddde];return _0x18b46d;};'use strict';var VoiceQueueReportEvents=require(_0x0be4('0x0'));var events=[_0x0be4('0x1'),_0x0be4('0x2'),'update'];function createListener(_0x3c6792,_0x4d5099){return function(_0x267188){_0x4d5099[_0x0be4('0x3')](_0x3c6792,_0x267188);};}function removeListener(_0x4772c5,_0xaf2e08){return function(){VoiceQueueReportEvents[_0x0be4('0x4')](_0x4772c5,_0xaf2e08);};}exports[_0x0be4('0x5')]=function(_0x38fb11){for(var _0x419cfb=0x0,_0x49aab9=events[_0x0be4('0x6')];_0x419cfb<_0x49aab9;_0x419cfb++){var _0x12c5a8=events[_0x419cfb];var _0x329d4e=createListener(_0x0be4('0x7')+_0x12c5a8,_0x38fb11);VoiceQueueReportEvents['on'](_0x12c5a8,_0x329d4e);}};
\ No newline at end of file
+var _0x935f=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener','register'];(function(_0x265a6c,_0x2c5c75){var _0x1708fb=function(_0x561aed){while(--_0x561aed){_0x265a6c['push'](_0x265a6c['shift']());}};_0x1708fb(++_0x2c5c75);}(_0x935f,0x1b2));var _0xf935=function(_0x400078,_0x5b3c29){_0x400078=_0x400078-0x0;var _0x316193=_0x935f[_0x400078];return _0x316193;};'use strict';var VoiceQueueReportEvents=require(_0xf935('0x0'));var events=[_0xf935('0x1'),_0xf935('0x2'),_0xf935('0x3')];function createListener(_0x4e9b02,_0x53c1c3){return function(_0x1e538e){_0x53c1c3[_0xf935('0x4')](_0x4e9b02,_0x1e538e);};}function removeListener(_0x111543,_0x206b3e){return function(){VoiceQueueReportEvents[_0xf935('0x5')](_0x111543,_0x206b3e);};}exports[_0xf935('0x6')]=function(_0x4d7704){for(var _0x23c688=0x0,_0xda73c7=events[_0xf935('0x7')];_0x23c688<_0xda73c7;_0x23c688++){var _0x48090e=events[_0x23c688];var _0x5b6c91=createListener(_0xf935('0x8')+_0x48090e,_0x4d7704);VoiceQueueReportEvents['on'](_0x48090e,_0x5b6c91);}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js
index cd9974a..0efd417 100644
--- a/server/api/voiceQueuesLog/index.js
+++ b/server/api/voiceQueuesLog/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x02ac=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer'];(function(_0xde2ad9,_0x450285){var _0x3760be=function(_0x12c274){while(--_0x12c274){_0xde2ad9['push'](_0xde2ad9['shift']());}};_0x3760be(++_0x450285);}(_0x02ac,0x1ed));var _0xc02a=function(_0x5b36f2,_0x194e22){_0x5b36f2=_0x5b36f2-0x0;var _0x3de420=_0x02ac[_0x5b36f2];return _0x3de420;};'use strict';var multer=require(_0xc02a('0x0'));var util=require('util');var path=require(_0xc02a('0x1'));var timeout=require(_0xc02a('0x2'));var express=require(_0xc02a('0x3'));var router=express[_0xc02a('0x4')]();var auth=require(_0xc02a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc02a('0x6'));var controller=require(_0xc02a('0x7'));router[_0xc02a('0x8')]('/',auth['isAuthenticated'](),controller[_0xc02a('0x9')]);router[_0xc02a('0x8')](_0xc02a('0xa'),auth[_0xc02a('0xb')](),controller[_0xc02a('0xc')]);router[_0xc02a('0xd')]('/',auth['isAuthenticated'](),controller[_0xc02a('0xe')]);router[_0xc02a('0xf')](_0xc02a('0xa'),auth[_0xc02a('0xb')](),controller[_0xc02a('0x10')]);router[_0xc02a('0x11')](_0xc02a('0xa'),auth[_0xc02a('0xb')](),controller['destroy']);module[_0xc02a('0x12')]=router;
\ No newline at end of file
+var _0x5a89=['/:id','show','post','put','update','delete','destroy','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x22a8f1,_0x1fa85a){var _0x8d2b82=function(_0x3f56bd){while(--_0x3f56bd){_0x22a8f1['push'](_0x22a8f1['shift']());}};_0x8d2b82(++_0x1fa85a);}(_0x5a89,0x18d));var _0x95a8=function(_0x8b2a0d,_0xa1665a){_0x8b2a0d=_0x8b2a0d-0x0;var _0x5ba21b=_0x5a89[_0x8b2a0d];return _0x5ba21b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x95a8('0x0'));var express=require(_0x95a8('0x1'));var router=express[_0x95a8('0x2')]();var auth=require(_0x95a8('0x3'));var interaction=require(_0x95a8('0x4'));var config=require(_0x95a8('0x5'));var controller=require('./voiceQueuesLog.controller');router[_0x95a8('0x6')]('/',auth[_0x95a8('0x7')](),controller['index']);router[_0x95a8('0x6')](_0x95a8('0x8'),auth['isAuthenticated'](),controller[_0x95a8('0x9')]);router[_0x95a8('0xa')]('/',auth[_0x95a8('0x7')](),controller['create']);router[_0x95a8('0xb')]('/:id',auth[_0x95a8('0x7')](),controller[_0x95a8('0xc')]);router[_0x95a8('0xd')](_0x95a8('0x8'),auth[_0x95a8('0x7')](),controller[_0x95a8('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
index ee33ffd..69dc95b 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f32=['format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING'];(function(_0x5d9ceb,_0x1a49f5){var _0x33ce82=function(_0x583915){while(--_0x583915){_0x5d9ceb['push'](_0x5d9ceb['shift']());}};_0x33ce82(++_0x1a49f5);}(_0x2f32,0xe3));var _0x22f3=function(_0x53010e,_0x5ef6ed){_0x53010e=_0x53010e-0x0;var _0x10b322=_0x2f32[_0x53010e];return _0x10b322;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x22f3('0x0'));module[_0x22f3('0x1')]={'time':{'type':Sequelize[_0x22f3('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x22f3('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x22f3('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x22f3('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x22f3('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x22f3('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x22f3('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x22f3('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x22f3('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x22f3('0x3')](_0x22f3('0x4'))}};
\ No newline at end of file
+var _0xac4a=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0xed2305,_0x35bae4){var _0x5ec077=function(_0xa30e87){while(--_0xa30e87){_0xed2305['push'](_0xed2305['shift']());}};_0x5ec077(++_0x35bae4);}(_0xac4a,0xff));var _0xaac4=function(_0x49d0de,_0x257de7){_0x49d0de=_0x49d0de-0x0;var _0x4fcbeb=_0xac4a[_0x49d0de];return _0x4fcbeb;};'use strict';var Sequelize=require(_0xaac4('0x0'));var moment=require(_0xaac4('0x1'));module[_0xaac4('0x2')]={'time':{'type':Sequelize[_0xaac4('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xaac4('0x4')],'allowNull':![],'defaultValue':moment()[_0xaac4('0x5')](_0xaac4('0x6'))}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
index 7cf3518..d95dc83 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['where','merge','VoiceQueuesLog','include','rows','catch','show','params','includeAll','options','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x55d97b,_0xb3cac0){var _0x4d4ce1=function(_0x2a3297){while(--_0x2a3297){_0x55d97b['push'](_0x55d97b['shift']());}};_0x4d4ce1(++_0xb3cac0);}(_0xb10b,0x12a));var _0xbb10=function(_0x2199f1,_0x10c734){_0x2199f1=_0x2199f1-0x0;var _0x43436b=_0xb10b[_0x2199f1];return _0x43436b;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['VoiceQueuesLog'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]),_0x20d946);if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));};exports[_0xbb10('0x3f')]=function(_0x5f3d67,_0x1e8f79){var _0x1c7fae={'raw':!![],'where':{'id':_0x5f3d67[_0xbb10('0x40')]['id']}},_0x3e7b4c={};_0x3e7b4c['model']=_[_0xbb10('0x2d')](db[_0xbb10('0x3b')][_0xbb10('0x28')]);_0x3e7b4c[_0xbb10('0x30')]=_['keys'](_0x5f3d67[_0xbb10('0x30')]);_0x3e7b4c[_0xbb10('0x2e')]=_['intersection'](_0x3e7b4c['model'],_0x3e7b4c[_0xbb10('0x30')]);_0x1c7fae['attributes']=_[_0xbb10('0x2f')](_0x3e7b4c[_0xbb10('0x2c')],qs['fields'](_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x31')]));_0x1c7fae[_0xbb10('0x32')]=_0x1c7fae['attributes'][_0xbb10('0x33')]?_0x1c7fae[_0xbb10('0x32')]:_0x3e7b4c[_0xbb10('0x2c')];if(_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x41')]){_0x1c7fae[_0xbb10('0x3c')]=[{'all':!![]}];}_0x1c7fae=_[_0xbb10('0x3a')]({},_0x1c7fae,_0x5f3d67[_0xbb10('0x42')]);return db[_0xbb10('0x3b')][_0xbb10('0x43')](_0x1c7fae)[_0xbb10('0x23')](handleEntityNotFound(_0x1e8f79,null))[_0xbb10('0x23')](respondWithResult(_0x1e8f79,null))['catch'](handleError(_0x1e8f79,null));};exports[_0xbb10('0x44')]=function(_0x41bbf8,_0x4a1248){return db[_0xbb10('0x3b')][_0xbb10('0x44')](_0x41bbf8[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x4a1248,0xc9))[_0xbb10('0x3e')](handleError(_0x4a1248,null));};exports[_0xbb10('0x46')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x3e')](handleError(_0x5be85e,null));};exports[_0xbb10('0x24')]=function(_0x22b315,_0x2f2552){return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x22b315[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f2552,null))['then'](removeEntity(_0x2f2552,null))[_0xbb10('0x3e')](handleError(_0x2f2552,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x2ea183,_0x3cff11){var _0x47c16c=function(_0x3d91e5){while(--_0x3d91e5){_0x2ea183['push'](_0x2ea183['shift']());}};_0x47c16c(++_0x3cff11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js
index 0f078dc..4f8fbd0 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.model.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x81c6=['../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event','dtm','util','bluebird','request-promise','path'];(function(_0x592d58,_0xf0c3da){var _0x4ac596=function(_0x4d0732){while(--_0x4d0732){_0x592d58['push'](_0x592d58['shift']());}};_0x4ac596(++_0xf0c3da);}(_0x81c6,0x1d5));var _0x681c=function(_0x25c398,_0x13284b){_0x25c398=_0x25c398-0x0;var _0x3311bc=_0x81c6[_0x25c398];return _0x3311bc;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x681c('0x9'),_0x681c('0xa')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xe2fe=['event_dtm','dtm','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./voiceQueuesLog.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xee2f('0xa'),'fields':['event',_0xee2f('0xb')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
index 18f6e10..ccb7227 100644
--- a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
+++ b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd7a0=['message','VoiceQueuesLog,\x20%s,\x20%s','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xd7a0,0x163));var _0x0d7a=function(_0xe0033b,_0x5114bc){_0xe0033b=_0xe0033b-0x0;var _0x1b42d1=_0xd7a0[_0xe0033b];return _0x1b42d1;};'use strict';var _=require(_0x0d7a('0x0'));var util=require(_0x0d7a('0x1'));var moment=require('moment');var BPromise=require(_0x0d7a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d7a('0x3'));var db=require(_0x0d7a('0x4'))['db'];var utils=require(_0x0d7a('0x5'));var logger=require(_0x0d7a('0x6'))(_0x0d7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d7a('0x8'));var client=jayson[_0x0d7a('0x9')][_0x0d7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16461e,_0x22b404,_0x371b7d){return new BPromise(function(_0x1514ae,_0x55d585){return client[_0x0d7a('0xb')](_0x16461e,_0x371b7d)[_0x0d7a('0xc')](function(_0x450d42){logger[_0x0d7a('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x22b404,_0x0d7a('0xe'));logger[_0x0d7a('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x22b404,_0x0d7a('0xe'),JSON[_0x0d7a('0x10')](_0x450d42));if(_0x450d42[_0x0d7a('0x11')]){if(_0x450d42[_0x0d7a('0x11')][_0x0d7a('0x12')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x22b404,_0x450d42[_0x0d7a('0x11')][_0x0d7a('0x13')]);return _0x55d585(_0x450d42[_0x0d7a('0x11')]['message']);}logger[_0x0d7a('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x22b404,_0x450d42['error'][_0x0d7a('0x13')]);return _0x1514ae(_0x450d42['error'][_0x0d7a('0x13')]);}else{logger[_0x0d7a('0xd')](_0x0d7a('0x14'),_0x22b404,_0x0d7a('0xe'));_0x1514ae(_0x450d42['result'][_0x0d7a('0x13')]);}})[_0x0d7a('0x15')](function(_0x497cbb){logger[_0x0d7a('0x11')](_0x0d7a('0x14'),_0x22b404,_0x497cbb);_0x55d585(_0x497cbb);});});}
\ No newline at end of file
+var _0x8d05=['result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0xca2c30,_0x2e91b5){var _0x13efb=function(_0x1e890b){while(--_0x1e890b){_0xca2c30['push'](_0xca2c30['shift']());}};_0x13efb(++_0x2e91b5);}(_0x8d05,0xe8));var _0x58d0=function(_0x39f6ef,_0x17cf66){_0x39f6ef=_0x39f6ef-0x0;var _0x924907=_0x8d05[_0x39f6ef];return _0x924907;};'use strict';var _=require(_0x58d0('0x0'));var util=require(_0x58d0('0x1'));var moment=require(_0x58d0('0x2'));var BPromise=require(_0x58d0('0x3'));var rs=require(_0x58d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x58d0('0x5'));var logger=require(_0x58d0('0x6'))(_0x58d0('0x7'));var config=require(_0x58d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x58d0('0x9')][_0x58d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528303,_0x66aef1,_0x4e44e2){return new BPromise(function(_0xe744f4,_0x34ab60){return client[_0x58d0('0xb')](_0x528303,_0x4e44e2)[_0x58d0('0xc')](function(_0x1d070a){logger['info'](_0x58d0('0xd'),_0x66aef1,_0x58d0('0xe'));logger['debug'](_0x58d0('0xf'),_0x66aef1,_0x58d0('0xe'),JSON['stringify'](_0x1d070a));if(_0x1d070a['error']){if(_0x1d070a[_0x58d0('0x10')][_0x58d0('0x11')]===0x1f4){logger[_0x58d0('0x10')](_0x58d0('0xd'),_0x66aef1,_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);return _0x34ab60(_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);}logger[_0x58d0('0x10')](_0x58d0('0xd'),_0x66aef1,_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);return _0xe744f4(_0x1d070a[_0x58d0('0x10')][_0x58d0('0x12')]);}else{logger[_0x58d0('0x13')](_0x58d0('0xd'),_0x66aef1,_0x58d0('0xe'));_0xe744f4(_0x1d070a[_0x58d0('0x14')][_0x58d0('0x12')]);}})['catch'](function(_0x10874e){logger[_0x58d0('0x10')](_0x58d0('0xd'),_0x66aef1,_0x10874e);_0x34ab60(_0x10874e);});});}
\ No newline at end of file
diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js
index c79b6a0..6aee9a5 100644
--- a/server/api/voiceRecording/index.js
+++ b/server/api/voiceRecording/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x2c95ce,_0x11032){var _0x5c8041=function(_0x174db4){while(--_0x174db4){_0x2c95ce['push'](_0x2c95ce['shift']());}};_0x5c8041(++_0x11032);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x440c00,_0x2f18ba){var _0x33c90f=function(_0x2db196){while(--_0x2db196){_0x440c00['push'](_0x440c00['shift']());}};_0x33c90f(++_0x2f18ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js
index 1bcfeae..b64ff34 100644
--- a/server/api/voiceRecording/voiceRecording.attributes.js
+++ b/server/api/voiceRecording/voiceRecording.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca1c=['extname','STRING','setDataValue','channel','membername','split','NEW','TEXT','FLOAT','BOOLEAN','DATE','format','MM-DD-YYYY\x20HH:mm','toString','moment','path','getDataValue','value'];(function(_0xd584dd,_0x1bb3ed){var _0x41c667=function(_0x10ef17){while(--_0x10ef17){_0xd584dd['push'](_0xd584dd['shift']());}};_0x41c667(++_0x1bb3ed);}(_0xca1c,0x1be));var _0xcca1=function(_0x243c54,_0x520f37){_0x243c54=_0x243c54-0x0;var _0xcd69fc=_0xca1c[_0x243c54];return _0xcd69fc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcca1('0x0'));var path=require(_0xcca1('0x1'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xcca1('0x2')](_0xcca1('0x3'))?path[_0xcca1('0x4')](this[_0xcca1('0x2')](_0xcca1('0x3'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xcca1('0x5')],'set':function(_0x7a350b){if(_0x7a350b){this[_0xcca1('0x6')](_0xcca1('0x7'),_0x7a350b);this[_0xcca1('0x6')](_0xcca1('0x8'),_0x7a350b[_0xcca1('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xcca1('0x5')]},'calleridnum':{'type':Sequelize[_0xcca1('0x5')]},'calleridname':{'type':Sequelize[_0xcca1('0x5')]},'connectedlinenum':{'type':Sequelize[_0xcca1('0x5')]},'connectedlinename':{'type':Sequelize[_0xcca1('0x5')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xcca1('0x5')]},'exten':{'type':Sequelize[_0xcca1('0x5')]},'value':{'type':Sequelize[_0xcca1('0x5')]},'type':{'type':Sequelize[_0xcca1('0x5')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xcca1('0x5')]},'userDisposition':{'type':Sequelize[_0xcca1('0x5')]},'location':{'type':Sequelize['TEXT']},'transcribeName':{'type':Sequelize[_0xcca1('0x5')]},'transcribeStatus':{'type':Sequelize[_0xcca1('0x5')],'defaultValue':_0xcca1('0xa')},'fileUri':{'type':Sequelize[_0xcca1('0xb')]},'fileText':{'type':Sequelize[_0xcca1('0xb')]},'failureReason':{'type':Sequelize[_0xcca1('0xb')]},'sentiment':{'type':Sequelize[_0xcca1('0x5')]},'sPositive':{'type':Sequelize[_0xcca1('0xc')]},'sNegative':{'type':Sequelize[_0xcca1('0xc')]},'sNeutral':{'type':Sequelize[_0xcca1('0xc')]},'sMixed':{'type':Sequelize[_0xcca1('0xc')]},'tempSentiment':{'type':Sequelize[_0xcca1('0xd')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0xcca1('0xe')],'get':function(){return moment(this[_0xcca1('0x2')]('createdAt'))[_0xcca1('0xf')](_0xcca1('0x10'))[_0xcca1('0x11')]();}},'updatedAt':{'type':Sequelize[_0xcca1('0xe')],'get':function(){return moment(this[_0xcca1('0x2')]('updatedAt'))[_0xcca1('0xf')](_0xcca1('0x10'))[_0xcca1('0x11')]();}}};
\ No newline at end of file
+var _0x81df=['sequelize','path','exports','getDataValue','extname','STRING','setDataValue','membername','split','TEXT','FLOAT','BOOLEAN','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt'];(function(_0x1d82d9,_0x15bcc5){var _0xea42bf=function(_0x48fda5){while(--_0x48fda5){_0x1d82d9['push'](_0x1d82d9['shift']());}};_0xea42bf(++_0x15bcc5);}(_0x81df,0x90));var _0xf81d=function(_0x162b1a,_0x33ab71){_0x162b1a=_0x162b1a-0x0;var _0x53808f=_0x81df[_0x162b1a];return _0x53808f;};'use strict';var Sequelize=require(_0xf81d('0x0'));var moment=require('moment');var path=require(_0xf81d('0x1'));module[_0xf81d('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf81d('0x3')]('value')?path[_0xf81d('0x4')](this[_0xf81d('0x3')]('value')):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf81d('0x5')],'set':function(_0x5d1a48){if(_0x5d1a48){this[_0xf81d('0x6')]('channel',_0x5d1a48);this['setDataValue'](_0xf81d('0x7'),_0x5d1a48[_0xf81d('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xf81d('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf81d('0x5')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xf81d('0x5')]},'type':{'type':Sequelize[_0xf81d('0x5')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xf81d('0x5')]},'userDisposition':{'type':Sequelize['STRING']},'location':{'type':Sequelize[_0xf81d('0x9')]},'transcribeName':{'type':Sequelize[_0xf81d('0x5')]},'transcribeStatus':{'type':Sequelize[_0xf81d('0x5')],'defaultValue':'NEW'},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize['TEXT']},'failureReason':{'type':Sequelize['TEXT']},'sentiment':{'type':Sequelize[_0xf81d('0x5')]},'sPositive':{'type':Sequelize[_0xf81d('0xa')]},'sNegative':{'type':Sequelize['FLOAT']},'sNeutral':{'type':Sequelize['FLOAT']},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0xf81d('0xb')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0xf81d('0xc')],'get':function(){return moment(this['getDataValue'](_0xf81d('0xd')))[_0xf81d('0xe')](_0xf81d('0xf'))[_0xf81d('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xf81d('0x3')](_0xf81d('0x11')))[_0xf81d('0xe')](_0xf81d('0xf'))['toString']();}}};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js
index e4640dc..ed9f232 100644
--- a/server/api/voiceRecording/voiceRecording.controller.js
+++ b/server/api/voiceRecording/voiceRecording.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0fa7=['reject','save','update','then','destroy','sendStatus','error','send','index','map','VoiceRecording','rawAttributes','fieldName','model','differenceBy','name','format','query','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','keys','find','create','body','params','describe','download','uniqueid','value','%s.cypher','existsSync','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','token','push','$and','decryptFile','secrets','Sequelize','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','apply'];(function(_0x4a8f67,_0x4f59a6){var _0x371d22=function(_0x49ab24){while(--_0x49ab24){_0x4a8f67['push'](_0x4a8f67['shift']());}};_0x371d22(++_0x4f59a6);}(_0x0fa7,0x1b3));var _0x70fa=function(_0x3ea46d,_0x56e75f){_0x3ea46d=_0x3ea46d-0x0;var _0x49f9c8=_0x0fa7[_0x3ea46d];return _0x49f9c8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x70fa('0x0'));var rimraf=require(_0x70fa('0x1'));var zipdir=require(_0x70fa('0x2'));var jsonpatch=require(_0x70fa('0x3'));var rp=require(_0x70fa('0x4'));var moment=require('moment');var BPromise=require(_0x70fa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x70fa('0x6'));var sox=require(_0x70fa('0x7'));var csv=require('to-csv');var ejs=require(_0x70fa('0x8'));var fs=require('fs');var _=require(_0x70fa('0x9'));var squel=require(_0x70fa('0xa'));var crypto=require(_0x70fa('0xb'));var jsforce=require(_0x70fa('0xc'));var deskjs=require(_0x70fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x70fa('0xe'));var Papa=require(_0x70fa('0xf'));var AWS=require(_0x70fa('0x10'));var uuidv4=require(_0x70fa('0x11'));var Redis=require(_0x70fa('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x70fa('0x13'));var as=require(_0x70fa('0x14'));var hardwareService=require(_0x70fa('0x15'));var logger=require(_0x70fa('0x16'))('api');var utils=require(_0x70fa('0x17'));var config=require(_0x70fa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a19d7,_0x35eb69){_0x35eb69=_0x35eb69||0xcc;return function(_0x42c003){if(_0x42c003){return _0x4a19d7['sendStatus'](_0x35eb69);}return _0x4a19d7[_0x70fa('0x19')](_0x35eb69)[_0x70fa('0x1a')]();};}function respondWithResult(_0x52c631,_0x14324a){_0x14324a=_0x14324a||0xc8;return function(_0x15bbb7){if(_0x15bbb7){return _0x52c631[_0x70fa('0x19')](_0x14324a)[_0x70fa('0x1b')](_0x15bbb7);}};}function respondWithFilteredResult(_0x18e323,_0x4861d2){return function(_0x178aa8){if(_0x178aa8){var _0x50a183=_0x178aa8[_0x70fa('0x1c')],_0x4b9cfb=_0x4861d2['offset'],_0x55d02a=_0x4861d2[_0x70fa('0x1d')]+_0x4861d2[_0x70fa('0x1e')],_0x263912;if(_0x55d02a>=_0x50a183){_0x55d02a=_0x50a183;_0x263912=0xc8;}else{_0x263912=0xce;}_0x18e323[_0x70fa('0x19')](_0x263912);return _0x18e323[_0x70fa('0x1f')]('Content-Range',_0x4b9cfb+'-'+_0x55d02a+'/'+_0x50a183)[_0x70fa('0x1b')](_0x178aa8);}return null;};}function patchUpdates(_0x59a90e){return function(_0x37d8ee){try{jsonpatch[_0x70fa('0x20')](_0x37d8ee,_0x59a90e,!![]);}catch(_0x3e2ba5){return BPromise[_0x70fa('0x21')](_0x3e2ba5);}return _0x37d8ee[_0x70fa('0x22')]();};}function saveUpdates(_0x266242,_0x209796){return function(_0xe8b514){if(_0xe8b514){return _0xe8b514[_0x70fa('0x23')](_0x266242)[_0x70fa('0x24')](function(_0x4d3fd6){return _0x4d3fd6;});}return null;};}function removeEntity(_0xc7a899,_0x562162){return function(_0x5e7597){if(_0x5e7597){return _0x5e7597[_0x70fa('0x25')]()[_0x70fa('0x24')](function(){_0xc7a899[_0x70fa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5533d6,_0x59ae87){return function(_0xcf032a){if(!_0xcf032a){_0x5533d6[_0x70fa('0x26')](0x194);}return _0xcf032a;};}function handleError(_0x128992,_0x32170c){_0x32170c=_0x32170c||0x1f4;return function(_0x4ee88d){logger[_0x70fa('0x27')](_0x4ee88d['stack']);if(_0x4ee88d['name']){delete _0x4ee88d['name'];}_0x128992[_0x70fa('0x19')](_0x32170c)[_0x70fa('0x28')](_0x4ee88d);};}exports[_0x70fa('0x29')]=function(_0x19dfdd,_0x423ee6){var _0x3032f3={},_0x3a17f0={},_0x52cb96={'count':0x0,'rows':[]};var _0x3b651c=_[_0x70fa('0x2a')](db[_0x70fa('0x2b')][_0x70fa('0x2c')],function(_0x4a3c32){return{'name':_0x4a3c32[_0x70fa('0x2d')],'type':_0x4a3c32['type']['key']};});_0x3a17f0[_0x70fa('0x2e')]=_[_0x70fa('0x2f')](_[_0x70fa('0x2a')](_0x3b651c,_0x70fa('0x30')),[_0x70fa('0x31')]);_0x3a17f0[_0x70fa('0x32')]=_['keys'](_0x19dfdd[_0x70fa('0x32')]);_0x3a17f0[_0x70fa('0x33')]=_['intersection'](_0x3a17f0[_0x70fa('0x2e')],_0x3a17f0[_0x70fa('0x32')]);_0x3032f3[_0x70fa('0x34')]=_[_0x70fa('0x35')](_0x3a17f0['model'],qs[_0x70fa('0x36')](_0x19dfdd[_0x70fa('0x32')][_0x70fa('0x36')]));_0x3032f3[_0x70fa('0x34')]=_0x3032f3[_0x70fa('0x34')][_0x70fa('0x37')]?_0x3032f3['attributes']:_0x3a17f0[_0x70fa('0x2e')];if(!_0x19dfdd['query']['hasOwnProperty']('nolimit')){_0x3032f3['limit']=qs['limit'](_0x19dfdd[_0x70fa('0x32')]['limit']);_0x3032f3[_0x70fa('0x1d')]=qs[_0x70fa('0x1d')](_0x19dfdd[_0x70fa('0x32')][_0x70fa('0x1d')]);}_0x3032f3['order']=qs[_0x70fa('0x38')](_0x19dfdd[_0x70fa('0x32')]['sort']);_0x3032f3[_0x70fa('0x39')]=qs[_0x70fa('0x33')](_[_0x70fa('0x3a')](_0x19dfdd[_0x70fa('0x32')],_0x3a17f0[_0x70fa('0x33')]),_0x3b651c);if(_0x19dfdd[_0x70fa('0x32')][_0x70fa('0x3b')]){_0x3032f3[_0x70fa('0x39')]=_[_0x70fa('0x3c')](_0x3032f3[_0x70fa('0x39')],{'$or':_['map'](_0x3b651c,function(_0x13da14){if(_0x13da14[_0x70fa('0x3d')]!==_0x70fa('0x3e')){var _0x231861={};_0x231861[_0x13da14[_0x70fa('0x30')]]={'$like':'%'+_0x19dfdd[_0x70fa('0x32')]['filter']+'%'};return _0x231861;}})});}_0x3032f3=_[_0x70fa('0x3c')]({},_0x3032f3,_0x19dfdd[_0x70fa('0x3f')]);var _0x119c29={'where':_0x3032f3[_0x70fa('0x39')]};return db[_0x70fa('0x2b')][_0x70fa('0x1c')](_0x119c29)['then'](function(_0x158b3d){_0x52cb96[_0x70fa('0x1c')]=_0x158b3d;if(_0x19dfdd[_0x70fa('0x32')][_0x70fa('0x40')]){_0x3032f3[_0x70fa('0x41')]=[{'all':!![]}];}return db[_0x70fa('0x2b')][_0x70fa('0x42')](_0x3032f3);})[_0x70fa('0x24')](function(_0x1ddcf1){_0x52cb96['rows']=_0x1ddcf1;return _0x52cb96;})['then'](respondWithFilteredResult(_0x423ee6,_0x3032f3))[_0x70fa('0x43')](handleError(_0x423ee6,null));};exports['show']=function(_0x6fbba7,_0x95fb1d){var _0xa91a93={'raw':![],'where':{'id':_0x6fbba7['params']['id']}},_0x4a74e8={};_0x4a74e8[_0x70fa('0x2e')]=_[_0x70fa('0x44')](db[_0x70fa('0x2b')][_0x70fa('0x2c')]);_0x4a74e8[_0x70fa('0x32')]=_[_0x70fa('0x44')](_0x6fbba7[_0x70fa('0x32')]);_0x4a74e8[_0x70fa('0x33')]=_[_0x70fa('0x35')](_0x4a74e8['model'],_0x4a74e8[_0x70fa('0x32')]);_0xa91a93['attributes']=_[_0x70fa('0x35')](_0x4a74e8[_0x70fa('0x2e')],qs['fields'](_0x6fbba7[_0x70fa('0x32')][_0x70fa('0x36')]));_0xa91a93[_0x70fa('0x34')]=_0xa91a93[_0x70fa('0x34')][_0x70fa('0x37')]?_0xa91a93[_0x70fa('0x34')]:_0x4a74e8['model'];if(_0x6fbba7[_0x70fa('0x32')][_0x70fa('0x40')]){_0xa91a93[_0x70fa('0x41')]=[{'all':!![]}];}_0xa91a93=_[_0x70fa('0x3c')]({},_0xa91a93,_0x6fbba7[_0x70fa('0x3f')]);return db['VoiceRecording'][_0x70fa('0x45')](_0xa91a93)['then'](handleEntityNotFound(_0x95fb1d,null))[_0x70fa('0x24')](respondWithResult(_0x95fb1d,null))[_0x70fa('0x43')](handleError(_0x95fb1d,null));};exports[_0x70fa('0x46')]=function(_0x24e5f3,_0xf6f4e5){return db[_0x70fa('0x2b')][_0x70fa('0x46')](_0x24e5f3[_0x70fa('0x47')],{})[_0x70fa('0x24')](respondWithResult(_0xf6f4e5,0xc9))[_0x70fa('0x43')](handleError(_0xf6f4e5,null));};exports[_0x70fa('0x23')]=function(_0x5f16e0,_0x50fa0a){if(_0x5f16e0[_0x70fa('0x47')]['id']){delete _0x5f16e0[_0x70fa('0x47')]['id'];}return db['VoiceRecording'][_0x70fa('0x45')]({'where':{'id':_0x5f16e0[_0x70fa('0x48')]['id']}})[_0x70fa('0x24')](handleEntityNotFound(_0x50fa0a,null))['then'](saveUpdates(_0x5f16e0[_0x70fa('0x47')],null))[_0x70fa('0x24')](respondWithResult(_0x50fa0a,null))[_0x70fa('0x43')](handleError(_0x50fa0a,null));};exports[_0x70fa('0x49')]=function(_0x507a5a,_0x5c6309){return db[_0x70fa('0x2b')][_0x70fa('0x49')]()[_0x70fa('0x24')](respondWithResult(_0x5c6309,null))[_0x70fa('0x43')](handleError(_0x5c6309,null));};exports[_0x70fa('0x4a')]=function(_0x1774d3,_0x5c43af,_0x574d0c){var _0x522063=require('../../components/encryptor');var _0x5a6a89=![];var _0x3565ad={};if(_0x1774d3[_0x70fa('0x32')][_0x70fa('0x3d')]&&_0x1774d3[_0x70fa('0x32')]['type']===_0x70fa('0x4b')){_0x3565ad[_0x70fa('0x4b')]=_0x1774d3[_0x70fa('0x48')]['id'];}else{_0x3565ad['id']=_0x1774d3[_0x70fa('0x48')]['id'];}return db[_0x70fa('0x2b')][_0x70fa('0x45')]({'where':_0x3565ad,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x5c43af,null))[_0x70fa('0x24')](function(_0x2e68f1){if(_0x2e68f1){var _0x558e54=_0x2e68f1[_0x70fa('0x4c')];var _0x141e9d=util['format'](_0x70fa('0x4d'),_0x558e54);if(fs[_0x70fa('0x4e')](_0x141e9d)){_0x5a6a89=!![];return _0x522063['decryptFile'](_0x141e9d,_0x558e54,config['secrets'][_0x70fa('0x4f')])[_0x70fa('0x24')](function(){return _0x2e68f1;});}return _0x2e68f1;}})['then'](function(_0x53dcad){if(_0x53dcad){var _0x9cbf06=_0x53dcad[_0x70fa('0x4c')];if(!fs[_0x70fa('0x4e')](_0x9cbf06)){throw new db['Sequelize'][(_0x70fa('0x50'))](_0x70fa('0x51'));}if(_0x53dcad[_0x70fa('0x52')]){return _0x5c43af[_0x70fa('0x4a')](_0x9cbf06,_0x53dcad[_0x70fa('0x52')]+path[_0x70fa('0x53')](_0x9cbf06),function(){if(_0x5a6a89){fs[_0x70fa('0x54')](_0x9cbf06);}});}else{return _0x5c43af[_0x70fa('0x4a')](_0x9cbf06,function(_0x575bcf){if(_0x5a6a89){fs[_0x70fa('0x54')](_0x9cbf06);}});}}})[_0x70fa('0x43')](function(_0x20993c){if(_0x20993c[_0x70fa('0x55')]==='VoiceRecording\x20not\x20found'){_0x5c43af[_0x70fa('0x19')](0x194)[_0x70fa('0x28')]('Not\x20found');}else{return handleError(_0x5c43af,null);}});};exports[_0x70fa('0x56')]=function(_0x43efc7,_0x69d6fd,_0x2e9e7e){var _0x3e5311=require('../../components/encryptor');var _0x24e975=![];var _0x3a23b9={'$and':[db['sequelize'][_0x70fa('0x39')](db[_0x70fa('0x57')]['fn'](_0x70fa('0x58'),db['sequelize'][_0x70fa('0x59')]('uniqueid')),_0x43efc7['query'][_0x70fa('0x5a')])]};if(_0x43efc7[_0x70fa('0x32')]['type']&&_0x43efc7[_0x70fa('0x32')]['type']===_0x70fa('0x4b')){_0x3a23b9['$and'][_0x70fa('0x5b')]({'uniqueid':_0x43efc7[_0x70fa('0x48')]['id']});}else{_0x3a23b9[_0x70fa('0x5c')][_0x70fa('0x5b')]({'id':_0x43efc7[_0x70fa('0x48')]['id']});}return db['VoiceRecording'][_0x70fa('0x45')]({'where':_0x3a23b9,'attributes':['id',_0x70fa('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x69d6fd,null))[_0x70fa('0x24')](function(_0x5bab66){if(_0x5bab66){var _0x2f8c23=util[_0x70fa('0x31')](_0x70fa('0x4d'),_0x5bab66[_0x70fa('0x4c')]);if(fs[_0x70fa('0x4e')](_0x2f8c23)){_0x24e975=!![];return _0x3e5311[_0x70fa('0x5d')](_0x2f8c23,_0x5bab66['value'],config[_0x70fa('0x5e')][_0x70fa('0x4f')])['then'](function(){return _0x5bab66;});}return _0x5bab66;}})[_0x70fa('0x24')](function(_0x384b07){if(_0x384b07){if(!fs['existsSync'](_0x384b07[_0x70fa('0x4c')])){throw new db[(_0x70fa('0x5f'))][(_0x70fa('0x50'))](_0x70fa('0x51'));}if(_0x384b07[_0x70fa('0x52')]){return _0x69d6fd[_0x70fa('0x4a')](_0x384b07[_0x70fa('0x4c')],_0x384b07[_0x70fa('0x52')]+path[_0x70fa('0x53')](_0x384b07[_0x70fa('0x4c')]),function(){if(_0x24e975){fs[_0x70fa('0x54')](_0x384b07[_0x70fa('0x4c')]);}});}else{return _0x69d6fd[_0x70fa('0x4a')](_0x384b07[_0x70fa('0x4c')],function(_0x59f0c5){if(_0x24e975){fs[_0x70fa('0x54')](_0x384b07[_0x70fa('0x4c')]);}});}}})['catch'](handleError(_0x69d6fd,null));};exports[_0x70fa('0x25')]=function(_0x2dd560,_0xbc8661){return db[_0x70fa('0x2b')]['find']({'where':{'id':_0x2dd560[_0x70fa('0x48')]['id']}})[_0x70fa('0x24')](function(_0x48ff06){if(!_0x48ff06)throw new ReferenceError(_0x70fa('0x60'));return _0x48ff06;})[_0x70fa('0x24')](function(_0xc88478){var _0x3c9b36=_0xc88478[_0x70fa('0x4c')];logger[_0x70fa('0x61')](_0x70fa('0x62'),_0x3c9b36);if(!_[_0x70fa('0x63')](_0xc88478[_0x70fa('0x4c')])&&fs['existsSync'](_0x3c9b36)){logger['info'](_0x70fa('0x64')+_0x3c9b36+_0x70fa('0x65'));fs['unlinkSync'](_0x3c9b36);}_0x3c9b36=_0x3c9b36+_0x70fa('0x66');if(!_[_0x70fa('0x63')](_0xc88478[_0x70fa('0x4c')])&&fs[_0x70fa('0x4e')](_0x3c9b36)){logger[_0x70fa('0x61')](_0x70fa('0x64')+_0x3c9b36+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x70fa('0x67')](_0x3c9b36);}return _0xc88478;})[_0x70fa('0x24')](function(_0x3d9055){if(!_0x3d9055)throw new InternalError();return _0x3d9055[_0x70fa('0x25')]();})[_0x70fa('0x24')](function(){_0xbc8661[_0x70fa('0x19')](0xcc)['end']();})['catch'](handleError(_0xbc8661,null));};function getBucketslist(_0x40d8aa,_0x27320d,_0x5f084a){return new Promise(function(_0x3cb611,_0x2b3e51){var _0x329ff7=new AWS['S3']({'accessKeyId':_0x27320d,'secretAccessKey':_0x40d8aa,'region':_0x5f084a});_0x329ff7[_0x70fa('0x68')]({},function(_0x405049,_0x7ca97f){if(_0x405049){return _0x2b3e51(_0x405049);}else{return _0x3cb611(_0x7ca97f);}});});}function createBucket(_0x561d46,_0x4819fe,_0x4d4d89,_0x2840de){return new Promise(function(_0x8d6640,_0x4d4b9e){var _0x426a24=new AWS['S3']({'accessKeyId':_0x4819fe,'secretAccessKey':_0x561d46,'region':_0x4d4d89});_0x426a24[_0x70fa('0x69')]({'Bucket':_0x2840de},function(_0x4fa1ce,_0x5dc87c){if(_0x4fa1ce){return _0x4d4b9e(_0x4fa1ce);}else{return _0x8d6640(_0x5dc87c);}});});}function uploadFile(_0x1f5c46,_0x100ceb,_0x3af50f,_0x2fe693,_0x308a38,_0x4b714b){return new Promise(function(_0x70d7a9,_0xd40948){var _0xe7e6e2=new AWS['S3']({'accessKeyId':_0x100ceb,'secretAccessKey':_0x1f5c46,'region':_0x3af50f});_0xe7e6e2[_0x70fa('0x6a')]({'Bucket':_0x2fe693,'Key':_0x308a38,'Body':_0x4b714b},function(_0x54bb47,_0x368d0d){if(_0x54bb47){return _0xd40948(_0x54bb47);}else{return _0x70d7a9(_0x368d0d);}});});}function startTranscribe(_0x2427fd,_0x40a627,_0x21db21,_0x599a30,_0x52b0fd,_0x4e0743){return new Promise(function(_0xea9ae0,_0x53a56e){var _0x68e748=new AWS[(_0x70fa('0x6b'))]({'accessKeyId':_0x40a627,'secretAccessKey':_0x2427fd,'region':_0x21db21});_0x68e748[_0x70fa('0x6c')]({'TranscriptionJobName':_0x599a30,'LanguageCode':_0x52b0fd,'Media':{'MediaFileUri':_0x4e0743}},function(_0x1c32be,_0x376c0c){if(_0x1c32be){return _0x53a56e(_0x1c32be);}else{return _0xea9ae0(_0x376c0c);}});});}function transcribe(_0x5ec140,_0x1e9824,_0x738ad4,_0x4a7d69,_0x354d8e,_0x173e15,_0x7668ad){return new Promise(function(_0x251967,_0x6271d7){var _0x3b4864={};logger[_0x70fa('0x61')](util[_0x70fa('0x31')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x5ec140,_0x354d8e));return uploadFile(_0x1e9824,_0x738ad4,_0x4a7d69,_0x354d8e,path[_0x70fa('0x6d')](_0x173e15),fs['readFileSync'](_0x173e15))[_0x70fa('0x24')](function(_0x4775db){logger[_0x70fa('0x61')](util[_0x70fa('0x31')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x5ec140,_0x354d8e,_0x4775db[_0x70fa('0x6e')]));_0x3b4864[_0x70fa('0x6f')]=_0x4775db[_0x70fa('0x70')];_0x3b4864['location']=_0x4775db['Location'];logger['info'](util['format'](_0x70fa('0x71'),_0x5ec140));return startTranscribe(_0x1e9824,_0x738ad4,_0x4a7d69,uuidv4(),_0x7668ad,_0x4775db[_0x70fa('0x6e')]);})[_0x70fa('0x24')](function(_0x430be1){logger[_0x70fa('0x61')](util[_0x70fa('0x31')](_0x70fa('0x72'),_0x5ec140,_0x430be1[_0x70fa('0x73')]['TranscriptionJobName']));_0x3b4864[_0x70fa('0x74')]=_0x430be1['TranscriptionJob'][_0x70fa('0x75')];_0x3b4864[_0x70fa('0x76')]=_0x430be1[_0x70fa('0x73')][_0x70fa('0x77')];return _0x251967(_0x3b4864);})[_0x70fa('0x43')](function(_0x1771b5){return _0x6271d7(_0x1771b5);});});}exports[_0x70fa('0x78')]=function(_0x741386,_0x566bd2,_0x3c9211){var _0x2067ac;var _0x39a1ea;var _0x249813;var _0x4bb685=require(_0x70fa('0x79'));return db['VoiceRecording'][_0x70fa('0x7a')]({'where':{'id':_0x741386[_0x70fa('0x48')]['id']}})['then'](function(_0x201dae){if(_0x201dae){var _0x1d15c7=util[_0x70fa('0x31')](_0x70fa('0x4d'),_0x201dae[_0x70fa('0x4c')]);if(fs[_0x70fa('0x4e')](_0x1d15c7)){cypher=!![];return _0x4bb685[_0x70fa('0x5d')](_0x1d15c7,_0x201dae[_0x70fa('0x4c')],config[_0x70fa('0x5e')][_0x70fa('0x4f')])['then'](function(){return _0x201dae;});}return _0x201dae;}})[_0x70fa('0x24')](function(_0x5db4e2){if(!_0x5db4e2){throw new db['Sequelize'][(_0x70fa('0x50'))](_0x70fa('0x7b'));}_0x39a1ea=_0x5db4e2;return db[_0x70fa('0x7c')][_0x70fa('0x7a')]({'where':{'id':0x1}});})[_0x70fa('0x24')](handleEntityNotFound(_0x566bd2,null))[_0x70fa('0x24')](function(_0x5c54dd){if(_0x5c54dd){_0x2067ac=_0x5c54dd;if(!_0x2067ac[_0x70fa('0x7d')]||!_0x2067ac['transcribeAccountId']||!_0x2067ac[_0x70fa('0x7e')]||!_0x2067ac[_0x70fa('0x7f')]||!_0x2067ac['bucket']){throw new db[(_0x70fa('0x5f'))][(_0x70fa('0x50'))](_0x70fa('0x80'));}if(_0x741386[_0x70fa('0x47')]['runSentiment']&&(!_0x2067ac[_0x70fa('0x81')]||!_0x2067ac[_0x70fa('0x82')]||!_0x2067ac[_0x70fa('0x83')]||!_0x2067ac[_0x70fa('0x7f')]||!_0x2067ac['bucket'])){throw new db['Sequelize'][(_0x70fa('0x50'))](_0x70fa('0x84'));}return db[_0x70fa('0x85')]['findOne']({'where':{'id':_0x2067ac[_0x70fa('0x86')]}});}})[_0x70fa('0x24')](function(_0x377285){if(!_0x377285){throw new db['Sequelize'][(_0x70fa('0x50'))](_0x70fa('0x87'));}if(!_0x377285[_0x70fa('0x88')]||!_0x377285['data2']){throw new db['Sequelize'][(_0x70fa('0x50'))](_0x70fa('0x89'));}_0x249813=_0x377285;return getBucketslist(_0x249813['data1'],_0x249813[_0x70fa('0x8a')],_0x2067ac[_0x70fa('0x7e')]);})[_0x70fa('0x24')](function(_0x2938e9){if(_0x2938e9&&_0x2938e9[_0x70fa('0x8b')]){var _0x210039=_[_0x70fa('0x45')](_0x2938e9[_0x70fa('0x8b')],function(_0x28cb4e){return _0x28cb4e[_0x70fa('0x8c')]===_0x2067ac[_0x70fa('0x6f')];});if(!_0x210039){logger[_0x70fa('0x61')](util[_0x70fa('0x31')](_0x70fa('0x8d'),_0x741386['params']['id'],_0x2067ac['bucket']));return createBucket(_0x249813['data1'],_0x249813[_0x70fa('0x8a')],_0x2067ac[_0x70fa('0x7e')],_0x2067ac[_0x70fa('0x6f')]);}logger[_0x70fa('0x61')](util['format'](_0x70fa('0x8e'),_0x741386[_0x70fa('0x48')]['id'],_0x2067ac['bucket']));return;}})[_0x70fa('0x24')](function(_0x5582b7){if(_0x39a1ea['transcribeStatus']===_0x70fa('0x8f')){return transcribe(_0x741386[_0x70fa('0x48')]['id'],_0x249813['data1'],_0x249813[_0x70fa('0x8a')],_0x2067ac[_0x70fa('0x7e')],_0x2067ac['bucket'],_0x39a1ea[_0x70fa('0x4c')],_0x2067ac[_0x70fa('0x7f')]);}else{logger[_0x70fa('0x61')](util['format'](_0x70fa('0x90'),_0x741386[_0x70fa('0x48')]['id']));return{'transcribeStatus':_0x70fa('0x91')};}})[_0x70fa('0x24')](function(_0x86a418){if(_0x86a418){_0x86a418[_0x70fa('0x92')]=_0x741386[_0x70fa('0x47')][_0x70fa('0x93')];return _0x39a1ea[_0x70fa('0x94')](_0x86a418);}})[_0x70fa('0x24')](respondWithResult(_0x566bd2,null))[_0x70fa('0x43')](handleError(_0x566bd2,null));};function writeFile(_0x12fbb7,_0x2ae964){return new Promise(function(_0x5bf615,_0x3b0d6c){fs[_0x70fa('0x95')](_0x2ae964,_0x12fbb7,function(_0x21133e,_0x5dca44){if(_0x21133e){return _0x3b0d6c(_0x21133e);}else{return _0x5bf615(_0x5dca44);}});});}exports[_0x70fa('0x96')]=function(_0x4871b5,_0xc6f141,_0x17be3e){return db['VoiceRecording']['findOne']({'where':{'id':_0x4871b5[_0x70fa('0x48')]['id']}})['then'](handleEntityNotFound(_0xc6f141))['then'](function(_0xea4065){if(_0xea4065&&_0xea4065[_0x70fa('0x97')]){var _0x1f2166=_0xea4065[_0x70fa('0x97')];var _0x531524=config[_0x70fa('0x98')]+_0x70fa('0x99')+_0xea4065['id']+_0x70fa('0x9a');if(fs[_0x70fa('0x4e')](_0x531524)){return _0x531524;}return writeFile(_0x1f2166,_0x531524)[_0x70fa('0x24')](function(){return _0x531524;});}else{throw new db['Sequelize']['ValidationError'](_0x70fa('0x9b'));}})['then'](function(_0x57ed21){return _0xc6f141[_0x70fa('0x4a')](_0x57ed21);})[_0x70fa('0x43')](handleError(_0xc6f141));};
\ No newline at end of file
+var _0xc668=['fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','error','stack','name','map','VoiceRecording','type','key','differenceBy','format','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','unlink','message','sequelize','MD5','col','token','$and','push','existsSync','secrets','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','runSentiment','updateAttributes','writeFile'];(function(_0x226659,_0x506c84){var _0x2d3d53=function(_0x2450bd){while(--_0x2450bd){_0x226659['push'](_0x226659['shift']());}};_0x2d3d53(++_0x506c84);}(_0xc668,0x12f));var _0x8c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc668[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x8c66('0x0'));var emlformat=require(_0x8c66('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8c66('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c66('0x3'));var moment=require(_0x8c66('0x4'));var BPromise=require(_0x8c66('0x5'));var Mustache=require(_0x8c66('0x6'));var util=require(_0x8c66('0x7'));var path=require(_0x8c66('0x8'));var sox=require(_0x8c66('0x9'));var csv=require(_0x8c66('0xa'));var ejs=require(_0x8c66('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8c66('0xc'));var crypto=require(_0x8c66('0xd'));var jsforce=require(_0x8c66('0xe'));var deskjs=require(_0x8c66('0xf'));var toCsv=require(_0x8c66('0xa'));var querystring=require(_0x8c66('0x10'));var Papa=require('papaparse');var AWS=require(_0x8c66('0x11'));var uuidv4=require(_0x8c66('0x12'));var Redis=require(_0x8c66('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8c66('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c66('0x15'));var logger=require(_0x8c66('0x16'))(_0x8c66('0x17'));var utils=require('../../config/utils');var config=require(_0x8c66('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ad77f,_0x4796c2){_0x4796c2=_0x4796c2||0xcc;return function(_0x41ed37){if(_0x41ed37){return _0x2ad77f[_0x8c66('0x19')](_0x4796c2);}return _0x2ad77f[_0x8c66('0x1a')](_0x4796c2)[_0x8c66('0x1b')]();};}function respondWithResult(_0x3f23c6,_0x2fef17){_0x2fef17=_0x2fef17||0xc8;return function(_0x3e1370){if(_0x3e1370){return _0x3f23c6[_0x8c66('0x1a')](_0x2fef17)[_0x8c66('0x1c')](_0x3e1370);}};}function respondWithFilteredResult(_0x226ce1,_0x57e7e1){return function(_0x508055){if(_0x508055){var _0x540503=_0x508055[_0x8c66('0x1d')],_0x4ac1ab=_0x57e7e1['offset'],_0x4972bb=_0x57e7e1[_0x8c66('0x1e')]+_0x57e7e1[_0x8c66('0x1f')],_0x265caf;if(_0x4972bb>=_0x540503){_0x4972bb=_0x540503;_0x265caf=0xc8;}else{_0x265caf=0xce;}_0x226ce1[_0x8c66('0x1a')](_0x265caf);return _0x226ce1[_0x8c66('0x20')](_0x8c66('0x21'),_0x4ac1ab+'-'+_0x4972bb+'/'+_0x540503)[_0x8c66('0x1c')](_0x508055);}return null;};}function patchUpdates(_0x17d494){return function(_0xb0c36c){try{jsonpatch['apply'](_0xb0c36c,_0x17d494,!![]);}catch(_0x5a7571){return BPromise['reject'](_0x5a7571);}return _0xb0c36c['save']();};}function saveUpdates(_0x323c71,_0x137174){return function(_0x4a18a5){if(_0x4a18a5){return _0x4a18a5[_0x8c66('0x22')](_0x323c71)[_0x8c66('0x23')](function(_0x399e83){return _0x399e83;});}return null;};}function removeEntity(_0x201869,_0x45ea37){return function(_0x1f2bdd){if(_0x1f2bdd){return _0x1f2bdd[_0x8c66('0x24')]()[_0x8c66('0x23')](function(){_0x201869['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c55b,_0x5777ef){return function(_0xc2ccb3){if(!_0xc2ccb3){_0x16c55b[_0x8c66('0x19')](0x194);}return _0xc2ccb3;};}function handleError(_0x1b4d7f,_0x286ac1){_0x286ac1=_0x286ac1||0x1f4;return function(_0x1664aa){logger[_0x8c66('0x25')](_0x1664aa[_0x8c66('0x26')]);if(_0x1664aa[_0x8c66('0x27')]){delete _0x1664aa[_0x8c66('0x27')];}_0x1b4d7f['status'](_0x286ac1)['send'](_0x1664aa);};}exports['index']=function(_0x3e4a3e,_0x13b5bb){var _0x11b8a4={},_0x2b31be={},_0x390b0b={'count':0x0,'rows':[]};var _0x35fc3f=_[_0x8c66('0x28')](db[_0x8c66('0x29')]['rawAttributes'],function(_0x136492){return{'name':_0x136492['fieldName'],'type':_0x136492[_0x8c66('0x2a')][_0x8c66('0x2b')]};});_0x2b31be['model']=_[_0x8c66('0x2c')](_[_0x8c66('0x28')](_0x35fc3f,_0x8c66('0x27')),[_0x8c66('0x2d')]);_0x2b31be[_0x8c66('0x2e')]=_[_0x8c66('0x2f')](_0x3e4a3e['query']);_0x2b31be[_0x8c66('0x30')]=_[_0x8c66('0x31')](_0x2b31be[_0x8c66('0x32')],_0x2b31be[_0x8c66('0x2e')]);_0x11b8a4['attributes']=_[_0x8c66('0x31')](_0x2b31be[_0x8c66('0x32')],qs['fields'](_0x3e4a3e[_0x8c66('0x2e')][_0x8c66('0x33')]));_0x11b8a4['attributes']=_0x11b8a4[_0x8c66('0x34')][_0x8c66('0x35')]?_0x11b8a4['attributes']:_0x2b31be[_0x8c66('0x32')];if(!_0x3e4a3e[_0x8c66('0x2e')][_0x8c66('0x36')](_0x8c66('0x37'))){_0x11b8a4[_0x8c66('0x1f')]=qs[_0x8c66('0x1f')](_0x3e4a3e[_0x8c66('0x2e')][_0x8c66('0x1f')]);_0x11b8a4[_0x8c66('0x1e')]=qs[_0x8c66('0x1e')](_0x3e4a3e[_0x8c66('0x2e')][_0x8c66('0x1e')]);}_0x11b8a4[_0x8c66('0x38')]=qs[_0x8c66('0x39')](_0x3e4a3e[_0x8c66('0x2e')]['sort']);_0x11b8a4[_0x8c66('0x3a')]=qs[_0x8c66('0x30')](_[_0x8c66('0x3b')](_0x3e4a3e[_0x8c66('0x2e')],_0x2b31be[_0x8c66('0x30')]),_0x35fc3f);if(_0x3e4a3e['query']['filter']){_0x11b8a4[_0x8c66('0x3a')]=_[_0x8c66('0x3c')](_0x11b8a4[_0x8c66('0x3a')],{'$or':_[_0x8c66('0x28')](_0x35fc3f,function(_0x98fec7){if(_0x98fec7[_0x8c66('0x2a')]!==_0x8c66('0x3d')){var _0x4d8043={};_0x4d8043[_0x98fec7['name']]={'$like':'%'+_0x3e4a3e['query']['filter']+'%'};return _0x4d8043;}})});}_0x11b8a4=_['merge']({},_0x11b8a4,_0x3e4a3e['options']);var _0x63709e={'where':_0x11b8a4[_0x8c66('0x3a')]};return db[_0x8c66('0x29')][_0x8c66('0x1d')](_0x63709e)[_0x8c66('0x23')](function(_0x328d1d){_0x390b0b[_0x8c66('0x1d')]=_0x328d1d;if(_0x3e4a3e[_0x8c66('0x2e')][_0x8c66('0x3e')]){_0x11b8a4['include']=[{'all':!![]}];}return db[_0x8c66('0x29')][_0x8c66('0x3f')](_0x11b8a4);})[_0x8c66('0x23')](function(_0x128e93){_0x390b0b[_0x8c66('0x40')]=_0x128e93;return _0x390b0b;})[_0x8c66('0x23')](respondWithFilteredResult(_0x13b5bb,_0x11b8a4))[_0x8c66('0x41')](handleError(_0x13b5bb,null));};exports[_0x8c66('0x42')]=function(_0x1cac1e,_0x17da6f){var _0x2cc719={'raw':![],'where':{'id':_0x1cac1e[_0x8c66('0x43')]['id']}},_0x5bf483={};_0x5bf483[_0x8c66('0x32')]=_[_0x8c66('0x2f')](db['VoiceRecording'][_0x8c66('0x44')]);_0x5bf483[_0x8c66('0x2e')]=_[_0x8c66('0x2f')](_0x1cac1e['query']);_0x5bf483[_0x8c66('0x30')]=_[_0x8c66('0x31')](_0x5bf483[_0x8c66('0x32')],_0x5bf483[_0x8c66('0x2e')]);_0x2cc719[_0x8c66('0x34')]=_['intersection'](_0x5bf483[_0x8c66('0x32')],qs[_0x8c66('0x33')](_0x1cac1e[_0x8c66('0x2e')][_0x8c66('0x33')]));_0x2cc719[_0x8c66('0x34')]=_0x2cc719['attributes'][_0x8c66('0x35')]?_0x2cc719[_0x8c66('0x34')]:_0x5bf483['model'];if(_0x1cac1e[_0x8c66('0x2e')][_0x8c66('0x3e')]){_0x2cc719['include']=[{'all':!![]}];}_0x2cc719=_[_0x8c66('0x3c')]({},_0x2cc719,_0x1cac1e[_0x8c66('0x45')]);return db[_0x8c66('0x29')][_0x8c66('0x46')](_0x2cc719)[_0x8c66('0x23')](handleEntityNotFound(_0x17da6f,null))[_0x8c66('0x23')](respondWithResult(_0x17da6f,null))[_0x8c66('0x41')](handleError(_0x17da6f,null));};exports['create']=function(_0x104e91,_0x23cab1){return db[_0x8c66('0x29')][_0x8c66('0x47')](_0x104e91[_0x8c66('0x48')],{})[_0x8c66('0x23')](respondWithResult(_0x23cab1,0xc9))['catch'](handleError(_0x23cab1,null));};exports[_0x8c66('0x22')]=function(_0x684b3b,_0x11a1b8){if(_0x684b3b[_0x8c66('0x48')]['id']){delete _0x684b3b[_0x8c66('0x48')]['id'];}return db[_0x8c66('0x29')][_0x8c66('0x46')]({'where':{'id':_0x684b3b[_0x8c66('0x43')]['id']}})[_0x8c66('0x23')](handleEntityNotFound(_0x11a1b8,null))[_0x8c66('0x23')](saveUpdates(_0x684b3b[_0x8c66('0x48')],null))[_0x8c66('0x23')](respondWithResult(_0x11a1b8,null))[_0x8c66('0x41')](handleError(_0x11a1b8,null));};exports[_0x8c66('0x49')]=function(_0x47366c,_0x5e9428){return db[_0x8c66('0x29')][_0x8c66('0x49')]()[_0x8c66('0x23')](respondWithResult(_0x5e9428,null))[_0x8c66('0x41')](handleError(_0x5e9428,null));};exports['download']=function(_0x548d86,_0x3ce27e,_0x4bd90c){var _0x20164a=require(_0x8c66('0x4a'));var _0x515357=![];var _0x51849f={};if(_0x548d86[_0x8c66('0x2e')][_0x8c66('0x2a')]&&_0x548d86['query'][_0x8c66('0x2a')]===_0x8c66('0x4b')){_0x51849f[_0x8c66('0x4b')]=_0x548d86[_0x8c66('0x43')]['id'];}else{_0x51849f['id']=_0x548d86['params']['id'];}return db[_0x8c66('0x29')][_0x8c66('0x46')]({'where':_0x51849f,'attributes':['id',_0x8c66('0x4c')],'raw':!![]})[_0x8c66('0x23')](handleEntityNotFound(_0x3ce27e,null))[_0x8c66('0x23')](function(_0x18b439){if(_0x18b439){var _0x4b7f09=_0x18b439['value'];var _0x4d341f=util['format'](_0x8c66('0x4d'),_0x4b7f09);if(fs['existsSync'](_0x4d341f)){_0x515357=!![];return _0x20164a[_0x8c66('0x4e')](_0x4d341f,_0x4b7f09,config['secrets'][_0x8c66('0x4f')])[_0x8c66('0x23')](function(){return _0x18b439;});}return _0x18b439;}})[_0x8c66('0x23')](function(_0x16d59a){if(_0x16d59a){var _0x523015=_0x16d59a[_0x8c66('0x4c')];if(!fs['existsSync'](_0x523015)){throw new db[(_0x8c66('0x50'))][(_0x8c66('0x51'))](_0x8c66('0x52'));}if(_0x16d59a[_0x8c66('0x53')]){return _0x3ce27e[_0x8c66('0x54')](_0x523015,_0x16d59a[_0x8c66('0x53')]+path['extname'](_0x523015),function(){if(_0x515357){fs[_0x8c66('0x55')](_0x523015);}});}else{return _0x3ce27e[_0x8c66('0x54')](_0x523015,function(_0x36a599){if(_0x515357){fs[_0x8c66('0x55')](_0x523015);}});}}})['catch'](function(_0x19f07b){if(_0x19f07b[_0x8c66('0x56')]===_0x8c66('0x52')){_0x3ce27e['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x3ce27e,null);}});};exports['downloads']=function(_0x4d45eb,_0xeb7446,_0xe1880d){var _0x1d7aa1=require(_0x8c66('0x4a'));var _0xbb8b79=![];var _0x1b6b47={'$and':[db[_0x8c66('0x57')]['where'](db['sequelize']['fn'](_0x8c66('0x58'),db[_0x8c66('0x57')][_0x8c66('0x59')]('uniqueid')),_0x4d45eb[_0x8c66('0x2e')][_0x8c66('0x5a')])]};if(_0x4d45eb[_0x8c66('0x2e')][_0x8c66('0x2a')]&&_0x4d45eb['query'][_0x8c66('0x2a')]===_0x8c66('0x4b')){_0x1b6b47[_0x8c66('0x5b')][_0x8c66('0x5c')]({'uniqueid':_0x4d45eb[_0x8c66('0x43')]['id']});}else{_0x1b6b47[_0x8c66('0x5b')][_0x8c66('0x5c')]({'id':_0x4d45eb[_0x8c66('0x43')]['id']});}return db[_0x8c66('0x29')][_0x8c66('0x46')]({'where':_0x1b6b47,'attributes':['id',_0x8c66('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0xeb7446,null))[_0x8c66('0x23')](function(_0x330c6d){if(_0x330c6d){var _0x20defe=util['format'](_0x8c66('0x4d'),_0x330c6d[_0x8c66('0x4c')]);if(fs[_0x8c66('0x5d')](_0x20defe)){_0xbb8b79=!![];return _0x1d7aa1[_0x8c66('0x4e')](_0x20defe,_0x330c6d[_0x8c66('0x4c')],config[_0x8c66('0x5e')][_0x8c66('0x4f')])['then'](function(){return _0x330c6d;});}return _0x330c6d;}})[_0x8c66('0x23')](function(_0x1b96ac){if(_0x1b96ac){if(!fs[_0x8c66('0x5d')](_0x1b96ac[_0x8c66('0x4c')])){throw new db[(_0x8c66('0x50'))][(_0x8c66('0x51'))](_0x8c66('0x52'));}if(_0x1b96ac[_0x8c66('0x53')]){return _0xeb7446[_0x8c66('0x54')](_0x1b96ac[_0x8c66('0x4c')],_0x1b96ac[_0x8c66('0x53')]+path['extname'](_0x1b96ac[_0x8c66('0x4c')]),function(){if(_0xbb8b79){fs['unlink'](_0x1b96ac[_0x8c66('0x4c')]);}});}else{return _0xeb7446[_0x8c66('0x54')](_0x1b96ac[_0x8c66('0x4c')],function(_0x49b735){if(_0xbb8b79){fs[_0x8c66('0x55')](_0x1b96ac[_0x8c66('0x4c')]);}});}}})[_0x8c66('0x41')](handleError(_0xeb7446,null));};exports[_0x8c66('0x24')]=function(_0x23d861,_0x158c71){return db[_0x8c66('0x29')][_0x8c66('0x46')]({'where':{'id':_0x23d861[_0x8c66('0x43')]['id']}})['then'](function(_0x19cdb7){if(!_0x19cdb7)throw new ReferenceError(_0x8c66('0x5f'));return _0x19cdb7;})['then'](function(_0x5215a2){var _0x32f2f4=_0x5215a2[_0x8c66('0x4c')];logger[_0x8c66('0x60')]('cancellazione\x20fisica\x20documento\x20%s',_0x32f2f4);if(!_[_0x8c66('0x61')](_0x5215a2['value'])&&fs['existsSync'](_0x32f2f4)){logger[_0x8c66('0x60')](_0x8c66('0x62')+_0x32f2f4+_0x8c66('0x63'));fs[_0x8c66('0x64')](_0x32f2f4);}_0x32f2f4=_0x32f2f4+_0x8c66('0x65');if(!_[_0x8c66('0x61')](_0x5215a2[_0x8c66('0x4c')])&&fs['existsSync'](_0x32f2f4)){logger[_0x8c66('0x60')](_0x8c66('0x62')+_0x32f2f4+_0x8c66('0x63'));fs[_0x8c66('0x64')](_0x32f2f4);}return _0x5215a2;})[_0x8c66('0x23')](function(_0x1e9d07){if(!_0x1e9d07)throw new InternalError();return _0x1e9d07[_0x8c66('0x24')]();})['then'](function(){_0x158c71[_0x8c66('0x1a')](0xcc)[_0x8c66('0x1b')]();})[_0x8c66('0x41')](handleError(_0x158c71,null));};function getBucketslist(_0x57eaf4,_0x4a892a,_0x22b481){return new Promise(function(_0x1df807,_0x66a3b5){var _0x3e6f4b=new AWS['S3']({'accessKeyId':_0x4a892a,'secretAccessKey':_0x57eaf4,'region':_0x22b481});_0x3e6f4b[_0x8c66('0x66')]({},function(_0xf88600,_0xc91920){if(_0xf88600){return _0x66a3b5(_0xf88600);}else{return _0x1df807(_0xc91920);}});});}function createBucket(_0x701866,_0x29b6cb,_0x399964,_0x41b735){return new Promise(function(_0x35fe7b,_0x324a38){var _0x2f42e0=new AWS['S3']({'accessKeyId':_0x29b6cb,'secretAccessKey':_0x701866,'region':_0x399964});_0x2f42e0[_0x8c66('0x67')]({'Bucket':_0x41b735},function(_0x304338,_0x5ba771){if(_0x304338){return _0x324a38(_0x304338);}else{return _0x35fe7b(_0x5ba771);}});});}function uploadFile(_0x1e63ca,_0x522a96,_0x3f2605,_0x52cb64,_0x27e788,_0x2df0e2){return new Promise(function(_0x49a29d,_0x57058c){var _0x2bc875=new AWS['S3']({'accessKeyId':_0x522a96,'secretAccessKey':_0x1e63ca,'region':_0x3f2605});_0x2bc875[_0x8c66('0x68')]({'Bucket':_0x52cb64,'Key':_0x27e788,'Body':_0x2df0e2},function(_0x18af1e,_0x15838f){if(_0x18af1e){return _0x57058c(_0x18af1e);}else{return _0x49a29d(_0x15838f);}});});}function startTranscribe(_0x4bc815,_0x3485df,_0x48926c,_0x5ce1dc,_0x3af1de,_0x457399){return new Promise(function(_0x5ee6d3,_0x11fa51){var _0x30893a=new AWS[(_0x8c66('0x69'))]({'accessKeyId':_0x3485df,'secretAccessKey':_0x4bc815,'region':_0x48926c});_0x30893a['startTranscriptionJob']({'TranscriptionJobName':_0x5ce1dc,'LanguageCode':_0x3af1de,'Media':{'MediaFileUri':_0x457399}},function(_0x5a811b,_0x55fd4e){if(_0x5a811b){return _0x11fa51(_0x5a811b);}else{return _0x5ee6d3(_0x55fd4e);}});});}function transcribe(_0x31f298,_0x2db582,_0x207304,_0x183ec4,_0x40a814,_0x31f13d,_0x15c789){return new Promise(function(_0x58b669,_0x3d7378){var _0x350049={};logger[_0x8c66('0x60')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x31f298,_0x40a814));return uploadFile(_0x2db582,_0x207304,_0x183ec4,_0x40a814,path[_0x8c66('0x6a')](_0x31f13d),fs[_0x8c66('0x6b')](_0x31f13d))['then'](function(_0xcd9b7f){logger[_0x8c66('0x60')](util['format'](_0x8c66('0x6c'),_0x31f298,_0x40a814,_0xcd9b7f[_0x8c66('0x6d')]));_0x350049[_0x8c66('0x6e')]=_0xcd9b7f[_0x8c66('0x6f')];_0x350049[_0x8c66('0x70')]=_0xcd9b7f[_0x8c66('0x6d')];logger['info'](util['format'](_0x8c66('0x71'),_0x31f298));return startTranscribe(_0x2db582,_0x207304,_0x183ec4,uuidv4(),_0x15c789,_0xcd9b7f[_0x8c66('0x6d')]);})[_0x8c66('0x23')](function(_0x3b90e5){logger['info'](util['format'](_0x8c66('0x72'),_0x31f298,_0x3b90e5[_0x8c66('0x73')][_0x8c66('0x74')]));_0x350049[_0x8c66('0x75')]=_0x3b90e5[_0x8c66('0x73')][_0x8c66('0x74')];_0x350049[_0x8c66('0x76')]=_0x3b90e5[_0x8c66('0x73')][_0x8c66('0x77')];return _0x58b669(_0x350049);})[_0x8c66('0x41')](function(_0x405306){return _0x3d7378(_0x405306);});});}exports['runTranscribe']=function(_0x962d68,_0x59c9bd,_0x5b2f88){var _0x21c561;var _0xf5e544;var _0x5ca602;var _0x4b043a=require(_0x8c66('0x4a'));return db[_0x8c66('0x29')][_0x8c66('0x78')]({'where':{'id':_0x962d68[_0x8c66('0x43')]['id']}})['then'](function(_0x6ff824){if(_0x6ff824){var _0x425e92=util[_0x8c66('0x2d')](_0x8c66('0x4d'),_0x6ff824[_0x8c66('0x4c')]);if(fs[_0x8c66('0x5d')](_0x425e92)){cypher=!![];return _0x4b043a['decryptFile'](_0x425e92,_0x6ff824['value'],config[_0x8c66('0x5e')][_0x8c66('0x4f')])[_0x8c66('0x23')](function(){return _0x6ff824;});}return _0x6ff824;}})[_0x8c66('0x23')](function(_0x7e12af){if(!_0x7e12af){throw new db['Sequelize'][(_0x8c66('0x51'))](_0x8c66('0x79'));}_0xf5e544=_0x7e12af;return db[_0x8c66('0x7a')][_0x8c66('0x78')]({'where':{'id':0x1}});})[_0x8c66('0x23')](handleEntityNotFound(_0x59c9bd,null))[_0x8c66('0x23')](function(_0x372992){if(_0x372992){_0x21c561=_0x372992;if(!_0x21c561[_0x8c66('0x7b')]||!_0x21c561[_0x8c66('0x7c')]||!_0x21c561[_0x8c66('0x7d')]||!_0x21c561[_0x8c66('0x7e')]||!_0x21c561['bucket']){throw new db[(_0x8c66('0x50'))]['ValidationError'](_0x8c66('0x7f'));}if(_0x962d68[_0x8c66('0x48')]['runSentiment']&&(!_0x21c561[_0x8c66('0x80')]||!_0x21c561[_0x8c66('0x81')]||!_0x21c561[_0x8c66('0x82')]||!_0x21c561[_0x8c66('0x7e')]||!_0x21c561[_0x8c66('0x6e')])){throw new db[(_0x8c66('0x50'))]['ValidationError'](_0x8c66('0x83'));}return db[_0x8c66('0x84')][_0x8c66('0x78')]({'where':{'id':_0x21c561[_0x8c66('0x7c')]}});}})['then'](function(_0x22e547){if(!_0x22e547){throw new db[(_0x8c66('0x50'))][(_0x8c66('0x51'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x22e547[_0x8c66('0x85')]||!_0x22e547[_0x8c66('0x86')]){throw new db[(_0x8c66('0x50'))][(_0x8c66('0x51'))](_0x8c66('0x87'));}_0x5ca602=_0x22e547;return getBucketslist(_0x5ca602[_0x8c66('0x85')],_0x5ca602['data2'],_0x21c561[_0x8c66('0x7d')]);})[_0x8c66('0x23')](function(_0x2808e2){if(_0x2808e2&&_0x2808e2[_0x8c66('0x88')]){var _0x360726=_[_0x8c66('0x46')](_0x2808e2[_0x8c66('0x88')],function(_0x4a0456){return _0x4a0456[_0x8c66('0x89')]===_0x21c561['bucket'];});if(!_0x360726){logger['info'](util[_0x8c66('0x2d')](_0x8c66('0x8a'),_0x962d68[_0x8c66('0x43')]['id'],_0x21c561[_0x8c66('0x6e')]));return createBucket(_0x5ca602['data1'],_0x5ca602[_0x8c66('0x86')],_0x21c561['transcribeRegion'],_0x21c561[_0x8c66('0x6e')]);}logger['info'](util[_0x8c66('0x2d')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x962d68[_0x8c66('0x43')]['id'],_0x21c561['bucket']));return;}})[_0x8c66('0x23')](function(_0x2a2840){if(_0xf5e544['transcribeStatus']==='NEW'){return transcribe(_0x962d68[_0x8c66('0x43')]['id'],_0x5ca602[_0x8c66('0x85')],_0x5ca602[_0x8c66('0x86')],_0x21c561[_0x8c66('0x7d')],_0x21c561[_0x8c66('0x6e')],_0xf5e544[_0x8c66('0x4c')],_0x21c561[_0x8c66('0x7e')]);}else{logger[_0x8c66('0x60')](util['format'](_0x8c66('0x8b'),_0x962d68[_0x8c66('0x43')]['id']));return{'transcribeStatus':_0x8c66('0x8c')};}})['then'](function(_0xc7e131){if(_0xc7e131){_0xc7e131['tempSentiment']=_0x962d68[_0x8c66('0x48')][_0x8c66('0x8d')];return _0xf5e544[_0x8c66('0x8e')](_0xc7e131);}})[_0x8c66('0x23')](respondWithResult(_0x59c9bd,null))[_0x8c66('0x41')](handleError(_0x59c9bd,null));};function writeFile(_0x44443f,_0x28cc21){return new Promise(function(_0x29b8e3,_0x4dd183){fs[_0x8c66('0x8f')](_0x28cc21,_0x44443f,function(_0x3d5ed6,_0x1c035c){if(_0x3d5ed6){return _0x4dd183(_0x3d5ed6);}else{return _0x29b8e3(_0x1c035c);}});});}exports['downloadTranscribe']=function(_0x11720d,_0x38f45e,_0x5385a1){return db[_0x8c66('0x29')][_0x8c66('0x78')]({'where':{'id':_0x11720d[_0x8c66('0x43')]['id']}})[_0x8c66('0x23')](handleEntityNotFound(_0x38f45e))[_0x8c66('0x23')](function(_0x546291){if(_0x546291&&_0x546291[_0x8c66('0x90')]){var _0x35f39d=_0x546291['fileText'];var _0x2992dd=config[_0x8c66('0x91')]+_0x8c66('0x92')+_0x546291['id']+_0x8c66('0x93');if(fs[_0x8c66('0x5d')](_0x2992dd)){return _0x2992dd;}return writeFile(_0x35f39d,_0x2992dd)[_0x8c66('0x23')](function(){return _0x2992dd;});}else{throw new db['Sequelize'][(_0x8c66('0x51'))](_0x8c66('0x94'));}})[_0x8c66('0x23')](function(_0x4d7749){return _0x38f45e[_0x8c66('0x54')](_0x4d7749);})[_0x8c66('0x41')](handleError(_0x38f45e));};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js
index 2c1bc10..b58fb3c 100644
--- a/server/api/voiceRecording/voiceRecording.model.js
+++ b/server/api/voiceRecording/voiceRecording.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf98=['VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xdf98,0xcf));var _0x8df9=function(_0x417b1a,_0x3cfce5){_0x417b1a=_0x417b1a-0x0;var _0x1e41af=_0xdf98[_0x417b1a];return _0x1e41af;};'use strict';var _=require(_0x8df9('0x0'));var util=require('util');var logger=require(_0x8df9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8df9('0x2'));var rp=require(_0x8df9('0x3'));var fs=require('fs');var path=require(_0x8df9('0x4'));var rimraf=require(_0x8df9('0x5'));var config=require(_0x8df9('0x6'));var attributes=require(_0x8df9('0x7'));module[_0x8df9('0x8')]=function(_0x158424,_0x20b677){return _0x158424['define'](_0x8df9('0x9'),attributes,{'tableName':_0x8df9('0xa'),'paranoid':![],'indexes':[{'name':_0x8df9('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1967=['rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5a3762,_0x3abd9d){var _0x3b9da2=function(_0x13f18e){while(--_0x13f18e){_0x5a3762['push'](_0x5a3762['shift']());}};_0x3b9da2(++_0x3abd9d);}(_0x1967,0x173));var _0x7196=function(_0x3a8ef9,_0x1dd8e6){_0x3a8ef9=_0x3a8ef9-0x0;var _0x3c12d6=_0x1967[_0x3a8ef9];return _0x3c12d6;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[{'name':_0x7196('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js
index 486416c..6905f81 100644
--- a/server/api/voiceRecording/voiceRecording.rpc.js
+++ b/server/api/voiceRecording/voiceRecording.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x498789,_0x465536){var _0x3f8b64=function(_0x47b635){while(--_0x47b635){_0x498789['push'](_0x498789['shift']());}};_0x3f8b64(++_0x465536);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x3af384,_0x2b2160){var _0x194aad=function(_0x39c9e4){while(--_0x39c9e4){_0x3af384['push'](_0x3af384['shift']());}};_0x194aad(++_0x2b2160);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js
index 33d9da2..006cb56 100644
--- a/server/api/voiceTransferReport/index.js
+++ b/server/api/voiceTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8fb=['util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','/:id','update','multer'];(function(_0x422127,_0x3674d5){var _0x12b194=function(_0x5d6c19){while(--_0x5d6c19){_0x422127['push'](_0x422127['shift']());}};_0x12b194(++_0x3674d5);}(_0xd8fb,0x99));var _0xbd8f=function(_0x1232ab,_0x1c8c07){_0x1232ab=_0x1232ab-0x0;var _0x6c9cae=_0xd8fb[_0x1232ab];return _0x6c9cae;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbd8f('0x4'));var config=require(_0xbd8f('0x5'));var controller=require('./voiceTransferReport.controller');router[_0xbd8f('0x6')]('/',auth[_0xbd8f('0x7')](),controller['index']);router[_0xbd8f('0x6')]('/:id',auth[_0xbd8f('0x7')](),controller['show']);router[_0xbd8f('0x8')]('/',auth[_0xbd8f('0x7')](),controller['create']);router['put'](_0xbd8f('0x9'),auth[_0xbd8f('0x7')](),controller[_0xbd8f('0xa')]);router['delete'](_0xbd8f('0x9'),auth[_0xbd8f('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x01d9=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2c2390,_0x37ef1c){var _0x478b7e=function(_0x2ea947){while(--_0x2ea947){_0x2c2390['push'](_0x2c2390['shift']());}};_0x478b7e(++_0x37ef1c);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var auth=require(_0x901d('0x5'));var interaction=require(_0x901d('0x6'));var config=require(_0x901d('0x7'));var controller=require(_0x901d('0x8'));router[_0x901d('0x9')]('/',auth[_0x901d('0xa')](),controller['index']);router[_0x901d('0x9')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0xc')]);router[_0x901d('0xd')]('/',auth[_0x901d('0xa')](),controller[_0x901d('0xe')]);router[_0x901d('0xf')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')](_0x901d('0xb'),auth['isAuthenticated'](),controller[_0x901d('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js
index 6523316..4820ded 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.attributes.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeb9b=['Yes','moment','exports','blind','attended','STRING','ENUM'];(function(_0x1e8673,_0x2dc01a){var _0x10472c=function(_0x106f85){while(--_0x106f85){_0x1e8673['push'](_0x1e8673['shift']());}};_0x10472c(++_0x2dc01a);}(_0xeb9b,0x1cf));var _0xbeb9=function(_0xc69fda,_0x367f93){_0xc69fda=_0xc69fda-0x0;var _0x721842=_0xeb9b[_0xc69fda];return _0x721842;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbeb9('0x0'));module[_0xbeb9('0x1')]={'type':{'type':Sequelize['ENUM'](_0xbeb9('0x2'),_0xbeb9('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xbeb9('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xbeb9('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xbeb9('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xbeb9('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xbeb9('0x4')]},'transfereechannel':{'type':Sequelize[_0xbeb9('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xbeb9('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xbeb9('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xbeb9('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xbeb9('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xbeb9('0x4')]},'transfereecontext':{'type':Sequelize[_0xbeb9('0x4')]},'transfereeexten':{'type':Sequelize[_0xbeb9('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xbeb9('0x4')]},'isexternal':{'type':Sequelize[_0xbeb9('0x5')](_0xbeb9('0x6'),'No')},'context':{'type':Sequelize[_0xbeb9('0x4')]},'extension':{'type':Sequelize[_0xbeb9('0x4')]}};
\ No newline at end of file
+var _0x2d57=['sequelize','moment','attended','STRING','ENUM','Yes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2d57,0x126));var _0x72d5=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x2d57[_0x255ac0];return _0x437bf1;};'use strict';var Sequelize=require(_0x72d5('0x0'));var moment=require(_0x72d5('0x1'));module['exports']={'type':{'type':Sequelize['ENUM']('blind',_0x72d5('0x2'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x72d5('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x72d5('0x3')]},'transferercalleridname':{'type':Sequelize[_0x72d5('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x72d5('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x72d5('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x72d5('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x72d5('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x72d5('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x72d5('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x72d5('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x72d5('0x3')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x72d5('0x4')](_0x72d5('0x5'),'No')},'context':{'type':Sequelize[_0x72d5('0x3')]},'extension':{'type':Sequelize[_0x72d5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js
index e1f227d..6d94d71 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.controller.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f2f=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x8f2f,0x1b6));var _0xf8f2=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x8f2f[_0x273c39];return _0x46d6b5;};'use strict';var pdf=require(_0xf8f2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf8f2('0x1'));var jsonpatch=require(_0xf8f2('0x2'));var rp=require(_0xf8f2('0x3'));var moment=require(_0xf8f2('0x4'));var BPromise=require(_0xf8f2('0x5'));var Mustache=require('mustache');var util=require(_0xf8f2('0x6'));var path=require('path');var sox=require(_0xf8f2('0x7'));var csv=require(_0xf8f2('0x8'));var ejs=require(_0xf8f2('0x9'));var fs=require('fs');var _=require(_0xf8f2('0xa'));var squel=require('squel');var crypto=require(_0xf8f2('0xb'));var jsforce=require(_0xf8f2('0xc'));var deskjs=require(_0xf8f2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf8f2('0xe'));var Papa=require(_0xf8f2('0xf'));var Redis=require(_0xf8f2('0x10'));var authService=require(_0xf8f2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8f2('0x12'));var logger=require(_0xf8f2('0x13'))(_0xf8f2('0x14'));var utils=require(_0xf8f2('0x15'));var config=require(_0xf8f2('0x16'));var db=require(_0xf8f2('0x17'))['db'];function respondWithStatusCode(_0x382957,_0x2c38e6){_0x2c38e6=_0x2c38e6||0xcc;return function(_0x235f23){if(_0x235f23){return _0x382957['sendStatus'](_0x2c38e6);}return _0x382957[_0xf8f2('0x18')](_0x2c38e6)[_0xf8f2('0x19')]();};}function respondWithResult(_0x427d9e,_0x1f5fe1){_0x1f5fe1=_0x1f5fe1||0xc8;return function(_0x4c4455){if(_0x4c4455){return _0x427d9e[_0xf8f2('0x18')](_0x1f5fe1)[_0xf8f2('0x1a')](_0x4c4455);}};}function respondWithFilteredResult(_0xc216fc,_0x25618d){return function(_0x335cb4){if(_0x335cb4){var _0x2c65aa=_0x335cb4[_0xf8f2('0x1b')],_0x57974b=_0x25618d[_0xf8f2('0x1c')],_0x16b8f3=_0x25618d[_0xf8f2('0x1c')]+_0x25618d[_0xf8f2('0x1d')],_0x15765b;if(_0x16b8f3>=_0x2c65aa){_0x16b8f3=_0x2c65aa;_0x15765b=0xc8;}else{_0x15765b=0xce;}_0xc216fc[_0xf8f2('0x18')](_0x15765b);return _0xc216fc[_0xf8f2('0x1e')](_0xf8f2('0x1f'),_0x57974b+'-'+_0x16b8f3+'/'+_0x2c65aa)[_0xf8f2('0x1a')](_0x335cb4);}return null;};}function patchUpdates(_0x278e70){return function(_0x2b5840){try{jsonpatch[_0xf8f2('0x20')](_0x2b5840,_0x278e70,!![]);}catch(_0x124b58){return BPromise[_0xf8f2('0x21')](_0x124b58);}return _0x2b5840['save']();};}function saveUpdates(_0x46102d,_0x52b228){return function(_0x231f74){if(_0x231f74){return _0x231f74[_0xf8f2('0x22')](_0x46102d)[_0xf8f2('0x23')](function(_0x2b7fa1){return _0x2b7fa1;});}return null;};}function removeEntity(_0xec841,_0x3a2688){return function(_0x4ba90f){if(_0x4ba90f){return _0x4ba90f[_0xf8f2('0x24')]()['then'](function(){_0xec841[_0xf8f2('0x18')](0xcc)[_0xf8f2('0x19')]();});}};}function handleEntityNotFound(_0x4d6c48,_0xda70ae){return function(_0x43d3f4){if(!_0x43d3f4){_0x4d6c48['sendStatus'](0x194);}return _0x43d3f4;};}function handleError(_0x470028,_0x24f35e){_0x24f35e=_0x24f35e||0x1f4;return function(_0xf135d){logger[_0xf8f2('0x25')](_0xf135d[_0xf8f2('0x26')]);if(_0xf135d[_0xf8f2('0x27')]){delete _0xf135d['name'];}_0x470028[_0xf8f2('0x18')](_0x24f35e)[_0xf8f2('0x28')](_0xf135d);};}exports[_0xf8f2('0x29')]=function(_0x329d28,_0x2b93f6){var _0x2307d0={},_0x58d4af={},_0x1cfe2b={'count':0x0,'rows':[]};var _0xfaccc4=_[_0xf8f2('0x2a')](db[_0xf8f2('0x2b')]['rawAttributes'],function(_0x4f124e){return{'name':_0x4f124e[_0xf8f2('0x2c')],'type':_0x4f124e[_0xf8f2('0x2d')][_0xf8f2('0x2e')]};});_0x58d4af[_0xf8f2('0x2f')]=_[_0xf8f2('0x2a')](_0xfaccc4,_0xf8f2('0x27'));_0x58d4af[_0xf8f2('0x30')]=_[_0xf8f2('0x31')](_0x329d28['query']);_0x58d4af[_0xf8f2('0x32')]=_[_0xf8f2('0x33')](_0x58d4af[_0xf8f2('0x2f')],_0x58d4af[_0xf8f2('0x30')]);_0x2307d0[_0xf8f2('0x34')]=_[_0xf8f2('0x33')](_0x58d4af[_0xf8f2('0x2f')],qs['fields'](_0x329d28[_0xf8f2('0x30')][_0xf8f2('0x35')]));_0x2307d0[_0xf8f2('0x34')]=_0x2307d0[_0xf8f2('0x34')][_0xf8f2('0x36')]?_0x2307d0[_0xf8f2('0x34')]:_0x58d4af['model'];if(!_0x329d28[_0xf8f2('0x30')][_0xf8f2('0x37')](_0xf8f2('0x38'))){_0x2307d0['limit']=qs[_0xf8f2('0x1d')](_0x329d28[_0xf8f2('0x30')][_0xf8f2('0x1d')]);_0x2307d0['offset']=qs['offset'](_0x329d28[_0xf8f2('0x30')][_0xf8f2('0x1c')]);}_0x2307d0[_0xf8f2('0x39')]=qs[_0xf8f2('0x3a')](_0x329d28[_0xf8f2('0x30')][_0xf8f2('0x3a')]);_0x2307d0[_0xf8f2('0x3b')]=qs['filters'](_[_0xf8f2('0x3c')](_0x329d28[_0xf8f2('0x30')],_0x58d4af[_0xf8f2('0x32')]),_0xfaccc4);if(_0x329d28[_0xf8f2('0x30')][_0xf8f2('0x3d')]){_0x2307d0[_0xf8f2('0x3b')]=_[_0xf8f2('0x3e')](_0x2307d0[_0xf8f2('0x3b')],{'$or':_[_0xf8f2('0x2a')](_0xfaccc4,function(_0xc50645){if(_0xc50645[_0xf8f2('0x2d')]!==_0xf8f2('0x3f')){var _0x2666a9={};_0x2666a9[_0xc50645['name']]={'$like':'%'+_0x329d28[_0xf8f2('0x30')][_0xf8f2('0x3d')]+'%'};return _0x2666a9;}})});}_0x2307d0=_['merge']({},_0x2307d0,_0x329d28[_0xf8f2('0x40')]);var _0x2fcaa6={'where':_0x2307d0['where']};return db[_0xf8f2('0x2b')][_0xf8f2('0x1b')](_0x2fcaa6)['then'](function(_0x48710d){_0x1cfe2b[_0xf8f2('0x1b')]=_0x48710d;if(_0x329d28[_0xf8f2('0x30')][_0xf8f2('0x41')]){_0x2307d0[_0xf8f2('0x42')]=[{'all':!![]}];}return db[_0xf8f2('0x2b')]['findAll'](_0x2307d0);})[_0xf8f2('0x23')](function(_0x221b16){_0x1cfe2b[_0xf8f2('0x43')]=_0x221b16;return _0x1cfe2b;})[_0xf8f2('0x23')](respondWithFilteredResult(_0x2b93f6,_0x2307d0))[_0xf8f2('0x44')](handleError(_0x2b93f6,null));};exports[_0xf8f2('0x45')]=function(_0x12cc42,_0x30e365){var _0x1b15b5={'raw':!![],'where':{'id':_0x12cc42[_0xf8f2('0x46')]['id']}},_0x10d730={};_0x10d730[_0xf8f2('0x2f')]=_['keys'](db[_0xf8f2('0x2b')][_0xf8f2('0x47')]);_0x10d730[_0xf8f2('0x30')]=_[_0xf8f2('0x31')](_0x12cc42[_0xf8f2('0x30')]);_0x10d730[_0xf8f2('0x32')]=_['intersection'](_0x10d730[_0xf8f2('0x2f')],_0x10d730[_0xf8f2('0x30')]);_0x1b15b5[_0xf8f2('0x34')]=_['intersection'](_0x10d730['model'],qs[_0xf8f2('0x35')](_0x12cc42[_0xf8f2('0x30')][_0xf8f2('0x35')]));_0x1b15b5['attributes']=_0x1b15b5[_0xf8f2('0x34')][_0xf8f2('0x36')]?_0x1b15b5[_0xf8f2('0x34')]:_0x10d730[_0xf8f2('0x2f')];if(_0x12cc42['query'][_0xf8f2('0x41')]){_0x1b15b5[_0xf8f2('0x42')]=[{'all':!![]}];}_0x1b15b5=_[_0xf8f2('0x3e')]({},_0x1b15b5,_0x12cc42[_0xf8f2('0x40')]);return db[_0xf8f2('0x2b')][_0xf8f2('0x48')](_0x1b15b5)['then'](handleEntityNotFound(_0x30e365,null))[_0xf8f2('0x23')](respondWithResult(_0x30e365,null))[_0xf8f2('0x44')](handleError(_0x30e365,null));};exports['create']=function(_0x1fcfa2,_0x43ac5b){return db[_0xf8f2('0x2b')][_0xf8f2('0x49')](_0x1fcfa2['body'],{})[_0xf8f2('0x23')](respondWithResult(_0x43ac5b,0xc9))[_0xf8f2('0x44')](handleError(_0x43ac5b,null));};exports[_0xf8f2('0x22')]=function(_0x5e4b9e,_0xa48dce){if(_0x5e4b9e['body']['id']){delete _0x5e4b9e[_0xf8f2('0x4a')]['id'];}return db[_0xf8f2('0x2b')]['find']({'where':{'id':_0x5e4b9e['params']['id']}})[_0xf8f2('0x23')](handleEntityNotFound(_0xa48dce,null))[_0xf8f2('0x23')](saveUpdates(_0x5e4b9e[_0xf8f2('0x4a')],null))['then'](respondWithResult(_0xa48dce,null))[_0xf8f2('0x44')](handleError(_0xa48dce,null));};exports['destroy']=function(_0x41e702,_0x14c5b3){return db['VoiceTransferReport'][_0xf8f2('0x48')]({'where':{'id':_0x41e702[_0xf8f2('0x46')]['id']}})['then'](handleEntityNotFound(_0x14c5b3,null))[_0xf8f2('0x23')](removeEntity(_0x14c5b3,null))[_0xf8f2('0x44')](handleError(_0x14c5b3,null));};
\ No newline at end of file
+var _0x1d07=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','set','Content-Range','json','apply','reject','save','update','then','name','VoiceTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x8f8b26,_0xa389df){var _0x26068b=function(_0x527c0d){while(--_0x527c0d){_0x8f8b26['push'](_0x8f8b26['shift']());}};_0x26068b(++_0xa389df);}(_0x1d07,0x1e5));var _0x71d0=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x1d07[_0xaa1b3e];return _0x454d7d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x71d0('0x0'));var zipdir=require(_0x71d0('0x1'));var jsonpatch=require(_0x71d0('0x2'));var rp=require('request-promise');var moment=require(_0x71d0('0x3'));var BPromise=require(_0x71d0('0x4'));var Mustache=require(_0x71d0('0x5'));var util=require('util');var path=require('path');var sox=require(_0x71d0('0x6'));var csv=require(_0x71d0('0x7'));var ejs=require(_0x71d0('0x8'));var fs=require('fs');var _=require(_0x71d0('0x9'));var squel=require(_0x71d0('0xa'));var crypto=require(_0x71d0('0xb'));var jsforce=require(_0x71d0('0xc'));var deskjs=require(_0x71d0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x71d0('0xe'));var authService=require(_0x71d0('0xf'));var qs=require(_0x71d0('0x10'));var as=require(_0x71d0('0x11'));var hardwareService=require(_0x71d0('0x12'));var logger=require(_0x71d0('0x13'))(_0x71d0('0x14'));var utils=require(_0x71d0('0x15'));var config=require(_0x71d0('0x16'));var db=require(_0x71d0('0x17'))['db'];function respondWithStatusCode(_0x14e3a9,_0x36f523){_0x36f523=_0x36f523||0xcc;return function(_0x290ffc){if(_0x290ffc){return _0x14e3a9[_0x71d0('0x18')](_0x36f523);}return _0x14e3a9['status'](_0x36f523)[_0x71d0('0x19')]();};}function respondWithResult(_0x4a44c3,_0x10dc79){_0x10dc79=_0x10dc79||0xc8;return function(_0x5cbc9f){if(_0x5cbc9f){return _0x4a44c3[_0x71d0('0x1a')](_0x10dc79)['json'](_0x5cbc9f);}};}function respondWithFilteredResult(_0x55480e,_0xb02682){return function(_0x1a5d86){if(_0x1a5d86){var _0x2615c2=_0x1a5d86['count'],_0x207c91=_0xb02682['offset'],_0x1bfe79=_0xb02682['offset']+_0xb02682['limit'],_0x57b5a3;if(_0x1bfe79>=_0x2615c2){_0x1bfe79=_0x2615c2;_0x57b5a3=0xc8;}else{_0x57b5a3=0xce;}_0x55480e[_0x71d0('0x1a')](_0x57b5a3);return _0x55480e[_0x71d0('0x1b')](_0x71d0('0x1c'),_0x207c91+'-'+_0x1bfe79+'/'+_0x2615c2)[_0x71d0('0x1d')](_0x1a5d86);}return null;};}function patchUpdates(_0x496655){return function(_0x1942a0){try{jsonpatch[_0x71d0('0x1e')](_0x1942a0,_0x496655,!![]);}catch(_0x463d91){return BPromise[_0x71d0('0x1f')](_0x463d91);}return _0x1942a0[_0x71d0('0x20')]();};}function saveUpdates(_0x227da6,_0xfa5ca4){return function(_0x4b4f81){if(_0x4b4f81){return _0x4b4f81[_0x71d0('0x21')](_0x227da6)[_0x71d0('0x22')](function(_0x49edc7){return _0x49edc7;});}return null;};}function removeEntity(_0x3e238e,_0x3cfa4b){return function(_0x2e8f86){if(_0x2e8f86){return _0x2e8f86['destroy']()[_0x71d0('0x22')](function(){_0x3e238e[_0x71d0('0x1a')](0xcc)[_0x71d0('0x19')]();});}};}function handleEntityNotFound(_0x336267,_0x9be902){return function(_0x3723e3){if(!_0x3723e3){_0x336267[_0x71d0('0x18')](0x194);}return _0x3723e3;};}function handleError(_0x1285c2,_0x109599){_0x109599=_0x109599||0x1f4;return function(_0x42f3cb){logger['error'](_0x42f3cb['stack']);if(_0x42f3cb[_0x71d0('0x23')]){delete _0x42f3cb[_0x71d0('0x23')];}_0x1285c2[_0x71d0('0x1a')](_0x109599)['send'](_0x42f3cb);};}exports['index']=function(_0x424522,_0x52e28b){var _0xcc70c={},_0x2fca05={},_0x852cb9={'count':0x0,'rows':[]};var _0x5ca600=_['map'](db[_0x71d0('0x24')][_0x71d0('0x25')],function(_0x280472){return{'name':_0x280472[_0x71d0('0x26')],'type':_0x280472[_0x71d0('0x27')][_0x71d0('0x28')]};});_0x2fca05[_0x71d0('0x29')]=_[_0x71d0('0x2a')](_0x5ca600,_0x71d0('0x23'));_0x2fca05[_0x71d0('0x2b')]=_[_0x71d0('0x2c')](_0x424522['query']);_0x2fca05[_0x71d0('0x2d')]=_[_0x71d0('0x2e')](_0x2fca05[_0x71d0('0x29')],_0x2fca05[_0x71d0('0x2b')]);_0xcc70c[_0x71d0('0x2f')]=_[_0x71d0('0x2e')](_0x2fca05[_0x71d0('0x29')],qs['fields'](_0x424522[_0x71d0('0x2b')][_0x71d0('0x30')]));_0xcc70c[_0x71d0('0x2f')]=_0xcc70c['attributes'][_0x71d0('0x31')]?_0xcc70c[_0x71d0('0x2f')]:_0x2fca05[_0x71d0('0x29')];if(!_0x424522[_0x71d0('0x2b')][_0x71d0('0x32')](_0x71d0('0x33'))){_0xcc70c[_0x71d0('0x34')]=qs[_0x71d0('0x34')](_0x424522['query'][_0x71d0('0x34')]);_0xcc70c[_0x71d0('0x35')]=qs[_0x71d0('0x35')](_0x424522[_0x71d0('0x2b')][_0x71d0('0x35')]);}_0xcc70c[_0x71d0('0x36')]=qs[_0x71d0('0x37')](_0x424522[_0x71d0('0x2b')]['sort']);_0xcc70c[_0x71d0('0x38')]=qs[_0x71d0('0x2d')](_['pick'](_0x424522['query'],_0x2fca05[_0x71d0('0x2d')]),_0x5ca600);if(_0x424522['query']['filter']){_0xcc70c[_0x71d0('0x38')]=_[_0x71d0('0x39')](_0xcc70c[_0x71d0('0x38')],{'$or':_[_0x71d0('0x2a')](_0x5ca600,function(_0x33e259){if(_0x33e259[_0x71d0('0x27')]!=='VIRTUAL'){var _0x30c9b8={};_0x30c9b8[_0x33e259[_0x71d0('0x23')]]={'$like':'%'+_0x424522[_0x71d0('0x2b')][_0x71d0('0x3a')]+'%'};return _0x30c9b8;}})});}_0xcc70c=_['merge']({},_0xcc70c,_0x424522[_0x71d0('0x3b')]);var _0x5b3d9a={'where':_0xcc70c[_0x71d0('0x38')]};return db[_0x71d0('0x24')]['count'](_0x5b3d9a)[_0x71d0('0x22')](function(_0x1a6bf1){_0x852cb9[_0x71d0('0x3c')]=_0x1a6bf1;if(_0x424522[_0x71d0('0x2b')][_0x71d0('0x3d')]){_0xcc70c[_0x71d0('0x3e')]=[{'all':!![]}];}return db[_0x71d0('0x24')][_0x71d0('0x3f')](_0xcc70c);})[_0x71d0('0x22')](function(_0x593661){_0x852cb9[_0x71d0('0x40')]=_0x593661;return _0x852cb9;})[_0x71d0('0x22')](respondWithFilteredResult(_0x52e28b,_0xcc70c))[_0x71d0('0x41')](handleError(_0x52e28b,null));};exports[_0x71d0('0x42')]=function(_0x440699,_0x277783){var _0x388930={'raw':!![],'where':{'id':_0x440699['params']['id']}},_0x1d9894={};_0x1d9894['model']=_[_0x71d0('0x2c')](db['VoiceTransferReport'][_0x71d0('0x25')]);_0x1d9894[_0x71d0('0x2b')]=_[_0x71d0('0x2c')](_0x440699[_0x71d0('0x2b')]);_0x1d9894[_0x71d0('0x2d')]=_['intersection'](_0x1d9894[_0x71d0('0x29')],_0x1d9894['query']);_0x388930[_0x71d0('0x2f')]=_[_0x71d0('0x2e')](_0x1d9894[_0x71d0('0x29')],qs['fields'](_0x440699[_0x71d0('0x2b')]['fields']));_0x388930[_0x71d0('0x2f')]=_0x388930[_0x71d0('0x2f')]['length']?_0x388930[_0x71d0('0x2f')]:_0x1d9894['model'];if(_0x440699[_0x71d0('0x2b')][_0x71d0('0x3d')]){_0x388930[_0x71d0('0x3e')]=[{'all':!![]}];}_0x388930=_[_0x71d0('0x39')]({},_0x388930,_0x440699['options']);return db[_0x71d0('0x24')][_0x71d0('0x43')](_0x388930)[_0x71d0('0x22')](handleEntityNotFound(_0x277783,null))[_0x71d0('0x22')](respondWithResult(_0x277783,null))['catch'](handleError(_0x277783,null));};exports[_0x71d0('0x44')]=function(_0x1c7374,_0x342767){return db[_0x71d0('0x24')][_0x71d0('0x44')](_0x1c7374[_0x71d0('0x45')],{})[_0x71d0('0x22')](respondWithResult(_0x342767,0xc9))['catch'](handleError(_0x342767,null));};exports[_0x71d0('0x21')]=function(_0x22ff96,_0x8936c2){if(_0x22ff96[_0x71d0('0x45')]['id']){delete _0x22ff96[_0x71d0('0x45')]['id'];}return db[_0x71d0('0x24')][_0x71d0('0x43')]({'where':{'id':_0x22ff96[_0x71d0('0x46')]['id']}})[_0x71d0('0x22')](handleEntityNotFound(_0x8936c2,null))[_0x71d0('0x22')](saveUpdates(_0x22ff96[_0x71d0('0x45')],null))[_0x71d0('0x22')](respondWithResult(_0x8936c2,null))[_0x71d0('0x41')](handleError(_0x8936c2,null));};exports[_0x71d0('0x47')]=function(_0x4082c9,_0x1978db){return db['VoiceTransferReport'][_0x71d0('0x43')]({'where':{'id':_0x4082c9['params']['id']}})[_0x71d0('0x22')](handleEntityNotFound(_0x1978db,null))[_0x71d0('0x22')](removeEntity(_0x1978db,null))[_0x71d0('0x41')](handleError(_0x1978db,null));};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js
index e05444c..684916f 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.model.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe4e2=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x35daf1,_0x346d71){var _0x311911=function(_0x12e626){while(--_0x12e626){_0x35daf1['push'](_0x35daf1['shift']());}};_0x311911(++_0x346d71);}(_0xe4e2,0x155));var _0x2e4e=function(_0x36fe63,_0x13af61){_0x36fe63=_0x36fe63-0x0;var _0x33841c=_0xe4e2[_0x36fe63];return _0x33841c;};'use strict';var _=require(_0x2e4e('0x0'));var util=require(_0x2e4e('0x1'));var logger=require('../../config/logger')(_0x2e4e('0x2'));var moment=require(_0x2e4e('0x3'));var BPromise=require(_0x2e4e('0x4'));var rp=require(_0x2e4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2e4e('0x6'));var attributes=require(_0x2e4e('0x7'));module[_0x2e4e('0x8')]=function(_0x2b503c,_0x173da3){return _0x2b503c[_0x2e4e('0x9')](_0x2e4e('0xa'),attributes,{'tableName':_0x2e4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x89f3=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash'];(function(_0x4c463a,_0x4411bb){var _0x54f816=function(_0x3086ce){while(--_0x3086ce){_0x4c463a['push'](_0x4c463a['shift']());}};_0x54f816(++_0x4411bb);}(_0x89f3,0xa8));var _0x389f=function(_0x287320,_0xf25354){_0x287320=_0x287320-0x0;var _0x141a2d=_0x89f3[_0x287320];return _0x141a2d;};'use strict';var _=require(_0x389f('0x0'));var util=require(_0x389f('0x1'));var logger=require(_0x389f('0x2'))(_0x389f('0x3'));var moment=require(_0x389f('0x4'));var BPromise=require(_0x389f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x389f('0x6'));var rimraf=require('rimraf');var config=require(_0x389f('0x7'));var attributes=require(_0x389f('0x8'));module[_0x389f('0x9')]=function(_0x1e8e3d,_0x4b7a0b){return _0x1e8e3d[_0x389f('0xa')](_0x389f('0xb'),attributes,{'tableName':_0x389f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js
index 8d1492b..2d9dac3 100644
--- a/server/api/voiceTransferReport/voiceTransferReport.rpc.js
+++ b/server/api/voiceTransferReport/voiceTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe961=['message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x541786,_0x496f28){var _0x5c0159=function(_0x319bc5){while(--_0x319bc5){_0x541786['push'](_0x541786['shift']());}};_0x5c0159(++_0x496f28);}(_0xe961,0xd3));var _0x1e96=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xe961[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x1e96('0x0'));var util=require(_0x1e96('0x1'));var moment=require(_0x1e96('0x2'));var BPromise=require(_0x1e96('0x3'));var rs=require(_0x1e96('0x4'));var fs=require('fs');var Redis=require(_0x1e96('0x5'));var db=require(_0x1e96('0x6'))['db'];var utils=require(_0x1e96('0x7'));var logger=require('../../config/logger')(_0x1e96('0x8'));var config=require(_0x1e96('0x9'));var jayson=require(_0x1e96('0xa'));var client=jayson[_0x1e96('0xb')][_0x1e96('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e518f,_0x38f013,_0x59062c){return new BPromise(function(_0x5575e8,_0x22dc95){return client[_0x1e96('0xd')](_0x2e518f,_0x59062c)[_0x1e96('0xe')](function(_0x3a744a){logger[_0x1e96('0xf')](_0x1e96('0x10'),_0x38f013,_0x1e96('0x11'));logger[_0x1e96('0x12')](_0x1e96('0x13'),_0x38f013,_0x1e96('0x11'),JSON['stringify'](_0x3a744a));if(_0x3a744a[_0x1e96('0x14')]){if(_0x3a744a[_0x1e96('0x14')]['code']===0x1f4){logger[_0x1e96('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x38f013,_0x3a744a[_0x1e96('0x14')]['message']);return _0x22dc95(_0x3a744a[_0x1e96('0x14')]['message']);}logger['error'](_0x1e96('0x10'),_0x38f013,_0x3a744a['error'][_0x1e96('0x15')]);return _0x5575e8(_0x3a744a[_0x1e96('0x14')][_0x1e96('0x15')]);}else{logger[_0x1e96('0xf')](_0x1e96('0x10'),_0x38f013,_0x1e96('0x11'));_0x5575e8(_0x3a744a[_0x1e96('0x16')][_0x1e96('0x15')]);}})[_0x1e96('0x17')](function(_0x506cd1){logger[_0x1e96('0x14')](_0x1e96('0x10'),_0x38f013,_0x506cd1);_0x22dc95(_0x506cd1);});});}exports[_0x1e96('0x18')]=function(_0x2a81f6){var _0x4a6c5d=this;return new Promise(function(_0x1fdb7b,_0x37ca9f){return db[_0x1e96('0x19')][_0x1e96('0x1a')](_0x2a81f6[_0x1e96('0x1b')],{'raw':_0x2a81f6['options']?_0x2a81f6['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3144a2){logger[_0x1e96('0xf')](_0x1e96('0x18'),_0x2a81f6);logger[_0x1e96('0x12')](_0x1e96('0x18'),_0x2a81f6,JSON[_0x1e96('0x1c')](_0x3144a2));_0x1fdb7b(_0x3144a2);})[_0x1e96('0x17')](function(_0x121fb8){logger[_0x1e96('0x14')](_0x1e96('0x18'),_0x121fb8[_0x1e96('0x15')],_0x2a81f6);_0x37ca9f(_0x4a6c5d[_0x1e96('0x14')](0x1f4,_0x121fb8[_0x1e96('0x15')]));});});};
\ No newline at end of file
+var _0x48ae=['VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','VoiceTransferReport','body','options','raw','then','CreateVoiceTransferReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info'];(function(_0xb011d6,_0x74d4eb){var _0x1e30f1=function(_0x5009ba){while(--_0x5009ba){_0xb011d6['push'](_0xb011d6['shift']());}};_0x1e30f1(++_0x74d4eb);}(_0x48ae,0x1b4));var _0xe48a=function(_0x46abb3,_0x2f61f2){_0x46abb3=_0x46abb3-0x0;var _0x32c334=_0x48ae[_0x46abb3];return _0x32c334;};'use strict';var _=require('lodash');var util=require(_0xe48a('0x0'));var moment=require(_0xe48a('0x1'));var BPromise=require(_0xe48a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe48a('0x3'));var db=require(_0xe48a('0x4'))['db'];var utils=require(_0xe48a('0x5'));var logger=require(_0xe48a('0x6'))(_0xe48a('0x7'));var config=require(_0xe48a('0x8'));var jayson=require(_0xe48a('0x9'));var client=jayson[_0xe48a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a56a7,_0x273a36,_0x164483){return new BPromise(function(_0x3f5e05,_0x3e5ed9){return client['request'](_0x3a56a7,_0x164483)['then'](function(_0x8c90f){logger[_0xe48a('0xb')](_0xe48a('0xc'),_0x273a36,'request\x20sent');logger[_0xe48a('0xd')](_0xe48a('0xe'),_0x273a36,'request\x20sent',JSON[_0xe48a('0xf')](_0x8c90f));if(_0x8c90f[_0xe48a('0x10')]){if(_0x8c90f[_0xe48a('0x10')][_0xe48a('0x11')]===0x1f4){logger[_0xe48a('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x273a36,_0x8c90f[_0xe48a('0x10')][_0xe48a('0x12')]);return _0x3e5ed9(_0x8c90f[_0xe48a('0x10')][_0xe48a('0x12')]);}logger[_0xe48a('0x10')](_0xe48a('0xc'),_0x273a36,_0x8c90f[_0xe48a('0x10')]['message']);return _0x3f5e05(_0x8c90f['error']['message']);}else{logger[_0xe48a('0xb')](_0xe48a('0xc'),_0x273a36,_0xe48a('0x13'));_0x3f5e05(_0x8c90f[_0xe48a('0x14')][_0xe48a('0x12')]);}})[_0xe48a('0x15')](function(_0x807ba5){logger['error'](_0xe48a('0xc'),_0x273a36,_0x807ba5);_0x3e5ed9(_0x807ba5);});});}exports['CreateVoiceTransferReport']=function(_0x52ef2b){var _0x10fd4d=this;return new Promise(function(_0x1938f2,_0x11b79e){return db[_0xe48a('0x16')]['create'](_0x52ef2b[_0xe48a('0x17')],{'raw':_0x52ef2b[_0xe48a('0x18')]?_0x52ef2b[_0xe48a('0x18')][_0xe48a('0x19')]===undefined?!![]:![]:!![]})[_0xe48a('0x1a')](function(_0x42835b){logger[_0xe48a('0xb')]('CreateVoiceTransferReport',_0x52ef2b);logger[_0xe48a('0xd')](_0xe48a('0x1b'),_0x52ef2b,JSON['stringify'](_0x42835b));_0x1938f2(_0x42835b);})[_0xe48a('0x15')](function(_0x21b684){logger[_0xe48a('0x10')](_0xe48a('0x1b'),_0x21b684['message'],_0x52ef2b);_0x11b79e(_0x10fd4d[_0xe48a('0x10')](0x1f4,_0x21b684[_0xe48a('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js
index 82350c4..9c11207 100644
--- a/server/api/webbar/index.js
+++ b/server/api/webbar/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a9c=['./webbar.controller','post','isAuthenticated','canUpdate','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','/transfer','transfer','express','Router','../../components/auth/service'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xc8a9('0x0'));var router=express[_0xc8a9('0x1')]();var auth=require(_0xc8a9('0x2'));var controller=require(_0xc8a9('0x3'));router[_0xc8a9('0x4')]('/originate',auth[_0xc8a9('0x5')](),auth[_0xc8a9('0x6')](),controller['originate']);router[_0xc8a9('0x4')](_0xc8a9('0x7'),auth[_0xc8a9('0x5')](),auth['canUpdate'](),controller[_0xc8a9('0x8')]);router[_0xc8a9('0x4')](_0xc8a9('0x9'),auth[_0xc8a9('0x5')](),auth[_0xc8a9('0x6')](),controller[_0xc8a9('0xa')]);router[_0xc8a9('0x4')](_0xc8a9('0xb'),auth[_0xc8a9('0x5')](),auth['canUpdate'](),controller['hold']);router[_0xc8a9('0x4')](_0xc8a9('0xc'),auth['isAuthenticated'](),auth[_0xc8a9('0x6')](),controller['unhold']);router[_0xc8a9('0x4')](_0xc8a9('0xd'),auth['isAuthenticated'](),auth[_0xc8a9('0x6')](),controller['calls']);router[_0xc8a9('0x4')](_0xc8a9('0xe'),auth[_0xc8a9('0x5')](),auth[_0xc8a9('0x6')](),controller[_0xc8a9('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xb3ea=['/calls','/transfer','transfer','express','Router','../../components/auth/service','post','isAuthenticated','originate','/hangup','canUpdate','/hold','hold','unhold'];(function(_0x391df0,_0x51b2dc){var _0x30bec6=function(_0x2899b1){while(--_0x2899b1){_0x391df0['push'](_0x391df0['shift']());}};_0x30bec6(++_0x51b2dc);}(_0xb3ea,0x10d));var _0xab3e=function(_0x21465d,_0x31a31d){_0x21465d=_0x21465d-0x0;var _0x5d843c=_0xb3ea[_0x21465d];return _0x5d843c;};'use strict';var express=require(_0xab3e('0x0'));var router=express[_0xab3e('0x1')]();var auth=require(_0xab3e('0x2'));var controller=require('./webbar.controller');router[_0xab3e('0x3')]('/originate',auth[_0xab3e('0x4')](),auth['canUpdate'](),controller[_0xab3e('0x5')]);router[_0xab3e('0x3')](_0xab3e('0x6'),auth[_0xab3e('0x4')](),auth[_0xab3e('0x7')](),controller['hangup']);router[_0xab3e('0x3')]('/answer',auth[_0xab3e('0x4')](),auth[_0xab3e('0x7')](),controller['answer']);router[_0xab3e('0x3')](_0xab3e('0x8'),auth['isAuthenticated'](),auth[_0xab3e('0x7')](),controller[_0xab3e('0x9')]);router['post']('/unhold',auth[_0xab3e('0x4')](),auth[_0xab3e('0x7')](),controller[_0xab3e('0xa')]);router[_0xab3e('0x3')](_0xab3e('0xb'),auth[_0xab3e('0x4')](),auth['canUpdate'](),controller['calls']);router['post'](_0xab3e('0xc'),auth[_0xab3e('0x4')](),auth[_0xab3e('0x7')](),controller[_0xab3e('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js
index dce0d45..e83d691 100644
--- a/server/api/webbar/webbar.controller.js
+++ b/server/api/webbar/webbar.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x03cf=['entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','webbar:hold','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transfer\x20executed!','lodash','../../mysqldb','bluebird','client','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','log','error','stack','name','send','status','NotFound','message','result','User','findOne','agent','then','VoiceChannels','all','filter','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','length','json','userId','callNumber'];(function(_0x570c85,_0x18d065){var _0x2055e5=function(_0xf49b21){while(--_0xf49b21){_0x570c85['push'](_0x570c85['shift']());}};_0x2055e5(++_0x18d065);}(_0x03cf,0x64));var _0xf03c=function(_0x262e6b,_0x2bd4c7){_0x262e6b=_0x262e6b-0x0;var _0x3c5fea=_0x03cf[_0x262e6b];return _0x3c5fea;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xf03c('0x0'));var db=require(_0xf03c('0x1'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0xf03c('0x2'));var jayson=require('jayson/promise');var amiClient=jayson[_0xf03c('0x3')]['http']({'port':0x232a});var logger=require(_0xf03c('0x4'))(_0xf03c('0x5'));var Redis=require(_0xf03c('0x6'));config['redis']=_[_0xf03c('0x7')](config[_0xf03c('0x8')],{'host':_0xf03c('0x9'),'port':0x18eb});var io=require(_0xf03c('0xa'))(new Redis(config[_0xf03c('0x8')]));var Schema=require(_0xf03c('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf03c('0xc')]},'callNumber':{'type':_0xf03c('0xd'),'required':[!![],_0xf03c('0xe')]},'callerId':{'type':_0xf03c('0xd')},'callbackUrl':{'type':_0xf03c('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xf03c('0xf'),'required':[!![],_0xf03c('0xc')]},'sessionId':{'type':_0xf03c('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf03c('0xf'),'required':[!![],_0xf03c('0xc')]},'sessionId':{'type':_0xf03c('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf03c('0xf'),'required':[!![],_0xf03c('0xc')]},'sessionId':{'type':'string','required':[!![],_0xf03c('0x10')]},'transferNumber':{'type':_0xf03c('0xd'),'required':[!![],_0xf03c('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf03c('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf03c('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf03c('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf03c('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf03c('0xf'),'required':[!![],_0xf03c('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf03c('0xc')]}});function emit(_0x4d0994,_0x30c66e,_0x10545f){logger['info'](_0x4d0994,_0x30c66e,JSON['stringify'](_0x10545f));io['to'](_0x4d0994)['emit'](_0x30c66e,_0x10545f);}function handleError(_0x30de55){return function(_0x1fafb3){console[_0xf03c('0x12')]('handleError:',_0x1fafb3,_0x1fafb3 instanceof RangeError);logger[_0xf03c('0x13')](_0x1fafb3[_0xf03c('0x14')]);if(_0x1fafb3 instanceof RangeError){if(_0x1fafb3[_0xf03c('0x15')]){delete _0x1fafb3[_0xf03c('0x15')];}_0x30de55['status'](0x194)[_0xf03c('0x16')](_0x1fafb3);}else{if(_0x1fafb3[_0xf03c('0x15')]){delete _0x1fafb3[_0xf03c('0x15')];}_0x30de55[_0xf03c('0x17')](0x1f4)[_0xf03c('0x16')](_0x1fafb3);}};}function checkError(){return function(_0x48007b){if(!_0x48007b){throw new RangeError(_0xf03c('0x18'));}return _0x48007b;};}function respondWithRpcPromise(_0x418e5c,_0x57b153){return new BPromise(function(_0x5953bb,_0x22e4b6){var _0x2474da=amiClient;return _0x2474da['request'](_0x418e5c,_0x57b153)['then'](function(_0x5e76f4){if(_0x5e76f4['error']){if(_0x5e76f4[_0xf03c('0x13')]['code']===0x1f4){return _0x22e4b6(_0x5e76f4[_0xf03c('0x13')][_0xf03c('0x19')]);}return _0x5953bb(_0x5e76f4[_0xf03c('0x13')][_0xf03c('0x19')]);}else{_0x5953bb(_0x5e76f4[_0xf03c('0x1a')]);}})['catch'](function(_0x272408){_0x22e4b6(_0x272408);});});}function getAgent(_0x44da09){return db[_0xf03c('0x1b')][_0xf03c('0x1c')]({'where':{'id':_0x44da09,'role':_0xf03c('0x1d')}})[_0xf03c('0x1e')](checkError());}function getAgentCheckSession(_0x4ae35d,_0x5ba510){return new BPromise(function(_0xb671e2,_0x4671e3){var _0x44795c=respondWithRpcPromise(_0xf03c('0x1f'));var _0x343222=getAgent(_0x4ae35d);Promise[_0xf03c('0x20')]([_0x44795c,_0x343222])[_0xf03c('0x1e')](function(_0x4353b0){var _0x2a6885=_0x4353b0[0x0];var _0x5b2d59=_0x4353b0[0x1];var _0x1df90f=_[_0xf03c('0x21')](_0x2a6885['rows'],function(_0x258e37){return _0x258e37[_0xf03c('0x22')]==_0x5b2d59['id']&&_0x258e37[_0xf03c('0x23')]==_0x5ba510;});if(_0x1df90f['length']==0x1){_0xb671e2(_0x5b2d59);}else{_0x4671e3(new RangeError(_0xf03c('0x24')+_0x5ba510+_0xf03c('0x25')));}});});}exports[_0xf03c('0x26')]=function(_0x53d5ae,_0x306511){logger[_0xf03c('0x27')](_0xf03c('0x28'),_0x53d5ae['body']);var _0x5dda04=originateValidation[_0xf03c('0xb')](_0x53d5ae[_0xf03c('0x29')]);if(_0x5dda04[_0xf03c('0x2a')]>0x0){return _0x306511[_0xf03c('0x17')](0x190)[_0xf03c('0x2b')](_0x5dda04);}var _0x1e4076=_0x53d5ae['body'][_0xf03c('0x2c')];var _0xb155e0=_0x53d5ae['body'][_0xf03c('0x2d')];var _0xd095dc=_0x53d5ae[_0xf03c('0x29')]['callerId'];var _0x57bd41=_0x53d5ae[_0xf03c('0x29')]['callbackUrl'];return getAgent(_0x1e4076)[_0xf03c('0x1e')](function(_0x4465f7){logger[_0xf03c('0x27')](_0xf03c('0x2e'),_0x4465f7[_0xf03c('0x15')]);emit(util[_0xf03c('0x2f')](_0xf03c('0x30'),_0x4465f7['name']),_0xf03c('0x31'),{'callNumber':_0xb155e0,'callerId':_0xd095dc,'callbackUrl':_0x57bd41});return _0x306511[_0xf03c('0x17')](0xc8)[_0xf03c('0x2b')]({'error':![],'message':_0xf03c('0x32')});})[_0xf03c('0x33')](handleError(_0x306511));};exports[_0xf03c('0x34')]=function(_0x2cec14,_0x4dadbc){logger[_0xf03c('0x27')]('hangup\x20fired:',_0x2cec14[_0xf03c('0x29')]);var _0x2bc026=hangupValidation[_0xf03c('0xb')](_0x2cec14['body']);if(_0x2bc026[_0xf03c('0x2a')]>0x0){return _0x4dadbc[_0xf03c('0x17')](0x190)[_0xf03c('0x2b')](_0x2bc026);}var _0x2cfcd8=_0x2cec14['body'][_0xf03c('0x2c')];var _0x3f0817=_0x2cec14[_0xf03c('0x29')][_0xf03c('0x23')];return getAgent(_0x2cfcd8)[_0xf03c('0x1e')](function(_0x5c7f89){logger['info']('entityFound:',_0x5c7f89['name']);emit(util[_0xf03c('0x2f')](_0xf03c('0x30'),_0x5c7f89[_0xf03c('0x15')]),'webbar:hangup',{'sessionId':_0x3f0817});return _0x4dadbc[_0xf03c('0x17')](0xc8)[_0xf03c('0x2b')]({'error':![],'message':_0xf03c('0x35')});})[_0xf03c('0x33')](handleError(_0x4dadbc));};exports[_0xf03c('0x36')]=function(_0x8054d,_0x256742){logger['info'](_0xf03c('0x37'),_0x8054d[_0xf03c('0x29')]);var _0x3669aa=answerValidation[_0xf03c('0xb')](_0x8054d[_0xf03c('0x29')]);if(_0x3669aa[_0xf03c('0x2a')]>0x0){return _0x256742[_0xf03c('0x17')](0x190)['json'](_0x3669aa);}var _0x2603c8=_0x8054d[_0xf03c('0x29')][_0xf03c('0x2c')];var _0x246a5e=_0x8054d['body'][_0xf03c('0x23')];return getAgent(_0x2603c8)[_0xf03c('0x1e')](function(_0xf84b26){logger[_0xf03c('0x27')](_0xf03c('0x2e'),_0xf84b26[_0xf03c('0x15')]);emit(util[_0xf03c('0x2f')](_0xf03c('0x30'),_0xf84b26[_0xf03c('0x15')]),_0xf03c('0x38'),{'sessionId':_0x246a5e});return _0x256742[_0xf03c('0x17')](0xc8)[_0xf03c('0x2b')]({'error':![],'message':_0xf03c('0x39')});})[_0xf03c('0x33')](handleError(_0x256742));};exports[_0xf03c('0x3a')]=function(_0x11342d,_0x15356c){logger['info']('hold\x20fired:',_0x11342d[_0xf03c('0x29')]);var _0x4ebc52=holdValidation['validate'](_0x11342d[_0xf03c('0x29')]);if(_0x4ebc52['length']>0x0){return _0x15356c[_0xf03c('0x17')](0x190)['json'](_0x4ebc52);}var _0x1bd628=_0x11342d['body'][_0xf03c('0x2c')];var _0x38af6f=_0x11342d[_0xf03c('0x29')][_0xf03c('0x23')];return getAgent(_0x1bd628)[_0xf03c('0x1e')](function(_0x47eb40){logger[_0xf03c('0x27')](_0xf03c('0x2e'),_0x47eb40[_0xf03c('0x15')]);emit(util[_0xf03c('0x2f')]('user:%s',_0x47eb40[_0xf03c('0x15')]),_0xf03c('0x3b'),{'sessionId':_0x38af6f});return _0x15356c['status'](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0xf03c('0x33')](handleError(_0x15356c));};exports[_0xf03c('0x3c')]=function(_0x144d3a,_0x68047a){logger[_0xf03c('0x27')](_0xf03c('0x3d'),_0x144d3a[_0xf03c('0x29')]);var _0x22695c=unholdValidation[_0xf03c('0xb')](_0x144d3a[_0xf03c('0x29')]);if(_0x22695c[_0xf03c('0x2a')]>0x0){return _0x68047a['status'](0x190)[_0xf03c('0x2b')](_0x22695c);}var _0x45e707=_0x144d3a['body']['userId'];var _0x16c2d2=_0x144d3a[_0xf03c('0x29')][_0xf03c('0x23')];return getAgent(_0x45e707)['then'](function(_0xea7430){logger[_0xf03c('0x27')]('entityFound:',_0xea7430[_0xf03c('0x15')]);emit(util[_0xf03c('0x2f')](_0xf03c('0x30'),_0xea7430[_0xf03c('0x15')]),'webbar:unhold',{'sessionId':_0x16c2d2});return _0x68047a[_0xf03c('0x17')](0xc8)[_0xf03c('0x2b')]({'error':![],'message':_0xf03c('0x3e')});})['catch'](handleError(_0x68047a));};exports[_0xf03c('0x3f')]=function(_0x356c16,_0x1c9226){logger[_0xf03c('0x27')](_0xf03c('0x40'),_0x1c9226['body']);var _0x3766e3=callsValidation[_0xf03c('0xb')](_0x356c16['body']);if(_0x3766e3[_0xf03c('0x2a')]>0x0){return _0x1c9226[_0xf03c('0x17')](0x190)[_0xf03c('0x2b')](_0x3766e3);}var _0x3c3d6e=_0x356c16[_0xf03c('0x29')]['userId'];var _0x29b325=respondWithRpcPromise(_0xf03c('0x1f'));var _0x1429fa=getAgent(_0x3c3d6e);return Promise[_0xf03c('0x20')]([_0x29b325,_0x1429fa])[_0xf03c('0x1e')](function(_0x529171){var _0x25da2d=_0x529171[0x0];var _0x578c4e=_0x529171[0x1];var _0x26f339=_[_0xf03c('0x21')](_0x25da2d[_0xf03c('0x41')],function(_0x388a7e){return _0x388a7e[_0xf03c('0x22')]==_0x578c4e['id'];});return _0x1c9226[_0xf03c('0x17')](0xc8)[_0xf03c('0x2b')]({'count':_0x26f339['length'],'rows':_0x26f339});})[_0xf03c('0x33')](handleError(_0x1c9226));};exports[_0xf03c('0x42')]=function(_0x74d560,_0x2b3083){logger[_0xf03c('0x27')](_0xf03c('0x43'),_0x74d560[_0xf03c('0x29')]);var _0x59f165=conferenceValidation['validate'](_0x74d560[_0xf03c('0x29')]);if(_0x59f165[_0xf03c('0x2a')]>0x0){return _0x2b3083[_0xf03c('0x17')](0x190)[_0xf03c('0x2b')](_0x59f165);}var _0x41ed5b=_0x74d560[_0xf03c('0x29')][_0xf03c('0x2c')];return getAgent(_0x41ed5b)[_0xf03c('0x1e')](function(_0x19acd5){logger[_0xf03c('0x27')](_0xf03c('0x2e'),_0x19acd5[_0xf03c('0x15')]);emit(util[_0xf03c('0x2f')](_0xf03c('0x30'),_0x19acd5['name']),_0xf03c('0x44'));return _0x2b3083[_0xf03c('0x17')](0xc8)[_0xf03c('0x2b')]({'error':![],'message':_0xf03c('0x45')});})[_0xf03c('0x33')](handleError(_0x2b3083));};exports[_0xf03c('0x46')]=function(_0x4b9bbd,_0x5d38b2){logger[_0xf03c('0x27')](_0xf03c('0x47'),_0x4b9bbd[_0xf03c('0x29')]);var _0x5162a2=transferValidation[_0xf03c('0xb')](_0x4b9bbd[_0xf03c('0x29')]);if(_0x5162a2[_0xf03c('0x2a')]>0x0){return _0x5d38b2[_0xf03c('0x17')](0x190)[_0xf03c('0x2b')](_0x5162a2);}var _0x1954d3=_0x4b9bbd[_0xf03c('0x29')][_0xf03c('0x2c')];var _0x3e143a=_0x4b9bbd[_0xf03c('0x29')][_0xf03c('0x23')];var _0x553abd=_0x4b9bbd[_0xf03c('0x29')]['transferNumber'];return getAgent(_0x1954d3)['then'](function(_0x478869){logger[_0xf03c('0x27')](_0xf03c('0x2e'),_0x478869[_0xf03c('0x15')]);emit(util[_0xf03c('0x2f')](_0xf03c('0x30'),_0x478869[_0xf03c('0x15')]),'webbar:transfer',{'sessionId':_0x3e143a,'transferNumber':_0x553abd});return _0x5d38b2[_0xf03c('0x17')](0xc8)['json']({'error':![],'message':_0xf03c('0x48')});})[_0xf03c('0x33')](handleError(_0x5d38b2));};
\ No newline at end of file
+var _0x9c64=['sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','error','stack','name','status','send','request','then','message','result','catch','User','findOne','agent','VoiceChannels','filter','rows','UserId','sessionId','sessionId\x20','originate\x20fired:','body','length','json','userId','callerId','callbackUrl','entityFound:','webbar:originate','originate\x20executed!','hangup','format','user:%s','webbar:hangup','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required'];(function(_0x1c2aeb,_0x48433c){var _0x783379=function(_0x3e8820){while(--_0x3e8820){_0x1c2aeb['push'](_0x1c2aeb['shift']());}};_0x783379(++_0x48433c);}(_0x9c64,0x16a));var _0x49c6=function(_0x12ecef,_0x6edc){_0x12ecef=_0x12ecef-0x0;var _0x47c207=_0x9c64[_0x12ecef];return _0x47c207;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x49c6('0x0'));var db=require(_0x49c6('0x1'))['db'];var config=require(_0x49c6('0x2'));var util=require(_0x49c6('0x3'));var BPromise=require(_0x49c6('0x4'));var jayson=require(_0x49c6('0x5'));var amiClient=jayson[_0x49c6('0x6')][_0x49c6('0x7')]({'port':0x232a});var logger=require(_0x49c6('0x8'))(_0x49c6('0x9'));var Redis=require(_0x49c6('0xa'));config[_0x49c6('0xb')]=_[_0x49c6('0xc')](config[_0x49c6('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x49c6('0xb')]));var Schema=require(_0x49c6('0xd'));var originateValidation=new Schema({'userId':{'type':_0x49c6('0xe'),'required':[!![],_0x49c6('0xf')]},'callNumber':{'type':_0x49c6('0x10'),'required':[!![],_0x49c6('0x11')]},'callerId':{'type':_0x49c6('0x10')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x49c6('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x49c6('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x49c6('0xe'),'required':[!![],_0x49c6('0xf')]},'sessionId':{'type':_0x49c6('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x49c6('0xe'),'required':[!![],_0x49c6('0xf')]},'sessionId':{'type':_0x49c6('0x10'),'required':[!![],_0x49c6('0x12')]},'transferNumber':{'type':_0x49c6('0x10'),'required':[!![],_0x49c6('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x49c6('0xf')]},'sessionId':{'type':_0x49c6('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x49c6('0xe'),'required':[!![],_0x49c6('0xf')]},'sessionId':{'type':_0x49c6('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x49c6('0xe'),'required':[!![],_0x49c6('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x49c6('0xe'),'required':[!![],_0x49c6('0xf')]}});function emit(_0x4d6563,_0x1181a8,_0x4e9766){logger[_0x49c6('0x14')](_0x4d6563,_0x1181a8,JSON[_0x49c6('0x15')](_0x4e9766));io['to'](_0x4d6563)[_0x49c6('0x16')](_0x1181a8,_0x4e9766);}function handleError(_0x16a21c){return function(_0x1e9e9a){console['log']('handleError:',_0x1e9e9a,_0x1e9e9a instanceof RangeError);logger[_0x49c6('0x17')](_0x1e9e9a[_0x49c6('0x18')]);if(_0x1e9e9a instanceof RangeError){if(_0x1e9e9a[_0x49c6('0x19')]){delete _0x1e9e9a[_0x49c6('0x19')];}_0x16a21c[_0x49c6('0x1a')](0x194)['send'](_0x1e9e9a);}else{if(_0x1e9e9a[_0x49c6('0x19')]){delete _0x1e9e9a['name'];}_0x16a21c[_0x49c6('0x1a')](0x1f4)[_0x49c6('0x1b')](_0x1e9e9a);}};}function checkError(){return function(_0x13ebab){if(!_0x13ebab){throw new RangeError('NotFound');}return _0x13ebab;};}function respondWithRpcPromise(_0x20ec87,_0x257e32){return new BPromise(function(_0x1d6538,_0x36f412){var _0x402f0c=amiClient;return _0x402f0c[_0x49c6('0x1c')](_0x20ec87,_0x257e32)[_0x49c6('0x1d')](function(_0x3fef72){if(_0x3fef72[_0x49c6('0x17')]){if(_0x3fef72[_0x49c6('0x17')]['code']===0x1f4){return _0x36f412(_0x3fef72[_0x49c6('0x17')]['message']);}return _0x1d6538(_0x3fef72[_0x49c6('0x17')][_0x49c6('0x1e')]);}else{_0x1d6538(_0x3fef72[_0x49c6('0x1f')]);}})[_0x49c6('0x20')](function(_0x300863){_0x36f412(_0x300863);});});}function getAgent(_0x173402){return db[_0x49c6('0x21')][_0x49c6('0x22')]({'where':{'id':_0x173402,'role':_0x49c6('0x23')}})[_0x49c6('0x1d')](checkError());}function getAgentCheckSession(_0x3d5bca,_0x3e8b92){return new BPromise(function(_0x14c813,_0x7eaa0b){var _0x572ced=respondWithRpcPromise(_0x49c6('0x24'));var _0xcecbd2=getAgent(_0x3d5bca);Promise['all']([_0x572ced,_0xcecbd2])['then'](function(_0x28d137){var _0x604c86=_0x28d137[0x0];var _0x3b0e35=_0x28d137[0x1];var _0x36f283=_[_0x49c6('0x25')](_0x604c86[_0x49c6('0x26')],function(_0x5a544a){return _0x5a544a[_0x49c6('0x27')]==_0x3b0e35['id']&&_0x5a544a[_0x49c6('0x28')]==_0x3e8b92;});if(_0x36f283['length']==0x1){_0x14c813(_0x3b0e35);}else{_0x7eaa0b(new RangeError(_0x49c6('0x29')+_0x3e8b92+'\x20not\x20found!'));}});});}exports['originate']=function(_0x4afd2d,_0x2086c0){logger[_0x49c6('0x14')](_0x49c6('0x2a'),_0x4afd2d[_0x49c6('0x2b')]);var _0x5c4d46=originateValidation[_0x49c6('0xd')](_0x4afd2d[_0x49c6('0x2b')]);if(_0x5c4d46[_0x49c6('0x2c')]>0x0){return _0x2086c0['status'](0x190)[_0x49c6('0x2d')](_0x5c4d46);}var _0x4ba9b8=_0x4afd2d[_0x49c6('0x2b')][_0x49c6('0x2e')];var _0x319639=_0x4afd2d[_0x49c6('0x2b')]['callNumber'];var _0xa7d49b=_0x4afd2d[_0x49c6('0x2b')][_0x49c6('0x2f')];var _0x457dda=_0x4afd2d[_0x49c6('0x2b')][_0x49c6('0x30')];return getAgent(_0x4ba9b8)[_0x49c6('0x1d')](function(_0x2be6d4){logger['info'](_0x49c6('0x31'),_0x2be6d4[_0x49c6('0x19')]);emit(util['format']('user:%s',_0x2be6d4['name']),_0x49c6('0x32'),{'callNumber':_0x319639,'callerId':_0xa7d49b,'callbackUrl':_0x457dda});return _0x2086c0[_0x49c6('0x1a')](0xc8)[_0x49c6('0x2d')]({'error':![],'message':_0x49c6('0x33')});})[_0x49c6('0x20')](handleError(_0x2086c0));};exports[_0x49c6('0x34')]=function(_0x41fd61,_0x29491b){logger[_0x49c6('0x14')]('hangup\x20fired:',_0x41fd61[_0x49c6('0x2b')]);var _0x23a90d=hangupValidation['validate'](_0x41fd61[_0x49c6('0x2b')]);if(_0x23a90d[_0x49c6('0x2c')]>0x0){return _0x29491b[_0x49c6('0x1a')](0x190)[_0x49c6('0x2d')](_0x23a90d);}var _0x219491=_0x41fd61[_0x49c6('0x2b')]['userId'];var _0x1dbf13=_0x41fd61[_0x49c6('0x2b')][_0x49c6('0x28')];return getAgent(_0x219491)[_0x49c6('0x1d')](function(_0x429ac8){logger['info']('entityFound:',_0x429ac8[_0x49c6('0x19')]);emit(util[_0x49c6('0x35')](_0x49c6('0x36'),_0x429ac8[_0x49c6('0x19')]),_0x49c6('0x37'),{'sessionId':_0x1dbf13});return _0x29491b[_0x49c6('0x1a')](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})[_0x49c6('0x20')](handleError(_0x29491b));};exports[_0x49c6('0x38')]=function(_0x2e9128,_0x32ac66){logger[_0x49c6('0x14')]('answer\x20fired:',_0x2e9128[_0x49c6('0x2b')]);var _0x38a841=answerValidation['validate'](_0x2e9128[_0x49c6('0x2b')]);if(_0x38a841[_0x49c6('0x2c')]>0x0){return _0x32ac66[_0x49c6('0x1a')](0x190)[_0x49c6('0x2d')](_0x38a841);}var _0x2f64e7=_0x2e9128[_0x49c6('0x2b')][_0x49c6('0x2e')];var _0xa950dd=_0x2e9128['body'][_0x49c6('0x28')];return getAgent(_0x2f64e7)[_0x49c6('0x1d')](function(_0xb1b8a7){logger['info']('entityFound:',_0xb1b8a7[_0x49c6('0x19')]);emit(util[_0x49c6('0x35')](_0x49c6('0x36'),_0xb1b8a7['name']),_0x49c6('0x39'),{'sessionId':_0xa950dd});return _0x32ac66[_0x49c6('0x1a')](0xc8)[_0x49c6('0x2d')]({'error':![],'message':_0x49c6('0x3a')});})['catch'](handleError(_0x32ac66));};exports[_0x49c6('0x3b')]=function(_0x15bc42,_0x218afa){logger['info'](_0x49c6('0x3c'),_0x15bc42[_0x49c6('0x2b')]);var _0x52f182=holdValidation[_0x49c6('0xd')](_0x15bc42['body']);if(_0x52f182[_0x49c6('0x2c')]>0x0){return _0x218afa[_0x49c6('0x1a')](0x190)[_0x49c6('0x2d')](_0x52f182);}var _0x14a359=_0x15bc42[_0x49c6('0x2b')][_0x49c6('0x2e')];var _0x17fc7d=_0x15bc42[_0x49c6('0x2b')][_0x49c6('0x28')];return getAgent(_0x14a359)['then'](function(_0x587464){logger[_0x49c6('0x14')](_0x49c6('0x31'),_0x587464[_0x49c6('0x19')]);emit(util[_0x49c6('0x35')](_0x49c6('0x36'),_0x587464[_0x49c6('0x19')]),_0x49c6('0x3d'),{'sessionId':_0x17fc7d});return _0x218afa['status'](0xc8)[_0x49c6('0x2d')]({'error':![],'message':_0x49c6('0x3e')});})[_0x49c6('0x20')](handleError(_0x218afa));};exports[_0x49c6('0x3f')]=function(_0x3aa996,_0x4d1fab){logger[_0x49c6('0x14')](_0x49c6('0x40'),_0x3aa996[_0x49c6('0x2b')]);var _0x3cc9e0=unholdValidation['validate'](_0x3aa996[_0x49c6('0x2b')]);if(_0x3cc9e0[_0x49c6('0x2c')]>0x0){return _0x4d1fab[_0x49c6('0x1a')](0x190)[_0x49c6('0x2d')](_0x3cc9e0);}var _0x3aed2c=_0x3aa996[_0x49c6('0x2b')][_0x49c6('0x2e')];var _0x1e1b55=_0x3aa996['body'][_0x49c6('0x28')];return getAgent(_0x3aed2c)[_0x49c6('0x1d')](function(_0x150cf3){logger[_0x49c6('0x14')]('entityFound:',_0x150cf3[_0x49c6('0x19')]);emit(util['format']('user:%s',_0x150cf3[_0x49c6('0x19')]),_0x49c6('0x41'),{'sessionId':_0x1e1b55});return _0x4d1fab[_0x49c6('0x1a')](0xc8)[_0x49c6('0x2d')]({'error':![],'message':_0x49c6('0x42')});})[_0x49c6('0x20')](handleError(_0x4d1fab));};exports[_0x49c6('0x43')]=function(_0x255afb,_0x533ed4){logger[_0x49c6('0x14')](_0x49c6('0x44'),_0x533ed4['body']);var _0x34c7ca=callsValidation[_0x49c6('0xd')](_0x255afb[_0x49c6('0x2b')]);if(_0x34c7ca[_0x49c6('0x2c')]>0x0){return _0x533ed4[_0x49c6('0x1a')](0x190)[_0x49c6('0x2d')](_0x34c7ca);}var _0x5d7144=_0x255afb['body'][_0x49c6('0x2e')];var _0x2aa3b5=respondWithRpcPromise(_0x49c6('0x24'));var _0x32494c=getAgent(_0x5d7144);return Promise['all']([_0x2aa3b5,_0x32494c])[_0x49c6('0x1d')](function(_0x112216){var _0x437206=_0x112216[0x0];var _0x2c3891=_0x112216[0x1];var _0x3c0f91=_[_0x49c6('0x25')](_0x437206['rows'],function(_0x43f816){return _0x43f816[_0x49c6('0x27')]==_0x2c3891['id'];});return _0x533ed4[_0x49c6('0x1a')](0xc8)[_0x49c6('0x2d')]({'count':_0x3c0f91[_0x49c6('0x2c')],'rows':_0x3c0f91});})[_0x49c6('0x20')](handleError(_0x533ed4));};exports[_0x49c6('0x45')]=function(_0x7340a8,_0x390348){logger[_0x49c6('0x14')]('conference\x20fired:',_0x7340a8[_0x49c6('0x2b')]);var _0x1a03c4=conferenceValidation[_0x49c6('0xd')](_0x7340a8[_0x49c6('0x2b')]);if(_0x1a03c4[_0x49c6('0x2c')]>0x0){return _0x390348[_0x49c6('0x1a')](0x190)[_0x49c6('0x2d')](_0x1a03c4);}var _0x321c9f=_0x7340a8[_0x49c6('0x2b')][_0x49c6('0x2e')];return getAgent(_0x321c9f)[_0x49c6('0x1d')](function(_0x26a132){logger[_0x49c6('0x14')]('entityFound:',_0x26a132[_0x49c6('0x19')]);emit(util['format'](_0x49c6('0x36'),_0x26a132['name']),_0x49c6('0x46'));return _0x390348[_0x49c6('0x1a')](0xc8)[_0x49c6('0x2d')]({'error':![],'message':_0x49c6('0x47')});})['catch'](handleError(_0x390348));};exports['transfer']=function(_0x103350,_0x3ff372){logger[_0x49c6('0x14')](_0x49c6('0x48'),_0x103350[_0x49c6('0x2b')]);var _0x3d26b3=transferValidation[_0x49c6('0xd')](_0x103350['body']);if(_0x3d26b3['length']>0x0){return _0x3ff372['status'](0x190)[_0x49c6('0x2d')](_0x3d26b3);}var _0xc7c8a2=_0x103350[_0x49c6('0x2b')][_0x49c6('0x2e')];var _0xdab2c9=_0x103350[_0x49c6('0x2b')][_0x49c6('0x28')];var _0x2b560b=_0x103350['body'][_0x49c6('0x49')];return getAgent(_0xc7c8a2)['then'](function(_0x31a144){logger[_0x49c6('0x14')](_0x49c6('0x31'),_0x31a144[_0x49c6('0x19')]);emit(util[_0x49c6('0x35')](_0x49c6('0x36'),_0x31a144[_0x49c6('0x19')]),_0x49c6('0x4a'),{'sessionId':_0xdab2c9,'transferNumber':_0x2b560b});return _0x3ff372[_0x49c6('0x1a')](0xc8)[_0x49c6('0x2d')]({'error':![],'message':_0x49c6('0x4b')});})[_0x49c6('0x20')](handleError(_0x3ff372));};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js
index 6ed0974..00b89e3 100644
--- a/server/api/whatsappAccount/index.js
+++ b/server/api/whatsappAccount/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd713=['../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','/:id/notify','/:id/send','put','update','delete','destroy','removeAnswers','removeAgents','connect-timeout','express','../../components/auth/service'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd713,0xf5));var _0x3d71=function(_0x583517,_0x43f182){_0x583517=_0x583517-0x0;var _0x503f7b=_0xd713[_0x583517];return _0x503f7b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3d71('0x0'));var express=require(_0x3d71('0x1'));var router=express['Router']();var auth=require(_0x3d71('0x2'));var interaction=require(_0x3d71('0x3'));var config=require(_0x3d71('0x4'));var controller=require(_0x3d71('0x5'));router[_0x3d71('0x6')]('/',auth[_0x3d71('0x7')](),controller[_0x3d71('0x8')]);router[_0x3d71('0x6')](_0x3d71('0x9'),auth[_0x3d71('0x7')](),controller[_0x3d71('0xa')]);router[_0x3d71('0x6')](_0x3d71('0xb'),auth['isAuthenticated'](),controller[_0x3d71('0xc')]);router[_0x3d71('0x6')](_0x3d71('0xd'),auth['isAuthenticated'](),controller[_0x3d71('0xe')]);router[_0x3d71('0x6')](_0x3d71('0xf'),auth[_0x3d71('0x7')](),controller[_0x3d71('0x10')]);router['get'](_0x3d71('0x11'),auth[_0x3d71('0x7')](),controller['getAgents']);router['get'](_0x3d71('0x12'),auth[_0x3d71('0x7')](),controller[_0x3d71('0x13')]);router['post']('/',auth[_0x3d71('0x7')](),controller['create']);router[_0x3d71('0x14')](_0x3d71('0xd'),auth['isAuthenticated'](),controller[_0x3d71('0x15')]);router[_0x3d71('0x14')](_0x3d71('0xf'),auth[_0x3d71('0x7')](),controller[_0x3d71('0x16')]);router[_0x3d71('0x14')](_0x3d71('0x11'),auth[_0x3d71('0x7')](),controller['addAgents']);router['post'](_0x3d71('0x12'),auth['isAuthenticated'](),controller['addApplications']);router[_0x3d71('0x14')](_0x3d71('0x17'),controller['notify']);router['post'](_0x3d71('0x18'),auth['isAuthenticated'](),controller['send']);router[_0x3d71('0x19')](_0x3d71('0xb'),auth[_0x3d71('0x7')](),controller[_0x3d71('0x1a')]);router[_0x3d71('0x1b')](_0x3d71('0xb'),auth['isAuthenticated'](),controller[_0x3d71('0x1c')]);router[_0x3d71('0x1b')](_0x3d71('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x3d71('0xf'),auth[_0x3d71('0x7')](),controller[_0x3d71('0x1d')]);router['delete']('/:id/users',auth[_0x3d71('0x7')](),controller[_0x3d71('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x285f=['/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','getDispositions','getAnswers','post','create','/:id/dispositions','addDisposition','/:id/users','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','send','put','update','/:id','destroy','delete','removeDispositions'];(function(_0x44b9a7,_0x5eec25){var _0x20156b=function(_0x3906f5){while(--_0x3906f5){_0x44b9a7['push'](_0x44b9a7['shift']());}};_0x20156b(++_0x5eec25);}(_0x285f,0x76));var _0xf285=function(_0x4f7434,_0x4eab7d){_0x4f7434=_0x4f7434-0x0;var _0x360b23=_0x285f[_0x4f7434];return _0x360b23;};'use strict';var multer=require(_0xf285('0x0'));var util=require(_0xf285('0x1'));var path=require(_0xf285('0x2'));var timeout=require(_0xf285('0x3'));var express=require(_0xf285('0x4'));var router=express['Router']();var auth=require(_0xf285('0x5'));var interaction=require(_0xf285('0x6'));var config=require(_0xf285('0x7'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0xf285('0x8')](),controller[_0xf285('0x9')]);router[_0xf285('0xa')](_0xf285('0xb'),auth['isAuthenticated'](),controller[_0xf285('0xc')]);router[_0xf285('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf285('0xd')]);router[_0xf285('0xa')]('/:id/dispositions',auth[_0xf285('0x8')](),controller[_0xf285('0xe')]);router[_0xf285('0xa')]('/:id/canned_answers',auth[_0xf285('0x8')](),controller[_0xf285('0xf')]);router[_0xf285('0xa')]('/:id/users',auth[_0xf285('0x8')](),controller['getAgents']);router[_0xf285('0xa')]('/:id/applications',auth[_0xf285('0x8')](),controller['getApplications']);router[_0xf285('0x10')]('/',auth[_0xf285('0x8')](),controller[_0xf285('0x11')]);router[_0xf285('0x10')](_0xf285('0x12'),auth[_0xf285('0x8')](),controller[_0xf285('0x13')]);router[_0xf285('0x10')]('/:id/canned_answers',auth[_0xf285('0x8')](),controller['addAnswer']);router[_0xf285('0x10')](_0xf285('0x14'),auth['isAuthenticated'](),controller[_0xf285('0x15')]);router[_0xf285('0x10')](_0xf285('0x16'),auth[_0xf285('0x8')](),controller[_0xf285('0x17')]);router[_0xf285('0x10')](_0xf285('0x18'),controller[_0xf285('0x19')]);router['post'](_0xf285('0x1a'),auth[_0xf285('0x8')](),controller[_0xf285('0x1b')]);router[_0xf285('0x1c')]('/:id',auth[_0xf285('0x8')](),controller[_0xf285('0x1d')]);router['delete'](_0xf285('0x1e'),auth[_0xf285('0x8')](),controller[_0xf285('0x1f')]);router[_0xf285('0x20')](_0xf285('0x12'),auth['isAuthenticated'](),controller[_0xf285('0x21')]);router[_0xf285('0x20')](_0xf285('0x22'),auth[_0xf285('0x8')](),controller[_0xf285('0x23')]);router[_0xf285('0x20')](_0xf285('0x14'),auth[_0xf285('0x8')](),controller[_0xf285('0x24')]);module[_0xf285('0x25')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js
index 91de111..5bb244d 100644
--- a/server/api/whatsappAccount/whatsappAccount.attributes.js
+++ b/server/api/whatsappAccount/whatsappAccount.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6961=['exports','STRING','name','generate','twilio','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x18b39e,_0x63c3e5){var _0x1f69ec=function(_0x36f809){while(--_0x36f809){_0x18b39e['push'](_0x18b39e['shift']());}};_0x1f69ec(++_0x63c3e5);}(_0x6961,0x1ce));var _0x1696=function(_0xd6a74,_0x3b878a){_0xd6a74=_0xd6a74-0x0;var _0x4ed128=_0x6961[_0xd6a74];return _0x4ed128;};'use strict';var Sequelize=require(_0x1696('0x0'));var rs=require(_0x1696('0x1'));module[_0x1696('0x2')]={'name':{'type':Sequelize[_0x1696('0x3')],'unique':_0x1696('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x1696('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x1696('0x3')],'defaultValue':function(){return rs[_0x1696('0x5')]();}},'phone':{'type':Sequelize[_0x1696('0x3')]},'type':{'type':Sequelize['ENUM'](_0x1696('0x6'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x1696('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1696('0x7')],'defaultValue':function(){return _0x1696('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x1696('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1696('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1696('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1696('0xa')],'comment':_0x1696('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x1696('0x9')],'defaultValue':![],'comment':_0x1696('0xc'),'set':function(_0x1735f4){if(!_0x1735f4){this['setDataValue'](_0x1696('0xd'),null);}this[_0x1696('0xe')](_0x1696('0xf'),_0x1735f4);}},'description':{'type':Sequelize[_0x1696('0x3')]}};
\ No newline at end of file
+var _0xc10e=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','name','STRING','ENUM','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xc10e,0xb8));var _0xec10=function(_0x529021,_0x5347c0){_0x529021=_0x529021-0x0;var _0x40d4ad=_0xc10e[_0x529021];return _0x40d4ad;};'use strict';var Sequelize=require(_0xec10('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xec10('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xec10('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xec10('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xec10('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xec10('0x2')]},'type':{'type':Sequelize[_0xec10('0x3')]('twilio')},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xec10('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xec10('0x4');}},'notificationSound':{'type':Sequelize[_0xec10('0x5')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xec10('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xec10('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xec10('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xec10('0x6')],'comment':_0xec10('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xec10('0x5')],'defaultValue':![],'comment':_0xec10('0x8'),'set':function(_0x5e1d9b){if(!_0x5e1d9b){this['setDataValue'](_0xec10('0x9'),null);}this[_0xec10('0xa')](_0xec10('0xb'),_0x5e1d9b);}},'description':{'type':Sequelize[_0xec10('0x2')]}};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js
index b399f7f..2d3b043 100644
--- a/server/api/whatsappAccount/whatsappAccount.controller.js
+++ b/server/api/whatsappAccount/whatsappAccount.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a ','List','out','Messages','dataValues','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','http','test','Sequelize','ValidationError','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','apply','reject','save','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','WhatsappAccount','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','keys','rawAttributes','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','order','map','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','WhatsappApplication','bulkCreate','priority','getApplications','notify','whatsapp','Applications','account','orderBy','asc','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','replace','whatsapp:','Body','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','WhatsappMessage','UserId','unshift','waitForTheAssignedAgent','Start'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x70e0,0x17b));var _0x070e=function(_0x575211,_0x3b9204){_0x575211=_0x575211-0x0;var _0x65d09a=_0x70e0[_0x575211];return _0x65d09a;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];config[_0x070e('0x16')]=_[_0x070e('0x17')](config[_0x070e('0x16')],{'host':_0x070e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x070e('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x070e('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x14c3fd,_0x51d14d,_0x5d3a38){if(_0x5d3a38){var _0x373d86=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x373d86[_0x070e('0x1b')](_0x51d14d)){return _0x14c3fd;}else{throw new db[(_0x070e('0x1c'))][(_0x070e('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x14c3fd;}}function respondWithRpcPromise(_0x49861b,_0x17e2e4,_0x2bd937,_0x38f6e6){return new BPromise(function(_0x2060cc,_0x364b3f){var _0x5037eb=_0x38f6e6||client;return _0x5037eb[_0x070e('0x1e')](_0x49861b,_0x2bd937)[_0x070e('0x1f')](function(_0x1ad3de){logger[_0x070e('0x20')](_0x070e('0x21'),_0x17e2e4,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x17e2e4,_0x070e('0x22'),JSON[_0x070e('0x23')](_0x1ad3de));if(_0x1ad3de[_0x070e('0x24')]){if(_0x1ad3de['error'][_0x070e('0x25')]===0x1f4){logger['error'](_0x070e('0x21'),_0x17e2e4,_0x1ad3de[_0x070e('0x24')][_0x070e('0x26')]);return _0x364b3f(_0x1ad3de[_0x070e('0x24')][_0x070e('0x26')]);}logger[_0x070e('0x24')](_0x070e('0x21'),_0x17e2e4,_0x1ad3de[_0x070e('0x24')]['message']);return _0x2060cc(_0x1ad3de[_0x070e('0x24')][_0x070e('0x26')]);}else{logger[_0x070e('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x17e2e4,_0x070e('0x22'));_0x2060cc(_0x1ad3de['result']['message']);}})[_0x070e('0x27')](function(_0x25f6e){logger[_0x070e('0x24')](_0x070e('0x21'),_0x17e2e4,_0x25f6e);_0x364b3f(_0x25f6e);});});}function respondWithStatusCode(_0x4763c6,_0x497f58){_0x497f58=_0x497f58||0xcc;return function(_0x374c54){if(_0x374c54){return _0x4763c6[_0x070e('0x28')](_0x497f58);}return _0x4763c6[_0x070e('0x29')](_0x497f58)[_0x070e('0x2a')]();};}function respondWithResult(_0x43dd96,_0x28d7f2){_0x28d7f2=_0x28d7f2||0xc8;return function(_0x1a1892){if(_0x1a1892){return _0x43dd96[_0x070e('0x29')](_0x28d7f2)['json'](_0x1a1892);}};}function respondWithFilteredResult(_0x282344,_0x351641){return function(_0x3a16d0){if(_0x3a16d0){var _0x56fc12=_0x3a16d0[_0x070e('0x2b')],_0x5c5f0d=_0x351641['offset'],_0x13097f=_0x351641[_0x070e('0x2c')]+_0x351641[_0x070e('0x2d')],_0x46065c;if(_0x13097f>=_0x56fc12){_0x13097f=_0x56fc12;_0x46065c=0xc8;}else{_0x46065c=0xce;}_0x282344[_0x070e('0x29')](_0x46065c);return _0x282344[_0x070e('0x2e')]('Content-Range',_0x5c5f0d+'-'+_0x13097f+'/'+_0x56fc12)['json'](_0x3a16d0);}return null;};}function patchUpdates(_0x523b75){return function(_0x59c5b4){try{jsonpatch[_0x070e('0x2f')](_0x59c5b4,_0x523b75,!![]);}catch(_0x4e0a7d){return BPromise[_0x070e('0x30')](_0x4e0a7d);}return _0x59c5b4[_0x070e('0x31')]();};}function saveUpdates(_0x4f8130,_0x47a739){return function(_0x699739){if(_0x699739){return _0x699739[_0x070e('0x32')](_0x4f8130)['then'](function(_0x546a16){return _0x546a16;});}return null;};}function removeEntity(_0x41ade4,_0x27dd1f){return function(_0x444d02){if(_0x444d02){return _0x444d02[_0x070e('0x33')]()[_0x070e('0x1f')](function(){var _0x5f530d=_0x444d02['get']({'plain':!![]});var _0x24d17d=_0x070e('0x34');return db[_0x070e('0x35')][_0x070e('0x33')]({'where':{'type':_0x24d17d,'resourceId':_0x5f530d['id']}})[_0x070e('0x1f')](function(){return _0x444d02;});})['then'](function(){_0x41ade4[_0x070e('0x29')](0xcc)[_0x070e('0x2a')]();});}};}function handleEntityNotFound(_0x534150,_0x2d6bb6){return function(_0x34746e){if(!_0x34746e){_0x534150['sendStatus'](0x194);}return _0x34746e;};}function handleError(_0x4d4ee8,_0x5ddbe9){_0x5ddbe9=_0x5ddbe9||0x1f4;return function(_0x363bff){logger[_0x070e('0x24')](_0x363bff[_0x070e('0x36')]);if(_0x363bff[_0x070e('0x37')]){delete _0x363bff[_0x070e('0x37')];}_0x4d4ee8['status'](_0x5ddbe9)[_0x070e('0x38')](_0x363bff);};}exports[_0x070e('0x39')]=function(_0xb53332,_0x487276){var _0x268c5d={'include':[{'model':db['Pause'],'as':_0x070e('0x3a')}]},_0x72cbc7={},_0x165c16={'count':0x0,'rows':[]};var _0x348092=_['map'](db[_0x070e('0x3b')]['rawAttributes'],function(_0x18dae9){return{'name':_0x18dae9[_0x070e('0x3c')],'type':_0x18dae9[_0x070e('0x3d')][_0x070e('0x3e')]};});_0x72cbc7[_0x070e('0x3f')]=_['map'](_0x348092,_0x070e('0x37'));_0x72cbc7['query']=_['keys'](_0xb53332[_0x070e('0x40')]);_0x72cbc7[_0x070e('0x41')]=_[_0x070e('0x42')](_0x72cbc7['model'],_0x72cbc7[_0x070e('0x40')]);_0x268c5d[_0x070e('0x43')]=_[_0x070e('0x42')](_0x72cbc7[_0x070e('0x3f')],qs['fields'](_0xb53332[_0x070e('0x40')]['fields']));_0x268c5d['attributes']=_0x268c5d['attributes'][_0x070e('0x44')]?_0x268c5d[_0x070e('0x43')]:_0x72cbc7[_0x070e('0x3f')];if(!_0xb53332[_0x070e('0x40')][_0x070e('0x45')]('nolimit')){_0x268c5d[_0x070e('0x2d')]=qs['limit'](_0xb53332[_0x070e('0x40')][_0x070e('0x2d')]);_0x268c5d[_0x070e('0x2c')]=qs['offset'](_0xb53332['query'][_0x070e('0x2c')]);}_0x268c5d['order']=qs[_0x070e('0x46')](_0xb53332[_0x070e('0x40')][_0x070e('0x46')]);_0x268c5d['where']=qs[_0x070e('0x41')](_[_0x070e('0x47')](_0xb53332['query'],_0x72cbc7['filters']),_0x348092);if(_0xb53332[_0x070e('0x40')][_0x070e('0x48')]){_0x268c5d[_0x070e('0x49')]=_[_0x070e('0x4a')](_0x268c5d[_0x070e('0x49')],{'$or':_['map'](_0x348092,function(_0x20b80e){if(_0x20b80e[_0x070e('0x3d')]!==_0x070e('0x4b')){var _0x391dee={};_0x391dee[_0x20b80e[_0x070e('0x37')]]={'$like':'%'+_0xb53332[_0x070e('0x40')][_0x070e('0x48')]+'%'};return _0x391dee;}})});}_0x268c5d=_[_0x070e('0x4a')]({},_0x268c5d,_0xb53332[_0x070e('0x4c')]);var _0x66a3f3={'where':_0x268c5d[_0x070e('0x49')]};return db[_0x070e('0x3b')][_0x070e('0x2b')](_0x66a3f3)[_0x070e('0x1f')](function(_0x402c82){_0x165c16['count']=_0x402c82;if(_0xb53332[_0x070e('0x40')][_0x070e('0x4d')]){_0x268c5d[_0x070e('0x4e')]=[{'all':!![]}];}return db[_0x070e('0x3b')][_0x070e('0x4f')](_0x268c5d);})[_0x070e('0x1f')](function(_0x3f0763){_0x165c16[_0x070e('0x50')]=_0x3f0763;return _0x165c16;})[_0x070e('0x1f')](respondWithFilteredResult(_0x487276,_0x268c5d))['catch'](handleError(_0x487276,null));};exports[_0x070e('0x51')]=function(_0x4c22da,_0x1acddb){var _0x2be643={'raw':![],'where':{'id':_0x4c22da[_0x070e('0x52')]['id']},'include':[{'model':db[_0x070e('0x53')],'as':_0x070e('0x3a')}]},_0x4abbe9={};_0x4abbe9[_0x070e('0x3f')]=_[_0x070e('0x54')](db[_0x070e('0x3b')][_0x070e('0x55')]);_0x4abbe9['query']=_[_0x070e('0x54')](_0x4c22da['query']);_0x4abbe9['filters']=_[_0x070e('0x42')](_0x4abbe9[_0x070e('0x3f')],_0x4abbe9[_0x070e('0x40')]);_0x2be643[_0x070e('0x43')]=_[_0x070e('0x42')](_0x4abbe9[_0x070e('0x3f')],qs[_0x070e('0x56')](_0x4c22da[_0x070e('0x40')]['fields']));_0x2be643[_0x070e('0x43')]=_0x2be643['attributes']['length']?_0x2be643[_0x070e('0x43')]:_0x4abbe9[_0x070e('0x3f')];if(_0x4c22da['query'][_0x070e('0x4d')]){_0x2be643[_0x070e('0x4e')]=[{'all':!![]}];}_0x2be643=_[_0x070e('0x4a')]({},_0x2be643,_0x4c22da[_0x070e('0x4c')]);return db[_0x070e('0x3b')][_0x070e('0x57')](_0x2be643)[_0x070e('0x1f')](handleEntityNotFound(_0x1acddb,null))['then'](respondWithResult(_0x1acddb,null))['catch'](handleError(_0x1acddb,null));};exports['create']=function(_0x3087e5,_0x1948a5){return db[_0x070e('0x3b')][_0x070e('0x58')](_0x3087e5['body'],{})[_0x070e('0x1f')](function(_0x5d3c3a){var _0x212710=_0x3087e5[_0x070e('0x59')][_0x070e('0x5a')]({'plain':!![]});if(!_0x212710)throw new Error(_0x070e('0x5b'));if(_0x212710[_0x070e('0x5c')]===_0x070e('0x59')){var _0x5561ed=_0x5d3c3a[_0x070e('0x5a')]({'plain':!![]});var _0x18e8d0=_0x070e('0x34');return db['UserProfileSection'][_0x070e('0x57')]({'where':{'name':_0x18e8d0,'userProfileId':_0x212710[_0x070e('0x5d')]},'raw':!![]})['then'](function(_0x1f1df5){if(_0x1f1df5&&_0x1f1df5['autoAssociation']===0x0){return db[_0x070e('0x35')]['create']({'name':_0x5561ed['name'],'resourceId':_0x5561ed['id'],'type':_0x1f1df5['name'],'sectionId':_0x1f1df5['id']},{})[_0x070e('0x1f')](function(){return _0x5d3c3a;});}else{return _0x5d3c3a;}})[_0x070e('0x27')](function(_0x1100d8){logger[_0x070e('0x24')](_0x070e('0x5e'),_0x1100d8);throw _0x1100d8;});}return _0x5d3c3a;})[_0x070e('0x1f')](respondWithResult(_0x1948a5,0xc9))['catch'](handleError(_0x1948a5,null));};exports[_0x070e('0x32')]=function(_0x54d4f9,_0xae78a4){if(_0x54d4f9['body']['id']){delete _0x54d4f9[_0x070e('0x5f')]['id'];}return db[_0x070e('0x3b')]['find']({'where':{'id':_0x54d4f9[_0x070e('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x070e('0x3a')}]})[_0x070e('0x1f')](handleEntityNotFound(_0xae78a4,null))[_0x070e('0x1f')](saveUpdates(_0x54d4f9[_0x070e('0x5f')],null))[_0x070e('0x1f')](respondWithResult(_0xae78a4,null))[_0x070e('0x27')](handleError(_0xae78a4,null));};exports[_0x070e('0x33')]=function(_0x148f1d,_0x3ef9cc){return db[_0x070e('0x3b')][_0x070e('0x57')]({'where':{'id':_0x148f1d[_0x070e('0x52')]['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0x3ef9cc,null))[_0x070e('0x1f')](removeEntity(_0x3ef9cc,null))['catch'](handleError(_0x3ef9cc,null));};exports[_0x070e('0x60')]=function(_0x19d78c,_0x381c83){return db[_0x070e('0x3b')]['describe']()[_0x070e('0x1f')](respondWithResult(_0x381c83,null))[_0x070e('0x27')](handleError(_0x381c83,null));};exports[_0x070e('0x61')]=function(_0x5625a9,_0x2a7b5d,_0x12a58f){if(_0x5625a9['body']['id']){delete _0x5625a9[_0x070e('0x5f')]['id'];}return db[_0x070e('0x3b')][_0x070e('0x57')]({'where':{'id':_0x5625a9[_0x070e('0x52')]['id']}})['then'](handleEntityNotFound(_0x2a7b5d,null))[_0x070e('0x1f')](function(_0x52804d){if(_0x52804d){_0x5625a9[_0x070e('0x5f')][_0x070e('0x62')]=_0x52804d['id'];return db[_0x070e('0x63')][_0x070e('0x58')](_0x5625a9[_0x070e('0x5f')]);}})['then'](respondWithResult(_0x2a7b5d,null))[_0x070e('0x27')](handleError(_0x2a7b5d,null));};exports[_0x070e('0x64')]=function(_0x8cc913,_0x114bcf,_0x5591dd){var _0x26b2c0={'raw':![],'where':{}};var _0x5cadcf={};var _0x399055={'count':0x0,'rows':[]};return db[_0x070e('0x3b')][_0x070e('0x65')]({'where':{'id':_0x8cc913['params']['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0x114bcf,null))['then'](function(_0x1e6e6a){if(_0x1e6e6a){_0x5cadcf['model']=_[_0x070e('0x54')](db[_0x070e('0x63')]['rawAttributes']);_0x5cadcf[_0x070e('0x40')]=_['keys'](_0x8cc913[_0x070e('0x40')]);_0x5cadcf[_0x070e('0x41')]=_['intersection'](_0x5cadcf['model'],_0x5cadcf[_0x070e('0x40')]);_0x26b2c0[_0x070e('0x43')]=_[_0x070e('0x42')](_0x5cadcf[_0x070e('0x3f')],qs[_0x070e('0x56')](_0x8cc913[_0x070e('0x40')][_0x070e('0x56')]));_0x26b2c0[_0x070e('0x43')]=_0x26b2c0[_0x070e('0x43')][_0x070e('0x44')]?_0x26b2c0[_0x070e('0x43')]:_0x5cadcf[_0x070e('0x3f')];if(!_0x8cc913[_0x070e('0x40')]['hasOwnProperty'](_0x070e('0x66'))){_0x26b2c0[_0x070e('0x2d')]=qs['limit'](_0x8cc913['query'][_0x070e('0x2d')]);_0x26b2c0[_0x070e('0x2c')]=qs[_0x070e('0x2c')](_0x8cc913[_0x070e('0x40')][_0x070e('0x2c')]);}_0x26b2c0[_0x070e('0x67')]=qs[_0x070e('0x46')](_0x8cc913[_0x070e('0x40')][_0x070e('0x46')]);_0x26b2c0[_0x070e('0x49')]=qs[_0x070e('0x41')](_[_0x070e('0x47')](_0x8cc913[_0x070e('0x40')],_0x5cadcf['filters']));_0x26b2c0['where']['WhatsappAccountId']=_0x1e6e6a['id'];if(_0x8cc913[_0x070e('0x40')][_0x070e('0x48')]){_0x26b2c0[_0x070e('0x49')]=_[_0x070e('0x4a')](_0x26b2c0['where'],{'$or':_[_0x070e('0x68')](_0x26b2c0[_0x070e('0x43')],function(_0x416dde){var _0xd74f9c={};_0xd74f9c[_0x416dde]={'$like':'%'+_0x8cc913[_0x070e('0x40')][_0x070e('0x48')]+'%'};return _0xd74f9c;})});}_0x26b2c0=_['merge']({},_0x26b2c0,_0x8cc913[_0x070e('0x4c')]);return db['Disposition'][_0x070e('0x2b')]({'where':_0x26b2c0[_0x070e('0x49')]})[_0x070e('0x1f')](function(_0x3aa620){_0x399055[_0x070e('0x2b')]=_0x3aa620;if(_0x8cc913['query'][_0x070e('0x4d')]){_0x26b2c0[_0x070e('0x4e')]=[{'all':!![]}];}return db['Disposition'][_0x070e('0x4f')](_0x26b2c0);})[_0x070e('0x1f')](function(_0x553ea1){_0x399055[_0x070e('0x50')]=_0x553ea1;return _0x399055;});}})[_0x070e('0x1f')](respondWithFilteredResult(_0x114bcf,_0x26b2c0))[_0x070e('0x27')](handleError(_0x114bcf,null));};exports['removeDispositions']=function(_0x40d7e6,_0xe8c476,_0x134b72){return db[_0x070e('0x3b')][_0x070e('0x57')]({'where':{'id':_0x40d7e6[_0x070e('0x52')]['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0xe8c476,null))[_0x070e('0x1f')](function(_0x206b97){if(_0x206b97){return _0x206b97[_0x070e('0x69')](_0x40d7e6[_0x070e('0x40')][_0x070e('0x6a')]);}})[_0x070e('0x1f')](respondWithStatusCode(_0xe8c476,null))['catch'](handleError(_0xe8c476,null));};exports[_0x070e('0x6b')]=function(_0x2df184,_0x392c45,_0x1b71dd){if(_0x2df184[_0x070e('0x5f')]['id']){delete _0x2df184[_0x070e('0x5f')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2df184['params']['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0x392c45,null))[_0x070e('0x1f')](function(_0x39cd65){if(_0x39cd65){_0x2df184[_0x070e('0x5f')]['WhatsappAccountId']=_0x39cd65['id'];return db[_0x070e('0x6c')][_0x070e('0x58')](_0x2df184[_0x070e('0x5f')]);}})['then'](respondWithResult(_0x392c45,null))[_0x070e('0x27')](handleError(_0x392c45,null));};exports['getAnswers']=function(_0x237e3b,_0x396902,_0x59e6e5){var _0x59fe3e={'raw':![],'where':{}};var _0x2048e9={};var _0x1fa499={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x070e('0x65')]({'where':{'id':_0x237e3b['params']['id']}})['then'](handleEntityNotFound(_0x396902,null))['then'](function(_0x15480c){if(_0x15480c){_0x2048e9[_0x070e('0x3f')]=_[_0x070e('0x54')](db[_0x070e('0x6c')][_0x070e('0x55')]);_0x2048e9[_0x070e('0x40')]=_[_0x070e('0x54')](_0x237e3b[_0x070e('0x40')]);_0x2048e9[_0x070e('0x41')]=_[_0x070e('0x42')](_0x2048e9[_0x070e('0x3f')],_0x2048e9[_0x070e('0x40')]);_0x59fe3e[_0x070e('0x43')]=_[_0x070e('0x42')](_0x2048e9[_0x070e('0x3f')],qs[_0x070e('0x56')](_0x237e3b[_0x070e('0x40')][_0x070e('0x56')]));_0x59fe3e[_0x070e('0x43')]=_0x59fe3e[_0x070e('0x43')][_0x070e('0x44')]?_0x59fe3e[_0x070e('0x43')]:_0x2048e9['model'];if(!_0x237e3b[_0x070e('0x40')][_0x070e('0x45')](_0x070e('0x66'))){_0x59fe3e[_0x070e('0x2d')]=qs['limit'](_0x237e3b[_0x070e('0x40')][_0x070e('0x2d')]);_0x59fe3e[_0x070e('0x2c')]=qs[_0x070e('0x2c')](_0x237e3b[_0x070e('0x40')][_0x070e('0x2c')]);}_0x59fe3e['order']=qs['sort'](_0x237e3b['query'][_0x070e('0x46')]);_0x59fe3e['where']=qs[_0x070e('0x41')](_[_0x070e('0x47')](_0x237e3b['query'],_0x2048e9[_0x070e('0x41')]));_0x59fe3e[_0x070e('0x49')]['WhatsappAccountId']=_0x15480c['id'];if(_0x237e3b['query'][_0x070e('0x48')]){_0x59fe3e[_0x070e('0x49')]=_[_0x070e('0x4a')](_0x59fe3e[_0x070e('0x49')],{'$or':_[_0x070e('0x68')](_0x59fe3e['attributes'],function(_0x3aba7a){var _0x56e3da={};_0x56e3da[_0x3aba7a]={'$like':'%'+_0x237e3b[_0x070e('0x40')][_0x070e('0x48')]+'%'};return _0x56e3da;})});}_0x59fe3e=_['merge']({},_0x59fe3e,_0x237e3b[_0x070e('0x4c')]);return db[_0x070e('0x6c')][_0x070e('0x2b')]({'where':_0x59fe3e[_0x070e('0x49')]})[_0x070e('0x1f')](function(_0x32b286){_0x1fa499['count']=_0x32b286;if(_0x237e3b[_0x070e('0x40')][_0x070e('0x4d')]){_0x59fe3e[_0x070e('0x4e')]=[{'all':!![]}];}return db[_0x070e('0x6c')][_0x070e('0x4f')](_0x59fe3e);})['then'](function(_0x2531f7){_0x1fa499[_0x070e('0x50')]=_0x2531f7;return _0x1fa499;});}})[_0x070e('0x1f')](respondWithFilteredResult(_0x396902,_0x59fe3e))[_0x070e('0x27')](handleError(_0x396902,null));};exports[_0x070e('0x6d')]=function(_0x31ceee,_0x248347,_0x4546eb){return db[_0x070e('0x3b')][_0x070e('0x57')]({'where':{'id':_0x31ceee[_0x070e('0x52')]['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0x248347,null))[_0x070e('0x1f')](function(_0xf1edc1){if(_0xf1edc1){return _0xf1edc1[_0x070e('0x6d')](_0x31ceee[_0x070e('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x248347,null))[_0x070e('0x27')](handleError(_0x248347,null));};exports[_0x070e('0x6e')]=function(_0x4ceba3,_0x5d8c9f,_0x5d8f66){return db['WhatsappAccount'][_0x070e('0x57')]({'where':{'id':_0x4ceba3[_0x070e('0x52')]['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0x5d8c9f,null))[_0x070e('0x1f')](function(_0x409811){if(_0x409811){return _0x409811[_0x070e('0x6e')](_0x4ceba3[_0x070e('0x5f')][_0x070e('0x6a')],_[_0x070e('0x6f')](_0x4ceba3[_0x070e('0x5f')],['ids','id'])||{})[_0x070e('0x70')](function(_0x36cfe2){for(var _0x49c66a=0x0;_0x49c66a<_0x4ceba3[_0x070e('0x5f')][_0x070e('0x6a')][_0x070e('0x44')];_0x49c66a+=0x1){socket[_0x070e('0x71')]('userWhatsappAccount:save',{'UserId':_0x4ceba3[_0x070e('0x5f')][_0x070e('0x6a')][_0x49c66a],'WhatsappAccountId':_0x4ceba3[_0x070e('0x52')]['id']});}return _0x36cfe2;});}})[_0x070e('0x1f')](respondWithResult(_0x5d8c9f,null))['catch'](handleError(_0x5d8c9f,null));};exports[_0x070e('0x72')]=function(_0x14a769,_0xfb9cec,_0xebbb53){return db[_0x070e('0x3b')][_0x070e('0x57')]({'where':{'id':_0x14a769[_0x070e('0x52')]['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0xfb9cec,null))[_0x070e('0x1f')](function(_0x1a41f2){if(_0x1a41f2){return _0x1a41f2[_0x070e('0x72')](_0x14a769['query'][_0x070e('0x6a')])[_0x070e('0x1f')](function(){if(_['isArray'](_0x14a769['query'][_0x070e('0x6a')])){for(var _0x53f6e7=0x0;_0x53f6e7<_0x14a769[_0x070e('0x40')][_0x070e('0x6a')][_0x070e('0x44')];_0x53f6e7+=0x1){socket[_0x070e('0x71')](_0x070e('0x73'),{'UserId':Number(_0x14a769[_0x070e('0x40')][_0x070e('0x6a')][_0x53f6e7]),'WhatsappAccountId':Number(_0x14a769['params']['id'])});}}else{socket[_0x070e('0x71')](_0x070e('0x73'),{'UserId':Number(_0x14a769[_0x070e('0x40')][_0x070e('0x6a')]),'WhatsappAccountId':Number(_0x14a769['params']['id'])});}});}})['then'](respondWithStatusCode(_0xfb9cec,null))[_0x070e('0x27')](handleError(_0xfb9cec,null));};exports[_0x070e('0x74')]=function(_0x2e92f0,_0x5b727f,_0x101bfc){var _0xf5b732={};var _0x4e795d={};var _0x2e9808;var _0x344289;return db[_0x070e('0x3b')][_0x070e('0x65')]({'where':{'id':_0x2e92f0[_0x070e('0x52')]['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0x5b727f,null))['then'](function(_0x58c3d7){if(_0x58c3d7){_0x2e9808=_0x58c3d7;_0x4e795d[_0x070e('0x3f')]=_['keys'](db[_0x070e('0x75')][_0x070e('0x55')]);_0x4e795d['query']=_[_0x070e('0x54')](_0x2e92f0['query']);_0x4e795d[_0x070e('0x41')]=_[_0x070e('0x42')](_0x4e795d[_0x070e('0x3f')],_0x4e795d[_0x070e('0x40')]);_0xf5b732[_0x070e('0x43')]=_[_0x070e('0x42')](_0x4e795d['model'],qs[_0x070e('0x56')](_0x2e92f0[_0x070e('0x40')]['fields']));_0xf5b732['attributes']=_0xf5b732[_0x070e('0x43')][_0x070e('0x44')]?_0xf5b732[_0x070e('0x43')]:_0x4e795d[_0x070e('0x3f')];_0xf5b732[_0x070e('0x67')]=qs[_0x070e('0x46')](_0x2e92f0[_0x070e('0x40')][_0x070e('0x46')]);_0xf5b732['where']=qs[_0x070e('0x41')](_[_0x070e('0x47')](_0x2e92f0[_0x070e('0x40')],_0x4e795d[_0x070e('0x41')]));if(_0x2e92f0[_0x070e('0x40')][_0x070e('0x48')]){_0xf5b732[_0x070e('0x49')]=_[_0x070e('0x4a')](_0xf5b732['where'],{'$or':_[_0x070e('0x68')](_0xf5b732[_0x070e('0x43')],function(_0x40532a){var _0xbc61f2={};_0xbc61f2[_0x40532a]={'$like':'%'+_0x2e92f0[_0x070e('0x40')][_0x070e('0x48')]+'%'};return _0xbc61f2;})});}_0xf5b732=_[_0x070e('0x4a')]({},_0xf5b732,_0x2e92f0[_0x070e('0x4c')]);return _0x2e9808[_0x070e('0x74')](_0xf5b732);}})[_0x070e('0x1f')](function(_0x5b259e){if(_0x5b259e){_0x344289=_0x5b259e['length'];if(!_0x2e92f0[_0x070e('0x40')][_0x070e('0x45')](_0x070e('0x66'))){_0xf5b732['limit']=qs[_0x070e('0x2d')](_0x2e92f0[_0x070e('0x40')]['limit']);_0xf5b732[_0x070e('0x2c')]=qs[_0x070e('0x2c')](_0x2e92f0[_0x070e('0x40')][_0x070e('0x2c')]);}return _0x2e9808[_0x070e('0x74')](_0xf5b732);}})[_0x070e('0x1f')](function(_0x4cd349){if(_0x4cd349){return _0x4cd349?{'count':_0x344289,'rows':_0x4cd349}:null;}})['then'](respondWithResult(_0x5b727f,null))[_0x070e('0x27')](handleError(_0x5b727f,null));};exports[_0x070e('0x76')]=function(_0x532f83,_0x4055ba,_0x1ba1d3){return db[_0x070e('0x3b')][_0x070e('0x65')]({'where':{'id':_0x532f83[_0x070e('0x52')]['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0x4055ba,null))['then'](function(_0xb7866f){if(_0xb7866f){return db[_0x070e('0x77')]['transaction'](function(_0x44ab7c){return db[_0x070e('0x78')][_0x070e('0x33')]({'where':{'WhatsappAccountId':_0x532f83[_0x070e('0x52')]['id']},'transaction':_0x44ab7c})['then'](function(_0x4c621a){var _0x2c2585=_[_0x070e('0x68')](_0x532f83[_0x070e('0x5f')],function(_0x326948){_0x326948[_0x070e('0x62')]=_0x532f83[_0x070e('0x52')]['id'];return _0x326948;});return db[_0x070e('0x78')][_0x070e('0x79')](_0x2c2585,{'transaction':_0x44ab7c});});})[_0x070e('0x1f')](function(){return db[_0x070e('0x78')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x532f83[_0x070e('0x52')]['id']},'order':_0x070e('0x7a')});});}})[_0x070e('0x1f')](respondWithResult(_0x4055ba,null))[_0x070e('0x27')](handleError(_0x4055ba,null));};exports['getApplications']=function(_0x8c79df,_0x35ddab,_0x510bce){var _0x4b559b={};var _0x27c346={};var _0x4684c7;var _0x1abf03;return db['WhatsappAccount'][_0x070e('0x65')]({'where':{'id':_0x8c79df[_0x070e('0x52')]['id']}})[_0x070e('0x1f')](handleEntityNotFound(_0x35ddab,null))[_0x070e('0x1f')](function(_0x34b5ae){if(_0x34b5ae){_0x4684c7=_0x34b5ae;_0x27c346['model']=_[_0x070e('0x54')](db[_0x070e('0x78')]['rawAttributes']);_0x27c346[_0x070e('0x40')]=_['keys'](_0x8c79df['query']);_0x27c346['filters']=_[_0x070e('0x42')](_0x27c346[_0x070e('0x3f')],_0x27c346[_0x070e('0x40')]);_0x4b559b[_0x070e('0x43')]=_['intersection'](_0x27c346[_0x070e('0x3f')],qs[_0x070e('0x56')](_0x8c79df['query'][_0x070e('0x56')]));_0x4b559b[_0x070e('0x43')]=_0x4b559b[_0x070e('0x43')][_0x070e('0x44')]?_0x4b559b[_0x070e('0x43')]:_0x27c346[_0x070e('0x3f')];_0x4b559b['order']=qs[_0x070e('0x46')](_0x8c79df['query'][_0x070e('0x46')]);_0x4b559b[_0x070e('0x49')]=qs[_0x070e('0x41')](_['pick'](_0x8c79df[_0x070e('0x40')],_0x27c346[_0x070e('0x41')]));if(_0x8c79df[_0x070e('0x40')]['filter']){_0x4b559b[_0x070e('0x49')]=_[_0x070e('0x4a')](_0x4b559b['where'],{'$or':_[_0x070e('0x68')](_0x4b559b[_0x070e('0x43')],function(_0x478e5b){var _0x56ec32={};_0x56ec32[_0x478e5b]={'$like':'%'+_0x8c79df['query']['filter']+'%'};return _0x56ec32;})});}_0x4b559b=_[_0x070e('0x4a')]({},_0x4b559b,_0x8c79df[_0x070e('0x4c')]);return _0x4684c7[_0x070e('0x7b')](_0x4b559b);}})[_0x070e('0x1f')](function(_0x1204d7){if(_0x1204d7){_0x1abf03=_0x1204d7[_0x070e('0x44')];if(!_0x8c79df[_0x070e('0x40')][_0x070e('0x45')]('nolimit')){_0x4b559b['limit']=qs['limit'](_0x8c79df['query'][_0x070e('0x2d')]);_0x4b559b[_0x070e('0x2c')]=qs[_0x070e('0x2c')](_0x8c79df[_0x070e('0x40')][_0x070e('0x2c')]);}return _0x4684c7['getApplications'](_0x4b559b);}})['then'](function(_0x1644c2){if(_0x1644c2){return _0x1644c2?{'count':_0x1abf03,'rows':_0x1644c2}:null;}})[_0x070e('0x1f')](respondWithResult(_0x35ddab,null))['catch'](handleError(_0x35ddab,null));};exports[_0x070e('0x7c')]=function(_0x46e19f,_0x239385,_0x75ea53){var _0x38b0e1={'channel':_0x070e('0x7d')};var _0x5e71ab=[];var _0x202ebf=[];var _0x1d48a9={};return db[_0x070e('0x3b')]['find']({'where':{'id':_0x46e19f[_0x070e('0x52')]['id']},'include':[{'model':db[_0x070e('0x78')],'as':_0x070e('0x7e')}]})[_0x070e('0x1f')](handleEntityNotFound(_0x239385,null))['then'](function(_0x4175b9){_0x38b0e1[_0x070e('0x7f')]=_0x4175b9;_0x38b0e1['applications']=_[_0x070e('0x80')](_0x4175b9[_0x070e('0x7e')],['priority'],[_0x070e('0x81')]);if(_0x38b0e1['account'][_0x070e('0x7e')]){delete _0x38b0e1['account'][_0x070e('0x7e')];}return db['CmContact']['describe']();})[_0x070e('0x1f')](function(_0x5df2fa){if(!_0x5df2fa){throw new db['Sequelize'][(_0x070e('0x1d'))](_0x070e('0x82'));}_0x5e71ab=_[_0x070e('0x83')](_[_0x070e('0x54')](_0x5df2fa),[_0x070e('0x84'),'updatedAt']);_0x202ebf=_[_0x070e('0x83')](_[_0x070e('0x54')](_0x5df2fa),[_0x070e('0x84'),_0x070e('0x85'),_0x070e('0x86'),_0x070e('0x87')]);_0x38b0e1['body']={'mapKey':_0x070e('0x88')};if(_0x38b0e1[_0x070e('0x7f')][_0x070e('0x3d')]&&_0x38b0e1[_0x070e('0x7f')]['type']==='twilio'){_0x38b0e1[_0x070e('0x5f')][_0x070e('0x89')]=_0x46e19f[_0x070e('0x5f')][_0x070e('0x8a')][_0x070e('0x8b')](_0x070e('0x8c'),'');_0x38b0e1['body'][_0x070e('0x5f')]=_0x46e19f[_0x070e('0x5f')][_0x070e('0x8d')];_0x38b0e1[_0x070e('0x5f')][_0x070e('0x8e')]=_0x46e19f[_0x070e('0x5f')]['MessageSid'];}if(_0x38b0e1['body']['id']){delete _0x38b0e1[_0x070e('0x5f')]['id'];}if(_[_0x070e('0x8f')](_0x38b0e1[_0x070e('0x5f')][_0x070e('0x89')])){throw new db[(_0x070e('0x1c'))][(_0x070e('0x1d'))](_0x070e('0x90'));}if(_['isNil'](_0x38b0e1[_0x070e('0x5f')]['body'])||_0x38b0e1[_0x070e('0x5f')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x070e('0x91'));}if(_[_0x070e('0x8f')](_0x38b0e1[_0x070e('0x5f')][_0x070e('0x92')])){throw new db[(_0x070e('0x1c'))][(_0x070e('0x1d'))](_0x070e('0x93')+_0x202ebf);}if(!_[_0x070e('0x94')](_0x202ebf,_0x38b0e1[_0x070e('0x5f')]['mapKey'])){throw new db[(_0x070e('0x1c'))][(_0x070e('0x1d'))](_0x070e('0x95')+_0x202ebf);}_0x1d48a9[_0x38b0e1[_0x070e('0x5f')][_0x070e('0x92')]]=_0x38b0e1[_0x070e('0x5f')][_0x070e('0x89')];return db[_0x070e('0x96')][_0x070e('0x57')]({'where':{'id':_0x38b0e1['account']['ListId']},'include':[{'model':db[_0x070e('0x97')],'as':_0x070e('0x98'),'where':_0x1d48a9,'limit':0x1,'order':[['updatedAt',_0x070e('0x99')]]}]});})['then'](handleEntityNotFound(_0x239385,null))['then'](function(_0x3f2eb0){if(_0x3f2eb0){_0x38b0e1[_0x070e('0x9a')]=_['omit'](_0x3f2eb0,[_0x070e('0x98')]);if(_0x3f2eb0[_0x070e('0x98')][_0x070e('0x44')]){return _0x3f2eb0['Contacts'][0x0];}var _0x590326=_[_0x070e('0x17')](_0x38b0e1[_0x070e('0x5f')],{'firstName':_0x38b0e1[_0x070e('0x5f')]['from'],'ListId':_0x3f2eb0['id']});_0x590326[_0x38b0e1[_0x070e('0x5f')][_0x070e('0x92')]]=_0x38b0e1['body'][_0x070e('0x89')];return db[_0x070e('0x97')][_0x070e('0x58')](_0x590326,{'fields':_0x5e71ab,'raw':!![]});}})[_0x070e('0x1f')](handleEntityNotFound(_0x239385,null))[_0x070e('0x1f')](function(_0x92db3c){if(_0x92db3c){_0x38b0e1[_0x070e('0x9b')]=_0x92db3c;var _0x1cf02b={'ContactId':_0x92db3c['id'],'phone':_0x38b0e1[_0x070e('0x5f')][_0x070e('0x89')],'WhatsappAccountId':_0x46e19f[_0x070e('0x52')]['id']};var _0x2b45d5={'ContactId':_0x92db3c['id'],'WhatsappAccountId':_0x46e19f[_0x070e('0x52')]['id'],'closed':![]};return db[_0x070e('0x9c')][_0x070e('0x57')]({'where':_0x2b45d5})[_0x070e('0x1f')](function(_0x2948a2){if(_0x2948a2){return[_0x2948a2,![]];}return db['WhatsappInteraction']['create'](_0x1cf02b)['then'](function(_0x52b206){return[_0x52b206,!![]];});});}})[_0x070e('0x70')](function(_0x8e9f07,_0x19a31f){_0x38b0e1['interaction']=_0x8e9f07[_0x070e('0x5a')]({'plain':!![]});_0x38b0e1[_0x070e('0x9d')][_0x070e('0x9e')]=![];if(_0x19a31f){if(_0x38b0e1['account'][_0x070e('0x9f')]){_0x38b0e1[_0x070e('0xa0')][_0x070e('0xa1')]({'id':0x0,'priority':_0x38b0e1[_0x070e('0xa0')]['length']+0x1,'app':_0x070e('0xa2'),'appdata':_0x070e('0xa3'),'interval':_0x070e('0xa4')});}_0x38b0e1['interaction'][_0x070e('0x9e')]=!![];}return db[_0x070e('0xa5')][_0x070e('0x58')]({'phone':_0x38b0e1[_0x070e('0x5f')][_0x070e('0x89')],'messageId':_0x38b0e1[_0x070e('0x5f')][_0x070e('0x8e')],'body':_0x38b0e1[_0x070e('0x5f')][_0x070e('0x5f')],'WhatsappAccountId':_0x46e19f['params']['id'],'WhatsappInteractionId':_0x8e9f07['id'],'direction':'in','ContactId':_0x8e9f07['ContactId'],'AttachmentId':_0x38b0e1[_0x070e('0x5f')]['AttachmentId']});})['then'](function(_0x197c18){_0x38b0e1[_0x070e('0x26')]=_0x197c18;if(_0x38b0e1[_0x070e('0x9d')][_0x070e('0xa6')]){return db[_0x070e('0x75')][_0x070e('0x57')]({'attributes':['id','name'],'where':{'id':_0x38b0e1[_0x070e('0x9d')][_0x070e('0xa6')]}})[_0x070e('0x1f')](function(_0x351d73){if(_0x351d73){_0x38b0e1['applications'][_0x070e('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x351d73[_0x070e('0x37')]+','+(_0x38b0e1[_0x070e('0x7f')][_0x070e('0xa8')]||0xa),'interval':_0x070e('0xa4')});}return respondWithRpcPromise(_0x070e('0xa9'),_0x070e('0xaa'),_0x38b0e1);});}return respondWithRpcPromise(_0x070e('0xa9'),_0x070e('0xaa'),_0x38b0e1);})[_0x070e('0x1f')](function(_0x537d78){if(_0x537d78){var _0xc35037=0xc8;var _0x1f71df=_0x070e('0xab');logger[_0x070e('0x20')](_0x070e('0xac'),_0x1f71df,_0xc35037,_0x070e('0xad'));logger[_0x070e('0xae')](_0x070e('0xaf'),_0x1f71df,_0xc35037,'entity\x20found',JSON[_0x070e('0x23')](_0x537d78));if(_0x38b0e1[_0x070e('0x7f')]['type']==='twilio'){return _0x239385[_0x070e('0x29')](_0xc35037)[_0x070e('0x2e')](_0x070e('0xb0'),_0x070e('0xb1'))[_0x070e('0x38')](_0x070e('0xb2'));}else{return _0x239385['status'](_0xc35037)['json'](_0x537d78);}}})[_0x070e('0x27')](handleError(_0x239385,null));};exports[_0x070e('0x38')]=function(_0x5079d9,_0x31d3fa,_0x5aebee){var _0x17e949,_0xa2c957,_0x535518;if(_[_0x070e('0x8f')](_0x5079d9[_0x070e('0x5f')]['body'])||_0x5079d9['body'][_0x070e('0x5f')]===''){throw new db['Sequelize'][(_0x070e('0x1d'))](_0x070e('0x91'));}if(_[_0x070e('0x8f')](_0x5079d9['body']['to'])){throw new db[(_0x070e('0x1c'))][(_0x070e('0x1d'))]('to\x20is\x20mandatory');}_0x17e949=_0x5079d9[_0x070e('0x5f')]['to'];return db[_0x070e('0x3b')][_0x070e('0x57')]({'where':{'id':_0x5079d9[_0x070e('0x52')]['id']},'include':[{'model':db[_0x070e('0x96')],'as':_0x070e('0xb3'),'include':[{'model':db[_0x070e('0x97')],'as':_0x070e('0x98'),'where':{'mobile':_0x17e949},'limit':0x1,'order':[[_0x070e('0x85'),_0x070e('0x99')]]}]}]})['then'](handleEntityNotFound(_0x31d3fa,null))[_0x070e('0x1f')](function(_0x11a111){if(_0x11a111&&_0x11a111[_0x070e('0xb3')]){_0xa2c957=_0x11a111['get']({'plain':!![]});if(_0xa2c957['List']&&_0xa2c957[_0x070e('0xb3')][_0x070e('0x98')][_0x070e('0x44')]){return _0xa2c957[_0x070e('0xb3')]['Contacts'][0x0];}return db[_0x070e('0x97')]['create'](_['defaults'](_0x5079d9[_0x070e('0x5f')],{'firstName':_0x17e949,'mobile':_0x17e949,'phone':_0x17e949,'ListId':_0xa2c957['ListId']}));}})[_0x070e('0x1f')](handleEntityNotFound(_0x31d3fa,null))[_0x070e('0x1f')](function(_0x1f4a5e){if(_0x1f4a5e){_0x535518=_0x1f4a5e;return db[_0x070e('0x9c')]['find']({'where':{'ContactId':_0x535518['id'],'closed':![],'WhatsappAccountId':_0xa2c957['id']}})[_0x070e('0x1f')](function(_0x532c79){if(_0x532c79){return[_0x532c79,![]];}return db[_0x070e('0x9c')][_0x070e('0x58')]({'UserId':_0x5079d9[_0x070e('0x59')]['id'],'ContactId':_0x535518['id'],'WhatsappAccountId':_0xa2c957['id'],'phone':_0x17e949,'firstMsgDirection':_0x070e('0xb4'),'Messages':[_[_0x070e('0x4a')](_0x5079d9[_0x070e('0x5f')],{'read':![],'body':_0x5079d9[_0x070e('0x5f')][_0x070e('0x5f')],'phone':_0x17e949,'WhatsappAccountId':_0xa2c957['id'],'UserId':_0x5079d9[_0x070e('0x59')]['id'],'ContactId':_0x535518['id']})]},{'include':[{'model':db[_0x070e('0xa5')],'as':_0x070e('0xb5')}]})[_0x070e('0x1f')](function(_0x1316d1){return[_0x1316d1,!![]];});});}})[_0x070e('0x70')](function(_0x9c7a91,_0x34e985){if(_0x34e985){return _0x9c7a91;}return db['WhatsappMessage']['create'](_[_0x070e('0x4a')](_0x5079d9[_0x070e('0x5f')],{'read':![],'body':_0x5079d9['body'][_0x070e('0x5f')],'phone':_0x17e949,'WhatsappAccountId':_0xa2c957['id'],'WhatsappInteractionId':_0x9c7a91['id'],'UserId':_0x5079d9[_0x070e('0x59')]['id'],'ContactId':_0x535518['id']}))['then'](function(_0x257a42){_0x9c7a91[_0x070e('0xb6')]['Messages']=[];_0x9c7a91[_0x070e('0xb6')][_0x070e('0xb5')][_0x070e('0xa1')](_0x257a42[_0x070e('0xb6')]);return _0x9c7a91;});})[_0x070e('0x1f')](respondWithResult(_0x31d3fa,null))[_0x070e('0x27')](handleError(_0x31d3fa,null));};
\ No newline at end of file
+var _0xbfcc=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','includeAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','MessageSid','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','defaults','contact','WhatsappInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','messageId','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a ','to\x20is\x20mandatory','List','WhatsappMessage','Messages','dataValues','html-pdf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','Pause','map','WhatsappAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','include','findAll','rows','show','params','mandatoryDispositionPause','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0xbfcc[_0x43fdf8];return _0x1160c6;};'use strict';var pdf=require(_0xcbfc('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcbfc('0x1'));var jsonpatch=require(_0xcbfc('0x2'));var rp=require(_0xcbfc('0x3'));var moment=require(_0xcbfc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcbfc('0x5'));var csv=require(_0xcbfc('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x6'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var db=require(_0xcbfc('0x14'))['db'];config[_0xcbfc('0x15')]=_['defaults'](config[_0xcbfc('0x15')],{'host':_0xcbfc('0x16'),'port':0x18eb});var socket=require(_0xcbfc('0x17'))(new Redis(config['redis']));require(_0xcbfc('0x18'))[_0xcbfc('0x19')](socket);var jayson=require(_0xcbfc('0x1a'));var client=jayson[_0xcbfc('0x1b')][_0xcbfc('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x53a7ea,_0x3c69ed,_0x1963de){if(_0x1963de){var _0x1ec8c4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ec8c4[_0xcbfc('0x1d')](_0x3c69ed)){return _0x53a7ea;}else{throw new db['Sequelize']['ValidationError'](_0xcbfc('0x1e'));}}else{return _0x53a7ea;}}function respondWithRpcPromise(_0xd8bbb3,_0xa65368,_0x4d6946,_0x5b078f){return new BPromise(function(_0x33f731,_0x99b59d){var _0x344510=_0x5b078f||client;return _0x344510['request'](_0xd8bbb3,_0x4d6946)[_0xcbfc('0x1f')](function(_0x552777){logger[_0xcbfc('0x20')](_0xcbfc('0x21'),_0xa65368,_0xcbfc('0x22'));logger[_0xcbfc('0x23')](_0xcbfc('0x24'),_0xa65368,_0xcbfc('0x22'),JSON['stringify'](_0x552777));if(_0x552777[_0xcbfc('0x25')]){if(_0x552777[_0xcbfc('0x25')]['code']===0x1f4){logger[_0xcbfc('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0xa65368,_0x552777['error']['message']);return _0x99b59d(_0x552777[_0xcbfc('0x25')]['message']);}logger['error'](_0xcbfc('0x21'),_0xa65368,_0x552777[_0xcbfc('0x25')][_0xcbfc('0x26')]);return _0x33f731(_0x552777[_0xcbfc('0x25')]['message']);}else{logger[_0xcbfc('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0xa65368,_0xcbfc('0x22'));_0x33f731(_0x552777[_0xcbfc('0x27')]['message']);}})[_0xcbfc('0x28')](function(_0x3b73a3){logger['error'](_0xcbfc('0x21'),_0xa65368,_0x3b73a3);_0x99b59d(_0x3b73a3);});});}function respondWithStatusCode(_0x3c3afd,_0x2f7549){_0x2f7549=_0x2f7549||0xcc;return function(_0x41f3b8){if(_0x41f3b8){return _0x3c3afd['sendStatus'](_0x2f7549);}return _0x3c3afd[_0xcbfc('0x29')](_0x2f7549)[_0xcbfc('0x2a')]();};}function respondWithResult(_0x4f632a,_0x1f6a14){_0x1f6a14=_0x1f6a14||0xc8;return function(_0x26463f){if(_0x26463f){return _0x4f632a[_0xcbfc('0x29')](_0x1f6a14)[_0xcbfc('0x2b')](_0x26463f);}};}function respondWithFilteredResult(_0x2b4286,_0x19d2e){return function(_0x203cec){if(_0x203cec){var _0x5366cf=_0x203cec[_0xcbfc('0x2c')],_0x41b68b=_0x19d2e['offset'],_0x433300=_0x19d2e[_0xcbfc('0x2d')]+_0x19d2e[_0xcbfc('0x2e')],_0x3f9d20;if(_0x433300>=_0x5366cf){_0x433300=_0x5366cf;_0x3f9d20=0xc8;}else{_0x3f9d20=0xce;}_0x2b4286[_0xcbfc('0x29')](_0x3f9d20);return _0x2b4286[_0xcbfc('0x2f')](_0xcbfc('0x30'),_0x41b68b+'-'+_0x433300+'/'+_0x5366cf)[_0xcbfc('0x2b')](_0x203cec);}return null;};}function patchUpdates(_0x7f7dda){return function(_0x544f7c){try{jsonpatch[_0xcbfc('0x31')](_0x544f7c,_0x7f7dda,!![]);}catch(_0x26172f){return BPromise['reject'](_0x26172f);}return _0x544f7c[_0xcbfc('0x32')]();};}function saveUpdates(_0x442cab,_0x145530){return function(_0x4f9334){if(_0x4f9334){return _0x4f9334['update'](_0x442cab)['then'](function(_0x3c6d04){return _0x3c6d04;});}return null;};}function removeEntity(_0x7e69bb,_0x1d47a4){return function(_0x9c1ff3){if(_0x9c1ff3){return _0x9c1ff3[_0xcbfc('0x33')]()[_0xcbfc('0x1f')](function(){var _0x856e83=_0x9c1ff3[_0xcbfc('0x34')]({'plain':!![]});var _0x49ad63=_0xcbfc('0x35');return db[_0xcbfc('0x36')]['destroy']({'where':{'type':_0x49ad63,'resourceId':_0x856e83['id']}})[_0xcbfc('0x1f')](function(){return _0x9c1ff3;});})['then'](function(){_0x7e69bb[_0xcbfc('0x29')](0xcc)[_0xcbfc('0x2a')]();});}};}function handleEntityNotFound(_0x43121e,_0x53ac0e){return function(_0x43f45b){if(!_0x43f45b){_0x43121e['sendStatus'](0x194);}return _0x43f45b;};}function handleError(_0x5af34d,_0x2baf2f){_0x2baf2f=_0x2baf2f||0x1f4;return function(_0x218772){logger[_0xcbfc('0x25')](_0x218772[_0xcbfc('0x37')]);if(_0x218772[_0xcbfc('0x38')]){delete _0x218772[_0xcbfc('0x38')];}_0x5af34d[_0xcbfc('0x29')](_0x2baf2f)[_0xcbfc('0x39')](_0x218772);};}exports['index']=function(_0x15fb08,_0x4aa064){var _0x15a5c4={'include':[{'model':db[_0xcbfc('0x3a')],'as':'mandatoryDispositionPause'}]},_0x44064d={},_0x312d28={'count':0x0,'rows':[]};var _0x5306e9=_[_0xcbfc('0x3b')](db[_0xcbfc('0x3c')][_0xcbfc('0x3d')],function(_0x291389){return{'name':_0x291389[_0xcbfc('0x3e')],'type':_0x291389['type'][_0xcbfc('0x3f')]};});_0x44064d[_0xcbfc('0x40')]=_[_0xcbfc('0x3b')](_0x5306e9,'name');_0x44064d[_0xcbfc('0x41')]=_[_0xcbfc('0x42')](_0x15fb08[_0xcbfc('0x41')]);_0x44064d['filters']=_[_0xcbfc('0x43')](_0x44064d[_0xcbfc('0x40')],_0x44064d[_0xcbfc('0x41')]);_0x15a5c4[_0xcbfc('0x44')]=_[_0xcbfc('0x43')](_0x44064d[_0xcbfc('0x40')],qs[_0xcbfc('0x45')](_0x15fb08['query'][_0xcbfc('0x45')]));_0x15a5c4[_0xcbfc('0x44')]=_0x15a5c4['attributes'][_0xcbfc('0x46')]?_0x15a5c4[_0xcbfc('0x44')]:_0x44064d[_0xcbfc('0x40')];if(!_0x15fb08[_0xcbfc('0x41')][_0xcbfc('0x47')](_0xcbfc('0x48'))){_0x15a5c4[_0xcbfc('0x2e')]=qs[_0xcbfc('0x2e')](_0x15fb08['query'][_0xcbfc('0x2e')]);_0x15a5c4[_0xcbfc('0x2d')]=qs[_0xcbfc('0x2d')](_0x15fb08[_0xcbfc('0x41')][_0xcbfc('0x2d')]);}_0x15a5c4[_0xcbfc('0x49')]=qs[_0xcbfc('0x4a')](_0x15fb08['query'][_0xcbfc('0x4a')]);_0x15a5c4[_0xcbfc('0x4b')]=qs['filters'](_[_0xcbfc('0x4c')](_0x15fb08[_0xcbfc('0x41')],_0x44064d[_0xcbfc('0x4d')]),_0x5306e9);if(_0x15fb08['query'][_0xcbfc('0x4e')]){_0x15a5c4[_0xcbfc('0x4b')]=_[_0xcbfc('0x4f')](_0x15a5c4[_0xcbfc('0x4b')],{'$or':_[_0xcbfc('0x3b')](_0x5306e9,function(_0xe0025a){if(_0xe0025a[_0xcbfc('0x50')]!=='VIRTUAL'){var _0x5a87b6={};_0x5a87b6[_0xe0025a[_0xcbfc('0x38')]]={'$like':'%'+_0x15fb08[_0xcbfc('0x41')][_0xcbfc('0x4e')]+'%'};return _0x5a87b6;}})});}_0x15a5c4=_[_0xcbfc('0x4f')]({},_0x15a5c4,_0x15fb08['options']);var _0x52a835={'where':_0x15a5c4[_0xcbfc('0x4b')]};return db[_0xcbfc('0x3c')][_0xcbfc('0x2c')](_0x52a835)['then'](function(_0x155236){_0x312d28[_0xcbfc('0x2c')]=_0x155236;if(_0x15fb08[_0xcbfc('0x41')]['includeAll']){_0x15a5c4[_0xcbfc('0x51')]=[{'all':!![]}];}return db[_0xcbfc('0x3c')][_0xcbfc('0x52')](_0x15a5c4);})[_0xcbfc('0x1f')](function(_0x32e0c3){_0x312d28[_0xcbfc('0x53')]=_0x32e0c3;return _0x312d28;})[_0xcbfc('0x1f')](respondWithFilteredResult(_0x4aa064,_0x15a5c4))[_0xcbfc('0x28')](handleError(_0x4aa064,null));};exports[_0xcbfc('0x54')]=function(_0xdee298,_0x48b5c8){var _0x3fb619={'raw':![],'where':{'id':_0xdee298[_0xcbfc('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xcbfc('0x56')}]},_0x3a2c1a={};_0x3a2c1a[_0xcbfc('0x40')]=_['keys'](db[_0xcbfc('0x3c')][_0xcbfc('0x3d')]);_0x3a2c1a[_0xcbfc('0x41')]=_[_0xcbfc('0x42')](_0xdee298['query']);_0x3a2c1a[_0xcbfc('0x4d')]=_[_0xcbfc('0x43')](_0x3a2c1a['model'],_0x3a2c1a[_0xcbfc('0x41')]);_0x3fb619[_0xcbfc('0x44')]=_[_0xcbfc('0x43')](_0x3a2c1a[_0xcbfc('0x40')],qs[_0xcbfc('0x45')](_0xdee298[_0xcbfc('0x41')][_0xcbfc('0x45')]));_0x3fb619[_0xcbfc('0x44')]=_0x3fb619[_0xcbfc('0x44')][_0xcbfc('0x46')]?_0x3fb619['attributes']:_0x3a2c1a[_0xcbfc('0x40')];if(_0xdee298['query']['includeAll']){_0x3fb619['include']=[{'all':!![]}];}_0x3fb619=_[_0xcbfc('0x4f')]({},_0x3fb619,_0xdee298[_0xcbfc('0x57')]);return db[_0xcbfc('0x3c')][_0xcbfc('0x58')](_0x3fb619)[_0xcbfc('0x1f')](handleEntityNotFound(_0x48b5c8,null))[_0xcbfc('0x1f')](respondWithResult(_0x48b5c8,null))[_0xcbfc('0x28')](handleError(_0x48b5c8,null));};exports[_0xcbfc('0x59')]=function(_0x4d2df1,_0x9e0c38){return db[_0xcbfc('0x3c')][_0xcbfc('0x59')](_0x4d2df1['body'],{})[_0xcbfc('0x1f')](function(_0x2c5c9e){var _0x1ad026=_0x4d2df1[_0xcbfc('0x5a')][_0xcbfc('0x34')]({'plain':!![]});if(!_0x1ad026)throw new Error(_0xcbfc('0x5b'));if(_0x1ad026[_0xcbfc('0x5c')]==='user'){var _0x329ae6=_0x2c5c9e['get']({'plain':!![]});var _0x1e0492=_0xcbfc('0x35');return db['UserProfileSection'][_0xcbfc('0x58')]({'where':{'name':_0x1e0492,'userProfileId':_0x1ad026['userProfileId']},'raw':!![]})[_0xcbfc('0x1f')](function(_0x3e6cbf){if(_0x3e6cbf&&_0x3e6cbf[_0xcbfc('0x5d')]===0x0){return db[_0xcbfc('0x36')][_0xcbfc('0x59')]({'name':_0x329ae6[_0xcbfc('0x38')],'resourceId':_0x329ae6['id'],'type':_0x3e6cbf['name'],'sectionId':_0x3e6cbf['id']},{})[_0xcbfc('0x1f')](function(){return _0x2c5c9e;});}else{return _0x2c5c9e;}})[_0xcbfc('0x28')](function(_0x5a78c9){logger[_0xcbfc('0x25')](_0xcbfc('0x5e'),_0x5a78c9);throw _0x5a78c9;});}return _0x2c5c9e;})[_0xcbfc('0x1f')](respondWithResult(_0x9e0c38,0xc9))[_0xcbfc('0x28')](handleError(_0x9e0c38,null));};exports[_0xcbfc('0x5f')]=function(_0x3af38b,_0x2bf39a){if(_0x3af38b[_0xcbfc('0x60')]['id']){delete _0x3af38b['body']['id'];}return db[_0xcbfc('0x3c')][_0xcbfc('0x58')]({'where':{'id':_0x3af38b[_0xcbfc('0x55')]['id']},'include':[{'model':db[_0xcbfc('0x3a')],'as':_0xcbfc('0x56')}]})[_0xcbfc('0x1f')](handleEntityNotFound(_0x2bf39a,null))[_0xcbfc('0x1f')](saveUpdates(_0x3af38b[_0xcbfc('0x60')],null))[_0xcbfc('0x1f')](respondWithResult(_0x2bf39a,null))[_0xcbfc('0x28')](handleError(_0x2bf39a,null));};exports['destroy']=function(_0x185303,_0x108768){return db['WhatsappAccount'][_0xcbfc('0x58')]({'where':{'id':_0x185303['params']['id']}})['then'](handleEntityNotFound(_0x108768,null))[_0xcbfc('0x1f')](removeEntity(_0x108768,null))[_0xcbfc('0x28')](handleError(_0x108768,null));};exports[_0xcbfc('0x61')]=function(_0x133829,_0x33d4d8){return db['WhatsappAccount']['describe']()[_0xcbfc('0x1f')](respondWithResult(_0x33d4d8,null))[_0xcbfc('0x28')](handleError(_0x33d4d8,null));};exports[_0xcbfc('0x62')]=function(_0x26cb3a,_0x17e42f,_0x53012d){if(_0x26cb3a[_0xcbfc('0x60')]['id']){delete _0x26cb3a[_0xcbfc('0x60')]['id'];}return db[_0xcbfc('0x3c')]['find']({'where':{'id':_0x26cb3a['params']['id']}})['then'](handleEntityNotFound(_0x17e42f,null))[_0xcbfc('0x1f')](function(_0x47f928){if(_0x47f928){_0x26cb3a['body'][_0xcbfc('0x63')]=_0x47f928['id'];return db['Disposition'][_0xcbfc('0x59')](_0x26cb3a[_0xcbfc('0x60')]);}})[_0xcbfc('0x1f')](respondWithResult(_0x17e42f,null))[_0xcbfc('0x28')](handleError(_0x17e42f,null));};exports[_0xcbfc('0x64')]=function(_0x4923e5,_0x25d2a7,_0xd3c182){var _0x1140d1={'raw':![],'where':{}};var _0x538954={};var _0xa490ee={'count':0x0,'rows':[]};return db[_0xcbfc('0x3c')][_0xcbfc('0x65')]({'where':{'id':_0x4923e5['params']['id']}})[_0xcbfc('0x1f')](handleEntityNotFound(_0x25d2a7,null))[_0xcbfc('0x1f')](function(_0x18863c){if(_0x18863c){_0x538954[_0xcbfc('0x40')]=_[_0xcbfc('0x42')](db[_0xcbfc('0x66')][_0xcbfc('0x3d')]);_0x538954['query']=_[_0xcbfc('0x42')](_0x4923e5['query']);_0x538954[_0xcbfc('0x4d')]=_[_0xcbfc('0x43')](_0x538954[_0xcbfc('0x40')],_0x538954['query']);_0x1140d1[_0xcbfc('0x44')]=_['intersection'](_0x538954[_0xcbfc('0x40')],qs[_0xcbfc('0x45')](_0x4923e5[_0xcbfc('0x41')][_0xcbfc('0x45')]));_0x1140d1[_0xcbfc('0x44')]=_0x1140d1[_0xcbfc('0x44')][_0xcbfc('0x46')]?_0x1140d1['attributes']:_0x538954[_0xcbfc('0x40')];if(!_0x4923e5[_0xcbfc('0x41')][_0xcbfc('0x47')]('nolimit')){_0x1140d1[_0xcbfc('0x2e')]=qs['limit'](_0x4923e5[_0xcbfc('0x41')][_0xcbfc('0x2e')]);_0x1140d1[_0xcbfc('0x2d')]=qs['offset'](_0x4923e5[_0xcbfc('0x41')][_0xcbfc('0x2d')]);}_0x1140d1['order']=qs[_0xcbfc('0x4a')](_0x4923e5['query'][_0xcbfc('0x4a')]);_0x1140d1['where']=qs[_0xcbfc('0x4d')](_[_0xcbfc('0x4c')](_0x4923e5['query'],_0x538954[_0xcbfc('0x4d')]));_0x1140d1['where'][_0xcbfc('0x63')]=_0x18863c['id'];if(_0x4923e5[_0xcbfc('0x41')][_0xcbfc('0x4e')]){_0x1140d1[_0xcbfc('0x4b')]=_['merge'](_0x1140d1[_0xcbfc('0x4b')],{'$or':_['map'](_0x1140d1[_0xcbfc('0x44')],function(_0x44c295){var _0xab8e52={};_0xab8e52[_0x44c295]={'$like':'%'+_0x4923e5[_0xcbfc('0x41')][_0xcbfc('0x4e')]+'%'};return _0xab8e52;})});}_0x1140d1=_[_0xcbfc('0x4f')]({},_0x1140d1,_0x4923e5[_0xcbfc('0x57')]);return db[_0xcbfc('0x66')][_0xcbfc('0x2c')]({'where':_0x1140d1[_0xcbfc('0x4b')]})[_0xcbfc('0x1f')](function(_0x297513){_0xa490ee[_0xcbfc('0x2c')]=_0x297513;if(_0x4923e5[_0xcbfc('0x41')][_0xcbfc('0x67')]){_0x1140d1[_0xcbfc('0x51')]=[{'all':!![]}];}return db[_0xcbfc('0x66')]['findAll'](_0x1140d1);})[_0xcbfc('0x1f')](function(_0x59725a){_0xa490ee[_0xcbfc('0x53')]=_0x59725a;return _0xa490ee;});}})['then'](respondWithFilteredResult(_0x25d2a7,_0x1140d1))[_0xcbfc('0x28')](handleError(_0x25d2a7,null));};exports[_0xcbfc('0x68')]=function(_0x3bbe6d,_0x2f99a3,_0x386156){return db[_0xcbfc('0x3c')][_0xcbfc('0x58')]({'where':{'id':_0x3bbe6d['params']['id']}})[_0xcbfc('0x1f')](handleEntityNotFound(_0x2f99a3,null))['then'](function(_0x144c8d){if(_0x144c8d){return _0x144c8d[_0xcbfc('0x68')](_0x3bbe6d['query']['ids']);}})['then'](respondWithStatusCode(_0x2f99a3,null))[_0xcbfc('0x28')](handleError(_0x2f99a3,null));};exports[_0xcbfc('0x69')]=function(_0x12238c,_0x511463,_0x4f298c){if(_0x12238c[_0xcbfc('0x60')]['id']){delete _0x12238c[_0xcbfc('0x60')]['id'];}return db[_0xcbfc('0x3c')][_0xcbfc('0x58')]({'where':{'id':_0x12238c[_0xcbfc('0x55')]['id']}})['then'](handleEntityNotFound(_0x511463,null))['then'](function(_0x5ee979){if(_0x5ee979){_0x12238c[_0xcbfc('0x60')][_0xcbfc('0x63')]=_0x5ee979['id'];return db[_0xcbfc('0x6a')][_0xcbfc('0x59')](_0x12238c['body']);}})['then'](respondWithResult(_0x511463,null))[_0xcbfc('0x28')](handleError(_0x511463,null));};exports[_0xcbfc('0x6b')]=function(_0xcd6615,_0x3053d9,_0x36ab87){var _0x57fe81={'raw':![],'where':{}};var _0x560505={};var _0x20d523={'count':0x0,'rows':[]};return db[_0xcbfc('0x3c')][_0xcbfc('0x65')]({'where':{'id':_0xcd6615[_0xcbfc('0x55')]['id']}})[_0xcbfc('0x1f')](handleEntityNotFound(_0x3053d9,null))[_0xcbfc('0x1f')](function(_0x182471){if(_0x182471){_0x560505[_0xcbfc('0x40')]=_[_0xcbfc('0x42')](db[_0xcbfc('0x6a')][_0xcbfc('0x3d')]);_0x560505[_0xcbfc('0x41')]=_[_0xcbfc('0x42')](_0xcd6615[_0xcbfc('0x41')]);_0x560505['filters']=_['intersection'](_0x560505[_0xcbfc('0x40')],_0x560505[_0xcbfc('0x41')]);_0x57fe81[_0xcbfc('0x44')]=_['intersection'](_0x560505[_0xcbfc('0x40')],qs[_0xcbfc('0x45')](_0xcd6615[_0xcbfc('0x41')][_0xcbfc('0x45')]));_0x57fe81['attributes']=_0x57fe81['attributes'][_0xcbfc('0x46')]?_0x57fe81[_0xcbfc('0x44')]:_0x560505[_0xcbfc('0x40')];if(!_0xcd6615[_0xcbfc('0x41')][_0xcbfc('0x47')](_0xcbfc('0x48'))){_0x57fe81[_0xcbfc('0x2e')]=qs[_0xcbfc('0x2e')](_0xcd6615[_0xcbfc('0x41')][_0xcbfc('0x2e')]);_0x57fe81[_0xcbfc('0x2d')]=qs[_0xcbfc('0x2d')](_0xcd6615[_0xcbfc('0x41')][_0xcbfc('0x2d')]);}_0x57fe81[_0xcbfc('0x49')]=qs[_0xcbfc('0x4a')](_0xcd6615[_0xcbfc('0x41')][_0xcbfc('0x4a')]);_0x57fe81[_0xcbfc('0x4b')]=qs['filters'](_[_0xcbfc('0x4c')](_0xcd6615['query'],_0x560505[_0xcbfc('0x4d')]));_0x57fe81['where'][_0xcbfc('0x63')]=_0x182471['id'];if(_0xcd6615['query']['filter']){_0x57fe81['where']=_[_0xcbfc('0x4f')](_0x57fe81[_0xcbfc('0x4b')],{'$or':_[_0xcbfc('0x3b')](_0x57fe81[_0xcbfc('0x44')],function(_0x3fb8e1){var _0x5a2b33={};_0x5a2b33[_0x3fb8e1]={'$like':'%'+_0xcd6615[_0xcbfc('0x41')][_0xcbfc('0x4e')]+'%'};return _0x5a2b33;})});}_0x57fe81=_[_0xcbfc('0x4f')]({},_0x57fe81,_0xcd6615[_0xcbfc('0x57')]);return db[_0xcbfc('0x6a')][_0xcbfc('0x2c')]({'where':_0x57fe81[_0xcbfc('0x4b')]})[_0xcbfc('0x1f')](function(_0x48078d){_0x20d523[_0xcbfc('0x2c')]=_0x48078d;if(_0xcd6615[_0xcbfc('0x41')][_0xcbfc('0x67')]){_0x57fe81['include']=[{'all':!![]}];}return db[_0xcbfc('0x6a')][_0xcbfc('0x52')](_0x57fe81);})[_0xcbfc('0x1f')](function(_0x10299e){_0x20d523['rows']=_0x10299e;return _0x20d523;});}})[_0xcbfc('0x1f')](respondWithFilteredResult(_0x3053d9,_0x57fe81))[_0xcbfc('0x28')](handleError(_0x3053d9,null));};exports[_0xcbfc('0x6c')]=function(_0x355b7c,_0x3ace3c,_0x3dc2b1){return db[_0xcbfc('0x3c')][_0xcbfc('0x58')]({'where':{'id':_0x355b7c[_0xcbfc('0x55')]['id']}})[_0xcbfc('0x1f')](handleEntityNotFound(_0x3ace3c,null))['then'](function(_0x4d6bf6){if(_0x4d6bf6){return _0x4d6bf6[_0xcbfc('0x6c')](_0x355b7c[_0xcbfc('0x41')][_0xcbfc('0x6d')]);}})['then'](respondWithStatusCode(_0x3ace3c,null))[_0xcbfc('0x28')](handleError(_0x3ace3c,null));};exports['addAgents']=function(_0x5bd871,_0x47e307,_0x58f952){return db[_0xcbfc('0x3c')][_0xcbfc('0x58')]({'where':{'id':_0x5bd871[_0xcbfc('0x55')]['id']}})[_0xcbfc('0x1f')](handleEntityNotFound(_0x47e307,null))[_0xcbfc('0x1f')](function(_0x4d8f4f){if(_0x4d8f4f){return _0x4d8f4f[_0xcbfc('0x6e')](_0x5bd871[_0xcbfc('0x60')][_0xcbfc('0x6d')],_['omit'](_0x5bd871[_0xcbfc('0x60')],['ids','id'])||{})['spread'](function(_0x24e0ca){for(var _0x26940d=0x0;_0x26940d<_0x5bd871[_0xcbfc('0x60')]['ids'][_0xcbfc('0x46')];_0x26940d+=0x1){socket[_0xcbfc('0x6f')](_0xcbfc('0x70'),{'UserId':_0x5bd871['body'][_0xcbfc('0x6d')][_0x26940d],'WhatsappAccountId':_0x5bd871[_0xcbfc('0x55')]['id']});}return _0x24e0ca;});}})[_0xcbfc('0x1f')](respondWithResult(_0x47e307,null))[_0xcbfc('0x28')](handleError(_0x47e307,null));};exports[_0xcbfc('0x71')]=function(_0x5abde1,_0x2665c0,_0x2e187e){return db[_0xcbfc('0x3c')]['find']({'where':{'id':_0x5abde1[_0xcbfc('0x55')]['id']}})[_0xcbfc('0x1f')](handleEntityNotFound(_0x2665c0,null))[_0xcbfc('0x1f')](function(_0xc7dd85){if(_0xc7dd85){return _0xc7dd85['removeAgents'](_0x5abde1[_0xcbfc('0x41')][_0xcbfc('0x6d')])[_0xcbfc('0x1f')](function(){if(_[_0xcbfc('0x72')](_0x5abde1[_0xcbfc('0x41')][_0xcbfc('0x6d')])){for(var _0x5ac72c=0x0;_0x5ac72c<_0x5abde1['query']['ids']['length'];_0x5ac72c+=0x1){socket[_0xcbfc('0x6f')](_0xcbfc('0x73'),{'UserId':Number(_0x5abde1[_0xcbfc('0x41')][_0xcbfc('0x6d')][_0x5ac72c]),'WhatsappAccountId':Number(_0x5abde1[_0xcbfc('0x55')]['id'])});}}else{socket[_0xcbfc('0x6f')](_0xcbfc('0x73'),{'UserId':Number(_0x5abde1['query'][_0xcbfc('0x6d')]),'WhatsappAccountId':Number(_0x5abde1['params']['id'])});}});}})[_0xcbfc('0x1f')](respondWithStatusCode(_0x2665c0,null))[_0xcbfc('0x28')](handleError(_0x2665c0,null));};exports[_0xcbfc('0x74')]=function(_0x2cf01d,_0x5066c3,_0x270345){var _0x2d9156={};var _0x2478d0={};var _0x10b32c;var _0xbff166;return db[_0xcbfc('0x3c')][_0xcbfc('0x65')]({'where':{'id':_0x2cf01d[_0xcbfc('0x55')]['id']}})[_0xcbfc('0x1f')](handleEntityNotFound(_0x5066c3,null))[_0xcbfc('0x1f')](function(_0x31a2e9){if(_0x31a2e9){_0x10b32c=_0x31a2e9;_0x2478d0[_0xcbfc('0x40')]=_['keys'](db[_0xcbfc('0x75')][_0xcbfc('0x3d')]);_0x2478d0[_0xcbfc('0x41')]=_[_0xcbfc('0x42')](_0x2cf01d[_0xcbfc('0x41')]);_0x2478d0[_0xcbfc('0x4d')]=_[_0xcbfc('0x43')](_0x2478d0[_0xcbfc('0x40')],_0x2478d0[_0xcbfc('0x41')]);_0x2d9156['attributes']=_[_0xcbfc('0x43')](_0x2478d0['model'],qs['fields'](_0x2cf01d[_0xcbfc('0x41')][_0xcbfc('0x45')]));_0x2d9156[_0xcbfc('0x44')]=_0x2d9156[_0xcbfc('0x44')][_0xcbfc('0x46')]?_0x2d9156[_0xcbfc('0x44')]:_0x2478d0[_0xcbfc('0x40')];_0x2d9156[_0xcbfc('0x49')]=qs[_0xcbfc('0x4a')](_0x2cf01d[_0xcbfc('0x41')][_0xcbfc('0x4a')]);_0x2d9156['where']=qs[_0xcbfc('0x4d')](_['pick'](_0x2cf01d[_0xcbfc('0x41')],_0x2478d0[_0xcbfc('0x4d')]));if(_0x2cf01d[_0xcbfc('0x41')][_0xcbfc('0x4e')]){_0x2d9156[_0xcbfc('0x4b')]=_[_0xcbfc('0x4f')](_0x2d9156[_0xcbfc('0x4b')],{'$or':_[_0xcbfc('0x3b')](_0x2d9156[_0xcbfc('0x44')],function(_0x389a8a){var _0x2f6b7f={};_0x2f6b7f[_0x389a8a]={'$like':'%'+_0x2cf01d[_0xcbfc('0x41')][_0xcbfc('0x4e')]+'%'};return _0x2f6b7f;})});}_0x2d9156=_[_0xcbfc('0x4f')]({},_0x2d9156,_0x2cf01d[_0xcbfc('0x57')]);return _0x10b32c[_0xcbfc('0x74')](_0x2d9156);}})[_0xcbfc('0x1f')](function(_0x2dd811){if(_0x2dd811){_0xbff166=_0x2dd811[_0xcbfc('0x46')];if(!_0x2cf01d[_0xcbfc('0x41')][_0xcbfc('0x47')](_0xcbfc('0x48'))){_0x2d9156[_0xcbfc('0x2e')]=qs['limit'](_0x2cf01d['query']['limit']);_0x2d9156[_0xcbfc('0x2d')]=qs[_0xcbfc('0x2d')](_0x2cf01d[_0xcbfc('0x41')][_0xcbfc('0x2d')]);}return _0x10b32c[_0xcbfc('0x74')](_0x2d9156);}})[_0xcbfc('0x1f')](function(_0x44e3fc){if(_0x44e3fc){return _0x44e3fc?{'count':_0xbff166,'rows':_0x44e3fc}:null;}})[_0xcbfc('0x1f')](respondWithResult(_0x5066c3,null))[_0xcbfc('0x28')](handleError(_0x5066c3,null));};exports[_0xcbfc('0x76')]=function(_0x5cfebe,_0x2d813a,_0x3e993c){return db[_0xcbfc('0x3c')][_0xcbfc('0x65')]({'where':{'id':_0x5cfebe[_0xcbfc('0x55')]['id']}})['then'](handleEntityNotFound(_0x2d813a,null))[_0xcbfc('0x1f')](function(_0x1b6fcd){if(_0x1b6fcd){return db[_0xcbfc('0x77')][_0xcbfc('0x78')](function(_0x19cb9a){return db[_0xcbfc('0x79')][_0xcbfc('0x33')]({'where':{'WhatsappAccountId':_0x5cfebe[_0xcbfc('0x55')]['id']},'transaction':_0x19cb9a})[_0xcbfc('0x1f')](function(_0x483cfc){var _0xe33430=_['map'](_0x5cfebe['body'],function(_0x3680bd){_0x3680bd[_0xcbfc('0x63')]=_0x5cfebe[_0xcbfc('0x55')]['id'];return _0x3680bd;});return db['WhatsappApplication'][_0xcbfc('0x7a')](_0xe33430,{'transaction':_0x19cb9a});});})[_0xcbfc('0x1f')](function(){return db[_0xcbfc('0x79')][_0xcbfc('0x7b')]({'where':{'WhatsappAccountId':_0x5cfebe[_0xcbfc('0x55')]['id']},'order':_0xcbfc('0x7c')});});}})['then'](respondWithResult(_0x2d813a,null))[_0xcbfc('0x28')](handleError(_0x2d813a,null));};exports[_0xcbfc('0x7d')]=function(_0x2b9b08,_0x85665b,_0x212c00){var _0x241b30={};var _0x68bbab={};var _0x54bcba;var _0x4637ce;return db[_0xcbfc('0x3c')]['findOne']({'where':{'id':_0x2b9b08['params']['id']}})['then'](handleEntityNotFound(_0x85665b,null))[_0xcbfc('0x1f')](function(_0x2d20f8){if(_0x2d20f8){_0x54bcba=_0x2d20f8;_0x68bbab[_0xcbfc('0x40')]=_[_0xcbfc('0x42')](db['WhatsappApplication']['rawAttributes']);_0x68bbab[_0xcbfc('0x41')]=_[_0xcbfc('0x42')](_0x2b9b08['query']);_0x68bbab[_0xcbfc('0x4d')]=_[_0xcbfc('0x43')](_0x68bbab['model'],_0x68bbab[_0xcbfc('0x41')]);_0x241b30[_0xcbfc('0x44')]=_[_0xcbfc('0x43')](_0x68bbab[_0xcbfc('0x40')],qs[_0xcbfc('0x45')](_0x2b9b08['query'][_0xcbfc('0x45')]));_0x241b30[_0xcbfc('0x44')]=_0x241b30[_0xcbfc('0x44')][_0xcbfc('0x46')]?_0x241b30['attributes']:_0x68bbab[_0xcbfc('0x40')];_0x241b30[_0xcbfc('0x49')]=qs[_0xcbfc('0x4a')](_0x2b9b08[_0xcbfc('0x41')][_0xcbfc('0x4a')]);_0x241b30[_0xcbfc('0x4b')]=qs['filters'](_[_0xcbfc('0x4c')](_0x2b9b08['query'],_0x68bbab[_0xcbfc('0x4d')]));if(_0x2b9b08[_0xcbfc('0x41')][_0xcbfc('0x4e')]){_0x241b30['where']=_[_0xcbfc('0x4f')](_0x241b30[_0xcbfc('0x4b')],{'$or':_[_0xcbfc('0x3b')](_0x241b30[_0xcbfc('0x44')],function(_0x4661d){var _0x18e451={};_0x18e451[_0x4661d]={'$like':'%'+_0x2b9b08[_0xcbfc('0x41')]['filter']+'%'};return _0x18e451;})});}_0x241b30=_[_0xcbfc('0x4f')]({},_0x241b30,_0x2b9b08[_0xcbfc('0x57')]);return _0x54bcba[_0xcbfc('0x7d')](_0x241b30);}})[_0xcbfc('0x1f')](function(_0x22e3b6){if(_0x22e3b6){_0x4637ce=_0x22e3b6[_0xcbfc('0x46')];if(!_0x2b9b08[_0xcbfc('0x41')]['hasOwnProperty'](_0xcbfc('0x48'))){_0x241b30['limit']=qs[_0xcbfc('0x2e')](_0x2b9b08[_0xcbfc('0x41')][_0xcbfc('0x2e')]);_0x241b30['offset']=qs[_0xcbfc('0x2d')](_0x2b9b08['query'][_0xcbfc('0x2d')]);}return _0x54bcba[_0xcbfc('0x7d')](_0x241b30);}})[_0xcbfc('0x1f')](function(_0x35cd37){if(_0x35cd37){return _0x35cd37?{'count':_0x4637ce,'rows':_0x35cd37}:null;}})[_0xcbfc('0x1f')](respondWithResult(_0x85665b,null))[_0xcbfc('0x28')](handleError(_0x85665b,null));};exports[_0xcbfc('0x7e')]=function(_0x4f5bab,_0x210218,_0x59f7a8){var _0x422e8c={'channel':_0xcbfc('0x7f')};var _0x31f657=[];var _0x141bfe=[];var _0x34d23a={};return db[_0xcbfc('0x3c')][_0xcbfc('0x58')]({'where':{'id':_0x4f5bab[_0xcbfc('0x55')]['id']},'include':[{'model':db[_0xcbfc('0x79')],'as':_0xcbfc('0x80')}]})[_0xcbfc('0x1f')](handleEntityNotFound(_0x210218,null))[_0xcbfc('0x1f')](function(_0x36ab9c){_0x422e8c[_0xcbfc('0x81')]=_0x36ab9c;_0x422e8c[_0xcbfc('0x82')]=_[_0xcbfc('0x83')](_0x36ab9c[_0xcbfc('0x80')],[_0xcbfc('0x7c')],[_0xcbfc('0x84')]);if(_0x422e8c[_0xcbfc('0x81')][_0xcbfc('0x80')]){delete _0x422e8c['account'][_0xcbfc('0x80')];}return db[_0xcbfc('0x85')][_0xcbfc('0x61')]();})[_0xcbfc('0x1f')](function(_0x4dbabd){if(!_0x4dbabd){throw new db['Sequelize'][(_0xcbfc('0x86'))](_0xcbfc('0x87'));}_0x31f657=_['difference'](_['keys'](_0x4dbabd),[_0xcbfc('0x88'),_0xcbfc('0x89')]);_0x141bfe=_['difference'](_['keys'](_0x4dbabd),[_0xcbfc('0x88'),_0xcbfc('0x89'),_0xcbfc('0x8a'),_0xcbfc('0x8b')]);_0x422e8c[_0xcbfc('0x60')]={'mapKey':_0xcbfc('0x8c')};if(_0x422e8c[_0xcbfc('0x81')][_0xcbfc('0x50')]&&_0x422e8c[_0xcbfc('0x81')][_0xcbfc('0x50')]===_0xcbfc('0x8d')){_0x422e8c['body'][_0xcbfc('0x8e')]=_0x4f5bab[_0xcbfc('0x60')][_0xcbfc('0x8f')][_0xcbfc('0x90')](_0xcbfc('0x91'),'');_0x422e8c[_0xcbfc('0x60')][_0xcbfc('0x60')]=_0x4f5bab[_0xcbfc('0x60')][_0xcbfc('0x92')];_0x422e8c[_0xcbfc('0x60')]['messageId']=_0x4f5bab[_0xcbfc('0x60')][_0xcbfc('0x93')];}if(_0x422e8c[_0xcbfc('0x60')]['id']){delete _0x422e8c[_0xcbfc('0x60')]['id'];}if(_[_0xcbfc('0x94')](_0x422e8c['body'][_0xcbfc('0x8e')])){throw new db[(_0xcbfc('0x95'))][(_0xcbfc('0x86'))]('from\x20is\x20mandatory');}if(_[_0xcbfc('0x94')](_0x422e8c['body'][_0xcbfc('0x60')])||_0x422e8c[_0xcbfc('0x60')]['body']===''){throw new db[(_0xcbfc('0x95'))][(_0xcbfc('0x86'))](_0xcbfc('0x96'));}if(_['isNil'](_0x422e8c[_0xcbfc('0x60')][_0xcbfc('0x97')])){throw new db[(_0xcbfc('0x95'))][(_0xcbfc('0x86'))](_0xcbfc('0x98')+_0x141bfe);}if(!_[_0xcbfc('0x99')](_0x141bfe,_0x422e8c['body'][_0xcbfc('0x97')])){throw new db[(_0xcbfc('0x95'))][(_0xcbfc('0x86'))](_0xcbfc('0x9a')+_0x141bfe);}_0x34d23a[_0x422e8c[_0xcbfc('0x60')][_0xcbfc('0x97')]]=_0x422e8c['body'][_0xcbfc('0x8e')];return db[_0xcbfc('0x9b')]['find']({'where':{'id':_0x422e8c['account'][_0xcbfc('0x8b')]},'include':[{'model':db[_0xcbfc('0x85')],'as':'Contacts','where':_0x34d23a,'limit':0x1,'order':[[_0xcbfc('0x89'),_0xcbfc('0x9c')]]}]});})[_0xcbfc('0x1f')](handleEntityNotFound(_0x210218,null))[_0xcbfc('0x1f')](function(_0x543b4b){if(_0x543b4b){_0x422e8c[_0xcbfc('0x9d')]=_[_0xcbfc('0x9e')](_0x543b4b,[_0xcbfc('0x9f')]);if(_0x543b4b[_0xcbfc('0x9f')][_0xcbfc('0x46')]){return _0x543b4b[_0xcbfc('0x9f')][0x0];}var _0x50c3aa=_[_0xcbfc('0xa0')](_0x422e8c[_0xcbfc('0x60')],{'firstName':_0x422e8c[_0xcbfc('0x60')][_0xcbfc('0x8e')],'ListId':_0x543b4b['id']});_0x50c3aa[_0x422e8c[_0xcbfc('0x60')]['mapKey']]=_0x422e8c['body'][_0xcbfc('0x8e')];return db[_0xcbfc('0x85')][_0xcbfc('0x59')](_0x50c3aa,{'fields':_0x31f657,'raw':!![]});}})[_0xcbfc('0x1f')](handleEntityNotFound(_0x210218,null))[_0xcbfc('0x1f')](function(_0x433d8e){if(_0x433d8e){_0x422e8c[_0xcbfc('0xa1')]=_0x433d8e;var _0x32b8ca={'ContactId':_0x433d8e['id'],'phone':_0x422e8c[_0xcbfc('0x60')][_0xcbfc('0x8e')],'WhatsappAccountId':_0x4f5bab[_0xcbfc('0x55')]['id']};var _0x18b44a={'ContactId':_0x433d8e['id'],'WhatsappAccountId':_0x4f5bab[_0xcbfc('0x55')]['id'],'closed':![]};return db[_0xcbfc('0xa2')][_0xcbfc('0x58')]({'where':_0x18b44a})[_0xcbfc('0x1f')](function(_0x5d97d9){if(_0x5d97d9){return[_0x5d97d9,![]];}return db[_0xcbfc('0xa2')][_0xcbfc('0x59')](_0x32b8ca)[_0xcbfc('0x1f')](function(_0x2898c8){return[_0x2898c8,!![]];});});}})[_0xcbfc('0xa3')](function(_0x52a328,_0x4ef47f){_0x422e8c[_0xcbfc('0xa4')]=_0x52a328[_0xcbfc('0x34')]({'plain':!![]});_0x422e8c[_0xcbfc('0xa4')][_0xcbfc('0xa5')]=![];if(_0x4ef47f){if(_0x422e8c[_0xcbfc('0x81')]['autoclose']){_0x422e8c[_0xcbfc('0x82')][_0xcbfc('0xa6')]({'id':0x0,'priority':_0x422e8c[_0xcbfc('0x82')]['length']+0x1,'app':_0xcbfc('0xa7'),'appdata':_0xcbfc('0xa8'),'interval':_0xcbfc('0xa9')});}_0x422e8c['interaction'][_0xcbfc('0xa5')]=!![];}return db['WhatsappMessage'][_0xcbfc('0x59')]({'phone':_0x422e8c[_0xcbfc('0x60')][_0xcbfc('0x8e')],'messageId':_0x422e8c['body'][_0xcbfc('0xaa')],'body':_0x422e8c[_0xcbfc('0x60')]['body'],'WhatsappAccountId':_0x4f5bab['params']['id'],'WhatsappInteractionId':_0x52a328['id'],'direction':'in','ContactId':_0x52a328[_0xcbfc('0xab')],'AttachmentId':_0x422e8c[_0xcbfc('0x60')][_0xcbfc('0xac')]});})[_0xcbfc('0x1f')](function(_0x31d70e){_0x422e8c[_0xcbfc('0x26')]=_0x31d70e;if(_0x422e8c[_0xcbfc('0xa4')][_0xcbfc('0xad')]){return db[_0xcbfc('0x75')][_0xcbfc('0x58')]({'attributes':['id',_0xcbfc('0x38')],'where':{'id':_0x422e8c['interaction'][_0xcbfc('0xad')]}})[_0xcbfc('0x1f')](function(_0x85c5c6){if(_0x85c5c6){_0x422e8c[_0xcbfc('0x82')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcbfc('0xae'),'appdata':_0x85c5c6[_0xcbfc('0x38')]+','+(_0x422e8c['account'][_0xcbfc('0xaf')]||0xa),'interval':_0xcbfc('0xa9')});}return respondWithRpcPromise('Start','startRouting',_0x422e8c);});}return respondWithRpcPromise(_0xcbfc('0xb0'),_0xcbfc('0xb1'),_0x422e8c);})[_0xcbfc('0x1f')](function(_0x58a735){if(_0x58a735){var _0x3823a6=0xc8;var _0x2cad6b=_0xcbfc('0xb2');logger[_0xcbfc('0x20')](_0xcbfc('0x24'),_0x2cad6b,_0x3823a6,_0xcbfc('0xb3'));logger[_0xcbfc('0x23')](_0xcbfc('0xb4'),_0x2cad6b,_0x3823a6,_0xcbfc('0xb3'),JSON[_0xcbfc('0xb5')](_0x58a735));if(_0x422e8c['account'][_0xcbfc('0x50')]===_0xcbfc('0x8d')){return _0x210218[_0xcbfc('0x29')](_0x3823a6)[_0xcbfc('0x2f')](_0xcbfc('0xb6'),_0xcbfc('0xb7'))['send'](_0xcbfc('0xb8'));}else{return _0x210218[_0xcbfc('0x29')](_0x3823a6)[_0xcbfc('0x2b')](_0x58a735);}}})[_0xcbfc('0x28')](handleError(_0x210218,null));};exports['send']=function(_0x531992,_0x541a90,_0x1522ec){var _0x52961c,_0x3fae32,_0x55fd41;if(_['isNil'](_0x531992[_0xcbfc('0x60')][_0xcbfc('0x60')])||_0x531992[_0xcbfc('0x60')][_0xcbfc('0x60')]===''){throw new db[(_0xcbfc('0x95'))]['ValidationError'](_0xcbfc('0x96'));}if(_[_0xcbfc('0x94')](_0x531992[_0xcbfc('0x60')]['to'])){throw new db['Sequelize']['ValidationError'](_0xcbfc('0xb9'));}_0x52961c=_0x531992[_0xcbfc('0x60')]['to'];return db['WhatsappAccount'][_0xcbfc('0x58')]({'where':{'id':_0x531992['params']['id']},'include':[{'model':db['CmList'],'as':_0xcbfc('0xba'),'include':[{'model':db[_0xcbfc('0x85')],'as':_0xcbfc('0x9f'),'where':{'mobile':_0x52961c},'limit':0x1,'order':[[_0xcbfc('0x89'),_0xcbfc('0x9c')]]}]}]})['then'](handleEntityNotFound(_0x541a90,null))[_0xcbfc('0x1f')](function(_0x1b4179){if(_0x1b4179&&_0x1b4179['List']){_0x3fae32=_0x1b4179[_0xcbfc('0x34')]({'plain':!![]});if(_0x3fae32[_0xcbfc('0xba')]&&_0x3fae32[_0xcbfc('0xba')][_0xcbfc('0x9f')][_0xcbfc('0x46')]){return _0x3fae32['List'][_0xcbfc('0x9f')][0x0];}return db[_0xcbfc('0x85')][_0xcbfc('0x59')](_[_0xcbfc('0xa0')](_0x531992[_0xcbfc('0x60')],{'firstName':_0x52961c,'mobile':_0x52961c,'phone':_0x52961c,'ListId':_0x3fae32[_0xcbfc('0x8b')]}));}})[_0xcbfc('0x1f')](handleEntityNotFound(_0x541a90,null))[_0xcbfc('0x1f')](function(_0x4a2284){if(_0x4a2284){_0x55fd41=_0x4a2284;return db[_0xcbfc('0xa2')][_0xcbfc('0x58')]({'where':{'ContactId':_0x55fd41['id'],'closed':![],'WhatsappAccountId':_0x3fae32['id']}})[_0xcbfc('0x1f')](function(_0x54d8f9){if(_0x54d8f9){return[_0x54d8f9,![]];}return db[_0xcbfc('0xa2')][_0xcbfc('0x59')]({'UserId':_0x531992[_0xcbfc('0x5a')]['id'],'ContactId':_0x55fd41['id'],'WhatsappAccountId':_0x3fae32['id'],'phone':_0x52961c,'firstMsgDirection':'out','Messages':[_[_0xcbfc('0x4f')](_0x531992[_0xcbfc('0x60')],{'read':![],'body':_0x531992[_0xcbfc('0x60')][_0xcbfc('0x60')],'phone':_0x52961c,'WhatsappAccountId':_0x3fae32['id'],'UserId':_0x531992[_0xcbfc('0x5a')]['id'],'ContactId':_0x55fd41['id']})]},{'include':[{'model':db[_0xcbfc('0xbb')],'as':_0xcbfc('0xbc')}]})[_0xcbfc('0x1f')](function(_0x2388af){return[_0x2388af,!![]];});});}})[_0xcbfc('0xa3')](function(_0x5e5c0f,_0x4bc911){if(_0x4bc911){return _0x5e5c0f;}return db[_0xcbfc('0xbb')][_0xcbfc('0x59')](_['merge'](_0x531992[_0xcbfc('0x60')],{'read':![],'body':_0x531992[_0xcbfc('0x60')][_0xcbfc('0x60')],'phone':_0x52961c,'WhatsappAccountId':_0x3fae32['id'],'WhatsappInteractionId':_0x5e5c0f['id'],'UserId':_0x531992['user']['id'],'ContactId':_0x55fd41['id']}))[_0xcbfc('0x1f')](function(_0x22099f){_0x5e5c0f[_0xcbfc('0xbd')][_0xcbfc('0xbc')]=[];_0x5e5c0f[_0xcbfc('0xbd')][_0xcbfc('0xbc')][_0xcbfc('0xa6')](_0x22099f['dataValues']);return _0x5e5c0f;});})[_0xcbfc('0x1f')](respondWithResult(_0x541a90,null))['catch'](handleError(_0x541a90,null));};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js
index f6e42d4..315b3f1 100644
--- a/server/api/whatsappAccount/whatsappAccount.events.js
+++ b/server/api/whatsappAccount/whatsappAccount.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ace=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x3e8bdd,_0x109e7c){var _0x514f2d=function(_0x42352d){while(--_0x42352d){_0x3e8bdd['push'](_0x3e8bdd['shift']());}};_0x514f2d(++_0x109e7c);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x3b8170,_0x3f8a3f){_0x3b8170=_0x3b8170-0x0;var _0xbd0a3b=_0x8ace[_0x3b8170];return _0xbd0a3b;};'use strict';var EventEmitter=require(_0xe8ac('0x0'));var WhatsappAccount=require(_0xe8ac('0x1'))['db'][_0xe8ac('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xe8ac('0x3')](0x0);var events={'afterCreate':_0xe8ac('0x4'),'afterUpdate':_0xe8ac('0x5'),'afterDestroy':_0xe8ac('0x6')};function emitEvent(_0x274d7d){return function(_0x114351,_0xf6af00,_0x199794){WhatsappAccountEvents[_0xe8ac('0x7')](_0x274d7d+':'+_0x114351['id'],_0x114351);WhatsappAccountEvents[_0xe8ac('0x7')](_0x274d7d,_0x114351);_0x199794(null);};}for(var e in events){if(events[_0xe8ac('0x8')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xe8ac('0x9')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xf562=['save','update','remove','emit','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x8c645a,_0x24c714){var _0x4aca4d=function(_0x352a3d){while(--_0x352a3d){_0x8c645a['push'](_0x8c645a['shift']());}};_0x4aca4d(++_0x24c714);}(_0xf562,0x100));var _0x2f56=function(_0x287563,_0x38455b){_0x287563=_0x287563-0x0;var _0x53bb66=_0xf562[_0x287563];return _0x53bb66;};'use strict';var EventEmitter=require(_0x2f56('0x0'));var WhatsappAccount=require(_0x2f56('0x1'))['db'][_0x2f56('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x2f56('0x3')](0x0);var events={'afterCreate':_0x2f56('0x4'),'afterUpdate':_0x2f56('0x5'),'afterDestroy':_0x2f56('0x6')};function emitEvent(_0x217301){return function(_0x38a249,_0x55a78f,_0x29e08d){WhatsappAccountEvents['emit'](_0x217301+':'+_0x38a249['id'],_0x38a249);WhatsappAccountEvents[_0x2f56('0x7')](_0x217301,_0x38a249);_0x29e08d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x2f56('0x8')](e,emitEvent(event));}}module[_0x2f56('0x9')]=WhatsappAccountEvents;
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js
index 6de5f2d..038a313 100644
--- a/server/api/whatsappAccount/whatsappAccount.model.js
+++ b/server/api/whatsappAccount/whatsappAccount.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe58b=['define','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x32af9d,_0x7bc19b){var _0x4279e1=function(_0x3a01ec){while(--_0x3a01ec){_0x32af9d['push'](_0x32af9d['shift']());}};_0x4279e1(++_0x7bc19b);}(_0xe58b,0x1e3));var _0xbe58=function(_0x1fff7d,_0xe8b9a){_0x1fff7d=_0x1fff7d-0x0;var _0x2996e0=_0xe58b[_0x1fff7d];return _0x2996e0;};'use strict';var _=require(_0xbe58('0x0'));var util=require(_0xbe58('0x1'));var logger=require(_0xbe58('0x2'))(_0xbe58('0x3'));var moment=require(_0xbe58('0x4'));var BPromise=require(_0xbe58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe58('0x6'));var rimraf=require(_0xbe58('0x7'));var config=require(_0xbe58('0x8'));var attributes=require(_0xbe58('0x9'));module[_0xbe58('0xa')]=function(_0x29f976,_0x514fca){return _0x29f976[_0xbe58('0xb')]('WhatsappAccount',attributes,{'tableName':_0xbe58('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8e4=['path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x35177b,_0x4d1234){var _0x5e47e6=function(_0xed5a2a){while(--_0xed5a2a){_0x35177b['push'](_0x35177b['shift']());}};_0x5e47e6(++_0x4d1234);}(_0xf8e4,0x1ac));var _0x4f8e=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xf8e4[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x4f8e('0x0'));var util=require(_0x4f8e('0x1'));var logger=require(_0x4f8e('0x2'))(_0x4f8e('0x3'));var moment=require('moment');var BPromise=require(_0x4f8e('0x4'));var rp=require(_0x4f8e('0x5'));var fs=require('fs');var path=require(_0x4f8e('0x6'));var rimraf=require(_0x4f8e('0x7'));var config=require(_0x4f8e('0x8'));var attributes=require(_0x4f8e('0x9'));module[_0x4f8e('0xa')]=function(_0x3ee1a4,_0x199bbf){return _0x3ee1a4[_0x4f8e('0xb')](_0x4f8e('0xc'),attributes,{'tableName':_0x4f8e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js
index b54323e..1ab4ab2 100644
--- a/server/api/whatsappAccount/whatsappAccount.rpc.js
+++ b/server/api/whatsappAccount/whatsappAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x418f=['catch','ShowWhatsappAccount','WhatsappAccount','find','raw','options','where','attributes','include','map','model','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','localhost','socket.io-emitter','./whatsappAccount.socket','request','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','WhatsappAccount,\x20%s,\x20%s','message','result'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x418f,0xdf));var _0xf418=function(_0x5bc3fc,_0x54db61){_0x5bc3fc=_0x5bc3fc-0x0;var _0x1253d0=_0x418f[_0x5bc3fc];return _0x1253d0;};'use strict';var _=require(_0xf418('0x0'));var util=require(_0xf418('0x1'));var moment=require(_0xf418('0x2'));var BPromise=require(_0xf418('0x3'));var rs=require(_0xf418('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf418('0x5'))['db'];var utils=require(_0xf418('0x6'));var logger=require(_0xf418('0x7'))(_0xf418('0x8'));var config=require('../../config/environment');var jayson=require(_0xf418('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xf418('0xa')],{'host':_0xf418('0xb'),'port':0x18eb});var socket=require(_0xf418('0xc'))(new Redis(config[_0xf418('0xa')]));require(_0xf418('0xd'))['register'](socket);function respondWithRpcPromise(_0x30f49b,_0x2c455d,_0x2efb5d){return new BPromise(function(_0x1503bc,_0x2293a2){return client[_0xf418('0xe')](_0x30f49b,_0x2efb5d)['then'](function(_0x45d2f3){logger[_0xf418('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x2c455d,_0xf418('0x10'));logger['debug'](_0xf418('0x11'),_0x2c455d,'request\x20sent',JSON['stringify'](_0x45d2f3));if(_0x45d2f3[_0xf418('0x12')]){if(_0x45d2f3[_0xf418('0x12')]['code']===0x1f4){logger[_0xf418('0x12')](_0xf418('0x13'),_0x2c455d,_0x45d2f3[_0xf418('0x12')][_0xf418('0x14')]);return _0x2293a2(_0x45d2f3[_0xf418('0x12')]['message']);}logger[_0xf418('0x12')](_0xf418('0x13'),_0x2c455d,_0x45d2f3['error'][_0xf418('0x14')]);return _0x1503bc(_0x45d2f3[_0xf418('0x12')][_0xf418('0x14')]);}else{logger['info'](_0xf418('0x13'),_0x2c455d,_0xf418('0x10'));_0x1503bc(_0x45d2f3[_0xf418('0x15')][_0xf418('0x14')]);}})[_0xf418('0x16')](function(_0x1a1f0c){logger[_0xf418('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x2c455d,_0x1a1f0c);_0x2293a2(_0x1a1f0c);});});}exports[_0xf418('0x17')]=function(_0x3ab008){var _0x57955b=this;return new Promise(function(_0x129ad7,_0xb7c2ee){return db[_0xf418('0x18')][_0xf418('0x19')]({'raw':_0x3ab008['options']?_0x3ab008['options'][_0xf418('0x1a')]===undefined?!![]:![]:!![],'where':_0x3ab008['options']?_0x3ab008[_0xf418('0x1b')][_0xf418('0x1c')]||null:null,'attributes':_0x3ab008['options']?_0x3ab008[_0xf418('0x1b')][_0xf418('0x1d')]||null:null,'include':_0x3ab008['options']?_0x3ab008['options'][_0xf418('0x1e')]?_[_0xf418('0x1f')](_0x3ab008[_0xf418('0x1b')][_0xf418('0x1e')],function(_0x506295){return{'model':db[_0x506295[_0xf418('0x20')]],'as':_0x506295['as'],'attributes':_0x506295[_0xf418('0x1d')],'include':_0x506295['include']?_[_0xf418('0x1f')](_0x506295[_0xf418('0x1e')],function(_0x5b98ea){return{'model':db[_0x5b98ea[_0xf418('0x20')]],'as':_0x5b98ea['as'],'attributes':_0x5b98ea['attributes'],'include':_0x5b98ea[_0xf418('0x1e')]?_['map'](_0x5b98ea['include'],function(_0x1aa139){return{'model':db[_0x1aa139[_0xf418('0x20')]],'as':_0x1aa139['as'],'attributes':_0x1aa139[_0xf418('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11480c){logger[_0xf418('0xf')](_0xf418('0x17'),_0x3ab008);logger[_0xf418('0x21')]('ShowWhatsappAccount',_0x3ab008,JSON[_0xf418('0x22')](_0x11480c));_0x129ad7(_0x11480c);})['catch'](function(_0x2df419){logger[_0xf418('0x12')]('ShowWhatsappAccount',_0x2df419[_0xf418('0x14')],_0x3ab008);_0xb7c2ee(_0x57955b[_0xf418('0x12')](0x1f4,_0x2df419[_0xf418('0x14')]));});});};
\ No newline at end of file
+var _0x21f8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','WhatsappAccount','options','attributes','include','model','map','ShowWhatsappAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x52a687,_0x2004ed){var _0x28283d=function(_0x43cb2d){while(--_0x43cb2d){_0x52a687['push'](_0x52a687['shift']());}};_0x28283d(++_0x2004ed);}(_0x21f8,0x170));var _0x821f=function(_0x97c6ea,_0x4cffce){_0x97c6ea=_0x97c6ea-0x0;var _0x2d7f50=_0x21f8[_0x97c6ea];return _0x2d7f50;};'use strict';var _=require('lodash');var util=require(_0x821f('0x0'));var moment=require('moment');var BPromise=require(_0x821f('0x1'));var rs=require(_0x821f('0x2'));var fs=require('fs');var Redis=require(_0x821f('0x3'));var db=require(_0x821f('0x4'))['db'];var utils=require(_0x821f('0x5'));var logger=require(_0x821f('0x6'))(_0x821f('0x7'));var config=require(_0x821f('0x8'));var jayson=require(_0x821f('0x9'));var client=jayson[_0x821f('0xa')][_0x821f('0xb')]({'port':0x232a});config['redis']=_[_0x821f('0xc')](config[_0x821f('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x821f('0xd')]));require('./whatsappAccount.socket')[_0x821f('0xe')](socket);function respondWithRpcPromise(_0x349f07,_0x449741,_0xcf26bd){return new BPromise(function(_0x4e4f96,_0x30b32e){return client[_0x821f('0xf')](_0x349f07,_0xcf26bd)[_0x821f('0x10')](function(_0x4c6768){logger['info'](_0x821f('0x11'),_0x449741,_0x821f('0x12'));logger[_0x821f('0x13')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x449741,_0x821f('0x12'),JSON[_0x821f('0x14')](_0x4c6768));if(_0x4c6768['error']){if(_0x4c6768[_0x821f('0x15')][_0x821f('0x16')]===0x1f4){logger['error'](_0x821f('0x11'),_0x449741,_0x4c6768[_0x821f('0x15')][_0x821f('0x17')]);return _0x30b32e(_0x4c6768['error'][_0x821f('0x17')]);}logger[_0x821f('0x15')](_0x821f('0x11'),_0x449741,_0x4c6768['error'][_0x821f('0x17')]);return _0x4e4f96(_0x4c6768['error'][_0x821f('0x17')]);}else{logger[_0x821f('0x18')](_0x821f('0x11'),_0x449741,'request\x20sent');_0x4e4f96(_0x4c6768[_0x821f('0x19')][_0x821f('0x17')]);}})[_0x821f('0x1a')](function(_0x45889d){logger[_0x821f('0x15')](_0x821f('0x11'),_0x449741,_0x45889d);_0x30b32e(_0x45889d);});});}exports['ShowWhatsappAccount']=function(_0x2c4255){var _0x549568=this;return new Promise(function(_0x1923b7,_0x4e8f85){return db[_0x821f('0x1b')]['find']({'raw':_0x2c4255[_0x821f('0x1c')]?_0x2c4255[_0x821f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2c4255[_0x821f('0x1c')]?_0x2c4255[_0x821f('0x1c')]['where']||null:null,'attributes':_0x2c4255['options']?_0x2c4255[_0x821f('0x1c')][_0x821f('0x1d')]||null:null,'include':_0x2c4255[_0x821f('0x1c')]?_0x2c4255[_0x821f('0x1c')][_0x821f('0x1e')]?_['map'](_0x2c4255[_0x821f('0x1c')][_0x821f('0x1e')],function(_0x42d9f3){return{'model':db[_0x42d9f3[_0x821f('0x1f')]],'as':_0x42d9f3['as'],'attributes':_0x42d9f3[_0x821f('0x1d')],'include':_0x42d9f3['include']?_[_0x821f('0x20')](_0x42d9f3['include'],function(_0x5d0146){return{'model':db[_0x5d0146[_0x821f('0x1f')]],'as':_0x5d0146['as'],'attributes':_0x5d0146[_0x821f('0x1d')],'include':_0x5d0146[_0x821f('0x1e')]?_['map'](_0x5d0146[_0x821f('0x1e')],function(_0x2cda06){return{'model':db[_0x2cda06[_0x821f('0x1f')]],'as':_0x2cda06['as'],'attributes':_0x2cda06[_0x821f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x821f('0x10')](function(_0x403d42){logger[_0x821f('0x18')](_0x821f('0x21'),_0x2c4255);logger['debug'](_0x821f('0x21'),_0x2c4255,JSON[_0x821f('0x14')](_0x403d42));_0x1923b7(_0x403d42);})[_0x821f('0x1a')](function(_0x4641a9){logger[_0x821f('0x15')](_0x821f('0x21'),_0x4641a9[_0x821f('0x17')],_0x2c4255);_0x4e8f85(_0x549568['error'](0x1f4,_0x4641a9[_0x821f('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js
index 830d26c..5a08f65 100644
--- a/server/api/whatsappAccount/whatsappAccount.socket.js
+++ b/server/api/whatsappAccount/whatsappAccount.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x89e5=['whatsappAccount:','./whatsappAccount.events','update','emit','register'];(function(_0x4490a4,_0x2d4239){var _0x8747=function(_0x571938){while(--_0x571938){_0x4490a4['push'](_0x4490a4['shift']());}};_0x8747(++_0x2d4239);}(_0x89e5,0xbf));var _0x589e=function(_0x505cc8,_0x2ec31e){_0x505cc8=_0x505cc8-0x0;var _0x27e703=_0x89e5[_0x505cc8];return _0x27e703;};'use strict';var WhatsappAccountEvents=require(_0x589e('0x0'));var events=['save','remove',_0x589e('0x1')];function createListener(_0x6aa6c5,_0x2d9fbe){return function(_0x416f67){_0x2d9fbe[_0x589e('0x2')](_0x6aa6c5,_0x416f67);};}function removeListener(_0x2b62f0,_0x24bddc){return function(){WhatsappAccountEvents['removeListener'](_0x2b62f0,_0x24bddc);};}exports[_0x589e('0x3')]=function(_0x116555){for(var _0x602b8e=0x0,_0x230cbe=events['length'];_0x602b8e<_0x230cbe;_0x602b8e++){var _0x34f78c=events[_0x602b8e];var _0x3727d7=createListener(_0x589e('0x4')+_0x34f78c,_0x116555);WhatsappAccountEvents['on'](_0x34f78c,_0x3727d7);}};
\ No newline at end of file
+var _0x1e35=['remove','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x2517ae,_0x2f5c62){var _0x152f2b=function(_0x3fc79a){while(--_0x3fc79a){_0x2517ae['push'](_0x2517ae['shift']());}};_0x152f2b(++_0x2f5c62);}(_0x1e35,0x101));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0x51e3('0x0'));var events=[_0x51e3('0x1'),_0x51e3('0x2'),'update'];function createListener(_0x40cf16,_0x2c7c67){return function(_0x2b0334){_0x2c7c67[_0x51e3('0x3')](_0x40cf16,_0x2b0334);};}function removeListener(_0xa28367,_0xa81422){return function(){WhatsappAccountEvents[_0x51e3('0x4')](_0xa28367,_0xa81422);};}exports['register']=function(_0x43bb4a){for(var _0x576442=0x0,_0x1edf96=events[_0x51e3('0x5')];_0x576442<_0x1edf96;_0x576442++){var _0x403ec0=events[_0x576442];var _0x4cb407=createListener(_0x51e3('0x6')+_0x403ec0,_0x43bb4a);WhatsappAccountEvents['on'](_0x403ec0,_0x4cb407);}};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js
index 9d93a2f..2ea78fb 100644
--- a/server/api/whatsappApplication/index.js
+++ b/server/api/whatsappApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb1d9=['../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x5e38cb,_0x56aa5a){var _0xd85952=function(_0x28810d){while(--_0x28810d){_0x5e38cb['push'](_0x5e38cb['shift']());}};_0xd85952(++_0x56aa5a);}(_0xb1d9,0x66));var _0x9b1d=function(_0x4b82ec,_0x2e9bb6){_0x4b82ec=_0x4b82ec-0x0;var _0x598eaf=_0xb1d9[_0x4b82ec];return _0x598eaf;};'use strict';var multer=require(_0x9b1d('0x0'));var util=require(_0x9b1d('0x1'));var path=require(_0x9b1d('0x2'));var timeout=require(_0x9b1d('0x3'));var express=require(_0x9b1d('0x4'));var router=express[_0x9b1d('0x5')]();var auth=require(_0x9b1d('0x6'));var interaction=require(_0x9b1d('0x7'));var config=require('../../config/environment');var controller=require(_0x9b1d('0x8'));router[_0x9b1d('0x9')]('/',auth[_0x9b1d('0xa')](),controller[_0x9b1d('0xb')]);router['get'](_0x9b1d('0xc'),auth[_0x9b1d('0xa')](),controller[_0x9b1d('0xd')]);router[_0x9b1d('0xe')]('/',auth['isAuthenticated'](),controller[_0x9b1d('0xf')]);router['put'](_0x9b1d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9b1d('0x10')](_0x9b1d('0xc'),auth[_0x9b1d('0xa')](),controller[_0x9b1d('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x140b=['multer','util','path','express','Router','../../components/interaction/service','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','exports'];(function(_0x3d8a3a,_0xeef8fc){var _0x28c1ce=function(_0x5dc810){while(--_0x5dc810){_0x3d8a3a['push'](_0x3d8a3a['shift']());}};_0x28c1ce(++_0xeef8fc);}(_0x140b,0xee));var _0xb140=function(_0x4ace15,_0xf169b5){_0x4ace15=_0x4ace15-0x0;var _0xc84b69=_0x140b[_0x4ace15];return _0xc84b69;};'use strict';var multer=require(_0xb140('0x0'));var util=require(_0xb140('0x1'));var path=require(_0xb140('0x2'));var timeout=require('connect-timeout');var express=require(_0xb140('0x3'));var router=express[_0xb140('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb140('0x5'));var config=require('../../config/environment');var controller=require(_0xb140('0x6'));router[_0xb140('0x7')]('/',auth['isAuthenticated'](),controller[_0xb140('0x8')]);router['get'](_0xb140('0x9'),auth[_0xb140('0xa')](),controller[_0xb140('0xb')]);router['post']('/',auth[_0xb140('0xa')](),controller['create']);router[_0xb140('0xc')](_0xb140('0x9'),auth[_0xb140('0xa')](),controller[_0xb140('0xd')]);router[_0xb140('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb140('0xf')]);module[_0xb140('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js
index c148cb0..aa7f146 100644
--- a/server/api/whatsappApplication/whatsappApplication.attributes.js
+++ b/server/api/whatsappApplication/whatsappApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf851=['noop','STRING','sequelize','INTEGER'];(function(_0x50c5dc,_0x2228fd){var _0xfb1827=function(_0x57e52f){while(--_0x57e52f){_0x50c5dc['push'](_0x50c5dc['shift']());}};_0xfb1827(++_0x2228fd);}(_0xf851,0xaa));var _0x1f85=function(_0x511933,_0x1d9966){_0x511933=_0x511933-0x0;var _0x3e063d=_0xf851[_0x511933];return _0x3e063d;};'use strict';var Sequelize=require(_0x1f85('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1f85('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1f85('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1f85('0x3')]},'interval':{'type':Sequelize[_0x1f85('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x24b0=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x4cd0e1,_0x201cd2){var _0x4f675a=function(_0x4d3eff){while(--_0x4d3eff){_0x4cd0e1['push'](_0x4cd0e1['shift']());}};_0x4f675a(++_0x201cd2);}(_0x24b0,0xc7));var _0x024b=function(_0x40dbec,_0x48d264){_0x40dbec=_0x40dbec-0x0;var _0x1daf7f=_0x24b0[_0x40dbec];return _0x1daf7f;};'use strict';var Sequelize=require(_0x024b('0x0'));module[_0x024b('0x1')]={'priority':{'type':Sequelize[_0x024b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x024b('0x3')],'allowNull':![],'defaultValue':_0x024b('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x024b('0x3')],'defaultValue':_0x024b('0x5')}};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js
index 5ebfc17..f1f1213 100644
--- a/server/api/whatsappApplication/whatsappApplication.controller.js
+++ b/server/api/whatsappApplication/whatsappApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcd5a=['pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','rawAttributes','keys','intersection','includeAll','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','end','status','json','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','WhatsappApplication','fieldName','key','map','query','filters','model','fields','attributes','length','nolimit','limit','offset','order','sort','where'];(function(_0x1b18cf,_0x1d06ad){var _0x2670c4=function(_0x2f9d46){while(--_0x2f9d46){_0x1b18cf['push'](_0x1b18cf['shift']());}};_0x2670c4(++_0x1d06ad);}(_0xcd5a,0xe0));var _0xacd5=function(_0x42c0ce,_0x3007fe){_0x42c0ce=_0x42c0ce-0x0;var _0x4ff05d=_0xcd5a[_0x42c0ce];return _0x4ff05d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xacd5('0x0'));var rimraf=require(_0xacd5('0x1'));var zipdir=require(_0xacd5('0x2'));var jsonpatch=require(_0xacd5('0x3'));var rp=require(_0xacd5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xacd5('0x5'));var csv=require(_0xacd5('0x6'));var ejs=require(_0xacd5('0x7'));var fs=require('fs');var _=require(_0xacd5('0x8'));var squel=require(_0xacd5('0x9'));var crypto=require(_0xacd5('0xa'));var jsforce=require(_0xacd5('0xb'));var deskjs=require(_0xacd5('0xc'));var toCsv=require(_0xacd5('0x6'));var querystring=require(_0xacd5('0xd'));var Papa=require(_0xacd5('0xe'));var Redis=require(_0xacd5('0xf'));var authService=require(_0xacd5('0x10'));var qs=require(_0xacd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacd5('0x12'));var logger=require(_0xacd5('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ec89a,_0x24a8d3){_0x24a8d3=_0x24a8d3||0xcc;return function(_0x1e7075){if(_0x1e7075){return _0x5ec89a[_0xacd5('0x14')](_0x24a8d3);}return _0x5ec89a['status'](_0x24a8d3)[_0xacd5('0x15')]();};}function respondWithResult(_0x457d3a,_0x25d3fe){_0x25d3fe=_0x25d3fe||0xc8;return function(_0x7db492){if(_0x7db492){return _0x457d3a[_0xacd5('0x16')](_0x25d3fe)[_0xacd5('0x17')](_0x7db492);}};}function respondWithFilteredResult(_0x2b5f45,_0x3847f6){return function(_0x2ae790){if(_0x2ae790){var _0x4b21df=_0x2ae790[_0xacd5('0x18')],_0x883d0a=_0x3847f6['offset'],_0xdf9d17=_0x3847f6['offset']+_0x3847f6['limit'],_0x3978ee;if(_0xdf9d17>=_0x4b21df){_0xdf9d17=_0x4b21df;_0x3978ee=0xc8;}else{_0x3978ee=0xce;}_0x2b5f45[_0xacd5('0x16')](_0x3978ee);return _0x2b5f45[_0xacd5('0x19')](_0xacd5('0x1a'),_0x883d0a+'-'+_0xdf9d17+'/'+_0x4b21df)[_0xacd5('0x17')](_0x2ae790);}return null;};}function patchUpdates(_0x15846f){return function(_0x5ccdf1){try{jsonpatch[_0xacd5('0x1b')](_0x5ccdf1,_0x15846f,!![]);}catch(_0x26a078){return BPromise[_0xacd5('0x1c')](_0x26a078);}return _0x5ccdf1[_0xacd5('0x1d')]();};}function saveUpdates(_0xcc43cb,_0x56a4c1){return function(_0xe5828a){if(_0xe5828a){return _0xe5828a[_0xacd5('0x1e')](_0xcc43cb)['then'](function(_0x2da89c){return _0x2da89c;});}return null;};}function removeEntity(_0x437692,_0x5b05d0){return function(_0x58fe2c){if(_0x58fe2c){return _0x58fe2c[_0xacd5('0x1f')]()[_0xacd5('0x20')](function(){_0x437692['status'](0xcc)[_0xacd5('0x15')]();});}};}function handleEntityNotFound(_0x169815,_0x2173f9){return function(_0x5de3b0){if(!_0x5de3b0){_0x169815[_0xacd5('0x14')](0x194);}return _0x5de3b0;};}function handleError(_0x4a16b9,_0x5e34b4){_0x5e34b4=_0x5e34b4||0x1f4;return function(_0x5bbfc3){logger['error'](_0x5bbfc3[_0xacd5('0x21')]);if(_0x5bbfc3[_0xacd5('0x22')]){delete _0x5bbfc3[_0xacd5('0x22')];}_0x4a16b9[_0xacd5('0x16')](_0x5e34b4)['send'](_0x5bbfc3);};}exports[_0xacd5('0x23')]=function(_0xc7b847,_0x16b00f){var _0x3d7de1={},_0xcfc563={},_0x392667={'count':0x0,'rows':[]};var _0x2cd750=_['map'](db[_0xacd5('0x24')]['rawAttributes'],function(_0x3eb433){return{'name':_0x3eb433[_0xacd5('0x25')],'type':_0x3eb433['type'][_0xacd5('0x26')]};});_0xcfc563['model']=_[_0xacd5('0x27')](_0x2cd750,_0xacd5('0x22'));_0xcfc563[_0xacd5('0x28')]=_['keys'](_0xc7b847[_0xacd5('0x28')]);_0xcfc563[_0xacd5('0x29')]=_['intersection'](_0xcfc563[_0xacd5('0x2a')],_0xcfc563[_0xacd5('0x28')]);_0x3d7de1['attributes']=_['intersection'](_0xcfc563[_0xacd5('0x2a')],qs['fields'](_0xc7b847[_0xacd5('0x28')][_0xacd5('0x2b')]));_0x3d7de1[_0xacd5('0x2c')]=_0x3d7de1['attributes'][_0xacd5('0x2d')]?_0x3d7de1[_0xacd5('0x2c')]:_0xcfc563[_0xacd5('0x2a')];if(!_0xc7b847['query']['hasOwnProperty'](_0xacd5('0x2e'))){_0x3d7de1[_0xacd5('0x2f')]=qs[_0xacd5('0x2f')](_0xc7b847[_0xacd5('0x28')][_0xacd5('0x2f')]);_0x3d7de1[_0xacd5('0x30')]=qs['offset'](_0xc7b847[_0xacd5('0x28')]['offset']);}_0x3d7de1[_0xacd5('0x31')]=qs['sort'](_0xc7b847[_0xacd5('0x28')][_0xacd5('0x32')]);_0x3d7de1[_0xacd5('0x33')]=qs[_0xacd5('0x29')](_[_0xacd5('0x34')](_0xc7b847[_0xacd5('0x28')],_0xcfc563[_0xacd5('0x29')]),_0x2cd750);if(_0xc7b847[_0xacd5('0x28')][_0xacd5('0x35')]){_0x3d7de1['where']=_[_0xacd5('0x36')](_0x3d7de1[_0xacd5('0x33')],{'$or':_[_0xacd5('0x27')](_0x2cd750,function(_0x285d0b){if(_0x285d0b[_0xacd5('0x37')]!==_0xacd5('0x38')){var _0x42b06f={};_0x42b06f[_0x285d0b[_0xacd5('0x22')]]={'$like':'%'+_0xc7b847['query'][_0xacd5('0x35')]+'%'};return _0x42b06f;}})});}_0x3d7de1=_['merge']({},_0x3d7de1,_0xc7b847[_0xacd5('0x39')]);var _0x1473e9={'where':_0x3d7de1[_0xacd5('0x33')]};return db[_0xacd5('0x24')][_0xacd5('0x18')](_0x1473e9)['then'](function(_0x199794){_0x392667[_0xacd5('0x18')]=_0x199794;if(_0xc7b847[_0xacd5('0x28')]['includeAll']){_0x3d7de1['include']=[{'all':!![]}];}return db[_0xacd5('0x24')][_0xacd5('0x3a')](_0x3d7de1);})['then'](function(_0x2880f2){_0x392667[_0xacd5('0x3b')]=_0x2880f2;return _0x392667;})['then'](respondWithFilteredResult(_0x16b00f,_0x3d7de1))[_0xacd5('0x3c')](handleError(_0x16b00f,null));};exports[_0xacd5('0x3d')]=function(_0x507ce6,_0x501644){var _0x5c4026={'raw':!![],'where':{'id':_0x507ce6['params']['id']}},_0x1d344e={};_0x1d344e[_0xacd5('0x2a')]=_['keys'](db[_0xacd5('0x24')][_0xacd5('0x3e')]);_0x1d344e[_0xacd5('0x28')]=_[_0xacd5('0x3f')](_0x507ce6[_0xacd5('0x28')]);_0x1d344e['filters']=_[_0xacd5('0x40')](_0x1d344e[_0xacd5('0x2a')],_0x1d344e['query']);_0x5c4026[_0xacd5('0x2c')]=_[_0xacd5('0x40')](_0x1d344e[_0xacd5('0x2a')],qs['fields'](_0x507ce6[_0xacd5('0x28')]['fields']));_0x5c4026['attributes']=_0x5c4026[_0xacd5('0x2c')]['length']?_0x5c4026[_0xacd5('0x2c')]:_0x1d344e[_0xacd5('0x2a')];if(_0x507ce6['query'][_0xacd5('0x41')]){_0x5c4026['include']=[{'all':!![]}];}_0x5c4026=_[_0xacd5('0x36')]({},_0x5c4026,_0x507ce6[_0xacd5('0x39')]);return db[_0xacd5('0x24')]['find'](_0x5c4026)[_0xacd5('0x20')](handleEntityNotFound(_0x501644,null))['then'](respondWithResult(_0x501644,null))['catch'](handleError(_0x501644,null));};exports[_0xacd5('0x42')]=function(_0x2d23d4,_0x3af099){return db['WhatsappApplication'][_0xacd5('0x42')](_0x2d23d4[_0xacd5('0x43')],{})['then'](respondWithResult(_0x3af099,0xc9))[_0xacd5('0x3c')](handleError(_0x3af099,null));};exports['update']=function(_0x6ed6ad,_0x14cae1){if(_0x6ed6ad['body']['id']){delete _0x6ed6ad[_0xacd5('0x43')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x6ed6ad[_0xacd5('0x44')]['id']}})[_0xacd5('0x20')](handleEntityNotFound(_0x14cae1,null))['then'](saveUpdates(_0x6ed6ad[_0xacd5('0x43')],null))[_0xacd5('0x20')](respondWithResult(_0x14cae1,null))[_0xacd5('0x3c')](handleError(_0x14cae1,null));};exports[_0xacd5('0x1f')]=function(_0x342197,_0x46f3b0){return db[_0xacd5('0x24')]['find']({'where':{'id':_0x342197[_0xacd5('0x44')]['id']}})[_0xacd5('0x20')](handleEntityNotFound(_0x46f3b0,null))[_0xacd5('0x20')](removeEntity(_0x46f3b0,null))[_0xacd5('0x3c')](handleError(_0x46f3b0,null));};
\ No newline at end of file
+var _0x2390=['map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','create','body','find','html-pdf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x2390,0xa8));var _0x0239=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x2390[_0x13b8f3];return _0x1a6d06;};'use strict';var pdf=require(_0x0239('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0239('0x1'));var jsonpatch=require(_0x0239('0x2'));var rp=require('request-promise');var moment=require(_0x0239('0x3'));var BPromise=require(_0x0239('0x4'));var Mustache=require('mustache');var util=require(_0x0239('0x5'));var path=require('path');var sox=require(_0x0239('0x6'));var csv=require(_0x0239('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0239('0x8'));var squel=require('squel');var crypto=require(_0x0239('0x9'));var jsforce=require(_0x0239('0xa'));var deskjs=require(_0x0239('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0239('0xc'));var Papa=require(_0x0239('0xd'));var Redis=require('ioredis');var authService=require(_0x0239('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0239('0xf'));var logger=require(_0x0239('0x10'))(_0x0239('0x11'));var utils=require(_0x0239('0x12'));var config=require(_0x0239('0x13'));var db=require(_0x0239('0x14'))['db'];function respondWithStatusCode(_0x188c4f,_0x4d5428){_0x4d5428=_0x4d5428||0xcc;return function(_0x30fbc4){if(_0x30fbc4){return _0x188c4f[_0x0239('0x15')](_0x4d5428);}return _0x188c4f[_0x0239('0x16')](_0x4d5428)['end']();};}function respondWithResult(_0x556159,_0x26ea0d){_0x26ea0d=_0x26ea0d||0xc8;return function(_0x38d9b1){if(_0x38d9b1){return _0x556159[_0x0239('0x16')](_0x26ea0d)[_0x0239('0x17')](_0x38d9b1);}};}function respondWithFilteredResult(_0x36ab3d,_0x33c705){return function(_0xc0cfb1){if(_0xc0cfb1){var _0x3193a7=_0xc0cfb1['count'],_0x42d63f=_0x33c705['offset'],_0x5b3288=_0x33c705[_0x0239('0x18')]+_0x33c705['limit'],_0x106b27;if(_0x5b3288>=_0x3193a7){_0x5b3288=_0x3193a7;_0x106b27=0xc8;}else{_0x106b27=0xce;}_0x36ab3d[_0x0239('0x16')](_0x106b27);return _0x36ab3d['set'](_0x0239('0x19'),_0x42d63f+'-'+_0x5b3288+'/'+_0x3193a7)['json'](_0xc0cfb1);}return null;};}function patchUpdates(_0x1bff66){return function(_0x51f86b){try{jsonpatch['apply'](_0x51f86b,_0x1bff66,!![]);}catch(_0x4a7f75){return BPromise[_0x0239('0x1a')](_0x4a7f75);}return _0x51f86b[_0x0239('0x1b')]();};}function saveUpdates(_0x2a5c06,_0x355412){return function(_0x47d350){if(_0x47d350){return _0x47d350['update'](_0x2a5c06)[_0x0239('0x1c')](function(_0x33d568){return _0x33d568;});}return null;};}function removeEntity(_0x27a0ee,_0x33aa7d){return function(_0x10fdc8){if(_0x10fdc8){return _0x10fdc8[_0x0239('0x1d')]()[_0x0239('0x1c')](function(){_0x27a0ee[_0x0239('0x16')](0xcc)[_0x0239('0x1e')]();});}};}function handleEntityNotFound(_0x5e9eb8,_0x71a3d6){return function(_0x42de70){if(!_0x42de70){_0x5e9eb8['sendStatus'](0x194);}return _0x42de70;};}function handleError(_0x39d48f,_0x21f1a7){_0x21f1a7=_0x21f1a7||0x1f4;return function(_0x52cd18){logger[_0x0239('0x1f')](_0x52cd18[_0x0239('0x20')]);if(_0x52cd18[_0x0239('0x21')]){delete _0x52cd18[_0x0239('0x21')];}_0x39d48f[_0x0239('0x16')](_0x21f1a7)[_0x0239('0x22')](_0x52cd18);};}exports[_0x0239('0x23')]=function(_0x3ac276,_0x1cbc83){var _0x4f46b9={},_0x3217fe={},_0x3b35da={'count':0x0,'rows':[]};var _0x13857c=_[_0x0239('0x24')](db[_0x0239('0x25')][_0x0239('0x26')],function(_0x482ebe){return{'name':_0x482ebe[_0x0239('0x27')],'type':_0x482ebe[_0x0239('0x28')]['key']};});_0x3217fe[_0x0239('0x29')]=_['map'](_0x13857c,_0x0239('0x21'));_0x3217fe[_0x0239('0x2a')]=_[_0x0239('0x2b')](_0x3ac276['query']);_0x3217fe['filters']=_[_0x0239('0x2c')](_0x3217fe[_0x0239('0x29')],_0x3217fe[_0x0239('0x2a')]);_0x4f46b9[_0x0239('0x2d')]=_[_0x0239('0x2c')](_0x3217fe['model'],qs[_0x0239('0x2e')](_0x3ac276['query']['fields']));_0x4f46b9[_0x0239('0x2d')]=_0x4f46b9[_0x0239('0x2d')][_0x0239('0x2f')]?_0x4f46b9['attributes']:_0x3217fe[_0x0239('0x29')];if(!_0x3ac276[_0x0239('0x2a')][_0x0239('0x30')](_0x0239('0x31'))){_0x4f46b9[_0x0239('0x32')]=qs[_0x0239('0x32')](_0x3ac276['query'][_0x0239('0x32')]);_0x4f46b9[_0x0239('0x18')]=qs[_0x0239('0x18')](_0x3ac276[_0x0239('0x2a')][_0x0239('0x18')]);}_0x4f46b9['order']=qs['sort'](_0x3ac276['query']['sort']);_0x4f46b9['where']=qs[_0x0239('0x33')](_[_0x0239('0x34')](_0x3ac276[_0x0239('0x2a')],_0x3217fe[_0x0239('0x33')]),_0x13857c);if(_0x3ac276[_0x0239('0x2a')][_0x0239('0x35')]){_0x4f46b9[_0x0239('0x36')]=_[_0x0239('0x37')](_0x4f46b9[_0x0239('0x36')],{'$or':_[_0x0239('0x24')](_0x13857c,function(_0x3b43cb){if(_0x3b43cb[_0x0239('0x28')]!==_0x0239('0x38')){var _0x99dec2={};_0x99dec2[_0x3b43cb[_0x0239('0x21')]]={'$like':'%'+_0x3ac276['query']['filter']+'%'};return _0x99dec2;}})});}_0x4f46b9=_[_0x0239('0x37')]({},_0x4f46b9,_0x3ac276[_0x0239('0x39')]);var _0x3b6cbb={'where':_0x4f46b9[_0x0239('0x36')]};return db['WhatsappApplication'][_0x0239('0x3a')](_0x3b6cbb)[_0x0239('0x1c')](function(_0x2a3505){_0x3b35da[_0x0239('0x3a')]=_0x2a3505;if(_0x3ac276['query'][_0x0239('0x3b')]){_0x4f46b9[_0x0239('0x3c')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x0239('0x3d')](_0x4f46b9);})['then'](function(_0x523068){_0x3b35da[_0x0239('0x3e')]=_0x523068;return _0x3b35da;})[_0x0239('0x1c')](respondWithFilteredResult(_0x1cbc83,_0x4f46b9))[_0x0239('0x3f')](handleError(_0x1cbc83,null));};exports['show']=function(_0x32eb9d,_0xc8cc98){var _0x318587={'raw':!![],'where':{'id':_0x32eb9d[_0x0239('0x40')]['id']}},_0xcde20a={};_0xcde20a[_0x0239('0x29')]=_[_0x0239('0x2b')](db[_0x0239('0x25')][_0x0239('0x26')]);_0xcde20a[_0x0239('0x2a')]=_[_0x0239('0x2b')](_0x32eb9d['query']);_0xcde20a[_0x0239('0x33')]=_['intersection'](_0xcde20a[_0x0239('0x29')],_0xcde20a['query']);_0x318587[_0x0239('0x2d')]=_['intersection'](_0xcde20a[_0x0239('0x29')],qs[_0x0239('0x2e')](_0x32eb9d[_0x0239('0x2a')][_0x0239('0x2e')]));_0x318587[_0x0239('0x2d')]=_0x318587[_0x0239('0x2d')][_0x0239('0x2f')]?_0x318587[_0x0239('0x2d')]:_0xcde20a[_0x0239('0x29')];if(_0x32eb9d[_0x0239('0x2a')][_0x0239('0x3b')]){_0x318587[_0x0239('0x3c')]=[{'all':!![]}];}_0x318587=_[_0x0239('0x37')]({},_0x318587,_0x32eb9d['options']);return db[_0x0239('0x25')]['find'](_0x318587)['then'](handleEntityNotFound(_0xc8cc98,null))[_0x0239('0x1c')](respondWithResult(_0xc8cc98,null))[_0x0239('0x3f')](handleError(_0xc8cc98,null));};exports[_0x0239('0x41')]=function(_0x413a67,_0x57e42f){return db[_0x0239('0x25')][_0x0239('0x41')](_0x413a67['body'],{})[_0x0239('0x1c')](respondWithResult(_0x57e42f,0xc9))[_0x0239('0x3f')](handleError(_0x57e42f,null));};exports['update']=function(_0x1147c1,_0x1e7827){if(_0x1147c1['body']['id']){delete _0x1147c1[_0x0239('0x42')]['id'];}return db['WhatsappApplication'][_0x0239('0x43')]({'where':{'id':_0x1147c1[_0x0239('0x40')]['id']}})[_0x0239('0x1c')](handleEntityNotFound(_0x1e7827,null))[_0x0239('0x1c')](saveUpdates(_0x1147c1[_0x0239('0x42')],null))[_0x0239('0x1c')](respondWithResult(_0x1e7827,null))[_0x0239('0x3f')](handleError(_0x1e7827,null));};exports[_0x0239('0x1d')]=function(_0x3b7ea1,_0x1a9293){return db[_0x0239('0x25')]['find']({'where':{'id':_0x3b7ea1[_0x0239('0x40')]['id']}})[_0x0239('0x1c')](handleEntityNotFound(_0x1a9293,null))['then'](removeEntity(_0x1a9293,null))[_0x0239('0x3f')](handleError(_0x1a9293,null));};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js
index 453b782..cf7d19b 100644
--- a/server/api/whatsappApplication/whatsappApplication.model.js
+++ b/server/api/whatsappApplication/whatsappApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1681=['define','whatsapp_applications','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappApplication.attributes','exports'];(function(_0x189744,_0x26f963){var _0x1072d1=function(_0x334bdb){while(--_0x334bdb){_0x189744['push'](_0x189744['shift']());}};_0x1072d1(++_0x26f963);}(_0x1681,0x12c));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1168('0x0'))(_0x1168('0x1'));var moment=require(_0x1168('0x2'));var BPromise=require(_0x1168('0x3'));var rp=require(_0x1168('0x4'));var fs=require('fs');var path=require(_0x1168('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1168('0x6'));module[_0x1168('0x7')]=function(_0x4a111a,_0x4601fe){return _0x4a111a[_0x1168('0x8')]('WhatsappApplication',attributes,{'tableName':_0x1168('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1168('0xa')});};
\ No newline at end of file
+var _0xb264=['define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports'];(function(_0x471c04,_0xde4489){var _0x36ae30=function(_0x5cd6e1){while(--_0x5cd6e1){_0x471c04['push'](_0x471c04['shift']());}};_0x36ae30(++_0xde4489);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b26('0x0'));var util=require(_0x4b26('0x1'));var logger=require('../../config/logger')(_0x4b26('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b26('0x3'));var fs=require('fs');var path=require(_0x4b26('0x4'));var rimraf=require(_0x4b26('0x5'));var config=require(_0x4b26('0x6'));var attributes=require(_0x4b26('0x7'));module[_0x4b26('0x8')]=function(_0x1e3af6,_0x4e039d){return _0x1e3af6[_0x4b26('0x9')](_0x4b26('0xa'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4b26('0xb'),'collate':_0x4b26('0xc')});};
\ No newline at end of file
diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js
index 8a7ff79..393c8db 100644
--- a/server/api/whatsappApplication/whatsappApplication.rpc.js
+++ b/server/api/whatsappApplication/whatsappApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d19=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','request\x20sent'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6d19,0x160));var _0x96d1=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x6d19[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x96d1('0x0'));var util=require(_0x96d1('0x1'));var moment=require(_0x96d1('0x2'));var BPromise=require(_0x96d1('0x3'));var rs=require(_0x96d1('0x4'));var fs=require('fs');var Redis=require(_0x96d1('0x5'));var db=require(_0x96d1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x96d1('0x7'))(_0x96d1('0x8'));var config=require(_0x96d1('0x9'));var jayson=require(_0x96d1('0xa'));var client=jayson['client'][_0x96d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x230638,_0x61e0f5,_0x58ade3){return new BPromise(function(_0xba2d03,_0x3f7a36){return client[_0x96d1('0xc')](_0x230638,_0x58ade3)[_0x96d1('0xd')](function(_0x37b251){logger[_0x96d1('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x61e0f5,'request\x20sent');logger[_0x96d1('0xf')](_0x96d1('0x10'),_0x61e0f5,'request\x20sent',JSON[_0x96d1('0x11')](_0x37b251));if(_0x37b251['error']){if(_0x37b251[_0x96d1('0x12')][_0x96d1('0x13')]===0x1f4){logger[_0x96d1('0x12')](_0x96d1('0x14'),_0x61e0f5,_0x37b251[_0x96d1('0x12')][_0x96d1('0x15')]);return _0x3f7a36(_0x37b251['error'][_0x96d1('0x15')]);}logger[_0x96d1('0x12')](_0x96d1('0x14'),_0x61e0f5,_0x37b251[_0x96d1('0x12')][_0x96d1('0x15')]);return _0xba2d03(_0x37b251['error']['message']);}else{logger[_0x96d1('0xe')](_0x96d1('0x14'),_0x61e0f5,_0x96d1('0x16'));_0xba2d03(_0x37b251[_0x96d1('0x17')][_0x96d1('0x15')]);}})[_0x96d1('0x18')](function(_0x45dc6f){logger[_0x96d1('0x12')](_0x96d1('0x14'),_0x61e0f5,_0x45dc6f);_0x3f7a36(_0x45dc6f);});});}
\ No newline at end of file
+var _0xe260=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xe260,0x94));var _0x0e26=function(_0x471853,_0x3a73ac){_0x471853=_0x471853-0x0;var _0x2819e1=_0xe260[_0x471853];return _0x2819e1;};'use strict';var _=require(_0x0e26('0x0'));var util=require('util');var moment=require(_0x0e26('0x1'));var BPromise=require(_0x0e26('0x2'));var rs=require(_0x0e26('0x3'));var fs=require('fs');var Redis=require(_0x0e26('0x4'));var db=require(_0x0e26('0x5'))['db'];var utils=require(_0x0e26('0x6'));var logger=require(_0x0e26('0x7'))(_0x0e26('0x8'));var config=require(_0x0e26('0x9'));var jayson=require(_0x0e26('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15018a,_0xea8fe0,_0x1f7ad8){return new BPromise(function(_0x2ed98e,_0x457c6e){return client[_0x0e26('0xb')](_0x15018a,_0x1f7ad8)[_0x0e26('0xc')](function(_0x5e67e2){logger[_0x0e26('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0xea8fe0,_0x0e26('0xe'));logger[_0x0e26('0xf')](_0x0e26('0x10'),_0xea8fe0,'request\x20sent',JSON['stringify'](_0x5e67e2));if(_0x5e67e2[_0x0e26('0x11')]){if(_0x5e67e2[_0x0e26('0x11')]['code']===0x1f4){logger[_0x0e26('0x11')](_0x0e26('0x12'),_0xea8fe0,_0x5e67e2[_0x0e26('0x11')]['message']);return _0x457c6e(_0x5e67e2[_0x0e26('0x11')][_0x0e26('0x13')]);}logger[_0x0e26('0x11')](_0x0e26('0x12'),_0xea8fe0,_0x5e67e2[_0x0e26('0x11')][_0x0e26('0x13')]);return _0x2ed98e(_0x5e67e2[_0x0e26('0x11')]['message']);}else{logger[_0x0e26('0xd')](_0x0e26('0x12'),_0xea8fe0,_0x0e26('0xe'));_0x2ed98e(_0x5e67e2[_0x0e26('0x14')]['message']);}})[_0x0e26('0x15')](function(_0x8571bf){logger[_0x0e26('0x11')](_0x0e26('0x12'),_0xea8fe0,_0x8571bf);_0x457c6e(_0x8571bf);});});}
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js
index d190fc2..721675c 100644
--- a/server/api/whatsappInteraction/index.js
+++ b/server/api/whatsappInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb20b=['getMessages','/:id/download','post','create','/:id/tags','tracked','addTags','put','update','whatsapp','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','index','get','/describe','isAuthenticated','show','/:id/messages'];(function(_0x2965ba,_0x1df010){var _0x2829a3=function(_0x32d923){while(--_0x32d923){_0x2965ba['push'](_0x2965ba['shift']());}};_0x2829a3(++_0x1df010);}(_0xb20b,0x93));var _0xbb20=function(_0x34951f,_0x4b9a30){_0x34951f=_0x34951f-0x0;var _0x4ff01c=_0xb20b[_0x34951f];return _0x4ff01c;};'use strict';var multer=require(_0xbb20('0x0'));var util=require('util');var path=require(_0xbb20('0x1'));var timeout=require(_0xbb20('0x2'));var express=require(_0xbb20('0x3'));var router=express[_0xbb20('0x4')]();var auth=require(_0xbb20('0x5'));var interaction=require(_0xbb20('0x6'));var config=require(_0xbb20('0x7'));var controller=require(_0xbb20('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb20('0x9')]);router[_0xbb20('0xa')](_0xbb20('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbb20('0xc')](),controller[_0xbb20('0xd')]);router['get'](_0xbb20('0xe'),auth[_0xbb20('0xc')](),controller[_0xbb20('0xf')]);router[_0xbb20('0xa')](_0xbb20('0x10'),auth[_0xbb20('0xc')](),controller['download']);router[_0xbb20('0x11')]('/',auth['isAuthenticated'](),controller[_0xbb20('0x12')]);router[_0xbb20('0x11')](_0xbb20('0xe'),auth[_0xbb20('0xc')](),controller['addMessage']);router[_0xbb20('0x11')](_0xbb20('0x13'),auth[_0xbb20('0xc')](),interaction[_0xbb20('0x14')]('whatsapp','whatsappinteraction:addtags'),controller[_0xbb20('0x15')]);router[_0xbb20('0x16')]('/:id',auth[_0xbb20('0xc')](),interaction[_0xbb20('0x14')]('whatsapp','whatsappinteraction:update'),controller[_0xbb20('0x17')]);router['delete']('/:id',auth[_0xbb20('0xc')](),interaction[_0xbb20('0x14')](_0xbb20('0x18'),'whatsappinteraction:destroy'),controller[_0xbb20('0x19')]);router['delete']('/:id/tags',auth[_0xbb20('0xc')](),controller['removeTags']);module[_0xbb20('0x1a')]=router;
\ No newline at end of file
+var _0x7662=['addTags','update','delete','tracked','whatsappinteraction:destroy','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7662,0xd2));var _0x2766=function(_0xeaa730,_0x23b812){_0xeaa730=_0xeaa730-0x0;var _0x19052d=_0x7662[_0xeaa730];return _0x19052d;};'use strict';var multer=require(_0x2766('0x0'));var util=require(_0x2766('0x1'));var path=require(_0x2766('0x2'));var timeout=require('connect-timeout');var express=require(_0x2766('0x3'));var router=express[_0x2766('0x4')]();var auth=require(_0x2766('0x5'));var interaction=require(_0x2766('0x6'));var config=require('../../config/environment');var controller=require(_0x2766('0x7'));router[_0x2766('0x8')]('/',auth[_0x2766('0x9')](),controller[_0x2766('0xa')]);router[_0x2766('0x8')](_0x2766('0xb'),auth[_0x2766('0x9')](),controller[_0x2766('0xc')]);router['get'](_0x2766('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x2766('0x8')](_0x2766('0xe'),auth['isAuthenticated'](),controller[_0x2766('0xf')]);router['get'](_0x2766('0x10'),auth[_0x2766('0x9')](),controller['download']);router[_0x2766('0x11')]('/',auth[_0x2766('0x9')](),controller['create']);router['post'](_0x2766('0xe'),auth[_0x2766('0x9')](),controller[_0x2766('0x12')]);router[_0x2766('0x11')](_0x2766('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2766('0x14'),_0x2766('0x15')),controller[_0x2766('0x16')]);router['put'](_0x2766('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x2766('0x14'),'whatsappinteraction:update'),controller[_0x2766('0x17')]);router[_0x2766('0x18')]('/:id',auth[_0x2766('0x9')](),interaction[_0x2766('0x19')]('whatsapp',_0x2766('0x1a')),controller[_0x2766('0x1b')]);router['delete'](_0x2766('0x13'),auth[_0x2766('0x9')](),controller['removeTags']);module[_0x2766('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js
index 27197d2..3363d8b 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef27=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x64ac46,_0x29a347){var _0x1a8b52=function(_0x49dc42){while(--_0x49dc42){_0x64ac46['push'](_0x64ac46['shift']());}};_0x1a8b52(++_0x29a347);}(_0xef27,0x6b));var _0x7ef2=function(_0x65ad87,_0x2bb0bc){_0x65ad87=_0x65ad87-0x0;var _0x3fb63a=_0xef27[_0x65ad87];return _0x3fb63a;};'use strict';var Sequelize=require(_0x7ef2('0x0'));var moment=require(_0x7ef2('0x1'));module[_0x7ef2('0x2')]={'closed':{'type':Sequelize[_0x7ef2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7ef2('0x4')]},'disposition':{'type':Sequelize[_0x7ef2('0x5')]},'note':{'type':Sequelize[_0x7ef2('0x5')]},'phone':{'type':Sequelize[_0x7ef2('0x5')]},'read1stAt':{'type':Sequelize[_0x7ef2('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x7ef2('0x6')]('in',_0x7ef2('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7ef2('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x7ef2('0x6')]('in',_0x7ef2('0x7')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xc4ec=['STRING','out','ENUM','sequelize','moment','exports','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4ec,0xd5));var _0xcc4e=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0xc4ec[_0x2fdf82];return _0x2382f5;};'use strict';var Sequelize=require(_0xcc4e('0x0'));var moment=require(_0xcc4e('0x1'));module[_0xcc4e('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc4e('0x3')]},'disposition':{'type':Sequelize[_0xcc4e('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xcc4e('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xcc4e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcc4e('0x6')]('in',_0xcc4e('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js
index d4bbab2..d9a2bf2 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.controller.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['index','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','keys','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','toString','count','sequelize','fields','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','WhatsappInteraction','includeAll','merge','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Whatsapp','YYYY-MM-DD','closedAt','disposition','existsSync','basename','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','TagIds','split','forEach','push','catch'];(function(_0x1124b6,_0x35be37){var _0x1074e8=function(_0xb21e42){while(--_0xb21e42){_0x1124b6['push'](_0x1124b6['shift']());}};_0x1074e8(++_0x35be37);}(_0x814b,0x1a2));var _0xb814=function(_0x59ae8f,_0x148344){_0x59ae8f=_0x59ae8f-0x0;var _0x3900b5=_0x814b[_0x59ae8f];return _0x3900b5;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}function getInteractionUsers(_0x52ed64,_0x9008b2){return new BPromise(function(_0x37d24d,_0x530744){try{if(_0x9008b2[_0x52ed64['id']]){_0x52ed64['Users']=_[_0xb814('0x30')](_0x9008b2[_0x52ed64['id']],function(_0x2051d0){return{'id':_0x2051d0['id'],'fullname':_0x2051d0['fullname']};});}}catch(_0x338a28){_0x530744(_0x338a28);}_0x37d24d(_0x52ed64);});}function getInteractionTags(_0x526610,_0x6efe9a){return new BPromise(function(_0x5f3e9b,_0x4cfc58){try{if(_0x526610[_0xb814('0x31')]){_0x526610['Tags']=[];_0x526610[_0xb814('0x31')][_0xb814('0x32')](',')[_0xb814('0x33')](function(_0x599f9f){_0x526610['Tags'][_0xb814('0x34')](_0x6efe9a[_0x599f9f]);});}delete _0x526610[_0xb814('0x31')];}catch(_0x523566){_0x4cfc58(_0x523566);}_0x5f3e9b(_0x526610);});}function updateWhatsappInteraction(_0x2c8943,_0xe558d5,_0x692c72){return new BPromise(function(_0x217b7e,_0x1b78de){return getInteractionUsers(_0x2c8943,_0x692c72)[_0xb814('0x2b')](function(_0x3672f3){return getInteractionTags(_0x3672f3,_0xe558d5);})['then'](function(_0x3207ec){_0x217b7e(_0x3207ec);})[_0xb814('0x35')](function(_0x30de5a){_0x1b78de(_0x30de5a);});});}exports[_0xb814('0x36')]=function(_0x14100d,_0x4ff31a){var _0x16ef82={},_0x57e6e6={},_0x43db67={'count':0x0,'rows':[]};var _0x16e21c=_[_0xb814('0x30')](db['WhatsappInteraction'][_0xb814('0x37')],function(_0xbdb3e9){return{'name':_0xbdb3e9['fieldName'],'type':_0xbdb3e9[_0xb814('0x38')][_0xb814('0x39')]};});_0x57e6e6[_0xb814('0x3a')]=_[_0xb814('0x30')](_0x16e21c,_0xb814('0x2e'));_0x57e6e6[_0xb814('0x3b')]=_['keys'](_0x14100d[_0xb814('0x3b')]);_0x57e6e6['filters']=_[_0xb814('0x3c')](_0x57e6e6['model'],_0x57e6e6[_0xb814('0x3b')]);_0x16ef82['attributes']=_[_0xb814('0x3c')](_0x57e6e6[_0xb814('0x3a')],qs['fields'](_0x14100d['query']['fields']));_0x16ef82['attributes']=_0x16ef82[_0xb814('0x3d')][_0xb814('0x3e')]?_0x16ef82[_0xb814('0x3d')]:_0x57e6e6[_0xb814('0x3a')];if(!_0x14100d['query']['hasOwnProperty'](_0xb814('0x3f'))){_0x16ef82['limit']=qs[_0xb814('0x40')](_0x14100d[_0xb814('0x3b')][_0xb814('0x40')]);_0x16ef82[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x14100d[_0xb814('0x3b')][_0xb814('0x24')]);}_0x16ef82[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x14100d['query']['sort']);_0x16ef82['where']=qs[_0xb814('0x43')](_['pick'](_0x14100d[_0xb814('0x3b')],_0x57e6e6['filters']),_0x16e21c);var _0x411723=[];var _0x44ff56=squel[_0xb814('0x44')]()[_0xb814('0x45')]('id')['field'](_0xb814('0x2e'))[_0xb814('0x45')](_0xb814('0x46'))[_0xb814('0x47')](_0xb814('0x48'));var _0x450a08=squel['select']()[_0xb814('0x45')](_0xb814('0x49'))[_0xb814('0x45')](_0xb814('0x4a'))[_0xb814('0x45')](_0xb814('0x4b'))[_0xb814('0x47')]('user_has_whatsapp_interactions','ui')['left_join'](_0xb814('0x4c'),'u',_0xb814('0x4d'));var _0x4c08d6=squel[_0xb814('0x44')]()[_0xb814('0x47')](_0xb814('0x4e'),'i')[_0xb814('0x4f')](_0xb814('0x50'),'c',_0xb814('0x51'))[_0xb814('0x4f')](_0xb814('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xb814('0x4f')](_0xb814('0x52'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xb814('0x4f')]('whatsapp_messages','me',_0xb814('0x53'))[_0xb814('0x4f')](_0xb814('0x54'),'it',_0xb814('0x55'))[_0xb814('0x4f')](_0xb814('0x48'),'t',_0xb814('0x56'));var _0x45480e=squel[_0xb814('0x57')]();var _0x2a422a=[];var _0x5e6df7=squel['expr']();var _0x32eca6;if(_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]){_0x32eca6=as[_0xb814('0x59')](_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]);var _0x135208=_0x32eca6['sqlOperator'];for(var _0x26fd0b=0x0;_0x26fd0b<_0x32eca6[_0xb814('0x5a')][_0xb814('0x3e')];_0x26fd0b++){var _0x5a916d=_0x32eca6[_0xb814('0x5a')][_0x26fd0b];var _0x4e6f3c='i';var _0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),_0x5a916d[_0xb814('0x45')]]);if(!_0x252293){switch(_0x5a916d['field']){case _0xb814('0x5b'):if(_0x5a916d[_0xb814('0x5c')]==0x1){_0x4c08d6[_0xb814('0x5d')]('`'+_0x5a916d['field']+_0xb814('0x5e'));}else{_0x4c08d6['having']('`'+_0x5a916d[_0xb814('0x45')]+_0xb814('0x5f'));}break;case'Contact':if(_0x5a916d[_0xb814('0x60')]==='$substring'){if(_0x5a916d['value'][_0xb814('0x32')]('\x20')[_0xb814('0x3e')]>0x1){_0x45480e[_0x135208](_0xb814('0x61'),qs['getFullTextValue'](_0x5a916d[_0xb814('0x5c')]),null);}else{var _0x538b0f='%'+_0x5a916d[_0xb814('0x5c')]+'%';_0x45480e[_0x135208](_0xb814('0x62'),_0x538b0f,_0x538b0f,_0x538b0f);}}else{_0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),'ContactId']);_0x5a916d[_0xb814('0x45')]=_0xb814('0x63');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x67'):var _0x5441c5=_0x5a916d['value'][_0xb814('0x32')](',')[_0xb814('0x30')](function(_0x4d13db){return Number(_0x4d13db);});_0x5441c5[_0xb814('0x33')](function(_0x58b9a6){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58b9a6+',%');});_0x2a422a=_[_0xb814('0x68')](_0x2a422a,_0x5441c5);break;case'User':if(_0x5a916d[_0xb814('0x60')]===_0xb814('0x69')){_0x45480e[_0x135208](_0xb814('0x6a'),'%'+_0x5a916d['value']+'%',null);}else{_0x252293=_[_0xb814('0x6b')](_0x16e21c,['name',_0xb814('0x6c')]);_0x5a916d[_0xb814('0x45')]=_0xb814('0x6c');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x6d'):_0x135e13=as[_0xb814('0x64')]('me',null,_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);break;}}else{var _0x135e13=as['buildExpression'](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')]['start'],_0x135e13[_0xb814('0x5c')]['end']);}}}else{var _0x37e9c5=_(_0x14100d['query'])[_0xb814('0x6e')]()[_0xb814('0x30')](function(_0xa03cd2){return _[_0xb814('0x6f')](_0x16e21c,[_0xb814('0x2e'),_0xa03cd2])?_0xa03cd2:undefined;})[_0xb814('0x70')]()[_0xb814('0x5c')]();if(!_['isEmpty'](_0x37e9c5)){_0x37e9c5[_0xb814('0x33')](function(_0x51ca51){if(_0x51ca51===_0xb814('0x71')){_0x4c08d6[_0xb814('0x72')](_0xb814('0x73'),[][_0xb814('0x74')](_0x14100d[_0xb814('0x3b')][_0x51ca51]));}else if(_0x51ca51===_0xb814('0x75')){var _0x514dab=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])['$gte'];var _0x3bb2b4=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])[_0xb814('0x77')];_0x4c08d6[_0xb814('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514dab,_0x3bb2b4);}else{if(_0x14100d[_0xb814('0x3b')][_0x51ca51]==='null'){_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x78'));}else{_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x79'),_0x14100d[_0xb814('0x3b')][_0x51ca51]);}}});}if(_0x14100d[_0xb814('0x3b')]['read']){if(_0x14100d['query']['read']==0x1){_0x4c08d6[_0xb814('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x4c08d6[_0xb814('0x5d')](_0xb814('0x7a'));}}if(_0x14100d[_0xb814('0x3b')]['tag']){_0x2a422a=_[_0xb814('0x7b')](_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')])?_0x14100d['query'][_0xb814('0x7c')]:new Array(_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')]);_0x2a422a[_0xb814('0x33')](function(_0x555be0){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x555be0+',%');});}if(_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')]){var _0x39863d=_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')][_0xb814('0x7e')]('\x5c','\x5c\x5c')[_0xb814('0x7e')]('\x27\x27',_0xb814('0x7f'));if(qs[_0xb814('0x80')](_0x39863d)){_0x45480e['or'](_0xb814('0x81'),_0x39863d+'%')['or'](_0xb814('0x82'),_0x39863d+'%');}else{_0x45480e['or'](_0xb814('0x83'),qs[_0xb814('0x84')](_0x39863d))['or'](_0xb814('0x85'),_0x39863d+'%');}}}_0x4c08d6[_0xb814('0x72')](_0x45480e);_0x4c08d6['group'](_0xb814('0x86'));var _0x33cfc4={'type':db[_0xb814('0x87')][_0xb814('0x88')][_0xb814('0x89')],'raw':!![]};var _0x283b0f=_0x4c08d6['clone']();_0x283b0f[_0xb814('0x45')]('i.id');_0x283b0f[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));if(_0x16ef82[_0xb814('0x41')]){_0x16ef82[_0xb814('0x41')]['forEach'](function(_0x4c44ee){_0x4c08d6[_0xb814('0x41')]('i.'+_0x4c44ee[0x0],_0x4c44ee[0x1]===_0xb814('0x8b')?![]:!![]);});}if(!_[_0xb814('0x8c')](_0x2a422a)){_0x4c08d6[_0xb814('0x5d')](_0x5e6df7);_0x283b0f['where'](_0xb814('0x8d'),_0x2a422a);}BPromise['resolve']()[_0xb814('0x2b')](function(){if(!_0x32eca6){if(_0x14100d[_0xb814('0x3b')]['WhatsappAccountId']||_0x14100d['query'][_0xb814('0x8e')])return;_0x283b0f['where'](_0xb814('0x8f'));_0x4c08d6[_0xb814('0x72')](_0xb814('0x8f'));return;}return _0x14100d[_0xb814('0x90')][_0xb814('0x91')]({'attributes':['id'],'raw':!![]})[_0xb814('0x2b')](function(_0x40fe4a){if(_['isEmpty'](_0x40fe4a)){_0x283b0f[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x283b0f[_0xb814('0x72')](_0xb814('0x73'),_['map'](_0x40fe4a,'id'));_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IN\x20?',_[_0xb814('0x30')](_0x40fe4a,'id'));}});})[_0xb814('0x2b')](function(){db['sequelize']['query'](_0x283b0f[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x3309c5){_0x43db67[_0xb814('0x93')]=_0x3309c5[_0xb814('0x3e')];if(_0x43db67[_0xb814('0x93')]===0x0)return[];return db[_0xb814('0x94')][_0xb814('0x3b')](_0x44ff56[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x53e705){_0x411723=_['keyBy'](_0x53e705,'id');_0x33cfc4=_['merge'](_0x33cfc4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14100d['query'][_0xb814('0x95')]){_0x16ef82[_0xb814('0x3d')][_0xb814('0x33')](function(_0x59f3ff){_0x4c08d6[_0xb814('0x45')]('i.'+_0x59f3ff);});}else{_0x4c08d6[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x96'),_0xb814('0x97'));_0x4c08d6[_0xb814('0x45')]('a.mandatoryDisposition',_0xb814('0x98'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x99'));_0x4c08d6[_0xb814('0x45')]('c.firstName',_0xb814('0x9a'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x9b'),_0xb814('0x9c'));_0x4c08d6[_0xb814('0x45')]('c.email','Contact.email');_0x4c08d6[_0xb814('0x45')]('c.phone',_0xb814('0x9d'));_0x4c08d6[_0xb814('0x45')]('c.mobile',_0xb814('0x9e'));_0x4c08d6['field'](_0xb814('0x9f'),'Contact.fax');_0x4c08d6[_0xb814('0x45')](_0xb814('0xa0'),_0xb814('0xa1'));_0x4c08d6[_0xb814('0x45')](_0xb814('0xa2'),_0xb814('0xa3'));_0x4c08d6[_0xb814('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16ef82[_0xb814('0x40')])_0x4c08d6['limit'](_0x16ef82['limit']);if(_0x16ef82[_0xb814('0x24')])_0x4c08d6[_0xb814('0x24')](_0x16ef82[_0xb814('0x24')]);return db['sequelize'][_0xb814('0x3b')](_0x4c08d6['toString'](),_0x33cfc4);})[_0xb814('0x2b')](function(_0x19d508){_0x450a08[_0xb814('0x72')](_0xb814('0xa4'),_['map'](_0x19d508,'id'));return db[_0xb814('0x94')][_0xb814('0x3b')](_0x450a08[_0xb814('0x92')](),_0x33cfc4)['then'](function(_0x1ebbf6){var _0x3fc77d=_[_0xb814('0xa5')](_0x1ebbf6,'WhatsappInteractionId');var _0x5d8626=[];_0x19d508[_0xb814('0x33')](function(_0x9dc06b){_0x5d8626[_0xb814('0x34')](updateWhatsappInteraction(_0x9dc06b,_0x411723,_0x3fc77d));});return BPromise[_0xb814('0xa6')](_0x5d8626);});});})[_0xb814('0x2b')](function(_0x37a7ab){_0x43db67[_0xb814('0xa7')]=_0x37a7ab;return _0x43db67;})[_0xb814('0x2b')](respondWithFilteredResult(_0x4ff31a,_0x16ef82));})[_0xb814('0x35')](handleError(_0x4ff31a,null));};exports[_0xb814('0xa8')]=function(_0x2569a5,_0x2a13fb){var _0x5b8d2e={'raw':![],'where':{'id':_0x2569a5[_0xb814('0xa9')]['id']}},_0x5416dc={};_0x5416dc['model']=_[_0xb814('0x6e')](db[_0xb814('0xaa')][_0xb814('0x37')]);_0x5416dc[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x2569a5[_0xb814('0x3b')]);_0x5416dc[_0xb814('0x43')]=_['intersection'](_0x5416dc['model'],_0x5416dc[_0xb814('0x3b')]);_0x5b8d2e['attributes']=_[_0xb814('0x3c')](_0x5416dc[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x2569a5['query'][_0xb814('0x95')]));_0x5b8d2e[_0xb814('0x3d')]=_0x5b8d2e[_0xb814('0x3d')][_0xb814('0x3e')]?_0x5b8d2e[_0xb814('0x3d')]:_0x5416dc['model'];if(_0x2569a5[_0xb814('0x3b')][_0xb814('0xab')]){_0x5b8d2e['include']=[{'all':!![]}];}_0x5b8d2e=_[_0xb814('0xac')]({},_0x5b8d2e,_0x2569a5[_0xb814('0xad')]);return db[_0xb814('0xaa')]['find'](_0x5b8d2e)[_0xb814('0x2b')](handleEntityNotFound(_0x2a13fb,null))[_0xb814('0x2b')](respondWithResult(_0x2a13fb,null))['catch'](handleError(_0x2a13fb,null));};exports[_0xb814('0xae')]=function(_0x171f83,_0x5b5634){return db[_0xb814('0xaa')][_0xb814('0xae')](_0x171f83[_0xb814('0x6d')],{})[_0xb814('0x2b')](respondWithResult(_0x5b5634,0xc9))[_0xb814('0x35')](handleError(_0x5b5634,null));};exports[_0xb814('0x29')]=function(_0x40ae0b,_0x336a8f){if(_0x40ae0b[_0xb814('0x6d')]['id']){delete _0x40ae0b[_0xb814('0x6d')]['id'];}return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x40ae0b['params']['id']}})['then'](handleEntityNotFound(_0x336a8f,null))[_0xb814('0x2b')](saveUpdates(_0x40ae0b['body'],null))['then'](respondWithResult(_0x336a8f,null))[_0xb814('0x35')](handleError(_0x336a8f,null));};exports['destroy']=function(_0x4f0427,_0x50cb34){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x4f0427[_0xb814('0xa9')]['id']}})['then'](handleEntityNotFound(_0x50cb34,null))[_0xb814('0x2b')](removeEntity(_0x50cb34,null))['catch'](handleError(_0x50cb34,null));};exports[_0xb814('0xaf')]=function(_0x2e6660,_0x49a8de){return db[_0xb814('0xaa')]['describe']()[_0xb814('0x2b')](respondWithResult(_0x49a8de,null))[_0xb814('0x35')](handleError(_0x49a8de,null));};exports[_0xb814('0xb0')]=function(_0x39ce17,_0x11efb8,_0xaf705d){return db[_0xb814('0xb1')][_0xb814('0x6b')]({'where':{'id':_0x39ce17[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x11efb8,null))[_0xb814('0x2b')](function(_0x3e7a9a){if(_0x3e7a9a){return _0x3e7a9a[_0xb814('0xb0')](_0x39ce17[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x39ce17[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x11efb8,null))[_0xb814('0x35')](handleError(_0x11efb8,null));};exports[_0xb814('0xb3')]=function(_0x1868d9,_0x570191,_0x56b2aa){var _0x473b30={'raw':![],'where':{}};var _0x4af71e={};var _0x2d40e6={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xb814('0xb4')]({'where':{'id':_0x1868d9['params']['id']}})['then'](handleEntityNotFound(_0x570191,null))[_0xb814('0x2b')](function(_0x32c956){if(_0x32c956){_0x4af71e[_0xb814('0x3a')]=_[_0xb814('0x6e')](db[_0xb814('0xb1')][_0xb814('0x37')]);_0x4af71e[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x1868d9[_0xb814('0x3b')]);_0x4af71e[_0xb814('0x43')]=_[_0xb814('0x3c')](_0x4af71e['model'],_0x4af71e[_0xb814('0x3b')]);_0x473b30['attributes']=_[_0xb814('0x3c')](_0x4af71e[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x1868d9['query'][_0xb814('0x95')]));_0x473b30[_0xb814('0x3d')]=_0x473b30[_0xb814('0x3d')][_0xb814('0x3e')]?_0x473b30[_0xb814('0x3d')]:_0x4af71e[_0xb814('0x3a')];if(!_0x1868d9[_0xb814('0x3b')][_0xb814('0xb5')](_0xb814('0x3f'))){_0x473b30[_0xb814('0x40')]=qs[_0xb814('0x40')](_0x1868d9[_0xb814('0x3b')][_0xb814('0x40')]);_0x473b30[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x1868d9['query'][_0xb814('0x24')]);}_0x473b30[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x1868d9['query']['sort']);_0x473b30[_0xb814('0x72')]=qs['filters'](_['pick'](_0x1868d9['query'],_0x4af71e['filters']));_0x473b30[_0xb814('0x72')][_0xb814('0xb6')]=_0x32c956['id'];if(_0x1868d9['query'][_0xb814('0x7d')]){_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],{'$or':_[_0xb814('0x30')](_0x473b30[_0xb814('0x3d')],function(_0x20e608){var _0x7b9948={};_0x7b9948[_0x20e608]={'$like':'%'+_0x1868d9[_0xb814('0x3b')][_0xb814('0x7d')]+'%'};return _0x7b9948;})});}if(_0x1868d9[_0xb814('0x3b')]['$gte']){var _0x2a5dff=_0x1868d9['query'][_0xb814('0xb7')][_0xb814('0x32')](',');var _0x35e8f7={};_0x35e8f7[_0x2a5dff[0x0]]={'$gte':moment(_0x2a5dff[0x1])[_0xb814('0xb8')](_0xb814('0xb9'))};_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],_0x35e8f7);}_0x473b30=_['merge']({},_0x473b30,_0x1868d9['options']);return db['WhatsappMessage'][_0xb814('0x93')]({'where':_0x473b30[_0xb814('0x72')]})[_0xb814('0x2b')](function(_0x3b7bee){_0x2d40e6[_0xb814('0x93')]=_0x3b7bee;if(_0x1868d9[_0xb814('0x3b')][_0xb814('0xab')]){_0x473b30[_0xb814('0xba')]=[{'all':!![]}];}return db[_0xb814('0xb1')][_0xb814('0xbb')](_0x473b30);})['then'](function(_0x5c989a){_0x2d40e6[_0xb814('0xa7')]=_0x5c989a;return _0x2d40e6;});}})[_0xb814('0x2b')](respondWithFilteredResult(_0x570191,_0x473b30))[_0xb814('0x35')](handleError(_0x570191,null));};exports[_0xb814('0xbc')]=function(_0x3f0c9c,_0x2642ab,_0x48358c){return db[_0xb814('0xaa')]['find']({'where':{'id':_0x3f0c9c[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x2642ab,null))[_0xb814('0x2b')](function(_0x94aa05){if(_0x94aa05){return _0x94aa05[_0xb814('0xbd')](_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x3f0c9c[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{})[_0xb814('0xbe')](function(){return db[_0xb814('0x67')]['findAll']({'attributes':['id',_0xb814('0x2e'),_0xb814('0x46')],'where':{'id':_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')]}});})[_0xb814('0x2b')](function(_0x4a2aa5){socket[_0xb814('0xbf')](_0xb814('0xc0'),{'id':Number(_0x3f0c9c[_0xb814('0xa9')]['id']),'tags':_0x4a2aa5||[]});return{'id':Number(_0x3f0c9c['params']['id']),'tags':_0x4a2aa5||[]};});}})[_0xb814('0x2b')](respondWithResult(_0x2642ab,null))['catch'](handleError(_0x2642ab,null));};exports[_0xb814('0xc1')]=function(_0x5b4315,_0x22f6f1,_0x3467bd){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x5b4315['params']['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x22f6f1,null))[_0xb814('0x2b')](function(_0x3fda0d){if(_0x3fda0d){return _0x3fda0d[_0xb814('0xc1')](_0x5b4315[_0xb814('0x3b')][_0xb814('0xb2')]);}})[_0xb814('0x2b')](respondWithStatusCode(_0x22f6f1,null))[_0xb814('0x35')](handleError(_0x22f6f1,null));};exports[_0xb814('0xc2')]=function(_0x152260,_0x3bc03a){var _0x368696=moment()[_0xb814('0xc3')]()[_0xb814('0x92')]();var _0x8e882a=path['join'](config[_0xb814('0xc4')],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc7'));var _0x4017b6=path[_0xb814('0xc8')](config['root'],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc9'));var _0x31b4f5=path['join'](_0x8e882a,_0x368696);var _0x5b5a26=util[_0xb814('0xb8')](_0xb814('0xca'),_0x152260[_0xb814('0xa9')]['id'],_0x368696);var _0x667ca1=path[_0xb814('0xc8')](_0x8e882a,_0x5b5a26);var _0x2c510a=[];_0x2c510a['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xcb'),'attributes':['id',_0xb814('0xcc')],'raw':!![]});_0x2c510a[_0xb814('0x34')]({'model':db['CmContact'],'as':_0xb814('0xcd'),'attributes':['id',_0xb814('0xce'),_0xb814('0xcf')],'raw':!![]});if(_0x152260[_0xb814('0x3b')][_0xb814('0xc9')]){_0x2c510a['push']({'model':db[_0xb814('0xd0')],'as':_0xb814('0xd0'),'raw':!![]});}var _0x371dd7=[{'model':db[_0xb814('0xb1')],'as':_0xb814('0xd1'),'attributes':['id',_0xb814('0x6d'),_0xb814('0x75'),_0xb814('0xd2'),_0xb814('0xd3'),_0xb814('0xd4')],'include':_0x2c510a}];_0x371dd7[_0xb814('0x34')]({'model':db[_0xb814('0xd5')],'as':_0xb814('0xd6'),'attributes':['id','name']});_0x371dd7['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xd7'),'attributes':['id',_0xb814('0xcc')]});return db['WhatsappInteraction'][_0xb814('0x6b')]({'where':{'id':_0x152260[_0xb814('0xa9')]['id']},'include':_0x371dd7})[_0xb814('0x2b')](handleEntityNotFound(_0x3bc03a,null))['then'](function(_0x10537d){if(_0x10537d){var _0xa651a=_0x10537d[_0xb814('0xd8')]({'plain':!![]});fs[_0xb814('0xd9')](_0x31b4f5);var _0x6ec0f5={'format':'A4','border':_0xb814('0xda'),'header':{'height':'40px','contents':{'first':_0xb814('0xdb')}},'footer':{'height':'30px','contents':{'default':util[_0xb814('0xb8')](' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',util[_0xb814('0xb8')](_0xb814('0xdc'),_0xb814('0xdd'),_0xa651a['id']),moment()['format'](_0xb814('0xde'))[_0xb814('0x92')]())}}};var _0x164304={'channel':'Whatsapp','account':_0xa651a[_0xb814('0xd6')]['name'],'agent':_0xa651a[_0xb814('0xd7')]?_0xa651a[_0xb814('0xd7')][_0xb814('0xcc')]:'N.A.','createdAt':moment(_0xa651a[_0xb814('0x75')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')](),'closedAt':_0xa651a['closed']?moment(_0xa651a[_0xb814('0xdf')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')]():'','disposition':_0xa651a[_0xb814('0xe0')],'messages':_(_0xa651a[_0xb814('0xd1')])[_0xb814('0x7d')]({'secret':![]})[_0xb814('0x30')](function(_0x9a33d0){if(_0x9a33d0['Attachment']){var _0x2fe47b=path[_0xb814('0xc8')](_0x4017b6,_0x9a33d0[_0xb814('0xd0')]['basename']);if(fs[_0xb814('0xe1')](_0x2fe47b)){fs['createReadStream'](_0x2fe47b)['pipe'](fs['createWriteStream'](path[_0xb814('0xc8')](_0x31b4f5,_0x9a33d0['Attachment'][_0xb814('0xe2')])));}}return{'date':moment(_0x9a33d0[_0xb814('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb814('0x92')](),'sender':_0x9a33d0['direction']===_0xb814('0xe3')?_0x9a33d0['User']?_0x9a33d0[_0xb814('0xcb')][_0xb814('0xcc')]:_0xb814('0xe4'):_0x9a33d0['Contact']['firstName']+(_0x9a33d0['Contact'][_0xb814('0xcf')]?'\x20'+_0x9a33d0['Contact']['lastName']:''),'body':_0x9a33d0[_0xb814('0xd0')]?_0x9a33d0['Attachment']['basename']:_0x9a33d0['body'],'direction':_0x9a33d0[_0xb814('0xd2')]===_0xb814('0xe3')?'A':'C','secret':_0x9a33d0[_0xb814('0xd3')],'read':_0x9a33d0['read'],'attachment':_0x9a33d0[_0xb814('0xd0')]};})[_0xb814('0x5c')]()};return ejs[_0xb814('0xe5')](path[_0xb814('0xc8')](config[_0xb814('0xc4')],_0xb814('0xc5'),'views',_0xb814('0xe6')),{'interaction':_0x164304})[_0xb814('0x2b')](function(_0x28b818){return new BPromise(function(_0x171845,_0x4f2db2){pdf[_0xb814('0xae')](_0x28b818,_0x6ec0f5)[_0xb814('0xe7')](path[_0xb814('0xc8')](_0x31b4f5,_0xb814('0xe8')+_0xa651a['id']+'-'+_0x368696+_0xb814('0xe9')),function(_0x2cb01d,_0x1f4540){if(_0x2cb01d)return _0x4f2db2(_0x2cb01d);_0x171845(_0x1f4540);});});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x81ebc0,_0x2e7959){zipdir(_0x31b4f5,{'saveTo':_0x667ca1},function(_0x47f054,_0x1aa70b){if(_0x47f054)return _0x2e7959(_0x47f054);return _0x81ebc0(_0x1aa70b);});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x5706ad,_0x3b8438){rimraf(_0x31b4f5,function(_0x56e231){if(_0x56e231)_0x3b8438(_0x56e231);return _0x5706ad();});});})[_0xb814('0x2b')](function(){return _0x3bc03a[_0xb814('0xc2')](_0x667ca1,_0x5b5a26,function(_0x5e2273){if(_0x5e2273){console[_0xb814('0xea')]('err',_0x5e2273);}else{fs[_0xb814('0xeb')](_0x667ca1);}});});});}else{return _0x3bc03a[_0xb814('0x20')](0xc8);}})[_0xb814('0x35')](handleError(_0x3bc03a,null));};
\ No newline at end of file
+var _0xc4aa=['status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','push','catch','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','length','getFullTextValue','ContactId','buildExpression','type','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.phone\x20LIKE\x20?','group','QueryTypes','SELECT','clone','order','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','include','merge','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','omit','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','createdAt','secret','WhatsappAccount','Account','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','format','%s\x20#%d','Whatsapp','YYYY-MM-DD','Owner','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','downloadInteraction.html','transcript-','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus'];(function(_0x5700ad,_0x16dc0e){var _0x5a3c14=function(_0x2dc0df){while(--_0x2dc0df){_0x5700ad['push'](_0x5700ad['shift']());}};_0x5a3c14(++_0x16dc0e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];config[_0xac4a('0x16')]=_[_0xac4a('0x17')](config['redis'],{'host':_0xac4a('0x18'),'port':0x18eb});var socket=require(_0xac4a('0x19'))(new Redis(config[_0xac4a('0x16')]));require(_0xac4a('0x1a'))[_0xac4a('0x1b')](socket);function respondWithStatusCode(_0x3b71c0,_0x34bc01){_0x34bc01=_0x34bc01||0xcc;return function(_0x33c287){if(_0x33c287){return _0x3b71c0[_0xac4a('0x1c')](_0x34bc01);}return _0x3b71c0[_0xac4a('0x1d')](_0x34bc01)[_0xac4a('0x1e')]();};}function respondWithResult(_0x26dbb8,_0x4a2119){_0x4a2119=_0x4a2119||0xc8;return function(_0x402fff){if(_0x402fff){return _0x26dbb8[_0xac4a('0x1d')](_0x4a2119)[_0xac4a('0x1f')](_0x402fff);}};}function respondWithFilteredResult(_0x144553,_0x3e88e3){return function(_0x387a54){if(_0x387a54){var _0x28e304=_0x387a54[_0xac4a('0x20')],_0x44ec59=_0x3e88e3[_0xac4a('0x21')],_0x546c5d=_0x3e88e3[_0xac4a('0x21')]+_0x3e88e3['limit'],_0x5ac21e;if(_0x546c5d>=_0x28e304){_0x546c5d=_0x28e304;_0x5ac21e=0xc8;}else{_0x5ac21e=0xce;}_0x144553[_0xac4a('0x1d')](_0x5ac21e);return _0x144553[_0xac4a('0x22')](_0xac4a('0x23'),_0x44ec59+'-'+_0x546c5d+'/'+_0x28e304)[_0xac4a('0x1f')](_0x387a54);}return null;};}function patchUpdates(_0x123694){return function(_0x3e829c){try{jsonpatch[_0xac4a('0x24')](_0x3e829c,_0x123694,!![]);}catch(_0x3ca790){return BPromise['reject'](_0x3ca790);}return _0x3e829c[_0xac4a('0x25')]();};}function saveUpdates(_0x3204ad,_0x599787){return function(_0x3d7ce0){if(_0x3d7ce0){return _0x3d7ce0[_0xac4a('0x26')](_0x3204ad)[_0xac4a('0x27')](function(_0x947d8e){return _0x947d8e;});}return null;};}function removeEntity(_0x4d2d6c,_0x1b7998){return function(_0x2503d8){if(_0x2503d8){return _0x2503d8[_0xac4a('0x28')]()[_0xac4a('0x27')](function(){_0x4d2d6c[_0xac4a('0x1d')](0xcc)[_0xac4a('0x1e')]();});}};}function handleEntityNotFound(_0x222507,_0x36054a){return function(_0x3e2c69){if(!_0x3e2c69){_0x222507[_0xac4a('0x1c')](0x194);}return _0x3e2c69;};}function handleError(_0x1d0539,_0x215a31){_0x215a31=_0x215a31||0x1f4;return function(_0x14832b){logger[_0xac4a('0x29')](_0x14832b[_0xac4a('0x2a')]);if(_0x14832b[_0xac4a('0x2b')]){delete _0x14832b['name'];}_0x1d0539[_0xac4a('0x1d')](_0x215a31)[_0xac4a('0x2c')](_0x14832b);};}function getInteractionUsers(_0x42a33c,_0x2772fe){return new BPromise(function(_0x116700,_0x4a5a9e){try{if(_0x2772fe[_0x42a33c['id']]){_0x42a33c['Users']=_[_0xac4a('0x2d')](_0x2772fe[_0x42a33c['id']],function(_0x7a948b){return{'id':_0x7a948b['id'],'fullname':_0x7a948b[_0xac4a('0x2e')]};});}}catch(_0x546b65){_0x4a5a9e(_0x546b65);}_0x116700(_0x42a33c);});}function getInteractionTags(_0x4bda1f,_0x355755){return new BPromise(function(_0x2896bc,_0x228629){try{if(_0x4bda1f[_0xac4a('0x2f')]){_0x4bda1f[_0xac4a('0x30')]=[];_0x4bda1f['TagIds'][_0xac4a('0x31')](',')['forEach'](function(_0x30364b){_0x4bda1f['Tags'][_0xac4a('0x32')](_0x355755[_0x30364b]);});}delete _0x4bda1f[_0xac4a('0x2f')];}catch(_0x31501b){_0x228629(_0x31501b);}_0x2896bc(_0x4bda1f);});}function updateWhatsappInteraction(_0x228aa7,_0x34577f,_0x61e552){return new BPromise(function(_0xbd4591,_0x1f13f3){return getInteractionUsers(_0x228aa7,_0x61e552)[_0xac4a('0x27')](function(_0xfd7c16){return getInteractionTags(_0xfd7c16,_0x34577f);})[_0xac4a('0x27')](function(_0x1634df){_0xbd4591(_0x1634df);})[_0xac4a('0x33')](function(_0x1a9d4e){_0x1f13f3(_0x1a9d4e);});});}exports['index']=function(_0x30442d,_0x1c41fb){var _0x5a4e2b={},_0x2a5419={},_0x1af1c1={'count':0x0,'rows':[]};var _0x565164=_['map'](db[_0xac4a('0x34')][_0xac4a('0x35')],function(_0x1b42b6){return{'name':_0x1b42b6[_0xac4a('0x36')],'type':_0x1b42b6['type'][_0xac4a('0x37')]};});_0x2a5419[_0xac4a('0x38')]=_['map'](_0x565164,_0xac4a('0x2b'));_0x2a5419[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x30442d['query']);_0x2a5419[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x2a5419[_0xac4a('0x38')],_0x2a5419['query']);_0x5a4e2b[_0xac4a('0x3d')]=_[_0xac4a('0x3c')](_0x2a5419['model'],qs['fields'](_0x30442d[_0xac4a('0x39')]['fields']));_0x5a4e2b['attributes']=_0x5a4e2b['attributes']['length']?_0x5a4e2b[_0xac4a('0x3d')]:_0x2a5419[_0xac4a('0x38')];if(!_0x30442d[_0xac4a('0x39')][_0xac4a('0x3e')](_0xac4a('0x3f'))){_0x5a4e2b[_0xac4a('0x40')]=qs[_0xac4a('0x40')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x40')]);_0x5a4e2b[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x30442d[_0xac4a('0x39')]['offset']);}_0x5a4e2b['order']=qs['sort'](_0x30442d[_0xac4a('0x39')][_0xac4a('0x41')]);_0x5a4e2b[_0xac4a('0x42')]=qs[_0xac4a('0x3b')](_[_0xac4a('0x43')](_0x30442d[_0xac4a('0x39')],_0x2a5419[_0xac4a('0x3b')]),_0x565164);var _0x3441f2=[];var _0x3e9973=squel[_0xac4a('0x44')]()['field']('id')[_0xac4a('0x45')](_0xac4a('0x2b'))[_0xac4a('0x45')](_0xac4a('0x46'))[_0xac4a('0x47')]('tools_tags');var _0x8700b4=squel[_0xac4a('0x44')]()['field'](_0xac4a('0x48'))['field'](_0xac4a('0x49'))[_0xac4a('0x45')](_0xac4a('0x4a'))[_0xac4a('0x47')](_0xac4a('0x4b'),'ui')[_0xac4a('0x4c')](_0xac4a('0x4d'),'u',_0xac4a('0x4e'));var _0x98e0c4=squel[_0xac4a('0x44')]()[_0xac4a('0x47')](_0xac4a('0x4f'),'i')['left_join'](_0xac4a('0x50'),'c',_0xac4a('0x51'))[_0xac4a('0x4c')]('users','o',_0xac4a('0x52'))[_0xac4a('0x4c')]('whatsapp_accounts','a',_0xac4a('0x53'))['left_join'](_0xac4a('0x54'),'me',_0xac4a('0x55'))[_0xac4a('0x4c')]('whatsapp_interaction_has_tags','it','it.WhatsappInteractionId\x20=\x20i.id')[_0xac4a('0x4c')]('tools_tags','t',_0xac4a('0x56'));var _0x566258=squel[_0xac4a('0x57')]();var _0x530bbb=[];var _0x3be103=squel[_0xac4a('0x57')]();var _0x424f9b;if(_0x30442d[_0xac4a('0x39')]['search']){_0x424f9b=as[_0xac4a('0x58')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x59')]);var _0x1ee454=_0x424f9b[_0xac4a('0x5a')];for(var _0x138876=0x0;_0x138876<_0x424f9b[_0xac4a('0x5b')]['length'];_0x138876++){var _0x35dee5=_0x424f9b[_0xac4a('0x5b')][_0x138876];var _0x4828e3='i';var _0x16afbe=_[_0xac4a('0x5c')](_0x565164,[_0xac4a('0x2b'),_0x35dee5[_0xac4a('0x45')]]);if(!_0x16afbe){switch(_0x35dee5['field']){case _0xac4a('0x5d'):if(_0x35dee5[_0xac4a('0x5e')]==0x1){_0x98e0c4[_0xac4a('0x5f')]('`'+_0x35dee5[_0xac4a('0x45')]+_0xac4a('0x60'));}else{_0x98e0c4['having']('`'+_0x35dee5[_0xac4a('0x45')]+'`\x20>\x200');}break;case _0xac4a('0x61'):if(_0x35dee5[_0xac4a('0x62')]==='$substring'){if(_0x35dee5['value'][_0xac4a('0x31')]('\x20')[_0xac4a('0x63')]>0x1){_0x566258[_0x1ee454]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xac4a('0x64')](_0x35dee5[_0xac4a('0x5e')]),null);}else{var _0x26b582='%'+_0x35dee5[_0xac4a('0x5e')]+'%';_0x566258[_0x1ee454]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x26b582,_0x26b582,_0x26b582);}}else{_0x16afbe=_[_0xac4a('0x5c')](_0x565164,[_0xac4a('0x2b'),_0xac4a('0x65')]);_0x35dee5[_0xac4a('0x45')]=_0xac4a('0x65');_0x19ce2c=as[_0xac4a('0x66')](_0x4828e3,_0x16afbe[_0xac4a('0x67')],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c['text'],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}break;case _0xac4a('0x69'):var _0x2ac1e9=_0x35dee5[_0xac4a('0x5e')][_0xac4a('0x31')](',')[_0xac4a('0x2d')](function(_0x786d9){return Number(_0x786d9);});_0x2ac1e9[_0xac4a('0x6a')](function(_0x38dd4f){_0x3be103['or'](_0xac4a('0x6b'),'%,'+_0x38dd4f+',%');});_0x530bbb=_[_0xac4a('0x6c')](_0x530bbb,_0x2ac1e9);break;case _0xac4a('0x6d'):if(_0x35dee5[_0xac4a('0x62')]==='$substring'){_0x566258[_0x1ee454](_0xac4a('0x6e'),'%'+_0x35dee5['value']+'%',null);}else{_0x16afbe=_[_0xac4a('0x5c')](_0x565164,['name',_0xac4a('0x6f')]);_0x35dee5['field']=_0xac4a('0x6f');_0x19ce2c=as['buildExpression'](_0x4828e3,_0x16afbe['type'],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}break;case _0xac4a('0x71'):_0x19ce2c=as['buildExpression']('me',null,_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c['value'][_0xac4a('0x68')],_0x19ce2c['value'][_0xac4a('0x1e')]);break;}}else{var _0x19ce2c=as[_0xac4a('0x66')](_0x4828e3,_0x16afbe[_0xac4a('0x67')],_0x35dee5);_0x566258[_0x1ee454](_0x19ce2c[_0xac4a('0x70')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x68')],_0x19ce2c[_0xac4a('0x5e')][_0xac4a('0x1e')]);}}}else{var _0x430dd0=_(_0x30442d[_0xac4a('0x39')])[_0xac4a('0x3a')]()[_0xac4a('0x2d')](function(_0x2cc410){return _[_0xac4a('0x72')](_0x565164,[_0xac4a('0x2b'),_0x2cc410])?_0x2cc410:undefined;})[_0xac4a('0x73')]()['value']();if(!_[_0xac4a('0x74')](_0x430dd0)){_0x430dd0[_0xac4a('0x6a')](function(_0x4fb812){if(_0x4fb812===_0xac4a('0x75')){_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x76'),[][_0xac4a('0x77')](_0x30442d[_0xac4a('0x39')][_0x4fb812]));}else if(_0x4fb812==='createdAt'){var _0x47c6d8=JSON[_0xac4a('0x78')](_0x30442d[_0xac4a('0x39')][_0x4fb812])[_0xac4a('0x79')];var _0x148288=JSON[_0xac4a('0x78')](_0x30442d[_0xac4a('0x39')][_0x4fb812])[_0xac4a('0x7a')];_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x7b'),_0x47c6d8,_0x148288);}else{if(_0x30442d[_0xac4a('0x39')][_0x4fb812]===_0xac4a('0x7c')){_0x98e0c4['where']('i.'+_0x4fb812+'\x20IS\x20NULL');}else{_0x98e0c4[_0xac4a('0x42')]('i.'+_0x4fb812+_0xac4a('0x7d'),_0x30442d[_0xac4a('0x39')][_0x4fb812]);}}});}if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x7e')]){if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x7e')]==0x1){_0x98e0c4[_0xac4a('0x5f')](_0xac4a('0x7f'));}else{_0x98e0c4[_0xac4a('0x5f')](_0xac4a('0x80'));}}if(_0x30442d[_0xac4a('0x39')]['tag']){_0x530bbb=_[_0xac4a('0x81')](_0x30442d[_0xac4a('0x39')][_0xac4a('0x82')])?_0x30442d[_0xac4a('0x39')]['tag']:new Array(_0x30442d[_0xac4a('0x39')]['tag']);_0x530bbb[_0xac4a('0x6a')](function(_0x3af39a){_0x3be103['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3af39a+',%');});}if(_0x30442d['query'][_0xac4a('0x83')]){var _0x3b8974=_0x30442d[_0xac4a('0x39')]['filter'][_0xac4a('0x84')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xac4a('0x85'));if(qs['isNumeric'](_0x3b8974)){_0x566258['or']('i.id\x20LIKE\x20?',_0x3b8974+'%')['or'](_0xac4a('0x86'),_0x3b8974+'%');}else{_0x566258['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xac4a('0x64')](_0x3b8974))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3b8974+'%');}}}_0x98e0c4[_0xac4a('0x42')](_0x566258);_0x98e0c4[_0xac4a('0x87')]('i.id');var _0x3980ae={'type':db['Sequelize'][_0xac4a('0x88')][_0xac4a('0x89')],'raw':!![]};var _0x522949=_0x98e0c4[_0xac4a('0x8a')]();_0x522949['field']('i.id');_0x522949[_0xac4a('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xac4a('0x5d'));if(_0x5a4e2b['order']){_0x5a4e2b['order'][_0xac4a('0x6a')](function(_0x4065c0){_0x98e0c4[_0xac4a('0x8b')]('i.'+_0x4065c0[0x0],_0x4065c0[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x530bbb)){_0x98e0c4[_0xac4a('0x5f')](_0x3be103);_0x522949[_0xac4a('0x42')]('t.id\x20IN\x20?',_0x530bbb);}BPromise['resolve']()[_0xac4a('0x27')](function(){if(!_0x424f9b){if(_0x30442d[_0xac4a('0x39')][_0xac4a('0x75')]||_0x30442d[_0xac4a('0x39')][_0xac4a('0x8c')])return;_0x522949[_0xac4a('0x42')](_0xac4a('0x8d'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x8d'));return;}return _0x30442d['user'][_0xac4a('0x8e')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x27')](function(_0x3ba61e){if(_['isEmpty'](_0x3ba61e)){_0x522949[_0xac4a('0x42')](_0xac4a('0x8f'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x8f'));}else{_0x522949[_0xac4a('0x42')]('i.WhatsappAccountId\x20IN\x20?',_[_0xac4a('0x2d')](_0x3ba61e,'id'));_0x98e0c4[_0xac4a('0x42')](_0xac4a('0x76'),_[_0xac4a('0x2d')](_0x3ba61e,'id'));}});})[_0xac4a('0x27')](function(){db[_0xac4a('0x90')][_0xac4a('0x39')](_0x522949['toString'](),_0x3980ae)[_0xac4a('0x27')](function(_0x2be178){_0x1af1c1[_0xac4a('0x20')]=_0x2be178[_0xac4a('0x63')];if(_0x1af1c1[_0xac4a('0x20')]===0x0)return[];return db[_0xac4a('0x90')]['query'](_0x3e9973[_0xac4a('0x91')](),_0x3980ae)[_0xac4a('0x27')](function(_0x1b9a33){_0x3441f2=_[_0xac4a('0x92')](_0x1b9a33,'id');_0x3980ae=_['merge'](_0x3980ae,{'model':db[_0xac4a('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30442d['query'][_0xac4a('0x93')]){_0x5a4e2b[_0xac4a('0x3d')]['forEach'](function(_0x5b95ab){_0x98e0c4[_0xac4a('0x45')]('i.'+_0x5b95ab);});}else{_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x94'),'unreadMessages');_0x98e0c4[_0xac4a('0x45')]('a.key',_0xac4a('0x95'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x96'),_0xac4a('0x97'));_0x98e0c4[_0xac4a('0x45')]('i.*');_0x98e0c4['field'](_0xac4a('0x98'),_0xac4a('0x99'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9a'),_0xac4a('0x9b'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9c'),_0xac4a('0x9d'));_0x98e0c4['field']('c.phone',_0xac4a('0x9e'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0x9f'),_0xac4a('0xa0'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa1'),_0xac4a('0xa2'));_0x98e0c4[_0xac4a('0x45')]('o.fullname','Owner.fullname');_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa3'),_0xac4a('0xa4'));_0x98e0c4[_0xac4a('0x45')](_0xac4a('0xa5'),_0xac4a('0x2f'));}if(_0x5a4e2b[_0xac4a('0x40')])_0x98e0c4['limit'](_0x5a4e2b[_0xac4a('0x40')]);if(_0x5a4e2b[_0xac4a('0x21')])_0x98e0c4[_0xac4a('0x21')](_0x5a4e2b['offset']);return db[_0xac4a('0x90')][_0xac4a('0x39')](_0x98e0c4[_0xac4a('0x91')](),_0x3980ae);})[_0xac4a('0x27')](function(_0x1a7448){_0x8700b4[_0xac4a('0x42')](_0xac4a('0xa6'),_[_0xac4a('0x2d')](_0x1a7448,'id'));return db[_0xac4a('0x90')]['query'](_0x8700b4[_0xac4a('0x91')](),_0x3980ae)['then'](function(_0x203321){var _0x1199f6=_[_0xac4a('0xa7')](_0x203321,_0xac4a('0xa8'));var _0x840fec=[];_0x1a7448[_0xac4a('0x6a')](function(_0x19766a){_0x840fec['push'](updateWhatsappInteraction(_0x19766a,_0x3441f2,_0x1199f6));});return BPromise[_0xac4a('0xa9')](_0x840fec);});});})[_0xac4a('0x27')](function(_0x279f9b){_0x1af1c1[_0xac4a('0xaa')]=_0x279f9b;return _0x1af1c1;})[_0xac4a('0x27')](respondWithFilteredResult(_0x1c41fb,_0x5a4e2b));})['catch'](handleError(_0x1c41fb,null));};exports[_0xac4a('0xab')]=function(_0x360d4f,_0x4f2b19){var _0x55af32={'raw':![],'where':{'id':_0x360d4f[_0xac4a('0xac')]['id']}},_0x386d6d={};_0x386d6d['model']=_[_0xac4a('0x3a')](db[_0xac4a('0x34')][_0xac4a('0x35')]);_0x386d6d[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x360d4f[_0xac4a('0x39')]);_0x386d6d['filters']=_[_0xac4a('0x3c')](_0x386d6d[_0xac4a('0x38')],_0x386d6d[_0xac4a('0x39')]);_0x55af32['attributes']=_[_0xac4a('0x3c')](_0x386d6d[_0xac4a('0x38')],qs[_0xac4a('0x93')](_0x360d4f[_0xac4a('0x39')][_0xac4a('0x93')]));_0x55af32[_0xac4a('0x3d')]=_0x55af32['attributes'][_0xac4a('0x63')]?_0x55af32[_0xac4a('0x3d')]:_0x386d6d['model'];if(_0x360d4f[_0xac4a('0x39')]['includeAll']){_0x55af32[_0xac4a('0xad')]=[{'all':!![]}];}_0x55af32=_[_0xac4a('0xae')]({},_0x55af32,_0x360d4f['options']);return db[_0xac4a('0x34')]['find'](_0x55af32)[_0xac4a('0x27')](handleEntityNotFound(_0x4f2b19,null))['then'](respondWithResult(_0x4f2b19,null))[_0xac4a('0x33')](handleError(_0x4f2b19,null));};exports[_0xac4a('0xaf')]=function(_0x24f464,_0xfe8977){return db[_0xac4a('0x34')][_0xac4a('0xaf')](_0x24f464[_0xac4a('0x71')],{})[_0xac4a('0x27')](respondWithResult(_0xfe8977,0xc9))[_0xac4a('0x33')](handleError(_0xfe8977,null));};exports[_0xac4a('0x26')]=function(_0x3a0163,_0x455eb7){if(_0x3a0163[_0xac4a('0x71')]['id']){delete _0x3a0163[_0xac4a('0x71')]['id'];}return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x3a0163[_0xac4a('0xac')]['id']}})['then'](handleEntityNotFound(_0x455eb7,null))[_0xac4a('0x27')](saveUpdates(_0x3a0163[_0xac4a('0x71')],null))[_0xac4a('0x27')](respondWithResult(_0x455eb7,null))[_0xac4a('0x33')](handleError(_0x455eb7,null));};exports[_0xac4a('0x28')]=function(_0x5d5bb3,_0x101137){return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x5d5bb3[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x101137,null))[_0xac4a('0x27')](removeEntity(_0x101137,null))['catch'](handleError(_0x101137,null));};exports[_0xac4a('0xb0')]=function(_0x55866d,_0x277fd1){return db[_0xac4a('0x34')][_0xac4a('0xb0')]()['then'](respondWithResult(_0x277fd1,null))[_0xac4a('0x33')](handleError(_0x277fd1,null));};exports[_0xac4a('0xb1')]=function(_0x127ede,_0x52f3f2,_0x2da95f){return db[_0xac4a('0xb2')][_0xac4a('0x5c')]({'where':{'id':_0x127ede[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x52f3f2,null))[_0xac4a('0x27')](function(_0x3b4183){if(_0x3b4183){return _0x3b4183[_0xac4a('0xb1')](_0x127ede['body'][_0xac4a('0xb3')],_['omit'](_0x127ede['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x52f3f2,null))['catch'](handleError(_0x52f3f2,null));};exports[_0xac4a('0xb4')]=function(_0x58fcb0,_0xc014a6,_0x377444){var _0x2132b2={'raw':![],'where':{}};var _0x525d50={};var _0x9ea4d1={'count':0x0,'rows':[]};return db[_0xac4a('0x34')][_0xac4a('0xb5')]({'where':{'id':_0x58fcb0[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0xc014a6,null))[_0xac4a('0x27')](function(_0x7a1b25){if(_0x7a1b25){_0x525d50[_0xac4a('0x38')]=_['keys'](db[_0xac4a('0xb2')][_0xac4a('0x35')]);_0x525d50[_0xac4a('0x39')]=_[_0xac4a('0x3a')](_0x58fcb0[_0xac4a('0x39')]);_0x525d50[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x525d50['model'],_0x525d50['query']);_0x2132b2[_0xac4a('0x3d')]=_[_0xac4a('0x3c')](_0x525d50['model'],qs[_0xac4a('0x93')](_0x58fcb0[_0xac4a('0x39')]['fields']));_0x2132b2['attributes']=_0x2132b2[_0xac4a('0x3d')][_0xac4a('0x63')]?_0x2132b2[_0xac4a('0x3d')]:_0x525d50[_0xac4a('0x38')];if(!_0x58fcb0[_0xac4a('0x39')]['hasOwnProperty'](_0xac4a('0x3f'))){_0x2132b2['limit']=qs['limit'](_0x58fcb0['query'][_0xac4a('0x40')]);_0x2132b2[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x21')]);}_0x2132b2[_0xac4a('0x8b')]=qs[_0xac4a('0x41')](_0x58fcb0[_0xac4a('0x39')]['sort']);_0x2132b2['where']=qs['filters'](_[_0xac4a('0x43')](_0x58fcb0[_0xac4a('0x39')],_0x525d50[_0xac4a('0x3b')]));_0x2132b2[_0xac4a('0x42')][_0xac4a('0xa8')]=_0x7a1b25['id'];if(_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x83')]){_0x2132b2[_0xac4a('0x42')]=_[_0xac4a('0xae')](_0x2132b2[_0xac4a('0x42')],{'$or':_[_0xac4a('0x2d')](_0x2132b2[_0xac4a('0x3d')],function(_0xe0fd57){var _0x32b013={};_0x32b013[_0xe0fd57]={'$like':'%'+_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x83')]+'%'};return _0x32b013;})});}if(_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x79')]){var _0x41cdb5=_0x58fcb0[_0xac4a('0x39')][_0xac4a('0x79')][_0xac4a('0x31')](',');var _0x3e2575={};_0x3e2575[_0x41cdb5[0x0]]={'$gte':moment(_0x41cdb5[0x1])['format'](_0xac4a('0xb6'))};_0x2132b2[_0xac4a('0x42')]=_[_0xac4a('0xae')](_0x2132b2[_0xac4a('0x42')],_0x3e2575);}_0x2132b2=_[_0xac4a('0xae')]({},_0x2132b2,_0x58fcb0[_0xac4a('0xb7')]);return db[_0xac4a('0xb2')][_0xac4a('0x20')]({'where':_0x2132b2['where']})['then'](function(_0x113f80){_0x9ea4d1[_0xac4a('0x20')]=_0x113f80;if(_0x58fcb0[_0xac4a('0x39')]['includeAll']){_0x2132b2['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xac4a('0xb8')](_0x2132b2);})['then'](function(_0x59e82c){_0x9ea4d1[_0xac4a('0xaa')]=_0x59e82c;return _0x9ea4d1;});}})['then'](respondWithFilteredResult(_0xc014a6,_0x2132b2))[_0xac4a('0x33')](handleError(_0xc014a6,null));};exports['addTags']=function(_0x3f95a4,_0x2b4f28,_0x413f5f){return db[_0xac4a('0x34')][_0xac4a('0x5c')]({'where':{'id':_0x3f95a4[_0xac4a('0xac')]['id']}})['then'](handleEntityNotFound(_0x2b4f28,null))[_0xac4a('0x27')](function(_0x34b6d7){if(_0x34b6d7){return _0x34b6d7[_0xac4a('0xb9')](_0x3f95a4['body'][_0xac4a('0xb3')],_[_0xac4a('0xba')](_0x3f95a4[_0xac4a('0x71')],[_0xac4a('0xb3'),'id'])||{})['spread'](function(){return db[_0xac4a('0x69')][_0xac4a('0xb8')]({'attributes':['id',_0xac4a('0x2b'),_0xac4a('0x46')],'where':{'id':_0x3f95a4[_0xac4a('0x71')][_0xac4a('0xb3')]}});})['then'](function(_0x57d3cd){socket[_0xac4a('0xbb')](_0xac4a('0xbc'),{'id':Number(_0x3f95a4[_0xac4a('0xac')]['id']),'tags':_0x57d3cd||[]});return{'id':Number(_0x3f95a4[_0xac4a('0xac')]['id']),'tags':_0x57d3cd||[]};});}})[_0xac4a('0x27')](respondWithResult(_0x2b4f28,null))[_0xac4a('0x33')](handleError(_0x2b4f28,null));};exports['removeTags']=function(_0x21a6f6,_0x580c9b,_0xe4165d){return db['WhatsappInteraction'][_0xac4a('0x5c')]({'where':{'id':_0x21a6f6[_0xac4a('0xac')]['id']}})[_0xac4a('0x27')](handleEntityNotFound(_0x580c9b,null))[_0xac4a('0x27')](function(_0x5650ce){if(_0x5650ce){return _0x5650ce[_0xac4a('0xbd')](_0x21a6f6[_0xac4a('0x39')][_0xac4a('0xb3')]);}})[_0xac4a('0x27')](respondWithStatusCode(_0x580c9b,null))[_0xac4a('0x33')](handleError(_0x580c9b,null));};exports['download']=function(_0x3dd60a,_0xbe1958){var _0x462964=moment()[_0xac4a('0xbe')]()[_0xac4a('0x91')]();var _0x5e5eb1=path[_0xac4a('0xbf')](config[_0xac4a('0xc0')],_0xac4a('0xc1'),_0xac4a('0xc2'),_0xac4a('0xc3'));var _0x55ccc3=path['join'](config['root'],'server',_0xac4a('0xc2'),_0xac4a('0xc4'));var _0x17f815=path[_0xac4a('0xbf')](_0x5e5eb1,_0x462964);var _0xa8b5bb=util['format'](_0xac4a('0xc5'),_0x3dd60a[_0xac4a('0xac')]['id'],_0x462964);var _0x5aad90=path[_0xac4a('0xbf')](_0x5e5eb1,_0xa8b5bb);var _0x14b425=[];_0x14b425[_0xac4a('0x32')]({'model':db['User'],'as':_0xac4a('0x6d'),'attributes':['id',_0xac4a('0x2e')],'raw':!![]});_0x14b425[_0xac4a('0x32')]({'model':db[_0xac4a('0xc6')],'as':_0xac4a('0x61'),'attributes':['id',_0xac4a('0xc7'),_0xac4a('0xc8')],'raw':!![]});if(_0x3dd60a[_0xac4a('0x39')][_0xac4a('0xc4')]){_0x14b425['push']({'model':db[_0xac4a('0xc9')],'as':_0xac4a('0xc9'),'raw':!![]});}var _0x579181=[{'model':db[_0xac4a('0xb2')],'as':'Messages','attributes':['id',_0xac4a('0x71'),_0xac4a('0xca'),'direction',_0xac4a('0xcb'),_0xac4a('0x7e')],'include':_0x14b425}];_0x579181[_0xac4a('0x32')]({'model':db[_0xac4a('0xcc')],'as':_0xac4a('0xcd'),'attributes':['id',_0xac4a('0x2b')]});_0x579181[_0xac4a('0x32')]({'model':db[_0xac4a('0x6d')],'as':'Owner','attributes':['id','fullname']});return db[_0xac4a('0x34')]['find']({'where':{'id':_0x3dd60a['params']['id']},'include':_0x579181})[_0xac4a('0x27')](handleEntityNotFound(_0xbe1958,null))[_0xac4a('0x27')](function(_0x3254c3){if(_0x3254c3){var _0x516225=_0x3254c3[_0xac4a('0xce')]({'plain':!![]});fs[_0xac4a('0xcf')](_0x17f815);var _0x5a2abf={'format':'A4','border':'10px','header':{'height':_0xac4a('0xd0'),'contents':{'first':_0xac4a('0xd1')}},'footer':{'height':_0xac4a('0xd2'),'contents':{'default':util[_0xac4a('0xd3')](' \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}} \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',util[_0xac4a('0xd3')](_0xac4a('0xd4'),_0xac4a('0xd5'),_0x516225['id']),moment()['format'](_0xac4a('0xd6'))[_0xac4a('0x91')]())}}};var _0x15b97a={'channel':_0xac4a('0xd5'),'account':_0x516225[_0xac4a('0xcd')]['name'],'agent':_0x516225['Owner']?_0x516225[_0xac4a('0xd7')][_0xac4a('0x2e')]:_0xac4a('0xd8'),'createdAt':moment(_0x516225[_0xac4a('0xca')])[_0xac4a('0xd3')](_0xac4a('0xb6'))[_0xac4a('0x91')](),'closedAt':_0x516225[_0xac4a('0xd9')]?moment(_0x516225[_0xac4a('0xda')])[_0xac4a('0xd3')](_0xac4a('0xb6'))[_0xac4a('0x91')]():'','disposition':_0x516225[_0xac4a('0xdb')],'messages':_(_0x516225['Messages'])[_0xac4a('0x83')]({'secret':![]})['map'](function(_0x4ec2c3){if(_0x4ec2c3[_0xac4a('0xc9')]){var _0x27833a=path[_0xac4a('0xbf')](_0x55ccc3,_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')]);if(fs[_0xac4a('0xdd')](_0x27833a)){fs[_0xac4a('0xde')](_0x27833a)[_0xac4a('0xdf')](fs[_0xac4a('0xe0')](path['join'](_0x17f815,_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')])));}}return{'date':moment(_0x4ec2c3[_0xac4a('0xca')])[_0xac4a('0xd3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x4ec2c3[_0xac4a('0xe1')]===_0xac4a('0xe2')?_0x4ec2c3[_0xac4a('0x6d')]?_0x4ec2c3[_0xac4a('0x6d')][_0xac4a('0x2e')]:_0xac4a('0xe3'):_0x4ec2c3[_0xac4a('0x61')][_0xac4a('0xc7')]+(_0x4ec2c3[_0xac4a('0x61')]['lastName']?'\x20'+_0x4ec2c3[_0xac4a('0x61')][_0xac4a('0xc8')]:''),'body':_0x4ec2c3[_0xac4a('0xc9')]?_0x4ec2c3[_0xac4a('0xc9')][_0xac4a('0xdc')]:_0x4ec2c3[_0xac4a('0x71')],'direction':_0x4ec2c3['direction']==='out'?'A':'C','secret':_0x4ec2c3['secret'],'read':_0x4ec2c3[_0xac4a('0x7e')],'attachment':_0x4ec2c3[_0xac4a('0xc9')]};})['value']()};return ejs['renderFile'](path[_0xac4a('0xbf')](config['root'],_0xac4a('0xc1'),'views',_0xac4a('0xe4')),{'interaction':_0x15b97a})[_0xac4a('0x27')](function(_0x1888c3){return new BPromise(function(_0x4a04c3,_0x14435d){pdf[_0xac4a('0xaf')](_0x1888c3,_0x5a2abf)['toFile'](path[_0xac4a('0xbf')](_0x17f815,_0xac4a('0xe5')+_0x516225['id']+'-'+_0x462964+'.pdf'),function(_0x48a75c,_0x4514a5){if(_0x48a75c)return _0x14435d(_0x48a75c);_0x4a04c3(_0x4514a5);});});})[_0xac4a('0x27')](function(){return new BPromise(function(_0x43df37,_0x45e45b){zipdir(_0x17f815,{'saveTo':_0x5aad90},function(_0x367254,_0x22cc71){if(_0x367254)return _0x45e45b(_0x367254);return _0x43df37(_0x22cc71);});})[_0xac4a('0x27')](function(){return new BPromise(function(_0x1ea4ef,_0x156b67){rimraf(_0x17f815,function(_0x330070){if(_0x330070)_0x156b67(_0x330070);return _0x1ea4ef();});});})[_0xac4a('0x27')](function(){return _0xbe1958[_0xac4a('0xe6')](_0x5aad90,_0xa8b5bb,function(_0x2d755c){if(_0x2d755c){console[_0xac4a('0xe7')](_0xac4a('0xe8'),_0x2d755c);}else{fs[_0xac4a('0xe9')](_0x5aad90);}});});});}else{return _0xbe1958[_0xac4a('0x1c')](0xc8);}})['catch'](handleError(_0xbe1958,null));};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js
index 088fdef..f0f514f 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.events.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc457=['map','findAll','then','unreadMessages','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappInteraction','setMaxListeners','save','getUsers','setDataValue','Users'];(function(_0x1169db,_0x5385cd){var _0x2d04a6=function(_0x14b85d){while(--_0x14b85d){_0x1169db['push'](_0x1169db['shift']());}};_0x2d04a6(++_0x5385cd);}(_0xc457,0xbc));var _0x7c45=function(_0x5ef942,_0x5a8f46){_0x5ef942=_0x5ef942-0x0;var _0x113f1f=_0xc457[_0x5ef942];return _0x113f1f;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x7c45('0x0'))['db'][_0x7c45('0x1')];var WhatsappMessage=require(_0x7c45('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7c45('0x2')](0x0);var events={'afterCreate':_0x7c45('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x32386e){return function(_0x3de364,_0xb2f941,_0x2c499c){_0x3de364[_0x7c45('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x20962d){_0x3de364[_0x7c45('0x5')](_0x7c45('0x6'),_0x20962d[_0x7c45('0x7')](function(_0x43ae95){return{'id':_0x43ae95['id']};}));return WhatsappMessage[_0x7c45('0x8')]({'where':{'WhatsappInteractionId':_0x3de364['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c45('0x9')](function(_0x4cdb76){_0x3de364[_0x7c45('0x5')](_0x7c45('0xa'),_0x4cdb76['length']);WhatsappInteractionEvents[_0x7c45('0xb')](_0x32386e+':'+_0x3de364['id'],_0x3de364);WhatsappInteractionEvents['emit'](_0x32386e,_0x3de364);_0x2c499c(null);})['catch'](_0x2c499c(null));};}for(var e in events){if(events[_0x7c45('0xc')](e)){var event=events[e];WhatsappInteraction[_0x7c45('0xd')](e,emitEvent(event));}}module[_0x7c45('0xe')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xca2b=['findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','remove','getUsers','Users','map'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0xca2b,0x17f));var _0xbca2=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xca2b[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0xbca2('0x0')];var WhatsappMessage=require('../../mysqldb')['db'][_0xbca2('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbca2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbca2('0x3'),'afterDestroy':_0xbca2('0x4')};function emitEvent(_0x46116d){return function(_0xf39871,_0x43ca37,_0x296a7e){_0xf39871[_0xbca2('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x259cfd){_0xf39871['setDataValue'](_0xbca2('0x6'),_0x259cfd[_0xbca2('0x7')](function(_0x446ae1){return{'id':_0x446ae1['id']};}));return WhatsappMessage[_0xbca2('0x8')]({'where':{'WhatsappInteractionId':_0xf39871['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbca2('0x9')](function(_0x2a025f){_0xf39871[_0xbca2('0xa')](_0xbca2('0xb'),_0x2a025f[_0xbca2('0xc')]);WhatsappInteractionEvents['emit'](_0x46116d+':'+_0xf39871['id'],_0xf39871);WhatsappInteractionEvents[_0xbca2('0xd')](_0x46116d,_0xf39871);_0x296a7e(null);})[_0xbca2('0xe')](_0x296a7e(null));};}for(var e in events){if(events[_0xbca2('0xf')](e)){var event=events[e];WhatsappInteraction[_0xbca2('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js
index 1243a55..1ca4b22 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.model.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x13fa8f,_0x195308){var _0x52ebf0=function(_0x11dfde){while(--_0x11dfde){_0x13fa8f['push'](_0x13fa8f['shift']());}};_0x52ebf0(++_0x195308);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});};
\ No newline at end of file
+var _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0xb78471,_0x8b4f76){var _0x9c0f66=function(_0x33f6c0){while(--_0x33f6c0){_0xb78471['push'](_0xb78471['shift']());}};_0x9c0f66(++_0x8b4f76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js
index 7850fca..6b52aa6 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf08=['message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','AddTagsToWhatsappInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x575500,_0x5f06b7){var _0xba27d2=function(_0x32cf55){while(--_0x32cf55){_0x575500['push'](_0x575500['shift']());}};_0xba27d2(++_0x5f06b7);}(_0xcf08,0x11b));var _0x8cf0=function(_0x43b20d,_0x3dbeca){_0x43b20d=_0x43b20d-0x0;var _0x5e3411=_0xcf08[_0x43b20d];return _0x5e3411;};'use strict';var _=require(_0x8cf0('0x0'));var util=require(_0x8cf0('0x1'));var moment=require(_0x8cf0('0x2'));var BPromise=require(_0x8cf0('0x3'));var rs=require(_0x8cf0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cf0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8cf0('0x6'));var config=require(_0x8cf0('0x7'));var jayson=require(_0x8cf0('0x8'));var client=jayson[_0x8cf0('0x9')][_0x8cf0('0xa')]({'port':0x232a});config[_0x8cf0('0xb')]=_[_0x8cf0('0xc')](config[_0x8cf0('0xb')],{'host':_0x8cf0('0xd'),'port':0x18eb});var socket=require(_0x8cf0('0xe'))(new Redis(config[_0x8cf0('0xb')]));require(_0x8cf0('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d5e5f,_0x45f2b4,_0x512d69){return new BPromise(function(_0x355d14,_0x1c212a){return client[_0x8cf0('0x10')](_0x5d5e5f,_0x512d69)[_0x8cf0('0x11')](function(_0x484fbf){logger['info'](_0x8cf0('0x12'),_0x45f2b4,'request\x20sent');logger[_0x8cf0('0x13')](_0x8cf0('0x14'),_0x45f2b4,_0x8cf0('0x15'),JSON[_0x8cf0('0x16')](_0x484fbf));if(_0x484fbf[_0x8cf0('0x17')]){if(_0x484fbf['error'][_0x8cf0('0x18')]===0x1f4){logger[_0x8cf0('0x17')](_0x8cf0('0x12'),_0x45f2b4,_0x484fbf[_0x8cf0('0x17')][_0x8cf0('0x19')]);return _0x1c212a(_0x484fbf[_0x8cf0('0x17')][_0x8cf0('0x19')]);}logger[_0x8cf0('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x45f2b4,_0x484fbf[_0x8cf0('0x17')][_0x8cf0('0x19')]);return _0x355d14(_0x484fbf[_0x8cf0('0x17')][_0x8cf0('0x19')]);}else{logger[_0x8cf0('0x1a')](_0x8cf0('0x12'),_0x45f2b4,_0x8cf0('0x15'));_0x355d14(_0x484fbf[_0x8cf0('0x1b')][_0x8cf0('0x19')]);}})[_0x8cf0('0x1c')](function(_0x1f9155){logger['error'](_0x8cf0('0x12'),_0x45f2b4,_0x1f9155);_0x1c212a(_0x1f9155);});});}exports[_0x8cf0('0x1d')]=function(_0x3b53d4){var _0x55f843=this;return new Promise(function(_0x579185,_0x1234be){return db[_0x8cf0('0x1e')][_0x8cf0('0x1f')](_0x3b53d4[_0x8cf0('0x20')],{'raw':_0x3b53d4[_0x8cf0('0x21')]?_0x3b53d4['options'][_0x8cf0('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b53d4['options']?_0x3b53d4['options'][_0x8cf0('0x23')]||null:null,'attributes':_0x3b53d4[_0x8cf0('0x21')]?_0x3b53d4['options'][_0x8cf0('0x24')]||null:null,'limit':_0x3b53d4[_0x8cf0('0x21')]?_0x3b53d4[_0x8cf0('0x21')]['limit']||null:null})[_0x8cf0('0x11')](function(_0x2fa51f){logger[_0x8cf0('0x1a')](_0x8cf0('0x1d'),_0x3b53d4);logger[_0x8cf0('0x13')](_0x8cf0('0x1d'),_0x3b53d4,JSON['stringify'](_0x2fa51f));_0x579185(_0x2fa51f);})[_0x8cf0('0x1c')](function(_0x292e01){logger[_0x8cf0('0x17')](_0x8cf0('0x1d'),_0x292e01[_0x8cf0('0x19')],_0x3b53d4);_0x1234be(_0x55f843[_0x8cf0('0x17')](0x1f4,_0x292e01[_0x8cf0('0x19')]));});});};exports[_0x8cf0('0x25')]=function(_0x2b3159){return new Promise(function(_0x443b3a,_0x11392d){return db[_0x8cf0('0x1e')][_0x8cf0('0x26')]({'where':_0x2b3159['options']?_0x2b3159['options']['where']||null:null})[_0x8cf0('0x11')](function(_0x3ff79d){if(_0x3ff79d){return _0x3ff79d[_0x8cf0('0x27')](_0x2b3159['body']['ids'],_[_0x8cf0('0x28')](_0x2b3159[_0x8cf0('0x20')],[_0x8cf0('0x29'),'id'])||{});}})[_0x8cf0('0x2a')](function(_0x3ee251){logger[_0x8cf0('0x1a')](_0x8cf0('0x2b'),_0x2b3159);logger[_0x8cf0('0x13')]('AddTags',_0x2b3159,JSON[_0x8cf0('0x16')](_0x3ee251));_0x443b3a(_0x3ee251);})[_0x8cf0('0x1c')](function(_0x3cd721){logger[_0x8cf0('0x17')]('AddTags',_0x3cd721[_0x8cf0('0x19')],_0x2b3159);_0x11392d(_this['error'](0x1f4,_0x3cd721[_0x8cf0('0x19')]));});});};
\ No newline at end of file
+var _0xb6b7=['error','message','request\x20sent','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','addTags','body','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48c388,_0x12e9ff){var _0x5cdc9b=function(_0x5db7f2){while(--_0x5db7f2){_0x48c388['push'](_0x48c388['shift']());}};_0x5cdc9b(++_0x12e9ff);}(_0xb6b7,0x11d));var _0x7b6b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb6b7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7b6b('0x0'));var util=require(_0x7b6b('0x1'));var moment=require(_0x7b6b('0x2'));var BPromise=require(_0x7b6b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b6b('0x4'));var db=require(_0x7b6b('0x5'))['db'];var utils=require(_0x7b6b('0x6'));var logger=require('../../config/logger')(_0x7b6b('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b6b('0x8'));var client=jayson[_0x7b6b('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b6b('0xa')]));require(_0x7b6b('0xb'))[_0x7b6b('0xc')](socket);function respondWithRpcPromise(_0x528040,_0x10bb91,_0x18649){return new BPromise(function(_0x3d835a,_0x2371e1){return client[_0x7b6b('0xd')](_0x528040,_0x18649)[_0x7b6b('0xe')](function(_0x46053b){logger[_0x7b6b('0xf')](_0x7b6b('0x10'),_0x10bb91,'request\x20sent');logger['debug'](_0x7b6b('0x11'),_0x10bb91,'request\x20sent',JSON[_0x7b6b('0x12')](_0x46053b));if(_0x46053b[_0x7b6b('0x13')]){if(_0x46053b[_0x7b6b('0x13')]['code']===0x1f4){logger[_0x7b6b('0x13')](_0x7b6b('0x10'),_0x10bb91,_0x46053b[_0x7b6b('0x13')]['message']);return _0x2371e1(_0x46053b[_0x7b6b('0x13')][_0x7b6b('0x14')]);}logger[_0x7b6b('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x10bb91,_0x46053b[_0x7b6b('0x13')][_0x7b6b('0x14')]);return _0x3d835a(_0x46053b['error'][_0x7b6b('0x14')]);}else{logger[_0x7b6b('0xf')](_0x7b6b('0x10'),_0x10bb91,_0x7b6b('0x15'));_0x3d835a(_0x46053b['result']['message']);}})[_0x7b6b('0x16')](function(_0x4dd6b3){logger[_0x7b6b('0x13')](_0x7b6b('0x10'),_0x10bb91,_0x4dd6b3);_0x2371e1(_0x4dd6b3);});});}exports[_0x7b6b('0x17')]=function(_0x2d1616){var _0xef2fa3=this;return new Promise(function(_0x2379d3,_0x3c370c){return db[_0x7b6b('0x18')][_0x7b6b('0x19')](_0x2d1616['body'],{'raw':_0x2d1616[_0x7b6b('0x1a')]?_0x2d1616[_0x7b6b('0x1a')][_0x7b6b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d1616[_0x7b6b('0x1a')]?_0x2d1616[_0x7b6b('0x1a')][_0x7b6b('0x1c')]||null:null,'attributes':_0x2d1616['options']?_0x2d1616[_0x7b6b('0x1a')][_0x7b6b('0x1d')]||null:null,'limit':_0x2d1616['options']?_0x2d1616[_0x7b6b('0x1a')][_0x7b6b('0x1e')]||null:null})[_0x7b6b('0xe')](function(_0x1db8c4){logger[_0x7b6b('0xf')](_0x7b6b('0x17'),_0x2d1616);logger['debug'](_0x7b6b('0x17'),_0x2d1616,JSON[_0x7b6b('0x12')](_0x1db8c4));_0x2379d3(_0x1db8c4);})[_0x7b6b('0x16')](function(_0x796546){logger[_0x7b6b('0x13')](_0x7b6b('0x17'),_0x796546['message'],_0x2d1616);_0x3c370c(_0xef2fa3[_0x7b6b('0x13')](0x1f4,_0x796546['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x34b7b6){return new Promise(function(_0x51cd19,_0x88ba1c){return db[_0x7b6b('0x18')]['find']({'where':_0x34b7b6['options']?_0x34b7b6['options']['where']||null:null})[_0x7b6b('0xe')](function(_0x568452){if(_0x568452){return _0x568452[_0x7b6b('0x1f')](_0x34b7b6[_0x7b6b('0x20')][_0x7b6b('0x21')],_[_0x7b6b('0x22')](_0x34b7b6[_0x7b6b('0x20')],[_0x7b6b('0x21'),'id'])||{});}})[_0x7b6b('0x23')](function(_0x4b680f){logger[_0x7b6b('0xf')](_0x7b6b('0x24'),_0x34b7b6);logger[_0x7b6b('0x25')](_0x7b6b('0x24'),_0x34b7b6,JSON[_0x7b6b('0x12')](_0x4b680f));_0x51cd19(_0x4b680f);})['catch'](function(_0x5ceee5){logger[_0x7b6b('0x13')](_0x7b6b('0x24'),_0x5ceee5[_0x7b6b('0x14')],_0x34b7b6);_0x88ba1c(_this[_0x7b6b('0x13')](0x1f4,_0x5ceee5[_0x7b6b('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js
index fbfee6a..b10d9cc 100644
--- a/server/api/whatsappInteraction/whatsappInteraction.socket.js
+++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5232=['length','./whatsappInteraction.events','save','update','removeListener','register'];(function(_0x25b5c1,_0x15f706){var _0x15cb0d=function(_0x269d4e){while(--_0x269d4e){_0x25b5c1['push'](_0x25b5c1['shift']());}};_0x15cb0d(++_0x15f706);}(_0x5232,0x9d));var _0x2523=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0x5232[_0x2b0bc2];return _0x56e5b9;};'use strict';var WhatsappInteractionEvents=require(_0x2523('0x0'));var events=[_0x2523('0x1'),'remove',_0x2523('0x2')];function createListener(_0x324f42,_0x37d1ff){return function(_0x75f40b){_0x37d1ff['emit'](_0x324f42,_0x75f40b);};}function removeListener(_0x2d84a9,_0x1700c8){return function(){WhatsappInteractionEvents[_0x2523('0x3')](_0x2d84a9,_0x1700c8);};}exports[_0x2523('0x4')]=function(_0x3e113c){for(var _0x387253=0x0,_0x31541d=events[_0x2523('0x5')];_0x387253<_0x31541d;_0x387253++){var _0xdfa59d=events[_0x387253];var _0x460679=createListener('whatsappInteraction:'+_0xdfa59d,_0x3e113c);WhatsappInteractionEvents['on'](_0xdfa59d,_0x460679);}};
\ No newline at end of file
+var _0x33a8=['emit','removeListener','length','./whatsappInteraction.events','save','remove'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x33a8,0x8d));var _0x833a=function(_0x4b7ff9,_0x28f37f){_0x4b7ff9=_0x4b7ff9-0x0;var _0x36997e=_0x33a8[_0x4b7ff9];return _0x36997e;};'use strict';var WhatsappInteractionEvents=require(_0x833a('0x0'));var events=[_0x833a('0x1'),_0x833a('0x2'),'update'];function createListener(_0x33196c,_0x1db6ae){return function(_0x5f14fe){_0x1db6ae[_0x833a('0x3')](_0x33196c,_0x5f14fe);};}function removeListener(_0x1ba0b8,_0x257aaa){return function(){WhatsappInteractionEvents[_0x833a('0x4')](_0x1ba0b8,_0x257aaa);};}exports['register']=function(_0x70a82b){for(var _0x8412ce=0x0,_0x468335=events[_0x833a('0x5')];_0x8412ce<_0x468335;_0x8412ce++){var _0x456031=events[_0x8412ce];var _0x39e081=createListener('whatsappInteraction:'+_0x456031,_0x70a82b);WhatsappInteractionEvents['on'](_0x456031,_0x39e081);}};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js
index a0d5422..f4197a5 100644
--- a/server/api/whatsappMessage/index.js
+++ b/server/api/whatsappMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xefaa=['put','update','/:id/accept','accept','reject','delete','destroy','util','path','express','get','isAuthenticated','index','describe','/:id','post','tracked','create','/:id/status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefaa,0x1a9));var _0xaefa=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xefaa[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require('multer');var util=require(_0xaefa('0x0'));var path=require(_0xaefa('0x1'));var timeout=require('connect-timeout');var express=require(_0xaefa('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xaefa('0x3')]('/',auth[_0xaefa('0x4')](),controller[_0xaefa('0x5')]);router['get']('/describe',auth[_0xaefa('0x4')](),controller[_0xaefa('0x6')]);router[_0xaefa('0x3')](_0xaefa('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xaefa('0x8')]('/',auth[_0xaefa('0x4')](),interaction[_0xaefa('0x9')]('whatsapp','whatsappmessage:create'),controller[_0xaefa('0xa')]);router[_0xaefa('0x8')](_0xaefa('0xb'),controller['status']);router[_0xaefa('0xc')](_0xaefa('0x7'),auth['isAuthenticated'](),controller[_0xaefa('0xd')]);router[_0xaefa('0xc')](_0xaefa('0xe'),auth[_0xaefa('0x4')](),controller[_0xaefa('0xf')]);router[_0xaefa('0xc')]('/:id/reject',auth[_0xaefa('0x4')](),controller[_0xaefa('0x10')]);router[_0xaefa('0x11')]('/:id',auth[_0xaefa('0x4')](),controller[_0xaefa('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x3835=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','post','whatsapp','/:id/status','status','update','put','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3835,0x1d5));var _0x5383=function(_0x2e87e4,_0x591ef7){_0x2e87e4=_0x2e87e4-0x0;var _0x3c9855=_0x3835[_0x2e87e4];return _0x3c9855;};'use strict';var multer=require(_0x5383('0x0'));var util=require('util');var path=require(_0x5383('0x1'));var timeout=require(_0x5383('0x2'));var express=require(_0x5383('0x3'));var router=express[_0x5383('0x4')]();var auth=require(_0x5383('0x5'));var interaction=require(_0x5383('0x6'));var config=require(_0x5383('0x7'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0x5383('0x8')](),controller[_0x5383('0x9')]);router[_0x5383('0xa')](_0x5383('0xb'),auth['isAuthenticated'](),controller[_0x5383('0xc')]);router[_0x5383('0xa')]('/:id',auth[_0x5383('0x8')](),controller['show']);router[_0x5383('0xd')]('/',auth[_0x5383('0x8')](),interaction['tracked'](_0x5383('0xe'),'whatsappmessage:create'),controller['create']);router[_0x5383('0xd')](_0x5383('0xf'),controller[_0x5383('0x10')]);router['put']('/:id',auth[_0x5383('0x8')](),controller[_0x5383('0x11')]);router[_0x5383('0x12')]('/:id/accept',auth[_0x5383('0x8')](),controller[_0x5383('0x13')]);router[_0x5383('0x12')](_0x5383('0x14'),auth[_0x5383('0x8')](),controller[_0x5383('0x15')]);router[_0x5383('0x16')]('/:id',auth[_0x5383('0x8')](),controller[_0x5383('0x17')]);module[_0x5383('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js
index c70599b..59787f0 100644
--- a/server/api/whatsappMessage/whatsappMessage.attributes.js
+++ b/server/api/whatsappMessage/whatsappMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2631=['out','STRING','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x4403e0,_0x2d0eec){var _0x5b0967=function(_0x526072){while(--_0x526072){_0x4403e0['push'](_0x4403e0['shift']());}};_0x5b0967(++_0x2d0eec);}(_0x2631,0x173));var _0x1263=function(_0x4c5611,_0x4ea142){_0x4c5611=_0x4c5611-0x0;var _0x453fe3=_0x2631[_0x4c5611];return _0x453fe3;};'use strict';var Sequelize=require(_0x1263('0x0'));module[_0x1263('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1263('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1263('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1263('0x4')]('in',_0x1263('0x5')),'defaultValue':_0x1263('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1263('0x6')](0xbe)},'phone':{'type':Sequelize[_0x1263('0x6')]},'readAt':{'type':Sequelize[_0x1263('0x7')]},'secret':{'type':Sequelize[_0x1263('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x063e=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x063e,0x111));var _0xe063=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x063e[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0xe063('0x0'));module[_0xe063('0x1')]={'body':{'type':Sequelize[_0xe063('0x2')](_0xe063('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe063('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe063('0x5')]('in',_0xe063('0x6')),'defaultValue':_0xe063('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe063('0x7')](0xbe)},'phone':{'type':Sequelize[_0xe063('0x7')]},'readAt':{'type':Sequelize[_0xe063('0x8')]},'secret':{'type':Sequelize[_0xe063('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js
index c93a76a..2e68eeb 100644
--- a/server/api/whatsappMessage/whatsappMessage.controller.js
+++ b/server/api/whatsappMessage/whatsappMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde3f=['send','index','WhatsappMessage','rawAttributes','fieldName','model','map','query','intersection','attributes','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','show','params','keys','fields','length','include','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','format','channel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SIP/%s','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','html-pdf','zip-dir','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name'];(function(_0x4bd723,_0x22fb39){var _0x35a23f=function(_0x28b065){while(--_0x28b065){_0x4bd723['push'](_0x4bd723['shift']());}};_0x35a23f(++_0x22fb39);}(_0xde3f,0x1c9));var _0xfde3=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xde3f[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0xfde3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfde3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfde3('0x2'));var Mustache=require(_0xfde3('0x3'));var util=require(_0xfde3('0x4'));var path=require(_0xfde3('0x5'));var sox=require(_0xfde3('0x6'));var csv=require(_0xfde3('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfde3('0x8'));var crypto=require(_0xfde3('0x9'));var jsforce=require(_0xfde3('0xa'));var deskjs=require(_0xfde3('0xb'));var toCsv=require(_0xfde3('0x7'));var querystring=require(_0xfde3('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfde3('0xd'));var hardwareService=require(_0xfde3('0xe'));var logger=require(_0xfde3('0xf'))(_0xfde3('0x10'));var utils=require(_0xfde3('0x11'));var config=require(_0xfde3('0x12'));var db=require(_0xfde3('0x13'))['db'];config[_0xfde3('0x14')]=_[_0xfde3('0x15')](config[_0xfde3('0x14')],{'host':_0xfde3('0x16'),'port':0x18eb});var socket=require(_0xfde3('0x17'))(new Redis(config[_0xfde3('0x14')]));require(_0xfde3('0x18'))[_0xfde3('0x19')](socket);var jayson=require(_0xfde3('0x1a'));var client=jayson['client'][_0xfde3('0x1b')]({'port':0x232c});var client9002=jayson[_0xfde3('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x4bce8b,_0x51b544,_0x2edbe9){if(_0x2edbe9){var _0x121960=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x121960[_0xfde3('0x1d')](_0x51b544)){return _0x4bce8b;}else{throw new db[(_0xfde3('0x1e'))]['ValidationError'](_0xfde3('0x1f'));}}else{return _0x4bce8b;}}function respondWithRpcPromise(_0x59f6db,_0x201baf,_0x2a3543,_0x99a214){return new BPromise(function(_0x394e3f,_0x1d97de){var _0x1b8bd0=_0x99a214||client;return _0x1b8bd0[_0xfde3('0x20')](_0x59f6db,_0x2a3543)['then'](function(_0x18a0c8){logger['info'](_0xfde3('0x21'),_0x201baf,_0xfde3('0x22'));logger[_0xfde3('0x23')](_0xfde3('0x24'),_0x201baf,'request\x20sent',JSON[_0xfde3('0x25')](_0x18a0c8));if(_0x18a0c8['error']){if(_0x18a0c8[_0xfde3('0x26')]['code']===0x1f4){logger[_0xfde3('0x26')](_0xfde3('0x21'),_0x201baf,_0x18a0c8[_0xfde3('0x26')][_0xfde3('0x27')]);return _0x1d97de(_0x18a0c8[_0xfde3('0x26')][_0xfde3('0x27')]);}logger['error'](_0xfde3('0x21'),_0x201baf,_0x18a0c8['error'][_0xfde3('0x27')]);return _0x394e3f(_0x18a0c8[_0xfde3('0x26')][_0xfde3('0x27')]);}else{logger[_0xfde3('0x28')](_0xfde3('0x21'),_0x201baf,_0xfde3('0x22'));_0x394e3f(_0x18a0c8[_0xfde3('0x29')]['message']);}})[_0xfde3('0x2a')](function(_0xadf6b8){logger['error'](_0xfde3('0x21'),_0x201baf,_0xadf6b8);_0x1d97de(_0xadf6b8);});});}function respondWithStatusCode(_0x5d6fda,_0x25eb14){_0x25eb14=_0x25eb14||0xcc;return function(_0x227cd5){if(_0x227cd5){return _0x5d6fda[_0xfde3('0x2b')](_0x25eb14);}return _0x5d6fda[_0xfde3('0x2c')](_0x25eb14)[_0xfde3('0x2d')]();};}function respondWithResult(_0x41ba9c,_0xc208e9){_0xc208e9=_0xc208e9||0xc8;return function(_0x5516d6){if(_0x5516d6){return _0x41ba9c['status'](_0xc208e9)['json'](_0x5516d6);}};}function respondWithFilteredResult(_0x1130ce,_0x281df0){return function(_0x5376df){if(_0x5376df){var _0x4d13f0=_0x5376df['count'],_0x3a0666=_0x281df0[_0xfde3('0x2e')],_0xe3fde=_0x281df0['offset']+_0x281df0[_0xfde3('0x2f')],_0xed43fe;if(_0xe3fde>=_0x4d13f0){_0xe3fde=_0x4d13f0;_0xed43fe=0xc8;}else{_0xed43fe=0xce;}_0x1130ce[_0xfde3('0x2c')](_0xed43fe);return _0x1130ce[_0xfde3('0x30')](_0xfde3('0x31'),_0x3a0666+'-'+_0xe3fde+'/'+_0x4d13f0)[_0xfde3('0x32')](_0x5376df);}return null;};}function patchUpdates(_0x331d2f){return function(_0x4171b7){try{jsonpatch[_0xfde3('0x33')](_0x4171b7,_0x331d2f,!![]);}catch(_0x3d1568){return BPromise[_0xfde3('0x34')](_0x3d1568);}return _0x4171b7[_0xfde3('0x35')]();};}function saveUpdates(_0x58cdcd,_0x5170f4){return function(_0x4e7571){if(_0x4e7571){return _0x4e7571[_0xfde3('0x36')](_0x58cdcd)[_0xfde3('0x37')](function(_0x4d6292){return _0x4d6292;});}return null;};}function removeEntity(_0x2e51ba,_0x51406d){return function(_0x2f988a){if(_0x2f988a){return _0x2f988a[_0xfde3('0x38')]()[_0xfde3('0x37')](function(){_0x2e51ba[_0xfde3('0x2c')](0xcc)[_0xfde3('0x2d')]();});}};}function handleEntityNotFound(_0x528dbd,_0x546b66){return function(_0x1bdb43){if(!_0x1bdb43){_0x528dbd[_0xfde3('0x2b')](0x194);}return _0x1bdb43;};}function handleError(_0x1bbb67,_0x4d0bc5){_0x4d0bc5=_0x4d0bc5||0x1f4;return function(_0x460f75){logger['error'](_0x460f75[_0xfde3('0x39')]);if(_0x460f75[_0xfde3('0x3a')]){delete _0x460f75[_0xfde3('0x3a')];}_0x1bbb67[_0xfde3('0x2c')](_0x4d0bc5)[_0xfde3('0x3b')](_0x460f75);};}exports[_0xfde3('0x3c')]=function(_0x17b070,_0x30c473){var _0x1082bb={},_0x2feced={},_0x30074c={'count':0x0,'rows':[]};var _0x2d2100=_['map'](db[_0xfde3('0x3d')][_0xfde3('0x3e')],function(_0x438d46){return{'name':_0x438d46[_0xfde3('0x3f')],'type':_0x438d46['type']['key']};});_0x2feced[_0xfde3('0x40')]=_[_0xfde3('0x41')](_0x2d2100,_0xfde3('0x3a'));_0x2feced[_0xfde3('0x42')]=_['keys'](_0x17b070['query']);_0x2feced['filters']=_[_0xfde3('0x43')](_0x2feced['model'],_0x2feced[_0xfde3('0x42')]);_0x1082bb['attributes']=_['intersection'](_0x2feced[_0xfde3('0x40')],qs['fields'](_0x17b070[_0xfde3('0x42')]['fields']));_0x1082bb[_0xfde3('0x44')]=_0x1082bb[_0xfde3('0x44')]['length']?_0x1082bb[_0xfde3('0x44')]:_0x2feced[_0xfde3('0x40')];if(!_0x17b070[_0xfde3('0x42')]['hasOwnProperty'](_0xfde3('0x45'))){_0x1082bb[_0xfde3('0x2f')]=qs[_0xfde3('0x2f')](_0x17b070[_0xfde3('0x42')][_0xfde3('0x2f')]);_0x1082bb[_0xfde3('0x2e')]=qs[_0xfde3('0x2e')](_0x17b070[_0xfde3('0x42')][_0xfde3('0x2e')]);}_0x1082bb['order']=qs['sort'](_0x17b070[_0xfde3('0x42')][_0xfde3('0x46')]);_0x1082bb[_0xfde3('0x47')]=qs[_0xfde3('0x48')](_[_0xfde3('0x49')](_0x17b070[_0xfde3('0x42')],_0x2feced[_0xfde3('0x48')]),_0x2d2100);if(_0x17b070['query'][_0xfde3('0x4a')]){_0x1082bb['where']=_[_0xfde3('0x4b')](_0x1082bb[_0xfde3('0x47')],{'$or':_[_0xfde3('0x41')](_0x2d2100,function(_0x5b1783){if(_0x5b1783[_0xfde3('0x4c')]!==_0xfde3('0x4d')){var _0x1320bb={};_0x1320bb[_0x5b1783[_0xfde3('0x3a')]]={'$like':'%'+_0x17b070[_0xfde3('0x42')][_0xfde3('0x4a')]+'%'};return _0x1320bb;}})});}_0x1082bb=_[_0xfde3('0x4b')]({},_0x1082bb,_0x17b070[_0xfde3('0x4e')]);var _0x4116a0={'where':_0x1082bb[_0xfde3('0x47')]};return db[_0xfde3('0x3d')][_0xfde3('0x4f')](_0x4116a0)[_0xfde3('0x37')](function(_0x35cf08){_0x30074c['count']=_0x35cf08;if(_0x17b070[_0xfde3('0x42')][_0xfde3('0x50')]){_0x1082bb['include']=[{'all':!![]}];}return db[_0xfde3('0x3d')][_0xfde3('0x51')](_0x1082bb);})[_0xfde3('0x37')](function(_0x4eaa09){_0x30074c['rows']=_0x4eaa09;return _0x30074c;})[_0xfde3('0x37')](respondWithFilteredResult(_0x30c473,_0x1082bb))[_0xfde3('0x2a')](handleError(_0x30c473,null));};exports[_0xfde3('0x52')]=function(_0x2a0214,_0x2c2f88){var _0x10b7fa={'raw':!![],'where':{'id':_0x2a0214[_0xfde3('0x53')]['id']}},_0x2f9a3b={};_0x2f9a3b[_0xfde3('0x40')]=_[_0xfde3('0x54')](db['WhatsappMessage']['rawAttributes']);_0x2f9a3b[_0xfde3('0x42')]=_['keys'](_0x2a0214[_0xfde3('0x42')]);_0x2f9a3b['filters']=_[_0xfde3('0x43')](_0x2f9a3b[_0xfde3('0x40')],_0x2f9a3b[_0xfde3('0x42')]);_0x10b7fa[_0xfde3('0x44')]=_['intersection'](_0x2f9a3b[_0xfde3('0x40')],qs[_0xfde3('0x55')](_0x2a0214[_0xfde3('0x42')][_0xfde3('0x55')]));_0x10b7fa[_0xfde3('0x44')]=_0x10b7fa['attributes'][_0xfde3('0x56')]?_0x10b7fa[_0xfde3('0x44')]:_0x2f9a3b['model'];if(_0x2a0214['query'][_0xfde3('0x50')]){_0x10b7fa[_0xfde3('0x57')]=[{'all':!![]}];}_0x10b7fa=_[_0xfde3('0x4b')]({},_0x10b7fa,_0x2a0214[_0xfde3('0x4e')]);return db['WhatsappMessage'][_0xfde3('0x58')](_0x10b7fa)[_0xfde3('0x37')](handleEntityNotFound(_0x2c2f88,null))[_0xfde3('0x37')](respondWithResult(_0x2c2f88,null))[_0xfde3('0x2a')](handleError(_0x2c2f88,null));};exports[_0xfde3('0x59')]=function(_0x330e19,_0x54d34e){return db['WhatsappMessage'][_0xfde3('0x59')](_0x330e19['body'],{})['then'](respondWithResult(_0x54d34e,0xc9))[_0xfde3('0x2a')](handleError(_0x54d34e,null));};exports[_0xfde3('0x36')]=function(_0xd89b77,_0x55f324){if(_0xd89b77[_0xfde3('0x5a')]['id']){delete _0xd89b77[_0xfde3('0x5a')]['id'];}return db['WhatsappMessage'][_0xfde3('0x58')]({'where':{'id':_0xd89b77[_0xfde3('0x53')]['id']}})[_0xfde3('0x37')](handleEntityNotFound(_0x55f324,null))[_0xfde3('0x37')](saveUpdates(_0xd89b77[_0xfde3('0x5a')],null))[_0xfde3('0x37')](respondWithResult(_0x55f324,null))[_0xfde3('0x2a')](handleError(_0x55f324,null));};exports[_0xfde3('0x38')]=function(_0x5af07b,_0xeaa925){return db[_0xfde3('0x3d')][_0xfde3('0x58')]({'where':{'id':_0x5af07b[_0xfde3('0x53')]['id']}})[_0xfde3('0x37')](handleEntityNotFound(_0xeaa925,null))['then'](removeEntity(_0xeaa925,null))['catch'](handleError(_0xeaa925,null));};exports[_0xfde3('0x5b')]=function(_0xc36fd6,_0x373d5f){return db['WhatsappMessage'][_0xfde3('0x5b')]()[_0xfde3('0x37')](respondWithResult(_0x373d5f,null))['catch'](handleError(_0x373d5f,null));};var interaction_log=require('../../config/logger')(_0xfde3('0x5c'));exports[_0xfde3('0x5d')]=function(_0x42b3f6,_0x1650bb,_0xe3b429){var _0x4a4261={'channel':_0xfde3('0x5e')};if(_0x42b3f6[_0xfde3('0x5a')]['id']){delete _0x42b3f6[_0xfde3('0x5a')]['id'];}_0x42b3f6['body'][_0xfde3('0x5f')]=!![];_0x42b3f6[_0xfde3('0x5a')][_0xfde3('0x60')]=moment()['format'](_0xfde3('0x61'));_0x42b3f6[_0xfde3('0x5a')]['UserId']=_0x42b3f6[_0xfde3('0x5a')][_0xfde3('0x62')]||_0x42b3f6[_0xfde3('0x63')]['id'];return db['WhatsappMessage'][_0xfde3('0x58')]({'where':{'id':_0x42b3f6['params']['id'],'UserId':null},'include':[{'model':db[_0xfde3('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x1650bb,null))['then'](saveUpdates(_0x42b3f6['body'],null))[_0xfde3('0x37')](function(_0x1121d7){if(_0x1121d7){_0x4a4261[_0xfde3('0x27')]=_0x1121d7[_0xfde3('0x65')]({'plain':!![]});return db[_0xfde3('0x66')][_0xfde3('0x58')]({'where':{'id':_0x1121d7[_0xfde3('0x67')]}});}return null;})[_0xfde3('0x37')](handleEntityNotFound(_0x1650bb,null))[_0xfde3('0x37')](function(_0xa38730){if(_0xa38730){return _0xa38730['update']({'UserId':_0x42b3f6[_0xfde3('0x5a')]['UserId'],'read1stAt':_[_0xfde3('0x68')](_0xa38730[_0xfde3('0x69')])?moment()['format'](_0xfde3('0x61')):undefined});}return null;})['then'](function(_0x584028){if(_0x584028){_0x4a4261[_0xfde3('0x6a')]=_0x584028[_0xfde3('0x65')]({'plain':!![]});interaction_log[_0xfde3('0x28')](_0xfde3('0x6b'),_0x42b3f6[_0xfde3('0x63')]['id'],_0x42b3f6[_0xfde3('0x63')][_0xfde3('0x3a')],_0x42b3f6[_0xfde3('0x63')][_0xfde3('0x6c')],_0x4a4261[_0xfde3('0x6a')]['id'],_0x42b3f6[_0xfde3('0x5a')]?JSON[_0xfde3('0x25')](_0x42b3f6[_0xfde3('0x5a')]):_0xfde3('0x6d'));return respondWithRpcPromise(_0xfde3('0x6e'),'acceptMessage',_0x4a4261);}return null;})['then'](function(_0x17ff97){if(_0x17ff97){if(_0x42b3f6[_0xfde3('0x5a')][_0xfde3('0x6f')]){_0x4a4261[_0xfde3('0x27')][_0xfde3('0x70')]=util[_0xfde3('0x71')]('SIP/%s',_0x42b3f6['user']['name']);_0x4a4261['message'][_0xfde3('0x72')]=_0x4a4261['channel'];_0x4a4261[_0xfde3('0x27')][_0xfde3('0x73')]=_0xfde3('0x5d');return respondWithRpcPromise(_0xfde3('0x74'),_0xfde3('0x74'),{'event':'acceptmessage','message':_0x4a4261[_0xfde3('0x27')]},client9002)['then'](function(){return _0x4a4261;});}return _0x4a4261;}return null;})[_0xfde3('0x37')](respondWithResult(_0x1650bb,null))['catch'](handleError(_0x1650bb,null));};var interaction_log=require(_0xfde3('0xf'))(_0xfde3('0x5c'));exports[_0xfde3('0x34')]=function(_0x52a39b,_0x35f25a,_0x425b74){var _0xc5c138={'agent':{},'channel':_0xfde3('0x5e')};if(_0x52a39b[_0xfde3('0x5a')]['id']){delete _0x52a39b[_0xfde3('0x5a')]['id'];}_0x52a39b['body'][_0xfde3('0x62')]=_0x52a39b[_0xfde3('0x5a')]['UserId']||_0x52a39b[_0xfde3('0x63')]['id'];_0xc5c138['agent']['id']=_0x52a39b['body']['UserId'];return db[_0xfde3('0x3d')]['find']({'where':{'id':_0x52a39b[_0xfde3('0x53')]['id'],'UserId':null}})[_0xfde3('0x37')](handleEntityNotFound(_0x35f25a,null))['then'](function(_0x4f7e24){if(_0x4f7e24){_0xc5c138[_0xfde3('0x27')]=_0x4f7e24[_0xfde3('0x65')]({'plain':!![]});return db['WhatsappInteraction'][_0xfde3('0x58')]({'where':{'id':_0x4f7e24[_0xfde3('0x67')]}});}return null;})[_0xfde3('0x37')](handleEntityNotFound(_0x35f25a,null))[_0xfde3('0x37')](function(_0x34ffe1){if(_0x34ffe1){_0xc5c138[_0xfde3('0x6a')]=_0x34ffe1[_0xfde3('0x65')]({'plain':!![]});interaction_log['info'](_0xfde3('0x75'),_0x52a39b[_0xfde3('0x63')]['id'],_0x52a39b[_0xfde3('0x63')]['name'],_0x52a39b[_0xfde3('0x63')][_0xfde3('0x6c')],_0xc5c138[_0xfde3('0x6a')]['id'],_0x52a39b[_0xfde3('0x5a')]?JSON[_0xfde3('0x25')](_0x52a39b[_0xfde3('0x5a')]):_0xfde3('0x6d'));return respondWithRpcPromise('RejectMessage',_0xfde3('0x76'),_0xc5c138);}return null;})[_0xfde3('0x37')](function(_0x133c89){if(_0x133c89){_0x133c89['message'][_0xfde3('0x70')]=util['format'](_0xfde3('0x77'),_0x52a39b[_0xfde3('0x63')]['name']);_0x133c89[_0xfde3('0x27')][_0xfde3('0x72')]=_0xc5c138[_0xfde3('0x72')];_0x133c89[_0xfde3('0x27')][_0xfde3('0x73')]=_0xfde3('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':_0xfde3('0x78'),'message':_0x133c89[_0xfde3('0x27')]},client9002);return _0xc5c138;}return null;})[_0xfde3('0x37')](respondWithResult(_0x35f25a,null))[_0xfde3('0x2a')](handleError(_0x35f25a,null));};exports[_0xfde3('0x2c')]=function(_0x3ef14b,_0x49205e,_0x568b35){if(_0x3ef14b[_0xfde3('0x5a')]['id']){delete _0x3ef14b[_0xfde3('0x5a')]['id'];}var _0x2574c;return db['WhatsappMessage'][_0xfde3('0x58')]({'where':{'id':_0x3ef14b[_0xfde3('0x53')]['id']}})['then'](handleEntityNotFound(_0x49205e,null))['then'](function(_0x59ba75){if(_0x59ba75){_0x2574c=_0x59ba75;return db[_0xfde3('0x79')]['find']({'where':{'id':_0x59ba75['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x49205e,null))[_0xfde3('0x37')](function(_0x49f566){if(_0x49f566){logger[_0xfde3('0x23')](_0xfde3('0x7a'),'status',_0xfde3('0x7b'),_0x49f566['type'],util['inspect'](_0x3ef14b[_0xfde3('0x5a')],{'showHidden':![],'depth':null}));switch(_0x49f566[_0xfde3('0x4c')]){case _0xfde3('0x7c'):if(_0x3ef14b[_0xfde3('0x5a')][_0xfde3('0x7d')]&&_0x3ef14b['body'][_0xfde3('0x7d')]===_0x2574c['messageId']&&_0x3ef14b[_0xfde3('0x5a')][_0xfde3('0x7e')]&&_0x3ef14b[_0xfde3('0x5a')][_0xfde3('0x7e')]===_0xfde3('0x5f')){return _0x2574c[_0xfde3('0x36')]({'read':!![]});}else{logger[_0xfde3('0x26')](_0xfde3('0x7f'),_0xfde3('0x2c'),'twilio',util[_0xfde3('0x80')](_0x3ef14b[_0xfde3('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x2574c;}})[_0xfde3('0x37')](respondWithResult(_0x49205e,null))[_0xfde3('0x2a')](handleError(_0x49205e,null));};
\ No newline at end of file
+var _0x4739=['where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','destroy','describe','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','WhatsappInteraction','update','isNil','interaction','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','whatsapp-interactions','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','WhatsappAccount','WhatsappAccountId','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','count','offset','limit','set','Content-Range','reject','save','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','pick'];(function(_0x14f7fe,_0x5132c4){var _0x3d8309=function(_0x22f5c7){while(--_0x22f5c7){_0x14f7fe['push'](_0x14f7fe['shift']());}};_0x3d8309(++_0x5132c4);}(_0x4739,0x13d));var _0x9473=function(_0x5dccda,_0xb427ea){_0x5dccda=_0x5dccda-0x0;var _0x557d91=_0x4739[_0x5dccda];return _0x557d91;};'use strict';var pdf=require(_0x9473('0x0'));var emlformat=require(_0x9473('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9473('0x2'));var rp=require(_0x9473('0x3'));var moment=require(_0x9473('0x4'));var BPromise=require(_0x9473('0x5'));var Mustache=require('mustache');var util=require(_0x9473('0x6'));var path=require(_0x9473('0x7'));var sox=require(_0x9473('0x8'));var csv=require(_0x9473('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9473('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9473('0xb'));var deskjs=require(_0x9473('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9473('0xd'));var Papa=require('papaparse');var Redis=require(_0x9473('0xe'));var authService=require(_0x9473('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9473('0x10'));var logger=require(_0x9473('0x11'))(_0x9473('0x12'));var utils=require(_0x9473('0x13'));var config=require(_0x9473('0x14'));var db=require(_0x9473('0x15'))['db'];config[_0x9473('0x16')]=_[_0x9473('0x17')](config['redis'],{'host':_0x9473('0x18'),'port':0x18eb});var socket=require(_0x9473('0x19'))(new Redis(config[_0x9473('0x16')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x9473('0x1a'));var client=jayson[_0x9473('0x1b')][_0x9473('0x1c')]({'port':0x232c});var client9002=jayson[_0x9473('0x1b')][_0x9473('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3691e9,_0x38830a,_0x351afd){if(_0x351afd){var _0x11162a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11162a[_0x9473('0x1d')](_0x38830a)){return _0x3691e9;}else{throw new db['Sequelize'][(_0x9473('0x1e'))](_0x9473('0x1f'));}}else{return _0x3691e9;}}function respondWithRpcPromise(_0xcfbdf1,_0x23fadd,_0x37a710,_0x2a8d19){return new BPromise(function(_0x55cf7b,_0xc96b15){var _0x498d7a=_0x2a8d19||client;return _0x498d7a['request'](_0xcfbdf1,_0x37a710)[_0x9473('0x20')](function(_0x3e4091){logger[_0x9473('0x21')](_0x9473('0x22'),_0x23fadd,_0x9473('0x23'));logger[_0x9473('0x24')](_0x9473('0x25'),_0x23fadd,_0x9473('0x23'),JSON[_0x9473('0x26')](_0x3e4091));if(_0x3e4091[_0x9473('0x27')]){if(_0x3e4091['error']['code']===0x1f4){logger[_0x9473('0x27')](_0x9473('0x22'),_0x23fadd,_0x3e4091[_0x9473('0x27')][_0x9473('0x28')]);return _0xc96b15(_0x3e4091[_0x9473('0x27')][_0x9473('0x28')]);}logger['error'](_0x9473('0x22'),_0x23fadd,_0x3e4091[_0x9473('0x27')][_0x9473('0x28')]);return _0x55cf7b(_0x3e4091[_0x9473('0x27')][_0x9473('0x28')]);}else{logger[_0x9473('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x23fadd,'request\x20sent');_0x55cf7b(_0x3e4091[_0x9473('0x29')][_0x9473('0x28')]);}})['catch'](function(_0x3b20c7){logger[_0x9473('0x27')](_0x9473('0x22'),_0x23fadd,_0x3b20c7);_0xc96b15(_0x3b20c7);});});}function respondWithStatusCode(_0x225b8a,_0x4f403e){_0x4f403e=_0x4f403e||0xcc;return function(_0x5d02ca){if(_0x5d02ca){return _0x225b8a['sendStatus'](_0x4f403e);}return _0x225b8a[_0x9473('0x2a')](_0x4f403e)[_0x9473('0x2b')]();};}function respondWithResult(_0x65bdb1,_0xa6b960){_0xa6b960=_0xa6b960||0xc8;return function(_0x17f93d){if(_0x17f93d){return _0x65bdb1[_0x9473('0x2a')](_0xa6b960)[_0x9473('0x2c')](_0x17f93d);}};}function respondWithFilteredResult(_0x249448,_0x3d68e7){return function(_0x56aa24){if(_0x56aa24){var _0x1e7274=_0x56aa24[_0x9473('0x2d')],_0x55589b=_0x3d68e7['offset'],_0x471411=_0x3d68e7[_0x9473('0x2e')]+_0x3d68e7[_0x9473('0x2f')],_0x2c3300;if(_0x471411>=_0x1e7274){_0x471411=_0x1e7274;_0x2c3300=0xc8;}else{_0x2c3300=0xce;}_0x249448[_0x9473('0x2a')](_0x2c3300);return _0x249448[_0x9473('0x30')](_0x9473('0x31'),_0x55589b+'-'+_0x471411+'/'+_0x1e7274)[_0x9473('0x2c')](_0x56aa24);}return null;};}function patchUpdates(_0x5439f1){return function(_0x174eda){try{jsonpatch['apply'](_0x174eda,_0x5439f1,!![]);}catch(_0x32e05f){return BPromise[_0x9473('0x32')](_0x32e05f);}return _0x174eda[_0x9473('0x33')]();};}function saveUpdates(_0x4211f4,_0x3fb4a4){return function(_0x1cd31f){if(_0x1cd31f){return _0x1cd31f['update'](_0x4211f4)[_0x9473('0x20')](function(_0x256e6c){return _0x256e6c;});}return null;};}function removeEntity(_0x310ba9,_0x46684f){return function(_0x58bed4){if(_0x58bed4){return _0x58bed4['destroy']()[_0x9473('0x20')](function(){_0x310ba9['status'](0xcc)[_0x9473('0x2b')]();});}};}function handleEntityNotFound(_0x34d96a,_0xcc555b){return function(_0x3a8aaf){if(!_0x3a8aaf){_0x34d96a['sendStatus'](0x194);}return _0x3a8aaf;};}function handleError(_0x5db05f,_0x17bb6f){_0x17bb6f=_0x17bb6f||0x1f4;return function(_0x2b825c){logger[_0x9473('0x27')](_0x2b825c[_0x9473('0x34')]);if(_0x2b825c[_0x9473('0x35')]){delete _0x2b825c['name'];}_0x5db05f['status'](_0x17bb6f)[_0x9473('0x36')](_0x2b825c);};}exports[_0x9473('0x37')]=function(_0x57bb64,_0x1fc107){var _0x3bb052={},_0x34e15b={},_0x5bea20={'count':0x0,'rows':[]};var _0x5eb36e=_[_0x9473('0x38')](db[_0x9473('0x39')][_0x9473('0x3a')],function(_0x552ef4){return{'name':_0x552ef4[_0x9473('0x3b')],'type':_0x552ef4[_0x9473('0x3c')][_0x9473('0x3d')]};});_0x34e15b[_0x9473('0x3e')]=_[_0x9473('0x38')](_0x5eb36e,_0x9473('0x35'));_0x34e15b[_0x9473('0x3f')]=_[_0x9473('0x40')](_0x57bb64[_0x9473('0x3f')]);_0x34e15b[_0x9473('0x41')]=_[_0x9473('0x42')](_0x34e15b[_0x9473('0x3e')],_0x34e15b[_0x9473('0x3f')]);_0x3bb052[_0x9473('0x43')]=_[_0x9473('0x42')](_0x34e15b[_0x9473('0x3e')],qs['fields'](_0x57bb64['query']['fields']));_0x3bb052[_0x9473('0x43')]=_0x3bb052[_0x9473('0x43')][_0x9473('0x44')]?_0x3bb052['attributes']:_0x34e15b['model'];if(!_0x57bb64[_0x9473('0x3f')][_0x9473('0x45')](_0x9473('0x46'))){_0x3bb052[_0x9473('0x2f')]=qs['limit'](_0x57bb64['query'][_0x9473('0x2f')]);_0x3bb052[_0x9473('0x2e')]=qs[_0x9473('0x2e')](_0x57bb64[_0x9473('0x3f')][_0x9473('0x2e')]);}_0x3bb052[_0x9473('0x47')]=qs['sort'](_0x57bb64[_0x9473('0x3f')]['sort']);_0x3bb052['where']=qs[_0x9473('0x41')](_[_0x9473('0x48')](_0x57bb64[_0x9473('0x3f')],_0x34e15b[_0x9473('0x41')]),_0x5eb36e);if(_0x57bb64[_0x9473('0x3f')]['filter']){_0x3bb052[_0x9473('0x49')]=_[_0x9473('0x4a')](_0x3bb052['where'],{'$or':_[_0x9473('0x38')](_0x5eb36e,function(_0x4d9bf4){if(_0x4d9bf4['type']!==_0x9473('0x4b')){var _0x50a60b={};_0x50a60b[_0x4d9bf4[_0x9473('0x35')]]={'$like':'%'+_0x57bb64[_0x9473('0x3f')][_0x9473('0x4c')]+'%'};return _0x50a60b;}})});}_0x3bb052=_[_0x9473('0x4a')]({},_0x3bb052,_0x57bb64[_0x9473('0x4d')]);var _0x1970fc={'where':_0x3bb052['where']};return db[_0x9473('0x39')][_0x9473('0x2d')](_0x1970fc)[_0x9473('0x20')](function(_0x17a43b){_0x5bea20[_0x9473('0x2d')]=_0x17a43b;if(_0x57bb64['query']['includeAll']){_0x3bb052[_0x9473('0x4e')]=[{'all':!![]}];}return db[_0x9473('0x39')][_0x9473('0x4f')](_0x3bb052);})[_0x9473('0x20')](function(_0x4b2c30){_0x5bea20[_0x9473('0x50')]=_0x4b2c30;return _0x5bea20;})[_0x9473('0x20')](respondWithFilteredResult(_0x1fc107,_0x3bb052))[_0x9473('0x51')](handleError(_0x1fc107,null));};exports[_0x9473('0x52')]=function(_0x3c6f70,_0x4db56e){var _0x2f45a6={'raw':!![],'where':{'id':_0x3c6f70[_0x9473('0x53')]['id']}},_0x53b993={};_0x53b993['model']=_[_0x9473('0x40')](db[_0x9473('0x39')][_0x9473('0x3a')]);_0x53b993[_0x9473('0x3f')]=_[_0x9473('0x40')](_0x3c6f70[_0x9473('0x3f')]);_0x53b993[_0x9473('0x41')]=_[_0x9473('0x42')](_0x53b993['model'],_0x53b993[_0x9473('0x3f')]);_0x2f45a6[_0x9473('0x43')]=_[_0x9473('0x42')](_0x53b993[_0x9473('0x3e')],qs[_0x9473('0x54')](_0x3c6f70['query'][_0x9473('0x54')]));_0x2f45a6[_0x9473('0x43')]=_0x2f45a6[_0x9473('0x43')][_0x9473('0x44')]?_0x2f45a6[_0x9473('0x43')]:_0x53b993[_0x9473('0x3e')];if(_0x3c6f70[_0x9473('0x3f')][_0x9473('0x55')]){_0x2f45a6['include']=[{'all':!![]}];}_0x2f45a6=_[_0x9473('0x4a')]({},_0x2f45a6,_0x3c6f70['options']);return db[_0x9473('0x39')][_0x9473('0x56')](_0x2f45a6)[_0x9473('0x20')](handleEntityNotFound(_0x4db56e,null))[_0x9473('0x20')](respondWithResult(_0x4db56e,null))[_0x9473('0x51')](handleError(_0x4db56e,null));};exports[_0x9473('0x57')]=function(_0x2ecbf5,_0x273c34){return db['WhatsappMessage'][_0x9473('0x57')](_0x2ecbf5['body'],{})[_0x9473('0x20')](respondWithResult(_0x273c34,0xc9))[_0x9473('0x51')](handleError(_0x273c34,null));};exports['update']=function(_0x1beda1,_0x222da3){if(_0x1beda1[_0x9473('0x58')]['id']){delete _0x1beda1[_0x9473('0x58')]['id'];}return db['WhatsappMessage'][_0x9473('0x56')]({'where':{'id':_0x1beda1[_0x9473('0x53')]['id']}})[_0x9473('0x20')](handleEntityNotFound(_0x222da3,null))[_0x9473('0x20')](saveUpdates(_0x1beda1[_0x9473('0x58')],null))[_0x9473('0x20')](respondWithResult(_0x222da3,null))[_0x9473('0x51')](handleError(_0x222da3,null));};exports[_0x9473('0x59')]=function(_0xbd98f7,_0x24990c){return db[_0x9473('0x39')][_0x9473('0x56')]({'where':{'id':_0xbd98f7[_0x9473('0x53')]['id']}})[_0x9473('0x20')](handleEntityNotFound(_0x24990c,null))[_0x9473('0x20')](removeEntity(_0x24990c,null))[_0x9473('0x51')](handleError(_0x24990c,null));};exports[_0x9473('0x5a')]=function(_0x36f8f0,_0x299807){return db['WhatsappMessage'][_0x9473('0x5a')]()[_0x9473('0x20')](respondWithResult(_0x299807,null))[_0x9473('0x51')](handleError(_0x299807,null));};var interaction_log=require(_0x9473('0x11'))('whatsapp-interactions');exports[_0x9473('0x5b')]=function(_0x19eb3a,_0x3b1c66,_0x18770c){var _0x98978f={'channel':_0x9473('0x5c')};if(_0x19eb3a['body']['id']){delete _0x19eb3a['body']['id'];}_0x19eb3a[_0x9473('0x58')][_0x9473('0x5d')]=!![];_0x19eb3a['body'][_0x9473('0x5e')]=moment()[_0x9473('0x5f')](_0x9473('0x60'));_0x19eb3a[_0x9473('0x58')][_0x9473('0x61')]=_0x19eb3a[_0x9473('0x58')][_0x9473('0x61')]||_0x19eb3a[_0x9473('0x62')]['id'];return db[_0x9473('0x39')]['find']({'where':{'id':_0x19eb3a['params']['id'],'UserId':null},'include':[{'model':db[_0x9473('0x63')],'as':'Contact'}]})[_0x9473('0x20')](handleEntityNotFound(_0x3b1c66,null))[_0x9473('0x20')](saveUpdates(_0x19eb3a[_0x9473('0x58')],null))[_0x9473('0x20')](function(_0x27856a){if(_0x27856a){_0x98978f[_0x9473('0x28')]=_0x27856a[_0x9473('0x64')]({'plain':!![]});return db[_0x9473('0x65')][_0x9473('0x56')]({'where':{'id':_0x27856a['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3b1c66,null))[_0x9473('0x20')](function(_0xaa2352){if(_0xaa2352){return _0xaa2352[_0x9473('0x66')]({'UserId':_0x19eb3a[_0x9473('0x58')][_0x9473('0x61')],'read1stAt':_[_0x9473('0x67')](_0xaa2352['read1stAt'])?moment()[_0x9473('0x5f')](_0x9473('0x60')):undefined});}return null;})[_0x9473('0x20')](function(_0x5ca94c){if(_0x5ca94c){_0x98978f[_0x9473('0x68')]=_0x5ca94c[_0x9473('0x64')]({'plain':!![]});interaction_log[_0x9473('0x21')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x19eb3a[_0x9473('0x62')]['id'],_0x19eb3a[_0x9473('0x62')][_0x9473('0x35')],_0x19eb3a[_0x9473('0x62')][_0x9473('0x69')],_0x98978f[_0x9473('0x68')]['id'],_0x19eb3a[_0x9473('0x58')]?JSON['stringify'](_0x19eb3a[_0x9473('0x58')]):_0x9473('0x6a'));return respondWithRpcPromise(_0x9473('0x6b'),_0x9473('0x6c'),_0x98978f);}return null;})[_0x9473('0x20')](function(_0x13e24d){if(_0x13e24d){if(_0x19eb3a[_0x9473('0x58')][_0x9473('0x6d')]){_0x98978f[_0x9473('0x28')][_0x9473('0x6e')]=util['format'](_0x9473('0x6f'),_0x19eb3a['user'][_0x9473('0x35')]);_0x98978f[_0x9473('0x28')][_0x9473('0x70')]=_0x98978f[_0x9473('0x70')];_0x98978f[_0x9473('0x28')]['event']=_0x9473('0x5b');return respondWithRpcPromise(_0x9473('0x71'),_0x9473('0x71'),{'event':_0x9473('0x72'),'message':_0x98978f[_0x9473('0x28')]},client9002)[_0x9473('0x20')](function(){return _0x98978f;});}return _0x98978f;}return null;})[_0x9473('0x20')](respondWithResult(_0x3b1c66,null))[_0x9473('0x51')](handleError(_0x3b1c66,null));};var interaction_log=require(_0x9473('0x11'))(_0x9473('0x73'));exports[_0x9473('0x32')]=function(_0x35ce5a,_0x4617e9,_0x482f47){var _0x435b0b={'agent':{},'channel':_0x9473('0x5c')};if(_0x35ce5a[_0x9473('0x58')]['id']){delete _0x35ce5a[_0x9473('0x58')]['id'];}_0x35ce5a['body'][_0x9473('0x61')]=_0x35ce5a[_0x9473('0x58')]['UserId']||_0x35ce5a['user']['id'];_0x435b0b['agent']['id']=_0x35ce5a[_0x9473('0x58')][_0x9473('0x61')];return db[_0x9473('0x39')][_0x9473('0x56')]({'where':{'id':_0x35ce5a['params']['id'],'UserId':null}})[_0x9473('0x20')](handleEntityNotFound(_0x4617e9,null))['then'](function(_0x516c1d){if(_0x516c1d){_0x435b0b['message']=_0x516c1d[_0x9473('0x64')]({'plain':!![]});return db['WhatsappInteraction'][_0x9473('0x56')]({'where':{'id':_0x516c1d[_0x9473('0x74')]}});}return null;})[_0x9473('0x20')](handleEntityNotFound(_0x4617e9,null))[_0x9473('0x20')](function(_0x2de537){if(_0x2de537){_0x435b0b[_0x9473('0x68')]=_0x2de537[_0x9473('0x64')]({'plain':!![]});interaction_log['info'](_0x9473('0x75'),_0x35ce5a[_0x9473('0x62')]['id'],_0x35ce5a[_0x9473('0x62')][_0x9473('0x35')],_0x35ce5a[_0x9473('0x62')][_0x9473('0x69')],_0x435b0b[_0x9473('0x68')]['id'],_0x35ce5a['body']?JSON[_0x9473('0x26')](_0x35ce5a[_0x9473('0x58')]):'null');return respondWithRpcPromise(_0x9473('0x76'),_0x9473('0x77'),_0x435b0b);}return null;})[_0x9473('0x20')](function(_0x3c5c33){if(_0x3c5c33){_0x3c5c33[_0x9473('0x28')][_0x9473('0x6e')]=util['format'](_0x9473('0x6f'),_0x35ce5a['user'][_0x9473('0x35')]);_0x3c5c33[_0x9473('0x28')][_0x9473('0x70')]=_0x435b0b[_0x9473('0x70')];_0x3c5c33[_0x9473('0x28')][_0x9473('0x78')]='reject';respondWithRpcPromise('EventManager',_0x9473('0x71'),{'event':_0x9473('0x79'),'message':_0x3c5c33['message']},client9002);return _0x435b0b;}return null;})['then'](respondWithResult(_0x4617e9,null))[_0x9473('0x51')](handleError(_0x4617e9,null));};exports[_0x9473('0x2a')]=function(_0x4faa33,_0x2c4f24,_0x347fbc){if(_0x4faa33['body']['id']){delete _0x4faa33['body']['id'];}var _0x23f9b0;return db[_0x9473('0x39')][_0x9473('0x56')]({'where':{'id':_0x4faa33[_0x9473('0x53')]['id']}})[_0x9473('0x20')](handleEntityNotFound(_0x2c4f24,null))[_0x9473('0x20')](function(_0x3caa1b){if(_0x3caa1b){_0x23f9b0=_0x3caa1b;return db[_0x9473('0x7a')]['find']({'where':{'id':_0x3caa1b[_0x9473('0x7b')]}});}})[_0x9473('0x20')](handleEntityNotFound(_0x2c4f24,null))['then'](function(_0x478f36){if(_0x478f36){logger[_0x9473('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x9473('0x2a'),'received\x20delivery\x20report\x20from',_0x478f36['type'],util[_0x9473('0x7c')](_0x4faa33[_0x9473('0x58')],{'showHidden':![],'depth':null}));switch(_0x478f36[_0x9473('0x3c')]){case _0x9473('0x7d'):if(_0x4faa33[_0x9473('0x58')][_0x9473('0x7e')]&&_0x4faa33[_0x9473('0x58')][_0x9473('0x7e')]===_0x23f9b0[_0x9473('0x7f')]&&_0x4faa33[_0x9473('0x58')][_0x9473('0x80')]&&_0x4faa33[_0x9473('0x58')]['MessageStatus']==='read'){return _0x23f9b0['update']({'read':!![]});}else{logger[_0x9473('0x27')](_0x9473('0x81'),_0x9473('0x2a'),_0x9473('0x7d'),util[_0x9473('0x7c')](_0x4faa33[_0x9473('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x23f9b0;}})[_0x9473('0x20')](respondWithResult(_0x2c4f24,null))[_0x9473('0x51')](handleError(_0x2c4f24,null));};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js
index 76c8e1d..c3d49ad 100644
--- a/server/api/whatsappMessage/whatsappMessage.events.js
+++ b/server/api/whatsappMessage/whatsappMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['WhatsappMessage','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x90b537,_0x534713){var _0x4e811d=function(_0x244b0b){while(--_0x244b0b){_0x90b537['push'](_0x90b537['shift']());}};_0x4e811d(++_0x534713);}(_0x7a54,0x106));var _0x47a5=function(_0x5c16c0,_0x1145e8){_0x5c16c0=_0x5c16c0-0x0;var _0x98d4db=_0x7a54[_0x5c16c0];return _0x98d4db;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var WhatsappMessage=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47a5('0x3'),'afterUpdate':_0x47a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f7f12){return function(_0x11bf85,_0x2a1a7e,_0x3717e1){WhatsappMessageEvents[_0x47a5('0x5')](_0x5f7f12+':'+_0x11bf85['id'],_0x11bf85);WhatsappMessageEvents['emit'](_0x5f7f12,_0x11bf85);_0x3717e1(null);};}for(var e in events){if(events[_0x47a5('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x47a5('0x7')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x348335,_0x57c4fe){var _0x4b7bdf=function(_0x5b849b){while(--_0x5b849b){_0x348335['push'](_0x348335['shift']());}};_0x4b7bdf(++_0x57c4fe);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ac6ab,_0x31e863){_0x5ac6ab=_0x5ac6ab-0x0;var _0x3a39f=_0x5f2f[_0x5ac6ab];return _0x3a39f;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var WhatsappMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];WhatsappMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js
index 2ad5615..47a3b71 100644
--- a/server/api/whatsappMessage/whatsappMessage.model.js
+++ b/server/api/whatsappMessage/whatsappMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05b7=['rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','secret','WhatsappInteraction','WhatsappInteractionId','then','createdAt','catch','direction','out','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/status?token=','token','update','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4','util','../../config/logger','api','request-promise','path'];(function(_0x5de3f3,_0x297ddf){var _0x461e0a=function(_0x2c7dd3){while(--_0x2c7dd3){_0x5de3f3['push'](_0x5de3f3['shift']());}};_0x461e0a(++_0x297ddf);}(_0x05b7,0xb7));var _0x705b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x05b7[_0x3054be];return _0x3df150;};'use strict';var _=require('lodash');var util=require(_0x705b('0x0'));var logger=require(_0x705b('0x1'))(_0x705b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x705b('0x3'));var fs=require('fs');var path=require(_0x705b('0x4'));var rimraf=require(_0x705b('0x5'));var config=require(_0x705b('0x6'));var attributes=require(_0x705b('0x7'));module[_0x705b('0x8')]=function(_0x532645,_0x346092){return _0x532645['define'](_0x705b('0x9'),attributes,{'tableName':_0x705b('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x705b('0xb')]},{'name':_0x705b('0xc'),'fields':[_0x705b('0xd')],'type':_0x705b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42e444,_0x4eb847,_0x327a87){var _0x4a5df7=_0x532645[_0x705b('0xf')];var _0x33f9db=_0x42e444[_0x705b('0x10')]({'plain':!![]});if(_0x33f9db['direction'][_0x705b('0x11')]()==='in'||_0x33f9db['direction']['toLowerCase']()==='out'&&!_0x33f9db[_0x705b('0x12')]&&!_['isNil'](_0x33f9db['UserId'])){_0x4a5df7[_0x705b('0x13')]['findOne']({'where':{'id':_0x33f9db[_0x705b('0x14')]}})[_0x705b('0x15')](function(_0x29eee2){if(_0x29eee2){_0x29eee2['update']({'lastMsgAt':_0x33f9db[_0x705b('0x16')],'lastMsgDirection':_0x33f9db['direction']['toLowerCase']()});}})[_0x705b('0x17')](function(_0x480f61){console['error'](_0x480f61);});}if(_0x33f9db[_0x705b('0x18')]===_0x705b('0x19')&&!_0x33f9db[_0x705b('0x12')]){var _0x758ac3;_0x4a5df7[_0x705b('0x1a')][_0x705b('0x1b')]({'where':{'id':_0x33f9db[_0x705b('0x1c')]},'raw':!![]})['then'](function(_0x39eb3a){_0x758ac3=_0x39eb3a;if(_0x758ac3&&_0x758ac3[_0x705b('0x1d')]){switch(_0x758ac3['type']){case _0x705b('0x1e'):var _0x2621a3=require(_0x705b('0x1e'));if(_0x758ac3[_0x705b('0x1f')]&&_0x758ac3[_0x705b('0x20')]&&_0x758ac3[_0x705b('0x21')]){var _0x2f2e9e=new _0x2621a3(_0x758ac3['accountSid'],_0x758ac3['authToken']);_0x2f2e9e[_0x705b('0x22')]['create']({'body':_0x33f9db[_0x705b('0xd')],'to':'whatsapp:'+_0x33f9db['phone'],'from':_0x705b('0x23')+_0x758ac3['phone'],'statusCallback':_0x758ac3[_0x705b('0x24')]+'/api/whatsapp/messages/'+_0x33f9db['id']+_0x705b('0x25')+_0x758ac3[_0x705b('0x26')]})[_0x705b('0x15')](function(_0x258101){if(_0x258101['sid']){return _0x42e444[_0x705b('0x27')]({'messageId':_0x258101[_0x705b('0x28')]});}})[_0x705b('0x17')](function(_0x2d0ab9){logger[_0x705b('0x29')](_0x705b('0x2a'),'afterCreate',_0x705b('0x1e'),util[_0x705b('0x2b')](_0x2d0ab9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x705b('0x2a'),_0x705b('0x2c'),_0x705b('0x1e'),_0x705b('0x2d'));}break;}}})['finally'](function(){_0x327a87();});}else{_0x327a87();}}},'charset':_0x705b('0x2e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7bf9=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','direction','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','toLowerCase','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4_unicode_ci','lodash','util'];(function(_0x17feba,_0x1792e9){var _0x4cc904=function(_0x35a447){while(--_0x35a447){_0x17feba['push'](_0x17feba['shift']());}};_0x4cc904(++_0x1792e9);}(_0x7bf9,0x91));var _0x97bf=function(_0xa4d7bd,_0x51409a){_0xa4d7bd=_0xa4d7bd-0x0;var _0xc14280=_0x7bf9[_0xa4d7bd];return _0xc14280;};'use strict';var _=require(_0x97bf('0x0'));var util=require(_0x97bf('0x1'));var logger=require(_0x97bf('0x2'))(_0x97bf('0x3'));var moment=require(_0x97bf('0x4'));var BPromise=require('bluebird');var rp=require(_0x97bf('0x5'));var fs=require('fs');var path=require(_0x97bf('0x6'));var rimraf=require(_0x97bf('0x7'));var config=require(_0x97bf('0x8'));var attributes=require(_0x97bf('0x9'));module[_0x97bf('0xa')]=function(_0x24792f,_0x1c8174){return _0x24792f[_0x97bf('0xb')](_0x97bf('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x97bf('0xd'),'fields':[_0x97bf('0xd')]},{'name':_0x97bf('0xe'),'fields':[_0x97bf('0xf')],'type':_0x97bf('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2eff48,_0x28be5e,_0x465f5d){var _0x522b52=_0x24792f['models'];var _0xc2ff47=_0x2eff48['get']({'plain':!![]});if(_0xc2ff47[_0x97bf('0x11')]['toLowerCase']()==='in'||_0xc2ff47[_0x97bf('0x11')]['toLowerCase']()===_0x97bf('0x12')&&!_0xc2ff47[_0x97bf('0x13')]&&!_[_0x97bf('0x14')](_0xc2ff47[_0x97bf('0x15')])){_0x522b52[_0x97bf('0x16')]['findOne']({'where':{'id':_0xc2ff47[_0x97bf('0x17')]}})[_0x97bf('0x18')](function(_0x3f04fe){if(_0x3f04fe){_0x3f04fe[_0x97bf('0x19')]({'lastMsgAt':_0xc2ff47[_0x97bf('0x1a')],'lastMsgDirection':_0xc2ff47['direction'][_0x97bf('0x1b')]()});}})[_0x97bf('0x1c')](function(_0x59aea1){console[_0x97bf('0x1d')](_0x59aea1);});}if(_0xc2ff47['direction']===_0x97bf('0x12')&&!_0xc2ff47[_0x97bf('0x13')]){var _0x497bcd;_0x522b52[_0x97bf('0x1e')][_0x97bf('0x1f')]({'where':{'id':_0xc2ff47[_0x97bf('0x20')]},'raw':!![]})[_0x97bf('0x18')](function(_0x339f20){_0x497bcd=_0x339f20;if(_0x497bcd&&_0x497bcd[_0x97bf('0x21')]){switch(_0x497bcd['type']){case _0x97bf('0x22'):var _0x3fb806=require(_0x97bf('0x22'));if(_0x497bcd[_0x97bf('0x23')]&&_0x497bcd['authToken']&&_0x497bcd[_0x97bf('0x24')]){var _0x4fedcd=new _0x3fb806(_0x497bcd[_0x97bf('0x23')],_0x497bcd[_0x97bf('0x25')]);_0x4fedcd['messages'][_0x97bf('0x26')]({'body':_0xc2ff47[_0x97bf('0xf')],'to':_0x97bf('0x27')+_0xc2ff47[_0x97bf('0x24')],'from':_0x97bf('0x27')+_0x497bcd[_0x97bf('0x24')],'statusCallback':_0x497bcd[_0x97bf('0x28')]+_0x97bf('0x29')+_0xc2ff47['id']+_0x97bf('0x2a')+_0x497bcd[_0x97bf('0x2b')]})[_0x97bf('0x18')](function(_0x135900){if(_0x135900[_0x97bf('0x2c')]){return _0x2eff48[_0x97bf('0x19')]({'messageId':_0x135900[_0x97bf('0x2c')]});}})['catch'](function(_0x3e7a7e){logger['error'](_0x97bf('0x2d'),_0x97bf('0x2e'),_0x97bf('0x22'),util['inspect'](_0x3e7a7e,{'showHidden':![],'depth':null}));});}else{logger[_0x97bf('0x1d')](_0x97bf('0x2d'),_0x97bf('0x2e'),_0x97bf('0x22'),_0x97bf('0x2f'));}break;}}})['finally'](function(){_0x465f5d();});}else{_0x465f5d();}}},'charset':'utf8mb4','collate':_0x97bf('0x30')});};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js
index b64cbd7..2f92359 100644
--- a/server/api/whatsappMessage/whatsappMessage.rpc.js
+++ b/server/api/whatsappMessage/whatsappMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb1b2=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0xb1b2,0xe1));var _0x2b1b=function(_0x55a523,_0x502714){_0x55a523=_0x55a523-0x0;var _0x24d8b0=_0xb1b2[_0x55a523];return _0x24d8b0;};'use strict';var _=require('lodash');var util=require(_0x2b1b('0x0'));var moment=require('moment');var BPromise=require(_0x2b1b('0x1'));var rs=require(_0x2b1b('0x2'));var fs=require('fs');var Redis=require(_0x2b1b('0x3'));var db=require(_0x2b1b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b1b('0x5'))(_0x2b1b('0x6'));var config=require(_0x2b1b('0x7'));var jayson=require(_0x2b1b('0x8'));var client=jayson[_0x2b1b('0x9')]['http']({'port':0x232a});config[_0x2b1b('0xa')]=_[_0x2b1b('0xb')](config[_0x2b1b('0xa')],{'host':_0x2b1b('0xc'),'port':0x18eb});var socket=require(_0x2b1b('0xd'))(new Redis(config[_0x2b1b('0xa')]));require(_0x2b1b('0xe'))[_0x2b1b('0xf')](socket);function respondWithRpcPromise(_0x9a6119,_0x896ddf,_0x1ffdde){return new BPromise(function(_0x2db2f2,_0x5c938b){return client['request'](_0x9a6119,_0x1ffdde)[_0x2b1b('0x10')](function(_0x132166){logger[_0x2b1b('0x11')](_0x2b1b('0x12'),_0x896ddf,_0x2b1b('0x13'));logger[_0x2b1b('0x14')](_0x2b1b('0x15'),_0x896ddf,_0x2b1b('0x13'),JSON[_0x2b1b('0x16')](_0x132166));if(_0x132166[_0x2b1b('0x17')]){if(_0x132166[_0x2b1b('0x17')][_0x2b1b('0x18')]===0x1f4){logger[_0x2b1b('0x17')](_0x2b1b('0x12'),_0x896ddf,_0x132166[_0x2b1b('0x17')][_0x2b1b('0x19')]);return _0x5c938b(_0x132166['error'][_0x2b1b('0x19')]);}logger['error'](_0x2b1b('0x12'),_0x896ddf,_0x132166['error'][_0x2b1b('0x19')]);return _0x2db2f2(_0x132166[_0x2b1b('0x17')][_0x2b1b('0x19')]);}else{logger[_0x2b1b('0x11')](_0x2b1b('0x12'),_0x896ddf,_0x2b1b('0x13'));_0x2db2f2(_0x132166[_0x2b1b('0x1a')][_0x2b1b('0x19')]);}})[_0x2b1b('0x1b')](function(_0x2124ce){logger[_0x2b1b('0x17')](_0x2b1b('0x12'),_0x896ddf,_0x2124ce);_0x5c938b(_0x2124ce);});});}exports[_0x2b1b('0x1c')]=function(_0x3afc3b){var _0xa900a2=this;return new Promise(function(_0x1210a3,_0xedea13){return db[_0x2b1b('0x1d')][_0x2b1b('0x1e')](_0x3afc3b['body'],{'raw':_0x3afc3b[_0x2b1b('0x1f')]?_0x3afc3b[_0x2b1b('0x1f')][_0x2b1b('0x20')]===undefined?!![]:![]:!![]})[_0x2b1b('0x10')](function(_0x285008){logger['info'](_0x2b1b('0x1c'),_0x3afc3b);logger['debug'](_0x2b1b('0x1c'),_0x3afc3b,JSON['stringify'](_0x285008));_0x1210a3(_0x285008);})[_0x2b1b('0x1b')](function(_0x47ae80){logger[_0x2b1b('0x17')]('CreateWhatsappMessage',_0x47ae80[_0x2b1b('0x19')],_0x3afc3b);_0xedea13(_0xa900a2[_0x2b1b('0x17')](0x1f4,_0x47ae80[_0x2b1b('0x19')]));});});};
\ No newline at end of file
+var _0x412d=['register','then','info','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','WhatsappMessage','body','options','raw','CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x412d,0xa5));var _0xd412=function(_0x5d39b8,_0x13f576){_0x5d39b8=_0x5d39b8-0x0;var _0x235439=_0x412d[_0x5d39b8];return _0x235439;};'use strict';var _=require(_0xd412('0x0'));var util=require(_0xd412('0x1'));var moment=require(_0xd412('0x2'));var BPromise=require(_0xd412('0x3'));var rs=require(_0xd412('0x4'));var fs=require('fs');var Redis=require(_0xd412('0x5'));var db=require(_0xd412('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd412('0x7'))(_0xd412('0x8'));var config=require(_0xd412('0x9'));var jayson=require(_0xd412('0xa'));var client=jayson[_0xd412('0xb')][_0xd412('0xc')]({'port':0x232a});config[_0xd412('0xd')]=_['defaults'](config[_0xd412('0xd')],{'host':_0xd412('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd412('0xd')]));require('./whatsappMessage.socket')[_0xd412('0xf')](socket);function respondWithRpcPromise(_0x5c100d,_0x5549a6,_0x348e51){return new BPromise(function(_0x3682d6,_0x5ca57c){return client['request'](_0x5c100d,_0x348e51)[_0xd412('0x10')](function(_0x2cfd5e){logger[_0xd412('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x5549a6,_0xd412('0x12'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5549a6,'request\x20sent',JSON[_0xd412('0x13')](_0x2cfd5e));if(_0x2cfd5e[_0xd412('0x14')]){if(_0x2cfd5e[_0xd412('0x14')][_0xd412('0x15')]===0x1f4){logger[_0xd412('0x14')](_0xd412('0x16'),_0x5549a6,_0x2cfd5e[_0xd412('0x14')][_0xd412('0x17')]);return _0x5ca57c(_0x2cfd5e[_0xd412('0x14')][_0xd412('0x17')]);}logger[_0xd412('0x14')](_0xd412('0x16'),_0x5549a6,_0x2cfd5e[_0xd412('0x14')][_0xd412('0x17')]);return _0x3682d6(_0x2cfd5e[_0xd412('0x14')][_0xd412('0x17')]);}else{logger[_0xd412('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x5549a6,_0xd412('0x12'));_0x3682d6(_0x2cfd5e[_0xd412('0x18')][_0xd412('0x17')]);}})['catch'](function(_0x4d1f8e){logger[_0xd412('0x14')](_0xd412('0x16'),_0x5549a6,_0x4d1f8e);_0x5ca57c(_0x4d1f8e);});});}exports['CreateWhatsappMessage']=function(_0x5f42fb){var _0x21f2e4=this;return new Promise(function(_0x445485,_0x2aa034){return db[_0xd412('0x19')]['create'](_0x5f42fb[_0xd412('0x1a')],{'raw':_0x5f42fb[_0xd412('0x1b')]?_0x5f42fb[_0xd412('0x1b')][_0xd412('0x1c')]===undefined?!![]:![]:!![]})[_0xd412('0x10')](function(_0x3642b5){logger[_0xd412('0x11')](_0xd412('0x1d'),_0x5f42fb);logger['debug'](_0xd412('0x1d'),_0x5f42fb,JSON[_0xd412('0x13')](_0x3642b5));_0x445485(_0x3642b5);})['catch'](function(_0x58e54b){logger[_0xd412('0x14')](_0xd412('0x1d'),_0x58e54b['message'],_0x5f42fb);_0x2aa034(_0x21f2e4[_0xd412('0x14')](0x1f4,_0x58e54b[_0xd412('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js
index ee9e925..7002e83 100644
--- a/server/api/whatsappMessage/whatsappMessage.socket.js
+++ b/server/api/whatsappMessage/whatsappMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf301=['remove','update','emit','removeListener','register','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf301,0xe6));var _0x1f30=function(_0x49830c,_0x4472d7){_0x49830c=_0x49830c-0x0;var _0x5872f2=_0xf301[_0x49830c];return _0x5872f2;};'use strict';var WhatsappMessageEvents=require(_0x1f30('0x0'));var events=[_0x1f30('0x1'),_0x1f30('0x2'),_0x1f30('0x3')];function createListener(_0x33f6b1,_0x412361){return function(_0x352c2a){_0x412361[_0x1f30('0x4')](_0x33f6b1,_0x352c2a);};}function removeListener(_0x34055d,_0x1edad6){return function(){WhatsappMessageEvents[_0x1f30('0x5')](_0x34055d,_0x1edad6);};}exports[_0x1f30('0x6')]=function(_0xe30628){for(var _0xcd7b81=0x0,_0x82a96f=events['length'];_0xcd7b81<_0x82a96f;_0xcd7b81++){var _0x1f77a8=events[_0xcd7b81];var _0x43c98d=createListener(_0x1f30('0x7')+_0x1f77a8,_0xe30628);WhatsappMessageEvents['on'](_0x1f77a8,_0x43c98d);}};
\ No newline at end of file
+var _0x84cb=['register','length','whatsappMessage:','./whatsappMessage.events','remove','emit','removeListener'];(function(_0x15a9df,_0x3eb9f3){var _0x20af34=function(_0x53e140){while(--_0x53e140){_0x15a9df['push'](_0x15a9df['shift']());}};_0x20af34(++_0x3eb9f3);}(_0x84cb,0xf8));var _0xb84c=function(_0x15c145,_0x5bc4ed){_0x15c145=_0x15c145-0x0;var _0x46f9c8=_0x84cb[_0x15c145];return _0x46f9c8;};'use strict';var WhatsappMessageEvents=require(_0xb84c('0x0'));var events=['save',_0xb84c('0x1'),'update'];function createListener(_0x233b71,_0x5b51a5){return function(_0x305f92){_0x5b51a5[_0xb84c('0x2')](_0x233b71,_0x305f92);};}function removeListener(_0x11b876,_0x9573c8){return function(){WhatsappMessageEvents[_0xb84c('0x3')](_0x11b876,_0x9573c8);};}exports[_0xb84c('0x4')]=function(_0x1afb9f){for(var _0x20fa18=0x0,_0x5a69a9=events[_0xb84c('0x5')];_0x20fa18<_0x5a69a9;_0x20fa18++){var _0x471717=events[_0x20fa18];var _0x282fa1=createListener(_0xb84c('0x6')+_0x471717,_0x1afb9f);WhatsappMessageEvents['on'](_0x471717,_0x282fa1);}};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js
index 0c7448f..ae277ed 100644
--- a/server/api/whatsappQueue/index.js
+++ b/server/api/whatsappQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc0d6=['describe','/:id','isAuthenticated','show','/:id/teams','/:id/users','getAgents','post','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','/describe'];(function(_0x31a951,_0x457142){var _0x29c5f8=function(_0x3f80b0){while(--_0x3f80b0){_0x31a951['push'](_0x31a951['shift']());}};_0x29c5f8(++_0x457142);}(_0xc0d6,0x155));var _0x6c0d=function(_0xb5a8b4,_0x470cc4){_0xb5a8b4=_0xb5a8b4-0x0;var _0xc91467=_0xc0d6[_0xb5a8b4];return _0xc91467;};'use strict';var multer=require(_0x6c0d('0x0'));var util=require(_0x6c0d('0x1'));var path=require(_0x6c0d('0x2'));var timeout=require(_0x6c0d('0x3'));var express=require(_0x6c0d('0x4'));var router=express[_0x6c0d('0x5')]();var auth=require(_0x6c0d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x6c0d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6c0d('0x7')](_0x6c0d('0x8'),auth['isAuthenticated'](),controller[_0x6c0d('0x9')]);router[_0x6c0d('0x7')](_0x6c0d('0xa'),auth[_0x6c0d('0xb')](),controller[_0x6c0d('0xc')]);router['get']('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x6c0d('0x7')](_0x6c0d('0xd'),auth[_0x6c0d('0xb')](),controller['getTeams']);router[_0x6c0d('0x7')](_0x6c0d('0xe'),auth[_0x6c0d('0xb')](),controller[_0x6c0d('0xf')]);router[_0x6c0d('0x10')]('/',auth[_0x6c0d('0xb')](),controller['create']);router['post'](_0x6c0d('0xd'),auth[_0x6c0d('0xb')](),controller['addTeams']);router[_0x6c0d('0x10')](_0x6c0d('0xe'),auth[_0x6c0d('0xb')](),controller[_0x6c0d('0x11')]);router[_0x6c0d('0x12')](_0x6c0d('0xa'),auth[_0x6c0d('0xb')](),controller[_0x6c0d('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6c0d('0x14')]);router[_0x6c0d('0x15')](_0x6c0d('0xd'),auth[_0x6c0d('0xb')](),controller[_0x6c0d('0x16')]);router[_0x6c0d('0x15')](_0x6c0d('0xe'),auth['isAuthenticated'](),controller[_0x6c0d('0x17')]);module[_0x6c0d('0x18')]=router;
\ No newline at end of file
+var _0x6914=['show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x310de0,_0xb5d28f){var _0x12c260=function(_0x484846){while(--_0x484846){_0x310de0['push'](_0x310de0['shift']());}};_0x12c260(++_0xb5d28f);}(_0x6914,0x1e4));var _0x4691=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x6914[_0x11005e];return _0x29338f;};'use strict';var multer=require('multer');var util=require(_0x4691('0x0'));var path=require(_0x4691('0x1'));var timeout=require(_0x4691('0x2'));var express=require('express');var router=express[_0x4691('0x3')]();var auth=require(_0x4691('0x4'));var interaction=require(_0x4691('0x5'));var config=require(_0x4691('0x6'));var controller=require('./whatsappQueue.controller');router[_0x4691('0x7')]('/',auth[_0x4691('0x8')](),controller['index']);router[_0x4691('0x7')]('/describe',auth[_0x4691('0x8')](),controller['describe']);router['get'](_0x4691('0x9'),auth[_0x4691('0x8')](),controller[_0x4691('0xa')]);router[_0x4691('0x7')](_0x4691('0xb'),auth[_0x4691('0x8')](),controller['getMembers']);router[_0x4691('0x7')](_0x4691('0xc'),auth[_0x4691('0x8')](),controller['getTeams']);router['get'](_0x4691('0xd'),auth['isAuthenticated'](),controller[_0x4691('0xe')]);router[_0x4691('0xf')]('/',auth[_0x4691('0x8')](),controller[_0x4691('0x10')]);router[_0x4691('0xf')](_0x4691('0xc'),auth['isAuthenticated'](),controller[_0x4691('0x11')]);router[_0x4691('0xf')](_0x4691('0xd'),auth[_0x4691('0x8')](),controller[_0x4691('0x12')]);router[_0x4691('0x13')](_0x4691('0x9'),auth[_0x4691('0x8')](),controller[_0x4691('0x14')]);router[_0x4691('0x15')](_0x4691('0x9'),auth[_0x4691('0x8')](),controller[_0x4691('0x16')]);router[_0x4691('0x15')]('/:id/teams',auth[_0x4691('0x8')](),controller[_0x4691('0x17')]);router['delete'](_0x4691('0xd'),auth[_0x4691('0x8')](),controller[_0x4691('0x18')]);module[_0x4691('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js
index b10c311..12ae006 100644
--- a/server/api/whatsappQueue/whatsappQueue.attributes.js
+++ b/server/api/whatsappQueue/whatsappQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9cf2=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x482e94,_0x2f34bd){var _0x3c3ec1=function(_0x142a34){while(--_0x142a34){_0x482e94['push'](_0x482e94['shift']());}};_0x3c3ec1(++_0x2f34bd);}(_0x9cf2,0xf7));var _0x29cf=function(_0x5283f1,_0x958204){_0x5283f1=_0x5283f1-0x0;var _0x17964e=_0x9cf2[_0x5283f1];return _0x17964e;};'use strict';var Sequelize=require(_0x29cf('0x0'));module[_0x29cf('0x1')]={'name':{'type':Sequelize[_0x29cf('0x2')],'unique':_0x29cf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x29cf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x29cf('0x5')](_0x29cf('0x6'),_0x29cf('0x7'),_0x29cf('0x8'))},'description':{'type':Sequelize[_0x29cf('0x2')]}};
\ No newline at end of file
+var _0xeda3=['rrmemory','beepall','roundrobin','STRING','sequelize','exports'];(function(_0x349b70,_0x4dbed4){var _0x3e14c3=function(_0x4bce9b){while(--_0x4bce9b){_0x349b70['push'](_0x349b70['shift']());}};_0x3e14c3(++_0x4dbed4);}(_0xeda3,0xca));var _0x3eda=function(_0x578bc3,_0x5d0ad0){_0x578bc3=_0x578bc3-0x0;var _0x1b0393=_0xeda3[_0x578bc3];return _0x1b0393;};'use strict';var Sequelize=require(_0x3eda('0x0'));module[_0x3eda('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3eda('0x2'),_0x3eda('0x3'),_0x3eda('0x4'))},'description':{'type':Sequelize[_0x3eda('0x5')]}};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js
index 2ff5518..a2e7f11 100644
--- a/server/api/whatsappQueue/whatsappQueue.controller.js
+++ b/server/api/whatsappQueue/whatsappQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5255=['findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','findOne','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','./whatsappQueue.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','show','params','WhatsappQueue','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','get','UserWhatsappQueue','WhatsappQueueId','findAll','User','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','Team','order','nolimit','ids','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each'];(function(_0x4b0dfe,_0x532a27){var _0x415271=function(_0x5ba4b){while(--_0x5ba4b){_0x4b0dfe['push'](_0x4b0dfe['shift']());}};_0x415271(++_0x532a27);}(_0x5255,0xad));var _0x5525=function(_0x2ba78b,_0x323359){_0x2ba78b=_0x2ba78b-0x0;var _0x4acb91=_0x5255[_0x2ba78b];return _0x4acb91;};'use strict';var pdf=require(_0x5525('0x0'));var emlformat=require(_0x5525('0x1'));var rimraf=require(_0x5525('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5525('0x3'));var rp=require(_0x5525('0x4'));var moment=require(_0x5525('0x5'));var BPromise=require(_0x5525('0x6'));var Mustache=require(_0x5525('0x7'));var util=require(_0x5525('0x8'));var path=require(_0x5525('0x9'));var sox=require(_0x5525('0xa'));var csv=require(_0x5525('0xb'));var ejs=require(_0x5525('0xc'));var fs=require('fs');var _=require(_0x5525('0xd'));var squel=require(_0x5525('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5525('0xf'));var toCsv=require(_0x5525('0xb'));var querystring=require(_0x5525('0x10'));var Papa=require(_0x5525('0x11'));var Redis=require('ioredis');var authService=require(_0x5525('0x12'));var qs=require(_0x5525('0x13'));var as=require(_0x5525('0x14'));var hardwareService=require(_0x5525('0x15'));var logger=require(_0x5525('0x16'))(_0x5525('0x17'));var utils=require('../../config/utils');var config=require(_0x5525('0x18'));var db=require(_0x5525('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5525('0x1a')]));require(_0x5525('0x1b'))[_0x5525('0x1c')](socket);function respondWithStatusCode(_0x31e3a1,_0x45bd38){_0x45bd38=_0x45bd38||0xcc;return function(_0x24b877){if(_0x24b877){return _0x31e3a1[_0x5525('0x1d')](_0x45bd38);}return _0x31e3a1[_0x5525('0x1e')](_0x45bd38)[_0x5525('0x1f')]();};}function respondWithResult(_0x34b3c1,_0xe92738){_0xe92738=_0xe92738||0xc8;return function(_0x3a1906){if(_0x3a1906){return _0x34b3c1[_0x5525('0x1e')](_0xe92738)['json'](_0x3a1906);}};}function respondWithFilteredResult(_0xfde2cc,_0x41b86d){return function(_0x2f1356){if(_0x2f1356){var _0x51eb4f=_0x2f1356[_0x5525('0x20')],_0x1226fc=_0x41b86d[_0x5525('0x21')],_0x44d699=_0x41b86d[_0x5525('0x21')]+_0x41b86d[_0x5525('0x22')],_0x59aada;if(_0x44d699>=_0x51eb4f){_0x44d699=_0x51eb4f;_0x59aada=0xc8;}else{_0x59aada=0xce;}_0xfde2cc[_0x5525('0x1e')](_0x59aada);return _0xfde2cc[_0x5525('0x23')](_0x5525('0x24'),_0x1226fc+'-'+_0x44d699+'/'+_0x51eb4f)[_0x5525('0x25')](_0x2f1356);}return null;};}function patchUpdates(_0x19d37a){return function(_0x595ed8){try{jsonpatch[_0x5525('0x26')](_0x595ed8,_0x19d37a,!![]);}catch(_0x38bb35){return BPromise[_0x5525('0x27')](_0x38bb35);}return _0x595ed8[_0x5525('0x28')]();};}function saveUpdates(_0x45f32a,_0x4cdacb){return function(_0x1c9814){if(_0x1c9814){return _0x1c9814[_0x5525('0x29')](_0x45f32a)[_0x5525('0x2a')](function(_0x2d43fc){return _0x2d43fc;});}return null;};}function removeEntity(_0x3248a8,_0x39963d){return function(_0x4f4afe){if(_0x4f4afe){return _0x4f4afe['destroy']()[_0x5525('0x2a')](function(){var _0x6ad2f4=_0x4f4afe['get']({'plain':!![]});var _0x42479e='WhatsappQueues';return db['UserProfileResource'][_0x5525('0x2b')]({'where':{'type':_0x42479e,'resourceId':_0x6ad2f4['id']}})['then'](function(){return _0x4f4afe;});})[_0x5525('0x2a')](function(){_0x3248a8[_0x5525('0x1e')](0xcc)[_0x5525('0x1f')]();});}};}function handleEntityNotFound(_0x18683f,_0x48cede){return function(_0x25f857){if(!_0x25f857){_0x18683f[_0x5525('0x1d')](0x194);}return _0x25f857;};}function handleError(_0xa690cb,_0x55261b){_0x55261b=_0x55261b||0x1f4;return function(_0xab2c2e){logger[_0x5525('0x2c')](_0xab2c2e['stack']);if(_0xab2c2e['name']){delete _0xab2c2e[_0x5525('0x2d')];}_0xa690cb[_0x5525('0x1e')](_0x55261b)['send'](_0xab2c2e);};}exports[_0x5525('0x2e')]=function(_0x2b7543,_0x1a6af6){var _0x471cb1={},_0x5e9ab5={},_0x159c0e={'count':0x0,'rows':[]};var _0x3525ea=_[_0x5525('0x2f')](db['WhatsappQueue']['rawAttributes'],function(_0x116837){return{'name':_0x116837[_0x5525('0x30')],'type':_0x116837[_0x5525('0x31')][_0x5525('0x32')]};});_0x5e9ab5[_0x5525('0x33')]=_['map'](_0x3525ea,'name');_0x5e9ab5[_0x5525('0x34')]=_[_0x5525('0x35')](_0x2b7543[_0x5525('0x34')]);_0x5e9ab5[_0x5525('0x36')]=_['intersection'](_0x5e9ab5[_0x5525('0x33')],_0x5e9ab5[_0x5525('0x34')]);_0x471cb1['attributes']=_[_0x5525('0x37')](_0x5e9ab5['model'],qs[_0x5525('0x38')](_0x2b7543[_0x5525('0x34')][_0x5525('0x38')]));_0x471cb1['attributes']=_0x471cb1[_0x5525('0x39')][_0x5525('0x3a')]?_0x471cb1[_0x5525('0x39')]:_0x5e9ab5['model'];if(!_0x2b7543[_0x5525('0x34')][_0x5525('0x3b')]('nolimit')){_0x471cb1[_0x5525('0x22')]=qs['limit'](_0x2b7543[_0x5525('0x34')][_0x5525('0x22')]);_0x471cb1[_0x5525('0x21')]=qs[_0x5525('0x21')](_0x2b7543[_0x5525('0x34')][_0x5525('0x21')]);}_0x471cb1['order']=qs[_0x5525('0x3c')](_0x2b7543[_0x5525('0x34')][_0x5525('0x3c')]);_0x471cb1[_0x5525('0x3d')]=qs[_0x5525('0x36')](_[_0x5525('0x3e')](_0x2b7543[_0x5525('0x34')],_0x5e9ab5[_0x5525('0x36')]),_0x3525ea);if(_0x2b7543[_0x5525('0x34')]['filter']){_0x471cb1['where']=_[_0x5525('0x3f')](_0x471cb1[_0x5525('0x3d')],{'$or':_[_0x5525('0x2f')](_0x3525ea,function(_0x4d91a3){if(_0x4d91a3[_0x5525('0x31')]!==_0x5525('0x40')){var _0x99b76c={};_0x99b76c[_0x4d91a3[_0x5525('0x2d')]]={'$like':'%'+_0x2b7543[_0x5525('0x34')][_0x5525('0x41')]+'%'};return _0x99b76c;}})});}_0x471cb1=_['merge']({},_0x471cb1,_0x2b7543['options']);var _0x394266={'where':_0x471cb1[_0x5525('0x3d')]};return db['WhatsappQueue']['count'](_0x394266)[_0x5525('0x2a')](function(_0x23ff8f){_0x159c0e[_0x5525('0x20')]=_0x23ff8f;if(_0x2b7543[_0x5525('0x34')][_0x5525('0x42')]){_0x471cb1[_0x5525('0x43')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x471cb1);})['then'](function(_0x151463){_0x159c0e[_0x5525('0x44')]=_0x151463;return _0x159c0e;})[_0x5525('0x2a')](respondWithFilteredResult(_0x1a6af6,_0x471cb1))['catch'](handleError(_0x1a6af6,null));};exports[_0x5525('0x45')]=function(_0x439516,_0x1cd801){var _0x15005c={'raw':!![],'where':{'id':_0x439516[_0x5525('0x46')]['id']}},_0x784d93={};_0x784d93[_0x5525('0x33')]=_[_0x5525('0x35')](db[_0x5525('0x47')][_0x5525('0x48')]);_0x784d93[_0x5525('0x34')]=_[_0x5525('0x35')](_0x439516['query']);_0x784d93[_0x5525('0x36')]=_[_0x5525('0x37')](_0x784d93[_0x5525('0x33')],_0x784d93[_0x5525('0x34')]);_0x15005c['attributes']=_[_0x5525('0x37')](_0x784d93[_0x5525('0x33')],qs['fields'](_0x439516[_0x5525('0x34')][_0x5525('0x38')]));_0x15005c[_0x5525('0x39')]=_0x15005c[_0x5525('0x39')][_0x5525('0x3a')]?_0x15005c['attributes']:_0x784d93[_0x5525('0x33')];if(_0x439516[_0x5525('0x34')][_0x5525('0x42')]){_0x15005c[_0x5525('0x43')]=[{'all':!![]}];}_0x15005c=_['merge']({},_0x15005c,_0x439516[_0x5525('0x49')]);return db[_0x5525('0x47')][_0x5525('0x4a')](_0x15005c)[_0x5525('0x2a')](handleEntityNotFound(_0x1cd801,null))['then'](respondWithResult(_0x1cd801,null))[_0x5525('0x4b')](handleError(_0x1cd801,null));};exports[_0x5525('0x4c')]=function(_0x533d46,_0xf748d8){return db[_0x5525('0x47')][_0x5525('0x4c')](_0x533d46[_0x5525('0x4d')],{})[_0x5525('0x2a')](function(_0x3c9e7e){var _0x3a2943=_0x533d46[_0x5525('0x4e')]['get']({'plain':!![]});if(!_0x3a2943)throw new Error(_0x5525('0x4f'));if(_0x3a2943[_0x5525('0x50')]==='user'){var _0x294a9f=_0x3c9e7e['get']({'plain':!![]});var _0x2e5a80=_0x5525('0x51');return db[_0x5525('0x52')][_0x5525('0x4a')]({'where':{'name':_0x2e5a80,'userProfileId':_0x3a2943[_0x5525('0x53')]},'raw':!![]})[_0x5525('0x2a')](function(_0x2faba3){if(_0x2faba3&&_0x2faba3[_0x5525('0x54')]===0x0){return db[_0x5525('0x55')][_0x5525('0x4c')]({'name':_0x294a9f[_0x5525('0x2d')],'resourceId':_0x294a9f['id'],'type':_0x2faba3['name'],'sectionId':_0x2faba3['id']},{})[_0x5525('0x2a')](function(){return _0x3c9e7e;});}else{return _0x3c9e7e;}})[_0x5525('0x4b')](function(_0x373e59){logger['error'](_0x5525('0x56'),_0x373e59);throw _0x373e59;});}return _0x3c9e7e;})[_0x5525('0x2a')](respondWithResult(_0xf748d8,0xc9))[_0x5525('0x4b')](handleError(_0xf748d8,null));};exports[_0x5525('0x29')]=function(_0x31e28c,_0x29edbd){if(_0x31e28c['body']['id']){delete _0x31e28c['body']['id'];}return db[_0x5525('0x47')][_0x5525('0x4a')]({'where':{'id':_0x31e28c[_0x5525('0x46')]['id']}})['then'](handleEntityNotFound(_0x29edbd,null))['then'](saveUpdates(_0x31e28c[_0x5525('0x4d')],null))[_0x5525('0x2a')](respondWithResult(_0x29edbd,null))[_0x5525('0x4b')](handleError(_0x29edbd,null));};exports[_0x5525('0x2b')]=function(_0x2f1a3a,_0x410368){return db[_0x5525('0x47')][_0x5525('0x4a')]({'where':{'id':_0x2f1a3a[_0x5525('0x46')]['id']}})['then'](handleEntityNotFound(_0x410368,null))[_0x5525('0x2a')](removeEntity(_0x410368,null))[_0x5525('0x4b')](handleError(_0x410368,null));};exports[_0x5525('0x57')]=function(_0x240c52,_0x4723e0){return db['WhatsappQueue'][_0x5525('0x57')]()[_0x5525('0x2a')](respondWithResult(_0x4723e0,null))[_0x5525('0x4b')](handleError(_0x4723e0,null));};exports['getMembers']=function(_0x34af6f,_0x340edb,_0xa22aeb){var _0x23ae0c={'raw':!![],'where':{}},_0x5204fc={},_0x28b0d8;return db[_0x5525('0x47')]['findOne']({'where':{'id':_0x34af6f[_0x5525('0x46')]['id']}})['then'](handleEntityNotFound(_0x340edb,null))[_0x5525('0x2a')](function(_0x4e0dfd){if(_0x4e0dfd){_0x28b0d8=_0x4e0dfd[_0x5525('0x58')]({'plain':!![]});_0x5204fc[_0x5525('0x33')]=_[_0x5525('0x35')](db[_0x5525('0x59')][_0x5525('0x48')]);_0x5204fc['query']=_[_0x5525('0x35')](_0x34af6f[_0x5525('0x34')]);_0x5204fc[_0x5525('0x36')]=_[_0x5525('0x37')](_0x5204fc[_0x5525('0x33')],_0x5204fc[_0x5525('0x34')]);_0x23ae0c['attributes']=_[_0x5525('0x37')](_0x5204fc[_0x5525('0x33')],qs[_0x5525('0x38')](_0x34af6f['query']['fields']));_0x23ae0c[_0x5525('0x39')]=_0x23ae0c[_0x5525('0x39')]['length']?_0x23ae0c[_0x5525('0x39')]:_0x5204fc[_0x5525('0x33')];if(!_0x34af6f[_0x5525('0x34')][_0x5525('0x3b')]('nolimit')){_0x23ae0c['limit']=qs[_0x5525('0x22')](_0x34af6f[_0x5525('0x34')][_0x5525('0x22')]);_0x23ae0c[_0x5525('0x21')]=qs[_0x5525('0x21')](_0x34af6f[_0x5525('0x34')][_0x5525('0x21')]);}_0x23ae0c['order']=qs[_0x5525('0x3c')](_0x34af6f[_0x5525('0x34')][_0x5525('0x3c')]);_0x23ae0c['where']=qs[_0x5525('0x36')](_[_0x5525('0x3e')](_0x34af6f[_0x5525('0x34')],_0x5204fc[_0x5525('0x36')]));_0x23ae0c[_0x5525('0x3d')][_0x5525('0x5a')]=_0x4e0dfd['id'];if(_0x34af6f[_0x5525('0x34')][_0x5525('0x41')]){_0x23ae0c[_0x5525('0x3d')]=_['merge'](_0x23ae0c[_0x5525('0x3d')],{'$or':_[_0x5525('0x2f')](_0x23ae0c[_0x5525('0x39')],function(_0x345ffd){var _0x3c24e9={};_0x3c24e9[_0x345ffd]={'$like':'%'+_0x34af6f['query'][_0x5525('0x41')]+'%'};return _0x3c24e9;})});}_0x23ae0c=_[_0x5525('0x3f')]({},_0x23ae0c,_0x34af6f[_0x5525('0x49')]);return db[_0x5525('0x59')][_0x5525('0x5b')](_0x23ae0c);}})['then'](function(_0x5e557a){if(_0x5e557a){return db[_0x5525('0x5c')]['findAndCountAll']({'where':{'id':_[_0x5525('0x2f')](_0x5e557a,_0x5525('0x5d')),'role':_0x5525('0x5e')},'attributes':['id',_0x5525('0x2d'),_0x5525('0x5f'),_0x5525('0x60'),_0x5525('0x61')]});}})['then'](function(_0x16789a){if(_0x16789a){return{'count':_0x16789a[_0x5525('0x20')],'rows':_['map'](_0x16789a[_0x5525('0x44')],function(_0x45e017){return{'membername':_0x45e017[_0x5525('0x2d')],'UserId':_0x45e017['id'],'queue_name':_0x28b0d8[_0x5525('0x2d')],'WhatsappQueueId':_0x28b0d8['id'],'interface':util[_0x5525('0x62')]('%s/%s',_0x5525('0x63'),_0x45e017[_0x5525('0x2d')]),'penalty':0x0,'paused':_0x45e017['whatsappPause'],'createdAt':_0x45e017[_0x5525('0x61')],'updatedAt':_0x45e017[_0x5525('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x340edb,_0x23ae0c))['catch'](handleError(_0x340edb,null));};exports[_0x5525('0x64')]=function(_0x5f19c2,_0x52b2ed,_0x2374c5){var _0x5b542b={};var _0x2b80b0={};var _0x30d5b4;var _0x182f88;return db[_0x5525('0x47')]['findOne']({'where':{'id':_0x5f19c2[_0x5525('0x46')]['id']}})[_0x5525('0x2a')](handleEntityNotFound(_0x52b2ed,null))[_0x5525('0x2a')](function(_0x588c04){if(_0x588c04){_0x30d5b4=_0x588c04;_0x2b80b0[_0x5525('0x33')]=_[_0x5525('0x35')](db[_0x5525('0x65')][_0x5525('0x48')]);_0x2b80b0[_0x5525('0x34')]=_['keys'](_0x5f19c2[_0x5525('0x34')]);_0x2b80b0[_0x5525('0x36')]=_[_0x5525('0x37')](_0x2b80b0[_0x5525('0x33')],_0x2b80b0['query']);_0x5b542b[_0x5525('0x39')]=_[_0x5525('0x37')](_0x2b80b0[_0x5525('0x33')],qs['fields'](_0x5f19c2[_0x5525('0x34')][_0x5525('0x38')]));_0x5b542b[_0x5525('0x39')]=_0x5b542b[_0x5525('0x39')][_0x5525('0x3a')]?_0x5b542b[_0x5525('0x39')]:_0x2b80b0[_0x5525('0x33')];_0x5b542b[_0x5525('0x66')]=qs[_0x5525('0x3c')](_0x5f19c2[_0x5525('0x34')][_0x5525('0x3c')]);_0x5b542b[_0x5525('0x3d')]=qs[_0x5525('0x36')](_[_0x5525('0x3e')](_0x5f19c2[_0x5525('0x34')],_0x2b80b0[_0x5525('0x36')]));if(_0x5f19c2[_0x5525('0x34')][_0x5525('0x41')]){_0x5b542b[_0x5525('0x3d')]=_[_0x5525('0x3f')](_0x5b542b[_0x5525('0x3d')],{'$or':_[_0x5525('0x2f')](_0x5b542b[_0x5525('0x39')],function(_0x235d5f){var _0x2035b4={};_0x2035b4[_0x235d5f]={'$like':'%'+_0x5f19c2[_0x5525('0x34')]['filter']+'%'};return _0x2035b4;})});}_0x5b542b=_['merge']({},_0x5b542b,_0x5f19c2['options']);return _0x30d5b4[_0x5525('0x64')](_0x5b542b);}})['then'](function(_0x5f3597){if(_0x5f3597){_0x182f88=_0x5f3597[_0x5525('0x3a')];if(!_0x5f19c2[_0x5525('0x34')][_0x5525('0x3b')](_0x5525('0x67'))){_0x5b542b[_0x5525('0x22')]=qs[_0x5525('0x22')](_0x5f19c2[_0x5525('0x34')][_0x5525('0x22')]);_0x5b542b['offset']=qs[_0x5525('0x21')](_0x5f19c2[_0x5525('0x34')]['offset']);}return _0x30d5b4[_0x5525('0x64')](_0x5b542b);}})[_0x5525('0x2a')](function(_0x4a6829){if(_0x4a6829){return _0x4a6829?{'count':_0x182f88,'rows':_0x4a6829}:null;}})['then'](respondWithResult(_0x52b2ed,null))['catch'](handleError(_0x52b2ed,null));};exports['addTeams']=function(_0x30e861,_0x2b9fae,_0x2f3103){var _0x7cc52=_0x30e861[_0x5525('0x4d')][_0x5525('0x68')];return db[_0x5525('0x65')][_0x5525('0x5b')]({'where':{'id':_0x7cc52},'attributes':['id'],'include':[{'model':db[_0x5525('0x5c')],'as':_0x5525('0x69'),'attributes':['id',_0x5525('0x2d'),_0x5525('0x6a'),'voicePause',_0x5525('0x6b')],'raw':!![]}]})[_0x5525('0x2a')](function(_0x1697f0){if(_0x1697f0){var _0x30e5ad=_[_0x5525('0x6c')](_0x1697f0,function(_0x196dba){var _0x61f132=_0x196dba['get']({'plain':!![]});return _0x61f132[_0x5525('0x69')];});return db[_0x5525('0x47')][_0x5525('0x4a')]({'where':{'id':_0x30e861['params']['id']}})[_0x5525('0x2a')](function(_0x5863ce){return db[_0x5525('0x6d')][_0x5525('0x6e')](function(_0x58bc36){return _0x5863ce[_0x5525('0x6f')](_0x7cc52,{'transaction':_0x58bc36})[_0x5525('0x2a')](function(){return BPromise[_0x5525('0x70')](_0x30e5ad,function(_0x30ebf9){return db['UserWhatsappQueue'][_0x5525('0x71')]({'where':{'UserId':_0x30ebf9['id'],'WhatsappQueueId':_0x30e861[_0x5525('0x46')]['id']},'transaction':_0x58bc36});});})['then'](function(){_0x30e5ad[_0x5525('0x72')](function(_0x1a62d1){socket[_0x5525('0x73')](_0x5525('0x74'),{'UserId':_0x1a62d1['id'],'WhatsappQueueId':_0x5863ce['id']});});});});});}})[_0x5525('0x2a')](respondWithStatusCode(_0x2b9fae,null))[_0x5525('0x4b')](handleError(_0x2b9fae,null));};exports[_0x5525('0x75')]=function(_0x2184fc,_0x139754,_0x460d85){return db[_0x5525('0x65')][_0x5525('0x5b')]({'where':{'id':_0x2184fc[_0x5525('0x34')][_0x5525('0x68')]},'attributes':['id'],'include':[{'model':db[_0x5525('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5525('0x2a')](handleEntityNotFound(_0x139754,null))['then'](function(_0x5717c4){var _0x2fdb36=_['map'](_0x5717c4,'id');var _0xbedbaa=[];var _0x31b451=[];var _0x2defa3=squel[_0x5525('0x76')]();_0x2defa3[_0x5525('0x77')](_0x5525('0x78'))[_0x5525('0x79')]('team_has_whatsapp_queues','tq')[_0x5525('0x7a')]('user_has_teams','ut',_0x5525('0x7b'))[_0x5525('0x3d')](_0x5525('0x7c'),_0x2184fc[_0x5525('0x46')]['id']);for(var _0x1e789b=0x0;_0x1e789b<_0x5717c4[_0x5525('0x3a')];_0x1e789b+=0x1){let _0x408c74=_0x5717c4[_0x1e789b];for(var _0xbaff93=0x0;_0xbaff93<_0x408c74[_0x5525('0x69')][_0x5525('0x3a')];_0xbaff93+=0x1){let _0x10dec0=_0x408c74[_0x5525('0x69')][_0xbaff93];var _0x56833b=_0x2defa3[_0x5525('0x7d')]();_0x56833b['where'](_0x5525('0x7e'),_0x10dec0['id']);_0x31b451[_0x5525('0x7f')](db[_0x5525('0x6d')][_0x5525('0x34')](_0x56833b[_0x5525('0x80')](),{'type':db[_0x5525('0x6d')]['QueryTypes']['SELECT']})[_0x5525('0x2a')](function(_0x478c75){if(_0x478c75[_0x5525('0x3a')]===0x1){return _0x10dec0['id'];}else{var _0x2c083a=_[_0x5525('0x81')](_[_0x5525('0x2f')](_0x478c75,_0x5525('0x82')),function(_0x1aeb28){return _[_0x5525('0x83')](_0x2fdb36,_0x1aeb28);});if(_0x2c083a){return _0x10dec0['id'];}}}));}}return BPromise[_0x5525('0x84')](_0x31b451)[_0x5525('0x2a')](function(_0x1bcb6d){_0xbedbaa=_(_0xbedbaa)[_0x5525('0x85')](_0x1bcb6d)[_0x5525('0x86')]()[_0x5525('0x87')]();return db[_0x5525('0x47')]['find']({'where':{'id':_0x2184fc[_0x5525('0x46')]['id']}})[_0x5525('0x2a')](function(_0x54e9ce){return db['sequelize'][_0x5525('0x6e')](function(_0x16e917){return _0x54e9ce['removeTeams'](_0x2184fc[_0x5525('0x34')][_0x5525('0x68')],{'transaction':_0x16e917})['then'](function(){if(!_[_0x5525('0x88')](_0xbedbaa)){return _0x54e9ce[_0x5525('0x89')](_0xbedbaa,{'transaction':_0x16e917});}})['then'](function(){_0xbedbaa[_0x5525('0x72')](function(_0x46f4a7){socket[_0x5525('0x73')](_0x5525('0x8a'),{'UserId':_0x46f4a7,'WhatsappQueueId':_0x54e9ce['id']});});});});});});})['then'](respondWithStatusCode(_0x139754,null))[_0x5525('0x4b')](handleError(_0x139754,null));};exports[_0x5525('0x8b')]=function(_0x287099,_0x896774,_0x2b4320){return db[_0x5525('0x47')]['find']({'where':{'id':_0x287099[_0x5525('0x46')]['id']}})['then'](handleEntityNotFound(_0x896774,null))[_0x5525('0x2a')](function(_0x4eb14d){if(_0x4eb14d){return _0x4eb14d['addAgents'](_0x287099[_0x5525('0x4d')][_0x5525('0x68')],_['omit'](_0x287099[_0x5525('0x4d')],[_0x5525('0x68'),'id'])||{})[_0x5525('0x8c')](function(_0x4bf4b9){for(var _0xf066ed=0x0;_0xf066ed<_0x287099[_0x5525('0x4d')]['ids']['length'];_0xf066ed+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':_0x287099[_0x5525('0x4d')][_0x5525('0x68')][_0xf066ed],'WhatsappQueueId':_0x287099[_0x5525('0x46')]['id']});}return _0x4bf4b9;});}})['then'](respondWithResult(_0x896774,null))['catch'](handleError(_0x896774,null));};exports[_0x5525('0x89')]=function(_0x340656,_0x465596,_0x57e952){return db['WhatsappQueue']['find']({'where':{'id':_0x340656[_0x5525('0x46')]['id']}})[_0x5525('0x2a')](handleEntityNotFound(_0x465596,null))[_0x5525('0x2a')](function(_0x505427){if(_0x505427){return _0x505427[_0x5525('0x89')](_0x340656[_0x5525('0x34')]['ids'])[_0x5525('0x2a')](function(){if(_['isArray'](_0x340656[_0x5525('0x34')]['ids'])){for(var _0x51d1fb=0x0;_0x51d1fb<_0x340656['query']['ids'][_0x5525('0x3a')];_0x51d1fb+=0x1){socket[_0x5525('0x73')](_0x5525('0x8a'),{'UserId':Number(_0x340656[_0x5525('0x34')][_0x5525('0x68')][_0x51d1fb]),'WhatsappQueueId':Number(_0x340656[_0x5525('0x46')]['id'])});}}else{socket[_0x5525('0x73')](_0x5525('0x8a'),{'UserId':Number(_0x340656[_0x5525('0x34')]['ids']),'WhatsappQueueId':Number(_0x340656[_0x5525('0x46')]['id'])});}});}})[_0x5525('0x2a')](respondWithStatusCode(_0x465596,null))[_0x5525('0x4b')](handleError(_0x465596,null));};exports['getAgents']=function(_0x4f5311,_0x345fe7,_0x158aef){var _0x1c5bc9={};var _0x92a816={};var _0x31fec4;var _0x433da2;return db[_0x5525('0x47')][_0x5525('0x8d')]({'where':{'id':_0x4f5311[_0x5525('0x46')]['id']}})[_0x5525('0x2a')](handleEntityNotFound(_0x345fe7,null))[_0x5525('0x2a')](function(_0x35c925){if(_0x35c925){_0x31fec4=_0x35c925;_0x92a816[_0x5525('0x33')]=_['keys'](db[_0x5525('0x5c')][_0x5525('0x48')]);_0x92a816[_0x5525('0x34')]=_[_0x5525('0x35')](_0x4f5311['query']);_0x92a816[_0x5525('0x36')]=_[_0x5525('0x37')](_0x92a816[_0x5525('0x33')],_0x92a816['query']);_0x1c5bc9['attributes']=_[_0x5525('0x37')](_0x92a816[_0x5525('0x33')],qs[_0x5525('0x38')](_0x4f5311[_0x5525('0x34')][_0x5525('0x38')]));_0x1c5bc9[_0x5525('0x39')]=_0x1c5bc9[_0x5525('0x39')][_0x5525('0x3a')]?_0x1c5bc9['attributes']:_0x92a816[_0x5525('0x33')];_0x1c5bc9[_0x5525('0x66')]=qs[_0x5525('0x3c')](_0x4f5311['query']['sort']);_0x1c5bc9[_0x5525('0x3d')]=qs[_0x5525('0x36')](_[_0x5525('0x3e')](_0x4f5311[_0x5525('0x34')],_0x92a816['filters']));if(_0x4f5311[_0x5525('0x34')]['filter']){_0x1c5bc9[_0x5525('0x3d')]=_['merge'](_0x1c5bc9[_0x5525('0x3d')],{'$or':_['map'](_0x1c5bc9[_0x5525('0x39')],function(_0x3abe68){var _0x32ac41={};_0x32ac41[_0x3abe68]={'$like':'%'+_0x4f5311['query'][_0x5525('0x41')]+'%'};return _0x32ac41;})});}_0x1c5bc9=_[_0x5525('0x3f')]({},_0x1c5bc9,_0x4f5311[_0x5525('0x49')]);return _0x31fec4[_0x5525('0x8e')](_0x1c5bc9);}})[_0x5525('0x2a')](function(_0x91eef9){if(_0x91eef9){_0x433da2=_0x91eef9['length'];if(!_0x4f5311[_0x5525('0x34')][_0x5525('0x3b')]('nolimit')){_0x1c5bc9[_0x5525('0x22')]=qs[_0x5525('0x22')](_0x4f5311[_0x5525('0x34')][_0x5525('0x22')]);_0x1c5bc9[_0x5525('0x21')]=qs[_0x5525('0x21')](_0x4f5311['query'][_0x5525('0x21')]);}return _0x31fec4['getAgents'](_0x1c5bc9);}})[_0x5525('0x2a')](function(_0x238bfc){if(_0x238bfc){return _0x238bfc?{'count':_0x433da2,'rows':_0x238bfc}:null;}})['then'](respondWithResult(_0x345fe7,null))[_0x5525('0x4b')](handleError(_0x345fe7,null));};
\ No newline at end of file
+var _0x597c=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','updatedAt','format','%s/%s','SIP','whatsappPause','Team','getTeams','addTeams','Agents','voicePause','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','select','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','ids','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','getAgents','order','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','options','WhatsappQueue','includeAll','findAll','rows','catch','show','params','keys','include','find','create'];(function(_0x497726,_0x1e677d){var _0xeeed56=function(_0x19f744){while(--_0x19f744){_0x497726['push'](_0x497726['shift']());}};_0xeeed56(++_0x1e677d);}(_0x597c,0x1da));var _0xc597=function(_0x24161f,_0x15e548){_0x24161f=_0x24161f-0x0;var _0xd5c281=_0x597c[_0x24161f];return _0xd5c281;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc597('0x0'));var rimraf=require(_0xc597('0x1'));var zipdir=require(_0xc597('0x2'));var jsonpatch=require(_0xc597('0x3'));var rp=require('request-promise');var moment=require(_0xc597('0x4'));var BPromise=require(_0xc597('0x5'));var Mustache=require(_0xc597('0x6'));var util=require(_0xc597('0x7'));var path=require(_0xc597('0x8'));var sox=require(_0xc597('0x9'));var csv=require(_0xc597('0xa'));var ejs=require(_0xc597('0xb'));var fs=require('fs');var _=require(_0xc597('0xc'));var squel=require(_0xc597('0xd'));var crypto=require(_0xc597('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc597('0xf'));var toCsv=require(_0xc597('0xa'));var querystring=require('querystring');var Papa=require(_0xc597('0x10'));var Redis=require(_0xc597('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc597('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc597('0x13'));var logger=require(_0xc597('0x14'))('api');var utils=require(_0xc597('0x15'));var config=require(_0xc597('0x16'));var db=require('../../mysqldb')['db'];config[_0xc597('0x17')]=_[_0xc597('0x18')](config[_0xc597('0x17')],{'host':_0xc597('0x19'),'port':0x18eb});var socket=require(_0xc597('0x1a'))(new Redis(config[_0xc597('0x17')]));require(_0xc597('0x1b'))[_0xc597('0x1c')](socket);function respondWithStatusCode(_0x401324,_0x23a6e4){_0x23a6e4=_0x23a6e4||0xcc;return function(_0xb2aa35){if(_0xb2aa35){return _0x401324[_0xc597('0x1d')](_0x23a6e4);}return _0x401324[_0xc597('0x1e')](_0x23a6e4)[_0xc597('0x1f')]();};}function respondWithResult(_0x27711c,_0x488c7c){_0x488c7c=_0x488c7c||0xc8;return function(_0x1edd56){if(_0x1edd56){return _0x27711c[_0xc597('0x1e')](_0x488c7c)[_0xc597('0x20')](_0x1edd56);}};}function respondWithFilteredResult(_0x383c03,_0x228ab0){return function(_0x36dde5){if(_0x36dde5){var _0x3cb14a=_0x36dde5[_0xc597('0x21')],_0x46484a=_0x228ab0[_0xc597('0x22')],_0x2a4096=_0x228ab0[_0xc597('0x22')]+_0x228ab0['limit'],_0x124997;if(_0x2a4096>=_0x3cb14a){_0x2a4096=_0x3cb14a;_0x124997=0xc8;}else{_0x124997=0xce;}_0x383c03[_0xc597('0x1e')](_0x124997);return _0x383c03[_0xc597('0x23')]('Content-Range',_0x46484a+'-'+_0x2a4096+'/'+_0x3cb14a)['json'](_0x36dde5);}return null;};}function patchUpdates(_0x22f66d){return function(_0x9cf5ea){try{jsonpatch[_0xc597('0x24')](_0x9cf5ea,_0x22f66d,!![]);}catch(_0x8a3dd2){return BPromise['reject'](_0x8a3dd2);}return _0x9cf5ea[_0xc597('0x25')]();};}function saveUpdates(_0x5801ac,_0x3f449a){return function(_0x3c81f0){if(_0x3c81f0){return _0x3c81f0[_0xc597('0x26')](_0x5801ac)[_0xc597('0x27')](function(_0x544768){return _0x544768;});}return null;};}function removeEntity(_0x9312e0,_0x5ddc2d){return function(_0x5322e6){if(_0x5322e6){return _0x5322e6[_0xc597('0x28')]()[_0xc597('0x27')](function(){var _0x37660a=_0x5322e6[_0xc597('0x29')]({'plain':!![]});var _0xf1d31a=_0xc597('0x2a');return db[_0xc597('0x2b')][_0xc597('0x28')]({'where':{'type':_0xf1d31a,'resourceId':_0x37660a['id']}})[_0xc597('0x27')](function(){return _0x5322e6;});})[_0xc597('0x27')](function(){_0x9312e0[_0xc597('0x1e')](0xcc)[_0xc597('0x1f')]();});}};}function handleEntityNotFound(_0x109d9a,_0x9c29d3){return function(_0x4d0791){if(!_0x4d0791){_0x109d9a['sendStatus'](0x194);}return _0x4d0791;};}function handleError(_0x187ed6,_0x4b21b4){_0x4b21b4=_0x4b21b4||0x1f4;return function(_0x5c7218){logger[_0xc597('0x2c')](_0x5c7218['stack']);if(_0x5c7218['name']){delete _0x5c7218[_0xc597('0x2d')];}_0x187ed6[_0xc597('0x1e')](_0x4b21b4)[_0xc597('0x2e')](_0x5c7218);};}exports[_0xc597('0x2f')]=function(_0x3cdcea,_0x322ed7){var _0x228444={},_0x5d796a={},_0x394800={'count':0x0,'rows':[]};var _0x2a948e=_[_0xc597('0x30')](db['WhatsappQueue'][_0xc597('0x31')],function(_0xdc878e){return{'name':_0xdc878e[_0xc597('0x32')],'type':_0xdc878e[_0xc597('0x33')]['key']};});_0x5d796a[_0xc597('0x34')]=_[_0xc597('0x30')](_0x2a948e,_0xc597('0x2d'));_0x5d796a[_0xc597('0x35')]=_['keys'](_0x3cdcea['query']);_0x5d796a[_0xc597('0x36')]=_[_0xc597('0x37')](_0x5d796a[_0xc597('0x34')],_0x5d796a[_0xc597('0x35')]);_0x228444[_0xc597('0x38')]=_[_0xc597('0x37')](_0x5d796a[_0xc597('0x34')],qs['fields'](_0x3cdcea[_0xc597('0x35')][_0xc597('0x39')]));_0x228444[_0xc597('0x38')]=_0x228444[_0xc597('0x38')][_0xc597('0x3a')]?_0x228444[_0xc597('0x38')]:_0x5d796a[_0xc597('0x34')];if(!_0x3cdcea[_0xc597('0x35')][_0xc597('0x3b')]('nolimit')){_0x228444[_0xc597('0x3c')]=qs[_0xc597('0x3c')](_0x3cdcea[_0xc597('0x35')][_0xc597('0x3c')]);_0x228444[_0xc597('0x22')]=qs['offset'](_0x3cdcea[_0xc597('0x35')][_0xc597('0x22')]);}_0x228444['order']=qs['sort'](_0x3cdcea[_0xc597('0x35')][_0xc597('0x3d')]);_0x228444[_0xc597('0x3e')]=qs[_0xc597('0x36')](_[_0xc597('0x3f')](_0x3cdcea[_0xc597('0x35')],_0x5d796a['filters']),_0x2a948e);if(_0x3cdcea[_0xc597('0x35')][_0xc597('0x40')]){_0x228444[_0xc597('0x3e')]=_['merge'](_0x228444[_0xc597('0x3e')],{'$or':_[_0xc597('0x30')](_0x2a948e,function(_0x2168b4){if(_0x2168b4[_0xc597('0x33')]!=='VIRTUAL'){var _0x44fd16={};_0x44fd16[_0x2168b4[_0xc597('0x2d')]]={'$like':'%'+_0x3cdcea[_0xc597('0x35')][_0xc597('0x40')]+'%'};return _0x44fd16;}})});}_0x228444=_[_0xc597('0x41')]({},_0x228444,_0x3cdcea[_0xc597('0x42')]);var _0x3c3fce={'where':_0x228444[_0xc597('0x3e')]};return db[_0xc597('0x43')]['count'](_0x3c3fce)[_0xc597('0x27')](function(_0x157e9b){_0x394800[_0xc597('0x21')]=_0x157e9b;if(_0x3cdcea[_0xc597('0x35')][_0xc597('0x44')]){_0x228444['include']=[{'all':!![]}];}return db[_0xc597('0x43')][_0xc597('0x45')](_0x228444);})[_0xc597('0x27')](function(_0x1d4974){_0x394800[_0xc597('0x46')]=_0x1d4974;return _0x394800;})[_0xc597('0x27')](respondWithFilteredResult(_0x322ed7,_0x228444))[_0xc597('0x47')](handleError(_0x322ed7,null));};exports[_0xc597('0x48')]=function(_0x569ba0,_0x257a34){var _0x4f30bf={'raw':!![],'where':{'id':_0x569ba0[_0xc597('0x49')]['id']}},_0x5a528d={};_0x5a528d['model']=_[_0xc597('0x4a')](db['WhatsappQueue']['rawAttributes']);_0x5a528d[_0xc597('0x35')]=_[_0xc597('0x4a')](_0x569ba0['query']);_0x5a528d['filters']=_[_0xc597('0x37')](_0x5a528d[_0xc597('0x34')],_0x5a528d[_0xc597('0x35')]);_0x4f30bf[_0xc597('0x38')]=_[_0xc597('0x37')](_0x5a528d[_0xc597('0x34')],qs[_0xc597('0x39')](_0x569ba0[_0xc597('0x35')][_0xc597('0x39')]));_0x4f30bf[_0xc597('0x38')]=_0x4f30bf[_0xc597('0x38')][_0xc597('0x3a')]?_0x4f30bf[_0xc597('0x38')]:_0x5a528d[_0xc597('0x34')];if(_0x569ba0['query'][_0xc597('0x44')]){_0x4f30bf[_0xc597('0x4b')]=[{'all':!![]}];}_0x4f30bf=_['merge']({},_0x4f30bf,_0x569ba0[_0xc597('0x42')]);return db[_0xc597('0x43')][_0xc597('0x4c')](_0x4f30bf)[_0xc597('0x27')](handleEntityNotFound(_0x257a34,null))[_0xc597('0x27')](respondWithResult(_0x257a34,null))[_0xc597('0x47')](handleError(_0x257a34,null));};exports[_0xc597('0x4d')]=function(_0x1434ad,_0x22c11e){return db[_0xc597('0x43')][_0xc597('0x4d')](_0x1434ad['body'],{})[_0xc597('0x27')](function(_0x2ffddf){var _0x3664c8=_0x1434ad[_0xc597('0x4e')][_0xc597('0x29')]({'plain':!![]});if(!_0x3664c8)throw new Error(_0xc597('0x4f'));if(_0x3664c8[_0xc597('0x50')]==='user'){var _0xb50457=_0x2ffddf[_0xc597('0x29')]({'plain':!![]});var _0x470d8a='WhatsappQueues';return db[_0xc597('0x51')]['find']({'where':{'name':_0x470d8a,'userProfileId':_0x3664c8[_0xc597('0x52')]},'raw':!![]})[_0xc597('0x27')](function(_0xcc5d58){if(_0xcc5d58&&_0xcc5d58[_0xc597('0x53')]===0x0){return db[_0xc597('0x2b')][_0xc597('0x4d')]({'name':_0xb50457['name'],'resourceId':_0xb50457['id'],'type':_0xcc5d58[_0xc597('0x2d')],'sectionId':_0xcc5d58['id']},{})[_0xc597('0x27')](function(){return _0x2ffddf;});}else{return _0x2ffddf;}})[_0xc597('0x47')](function(_0x29d452){logger[_0xc597('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29d452);throw _0x29d452;});}return _0x2ffddf;})[_0xc597('0x27')](respondWithResult(_0x22c11e,0xc9))[_0xc597('0x47')](handleError(_0x22c11e,null));};exports[_0xc597('0x26')]=function(_0x6208e3,_0x295632){if(_0x6208e3['body']['id']){delete _0x6208e3[_0xc597('0x54')]['id'];}return db['WhatsappQueue'][_0xc597('0x4c')]({'where':{'id':_0x6208e3[_0xc597('0x49')]['id']}})[_0xc597('0x27')](handleEntityNotFound(_0x295632,null))[_0xc597('0x27')](saveUpdates(_0x6208e3['body'],null))[_0xc597('0x27')](respondWithResult(_0x295632,null))['catch'](handleError(_0x295632,null));};exports[_0xc597('0x28')]=function(_0xacf1b7,_0x2c9e00){return db['WhatsappQueue'][_0xc597('0x4c')]({'where':{'id':_0xacf1b7[_0xc597('0x49')]['id']}})[_0xc597('0x27')](handleEntityNotFound(_0x2c9e00,null))[_0xc597('0x27')](removeEntity(_0x2c9e00,null))[_0xc597('0x47')](handleError(_0x2c9e00,null));};exports['describe']=function(_0x25aefa,_0x890a2c){return db[_0xc597('0x43')][_0xc597('0x55')]()[_0xc597('0x27')](respondWithResult(_0x890a2c,null))[_0xc597('0x47')](handleError(_0x890a2c,null));};exports[_0xc597('0x56')]=function(_0x40c124,_0x290c35,_0x32ee67){var _0x499e19={'raw':!![],'where':{}},_0x59db6b={},_0x1aa967;return db[_0xc597('0x43')][_0xc597('0x57')]({'where':{'id':_0x40c124['params']['id']}})['then'](handleEntityNotFound(_0x290c35,null))[_0xc597('0x27')](function(_0x4fd6fd){if(_0x4fd6fd){_0x1aa967=_0x4fd6fd[_0xc597('0x29')]({'plain':!![]});_0x59db6b['model']=_[_0xc597('0x4a')](db[_0xc597('0x58')][_0xc597('0x31')]);_0x59db6b[_0xc597('0x35')]=_[_0xc597('0x4a')](_0x40c124['query']);_0x59db6b[_0xc597('0x36')]=_['intersection'](_0x59db6b[_0xc597('0x34')],_0x59db6b['query']);_0x499e19[_0xc597('0x38')]=_[_0xc597('0x37')](_0x59db6b['model'],qs[_0xc597('0x39')](_0x40c124[_0xc597('0x35')]['fields']));_0x499e19[_0xc597('0x38')]=_0x499e19[_0xc597('0x38')][_0xc597('0x3a')]?_0x499e19['attributes']:_0x59db6b[_0xc597('0x34')];if(!_0x40c124[_0xc597('0x35')][_0xc597('0x3b')](_0xc597('0x59'))){_0x499e19[_0xc597('0x3c')]=qs['limit'](_0x40c124[_0xc597('0x35')]['limit']);_0x499e19[_0xc597('0x22')]=qs[_0xc597('0x22')](_0x40c124['query']['offset']);}_0x499e19['order']=qs[_0xc597('0x3d')](_0x40c124[_0xc597('0x35')][_0xc597('0x3d')]);_0x499e19[_0xc597('0x3e')]=qs['filters'](_[_0xc597('0x3f')](_0x40c124[_0xc597('0x35')],_0x59db6b[_0xc597('0x36')]));_0x499e19['where'][_0xc597('0x5a')]=_0x4fd6fd['id'];if(_0x40c124['query'][_0xc597('0x40')]){_0x499e19[_0xc597('0x3e')]=_[_0xc597('0x41')](_0x499e19['where'],{'$or':_[_0xc597('0x30')](_0x499e19[_0xc597('0x38')],function(_0x11d8bb){var _0x134d9e={};_0x134d9e[_0x11d8bb]={'$like':'%'+_0x40c124[_0xc597('0x35')][_0xc597('0x40')]+'%'};return _0x134d9e;})});}_0x499e19=_[_0xc597('0x41')]({},_0x499e19,_0x40c124[_0xc597('0x42')]);return db[_0xc597('0x58')][_0xc597('0x45')](_0x499e19);}})[_0xc597('0x27')](function(_0x11b013){if(_0x11b013){return db[_0xc597('0x5b')][_0xc597('0x5c')]({'where':{'id':_[_0xc597('0x30')](_0x11b013,_0xc597('0x5d')),'role':'agent'},'attributes':['id',_0xc597('0x2d'),'whatsappPause',_0xc597('0x5e'),'createdAt']});}})['then'](function(_0x22b467){if(_0x22b467){return{'count':_0x22b467[_0xc597('0x21')],'rows':_[_0xc597('0x30')](_0x22b467[_0xc597('0x46')],function(_0x28e6eb){return{'membername':_0x28e6eb[_0xc597('0x2d')],'UserId':_0x28e6eb['id'],'queue_name':_0x1aa967[_0xc597('0x2d')],'WhatsappQueueId':_0x1aa967['id'],'interface':util[_0xc597('0x5f')](_0xc597('0x60'),_0xc597('0x61'),_0x28e6eb[_0xc597('0x2d')]),'penalty':0x0,'paused':_0x28e6eb[_0xc597('0x62')],'createdAt':_0x28e6eb['createdAt'],'updatedAt':_0x28e6eb[_0xc597('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc597('0x27')](respondWithFilteredResult(_0x290c35,_0x499e19))['catch'](handleError(_0x290c35,null));};exports['getTeams']=function(_0x3636b2,_0x17f84f,_0x182724){var _0x2597dc={};var _0x3e8f74={};var _0x52f3ed;var _0x432c03;return db[_0xc597('0x43')][_0xc597('0x57')]({'where':{'id':_0x3636b2['params']['id']}})['then'](handleEntityNotFound(_0x17f84f,null))[_0xc597('0x27')](function(_0x13903f){if(_0x13903f){_0x52f3ed=_0x13903f;_0x3e8f74[_0xc597('0x34')]=_['keys'](db[_0xc597('0x63')][_0xc597('0x31')]);_0x3e8f74[_0xc597('0x35')]=_['keys'](_0x3636b2[_0xc597('0x35')]);_0x3e8f74[_0xc597('0x36')]=_[_0xc597('0x37')](_0x3e8f74[_0xc597('0x34')],_0x3e8f74[_0xc597('0x35')]);_0x2597dc[_0xc597('0x38')]=_['intersection'](_0x3e8f74[_0xc597('0x34')],qs['fields'](_0x3636b2['query'][_0xc597('0x39')]));_0x2597dc['attributes']=_0x2597dc[_0xc597('0x38')][_0xc597('0x3a')]?_0x2597dc['attributes']:_0x3e8f74[_0xc597('0x34')];_0x2597dc['order']=qs['sort'](_0x3636b2[_0xc597('0x35')]['sort']);_0x2597dc[_0xc597('0x3e')]=qs[_0xc597('0x36')](_[_0xc597('0x3f')](_0x3636b2[_0xc597('0x35')],_0x3e8f74['filters']));if(_0x3636b2[_0xc597('0x35')][_0xc597('0x40')]){_0x2597dc[_0xc597('0x3e')]=_[_0xc597('0x41')](_0x2597dc['where'],{'$or':_['map'](_0x2597dc[_0xc597('0x38')],function(_0x3f59a5){var _0x363272={};_0x363272[_0x3f59a5]={'$like':'%'+_0x3636b2[_0xc597('0x35')][_0xc597('0x40')]+'%'};return _0x363272;})});}_0x2597dc=_[_0xc597('0x41')]({},_0x2597dc,_0x3636b2[_0xc597('0x42')]);return _0x52f3ed[_0xc597('0x64')](_0x2597dc);}})[_0xc597('0x27')](function(_0x540fd2){if(_0x540fd2){_0x432c03=_0x540fd2['length'];if(!_0x3636b2[_0xc597('0x35')][_0xc597('0x3b')](_0xc597('0x59'))){_0x2597dc['limit']=qs[_0xc597('0x3c')](_0x3636b2[_0xc597('0x35')]['limit']);_0x2597dc[_0xc597('0x22')]=qs[_0xc597('0x22')](_0x3636b2[_0xc597('0x35')]['offset']);}return _0x52f3ed[_0xc597('0x64')](_0x2597dc);}})[_0xc597('0x27')](function(_0x4f2db2){if(_0x4f2db2){return _0x4f2db2?{'count':_0x432c03,'rows':_0x4f2db2}:null;}})['then'](respondWithResult(_0x17f84f,null))[_0xc597('0x47')](handleError(_0x17f84f,null));};exports[_0xc597('0x65')]=function(_0x3d30d6,_0x40bf05,_0x182ca0){var _0x3fa272=_0x3d30d6[_0xc597('0x54')]['ids'];return db[_0xc597('0x63')][_0xc597('0x45')]({'where':{'id':_0x3fa272},'attributes':['id'],'include':[{'model':db[_0xc597('0x5b')],'as':_0xc597('0x66'),'attributes':['id',_0xc597('0x2d'),'online',_0xc597('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x30ec92){if(_0x30ec92){var _0x321444=_['flatMap'](_0x30ec92,function(_0x59ff61){var _0x53ddbf=_0x59ff61[_0xc597('0x29')]({'plain':!![]});return _0x53ddbf[_0xc597('0x66')];});return db['WhatsappQueue']['find']({'where':{'id':_0x3d30d6['params']['id']}})[_0xc597('0x27')](function(_0xb81ea9){return db[_0xc597('0x68')][_0xc597('0x69')](function(_0x234238){return _0xb81ea9[_0xc597('0x65')](_0x3fa272,{'transaction':_0x234238})['then'](function(){return BPromise[_0xc597('0x6a')](_0x321444,function(_0x3f4308){return db[_0xc597('0x58')]['findOrCreate']({'where':{'UserId':_0x3f4308['id'],'WhatsappQueueId':_0x3d30d6['params']['id']},'transaction':_0x234238});});})[_0xc597('0x27')](function(){_0x321444[_0xc597('0x6b')](function(_0x28f6b1){socket[_0xc597('0x6c')](_0xc597('0x6d'),{'UserId':_0x28f6b1['id'],'WhatsappQueueId':_0xb81ea9['id']});});});});});}})['then'](respondWithStatusCode(_0x40bf05,null))[_0xc597('0x47')](handleError(_0x40bf05,null));};exports['removeTeams']=function(_0xe4532a,_0x1bb6d9,_0x5936f4){return db[_0xc597('0x63')][_0xc597('0x45')]({'where':{'id':_0xe4532a['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xc597('0x5b')],'as':_0xc597('0x66'),'attributes':['id'],'raw':!![]}]})[_0xc597('0x27')](handleEntityNotFound(_0x1bb6d9,null))[_0xc597('0x27')](function(_0x3800f8){var _0x2a5067=_[_0xc597('0x30')](_0x3800f8,'id');var _0x2954ee=[];var _0xebe260=[];var _0x9d229e=squel[_0xc597('0x6e')]();_0x9d229e['field'](_0xc597('0x6f'))[_0xc597('0x70')](_0xc597('0x71'),'tq')['join'](_0xc597('0x72'),'ut',_0xc597('0x73'))[_0xc597('0x3e')](_0xc597('0x74'),_0xe4532a['params']['id']);for(var _0x4af9b6=0x0;_0x4af9b6<_0x3800f8['length'];_0x4af9b6+=0x1){let _0x1916ed=_0x3800f8[_0x4af9b6];for(var _0x6ed7b1=0x0;_0x6ed7b1<_0x1916ed['Agents'][_0xc597('0x3a')];_0x6ed7b1+=0x1){let _0xf9b1da=_0x1916ed[_0xc597('0x66')][_0x6ed7b1];var _0x5c0a34=_0x9d229e[_0xc597('0x75')]();_0x5c0a34[_0xc597('0x3e')](_0xc597('0x76'),_0xf9b1da['id']);_0xebe260[_0xc597('0x77')](db[_0xc597('0x68')][_0xc597('0x35')](_0x5c0a34[_0xc597('0x78')](),{'type':db[_0xc597('0x68')]['QueryTypes'][_0xc597('0x79')]})[_0xc597('0x27')](function(_0x51e7cd){if(_0x51e7cd['length']===0x1){return _0xf9b1da['id'];}else{var _0xc90393=_[_0xc597('0x7a')](_[_0xc597('0x30')](_0x51e7cd,_0xc597('0x7b')),function(_0x6ab43f){return _[_0xc597('0x7c')](_0x2a5067,_0x6ab43f);});if(_0xc90393){return _0xf9b1da['id'];}}}));}}return BPromise[_0xc597('0x7d')](_0xebe260)[_0xc597('0x27')](function(_0x3abe37){_0x2954ee=_(_0x2954ee)[_0xc597('0x7e')](_0x3abe37)[_0xc597('0x7f')]()[_0xc597('0x80')]();return db[_0xc597('0x43')][_0xc597('0x4c')]({'where':{'id':_0xe4532a[_0xc597('0x49')]['id']}})[_0xc597('0x27')](function(_0x7c14d5){return db['sequelize'][_0xc597('0x69')](function(_0x335e47){return _0x7c14d5[_0xc597('0x81')](_0xe4532a['query'][_0xc597('0x82')],{'transaction':_0x335e47})[_0xc597('0x27')](function(){if(!_[_0xc597('0x83')](_0x2954ee)){return _0x7c14d5[_0xc597('0x84')](_0x2954ee,{'transaction':_0x335e47});}})[_0xc597('0x27')](function(){_0x2954ee['forEach'](function(_0xf0a66b){socket[_0xc597('0x6c')](_0xc597('0x85'),{'UserId':_0xf0a66b,'WhatsappQueueId':_0x7c14d5['id']});});});});});});})[_0xc597('0x27')](respondWithStatusCode(_0x1bb6d9,null))[_0xc597('0x47')](handleError(_0x1bb6d9,null));};exports['addAgents']=function(_0x370467,_0x59b6a0,_0x2c64dd){return db['WhatsappQueue'][_0xc597('0x4c')]({'where':{'id':_0x370467[_0xc597('0x49')]['id']}})[_0xc597('0x27')](handleEntityNotFound(_0x59b6a0,null))[_0xc597('0x27')](function(_0x5b9c7d){if(_0x5b9c7d){return _0x5b9c7d[_0xc597('0x86')](_0x370467['body'][_0xc597('0x82')],_['omit'](_0x370467['body'],[_0xc597('0x82'),'id'])||{})[_0xc597('0x87')](function(_0x513407){for(var _0x14a6b6=0x0;_0x14a6b6<_0x370467['body'][_0xc597('0x82')][_0xc597('0x3a')];_0x14a6b6+=0x1){socket['emit'](_0xc597('0x6d'),{'UserId':_0x370467[_0xc597('0x54')][_0xc597('0x82')][_0x14a6b6],'WhatsappQueueId':_0x370467[_0xc597('0x49')]['id']});}return _0x513407;});}})[_0xc597('0x27')](respondWithResult(_0x59b6a0,null))[_0xc597('0x47')](handleError(_0x59b6a0,null));};exports[_0xc597('0x84')]=function(_0x23df6a,_0x407ffe,_0xef44a3){return db['WhatsappQueue'][_0xc597('0x4c')]({'where':{'id':_0x23df6a[_0xc597('0x49')]['id']}})[_0xc597('0x27')](handleEntityNotFound(_0x407ffe,null))[_0xc597('0x27')](function(_0x33b7c0){if(_0x33b7c0){return _0x33b7c0[_0xc597('0x84')](_0x23df6a[_0xc597('0x35')]['ids'])[_0xc597('0x27')](function(){if(_['isArray'](_0x23df6a[_0xc597('0x35')]['ids'])){for(var _0x451638=0x0;_0x451638<_0x23df6a[_0xc597('0x35')][_0xc597('0x82')][_0xc597('0x3a')];_0x451638+=0x1){socket[_0xc597('0x6c')](_0xc597('0x85'),{'UserId':Number(_0x23df6a[_0xc597('0x35')][_0xc597('0x82')][_0x451638]),'WhatsappQueueId':Number(_0x23df6a[_0xc597('0x49')]['id'])});}}else{socket[_0xc597('0x6c')](_0xc597('0x85'),{'UserId':Number(_0x23df6a[_0xc597('0x35')][_0xc597('0x82')]),'WhatsappQueueId':Number(_0x23df6a[_0xc597('0x49')]['id'])});}});}})[_0xc597('0x27')](respondWithStatusCode(_0x407ffe,null))[_0xc597('0x47')](handleError(_0x407ffe,null));};exports[_0xc597('0x88')]=function(_0x468b4f,_0x5ac469,_0x5124cb){var _0x2833c8={};var _0x311f15={};var _0x21c822;var _0x49c2c2;return db[_0xc597('0x43')]['findOne']({'where':{'id':_0x468b4f[_0xc597('0x49')]['id']}})[_0xc597('0x27')](handleEntityNotFound(_0x5ac469,null))['then'](function(_0x4119af){if(_0x4119af){_0x21c822=_0x4119af;_0x311f15[_0xc597('0x34')]=_[_0xc597('0x4a')](db['User'][_0xc597('0x31')]);_0x311f15[_0xc597('0x35')]=_[_0xc597('0x4a')](_0x468b4f['query']);_0x311f15[_0xc597('0x36')]=_['intersection'](_0x311f15['model'],_0x311f15[_0xc597('0x35')]);_0x2833c8[_0xc597('0x38')]=_['intersection'](_0x311f15[_0xc597('0x34')],qs[_0xc597('0x39')](_0x468b4f[_0xc597('0x35')][_0xc597('0x39')]));_0x2833c8[_0xc597('0x38')]=_0x2833c8[_0xc597('0x38')]['length']?_0x2833c8[_0xc597('0x38')]:_0x311f15[_0xc597('0x34')];_0x2833c8[_0xc597('0x89')]=qs['sort'](_0x468b4f[_0xc597('0x35')][_0xc597('0x3d')]);_0x2833c8[_0xc597('0x3e')]=qs[_0xc597('0x36')](_[_0xc597('0x3f')](_0x468b4f[_0xc597('0x35')],_0x311f15[_0xc597('0x36')]));if(_0x468b4f[_0xc597('0x35')][_0xc597('0x40')]){_0x2833c8[_0xc597('0x3e')]=_[_0xc597('0x41')](_0x2833c8[_0xc597('0x3e')],{'$or':_[_0xc597('0x30')](_0x2833c8[_0xc597('0x38')],function(_0x2db50f){var _0x526dc9={};_0x526dc9[_0x2db50f]={'$like':'%'+_0x468b4f[_0xc597('0x35')][_0xc597('0x40')]+'%'};return _0x526dc9;})});}_0x2833c8=_['merge']({},_0x2833c8,_0x468b4f['options']);return _0x21c822['getAgents'](_0x2833c8);}})[_0xc597('0x27')](function(_0x689484){if(_0x689484){_0x49c2c2=_0x689484[_0xc597('0x3a')];if(!_0x468b4f[_0xc597('0x35')][_0xc597('0x3b')](_0xc597('0x59'))){_0x2833c8[_0xc597('0x3c')]=qs[_0xc597('0x3c')](_0x468b4f[_0xc597('0x35')][_0xc597('0x3c')]);_0x2833c8[_0xc597('0x22')]=qs[_0xc597('0x22')](_0x468b4f[_0xc597('0x35')][_0xc597('0x22')]);}return _0x21c822[_0xc597('0x88')](_0x2833c8);}})[_0xc597('0x27')](function(_0x18021d){if(_0x18021d){return _0x18021d?{'count':_0x49c2c2,'rows':_0x18021d}:null;}})[_0xc597('0x27')](respondWithResult(_0x5ac469,null))[_0xc597('0x47')](handleError(_0x5ac469,null));};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js
index d88a5de..29cacc9 100644
--- a/server/api/whatsappQueue/whatsappQueue.events.js
+++ b/server/api/whatsappQueue/whatsappQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f7d=['events','WhatsappQueue','setMaxListeners','save','update','emit','hook','exports'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x8f7d,0x178));var _0xd8f7=function(_0x381764,_0x52fe19){_0x381764=_0x381764-0x0;var _0x292f80=_0x8f7d[_0x381764];return _0x292f80;};'use strict';var EventEmitter=require(_0xd8f7('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xd8f7('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xd8f7('0x2')](0x0);var events={'afterCreate':_0xd8f7('0x3'),'afterUpdate':_0xd8f7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1bcdc8){return function(_0x263458,_0x1c1a0a,_0x46b4e0){WhatsappQueueEvents[_0xd8f7('0x5')](_0x1bcdc8+':'+_0x263458['id'],_0x263458);WhatsappQueueEvents[_0xd8f7('0x5')](_0x1bcdc8,_0x263458);_0x46b4e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xd8f7('0x6')](e,emitEvent(event));}}module[_0xd8f7('0x7')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0xbe00=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','save','update'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xbe00,0x109));var _0x0be0=function(_0x26fbc2,_0x51d2d2){_0x26fbc2=_0x26fbc2-0x0;var _0x52f64b=_0xbe00[_0x26fbc2];return _0x52f64b;};'use strict';var EventEmitter=require(_0x0be0('0x0'));var WhatsappQueue=require(_0x0be0('0x1'))['db'][_0x0be0('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0be0('0x3'),'afterUpdate':_0x0be0('0x4'),'afterDestroy':_0x0be0('0x5')};function emitEvent(_0x5e1781){return function(_0x3a9b4c,_0xe982b7,_0x39ec76){WhatsappQueueEvents[_0x0be0('0x6')](_0x5e1781+':'+_0x3a9b4c['id'],_0x3a9b4c);WhatsappQueueEvents[_0x0be0('0x6')](_0x5e1781,_0x3a9b4c);_0x39ec76(null);};}for(var e in events){if(events[_0x0be0('0x7')](e)){var event=events[e];WhatsappQueue[_0x0be0('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js
index bbfa921..2549052 100644
--- a/server/api/whatsappQueue/whatsappQueue.model.js
+++ b/server/api/whatsappQueue/whatsappQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ab6=['moment','bluebird','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2ab6,0xf3));var _0x62ab=function(_0x416902,_0xccb5e4){_0x416902=_0x416902-0x0;var _0x2f0619=_0x2ab6[_0x416902];return _0x2f0619;};'use strict';var _=require(_0x62ab('0x0'));var util=require(_0x62ab('0x1'));var logger=require(_0x62ab('0x2'))(_0x62ab('0x3'));var moment=require(_0x62ab('0x4'));var BPromise=require(_0x62ab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62ab('0x6'));var rimraf=require(_0x62ab('0x7'));var config=require('../../config/environment');var attributes=require(_0x62ab('0x8'));module[_0x62ab('0x9')]=function(_0x3d4bc2,_0x1d4fdc){return _0x3d4bc2[_0x62ab('0xa')](_0x62ab('0xb'),attributes,{'tableName':_0x62ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfbbc=['rimraf','../../config/environment','exports','define','WhatsappQueue','whatsapp_queues','lodash','api','moment','bluebird','path'];(function(_0x37c703,_0x54a49b){var _0x118d4a=function(_0x5beea4){while(--_0x5beea4){_0x37c703['push'](_0x37c703['shift']());}};_0x118d4a(++_0x54a49b);}(_0xfbbc,0x1a8));var _0xcfbb=function(_0x1a18c2,_0x3ab22f){_0x1a18c2=_0x1a18c2-0x0;var _0x44d40a=_0xfbbc[_0x1a18c2];return _0x44d40a;};'use strict';var _=require(_0xcfbb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcfbb('0x1'));var moment=require(_0xcfbb('0x2'));var BPromise=require(_0xcfbb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfbb('0x4'));var rimraf=require(_0xcfbb('0x5'));var config=require(_0xcfbb('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0xcfbb('0x7')]=function(_0x4b2c20,_0x3a33ca){return _0x4b2c20[_0xcfbb('0x8')](_0xcfbb('0x9'),attributes,{'tableName':_0xcfbb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js
index 7ea3b7e..221396a 100644
--- a/server/api/whatsappQueue/whatsappQueue.rpc.js
+++ b/server/api/whatsappQueue/whatsappQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5152=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','stringify','WhatsappQueue','ShowWhatsappQueue','lodash','util','moment','bluebird','ioredis'];(function(_0x2f070e,_0x746f67){var _0x4c2618=function(_0x4d7813){while(--_0x4d7813){_0x2f070e['push'](_0x2f070e['shift']());}};_0x4c2618(++_0x746f67);}(_0x5152,0x19d));var _0x2515=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x5152[_0x8e8ca7];return _0x561381;};'use strict';var _=require(_0x2515('0x0'));var util=require(_0x2515('0x1'));var moment=require(_0x2515('0x2'));var BPromise=require(_0x2515('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2515('0x4'));var db=require(_0x2515('0x5'))['db'];var utils=require(_0x2515('0x6'));var logger=require(_0x2515('0x7'))('rpc');var config=require(_0x2515('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2515('0x9')][_0x2515('0xa')]({'port':0x232a});config[_0x2515('0xb')]=_[_0x2515('0xc')](config['redis'],{'host':_0x2515('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2515('0xb')]));require('./whatsappQueue.socket')[_0x2515('0xe')](socket);function respondWithRpcPromise(_0x9c5b35,_0xa749fa,_0x5ed7e4){return new BPromise(function(_0x1bee65,_0x1c539f){return client[_0x2515('0xf')](_0x9c5b35,_0x5ed7e4)['then'](function(_0x2359c7){logger[_0x2515('0x10')](_0x2515('0x11'),_0xa749fa,_0x2515('0x12'));logger[_0x2515('0x13')](_0x2515('0x14'),_0xa749fa,_0x2515('0x12'),JSON['stringify'](_0x2359c7));if(_0x2359c7[_0x2515('0x15')]){if(_0x2359c7[_0x2515('0x15')][_0x2515('0x16')]===0x1f4){logger['error'](_0x2515('0x11'),_0xa749fa,_0x2359c7[_0x2515('0x15')]['message']);return _0x1c539f(_0x2359c7[_0x2515('0x15')][_0x2515('0x17')]);}logger[_0x2515('0x15')](_0x2515('0x11'),_0xa749fa,_0x2359c7[_0x2515('0x15')][_0x2515('0x17')]);return _0x1bee65(_0x2359c7[_0x2515('0x15')][_0x2515('0x17')]);}else{logger[_0x2515('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0xa749fa,'request\x20sent');_0x1bee65(_0x2359c7['result'][_0x2515('0x17')]);}})[_0x2515('0x18')](function(_0x5dddfd){logger['error'](_0x2515('0x11'),_0xa749fa,_0x5dddfd);_0x1c539f(_0x5dddfd);});});}exports[_0x2515('0x19')]=function(_0x512080){var _0x10639f=this;return new Promise(function(_0x475cd9,_0x12c9af){return db['WhatsappQueue'][_0x2515('0x1a')]({'raw':_0x512080[_0x2515('0x1b')]?_0x512080[_0x2515('0x1b')][_0x2515('0x1c')]===undefined?!![]:![]:!![],'where':_0x512080['options']?_0x512080[_0x2515('0x1b')][_0x2515('0x1d')]||null:null,'attributes':_0x512080[_0x2515('0x1b')]?_0x512080[_0x2515('0x1b')][_0x2515('0x1e')]||null:null,'limit':_0x512080['options']?_0x512080['options'][_0x2515('0x1f')]||null:null,'include':_0x512080[_0x2515('0x1b')]?_0x512080['options']['include']?_['map'](_0x512080[_0x2515('0x1b')][_0x2515('0x20')],function(_0x5882e3){return{'model':db[_0x5882e3[_0x2515('0x21')]],'as':_0x5882e3['as'],'attributes':_0x5882e3[_0x2515('0x1e')],'include':_0x5882e3['include']?_[_0x2515('0x22')](_0x5882e3[_0x2515('0x20')],function(_0x434334){return{'model':db[_0x434334[_0x2515('0x21')]],'as':_0x434334['as'],'attributes':_0x434334[_0x2515('0x1e')],'include':_0x434334[_0x2515('0x20')]?_[_0x2515('0x22')](_0x434334[_0x2515('0x20')],function(_0x2f9533){return{'model':db[_0x2f9533['model']],'as':_0x2f9533['as'],'attributes':_0x2f9533[_0x2515('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38be7f){logger[_0x2515('0x10')]('GetWhatsappQueue',_0x512080);logger[_0x2515('0x13')](_0x2515('0x19'),_0x512080,JSON[_0x2515('0x23')](_0x38be7f));_0x475cd9(_0x38be7f);})['catch'](function(_0x8bd2a7){logger[_0x2515('0x15')](_0x2515('0x19'),_0x8bd2a7[_0x2515('0x17')],_0x512080);_0x12c9af(_0x10639f[_0x2515('0x15')](0x1f4,_0x8bd2a7[_0x2515('0x17')]));});});};exports['ShowWhatsappQueue']=function(_0x4a0db0){var _0x1c30d6=this;return new Promise(function(_0x17b376,_0x476eb6){return db[_0x2515('0x24')]['find']({'raw':_0x4a0db0[_0x2515('0x1b')]?_0x4a0db0['options'][_0x2515('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a0db0[_0x2515('0x1b')]?_0x4a0db0[_0x2515('0x1b')][_0x2515('0x1d')]||null:null,'attributes':_0x4a0db0[_0x2515('0x1b')]?_0x4a0db0[_0x2515('0x1b')][_0x2515('0x1e')]||null:null,'include':_0x4a0db0[_0x2515('0x1b')]?_0x4a0db0['options'][_0x2515('0x20')]?_[_0x2515('0x22')](_0x4a0db0[_0x2515('0x1b')][_0x2515('0x20')],function(_0x472341){return{'model':db[_0x472341[_0x2515('0x21')]],'as':_0x472341['as'],'attributes':_0x472341['attributes'],'include':_0x472341[_0x2515('0x20')]?_['map'](_0x472341[_0x2515('0x20')],function(_0x448809){return{'model':db[_0x448809[_0x2515('0x21')]],'as':_0x448809['as'],'attributes':_0x448809[_0x2515('0x1e')],'include':_0x448809[_0x2515('0x20')]?_[_0x2515('0x22')](_0x448809[_0x2515('0x20')],function(_0x295d4b){return{'model':db[_0x295d4b[_0x2515('0x21')]],'as':_0x295d4b['as'],'attributes':_0x295d4b[_0x2515('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x276965){logger[_0x2515('0x10')](_0x2515('0x25'),_0x4a0db0);logger[_0x2515('0x13')](_0x2515('0x25'),_0x4a0db0,JSON[_0x2515('0x23')](_0x276965));_0x17b376(_0x276965);})[_0x2515('0x18')](function(_0x22f906){logger['error'](_0x2515('0x25'),_0x22f906['message'],_0x4a0db0);_0x476eb6(_0x1c30d6[_0x2515('0x15')](0x1f4,_0x22f906[_0x2515('0x17')]));});});};
\ No newline at end of file
+var _0x0044=['WhatsappQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetWhatsappQueue','stringify','ShowWhatsappQueue'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x0044,0x12a));var _0x4004=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0x0044[_0x1c06f4];return _0x1a727e;};'use strict';var _=require('lodash');var util=require(_0x4004('0x0'));var moment=require('moment');var BPromise=require(_0x4004('0x1'));var rs=require(_0x4004('0x2'));var fs=require('fs');var Redis=require(_0x4004('0x3'));var db=require(_0x4004('0x4'))['db'];var utils=require(_0x4004('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4004('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4004('0x7')]({'port':0x232a});config[_0x4004('0x8')]=_[_0x4004('0x9')](config[_0x4004('0x8')],{'host':_0x4004('0xa'),'port':0x18eb});var socket=require(_0x4004('0xb'))(new Redis(config['redis']));require(_0x4004('0xc'))['register'](socket);function respondWithRpcPromise(_0x9cd80a,_0x1f6b7f,_0x1f2bf8){return new BPromise(function(_0x5057db,_0xb96fdc){return client[_0x4004('0xd')](_0x9cd80a,_0x1f2bf8)[_0x4004('0xe')](function(_0x3fb237){logger[_0x4004('0xf')](_0x4004('0x10'),_0x1f6b7f,_0x4004('0x11'));logger['debug'](_0x4004('0x12'),_0x1f6b7f,'request\x20sent',JSON['stringify'](_0x3fb237));if(_0x3fb237[_0x4004('0x13')]){if(_0x3fb237[_0x4004('0x13')]['code']===0x1f4){logger[_0x4004('0x13')](_0x4004('0x10'),_0x1f6b7f,_0x3fb237['error'][_0x4004('0x14')]);return _0xb96fdc(_0x3fb237[_0x4004('0x13')]['message']);}logger[_0x4004('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x1f6b7f,_0x3fb237[_0x4004('0x13')][_0x4004('0x14')]);return _0x5057db(_0x3fb237[_0x4004('0x13')][_0x4004('0x14')]);}else{logger[_0x4004('0xf')](_0x4004('0x10'),_0x1f6b7f,_0x4004('0x11'));_0x5057db(_0x3fb237[_0x4004('0x15')][_0x4004('0x14')]);}})[_0x4004('0x16')](function(_0x2818ab){logger[_0x4004('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x1f6b7f,_0x2818ab);_0xb96fdc(_0x2818ab);});});}exports['GetWhatsappQueue']=function(_0x2ba620){var _0x5d095b=this;return new Promise(function(_0x1218a1,_0x247a5d){return db['WhatsappQueue'][_0x4004('0x17')]({'raw':_0x2ba620[_0x4004('0x18')]?_0x2ba620[_0x4004('0x18')][_0x4004('0x19')]===undefined?!![]:![]:!![],'where':_0x2ba620[_0x4004('0x18')]?_0x2ba620[_0x4004('0x18')][_0x4004('0x1a')]||null:null,'attributes':_0x2ba620[_0x4004('0x18')]?_0x2ba620[_0x4004('0x18')][_0x4004('0x1b')]||null:null,'limit':_0x2ba620['options']?_0x2ba620[_0x4004('0x18')][_0x4004('0x1c')]||null:null,'include':_0x2ba620[_0x4004('0x18')]?_0x2ba620[_0x4004('0x18')][_0x4004('0x1d')]?_['map'](_0x2ba620['options']['include'],function(_0x1209ee){return{'model':db[_0x1209ee[_0x4004('0x1e')]],'as':_0x1209ee['as'],'attributes':_0x1209ee[_0x4004('0x1b')],'include':_0x1209ee['include']?_['map'](_0x1209ee['include'],function(_0x7a490d){return{'model':db[_0x7a490d[_0x4004('0x1e')]],'as':_0x7a490d['as'],'attributes':_0x7a490d[_0x4004('0x1b')],'include':_0x7a490d[_0x4004('0x1d')]?_[_0x4004('0x1f')](_0x7a490d['include'],function(_0x45445e){return{'model':db[_0x45445e[_0x4004('0x1e')]],'as':_0x45445e['as'],'attributes':_0x45445e[_0x4004('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4004('0xe')](function(_0x4820cc){logger['info'](_0x4004('0x20'),_0x2ba620);logger['debug'](_0x4004('0x20'),_0x2ba620,JSON[_0x4004('0x21')](_0x4820cc));_0x1218a1(_0x4820cc);})['catch'](function(_0x301440){logger['error'](_0x4004('0x20'),_0x301440[_0x4004('0x14')],_0x2ba620);_0x247a5d(_0x5d095b['error'](0x1f4,_0x301440[_0x4004('0x14')]));});});};exports[_0x4004('0x22')]=function(_0x5766d5){var _0x378454=this;return new Promise(function(_0x1904a0,_0xf4234){return db[_0x4004('0x23')][_0x4004('0x24')]({'raw':_0x5766d5[_0x4004('0x18')]?_0x5766d5[_0x4004('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5766d5[_0x4004('0x18')]?_0x5766d5[_0x4004('0x18')]['where']||null:null,'attributes':_0x5766d5['options']?_0x5766d5[_0x4004('0x18')][_0x4004('0x1b')]||null:null,'include':_0x5766d5['options']?_0x5766d5[_0x4004('0x18')][_0x4004('0x1d')]?_[_0x4004('0x1f')](_0x5766d5[_0x4004('0x18')][_0x4004('0x1d')],function(_0xd3bcbe){return{'model':db[_0xd3bcbe[_0x4004('0x1e')]],'as':_0xd3bcbe['as'],'attributes':_0xd3bcbe[_0x4004('0x1b')],'include':_0xd3bcbe[_0x4004('0x1d')]?_[_0x4004('0x1f')](_0xd3bcbe[_0x4004('0x1d')],function(_0x232159){return{'model':db[_0x232159[_0x4004('0x1e')]],'as':_0x232159['as'],'attributes':_0x232159[_0x4004('0x1b')],'include':_0x232159[_0x4004('0x1d')]?_['map'](_0x232159[_0x4004('0x1d')],function(_0x1c818b){return{'model':db[_0x1c818b['model']],'as':_0x1c818b['as'],'attributes':_0x1c818b['attributes']};}):[]};}):[]};}):[]:[]})[_0x4004('0xe')](function(_0xbfe4b5){logger[_0x4004('0xf')]('ShowWhatsappQueue',_0x5766d5);logger['debug'](_0x4004('0x22'),_0x5766d5,JSON[_0x4004('0x21')](_0xbfe4b5));_0x1904a0(_0xbfe4b5);})[_0x4004('0x16')](function(_0x5ff618){logger[_0x4004('0x13')](_0x4004('0x22'),_0x5ff618['message'],_0x5766d5);_0xf4234(_0x378454['error'](0x1f4,_0x5ff618['message']));});});};
\ No newline at end of file
diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js
index 28ab6ae..502eeb4 100644
--- a/server/api/whatsappQueue/whatsappQueue.socket.js
+++ b/server/api/whatsappQueue/whatsappQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9885=['removeListener','register','./whatsappQueue.events','save','remove','update','emit'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x9885,0x191));var _0x5988=function(_0x17ff44,_0x2d0e21){_0x17ff44=_0x17ff44-0x0;var _0x504dec=_0x9885[_0x17ff44];return _0x504dec;};'use strict';var WhatsappQueueEvents=require(_0x5988('0x0'));var events=[_0x5988('0x1'),_0x5988('0x2'),_0x5988('0x3')];function createListener(_0x16ddaf,_0x39580b){return function(_0xe59da4){_0x39580b[_0x5988('0x4')](_0x16ddaf,_0xe59da4);};}function removeListener(_0x57de53,_0x3891b5){return function(){WhatsappQueueEvents[_0x5988('0x5')](_0x57de53,_0x3891b5);};}exports[_0x5988('0x6')]=function(_0x559566){for(var _0x2bb661=0x0,_0x394436=events['length'];_0x2bb661<_0x394436;_0x2bb661++){var _0x4af41f=events[_0x2bb661];var _0x4888b6=createListener('whatsappQueue:'+_0x4af41f,_0x559566);WhatsappQueueEvents['on'](_0x4af41f,_0x4888b6);}};
\ No newline at end of file
+var _0xf6b6=['register','length','whatsappQueue:','save','remove','emit','removeListener'];(function(_0x73ba1f,_0x588ccb){var _0x2e2725=function(_0x145578){while(--_0x145578){_0x73ba1f['push'](_0x73ba1f['shift']());}};_0x2e2725(++_0x588ccb);}(_0xf6b6,0x1e6));var _0x6f6b=function(_0x5e56b3,_0x3f92f2){_0x5e56b3=_0x5e56b3-0x0;var _0x27d2db=_0xf6b6[_0x5e56b3];return _0x27d2db;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x6f6b('0x0'),_0x6f6b('0x1'),'update'];function createListener(_0x32e175,_0x179864){return function(_0x15726b){_0x179864[_0x6f6b('0x2')](_0x32e175,_0x15726b);};}function removeListener(_0x2f1e66,_0x1f590f){return function(){WhatsappQueueEvents[_0x6f6b('0x3')](_0x2f1e66,_0x1f590f);};}exports[_0x6f6b('0x4')]=function(_0x1aa361){for(var _0x7d1455=0x0,_0x7bf818=events[_0x6f6b('0x5')];_0x7d1455<_0x7bf818;_0x7d1455++){var _0x491068=events[_0x7d1455];var _0x9d4f9e=createListener(_0x6f6b('0x6')+_0x491068,_0x1aa361);WhatsappQueueEvents['on'](_0x491068,_0x9d4f9e);}};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js
index 974a799..abaf840 100644
--- a/server/api/whatsappQueueReport/index.js
+++ b/server/api/whatsappQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1d71=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','show','create','/:id','update','destroy','exports','multer','util'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x1d71,0x154));var _0x11d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d71[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x11d7('0x0'));var util=require(_0x11d7('0x1'));var path=require(_0x11d7('0x2'));var timeout=require(_0x11d7('0x3'));var express=require(_0x11d7('0x4'));var router=express[_0x11d7('0x5')]();var auth=require(_0x11d7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x11d7('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x11d7('0x8')]('/',auth['isAuthenticated'](),controller[_0x11d7('0x9')]);router[_0x11d7('0x8')]('/describe',auth[_0x11d7('0xa')](),controller[_0x11d7('0xb')]);router[_0x11d7('0x8')]('/:id',auth[_0x11d7('0xa')](),controller[_0x11d7('0xc')]);router['post']('/',auth[_0x11d7('0xa')](),controller[_0x11d7('0xd')]);router['put'](_0x11d7('0xe'),auth[_0x11d7('0xa')](),controller[_0x11d7('0xf')]);router['delete'](_0x11d7('0xe'),auth[_0x11d7('0xa')](),controller[_0x11d7('0x10')]);module[_0x11d7('0x11')]=router;
\ No newline at end of file
+var _0x18cc=['show','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x188d36,_0x147dd1){var _0x263311=function(_0x3882a8){while(--_0x3882a8){_0x188d36['push'](_0x188d36['shift']());}};_0x263311(++_0x147dd1);}(_0x18cc,0x116));var _0xc18c=function(_0x5c2310,_0x1a5e13){_0x5c2310=_0x5c2310-0x0;var _0x5f5195=_0x18cc[_0x5c2310];return _0x5f5195;};'use strict';var multer=require(_0xc18c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc18c('0x1'));var express=require('express');var router=express[_0xc18c('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xc18c('0x3'));var config=require(_0xc18c('0x4'));var controller=require(_0xc18c('0x5'));router['get']('/',auth[_0xc18c('0x6')](),controller[_0xc18c('0x7')]);router[_0xc18c('0x8')]('/describe',auth[_0xc18c('0x6')](),controller[_0xc18c('0x9')]);router[_0xc18c('0x8')](_0xc18c('0xa'),auth[_0xc18c('0x6')](),controller[_0xc18c('0xb')]);router['post']('/',auth[_0xc18c('0x6')](),controller['create']);router[_0xc18c('0xc')](_0xc18c('0xa'),auth[_0xc18c('0x6')](),controller[_0xc18c('0xd')]);router[_0xc18c('0xe')](_0xc18c('0xa'),auth[_0xc18c('0x6')](),controller[_0xc18c('0xf')]);module[_0xc18c('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
index 0b68810..fb8b962 100644
--- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
+++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['DATE','STRING','sequelize','exports'];(function(_0x60033,_0x226f33){var _0x53c597=function(_0x5e6457){while(--_0x5e6457){_0x60033['push'](_0x60033['shift']());}};_0x53c597(++_0x226f33);}(_0x55ca,0x126));var _0xa55c=function(_0x2bbbc2,_0x2fd8b9){_0x2bbbc2=_0x2bbbc2-0x0;var _0x1f0319=_0x55ca[_0x2bbbc2];return _0x1f0319;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa55c('0x2')]},'acceptAt':{'type':Sequelize[_0xa55c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa55c('0x3')]}};
\ No newline at end of file
+var _0x6aa7=['DATE','sequelize','STRING'];(function(_0xbdc237,_0x476ae3){var _0x51884b=function(_0x553ac5){while(--_0x553ac5){_0xbdc237['push'](_0xbdc237['shift']());}};_0x51884b(++_0x476ae3);}(_0x6aa7,0x178));var _0x76aa=function(_0x59b3a5,_0x1264ec){_0x59b3a5=_0x59b3a5-0x0;var _0x10270a=_0x6aa7[_0x59b3a5];return _0x10270a;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x76aa('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x76aa('0x1')]},'joinAt':{'type':Sequelize[_0x76aa('0x2')]},'leaveAt':{'type':Sequelize[_0x76aa('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x76aa('0x2')]},'reason':{'type':Sequelize[_0x76aa('0x1')]}};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js
index 51b8971..8c50643 100644
--- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js
+++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x47c5=['sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','stack','index','map','WhatsappQueueReport','rawAttributes','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','type','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x1d4fa6,_0x391d9d){var _0x134c9e=function(_0x305dd9){while(--_0x305dd9){_0x1d4fa6['push'](_0x1d4fa6['shift']());}};_0x134c9e(++_0x391d9d);}(_0x47c5,0x165));var _0x547c=function(_0x501d0d,_0x38b758){_0x501d0d=_0x501d0d-0x0;var _0x37a8b8=_0x47c5[_0x501d0d];return _0x37a8b8;};'use strict';var pdf=require(_0x547c('0x0'));var emlformat=require(_0x547c('0x1'));var rimraf=require(_0x547c('0x2'));var zipdir=require(_0x547c('0x3'));var jsonpatch=require(_0x547c('0x4'));var rp=require(_0x547c('0x5'));var moment=require('moment');var BPromise=require(_0x547c('0x6'));var Mustache=require(_0x547c('0x7'));var util=require('util');var path=require(_0x547c('0x8'));var sox=require(_0x547c('0x9'));var csv=require('to-csv');var ejs=require(_0x547c('0xa'));var fs=require('fs');var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x10'));var querystring=require(_0x547c('0x11'));var Papa=require(_0x547c('0x12'));var Redis=require(_0x547c('0x13'));var authService=require(_0x547c('0x14'));var qs=require(_0x547c('0x15'));var as=require(_0x547c('0x16'));var hardwareService=require(_0x547c('0x17'));var logger=require(_0x547c('0x18'))(_0x547c('0x19'));var utils=require(_0x547c('0x1a'));var config=require('../../config/environment');var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x39dce7,_0x5eea67){_0x5eea67=_0x5eea67||0xcc;return function(_0x436c19){if(_0x436c19){return _0x39dce7[_0x547c('0x1c')](_0x5eea67);}return _0x39dce7[_0x547c('0x1d')](_0x5eea67)[_0x547c('0x1e')]();};}function respondWithResult(_0x392a35,_0x150317){_0x150317=_0x150317||0xc8;return function(_0x2bc289){if(_0x2bc289){return _0x392a35[_0x547c('0x1d')](_0x150317)[_0x547c('0x1f')](_0x2bc289);}};}function respondWithFilteredResult(_0x161991,_0x240243){return function(_0x103455){if(_0x103455){var _0x39f316=_0x103455[_0x547c('0x20')],_0x23644b=_0x240243[_0x547c('0x21')],_0x2d5331=_0x240243['offset']+_0x240243['limit'],_0xf32cdd;if(_0x2d5331>=_0x39f316){_0x2d5331=_0x39f316;_0xf32cdd=0xc8;}else{_0xf32cdd=0xce;}_0x161991[_0x547c('0x1d')](_0xf32cdd);return _0x161991[_0x547c('0x22')](_0x547c('0x23'),_0x23644b+'-'+_0x2d5331+'/'+_0x39f316)['json'](_0x103455);}return null;};}function patchUpdates(_0x248aca){return function(_0x18ef77){try{jsonpatch[_0x547c('0x24')](_0x18ef77,_0x248aca,!![]);}catch(_0x58ddc9){return BPromise[_0x547c('0x25')](_0x58ddc9);}return _0x18ef77[_0x547c('0x26')]();};}function saveUpdates(_0x496c38,_0x5453f9){return function(_0x35040a){if(_0x35040a){return _0x35040a[_0x547c('0x27')](_0x496c38)['then'](function(_0x11e709){return _0x11e709;});}return null;};}function removeEntity(_0x16a3a6,_0x592e46){return function(_0x2e317a){if(_0x2e317a){return _0x2e317a[_0x547c('0x28')]()[_0x547c('0x29')](function(){_0x16a3a6['status'](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x361c5c,_0x470694){return function(_0x26823c){if(!_0x26823c){_0x361c5c[_0x547c('0x1c')](0x194);}return _0x26823c;};}function handleError(_0x2663bc,_0x2ab2cc){_0x2ab2cc=_0x2ab2cc||0x1f4;return function(_0x17fa33){logger['error'](_0x17fa33[_0x547c('0x2a')]);if(_0x17fa33['name']){delete _0x17fa33['name'];}_0x2663bc['status'](_0x2ab2cc)['send'](_0x17fa33);};}exports[_0x547c('0x2b')]=function(_0x4c5256,_0x93985c){var _0x5729b0={},_0x3ea493={},_0x486216={'count':0x0,'rows':[]};var _0x1c2cd2=_[_0x547c('0x2c')](db[_0x547c('0x2d')][_0x547c('0x2e')],function(_0x198afb){return{'name':_0x198afb['fieldName'],'type':_0x198afb['type'][_0x547c('0x2f')]};});_0x3ea493['model']=_[_0x547c('0x2c')](_0x1c2cd2,_0x547c('0x30'));_0x3ea493[_0x547c('0x31')]=_[_0x547c('0x32')](_0x4c5256[_0x547c('0x31')]);_0x3ea493[_0x547c('0x33')]=_[_0x547c('0x34')](_0x3ea493['model'],_0x3ea493['query']);_0x5729b0[_0x547c('0x35')]=_[_0x547c('0x34')](_0x3ea493[_0x547c('0x36')],qs[_0x547c('0x37')](_0x4c5256[_0x547c('0x31')][_0x547c('0x37')]));_0x5729b0[_0x547c('0x35')]=_0x5729b0[_0x547c('0x35')][_0x547c('0x38')]?_0x5729b0[_0x547c('0x35')]:_0x3ea493[_0x547c('0x36')];if(!_0x4c5256[_0x547c('0x31')][_0x547c('0x39')](_0x547c('0x3a'))){_0x5729b0['limit']=qs[_0x547c('0x3b')](_0x4c5256['query']['limit']);_0x5729b0['offset']=qs[_0x547c('0x21')](_0x4c5256[_0x547c('0x31')][_0x547c('0x21')]);}_0x5729b0[_0x547c('0x3c')]=qs[_0x547c('0x3d')](_0x4c5256[_0x547c('0x31')]['sort']);_0x5729b0['where']=qs['filters'](_[_0x547c('0x3e')](_0x4c5256[_0x547c('0x31')],_0x3ea493[_0x547c('0x33')]),_0x1c2cd2);if(_0x4c5256[_0x547c('0x31')][_0x547c('0x3f')]){_0x5729b0[_0x547c('0x40')]=_['merge'](_0x5729b0[_0x547c('0x40')],{'$or':_['map'](_0x1c2cd2,function(_0x32308f){if(_0x32308f[_0x547c('0x41')]!=='VIRTUAL'){var _0x380705={};_0x380705[_0x32308f['name']]={'$like':'%'+_0x4c5256['query'][_0x547c('0x3f')]+'%'};return _0x380705;}})});}_0x5729b0=_[_0x547c('0x42')]({},_0x5729b0,_0x4c5256[_0x547c('0x43')]);var _0x22a70b={'where':_0x5729b0['where']};return db['WhatsappQueueReport'][_0x547c('0x20')](_0x22a70b)[_0x547c('0x29')](function(_0x411c6f){_0x486216['count']=_0x411c6f;if(_0x4c5256[_0x547c('0x31')][_0x547c('0x44')]){_0x5729b0[_0x547c('0x45')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x547c('0x46')](_0x5729b0);})[_0x547c('0x29')](function(_0xbb08e7){_0x486216['rows']=_0xbb08e7;return _0x486216;})[_0x547c('0x29')](respondWithFilteredResult(_0x93985c,_0x5729b0))[_0x547c('0x47')](handleError(_0x93985c,null));};exports['show']=function(_0x26ea8c,_0x23c8b2){var _0x9c3cb2={'raw':!![],'where':{'id':_0x26ea8c[_0x547c('0x48')]['id']}},_0x4ffd10={};_0x4ffd10['model']=_[_0x547c('0x32')](db['WhatsappQueueReport'][_0x547c('0x2e')]);_0x4ffd10[_0x547c('0x31')]=_[_0x547c('0x32')](_0x26ea8c[_0x547c('0x31')]);_0x4ffd10[_0x547c('0x33')]=_[_0x547c('0x34')](_0x4ffd10['model'],_0x4ffd10['query']);_0x9c3cb2[_0x547c('0x35')]=_[_0x547c('0x34')](_0x4ffd10[_0x547c('0x36')],qs['fields'](_0x26ea8c[_0x547c('0x31')][_0x547c('0x37')]));_0x9c3cb2[_0x547c('0x35')]=_0x9c3cb2[_0x547c('0x35')][_0x547c('0x38')]?_0x9c3cb2[_0x547c('0x35')]:_0x4ffd10['model'];if(_0x26ea8c[_0x547c('0x31')][_0x547c('0x44')]){_0x9c3cb2[_0x547c('0x45')]=[{'all':!![]}];}_0x9c3cb2=_['merge']({},_0x9c3cb2,_0x26ea8c[_0x547c('0x43')]);return db[_0x547c('0x2d')][_0x547c('0x49')](_0x9c3cb2)[_0x547c('0x29')](handleEntityNotFound(_0x23c8b2,null))['then'](respondWithResult(_0x23c8b2,null))[_0x547c('0x47')](handleError(_0x23c8b2,null));};exports['create']=function(_0x15ffa6,_0x5025cc){return db[_0x547c('0x2d')][_0x547c('0x4a')](_0x15ffa6['body'],{})[_0x547c('0x29')](respondWithResult(_0x5025cc,0xc9))[_0x547c('0x47')](handleError(_0x5025cc,null));};exports[_0x547c('0x27')]=function(_0x1ddf30,_0x52d419){if(_0x1ddf30[_0x547c('0x4b')]['id']){delete _0x1ddf30['body']['id'];}return db['WhatsappQueueReport'][_0x547c('0x49')]({'where':{'id':_0x1ddf30[_0x547c('0x48')]['id']}})[_0x547c('0x29')](handleEntityNotFound(_0x52d419,null))[_0x547c('0x29')](saveUpdates(_0x1ddf30[_0x547c('0x4b')],null))[_0x547c('0x29')](respondWithResult(_0x52d419,null))[_0x547c('0x47')](handleError(_0x52d419,null));};exports[_0x547c('0x28')]=function(_0x58cb05,_0x31a262){return db[_0x547c('0x2d')][_0x547c('0x49')]({'where':{'id':_0x58cb05['params']['id']}})['then'](handleEntityNotFound(_0x31a262,null))[_0x547c('0x29')](removeEntity(_0x31a262,null))[_0x547c('0x47')](handleError(_0x31a262,null));};exports['describe']=function(_0xadd57d,_0x3e42a2){return db[_0x547c('0x2d')][_0x547c('0x4c')]()[_0x547c('0x29')](respondWithResult(_0x3e42a2,null))[_0x547c('0x47')](handleError(_0x3e42a2,null));};
\ No newline at end of file
+var _0x5532=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','status','stack','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x5532,0x19a));var _0x2553=function(_0x66c830,_0x3d1e5a){_0x66c830=_0x66c830-0x0;var _0x501b9d=_0x5532[_0x66c830];return _0x501b9d;};'use strict';var pdf=require(_0x2553('0x0'));var emlformat=require(_0x2553('0x1'));var rimraf=require(_0x2553('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2553('0x3'));var rp=require('request-promise');var moment=require(_0x2553('0x4'));var BPromise=require(_0x2553('0x5'));var Mustache=require(_0x2553('0x6'));var util=require('util');var path=require(_0x2553('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2553('0x8'));var fs=require('fs');var _=require(_0x2553('0x9'));var squel=require('squel');var crypto=require(_0x2553('0xa'));var jsforce=require(_0x2553('0xb'));var deskjs=require(_0x2553('0xc'));var toCsv=require(_0x2553('0xd'));var querystring=require(_0x2553('0xe'));var Papa=require(_0x2553('0xf'));var Redis=require(_0x2553('0x10'));var authService=require(_0x2553('0x11'));var qs=require(_0x2553('0x12'));var as=require(_0x2553('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2553('0x14'))(_0x2553('0x15'));var utils=require(_0x2553('0x16'));var config=require('../../config/environment');var db=require(_0x2553('0x17'))['db'];function respondWithStatusCode(_0x2e83ae,_0x509539){_0x509539=_0x509539||0xcc;return function(_0x5d24fb){if(_0x5d24fb){return _0x2e83ae[_0x2553('0x18')](_0x509539);}return _0x2e83ae['status'](_0x509539)[_0x2553('0x19')]();};}function respondWithResult(_0x2806a2,_0x426ebb){_0x426ebb=_0x426ebb||0xc8;return function(_0x587ab5){if(_0x587ab5){return _0x2806a2['status'](_0x426ebb)[_0x2553('0x1a')](_0x587ab5);}};}function respondWithFilteredResult(_0x3b3024,_0x2e2555){return function(_0x77477d){if(_0x77477d){var _0x241dfe=_0x77477d[_0x2553('0x1b')],_0x31ae8f=_0x2e2555['offset'],_0x486092=_0x2e2555[_0x2553('0x1c')]+_0x2e2555[_0x2553('0x1d')],_0x244d3e;if(_0x486092>=_0x241dfe){_0x486092=_0x241dfe;_0x244d3e=0xc8;}else{_0x244d3e=0xce;}_0x3b3024['status'](_0x244d3e);return _0x3b3024[_0x2553('0x1e')](_0x2553('0x1f'),_0x31ae8f+'-'+_0x486092+'/'+_0x241dfe)[_0x2553('0x1a')](_0x77477d);}return null;};}function patchUpdates(_0x3f8794){return function(_0x4970de){try{jsonpatch['apply'](_0x4970de,_0x3f8794,!![]);}catch(_0x5b875b){return BPromise[_0x2553('0x20')](_0x5b875b);}return _0x4970de[_0x2553('0x21')]();};}function saveUpdates(_0x5642ea,_0x55ceba){return function(_0x26698c){if(_0x26698c){return _0x26698c[_0x2553('0x22')](_0x5642ea)[_0x2553('0x23')](function(_0x4b8983){return _0x4b8983;});}return null;};}function removeEntity(_0x158aca,_0x2c7d16){return function(_0x3b4110){if(_0x3b4110){return _0x3b4110['destroy']()[_0x2553('0x23')](function(){_0x158aca[_0x2553('0x24')](0xcc)[_0x2553('0x19')]();});}};}function handleEntityNotFound(_0xc91f02,_0x49d4d1){return function(_0x1b6d14){if(!_0x1b6d14){_0xc91f02[_0x2553('0x18')](0x194);}return _0x1b6d14;};}function handleError(_0x4dc8c0,_0x12dc16){_0x12dc16=_0x12dc16||0x1f4;return function(_0x1557ea){logger['error'](_0x1557ea[_0x2553('0x25')]);if(_0x1557ea[_0x2553('0x26')]){delete _0x1557ea[_0x2553('0x26')];}_0x4dc8c0['status'](_0x12dc16)[_0x2553('0x27')](_0x1557ea);};}exports['index']=function(_0x2f72e7,_0x479479){var _0x49163b={},_0x1765a5={},_0x4fe54d={'count':0x0,'rows':[]};var _0x29f9d1=_[_0x2553('0x28')](db[_0x2553('0x29')][_0x2553('0x2a')],function(_0x54691d){return{'name':_0x54691d[_0x2553('0x2b')],'type':_0x54691d[_0x2553('0x2c')][_0x2553('0x2d')]};});_0x1765a5[_0x2553('0x2e')]=_[_0x2553('0x28')](_0x29f9d1,_0x2553('0x26'));_0x1765a5[_0x2553('0x2f')]=_[_0x2553('0x30')](_0x2f72e7[_0x2553('0x2f')]);_0x1765a5[_0x2553('0x31')]=_[_0x2553('0x32')](_0x1765a5[_0x2553('0x2e')],_0x1765a5[_0x2553('0x2f')]);_0x49163b[_0x2553('0x33')]=_['intersection'](_0x1765a5[_0x2553('0x2e')],qs[_0x2553('0x34')](_0x2f72e7['query'][_0x2553('0x34')]));_0x49163b[_0x2553('0x33')]=_0x49163b['attributes'][_0x2553('0x35')]?_0x49163b[_0x2553('0x33')]:_0x1765a5[_0x2553('0x2e')];if(!_0x2f72e7[_0x2553('0x2f')]['hasOwnProperty'](_0x2553('0x36'))){_0x49163b[_0x2553('0x1d')]=qs[_0x2553('0x1d')](_0x2f72e7[_0x2553('0x2f')][_0x2553('0x1d')]);_0x49163b[_0x2553('0x1c')]=qs[_0x2553('0x1c')](_0x2f72e7[_0x2553('0x2f')][_0x2553('0x1c')]);}_0x49163b['order']=qs[_0x2553('0x37')](_0x2f72e7['query'][_0x2553('0x37')]);_0x49163b[_0x2553('0x38')]=qs[_0x2553('0x31')](_['pick'](_0x2f72e7[_0x2553('0x2f')],_0x1765a5['filters']),_0x29f9d1);if(_0x2f72e7['query']['filter']){_0x49163b[_0x2553('0x38')]=_[_0x2553('0x39')](_0x49163b[_0x2553('0x38')],{'$or':_[_0x2553('0x28')](_0x29f9d1,function(_0x4a7065){if(_0x4a7065[_0x2553('0x2c')]!==_0x2553('0x3a')){var _0x737a01={};_0x737a01[_0x4a7065['name']]={'$like':'%'+_0x2f72e7[_0x2553('0x2f')][_0x2553('0x3b')]+'%'};return _0x737a01;}})});}_0x49163b=_[_0x2553('0x39')]({},_0x49163b,_0x2f72e7[_0x2553('0x3c')]);var _0x40a13d={'where':_0x49163b[_0x2553('0x38')]};return db['WhatsappQueueReport'][_0x2553('0x1b')](_0x40a13d)[_0x2553('0x23')](function(_0x3bc4a1){_0x4fe54d[_0x2553('0x1b')]=_0x3bc4a1;if(_0x2f72e7[_0x2553('0x2f')][_0x2553('0x3d')]){_0x49163b['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x2553('0x3e')](_0x49163b);})[_0x2553('0x23')](function(_0x336571){_0x4fe54d[_0x2553('0x3f')]=_0x336571;return _0x4fe54d;})['then'](respondWithFilteredResult(_0x479479,_0x49163b))[_0x2553('0x40')](handleError(_0x479479,null));};exports['show']=function(_0x2e98d8,_0x4596e3){var _0x441a30={'raw':!![],'where':{'id':_0x2e98d8[_0x2553('0x41')]['id']}},_0x410e92={};_0x410e92['model']=_[_0x2553('0x30')](db[_0x2553('0x29')][_0x2553('0x2a')]);_0x410e92[_0x2553('0x2f')]=_['keys'](_0x2e98d8[_0x2553('0x2f')]);_0x410e92['filters']=_['intersection'](_0x410e92[_0x2553('0x2e')],_0x410e92['query']);_0x441a30[_0x2553('0x33')]=_[_0x2553('0x32')](_0x410e92[_0x2553('0x2e')],qs[_0x2553('0x34')](_0x2e98d8['query']['fields']));_0x441a30[_0x2553('0x33')]=_0x441a30[_0x2553('0x33')]['length']?_0x441a30['attributes']:_0x410e92['model'];if(_0x2e98d8['query']['includeAll']){_0x441a30[_0x2553('0x42')]=[{'all':!![]}];}_0x441a30=_[_0x2553('0x39')]({},_0x441a30,_0x2e98d8[_0x2553('0x3c')]);return db[_0x2553('0x29')]['find'](_0x441a30)['then'](handleEntityNotFound(_0x4596e3,null))['then'](respondWithResult(_0x4596e3,null))[_0x2553('0x40')](handleError(_0x4596e3,null));};exports[_0x2553('0x43')]=function(_0xf1787d,_0xb019f5){return db[_0x2553('0x29')][_0x2553('0x43')](_0xf1787d['body'],{})[_0x2553('0x23')](respondWithResult(_0xb019f5,0xc9))[_0x2553('0x40')](handleError(_0xb019f5,null));};exports[_0x2553('0x22')]=function(_0x29ad08,_0x473b7f){if(_0x29ad08[_0x2553('0x44')]['id']){delete _0x29ad08[_0x2553('0x44')]['id'];}return db[_0x2553('0x29')]['find']({'where':{'id':_0x29ad08[_0x2553('0x41')]['id']}})[_0x2553('0x23')](handleEntityNotFound(_0x473b7f,null))['then'](saveUpdates(_0x29ad08[_0x2553('0x44')],null))[_0x2553('0x23')](respondWithResult(_0x473b7f,null))['catch'](handleError(_0x473b7f,null));};exports[_0x2553('0x45')]=function(_0x5eecfd,_0x27a2df){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5eecfd['params']['id']}})[_0x2553('0x23')](handleEntityNotFound(_0x27a2df,null))[_0x2553('0x23')](removeEntity(_0x27a2df,null))[_0x2553('0x40')](handleError(_0x27a2df,null));};exports[_0x2553('0x46')]=function(_0x5cdcfc,_0x51f3d2){return db['WhatsappQueueReport'][_0x2553('0x46')]()['then'](respondWithResult(_0x51f3d2,null))[_0x2553('0x40')](handleError(_0x51f3d2,null));};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js
index e5ff7fd..7394287 100644
--- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js
+++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x45a4=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash','util','api','bluebird'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x45a4,0x140));var _0x445a=function(_0xb31b0c,_0x41de7a){_0xb31b0c=_0xb31b0c-0x0;var _0x145f0d=_0x45a4[_0xb31b0c];return _0x145f0d;};'use strict';var _=require(_0x445a('0x0'));var util=require(_0x445a('0x1'));var logger=require('../../config/logger')(_0x445a('0x2'));var moment=require('moment');var BPromise=require(_0x445a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x445a('0x4'));var rimraf=require(_0x445a('0x5'));var config=require(_0x445a('0x6'));var attributes=require(_0x445a('0x7'));module[_0x445a('0x8')]=function(_0x2fed40,_0x16a5a0){return _0x2fed40[_0x445a('0x9')]('WhatsappQueueReport',attributes,{'tableName':_0x445a('0xa'),'paranoid':![],'indexes':[{'name':_0x445a('0xb'),'fields':[_0x445a('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7482=['rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','lodash','util','api','bluebird','path'];(function(_0x33b2ee,_0x3d5874){var _0x239d45=function(_0x272c0f){while(--_0x272c0f){_0x33b2ee['push'](_0x33b2ee['shift']());}};_0x239d45(++_0x3d5874);}(_0x7482,0xe2));var _0x2748=function(_0x1d1da2,_0x415963){_0x1d1da2=_0x1d1da2-0x0;var _0x549c23=_0x7482[_0x1d1da2];return _0x549c23;};'use strict';var _=require(_0x2748('0x0'));var util=require(_0x2748('0x1'));var logger=require('../../config/logger')(_0x2748('0x2'));var moment=require('moment');var BPromise=require(_0x2748('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2748('0x4'));var rimraf=require(_0x2748('0x5'));var config=require(_0x2748('0x6'));var attributes=require(_0x2748('0x7'));module[_0x2748('0x8')]=function(_0x465993,_0x2071ae){return _0x465993['define'](_0x2748('0x9'),attributes,{'tableName':_0x2748('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
index 239f8f3..81ad932 100644
--- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
+++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc925=['message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','debug','UpdateWhatsappQueueReport','where','attributes','limit','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4be857,_0x155753){var _0x35e2d4=function(_0x1ba7da){while(--_0x1ba7da){_0x4be857['push'](_0x4be857['shift']());}};_0x35e2d4(++_0x155753);}(_0xc925,0x71));var _0x5c92=function(_0x33ccb5,_0xe10dac){_0x33ccb5=_0x33ccb5-0x0;var _0x5d9d6f=_0xc925[_0x33ccb5];return _0x5d9d6f;};'use strict';var _=require('lodash');var util=require(_0x5c92('0x0'));var moment=require(_0x5c92('0x1'));var BPromise=require(_0x5c92('0x2'));var rs=require(_0x5c92('0x3'));var fs=require('fs');var Redis=require(_0x5c92('0x4'));var db=require(_0x5c92('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c92('0x6'))(_0x5c92('0x7'));var config=require(_0x5c92('0x8'));var jayson=require(_0x5c92('0x9'));var client=jayson[_0x5c92('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17afff,_0x31ee43,_0x1c0e51){return new BPromise(function(_0x582302,_0xaf398d){return client[_0x5c92('0xb')](_0x17afff,_0x1c0e51)[_0x5c92('0xc')](function(_0x34e90c){logger[_0x5c92('0xd')](_0x5c92('0xe'),_0x31ee43,_0x5c92('0xf'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x31ee43,_0x5c92('0xf'),JSON[_0x5c92('0x10')](_0x34e90c));if(_0x34e90c[_0x5c92('0x11')]){if(_0x34e90c[_0x5c92('0x11')][_0x5c92('0x12')]===0x1f4){logger[_0x5c92('0x11')](_0x5c92('0xe'),_0x31ee43,_0x34e90c[_0x5c92('0x11')]['message']);return _0xaf398d(_0x34e90c[_0x5c92('0x11')][_0x5c92('0x13')]);}logger[_0x5c92('0x11')](_0x5c92('0xe'),_0x31ee43,_0x34e90c[_0x5c92('0x11')][_0x5c92('0x13')]);return _0x582302(_0x34e90c[_0x5c92('0x11')][_0x5c92('0x13')]);}else{logger[_0x5c92('0xd')](_0x5c92('0xe'),_0x31ee43,_0x5c92('0xf'));_0x582302(_0x34e90c[_0x5c92('0x14')][_0x5c92('0x13')]);}})['catch'](function(_0x490773){logger[_0x5c92('0x11')](_0x5c92('0xe'),_0x31ee43,_0x490773);_0xaf398d(_0x490773);});});}exports[_0x5c92('0x15')]=function(_0x423799){var _0x5a67ca=this;return new Promise(function(_0x5bb4ee,_0x5b8a86){return db[_0x5c92('0x16')][_0x5c92('0x17')](_0x423799[_0x5c92('0x18')],{'raw':_0x423799['options']?_0x423799[_0x5c92('0x19')][_0x5c92('0x1a')]===undefined?!![]:![]:!![]})[_0x5c92('0xc')](function(_0x5ec3fc){logger[_0x5c92('0xd')](_0x5c92('0x15'),_0x423799);logger[_0x5c92('0x1b')](_0x5c92('0x15'),_0x423799,JSON['stringify'](_0x5ec3fc));_0x5bb4ee(_0x5ec3fc);})['catch'](function(_0x55acb5){logger[_0x5c92('0x11')](_0x5c92('0x15'),_0x55acb5['message'],_0x423799);_0x5b8a86(_0x5a67ca[_0x5c92('0x11')](0x1f4,_0x55acb5[_0x5c92('0x13')]));});});};exports[_0x5c92('0x1c')]=function(_0x2f69a6){var _0x4d911c=this;return new Promise(function(_0x31a9a1,_0x448fd0){return db['WhatsappQueueReport']['update'](_0x2f69a6[_0x5c92('0x18')],{'raw':_0x2f69a6['options']?_0x2f69a6['options'][_0x5c92('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f69a6[_0x5c92('0x19')]?_0x2f69a6[_0x5c92('0x19')][_0x5c92('0x1d')]||null:null,'attributes':_0x2f69a6[_0x5c92('0x19')]?_0x2f69a6[_0x5c92('0x19')][_0x5c92('0x1e')]||null:null,'limit':_0x2f69a6['options']?_0x2f69a6['options'][_0x5c92('0x1f')]||null:null})[_0x5c92('0xc')](function(_0x326d8a){logger[_0x5c92('0xd')](_0x5c92('0x1c'),_0x2f69a6);logger['debug'](_0x5c92('0x1c'),_0x2f69a6,JSON[_0x5c92('0x10')](_0x326d8a));_0x31a9a1(_0x326d8a);})[_0x5c92('0x20')](function(_0x9e6d68){logger[_0x5c92('0x11')]('UpdateWhatsappQueueReport',_0x9e6d68[_0x5c92('0x13')],_0x2f69a6);_0x448fd0(_0x4d911c[_0x5c92('0x11')](0x1f4,_0x9e6d68[_0x5c92('0x13')]));});});};
\ No newline at end of file
+var _0x761e=['message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','info','stringify','update','where','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0x761e,0x14e));var _0xe761=function(_0x2c3a88,_0x48637e){_0x2c3a88=_0x2c3a88-0x0;var _0x4a7925=_0x761e[_0x2c3a88];return _0x4a7925;};'use strict';var _=require(_0xe761('0x0'));var util=require(_0xe761('0x1'));var moment=require(_0xe761('0x2'));var BPromise=require(_0xe761('0x3'));var rs=require(_0xe761('0x4'));var fs=require('fs');var Redis=require(_0xe761('0x5'));var db=require(_0xe761('0x6'))['db'];var utils=require(_0xe761('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe761('0x8'));var jayson=require(_0xe761('0x9'));var client=jayson['client'][_0xe761('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e435d,_0x2f5966,_0x3b3a62){return new BPromise(function(_0x2925c2,_0x405165){return client['request'](_0x3e435d,_0x3b3a62)[_0xe761('0xb')](function(_0x286cb0){logger['info'](_0xe761('0xc'),_0x2f5966,_0xe761('0xd'));logger[_0xe761('0xe')](_0xe761('0xf'),_0x2f5966,_0xe761('0xd'),JSON['stringify'](_0x286cb0));if(_0x286cb0[_0xe761('0x10')]){if(_0x286cb0['error'][_0xe761('0x11')]===0x1f4){logger['error'](_0xe761('0xc'),_0x2f5966,_0x286cb0['error']['message']);return _0x405165(_0x286cb0[_0xe761('0x10')][_0xe761('0x12')]);}logger[_0xe761('0x10')](_0xe761('0xc'),_0x2f5966,_0x286cb0[_0xe761('0x10')][_0xe761('0x12')]);return _0x2925c2(_0x286cb0[_0xe761('0x10')][_0xe761('0x12')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x2f5966,_0xe761('0xd'));_0x2925c2(_0x286cb0[_0xe761('0x13')]['message']);}})[_0xe761('0x14')](function(_0x3d009e){logger[_0xe761('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2f5966,_0x3d009e);_0x405165(_0x3d009e);});});}exports[_0xe761('0x15')]=function(_0x3252a8){var _0x2b842e=this;return new Promise(function(_0x34dd74,_0x501e52){return db[_0xe761('0x16')]['create'](_0x3252a8[_0xe761('0x17')],{'raw':_0x3252a8[_0xe761('0x18')]?_0x3252a8[_0xe761('0x18')][_0xe761('0x19')]===undefined?!![]:![]:!![]})[_0xe761('0xb')](function(_0x1d8f21){logger[_0xe761('0x1a')](_0xe761('0x15'),_0x3252a8);logger['debug'](_0xe761('0x15'),_0x3252a8,JSON[_0xe761('0x1b')](_0x1d8f21));_0x34dd74(_0x1d8f21);})['catch'](function(_0x31ff9a){logger[_0xe761('0x10')](_0xe761('0x15'),_0x31ff9a['message'],_0x3252a8);_0x501e52(_0x2b842e['error'](0x1f4,_0x31ff9a[_0xe761('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x6a68c1){var _0x1cd516=this;return new Promise(function(_0x539d05,_0x5c386c){return db[_0xe761('0x16')][_0xe761('0x1c')](_0x6a68c1['body'],{'raw':_0x6a68c1['options']?_0x6a68c1[_0xe761('0x18')][_0xe761('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6a68c1[_0xe761('0x18')]?_0x6a68c1[_0xe761('0x18')][_0xe761('0x1d')]||null:null,'attributes':_0x6a68c1[_0xe761('0x18')]?_0x6a68c1['options'][_0xe761('0x1e')]||null:null,'limit':_0x6a68c1[_0xe761('0x18')]?_0x6a68c1['options']['limit']||null:null})[_0xe761('0xb')](function(_0x2fa3d2){logger['info'](_0xe761('0x1f'),_0x6a68c1);logger[_0xe761('0xe')](_0xe761('0x1f'),_0x6a68c1,JSON[_0xe761('0x1b')](_0x2fa3d2));_0x539d05(_0x2fa3d2);})[_0xe761('0x14')](function(_0x30453d){logger[_0xe761('0x10')](_0xe761('0x1f'),_0x30453d['message'],_0x6a68c1);_0x5c386c(_0x1cd516[_0xe761('0x10')](0x1f4,_0x30453d[_0xe761('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js
index 3253154..5885949 100644
--- a/server/api/whatsappTransferReport/index.js
+++ b/server/api/whatsappTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc139=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','multer'];(function(_0x5da980,_0x45b11c){var _0x4ee75e=function(_0x1e843b){while(--_0x1e843b){_0x5da980['push'](_0x5da980['shift']());}};_0x4ee75e(++_0x45b11c);}(_0xc139,0x1b9));var _0x9c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc139[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9c13('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9c13('0x1'));var express=require(_0x9c13('0x2'));var router=express[_0x9c13('0x3')]();var auth=require(_0x9c13('0x4'));var interaction=require(_0x9c13('0x5'));var config=require(_0x9c13('0x6'));var controller=require(_0x9c13('0x7'));router[_0x9c13('0x8')]('/',auth[_0x9c13('0x9')](),controller[_0x9c13('0xa')]);router[_0x9c13('0x8')](_0x9c13('0xb'),auth[_0x9c13('0x9')](),controller[_0x9c13('0xc')]);router['get'](_0x9c13('0xd'),auth[_0x9c13('0x9')](),controller[_0x9c13('0xe')]);router['post']('/',auth[_0x9c13('0x9')](),controller['create']);router[_0x9c13('0xf')](_0x9c13('0xd'),auth[_0x9c13('0x9')](),controller[_0x9c13('0x10')]);router['delete'](_0x9c13('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc9d9=['multer','path','express','../../components/interaction/service','isAuthenticated','index','/describe','get','/:id','post','create','put','delete','destroy','exports'];(function(_0x4ef406,_0x450bff){var _0x17af13=function(_0x5a8dc0){while(--_0x5a8dc0){_0x4ef406['push'](_0x4ef406['shift']());}};_0x17af13(++_0x450bff);}(_0xc9d9,0x195));var _0x9c9d=function(_0xebf2a0,_0x3e0ed1){_0xebf2a0=_0xebf2a0-0x0;var _0x2439be=_0xc9d9[_0xebf2a0];return _0x2439be;};'use strict';var multer=require(_0x9c9d('0x0'));var util=require('util');var path=require(_0x9c9d('0x1'));var timeout=require('connect-timeout');var express=require(_0x9c9d('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9c9d('0x3'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0x9c9d('0x4')](),controller[_0x9c9d('0x5')]);router['get'](_0x9c9d('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x9c9d('0x7')](_0x9c9d('0x8'),auth[_0x9c9d('0x4')](),controller['show']);router[_0x9c9d('0x9')]('/',auth[_0x9c9d('0x4')](),controller[_0x9c9d('0xa')]);router[_0x9c9d('0xb')](_0x9c9d('0x8'),auth[_0x9c9d('0x4')](),controller['update']);router[_0x9c9d('0xc')](_0x9c9d('0x8'),auth[_0x9c9d('0x4')](),controller[_0x9c9d('0xd')]);module[_0x9c9d('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
index afbc44b..4857fe5 100644
--- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
+++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['agent','queue','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x5dda62,_0x3cfc26){var _0x46cc3b=function(_0x368441){while(--_0x368441){_0x5dda62['push'](_0x5dda62['shift']());}};_0x46cc3b(++_0x3cfc26);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2610e1,_0x5a86f1){_0x2610e1=_0x2610e1-0x0;var _0xef812e=_0x5f2f[_0x2610e1];return _0xef812e;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'uniqueid':{'type':Sequelize[_0xf5f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf5f2('0x3')](_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf5f2('0x7')]}};
\ No newline at end of file
+var _0x5f2f=['agent','queue','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x51ab2b,_0x3b00d1){var _0x1b3d5f=function(_0x22b37a){while(--_0x22b37a){_0x51ab2b['push'](_0x51ab2b['shift']());}};_0x1b3d5f(++_0x3b00d1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ec473,_0x2e9c3a){_0x5ec473=_0x5ec473-0x0;var _0x581e90=_0x5f2f[_0x5ec473];return _0x581e90;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'uniqueid':{'type':Sequelize[_0xf5f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf5f2('0x3')](_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf5f2('0x7')]}};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js
index 968361c..a20eeec 100644
--- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js
+++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6815=['find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','apply','reject','save','update','then','destroy','error','name','send','map','WhatsappTransferReport','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','rawAttributes','length'];(function(_0x500384,_0x55595d){var _0x28ff7c=function(_0x317714){while(--_0x317714){_0x500384['push'](_0x500384['shift']());}};_0x28ff7c(++_0x55595d);}(_0x6815,0x1a2));var _0x5681=function(_0x4b612c,_0x6eb4c2){_0x4b612c=_0x4b612c-0x0;var _0x8b7601=_0x6815[_0x4b612c];return _0x8b7601;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5681('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5681('0x1'));var rp=require(_0x5681('0x2'));var moment=require(_0x5681('0x3'));var BPromise=require(_0x5681('0x4'));var Mustache=require('mustache');var util=require(_0x5681('0x5'));var path=require(_0x5681('0x6'));var sox=require(_0x5681('0x7'));var csv=require(_0x5681('0x8'));var ejs=require(_0x5681('0x9'));var fs=require('fs');var _=require(_0x5681('0xa'));var squel=require(_0x5681('0xb'));var crypto=require(_0x5681('0xc'));var jsforce=require(_0x5681('0xd'));var deskjs=require(_0x5681('0xe'));var toCsv=require(_0x5681('0x8'));var querystring=require('querystring');var Papa=require(_0x5681('0xf'));var Redis=require('ioredis');var authService=require(_0x5681('0x10'));var qs=require(_0x5681('0x11'));var as=require(_0x5681('0x12'));var hardwareService=require(_0x5681('0x13'));var logger=require(_0x5681('0x14'))(_0x5681('0x15'));var utils=require(_0x5681('0x16'));var config=require('../../config/environment');var db=require(_0x5681('0x17'))['db'];function respondWithStatusCode(_0x537e7a,_0x4b73d5){_0x4b73d5=_0x4b73d5||0xcc;return function(_0x1a1830){if(_0x1a1830){return _0x537e7a[_0x5681('0x18')](_0x4b73d5);}return _0x537e7a[_0x5681('0x19')](_0x4b73d5)[_0x5681('0x1a')]();};}function respondWithResult(_0x97408b,_0x8fda40){_0x8fda40=_0x8fda40||0xc8;return function(_0x4e9c0c){if(_0x4e9c0c){return _0x97408b[_0x5681('0x19')](_0x8fda40)['json'](_0x4e9c0c);}};}function respondWithFilteredResult(_0x1cf74f,_0x3d9406){return function(_0x50bdba){if(_0x50bdba){var _0x3f6be9=_0x50bdba['count'],_0x3557b2=_0x3d9406[_0x5681('0x1b')],_0xe6c886=_0x3d9406[_0x5681('0x1b')]+_0x3d9406[_0x5681('0x1c')],_0x202573;if(_0xe6c886>=_0x3f6be9){_0xe6c886=_0x3f6be9;_0x202573=0xc8;}else{_0x202573=0xce;}_0x1cf74f['status'](_0x202573);return _0x1cf74f['set']('Content-Range',_0x3557b2+'-'+_0xe6c886+'/'+_0x3f6be9)['json'](_0x50bdba);}return null;};}function patchUpdates(_0x3b5ed3){return function(_0x1f6dfa){try{jsonpatch[_0x5681('0x1d')](_0x1f6dfa,_0x3b5ed3,!![]);}catch(_0x1bba0f){return BPromise[_0x5681('0x1e')](_0x1bba0f);}return _0x1f6dfa[_0x5681('0x1f')]();};}function saveUpdates(_0x2e370b,_0x222a61){return function(_0x17f774){if(_0x17f774){return _0x17f774[_0x5681('0x20')](_0x2e370b)[_0x5681('0x21')](function(_0x4359ad){return _0x4359ad;});}return null;};}function removeEntity(_0x2b2208,_0x3e3953){return function(_0x29a4a4){if(_0x29a4a4){return _0x29a4a4[_0x5681('0x22')]()[_0x5681('0x21')](function(){_0x2b2208[_0x5681('0x19')](0xcc)[_0x5681('0x1a')]();});}};}function handleEntityNotFound(_0x5c6164,_0x3fd74a){return function(_0x9b6895){if(!_0x9b6895){_0x5c6164[_0x5681('0x18')](0x194);}return _0x9b6895;};}function handleError(_0x3d7da9,_0x5c0599){_0x5c0599=_0x5c0599||0x1f4;return function(_0x45e2ce){logger[_0x5681('0x23')](_0x45e2ce['stack']);if(_0x45e2ce[_0x5681('0x24')]){delete _0x45e2ce['name'];}_0x3d7da9['status'](_0x5c0599)[_0x5681('0x25')](_0x45e2ce);};}exports['index']=function(_0x3f86fe,_0xeeecc0){var _0x4946e3={},_0x43a933={},_0x4846b5={'count':0x0,'rows':[]};var _0x437734=_[_0x5681('0x26')](db[_0x5681('0x27')]['rawAttributes'],function(_0x102c29){return{'name':_0x102c29['fieldName'],'type':_0x102c29[_0x5681('0x28')][_0x5681('0x29')]};});_0x43a933[_0x5681('0x2a')]=_[_0x5681('0x26')](_0x437734,_0x5681('0x24'));_0x43a933['query']=_[_0x5681('0x2b')](_0x3f86fe[_0x5681('0x2c')]);_0x43a933['filters']=_[_0x5681('0x2d')](_0x43a933['model'],_0x43a933[_0x5681('0x2c')]);_0x4946e3[_0x5681('0x2e')]=_[_0x5681('0x2d')](_0x43a933['model'],qs[_0x5681('0x2f')](_0x3f86fe[_0x5681('0x2c')][_0x5681('0x2f')]));_0x4946e3[_0x5681('0x2e')]=_0x4946e3['attributes']['length']?_0x4946e3[_0x5681('0x2e')]:_0x43a933[_0x5681('0x2a')];if(!_0x3f86fe[_0x5681('0x2c')][_0x5681('0x30')](_0x5681('0x31'))){_0x4946e3[_0x5681('0x1c')]=qs[_0x5681('0x1c')](_0x3f86fe[_0x5681('0x2c')][_0x5681('0x1c')]);_0x4946e3[_0x5681('0x1b')]=qs[_0x5681('0x1b')](_0x3f86fe[_0x5681('0x2c')]['offset']);}_0x4946e3[_0x5681('0x32')]=qs[_0x5681('0x33')](_0x3f86fe['query'][_0x5681('0x33')]);_0x4946e3[_0x5681('0x34')]=qs[_0x5681('0x35')](_[_0x5681('0x36')](_0x3f86fe[_0x5681('0x2c')],_0x43a933[_0x5681('0x35')]),_0x437734);if(_0x3f86fe[_0x5681('0x2c')][_0x5681('0x37')]){_0x4946e3[_0x5681('0x34')]=_[_0x5681('0x38')](_0x4946e3['where'],{'$or':_[_0x5681('0x26')](_0x437734,function(_0x181ec9){if(_0x181ec9[_0x5681('0x28')]!==_0x5681('0x39')){var _0x58bbe9={};_0x58bbe9[_0x181ec9[_0x5681('0x24')]]={'$like':'%'+_0x3f86fe[_0x5681('0x2c')][_0x5681('0x37')]+'%'};return _0x58bbe9;}})});}_0x4946e3=_[_0x5681('0x38')]({},_0x4946e3,_0x3f86fe[_0x5681('0x3a')]);var _0x5159fc={'where':_0x4946e3['where']};return db[_0x5681('0x27')][_0x5681('0x3b')](_0x5159fc)[_0x5681('0x21')](function(_0x23c4df){_0x4846b5[_0x5681('0x3b')]=_0x23c4df;if(_0x3f86fe['query']['includeAll']){_0x4946e3[_0x5681('0x3c')]=[{'all':!![]}];}return db[_0x5681('0x27')]['findAll'](_0x4946e3);})['then'](function(_0x237966){_0x4846b5[_0x5681('0x3d')]=_0x237966;return _0x4846b5;})[_0x5681('0x21')](respondWithFilteredResult(_0xeeecc0,_0x4946e3))[_0x5681('0x3e')](handleError(_0xeeecc0,null));};exports['show']=function(_0x29a125,_0x272c9d){var _0x16592b={'raw':!![],'where':{'id':_0x29a125['params']['id']}},_0x49ad6e={};_0x49ad6e[_0x5681('0x2a')]=_[_0x5681('0x2b')](db[_0x5681('0x27')][_0x5681('0x3f')]);_0x49ad6e[_0x5681('0x2c')]=_[_0x5681('0x2b')](_0x29a125[_0x5681('0x2c')]);_0x49ad6e[_0x5681('0x35')]=_['intersection'](_0x49ad6e[_0x5681('0x2a')],_0x49ad6e[_0x5681('0x2c')]);_0x16592b[_0x5681('0x2e')]=_[_0x5681('0x2d')](_0x49ad6e[_0x5681('0x2a')],qs['fields'](_0x29a125[_0x5681('0x2c')][_0x5681('0x2f')]));_0x16592b['attributes']=_0x16592b[_0x5681('0x2e')][_0x5681('0x40')]?_0x16592b[_0x5681('0x2e')]:_0x49ad6e['model'];if(_0x29a125[_0x5681('0x2c')]['includeAll']){_0x16592b[_0x5681('0x3c')]=[{'all':!![]}];}_0x16592b=_[_0x5681('0x38')]({},_0x16592b,_0x29a125[_0x5681('0x3a')]);return db[_0x5681('0x27')][_0x5681('0x41')](_0x16592b)[_0x5681('0x21')](handleEntityNotFound(_0x272c9d,null))[_0x5681('0x21')](respondWithResult(_0x272c9d,null))['catch'](handleError(_0x272c9d,null));};exports[_0x5681('0x42')]=function(_0x242243,_0x1a258d){return db[_0x5681('0x27')]['create'](_0x242243[_0x5681('0x43')],{})[_0x5681('0x21')](respondWithResult(_0x1a258d,0xc9))[_0x5681('0x3e')](handleError(_0x1a258d,null));};exports[_0x5681('0x20')]=function(_0x488664,_0x412715){if(_0x488664['body']['id']){delete _0x488664['body']['id'];}return db[_0x5681('0x27')][_0x5681('0x41')]({'where':{'id':_0x488664['params']['id']}})[_0x5681('0x21')](handleEntityNotFound(_0x412715,null))[_0x5681('0x21')](saveUpdates(_0x488664[_0x5681('0x43')],null))[_0x5681('0x21')](respondWithResult(_0x412715,null))[_0x5681('0x3e')](handleError(_0x412715,null));};exports[_0x5681('0x22')]=function(_0x1aa856,_0x3b993f){return db['WhatsappTransferReport'][_0x5681('0x41')]({'where':{'id':_0x1aa856['params']['id']}})[_0x5681('0x21')](handleEntityNotFound(_0x3b993f,null))['then'](removeEntity(_0x3b993f,null))['catch'](handleError(_0x3b993f,null));};exports[_0x5681('0x44')]=function(_0x5856bd,_0x2b53f1){return db[_0x5681('0x27')]['describe']()[_0x5681('0x21')](respondWithResult(_0x2b53f1,null))['catch'](handleError(_0x2b53f1,null));};
\ No newline at end of file
+var _0x0b47=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','catch','params','keys','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','reject','update','then','destroy','error','stack','name','send','map','WhatsappTransferReport','fieldName','key','model','query','filters','attributes'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x0b47,0x16b));var _0x70b4=function(_0x472963,_0x25c31f){_0x472963=_0x472963-0x0;var _0x544507=_0x0b47[_0x472963];return _0x544507;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x70b4('0x0'));var rimraf=require(_0x70b4('0x1'));var zipdir=require(_0x70b4('0x2'));var jsonpatch=require(_0x70b4('0x3'));var rp=require(_0x70b4('0x4'));var moment=require(_0x70b4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x70b4('0x6'));var util=require(_0x70b4('0x7'));var path=require(_0x70b4('0x8'));var sox=require(_0x70b4('0x9'));var csv=require(_0x70b4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x70b4('0xb'));var squel=require('squel');var crypto=require(_0x70b4('0xc'));var jsforce=require(_0x70b4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x70b4('0xa'));var querystring=require('querystring');var Papa=require(_0x70b4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x70b4('0xf'));var as=require(_0x70b4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70b4('0x11'))(_0x70b4('0x12'));var utils=require(_0x70b4('0x13'));var config=require(_0x70b4('0x14'));var db=require(_0x70b4('0x15'))['db'];function respondWithStatusCode(_0x4c347b,_0x5dea68){_0x5dea68=_0x5dea68||0xcc;return function(_0x23fae0){if(_0x23fae0){return _0x4c347b[_0x70b4('0x16')](_0x5dea68);}return _0x4c347b[_0x70b4('0x17')](_0x5dea68)[_0x70b4('0x18')]();};}function respondWithResult(_0x1506bb,_0x3e17bd){_0x3e17bd=_0x3e17bd||0xc8;return function(_0xbde08f){if(_0xbde08f){return _0x1506bb['status'](_0x3e17bd)['json'](_0xbde08f);}};}function respondWithFilteredResult(_0xa7a110,_0x348c64){return function(_0x152a8d){if(_0x152a8d){var _0x17ce4f=_0x152a8d[_0x70b4('0x19')],_0x27611c=_0x348c64['offset'],_0x423925=_0x348c64[_0x70b4('0x1a')]+_0x348c64[_0x70b4('0x1b')],_0x4ac876;if(_0x423925>=_0x17ce4f){_0x423925=_0x17ce4f;_0x4ac876=0xc8;}else{_0x4ac876=0xce;}_0xa7a110[_0x70b4('0x17')](_0x4ac876);return _0xa7a110['set'](_0x70b4('0x1c'),_0x27611c+'-'+_0x423925+'/'+_0x17ce4f)['json'](_0x152a8d);}return null;};}function patchUpdates(_0x63a09){return function(_0x52fab9){try{jsonpatch['apply'](_0x52fab9,_0x63a09,!![]);}catch(_0x2caa28){return BPromise[_0x70b4('0x1d')](_0x2caa28);}return _0x52fab9['save']();};}function saveUpdates(_0x56d144,_0x334f7d){return function(_0x415b0f){if(_0x415b0f){return _0x415b0f[_0x70b4('0x1e')](_0x56d144)[_0x70b4('0x1f')](function(_0x308f07){return _0x308f07;});}return null;};}function removeEntity(_0x3961b2,_0x2ce13e){return function(_0x1c9bc2){if(_0x1c9bc2){return _0x1c9bc2[_0x70b4('0x20')]()[_0x70b4('0x1f')](function(){_0x3961b2[_0x70b4('0x17')](0xcc)[_0x70b4('0x18')]();});}};}function handleEntityNotFound(_0x4c72c5,_0x3bdf1e){return function(_0x52ef5f){if(!_0x52ef5f){_0x4c72c5[_0x70b4('0x16')](0x194);}return _0x52ef5f;};}function handleError(_0xc483de,_0x11c2c4){_0x11c2c4=_0x11c2c4||0x1f4;return function(_0x1e296d){logger[_0x70b4('0x21')](_0x1e296d[_0x70b4('0x22')]);if(_0x1e296d['name']){delete _0x1e296d[_0x70b4('0x23')];}_0xc483de[_0x70b4('0x17')](_0x11c2c4)[_0x70b4('0x24')](_0x1e296d);};}exports['index']=function(_0x519e07,_0x34d740){var _0x2255b4={},_0x470cc8={},_0xe02575={'count':0x0,'rows':[]};var _0x2dbb70=_[_0x70b4('0x25')](db[_0x70b4('0x26')]['rawAttributes'],function(_0x2c1879){return{'name':_0x2c1879[_0x70b4('0x27')],'type':_0x2c1879['type'][_0x70b4('0x28')]};});_0x470cc8[_0x70b4('0x29')]=_[_0x70b4('0x25')](_0x2dbb70,_0x70b4('0x23'));_0x470cc8[_0x70b4('0x2a')]=_['keys'](_0x519e07[_0x70b4('0x2a')]);_0x470cc8[_0x70b4('0x2b')]=_['intersection'](_0x470cc8[_0x70b4('0x29')],_0x470cc8[_0x70b4('0x2a')]);_0x2255b4[_0x70b4('0x2c')]=_[_0x70b4('0x2d')](_0x470cc8[_0x70b4('0x29')],qs[_0x70b4('0x2e')](_0x519e07[_0x70b4('0x2a')][_0x70b4('0x2e')]));_0x2255b4['attributes']=_0x2255b4['attributes'][_0x70b4('0x2f')]?_0x2255b4[_0x70b4('0x2c')]:_0x470cc8[_0x70b4('0x29')];if(!_0x519e07[_0x70b4('0x2a')][_0x70b4('0x30')](_0x70b4('0x31'))){_0x2255b4[_0x70b4('0x1b')]=qs[_0x70b4('0x1b')](_0x519e07['query']['limit']);_0x2255b4[_0x70b4('0x1a')]=qs[_0x70b4('0x1a')](_0x519e07[_0x70b4('0x2a')][_0x70b4('0x1a')]);}_0x2255b4[_0x70b4('0x32')]=qs[_0x70b4('0x33')](_0x519e07['query'][_0x70b4('0x33')]);_0x2255b4[_0x70b4('0x34')]=qs[_0x70b4('0x2b')](_['pick'](_0x519e07[_0x70b4('0x2a')],_0x470cc8['filters']),_0x2dbb70);if(_0x519e07['query'][_0x70b4('0x35')]){_0x2255b4[_0x70b4('0x34')]=_[_0x70b4('0x36')](_0x2255b4['where'],{'$or':_['map'](_0x2dbb70,function(_0x4d7efe){if(_0x4d7efe[_0x70b4('0x37')]!==_0x70b4('0x38')){var _0xcbca9b={};_0xcbca9b[_0x4d7efe[_0x70b4('0x23')]]={'$like':'%'+_0x519e07[_0x70b4('0x2a')][_0x70b4('0x35')]+'%'};return _0xcbca9b;}})});}_0x2255b4=_[_0x70b4('0x36')]({},_0x2255b4,_0x519e07[_0x70b4('0x39')]);var _0x300461={'where':_0x2255b4['where']};return db[_0x70b4('0x26')][_0x70b4('0x19')](_0x300461)[_0x70b4('0x1f')](function(_0x32b731){_0xe02575[_0x70b4('0x19')]=_0x32b731;if(_0x519e07[_0x70b4('0x2a')]['includeAll']){_0x2255b4[_0x70b4('0x3a')]=[{'all':!![]}];}return db[_0x70b4('0x26')]['findAll'](_0x2255b4);})['then'](function(_0x1fc0f4){_0xe02575['rows']=_0x1fc0f4;return _0xe02575;})['then'](respondWithFilteredResult(_0x34d740,_0x2255b4))[_0x70b4('0x3b')](handleError(_0x34d740,null));};exports['show']=function(_0x447edf,_0x372083){var _0x59a9a0={'raw':!![],'where':{'id':_0x447edf[_0x70b4('0x3c')]['id']}},_0x54d13f={};_0x54d13f[_0x70b4('0x29')]=_[_0x70b4('0x3d')](db[_0x70b4('0x26')][_0x70b4('0x3e')]);_0x54d13f[_0x70b4('0x2a')]=_[_0x70b4('0x3d')](_0x447edf[_0x70b4('0x2a')]);_0x54d13f[_0x70b4('0x2b')]=_[_0x70b4('0x2d')](_0x54d13f[_0x70b4('0x29')],_0x54d13f[_0x70b4('0x2a')]);_0x59a9a0['attributes']=_['intersection'](_0x54d13f[_0x70b4('0x29')],qs['fields'](_0x447edf[_0x70b4('0x2a')]['fields']));_0x59a9a0['attributes']=_0x59a9a0['attributes']['length']?_0x59a9a0[_0x70b4('0x2c')]:_0x54d13f[_0x70b4('0x29')];if(_0x447edf[_0x70b4('0x2a')][_0x70b4('0x3f')]){_0x59a9a0[_0x70b4('0x3a')]=[{'all':!![]}];}_0x59a9a0=_[_0x70b4('0x36')]({},_0x59a9a0,_0x447edf['options']);return db[_0x70b4('0x26')][_0x70b4('0x40')](_0x59a9a0)[_0x70b4('0x1f')](handleEntityNotFound(_0x372083,null))['then'](respondWithResult(_0x372083,null))['catch'](handleError(_0x372083,null));};exports[_0x70b4('0x41')]=function(_0x3221f7,_0x5742f6){return db[_0x70b4('0x26')]['create'](_0x3221f7['body'],{})[_0x70b4('0x1f')](respondWithResult(_0x5742f6,0xc9))[_0x70b4('0x3b')](handleError(_0x5742f6,null));};exports[_0x70b4('0x1e')]=function(_0x3becf5,_0x868dd5){if(_0x3becf5[_0x70b4('0x42')]['id']){delete _0x3becf5[_0x70b4('0x42')]['id'];}return db[_0x70b4('0x26')][_0x70b4('0x40')]({'where':{'id':_0x3becf5[_0x70b4('0x3c')]['id']}})[_0x70b4('0x1f')](handleEntityNotFound(_0x868dd5,null))[_0x70b4('0x1f')](saveUpdates(_0x3becf5[_0x70b4('0x42')],null))[_0x70b4('0x1f')](respondWithResult(_0x868dd5,null))[_0x70b4('0x3b')](handleError(_0x868dd5,null));};exports[_0x70b4('0x20')]=function(_0x204926,_0x363309){return db[_0x70b4('0x26')][_0x70b4('0x40')]({'where':{'id':_0x204926[_0x70b4('0x3c')]['id']}})[_0x70b4('0x1f')](handleEntityNotFound(_0x363309,null))[_0x70b4('0x1f')](removeEntity(_0x363309,null))[_0x70b4('0x3b')](handleError(_0x363309,null));};exports[_0x70b4('0x43')]=function(_0x2197a7,_0x16c0bb){return db['WhatsappTransferReport'][_0x70b4('0x43')]()[_0x70b4('0x1f')](respondWithResult(_0x16c0bb,null))[_0x70b4('0x3b')](handleError(_0x16c0bb,null));};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js
index d8aa4b6..22cd12a 100644
--- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js
+++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb2d2=['util','api','moment','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x2f7d36,_0x6c8153){var _0x300cf9=function(_0x487534){while(--_0x487534){_0x2f7d36['push'](_0x2f7d36['shift']());}};_0x300cf9(++_0x6c8153);}(_0xb2d2,0xa7));var _0x2b2d=function(_0x5388d7,_0x138e82){_0x5388d7=_0x5388d7-0x0;var _0x576d49=_0xb2d2[_0x5388d7];return _0x576d49;};'use strict';var _=require(_0x2b2d('0x0'));var util=require(_0x2b2d('0x1'));var logger=require('../../config/logger')(_0x2b2d('0x2'));var moment=require(_0x2b2d('0x3'));var BPromise=require(_0x2b2d('0x4'));var rp=require(_0x2b2d('0x5'));var fs=require('fs');var path=require(_0x2b2d('0x6'));var rimraf=require(_0x2b2d('0x7'));var config=require('../../config/environment');var attributes=require(_0x2b2d('0x8'));module['exports']=function(_0x63dae3,_0x136bc1){return _0x63dae3['define'](_0x2b2d('0x9'),attributes,{'tableName':_0x2b2d('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2b2d('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6766=['exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes'];(function(_0xc64946,_0x229695){var _0x2f66e5=function(_0x3028d5){while(--_0x3028d5){_0xc64946['push'](_0xc64946['shift']());}};_0x2f66e5(++_0x229695);}(_0x6766,0x1e5));var _0x6676=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x6766[_0x2ff4bd];return _0x28edc6;};'use strict';var _=require('lodash');var util=require(_0x6676('0x0'));var logger=require(_0x6676('0x1'))(_0x6676('0x2'));var moment=require(_0x6676('0x3'));var BPromise=require(_0x6676('0x4'));var rp=require(_0x6676('0x5'));var fs=require('fs');var path=require(_0x6676('0x6'));var rimraf=require(_0x6676('0x7'));var config=require(_0x6676('0x8'));var attributes=require(_0x6676('0x9'));module[_0x6676('0xa')]=function(_0x46f864,_0x15cebb){return _0x46f864[_0x6676('0xb')](_0x6676('0xc'),attributes,{'tableName':_0x6676('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6676('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
index c40e006..ff30aa8 100644
--- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
+++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5be891,_0xf27226){var _0x434bce=function(_0x528fdb){while(--_0x528fdb){_0x5be891['push'](_0x5be891['shift']());}};_0x434bce(++_0xf27226);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x818426,_0x1f376f){var _0x1cfa74=function(_0x56716a){while(--_0x56716a){_0x818426['push'](_0x818426['shift']());}};_0x1cfa74(++_0x1f376f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/app.js b/server/app.js
index 24f4f88..fccec37 100644
--- a/server/app.js
+++ b/server/app.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7fd=['lodash','./mysqldb','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','start','info','Online\x20apps:','map','filter','online','name','Offline\x20apps:','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s'];(function(_0x2e65ee,_0x29dad9){var _0x4c712a=function(_0xca593f){while(--_0xca593f){_0x2e65ee['push'](_0x2e65ee['shift']());}};_0x4c712a(++_0x29dad9);}(_0xb7fd,0x122));var _0xdb7f=function(_0x5c616f,_0x4ace32){_0x5c616f=_0x5c616f-0x0;var _0x167d23=_0xb7fd[_0x5c616f];return _0x167d23;};'use strict';var _=require(_0xdb7f('0x0'));var mysqldb=require(_0xdb7f('0x1'));var rpc=require('./rpc');var config=require(_0xdb7f('0x2'));var logger=require(_0xdb7f('0x3'))(_0xdb7f('0x4'));var pm2=require(_0xdb7f('0x5'));var pm2Config=require(_0xdb7f('0x6'));var schedule=require(_0xdb7f('0x7'));var chat=require(_0xdb7f('0x8'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xdb7f('0x9')][_0xdb7f('0xa')]()[_0xdb7f('0xb')](function(){return rpc[_0xdb7f('0xc')]();})[_0xdb7f('0xb')](function(_0x22a207){logger['info'](_0x22a207);return chat[_0xdb7f('0xd')]();})[_0xdb7f('0xb')](function(){return schedule[_0xdb7f('0xd')]();})[_0xdb7f('0xb')](function(){return transcribe[_0xdb7f('0xd')]();})[_0xdb7f('0xb')](function(_0x5f54df){logger[_0xdb7f('0xe')](_0x5f54df);return pm2[_0xdb7f('0xd')](pm2Config);})[_0xdb7f('0xb')](function(_0x4f79cb){logger['info'](_0xdb7f('0xf'),_[_0xdb7f('0x10')](_[_0xdb7f('0x11')](_0x4f79cb,{'status':_0xdb7f('0x12')}),_0xdb7f('0x13'))['join']());logger[_0xdb7f('0xe')](_0xdb7f('0x14'),_[_0xdb7f('0x10')](_[_0xdb7f('0x11')](_0x4f79cb,function(_0x259e3f){return _0x259e3f['status']!==_0xdb7f('0x12');}),_0xdb7f('0x13'))['join']()||_0xdb7f('0x15'));config[_0xdb7f('0x16')]&&require(_0xdb7f('0x17'))[_0xdb7f('0x18')]();require(_0xdb7f('0x19'))['default']();})[_0xdb7f('0x1a')](function(_0x2a3ffc){logger[_0xdb7f('0x1b')](_0xdb7f('0x1c'),_0x2a3ffc);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0x7cad=['join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','error','exit','lodash','./rpc','./config/environment','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','then','info','start','filter','online','name'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7cad,0x128));var _0xd7ca=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x7cad[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0xd7ca('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xd7ca('0x1'));var config=require(_0xd7ca('0x2'));var logger=require('./config/logger')('app');var pm2=require(_0xd7ca('0x3'));var pm2Config=require(_0xd7ca('0x4'));var schedule=require(_0xd7ca('0x5'));var chat=require(_0xd7ca('0x6'));var transcribe=require(_0xd7ca('0x7'));function main(){return mysqldb['db'][_0xd7ca('0x8')][_0xd7ca('0x9')]()[_0xd7ca('0xa')](function(){return rpc['listen']();})['then'](function(_0x5b8d45){logger[_0xd7ca('0xb')](_0x5b8d45);return chat[_0xd7ca('0xc')]();})[_0xd7ca('0xa')](function(){return schedule['start']();})[_0xd7ca('0xa')](function(){return transcribe['start']();})['then'](function(_0x7f76fc){logger[_0xd7ca('0xb')](_0x7f76fc);return pm2[_0xd7ca('0xc')](pm2Config);})[_0xd7ca('0xa')](function(_0x244015){logger[_0xd7ca('0xb')]('Online\x20apps:',_['map'](_[_0xd7ca('0xd')](_0x244015,{'status':_0xd7ca('0xe')}),_0xd7ca('0xf'))[_0xd7ca('0x10')]());logger[_0xd7ca('0xb')](_0xd7ca('0x11'),_['map'](_['filter'](_0x244015,function(_0x55c8ab){return _0x55c8ab[_0xd7ca('0x12')]!==_0xd7ca('0xe');}),_0xd7ca('0xf'))[_0xd7ca('0x10')]()||_0xd7ca('0x13'));config[_0xd7ca('0x14')]&&require(_0xd7ca('0x15'))[_0xd7ca('0x16')]();require(_0xd7ca('0x17'))[_0xd7ca('0x16')]();})['catch'](function(_0x3e1511){logger[_0xd7ca('0x18')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x3e1511);process[_0xd7ca('0x19')](0x1);});}main();
\ No newline at end of file
diff --git a/server/components/auth/service.js b/server/components/auth/service.js
index cb05e8e..33c9f42 100644
--- a/server/components/auth/service.js
+++ b/server/components/auth/service.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b21=['phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','isChatInteractionAuthorized','isAuthenticated','use','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','authorization','headers','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','user','catch','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','setTokenCookie','cookie','redirect','send','retrieveApiKey','isNil','apiKeyNonce','generateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','payload','randomBytes','toString','hex','floor','now','HS512','../../config/license/hardware','lodash','express-jwt','composable-middleware','basic-auth','bluebird','secrets','session','role','fullname','name','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording'];(function(_0x4737aa,_0x266f4b){var _0x275ab2=function(_0x2d4454){while(--_0x2d4454){_0x4737aa['push'](_0x4737aa['shift']());}};_0x275ab2(++_0x266f4b);}(_0x9b21,0x9d));var _0x19b2=function(_0x20fe72,_0x2665e1){_0x20fe72=_0x20fe72-0x0;var _0x370e09=_0x9b21[_0x20fe72];return _0x370e09;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x19b2('0x0'));var _=require(_0x19b2('0x1'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x19b2('0x2'));var compose=require(_0x19b2('0x3'));var basicAuth=require(_0x19b2('0x4'));var crypto=require('crypto');var BPromise=require(_0x19b2('0x5'));var validateJwt=expressJwt({'secret':config[_0x19b2('0x6')][_0x19b2('0x7')]});var userAttributes=['id',_0x19b2('0x8'),_0x19b2('0x9'),_0x19b2('0xa'),_0x19b2('0xb'),_0x19b2('0xc'),'userpic',_0x19b2('0xd'),_0x19b2('0xe'),_0x19b2('0xf'),_0x19b2('0x10'),_0x19b2('0x11'),_0x19b2('0x12'),_0x19b2('0x13'),'openchannelPause','pauseType',_0x19b2('0x14'),_0x19b2('0x15'),_0x19b2('0x16'),'crudPermissions',_0x19b2('0x17'),_0x19b2('0x18'),_0x19b2('0x19'),_0x19b2('0x1a'),_0x19b2('0x1b'),'phoneBarDnd',_0x19b2('0x1c'),_0x19b2('0x1d'),_0x19b2('0x1e'),_0x19b2('0x1f'),_0x19b2('0x20'),'phoneBarRemoteControl',_0x19b2('0x21'),_0x19b2('0x22'),_0x19b2('0x23'),'userProfileId'];exports[_0x19b2('0x24')]=function(){return this[_0x19b2('0x25')](!![])[_0x19b2('0x26')](function(_0x592d59,_0x108c70,_0x285b6d){if(_0x592d59['user']){_0x285b6d();}else{return db['ChatInteraction'][_0x19b2('0x27')]({'where':{'id':_0x592d59[_0x19b2('0x28')]['id']},'attributes':['id',_0x19b2('0x29'),_0x19b2('0x2a')],'raw':!![]})[_0x19b2('0x2b')](function(_0xaa219d){if(_0xaa219d&&_0xaa219d[_0x19b2('0x29')]){return _0x108c70['status'](_0xaa219d[_0x19b2('0x2a')]===_0x19b2('0x2c')?0x195:0x193)[_0x19b2('0x2d')]({'message':_0xaa219d['disposition']===_0x19b2('0x2c')?_0x19b2('0x2e'):_0x19b2('0x2f')});}else{_0x285b6d();}})['catch'](function(_0x3ea6bb){_0x285b6d(_0x3ea6bb);});}});};exports[_0x19b2('0x25')]=function isAuthenticated(_0x144a78){return compose()[_0x19b2('0x26')](function(_0x101f0c,_0x3f24e9,_0x2956af){if(_0x101f0c['headers'][_0x19b2('0x30')]){if(_['startsWith'](_0x101f0c[_0x19b2('0x31')][_0x19b2('0x30')],_0x19b2('0x32'))){var _0x3c4911=basicAuth(_0x101f0c);db[_0x19b2('0x33')][_0x19b2('0x34')]({'where':{'name':_0x3c4911[_0x19b2('0xa')]}})[_0x19b2('0x2b')](function(_0x27c39f){if(!_0x27c39f||!_0x27c39f[_0x19b2('0x35')](_0x3c4911[_0x19b2('0x36')])){return _0x3f24e9[_0x19b2('0x37')](0x191)[_0x19b2('0x2d')]({'message':_0x19b2('0x38')});}_0x101f0c[_0x19b2('0x39')]={'id':_0x27c39f['id']};_0x2956af();})[_0x19b2('0x3a')](function(_0x28d466){_0x2956af(_0x28d466);});}else if(_[_0x19b2('0x3b')](_0x101f0c[_0x19b2('0x31')][_0x19b2('0x30')],_0x19b2('0x3c'))){validateJwt(_0x101f0c,_0x3f24e9,_0x2956af);}else{if(_0x144a78){_0x2956af();}else{return _0x3f24e9[_0x19b2('0x37')](0x193)[_0x19b2('0x2d')]({'message':_0x19b2('0x3d')});}}}else if(_0x101f0c[_0x19b2('0x3e')][_0x19b2('0x3f')]){try{var _0x18be38={'audience':hardwareConf[_0x19b2('0x40')](),'issuer':hardwareConf[_0x19b2('0x40')]()};verifyJwt(_0x101f0c[_0x19b2('0x3e')][_0x19b2('0x3f')],_0x18be38)[_0x19b2('0x2b')](function(_0x21c82d){return db[_0x19b2('0x33')][_0x19b2('0x34')]({'where':{'id':_0x21c82d['sub']}})['then'](function(_0xf5ae99){if(!_0xf5ae99||!_['isEqual'](_0xf5ae99['apiKeyNonce'],_0x21c82d[_0x19b2('0x41')])){return _0x3f24e9['status'](0x191)[_0x19b2('0x2d')]({'message':_0x19b2('0x42')});}_0x101f0c[_0x19b2('0x39')]={'id':_0xf5ae99['id']};_0x2956af();});})['catch'](function(){return _0x3f24e9['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x3e4e74){_0x2956af(_0x3e4e74);}}else if(_0x144a78){_0x2956af();}else{return _0x3f24e9[_0x19b2('0x37')](0x193)[_0x19b2('0x2d')]({'message':_0x19b2('0x3d')});}})['use'](function(_0x27acc2,_0x1f5e04,_0x2231b7){if(_0x27acc2[_0x19b2('0x39')]){db[_0x19b2('0x33')][_0x19b2('0x34')]({'where':{'id':_0x27acc2[_0x19b2('0x39')]['id']},'attributes':userAttributes})[_0x19b2('0x2b')](function(_0x35ba27){if(!_0x35ba27){return _0x1f5e04[_0x19b2('0x37')](0x194)[_0x19b2('0x2d')]({'message':_0x19b2('0x43')});}_0x27acc2[_0x19b2('0x39')]=_0x35ba27;_0x2231b7();})[_0x19b2('0x3a')](function(_0x23525b){_0x2231b7(_0x23525b);});}else if(_0x144a78){_0x2231b7();}else{return _0x1f5e04[_0x19b2('0x37')](0x194)['json']({'message':_0x19b2('0x44')});}});};exports[_0x19b2('0x45')]=function canUpdate(){return compose()[_0x19b2('0x26')](function(_0x389f8d,_0x49df0f,_0x361e18){return require('../../config/license/util')[_0x19b2('0x46')]()[_0x19b2('0x2b')](function(_0x53a649){if(_0x53a649['update']){_0x361e18();}else{return _0x49df0f[_0x19b2('0x37')](0x193)[_0x19b2('0x2d')]({'message':_0x19b2('0x47')});}})[_0x19b2('0x3a')](function(_0xfc44d5){_0x361e18(_0xfc44d5);});});};exports[_0x19b2('0x48')]=function(_0x20a3af,_0x5f4a08,_0x4c04cf){_0x20a3af[_0x19b2('0x48')]=!![];return _0x4c04cf();};exports['signToken']=function signToken(_0x2a8e11){return signJwt(_0x2a8e11);};exports[_0x19b2('0x49')]=function(_0x738212,_0x53a5a0){if(!_0x738212[_0x19b2('0x39')]){return _0x53a5a0['status'](0x194)[_0x19b2('0x2d')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x324272={'payload':{'id':_0x738212['user']['id'],'role':_0x738212['user'][_0x19b2('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0x324272)[_0x19b2('0x2b')](function(_0x547f55){_0x53a5a0[_0x19b2('0x4a')]('motion.token',_0x547f55);_0x53a5a0[_0x19b2('0x4b')]('/dashboards/general');})['catch'](function(_0x8a4aa1){return _0x53a5a0['status'](0x1f4)[_0x19b2('0x4c')](_0x8a4aa1);});};exports[_0x19b2('0x4d')]=function(_0xb0c134){if(_[_0x19b2('0x4e')](_0xb0c134[_0x19b2('0x4f')])||_['isNil'](_0xb0c134['apiKeyIat'])){return null;}else{return createJwt(_0xb0c134);}};exports[_0x19b2('0x50')]=function(_0x299a36){_0x299a36[_0x19b2('0x4f')]=generateNonce();_0x299a36['apiKeyIat']=generateIssuedAt();return createJwt(_0x299a36);};exports['regenerateApiKey']=function(_0x4d16bf,_0x18b6fb){var _0x55878c=_0x4d16bf[_0x19b2('0x3e')][_0x19b2('0x3f')];if(_0x55878c){var _0x20e5c7={'nonce':_0x18b6fb[_0x19b2('0x4f')],'iat':_0x18b6fb[_0x19b2('0x51')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x19b2('0x40')]()};return verifyJwt(_0x55878c,_0x20e5c7)[_0x19b2('0x2b')](function(){return generateApiKey(_0x18b6fb);});}else{throw{'message':_0x19b2('0x52')};}};function signJwt(_0x59bc1f){var _0x537f3b=BPromise[_0x19b2('0x53')](jwt[_0x19b2('0x54')],{'context':jwt});var _0x2ea4ba=_0x59bc1f[_0x19b2('0x55')]||config[_0x19b2('0x6')]['session'];return new BPromise(function(_0x4bd92e,_0x6b4310){_0x537f3b(_0x59bc1f[_0x19b2('0x56')],_0x2ea4ba,_0x59bc1f['options'])[_0x19b2('0x2b')](function(_0x16d5f2){_0x4bd92e(_0x16d5f2);})[_0x19b2('0x3a')](function(_0x29e2b3){_0x6b4310(_0x29e2b3);});});}function verifyJwt(_0x47fb7d,_0x372cf1,_0x3c3d5e){var _0x268f22=BPromise[_0x19b2('0x53')](jwt['verify'],{'context':jwt});var _0x16001a=_0x3c3d5e||config['secrets']['session'];return new BPromise(function(_0x33a778,_0x512c6b){_0x268f22(_0x47fb7d,_0x16001a,_0x372cf1)['then'](function(_0x1e31be){_0x33a778(_0x1e31be);})['catch'](function(_0x2605ff){_0x512c6b(_0x2605ff);});});}function generateNonce(){return crypto[_0x19b2('0x57')](0x10)[_0x19b2('0x58')](_0x19b2('0x59'));}function generateIssuedAt(){return Math[_0x19b2('0x5a')](Date[_0x19b2('0x5b')]()/0x3e8)[_0x19b2('0x58')]();}function createJwt(_0x30aa1e){var _0x287a7d={'payload':{'iat':_0x30aa1e[_0x19b2('0x51')],'nonce':_0x30aa1e[_0x19b2('0x4f')]},'options':{'algorithm':_0x19b2('0x5c'),'subject':_0x30aa1e['id'][_0x19b2('0x58')](),'issuer':hardwareConf[_0x19b2('0x40')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x287a7d)['then'](function(_0x6a1a24){return{'iat':_0x30aa1e['apiKeyIat'],'nonce':_0x30aa1e[_0x19b2('0x4f')],'token':_0x6a1a24};});}
\ No newline at end of file
+var _0xae0f=['smsPause','openchannelPause','pauseType','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','closed','then','status','disposition','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','User','find','authenticate','json','user','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','sub','isEqual','apiKeyNonce','Invalid\x20API\x20access\x20key','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyIat','generateApiKey','promisify','sign','secret','payload','options','verify','randomBytes','toString','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','secrets','session','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause'];(function(_0x1bc117,_0x51ea4e){var _0x115604=function(_0x240f98){while(--_0x240f98){_0x1bc117['push'](_0x1bc117['shift']());}};_0x115604(++_0x51ea4e);}(_0xae0f,0x1ca));var _0xfae0=function(_0x4bdbfc,_0x4914e5){_0x4bdbfc=_0x4bdbfc-0x0;var _0x54f810=_0xae0f[_0x4bdbfc];return _0x54f810;};'use strict';var db=require(_0xfae0('0x0'))['db'];var config=require(_0xfae0('0x1'));var hardwareConf=require(_0xfae0('0x2'));var _=require(_0xfae0('0x3'));var jwt=require(_0xfae0('0x4'));var expressJwt=require(_0xfae0('0x5'));var compose=require(_0xfae0('0x6'));var basicAuth=require(_0xfae0('0x7'));var crypto=require('crypto');var BPromise=require(_0xfae0('0x8'));var validateJwt=expressJwt({'secret':config[_0xfae0('0x9')][_0xfae0('0xa')]});var userAttributes=['id','role',_0xfae0('0xb'),_0xfae0('0xc'),_0xfae0('0xd'),_0xfae0('0xe'),_0xfae0('0xf'),_0xfae0('0x10'),_0xfae0('0x11'),_0xfae0('0x12'),_0xfae0('0x13'),_0xfae0('0x14'),_0xfae0('0x15'),_0xfae0('0x16'),_0xfae0('0x17'),_0xfae0('0x18'),'showWebBar','lastLoginAt',_0xfae0('0x19'),_0xfae0('0x1a'),_0xfae0('0x1b'),_0xfae0('0x1c'),'alias',_0xfae0('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xfae0('0x1e'),'phoneBarEnableDtmfTone',_0xfae0('0x1f'),_0xfae0('0x20'),_0xfae0('0x21'),_0xfae0('0x22'),'phoneBarRemoteControlPort','hotdesk',_0xfae0('0x23'),_0xfae0('0x24')];exports[_0xfae0('0x25')]=function(){return this['isAuthenticated'](!![])[_0xfae0('0x26')](function(_0x58a765,_0x3574ef,_0x471927){if(_0x58a765['user']){_0x471927();}else{return db[_0xfae0('0x27')][_0xfae0('0x28')]({'where':{'id':_0x58a765[_0xfae0('0x29')]['id']},'attributes':['id',_0xfae0('0x2a'),'disposition'],'raw':!![]})[_0xfae0('0x2b')](function(_0x6d9f55){if(_0x6d9f55&&_0x6d9f55['closed']){return _0x3574ef[_0xfae0('0x2c')](_0x6d9f55[_0xfae0('0x2d')]===_0xfae0('0x2e')?0x195:0x193)['json']({'message':_0x6d9f55[_0xfae0('0x2d')]===_0xfae0('0x2e')?_0xfae0('0x2f'):_0xfae0('0x30')});}else{_0x471927();}})[_0xfae0('0x31')](function(_0x2c867e){_0x471927(_0x2c867e);});}});};exports[_0xfae0('0x32')]=function isAuthenticated(_0x72920e){return compose()[_0xfae0('0x26')](function(_0x53399e,_0x215f34,_0x3b065d){if(_0x53399e[_0xfae0('0x33')][_0xfae0('0x34')]){if(_[_0xfae0('0x35')](_0x53399e['headers']['authorization'],_0xfae0('0x36'))){var _0x1c46b8=basicAuth(_0x53399e);db[_0xfae0('0x37')][_0xfae0('0x38')]({'where':{'name':_0x1c46b8['name']}})[_0xfae0('0x2b')](function(_0x38eb91){if(!_0x38eb91||!_0x38eb91[_0xfae0('0x39')](_0x1c46b8['pass'])){return _0x215f34[_0xfae0('0x2c')](0x191)[_0xfae0('0x3a')]({'message':'Wrong\x20credentials.'});}_0x53399e[_0xfae0('0x3b')]={'id':_0x38eb91['id']};_0x3b065d();})[_0xfae0('0x31')](function(_0x983477){_0x3b065d(_0x983477);});}else if(_[_0xfae0('0x35')](_0x53399e[_0xfae0('0x33')][_0xfae0('0x34')],_0xfae0('0x3c'))){validateJwt(_0x53399e,_0x215f34,_0x3b065d);}else{if(_0x72920e){_0x3b065d();}else{return _0x215f34[_0xfae0('0x2c')](0x193)[_0xfae0('0x3a')]({'message':_0xfae0('0x3d')});}}}else if(_0x53399e['query'][_0xfae0('0x3e')]){try{var _0x3efcb6={'audience':hardwareConf[_0xfae0('0x3f')](),'issuer':hardwareConf[_0xfae0('0x3f')]()};verifyJwt(_0x53399e['query'][_0xfae0('0x3e')],_0x3efcb6)['then'](function(_0x251da4){return db['User']['find']({'where':{'id':_0x251da4[_0xfae0('0x40')]}})[_0xfae0('0x2b')](function(_0x1e34ec){if(!_0x1e34ec||!_[_0xfae0('0x41')](_0x1e34ec[_0xfae0('0x42')],_0x251da4['nonce'])){return _0x215f34['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x53399e[_0xfae0('0x3b')]={'id':_0x1e34ec['id']};_0x3b065d();});})['catch'](function(){return _0x215f34['status'](0x191)['json']({'message':_0xfae0('0x43')});});}catch(_0x20b472){_0x3b065d(_0x20b472);}}else if(_0x72920e){_0x3b065d();}else{return _0x215f34[_0xfae0('0x2c')](0x193)[_0xfae0('0x3a')]({'message':_0xfae0('0x3d')});}})[_0xfae0('0x26')](function(_0x2e994d,_0x562ff7,_0x255b63){if(_0x2e994d[_0xfae0('0x3b')]){db['User']['find']({'where':{'id':_0x2e994d['user']['id']},'attributes':userAttributes})[_0xfae0('0x2b')](function(_0x59c790){if(!_0x59c790){return _0x562ff7[_0xfae0('0x2c')](0x194)[_0xfae0('0x3a')]({'message':'User\x20not\x20found.'});}_0x2e994d[_0xfae0('0x3b')]=_0x59c790;_0x255b63();})['catch'](function(_0x295a7d){_0x255b63(_0x295a7d);});}else if(_0x72920e){_0x255b63();}else{return _0x562ff7[_0xfae0('0x2c')](0x194)[_0xfae0('0x3a')]({'message':_0xfae0('0x44')});}});};exports[_0xfae0('0x45')]=function canUpdate(){return compose()['use'](function(_0x37e0ff,_0xcc1ab6,_0x5169d6){return require(_0xfae0('0x46'))[_0xfae0('0x47')]()[_0xfae0('0x2b')](function(_0x4e46da){if(_0x4e46da[_0xfae0('0x48')]){_0x5169d6();}else{return _0xcc1ab6[_0xfae0('0x2c')](0x193)[_0xfae0('0x3a')]({'message':_0xfae0('0x49')});}})[_0xfae0('0x31')](function(_0x4ab409){_0x5169d6(_0x4ab409);});});};exports['isMiddleware']=function(_0x46cc30,_0x193319,_0xfdfece){_0x46cc30[_0xfae0('0x4a')]=!![];return _0xfdfece();};exports[_0xfae0('0x4b')]=function signToken(_0x21da80){return signJwt(_0x21da80);};exports[_0xfae0('0x4c')]=function(_0x408acb,_0x29af44){if(!_0x408acb[_0xfae0('0x3b')]){return _0x29af44[_0xfae0('0x2c')](0x194)['json']({'message':_0xfae0('0x4d')});}var _0x12242d={'payload':{'id':_0x408acb[_0xfae0('0x3b')]['id'],'role':_0x408acb['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x12242d)['then'](function(_0x9ee2c8){_0x29af44['cookie'](_0xfae0('0x4e'),_0x9ee2c8);_0x29af44[_0xfae0('0x4f')](_0xfae0('0x50'));})[_0xfae0('0x31')](function(_0x41bbcb){return _0x29af44['status'](0x1f4)[_0xfae0('0x51')](_0x41bbcb);});};exports[_0xfae0('0x52')]=function(_0x55720d){if(_['isNil'](_0x55720d[_0xfae0('0x42')])||_['isNil'](_0x55720d[_0xfae0('0x53')])){return null;}else{return createJwt(_0x55720d);}};exports[_0xfae0('0x54')]=function(_0x40c390){_0x40c390[_0xfae0('0x42')]=generateNonce();_0x40c390[_0xfae0('0x53')]=generateIssuedAt();return createJwt(_0x40c390);};exports['regenerateApiKey']=function(_0x44e7ed,_0xed9345){var _0x4ca4bc=_0x44e7ed['query'][_0xfae0('0x3e')];if(_0x4ca4bc){var _0x5afa5a={'nonce':_0xed9345[_0xfae0('0x42')],'iat':_0xed9345[_0xfae0('0x53')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xfae0('0x3f')]()};return verifyJwt(_0x4ca4bc,_0x5afa5a)[_0xfae0('0x2b')](function(){return generateApiKey(_0xed9345);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0x1292bc){var _0x291ef2=BPromise[_0xfae0('0x55')](jwt[_0xfae0('0x56')],{'context':jwt});var _0x4acfe3=_0x1292bc[_0xfae0('0x57')]||config[_0xfae0('0x9')][_0xfae0('0xa')];return new BPromise(function(_0x6bdbb3,_0x5ea916){_0x291ef2(_0x1292bc[_0xfae0('0x58')],_0x4acfe3,_0x1292bc[_0xfae0('0x59')])[_0xfae0('0x2b')](function(_0x2c9da3){_0x6bdbb3(_0x2c9da3);})[_0xfae0('0x31')](function(_0x4058f5){_0x5ea916(_0x4058f5);});});}function verifyJwt(_0x5f3e1c,_0x3f4355,_0x4ded9b){var _0x3dd8ab=BPromise['promisify'](jwt[_0xfae0('0x5a')],{'context':jwt});var _0x1cce5b=_0x4ded9b||config['secrets']['session'];return new BPromise(function(_0x46b9f7,_0x3261cd){_0x3dd8ab(_0x5f3e1c,_0x1cce5b,_0x3f4355)['then'](function(_0x55b183){_0x46b9f7(_0x55b183);})[_0xfae0('0x31')](function(_0x39b385){_0x3261cd(_0x39b385);});});}function generateNonce(){return crypto[_0xfae0('0x5b')](0x10)[_0xfae0('0x5c')]('hex');}function generateIssuedAt(){return Math[_0xfae0('0x5d')](Date[_0xfae0('0x5e')]()/0x3e8)[_0xfae0('0x5c')]();}function createJwt(_0x28e175){var _0x590266={'payload':{'iat':_0x28e175[_0xfae0('0x53')],'nonce':_0x28e175[_0xfae0('0x42')]},'options':{'algorithm':_0xfae0('0x5f'),'subject':_0x28e175['id'][_0xfae0('0x5c')](),'issuer':hardwareConf[_0xfae0('0x3f')](),'audience':hardwareConf[_0xfae0('0x3f')]()}};return signJwt(_0x590266)[_0xfae0('0x2b')](function(_0x3f0e1b){return{'iat':_0x28e175[_0xfae0('0x53')],'nonce':_0x28e175['apiKeyNonce'],'token':_0x3f0e1b};});}
\ No newline at end of file
diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js
index 39f7e47..bff6641 100644
--- a/server/components/encryptor/index.js
+++ b/server/components/encryptor/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['data','update','binary','write','end','decryptFile','createDecipher','final','close','unlink','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x0baf('0x0'));var defaultOptions={'algorithm':_0x0baf('0x1')};function combineOptions(_0x1e212d){var _0x263f79={};for(var _0x1688bc in defaultOptions){if(defaultOptions[_0x0baf('0x2')](_0x1688bc)){_0x263f79[_0x1688bc]=defaultOptions[_0x1688bc];}}if(_0x1e212d){for(var _0x5a3e42 in _0x1e212d){if(_0x1e212d[_0x0baf('0x2')](_0x5a3e42)){_0x263f79[_0x5a3e42]=_0x1e212d[_0x5a3e42];}}}return _0x263f79;}exports[_0x0baf('0x3')]=function(_0x2d3fa5,_0x39b8f3,_0xe4c3c4,_0x335e24){return new BPromise(function(_0x1a10b1,_0x2dcaac){_0x335e24=combineOptions(_0x335e24);var _0x1d0a0d=new Buffer(_0xe4c3c4);var _0x5f5030=fs[_0x0baf('0x4')](_0x2d3fa5);var _0x5f20aa=fs[_0x0baf('0x5')](_0x39b8f3);var _0x2c7442=crypto[_0x0baf('0x6')](_0x335e24[_0x0baf('0x7')],_0x1d0a0d);_0x5f5030['on'](_0x0baf('0x8'),function(_0xf4c8ac){var _0x41cead=new Buffer(_0x2c7442[_0x0baf('0x9')](_0xf4c8ac),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x41cead);});_0x5f5030['on'](_0x0baf('0xc'),function(){try{var _0x51d93c=new Buffer(_0x2c7442['final'](_0x0baf('0xa')),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x51d93c);_0x5f20aa[_0x0baf('0xc')]();_0x5f20aa['on']('close',function(){return _0x1a10b1(_0x39b8f3);});}catch(_0x2ab33e){fs['unlink'](_0x39b8f3);return _0x2dcaac(_0x2ab33e);}});});};exports[_0x0baf('0xd')]=function(_0x1f50c3,_0x7fbf67,_0x2bc381,_0xb8339e){return new BPromise(function(_0x469599,_0x4f80a8){_0xb8339e=combineOptions(_0xb8339e);var _0x4cd79d=new Buffer(_0x2bc381);var _0x2312c7=fs[_0x0baf('0x4')](_0x1f50c3);var _0x283408=fs[_0x0baf('0x5')](_0x7fbf67);var _0x2cf7da=crypto[_0x0baf('0xe')](_0xb8339e['algorithm'],_0x4cd79d);_0x2312c7['on'](_0x0baf('0x8'),function(_0xfbecec){var _0x1ef0e5=new Buffer(_0x2cf7da[_0x0baf('0x9')](_0xfbecec),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x1ef0e5);});_0x2312c7['on']('end',function(){try{var _0x5cff5d=new Buffer(_0x2cf7da[_0x0baf('0xf')](_0x0baf('0xa')),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x5cff5d);_0x283408[_0x0baf('0xc')]();_0x283408['on'](_0x0baf('0x10'),function(){return _0x469599(_0x7fbf67);});}catch(_0x210cd8){fs[_0x0baf('0x11')](_0x7fbf67);return _0x4f80a8(_0x210cd8);}});});};
\ No newline at end of file
+var _0xd8b0=['data','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','update','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm'];(function(_0x5a4761,_0x6834f4){var _0x2e172c=function(_0x1fede9){while(--_0x1fede9){_0x5a4761['push'](_0x5a4761['shift']());}};_0x2e172c(++_0x6834f4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x585166){var _0x4b72b0={};for(var _0x3ff8df in defaultOptions){if(defaultOptions[_0x0d8b('0x2')](_0x3ff8df)){_0x4b72b0[_0x3ff8df]=defaultOptions[_0x3ff8df];}}if(_0x585166){for(var _0x43bca1 in _0x585166){if(_0x585166[_0x0d8b('0x2')](_0x43bca1)){_0x4b72b0[_0x43bca1]=_0x585166[_0x43bca1];}}}return _0x4b72b0;}exports[_0x0d8b('0x3')]=function(_0x577834,_0x5e15e6,_0x3f8b6f,_0x227c63){return new BPromise(function(_0x39f43a,_0x4a4470){_0x227c63=combineOptions(_0x227c63);var _0x413284=new Buffer(_0x3f8b6f);var _0x284169=fs['createReadStream'](_0x577834);var _0x129310=fs[_0x0d8b('0x4')](_0x5e15e6);var _0x3b027f=crypto[_0x0d8b('0x5')](_0x227c63[_0x0d8b('0x6')],_0x413284);_0x284169['on'](_0x0d8b('0x7'),function(_0x2c5e9e){var _0x28f87c=new Buffer(_0x3b027f['update'](_0x2c5e9e),_0x0d8b('0x8'));_0x129310['write'](_0x28f87c);});_0x284169['on'](_0x0d8b('0x9'),function(){try{var _0xc574a3=new Buffer(_0x3b027f[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x129310[_0x0d8b('0xb')](_0xc574a3);_0x129310[_0x0d8b('0x9')]();_0x129310['on'](_0x0d8b('0xc'),function(){return _0x39f43a(_0x5e15e6);});}catch(_0x1d4bbc){fs[_0x0d8b('0xd')](_0x5e15e6);return _0x4a4470(_0x1d4bbc);}});});};exports[_0x0d8b('0xe')]=function(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){_0x4f6f21=combineOptions(_0x4f6f21);var _0x17f7df=new Buffer(_0x2d4e1c);var _0xe2e167=fs[_0x0d8b('0xf')](_0xe65334);var _0x5cd485=fs[_0x0d8b('0x4')](_0x1567ce);var _0x4586c2=crypto[_0x0d8b('0x10')](_0x4f6f21[_0x0d8b('0x6')],_0x17f7df);_0xe2e167['on'](_0x0d8b('0x7'),function(_0x18dd2d){var _0x264b39=new Buffer(_0x4586c2[_0x0d8b('0x11')](_0x18dd2d),'binary');_0x5cd485[_0x0d8b('0xb')](_0x264b39);});_0xe2e167['on'](_0x0d8b('0x9'),function(){try{var _0x196c0a=new Buffer(_0x4586c2[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x5cd485[_0x0d8b('0xb')](_0x196c0a);_0x5cd485[_0x0d8b('0x9')]();_0x5cd485['on']('close',function(){return _0x23eb7b(_0x1567ce);});}catch(_0x4f0a1a){fs[_0x0d8b('0xd')](_0x1567ce);return _0xa86349(_0x4f0a1a);}});});};
\ No newline at end of file
diff --git a/server/components/export/csv.js b/server/components/export/csv.js
index 07c11de..635259c 100644
--- a/server/components/export/csv.js
+++ b/server/components/export/csv.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4522=['Setting','find','split','splitSizeCsv','then','format','sequelize','SELECT','num','length','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','mkdirSync','join','each','csv','writeFileSync','Completed','%s.%s','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','CSV'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4522,0x1a0));var _0x2452=function(_0x46b7b8,_0x1ec3ac){_0x46b7b8=_0x46b7b8-0x0;var _0x1dc692=_0x4522[_0x46b7b8];return _0x1dc692;};'use strict';var util=require('util');var path=require('path');var _=require(_0x2452('0x0'));var csv=require(_0x2452('0x1'));var fs=require('fs');var BPromise=require(_0x2452('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x2452('0x3'));var db=require(_0x2452('0x4'))['db'];var dbH=require(_0x2452('0x4'))[_0x2452('0x5')];var logger=require(_0x2452('0x6'))(_0x2452('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x2452('0x8')][0x2]);var QUERY=process[_0x2452('0x8')][0x3];var PATH=process[_0x2452('0x8')][0x4];function analyticExtractedReport(_0x149807,_0x3bc193){var _0x33b935={'status':_0x149807};var _0x24073f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3bc193){_0x33b935[_0x2452('0x9')]=_0x3bc193;}return db[_0x2452('0xa')][_0x2452('0xb')](_0x33b935,_0x24073f);}function main(){var _0x5a38e0=0x1388;var _0x5dc630;logger[_0x2452('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2452('0xd')));return db[_0x2452('0xe')][_0x2452('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2452('0x10'),_0x2452('0x11')]})[_0x2452('0x12')](function(_0x2c1e0f){if(_0x2c1e0f){_0x5dc630=_0x2c1e0f;_0x5a38e0=_0x5dc630[_0x2452('0x11')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0x2452('0x13')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x2452('0x14')]['QueryTypes'][_0x2452('0x15')]});})[_0x2452('0x12')](function(_0x5d0438){if(!_0x5d0438[0x0][_0x2452('0x16')]){return analyticExtractedReport('Empty');}var _0x3dd8cc=[];var _0x734b88=0x0;var _0x461d2b=!![];if(_0x5d0438&&_0x5d0438[_0x2452('0x17')]){var _0x4e1d20=_0x5d0438[0x0][_0x2452('0x16')]%(_0x734b88+_0x5a38e0);if(_0x5dc630[_0x2452('0x10')]){for(;_0x461d2b;_0x734b88+=_0x5a38e0,_0x4e1d20=_0x5d0438[0x0]['num']%(_0x734b88+_0x5a38e0)){if(_0x4e1d20==0x0||_0x4e1d20==_0x5d0438[0x0]['num']){_0x461d2b=![];}_0x3dd8cc[_0x2452('0x18')](dbH[_0x2452('0x14')][_0x2452('0x19')](util['format'](_0x2452('0x1a'),QUERY,_0x5a38e0,_0x734b88),{'type':dbH[_0x2452('0x14')][_0x2452('0x1b')][_0x2452('0x15')]}));}}else{_0x3dd8cc[_0x2452('0x18')](dbH[_0x2452('0x14')][_0x2452('0x19')](QUERY,{'type':dbH[_0x2452('0x14')]['QueryTypes']['SELECT']}));}}var _0x1f060d=path[_0x2452('0x1c')](PATH);var _0x4bb3ff=path[_0x2452('0x1d')](PATH,_0x2452('0x1e'));var _0x1d5720=_0x5dc630[_0x2452('0x10')]&&_0x3dd8cc[_0x2452('0x17')]>0x1;var _0x397f21=[];if(!fs[_0x2452('0x1f')](path['join'](_0x1f060d,_0x4bb3ff))&&_0x1d5720){fs[_0x2452('0x20')](path[_0x2452('0x21')](_0x1f060d,_0x4bb3ff));}return BPromise[_0x2452('0x22')](_0x3dd8cc,function(_0x231410){_0x397f21[_0x2452('0x18')](_0x231410);})['then'](function(){for(var _0x48783a=0x0;_0x48783a<_0x397f21[_0x2452('0x17')];_0x48783a+=0x1){var _0x159ba1;var _0x46fcbb=_0x397f21[_0x48783a];if(_0x1d5720){_0x159ba1=path[_0x2452('0x21')](_0x1f060d,_0x4bb3ff,util[_0x2452('0x13')]('%s%d.%s',_0x4bb3ff,_0x48783a,_0x2452('0x23')));}else{_0x159ba1=path[_0x2452('0x21')](_0x1f060d,util['format']('%s.%s',_0x4bb3ff,_0x2452('0x23')));}fs[_0x2452('0x24')](_0x159ba1,csv(_0x46fcbb));}})[_0x2452('0x12')](function(){if(_0x1d5720){zipdir(path[_0x2452('0x21')](_0x1f060d,_0x4bb3ff),{'saveTo':path[_0x2452('0x21')](_0x1f060d,util[_0x2452('0x13')]('%s.%s',_0x4bb3ff,'zip'))},function(_0x46b611,_0x454e0a){});rimraf(path[_0x2452('0x21')](_0x1f060d,_0x4bb3ff),function(){});}})['then'](function(){logger[_0x2452('0xc')](util[_0x2452('0x13')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2452('0xd')));return analyticExtractedReport(_0x2452('0x25'),_0x1d5720?util[_0x2452('0x13')](_0x2452('0x26'),_0x4bb3ff,_0x1d5720?_0x2452('0x27'):_0x2452('0x23')):null);});})[_0x2452('0x28')](function(_0x115e09){logger[_0x2452('0xc')](util[_0x2452('0x13')](_0x2452('0x29'),EXTRACTED_REPORT_ID,_0x2452('0xd')),util[_0x2452('0x2a')](_0x115e09,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _0x9a19=['util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed'];(function(_0x5657bb,_0x2f1219){var _0x2a5ecb=function(_0x193add){while(--_0x193add){_0x5657bb['push'](_0x5657bb['shift']());}};_0x2a5ecb(++_0x2f1219);}(_0x9a19,0x114));var _0x99a1=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x9a19[_0x2261ce];return _0x524640;};'use strict';var util=require(_0x99a1('0x0'));var path=require(_0x99a1('0x1'));var _=require(_0x99a1('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x99a1('0x3'));var zipdir=require(_0x99a1('0x4'));var rimraf=require(_0x99a1('0x5'));var db=require(_0x99a1('0x6'))['db'];var dbH=require(_0x99a1('0x6'))[_0x99a1('0x7')];var logger=require(_0x99a1('0x8'))(_0x99a1('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x99a1('0xa')][0x2]);var QUERY=process[_0x99a1('0xa')][0x3];var PATH=process[_0x99a1('0xa')][0x4];function analyticExtractedReport(_0x523b9e,_0x4d2a5c){var _0x5aa6c2={'status':_0x523b9e};var _0x56f50={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4d2a5c){_0x5aa6c2[_0x99a1('0xb')]=_0x4d2a5c;}return db['AnalyticExtractedReport']['update'](_0x5aa6c2,_0x56f50);}function main(){var _0x4696f6=0x1388;var _0xd7b568;logger[_0x99a1('0xc')](util[_0x99a1('0xd')](_0x99a1('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x99a1('0xf')][_0x99a1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x99a1('0x11'),_0x99a1('0x12')]})[_0x99a1('0x13')](function(_0x1bc7aa){if(_0x1bc7aa){_0xd7b568=_0x1bc7aa;_0x4696f6=_0xd7b568[_0x99a1('0x12')]||0x1388;}})[_0x99a1('0x13')](function(){return dbH[_0x99a1('0x14')][_0x99a1('0x15')](util[_0x99a1('0xd')](_0x99a1('0x16'),QUERY),{'type':dbH[_0x99a1('0x14')][_0x99a1('0x17')][_0x99a1('0x18')]});})['then'](function(_0x2d81ed){if(!_0x2d81ed[0x0][_0x99a1('0x19')]){return analyticExtractedReport(_0x99a1('0x1a'));}var _0x3d40cc=[];var _0x384f05=0x0;var _0x33e2c1=!![];if(_0x2d81ed&&_0x2d81ed[_0x99a1('0x1b')]){var _0x4e645b=_0x2d81ed[0x0]['num']%(_0x384f05+_0x4696f6);if(_0xd7b568[_0x99a1('0x11')]){for(;_0x33e2c1;_0x384f05+=_0x4696f6,_0x4e645b=_0x2d81ed[0x0][_0x99a1('0x19')]%(_0x384f05+_0x4696f6)){if(_0x4e645b==0x0||_0x4e645b==_0x2d81ed[0x0][_0x99a1('0x19')]){_0x33e2c1=![];}_0x3d40cc[_0x99a1('0x1c')](dbH[_0x99a1('0x14')][_0x99a1('0x15')](util[_0x99a1('0xd')](_0x99a1('0x1d'),QUERY,_0x4696f6,_0x384f05),{'type':dbH[_0x99a1('0x14')][_0x99a1('0x17')][_0x99a1('0x18')]}));}}else{_0x3d40cc['push'](dbH[_0x99a1('0x14')][_0x99a1('0x15')](QUERY,{'type':dbH['sequelize'][_0x99a1('0x17')]['SELECT']}));}}var _0x458ed3=path[_0x99a1('0x1e')](PATH);var _0x2d6f20=path[_0x99a1('0x1f')](PATH,'.csv');var _0x3eab51=_0xd7b568[_0x99a1('0x11')]&&_0x3d40cc['length']>0x1;var _0x44df2d=[];if(!fs['existsSync'](path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20))&&_0x3eab51){fs[_0x99a1('0x21')](path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20));}return BPromise[_0x99a1('0x22')](_0x3d40cc,function(_0x3c813){_0x44df2d[_0x99a1('0x1c')](_0x3c813);})['then'](function(){for(var _0x114b38=0x0;_0x114b38<_0x44df2d['length'];_0x114b38+=0x1){var _0x5dc733;var _0xafea84=_0x44df2d[_0x114b38];if(_0x3eab51){_0x5dc733=path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20,util[_0x99a1('0xd')](_0x99a1('0x23'),_0x2d6f20,_0x114b38,_0x99a1('0x24')));}else{_0x5dc733=path[_0x99a1('0x20')](_0x458ed3,util[_0x99a1('0xd')]('%s.%s',_0x2d6f20,_0x99a1('0x24')));}fs['writeFileSync'](_0x5dc733,csv(_0xafea84));}})[_0x99a1('0x13')](function(){if(_0x3eab51){zipdir(path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20),{'saveTo':path[_0x99a1('0x20')](_0x458ed3,util['format'](_0x99a1('0x25'),_0x2d6f20,_0x99a1('0x26')))},function(_0x5718b9,_0x37514e){});rimraf(path[_0x99a1('0x20')](_0x458ed3,_0x2d6f20),function(){});}})[_0x99a1('0x13')](function(){logger[_0x99a1('0xc')](util[_0x99a1('0xd')](_0x99a1('0x27'),EXTRACTED_REPORT_ID,_0x99a1('0x28')));return analyticExtractedReport(_0x99a1('0x29'),_0x3eab51?util['format']('%s.%s',_0x2d6f20,_0x3eab51?_0x99a1('0x26'):'csv'):null);});})[_0x99a1('0x2a')](function(_0x400581){logger['info'](util[_0x99a1('0xd')](_0x99a1('0x2b'),EXTRACTED_REPORT_ID,_0x99a1('0x28')),util[_0x99a1('0x2c')](_0x400581,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x99a1('0x2d'));});}main();
\ No newline at end of file
diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js
index e55e7bc..dc38f95 100644
--- a/server/components/export/pdf.js
+++ b/server/components/export/pdf.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['hasOwnProperty','push','num','Empty','dirname','basename','Setting','find','split','splitSizePdf','then','length','query','format','QueryTypes','SELECT','sequelize','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','createWriteStream','finish','err','end','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0xdd4337,_0x3673f9){var _0x231608=function(_0x3fa60){while(--_0x3fa60){_0xdd4337['push'](_0xdd4337['shift']());}};_0x231608(++_0x3673f9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5dcc07,_0x12dc38){_0x5dcc07=_0x5dcc07-0x0;var _0x47cc95=_0x5f2f[_0x5dcc07];return _0x47cc95;};'use strict';var _=require(_0xf5f2('0x0'));var fs=require('fs');var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var PdfPrinter=require(_0xf5f2('0x5'));var zipdir=require(_0xf5f2('0x6'));var rimraf=require(_0xf5f2('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5f2('0x8')];var logger=require(_0xf5f2('0x9'))(_0xf5f2('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf5f2('0xb')][0x2]);var QUERY=process[_0xf5f2('0xb')][0x3];var PATH=process[_0xf5f2('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5f2('0xc');var _extractedReport;function analyticExtractedReport(_0x46cd9c,_0x2ec345){var _0x56a69f={'status':_0x46cd9c};var _0x375da4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ec345){_0x56a69f[_0xf5f2('0xd')]=_0x2ec345;}return db[_0xf5f2('0xe')]['update'](_0x56a69f,_0x375da4);}function getHeader(_0x977a59){var _0x4ebbbe=[];for(var _0x53fb33 in _0x977a59){if(_0x977a59[_0xf5f2('0xf')](_0x53fb33)){_0x4ebbbe[_0xf5f2('0x10')]({'text':_0x53fb33,'style':'tableHeader'});}}return _0x4ebbbe;}function extractReport(_0x336f6b){var _0x14b51f=0x1388;var _0x331482;if(!_0x336f6b[0x0][_0xf5f2('0x11')]){return analyticExtractedReport(_0xf5f2('0x12'));}var _0x3e5956=[];var _0x5c01b8=0x0;var _0x5850f4=!![];var _0xea612c=path[_0xf5f2('0x13')](PATH);var _0x1c1a5c=path[_0xf5f2('0x14')](PATH,'.pdf');var _0xafe430=![];var _0x286197=[];return db[_0xf5f2('0x15')][_0xf5f2('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5f2('0x17'),_0xf5f2('0x18')]})[_0xf5f2('0x19')](function(_0x395a5a){if(_0x395a5a){_0x331482=_0x395a5a;_0x14b51f=_0x331482[_0xf5f2('0x18')]||0x3e8;}})[_0xf5f2('0x19')](function(){if(_0x336f6b&&_0x336f6b[_0xf5f2('0x1a')]){var _0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f);if(_0x331482[_0xf5f2('0x17')]){for(;_0x5850f4;_0x5c01b8+=_0x14b51f,_0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f)){if(_0x28e097==0x0||_0x28e097==_0x336f6b[0x0][_0xf5f2('0x11')]){_0x5850f4=![];}_0x3e5956[_0xf5f2('0x10')](dbH['sequelize'][_0xf5f2('0x1b')](util[_0xf5f2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14b51f,_0x5c01b8),{'type':dbH['sequelize'][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}else{_0x3e5956['push'](dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](QUERY,{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}_0xafe430=_0x331482['split']&&_0x3e5956[_0xf5f2('0x1a')]>0x1;if(!fs[_0xf5f2('0x20')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c))&&_0xafe430){fs[_0xf5f2('0x22')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c));}return BPromise['each'](_0x3e5956,function(_0x529f07){_0x286197[_0xf5f2('0x10')](_0x529f07);});})[_0xf5f2('0x19')](function(){return BPromise[_0xf5f2('0x23')](_0x3e5956,function(_0x1a5bb3,_0xf6c58d){var _0x788a8d;var _0x13a3be=util[_0xf5f2('0x1c')](_0xf5f2('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xf5f2('0x25')])[_0xf5f2('0x1c')](FORMAT),moment(_extractedReport[_0xf5f2('0x26')])[_0xf5f2('0x1c')](FORMAT));var _0x198c73={'pageSize':'A4','pageOrientation':_0xf5f2('0x27'),'content':[{'text':_0x13a3be,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x22c826={'headerRows':0x1,'body':[]};_0x22c826[_0xf5f2('0x28')][_0xf5f2('0x10')](getHeader(_0x1a5bb3[0x0]));var _0x5027ab;for(var _0x5a2c7e=0x0;_0x5a2c7e<_0x1a5bb3[_0xf5f2('0x1a')];_0x5a2c7e+=0x1){_0x5027ab=[];for(var _0x50b8a2 in _0x1a5bb3[_0x5a2c7e]){if(_0x1a5bb3[_0x5a2c7e][_0xf5f2('0xf')](_0x50b8a2)){_0x5027ab[_0xf5f2('0x10')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]?_[_0xf5f2('0x29')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]):'');}}_0x22c826['body']['push'](_0x5027ab);}_0x198c73[_0xf5f2('0x2a')]['push']({'table':_0x22c826});return new BPromise(function(_0xb744b9,_0x58a4df){var _0x45b643=new PdfPrinter({'Roboto':{'normal':__dirname+_0xf5f2('0x2b'),'bold':__dirname+_0xf5f2('0x2c'),'italics':__dirname+_0xf5f2('0x2d'),'bolditalics':__dirname+_0xf5f2('0x2e')}});var _0x277eee=_0x45b643[_0xf5f2('0x2f')](_0x198c73);if(_0xafe430){_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c,util['format'](_0xf5f2('0x30'),_0x1c1a5c,_0xf6c58d,_0xf5f2('0x31')));}else{_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xf5f2('0x31')));}var _0x297c0c=_0x277eee['pipe'](fs[_0xf5f2('0x33')](_0x788a8d));_0x297c0c['on'](_0xf5f2('0x34'),function(){_0xb744b9();});_0x297c0c['on']('error',function(_0x3fc168){console['log'](_0xf5f2('0x35'),_0x3fc168);_0x58a4df(_0x3fc168);});_0x277eee[_0xf5f2('0x36')]();});});})[_0xf5f2('0x19')](function(){if(_0xafe430){return new BPromise(function(_0x2e3cca,_0x59a6dd){zipdir(path['join'](_0xea612c,_0x1c1a5c),{'saveTo':path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,'zip'))},function(_0x41447f){if(_0x41447f){_0x59a6dd(_0x41447f);}else{_0x2e3cca();}});});}})['then'](function(){if(_0xafe430){rimraf(path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c),function(){});}})['then'](function(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf5f2('0x38')));return analyticExtractedReport(_0xf5f2('0x39'),_0xafe430?util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xafe430?'zip':'pdf'):null);});}function main(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')](_0xf5f2('0x3a'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')));return db[_0xf5f2('0xe')][_0xf5f2('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5f2('0x19')](function(_0x4c0ac7){_extractedReport=_0x4c0ac7;return dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](util['format'](_0xf5f2('0x3d'),QUERY),{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]});})[_0xf5f2('0x19')](extractReport)[_0xf5f2('0x3e')](function(_0x462ea3){logger[_0xf5f2('0x37')](util['format'](_0xf5f2('0x3f'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')),util[_0xf5f2('0x40')](_0x462ea3,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x581686,_0x13aec1){var _0x3feb67=function(_0x1e38eb){while(--_0x1e38eb){_0x581686['push'](_0x581686['shift']());}};_0x3feb67(++_0x13aec1);}(_0xb10b,0x12a));var _0xbb10=function(_0x23fcad,_0x2b4c2e){_0x23fcad=_0x23fcad-0x0;var _0x3e4d60=_0xb10b[_0x23fcad];return _0x3e4d60;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main();
\ No newline at end of file
diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js
index a47d5b5..46314ed 100644
--- a/server/components/export/xlsx.js
+++ b/server/components/export/xlsx.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8084=['then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx'];(function(_0x56e891,_0x1e8de0){var _0x4460cf=function(_0x22c423){while(--_0x22c423){_0x56e891['push'](_0x56e891['shift']());}};_0x4460cf(++_0x1e8de0);}(_0x8084,0x13b));var _0x4808=function(_0x38908c,_0xcdfb79){_0x38908c=_0x38908c-0x0;var _0x1f3eaa=_0x8084[_0x38908c];return _0x1f3eaa;};'use strict';var util=require(_0x4808('0x0'));var path=require(_0x4808('0x1'));var _=require(_0x4808('0x2'));var fs=require('fs');var json2xls=require(_0x4808('0x3'));var BPromise=require(_0x4808('0x4'));var zipdir=require(_0x4808('0x5'));var rimraf=require(_0x4808('0x6'));var db=require(_0x4808('0x7'))['db'];var dbH=require(_0x4808('0x7'))[_0x4808('0x8')];var logger=require(_0x4808('0x9'))(_0x4808('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x4808('0xb')][0x2]);var QUERY=process[_0x4808('0xb')][0x3];var PATH=process[_0x4808('0xb')][0x4];function analyticExtractedReport(_0x477ddd,_0x4bc3c9){var _0x295cee={'status':_0x477ddd};var _0x57bb0e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4bc3c9){_0x295cee[_0x4808('0xc')]=_0x4bc3c9;}return db['AnalyticExtractedReport'][_0x4808('0xd')](_0x295cee,_0x57bb0e);}function main(){var _0x193e67=0x1388;var _0x4428d4;logger[_0x4808('0xe')](util['format'](_0x4808('0xf'),EXTRACTED_REPORT_ID,_0x4808('0x10')));return db[_0x4808('0x11')][_0x4808('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4808('0x13'),_0x4808('0x14')]})[_0x4808('0x15')](function(_0x29a0b0){if(_0x29a0b0){_0x4428d4=_0x29a0b0;_0x193e67=_0x4428d4[_0x4808('0x14')]||0x1388;}})[_0x4808('0x15')](function(){return dbH[_0x4808('0x16')]['query'](util[_0x4808('0x17')](_0x4808('0x18'),QUERY),{'type':dbH['sequelize'][_0x4808('0x19')]['SELECT']});})['then'](function(_0x37fe93){if(!_0x37fe93[0x0][_0x4808('0x1a')]){return analyticExtractedReport(_0x4808('0x1b'));}var _0x5eae59=[];var _0xe3b4ea=0x0;var _0x4221b1=!![];if(_0x4428d4[_0x4808('0x13')]){if(_0x37fe93&&_0x37fe93[_0x4808('0x1c')]){var _0x27b85d=_0x37fe93[0x0]['num']%(_0xe3b4ea+_0x193e67);for(;_0x4221b1;_0xe3b4ea+=_0x193e67,_0x27b85d=_0x37fe93[0x0][_0x4808('0x1a')]%(_0xe3b4ea+_0x193e67)){if(_0x27b85d==0x0||_0x27b85d==_0x37fe93[0x0]['num']){_0x4221b1=![];}_0x5eae59[_0x4808('0x1d')](dbH[_0x4808('0x16')][_0x4808('0x1e')](util[_0x4808('0x17')](_0x4808('0x1f'),QUERY,_0x193e67,_0xe3b4ea),{'type':dbH['sequelize'][_0x4808('0x19')][_0x4808('0x20')]}));}}}else{_0x5eae59['push'](dbH[_0x4808('0x16')][_0x4808('0x1e')](QUERY,{'type':dbH[_0x4808('0x16')][_0x4808('0x19')][_0x4808('0x20')]}));}var _0x371333=path[_0x4808('0x21')](PATH);var _0x244e5a=path[_0x4808('0x22')](PATH,_0x4808('0x23'));var _0x3cfb7f=_0x4428d4['split']&&_0x5eae59['length']>0x1;var _0x31e4f4=[];if(!fs[_0x4808('0x24')](path[_0x4808('0x25')](_0x371333,_0x244e5a))&&_0x3cfb7f){fs['mkdirSync'](path['join'](_0x371333,_0x244e5a));}return BPromise['each'](_0x5eae59,function(_0x1b1199){_0x31e4f4[_0x4808('0x1d')](_0x1b1199);})['then'](function(){for(var _0x2c55f1=0x0;_0x2c55f1<_0x31e4f4['length'];_0x2c55f1+=0x1){var _0x2597c6;var _0x153067=_0x31e4f4[_0x2c55f1];if(_0x3cfb7f){_0x2597c6=path[_0x4808('0x25')](_0x371333,_0x244e5a,util[_0x4808('0x17')](_0x4808('0x26'),_0x244e5a,_0x2c55f1,'xlsx'));}else{_0x2597c6=path[_0x4808('0x25')](_0x371333,util[_0x4808('0x17')]('%s.%s',_0x244e5a,_0x4808('0x27')));}fs[_0x4808('0x28')](_0x2597c6,json2xls(_0x153067),_0x4808('0x29'));}})[_0x4808('0x15')](function(){if(_0x3cfb7f){zipdir(path[_0x4808('0x25')](_0x371333,_0x244e5a),{'saveTo':path[_0x4808('0x25')](_0x371333,util[_0x4808('0x17')](_0x4808('0x2a'),_0x244e5a,_0x4808('0x2b')))},function(_0x1c540e,_0x560594){});rimraf(path[_0x4808('0x25')](_0x371333,_0x244e5a),function(){});}})[_0x4808('0x15')](function(){logger[_0x4808('0xe')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x4808('0x2c'),_0x3cfb7f?util[_0x4808('0x17')](_0x4808('0x2a'),_0x244e5a,_0x3cfb7f?'zip':'xlsx'):null);});})[_0x4808('0x2d')](function(_0x317023){logger[_0x4808('0xe')](util[_0x4808('0x17')](_0x4808('0x2e'),EXTRACTED_REPORT_ID,_0x4808('0x10')),util[_0x4808('0x2f')](_0x317023,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _0x8e08=['binary','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','json2xls','bluebird','zip-dir','../../mysqldb','argv','savename','format','XLSX','find','split','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','.xlsx','existsSync','join','mkdirSync','%s%d.%s','xlsx','writeFileSync'];(function(_0x1d6158,_0x4ba9fb){var _0x1555e=function(_0x129880){while(--_0x129880){_0x1d6158['push'](_0x1d6158['shift']());}};_0x1555e(++_0x4ba9fb);}(_0x8e08,0xf9));var _0x88e0=function(_0x1b7aab,_0x4e23aa){_0x1b7aab=_0x1b7aab-0x0;var _0x52bbea=_0x8e08[_0x1b7aab];return _0x52bbea;};'use strict';var util=require('util');var path=require(_0x88e0('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x88e0('0x1'));var BPromise=require(_0x88e0('0x2'));var zipdir=require(_0x88e0('0x3'));var rimraf=require('rimraf');var db=require(_0x88e0('0x4'))['db'];var dbH=require(_0x88e0('0x4'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x88e0('0x5')][0x2]);var QUERY=process[_0x88e0('0x5')][0x3];var PATH=process[_0x88e0('0x5')][0x4];function analyticExtractedReport(_0x5a24a3,_0x5d6165){var _0x239c4c={'status':_0x5a24a3};var _0x57799d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d6165){_0x239c4c[_0x88e0('0x6')]=_0x5d6165;}return db['AnalyticExtractedReport']['update'](_0x239c4c,_0x57799d);}function main(){var _0x4fee66=0x1388;var _0x26233d;logger['info'](util[_0x88e0('0x7')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x88e0('0x8')));return db['Setting'][_0x88e0('0x9')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x88e0('0xa'),_0x88e0('0xb')]})['then'](function(_0x480d36){if(_0x480d36){_0x26233d=_0x480d36;_0x4fee66=_0x26233d[_0x88e0('0xb')]||0x1388;}})['then'](function(){return dbH[_0x88e0('0xc')][_0x88e0('0xd')](util[_0x88e0('0x7')](_0x88e0('0xe'),QUERY),{'type':dbH[_0x88e0('0xc')][_0x88e0('0xf')][_0x88e0('0x10')]});})[_0x88e0('0x11')](function(_0x3439a8){if(!_0x3439a8[0x0][_0x88e0('0x12')]){return analyticExtractedReport(_0x88e0('0x13'));}var _0x463d75=[];var _0x4584f4=0x0;var _0x2fadcc=!![];if(_0x26233d['split']){if(_0x3439a8&&_0x3439a8[_0x88e0('0x14')]){var _0x6b5dc6=_0x3439a8[0x0][_0x88e0('0x12')]%(_0x4584f4+_0x4fee66);for(;_0x2fadcc;_0x4584f4+=_0x4fee66,_0x6b5dc6=_0x3439a8[0x0]['num']%(_0x4584f4+_0x4fee66)){if(_0x6b5dc6==0x0||_0x6b5dc6==_0x3439a8[0x0][_0x88e0('0x12')]){_0x2fadcc=![];}_0x463d75['push'](dbH[_0x88e0('0xc')][_0x88e0('0xd')](util[_0x88e0('0x7')](_0x88e0('0x15'),QUERY,_0x4fee66,_0x4584f4),{'type':dbH['sequelize']['QueryTypes'][_0x88e0('0x10')]}));}}}else{_0x463d75[_0x88e0('0x16')](dbH[_0x88e0('0xc')][_0x88e0('0xd')](QUERY,{'type':dbH[_0x88e0('0xc')][_0x88e0('0xf')][_0x88e0('0x10')]}));}var _0x247013=path['dirname'](PATH);var _0x442376=path[_0x88e0('0x17')](PATH,_0x88e0('0x18'));var _0x5a7f39=_0x26233d[_0x88e0('0xa')]&&_0x463d75[_0x88e0('0x14')]>0x1;var _0x350c4c=[];if(!fs[_0x88e0('0x19')](path[_0x88e0('0x1a')](_0x247013,_0x442376))&&_0x5a7f39){fs[_0x88e0('0x1b')](path[_0x88e0('0x1a')](_0x247013,_0x442376));}return BPromise['each'](_0x463d75,function(_0x5551c1){_0x350c4c['push'](_0x5551c1);})[_0x88e0('0x11')](function(){for(var _0x28bd35=0x0;_0x28bd35<_0x350c4c[_0x88e0('0x14')];_0x28bd35+=0x1){var _0x54608e;var _0x95bb29=_0x350c4c[_0x28bd35];if(_0x5a7f39){_0x54608e=path[_0x88e0('0x1a')](_0x247013,_0x442376,util[_0x88e0('0x7')](_0x88e0('0x1c'),_0x442376,_0x28bd35,_0x88e0('0x1d')));}else{_0x54608e=path[_0x88e0('0x1a')](_0x247013,util[_0x88e0('0x7')]('%s.%s',_0x442376,_0x88e0('0x1d')));}fs[_0x88e0('0x1e')](_0x54608e,json2xls(_0x95bb29),_0x88e0('0x1f'));}})[_0x88e0('0x11')](function(){if(_0x5a7f39){zipdir(path[_0x88e0('0x1a')](_0x247013,_0x442376),{'saveTo':path[_0x88e0('0x1a')](_0x247013,util['format'](_0x88e0('0x20'),_0x442376,_0x88e0('0x21')))},function(_0x53d993,_0x8b8e88){});rimraf(path[_0x88e0('0x1a')](_0x247013,_0x442376),function(){});}})[_0x88e0('0x11')](function(){logger[_0x88e0('0x22')](util['format'](_0x88e0('0x23'),EXTRACTED_REPORT_ID,_0x88e0('0x8')));return analyticExtractedReport('Completed',_0x5a7f39?util[_0x88e0('0x7')](_0x88e0('0x20'),_0x442376,_0x5a7f39?_0x88e0('0x21'):'xlsx'):null);});})[_0x88e0('0x24')](function(_0x2a7ad1){logger[_0x88e0('0x22')](util[_0x88e0('0x7')](_0x88e0('0x25'),EXTRACTED_REPORT_ID,_0x88e0('0x8')),util[_0x88e0('0x26')](_0x2a7ad1,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x88e0('0x27'));});}main();
\ No newline at end of file
diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js
index 3b8023a..efd8bf1 100644
--- a/server/components/extensions/rewrite.js
+++ b/server/components/extensions/rewrite.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ee4=['XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','find','format','CDR(type)=%s','type','context','outbound','Set','cutdigits','${EXTEN:','VoiceExtensionId','push','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','length','createdAt','interval','*,*,*,*','map','tag','CDR(tag)=','hasOwnProperty','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','toLowerCase','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress'];(function(_0x2696e3,_0x230c4d){var _0x533b98=function(_0x348f07){while(--_0x348f07){_0x2696e3['push'](_0x2696e3['shift']());}};_0x533b98(++_0x230c4d);}(_0x4ee4,0x179));var _0x44ee=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x4ee4[_0x3da832];return _0xe602f2;};'use strict';var _=require(_0x44ee('0x0'));var util=require(_0x44ee('0x1'));function rewrite(_0x1a3f8f,_0x215fb6){var _0x4cdb1a=this;return _0x1a3f8f[_0x44ee('0x2')][_0x44ee('0x3')][_0x44ee('0x4')]({'raw':!![]})[_0x44ee('0x5')](function(_0x30a093){_0x4cdb1a[_0x44ee('0x6')]=_0x30a093;return _0x1a3f8f[_0x44ee('0x2')][_0x44ee('0x7')][_0x44ee('0x4')]({'where':{'IntervalId':_0x215fb6[_0x44ee('0x8')]},'raw':!![]});})[_0x44ee('0x5')](function(_0x12c056){return _0x1a3f8f[_0x44ee('0x2')][_0x44ee('0x7')][_0x44ee('0x4')]({'where':{'exten':{'$in':_[_0x44ee('0x9')](_['map'](_0x12c056,_0x44ee('0xa')))}},'order':[{'raw':_0x44ee('0xb')}],'raw':!![]});})[_0x44ee('0x5')](function(_0x6fd1a8){var _0x5abc82=_[_0x44ee('0xc')](_0x6fd1a8,{'priority':'1'});var _0x4c0cb3=_['filter'](_0x6fd1a8,{'isApp':0x1});var _0x55f049=_[_0x44ee('0xd')](_0x4c0cb3,'exten');var _0x54851b=[_0x44ee('0xe'),_0x44ee('0xf')];var _0x22e8bb=[];var _0x579c74=[];for(var _0x3ea3d9 in _0x55f049){if(_0x55f049['hasOwnProperty'](_0x3ea3d9)){_0x4cdb1a[_0x44ee('0x10')]=0x2;_0x4cdb1a[_0x44ee('0x11')]=[];_0x4cdb1a[_0x44ee('0x12')]=_[_0x44ee('0x13')](_0x5abc82,{'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')]});_0x4cdb1a[_0x44ee('0x11')]['push']({'type':_0x55f049[_0x3ea3d9][0x0]['type'],'app':'Set','appdata':util[_0x44ee('0x14')](_0x44ee('0x15'),_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x16')]),'context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')],'priority':_0x4cdb1a[_0x44ee('0x10')]++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0]['VoiceExtensionId']});if(_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x16')]===_0x44ee('0x18')){if(_0x4cdb1a[_0x44ee('0x12')]){_0x4cdb1a[_0x44ee('0x11')]['push']({'type':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x16')],'app':_0x44ee('0x19'),'appdata':'CDR(destination)='+(_0x4cdb1a[_0x44ee('0x12')][_0x44ee('0x1a')]?_0x44ee('0x1b')+_0x4cdb1a[_0x44ee('0x12')][_0x44ee('0x1a')]+'}':'${EXTEN}'),'context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0]['exten'],'priority':_0x4cdb1a['priority']++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')]});}_0x4cdb1a[_0x44ee('0x11')][_0x44ee('0x1d')]({'type':_0x55f049[_0x3ea3d9][0x0]['type'],'app':_0x44ee('0x19'),'appdata':_0x44ee('0x1e')+_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')],'context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0]['exten'],'priority':_0x4cdb1a[_0x44ee('0x10')]++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')]});var _0x452d63=_0x4cdb1a[_0x44ee('0x10')]++;_0x4cdb1a[_0x44ee('0x11')]['push']({'type':_0x55f049[_0x3ea3d9][0x0]['type'],'app':_0x44ee('0x1f'),'appdata':_0x44ee('0x20')+(_0x452d63+0x2)+_0x44ee('0x21')+(_0x452d63+0x1)+')','context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')],'priority':_0x452d63,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')]});if(_0x4cdb1a[_0x44ee('0x12')]){_0x4cdb1a[_0x44ee('0x11')][_0x44ee('0x1d')]({'type':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x16')],'app':_0x44ee('0x19'),'appdata':_0x4cdb1a['extension'][_0x44ee('0x1a')]?_0x44ee('0x22')+_0x4cdb1a['extension'][_0x44ee('0x1a')]+'}':_0x44ee('0x23'),'context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')],'priority':_0x4cdb1a['priority']++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0]['VoiceExtensionId']});}_0x4cdb1a['extensions'][_0x44ee('0x1d')]({'type':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x16')],'app':_0x44ee('0x19'),'appdata':_0x44ee('0x24')+_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')],'context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0]['exten'],'priority':_0x4cdb1a[_0x44ee('0x10')]++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')]});if(_0x4cdb1a[_0x44ee('0x12')]&&_0x4cdb1a[_0x44ee('0x12')]['hasOwnProperty'](_0x44ee('0x25'))&&_0x4cdb1a[_0x44ee('0x12')][_0x44ee('0x25')]!==_0x44ee('0x26')){_0x4cdb1a[_0x44ee('0x11')]['push']({'type':_0x55f049[_0x3ea3d9][0x0]['type'],'app':_0x44ee('0x19'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')],'priority':_0x4cdb1a['priority']++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')]});_0x4cdb1a[_0x44ee('0x11')][_0x44ee('0x1d')]({'type':_0x55f049[_0x3ea3d9][0x0]['type'],'app':_0x44ee('0x19'),'appdata':_0x44ee('0x27')+_0x4cdb1a[_0x44ee('0x12')][_0x44ee('0x25')]||_0x44ee('0x28'),'context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')],'priority':_0x4cdb1a['priority']++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0]['VoiceExtensionId']});}}_0x4cdb1a[_0x44ee('0x11')][_0x44ee('0x1d')]({'type':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x16')],'app':_0x44ee('0x19'),'appdata':_0x44ee('0x29'),'context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')],'priority':_0x4cdb1a[_0x44ee('0x10')]++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')]});_0x4cdb1a[_0x44ee('0x11')][_0x44ee('0x1d')]({'type':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x16')],'app':_0x44ee('0x19'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')],'priority':_0x4cdb1a[_0x44ee('0x10')]++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')]});_0x4cdb1a['extensions'][_0x44ee('0x1d')]({'type':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x16')],'app':_0x44ee('0x19'),'appdata':'MONITOR_OPTIONS=ab','context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')],'priority':_0x4cdb1a['priority']++,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')]});for(var _0x44e683=0x0,_0x493bad=0x0;_0x44e683<_0x55f049[_0x3ea3d9][_0x44ee('0x2a')];_0x44e683+=0x1,_0x493bad=0x0){var _0x1b1678=_0x55f049[_0x3ea3d9][_0x44e683];if(_0x1b1678[_0x44ee('0x16')]){_0x1b1678['type']=_0x1b1678[_0x44ee('0x16')]['toLowerCase']();}var _0x383600=[];var _0x3fa13c=[];delete _0x1b1678['id'];delete _0x1b1678[_0x44ee('0x2b')];delete _0x1b1678['updatedAt'];var _0xf6ef3a=_0x1b1678[_0x44ee('0x2c')]!==_0x44ee('0x2d')?[_0x1b1678['interval']]:_0x1b1678[_0x44ee('0x8')]?_[_0x44ee('0x2e')](_['filter'](_0x4cdb1a[_0x44ee('0x6')],{'IntervalId':_0x1b1678[_0x44ee('0x8')]}),'interval'):[];if(_0x1b1678['hasOwnProperty']('tag')){if(_0x1b1678[_0x44ee('0x2f')]&&_0x1b1678[_0x44ee('0x2f')]!=='--'){_0x383600[_0x44ee('0x1d')]({'type':_0x1b1678[_0x44ee('0x16')],'app':_0x44ee('0x19'),'appdata':_0x44ee('0x30')+_0x1b1678[_0x44ee('0x2f')],'context':_0x1b1678[_0x44ee('0x17')],'exten':_0x1b1678[_0x44ee('0xa')],'priority':_0xf6ef3a[_0x44ee('0x2a')]+_0x4cdb1a['priority']+_0x493bad++,'VoiceExtensionId':_0x1b1678[_0x44ee('0x1c')]});}}if(_0x1b1678[_0x44ee('0x16')]==='outbound'&&_0x1b1678[_0x44ee('0x31')](_0x44ee('0x32'))){if(_0x1b1678[_0x44ee('0x32')]){_0x383600['push']({'type':_0x1b1678['type'],'app':_0x44ee('0x1f'),'appdata':_0x44ee('0x33')+_0x1b1678[_0x44ee('0x32')]+')','context':_0x1b1678[_0x44ee('0x17')],'exten':_0x1b1678[_0x44ee('0xa')],'priority':_0xf6ef3a['length']+_0x4cdb1a[_0x44ee('0x10')]+_0x493bad++,'VoiceExtensionId':_0x1b1678['VoiceExtensionId']});}else{_0x383600[_0x44ee('0x1d')]({'type':_0x1b1678[_0x44ee('0x16')],'app':'ExecIf','appdata':_0x44ee('0x34'),'context':_0x1b1678[_0x44ee('0x17')],'exten':_0x1b1678[_0x44ee('0xa')],'priority':_0xf6ef3a[_0x44ee('0x2a')]+_0x4cdb1a[_0x44ee('0x10')]+_0x493bad++,'VoiceExtensionId':_0x1b1678[_0x44ee('0x1c')]});}}if(_0x1b1678[_0x44ee('0x31')]('answer')){if(_0x54851b[_0x44ee('0x35')](_0x1b1678[_0x44ee('0x36')][_0x44ee('0x37')]())>=0x0&&_0x1b1678[_0x44ee('0x38')]!=='custom'){if(_0x1b1678[_0x44ee('0x39')]){_0x383600[_0x44ee('0x1d')]({'type':_0x1b1678[_0x44ee('0x16')],'app':_0x44ee('0x1f'),'appdata':_0x44ee('0x3a'),'context':_0x1b1678[_0x44ee('0x17')],'exten':_0x1b1678[_0x44ee('0xa')],'priority':_0xf6ef3a['length']+_0x4cdb1a[_0x44ee('0x10')]+_0x493bad++,'VoiceExtensionId':_0x1b1678[_0x44ee('0x1c')]});_0x383600[_0x44ee('0x1d')]({'type':_0x1b1678[_0x44ee('0x16')],'app':'Set','appdata':_0x44ee('0x3b'),'context':_0x1b1678[_0x44ee('0x17')],'exten':_0x1b1678[_0x44ee('0xa')],'priority':_0xf6ef3a[_0x44ee('0x2a')]+_0x4cdb1a[_0x44ee('0x10')]+_0x493bad++,'VoiceExtensionId':_0x1b1678['VoiceExtensionId']});}else{_0x383600[_0x44ee('0x1d')]({'type':_0x1b1678[_0x44ee('0x16')],'app':_0x44ee('0x1f'),'appdata':_0x44ee('0x3c'),'context':_0x1b1678[_0x44ee('0x17')],'exten':_0x1b1678[_0x44ee('0xa')],'priority':_0xf6ef3a['length']+_0x4cdb1a[_0x44ee('0x10')]+_0x493bad++,'VoiceExtensionId':_0x1b1678[_0x44ee('0x1c')]});_0x383600['push']({'type':_0x1b1678[_0x44ee('0x16')],'app':'Set','appdata':_0x44ee('0x3d'),'context':_0x1b1678[_0x44ee('0x17')],'exten':_0x1b1678['exten'],'priority':_0xf6ef3a[_0x44ee('0x2a')]+_0x4cdb1a[_0x44ee('0x10')]+_0x493bad++,'VoiceExtensionId':_0x1b1678[_0x44ee('0x1c')]});}}}for(var _0xaad89a=0x0;_0xaad89a<_0xf6ef3a[_0x44ee('0x2a')];_0xaad89a+=0x1){var _0x2b57e7=_0x4cdb1a['priority']+_0xf6ef3a[_0x44ee('0x2a')];var _0x47f265=_0xaad89a===_0xf6ef3a[_0x44ee('0x2a')]-0x1?_0x4cdb1a[_0x44ee('0x10')]+_0x383600['length']+_0x3fa13c['length']+0x2:_0x4cdb1a[_0x44ee('0x10')]+_0xaad89a+0x1;_0x383600[_0x44ee('0x3e')](_0xaad89a,0x0,{'type':_0x1b1678[_0x44ee('0x16')],'app':_0x44ee('0x3f'),'appdata':_0xf6ef3a[_0xaad89a]+'?'+_0x1b1678[_0x44ee('0x17')]+_0x44ee('0x40')+_0x2b57e7+':'+_0x1b1678[_0x44ee('0x17')]+_0x44ee('0x40')+_0x47f265,'exten':_0x1b1678['exten'],'context':_0x1b1678[_0x44ee('0x17')],'priority':_0x4cdb1a[_0x44ee('0x10')]+_0xaad89a,'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0]['VoiceExtensionId']});}_0x1b1678[_0x44ee('0x10')]=_0x383600[_0x44ee('0x2a')]?_[_0x44ee('0x41')](_0x383600)['priority']+0x1:_0x4cdb1a[_0x44ee('0x10')];_0x4cdb1a[_0x44ee('0x10')]=(_0x3fa13c[_0x44ee('0x2a')]?_[_0x44ee('0x41')](_0x3fa13c)[_0x44ee('0x10')]:_0x1b1678[_0x44ee('0x10')])+0x1;_0x4cdb1a[_0x44ee('0x11')]=_['concat'](_0x4cdb1a[_0x44ee('0x11')],_0x383600,[_0x1b1678],_0x3fa13c);}_0x4cdb1a['extensions'][_0x44ee('0x1d')]({'type':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x16')],'app':_0x44ee('0x42'),'exten':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0xa')],'context':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x17')],'priority':_0x4cdb1a[_0x44ee('0x10')],'VoiceExtensionId':_0x55f049[_0x3ea3d9][0x0][_0x44ee('0x1c')]});_0x22e8bb[_0x44ee('0x1d')](_0x55f049[_0x3ea3d9][0x0]['VoiceExtensionId']);_0x579c74=_['concat'](_0x579c74,_0x4cdb1a[_0x44ee('0x11')]);}}return _0x1a3f8f[_0x44ee('0x43')](function(_0x1b3f2f){return _0x1a3f8f['models'][_0x44ee('0x7')][_0x44ee('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x22e8bb}},'transaction':_0x1b3f2f})['then'](function(_0x1a73f2){return _0x1a3f8f['models'][_0x44ee('0x7')][_0x44ee('0x45')](_[_0x44ee('0x46')](_0x579c74,_0x44ee('0x10')),{'transaction':_0x1b3f2f});});});})['catch'](function(_0xfb7fe2){console[_0x44ee('0x47')](_0xfb7fe2);});}exports[_0x44ee('0x48')]=rewrite;
\ No newline at end of file
+var _0x0be6=['intervals','tag','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','destroy','bulkCreate','sortBy','error','rewrite','Interval','then','models','VoiceExtension','findAll','uniq','map','filter','groupBy','exten','queue','priority','find','extensions','push','type','Set','format','CDR(type)=%s','context','outbound','extension','cutdigits','${EXTEN:','${EXTEN}','VoiceExtensionId','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','createdAt','updatedAt','interval','*,*,*,*','IntervalId'];(function(_0x1a9198,_0x2d3039){var _0x258fc9=function(_0x30884){while(--_0x30884){_0x1a9198['push'](_0x1a9198['shift']());}};_0x258fc9(++_0x2d3039);}(_0x0be6,0xa8));var _0x60be=function(_0x32dcc6,_0x3e525a){_0x32dcc6=_0x32dcc6-0x0;var _0x585911=_0x0be6[_0x32dcc6];return _0x585911;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x3564fe,_0x462241){var _0x22daf9=this;return _0x3564fe['models'][_0x60be('0x0')]['findAll']({'raw':!![]})[_0x60be('0x1')](function(_0x3f7b6f){_0x22daf9['intervals']=_0x3f7b6f;return _0x3564fe[_0x60be('0x2')][_0x60be('0x3')][_0x60be('0x4')]({'where':{'IntervalId':_0x462241['IntervalId']},'raw':!![]});})['then'](function(_0x192030){return _0x3564fe[_0x60be('0x2')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x60be('0x5')](_[_0x60be('0x6')](_0x192030,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x60be('0x1')](function(_0x2fd4dd){var _0x2ff8c0=_['filter'](_0x2fd4dd,{'priority':'1'});var _0x2661a5=_[_0x60be('0x7')](_0x2fd4dd,{'isApp':0x1});var _0x40c7b5=_[_0x60be('0x8')](_0x2661a5,_0x60be('0x9'));var _0xb10d4a=[_0x60be('0xa'),'playback'];var _0x336ac6=[];var _0x474f4e=[];for(var _0x2dea34 in _0x40c7b5){if(_0x40c7b5['hasOwnProperty'](_0x2dea34)){_0x22daf9[_0x60be('0xb')]=0x2;_0x22daf9['extensions']=[];_0x22daf9['extension']=_[_0x60be('0xc')](_0x2ff8c0,{'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')]});_0x22daf9[_0x60be('0xd')][_0x60be('0xe')]({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':_0x60be('0x10'),'appdata':util[_0x60be('0x11')](_0x60be('0x12'),_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')]),'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0]['exten'],'priority':_0x22daf9[_0x60be('0xb')]++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0]['VoiceExtensionId']});if(_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')]===_0x60be('0x14')){if(_0x22daf9[_0x60be('0x15')]){_0x22daf9[_0x60be('0xd')][_0x60be('0xe')]({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':_0x60be('0x10'),'appdata':'CDR(destination)='+(_0x22daf9[_0x60be('0x15')][_0x60be('0x16')]?_0x60be('0x17')+_0x22daf9['extension'][_0x60be('0x16')]+'}':_0x60be('0x18')),'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')],'priority':_0x22daf9[_0x60be('0xb')]++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x19')]});}_0x22daf9[_0x60be('0xd')][_0x60be('0xe')]({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':_0x60be('0x10'),'appdata':_0x60be('0x1a')+_0x40c7b5[_0x2dea34][0x0]['VoiceExtensionId'],'context':_0x40c7b5[_0x2dea34][0x0]['context'],'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')],'priority':_0x22daf9['priority']++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x19')]});var _0x5a73cc=_0x22daf9['priority']++;_0x22daf9[_0x60be('0xd')][_0x60be('0xe')]({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':'ExecIf','appdata':_0x60be('0x1b')+(_0x5a73cc+0x2)+_0x60be('0x1c')+(_0x5a73cc+0x1)+')','context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0]['exten'],'priority':_0x5a73cc,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x19')]});if(_0x22daf9[_0x60be('0x15')]){_0x22daf9['extensions'][_0x60be('0xe')]({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':_0x60be('0x10'),'appdata':_0x22daf9[_0x60be('0x15')][_0x60be('0x16')]?_0x60be('0x1d')+_0x22daf9[_0x60be('0x15')][_0x60be('0x16')]+'}':_0x60be('0x1e'),'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0]['exten'],'priority':_0x22daf9['priority']++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0]['VoiceExtensionId']});}_0x22daf9[_0x60be('0xd')][_0x60be('0xe')]({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':_0x60be('0x10'),'appdata':_0x60be('0x1f')+_0x40c7b5[_0x2dea34][0x0]['VoiceExtensionId'],'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')],'priority':_0x22daf9[_0x60be('0xb')]++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x19')]});if(_0x22daf9[_0x60be('0x15')]&&_0x22daf9[_0x60be('0x15')][_0x60be('0x20')]('recordingFormat')&&_0x22daf9['extension'][_0x60be('0x21')]!=='none'){_0x22daf9[_0x60be('0xd')]['push']({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':_0x60be('0x10'),'appdata':_0x60be('0x22'),'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')],'priority':_0x22daf9['priority']++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x19')]});_0x22daf9['extensions'][_0x60be('0xe')]({'type':_0x40c7b5[_0x2dea34][0x0]['type'],'app':'Set','appdata':_0x60be('0x23')+_0x22daf9['extension'][_0x60be('0x21')]||_0x60be('0x24'),'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')],'priority':_0x22daf9[_0x60be('0xb')]++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x19')]});}}_0x22daf9[_0x60be('0xd')]['push']({'type':_0x40c7b5[_0x2dea34][0x0]['type'],'app':_0x60be('0x10'),'appdata':_0x60be('0x25'),'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')],'priority':_0x22daf9[_0x60be('0xb')]++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0]['VoiceExtensionId']});_0x22daf9[_0x60be('0xd')][_0x60be('0xe')]({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':_0x60be('0x10'),'appdata':_0x60be('0x26'),'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')],'priority':_0x22daf9[_0x60be('0xb')]++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0]['VoiceExtensionId']});_0x22daf9['extensions']['push']({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':_0x60be('0x10'),'appdata':_0x60be('0x27'),'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')],'priority':_0x22daf9[_0x60be('0xb')]++,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x19')]});for(var _0x39efe1=0x0,_0xb526ea=0x0;_0x39efe1<_0x40c7b5[_0x2dea34]['length'];_0x39efe1+=0x1,_0xb526ea=0x0){var _0x5b37e6=_0x40c7b5[_0x2dea34][_0x39efe1];if(_0x5b37e6[_0x60be('0xf')]){_0x5b37e6[_0x60be('0xf')]=_0x5b37e6[_0x60be('0xf')]['toLowerCase']();}var _0x351d1f=[];var _0x31001d=[];delete _0x5b37e6['id'];delete _0x5b37e6[_0x60be('0x28')];delete _0x5b37e6[_0x60be('0x29')];var _0x1d426a=_0x5b37e6[_0x60be('0x2a')]!==_0x60be('0x2b')?[_0x5b37e6[_0x60be('0x2a')]]:_0x5b37e6[_0x60be('0x2c')]?_[_0x60be('0x6')](_[_0x60be('0x7')](_0x22daf9[_0x60be('0x2d')],{'IntervalId':_0x5b37e6['IntervalId']}),_0x60be('0x2a')):[];if(_0x5b37e6['hasOwnProperty'](_0x60be('0x2e'))){if(_0x5b37e6['tag']&&_0x5b37e6[_0x60be('0x2e')]!=='--'){_0x351d1f['push']({'type':_0x5b37e6[_0x60be('0xf')],'app':'Set','appdata':'CDR(tag)='+_0x5b37e6[_0x60be('0x2e')],'context':_0x5b37e6[_0x60be('0x13')],'exten':_0x5b37e6[_0x60be('0x9')],'priority':_0x1d426a[_0x60be('0x2f')]+_0x22daf9[_0x60be('0xb')]+_0xb526ea++,'VoiceExtensionId':_0x5b37e6['VoiceExtensionId']});}}if(_0x5b37e6['type']===_0x60be('0x14')&&_0x5b37e6['hasOwnProperty'](_0x60be('0x30'))){if(_0x5b37e6[_0x60be('0x30')]){_0x351d1f[_0x60be('0xe')]({'type':_0x5b37e6[_0x60be('0xf')],'app':_0x60be('0x31'),'appdata':_0x60be('0x32')+_0x5b37e6[_0x60be('0x30')]+')','context':_0x5b37e6['context'],'exten':_0x5b37e6['exten'],'priority':_0x1d426a[_0x60be('0x2f')]+_0x22daf9['priority']+_0xb526ea++,'VoiceExtensionId':_0x5b37e6[_0x60be('0x19')]});}else{_0x351d1f['push']({'type':_0x5b37e6[_0x60be('0xf')],'app':_0x60be('0x31'),'appdata':_0x60be('0x33'),'context':_0x5b37e6[_0x60be('0x13')],'exten':_0x5b37e6[_0x60be('0x9')],'priority':_0x1d426a[_0x60be('0x2f')]+_0x22daf9[_0x60be('0xb')]+_0xb526ea++,'VoiceExtensionId':_0x5b37e6[_0x60be('0x19')]});}}if(_0x5b37e6[_0x60be('0x20')](_0x60be('0x34'))){if(_0xb10d4a[_0x60be('0x35')](_0x5b37e6[_0x60be('0x36')][_0x60be('0x37')]())>=0x0&&_0x5b37e6[_0x60be('0x38')]!=='custom'){if(_0x5b37e6[_0x60be('0x34')]){_0x351d1f[_0x60be('0xe')]({'type':_0x5b37e6[_0x60be('0xf')],'app':'ExecIf','appdata':_0x60be('0x39'),'context':_0x5b37e6[_0x60be('0x13')],'exten':_0x5b37e6['exten'],'priority':_0x1d426a[_0x60be('0x2f')]+_0x22daf9[_0x60be('0xb')]+_0xb526ea++,'VoiceExtensionId':_0x5b37e6[_0x60be('0x19')]});_0x351d1f[_0x60be('0xe')]({'type':_0x5b37e6[_0x60be('0xf')],'app':_0x60be('0x10'),'appdata':_0x60be('0x3a'),'context':_0x5b37e6['context'],'exten':_0x5b37e6['exten'],'priority':_0x1d426a[_0x60be('0x2f')]+_0x22daf9[_0x60be('0xb')]+_0xb526ea++,'VoiceExtensionId':_0x5b37e6[_0x60be('0x19')]});}else{_0x351d1f[_0x60be('0xe')]({'type':_0x5b37e6[_0x60be('0xf')],'app':'ExecIf','appdata':_0x60be('0x3b'),'context':_0x5b37e6[_0x60be('0x13')],'exten':_0x5b37e6[_0x60be('0x9')],'priority':_0x1d426a['length']+_0x22daf9['priority']+_0xb526ea++,'VoiceExtensionId':_0x5b37e6[_0x60be('0x19')]});_0x351d1f[_0x60be('0xe')]({'type':_0x5b37e6[_0x60be('0xf')],'app':'Set','appdata':_0x60be('0x3c'),'context':_0x5b37e6[_0x60be('0x13')],'exten':_0x5b37e6[_0x60be('0x9')],'priority':_0x1d426a[_0x60be('0x2f')]+_0x22daf9[_0x60be('0xb')]+_0xb526ea++,'VoiceExtensionId':_0x5b37e6['VoiceExtensionId']});}}}for(var _0x497c68=0x0;_0x497c68<_0x1d426a[_0x60be('0x2f')];_0x497c68+=0x1){var _0x7db700=_0x22daf9[_0x60be('0xb')]+_0x1d426a['length'];var _0x3c6776=_0x497c68===_0x1d426a[_0x60be('0x2f')]-0x1?_0x22daf9[_0x60be('0xb')]+_0x351d1f['length']+_0x31001d[_0x60be('0x2f')]+0x2:_0x22daf9['priority']+_0x497c68+0x1;_0x351d1f[_0x60be('0x3d')](_0x497c68,0x0,{'type':_0x5b37e6[_0x60be('0xf')],'app':_0x60be('0x3e'),'appdata':_0x1d426a[_0x497c68]+'?'+_0x5b37e6[_0x60be('0x13')]+_0x60be('0x3f')+_0x7db700+':'+_0x5b37e6[_0x60be('0x13')]+_0x60be('0x3f')+_0x3c6776,'exten':_0x5b37e6['exten'],'context':_0x5b37e6[_0x60be('0x13')],'priority':_0x22daf9[_0x60be('0xb')]+_0x497c68,'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x19')]});}_0x5b37e6[_0x60be('0xb')]=_0x351d1f[_0x60be('0x2f')]?_['last'](_0x351d1f)[_0x60be('0xb')]+0x1:_0x22daf9['priority'];_0x22daf9['priority']=(_0x31001d[_0x60be('0x2f')]?_[_0x60be('0x40')](_0x31001d)[_0x60be('0xb')]:_0x5b37e6[_0x60be('0xb')])+0x1;_0x22daf9[_0x60be('0xd')]=_['concat'](_0x22daf9[_0x60be('0xd')],_0x351d1f,[_0x5b37e6],_0x31001d);}_0x22daf9[_0x60be('0xd')][_0x60be('0xe')]({'type':_0x40c7b5[_0x2dea34][0x0][_0x60be('0xf')],'app':_0x60be('0x41'),'exten':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x9')],'context':_0x40c7b5[_0x2dea34][0x0][_0x60be('0x13')],'priority':_0x22daf9[_0x60be('0xb')],'VoiceExtensionId':_0x40c7b5[_0x2dea34][0x0]['VoiceExtensionId']});_0x336ac6['push'](_0x40c7b5[_0x2dea34][0x0]['VoiceExtensionId']);_0x474f4e=_['concat'](_0x474f4e,_0x22daf9['extensions']);}}return _0x3564fe['transaction'](function(_0x1719d6){return _0x3564fe['models'][_0x60be('0x3')][_0x60be('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x336ac6}},'transaction':_0x1719d6})[_0x60be('0x1')](function(_0x2473a4){return _0x3564fe[_0x60be('0x2')][_0x60be('0x3')][_0x60be('0x43')](_[_0x60be('0x44')](_0x474f4e,_0x60be('0xb')),{'transaction':_0x1719d6});});});})['catch'](function(_0x4d2c05){console[_0x60be('0x45')](_0x4d2c05);});}exports[_0x60be('0x46')]=rewrite;
\ No newline at end of file
diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js
index 194edee..10750c1 100644
--- a/server/components/import/cm/csv.js
+++ b/server/components/import/cm/csv.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','toString','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','from','createdAt','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','catch','query','BlackLists','all','Campaign','Lists','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CmContact','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','duplicate','Duplicate\x20Contact','keys','then','push','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect'];(function(_0x4809f1,_0x44933e){var _0x289ff9=function(_0x31c4b0){while(--_0x31c4b0){_0x4809f1['push'](_0x4809f1['shift']());}};_0x289ff9(++_0x44933e);}(_0x70e0,0x17b));var _0x070e=function(_0x5eae84,_0x1fa7aa){_0x5eae84=_0x5eae84-0x0;var _0x78a981=_0x70e0[_0x5eae84];return _0x78a981;};'use strict';var BPromise=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var _=require(_0x070e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var config=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('api');config[_0x070e('0x7')]=_['defaults'](config[_0x070e('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x070e('0x8'))[_0x070e('0x9')](socket);try{if(!process[_0x070e('0xa')][0x2]||process[_0x070e('0xa')][0x2]===_0x070e('0xb')||process[_0x070e('0xa')][0x2]===_0x070e('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x070e('0xa')][0x3]||process[_0x070e('0xa')][0x3]===_0x070e('0xb')||process[_0x070e('0xa')][0x3]===_0x070e('0xc')||!process[_0x070e('0xa')][0x4]||process[_0x070e('0xa')][0x4]===_0x070e('0xb')||process[_0x070e('0xa')][0x4]===_0x070e('0xc')){throw new Error(_0x070e('0xd'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x070e('0xe')](','),process['argv'][0x4]['split'](','));if(!process['argv'][0x5]||process[_0x070e('0xa')][0x5]===_0x070e('0xb')||process['argv'][0x5]==='null'){throw new Error(_0x070e('0xf'));}var LISTID=process[_0x070e('0xa')][0x5];var COMPANYID=process[_0x070e('0xa')][0x6]&&process[_0x070e('0xa')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x070e('0xc')?process[_0x070e('0xa')][0x6]:null;var DUPLICATES=process[_0x070e('0xa')][0x7]&&process[_0x070e('0xa')][0x7]!==_0x070e('0xb')&&process['argv'][0x7]!==_0x070e('0xc')?process[_0x070e('0xa')][0x7]:null;if(!process[_0x070e('0xa')][0x8]||process[_0x070e('0xa')][0x8]===_0x070e('0xb')||process['argv'][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x070e('0xa')][0x8];}catch(_0x3004f0){logger[_0x070e('0x10')](_0x3004f0);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x4be0d7,_0x5b184,_0x5dc5d2,_0xf8dd5d){var _0x3f6985={'message':_0x5b184};_0x3f6985[_0x4be0d7]=!![];if(_0x5dc5d2){_0x3f6985[_0x070e('0x11')]=_0x5dc5d2;}if(_0xf8dd5d){_0x3f6985[_0x070e('0x12')]=_0xf8dd5d;}return _0x3f6985;}function isEmail(_0x28a1c3){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x070e('0x13')](_0x28a1c3);}function checkRow(_0xe405e,_0x164cdf,_0x595c7e){return new BPromise(function(_0x2f8055,_0x270061){if(_[_0x070e('0x14')](_0xe405e)){return _0x270061(handleCheckRowError('error',_0x070e('0x15'),null,_0x595c7e));}if(_0xe405e['errors']&&_0xe405e['errors'][_0x070e('0x16')]){var _0x25f6e=_[_0x070e('0x17')](_0xe405e[_0x070e('0x18')],_0x070e('0x19'))['join'](';');return _0x270061(handleCheckRowError(_0x070e('0x10'),_0x25f6e,null,_0x595c7e));}var _0x219e48={};for(var _0x1d72d6 in FIELDS){if(FIELDS[_0x070e('0x1a')](_0x1d72d6)&&FIELDS[_0x1d72d6]){_0x219e48[_0x1d72d6]=_0xe405e[_0x070e('0x1b')][0x0][FIELDS[_0x1d72d6]]||_0xe405e[_0x070e('0x1b')][0x0]['\ufeff'+FIELDS[_0x1d72d6]];}}if(!_0x219e48[_0x070e('0x1c')]){return _0x270061(handleCheckRowError(_0x070e('0x10'),'firstName\x20not\x20specified!',null,_0x595c7e));}if(!_0x219e48[_0x070e('0x1d')]){return _0x270061(handleCheckRowError(_0x070e('0x10'),_0x070e('0x1e'),null,_0x595c7e));}if(_0x219e48['birthDate']){var _0x5c5f0d=moment(_0x219e48[_0x070e('0x1f')],_0x070e('0x20'));if(!_0x5c5f0d[_0x070e('0x21')]()){return _0x270061(handleCheckRowError('error',_0x070e('0x22'),null,_0x595c7e));}}if(_0x219e48[_0x070e('0x23')]){if(!isEmail(_0x219e48[_0x070e('0x23')])){return _0x270061(handleCheckRowError(_0x070e('0x10'),'email\x20format\x20is\x20not\x20valid!',null,_0x595c7e));}}_0x219e48['ListId']=LISTID;_0x219e48['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x164cdf){var _0xdf8945={};for(var _0x4e0a7d=0x0,_0x1dff97=DUPLICATES[_0x070e('0x16')];_0x4e0a7d<_0x1dff97;_0x4e0a7d+=0x1){_0xdf8945[DUPLICATES[_0x4e0a7d]]=_0x219e48[DUPLICATES[_0x4e0a7d]];}var _0x4f8130=_['find'](_0x164cdf,_0xdf8945);if(_0x4f8130){return _0x270061(handleCheckRowError(_0x070e('0x24'),_0x070e('0x25'),_0x4f8130,_0x595c7e));}}return db['CmContact']['create'](_0x219e48,{'raw':!![],'hooks':![],'fields':_[_0x070e('0x26')](_0x219e48)})[_0x070e('0x27')](function(_0x444d02){if(DUPLICATES&&DUPLICATES[_0x070e('0x16')]&&_0x164cdf){_0x164cdf[_0x070e('0x28')](_['pick'](_0x219e48,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x444d02['id'];return _0x2f8055();})['catch'](function(_0x24d17d){return _0x270061(handleCheckRowError(_0x070e('0x10'),_0x070e('0x29')+(_0x24d17d[_0x070e('0x19')]||JSON[_0x070e('0x2a')](_0x24d17d)),null,_0x595c7e));});});}function checkHopper(){function _0x4deaf8(){return function(_0x22f3a9){logger[_0x070e('0x10')]('cmContact',_0x070e('0x2b'),util[_0x070e('0x2c')](_0x22f3a9,{'showHidden':![],'depth':null}));};}var _0x4ba6f0=function(_0x4d4ee8,_0x5ddbe9){var _0x363bff=squel[_0x070e('0x2d')]()[_0x070e('0x2e')](_0x070e('0x2f'))[_0x070e('0x30')](['phone',_0x070e('0x31'),_0x070e('0x32'),_0x070e('0x33'),_0x5ddbe9,'createdAt',_0x070e('0x34')],squel[_0x070e('0x35')]()[_0x070e('0x36')]('phone',_0x070e('0x1d'))[_0x070e('0x36')]('NOW()',_0x070e('0x31'))['field']('id',_0x070e('0x32'))[_0x070e('0x36')](LISTID[_0x070e('0x37')](),_0x070e('0x33'))[_0x070e('0x36')](_0x4d4ee8['id']['toString'](),_0x5ddbe9)[_0x070e('0x36')]('NOW()','createdAt')[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x34'))['from'](_0x070e('0x39'))[_0x070e('0x3a')](_0x070e('0x3b'))[_0x070e('0x3a')]('ListId\x20=\x20?',LISTID[_0x070e('0x37')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x070e('0x3c'),squel[_0x070e('0x35')]()[_0x070e('0x36')](_0x070e('0x1d'))[_0x070e('0x3d')]('cm_hopper')[_0x070e('0x3a')](_0x5ddbe9+'\x20=\x20?',_0x4d4ee8['id'][_0x070e('0x37')]())))[_0x070e('0x37')]();return _0x363bff;};var _0xff760c=function(_0x52fcea,_0x54285a){var _0x261a27=squel['insert']()[_0x070e('0x2e')](_0x070e('0x2f'))[_0x070e('0x30')](['phone',_0x070e('0x31'),_0x070e('0x32'),'ListId',_0x54285a,'createdAt',_0x070e('0x34')],squel[_0x070e('0x35')]()[_0x070e('0x36')](_0x070e('0x1d'),_0x070e('0x1d'))['field'](_0x070e('0x38'),_0x070e('0x31'))[_0x070e('0x36')]('id',_0x070e('0x32'))[_0x070e('0x36')](LISTID[_0x070e('0x37')](),_0x070e('0x33'))[_0x070e('0x36')](_0x52fcea['id'][_0x070e('0x37')](),_0x54285a)[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x3e'))[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x34'))['from'](_0x070e('0x39'))[_0x070e('0x3a')](_0x070e('0x3b'))[_0x070e('0x3a')](_0x070e('0x3f'),LISTID[_0x070e('0x37')]())[_0x070e('0x3a')](_0x070e('0x40'),squel[_0x070e('0x41')](hopperContacts))['where'](_0x070e('0x42'))['where'](_0x070e('0x3c'),squel[_0x070e('0x35')]()['field'](_0x070e('0x43'))[_0x070e('0x3d')](_0x070e('0x44'))[_0x070e('0x3a')](_0x54285a+_0x070e('0x45'),_0x52fcea['id'][_0x070e('0x37')]()))[_0x070e('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x070e('0x35')]()['field']('phone')[_0x070e('0x3d')](_0x070e('0x2f'))[_0x070e('0x3a')](_0x54285a+_0x070e('0x45'),_0x52fcea['id'][_0x070e('0x37')]())))[_0x070e('0x37')]();return _0x261a27;};function _0x440fa1(_0x343785,_0x53bea1){var _0x477e69=squel['insert']()['into'](_0x070e('0x2f'))[_0x070e('0x30')](['phone',_0x070e('0x31'),_0x070e('0x32'),_0x070e('0x33'),_0x53bea1,_0x070e('0x3e'),_0x070e('0x34')],squel[_0x070e('0x35')]()[_0x070e('0x36')]('phone','phone')['field'](_0x070e('0x38'),_0x070e('0x31'))[_0x070e('0x36')]('id',_0x070e('0x32'))['field'](LISTID[_0x070e('0x37')](),'ListId')[_0x070e('0x36')](_0x343785['id'][_0x070e('0x37')](),_0x53bea1)[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x3e'))[_0x070e('0x36')]('NOW()',_0x070e('0x34'))[_0x070e('0x3d')](_0x070e('0x39'))['where'](_0x070e('0x3b'))[_0x070e('0x3a')]('ListId\x20=\x20?',LISTID[_0x070e('0x37')]())['where'](_0x070e('0x40'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x070e('0x37')]();return _0x477e69;}function _0x1ae5cb(_0x1100d8,_0x122198){var _0x3cb9ee=squel[_0x070e('0x2d')]()['into'](_0x070e('0x46'))['fromQuery']([_0x070e('0x1d'),'ContactId',_0x070e('0x33'),_0x122198,_0x070e('0x3e'),'updatedAt'],squel[_0x070e('0x35')]()['field'](_0x070e('0x1d'),_0x070e('0x1d'))[_0x070e('0x36')]('id',_0x070e('0x32'))[_0x070e('0x36')](LISTID[_0x070e('0x37')](),_0x070e('0x33'))[_0x070e('0x36')](_0x1100d8['id'][_0x070e('0x37')](),_0x122198)[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x3e'))[_0x070e('0x36')](_0x070e('0x38'),'updatedAt')[_0x070e('0x3d')](_0x070e('0x39'))[_0x070e('0x3a')](_0x070e('0x3b'))['where'](_0x070e('0x3f'),LISTID[_0x070e('0x37')]())[_0x070e('0x3a')](_0x070e('0x40'),squel[_0x070e('0x41')](hopperContacts))[_0x070e('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x070e('0x37')]();return _0x3cb9ee;}return db[_0x070e('0x47')][_0x070e('0x48')]({'where':{'type':_0x070e('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x070e('0x4a')],'as':'Lists','where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0x36373d){var _0x3a1ad2=[];if(_0x36373d){var _0x150bf6;for(var _0x2a20d4=0x0,_0x50ef9f;_0x2a20d4<_0x36373d[_0x070e('0x16')];_0x2a20d4+=0x1){_0x50ef9f=_0x36373d[_0x2a20d4][_0x070e('0x4b')]({'plain':!![]});switch(_0x50ef9f[_0x070e('0x4c')]){case _0x070e('0x4d'):_0x3a1ad2['push'](db[_0x070e('0x4e')]['query'](_0xff760c(_0x50ef9f,_0x070e('0x4f')))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));break;case'onlyIfOpen':_0x3a1ad2[_0x070e('0x28')](db['sequelize'][_0x070e('0x51')](_0x4ba6f0(_0x50ef9f,'VoiceQueueId'))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));break;default:_0x3a1ad2['push'](db[_0x070e('0x4e')]['query'](_0x440fa1(_0x50ef9f,_0x070e('0x4f')))[_0x070e('0x27')](function(){})['catch'](_0x4deaf8()));}}}return _0x3a1ad2;})['all']()[_0x070e('0x27')](function(){return db[_0x070e('0x47')][_0x070e('0x48')]({'where':{'type':_0x070e('0x49')},'attributes':['id'],'include':[{'model':db[_0x070e('0x4a')],'as':_0x070e('0x52'),'where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0x332c8a){var _0x25b599=[];if(_0x332c8a){var _0x1d1f44;for(var _0x72077d=0x0,_0x25670e;_0x72077d<_0x332c8a[_0x070e('0x16')];_0x72077d+=0x1){_0x25670e=_0x332c8a[_0x72077d]['get']({'plain':!![]});_0x25b599[_0x070e('0x28')](db[_0x070e('0x4e')]['query'](_0x1ae5cb(_0x25670e,'VoiceQueueId'))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));}}return _0x25b599;})[_0x070e('0x53')]();})[_0x070e('0x27')](function(){return db[_0x070e('0x54')][_0x070e('0x48')]({'attributes':['id',_0x070e('0x4c')],'include':[{'model':db[_0x070e('0x4a')],'as':_0x070e('0x55'),'where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0x62800d){var _0x2084a1=[];if(_0x62800d){for(var _0x46ec49=0x0,_0x595e2e;_0x46ec49<_0x62800d['length'];_0x46ec49+=0x1){_0x595e2e=_0x62800d[_0x46ec49]['get']({'plain':!![]});switch(_0x595e2e[_0x070e('0x4c')]){case _0x070e('0x4d'):_0x2084a1[_0x070e('0x28')](db[_0x070e('0x4e')]['query'](_0xff760c(_0x595e2e,_0x070e('0x56')))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));break;case _0x070e('0x57'):_0x2084a1[_0x070e('0x28')](db[_0x070e('0x4e')]['query'](_0x4ba6f0(_0x595e2e,_0x070e('0x56')))['then'](function(){})[_0x070e('0x50')](_0x4deaf8()));break;default:_0x2084a1[_0x070e('0x28')](db[_0x070e('0x4e')][_0x070e('0x51')](_0x440fa1(_0x595e2e,_0x070e('0x56')))['then'](function(){})[_0x070e('0x50')](_0x4deaf8()));}}}return _0x2084a1;})[_0x070e('0x53')]();})['then'](function(){return db[_0x070e('0x54')][_0x070e('0x48')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x070e('0x52'),'where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0xf0aef8){var _0x4da906=[];if(_0xf0aef8){for(var _0x40d7e6=0x0,_0xe8c476;_0x40d7e6<_0xf0aef8[_0x070e('0x16')];_0x40d7e6+=0x1){_0xe8c476=_0xf0aef8[_0x40d7e6][_0x070e('0x4b')]({'plain':!![]});_0x4da906[_0x070e('0x28')](db[_0x070e('0x4e')][_0x070e('0x51')](_0x1ae5cb(_0xe8c476,_0x070e('0x56')))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));}}return _0x4da906;})[_0x070e('0x53')]();})[_0x070e('0x50')](function(_0x18c27a){logger['error'](_0x070e('0x58'),_0x070e('0x59'),_0x18c27a[_0x070e('0x19')]);});}var processPromises=function(_0x1b71dd){return BPromise[_0x070e('0x53')](promises)[_0x070e('0x27')](function(_0x5c4352){})['catch'](function(_0x4a8563){logger[_0x070e('0x10')](_0x070e('0x5a'),JSON[_0x070e('0x2a')](_0x4a8563));})[_0x070e('0x5b')](function(){socket['emit'](_0x070e('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1b71dd){return _0x1b71dd[_0x070e('0x5d')]();}});};var endCsv=function(){return BPromise[_0x070e('0x5e')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x070e('0x27')](function(){socket['emit'](_0x070e('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x070e('0x5f')](FILEPATH);}catch(_0x59e6e5){logger['error'](_0x070e('0x60'),JSON[_0x070e('0x2a')](_0x59e6e5));}finally{process['exit'](0x0);}});};process['on'](_0x070e('0x61'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x070e('0x27')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x070e('0xe')](',');return db[_0x070e('0x62')][_0x070e('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x070e('0x27')](function(_0x341756){var _0x2a12a1=fs[_0x070e('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x070e('0x64')](_0x2a12a1,{'header':!![],'skipEmptyLines':!![],'step':function(_0xdcc60a,_0x4e0f6e){total+=0x1;var _0x1306e6=total;promises[_0x070e('0x28')](checkRow(_0xdcc60a,_0x341756,_0x1306e6)[_0x070e('0x27')](function(){success+=0x1;})[_0x070e('0x50')](function(_0x3f2bb5){if(_0x3f2bb5[_0x070e('0x10')]){errors+=0x1;delete _0x3f2bb5[_0x070e('0x10')];}else if(_0x3f2bb5[_0x070e('0x24')]){duplicates+=0x1;delete _0x3f2bb5[_0x070e('0x24')];}rows[_0x070e('0x28')](_0x3f2bb5);}));if(total%0xc8===0x0){_0x4e0f6e[_0x070e('0x65')]();return processPromises(_0x4e0f6e);}},'complete':function(){return processPromises()['then'](function(){logger[_0x070e('0x66')](_0x070e('0x67'));endCsv();});},'error':function(_0x449337,_0xe50b1b){logger['info'](_0x070e('0x68'),JSON[_0x070e('0x2a')](_0x449337));endCsv();}});})[_0x070e('0x50')](function(_0x2bad43){logger[_0x070e('0x10')](_0x070e('0x69'),JSON['stringify'](_0x2bad43));});}main();
\ No newline at end of file
+var _0xa9e0=['CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','query','catch','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','emit','unlinkSync','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate'];(function(_0x22f66,_0x1391f9){var _0x26e71e=function(_0x5f19d0){while(--_0x5f19d0){_0x22f66['push'](_0x22f66['shift']());}};_0x26e71e(++_0x1391f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0a9e('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var socket=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x0a9e('0xb')][0x2]||process['argv'][0x2]==='undefined'||process[_0x0a9e('0xb')][0x2]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xd'));}var FILEPATH=process[_0x0a9e('0xb')][0x2];if(!process[_0x0a9e('0xb')][0x3]||process[_0x0a9e('0xb')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process['argv'][0x4]||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x4]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0xf'));}var FIELDS=_[_0x0a9e('0x10')](process['argv'][0x3][_0x0a9e('0x11')](','),process[_0x0a9e('0xb')][0x4][_0x0a9e('0x11')](','));if(!process[_0x0a9e('0xb')][0x5]||process[_0x0a9e('0xb')][0x5]===_0x0a9e('0xe')||process['argv'][0x5]===_0x0a9e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x0a9e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0a9e('0xb')][0x6]!==_0x0a9e('0xe')&&process['argv'][0x6]!==_0x0a9e('0xc')?process['argv'][0x6]:null;var DUPLICATES=process[_0x0a9e('0xb')][0x7]&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xe')&&process[_0x0a9e('0xb')][0x7]!==_0x0a9e('0xc')?process[_0x0a9e('0xb')][0x7]:null;if(!process[_0x0a9e('0xb')][0x8]||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xe')||process[_0x0a9e('0xb')][0x8]===_0x0a9e('0xc')){throw new Error(_0x0a9e('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2c3407){logger[_0x0a9e('0x13')](_0x2c3407);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x53682f,_0x20f109,_0x5a09ef,_0x588269){var _0x3a02e1={'message':_0x20f109};_0x3a02e1[_0x53682f]=!![];if(_0x5a09ef){_0x3a02e1[_0x0a9e('0x14')]=_0x5a09ef;}if(_0x588269){_0x3a02e1[_0x0a9e('0x15')]=_0x588269;}return _0x3a02e1;}function isEmail(_0x30bae6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x30bae6);}function checkRow(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return new BPromise(function(_0x4d00e6,_0x370d86){if(_[_0x0a9e('0x16')](_0xfb6e48)){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3b45bc));}if(_0xfb6e48['errors']&&_0xfb6e48[_0x0a9e('0x17')][_0x0a9e('0x18')]){var _0x40c424=_[_0x0a9e('0x19')](_0xfb6e48['errors'],_0x0a9e('0x1a'))['join'](';');return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x40c424,null,_0x3b45bc));}var _0x5bfb33={};for(var _0x1dc186 in FIELDS){if(FIELDS[_0x0a9e('0x1b')](_0x1dc186)&&FIELDS[_0x1dc186]){_0x5bfb33[_0x1dc186]=_0xfb6e48[_0x0a9e('0x1c')][0x0][FIELDS[_0x1dc186]]||_0xfb6e48[_0x0a9e('0x1c')][0x0]['\ufeff'+FIELDS[_0x1dc186]];}}if(!_0x5bfb33[_0x0a9e('0x1d')]){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x1e'),null,_0x3b45bc));}if(!_0x5bfb33[_0x0a9e('0x1f')]){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x20'),null,_0x3b45bc));}if(_0x5bfb33[_0x0a9e('0x21')]){var _0x2b1f27=moment(_0x5bfb33[_0x0a9e('0x21')],'YYYY-MM-DD');if(!_0x2b1f27[_0x0a9e('0x22')]()){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x23'),null,_0x3b45bc));}}if(_0x5bfb33[_0x0a9e('0x24')]){if(!isEmail(_0x5bfb33[_0x0a9e('0x24')])){return _0x370d86(handleCheckRowError(_0x0a9e('0x13'),_0x0a9e('0x25'),null,_0x3b45bc));}}_0x5bfb33[_0x0a9e('0x26')]=LISTID;_0x5bfb33[_0x0a9e('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2fb0e4){var _0x426950={};for(var _0x5d1e0e=0x0,_0x2407f9=DUPLICATES[_0x0a9e('0x18')];_0x5d1e0e<_0x2407f9;_0x5d1e0e+=0x1){_0x426950[DUPLICATES[_0x5d1e0e]]=_0x5bfb33[DUPLICATES[_0x5d1e0e]];}var _0x1122db=_[_0x0a9e('0x28')](_0x2fb0e4,_0x426950);if(_0x1122db){return _0x370d86(handleCheckRowError(_0x0a9e('0x29'),'Duplicate\x20Contact',_0x1122db,_0x3b45bc));}}return db[_0x0a9e('0x2a')][_0x0a9e('0x2b')](_0x5bfb33,{'raw':!![],'hooks':![],'fields':_[_0x0a9e('0x2c')](_0x5bfb33)})[_0x0a9e('0x2d')](function(_0x2b45ea){if(DUPLICATES&&DUPLICATES[_0x0a9e('0x18')]&&_0x2fb0e4){_0x2fb0e4[_0x0a9e('0x2e')](_[_0x0a9e('0x2f')](_0x5bfb33,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2b45ea['id'];return _0x4d00e6();})['catch'](function(_0x44295a){return _0x370d86(handleCheckRowError('error',_0x0a9e('0x30')+(_0x44295a[_0x0a9e('0x1a')]||JSON[_0x0a9e('0x31')](_0x44295a)),null,_0x3b45bc));});});}function checkHopper(){function _0x3f3d41(){return function(_0x567193){logger[_0x0a9e('0x13')](_0x0a9e('0x32'),_0x0a9e('0x33'),util[_0x0a9e('0x34')](_0x567193,{'showHidden':![],'depth':null}));};}var _0x4853b1=function(_0x54135e,_0x1e8694){var _0x5640eb=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')](['phone',_0x0a9e('0x39'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x1e8694,'createdAt',_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')]('phone','phone')[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),'ListId')['field'](_0x54135e['id'][_0x0a9e('0x3f')](),_0x1e8694)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')](_0x0a9e('0x46'))[_0x0a9e('0x43')](_0x0a9e('0x47'),squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')['where'](_0x1e8694+_0x0a9e('0x48'),_0x54135e['id'][_0x0a9e('0x3f')]())))[_0x0a9e('0x3f')]();return _0x5640eb;};var _0x315881=function(_0x1a69dd,_0xc9a702){var _0x10b040=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),'scheduledAt',_0x0a9e('0x3a'),_0x0a9e('0x26'),_0xc9a702,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')[_0x0a9e('0x3d')]('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x1a69dd['id'][_0x0a9e('0x3f')](),_0xc9a702)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x3b'))[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID[_0x0a9e('0x3f')]())[_0x0a9e('0x43')]('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x3c')]()[_0x0a9e('0x3d')](_0x0a9e('0x4a'))[_0x0a9e('0x41')](_0x0a9e('0x4b'))[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id'][_0x0a9e('0x3f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'))[_0x0a9e('0x41')]('cm_hopper')[_0x0a9e('0x43')](_0xc9a702+_0x0a9e('0x48'),_0x1a69dd['id']['toString']())))['toString']();return _0x10b040;};function _0x2ef381(_0x59c6ff,_0x443e72){var _0x4c3845=squel[_0x0a9e('0x35')]()[_0x0a9e('0x36')](_0x0a9e('0x37'))['fromQuery']([_0x0a9e('0x1f'),_0x0a9e('0x39'),'ContactId','ListId',_0x443e72,_0x0a9e('0x40'),_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')]('phone',_0x0a9e('0x1f'))['field'](_0x0a9e('0x3e'),'scheduledAt')['field']('id','ContactId')[_0x0a9e('0x3d')](LISTID['toString'](),_0x0a9e('0x26'))[_0x0a9e('0x3d')](_0x59c6ff['id'][_0x0a9e('0x3f')](),_0x443e72)[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),'updatedAt')[_0x0a9e('0x41')](_0x0a9e('0x42'))[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')](_0x0a9e('0x45'),LISTID['toString']())[_0x0a9e('0x43')](_0x0a9e('0x4c'),squel['str'](hopperContacts))[_0x0a9e('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x0a9e('0x3f')]();return _0x4c3845;}function _0x5ba1f9(_0x4b3c1a,_0x5674ee){var _0x273cb5=squel['insert']()[_0x0a9e('0x36')](_0x0a9e('0x4d'))[_0x0a9e('0x38')]([_0x0a9e('0x1f'),_0x0a9e('0x3a'),_0x0a9e('0x26'),_0x5674ee,'createdAt',_0x0a9e('0x3b')],squel['select']()[_0x0a9e('0x3d')](_0x0a9e('0x1f'),_0x0a9e('0x1f'))['field']('id',_0x0a9e('0x3a'))[_0x0a9e('0x3d')](LISTID[_0x0a9e('0x3f')](),_0x0a9e('0x26'))['field'](_0x4b3c1a['id'][_0x0a9e('0x3f')](),_0x5674ee)[_0x0a9e('0x3d')]('NOW()',_0x0a9e('0x40'))[_0x0a9e('0x3d')](_0x0a9e('0x3e'),_0x0a9e('0x3b'))[_0x0a9e('0x41')]('cm_contacts')[_0x0a9e('0x43')](_0x0a9e('0x44'))[_0x0a9e('0x43')]('ListId\x20=\x20?',LISTID[_0x0a9e('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0a9e('0x49')](hopperContacts))[_0x0a9e('0x43')](_0x0a9e('0x46')))[_0x0a9e('0x3f')]();return _0x273cb5;}return db[_0x0a9e('0x4e')][_0x0a9e('0x4f')]({'where':{'type':_0x0a9e('0x50')},'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x53'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x19012b){var _0x2bbb86=[];if(_0x19012b){var _0x2b8192;for(var _0x320898=0x0,_0x412a72;_0x320898<_0x19012b[_0x0a9e('0x18')];_0x320898+=0x1){_0x412a72=_0x19012b[_0x320898][_0x0a9e('0x54')]({'plain':!![]});switch(_0x412a72['dialCheckDuplicateType']){case _0x0a9e('0x55'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x315881(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x2bbb86[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x4853b1(_0x412a72,_0x0a9e('0x57')))['then'](function(){})['catch'](_0x3f3d41()));break;default:_0x2bbb86['push'](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x2ef381(_0x412a72,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}}return _0x2bbb86;})[_0x0a9e('0x5b')]()[_0x0a9e('0x2d')](function(){return db[_0x0a9e('0x4e')]['findAll']({'where':{'type':_0x0a9e('0x50')},'attributes':['id'],'include':[{'model':db[_0x0a9e('0x52')],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x2bdc44){var _0x583b2e=[];if(_0x2bdc44){var _0x4437ff;for(var _0x44351d=0x0,_0x4c46c1;_0x44351d<_0x2bdc44[_0x0a9e('0x18')];_0x44351d+=0x1){_0x4c46c1=_0x2bdc44[_0x44351d][_0x0a9e('0x54')]({'plain':!![]});_0x583b2e[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x5ba1f9(_0x4c46c1,_0x0a9e('0x57')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x583b2e;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id',_0x0a9e('0x51')],'include':[{'model':db[_0x0a9e('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x3511c9){var _0x30a4c7=[];if(_0x3511c9){for(var _0xf410e5=0x0,_0x332367;_0xf410e5<_0x3511c9[_0x0a9e('0x18')];_0xf410e5+=0x1){_0x332367=_0x3511c9[_0xf410e5][_0x0a9e('0x54')]({'plain':!![]});switch(_0x332367[_0x0a9e('0x51')]){case _0x0a9e('0x55'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x315881(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));break;case _0x0a9e('0x58'):_0x30a4c7[_0x0a9e('0x2e')](db[_0x0a9e('0x56')]['query'](_0x4853b1(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));break;default:_0x30a4c7[_0x0a9e('0x2e')](db['sequelize']['query'](_0x2ef381(_0x332367,_0x0a9e('0x5e')))[_0x0a9e('0x2d')](function(){})['catch'](_0x3f3d41()));}}}return _0x30a4c7;})[_0x0a9e('0x5b')]();})['then'](function(){return db[_0x0a9e('0x5d')][_0x0a9e('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0a9e('0x5c'),'where':{'id':LISTID}}]})[_0x0a9e('0x2d')](function(_0x2d2286){var _0x42b959=[];if(_0x2d2286){for(var _0x3755fe=0x0,_0x1f42a0;_0x3755fe<_0x2d2286[_0x0a9e('0x18')];_0x3755fe+=0x1){_0x1f42a0=_0x2d2286[_0x3755fe]['get']({'plain':!![]});_0x42b959[_0x0a9e('0x2e')](db[_0x0a9e('0x56')][_0x0a9e('0x59')](_0x5ba1f9(_0x1f42a0,_0x0a9e('0x5e')))['then'](function(){})[_0x0a9e('0x5a')](_0x3f3d41()));}}return _0x42b959;})[_0x0a9e('0x5b')]();})['catch'](function(_0x1d6834){logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x60'),_0x1d6834[_0x0a9e('0x1a')]);});}var processPromises=function(_0x385d52){return BPromise['all'](promises)['then'](function(_0x353384){})[_0x0a9e('0x5a')](function(_0x94dcf5){logger['error'](_0x0a9e('0x61'),JSON[_0x0a9e('0x31')](_0x94dcf5));})['finally'](function(){socket['emit'](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x385d52){return _0x385d52['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0a9e('0x2d')](function(){socket[_0x0a9e('0x63')](_0x0a9e('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0a9e('0x64')](FILEPATH);}catch(_0x3c6dd6){logger[_0x0a9e('0x13')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x0a9e('0x31')](_0x3c6dd6));}finally{process['exit'](0x0);}});};process['on'](_0x0a9e('0x65'),function(){logger[_0x0a9e('0x66')](_0x0a9e('0x67'));endCsv();});function main(){return BPromise[_0x0a9e('0x68')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0a9e('0x11')](',');return db[_0x0a9e('0x2a')][_0x0a9e('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0xb6e411){var _0x21e592=fs[_0x0a9e('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0a9e('0x6a')](_0x21e592,{'header':!![],'skipEmptyLines':!![],'step':function(_0x255e49,_0x1910bf){total+=0x1;var _0x32b9bd=total;promises[_0x0a9e('0x2e')](checkRow(_0x255e49,_0xb6e411,_0x32b9bd)['then'](function(){success+=0x1;})[_0x0a9e('0x5a')](function(_0x3325c5){if(_0x3325c5['error']){errors+=0x1;delete _0x3325c5[_0x0a9e('0x13')];}else if(_0x3325c5[_0x0a9e('0x29')]){duplicates+=0x1;delete _0x3325c5[_0x0a9e('0x29')];}rows['push'](_0x3325c5);}));if(total%0xc8===0x0){_0x1910bf[_0x0a9e('0x6b')]();return processPromises(_0x1910bf);}},'complete':function(){return processPromises()['then'](function(){logger[_0x0a9e('0x66')](_0x0a9e('0x6c'));endCsv();});},'error':function(_0x558a87,_0x1f29bd){logger[_0x0a9e('0x66')](_0x0a9e('0x6d'),JSON[_0x0a9e('0x31')](_0x558a87));endCsv();}});})[_0x0a9e('0x5a')](function(_0x501050){logger[_0x0a9e('0x13')](_0x0a9e('0x6e'),JSON[_0x0a9e('0x31')](_0x501050));});}main();
\ No newline at end of file
diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js
index 1cf0f96..e51d2c6 100644
--- a/server/components/import/cm/csv2.js
+++ b/server/components/import/cm/csv2.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','cm_hopper_black','phone','fields','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','scheduledat','ListId','createdAt','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','then','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','stringify','start','binding','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','DROP\x20TABLE\x20','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults'];(function(_0x34fa84,_0x45f460){var _0xff0fe=function(_0x537cac){while(--_0x537cac){_0x34fa84['push'](_0x34fa84['shift']());}};_0xff0fe(++_0x45f460);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var fs=require('fs');var path=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var Papa=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var BPromise=require('bluebird');var moment=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var Redis=require(_0x7995('0x6'));var db=require(_0x7995('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x7995('0x8'));var logger=require(_0x7995('0x9'))(_0x7995('0xa'));config[_0x7995('0xb')]=_[_0x7995('0xc')](config[_0x7995('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7995('0xd'))(new Redis(config[_0x7995('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x7995('0xe'));function isEmail(_0x3116fb){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x7995('0xf')](_0x3116fb);}function selectNotIn(_0x35b5fe,_0x3c1d19,_0x1e400a,_0x341672,_0x524f7b){return squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')[_0x7995('0x12')](_0x341672)[_0x7995('0x13')](_0x3c1d19,null,_0x3c1d19+_0x7995('0x14')+_0x341672+'.'+_0x1e400a)[_0x7995('0x15')](_0x341672+'.'+_0x1e400a+_0x7995('0x16')+_0x35b5fe+'.'+_0x1e400a)[_0x7995('0x15')](_0x3c1d19+_0x7995('0x17')+_0x524f7b['join']()+')');}function insertCmHopper(_0x58f5ad,_0x2b4e94,_0x2233dd,_0x24b5bb,_0x321ae8){var _0x3f1d3e=[_0x7995('0x18'),_0x7995('0x19'),_0x7995('0x1a'),'cm_contacts.ListId',_0x2b4e94+'.'+_0x24b5bb,_0x7995('0x1b'),'cm_contacts.updatedAt',_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x321ae8+'\x22'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone','scheduledat',_0x7995('0x22'),'ListId',_0x24b5bb,'createdAt',_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel['select']()['fields'](_0x3f1d3e)[_0x7995('0x12')](_0x2b4e94)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x2b4e94+_0x7995('0x28'))[_0x7995('0x13')](_0x2233dd,null,_0x2233dd+'.id\x20=\x20'+_0x2b4e94+'.'+_0x24b5bb)[_0x7995('0x15')](_0x2b4e94+_0x7995('0x29'),_0x58f5ad)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c')])))[_0x7995('0x2d')]();}function insertCmHopperBlack(_0x2a307e,_0x56691a,_0x47625f,_0x5911c3){var _0x229742=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x56691a+'.'+_0x5911c3,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()['into'](_0x7995('0x2f'))[_0x7995('0x21')]([_0x7995('0x30'),'ContactId','ListId',_0x5911c3,'createdAt',_0x7995('0x23')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x229742)[_0x7995('0x12')](_0x56691a)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x56691a+'.CmListId')[_0x7995('0x13')](_0x47625f,null,_0x47625f+'.id\x20=\x20'+_0x56691a+'.'+_0x5911c3)[_0x7995('0x15')](_0x56691a+_0x7995('0x29'),_0x2a307e)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')['from']('cm_hopper_black')[_0x7995('0x15')](_0x7995('0x32'),_0x2a307e)['where'](_0x5911c3+_0x7995('0x33'),_0x56691a+'.'+_0x5911c3)))['toString']();}function insertTzCmHopper(_0x37917b,_0x1cb058,_0x177cb4,_0x5014d2,_0x52d76d,_0x36d057){var _0x5e67fe=['cm_contacts.phone',_0x7995('0x34')+_0x36d057+_0x7995('0x35'),'cm_contacts.id',_0x7995('0x2e'),_0x1cb058+'.'+_0x5014d2,_0x7995('0x1b'),_0x7995('0x36'),_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x52d76d+'\x22'];var _0x53002a=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone',_0x7995('0x37'),_0x7995('0x22'),_0x7995('0x38'),_0x5014d2,_0x7995('0x39'),_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x5e67fe)[_0x7995('0x12')](_0x1cb058)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x1cb058+_0x7995('0x28'))[_0x7995('0x13')](_0x177cb4,null,_0x177cb4+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x13')](_0x36d057,null,_0x36d057+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x15')](_0x1cb058+'.CmListId\x20=\x20?',_0x37917b)['where'](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,'cm_hopper',[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))['where'](_0x7995('0x2b'),selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,_0x7995('0x20'),[_0x7995('0x2c')])))['toString']();return _0x53002a;}function insertTzCmHopperBlack(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881){var _0x493066=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x5e85b9+'.'+_0x5a8881,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x2f'))[_0x7995('0x21')](['phone','ContactId',_0x7995('0x38'),_0x5a8881,'createdAt',_0x7995('0x23')],squel['select']()[_0x7995('0x31')](_0x493066)['from'](_0x5e85b9)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x5e85b9+_0x7995('0x28'))[_0x7995('0x13')](_0x3993b5,null,_0x3993b5+_0x7995('0x14')+_0x5e85b9+'.'+_0x5a8881)[_0x7995('0x15')](_0x5e85b9+'.CmListId\x20=\x20?',_0x46ac4f)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')](_0x7995('0x30'))[_0x7995('0x12')](_0x7995('0x2f'))['where'](_0x7995('0x32'),_0x46ac4f)[_0x7995('0x15')](_0x5a8881+'\x20=\x20?',_0x5e85b9+'.'+_0x5a8881)))[_0x7995('0x2d')]();}function insertCmContact(_0x5843ba,_0x1d87f9,_0x187735,_0x1afab4){var _0x30e220=_[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x1afab4),[_0x7995('0x38'),'CompanyId',_0x7995('0x39'),_0x7995('0x23')]);return squel[_0x7995('0x1e')]()['into'](_0x7995('0x26'))[_0x7995('0x21')](_0x30e220,squel[_0x7995('0x10')]()['fields'](_0x30e220)['from'](_0x1d87f9)['where']('('+_0x187735[_0x7995('0x13')](',')+_0x7995('0x3c'),squel['select']()[_0x7995('0x31')](_0x187735)[_0x7995('0x12')](_0x7995('0x26'))[_0x7995('0x15')](_0x7995('0x32'),_0x5843ba)['where'](_0x7995('0x3d')))['where'](_0x7995('0x3e'),squel[_0x7995('0x10')]()[_0x7995('0x11')]('MIN(id)','min_id')['from'](_0x1d87f9)['group'](_0x187735[_0x7995('0x13')](','))))[_0x7995('0x2d')]();}function handleStop(){logger[_0x7995('0x3f')](_0x7995('0x40'));stopped=!![];}function handleUncaughtException(_0x1d957e){logger[_0x7995('0x41')](_0x1d957e[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}function handleError(_0x328671,_0x17ecd3){stats[_0x7995('0x44')][_0x7995('0x45')]({'name':_0x17ecd3[_0x7995('0x46')],'message':_0x17ecd3[_0x7995('0x42')],'row':_0x328671});}function handleQuery(_0x1ea1dc){logger[_0x7995('0x3f')](_0x1ea1dc);return db[_0x7995('0x47')][_0x7995('0x48')](_0x1ea1dc)[_0x7995('0x49')](function(_0x50b7c2){results[_0x7995('0x45')](_0x50b7c2);})[_0x7995('0x4a')](function(_0x3b8a54){logger[_0x7995('0x41')](_0x3b8a54['message']);});}function updateTzCampaigns(_0x53125a){return new Promise(function(_0x402fa0,_0x197b52){var _0x5b9467=squel[_0x7995('0x10')]()['fields']([_0x7995('0x4b'),_0x7995('0x4c')])[_0x7995('0x12')](_0x7995('0x4d'))['join']('campaigns_has_cm_lists',null,_0x7995('0x4e'))[_0x7995('0x15')](_0x7995('0x4f')+_0x53125a);db[_0x7995('0x47')][_0x7995('0x48')](_0x5b9467[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x1e2206){var _0x984c23=[];for(var _0x50caf5=0x0;_0x50caf5<_0x1e2206[_0x7995('0x50')];_0x50caf5++){_0x984c23[_0x7995('0x45')](getTimezoneData(_0x1e2206[_0x50caf5],tmp_campaigns));}BPromise[_0x7995('0x51')](_0x984c23)[_0x7995('0x52')](function(){_0x402fa0({'val':0x1});});})['catch'](function(_0x51bf6a){logger[_0x7995('0x41')](_0x51bf6a[_0x7995('0x42')]);_0x402fa0({'val':0x0});});});}function updateTzVoiceQueues(_0x47d5d7){return new Promise(function(_0x971a23,_0x375fc9){var _0x2e3421=squel[_0x7995('0x10')]()[_0x7995('0x31')](['voice_queues.id',_0x7995('0x53')])['from'](_0x7995('0x54'))[_0x7995('0x13')](_0x7995('0x55'),null,_0x7995('0x56'))[_0x7995('0x15')](_0x7995('0x57')+_0x47d5d7);db[_0x7995('0x47')][_0x7995('0x48')](_0x2e3421[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x2618c4){var _0x234d8d=[];for(var _0x56eb85=0x0;_0x56eb85<_0x2618c4[_0x7995('0x50')];_0x56eb85++){_0x234d8d[_0x7995('0x45')](getTimezoneData(_0x2618c4[_0x56eb85],tmp_voice_queues));}BPromise[_0x7995('0x51')](_0x234d8d)[_0x7995('0x52')](function(){_0x971a23({'val':0x1});});})[_0x7995('0x4a')](function(_0x54a2e0){logger['error'](_0x54a2e0[_0x7995('0x42')]);_0x971a23({'val':0x0});});});}function getTimezoneData(_0x87e38d,_0x221542){return new Promise(function(_0xae6166,_0x5aa2ec){var _0x22d317=shared['timezones'];var _0x5df621=_0x22d317[_0x87e38d[_0x7995('0x58')]];if(_[_0x7995('0x59')](_0x5df621)){_0xae6166({'ret':0x1});}else{var _0x3f0a71=_0x5df621[_0x7995('0x5a')];var _0x290eae=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x221542)[_0x7995('0x5b')]('id',_0x87e38d['id'])[_0x7995('0x5b')](_0x7995('0x5c'),_0x3f0a71)['set'](_0x7995('0x58'),_0x87e38d[_0x7995('0x58')])[_0x7995('0x2d')]();return db['sequelize'][_0x7995('0x48')](_0x290eae)[_0x7995('0x49')](function(_0x705f0){_0xae6166({'ret':0x1});})[_0x7995('0x4a')](function(_0x3b0d30){logger[_0x7995('0x41')](_0x3b0d30[_0x7995('0x42')]);_0x5aa2ec({'ret':0x1});});}});}function handleTZQuery(_0x3adfd2){logger[_0x7995('0x3f')](_0x3adfd2);return db[_0x7995('0x47')][_0x7995('0x48')](_0x3adfd2)['spread'](function(_0x5e8b4c){})[_0x7995('0x4a')](function(_0xfe1105){logger[_0x7995('0x41')](_0xfe1105[_0x7995('0x42')]);});}function main(_0x4dbab8,_0x3b45e8,_0x2c9eb6,_0x54b955){logger['info'](_0x7995('0x5d'),_0x4dbab8,JSON[_0x7995('0x5e')](_0x3b45e8));process['send'](_0x7995('0x5f'));var _0x5b1cba=_0x3b45e8[_0x7995('0x60')];var _0xea9aba=_0x3b45e8['socket_timestamp'];var _0x5d9d33=path[_0x7995('0x13')](config['root'],_0x7995('0x61'),_0xea9aba+_0x7995('0x62'));hasTZ=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x63')](_0x7995('0x58'));var _0x18cff7=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x13')]();logger[_0x7995('0x3f')](_0x7995('0x64'),_0x18cff7);if(hasTZ)_0x18cff7+=_0x7995('0x65');fs[_0x7995('0x66')](_0x5d9d33,_0x18cff7+'\x0a');Papa[_0x7995('0x67')](fs[_0x7995('0x68')](_0x4dbab8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x36e3a7,_0x3773de){try{for(var _0x6ad274=0x0,_0x251490=[];_0x6ad274<_0x36e3a7[_0x7995('0x69')][_0x7995('0x50')];_0x6ad274++){stats[_0x7995('0x6a')]+=0x1;if(_0x36e3a7[_0x7995('0x44')][_0x6ad274]){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],_0x36e3a7[_0x7995('0x44')][_0x6ad274]);}else{var _0x260ef1=[];for(var _0x33479a in _0x5b1cba){if(_0x5b1cba[_0x7995('0x6b')](_0x33479a)){if(_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]){var _0x59efff=_[_0x7995('0x6c')](_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]['replace'](/"/g,'\x27'));switch(_0x33479a){case'scheduledat':var _0x15e8d1=moment(_0x59efff,_0x7995('0xe'),!![]);if(_0x15e8d1[_0x7995('0x6d')]()){_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x6e'));}break;case'priority':var _0x2f8a2d=parseInt(_0x59efff);_0x59efff=_[_0x7995('0x6f')](_0x2f8a2d)||_0x2f8a2d<0x0||_0x2f8a2d>0x4?_0x54b955?0x3:0x2:_0x2f8a2d;_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');break;case _0x7995('0x70'):var _0x7d9c6e=parseInt(_0x59efff);if(_[_0x7995('0x71')](_0x7d9c6e)&&_[_0x7995('0x63')](_0x2c9eb6,_0x7d9c6e)){_0x251490[_0x7995('0x45')]('\x22'+_0x7d9c6e+'\x22');}else{_0x260ef1['push'](_0x7995('0x72'));}break;case _0x7995('0x73'):if(isEmail(_0x59efff)){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1['push'](_0x7995('0x74'));}break;case _0x7995('0x75'):var _0x18e1a2=moment(_0x59efff,_0x7995('0x76'),!![]);if(_0x18e1a2[_0x7995('0x6d')]()){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x77'));}break;case'dialTimezone':var _0x209977=shared[_0x7995('0x78')];var _0x489bac=_0x209977[_0x59efff];if(!_[_0x7995('0x59')](_0x489bac)){var _0x4a5bc5=_0x489bac[_0x7995('0x5a')];_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');_0x251490[_0x7995('0x45')]('\x22'+_0x4a5bc5+'\x22');}break;default:_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}}else{switch(_0x33479a){case _0x7995('0x79'):case'phone':_0x260ef1[_0x7995('0x45')](_0x33479a+_0x7995('0x7a'));break;default:_0x251490[_0x7995('0x45')]('\x22\x22');}}}}if(_0x260ef1['length']){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],{'code':_0x7995('0x7b'),'message':_0x260ef1[_0x7995('0x13')]()});}else{fs[_0x7995('0x7c')](_0x5d9d33,_0x251490['join']()+'\x0a');}_0x251490=[];}if(!(stats[_0x7995('0x6a')]%0xc8)){socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x7995('0x7f'));_0x3773de[_0x7995('0x80')]();}}catch(_0x4800a8){handleError(_0x36e3a7['data'][_0x6ad274],{'code':_0x7995('0x81'),'message':_0x4800a8[_0x7995('0x42')]});logger[_0x7995('0x41')](_0x7995('0x82'),_0x4800a8[_0x7995('0x42')]);}},'complete':function(){try{var _0x551b5e=[];var _0x56003d=[];var _0x393cb7='cm_contacts';if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x393cb7=_0x7995('0x84')+_0xea9aba;_0x551b5e['push'](_0x7995('0x85')+_0x393cb7+_0x7995('0x86'));}tmp_campaigns=_0x7995('0x87')+_0xea9aba;tmp_voice_queues=_0x7995('0x88')+_0xea9aba;_0x56003d[_0x7995('0x45')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x7995('0x89'));_0x56003d[_0x7995('0x45')](_0x7995('0x85')+tmp_voice_queues+_0x7995('0x89'));BPromise['each'](_0x56003d,handleTZQuery)[_0x7995('0x52')](function(_0x38064a){updateTzCampaigns(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x20683e){updateTzVoiceQueues(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x50efab){var _0x1b4b34=util['format'](_0x7995('0x8a'),_0x5d9d33,_0x393cb7,_0x18cff7,_0x3b45e8['ListId'],_0x3b45e8[_0x7995('0x8b')]||null,NOW,NOW);if(_[_0x7995('0x59')](_0x5b1cba['scheduledat'])){_0x1b4b34+=_0x7995('0x8c');}_0x551b5e['push'](_0x1b4b34);if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x551b5e[_0x7995('0x45')](insertCmContact(_0x3b45e8[_0x7995('0x38')],_0x393cb7,_0x3b45e8['duplicates'],_0x5b1cba));}if(hasTZ){_0x551b5e[_0x7995('0x45')](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'voice_queues_has_cm_lists','voice_queues',_0x7995('0x8d'),_0x54b955,tmp_voice_queues));_0x551b5e['push'](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],_0x7995('0x8e'),_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists',_0x7995('0x4d'),_0x7995('0x8f'),_0x54b955,tmp_campaigns));_0x551b5e[_0x7995('0x45')](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists','campaigns','CampaignId'));}else{_0x551b5e[_0x7995('0x45')](insertCmHopper(_0x3b45e8[_0x7995('0x38')],_0x7995('0x55'),_0x7995('0x54'),_0x7995('0x8d'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8['ListId'],'voice_queues_has_cm_blacklists',_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists','campaigns',_0x7995('0x8f'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists',_0x7995('0x4d'),_0x7995('0x8f')));}_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_campaigns+';');_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_voice_queues+';');BPromise[_0x7995('0x91')](_0x551b5e,handleQuery)[_0x7995('0x52')](function(_0x19d746){stats['finish']=!![];stats[_0x7995('0x92')]=_0x3b45e8[_0x7995('0x83')]&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]?results[0x2][_0x7995('0x92')]:results[0x0]['affectedRows'];socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);fs[_0x7995('0x93')](_0x4dbab8);fs['unlink'](_0x5d9d33);process['exit'](0x0);})['catch'](function(_0xb28dea){logger[_0x7995('0x41')](_0xb28dea[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);});})[_0x7995('0x4a')](function(_0x3ad47c){logger['error'](_0x3ad47c[_0x7995('0x42')]);process['exit'](0x1);});});});}catch(_0x40a151){logger[_0x7995('0x41')](_0x7995('0x94'),_0x40a151[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}},'error':function(_0x24ac44,_0x4f929b,_0x24a0e6,_0x245821){throw new Error(_0x245821);}});}function validate(){if(process[_0x7995('0x95')]&&process[_0x7995('0x95')]['length']<0x4){throw new Error(_0x7995('0x96'));}var _0x57f875=path[_0x7995('0x13')](config[_0x7995('0x97')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0x7995('0x98')](_0x57f875)){throw new Error(_0x7995('0x99'));}var _0x41e200={};try{_0x41e200=JSON[_0x7995('0x67')](process[_0x7995('0x95')][0x3]);if(!_0x41e200[_0x7995('0x60')]){throw new Error(_0x7995('0x9a'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x30')]){throw new Error(_0x7995('0x9b'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x79')]){throw new Error('firstName\x20is\x20mandatory');}var _0x5380e6=0x0;if(_0x41e200[_0x7995('0x60')][_0x7995('0x70')]){_0x5380e6=0x1;}if(!_0x41e200[_0x7995('0x38')]){throw new Error(_0x7995('0x9c'));}}catch(_0x100bde){throw new Error('body\x20id\x20mandatory');}var _0xe8c08e=[];try{_0xe8c08e=_[_0x7995('0x9d')](JSON['parse'](process[_0x7995('0x95')][0x4]),'id');}catch(_0x53d693){logger[_0x7995('0x3f')](_0x7995('0x9e'));}main(_0x57f875,_0x41e200,_0xe8c08e,_0x5380e6);}validate();process['on'](_0x7995('0x9f'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x9957=['socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','cm_hopper_black','phone','fields','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','scheduledat','ListId','createdAt','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','then','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','stringify','start','binding','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','DROP\x20TABLE\x20','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults'];(function(_0x1c8719,_0x28f91c){var _0x2b0d7d=function(_0x42127b){while(--_0x42127b){_0x1c8719['push'](_0x1c8719['shift']());}};_0x2b0d7d(++_0x28f91c);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var fs=require('fs');var path=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var Papa=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var BPromise=require('bluebird');var moment=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var Redis=require(_0x7995('0x6'));var db=require(_0x7995('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x7995('0x8'));var logger=require(_0x7995('0x9'))(_0x7995('0xa'));config[_0x7995('0xb')]=_[_0x7995('0xc')](config[_0x7995('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7995('0xd'))(new Redis(config[_0x7995('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x7995('0xe'));function isEmail(_0x3116fb){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x7995('0xf')](_0x3116fb);}function selectNotIn(_0x35b5fe,_0x3c1d19,_0x1e400a,_0x341672,_0x524f7b){return squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')[_0x7995('0x12')](_0x341672)[_0x7995('0x13')](_0x3c1d19,null,_0x3c1d19+_0x7995('0x14')+_0x341672+'.'+_0x1e400a)[_0x7995('0x15')](_0x341672+'.'+_0x1e400a+_0x7995('0x16')+_0x35b5fe+'.'+_0x1e400a)[_0x7995('0x15')](_0x3c1d19+_0x7995('0x17')+_0x524f7b['join']()+')');}function insertCmHopper(_0x58f5ad,_0x2b4e94,_0x2233dd,_0x24b5bb,_0x321ae8){var _0x3f1d3e=[_0x7995('0x18'),_0x7995('0x19'),_0x7995('0x1a'),'cm_contacts.ListId',_0x2b4e94+'.'+_0x24b5bb,_0x7995('0x1b'),'cm_contacts.updatedAt',_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x321ae8+'\x22'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone','scheduledat',_0x7995('0x22'),'ListId',_0x24b5bb,'createdAt',_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel['select']()['fields'](_0x3f1d3e)[_0x7995('0x12')](_0x2b4e94)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x2b4e94+_0x7995('0x28'))[_0x7995('0x13')](_0x2233dd,null,_0x2233dd+'.id\x20=\x20'+_0x2b4e94+'.'+_0x24b5bb)[_0x7995('0x15')](_0x2b4e94+_0x7995('0x29'),_0x58f5ad)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c')])))[_0x7995('0x2d')]();}function insertCmHopperBlack(_0x2a307e,_0x56691a,_0x47625f,_0x5911c3){var _0x229742=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x56691a+'.'+_0x5911c3,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()['into'](_0x7995('0x2f'))[_0x7995('0x21')]([_0x7995('0x30'),'ContactId','ListId',_0x5911c3,'createdAt',_0x7995('0x23')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x229742)[_0x7995('0x12')](_0x56691a)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x56691a+'.CmListId')[_0x7995('0x13')](_0x47625f,null,_0x47625f+'.id\x20=\x20'+_0x56691a+'.'+_0x5911c3)[_0x7995('0x15')](_0x56691a+_0x7995('0x29'),_0x2a307e)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')['from']('cm_hopper_black')[_0x7995('0x15')](_0x7995('0x32'),_0x2a307e)['where'](_0x5911c3+_0x7995('0x33'),_0x56691a+'.'+_0x5911c3)))['toString']();}function insertTzCmHopper(_0x37917b,_0x1cb058,_0x177cb4,_0x5014d2,_0x52d76d,_0x36d057){var _0x5e67fe=['cm_contacts.phone',_0x7995('0x34')+_0x36d057+_0x7995('0x35'),'cm_contacts.id',_0x7995('0x2e'),_0x1cb058+'.'+_0x5014d2,_0x7995('0x1b'),_0x7995('0x36'),_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x52d76d+'\x22'];var _0x53002a=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone',_0x7995('0x37'),_0x7995('0x22'),_0x7995('0x38'),_0x5014d2,_0x7995('0x39'),_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x5e67fe)[_0x7995('0x12')](_0x1cb058)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x1cb058+_0x7995('0x28'))[_0x7995('0x13')](_0x177cb4,null,_0x177cb4+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x13')](_0x36d057,null,_0x36d057+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x15')](_0x1cb058+'.CmListId\x20=\x20?',_0x37917b)['where'](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,'cm_hopper',[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))['where'](_0x7995('0x2b'),selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,_0x7995('0x20'),[_0x7995('0x2c')])))['toString']();return _0x53002a;}function insertTzCmHopperBlack(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881){var _0x493066=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x5e85b9+'.'+_0x5a8881,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x2f'))[_0x7995('0x21')](['phone','ContactId',_0x7995('0x38'),_0x5a8881,'createdAt',_0x7995('0x23')],squel['select']()[_0x7995('0x31')](_0x493066)['from'](_0x5e85b9)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x5e85b9+_0x7995('0x28'))[_0x7995('0x13')](_0x3993b5,null,_0x3993b5+_0x7995('0x14')+_0x5e85b9+'.'+_0x5a8881)[_0x7995('0x15')](_0x5e85b9+'.CmListId\x20=\x20?',_0x46ac4f)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')](_0x7995('0x30'))[_0x7995('0x12')](_0x7995('0x2f'))['where'](_0x7995('0x32'),_0x46ac4f)[_0x7995('0x15')](_0x5a8881+'\x20=\x20?',_0x5e85b9+'.'+_0x5a8881)))[_0x7995('0x2d')]();}function insertCmContact(_0x5843ba,_0x1d87f9,_0x187735,_0x1afab4){var _0x30e220=_[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x1afab4),[_0x7995('0x38'),'CompanyId',_0x7995('0x39'),_0x7995('0x23')]);return squel[_0x7995('0x1e')]()['into'](_0x7995('0x26'))[_0x7995('0x21')](_0x30e220,squel[_0x7995('0x10')]()['fields'](_0x30e220)['from'](_0x1d87f9)['where']('('+_0x187735[_0x7995('0x13')](',')+_0x7995('0x3c'),squel['select']()[_0x7995('0x31')](_0x187735)[_0x7995('0x12')](_0x7995('0x26'))[_0x7995('0x15')](_0x7995('0x32'),_0x5843ba)['where'](_0x7995('0x3d')))['where'](_0x7995('0x3e'),squel[_0x7995('0x10')]()[_0x7995('0x11')]('MIN(id)','min_id')['from'](_0x1d87f9)['group'](_0x187735[_0x7995('0x13')](','))))[_0x7995('0x2d')]();}function handleStop(){logger[_0x7995('0x3f')](_0x7995('0x40'));stopped=!![];}function handleUncaughtException(_0x1d957e){logger[_0x7995('0x41')](_0x1d957e[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}function handleError(_0x328671,_0x17ecd3){stats[_0x7995('0x44')][_0x7995('0x45')]({'name':_0x17ecd3[_0x7995('0x46')],'message':_0x17ecd3[_0x7995('0x42')],'row':_0x328671});}function handleQuery(_0x1ea1dc){logger[_0x7995('0x3f')](_0x1ea1dc);return db[_0x7995('0x47')][_0x7995('0x48')](_0x1ea1dc)[_0x7995('0x49')](function(_0x50b7c2){results[_0x7995('0x45')](_0x50b7c2);})[_0x7995('0x4a')](function(_0x3b8a54){logger[_0x7995('0x41')](_0x3b8a54['message']);});}function updateTzCampaigns(_0x53125a){return new Promise(function(_0x402fa0,_0x197b52){var _0x5b9467=squel[_0x7995('0x10')]()['fields']([_0x7995('0x4b'),_0x7995('0x4c')])[_0x7995('0x12')](_0x7995('0x4d'))['join']('campaigns_has_cm_lists',null,_0x7995('0x4e'))[_0x7995('0x15')](_0x7995('0x4f')+_0x53125a);db[_0x7995('0x47')][_0x7995('0x48')](_0x5b9467[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x1e2206){var _0x984c23=[];for(var _0x50caf5=0x0;_0x50caf5<_0x1e2206[_0x7995('0x50')];_0x50caf5++){_0x984c23[_0x7995('0x45')](getTimezoneData(_0x1e2206[_0x50caf5],tmp_campaigns));}BPromise[_0x7995('0x51')](_0x984c23)[_0x7995('0x52')](function(){_0x402fa0({'val':0x1});});})['catch'](function(_0x51bf6a){logger[_0x7995('0x41')](_0x51bf6a[_0x7995('0x42')]);_0x402fa0({'val':0x0});});});}function updateTzVoiceQueues(_0x47d5d7){return new Promise(function(_0x971a23,_0x375fc9){var _0x2e3421=squel[_0x7995('0x10')]()[_0x7995('0x31')](['voice_queues.id',_0x7995('0x53')])['from'](_0x7995('0x54'))[_0x7995('0x13')](_0x7995('0x55'),null,_0x7995('0x56'))[_0x7995('0x15')](_0x7995('0x57')+_0x47d5d7);db[_0x7995('0x47')][_0x7995('0x48')](_0x2e3421[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x2618c4){var _0x234d8d=[];for(var _0x56eb85=0x0;_0x56eb85<_0x2618c4[_0x7995('0x50')];_0x56eb85++){_0x234d8d[_0x7995('0x45')](getTimezoneData(_0x2618c4[_0x56eb85],tmp_voice_queues));}BPromise[_0x7995('0x51')](_0x234d8d)[_0x7995('0x52')](function(){_0x971a23({'val':0x1});});})[_0x7995('0x4a')](function(_0x54a2e0){logger['error'](_0x54a2e0[_0x7995('0x42')]);_0x971a23({'val':0x0});});});}function getTimezoneData(_0x87e38d,_0x221542){return new Promise(function(_0xae6166,_0x5aa2ec){var _0x22d317=shared['timezones'];var _0x5df621=_0x22d317[_0x87e38d[_0x7995('0x58')]];if(_[_0x7995('0x59')](_0x5df621)){_0xae6166({'ret':0x1});}else{var _0x3f0a71=_0x5df621[_0x7995('0x5a')];var _0x290eae=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x221542)[_0x7995('0x5b')]('id',_0x87e38d['id'])[_0x7995('0x5b')](_0x7995('0x5c'),_0x3f0a71)['set'](_0x7995('0x58'),_0x87e38d[_0x7995('0x58')])[_0x7995('0x2d')]();return db['sequelize'][_0x7995('0x48')](_0x290eae)[_0x7995('0x49')](function(_0x705f0){_0xae6166({'ret':0x1});})[_0x7995('0x4a')](function(_0x3b0d30){logger[_0x7995('0x41')](_0x3b0d30[_0x7995('0x42')]);_0x5aa2ec({'ret':0x1});});}});}function handleTZQuery(_0x3adfd2){logger[_0x7995('0x3f')](_0x3adfd2);return db[_0x7995('0x47')][_0x7995('0x48')](_0x3adfd2)['spread'](function(_0x5e8b4c){})[_0x7995('0x4a')](function(_0xfe1105){logger[_0x7995('0x41')](_0xfe1105[_0x7995('0x42')]);});}function main(_0x4dbab8,_0x3b45e8,_0x2c9eb6,_0x54b955){logger['info'](_0x7995('0x5d'),_0x4dbab8,JSON[_0x7995('0x5e')](_0x3b45e8));process['send'](_0x7995('0x5f'));var _0x5b1cba=_0x3b45e8[_0x7995('0x60')];var _0xea9aba=_0x3b45e8['socket_timestamp'];var _0x5d9d33=path[_0x7995('0x13')](config['root'],_0x7995('0x61'),_0xea9aba+_0x7995('0x62'));hasTZ=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x63')](_0x7995('0x58'));var _0x18cff7=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x13')]();logger[_0x7995('0x3f')](_0x7995('0x64'),_0x18cff7);if(hasTZ)_0x18cff7+=_0x7995('0x65');fs[_0x7995('0x66')](_0x5d9d33,_0x18cff7+'\x0a');Papa[_0x7995('0x67')](fs[_0x7995('0x68')](_0x4dbab8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x36e3a7,_0x3773de){try{for(var _0x6ad274=0x0,_0x251490=[];_0x6ad274<_0x36e3a7[_0x7995('0x69')][_0x7995('0x50')];_0x6ad274++){stats[_0x7995('0x6a')]+=0x1;if(_0x36e3a7[_0x7995('0x44')][_0x6ad274]){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],_0x36e3a7[_0x7995('0x44')][_0x6ad274]);}else{var _0x260ef1=[];for(var _0x33479a in _0x5b1cba){if(_0x5b1cba[_0x7995('0x6b')](_0x33479a)){if(_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]){var _0x59efff=_[_0x7995('0x6c')](_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]['replace'](/"/g,'\x27'));switch(_0x33479a){case'scheduledat':var _0x15e8d1=moment(_0x59efff,_0x7995('0xe'),!![]);if(_0x15e8d1[_0x7995('0x6d')]()){_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x6e'));}break;case'priority':var _0x2f8a2d=parseInt(_0x59efff);_0x59efff=_[_0x7995('0x6f')](_0x2f8a2d)||_0x2f8a2d<0x0||_0x2f8a2d>0x4?_0x54b955?0x3:0x2:_0x2f8a2d;_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');break;case _0x7995('0x70'):var _0x7d9c6e=parseInt(_0x59efff);if(_[_0x7995('0x71')](_0x7d9c6e)&&_[_0x7995('0x63')](_0x2c9eb6,_0x7d9c6e)){_0x251490[_0x7995('0x45')]('\x22'+_0x7d9c6e+'\x22');}else{_0x260ef1['push'](_0x7995('0x72'));}break;case _0x7995('0x73'):if(isEmail(_0x59efff)){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1['push'](_0x7995('0x74'));}break;case _0x7995('0x75'):var _0x18e1a2=moment(_0x59efff,_0x7995('0x76'),!![]);if(_0x18e1a2[_0x7995('0x6d')]()){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x77'));}break;case'dialTimezone':var _0x209977=shared[_0x7995('0x78')];var _0x489bac=_0x209977[_0x59efff];if(!_[_0x7995('0x59')](_0x489bac)){var _0x4a5bc5=_0x489bac[_0x7995('0x5a')];_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');_0x251490[_0x7995('0x45')]('\x22'+_0x4a5bc5+'\x22');}break;default:_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}}else{switch(_0x33479a){case _0x7995('0x79'):case'phone':_0x260ef1[_0x7995('0x45')](_0x33479a+_0x7995('0x7a'));break;default:_0x251490[_0x7995('0x45')]('\x22\x22');}}}}if(_0x260ef1['length']){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],{'code':_0x7995('0x7b'),'message':_0x260ef1[_0x7995('0x13')]()});}else{fs[_0x7995('0x7c')](_0x5d9d33,_0x251490['join']()+'\x0a');}_0x251490=[];}if(!(stats[_0x7995('0x6a')]%0xc8)){socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x7995('0x7f'));_0x3773de[_0x7995('0x80')]();}}catch(_0x4800a8){handleError(_0x36e3a7['data'][_0x6ad274],{'code':_0x7995('0x81'),'message':_0x4800a8[_0x7995('0x42')]});logger[_0x7995('0x41')](_0x7995('0x82'),_0x4800a8[_0x7995('0x42')]);}},'complete':function(){try{var _0x551b5e=[];var _0x56003d=[];var _0x393cb7='cm_contacts';if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x393cb7=_0x7995('0x84')+_0xea9aba;_0x551b5e['push'](_0x7995('0x85')+_0x393cb7+_0x7995('0x86'));}tmp_campaigns=_0x7995('0x87')+_0xea9aba;tmp_voice_queues=_0x7995('0x88')+_0xea9aba;_0x56003d[_0x7995('0x45')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x7995('0x89'));_0x56003d[_0x7995('0x45')](_0x7995('0x85')+tmp_voice_queues+_0x7995('0x89'));BPromise['each'](_0x56003d,handleTZQuery)[_0x7995('0x52')](function(_0x38064a){updateTzCampaigns(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x20683e){updateTzVoiceQueues(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x50efab){var _0x1b4b34=util['format'](_0x7995('0x8a'),_0x5d9d33,_0x393cb7,_0x18cff7,_0x3b45e8['ListId'],_0x3b45e8[_0x7995('0x8b')]||null,NOW,NOW);if(_[_0x7995('0x59')](_0x5b1cba['scheduledat'])){_0x1b4b34+=_0x7995('0x8c');}_0x551b5e['push'](_0x1b4b34);if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x551b5e[_0x7995('0x45')](insertCmContact(_0x3b45e8[_0x7995('0x38')],_0x393cb7,_0x3b45e8['duplicates'],_0x5b1cba));}if(hasTZ){_0x551b5e[_0x7995('0x45')](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'voice_queues_has_cm_lists','voice_queues',_0x7995('0x8d'),_0x54b955,tmp_voice_queues));_0x551b5e['push'](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],_0x7995('0x8e'),_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists',_0x7995('0x4d'),_0x7995('0x8f'),_0x54b955,tmp_campaigns));_0x551b5e[_0x7995('0x45')](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists','campaigns','CampaignId'));}else{_0x551b5e[_0x7995('0x45')](insertCmHopper(_0x3b45e8[_0x7995('0x38')],_0x7995('0x55'),_0x7995('0x54'),_0x7995('0x8d'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8['ListId'],'voice_queues_has_cm_blacklists',_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists','campaigns',_0x7995('0x8f'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists',_0x7995('0x4d'),_0x7995('0x8f')));}_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_campaigns+';');_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_voice_queues+';');BPromise[_0x7995('0x91')](_0x551b5e,handleQuery)[_0x7995('0x52')](function(_0x19d746){stats['finish']=!![];stats[_0x7995('0x92')]=_0x3b45e8[_0x7995('0x83')]&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]?results[0x2][_0x7995('0x92')]:results[0x0]['affectedRows'];socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);fs[_0x7995('0x93')](_0x4dbab8);fs['unlink'](_0x5d9d33);process['exit'](0x0);})['catch'](function(_0xb28dea){logger[_0x7995('0x41')](_0xb28dea[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);});})[_0x7995('0x4a')](function(_0x3ad47c){logger['error'](_0x3ad47c[_0x7995('0x42')]);process['exit'](0x1);});});});}catch(_0x40a151){logger[_0x7995('0x41')](_0x7995('0x94'),_0x40a151[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}},'error':function(_0x24ac44,_0x4f929b,_0x24a0e6,_0x245821){throw new Error(_0x245821);}});}function validate(){if(process[_0x7995('0x95')]&&process[_0x7995('0x95')]['length']<0x4){throw new Error(_0x7995('0x96'));}var _0x57f875=path[_0x7995('0x13')](config[_0x7995('0x97')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0x7995('0x98')](_0x57f875)){throw new Error(_0x7995('0x99'));}var _0x41e200={};try{_0x41e200=JSON[_0x7995('0x67')](process[_0x7995('0x95')][0x3]);if(!_0x41e200[_0x7995('0x60')]){throw new Error(_0x7995('0x9a'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x30')]){throw new Error(_0x7995('0x9b'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x79')]){throw new Error('firstName\x20is\x20mandatory');}var _0x5380e6=0x0;if(_0x41e200[_0x7995('0x60')][_0x7995('0x70')]){_0x5380e6=0x1;}if(!_0x41e200[_0x7995('0x38')]){throw new Error(_0x7995('0x9c'));}}catch(_0x100bde){throw new Error('body\x20id\x20mandatory');}var _0xe8c08e=[];try{_0xe8c08e=_[_0x7995('0x9d')](JSON['parse'](process[_0x7995('0x95')][0x4]),'id');}catch(_0x53d693){logger[_0x7995('0x3f')](_0x7995('0x9e'));}main(_0x57f875,_0x41e200,_0xe8c08e,_0x5380e6);}validate();process['on'](_0x7995('0x9f'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js
index 676eda6..9e3a11a 100644
--- a/server/components/import/cm/csvUpdates.js
+++ b/server/components/import/cm/csvUpdates.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x54d2=['.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.updatedAt','insert','cm_hopper_black','ListId','field','ListId\x20=\x20?','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','errors','code','sequelize','catch','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','writeFileSync','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','exit','argv','arguments\x20\x20\x20','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','test','select','phone','from','.id\x20=\x20','where','join','query','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','all','then','error','message','split','length','filter','findOne','update','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId'];(function(_0x332878,_0x2f2658){var _0x26953b=function(_0x198011){while(--_0x198011){_0x332878['push'](_0x332878['shift']());}};_0x26953b(++_0x2f2658);}(_0x54d2,0x1a2));var _0x254d=function(_0x57010f,_0x11304b){_0x57010f=_0x57010f-0x0;var _0x7c532c=_0x54d2[_0x57010f];return _0x7c532c;};'use strict';var fs=require('fs');var path=require(_0x254d('0x0'));var _=require(_0x254d('0x1'));var Papa=require(_0x254d('0x2'));var util=require(_0x254d('0x3'));var BPromise=require(_0x254d('0x4'));var moment=require(_0x254d('0x5'));var squel=require(_0x254d('0x6'));var Redis=require(_0x254d('0x7'));var db=require(_0x254d('0x8'))['db'];var config=require(_0x254d('0x9'));var logger=require('../../../config/logger')(_0x254d('0xa'));config[_0x254d('0xb')]=_[_0x254d('0xc')](config[_0x254d('0xb')],{'host':_0x254d('0xd'),'port':0x18eb});var socket=require(_0x254d('0xe'))(new Redis(config[_0x254d('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x254d('0xf')](_0x254d('0x10'));var tempTableName='cm_contacts_temp_'+moment()[_0x254d('0xf')](_0x254d('0x11'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x545cfe){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x254d('0x12')](_0x545cfe);}function selectNotIn(_0x4e651c,_0x5870c1,_0x2c1432,_0x37dbdd,_0x46e2a4){return squel[_0x254d('0x13')]()['field'](_0x254d('0x14'))[_0x254d('0x15')](_0x37dbdd)['join'](_0x5870c1,null,_0x5870c1+_0x254d('0x16')+_0x37dbdd+'.'+_0x2c1432)[_0x254d('0x17')](_0x37dbdd+'.'+_0x2c1432+'\x20=\x20'+_0x4e651c+'.'+_0x2c1432)[_0x254d('0x17')](_0x5870c1+'.dialCheckDuplicateType\x20IN\x20('+_0x46e2a4[_0x254d('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x485e26,_0xeb5b19){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x254d('0x19')](_0x254d('0x1a')+tempTableName)[_0x254d('0x1b')](function(_0x2350e6){if(_0x2350e6!==null){var _0x1d6abd=[];for(var _0x2d9b46=0x0;_0x2d9b46<_0x2350e6['length'];_0x2d9b46++){var _0x17151e=_0x2350e6[_0x2d9b46];if(!_[_0x254d('0x1c')](_0x17151e[_0x254d('0x14')])){if(!_[_0x254d('0x1c')](_0x17151e[_0x254d('0x1d')]))_0x1d6abd[_0x254d('0x1e')](insertAdditionalPhones(_0x17151e));promisesContact['push']({'contact':_0x17151e});}}}Promise[_0x254d('0x1f')](_0x1d6abd)[_0x254d('0x20')](function(){_0x485e26({'val':0x1});});})['catch'](function(_0x49d723){logger[_0x254d('0x21')](_0x49d723[_0x254d('0x22')]);});});}function insertAdditionalPhones(_0x107b87){return new Promise(function(_0x518f15,_0x3c2049){var _0x87cbd9=_0x107b87[_0x254d('0x1d')];if(_[_0x254d('0x1c')](_0x87cbd9))_0x3c2049({'val':0x0});else{var _0x570e01=_0x87cbd9[_0x254d('0x23')](';');var _0x3370e2=[];orderBy=0x0;for(var _0x4d30a6=0x0;_0x4d30a6<_0x570e01[_0x254d('0x24')];_0x4d30a6++){_0x3370e2['push'](splitAdditionalPhone(_0x107b87['id'],_0x570e01[_0x4d30a6]));}Promise['all'](_0x3370e2)[_0x254d('0x20')](function(){_0x518f15({'val':_0x570e01[_0x254d('0x24')]});});}});}function splitAdditionalPhone(_0x16e660,_0x487c37){return new Promise(function(_0x1f42ca,_0x42c6c6){var _0xec869f=_0x487c37['split'](':');var _0x19748e=_0xec869f[0x0];var _0x32a5c5=_0xec869f[0x1];if(_0x32a5c5!==''){var _0x43314d=_0x32a5c5[_0x254d('0x23')]('|');var _0x5ac917=[];for(var _0x4d386d=0x0;_0x4d386d<_0x43314d['length'];_0x4d386d++){if(_0x43314d[_0x4d386d]!==''){var _0x18e2ae=_[_0x254d('0x25')](promisesAdditionalPhones,{'contactId':_0x16e660,'phone':_0x43314d[_0x4d386d]});if(_0x18e2ae['length']==0x0){orderBy++;promisesAdditionalPhones[_0x254d('0x1e')]({'contactId':_0x16e660,'contactTypeId':_0x19748e,'phone':_0x43314d[_0x4d386d],'orderBy':orderBy});}}}_0x1f42ca({'ok':0x1});}else _0x1f42ca({'res':0x0});});}function createAdditionalPhone(_0x4cfc33,_0x2fa104,_0x4fc822,_0x4ce0fc){return new Promise(function(_0x11b47b,_0x307bbb){return db['CmContactHasItem'][_0x254d('0x26')]({'where':{'CmContactId':_0x4cfc33,'item':_0x4fc822}})[_0x254d('0x20')](function(_0x197c7b){if(_0x197c7b){return db['CmContactHasItem'][_0x254d('0x27')]({'ItemTypeId':_0x2fa104,'OrderBy':_0x4ce0fc},{'where':{'CmContactId':_0x4cfc33,'item':_0x4fc822}})[_0x254d('0x20')](function(_0xf1f285){_0x11b47b({'res':'updated'});});}else{return db['CmContactHasItem'][_0x254d('0x28')]({'CmContactId':_0x4cfc33,'item':_0x4fc822,'ItemTypeId':_0x2fa104,'OrderBy':_0x4ce0fc,'ItemClass':_0x254d('0x29')})[_0x254d('0x20')](function(_0x1c7293){_0x11b47b({'res':_0x254d('0x2a')});});}});});}function updateContact(_0x44eba9){return new Promise(function(_0x39fba1,_0x2760b1){var _0x235b70=_0x44eba9['id'];delete _0x44eba9['id'];return db[_0x254d('0x2b')]['update'](_0x44eba9,{'where':{'id':_0x235b70}})[_0x254d('0x20')](function(_0x4fef57){updatedRows+=0x1;return db[_0x254d('0x2c')][_0x254d('0x27')]({'phone':_0x44eba9[_0x254d('0x14')]},{'where':{'ContactId':_0x235b70}})[_0x254d('0x20')](function(_0x360f07){_0x39fba1({'ret':'OK'});});});});}function insertCmHopper(_0x539612,_0x169e10,_0x47bd70,_0x119952,_0x3452d9){var _0x48520f=[_0x254d('0x2d'),_0x254d('0x2e'),_0x254d('0x2f'),_0x254d('0x30'),_0x169e10+'.'+_0x119952,_0x254d('0x31'),'cm_contacts.updatedAt',_0x254d('0x32'),'cm_contacts.UserId','\x22'+_0x3452d9+'\x22'];return squel['insert']()[_0x254d('0x33')](_0x254d('0x34'))[_0x254d('0x35')]([_0x254d('0x14'),_0x254d('0x36'),_0x254d('0x37'),'ListId',_0x119952,_0x254d('0x38'),_0x254d('0x39'),_0x254d('0x3a'),_0x254d('0x3b'),_0x254d('0x3c')],squel[_0x254d('0x13')]()[_0x254d('0x3d')](_0x48520f)[_0x254d('0x15')](_0x169e10)['join'](_0x254d('0x3e'),null,_0x254d('0x3f')+_0x169e10+_0x254d('0x40'))[_0x254d('0x18')](_0x47bd70,null,_0x47bd70+'.id\x20=\x20'+_0x169e10+'.'+_0x119952)[_0x254d('0x17')](_0x169e10+_0x254d('0x41'),_0x539612)[_0x254d('0x17')](_0x254d('0x42'),NOW)[_0x254d('0x17')](_0x254d('0x43'),selectNotIn(_0x169e10,_0x47bd70,_0x119952,'cm_hopper',[_0x254d('0x44'),'\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x169e10,_0x47bd70,_0x119952,'cm_hopper',[_0x254d('0x44')])))['toString']();}function insertCmHopperBlack(_0x36bdfa,_0x111778,_0x172cef,_0x461ac8){var _0x403e00=[_0x254d('0x2d'),_0x254d('0x2f'),'cm_contacts.ListId',_0x111778+'.'+_0x461ac8,_0x254d('0x31'),_0x254d('0x45')];return squel[_0x254d('0x46')]()[_0x254d('0x33')](_0x254d('0x47'))[_0x254d('0x35')](['phone','ContactId',_0x254d('0x48'),_0x461ac8,_0x254d('0x38'),_0x254d('0x39')],squel[_0x254d('0x13')]()[_0x254d('0x3d')](_0x403e00)[_0x254d('0x15')](_0x111778)[_0x254d('0x18')](_0x254d('0x3e'),null,_0x254d('0x3f')+_0x111778+_0x254d('0x40'))[_0x254d('0x18')](_0x172cef,null,_0x172cef+_0x254d('0x16')+_0x111778+'.'+_0x461ac8)['where'](_0x111778+_0x254d('0x41'),_0x36bdfa)[_0x254d('0x17')](_0x254d('0x42'),NOW)[_0x254d('0x17')](_0x254d('0x43'),squel[_0x254d('0x13')]()[_0x254d('0x49')](_0x254d('0x14'))['from'](_0x254d('0x47'))['where'](_0x254d('0x4a'),_0x36bdfa)[_0x254d('0x17')](_0x461ac8+_0x254d('0x4b'),_0x111778+'.'+_0x461ac8)))[_0x254d('0x4c')]();}function insertCmHopperAdditionalPhones(_0xb63533){var _0x4b2ee3=[_0x254d('0x4d'),_0x254d('0x4e'),_0x254d('0x4f'),_0x254d('0x50'),_0x254d('0x51')];return squel[_0x254d('0x46')]()[_0x254d('0x33')]('cm_hopper_additional_phones')[_0x254d('0x35')]([_0x254d('0x52'),_0x254d('0x14'),_0x254d('0x53'),_0x254d('0x38'),_0x254d('0x39')],squel[_0x254d('0x13')]()[_0x254d('0x3d')](_0x4b2ee3)[_0x254d('0x15')](_0x254d('0x34'))[_0x254d('0x18')](_0x254d('0x3e'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x254d('0x18')](_0x254d('0x54'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x254d('0x17')](_0x254d('0x55'),_0xb63533)[_0x254d('0x17')](_0x254d('0x42'),NOW))['toString']();}function insertCmContact(_0x192969,_0x4b04f8,_0x131a2c,_0xa53ff7){var _0x5de172=_[_0x254d('0x56')](_[_0x254d('0x57')](_0xa53ff7),[_0x254d('0x48'),_0x254d('0x58'),_0x254d('0x38'),_0x254d('0x39')]);return squel[_0x254d('0x46')]()['into'](_0x254d('0x3e'))[_0x254d('0x35')](_0x5de172,squel[_0x254d('0x13')]()['fields'](_0x5de172)[_0x254d('0x15')](_0x4b04f8)[_0x254d('0x17')]('('+_0x131a2c[_0x254d('0x18')](',')+_0x254d('0x59'),squel[_0x254d('0x13')]()['fields'](_0x131a2c)['from'](_0x254d('0x3e'))[_0x254d('0x17')](_0x254d('0x4a'),_0x192969))[_0x254d('0x17')](_0x254d('0x5a'),squel[_0x254d('0x13')]()['field'](_0x254d('0x5b'),_0x254d('0x5c'))[_0x254d('0x15')](_0x4b04f8)[_0x254d('0x5d')](_0x131a2c['join'](','))))[_0x254d('0x4c')]();}function handleStop(){logger[_0x254d('0x5e')](_0x254d('0x5f'));stopped=!![];}function handleUncaughtException(_0x376960){logger[_0x254d('0x21')](_0x376960[_0x254d('0x22')]);process['exit'](0x1);}function handleError(_0x5ea14e,_0x2ea473){stats[_0x254d('0x60')][_0x254d('0x1e')]({'name':_0x2ea473[_0x254d('0x61')],'message':_0x2ea473[_0x254d('0x22')],'row':_0x5ea14e});}function handleQuery(_0x565c8){logger[_0x254d('0x5e')](_0x565c8);return db[_0x254d('0x62')]['query'](_0x565c8)[_0x254d('0x1b')](function(_0x2a953e){results[_0x254d('0x1e')](_0x2a953e);})[_0x254d('0x63')](function(_0x32a22c){logger[_0x254d('0x21')](_0x32a22c[_0x254d('0x22')]);});}function main(_0x1fdab9,_0x48c3ba,_0x16b394,_0x1a2aa3){logger[_0x254d('0x5e')]('main',_0x1fdab9,JSON['stringify'](_0x48c3ba));process['send']('start');var _0x518187=_0x48c3ba[_0x254d('0x64')];var _0x3df448=_[_0x254d('0x65')](_0x518187);var _0x1cd85f=_0x48c3ba[_0x254d('0x66')];var _0x30ccc9=path[_0x254d('0x18')](config[_0x254d('0x67')],_0x254d('0x68'),_0x1cd85f+_0x254d('0x69'));logger[_0x254d('0x5e')](_0x254d('0x6a'),_0x48c3ba);db[_0x254d('0x6b')][_0x254d('0x6c')]({'raw':!![],'attributes':['id','name']})['then'](function(_0x1fdef1){for(var _0x4ea0a5=0x0;_0x4ea0a5<_0x1fdef1[_0x254d('0x24')];_0x4ea0a5++){if(_0x1fdef1[_0x4ea0a5]['name']in _0x518187){contactItemTypes[_0x254d('0x1e')](_0x1fdef1[_0x4ea0a5]);delete _0x3df448[_0x1fdef1[_0x4ea0a5][_0x254d('0x6d')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x3df448[_0x254d('0x1d')]='';var _0x512035=_[_0x254d('0x57')](_0x3df448)[_0x254d('0x18')]();logger[_0x254d('0x5e')]('header',_0x512035);fs[_0x254d('0x6e')](_0x30ccc9,_0x512035+'\x0a');Papa['parse'](fs[_0x254d('0x6f')](_0x1fdab9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4464cc,_0x1570f9){try{for(var _0x3960f5=0x0,_0x5a85ca=[];_0x3960f5<_0x4464cc[_0x254d('0x70')]['length'];_0x3960f5++){stats[_0x254d('0x71')]+=0x1;if(_0x4464cc[_0x254d('0x60')][_0x3960f5]){handleError(_0x4464cc[_0x254d('0x70')][_0x3960f5],_0x4464cc['errors'][_0x3960f5]);}else{var _0x5b6296=[];var _0x327f03=[];for(var _0x16689e in _0x518187){let _0x33e43c=contactItemTypes[_0x254d('0x72')](_0x8334d3=>_0x8334d3[_0x254d('0x6d')]===_0x16689e);if(_[_0x254d('0x1c')](_0x33e43c)){if(_0x518187[_0x254d('0x73')](_0x16689e)){if(_0x4464cc[_0x254d('0x70')][_0x3960f5][_0x518187[_0x16689e]]){var _0x379e40=_[_0x254d('0x74')](_0x4464cc[_0x254d('0x70')][_0x3960f5][_0x518187[_0x16689e]][_0x254d('0x75')](/"/g,'\x27'));switch(_0x16689e){case _0x254d('0x36'):var _0x3a35b4=moment(_0x379e40,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3a35b4['isValid']()){_0x5a85ca[_0x254d('0x1e')]('\x22'+_0x379e40+'\x22');}else{_0x5b6296[_0x254d('0x1e')](_0x254d('0x76'));}break;case _0x254d('0x3a'):var _0x1ab6f8=parseInt(_0x379e40);_0x379e40=_[_0x254d('0x77')](_0x1ab6f8)||_0x1ab6f8<0x0||_0x1ab6f8>0x4?_0x1a2aa3?0x3:0x2:_0x1ab6f8;_0x5a85ca['push']('\x22'+_0x379e40+'\x22');break;case _0x254d('0x3b'):var _0x226abe=parseInt(_0x379e40);if(_[_0x254d('0x78')](_0x226abe)&&_[_0x254d('0x79')](_0x16b394,_0x226abe)){_0x5a85ca[_0x254d('0x1e')]('\x22'+_0x226abe+'\x22');}else{_0x5b6296[_0x254d('0x1e')](_0x254d('0x7a'));}break;case _0x254d('0x7b'):if(isEmail(_0x379e40)){_0x5a85ca[_0x254d('0x1e')]('\x22'+_0x379e40+'\x22');}else{_0x5b6296[_0x254d('0x1e')](_0x254d('0x7c'));}break;case _0x254d('0x7d'):var _0x36445f=moment(_0x379e40,_0x254d('0x7e'),!![]);if(_0x36445f['isValid']()){_0x5a85ca['push']('\x22'+_0x379e40+'\x22');}else{_0x5b6296[_0x254d('0x1e')](_0x254d('0x7f'));}break;default:_0x5a85ca[_0x254d('0x1e')]('\x22'+_0x379e40+'\x22');}}else{switch(_0x16689e){case _0x254d('0x80'):case'phone':_0x5b6296['push'](_0x16689e+_0x254d('0x81'));break;default:_0x5a85ca['push']('\x22\x22');}}}}else{var _0x2bc3ec='';for(var _0xb4d48e=0x0;_0xb4d48e<_0x518187[_0x16689e][_0x254d('0x24')];_0xb4d48e++){var _0x379e40=_[_0x254d('0x74')](_0x4464cc[_0x254d('0x70')][_0x3960f5][_0x518187[_0x16689e][_0xb4d48e]]['replace'](/"/g,'\x27'));if(_0x2bc3ec=='')_0x2bc3ec=_0x379e40;else _0x2bc3ec+='|'+_0x379e40;}_0x327f03[_0x254d('0x1e')](_0x33e43c['id']+':'+_0x2bc3ec);}}if(hasAdditionalPhones){_0x5a85ca[_0x254d('0x1e')]('\x22'+_0x327f03['join'](';')+'\x22');}if(_0x5b6296[_0x254d('0x24')]){handleError(_0x4464cc[_0x254d('0x70')][_0x3960f5],{'code':_0x254d('0x82'),'message':_0x5b6296[_0x254d('0x18')]()});}else{fs[_0x254d('0x83')](_0x30ccc9,_0x5a85ca[_0x254d('0x18')]()+'\x0a');}_0x5a85ca=[];}if(!(stats[_0x254d('0x71')]%0xc8)){socket[_0x254d('0x84')](_0x254d('0x85')+_0x1cd85f,stats);stats[_0x254d('0x60')]=[];}}if(stopped){logger[_0x254d('0x5e')](_0x254d('0x86'));_0x1570f9[_0x254d('0x87')]();}}catch(_0x4e350a){handleError(_0x4464cc[_0x254d('0x70')][_0x3960f5],{'code':'SystemError','message':_0x4e350a['message']});logger[_0x254d('0x21')](_0x254d('0x88'),_0x4e350a[_0x254d('0x22')]);}},'complete':function(){try{var _0x2e8841=[];var _0x3168d6=tempTableName;_0x2e8841[_0x254d('0x1e')](_0x254d('0x89')+_0x3168d6+_0x254d('0x8a'));logger[_0x254d('0x5e')](_0x254d('0x8b'),contactItemTypes[_0x254d('0x24')]);var _0x35bc4c=util[_0x254d('0xf')](_0x254d('0x8c'),_0x30ccc9,_0x3168d6,_0x512035,_0x48c3ba[_0x254d('0x48')],_0x48c3ba[_0x254d('0x58')]||null,NOW,NOW);if(_[_0x254d('0x1c')](_0x518187[_0x254d('0x36')])){_0x35bc4c+=_0x254d('0x8d');}_0x2e8841[_0x254d('0x1e')](_0x35bc4c);BPromise[_0x254d('0x8e')](_0x2e8841,handleQuery)[_0x254d('0x20')](function(_0x4e8548){BPromise[_0x254d('0x1f')]([handleAdditionalPhones()])[_0x254d('0x20')](function(){_0x2e8841=[];for(var _0x1f725f=0x0;_0x1f725f\x20\x20','existsSync','file\x20doesn\x27t\x20exists'];(function(_0xe3bb46,_0x4ba544){var _0x45001c=function(_0x28afa0){while(--_0x28afa0){_0xe3bb46['push'](_0xe3bb46['shift']());}};_0x45001c(++_0x4ba544);}(_0xa561,0x1cd));var _0x1a56=function(_0x50c53a,_0x107d3e){_0x50c53a=_0x50c53a-0x0;var _0x361af5=_0xa561[_0x50c53a];return _0x361af5;};'use strict';var fs=require('fs');var path=require(_0x1a56('0x0'));var _=require(_0x1a56('0x1'));var Papa=require(_0x1a56('0x2'));var util=require('util');var BPromise=require(_0x1a56('0x3'));var moment=require('moment');var squel=require(_0x1a56('0x4'));var Redis=require(_0x1a56('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x1a56('0x6'));var logger=require(_0x1a56('0x7'))('import');config[_0x1a56('0x8')]=_['defaults'](config[_0x1a56('0x8')],{'host':_0x1a56('0x9'),'port':0x18eb});var socket=require(_0x1a56('0xa'))(new Redis(config[_0x1a56('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x1a56('0xb')](_0x1a56('0xc'));var tempTableName=_0x1a56('0xd')+moment()[_0x1a56('0xb')](_0x1a56('0xe'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x1f36a8){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x1a56('0xf')](_0x1f36a8);}function selectNotIn(_0x34bd25,_0x38efa8,_0x49857b,_0x24c373,_0xff3b7d){return squel[_0x1a56('0x10')]()[_0x1a56('0x11')]('phone')[_0x1a56('0x12')](_0x24c373)[_0x1a56('0x13')](_0x38efa8,null,_0x38efa8+_0x1a56('0x14')+_0x24c373+'.'+_0x49857b)[_0x1a56('0x15')](_0x24c373+'.'+_0x49857b+'\x20=\x20'+_0x34bd25+'.'+_0x49857b)[_0x1a56('0x15')](_0x38efa8+_0x1a56('0x16')+_0xff3b7d['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2c003a,_0x2612f2){promisesAdditionalPhones=[];promisesContact=[];return db[_0x1a56('0x17')]['query'](_0x1a56('0x18')+tempTableName)[_0x1a56('0x19')](function(_0x23c2ff){if(_0x23c2ff!==null){var _0x5045df=[];for(var _0x4661f8=0x0;_0x4661f8<_0x23c2ff[_0x1a56('0x1a')];_0x4661f8++){var _0x541bb1=_0x23c2ff[_0x4661f8];if(!_[_0x1a56('0x1b')](_0x541bb1['phone'])){if(!_[_0x1a56('0x1b')](_0x541bb1[_0x1a56('0x1c')]))_0x5045df['push'](insertAdditionalPhones(_0x541bb1));promisesContact[_0x1a56('0x1d')]({'contact':_0x541bb1});}}}Promise['all'](_0x5045df)[_0x1a56('0x1e')](function(){_0x2c003a({'val':0x1});});})[_0x1a56('0x1f')](function(_0x367c82){logger['error'](_0x367c82[_0x1a56('0x20')]);});});}function insertAdditionalPhones(_0x1ba075){return new Promise(function(_0x490b42,_0x56fe22){var _0x44b514=_0x1ba075['AdditionalPhones'];if(_[_0x1a56('0x1b')](_0x44b514))_0x56fe22({'val':0x0});else{var _0x532beb=_0x44b514['split'](';');var _0x54313e=[];orderBy=0x0;for(var _0x525637=0x0;_0x525637<_0x532beb['length'];_0x525637++){_0x54313e[_0x1a56('0x1d')](splitAdditionalPhone(_0x1ba075['id'],_0x532beb[_0x525637]));}Promise[_0x1a56('0x21')](_0x54313e)[_0x1a56('0x1e')](function(){_0x490b42({'val':_0x532beb[_0x1a56('0x1a')]});});}});}function splitAdditionalPhone(_0x2a93f7,_0x39339e){return new Promise(function(_0x5b96db,_0x257f31){var _0x2ca54d=_0x39339e['split'](':');var _0x3b2d31=_0x2ca54d[0x0];var _0x284b1a=_0x2ca54d[0x1];if(_0x284b1a!==''){var _0x5311c3=_0x284b1a[_0x1a56('0x22')]('|');var _0x28c70e=[];for(var _0x8cfa11=0x0;_0x8cfa11<_0x5311c3['length'];_0x8cfa11++){if(_0x5311c3[_0x8cfa11]!==''){var _0x2c7108=_[_0x1a56('0x23')](promisesAdditionalPhones,{'contactId':_0x2a93f7,'phone':_0x5311c3[_0x8cfa11]});if(_0x2c7108[_0x1a56('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x1a56('0x1d')]({'contactId':_0x2a93f7,'contactTypeId':_0x3b2d31,'phone':_0x5311c3[_0x8cfa11],'orderBy':orderBy});}}}_0x5b96db({'ok':0x1});}else _0x5b96db({'res':0x0});});}function createAdditionalPhone(_0x5b7bf3,_0x2752bd,_0x526c9f,_0x56b206){return new Promise(function(_0x526227,_0x2fb79c){return db['CmContactHasItem'][_0x1a56('0x24')]({'where':{'CmContactId':_0x5b7bf3,'item':_0x526c9f}})['then'](function(_0x1f28ac){if(_0x1f28ac){return db[_0x1a56('0x25')]['update']({'ItemTypeId':_0x2752bd,'OrderBy':_0x56b206},{'where':{'CmContactId':_0x5b7bf3,'item':_0x526c9f}})[_0x1a56('0x1e')](function(_0xd5a1fb){_0x526227({'res':_0x1a56('0x26')});});}else{return db['CmContactHasItem'][_0x1a56('0x27')]({'CmContactId':_0x5b7bf3,'item':_0x526c9f,'ItemTypeId':_0x2752bd,'OrderBy':_0x56b206,'ItemClass':_0x1a56('0x28')})['then'](function(_0x5c7cc8){_0x526227({'res':_0x1a56('0x29')});});}});});}function updateContact(_0x4369af){return new Promise(function(_0x570ad0,_0x15c870){var _0x246307=_0x4369af['id'];delete _0x4369af['id'];return db[_0x1a56('0x2a')]['update'](_0x4369af,{'where':{'id':_0x246307}})[_0x1a56('0x1e')](function(_0x17aa6){updatedRows+=0x1;return db[_0x1a56('0x2b')]['update']({'phone':_0x4369af[_0x1a56('0x2c')]},{'where':{'ContactId':_0x246307}})['then'](function(_0x187107){_0x570ad0({'ret':'OK'});});});});}function insertCmHopper(_0x312639,_0x20efb4,_0x129c33,_0x3eb06c,_0x20752a){var _0x7022be=[_0x1a56('0x2d'),'cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x20efb4+'.'+_0x3eb06c,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x1a56('0x2e'),_0x1a56('0x2f'),'\x22'+_0x20752a+'\x22'];return squel['insert']()[_0x1a56('0x30')](_0x1a56('0x31'))['fromQuery'](['phone','scheduledat','ContactId','ListId',_0x3eb06c,'createdAt',_0x1a56('0x32'),_0x1a56('0x33'),_0x1a56('0x34'),'recallme'],squel[_0x1a56('0x10')]()['fields'](_0x7022be)[_0x1a56('0x12')](_0x20efb4)[_0x1a56('0x13')]('cm_contacts',null,_0x1a56('0x35')+_0x20efb4+_0x1a56('0x36'))[_0x1a56('0x13')](_0x129c33,null,_0x129c33+'.id\x20=\x20'+_0x20efb4+'.'+_0x3eb06c)[_0x1a56('0x15')](_0x20efb4+_0x1a56('0x37'),_0x312639)[_0x1a56('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x1a56('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x20efb4,_0x129c33,_0x3eb06c,_0x1a56('0x31'),['\x22always\x22',_0x1a56('0x38')]))['where'](_0x1a56('0x39'),selectNotIn(_0x20efb4,_0x129c33,_0x3eb06c,_0x1a56('0x31'),[_0x1a56('0x3a')])))['toString']();}function insertCmHopperBlack(_0x9784a3,_0x433ccf,_0x305db9,_0x276cd5){var _0x48b32f=[_0x1a56('0x2d'),'cm_contacts.id','cm_contacts.ListId',_0x433ccf+'.'+_0x276cd5,_0x1a56('0x3b'),_0x1a56('0x3c')];return squel[_0x1a56('0x3d')]()[_0x1a56('0x30')](_0x1a56('0x3e'))[_0x1a56('0x3f')](['phone',_0x1a56('0x40'),_0x1a56('0x41'),_0x276cd5,_0x1a56('0x42'),'updatedAt'],squel[_0x1a56('0x10')]()[_0x1a56('0x43')](_0x48b32f)[_0x1a56('0x12')](_0x433ccf)[_0x1a56('0x13')](_0x1a56('0x44'),null,_0x1a56('0x35')+_0x433ccf+_0x1a56('0x36'))[_0x1a56('0x13')](_0x305db9,null,_0x305db9+_0x1a56('0x14')+_0x433ccf+'.'+_0x276cd5)['where'](_0x433ccf+_0x1a56('0x37'),_0x9784a3)[_0x1a56('0x15')](_0x1a56('0x45'),NOW)['where'](_0x1a56('0x39'),squel[_0x1a56('0x10')]()['field'](_0x1a56('0x2c'))[_0x1a56('0x12')]('cm_hopper_black')[_0x1a56('0x15')]('ListId\x20=\x20?',_0x9784a3)[_0x1a56('0x15')](_0x276cd5+_0x1a56('0x46'),_0x433ccf+'.'+_0x276cd5)))[_0x1a56('0x47')]();}function insertCmHopperAdditionalPhones(_0x17d093){var _0x6184e=[_0x1a56('0x48'),_0x1a56('0x49'),_0x1a56('0x4a'),'cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];return squel[_0x1a56('0x3d')]()[_0x1a56('0x30')](_0x1a56('0x4b'))[_0x1a56('0x3f')]([_0x1a56('0x4c'),'phone',_0x1a56('0x4d'),_0x1a56('0x42'),_0x1a56('0x32')],squel[_0x1a56('0x10')]()[_0x1a56('0x43')](_0x6184e)['from'](_0x1a56('0x31'))[_0x1a56('0x13')](_0x1a56('0x44'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x1a56('0x13')](_0x1a56('0x4e'),null,_0x1a56('0x4f'))[_0x1a56('0x15')](_0x1a56('0x50'),_0x17d093)[_0x1a56('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x1a56('0x47')]();}function insertCmContact(_0x5e0d17,_0x1722f6,_0xc6f65b,_0x561e5d){var _0x4ee4ad=_[_0x1a56('0x51')](_[_0x1a56('0x52')](_0x561e5d),[_0x1a56('0x41'),_0x1a56('0x53'),_0x1a56('0x42'),_0x1a56('0x32')]);return squel[_0x1a56('0x3d')]()[_0x1a56('0x30')](_0x1a56('0x44'))['fromQuery'](_0x4ee4ad,squel[_0x1a56('0x10')]()['fields'](_0x4ee4ad)[_0x1a56('0x12')](_0x1722f6)[_0x1a56('0x15')]('('+_0xc6f65b[_0x1a56('0x13')](',')+_0x1a56('0x54'),squel[_0x1a56('0x10')]()['fields'](_0xc6f65b)[_0x1a56('0x12')]('cm_contacts')['where'](_0x1a56('0x55'),_0x5e0d17))[_0x1a56('0x15')](_0x1a56('0x56'),squel[_0x1a56('0x10')]()[_0x1a56('0x11')](_0x1a56('0x57'),'min_id')[_0x1a56('0x12')](_0x1722f6)[_0x1a56('0x58')](_0xc6f65b[_0x1a56('0x13')](','))))['toString']();}function handleStop(){logger[_0x1a56('0x59')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2599ff){logger[_0x1a56('0x5a')](_0x2599ff['message']);process['exit'](0x1);}function handleError(_0x277a68,_0x5642ac){stats['errors'][_0x1a56('0x1d')]({'name':_0x5642ac['code'],'message':_0x5642ac[_0x1a56('0x20')],'row':_0x277a68});}function handleQuery(_0x162905){logger[_0x1a56('0x59')](_0x162905);return db['sequelize'][_0x1a56('0x5b')](_0x162905)[_0x1a56('0x19')](function(_0x264e35){results[_0x1a56('0x1d')](_0x264e35);})[_0x1a56('0x1f')](function(_0x25a75a){logger[_0x1a56('0x5a')](_0x25a75a['message']);});}function main(_0x184f82,_0x48c2a3,_0x42f467,_0x1a6150){logger[_0x1a56('0x59')](_0x1a56('0x5c'),_0x184f82,JSON['stringify'](_0x48c2a3));process['send'](_0x1a56('0x5d'));var _0x46b565=_0x48c2a3[_0x1a56('0x5e')];var _0x46932d=_[_0x1a56('0x5f')](_0x46b565);var _0x295b33=_0x48c2a3[_0x1a56('0x60')];var _0x165cb5=path[_0x1a56('0x13')](config[_0x1a56('0x61')],_0x1a56('0x62'),_0x295b33+_0x1a56('0x63'));logger[_0x1a56('0x59')](_0x1a56('0x64'),_0x48c2a3);db[_0x1a56('0x65')][_0x1a56('0x66')]({'raw':!![],'attributes':['id',_0x1a56('0x67')]})[_0x1a56('0x1e')](function(_0x4b1d0f){for(var _0x57964b=0x0;_0x57964b<_0x4b1d0f[_0x1a56('0x1a')];_0x57964b++){if(_0x4b1d0f[_0x57964b]['name']in _0x46b565){contactItemTypes[_0x1a56('0x1d')](_0x4b1d0f[_0x57964b]);delete _0x46932d[_0x4b1d0f[_0x57964b][_0x1a56('0x67')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x46932d[_0x1a56('0x1c')]='';var _0x5357b2=_[_0x1a56('0x52')](_0x46932d)[_0x1a56('0x13')]();logger[_0x1a56('0x59')](_0x1a56('0x68'),_0x5357b2);fs['writeFileSync'](_0x165cb5,_0x5357b2+'\x0a');Papa[_0x1a56('0x69')](fs[_0x1a56('0x6a')](_0x184f82),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4e4b26,_0x1ebfbd){try{for(var _0x31a4aa=0x0,_0x3a5efe=[];_0x31a4aa<_0x4e4b26[_0x1a56('0x6b')][_0x1a56('0x1a')];_0x31a4aa++){stats['rows']+=0x1;if(_0x4e4b26['errors'][_0x31a4aa]){handleError(_0x4e4b26[_0x1a56('0x6b')][_0x31a4aa],_0x4e4b26[_0x1a56('0x6c')][_0x31a4aa]);}else{var _0x6a9f84=[];var _0x19d61a=[];for(var _0x49df94 in _0x46b565){let _0x9dbaea=contactItemTypes[_0x1a56('0x6d')](_0x559740=>_0x559740[_0x1a56('0x67')]===_0x49df94);if(_[_0x1a56('0x1b')](_0x9dbaea)){if(_0x46b565['hasOwnProperty'](_0x49df94)){if(_0x4e4b26[_0x1a56('0x6b')][_0x31a4aa][_0x46b565[_0x49df94]]){var _0x7d464=_[_0x1a56('0x6e')](_0x4e4b26[_0x1a56('0x6b')][_0x31a4aa][_0x46b565[_0x49df94]][_0x1a56('0x6f')](/"/g,'\x27'));switch(_0x49df94){case _0x1a56('0x70'):var _0xc7fff=moment(_0x7d464,_0x1a56('0xc'),!![]);if(_0xc7fff[_0x1a56('0x71')]()){_0x3a5efe['push']('\x22'+_0x7d464+'\x22');}else{_0x6a9f84[_0x1a56('0x1d')](_0x1a56('0x72'));}break;case'priority':var _0x5e9aa5=parseInt(_0x7d464);_0x7d464=_[_0x1a56('0x73')](_0x5e9aa5)||_0x5e9aa5<0x0||_0x5e9aa5>0x4?_0x1a6150?0x3:0x2:_0x5e9aa5;_0x3a5efe['push']('\x22'+_0x7d464+'\x22');break;case'UserId':var _0x45bac9=parseInt(_0x7d464);if(_['isNumber'](_0x45bac9)&&_['includes'](_0x42f467,_0x45bac9)){_0x3a5efe['push']('\x22'+_0x45bac9+'\x22');}else{_0x6a9f84['push'](_0x1a56('0x74'));}break;case _0x1a56('0x75'):if(isEmail(_0x7d464)){_0x3a5efe['push']('\x22'+_0x7d464+'\x22');}else{_0x6a9f84[_0x1a56('0x1d')](_0x1a56('0x76'));}break;case _0x1a56('0x77'):var _0x273a5a=moment(_0x7d464,_0x1a56('0x78'),!![]);if(_0x273a5a[_0x1a56('0x71')]()){_0x3a5efe['push']('\x22'+_0x7d464+'\x22');}else{_0x6a9f84[_0x1a56('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x3a5efe[_0x1a56('0x1d')]('\x22'+_0x7d464+'\x22');}}else{switch(_0x49df94){case _0x1a56('0x79'):case'phone':_0x6a9f84[_0x1a56('0x1d')](_0x49df94+'\x20not\x20specified');break;default:_0x3a5efe[_0x1a56('0x1d')]('\x22\x22');}}}}else{var _0x1fccfb='';for(var _0x36ddc8=0x0;_0x36ddc8<_0x46b565[_0x49df94][_0x1a56('0x1a')];_0x36ddc8++){var _0x7d464=_[_0x1a56('0x6e')](_0x4e4b26[_0x1a56('0x6b')][_0x31a4aa][_0x46b565[_0x49df94][_0x36ddc8]][_0x1a56('0x6f')](/"/g,'\x27'));if(_0x1fccfb=='')_0x1fccfb=_0x7d464;else _0x1fccfb+='|'+_0x7d464;}_0x19d61a[_0x1a56('0x1d')](_0x9dbaea['id']+':'+_0x1fccfb);}}if(hasAdditionalPhones){_0x3a5efe[_0x1a56('0x1d')]('\x22'+_0x19d61a['join'](';')+'\x22');}if(_0x6a9f84[_0x1a56('0x1a')]){handleError(_0x4e4b26[_0x1a56('0x6b')][_0x31a4aa],{'code':_0x1a56('0x7a'),'message':_0x6a9f84[_0x1a56('0x13')]()});}else{fs[_0x1a56('0x7b')](_0x165cb5,_0x3a5efe['join']()+'\x0a');}_0x3a5efe=[];}if(!(stats[_0x1a56('0x7c')]%0xc8)){socket[_0x1a56('0x7d')]('contact:import:'+_0x295b33,stats);stats[_0x1a56('0x6c')]=[];}}if(stopped){logger[_0x1a56('0x59')](_0x1a56('0x7e'));_0x1ebfbd['abort']();}}catch(_0x599f0e){handleError(_0x4e4b26[_0x1a56('0x6b')][_0x31a4aa],{'code':'SystemError','message':_0x599f0e['message']});logger[_0x1a56('0x5a')](_0x1a56('0x7f'),_0x599f0e['message']);}},'complete':function(){try{var _0x4d042d=[];var _0x391812=tempTableName;_0x4d042d['push'](_0x1a56('0x80')+_0x391812+_0x1a56('0x81'));logger[_0x1a56('0x59')](_0x1a56('0x82'),contactItemTypes[_0x1a56('0x1a')]);var _0x4ce2ab=util[_0x1a56('0xb')](_0x1a56('0x83'),_0x165cb5,_0x391812,_0x5357b2,_0x48c2a3[_0x1a56('0x41')],_0x48c2a3[_0x1a56('0x53')]||null,NOW,NOW);if(_[_0x1a56('0x1b')](_0x46b565['scheduledat'])){_0x4ce2ab+=',\x20scheduledAt\x20=\x20NOW()';}_0x4d042d[_0x1a56('0x1d')](_0x4ce2ab);BPromise[_0x1a56('0x84')](_0x4d042d,handleQuery)['then'](function(_0x37ed80){BPromise[_0x1a56('0x21')]([handleAdditionalPhones()])[_0x1a56('0x1e')](function(){_0x4d042d=[];for(var _0x2f20f8=0x0;_0x2f20f8=_0x31eea6){return _0x55f8a7[_0x9294('0x11')](0x193)[_0x9294('0x12')]({'message':util[_0x9294('0x8')](_0x9294('0x13'),_0xcb67ca)});}_0x515158();})[_0x9294('0x14')](function(_0x544cb7){_0x515158(_0x544cb7);});});}function isUserLimit(){return isLimit(_0x9294('0x15'),0x1,db[_0x9294('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x9294('0x17')}]}});}exports[_0x9294('0x18')]=isUserLimit;
\ No newline at end of file
+var _0x88a0=['aes-256-ctr','format','%s:%s:%s','update','utf8','final','hasOwnProperty','use','License','findOne','then','count','json','catch','users','User','admin','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher'];(function(_0x2b07f1,_0x1e538d){var _0x2e76fb=function(_0x245aa7){while(--_0x245aa7){_0x2b07f1['push'](_0x2b07f1['shift']());}};_0x2e76fb(++_0x1e538d);}(_0x88a0,0x124));var _0x088a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x88a0[_0x2dafbe];return _0x58a45a;};'use strict';var crypto=require('crypto');var util=require(_0x088a('0x0'));var compose=require(_0x088a('0x1'));var db=require(_0x088a('0x2'))['db'];var config=require(_0x088a('0x3'));function getValueFromLicense(_0x5874f0,_0xf7e006){if(_0x5874f0&&_0xf7e006){if(_0xf7e006[_0x088a('0x4')]&&_0xf7e006[_0x088a('0x5')]){var _0x4fbded=_0xf7e006[_0x088a('0x4')];var _0x46f307=_0xf7e006['license'];var _0x4b4c08=_0x4fbded[_0x088a('0x6')]('-')[0x4];var _0x145b45=_0x4fbded[_0x088a('0x6')]('-')[0x0];var _0x3e039d=crypto[_0x088a('0x7')](_0x088a('0x8'),util[_0x088a('0x9')](_0x088a('0xa'),_0x4b4c08,_0x4fbded,_0x145b45));var _0x2fbd88=_0x3e039d[_0x088a('0xb')](_0x46f307,'base64',_0x088a('0xc'));_0x2fbd88+=_0x3e039d[_0x088a('0xd')](_0x088a('0xc'));var _0x20c7f3=JSON['parse'](_0x2fbd88);return _0x20c7f3[_0x088a('0xe')](_0x5874f0)?_0x20c7f3[_0x5874f0]:null;}}return null;}function isLimit(_0x14bc0c,_0x1dbd4b,_0x2ca67f,_0x49859b){var _0x59d45a=_0x1dbd4b;return compose()[_0x088a('0xf')](function(_0x1b4320,_0x1ffbe6,_0x183384){return db[_0x088a('0x10')][_0x088a('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x088a('0x12')](function(_0x5f3b24){var _0x177b7c=getValueFromLicense(_0x14bc0c,_0x5f3b24);return _0x177b7c?_0x177b7c:_0x59d45a;})[_0x088a('0x12')](function(_0x4a3031){_0x59d45a=_0x4a3031;return _0x2ca67f[_0x088a('0x13')](_0x49859b);})[_0x088a('0x12')](function(_0x4c9c61){if(_0x4c9c61>=_0x59d45a){return _0x1ffbe6['status'](0x193)[_0x088a('0x14')]({'message':util[_0x088a('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x14bc0c)});}_0x183384();})[_0x088a('0x15')](function(_0x530f7d){_0x183384(_0x530f7d);});});}function isUserLimit(){return isLimit(_0x088a('0x16'),0x1,db[_0x088a('0x17')],{'where':{'$or':[{'role':_0x088a('0x18')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js
index 9ac2b4e..81b2a4a 100644
--- a/server/components/parsers/advancedSearch.js
+++ b/server/components/parsers/advancedSearch.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3148=['$substring','pop','utcOffset','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','shift','match','forEach','filter','indexOf','map','buildExpression','DATE','operator','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x3148,0x123));var _0x8314=function(_0x4e9559,_0x324346){_0x4e9559=_0x4e9559-0x0;var _0x13d630=_0x3148[_0x4e9559];return _0x13d630;};'use strict';var _=require('lodash');var moment=require(_0x8314('0x0'));exports[_0x8314('0x1')]=function(_0x137cdb){var _0x46ff94={'conditions':[]};_0x46ff94[_0x8314('0x2')]=_[_0x8314('0x3')](_0x137cdb,_0x8314('0x4'))?'or':_0x8314('0x5');var _0x301b64=_0x137cdb[_0x8314('0x6')](_0x8314('0x7'),'')['replace'](_0x8314('0x4'),'')[_0x8314('0x8')]('||');for(var _0x5df308=0x0;_0x5df308<_0x301b64['length'];_0x5df308++){var _0xc7d7c8=_0x301b64[_0x5df308]['split'](':=');var _0x4f37f1=_0xc7d7c8[0x0];var _0x4cd980=_0xc7d7c8[_0x8314('0x9')](0x1);_0x4cd980['forEach'](function(_0x53dbfb){var _0x2aba91=_0x53dbfb[_0x8314('0x8')]('[')[_0x8314('0xa')]();var _0x59d2fc=_0x53dbfb[_0x8314('0xb')](/\[(.*?)\]/g);_0x59d2fc[_0x8314('0xc')](function(_0x141124){var _0x4501ff=_0x141124[_0x8314('0x8')]('[')[_0x8314('0xd')](function(_0x3c2ac1){return _0x3c2ac1[_0x8314('0xe')](']')>-0x1;})[_0x8314('0xf')](function(_0x392f53){return _0x392f53[_0x8314('0x8')](']')[0x0];})[0x0];_0x46ff94['conditions']['push']({'field':_0x4f37f1,'operator':_0x2aba91,'value':_0x4501ff});});});}return _0x46ff94;};exports[_0x8314('0x10')]=function(_0x59979c,_0x230cc9,_0x5a711a){var _0x583659={};if(_0x230cc9===_0x8314('0x11')){if(_0x5a711a['operator']==='$eq'){_0x5a711a[_0x8314('0x12')]=_0x8314('0x13');_0x5a711a[_0x8314('0x14')]+=','+_0x5a711a[_0x8314('0x14')];}else if(_[_0x8314('0x15')]([_0x8314('0x16'),'$lte'],_0x5a711a[_0x8314('0x12')])){_0x5a711a[_0x8314('0x14')]=moment(_0x5a711a[_0x8314('0x14')])[_0x8314('0x17')](0x1,_0x8314('0x18'))[_0x8314('0x19')](_0x8314('0x1a'));}}if(_0x5a711a[_0x8314('0x1b')]){_0x230cc9=_0x5a711a[_0x8314('0x1b')];_0x583659[_0x8314('0x1c')]=_0x8314('0x1d')+_0x59979c+'.'+_0x5a711a[_0x8314('0x1e')]+'\x20AS\x20'+_0x5a711a[_0x8314('0x1b')]+')\x20'+parseOperator(_0x5a711a['operator']);}else{_0x583659[_0x8314('0x1c')]=_0x59979c+'.'+_0x5a711a[_0x8314('0x1e')]+'\x20'+parseOperator(_0x5a711a[_0x8314('0x12')]);}if(_['includes']([_0x8314('0x1f'),_0x8314('0x20')],_0x5a711a[_0x8314('0x12')]))_0x583659[_0x8314('0x1c')]='('+_0x583659[_0x8314('0x1c')]+'\x20OR\x20'+_0x59979c+'.'+_0x5a711a[_0x8314('0x1e')]+_0x8314('0x21');_0x583659[_0x8314('0x14')]=parseValue(_0x230cc9,_0x5a711a[_0x8314('0x12')],_0x5a711a[_0x8314('0x14')]);return _0x583659;};function parseOperator(_0x58986c){var _0x4651ae;switch(_0x58986c){case _0x8314('0x22'):_0x4651ae=_0x8314('0x23');break;case _0x8314('0x20'):_0x4651ae=_0x8314('0x24');break;case _0x8314('0x25'):_0x4651ae=_0x8314('0x26');break;case _0x8314('0x1f'):_0x4651ae=_0x8314('0x27');break;case'$substring':case _0x8314('0x28'):case _0x8314('0x29'):_0x4651ae=_0x8314('0x2a');break;case _0x8314('0x2b'):_0x4651ae='<\x20?';break;case _0x8314('0x16'):_0x4651ae=_0x8314('0x2c');break;case _0x8314('0x2d'):_0x4651ae=_0x8314('0x2e');break;case _0x8314('0x2f'):_0x4651ae=_0x8314('0x30');break;case _0x8314('0x13'):_0x4651ae=_0x8314('0x31');break;}return _0x4651ae;}function parseValue(_0x23acb9,_0x8143e9,_0x48c7b9){var _0x5726f0={'start':undefined,'end':undefined};switch(_0x8143e9){case _0x8314('0x22'):case _0x8314('0x20'):_0x5726f0[_0x8314('0x32')]=_0x48c7b9['split'](',');break;case _0x8314('0x33'):_0x5726f0['start']='%'+_0x48c7b9+'%';break;case _0x8314('0x28'):_0x5726f0[_0x8314('0x32')]=_0x48c7b9+'%';break;case _0x8314('0x29'):_0x5726f0['start']='%'+_0x48c7b9;break;case _0x8314('0x13'):var _0x337484=_0x48c7b9[_0x8314('0x8')](',');var _0x48c7b9=_0x337484[_0x8314('0xa')]();var _0x3f1ec6=_0x337484[_0x8314('0x34')]();if(_0x23acb9===_0x8314('0x11')){_0x48c7b9=moment(_0x48c7b9)[_0x8314('0x35')](0x0,!![])['format']();_0x3f1ec6=moment(_0x3f1ec6)[_0x8314('0x35')](0x0,!![])['add'](0x17,_0x8314('0x36'))[_0x8314('0x17')](0x3b,_0x8314('0x37'))[_0x8314('0x17')](0x3b,_0x8314('0x38'))['format']();}_0x5726f0={'start':_0x48c7b9,'end':_0x3f1ec6};break;default:_0x5726f0[_0x8314('0x32')]=_0x48c7b9;break;}return _0x5726f0;}
\ No newline at end of file
+var _0x2a40=['split','slice','forEach','match','filter','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','$ne','$notIn','\x20OR\x20','field','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','pop','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x2a40,0xa5));var _0x02a4=function(_0x21b706,_0x1022f4){_0x21b706=_0x21b706-0x0;var _0x13b94a=_0x2a40[_0x21b706];return _0x13b94a;};'use strict';var _=require(_0x02a4('0x0'));var moment=require(_0x02a4('0x1'));exports[_0x02a4('0x2')]=function(_0x3ed677){var _0x20009c={'conditions':[]};_0x20009c[_0x02a4('0x3')]=_[_0x02a4('0x4')](_0x3ed677,_0x02a4('0x5'))?'or':_0x02a4('0x6');var _0x382c6b=_0x3ed677[_0x02a4('0x7')](_0x02a4('0x8'),'')[_0x02a4('0x7')](_0x02a4('0x5'),'')[_0x02a4('0x9')]('||');for(var _0x5a584b=0x0;_0x5a584b<_0x382c6b['length'];_0x5a584b++){var _0x328b37=_0x382c6b[_0x5a584b]['split'](':=');var _0x1329c7=_0x328b37[0x0];var _0x6b2a2e=_0x328b37[_0x02a4('0xa')](0x1);_0x6b2a2e[_0x02a4('0xb')](function(_0x1c5c45){var _0x253731=_0x1c5c45[_0x02a4('0x9')]('[')['shift']();var _0x46dd6c=_0x1c5c45[_0x02a4('0xc')](/\[(.*?)\]/g);_0x46dd6c[_0x02a4('0xb')](function(_0x516f5c){var _0x4702d7=_0x516f5c[_0x02a4('0x9')]('[')[_0x02a4('0xd')](function(_0x129873){return _0x129873['indexOf'](']')>-0x1;})[_0x02a4('0xe')](function(_0x1d275c){return _0x1d275c[_0x02a4('0x9')](']')[0x0];})[0x0];_0x20009c[_0x02a4('0xf')]['push']({'field':_0x1329c7,'operator':_0x253731,'value':_0x4702d7});});});}return _0x20009c;};exports[_0x02a4('0x10')]=function(_0x56c83d,_0x200bb5,_0x4656de){var _0x417a5b={};if(_0x200bb5===_0x02a4('0x11')){if(_0x4656de[_0x02a4('0x12')]===_0x02a4('0x13')){_0x4656de[_0x02a4('0x12')]=_0x02a4('0x14');_0x4656de[_0x02a4('0x15')]+=','+_0x4656de[_0x02a4('0x15')];}else if(_[_0x02a4('0x16')]([_0x02a4('0x17'),_0x02a4('0x18')],_0x4656de[_0x02a4('0x12')])){_0x4656de[_0x02a4('0x15')]=moment(_0x4656de[_0x02a4('0x15')])['add'](0x1,_0x02a4('0x19'))[_0x02a4('0x1a')](_0x02a4('0x1b'));}}if(_0x4656de[_0x02a4('0x1c')]){_0x200bb5=_0x4656de[_0x02a4('0x1c')];_0x417a5b[_0x02a4('0x1d')]=_0x02a4('0x1e')+_0x56c83d+'.'+_0x4656de['field']+_0x02a4('0x1f')+_0x4656de['castTo']+')\x20'+parseOperator(_0x4656de[_0x02a4('0x12')]);}else{_0x417a5b['text']=_0x56c83d+'.'+_0x4656de['field']+'\x20'+parseOperator(_0x4656de['operator']);}if(_['includes']([_0x02a4('0x20'),_0x02a4('0x21')],_0x4656de['operator']))_0x417a5b['text']='('+_0x417a5b[_0x02a4('0x1d')]+_0x02a4('0x22')+_0x56c83d+'.'+_0x4656de[_0x02a4('0x23')]+_0x02a4('0x24');_0x417a5b[_0x02a4('0x15')]=parseValue(_0x200bb5,_0x4656de[_0x02a4('0x12')],_0x4656de[_0x02a4('0x15')]);return _0x417a5b;};function parseOperator(_0x27f779){var _0x36a212;switch(_0x27f779){case _0x02a4('0x25'):_0x36a212=_0x02a4('0x26');break;case'$notIn':_0x36a212=_0x02a4('0x27');break;case'$eq':_0x36a212=_0x02a4('0x28');break;case _0x02a4('0x20'):_0x36a212='<>\x20?';break;case _0x02a4('0x29'):case _0x02a4('0x2a'):case _0x02a4('0x2b'):_0x36a212=_0x02a4('0x2c');break;case _0x02a4('0x2d'):_0x36a212=_0x02a4('0x2e');break;case _0x02a4('0x17'):_0x36a212=_0x02a4('0x2f');break;case _0x02a4('0x18'):_0x36a212='<=\x20?';break;case'$gte':_0x36a212=_0x02a4('0x30');break;case _0x02a4('0x14'):_0x36a212=_0x02a4('0x31');break;}return _0x36a212;}function parseValue(_0x4478a5,_0x163df1,_0x38b67c){var _0x5e69fd={'start':undefined,'end':undefined};switch(_0x163df1){case _0x02a4('0x25'):case _0x02a4('0x21'):_0x5e69fd[_0x02a4('0x32')]=_0x38b67c[_0x02a4('0x9')](',');break;case'$substring':_0x5e69fd[_0x02a4('0x32')]='%'+_0x38b67c+'%';break;case _0x02a4('0x2a'):_0x5e69fd[_0x02a4('0x32')]=_0x38b67c+'%';break;case _0x02a4('0x2b'):_0x5e69fd[_0x02a4('0x32')]='%'+_0x38b67c;break;case _0x02a4('0x14'):var _0x455291=_0x38b67c['split'](',');var _0x38b67c=_0x455291[_0x02a4('0x33')]();var _0x43699e=_0x455291[_0x02a4('0x34')]();if(_0x4478a5===_0x02a4('0x11')){_0x38b67c=moment(_0x38b67c)[_0x02a4('0x35')](0x0,!![])[_0x02a4('0x1a')]();_0x43699e=moment(_0x43699e)[_0x02a4('0x35')](0x0,!![])[_0x02a4('0x36')](0x17,_0x02a4('0x37'))[_0x02a4('0x36')](0x3b,_0x02a4('0x38'))[_0x02a4('0x36')](0x3b,_0x02a4('0x39'))[_0x02a4('0x1a')]();}_0x5e69fd={'start':_0x38b67c,'end':_0x43699e};break;default:_0x5e69fd[_0x02a4('0x32')]=_0x38b67c;break;}return _0x5e69fd;}
\ No newline at end of file
diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js
index 1129a54..306356e 100644
--- a/server/components/parsers/qs.js
+++ b/server/components/parsers/qs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3454=['length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','forEach','join','sequelize','moment','fields','split','isEmpty','forOwn','find','type','DATE','parse','format','utc','subtract','isArray','limit','sort','map','indexOf','priority','col','unsigned','substr','DESC','cast','omit'];(function(_0x4a26e9,_0x12442b){var _0x39d5db=function(_0x349e1b){while(--_0x349e1b){_0x4a26e9['push'](_0x4a26e9['shift']());}};_0x39d5db(++_0x12442b);}(_0x3454,0x1c8));var _0x4345=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3454[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var sequelize=require(_0x4345('0x0'));var moment=require(_0x4345('0x1'));var LIMIT_VALUE=0xfa;exports[_0x4345('0x2')]=function(_0x12bd51){var _0x1f4c03=null;if(_0x12bd51){_0x1f4c03=_0x12bd51[_0x4345('0x3')](',');}return _0x1f4c03;};exports['filters']=function(_0x84e8f,_0x60d183){var _0xdc0ad3={};if(!_[_0x4345('0x4')](_0x84e8f)){_[_0x4345('0x5')](_0x84e8f,function(_0xe6402a,_0x4bfaeb){try{if(_0x60d183){var _0x570d36=_[_0x4345('0x6')](_0x60d183,{'name':_0x4bfaeb})||{};if(_0x570d36[_0x4345('0x7')]===_0x4345('0x8')&&_['isPlainObject'](_0xe6402a)){var _0x4c79c8=JSON[_0x4345('0x9')](_0xe6402a);var _0x19cd80={'$gte':moment(moment(_0x4c79c8['$gte'])[_0x4345('0xa')]('YYYY-MM-DD'))['utc']()[_0x4345('0xa')](),'$lte':moment(moment(_0x4c79c8['$lte'])[_0x4345('0xa')]('YYYY-MM-DD'))[_0x4345('0xb')]()[_0x4345('0xc')](0x1,'s')[_0x4345('0xa')]()};_0xdc0ad3[_0x4bfaeb]=_0x19cd80;}else{_0xdc0ad3[_0x4bfaeb]=_[_0x4345('0xd')](_0xe6402a)?_0xe6402a:JSON['parse'](_0xe6402a);}}else{_0xdc0ad3[_0x4bfaeb]=_['isArray'](_0xe6402a)?_0xe6402a:JSON[_0x4345('0x9')](_0xe6402a);}}catch(_0x50c88a){_0xdc0ad3[_0x4bfaeb]=_0xe6402a[_0x4345('0x3')](',');}});}return _0xdc0ad3;};exports[_0x4345('0xe')]=function(_0x2c988e){_0x2c988e=parseInt(_0x2c988e,0xa);if(!_0x2c988e||_0x2c988e<0x0){_0x2c988e=LIMIT_VALUE;}return _0x2c988e;};exports['offset']=function(_0x4e9bf3){_0x4e9bf3=parseInt(_0x4e9bf3,0xa);if(!_0x4e9bf3||_0x4e9bf3<0x0){_0x4e9bf3=0x0;}return _0x4e9bf3;};exports[_0x4345('0xf')]=function(_0x4ac109){var _0x155260,_0x284c1e=null;if(_0x4ac109){_0x155260=_0x4ac109[_0x4345('0x3')](',');_0x284c1e=_[_0x4345('0x10')](_0x155260,function(_0x172beb){if(_0x172beb[_0x4345('0x11')]('-')===0x0){return[_0x172beb===_0x4345('0x12')?sequelize['cast'](sequelize[_0x4345('0x13')](_0x4345('0x12')),_0x4345('0x14')):_0x172beb[_0x4345('0x15')](0x1),_0x4345('0x16')];}else{return[_0x172beb===_0x4345('0x12')?sequelize[_0x4345('0x17')](sequelize[_0x4345('0x13')](_0x4345('0x12')),'unsigned'):_0x172beb,'ASC'];}});}return _0x284c1e;};exports[_0x4345('0x18')]=function(_0x6b079c,_0x276190){if(_[_0x4345('0x4')](_0x6b079c)){return _0x6b079c;}if(_[_0x4345('0xd')](_0x6b079c)){for(var _0x1b6814=0x0;_0x1b6814<_0x6b079c[_0x4345('0x19')];_0x1b6814+=0x1){_0x6b079c[_0x1b6814]=this[_0x4345('0x18')](_0x6b079c[_0x1b6814],_0x276190);}return _0x6b079c;}if(!_[_0x4345('0x1a')](_0x6b079c)){return _0x6b079c;}if(_[_0x4345('0x1b')](_0x276190)){_0x276190=[_0x276190];}if(!_[_0x4345('0xd')](_0x276190)){return _0x6b079c;}for(var _0x346178=0x0;_0x346178<_0x276190[_0x4345('0x19')];_0x346178+=0x1){_[_0x4345('0x1c')](_0x6b079c,_0x276190[_0x346178]);}for(var _0x3b3d61 in _0x6b079c){if(_0x6b079c[_0x4345('0x1d')](_0x3b3d61)){_0x6b079c[_0x3b3d61]=this[_0x4345('0x18')](_0x6b079c[_0x3b3d61],_0x276190);}}return _0x6b079c;};exports[_0x4345('0x1e')]=function(_0x2084bb){return _0x2084bb[_0x4345('0x1f')](RegExp(_0x4345('0x20')))?!![]:![];};exports[_0x4345('0x21')]=function(_0x443591){return _0x443591[_0x4345('0x1f')](/^\S+@\S+$/)?!![]:![];};exports[_0x4345('0x22')]=function(_0x3b875b){var _0x2dedc4=[];_0x3b875b[_0x4345('0x3')]('\x20')[_0x4345('0x23')](function(_0x4183c5){_0x2dedc4['push']('+'+_0x4183c5['toString']()+'*');});return _0x2dedc4[_0x4345('0x24')]('\x20');};
\ No newline at end of file
+var _0xcf33=['push','toString','join','lodash','sequelize','moment','split','filters','forOwn','find','type','isPlainObject','parse','$gte','format','$lte','YYYY-MM-DD','utc','subtract','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','ASC','isArray','length','isString','unset','omit','isNumeric','match','isEmail','forEach'];(function(_0x144caf,_0x15b0b4){var _0x152159=function(_0x57ab28){while(--_0x57ab28){_0x144caf['push'](_0x144caf['shift']());}};_0x152159(++_0x15b0b4);}(_0xcf33,0x114));var _0x3cf3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xcf33[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x3cf3('0x0'));var sequelize=require(_0x3cf3('0x1'));var moment=require(_0x3cf3('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x2f68d0){var _0x4de81f=null;if(_0x2f68d0){_0x4de81f=_0x2f68d0[_0x3cf3('0x3')](',');}return _0x4de81f;};exports[_0x3cf3('0x4')]=function(_0x329b21,_0x57b4c0){var _0x4372cd={};if(!_['isEmpty'](_0x329b21)){_[_0x3cf3('0x5')](_0x329b21,function(_0x37897f,_0x539e1e){try{if(_0x57b4c0){var _0x2be67d=_[_0x3cf3('0x6')](_0x57b4c0,{'name':_0x539e1e})||{};if(_0x2be67d[_0x3cf3('0x7')]==='DATE'&&_[_0x3cf3('0x8')](_0x37897f)){var _0x3c9d52=JSON[_0x3cf3('0x9')](_0x37897f);var _0x1a3572={'$gte':moment(moment(_0x3c9d52[_0x3cf3('0xa')])[_0x3cf3('0xb')]('YYYY-MM-DD'))['utc']()[_0x3cf3('0xb')](),'$lte':moment(moment(_0x3c9d52[_0x3cf3('0xc')])[_0x3cf3('0xb')](_0x3cf3('0xd')))[_0x3cf3('0xe')]()[_0x3cf3('0xf')](0x1,'s')['format']()};_0x4372cd[_0x539e1e]=_0x1a3572;}else{_0x4372cd[_0x539e1e]=_['isArray'](_0x37897f)?_0x37897f:JSON[_0x3cf3('0x9')](_0x37897f);}}else{_0x4372cd[_0x539e1e]=_['isArray'](_0x37897f)?_0x37897f:JSON[_0x3cf3('0x9')](_0x37897f);}}catch(_0x5e9f06){_0x4372cd[_0x539e1e]=_0x37897f[_0x3cf3('0x3')](',');}});}return _0x4372cd;};exports[_0x3cf3('0x10')]=function(_0x41e534){_0x41e534=parseInt(_0x41e534,0xa);if(!_0x41e534||_0x41e534<0x0){_0x41e534=LIMIT_VALUE;}return _0x41e534;};exports[_0x3cf3('0x11')]=function(_0x44ee0c){_0x44ee0c=parseInt(_0x44ee0c,0xa);if(!_0x44ee0c||_0x44ee0c<0x0){_0x44ee0c=0x0;}return _0x44ee0c;};exports[_0x3cf3('0x12')]=function(_0x295efa){var _0x196d37,_0x2cc059=null;if(_0x295efa){_0x196d37=_0x295efa[_0x3cf3('0x3')](',');_0x2cc059=_[_0x3cf3('0x13')](_0x196d37,function(_0x21e8d1){if(_0x21e8d1[_0x3cf3('0x14')]('-')===0x0){return[_0x21e8d1===_0x3cf3('0x15')?sequelize[_0x3cf3('0x16')](sequelize[_0x3cf3('0x17')](_0x3cf3('0x15')),_0x3cf3('0x18')):_0x21e8d1[_0x3cf3('0x19')](0x1),'DESC'];}else{return[_0x21e8d1===_0x3cf3('0x15')?sequelize[_0x3cf3('0x16')](sequelize[_0x3cf3('0x17')]('priority'),'unsigned'):_0x21e8d1,_0x3cf3('0x1a')];}});}return _0x2cc059;};exports['omit']=function(_0x7a0408,_0x20ab66){if(_['isEmpty'](_0x7a0408)){return _0x7a0408;}if(_[_0x3cf3('0x1b')](_0x7a0408)){for(var _0x3021bb=0x0;_0x3021bb<_0x7a0408[_0x3cf3('0x1c')];_0x3021bb+=0x1){_0x7a0408[_0x3021bb]=this['omit'](_0x7a0408[_0x3021bb],_0x20ab66);}return _0x7a0408;}if(!_['isObject'](_0x7a0408)){return _0x7a0408;}if(_[_0x3cf3('0x1d')](_0x20ab66)){_0x20ab66=[_0x20ab66];}if(!_['isArray'](_0x20ab66)){return _0x7a0408;}for(var _0x56eca3=0x0;_0x56eca3<_0x20ab66[_0x3cf3('0x1c')];_0x56eca3+=0x1){_[_0x3cf3('0x1e')](_0x7a0408,_0x20ab66[_0x56eca3]);}for(var _0x4ea5fc in _0x7a0408){if(_0x7a0408['hasOwnProperty'](_0x4ea5fc)){_0x7a0408[_0x4ea5fc]=this[_0x3cf3('0x1f')](_0x7a0408[_0x4ea5fc],_0x20ab66);}}return _0x7a0408;};exports[_0x3cf3('0x20')]=function(_0x435715){return _0x435715[_0x3cf3('0x21')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x3cf3('0x22')]=function(_0x32816e){return _0x32816e['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x37e2b6){var _0x3c3fc2=[];_0x37e2b6[_0x3cf3('0x3')]('\x20')[_0x3cf3('0x23')](function(_0xffa31){_0x3c3fc2[_0x3cf3('0x24')]('+'+_0xffa31[_0x3cf3('0x25')]()+'*');});return _0x3c3fc2[_0x3cf3('0x26')]('\x20');};
\ No newline at end of file
diff --git a/server/config/express.js b/server/config/express.js
index 14f07a0..4e8dc69 100644
--- a/server/config/express.js
+++ b/server/config/express.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6108=['get','appPath','views','root','/server/views','engine','html','renderFile','view\x20engine','50mb','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','passport','cors','moment','./environment','../mysqldb','default','env','production','join','development','test','set','client','use','toISOString','split','static'];(function(_0x38c7aa,_0xbe5efc){var _0x49f6fd=function(_0x1f21d2){while(--_0x1f21d2){_0x38c7aa['push'](_0x38c7aa['shift']());}};_0x49f6fd(++_0xbe5efc);}(_0x6108,0x8f));var _0x8610=function(_0x16521d,_0x46bde9){_0x16521d=_0x16521d-0x0;var _0x12da2e=_0x6108[_0x16521d];return _0x12da2e;};'use strict';var express=require(_0x8610('0x0'));var favicon=require(_0x8610('0x1'));var bodyParser=require(_0x8610('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x8610('0x3'));var errorHandler=require(_0x8610('0x4'));var path=require('path');var passport=require(_0x8610('0x5'));var cors=require(_0x8610('0x6'));var moment=require(_0x8610('0x7'));var config=require(_0x8610('0x8'));var db=require(_0x8610('0x9'))['db'];exports[_0x8610('0xa')]=function(_0x237302){var _0x2e3939=_0x237302['get'](_0x8610('0xb'));if(_0x2e3939===_0x8610('0xc')){_0x237302['set']('appPath',path[_0x8610('0xd')](config['root'],'public'));}if(_0x2e3939===_0x8610('0xe')||_0x2e3939===_0x8610('0xf')){_0x237302[_0x8610('0x10')]('appPath',path[_0x8610('0xd')](config['root'],_0x8610('0x11')));_0x237302[_0x8610('0x12')](errorHandler());}_0x237302[_0x8610('0x10')]('json\x20replacer',function(_0x5b52b5,_0x15f802){if(this[_0x5b52b5]instanceof Date){_0x15f802=this[_0x5b52b5][_0x8610('0x13')]()[_0x8610('0x14')]('.')[0x0]+'Z';}return _0x15f802;});_0x237302[_0x8610('0x12')](express[_0x8610('0x15')](_0x237302[_0x8610('0x16')](_0x8610('0x17'))));_0x237302[_0x8610('0x10')](_0x8610('0x18'),config[_0x8610('0x19')]+_0x8610('0x1a'));_0x237302[_0x8610('0x1b')](_0x8610('0x1c'),require('ejs')[_0x8610('0x1d')]);_0x237302[_0x8610('0x10')](_0x8610('0x1e'),_0x8610('0x1c'));_0x237302[_0x8610('0x12')](bodyParser['urlencoded']({'limit':_0x8610('0x1f'),'extended':!![]}));_0x237302[_0x8610('0x12')](bodyParser['json']({'limit':_0x8610('0x1f')}));_0x237302[_0x8610('0x12')](cors());_0x237302[_0x8610('0x12')](methodOverride());_0x237302[_0x8610('0x12')](cookieParser());_0x237302[_0x8610('0x12')](passport[_0x8610('0x20')]());};
\ No newline at end of file
+var _0xb6a6=['root','public','development','test','set','client','use','json\x20replacer','static','/server/views','engine','html','ejs','renderFile','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','default','get','env','production','appPath','join'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb6a6,0x110));var _0x6b6a=function(_0x5609fe,_0x98c31c){_0x5609fe=_0x5609fe-0x0;var _0x29a026=_0xb6a6[_0x5609fe];return _0x29a026;};'use strict';var express=require(_0x6b6a('0x0'));var favicon=require(_0x6b6a('0x1'));var bodyParser=require(_0x6b6a('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6b6a('0x3'));var errorHandler=require(_0x6b6a('0x4'));var path=require(_0x6b6a('0x5'));var passport=require(_0x6b6a('0x6'));var cors=require(_0x6b6a('0x7'));var moment=require(_0x6b6a('0x8'));var config=require(_0x6b6a('0x9'));var db=require('../mysqldb')['db'];exports[_0x6b6a('0xa')]=function(_0x2ba2db){var _0x1a3a74=_0x2ba2db[_0x6b6a('0xb')](_0x6b6a('0xc'));if(_0x1a3a74===_0x6b6a('0xd')){_0x2ba2db['set'](_0x6b6a('0xe'),path[_0x6b6a('0xf')](config[_0x6b6a('0x10')],_0x6b6a('0x11')));}if(_0x1a3a74===_0x6b6a('0x12')||_0x1a3a74===_0x6b6a('0x13')){_0x2ba2db[_0x6b6a('0x14')]('appPath',path[_0x6b6a('0xf')](config[_0x6b6a('0x10')],_0x6b6a('0x15')));_0x2ba2db[_0x6b6a('0x16')](errorHandler());}_0x2ba2db[_0x6b6a('0x14')](_0x6b6a('0x17'),function(_0xbb0df5,_0x30fa9e){if(this[_0xbb0df5]instanceof Date){_0x30fa9e=this[_0xbb0df5]['toISOString']()['split']('.')[0x0]+'Z';}return _0x30fa9e;});_0x2ba2db[_0x6b6a('0x16')](express[_0x6b6a('0x18')](_0x2ba2db[_0x6b6a('0xb')](_0x6b6a('0xe'))));_0x2ba2db[_0x6b6a('0x14')]('views',config[_0x6b6a('0x10')]+_0x6b6a('0x19'));_0x2ba2db[_0x6b6a('0x1a')](_0x6b6a('0x1b'),require(_0x6b6a('0x1c'))[_0x6b6a('0x1d')]);_0x2ba2db[_0x6b6a('0x14')]('view\x20engine',_0x6b6a('0x1b'));_0x2ba2db[_0x6b6a('0x16')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x2ba2db['use'](bodyParser[_0x6b6a('0x1e')]({'limit':'50mb'}));_0x2ba2db[_0x6b6a('0x16')](cors());_0x2ba2db[_0x6b6a('0x16')](methodOverride());_0x2ba2db[_0x6b6a('0x16')](cookieParser());_0x2ba2db['use'](passport[_0x6b6a('0x1f')]());};
\ No newline at end of file
diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js
index 5e3c531..509db02 100644
--- a/server/config/license/hardware.js
+++ b/server/config/license/hardware.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x379e=['md5','update','digest','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','substring','lodash','execSync','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','model','join','createHash'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x379e,0x104));var _0xe379=function(_0x15e04a,_0x5c3c25){_0x15e04a=_0x15e04a-0x0;var _0x8beb80=_0x379e[_0x15e04a];return _0x8beb80;};'use strict';var _=require(_0xe379('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xe379('0x1')];function getInterfaces(){var _0xccbef2=[];var _0x1e24f9=os[_0xe379('0x2')]();var _0x3db31a=_[_0xe379('0x3')](_[_0xe379('0x4')](_0x1e24f9));for(var _0x5ebed1=0x0;_0x5ebed1<_0x3db31a[_0xe379('0x5')];_0x5ebed1++){var _0x24221c=_0x1e24f9[_0x3db31a[_0x5ebed1]][_0xe379('0x6')](function(_0x1b6fed){return _0x1b6fed[_0xe379('0x7')]==='IPv4'&&_0x1b6fed[_0xe379('0x8')]===![];});_0xccbef2=_0xccbef2[_0xe379('0x9')](_0x24221c);}return _0xccbef2;}function getFirstInterface(){var _0x29537d=_[_0xe379('0xa')](getInterfaces());return{'macAddress':_0x29537d&&_0x29537d[_0xe379('0xb')]?_0x29537d[_0xe379('0xb')]:_0xe379('0xc'),'ipAddress':_0x29537d&&_0x29537d[_0xe379('0xd')]?_0x29537d[_0xe379('0xd')]:'127.0.0.1'};}exports[_0xe379('0xe')]=getFirstInterface;function getCPUhash(){var _0x19631b=_[_0xe379('0x3')](os[_0xe379('0xf')]()['map'](function(_0x4c6562){return _0x4c6562[_0xe379('0x10')];}))[_0xe379('0x11')](':');return crypto[_0xe379('0x12')](_0xe379('0x13'))[_0xe379('0x14')](_0x19631b)[_0xe379('0x15')](_0xe379('0x16'));}exports[_0xe379('0x17')]=function(){switch(os['platform']()){case _0xe379('0x18'):return exec(_0xe379('0x19'),{'encoding':_0xe379('0x1a')})[_0xe379('0x1b')]('\x0d\x0a','');default:var _0x3d9351=getFirstInterface();var _0x3fc4a0=getCPUhash();var _0x48c772=_0x3fc4a0+'|'+os[_0xe379('0x1c')]()+'|'+_0x3d9351['macAddress']+'|'+_0x3d9351[_0xe379('0x1d')];var _0x56c11d=crypto[_0xe379('0x12')](_0xe379('0x13'))[_0xe379('0x14')](_0x48c772)[_0xe379('0x15')]('hex');return _0x56c11d[_0xe379('0x1e')](0x0,0x8)+'-'+_0x56c11d[_0xe379('0x1e')](0x8,0xc)+'-'+_0x56c11d[_0xe379('0x1e')](0xc,0x10)+'-'+_0x56c11d[_0xe379('0x1e')](0x10,0x14)+'-'+_0x56c11d[_0xe379('0x1e')](0x14);}};
\ No newline at end of file
+var _0xdded=['map','model','createHash','md5','update','digest','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','concat','mac','address','127.0.0.1','getFirstInterface','cpus'];(function(_0x4af01e,_0x543f5c){var _0x178c11=function(_0x2c2f76){while(--_0x2c2f76){_0x4af01e['push'](_0x4af01e['shift']());}};_0x178c11(++_0x543f5c);}(_0xdded,0x17a));var _0xddde=function(_0x4d7f37,_0x12264d){_0x4d7f37=_0x4d7f37-0x0;var _0x42e961=_0xdded[_0x4d7f37];return _0x42e961;};'use strict';var _=require(_0xddde('0x0'));var os=require('os');var crypto=require(_0xddde('0x1'));var machine=require(_0xddde('0x2'));var exec=require(_0xddde('0x3'))[_0xddde('0x4')];function getInterfaces(){var _0x9b8506=[];var _0x5cc90a=os[_0xddde('0x5')]();var _0x276cc6=_[_0xddde('0x6')](_[_0xddde('0x7')](_0x5cc90a));for(var _0xc00db8=0x0;_0xc00db8<_0x276cc6[_0xddde('0x8')];_0xc00db8++){var _0x3c3021=_0x5cc90a[_0x276cc6[_0xc00db8]][_0xddde('0x9')](function(_0x516eb5){return _0x516eb5[_0xddde('0xa')]===_0xddde('0xb')&&_0x516eb5['internal']===![];});_0x9b8506=_0x9b8506[_0xddde('0xc')](_0x3c3021);}return _0x9b8506;}function getFirstInterface(){var _0x4f0f3c=_['head'](getInterfaces());return{'macAddress':_0x4f0f3c&&_0x4f0f3c['mac']?_0x4f0f3c[_0xddde('0xd')]:'00:00:00:00:00:00','ipAddress':_0x4f0f3c&&_0x4f0f3c[_0xddde('0xe')]?_0x4f0f3c['address']:_0xddde('0xf')};}exports[_0xddde('0x10')]=getFirstInterface;function getCPUhash(){var _0xaaed0c=_[_0xddde('0x6')](os[_0xddde('0x11')]()[_0xddde('0x12')](function(_0x25fadc){return _0x25fadc[_0xddde('0x13')];}))['join'](':');return crypto[_0xddde('0x14')](_0xddde('0x15'))[_0xddde('0x16')](_0xaaed0c)[_0xddde('0x17')](_0xddde('0x18'));}exports[_0xddde('0x19')]=function(){switch(os['platform']()){case _0xddde('0x1a'):return exec(_0xddde('0x1b'),{'encoding':_0xddde('0x1c')})['replace']('\x0d\x0a','');default:var _0x5de7ce=getFirstInterface();var _0xadd497=getCPUhash();var _0x4e98fd=_0xadd497+'|'+os[_0xddde('0x1d')]()+'|'+_0x5de7ce[_0xddde('0x1e')]+'|'+_0x5de7ce[_0xddde('0x1f')];var _0x463254=crypto[_0xddde('0x14')]('md5')[_0xddde('0x16')](_0x4e98fd)[_0xddde('0x17')]('hex');return _0x463254[_0xddde('0x20')](0x0,0x8)+'-'+_0x463254[_0xddde('0x20')](0x8,0xc)+'-'+_0x463254['substring'](0xc,0x10)+'-'+_0x463254['substring'](0x10,0x14)+'-'+_0x463254[_0xddde('0x20')](0x14);}};
\ No newline at end of file
diff --git a/server/config/license/index.js b/server/config/license/index.js
index 470f8d0..5119bdc 100644
--- a/server/config/license/index.js
+++ b/server/config/license/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3588=['getUuid','License','spread','default','util','crypto','moment','request-promise','bluebird','pkginfo','version','../environment','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','||FIELD||VALUE||\x0a','User','findOne','admin','|reason|','|name|','|email|','email','getFirstInterface','ipAddress','MOTLICENSE','Alert','fullname','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','Changed','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x3588,0x82));var _0x8358=function(_0x47470f,_0x411315){_0x47470f=_0x47470f-0x0;var _0x5b16a4=_0x3588[_0x47470f];return _0x5b16a4;};'use strict';var util=require(_0x8358('0x0'));var crypto=require(_0x8358('0x1'));var moment=require(_0x8358('0x2'));var rp=require(_0x8358('0x3'));var BPromise=require(_0x8358('0x4'));var pkginfo=require(_0x8358('0x5'))(module,_0x8358('0x6'));var db=require('../../mysqldb')['db'];var config=require(_0x8358('0x7'));var hardware=require(_0x8358('0x8'));var logger=require(_0x8358('0x9'))(_0x8358('0xa'));var jira=require('../../api/jira/jira.controller');var HOST=_0x8358('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x846201){return new BPromise(function(_0x49d515,_0x11d369){var _0x583720=util[_0x8358('0xc')](_0x8358('0xd'),HOST,_0x846201,module[_0x8358('0xe')][_0x8358('0x6')]);if(oldToken){_0x583720=util['format'](_0x8358('0xf'),HOST,_0x846201,module['exports'][_0x8358('0x6')],oldToken);}var _0x3a0bd9={'uri':_0x583720,'method':_0x8358('0x10'),'timeout':0xea60,'json':!![]};return rp(_0x3a0bd9)[_0x8358('0x11')](function(_0x12fd8f){_0x49d515(_0x12fd8f);})[_0x8358('0x12')](function(_0x3fea96){_0x11d369(_0x3fea96);});});}function encryptDate(_0xf6d13f){var _0x3cf276=crypto[_0x8358('0x13')](_0x8358('0x14'),config[_0x8358('0x15')][_0x8358('0x16')]);var _0xc9a911=_0x3cf276[_0x8358('0x17')](_0xf6d13f,_0x8358('0x18'),'base64');_0xc9a911+=_0x3cf276['final'](_0x8358('0x19'));return _0xc9a911;}function decryptDate(_0x4bad9c){var _0x19da0b=crypto['createDecipher']('aes-256-ctr',config['secrets'][_0x8358('0x16')]);var _0x31d71f=_0x19da0b[_0x8358('0x17')](_0x4bad9c,_0x8358('0x19'),_0x8358('0x18'));_0x31d71f+=_0x19da0b[_0x8358('0x1a')](_0x8358('0x18'));return _0x31d71f;}function sendJiraAlert(_0x524bfb,_0x7695cd,_0x3f2701){var _0x4d5fb0=_0x8358('0x1b');return db[_0x8358('0x1c')][_0x8358('0x1d')]({'where':{'role':_0x8358('0x1e')},'attributes':['fullname','email'],'raw':!![]})[_0x8358('0x11')](function(_0x177c4f){ADMIN=_0x177c4f;_0x4d5fb0+=_0x8358('0x1f')+_0x3f2701+'|\x0a';_0x4d5fb0+='|uuid|'+_0x524bfb+'|\x0a';_0x4d5fb0+='|machineUuid|'+_0x7695cd+'|\x0a';_0x4d5fb0+=_0x8358('0x20')+ADMIN['fullname']+'|\x0a';_0x4d5fb0+=_0x8358('0x21')+ADMIN[_0x8358('0x22')]+'|\x0a';return _0x4d5fb0;})[_0x8358('0x11')](function(_0x21e9ad){var _0x25d82a=hardware[_0x8358('0x23')]()[_0x8358('0x24')];return jira['openIssue']({'key':_0x8358('0x25'),'summary':'Motion\x20License\x20Alert','description':_0x21e9ad,'issuetype':_0x8358('0x26'),'oldToken':_0x524bfb,'newToken':_0x7695cd,'email':ADMIN['email'],'name':ADMIN[_0x8358('0x27')],'reason':GRAY_PERIOD_REASON,'ip':_0x25d82a});});}function manageLicense(_0x1beaa7,_0x3a707c){var _0x542499=_0x3a707c[_0x8358('0x28')]({'plain':!![]});httpRequest(_0x1beaa7)[_0x8358('0x11')](function(_0x12dc59){if(oldToken){oldToken=undefined;}if(_0x12dc59[_0x8358('0x29')]){if(!_0x542499[_0x8358('0xa')]&&_0x542499[_0x8358('0xa')]!=_0x12dc59[_0x8358('0xa')]||_0x542499['license']&&_0x542499[_0x8358('0x2a')]){logger[_0x8358('0x2b')](_0x8358('0x2c'));}if(_0x542499[_0x8358('0xa')]&&!_0x542499[_0x8358('0x2a')]&&_0x542499[_0x8358('0xa')]!=_0x12dc59[_0x8358('0xa')]){logger[_0x8358('0x2b')](_0x8358('0x2d'));}if(_0x542499[_0x8358('0xa')]&&!_0x542499[_0x8358('0x2a')]&&_0x542499[_0x8358('0xa')]==_0x12dc59[_0x8358('0xa')]){return _0x3a707c;}return _0x3a707c['update']({'data1':_0x1beaa7,'data2':null,'license':_0x12dc59[_0x8358('0xa')]});}else{if(_0x12dc59['license']||_0x542499['license']){if(!_0x542499[_0x8358('0x2a')]){if(_0x542499[_0x8358('0x2e')]==_0x1beaa7){GRAY_PERIOD_REASON=_0x8358('0x2f');logger[_0x8358('0x2b')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x8358('0x30');oldToken=_0x542499[_0x8358('0x2e')];logger[_0x8358('0x2b')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x542499[_0x8358('0x2e')],_0x1beaa7);}sendJiraAlert(_0x542499[_0x8358('0x2e')],_0x12dc59[_0x8358('0x31')],GRAY_PERIOD_REASON);logger[_0x8358('0x2b')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x8358('0x32')](),moment()['format'](_0x8358('0x33')));return _0x3a707c[_0x8358('0x17')]({'data2':encryptDate(moment()[_0x8358('0xc')](_0x8358('0x33')))});}else{if(moment()[_0x8358('0x34')](decryptDate(_0x542499[_0x8358('0x2a')]),_0x8358('0x35'))>DAYS){logger[_0x8358('0x2b')](_0x8358('0x36'),moment()[_0x8358('0xc')](_0x8358('0x33')));return _0x3a707c['update']({'data1':_0x1beaa7,'data2':null,'license':null});}}}else{if(_0x542499['data1']!=_0x1beaa7){logger[_0x8358('0x2b')](_0x8358('0x37'),_0x542499[_0x8358('0x2e')],_0x1beaa7);return _0x3a707c[_0x8358('0x17')]({'data1':_0x1beaa7,'data2':null,'license':null});}}}return _0x3a707c;})['then'](function(_0x5a2e9d){_0x3a707c=_0x5a2e9d;})[_0x8358('0x12')](function(_0x45c08b){logger[_0x8358('0x38')](_0x45c08b[_0x8358('0x39')]);})[_0x8358('0x3a')](function(){setTimeout(function(){manageLicense(hardware[_0x8358('0x3b')](),_0x3a707c);},TIME);});}function defaultLicense(){var _0x4b7186=hardware[_0x8358('0x3b')]();if(_0x4b7186){return db[_0x8358('0x3c')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x4b7186}})[_0x8358('0x3d')](function(_0x9aced3,_0x26ef7c){logger[_0x8358('0x2b')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x4b7186);manageLicense(_0x4b7186,_0x9aced3);})[_0x8358('0x12')](function(_0x2a4b27){logger[_0x8358('0x38')](_0x2a4b27['message']);});}}exports[_0x8358('0x3e')]=defaultLicense;
\ No newline at end of file
+var _0x896e=['../../mysqldb','../environment','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','aes-256-ctr','secrets','session','update','utf8','base64','final','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','|uuid|','|machineUuid|','|name|','email','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','uuid','YYYY-MM-DD\x20HH:mm','format','diff','days','DEMO\x20START\x20AT\x20%s','message','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','util','crypto','moment','request-promise','bluebird','pkginfo','version'];(function(_0x28593d,_0x387aaf){var _0x3d3e81=function(_0x483032){while(--_0x483032){_0x28593d['push'](_0x28593d['shift']());}};_0x3d3e81(++_0x387aaf);}(_0x896e,0x1e9));var _0xe896=function(_0x3d0e5b,_0x17d15d){_0x3d0e5b=_0x3d0e5b-0x0;var _0x4669d9=_0x896e[_0x3d0e5b];return _0x4669d9;};'use strict';var util=require(_0xe896('0x0'));var crypto=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var rp=require(_0xe896('0x3'));var BPromise=require(_0xe896('0x4'));var pkginfo=require(_0xe896('0x5'))(module,_0xe896('0x6'));var db=require(_0xe896('0x7'))['db'];var config=require(_0xe896('0x8'));var hardware=require(_0xe896('0x9'));var logger=require(_0xe896('0xa'))(_0xe896('0xb'));var jira=require('../../api/jira/jira.controller');var HOST=_0xe896('0xc');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x7a0721){return new BPromise(function(_0x3b902c,_0x264eeb){var _0x43c619=util['format'](_0xe896('0xd'),HOST,_0x7a0721,module[_0xe896('0xe')][_0xe896('0x6')]);if(oldToken){_0x43c619=util['format'](_0xe896('0xf'),HOST,_0x7a0721,module['exports'][_0xe896('0x6')],oldToken);}var _0x5be679={'uri':_0x43c619,'method':_0xe896('0x10'),'timeout':0xea60,'json':!![]};return rp(_0x5be679)[_0xe896('0x11')](function(_0xa00ae9){_0x3b902c(_0xa00ae9);})['catch'](function(_0x3c531e){_0x264eeb(_0x3c531e);});});}function encryptDate(_0x4452cd){var _0x3e8ac9=crypto['createCipher'](_0xe896('0x12'),config[_0xe896('0x13')][_0xe896('0x14')]);var _0x5383b7=_0x3e8ac9[_0xe896('0x15')](_0x4452cd,_0xe896('0x16'),_0xe896('0x17'));_0x5383b7+=_0x3e8ac9['final']('base64');return _0x5383b7;}function decryptDate(_0x446ce2){var _0x25606b=crypto['createDecipher']('aes-256-ctr',config[_0xe896('0x13')][_0xe896('0x14')]);var _0x57f04b=_0x25606b[_0xe896('0x15')](_0x446ce2,'base64',_0xe896('0x16'));_0x57f04b+=_0x25606b[_0xe896('0x18')](_0xe896('0x16'));return _0x57f04b;}function sendJiraAlert(_0x5dc89d,_0x782813,_0x9714f1){var _0xdcdba8=_0xe896('0x19');return db[_0xe896('0x1a')][_0xe896('0x1b')]({'where':{'role':_0xe896('0x1c')},'attributes':[_0xe896('0x1d'),'email'],'raw':!![]})[_0xe896('0x11')](function(_0x5e1f29){ADMIN=_0x5e1f29;_0xdcdba8+='|reason|'+_0x9714f1+'|\x0a';_0xdcdba8+=_0xe896('0x1e')+_0x5dc89d+'|\x0a';_0xdcdba8+=_0xe896('0x1f')+_0x782813+'|\x0a';_0xdcdba8+=_0xe896('0x20')+ADMIN[_0xe896('0x1d')]+'|\x0a';_0xdcdba8+='|email|'+ADMIN[_0xe896('0x21')]+'|\x0a';return _0xdcdba8;})['then'](function(_0x5001f7){var _0x45dd49=hardware[_0xe896('0x22')]()[_0xe896('0x23')];return jira[_0xe896('0x24')]({'key':_0xe896('0x25'),'summary':_0xe896('0x26'),'description':_0x5001f7,'issuetype':_0xe896('0x27'),'oldToken':_0x5dc89d,'newToken':_0x782813,'email':ADMIN['email'],'name':ADMIN[_0xe896('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x45dd49});});}function manageLicense(_0x163a75,_0xc3cd05){var _0x569d5f=_0xc3cd05[_0xe896('0x28')]({'plain':!![]});httpRequest(_0x163a75)[_0xe896('0x11')](function(_0x2bc11d){if(oldToken){oldToken=undefined;}if(_0x2bc11d[_0xe896('0x29')]){if(!_0x569d5f[_0xe896('0xb')]&&_0x569d5f[_0xe896('0xb')]!=_0x2bc11d['license']||_0x569d5f[_0xe896('0xb')]&&_0x569d5f[_0xe896('0x2a')]){logger[_0xe896('0x2b')](_0xe896('0x2c'));}if(_0x569d5f[_0xe896('0xb')]&&!_0x569d5f['data2']&&_0x569d5f['license']!=_0x2bc11d['license']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x569d5f[_0xe896('0xb')]&&!_0x569d5f[_0xe896('0x2a')]&&_0x569d5f[_0xe896('0xb')]==_0x2bc11d[_0xe896('0xb')]){return _0xc3cd05;}return _0xc3cd05[_0xe896('0x15')]({'data1':_0x163a75,'data2':null,'license':_0x2bc11d[_0xe896('0xb')]});}else{if(_0x2bc11d[_0xe896('0xb')]||_0x569d5f[_0xe896('0xb')]){if(!_0x569d5f['data2']){if(_0x569d5f['data1']==_0x163a75){GRAY_PERIOD_REASON=_0xe896('0x2d');logger[_0xe896('0x2b')](_0xe896('0x2e'));}else{GRAY_PERIOD_REASON=_0xe896('0x2f');oldToken=_0x569d5f['data1'];logger[_0xe896('0x2b')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x569d5f['data1'],_0x163a75);}sendJiraAlert(_0x569d5f[_0xe896('0x30')],_0x2bc11d[_0xe896('0x31')],GRAY_PERIOD_REASON);logger[_0xe896('0x2b')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xe896('0x32')));return _0xc3cd05[_0xe896('0x15')]({'data2':encryptDate(moment()[_0xe896('0x33')](_0xe896('0x32')))});}else{if(moment()[_0xe896('0x34')](decryptDate(_0x569d5f['data2']),_0xe896('0x35'))>DAYS){logger[_0xe896('0x2b')](_0xe896('0x36'),moment()[_0xe896('0x33')](_0xe896('0x32')));return _0xc3cd05[_0xe896('0x15')]({'data1':_0x163a75,'data2':null,'license':null});}}}else{if(_0x569d5f[_0xe896('0x30')]!=_0x163a75){logger[_0xe896('0x2b')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x569d5f[_0xe896('0x30')],_0x163a75);return _0xc3cd05[_0xe896('0x15')]({'data1':_0x163a75,'data2':null,'license':null});}}}return _0xc3cd05;})['then'](function(_0xc5eedb){_0xc3cd05=_0xc5eedb;})['catch'](function(_0x43ecc4){logger['error'](_0x43ecc4[_0xe896('0x37')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xe896('0x38')](),_0xc3cd05);},TIME);});}function defaultLicense(){var _0x470c29=hardware[_0xe896('0x38')]();if(_0x470c29){return db[_0xe896('0x39')][_0xe896('0x3a')]({'where':{'id':0x1},'defaults':{'data1':_0x470c29}})['spread'](function(_0x480b8a,_0x203aea){logger[_0xe896('0x2b')](_0xe896('0x3b'),_0x470c29);manageLicense(_0x470c29,_0x480b8a);})[_0xe896('0x3c')](function(_0x2ff489){logger['error'](_0x2ff489['message']);});}}exports[_0xe896('0x3d')]=defaultLicense;
\ No newline at end of file
diff --git a/server/config/license/util.js b/server/config/license/util.js
index cf8a8c1..2c5ffd1 100644
--- a/server/config/license/util.js
+++ b/server/config/license/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4ea=['Demo\x20license','getLicense','License','find','checkLicense','util','lodash','moment','../../mysqldb','license','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','parse','demo','uuid','machineUuid','getUuid','secrets','session','gray','deadline','add','days','changed','disabled','2027-01-01T00:00:00.000Z'];(function(_0x1825ac,_0x3eb421){var _0xc4551=function(_0x33e9ae){while(--_0x33e9ae){_0x1825ac['push'](_0x1825ac['shift']());}};_0xc4551(++_0x3eb421);}(_0xc4ea,0x1ef));var _0xac4e=function(_0x33b0bc,_0x3b8f26){_0x33b0bc=_0x33b0bc-0x0;var _0x1a2057=_0xc4ea[_0x33b0bc];return _0x1a2057;};'use strict';var crypto=require('crypto');var util=require(_0xac4e('0x0'));var _=require(_0xac4e('0x1'));var moment=require(_0xac4e('0x2'));var hardware=require('./hardware');var config=require('../environment');var db=require(_0xac4e('0x3'))['db'];function checkLicense(_0x361d99,_0x2db72c){if(_0x361d99){try{var _0x3b0539=_0x2db72c||_0x361d99[_0xac4e('0x4')];if(_['isEmpty'](_0x3b0539)){throw new Error(_0xac4e('0x5'));}var _0x44b905=_0x361d99[_0xac4e('0x6')];var _0x2ee5d4=_0x361d99[_0xac4e('0x7')];var _0x336798=_0x44b905[_0xac4e('0x8')]('-')[0x4];var _0x4e56d2=_0x44b905[_0xac4e('0x8')]('-')[0x0];var _0x191130=crypto[_0xac4e('0x9')]('aes-256-ctr',util[_0xac4e('0xa')](_0xac4e('0xb'),_0x336798,_0x44b905,_0x4e56d2));var _0x138e74=_0x191130[_0xac4e('0xc')](_0x3b0539,_0xac4e('0xd'),_0xac4e('0xe'));_0x138e74+=_0x191130[_0xac4e('0xf')](_0xac4e('0xe'));var _0x139eb2=JSON[_0xac4e('0x10')](_0x138e74);_0x139eb2[_0xac4e('0x11')]=![];_0x139eb2[_0xac4e('0x12')]=_0x44b905;_0x139eb2[_0xac4e('0x13')]=hardware[_0xac4e('0x14')]();if(_0x2ee5d4){var _0x5cf65c=crypto[_0xac4e('0x9')]('aes-256-ctr',config[_0xac4e('0x15')][_0xac4e('0x16')]);var _0x507592=_0x5cf65c[_0xac4e('0xc')](_0x2ee5d4,_0xac4e('0xd'),_0xac4e('0xe'));_0x507592+=_0x5cf65c[_0xac4e('0xf')]('utf8');_0x139eb2[_0xac4e('0x17')]=_0x507592;_0x139eb2[_0xac4e('0x18')]=moment(_0x507592)[_0xac4e('0x19')](0x7,_0xac4e('0x1a'))['format']();_0x139eb2['grayReason']=_0x139eb2[_0xac4e('0x12')]!=_0x139eb2[_0xac4e('0x13')]?_0xac4e('0x1b'):_0xac4e('0x1c');}return _0x139eb2;}catch(_0x28d0b2){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xac4e('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x361d99[_0xac4e('0x6')],'machineUuid':hardware[_0xac4e('0x14')](),'message':_0x28d0b2['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xac4e('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xac4e('0x1e'),'uuid':_0x361d99[_0xac4e('0x6')],'machineUuid':hardware[_0xac4e('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0xac4e('0x1f')]=function(_0x5a5511){return db[_0xac4e('0x20')][_0xac4e('0x21')](_['defaults'](_0x5a5511,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5ab54e){return checkLicense(_0x5ab54e,null);});};exports[_0xac4e('0x22')]=checkLicense;
\ No newline at end of file
+var _0x4bf4=['checkLicense','crypto','lodash','../environment','../../mysqldb','license','isEmpty','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','base64','utf8','final','parse','demo','getUuid','secrets','session','update','gray','deadline','add','grayReason','machineUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','getLicense','License','find','defaults'];(function(_0x4a6362,_0x9e782a){var _0x2653a5=function(_0x52b12b){while(--_0x52b12b){_0x4a6362['push'](_0x4a6362['shift']());}};_0x2653a5(++_0x9e782a);}(_0x4bf4,0xef));var _0x44bf=function(_0x5e2320,_0x245774){_0x5e2320=_0x5e2320-0x0;var _0x254ea9=_0x4bf4[_0x5e2320];return _0x254ea9;};'use strict';var crypto=require(_0x44bf('0x0'));var util=require('util');var _=require(_0x44bf('0x1'));var moment=require('moment');var hardware=require('./hardware');var config=require(_0x44bf('0x2'));var db=require(_0x44bf('0x3'))['db'];function checkLicense(_0x517710,_0x33895e){if(_0x517710){try{var _0x235e05=_0x33895e||_0x517710[_0x44bf('0x4')];if(_[_0x44bf('0x5')](_0x235e05)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x33a9ba=_0x517710[_0x44bf('0x6')];var _0x197ccf=_0x517710['data2'];var _0x520849=_0x33a9ba['split']('-')[0x4];var _0x39adbd=_0x33a9ba[_0x44bf('0x7')]('-')[0x0];var _0x5b555c=crypto[_0x44bf('0x8')](_0x44bf('0x9'),util['format'](_0x44bf('0xa'),_0x520849,_0x33a9ba,_0x39adbd));var _0x15a250=_0x5b555c['update'](_0x235e05,_0x44bf('0xb'),_0x44bf('0xc'));_0x15a250+=_0x5b555c[_0x44bf('0xd')](_0x44bf('0xc'));var _0x1b8b6b=JSON[_0x44bf('0xe')](_0x15a250);_0x1b8b6b[_0x44bf('0xf')]=![];_0x1b8b6b['uuid']=_0x33a9ba;_0x1b8b6b['machineUuid']=hardware[_0x44bf('0x10')]();if(_0x197ccf){var _0x3ee676=crypto[_0x44bf('0x8')](_0x44bf('0x9'),config[_0x44bf('0x11')][_0x44bf('0x12')]);var _0x19b8da=_0x3ee676[_0x44bf('0x13')](_0x197ccf,_0x44bf('0xb'),_0x44bf('0xc'));_0x19b8da+=_0x3ee676[_0x44bf('0xd')](_0x44bf('0xc'));_0x1b8b6b[_0x44bf('0x14')]=_0x19b8da;_0x1b8b6b[_0x44bf('0x15')]=moment(_0x19b8da)[_0x44bf('0x16')](0x7,'days')['format']();_0x1b8b6b[_0x44bf('0x17')]=_0x1b8b6b['uuid']!=_0x1b8b6b[_0x44bf('0x18')]?'changed':'disabled';}return _0x1b8b6b;}catch(_0x42c85d){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x44bf('0x19'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x44bf('0x1a'),'uuid':_0x517710[_0x44bf('0x6')],'machineUuid':hardware[_0x44bf('0x10')](),'message':_0x42c85d[_0x44bf('0x1b')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x44bf('0x19'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x44bf('0x1c'),'uuid':_0x517710['data1'],'machineUuid':hardware[_0x44bf('0x10')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0x44bf('0x1d')]=function(_0x51413e){return db[_0x44bf('0x1e')][_0x44bf('0x1f')](_[_0x44bf('0x20')](_0x51413e,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2cae55){return checkLicense(_0x2cae55,null);});};exports[_0x44bf('0x21')]=checkLicense;
\ No newline at end of file
diff --git a/server/config/local.env.js b/server/config/local.env.js
index 1b24a76..a3ad523 100644
--- a/server/config/local.env.js
+++ b/server/config/local.env.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x85cf=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x246890,_0x46b964){var _0x2b2a5a=function(_0x4f1232){while(--_0x4f1232){_0x246890['push'](_0x246890['shift']());}};_0x2b2a5a(++_0x46b964);}(_0x85cf,0x76));var _0xf85c=function(_0xfde94a,_0x23a49b){_0xfde94a=_0xfde94a-0x0;var _0x1d0aee=_0x85cf[_0xfde94a];return _0x1d0aee;};'use strict';module['exports']={'DOMAIN':_0xf85c('0x0'),'SESSION_SECRET':_0xf85c('0x1'),'GOOGLE_ID':_0xf85c('0x2'),'GOOGLE_SECRET':_0xf85c('0x3'),'DEBUG':''};
\ No newline at end of file
+var _0xe495=['myappanuglar-secret','app-id','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe495,0xfe));var _0x5e49=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xe495[_0x29d915];return _0x160f86;};'use strict';module[_0x5e49('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x5e49('0x1'),'GOOGLE_ID':_0x5e49('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
diff --git a/server/config/logger.js b/server/config/logger.js
index e158252..df310d2 100644
--- a/server/config/logger.js
+++ b/server/config/logger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f83=['INFO','join','/var','xcally','format','%s-%s.log','message','exports','File','error','info','transports','Console','moment','path'];(function(_0x4279ea,_0x8c9fc2){var _0x151c20=function(_0x4f8a5f){while(--_0x4f8a5f){_0x4279ea['push'](_0x4279ea['shift']());}};_0x151c20(++_0x8c9fc2);}(_0x5f83,0x1ed));var _0x35f8=function(_0x9442b7,_0x56fbd8){_0x9442b7=_0x9442b7-0x0;var _0x1a2b51=_0x5f83[_0x9442b7];return _0x1a2b51;};'use strict';var moment=require(_0x35f8('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x35f8('0x1'));var debugLevel=_0x35f8('0x2');function filename(_0x39b868,_0x7b4e33){return path[_0x35f8('0x3')](_0x35f8('0x4'),'log',_0x35f8('0x5'),util[_0x35f8('0x6')](_0x35f8('0x7'),_0x39b868,_0x7b4e33));}function formatter(_0x1d42ed,_0x4bbd4f){return util[_0x35f8('0x6')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x35f8('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4bbd4f['level']['toUpperCase'](),_0x1d42ed,_0x4bbd4f[_0x35f8('0x8')]);}module[_0x35f8('0x9')]=function(_0x19d48){return new winston['Logger']({'transports':[new winston['transports'][(_0x35f8('0xa'))]({'name':util[_0x35f8('0x6')]('%s-%s',_0x19d48,'error'),'filename':filename(_0x19d48,_0x35f8('0xb')),'level':_0x35f8('0xb'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xbf5f7c){return formatter(_0x19d48,_0xbf5f7c);}}),new winston['transports'][(_0x35f8('0xa'))]({'name':util[_0x35f8('0x6')]('%s-%s',_0x19d48,_0x35f8('0xc')),'filename':filename(_0x19d48,_0x35f8('0xc')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x11e720){return formatter(_0x19d48,_0x11e720);}}),new winston[(_0x35f8('0xd'))][(_0x35f8('0xe'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x32eca6){return formatter(_0x19d48,_0x32eca6);}})]});};
\ No newline at end of file
+var _0x9e1e=['winston','INFO','join','/var','log','%s-%s.log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','Logger','transports','error','%s-%s','info','Console','env','debugLevel','moment'];(function(_0x388949,_0x11638a){var _0x27230e=function(_0x1dca11){while(--_0x1dca11){_0x388949['push'](_0x388949['shift']());}};_0x27230e(++_0x11638a);}(_0x9e1e,0x12b));var _0xe9e1=function(_0x121bd0,_0x136db0){_0x121bd0=_0x121bd0-0x0;var _0x481cd1=_0x9e1e[_0x121bd0];return _0x481cd1;};'use strict';var moment=require(_0xe9e1('0x0'));var winston=require(_0xe9e1('0x1'));var util=require('util');var path=require('path');var debugLevel=_0xe9e1('0x2');function filename(_0x4386bf,_0x5b2d95){return path[_0xe9e1('0x3')](_0xe9e1('0x4'),_0xe9e1('0x5'),'xcally',util['format'](_0xe9e1('0x6'),_0x4386bf,_0x5b2d95));}function formatter(_0x692f48,_0x12c0e3){return util[_0xe9e1('0x7')](_0xe9e1('0x8'),moment()[_0xe9e1('0x7')](_0xe9e1('0x9')),_0x12c0e3['level'][_0xe9e1('0xa')](),_0x692f48,_0x12c0e3[_0xe9e1('0xb')]);}module['exports']=function(_0x2cd38f){return new winston[(_0xe9e1('0xc'))]({'transports':[new winston[(_0xe9e1('0xd'))]['File']({'name':util[_0xe9e1('0x7')]('%s-%s',_0x2cd38f,_0xe9e1('0xe')),'filename':filename(_0x2cd38f,_0xe9e1('0xe')),'level':_0xe9e1('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2c7e6d){return formatter(_0x2cd38f,_0x2c7e6d);}}),new winston[(_0xe9e1('0xd'))]['File']({'name':util[_0xe9e1('0x7')](_0xe9e1('0xf'),_0x2cd38f,'info'),'filename':filename(_0x2cd38f,_0xe9e1('0x10')),'level':_0xe9e1('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x312604){return formatter(_0x2cd38f,_0x312604);}}),new winston[(_0xe9e1('0xd'))][(_0xe9e1('0x11'))]({'level':process[_0xe9e1('0x12')][_0xe9e1('0x13')]||debugLevel,'json':![],'formatter':function(_0x1f083d){return formatter(_0x2cd38f,_0x1f083d);}})]});};
\ No newline at end of file
diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js
index e8dea15..b020889 100644
--- a/server/config/pm2/config.js
+++ b/server/config/pm2/config.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5b6b=['exports','path','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js'];(function(_0x1b7afa,_0x4be0ea){var _0x570d2c=function(_0xf743ec){while(--_0xf743ec){_0x1b7afa['push'](_0x1b7afa['shift']());}};_0x570d2c(++_0x4be0ea);}(_0x5b6b,0x121));var _0xb5b6=function(_0x56ae7d,_0x2455e0){_0x56ae7d=_0x56ae7d-0x0;var _0x43bf23=_0x5b6b[_0x56ae7d];return _0x43bf23;};'use strict';var path=require(_0xb5b6('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xb5b6('0x1')](__dirname,'../../services/express/index.js')},{'name':_0xb5b6('0x2'),'script':path[_0xb5b6('0x1')](__dirname,_0xb5b6('0x3'))},{'name':_0xb5b6('0x4'),'script':path[_0xb5b6('0x1')](__dirname,_0xb5b6('0x5'))},{'name':_0xb5b6('0x6'),'script':path[_0xb5b6('0x1')](__dirname,_0xb5b6('0x7'))},{'name':_0xb5b6('0x8'),'script':path[_0xb5b6('0x1')](__dirname,'../../services/routing/index.js')},{'name':_0xb5b6('0x9'),'script':path[_0xb5b6('0x1')](__dirname,_0xb5b6('0xa'))}]};module[_0xb5b6('0xb')]=config;
\ No newline at end of file
+var _0x6c09=['../../services/express/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','express','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c09,0x110));var _0x96c0=function(_0x378afa,_0x4a6cb3){_0x378afa=_0x378afa-0x0;var _0x3f9e8c=_0x6c09[_0x378afa];return _0x3f9e8c;};'use strict';var path=require(_0x96c0('0x0'));var os=require('os');var config={'apps':[{'name':_0x96c0('0x1'),'script':path[_0x96c0('0x2')](__dirname,_0x96c0('0x3'))},{'name':'ami','script':path[_0x96c0('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path['join'](__dirname,_0x96c0('0x4'))},{'name':_0x96c0('0x5'),'script':path[_0x96c0('0x2')](__dirname,_0x96c0('0x6'))},{'name':_0x96c0('0x7'),'script':path[_0x96c0('0x2')](__dirname,_0x96c0('0x8'))},{'name':_0x96c0('0x9'),'script':path[_0x96c0('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0x96c0('0xa')]=config;
\ No newline at end of file
diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js
index 3468fa6..ee6bf00 100644
--- a/server/config/pm2/index.js
+++ b/server/config/pm2/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7a7=['then','restart','list','describe','delete','dump','pm2','bluebird','./config','connected','start','disconnect','stop'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xb7a7,0x6e));var _0x7b7a=function(_0x305081,_0x4fec5f){_0x305081=_0x305081-0x0;var _0xc5684e=_0xb7a7[_0x305081];return _0xc5684e;};'use strict';var pm2=require(_0x7b7a('0x0'));var BPromise=require(_0x7b7a('0x1'));var config=require(_0x7b7a('0x2'));function connect(){return new BPromise(function(_0x2750c2,_0xdc2ef1){return pm2['connect'](function(_0x51de97){if(_0x51de97){return _0xdc2ef1(_0x51de97);}return _0x2750c2(_0x7b7a('0x3'));});});};exports[_0x7b7a('0x4')]=function(_0x42d678){return connect()['then'](function(){return new BPromise(function(_0x8a892f,_0x6e7b3c){return pm2[_0x7b7a('0x4')](_0x42d678,function(_0xf003bc,_0x8e6a84){if(_0xf003bc){return _0x6e7b3c(_0xf003bc);}pm2[_0x7b7a('0x5')]();return _0x8a892f(_0x8e6a84);});});});};exports[_0x7b7a('0x6')]=function(_0x2e09b4){return connect()[_0x7b7a('0x7')](function(){return new BPromise(function(_0x4ae895,_0x3f1125){return pm2['stop'](_0x2e09b4,function(_0x14ed0e,_0x21c573){if(_0x14ed0e){return _0x3f1125(_0x14ed0e);}pm2[_0x7b7a('0x5')]();return _0x4ae895(_0x21c573);});});});};exports[_0x7b7a('0x8')]=function(_0x156e80){return connect()['then'](function(){return new BPromise(function(_0x5207bb,_0x56c0b8){return pm2['restart'](_0x156e80,function(_0x430256,_0x1413f8){if(_0x430256){return _0x56c0b8(_0x430256);}pm2['disconnect']();return _0x5207bb(_0x1413f8);});});});};exports[_0x7b7a('0x9')]=function(){return connect()[_0x7b7a('0x7')](function(){return new BPromise(function(_0x318b50,_0x3776a4){return pm2[_0x7b7a('0x9')](function(_0x24e334,_0x2a8585){if(_0x24e334){return _0x3776a4(_0x24e334);}pm2[_0x7b7a('0x5')]();return _0x318b50(_0x2a8585);});});});};exports[_0x7b7a('0xa')]=function(_0x3b1998){return connect()['then'](function(){return new BPromise(function(_0x582062,_0x150104){return pm2[_0x7b7a('0xa')](_0x3b1998,function(_0x3a10a9,_0x41f0a8){if(_0x3a10a9){return _0x150104(_0x3a10a9);}pm2[_0x7b7a('0x5')]();return _0x582062(_0x41f0a8);});});});};exports['delete']=function(_0x36d78d){return connect()['then'](function(){return new BPromise(function(_0x430c11,_0x763b6){return pm2[_0x7b7a('0xb')](_0x36d78d,function(_0x35e2d4,_0x2569bd){if(_0x35e2d4){return _0x763b6(_0x35e2d4);}pm2[_0x7b7a('0x5')]();return _0x430c11(_0x2569bd);});});});};exports[_0x7b7a('0xc')]=function(){return connect()[_0x7b7a('0x7')](function(){return new BPromise(function(_0x2cb0b4,_0x1c897d){return pm2[_0x7b7a('0xc')](function(_0x402794){if(_0x402794){return _0x1c897d(_0x402794);}return _0x2cb0b4('saved');});});});};
\ No newline at end of file
+var _0xaa5c=['describe','delete','dump','saved','pm2','bluebird','./config','start','disconnect','stop','restart','then','list'];(function(_0xb2e98d,_0x31daa1){var _0x56a0eb=function(_0x102910){while(--_0x102910){_0xb2e98d['push'](_0xb2e98d['shift']());}};_0x56a0eb(++_0x31daa1);}(_0xaa5c,0x1f2));var _0xcaa5=function(_0x5b471c,_0x1c11ef){_0x5b471c=_0x5b471c-0x0;var _0x431435=_0xaa5c[_0x5b471c];return _0x431435;};'use strict';var pm2=require(_0xcaa5('0x0'));var BPromise=require(_0xcaa5('0x1'));var config=require(_0xcaa5('0x2'));function connect(){return new BPromise(function(_0xecb40a,_0x54ad1c){return pm2['connect'](function(_0x5c4f66){if(_0x5c4f66){return _0x54ad1c(_0x5c4f66);}return _0xecb40a('connected');});});};exports[_0xcaa5('0x3')]=function(_0x4d1b66){return connect()['then'](function(){return new BPromise(function(_0x2f6bb0,_0x42afd4){return pm2[_0xcaa5('0x3')](_0x4d1b66,function(_0x5f56bc,_0x3d0a81){if(_0x5f56bc){return _0x42afd4(_0x5f56bc);}pm2[_0xcaa5('0x4')]();return _0x2f6bb0(_0x3d0a81);});});});};exports[_0xcaa5('0x5')]=function(_0x1b8683){return connect()['then'](function(){return new BPromise(function(_0xce54c8,_0x11b4d1){return pm2['stop'](_0x1b8683,function(_0x559041,_0x283f07){if(_0x559041){return _0x11b4d1(_0x559041);}pm2[_0xcaa5('0x4')]();return _0xce54c8(_0x283f07);});});});};exports[_0xcaa5('0x6')]=function(_0x52481f){return connect()[_0xcaa5('0x7')](function(){return new BPromise(function(_0x57bf00,_0x3bf106){return pm2[_0xcaa5('0x6')](_0x52481f,function(_0xba44bd,_0x3b8783){if(_0xba44bd){return _0x3bf106(_0xba44bd);}pm2[_0xcaa5('0x4')]();return _0x57bf00(_0x3b8783);});});});};exports[_0xcaa5('0x8')]=function(){return connect()[_0xcaa5('0x7')](function(){return new BPromise(function(_0x4bf6f7,_0x2f78a6){return pm2[_0xcaa5('0x8')](function(_0x474770,_0x295c9f){if(_0x474770){return _0x2f78a6(_0x474770);}pm2[_0xcaa5('0x4')]();return _0x4bf6f7(_0x295c9f);});});});};exports[_0xcaa5('0x9')]=function(_0x3e1c8e){return connect()[_0xcaa5('0x7')](function(){return new BPromise(function(_0x8b7ad5,_0x53e67f){return pm2[_0xcaa5('0x9')](_0x3e1c8e,function(_0x47eb0f,_0x17e3d2){if(_0x47eb0f){return _0x53e67f(_0x47eb0f);}pm2[_0xcaa5('0x4')]();return _0x8b7ad5(_0x17e3d2);});});});};exports['delete']=function(_0x37ced2){return connect()[_0xcaa5('0x7')](function(){return new BPromise(function(_0x2111ac,_0x7dad0b){return pm2[_0xcaa5('0xa')](_0x37ced2,function(_0x518928,_0x20b4e3){if(_0x518928){return _0x7dad0b(_0x518928);}pm2[_0xcaa5('0x4')]();return _0x2111ac(_0x20b4e3);});});});};exports[_0xcaa5('0xb')]=function(){return connect()[_0xcaa5('0x7')](function(){return new BPromise(function(_0x5ec417,_0x843c06){return pm2['dump'](function(_0x93f6d4){if(_0x93f6d4){return _0x843c06(_0x93f6d4);}return _0x5ec417(_0xcaa5('0xc'));});});});};
\ No newline at end of file
diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js
index ad51ab3..1229528 100644
--- a/server/config/schedule/chat.js
+++ b/server/config/schedule/chat.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d1d=['length','emit','chatInteraction:update','catch','error','moment','ioredis','../../mysqldb','../../config/environment','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','update','system','format','YYYY-MM-DD\x20HH:mm:ss','map'];(function(_0x2b31a8,_0x28b862){var _0x1175a5=function(_0x2cdb5d){while(--_0x2cdb5d){_0x2b31a8['push'](_0x2b31a8['shift']());}};_0x1175a5(++_0x28b862);}(_0x3d1d,0xb4));var _0xd3d1=function(_0x2ec411,_0x4fd58c){_0x2ec411=_0x2ec411-0x0;var _0x1aa774=_0x3d1d[_0x2ec411];return _0x1aa774;};'use strict';var _=require('lodash');var moment=require(_0xd3d1('0x0'));var Redis=require(_0xd3d1('0x1'));var db=require(_0xd3d1('0x2'))['db'];var config=require(_0xd3d1('0x3'));config[_0xd3d1('0x4')]=_['defaults'](config[_0xd3d1('0x4')],{'host':_0xd3d1('0x5'),'port':0x18eb});var io=require(_0xd3d1('0x6'))(new Redis(config[_0xd3d1('0x4')]));function closeInteractions(){var _0x3227aa=0x0;var _0x4fc4ab=[];return db[_0xd3d1('0x7')][_0xd3d1('0x8')]({'raw':!![],'attributes':['id',_0xd3d1('0x9')],'where':{'id':0x1}})[_0xd3d1('0xa')](function(_0x1fad2c){_0x3227aa=_0x1fad2c['chatTimeout'];if(_0x3227aa){return db[_0xd3d1('0xb')]['findAll']({'raw':!![],'attributes':['id',_0xd3d1('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd3d1('0xd')](_0x1fad2c[_0xd3d1('0x9')],_0xd3d1('0xe'))}}});}else{return[];}})[_0xd3d1('0xa')](function(_0x3be108){_0x4fc4ab=_0x3be108;if(_0x3227aa){return db[_0xd3d1('0xb')][_0xd3d1('0xf')]({'closeReason':_0xd3d1('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xd3d1('0x11')](_0xd3d1('0x12'))},{'where':{'id':_[_0xd3d1('0x13')](_0x4fc4ab||[],'id')}});}})['then'](function(_0x344dd6){for(var _0x108afb=0x0;_0x108afb<_0x4fc4ab[_0xd3d1('0x14')];_0x108afb++){io[_0xd3d1('0x15')](_0xd3d1('0x16'),{'id':_0x4fc4ab[_0x108afb]['id'],'closed':!![]});}})[_0xd3d1('0x17')](function(_0x41af85){console[_0xd3d1('0x18')](_0x41af85);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x2a83=['findAll','lastMsgAt','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','catch','error','lodash','moment','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then','ChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a83,0x89));var _0x32a8=function(_0x41c7d9,_0x372922){_0x41c7d9=_0x41c7d9-0x0;var _0x4169a4=_0x2a83[_0x41c7d9];return _0x4169a4;};'use strict';var _=require(_0x32a8('0x0'));var moment=require(_0x32a8('0x1'));var Redis=require(_0x32a8('0x2'));var db=require(_0x32a8('0x3'))['db'];var config=require(_0x32a8('0x4'));config[_0x32a8('0x5')]=_[_0x32a8('0x6')](config[_0x32a8('0x5')],{'host':_0x32a8('0x7'),'port':0x18eb});var io=require(_0x32a8('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x983188=0x0;var _0x71f272=[];return db['Setting'][_0x32a8('0x9')]({'raw':!![],'attributes':['id',_0x32a8('0xa')],'where':{'id':0x1}})[_0x32a8('0xb')](function(_0x52cb79){_0x983188=_0x52cb79['chatTimeout'];if(_0x983188){return db[_0x32a8('0xc')][_0x32a8('0xd')]({'raw':!![],'attributes':['id',_0x32a8('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x52cb79[_0x32a8('0xa')],_0x32a8('0xf'))}}});}else{return[];}})[_0x32a8('0xb')](function(_0x369556){_0x71f272=_0x369556;if(_0x983188){return db[_0x32a8('0xc')][_0x32a8('0x10')]({'closeReason':_0x32a8('0x11'),'disposition':_0x32a8('0x12'),'closed':!![],'closedAt':moment()[_0x32a8('0x13')](_0x32a8('0x14'))},{'where':{'id':_['map'](_0x71f272||[],'id')}});}})[_0x32a8('0xb')](function(_0x159877){for(var _0x55629b=0x0;_0x55629b<_0x71f272[_0x32a8('0x15')];_0x55629b++){io[_0x32a8('0x16')]('chatInteraction:update',{'id':_0x71f272[_0x55629b]['id'],'closed':!![]});}})[_0x32a8('0x17')](function(_0x41dd6a){console[_0x32a8('0x18')](_0x41dd6a);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js
index 0ef511f..ba1b537 100644
--- a/server/config/schedule/index.js
+++ b/server/config/schedule/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd156=['cron','active','isBetween','startAt','start','stop\x20cron','endAt','update','update\x20cron','run','util','moment','cron-job-manager','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','pass','email','user','bcc','format','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','email\x20sent','catch','error','error\x20mail','stringify','data','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','name','MailServerOut','keys','map','toString','keyBy','difference','length','exists','stop','delete\x20cron','toRun','index','resolve','run\x20job'];(function(_0x2e26e1,_0x2728de){var _0x5241f5=function(_0x3a3e15){while(--_0x3a3e15){_0x2e26e1['push'](_0x2e26e1['shift']());}};_0x5241f5(++_0x2728de);}(_0xd156,0x10f));var _0x6d15=function(_0x54a25b,_0x48f7c5){_0x54a25b=_0x54a25b-0x0;var _0x591489=_0xd156[_0x54a25b];return _0x591489;};'use strict';var fs=require('fs');var util=require(_0x6d15('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0x6d15('0x1'));var CronJobManager=require(_0x6d15('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x6d15('0x3'));var logger=require('../logger')(_0x6d15('0x4'));var db=require(_0x6d15('0x5'))['db'];var analyticCustomReportController=require(_0x6d15('0x6'));var analyticDefaultReportController=require(_0x6d15('0x7'));var client=jayson[_0x6d15('0x8')][_0x6d15('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4d2c80,_0x39809f){return function(){logger[_0x6d15('0xa')](_0x6d15('0xb'),_0x4d2c80['email']);var _0x3faac5=!![];var _0x25a7b4={'tls':{'rejectUnauthorized':![]}};if(_0x4d2c80[_0x6d15('0xc')][_0x6d15('0xd')][_0x6d15('0xe')]){_0x25a7b4['service']=_0x4d2c80['MailAccount']['Smtp'][_0x6d15('0xe')];}else{_0x25a7b4[_0x6d15('0xf')]=_0x4d2c80[_0x6d15('0xc')]['Smtp']['host'];_0x25a7b4[_0x6d15('0x10')]=_0x4d2c80[_0x6d15('0xc')][_0x6d15('0xd')]['port'];_0x25a7b4['secure']=_0x4d2c80['MailAccount']['Smtp']['secure'];}if(_0x4d2c80['MailAccount'][_0x6d15('0xd')]['authentication']){_0x25a7b4['auth']={'user':_0x4d2c80[_0x6d15('0xc')][_0x6d15('0xd')]['user'],'pass':_0x4d2c80[_0x6d15('0xc')][_0x6d15('0xd')][_0x6d15('0x11')]};}var _0x35c829={'account':_0x25a7b4,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4d2c80[_0x6d15('0xc')]['name'],_0x4d2c80['MailAccount'][_0x6d15('0x12')]||_0x4d2c80['MailAccount'][_0x6d15('0xd')][_0x6d15('0x13')]),'to':_0x4d2c80[_0x6d15('0x12')],'cc':_0x4d2c80['cc'],'bcc':_0x4d2c80[_0x6d15('0x14')],'subject':util[_0x6d15('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x39809f['name'],_0x4d2c80['subtractNumber'],_0x4d2c80[_0x6d15('0x16')])}};var _0x40f713=path[_0x6d15('0x17')](__dirname,_0x6d15('0x18'));var _0x5a340c=_0x39809f[_0x6d15('0x19')];var _0x476fba=util[_0x6d15('0x15')](_0x6d15('0x1a'),path[_0x6d15('0x1b')](_0x39809f[_0x6d15('0x19')],path[_0x6d15('0x1c')](_0x39809f[_0x6d15('0x19')])),_0x6d15('0x1d'));var _0x5b3f05=path['join'](_0x40f713,_0x5a340c);var _0x15d63a=path['join'](_0x40f713,_0x476fba);if(fs[_0x6d15('0x1e')](_0x5b3f05)){_0x39809f[_0x6d15('0x1f')]=_0x6d15('0x20');_0x35c829['message'][_0x6d15('0x21')]=[{'filename':_0x5a340c,'path':_0x5b3f05}];_0x35c829[_0x6d15('0x22')][_0x6d15('0x23')]=util['format'](_0x6d15('0x24'),JSON['stringify'](_0x39809f,null,0x2));}else if(fs[_0x6d15('0x1e')](_0x15d63a)){_0x39809f[_0x6d15('0x1f')]=_0x6d15('0x20');_0x35c829[_0x6d15('0x22')][_0x6d15('0x21')]=[{'filename':_0x476fba,'path':_0x15d63a}];}else{_0x35c829['message'][_0x6d15('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4d2c80[_0x6d15('0x25')]){_0x3faac5=![];logger[_0x6d15('0xa')](_0x6d15('0x26'));}}if(_0x3faac5){return client[_0x6d15('0x27')](_0x6d15('0x28'),_0x35c829)[_0x6d15('0x29')](function(_0x2b0066){if(_0x2b0066['error']){return logger['error']('error\x20mail',JSON['stringify'](_0x2b0066));}return logger[_0x6d15('0xa')](_0x6d15('0x2a'));})[_0x6d15('0x2b')](function(_0xe6f3a5){return logger[_0x6d15('0x2c')](_0x6d15('0x2d'),JSON['stringify'](_0xe6f3a5));});}};}function handleError(){return function(_0x4d775d){return logger[_0x6d15('0x2c')](JSON[_0x6d15('0x2e')](_0x4d775d));};}function handleResult(_0x3ee8ce){return function(_0x1096e0){logger[_0x6d15('0xa')](_0x6d15('0x2f'),JSON[_0x6d15('0x2e')](_0x1096e0));if(_0x3ee8ce[_0x6d15('0xc')]&&_0x3ee8ce[_0x6d15('0xc')][_0x6d15('0xd')]&&!_[_0x6d15('0x30')](_0x3ee8ce['email'])){setTimeout(handleSendEmail(_0x3ee8ce,_0x1096e0),0x3c*0x3e8);}};}function handleJob(_0x90d4bc){return function(){try{if(_[_0x6d15('0x30')](_0x90d4bc[_0x6d15('0x31')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x6d15('0x30')](_0x90d4bc[_0x6d15('0x16')])){return logger['info'](_0x6d15('0x32'));}var _0x4fb77c={'startDate':moment()[_0x6d15('0x33')](_0x90d4bc[_0x6d15('0x31')],_0x90d4bc['subtractUnit'])[_0x6d15('0x15')](_0x6d15('0x34')),'endDate':moment()[_0x6d15('0x15')](_0x6d15('0x34')),'type':_0x6d15('0x35'),'output':_0x90d4bc[_0x6d15('0x36')],'name':_0x90d4bc['name']};if(!_['isNil'](_0x90d4bc[_0x6d15('0x37')])){logger[_0x6d15('0xa')](_0x6d15('0x38'),_0x90d4bc['DefaultReportId']);return analyticDefaultReportController[_0x6d15('0x39')]({'id':_0x90d4bc[_0x6d15('0x37')]},_0x4fb77c)[_0x6d15('0x29')](handleResult(_0x90d4bc))['catch'](handleError());}if(!_[_0x6d15('0x30')](_0x90d4bc[_0x6d15('0x3a')])){logger[_0x6d15('0xa')](_0x6d15('0x3b'),_0x90d4bc[_0x6d15('0x3a')]);return analyticCustomReportController[_0x6d15('0x39')]({'id':_0x90d4bc[_0x6d15('0x3a')]},_0x4fb77c)[_0x6d15('0x29')](handleResult(_0x90d4bc))[_0x6d15('0x2b')](handleError());}}catch(_0x377769){logger[_0x6d15('0x2c')](JSON[_0x6d15('0x2e')](_0x377769));}return logger['info'](_0x6d15('0x3c'));};}function getJobs(_0x1cf058){var _0x1ef063={};if(_0x1cf058){_0x1ef063['id']=_0x1cf058;}return db[_0x6d15('0x3d')]['findAll']({'where':_0x1ef063,'include':[{'model':db['MailAccount'],'attributes':['id',_0x6d15('0x3e'),'email'],'include':[{'model':db[_0x6d15('0x3f')],'as':_0x6d15('0xd')}]}]})['then'](function(_0x2e0769){var _0x4a5c94=_[_0x6d15('0x40')](manager['jobs']);var _0x3ec8aa=_[_0x6d15('0x41')](_0x2e0769,function(_0x4636f5){return _0x4636f5['id'][_0x6d15('0x42')]();});var _0x4a4b99=_[_0x6d15('0x43')](_0x2e0769,function(_0x1a792c){return _0x1a792c['id'][_0x6d15('0x42')]();});var _0x2dc137=_0x1cf058?_0x3ec8aa:_['difference'](_0x3ec8aa,_0x4a5c94);var _0x3117ae=_['intersection'](_0x3ec8aa,_0x4a5c94);var _0x345a6e=_[_0x6d15('0x44')](_0x4a5c94,_0x3ec8aa);var _0x1e9d46;var _0x1b2246;for(_0x1e9d46=0x0;_0x1e9d46<_0x345a6e[_0x6d15('0x45')]&&!_0x1cf058;_0x1e9d46+=0x1){_0x1b2246=_0x345a6e[_0x1e9d46]['toString']();if(manager[_0x6d15('0x46')](_0x1b2246)){manager[_0x6d15('0x47')](_0x1b2246);manager['deleteJob'](_0x1b2246);logger[_0x6d15('0xa')](_0x6d15('0x48'),_0x1b2246);}}logger[_0x6d15('0xa')](_0x6d15('0x49'),JSON[_0x6d15('0x2e')](_0x2dc137));for(_0x1e9d46=0x0;_0x1e9d46<_0x2dc137[_0x6d15('0x45')];_0x1e9d46+=0x1){_0x1b2246=_0x2dc137[_0x1e9d46][_0x6d15('0x42')]();logger[_0x6d15('0xa')](_0x6d15('0x4a'),_0x1b2246);if(_0x1cf058){logger[_0x6d15('0xa')]('my\x20id',_0x1cf058);logger[_0x6d15('0xa')](JSON[_0x6d15('0x2e')](_0x4a4b99[_0x1b2246]));BPromise[_0x6d15('0x4b')]()[_0x6d15('0x29')](handleJob(_0x4a4b99[_0x1b2246]));logger['info'](_0x6d15('0x4c'),_0x4a4b99[_0x1b2246][_0x6d15('0x3e')],_0x4a4b99[_0x1b2246]['cron']);}else if(_0x4a4b99[_0x1b2246][_0x6d15('0x4d')]&&_0x4a4b99[_0x1b2246][_0x6d15('0x4e')]&&moment()[_0x6d15('0x4f')](_0x4a4b99[_0x1b2246][_0x6d15('0x50')],_0x4a4b99[_0x1b2246]['endAt'])){manager['add'](_0x1b2246,_0x4a4b99[_0x1b2246][_0x6d15('0x4d')],handleJob(_0x4a4b99[_0x1b2246]));manager[_0x6d15('0x51')](_0x1b2246);logger[_0x6d15('0xa')]('add\x20cron',_0x4a4b99[_0x1b2246][_0x6d15('0x3e')],_0x4a4b99[_0x1b2246][_0x6d15('0x4d')]);}else if(manager['exists'](_0x1b2246)){manager[_0x6d15('0x47')](_0x1b2246);manager['deleteJob'](_0x1b2246);logger[_0x6d15('0xa')](_0x6d15('0x52'),_0x4a4b99[_0x1b2246][_0x6d15('0x3e')],_0x4a4b99[_0x1b2246][_0x6d15('0x4d')]);}}for(_0x1e9d46=0x0,_0x1b2246;_0x1e9d46<_0x3117ae[_0x6d15('0x45')]&&!_0x1cf058;_0x1e9d46+=0x1){_0x1b2246=_0x3117ae[_0x1e9d46][_0x6d15('0x42')]();if(manager[_0x6d15('0x46')](_0x1b2246)){if(_0x4a4b99[_0x1b2246][_0x6d15('0x4d')]&&_0x4a4b99[_0x1b2246]['active']&&moment()[_0x6d15('0x4f')](_0x4a4b99[_0x1b2246][_0x6d15('0x50')],_0x4a4b99[_0x1b2246][_0x6d15('0x53')])){manager[_0x6d15('0x54')](_0x1b2246,_0x4a4b99[_0x1b2246][_0x6d15('0x4d')],handleJob(_0x4a4b99[_0x1b2246]));logger['info'](_0x6d15('0x55'),_0x4a4b99[_0x1b2246][_0x6d15('0x3e')],_0x4a4b99[_0x1b2246]['cron']);}else{manager['stop'](_0x1b2246);manager['deleteJob'](_0x1b2246);logger[_0x6d15('0xa')](_0x6d15('0x52'),_0x4a4b99[_0x1b2246][_0x6d15('0x3e')],_0x4a4b99[_0x1b2246][_0x6d15('0x4d')]);}}}})[_0x6d15('0x2b')](function(_0x11db7c){logger[_0x6d15('0x2c')](JSON[_0x6d15('0x2e')](_0x11db7c));});}exports[_0x6d15('0x56')]=function(_0x1a0f4e){return getJobs(_0x1a0f4e);};exports[_0x6d15('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x7d09=['email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','add\x20cron','exists','stop\x20cron','isBetween','update\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7d09,0x1e1));var _0x97d0=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x7d09[_0x43a5c7];return _0x3b12a2;};'use strict';var fs=require('fs');var util=require(_0x97d0('0x0'));var path=require(_0x97d0('0x1'));var _=require(_0x97d0('0x2'));var moment=require(_0x97d0('0x3'));var CronJobManager=require(_0x97d0('0x4'));var jayson=require(_0x97d0('0x5'));var BPromise=require(_0x97d0('0x6'));var logger=require(_0x97d0('0x7'))(_0x97d0('0x8'));var db=require(_0x97d0('0x9'))['db'];var analyticCustomReportController=require(_0x97d0('0xa'));var analyticDefaultReportController=require(_0x97d0('0xb'));var client=jayson['client'][_0x97d0('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x461b05,_0x4dbc91){return function(){logger[_0x97d0('0xd')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x461b05[_0x97d0('0xe')]);var _0x4e5adb=!![];var _0x43a0c8={'tls':{'rejectUnauthorized':![]}};if(_0x461b05[_0x97d0('0xf')][_0x97d0('0x10')][_0x97d0('0x11')]){_0x43a0c8[_0x97d0('0x11')]=_0x461b05['MailAccount'][_0x97d0('0x10')][_0x97d0('0x11')];}else{_0x43a0c8['host']=_0x461b05['MailAccount']['Smtp'][_0x97d0('0x12')];_0x43a0c8['port']=_0x461b05[_0x97d0('0xf')][_0x97d0('0x10')][_0x97d0('0x13')];_0x43a0c8[_0x97d0('0x14')]=_0x461b05[_0x97d0('0xf')][_0x97d0('0x10')]['secure'];}if(_0x461b05[_0x97d0('0xf')][_0x97d0('0x10')][_0x97d0('0x15')]){_0x43a0c8[_0x97d0('0x16')]={'user':_0x461b05['MailAccount'][_0x97d0('0x10')][_0x97d0('0x17')],'pass':_0x461b05[_0x97d0('0xf')][_0x97d0('0x10')][_0x97d0('0x18')]};}var _0x8719c7={'account':_0x43a0c8,'message':{'from':util['format'](_0x97d0('0x19'),_0x461b05[_0x97d0('0xf')][_0x97d0('0x1a')],_0x461b05[_0x97d0('0xf')]['email']||_0x461b05[_0x97d0('0xf')][_0x97d0('0x10')][_0x97d0('0x17')]),'to':_0x461b05['email'],'cc':_0x461b05['cc'],'bcc':_0x461b05[_0x97d0('0x1b')],'subject':util[_0x97d0('0x1c')](_0x97d0('0x1d'),_0x4dbc91[_0x97d0('0x1a')],_0x461b05['subtractNumber'],_0x461b05[_0x97d0('0x1e')])}};var _0x8e25e=path[_0x97d0('0x1f')](__dirname,_0x97d0('0x20'));var _0x1cf268=_0x4dbc91[_0x97d0('0x21')];var _0x522cbb=util[_0x97d0('0x1c')](_0x97d0('0x22'),path[_0x97d0('0x23')](_0x4dbc91[_0x97d0('0x21')],path[_0x97d0('0x24')](_0x4dbc91[_0x97d0('0x21')])),_0x97d0('0x25'));var _0x526b1d=path[_0x97d0('0x1f')](_0x8e25e,_0x1cf268);var _0x38f07c=path['join'](_0x8e25e,_0x522cbb);if(fs[_0x97d0('0x26')](_0x526b1d)){_0x4dbc91[_0x97d0('0x27')]=_0x97d0('0x28');_0x8719c7[_0x97d0('0x29')]['attachments']=[{'filename':_0x1cf268,'path':_0x526b1d}];_0x8719c7[_0x97d0('0x29')][_0x97d0('0x2a')]=util[_0x97d0('0x1c')](_0x97d0('0x2b'),JSON[_0x97d0('0x2c')](_0x4dbc91,null,0x2));}else if(fs[_0x97d0('0x26')](_0x38f07c)){_0x4dbc91[_0x97d0('0x27')]=_0x97d0('0x28');_0x8719c7['message'][_0x97d0('0x2d')]=[{'filename':_0x522cbb,'path':_0x38f07c}];}else{_0x8719c7[_0x97d0('0x29')][_0x97d0('0x2a')]=_0x97d0('0x2e');if(!_0x461b05[_0x97d0('0x2f')]){_0x4e5adb=![];logger[_0x97d0('0xd')](_0x97d0('0x30'));}}if(_0x4e5adb){return client[_0x97d0('0x31')](_0x97d0('0x32'),_0x8719c7)[_0x97d0('0x33')](function(_0xe4eceb){if(_0xe4eceb[_0x97d0('0x34')]){return logger[_0x97d0('0x34')](_0x97d0('0x35'),JSON['stringify'](_0xe4eceb));}return logger[_0x97d0('0xd')](_0x97d0('0x36'));})[_0x97d0('0x37')](function(_0x43bc35){return logger['error'](_0x97d0('0x35'),JSON['stringify'](_0x43bc35));});}};}function handleError(){return function(_0xe3bc32){return logger[_0x97d0('0x34')](JSON['stringify'](_0xe3bc32));};}function handleResult(_0x161cee){return function(_0x3c84fc){logger[_0x97d0('0xd')](_0x97d0('0x38'),JSON[_0x97d0('0x2c')](_0x3c84fc));if(_0x161cee[_0x97d0('0xf')]&&_0x161cee[_0x97d0('0xf')]['Smtp']&&!_[_0x97d0('0x39')](_0x161cee[_0x97d0('0xe')])){setTimeout(handleSendEmail(_0x161cee,_0x3c84fc),0x3c*0x3e8);}};}function handleJob(_0x6c663d){return function(){try{if(_[_0x97d0('0x39')](_0x6c663d[_0x97d0('0x3a')])){return logger[_0x97d0('0xd')](_0x97d0('0x3b'));}if(_[_0x97d0('0x39')](_0x6c663d[_0x97d0('0x1e')])){return logger[_0x97d0('0xd')](_0x97d0('0x3c'));}var _0x32e9f9={'startDate':moment()[_0x97d0('0x3d')](_0x6c663d[_0x97d0('0x3a')],_0x6c663d['subtractUnit'])[_0x97d0('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x97d0('0x1c')](_0x97d0('0x3e')),'type':'scheduled','output':_0x6c663d['output'],'name':_0x6c663d[_0x97d0('0x1a')]};if(!_[_0x97d0('0x39')](_0x6c663d[_0x97d0('0x3f')])){logger[_0x97d0('0xd')](_0x97d0('0x40'),_0x6c663d[_0x97d0('0x3f')]);return analyticDefaultReportController[_0x97d0('0x41')]({'id':_0x6c663d[_0x97d0('0x3f')]},_0x32e9f9)[_0x97d0('0x33')](handleResult(_0x6c663d))[_0x97d0('0x37')](handleError());}if(!_[_0x97d0('0x39')](_0x6c663d[_0x97d0('0x42')])){logger[_0x97d0('0xd')](_0x97d0('0x43'),_0x6c663d[_0x97d0('0x42')]);return analyticCustomReportController['runReport']({'id':_0x6c663d['CustomReportId']},_0x32e9f9)['then'](handleResult(_0x6c663d))['catch'](handleError());}}catch(_0x5ce3b5){logger[_0x97d0('0x34')](JSON[_0x97d0('0x2c')](_0x5ce3b5));}return logger[_0x97d0('0xd')](_0x97d0('0x44'));};}function getJobs(_0x15ed7b){var _0x6094fd={};if(_0x15ed7b){_0x6094fd['id']=_0x15ed7b;}return db[_0x97d0('0x45')][_0x97d0('0x46')]({'where':_0x6094fd,'include':[{'model':db[_0x97d0('0xf')],'attributes':['id',_0x97d0('0x1a'),_0x97d0('0xe')],'include':[{'model':db[_0x97d0('0x47')],'as':_0x97d0('0x10')}]}]})[_0x97d0('0x33')](function(_0x579542){var _0x3569c4=_[_0x97d0('0x48')](manager[_0x97d0('0x49')]);var _0x250396=_[_0x97d0('0x4a')](_0x579542,function(_0x23df66){return _0x23df66['id']['toString']();});var _0x3d9cf6=_[_0x97d0('0x4b')](_0x579542,function(_0x453358){return _0x453358['id'][_0x97d0('0x4c')]();});var _0x164d88=_0x15ed7b?_0x250396:_[_0x97d0('0x4d')](_0x250396,_0x3569c4);var _0x1dbc3d=_['intersection'](_0x250396,_0x3569c4);var _0x2e0b4d=_['difference'](_0x3569c4,_0x250396);var _0x4824e7;var _0xfbc5ed;for(_0x4824e7=0x0;_0x4824e7<_0x2e0b4d['length']&&!_0x15ed7b;_0x4824e7+=0x1){_0xfbc5ed=_0x2e0b4d[_0x4824e7][_0x97d0('0x4c')]();if(manager['exists'](_0xfbc5ed)){manager[_0x97d0('0x4e')](_0xfbc5ed);manager[_0x97d0('0x4f')](_0xfbc5ed);logger['info'](_0x97d0('0x50'),_0xfbc5ed);}}logger[_0x97d0('0xd')](_0x97d0('0x51'),JSON['stringify'](_0x164d88));for(_0x4824e7=0x0;_0x4824e7<_0x164d88[_0x97d0('0x52')];_0x4824e7+=0x1){_0xfbc5ed=_0x164d88[_0x4824e7]['toString']();logger[_0x97d0('0xd')](_0x97d0('0x53'),_0xfbc5ed);if(_0x15ed7b){logger[_0x97d0('0xd')](_0x97d0('0x54'),_0x15ed7b);logger[_0x97d0('0xd')](JSON[_0x97d0('0x2c')](_0x3d9cf6[_0xfbc5ed]));BPromise[_0x97d0('0x55')]()[_0x97d0('0x33')](handleJob(_0x3d9cf6[_0xfbc5ed]));logger[_0x97d0('0xd')](_0x97d0('0x56'),_0x3d9cf6[_0xfbc5ed]['name'],_0x3d9cf6[_0xfbc5ed][_0x97d0('0x57')]);}else if(_0x3d9cf6[_0xfbc5ed][_0x97d0('0x57')]&&_0x3d9cf6[_0xfbc5ed][_0x97d0('0x58')]&&moment()['isBetween'](_0x3d9cf6[_0xfbc5ed][_0x97d0('0x59')],_0x3d9cf6[_0xfbc5ed][_0x97d0('0x5a')])){manager[_0x97d0('0x5b')](_0xfbc5ed,_0x3d9cf6[_0xfbc5ed][_0x97d0('0x57')],handleJob(_0x3d9cf6[_0xfbc5ed]));manager['start'](_0xfbc5ed);logger['info'](_0x97d0('0x5c'),_0x3d9cf6[_0xfbc5ed][_0x97d0('0x1a')],_0x3d9cf6[_0xfbc5ed]['cron']);}else if(manager[_0x97d0('0x5d')](_0xfbc5ed)){manager[_0x97d0('0x4e')](_0xfbc5ed);manager[_0x97d0('0x4f')](_0xfbc5ed);logger[_0x97d0('0xd')](_0x97d0('0x5e'),_0x3d9cf6[_0xfbc5ed][_0x97d0('0x1a')],_0x3d9cf6[_0xfbc5ed][_0x97d0('0x57')]);}}for(_0x4824e7=0x0,_0xfbc5ed;_0x4824e7<_0x1dbc3d['length']&&!_0x15ed7b;_0x4824e7+=0x1){_0xfbc5ed=_0x1dbc3d[_0x4824e7][_0x97d0('0x4c')]();if(manager[_0x97d0('0x5d')](_0xfbc5ed)){if(_0x3d9cf6[_0xfbc5ed][_0x97d0('0x57')]&&_0x3d9cf6[_0xfbc5ed][_0x97d0('0x58')]&&moment()[_0x97d0('0x5f')](_0x3d9cf6[_0xfbc5ed][_0x97d0('0x59')],_0x3d9cf6[_0xfbc5ed][_0x97d0('0x5a')])){manager['update'](_0xfbc5ed,_0x3d9cf6[_0xfbc5ed][_0x97d0('0x57')],handleJob(_0x3d9cf6[_0xfbc5ed]));logger[_0x97d0('0xd')](_0x97d0('0x60'),_0x3d9cf6[_0xfbc5ed]['name'],_0x3d9cf6[_0xfbc5ed][_0x97d0('0x57')]);}else{manager['stop'](_0xfbc5ed);manager[_0x97d0('0x4f')](_0xfbc5ed);logger['info'](_0x97d0('0x5e'),_0x3d9cf6[_0xfbc5ed][_0x97d0('0x1a')],_0x3d9cf6[_0xfbc5ed][_0x97d0('0x57')]);}}}})[_0x97d0('0x37')](function(_0x592aae){logger['error'](JSON['stringify'](_0x592aae));});}exports[_0x97d0('0x61')]=function(_0x3cb25a){return getJobs(_0x3cb25a);};exports[_0x97d0('0x62')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js
index 57421ec..d698af8 100644
--- a/server/config/schedule/transcribe.js
+++ b/server/config/schedule/transcribe.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d84=['inspect','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','push','all','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','getTranscriptionJob','detectSentiment','substring','info','format','transcribeName','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','data1','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis'];(function(_0x219b98,_0x38a85b){var _0x7c426e=function(_0x2024fa){while(--_0x2024fa){_0x219b98['push'](_0x219b98['shift']());}};_0x7c426e(++_0x38a85b);}(_0x3d84,0x12b));var _0x43d8=function(_0x3bd468,_0x40117f){_0x3bd468=_0x3bd468-0x0;var _0x501332=_0x3d84[_0x3bd468];return _0x501332;};var _=require(_0x43d8('0x0'));var AWS=require('aws-sdk');var rp=require(_0x43d8('0x1'));var util=require(_0x43d8('0x2'));var BPromise=require(_0x43d8('0x3'));var db=require(_0x43d8('0x4'))['db'];var logger=require(_0x43d8('0x5'))('transcribe');function getTranscriptionJob(_0x3a0dba,_0x54f1a9,_0x3af5ac,_0x210163){return new Promise(function(_0x2640c7,_0x5a9caa){var _0x544700=new AWS['TranscribeService']({'accessKeyId':_0x54f1a9,'secretAccessKey':_0x3a0dba,'region':_0x3af5ac});_0x544700[_0x43d8('0x6')]({'TranscriptionJobName':_0x210163},function(_0x3d5698,_0x149fdf){if(_0x3d5698){return _0x5a9caa(_0x3d5698);}else{return _0x2640c7(_0x149fdf);}});});}function sentiment(_0x615ff7,_0x268529,_0xd55946,_0x2a158a,_0x2d71c8){return new Promise(function(_0x4ba1df,_0x4242c6){var _0xcaa01=new AWS['Comprehend']({'accessKeyId':_0x268529,'secretAccessKey':_0x615ff7,'region':_0xd55946});_0xcaa01[_0x43d8('0x7')]({'Text':_0x2a158a,'LanguageCode':_0x2d71c8[_0x43d8('0x8')](0x0,0x2)},function(_0x1776a2,_0x58f252){if(_0x1776a2){return _0x4242c6(_0x1776a2);}else{return _0x4ba1df(_0x58f252);}});});}function checkTranscribeJob(_0xe449aa,_0x38cc21,_0x5511cd){var _0x26521b;return new BPromise(function(_0xb9eb29,_0x3c680e){logger[_0x43d8('0x9')](util[_0x43d8('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xe449aa['id'],_0xe449aa[_0x43d8('0xb')]));return getTranscriptionJob(_0x5511cd['data1'],_0x5511cd['data2'],_0x38cc21[_0x43d8('0xc')],_0xe449aa[_0x43d8('0xb')])['then'](function(_0x130b95){logger[_0x43d8('0x9')](util['format'](_0x43d8('0xd'),_0xe449aa['id'],_0xe449aa[_0x43d8('0xb')],_0x130b95[_0x43d8('0xe')][_0x43d8('0xf')]));if(!_0xe449aa[_0x43d8('0x10')]){switch(_0x130b95[_0x43d8('0xe')]['TranscriptionJobStatus']){case'COMPLETED':var _0x1dd07e={'transcribeStatus':_0x130b95[_0x43d8('0xe')][_0x43d8('0xf')],'fileUri':_0x130b95[_0x43d8('0xe')][_0x43d8('0x11')][_0x43d8('0x12')]};logger['info'](util[_0x43d8('0xa')](_0x43d8('0x13'),_0xe449aa['id']));return rp({'uri':_0x130b95[_0x43d8('0xe')][_0x43d8('0x11')][_0x43d8('0x12')],'json':!![]})[_0x43d8('0x14')](function(_0x19bd58){logger[_0x43d8('0x9')](util[_0x43d8('0xa')](_0x43d8('0x15'),_0xe449aa['id']));if(_0x19bd58&&_0x19bd58[_0x43d8('0x16')]&&_0x19bd58[_0x43d8('0x16')]['transcripts']&&_0x19bd58[_0x43d8('0x16')][_0x43d8('0x17')]['length']){_0x1dd07e[_0x43d8('0x10')]='';for(var _0x534663=0x0;_0x534663<_0x19bd58[_0x43d8('0x16')][_0x43d8('0x17')][_0x43d8('0x18')];_0x534663++){_0x1dd07e[_0x43d8('0x10')]+=_0x19bd58[_0x43d8('0x16')][_0x43d8('0x17')][_0x534663][_0x43d8('0x19')]+'';}}return _0xe449aa[_0x43d8('0x1a')](_0x1dd07e);})[_0x43d8('0x14')](function(){logger['info'](util[_0x43d8('0xa')](_0x43d8('0x1b'),_0xe449aa['id']));if(!_0xe449aa[_0x43d8('0x1c')]){throw new db['Sequelize']['ValidationError'](_0x43d8('0x1d'));}if(!_0x38cc21[_0x43d8('0x1e')]||!_0x38cc21[_0x43d8('0x1f')]||!_0x38cc21['sentimentRegion']||!_0x38cc21[_0x43d8('0x20')]||!_0x38cc21['bucket']){throw new db[(_0x43d8('0x21'))][(_0x43d8('0x22'))](_0x43d8('0x23'));}if(!_0x1dd07e['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x38cc21['sentimentAccountId']===_0x5511cd['id']){return _0x5511cd;}else{return db[_0x43d8('0x24')][_0x43d8('0x25')]({'where':{'id':_settings[_0x43d8('0x1f')]}});}})['then'](function(_0x51a9f3){if(!_0x51a9f3){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x51a9f3[_0x43d8('0x26')]||!_0x51a9f3[_0x43d8('0x27')]){throw new db[(_0x43d8('0x21'))][(_0x43d8('0x22'))](_0x43d8('0x28'));}_0x26521b=_0x51a9f3;logger[_0x43d8('0x9')](util[_0x43d8('0xa')](_0x43d8('0x29'),_0xe449aa['id']));return sentiment(_0x26521b[_0x43d8('0x26')],_0x26521b[_0x43d8('0x27')],_0x38cc21[_0x43d8('0x2a')],_0x1dd07e['fileText'],_0x38cc21[_0x43d8('0x20')]);})['then'](function(_0x2d1da3){logger['info'](util['format'](_0x43d8('0x2b'),_0xe449aa['id']));return _0xe449aa[_0x43d8('0x1a')]({'sentiment':_0x2d1da3[_0x43d8('0x2c')],'sPositive':_0x2d1da3[_0x43d8('0x2d')][_0x43d8('0x2e')],'sNegative':_0x2d1da3[_0x43d8('0x2d')][_0x43d8('0x2f')],'sMixed':_0x2d1da3[_0x43d8('0x2d')][_0x43d8('0x30')],'sNeutral':_0x2d1da3[_0x43d8('0x2d')][_0x43d8('0x31')]});})[_0x43d8('0x14')](function(){logger['info'](util[_0x43d8('0xa')](_0x43d8('0x1b'),_0xe449aa['id']));_0xb9eb29();});case _0x43d8('0x32'):return _0xe449aa[_0x43d8('0x1a')]({'transcribeStatus':_0x43d8('0x32'),'failureReason':_0x130b95[_0x43d8('0xe')]['FailureReason']})[_0x43d8('0x14')](function(){logger[_0x43d8('0x9')](util[_0x43d8('0xa')](_0x43d8('0x1b'),_0xe449aa['id']));_0xb9eb29();});default:logger[_0x43d8('0x9')](util[_0x43d8('0xa')](_0x43d8('0x33'),_0xe449aa['id']));break;}}else{return BPromise[_0x43d8('0x34')]()['then'](function(){if(!_0xe449aa['tempSentiment']){throw new db[(_0x43d8('0x21'))][(_0x43d8('0x22'))](_0x43d8('0x1d'));}if(!_0x38cc21[_0x43d8('0x1e')]||!_0x38cc21[_0x43d8('0x1f')]||!_0x38cc21[_0x43d8('0x2a')]||!_0x38cc21[_0x43d8('0x20')]||!_0x38cc21[_0x43d8('0x35')]){throw new db[(_0x43d8('0x21'))]['ValidationError'](_0x43d8('0x23'));}if(!_0xe449aa[_0x43d8('0x10')]){throw new Error(_0x43d8('0x36'));}if(_0x38cc21['sentimentAccountId']===_0x5511cd['id']){return _0x5511cd;}else{return db[_0x43d8('0x24')]['findOne']({'where':{'id':_settings[_0x43d8('0x1f')]}});}})[_0x43d8('0x14')](function(_0xab986a){if(!_0xab986a){throw new db[(_0x43d8('0x21'))]['ValidationError'](_0x43d8('0x37'));}if(!_0xab986a['data1']||!_0xab986a['data2']){throw new db[(_0x43d8('0x21'))][(_0x43d8('0x22'))](_0x43d8('0x28'));}_0x26521b=_0xab986a;logger[_0x43d8('0x9')](util[_0x43d8('0xa')](_0x43d8('0x29'),_0xe449aa['id']));return sentiment(_0x26521b[_0x43d8('0x26')],_0x26521b[_0x43d8('0x27')],_0x38cc21[_0x43d8('0x2a')],_0xe449aa['fileText'],_0x38cc21[_0x43d8('0x20')]);})['then'](function(_0x48c2bd){logger['info'](util['format'](_0x43d8('0x2b'),_0xe449aa['id']));return _0xe449aa['update']({'sentiment':_0x48c2bd[_0x43d8('0x2c')],'sPositive':_0x48c2bd[_0x43d8('0x2d')]['Positive'],'sNegative':_0x48c2bd[_0x43d8('0x2d')][_0x43d8('0x2f')],'sMixed':_0x48c2bd[_0x43d8('0x2d')]['Mixed'],'sNeutral':_0x48c2bd[_0x43d8('0x2d')][_0x43d8('0x31')],'transcribeStatus':'COMPLETED'});})[_0x43d8('0x14')](function(){logger['info'](util[_0x43d8('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xe449aa['id']));_0xb9eb29();});}})[_0x43d8('0x38')](function(_0x53a370){if(_0x53a370){if(!_0x53a370[_0x43d8('0x39')]||_0x53a370['name']!==_0x43d8('0x3a')){logger[_0x43d8('0x3b')](util[_0x43d8('0xa')](_0x43d8('0x3c'),_0xe449aa['id']),util[_0x43d8('0x3d')](_0x53a370,{'showHidden':![],'depth':null}));}}_0xb9eb29();});});}function checkTranscribe(){var _0x46aae6;var _0x297a42;var _0x1ff9b2;return db['VoiceRecording'][_0x43d8('0x3e')]({'where':{'transcribeStatus':_0x43d8('0x3f')}})[_0x43d8('0x14')](function(_0x3b9393){if(!_0x3b9393||!_0x3b9393[_0x43d8('0x18')]){throw new db[(_0x43d8('0x21'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x46aae6=_0x3b9393;return db[_0x43d8('0x40')][_0x43d8('0x25')]({'where':{'id':0x1}});})[_0x43d8('0x14')](function(_0x328544){if(!_0x328544){throw new db[(_0x43d8('0x21'))][(_0x43d8('0x22'))](_0x43d8('0x41'));}_0x297a42=_0x328544;if(!_0x297a42[_0x43d8('0x42')]||!_0x297a42[_0x43d8('0x43')]||!_0x297a42[_0x43d8('0xc')]||!_0x297a42[_0x43d8('0x20')]||!_0x297a42[_0x43d8('0x35')]){throw new db['Sequelize']['ValidationError'](_0x43d8('0x44'));}return db['CloudProvider'][_0x43d8('0x25')]({'where':{'id':_0x297a42[_0x43d8('0x43')]}});})[_0x43d8('0x14')](function(_0x3dfa56){if(!_0x3dfa56){throw new db[(_0x43d8('0x21'))][(_0x43d8('0x22'))](_0x43d8('0x37'));}if(!_0x3dfa56[_0x43d8('0x26')]||!_0x3dfa56[_0x43d8('0x27')]){throw new db[(_0x43d8('0x21'))]['ValidationError'](_0x43d8('0x28'));}_0x1ff9b2=_0x3dfa56;var _0xb82875=[];_0x46aae6['forEach'](function(_0x25f54f){_0xb82875[_0x43d8('0x45')](checkTranscribeJob(_0x25f54f,_0x297a42,_0x1ff9b2));});return BPromise[_0x43d8('0x46')](_0xb82875);})[_0x43d8('0x38')](function(_0x5e017c){if(_0x5e017c){if(!_0x5e017c['name']||_0x5e017c['name']!=='SequelizeValidationError'){logger[_0x43d8('0x3b')](util[_0x43d8('0x3d')](_0x5e017c,{'showHidden':![],'depth':null}));}}});}exports[_0x43d8('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x9e63=['data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','update','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','CloudProvider','Negative','catch','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','SequelizeValidationError','start','lodash','aws-sdk','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName'];(function(_0x572b6e,_0x3ce5ef){var _0x4ea3c0=function(_0x3b3991){while(--_0x3b3991){_0x572b6e['push'](_0x572b6e['shift']());}};_0x4ea3c0(++_0x3ce5ef);}(_0x9e63,0x163));var _0x39e6=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x9e63[_0x2160a9];return _0xa88cf7;};var _=require(_0x39e6('0x0'));var AWS=require(_0x39e6('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0x39e6('0x2'));var db=require(_0x39e6('0x3'))['db'];var logger=require(_0x39e6('0x4'))(_0x39e6('0x5'));function getTranscriptionJob(_0x3097cd,_0x233f3a,_0x17bad6,_0x4f617b){return new Promise(function(_0x1fc4da,_0x4e5a73){var _0x3d8e6a=new AWS[(_0x39e6('0x6'))]({'accessKeyId':_0x233f3a,'secretAccessKey':_0x3097cd,'region':_0x17bad6});_0x3d8e6a[_0x39e6('0x7')]({'TranscriptionJobName':_0x4f617b},function(_0x520a6b,_0x336162){if(_0x520a6b){return _0x4e5a73(_0x520a6b);}else{return _0x1fc4da(_0x336162);}});});}function sentiment(_0x3bb10d,_0x525bff,_0xfb5fbe,_0x3a5ead,_0x487dab){return new Promise(function(_0xdeced0,_0x5db76e){var _0x2ca975=new AWS[(_0x39e6('0x8'))]({'accessKeyId':_0x525bff,'secretAccessKey':_0x3bb10d,'region':_0xfb5fbe});_0x2ca975[_0x39e6('0x9')]({'Text':_0x3a5ead,'LanguageCode':_0x487dab[_0x39e6('0xa')](0x0,0x2)},function(_0x1ea99a,_0xee4c8b){if(_0x1ea99a){return _0x5db76e(_0x1ea99a);}else{return _0xdeced0(_0xee4c8b);}});});}function checkTranscribeJob(_0x56da9b,_0x5664ed,_0xf66d3b){var _0x3e9521;return new BPromise(function(_0x5a1eec,_0x381480){logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0xd'),_0x56da9b['id'],_0x56da9b[_0x39e6('0xe')]));return getTranscriptionJob(_0xf66d3b[_0x39e6('0xf')],_0xf66d3b[_0x39e6('0x10')],_0x5664ed[_0x39e6('0x11')],_0x56da9b[_0x39e6('0xe')])[_0x39e6('0x12')](function(_0x5d95e0){logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0x13'),_0x56da9b['id'],_0x56da9b['transcribeName'],_0x5d95e0[_0x39e6('0x14')][_0x39e6('0x15')]));if(!_0x56da9b[_0x39e6('0x16')]){switch(_0x5d95e0[_0x39e6('0x14')][_0x39e6('0x15')]){case _0x39e6('0x17'):var _0x1f6924={'transcribeStatus':_0x5d95e0[_0x39e6('0x14')][_0x39e6('0x15')],'fileUri':_0x5d95e0[_0x39e6('0x14')][_0x39e6('0x18')]['TranscriptFileUri']};logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0x19'),_0x56da9b['id']));return rp({'uri':_0x5d95e0['TranscriptionJob']['Transcript'][_0x39e6('0x1a')],'json':!![]})[_0x39e6('0x12')](function(_0x30bbcc){logger[_0x39e6('0xb')](util[_0x39e6('0xc')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x56da9b['id']));if(_0x30bbcc&&_0x30bbcc[_0x39e6('0x1b')]&&_0x30bbcc['results']['transcripts']&&_0x30bbcc['results'][_0x39e6('0x1c')][_0x39e6('0x1d')]){_0x1f6924['fileText']='';for(var _0x41203f=0x0;_0x41203f<_0x30bbcc[_0x39e6('0x1b')][_0x39e6('0x1c')][_0x39e6('0x1d')];_0x41203f++){_0x1f6924['fileText']+=_0x30bbcc['results'][_0x39e6('0x1c')][_0x41203f][_0x39e6('0x1e')]+'';}}return _0x56da9b['update'](_0x1f6924);})[_0x39e6('0x12')](function(){logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0x1f'),_0x56da9b['id']));if(!_0x56da9b['tempSentiment']){throw new db[(_0x39e6('0x20'))][(_0x39e6('0x21'))](_0x39e6('0x22'));}if(!_0x5664ed['sentiment']||!_0x5664ed[_0x39e6('0x23')]||!_0x5664ed['sentimentRegion']||!_0x5664ed['language']||!_0x5664ed[_0x39e6('0x24')]){throw new db[(_0x39e6('0x20'))][(_0x39e6('0x21'))](_0x39e6('0x25'));}if(!_0x1f6924[_0x39e6('0x16')]){throw new Error(_0x39e6('0x26'));}if(_0x5664ed['sentimentAccountId']===_0xf66d3b['id']){return _0xf66d3b;}else{return db['CloudProvider'][_0x39e6('0x27')]({'where':{'id':_settings[_0x39e6('0x23')]}});}})[_0x39e6('0x12')](function(_0x40547d){if(!_0x40547d){throw new db['Sequelize']['ValidationError'](_0x39e6('0x28'));}if(!_0x40547d['data1']||!_0x40547d[_0x39e6('0x10')]){throw new db[(_0x39e6('0x20'))]['ValidationError'](_0x39e6('0x29'));}_0x3e9521=_0x40547d;logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0x2a'),_0x56da9b['id']));return sentiment(_0x3e9521[_0x39e6('0xf')],_0x3e9521['data2'],_0x5664ed[_0x39e6('0x2b')],_0x1f6924[_0x39e6('0x16')],_0x5664ed[_0x39e6('0x2c')]);})[_0x39e6('0x12')](function(_0x444fda){logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0x2d'),_0x56da9b['id']));return _0x56da9b['update']({'sentiment':_0x444fda[_0x39e6('0x2e')],'sPositive':_0x444fda[_0x39e6('0x2f')][_0x39e6('0x30')],'sNegative':_0x444fda[_0x39e6('0x2f')]['Negative'],'sMixed':_0x444fda['SentimentScore'][_0x39e6('0x31')],'sNeutral':_0x444fda[_0x39e6('0x2f')][_0x39e6('0x32')]});})[_0x39e6('0x12')](function(){logger[_0x39e6('0xb')](util[_0x39e6('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x56da9b['id']));_0x5a1eec();});case _0x39e6('0x33'):return _0x56da9b[_0x39e6('0x34')]({'transcribeStatus':'FAILED','failureReason':_0x5d95e0[_0x39e6('0x14')][_0x39e6('0x35')]})[_0x39e6('0x12')](function(){logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0x1f'),_0x56da9b['id']));_0x5a1eec();});default:logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0x36'),_0x56da9b['id']));break;}}else{return BPromise[_0x39e6('0x37')]()[_0x39e6('0x12')](function(){if(!_0x56da9b[_0x39e6('0x38')]){throw new db[(_0x39e6('0x20'))][(_0x39e6('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5664ed[_0x39e6('0x39')]||!_0x5664ed[_0x39e6('0x23')]||!_0x5664ed[_0x39e6('0x2b')]||!_0x5664ed[_0x39e6('0x2c')]||!_0x5664ed[_0x39e6('0x24')]){throw new db[(_0x39e6('0x20'))][(_0x39e6('0x21'))](_0x39e6('0x25'));}if(!_0x56da9b[_0x39e6('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x5664ed['sentimentAccountId']===_0xf66d3b['id']){return _0xf66d3b;}else{return db[_0x39e6('0x3a')][_0x39e6('0x27')]({'where':{'id':_settings[_0x39e6('0x23')]}});}})[_0x39e6('0x12')](function(_0x1bb1ee){if(!_0x1bb1ee){throw new db[(_0x39e6('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1bb1ee[_0x39e6('0xf')]||!_0x1bb1ee[_0x39e6('0x10')]){throw new db[(_0x39e6('0x20'))]['ValidationError'](_0x39e6('0x29'));}_0x3e9521=_0x1bb1ee;logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0x2a'),_0x56da9b['id']));return sentiment(_0x3e9521[_0x39e6('0xf')],_0x3e9521[_0x39e6('0x10')],_0x5664ed[_0x39e6('0x2b')],_0x56da9b[_0x39e6('0x16')],_0x5664ed['language']);})[_0x39e6('0x12')](function(_0x42e691){logger[_0x39e6('0xb')](util[_0x39e6('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x56da9b['id']));return _0x56da9b[_0x39e6('0x34')]({'sentiment':_0x42e691[_0x39e6('0x2e')],'sPositive':_0x42e691[_0x39e6('0x2f')][_0x39e6('0x30')],'sNegative':_0x42e691[_0x39e6('0x2f')][_0x39e6('0x3b')],'sMixed':_0x42e691[_0x39e6('0x2f')][_0x39e6('0x31')],'sNeutral':_0x42e691['SentimentScore'][_0x39e6('0x32')],'transcribeStatus':_0x39e6('0x17')});})[_0x39e6('0x12')](function(){logger[_0x39e6('0xb')](util[_0x39e6('0xc')](_0x39e6('0x1f'),_0x56da9b['id']));_0x5a1eec();});}})[_0x39e6('0x3c')](function(_0x1eef22){if(_0x1eef22){if(!_0x1eef22[_0x39e6('0x3d')]||_0x1eef22['name']!=='SequelizeValidationError'){logger['error'](util[_0x39e6('0xc')](_0x39e6('0x3e'),_0x56da9b['id']),util[_0x39e6('0x3f')](_0x1eef22,{'showHidden':![],'depth':null}));}}_0x5a1eec();});});}function checkTranscribe(){var _0x4de92d;var _0x4f1720;var _0x4a8125;return db[_0x39e6('0x40')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x314452){if(!_0x314452||!_0x314452[_0x39e6('0x1d')]){throw new db[(_0x39e6('0x20'))][(_0x39e6('0x21'))](_0x39e6('0x41'));}_0x4de92d=_0x314452;return db[_0x39e6('0x42')][_0x39e6('0x27')]({'where':{'id':0x1}});})['then'](function(_0x161bb5){if(!_0x161bb5){throw new db[(_0x39e6('0x20'))]['ValidationError'](_0x39e6('0x43'));}_0x4f1720=_0x161bb5;if(!_0x4f1720['transcribe']||!_0x4f1720[_0x39e6('0x44')]||!_0x4f1720[_0x39e6('0x11')]||!_0x4f1720[_0x39e6('0x2c')]||!_0x4f1720[_0x39e6('0x24')]){throw new db[(_0x39e6('0x20'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x39e6('0x3a')][_0x39e6('0x27')]({'where':{'id':_0x4f1720[_0x39e6('0x44')]}});})[_0x39e6('0x12')](function(_0x3aa3d7){if(!_0x3aa3d7){throw new db[(_0x39e6('0x20'))][(_0x39e6('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3aa3d7[_0x39e6('0xf')]||!_0x3aa3d7[_0x39e6('0x10')]){throw new db[(_0x39e6('0x20'))][(_0x39e6('0x21'))](_0x39e6('0x29'));}_0x4a8125=_0x3aa3d7;var _0x3c90c7=[];_0x4de92d[_0x39e6('0x45')](function(_0xad5750){_0x3c90c7[_0x39e6('0x46')](checkTranscribeJob(_0xad5750,_0x4f1720,_0x4a8125));});return BPromise[_0x39e6('0x47')](_0x3c90c7);})[_0x39e6('0x3c')](function(_0x368681){if(_0x368681){if(!_0x368681[_0x39e6('0x3d')]||_0x368681['name']!==_0x39e6('0x48')){logger['error'](util[_0x39e6('0x3f')](_0x368681,{'showHidden':![],'depth':null}));}}});}exports[_0x39e6('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
diff --git a/server/config/seedContact.js b/server/config/seedContact.js
index 595971d..bdf1c6a 100644
--- a/server/config/seedContact.js
+++ b/server/config/seedContact.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb287=['../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','util'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xb287,0xc5));var _0x7b28=function(_0x2a0f46,_0x4a0313){_0x2a0f46=_0x2a0f46-0x0;var _0x187603=_0xb287[_0x2a0f46];return _0x187603;};'use strict';var util=require(_0x7b28('0x0'));var db=require(_0x7b28('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7b28('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x7b28('0x3')+i,'phone':0xf879fb460+i,'email':_0x7b28('0x4')+i+_0x7b28('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7b28('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7b28('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7b28('0x6')](),'updatedAt':Date[_0x7b28('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x7b28('0x7')+i,'lastName':_0x7b28('0x3')+i,'phone':0xf879fb460+i,'email':_0x7b28('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7b28('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7b28('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7b28('0x6')](),'updatedAt':Date[_0x7b28('0x6')]()});}db[_0x7b28('0x8')][_0x7b28('0x9')]({'where':{}})[_0x7b28('0xa')](function(){return db[_0x7b28('0x8')][_0x7b28('0xb')](contacts);})[_0x7b28('0xa')](function(){console[_0x7b28('0xc')](_0x7b28('0xd'),_0x7b28('0xe'));return db[_0x7b28('0xf')][_0x7b28('0x9')]({'where':{}});})[_0x7b28('0xa')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x7b28('0xa')](function(){console['log']('finished\x20populating',_0x7b28('0x10'));return db['CmContact'][_0x7b28('0xb')](contacts2);})['then'](function(){console[_0x7b28('0xc')](_0x7b28('0xd'),_0x7b28('0x11'));return db[_0x7b28('0xf')][_0x7b28('0xb')](hopper2);})[_0x7b28('0xa')](function(){console[_0x7b28('0xc')]('finished\x20populating','hopper2');})['catch'](function(_0x59bd5a){console[_0x7b28('0xc')](_0x59bd5a);});
\ No newline at end of file
+var _0x3972=['finished\x20populating','then','CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo','destroy','CmContact','bulkCreate','log'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3972,0x1b7));var _0x2397=function(_0x368d33,_0x28c974){_0x368d33=_0x368d33-0x0;var _0x13da22=_0x3972[_0x368d33];return _0x13da22;};'use strict';var util=require('util');var db=require(_0x2397('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x2397('0x1')]({'id':i,'firstName':_0x2397('0x2')+i,'lastName':_0x2397('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x2397('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x2397('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2397('0x5')](),'updatedAt':Date[_0x2397('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x2397('0x3')+i,'phone':0xf879fb460+i,'email':_0x2397('0x6')+i+_0x2397('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2397('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x2397('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2397('0x5')](),'updatedAt':Date[_0x2397('0x5')]()});}db['CmContact'][_0x2397('0x7')]({'where':{}})['then'](function(){return db[_0x2397('0x8')][_0x2397('0x9')](contacts);})['then'](function(){console[_0x2397('0xa')](_0x2397('0xb'),'contacts1');return db['CmHopper'][_0x2397('0x7')]({'where':{}});})[_0x2397('0xc')](function(){return db[_0x2397('0xd')][_0x2397('0x9')](hopper);})[_0x2397('0xc')](function(){console['log'](_0x2397('0xb'),_0x2397('0xe'));return db['CmContact'][_0x2397('0x9')](contacts2);})['then'](function(){console[_0x2397('0xa')](_0x2397('0xb'),_0x2397('0xf'));return db[_0x2397('0xd')][_0x2397('0x9')](hopper2);})[_0x2397('0xc')](function(){console[_0x2397('0xa')]('finished\x20populating',_0x2397('0x10'));})[_0x2397('0x11')](function(_0x114be6){console[_0x2397('0xa')](_0x114be6);});
\ No newline at end of file
diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js
index cd16f12..7e42905 100644
--- a/server/config/seedUsers.js
+++ b/server/config/seedUsers.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2196=['udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','add\x20user','catch','log','util','../mysqldb','push','%s%s','agent','format','password','friend'];(function(_0x2c3fbd,_0x3e2441){var _0x50ffff=function(_0x49d6d7){while(--_0x49d6d7){_0x2c3fbd['push'](_0x2c3fbd['shift']());}};_0x50ffff(++_0x3e2441);}(_0x2196,0x1b1));var _0x6219=function(_0x1a875a,_0x2a1002){_0x1a875a=_0x1a875a-0x0;var _0x1a0e87=_0x2196[_0x1a875a];return _0x1a0e87;};'use strict';var util=require(_0x6219('0x0'));var db=require(_0x6219('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6219('0x2')]({'name':util['format'](_0x6219('0x3'),_0x6219('0x4'),i),'fullname':util['format'](_0x6219('0x3'),'agent',i),'email':util[_0x6219('0x5')]('%s%s@xcally.com',_0x6219('0x4'),i),'role':'agent','password':_0x6219('0x6'),'internal':0xfa0+i,'type':_0x6219('0x7'),'transport':[_0x6219('0x8'),'ws',_0x6219('0x9')],'disallow':[_0x6219('0xa')],'allow':[_0x6219('0xb')],'defaultuser':util[_0x6219('0x5')](_0x6219('0x3'),_0x6219('0x4'),i),'encryption':_0x6219('0xc'),'avpf':_0x6219('0xc'),'force_avp':_0x6219('0xc'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x6219('0xd'),'dtlsprivatekey':_0x6219('0xe'),'dtlssetup':'actpass','callerid':util['format'](_0x6219('0xf'),util[_0x6219('0x5')](_0x6219('0x3'),_0x6219('0x4'),i),0xfa0+i)});}db[_0x6219('0x10')]['bulkCreate'](users)[_0x6219('0x11')](function(){console['log'](_0x6219('0x12'));})[_0x6219('0x13')](function(_0x594dc4){console[_0x6219('0x14')](_0x594dc4);});
\ No newline at end of file
+var _0x6b0d=['\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x6b0d,0xa0));var _0xd6b0=function(_0xa8f8f7,_0x48aec7){_0xa8f8f7=_0xa8f8f7-0x0;var _0x1dbc00=_0x6b0d[_0xa8f8f7];return _0x1dbc00;};'use strict';var util=require(_0xd6b0('0x0'));var db=require(_0xd6b0('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd6b0('0x2')]({'name':util[_0xd6b0('0x3')](_0xd6b0('0x4'),_0xd6b0('0x5'),i),'fullname':util[_0xd6b0('0x3')](_0xd6b0('0x4'),'agent',i),'email':util['format']('%s%s@xcally.com',_0xd6b0('0x5'),i),'role':_0xd6b0('0x5'),'password':_0xd6b0('0x6'),'internal':0xfa0+i,'type':_0xd6b0('0x7'),'transport':[_0xd6b0('0x8'),'ws',_0xd6b0('0x9')],'disallow':[_0xd6b0('0xa')],'allow':[_0xd6b0('0xb')],'defaultuser':util[_0xd6b0('0x3')](_0xd6b0('0x4'),_0xd6b0('0x5'),i),'encryption':_0xd6b0('0xc'),'avpf':_0xd6b0('0xc'),'force_avp':_0xd6b0('0xc'),'icesupport':_0xd6b0('0xc'),'dtlsenable':_0xd6b0('0xc'),'dtlsverify':'no','dtlscertfile':_0xd6b0('0xd'),'dtlsprivatekey':_0xd6b0('0xe'),'dtlssetup':_0xd6b0('0xf'),'callerid':util['format'](_0xd6b0('0x10'),util['format'](_0xd6b0('0x4'),_0xd6b0('0x5'),i),0xfa0+i)});}db['User'][_0xd6b0('0x11')](users)[_0xd6b0('0x12')](function(){console[_0xd6b0('0x13')](_0xd6b0('0x14'));})[_0xd6b0('0x15')](function(_0x12c13){console['log'](_0x12c13);});
\ No newline at end of file
diff --git a/server/config/socketio.js b/server/config/socketio.js
index 85ee4c1..901bcd4 100644
--- a/server/config/socketio.js
+++ b/server/config/socketio.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa3c4=['agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','UserProfileResource','resourceId','map','where','role','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueue','FaxQueue','MailQueues','WhatsappQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','all','voice','chat','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','leave','removeMailInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','log','default','connection','address','remoteAddress','request','remotePort','nsp','disconnect','DISCONNECTED','lodash','bluebird','../mysqldb','./environment','name','User'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa3c4,0x114));var _0x4a3c=function(_0x468188,_0x12a2f5){_0x468188=_0x468188-0x0;var _0x1b4129=_0xa3c4[_0x468188];return _0x1b4129;};'use strict';var _=require(_0x4a3c('0x0'));var util=require('util');var BPromise=require(_0x4a3c('0x1'));var db=require(_0x4a3c('0x2'))['db'];var config=require(_0x4a3c('0x3'));var queryQueues={'attributes':['id',_0x4a3c('0x4')],'include':[{'as':'Agents','model':db[_0x4a3c('0x5')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x4a3c('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x4a3c('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4a3c('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x4a3c('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4a3c('0x4'),_0x4a3c('0x8')],'where':{'type':_0x4a3c('0x9')}};function getAssociatedResources(_0x503219,_0x31ce0b,_0x255ee6){return db[_0x4a3c('0xa')][_0x4a3c('0xb')]({'where':{'name':_0x503219,'userProfileId':_0x31ce0b},'raw':!![]})[_0x4a3c('0xc')](function(_0x26ae54){if(_0x26ae54){if(_0x26ae54[_0x4a3c('0xd')]){switch(_0x503219){case _0x4a3c('0xe'):case _0x4a3c('0xf'):case _0x4a3c('0x10'):case _0x4a3c('0x11'):case'MailQueues':case _0x4a3c('0x12'):case _0x4a3c('0x13'):return db[_0x255ee6]['findAll'](queryQueues);case _0x4a3c('0x14'):return db[_0x255ee6][_0x4a3c('0x15')](queryTelephones);case _0x4a3c('0x16'):return db[_0x255ee6][_0x4a3c('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x255ee6][_0x4a3c('0x15')](queryCampaigns);}}else{return db[_0x4a3c('0x17')][_0x4a3c('0x15')]({'attributes':[_0x4a3c('0x18')],'where':{'sectionId':_0x26ae54['id']},'raw':!![]})[_0x4a3c('0xc')](function(_0x37b0cb){if(_0x37b0cb){var _0xc762f8={'where':{'id':_[_0x4a3c('0x19')](_0x37b0cb,_0x4a3c('0x18'))},'raw':!![]};switch(_0x255ee6){case _0x4a3c('0x5'):_0xc762f8[_0x4a3c('0x1a')][_0x4a3c('0x1b')]=_0x4a3c('0x7');break;case _0x4a3c('0x1c'):_0xc762f8['where'][_0x4a3c('0x8')]=_0x4a3c('0x9');break;}return db[_0x255ee6]['findAll'](_0xc762f8);}else{return[];}});}}else{return[];}})[_0x4a3c('0xc')](function(_0x537d52){return _0x537d52;});}function joinOrLeaveQueues(_0x43ca84,_0x30a892,_0x446ba8,_0x1f10f1){_0x43ca84[_0x30a892](util[_0x4a3c('0x1d')](_0x4a3c('0x1e'),_0x446ba8,_0x1f10f1['name']));if(_0x1f10f1[_0x4a3c('0x1f')]){for(var _0x531458=0x0;_0x531458<_0x1f10f1[_0x4a3c('0x1f')][_0x4a3c('0x20')];_0x531458+=0x1){_0x43ca84[_0x30a892](util[_0x4a3c('0x1d')](_0x4a3c('0x21'),_0x1f10f1['Agents'][_0x531458][_0x4a3c('0x4')]));}}}function joinOrLeave(_0x4574a4,_0xe30090,_0x597b2e){var _0x10ff09;if(_0x4574a4[_0x4a3c('0x22')]['query']['id']){db['User'][_0x4a3c('0x23')]({'attributes':['id',_0x4a3c('0x4'),_0x4a3c('0x1b'),_0x4a3c('0x24')],'where':{'id':_0x4574a4[_0x4a3c('0x22')][_0x4a3c('0x25')]['id']},'include':[{'model':db[_0x4a3c('0x26')],'as':_0x4a3c('0x27'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4a3c('0x28')],'as':_0x4a3c('0x29'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x4a3c('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x4a3c('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x4a3c('0x2c')],'as':_0x4a3c('0x2d'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x179b55){if(_0x179b55){_0x10ff09=_0x179b55;_0x4574a4[_0xe30090](util[_0x4a3c('0x1d')]('user:%s',_0x179b55[_0x4a3c('0x4')]));var _0x2eb071=[];switch(_0x179b55['role']){case'admin':_0x4574a4[_0xe30090](_0x4a3c('0x2e'));_0x4574a4[_0xe30090](_0x4a3c('0x2f'));if(queryQueues[_0x4a3c('0x30')](_0x4a3c('0x31'))){delete queryQueues['include'];}_0x2eb071[_0x4a3c('0x32')](db['VoiceQueue'][_0x4a3c('0x15')](queryQueues));_0x2eb071['push'](db[_0x4a3c('0x33')][_0x4a3c('0x15')](queryQueues));_0x2eb071[_0x4a3c('0x32')](db['FaxQueue'][_0x4a3c('0x15')](queryQueues));_0x2eb071['push'](db[_0x4a3c('0x34')][_0x4a3c('0x15')](queryQueues));_0x2eb071[_0x4a3c('0x32')](db[_0x4a3c('0x35')][_0x4a3c('0x15')](queryQueues));_0x2eb071[_0x4a3c('0x32')](db[_0x4a3c('0x36')][_0x4a3c('0x15')](queryQueues));_0x2eb071[_0x4a3c('0x32')](db['WhatsappQueue'][_0x4a3c('0x15')](queryQueues));_0x2eb071['push'](db[_0x4a3c('0x5')][_0x4a3c('0x15')](queryTelephones));_0x2eb071['push'](db[_0x4a3c('0x37')][_0x4a3c('0x15')](queryTrunks));_0x2eb071[_0x4a3c('0x32')](db['Campaign'][_0x4a3c('0x15')](queryCampaigns));_0x2eb071[_0x4a3c('0x32')](db[_0x4a3c('0x5')]['findAll'](queryAgents));break;case _0x4a3c('0x38'):_0x4574a4[_0xe30090]('voice:inbound');_0x4574a4[_0xe30090](_0x4a3c('0x2f'));_0x2eb071['push'](getAssociatedResources('VoiceQueues',_0x179b55[_0x4a3c('0x24')],_0x4a3c('0x39')));_0x2eb071[_0x4a3c('0x32')](getAssociatedResources(_0x4a3c('0xf'),_0x179b55['userProfileId'],_0x4a3c('0x33')));_0x2eb071['push'](getAssociatedResources(_0x4a3c('0x10'),_0x179b55[_0x4a3c('0x24')],_0x4a3c('0x3a')));_0x2eb071[_0x4a3c('0x32')](getAssociatedResources(_0x4a3c('0x11'),_0x179b55[_0x4a3c('0x24')],_0x4a3c('0x34')));_0x2eb071[_0x4a3c('0x32')](getAssociatedResources(_0x4a3c('0x3b'),_0x179b55[_0x4a3c('0x24')],_0x4a3c('0x35')));_0x2eb071[_0x4a3c('0x32')](getAssociatedResources('OpenchannelQueues',_0x179b55[_0x4a3c('0x24')],_0x4a3c('0x36')));_0x2eb071[_0x4a3c('0x32')](getAssociatedResources(_0x4a3c('0x13'),_0x179b55['userProfileId'],_0x4a3c('0x3c')));_0x2eb071[_0x4a3c('0x32')](getAssociatedResources('Telephones',_0x179b55['userProfileId'],_0x4a3c('0x5')));_0x2eb071[_0x4a3c('0x32')](getAssociatedResources(_0x4a3c('0x16'),_0x179b55[_0x4a3c('0x24')],_0x4a3c('0x37')));_0x2eb071[_0x4a3c('0x32')](getAssociatedResources(_0x4a3c('0x3d'),_0x179b55[_0x4a3c('0x24')],_0x4a3c('0x1c')));_0x2eb071[_0x4a3c('0x32')](db['User'][_0x4a3c('0x15')](queryAgents));break;case'agent':_0x4574a4[_0xe30090](_0x4a3c('0x2e'));_0x4574a4[_0xe30090](_0x4a3c('0x2f'));_0x2eb071[_0x4a3c('0x32')](_0x179b55[_0x4a3c('0x3e')]({'attributes':['id','name']}));_0x2eb071[_0x4a3c('0x32')](_0x179b55[_0x4a3c('0x3f')]({'attributes':['id','name']}));_0x2eb071['push'](_0x179b55[_0x4a3c('0x40')]({'attributes':['id','name']}));_0x2eb071[_0x4a3c('0x32')](_0x179b55['getSmsQueues']({'attributes':['id',_0x4a3c('0x4')]}));_0x2eb071[_0x4a3c('0x32')](_0x179b55[_0x4a3c('0x41')]({'attributes':['id',_0x4a3c('0x4')]}));_0x2eb071[_0x4a3c('0x32')](_0x179b55['getOpenchannelQueues']({'attributes':['id',_0x4a3c('0x4')]}));_0x2eb071[_0x4a3c('0x32')](_0x179b55['getWhatsappQueues']({'attributes':['id',_0x4a3c('0x4')]}));break;}return BPromise[_0x4a3c('0x42')](_0x2eb071);}})[_0x4a3c('0xc')](function(_0x45164b){if(_0x45164b&&_0x45164b[_0x4a3c('0x20')]){for(var _0x1a81ea=0x0;_0x1a81ea<_0x45164b[_0x4a3c('0x20')];_0x1a81ea+=0x1){for(var _0x6c0242=0x0;_0x6c0242<_0x45164b[_0x1a81ea][_0x4a3c('0x20')];_0x6c0242+=0x1){switch(_0x1a81ea){case 0x0:joinOrLeaveQueues(_0x4574a4,_0xe30090,_0x4a3c('0x43'),_0x45164b[_0x1a81ea][_0x6c0242]);break;case 0x1:joinOrLeaveQueues(_0x4574a4,_0xe30090,_0x4a3c('0x44'),_0x45164b[_0x1a81ea][_0x6c0242]);break;case 0x2:joinOrLeaveQueues(_0x4574a4,_0xe30090,'fax',_0x45164b[_0x1a81ea][_0x6c0242]);break;case 0x3:joinOrLeaveQueues(_0x4574a4,_0xe30090,_0x4a3c('0x45'),_0x45164b[_0x1a81ea][_0x6c0242]);break;case 0x4:joinOrLeaveQueues(_0x4574a4,_0xe30090,_0x4a3c('0x46'),_0x45164b[_0x1a81ea][_0x6c0242]);break;case 0x5:joinOrLeaveQueues(_0x4574a4,_0xe30090,_0x4a3c('0x47'),_0x45164b[_0x1a81ea][_0x6c0242]);break;case 0x6:joinOrLeaveQueues(_0x4574a4,_0xe30090,_0x4a3c('0x48'),_0x45164b[_0x1a81ea][_0x6c0242]);break;case 0x7:_0x4574a4[_0xe30090](util['format']('telephone:%s',_0x45164b[_0x1a81ea][_0x6c0242][_0x4a3c('0x4')]));break;case 0x8:_0x4574a4[_0xe30090](util['format'](_0x4a3c('0x49'),_0x45164b[_0x1a81ea][_0x6c0242]['name']));break;case 0x9:_0x4574a4[_0xe30090](util[_0x4a3c('0x1d')](_0x4a3c('0x4a'),_0x45164b[_0x1a81ea][_0x6c0242][_0x4a3c('0x8')],_0x45164b[_0x1a81ea][_0x6c0242][_0x4a3c('0x4')]));break;case 0xa:_0x4574a4[_0xe30090](util['format'](_0x4a3c('0x21'),_0x45164b[_0x1a81ea][_0x6c0242]['name']));break;}}}}})['then'](function(){if(_0xe30090==='leave'){var _0x2e2dea=_[_0x4a3c('0x19')](_0x10ff09['ChatInteractions'],'id');return _0x10ff09[_0x4a3c('0x4b')](_0x2e2dea)['then'](function(){for(var _0x47fbe5=0x0;_0x47fbe5<_0x2e2dea[_0x4a3c('0x20')];_0x47fbe5+=0x1){_0x597b2e[_0x4a3c('0x4c')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2e2dea[_0x47fbe5]),'UserId':Number(_0x10ff09['id'])});}});}})['then'](function(){if(_0xe30090===_0x4a3c('0x4d')){var _0x19bb4f=_[_0x4a3c('0x19')](_0x10ff09['MailInteractions'],'id');return _0x10ff09[_0x4a3c('0x4e')](_0x19bb4f)[_0x4a3c('0xc')](function(){for(var _0x3519d5=0x0;_0x3519d5<_0x19bb4f[_0x4a3c('0x20')];_0x3519d5+=0x1){_0x597b2e[_0x4a3c('0x4c')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x19bb4f[_0x3519d5]),'UserId':Number(_0x10ff09['id'])});}});}})['then'](function(){if(_0xe30090===_0x4a3c('0x4d')){var _0x5a6ecf=_[_0x4a3c('0x19')](_0x10ff09[_0x4a3c('0x29')],'id');return _0x10ff09['removeFaxInteractions'](_0x5a6ecf)[_0x4a3c('0xc')](function(){for(var _0x304fd6=0x0;_0x304fd6<_0x5a6ecf[_0x4a3c('0x20')];_0x304fd6+=0x1){_0x597b2e[_0x4a3c('0x4c')](_0x4a3c('0x4f'),{'FaxInteractionId':Number(_0x5a6ecf[_0x304fd6]),'UserId':Number(_0x10ff09['id'])});}});}})[_0x4a3c('0xc')](function(){if(_0xe30090==='leave'){var _0x3fcc5b=_[_0x4a3c('0x19')](_0x10ff09[_0x4a3c('0x2a')],'id');return _0x10ff09[_0x4a3c('0x50')](_0x3fcc5b)[_0x4a3c('0xc')](function(){for(var _0x5d31e5=0x0;_0x5d31e5<_0x3fcc5b['length'];_0x5d31e5+=0x1){_0x597b2e[_0x4a3c('0x4c')](_0x4a3c('0x51'),{'SmsInteractionId':Number(_0x3fcc5b[_0x5d31e5]),'UserId':Number(_0x10ff09['id'])});}});}})[_0x4a3c('0xc')](function(){if(_0xe30090==='leave'){var _0x59cb8f=_[_0x4a3c('0x19')](_0x10ff09['OpenchannelInteractions'],'id');return _0x10ff09[_0x4a3c('0x52')](_0x59cb8f)['then'](function(){for(var _0x3b8f90=0x0;_0x3b8f90<_0x59cb8f[_0x4a3c('0x20')];_0x3b8f90+=0x1){_0x597b2e['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x59cb8f[_0x3b8f90]),'UserId':Number(_0x10ff09['id'])});}});}})['then'](function(){if(_0xe30090===_0x4a3c('0x4d')){var _0x56510c=_[_0x4a3c('0x19')](_0x10ff09[_0x4a3c('0x2d')],'id');return _0x10ff09[_0x4a3c('0x53')](_0x56510c)[_0x4a3c('0xc')](function(){for(var _0x43ac57=0x0;_0x43ac57<_0x56510c[_0x4a3c('0x20')];_0x43ac57+=0x1){_0x597b2e['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x56510c[_0x43ac57]),'UserId':Number(_0x10ff09['id'])});}});}})['catch'](function(_0x312f64){_0x4574a4[_0x4a3c('0x54')](_0x312f64);});}}function onDisconnect(_0x448fd9,_0x53960e){joinOrLeave(_0x448fd9,_0x4a3c('0x4d'),_0x53960e);}function onConnect(_0x370ffd){joinOrLeave(_0x370ffd,'join');}exports[_0x4a3c('0x55')]=function(_0x598650){_0x598650['on'](_0x4a3c('0x56'),function(_0x4bc4e7){_0x4bc4e7['setMaxListeners'](0x0);_0x4bc4e7[_0x4a3c('0x57')]=_0x4bc4e7['request']['connection'][_0x4a3c('0x58')]+':'+_0x4bc4e7[_0x4a3c('0x59')][_0x4a3c('0x56')][_0x4a3c('0x5a')];_0x4bc4e7['connectedAt']=new Date();_0x4bc4e7[_0x4a3c('0x54')]=function(_0x33099c){console[_0x4a3c('0x54')]('SocketIO\x20'+_0x4bc4e7[_0x4a3c('0x5b')][_0x4a3c('0x4')]+'['+_0x4bc4e7[_0x4a3c('0x57')]+']',_0x33099c);};_0x4bc4e7['on'](_0x4a3c('0x5c'),function(){onDisconnect(_0x4bc4e7,_0x598650);_0x4bc4e7[_0x4a3c('0x54')](_0x4a3c('0x5d'));});onConnect(_0x4bc4e7);_0x4bc4e7[_0x4a3c('0x54')]('CONNECTED');});};
\ No newline at end of file
+var _0x6ae0=['then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','IvrCampaigns','UserProfileResource','map','resourceId','telephone','Campaign','where','type','format','query','User','role','userProfileId','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','user:%s','admin','voice:inbound','hasOwnProperty','include','VoiceQueue','push','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','voice:outbound','ChatQueue','FaxQueue','WhatsappQueues','WhatsappQueue','Telephones','Trunks','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','Agents','name','agent','ivr','UserProfileSection','findOne'];(function(_0x403167,_0x1d67c9){var _0x1afe50=function(_0x51f326){while(--_0x51f326){_0x403167['push'](_0x403167['shift']());}};_0x1afe50(++_0x1d67c9);}(_0x6ae0,0x192));var _0x06ae=function(_0x397cb5,_0x60d6b2){_0x397cb5=_0x397cb5-0x0;var _0x2a5444=_0x6ae0[_0x397cb5];return _0x2a5444;};'use strict';var _=require(_0x06ae('0x0'));var util=require(_0x06ae('0x1'));var BPromise=require(_0x06ae('0x2'));var db=require(_0x06ae('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x06ae('0x4'),'model':db['User'],'attributes':['id',_0x06ae('0x5'),'role'],'raw':!![],'where':{'role':_0x06ae('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x06ae('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x06ae('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x06ae('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x06ae('0x5'),'type'],'where':{'type':_0x06ae('0x7')}};function getAssociatedResources(_0x240758,_0x4ce533,_0x39f10e){return db[_0x06ae('0x8')][_0x06ae('0x9')]({'where':{'name':_0x240758,'userProfileId':_0x4ce533},'raw':!![]})[_0x06ae('0xa')](function(_0x58aac0){if(_0x58aac0){if(_0x58aac0[_0x06ae('0xb')]){switch(_0x240758){case _0x06ae('0xc'):case _0x06ae('0xd'):case _0x06ae('0xe'):case _0x06ae('0xf'):case _0x06ae('0x10'):case _0x06ae('0x11'):case'WhatsappQueues':return db[_0x39f10e]['findAll'](queryQueues);case'Telephones':return db[_0x39f10e][_0x06ae('0x12')](queryTelephones);case'Trunks':return db[_0x39f10e][_0x06ae('0x12')](queryTrunks);case _0x06ae('0x13'):return db[_0x39f10e][_0x06ae('0x12')](queryCampaigns);}}else{return db[_0x06ae('0x14')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x58aac0['id']},'raw':!![]})[_0x06ae('0xa')](function(_0x5f44a2){if(_0x5f44a2){var _0x1c8fd7={'where':{'id':_[_0x06ae('0x15')](_0x5f44a2,_0x06ae('0x16'))},'raw':!![]};switch(_0x39f10e){case'User':_0x1c8fd7['where']['role']=_0x06ae('0x17');break;case _0x06ae('0x18'):_0x1c8fd7[_0x06ae('0x19')][_0x06ae('0x1a')]=_0x06ae('0x7');break;}return db[_0x39f10e][_0x06ae('0x12')](_0x1c8fd7);}else{return[];}});}}else{return[];}})[_0x06ae('0xa')](function(_0x5b18a9){return _0x5b18a9;});}function joinOrLeaveQueues(_0x490cd0,_0x4b6b2b,_0x48fb16,_0x3f1f62){_0x490cd0[_0x4b6b2b](util[_0x06ae('0x1b')]('%s:queue:%s',_0x48fb16,_0x3f1f62[_0x06ae('0x5')]));if(_0x3f1f62[_0x06ae('0x4')]){for(var _0x467156=0x0;_0x467156<_0x3f1f62[_0x06ae('0x4')]['length'];_0x467156+=0x1){_0x490cd0[_0x4b6b2b](util[_0x06ae('0x1b')]('user:%s',_0x3f1f62[_0x06ae('0x4')][_0x467156][_0x06ae('0x5')]));}}}function joinOrLeave(_0x540b50,_0x32c535,_0x264785){var _0x2c4480;if(_0x540b50['handshake'][_0x06ae('0x1c')]['id']){db[_0x06ae('0x1d')]['find']({'attributes':['id',_0x06ae('0x5'),_0x06ae('0x1e'),_0x06ae('0x1f')],'where':{'id':_0x540b50[_0x06ae('0x20')][_0x06ae('0x1c')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x06ae('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x06ae('0x22')],'as':_0x06ae('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x06ae('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x06ae('0x25')],'as':_0x06ae('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x06ae('0x27')],'as':_0x06ae('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x06ae('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x1baff9){if(_0x1baff9){_0x2c4480=_0x1baff9;_0x540b50[_0x32c535](util[_0x06ae('0x1b')](_0x06ae('0x2a'),_0x1baff9[_0x06ae('0x5')]));var _0x7ffa60=[];switch(_0x1baff9['role']){case _0x06ae('0x2b'):_0x540b50[_0x32c535](_0x06ae('0x2c'));_0x540b50[_0x32c535]('voice:outbound');if(queryQueues[_0x06ae('0x2d')]('include')){delete queryQueues[_0x06ae('0x2e')];}_0x7ffa60['push'](db[_0x06ae('0x2f')][_0x06ae('0x12')](queryQueues));_0x7ffa60[_0x06ae('0x30')](db['ChatQueue'][_0x06ae('0x12')](queryQueues));_0x7ffa60['push'](db['FaxQueue']['findAll'](queryQueues));_0x7ffa60[_0x06ae('0x30')](db[_0x06ae('0x31')]['findAll'](queryQueues));_0x7ffa60[_0x06ae('0x30')](db[_0x06ae('0x32')]['findAll'](queryQueues));_0x7ffa60[_0x06ae('0x30')](db[_0x06ae('0x33')]['findAll'](queryQueues));_0x7ffa60['push'](db['WhatsappQueue'][_0x06ae('0x12')](queryQueues));_0x7ffa60[_0x06ae('0x30')](db[_0x06ae('0x1d')]['findAll'](queryTelephones));_0x7ffa60['push'](db[_0x06ae('0x34')]['findAll'](queryTrunks));_0x7ffa60['push'](db[_0x06ae('0x18')][_0x06ae('0x12')](queryCampaigns));_0x7ffa60[_0x06ae('0x30')](db[_0x06ae('0x1d')]['findAll'](queryAgents));break;case _0x06ae('0x35'):_0x540b50[_0x32c535](_0x06ae('0x2c'));_0x540b50[_0x32c535](_0x06ae('0x36'));_0x7ffa60[_0x06ae('0x30')](getAssociatedResources(_0x06ae('0xc'),_0x1baff9[_0x06ae('0x1f')],_0x06ae('0x2f')));_0x7ffa60[_0x06ae('0x30')](getAssociatedResources(_0x06ae('0xd'),_0x1baff9[_0x06ae('0x1f')],_0x06ae('0x37')));_0x7ffa60[_0x06ae('0x30')](getAssociatedResources(_0x06ae('0xe'),_0x1baff9['userProfileId'],_0x06ae('0x38')));_0x7ffa60[_0x06ae('0x30')](getAssociatedResources(_0x06ae('0xf'),_0x1baff9[_0x06ae('0x1f')],_0x06ae('0x31')));_0x7ffa60['push'](getAssociatedResources(_0x06ae('0x10'),_0x1baff9['userProfileId'],_0x06ae('0x32')));_0x7ffa60[_0x06ae('0x30')](getAssociatedResources(_0x06ae('0x11'),_0x1baff9[_0x06ae('0x1f')],_0x06ae('0x33')));_0x7ffa60['push'](getAssociatedResources(_0x06ae('0x39'),_0x1baff9[_0x06ae('0x1f')],_0x06ae('0x3a')));_0x7ffa60[_0x06ae('0x30')](getAssociatedResources(_0x06ae('0x3b'),_0x1baff9['userProfileId'],_0x06ae('0x1d')));_0x7ffa60['push'](getAssociatedResources(_0x06ae('0x3c'),_0x1baff9[_0x06ae('0x1f')],_0x06ae('0x34')));_0x7ffa60[_0x06ae('0x30')](getAssociatedResources(_0x06ae('0x13'),_0x1baff9['userProfileId'],_0x06ae('0x18')));_0x7ffa60[_0x06ae('0x30')](db['User'][_0x06ae('0x12')](queryAgents));break;case _0x06ae('0x6'):_0x540b50[_0x32c535]('voice:inbound');_0x540b50[_0x32c535](_0x06ae('0x36'));_0x7ffa60['push'](_0x1baff9['getVoiceQueues']({'attributes':['id','name']}));_0x7ffa60[_0x06ae('0x30')](_0x1baff9[_0x06ae('0x3d')]({'attributes':['id',_0x06ae('0x5')]}));_0x7ffa60[_0x06ae('0x30')](_0x1baff9[_0x06ae('0x3e')]({'attributes':['id',_0x06ae('0x5')]}));_0x7ffa60[_0x06ae('0x30')](_0x1baff9[_0x06ae('0x3f')]({'attributes':['id','name']}));_0x7ffa60[_0x06ae('0x30')](_0x1baff9[_0x06ae('0x40')]({'attributes':['id',_0x06ae('0x5')]}));_0x7ffa60[_0x06ae('0x30')](_0x1baff9['getOpenchannelQueues']({'attributes':['id',_0x06ae('0x5')]}));_0x7ffa60[_0x06ae('0x30')](_0x1baff9[_0x06ae('0x41')]({'attributes':['id',_0x06ae('0x5')]}));break;}return BPromise[_0x06ae('0x42')](_0x7ffa60);}})[_0x06ae('0xa')](function(_0x2cfaac){if(_0x2cfaac&&_0x2cfaac[_0x06ae('0x43')]){for(var _0x1ce9e6=0x0;_0x1ce9e6<_0x2cfaac[_0x06ae('0x43')];_0x1ce9e6+=0x1){for(var _0x3e56b9=0x0;_0x3e56b9<_0x2cfaac[_0x1ce9e6][_0x06ae('0x43')];_0x3e56b9+=0x1){switch(_0x1ce9e6){case 0x0:joinOrLeaveQueues(_0x540b50,_0x32c535,_0x06ae('0x44'),_0x2cfaac[_0x1ce9e6][_0x3e56b9]);break;case 0x1:joinOrLeaveQueues(_0x540b50,_0x32c535,_0x06ae('0x45'),_0x2cfaac[_0x1ce9e6][_0x3e56b9]);break;case 0x2:joinOrLeaveQueues(_0x540b50,_0x32c535,_0x06ae('0x46'),_0x2cfaac[_0x1ce9e6][_0x3e56b9]);break;case 0x3:joinOrLeaveQueues(_0x540b50,_0x32c535,_0x06ae('0x47'),_0x2cfaac[_0x1ce9e6][_0x3e56b9]);break;case 0x4:joinOrLeaveQueues(_0x540b50,_0x32c535,_0x06ae('0x48'),_0x2cfaac[_0x1ce9e6][_0x3e56b9]);break;case 0x5:joinOrLeaveQueues(_0x540b50,_0x32c535,_0x06ae('0x49'),_0x2cfaac[_0x1ce9e6][_0x3e56b9]);break;case 0x6:joinOrLeaveQueues(_0x540b50,_0x32c535,_0x06ae('0x4a'),_0x2cfaac[_0x1ce9e6][_0x3e56b9]);break;case 0x7:_0x540b50[_0x32c535](util['format'](_0x06ae('0x4b'),_0x2cfaac[_0x1ce9e6][_0x3e56b9][_0x06ae('0x5')]));break;case 0x8:_0x540b50[_0x32c535](util[_0x06ae('0x1b')](_0x06ae('0x4c'),_0x2cfaac[_0x1ce9e6][_0x3e56b9][_0x06ae('0x5')]));break;case 0x9:_0x540b50[_0x32c535](util[_0x06ae('0x1b')](_0x06ae('0x4d'),_0x2cfaac[_0x1ce9e6][_0x3e56b9][_0x06ae('0x1a')],_0x2cfaac[_0x1ce9e6][_0x3e56b9]['name']));break;case 0xa:_0x540b50[_0x32c535](util[_0x06ae('0x1b')](_0x06ae('0x2a'),_0x2cfaac[_0x1ce9e6][_0x3e56b9][_0x06ae('0x5')]));break;}}}}})[_0x06ae('0xa')](function(){if(_0x32c535==='leave'){var _0x5df691=_[_0x06ae('0x15')](_0x2c4480[_0x06ae('0x21')],'id');return _0x2c4480[_0x06ae('0x4e')](_0x5df691)[_0x06ae('0xa')](function(){for(var _0x1c014c=0x0;_0x1c014c<_0x5df691['length'];_0x1c014c+=0x1){_0x264785[_0x06ae('0x4f')](_0x06ae('0x50'),{'ChatInteractionId':Number(_0x5df691[_0x1c014c]),'UserId':Number(_0x2c4480['id'])});}});}})[_0x06ae('0xa')](function(){if(_0x32c535===_0x06ae('0x51')){var _0x5552ef=_[_0x06ae('0x15')](_0x2c4480[_0x06ae('0x23')],'id');return _0x2c4480[_0x06ae('0x52')](_0x5552ef)['then'](function(){for(var _0x2dcfc1=0x0;_0x2dcfc1<_0x5552ef[_0x06ae('0x43')];_0x2dcfc1+=0x1){_0x264785[_0x06ae('0x4f')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x5552ef[_0x2dcfc1]),'UserId':Number(_0x2c4480['id'])});}});}})[_0x06ae('0xa')](function(){if(_0x32c535==='leave'){var _0x3b68cf=_[_0x06ae('0x15')](_0x2c4480[_0x06ae('0x53')],'id');return _0x2c4480[_0x06ae('0x54')](_0x3b68cf)[_0x06ae('0xa')](function(){for(var _0xee6b8f=0x0;_0xee6b8f<_0x3b68cf[_0x06ae('0x43')];_0xee6b8f+=0x1){_0x264785[_0x06ae('0x4f')](_0x06ae('0x55'),{'FaxInteractionId':Number(_0x3b68cf[_0xee6b8f]),'UserId':Number(_0x2c4480['id'])});}});}})[_0x06ae('0xa')](function(){if(_0x32c535===_0x06ae('0x51')){var _0x4f858e=_[_0x06ae('0x15')](_0x2c4480[_0x06ae('0x26')],'id');return _0x2c4480[_0x06ae('0x56')](_0x4f858e)[_0x06ae('0xa')](function(){for(var _0x2d6958=0x0;_0x2d6958<_0x4f858e[_0x06ae('0x43')];_0x2d6958+=0x1){_0x264785[_0x06ae('0x4f')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x4f858e[_0x2d6958]),'UserId':Number(_0x2c4480['id'])});}});}})[_0x06ae('0xa')](function(){if(_0x32c535===_0x06ae('0x51')){var _0x400136=_['map'](_0x2c4480[_0x06ae('0x28')],'id');return _0x2c4480[_0x06ae('0x57')](_0x400136)[_0x06ae('0xa')](function(){for(var _0xdb82a7=0x0;_0xdb82a7<_0x400136[_0x06ae('0x43')];_0xdb82a7+=0x1){_0x264785[_0x06ae('0x4f')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x400136[_0xdb82a7]),'UserId':Number(_0x2c4480['id'])});}});}})['then'](function(){if(_0x32c535==='leave'){var _0x2fa87c=_[_0x06ae('0x15')](_0x2c4480[_0x06ae('0x29')],'id');return _0x2c4480[_0x06ae('0x58')](_0x2fa87c)['then'](function(){for(var _0x32808b=0x0;_0x32808b<_0x2fa87c['length'];_0x32808b+=0x1){_0x264785[_0x06ae('0x4f')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2fa87c[_0x32808b]),'UserId':Number(_0x2c4480['id'])});}});}})['catch'](function(_0x495da6){_0x540b50['log'](_0x495da6);});}}function onDisconnect(_0x2070a0,_0x5910a9){joinOrLeave(_0x2070a0,_0x06ae('0x51'),_0x5910a9);}function onConnect(_0x111a55){joinOrLeave(_0x111a55,_0x06ae('0x59'));}exports[_0x06ae('0x5a')]=function(_0x14845d){_0x14845d['on']('connection',function(_0x8d8f3){_0x8d8f3[_0x06ae('0x5b')](0x0);_0x8d8f3[_0x06ae('0x5c')]=_0x8d8f3[_0x06ae('0x5d')][_0x06ae('0x5e')][_0x06ae('0x5f')]+':'+_0x8d8f3[_0x06ae('0x5d')][_0x06ae('0x5e')][_0x06ae('0x60')];_0x8d8f3[_0x06ae('0x61')]=new Date();_0x8d8f3[_0x06ae('0x62')]=function(_0xf7cbe1){console[_0x06ae('0x62')](_0x06ae('0x63')+_0x8d8f3[_0x06ae('0x64')]['name']+'['+_0x8d8f3[_0x06ae('0x5c')]+']',_0xf7cbe1);};_0x8d8f3['on']('disconnect',function(){onDisconnect(_0x8d8f3,_0x14845d);_0x8d8f3[_0x06ae('0x62')](_0x06ae('0x65'));});onConnect(_0x8d8f3);_0x8d8f3[_0x06ae('0x62')](_0x06ae('0x66'));});};
\ No newline at end of file
diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js
index 33f7b5b..018b788 100644
--- a/server/config/triggers/index.js
+++ b/server/config/triggers/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb93d=['find','name','interface','format','incomingmessage','catch','outgoingmessage','event','opened','closed','length','hasOwnProperty','model','toLowerCase','../../mysqldb','jayson/promise','../logger','triggers','client','Chat','ChatInteraction','newinteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','get','channel','direction','UserId','User'];(function(_0x22eb5d,_0x2e519d){var _0x4a39ad=function(_0x4a1206){while(--_0x4a1206){_0x22eb5d['push'](_0x22eb5d['shift']());}};_0x4a39ad(++_0x2e519d);}(_0xb93d,0xaa));var _0xdb93=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xb93d[_0x346737];return _0x1ade2e;};'use strict';var util=require('util');var db=require(_0xdb93('0x0'))['db'];var jayson=require(_0xdb93('0x1'));var logger=require(_0xdb93('0x2'))(_0xdb93('0x3'));var client=jayson[_0xdb93('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0xdb93('0x5'),'model':_0xdb93('0x6'),'event':'afterCreate','condition':_0xdb93('0x7'),'callback':afterCreate},{'channel':'Chat','model':_0xdb93('0x6'),'event':_0xdb93('0x8'),'condition':_0xdb93('0x9'),'callback':afterUpdate},{'channel':_0xdb93('0x5'),'model':_0xdb93('0xa'),'event':_0xdb93('0xb'),'condition':_0xdb93('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':_0xdb93('0xb'),'condition':_0xdb93('0x7'),'callback':afterCreate},{'channel':'Sms','model':_0xdb93('0xd'),'event':_0xdb93('0x8'),'condition':_0xdb93('0x9'),'callback':afterUpdate},{'channel':_0xdb93('0xe'),'model':_0xdb93('0xf'),'event':_0xdb93('0xb'),'condition':_0xdb93('0xc'),'callback':afterCreateMessage},{'channel':_0xdb93('0x10'),'model':_0xdb93('0x11'),'event':_0xdb93('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xdb93('0x10'),'model':'WhatsappInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdb93('0x10'),'model':'WhatsappMessage','event':'afterCreate','condition':_0xdb93('0xc'),'callback':afterCreateMessage},{'channel':_0xdb93('0x12'),'model':_0xdb93('0x13'),'event':'afterCreate','condition':_0xdb93('0x7'),'callback':afterCreate},{'channel':_0xdb93('0x12'),'model':_0xdb93('0x13'),'event':_0xdb93('0x8'),'condition':_0xdb93('0x9'),'callback':afterUpdate},{'channel':_0xdb93('0x12'),'model':_0xdb93('0x14'),'event':_0xdb93('0xb'),'condition':_0xdb93('0xc'),'callback':afterCreateMessage},{'channel':_0xdb93('0x15'),'model':_0xdb93('0x16'),'event':_0xdb93('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xdb93('0x15'),'model':'MailInteraction','event':'afterUpdate','condition':_0xdb93('0x9'),'callback':afterUpdate},{'channel':_0xdb93('0x15'),'model':_0xdb93('0x17'),'event':_0xdb93('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xdb93('0x18'),'model':_0xdb93('0x19'),'event':_0xdb93('0xb'),'condition':_0xdb93('0x7'),'callback':afterCreate},{'channel':_0xdb93('0x18'),'model':_0xdb93('0x19'),'event':_0xdb93('0x8'),'condition':_0xdb93('0x9'),'callback':afterUpdate},{'channel':_0xdb93('0x18'),'model':_0xdb93('0x1a'),'event':_0xdb93('0xb'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x2765a0){return client[_0xdb93('0x1b')](_0xdb93('0x1c'),_0x2765a0)[_0xdb93('0x1d')](function(_0xa4f27a){logger[_0xdb93('0x1e')](_0xdb93('0x1f'),_0xdb93('0x1c'),_0xa4f27a);if(_0xa4f27a[_0xdb93('0x20')]){if(_0xa4f27a[_0xdb93('0x20')]['code']===0x1f4){logger['error'](_0xdb93('0x1f'),'EventManager',_0xa4f27a[_0xdb93('0x20')]);}}})['catch'](function(_0x3edc7a){logger['error'](_0xdb93('0x1f'),_0xdb93('0x1c'),_0x3edc7a);});}function afterCreateMessage(_0x3d41d1,_0x39d014){return function(_0x4cb653,_0x467279){_0x4cb653=_0x4cb653[_0xdb93('0x21')]({'plain':!![]});_0x4cb653[_0xdb93('0x22')]=_0x3d41d1;_0x4cb653['event']=_0x4cb653[_0xdb93('0x23')];if(_0x4cb653[_0xdb93('0x24')]){return db[_0xdb93('0x25')][_0xdb93('0x26')]({'where':{'id':_0x4cb653[_0xdb93('0x24')]},'attributes':['id',_0xdb93('0x27')],'raw':!![]})[_0xdb93('0x1d')](function(_0x5692b4){_0x4cb653[_0xdb93('0x28')]=util[_0xdb93('0x29')]('SIP/%s',_0x5692b4[_0xdb93('0x27')]);_0x4cb653['channel']=_0x3d41d1;return request({'event':_0xdb93('0x2a'),'message':_0x4cb653});})[_0xdb93('0x2b')](function(_0x35320d){console['error'](_0x35320d);});}else{return request({'event':_0xdb93('0x2c'),'message':_0x4cb653});}};}function afterCreate(_0x152681,_0x587569){return function(_0x4d9a7e,_0x4dae8d){_0x4d9a7e=_0x4d9a7e['get']({'plain':!![]});_0x4d9a7e[_0xdb93('0x22')]=_0x152681;_0x4d9a7e[_0xdb93('0x2d')]=_0xdb93('0x2e');return request({'event':_0x587569,'message':_0x4d9a7e});};}function afterUpdate(_0x496ff0,_0x1813a9){return function(_0xddd1fe,_0x4d2766){if(_0xddd1fe['changed'](_0xdb93('0x2f'))&&_0xddd1fe['closed']){_0xddd1fe=_0xddd1fe[_0xdb93('0x21')]({'plain':!![]});_0xddd1fe[_0xdb93('0x22')]=_0x496ff0;_0xddd1fe[_0xdb93('0x2d')]=_0xdb93('0x2f');if(_0xddd1fe[_0xdb93('0x24')]){return db['User'][_0xdb93('0x26')]({'where':{'id':_0xddd1fe[_0xdb93('0x24')]},'attributes':['id',_0xdb93('0x27')],'raw':!![]})['then'](function(_0x63522d){_0xddd1fe['interface']=util[_0xdb93('0x29')]('SIP/%s',_0x63522d[_0xdb93('0x27')]);return request({'event':_0x1813a9,'message':_0xddd1fe});})[_0xdb93('0x2b')](function(_0x20114c){console[_0xdb93('0x20')](_0x20114c);});}else{return request({'event':_0x1813a9,'message':_0xddd1fe});}}};}exports['default']=function(){for(var _0x527780=0x0;_0x527780=_0x5ac2a7[_0xeb3d('0x14')]){throw Error(_0xeb3d('0x15'));}_0x4106fd(_0x15f399);})[_0xeb3d('0x16')](function(_0x1dec89){_0x3de0be(_0x1dec89);});});};
\ No newline at end of file
+var _0x5c34=['whatsapp','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','agents','catch','lodash','../mysqldb','./license/util','voice','mail'];(function(_0x57e6b8,_0x630228){var _0x1601f4=function(_0x36efc0){while(--_0x36efc0){_0x57e6b8['push'](_0x57e6b8['shift']());}};_0x1601f4(++_0x630228);}(_0x5c34,0x1f3));var _0x45c3=function(_0x522fc2,_0x43bd0f){_0x522fc2=_0x522fc2-0x0;var _0x39c8e9=_0x5c34[_0x522fc2];return _0x39c8e9;};'use strict';var _=require(_0x45c3('0x0'));var BPromise=require('bluebird');var db=require(_0x45c3('0x1'))['db'];var util=require(_0x45c3('0x2'));var channels=[_0x45c3('0x3'),_0x45c3('0x4'),'chat','fax','sms',_0x45c3('0x5'),_0x45c3('0x6')];exports['getChannels']=function(){return channels;};exports[_0x45c3('0x7')]=function(_0x207a7c){_0x207a7c=_0x207a7c[_0x45c3('0x8')]();return _[_0x45c3('0x9')](channels,_0x207a7c);};exports[_0x45c3('0xa')]=function(_0x2704a3,_0x1c7bbf,_0x8236d2,_0x1ca42d){var _0x920e3c={'loginAttempts':_0x1c7bbf,'blocked':_0x8236d2};if(!_[_0x45c3('0xb')](_0x1ca42d)){_0x920e3c[_0x45c3('0xc')]=_0x1ca42d;}return _0x2704a3[_0x45c3('0xd')](_0x920e3c);};exports[_0x45c3('0xe')]=function(_0x2e475d){return new BPromise(function(_0x182a23,_0x36b2d6){var _0x565c9e=0x0;if(_0x2e475d[_0x45c3('0xf')]!==_0x45c3('0x10')){_0x182a23(_0x2e475d);}db[_0x45c3('0x11')][_0x45c3('0x12')]({'where':{'role':_0x45c3('0x10'),'online':!![],'id':{'$ne':_0x2e475d['id']}}})['then'](function(_0x2bb00f){_0x565c9e=_0x2bb00f;return util[_0x45c3('0xe')]();})['then'](function(_0x2a7478){if(_0x2a7478&&_0x2a7478[_0x45c3('0x13')]&&_0x565c9e>=_0x2a7478['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x182a23(_0x2e475d);})[_0x45c3('0x14')](function(_0x3c1e82){_0x36b2d6(_0x3c1e82);});});};
\ No newline at end of file
diff --git a/server/errors/index.js b/server/errors/index.js
index f7cdb7f..8a70ae9 100644
--- a/server/errors/index.js
+++ b/server/errors/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9946=['exports','404','status','render','json','send'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0x9946,0x17a));var _0x6994=function(_0x10d864,_0x5d2d91){_0x10d864=_0x10d864-0x0;var _0x1b2775=_0x9946[_0x10d864];return _0x1b2775;};'use strict';module[_0x6994('0x0')][0x194]=function pageNotFound(_0x5b7463,_0x2eb5a4){var _0x8fba40=_0x6994('0x1');var _0x2dbff6=0x194;var _0x19b215={'status':_0x2dbff6};_0x2eb5a4[_0x6994('0x2')](_0x19b215[_0x6994('0x2')]);_0x2eb5a4[_0x6994('0x3')](_0x8fba40,{},function(_0xf04b72,_0x4386d7){if(_0xf04b72){return _0x2eb5a4[_0x6994('0x2')](_0x19b215['status'])[_0x6994('0x4')](_0x19b215);}_0x2eb5a4[_0x6994('0x5')](_0x4386d7);});};
\ No newline at end of file
+var _0x6c75=['send','exports','404','status','render','json'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x6c75,0xb5));var _0x56c7=function(_0x4c9af1,_0x60a0dc){_0x4c9af1=_0x4c9af1-0x0;var _0x250bd4=_0x6c75[_0x4c9af1];return _0x250bd4;};'use strict';module[_0x56c7('0x0')][0x194]=function pageNotFound(_0x1d3b92,_0x26408f){var _0x51640c=_0x56c7('0x1');var _0x1117bf=0x194;var _0x4b87de={'status':_0x1117bf};_0x26408f[_0x56c7('0x2')](_0x4b87de[_0x56c7('0x2')]);_0x26408f[_0x56c7('0x3')](_0x51640c,{},function(_0x43e53c,_0x461b61){if(_0x43e53c){return _0x26408f[_0x56c7('0x2')](_0x4b87de[_0x56c7('0x2')])[_0x56c7('0x4')](_0x4b87de);}_0x26408f[_0x56c7('0x5')](_0x461b61);});};
\ No newline at end of file
diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js
index 4194717..2df3d3f 100644
--- a/server/mysqldb/index.js
+++ b/server/mysqldb/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf07=['SmsAccountId','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','team_has_sms_queues','Teams','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsite','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','Contacts','SmsInteractions','Company','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAllId','Any','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','Configurations','Subjects','SubjectId','FieldId','AccountId','Description','DescriptionId','Field','VariableId','Descriptions','Subject','DeskAccount','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','Dynamics365Field','FromId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','ProjectId','team_has_voice_queues','team_has_chat_queues','OpenchannelQueues','team_has_whatsapp_queues','HopperBlacks','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','FromOpenchannelAccountId','ToUserId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_accounts','user_has_whatsapp_interactions','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','path','../config/environment','sequelize','lodash','determine','xcall','utf8mb4','utf8','sequelizeHistory','defaultsDeep','motion2','xC@LL1234','mysql','name','utf8_general_ci','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','hasOne','cascade','Recordings','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','Notification','Notifications','belongsTo','UserProfile','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_chat_interactions','FaxInteraction','user_has_fax_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','OpenchannelAccounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccount','SquareProjects','user_has_square_projects','SpiedAgents','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','Agents','voice_queues_has_cm_blacklists','Messages','mailboxuser','VoiceQueueReport','QueueCalls','Contact','ContactId','MailAccountId','MailServerOut','Smtp','Dispositions','Answers','Interactions','ListId','Template','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','restrict','TagId','List','Items','FaxAccountId','CannedAnswer','Exntensions','mandatoryDispositionPauseId','FaxApplication','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport'];(function(_0x5aea22,_0x84db0c){var _0x25bcda=function(_0x45afd3){while(--_0x45afd3){_0x5aea22['push'](_0x5aea22['shift']());}};_0x25bcda(++_0x84db0c);}(_0xbf07,0x77));var _0x7bf0=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0xbf07[_0x36c6eb];return _0x30675b;};'use strict';var path=require(_0x7bf0('0x0'));var config=require(_0x7bf0('0x1'));var Sequelize=require(_0x7bf0('0x2'));var _=require(_0x7bf0('0x3'));var jstz=require('jstz');var timezone=jstz[_0x7bf0('0x4')]();config[_0x7bf0('0x2')]=_['defaultsDeep'](config['sequelize'],{'database':'motion2','username':_0x7bf0('0x5'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x7bf0('0x6')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x7bf0('0x7'),'collate':'utf8_general_ci'}}});config[_0x7bf0('0x8')]=_[_0x7bf0('0x9')](config[_0x7bf0('0x8')],{'database':_0x7bf0('0xa'),'username':_0x7bf0('0x5'),'password':_0x7bf0('0xb'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x7bf0('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x7bf0('0xd')](),'define':{'charset':_0x7bf0('0x7'),'collate':_0x7bf0('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7bf0('0x2')][_0x7bf0('0xf')],config[_0x7bf0('0x2')][_0x7bf0('0x10')],config[_0x7bf0('0x2')][_0x7bf0('0x11')],config[_0x7bf0('0x2')][_0x7bf0('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7bf0('0x8')][_0x7bf0('0xf')],config[_0x7bf0('0x8')][_0x7bf0('0x10')],config[_0x7bf0('0x8')][_0x7bf0('0x11')],config[_0x7bf0('0x8')][_0x7bf0('0x12')])};db[_0x7bf0('0x13')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x15'));db[_0x7bf0('0x16')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x7bf0('0x17')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x18'));db[_0x7bf0('0x19')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x1a'));db[_0x7bf0('0x1b')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x1c'));db[_0x7bf0('0x1d')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x1e'));db[_0x7bf0('0x1f')]=db['sequelize']['import'](_0x7bf0('0x20'));db[_0x7bf0('0x21')]=db['sequelize'][_0x7bf0('0x14')]('../api/screenRecording/screenRecording.model');db[_0x7bf0('0x22')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x23'));db[_0x7bf0('0x24')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x25'));db[_0x7bf0('0x26')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x7bf0('0x27')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x28'));db[_0x7bf0('0x29')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x2a'));db['VoiceQueueReport']=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x2b'));db[_0x7bf0('0x2c')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x2d'));db[_0x7bf0('0x2e')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x2f'));db[_0x7bf0('0x30')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x7bf0('0x31')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x32'));db[_0x7bf0('0x33')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x34'));db['UserChatQueue']=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0x7bf0('0x35')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x36'));db[_0x7bf0('0x37')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x38'));db[_0x7bf0('0x39')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x3a'));db[_0x7bf0('0x3b')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x7bf0('0x3c')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x3d'));db[_0x7bf0('0x3e')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x3f'));db['MailServerOut']=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x40'));db[_0x7bf0('0x41')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x42'));db[_0x7bf0('0x43')]=db[_0x7bf0('0x2')]['import']('../api/mailQueue/mailQueue.model');db[_0x7bf0('0x44')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0x7bf0('0x45')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x46'));db[_0x7bf0('0x47')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/mailMessage/mailMessage.model');db[_0x7bf0('0x48')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x49'));db[_0x7bf0('0x4a')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x4b'));db[_0x7bf0('0x4c')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x4d'));db[_0x7bf0('0x4e')]=db[_0x7bf0('0x2')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x7bf0('0x4f')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x50'));db['FaxApplication']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x51'));db['FaxInteraction']=db['sequelize']['import'](_0x7bf0('0x52'));db[_0x7bf0('0x53')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x54'));db[_0x7bf0('0x55')]=db['sequelize']['import']('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0x7bf0('0x2')]['import']('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x56'));db[_0x7bf0('0x57')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x58'));db[_0x7bf0('0x59')]=db['sequelize']['import'](_0x7bf0('0x5a'));db[_0x7bf0('0x5b')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x5c'));db[_0x7bf0('0x5d')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x5e'));db[_0x7bf0('0x5f')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x60'));db[_0x7bf0('0x61')]=db['sequelize']['import']('../api/openchannelApplication/openchannelApplication.model');db[_0x7bf0('0x62')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x63'));db[_0x7bf0('0x64')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x65'));db[_0x7bf0('0x66')]=db[_0x7bf0('0x2')]['import']('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x67'));db[_0x7bf0('0x68')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x69'));db[_0x7bf0('0x6a')]=db['sequelize']['import'](_0x7bf0('0x6b'));db[_0x7bf0('0x6c')]=db['sequelize'][_0x7bf0('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0x7bf0('0x6d')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x6e'));db['ChatOfflineMessage']=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x6f'));db[_0x7bf0('0x70')]=db['sequelize'][_0x7bf0('0x14')]('../api/chatQueue/chatQueue.model');db[_0x7bf0('0x71')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/chatGroup/chatGroup.model');db[_0x7bf0('0x72')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x73'));db[_0x7bf0('0x74')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x75'));db[_0x7bf0('0x76')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/cmContact/cmContact.model');db[_0x7bf0('0x77')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x78'));db[_0x7bf0('0x79')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x7bf0('0x7a')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x7b'));db[_0x7bf0('0x7c')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x7d'));db['ReportAgentPreview']=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x7e'));db['CmCustomField']=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x7f'));db[_0x7bf0('0x80')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x81'));db[_0x7bf0('0x82')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x83'));db['CannedAnswer']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x84'));db[_0x7bf0('0x85')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x86'));db[_0x7bf0('0x87')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/condition/condition.model');db[_0x7bf0('0x88')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x89'));db[_0x7bf0('0x8a')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/pause/pause.model');db['Cdr']=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x8b'));db[_0x7bf0('0x8c')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x8d'));db[_0x7bf0('0x8e')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x8f'));db[_0x7bf0('0x90')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x91'));db[_0x7bf0('0x92')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x93'));db['Template']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x94'));db[_0x7bf0('0x95')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/trigger/trigger.model');db[_0x7bf0('0x96')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x97'));db['Integration']=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x98'));db[_0x7bf0('0x99')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0x9a'));db['AnalyticCustomReport']=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x9b'));db[_0x7bf0('0x9c')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x7bf0('0x9d')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x9e'));db[_0x7bf0('0x9f')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xa0'));db[_0x7bf0('0xa1')]=db[_0x7bf0('0x2')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xa2'));db[_0x7bf0('0xa3')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xa4'));db[_0x7bf0('0xa5')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xa6'));db[_0x7bf0('0xa7')]=db['sequelize'][_0x7bf0('0x14')]('../api/intSalesforceField/intSalesforceField.model');db[_0x7bf0('0xa8')]=db['sequelize']['import'](_0x7bf0('0xa9'));db[_0x7bf0('0xaa')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xab'));db[_0x7bf0('0xac')]=db['sequelize'][_0x7bf0('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0xad'));db[_0x7bf0('0xae')]=db[_0x7bf0('0x2')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db['sequelize'][_0x7bf0('0x14')]('../api/intDeskField/intDeskField.model');db[_0x7bf0('0xaf')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xb0'));db['ZohoConfiguration']=db[_0x7bf0('0x2')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x7bf0('0xb1')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/intZohoField/intZohoField.model');db[_0x7bf0('0xb2')]=db['sequelize']['import'](_0x7bf0('0xb3'));db[_0x7bf0('0xb4')]=db[_0x7bf0('0x2')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db['sequelize'][_0x7bf0('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0x7bf0('0xb5')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xb6'));db['FreshdeskConfiguration']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xb7'));db[_0x7bf0('0xb8')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x7bf0('0xb9')]=db['sequelize']['import'](_0x7bf0('0xba'));db[_0x7bf0('0xbb')]=db['sequelize'][_0x7bf0('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x7bf0('0xbc')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xbd'));db[_0x7bf0('0xbe')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xbf'));db[_0x7bf0('0xc0')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x7bf0('0xc1')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/intServicenowField/intServicenowField.model');db[_0x7bf0('0xc2')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xc3'));db[_0x7bf0('0xc4')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xc5'));db['Dynamics365Field']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xc6'));db[_0x7bf0('0xc7')]=db[_0x7bf0('0x2')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x7bf0('0xc8')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xc9'));db[_0x7bf0('0xca')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x7bf0('0xcb')]=db['sequelize']['import'](_0x7bf0('0x98'));db[_0x7bf0('0xcc')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0xcd'));db[_0x7bf0('0xce')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xcf'));db[_0x7bf0('0xd0')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xd1'));db['JscriptyAnswerReport']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xd2'));db['JscriptyQuestionReport']=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0xd3'));db[_0x7bf0('0xd4')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xd5'));db[_0x7bf0('0xd6')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0xd7'));db[_0x7bf0('0xd8')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0xd9'));db[_0x7bf0('0xda')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xdb'));db[_0x7bf0('0xdc')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xdd'));db[_0x7bf0('0xde')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xdf'));db[_0x7bf0('0xe0')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xe1'));db[_0x7bf0('0xe2')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xe3'));db[_0x7bf0('0xe4')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0xe5'));db['SquareMessage']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xe6'));db[_0x7bf0('0xe7')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xe8'));db[_0x7bf0('0xe9')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xea'));db[_0x7bf0('0xeb')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xec'));db[_0x7bf0('0xed')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/migration/migration.model');db[_0x7bf0('0xee')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0xef'));db[_0x7bf0('0xf0')]=db['sequelize']['import'](_0x7bf0('0xf1'));db['MailTransferReport']=db[_0x7bf0('0x2')]['import'](_0x7bf0('0xf2'));db['ChatTransferReport']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xf3'));db[_0x7bf0('0xf4')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xf5'));db[_0x7bf0('0xf6')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0xf7'));db[_0x7bf0('0xf8')]=db['sequelize'][_0x7bf0('0x14')](_0x7bf0('0xf9'));db[_0x7bf0('0xfa')]=db['sequelize']['import']('../api/cmList/cmList.model');db[_0x7bf0('0xfb')]=db['sequelize']['import'](_0x7bf0('0xfc'));db['UserProfile']=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/userProfile/userProfile.model');db[_0x7bf0('0xfd')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xfe'));db['UserProfileResource']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0xff'));db['Notification']=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/notification/notification.model');db['WhatsappAccount']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x100'));db['WhatsappApplication']=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x101'));db[_0x7bf0('0x102')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x103'));db[_0x7bf0('0x104')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x105'));db[_0x7bf0('0x106')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x107'));db[_0x7bf0('0x108')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x7bf0('0x109')]=db[_0x7bf0('0x2')][_0x7bf0('0x14')](_0x7bf0('0x10a'));db[_0x7bf0('0x10b')]=db[_0x7bf0('0x2')]['import'](_0x7bf0('0x10c'));db[_0x7bf0('0x13')][_0x7bf0('0x10d')](db['VoiceMail'],{'as':_0x7bf0('0x22'),'onDelete':_0x7bf0('0x10e'),'foreignKey':'UserId'});db[_0x7bf0('0x13')]['hasMany'](db[_0x7bf0('0x1f')],{'as':_0x7bf0('0x10f'),'foreignKey':_0x7bf0('0x110')});db['User'][_0x7bf0('0x111')](db[_0x7bf0('0x31')],{'as':_0x7bf0('0x112'),'foreignKey':'UserId'});db[_0x7bf0('0x13')][_0x7bf0('0x111')](db[_0x7bf0('0x19')],{'as':_0x7bf0('0x113'),'onDelete':_0x7bf0('0x10e'),'hooks':!![]});db['User']['hasMany'](db[_0x7bf0('0x7a')],{'as':_0x7bf0('0x114'),'foreignKey':'UserId'});db['User'][_0x7bf0('0x111')](db['CmHopperHistory'],{'as':_0x7bf0('0x115'),'foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x13')][_0x7bf0('0x111')](db[_0x7bf0('0x116')],{'as':_0x7bf0('0x116'),'foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x13')][_0x7bf0('0x111')](db[_0x7bf0('0x62')],{'as':_0x7bf0('0x117'),'foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x13')][_0x7bf0('0x111')](db[_0x7bf0('0x6c')],{'as':_0x7bf0('0x118'),'foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x13')][_0x7bf0('0x111')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x13')][_0x7bf0('0x111')](db['FaxInteraction'],{'as':_0x7bf0('0x119'),'foreignKey':'UserId'});db[_0x7bf0('0x13')][_0x7bf0('0x111')](db['MailInteraction'],{'as':_0x7bf0('0x11a'),'foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x13')]['hasMany'](db[_0x7bf0('0x102')],{'as':_0x7bf0('0x11b'),'foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x13')][_0x7bf0('0x111')](db[_0x7bf0('0x11c')],{'as':_0x7bf0('0x11d'),'foreignKey':'SenderId'});db[_0x7bf0('0x13')][_0x7bf0('0x11e')](db[_0x7bf0('0x11f')],{'as':_0x7bf0('0x11f'),'foreignKey':'userProfileId'});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x71')],{'as':_0x7bf0('0x121'),'through':_0x7bf0('0x122')});db['User'][_0x7bf0('0x120')](db[_0x7bf0('0x76')],{'as':'Contacts','through':_0x7bf0('0x123')});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x124'),'through':_0x7bf0('0x125')});db['User']['belongsToMany'](db['Team'],{'through':'user_has_teams'});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x45')],{'as':_0x7bf0('0x11a'),'through':'user_has_mail_interactions'});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db['ChatInteraction'],{'as':_0x7bf0('0x118'),'through':_0x7bf0('0x126')});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x127')],{'as':'FaxInteractions','through':_0x7bf0('0x128')});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x59')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x62')],{'as':_0x7bf0('0x117'),'through':_0x7bf0('0x129')});db['User'][_0x7bf0('0x120')](db[_0x7bf0('0x102')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db['VoiceQueue'],{'as':_0x7bf0('0x12a'),'through':_0x7bf0('0x33'),'required':![]});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x43')],{'as':_0x7bf0('0x12b'),'through':_0x7bf0('0x35'),'required':![]});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x70')],{'as':_0x7bf0('0x12c'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x55')],{'as':_0x7bf0('0x12d'),'through':_0x7bf0('0x37'),'required':![]});db['User'][_0x7bf0('0x120')](db[_0x7bf0('0x5d')],{'as':_0x7bf0('0x12e'),'through':'UserSmsQueue','required':![]});db[_0x7bf0('0x13')]['belongsToMany'](db[_0x7bf0('0x66')],{'as':'OpenchannelQueues','through':_0x7bf0('0x3b'),'required':![]});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db['WhatsappQueue'],{'as':_0x7bf0('0x12f'),'through':'UserWhatsappQueue','required':![]});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db['CmList'],{'through':'cm_user_has_lists'});db[_0x7bf0('0x13')]['belongsToMany'](db[_0x7bf0('0xfb')],{'as':_0x7bf0('0x130'),'through':_0x7bf0('0x131'),'required':![]});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db['ChatWebsite'],{'as':_0x7bf0('0x132'),'through':_0x7bf0('0x133')});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x4f')],{'as':_0x7bf0('0x134'),'through':_0x7bf0('0x135')});db['User'][_0x7bf0('0x120')](db['MailAccount'],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x7bf0('0x13')]['belongsToMany'](db[_0x7bf0('0x5f')],{'as':_0x7bf0('0x136'),'through':'user_has_openchannel_accounts'});db['User'][_0x7bf0('0x120')](db[_0x7bf0('0x137')],{'as':_0x7bf0('0x138'),'through':_0x7bf0('0x139')});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0x13a')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x7bf0('0x13')][_0x7bf0('0x120')](db[_0x7bf0('0xe2')],{'as':_0x7bf0('0x13b'),'through':_0x7bf0('0x13c')});db[_0x7bf0('0x16')]['hasMany'](db[_0x7bf0('0x19')],{'as':_0x7bf0('0x13d'),'onDelete':_0x7bf0('0x10e'),'foreignKey':'ChanSpyId'});db[_0x7bf0('0x17')][_0x7bf0('0x111')](db[_0x7bf0('0x19')],{'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x19')][_0x7bf0('0x111')](db[_0x7bf0('0x19')],{'as':_0x7bf0('0x13e'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x1b')]['belongsToMany'](db[_0x7bf0('0x90')],{'as':_0x7bf0('0x13f'),'through':_0x7bf0('0x140')});db[_0x7bf0('0x1d')][_0x7bf0('0x111')](db[_0x7bf0('0x31')],{'as':_0x7bf0('0x141'),'foreignKey':_0x7bf0('0x142')});db[_0x7bf0('0x1d')][_0x7bf0('0x111')](db[_0x7bf0('0x77')],{'as':_0x7bf0('0x143'),'foreignKey':_0x7bf0('0x142')});db[_0x7bf0('0x1d')][_0x7bf0('0x111')](db[_0x7bf0('0x7a')],{'as':'HopperFinals','foreignKey':_0x7bf0('0x142')});db[_0x7bf0('0x1d')][_0x7bf0('0x111')](db[_0x7bf0('0x7c')],{'as':_0x7bf0('0x144'),'foreignKey':_0x7bf0('0x142')});db[_0x7bf0('0x1d')][_0x7bf0('0x111')](db[_0x7bf0('0x116')],{'as':_0x7bf0('0x116'),'foreignKey':_0x7bf0('0x142')});db[_0x7bf0('0x1d')][_0x7bf0('0x111')](db[_0x7bf0('0x79')],{'as':'HopperBlacks','foreignKey':_0x7bf0('0x142')});db[_0x7bf0('0x1d')][_0x7bf0('0x111')](db['JscriptySessionReport'],{'as':_0x7bf0('0x145'),'foreignKey':_0x7bf0('0x142')});db[_0x7bf0('0x1d')][_0x7bf0('0x11e')](db[_0x7bf0('0x2e')],{'as':_0x7bf0('0x2e'),'foreignKey':_0x7bf0('0x146')});db[_0x7bf0('0x1d')][_0x7bf0('0x11e')](db[_0x7bf0('0x2e')],{'as':_0x7bf0('0x147'),'foreignKey':_0x7bf0('0x148')});db['VoiceQueue'][_0x7bf0('0x11e')](db[_0x7bf0('0x88')],{'as':_0x7bf0('0x88'),'foreignKey':_0x7bf0('0x149')});db[_0x7bf0('0x1d')]['belongsTo'](db[_0x7bf0('0x8a')],{'as':_0x7bf0('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x7bf0('0x120')](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x124'),'through':'voice_queues_has_cm_lists'});db[_0x7bf0('0x1d')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x14b'),'through':'UserVoiceQueue'});db[_0x7bf0('0x1d')][_0x7bf0('0x120')](db[_0x7bf0('0xe7')],{'as':'Teams','through':'team_has_voice_queues'});db[_0x7bf0('0x1d')]['belongsToMany'](db['CmList'],{'as':'BlackLists','through':_0x7bf0('0x14c')});db[_0x7bf0('0x1f')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':'User','foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x21')][_0x7bf0('0x11e')](db['User'],{'as':'User','foreignKey':'UserId'});db['VoiceMail']['hasMany'](db[_0x7bf0('0x24')],{'as':_0x7bf0('0x14d'),'onDelete':'cascade','foreignKey':_0x7bf0('0x14e'),'sourceKey':'mailbox'});db[_0x7bf0('0x24')][_0x7bf0('0x11e')](db[_0x7bf0('0x22')],{'foreignKey':_0x7bf0('0x14e'),'targetKey':'mailbox'});db[_0x7bf0('0x26')]['hasMany'](db[_0x7bf0('0x14f')],{'as':_0x7bf0('0x150'),'foreignKey':'uniqueid','constraints':![]});db[_0x7bf0('0x26')][_0x7bf0('0x111')](db[_0x7bf0('0x29')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x7bf0('0x26')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':'User','foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x26')][_0x7bf0('0x11e')](db['CmContact'],{'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x3e')][_0x7bf0('0x11e')](db[_0x7bf0('0x41')],{'as':_0x7bf0('0x41'),'foreignKey':_0x7bf0('0x153')});db[_0x7bf0('0x154')][_0x7bf0('0x11e')](db[_0x7bf0('0x41')],{'as':_0x7bf0('0x41'),'foreignKey':'MailAccountId'});db[_0x7bf0('0x41')][_0x7bf0('0x10d')](db['MailServerIn'],{'as':'Imap','onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x41')][_0x7bf0('0x10d')](db[_0x7bf0('0x154')],{'as':_0x7bf0('0x155'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x41')][_0x7bf0('0x111')](db['Disposition'],{'as':_0x7bf0('0x156'),'foreignKey':'MailAccountId'});db[_0x7bf0('0x41')][_0x7bf0('0x111')](db['CannedAnswer'],{'as':_0x7bf0('0x157'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x7bf0('0x111')](db['MailMessage'],{'as':'Messages','foreignKey':_0x7bf0('0x153')});db[_0x7bf0('0x41')][_0x7bf0('0x111')](db['MailInteraction'],{'as':_0x7bf0('0x158')});db[_0x7bf0('0x41')][_0x7bf0('0x111')](db[_0x7bf0('0x48')],{'as':_0x7bf0('0x13e')});db[_0x7bf0('0x41')]['belongsTo'](db[_0x7bf0('0xfa')],{'as':'List','foreignKey':_0x7bf0('0x159')});db[_0x7bf0('0x41')][_0x7bf0('0x11e')](db[_0x7bf0('0x15a')],{'as':_0x7bf0('0x15a'),'foreignKey':'TemplateId'});db[_0x7bf0('0x41')]['belongsTo'](db[_0x7bf0('0x8a')],{'as':_0x7bf0('0x14a'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':'Agents','through':_0x7bf0('0x15b')});db[_0x7bf0('0x43')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x14b'),'through':_0x7bf0('0x35')});db[_0x7bf0('0x43')][_0x7bf0('0x120')](db[_0x7bf0('0xe7')],{'through':_0x7bf0('0x15c'),'as':'Teams'});db['MailInteraction'][_0x7bf0('0x111')](db[_0x7bf0('0x47')],{'as':_0x7bf0('0x14d'),'onDelete':'cascade','foreignKey':_0x7bf0('0x15d')});db['MailInteraction'][_0x7bf0('0x11e')](db['MailAccount'],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x153')});db[_0x7bf0('0x45')]['belongsTo'](db[_0x7bf0('0x76')],{'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x45')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x15f'),'foreignKey':'UserId'});db['MailInteraction'][_0x7bf0('0x120')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x7bf0('0x160')});db[_0x7bf0('0x45')][_0x7bf0('0x120')](db['Tag'],{'through':_0x7bf0('0x161'),'as':_0x7bf0('0x162')});db[_0x7bf0('0x45')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x163'),'through':_0x7bf0('0x164'),'foreignKey':_0x7bf0('0x15d')});db[_0x7bf0('0x47')][_0x7bf0('0x111')](db[_0x7bf0('0xee')],{'as':_0x7bf0('0x165'),'onDelete':'cascade'});db['MailMessage'][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x13')});db[_0x7bf0('0x47')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'onDelete':'cascade','as':'Contact'});db[_0x7bf0('0x47')][_0x7bf0('0x11e')](db[_0x7bf0('0x45')],{'as':_0x7bf0('0x166'),'foreignKey':_0x7bf0('0x15d')});db[_0x7bf0('0x47')][_0x7bf0('0x11e')](db['MailAccount'],{'as':'Account','foreignKey':_0x7bf0('0x153')});db[_0x7bf0('0x48')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'onDelete':'restrict'});db[_0x7bf0('0x48')][_0x7bf0('0x11e')](db[_0x7bf0('0x43')],{'onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x48')][_0x7bf0('0x11e')](db[_0x7bf0('0x41')],{'onDelete':'restrict'});db[_0x7bf0('0x48')][_0x7bf0('0x11e')](db[_0x7bf0('0x88')],{'onDelete':_0x7bf0('0x167'),'foreignKey':_0x7bf0('0x149')});db['MailApplication'][_0x7bf0('0x11e')](db['Tag'],{'onDelete':_0x7bf0('0x167'),'foreignKey':_0x7bf0('0x168')});db[_0x7bf0('0x4a')][_0x7bf0('0x11e')](db['MailAccount'],{});db[_0x7bf0('0x4a')][_0x7bf0('0x11e')](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x169'),'foreignKey':'ListId'});db[_0x7bf0('0x4a')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'as':_0x7bf0('0x151'),'foreignKey':'ContactId'});db[_0x7bf0('0x4a')][_0x7bf0('0x11e')](db[_0x7bf0('0x45')],{});db[_0x7bf0('0x4a')][_0x7bf0('0x11e')](db['MailMessage'],{});db[_0x7bf0('0x4a')]['belongsTo'](db[_0x7bf0('0x13')],{});db[_0x7bf0('0x4a')][_0x7bf0('0x11e')](db['MailQueue'],{});db[_0x7bf0('0x4c')][_0x7bf0('0x111')](db[_0x7bf0('0x4e')],{'as':_0x7bf0('0x16a'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x4f')][_0x7bf0('0x111')](db[_0x7bf0('0x85')],{'as':_0x7bf0('0x156'),'foreignKey':_0x7bf0('0x16b')});db[_0x7bf0('0x4f')][_0x7bf0('0x111')](db[_0x7bf0('0x16c')],{'as':'Answers','foreignKey':_0x7bf0('0x16b')});db[_0x7bf0('0x4f')][_0x7bf0('0x111')](db[_0x7bf0('0x127')],{'as':'Interactions'});db[_0x7bf0('0x4f')][_0x7bf0('0x111')](db['FaxApplication'],{'as':'Applications'});db[_0x7bf0('0x4f')][_0x7bf0('0x111')](db[_0x7bf0('0x19')],{'as':_0x7bf0('0x16d'),'onDelete':_0x7bf0('0x10e')});db['FaxAccount'][_0x7bf0('0x111')](db[_0x7bf0('0x53')],{'as':'Messages'});db[_0x7bf0('0x4f')]['belongsTo'](db[_0x7bf0('0x2e')],{'as':_0x7bf0('0x2e')});db[_0x7bf0('0x4f')]['belongsTo'](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x169'),'foreignKey':_0x7bf0('0x159')});db['FaxAccount'][_0x7bf0('0x11e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x7bf0('0x16e')});db[_0x7bf0('0x4f')]['belongsToMany'](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x14b'),'through':_0x7bf0('0x135')});db[_0x7bf0('0x16f')][_0x7bf0('0x11e')](db['User'],{'onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x16f')][_0x7bf0('0x11e')](db[_0x7bf0('0x55')],{'onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x16f')][_0x7bf0('0x11e')](db['FaxAccount'],{'onDelete':'restrict'});db[_0x7bf0('0x16f')][_0x7bf0('0x11e')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7bf0('0x168')});db['FaxInteraction'][_0x7bf0('0x111')](db['FaxMessage'],{'as':_0x7bf0('0x14d'),'onDelete':'cascade','foreignKey':_0x7bf0('0x170')});db[_0x7bf0('0x127')]['belongsTo'](db[_0x7bf0('0x4f')],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x16b')});db[_0x7bf0('0x127')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'as':'Contact','foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x127')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x15f'),'foreignKey':'UserId'});db[_0x7bf0('0x127')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x171'),'as':_0x7bf0('0x160')});db['FaxInteraction'][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x171'),'as':_0x7bf0('0x162')});db['FaxInteraction'][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x163'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x13')});db[_0x7bf0('0x53')][_0x7bf0('0x11e')](db['FaxInteraction'],{'as':_0x7bf0('0x166'),'foreignKey':_0x7bf0('0x170')});db[_0x7bf0('0x53')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x151')});db[_0x7bf0('0x53')][_0x7bf0('0x11e')](db[_0x7bf0('0xee')],{'as':'Attachment','foreignKey':_0x7bf0('0x172')});db['FaxMessage'][_0x7bf0('0x11e')](db[_0x7bf0('0x4f')],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x16b')});db[_0x7bf0('0x55')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x14b'),'through':_0x7bf0('0x37')});db[_0x7bf0('0x55')][_0x7bf0('0x120')](db[_0x7bf0('0xe7')],{'through':_0x7bf0('0x173'),'as':'Teams'});db[_0x7bf0('0x174')][_0x7bf0('0x11e')](db[_0x7bf0('0x4f')],{});db[_0x7bf0('0x174')][_0x7bf0('0x11e')](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x169'),'foreignKey':_0x7bf0('0x159')});db[_0x7bf0('0x174')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'as':'Contact','foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x174')][_0x7bf0('0x11e')](db[_0x7bf0('0x127')],{});db[_0x7bf0('0x174')][_0x7bf0('0x11e')](db['FaxMessage'],{});db[_0x7bf0('0x174')]['belongsTo'](db[_0x7bf0('0x13')],{});db['FaxQueueReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x55')],{});db[_0x7bf0('0x137')][_0x7bf0('0x111')](db['Disposition'],{'as':_0x7bf0('0x156'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x7bf0('0x111')](db[_0x7bf0('0x16c')],{'as':'Answers','foreignKey':_0x7bf0('0x175')});db['SmsAccount'][_0x7bf0('0x111')](db[_0x7bf0('0x5b')],{'as':_0x7bf0('0x14d'),'foreignKey':_0x7bf0('0x175')});db[_0x7bf0('0x137')][_0x7bf0('0x111')](db[_0x7bf0('0x59')],{'as':_0x7bf0('0x158')});db[_0x7bf0('0x137')][_0x7bf0('0x111')](db['SmsApplication'],{'as':_0x7bf0('0x13e')});db[_0x7bf0('0x137')][_0x7bf0('0x11e')](db['CmList'],{'as':_0x7bf0('0x169'),'foreignKey':_0x7bf0('0x159')});db['SmsAccount']['belongsTo'](db['Pause'],{'as':_0x7bf0('0x14a'),'foreignKey':_0x7bf0('0x16e')});db['SmsAccount']['belongsToMany'](db[_0x7bf0('0x13')],{'as':'Agents','through':_0x7bf0('0x139')});db[_0x7bf0('0x57')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'onDelete':'restrict'});db[_0x7bf0('0x57')]['belongsTo'](db['SmsQueue'],{'onDelete':'restrict'});db[_0x7bf0('0x57')]['belongsTo'](db[_0x7bf0('0x137')],{'onDelete':_0x7bf0('0x167')});db['SmsApplication'][_0x7bf0('0x11e')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x7bf0('0x149')});db[_0x7bf0('0x57')][_0x7bf0('0x11e')](db[_0x7bf0('0x92')],{'onDelete':_0x7bf0('0x167'),'foreignKey':_0x7bf0('0x168')});db[_0x7bf0('0x59')][_0x7bf0('0x111')](db[_0x7bf0('0x5b')],{'as':_0x7bf0('0x14d'),'onDelete':_0x7bf0('0x10e'),'foreignKey':'SmsInteractionId'});db[_0x7bf0('0x59')]['belongsTo'](db[_0x7bf0('0x137')],{'as':'Account','foreignKey':_0x7bf0('0x175')});db['SmsInteraction'][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'as':'Contact','foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x59')][_0x7bf0('0x11e')](db['User'],{'as':_0x7bf0('0x15f'),'foreignKey':_0x7bf0('0x110')});db[_0x7bf0('0x59')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x176'),'as':_0x7bf0('0x160')});db['SmsInteraction'][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x176'),'as':_0x7bf0('0x162')});db[_0x7bf0('0x59')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x163'),'through':_0x7bf0('0x177'),'foreignKey':_0x7bf0('0x178')});db['SmsMessage'][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x13')});db[_0x7bf0('0x5b')][_0x7bf0('0x11e')](db['CmContact'],{'onDelete':'cascade','as':_0x7bf0('0x151')});db[_0x7bf0('0x5b')][_0x7bf0('0x11e')](db[_0x7bf0('0x59')],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x166'),'foreignKey':_0x7bf0('0x178')});db[_0x7bf0('0x5b')][_0x7bf0('0x11e')](db[_0x7bf0('0x137')],{'as':_0x7bf0('0x15e'),'foreignKey':'SmsAccountId'});db[_0x7bf0('0x5d')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x14b'),'through':_0x7bf0('0x39'),'foreignKey':'SmsQueueId'});db[_0x7bf0('0x5d')]['belongsToMany'](db[_0x7bf0('0xe7')],{'through':_0x7bf0('0x179'),'as':_0x7bf0('0x17a')});db[_0x7bf0('0x5f')][_0x7bf0('0x111')](db[_0x7bf0('0x85')],{'as':_0x7bf0('0x156'),'foreignKey':_0x7bf0('0x17b')});db[_0x7bf0('0x5f')]['hasMany'](db['CannedAnswer'],{'as':_0x7bf0('0x157'),'foreignKey':_0x7bf0('0x17b')});db[_0x7bf0('0x5f')][_0x7bf0('0x111')](db[_0x7bf0('0x62')],{'as':_0x7bf0('0x158'),'foreignKey':_0x7bf0('0x17b')});db[_0x7bf0('0x5f')]['hasMany'](db[_0x7bf0('0x64')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x7bf0('0x111')](db[_0x7bf0('0x61')],{'as':_0x7bf0('0x13e'),'foreignKey':_0x7bf0('0x17b')});db[_0x7bf0('0x5f')][_0x7bf0('0x11e')](db[_0x7bf0('0xfa')],{'as':'List','foreignKey':_0x7bf0('0x159')});db[_0x7bf0('0x5f')][_0x7bf0('0x11e')](db[_0x7bf0('0x8a')],{'as':_0x7bf0('0x14a'),'foreignKey':_0x7bf0('0x16e')});db[_0x7bf0('0x5f')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':'Agents','through':_0x7bf0('0x17c')});db[_0x7bf0('0x61')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'onDelete':_0x7bf0('0x167')});db['OpenchannelApplication'][_0x7bf0('0x11e')](db[_0x7bf0('0x66')],{'onDelete':_0x7bf0('0x167'),'foreignKey':_0x7bf0('0x17d')});db['OpenchannelApplication']['belongsTo'](db[_0x7bf0('0x5f')],{'onDelete':_0x7bf0('0x167'),'foreignKey':_0x7bf0('0x17b')});db[_0x7bf0('0x61')][_0x7bf0('0x11e')](db[_0x7bf0('0x88')],{'onDelete':_0x7bf0('0x167'),'foreignKey':_0x7bf0('0x149')});db['OpenchannelApplication'][_0x7bf0('0x11e')](db[_0x7bf0('0x92')],{'onDelete':'restrict','foreignKey':_0x7bf0('0x168')});db[_0x7bf0('0x62')]['hasMany'](db[_0x7bf0('0x64')],{'as':_0x7bf0('0x14d'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x17e')});db[_0x7bf0('0x62')][_0x7bf0('0x11e')](db[_0x7bf0('0x5f')],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x17b')});db[_0x7bf0('0x62')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x62')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x15f'),'foreignKey':'UserId'});db[_0x7bf0('0x62')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x17f'),'as':_0x7bf0('0x160')});db[_0x7bf0('0x62')][_0x7bf0('0x120')](db['Tag'],{'through':_0x7bf0('0x17f'),'as':'ThroughTags'});db[_0x7bf0('0x62')]['belongsToMany'](db[_0x7bf0('0x13')],{'as':'Users','through':_0x7bf0('0x129'),'foreignKey':_0x7bf0('0x17e')});db[_0x7bf0('0x64')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0x7bf0('0x13')});db[_0x7bf0('0x64')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x151')});db[_0x7bf0('0x64')][_0x7bf0('0x11e')](db[_0x7bf0('0x62')],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x166'),'foreignKey':_0x7bf0('0x17e')});db[_0x7bf0('0x64')][_0x7bf0('0x11e')](db['Attachment'],{'as':_0x7bf0('0xee'),'foreignKey':_0x7bf0('0x172')});db[_0x7bf0('0x64')][_0x7bf0('0x11e')](db['OpenchannelAccount'],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x17b')});db['OpenchannelQueue'][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0x7bf0('0x17d')});db[_0x7bf0('0x66')]['belongsToMany'](db[_0x7bf0('0xe7')],{'through':_0x7bf0('0x180'),'as':_0x7bf0('0x17a')});db[_0x7bf0('0x181')][_0x7bf0('0x111')](db[_0x7bf0('0x85')],{'as':_0x7bf0('0x156'),'foreignKey':_0x7bf0('0x182')});db['ChatWebsite'][_0x7bf0('0x111')](db[_0x7bf0('0x16c')],{'as':_0x7bf0('0x157'),'foreignKey':'ChatWebsiteId'});db[_0x7bf0('0x181')][_0x7bf0('0x111')](db[_0x7bf0('0x72')],{'as':_0x7bf0('0x183')});db[_0x7bf0('0x181')][_0x7bf0('0x111')](db[_0x7bf0('0x6c')],{'as':_0x7bf0('0x158')});db[_0x7bf0('0x181')][_0x7bf0('0x111')](db[_0x7bf0('0x6a')],{'as':_0x7bf0('0x13e')});db[_0x7bf0('0x181')][_0x7bf0('0x111')](db[_0x7bf0('0x6d')],{'as':_0x7bf0('0x14d')});db[_0x7bf0('0x181')][_0x7bf0('0x11e')](db['CmList'],{'as':_0x7bf0('0x169'),'foreignKey':_0x7bf0('0x159')});db[_0x7bf0('0x181')][_0x7bf0('0x11e')](db['Interval'],{'as':_0x7bf0('0x88'),'foreignKey':_0x7bf0('0x149')});db[_0x7bf0('0x181')]['belongsTo'](db[_0x7bf0('0x8a')],{'as':_0x7bf0('0x14a'),'foreignKey':_0x7bf0('0x16e')});db[_0x7bf0('0x181')]['belongsToMany'](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x14b'),'through':_0x7bf0('0x133')});db[_0x7bf0('0x68')][_0x7bf0('0x11e')](db[_0x7bf0('0x5f')],{});db['OpenchannelQueueReport'][_0x7bf0('0x11e')](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x169'),'foreignKey':_0x7bf0('0x159')});db[_0x7bf0('0x68')]['belongsTo'](db[_0x7bf0('0x76')],{'as':_0x7bf0('0x151'),'foreignKey':'ContactId'});db['OpenchannelQueueReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x62')],{});db['OpenchannelQueueReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x64')],{});db['OpenchannelQueueReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{});db[_0x7bf0('0x68')][_0x7bf0('0x11e')](db['OpenchannelQueue'],{});db[_0x7bf0('0x6a')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x184'),'foreignKey':_0x7bf0('0x110'),'onDelete':'restrict'});db['ChatApplication'][_0x7bf0('0x11e')](db[_0x7bf0('0x70')],{'as':_0x7bf0('0x185'),'foreignKey':_0x7bf0('0x186'),'onDelete':_0x7bf0('0x167')});db['ChatApplication'][_0x7bf0('0x11e')](db[_0x7bf0('0x181')],{'as':_0x7bf0('0x187'),'foreignKey':_0x7bf0('0x182'),'onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x6a')][_0x7bf0('0x11e')](db['Tag'],{'onDelete':_0x7bf0('0x167'),'foreignKey':_0x7bf0('0x168')});db[_0x7bf0('0x6c')][_0x7bf0('0x111')](db[_0x7bf0('0x6d')],{'as':_0x7bf0('0x14d'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x188')});db[_0x7bf0('0x6c')]['belongsTo'](db[_0x7bf0('0x181')],{'as':'Account','foreignKey':_0x7bf0('0x182')});db[_0x7bf0('0x6c')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152')});db['ChatInteraction'][_0x7bf0('0x11e')](db['User'],{'as':_0x7bf0('0x15f'),'foreignKey':_0x7bf0('0x110')});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':_0x7bf0('0x189'),'as':_0x7bf0('0x160')});db[_0x7bf0('0x6c')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x189'),'as':_0x7bf0('0x162')});db[_0x7bf0('0x6c')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x163'),'through':_0x7bf0('0x126'),'foreignKey':_0x7bf0('0x188')});db[_0x7bf0('0x6d')][_0x7bf0('0x11e')](db['User'],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x13')});db[_0x7bf0('0x6d')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152')});db['ChatMessage'][_0x7bf0('0x11e')](db[_0x7bf0('0x6c')],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x166'),'foreignKey':'ChatInteractionId'});db[_0x7bf0('0x6d')][_0x7bf0('0x11e')](db[_0x7bf0('0xee')],{'as':_0x7bf0('0xee'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0x7bf0('0x11e')](db[_0x7bf0('0x181')],{'as':_0x7bf0('0x15e'),'foreignKey':'ChatWebsiteId'});db[_0x7bf0('0x18a')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'onDelete':'cascade','as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152')});db['ChatOfflineMessage']['belongsTo'](db[_0x7bf0('0x181')],{'as':_0x7bf0('0x15e'),'foreignKey':'ChatWebsiteId'});db[_0x7bf0('0x70')][_0x7bf0('0x120')](db['User'],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0x7bf0('0x70')][_0x7bf0('0x120')](db[_0x7bf0('0xe7')],{'through':'team_has_chat_queues','as':_0x7bf0('0x17a')});db['ChatGroup'][_0x7bf0('0x111')](db[_0x7bf0('0xd0')],{'as':_0x7bf0('0x14d'),'foreignKey':'ChatGroupId','onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x71')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x141'),'through':_0x7bf0('0x122')});db[_0x7bf0('0x72')][_0x7bf0('0x11e')](db[_0x7bf0('0x181')],{'as':_0x7bf0('0x187'),'foreignKey':_0x7bf0('0x182')});db[_0x7bf0('0x74')]['hasMany'](db[_0x7bf0('0x76')],{'as':_0x7bf0('0x18b'),'foreignKey':'CompanyId'});db[_0x7bf0('0x76')][_0x7bf0('0x111')](db[_0x7bf0('0x77')],{'as':_0x7bf0('0x143'),'foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x76')][_0x7bf0('0x111')](db['CmHopperFinal'],{'as':_0x7bf0('0x114'),'foreignKey':'ContactId'});db['CmContact'][_0x7bf0('0x111')](db[_0x7bf0('0x7c')],{'as':_0x7bf0('0x144'),'foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x76')][_0x7bf0('0x111')](db['ReportAgentPreview'],{'as':_0x7bf0('0x116'),'foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x76')][_0x7bf0('0x111')](db[_0x7bf0('0xd4')],{'as':_0x7bf0('0x145'),'foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x76')][_0x7bf0('0x111')](db[_0x7bf0('0x62')],{'as':_0x7bf0('0x117'),'foreignKey':_0x7bf0('0x152'),'onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x76')]['hasMany'](db[_0x7bf0('0x6c')],{'as':_0x7bf0('0x118'),'foreignKey':_0x7bf0('0x152'),'onDelete':'restrict'});db[_0x7bf0('0x76')][_0x7bf0('0x111')](db[_0x7bf0('0x59')],{'as':_0x7bf0('0x18c'),'foreignKey':_0x7bf0('0x152'),'onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x76')][_0x7bf0('0x111')](db[_0x7bf0('0x127')],{'as':_0x7bf0('0x119'),'foreignKey':'ContactId','onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x76')]['hasMany'](db['MailInteraction'],{'as':_0x7bf0('0x11a'),'foreignKey':_0x7bf0('0x152'),'onDelete':_0x7bf0('0x167')});db['CmContact']['belongsTo'](db[_0x7bf0('0x74')],{'as':_0x7bf0('0x18d'),'foreignKey':_0x7bf0('0x18e')});db[_0x7bf0('0x76')]['belongsTo'](db[_0x7bf0('0xfa')],{'as':'List','foreignKey':_0x7bf0('0x159'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x76')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x163'),'through':_0x7bf0('0x123')});db[_0x7bf0('0x76')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0x7bf0('0x76')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x18f'),'as':_0x7bf0('0x162')});db[_0x7bf0('0x77')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x77')]['belongsTo'](db['CmList'],{'as':_0x7bf0('0x169'),'foreignKey':_0x7bf0('0x159'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x77')][_0x7bf0('0x11e')](db['User'],{'as':_0x7bf0('0x184'),'foreignKey':'UserId'});db[_0x7bf0('0x77')]['belongsTo'](db['VoiceQueue'],{'as':_0x7bf0('0x185'),'foreignKey':_0x7bf0('0x142'),'onDelete':_0x7bf0('0x10e')});db['CmHopper'][_0x7bf0('0x11e')](db[_0x7bf0('0xeb')],{'as':'Campaign','foreignKey':_0x7bf0('0x190'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x77')]['belongsTo'](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x15f'),'foreignKey':_0x7bf0('0x191')});db[_0x7bf0('0x79')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152'),'onDelete':_0x7bf0('0x10e')});db['CmHopperBlack'][_0x7bf0('0x11e')](db['CmList'],{'as':_0x7bf0('0x169'),'foreignKey':_0x7bf0('0x159'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x79')][_0x7bf0('0x11e')](db[_0x7bf0('0x1d')],{'as':_0x7bf0('0x185'),'foreignKey':_0x7bf0('0x142'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0x79')][_0x7bf0('0x11e')](db[_0x7bf0('0xeb')],{'as':_0x7bf0('0xeb'),'foreignKey':'CampaignId','onDelete':_0x7bf0('0x10e')});db['Automation'][_0x7bf0('0x111')](db[_0x7bf0('0x87')],{'as':{'plural':'All','singular':_0x7bf0('0x192')},'foreignKey':_0x7bf0('0x193'),'onDelete':_0x7bf0('0x10e'),'hooks':!![]});db[_0x7bf0('0x82')]['hasMany'](db[_0x7bf0('0x87')],{'as':{'plural':_0x7bf0('0x194'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x7bf0('0x10e'),'hooks':!![]});db[_0x7bf0('0x82')][_0x7bf0('0x111')](db['Action'],{'as':'Actions','foreignKey':_0x7bf0('0x195'),'onDelete':_0x7bf0('0x10e'),'hooks':!![]});db[_0x7bf0('0x88')][_0x7bf0('0x111')](db[_0x7bf0('0x88')],{'as':_0x7bf0('0x196'),'foreignKey':_0x7bf0('0x149'),'onDelete':_0x7bf0('0x10e'),'hooks':!![],'required':![]});db[_0x7bf0('0x88')][_0x7bf0('0x111')](db['VoiceExtension'],{'as':_0x7bf0('0x113'),'foreignKey':_0x7bf0('0x149'),'onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x88')]['hasMany'](db[_0x7bf0('0x48')],{'as':_0x7bf0('0x197'),'foreignKey':_0x7bf0('0x149')});db[_0x7bf0('0x88')][_0x7bf0('0x111')](db['ChatApplication'],{'as':_0x7bf0('0x198'),'foreignKey':'IntervalId'});db[_0x7bf0('0x88')][_0x7bf0('0x111')](db['FaxApplication'],{'as':_0x7bf0('0x199'),'foreignKey':_0x7bf0('0x149')});db[_0x7bf0('0x88')][_0x7bf0('0x111')](db[_0x7bf0('0x57')],{'as':_0x7bf0('0x19a'),'foreignKey':_0x7bf0('0x149')});db[_0x7bf0('0x8e')]['belongsTo'](db[_0x7bf0('0x41')],{});db['Schedule'][_0x7bf0('0x11e')](db['AnalyticDefaultReport'],{'foreignKey':_0x7bf0('0x19b')});db[_0x7bf0('0x8e')][_0x7bf0('0x11e')](db[_0x7bf0('0x19c')],{'foreignKey':_0x7bf0('0x19d')});db[_0x7bf0('0x90')][_0x7bf0('0x120')](db[_0x7bf0('0x1b')],{'as':_0x7bf0('0x19e'),'through':_0x7bf0('0x140'),'onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x92')]['belongsToMany'](db[_0x7bf0('0x76')],{'through':_0x7bf0('0x18f')});db['Tag'][_0x7bf0('0x120')](db[_0x7bf0('0x6c')],{'through':_0x7bf0('0x189')});db['Tag'][_0x7bf0('0x120')](db[_0x7bf0('0x45')],{'through':_0x7bf0('0x161')});db[_0x7bf0('0x92')][_0x7bf0('0x120')](db[_0x7bf0('0x59')],{'through':_0x7bf0('0x176')});db[_0x7bf0('0x92')][_0x7bf0('0x120')](db[_0x7bf0('0x127')],{'through':_0x7bf0('0x171')});db[_0x7bf0('0x92')][_0x7bf0('0x120')](db[_0x7bf0('0x62')],{'through':_0x7bf0('0x17f')});db[_0x7bf0('0x92')]['belongsToMany'](db[_0x7bf0('0x102')],{'through':_0x7bf0('0x19f')});db[_0x7bf0('0x95')][_0x7bf0('0x111')](db['Condition'],{'as':{'plural':_0x7bf0('0x1a0'),'singular':_0x7bf0('0x1a1')},'foreignKey':_0x7bf0('0x1a2'),'onDelete':_0x7bf0('0x10e'),'hooks':!![]});db[_0x7bf0('0x95')][_0x7bf0('0x111')](db[_0x7bf0('0x87')],{'as':{'plural':_0x7bf0('0x1a3'),'singular':_0x7bf0('0x1a4')},'foreignKey':_0x7bf0('0x1a5'),'onDelete':_0x7bf0('0x10e'),'hooks':!![]});db[_0x7bf0('0x95')][_0x7bf0('0x111')](db[_0x7bf0('0x80')],{'as':'Actions','foreignKey':_0x7bf0('0x1a6'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0x7bf0('0xa1')],{'as':_0x7bf0('0x1a7'),'onDelete':'cascade','foreignKey':_0x7bf0('0x19d'),'hooks':!![]});db[_0x7bf0('0x9c')][_0x7bf0('0x111')](db[_0x7bf0('0xa1')],{'as':_0x7bf0('0x1a7'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x19b')});db[_0x7bf0('0x9f')][_0x7bf0('0x111')](db['AnalyticFieldReport'],{'as':_0x7bf0('0x1a7'),'onDelete':_0x7bf0('0x10e'),'foreignKey':'MetricId'});db[_0x7bf0('0xa1')][_0x7bf0('0x11e')](db[_0x7bf0('0x9f')],{'foreignKey':'MetricId'});db[_0x7bf0('0xa3')][_0x7bf0('0x111')](db[_0x7bf0('0xa5')],{'as':_0x7bf0('0x1a8'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x7bf0('0xa5')][_0x7bf0('0x111')](db[_0x7bf0('0xa7')],{'as':_0x7bf0('0x1a9'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xa5')]['hasMany'](db[_0x7bf0('0xa7')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x7bf0('0xa5')][_0x7bf0('0x111')](db[_0x7bf0('0xa7')],{'as':_0x7bf0('0x1a7'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ab')});db['SalesforceConfiguration'][_0x7bf0('0x11e')](db['SalesforceAccount'],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x1ac')});db[_0x7bf0('0xa7')][_0x7bf0('0x111')](db[_0x7bf0('0xa7')],{'as':'Subject','foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xa7')]['hasMany'](db[_0x7bf0('0xa7')],{'as':_0x7bf0('0x1ad'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0xa7')]['hasMany'](db[_0x7bf0('0xa7')],{'as':_0x7bf0('0x1af'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0xa7')][_0x7bf0('0x11e')](db['Variable'],{'as':'Variable','foreignKey':_0x7bf0('0x1b0')});db[_0x7bf0('0xa8')][_0x7bf0('0x111')](db[_0x7bf0('0xaa')],{'as':_0x7bf0('0x1a8'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ac')});db[_0x7bf0('0xaa')]['hasMany'](db['SugarcrmField'],{'as':_0x7bf0('0x1a9'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xaa')][_0x7bf0('0x111')](db[_0x7bf0('0xac')],{'as':_0x7bf0('0x1b1'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ae')});db['SugarcrmConfiguration'][_0x7bf0('0x111')](db['SugarcrmField'],{'as':_0x7bf0('0x1a7'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0xaa')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x7bf0('0x15e'),'foreignKey':'AccountId'});db[_0x7bf0('0xac')][_0x7bf0('0x111')](db[_0x7bf0('0xac')],{'as':_0x7bf0('0x1b2'),'foreignKey':_0x7bf0('0x1aa')});db['SugarcrmField'][_0x7bf0('0x111')](db['SugarcrmField'],{'as':_0x7bf0('0x1ad'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0xac')][_0x7bf0('0x111')](db[_0x7bf0('0xac')],{'as':_0x7bf0('0x1af'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0xac')][_0x7bf0('0x11e')](db[_0x7bf0('0x96')],{'as':_0x7bf0('0x96'),'foreignKey':_0x7bf0('0x1b0')});db[_0x7bf0('0x1b3')][_0x7bf0('0x111')](db[_0x7bf0('0xae')],{'as':_0x7bf0('0x1a8'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ac')});db[_0x7bf0('0xae')]['hasMany'](db[_0x7bf0('0x1b4')],{'as':'Subjects','onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1aa')});db['DeskConfiguration'][_0x7bf0('0x111')](db[_0x7bf0('0x1b4')],{'as':_0x7bf0('0x1b1'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0xae')][_0x7bf0('0x111')](db['DeskField'],{'as':'Fields','onDelete':_0x7bf0('0x10e'),'foreignKey':'FieldId'});db['DeskConfiguration'][_0x7bf0('0x11e')](db['DeskAccount'],{'as':_0x7bf0('0x15e'),'foreignKey':'AccountId'});db[_0x7bf0('0xae')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x1b5')});db[_0x7bf0('0x1b4')][_0x7bf0('0x111')](db[_0x7bf0('0x1b4')],{'as':'Subject','foreignKey':_0x7bf0('0x1aa')});db['DeskField'][_0x7bf0('0x111')](db[_0x7bf0('0x1b4')],{'as':_0x7bf0('0x1ad'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0x1b4')]['hasMany'](db[_0x7bf0('0x1b4')],{'as':'Field','foreignKey':'FieldId'});db['DeskField']['belongsTo'](db[_0x7bf0('0x96')],{'as':_0x7bf0('0x96'),'foreignKey':'VariableId'});db[_0x7bf0('0xaf')]['hasMany'](db[_0x7bf0('0x1b6')],{'as':_0x7bf0('0x1a8'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ac')});db[_0x7bf0('0x1b6')][_0x7bf0('0x111')](db['ZohoField'],{'as':'Subjects','onDelete':_0x7bf0('0x10e'),'foreignKey':'SubjectId'});db[_0x7bf0('0x1b6')][_0x7bf0('0x111')](db[_0x7bf0('0xb1')],{'as':_0x7bf0('0x1b1'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0x1b6')][_0x7bf0('0x111')](db[_0x7bf0('0xb1')],{'as':_0x7bf0('0x1a7'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0x1b6')][_0x7bf0('0x11e')](db[_0x7bf0('0xaf')],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x1ac')});db['ZohoField'][_0x7bf0('0x111')](db['ZohoField'],{'as':_0x7bf0('0x1b2'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xb1')][_0x7bf0('0x111')](db['ZohoField'],{'as':'Description','foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0xb1')][_0x7bf0('0x111')](db[_0x7bf0('0xb1')],{'as':_0x7bf0('0x1af'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0xb1')][_0x7bf0('0x11e')](db[_0x7bf0('0x96')],{'as':_0x7bf0('0x96'),'foreignKey':_0x7bf0('0x1b0')});db['ZendeskAccount'][_0x7bf0('0x111')](db[_0x7bf0('0xb4')],{'as':'Configurations','onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ac')});db[_0x7bf0('0xb4')]['hasMany'](db[_0x7bf0('0x1b7')],{'as':_0x7bf0('0x1a9'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xb4')][_0x7bf0('0x111')](db[_0x7bf0('0x1b7')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x7bf0('0xb4')]['hasMany'](db[_0x7bf0('0x1b7')],{'as':_0x7bf0('0x1a7'),'foreignKey':_0x7bf0('0x1ab')});db['ZendeskConfiguration'][_0x7bf0('0x11e')](db[_0x7bf0('0xb2')],{'as':'Account','foreignKey':_0x7bf0('0x1ac')});db[_0x7bf0('0xb4')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x1b8')});db[_0x7bf0('0x1b7')][_0x7bf0('0x111')](db[_0x7bf0('0x1b7')],{'as':_0x7bf0('0x1b2'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0x1b7')][_0x7bf0('0x111')](db['ZendeskField'],{'as':'Description','foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0x1b7')]['hasMany'](db['ZendeskField'],{'as':_0x7bf0('0x1af'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0x1b7')][_0x7bf0('0x11e')](db[_0x7bf0('0x96')],{'as':_0x7bf0('0x96'),'foreignKey':_0x7bf0('0x1b0')});db[_0x7bf0('0xb5')][_0x7bf0('0x111')](db[_0x7bf0('0x1b9')],{'as':_0x7bf0('0x1a8'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x7bf0('0x1b9')][_0x7bf0('0x111')](db[_0x7bf0('0xb8')],{'as':_0x7bf0('0x1a9'),'onDelete':'cascade','foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0x1b9')][_0x7bf0('0x111')](db[_0x7bf0('0xb8')],{'as':_0x7bf0('0x1b1'),'onDelete':'cascade','foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0x1b9')]['hasMany'](db[_0x7bf0('0xb8')],{'as':_0x7bf0('0x1a7'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0x1b9')]['belongsTo'](db[_0x7bf0('0xb5')],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x1ac')});db[_0x7bf0('0x1b9')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x1ba')});db['FreshdeskField'][_0x7bf0('0x111')](db[_0x7bf0('0xb8')],{'as':_0x7bf0('0x1b2'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xb8')][_0x7bf0('0x111')](db['FreshdeskField'],{'as':_0x7bf0('0x1ad'),'foreignKey':'DescriptionId'});db['FreshdeskField'][_0x7bf0('0x111')](db[_0x7bf0('0xb8')],{'as':_0x7bf0('0x1af'),'foreignKey':_0x7bf0('0x1ab')});db['FreshdeskField']['belongsTo'](db[_0x7bf0('0x96')],{'as':_0x7bf0('0x96'),'foreignKey':_0x7bf0('0x1b0')});db[_0x7bf0('0xb9')][_0x7bf0('0x111')](db['VtigerConfiguration'],{'as':_0x7bf0('0x1a8'),'onDelete':_0x7bf0('0x10e'),'foreignKey':'AccountId'});db[_0x7bf0('0xbb')]['hasMany'](db['VtigerField'],{'as':_0x7bf0('0x1a9'),'foreignKey':_0x7bf0('0x1aa')});db['VtigerConfiguration'][_0x7bf0('0x111')](db[_0x7bf0('0xbc')],{'as':_0x7bf0('0x1b1'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0xbb')]['hasMany'](db['VtigerField'],{'as':_0x7bf0('0x1a7'),'foreignKey':_0x7bf0('0x1ab')});db['VtigerConfiguration'][_0x7bf0('0x11e')](db[_0x7bf0('0xb9')],{'as':'Account','foreignKey':_0x7bf0('0x1ac')});db['VtigerField']['hasMany'](db[_0x7bf0('0xbc')],{'as':_0x7bf0('0x1b2'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xbc')]['hasMany'](db['VtigerField'],{'as':_0x7bf0('0x1ad'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0xbc')][_0x7bf0('0x111')](db[_0x7bf0('0xbc')],{'as':'Field','foreignKey':'FieldId'});db[_0x7bf0('0xbc')]['belongsTo'](db[_0x7bf0('0x96')],{'as':_0x7bf0('0x96'),'foreignKey':_0x7bf0('0x1b0')});db[_0x7bf0('0xbe')][_0x7bf0('0x111')](db[_0x7bf0('0xc0')],{'as':_0x7bf0('0x1a8'),'onDelete':_0x7bf0('0x10e'),'foreignKey':'AccountId'});db[_0x7bf0('0xc0')][_0x7bf0('0x111')](db[_0x7bf0('0xc1')],{'as':_0x7bf0('0x1a9'),'foreignKey':_0x7bf0('0x1aa')});db['ServicenowConfiguration'][_0x7bf0('0x111')](db[_0x7bf0('0xc1')],{'as':_0x7bf0('0x1b1'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0xc0')][_0x7bf0('0x111')](db[_0x7bf0('0xc1')],{'as':_0x7bf0('0x1a7'),'foreignKey':'FieldId'});db[_0x7bf0('0xc0')]['belongsTo'](db[_0x7bf0('0xbe')],{'as':_0x7bf0('0x15e'),'foreignKey':'AccountId'});db[_0x7bf0('0xc1')][_0x7bf0('0x111')](db['ServicenowField'],{'as':_0x7bf0('0x1b2'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xc1')][_0x7bf0('0x111')](db[_0x7bf0('0xc1')],{'as':'Description','foreignKey':_0x7bf0('0x1ae')});db['ServicenowField'][_0x7bf0('0x111')](db[_0x7bf0('0xc1')],{'as':_0x7bf0('0x1af'),'foreignKey':_0x7bf0('0x1ab')});db['ServicenowField'][_0x7bf0('0x11e')](db['Variable'],{'as':_0x7bf0('0x96'),'foreignKey':_0x7bf0('0x1b0')});db[_0x7bf0('0xc2')]['hasMany'](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ac')});db[_0x7bf0('0xc4')][_0x7bf0('0x111')](db['Dynamics365Field'],{'as':_0x7bf0('0x1a9'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x7bf0('0xc4')][_0x7bf0('0x111')](db[_0x7bf0('0x1bb')],{'as':_0x7bf0('0x1b1'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ae')});db['Dynamics365Configuration'][_0x7bf0('0x111')](db[_0x7bf0('0x1bb')],{'as':_0x7bf0('0x1a7'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0xc4')][_0x7bf0('0x11e')](db[_0x7bf0('0xc2')],{'as':'Account','foreignKey':_0x7bf0('0x1ac')});db['Dynamics365Field'][_0x7bf0('0x111')](db['Dynamics365Field'],{'as':_0x7bf0('0x1b2'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0x1bb')][_0x7bf0('0x111')](db[_0x7bf0('0x1bb')],{'as':_0x7bf0('0x1ad'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0x1bb')]['hasMany'](db[_0x7bf0('0x1bb')],{'as':_0x7bf0('0x1af'),'foreignKey':'FieldId'});db[_0x7bf0('0x1bb')][_0x7bf0('0x11e')](db[_0x7bf0('0x96')],{'as':_0x7bf0('0x96'),'foreignKey':_0x7bf0('0x1b0')});db[_0x7bf0('0xc7')][_0x7bf0('0x111')](db[_0x7bf0('0xc8')],{'as':_0x7bf0('0x1a8'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x7bf0('0x1a9'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xc8')][_0x7bf0('0x111')](db[_0x7bf0('0xca')],{'as':_0x7bf0('0x1b1'),'foreignKey':_0x7bf0('0x1ae')});db[_0x7bf0('0xc8')]['hasMany'](db[_0x7bf0('0xca')],{'as':_0x7bf0('0x1a7'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0xc8')]['belongsTo'](db[_0x7bf0('0xc7')],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x1ac')});db[_0x7bf0('0xca')][_0x7bf0('0x111')](db[_0x7bf0('0xca')],{'as':_0x7bf0('0x1b2'),'foreignKey':_0x7bf0('0x1aa')});db[_0x7bf0('0xca')][_0x7bf0('0x111')](db[_0x7bf0('0xca')],{'as':_0x7bf0('0x1ad'),'foreignKey':'DescriptionId'});db[_0x7bf0('0xca')][_0x7bf0('0x111')](db[_0x7bf0('0xca')],{'as':_0x7bf0('0x1af'),'foreignKey':_0x7bf0('0x1ab')});db[_0x7bf0('0xca')][_0x7bf0('0x11e')](db[_0x7bf0('0x96')],{'as':_0x7bf0('0x96'),'foreignKey':_0x7bf0('0x1b0')});db[_0x7bf0('0xce')][_0x7bf0('0x11e')](db['ChatWebsite'],{});db[_0x7bf0('0xce')][_0x7bf0('0x11e')](db[_0x7bf0('0xfa')],{'as':'List','foreignKey':_0x7bf0('0x159')});db[_0x7bf0('0xce')][_0x7bf0('0x11e')](db['CmContact'],{'as':_0x7bf0('0x151'),'foreignKey':'ContactId'});db[_0x7bf0('0xce')][_0x7bf0('0x11e')](db[_0x7bf0('0x6c')],{});db['ChatQueueReport']['belongsTo'](db[_0x7bf0('0x6d')],{});db['ChatQueueReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{});db['ChatQueueReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x70')],{});db[_0x7bf0('0xd0')][_0x7bf0('0x11e')](db['User'],{'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x1bc')});db[_0x7bf0('0xd0')]['belongsTo'](db[_0x7bf0('0x13')],{'onDelete':'cascade','foreignKey':'ToId'});db[_0x7bf0('0xd4')][_0x7bf0('0x111')](db[_0x7bf0('0x1bd')],{'foreignKey':_0x7bf0('0x1be'),'onDelete':_0x7bf0('0x10e')});db['JscriptySessionReport'][_0x7bf0('0x111')](db[_0x7bf0('0x1bf')],{'foreignKey':'SessionId','onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0xd6')]['belongsTo'](db[_0x7bf0('0x137')],{});db[_0x7bf0('0xd6')][_0x7bf0('0x11e')](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x169'),'foreignKey':'ListId'});db[_0x7bf0('0xd6')][_0x7bf0('0x11e')](db['CmContact'],{'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152')});db['SmsQueueReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x59')],{});db[_0x7bf0('0xd6')][_0x7bf0('0x11e')](db[_0x7bf0('0x5b')],{});db['SmsQueueReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{});db[_0x7bf0('0xd6')][_0x7bf0('0x11e')](db[_0x7bf0('0x5d')],{});db['JscriptyProject'][_0x7bf0('0x111')](db[_0x7bf0('0xd4')],{'foreignKey':_0x7bf0('0x1c0')});db[_0x7bf0('0xdc')][_0x7bf0('0x111')](db[_0x7bf0('0x1bd')],{'foreignKey':_0x7bf0('0x1c0')});db[_0x7bf0('0xdc')]['hasMany'](db[_0x7bf0('0x1bf')],{'foreignKey':'ProjectId'});db[_0x7bf0('0xe2')][_0x7bf0('0x120')](db['User'],{'as':_0x7bf0('0x163'),'through':_0x7bf0('0x13c')});db[_0x7bf0('0xe7')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':'Agents','through':'user_has_teams'});db['Team'][_0x7bf0('0x120')](db['VoiceQueue'],{'through':_0x7bf0('0x1c1'),'as':'VoiceQueues'});db[_0x7bf0('0xe7')][_0x7bf0('0x120')](db['MailQueue'],{'through':_0x7bf0('0x15c'),'as':_0x7bf0('0x12b')});db['Team'][_0x7bf0('0x120')](db[_0x7bf0('0x70')],{'through':_0x7bf0('0x1c2'),'as':_0x7bf0('0x12c')});db[_0x7bf0('0xe7')]['belongsToMany'](db[_0x7bf0('0x55')],{'through':'team_has_fax_queues','as':_0x7bf0('0x12d')});db[_0x7bf0('0xe7')][_0x7bf0('0x120')](db[_0x7bf0('0x5d')],{'through':_0x7bf0('0x179'),'as':_0x7bf0('0x12e')});db['Team'][_0x7bf0('0x120')](db[_0x7bf0('0x66')],{'through':_0x7bf0('0x180'),'as':_0x7bf0('0x1c3')});db[_0x7bf0('0xe7')][_0x7bf0('0x120')](db['WhatsappQueue'],{'through':_0x7bf0('0x1c4'),'as':_0x7bf0('0x12f')});db[_0x7bf0('0xeb')][_0x7bf0('0x111')](db[_0x7bf0('0x77')],{'as':_0x7bf0('0x143'),'foreignKey':_0x7bf0('0x190')});db[_0x7bf0('0xeb')][_0x7bf0('0x111')](db[_0x7bf0('0x7a')],{'as':_0x7bf0('0x114'),'foreignKey':_0x7bf0('0x190')});db[_0x7bf0('0xeb')][_0x7bf0('0x111')](db[_0x7bf0('0x7c')],{'as':_0x7bf0('0x144'),'foreignKey':_0x7bf0('0x190')});db['Campaign'][_0x7bf0('0x111')](db[_0x7bf0('0x79')],{'as':_0x7bf0('0x1c5'),'foreignKey':_0x7bf0('0x190')});db[_0x7bf0('0xeb')]['belongsTo'](db['Trunk'],{'as':_0x7bf0('0x2e'),'foreignKey':'TrunkId'});db['Campaign'][_0x7bf0('0x11e')](db[_0x7bf0('0x2e')],{'as':'TrunkBackup','foreignKey':_0x7bf0('0x148')});db[_0x7bf0('0xeb')][_0x7bf0('0x11e')](db[_0x7bf0('0x88')],{'as':_0x7bf0('0x88'),'foreignKey':_0x7bf0('0x149')});db['Campaign'][_0x7bf0('0x11e')](db[_0x7bf0('0xe2')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x7bf0('0xeb')][_0x7bf0('0x120')](db[_0x7bf0('0xfa')],{'as':'Lists','through':_0x7bf0('0x1c6')});db['Campaign'][_0x7bf0('0x120')](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x1c7'),'through':_0x7bf0('0x1c8')});db[_0x7bf0('0x1c9')][_0x7bf0('0x11e')](db[_0x7bf0('0x47')],{});db[_0x7bf0('0x1c9')][_0x7bf0('0x11e')](db[_0x7bf0('0x45')],{});db[_0x7bf0('0x1c9')]['belongsTo'](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x7bf0('0x1ca')});db[_0x7bf0('0x1c9')][_0x7bf0('0x11e')](db['User'],{'foreignKey':_0x7bf0('0x1cb'),'as':_0x7bf0('0x1cc')});db[_0x7bf0('0x1c9')]['belongsTo'](db[_0x7bf0('0x13')],{'foreignKey':'ToUserId','as':_0x7bf0('0x1cd')});db[_0x7bf0('0x1c9')]['belongsTo'](db['MailQueue'],{'foreignKey':_0x7bf0('0x1ce'),'as':_0x7bf0('0x1cf')});db[_0x7bf0('0x1c9')][_0x7bf0('0x11e')](db[_0x7bf0('0x41')],{'foreignKey':_0x7bf0('0x1d0'),'as':_0x7bf0('0x1d1')});db[_0x7bf0('0x1d2')][_0x7bf0('0x11e')](db[_0x7bf0('0x6d')],{});db[_0x7bf0('0x1d2')][_0x7bf0('0x11e')](db[_0x7bf0('0x6c')],{});db[_0x7bf0('0x1d2')][_0x7bf0('0x11e')](db[_0x7bf0('0x181')],{'foreignKey':_0x7bf0('0x1d3'),'as':_0x7bf0('0x1ca')});db[_0x7bf0('0x1d2')]['belongsTo'](db[_0x7bf0('0x13')],{'foreignKey':'FromUserId','as':_0x7bf0('0x1cc')});db[_0x7bf0('0x1d2')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'foreignKey':'ToUserId','as':_0x7bf0('0x1cd')});db[_0x7bf0('0x1d2')][_0x7bf0('0x11e')](db[_0x7bf0('0x70')],{'foreignKey':_0x7bf0('0x1d4'),'as':_0x7bf0('0x1cf')});db['ChatTransferReport'][_0x7bf0('0x11e')](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0x7bf0('0x1d1')});db[_0x7bf0('0xf4')]['belongsTo'](db[_0x7bf0('0x53')],{});db[_0x7bf0('0xf4')][_0x7bf0('0x11e')](db['FaxInteraction'],{});db[_0x7bf0('0xf4')]['belongsTo'](db[_0x7bf0('0x4f')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0x7bf0('0xf4')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'foreignKey':'FromUserId','as':_0x7bf0('0x1cc')});db[_0x7bf0('0xf4')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x7bf0('0xf4')][_0x7bf0('0x11e')](db[_0x7bf0('0x55')],{'foreignKey':'ToFaxQueueId','as':_0x7bf0('0x1cf')});db[_0x7bf0('0xf4')][_0x7bf0('0x11e')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x7bf0('0x1d1')});db[_0x7bf0('0xf6')][_0x7bf0('0x11e')](db[_0x7bf0('0x64')],{});db[_0x7bf0('0xf6')][_0x7bf0('0x11e')](db[_0x7bf0('0x62')],{});db[_0x7bf0('0xf6')][_0x7bf0('0x11e')](db[_0x7bf0('0x5f')],{'foreignKey':_0x7bf0('0x1d5'),'as':'FromAccount'});db[_0x7bf0('0xf6')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'foreignKey':_0x7bf0('0x1cb'),'as':_0x7bf0('0x1cc')});db[_0x7bf0('0xf6')]['belongsTo'](db[_0x7bf0('0x13')],{'foreignKey':_0x7bf0('0x1d6'),'as':_0x7bf0('0x1cd')});db['OpenchannelTransferReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x66')],{'foreignKey':_0x7bf0('0x1d7'),'as':_0x7bf0('0x1cf')});db[_0x7bf0('0xf6')][_0x7bf0('0x11e')](db[_0x7bf0('0x5f')],{'foreignKey':_0x7bf0('0x1d8'),'as':_0x7bf0('0x1d1')});db[_0x7bf0('0xf8')]['belongsTo'](db[_0x7bf0('0x5b')],{});db[_0x7bf0('0xf8')][_0x7bf0('0x11e')](db[_0x7bf0('0x59')],{});db['SmsTransferReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x137')],{'foreignKey':_0x7bf0('0x1d9'),'as':'FromAccount'});db['SmsTransferReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'foreignKey':_0x7bf0('0x1cb'),'as':_0x7bf0('0x1cc')});db[_0x7bf0('0xf8')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'foreignKey':_0x7bf0('0x1d6'),'as':_0x7bf0('0x1cd')});db[_0x7bf0('0xf8')]['belongsTo'](db[_0x7bf0('0x5d')],{'foreignKey':_0x7bf0('0x1da'),'as':_0x7bf0('0x1cf')});db[_0x7bf0('0xf8')][_0x7bf0('0x11e')](db['SmsAccount'],{'foreignKey':_0x7bf0('0x1db'),'as':_0x7bf0('0x1d1')});db[_0x7bf0('0xfa')]['hasMany'](db[_0x7bf0('0x85')],{'as':_0x7bf0('0x156'),'foreignKey':'ListId'});db[_0x7bf0('0xfa')][_0x7bf0('0x111')](db[_0x7bf0('0x1dc')],{'as':_0x7bf0('0x1dd'),'foreignKey':_0x7bf0('0x159')});db['CmList']['hasMany'](db['CmContact'],{'as':_0x7bf0('0x18b'),'onDelete':_0x7bf0('0x10e'),'foreignKey':_0x7bf0('0x159')});db['CmList']['hasMany'](db[_0x7bf0('0x7a')],{'as':_0x7bf0('0x114'),'foreignKey':'ListId'});db[_0x7bf0('0xfa')][_0x7bf0('0x111')](db[_0x7bf0('0x7c')],{'as':_0x7bf0('0x115'),'foreignKey':_0x7bf0('0x159')});db[_0x7bf0('0xfa')][_0x7bf0('0x111')](db['ReportAgentPreview'],{'as':_0x7bf0('0x116'),'foreignKey':'ListId'});db[_0x7bf0('0xfa')][_0x7bf0('0x120')](db['VoiceQueue'],{'as':_0x7bf0('0x1de'),'through':_0x7bf0('0x1df')});db[_0x7bf0('0xfa')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x14b'),'through':'cm_user_has_lists'});db[_0x7bf0('0xfb')][_0x7bf0('0x111')](db[_0x7bf0('0x19')],{'as':_0x7bf0('0x113'),'onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0xfb')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':'Agents','through':_0x7bf0('0x131')});db['UserProfile'][_0x7bf0('0x111')](db['User'],{'as':'Users','foreignKey':_0x7bf0('0x1e0')});db['UserProfile']['hasMany'](db[_0x7bf0('0xfd')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x7bf0('0x10e')});db[_0x7bf0('0xfd')][_0x7bf0('0x111')](db[_0x7bf0('0x1e1')],{'as':_0x7bf0('0x1e2'),'foreignKey':_0x7bf0('0x1e3'),'onDelete':'cascade'});db[_0x7bf0('0x13a')][_0x7bf0('0x111')](db[_0x7bf0('0x85')],{'as':_0x7bf0('0x156'),'foreignKey':_0x7bf0('0x1e4')});db[_0x7bf0('0x13a')][_0x7bf0('0x111')](db[_0x7bf0('0x16c')],{'as':_0x7bf0('0x157'),'foreignKey':_0x7bf0('0x1e4')});db[_0x7bf0('0x13a')][_0x7bf0('0x111')](db[_0x7bf0('0x104')],{'as':'Messages','foreignKey':_0x7bf0('0x1e4')});db[_0x7bf0('0x13a')][_0x7bf0('0x111')](db[_0x7bf0('0x102')],{'as':'Interactions'});db['WhatsappAccount'][_0x7bf0('0x111')](db[_0x7bf0('0x1e5')],{'as':_0x7bf0('0x13e')});db[_0x7bf0('0x13a')]['belongsTo'](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x169'),'foreignKey':'ListId'});db[_0x7bf0('0x13a')][_0x7bf0('0x11e')](db[_0x7bf0('0x8a')],{'as':_0x7bf0('0x14a'),'foreignKey':_0x7bf0('0x16e')});db[_0x7bf0('0x13a')]['belongsToMany'](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x14b'),'through':_0x7bf0('0x1e6')});db['WhatsappApplication'][_0x7bf0('0x11e')](db['User'],{'onDelete':_0x7bf0('0x167')});db['WhatsappApplication']['belongsTo'](db[_0x7bf0('0x109')],{'onDelete':_0x7bf0('0x167')});db[_0x7bf0('0x1e5')]['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x7bf0('0x167')});db['WhatsappApplication'][_0x7bf0('0x11e')](db['Interval'],{'onDelete':_0x7bf0('0x167'),'foreignKey':_0x7bf0('0x149')});db[_0x7bf0('0x1e5')][_0x7bf0('0x11e')](db[_0x7bf0('0x92')],{'onDelete':_0x7bf0('0x167'),'foreignKey':_0x7bf0('0x168')});db[_0x7bf0('0x102')][_0x7bf0('0x111')](db['WhatsappMessage'],{'as':_0x7bf0('0x14d'),'onDelete':_0x7bf0('0x10e'),'foreignKey':'WhatsappInteractionId'});db[_0x7bf0('0x102')][_0x7bf0('0x11e')](db[_0x7bf0('0x13a')],{'as':'Account','foreignKey':_0x7bf0('0x1e4')});db[_0x7bf0('0x102')][_0x7bf0('0x11e')](db['CmContact'],{'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x102')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x15f'),'foreignKey':_0x7bf0('0x110')});db['WhatsappInteraction'][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x19f'),'as':_0x7bf0('0x160')});db[_0x7bf0('0x102')][_0x7bf0('0x120')](db[_0x7bf0('0x92')],{'through':_0x7bf0('0x19f'),'as':_0x7bf0('0x162')});db[_0x7bf0('0x102')][_0x7bf0('0x120')](db[_0x7bf0('0x13')],{'as':_0x7bf0('0x163'),'through':_0x7bf0('0x1e7'),'foreignKey':_0x7bf0('0x1e8')});db['WhatsappMessage'][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'as':'User'});db[_0x7bf0('0x104')][_0x7bf0('0x11e')](db[_0x7bf0('0x76')],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x151')});db[_0x7bf0('0x104')][_0x7bf0('0x11e')](db[_0x7bf0('0x102')],{'onDelete':_0x7bf0('0x10e'),'as':_0x7bf0('0x166'),'foreignKey':'WhatsappInteractionId'});db[_0x7bf0('0x104')][_0x7bf0('0x11e')](db[_0x7bf0('0x13a')],{'as':_0x7bf0('0x15e'),'foreignKey':_0x7bf0('0x1e4')});db[_0x7bf0('0x106')][_0x7bf0('0x11e')](db[_0x7bf0('0x13a')],{});db[_0x7bf0('0x106')]['belongsTo'](db[_0x7bf0('0xfa')],{'as':_0x7bf0('0x169'),'foreignKey':_0x7bf0('0x159')});db[_0x7bf0('0x106')]['belongsTo'](db[_0x7bf0('0x76')],{'as':_0x7bf0('0x151'),'foreignKey':_0x7bf0('0x152')});db[_0x7bf0('0x106')][_0x7bf0('0x11e')](db[_0x7bf0('0x102')],{});db[_0x7bf0('0x106')]['belongsTo'](db['WhatsappQueue'],{});db[_0x7bf0('0x106')][_0x7bf0('0x11e')](db[_0x7bf0('0x104')],{});db[_0x7bf0('0x106')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{});db[_0x7bf0('0x108')][_0x7bf0('0x11e')](db[_0x7bf0('0x104')],{});db[_0x7bf0('0x108')]['belongsTo'](db[_0x7bf0('0x102')],{});db[_0x7bf0('0x108')][_0x7bf0('0x11e')](db['WhatsappAccount'],{'foreignKey':_0x7bf0('0x1e9'),'as':_0x7bf0('0x1ca')});db[_0x7bf0('0x108')][_0x7bf0('0x11e')](db[_0x7bf0('0x13a')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db['WhatsappTransferReport'][_0x7bf0('0x11e')](db[_0x7bf0('0x109')],{'foreignKey':_0x7bf0('0x1ea'),'as':_0x7bf0('0x1cf')});db[_0x7bf0('0x108')][_0x7bf0('0x11e')](db['User'],{'foreignKey':_0x7bf0('0x1cb'),'as':_0x7bf0('0x1cc')});db[_0x7bf0('0x108')][_0x7bf0('0x11e')](db[_0x7bf0('0x13')],{'foreignKey':'ToUserId','as':_0x7bf0('0x1cd')});db[_0x7bf0('0x109')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x7bf0('0x3c'),'foreignKey':_0x7bf0('0x1eb')});db[_0x7bf0('0x109')][_0x7bf0('0x120')](db['Team'],{'through':_0x7bf0('0x1c4'),'as':_0x7bf0('0x17a')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x1247=['SpiedAgents','Applications','Sound','Sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailServerIn','MailAccountId','Imap','Smtp','Dispositions','CannedAnswer','List','ListId','TemplateId','mandatoryDispositionPause','MailInteractionId','Account','Tags','mail_interaction_has_tags','ThroughTags','Users','Interaction','restrict','TagId','MailQueueReport','Dashboard','Items','FaxAccountId','Answers','Interactions','Exntensions','Owner','fax_interaction_has_tags','FaxInteractionId','AttachmentId','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelMessage','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','ChatApplication','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Members','Website','CompanyId','Company','cm_contact_has_tags','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','moh_has_sounds','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticMetric','Fields','MetricId','AccountId','SalesforceField','Subjects','Descriptions','DescriptionId','FieldId','Field','Variable','VariableId','SugarcrmAccount','Configurations','SubjectId','Subject','DeskConfiguration','DeskField','int_desk_configuration_has_tags','Description','ZohoAccount','ZohoConfiguration','ZendeskAccount','ZendeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','ServicenowField','FreshsalesField','FromId','ToId','SessionId','ProjectId','team_has_mail_queues','MailQueues','team_has_fax_queues','CampaignId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToAccount','ChatTransferReport','FromChatWebsiteId','ToQueue','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','user_has_voice_prefixes','Resources','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappApplication','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','WhatsappTransferReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','path','../config/environment','jstz','determine','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','defaultsDeep','sequelizeHistory','database','password','username','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','Notification','../api/notification/notification.model','WhatsappAccount','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappQueue/whatsappQueue.model','hasOne','VoiceMail','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','Notifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','UserWhatsappQueue','VoicePrefix','VoicePrefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_square_projects'];(function(_0x51ba6f,_0x246567){var _0xfda5da=function(_0x3f2b66){while(--_0x3f2b66){_0x51ba6f['push'](_0x51ba6f['shift']());}};_0xfda5da(++_0x246567);}(_0x1247,0xb6));var _0x7124=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0x1247[_0x562faf];return _0x22c1f6;};'use strict';var path=require(_0x7124('0x0'));var config=require(_0x7124('0x1'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0x7124('0x2'));var timezone=jstz[_0x7124('0x3')]();config[_0x7124('0x4')]=_['defaultsDeep'](config[_0x7124('0x4')],{'database':_0x7124('0x5'),'username':_0x7124('0x6'),'password':_0x7124('0x7'),'options':{'host':_0x7124('0x8'),'port':0xcea,'dialect':_0x7124('0x9'),'dialectOptions':{'charset':_0x7124('0xa')},'logging':![],'timezone':timezone[_0x7124('0xb')](),'define':{'charset':_0x7124('0xc'),'collate':_0x7124('0xd')}}});config['sequelizeHistory']=_[_0x7124('0xe')](config[_0x7124('0xf')],{'database':_0x7124('0x5'),'username':_0x7124('0x6'),'password':_0x7124('0x7'),'options':{'host':_0x7124('0x8'),'port':0xcea,'dialect':_0x7124('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x7124('0xb')](),'define':{'charset':'utf8','collate':_0x7124('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7124('0x4')][_0x7124('0x10')],config[_0x7124('0x4')]['username'],config[_0x7124('0x4')][_0x7124('0x11')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7124('0xf')][_0x7124('0x10')],config[_0x7124('0xf')][_0x7124('0x12')],config[_0x7124('0xf')][_0x7124('0x11')],config[_0x7124('0xf')][_0x7124('0x13')])};db[_0x7124('0x14')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x16'));db[_0x7124('0x17')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x18'));db[_0x7124('0x19')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x1a'));db[_0x7124('0x1b')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x1c'));db[_0x7124('0x1d')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x1e'));db[_0x7124('0x1f')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/voiceQueue/voiceQueue.model');db[_0x7124('0x20')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x21'));db['ScreenRecording']=db[_0x7124('0x4')]['import'](_0x7124('0x22'));db['VoiceMail']=db[_0x7124('0x4')]['import'](_0x7124('0x23'));db[_0x7124('0x24')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x25'));db[_0x7124('0x26')]=db['sequelize'][_0x7124('0x15')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x7124('0x4')][_0x7124('0x15')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x7124('0x4')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x27'));db['MemberReport']=db[_0x7124('0x4')]['import'](_0x7124('0x28'));db[_0x7124('0x29')]=db['sequelize'][_0x7124('0x15')](_0x7124('0x2a'));db[_0x7124('0x2b')]=db['sequelize'][_0x7124('0x15')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0x7124('0x4')][_0x7124('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x7124('0x2c')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x2d'));db[_0x7124('0x2e')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/userChatQueue/userChatQueue.model');db[_0x7124('0x2f')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x30'));db[_0x7124('0x31')]=db['sequelize'][_0x7124('0x15')](_0x7124('0x32'));db[_0x7124('0x33')]=db[_0x7124('0x4')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x7124('0x34')]=db['sequelize'][_0x7124('0x15')](_0x7124('0x35'));db['UserWhatsappQueue']=db['sequelize'][_0x7124('0x15')](_0x7124('0x36'));db['MailServerIn']=db['sequelize'][_0x7124('0x15')](_0x7124('0x37'));db[_0x7124('0x38')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x39'));db['MailAccount']=db['sequelize'][_0x7124('0x15')](_0x7124('0x3a'));db[_0x7124('0x3b')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x3c'));db[_0x7124('0x3d')]=db[_0x7124('0x4')]['import'](_0x7124('0x3e'));db[_0x7124('0x3f')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x40'));db[_0x7124('0x41')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x42'));db[_0x7124('0x43')]=db['sequelize'][_0x7124('0x15')](_0x7124('0x44'));db['MailQueueReport']=db['sequelize'][_0x7124('0x15')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0x7124('0x4')]['import'](_0x7124('0x45'));db[_0x7124('0x46')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x47'));db[_0x7124('0x48')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x49'));db[_0x7124('0x4a')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x4b'));db['FaxInteraction']=db[_0x7124('0x4')]['import']('../api/faxInteraction/faxInteraction.model');db[_0x7124('0x4c')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x4d'));db[_0x7124('0x4e')]=db['sequelize'][_0x7124('0x15')](_0x7124('0x4f'));db[_0x7124('0x50')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x51'));db['SmsAccount']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x52'));db[_0x7124('0x53')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x54'));db['SmsInteraction']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x55'));db[_0x7124('0x56')]=db[_0x7124('0x4')]['import'](_0x7124('0x57'));db[_0x7124('0x58')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/smsQueue/smsQueue.model');db[_0x7124('0x59')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x5a'));db[_0x7124('0x5b')]=db[_0x7124('0x4')]['import'](_0x7124('0x5c'));db['OpenchannelMessage']=db[_0x7124('0x4')][_0x7124('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0x7124('0x5d')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0x7124('0x5e')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x5f'));db[_0x7124('0x60')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x61'));db['ChatApplication']=db['sequelize'][_0x7124('0x15')](_0x7124('0x62'));db[_0x7124('0x63')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x64'));db['ChatMessage']=db[_0x7124('0x4')][_0x7124('0x15')]('../api/chatMessage/chatMessage.model');db[_0x7124('0x65')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x66'));db[_0x7124('0x67')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x68'));db[_0x7124('0x69')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x6a'));db[_0x7124('0x6b')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x6c'));db[_0x7124('0x6d')]=db['sequelize'][_0x7124('0x15')]('../api/cmCompany/cmCompany.model');db[_0x7124('0x6e')]=db['sequelize'][_0x7124('0x15')](_0x7124('0x6f'));db[_0x7124('0x70')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x71'));db[_0x7124('0x72')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x73'));db['CmHopperFinal']=db['sequelize'][_0x7124('0x15')](_0x7124('0x74'));db['CmHopperHistory']=db[_0x7124('0x4')][_0x7124('0x15')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x7124('0x75')]=db['sequelize'][_0x7124('0x15')](_0x7124('0x76'));db[_0x7124('0x77')]=db[_0x7124('0x4')]['import'](_0x7124('0x78'));db[_0x7124('0x79')]=db[_0x7124('0x4')]['import'](_0x7124('0x7a'));db[_0x7124('0x7b')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x7c'));db['CannedAnswer']=db[_0x7124('0x4')]['import'](_0x7124('0x7d'));db[_0x7124('0x7e')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x7f'));db[_0x7124('0x80')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x81'));db[_0x7124('0x82')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x83'));db[_0x7124('0x84')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x85'));db[_0x7124('0x86')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x87'));db[_0x7124('0x88')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x89'));db[_0x7124('0x8a')]=db['sequelize']['import'](_0x7124('0x8b'));db['Sound']=db[_0x7124('0x4')][_0x7124('0x15')]('../api/sound/sound.model');db[_0x7124('0x8c')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x8d'));db[_0x7124('0x8e')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x8f'));db[_0x7124('0x90')]=db['sequelize'][_0x7124('0x15')]('../api/trigger/trigger.model');db['Variable']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x91'));db['Integration']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x92'));db[_0x7124('0x93')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x94'));db[_0x7124('0x95')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x96'));db[_0x7124('0x97')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0x7124('0x4')]['import'](_0x7124('0x98'));db['AnalyticMetric']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x99'));db[_0x7124('0x9a')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x9b'));db['AnalyticTreeReport']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x9c'));db[_0x7124('0x9d')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x9e'));db[_0x7124('0x9f')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xa0'));db['SalesforceField']=db['sequelize'][_0x7124('0x15')](_0x7124('0xa1'));db['SugarcrmAccount']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xa2'));db[_0x7124('0xa3')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xa4'));db[_0x7124('0xa5')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xa6'));db[_0x7124('0xa7')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xa8'));db['DeskConfiguration']=db[_0x7124('0x4')][_0x7124('0x15')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xa9'));db['ZohoAccount']=db[_0x7124('0x4')]['import'](_0x7124('0xaa'));db['ZohoConfiguration']=db['sequelize'][_0x7124('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x7124('0xab')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xac'));db['ZendeskConfiguration']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xad'));db[_0x7124('0xae')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xaf'));db[_0x7124('0xb0')]=db[_0x7124('0x4')]['import'](_0x7124('0xb1'));db[_0x7124('0xb2')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xb3'));db[_0x7124('0xb4')]=db['sequelize']['import'](_0x7124('0xb5'));db[_0x7124('0xb6')]=db[_0x7124('0x4')]['import'](_0x7124('0xb7'));db[_0x7124('0xb8')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db['sequelize'][_0x7124('0x15')](_0x7124('0xb9'));db[_0x7124('0xba')]=db['sequelize']['import'](_0x7124('0xbb'));db[_0x7124('0xbc')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db['sequelize'][_0x7124('0x15')](_0x7124('0xbd'));db[_0x7124('0xbe')]=db[_0x7124('0x4')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0x7124('0xbf')]=db[_0x7124('0x4')]['import'](_0x7124('0xc0'));db[_0x7124('0xc1')]=db[_0x7124('0x4')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x7124('0xc2')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xc3'));db[_0x7124('0xc4')]=db['sequelize'][_0x7124('0x15')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db['sequelize']['import'](_0x7124('0xc5'));db[_0x7124('0xc6')]=db['sequelize']['import'](_0x7124('0x92'));db[_0x7124('0xc7')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xc8'));db[_0x7124('0xc9')]=db[_0x7124('0x4')]['import'](_0x7124('0xca'));db[_0x7124('0xcb')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xcc'));db[_0x7124('0xcd')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xce'));db[_0x7124('0xcf')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xd0'));db['JscriptySessionReport']=db['sequelize'][_0x7124('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x7124('0xd1')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xd2'));db[_0x7124('0xd3')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xd4'));db[_0x7124('0xd5')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xd6'));db[_0x7124('0xd7')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xd8'));db[_0x7124('0xd9')]=db['sequelize']['import'](_0x7124('0xda'));db[_0x7124('0xdb')]=db[_0x7124('0x4')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x7124('0xdc')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xdd'));db['SquareRecording']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xde'));db[_0x7124('0xdf')]=db['sequelize'][_0x7124('0x15')](_0x7124('0xe0'));db[_0x7124('0xe1')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xe2'));db[_0x7124('0xe3')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xe4'));db[_0x7124('0xe5')]=db[_0x7124('0x4')]['import'](_0x7124('0xe6'));db[_0x7124('0xe7')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xe8'));db[_0x7124('0xe9')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/attachment/attachment.model');db[_0x7124('0xea')]=db['sequelize'][_0x7124('0x15')](_0x7124('0xeb'));db[_0x7124('0xec')]=db['sequelize']['import'](_0x7124('0xed'));db['ChatTransferReport']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xee'));db[_0x7124('0xef')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0x7124('0xf0')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x7124('0xf1')]=db[_0x7124('0x4')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0x7124('0xf2')]=db['sequelize']['import'](_0x7124('0xf3'));db['VoicePrefix']=db['sequelize'][_0x7124('0x15')]('../api/voicePrefix/voicePrefix.model');db[_0x7124('0xf4')]=db[_0x7124('0x4')]['import'](_0x7124('0xf5'));db[_0x7124('0xf6')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xf7'));db[_0x7124('0xf8')]=db[_0x7124('0x4')]['import'](_0x7124('0xf9'));db[_0x7124('0xfa')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xfb'));db[_0x7124('0xfc')]=db[_0x7124('0x4')][_0x7124('0x15')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xfd'));db[_0x7124('0xfe')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0xff'));db[_0x7124('0x100')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x101'));db[_0x7124('0x102')]=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x103'));db['WhatsappTransferReport']=db[_0x7124('0x4')][_0x7124('0x15')]('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0x7124('0x4')][_0x7124('0x15')](_0x7124('0x104'));db['CloudProvider']=db[_0x7124('0x4')][_0x7124('0x15')]('../api/cloudProvider/cloudProvider.model');db[_0x7124('0x14')][_0x7124('0x105')](db[_0x7124('0x106')],{'as':'VoiceMail','onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x14')][_0x7124('0x109')](db['VoiceRecording'],{'as':_0x7124('0x10a'),'foreignKey':_0x7124('0x108')});db['User'][_0x7124('0x109')](db[_0x7124('0x10b')],{'as':_0x7124('0x10c'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x14')]['hasMany'](db[_0x7124('0x1b')],{'as':_0x7124('0x10d'),'onDelete':_0x7124('0x107'),'hooks':!![]});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0x10e')],{'as':_0x7124('0x10f'),'foreignKey':'UserId'});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0x110')],{'as':_0x7124('0x111'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0x75')],{'as':'ReportAgentPreview','foreignKey':_0x7124('0x108')});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0x5b')],{'as':_0x7124('0x112'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0x63')],{'as':_0x7124('0x113'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0x114')],{'as':_0x7124('0x115'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0x116')],{'as':_0x7124('0x117'),'foreignKey':'UserId'});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0x3f')],{'as':_0x7124('0x118'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0xfe')],{'as':_0x7124('0x119'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x14')][_0x7124('0x109')](db[_0x7124('0xfa')],{'as':_0x7124('0x11a'),'foreignKey':_0x7124('0x11b')});db[_0x7124('0x14')][_0x7124('0x11c')](db[_0x7124('0xf4')],{'as':_0x7124('0xf4'),'foreignKey':_0x7124('0x11d')});db['User'][_0x7124('0x11e')](db['ChatGroup'],{'as':_0x7124('0x11f'),'through':_0x7124('0x120')});db['User']['belongsToMany'](db['CmContact'],{'as':_0x7124('0x121'),'through':_0x7124('0x122')});db['User'][_0x7124('0x11e')](db[_0x7124('0xf2')],{'as':_0x7124('0x123'),'through':_0x7124('0x124')});db[_0x7124('0x14')]['belongsToMany'](db[_0x7124('0xe1')],{'through':_0x7124('0x125')});db[_0x7124('0x14')]['belongsToMany'](db[_0x7124('0x3f')],{'as':_0x7124('0x118'),'through':_0x7124('0x126')});db[_0x7124('0x14')][_0x7124('0x11e')](db[_0x7124('0x63')],{'as':_0x7124('0x113'),'through':'user_has_chat_interactions'});db['User'][_0x7124('0x11e')](db['FaxInteraction'],{'as':_0x7124('0x117'),'through':_0x7124('0x127')});db[_0x7124('0x14')][_0x7124('0x11e')](db[_0x7124('0x114')],{'as':_0x7124('0x115'),'through':_0x7124('0x128')});db[_0x7124('0x14')]['belongsToMany'](db[_0x7124('0x5b')],{'as':_0x7124('0x112'),'through':_0x7124('0x129')});db[_0x7124('0x14')]['belongsToMany'](db[_0x7124('0xfe')],{'as':_0x7124('0x119'),'through':'user_has_whatsapp_interactions'});db['User'][_0x7124('0x11e')](db['VoiceQueue'],{'as':_0x7124('0x12a'),'through':_0x7124('0x2c'),'required':![]});db['User']['belongsToMany'](db[_0x7124('0x3b')],{'as':'MailQueues','through':_0x7124('0x2f'),'required':![]});db[_0x7124('0x14')][_0x7124('0x11e')](db[_0x7124('0x67')],{'as':_0x7124('0x12b'),'through':_0x7124('0x2e'),'required':![],'hooks':!![]});db[_0x7124('0x14')]['belongsToMany'](db['FaxQueue'],{'as':_0x7124('0x12c'),'through':'UserFaxQueue','required':![]});db[_0x7124('0x14')]['belongsToMany'](db['SmsQueue'],{'as':_0x7124('0x12d'),'through':_0x7124('0x33'),'required':![]});db[_0x7124('0x14')]['belongsToMany'](db[_0x7124('0x5d')],{'as':_0x7124('0x12e'),'through':_0x7124('0x34'),'required':![]});db[_0x7124('0x14')][_0x7124('0x11e')](db[_0x7124('0x12f')],{'as':_0x7124('0x130'),'through':_0x7124('0x131'),'required':![]});db[_0x7124('0x14')][_0x7124('0x11e')](db[_0x7124('0xf2')],{'through':'cm_user_has_lists'});db[_0x7124('0x14')]['belongsToMany'](db[_0x7124('0x132')],{'as':_0x7124('0x133'),'through':'user_has_voice_prefixes','required':![]});db[_0x7124('0x14')]['belongsToMany'](db[_0x7124('0x5e')],{'as':_0x7124('0x134'),'through':_0x7124('0x135')});db[_0x7124('0x14')][_0x7124('0x11e')](db[_0x7124('0x48')],{'as':_0x7124('0x136'),'through':_0x7124('0x137')});db[_0x7124('0x14')]['belongsToMany'](db[_0x7124('0x138')],{'as':_0x7124('0x139'),'through':_0x7124('0x13a')});db[_0x7124('0x14')][_0x7124('0x11e')](db['OpenchannelAccount'],{'as':_0x7124('0x13b'),'through':_0x7124('0x13c')});db[_0x7124('0x14')][_0x7124('0x11e')](db[_0x7124('0x13d')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db['User'][_0x7124('0x11e')](db[_0x7124('0xfc')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x7124('0x14')]['belongsToMany'](db[_0x7124('0xdc')],{'as':'SquareProjects','through':_0x7124('0x13e')});db[_0x7124('0x17')][_0x7124('0x109')](db['VoiceExtension'],{'as':_0x7124('0x13f'),'onDelete':_0x7124('0x107'),'foreignKey':'ChanSpyId'});db[_0x7124('0x19')][_0x7124('0x109')](db[_0x7124('0x1b')],{'onDelete':_0x7124('0x107')});db[_0x7124('0x1b')]['hasMany'](db[_0x7124('0x1b')],{'as':_0x7124('0x140'),'onDelete':_0x7124('0x107')});db[_0x7124('0x1d')]['belongsToMany'](db[_0x7124('0x141')],{'as':_0x7124('0x142'),'through':'moh_has_sounds'});db[_0x7124('0x1f')][_0x7124('0x109')](db[_0x7124('0x10b')],{'as':'Members','foreignKey':_0x7124('0x143')});db[_0x7124('0x1f')]['hasMany'](db[_0x7124('0x70')],{'as':_0x7124('0x144'),'foreignKey':_0x7124('0x143')});db[_0x7124('0x1f')][_0x7124('0x109')](db[_0x7124('0x10e')],{'as':'HopperFinals','foreignKey':_0x7124('0x143')});db['VoiceQueue'][_0x7124('0x109')](db[_0x7124('0x110')],{'as':_0x7124('0x145'),'foreignKey':_0x7124('0x143')});db['VoiceQueue'][_0x7124('0x109')](db['ReportAgentPreview'],{'as':_0x7124('0x75'),'foreignKey':_0x7124('0x143')});db['VoiceQueue'][_0x7124('0x109')](db[_0x7124('0x72')],{'as':_0x7124('0x146'),'foreignKey':_0x7124('0x143')});db[_0x7124('0x1f')][_0x7124('0x109')](db[_0x7124('0x147')],{'as':_0x7124('0x148'),'foreignKey':_0x7124('0x143')});db['VoiceQueue'][_0x7124('0x11c')](db['Trunk'],{'as':'Trunk','foreignKey':_0x7124('0x149')});db[_0x7124('0x1f')]['belongsTo'](db['Trunk'],{'as':_0x7124('0x14a'),'foreignKey':_0x7124('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x7124('0x82')],{'as':'Interval','foreignKey':_0x7124('0x14c')});db['VoiceQueue'][_0x7124('0x11c')](db[_0x7124('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x7124('0x14d')});db['VoiceQueue']['belongsToMany'](db[_0x7124('0xf2')],{'as':_0x7124('0x123'),'through':_0x7124('0x14e')});db[_0x7124('0x1f')][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x14f'),'through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0x7124('0xe1')],{'as':_0x7124('0x150'),'through':_0x7124('0x151')});db[_0x7124('0x1f')]['belongsToMany'](db[_0x7124('0xf2')],{'as':_0x7124('0x152'),'through':_0x7124('0x153')});db['VoiceRecording'][_0x7124('0x11c')](db[_0x7124('0x14')],{'as':_0x7124('0x14'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x154')][_0x7124('0x11c')](db[_0x7124('0x14')],{'as':_0x7124('0x14'),'foreignKey':'UserId'});db['VoiceMail'][_0x7124('0x109')](db['VoiceMailMessage'],{'as':_0x7124('0x155'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x156'),'sourceKey':_0x7124('0x157')});db['VoiceMailMessage'][_0x7124('0x11c')](db['VoiceMail'],{'foreignKey':_0x7124('0x156'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db['VoiceQueueReport'],{'as':_0x7124('0x158'),'foreignKey':_0x7124('0x159'),'constraints':![]});db[_0x7124('0x26')]['hasMany'](db['VoiceAgentReport'],{'as':_0x7124('0x15a'),'foreignKey':'uniqueid','constraints':![]});db[_0x7124('0x26')][_0x7124('0x11c')](db[_0x7124('0x14')],{'as':_0x7124('0x14'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x26')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c')});db[_0x7124('0x15d')][_0x7124('0x11c')](db[_0x7124('0x138')],{'as':_0x7124('0x138'),'foreignKey':_0x7124('0x15e')});db['MailServerOut']['belongsTo'](db[_0x7124('0x138')],{'as':_0x7124('0x138'),'foreignKey':_0x7124('0x15e')});db[_0x7124('0x138')][_0x7124('0x105')](db[_0x7124('0x15d')],{'as':_0x7124('0x15f'),'onDelete':_0x7124('0x107')});db['MailAccount'][_0x7124('0x105')](db[_0x7124('0x38')],{'as':_0x7124('0x160'),'onDelete':_0x7124('0x107')});db['MailAccount'][_0x7124('0x109')](db[_0x7124('0x7e')],{'as':_0x7124('0x161'),'foreignKey':_0x7124('0x15e')});db[_0x7124('0x138')]['hasMany'](db[_0x7124('0x162')],{'as':'Answers','foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0x7124('0x41')],{'as':'Messages','foreignKey':_0x7124('0x15e')});db[_0x7124('0x138')]['hasMany'](db['MailInteraction'],{'as':'Interactions'});db['MailAccount'][_0x7124('0x109')](db[_0x7124('0x43')],{'as':_0x7124('0x140')});db[_0x7124('0x138')][_0x7124('0x11c')](db['CmList'],{'as':_0x7124('0x163'),'foreignKey':_0x7124('0x164')});db[_0x7124('0x138')]['belongsTo'](db[_0x7124('0x8e')],{'as':'Template','foreignKey':_0x7124('0x165')});db[_0x7124('0x138')][_0x7124('0x11c')](db['Pause'],{'as':_0x7124('0x166'),'foreignKey':_0x7124('0x14d')});db[_0x7124('0x138')][_0x7124('0x11e')](db['User'],{'as':'Agents','through':_0x7124('0x13a')});db[_0x7124('0x3b')][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x14f'),'through':'UserMailQueue'});db['MailQueue'][_0x7124('0x11e')](db[_0x7124('0xe1')],{'through':'team_has_mail_queues','as':_0x7124('0x150')});db[_0x7124('0x3f')]['hasMany'](db[_0x7124('0x41')],{'as':_0x7124('0x155'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x167')});db['MailInteraction'][_0x7124('0x11c')](db[_0x7124('0x138')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x15e')});db[_0x7124('0x3f')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':'Contact','foreignKey':_0x7124('0x15c')});db[_0x7124('0x3f')]['belongsTo'](db[_0x7124('0x14')],{'as':'Owner','foreignKey':_0x7124('0x108')});db[_0x7124('0x3f')][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':'mail_interaction_has_tags','as':_0x7124('0x169')});db[_0x7124('0x3f')][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':_0x7124('0x16a'),'as':_0x7124('0x16b')});db[_0x7124('0x3f')][_0x7124('0x11e')](db['User'],{'as':_0x7124('0x16c'),'through':_0x7124('0x126'),'foreignKey':_0x7124('0x167')});db['MailMessage']['hasMany'](db['Attachment'],{'as':'Attachments','onDelete':'cascade'});db[_0x7124('0x41')]['belongsTo'](db[_0x7124('0x14')],{'as':'User'});db[_0x7124('0x41')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'onDelete':'cascade','as':_0x7124('0x15b')});db[_0x7124('0x41')]['belongsTo'](db['MailInteraction'],{'as':_0x7124('0x16d'),'foreignKey':_0x7124('0x167')});db[_0x7124('0x41')][_0x7124('0x11c')](db[_0x7124('0x138')],{'as':'Account','foreignKey':_0x7124('0x15e')});db[_0x7124('0x43')][_0x7124('0x11c')](db[_0x7124('0x14')],{'onDelete':_0x7124('0x16e')});db[_0x7124('0x43')]['belongsTo'](db['MailQueue'],{'onDelete':_0x7124('0x16e')});db[_0x7124('0x43')][_0x7124('0x11c')](db[_0x7124('0x138')],{'onDelete':_0x7124('0x16e')});db[_0x7124('0x43')][_0x7124('0x11c')](db[_0x7124('0x82')],{'onDelete':_0x7124('0x16e'),'foreignKey':_0x7124('0x14c')});db[_0x7124('0x43')][_0x7124('0x11c')](db[_0x7124('0x8c')],{'onDelete':_0x7124('0x16e'),'foreignKey':_0x7124('0x16f')});db[_0x7124('0x170')]['belongsTo'](db[_0x7124('0x138')],{});db['MailQueueReport'][_0x7124('0x11c')](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':_0x7124('0x164')});db[_0x7124('0x170')][_0x7124('0x11c')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x7124('0x170')][_0x7124('0x11c')](db[_0x7124('0x3f')],{});db[_0x7124('0x170')][_0x7124('0x11c')](db[_0x7124('0x41')],{});db[_0x7124('0x170')][_0x7124('0x11c')](db[_0x7124('0x14')],{});db[_0x7124('0x170')][_0x7124('0x11c')](db['MailQueue'],{});db[_0x7124('0x171')][_0x7124('0x109')](db[_0x7124('0x46')],{'as':_0x7124('0x172'),'onDelete':_0x7124('0x107')});db[_0x7124('0x48')][_0x7124('0x109')](db['Disposition'],{'as':_0x7124('0x161'),'foreignKey':_0x7124('0x173')});db[_0x7124('0x48')][_0x7124('0x109')](db[_0x7124('0x162')],{'as':_0x7124('0x174'),'foreignKey':_0x7124('0x173')});db[_0x7124('0x48')][_0x7124('0x109')](db['FaxInteraction'],{'as':_0x7124('0x175')});db['FaxAccount'][_0x7124('0x109')](db[_0x7124('0x4a')],{'as':_0x7124('0x140')});db[_0x7124('0x48')][_0x7124('0x109')](db[_0x7124('0x1b')],{'as':_0x7124('0x176'),'onDelete':'cascade'});db['FaxAccount'][_0x7124('0x109')](db[_0x7124('0x4c')],{'as':_0x7124('0x155')});db['FaxAccount'][_0x7124('0x11c')](db[_0x7124('0x29')],{'as':_0x7124('0x29')});db['FaxAccount'][_0x7124('0x11c')](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':'ListId'});db[_0x7124('0x48')][_0x7124('0x11c')](db['Pause'],{'as':_0x7124('0x166'),'foreignKey':_0x7124('0x14d')});db[_0x7124('0x48')][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x14f'),'through':_0x7124('0x137')});db[_0x7124('0x4a')][_0x7124('0x11c')](db['User'],{'onDelete':'restrict'});db['FaxApplication'][_0x7124('0x11c')](db[_0x7124('0x4e')],{'onDelete':_0x7124('0x16e')});db[_0x7124('0x4a')][_0x7124('0x11c')](db[_0x7124('0x48')],{'onDelete':_0x7124('0x16e')});db[_0x7124('0x4a')][_0x7124('0x11c')](db[_0x7124('0x8c')],{'onDelete':_0x7124('0x16e'),'foreignKey':'TagId'});db['FaxInteraction'][_0x7124('0x109')](db[_0x7124('0x4c')],{'as':_0x7124('0x155'),'onDelete':_0x7124('0x107'),'foreignKey':'FaxInteractionId'});db[_0x7124('0x116')][_0x7124('0x11c')](db[_0x7124('0x48')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxInteraction']['belongsTo'](db[_0x7124('0x6e')],{'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c')});db['FaxInteraction'][_0x7124('0x11c')](db['User'],{'as':_0x7124('0x177'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x116')]['belongsToMany'](db['Tag'],{'through':_0x7124('0x178'),'as':'Tags'});db[_0x7124('0x116')][_0x7124('0x11e')](db['Tag'],{'through':_0x7124('0x178'),'as':'ThroughTags'});db['FaxInteraction'][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x16c'),'through':_0x7124('0x127'),'foreignKey':_0x7124('0x179')});db[_0x7124('0x4c')][_0x7124('0x11c')](db['User'],{'onDelete':_0x7124('0x107'),'as':'User'});db[_0x7124('0x4c')][_0x7124('0x11c')](db[_0x7124('0x116')],{'as':_0x7124('0x16d'),'foreignKey':'FaxInteractionId'});db[_0x7124('0x4c')]['belongsTo'](db['CmContact'],{'onDelete':_0x7124('0x107'),'as':_0x7124('0x15b')});db[_0x7124('0x4c')][_0x7124('0x11c')](db[_0x7124('0xe9')],{'as':'Attachment','foreignKey':_0x7124('0x17a')});db[_0x7124('0x4c')][_0x7124('0x11c')](db[_0x7124('0x48')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x173')});db[_0x7124('0x4e')][_0x7124('0x11e')](db['User'],{'as':_0x7124('0x14f'),'through':_0x7124('0x31')});db[_0x7124('0x4e')]['belongsToMany'](db[_0x7124('0xe1')],{'through':'team_has_fax_queues','as':'Teams'});db['FaxQueueReport'][_0x7124('0x11c')](db[_0x7124('0x48')],{});db[_0x7124('0x50')][_0x7124('0x11c')](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':'ListId'});db[_0x7124('0x50')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':'Contact','foreignKey':_0x7124('0x15c')});db[_0x7124('0x50')][_0x7124('0x11c')](db[_0x7124('0x116')],{});db[_0x7124('0x50')]['belongsTo'](db[_0x7124('0x4c')],{});db[_0x7124('0x50')][_0x7124('0x11c')](db['User'],{});db[_0x7124('0x50')][_0x7124('0x11c')](db['FaxQueue'],{});db[_0x7124('0x13d')]['hasMany'](db[_0x7124('0x7e')],{'as':_0x7124('0x161'),'foreignKey':'SmsAccountId'});db[_0x7124('0x13d')]['hasMany'](db[_0x7124('0x162')],{'as':'Answers','foreignKey':_0x7124('0x17b')});db[_0x7124('0x13d')][_0x7124('0x109')](db[_0x7124('0x56')],{'as':'Messages','foreignKey':_0x7124('0x17b')});db[_0x7124('0x13d')][_0x7124('0x109')](db['SmsInteraction'],{'as':_0x7124('0x175')});db['SmsAccount'][_0x7124('0x109')](db[_0x7124('0x53')],{'as':'Applications'});db[_0x7124('0x13d')][_0x7124('0x11c')](db[_0x7124('0xf2')],{'as':'List','foreignKey':_0x7124('0x164')});db[_0x7124('0x13d')][_0x7124('0x11c')](db['Pause'],{'as':_0x7124('0x166'),'foreignKey':_0x7124('0x14d')});db[_0x7124('0x13d')][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':'Agents','through':_0x7124('0x17c')});db[_0x7124('0x53')][_0x7124('0x11c')](db['User'],{'onDelete':'restrict'});db[_0x7124('0x53')][_0x7124('0x11c')](db[_0x7124('0x58')],{'onDelete':_0x7124('0x16e')});db[_0x7124('0x53')][_0x7124('0x11c')](db[_0x7124('0x13d')],{'onDelete':_0x7124('0x16e')});db[_0x7124('0x53')]['belongsTo'](db[_0x7124('0x82')],{'onDelete':'restrict','foreignKey':_0x7124('0x14c')});db[_0x7124('0x53')][_0x7124('0x11c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7124('0x16f')});db[_0x7124('0x114')][_0x7124('0x109')](db[_0x7124('0x56')],{'as':_0x7124('0x155'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x17d')});db[_0x7124('0x114')][_0x7124('0x11c')](db['SmsAccount'],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x17b')});db[_0x7124('0x114')][_0x7124('0x11c')](db['CmContact'],{'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c')});db[_0x7124('0x114')][_0x7124('0x11c')](db[_0x7124('0x14')],{'as':_0x7124('0x177'),'foreignKey':_0x7124('0x108')});db['SmsInteraction'][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':_0x7124('0x17e'),'as':_0x7124('0x169')});db[_0x7124('0x114')][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':_0x7124('0x17e'),'as':_0x7124('0x16b')});db[_0x7124('0x114')]['belongsToMany'](db['User'],{'as':_0x7124('0x16c'),'through':'user_has_sms_interactions','foreignKey':_0x7124('0x17d')});db[_0x7124('0x56')][_0x7124('0x11c')](db[_0x7124('0x14')],{'as':_0x7124('0x14')});db['SmsMessage']['belongsTo'](db[_0x7124('0x6e')],{'onDelete':'cascade','as':_0x7124('0x15b')});db[_0x7124('0x56')][_0x7124('0x11c')](db['SmsInteraction'],{'onDelete':_0x7124('0x107'),'as':_0x7124('0x16d'),'foreignKey':_0x7124('0x17d')});db['SmsMessage'][_0x7124('0x11c')](db['SmsAccount'],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x17b')});db[_0x7124('0x58')][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x7124('0x17f')});db[_0x7124('0x58')]['belongsToMany'](db[_0x7124('0xe1')],{'through':_0x7124('0x180'),'as':_0x7124('0x150')});db[_0x7124('0x59')][_0x7124('0x109')](db['Disposition'],{'as':'Dispositions','foreignKey':'OpenchannelAccountId'});db[_0x7124('0x59')][_0x7124('0x109')](db[_0x7124('0x162')],{'as':'Answers','foreignKey':_0x7124('0x181')});db['OpenchannelAccount'][_0x7124('0x109')](db['OpenchannelInteraction'],{'as':_0x7124('0x175'),'foreignKey':'OpenchannelAccountId'});db[_0x7124('0x59')][_0x7124('0x109')](db['OpenchannelMessage'],{'as':_0x7124('0x155'),'foreignKey':'OpenchannelAccountId'});db[_0x7124('0x59')][_0x7124('0x109')](db[_0x7124('0x182')],{'as':_0x7124('0x140'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x7124('0x11c')](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':_0x7124('0x164')});db['OpenchannelAccount']['belongsTo'](db[_0x7124('0x84')],{'as':_0x7124('0x166'),'foreignKey':_0x7124('0x14d')});db['OpenchannelAccount'][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x14f'),'through':_0x7124('0x13c')});db[_0x7124('0x182')][_0x7124('0x11c')](db[_0x7124('0x14')],{'onDelete':_0x7124('0x16e')});db[_0x7124('0x182')]['belongsTo'](db[_0x7124('0x5d')],{'onDelete':_0x7124('0x16e'),'foreignKey':_0x7124('0x183')});db[_0x7124('0x182')][_0x7124('0x11c')](db[_0x7124('0x59')],{'onDelete':_0x7124('0x16e'),'foreignKey':'OpenchannelAccountId'});db[_0x7124('0x182')][_0x7124('0x11c')](db[_0x7124('0x82')],{'onDelete':_0x7124('0x16e'),'foreignKey':_0x7124('0x14c')});db[_0x7124('0x182')][_0x7124('0x11c')](db[_0x7124('0x8c')],{'onDelete':_0x7124('0x16e'),'foreignKey':'TagId'});db[_0x7124('0x5b')]['hasMany'](db['OpenchannelMessage'],{'as':_0x7124('0x155'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x184')});db[_0x7124('0x5b')]['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x7124('0x181')});db[_0x7124('0x5b')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c')});db['OpenchannelInteraction'][_0x7124('0x11c')](db[_0x7124('0x14')],{'as':_0x7124('0x177'),'foreignKey':_0x7124('0x108')});db[_0x7124('0x5b')][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':_0x7124('0x185'),'as':_0x7124('0x169')});db[_0x7124('0x5b')][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':_0x7124('0x185'),'as':_0x7124('0x16b')});db['OpenchannelInteraction']['belongsToMany'](db[_0x7124('0x14')],{'as':'Users','through':_0x7124('0x129'),'foreignKey':_0x7124('0x184')});db[_0x7124('0x186')][_0x7124('0x11c')](db[_0x7124('0x14')],{'onDelete':_0x7124('0x107'),'as':_0x7124('0x14')});db['OpenchannelMessage'][_0x7124('0x11c')](db[_0x7124('0x6e')],{'onDelete':_0x7124('0x107'),'as':'Contact'});db[_0x7124('0x186')][_0x7124('0x11c')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x7124('0x16d'),'foreignKey':_0x7124('0x184')});db[_0x7124('0x186')][_0x7124('0x11c')](db[_0x7124('0xe9')],{'as':'Attachment','foreignKey':_0x7124('0x17a')});db[_0x7124('0x186')]['belongsTo'](db[_0x7124('0x59')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x181')});db[_0x7124('0x5d')][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x14f'),'through':_0x7124('0x34'),'foreignKey':'OpenchannelQueueId'});db[_0x7124('0x5d')][_0x7124('0x11e')](db[_0x7124('0xe1')],{'through':_0x7124('0x187'),'as':_0x7124('0x150')});db['ChatWebsite']['hasMany'](db[_0x7124('0x7e')],{'as':'Dispositions','foreignKey':_0x7124('0x188')});db[_0x7124('0x5e')][_0x7124('0x109')](db[_0x7124('0x162')],{'as':'Answers','foreignKey':_0x7124('0x188')});db['ChatWebsite'][_0x7124('0x109')](db['ChatProactiveAction'],{'as':_0x7124('0x189')});db[_0x7124('0x5e')][_0x7124('0x109')](db[_0x7124('0x63')],{'as':_0x7124('0x175')});db[_0x7124('0x5e')][_0x7124('0x109')](db['ChatApplication'],{'as':'Applications'});db[_0x7124('0x5e')][_0x7124('0x109')](db[_0x7124('0x18a')],{'as':_0x7124('0x155')});db[_0x7124('0x5e')]['belongsTo'](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':_0x7124('0x164')});db[_0x7124('0x5e')]['belongsTo'](db[_0x7124('0x82')],{'as':_0x7124('0x82'),'foreignKey':_0x7124('0x14c')});db['ChatWebsite'][_0x7124('0x11c')](db['Pause'],{'as':_0x7124('0x166'),'foreignKey':_0x7124('0x14d')});db[_0x7124('0x5e')][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x14f'),'through':_0x7124('0x135')});db[_0x7124('0x60')]['belongsTo'](db[_0x7124('0x59')],{});db[_0x7124('0x60')][_0x7124('0x11c')](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':'ListId'});db[_0x7124('0x60')]['belongsTo'](db[_0x7124('0x6e')],{'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c')});db[_0x7124('0x60')][_0x7124('0x11c')](db[_0x7124('0x5b')],{});db[_0x7124('0x60')][_0x7124('0x11c')](db[_0x7124('0x186')],{});db[_0x7124('0x60')][_0x7124('0x11c')](db[_0x7124('0x14')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelQueue'],{});db[_0x7124('0x18b')][_0x7124('0x11c')](db[_0x7124('0x14')],{'as':_0x7124('0x18c'),'foreignKey':'UserId','onDelete':_0x7124('0x16e')});db[_0x7124('0x18b')][_0x7124('0x11c')](db[_0x7124('0x67')],{'as':_0x7124('0x18d'),'foreignKey':_0x7124('0x18e'),'onDelete':'restrict'});db[_0x7124('0x18b')][_0x7124('0x11c')](db[_0x7124('0x5e')],{'as':'Website','foreignKey':_0x7124('0x188'),'onDelete':_0x7124('0x16e')});db[_0x7124('0x18b')][_0x7124('0x11c')](db['Tag'],{'onDelete':_0x7124('0x16e'),'foreignKey':_0x7124('0x16f')});db['ChatInteraction'][_0x7124('0x109')](db[_0x7124('0x18a')],{'as':_0x7124('0x155'),'onDelete':'cascade','foreignKey':_0x7124('0x18f')});db[_0x7124('0x63')]['belongsTo'](db[_0x7124('0x5e')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x188')});db[_0x7124('0x63')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c')});db['ChatInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0x7124('0x63')][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':_0x7124('0x190'),'as':_0x7124('0x169')});db['ChatInteraction']['belongsToMany'](db[_0x7124('0x8c')],{'through':'chat_interaction_has_tags','as':_0x7124('0x16b')});db[_0x7124('0x63')]['belongsToMany'](db[_0x7124('0x14')],{'as':_0x7124('0x16c'),'through':'user_has_chat_interactions','foreignKey':_0x7124('0x18f')});db['ChatMessage']['belongsTo'](db[_0x7124('0x14')],{'onDelete':_0x7124('0x107'),'as':'User'});db['ChatMessage'][_0x7124('0x11c')](db[_0x7124('0x6e')],{'onDelete':_0x7124('0x107'),'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c')});db[_0x7124('0x18a')][_0x7124('0x11c')](db[_0x7124('0x63')],{'onDelete':'cascade','as':_0x7124('0x16d'),'foreignKey':'ChatInteractionId'});db[_0x7124('0x18a')][_0x7124('0x11c')](db[_0x7124('0xe9')],{'as':_0x7124('0xe9'),'foreignKey':'AttachmentId'});db[_0x7124('0x18a')]['belongsTo'](db[_0x7124('0x5e')],{'as':_0x7124('0x168'),'foreignKey':'ChatWebsiteId'});db[_0x7124('0x65')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'onDelete':_0x7124('0x107'),'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c')});db[_0x7124('0x65')][_0x7124('0x11c')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x7124('0x188')});db[_0x7124('0x67')]['belongsToMany'](db[_0x7124('0x14')],{'as':_0x7124('0x14f'),'through':_0x7124('0x2e'),'hooks':!![]});db[_0x7124('0x67')][_0x7124('0x11e')](db[_0x7124('0xe1')],{'through':_0x7124('0x191'),'as':_0x7124('0x150')});db[_0x7124('0x69')][_0x7124('0x109')](db['ChatInternalMessage'],{'as':_0x7124('0x155'),'foreignKey':_0x7124('0x192'),'onDelete':'cascade'});db[_0x7124('0x69')]['belongsToMany'](db[_0x7124('0x14')],{'as':_0x7124('0x193'),'through':_0x7124('0x120')});db['ChatProactiveAction'][_0x7124('0x11c')](db[_0x7124('0x5e')],{'as':_0x7124('0x194'),'foreignKey':_0x7124('0x188')});db[_0x7124('0x6d')]['hasMany'](db[_0x7124('0x6e')],{'as':_0x7124('0x121'),'foreignKey':_0x7124('0x195')});db[_0x7124('0x6e')]['hasMany'](db[_0x7124('0x70')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x7124('0x6e')][_0x7124('0x109')](db['CmHopperFinal'],{'as':_0x7124('0x10f'),'foreignKey':'ContactId'});db['CmContact'][_0x7124('0x109')](db[_0x7124('0x110')],{'as':_0x7124('0x145'),'foreignKey':_0x7124('0x15c')});db[_0x7124('0x6e')][_0x7124('0x109')](db[_0x7124('0x75')],{'as':_0x7124('0x75'),'foreignKey':_0x7124('0x15c')});db[_0x7124('0x6e')][_0x7124('0x109')](db[_0x7124('0x147')],{'as':_0x7124('0x148'),'foreignKey':'ContactId'});db[_0x7124('0x6e')][_0x7124('0x109')](db[_0x7124('0x5b')],{'as':_0x7124('0x112'),'foreignKey':_0x7124('0x15c'),'onDelete':_0x7124('0x16e')});db[_0x7124('0x6e')][_0x7124('0x109')](db[_0x7124('0x63')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0x7124('0x16e')});db[_0x7124('0x6e')][_0x7124('0x109')](db[_0x7124('0x114')],{'as':'SmsInteractions','foreignKey':_0x7124('0x15c'),'onDelete':_0x7124('0x16e')});db['CmContact'][_0x7124('0x109')](db['FaxInteraction'],{'as':_0x7124('0x117'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x7124('0x6e')][_0x7124('0x109')](db[_0x7124('0x3f')],{'as':_0x7124('0x118'),'foreignKey':_0x7124('0x15c'),'onDelete':_0x7124('0x16e')});db[_0x7124('0x6e')][_0x7124('0x11c')](db[_0x7124('0x6d')],{'as':_0x7124('0x196'),'foreignKey':_0x7124('0x195')});db[_0x7124('0x6e')][_0x7124('0x11c')](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':'ListId','onDelete':_0x7124('0x107')});db['CmContact'][_0x7124('0x11e')](db['User'],{'as':_0x7124('0x16c'),'through':_0x7124('0x122')});db[_0x7124('0x6e')][_0x7124('0x11e')](db[_0x7124('0x8c')],{'as':_0x7124('0x169'),'through':_0x7124('0x197')});db['CmContact']['belongsToMany'](db[_0x7124('0x8c')],{'through':_0x7124('0x197'),'as':_0x7124('0x16b')});db['CmHopper'][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':_0x7124('0x164'),'onDelete':_0x7124('0x107')});db[_0x7124('0x70')][_0x7124('0x11c')](db['User'],{'as':_0x7124('0x18c'),'foreignKey':_0x7124('0x108')});db['CmHopper'][_0x7124('0x11c')](db['VoiceQueue'],{'as':_0x7124('0x18d'),'foreignKey':'VoiceQueueId','onDelete':_0x7124('0x107')});db[_0x7124('0x70')]['belongsTo'](db['Campaign'],{'as':_0x7124('0xe5'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x7124('0x70')][_0x7124('0x11c')](db['User'],{'as':'Owner','foreignKey':_0x7124('0x198')});db[_0x7124('0x72')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':_0x7124('0x15b'),'foreignKey':_0x7124('0x15c'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x7124('0xf2')],{'as':'List','foreignKey':_0x7124('0x164'),'onDelete':'cascade'});db[_0x7124('0x72')][_0x7124('0x11c')](db[_0x7124('0x1f')],{'as':_0x7124('0x18d'),'foreignKey':_0x7124('0x143'),'onDelete':'cascade'});db[_0x7124('0x72')]['belongsTo'](db['Campaign'],{'as':_0x7124('0xe5'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x7124('0x7b')]['hasMany'](db[_0x7124('0x80')],{'as':{'plural':_0x7124('0x199'),'singular':_0x7124('0x19a')},'foreignKey':_0x7124('0x19b'),'onDelete':'cascade','hooks':!![]});db[_0x7124('0x7b')][_0x7124('0x109')](db[_0x7124('0x80')],{'as':{'plural':_0x7124('0x19c'),'singular':_0x7124('0x19d')},'foreignKey':_0x7124('0x19e'),'onDelete':_0x7124('0x107'),'hooks':!![]});db[_0x7124('0x7b')][_0x7124('0x109')](db[_0x7124('0x79')],{'as':_0x7124('0x19f'),'foreignKey':_0x7124('0x1a0'),'onDelete':_0x7124('0x107'),'hooks':!![]});db['Interval'][_0x7124('0x109')](db[_0x7124('0x82')],{'as':_0x7124('0x1a1'),'foreignKey':'IntervalId','onDelete':_0x7124('0x107'),'hooks':!![],'required':![]});db[_0x7124('0x82')][_0x7124('0x109')](db['VoiceExtension'],{'as':_0x7124('0x10d'),'foreignKey':_0x7124('0x14c'),'onDelete':_0x7124('0x16e')});db[_0x7124('0x82')][_0x7124('0x109')](db[_0x7124('0x43')],{'as':_0x7124('0x1a2'),'foreignKey':_0x7124('0x14c')});db[_0x7124('0x82')][_0x7124('0x109')](db['ChatApplication'],{'as':_0x7124('0x1a3'),'foreignKey':_0x7124('0x14c')});db[_0x7124('0x82')][_0x7124('0x109')](db['FaxApplication'],{'as':_0x7124('0x1a4'),'foreignKey':_0x7124('0x14c')});db[_0x7124('0x82')]['hasMany'](db['SmsApplication'],{'as':_0x7124('0x1a5'),'foreignKey':_0x7124('0x14c')});db[_0x7124('0x8a')][_0x7124('0x11c')](db[_0x7124('0x138')],{});db['Schedule'][_0x7124('0x11c')](db['AnalyticDefaultReport'],{'foreignKey':_0x7124('0x1a6')});db[_0x7124('0x8a')][_0x7124('0x11c')](db[_0x7124('0x95')],{'foreignKey':'CustomReportId'});db[_0x7124('0x141')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x7124('0x1a7'),'through':_0x7124('0x1a8'),'onDelete':_0x7124('0x16e')});db[_0x7124('0x8c')][_0x7124('0x11e')](db[_0x7124('0x6e')],{'through':'cm_contact_has_tags'});db['Tag'][_0x7124('0x11e')](db[_0x7124('0x63')],{'through':_0x7124('0x190')});db[_0x7124('0x8c')][_0x7124('0x11e')](db[_0x7124('0x3f')],{'through':_0x7124('0x16a')});db[_0x7124('0x8c')][_0x7124('0x11e')](db[_0x7124('0x114')],{'through':_0x7124('0x17e')});db[_0x7124('0x8c')][_0x7124('0x11e')](db[_0x7124('0x116')],{'through':_0x7124('0x178')});db['Tag']['belongsToMany'](db[_0x7124('0x5b')],{'through':'openchannel_interaction_has_tags'});db[_0x7124('0x8c')]['belongsToMany'](db[_0x7124('0xfe')],{'through':'whatsapp_interaction_has_tags'});db[_0x7124('0x90')]['hasMany'](db[_0x7124('0x80')],{'as':{'plural':_0x7124('0x1a9'),'singular':_0x7124('0x1aa')},'foreignKey':_0x7124('0x1ab'),'onDelete':_0x7124('0x107'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x7124('0x80')],{'as':{'plural':_0x7124('0x1ac'),'singular':_0x7124('0x1ad')},'foreignKey':_0x7124('0x1ae'),'onDelete':_0x7124('0x107'),'hooks':!![]});db[_0x7124('0x90')]['hasMany'](db['Action'],{'as':_0x7124('0x19f'),'foreignKey':_0x7124('0x1af'),'onDelete':_0x7124('0x107'),'hooks':!![]});db[_0x7124('0x95')][_0x7124('0x109')](db[_0x7124('0x9a')],{'as':'Fields','onDelete':_0x7124('0x107'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x7124('0x109')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7124('0x1a6')});db[_0x7124('0x1b0')][_0x7124('0x109')](db[_0x7124('0x9a')],{'as':_0x7124('0x1b1'),'onDelete':_0x7124('0x107'),'foreignKey':'MetricId'});db[_0x7124('0x9a')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x7124('0x1b2')});db[_0x7124('0x9d')][_0x7124('0x109')](db[_0x7124('0x9f')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x7124('0x1b3')});db[_0x7124('0x9f')][_0x7124('0x109')](db[_0x7124('0x1b4')],{'as':_0x7124('0x1b5'),'onDelete':'cascade','foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x7124('0x109')](db['SalesforceField'],{'as':_0x7124('0x1b6'),'onDelete':'cascade','foreignKey':_0x7124('0x1b7')});db[_0x7124('0x9f')]['hasMany'](db[_0x7124('0x1b4')],{'as':_0x7124('0x1b1'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b8')});db[_0x7124('0x9f')][_0x7124('0x11c')](db[_0x7124('0x9d')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0x1b4')][_0x7124('0x109')](db[_0x7124('0x1b4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x7124('0x1b4')][_0x7124('0x109')](db[_0x7124('0x1b4')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x7124('0x1b4')][_0x7124('0x109')](db['SalesforceField'],{'as':_0x7124('0x1b9'),'foreignKey':_0x7124('0x1b8')});db[_0x7124('0x1b4')][_0x7124('0x11c')](db['Variable'],{'as':_0x7124('0x1ba'),'foreignKey':_0x7124('0x1bb')});db[_0x7124('0x1bc')][_0x7124('0x109')](db['SugarcrmConfiguration'],{'as':_0x7124('0x1bd'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0xa3')][_0x7124('0x109')](db[_0x7124('0xa5')],{'as':_0x7124('0x1b5'),'onDelete':'cascade','foreignKey':_0x7124('0x1be')});db[_0x7124('0xa3')][_0x7124('0x109')](db[_0x7124('0xa5')],{'as':_0x7124('0x1b6'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x7124('0xa3')][_0x7124('0x109')](db[_0x7124('0xa5')],{'as':_0x7124('0x1b1'),'onDelete':'cascade','foreignKey':_0x7124('0x1b8')});db['SugarcrmConfiguration'][_0x7124('0x11c')](db[_0x7124('0x1bc')],{'as':'Account','foreignKey':_0x7124('0x1b3')});db['SugarcrmField'][_0x7124('0x109')](db[_0x7124('0xa5')],{'as':_0x7124('0x1bf'),'foreignKey':_0x7124('0x1be')});db['SugarcrmField'][_0x7124('0x109')](db['SugarcrmField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x7124('0xa5')]['hasMany'](db[_0x7124('0xa5')],{'as':_0x7124('0x1b9'),'foreignKey':_0x7124('0x1b8')});db[_0x7124('0xa5')][_0x7124('0x11c')](db[_0x7124('0x1ba')],{'as':_0x7124('0x1ba'),'foreignKey':_0x7124('0x1bb')});db[_0x7124('0xa7')][_0x7124('0x109')](db[_0x7124('0x1c0')],{'as':_0x7124('0x1bd'),'onDelete':'cascade','foreignKey':_0x7124('0x1b3')});db[_0x7124('0x1c0')][_0x7124('0x109')](db['DeskField'],{'as':_0x7124('0x1b5'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1be')});db[_0x7124('0x1c0')][_0x7124('0x109')](db[_0x7124('0x1c1')],{'as':_0x7124('0x1b6'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b7')});db[_0x7124('0x1c0')][_0x7124('0x109')](db[_0x7124('0x1c1')],{'as':'Fields','onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b8')});db[_0x7124('0x1c0')]['belongsTo'](db['DeskAccount'],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0x1c0')][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':_0x7124('0x1c2')});db[_0x7124('0x1c1')][_0x7124('0x109')](db[_0x7124('0x1c1')],{'as':_0x7124('0x1bf'),'foreignKey':'SubjectId'});db['DeskField'][_0x7124('0x109')](db['DeskField'],{'as':_0x7124('0x1c3'),'foreignKey':_0x7124('0x1b7')});db['DeskField'][_0x7124('0x109')](db[_0x7124('0x1c1')],{'as':_0x7124('0x1b9'),'foreignKey':_0x7124('0x1b8')});db[_0x7124('0x1c1')][_0x7124('0x11c')](db[_0x7124('0x1ba')],{'as':_0x7124('0x1ba'),'foreignKey':_0x7124('0x1bb')});db[_0x7124('0x1c4')][_0x7124('0x109')](db['ZohoConfiguration'],{'as':_0x7124('0x1bd'),'onDelete':_0x7124('0x107'),'foreignKey':'AccountId'});db['ZohoConfiguration'][_0x7124('0x109')](db[_0x7124('0xab')],{'as':'Subjects','onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1be')});db[_0x7124('0x1c5')][_0x7124('0x109')](db[_0x7124('0xab')],{'as':_0x7124('0x1b6'),'onDelete':_0x7124('0x107'),'foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0x7124('0x109')](db[_0x7124('0xab')],{'as':_0x7124('0x1b1'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b8')});db['ZohoConfiguration']['belongsTo'](db[_0x7124('0x1c4')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0xab')]['hasMany'](db['ZohoField'],{'as':_0x7124('0x1bf'),'foreignKey':'SubjectId'});db[_0x7124('0xab')]['hasMany'](db[_0x7124('0xab')],{'as':'Description','foreignKey':_0x7124('0x1b7')});db[_0x7124('0xab')][_0x7124('0x109')](db[_0x7124('0xab')],{'as':_0x7124('0x1b9'),'foreignKey':_0x7124('0x1b8')});db[_0x7124('0xab')][_0x7124('0x11c')](db[_0x7124('0x1ba')],{'as':'Variable','foreignKey':_0x7124('0x1bb')});db[_0x7124('0x1c6')]['hasMany'](db[_0x7124('0x1c7')],{'as':_0x7124('0x1bd'),'onDelete':_0x7124('0x107'),'foreignKey':'AccountId'});db[_0x7124('0x1c7')][_0x7124('0x109')](db['ZendeskField'],{'as':_0x7124('0x1b5'),'foreignKey':_0x7124('0x1be')});db[_0x7124('0x1c7')][_0x7124('0x109')](db[_0x7124('0xae')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x7124('0x1c7')][_0x7124('0x109')](db['ZendeskField'],{'as':_0x7124('0x1b1'),'foreignKey':'FieldId'});db[_0x7124('0x1c7')][_0x7124('0x11c')](db['ZendeskAccount'],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0x1c7')]['belongsToMany'](db[_0x7124('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x7124('0x109')](db['ZendeskField'],{'as':_0x7124('0x1bf'),'foreignKey':_0x7124('0x1be')});db[_0x7124('0xae')][_0x7124('0x109')](db['ZendeskField'],{'as':_0x7124('0x1c3'),'foreignKey':'DescriptionId'});db[_0x7124('0xae')][_0x7124('0x109')](db[_0x7124('0xae')],{'as':'Field','foreignKey':'FieldId'});db['ZendeskField'][_0x7124('0x11c')](db[_0x7124('0x1ba')],{'as':_0x7124('0x1ba'),'foreignKey':_0x7124('0x1bb')});db['FreshdeskAccount']['hasMany'](db[_0x7124('0xb2')],{'as':_0x7124('0x1bd'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0xb2')]['hasMany'](db[_0x7124('0xb4')],{'as':'Subjects','onDelete':_0x7124('0x107'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x7124('0x109')](db[_0x7124('0xb4')],{'as':_0x7124('0x1b6'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b7')});db[_0x7124('0xb2')][_0x7124('0x109')](db['FreshdeskField'],{'as':_0x7124('0x1b1'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b8')});db['FreshdeskConfiguration'][_0x7124('0x11c')](db[_0x7124('0xb0')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0xb2')]['belongsToMany'](db['Tag'],{'through':_0x7124('0x1c8')});db[_0x7124('0xb4')][_0x7124('0x109')](db[_0x7124('0xb4')],{'as':_0x7124('0x1bf'),'foreignKey':_0x7124('0x1be')});db[_0x7124('0xb4')]['hasMany'](db[_0x7124('0xb4')],{'as':_0x7124('0x1c3'),'foreignKey':'DescriptionId'});db[_0x7124('0xb4')][_0x7124('0x109')](db['FreshdeskField'],{'as':_0x7124('0x1b9'),'foreignKey':'FieldId'});db['FreshdeskField'][_0x7124('0x11c')](db['Variable'],{'as':_0x7124('0x1ba'),'foreignKey':_0x7124('0x1bb')});db['VtigerAccount'][_0x7124('0x109')](db[_0x7124('0xb8')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x7124('0x1b3')});db[_0x7124('0xb8')][_0x7124('0x109')](db[_0x7124('0x1c9')],{'as':_0x7124('0x1b5'),'foreignKey':_0x7124('0x1be')});db['VtigerConfiguration'][_0x7124('0x109')](db[_0x7124('0x1c9')],{'as':_0x7124('0x1b6'),'foreignKey':'DescriptionId'});db['VtigerConfiguration']['hasMany'](db[_0x7124('0x1c9')],{'as':'Fields','foreignKey':_0x7124('0x1b8')});db[_0x7124('0xb8')][_0x7124('0x11c')](db['VtigerAccount'],{'as':_0x7124('0x168'),'foreignKey':'AccountId'});db[_0x7124('0x1c9')]['hasMany'](db[_0x7124('0x1c9')],{'as':_0x7124('0x1bf'),'foreignKey':_0x7124('0x1be')});db[_0x7124('0x1c9')]['hasMany'](db[_0x7124('0x1c9')],{'as':_0x7124('0x1c3'),'foreignKey':_0x7124('0x1b7')});db[_0x7124('0x1c9')][_0x7124('0x109')](db['VtigerField'],{'as':_0x7124('0x1b9'),'foreignKey':_0x7124('0x1b8')});db[_0x7124('0x1c9')][_0x7124('0x11c')](db[_0x7124('0x1ba')],{'as':'Variable','foreignKey':'VariableId'});db[_0x7124('0xba')][_0x7124('0x109')](db[_0x7124('0xbc')],{'as':_0x7124('0x1bd'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0xbc')][_0x7124('0x109')](db[_0x7124('0x1ca')],{'as':_0x7124('0x1b5'),'foreignKey':_0x7124('0x1be')});db['ServicenowConfiguration'][_0x7124('0x109')](db[_0x7124('0x1ca')],{'as':'Descriptions','foreignKey':_0x7124('0x1b7')});db[_0x7124('0xbc')][_0x7124('0x109')](db['ServicenowField'],{'as':_0x7124('0x1b1'),'foreignKey':'FieldId'});db[_0x7124('0xbc')]['belongsTo'](db[_0x7124('0xba')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0x1ca')][_0x7124('0x109')](db['ServicenowField'],{'as':_0x7124('0x1bf'),'foreignKey':_0x7124('0x1be')});db[_0x7124('0x1ca')]['hasMany'](db[_0x7124('0x1ca')],{'as':'Description','foreignKey':_0x7124('0x1b7')});db[_0x7124('0x1ca')][_0x7124('0x109')](db[_0x7124('0x1ca')],{'as':_0x7124('0x1b9'),'foreignKey':_0x7124('0x1b8')});db[_0x7124('0x1ca')]['belongsTo'](db[_0x7124('0x1ba')],{'as':_0x7124('0x1ba'),'foreignKey':_0x7124('0x1bb')});db[_0x7124('0xbe')][_0x7124('0x109')](db[_0x7124('0xbf')],{'as':_0x7124('0x1bd'),'onDelete':_0x7124('0x107'),'foreignKey':'AccountId'});db['Dynamics365Configuration'][_0x7124('0x109')](db[_0x7124('0xc1')],{'as':_0x7124('0x1b5'),'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1be')});db['Dynamics365Configuration'][_0x7124('0x109')](db['Dynamics365Field'],{'as':_0x7124('0x1b6'),'onDelete':'cascade','foreignKey':_0x7124('0x1b7')});db['Dynamics365Configuration']['hasMany'](db[_0x7124('0xc1')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7124('0x1b8')});db['Dynamics365Configuration']['belongsTo'](db[_0x7124('0xbe')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1b3')});db['Dynamics365Field'][_0x7124('0x109')](db[_0x7124('0xc1')],{'as':_0x7124('0x1bf'),'foreignKey':_0x7124('0x1be')});db[_0x7124('0xc1')][_0x7124('0x109')](db[_0x7124('0xc1')],{'as':_0x7124('0x1c3'),'foreignKey':_0x7124('0x1b7')});db[_0x7124('0xc1')]['hasMany'](db[_0x7124('0xc1')],{'as':'Field','foreignKey':_0x7124('0x1b8')});db[_0x7124('0xc1')]['belongsTo'](db[_0x7124('0x1ba')],{'as':_0x7124('0x1ba'),'foreignKey':_0x7124('0x1bb')});db['FreshsalesAccount']['hasMany'](db[_0x7124('0xc4')],{'as':'Configurations','onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0xc4')][_0x7124('0x109')](db[_0x7124('0x1cb')],{'as':'Subjects','foreignKey':_0x7124('0x1be')});db['FreshsalesConfiguration']['hasMany'](db[_0x7124('0x1cb')],{'as':_0x7124('0x1b6'),'foreignKey':_0x7124('0x1b7')});db['FreshsalesConfiguration'][_0x7124('0x109')](db['FreshsalesField'],{'as':_0x7124('0x1b1'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x7124('0x11c')](db[_0x7124('0xc2')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1b3')});db[_0x7124('0x1cb')][_0x7124('0x109')](db[_0x7124('0x1cb')],{'as':_0x7124('0x1bf'),'foreignKey':_0x7124('0x1be')});db[_0x7124('0x1cb')]['hasMany'](db[_0x7124('0x1cb')],{'as':_0x7124('0x1c3'),'foreignKey':'DescriptionId'});db[_0x7124('0x1cb')][_0x7124('0x109')](db['FreshsalesField'],{'as':_0x7124('0x1b9'),'foreignKey':_0x7124('0x1b8')});db['FreshsalesField'][_0x7124('0x11c')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x7124('0xc9')][_0x7124('0x11c')](db['ChatWebsite'],{});db[_0x7124('0xc9')]['belongsTo'](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':_0x7124('0x164')});db[_0x7124('0xc9')][_0x7124('0x11c')](db['CmContact'],{'as':'Contact','foreignKey':_0x7124('0x15c')});db[_0x7124('0xc9')][_0x7124('0x11c')](db[_0x7124('0x63')],{});db[_0x7124('0xc9')]['belongsTo'](db[_0x7124('0x18a')],{});db[_0x7124('0xc9')][_0x7124('0x11c')](db['User'],{});db['ChatQueueReport'][_0x7124('0x11c')](db[_0x7124('0x67')],{});db['ChatInternalMessage'][_0x7124('0x11c')](db[_0x7124('0x14')],{'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1cc')});db['ChatInternalMessage'][_0x7124('0x11c')](db[_0x7124('0x14')],{'onDelete':_0x7124('0x107'),'foreignKey':_0x7124('0x1cd')});db[_0x7124('0x147')][_0x7124('0x109')](db['JscriptyQuestionReport'],{'foreignKey':_0x7124('0x1ce'),'onDelete':_0x7124('0x107')});db[_0x7124('0x147')][_0x7124('0x109')](db[_0x7124('0xcd')],{'foreignKey':_0x7124('0x1ce'),'onDelete':_0x7124('0x107')});db['SmsQueueReport'][_0x7124('0x11c')](db['SmsAccount'],{});db[_0x7124('0xd1')]['belongsTo'](db[_0x7124('0xf2')],{'as':_0x7124('0x163'),'foreignKey':'ListId'});db[_0x7124('0xd1')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':'Contact','foreignKey':_0x7124('0x15c')});db['SmsQueueReport'][_0x7124('0x11c')](db['SmsInteraction'],{});db[_0x7124('0xd1')][_0x7124('0x11c')](db[_0x7124('0x56')],{});db['SmsQueueReport'][_0x7124('0x11c')](db['User'],{});db[_0x7124('0xd1')]['belongsTo'](db['SmsQueue'],{});db[_0x7124('0xd7')][_0x7124('0x109')](db[_0x7124('0x147')],{'foreignKey':_0x7124('0x1cf')});db[_0x7124('0xd7')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x7124('0x1cf')});db[_0x7124('0xd7')][_0x7124('0x109')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db['SquareProject'][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x16c'),'through':_0x7124('0x13e')});db[_0x7124('0xe1')]['belongsToMany'](db[_0x7124('0x14')],{'as':_0x7124('0x14f'),'through':_0x7124('0x125')});db['Team']['belongsToMany'](db['VoiceQueue'],{'through':_0x7124('0x151'),'as':_0x7124('0x12a')});db[_0x7124('0xe1')][_0x7124('0x11e')](db[_0x7124('0x3b')],{'through':_0x7124('0x1d0'),'as':_0x7124('0x1d1')});db[_0x7124('0xe1')]['belongsToMany'](db[_0x7124('0x67')],{'through':_0x7124('0x191'),'as':_0x7124('0x12b')});db['Team'][_0x7124('0x11e')](db[_0x7124('0x4e')],{'through':_0x7124('0x1d2'),'as':'FaxQueues'});db[_0x7124('0xe1')][_0x7124('0x11e')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x7124('0x12d')});db[_0x7124('0xe1')]['belongsToMany'](db[_0x7124('0x5d')],{'through':'team_has_openchannel_queues','as':_0x7124('0x12e')});db[_0x7124('0xe1')][_0x7124('0x11e')](db['WhatsappQueue'],{'through':'team_has_whatsapp_queues','as':_0x7124('0x130')});db[_0x7124('0xe5')]['hasMany'](db[_0x7124('0x70')],{'as':'Hoppers','foreignKey':_0x7124('0x1d3')});db[_0x7124('0xe5')][_0x7124('0x109')](db[_0x7124('0x10e')],{'as':_0x7124('0x10f'),'foreignKey':'CampaignId'});db[_0x7124('0xe5')][_0x7124('0x109')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x7124('0x1d3')});db[_0x7124('0xe5')]['hasMany'](db[_0x7124('0x72')],{'as':_0x7124('0x146'),'foreignKey':_0x7124('0x1d3')});db['Campaign'][_0x7124('0x11c')](db[_0x7124('0x29')],{'as':_0x7124('0x29'),'foreignKey':_0x7124('0x149')});db[_0x7124('0xe5')][_0x7124('0x11c')](db[_0x7124('0x29')],{'as':'TrunkBackup','foreignKey':_0x7124('0x14b')});db['Campaign'][_0x7124('0x11c')](db[_0x7124('0x82')],{'as':_0x7124('0x82'),'foreignKey':'IntervalId'});db[_0x7124('0xe5')]['belongsTo'](db[_0x7124('0xdc')],{'as':_0x7124('0xdc'),'foreignKey':'SquareProjectId'});db[_0x7124('0xe5')][_0x7124('0x11e')](db[_0x7124('0xf2')],{'as':_0x7124('0x123'),'through':_0x7124('0x1d4')});db[_0x7124('0xe5')]['belongsToMany'](db[_0x7124('0xf2')],{'as':_0x7124('0x152'),'through':'campaigns_has_cm_blacklists'});db[_0x7124('0xec')][_0x7124('0x11c')](db['MailMessage'],{});db[_0x7124('0xec')][_0x7124('0x11c')](db[_0x7124('0x3f')],{});db[_0x7124('0xec')][_0x7124('0x11c')](db[_0x7124('0x138')],{'foreignKey':_0x7124('0x1d5'),'as':_0x7124('0x1d6')});db[_0x7124('0xec')][_0x7124('0x11c')](db[_0x7124('0x14')],{'foreignKey':_0x7124('0x1d7'),'as':_0x7124('0x1d8')});db['MailTransferReport'][_0x7124('0x11c')](db[_0x7124('0x14')],{'foreignKey':_0x7124('0x1d9'),'as':_0x7124('0x1da')});db['MailTransferReport']['belongsTo'](db[_0x7124('0x3b')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db['MailTransferReport'][_0x7124('0x11c')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x7124('0x1db')});db[_0x7124('0x1dc')][_0x7124('0x11c')](db['ChatMessage'],{});db[_0x7124('0x1dc')][_0x7124('0x11c')](db['ChatInteraction'],{});db[_0x7124('0x1dc')][_0x7124('0x11c')](db['ChatWebsite'],{'foreignKey':_0x7124('0x1dd'),'as':'FromAccount'});db[_0x7124('0x1dc')][_0x7124('0x11c')](db['User'],{'foreignKey':_0x7124('0x1d7'),'as':_0x7124('0x1d8')});db['ChatTransferReport'][_0x7124('0x11c')](db[_0x7124('0x14')],{'foreignKey':_0x7124('0x1d9'),'as':_0x7124('0x1da')});db[_0x7124('0x1dc')][_0x7124('0x11c')](db[_0x7124('0x67')],{'foreignKey':'ToChatQueueId','as':_0x7124('0x1de')});db[_0x7124('0x1dc')][_0x7124('0x11c')](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0x7124('0x1db')});db['FaxTransferReport']['belongsTo'](db[_0x7124('0x4c')],{});db['FaxTransferReport'][_0x7124('0x11c')](db['FaxInteraction'],{});db[_0x7124('0xef')]['belongsTo'](db[_0x7124('0x48')],{'foreignKey':_0x7124('0x1df'),'as':_0x7124('0x1d6')});db['FaxTransferReport'][_0x7124('0x11c')](db[_0x7124('0x14')],{'foreignKey':_0x7124('0x1d7'),'as':_0x7124('0x1d8')});db[_0x7124('0xef')][_0x7124('0x11c')](db['User'],{'foreignKey':_0x7124('0x1d9'),'as':'ToAgent'});db[_0x7124('0xef')][_0x7124('0x11c')](db[_0x7124('0x4e')],{'foreignKey':_0x7124('0x1e0'),'as':_0x7124('0x1de')});db[_0x7124('0xef')][_0x7124('0x11c')](db['FaxAccount'],{'foreignKey':_0x7124('0x1e1'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x7124('0x11c')](db['OpenchannelMessage'],{});db[_0x7124('0xf0')][_0x7124('0x11c')](db[_0x7124('0x5b')],{});db[_0x7124('0xf0')][_0x7124('0x11c')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x7124('0x1d6')});db[_0x7124('0xf0')][_0x7124('0x11c')](db['User'],{'foreignKey':_0x7124('0x1d7'),'as':_0x7124('0x1d8')});db['OpenchannelTransferReport'][_0x7124('0x11c')](db['User'],{'foreignKey':'ToUserId','as':_0x7124('0x1da')});db['OpenchannelTransferReport'][_0x7124('0x11c')](db[_0x7124('0x5d')],{'foreignKey':_0x7124('0x1e2'),'as':_0x7124('0x1de')});db[_0x7124('0xf0')]['belongsTo'](db[_0x7124('0x59')],{'foreignKey':_0x7124('0x1e3'),'as':_0x7124('0x1db')});db[_0x7124('0xf1')][_0x7124('0x11c')](db[_0x7124('0x56')],{});db[_0x7124('0xf1')][_0x7124('0x11c')](db[_0x7124('0x114')],{});db[_0x7124('0xf1')][_0x7124('0x11c')](db[_0x7124('0x13d')],{'foreignKey':_0x7124('0x1e4'),'as':_0x7124('0x1d6')});db[_0x7124('0xf1')][_0x7124('0x11c')](db[_0x7124('0x14')],{'foreignKey':_0x7124('0x1d7'),'as':_0x7124('0x1d8')});db[_0x7124('0xf1')][_0x7124('0x11c')](db['User'],{'foreignKey':_0x7124('0x1d9'),'as':_0x7124('0x1da')});db['SmsTransferReport'][_0x7124('0x11c')](db['SmsQueue'],{'foreignKey':_0x7124('0x1e5'),'as':'ToQueue'});db[_0x7124('0xf1')][_0x7124('0x11c')](db[_0x7124('0x13d')],{'foreignKey':'ToSmsAccountId','as':_0x7124('0x1db')});db[_0x7124('0xf2')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x7124('0x164')});db[_0x7124('0xf2')][_0x7124('0x109')](db['CmCustomField'],{'as':_0x7124('0x1e6'),'foreignKey':_0x7124('0x164')});db['CmList'][_0x7124('0x109')](db[_0x7124('0x6e')],{'as':_0x7124('0x121'),'onDelete':'cascade','foreignKey':_0x7124('0x164')});db['CmList'][_0x7124('0x109')](db['CmHopperFinal'],{'as':_0x7124('0x10f'),'foreignKey':_0x7124('0x164')});db[_0x7124('0xf2')][_0x7124('0x109')](db[_0x7124('0x110')],{'as':_0x7124('0x111'),'foreignKey':_0x7124('0x164')});db[_0x7124('0xf2')][_0x7124('0x109')](db[_0x7124('0x75')],{'as':_0x7124('0x75'),'foreignKey':'ListId'});db[_0x7124('0xf2')]['belongsToMany'](db[_0x7124('0x1f')],{'as':_0x7124('0x1e7'),'through':_0x7124('0x14e')});db[_0x7124('0xf2')][_0x7124('0x11e')](db['User'],{'as':_0x7124('0x14f'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0x7124('0x109')](db[_0x7124('0x1b')],{'as':_0x7124('0x10d'),'onDelete':_0x7124('0x107')});db[_0x7124('0x132')][_0x7124('0x11e')](db['User'],{'as':_0x7124('0x14f'),'through':_0x7124('0x1e8')});db[_0x7124('0xf4')][_0x7124('0x109')](db[_0x7124('0x14')],{'as':_0x7124('0x16c'),'foreignKey':_0x7124('0x11d')});db[_0x7124('0xf4')]['hasMany'](db[_0x7124('0xf6')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x7124('0x107')});db[_0x7124('0xf6')][_0x7124('0x109')](db[_0x7124('0xf8')],{'as':_0x7124('0x1e9'),'foreignKey':'sectionId','onDelete':_0x7124('0x107')});db[_0x7124('0xfc')]['hasMany'](db[_0x7124('0x7e')],{'as':_0x7124('0x161'),'foreignKey':_0x7124('0x1ea')});db['WhatsappAccount'][_0x7124('0x109')](db[_0x7124('0x162')],{'as':_0x7124('0x174'),'foreignKey':_0x7124('0x1ea')});db[_0x7124('0xfc')]['hasMany'](db[_0x7124('0x100')],{'as':'Messages','foreignKey':_0x7124('0x1ea')});db[_0x7124('0xfc')]['hasMany'](db[_0x7124('0xfe')],{'as':_0x7124('0x175')});db[_0x7124('0xfc')][_0x7124('0x109')](db['WhatsappApplication'],{'as':_0x7124('0x140')});db[_0x7124('0xfc')]['belongsTo'](db[_0x7124('0xf2')],{'as':'List','foreignKey':_0x7124('0x164')});db['WhatsappAccount'][_0x7124('0x11c')](db['Pause'],{'as':_0x7124('0x166'),'foreignKey':_0x7124('0x14d')});db['WhatsappAccount'][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x14f'),'through':_0x7124('0x1eb')});db[_0x7124('0x1ec')][_0x7124('0x11c')](db[_0x7124('0x14')],{'onDelete':_0x7124('0x16e')});db['WhatsappApplication']['belongsTo'](db['WhatsappQueue'],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0x7124('0xfc')],{'onDelete':_0x7124('0x16e')});db['WhatsappApplication'][_0x7124('0x11c')](db['Interval'],{'onDelete':_0x7124('0x16e'),'foreignKey':'IntervalId'});db['WhatsappApplication']['belongsTo'](db['Tag'],{'onDelete':_0x7124('0x16e'),'foreignKey':_0x7124('0x16f')});db[_0x7124('0xfe')][_0x7124('0x109')](db[_0x7124('0x100')],{'as':_0x7124('0x155'),'onDelete':'cascade','foreignKey':_0x7124('0x1ed')});db['WhatsappInteraction'][_0x7124('0x11c')](db[_0x7124('0xfc')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1ea')});db['WhatsappInteraction'][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':'Contact','foreignKey':_0x7124('0x15c')});db[_0x7124('0xfe')][_0x7124('0x11c')](db['User'],{'as':_0x7124('0x177'),'foreignKey':_0x7124('0x108')});db[_0x7124('0xfe')][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':_0x7124('0x1ee'),'as':'Tags'});db['WhatsappInteraction'][_0x7124('0x11e')](db[_0x7124('0x8c')],{'through':_0x7124('0x1ee'),'as':_0x7124('0x16b')});db[_0x7124('0xfe')][_0x7124('0x11e')](db[_0x7124('0x14')],{'as':_0x7124('0x16c'),'through':_0x7124('0x1ef'),'foreignKey':_0x7124('0x1ed')});db['WhatsappMessage'][_0x7124('0x11c')](db[_0x7124('0x14')],{'as':_0x7124('0x14')});db[_0x7124('0x100')]['belongsTo'](db[_0x7124('0x6e')],{'onDelete':_0x7124('0x107'),'as':_0x7124('0x15b')});db[_0x7124('0x100')][_0x7124('0x11c')](db[_0x7124('0xfe')],{'onDelete':_0x7124('0x107'),'as':_0x7124('0x16d'),'foreignKey':_0x7124('0x1ed')});db[_0x7124('0x100')]['belongsTo'](db[_0x7124('0xfc')],{'as':_0x7124('0x168'),'foreignKey':_0x7124('0x1ea')});db['WhatsappQueueReport']['belongsTo'](db['WhatsappAccount'],{});db[_0x7124('0x102')][_0x7124('0x11c')](db['CmList'],{'as':_0x7124('0x163'),'foreignKey':_0x7124('0x164')});db[_0x7124('0x102')][_0x7124('0x11c')](db[_0x7124('0x6e')],{'as':'Contact','foreignKey':_0x7124('0x15c')});db[_0x7124('0x102')]['belongsTo'](db[_0x7124('0xfe')],{});db[_0x7124('0x102')]['belongsTo'](db['WhatsappQueue'],{});db[_0x7124('0x102')][_0x7124('0x11c')](db['WhatsappMessage'],{});db[_0x7124('0x102')][_0x7124('0x11c')](db[_0x7124('0x14')],{});db[_0x7124('0x1f0')][_0x7124('0x11c')](db[_0x7124('0x100')],{});db['WhatsappTransferReport'][_0x7124('0x11c')](db[_0x7124('0xfe')],{});db['WhatsappTransferReport'][_0x7124('0x11c')](db['WhatsappAccount'],{'foreignKey':_0x7124('0x1f1'),'as':'FromAccount'});db[_0x7124('0x1f0')][_0x7124('0x11c')](db[_0x7124('0xfc')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x7124('0x1f0')][_0x7124('0x11c')](db[_0x7124('0x12f')],{'foreignKey':_0x7124('0x1f2'),'as':_0x7124('0x1de')});db[_0x7124('0x1f0')][_0x7124('0x11c')](db['User'],{'foreignKey':_0x7124('0x1d7'),'as':_0x7124('0x1d8')});db['WhatsappTransferReport'][_0x7124('0x11c')](db[_0x7124('0x14')],{'foreignKey':_0x7124('0x1d9'),'as':'ToAgent'});db['WhatsappQueue']['belongsToMany'](db[_0x7124('0x14')],{'as':'Agents','through':_0x7124('0x131'),'foreignKey':_0x7124('0x1f3')});db[_0x7124('0x12f')][_0x7124('0x11e')](db['Team'],{'through':_0x7124('0x1f4'),'as':'Teams'});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
diff --git a/server/routes.js b/server/routes.js
index 3b3c604..bf4eff0 100644
--- a/server/routes.js
+++ b/server/routes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x689f=['/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfileSection','/api/userProfile/resources','/api/notifications','./api/notification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','root','/www','/demo','join','/snippet','snippet','1.0.16','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','resolve','get','/index.html','express-winston','util','./errors','./config/environment','api','auth','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','connection','remoteAddress','statusCode','responseTime','user','role','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','x-forwarded-for','name','other','agent_name','test','url','./api/user','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperFinal','./api/cmHopperHistory','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts'];(function(_0x287504,_0x3477ce){var _0x14cbb0=function(_0x4ceac0){while(--_0x4ceac0){_0x287504['push'](_0x287504['shift']());}};_0x14cbb0(++_0x3477ce);}(_0x689f,0x17c));var _0xf689=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x689f[_0x4653f7];return _0x5454da;};'use strict';var path=require('path');var express=require('express');var ewinston=require(_0xf689('0x0'));var util=require(_0xf689('0x1'));var errors=require(_0xf689('0x2'));var config=require(_0xf689('0x3'));var logger=require('./config/logger')(_0xf689('0x4'));var authLogger=require('./config/logger')(_0xf689('0x5'));exports[_0xf689('0x6')]=function(_0x3bf716){_0x3bf716[_0xf689('0x7')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xac2b70,_0x3e8347){return util['format'](_0xf689('0x8'),_0xac2b70[_0xf689('0x9')],_0xac2b70[_0xf689('0xa')]['x-forwarded-for']?_0xac2b70[_0xf689('0xa')]['x-forwarded-for']:_0xac2b70[_0xf689('0xb')][_0xf689('0xc')]||_0xac2b70['ip'],_0xac2b70['url'],_0x3e8347[_0xf689('0xd')],_0x3e8347[_0xf689('0xe')],_0xac2b70[_0xf689('0xf')]?_0xac2b70[_0xf689('0xf')]['id']:null,_0xac2b70[_0xf689('0xf')]?_0xac2b70[_0xf689('0xf')]['name']:null,_0xac2b70[_0xf689('0xf')]?_0xac2b70[_0xf689('0xf')][_0xf689('0x10')]:null);}}));_0x3bf716[_0xf689('0x7')](ewinston[_0xf689('0x11')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x21e39c,_0x584ebe){var _0xfe30f1=_0xf689('0x12');if(_0x21e39c[_0xf689('0x13')]&&_0x21e39c[_0xf689('0x13')][_0xf689('0x14')]&&_0x21e39c[_0xf689('0x13')][_0xf689('0x15')]){_0xfe30f1=_0xf689('0x16');}return util['format'](_0xfe30f1,_0x21e39c[_0xf689('0x9')],_0x21e39c[_0xf689('0xa')][_0xf689('0x17')]?_0x21e39c[_0xf689('0xa')][_0xf689('0x17')]:_0x21e39c[_0xf689('0xb')][_0xf689('0xc')]||_0x21e39c['ip'],_0x21e39c['url'],_0x584ebe[_0xf689('0xd')],_0x584ebe[_0xf689('0xe')],_0x21e39c[_0xf689('0xf')]?_0x21e39c[_0xf689('0xf')]['id']:null,_0x21e39c[_0xf689('0xf')]?_0x21e39c[_0xf689('0xf')][_0xf689('0x18')]:null,_0x21e39c[_0xf689('0xf')]?_0x21e39c[_0xf689('0xf')]['role']:null,_0x21e39c[_0xf689('0x13')]&&_0x21e39c[_0xf689('0x13')][_0xf689('0x14')]?_0x21e39c[_0xf689('0x13')][_0xf689('0x14')]:_0xf689('0x19'),_0x21e39c[_0xf689('0x13')]&&_0x21e39c[_0xf689('0x13')]['agent_id']?_0x21e39c[_0xf689('0x13')][_0xf689('0x15')]:'',_0x21e39c['body']&&_0x21e39c[_0xf689('0x13')][_0xf689('0x1a')]?_0x21e39c[_0xf689('0x13')][_0xf689('0x1a')]:'');},'ignoreRoute':function(_0x21cbe2){var _0x38a226=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x38a226[_0xf689('0x1b')](_0x21cbe2[_0xf689('0x1c')]);}}));_0x3bf716[_0xf689('0x7')]('/api/users',require(_0xf689('0x1d')));_0x3bf716[_0xf689('0x7')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x3bf716[_0xf689('0x7')](_0xf689('0x1e'),require(_0xf689('0x1f')));_0x3bf716['use']('/api/voice/extensions',require(_0xf689('0x20')));_0x3bf716[_0xf689('0x7')](_0xf689('0x21'),require(_0xf689('0x22')));_0x3bf716[_0xf689('0x7')]('/api/voice/queues',require(_0xf689('0x23')));_0x3bf716['use'](_0xf689('0x24'),require(_0xf689('0x25')));_0x3bf716[_0xf689('0x7')](_0xf689('0x26'),require(_0xf689('0x27')));_0x3bf716[_0xf689('0x7')](_0xf689('0x28'),require(_0xf689('0x29')));_0x3bf716[_0xf689('0x7')](_0xf689('0x2a'),require(_0xf689('0x2b')));_0x3bf716[_0xf689('0x7')]('/api/voice/calls/reports',require(_0xf689('0x2c')));_0x3bf716[_0xf689('0x7')](_0xf689('0x2d'),require(_0xf689('0x2e')));_0x3bf716['use'](_0xf689('0x2f'),require(_0xf689('0x30')));_0x3bf716[_0xf689('0x7')](_0xf689('0x31'),require(_0xf689('0x32')));_0x3bf716['use'](_0xf689('0x33'),require('./api/memberReport'));_0x3bf716[_0xf689('0x7')]('/api/trunks',require(_0xf689('0x34')));_0x3bf716[_0xf689('0x7')](_0xf689('0x35'),require(_0xf689('0x36')));_0x3bf716[_0xf689('0x7')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x3bf716[_0xf689('0x7')](_0xf689('0x37'),require(_0xf689('0x38')));_0x3bf716[_0xf689('0x7')](_0xf689('0x39'),require('./api/mailQueue'));_0x3bf716[_0xf689('0x7')]('/api/mail/substatuses',require(_0xf689('0x3a')));_0x3bf716['use'](_0xf689('0x3b'),require('./api/mailInteraction'));_0x3bf716['use']('/api/mail/messages',require(_0xf689('0x3c')));_0x3bf716['use'](_0xf689('0x3d'),require('./api/mailApplication'));_0x3bf716[_0xf689('0x7')](_0xf689('0x3e'),require(_0xf689('0x3f')));_0x3bf716[_0xf689('0x7')](_0xf689('0x40'),require(_0xf689('0x41')));_0x3bf716[_0xf689('0x7')]('/api/dashboards/items',require(_0xf689('0x42')));_0x3bf716[_0xf689('0x7')](_0xf689('0x43'),require('./api/faxAccount'));_0x3bf716['use'](_0xf689('0x44'),require(_0xf689('0x45')));_0x3bf716['use']('/api/fax/interactions',require(_0xf689('0x46')));_0x3bf716[_0xf689('0x7')](_0xf689('0x47'),require(_0xf689('0x48')));_0x3bf716[_0xf689('0x7')](_0xf689('0x49'),require('./api/faxQueue'));_0x3bf716[_0xf689('0x7')]('/api/fax/reports/queue',require(_0xf689('0x4a')));_0x3bf716[_0xf689('0x7')](_0xf689('0x4b'),require(_0xf689('0x4c')));_0x3bf716[_0xf689('0x7')]('/api/sms/applications',require(_0xf689('0x4d')));_0x3bf716[_0xf689('0x7')]('/api/sms/interactions',require(_0xf689('0x4e')));_0x3bf716[_0xf689('0x7')](_0xf689('0x4f'),require(_0xf689('0x50')));_0x3bf716['use'](_0xf689('0x51'),require('./api/smsQueue'));_0x3bf716['use'](_0xf689('0x52'),require(_0xf689('0x53')));_0x3bf716[_0xf689('0x7')]('/api/openchannel/applications',require(_0xf689('0x54')));_0x3bf716['use'](_0xf689('0x55'),require(_0xf689('0x56')));_0x3bf716[_0xf689('0x7')]('/api/openchannel/messages',require(_0xf689('0x57')));_0x3bf716[_0xf689('0x7')](_0xf689('0x58'),require('./api/openchannelQueue'));_0x3bf716[_0xf689('0x7')](_0xf689('0x59'),require(_0xf689('0x5a')));_0x3bf716[_0xf689('0x7')](_0xf689('0x5b'),require(_0xf689('0x5c')));_0x3bf716[_0xf689('0x7')]('/api/chat/applications',require(_0xf689('0x5d')));_0x3bf716[_0xf689('0x7')]('/api/chat/interactions',require('./api/chatInteraction'));_0x3bf716[_0xf689('0x7')](_0xf689('0x5e'),require(_0xf689('0x5f')));_0x3bf716[_0xf689('0x7')](_0xf689('0x60'),require(_0xf689('0x61')));_0x3bf716['use']('/api/chat/queues',require(_0xf689('0x62')));_0x3bf716[_0xf689('0x7')](_0xf689('0x63'),require(_0xf689('0x64')));_0x3bf716['use']('/api/chat/proactive_actions',require(_0xf689('0x65')));_0x3bf716[_0xf689('0x7')](_0xf689('0x66'),require(_0xf689('0x67')));_0x3bf716[_0xf689('0x7')](_0xf689('0x68'),require(_0xf689('0x69')));_0x3bf716[_0xf689('0x7')](_0xf689('0x6a'),require(_0xf689('0x6b')));_0x3bf716[_0xf689('0x7')](_0xf689('0x6c'),require('./api/cmHopperBlack'));_0x3bf716[_0xf689('0x7')]('/api/cm/hopper_final',require(_0xf689('0x6d')));_0x3bf716['use']('/api/cm/hopper_history',require(_0xf689('0x6e')));_0x3bf716['use']('/api/cm/custom_fields',require('./api/cmCustomField'));_0x3bf716[_0xf689('0x7')](_0xf689('0x6f'),require(_0xf689('0x70')));_0x3bf716['use'](_0xf689('0x71'),require(_0xf689('0x72')));_0x3bf716[_0xf689('0x7')](_0xf689('0x73'),require('./api/cannedAnswer'));_0x3bf716[_0xf689('0x7')]('/api/dispositions',require('./api/disposition'));_0x3bf716['use'](_0xf689('0x74'),require('./api/condition'));_0x3bf716[_0xf689('0x7')](_0xf689('0x75'),require(_0xf689('0x76')));_0x3bf716[_0xf689('0x7')](_0xf689('0x77'),require('./api/pause'));_0x3bf716[_0xf689('0x7')]('/api/cdr',require(_0xf689('0x78')));_0x3bf716[_0xf689('0x7')](_0xf689('0x79'),require(_0xf689('0x7a')));_0x3bf716[_0xf689('0x7')](_0xf689('0x7b'),require(_0xf689('0x7c')));_0x3bf716[_0xf689('0x7')](_0xf689('0x7d'),require(_0xf689('0x7e')));_0x3bf716[_0xf689('0x7')](_0xf689('0x7f'),require(_0xf689('0x80')));_0x3bf716[_0xf689('0x7')](_0xf689('0x81'),require(_0xf689('0x82')));_0x3bf716[_0xf689('0x7')](_0xf689('0x83'),require(_0xf689('0x84')));_0x3bf716['use']('/api/variables',require('./api/variable'));_0x3bf716['use']('/api/integrations',require(_0xf689('0x85')));_0x3bf716[_0xf689('0x7')](_0xf689('0x86'),require(_0xf689('0x87')));_0x3bf716[_0xf689('0x7')](_0xf689('0x88'),require(_0xf689('0x89')));_0x3bf716['use'](_0xf689('0x8a'),require('./api/analyticDefaultReport'));_0x3bf716['use'](_0xf689('0x8b'),require('./api/analyticExtractedReport'));_0x3bf716[_0xf689('0x7')](_0xf689('0x8c'),require(_0xf689('0x8d')));_0x3bf716['use'](_0xf689('0x8e'),require(_0xf689('0x8f')));_0x3bf716[_0xf689('0x7')](_0xf689('0x90'),require(_0xf689('0x91')));_0x3bf716[_0xf689('0x7')]('/api/integrations/salesforce/accounts',require(_0xf689('0x92')));_0x3bf716[_0xf689('0x7')](_0xf689('0x93'),require(_0xf689('0x94')));_0x3bf716[_0xf689('0x7')]('/api/integrations/salesforce/fields',require(_0xf689('0x95')));_0x3bf716[_0xf689('0x7')]('/api/integrations/sugarcrm/accounts',require(_0xf689('0x96')));_0x3bf716[_0xf689('0x7')](_0xf689('0x97'),require('./api/intSugarcrmConfiguration'));_0x3bf716['use'](_0xf689('0x98'),require(_0xf689('0x99')));_0x3bf716[_0xf689('0x7')](_0xf689('0x9a'),require(_0xf689('0x9b')));_0x3bf716[_0xf689('0x7')](_0xf689('0x9c'),require(_0xf689('0x9d')));_0x3bf716[_0xf689('0x7')](_0xf689('0x9e'),require('./api/intDeskField'));_0x3bf716['use'](_0xf689('0x9f'),require(_0xf689('0xa0')));_0x3bf716[_0xf689('0x7')](_0xf689('0xa1'),require('./api/intZohoConfiguration'));_0x3bf716[_0xf689('0x7')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x3bf716[_0xf689('0x7')](_0xf689('0xa2'),require('./api/intZendeskAccount'));_0x3bf716[_0xf689('0x7')](_0xf689('0xa3'),require('./api/intZendeskConfiguration'));_0x3bf716[_0xf689('0x7')](_0xf689('0xa4'),require('./api/intZendeskField'));_0x3bf716[_0xf689('0x7')]('/api/integrations/freshdesk/accounts',require(_0xf689('0xa5')));_0x3bf716[_0xf689('0x7')]('/api/integrations/freshdesk/configurations',require(_0xf689('0xa6')));_0x3bf716[_0xf689('0x7')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x3bf716[_0xf689('0x7')](_0xf689('0xa7'),require(_0xf689('0xa8')));_0x3bf716[_0xf689('0x7')](_0xf689('0xa9'),require(_0xf689('0xaa')));_0x3bf716[_0xf689('0x7')](_0xf689('0xab'),require('./api/intVtigerField'));_0x3bf716[_0xf689('0x7')](_0xf689('0xac'),require(_0xf689('0xad')));_0x3bf716[_0xf689('0x7')](_0xf689('0xae'),require(_0xf689('0xaf')));_0x3bf716['use'](_0xf689('0xb0'),require(_0xf689('0xb1')));_0x3bf716['use'](_0xf689('0xb2'),require(_0xf689('0xb3')));_0x3bf716['use'](_0xf689('0xb4'),require('./api/intDynamics365Configuration'));_0x3bf716[_0xf689('0x7')](_0xf689('0xb5'),require(_0xf689('0xb6')));_0x3bf716[_0xf689('0x7')](_0xf689('0xb7'),require('./api/intFreshsalesAccount'));_0x3bf716['use'](_0xf689('0xb8'),require(_0xf689('0xb9')));_0x3bf716[_0xf689('0x7')](_0xf689('0xba'),require(_0xf689('0xbb')));_0x3bf716[_0xf689('0x7')](_0xf689('0xbc'),require(_0xf689('0xbd')));_0x3bf716['use'](_0xf689('0xbe'),require(_0xf689('0xbf')));_0x3bf716['use'](_0xf689('0xc0'),require(_0xf689('0xc1')));_0x3bf716['use'](_0xf689('0xc2'),require(_0xf689('0xc3')));_0x3bf716[_0xf689('0x7')](_0xf689('0xc4'),require('./api/jscriptyQuestionReport'));_0x3bf716[_0xf689('0x7')](_0xf689('0xc5'),require(_0xf689('0xc6')));_0x3bf716[_0xf689('0x7')](_0xf689('0xc7'),require(_0xf689('0xc8')));_0x3bf716[_0xf689('0x7')](_0xf689('0xc9'),require(_0xf689('0xca')));_0x3bf716['use'](_0xf689('0xcb'),require(_0xf689('0xcc')));_0x3bf716[_0xf689('0x7')](_0xf689('0xcd'),require(_0xf689('0xce')));_0x3bf716[_0xf689('0x7')](_0xf689('0xcf'),require(_0xf689('0xd0')));_0x3bf716[_0xf689('0x7')](_0xf689('0xd1'),require(_0xf689('0xd2')));_0x3bf716[_0xf689('0x7')](_0xf689('0xd3'),require('./api/squareProject'));_0x3bf716['use']('/api/square/recordings',require('./api/squareRecording'));_0x3bf716[_0xf689('0x7')](_0xf689('0xd4'),require(_0xf689('0xd5')));_0x3bf716[_0xf689('0x7')](_0xf689('0xd6'),require(_0xf689('0xd7')));_0x3bf716['use'](_0xf689('0xd8'),require(_0xf689('0xd9')));_0x3bf716[_0xf689('0x7')](_0xf689('0xda'),require(_0xf689('0xdb')));_0x3bf716[_0xf689('0x7')](_0xf689('0xdc'),require(_0xf689('0xdd')));_0x3bf716[_0xf689('0x7')](_0xf689('0xde'),require(_0xf689('0xdf')));_0x3bf716[_0xf689('0x7')](_0xf689('0xe0'),require('./api/plugin'));_0x3bf716[_0xf689('0x7')](_0xf689('0xe1'),require(_0xf689('0xe2')));_0x3bf716[_0xf689('0x7')]('/api/chat/reports/transfer',require(_0xf689('0xe3')));_0x3bf716[_0xf689('0x7')]('/api/fax/reports/transfer',require(_0xf689('0xe4')));_0x3bf716[_0xf689('0x7')](_0xf689('0xe5'),require('./api/openchannelTransferReport'));_0x3bf716[_0xf689('0x7')](_0xf689('0xe6'),require(_0xf689('0xe7')));_0x3bf716[_0xf689('0x7')](_0xf689('0xe8'),require(_0xf689('0xe9')));_0x3bf716['use']('/api/voice/prefixes',require(_0xf689('0xea')));_0x3bf716[_0xf689('0x7')](_0xf689('0xeb'),require('./api/userProfile'));_0x3bf716[_0xf689('0x7')]('/api/userProfile/sections',require(_0xf689('0xec')));_0x3bf716[_0xf689('0x7')](_0xf689('0xed'),require('./api/userProfileResource'));_0x3bf716[_0xf689('0x7')](_0xf689('0xee'),require(_0xf689('0xef')));_0x3bf716[_0xf689('0x7')]('/api/whatsapp/accounts',require(_0xf689('0xf0')));_0x3bf716[_0xf689('0x7')](_0xf689('0xf1'),require(_0xf689('0xf2')));_0x3bf716[_0xf689('0x7')]('/api/whatsapp/interactions',require(_0xf689('0xf3')));_0x3bf716[_0xf689('0x7')](_0xf689('0xf4'),require(_0xf689('0xf5')));_0x3bf716[_0xf689('0x7')](_0xf689('0xf6'),require(_0xf689('0xf7')));_0x3bf716[_0xf689('0x7')](_0xf689('0xf8'),require('./api/whatsappTransferReport'));_0x3bf716[_0xf689('0x7')](_0xf689('0xf9'),require(_0xf689('0xfa')));_0x3bf716[_0xf689('0x7')](_0xf689('0xfb'),require(_0xf689('0xfc')));_0x3bf716[_0xf689('0x7')](_0xf689('0xfd'),require(_0xf689('0xfe')));_0x3bf716[_0xf689('0x7')](_0xf689('0xff'),require('./api/authGoogle'));_0x3bf716['use']('/api/jira',require('./api/jira'));_0x3bf716['use'](_0xf689('0x100'),require(_0xf689('0x101')));_0x3bf716['use'](_0xf689('0x102'),require(_0xf689('0x103')));_0x3bf716[_0xf689('0x7')](_0xf689('0x104'),require(_0xf689('0x105')));_0x3bf716[_0xf689('0x7')](_0xf689('0x106'),require(_0xf689('0x107')));_0x3bf716[_0xf689('0x7')](_0xf689('0x108'),require(_0xf689('0x109')));_0x3bf716['use'](_0xf689('0x10a'),express[_0xf689('0x10b')](path['join'](config[_0xf689('0x10c')],_0xf689('0x10a'))));_0x3bf716['use'](_0xf689('0x10d'),express['static'](path['join'](config[_0xf689('0x10c')],'/www')));_0x3bf716[_0xf689('0x7')](_0xf689('0x10e'),express[_0xf689('0x10b')](path[_0xf689('0x10f')](config['root'],_0xf689('0x10e'))));_0x3bf716['use'](_0xf689('0x110'),express[_0xf689('0x10b')](path[_0xf689('0x10f')](config[_0xf689('0x10c')],_0xf689('0x111'),_0xf689('0x112'))));_0x3bf716[_0xf689('0x7')](_0xf689('0x113'),express[_0xf689('0x10b')](path['join'](config[_0xf689('0x10c')],_0xf689('0x114'))));_0x3bf716['route'](_0xf689('0x115'))['get'](errors[0x194]);_0x3bf716[_0xf689('0x116')]('/*')['get'](function(_0x243be2,_0x7c20cb){_0x7c20cb['sendFile'](path[_0xf689('0x117')](_0x3bf716[_0xf689('0x118')]('appPath')+_0xf689('0x119')));});};
\ No newline at end of file
+var _0x7efb=['/api/triggers','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/messages','./api/squareMessage','./api/team','/api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/notifications','./api/notification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/authLocal','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','express-winston','./errors','./config/logger','auth','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','other','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template'];(function(_0x252cb1,_0x24fce7){var _0x4ebd92=function(_0x36aae4){while(--_0x36aae4){_0x252cb1['push'](_0x252cb1['shift']());}};_0x4ebd92(++_0x24fce7);}(_0x7efb,0x8f));var _0xb7ef=function(_0x1c1b4f,_0x16c590){_0x1c1b4f=_0x1c1b4f-0x0;var _0x118c6a=_0x7efb[_0x1c1b4f];return _0x118c6a;};'use strict';var path=require(_0xb7ef('0x0'));var express=require(_0xb7ef('0x1'));var ewinston=require(_0xb7ef('0x2'));var util=require('util');var errors=require(_0xb7ef('0x3'));var config=require('./config/environment');var logger=require(_0xb7ef('0x4'))('api');var authLogger=require(_0xb7ef('0x4'))(_0xb7ef('0x5'));exports[_0xb7ef('0x6')]=function(_0xf68c6f){_0xf68c6f[_0xb7ef('0x7')](ewinston[_0xb7ef('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1151ad,_0x5cb8be){return util[_0xb7ef('0x9')](_0xb7ef('0xa'),_0x1151ad[_0xb7ef('0xb')],_0x1151ad[_0xb7ef('0xc')][_0xb7ef('0xd')]?_0x1151ad[_0xb7ef('0xc')][_0xb7ef('0xd')]:_0x1151ad['connection'][_0xb7ef('0xe')]||_0x1151ad['ip'],_0x1151ad[_0xb7ef('0xf')],_0x5cb8be[_0xb7ef('0x10')],_0x5cb8be[_0xb7ef('0x11')],_0x1151ad[_0xb7ef('0x12')]?_0x1151ad[_0xb7ef('0x12')]['id']:null,_0x1151ad['user']?_0x1151ad[_0xb7ef('0x12')][_0xb7ef('0x13')]:null,_0x1151ad[_0xb7ef('0x12')]?_0x1151ad['user']['role']:null);}}));_0xf68c6f[_0xb7ef('0x7')](ewinston[_0xb7ef('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x134a01,_0xcb59b8){var _0x5cd941=_0xb7ef('0x14');if(_0x134a01[_0xb7ef('0x15')]&&_0x134a01[_0xb7ef('0x15')][_0xb7ef('0x16')]&&_0x134a01[_0xb7ef('0x15')][_0xb7ef('0x17')]){_0x5cd941=_0xb7ef('0x18');}return util[_0xb7ef('0x9')](_0x5cd941,_0x134a01[_0xb7ef('0xb')],_0x134a01[_0xb7ef('0xc')][_0xb7ef('0xd')]?_0x134a01[_0xb7ef('0xc')][_0xb7ef('0xd')]:_0x134a01[_0xb7ef('0x19')][_0xb7ef('0xe')]||_0x134a01['ip'],_0x134a01[_0xb7ef('0xf')],_0xcb59b8[_0xb7ef('0x10')],_0xcb59b8[_0xb7ef('0x11')],_0x134a01[_0xb7ef('0x12')]?_0x134a01[_0xb7ef('0x12')]['id']:null,_0x134a01[_0xb7ef('0x12')]?_0x134a01['user'][_0xb7ef('0x13')]:null,_0x134a01[_0xb7ef('0x12')]?_0x134a01[_0xb7ef('0x12')]['role']:null,_0x134a01[_0xb7ef('0x15')]&&_0x134a01[_0xb7ef('0x15')][_0xb7ef('0x16')]?_0x134a01['body'][_0xb7ef('0x16')]:_0xb7ef('0x1a'),_0x134a01['body']&&_0x134a01[_0xb7ef('0x15')][_0xb7ef('0x17')]?_0x134a01[_0xb7ef('0x15')][_0xb7ef('0x17')]:'',_0x134a01[_0xb7ef('0x15')]&&_0x134a01[_0xb7ef('0x15')][_0xb7ef('0x1b')]?_0x134a01[_0xb7ef('0x15')][_0xb7ef('0x1b')]:'');},'ignoreRoute':function(_0xf22ce5){var _0x393b3b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x393b3b['test'](_0xf22ce5[_0xb7ef('0xf')]);}}));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x1c'),require(_0xb7ef('0x1d')));_0xf68c6f['use'](_0xb7ef('0x1e'),require(_0xb7ef('0x1f')));_0xf68c6f[_0xb7ef('0x7')]('/api/voice/contexts',require(_0xb7ef('0x20')));_0xf68c6f[_0xb7ef('0x7')]('/api/voice/extensions',require('./api/voiceExtension'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x21'),require(_0xb7ef('0x22')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x23'),require('./api/voiceQueue'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x24'),require('./api/voiceRecording'));_0xf68c6f['use'](_0xb7ef('0x25'),require(_0xb7ef('0x26')));_0xf68c6f['use'](_0xb7ef('0x27'),require(_0xb7ef('0x28')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x29'),require('./api/voiceMailMessage'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x2a'),require(_0xb7ef('0x2b')));_0xf68c6f['use'](_0xb7ef('0x2c'),require(_0xb7ef('0x2d')));_0xf68c6f['use'](_0xb7ef('0x2e'),require(_0xb7ef('0x2f')));_0xf68c6f[_0xb7ef('0x7')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0xf68c6f['use']('/api/members/reports',require(_0xb7ef('0x30')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x31'),require('./api/trunk'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x32'),require(_0xb7ef('0x33')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x34'),require(_0xb7ef('0x35')));_0xf68c6f['use'](_0xb7ef('0x36'),require(_0xb7ef('0x37')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x38'),require('./api/mailQueue'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x39'),require(_0xb7ef('0x3a')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x3b'),require('./api/mailInteraction'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x3c'),require(_0xb7ef('0x3d')));_0xf68c6f[_0xb7ef('0x7')]('/api/mail/applications',require(_0xb7ef('0x3e')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x3f'),require('./api/mailQueueReport'));_0xf68c6f[_0xb7ef('0x7')]('/api/dashboards',require(_0xb7ef('0x40')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x41'),require(_0xb7ef('0x42')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x43'),require(_0xb7ef('0x44')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x45'),require(_0xb7ef('0x46')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x47'),require(_0xb7ef('0x48')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x49'),require('./api/faxMessage'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x4a'),require(_0xb7ef('0x4b')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x4c'),require('./api/faxQueueReport'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x4d'),require(_0xb7ef('0x4e')));_0xf68c6f['use'](_0xb7ef('0x4f'),require('./api/smsApplication'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x50'),require('./api/smsInteraction'));_0xf68c6f[_0xb7ef('0x7')]('/api/sms/messages',require(_0xb7ef('0x51')));_0xf68c6f['use'](_0xb7ef('0x52'),require(_0xb7ef('0x53')));_0xf68c6f['use'](_0xb7ef('0x54'),require(_0xb7ef('0x55')));_0xf68c6f['use']('/api/openchannel/applications',require(_0xb7ef('0x56')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x57'),require(_0xb7ef('0x58')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x59'),require(_0xb7ef('0x5a')));_0xf68c6f['use']('/api/openchannel/queues',require(_0xb7ef('0x5b')));_0xf68c6f['use']('/api/chat/websites',require(_0xb7ef('0x5c')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x5d'),require(_0xb7ef('0x5e')));_0xf68c6f['use'](_0xb7ef('0x5f'),require('./api/chatApplication'));_0xf68c6f[_0xb7ef('0x7')]('/api/chat/interactions',require(_0xb7ef('0x60')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x61'),require('./api/chatMessage'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x62'),require(_0xb7ef('0x63')));_0xf68c6f[_0xb7ef('0x7')]('/api/chat/queues',require(_0xb7ef('0x64')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x65'),require(_0xb7ef('0x66')));_0xf68c6f['use'](_0xb7ef('0x67'),require(_0xb7ef('0x68')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x69'),require(_0xb7ef('0x6a')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x6b'),require(_0xb7ef('0x6c')));_0xf68c6f['use'](_0xb7ef('0x6d'),require(_0xb7ef('0x6e')));_0xf68c6f['use']('/api/cm/hopper_black',require(_0xb7ef('0x6f')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x70'),require(_0xb7ef('0x71')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x72'),require(_0xb7ef('0x73')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x74'),require(_0xb7ef('0x75')));_0xf68c6f['use']('/api/actions',require(_0xb7ef('0x76')));_0xf68c6f['use'](_0xb7ef('0x77'),require(_0xb7ef('0x78')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x79'),require('./api/cannedAnswer'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x7a'),require(_0xb7ef('0x7b')));_0xf68c6f['use'](_0xb7ef('0x7c'),require('./api/condition'));_0xf68c6f['use'](_0xb7ef('0x7d'),require('./api/interval'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x7e'),require(_0xb7ef('0x7f')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x80'),require(_0xb7ef('0x81')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x82'),require(_0xb7ef('0x83')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x84'),require('./api/schedule'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x85'),require(_0xb7ef('0x86')));_0xf68c6f['use'](_0xb7ef('0x87'),require(_0xb7ef('0x88')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x89'),require(_0xb7ef('0x8a')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x8b'),require('./api/trigger'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x8c'),require(_0xb7ef('0x8d')));_0xf68c6f[_0xb7ef('0x7')]('/api/integrations',require(_0xb7ef('0x8e')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x8f'),require(_0xb7ef('0x90')));_0xf68c6f['use'](_0xb7ef('0x91'),require('./api/analyticCustomReport'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x92'),require('./api/analyticDefaultReport'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x93'),require(_0xb7ef('0x94')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x95'),require('./api/analyticMetric'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x96'),require(_0xb7ef('0x97')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x98'),require('./api/analyticTreeReport'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x99'),require(_0xb7ef('0x9a')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x9b'),require(_0xb7ef('0x9c')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x9d'),require('./api/intSalesforceField'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x9e'),require(_0xb7ef('0x9f')));_0xf68c6f[_0xb7ef('0x7')]('/api/integrations/sugarcrm/configurations',require(_0xb7ef('0xa0')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xa1'),require('./api/intSugarcrmField'));_0xf68c6f['use'](_0xb7ef('0xa2'),require(_0xb7ef('0xa3')));_0xf68c6f[_0xb7ef('0x7')]('/api/integrations/desk/configurations',require(_0xb7ef('0xa4')));_0xf68c6f[_0xb7ef('0x7')]('/api/integrations/desk/fields',require(_0xb7ef('0xa5')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xa6'),require(_0xb7ef('0xa7')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xa8'),require(_0xb7ef('0xa9')));_0xf68c6f[_0xb7ef('0x7')]('/api/integrations/zoho/fields',require(_0xb7ef('0xaa')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xab'),require(_0xb7ef('0xac')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xad'),require('./api/intZendeskConfiguration'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xae'),require(_0xb7ef('0xaf')));_0xf68c6f['use'](_0xb7ef('0xb0'),require(_0xb7ef('0xb1')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xb2'),require(_0xb7ef('0xb3')));_0xf68c6f[_0xb7ef('0x7')]('/api/integrations/freshdesk/fields',require(_0xb7ef('0xb4')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xb5'),require(_0xb7ef('0xb6')));_0xf68c6f['use'](_0xb7ef('0xb7'),require(_0xb7ef('0xb8')));_0xf68c6f['use'](_0xb7ef('0xb9'),require(_0xb7ef('0xba')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xbb'),require(_0xb7ef('0xbc')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xbd'),require('./api/intServicenowConfiguration'));_0xf68c6f[_0xb7ef('0x7')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xbe'),require('./api/intDynamics365Account'));_0xf68c6f['use']('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xbf'),require(_0xb7ef('0xc0')));_0xf68c6f['use'](_0xb7ef('0xc1'),require(_0xb7ef('0xc2')));_0xf68c6f['use'](_0xb7ef('0xc3'),require(_0xb7ef('0xc4')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xc5'),require(_0xb7ef('0xc6')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xc7'),require(_0xb7ef('0xc8')));_0xf68c6f['use'](_0xb7ef('0xc9'),require(_0xb7ef('0xca')));_0xf68c6f[_0xb7ef('0x7')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0xf68c6f[_0xb7ef('0x7')]('/api/jscripty/answers/reports',require(_0xb7ef('0xcb')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xcc'),require(_0xb7ef('0xcd')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xce'),require('./api/jscriptySessionReport'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xcf'),require('./api/smsQueueReport'));_0xf68c6f[_0xb7ef('0x7')]('/api/square/reports',require(_0xb7ef('0xd0')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xd1'),require('./api/squareReportDetail'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xd2'),require(_0xb7ef('0xd3')));_0xf68c6f['use'](_0xb7ef('0xd4'),require(_0xb7ef('0xd5')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xd6'),require(_0xb7ef('0xd7')));_0xf68c6f[_0xb7ef('0x7')]('/api/square/projects',require(_0xb7ef('0xd8')));_0xf68c6f[_0xb7ef('0x7')]('/api/square/recordings',require('./api/squareRecording'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xd9'),require(_0xb7ef('0xda')));_0xf68c6f[_0xb7ef('0x7')]('/api/teams',require(_0xb7ef('0xdb')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xdc'),require('./api/license'));_0xf68c6f['use'](_0xb7ef('0xdd'),require(_0xb7ef('0xde')));_0xf68c6f[_0xb7ef('0x7')]('/api/migrations',require('./api/migration'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xdf'),require(_0xb7ef('0xe0')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xe1'),require('./api/plugin'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xe2'),require(_0xb7ef('0xe3')));_0xf68c6f[_0xb7ef('0x7')]('/api/chat/reports/transfer',require(_0xb7ef('0xe4')));_0xf68c6f['use']('/api/fax/reports/transfer',require(_0xb7ef('0xe5')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xe6'),require(_0xb7ef('0xe7')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xe8'),require(_0xb7ef('0xe9')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xea'),require(_0xb7ef('0xeb')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xec'),require(_0xb7ef('0xed')));_0xf68c6f[_0xb7ef('0x7')]('/api/userProfiles',require(_0xb7ef('0xee')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xef'),require(_0xb7ef('0xf0')));_0xf68c6f[_0xb7ef('0x7')]('/api/userProfile/resources',require(_0xb7ef('0xf1')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xf2'),require(_0xb7ef('0xf3')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xf4'),require(_0xb7ef('0xf5')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xf6'),require('./api/whatsappApplication'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xf7'),require(_0xb7ef('0xf8')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xf9'),require('./api/whatsappMessage'));_0xf68c6f[_0xb7ef('0x7')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xfa'),require(_0xb7ef('0xfb')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xfc'),require(_0xb7ef('0xfd')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0xfe'),require(_0xb7ef('0xff')));_0xf68c6f[_0xb7ef('0x7')]('/api/auth/local',require(_0xb7ef('0x100')));_0xf68c6f['use']('/api/auth/google',require('./api/authGoogle'));_0xf68c6f['use'](_0xb7ef('0x101'),require(_0xb7ef('0x102')));_0xf68c6f['use'](_0xb7ef('0x103'),require(_0xb7ef('0x104')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x105'),require(_0xb7ef('0x106')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x107'),require('./api/system'));_0xf68c6f[_0xb7ef('0x7')]('/api/pm2',require(_0xb7ef('0x108')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x109'),require(_0xb7ef('0x10a')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x10b'),express[_0xb7ef('0x10c')](path[_0xb7ef('0x10d')](config[_0xb7ef('0x10e')],_0xb7ef('0x10b'))));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x10f'),express[_0xb7ef('0x10c')](path[_0xb7ef('0x10d')](config[_0xb7ef('0x10e')],'/www')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x110'),express[_0xb7ef('0x10c')](path[_0xb7ef('0x10d')](config[_0xb7ef('0x10e')],_0xb7ef('0x110'))));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x111'),express[_0xb7ef('0x10c')](path[_0xb7ef('0x10d')](config[_0xb7ef('0x10e')],'snippet','1.0.16')));_0xf68c6f[_0xb7ef('0x7')](_0xb7ef('0x112'),express[_0xb7ef('0x10c')](path[_0xb7ef('0x10d')](config['root'],_0xb7ef('0x113'))));_0xf68c6f[_0xb7ef('0x114')](_0xb7ef('0x115'))['get'](errors[0x194]);_0xf68c6f[_0xb7ef('0x114')]('/*')[_0xb7ef('0x116')](function(_0xa1baf6,_0x1126da){_0x1126da[_0xb7ef('0x117')](path['resolve'](_0xf68c6f[_0xb7ef('0x116')](_0xb7ef('0x118'))+_0xb7ef('0x119')));});};
\ No newline at end of file
diff --git a/server/rpc/index.js b/server/rpc/index.js
index e8deef8..90bde7b 100644
--- a/server/rpc/index.js
+++ b/server/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2baa=['../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2baa,0xfe));var _0xa2ba=function(_0x211219,_0x1c7e0d){_0x211219=_0x211219-0x0;var _0x2f39b1=_0x2baa[_0x211219];return _0x2f39b1;};'use strict';var jayson=require(_0xa2ba('0x0'));var BPromise=require(_0xa2ba('0x1'));var _=require('lodash');var config=require('../config/environment');exports[_0xa2ba('0x2')]=function(){return new BPromise(function(_0x38f4f4,_0x40983e){var _0x30d423={};_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x4')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x5')));_0x30d423=_['merge'](_0x30d423,require(_0xa2ba('0x6')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x7')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x8')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x9')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0xa')));_0x30d423=_['merge'](_0x30d423,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0xb')));_0x30d423=_['merge'](_0x30d423,require(_0xa2ba('0xc')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0xd')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0xe')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0xf')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x10')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x11')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x12')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require('../api/mailMessage/mailMessage.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x13')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x14')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x15')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x16')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x17')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x18')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x19')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x1a')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x1b')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x1c')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x1d')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require('../api/smsQueue/smsQueue.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x1e')));_0x30d423=_['merge'](_0x30d423,require(_0xa2ba('0x1f')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x20')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x21')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x22')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x23')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x24')));_0x30d423=_['merge'](_0x30d423,require('../api/cmContact/cmContact.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x25')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x26')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x27')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x28')));_0x30d423=_['merge'](_0x30d423,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x30d423=_['merge'](_0x30d423,require('../api/interval/interval.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x29')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x2a')));_0x30d423=_['merge'](_0x30d423,require(_0xa2ba('0x2b')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x2c')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x2d')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x2e')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x2f')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x30')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x31')));_0x30d423=_['merge'](_0x30d423,require(_0xa2ba('0x32')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x33')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x34')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x35')));_0x30d423=_['merge'](_0x30d423,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x30d423=_['merge'](_0x30d423,require(_0xa2ba('0x36')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x37')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require('../api/squareReport/squareReport.rpc'));_0x30d423=_['merge'](_0x30d423,require(_0xa2ba('0x38')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x39')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x3a')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x3b')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x3c')));_0x30d423=_['merge'](_0x30d423,require(_0xa2ba('0x3d')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x3e')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require('../api/plugin/plugin.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x3f')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require(_0xa2ba('0x40')));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x30d423=_[_0xa2ba('0x3')](_0x30d423,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x35dd1d=jayson[_0xa2ba('0x41')](_0x30d423)['http']();var _0x2f177c=config[_0xa2ba('0x42')][_0xa2ba('0x43')]||config[_0xa2ba('0x43')]+0x1;var _0x138560=config[_0xa2ba('0x42')]['ip']||_0xa2ba('0x44');_0x35dd1d['on'](_0xa2ba('0x45'),function(_0x24eab7){return _0x40983e(_0x24eab7);});_0x35dd1d[_0xa2ba('0x2')](_0x2f177c,_0x138560,function(){console[_0xa2ba('0x46')](_0xa2ba('0x47'),_0x138560,_0x2f177c);require(_0xa2ba('0x48'))['default']();return _0x38f4f4(_0xa2ba('0x49')+_0x138560+':'+_0x2f177c);});});};
\ No newline at end of file
+var _0x1c9e=['../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','bluebird','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc'];(function(_0x6f0bdb,_0x7911ad){var _0x2f49c1=function(_0x5db2df){while(--_0x5db2df){_0x6f0bdb['push'](_0x6f0bdb['shift']());}};_0x2f49c1(++_0x7911ad);}(_0x1c9e,0x1c4));var _0xe1c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c9e[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xe1c9('0x0'));var BPromise=require(_0xe1c9('0x1'));var _=require('lodash');var config=require('../config/environment');exports[_0xe1c9('0x2')]=function(){return new BPromise(function(_0x2e6eb6,_0x51bef8){var _0x5d9274={};_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x4')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/voiceExtension/voiceExtension.rpc'));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x5')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x6')));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x7')));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x8')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x9')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0xa')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0xb')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0xc')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0xd')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0xe')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0xf')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/mailAccount/mailAccount.rpc'));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x10')));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x11')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x12')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x13')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x14')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x15')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x16')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x17')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x18')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x19')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x1a')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x1b')));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x1c')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/smsMessage/smsMessage.rpc'));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x1d')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x1e')));_0x5d9274=_['merge'](_0x5d9274,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x1f')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x20')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x21')));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x22')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/chatQueue/chatQueue.rpc'));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x23')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x24')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x25')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x26')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x27')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x28')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x29')));_0x5d9274=_['merge'](_0x5d9274,require('../api/sound/sound.rpc'));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x2a')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x2b')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x2c')));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x2d')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x2e')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x2f')));_0x5d9274=_['merge'](_0x5d9274,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x30')));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x31')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x32')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x33')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x34')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x35')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x36')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x37')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x38')));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x39')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x3a')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/attachment/attachment.rpc'));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x3b')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x3c')));_0x5d9274=_['merge'](_0x5d9274,require(_0xe1c9('0x3d')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x3e')));_0x5d9274=_[_0xe1c9('0x3')](_0x5d9274,require(_0xe1c9('0x3f')));var _0x56c67a=jayson['server'](_0x5d9274)['http']();var _0x37d980=config['rpc'][_0xe1c9('0x40')]||config[_0xe1c9('0x40')]+0x1;var _0x2d7cf7=config['rpc']['ip']||_0xe1c9('0x41');_0x56c67a['on'](_0xe1c9('0x42'),function(_0x1f1063){return _0x51bef8(_0x1f1063);});_0x56c67a['listen'](_0x37d980,_0x2d7cf7,function(){console['log'](_0xe1c9('0x43'),_0x2d7cf7,_0x37d980);require('../config/triggers')[_0xe1c9('0x44')]();return _0x2e6eb6('RPC\x20listening\x20on\x20'+_0x2d7cf7+':'+_0x37d980);});});};
\ No newline at end of file
diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js
index 0c8051b..b61b77b 100644
--- a/server/services/agi/channel.js
+++ b/server/services/agi/channel.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6009=['toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','log','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec','AGI','wait','label','exports','util','lodash','events','./error','call','setEncoding','utf8','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','function','no\x20code','indexOf','substr','startsWith','length','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','command=','write','destroy','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','format','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','isBoolean'];(function(_0x400001,_0x4b768f){var _0x343fbe=function(_0x199f05){while(--_0x199f05){_0x400001['push'](_0x400001['shift']());}};_0x343fbe(++_0x4b768f);}(_0x6009,0x140));var _0x9600=function(_0x2bdb28,_0x140b07){_0x2bdb28=_0x2bdb28-0x0;var _0xec9a20=_0x6009[_0x2bdb28];return _0xec9a20;};'use strict';var util=require(_0x9600('0x0'));var _=require(_0x9600('0x1'));var EventEmitter=require(_0x9600('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x9600('0x3'));function AGIChannel(_0x3ca542){var _0x3d6e5e=this,_0x2d1746=new AGIReply(),_0x5c118e=![],_0x51a51c={};EventEmitter[_0x9600('0x4')](_0x3d6e5e);_0x3ca542[_0x9600('0x5')]('utf8');_0x3ca542['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2d1746[_0x9600('0x5')](_0x9600('0x6'));_0x2d1746['on']('headers',function(_0x5ae4c2){for(var _0x1bc495 in _0x5ae4c2){_0x3d6e5e[_0x1bc495]=_0x5ae4c2[_0x1bc495];}_0x3d6e5e[_0x9600('0x7')](_0x9600('0x8'));});_0x2d1746['on'](_0x9600('0x9'),function(_0x54586e){if(_0x54586e[_0x9600('0xa')]()==_0x9600('0xb')){_0x3d6e5e[_0x9600('0x7')](_0x9600('0xb'));return;}if(_0x54586e[_0x9600('0xc')](0x0,0xb)==_0x9600('0xd')){_0x5c118e=!![];}if(_0x5c118e){_0x51a51c['rx']+=_0x54586e+'\x0a';if(_0x54586e[_0x9600('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x5c118e=![];}}else{_0x51a51c['rx']=_0x54586e;}if(_0x5c118e){return;}if(typeof _0x51a51c['cb']==_0x9600('0xf')){var _0x28ead4=_0x51a51c['rx'][_0x9600('0xc')](0x0,0x3),_0x7fa041=null,_0x5b15f3=null;_0x28ead4=parseInt(_0x28ead4);if(isNaN(_0x28ead4)){_0x51a51c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x9600('0x10')});return;}if(_0x28ead4!=0xc8){_0x51a51c['cb'](null,{'code':_0x28ead4,'result':-0x1,'extra':'KO'});return;}_0x7fa041=_0x51a51c['rx'][_0x9600('0xc')](0x4)['replace']('result=','');if(_0x7fa041[_0x9600('0x11')]('\x20')!=-0x1){_0x7fa041=_0x7fa041[_0x9600('0x12')](0x0,_0x7fa041[_0x9600('0x11')]('\x20'));}if(_[_0x9600('0x13')](_0x7fa041,'-1')){_0x7fa041=parseInt(_0x7fa041);}_0x5b15f3=_0x51a51c['rx']['split']('\x20');if(_0x5b15f3['length']==0x3){_0x5b15f3=_0x5b15f3[0x2][_0x9600('0xc')](0x1,_0x5b15f3[0x2][_0x9600('0x14')]-0x1);}else if(_0x5b15f3[_0x9600('0x14')]>0x3){var _0xea9e59=/\((.+)\)/;var _0x13d1e6=_0x51a51c['rx']['match'](_0xea9e59);if(_0x13d1e6){_0x5b15f3=_0x13d1e6[0x1];}else{_0x5b15f3=null;}}else{_0x5b15f3=null;}_0x51a51c['cb'](null,{'code':_0x28ead4,'result':_0x7fa041,'extra':_0x5b15f3});}});_0x3ca542['on'](_0x9600('0x15'),function(_0x19edc2){_0x3d6e5e[_0x9600('0x7')](_0x9600('0x15'),new AGIError('E_AGI_SOCKET_ERROR',_0x19edc2['code']));});_0x3ca542['on'](_0x9600('0x16'),function(){_0x3d6e5e[_0x9600('0x7')](_0x9600('0x16'),new AGIError(_0x9600('0x17')));});_0x3ca542['on'](_0x9600('0x18'),function(){_0x3d6e5e[_0x9600('0x7')](_0x9600('0x18'),new AGIError(_0x9600('0x19')));_0x3ca542['destroy']();});_0x3ca542[_0x9600('0x1a')](_0x2d1746);this[_0x9600('0x1b')]=function(_0x5c1ef6,_0x5e4438){console['log'](_0x9600('0x1c'),_0x5c1ef6);var _0x5c1ef6=_0x5c1ef6||'',_0x5e4438=typeof _0x5e4438=='function'?_0x5e4438:new Function();_0x51a51c={'tx':_0x5c1ef6,'rx':'','cb':_0x5e4438};_0x3ca542[_0x9600('0x1d')](_0x5c1ef6+'\x0a');},this[_0x9600('0x16')]=function(){_0x3ca542[_0x9600('0x1e')]();};}util[_0x9600('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x9600('0x20')][_0x9600('0x21')]=function(_0x477626){return this[_0x9600('0x1b')][_0x9600('0x22')](this,_0x477626);};AGIChannel['prototype'][_0x9600('0x23')]=function(){return this[_0x9600('0x21')](_0x9600('0x24'));};AGIChannel[_0x9600('0x20')][_0x9600('0x25')]=function(_0x6d399,_0x445ed1,_0xbd2fd8){_0x6d399=_0x6d399===undefined?_0x9600('0x26'):_0x6d399;_0x445ed1=_0x445ed1===undefined?'5':_0x445ed1;_0xbd2fd8=_0xbd2fd8===undefined?'1':_0xbd2fd8;return this['sendRequest'](util['format'](_0x9600('0x27'),_0x6d399,_0x445ed1*0x3e8,_0xbd2fd8));};AGIChannel[_0x9600('0x20')][_0x9600('0x28')]=function(_0x16412b){_0x16412b=_0x16412b||'NO\x20MESSAGE';return this[_0x9600('0x21')](util['format'](_0x9600('0x29'),_0x16412b));};AGIChannel[_0x9600('0x20')]['exec']=function(_0x587db8,_0x572ff7){if(_['isArray'](_0x572ff7)){return this[_0x9600('0x21')](util[_0x9600('0x2a')](_0x9600('0x2b'),_0x587db8,_0x572ff7[_0x9600('0x2c')](',')));}return this[_0x9600('0x21')](util['format'](_0x9600('0x2b'),_0x587db8,_0x572ff7));};AGIChannel[_0x9600('0x20')]['setContext']=function(_0x2b3ef5){return this[_0x9600('0x21')](util[_0x9600('0x2a')](_0x9600('0x2d'),_0x2b3ef5));};AGIChannel[_0x9600('0x20')][_0x9600('0x2e')]=function(_0xb76372){return this['sendRequest'](util['format']('SET\x20EXTENSION\x20%s',_0xb76372));};AGIChannel[_0x9600('0x20')][_0x9600('0x2f')]=function(_0x4373ba){return this[_0x9600('0x21')](util['format'](_0x9600('0x30'),_0x4373ba));};AGIChannel[_0x9600('0x20')][_0x9600('0xb')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x9600('0x20')]['setVariable']=function(_0xa6df38,_0x58f656){var _0x2b3eaf=_[_0x9600('0x31')](_0x58f656)||_['isNumber'](_0x58f656)?_0x58f656[_0x9600('0x32')]():_0x58f656;return this[_0x9600('0x21')](util[_0x9600('0x2a')](_0x9600('0x33'),_0xa6df38,_0x2b3eaf?_0x2b3eaf[_0x9600('0x32')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9600('0x20')][_0x9600('0x34')]=function(_0x4a7ffb,_0x3b2a00){return this['sendRequest'](util[_0x9600('0x2a')](_0x9600('0x35'),_0x4a7ffb,_0x3b2a00));};AGIChannel[_0x9600('0x20')][_0x9600('0x36')]=function(_0x32f8c6,_0x1489ba){return this[_0x9600('0x21')](util[_0x9600('0x2a')](_0x9600('0x37'),_0x32f8c6,_0x1489ba));};AGIChannel[_0x9600('0x20')][_0x9600('0x38')]=function(_0x1aaaa0,_0x274022){return this[_0x9600('0x21')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x1aaaa0,_0x274022));};AGIChannel['prototype'][_0x9600('0x39')]=function(_0x56d89b,_0x2b2a3a,_0x162b97){_0x2b2a3a=_0x2b2a3a||this[_0x9600('0x3a')];_0x162b97=_0x162b97||0x1;this['setContext'](_0x56d89b);this['setExtension'](_0x2b2a3a);this[_0x9600('0x2f')](_0x162b97);return this['noop'](util['format'](_0x9600('0x3b'),_0x56d89b,_0x2b2a3a,_0x162b97));};AGIChannel[_0x9600('0x20')][_0x9600('0x3c')]=function(_0x29ff0d){console[_0x9600('0x3d')]('getvariable',_0x29ff0d);return this['sendRequest'](util['format'](_0x9600('0x3e'),_0x29ff0d));};AGIChannel[_0x9600('0x20')][_0x9600('0x3f')]=function(_0x827cdc,_0x28245b,_0x37cef7,_0x338e80,_0x4a76c8,_0x1b9f07){_0x28245b=_0x28245b||_0x9600('0x40');_0x37cef7=_0x37cef7||'';_0x338e80=_0x338e80===undefined?-0x1:_0x338e80==='-1'?-0x1:_0x338e80*0x3e8;_0x4a76c8=_0x4a76c8===undefined?'':'s='+_0x4a76c8;_0x1b9f07=_0x1b9f07?_0x9600('0x41'):'';return this[_0x9600('0x21')](util[_0x9600('0x2a')](_0x9600('0x42'),_0x827cdc,_0x28245b,_0x37cef7,_0x338e80,_0x1b9f07,_0x4a76c8));};AGIChannel[_0x9600('0x20')][_0x9600('0x43')]=function(_0x19a3e6,_0x37d3ee){_0x37d3ee=_0x37d3ee||'';return this[_0x9600('0x21')](util[_0x9600('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x19a3e6,_0x37d3ee));};AGIChannel[_0x9600('0x20')][_0x9600('0x44')]=function(_0x42facf){return this[_0x9600('0x45')](_0x9600('0x46'),_0x42facf);};AGIChannel[_0x9600('0x20')][_0x9600('0x47')]=function(_0x449548){return this[_0x9600('0x45')]('WAIT',_0x449548);};AGIChannel['prototype'][_0x9600('0x15')]=function(_0x57a038,_0x1c8ca3){this['noop'](util[_0x9600('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x57a038['id'],_0x57a038[_0x9600('0x48')],_0x1c8ca3));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9600('0x49')]=AGIChannel;
\ No newline at end of file
+var _0x86d3=['length','error','code','close','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','command=','write','inherits','prototype','sendRequest','sync','answer','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','format','VERBOSE\x20\x22%s\x22','exec','isArray','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','getvariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','hangup','substring','520-Invalid','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','split'];(function(_0x20d73e,_0x39f9ec){var _0x52e84b=function(_0x11a4ac){while(--_0x11a4ac){_0x20d73e['push'](_0x20d73e['shift']());}};_0x52e84b(++_0x39f9ec);}(_0x86d3,0x1db));var _0x386d=function(_0x22d82b,_0xe798c4){_0x22d82b=_0x22d82b-0x0;var _0x37fea1=_0x86d3[_0x22d82b];return _0x37fea1;};'use strict';var util=require('util');var _=require(_0x386d('0x0'));var EventEmitter=require(_0x386d('0x1'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x386d('0x2'));function AGIChannel(_0x88e720){var _0x4aea08=this,_0x4f2b4e=new AGIReply(),_0x504c29=![],_0x439d34={};EventEmitter[_0x386d('0x3')](_0x4aea08);_0x88e720[_0x386d('0x4')](_0x386d('0x5'));_0x88e720[_0x386d('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4f2b4e[_0x386d('0x4')]('utf8');_0x4f2b4e['on'](_0x386d('0x7'),function(_0x57cadd){for(var _0x571647 in _0x57cadd){_0x4aea08[_0x571647]=_0x57cadd[_0x571647];}_0x4aea08[_0x386d('0x8')](_0x386d('0x9'));});_0x4f2b4e['on'](_0x386d('0xa'),function(_0x1d5a97){if(_0x1d5a97['toLowerCase']()==_0x386d('0xb')){_0x4aea08[_0x386d('0x8')](_0x386d('0xb'));return;}if(_0x1d5a97[_0x386d('0xc')](0x0,0xb)==_0x386d('0xd')){_0x504c29=!![];}if(_0x504c29){_0x439d34['rx']+=_0x1d5a97+'\x0a';if(_0x1d5a97[_0x386d('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x504c29=![];}}else{_0x439d34['rx']=_0x1d5a97;}if(_0x504c29){return;}if(typeof _0x439d34['cb']==_0x386d('0xf')){var _0xe88d83=_0x439d34['rx'][_0x386d('0xc')](0x0,0x3),_0x582f8a=null,_0x4528d6=null;_0xe88d83=parseInt(_0xe88d83);if(isNaN(_0xe88d83)){_0x439d34['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x386d('0x10')});return;}if(_0xe88d83!=0xc8){_0x439d34['cb'](null,{'code':_0xe88d83,'result':-0x1,'extra':'KO'});return;}_0x582f8a=_0x439d34['rx'][_0x386d('0xc')](0x4)[_0x386d('0x11')](_0x386d('0x12'),'');if(_0x582f8a[_0x386d('0x13')]('\x20')!=-0x1){_0x582f8a=_0x582f8a[_0x386d('0x14')](0x0,_0x582f8a['indexOf']('\x20'));}if(_[_0x386d('0x15')](_0x582f8a,'-1')){_0x582f8a=parseInt(_0x582f8a);}_0x4528d6=_0x439d34['rx'][_0x386d('0x16')]('\x20');if(_0x4528d6[_0x386d('0x17')]==0x3){_0x4528d6=_0x4528d6[0x2]['substring'](0x1,_0x4528d6[0x2][_0x386d('0x17')]-0x1);}else if(_0x4528d6[_0x386d('0x17')]>0x3){var _0x436e67=/\((.+)\)/;var _0x31e593=_0x439d34['rx']['match'](_0x436e67);if(_0x31e593){_0x4528d6=_0x31e593[0x1];}else{_0x4528d6=null;}}else{_0x4528d6=null;}_0x439d34['cb'](null,{'code':_0xe88d83,'result':_0x582f8a,'extra':_0x4528d6});}});_0x88e720['on'](_0x386d('0x18'),function(_0x120af4){_0x4aea08[_0x386d('0x8')](_0x386d('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x120af4[_0x386d('0x19')]));});_0x88e720['on']('close',function(){_0x4aea08[_0x386d('0x8')](_0x386d('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x88e720['on']('timeout',function(){_0x4aea08[_0x386d('0x8')]('timeout',new AGIError(_0x386d('0x1b')));_0x88e720[_0x386d('0x1c')]();});_0x88e720[_0x386d('0x1d')](_0x4f2b4e);this[_0x386d('0x1e')]=function(_0xe7584d,_0x5947a5){console['log'](_0x386d('0x1f'),_0xe7584d);var _0xe7584d=_0xe7584d||'',_0x5947a5=typeof _0x5947a5==_0x386d('0xf')?_0x5947a5:new Function();_0x439d34={'tx':_0xe7584d,'rx':'','cb':_0x5947a5};_0x88e720[_0x386d('0x20')](_0xe7584d+'\x0a');},this[_0x386d('0x1a')]=function(){_0x88e720['destroy']();};}util[_0x386d('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x386d('0x22')][_0x386d('0x23')]=function(_0x10ab21){return this[_0x386d('0x1e')][_0x386d('0x24')](this,_0x10ab21);};AGIChannel[_0x386d('0x22')][_0x386d('0x25')]=function(){return this[_0x386d('0x23')]('ANSWER');};AGIChannel[_0x386d('0x22')][_0x386d('0x26')]=function(_0x5c6cd0,_0x19bbf4,_0x423899){_0x5c6cd0=_0x5c6cd0===undefined?_0x386d('0x27'):_0x5c6cd0;_0x19bbf4=_0x19bbf4===undefined?'5':_0x19bbf4;_0x423899=_0x423899===undefined?'1':_0x423899;return this[_0x386d('0x23')](util['format'](_0x386d('0x28'),_0x5c6cd0,_0x19bbf4*0x3e8,_0x423899));};AGIChannel[_0x386d('0x22')][_0x386d('0x29')]=function(_0x2bb833){_0x2bb833=_0x2bb833||'NO\x20MESSAGE';return this[_0x386d('0x23')](util[_0x386d('0x2a')](_0x386d('0x2b'),_0x2bb833));};AGIChannel[_0x386d('0x22')][_0x386d('0x2c')]=function(_0x33ba41,_0x572528){if(_[_0x386d('0x2d')](_0x572528)){return this[_0x386d('0x23')](util[_0x386d('0x2a')]('EXEC\x20%s\x20%s',_0x33ba41,_0x572528[_0x386d('0x2e')](',')));}return this['sendRequest'](util[_0x386d('0x2a')]('EXEC\x20%s\x20%s',_0x33ba41,_0x572528));};AGIChannel[_0x386d('0x22')][_0x386d('0x2f')]=function(_0x554158){return this['sendRequest'](util[_0x386d('0x2a')](_0x386d('0x30'),_0x554158));};AGIChannel[_0x386d('0x22')]['setExtension']=function(_0x31ac20){return this[_0x386d('0x23')](util[_0x386d('0x2a')](_0x386d('0x31'),_0x31ac20));};AGIChannel[_0x386d('0x22')][_0x386d('0x32')]=function(_0x37f210){return this[_0x386d('0x23')](util[_0x386d('0x2a')](_0x386d('0x33'),_0x37f210));};AGIChannel[_0x386d('0x22')][_0x386d('0xb')]=function(){return this[_0x386d('0x23')](_0x386d('0x34'));};AGIChannel[_0x386d('0x22')][_0x386d('0x35')]=function(_0x4f5753,_0x81cd3d){var _0x1925d1=_[_0x386d('0x36')](_0x81cd3d)||_[_0x386d('0x37')](_0x81cd3d)?_0x81cd3d[_0x386d('0x38')]():_0x81cd3d;return this[_0x386d('0x23')](util[_0x386d('0x2a')](_0x386d('0x39'),_0x4f5753,_0x1925d1?_0x1925d1['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x386d('0x22')][_0x386d('0x3a')]=function(_0xa19a5,_0x302983){return this[_0x386d('0x23')](util[_0x386d('0x2a')](_0x386d('0x3b'),_0xa19a5,_0x302983));};AGIChannel[_0x386d('0x22')][_0x386d('0x3c')]=function(_0x1b6573,_0x34d372){return this[_0x386d('0x23')](util[_0x386d('0x2a')](_0x386d('0x3d'),_0x1b6573,_0x34d372));};AGIChannel[_0x386d('0x22')][_0x386d('0x3e')]=function(_0x12e585,_0x38fd23){return this[_0x386d('0x23')](util[_0x386d('0x2a')](_0x386d('0x3f'),_0x12e585,_0x38fd23));};AGIChannel[_0x386d('0x22')][_0x386d('0x40')]=function(_0x4393ba,_0x4428dd,_0xa215db){_0x4428dd=_0x4428dd||this[_0x386d('0x41')];_0xa215db=_0xa215db||0x1;this[_0x386d('0x2f')](_0x4393ba);this[_0x386d('0x42')](_0x4428dd);this[_0x386d('0x32')](_0xa215db);return this['noop'](util[_0x386d('0x2a')](_0x386d('0x43'),_0x4393ba,_0x4428dd,_0xa215db));};AGIChannel[_0x386d('0x22')][_0x386d('0x44')]=function(_0x2ef9df){console['log'](_0x386d('0x45'),_0x2ef9df);return this[_0x386d('0x23')](util['format'](_0x386d('0x46'),_0x2ef9df));};AGIChannel[_0x386d('0x22')][_0x386d('0x47')]=function(_0x35929f,_0x39ce71,_0x1bef94,_0x276ffb,_0x4b7f39,_0x1a3326){_0x39ce71=_0x39ce71||_0x386d('0x48');_0x1bef94=_0x1bef94||'';_0x276ffb=_0x276ffb===undefined?-0x1:_0x276ffb==='-1'?-0x1:_0x276ffb*0x3e8;_0x4b7f39=_0x4b7f39===undefined?'':'s='+_0x4b7f39;_0x1a3326=_0x1a3326?_0x386d('0x49'):'';return this[_0x386d('0x23')](util[_0x386d('0x2a')](_0x386d('0x4a'),_0x35929f,_0x39ce71,_0x1bef94,_0x276ffb,_0x1a3326,_0x4b7f39));};AGIChannel[_0x386d('0x22')][_0x386d('0x4b')]=function(_0x302f77,_0x375b18){_0x375b18=_0x375b18||'';return this[_0x386d('0x23')](util[_0x386d('0x2a')](_0x386d('0x4c'),_0x302f77,_0x375b18));};AGIChannel['prototype'][_0x386d('0x4d')]=function(_0x1b6bcb){return this[_0x386d('0x2c')](_0x386d('0x4e'),_0x1b6bcb);};AGIChannel[_0x386d('0x22')]['wait']=function(_0x59b00a){return this[_0x386d('0x2c')](_0x386d('0x4f'),_0x59b00a);};AGIChannel[_0x386d('0x22')][_0x386d('0x18')]=function(_0x4f1a61,_0x3707dc){this[_0x386d('0x29')](util['format'](_0x386d('0x50'),_0x4f1a61['id'],_0x4f1a61[_0x386d('0x51')],_0x3707dc));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x386d('0x52')]=AGIChannel;
\ No newline at end of file
diff --git a/server/services/agi/error.js b/server/services/agi/error.js
index 0949ffa..4817993 100644
--- a/server/services/agi/error.js
+++ b/server/services/agi/error.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0a12=['name','exports','Undefined\x20error.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message'];(function(_0x56756b,_0x3e8cc7){var _0xa3002=function(_0x5f1386){while(--_0x5f1386){_0x56756b['push'](_0x56756b['shift']());}};_0xa3002(++_0x3e8cc7);}(_0x0a12,0xb8));var _0x20a1=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x0a12[_0x2aec52];return _0x3b8835;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x20a1('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x20a1('0x1'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x20a1('0x2'),'E_AGI_SOCKET_CLOSE':_0x20a1('0x3'),'E_AGI_SOCKET_TIMEOUT':_0x20a1('0x4'),'E_AGI_COMMAND_EMPTY':_0x20a1('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x20a1('0x6'),'E_AGI_IVR_ENTRY':_0x20a1('0x7')};function AGIError(_0x1fedd2){var _0x1fedd2=_0x1fedd2||null,_0x494314=_0x494314||[],_0x28ed27=0x1,_0x52fb53='';if(!error[_0x1fedd2]){_0x1fedd2='E_AGI_UNDEFINED';}_0x494314[_0x20a1('0x8')](error[_0x1fedd2]);while(arguments[_0x28ed27]){_0x494314[_0x20a1('0x8')](arguments[_0x28ed27]);_0x28ed27++;}_0x52fb53=util[_0x20a1('0x9')][_0x20a1('0xa')](util,_0x494314);this[_0x20a1('0xb')]=_0x52fb53;this[_0x20a1('0xc')]=_0x1fedd2;}module[_0x20a1('0xd')]=AGIError;
\ No newline at end of file
+var _0x5096=['E_AGI_UNDEFINED','push','format','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x3a1d84,_0xcdd69){var _0x24c985=function(_0x2307a8){while(--_0x2307a8){_0x3a1d84['push'](_0x3a1d84['shift']());}};_0x24c985(++_0xcdd69);}(_0x5096,0x6c));var _0x6509=function(_0x45d6a9,_0x549ec9){_0x45d6a9=_0x45d6a9-0x0;var _0x3f42a2=_0x5096[_0x45d6a9];return _0x3f42a2;};'use strict';var util=require(_0x6509('0x0'));var error={'E_AGI_UNDEFINED':_0x6509('0x1'),'E_AGI_ARGUMENT_PORT':_0x6509('0x2'),'E_AGI_SERVER_ERROR':_0x6509('0x3'),'E_AGI_SERVER_CLOSE':_0x6509('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x6509('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x6509('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x6509('0x7'),'E_AGI_COMMAND_EMPTY':_0x6509('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6509('0x9'),'E_AGI_IVR_ENTRY':_0x6509('0xa')};function AGIError(_0x19073c){var _0x19073c=_0x19073c||null,_0xa51d41=_0xa51d41||[],_0x3c5006=0x1,_0x4b67e8='';if(!error[_0x19073c]){_0x19073c=_0x6509('0xb');}_0xa51d41[_0x6509('0xc')](error[_0x19073c]);while(arguments[_0x3c5006]){_0xa51d41[_0x6509('0xc')](arguments[_0x3c5006]);_0x3c5006++;}_0x4b67e8=util[_0x6509('0xd')][_0x6509('0xe')](util,_0xa51d41);this['message']=_0x4b67e8;this[_0x6509('0xf')]=_0x19073c;}module[_0x6509('0x10')]=AGIError;
\ No newline at end of file
diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js
index 1e0c0ad..c91e9a6 100644
--- a/server/services/agi/graph/index.js
+++ b/server/services/agi/graph/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f68=['agicommand','target','default','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','vertices','numberOfEdges','prototype','addEdge','edges','push','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split'];(function(_0x1152f8,_0x23f842){var _0x2d1c85=function(_0x15aa17){while(--_0x15aa17){_0x1152f8['push'](_0x1152f8['shift']());}};_0x2d1c85(++_0x23f842);}(_0x2f68,0x9a));var _0x82f6=function(_0x25ed98,_0x5a4a48){_0x25ed98=_0x25ed98-0x0;var _0x5cc414=_0x2f68[_0x25ed98];return _0x5cc414;};'use strict';var _=require('lodash');var logger=require(_0x82f6('0x0'))(_0x82f6('0x1'));var verticesWithRetry=[_0x82f6('0x2'),_0x82f6('0x3'),'getsecretdigits'];var Graph=function(){this[_0x82f6('0x4')]={};this['edges']={};this[_0x82f6('0x5')]=0x0;};Graph[_0x82f6('0x6')]['addVertex']=function(_0x3ad120){this[_0x82f6('0x4')][_0x3ad120['id']]=_0x3ad120;this['edges'][_0x3ad120['id']]=[];};Graph['prototype'][_0x82f6('0x7')]=function(_0x5660bf,_0x5daa3c,_0x864400){this[_0x82f6('0x8')][_0x5660bf][_0x82f6('0x9')]({'target':_0x5daa3c,'condition':_0x864400});this['numberOfEdges']+=0x1;};Graph[_0x82f6('0x6')][_0x82f6('0xa')]=function(){return _['size'](this[_0x82f6('0x4')]);};Graph[_0x82f6('0x6')][_0x82f6('0xb')]=function(){return this[_0x82f6('0x5')];};Graph[_0x82f6('0x6')][_0x82f6('0xc')]=function(_0x4c870e){return this[_0x82f6('0x4')][_0x4c870e];};Graph[_0x82f6('0x6')]['traverseBFS']=function(_0x194da7,_0x1f8bf5){if(!this[_0x82f6('0x4')][_0x194da7]){return logger[_0x82f6('0xd')](_0x82f6('0xe'));}var _0xa00275=_0x1f8bf5(this[_0x82f6('0x4')][_0x194da7]);if(!_0xa00275){return logger[_0x82f6('0xd')](_0x82f6('0xf'));}if(this['edges'][_0x194da7][_0x82f6('0x10')]===0x0){return logger['info'](_0x82f6('0x11'));}for(var _0x1d0263=0x0,_0x31b4fb=[],_0x1033d3=![];_0x1d0263\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./mailRpc','./graph','./vertices','agi','127.0.0.1','nextTick','error','log','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','message','stack','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','omit','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','close','evtHangup','production','YYYY-MM-DD\x20HH:mm:ss','mxCell','vertices','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','LOOP\x20through\x20graph','traverseBFS'];(function(_0x20f5fa,_0x3b479e){var _0x35ab42=function(_0x2e605a){while(--_0x2e605a){_0x20f5fa['push'](_0x20f5fa['shift']());}};_0x35ab42(++_0x3b479e);}(_0x3c1a,0xda));var _0xa3c1=function(_0x3f25db,_0x1d3686){_0x3f25db=_0x3f25db-0x0;var _0x54f29d=_0x3c1a[_0x3f25db];return _0x54f29d;};'use strict';var parser=require(_0xa3c1('0x0'));var _=require(_0xa3c1('0x1'));var syncho=require(_0xa3c1('0x2'));var util=require(_0xa3c1('0x3'));var moment=require(_0xa3c1('0x4'));var config=require(_0xa3c1('0x5'));var logger=require(_0xa3c1('0x6'))('agi');var utilLicense=require(_0xa3c1('0x7'));var rpc=require('./rpc');var mailRpc=require(_0xa3c1('0x8'));var Graph=require(_0xa3c1('0x9'));var Vertices=require(_0xa3c1('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xa3c1('0xb')]=_['defaults'](config['agi'],{'ip':_0xa3c1('0xc'),'port':0x11dd});function connectionHandler(_0x1aa471){process[_0xa3c1('0xd')](function(){syncho(function(){try{setChannelVariables(_0x1aa471);agiHandler(_0x1aa471);}catch(_0x1e45c6){logger[_0xa3c1('0xe')](_0x1e45c6['stack']);}});});}function listeningHandler(){console[_0xa3c1('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi']['port']);logger['info'](util[_0xa3c1('0x10')](_0xa3c1('0x11'),config[_0xa3c1('0xb')]['ip'],config[_0xa3c1('0xb')][_0xa3c1('0x12')]));}function errorHandler(_0x1ce473){if(_0x1ce473&&_0x1ce473[_0xa3c1('0x13')]&&_0x1ce473['message']){logger[_0xa3c1('0xe')](util[_0xa3c1('0x10')](_0xa3c1('0x14'),_0x1ce473[_0xa3c1('0x13')],_0x1ce473[_0xa3c1('0x15')]));}else{logger[_0xa3c1('0xe')](util[_0xa3c1('0x10')]('[ERROR]\x20%s',_0x1ce473[_0xa3c1('0x16')]));}}function closeHandler(){logger[_0xa3c1('0x17')](util['format'](_0xa3c1('0x18'),this[_0xa3c1('0x19')],this['calleridname'],this['callerid'],this[_0xa3c1('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x1d0077){logger['error'](_0x1d0077['stack']);}}function timeoutHandler(){logger[_0xa3c1('0x17')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xa3c1('0x19')],this[_0xa3c1('0x1b')],this['callerid'],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0xa3c1('0x17')](util[_0xa3c1('0x10')](_0xa3c1('0x1c'),this[_0xa3c1('0x19')],this[_0xa3c1('0x1b')],this['callerid'],this[_0xa3c1('0x1a')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x5ec5cf){return parser['toJson'](_0x5ec5cf,{'object':!![]})[_0xa3c1('0x1d')][_0xa3c1('0x1e')];}function addVertex(_0x1400e0,_0x321ae8,_0x558713){_0x321ae8[_0xa3c1('0x1f')]=_0x558713;if(_0x321ae8[_0xa3c1('0x20')](_0xa3c1('0x21'))){_0x321ae8[_0xa3c1('0x22')]=parseInt(_0x321ae8['retry'],0xa);}_0x1400e0['addVertex'](_[_0xa3c1('0x23')](_0x321ae8,'mxCell'));}function initGraph(_0x34569c,_0x353fb6){var _0x3194fa=new Graph();for(var _0x3a7052 in _0x34569c){if(_0x34569c[_0xa3c1('0x20')](_0x3a7052)){if(_[_0xa3c1('0x24')](_0x34569c[_0x3a7052])){for(var _0x11d226=0x0;_0x11d226<_0x34569c[_0x3a7052][_0xa3c1('0x25')];_0x11d226+=0x1){addVertex(_0x3194fa,_0x34569c[_0x3a7052][_0x11d226],_0x3a7052);}}else{addVertex(_0x3194fa,_0x34569c[_0x3a7052],_0x3a7052);}}}for(var _0x54d233=0x0;_0x54d233<_0x353fb6[_0xa3c1('0x25')];_0x54d233+=0x1){if(_0x353fb6[_0x54d233][_0xa3c1('0x26')]&&_0x353fb6[_0x54d233][_0xa3c1('0x27')]){_0x3194fa[_0xa3c1('0x28')](_0x353fb6[_0x54d233][_0xa3c1('0x26')],_0x353fb6[_0x54d233][_0xa3c1('0x27')],_0x353fb6[_0x54d233][_0xa3c1('0x29')]);}}return _0x3194fa;}function getSquareProject(_0x409d12,_0x3d440f){rpc[_0xa3c1('0x2a')](_0x409d12)[_0xa3c1('0x2b')](function(_0x38fe18){_0x3d440f(null,_0x38fe18);})[_0xa3c1('0x2c')](function(_0x257afe){_0x3d440f(null,_0x257afe);});}function createSquareReport(_0x15660c,_0x4cde8c){rpc[_0xa3c1('0x2d')](_0x15660c)[_0xa3c1('0x2b')](function(_0x15a8f3){if(_0x4cde8c){_0x4cde8c(null,_0x15a8f3);}})[_0xa3c1('0x2c')](function(_0x42e7b4){if(_0x4cde8c){_0x4cde8c(null,_0x42e7b4);}});}function setChannelVariables(_0x19e4be){for(var _0x4391b9 in _0x19e4be){if(_0x19e4be[_0xa3c1('0x20')](_0x4391b9)){if(_0x4391b9[_0xa3c1('0x2e')]('agi_')===0x0){_0x19e4be[_0x4391b9[_0xa3c1('0x2f')](0x4)]=_0x19e4be[_0x4391b9];delete _0x19e4be[_0x4391b9];}}}}function getLogFromObject(_0x474583){return util[_0xa3c1('0x30')](_0x474583,{'showHidden':![],'depth':null});}function agiHandler(_0xd693a5){var _0x8d98ee,_0x18db67,_0x19430c,_0x19da4b,_0xdfc44a;logger[_0xa3c1('0x31')](_0xa3c1('0x32'),JSON[_0xa3c1('0x33')](_0xd693a5,null,0x2));logger[_0xa3c1('0x17')](util['format'](_0xa3c1('0x34'),_0xd693a5[_0xa3c1('0x19')],_0xd693a5['calleridname'],_0xd693a5[_0xa3c1('0x35')],_0xd693a5['dnid'],_0xd693a5['uniqueid']));_0xd693a5['on'](_0xa3c1('0xe'),errorHandler);_0xd693a5['on'](_0xa3c1('0x36'),closeHandler);_0xd693a5['on']('timeout',timeoutHandler);_0xd693a5[_0xa3c1('0x37')]=![];_0xd693a5['on']('hangup',hangupHandler);var _0x4f27d4=getSquareProject['sync'](null,_0xd693a5[_0xa3c1('0x19')]);if(_0x4f27d4){if(_0x4f27d4['production']){_0x8d98ee=getRoot(_0x4f27d4[_0xa3c1('0x38')]);console[_0xa3c1('0xf')]('SQUAREROOT',_0x8d98ee);if(_0x8d98ee&&_0x8d98ee['start']){logger[_0xa3c1('0x31')](_0xa3c1('0x1e'),JSON[_0xa3c1('0x33')](_0x8d98ee,null,0x2));_0xd693a5['joinAt']=moment()[_0xa3c1('0x10')](_0xa3c1('0x39'));_0x18db67=initGraph(_[_0xa3c1('0x23')](_0x8d98ee,_0xa3c1('0x3a')),_0x8d98ee['mxCell']);_0x19430c=new Vertices(_0xd693a5,rpc,mailRpc);console[_0xa3c1('0xf')](_0xa3c1('0x3b'),_0x19430c);logger[_0xa3c1('0x17')](util[_0xa3c1('0x10')](_0xa3c1('0x3c'),_0xd693a5[_0xa3c1('0x19')],_0xd693a5['calleridname'],_0xd693a5[_0xa3c1('0x35')],_0xd693a5['dnid'],_0xd693a5[_0xa3c1('0x3d')]));console[_0xa3c1('0xf')](_0xa3c1('0x3e'));_0x18db67[_0xa3c1('0x3f')](_0x8d98ee[_0xa3c1('0x40')]['id'],function(_0x3cf736){try{_0x3cf736=_0x19430c[_0xa3c1('0x41')](_0x3cf736);logger['debug'](_0xa3c1('0x42'),JSON[_0xa3c1('0x33')](_0x3cf736,null,0x2));console[_0xa3c1('0xf')](_0xa3c1('0x43'),_0x3cf736);if(_0x3cf736[_0xa3c1('0x1f')]===_0xa3c1('0x44')){logger[_0xa3c1('0x17')](_0xa3c1('0x45'));_0xd693a5['context']=_0x3cf736['context']||_0xd693a5[_0xa3c1('0x46')];_0xd693a5[_0xa3c1('0x47')]=_0x3cf736[_0xa3c1('0x47')];_0xd693a5[_0xa3c1('0x48')]=_0x3cf736[_0xa3c1('0x48')]?_0x3cf736[_0xa3c1('0x48')]-0x1:0x1;return null;}else if(_0x3cf736&&_0x19430c[_0x3cf736['agicommand']]){_0xdfc44a=_0x19430c[_0x3cf736[_0xa3c1('0x1f')]](_0x3cf736);console[_0xa3c1('0xf')](_0xa3c1('0x49'),_0xdfc44a);logger[_0xa3c1('0x17')](_0xa3c1('0x4a'),JSON[_0xa3c1('0x33')](_0xdfc44a,null,0x2));if(_0xdfc44a&&_0xdfc44a[_0xa3c1('0x4b')]===AGI_CODE_SUCCESS&&_0xdfc44a[_0xa3c1('0x4c')]!==AGI_RESULT_ERROR&&!_0xd693a5[_0xa3c1('0x37')]){logger[_0xa3c1('0x31')](_0xa3c1('0x4a'),getLogFromObject(_0xdfc44a));return _[_0xa3c1('0x4d')](_0xdfc44a[_0xa3c1('0x4c')])?null:_0xdfc44a[_0xa3c1('0x4c')]['toString']();}else{logger[_0xa3c1('0xe')](_0xa3c1('0x4a'),getLogFromObject(_0xdfc44a));return null;}}else{logger[_0xa3c1('0xe')](_0xa3c1('0x4e'));return null;}}catch(_0x329645){logger[_0xa3c1('0xe')](_0x329645['stack']);return null;}});if(_0x8d98ee['finally']){logger['info'](util['format'](_0xa3c1('0x4f'),_0xd693a5[_0xa3c1('0x19')],_0xd693a5[_0xa3c1('0x1b')],_0xd693a5[_0xa3c1('0x35')],_0xd693a5['dnid'],_0xd693a5[_0xa3c1('0x3d')]));_0x18db67[_0xa3c1('0x3f')](_0x8d98ee[_0xa3c1('0x50')]['id'],function(_0x3c068e){try{_0x3c068e=_0x19430c[_0xa3c1('0x41')](_0x3c068e);logger[_0xa3c1('0x31')](_0xa3c1('0x42'),JSON[_0xa3c1('0x33')](_0x3c068e,null,0x2));if(_0x3c068e&&_0x19430c[_0x3c068e[_0xa3c1('0x1f')]]){_0xdfc44a=_0x19430c[_0x3c068e[_0xa3c1('0x1f')]](_0x3c068e);if(_0xdfc44a){logger[_0xa3c1('0x31')](_0xa3c1('0x4a'),getLogFromObject(_0xdfc44a));return _[_0xa3c1('0x4d')](_0xdfc44a[_0xa3c1('0x4c')])?null:_0xdfc44a[_0xa3c1('0x4c')][_0xa3c1('0x51')]();}else{logger['error'](_0xa3c1('0x4a'),getLogFromObject(_0xdfc44a));return null;}}else{logger[_0xa3c1('0xe')](_0xa3c1('0x4e'));return null;}}catch(_0x211f7f){logger[_0xa3c1('0xe')](_0x211f7f[_0xa3c1('0x16')]);return null;}});}logger[_0xa3c1('0x17')](util['format'](_0xa3c1('0x52'),_0xd693a5[_0xa3c1('0x19')],_0xd693a5[_0xa3c1('0x1b')],_0xd693a5[_0xa3c1('0x35')],_0xd693a5[_0xa3c1('0x1a')],_0xd693a5[_0xa3c1('0x3d')]));logger['info'](util[_0xa3c1('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0xd693a5['context'],_0xd693a5[_0xa3c1('0x47')],parseInt(_0xd693a5[_0xa3c1('0x48')],0xa)+0x1));_0xd693a5[_0xa3c1('0x53')](_0xd693a5[_0xa3c1('0x46')],_0xd693a5[_0xa3c1('0x47')],parseInt(_0xd693a5[_0xa3c1('0x48')],0xa)+0x1);_0xd693a5[_0xa3c1('0x36')]();}}else{logger['error'](util[_0xa3c1('0x10')](_0xa3c1('0x54'),_0xd693a5[_0xa3c1('0x19')]));_0xd693a5[_0xa3c1('0x53')](_0xd693a5[_0xa3c1('0x46')],_0xd693a5[_0xa3c1('0x47')],parseInt(_0xd693a5[_0xa3c1('0x48')],0xa)+0x1);_0xd693a5[_0xa3c1('0x36')]();}}else{logger['error'](util[_0xa3c1('0x10')](_0xa3c1('0x55'),_0xd693a5[_0xa3c1('0x19')]));_0xd693a5[_0xa3c1('0x53')](_0xd693a5[_0xa3c1('0x46')],_0xd693a5[_0xa3c1('0x47')],parseInt(_0xd693a5['priority'],0xa)+0x1);_0xd693a5[_0xa3c1('0x36')]();}}function main(){var _0xc1521d;return utilLicense['getLicense']()[_0xa3c1('0x2b')](function(_0x560291){if(_0x560291){if(_0x560291[_0xa3c1('0x56')]){if(_0x560291['callysquare']&&_0x560291[_0xa3c1('0x57')]>0x0){logger[_0xa3c1('0x17')](util[_0xa3c1('0x10')](_0xa3c1('0x58'),_0x560291[_0xa3c1('0x57')]));_0xc1521d=_0x560291[_0xa3c1('0x57')];}else{logger[_0xa3c1('0x17')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xa3c1('0x17')](_0xa3c1('0x59'));_0xc1521d=-0x1;}}})[_0xa3c1('0x2c')](function(_0x22746e){logger[_0xa3c1('0xe')](_0xa3c1('0x5a'),_0x22746e[_0xa3c1('0x16')]);})['finally'](function(){var _0x18e833=require(_0xa3c1('0x5b'))(config[_0xa3c1('0xb')][_0xa3c1('0x12')],config[_0xa3c1('0xb')]['ip'],_0xc1521d);_0x18e833['on'](_0xa3c1('0xe'),errorHandler);_0x18e833['on'](_0xa3c1('0x5c'),listeningHandler);_0x18e833['on'](_0xa3c1('0x5d'),connectionHandler);_0x18e833['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0x9fda=['getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','stringify','close','timeout','sync','SQUAREROOT','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','vertices','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','LOOP\x20through\x20graph','traverseBFS','clear','VERTEX','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./graph','./vertices','agi','127.0.0.1','nextTick','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[%s]\x20%s','format','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','calleridname','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','addEdge','target'];(function(_0x35da0e,_0x3b28ed){var _0x5dff00=function(_0x4c7d7e){while(--_0x4c7d7e){_0x35da0e['push'](_0x35da0e['shift']());}};_0x5dff00(++_0x3b28ed);}(_0x9fda,0x8c));var _0xa9fd=function(_0x214c18,_0x1b92a3){_0x214c18=_0x214c18-0x0;var _0x1bdaac=_0x9fda[_0x214c18];return _0x1bdaac;};'use strict';var parser=require(_0xa9fd('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0xa9fd('0x1'));var moment=require(_0xa9fd('0x2'));var config=require(_0xa9fd('0x3'));var logger=require(_0xa9fd('0x4'))('agi');var utilLicense=require(_0xa9fd('0x5'));var rpc=require(_0xa9fd('0x6'));var mailRpc=require('./mailRpc');var Graph=require(_0xa9fd('0x7'));var Vertices=require(_0xa9fd('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0xa9fd('0x9')],{'ip':_0xa9fd('0xa'),'port':0x11dd});function connectionHandler(_0x4072e3){process[_0xa9fd('0xb')](function(){syncho(function(){try{setChannelVariables(_0x4072e3);agiHandler(_0x4072e3);}catch(_0x2c019e){logger['error'](_0x2c019e[_0xa9fd('0xc')]);}});});}function listeningHandler(){console[_0xa9fd('0xd')](_0xa9fd('0xe'),config['agi'][_0xa9fd('0xf')]);logger['info'](util['format'](_0xa9fd('0x10'),config[_0xa9fd('0x9')]['ip'],config[_0xa9fd('0x9')]['port']));}function errorHandler(_0x26f631){if(_0x26f631&&_0x26f631[_0xa9fd('0x11')]&&_0x26f631[_0xa9fd('0x12')]){logger[_0xa9fd('0x13')](util['format'](_0xa9fd('0x14'),_0x26f631[_0xa9fd('0x11')],_0x26f631[_0xa9fd('0x12')]));}else{logger[_0xa9fd('0x13')](util[_0xa9fd('0x15')](_0xa9fd('0x16'),_0x26f631[_0xa9fd('0xc')]));}}function closeHandler(){logger[_0xa9fd('0x17')](util['format'](_0xa9fd('0x18'),this[_0xa9fd('0x19')],this['calleridname'],this['callerid'],this[_0xa9fd('0x1a')],this[_0xa9fd('0x1b')]));try{createSquareReport(this);}catch(_0x431f80){logger[_0xa9fd('0x13')](_0x431f80[_0xa9fd('0xc')]);}}function timeoutHandler(){logger[_0xa9fd('0x17')](util[_0xa9fd('0x15')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xa9fd('0x1c')],this[_0xa9fd('0x1d')],this[_0xa9fd('0x1a')],this[_0xa9fd('0x1b')]));}function hangupHandler(){logger[_0xa9fd('0x17')](util[_0xa9fd('0x15')](_0xa9fd('0x1e'),this['arg_1'],this[_0xa9fd('0x1c')],this['callerid'],this['dnid'],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x257cc0){return parser[_0xa9fd('0x1f')](_0x257cc0,{'object':!![]})[_0xa9fd('0x20')][_0xa9fd('0x21')];}function addVertex(_0x38af9a,_0x53ce13,_0x165b02){_0x53ce13[_0xa9fd('0x22')]=_0x165b02;if(_0x53ce13['hasOwnProperty'](_0xa9fd('0x23'))){_0x53ce13[_0xa9fd('0x24')]=parseInt(_0x53ce13[_0xa9fd('0x23')],0xa);}_0x38af9a[_0xa9fd('0x25')](_[_0xa9fd('0x26')](_0x53ce13,_0xa9fd('0x27')));}function initGraph(_0x44a525,_0x17d70f){var _0xddf48d=new Graph();for(var _0x249484 in _0x44a525){if(_0x44a525[_0xa9fd('0x28')](_0x249484)){if(_[_0xa9fd('0x29')](_0x44a525[_0x249484])){for(var _0x43098d=0x0;_0x43098d<_0x44a525[_0x249484][_0xa9fd('0x2a')];_0x43098d+=0x1){addVertex(_0xddf48d,_0x44a525[_0x249484][_0x43098d],_0x249484);}}else{addVertex(_0xddf48d,_0x44a525[_0x249484],_0x249484);}}}for(var _0xe12216=0x0;_0xe12216<_0x17d70f[_0xa9fd('0x2a')];_0xe12216+=0x1){if(_0x17d70f[_0xe12216][_0xa9fd('0x2b')]&&_0x17d70f[_0xe12216]['target']){_0xddf48d[_0xa9fd('0x2c')](_0x17d70f[_0xe12216][_0xa9fd('0x2b')],_0x17d70f[_0xe12216][_0xa9fd('0x2d')],_0x17d70f[_0xe12216]['value']);}}return _0xddf48d;}function getSquareProject(_0x23b96b,_0x1fb141){rpc[_0xa9fd('0x2e')](_0x23b96b)[_0xa9fd('0x2f')](function(_0x1ff8ec){_0x1fb141(null,_0x1ff8ec);})[_0xa9fd('0x30')](function(_0x34480a){_0x1fb141(null,_0x34480a);});}function createSquareReport(_0x5f1cda,_0x22a904){rpc[_0xa9fd('0x31')](_0x5f1cda)[_0xa9fd('0x2f')](function(_0x5604d8){if(_0x22a904){_0x22a904(null,_0x5604d8);}})[_0xa9fd('0x30')](function(_0x151ee8){if(_0x22a904){_0x22a904(null,_0x151ee8);}});}function setChannelVariables(_0x45d0fd){for(var _0x189b77 in _0x45d0fd){if(_0x45d0fd['hasOwnProperty'](_0x189b77)){if(_0x189b77[_0xa9fd('0x32')](_0xa9fd('0x33'))===0x0){_0x45d0fd[_0x189b77[_0xa9fd('0x34')](0x4)]=_0x45d0fd[_0x189b77];delete _0x45d0fd[_0x189b77];}}}}function getLogFromObject(_0x38199f){return util[_0xa9fd('0x35')](_0x38199f,{'showHidden':![],'depth':null});}function agiHandler(_0xa17848){var _0x54a271,_0x4809c8,_0xd687af,_0x4582d9,_0x2e4bf1;logger[_0xa9fd('0x36')]('variables',JSON[_0xa9fd('0x37')](_0xa17848,null,0x2));logger['info'](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xa17848[_0xa9fd('0x19')],_0xa17848[_0xa9fd('0x1c')],_0xa17848['callerid'],_0xa17848[_0xa9fd('0x1a')],_0xa17848[_0xa9fd('0x1b')]));_0xa17848['on'](_0xa9fd('0x13'),errorHandler);_0xa17848['on'](_0xa9fd('0x38'),closeHandler);_0xa17848['on'](_0xa9fd('0x39'),timeoutHandler);_0xa17848['evtHangup']=![];_0xa17848['on']('hangup',hangupHandler);var _0x509b7d=getSquareProject[_0xa9fd('0x3a')](null,_0xa17848[_0xa9fd('0x19')]);if(_0x509b7d){if(_0x509b7d['production']){_0x54a271=getRoot(_0x509b7d['production']);console[_0xa9fd('0xd')](_0xa9fd('0x3b'),_0x54a271);if(_0x54a271&&_0x54a271[_0xa9fd('0x3c')]){logger[_0xa9fd('0x36')](_0xa9fd('0x21'),JSON[_0xa9fd('0x37')](_0x54a271,null,0x2));_0xa17848[_0xa9fd('0x3d')]=moment()[_0xa9fd('0x15')](_0xa9fd('0x3e'));_0x4809c8=initGraph(_[_0xa9fd('0x26')](_0x54a271,_0xa9fd('0x27')),_0x54a271[_0xa9fd('0x27')]);_0xd687af=new Vertices(_0xa17848,rpc,mailRpc);console['log'](_0xa9fd('0x3f'),_0xd687af);logger[_0xa9fd('0x17')](util['format'](_0xa9fd('0x40'),_0xa17848[_0xa9fd('0x19')],_0xa17848[_0xa9fd('0x1c')],_0xa17848[_0xa9fd('0x1d')],_0xa17848[_0xa9fd('0x1a')],_0xa17848['uniqueid']));console[_0xa9fd('0xd')](_0xa9fd('0x41'));_0x4809c8[_0xa9fd('0x42')](_0x54a271[_0xa9fd('0x3c')]['id'],function(_0x5c164a){try{_0x5c164a=_0xd687af[_0xa9fd('0x43')](_0x5c164a);logger[_0xa9fd('0x36')]('vertex',JSON[_0xa9fd('0x37')](_0x5c164a,null,0x2));console[_0xa9fd('0xd')](_0xa9fd('0x44'),_0x5c164a);if(_0x5c164a[_0xa9fd('0x22')]==='gotoc'){logger[_0xa9fd('0x17')](_0xa9fd('0x45'));_0xa17848[_0xa9fd('0x46')]=_0x5c164a[_0xa9fd('0x46')]||_0xa17848['context'];_0xa17848['extension']=_0x5c164a[_0xa9fd('0x47')];_0xa17848[_0xa9fd('0x48')]=_0x5c164a[_0xa9fd('0x48')]?_0x5c164a[_0xa9fd('0x48')]-0x1:0x1;return null;}else if(_0x5c164a&&_0xd687af[_0x5c164a[_0xa9fd('0x22')]]){_0x2e4bf1=_0xd687af[_0x5c164a[_0xa9fd('0x22')]](_0x5c164a);console[_0xa9fd('0xd')]('vresponse',_0x2e4bf1);logger[_0xa9fd('0x17')](_0xa9fd('0x49'),JSON[_0xa9fd('0x37')](_0x2e4bf1,null,0x2));if(_0x2e4bf1&&_0x2e4bf1[_0xa9fd('0x4a')]===AGI_CODE_SUCCESS&&_0x2e4bf1[_0xa9fd('0x4b')]!==AGI_RESULT_ERROR&&!_0xa17848['evtHangup']){logger['debug'](_0xa9fd('0x49'),getLogFromObject(_0x2e4bf1));return _[_0xa9fd('0x4c')](_0x2e4bf1[_0xa9fd('0x4b')])?null:_0x2e4bf1['result'][_0xa9fd('0x4d')]();}else{logger[_0xa9fd('0x13')]('response',getLogFromObject(_0x2e4bf1));return null;}}else{logger[_0xa9fd('0x13')](_0xa9fd('0x4e'));return null;}}catch(_0x220206){logger[_0xa9fd('0x13')](_0x220206['stack']);return null;}});if(_0x54a271[_0xa9fd('0x4f')]){logger[_0xa9fd('0x17')](util['format'](_0xa9fd('0x50'),_0xa17848[_0xa9fd('0x19')],_0xa17848[_0xa9fd('0x1c')],_0xa17848[_0xa9fd('0x1d')],_0xa17848[_0xa9fd('0x1a')],_0xa17848[_0xa9fd('0x1b')]));_0x4809c8[_0xa9fd('0x42')](_0x54a271[_0xa9fd('0x4f')]['id'],function(_0x5ce583){try{_0x5ce583=_0xd687af[_0xa9fd('0x43')](_0x5ce583);logger[_0xa9fd('0x36')](_0xa9fd('0x51'),JSON[_0xa9fd('0x37')](_0x5ce583,null,0x2));if(_0x5ce583&&_0xd687af[_0x5ce583[_0xa9fd('0x22')]]){_0x2e4bf1=_0xd687af[_0x5ce583[_0xa9fd('0x22')]](_0x5ce583);if(_0x2e4bf1){logger[_0xa9fd('0x36')]('response',getLogFromObject(_0x2e4bf1));return _[_0xa9fd('0x4c')](_0x2e4bf1[_0xa9fd('0x4b')])?null:_0x2e4bf1['result'][_0xa9fd('0x4d')]();}else{logger[_0xa9fd('0x13')]('response',getLogFromObject(_0x2e4bf1));return null;}}else{logger[_0xa9fd('0x13')](_0xa9fd('0x4e'));return null;}}catch(_0x35c0e7){logger[_0xa9fd('0x13')](_0x35c0e7[_0xa9fd('0xc')]);return null;}});}logger[_0xa9fd('0x17')](util[_0xa9fd('0x15')](_0xa9fd('0x52'),_0xa17848[_0xa9fd('0x19')],_0xa17848[_0xa9fd('0x1c')],_0xa17848[_0xa9fd('0x1d')],_0xa17848[_0xa9fd('0x1a')],_0xa17848[_0xa9fd('0x1b')]));logger['info'](util[_0xa9fd('0x15')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0xa17848[_0xa9fd('0x46')],_0xa17848[_0xa9fd('0x47')],parseInt(_0xa17848['priority'],0xa)+0x1));_0xa17848[_0xa9fd('0x53')](_0xa17848[_0xa9fd('0x46')],_0xa17848[_0xa9fd('0x47')],parseInt(_0xa17848[_0xa9fd('0x48')],0xa)+0x1);_0xa17848[_0xa9fd('0x38')]();}}else{logger['error'](util[_0xa9fd('0x15')](_0xa9fd('0x54'),_0xa17848[_0xa9fd('0x19')]));_0xa17848[_0xa9fd('0x53')](_0xa17848[_0xa9fd('0x46')],_0xa17848[_0xa9fd('0x47')],parseInt(_0xa17848['priority'],0xa)+0x1);_0xa17848[_0xa9fd('0x38')]();}}else{logger[_0xa9fd('0x13')](util[_0xa9fd('0x15')]('Project\x20%s\x20not\x20found',_0xa17848[_0xa9fd('0x19')]));_0xa17848[_0xa9fd('0x53')](_0xa17848[_0xa9fd('0x46')],_0xa17848[_0xa9fd('0x47')],parseInt(_0xa17848[_0xa9fd('0x48')],0xa)+0x1);_0xa17848[_0xa9fd('0x38')]();}}function main(){var _0x467231;return utilLicense[_0xa9fd('0x55')]()[_0xa9fd('0x2f')](function(_0x1a520e){if(_0x1a520e){if(_0x1a520e['voice']){if(_0x1a520e[_0xa9fd('0x56')]&&_0x1a520e['callysquare']>0x0){logger[_0xa9fd('0x17')](util[_0xa9fd('0x15')](_0xa9fd('0x57'),_0x1a520e['callysquare']));_0x467231=_0x1a520e[_0xa9fd('0x56')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xa9fd('0x17')](_0xa9fd('0x58'));_0x467231=-0x1;}}})[_0xa9fd('0x30')](function(_0x9c8c94){logger[_0xa9fd('0x13')](_0xa9fd('0x59'),_0x9c8c94[_0xa9fd('0xc')]);})[_0xa9fd('0x4f')](function(){var _0x268c34=require(_0xa9fd('0x5a'))(config[_0xa9fd('0x9')][_0xa9fd('0xf')],config[_0xa9fd('0x9')]['ip'],_0x467231);_0x268c34['on'](_0xa9fd('0x13'),errorHandler);_0x268c34['on'](_0xa9fd('0x5b'),listeningHandler);_0x268c34['on'](_0xa9fd('0x5c'),connectionHandler);_0x268c34['on'](_0xa9fd('0x38'),closeHandler);});}main();
\ No newline at end of file
diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js
index 98a0229..6b05826 100644
--- a/server/services/agi/mailRpc/index.js
+++ b/server/services/agi/mailRpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x51b0fc,_0xfc3203){var _0x10c36d=function(_0x40c79b){while(--_0x40c79b){_0x51b0fc['push'](_0x51b0fc['shift']());}};_0x10c36d(++_0xfc3203);}(_0x34e8,0x12c));var _0x834e=function(_0x17fba1,_0x21937c){_0x17fba1=_0x17fba1-0x0;var _0x2f6bc4=_0x34e8[_0x17fba1];return _0x2f6bc4;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});};
\ No newline at end of file
+var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x48365d,_0xd358da){var _0x453dad=function(_0x2fd071){while(--_0x2fd071){_0x48365d['push'](_0x48365d['shift']());}};_0x453dad(++_0xd358da);}(_0x814b,0x1a2));var _0xb814=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0x814b[_0x4aa838];return _0x3abff0;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});};
\ No newline at end of file
diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js
index 1a13b4b..33a7ea8 100644
--- a/server/services/agi/reply.js
+++ b/server/services/agi/reply.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x40a988,_0x1ff48e){var _0x1b6054=function(_0x5b8c30){while(--_0x5b8c30){_0x40a988['push'](_0x40a988['shift']());}};_0x1b6054(++_0x1ff48e);}(_0x7a54,0x106));var _0x47a5=function(_0x2ea283,_0x4777ff){_0x2ea283=_0x2ea283-0x0;var _0x110e57=_0x7a54[_0x2ea283];return _0x110e57;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply;
\ No newline at end of file
+var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0xb68695,_0x1881a4){var _0x15a817=function(_0x4d04d6){while(--_0x4d04d6){_0xb68695['push'](_0xb68695['shift']());}};_0x15a817(++_0x1881a4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c48a8,_0x2fecf7){_0x2c48a8=_0x2c48a8-0x0;var _0x1a6b65=_0x5f2f[_0x2c48a8];return _0x1a6b65;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply;
\ No newline at end of file
diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js
index 39dd3a7..880c954 100644
--- a/server/services/agi/rpc/index.js
+++ b/server/services/agi/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8790=['MailServerOut','Smtp','name','email','ShowVoiceQueue','getVariableById','ShowVariable','dsn','getUserById','ShowUser','getContactByPhone','log','rpcreq','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','createSquareRecording','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentUnpause','agentLogout','LogoutUser','moment','lodash','util','jayson/promise','http','request','then','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8790,0x67));var _0x0879=function(_0x515bea,_0x4a59ef){_0x515bea=_0x515bea-0x0;var _0x8e643b=_0x8790[_0x515bea];return _0x8e643b;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0879('0x0'));var _=require(_0x0879('0x1'));var util=require(_0x0879('0x2'));var jayson=require(_0x0879('0x3'));var client=jayson['client'][_0x0879('0x4')]({'port':0x2329});function request(_0x49872f,_0xf0f4f3){return new BPromise(function(_0x1bb6bc,_0xa22d24){return client[_0x0879('0x5')](_0x49872f,_0xf0f4f3)[_0x0879('0x6')](function(_0x2036e5){if(_0x2036e5[_0x0879('0x7')]){return _0xa22d24(_0x2036e5[_0x0879('0x7')][_0x0879('0x8')]);}else{return _0x1bb6bc(_0x2036e5[_0x0879('0x9')]);}})['catch'](function(_0x3fba0d){return _0xa22d24(_0x3fba0d);});});}exports[_0x0879('0xa')]=function(_0x3fcd8a){return request(_0x0879('0xb'),{'options':{'raw':![],'where':{'name':_0x3fcd8a},'attributes':[_0x0879('0xc')]}});};exports[_0x0879('0xd')]=function(_0x1f73d1){return request(_0x0879('0xe'),{'options':{'raw':![],'where':{'id':_0x1f73d1},'include':[{'model':_0x0879('0xf'),'as':_0x0879('0x10')}],'attributes':['id',_0x0879('0x11'),_0x0879('0x12')]}});};exports['getSquareProjectById']=function(_0x58dbe0){return request(_0x0879('0xb'),{'options':{'where':{'id':_0x58dbe0},'attributes':[_0x0879('0x11')]}});};exports['getVoiceQueueById']=function(_0x44f464){return request(_0x0879('0x13'),{'options':{'where':{'id':_0x44f464},'attributes':[_0x0879('0x11')]}});};exports[_0x0879('0x14')]=function(_0xf8002f){return request(_0x0879('0x15'),{'options':{'where':{'id':_0xf8002f},'attributes':[_0x0879('0x11')]}});};exports['getSquareOdbcById']=function(_0x7995cd){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x7995cd},'attributes':[_0x0879('0x16')]}});};exports[_0x0879('0x17')]=function(_0x36eab2){return request(_0x0879('0x18'),{'options':{'where':{'id':_0x36eab2},'attributes':['name']}});};exports[_0x0879('0x19')]=function(_0x4a7332){console[_0x0879('0x1a')](_0x0879('0x1b'),_0x4a7332);return request(_0x0879('0x1c'),{'options':{'where':{'phone':_0x4a7332[_0x0879('0x1d')]},'attributes':['id']}});};exports[_0x0879('0x1e')]=function(_0x45165b){return request('ShowTrunk',{'options':{'where':{'id':_0x45165b},'attributes':[_0x0879('0x11')]}});};exports[_0x0879('0x1f')]=function(_0x23eed5){return request(_0x0879('0x20'),{'options':{'where':{'id':_0x23eed5},'attributes':[_0x0879('0x21')]}});};exports[_0x0879('0x22')]=function(_0x261ee9){return request(_0x0879('0x23'),{'options':{'raw':![],'where':{'id':_0x261ee9},'include':[{'model':_0x0879('0x24'),'as':_0x0879('0x25')}]}});};exports[_0x0879('0x26')]=function(_0x4941ca){return request(_0x0879('0x27'),{'options':{'where':{'id':_0x4941ca},'attributes':['id',_0x0879('0x11')]}});};exports['createSmsMessage']=function(_0x3bfc6){return request(_0x0879('0x28'),{'body':_0x3bfc6});};exports[_0x0879('0x29')]=function(_0x55ec5b){return request(_0x0879('0x2a'),{'body':_0x55ec5b});};exports[_0x0879('0x2b')]=function(_0xe30d18){return request(_0x0879('0x2c'),{'body':_[_0x0879('0x2d')](_0xe30d18,{'project_name':_0xe30d18[_0x0879('0x2e')],'prev_project_name':_0xe30d18[_0x0879('0x2f')]||'','is_subproject':_0xe30d18[_0x0879('0x2f')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x0879('0x30')]=function(_0x1809f2){return request('CreateSquareRecording',{'body':_0x1809f2});};exports['createSquareMessage']=function(_0x351cb7){return request(_0x0879('0x31'),{'body':_0x351cb7});};exports['createCmContact']=function(_0x24fd7f){return request(_0x0879('0x32'),{'options':{'raw':![],'where':{'phone':_0x24fd7f['phone'],'ListId':_0x24fd7f[_0x0879('0x33')]}}})[_0x0879('0x6')](function(_0x5c1046){if(_0x5c1046){return _0x5c1046;}return request(_0x0879('0x34'),{'body':_0x24fd7f});});};exports['getPauseById']=function(_0x535719){return request(_0x0879('0x35'),{'options':{'where':{'id':_0x535719},'attributes':['name']}});};exports[_0x0879('0x36')]=function(_0xbf7e5d,_0x37fcd7){return request(_0x0879('0x37'),{'body':{'interface':_0x37fcd7},'options':{'where':_0xbf7e5d}});};exports['agentPause']=function(_0x8b86dd,_0x30df96,_0x54f3fa){return request('PauseUser',{'body':{'type':_0x30df96,'uniqueid':_0x54f3fa},'options':{'where':_0x8b86dd}});};exports[_0x0879('0x38')]=function(_0x272297){return request('UnpauseUser',{'body':{},'options':{'where':_0x272297}});};exports[_0x0879('0x39')]=function(_0x897935){return request(_0x0879('0x3a'),{'body':{},'options':{'where':_0x897935}});};
\ No newline at end of file
+var _0x34b6=['getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','lodash','client','http','request','then','error','message','result','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','log','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x34b6,0x93));var _0x634b=function(_0x577386,_0xba5a03){_0x577386=_0x577386-0x0;var _0x465313=_0x34b6[_0x577386];return _0x465313;};'use strict';var BPromise=require(_0x634b('0x0'));var moment=require('moment');var _=require(_0x634b('0x1'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x634b('0x2')][_0x634b('0x3')]({'port':0x2329});function request(_0x5aa4c7,_0x17bc85){return new BPromise(function(_0x20a06e,_0x32e0ce){return client[_0x634b('0x4')](_0x5aa4c7,_0x17bc85)[_0x634b('0x5')](function(_0x31f291){if(_0x31f291[_0x634b('0x6')]){return _0x32e0ce(_0x31f291[_0x634b('0x6')][_0x634b('0x7')]);}else{return _0x20a06e(_0x31f291[_0x634b('0x8')]);}})['catch'](function(_0x22eb0c){return _0x32e0ce(_0x22eb0c);});});}exports[_0x634b('0x9')]=function(_0x3d4869){return request(_0x634b('0xa'),{'options':{'raw':![],'where':{'name':_0x3d4869},'attributes':['production']}});};exports[_0x634b('0xb')]=function(_0x557a5d){return request(_0x634b('0xc'),{'options':{'raw':![],'where':{'id':_0x557a5d},'include':[{'model':_0x634b('0xd'),'as':_0x634b('0xe')}],'attributes':['id',_0x634b('0xf'),_0x634b('0x10')]}});};exports[_0x634b('0x11')]=function(_0x26ab14){return request('ShowSquareProject',{'options':{'where':{'id':_0x26ab14},'attributes':['name']}});};exports[_0x634b('0x12')]=function(_0x5ed5e0){return request(_0x634b('0x13'),{'options':{'where':{'id':_0x5ed5e0},'attributes':[_0x634b('0xf')]}});};exports['getVariableById']=function(_0x11a60b){return request(_0x634b('0x14'),{'options':{'where':{'id':_0x11a60b},'attributes':[_0x634b('0xf')]}});};exports[_0x634b('0x15')]=function(_0x4c7c69){return request(_0x634b('0x16'),{'options':{'where':{'id':_0x4c7c69},'attributes':[_0x634b('0x17')]}});};exports[_0x634b('0x18')]=function(_0x4c5f6b){return request('ShowUser',{'options':{'where':{'id':_0x4c5f6b},'attributes':[_0x634b('0xf')]}});};exports[_0x634b('0x19')]=function(_0x5249bf){console[_0x634b('0x1a')]('rpcreq',_0x5249bf);return request('GetContactByPhone',{'options':{'where':{'phone':_0x5249bf[_0x634b('0x1b')]},'attributes':['id']}});};exports[_0x634b('0x1c')]=function(_0x51b9a2){return request(_0x634b('0x1d'),{'options':{'where':{'id':_0x51b9a2},'attributes':[_0x634b('0xf')]}});};exports[_0x634b('0x1e')]=function(_0x3cc10d){return request(_0x634b('0x1f'),{'options':{'where':{'id':_0x3cc10d},'attributes':[_0x634b('0x20')]}});};exports[_0x634b('0x21')]=function(_0x3915df){return request(_0x634b('0x22'),{'options':{'raw':![],'where':{'id':_0x3915df},'include':[{'model':'Interval','as':_0x634b('0x23')}]}});};exports[_0x634b('0x24')]=function(_0x553d47){return request(_0x634b('0x25'),{'options':{'where':{'id':_0x553d47},'attributes':['id',_0x634b('0xf')]}});};exports[_0x634b('0x26')]=function(_0x4d3b6a){return request(_0x634b('0x27'),{'body':_0x4d3b6a});};exports[_0x634b('0x28')]=function(_0x247214){return request(_0x634b('0x29'),{'body':_0x247214});};exports['createSquareReport']=function(_0x21d95f){return request(_0x634b('0x2a'),{'body':_['merge'](_0x21d95f,{'project_name':_0x21d95f[_0x634b('0x2b')],'prev_project_name':_0x21d95f[_0x634b('0x2c')]||'','is_subproject':_0x21d95f[_0x634b('0x2c')]?!![]:![],'leaveAt':moment()[_0x634b('0x2d')](_0x634b('0x2e'))})});};exports[_0x634b('0x2f')]=function(_0x2cc984){return request(_0x634b('0x30'),{'body':_0x2cc984});};exports[_0x634b('0x31')]=function(_0x1badb5){return request('CreateSquareMessage',{'body':_0x1badb5});};exports['createCmContact']=function(_0x4929eb){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x4929eb['phone'],'ListId':_0x4929eb[_0x634b('0x32')]}}})[_0x634b('0x5')](function(_0x1c7924){if(_0x1c7924){return _0x1c7924;}return request(_0x634b('0x33'),{'body':_0x4929eb});});};exports[_0x634b('0x34')]=function(_0x4f9362){return request(_0x634b('0x35'),{'options':{'where':{'id':_0x4f9362},'attributes':['name']}});};exports['agentLogin']=function(_0x4bc4a3,_0x59d41f){return request(_0x634b('0x36'),{'body':{'interface':_0x59d41f},'options':{'where':_0x4bc4a3}});};exports[_0x634b('0x37')]=function(_0x24ed00,_0x174239,_0x22aa2b){return request('PauseUser',{'body':{'type':_0x174239,'uniqueid':_0x22aa2b},'options':{'where':_0x24ed00}});};exports[_0x634b('0x38')]=function(_0x2f51cd){return request(_0x634b('0x39'),{'body':{},'options':{'where':_0x2f51cd}});};exports[_0x634b('0x3a')]=function(_0x33dc11){return request(_0x634b('0x3b'),{'body':{},'options':{'where':_0x33dc11}});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js
index 4b26e39..ae7f57a 100644
--- a/server/services/agi/scripts/aws/index.js
+++ b/server/services/agi/scripts/aws/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['exports','./polly','./lex'];(function(_0x20c1a5,_0x14c8d0){var _0x462ded=function(_0x5f7c66){while(--_0x5f7c66){_0x20c1a5['push'](_0x20c1a5['shift']());}};_0x462ded(++_0x14c8d0);}(_0x70e0,0x17b));var _0x070e=function(_0x3fb793,_0x1c705e){_0x3fb793=_0x3fb793-0x0;var _0x5ec9cc=_0x70e0[_0x3fb793];return _0x5ec9cc;};var polly=require(_0x070e('0x0'));var lex=require(_0x070e('0x1'));module[_0x070e('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xb458=['exports','./polly','./lex'];(function(_0x52e722,_0x596afe){var _0x4c4feb=function(_0x3efd7e){while(--_0x3efd7e){_0x52e722['push'](_0x52e722['shift']());}};_0x4c4feb(++_0x596afe);}(_0xb458,0x103));var _0x8b45=function(_0x3f042d,_0x3d7653){_0x3f042d=_0x3f042d-0x0;var _0x2d91aa=_0xb458[_0x3f042d];return _0x2d91aa;};var polly=require(_0x8b45('0x0'));var lex=require(_0x8b45('0x1'));module[_0x8b45('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js
index 9bee793..c7d568a 100644
--- a/server/services/agi/scripts/aws/lex/index.js
+++ b/server/services/agi/scripts/aws/lex/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc3fe=['exports','./lib/api'];(function(_0x5a62e6,_0x184c1f){var _0x285b3c=function(_0x342134){while(--_0x342134){_0x5a62e6['push'](_0x5a62e6['shift']());}};_0x285b3c(++_0x184c1f);}(_0xc3fe,0xff));var _0xec3f=function(_0x50d48f,_0x2755d3){_0x50d48f=_0x50d48f-0x0;var _0x33f5cf=_0xc3fe[_0x50d48f];return _0x33f5cf;};'use strict';var lex=require(_0xec3f('0x0'));module[_0xec3f('0x1')]=function(_0xc1dd73,_0x4d38a1,_0x15ddf0,_0x2a45d9,_0x2d85fc,_0x553ad4){return lex(_0xc1dd73,_0x4d38a1,_0x15ddf0,_0x2a45d9,_0x2d85fc,_0x553ad4);};
\ No newline at end of file
+var _0xfc03=['./lib/api'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xfc03,0x16f));var _0x3fc0=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfc03[_0x59ee6f];return _0x4c0979;};'use strict';var lex=require(_0x3fc0('0x0'));module['exports']=function(_0x5b3d80,_0x27411e,_0x4a3641,_0x39420d,_0x47eb14,_0x13c308){return lex(_0x5b3d80,_0x27411e,_0x4a3641,_0x39420d,_0x47eb14,_0x13c308);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js
index c892a9d..12954ee 100644
--- a/server/services/agi/scripts/aws/lex/lib/api.js
+++ b/server/services/agi/scripts/aws/lex/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd38=['exports','aws-sdk','slots','slot_'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xbd38,0x14d));var _0x8bd3=function(_0x4f5c95,_0xe3e0c7){_0x4f5c95=_0x4f5c95-0x0;var _0x27c064=_0xbd38[_0x4f5c95];return _0x27c064;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x8bd3('0x0'));function lexResult(_0xd10480,_0x474b1f){return new BPromise(function(_0x2e7a6f,_0x30b2ae){_0xd10480['postText'](_0x474b1f,function(_0x500358,_0xad9e0b){if(_0x500358){_0x30b2ae(_0x500358);}if(_0xad9e0b[_0x8bd3('0x1')]){for(const _0x2f27cd in _0xad9e0b[_0x8bd3('0x1')]){if(_0xad9e0b[_0x8bd3('0x1')]['hasOwnProperty'](_0x2f27cd)){var _0x49b24=_0xad9e0b[_0x8bd3('0x1')][_0x2f27cd];_0xad9e0b[_0x8bd3('0x2')+_0x2f27cd]=_0x49b24;}}}_0x2e7a6f(_0xad9e0b);});});}module[_0x8bd3('0x3')]=function(_0x212613,_0x262c73,_0x38aad6,_0x2d172a,_0x2e580a,_0x14e51f){var _0x175221=new AWS['LexRuntime']({'accessKeyId':_0x262c73,'secretAccessKey':_0x38aad6,'region':_0x2d172a});var _0x20f741={'botAlias':'$LATEST','botName':_0x14e51f,'inputText':_0x2e580a,'userId':_0x212613};return lexResult(_0x175221,_0x20f741);};
\ No newline at end of file
+var _0x75f2=['hasOwnProperty','slot_','exports','bluebird','aws-sdk','postText','slots'];(function(_0xb9fe33,_0x47a545){var _0x15f7c2=function(_0x24f0e3){while(--_0x24f0e3){_0xb9fe33['push'](_0xb9fe33['shift']());}};_0x15f7c2(++_0x47a545);}(_0x75f2,0x168));var _0x275f=function(_0x2f24f5,_0x1f1e4f){_0x2f24f5=_0x2f24f5-0x0;var _0x27bac4=_0x75f2[_0x2f24f5];return _0x27bac4;};'use strict';var BPromise=require(_0x275f('0x0'));var AWS=require(_0x275f('0x1'));function lexResult(_0x10cc57,_0x41ab05){return new BPromise(function(_0x30b241,_0x5e5022){_0x10cc57[_0x275f('0x2')](_0x41ab05,function(_0x190893,_0x28481a){if(_0x190893){_0x5e5022(_0x190893);}if(_0x28481a['slots']){for(const _0x536ecb in _0x28481a[_0x275f('0x3')]){if(_0x28481a['slots'][_0x275f('0x4')](_0x536ecb)){var _0xb4ee2b=_0x28481a[_0x275f('0x3')][_0x536ecb];_0x28481a[_0x275f('0x5')+_0x536ecb]=_0xb4ee2b;}}}_0x30b241(_0x28481a);});});}module[_0x275f('0x6')]=function(_0x3491c3,_0x4940f2,_0x13302d,_0xbdf79a,_0xa1a620,_0x3c6035){var _0x7d2c95=new AWS['LexRuntime']({'accessKeyId':_0x4940f2,'secretAccessKey':_0x13302d,'region':_0xbdf79a});var _0x3de685={'botAlias':'$LATEST','botName':_0x3c6035,'inputText':_0xa1a620,'userId':_0x3491c3};return lexResult(_0x7d2c95,_0x3de685);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js
index b880cf9..86322dc 100644
--- a/server/services/agi/scripts/aws/polly/index.js
+++ b/server/services/agi/scripts/aws/polly/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6519=['./lib/api','exports'];(function(_0x23cca9,_0xc7df47){var _0x449f95=function(_0x161afc){while(--_0x161afc){_0x23cca9['push'](_0x23cca9['shift']());}};_0x449f95(++_0xc7df47);}(_0x6519,0x18a));var _0x9651=function(_0x526818,_0x30c916){_0x526818=_0x526818-0x0;var _0x44c7e3=_0x6519[_0x526818];return _0x44c7e3;};'use strict';var polly=require(_0x9651('0x0'));module[_0x9651('0x1')]=function(_0x59b570,_0x53b49e,_0x51b9de,_0x2d5378,_0x4c8f98,_0x528712,_0x480f94){return polly(_0x59b570,_0x53b49e,_0x51b9de,_0x2d5378,_0x4c8f98,_0x528712,_0x480f94);};
\ No newline at end of file
+var _0x29d4=['./lib/api'];(function(_0x57dab7,_0x186b92){var _0xa6856d=function(_0x4cf925){while(--_0x4cf925){_0x57dab7['push'](_0x57dab7['shift']());}};_0xa6856d(++_0x186b92);}(_0x29d4,0x1a1));var _0x429d=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x29d4[_0x21aec3];return _0x288bbc;};'use strict';var polly=require(_0x429d('0x0'));module['exports']=function(_0x17f867,_0x40881e,_0x16ce75,_0x472fc9,_0x45df1c,_0x4e287b,_0xc3989d){return polly(_0x17f867,_0x40881e,_0x16ce75,_0x472fc9,_0x45df1c,_0x4e287b,_0xc3989d);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js
index 0c2c40e..f63a4f7 100644
--- a/server/services/agi/scripts/aws/polly/lib/api.js
+++ b/server/services/agi/scripts/aws/polly/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f69=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring','aws-sdk','AudioStream'];(function(_0x2b6c72,_0x180fe8){var _0x1f49b5=function(_0x43cb26){while(--_0x43cb26){_0x2b6c72['push'](_0x2b6c72['shift']());}};_0x1f49b5(++_0x180fe8);}(_0x7f69,0x8a));var _0x97f6=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x7f69[_0x8b8564];return _0x360c61;};'use strict';var fs=require('fs');var path=require(_0x97f6('0x0'));var BPromise=require(_0x97f6('0x1'));var rs=require(_0x97f6('0x2'));var AWS=require(_0x97f6('0x3'));function pollyResult(_0x528edb,_0x21f42e,_0x4e15ca){return new BPromise(function(_0x134158,_0x3dfc30){_0x528edb['synthesizeSpeech'](_0x21f42e,function(_0x30c855,_0x58f700){if(_0x30c855){_0x3dfc30(_0x30c855);}else if(_0x58f700){if(_0x58f700[_0x97f6('0x4')]instanceof Buffer){fs[_0x97f6('0x5')](_0x4e15ca,_0x58f700[_0x97f6('0x4')],function(_0x2c6b81){if(_0x2c6b81){_0x3dfc30(_0x2c6b81);}else{_0x134158();}});}else{_0x3dfc30(new Error(_0x97f6('0x6')));}}else{_0x3dfc30(new Error(_0x97f6('0x7')));}});});}module[_0x97f6('0x8')]=function(_0x1029dc,_0x251561,_0xbba2cf,_0x4af085,_0x84a343,_0x5e9ef0,_0x4f735f){var _0x4649fd=new AWS['Polly']({'accessKeyId':_0x1029dc,'secretAccessKey':_0x251561,'region':_0xbba2cf});var _0x11da51={'Text':_0x84a343,'TextType':_0x5e9ef0||_0x97f6('0x9'),'OutputFormat':_0x97f6('0xa'),'VoiceId':_0x4af085};return pollyResult(_0x4649fd,_0x11da51,_0x4f735f);};
\ No newline at end of file
+var _0x1d22=['bluebird','randomstring','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x1d22,0x8f));var _0x21d2=function(_0x33e2ee,_0xbfc830){_0x33e2ee=_0x33e2ee-0x0;var _0x55dee6=_0x1d22[_0x33e2ee];return _0x55dee6;};'use strict';var fs=require('fs');var path=require(_0x21d2('0x0'));var BPromise=require(_0x21d2('0x1'));var rs=require(_0x21d2('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x42a2f2,_0x4324c8,_0xc8d0db){return new BPromise(function(_0x2d7b9a,_0x12fd2f){_0x42a2f2['synthesizeSpeech'](_0x4324c8,function(_0x3ffc36,_0xe9de4f){if(_0x3ffc36){_0x12fd2f(_0x3ffc36);}else if(_0xe9de4f){if(_0xe9de4f[_0x21d2('0x3')]instanceof Buffer){fs[_0x21d2('0x4')](_0xc8d0db,_0xe9de4f[_0x21d2('0x3')],function(_0x819a27){if(_0x819a27){_0x12fd2f(_0x819a27);}else{_0x2d7b9a();}});}else{_0x12fd2f(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x12fd2f(new Error(_0x21d2('0x5')));}});});}module[_0x21d2('0x6')]=function(_0x52127c,_0x53356b,_0x3e2c4f,_0x128383,_0x332b83,_0xe1f331,_0x2bfda0){var _0x1095bb=new AWS[(_0x21d2('0x7'))]({'accessKeyId':_0x52127c,'secretAccessKey':_0x53356b,'region':_0x3e2c4f});var _0xc0f217={'Text':_0x332b83,'TextType':_0xe1f331||'text','OutputFormat':_0x21d2('0x8'),'VoiceId':_0x128383};return pollyResult(_0x1095bb,_0xc0f217,_0x2bfda0);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js
index 7111ab3..d057beb 100644
--- a/server/services/agi/scripts/google/asr/index.js
+++ b/server/services/agi/scripts/google/asr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe5f5=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5f5,0x1c9));var _0x5e5f=function(_0x297608,_0x29913f){_0x297608=_0x297608-0x0;var _0x165999=_0xe5f5[_0x297608];return _0x165999;};'use strict';var asr=require('./lib/api');module[_0x5e5f('0x0')]=function(_0x1f2313,_0x25a941,_0x43b799,_0x1e1187){return asr(_0x1f2313,_0x25a941,_0x43b799);};
\ No newline at end of file
+var _0x372e=['exports'];(function(_0x167384,_0x4b5c2b){var _0x289311=function(_0x12224c){while(--_0x12224c){_0x167384['push'](_0x167384['shift']());}};_0x289311(++_0x4b5c2b);}(_0x372e,0x12c));var _0xe372=function(_0x5413ef,_0x4e7c38){_0x5413ef=_0x5413ef-0x0;var _0x3100e1=_0x372e[_0x5413ef];return _0x3100e1;};'use strict';var asr=require('./lib/api');module[_0xe372('0x0')]=function(_0x4e125a,_0xdcb329,_0x1655fa,_0x2af7c7){return asr(_0x4e125a,_0xdcb329,_0x1655fa);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js
index afad93b..7711a19 100644
--- a/server/services/agi/scripts/google/asr/lib/api.js
+++ b/server/services/agi/scripts/google/asr/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3775=['POST','/v1/speech:recognize?key=','LINEAR16','8000','url','exports','length','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64'];(function(_0x5a11a6,_0x3016be){var _0x587761=function(_0x19e2be){while(--_0x19e2be){_0x5a11a6['push'](_0x5a11a6['shift']());}};_0x587761(++_0x3016be);}(_0x3775,0x1be));var _0x5377=function(_0x3caaee,_0x2267bc){_0x3caaee=_0x3caaee-0x0;var _0x16df54=_0x3775[_0x3caaee];return _0x16df54;};'use strict';var url=require(_0x5377('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x5377('0x1')]=function(_0x4c671c,_0x4b30f2,_0x111a6a){return new BPromise(function(_0x34fd61,_0x4b053d){var _0x5b93aa;if(typeof _0x4c671c!=='string'||_0x4c671c[_0x5377('0x2')]===0x0){return _0x4b053d('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x4b30f2!==_0x5377('0x3')||_0x4b30f2[_0x5377('0x2')]===0x0){return _0x4b053d('key\x20should\x20be\x20a\x20string');}if(typeof _0x111a6a!==_0x5377('0x4')&&(typeof _0x111a6a!=='string'||_0x111a6a[_0x5377('0x2')]===0x0)){return _0x4b053d(_0x5377('0x5'));}try{_0x5b93aa=fs[_0x5377('0x6')](_0x4c671c)[_0x5377('0x7')](_0x5377('0x8'));}catch(_0x619e0d){return _0x4b053d(_0x619e0d);}return _0x34fd61({'method':_0x5377('0x9'),'uri':host+_0x5377('0xa')+_0x4b30f2,'body':{'config':{'encoding':_0x5377('0xb'),'sampleRateHertz':_0x5377('0xc'),'languageCode':_0x111a6a},'audio':{'content':_0x5b93aa}},'json':!![]});});};
\ No newline at end of file
+var _0x4ae3=['https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird'];(function(_0x31ef6a,_0x4514e3){var _0x21808f=function(_0x14f1f4){while(--_0x14f1f4){_0x31ef6a['push'](_0x31ef6a['shift']());}};_0x21808f(++_0x4514e3);}(_0x4ae3,0xc1));var _0x34ae=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0x4ae3[_0x163742];return _0x1152ac;};'use strict';var url=require(_0x34ae('0x0'));var BPromise=require(_0x34ae('0x1'));var fs=require('fs');var host=_0x34ae('0x2');module['exports']=function(_0x42f1dc,_0x159606,_0x1f6073){return new BPromise(function(_0xd990aa,_0x52ad72){var _0x563295;if(typeof _0x42f1dc!==_0x34ae('0x3')||_0x42f1dc[_0x34ae('0x4')]===0x0){return _0x52ad72(_0x34ae('0x5'));}if(typeof _0x159606!==_0x34ae('0x3')||_0x159606[_0x34ae('0x4')]===0x0){return _0x52ad72(_0x34ae('0x6'));}if(typeof _0x1f6073!==_0x34ae('0x7')&&(typeof _0x1f6073!==_0x34ae('0x3')||_0x1f6073[_0x34ae('0x4')]===0x0)){return _0x52ad72(_0x34ae('0x8'));}try{_0x563295=fs[_0x34ae('0x9')](_0x42f1dc)[_0x34ae('0xa')](_0x34ae('0xb'));}catch(_0x45d556){return _0x52ad72(_0x45d556);}return _0xd990aa({'method':_0x34ae('0xc'),'uri':host+_0x34ae('0xd')+_0x159606,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x34ae('0xe'),'languageCode':_0x1f6073},'audio':{'content':_0x563295}},'json':!![]});});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js
index b3ab00b..b26e603 100644
--- a/server/services/agi/scripts/google/index.js
+++ b/server/services/agi/scripts/google/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2883=['./asr','exports'];(function(_0x35ed44,_0x265d05){var _0x479406=function(_0x95239a){while(--_0x95239a){_0x35ed44['push'](_0x35ed44['shift']());}};_0x479406(++_0x265d05);}(_0x2883,0x11e));var _0x3288=function(_0xec9ca0,_0x5eb6e3){_0xec9ca0=_0xec9ca0-0x0;var _0x14329f=_0x2883[_0xec9ca0];return _0x14329f;};var asr=require(_0x3288('0x0'));module[_0x3288('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x5919=['exports','./asr'];(function(_0x105f4d,_0x287499){var _0x314b1a=function(_0x5d4907){while(--_0x5d4907){_0x105f4d['push'](_0x105f4d['shift']());}};_0x314b1a(++_0x287499);}(_0x5919,0x15d));var _0x9591=function(_0x26e105,_0x821a88){_0x26e105=_0x26e105-0x0;var _0x534f19=_0x5919[_0x26e105];return _0x534f19;};var asr=require(_0x9591('0x0'));module[_0x9591('0x1')]={'asr':asr};
\ No newline at end of file
diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js
index d77882c..17d5905 100644
--- a/server/services/agi/scripts/index.js
+++ b/server/services/agi/scripts/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2c8e=['AudioFromTts','Data','dirName','https','parse','bluebird','sox','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','path','WHAT_EVER','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','statusCode','finish','info','finish\x20download\x20file','close','unlink','download\x20error','end','protocol','host','get','data','wav','error\x20convert','start','resolve','tmp','generate','writeFileSync','then','chmodSync','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','text:synthesize','.mp3','from','audioContent','base64','writeFile','.wav','googleCloudTTS\x20path','googleTTS','goggleTTS\x20path','googleASR','asr','uri','map','alternatives','transcript','results','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','awsPolly','awsLex','lex','stringify','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','nda','text','channelData','CustomAction'];(function(_0x3980ef,_0x295d1d){var _0x4d23f2=function(_0x392c77){while(--_0x392c77){_0x3980ef['push'](_0x3980ef['shift']());}};_0x4d23f2(++_0x295d1d);}(_0x2c8e,0x144));var _0xe2c8=function(_0x47953d,_0x25115f){_0x47953d=_0x47953d-0x0;var _0x34de41=_0x2c8e[_0x47953d];return _0x34de41;};'use strict';var fs=require('fs');var path=require('path');var http=require('http');var https=require(_0xe2c8('0x0'));var urlParse=require('url')[_0xe2c8('0x1')];var BPromise=require(_0xe2c8('0x2'));var rs=require('randomstring');var sox=require(_0xe2c8('0x3'));var rp=require(_0xe2c8('0x4'));var util=require(_0xe2c8('0x5'));var querystring=require(_0xe2c8('0x6'));var tts=require(_0xe2c8('0x7'));var apiai=require(_0xe2c8('0x8'));var md5=require(_0xe2c8('0x9'));var google=require(_0xe2c8('0xa'));var aws=require(_0xe2c8('0xb'));var tilde=require(_0xe2c8('0xc'));var sestek=require(_0xe2c8('0xd'));var logger=require(_0xe2c8('0xe'))(_0xe2c8('0xf'));var ISPEECH_API=_0xe2c8('0x10');function downloadFile(_0x2c68cb,_0x1315b5){return new BPromise(function(_0x1e58a7,_0x397fe6){var _0x4dbc76=urlParse(_0x2c68cb);var _0x1c41f9=_0x4dbc76['protocol']==='https:'?https:http;var _0x2a87a1={'host':_0x4dbc76['host'],'path':_0x4dbc76[_0xe2c8('0x11')],'headers':{'user-agent':_0xe2c8('0x12')}};_0x1c41f9['get'](_0x2a87a1,function(_0x31c626){if(_0x31c626['statusCode']!==0xc8){logger[_0xe2c8('0x13')](_0xe2c8('0x14')+_0x2c68cb+_0xe2c8('0x15')+_0x31c626['statusCode']+'\x20('+_0x31c626[_0xe2c8('0x16')]+')');_0x397fe6(new Error(_0xe2c8('0x14')+_0x2c68cb+'\x20failed,\x20status\x20code\x20=\x20'+_0x31c626[_0xe2c8('0x17')]+'\x20('+_0x31c626[_0xe2c8('0x16')]+')'));return;}var _0x3b31e2=fs['createWriteStream'](_0x1315b5);_0x3b31e2['on'](_0xe2c8('0x18'),function(){logger[_0xe2c8('0x19')](_0xe2c8('0x1a'));_0x3b31e2[_0xe2c8('0x1b')](_0x1e58a7);});_0x3b31e2['on'](_0xe2c8('0x13'),function(_0x1dc3d4){fs[_0xe2c8('0x1c')](_0x1315b5);logger['error'](_0xe2c8('0x1d'),_0x1dc3d4);_0x397fe6(_0x1dc3d4);});_0x31c626['pipe'](_0x3b31e2);})['on'](_0xe2c8('0x13'),function(_0x379059){logger[_0xe2c8('0x13')](_0x379059);_0x397fe6(_0x379059);})[_0xe2c8('0x1e')]();});}function uploadFile(_0x15ad1d){return new BPromise(function(_0x515cde,_0x5657a1){var _0x3efbb5=urlParse(_0x15ad1d);var _0x310da2=_0x3efbb5[_0xe2c8('0x1f')]==='https:'?https:http;var _0x4919f4={'host':_0x3efbb5[_0xe2c8('0x20')],'path':_0x3efbb5[_0xe2c8('0x11')],'headers':{'user-agent':_0xe2c8('0x12')}};_0x310da2[_0xe2c8('0x21')](_0x4919f4,function(_0x2da143){if(_0x2da143[_0xe2c8('0x17')]!==0xc8){_0x5657a1(new Error('request\x20to\x20'+_0x15ad1d+_0xe2c8('0x15')+_0x2da143[_0xe2c8('0x17')]+'\x20('+_0x2da143['statusMessage']+')'));return;}var _0x3f96a0='';_0x2da143['on'](_0xe2c8('0x22'),function(_0x35c086){_0x3f96a0+=_0x35c086;});_0x2da143['on'](_0xe2c8('0x1e'),function(){_0x515cde(_0x3f96a0);});})['on'](_0xe2c8('0x13'),function(_0x4e52ea){_0x5657a1(_0x4e52ea);})[_0xe2c8('0x1e')]();});}function convertFile(_0x96f33,_0x583149){return new BPromise(function(_0x2fab98,_0x1ac3a2){var _0xbe9b0=sox['transcode'](_0x96f33,_0x583149,{'sampleRate':0x1f40,'format':_0xe2c8('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xbe9b0['on'](_0xe2c8('0x13'),function(_0x5ce9a2){logger[_0xe2c8('0x13')](_0xe2c8('0x24'),_0x5ce9a2);_0x1ac3a2(_0x5ce9a2);});_0xbe9b0['on']('end',function(){logger[_0xe2c8('0x19')]('finish\x20to\x20convert');_0x2fab98();});_0xbe9b0[_0xe2c8('0x25')]();});}function base64Decode(_0x1592dd,_0x1e76a4){var _0x1dbcc2=path[_0xe2c8('0x26')](__dirname,_0xe2c8('0x27'),rs[_0xe2c8('0x28')](0x4)+'.wav');fs[_0xe2c8('0x29')](_0x1dbcc2,_0x1592dd,'base64');return convertFile(_0x1dbcc2,_0x1e76a4)[_0xe2c8('0x2a')](function(){try{fs[_0xe2c8('0x1c')](_0x1dbcc2);fs[_0xe2c8('0x2b')](_0x1e76a4,_0xe2c8('0x2c'));}catch(_0x48c744){logger[_0xe2c8('0x13')](_0x48c744);}return _0x1e76a4[_0xe2c8('0x2d')]('.')[0x0];});}function base64Encode(_0x128b57){var _0x360a31=fs[_0xe2c8('0x2e')](_0x128b57);return new Buffer(_0x360a31)['toString']('base64');}exports['googleCloudTTS']=function(_0x287a06,_0x35ce51,_0x1b7a0f,_0x44d30a,_0x3589dd,_0x1caecf){var _0x1f347d,_0x5429df;var _0x5d9cf2=_0xe2c8('0x2f');var _0x1d3cc8=_0xe2c8('0x30')+_0x287a06;var _0xe74150={};if(_0x35ce51===_0xe2c8('0x31')){_0xe74150[_0xe2c8('0x32')]={'ssml':_0x1b7a0f};}else{_0xe74150['input']={'text':_0x1b7a0f};};_0xe74150['voice']={'languageCode':_0x44d30a,'ssmlGender':_0x3589dd};_0xe74150['audioConfig']={'audioEncoding':_0xe2c8('0x33'),'sampleRateHertz':0x1f40};var _0xa58dea={'url':_0x5d9cf2+_0xe2c8('0x34')+_0x1d3cc8,'method':'POST','json':!![],'body':_0xe74150};return rp(_0xa58dea)[_0xe2c8('0x2a')](function(_0x1bd4d8){return new BPromise(function(_0x2ba0c3,_0x2f60b4){_0x1f347d=path[_0xe2c8('0x26')](__dirname,_0xe2c8('0x27'),rs[_0xe2c8('0x28')](0x4)+_0xe2c8('0x35'));var _0x42a04e=Buffer[_0xe2c8('0x36')](_0x1bd4d8[_0xe2c8('0x37')],_0xe2c8('0x38'));return fs[_0xe2c8('0x39')](_0x1f347d,_0x42a04e,function(_0x31b188){_0x2f60b4(_0x31b188);},function(_0x116563){fs['chmodSync'](_0x1f347d,_0xe2c8('0x2c'));_0x2ba0c3(_0x116563);});});})[_0xe2c8('0x2a')](function(_0x3b7a87){_0x5429df=path[_0xe2c8('0x26')](__dirname,_0xe2c8('0x27'),rs[_0xe2c8('0x28')](0x4)+_0xe2c8('0x3a'));return convertFile(_0x1f347d,_0x5429df);})[_0xe2c8('0x2a')](function(){try{fs[_0xe2c8('0x1c')](_0x1f347d);fs[_0xe2c8('0x2b')](_0x5429df,_0xe2c8('0x2c'));}catch(_0x1720d6){logger[_0xe2c8('0x13')](_0x1720d6);}logger['info'](_0xe2c8('0x3b'),_0x5429df[_0xe2c8('0x2d')]('.')[0x0]);return _0x5429df[_0xe2c8('0x2d')]('.')[0x0];});};exports[_0xe2c8('0x3c')]=function(_0x3dc995,_0xef176c){var _0x8558d4,_0xdad58e;return tts(_0x3dc995,_0xef176c||'en',0x1)[_0xe2c8('0x2a')](function(_0x269bdf){logger['info'](_0x269bdf);_0x8558d4=path['resolve'](__dirname,_0xe2c8('0x27'),rs['generate'](0x4)+'.mp3');return downloadFile(_0x269bdf,_0x8558d4);})['then'](function(){_0xdad58e=path[_0xe2c8('0x26')](__dirname,_0xe2c8('0x27'),rs[_0xe2c8('0x28')](0x4)+'.wav');return convertFile(_0x8558d4,_0xdad58e);})[_0xe2c8('0x2a')](function(){try{fs[_0xe2c8('0x1c')](_0x8558d4);fs['chmodSync'](_0xdad58e,'777');}catch(_0x12941b){logger[_0xe2c8('0x13')](_0x12941b);}logger[_0xe2c8('0x19')](_0xe2c8('0x3d'),_0xdad58e[_0xe2c8('0x2d')]('.')[0x0]);return _0xdad58e['split']('.')[0x0];});};exports[_0xe2c8('0x3e')]=function(_0x4f5c26,_0x2062da,_0x39441d){return google[_0xe2c8('0x3f')](_0x4f5c26,_0x2062da,_0x39441d)['then'](function(_0x5a6506){logger[_0xe2c8('0x19')](_0x5a6506[_0xe2c8('0x40')]);return rp(_0x5a6506);})['then'](function(_0x27ea47){var _0x264cf3='';var _0x57c700=0x0;try{fs[_0xe2c8('0x1c')](_0x4f5c26);}catch(_0x369fd1){logger[_0xe2c8('0x13')](_0x369fd1);}if(_0x27ea47&&_0x27ea47['results']){_0x264cf3=_0x27ea47['results'][_0xe2c8('0x41')](function(_0x99d6e4){return _0x99d6e4&&_0x99d6e4['alternatives'][0x0]&&_0x99d6e4[_0xe2c8('0x42')][0x0][_0xe2c8('0x43')]?_0x99d6e4['alternatives'][0x0][_0xe2c8('0x43')]:'';})['join']('\x0a');_0x57c700=_0x27ea47[_0xe2c8('0x44')][_0xe2c8('0x41')](function(_0x31e6e9){return _0x31e6e9&&_0x31e6e9['alternatives'][0x0]&&_0x31e6e9[_0xe2c8('0x42')][0x0][_0xe2c8('0x45')]?_0x31e6e9[_0xe2c8('0x42')][0x0][_0xe2c8('0x45')]:0x0;})[_0xe2c8('0x46')]('\x0a');}logger['info'](_0xe2c8('0x47'),_0x264cf3);logger[_0xe2c8('0x19')](_0xe2c8('0x48'),_0x57c700);return{'transcript':_0x264cf3,'confidence':_0x57c700};})[_0xe2c8('0x49')](function(_0x4cd971){logger[_0xe2c8('0x13')]('[%s]\x20%s:%s',_0x4cd971['statusCode'],_0x4cd971[_0xe2c8('0x4a')],_0x4cd971[_0xe2c8('0x4b')]);});};exports[_0xe2c8('0x4c')]=function(_0x2486c0,_0x5e3ff8,_0x2a6ba7,_0x242243){var _0x5fd32b=apiai(_0x5e3ff8,{'language':_0x242243||'en'});return _0x5fd32b[_0xe2c8('0x4d')](_0x2a6ba7,{'sessionId':md5(_0x2486c0)})[_0xe2c8('0x2a')](function(_0x129643){logger['info'](JSON['stringify'](_0x129643));return{'source':_0x129643[_0xe2c8('0x4e')][_0xe2c8('0x4f')],'resolvedQuery':_0x129643['result'][_0xe2c8('0x50')],'action':_0x129643[_0xe2c8('0x4e')][_0xe2c8('0x51')],'actionIncomplete':_0x129643['result'][_0xe2c8('0x52')],'speech':_0x129643[_0xe2c8('0x4e')][_0xe2c8('0x53')]['speech'],'score':_0x129643['result'][_0xe2c8('0x54')],'statusCode':_0x129643[_0xe2c8('0x55')][_0xe2c8('0x56')],'endConversation':_0x129643[_0xe2c8('0x4e')][_0xe2c8('0x57')][_0xe2c8('0x58')]||![],'isFallbackIntent':_0x129643[_0xe2c8('0x4e')]['metadata'][_0xe2c8('0x59')]};});};exports[_0xe2c8('0x5a')]=function(_0x3651c8,_0x3a06b0,_0x39f64f,_0x34bb52){return tilde['asr'](_0x3651c8,_0x3a06b0,_0x39f64f,_0x34bb52)[_0xe2c8('0x2a')](function(_0xa5d990){try{fs[_0xe2c8('0x1c')](_0x3651c8);}catch(_0x370594){logger[_0xe2c8('0x13')](_0x370594);}logger['info']('Tilde\x20ASR\x20transcription',_0xa5d990[_0xe2c8('0x43')]);logger['info']('Tilde\x20ASR\x20confidence',_0xa5d990[_0xe2c8('0x45')]);return _0xa5d990;});};exports[_0xe2c8('0x5b')]=function(_0x805d18,_0x402929,_0x113a46,_0x16fc4d,_0x9e8f26,_0x357284){var _0x499f06=path[_0xe2c8('0x26')](__dirname,_0xe2c8('0x27'),rs[_0xe2c8('0x28')](0x4)+'.mp3');var _0x2ef132;return aws['polly'](_0x805d18,_0x402929,_0x113a46,_0x16fc4d,_0x9e8f26,_0x357284,_0x499f06)[_0xe2c8('0x2a')](function(){_0x2ef132=path[_0xe2c8('0x26')](__dirname,_0xe2c8('0x27'),rs[_0xe2c8('0x28')](0x4)+_0xe2c8('0x3a'));return convertFile(_0x499f06,_0x2ef132);})['then'](function(){try{fs[_0xe2c8('0x1c')](_0x499f06);fs[_0xe2c8('0x2b')](_0x2ef132,_0xe2c8('0x2c'));}catch(_0x1d5195){logger[_0xe2c8('0x13')](_0x1d5195);}return _0x2ef132[_0xe2c8('0x2d')]('.')[0x0];});};exports[_0xe2c8('0x5c')]=function(_0x6cb879,_0x145470,_0x192e51,_0x1b3962,_0x156518,_0xf7a8ca){return aws[_0xe2c8('0x5d')](_0x6cb879,_0x145470,_0x192e51,_0x1b3962,_0x156518,_0xf7a8ca)[_0xe2c8('0x2a')](function(_0x14e779){logger[_0xe2c8('0x19')](JSON[_0xe2c8('0x5e')](_0x14e779));return _0x14e779;});};exports[_0xe2c8('0x5f')]=function(_0x29bae2,_0x47e94e,_0x1e2c8b,_0xc39e22){var _0x4b6f4f=util[_0xe2c8('0x60')](_0xe2c8('0x61'),ISPEECH_API,_0x29bae2,encodeURIComponent(_0x47e94e),_0x1e2c8b,_0xc39e22);var _0x56c8a5=path[_0xe2c8('0x26')](__dirname,_0xe2c8('0x27'),rs[_0xe2c8('0x28')](0x4)+'.mp3');var _0x17ab44;return downloadFile(_0x4b6f4f,_0x56c8a5)[_0xe2c8('0x2a')](function(){_0x17ab44=path['resolve'](__dirname,_0xe2c8('0x27'),rs[_0xe2c8('0x28')](0x4)+_0xe2c8('0x3a'));return convertFile(_0x56c8a5,_0x17ab44);})[_0xe2c8('0x2a')](function(){try{fs['unlink'](_0x56c8a5);fs[_0xe2c8('0x2b')](_0x17ab44,_0xe2c8('0x2c'));}catch(_0x567691){logger[_0xe2c8('0x13')](_0x567691);}return _0x17ab44[_0xe2c8('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x4ce5bf,_0x2e565d,_0x30014e,_0x14598f){var _0x21175b=util[_0xe2c8('0x60')](_0xe2c8('0x62'),ISPEECH_API,_0x2e565d,_0x30014e,base64Encode(_0x4ce5bf),_0x14598f?util[_0xe2c8('0x60')]('model=%s',encodeURIComponent(_0x14598f)):_0xe2c8('0x63'));return uploadFile(_0x21175b)[_0xe2c8('0x2a')](function(_0x429e42){return querystring[_0xe2c8('0x1')](_0x429e42);});};exports['sestekNDA']=function(_0x5a03f3,_0x27ae4c){return sestek[_0xe2c8('0x64')](_0x5a03f3,_0x27ae4c)[_0xe2c8('0x2a')](function(_0x2f8f9c){logger[_0xe2c8('0x19')](JSON[_0xe2c8('0x5e')](_0x2f8f9c));var _0x49c313={'speech':_0x2f8f9c[_0xe2c8('0x65')],'action':_0x2f8f9c[_0xe2c8('0x66')]?_0x2f8f9c[_0xe2c8('0x66')][_0xe2c8('0x67')]:undefined,'actiondata':_0x2f8f9c['channelData']?_0x2f8f9c[_0xe2c8('0x66')]['CustomActionData']:undefined};if(_0x2f8f9c['channelData']&&_0x2f8f9c[_0xe2c8('0x66')]['AudioFromTts']){return base64Decode(_0x2f8f9c[_0xe2c8('0x66')][_0xe2c8('0x68')][_0xe2c8('0x69')],path[_0xe2c8('0x26')](__dirname,_0xe2c8('0x27'),rs['generate'](0x4)+_0xe2c8('0x3a')))[_0xe2c8('0x2a')](function(_0x30b82f){_0x49c313['audiofile']=_0x30b82f;return _0x49c313;});}return _0x49c313;});};exports[_0xe2c8('0x6a')]=function(){return __dirname;};
\ No newline at end of file
+var _0xd326=['voice','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','writeFile','chmodSync','googleCloudTTS\x20path','split','googleTTS','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','name','message','textRequest','stringify','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','endConversation','metadata','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','audiofile','dirName','path','https','parse','bluebird','randomstring','sox','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./google','./sestek','../../../config/logger','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','\x20failed,\x20status\x20code\x20=\x20','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','then','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd326,0xa7));var _0x6d32=function(_0x10dc4a,_0x38e428){_0x10dc4a=_0x10dc4a-0x0;var _0xc851a0=_0xd326[_0x10dc4a];return _0xc851a0;};'use strict';var fs=require('fs');var path=require(_0x6d32('0x0'));var http=require('http');var https=require(_0x6d32('0x1'));var urlParse=require('url')[_0x6d32('0x2')];var BPromise=require(_0x6d32('0x3'));var rs=require(_0x6d32('0x4'));var sox=require(_0x6d32('0x5'));var rp=require(_0x6d32('0x6'));var util=require(_0x6d32('0x7'));var querystring=require(_0x6d32('0x8'));var tts=require(_0x6d32('0x9'));var apiai=require(_0x6d32('0xa'));var md5=require(_0x6d32('0xb'));var google=require(_0x6d32('0xc'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x6d32('0xd'));var logger=require(_0x6d32('0xe'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x34846f,_0x1be82d){return new BPromise(function(_0x20b7bb,_0x292263){var _0xe37f8d=urlParse(_0x34846f);var _0x5ee695=_0xe37f8d[_0x6d32('0xf')]===_0x6d32('0x10')?https:http;var _0x4d27ac={'host':_0xe37f8d[_0x6d32('0x11')],'path':_0xe37f8d[_0x6d32('0x0')],'headers':{'user-agent':_0x6d32('0x12')}};_0x5ee695[_0x6d32('0x13')](_0x4d27ac,function(_0x1e507f){if(_0x1e507f[_0x6d32('0x14')]!==0xc8){logger[_0x6d32('0x15')](_0x6d32('0x16')+_0x34846f+'\x20failed,\x20status\x20code\x20=\x20'+_0x1e507f[_0x6d32('0x14')]+'\x20('+_0x1e507f[_0x6d32('0x17')]+')');_0x292263(new Error('request\x20to\x20'+_0x34846f+'\x20failed,\x20status\x20code\x20=\x20'+_0x1e507f['statusCode']+'\x20('+_0x1e507f[_0x6d32('0x17')]+')'));return;}var _0x539e82=fs[_0x6d32('0x18')](_0x1be82d);_0x539e82['on'](_0x6d32('0x19'),function(){logger[_0x6d32('0x1a')](_0x6d32('0x1b'));_0x539e82[_0x6d32('0x1c')](_0x20b7bb);});_0x539e82['on']('error',function(_0x20e960){fs[_0x6d32('0x1d')](_0x1be82d);logger[_0x6d32('0x15')](_0x6d32('0x1e'),_0x20e960);_0x292263(_0x20e960);});_0x1e507f[_0x6d32('0x1f')](_0x539e82);})['on']('error',function(_0xa277ad){logger[_0x6d32('0x15')](_0xa277ad);_0x292263(_0xa277ad);})[_0x6d32('0x20')]();});}function uploadFile(_0x39135e){return new BPromise(function(_0x284325,_0x1c720c){var _0x1e19c3=urlParse(_0x39135e);var _0x2019a3=_0x1e19c3[_0x6d32('0xf')]==='https:'?https:http;var _0x574048={'host':_0x1e19c3[_0x6d32('0x11')],'path':_0x1e19c3['path'],'headers':{'user-agent':_0x6d32('0x12')}};_0x2019a3[_0x6d32('0x13')](_0x574048,function(_0x2e6166){if(_0x2e6166[_0x6d32('0x14')]!==0xc8){_0x1c720c(new Error(_0x6d32('0x16')+_0x39135e+_0x6d32('0x21')+_0x2e6166[_0x6d32('0x14')]+'\x20('+_0x2e6166[_0x6d32('0x17')]+')'));return;}var _0x8c7d6c='';_0x2e6166['on'](_0x6d32('0x22'),function(_0x14deab){_0x8c7d6c+=_0x14deab;});_0x2e6166['on']('end',function(){_0x284325(_0x8c7d6c);});})['on'](_0x6d32('0x15'),function(_0x30f433){_0x1c720c(_0x30f433);})['end']();});}function convertFile(_0x3b13b6,_0x380a38){return new BPromise(function(_0x5d14c6,_0x542d6){var _0x40fe66=sox[_0x6d32('0x23')](_0x3b13b6,_0x380a38,{'sampleRate':0x1f40,'format':_0x6d32('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x40fe66['on'](_0x6d32('0x15'),function(_0x482865){logger[_0x6d32('0x15')](_0x6d32('0x25'),_0x482865);_0x542d6(_0x482865);});_0x40fe66['on']('end',function(){logger[_0x6d32('0x1a')](_0x6d32('0x26'));_0x5d14c6();});_0x40fe66[_0x6d32('0x27')]();});}function base64Decode(_0x271031,_0x3856a7){var _0x54dca1=path[_0x6d32('0x28')](__dirname,'tmp',rs[_0x6d32('0x29')](0x4)+_0x6d32('0x2a'));fs[_0x6d32('0x2b')](_0x54dca1,_0x271031,'base64');return convertFile(_0x54dca1,_0x3856a7)[_0x6d32('0x2c')](function(){try{fs[_0x6d32('0x1d')](_0x54dca1);fs['chmodSync'](_0x3856a7,_0x6d32('0x2d'));}catch(_0x5f4471){logger[_0x6d32('0x15')](_0x5f4471);}return _0x3856a7['split']('.')[0x0];});}function base64Encode(_0x3306a0){var _0x3ced98=fs[_0x6d32('0x2e')](_0x3306a0);return new Buffer(_0x3ced98)[_0x6d32('0x2f')]('base64');}exports[_0x6d32('0x30')]=function(_0x5202ad,_0x5194ee,_0x1c3826,_0x176ee3,_0x534c80,_0x620d68){var _0x854812,_0x33dfac;var _0x510ff3=_0x6d32('0x31');var _0x4611e8=_0x6d32('0x32')+_0x5202ad;var _0x254d12={};if(_0x5194ee===_0x6d32('0x33')){_0x254d12['input']={'ssml':_0x1c3826};}else{_0x254d12[_0x6d32('0x34')]={'text':_0x1c3826};};_0x254d12[_0x6d32('0x35')]={'languageCode':_0x176ee3,'ssmlGender':_0x534c80};_0x254d12[_0x6d32('0x36')]={'audioEncoding':_0x6d32('0x37'),'sampleRateHertz':0x1f40};var _0x57bac5={'url':_0x510ff3+_0x6d32('0x38')+_0x4611e8,'method':_0x6d32('0x39'),'json':!![],'body':_0x254d12};return rp(_0x57bac5)['then'](function(_0xc2dce6){return new BPromise(function(_0x55128c,_0xf7dc71){_0x854812=path['resolve'](__dirname,_0x6d32('0x3a'),rs[_0x6d32('0x29')](0x4)+_0x6d32('0x3b'));var _0x1a29c4=Buffer[_0x6d32('0x3c')](_0xc2dce6[_0x6d32('0x3d')],'base64');return fs[_0x6d32('0x3e')](_0x854812,_0x1a29c4,function(_0x584898){_0xf7dc71(_0x584898);},function(_0x4aab27){fs[_0x6d32('0x3f')](_0x854812,_0x6d32('0x2d'));_0x55128c(_0x4aab27);});});})['then'](function(_0x587ce3){_0x33dfac=path[_0x6d32('0x28')](__dirname,_0x6d32('0x3a'),rs['generate'](0x4)+'.wav');return convertFile(_0x854812,_0x33dfac);})['then'](function(){try{fs['unlink'](_0x854812);fs[_0x6d32('0x3f')](_0x33dfac,_0x6d32('0x2d'));}catch(_0x1b4f8d){logger[_0x6d32('0x15')](_0x1b4f8d);}logger['info'](_0x6d32('0x40'),_0x33dfac[_0x6d32('0x41')]('.')[0x0]);return _0x33dfac[_0x6d32('0x41')]('.')[0x0];});};exports[_0x6d32('0x42')]=function(_0x5f2bd9,_0x4c66ec){var _0x4a49b9,_0x4be79b;return tts(_0x5f2bd9,_0x4c66ec||'en',0x1)[_0x6d32('0x2c')](function(_0x2184d1){logger['info'](_0x2184d1);_0x4a49b9=path[_0x6d32('0x28')](__dirname,_0x6d32('0x3a'),rs['generate'](0x4)+_0x6d32('0x3b'));return downloadFile(_0x2184d1,_0x4a49b9);})[_0x6d32('0x2c')](function(){_0x4be79b=path['resolve'](__dirname,_0x6d32('0x3a'),rs[_0x6d32('0x29')](0x4)+_0x6d32('0x2a'));return convertFile(_0x4a49b9,_0x4be79b);})['then'](function(){try{fs[_0x6d32('0x1d')](_0x4a49b9);fs[_0x6d32('0x3f')](_0x4be79b,_0x6d32('0x2d'));}catch(_0x4b6961){logger['error'](_0x4b6961);}logger[_0x6d32('0x1a')](_0x6d32('0x43'),_0x4be79b[_0x6d32('0x41')]('.')[0x0]);return _0x4be79b[_0x6d32('0x41')]('.')[0x0];});};exports[_0x6d32('0x44')]=function(_0x3a1254,_0x240109,_0x566130){return google[_0x6d32('0x45')](_0x3a1254,_0x240109,_0x566130)['then'](function(_0x4418ca){logger[_0x6d32('0x1a')](_0x4418ca['uri']);return rp(_0x4418ca);})[_0x6d32('0x2c')](function(_0x2a565b){var _0x2501bb='';var _0x119e4f=0x0;try{fs[_0x6d32('0x1d')](_0x3a1254);}catch(_0x54ebcf){logger[_0x6d32('0x15')](_0x54ebcf);}if(_0x2a565b&&_0x2a565b[_0x6d32('0x46')]){_0x2501bb=_0x2a565b['results'][_0x6d32('0x47')](function(_0x348cfb){return _0x348cfb&&_0x348cfb[_0x6d32('0x48')][0x0]&&_0x348cfb['alternatives'][0x0]['transcript']?_0x348cfb[_0x6d32('0x48')][0x0][_0x6d32('0x49')]:'';})[_0x6d32('0x4a')]('\x0a');_0x119e4f=_0x2a565b[_0x6d32('0x46')]['map'](function(_0xa28774){return _0xa28774&&_0xa28774[_0x6d32('0x48')][0x0]&&_0xa28774['alternatives'][0x0][_0x6d32('0x4b')]?_0xa28774[_0x6d32('0x48')][0x0][_0x6d32('0x4b')]:0x0;})[_0x6d32('0x4a')]('\x0a');}logger[_0x6d32('0x1a')](_0x6d32('0x4c'),_0x2501bb);logger[_0x6d32('0x1a')]('googleASR\x20confidence',_0x119e4f);return{'transcript':_0x2501bb,'confidence':_0x119e4f};})['catch'](function(_0x8f71fa){logger[_0x6d32('0x15')](_0x6d32('0x4d'),_0x8f71fa[_0x6d32('0x14')],_0x8f71fa[_0x6d32('0x4e')],_0x8f71fa[_0x6d32('0x4f')]);});};exports['googleDialogflow']=function(_0x3adc10,_0x267997,_0x4d522d,_0x119171){var _0x1e9545=apiai(_0x267997,{'language':_0x119171||'en'});return _0x1e9545[_0x6d32('0x50')](_0x4d522d,{'sessionId':md5(_0x3adc10)})[_0x6d32('0x2c')](function(_0x3fd30a){logger[_0x6d32('0x1a')](JSON[_0x6d32('0x51')](_0x3fd30a));return{'source':_0x3fd30a[_0x6d32('0x52')]['source'],'resolvedQuery':_0x3fd30a[_0x6d32('0x52')][_0x6d32('0x53')],'action':_0x3fd30a[_0x6d32('0x52')][_0x6d32('0x54')],'actionIncomplete':_0x3fd30a[_0x6d32('0x52')][_0x6d32('0x55')],'speech':_0x3fd30a[_0x6d32('0x52')][_0x6d32('0x56')][_0x6d32('0x57')],'score':_0x3fd30a['result'][_0x6d32('0x58')],'statusCode':_0x3fd30a['status'][_0x6d32('0x59')],'endConversation':_0x3fd30a[_0x6d32('0x52')]['metadata'][_0x6d32('0x5a')]||![],'isFallbackIntent':_0x3fd30a[_0x6d32('0x52')][_0x6d32('0x5b')]['isFallbackIntent']};});};exports[_0x6d32('0x5c')]=function(_0x1dff0c,_0x16d042,_0x153886,_0x9c8463){return tilde[_0x6d32('0x45')](_0x1dff0c,_0x16d042,_0x153886,_0x9c8463)[_0x6d32('0x2c')](function(_0x3dac9f){try{fs['unlink'](_0x1dff0c);}catch(_0x27b70f){logger[_0x6d32('0x15')](_0x27b70f);}logger[_0x6d32('0x1a')](_0x6d32('0x5d'),_0x3dac9f[_0x6d32('0x49')]);logger[_0x6d32('0x1a')](_0x6d32('0x5e'),_0x3dac9f['confidence']);return _0x3dac9f;});};exports[_0x6d32('0x5f')]=function(_0x3d71e7,_0x3ec3a1,_0xc00988,_0x495c50,_0xb32220,_0x3ccffe){var _0x10972f=path[_0x6d32('0x28')](__dirname,_0x6d32('0x3a'),rs[_0x6d32('0x29')](0x4)+_0x6d32('0x3b'));var _0x376b8f;return aws[_0x6d32('0x60')](_0x3d71e7,_0x3ec3a1,_0xc00988,_0x495c50,_0xb32220,_0x3ccffe,_0x10972f)[_0x6d32('0x2c')](function(){_0x376b8f=path[_0x6d32('0x28')](__dirname,_0x6d32('0x3a'),rs[_0x6d32('0x29')](0x4)+'.wav');return convertFile(_0x10972f,_0x376b8f);})['then'](function(){try{fs[_0x6d32('0x1d')](_0x10972f);fs[_0x6d32('0x3f')](_0x376b8f,_0x6d32('0x2d'));}catch(_0x119c82){logger[_0x6d32('0x15')](_0x119c82);}return _0x376b8f[_0x6d32('0x41')]('.')[0x0];});};exports['awsLex']=function(_0xd9cbe1,_0x567b64,_0xd650e8,_0xc1fbf1,_0x293abe,_0x5efeca){return aws[_0x6d32('0x61')](_0xd9cbe1,_0x567b64,_0xd650e8,_0xc1fbf1,_0x293abe,_0x5efeca)[_0x6d32('0x2c')](function(_0x3e1edf){logger[_0x6d32('0x1a')](JSON[_0x6d32('0x51')](_0x3e1edf));return _0x3e1edf;});};exports[_0x6d32('0x62')]=function(_0x56bcd4,_0x2ae37f,_0x401630,_0x280351){var _0x235ced=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x56bcd4,encodeURIComponent(_0x2ae37f),_0x401630,_0x280351);var _0x2e8400=path[_0x6d32('0x28')](__dirname,'tmp',rs[_0x6d32('0x29')](0x4)+_0x6d32('0x3b'));var _0x5ce6b2;return downloadFile(_0x235ced,_0x2e8400)[_0x6d32('0x2c')](function(){_0x5ce6b2=path[_0x6d32('0x28')](__dirname,_0x6d32('0x3a'),rs[_0x6d32('0x29')](0x4)+'.wav');return convertFile(_0x2e8400,_0x5ce6b2);})[_0x6d32('0x2c')](function(){try{fs[_0x6d32('0x1d')](_0x2e8400);fs[_0x6d32('0x3f')](_0x5ce6b2,'777');}catch(_0x8b64f3){logger[_0x6d32('0x15')](_0x8b64f3);}return _0x5ce6b2[_0x6d32('0x41')]('.')[0x0];});};exports['ispeechASR']=function(_0x262b81,_0x47e243,_0x3e1794,_0x338c62){var _0x176c54=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x47e243,_0x3e1794,base64Encode(_0x262b81),_0x338c62?util[_0x6d32('0x63')](_0x6d32('0x64'),encodeURIComponent(_0x338c62)):_0x6d32('0x65'));return uploadFile(_0x176c54)[_0x6d32('0x2c')](function(_0x584d2f){return querystring[_0x6d32('0x2')](_0x584d2f);});};exports[_0x6d32('0x66')]=function(_0x5d421a,_0x54e4ae){return sestek[_0x6d32('0x67')](_0x5d421a,_0x54e4ae)['then'](function(_0x20a0ef){logger[_0x6d32('0x1a')](JSON[_0x6d32('0x51')](_0x20a0ef));var _0x27153b={'speech':_0x20a0ef[_0x6d32('0x68')],'action':_0x20a0ef[_0x6d32('0x69')]?_0x20a0ef[_0x6d32('0x69')][_0x6d32('0x6a')]:undefined,'actiondata':_0x20a0ef[_0x6d32('0x69')]?_0x20a0ef[_0x6d32('0x69')]['CustomActionData']:undefined};if(_0x20a0ef[_0x6d32('0x69')]&&_0x20a0ef['channelData'][_0x6d32('0x6b')]){return base64Decode(_0x20a0ef[_0x6d32('0x69')][_0x6d32('0x6b')]['Data'],path[_0x6d32('0x28')](__dirname,_0x6d32('0x3a'),rs[_0x6d32('0x29')](0x4)+_0x6d32('0x2a')))[_0x6d32('0x2c')](function(_0x535da2){_0x27153b[_0x6d32('0x6c')]=_0x535da2;return _0x27153b;});}return _0x27153b;});};exports[_0x6d32('0x6d')]=function(){return __dirname;};
\ No newline at end of file
diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js
index 5ad04d1..1dff2a0 100644
--- a/server/services/agi/scripts/sestek/index.js
+++ b/server/services/agi/scripts/sestek/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9de1=['./nda','exports'];(function(_0x5d8e77,_0x1a0c80){var _0x28dc3a=function(_0x2b0052){while(--_0x2b0052){_0x5d8e77['push'](_0x5d8e77['shift']());}};_0x28dc3a(++_0x1a0c80);}(_0x9de1,0x1ea));var _0x19de=function(_0x47bf54,_0x327a53){_0x47bf54=_0x47bf54-0x0;var _0x2b75bc=_0x9de1[_0x47bf54];return _0x2b75bc;};var nda=require(_0x19de('0x0'));module[_0x19de('0x1')]={'nda':nda};
\ No newline at end of file
+var _0xafd6=['exports','./nda'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xafd6,0x10f));var _0x6afd=function(_0x500c13,_0x5c07b1){_0x500c13=_0x500c13-0x0;var _0x47686d=_0xafd6[_0x500c13];return _0x47686d;};var nda=require(_0x6afd('0x0'));module[_0x6afd('0x1')]={'nda':nda};
\ No newline at end of file
diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js
index 3817ff1..9599d9f 100644
--- a/server/services/agi/scripts/sestek/nda/index.js
+++ b/server/services/agi/scripts/sestek/nda/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfdb6=['Nda','uniqueid','callerid','calleridname','extension','text','access_token','body','channelData','project','ndagenerate_audio','audio/wav','CustomAction','custom_action','CustomActionData','custom_action_data','agi','exports','POST','resolve','ndauth_url','/token','password','then','ndaactivity_type','message'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xfdb6,0x1b0));var _0x6fdb=function(_0x100b8d,_0x1d5879){_0x100b8d=_0x100b8d-0x0;var _0x8f8590=_0xfdb6[_0x100b8d];return _0x8f8590;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require('../../../../../config/logger')(_0x6fdb('0x0'));module[_0x6fdb('0x1')]=function(_0x3a041e,_0x3822a7){var _0x4f9d62={'method':_0x6fdb('0x2'),'uri':url[_0x6fdb('0x3')](_0x3822a7[_0x6fdb('0x4')],_0x6fdb('0x5')),'form':{'grant_type':_0x6fdb('0x6'),'username':_0x3822a7['username'],'password':_0x3822a7[_0x6fdb('0x6')]},'json':!![]};return rp(_0x4f9d62)[_0x6fdb('0x7')](function(_0x1aa31a){var _0x7a2ff4={'method':_0x6fdb('0x2'),'uri':url[_0x6fdb('0x3')](_0x3822a7['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x3822a7[_0x6fdb('0x8')]||_0x6fdb('0x9'),'channelId':_0x6fdb('0xa'),'conversation':{'id':_0x3a041e[_0x6fdb('0xb')]},'from':{'id':_0x3a041e[_0x6fdb('0xc')],'name':_0x3a041e[_0x6fdb('0xd')]},'recipient':{'id':_0x3a041e['dnid'],'name':_0x3a041e[_0x6fdb('0xe')]},'text':_0x3822a7[_0x6fdb('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1aa31a[_0x6fdb('0x10')]},'json':!![]};if(_0x3822a7['project']){_0x7a2ff4[_0x6fdb('0x11')][_0x6fdb('0x12')]['ProjectName']=_0x3822a7[_0x6fdb('0x13')];}if(_0x3822a7[_0x6fdb('0x14')]=='1'){_0x7a2ff4[_0x6fdb('0x11')][_0x6fdb('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6fdb('0x15')};}if(_0x3822a7['custom_action']){_0x7a2ff4[_0x6fdb('0x11')][_0x6fdb('0x12')][_0x6fdb('0x16')]=_0x3822a7[_0x6fdb('0x17')];if(_0x3822a7['custom_action_data']){_0x7a2ff4[_0x6fdb('0x11')][_0x6fdb('0x12')][_0x6fdb('0x18')]=_0x3822a7[_0x6fdb('0x19')];}}logger['info'](JSON['stringify'](_0x7a2ff4));return rp(_0x7a2ff4);});};
\ No newline at end of file
+var _0x3a61=['CustomActionData','custom_action_data','info','stringify','url','../../../../../config/logger','exports','resolve','/token','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','callerid','calleridname','text','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction'];(function(_0x5e608c,_0x453591){var _0x44d7fc=function(_0xc9de57){while(--_0xc9de57){_0x5e608c['push'](_0x5e608c['shift']());}};_0x44d7fc(++_0x453591);}(_0x3a61,0x1be));var _0x13a6=function(_0x4c8240,_0x2726cb){_0x4c8240=_0x4c8240-0x0;var _0x197de3=_0x3a61[_0x4c8240];return _0x197de3;};'use strict';var rp=require('request-promise');var url=require(_0x13a6('0x0'));var logger=require(_0x13a6('0x1'))('agi');module[_0x13a6('0x2')]=function(_0x507c62,_0x52098d){var _0x1c1a17={'method':'POST','uri':url[_0x13a6('0x3')](_0x52098d['ndauth_url'],_0x13a6('0x4')),'form':{'grant_type':'password','username':_0x52098d['username'],'password':_0x52098d['password']},'json':!![]};return rp(_0x1c1a17)[_0x13a6('0x5')](function(_0x509e14){var _0x26249b={'method':_0x13a6('0x6'),'uri':url[_0x13a6('0x3')](_0x52098d[_0x13a6('0x7')],_0x13a6('0x8')),'body':{'type':_0x52098d['ndaactivity_type']||'message','channelId':'Nda','conversation':{'id':_0x507c62['uniqueid']},'from':{'id':_0x507c62[_0x13a6('0x9')],'name':_0x507c62[_0x13a6('0xa')]},'recipient':{'id':_0x507c62['dnid'],'name':_0x507c62['extension']},'text':_0x52098d[_0x13a6('0xb')],'channelData':{}},'headers':{'Authorization':_0x13a6('0xc')+_0x509e14[_0x13a6('0xd')]},'json':!![]};if(_0x52098d[_0x13a6('0xe')]){_0x26249b[_0x13a6('0xf')][_0x13a6('0x10')]['ProjectName']=_0x52098d[_0x13a6('0xe')];}if(_0x52098d[_0x13a6('0x11')]=='1'){_0x26249b[_0x13a6('0xf')][_0x13a6('0x10')][_0x13a6('0x12')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x13a6('0x13')};}if(_0x52098d[_0x13a6('0x14')]){_0x26249b[_0x13a6('0xf')]['channelData'][_0x13a6('0x15')]=_0x52098d['custom_action'];if(_0x52098d['custom_action_data']){_0x26249b[_0x13a6('0xf')][_0x13a6('0x10')][_0x13a6('0x16')]=_0x52098d[_0x13a6('0x17')];}}logger[_0x13a6('0x18')](JSON[_0x13a6('0x19')](_0x26249b));return rp(_0x26249b);});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js
index 5fccb3c..7ccfb81 100644
--- a/server/services/agi/scripts/tilde/asr/index.js
+++ b/server/services/agi/scripts/tilde/asr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb62=['./lib/api'];(function(_0x4ed40b,_0x44d3aa){var _0x242033=function(_0xdb6e58){while(--_0xdb6e58){_0x4ed40b['push'](_0x4ed40b['shift']());}};_0x242033(++_0x44d3aa);}(_0xcb62,0x6c));var _0x2cb6=function(_0x4e9e8d,_0xcc83ba){_0x4e9e8d=_0x4e9e8d-0x0;var _0x1e2dfb=_0xcb62[_0x4e9e8d];return _0x1e2dfb;};'use strict';var asr=require(_0x2cb6('0x0'));module['exports']=function(_0x55e83b,_0x1563b0,_0x33dae9,_0x25b6ac){return asr(_0x55e83b,_0x1563b0,_0x33dae9,_0x25b6ac);};
\ No newline at end of file
+var _0xef51=['./lib/api','exports'];(function(_0x4667eb,_0x11475b){var _0x4a5707=function(_0x4445e8){while(--_0x4445e8){_0x4667eb['push'](_0x4667eb['shift']());}};_0x4a5707(++_0x11475b);}(_0xef51,0xee));var _0x1ef5=function(_0x2a4b5f,_0x30978b){_0x2a4b5f=_0x2a4b5f-0x0;var _0x16fc41=_0xef51[_0x2a4b5f];return _0x16fc41;};'use strict';var asr=require(_0x1ef5('0x0'));module[_0x1ef5('0x1')]=function(_0x54b9a5,_0x218dd7,_0x20bad0,_0xe9fc49){return asr(_0x54b9a5,_0x218dd7,_0x20bad0,_0xe9fc49);};
\ No newline at end of file
diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js
index 5b2d4ec..93750aa 100644
--- a/server/services/agi/scripts/tilde/asr/lib/api.js
+++ b/server/services/agi/scripts/tilde/asr/lib/api.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2947=['stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x2947,0x189));var _0x7294=function(_0x27f953,_0x585a91){_0x27f953=_0x27f953-0x0;var _0x4e6e6e=_0x2947[_0x27f953];return _0x4e6e6e;};'use strict';var BPromise=require(_0x7294('0x0'));var _=require(_0x7294('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7294('0x2'));var crypto=require(_0x7294('0x3'));var logger=require(_0x7294('0x4'))(_0x7294('0x5'));module[_0x7294('0x6')]=function(_0x5289e2,_0x55b43e,_0x3c7616,_0x59bce1){return new BPromise(function(_0xfd5b6a,_0xd80099){logger[_0x7294('0x7')](_0x7294('0x8'),_0x59bce1||_0x7294('0x9'));var _0xd8bb93=new WebSocket(_0x59bce1||_0x7294('0x9'),{'perMessageDeflate':![]});var _0x2a1ff0='';var _0x37fc6b='0';var _0x277b98='1';var _0x59d56b=_0x7294('0xa');function _0x3456fd(_0x489d66){var _0x52b728=crypto['createHash'](_0x7294('0xb'));_0x52b728[_0x7294('0xc')](_0x489d66);return _0x52b728[_0x7294('0xd')]('hex');}function _0x4f3834(){try{logger[_0x7294('0x7')](_0x7294('0xe'));var _0x3a7528=moment()[_0x7294('0xf')]();var _0x20d046=_0x3456fd(_0x3a7528+_0x55b43e+_0x3c7616);_0xd8bb93[_0x7294('0x10')](JSON[_0x7294('0x11')]({'appID':_0x55b43e,'timestamp':_0x3a7528,'appKey':_0x20d046}));var _0x7a36ad=fs[_0x7294('0x12')](_0x5289e2);_0x7a36ad['on'](_0x7294('0x13'),function(_0x71452f){_0xd8bb93[_0x7294('0x10')](_0x71452f);});_0x7a36ad['on'](_0x7294('0x14'),function(){_0xd8bb93[_0x7294('0x10')](_0x7294('0x15'));});}catch(_0x3bd238){logger['error'](_0x7294('0x16'),JSON[_0x7294('0x11')](_0x3bd238));_0xd8bb93[_0x7294('0x17')]();}}function _0x10d168(_0x3f37ad){try{if(_0x3f37ad){var _0x4a4f79=JSON[_0x7294('0x18')](_0x3f37ad);switch(_0x4a4f79[_0x7294('0x19')]){case 0x0:if(_0x4a4f79[_0x7294('0x1a')]){if(_0x4a4f79[_0x7294('0x1a')][_0x7294('0x1b')]){logger[_0x7294('0x7')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x4a4f79[_0x7294('0x1a')][_0x7294('0x1c')]));_0x2a1ff0=_0x4a4f79[_0x7294('0x1a')][_0x7294('0x1c')][0x0][_0x7294('0x1d')];_0x37fc6b=_0x4a4f79[_0x7294('0x1a')][_0x7294('0x1c')][0x0]['likelihood'];_0x277b98='0';_0x59d56b=_0x7294('0x1e');_0xd8bb93[_0x7294('0x17')]();}}break;case 0x1:logger[_0x7294('0x7')](_0x7294('0xa'));_0x277b98='1';_0x59d56b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x7294('0x7')](_0x7294('0x1f'));_0x277b98='2';_0x59d56b=_0x7294('0x1f');break;case 0x9:logger[_0x7294('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x277b98='9';_0x59d56b='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info']('Authentication\x20failed.');_0x277b98='10';_0x59d56b=_0x7294('0x20');break;case 0xb:logger['info'](_0x7294('0x21'));_0x277b98='11';_0x59d56b='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x59caf4){logger[_0x7294('0x22')](_0x7294('0x23'),JSON[_0x7294('0x11')](_0x59caf4));_0xd8bb93[_0x7294('0x17')]();}}function _0x12c5ab(){logger[_0x7294('0x7')]('Close\x20Tilde\x20ASR\x20socket');_0xfd5b6a({'transcript':_0x2a1ff0,'confidence':_0x37fc6b,'status':_0x277b98,'status_message':_0x59d56b});}function _0x325dc7(_0x25f700){logger[_0x7294('0x22')](_0x7294('0x24'));if(!_[_0x7294('0x25')](_0x25f700)){logger[_0x7294('0x22')](_[_0x7294('0x26')](_0x25f700)?JSON[_0x7294('0x11')](_0x25f700):_0x25f700);}}_0xd8bb93['on'](_0x7294('0x27'),_0x4f3834);_0xd8bb93['on'](_0x7294('0x28'),_0x10d168);_0xd8bb93['on'](_0x7294('0x14'),_0x12c5ab);_0xd8bb93['on'](_0x7294('0x22'),_0x325dc7);});};
\ No newline at end of file
+var _0x1adc=['Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','send','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket'];(function(_0x33159b,_0xe76e8d){var _0x3e5029=function(_0x3a6f03){while(--_0x3a6f03){_0x33159b['push'](_0x33159b['shift']());}};_0x3e5029(++_0xe76e8d);}(_0x1adc,0x19f));var _0xc1ad=function(_0x256f02,_0x10948e){_0x256f02=_0x256f02-0x0;var _0x3c80e4=_0x1adc[_0x256f02];return _0x3c80e4;};'use strict';var BPromise=require(_0xc1ad('0x0'));var _=require(_0xc1ad('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc1ad('0x2'));var crypto=require(_0xc1ad('0x3'));var logger=require(_0xc1ad('0x4'))(_0xc1ad('0x5'));module[_0xc1ad('0x6')]=function(_0x1917d0,_0x26ba41,_0x5c9cc8,_0x2083ed){return new BPromise(function(_0x78e42d,_0x3c4366){logger[_0xc1ad('0x7')]('Tilde\x20URI',_0x2083ed||_0xc1ad('0x8'));var _0x111d11=new WebSocket(_0x2083ed||_0xc1ad('0x8'),{'perMessageDeflate':![]});var _0x17aebb='';var _0x16d42e='0';var _0x1ee630='1';var _0x4facb3=_0xc1ad('0x9');function _0x44b7f4(_0x4aa1c4){var _0x31c658=crypto[_0xc1ad('0xa')](_0xc1ad('0xb'));_0x31c658[_0xc1ad('0xc')](_0x4aa1c4);return _0x31c658['digest'](_0xc1ad('0xd'));}function _0x5996b5(){try{logger[_0xc1ad('0x7')](_0xc1ad('0xe'));var _0x7b89c5=moment()['unix']();var _0x4a114e=_0x44b7f4(_0x7b89c5+_0x26ba41+_0x5c9cc8);_0x111d11[_0xc1ad('0xf')](JSON['stringify']({'appID':_0x26ba41,'timestamp':_0x7b89c5,'appKey':_0x4a114e}));var _0x5a4a86=fs['createReadStream'](_0x1917d0);_0x5a4a86['on'](_0xc1ad('0x10'),function(_0xfcc758){_0x111d11[_0xc1ad('0xf')](_0xfcc758);});_0x5a4a86['on'](_0xc1ad('0x11'),function(){_0x111d11['send'](_0xc1ad('0x12'));});}catch(_0x265be7){logger[_0xc1ad('0x13')](_0xc1ad('0x14'),JSON[_0xc1ad('0x15')](_0x265be7));_0x111d11[_0xc1ad('0x16')]();}}function _0x57e8e0(_0x4afde9){try{if(_0x4afde9){var _0x1d96bb=JSON[_0xc1ad('0x17')](_0x4afde9);switch(_0x1d96bb[_0xc1ad('0x18')]){case 0x0:if(_0x1d96bb[_0xc1ad('0x19')]){if(_0x1d96bb[_0xc1ad('0x19')]['final']){logger[_0xc1ad('0x7')](_0xc1ad('0x1a'),JSON[_0xc1ad('0x15')](_0x1d96bb['result'][_0xc1ad('0x1b')]));_0x17aebb=_0x1d96bb[_0xc1ad('0x19')][_0xc1ad('0x1b')][0x0][_0xc1ad('0x1c')];_0x16d42e=_0x1d96bb['result'][_0xc1ad('0x1b')][0x0][_0xc1ad('0x1d')];_0x1ee630='0';_0x4facb3='Success.';_0x111d11[_0xc1ad('0x16')]();}}break;case 0x1:logger[_0xc1ad('0x7')](_0xc1ad('0x9'));_0x1ee630='1';_0x4facb3=_0xc1ad('0x9');break;case 0x2:logger[_0xc1ad('0x7')](_0xc1ad('0x1e'));_0x1ee630='2';_0x4facb3=_0xc1ad('0x1e');break;case 0x9:logger['info'](_0xc1ad('0x1f'));_0x1ee630='9';_0x4facb3=_0xc1ad('0x1f');break;case 0xa:logger[_0xc1ad('0x7')](_0xc1ad('0x20'));_0x1ee630='10';_0x4facb3='Authentication\x20failed.';break;case 0xb:logger[_0xc1ad('0x7')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x1ee630='11';_0x4facb3=_0xc1ad('0x21');}}}catch(_0x1630d8){logger['error'](_0xc1ad('0x22'),JSON[_0xc1ad('0x15')](_0x1630d8));_0x111d11[_0xc1ad('0x16')]();}}function _0x17fcc6(){logger['info'](_0xc1ad('0x23'));_0x78e42d({'transcript':_0x17aebb,'confidence':_0x16d42e,'status':_0x1ee630,'status_message':_0x4facb3});}function _0x4ce2be(_0x219172){logger[_0xc1ad('0x13')](_0xc1ad('0x24'));if(!_[_0xc1ad('0x25')](_0x219172)){logger[_0xc1ad('0x13')](_[_0xc1ad('0x26')](_0x219172)?JSON[_0xc1ad('0x15')](_0x219172):_0x219172);}}_0x111d11['on'](_0xc1ad('0x27'),_0x5996b5);_0x111d11['on'](_0xc1ad('0x28'),_0x57e8e0);_0x111d11['on'](_0xc1ad('0x11'),_0x17fcc6);_0x111d11['on'](_0xc1ad('0x13'),_0x4ce2be);});};
\ No newline at end of file
diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js
index 473cfe8..2b03165 100644
--- a/server/services/agi/scripts/tilde/index.js
+++ b/server/services/agi/scripts/tilde/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9072=['exports','./asr'];(function(_0x2a2588,_0x524eb5){var _0x534723=function(_0x434118){while(--_0x434118){_0x2a2588['push'](_0x2a2588['shift']());}};_0x534723(++_0x524eb5);}(_0x9072,0x169));var _0x2907=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9072[_0x3dd15e];return _0x231fd0;};var asr=require(_0x2907('0x0'));module[_0x2907('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x5158=['exports','./asr'];(function(_0x4b8609,_0x45bfdc){var _0x1f2269=function(_0x50ba0a){while(--_0x50ba0a){_0x4b8609['push'](_0x4b8609['shift']());}};_0x1f2269(++_0x45bfdc);}(_0x5158,0x1d7));var _0x8515=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x5158[_0x4ed520];return _0x4415a6;};var asr=require(_0x8515('0x0'));module[_0x8515('0x1')]={'asr':asr};
\ No newline at end of file
diff --git a/server/services/agi/server.js b/server/services/agi/server.js
index 99f09f2..0b1358b 100644
--- a/server/services/agi/server.js
+++ b/server/services/agi/server.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec56=['listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen'];(function(_0x41ba15,_0x3616fc){var _0x599ed7=function(_0x2e0603){while(--_0x2e0603){_0x41ba15['push'](_0x41ba15['shift']());}};_0x599ed7(++_0x3616fc);}(_0xec56,0x1bd));var _0x6ec5=function(_0x22d18e,_0x1beaac){_0x22d18e=_0x22d18e-0x0;var _0x39e003=_0xec56[_0x22d18e];return _0x39e003;};'use strict';var util=require(_0x6ec5('0x0'));var net=require('net');var EventEmitter=require('events')[_0x6ec5('0x1')];var AGIError=require(_0x6ec5('0x2'));var AGIChannel=require(_0x6ec5('0x3'));var AGIServer=function(_0x240ccf,_0x43c2cd,_0x399441){var _0x469679=this,_0x240ccf=_0x240ccf||0x11dd,_0x43c2cd=_0x43c2cd||_0x6ec5('0x4'),_0x28b12b=null,_0x2d0a93=0x0;EventEmitter[_0x6ec5('0x5')](_0x469679);function _0x1f59cd(){if(!_0x240ccf){_0x469679[_0x6ec5('0x6')](_0x6ec5('0x7'),new AGIError(_0x6ec5('0x8')));return![];}_0x28b12b=net[_0x6ec5('0x9')]();_0x28b12b[_0x6ec5('0xa')](_0x240ccf,_0x43c2cd);_0x28b12b['on']('listening',function(){_0x469679[_0x6ec5('0x6')](_0x6ec5('0xb'));});_0x28b12b['on'](_0x6ec5('0xc'),function(_0x1964ae){_0x28b12b[_0x6ec5('0xd')](function(_0x181e79,_0x1d5b76){if(_0x181e79){_0x469679['emit'](_0x6ec5('0x7'),new AGIError(_0x6ec5('0xe'),_0x181e79));}else if(_0x399441&&_0x399441<0x0){_0x469679[_0x6ec5('0x6')](_0x6ec5('0x7'),new AGIError(_0x6ec5('0xf')));_0x1964ae[_0x6ec5('0x10')]();}else if(_0x399441&&_0x399441>0x0&&_0x399441<_0x1d5b76){_0x2d0a93+=0x1;_0x469679[_0x6ec5('0x6')](_0x6ec5('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x2d0a93));_0x1964ae[_0x6ec5('0x10')]();}else{var _0x4d1510=new AGIChannel(_0x1964ae);_0x4d1510['on'](_0x6ec5('0x11'),function(){_0x469679[_0x6ec5('0x6')](_0x6ec5('0xc'),_0x4d1510);});}});});_0x28b12b['on'](_0x6ec5('0x7'),function(_0xdc0b10){_0x469679['emit'](_0x6ec5('0x7'),new AGIError(_0x6ec5('0xe'),_0xdc0b10[_0x6ec5('0x12')]));});_0x28b12b['on'](_0x6ec5('0x13'),function(){_0x469679[_0x6ec5('0x6')](_0x6ec5('0x13'),new AGIError(_0x6ec5('0x14')));});}process[_0x6ec5('0x15')](function(){_0x1f59cd();});};util[_0x6ec5('0x16')](AGIServer,EventEmitter);module[_0x6ec5('0x17')]=function(_0x17f7a2,_0x45c230,_0x437f0f){return new AGIServer(_0x17f7a2,_0x45c230,_0x437f0f);};
\ No newline at end of file
+var _0x4a81=['net','events','EventEmitter','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','ready','code','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util'];(function(_0x36d39f,_0x2cfaae){var _0x557e80=function(_0xcab127){while(--_0xcab127){_0x36d39f['push'](_0x36d39f['shift']());}};_0x557e80(++_0x2cfaae);}(_0x4a81,0x1b7));var _0x14a8=function(_0x353f00,_0x24e3e6){_0x353f00=_0x353f00-0x0;var _0x52b24d=_0x4a81[_0x353f00];return _0x52b24d;};'use strict';var util=require(_0x14a8('0x0'));var net=require(_0x14a8('0x1'));var EventEmitter=require(_0x14a8('0x2'))[_0x14a8('0x3')];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x45869b,_0x53309b,_0x39c3d4){var _0x3363f8=this,_0x45869b=_0x45869b||0x11dd,_0x53309b=_0x53309b||_0x14a8('0x4'),_0x2cd6d2=null,_0x4aa19e=0x0;EventEmitter['call'](_0x3363f8);function _0x26e442(){if(!_0x45869b){_0x3363f8[_0x14a8('0x5')](_0x14a8('0x6'),new AGIError(_0x14a8('0x7')));return![];}_0x2cd6d2=net[_0x14a8('0x8')]();_0x2cd6d2['listen'](_0x45869b,_0x53309b);_0x2cd6d2['on']('listening',function(){_0x3363f8[_0x14a8('0x5')](_0x14a8('0x9'));});_0x2cd6d2['on'](_0x14a8('0xa'),function(_0x5673b7){_0x2cd6d2[_0x14a8('0xb')](function(_0x34f6e1,_0x357bb6){if(_0x34f6e1){_0x3363f8[_0x14a8('0x5')](_0x14a8('0x6'),new AGIError(_0x14a8('0xc'),_0x34f6e1));}else if(_0x39c3d4&&_0x39c3d4<0x0){_0x3363f8[_0x14a8('0x5')](_0x14a8('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x5673b7['destroy']();}else if(_0x39c3d4&&_0x39c3d4>0x0&&_0x39c3d4<_0x357bb6){_0x4aa19e+=0x1;_0x3363f8[_0x14a8('0x5')](_0x14a8('0x6'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4aa19e));_0x5673b7[_0x14a8('0xd')]();}else{var _0x54223b=new AGIChannel(_0x5673b7);_0x54223b['on'](_0x14a8('0xe'),function(){_0x3363f8[_0x14a8('0x5')](_0x14a8('0xa'),_0x54223b);});}});});_0x2cd6d2['on'](_0x14a8('0x6'),function(_0x31ce02){_0x3363f8[_0x14a8('0x5')]('error',new AGIError(_0x14a8('0xc'),_0x31ce02[_0x14a8('0xf')]));});_0x2cd6d2['on']('close',function(){_0x3363f8[_0x14a8('0x5')]('close',new AGIError(_0x14a8('0x10')));});}process[_0x14a8('0x11')](function(){_0x26e442();});};util[_0x14a8('0x12')](AGIServer,EventEmitter);module[_0x14a8('0x13')]=function(_0x2534e0,_0x1e9433,_0x4a87f7){return new AGIServer(_0x2534e0,_0x1e9433,_0x4a87f7);};
\ No newline at end of file
diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js
index f0e62ef..8421e0f 100644
--- a/server/services/agi/vertices.js
+++ b/server/services/agi/vertices.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4323=['awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','NOBEEP','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','getIntervals','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','success','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','agentPause','playback','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','auth','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','getSmsAccount','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','no\x20variable\x20selected','replaceAll','join','exports','lodash','shelljs','randomstring','mustache','request-promise','../../config/logger','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','open','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','log','in\x20createcmcontact','in\x20createcmcontact\x20callback','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','has','dialTimezone','VALUE\x20TZ','getContactByPhone','dialtimezone','utcOffset','minutestoadd','add','minutes','insertContact','getPause','getPauseById','agentUnpause','agentLogout','agentLogin','agent','internal','%s/%s@from-sip/n','shellCommand','exec','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','googleTTS','restAPI','url','number','includes','method','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','headers','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_polly_region','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','length','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceall\x20end','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','isConfigured','maxRetry','retry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','options','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','timeout','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','before\x20createcmcontact','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','opts','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable'];(function(_0x224532,_0x440273){var _0x3a6b95=function(_0x504d0f){while(--_0x504d0f){_0x224532['push'](_0x224532['shift']());}};_0x3a6b95(++_0x440273);}(_0x4323,0xa5));var _0x3432=function(_0x20d72e,_0x534501){_0x20d72e=_0x20d72e-0x0;var _0x2580d6=_0x4323[_0x20d72e];return _0x2580d6;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0x3432('0x0'));var sh=require(_0x3432('0x1'));var odbc=require('odbc')();var rs=require(_0x3432('0x2'));var moment=require('moment');var Mustache=require(_0x3432('0x3'));var rp=require(_0x3432('0x4'));var logger=require(_0x3432('0x5'))('agi');var config=require(_0x3432('0x6'));var shared=require('../../config/environment/shared');var scripts=require(_0x3432('0x7'));var FILES_PATH=_0x3432('0x8');var recursiveMapAttributes=[_0x3432('0x9'),_0x3432('0xa')];var verticesWithRetry=['menu',_0x3432('0xb'),'getsecretdigits'];var AGIVertices=function(_0x589e29,_0x43c83a,_0x3f8ff4){this[_0x3432('0xc')]=_0x589e29;this[_0x3432('0xd')]=_0x43c83a;this[_0x3432('0xe')]=_0x3f8ff4;};AGIVertices[_0x3432('0xf')][_0x3432('0x10')]=function(_0x1efdf9,_0xa6f337){this[_0x3432('0xd')][_0x3432('0x11')](_0x1efdf9)[_0x3432('0x12')](function(_0x21126a){_0xa6f337(null,_0x21126a?_0x21126a[_0x3432('0x13')]:![]);})[_0x3432('0x14')](function(_0x4102a1){_0xa6f337(_0x4102a1);});};AGIVertices[_0x3432('0xf')][_0x3432('0x15')]=function(_0x9b0c0d,_0x1e88a3){this[_0x3432('0xd')][_0x3432('0x16')](_0x9b0c0d)[_0x3432('0x12')](function(_0x4bb159){_0x1e88a3(null,_0x4bb159?_0x4bb159['name']:![]);})[_0x3432('0x14')](function(_0x34bd65){_0x1e88a3(_0x34bd65);});};AGIVertices['prototype'][_0x3432('0x17')]=function(_0x5b9528,_0x1f759c){this[_0x3432('0xd')][_0x3432('0x18')](_0x5b9528)[_0x3432('0x12')](function(_0x2ee63f){_0x1f759c(null,_0x2ee63f?_0x2ee63f[_0x3432('0x13')]:![]);})[_0x3432('0x14')](function(_0x2767d1){_0x1f759c(_0x2767d1);});};AGIVertices[_0x3432('0xf')]['getSquareOdbc']=function(_0x254825,_0x3e3ee9){this['rpc'][_0x3432('0x19')](_0x254825)[_0x3432('0x12')](function(_0x4474e1){_0x3e3ee9(null,_0x4474e1?_0x4474e1['dsn']:![]);})[_0x3432('0x14')](function(_0x3f6637){_0x3e3ee9(_0x3f6637);});};AGIVertices[_0x3432('0xf')]['getUser']=function(_0x297a80,_0x4786a6){this[_0x3432('0xd')][_0x3432('0x1a')](_0x297a80)[_0x3432('0x12')](function(_0x2b4a09){_0x4786a6(null,_0x2b4a09?_0x2b4a09[_0x3432('0x13')]:![]);})[_0x3432('0x14')](function(_0x4a141a){_0x4786a6(_0x4a141a);});};AGIVertices[_0x3432('0xf')][_0x3432('0x1b')]=function(_0x4c5bdf,_0x8fbefe){this[_0x3432('0xd')]['getTrunkById'](_0x4c5bdf)[_0x3432('0x12')](function(_0x3567f0){_0x8fbefe(null,_0x3567f0?_0x3567f0[_0x3432('0x13')]:![]);})[_0x3432('0x14')](function(_0x3fa7cb){_0x8fbefe(_0x3fa7cb);});};AGIVertices[_0x3432('0xf')][_0x3432('0x1c')]=function(_0x366ad8,_0x479c16){var _0x4cecc2=this;this[_0x3432('0xd')][_0x3432('0x1d')](_0x366ad8)[_0x3432('0x12')](function(_0x13d797){_0x479c16(null,_0x13d797?_0x4cecc2[_0x3432('0x1e')](_0x13d797[_0x3432('0x1f')]):![]);})[_0x3432('0x14')](function(_0x58b7a4){_0x479c16(_0x58b7a4);});};AGIVertices[_0x3432('0xf')][_0x3432('0x20')]=function(_0x2090d4,_0x335013){this[_0x3432('0xd')][_0x3432('0x21')](_0x2090d4)[_0x3432('0x12')](function(_0x4f4737){_0x335013(null,_0x4f4737?_0x4f4737:![]);})[_0x3432('0x14')](function(_0x29d5db){_0x335013(_0x29d5db);});};AGIVertices[_0x3432('0xf')][_0x3432('0x22')]=function(_0x773810,_0x473733,_0x234bdd){this[_0x3432('0xe')][_0x3432('0x22')](_0x773810,_0x473733)['then'](function(){_0x234bdd(null);})['catch'](function(_0x5cdef8){_0x234bdd(_0x5cdef8);});};AGIVertices[_0x3432('0xf')]['getIntervals']=function(_0xd8c0b6,_0x41df36){this[_0x3432('0xd')][_0x3432('0x23')](_0xd8c0b6)[_0x3432('0x12')](function(_0x30ba08){if(_0x30ba08){if(_0x30ba08[_0x3432('0x24')]){_0x41df36(null,[_0x30ba08[_0x3432('0x25')]]);}else{_0x41df36(null,_['map'](_0x30ba08[_0x3432('0x26')],_0x3432('0x25')));}}else{_0x41df36(null,![]);}})['catch'](function(_0x2475c7){_0x41df36(_0x2475c7);});};AGIVertices[_0x3432('0xf')]['getSoundPath']=function(_0x11d009){return util[_0x3432('0x27')](_0x3432('0x28'),FILES_PATH,_0x11d009);};AGIVertices['prototype']['getQueryOdbc']=function(_0x2fe4ee,_0x581ba4,_0x1e3e7){odbc[_0x3432('0x29')](_0x2fe4ee,function(_0x39a4ee){if(_0x39a4ee){logger['error'](_0x3432('0x2a'),_0x39a4ee);_0x1e3e7(_0x39a4ee);}else{logger['info'](_0x3432('0x2b'));odbc[_0x3432('0x2c')](_0x581ba4,function(_0x38cbca,_0x2409d6){if(_0x38cbca){logger[_0x3432('0x2d')]('Error\x20executing\x20query\x20%s',_0x581ba4);_0x1e3e7(_0x38cbca);}else{logger[_0x3432('0x2d')](_0x3432('0x2e'),_0x581ba4);odbc[_0x3432('0x2f')](function(_0x1d8fdc){if(_0x1d8fdc){logger[_0x3432('0x30')](_0x3432('0x31'),_0x1d8fdc);}_0x1e3e7(null,_0x2409d6);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0xd5323e,_0x10e2e1){this[_0x3432('0xd')]['getSmsAccountById'](_0xd5323e)[_0x3432('0x12')](function(_0x4cf2e9){_0x10e2e1(null,_0x4cf2e9?_0x4cf2e9:![]);})[_0x3432('0x14')](function(_0x1c5a8c){_0x10e2e1(_0x1c5a8c);});};AGIVertices['prototype']['createSmsMessage']=function(_0xad8814,_0x26a903){this[_0x3432('0xd')][_0x3432('0x32')](_0xad8814)[_0x3432('0x12')](function(_0x42b3b1){_0x26a903(null,_0x42b3b1);})[_0x3432('0x14')](function(_0x13df73){_0x26a903(_0x13df73);});};AGIVertices[_0x3432('0xf')][_0x3432('0x33')]=function(_0x559dac,_0x306dad,_0x4c10ad){this[_0x3432('0xd')][_0x3432('0x33')]({'uniqueid':this['channel'][_0x3432('0x34')],'node':_0x559dac[_0x3432('0x35')],'application':_0x559dac[_0x3432('0x36')],'data':_0x306dad||null,'project_name':this[_0x3432('0xc')][_0x3432('0x37')],'callerid':this[_0x3432('0xc')][_0x3432('0x38')]})[_0x3432('0x12')](function(_0x5e970f){if(_0x4c10ad){_0x4c10ad(null,_0x5e970f);}})['catch'](function(_0x33249f){if(_0x4c10ad){_0x4c10ad(_0x33249f);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x427bbc,_0x243fa1,_0x4bfd0c,_0xc4b652){this['rpc'][_0x3432('0x39')]({'uniqueid':this[_0x3432('0xc')]['uniqueid'],'callerid':this[_0x3432('0xc')][_0x3432('0x38')],'calleridname':this[_0x3432('0xc')][_0x3432('0x3a')],'context':this['channel'][_0x3432('0x3b')],'extension':this[_0x3432('0xc')]['extension'],'priority':this['channel'][_0x3432('0x3c')],'accountcode':this[_0x3432('0xc')][_0x3432('0x3d')],'dnid':this[_0x3432('0xc')][_0x3432('0x3e')],'projectName':this[_0x3432('0xc')][_0x3432('0x37')],'saveName':_0x243fa1,'filename':_0x427bbc[_0x3432('0x3f')]||_0x243fa1,'savePath':_0x4bfd0c})[_0x3432('0x12')](function(_0xe6b618){_0xc4b652(null,_0xe6b618);})['catch'](function(_0x239003){_0xc4b652(_0x239003);});};AGIVertices['prototype'][_0x3432('0x40')]=function(_0x57ae90,_0x4ebc02,_0x57cb31){this['rpc']['createSquareMessage']({'uniqueid':this[_0x3432('0xc')]['uniqueid'],'body':_0x57ae90,'direction':_0x4ebc02})[_0x3432('0x12')](function(_0x430bd6){if(_0x57cb31){_0x57cb31(null,_0x430bd6);}})[_0x3432('0x14')](function(_0x15a25b){if(_0x57cb31){_0x57cb31(_0x15a25b);}});};AGIVertices[_0x3432('0xf')][_0x3432('0x41')]=function(_0x301589,_0x46697c){console[_0x3432('0x42')](_0x3432('0x43'),_0x301589);console[_0x3432('0x42')](_0x3432('0x44'),_0x46697c);var _0x26725f=0x0;var _0x3979b9={'firstName':_['isEmpty'](_0x301589[_0x3432('0x13')])||_[_0x3432('0x45')](_0x301589[_0x3432('0x13')])?_0x3432('0x46')+Math[_0x3432('0x47')]():_0x301589[_0x3432('0x13')],'lastName':_[_0x3432('0x48')](_0x301589[_0x3432('0x49')])||_[_0x3432('0x45')](_0x301589[_0x3432('0x49')])?null:_0x301589[_0x3432('0x49')],'phone':_0x301589[_0x3432('0x4a')],'ListId':_0x301589[_0x3432('0x4b')],'scheduledat':_0x301589[_0x3432('0x4c')],'callbackUniqueid':this[_0x3432('0xc')][_0x3432('0x34')],'tags':_0x3432('0x4d'),'description':'Callback\x20scheduled\x20at\x20'+_0x301589[_0x3432('0x4c')][_0x3432('0x4e')](),'priority':_0x301589[_0x3432('0x4f')]};if(_[_0x3432('0x50')](_0x301589,'dialTimezone')){if(!_[_0x3432('0x45')](_0x301589[_0x3432('0x51')])){var _0x5e7c41=_0x301589[_0x3432('0x51')];console['log'](_0x3432('0x52'),_0x5e7c41);if(_0x301589['dialTimezone']=='CALLERID(dialTimezone)'){this['rpc'][_0x3432('0x53')]({'phone':_0x301589['phone']})[_0x3432('0x12')](function(_0x2904f3){console[_0x3432('0x42')]('RES1',_0x2904f3);var _0x37f27b=_0x2904f3[_0x3432('0x51')];console['log'](_0x3432('0x54'),_0x37f27b);if(!_[_0x3432('0x45')](_0x37f27b)){var _0x4a86d1=shared[_0x37f27b];console[_0x3432('0x42')]('tz',_0x4a86d1);if(!_[_0x3432('0x45')](_0x4a86d1)){var _0x38a502=-0x1*_0x4a86d1[_0x3432('0x55')];console[_0x3432('0x42')](_0x3432('0x56'),_0x38a502);console[_0x3432('0x42')]('scheduledat\x20before',_0x3979b9[_0x3432('0x4c')]);_0x3979b9[_0x3432('0x4c')]=moment(_0x301589[_0x3432('0x4c')])[_0x3432('0x57')](_0x38a502,_0x3432('0x58'));console['log']('scheduledat\x20after',_0x3979b9[_0x3432('0x4c')]);this[_0x3432('0xd')][_0x3432('0x59')](_0x3979b9,_0x301589,_0x46697c)[_0x3432('0x12')](function(_0x18b49f){_0x46697c(null,_0x18b49f);})[_0x3432('0x14')](function(_0x134956){_0x46697c(_0x134956);});}else{this[_0x3432('0xd')]['insertContact'](_0x3979b9,_0x301589,_0x46697c)['then'](function(_0x36a64b){_0x46697c(null,_0x36a64b);})['catch'](function(_0x1e6580){_0x46697c(_0x1e6580);});}}else{this[_0x3432('0xd')][_0x3432('0x59')](_0x3979b9,_0x301589,_0x46697c)[_0x3432('0x12')](function(_0x302f35){_0x46697c(null,_0x302f35);})['catch'](function(_0x1f1c52){_0x46697c(_0x1f1c52);});}});}else{var _0x26725f=shared[_0x5e7c41];if(!_[_0x3432('0x45')](_0x26725f)){var _0x9cbbca=-0x1*_0x26725f[_0x3432('0x55')];_0x3979b9[_0x3432('0x4c')]=moment(_0x301589[_0x3432('0x4c')])[_0x3432('0x57')](_0x9cbbca,_0x3432('0x58'));this[_0x3432('0xd')][_0x3432('0x59')](_0x3979b9,_0x301589,_0x46697c)['then'](function(_0x13c094){_0x46697c(null,_0x13c094);})[_0x3432('0x14')](function(_0x48aabb){_0x46697c(_0x48aabb);});}else{this[_0x3432('0xd')]['insertContact'](_0x3979b9,_0x301589,_0x46697c)[_0x3432('0x12')](function(_0x55c49b){_0x46697c(null,_0x55c49b);})[_0x3432('0x14')](function(_0x38161c){_0x46697c(_0x38161c);});}}}else{this[_0x3432('0xd')][_0x3432('0x59')](_0x3979b9,_0x301589,_0x46697c)[_0x3432('0x12')](function(_0x734743){_0x46697c(null,_0x734743);})[_0x3432('0x14')](function(_0x2e49e4){_0x46697c(_0x2e49e4);});}}else{this[_0x3432('0xd')][_0x3432('0x59')](_0x3979b9,_0x301589,_0x46697c)[_0x3432('0x12')](function(_0x5a499d){_0x46697c(null,_0x5a499d);})['catch'](function(_0x81ef67){_0x46697c(_0x81ef67);});}};AGIVertices[_0x3432('0xf')]['insertContact']=function(_0x3bdcba,_0x17ccc2,_0x114fb8){this[_0x3432('0xd')]['createCmContact'](_0x3bdcba)['then'](function(_0x58ffaf){_0x114fb8(null,_0x58ffaf);})[_0x3432('0x14')](function(_0x5a68b9){_0x114fb8(_0x5a68b9);});};AGIVertices[_0x3432('0xf')][_0x3432('0x5a')]=function(_0x4aea01,_0x317049){this[_0x3432('0xd')][_0x3432('0x5b')](_0x4aea01)[_0x3432('0x12')](function(_0xc29951){_0x317049(null,_0xc29951?_0xc29951[_0x3432('0x13')]:![]);})[_0x3432('0x14')](function(_0x506695){_0x317049(_0x506695);});};AGIVertices['prototype']['agentPause']=function(_0x3f09bd,_0x53e2fd,_0x1e8009){var _0x1dce33={'role':'agent'};_0x1dce33[_0x3f09bd]=this[_0x3432('0xc')][_0x3432('0x38')];this[_0x3432('0xd')]['agentPause'](_0x1dce33,_0x53e2fd,this[_0x3432('0xc')][_0x3432('0x34')])['then'](function(_0x3186f3){_0x1e8009(null,_['isNil'](_0x3186f3)?![]:!![]);})[_0x3432('0x14')](function(_0x4e501f){logger[_0x3432('0x30')](_0x4e501f);_0x1e8009(null,![]);});};AGIVertices[_0x3432('0xf')][_0x3432('0x5c')]=function(_0x538f97,_0x15afb3){var _0x2a4dc2={'role':'agent'};_0x2a4dc2[_0x538f97]=this[_0x3432('0xc')][_0x3432('0x38')];this[_0x3432('0xd')]['agentUnpause'](_0x2a4dc2)[_0x3432('0x12')](function(_0x5e2bef){_0x15afb3(null,_[_0x3432('0x45')](_0x5e2bef)?![]:!![]);})[_0x3432('0x14')](function(_0x294853){logger[_0x3432('0x30')](_0x294853);_0x15afb3(null,![]);});};AGIVertices[_0x3432('0xf')][_0x3432('0x5d')]=function(_0x3ea7bc,_0x336cc6){var _0x295e51={'role':'agent'};_0x295e51[_0x3ea7bc]=this[_0x3432('0xc')][_0x3432('0x38')];this['rpc'][_0x3432('0x5d')](_0x295e51)['then'](function(_0x3f318a){_0x336cc6(null,_[_0x3432('0x45')](_0x3f318a)?![]:!![]);})[_0x3432('0x14')](function(_0x4ba20f){logger['error'](_0x4ba20f);_0x336cc6(null,![]);});};AGIVertices[_0x3432('0xf')][_0x3432('0x5e')]=function(_0x325f9a,_0x51216f){var _0x2edc41={'role':_0x3432('0x5f')};_0x2edc41[_0x325f9a]=this['channel'][_0x3432('0x38')];var _0x5ec131=_0x325f9a!=_0x3432('0x60')?util[_0x3432('0x27')](_0x3432('0x61'),'LOCAL',this['channel'][_0x3432('0x38')]):undefined;this[_0x3432('0xd')][_0x3432('0x5e')](_0x2edc41,_0x5ec131)[_0x3432('0x12')](function(_0x47c181){_0x51216f(null,_[_0x3432('0x45')](_0x47c181)?![]:!![]);})[_0x3432('0x14')](function(_0x44161a){logger['error'](_0x44161a);_0x51216f(null,![]);});};AGIVertices[_0x3432('0xf')][_0x3432('0x62')]=function(_0x1530b4,_0x4be12f){sh[_0x3432('0x63')](_['trim'](_0x1530b4),function(_0x1ee82c,_0x3b3e65){var _0x22b241=_0x3b3e65[_0x3432('0x64')](/(\r\n|\n|\r)/gm,'');_0x4be12f(null,_0x22b241);});};AGIVertices[_0x3432('0xf')][_0x3432('0x65')]=function(_0x3bedfe,_0x277093){scripts[_0x3432('0x65')](_0x3bedfe['apiKey'],_0x3bedfe[_0x3432('0x66')]||_0x3432('0x67'),_0x3bedfe[_0x3432('0x67')],_0x3bedfe['languageCode']||_0x3432('0x68'),_0x3bedfe[_0x3432('0x69')]||'MALE',_0x3bedfe[_0x3432('0x6a')]||'MP3')[_0x3432('0x12')](function(_0xb8ac0e){_0x277093(null,_0xb8ac0e);})[_0x3432('0x14')](function(_0x99ab6b){_0x277093(_0x99ab6b);});};AGIVertices[_0x3432('0xf')][_0x3432('0x6b')]=function(_0x24a541,_0xa70ade){scripts[_0x3432('0x6b')](_0x24a541[_0x3432('0x67')],_0x24a541['google_tts_language']||'en',0x1)[_0x3432('0x12')](function(_0x55964f){_0xa70ade(null,_0x55964f);})[_0x3432('0x14')](function(_0x213a16){_0xa70ade(_0x213a16);});};AGIVertices[_0x3432('0xf')][_0x3432('0x6c')]=function(_0x1574f6,_0x51edfe){var _0x3d58dc={'uri':_0x1574f6[_0x3432('0x6d')],'method':_0x1574f6['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1574f6['timeout'])===_0x3432('0x6e')&&parseInt(_0x1574f6['timeout'])>=0x1?parseInt(_0x1574f6['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x3432('0x6f')](['POST','PUT'],_0x3d58dc[_0x3432('0x70')]['toUpperCase']())){try{_0x3d58dc['body']=_0x1574f6[_0x3432('0xa')]?JSON[_0x3432('0x71')](_0x1574f6[_0x3432('0xa')]):{};}catch(_0x21ef32){logger[_0x3432('0x30')](_0x3432('0x72'),_0x21ef32);}}try{_0x3d58dc['headers']=_0x1574f6[_0x3432('0x9')]?JSON[_0x3432('0x71')](_0x1574f6[_0x3432('0x9')]):{};}catch(_0x5a3b2c){logger['error'](_0x3432('0x73'),_0x5a3b2c);}if(_0x1574f6['computedVariables']){try{var _0x1ce042=require(_0x1574f6[_0x3432('0x74')])['sync'](this,_0x3d58dc);_0x3d58dc[_0x3432('0x75')]=Mustache[_0x3432('0x76')](_0x1574f6[_0x3432('0x6d')],_0x1ce042,{},['$$','$$']);if(_0x3d58dc[_0x3432('0x77')]){_0x3d58dc[_0x3432('0x77')]=JSON[_0x3432('0x71')](Mustache['render'](JSON[_0x3432('0x78')](_0x3d58dc[_0x3432('0x77')]),_0x1ce042,{},['$$','$$']));}if(_0x3d58dc[_0x3432('0x79')]){_0x3d58dc[_0x3432('0x79')]=JSON[_0x3432('0x71')](Mustache['render'](JSON[_0x3432('0x78')](_0x3d58dc['body']),_0x1ce042,{},['$$','$$']));}}catch(_0x8ad178){logger[_0x3432('0x30')](_0x3432('0x7a'),_0x8ad178);}}rp(_0x3d58dc)[_0x3432('0x12')](function(_0x416d8a){var _0x556f38={'statusCode':_0x416d8a[_0x3432('0x7b')]||0xc8,'statusMessage':_0x416d8a[_0x3432('0x7c')]||'OK','headers':_0x416d8a[_0x3432('0x77')]||{},'body':_0x416d8a[_0x3432('0x79')]||{}};_0x51edfe(null,_0x556f38);})[_0x3432('0x14')](function(_0x3751b4){var _0x692c34={'statusCode':_0x3751b4[_0x3432('0x7b')]||0x1f4,'statusMessage':_0x3751b4[_0x3432('0x7d')]||_0x3432('0x7e'),'headers':_0x3751b4['options'][_0x3432('0x77')]||{},'body':_0x3751b4['options'][_0x3432('0x79')]||{}};_0x51edfe(null,_0x692c34);});};AGIVertices['prototype'][_0x3432('0x7f')]=function(_0xbb4c5,_0x634758){scripts[_0x3432('0x7f')](this[_0x3432('0xc')][_0x3432('0x34')],_0xbb4c5[_0x3432('0x80')],_0xbb4c5[_0x3432('0x67')],_0xbb4c5[_0x3432('0x81')]||'en')[_0x3432('0x12')](function(_0x1a0888){_0x634758(null,_0x1a0888);})['catch'](function(_0x4c93d8){_0x634758(_0x4c93d8);});};AGIVertices[_0x3432('0xf')][_0x3432('0x82')]=function(_0x9ceeff,_0x440982){scripts['sestekNDA'](this[_0x3432('0xc')],_0x9ceeff)[_0x3432('0x12')](function(_0x466301){_0x440982(null,_0x466301);})[_0x3432('0x14')](function(_0x46736f){_0x440982(_0x46736f);});};AGIVertices['prototype'][_0x3432('0x83')]=function(_0x1e67ec,_0x55d186){scripts[_0x3432('0x83')](_0x1e67ec[_0x3432('0x80')],_0x1e67ec['text'],_0x1e67ec[_0x3432('0x84')]||_0x3432('0x68'),_0x1e67ec['speed'])['then'](function(_0x41bde1){_0x55d186(null,_0x41bde1);})['catch'](function(_0xd87d21){_0x55d186(_0xd87d21);});};AGIVertices[_0x3432('0xf')][_0x3432('0x85')]=function(_0x8b665c,_0x33990c,_0x37313a){scripts[_0x3432('0x85')](_0x33990c,_0x8b665c[_0x3432('0x80')],_0x8b665c[_0x3432('0x86')]||_0x3432('0x68'),this['isConfigured'](_0x8b665c[_0x3432('0x87')])?_0x8b665c['model']:undefined)[_0x3432('0x12')](function(_0x1b5326){_0x37313a(null,_0x1b5326);})[_0x3432('0x14')](function(_0x3cfd34){_0x37313a(_0x3cfd34);});};AGIVertices[_0x3432('0xf')][_0x3432('0x88')]=function(_0x5ec81c,_0x1f1c93){scripts[_0x3432('0x88')](_0x5ec81c['aws_access_key_id'],_0x5ec81c['aws_secret_access_key'],_0x5ec81c[_0x3432('0x89')],_0x5ec81c['aws_polly_voice']||_0x3432('0x8a'),_0x5ec81c['text'],_0x5ec81c[_0x3432('0x8b')]||_0x3432('0x67'))[_0x3432('0x12')](function(_0x1ac74b){_0x1f1c93(null,_0x1ac74b);})[_0x3432('0x14')](function(_0x39df99){_0x1f1c93(_0x39df99);});};AGIVertices[_0x3432('0xf')][_0x3432('0x8c')]=function(_0x45ba9f,_0x3fe190){scripts['awsLex'](this[_0x3432('0xc')][_0x3432('0x34')],_0x45ba9f['aws_access_key_id'],_0x45ba9f[_0x3432('0x8d')],_0x45ba9f[_0x3432('0x8e')],_0x45ba9f[_0x3432('0x67')],_0x45ba9f['aws_bot_name'])[_0x3432('0x12')](function(_0x9ead0){_0x3fe190(null,_0x9ead0);})[_0x3432('0x14')](function(_0xac7490){_0x3fe190(_0xac7490);});};AGIVertices['prototype'][_0x3432('0x8f')]=function(_0x43979b,_0x14cc75,_0x2c5143){scripts[_0x3432('0x8f')](_0x14cc75,_0x43979b[_0x3432('0x80')],_0x43979b[_0x3432('0x90')]||_0x3432('0x68'))[_0x3432('0x12')](function(_0x3c3e5f){_0x2c5143(null,_0x3c3e5f);})[_0x3432('0x14')](function(_0x4e0fd8){_0x2c5143(_0x4e0fd8);});};AGIVertices['prototype']['tildeASR']=function(_0x1ddbcc,_0x22c88c,_0x547b19){scripts[_0x3432('0x91')](_0x22c88c,_0x1ddbcc['appid'],_0x1ddbcc[_0x3432('0x92')],_0x1ddbcc[_0x3432('0x75')])[_0x3432('0x12')](function(_0x4269a2){_0x547b19(null,_0x4269a2);})[_0x3432('0x14')](function(_0x19c4b9){_0x547b19(_0x19c4b9);});};AGIVertices[_0x3432('0xf')][_0x3432('0x93')]=function(_0x4b35e){var _0x6f0c1a=_[_0x3432('0x6f')](verticesWithRetry,_0x4b35e[_0x3432('0x36')])?_0x4b35e:_[_0x3432('0x94')](_0x4b35e);for(var _0x5f4497 in _0x6f0c1a){if(_0x6f0c1a['hasOwnProperty'](_0x5f4497)){if(_0x6f0c1a[_0x5f4497]&&_[_0x3432('0x95')](_0x6f0c1a[_0x5f4497])){if(_[_0x3432('0x6f')](recursiveMapAttributes,_0x5f4497)){_0x6f0c1a[_0x5f4497]=this[_0x3432('0x96')](_0x6f0c1a[_0x5f4497]);}else{_0x6f0c1a[_0x5f4497]=this[_0x3432('0x97')](_0x6f0c1a[_0x5f4497]);}}}}return _0x6f0c1a;};AGIVertices[_0x3432('0xf')][_0x3432('0x98')]=function(_0xaabee5){for(var _0x31eff3 in _0xaabee5){if(_0xaabee5[_0x3432('0x99')](_0x31eff3)){if(_[_0x3432('0x9a')](_0xaabee5[_0x31eff3])){this[_0x3432('0x98')](_0xaabee5[_0x31eff3]);}else if(_['isArray'](_0xaabee5[_0x31eff3])){for(var _0x43b30d=0x0;_0x43b30d<_0xaabee5[_0x31eff3][_0x3432('0x9b')];_0x43b30d++){this[_0x3432('0x98')](_0xaabee5[_0x31eff3][_0x43b30d]);}}else if(_['isString'](_0xaabee5[_0x31eff3])){_0xaabee5[_0x31eff3]=this[_0x3432('0x97')](_0xaabee5[_0x31eff3]);}}}};AGIVertices[_0x3432('0xf')][_0x3432('0x9c')]=function(_0x4a6996,_0x2e2fd8){for(var _0x1fa115 in _0x4a6996){if(_0x4a6996[_0x3432('0x99')](_0x1fa115)){if(_['isPlainObject'](_0x4a6996[_0x1fa115])){if(!_['isEmpty'](_0x4a6996[_0x1fa115])){this['saveRestApiResult'](_0x4a6996[_0x1fa115],util[_0x3432('0x27')](_0x3432('0x9d'),_0x2e2fd8,_0x1fa115));}}else if(_[_0x3432('0x9e')](_0x4a6996[_0x1fa115])){for(var _0x33882f=0x0;_0x33882f<_0x4a6996[_0x1fa115][_0x3432('0x9b')];_0x33882f++){this[_0x3432('0x9c')](_0x4a6996[_0x1fa115][_0x33882f],util[_0x3432('0x27')]('%s.%s',_0x2e2fd8,_0x1fa115+'['+_0x33882f+']'));}}else{if(!_[_0x3432('0x45')](_0x4a6996[_0x1fa115])){this[_0x3432('0xc')][_0x3432('0x9f')](util[_0x3432('0x27')](_0x3432('0x9d'),_0x2e2fd8,_0x1fa115),_0x4a6996[_0x1fa115]);}}}}};AGIVertices['prototype'][_0x3432('0x96')]=function(_0x5f3412){try{var _0xcf3889=JSON[_0x3432('0x71')](_0x5f3412);this['recursiveNodeIndex'](_0xcf3889);return JSON[_0x3432('0x78')](_0xcf3889);}catch(_0x45a7a4){return this[_0x3432('0x97')](_0x5f3412);}};AGIVertices['prototype'][_0x3432('0x97')]=function(_0x4b3ca4){console[_0x3432('0x42')]('replaceall\x20init',_0x4b3ca4);var _0x21b56e=_0x4b3ca4[_0x3432('0xa0')]('{');for(var _0x18a75b=0x1;_0x18a75b<_0x21b56e[_0x3432('0x9b')];_0x18a75b+=0x1){var _0x411d95=_0x21b56e[_0x18a75b][_0x3432('0xa0')]('}');console[_0x3432('0x42')]('nextbracket',_0x411d95);if(_0x411d95[_0x3432('0x9b')]>0x1){_0x4b3ca4=_0x4b3ca4['replaceAll']('{'+_0x411d95[0x0]+'}',this['channel'][_0x3432('0x10')](_0x411d95[0x0])['extra']||_0x411d95[0x0]);}}if(_0x21b56e[_0x3432('0x9b')]===0x1){return _0x4b3ca4[_0x3432('0x4e')]();}console[_0x3432('0x42')](_0x3432('0xa1'),_0x4b3ca4);return this[_0x3432('0x97')](_0x4b3ca4);};AGIVertices[_0x3432('0xf')][_0x3432('0xa2')]=function(_0x5bd71a,_0xd60f9){var _0x24c75b=this[_0x3432('0xc')]['getVariable'](_0x5bd71a);if(_0x24c75b[_0x3432('0xa3')]===-0x1){return _0x24c75b;}logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0xa4'),_0xd60f9,_0x24c75b[_0x3432('0xa5')]));return this['channel']['setVariable'](_0xd60f9,_0x24c75b[_0x3432('0xa5')]);};AGIVertices['prototype'][_0x3432('0xa6')]=function(_0x23c966){return _0x23c966&&_0x23c966!=='0'&&_0x23c966!=='-1'&&_0x23c966!=='';};AGIVertices[_0x3432('0xf')][_0x3432('0xa7')]=function(_0x155d2b){this[_0x3432('0x33')]['sync'](this,_0x155d2b,'-');_0x155d2b[_0x3432('0xa8')]=_0x155d2b[_0x3432('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3432('0xf')][_0x3432('0xa9')]=function(_0x48b6d8){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x48b6d8[_0x3432('0x35')]));if(!this['isConfigured'](_0x48b6d8[_0x3432('0x67')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xab'));}var _0x46db9d='\x22'+_0x48b6d8[_0x3432('0x67')]+'\x22';if(this[_0x3432('0xa6')](_0x48b6d8['options'])){_0x46db9d+=','+_0x48b6d8['options'];}var _0x45c6d0=this[_0x3432('0xc')][_0x3432('0x63')](_0x3432('0xac'),_0x46db9d);if(_0x45c6d0[_0x3432('0xa3')]===-0x1){return _0x45c6d0;}return this[_0x3432('0xc')][_0x3432('0xaa')](util['format'](_0x3432('0xad'),_0x46db9d));};AGIVertices[_0x3432('0xf')][_0x3432('0xae')]=function(_0x59cdaf){logger[_0x3432('0x2d')](util['format'](_0x3432('0xaf'),_0x59cdaf[_0x3432('0x35')]));if(!this['isConfigured'](_0x59cdaf[_0x3432('0xb0')])){return this[_0x3432('0xc')][_0x3432('0xaa')]('no\x20grammar\x20configured');}var _0x236462=_0x59cdaf[_0x3432('0xb0')];if(this[_0x3432('0xa6')](_0x59cdaf['options'])){_0x236462+=','+_0x59cdaf[_0x3432('0xb1')];}var _0x49deef=this['channel']['exec'](_0x3432('0xb2'),_0x236462);if(_0x49deef[_0x3432('0xa3')]===-0x1){return _0x49deef;}var _0x32bba2=this[_0x3432('0xa2')](_0x3432('0xb3'),_0x3432('0xb4'));if(_0x32bba2[_0x3432('0xa3')]===-0x1){return _0x32bba2;}var _0x1d7c61=this[_0x3432('0xa2')](_0x3432('0xb5'),_0x3432('0xb6'));if(_0x1d7c61[_0x3432('0xa3')]===-0x1){return _0x1d7c61;}var _0x1611fc=this[_0x3432('0xa2')](_0x3432('0xb7'),_0x3432('0xb8'));if(_0x1611fc['result']===-0x1){return _0x1611fc;}return this[_0x3432('0xc')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x236462));};AGIVertices[_0x3432('0xf')][_0x3432('0xb9')]=function(_0x5b5f25){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0xba'),_0x5b5f25[_0x3432('0x35')]));return this[_0x3432('0xc')][_0x3432('0xb9')]([_0x5b5f25[_0x3432('0xbb')],_0x5b5f25[_0x3432('0xbc')]]);};AGIVertices['prototype']['answer']=function(_0x14e6c3){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x14e6c3[_0x3432('0x35')]));if(this[_0x3432('0xa6')](_0x14e6c3[_0x3432('0xbd')])){logger[_0x3432('0x2d')](util['format'](_0x3432('0xbe'),_0x14e6c3[_0x3432('0xbd')]));var _0x17adf4=this[_0x3432('0xc')]['wait'](_0x14e6c3['timeout']);if(_0x17adf4[_0x3432('0xa3')]===-0x1){return _0x17adf4;}}return this[_0x3432('0xc')][_0x3432('0xbf')]();};AGIVertices[_0x3432('0xf')]['callback']=function(_0xee1ec){console['log']('enter\x20in\x20callbackblock',_0xee1ec);logger[_0x3432('0x2d')](util['format'](_0x3432('0xc0'),_0xee1ec[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0xee1ec[_0x3432('0x4b')])){return this[_0x3432('0xc')][_0x3432('0x30')](_0xee1ec,_0x3432('0xc1'));}_0xee1ec[_0x3432('0x4c')]=moment();if(this[_0x3432('0xa6')](_0xee1ec['delay'])){_0xee1ec[_0x3432('0x4c')]=moment()[_0x3432('0x57')](_0xee1ec['delay'],_0x3432('0x58'));}if(!this[_0x3432('0xa6')](_0xee1ec[_0x3432('0x4f')])){_0xee1ec[_0x3432('0x4f')]=0x2;}console[_0x3432('0x42')](_0x3432('0xc2'),_0xee1ec);this[_0x3432('0x41')][_0x3432('0xc3')](this,_0xee1ec);return this['channel'][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0xc4'),_0xee1ec[_0x3432('0x4a')],_0xee1ec[_0x3432('0x4b')],_0xee1ec['scheduledAt']));};AGIVertices[_0x3432('0xf')][_0x3432('0xc5')]=function(_0x5f2db6){logger['info'](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x5f2db6[_0x3432('0x35')]));var _0x1acb09=this[_0x3432('0xc')][_0x3432('0x63')](_0x5f2db6[_0x3432('0xc6')],_0x5f2db6[_0x3432('0xb1')]);if(_0x1acb09[_0x3432('0xa3')]===-0x1){return _0x1acb09;}return this[_0x3432('0xc')][_0x3432('0xaa')](util['format']('Executed\x20command\x20%s\x20%s',_0x5f2db6[_0x3432('0xc6')],_0x5f2db6[_0x3432('0xb1')]));};AGIVertices[_0x3432('0xf')][_0x3432('0xc7')]=function(_0x562f08){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0xc8'),_0x562f08['label']));if(!this[_0x3432('0xa6')](_0x562f08['text'])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xab'));}var _0x403fa4='\x22'+_0x562f08[_0x3432('0x67')]+'\x22';if(this['isConfigured'](_0x562f08[_0x3432('0xb1')])){_0x403fa4+=','+_0x562f08['options'];}var _0x5227af=this[_0x3432('0xc')]['exec'](_0x3432('0xac'),_0x403fa4);if(_0x5227af[_0x3432('0xa3')]===-0x1){return _0x5227af;}return this[_0x3432('0xc')]['noop'](util[_0x3432('0x27')](_0x3432('0xad'),_0x403fa4));};AGIVertices['prototype'][_0x3432('0xc9')]=function(_0x4749c8){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0xca'),_0x4749c8[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x4749c8['text'])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xab'));}var _0x54b344='\x22'+_0x4749c8[_0x3432('0x67')]+'\x22';if(this[_0x3432('0xa6')](_0x4749c8[_0x3432('0xb1')])){_0x54b344+=','+_0x4749c8['options'];}var _0x20241f=this['channel'][_0x3432('0x63')](_0x3432('0xac'),_0x54b344);if(_0x20241f[_0x3432('0xa3')]===-0x1){return _0x20241f;}return this[_0x3432('0xc')][_0x3432('0xaa')](util['format'](_0x3432('0xad'),_0x54b344));};AGIVertices[_0x3432('0xf')][_0x3432('0xcb')]=function(_0x2e9061){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0xcc'),_0x2e9061[_0x3432('0x35')]));if(!this['isConfigured'](_0x2e9061['grammar'])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xcd'));}var _0x21e351=_0x2e9061['grammar'];if(this['isConfigured'](_0x2e9061[_0x3432('0xb1')])){_0x21e351+=','+_0x2e9061['options'];}var _0x23d114=this['channel']['exec']('MRCPRecog',_0x21e351);if(_0x23d114['result']===-0x1){return _0x23d114;}var _0x1d7b3a=this[_0x3432('0xa2')](_0x3432('0xb3'),_0x3432('0xce'));if(_0x1d7b3a[_0x3432('0xa3')]===-0x1){return _0x1d7b3a;}var _0x1722d9=this[_0x3432('0xa2')](_0x3432('0xb5'),_0x3432('0xcf'));if(_0x1722d9['result']===-0x1){return _0x1722d9;}var _0x3fff35=this[_0x3432('0xa2')](_0x3432('0xb7'),_0x3432('0xd0'));if(_0x3fff35['result']===-0x1){return _0x3fff35;}return this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x21e351));};AGIVertices[_0x3432('0xf')]['sestekasr']=function(_0x1013f3){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0xd1'),_0x1013f3[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x1013f3[_0x3432('0xb0')])){return this['channel'][_0x3432('0xaa')](_0x3432('0xcd'));}var _0x56a4e2=_0x1013f3[_0x3432('0xb0')];if(this[_0x3432('0xa6')](_0x1013f3[_0x3432('0xb1')])){_0x56a4e2+=','+_0x1013f3[_0x3432('0xb1')];}var _0x50532f=this[_0x3432('0xc')]['exec']('MRCPRecog',_0x56a4e2);if(_0x50532f['result']===-0x1){return _0x50532f;}var _0x3e3bf5=this[_0x3432('0xa2')](_0x3432('0xb3'),_0x3432('0xd2'));if(_0x3e3bf5[_0x3432('0xa3')]===-0x1){return _0x3e3bf5;}var _0x3762ac=this[_0x3432('0xa2')](_0x3432('0xb5'),_0x3432('0xd3'));if(_0x3762ac['result']===-0x1){return _0x3762ac;}var _0x1dd7a4=this[_0x3432('0xa2')](_0x3432('0xb7'),'SESTEK_ASR_INSTANCE');if(_0x1dd7a4[_0x3432('0xa3')]===-0x1){return _0x1dd7a4;}return this[_0x3432('0xc')]['noop'](util[_0x3432('0x27')](_0x3432('0xd4'),_0x56a4e2));};AGIVertices[_0x3432('0xf')]['database']=function(_0x3d1128){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3d1128['label']));if(!this[_0x3432('0xa6')](_0x3d1128[_0x3432('0xd5')])){return this[_0x3432('0xc')][_0x3432('0x30')](_0x3d1128,_0x3432('0xd6'));}var _0x4fbd8d=this[_0x3432('0xd7')][_0x3432('0xc3')](this,_0x3d1128[_0x3432('0xd5')]);if(!_0x4fbd8d){return this[_0x3432('0xc')][_0x3432('0x30')](_0x3d1128,_0x3432('0xd8'));}if(!this[_0x3432('0xa6')](_0x3d1128[_0x3432('0x2c')])){return this['channel'][_0x3432('0x30')](_0x3d1128,'no\x20query\x20configured');}var _0x44304f=_0x3d1128[_0x3432('0x2c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0xd9'),_0x44304f));var _0x356107=this[_0x3432('0xda')]['sync'](this,_0x4fbd8d,_0x44304f);this['createSquareDetailsReport']['sync'](this,_0x3d1128,_0x44304f);if(!this[_0x3432('0xa6')](_0x3d1128[_0x3432('0xdb')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xdc'));}var _0x18759d=this[_0x3432('0x10')][_0x3432('0xc3')](this,_0x3d1128[_0x3432('0xdb')]);if(!_0x18759d){return this[_0x3432('0xc')][_0x3432('0x30')](_0x3d1128,'no\x20variable\x20found');}var _0x35146d=this;_0x356107[_0x3432('0xdd')](function(_0x27b221,_0x553050){Object[_0x3432('0xde')](_0x27b221)[_0x3432('0xdd')](function(_0x11e359){_0x35146d[_0x3432('0xc')][_0x3432('0x9f')](util[_0x3432('0x27')]('%s[%s][%s]',_0x18759d,_0x553050,_0x11e359),_0x27b221[_0x11e359]);});});this[_0x3432('0xc')][_0x3432('0x9f')](util[_0x3432('0x27')](_0x3432('0xdf'),_0x18759d),_0x356107[_0x3432('0x9b')]);return this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')]('variable\x20%s\x20set',_0x18759d));};AGIVertices[_0x3432('0xf')][_0x3432('0xe0')]=function(_0x5d833e){logger[_0x3432('0xe1')](util[_0x3432('0x27')](_0x3432('0xe2'),_0x5d833e[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x5d833e[_0x3432('0xe3')])){return this['channel'][_0x3432('0x30')](_0x5d833e,_0x3432('0xe4'));}var _0x3c4815=this['getUser']['sync'](this,_0x5d833e[_0x3432('0xe3')]);if(!_0x3c4815){return this[_0x3432('0xc')]['error'](_0x5d833e,_0x3432('0xe5'));}var _0x5a1e80=this[_0x3432('0xc')][_0x3432('0x63')](_0x3432('0xe6'),[util[_0x3432('0x27')](_0x3432('0xe7'),_0x3c4815),_0x5d833e[_0x3432('0xbd')],_0x5d833e['opts'],_0x5d833e[_0x3432('0x6d')]]);if(_0x5a1e80[_0x3432('0xa3')]===-0x1){return _0x5a1e80;}return this['channel'][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0xe8'),_0x3432('0xe6')));};AGIVertices[_0x3432('0xf')][_0x3432('0xe9')]=function(_0x421e42){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x421e42[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x421e42[_0x3432('0x80')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xea'));}if(!this[_0x3432('0xa6')](_0x421e42[_0x3432('0x67')])){return this['channel'][_0x3432('0xaa')](_0x3432('0xab'));}this[_0x3432('0xc')][_0x3432('0xeb')]=!![];this[_0x3432('0x33')](_0x421e42);this[_0x3432('0x40')](_0x421e42[_0x3432('0x67')],'in');this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0xec'),_0x421e42['text']));var _0x8438e0=this[_0x3432('0x7f')]['sync'](this,_0x421e42);if(_0x8438e0){for(var _0x3854de in _0x8438e0){if(_0x8438e0[_0x3432('0x99')](_0x3854de)){this[_0x3432('0xc')][_0x3432('0x9f')](util[_0x3432('0x27')](_0x3432('0xed'),_0x3854de[_0x3432('0xee')]()),_0x8438e0[_0x3854de]);}}this[_0x3432('0x40')](_0x8438e0[_0x3432('0xef')],_0x3432('0xf0'));return this[_0x3432('0xc')]['noop'](util[_0x3432('0x27')]('Dialogflow\x20Result\x20%s',_0x8438e0[_0x3432('0xef')]));}return this[_0x3432('0xc')][_0x3432('0x30')](_0x421e42,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x3432('0xf')][_0x3432('0xf1')]=function(_0x5bfd02){logger[_0x3432('0x2d')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5bfd02[_0x3432('0x35')]));if(!this['isConfigured'](_0x5bfd02[_0x3432('0xf2')])){return this[_0x3432('0xc')]['noop'](_0x3432('0xf3'));}if(!this['isConfigured'](_0x5bfd02[_0x3432('0xf4')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xf5'));}if(!this['isConfigured'](_0x5bfd02[_0x3432('0xf6')])){return this[_0x3432('0xc')]['noop']('no\x20password\x20configured');}if(!this['isConfigured'](_0x5bfd02[_0x3432('0xf7')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xab'));}this[_0x3432('0xc')]['bot']=!![];this[_0x3432('0x33')](_0x5bfd02);this[_0x3432('0x40')](_0x5bfd02['text'],'in');this['channel'][_0x3432('0xaa')](util[_0x3432('0x27')]('Trying\x20SestekNDA:\x20%s',_0x5bfd02[_0x3432('0x67')]));var _0x1a2496=this[_0x3432('0x82')][_0x3432('0xc3')](this,_0x5bfd02);if(_0x1a2496){for(var _0x104c9a in _0x1a2496){if(_0x1a2496[_0x3432('0x99')](_0x104c9a)){this[_0x3432('0xc')]['setVariable'](util[_0x3432('0x27')](_0x3432('0xf8'),_0x104c9a['toUpperCase']()),_0x1a2496[_0x104c9a]);}}this[_0x3432('0x40')](_0x1a2496[_0x3432('0xef')],_0x3432('0xf0'));if(_0x1a2496['audiofile']){this[_0x3432('0xc')][_0x3432('0xaa')](util['format'](_0x3432('0xf9'),_0x1a2496[_0x3432('0xfa')]));var _0x54fdee=this['channel'][_0x3432('0xfb')](_0x1a2496[_0x3432('0xfa')]);try{fs[_0x3432('0xfc')](_0x1a2496[_0x3432('0xfa')]+'.wav');}catch(_0x1baf9f){logger[_0x3432('0x30')](_0x1baf9f);}return _0x54fdee;}else{return this[_0x3432('0xc')]['noop'](util['format'](_0x3432('0xfd'),_0x1a2496[_0x3432('0xef')]));}}return this[_0x3432('0xc')][_0x3432('0x30')](_0x5bfd02,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x3432('0xfe')]=function(_0x35e26c){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0xff'),_0x35e26c[_0x3432('0x35')]));return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xfe'));};AGIVertices[_0x3432('0xf')][_0x3432('0x100')]=function(_0x19d854){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x101'),_0x19d854['label']));var _0x4a7414='';if(_0x19d854[_0x3432('0x102')]){if(!this[_0x3432('0xa6')](_0x19d854['trunk_id'])){return this[_0x3432('0xc')][_0x3432('0x30')](_0x19d854,_0x3432('0x103'));}else{var _0xc10a66=parseInt(_0x19d854[_0x3432('0x102')],0xa);if(isNaN(_0xc10a66)){_0x4a7414=_0x19d854[_0x3432('0x102')];}else{_0x4a7414=this[_0x3432('0x1b')][_0x3432('0xc3')](this,_0x19d854[_0x3432('0x102')]);if(!_0x4a7414){return this[_0x3432('0xc')][_0x3432('0x30')](_0x19d854,'no\x20trunk\x20found');}}}}else if(_0x19d854[_0x3432('0x104')]){_0x4a7414=_0x19d854[_0x3432('0x104')];}else{return this[_0x3432('0xc')][_0x3432('0x30')](_0x19d854,'no\x20trunk\x20selected');}var _0x5b61b6=this['channel'][_0x3432('0x63')](_0x3432('0xe6'),[util[_0x3432('0x27')](_0x3432('0x105'),_0x4a7414,_0x19d854[_0x3432('0x4a')]),_0x19d854[_0x3432('0xbd')],_0x19d854[_0x3432('0x106')],_0x19d854[_0x3432('0x6d')]]);if(_0x5b61b6[_0x3432('0xa3')]===-0x1){return _0x5b61b6;}return this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0xe8'),_0x3432('0xe6')));};AGIVertices[_0x3432('0xf')]['finally']=function(_0x103951){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x103951['label']));return this['channel'][_0x3432('0xaa')]('finally');};AGIVertices[_0x3432('0xf')][_0x3432('0xb')]=function(_0xcc12d3){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x107'),_0xcc12d3[_0x3432('0x35')]));if(_0xcc12d3[_0x3432('0xa8')]===0x0){return this[_0x3432('0xa7')](_0xcc12d3);}_0xcc12d3[_0x3432('0xa8')]-=0x1;if(!this['isConfigured'](_0xcc12d3[_0x3432('0x108')])){return this['channel'][_0x3432('0x30')](_0xcc12d3,_0x3432('0x109'));}var _0x4cf9e1=this[_0x3432('0x1c')]['sync'](this,_0xcc12d3[_0x3432('0x108')]);if(!_0x4cf9e1){return this[_0x3432('0xc')][_0x3432('0x30')](_0xcc12d3,_0x3432('0x10a'));}if(!this[_0x3432('0xa6')](_0xcc12d3[_0x3432('0xdb')])){return this[_0x3432('0xc')][_0x3432('0x30')](_0x3432('0xdc'));}var _0x16c065=this[_0x3432('0xc')][_0x3432('0x10b')](_0x4cf9e1,_0xcc12d3[_0x3432('0x10c')],_0xcc12d3['maxdigit']);var _0x42599a=_0x16c065[_0x3432('0xa3')]?_0x16c065[_0x3432('0xa3')][_0x3432('0x4e')]():'';logger[_0x3432('0x2d')](_0x3432('0x10d'),JSON['stringify'](_0x16c065));if(_0x16c065['result']===-0x1){this[_0x3432('0x33')][_0x3432('0xc3')](this,_0xcc12d3,_0x42599a);return _0x16c065;}else if(_0x16c065[_0x3432('0xa5')]===_0x3432('0xbd')){_0x16c065[_0x3432('0xa3')]=_0x42599a[_0x3432('0x9b')]>=parseInt(_0xcc12d3[_0x3432('0x10e')])?'x':'i';}else{_0x16c065[_0x3432('0xa3')]=_0x42599a[_0x3432('0x9b')]>=parseInt(_0xcc12d3['mindigit'])&&_0x42599a[_0x3432('0x9b')]<=parseInt(_0xcc12d3[_0x3432('0x10f')])?'x':'i';}var _0x115979=this['getVariable']['sync'](this,_0xcc12d3['variable_id']);if(!_0x115979){return this['channel']['error'](_0xcc12d3,_0x3432('0x110'));}this[_0x3432('0xc')][_0x3432('0x9f')](_0x115979,_0x42599a);if(this[_0x3432('0xa6')](_0xcc12d3['hiddendigitsnum'])){var _0x379167=parseInt(_0xcc12d3[_0x3432('0x111')],0xa);var _0x45e9a4=rs[_0x3432('0x112')]({'charset':'*','length':_0x379167});var _0x1f2ff8=_0x42599a['length'];if(_0x1f2ff8>0x0){if(_0x1f2ff8>_0x379167){this[_0x3432('0x33')][_0x3432('0xc3')](this,_0xcc12d3,_0xcc12d3[_0x3432('0x113')]===_0x3432('0x114')?_0x45e9a4+_0x42599a['substr'](_0x379167):_0x42599a[_0x3432('0x115')](0x0,_0x1f2ff8-_0x379167)+_0x45e9a4);}else{this['createSquareDetailsReport']['sync'](this,_0xcc12d3,rs['generate']({'charset':'*','length':_0x1f2ff8}));}}else{this[_0x3432('0x33')]['sync'](this,_0xcc12d3,'');}}else{this[_0x3432('0x33')][_0x3432('0xc3')](this,_0xcc12d3,_0x42599a);}return _0x16c065;};AGIVertices[_0x3432('0xf')][_0x3432('0x116')]=function(_0x39a146){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x39a146[_0x3432('0x35')]));return this['getdigits'](_0x39a146);};AGIVertices[_0x3432('0xf')][_0x3432('0x117')]=function(_0x580852){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x118'),_0x580852[_0x3432('0x35')]));this[_0x3432('0x33')][_0x3432('0xc3')](this,_0x580852,_0x580852[_0x3432('0x119')]);return this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x11a'),_0x580852[_0x3432('0x119')]));};AGIVertices[_0x3432('0xf')][_0x3432('0x11b')]=function(_0x5425a9){logger[_0x3432('0x2d')](util['format'](_0x3432('0x11c'),_0x5425a9['label']));if(!this[_0x3432('0xa6')](_0x5425a9[_0x3432('0x11d')])||!this[_0x3432('0xa6')](_0x5425a9[_0x3432('0x8d')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0x11e'));}if(!this[_0x3432('0xa6')](_0x5425a9['text'])){return this[_0x3432('0xc')]['noop']('no\x20text\x20configured');}this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x11f'),_0x5425a9[_0x3432('0x67')]));var _0x1300e4=this[_0x3432('0x88')][_0x3432('0xc3')](this,_0x5425a9);if(_0x1300e4){this[_0x3432('0xc')]['noop'](util['format'](_0x3432('0x120'),_0x1300e4));var _0x9cb19b=this['channel']['streamFile'](_0x1300e4);try{fs[_0x3432('0xfc')](_0x1300e4+_0x3432('0x121'));}catch(_0x477014){logger['error'](_0x477014);}return _0x9cb19b;}return this[_0x3432('0xc')]['error'](_0x5425a9,_0x3432('0x122'));};AGIVertices[_0x3432('0xf')][_0x3432('0x123')]=function(_0x168f4b){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x124'),_0x168f4b[_0x3432('0x35')]));if(!this['isConfigured'](_0x168f4b[_0x3432('0x11d')])||!this[_0x3432('0xa6')](_0x168f4b[_0x3432('0x8d')])){return this['channel']['noop'](_0x3432('0x11e'));}if(!this['isConfigured'](_0x168f4b['aws_bot_name'])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0x125'));}if(!this[_0x3432('0xa6')](_0x168f4b[_0x3432('0x67')])){return this[_0x3432('0xc')]['noop'](_0x3432('0xab'));}this[_0x3432('0xc')][_0x3432('0xeb')]=!![];this[_0x3432('0x33')](_0x168f4b);this[_0x3432('0x40')](_0x168f4b[_0x3432('0x67')],'in');this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x126'),_0x168f4b['text']));var _0x1cb1ac=this[_0x3432('0x8c')][_0x3432('0xc3')](this,_0x168f4b);if(_0x1cb1ac){for(var _0x2c9979 in _0x1cb1ac){if(_0x1cb1ac[_0x3432('0x99')](_0x2c9979)&&_[_0x3432('0x95')](_0x1cb1ac[_0x2c9979])){this['channel'][_0x3432('0x9f')](util[_0x3432('0x27')]('AWS_LEX_%s',_0x2c9979[_0x3432('0xee')]()),_0x1cb1ac[_0x2c9979]);}}if(_[_0x3432('0x45')](_0x1cb1ac[_0x3432('0x7d')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0x127'));}else{this['createSquareMessage'](_0x1cb1ac[_0x3432('0x7d')],_0x3432('0xf0'));return this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x128'),_0x1cb1ac['message']));}}return this[_0x3432('0xc')][_0x3432('0x30')](_0x168f4b,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype']['googleasr']=function(_0x40d984){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x129'),_0x40d984[_0x3432('0x35')],_0x40d984[_0x3432('0xbd')]));if(!this[_0x3432('0xa6')](_0x40d984[_0x3432('0x80')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xea'));}var _0x4b278a=_0x3432('0x12a');var _0x110294=util[_0x3432('0x27')](_0x3432('0x12b'),FILES_PATH,rs[_0x3432('0x112')](0x4));var _0xd0769d=util['format'](_0x3432('0x9d'),_0x110294,_0x4b278a);var _0x1d2ee4=!![];if(_0x40d984['beep']==='NOBEEP'){_0x1d2ee4=![];}var _0x2278cf=this[_0x3432('0xc')][_0x3432('0x12c')](_0x110294,_0x4b278a,_0x40d984['intKey'],_0x40d984[_0x3432('0xbd')],undefined,_0x1d2ee4);if(_0x2278cf['result']!==-0x1){this[_0x3432('0xc')]['noop'](util[_0x3432('0x27')]('google\x20%s\x20file\x20created',_0xd0769d));var _0x33bf39=this['googleASR'][_0x3432('0xc3')](this,_0x40d984,_0xd0769d);if(_0x33bf39){for(var _0x40c18e in _0x33bf39){if(_0x33bf39['hasOwnProperty'](_0x40c18e)){this[_0x3432('0xc')][_0x3432('0x9f')](util[_0x3432('0x27')](_0x3432('0x12d'),_0x40c18e[_0x3432('0xee')]()),_0x33bf39[_0x40c18e]);}}return this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x12e'),JSON['stringify'](_0x33bf39)));}}return _0x2278cf;};AGIVertices[_0x3432('0xf')][_0x3432('0x12f')]=function(_0xfb6048){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x130'),_0xfb6048[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0xfb6048[_0x3432('0x131')])){return this[_0x3432('0xc')]['noop'](_0x3432('0x132'));}if(!this[_0x3432('0xa6')](_0xfb6048[_0x3432('0x92')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0x133'));}var _0x44f82b=_0x3432('0x12a');var _0x36e268=util[_0x3432('0x27')](_0x3432('0x12b'),FILES_PATH,rs[_0x3432('0x112')](0x4));var _0x15765f=util['format'](_0x3432('0x9d'),_0x36e268,_0x44f82b);var _0x224765=!![];if(_0xfb6048[_0x3432('0x134')]===_0x3432('0x135')){_0x224765=![];}var _0x45ea18=this[_0x3432('0xc')][_0x3432('0x12c')](_0x36e268,_0x44f82b,_0xfb6048[_0x3432('0x136')],_0xfb6048[_0x3432('0xbd')],undefined,_0x224765);if(_0x45ea18['result']!==-0x1){this['channel'][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x137'),_0x15765f));var _0x536dbd=this['tildeASR'][_0x3432('0xc3')](this,_0xfb6048,_0x15765f);if(_0x536dbd){for(var _0x11e096 in _0x536dbd){if(_0x536dbd['hasOwnProperty'](_0x11e096)){this[_0x3432('0xc')][_0x3432('0x9f')](util[_0x3432('0x27')]('TILDE_ASR_%s',_0x11e096[_0x3432('0xee')]()),_0x536dbd[_0x11e096]);}}return this[_0x3432('0xc')]['noop'](util[_0x3432('0x27')](_0x3432('0x138'),JSON[_0x3432('0x78')](_0x536dbd)));}}return _0x45ea18;};AGIVertices[_0x3432('0xf')]['gotoc']=function(_0x32def9){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x139'),_0x32def9[_0x3432('0x35')]));return this[_0x3432('0xc')]['continueAt'](_0x32def9[_0x3432('0x3b')],_0x32def9['extension'],_0x32def9[_0x3432('0x3c')]);};AGIVertices['prototype'][_0x3432('0x13a')]=function(_0xe488c4){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x13b'),_0xe488c4[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0xe488c4['condition'])){return this[_0x3432('0xc')][_0x3432('0x30')](_0xe488c4,_0x3432('0x13c'));}try{var _0x3c4369=eval(_0xe488c4[_0x3432('0x13d')])?_0x3432('0x13e'):_0x3432('0x13f');this['channel'][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x140'),_0xe488c4[_0x3432('0x13d')],_0x3c4369));return{'code':0xc8,'result':_0x3c4369};}catch(_0x15a556){return{'code':0xc8,'result':_0x3432('0x13f')};}};AGIVertices['prototype'][_0x3432('0x141')]=function(_0x428216){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x428216[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x428216['interval_id'])){return this[_0x3432('0xc')]['error'](_0x428216,'no\x20interval\x20configured');}var _0x497d24=this[_0x3432('0x142')][_0x3432('0xc3')](this,_0x428216[_0x3432('0x143')]);if(!_0x497d24){return this[_0x3432('0xc')][_0x3432('0x30')](_0x428216,_0x3432('0x144'));}for(var _0x32b164=0x0;_0x32b164<_0x497d24[_0x3432('0x9b')];_0x32b164+=0x1){var _0xff061e=this[_0x3432('0xc')][_0x3432('0x10')](util[_0x3432('0x27')](_0x3432('0x145'),_0x497d24[_0x32b164]));if(_0xff061e[_0x3432('0xa3')]===-0x1){return _0xff061e;}logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x146'),_0x497d24[_0x32b164],_0xff061e[_0x3432('0xa5')]));if(_0xff061e[_0x3432('0xa5')]===_0x3432('0x13e')){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x146'),_0x497d24[_0x32b164],_0x3432('0x13e')));this['channel']['noop'](util['format'](_0x3432('0x146'),_0x497d24[_0x32b164],_0x3432('0x13e')));return{'code':0xc8,'result':_0x3432('0x13e')};}else{logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x146'),_0x497d24[_0x32b164],'false'));this[_0x3432('0xc')][_0x3432('0xaa')](util['format'](_0x3432('0x146'),_0x497d24[_0x32b164],_0x3432('0x13f')));}}return{'code':0xc8,'result':_0x3432('0x13f')};};AGIVertices[_0x3432('0xf')]['hangup']=function(_0x1a0476){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x147'),_0x1a0476['label']));return this['channel'][_0x3432('0x148')]();};AGIVertices['prototype'][_0x3432('0x149')]=function(_0x5c97f8){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x14a'),_0x5c97f8[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x5c97f8[_0x3432('0x80')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xea'));}var _0x4daefb='wav';var _0x4009a4=util[_0x3432('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x3432('0x112')](0x4));var _0x1175b9=util[_0x3432('0x27')](_0x3432('0x9d'),_0x4009a4,_0x4daefb);var _0x52f405=!![];if(_0x5c97f8['beep']===_0x3432('0x135')){_0x52f405=![];}var _0x4c242d=this[_0x3432('0xc')]['recordFile'](_0x4009a4,_0x4daefb,_0x5c97f8[_0x3432('0x136')],_0x5c97f8[_0x3432('0xbd')],undefined,_0x52f405);if(_0x4c242d[_0x3432('0xa3')]!==-0x1){this['channel'][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x14b'),_0x1175b9));var _0x4c681d=this[_0x3432('0x85')]['sync'](this,_0x5c97f8,_0x1175b9);if(_0x4c681d){for(var _0x3bb2a3 in _0x4c681d){if(_0x4c681d['hasOwnProperty'](_0x3bb2a3)){this['channel'][_0x3432('0x9f')](util['format']('ISPEECH_ASR_%s',_0x3bb2a3['toUpperCase']()),_0x4c681d[_0x3bb2a3]);}}return this[_0x3432('0xc')][_0x3432('0xaa')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x3432('0x78')](_0x4c681d)));}}return _0x4c242d;};AGIVertices[_0x3432('0xf')][_0x3432('0x14c')]=function(_0xa9b106){logger['info'](util[_0x3432('0x27')](_0x3432('0x14d'),_0xa9b106[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0xa9b106[_0x3432('0x80')])){return this[_0x3432('0xc')]['noop']('no\x20key\x20configured');}if(!this[_0x3432('0xa6')](_0xa9b106[_0x3432('0x67')])){return this[_0x3432('0xc')]['noop'](_0x3432('0xab'));}this[_0x3432('0xc')]['noop'](util[_0x3432('0x27')](_0x3432('0x14e'),_0xa9b106[_0x3432('0x67')]));var _0x558ed0=this[_0x3432('0x83')][_0x3432('0xc3')](this,_0xa9b106);if(_0x558ed0){this['channel'][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x14b'),_0x558ed0));var _0x160404=this[_0x3432('0xc')][_0x3432('0xfb')](_0x558ed0,_0xa9b106[_0x3432('0x136')]);try{fs['unlink'](_0x558ed0+'.wav');}catch(_0x285710){logger[_0x3432('0x30')](_0x285710);}return _0x160404;}return this[_0x3432('0xc')]['error'](_0xa9b106,_0x3432('0x14f'));};AGIVertices[_0x3432('0xf')][_0x3432('0x150')]=function(_0x428ca8){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x151'),_0x428ca8[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x428ca8['findBy'])){return this['channel'][_0x3432('0x30')](_0x428ca8,_0x3432('0x152'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3432('0xc')][_0x3432('0x38')],_0x428ca8['findBy']));var _0x47f20c=this[_0x3432('0x5e')][_0x3432('0xc3')](this,_0x428ca8[_0x3432('0x153')]);if(_0x47f20c){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x154'),this['channel'][_0x3432('0x38')],_0x428ca8[_0x3432('0x153')]));this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3432('0xc')]['callerid'],_0x428ca8[_0x3432('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x155'),this[_0x3432('0xc')][_0x3432('0x38')],_0x428ca8[_0x3432('0x153')]));this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x155'),this[_0x3432('0xc')][_0x3432('0x38')],_0x428ca8[_0x3432('0x153')]));return{'code':0xc8,'result':_0x3432('0x156')};}};AGIVertices[_0x3432('0xf')][_0x3432('0x157')]=function(_0x36a050){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x158'),_0x36a050[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x36a050['findBy'])){return this[_0x3432('0xc')][_0x3432('0x30')](_0x36a050,_0x3432('0x152'));}logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x159'),this[_0x3432('0xc')][_0x3432('0x38')],_0x36a050['findBy']));var _0x28ec5a=this[_0x3432('0x5d')]['sync'](this,_0x36a050['findBy']);if(_0x28ec5a){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x154'),this[_0x3432('0xc')][_0x3432('0x38')],_0x36a050[_0x3432('0x153')]));this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x154'),this[_0x3432('0xc')][_0x3432('0x38')],_0x36a050[_0x3432('0x153')]));return{'code':0xc8,'result':_0x3432('0x15a')};}else{logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x155'),this['channel'][_0x3432('0x38')],_0x36a050[_0x3432('0x153')]));this[_0x3432('0xc')][_0x3432('0xaa')](util['format'](_0x3432('0x155'),this['channel'][_0x3432('0x38')],_0x36a050['findBy']));return{'code':0xc8,'result':_0x3432('0x156')};}};AGIVertices[_0x3432('0xf')]['math']=function(_0x156203){logger[_0x3432('0x2d')](util['format'](_0x3432('0x15b'),_0x156203[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x156203['operation'])){return this[_0x3432('0xc')]['error'](_0x156203,_0x3432('0x15c'));}this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x15d'),_0x156203[_0x3432('0x15e')]));var _0x59c893=eval(_0x156203[_0x3432('0x15e')]);if(!this[_0x3432('0xa6')](_0x156203[_0x3432('0xdb')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xdc'));}var _0x1d6cae=this[_0x3432('0x10')]['sync'](this,_0x156203[_0x3432('0xdb')]);if(!_0x1d6cae){return this[_0x3432('0xc')][_0x3432('0x30')](_0x156203,_0x3432('0x110'));}if(_[_0x3432('0x9e')](_0x59c893)){var _0x139847=this;_0x59c893[_0x3432('0xdd')](function(_0x45e118,_0x5c8ec2){_0x139847[_0x3432('0xc')]['setVariable'](util[_0x3432('0x27')](_0x3432('0x15f'),_0x1d6cae,_0x5c8ec2),_0x45e118);});return this['channel']['noop'](util['format'](_0x3432('0x160'),_0x1d6cae));}else{return this[_0x3432('0xc')][_0x3432('0x9f')](_0x1d6cae,_0x59c893);}};AGIVertices['prototype'][_0x3432('0x161')]=function(_0xfb7b2a){logger['info'](util[_0x3432('0x27')](_0x3432('0x162'),_0xfb7b2a[_0x3432('0x35')]));if(_0xfb7b2a[_0x3432('0xa8')]===0x0){return this['maxRetry'](_0xfb7b2a);}_0xfb7b2a[_0x3432('0xa8')]-=0x1;if(!this[_0x3432('0xa6')](_0xfb7b2a['file_id'])){return this[_0x3432('0xc')][_0x3432('0x30')](_0xfb7b2a,_0x3432('0x109'));}var _0x1723ec=this[_0x3432('0x1c')]['sync'](this,_0xfb7b2a[_0x3432('0x108')]);if(!_0x1723ec){return this['channel'][_0x3432('0x30')](_0xfb7b2a,_0x3432('0x10a'));}var _0xb943b3=this[_0x3432('0xc')][_0x3432('0x10b')](_0x1723ec,_0xfb7b2a[_0x3432('0x10c')],_0xfb7b2a['digit']);var _0x1a5923=_0xb943b3[_0x3432('0xa3')];if(_0xb943b3[_0x3432('0xa3')]===-0x1){this[_0x3432('0x33')][_0x3432('0xc3')](this,_0xfb7b2a,'-1');return _0xb943b3;}else if(_0xb943b3['extra']===_0x3432('0xbd')){_0xb943b3[_0x3432('0xa3')]=_0xb943b3[_0x3432('0xa3')][_0x3432('0x9b')]>0x0?_0xb943b3[_0x3432('0xa3')]:'t';}else if(_[_0x3432('0x48')](_0xb943b3[_0x3432('0xa3')])){_0xb943b3['result']='#';_0x1a5923='#';}if(!this[_0x3432('0xa6')](_0xfb7b2a[_0x3432('0xdb')])){this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0xdc'));}else{var _0x1f9cff=this[_0x3432('0x10')]['sync'](this,_0xfb7b2a['variable_id']);if(!_0x1f9cff){return this[_0x3432('0xc')]['error'](_0xfb7b2a,_0x3432('0x110'));}this['channel']['setVariable'](_0x1f9cff,_0x1a5923);}this['createSquareDetailsReport']['sync'](this,_0xfb7b2a,_0x1a5923);return _0xb943b3;};AGIVertices['prototype'][_0x3432('0xaa')]=function(_0x135768){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x163'),_0x135768[_0x3432('0x35')]));return this['channel'][_0x3432('0xaa')](_0x135768[_0x3432('0x164')]||_0x135768[_0x3432('0x35')]);};AGIVertices[_0x3432('0xf')]['pause']=function(_0x35438b){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x165'),_0x35438b[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x35438b[_0x3432('0x153')])){return this['channel'][_0x3432('0x30')](_0x35438b,_0x3432('0x152'));}logger[_0x3432('0x2d')](util[_0x3432('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3432('0xc')][_0x3432('0x38')],_0x35438b[_0x3432('0x153')]));var _0x58e5b6=this[_0x3432('0x5a')][_0x3432('0xc3')](this,_0x35438b['pause_id']);var _0x1ff41a=this[_0x3432('0x166')]['sync'](this,_0x35438b[_0x3432('0x153')],_0x58e5b6);if(_0x1ff41a){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x154'),this['channel'][_0x3432('0x38')],_0x35438b[_0x3432('0x153')]));this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x154'),this[_0x3432('0xc')]['callerid'],_0x35438b[_0x3432('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x155'),this['channel']['callerid'],_0x35438b[_0x3432('0x153')]));this[_0x3432('0xc')][_0x3432('0xaa')](util['format'](_0x3432('0x154'),this['channel'][_0x3432('0x38')],_0x35438b[_0x3432('0x153')]));return{'code':0xc8,'result':_0x3432('0x156')};}};AGIVertices['prototype'][_0x3432('0x167')]=function(_0x940549){logger['info'](util[_0x3432('0x27')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x940549[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x940549[_0x3432('0x108')])){return this[_0x3432('0xc')][_0x3432('0x30')](_0x940549,_0x3432('0x109'));}var _0x4d6916=this[_0x3432('0x1c')]['sync'](this,_0x940549['file_id']);if(!_0x4d6916){return this[_0x3432('0xc')][_0x3432('0x30')](_0x940549,_0x3432('0x10a'));}var _0x3f2d96=this['channel'][_0x3432('0x63')](_0x3432('0x168'),[_0x4d6916,_0x940549[_0x3432('0x106')]]);if(_0x3f2d96['result']===-0x1){return _0x3f2d96;}return this['channel'][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x169'),_0x3432('0x168'),_0x4d6916));};AGIVertices['prototype'][_0x3432('0x16a')]=function(_0x5d812e){logger['info'](util['format'](_0x3432('0x16b'),_0x5d812e[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x5d812e[_0x3432('0x16c')])){return this['channel']['error'](_0x5d812e,'no\x20queue\x20selected');}var _0x4ad9f4='';var _0x1e736b=parseInt(_0x5d812e[_0x3432('0x16c')],0xa);if(isNaN(_0x1e736b)){_0x4ad9f4=_0x5d812e['queue_id'];}else{_0x4ad9f4=this[_0x3432('0x15')][_0x3432('0xc3')](this,_0x5d812e['queue_id']);if(!_0x4ad9f4){return this[_0x3432('0xc')]['error'](_0x5d812e,_0x3432('0x16d'));}}var _0x50899a='';if(this['isConfigured'](_0x5d812e[_0x3432('0x108')])){var _0x44c53f=this[_0x3432('0x1c')][_0x3432('0xc3')](this,_0x5d812e['file_id']);if(_0x44c53f){_0x50899a=_0x44c53f;}}this[_0x3432('0x33')][_0x3432('0xc3')](this,_0x5d812e,_0x4ad9f4);if(_0x5d812e['opts'][_0x3432('0x16e')]('x')<0x0){_0x5d812e[_0x3432('0x106')]+='x';}if(_0x5d812e[_0x3432('0x106')][_0x3432('0x16e')]('X')<0x0){_0x5d812e[_0x3432('0x106')]+='X';}this[_0x3432('0xc')][_0x3432('0x9f')]('XMCS-QUEUE',_0x4ad9f4?_0x4ad9f4[_0x3432('0x16f')]():'');var _0xc3cfed=this['channel'][_0x3432('0x63')](_0x3432('0x170'),[_0x4ad9f4,_0x5d812e['opts'],_0x5d812e['url'],_0x50899a,_0x5d812e[_0x3432('0xbd')],_0x5d812e[_0x3432('0xb9')],_0x5d812e['macro'],_0x5d812e['gosub'],'',_0x5d812e[_0x3432('0x171')]]);if(_0xc3cfed[_0x3432('0xa3')]===-0x1){return _0xc3cfed;}return this[_0x3432('0xc')]['noop'](util[_0x3432('0x27')](_0x3432('0x169'),_0x3432('0x170'),_0x4ad9f4));};AGIVertices[_0x3432('0xf')][_0x3432('0x172')]=function(_0x348a66){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x348a66['label']));var _0x4f519f=_0x348a66[_0x3432('0x173')]||_0x3432('0x12a');var _0x58ebd5=util[_0x3432('0x27')](_0x3432('0x174'),this['channel'][_0x3432('0x34')],rs[_0x3432('0x112')](0x5));var _0x1d4fc4=util[_0x3432('0x27')](_0x3432('0x175'),FILES_PATH,_0x58ebd5,_0x4f519f);var _0x349b8a=util['format']('%s/recordings/%s',FILES_PATH,_0x58ebd5);this['createSquareRecording']['sync'](this,_0x348a66,_0x58ebd5,_0x1d4fc4);this['channel'][_0x3432('0x9f')](_0x3432('0x176'),_0x58ebd5);logger[_0x3432('0x2d')](_0x3432('0x177'),_0x349b8a,_0x4f519f,_0x348a66[_0x3432('0x178')],_0x348a66[_0x3432('0xbd')]);return this[_0x3432('0xc')][_0x3432('0x12c')](_0x349b8a,_0x4f519f,_0x348a66[_0x3432('0x178')],_0x348a66['timeout'],undefined,!![]);};AGIVertices[_0x3432('0xf')][_0x3432('0x179')]=function(_0x56d76b){logger['info'](util[_0x3432('0x27')](_0x3432('0x17a'),_0x56d76b[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x56d76b[_0x3432('0x6d')])){return this['channel']['noop'](_0x3432('0x17b'));}var _0x25c643=this[_0x3432('0x6c')][_0x3432('0xc3')](this,_0x56d76b);logger['info'](util[_0x3432('0x27')](_0x3432('0x17c'),util[_0x3432('0x17d')](_0x25c643,{'showHidden':![],'depth':null})));if(!this[_0x3432('0xa6')](_0x56d76b[_0x3432('0xdb')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0x17e'));}var _0x1d1b3e=this[_0x3432('0x10')][_0x3432('0xc3')](this,_0x56d76b[_0x3432('0xdb')]);if(!_0x1d1b3e){return this[_0x3432('0xc')][_0x3432('0x30')](_0x56d76b,'no\x20variable\x20found');}this[_0x3432('0xc')]['setVariable'](util[_0x3432('0x27')](_0x3432('0x17f'),_0x1d1b3e),_0x25c643[_0x3432('0x7b')]?_0x25c643[_0x3432('0x7b')]:_0x3432('0x180'));this[_0x3432('0xc')][_0x3432('0x9f')](util['format'](_0x3432('0x181'),_0x1d1b3e),_0x25c643[_0x3432('0x7c')]?_0x25c643[_0x3432('0x7c')]:'OK');if(_0x25c643['body']){try{this[_0x3432('0x9c')](_0x25c643[_0x3432('0x79')],_0x1d1b3e);}catch(_0x5d470d){logger[_0x3432('0x30')](util[_0x3432('0x27')](_0x3432('0x182'),_0x1d1b3e));}}return this['channel'][_0x3432('0xaa')](util['format']('variable\x20%s\x20set',_0x1d1b3e));};AGIVertices[_0x3432('0xf')][_0x3432('0x183')]=function(_0x5cb5bb){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5cb5bb[_0x3432('0x35')]));return this['channel'][_0x3432('0x184')](_0x5cb5bb[_0x3432('0x185')][_0x3432('0x64')](/\s+/g,''),_0x5cb5bb['escape_digits']);};AGIVertices[_0x3432('0xf')][_0x3432('0x186')]=function(_0x465451){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x465451[_0x3432('0x35')]));return this[_0x3432('0xc')][_0x3432('0x187')](_0x465451[_0x3432('0x6e')][_0x3432('0x64')](/\s+/g,''),_0x465451['escape_digits']);};AGIVertices[_0x3432('0xf')]['sayphonetic']=function(_0x469922){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x188'),_0x469922[_0x3432('0x35')]));return this[_0x3432('0xc')][_0x3432('0x189')](_0x469922['text'],_0x469922[_0x3432('0x178')]);};AGIVertices[_0x3432('0xf')][_0x3432('0x18a')]=function(_0x58c4c3){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x18b'),_0x58c4c3[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x58c4c3[_0x3432('0x18c')])){return this[_0x3432('0xc')]['noop'](_0x3432('0x18d'));}var _0xe027a7=this[_0x3432('0x20')]['sync'](this,_0x58c4c3[_0x3432('0x18c')]);if(!_0xe027a7||!_0xe027a7[_0x3432('0x18e')]){return this[_0x3432('0xc')][_0x3432('0x30')](_0x58c4c3,'no\x20mail\x20account\x20found');}var _0x23ee95={'from':util['format'](_0x3432('0x18f'),_0xe027a7['name'],_0xe027a7[_0x3432('0x190')]||_0xe027a7[_0x3432('0x18e')][_0x3432('0x191')]),'to':_0x58c4c3['to']||'','cc':_0x58c4c3['cc']||'','bcc':_0x58c4c3[_0x3432('0x192')]||'','subject':_0x58c4c3[_0x3432('0x193')],'html':_0x58c4c3[_0x3432('0x67')],'text':_0x58c4c3[_0x3432('0x67')]};var _0x7300ef={'tls':{'rejectUnauthorized':![]}};if(_0xe027a7[_0x3432('0x18e')][_0x3432('0x194')]){_0x7300ef['service']=_0xe027a7[_0x3432('0x18e')][_0x3432('0x194')];}else{_0x7300ef[_0x3432('0x195')]=_0xe027a7['Smtp'][_0x3432('0x195')];_0x7300ef[_0x3432('0x196')]=_0xe027a7['Smtp'][_0x3432('0x196')];_0x7300ef[_0x3432('0x197')]=_0xe027a7[_0x3432('0x18e')]['secure'];}if(_0xe027a7['Smtp']['authentication']){_0x7300ef[_0x3432('0x198')]={'user':_0xe027a7['Smtp'][_0x3432('0x191')],'pass':_0xe027a7[_0x3432('0x18e')]['pass']};}if(this[_0x3432('0xa6')](_0x58c4c3['template_id'])){}logger['debug'](_0x3432('0x199'),JSON[_0x3432('0x78')](_0x23ee95));this[_0x3432('0x33')][_0x3432('0xc3')](this,_0x58c4c3,_0x58c4c3[_0x3432('0x18c')]);this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x19a'),_0xe027a7['name']));this[_0x3432('0x22')][_0x3432('0xc3')](this,_0x7300ef,_0x23ee95);return this[_0x3432('0xc')][_0x3432('0xaa')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x3432('0xf')][_0x3432('0x19b')]=function(_0x2d1dda){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x2d1dda[_0x3432('0x35')]));return this[_0x3432('0xc')]['noop'](_0x3432('0x19c'));};AGIVertices[_0x3432('0xf')][_0x3432('0x19d')]=function(_0x15d349){logger[_0x3432('0x2d')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x15d349[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x15d349['sms_account_id'])){return this[_0x3432('0xc')]['noop']('no\x20sms\x20account\x20configured');}var _0x46dc8d=this[_0x3432('0x19e')][_0x3432('0xc3')](this,_0x15d349[_0x3432('0x19f')]);if(!_0x46dc8d){return this[_0x3432('0xc')][_0x3432('0x30')](_0x15d349,_0x3432('0x1a0'));}var _0x539c59={'body':_0x15d349[_0x3432('0x1a1')],'phone':_0x15d349['to']||'','SmsAccountId':_0x46dc8d['id']};logger['debug'](_0x3432('0x1a2'),JSON[_0x3432('0x78')](_0x539c59));this['createSquareDetailsReport'][_0x3432('0xc3')](this,_0x15d349,_0x15d349[_0x3432('0x19f')]);this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x1a3'),_0x46dc8d[_0x3432('0x13')]));this[_0x3432('0x32')][_0x3432('0xc3')](this,_0x539c59);return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0x1a4'));};AGIVertices[_0x3432('0xf')]['set']=function(_0x4ef081){logger['info'](util[_0x3432('0x27')](_0x3432('0x1a5'),_0x4ef081[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x4ef081['variable_id'])){return this[_0x3432('0xc')][_0x3432('0x30')](_0x4ef081,'no\x20variable\x20selected');}var _0x5d17e2=this['getVariable'][_0x3432('0xc3')](this,_0x4ef081[_0x3432('0xdb')]);if(!_0x5d17e2){return this[_0x3432('0xc')]['error'](_0x4ef081,_0x3432('0x110'));}return this[_0x3432('0xc')][_0x3432('0x9f')](_0x5d17e2,_0x4ef081[_0x3432('0x1a6')]);};AGIVertices[_0x3432('0xf')]['start']=function(_0x8ea25f){logger[_0x3432('0x2d')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x8ea25f[_0x3432('0x35')]));this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0x1a7'));if(_0x8ea25f[_0x3432('0xbf')]===_0x3432('0x1a8')){this['channel'][_0x3432('0xaa')](_0x3432('0x1a9'));return this[_0x3432('0xc')]['answer']();}return this['channel'][_0x3432('0xaa')](_0x3432('0x1aa'));};AGIVertices[_0x3432('0xf')]['subproject']=function(_0x345a79){logger['info'](util['format'](_0x3432('0x1ab'),_0x345a79[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x345a79['project_id'])){return this[_0x3432('0xc')][_0x3432('0x30')](_0x345a79,_0x3432('0x1ac'));}var _0x2b75d6=this[_0x3432('0x17')]['sync'](this,_0x345a79[_0x3432('0x1ad')]);if(!this[_0x3432('0xa6')](_0x2b75d6)){return this[_0x3432('0xc')][_0x3432('0x30')](_0x345a79,util[_0x3432('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x345a79[_0x3432('0x1ad')]));}if(_0x2b75d6===this[_0x3432('0xc')][_0x3432('0x37')]){return this[_0x3432('0xc')][_0x3432('0x30')](_0x345a79,_0x3432('0x1ae'));}this[_0x3432('0x33')][_0x3432('0xc3')](this,_0x345a79,_0x2b75d6);var _0x17d11a=this[_0x3432('0xc')][_0x3432('0x63')](_0x3432('0x1af'),util[_0x3432('0x27')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x3432('0xb9')][_0x3432('0x195')]||_0x3432('0x1b0'),_0x2b75d6,this[_0x3432('0xc')][_0x3432('0x37')]));if(_0x17d11a[_0x3432('0xa3')]===-0x1){return _0x17d11a;}return this['channel'][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x169'),_0x3432('0x1af'),_0x2b75d6));};AGIVertices[_0x3432('0xf')][_0x3432('0x1b1')]=function(_0x7bb97c){logger['info'](util[_0x3432('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x7bb97c['label']));var _0x4db737=this[_0x3432('0x62')]['sync'](this,_0x7bb97c[_0x3432('0xbb')]);this[_0x3432('0x33')]['sync'](this,_0x7bb97c,_0x7bb97c[_0x3432('0xbb')]);if(this[_0x3432('0xa6')](_0x7bb97c[_0x3432('0xdb')])){var _0x3d4e83=this['getVariable'][_0x3432('0xc3')](this,_0x7bb97c[_0x3432('0xdb')]);if(_0x3d4e83){this['channel'][_0x3432('0x9f')](_0x3d4e83,_0x4db737);return this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x1b2'),_0x7bb97c[_0x3432('0xbb')],_0x3d4e83));}}return this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x1b3'),_0x7bb97c[_0x3432('0xbb')]));};AGIVertices[_0x3432('0xf')][_0x3432('0x1b4')]=function(_0x4905af){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x4905af[_0x3432('0x35')]));_0x4905af['text']=_0x4905af[_0x3432('0x67')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3432('0xa6')](_0x4905af[_0x3432('0x1b5')])){return this[_0x3432('0xc')][_0x3432('0xaa')](_0x3432('0x1b6'));}if(!this['isConfigured'](_0x4905af[_0x3432('0x67')])){return this[_0x3432('0xc')][_0x3432('0xaa')]('no\x20text\x20configured');}this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x1b7'),_0x4905af['text']));var _0x5a4d7c=this[_0x3432('0x65')][_0x3432('0xc3')](this,_0x4905af);if(_0x5a4d7c){this[_0x3432('0xc')]['noop'](util[_0x3432('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x5a4d7c));var _0x5d8050=this[_0x3432('0xc')]['streamFile'](_0x5a4d7c);try{fs['unlink'](_0x5a4d7c+'.wav');}catch(_0x467e6b){logger['error'](_0x467e6b);}return _0x5d8050;}return this['channel'][_0x3432('0x30')](_0x4905af,_0x3432('0x1b8'));};AGIVertices[_0x3432('0xf')][_0x3432('0x1b9')]=function(_0x2e518f){logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x1ba'),_0x2e518f[_0x3432('0x35')]));_0x2e518f[_0x3432('0x67')]=_0x2e518f[_0x3432('0x67')][_0x3432('0x64')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3432('0xa6')](_0x2e518f['text'])){return this['channel'][_0x3432('0xaa')]('no\x20text\x20configured');}this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x1bb'),_0x2e518f[_0x3432('0x67')]));var _0x1fd27c=this[_0x3432('0x6b')]['sync'](this,_0x2e518f);if(_0x1fd27c){this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x1fd27c));var _0x5550b6=this[_0x3432('0xc')][_0x3432('0xfb')](_0x1fd27c);try{fs[_0x3432('0xfc')](_0x1fd27c+_0x3432('0x121'));}catch(_0x366a25){logger[_0x3432('0x30')](_0x366a25);}return _0x5550b6;}return this[_0x3432('0xc')][_0x3432('0x30')](_0x2e518f,_0x3432('0x1bc'));};AGIVertices[_0x3432('0xf')][_0x3432('0x1bd')]=function(_0x1ff84f){logger[_0x3432('0x2d')](util['format'](_0x3432('0x1be'),_0x1ff84f[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x1ff84f[_0x3432('0x153')])){return this[_0x3432('0xc')][_0x3432('0x30')](_0x1ff84f,_0x3432('0x152'));}logger['info'](util[_0x3432('0x27')](_0x3432('0x159'),this[_0x3432('0xc')][_0x3432('0x38')],_0x1ff84f[_0x3432('0x153')]));var _0x1e42c4=this[_0x3432('0x5c')][_0x3432('0xc3')](this,_0x1ff84f[_0x3432('0x153')]);if(_0x1e42c4){logger[_0x3432('0x2d')](util['format'](_0x3432('0x154'),this[_0x3432('0xc')][_0x3432('0x38')],_0x1ff84f[_0x3432('0x153')]));this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x154'),this[_0x3432('0xc')][_0x3432('0x38')],_0x1ff84f[_0x3432('0x153')]));return{'code':0xc8,'result':_0x3432('0x15a')};}else{logger[_0x3432('0x2d')](util[_0x3432('0x27')](_0x3432('0x155'),this['channel'][_0x3432('0x38')],_0x1ff84f[_0x3432('0x153')]));this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x155'),this[_0x3432('0xc')][_0x3432('0x38')],_0x1ff84f[_0x3432('0x153')]));return{'code':0xc8,'result':_0x3432('0x156')};}};AGIVertices['prototype'][_0x3432('0x1bf')]=function(_0x369794){logger[_0x3432('0x2d')](util['format'](_0x3432('0x1c0'),_0x369794[_0x3432('0x35')]));var _0x3bab4a=this[_0x3432('0xc')][_0x3432('0x63')](_0x3432('0x1c1'),[_0x369794[_0x3432('0x1c2')],_0x369794['options']]);if(_0x3bab4a['result']===-0x1){return _0x3bab4a;}return this[_0x3432('0xc')][_0x3432('0xaa')](util[_0x3432('0x27')](_0x3432('0x169'),_0x3432('0x1c1'),_0x369794[_0x3432('0x1c2')]));};AGIVertices['prototype'][_0x3432('0x1c3')]=function(_0x42b819){logger[_0x3432('0x2d')](util[_0x3432('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x42b819[_0x3432('0x35')]));if(!this[_0x3432('0xa6')](_0x42b819[_0x3432('0xdb')])){return this['channel'][_0x3432('0x30')](_0x42b819,_0x3432('0x1c4'));}var _0x4db456=this[_0x3432('0x10')][_0x3432('0xc3')](this,_0x42b819['variable_id']);if(!_0x4db456){return this[_0x3432('0xc')][_0x3432('0x30')](_0x42b819,_0x3432('0x110'));}var _0x3553a5=this[_0x3432('0xc')][_0x3432('0x10')](_0x4db456);return{'code':0xc8,'result':_0x3553a5['extra']?_0x3553a5[_0x3432('0xa5')]:'-'};};String['prototype'][_0x3432('0x1c5')]=function(_0x1b7320,_0x237953){return this[_0x3432('0xa0')](_0x1b7320)[_0x3432('0x1c6')](_0x237953);};module[_0x3432('0x1c7')]=AGIVertices;
\ No newline at end of file
+var _0xaf1b=['maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','wait','enter\x20in\x20callbackblock','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','callback_priority','before\x20createcmcontact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','no\x20database\x20selected','query','no\x20query\x20configured','replace','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','getdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','no\x20interval\x20configured','no\x20intervals\x20found','getVariable','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','200','%s_STATUS_MESSAGE','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','bcc','subject','service','host','port','secure','authentication','auth','pass','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','menu','getsecretdigits','channel','rpc','prototype','getVariableById','then','getVoiceQueue','getVoiceQueueById','name','catch','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','file','createSquareMessage','createCmContact','log','in\x20createcmcontact','in\x20createcmcontact\x20callback','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','dialTimezone','CALLERID(dialTimezone)','getContactByPhone','RES1','utcOffset','minutestoadd','scheduledat\x20before','minutes','scheduledat\x20after','insertContact','add','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','number','timeout','includes','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','length','saveRestApiResult','%s.%s','split','nextbracket','extra','replaceall\x20end','getAndSetVariable','result','setVariable'];(function(_0x2c31ff,_0x109a95){var _0xb0ecce=function(_0x5bcf0f){while(--_0x5bcf0f){_0x2c31ff['push'](_0x2c31ff['shift']());}};_0xb0ecce(++_0x109a95);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x3ea0d0,_0x228b02){_0x3ea0d0=_0x3ea0d0-0x0;var _0x1b9c5b=_0xaf1b[_0x3ea0d0];return _0x1b9c5b;};'use strict';var fs=require('fs');var path=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var _=require(_0xbaf1('0x2'));var sh=require(_0xbaf1('0x3'));var odbc=require(_0xbaf1('0x4'))();var rs=require(_0xbaf1('0x5'));var moment=require(_0xbaf1('0x6'));var Mustache=require(_0xbaf1('0x7'));var rp=require(_0xbaf1('0x8'));var logger=require(_0xbaf1('0x9'))(_0xbaf1('0xa'));var config=require(_0xbaf1('0xb'));var shared=require(_0xbaf1('0xc'));var scripts=require(_0xbaf1('0xd'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xbaf1('0xe'),'rawBody'];var verticesWithRetry=[_0xbaf1('0xf'),'getdigits',_0xbaf1('0x10')];var AGIVertices=function(_0x3723ae,_0x41a0ba,_0x4ece8c){this[_0xbaf1('0x11')]=_0x3723ae;this[_0xbaf1('0x12')]=_0x41a0ba;this['mailRpc']=_0x4ece8c;};AGIVertices[_0xbaf1('0x13')]['getVariable']=function(_0xeed5d4,_0x418d09){this[_0xbaf1('0x12')][_0xbaf1('0x14')](_0xeed5d4)[_0xbaf1('0x15')](function(_0x36ec1c){_0x418d09(null,_0x36ec1c?_0x36ec1c['name']:![]);})['catch'](function(_0x322058){_0x418d09(_0x322058);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x16')]=function(_0xb6f7d8,_0x1d94da){this[_0xbaf1('0x12')][_0xbaf1('0x17')](_0xb6f7d8)['then'](function(_0x32981b){_0x1d94da(null,_0x32981b?_0x32981b[_0xbaf1('0x18')]:![]);})[_0xbaf1('0x19')](function(_0x342c11){_0x1d94da(_0x342c11);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x1a')]=function(_0x199252,_0x18b8aa){this['rpc'][_0xbaf1('0x1b')](_0x199252)['then'](function(_0xfee892){_0x18b8aa(null,_0xfee892?_0xfee892[_0xbaf1('0x18')]:![]);})[_0xbaf1('0x19')](function(_0x11532d){_0x18b8aa(_0x11532d);});};AGIVertices['prototype'][_0xbaf1('0x1c')]=function(_0x52b6da,_0x2ac412){this[_0xbaf1('0x12')]['getSquareOdbcById'](_0x52b6da)[_0xbaf1('0x15')](function(_0x33c524){_0x2ac412(null,_0x33c524?_0x33c524[_0xbaf1('0x1d')]:![]);})[_0xbaf1('0x19')](function(_0x3ed50d){_0x2ac412(_0x3ed50d);});};AGIVertices[_0xbaf1('0x13')]['getUser']=function(_0x487d25,_0x3cb56b){this[_0xbaf1('0x12')][_0xbaf1('0x1e')](_0x487d25)['then'](function(_0x2e71ce){_0x3cb56b(null,_0x2e71ce?_0x2e71ce[_0xbaf1('0x18')]:![]);})[_0xbaf1('0x19')](function(_0x5794f9){_0x3cb56b(_0x5794f9);});};AGIVertices[_0xbaf1('0x13')]['getTrunk']=function(_0x1e7847,_0x181c9d){this[_0xbaf1('0x12')][_0xbaf1('0x1f')](_0x1e7847)[_0xbaf1('0x15')](function(_0x480835){_0x181c9d(null,_0x480835?_0x480835['name']:![]);})[_0xbaf1('0x19')](function(_0xda1d6c){_0x181c9d(_0xda1d6c);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x20')]=function(_0x4f202f,_0xa313ec){var _0x5959d0=this;this[_0xbaf1('0x12')][_0xbaf1('0x21')](_0x4f202f)[_0xbaf1('0x15')](function(_0x17f2ea){_0xa313ec(null,_0x17f2ea?_0x5959d0[_0xbaf1('0x22')](_0x17f2ea[_0xbaf1('0x23')]):![]);})[_0xbaf1('0x19')](function(_0x4db035){_0xa313ec(_0x4db035);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x24')]=function(_0x1a523d,_0x29f528){this[_0xbaf1('0x12')][_0xbaf1('0x25')](_0x1a523d)[_0xbaf1('0x15')](function(_0x75f165){_0x29f528(null,_0x75f165?_0x75f165:![]);})['catch'](function(_0x467aca){_0x29f528(_0x467aca);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x26')]=function(_0x2673e0,_0x562027,_0x19976c){this['mailRpc'][_0xbaf1('0x26')](_0x2673e0,_0x562027)['then'](function(){_0x19976c(null);})[_0xbaf1('0x19')](function(_0xb09ceb){_0x19976c(_0xb09ceb);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x27')]=function(_0x4a150e,_0x353fd2){this[_0xbaf1('0x12')][_0xbaf1('0x28')](_0x4a150e)[_0xbaf1('0x15')](function(_0x40e328){if(_0x40e328){if(_0x40e328[_0xbaf1('0x29')]){_0x353fd2(null,[_0x40e328[_0xbaf1('0x2a')]]);}else{_0x353fd2(null,_['map'](_0x40e328[_0xbaf1('0x2b')],_0xbaf1('0x2a')));}}else{_0x353fd2(null,![]);}})[_0xbaf1('0x19')](function(_0x1d6675){_0x353fd2(_0x1d6675);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x22')]=function(_0x3ac7b9){return util['format'](_0xbaf1('0x2c'),FILES_PATH,_0x3ac7b9);};AGIVertices['prototype'][_0xbaf1('0x2d')]=function(_0xcd28ce,_0x3889b3,_0x19c61e){odbc[_0xbaf1('0x2e')](_0xcd28ce,function(_0x5c9fd4){if(_0x5c9fd4){logger[_0xbaf1('0x2f')](_0xbaf1('0x30'),_0x5c9fd4);_0x19c61e(_0x5c9fd4);}else{logger[_0xbaf1('0x31')]('ODBC\x20connection\x20successfully');odbc['query'](_0x3889b3,function(_0x5ab210,_0x3e45aa){if(_0x5ab210){logger[_0xbaf1('0x31')]('Error\x20executing\x20query\x20%s',_0x3889b3);_0x19c61e(_0x5ab210);}else{logger[_0xbaf1('0x31')](_0xbaf1('0x32'),_0x3889b3);odbc[_0xbaf1('0x33')](function(_0x49dc0b){if(_0x49dc0b){logger[_0xbaf1('0x2f')](_0xbaf1('0x34'),_0x49dc0b);}_0x19c61e(null,_0x3e45aa);});}});}});};AGIVertices[_0xbaf1('0x13')]['getSmsAccount']=function(_0x24c10c,_0x39d196){this['rpc']['getSmsAccountById'](_0x24c10c)[_0xbaf1('0x15')](function(_0x4ca174){_0x39d196(null,_0x4ca174?_0x4ca174:![]);})['catch'](function(_0x5209ea){_0x39d196(_0x5209ea);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x35')]=function(_0x644721,_0x27c821){this[_0xbaf1('0x12')][_0xbaf1('0x35')](_0x644721)[_0xbaf1('0x15')](function(_0x338290){_0x27c821(null,_0x338290);})['catch'](function(_0x45f0b5){_0x27c821(_0x45f0b5);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x36')]=function(_0x314ac3,_0x57d561,_0x370ef1){this['rpc'][_0xbaf1('0x36')]({'uniqueid':this[_0xbaf1('0x11')][_0xbaf1('0x37')],'node':_0x314ac3['label'],'application':_0x314ac3[_0xbaf1('0x38')],'data':_0x57d561||null,'project_name':this[_0xbaf1('0x11')][_0xbaf1('0x39')],'callerid':this['channel'][_0xbaf1('0x3a')]})['then'](function(_0x4c159f){if(_0x370ef1){_0x370ef1(null,_0x4c159f);}})['catch'](function(_0x3381ab){if(_0x370ef1){_0x370ef1(_0x3381ab);}});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x3b')]=function(_0x115d11,_0x3ed8a0,_0x1e5955,_0x52bd9a){this[_0xbaf1('0x12')][_0xbaf1('0x3b')]({'uniqueid':this[_0xbaf1('0x11')][_0xbaf1('0x37')],'callerid':this[_0xbaf1('0x11')][_0xbaf1('0x3a')],'calleridname':this['channel'][_0xbaf1('0x3c')],'context':this['channel']['context'],'extension':this[_0xbaf1('0x11')][_0xbaf1('0x3d')],'priority':this[_0xbaf1('0x11')][_0xbaf1('0x3e')],'accountcode':this[_0xbaf1('0x11')]['accountcode'],'dnid':this[_0xbaf1('0x11')]['dnid'],'projectName':this[_0xbaf1('0x11')][_0xbaf1('0x39')],'saveName':_0x3ed8a0,'filename':_0x115d11[_0xbaf1('0x3f')]||_0x3ed8a0,'savePath':_0x1e5955})[_0xbaf1('0x15')](function(_0x2b1f4a){_0x52bd9a(null,_0x2b1f4a);})[_0xbaf1('0x19')](function(_0x2fc4a9){_0x52bd9a(_0x2fc4a9);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x40')]=function(_0x245a1d,_0x3db77c,_0x41f8fd){this[_0xbaf1('0x12')][_0xbaf1('0x40')]({'uniqueid':this[_0xbaf1('0x11')][_0xbaf1('0x37')],'body':_0x245a1d,'direction':_0x3db77c})['then'](function(_0x1373c5){if(_0x41f8fd){_0x41f8fd(null,_0x1373c5);}})[_0xbaf1('0x19')](function(_0x1715a3){if(_0x41f8fd){_0x41f8fd(_0x1715a3);}});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x41')]=function(_0x7117bf,_0x3962b5){console[_0xbaf1('0x42')](_0xbaf1('0x43'),_0x7117bf);console[_0xbaf1('0x42')](_0xbaf1('0x44'),_0x3962b5);var _0x4a57df=0x0;var _0x1744f2={'firstName':_[_0xbaf1('0x45')](_0x7117bf[_0xbaf1('0x18')])||_[_0xbaf1('0x46')](_0x7117bf[_0xbaf1('0x18')])?_0xbaf1('0x47')+Math['random']():_0x7117bf[_0xbaf1('0x18')],'lastName':_['isEmpty'](_0x7117bf[_0xbaf1('0x48')])||_[_0xbaf1('0x46')](_0x7117bf[_0xbaf1('0x48')])?null:_0x7117bf[_0xbaf1('0x48')],'phone':_0x7117bf[_0xbaf1('0x49')],'ListId':_0x7117bf[_0xbaf1('0x4a')],'scheduledat':_0x7117bf[_0xbaf1('0x4b')],'callbackUniqueid':this[_0xbaf1('0x11')][_0xbaf1('0x37')],'tags':_0xbaf1('0x4c'),'description':_0xbaf1('0x4d')+_0x7117bf['scheduledAt'][_0xbaf1('0x4e')](),'priority':_0x7117bf['callback_priority']};if(_['has'](_0x7117bf,'dialTimezone')){if(!_[_0xbaf1('0x46')](_0x7117bf['dialTimezone'])){var _0x5024cb=_0x7117bf[_0xbaf1('0x4f')];console[_0xbaf1('0x42')]('VALUE\x20TZ',_0x5024cb);if(_0x7117bf[_0xbaf1('0x4f')]==_0xbaf1('0x50')){this[_0xbaf1('0x12')][_0xbaf1('0x51')]({'phone':_0x7117bf[_0xbaf1('0x49')]})[_0xbaf1('0x15')](function(_0x1784d8){console[_0xbaf1('0x42')](_0xbaf1('0x52'),_0x1784d8);var _0x2b55aa=_0x1784d8['dialTimezone'];console[_0xbaf1('0x42')]('dialtimezone',_0x2b55aa);if(!_[_0xbaf1('0x46')](_0x2b55aa)){var _0x53ba22=shared[_0x2b55aa];console[_0xbaf1('0x42')]('tz',_0x53ba22);if(!_[_0xbaf1('0x46')](_0x53ba22)){var _0x3b2146=-0x1*_0x53ba22[_0xbaf1('0x53')];console[_0xbaf1('0x42')](_0xbaf1('0x54'),_0x3b2146);console[_0xbaf1('0x42')](_0xbaf1('0x55'),_0x1744f2[_0xbaf1('0x4b')]);_0x1744f2[_0xbaf1('0x4b')]=moment(_0x7117bf[_0xbaf1('0x4b')])['add'](_0x3b2146,_0xbaf1('0x56'));console['log'](_0xbaf1('0x57'),_0x1744f2['scheduledAt']);this[_0xbaf1('0x12')][_0xbaf1('0x58')](_0x1744f2,_0x7117bf,_0x3962b5)[_0xbaf1('0x15')](function(_0x26bccd){_0x3962b5(null,_0x26bccd);})[_0xbaf1('0x19')](function(_0x5130bd){_0x3962b5(_0x5130bd);});}else{this[_0xbaf1('0x12')][_0xbaf1('0x58')](_0x1744f2,_0x7117bf,_0x3962b5)[_0xbaf1('0x15')](function(_0x4b075a){_0x3962b5(null,_0x4b075a);})[_0xbaf1('0x19')](function(_0x227bfe){_0x3962b5(_0x227bfe);});}}else{this[_0xbaf1('0x12')][_0xbaf1('0x58')](_0x1744f2,_0x7117bf,_0x3962b5)[_0xbaf1('0x15')](function(_0x212789){_0x3962b5(null,_0x212789);})['catch'](function(_0x2f56d6){_0x3962b5(_0x2f56d6);});}});}else{var _0x4a57df=shared[_0x5024cb];if(!_[_0xbaf1('0x46')](_0x4a57df)){var _0xaa5409=-0x1*_0x4a57df[_0xbaf1('0x53')];_0x1744f2[_0xbaf1('0x4b')]=moment(_0x7117bf['scheduledAt'])[_0xbaf1('0x59')](_0xaa5409,_0xbaf1('0x56'));this[_0xbaf1('0x12')]['insertContact'](_0x1744f2,_0x7117bf,_0x3962b5)['then'](function(_0x247cff){_0x3962b5(null,_0x247cff);})[_0xbaf1('0x19')](function(_0x178dd6){_0x3962b5(_0x178dd6);});}else{this['rpc'][_0xbaf1('0x58')](_0x1744f2,_0x7117bf,_0x3962b5)[_0xbaf1('0x15')](function(_0x3ea68b){_0x3962b5(null,_0x3ea68b);})[_0xbaf1('0x19')](function(_0x1ea8f2){_0x3962b5(_0x1ea8f2);});}}}else{this['rpc'][_0xbaf1('0x58')](_0x1744f2,_0x7117bf,_0x3962b5)[_0xbaf1('0x15')](function(_0x127c90){_0x3962b5(null,_0x127c90);})['catch'](function(_0x4f9b26){_0x3962b5(_0x4f9b26);});}}else{this[_0xbaf1('0x12')][_0xbaf1('0x58')](_0x1744f2,_0x7117bf,_0x3962b5)[_0xbaf1('0x15')](function(_0x59675b){_0x3962b5(null,_0x59675b);})[_0xbaf1('0x19')](function(_0x39d184){_0x3962b5(_0x39d184);});}};AGIVertices[_0xbaf1('0x13')]['insertContact']=function(_0x464421,_0x41afbd,_0x50e9dd){this['rpc'][_0xbaf1('0x41')](_0x464421)[_0xbaf1('0x15')](function(_0x5d0909){_0x50e9dd(null,_0x5d0909);})['catch'](function(_0x38bf32){_0x50e9dd(_0x38bf32);});};AGIVertices['prototype'][_0xbaf1('0x5a')]=function(_0x46f130,_0x1d12da){this[_0xbaf1('0x12')][_0xbaf1('0x5b')](_0x46f130)[_0xbaf1('0x15')](function(_0x51dd60){_0x1d12da(null,_0x51dd60?_0x51dd60['name']:![]);})['catch'](function(_0x493bfa){_0x1d12da(_0x493bfa);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x5c')]=function(_0x1e8486,_0x487088,_0xab1f6e){var _0x12e901={'role':_0xbaf1('0x5d')};_0x12e901[_0x1e8486]=this[_0xbaf1('0x11')]['callerid'];this[_0xbaf1('0x12')][_0xbaf1('0x5c')](_0x12e901,_0x487088,this[_0xbaf1('0x11')][_0xbaf1('0x37')])[_0xbaf1('0x15')](function(_0x4f9f44){_0xab1f6e(null,_['isNil'](_0x4f9f44)?![]:!![]);})['catch'](function(_0x440d71){logger[_0xbaf1('0x2f')](_0x440d71);_0xab1f6e(null,![]);});};AGIVertices['prototype'][_0xbaf1('0x5e')]=function(_0x534e73,_0x43c68d){var _0x56629a={'role':_0xbaf1('0x5d')};_0x56629a[_0x534e73]=this[_0xbaf1('0x11')]['callerid'];this[_0xbaf1('0x12')][_0xbaf1('0x5e')](_0x56629a)[_0xbaf1('0x15')](function(_0x367751){_0x43c68d(null,_[_0xbaf1('0x46')](_0x367751)?![]:!![]);})['catch'](function(_0x3fc496){logger[_0xbaf1('0x2f')](_0x3fc496);_0x43c68d(null,![]);});};AGIVertices['prototype'][_0xbaf1('0x5f')]=function(_0x583bc2,_0x479a1d){var _0x3d46ea={'role':_0xbaf1('0x5d')};_0x3d46ea[_0x583bc2]=this[_0xbaf1('0x11')][_0xbaf1('0x3a')];this[_0xbaf1('0x12')][_0xbaf1('0x5f')](_0x3d46ea)[_0xbaf1('0x15')](function(_0x215f54){_0x479a1d(null,_[_0xbaf1('0x46')](_0x215f54)?![]:!![]);})[_0xbaf1('0x19')](function(_0x1d6e58){logger[_0xbaf1('0x2f')](_0x1d6e58);_0x479a1d(null,![]);});};AGIVertices['prototype'][_0xbaf1('0x60')]=function(_0x5a4342,_0x9799e9){var _0x1192cd={'role':_0xbaf1('0x5d')};_0x1192cd[_0x5a4342]=this[_0xbaf1('0x11')][_0xbaf1('0x3a')];var _0x399d04=_0x5a4342!=_0xbaf1('0x61')?util[_0xbaf1('0x62')](_0xbaf1('0x63'),'LOCAL',this[_0xbaf1('0x11')]['callerid']):undefined;this['rpc'][_0xbaf1('0x60')](_0x1192cd,_0x399d04)[_0xbaf1('0x15')](function(_0x345bbe){_0x9799e9(null,_['isNil'](_0x345bbe)?![]:!![]);})['catch'](function(_0x383578){logger[_0xbaf1('0x2f')](_0x383578);_0x9799e9(null,![]);});};AGIVertices['prototype'][_0xbaf1('0x64')]=function(_0x41196f,_0x446682){sh[_0xbaf1('0x65')](_[_0xbaf1('0x66')](_0x41196f),function(_0x5db08d,_0x4e5421){var _0x5e7f4f=_0x4e5421['replace'](/(\r\n|\n|\r)/gm,'');_0x446682(null,_0x5e7f4f);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x67')]=function(_0x404b56,_0x1b1a90){scripts['googleCloudTTS'](_0x404b56[_0xbaf1('0x68')],_0x404b56['google_cloud_tts_text_type']||_0xbaf1('0x69'),_0x404b56['text'],_0x404b56[_0xbaf1('0x6a')]||'en-US',_0x404b56[_0xbaf1('0x6b')]||_0xbaf1('0x6c'),_0x404b56[_0xbaf1('0x6d')]||_0xbaf1('0x6e'))['then'](function(_0xde578b){_0x1b1a90(null,_0xde578b);})[_0xbaf1('0x19')](function(_0x55cd4a){_0x1b1a90(_0x55cd4a);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x6f')]=function(_0x46d111,_0x11ee42){scripts[_0xbaf1('0x6f')](_0x46d111[_0xbaf1('0x69')],_0x46d111[_0xbaf1('0x70')]||'en',0x1)[_0xbaf1('0x15')](function(_0x5cc021){_0x11ee42(null,_0x5cc021);})[_0xbaf1('0x19')](function(_0x341715){_0x11ee42(_0x341715);});};AGIVertices[_0xbaf1('0x13')]['restAPI']=function(_0x22ed1c,_0x31c3bb){var _0x40885f={'uri':_0x22ed1c[_0xbaf1('0x71')],'method':_0x22ed1c[_0xbaf1('0x72')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x22ed1c['timeout'])===_0xbaf1('0x73')&&parseInt(_0x22ed1c[_0xbaf1('0x74')])>=0x1?parseInt(_0x22ed1c[_0xbaf1('0x74')])*0x3e8:0x5*0x3e8};if(_[_0xbaf1('0x75')](['POST',_0xbaf1('0x76')],_0x40885f['method'][_0xbaf1('0x77')]())){try{_0x40885f[_0xbaf1('0x78')]=_0x22ed1c['rawBody']?JSON[_0xbaf1('0x79')](_0x22ed1c['rawBody']):{};}catch(_0x2c0cf5){logger[_0xbaf1('0x2f')](_0xbaf1('0x7a'),_0x2c0cf5);}}try{_0x40885f[_0xbaf1('0x7b')]=_0x22ed1c[_0xbaf1('0xe')]?JSON[_0xbaf1('0x79')](_0x22ed1c[_0xbaf1('0xe')]):{};}catch(_0xe15c80){logger[_0xbaf1('0x2f')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0xe15c80);}if(_0x22ed1c[_0xbaf1('0x7c')]){try{var _0x114cdd=require(_0x22ed1c[_0xbaf1('0x7c')])[_0xbaf1('0x7d')](this,_0x40885f);_0x40885f[_0xbaf1('0x7e')]=Mustache[_0xbaf1('0x7f')](_0x22ed1c[_0xbaf1('0x71')],_0x114cdd,{},['$$','$$']);if(_0x40885f[_0xbaf1('0x7b')]){_0x40885f[_0xbaf1('0x7b')]=JSON[_0xbaf1('0x79')](Mustache[_0xbaf1('0x7f')](JSON[_0xbaf1('0x80')](_0x40885f[_0xbaf1('0x7b')]),_0x114cdd,{},['$$','$$']));}if(_0x40885f[_0xbaf1('0x78')]){_0x40885f[_0xbaf1('0x78')]=JSON[_0xbaf1('0x79')](Mustache[_0xbaf1('0x7f')](JSON[_0xbaf1('0x80')](_0x40885f['body']),_0x114cdd,{},['$$','$$']));}}catch(_0x21f6b2){logger[_0xbaf1('0x2f')](_0xbaf1('0x81'),_0x21f6b2);}}rp(_0x40885f)[_0xbaf1('0x15')](function(_0x5b08d6){var _0x95fafa={'statusCode':_0x5b08d6[_0xbaf1('0x82')]||0xc8,'statusMessage':_0x5b08d6[_0xbaf1('0x83')]||'OK','headers':_0x5b08d6['headers']||{},'body':_0x5b08d6[_0xbaf1('0x78')]||{}};_0x31c3bb(null,_0x95fafa);})[_0xbaf1('0x19')](function(_0x280f35){var _0x44fd6c={'statusCode':_0x280f35[_0xbaf1('0x82')]||0x1f4,'statusMessage':_0x280f35[_0xbaf1('0x84')]||_0xbaf1('0x85'),'headers':_0x280f35[_0xbaf1('0x86')]['headers']||{},'body':_0x280f35['options'][_0xbaf1('0x78')]||{}};_0x31c3bb(null,_0x44fd6c);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x87')]=function(_0x54897b,_0x4611bb){scripts[_0xbaf1('0x87')](this[_0xbaf1('0x11')]['uniqueid'],_0x54897b[_0xbaf1('0x88')],_0x54897b[_0xbaf1('0x69')],_0x54897b[_0xbaf1('0x89')]||'en')[_0xbaf1('0x15')](function(_0x2820f0){_0x4611bb(null,_0x2820f0);})[_0xbaf1('0x19')](function(_0x211c52){_0x4611bb(_0x211c52);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x8a')]=function(_0xfc4e69,_0x5bf914){scripts[_0xbaf1('0x8a')](this['channel'],_0xfc4e69)[_0xbaf1('0x15')](function(_0x41e4e9){_0x5bf914(null,_0x41e4e9);})['catch'](function(_0x203b39){_0x5bf914(_0x203b39);});};AGIVertices['prototype'][_0xbaf1('0x8b')]=function(_0x5cd66e,_0x565015){scripts[_0xbaf1('0x8b')](_0x5cd66e[_0xbaf1('0x88')],_0x5cd66e[_0xbaf1('0x69')],_0x5cd66e[_0xbaf1('0x8c')]||'en-US',_0x5cd66e[_0xbaf1('0x8d')])['then'](function(_0x45974f){_0x565015(null,_0x45974f);})['catch'](function(_0x440e69){_0x565015(_0x440e69);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x8e')]=function(_0x5af18a,_0x2200b2,_0xfe8b4a){scripts[_0xbaf1('0x8e')](_0x2200b2,_0x5af18a[_0xbaf1('0x88')],_0x5af18a[_0xbaf1('0x8f')]||'en-US',this[_0xbaf1('0x90')](_0x5af18a[_0xbaf1('0x91')])?_0x5af18a[_0xbaf1('0x91')]:undefined)['then'](function(_0x2f0ecd){_0xfe8b4a(null,_0x2f0ecd);})[_0xbaf1('0x19')](function(_0x25d3f9){_0xfe8b4a(_0x25d3f9);});};AGIVertices['prototype'][_0xbaf1('0x92')]=function(_0x3e42cd,_0x223db0){scripts[_0xbaf1('0x92')](_0x3e42cd[_0xbaf1('0x93')],_0x3e42cd[_0xbaf1('0x94')],_0x3e42cd['aws_polly_region'],_0x3e42cd[_0xbaf1('0x95')]||_0xbaf1('0x96'),_0x3e42cd[_0xbaf1('0x69')],_0x3e42cd[_0xbaf1('0x97')]||_0xbaf1('0x69'))[_0xbaf1('0x15')](function(_0x414890){_0x223db0(null,_0x414890);})[_0xbaf1('0x19')](function(_0xc23eda){_0x223db0(_0xc23eda);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x98')]=function(_0x4f7f8f,_0x597350){scripts[_0xbaf1('0x98')](this[_0xbaf1('0x11')][_0xbaf1('0x37')],_0x4f7f8f[_0xbaf1('0x93')],_0x4f7f8f[_0xbaf1('0x94')],_0x4f7f8f['aws_lex_region'],_0x4f7f8f[_0xbaf1('0x69')],_0x4f7f8f[_0xbaf1('0x99')])['then'](function(_0x563691){_0x597350(null,_0x563691);})[_0xbaf1('0x19')](function(_0x14c83b){_0x597350(_0x14c83b);});};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x9a')]=function(_0x5504a3,_0x18193e,_0x989dc3){scripts['googleASR'](_0x18193e,_0x5504a3[_0xbaf1('0x88')],_0x5504a3[_0xbaf1('0x9b')]||'en-US')[_0xbaf1('0x15')](function(_0x1a0d6b){_0x989dc3(null,_0x1a0d6b);})[_0xbaf1('0x19')](function(_0x349c29){_0x989dc3(_0x349c29);});};AGIVertices['prototype'][_0xbaf1('0x9c')]=function(_0x1a334c,_0x394819,_0x2885b8){scripts['tildeASR'](_0x394819,_0x1a334c[_0xbaf1('0x9d')],_0x1a334c[_0xbaf1('0x9e')],_0x1a334c['uri'])['then'](function(_0x4983f7){_0x2885b8(null,_0x4983f7);})[_0xbaf1('0x19')](function(_0x4cb39a){_0x2885b8(_0x4cb39a);});};AGIVertices['prototype']['clear']=function(_0x11e52b){var _0xf3f68b=_[_0xbaf1('0x75')](verticesWithRetry,_0x11e52b[_0xbaf1('0x38')])?_0x11e52b:_[_0xbaf1('0x9f')](_0x11e52b);for(var _0xbdb883 in _0xf3f68b){if(_0xf3f68b['hasOwnProperty'](_0xbdb883)){if(_0xf3f68b[_0xbdb883]&&_[_0xbaf1('0xa0')](_0xf3f68b[_0xbdb883])){if(_[_0xbaf1('0x75')](recursiveMapAttributes,_0xbdb883)){_0xf3f68b[_0xbdb883]=this[_0xbaf1('0xa1')](_0xf3f68b[_0xbdb883]);}else{_0xf3f68b[_0xbdb883]=this[_0xbaf1('0xa2')](_0xf3f68b[_0xbdb883]);}}}}return _0xf3f68b;};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xa3')]=function(_0x2a246e){for(var _0x286b1b in _0x2a246e){if(_0x2a246e[_0xbaf1('0xa4')](_0x286b1b)){if(_[_0xbaf1('0xa5')](_0x2a246e[_0x286b1b])){this[_0xbaf1('0xa3')](_0x2a246e[_0x286b1b]);}else if(_['isArray'](_0x2a246e[_0x286b1b])){for(var _0x5a78b9=0x0;_0x5a78b9<_0x2a246e[_0x286b1b][_0xbaf1('0xa6')];_0x5a78b9++){this[_0xbaf1('0xa3')](_0x2a246e[_0x286b1b][_0x5a78b9]);}}else if(_['isString'](_0x2a246e[_0x286b1b])){_0x2a246e[_0x286b1b]=this[_0xbaf1('0xa2')](_0x2a246e[_0x286b1b]);}}}};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xa7')]=function(_0x160b67,_0x4f33a9){for(var _0x47948a in _0x160b67){if(_0x160b67[_0xbaf1('0xa4')](_0x47948a)){if(_[_0xbaf1('0xa5')](_0x160b67[_0x47948a])){if(!_[_0xbaf1('0x45')](_0x160b67[_0x47948a])){this[_0xbaf1('0xa7')](_0x160b67[_0x47948a],util[_0xbaf1('0x62')]('%s.%s',_0x4f33a9,_0x47948a));}}else if(_['isArray'](_0x160b67[_0x47948a])){for(var _0x17003d=0x0;_0x17003d<_0x160b67[_0x47948a][_0xbaf1('0xa6')];_0x17003d++){this['saveRestApiResult'](_0x160b67[_0x47948a][_0x17003d],util['format'](_0xbaf1('0xa8'),_0x4f33a9,_0x47948a+'['+_0x17003d+']'));}}else{if(!_['isNil'](_0x160b67[_0x47948a])){this[_0xbaf1('0x11')]['setVariable'](util[_0xbaf1('0x62')](_0xbaf1('0xa8'),_0x4f33a9,_0x47948a),_0x160b67[_0x47948a]);}}}}};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xa1')]=function(_0x3aa2fd){try{var _0x1d0bb6=JSON[_0xbaf1('0x79')](_0x3aa2fd);this[_0xbaf1('0xa3')](_0x1d0bb6);return JSON['stringify'](_0x1d0bb6);}catch(_0x3d5d04){return this[_0xbaf1('0xa2')](_0x3aa2fd);}};AGIVertices[_0xbaf1('0x13')]['replaceAllVariables']=function(_0x19efff){console[_0xbaf1('0x42')]('replaceall\x20init',_0x19efff);var _0x454351=_0x19efff[_0xbaf1('0xa9')]('{');for(var _0x3856a7=0x1;_0x3856a7<_0x454351[_0xbaf1('0xa6')];_0x3856a7+=0x1){var _0x320b9e=_0x454351[_0x3856a7][_0xbaf1('0xa9')]('}');console['log'](_0xbaf1('0xaa'),_0x320b9e);if(_0x320b9e[_0xbaf1('0xa6')]>0x1){_0x19efff=_0x19efff['replaceAll']('{'+_0x320b9e[0x0]+'}',this[_0xbaf1('0x11')]['getVariable'](_0x320b9e[0x0])[_0xbaf1('0xab')]||_0x320b9e[0x0]);}}if(_0x454351[_0xbaf1('0xa6')]===0x1){return _0x19efff['toString']();}console['log'](_0xbaf1('0xac'),_0x19efff);return this[_0xbaf1('0xa2')](_0x19efff);};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xad')]=function(_0xf0d5ad,_0x17e26b){var _0x321998=this['channel']['getVariable'](_0xf0d5ad);if(_0x321998[_0xbaf1('0xae')]===-0x1){return _0x321998;}logger[_0xbaf1('0x31')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x17e26b,_0x321998[_0xbaf1('0xab')]));return this['channel'][_0xbaf1('0xaf')](_0x17e26b,_0x321998[_0xbaf1('0xab')]);};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x90')]=function(_0x2d6ebe){return _0x2d6ebe&&_0x2d6ebe!=='0'&&_0x2d6ebe!=='-1'&&_0x2d6ebe!=='';};AGIVertices['prototype'][_0xbaf1('0xb0')]=function(_0x1bc2cb){this[_0xbaf1('0x36')][_0xbaf1('0x7d')](this,_0x1bc2cb,'-');_0x1bc2cb[_0xbaf1('0xb1')]=_0x1bc2cb['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xb2')]=function(_0x415d90){logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0xb3'),_0x415d90[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x415d90[_0xbaf1('0x69')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0xb6'));}var _0x532bba='\x22'+_0x415d90[_0xbaf1('0x69')]+'\x22';if(this[_0xbaf1('0x90')](_0x415d90[_0xbaf1('0x86')])){_0x532bba+=','+_0x415d90[_0xbaf1('0x86')];}var _0x45a1d6=this[_0xbaf1('0x11')]['exec'](_0xbaf1('0xb7'),_0x532bba);if(_0x45a1d6['result']===-0x1){return _0x45a1d6;}return this[_0xbaf1('0x11')]['noop'](util[_0xbaf1('0x62')](_0xbaf1('0xb8'),_0x532bba));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xb9')]=function(_0xb7d098){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0xba'),_0xb7d098[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0xb7d098[_0xbaf1('0xbb')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x4f83ea=_0xb7d098[_0xbaf1('0xbb')];if(this[_0xbaf1('0x90')](_0xb7d098[_0xbaf1('0x86')])){_0x4f83ea+=','+_0xb7d098['options'];}var _0xd149cc=this[_0xbaf1('0x11')][_0xbaf1('0x65')](_0xbaf1('0xbc'),_0x4f83ea);if(_0xd149cc['result']===-0x1){return _0xd149cc;}var _0x23f4ba=this[_0xbaf1('0xad')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x23f4ba['result']===-0x1){return _0x23f4ba;}var _0x383b59=this['getAndSetVariable'](_0xbaf1('0xbd'),_0xbaf1('0xbe'));if(_0x383b59[_0xbaf1('0xae')]===-0x1){return _0x383b59;}var _0x42c74a=this[_0xbaf1('0xad')](_0xbaf1('0xbf'),'MRCP_RECOG_INSTANCE');if(_0x42c74a[_0xbaf1('0xae')]===-0x1){return _0x42c74a;}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format'](_0xbaf1('0xc0'),_0x4f83ea));};AGIVertices['prototype'][_0xbaf1('0xa')]=function(_0x1a0e52){logger[_0xbaf1('0x31')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1a0e52['label']));return this[_0xbaf1('0x11')][_0xbaf1('0xa')]([_0x1a0e52[_0xbaf1('0xc1')],_0x1a0e52[_0xbaf1('0xc2')]]);};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xc3')]=function(_0x2af4eb){logger['info'](util[_0xbaf1('0x62')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2af4eb['label']));if(this[_0xbaf1('0x90')](_0x2af4eb['timeout'])){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2af4eb[_0xbaf1('0x74')]));var _0x54143f=this[_0xbaf1('0x11')][_0xbaf1('0xc4')](_0x2af4eb[_0xbaf1('0x74')]);if(_0x54143f[_0xbaf1('0xae')]===-0x1){return _0x54143f;}}return this[_0xbaf1('0x11')]['answer']();};AGIVertices[_0xbaf1('0x13')]['callback']=function(_0x4bbee1){console[_0xbaf1('0x42')](_0xbaf1('0xc5'),_0x4bbee1);logger['info'](util['format'](_0xbaf1('0xc6'),_0x4bbee1[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x4bbee1[_0xbaf1('0x4a')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x4bbee1,_0xbaf1('0xc7'));}_0x4bbee1[_0xbaf1('0x4b')]=moment();if(this[_0xbaf1('0x90')](_0x4bbee1[_0xbaf1('0xc8')])){_0x4bbee1['scheduledAt']=moment()['add'](_0x4bbee1[_0xbaf1('0xc8')],_0xbaf1('0x56'));}if(!this[_0xbaf1('0x90')](_0x4bbee1[_0xbaf1('0xc9')])){_0x4bbee1['callback_priority']=0x2;}console[_0xbaf1('0x42')](_0xbaf1('0xca'),_0x4bbee1);this['createCmContact']['sync'](this,_0x4bbee1);return this[_0xbaf1('0x11')]['noop'](util[_0xbaf1('0x62')](_0xbaf1('0xcb'),_0x4bbee1[_0xbaf1('0x49')],_0x4bbee1['list_id'],_0x4bbee1['scheduledAt']));};AGIVertices['prototype'][_0xbaf1('0xcc')]=function(_0x3d3fbb){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0xcd'),_0x3d3fbb['label']));var _0x351390=this['channel'][_0xbaf1('0x65')](_0x3d3fbb[_0xbaf1('0xce')],_0x3d3fbb[_0xbaf1('0x86')]);if(_0x351390[_0xbaf1('0xae')]===-0x1){return _0x351390;}return this['channel']['noop'](util['format'](_0xbaf1('0xcf'),_0x3d3fbb[_0xbaf1('0xce')],_0x3d3fbb[_0xbaf1('0x86')]));};AGIVertices['prototype'][_0xbaf1('0xd0')]=function(_0x2ea99e){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0xd1'),_0x2ea99e[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x2ea99e[_0xbaf1('0x69')])){return this[_0xbaf1('0x11')]['noop'](_0xbaf1('0xb6'));}var _0x54915f='\x22'+_0x2ea99e[_0xbaf1('0x69')]+'\x22';if(this['isConfigured'](_0x2ea99e[_0xbaf1('0x86')])){_0x54915f+=','+_0x2ea99e[_0xbaf1('0x86')];}var _0x441b15=this[_0xbaf1('0x11')][_0xbaf1('0x65')]('MRCPSynth',_0x54915f);if(_0x441b15['result']===-0x1){return _0x441b15;}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format'](_0xbaf1('0xb8'),_0x54915f));};AGIVertices['prototype'][_0xbaf1('0xd2')]=function(_0x38df48){logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0xd3'),_0x38df48[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x38df48[_0xbaf1('0x69')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')]('no\x20text\x20configured');}var _0x11164e='\x22'+_0x38df48[_0xbaf1('0x69')]+'\x22';if(this['isConfigured'](_0x38df48[_0xbaf1('0x86')])){_0x11164e+=','+_0x38df48[_0xbaf1('0x86')];}var _0x4584fa=this[_0xbaf1('0x11')][_0xbaf1('0x65')](_0xbaf1('0xb7'),_0x11164e);if(_0x4584fa[_0xbaf1('0xae')]===-0x1){return _0x4584fa;}return this[_0xbaf1('0x11')]['noop'](util[_0xbaf1('0x62')](_0xbaf1('0xb8'),_0x11164e));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xd4')]=function(_0x4a52ae){logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0xd5'),_0x4a52ae[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x4a52ae[_0xbaf1('0xbb')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')]('no\x20grammar\x20configured');}var _0x2d9f64=_0x4a52ae[_0xbaf1('0xbb')];if(this['isConfigured'](_0x4a52ae[_0xbaf1('0x86')])){_0x2d9f64+=','+_0x4a52ae[_0xbaf1('0x86')];}var _0x13dc98=this[_0xbaf1('0x11')]['exec'](_0xbaf1('0xbc'),_0x2d9f64);if(_0x13dc98[_0xbaf1('0xae')]===-0x1){return _0x13dc98;}var _0x34de0f=this[_0xbaf1('0xad')](_0xbaf1('0xd6'),_0xbaf1('0xd7'));if(_0x34de0f[_0xbaf1('0xae')]===-0x1){return _0x34de0f;}var _0x2eb2c2=this[_0xbaf1('0xad')](_0xbaf1('0xbd'),_0xbaf1('0xd8'));if(_0x2eb2c2[_0xbaf1('0xae')]===-0x1){return _0x2eb2c2;}var _0x44ab8a=this[_0xbaf1('0xad')]('RECOG_INSTANCE()',_0xbaf1('0xd9'));if(_0x44ab8a[_0xbaf1('0xae')]===-0x1){return _0x44ab8a;}return this[_0xbaf1('0x11')]['noop'](util['format'](_0xbaf1('0xc0'),_0x2d9f64));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xda')]=function(_0x1dec22){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1dec22[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x1dec22[_0xbaf1('0xbb')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0xdb'));}var _0x39e247=_0x1dec22[_0xbaf1('0xbb')];if(this[_0xbaf1('0x90')](_0x1dec22[_0xbaf1('0x86')])){_0x39e247+=','+_0x1dec22[_0xbaf1('0x86')];}var _0x1b27b5=this[_0xbaf1('0x11')][_0xbaf1('0x65')](_0xbaf1('0xbc'),_0x39e247);if(_0x1b27b5[_0xbaf1('0xae')]===-0x1){return _0x1b27b5;}var _0x5d53ff=this[_0xbaf1('0xad')]('RECOG_CONFIDENCE()',_0xbaf1('0xdc'));if(_0x5d53ff[_0xbaf1('0xae')]===-0x1){return _0x5d53ff;}var _0x3bcf2e=this[_0xbaf1('0xad')](_0xbaf1('0xbd'),_0xbaf1('0xdd'));if(_0x3bcf2e[_0xbaf1('0xae')]===-0x1){return _0x3bcf2e;}var _0x3bf24f=this[_0xbaf1('0xad')](_0xbaf1('0xbf'),_0xbaf1('0xde'));if(_0x3bf24f[_0xbaf1('0xae')]===-0x1){return _0x3bf24f;}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x39e247));};AGIVertices['prototype']['database']=function(_0x2689b3){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x2689b3[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x2689b3[_0xbaf1('0xdf')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x2689b3,_0xbaf1('0xe0'));}var _0x35c45e=this['getSquareOdbc']['sync'](this,_0x2689b3[_0xbaf1('0xdf')]);if(!_0x35c45e){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x2689b3,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x2689b3[_0xbaf1('0xe1')])){return this['channel'][_0xbaf1('0x2f')](_0x2689b3,_0xbaf1('0xe2'));}var _0xa32529=_0x2689b3[_0xbaf1('0xe1')][_0xbaf1('0xe3')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xbaf1('0xb5')](util['format'](_0xbaf1('0xe4'),_0xa32529));var _0x16bf98=this[_0xbaf1('0x2d')][_0xbaf1('0x7d')](this,_0x35c45e,_0xa32529);this[_0xbaf1('0x36')][_0xbaf1('0x7d')](this,_0x2689b3,_0xa32529);if(!this[_0xbaf1('0x90')](_0x2689b3['variable_id'])){return this['channel'][_0xbaf1('0xb5')](_0xbaf1('0xe5'));}var _0x326c00=this['getVariable'][_0xbaf1('0x7d')](this,_0x2689b3[_0xbaf1('0xe6')]);if(!_0x326c00){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x2689b3,_0xbaf1('0xe7'));}var _0x415df7=this;_0x16bf98[_0xbaf1('0xe8')](function(_0x141a15,_0x5d94b7){Object[_0xbaf1('0xe9')](_0x141a15)[_0xbaf1('0xe8')](function(_0x50a20a){_0x415df7[_0xbaf1('0x11')][_0xbaf1('0xaf')](util[_0xbaf1('0x62')](_0xbaf1('0xea'),_0x326c00,_0x5d94b7,_0x50a20a),_0x141a15[_0x50a20a]);});});this[_0xbaf1('0x11')]['setVariable'](util[_0xbaf1('0x62')]('%s_ROWS_COUNT',_0x326c00),_0x16bf98['length']);return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format'](_0xbaf1('0xeb'),_0x326c00));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xec')]=function(_0x558b59){logger[_0xbaf1('0xed')](util[_0xbaf1('0x62')](_0xbaf1('0xee'),_0x558b59[_0xbaf1('0xb4')]));if(!this['isConfigured'](_0x558b59[_0xbaf1('0xef')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x558b59,_0xbaf1('0xf0'));}var _0x211994=this['getUser'][_0xbaf1('0x7d')](this,_0x558b59[_0xbaf1('0xef')]);if(!_0x211994){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x558b59,_0xbaf1('0xf1'));}var _0x546b9e=this[_0xbaf1('0x11')]['exec'](_0xbaf1('0xf2'),[util[_0xbaf1('0x62')](_0xbaf1('0xf3'),_0x211994),_0x558b59['timeout'],_0x558b59[_0xbaf1('0xf4')],_0x558b59[_0xbaf1('0x71')]]);if(_0x546b9e['result']===-0x1){return _0x546b9e;}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')]('Executed\x20command\x20%s',_0xbaf1('0xf2')));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0xf5')]=function(_0x48e3a4){logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0xf6'),_0x48e3a4[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x48e3a4[_0xbaf1('0x88')])){return this['channel'][_0xbaf1('0xb5')](_0xbaf1('0xf7'));}if(!this[_0xbaf1('0x90')](_0x48e3a4[_0xbaf1('0x69')])){return this[_0xbaf1('0x11')]['noop'](_0xbaf1('0xb6'));}this['channel'][_0xbaf1('0xf8')]=!![];this[_0xbaf1('0x36')](_0x48e3a4);this[_0xbaf1('0x40')](_0x48e3a4[_0xbaf1('0x69')],'in');this[_0xbaf1('0x11')]['noop'](util[_0xbaf1('0x62')](_0xbaf1('0xf9'),_0x48e3a4[_0xbaf1('0x69')]));var _0x26cb00=this['googleDialogflow'][_0xbaf1('0x7d')](this,_0x48e3a4);if(_0x26cb00){for(var _0x224cba in _0x26cb00){if(_0x26cb00[_0xbaf1('0xa4')](_0x224cba)){this[_0xbaf1('0x11')][_0xbaf1('0xaf')](util['format'](_0xbaf1('0xfa'),_0x224cba[_0xbaf1('0x77')]()),_0x26cb00[_0x224cba]);}}this['createSquareMessage'](_0x26cb00['speech'],_0xbaf1('0xfb'));return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0xfc'),_0x26cb00[_0xbaf1('0xfd')]));}return this['channel']['error'](_0x48e3a4,_0xbaf1('0xfe'));};AGIVertices[_0xbaf1('0x13')]['sesteknda']=function(_0xbc110d){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0xff'),_0xbc110d[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0xbc110d[_0xbaf1('0x100')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x101'));}if(!this['isConfigured'](_0xbc110d['username'])){return this['channel']['noop'](_0xbaf1('0x102'));}if(!this[_0xbaf1('0x90')](_0xbc110d[_0xbaf1('0x103')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x104'));}if(!this['isConfigured'](_0xbc110d[_0xbaf1('0x105')])){return this[_0xbaf1('0x11')]['noop']('no\x20text\x20configured');}this['channel'][_0xbaf1('0xf8')]=!![];this[_0xbaf1('0x36')](_0xbc110d);this[_0xbaf1('0x40')](_0xbc110d[_0xbaf1('0x69')],'in');this[_0xbaf1('0x11')]['noop'](util[_0xbaf1('0x62')](_0xbaf1('0x106'),_0xbc110d[_0xbaf1('0x69')]));var _0x3d48bb=this[_0xbaf1('0x8a')][_0xbaf1('0x7d')](this,_0xbc110d);if(_0x3d48bb){for(var _0x485ad6 in _0x3d48bb){if(_0x3d48bb[_0xbaf1('0xa4')](_0x485ad6)){this[_0xbaf1('0x11')]['setVariable'](util[_0xbaf1('0x62')]('SESTEK_NDA_%s',_0x485ad6[_0xbaf1('0x77')]()),_0x3d48bb[_0x485ad6]);}}this[_0xbaf1('0x40')](_0x3d48bb[_0xbaf1('0xfd')],_0xbaf1('0xfb'));if(_0x3d48bb[_0xbaf1('0x107')]){this['channel']['noop'](util[_0xbaf1('0x62')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x3d48bb[_0xbaf1('0x107')]));var _0x183fab=this[_0xbaf1('0x11')][_0xbaf1('0x108')](_0x3d48bb[_0xbaf1('0x107')]);try{fs[_0xbaf1('0x109')](_0x3d48bb[_0xbaf1('0x107')]+_0xbaf1('0x10a'));}catch(_0x4864f5){logger[_0xbaf1('0x2f')](_0x4864f5);}return _0x183fab;}else{return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x10b'),_0x3d48bb[_0xbaf1('0xfd')]));}}return this['channel']['error'](_0xbc110d,_0xbaf1('0x10c'));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x10d')]=function(_0x3830e4){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x10e'),_0x3830e4[_0xbaf1('0xb4')]));return this['channel'][_0xbaf1('0xb5')](_0xbaf1('0x10d'));};AGIVertices['prototype'][_0xbaf1('0x10f')]=function(_0x19b95f){logger['info'](util['format'](_0xbaf1('0x110'),_0x19b95f['label']));var _0x135456='';if(_0x19b95f[_0xbaf1('0x111')]){if(!this[_0xbaf1('0x90')](_0x19b95f[_0xbaf1('0x111')])){return this[_0xbaf1('0x11')]['error'](_0x19b95f,_0xbaf1('0x112'));}else{var _0x22f7dd=parseInt(_0x19b95f['trunk_id'],0xa);if(isNaN(_0x22f7dd)){_0x135456=_0x19b95f[_0xbaf1('0x111')];}else{_0x135456=this[_0xbaf1('0x113')]['sync'](this,_0x19b95f[_0xbaf1('0x111')]);if(!_0x135456){return this[_0xbaf1('0x11')]['error'](_0x19b95f,'no\x20trunk\x20found');}}}}else if(_0x19b95f['trunk_name']){_0x135456=_0x19b95f[_0xbaf1('0x114')];}else{return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x19b95f,_0xbaf1('0x112'));}var _0x307a70=this['channel'][_0xbaf1('0x65')](_0xbaf1('0xf2'),[util[_0xbaf1('0x62')](_0xbaf1('0x115'),_0x135456,_0x19b95f[_0xbaf1('0x49')]),_0x19b95f[_0xbaf1('0x74')],_0x19b95f[_0xbaf1('0xf4')],_0x19b95f[_0xbaf1('0x71')]]);if(_0x307a70[_0xbaf1('0xae')]===-0x1){return _0x307a70;}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xbaf1('0x13')]['finally']=function(_0x477fd4){logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x116'),_0x477fd4['label']));return this['channel']['noop'](_0xbaf1('0x117'));};AGIVertices['prototype']['getdigits']=function(_0x4082fe){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4082fe['label']));if(_0x4082fe[_0xbaf1('0xb1')]===0x0){return this[_0xbaf1('0xb0')](_0x4082fe);}_0x4082fe[_0xbaf1('0xb1')]-=0x1;if(!this[_0xbaf1('0x90')](_0x4082fe[_0xbaf1('0x118')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x4082fe,_0xbaf1('0x119'));}var _0xf1ca09=this['getSound'][_0xbaf1('0x7d')](this,_0x4082fe['file_id']);if(!_0xf1ca09){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x4082fe,_0xbaf1('0x11a'));}if(!this[_0xbaf1('0x90')](_0x4082fe[_0xbaf1('0xe6')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0xbaf1('0xe5'));}var _0x467ed1=this[_0xbaf1('0x11')][_0xbaf1('0x11b')](_0xf1ca09,_0x4082fe[_0xbaf1('0x11c')],_0x4082fe['maxdigit']);var _0x4b82b9=_0x467ed1[_0xbaf1('0xae')]?_0x467ed1['result'][_0xbaf1('0x4e')]():'';logger[_0xbaf1('0x31')](_0xbaf1('0x11d'),JSON[_0xbaf1('0x80')](_0x467ed1));if(_0x467ed1[_0xbaf1('0xae')]===-0x1){this[_0xbaf1('0x36')]['sync'](this,_0x4082fe,_0x4b82b9);return _0x467ed1;}else if(_0x467ed1[_0xbaf1('0xab')]===_0xbaf1('0x74')){_0x467ed1['result']=_0x4b82b9[_0xbaf1('0xa6')]>=parseInt(_0x4082fe['mindigit'])?'x':'i';}else{_0x467ed1[_0xbaf1('0xae')]=_0x4b82b9['length']>=parseInt(_0x4082fe['mindigit'])&&_0x4b82b9[_0xbaf1('0xa6')]<=parseInt(_0x4082fe['maxdigit'])?'x':'i';}var _0x502e72=this['getVariable'][_0xbaf1('0x7d')](this,_0x4082fe['variable_id']);if(!_0x502e72){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x4082fe,_0xbaf1('0xe7'));}this[_0xbaf1('0x11')][_0xbaf1('0xaf')](_0x502e72,_0x4b82b9);if(this[_0xbaf1('0x90')](_0x4082fe[_0xbaf1('0x11e')])){var _0x23268d=parseInt(_0x4082fe[_0xbaf1('0x11e')],0xa);var _0x261e27=rs[_0xbaf1('0x11f')]({'charset':'*','length':_0x23268d});var _0x2a5fb7=_0x4b82b9['length'];if(_0x2a5fb7>0x0){if(_0x2a5fb7>_0x23268d){this[_0xbaf1('0x36')]['sync'](this,_0x4082fe,_0x4082fe[_0xbaf1('0x120')]===_0xbaf1('0x121')?_0x261e27+_0x4b82b9[_0xbaf1('0x122')](_0x23268d):_0x4b82b9[_0xbaf1('0x122')](0x0,_0x2a5fb7-_0x23268d)+_0x261e27);}else{this[_0xbaf1('0x36')][_0xbaf1('0x7d')](this,_0x4082fe,rs[_0xbaf1('0x11f')]({'charset':'*','length':_0x2a5fb7}));}}else{this[_0xbaf1('0x36')][_0xbaf1('0x7d')](this,_0x4082fe,'');}}else{this['createSquareDetailsReport'][_0xbaf1('0x7d')](this,_0x4082fe,_0x4b82b9);}return _0x467ed1;};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x10')]=function(_0x1f0302){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x123'),_0x1f0302[_0xbaf1('0xb4')]));return this[_0xbaf1('0x124')](_0x1f0302);};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x125')]=function(_0x12bdeb){logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0x126'),_0x12bdeb[_0xbaf1('0xb4')]));this[_0xbaf1('0x36')]['sync'](this,_0x12bdeb,_0x12bdeb[_0xbaf1('0x127')]);return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x128'),_0x12bdeb[_0xbaf1('0x127')]));};AGIVertices[_0xbaf1('0x13')]['awspolly']=function(_0x537fd4){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x129'),_0x537fd4[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x537fd4[_0xbaf1('0x93')])||!this[_0xbaf1('0x90')](_0x537fd4[_0xbaf1('0x94')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x12a'));}if(!this[_0xbaf1('0x90')](_0x537fd4[_0xbaf1('0x69')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0xb6'));}this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')]('Trying\x20aws\x20Polly\x20%s',_0x537fd4[_0xbaf1('0x69')]));var _0x24aae6=this[_0xbaf1('0x92')][_0xbaf1('0x7d')](this,_0x537fd4);if(_0x24aae6){this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format'](_0xbaf1('0x12b'),_0x24aae6));var _0x317151=this[_0xbaf1('0x11')][_0xbaf1('0x108')](_0x24aae6);try{fs[_0xbaf1('0x109')](_0x24aae6+'.wav');}catch(_0x190f20){logger[_0xbaf1('0x2f')](_0x190f20);}return _0x317151;}return this['channel']['error'](_0x537fd4,_0xbaf1('0x12c'));};AGIVertices[_0xbaf1('0x13')]['awslex']=function(_0x2a827d){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x12d'),_0x2a827d[_0xbaf1('0xb4')]));if(!this['isConfigured'](_0x2a827d['aws_access_key_id'])||!this[_0xbaf1('0x90')](_0x2a827d[_0xbaf1('0x94')])){return this['channel']['noop'](_0xbaf1('0x12a'));}if(!this[_0xbaf1('0x90')](_0x2a827d[_0xbaf1('0x99')])){return this['channel']['noop'](_0xbaf1('0x12e'));}if(!this[_0xbaf1('0x90')](_0x2a827d[_0xbaf1('0x69')])){return this['channel'][_0xbaf1('0xb5')](_0xbaf1('0xb6'));}this[_0xbaf1('0x11')]['bot']=!![];this[_0xbaf1('0x36')](_0x2a827d);this[_0xbaf1('0x40')](_0x2a827d['text'],'in');this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x12f'),_0x2a827d[_0xbaf1('0x69')]));var _0x15ea52=this[_0xbaf1('0x98')]['sync'](this,_0x2a827d);if(_0x15ea52){for(var _0x36a36a in _0x15ea52){if(_0x15ea52[_0xbaf1('0xa4')](_0x36a36a)&&_[_0xbaf1('0xa0')](_0x15ea52[_0x36a36a])){this['channel'][_0xbaf1('0xaf')](util[_0xbaf1('0x62')](_0xbaf1('0x130'),_0x36a36a[_0xbaf1('0x77')]()),_0x15ea52[_0x36a36a]);}}if(_[_0xbaf1('0x46')](_0x15ea52[_0xbaf1('0x84')])){return this[_0xbaf1('0x11')]['noop'](_0xbaf1('0x131'));}else{this['createSquareMessage'](_0x15ea52[_0xbaf1('0x84')],'out');return this[_0xbaf1('0x11')]['noop'](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x15ea52[_0xbaf1('0x84')]));}}return this[_0xbaf1('0x11')]['error'](_0x2a827d,_0xbaf1('0x132'));};AGIVertices['prototype'][_0xbaf1('0x133')]=function(_0x1d88d6){logger['info'](util[_0xbaf1('0x62')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x1d88d6['label'],_0x1d88d6[_0xbaf1('0x74')]));if(!this[_0xbaf1('0x90')](_0x1d88d6['key'])){return this[_0xbaf1('0x11')]['noop'](_0xbaf1('0xf7'));}var _0x4a92d9=_0xbaf1('0x134');var _0x4d7bc1=util[_0xbaf1('0x62')]('%s/recordings/%s',FILES_PATH,rs[_0xbaf1('0x11f')](0x4));var _0x143bc4=util[_0xbaf1('0x62')](_0xbaf1('0xa8'),_0x4d7bc1,_0x4a92d9);var _0x18ed2a=!![];if(_0x1d88d6[_0xbaf1('0x135')]===_0xbaf1('0x136')){_0x18ed2a=![];}var _0x5d5ac7=this[_0xbaf1('0x11')][_0xbaf1('0x137')](_0x4d7bc1,_0x4a92d9,_0x1d88d6[_0xbaf1('0x138')],_0x1d88d6[_0xbaf1('0x74')],undefined,_0x18ed2a);if(_0x5d5ac7[_0xbaf1('0xae')]!==-0x1){this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format'](_0xbaf1('0x139'),_0x143bc4));var _0x17e158=this[_0xbaf1('0x9a')][_0xbaf1('0x7d')](this,_0x1d88d6,_0x143bc4);if(_0x17e158){for(var _0x25ea22 in _0x17e158){if(_0x17e158['hasOwnProperty'](_0x25ea22)){this[_0xbaf1('0x11')]['setVariable'](util['format'](_0xbaf1('0x13a'),_0x25ea22[_0xbaf1('0x77')]()),_0x17e158[_0x25ea22]);}}return this['channel'][_0xbaf1('0xb5')](util['format'](_0xbaf1('0x13b'),JSON[_0xbaf1('0x80')](_0x17e158)));}}return _0x5d5ac7;};AGIVertices[_0xbaf1('0x13')]['tildeasr']=function(_0x1fa1b3){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x13c'),_0x1fa1b3[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x1fa1b3[_0xbaf1('0x9d')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x13d'));}if(!this[_0xbaf1('0x90')](_0x1fa1b3[_0xbaf1('0x9e')])){return this[_0xbaf1('0x11')]['noop']('no\x20appsecret\x20configured');}var _0x20de3c=_0xbaf1('0x134');var _0x561a4b=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x1e5a83=util['format']('%s.%s',_0x561a4b,_0x20de3c);var _0x142993=!![];if(_0x1fa1b3['beep']===_0xbaf1('0x136')){_0x142993=![];}var _0x38fa8a=this[_0xbaf1('0x11')][_0xbaf1('0x137')](_0x561a4b,_0x20de3c,_0x1fa1b3[_0xbaf1('0x138')],_0x1fa1b3[_0xbaf1('0x74')],undefined,_0x142993);if(_0x38fa8a[_0xbaf1('0xae')]!==-0x1){this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format']('tilde\x20%s\x20file\x20created',_0x1e5a83));var _0x28a0c3=this[_0xbaf1('0x9c')][_0xbaf1('0x7d')](this,_0x1fa1b3,_0x1e5a83);if(_0x28a0c3){for(var _0x141bd8 in _0x28a0c3){if(_0x28a0c3[_0xbaf1('0xa4')](_0x141bd8)){this['channel'][_0xbaf1('0xaf')](util['format']('TILDE_ASR_%s',_0x141bd8['toUpperCase']()),_0x28a0c3[_0x141bd8]);}}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format'](_0xbaf1('0x13e'),JSON[_0xbaf1('0x80')](_0x28a0c3)));}}return _0x38fa8a;};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x13f')]=function(_0x3d189a){logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0x140'),_0x3d189a[_0xbaf1('0xb4')]));return this[_0xbaf1('0x11')]['continueAt'](_0x3d189a[_0xbaf1('0x141')],_0x3d189a[_0xbaf1('0x3d')],_0x3d189a[_0xbaf1('0x3e')]);};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x142')]=function(_0x2ac4f2){logger['info'](util['format'](_0xbaf1('0x143'),_0x2ac4f2[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x2ac4f2[_0xbaf1('0x144')])){return this[_0xbaf1('0x11')]['error'](_0x2ac4f2,'no\x20condition\x20configured');}try{var _0x5ea699=eval(_0x2ac4f2[_0xbaf1('0x144')])?_0xbaf1('0x145'):_0xbaf1('0x146');this[_0xbaf1('0x11')]['noop'](util[_0xbaf1('0x62')]('EVAL\x20CONDITION\x20%s\x20%s',_0x2ac4f2[_0xbaf1('0x144')],_0x5ea699));return{'code':0xc8,'result':_0x5ea699};}catch(_0xf04120){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x1d8053){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x1d8053[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x1d8053['interval_id'])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x1d8053,_0xbaf1('0x147'));}var _0x501874=this[_0xbaf1('0x27')][_0xbaf1('0x7d')](this,_0x1d8053['interval_id']);if(!_0x501874){return this['channel'][_0xbaf1('0x2f')](_0x1d8053,_0xbaf1('0x148'));}for(var _0x442df1=0x0;_0x442df1<_0x501874[_0xbaf1('0xa6')];_0x442df1+=0x1){var _0x49acc8=this[_0xbaf1('0x11')][_0xbaf1('0x149')](util['format'](_0xbaf1('0x14a'),_0x501874[_0x442df1]));if(_0x49acc8[_0xbaf1('0xae')]===-0x1){return _0x49acc8;}logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('IFTIME\x20%s\x20%s',_0x501874[_0x442df1],_0x49acc8[_0xbaf1('0xab')]));if(_0x49acc8[_0xbaf1('0xab')]===_0xbaf1('0x145')){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x14b'),_0x501874[_0x442df1],_0xbaf1('0x145')));this[_0xbaf1('0x11')]['noop'](util['format']('IFTIME\x20%s\x20%s',_0x501874[_0x442df1],_0xbaf1('0x145')));return{'code':0xc8,'result':_0xbaf1('0x145')};}else{logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x14b'),_0x501874[_0x442df1],_0xbaf1('0x146')));this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x14b'),_0x501874[_0x442df1],'false'));}}return{'code':0xc8,'result':_0xbaf1('0x146')};};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x14c')]=function(_0x243fe4){logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0x14d'),_0x243fe4[_0xbaf1('0xb4')]));return this[_0xbaf1('0x11')][_0xbaf1('0x14c')]();};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x14e')]=function(_0x2a2789){logger[_0xbaf1('0x31')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x2a2789[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x2a2789[_0xbaf1('0x88')])){return this['channel'][_0xbaf1('0xb5')]('no\x20key\x20configured');}var _0x201745=_0xbaf1('0x134');var _0x339779=util[_0xbaf1('0x62')]('%s/recordings/%s',FILES_PATH,rs[_0xbaf1('0x11f')](0x4));var _0xab3e66=util[_0xbaf1('0x62')](_0xbaf1('0xa8'),_0x339779,_0x201745);var _0x9e39b1=!![];if(_0x2a2789[_0xbaf1('0x135')]==='NOBEEP'){_0x9e39b1=![];}var _0x22991e=this[_0xbaf1('0x11')]['recordFile'](_0x339779,_0x201745,_0x2a2789[_0xbaf1('0x138')],_0x2a2789[_0xbaf1('0x74')],undefined,_0x9e39b1);if(_0x22991e[_0xbaf1('0xae')]!==-0x1){this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format'](_0xbaf1('0x14f'),_0xab3e66));var _0x3cc2ca=this[_0xbaf1('0x8e')][_0xbaf1('0x7d')](this,_0x2a2789,_0xab3e66);if(_0x3cc2ca){for(var _0x498e47 in _0x3cc2ca){if(_0x3cc2ca[_0xbaf1('0xa4')](_0x498e47)){this[_0xbaf1('0x11')][_0xbaf1('0xaf')](util['format']('ISPEECH_ASR_%s',_0x498e47[_0xbaf1('0x77')]()),_0x3cc2ca[_0x498e47]);}}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x150'),JSON['stringify'](_0x3cc2ca)));}}return _0x22991e;};AGIVertices[_0xbaf1('0x13')]['ispeechtts']=function(_0x3bfa30){logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0x151'),_0x3bfa30[_0xbaf1('0xb4')]));if(!this['isConfigured'](_0x3bfa30[_0xbaf1('0x88')])){return this[_0xbaf1('0x11')]['noop'](_0xbaf1('0xf7'));}if(!this[_0xbaf1('0x90')](_0x3bfa30['text'])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')]('no\x20text\x20configured');}this['channel'][_0xbaf1('0xb5')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x3bfa30['text']));var _0x3f8a5c=this['ispeechTTS'][_0xbaf1('0x7d')](this,_0x3bfa30);if(_0x3f8a5c){this['channel'][_0xbaf1('0xb5')](util[_0xbaf1('0x62')]('ispeech\x20%s\x20file\x20created',_0x3f8a5c));var _0x311550=this[_0xbaf1('0x11')]['streamFile'](_0x3f8a5c,_0x3bfa30[_0xbaf1('0x138')]);try{fs['unlink'](_0x3f8a5c+_0xbaf1('0x10a'));}catch(_0x13496){logger[_0xbaf1('0x2f')](_0x13496);}return _0x311550;}return this['channel']['error'](_0x3bfa30,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x152')]=function(_0xcc0626){logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x153'),_0xcc0626[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0xcc0626[_0xbaf1('0x154')])){return this['channel'][_0xbaf1('0x2f')](_0xcc0626,_0xbaf1('0x155'));}logger[_0xbaf1('0x31')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbaf1('0x11')][_0xbaf1('0x3a')],_0xcc0626[_0xbaf1('0x154')]));var _0x1463bc=this[_0xbaf1('0x60')][_0xbaf1('0x7d')](this,_0xcc0626[_0xbaf1('0x154')]);if(_0x1463bc){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbaf1('0x11')]['callerid'],_0xcc0626[_0xbaf1('0x154')]));this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x156'),this['channel'][_0xbaf1('0x3a')],_0xcc0626[_0xbaf1('0x154')]));return{'code':0xc8,'result':_0xbaf1('0x157')};}else{logger['info'](util['format'](_0xbaf1('0x158'),this['channel'][_0xbaf1('0x3a')],_0xcc0626[_0xbaf1('0x154')]));this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x158'),this[_0xbaf1('0x11')]['callerid'],_0xcc0626[_0xbaf1('0x154')]));return{'code':0xc8,'result':_0xbaf1('0x159')};}};AGIVertices[_0xbaf1('0x13')]['logout']=function(_0x5add34){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x15a'),_0x5add34['label']));if(!this[_0xbaf1('0x90')](_0x5add34[_0xbaf1('0x154')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x5add34,_0xbaf1('0x155'));}logger['info'](util['format'](_0xbaf1('0x15b'),this[_0xbaf1('0x11')][_0xbaf1('0x3a')],_0x5add34['findBy']));var _0x5f39fb=this[_0xbaf1('0x5f')][_0xbaf1('0x7d')](this,_0x5add34[_0xbaf1('0x154')]);if(_0x5f39fb){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbaf1('0x11')][_0xbaf1('0x3a')],_0x5add34[_0xbaf1('0x154')]));this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x156'),this['channel'][_0xbaf1('0x3a')],_0x5add34[_0xbaf1('0x154')]));return{'code':0xc8,'result':_0xbaf1('0x157')};}else{logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x158'),this[_0xbaf1('0x11')][_0xbaf1('0x3a')],_0x5add34[_0xbaf1('0x154')]));this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x158'),this[_0xbaf1('0x11')][_0xbaf1('0x3a')],_0x5add34[_0xbaf1('0x154')]));return{'code':0xc8,'result':_0xbaf1('0x159')};}};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x15c')]=function(_0x3d715c){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3d715c[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x3d715c[_0xbaf1('0x15d')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x3d715c,_0xbaf1('0x15e'));}this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format']('math\x20%s',_0x3d715c['operation']));var _0x543dec=eval(_0x3d715c[_0xbaf1('0x15d')]);if(!this[_0xbaf1('0x90')](_0x3d715c[_0xbaf1('0xe6')])){return this['channel'][_0xbaf1('0xb5')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x105e0c=this['getVariable'][_0xbaf1('0x7d')](this,_0x3d715c['variable_id']);if(!_0x105e0c){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x3d715c,_0xbaf1('0xe7'));}if(_['isArray'](_0x543dec)){var _0x341087=this;_0x543dec[_0xbaf1('0xe8')](function(_0x25ec34,_0x541fb3){_0x341087[_0xbaf1('0x11')][_0xbaf1('0xaf')](util[_0xbaf1('0x62')](_0xbaf1('0x15f'),_0x105e0c,_0x541fb3),_0x25ec34);});return this['channel'][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x160'),_0x105e0c));}else{return this[_0xbaf1('0x11')][_0xbaf1('0xaf')](_0x105e0c,_0x543dec);}};AGIVertices['prototype'][_0xbaf1('0xf')]=function(_0x383100){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x161'),_0x383100[_0xbaf1('0xb4')]));if(_0x383100[_0xbaf1('0xb1')]===0x0){return this[_0xbaf1('0xb0')](_0x383100);}_0x383100[_0xbaf1('0xb1')]-=0x1;if(!this['isConfigured'](_0x383100[_0xbaf1('0x118')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x383100,_0xbaf1('0x119'));}var _0x29db72=this[_0xbaf1('0x20')][_0xbaf1('0x7d')](this,_0x383100[_0xbaf1('0x118')]);if(!_0x29db72){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x383100,_0xbaf1('0x11a'));}var _0xeed927=this['channel'][_0xbaf1('0x11b')](_0x29db72,_0x383100[_0xbaf1('0x11c')],_0x383100[_0xbaf1('0x162')]);var _0x28f25a=_0xeed927[_0xbaf1('0xae')];if(_0xeed927['result']===-0x1){this[_0xbaf1('0x36')][_0xbaf1('0x7d')](this,_0x383100,'-1');return _0xeed927;}else if(_0xeed927[_0xbaf1('0xab')]===_0xbaf1('0x74')){_0xeed927['result']=_0xeed927[_0xbaf1('0xae')][_0xbaf1('0xa6')]>0x0?_0xeed927[_0xbaf1('0xae')]:'t';}else if(_[_0xbaf1('0x45')](_0xeed927[_0xbaf1('0xae')])){_0xeed927[_0xbaf1('0xae')]='#';_0x28f25a='#';}if(!this[_0xbaf1('0x90')](_0x383100[_0xbaf1('0xe6')])){this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x2bae17=this[_0xbaf1('0x149')]['sync'](this,_0x383100[_0xbaf1('0xe6')]);if(!_0x2bae17){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x383100,_0xbaf1('0xe7'));}this[_0xbaf1('0x11')]['setVariable'](_0x2bae17,_0x28f25a);}this[_0xbaf1('0x36')][_0xbaf1('0x7d')](this,_0x383100,_0x28f25a);return _0xeed927;};AGIVertices['prototype'][_0xbaf1('0xb5')]=function(_0x153ceb){logger[_0xbaf1('0x31')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x153ceb[_0xbaf1('0xb4')]));return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0x153ceb[_0xbaf1('0x163')]||_0x153ceb[_0xbaf1('0xb4')]);};AGIVertices[_0xbaf1('0x13')]['pause']=function(_0x2cbddf){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x2cbddf['label']));if(!this[_0xbaf1('0x90')](_0x2cbddf[_0xbaf1('0x154')])){return this[_0xbaf1('0x11')]['error'](_0x2cbddf,_0xbaf1('0x155'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbaf1('0x11')][_0xbaf1('0x3a')],_0x2cbddf['findBy']));var _0x2d8a67=this[_0xbaf1('0x5a')][_0xbaf1('0x7d')](this,_0x2cbddf[_0xbaf1('0x164')]);var _0x1a33cd=this['agentPause'][_0xbaf1('0x7d')](this,_0x2cbddf[_0xbaf1('0x154')],_0x2d8a67);if(_0x1a33cd){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x156'),this[_0xbaf1('0x11')]['callerid'],_0x2cbddf[_0xbaf1('0x154')]));this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x156'),this[_0xbaf1('0x11')][_0xbaf1('0x3a')],_0x2cbddf[_0xbaf1('0x154')]));return{'code':0xc8,'result':_0xbaf1('0x157')};}else{logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x158'),this[_0xbaf1('0x11')]['callerid'],_0x2cbddf[_0xbaf1('0x154')]));this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbaf1('0x11')]['callerid'],_0x2cbddf['findBy']));return{'code':0xc8,'result':_0xbaf1('0x159')};}};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x165')]=function(_0x569777){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x166'),_0x569777['label']));if(!this[_0xbaf1('0x90')](_0x569777['file_id'])){return this['channel']['error'](_0x569777,_0xbaf1('0x119'));}var _0x28280e=this['getSound'][_0xbaf1('0x7d')](this,_0x569777['file_id']);if(!_0x28280e){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x569777,'no\x20file\x20audio\x20found');}var _0x567560=this[_0xbaf1('0x11')][_0xbaf1('0x65')]('PLAYBACK',[_0x28280e,_0x569777[_0xbaf1('0xf4')]]);if(_0x567560[_0xbaf1('0xae')]===-0x1){return _0x567560;}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')]('Executed\x20command\x20%s\x20%s',_0xbaf1('0x167'),_0x28280e));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x168')]=function(_0x2ff53e){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x2ff53e[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x2ff53e[_0xbaf1('0x169')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x2ff53e,_0xbaf1('0x16a'));}var _0x1223c1='';var _0x8aa492=parseInt(_0x2ff53e[_0xbaf1('0x169')],0xa);if(isNaN(_0x8aa492)){_0x1223c1=_0x2ff53e['queue_id'];}else{_0x1223c1=this[_0xbaf1('0x16')][_0xbaf1('0x7d')](this,_0x2ff53e[_0xbaf1('0x169')]);if(!_0x1223c1){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x2ff53e,_0xbaf1('0x16b'));}}var _0x22ec2e='';if(this[_0xbaf1('0x90')](_0x2ff53e[_0xbaf1('0x118')])){var _0x58877c=this[_0xbaf1('0x20')][_0xbaf1('0x7d')](this,_0x2ff53e[_0xbaf1('0x118')]);if(_0x58877c){_0x22ec2e=_0x58877c;}}this[_0xbaf1('0x36')][_0xbaf1('0x7d')](this,_0x2ff53e,_0x1223c1);if(_0x2ff53e[_0xbaf1('0xf4')][_0xbaf1('0x16c')]('x')<0x0){_0x2ff53e[_0xbaf1('0xf4')]+='x';}if(_0x2ff53e[_0xbaf1('0xf4')]['indexOf']('X')<0x0){_0x2ff53e[_0xbaf1('0xf4')]+='X';}this[_0xbaf1('0x11')][_0xbaf1('0xaf')]('XMCS-QUEUE',_0x1223c1?_0x1223c1[_0xbaf1('0x16d')]():'');var _0x5dbf69=this[_0xbaf1('0x11')][_0xbaf1('0x65')](_0xbaf1('0x16e'),[_0x1223c1,_0x2ff53e['opts'],_0x2ff53e[_0xbaf1('0x71')],_0x22ec2e,_0x2ff53e[_0xbaf1('0x74')],_0x2ff53e['agi'],_0x2ff53e[_0xbaf1('0x16f')],_0x2ff53e[_0xbaf1('0x170')],'',_0x2ff53e['position']]);if(_0x5dbf69[_0xbaf1('0xae')]===-0x1){return _0x5dbf69;}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format'](_0xbaf1('0xcf'),_0xbaf1('0x16e'),_0x1223c1));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x171')]=function(_0x3ce165){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x172'),_0x3ce165[_0xbaf1('0xb4')]));var _0x1fec24=_0x3ce165[_0xbaf1('0x173')]||_0xbaf1('0x134');var _0xb71c64=util['format'](_0xbaf1('0x174'),this['channel'][_0xbaf1('0x37')],rs[_0xbaf1('0x11f')](0x5));var _0x415b52=util[_0xbaf1('0x62')](_0xbaf1('0x175'),FILES_PATH,_0xb71c64,_0x1fec24);var _0x428bcc=util[_0xbaf1('0x62')]('%s/recordings/%s',FILES_PATH,_0xb71c64);this['createSquareRecording'][_0xbaf1('0x7d')](this,_0x3ce165,_0xb71c64,_0x415b52);this[_0xbaf1('0x11')][_0xbaf1('0xaf')](_0xbaf1('0x176'),_0xb71c64);logger[_0xbaf1('0x31')](_0xbaf1('0x177'),_0x428bcc,_0x1fec24,_0x3ce165[_0xbaf1('0x178')],_0x3ce165[_0xbaf1('0x74')]);return this['channel']['recordFile'](_0x428bcc,_0x1fec24,_0x3ce165[_0xbaf1('0x178')],_0x3ce165[_0xbaf1('0x74')],undefined,!![]);};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x179')]=function(_0x64b0c6){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x17a'),_0x64b0c6[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x64b0c6['url'])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x17b'));}var _0x421fc0=this[_0xbaf1('0x17c')][_0xbaf1('0x7d')](this,_0x64b0c6);logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')]('Response:',util['inspect'](_0x421fc0,{'showHidden':![],'depth':null})));if(!this[_0xbaf1('0x90')](_0x64b0c6[_0xbaf1('0xe6')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x6e00fa=this[_0xbaf1('0x149')]['sync'](this,_0x64b0c6[_0xbaf1('0xe6')]);if(!_0x6e00fa){return this[_0xbaf1('0x11')]['error'](_0x64b0c6,_0xbaf1('0xe7'));}this['channel'][_0xbaf1('0xaf')](util[_0xbaf1('0x62')]('%s_STATUS_CODE',_0x6e00fa),_0x421fc0[_0xbaf1('0x82')]?_0x421fc0[_0xbaf1('0x82')]:_0xbaf1('0x17d'));this[_0xbaf1('0x11')]['setVariable'](util[_0xbaf1('0x62')](_0xbaf1('0x17e'),_0x6e00fa),_0x421fc0[_0xbaf1('0x83')]?_0x421fc0['statusMessage']:'OK');if(_0x421fc0[_0xbaf1('0x78')]){try{this[_0xbaf1('0xa7')](_0x421fc0[_0xbaf1('0x78')],_0x6e00fa);}catch(_0x38d5fa){logger['error'](util[_0xbaf1('0x62')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x6e00fa));}}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util['format'](_0xbaf1('0xeb'),_0x6e00fa));};AGIVertices[_0xbaf1('0x13')]['saydigits']=function(_0x29c482){logger['info'](util[_0xbaf1('0x62')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x29c482['label']));return this[_0xbaf1('0x11')]['sayDigits'](_0x29c482[_0xbaf1('0x17f')][_0xbaf1('0xe3')](/\s+/g,''),_0x29c482[_0xbaf1('0x178')]);};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x180')]=function(_0x2cd7c9){logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x181'),_0x2cd7c9['label']));return this['channel'][_0xbaf1('0x182')](_0x2cd7c9['number']['replace'](/\s+/g,''),_0x2cd7c9['escape_digits']);};AGIVertices['prototype'][_0xbaf1('0x183')]=function(_0x219d7b){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x184'),_0x219d7b[_0xbaf1('0xb4')]));return this[_0xbaf1('0x11')][_0xbaf1('0x185')](_0x219d7b['text'],_0x219d7b['escape_digits']);};AGIVertices['prototype'][_0xbaf1('0x186')]=function(_0x3cdf9e){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x187'),_0x3cdf9e[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x3cdf9e['account_id'])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x188'));}var _0x444576=this[_0xbaf1('0x24')][_0xbaf1('0x7d')](this,_0x3cdf9e['account_id']);if(!_0x444576||!_0x444576[_0xbaf1('0x189')]){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x3cdf9e,_0xbaf1('0x18a'));}var _0x5a1ef={'from':util[_0xbaf1('0x62')]('\x22%s\x22\x20<%s>',_0x444576[_0xbaf1('0x18')],_0x444576[_0xbaf1('0x18b')]||_0x444576[_0xbaf1('0x189')]['user']),'to':_0x3cdf9e['to']||'','cc':_0x3cdf9e['cc']||'','bcc':_0x3cdf9e[_0xbaf1('0x18c')]||'','subject':_0x3cdf9e[_0xbaf1('0x18d')],'html':_0x3cdf9e[_0xbaf1('0x69')],'text':_0x3cdf9e['text']};var _0x45d933={'tls':{'rejectUnauthorized':![]}};if(_0x444576[_0xbaf1('0x189')][_0xbaf1('0x18e')]){_0x45d933[_0xbaf1('0x18e')]=_0x444576[_0xbaf1('0x189')][_0xbaf1('0x18e')];}else{_0x45d933[_0xbaf1('0x18f')]=_0x444576[_0xbaf1('0x189')][_0xbaf1('0x18f')];_0x45d933[_0xbaf1('0x190')]=_0x444576['Smtp']['port'];_0x45d933[_0xbaf1('0x191')]=_0x444576['Smtp'][_0xbaf1('0x191')];}if(_0x444576['Smtp'][_0xbaf1('0x192')]){_0x45d933[_0xbaf1('0x193')]={'user':_0x444576[_0xbaf1('0x189')]['user'],'pass':_0x444576[_0xbaf1('0x189')][_0xbaf1('0x194')]};}if(this['isConfigured'](_0x3cdf9e['template_id'])){}logger[_0xbaf1('0xed')](_0xbaf1('0x195'),JSON['stringify'](_0x5a1ef));this['createSquareDetailsReport']['sync'](this,_0x3cdf9e,_0x3cdf9e[_0xbaf1('0x196')]);this['channel'][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x197'),_0x444576[_0xbaf1('0x18')]));this[_0xbaf1('0x26')][_0xbaf1('0x7d')](this,_0x45d933,_0x5a1ef);return this['channel']['noop'](_0xbaf1('0x198'));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x199')]=function(_0x503d36){logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x19a'),_0x503d36['label']));return this['channel'][_0xbaf1('0xb5')](_0xbaf1('0x19b'));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x19c')]=function(_0x346d5e){logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0x19d'),_0x346d5e[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x346d5e[_0xbaf1('0x19e')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')]('no\x20sms\x20account\x20configured');}var _0x246534=this[_0xbaf1('0x19f')][_0xbaf1('0x7d')](this,_0x346d5e[_0xbaf1('0x19e')]);if(!_0x246534){return this['channel'][_0xbaf1('0x2f')](_0x346d5e,_0xbaf1('0x1a0'));}var _0x3fe7cb={'body':_0x346d5e['sms_text'],'phone':_0x346d5e['to']||'','SmsAccountId':_0x246534['id']};logger[_0xbaf1('0xed')](_0xbaf1('0x1a1'),JSON[_0xbaf1('0x80')](_0x3fe7cb));this[_0xbaf1('0x36')][_0xbaf1('0x7d')](this,_0x346d5e,_0x346d5e['sms_account_id']);this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x1a2'),_0x246534[_0xbaf1('0x18')]));this['createSmsMessage'][_0xbaf1('0x7d')](this,_0x3fe7cb);return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x1a3'));};AGIVertices[_0xbaf1('0x13')]['set']=function(_0x4d2db1){logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x1a4'),_0x4d2db1[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x4d2db1[_0xbaf1('0xe6')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x4d2db1,_0xbaf1('0x1a5'));}var _0xbea0bc=this[_0xbaf1('0x149')][_0xbaf1('0x7d')](this,_0x4d2db1['variable_id']);if(!_0xbea0bc){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x4d2db1,_0xbaf1('0xe7'));}return this[_0xbaf1('0x11')][_0xbaf1('0xaf')](_0xbea0bc,_0x4d2db1[_0xbaf1('0x1a6')]);};AGIVertices['prototype'][_0xbaf1('0x1a7')]=function(_0x3037ab){logger['info'](util['format'](_0xbaf1('0x1a8'),_0x3037ab[_0xbaf1('0xb4')]));this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x1a9'));if(_0x3037ab[_0xbaf1('0xc3')]===_0xbaf1('0x1aa')){this[_0xbaf1('0x11')]['noop'](_0xbaf1('0x1ab'));return this[_0xbaf1('0x11')][_0xbaf1('0xc3')]();}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x1ac'));};AGIVertices[_0xbaf1('0x13')]['subproject']=function(_0x2b8358){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x1ad'),_0x2b8358['label']));if(!this[_0xbaf1('0x90')](_0x2b8358[_0xbaf1('0x1ae')])){return this[_0xbaf1('0x11')]['error'](_0x2b8358,_0xbaf1('0x1af'));}var _0x59af1c=this[_0xbaf1('0x1a')][_0xbaf1('0x7d')](this,_0x2b8358[_0xbaf1('0x1ae')]);if(!this[_0xbaf1('0x90')](_0x59af1c)){return this['channel'][_0xbaf1('0x2f')](_0x2b8358,util['format'](_0xbaf1('0x1b0'),_0x2b8358[_0xbaf1('0x1ae')]));}if(_0x59af1c===this[_0xbaf1('0x11')][_0xbaf1('0x39')]){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x2b8358,_0xbaf1('0x1b1'));}this[_0xbaf1('0x36')][_0xbaf1('0x7d')](this,_0x2b8358,_0x59af1c);var _0x2cea72=this['channel'][_0xbaf1('0x65')](_0xbaf1('0x1b2'),util['format'](_0xbaf1('0x1b3'),config[_0xbaf1('0xa')][_0xbaf1('0x18f')]||_0xbaf1('0x1b4'),_0x59af1c,this['channel'][_0xbaf1('0x39')]));if(_0x2cea72[_0xbaf1('0xae')]===-0x1){return _0x2cea72;}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0xcf'),_0xbaf1('0x1b2'),_0x59af1c));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x1b5')]=function(_0x3cc3bc){logger[_0xbaf1('0x31')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3cc3bc[_0xbaf1('0xb4')]));var _0x3c372b=this[_0xbaf1('0x64')][_0xbaf1('0x7d')](this,_0x3cc3bc[_0xbaf1('0xc1')]);this['createSquareDetailsReport'][_0xbaf1('0x7d')](this,_0x3cc3bc,_0x3cc3bc[_0xbaf1('0xc1')]);if(this[_0xbaf1('0x90')](_0x3cc3bc[_0xbaf1('0xe6')])){var _0x2ffb46=this[_0xbaf1('0x149')][_0xbaf1('0x7d')](this,_0x3cc3bc[_0xbaf1('0xe6')]);if(_0x2ffb46){this[_0xbaf1('0x11')][_0xbaf1('0xaf')](_0x2ffb46,_0x3c372b);return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x1b6'),_0x3cc3bc[_0xbaf1('0xc1')],_0x2ffb46));}}return this['channel'][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x1b7'),_0x3cc3bc[_0xbaf1('0xc1')]));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x1b8')]=function(_0x40d9f5){logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x1b9'),_0x40d9f5['label']));_0x40d9f5[_0xbaf1('0x69')]=_0x40d9f5[_0xbaf1('0x69')][_0xbaf1('0xe3')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbaf1('0x90')](_0x40d9f5['apiKey'])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0x1ba'));}if(!this[_0xbaf1('0x90')](_0x40d9f5[_0xbaf1('0x69')])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0xb6'));}this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x40d9f5['text']));var _0x13293d=this[_0xbaf1('0x67')]['sync'](this,_0x40d9f5);if(_0x13293d){this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x1bb'),_0x13293d));var _0x52168b=this[_0xbaf1('0x11')][_0xbaf1('0x108')](_0x13293d);try{fs[_0xbaf1('0x109')](_0x13293d+_0xbaf1('0x10a'));}catch(_0x41af1c){logger[_0xbaf1('0x2f')](_0x41af1c);}return _0x52168b;}return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x40d9f5,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x1bc')]=function(_0x290931){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x1bd'),_0x290931[_0xbaf1('0xb4')]));_0x290931[_0xbaf1('0x69')]=_0x290931[_0xbaf1('0x69')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbaf1('0x90')](_0x290931['text'])){return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](_0xbaf1('0xb6'));}this['channel'][_0xbaf1('0xb5')](util['format'](_0xbaf1('0x1be'),_0x290931['text']));var _0x3d327a=this[_0xbaf1('0x6f')][_0xbaf1('0x7d')](this,_0x290931);if(_0x3d327a){this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')](_0xbaf1('0x1bf'),_0x3d327a));var _0x486e28=this[_0xbaf1('0x11')][_0xbaf1('0x108')](_0x3d327a);try{fs[_0xbaf1('0x109')](_0x3d327a+_0xbaf1('0x10a'));}catch(_0x284c1e){logger[_0xbaf1('0x2f')](_0x284c1e);}return _0x486e28;}return this['channel'][_0xbaf1('0x2f')](_0x290931,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x1c0')]=function(_0x4cf7d9){logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x1c1'),_0x4cf7d9[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x4cf7d9[_0xbaf1('0x154')])){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x4cf7d9,_0xbaf1('0x155'));}logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x15b'),this['channel']['callerid'],_0x4cf7d9[_0xbaf1('0x154')]));var _0x46b6af=this['agentUnpause']['sync'](this,_0x4cf7d9['findBy']);if(_0x46b6af){logger[_0xbaf1('0x31')](util['format'](_0xbaf1('0x156'),this[_0xbaf1('0x11')][_0xbaf1('0x3a')],_0x4cf7d9[_0xbaf1('0x154')]));this[_0xbaf1('0x11')]['noop'](util['format'](_0xbaf1('0x156'),this['channel'][_0xbaf1('0x3a')],_0x4cf7d9[_0xbaf1('0x154')]));return{'code':0xc8,'result':_0xbaf1('0x157')};}else{logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0x158'),this[_0xbaf1('0x11')]['callerid'],_0x4cf7d9[_0xbaf1('0x154')]));this['channel'][_0xbaf1('0xb5')](util[_0xbaf1('0x62')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbaf1('0x11')][_0xbaf1('0x3a')],_0x4cf7d9[_0xbaf1('0x154')]));return{'code':0xc8,'result':_0xbaf1('0x159')};}};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x1c2')]=function(_0x390cbb){logger['info'](util[_0xbaf1('0x62')](_0xbaf1('0x1c3'),_0x390cbb['label']));var _0x4f19aa=this['channel'][_0xbaf1('0x65')]('VOICEMAIL',[_0x390cbb[_0xbaf1('0x1c4')],_0x390cbb[_0xbaf1('0x86')]]);if(_0x4f19aa[_0xbaf1('0xae')]===-0x1){return _0x4f19aa;}return this[_0xbaf1('0x11')][_0xbaf1('0xb5')](util[_0xbaf1('0x62')]('Executed\x20command\x20%s\x20%s',_0xbaf1('0x1c5'),_0x390cbb['mailbox']));};AGIVertices[_0xbaf1('0x13')][_0xbaf1('0x1c6')]=function(_0x36c543){logger[_0xbaf1('0x31')](util[_0xbaf1('0x62')](_0xbaf1('0x1c7'),_0x36c543[_0xbaf1('0xb4')]));if(!this[_0xbaf1('0x90')](_0x36c543['variable_id'])){return this['channel'][_0xbaf1('0x2f')](_0x36c543,_0xbaf1('0x1a5'));}var _0x53c4ee=this[_0xbaf1('0x149')][_0xbaf1('0x7d')](this,_0x36c543[_0xbaf1('0xe6')]);if(!_0x53c4ee){return this[_0xbaf1('0x11')][_0xbaf1('0x2f')](_0x36c543,'no\x20variable\x20found');}var _0x112118=this[_0xbaf1('0x11')][_0xbaf1('0x149')](_0x53c4ee);return{'code':0xc8,'result':_0x112118[_0xbaf1('0xab')]?_0x112118[_0xbaf1('0xab')]:'-'};};String[_0xbaf1('0x13')]['replaceAll']=function(_0xed7abf,_0x249af1){return this[_0xbaf1('0xa9')](_0xed7abf)[_0xbaf1('0x1c8')](_0x249af1);};module[_0xbaf1('0x1c9')]=AGIVertices;
\ No newline at end of file
diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js
index 2fa1dd4..9f817f3 100644
--- a/server/services/ami/acw/index.js
+++ b/server/services/ami/acw/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ef6=['milliseconds','diff','seconds','prototype','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','info','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview'];(function(_0x515232,_0x3de920){var _0x45685c=function(_0x25bae8){while(--_0x25bae8){_0x515232['push'](_0x515232['shift']());}};_0x45685c(++_0x3de920);}(_0x8ef6,0xf2));var _0x68ef=function(_0x590c94,_0x47b74b){_0x590c94=_0x590c94-0x0;var _0x1734f2=_0x8ef6[_0x590c94];return _0x1734f2;};'use strict';var util=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var ami=require(_0x68ef('0x3'));var logger=require(_0x68ef('0x4'))(_0x68ef('0x5'));var RpcUser=require(_0x68ef('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x27d0af){this[_0x68ef('0x7')]=_0x27d0af[_0x68ef('0x7')];this[_0x68ef('0x8')]=_0x27d0af['agents'];this['timers']=_0x27d0af[_0x68ef('0x9')];this[_0x68ef('0xa')]={};ami['on'](_0x68ef('0xb'),this['syncAgentConnect'][_0x68ef('0xc')](this));ami['on'](_0x68ef('0xd'),this[_0x68ef('0xe')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0xf'),this[_0x68ef('0x10')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0x11'),this[_0x68ef('0x12')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0x13'),this[_0x68ef('0x14')]['bind'](this));ami['on'](_0x68ef('0x15'),this[_0x68ef('0x16')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0x17'),this[_0x68ef('0x18')][_0x68ef('0xc')](this));}function getDiff(_0x508671){var _0x3b48dd=moment()[_0x68ef('0x19')](0x0);var _0x2657c5=moment(_0x508671)['milliseconds'](0x0);return _0x3b48dd[_0x68ef('0x1a')](_0x2657c5,_0x68ef('0x1b'));}Acw[_0x68ef('0x1c')]['startAcw']=function(_0x35493d){try{var _0x37c4cc=this;var _0x3d1e90=this[_0x68ef('0xa')][_0x35493d]['interface'];var _0x2ada1c=this['channels'][_0x35493d]['queue'];var _0x2633c1=this[_0x68ef('0x7')][_0x2ada1c];var _0x4ade0d=![];var _0x527870=_0x68ef('0x1d');if(_0x2633c1[_0x68ef('0x1e')]){if(_0x2633c1[_0x68ef('0x1f')]['name']){_0x4ade0d=!![];_0x527870=_0x2633c1[_0x68ef('0x1f')][_0x68ef('0x20')];}}ami[_0x68ef('0x21')]({'action':'QueuePause','interface':_0x3d1e90,'paused':!![],'reason':_0x527870})[_0x68ef('0x22')](function(_0x3be4c0){if(_0x37c4cc['agents'][_0x3d1e90]){return RpcUser[_0x68ef('0x23')](_0x37c4cc[_0x68ef('0x8')][_0x3d1e90]['id'])[_0x68ef('0x22')](function(_0x5ddec7){if(_0x5ddec7&&!_0x5ddec7['voicePause']){logger['info'](_0x68ef('0x24'),_0x35493d,_0x3d1e90,_0x2ada1c);var _0x2023f2=_0x37c4cc[_0x68ef('0xa')][_0x35493d][_0x68ef('0x25')]&&_0x37c4cc[_0x68ef('0xa')][_0x35493d][_0x68ef('0x26')]?_0x37c4cc[_0x68ef('0xa')][_0x35493d][_0x68ef('0x26')]:_0x35493d;return RpcUser[_0x68ef('0x27')](_0x37c4cc[_0x68ef('0x8')][_0x3d1e90],_0x527870,_0x2023f2)['then'](function(_0x178460){if(!_0x4ade0d){_0x37c4cc['timers'][_0x3d1e90]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x35493d,_0x37c4cc[_0x68ef('0x7')][_0x2ada1c][_0x68ef('0x28')],_0x3d1e90,_0x2ada1c);_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x29')]=setTimeout(_0x37c4cc['stopAcw']['bind'](_0x37c4cc,_0x3d1e90),_0x37c4cc[_0x68ef('0x7')][_0x2ada1c][_0x68ef('0x28')]*0x3e8);_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x2a')]=moment()[_0x68ef('0x2b')](_0x68ef('0x2c'));_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x2d')]=_0x35493d;_0x37c4cc['timers'][_0x3d1e90][_0x68ef('0x2e')]=_0x2ada1c;_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x2f')]=function(){var _0x4c25aa=getDiff(_0x37c4cc[_0x68ef('0x9')][_0x3d1e90]['lastPauseAt']);clearTimeout(_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x29')]);_0x37c4cc['timers'][_0x3d1e90]['timer']=![];RpcVoiceAgentReport[_0x68ef('0x30')]({'acwtime':_0x4c25aa},_0x37c4cc[_0x68ef('0x9')][_0x3d1e90]['uniqueid'],_0x3d1e90)[_0x68ef('0x22')](function(_0x8c0a06){logger[_0x68ef('0x31')](_0x68ef('0x32'),_0x35493d,_0x4c25aa,_0x8c0a06);})['catch'](function(_0x2c8bd0){logger[_0x68ef('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x35493d,_0x2c8bd0);});delete _0x37c4cc[_0x68ef('0x9')][_0x3d1e90];};}});}else{logger['info'](_0x68ef('0x34'),_0x35493d,_0x3d1e90,_0x2ada1c);}});}})[_0x68ef('0x35')](function(_0x4973c2){logger[_0x68ef('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x35493d,_0x37c4cc[_0x68ef('0x7')][_0x2ada1c]['acwTimeout'],_0x3d1e90,_0x2ada1c);})[_0x68ef('0x36')](function(){delete _0x37c4cc[_0x68ef('0xa')][_0x35493d];});}catch(_0x798276){logger['error'](_0x68ef('0x37'),_0x798276['message']);}};Acw[_0x68ef('0x1c')]['stopAcw']=function(_0x474ffa){try{var _0x362ef1=this;if(_0x362ef1[_0x68ef('0x9')][_0x474ffa]){_0x362ef1[_0x68ef('0x9')][_0x474ffa][_0x68ef('0x29')]=![];var _0xefd1d=_0x362ef1['timers'][_0x474ffa][_0x68ef('0x2d')];var _0x15a6ab=_0x362ef1[_0x68ef('0x9')][_0x474ffa]['queue'];var _0x32eddd=_0x362ef1[_0x68ef('0x7')][_0x15a6ab][_0x68ef('0x28')];logger['info']('[TIMER][STOP][AGENT:%s]',_0x474ffa);RpcUser[_0x68ef('0x38')](this[_0x68ef('0x8')][_0x474ffa]);RpcVoiceAgentReport[_0x68ef('0x30')]({'acwtime':_0x32eddd,'agentacw':!![]},_0xefd1d,_0x474ffa)[_0x68ef('0x22')](function(_0x401459){logger[_0x68ef('0x31')](_0x68ef('0x32'),_0xefd1d,_0x32eddd,_0x401459);})['catch'](function(_0xaf7df1){logger[_0x68ef('0x33')](_0x68ef('0x39'),_0xefd1d,_0xaf7df1);});}else{logger[_0x68ef('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x474ffa);if(_0x362ef1[_0x68ef('0x9')]){logger[_0x68ef('0x31')](_0x68ef('0x3a'),JSON[_0x68ef('0x3b')](_0x362ef1[_0x68ef('0x9')]));}}}catch(_0x3b00ea){logger['error'](_0x68ef('0x3c'),_0x3b00ea[_0x68ef('0x3d')]);}};Acw[_0x68ef('0x1c')][_0x68ef('0x3e')]=function(_0x449f3c){try{if(this[_0x68ef('0x7')][_0x449f3c[_0x68ef('0x2e')]]&&(this[_0x68ef('0x7')][_0x449f3c[_0x68ef('0x2e')]]['acw']||this[_0x68ef('0x7')][_0x449f3c[_0x68ef('0x2e')]][_0x68ef('0x1e')])){if(this[_0x68ef('0x8')][_0x449f3c[_0x68ef('0x3f')]]){this[_0x68ef('0xa')][_0x449f3c[_0x68ef('0x2d')]]={'queue':_0x449f3c['queue'],'interface':_0x449f3c[_0x68ef('0x3f')],'destlinkedid':_0x449f3c['destlinkedid']};}}}catch(_0x13c088){logger[_0x68ef('0x33')](_0x68ef('0x40'),_0x13c088[_0x68ef('0x3d')]);}};Acw['prototype'][_0x68ef('0x18')]=function(_0x5a8231){try{if(this[_0x68ef('0x7')][_0x5a8231['queue']]&&(this[_0x68ef('0x7')][_0x5a8231[_0x68ef('0x2e')]][_0x68ef('0x5')]||this['voiceQueues'][_0x5a8231['queue']][_0x68ef('0x1e')])){if(this[_0x68ef('0x8')][_0x5a8231['interface']]){this['channels'][_0x5a8231['uniqueid']]={'queue':_0x5a8231[_0x68ef('0x2e')],'interface':_0x5a8231[_0x68ef('0x3f')]};}}}catch(_0x173fb7){logger[_0x68ef('0x33')](_0x68ef('0x41'),_0x173fb7['message']);}};Acw['prototype'][_0x68ef('0xe')]=function(_0x21f064){try{if(this[_0x68ef('0xa')][_0x21f064[_0x68ef('0x2d')]]&&_['isUndefined'](this[_0x68ef('0xa')][_0x21f064[_0x68ef('0x2d')]][_0x68ef('0x25')])){logger[_0x68ef('0x31')]('[%s][HANGUP:UNIQUEID]',_0x21f064['uniqueid']);this[_0x68ef('0x42')](_0x21f064[_0x68ef('0x2d')]);}else if(this['channels'][_0x21f064[_0x68ef('0x43')]]&&_[_0x68ef('0x44')](this[_0x68ef('0xa')][_0x21f064[_0x68ef('0x43')]][_0x68ef('0x25')])){logger['info'](_0x68ef('0x45'),_0x21f064[_0x68ef('0x43')]);this[_0x68ef('0x42')](_0x21f064['linkedid']);}}catch(_0x8ef51b){logger[_0x68ef('0x33')](_0x68ef('0x46'),_0x8ef51b['message']);}};Acw[_0x68ef('0x1c')]['syncHangup']=function(_0x574573){try{if(this[_0x68ef('0xa')][_0x574573['uniqueid']]&&this[_0x68ef('0xa')][_0x574573[_0x68ef('0x2d')]][_0x68ef('0x25')]){logger[_0x68ef('0x31')](_0x68ef('0x47'),_0x574573[_0x68ef('0x2d')]);this[_0x68ef('0x42')](_0x574573[_0x68ef('0x2d')]);}else if(this[_0x68ef('0xa')][_0x574573[_0x68ef('0x43')]]&&this['channels'][_0x574573['linkedid']][_0x68ef('0x25')]){logger[_0x68ef('0x31')](_0x68ef('0x48'),_0x574573[_0x68ef('0x43')]);this[_0x68ef('0x42')](_0x574573[_0x68ef('0x43')]);}}catch(_0x15400c){logger[_0x68ef('0x33')](_0x68ef('0x49'),_0x15400c['message']);}};Acw['prototype'][_0x68ef('0x14')]=function(_0x5781c8){try{if(!_[_0x68ef('0x4a')](this['channels'][_0x5781c8[_0x68ef('0x4b')]])){this[_0x68ef('0x42')](_0x5781c8['transfereeuniqueid']);if(this[_0x68ef('0xa')][_0x5781c8['secondtransfereruniqueid']]){this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4c')]][_0x68ef('0x25')]=!![];this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4d')]]=this[_0x68ef('0xa')][_0x5781c8['secondtransfereruniqueid']];delete this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4c')]];}}else if(!_[_0x68ef('0x4a')](this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4d')]])){this[_0x68ef('0x42')](_0x5781c8['transfertargetuniqueid']);if(this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4e')]]){this['channels'][_0x5781c8[_0x68ef('0x4e')]][_0x68ef('0x25')]=!![];this[_0x68ef('0xa')][_0x5781c8['transfereeuniqueid']]=this[_0x68ef('0xa')][_0x5781c8['origtransfereruniqueid']];delete this['channels'][_0x5781c8[_0x68ef('0x4e')]];}}}catch(_0x540da5){logger[_0x68ef('0x33')]('[ACW][syncAttendedTransfer]\x20%s',_0x540da5[_0x68ef('0x3d')]);}};Acw[_0x68ef('0x1c')][_0x68ef('0x16')]=function(_0x3fbd39){try{if(this[_0x68ef('0xa')][_0x3fbd39[_0x68ef('0x4f')]]){logger['info'](_0x68ef('0x50'),JSON['stringify'](_0x3fbd39[_0x68ef('0x4f')]));this['startAcw'](_0x3fbd39[_0x68ef('0x4f')]);}else if(this[_0x68ef('0xa')][_0x3fbd39[_0x68ef('0x51')]]){logger[_0x68ef('0x31')](_0x68ef('0x52'),JSON[_0x68ef('0x3b')](_0x3fbd39[_0x68ef('0x51')]));this['startAcw'](_0x3fbd39[_0x68ef('0x51')]);}}catch(_0x11bab3){logger[_0x68ef('0x33')](_0x68ef('0x53'),_0x11bab3[_0x68ef('0x3d')]);}};Acw['prototype'][_0x68ef('0x12')]=function(_0x561e8d){try{if(this[_0x68ef('0x7')][_0x561e8d['queue']]&&this['voiceQueues'][_0x561e8d[_0x68ef('0x2e')]][_0x68ef('0x54')]===_0x68ef('0x55')){if(this[_0x68ef('0x8')][_0x561e8d['interface']]){logger[_0x68ef('0x31')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x561e8d[_0x68ef('0x2d')],_0x561e8d[_0x68ef('0x3f')],_0x561e8d[_0x68ef('0x2e')]);return RpcUser['savePause'](this['agents'][_0x561e8d[_0x68ef('0x3f')]],_0x68ef('0x56'),_0x561e8d[_0x68ef('0x2d')]);}}}catch(_0x454c6f){logger['error'](_0x68ef('0x57'),_0x454c6f[_0x68ef('0x3d')]);}};module[_0x68ef('0x58')]=Acw;
\ No newline at end of file
+var _0x207c=['syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','agents','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x207c,0x1e8));var _0xc207=function(_0x34412f,_0x116bea){_0x34412f=_0x34412f-0x0;var _0x4b4b5a=_0x207c[_0x34412f];return _0x4b4b5a;};'use strict';var util=require('util');var _=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var ami=require(_0xc207('0x2'));var logger=require(_0xc207('0x3'))(_0xc207('0x4'));var RpcUser=require(_0xc207('0x5'));var RpcVoiceAgentReport=require(_0xc207('0x6'));function Acw(_0x4b9daa){this[_0xc207('0x7')]=_0x4b9daa['voiceQueues'];this['agents']=_0x4b9daa['agents'];this[_0xc207('0x8')]=_0x4b9daa[_0xc207('0x8')];this[_0xc207('0x9')]={};ami['on']('agentconnect',this[_0xc207('0xa')][_0xc207('0xb')](this));ami['on'](_0xc207('0xc'),this['syncHangupRequest'][_0xc207('0xb')](this));ami['on'](_0xc207('0xd'),this[_0xc207('0xe')][_0xc207('0xb')](this));ami['on'](_0xc207('0xf'),this[_0xc207('0x10')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xc207('0xb')](this));ami['on']('blindtransfer',this[_0xc207('0x11')][_0xc207('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0xc207('0x12')][_0xc207('0xb')](this));}function getDiff(_0x3062f5){var _0x32acbf=moment()[_0xc207('0x13')](0x0);var _0x51e967=moment(_0x3062f5)[_0xc207('0x13')](0x0);return _0x32acbf[_0xc207('0x14')](_0x51e967,_0xc207('0x15'));}Acw[_0xc207('0x16')]['startAcw']=function(_0x564cef){try{var _0x554e5c=this;var _0x1cebfa=this[_0xc207('0x9')][_0x564cef][_0xc207('0x17')];var _0x65f539=this['channels'][_0x564cef][_0xc207('0x18')];var _0x282595=this[_0xc207('0x7')][_0x65f539];var _0x5f288e=![];var _0x4129b8='ACW';if(_0x282595[_0xc207('0x19')]){if(_0x282595[_0xc207('0x1a')][_0xc207('0x1b')]){_0x5f288e=!![];_0x4129b8=_0x282595[_0xc207('0x1a')][_0xc207('0x1b')];}}ami[_0xc207('0x1c')]({'action':_0xc207('0x1d'),'interface':_0x1cebfa,'paused':!![],'reason':_0x4129b8})[_0xc207('0x1e')](function(_0x212005){if(_0x554e5c[_0xc207('0x1f')][_0x1cebfa]){return RpcUser[_0xc207('0x20')](_0x554e5c[_0xc207('0x1f')][_0x1cebfa]['id'])[_0xc207('0x1e')](function(_0x4b52a7){if(_0x4b52a7&&!_0x4b52a7[_0xc207('0x21')]){logger['info'](_0xc207('0x22'),_0x564cef,_0x1cebfa,_0x65f539);var _0x3ac142=_0x554e5c[_0xc207('0x9')][_0x564cef][_0xc207('0x23')]&&_0x554e5c[_0xc207('0x9')][_0x564cef][_0xc207('0x24')]?_0x554e5c[_0xc207('0x9')][_0x564cef][_0xc207('0x24')]:_0x564cef;return RpcUser[_0xc207('0x25')](_0x554e5c[_0xc207('0x1f')][_0x1cebfa],_0x4129b8,_0x3ac142)[_0xc207('0x1e')](function(_0x27df03){if(!_0x5f288e){_0x554e5c[_0xc207('0x8')][_0x1cebfa]={};logger[_0xc207('0x26')](_0xc207('0x27'),_0x564cef,_0x554e5c['voiceQueues'][_0x65f539][_0xc207('0x28')],_0x1cebfa,_0x65f539);_0x554e5c['timers'][_0x1cebfa]['timer']=setTimeout(_0x554e5c[_0xc207('0x29')][_0xc207('0xb')](_0x554e5c,_0x1cebfa),_0x554e5c[_0xc207('0x7')][_0x65f539][_0xc207('0x28')]*0x3e8);_0x554e5c[_0xc207('0x8')][_0x1cebfa]['lastPauseAt']=moment()[_0xc207('0x2a')](_0xc207('0x2b'));_0x554e5c[_0xc207('0x8')][_0x1cebfa][_0xc207('0x2c')]=_0x564cef;_0x554e5c[_0xc207('0x8')][_0x1cebfa][_0xc207('0x18')]=_0x65f539;_0x554e5c[_0xc207('0x8')][_0x1cebfa][_0xc207('0x2d')]=function(){var _0xc6a7ce=getDiff(_0x554e5c[_0xc207('0x8')][_0x1cebfa][_0xc207('0x2e')]);clearTimeout(_0x554e5c[_0xc207('0x8')][_0x1cebfa][_0xc207('0x2f')]);_0x554e5c['timers'][_0x1cebfa][_0xc207('0x2f')]=![];RpcVoiceAgentReport[_0xc207('0x30')]({'acwtime':_0xc6a7ce},_0x554e5c[_0xc207('0x8')][_0x1cebfa][_0xc207('0x2c')],_0x1cebfa)[_0xc207('0x1e')](function(_0x2ce133){logger['info'](_0xc207('0x31'),_0x564cef,_0xc6a7ce,_0x2ce133);})[_0xc207('0x32')](function(_0x3899dd){logger[_0xc207('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x564cef,_0x3899dd);});delete _0x554e5c[_0xc207('0x8')][_0x1cebfa];};}});}else{logger[_0xc207('0x26')](_0xc207('0x34'),_0x564cef,_0x1cebfa,_0x65f539);}});}})[_0xc207('0x32')](function(_0x1a8359){logger[_0xc207('0x33')](_0xc207('0x27'),_0x564cef,_0x554e5c[_0xc207('0x7')][_0x65f539][_0xc207('0x28')],_0x1cebfa,_0x65f539);})['finally'](function(){delete _0x554e5c['channels'][_0x564cef];});}catch(_0x188c39){logger[_0xc207('0x33')](_0xc207('0x35'),_0x188c39[_0xc207('0x36')]);}};Acw['prototype'][_0xc207('0x29')]=function(_0x433c0f){try{var _0x20a5eb=this;if(_0x20a5eb[_0xc207('0x8')][_0x433c0f]){_0x20a5eb[_0xc207('0x8')][_0x433c0f]['timer']=![];var _0x219b0b=_0x20a5eb[_0xc207('0x8')][_0x433c0f]['uniqueid'];var _0x21dd42=_0x20a5eb['timers'][_0x433c0f][_0xc207('0x18')];var _0x1f69f9=_0x20a5eb['voiceQueues'][_0x21dd42][_0xc207('0x28')];logger[_0xc207('0x26')](_0xc207('0x37'),_0x433c0f);RpcUser['saveUnpause'](this['agents'][_0x433c0f]);RpcVoiceAgentReport[_0xc207('0x30')]({'acwtime':_0x1f69f9,'agentacw':!![]},_0x219b0b,_0x433c0f)[_0xc207('0x1e')](function(_0x41d66c){logger[_0xc207('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x219b0b,_0x1f69f9,_0x41d66c);})[_0xc207('0x32')](function(_0x47cdc4){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x219b0b,_0x47cdc4);});}else{logger['error'](_0xc207('0x38'),_0x433c0f);if(_0x20a5eb[_0xc207('0x8')]){logger[_0xc207('0x26')]('[ACW][TIMERS]',JSON[_0xc207('0x39')](_0x20a5eb[_0xc207('0x8')]));}}}catch(_0x3e7cd9){logger[_0xc207('0x33')]('[ACW][STOP]\x20%s',_0x3e7cd9[_0xc207('0x36')]);}};Acw[_0xc207('0x16')][_0xc207('0xa')]=function(_0x46aa9f){try{if(this[_0xc207('0x7')][_0x46aa9f['queue']]&&(this[_0xc207('0x7')][_0x46aa9f[_0xc207('0x18')]][_0xc207('0x4')]||this[_0xc207('0x7')][_0x46aa9f[_0xc207('0x18')]][_0xc207('0x19')])){if(this[_0xc207('0x1f')][_0x46aa9f[_0xc207('0x17')]]){this[_0xc207('0x9')][_0x46aa9f['uniqueid']]={'queue':_0x46aa9f[_0xc207('0x18')],'interface':_0x46aa9f[_0xc207('0x17')],'destlinkedid':_0x46aa9f['destlinkedid']};}}}catch(_0x141e34){logger[_0xc207('0x33')](_0xc207('0x3a'),_0x141e34[_0xc207('0x36')]);}};Acw[_0xc207('0x16')]['syncAgentConnectPreview']=function(_0x11989b){try{if(this[_0xc207('0x7')][_0x11989b[_0xc207('0x18')]]&&(this['voiceQueues'][_0x11989b[_0xc207('0x18')]][_0xc207('0x4')]||this[_0xc207('0x7')][_0x11989b[_0xc207('0x18')]]['mandatoryDisposition'])){if(this['agents'][_0x11989b[_0xc207('0x17')]]){this[_0xc207('0x9')][_0x11989b[_0xc207('0x2c')]]={'queue':_0x11989b[_0xc207('0x18')],'interface':_0x11989b[_0xc207('0x17')]};}}}catch(_0x31baa0){logger[_0xc207('0x33')](_0xc207('0x3b'),_0x31baa0[_0xc207('0x36')]);}};Acw[_0xc207('0x16')][_0xc207('0x3c')]=function(_0x2fda4f){try{if(this['channels'][_0x2fda4f['uniqueid']]&&_[_0xc207('0x3d')](this[_0xc207('0x9')][_0x2fda4f[_0xc207('0x2c')]]['attended'])){logger[_0xc207('0x26')](_0xc207('0x3e'),_0x2fda4f[_0xc207('0x2c')]);this[_0xc207('0x3f')](_0x2fda4f['uniqueid']);}else if(this[_0xc207('0x9')][_0x2fda4f['linkedid']]&&_[_0xc207('0x3d')](this['channels'][_0x2fda4f['linkedid']][_0xc207('0x23')])){logger[_0xc207('0x26')]('[%s][HANGUP:LINKEDID]',_0x2fda4f['linkedid']);this['startAcw'](_0x2fda4f[_0xc207('0x40')]);}}catch(_0x462958){logger[_0xc207('0x33')](_0xc207('0x41'),_0x462958[_0xc207('0x36')]);}};Acw[_0xc207('0x16')][_0xc207('0xe')]=function(_0x1dfdee){try{if(this['channels'][_0x1dfdee[_0xc207('0x2c')]]&&this[_0xc207('0x9')][_0x1dfdee['uniqueid']]['attended']){logger[_0xc207('0x26')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x1dfdee['uniqueid']);this[_0xc207('0x3f')](_0x1dfdee[_0xc207('0x2c')]);}else if(this[_0xc207('0x9')][_0x1dfdee[_0xc207('0x40')]]&&this[_0xc207('0x9')][_0x1dfdee[_0xc207('0x40')]][_0xc207('0x23')]){logger[_0xc207('0x26')](_0xc207('0x42'),_0x1dfdee[_0xc207('0x40')]);this[_0xc207('0x3f')](_0x1dfdee['linkedid']);}}catch(_0x529a21){logger[_0xc207('0x33')](_0xc207('0x43'),_0x529a21[_0xc207('0x36')]);}};Acw[_0xc207('0x16')][_0xc207('0x44')]=function(_0x21c12b){try{if(!_[_0xc207('0x45')](this[_0xc207('0x9')][_0x21c12b[_0xc207('0x46')]])){this['startAcw'](_0x21c12b[_0xc207('0x46')]);if(this[_0xc207('0x9')][_0x21c12b[_0xc207('0x47')]]){this[_0xc207('0x9')][_0x21c12b['secondtransfereruniqueid']][_0xc207('0x23')]=!![];this[_0xc207('0x9')][_0x21c12b[_0xc207('0x48')]]=this[_0xc207('0x9')][_0x21c12b[_0xc207('0x47')]];delete this[_0xc207('0x9')][_0x21c12b[_0xc207('0x47')]];}}else if(!_['isNil'](this[_0xc207('0x9')][_0x21c12b[_0xc207('0x48')]])){this[_0xc207('0x3f')](_0x21c12b[_0xc207('0x48')]);if(this['channels'][_0x21c12b[_0xc207('0x49')]]){this['channels'][_0x21c12b['origtransfereruniqueid']][_0xc207('0x23')]=!![];this[_0xc207('0x9')][_0x21c12b[_0xc207('0x46')]]=this[_0xc207('0x9')][_0x21c12b[_0xc207('0x49')]];delete this[_0xc207('0x9')][_0x21c12b[_0xc207('0x49')]];}}}catch(_0x33c372){logger[_0xc207('0x33')](_0xc207('0x4a'),_0x33c372[_0xc207('0x36')]);}};Acw[_0xc207('0x16')][_0xc207('0x11')]=function(_0x3ed4b2){try{if(this[_0xc207('0x9')][_0x3ed4b2['transfereruniqueid']]){logger[_0xc207('0x26')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xc207('0x39')](_0x3ed4b2[_0xc207('0x4b')]));this[_0xc207('0x3f')](_0x3ed4b2['transfereruniqueid']);}else if(this['channels'][_0x3ed4b2[_0xc207('0x4c')]]){logger[_0xc207('0x26')](_0xc207('0x4d'),JSON['stringify'](_0x3ed4b2[_0xc207('0x4c')]));this[_0xc207('0x3f')](_0x3ed4b2[_0xc207('0x4c')]);}}catch(_0x4967b4){logger['error'](_0xc207('0x4e'),_0x4967b4['message']);}};Acw[_0xc207('0x16')][_0xc207('0x10')]=function(_0x3cca53){try{if(this[_0xc207('0x7')][_0x3cca53[_0xc207('0x18')]]&&this[_0xc207('0x7')][_0x3cca53[_0xc207('0x18')]][_0xc207('0x4f')]==='all'){if(this[_0xc207('0x1f')][_0x3cca53[_0xc207('0x17')]]){logger[_0xc207('0x26')](_0xc207('0x50'),_0x3cca53[_0xc207('0x2c')],_0x3cca53[_0xc207('0x17')],_0x3cca53[_0xc207('0x18')]);return RpcUser[_0xc207('0x25')](this[_0xc207('0x1f')][_0x3cca53[_0xc207('0x17')]],_0xc207('0x51'),_0x3cca53['uniqueid']);}}}catch(_0x20e130){logger[_0xc207('0x33')](_0xc207('0x52'),_0x20e130[_0xc207('0x36')]);}};module['exports']=Acw;
\ No newline at end of file
diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js
index 6a429ba..d346ead 100644
--- a/server/services/ami/ami.js
+++ b/server/services/ami/ami.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x14b1=['log','exports','asterisk-manager','bluebird','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','info','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','catch'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0x14b1,0x160));var _0x114b=function(_0x531b1e,_0x301978){_0x531b1e=_0x531b1e-0x0;var _0x1208b6=_0x14b1[_0x531b1e];return _0x1208b6;};'use strict';var Manager=require(_0x114b('0x0'));var BPromise=require(_0x114b('0x1'));var moment=require('moment');var util=require('util');var _=require(_0x114b('0x2'));var logger=require(_0x114b('0x3'))(_0x114b('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x114b('0x5')][_0x114b('0x6')],config[_0x114b('0x5')]['ip'],config['asterisk'][_0x114b('0x7')],config[_0x114b('0x5')][_0x114b('0x8')],!![]);ami[_0x114b('0x9')]();ami[_0x114b('0xa')]=BPromise[_0x114b('0xb')](ami['action']);function error(_0x356f39){logger[_0x114b('0xc')](util['format'](_0x114b('0xd'),config[_0x114b('0x5')][_0x114b('0x7')],config[_0x114b('0x5')]['ip'],config[_0x114b('0x5')][_0x114b('0x6')],util[_0x114b('0xe')](_0x356f39,![],null)));}function close(){logger[_0x114b('0xc')](util['format'](_0x114b('0xf'),config[_0x114b('0x5')][_0x114b('0x7')],config[_0x114b('0x5')]['ip'],config[_0x114b('0x5')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x114b('0xa')]({'action':_0x114b('0x10')});};};ami[_0x114b('0x11')]=function(){return function(){return ami[_0x114b('0xa')]({'action':_0x114b('0x12')});};};ami[_0x114b('0x13')]=function(){return function(){return ami[_0x114b('0xa')]({'action':'sippeerstatus'});};};ami[_0x114b('0x14')]=function(){return function(){return ami[_0x114b('0xa')]({'action':'queuesummary'});};};ami[_0x114b('0x15')]=function(){return function(){return ami[_0x114b('0xa')]({'action':'coreshowchannels'});};};function connect(_0x45f64){logger[_0x114b('0x16')](util[_0x114b('0x17')](_0x114b('0x18'),config['asterisk'][_0x114b('0x7')],config[_0x114b('0x5')]['ip'],config[_0x114b('0x5')][_0x114b('0x6')]));ami[_0x114b('0x19')]('error',error);ami[_0x114b('0x19')]('close',close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x53edb3){logger[_0x114b('0x16')](util[_0x114b('0x17')](_0x114b('0x1a'),config['asterisk'][_0x114b('0x7')],config[_0x114b('0x5')]['ip'],config[_0x114b('0x5')]['port'],util[_0x114b('0xe')](_0x53edb3,![],null)));});ami['on'](_0x114b('0x1b'),function(_0x46addc){logger[_0x114b('0x16')](util['format'](_0x114b('0x1c'),config['asterisk']['username'],config[_0x114b('0x5')]['ip'],config[_0x114b('0x5')]['port']));return BPromise[_0x114b('0x1d')]()[_0x114b('0x1e')](ami[_0x114b('0x1f')]())['then'](ami[_0x114b('0x11')]())[_0x114b('0x1e')](ami[_0x114b('0x13')]())['then'](ami[_0x114b('0x14')]())[_0x114b('0x1e')](ami['actionCoreShowChannels']())[_0x114b('0x20')](function(_0x3cf701){console[_0x114b('0x21')](_0x3cf701);});});ami[_0x114b('0x19')](_0x114b('0xc'),error);ami[_0x114b('0x19')]('close',close);module[_0x114b('0x22')]=ami;
\ No newline at end of file
+var _0xf525=['promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','catch','exports','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','port','asterisk','username','keepConnected','Action'];(function(_0x258257,_0x32042d){var _0xafb58a=function(_0x506b5a){while(--_0x506b5a){_0x258257['push'](_0x258257['shift']());}};_0xafb58a(++_0x32042d);}(_0xf525,0xd8));var _0x5f52=function(_0x511f0d,_0x1d7215){_0x511f0d=_0x511f0d-0x0;var _0x590065=_0xf525[_0x511f0d];return _0x590065;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x5f52('0x0'));var moment=require(_0x5f52('0x1'));var util=require(_0x5f52('0x2'));var _=require(_0x5f52('0x3'));var logger=require(_0x5f52('0x4'))(_0x5f52('0x5'));var config=require(_0x5f52('0x6'));var ami=new Manager(config['asterisk'][_0x5f52('0x7')],config['asterisk']['ip'],config[_0x5f52('0x8')][_0x5f52('0x9')],config[_0x5f52('0x8')]['password'],!![]);ami[_0x5f52('0xa')]();ami[_0x5f52('0xb')]=BPromise[_0x5f52('0xc')](ami['action']);function error(_0xce6fd0){logger[_0x5f52('0xd')](util[_0x5f52('0xe')](_0x5f52('0xf'),config[_0x5f52('0x8')][_0x5f52('0x9')],config[_0x5f52('0x8')]['ip'],config[_0x5f52('0x8')][_0x5f52('0x7')],util[_0x5f52('0x10')](_0xce6fd0,![],null)));}function close(){logger['error'](util[_0x5f52('0xe')](_0x5f52('0x11'),config[_0x5f52('0x8')][_0x5f52('0x9')],config[_0x5f52('0x8')]['ip'],config['asterisk']['port']));}ami[_0x5f52('0x12')]=function(){return function(){return ami[_0x5f52('0xb')]({'action':_0x5f52('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x5f52('0xb')]({'action':_0x5f52('0x14')});};};ami[_0x5f52('0x15')]=function(){return function(){return ami[_0x5f52('0xb')]({'action':_0x5f52('0x16')});};};ami[_0x5f52('0x17')]=function(){return function(){return ami[_0x5f52('0xb')]({'action':'queuesummary'});};};ami[_0x5f52('0x18')]=function(){return function(){return ami[_0x5f52('0xb')]({'action':'coreshowchannels'});};};function connect(_0x216733){logger['info'](util['format'](_0x5f52('0x19'),config['asterisk'][_0x5f52('0x9')],config[_0x5f52('0x8')]['ip'],config[_0x5f52('0x8')][_0x5f52('0x7')]));ami[_0x5f52('0x1a')](_0x5f52('0xd'),error);ami[_0x5f52('0x1a')](_0x5f52('0x1b'),close);}ami['on']('connect',connect);ami['on'](_0x5f52('0x1c'),function(_0x1beded){logger[_0x5f52('0x1d')](util[_0x5f52('0xe')](_0x5f52('0x1e'),config['asterisk'][_0x5f52('0x9')],config[_0x5f52('0x8')]['ip'],config[_0x5f52('0x8')]['port'],util[_0x5f52('0x10')](_0x1beded,![],null)));});ami['on'](_0x5f52('0x1f'),function(_0x153626){logger[_0x5f52('0x1d')](util[_0x5f52('0xe')](_0x5f52('0x20'),config['asterisk'][_0x5f52('0x9')],config['asterisk']['ip'],config[_0x5f52('0x8')][_0x5f52('0x7')]));return BPromise[_0x5f52('0x21')]()[_0x5f52('0x22')](ami[_0x5f52('0x12')]())[_0x5f52('0x22')](ami[_0x5f52('0x23')]())[_0x5f52('0x22')](ami[_0x5f52('0x15')]())[_0x5f52('0x22')](ami['actionQueueSummary']())[_0x5f52('0x22')](ami[_0x5f52('0x18')]())[_0x5f52('0x24')](function(_0x33fca4){console['log'](_0x33fca4);});});ami[_0x5f52('0x1a')](_0x5f52('0xd'),error);ami[_0x5f52('0x1a')](_0x5f52('0x1b'),close);module[_0x5f52('0x25')]=ami;
\ No newline at end of file
diff --git a/server/services/ami/client.js b/server/services/ami/client.js
index 5e351b6..d986ac4 100644
--- a/server/services/ami/client.js
+++ b/server/services/ami/client.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38d1=['http','Request','then','debug','memberReport','error','message','catch','exports','jayson/promise','../../config/logger','ami','client'];(function(_0x431f3c,_0x54cb7b){var _0x543f22=function(_0x577165){while(--_0x577165){_0x431f3c['push'](_0x431f3c['shift']());}};_0x543f22(++_0x54cb7b);}(_0x38d1,0xa5));var _0x138d=function(_0x2ce3f6,_0x24acaf){_0x2ce3f6=_0x2ce3f6-0x0;var _0x598dab=_0x38d1[_0x2ce3f6];return _0x598dab;};'use strict';var jayson=require(_0x138d('0x0'));var BPromise=require('bluebird');var logger=require(_0x138d('0x1'))(_0x138d('0x2'));var client=jayson[_0x138d('0x3')][_0x138d('0x4')]({'port':0x2329});client[_0x138d('0x5')]=function(_0x2d4419,_0x27dbd5){return new BPromise(function(_0x16d60c,_0xab189a){return client['request'](_0x2d4419,_0x27dbd5)[_0x138d('0x6')](function(_0x32da88){logger[_0x138d('0x7')]('rpc',_0x138d('0x8'),_0x2d4419,_0x27dbd5,_0x32da88);if(_0x32da88[_0x138d('0x9')]){logger[_0x138d('0x9')]('rpc',_0x138d('0x8'),_0x2d4419,_0x32da88[_0x138d('0x9')][_0x138d('0xa')],_0x27dbd5);return _0xab189a(_0x32da88[_0x138d('0x9')][_0x138d('0xa')]);}else{return _0x16d60c(_0x32da88['result']);}})[_0x138d('0xb')](function(_0x7eea87){logger['error']('rpc',_0x138d('0x8'),_0x2d4419,_0x7eea87,_0x27dbd5);return _0xab189a(_0x7eea87);});});};module[_0x138d('0xc')]=client;
\ No newline at end of file
+var _0x64d8=['catch','exports','jayson/promise','bluebird','../../config/logger','ami','client','http','then','memberReport','error','rpc','message','result'];(function(_0x4c98ad,_0x49996a){var _0x9725ff=function(_0x3a18fe){while(--_0x3a18fe){_0x4c98ad['push'](_0x4c98ad['shift']());}};_0x9725ff(++_0x49996a);}(_0x64d8,0x18a));var _0x864d=function(_0x40e0eb,_0x51f9a5){_0x40e0eb=_0x40e0eb-0x0;var _0x3b11ee=_0x64d8[_0x40e0eb];return _0x3b11ee;};'use strict';var jayson=require(_0x864d('0x0'));var BPromise=require(_0x864d('0x1'));var logger=require(_0x864d('0x2'))(_0x864d('0x3'));var client=jayson[_0x864d('0x4')][_0x864d('0x5')]({'port':0x2329});client['Request']=function(_0x10b87e,_0x531b42){return new BPromise(function(_0x5e5bdf,_0x2f3c64){return client['request'](_0x10b87e,_0x531b42)[_0x864d('0x6')](function(_0x32e9f0){logger['debug']('rpc',_0x864d('0x7'),_0x10b87e,_0x531b42,_0x32e9f0);if(_0x32e9f0[_0x864d('0x8')]){logger[_0x864d('0x8')](_0x864d('0x9'),'memberReport',_0x10b87e,_0x32e9f0[_0x864d('0x8')][_0x864d('0xa')],_0x531b42);return _0x2f3c64(_0x32e9f0[_0x864d('0x8')][_0x864d('0xa')]);}else{return _0x5e5bdf(_0x32e9f0[_0x864d('0xb')]);}})[_0x864d('0xc')](function(_0x153a4d){logger['error'](_0x864d('0x9'),_0x864d('0x7'),_0x10b87e,_0x153a4d,_0x531b42);return _0x2f3c64(_0x153a4d);});});};module[_0x864d('0xd')]=client;
\ No newline at end of file
diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js
index 40589db..dd16696 100644
--- a/server/services/ami/dialer/action.js
+++ b/server/services/ami/dialer/action.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde6f=['callbackat','recallme','originatecalleridname','prototype','format','dialCutDigit','substring','getQueue','exports','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid'];(function(_0x5dbcd9,_0x1d0ce2){var _0x29f990=function(_0x324786){while(--_0x324786){_0x5dbcd9['push'](_0x5dbcd9['shift']());}};_0x29f990(++_0x1d0ce2);}(_0xde6f,0x84));var _0xfde6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde6f[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xfde6('0x0'));function checkNameSurname(_0xe3543e,_0x211a20,_0x5df9d5){var _0x1b72d8='';if(!_[_0xfde6('0x1')](_0x211a20)&&_0xfde6('0x2')===typeof _0x211a20){_0x1b72d8+=_0x211a20;}if(!_[_0xfde6('0x1')](_0x5df9d5)&&_0xfde6('0x2')===typeof _0x5df9d5){_0x1b72d8+='\x20'+_0x5df9d5;}if(_0x1b72d8!==''){return _0x1b72d8;}return _0xe3543e;}function Action(_0x347a67,_0x50d21a,_0x5628ea){this[_0xfde6('0x3')]=_0x347a67;this[_0xfde6('0x4')]=_0x5628ea||undefined;this[_0xfde6('0x5')]=checkNameSurname(_0x50d21a[_0xfde6('0x6')]['phone'],_0x50d21a[_0xfde6('0x6')][_0xfde6('0x7')],_0x50d21a[_0xfde6('0x6')]['lastName']);this[_0xfde6('0x8')]=_0x50d21a[_0xfde6('0x6')]['phone'];this['queue']=_0x347a67[_0xfde6('0x5')];this[_0xfde6('0x9')]=_0x50d21a[_0xfde6('0x9')]||![];this[_0xfde6('0xa')]=_0x347a67['type'];this[_0xfde6('0xb')]=_0x347a67[_0xfde6('0xb')]||0x3;this[_0xfde6('0xc')]=_0x50d21a[_0xfde6('0xc')];this[_0xfde6('0xd')]=_0x50d21a['countbusyretry'];this[_0xfde6('0xe')]=_0x50d21a[_0xfde6('0xe')];this['countnoanswerretry']=_0x50d21a[_0xfde6('0xf')];this[_0xfde6('0x10')]=_0x50d21a[_0xfde6('0x10')];this['countdropretry']=_0x50d21a[_0xfde6('0x11')];this[_0xfde6('0x12')]=_0x50d21a[_0xfde6('0x12')];this[_0xfde6('0x13')]=_0x50d21a['countmachineretry'];this['countagentrejectretry']=_0x50d21a[_0xfde6('0x14')];this['ContactId']=_0x50d21a[_0xfde6('0x15')];this[_0xfde6('0x16')]=_0x50d21a['ListId'];this[_0xfde6('0x17')]=_0x50d21a['UserId'];this[_0xfde6('0x18')]=_0x50d21a[_0xfde6('0x18')];this[_0xfde6('0x19')]=_0x50d21a[_0xfde6('0x19')];this[_0xfde6('0x1a')]=_0x50d21a['id'];this[_0xfde6('0x1b')]=_0x50d21a[_0xfde6('0x6')][_0xfde6('0x7')]||'';this[_0xfde6('0x1c')]=moment()['format'](_0xfde6('0x1d'));this[_0xfde6('0x1e')]=_0x50d21a['callback'];this[_0xfde6('0x1f')]=_0x50d21a[_0xfde6('0x1f')];this['callbackat']=_0x50d21a[_0xfde6('0x20')];this[_0xfde6('0x21')]=_0x50d21a['recallme'];this['originatecalleridnum']='';this[_0xfde6('0x22')]='';}Action[_0xfde6('0x23')]['getCaller']=function(){return util[_0xfde6('0x24')]('\x22%s\x22\x20<%s>',this['name'],this[_0xfde6('0x3')][_0xfde6('0x25')]>0x0?this[_0xfde6('0x8')][_0xfde6('0x26')](this[_0xfde6('0x3')][_0xfde6('0x25')]):this['number']);};Action[_0xfde6('0x23')][_0xfde6('0x27')]=function(){return this['queue'];};module[_0xfde6('0x28')]=Action;
\ No newline at end of file
+var _0xb9f0=['ContactId','ListId','UserId','CampaignId','idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','dialCutDigit','substring','number','getQueue','queue','exports','moment','isNil','string','voiceQueue','name','Contact','phone','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x13e442,_0x24cc6b){var _0x521893=function(_0x5423a5){while(--_0x5423a5){_0x13e442['push'](_0x13e442['shift']());}};_0x521893(++_0x24cc6b);}(_0xb9f0,0xc8));var _0x0b9f=function(_0x3628f4,_0x93661e){_0x3628f4=_0x3628f4-0x0;var _0x23758c=_0xb9f0[_0x3628f4];return _0x23758c;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0b9f('0x0'));function checkNameSurname(_0x122421,_0x2c11a9,_0x54e0f4){var _0x4f9e8c='';if(!_[_0x0b9f('0x1')](_0x2c11a9)&&_0x0b9f('0x2')===typeof _0x2c11a9){_0x4f9e8c+=_0x2c11a9;}if(!_['isNil'](_0x54e0f4)&&'string'===typeof _0x54e0f4){_0x4f9e8c+='\x20'+_0x54e0f4;}if(_0x4f9e8c!==''){return _0x4f9e8c;}return _0x122421;}function Action(_0x2b9331,_0x1a1456,_0x5e3c06){this[_0x0b9f('0x3')]=_0x2b9331;this['uniqueid']=_0x5e3c06||undefined;this[_0x0b9f('0x4')]=checkNameSurname(_0x1a1456[_0x0b9f('0x5')][_0x0b9f('0x6')],_0x1a1456[_0x0b9f('0x5')]['firstName'],_0x1a1456[_0x0b9f('0x5')][_0x0b9f('0x7')]);this['number']=_0x1a1456['Contact']['phone'];this['queue']=_0x2b9331[_0x0b9f('0x4')];this[_0x0b9f('0x8')]=_0x1a1456['active']||![];this[_0x0b9f('0x9')]=_0x2b9331[_0x0b9f('0x9')];this[_0x0b9f('0xa')]=_0x2b9331[_0x0b9f('0xa')]||0x3;this['scheduledat']=_0x1a1456[_0x0b9f('0xb')];this['countbusyretry']=_0x1a1456[_0x0b9f('0xc')];this[_0x0b9f('0xd')]=_0x1a1456['countcongestionretry'];this[_0x0b9f('0xe')]=_0x1a1456[_0x0b9f('0xe')];this['countnosuchnumberretry']=_0x1a1456[_0x0b9f('0xf')];this[_0x0b9f('0x10')]=_0x1a1456[_0x0b9f('0x10')];this[_0x0b9f('0x11')]=_0x1a1456[_0x0b9f('0x11')];this[_0x0b9f('0x12')]=_0x1a1456[_0x0b9f('0x12')];this[_0x0b9f('0x13')]=_0x1a1456[_0x0b9f('0x13')];this[_0x0b9f('0x14')]=_0x1a1456[_0x0b9f('0x14')];this[_0x0b9f('0x15')]=_0x1a1456[_0x0b9f('0x15')];this[_0x0b9f('0x16')]=_0x1a1456[_0x0b9f('0x16')];this['VoiceQueueId']=_0x1a1456['VoiceQueueId'];this[_0x0b9f('0x17')]=_0x1a1456[_0x0b9f('0x17')];this[_0x0b9f('0x18')]=_0x1a1456['id'];this[_0x0b9f('0x19')]=_0x1a1456[_0x0b9f('0x5')][_0x0b9f('0x1a')]||'';this[_0x0b9f('0x1b')]=moment()['format'](_0x0b9f('0x1c'));this[_0x0b9f('0x1d')]=_0x1a1456[_0x0b9f('0x1d')];this[_0x0b9f('0x1e')]=_0x1a1456[_0x0b9f('0x1e')];this['callbackat']=_0x1a1456[_0x0b9f('0x1f')];this[_0x0b9f('0x20')]=_0x1a1456[_0x0b9f('0x20')];this[_0x0b9f('0x21')]='';this[_0x0b9f('0x22')]='';}Action[_0x0b9f('0x23')][_0x0b9f('0x24')]=function(){return util[_0x0b9f('0x25')]('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue'][_0x0b9f('0x26')]>0x0?this['number'][_0x0b9f('0x27')](this['voiceQueue'][_0x0b9f('0x26')]):this[_0x0b9f('0x28')]);};Action[_0x0b9f('0x23')][_0x0b9f('0x29')]=function(){return this[_0x0b9f('0x2a')];};module[_0x0b9f('0x2b')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js
index 90b8fd7..7dec602 100644
--- a/server/services/ami/dialer/additionalPhone.js
+++ b/server/services/ami/dialer/additionalPhone.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa98=['seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','endtime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','diff'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xaa98,0x12d));var _0x8aa9=function(_0x3ad779,_0x5249e1){_0x3ad779=_0x3ad779-0x0;var _0x31ee8b=_0xaa98[_0x3ad779];return _0x31ee8b;};'use strict';var util=require('util');var _=require(_0x8aa9('0x0'));var moment=require(_0x8aa9('0x1'));function getSeconds(_0x3246c3,_0x24cdce){var _0x205e53=moment(_0x3246c3)['milliseconds'](0x0);var _0x178201=moment(_0x24cdce)['milliseconds'](0x0);return _0x205e53[_0x8aa9('0x2')](_0x178201,_0x8aa9('0x3'));}function AdditionalPhone(_0x2622c5){this[_0x8aa9('0x4')]=_0x2622c5[_0x8aa9('0x4')];this[_0x8aa9('0x5')]=_0x2622c5[_0x8aa9('0x5')]||undefined;this[_0x8aa9('0x6')]=_0x2622c5[_0x8aa9('0x6')];this[_0x8aa9('0x7')]=_0x2622c5[_0x8aa9('0x6')]===_0x8aa9('0x8')?_0x8aa9('0x9'):_0x2622c5[_0x8aa9('0x6')];this[_0x8aa9('0xa')]=_0x2622c5[_0x8aa9('0xa')];this[_0x8aa9('0xb')]=_0x2622c5[_0x8aa9('0xb')];this[_0x8aa9('0xc')]=_0x2622c5[_0x8aa9('0xc')];this[_0x8aa9('0xd')]=_0x2622c5['countbusyretry']+_0x2622c5[_0x8aa9('0xb')]+_0x2622c5['countnoanswerretry']+_0x2622c5[_0x8aa9('0xe')]+_0x2622c5[_0x8aa9('0xf')]+_0x2622c5[_0x8aa9('0x10')]+_0x2622c5[_0x8aa9('0x11')]+_0x2622c5['countagentrejectretry'];this[_0x8aa9('0xe')]=_0x2622c5['countnosuchnumberretry'];this['countdropretry']=_0x2622c5[_0x8aa9('0xf')];this[_0x8aa9('0x10')]=_0x2622c5['countabandonedretry'];this[_0x8aa9('0x11')]=_0x2622c5[_0x8aa9('0x11')];this[_0x8aa9('0x12')]=_0x2622c5[_0x8aa9('0x12')];this[_0x8aa9('0x9')]=_0x2622c5[_0x8aa9('0x9')];this['calleridname']=_0x2622c5[_0x8aa9('0x13')];this[_0x8aa9('0x14')]=_0x2622c5[_0x8aa9('0x15')];this['starttime']=_0x2622c5[_0x8aa9('0x16')];this['responsetime']=_0x2622c5['responsetime'];this[_0x8aa9('0x17')]=_0x2622c5[_0x8aa9('0x18')];this['ringtime']=getSeconds(_0x2622c5['responsetime'],_0x2622c5[_0x8aa9('0x16')]);this[_0x8aa9('0x19')]=0x0;this[_0x8aa9('0x1a')]=0x0;this['callback']=_0x2622c5[_0x8aa9('0x1b')];this[_0x8aa9('0x1c')]=_0x2622c5['callbackuniqueid'];this[_0x8aa9('0x1d')]=_0x2622c5['callbackat'];this['recallme']=_0x2622c5['recallme'];this[_0x8aa9('0x1e')]=_0x2622c5[_0x8aa9('0x1e')];this[_0x8aa9('0x1f')]=_0x2622c5[_0x8aa9('0x1f')];this[_0x8aa9('0x20')]=_0x2622c5['UserId'];this[_0x8aa9('0x21')]=_0x2622c5[_0x8aa9('0x21')];this[_0x8aa9('0x22')]=_0x2622c5[_0x8aa9('0x22')];this['originatecalleridnum']=_0x2622c5[_0x8aa9('0x23')]||'';this[_0x8aa9('0x24')]=_0x2622c5['originatecalleridname']||'';}module[_0x8aa9('0x25')]=History;
\ No newline at end of file
+var _0x05e6=['originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','number','starttime','endtime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x1cc4cd,_0x4004a2){var _0x271b5f=function(_0x33f88c){while(--_0x33f88c){_0x1cc4cd['push'](_0x1cc4cd['shift']());}};_0x271b5f(++_0x4004a2);}(_0x05e6,0x189));var _0x605e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x05e6[_0x2763f2];return _0x3ef471;};'use strict';var util=require('util');var _=require(_0x605e('0x0'));var moment=require(_0x605e('0x1'));function getSeconds(_0x357999,_0x266c6b){var _0x119191=moment(_0x357999)['milliseconds'](0x0);var _0x47f6c1=moment(_0x266c6b)[_0x605e('0x2')](0x0);return _0x119191[_0x605e('0x3')](_0x47f6c1,_0x605e('0x4'));}function AdditionalPhone(_0x2d8428){this[_0x605e('0x5')]=_0x2d8428['uniqueid'];this['scheduledat']=_0x2d8428[_0x605e('0x6')]||undefined;this['type']=_0x2d8428['type'];this[_0x605e('0x7')]=_0x2d8428[_0x605e('0x8')]===_0x605e('0x9')?_0x605e('0xa'):_0x2d8428[_0x605e('0x8')];this[_0x605e('0xb')]=_0x2d8428['countbusyretry'];this[_0x605e('0xc')]=_0x2d8428['countcongestionretry'];this[_0x605e('0xd')]=_0x2d8428[_0x605e('0xd')];this[_0x605e('0xe')]=_0x2d8428[_0x605e('0xb')]+_0x2d8428[_0x605e('0xc')]+_0x2d8428[_0x605e('0xd')]+_0x2d8428[_0x605e('0xf')]+_0x2d8428[_0x605e('0x10')]+_0x2d8428[_0x605e('0x11')]+_0x2d8428[_0x605e('0x12')]+_0x2d8428[_0x605e('0x13')];this[_0x605e('0xf')]=_0x2d8428['countnosuchnumberretry'];this['countdropretry']=_0x2d8428[_0x605e('0x10')];this['countabandonedretry']=_0x2d8428['countabandonedretry'];this[_0x605e('0x12')]=_0x2d8428[_0x605e('0x12')];this[_0x605e('0x13')]=_0x2d8428['countagentrejectretry'];this[_0x605e('0xa')]=_0x2d8428[_0x605e('0xa')];this[_0x605e('0x14')]=_0x2d8428['name'];this['calleridnum']=_0x2d8428[_0x605e('0x15')];this[_0x605e('0x16')]=_0x2d8428[_0x605e('0x16')];this['responsetime']=_0x2d8428['responsetime'];this[_0x605e('0x17')]=_0x2d8428[_0x605e('0x18')];this[_0x605e('0x19')]=getSeconds(_0x2d8428[_0x605e('0x18')],_0x2d8428[_0x605e('0x16')]);this[_0x605e('0x1a')]=0x0;this['talktime']=0x0;this[_0x605e('0x1b')]=_0x2d8428[_0x605e('0x1b')];this['callbackuniqueid']=_0x2d8428[_0x605e('0x1c')];this[_0x605e('0x1d')]=_0x2d8428[_0x605e('0x1d')];this[_0x605e('0x1e')]=_0x2d8428[_0x605e('0x1e')];this[_0x605e('0x1f')]=_0x2d8428[_0x605e('0x1f')];this[_0x605e('0x20')]=_0x2d8428['ListId'];this[_0x605e('0x21')]=_0x2d8428[_0x605e('0x21')];this[_0x605e('0x22')]=_0x2d8428[_0x605e('0x22')];this[_0x605e('0x23')]=_0x2d8428[_0x605e('0x23')];this['originatecalleridnum']=_0x2d8428[_0x605e('0x24')]||'';this[_0x605e('0x25')]=_0x2d8428['originatecalleridname']||'';}module[_0x605e('0x26')]=History;
\ No newline at end of file
diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js
index a18e7c5..a7d9840 100644
--- a/server/services/ami/dialer/agentComplete.js
+++ b/server/services/ami/dialer/agentComplete.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf745=['callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason'];(function(_0x156a2d,_0x28ea83){var _0x4cf0ed=function(_0x155b78){while(--_0x155b78){_0x156a2d['push'](_0x156a2d['shift']());}};_0x4cf0ed(++_0x28ea83);}(_0xf745,0xf6));var _0x5f74=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf745[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x5f74('0x0'));var _=require(_0x5f74('0x1'));var moment=require(_0x5f74('0x2'));function getSeconds(_0xc72b6d,_0x259692){var _0x1e0fa8=moment(_0xc72b6d)[_0x5f74('0x3')](0x0);var _0x383aa0=moment(_0x259692)[_0x5f74('0x3')](0x0);return _0x1e0fa8[_0x5f74('0x4')](_0x383aa0,'seconds');}function AgentComplete(_0x54f74e,_0x10dd1f){this[_0x5f74('0x5')]=0x4;this[_0x5f74('0x6')]=_0x5f74('0x7');this['scheduledat']=_0x54f74e[_0x5f74('0x8')];this['type']=_0x54f74e[_0x5f74('0x9')];this[_0x5f74('0xa')]=_0x54f74e[_0x5f74('0x9')]===_0x5f74('0xb')?_0x5f74('0xc'):_0x54f74e[_0x5f74('0x9')];this[_0x5f74('0xd')]=_0x54f74e[_0x5f74('0xd')];this[_0x5f74('0xe')]=_0x54f74e['countcongestionretry'];this[_0x5f74('0xf')]=_0x54f74e[_0x5f74('0xf')];this[_0x5f74('0x10')]=_0x54f74e[_0x5f74('0xd')]+_0x54f74e[_0x5f74('0xe')]+_0x54f74e['countnoanswerretry']+_0x54f74e[_0x5f74('0x11')]+_0x54f74e['countdropretry']+_0x54f74e[_0x5f74('0x12')]+_0x54f74e[_0x5f74('0x13')]+_0x54f74e[_0x5f74('0x14')];this['countnosuchnumberretry']=_0x54f74e[_0x5f74('0x11')];this['countdropretry']=_0x54f74e['countdropretry'];this[_0x5f74('0x12')]=_0x54f74e[_0x5f74('0x12')];this[_0x5f74('0x13')]=_0x54f74e[_0x5f74('0x13')];this['countagentrejectretry']=_0x54f74e[_0x5f74('0x14')];this[_0x5f74('0x15')]=_0x10dd1f['uniqueid'];this[_0x5f74('0x16')]=_0x54f74e[_0x5f74('0x17')];this[_0x5f74('0x18')]=_0x54f74e['number'];this[_0x5f74('0x19')]=_0x54f74e[_0x5f74('0x19')];this[_0x5f74('0x1a')]=_0x54f74e[_0x5f74('0x1a')];this['answertime']=_0x54f74e[_0x5f74('0x1b')];this['endtime']=moment()[_0x5f74('0x1c')](_0x5f74('0x1d'));this[_0x5f74('0x1e')]=getSeconds(_0x54f74e[_0x5f74('0x1a')],_0x54f74e[_0x5f74('0x19')]);this[_0x5f74('0x1f')]=getSeconds(_0x54f74e[_0x5f74('0x1b')],_0x54f74e[_0x5f74('0x1a')]);this[_0x5f74('0x20')]=getSeconds(this[_0x5f74('0x21')],_0x54f74e[_0x5f74('0x1b')]);this[_0x5f74('0xc')]=_0x10dd1f['queue'];this[_0x5f74('0x22')]=_0x10dd1f[_0x5f74('0x22')];this[_0x5f74('0x23')]=_0x10dd1f[_0x5f74('0x23')];this[_0x5f74('0x24')]=_0x54f74e[_0x5f74('0x24')];this['callbackuniqueid']=_0x54f74e['callbackuniqueid'];this[_0x5f74('0x25')]=_0x54f74e['callbackat'];this['recallme']=_0x54f74e[_0x5f74('0x26')];this[_0x5f74('0x27')]=_0x54f74e[_0x5f74('0x27')];this['ListId']=_0x54f74e[_0x5f74('0x28')];this[_0x5f74('0x29')]=_0x54f74e[_0x5f74('0x29')];this[_0x5f74('0x2a')]=_0x54f74e[_0x5f74('0x2a')];this[_0x5f74('0x2b')]=_0x54f74e[_0x5f74('0x2b')];this['originatecalleridnum']=_0x54f74e[_0x5f74('0x2c')]||'';this[_0x5f74('0x2d')]=_0x54f74e[_0x5f74('0x2d')]||'';}module[_0x5f74('0x2e')]=AgentComplete;
\ No newline at end of file
+var _0xd773=['countabandonedretry','uniqueid','calleridname','name','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','queue','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry'];(function(_0x3f6362,_0x2b6a38){var _0x5071dc=function(_0x58c0a1){while(--_0x58c0a1){_0x3f6362['push'](_0x3f6362['shift']());}};_0x5071dc(++_0x2b6a38);}(_0xd773,0x1d9));var _0x3d77=function(_0x1be053,_0x3fb24e){_0x1be053=_0x1be053-0x0;var _0x472c75=_0xd773[_0x1be053];return _0x472c75;};'use strict';var util=require(_0x3d77('0x0'));var _=require(_0x3d77('0x1'));var moment=require(_0x3d77('0x2'));function getSeconds(_0x54679f,_0x41d374){var _0x43d8e0=moment(_0x54679f)[_0x3d77('0x3')](0x0);var _0x5dbf20=moment(_0x41d374)[_0x3d77('0x3')](0x0);return _0x43d8e0['diff'](_0x5dbf20,_0x3d77('0x4'));}function AgentComplete(_0x511e0c,_0xc18fe5){this[_0x3d77('0x5')]=0x4;this[_0x3d77('0x6')]=_0x3d77('0x7');this[_0x3d77('0x8')]=_0x511e0c[_0x3d77('0x8')];this[_0x3d77('0x9')]=_0x511e0c['type'];this[_0x3d77('0xa')]=_0x511e0c['type']==='outbound'?'queue':_0x511e0c[_0x3d77('0x9')];this['countbusyretry']=_0x511e0c['countbusyretry'];this['countcongestionretry']=_0x511e0c[_0x3d77('0xb')];this[_0x3d77('0xc')]=_0x511e0c[_0x3d77('0xc')];this[_0x3d77('0xd')]=_0x511e0c[_0x3d77('0xe')]+_0x511e0c['countcongestionretry']+_0x511e0c[_0x3d77('0xc')]+_0x511e0c[_0x3d77('0xf')]+_0x511e0c[_0x3d77('0x10')]+_0x511e0c['countabandonedretry']+_0x511e0c[_0x3d77('0x11')]+_0x511e0c[_0x3d77('0x12')];this[_0x3d77('0xf')]=_0x511e0c[_0x3d77('0xf')];this[_0x3d77('0x10')]=_0x511e0c[_0x3d77('0x10')];this[_0x3d77('0x13')]=_0x511e0c[_0x3d77('0x13')];this[_0x3d77('0x11')]=_0x511e0c[_0x3d77('0x11')];this[_0x3d77('0x12')]=_0x511e0c[_0x3d77('0x12')];this[_0x3d77('0x14')]=_0xc18fe5[_0x3d77('0x14')];this[_0x3d77('0x15')]=_0x511e0c[_0x3d77('0x16')];this['calleridnum']=_0x511e0c['number'];this[_0x3d77('0x17')]=_0x511e0c[_0x3d77('0x17')];this['responsetime']=_0x511e0c[_0x3d77('0x18')];this['answertime']=_0x511e0c[_0x3d77('0x19')];this[_0x3d77('0x1a')]=moment()[_0x3d77('0x1b')](_0x3d77('0x1c'));this['ringtime']=getSeconds(_0x511e0c['responsetime'],_0x511e0c['starttime']);this['holdtime']=getSeconds(_0x511e0c[_0x3d77('0x19')],_0x511e0c[_0x3d77('0x18')]);this['talktime']=getSeconds(this['endtime'],_0x511e0c[_0x3d77('0x19')]);this[_0x3d77('0x1d')]=_0xc18fe5[_0x3d77('0x1d')];this['membername']=_0xc18fe5[_0x3d77('0x1e')];this['reason']=_0xc18fe5['reason'];this[_0x3d77('0x1f')]=_0x511e0c[_0x3d77('0x1f')];this[_0x3d77('0x20')]=_0x511e0c[_0x3d77('0x20')];this['callbackat']=_0x511e0c[_0x3d77('0x21')];this[_0x3d77('0x22')]=_0x511e0c[_0x3d77('0x22')];this[_0x3d77('0x23')]=_0x511e0c[_0x3d77('0x23')];this['ListId']=_0x511e0c['ListId'];this[_0x3d77('0x24')]=_0x511e0c[_0x3d77('0x24')];this[_0x3d77('0x25')]=_0x511e0c[_0x3d77('0x25')];this[_0x3d77('0x26')]=_0x511e0c[_0x3d77('0x26')];this[_0x3d77('0x27')]=_0x511e0c[_0x3d77('0x27')]||'';this['originatecalleridname']=_0x511e0c['originatecalleridname']||'';}module[_0x3d77('0x28')]=AgentComplete;
\ No newline at end of file
diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js
index adb8c0e..f5fa954 100644
--- a/server/services/ami/dialer/final.js
+++ b/server/services/ami/dialer/final.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4cce=['countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4cb9d5,_0x187d5a){var _0x444523=function(_0x46497c){while(--_0x46497c){_0x4cb9d5['push'](_0x4cb9d5['shift']());}};_0x444523(++_0x187d5a);}(_0x4cce,0x16e));var _0xe4cc=function(_0x2ff2b8,_0x35a036){_0x2ff2b8=_0x2ff2b8-0x0;var _0x3d0b7e=_0x4cce[_0x2ff2b8];return _0x3d0b7e;};'use strict';var util=require(_0xe4cc('0x0'));var _=require(_0xe4cc('0x1'));var moment=require(_0xe4cc('0x2'));function getSeconds(_0x108f11,_0x2917d3){var _0x50c431=moment(_0x108f11)[_0xe4cc('0x3')](0x0);var _0x5c6364=moment(_0x2917d3)[_0xe4cc('0x3')](0x0);return _0x50c431[_0xe4cc('0x4')](_0x5c6364,_0xe4cc('0x5'));}function Final(_0x1ad8d2){this[_0xe4cc('0x6')]=_0x1ad8d2[_0xe4cc('0x6')];this[_0xe4cc('0x7')]=_0x1ad8d2[_0xe4cc('0x7')];this[_0xe4cc('0x8')]=_0x1ad8d2['type'];this[_0xe4cc('0x9')]=_0x1ad8d2[_0xe4cc('0x8')]===_0xe4cc('0xa')?'queue':_0x1ad8d2[_0xe4cc('0x8')];this[_0xe4cc('0xb')]=_0x1ad8d2[_0xe4cc('0xb')];this[_0xe4cc('0xc')]=_0x1ad8d2[_0xe4cc('0xc')];this[_0xe4cc('0xd')]=_0x1ad8d2[_0xe4cc('0xd')];this[_0xe4cc('0xe')]=_0x1ad8d2[_0xe4cc('0xb')]+_0x1ad8d2[_0xe4cc('0xc')]+_0x1ad8d2[_0xe4cc('0xd')]+_0x1ad8d2[_0xe4cc('0xf')]+_0x1ad8d2[_0xe4cc('0x10')]+_0x1ad8d2['countabandonedretry']+_0x1ad8d2[_0xe4cc('0x11')]+_0x1ad8d2[_0xe4cc('0x12')];this['countnosuchnumberretry']=_0x1ad8d2[_0xe4cc('0xf')];this[_0xe4cc('0x10')]=_0x1ad8d2[_0xe4cc('0x10')];this[_0xe4cc('0x13')]=_0x1ad8d2[_0xe4cc('0x13')];this[_0xe4cc('0x11')]=_0x1ad8d2[_0xe4cc('0x11')];this[_0xe4cc('0x12')]=_0x1ad8d2['countagentrejectretry'];this[_0xe4cc('0x14')]=_0x1ad8d2[_0xe4cc('0x14')];this[_0xe4cc('0x15')]=_0x1ad8d2[_0xe4cc('0x15')];this[_0xe4cc('0x16')]=_0x1ad8d2[_0xe4cc('0x16')];this[_0xe4cc('0x17')]=_0x1ad8d2['starttime'];this[_0xe4cc('0x18')]=_0x1ad8d2[_0xe4cc('0x18')];this['endtime']=_0x1ad8d2['responsetime'];this[_0xe4cc('0x19')]=_0x1ad8d2[_0xe4cc('0x19')]||0x0;this[_0xe4cc('0x1a')]=_0x1ad8d2['holdtime']||0x0;this[_0xe4cc('0x1b')]=_0x1ad8d2[_0xe4cc('0x1b')]||0x0;this['callback']=_0x1ad8d2[_0xe4cc('0x1c')];this[_0xe4cc('0x1d')]=_0x1ad8d2[_0xe4cc('0x1d')];this[_0xe4cc('0x1e')]=_0x1ad8d2[_0xe4cc('0x1e')];this['recallme']=_0x1ad8d2['recallme'];this[_0xe4cc('0x1f')]=_0x1ad8d2[_0xe4cc('0x1f')];this[_0xe4cc('0x20')]=_0x1ad8d2['ListId'];this['UserId']=_0x1ad8d2[_0xe4cc('0x21')];this['VoiceQueueId']=_0x1ad8d2[_0xe4cc('0x22')];this[_0xe4cc('0x23')]=_0x1ad8d2[_0xe4cc('0x23')];this[_0xe4cc('0x24')]=_0x1ad8d2[_0xe4cc('0x24')]||'';this['originatecalleridname']=_0x1ad8d2[_0xe4cc('0x25')]||'';}module['exports']=Final;
\ No newline at end of file
+var _0xc062=['countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry'];(function(_0x297e52,_0x13d894){var _0x5a7628=function(_0x351c6c){while(--_0x351c6c){_0x297e52['push'](_0x297e52['shift']());}};_0x5a7628(++_0x13d894);}(_0xc062,0x7f));var _0x2c06=function(_0x17b5a0,_0x1e3579){_0x17b5a0=_0x17b5a0-0x0;var _0x19f7ca=_0xc062[_0x17b5a0];return _0x19f7ca;};'use strict';var util=require(_0x2c06('0x0'));var _=require(_0x2c06('0x1'));var moment=require('moment');function getSeconds(_0x1c9176,_0xcfab66){var _0x410bb8=moment(_0x1c9176)[_0x2c06('0x2')](0x0);var _0x22d7bb=moment(_0xcfab66)[_0x2c06('0x2')](0x0);return _0x410bb8[_0x2c06('0x3')](_0x22d7bb,'seconds');}function Final(_0x3ec436){this[_0x2c06('0x4')]=_0x3ec436[_0x2c06('0x4')];this[_0x2c06('0x5')]=_0x3ec436['scheduledat'];this[_0x2c06('0x6')]=_0x3ec436[_0x2c06('0x6')];this['campaigntype']=_0x3ec436[_0x2c06('0x6')]===_0x2c06('0x7')?_0x2c06('0x8'):_0x3ec436[_0x2c06('0x6')];this['countbusyretry']=_0x3ec436[_0x2c06('0x9')];this[_0x2c06('0xa')]=_0x3ec436[_0x2c06('0xa')];this['countnoanswerretry']=_0x3ec436['countnoanswerretry'];this[_0x2c06('0xb')]=_0x3ec436[_0x2c06('0x9')]+_0x3ec436[_0x2c06('0xa')]+_0x3ec436['countnoanswerretry']+_0x3ec436[_0x2c06('0xc')]+_0x3ec436['countdropretry']+_0x3ec436[_0x2c06('0xd')]+_0x3ec436['countmachineretry']+_0x3ec436['countagentrejectretry'];this[_0x2c06('0xc')]=_0x3ec436['countnosuchnumberretry'];this['countdropretry']=_0x3ec436['countdropretry'];this[_0x2c06('0xd')]=_0x3ec436[_0x2c06('0xd')];this[_0x2c06('0xe')]=_0x3ec436[_0x2c06('0xe')];this['countagentrejectretry']=_0x3ec436[_0x2c06('0xf')];this[_0x2c06('0x8')]=_0x3ec436['queue'];this['calleridname']=_0x3ec436[_0x2c06('0x10')];this[_0x2c06('0x11')]=_0x3ec436[_0x2c06('0x11')];this[_0x2c06('0x12')]=_0x3ec436[_0x2c06('0x12')];this[_0x2c06('0x13')]=_0x3ec436[_0x2c06('0x13')];this['endtime']=_0x3ec436[_0x2c06('0x13')];this[_0x2c06('0x14')]=_0x3ec436[_0x2c06('0x14')]||0x0;this[_0x2c06('0x15')]=_0x3ec436['holdtime']||0x0;this[_0x2c06('0x16')]=_0x3ec436[_0x2c06('0x16')]||0x0;this[_0x2c06('0x17')]=_0x3ec436['callback'];this['callbackuniqueid']=_0x3ec436[_0x2c06('0x18')];this['callbackat']=_0x3ec436[_0x2c06('0x19')];this[_0x2c06('0x1a')]=_0x3ec436['recallme'];this['ContactId']=_0x3ec436[_0x2c06('0x1b')];this[_0x2c06('0x1c')]=_0x3ec436[_0x2c06('0x1c')];this[_0x2c06('0x1d')]=_0x3ec436[_0x2c06('0x1d')];this[_0x2c06('0x1e')]=_0x3ec436[_0x2c06('0x1e')];this[_0x2c06('0x1f')]=_0x3ec436[_0x2c06('0x1f')];this['originatecalleridnum']=_0x3ec436[_0x2c06('0x20')]||'';this[_0x2c06('0x21')]=_0x3ec436[_0x2c06('0x21')]||'';}module[_0x2c06('0x22')]=Final;
\ No newline at end of file
diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js
index efbfeae..e112cf3 100644
--- a/server/services/ami/dialer/hangup.js
+++ b/server/services/ami/dialer/hangup.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1055=['callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','membername','reason','cause-txt','callback'];(function(_0x5b55ae,_0x1fe5d4){var _0x247129=function(_0x1ea3d9){while(--_0x1ea3d9){_0x5b55ae['push'](_0x5b55ae['shift']());}};_0x247129(++_0x1fe5d4);}(_0x1055,0xe4));var _0x5105=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x1055[_0x3cb6dc];return _0x47ec89;};'use strict';var util=require(_0x5105('0x0'));var _=require('lodash');var moment=require(_0x5105('0x1'));function getSeconds(_0x340357,_0x210361){var _0x4da78f=moment(_0x340357)[_0x5105('0x2')](0x0);var _0x4b20bc=moment(_0x210361)[_0x5105('0x2')](0x0);return _0x4da78f[_0x5105('0x3')](_0x4b20bc,_0x5105('0x4'));}function Hangup(_0x113c95,_0x4541a0){this[_0x5105('0x5')]=0x4;this[_0x5105('0x6')]=_0x5105('0x7');this[_0x5105('0x8')]=_0x113c95[_0x5105('0x8')];this[_0x5105('0x9')]=_0x113c95['type'];this[_0x5105('0xa')]=_0x113c95['type']===_0x5105('0xb')?_0x5105('0xc'):_0x113c95[_0x5105('0x9')];this[_0x5105('0xd')]=_0x113c95[_0x5105('0xd')];this[_0x5105('0xe')]=_0x113c95[_0x5105('0xe')];this[_0x5105('0xf')]=_0x113c95[_0x5105('0xf')];this[_0x5105('0x10')]=_0x113c95[_0x5105('0xd')]+_0x113c95[_0x5105('0xe')]+_0x113c95[_0x5105('0xf')]+_0x113c95[_0x5105('0x11')]+_0x113c95['countdropretry']+_0x113c95['countabandonedretry']+_0x113c95[_0x5105('0x12')]+_0x113c95[_0x5105('0x13')];this[_0x5105('0x11')]=_0x113c95['countnosuchnumberretry'];this[_0x5105('0x14')]=_0x113c95[_0x5105('0x14')];this[_0x5105('0x15')]=_0x113c95[_0x5105('0x15')];this[_0x5105('0x12')]=_0x113c95[_0x5105('0x12')];this['countagentrejectretry']=_0x113c95['countagentrejectretry'];this['uniqueid']=_0x4541a0[_0x5105('0x16')];this['calleridname']=_0x113c95[_0x5105('0x17')];this[_0x5105('0x18')]=_0x113c95[_0x5105('0x19')];this[_0x5105('0x1a')]=_0x113c95[_0x5105('0x1a')];this[_0x5105('0x1b')]=_0x113c95['responsetime'];this[_0x5105('0x1c')]=moment()[_0x5105('0x1d')](_0x5105('0x1e'));this['ringtime']=getSeconds(_0x113c95[_0x5105('0x1b')],_0x113c95[_0x5105('0x1a')]);this[_0x5105('0x1f')]=0x0;this['talktime']=getSeconds(this[_0x5105('0x1c')],_0x113c95[_0x5105('0x1b')]);this[_0x5105('0xc')]=_0x113c95['queue'];this[_0x5105('0x20')]='IVR';this[_0x5105('0x21')]=_0x4541a0[_0x5105('0x22')];this[_0x5105('0x23')]=_0x113c95['callback'];this['callbackuniqueid']=_0x113c95[_0x5105('0x24')];this['callbackat']=_0x113c95[_0x5105('0x25')];this[_0x5105('0x26')]=_0x113c95[_0x5105('0x26')];this[_0x5105('0x27')]=_0x113c95[_0x5105('0x27')];this[_0x5105('0x28')]=_0x113c95['ListId'];this['UserId']=_0x113c95['UserId'];this[_0x5105('0x29')]=_0x113c95[_0x5105('0x29')];this[_0x5105('0x2a')]=_0x113c95[_0x5105('0x2a')];}module[_0x5105('0x2b')]=Hangup;
\ No newline at end of file
+var _0x9255=['callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','diff','statedesc','scheduledat','campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','cause-txt','callback'];(function(_0x1ee0a1,_0x51058e){var _0x1d2d5b=function(_0x35cfb5){while(--_0x35cfb5){_0x1ee0a1['push'](_0x1ee0a1['shift']());}};_0x1d2d5b(++_0x51058e);}(_0x9255,0x1cb));var _0x5925=function(_0x2cdf5b,_0xd7fc9e){_0x2cdf5b=_0x2cdf5b-0x0;var _0x393369=_0x9255[_0x2cdf5b];return _0x393369;};'use strict';var util=require(_0x5925('0x0'));var _=require(_0x5925('0x1'));var moment=require('moment');function getSeconds(_0x24114a,_0x1d93f8){var _0x27244c=moment(_0x24114a)[_0x5925('0x2')](0x0);var _0x58a977=moment(_0x1d93f8)[_0x5925('0x2')](0x0);return _0x27244c[_0x5925('0x3')](_0x58a977,'seconds');}function Hangup(_0x1cb215,_0x3ee30c){this['state']=0x4;this[_0x5925('0x4')]='Answer';this[_0x5925('0x5')]=_0x1cb215[_0x5925('0x5')];this['type']=_0x1cb215['type'];this[_0x5925('0x6')]=_0x1cb215['type']===_0x5925('0x7')?_0x5925('0x8'):_0x1cb215[_0x5925('0x9')];this[_0x5925('0xa')]=_0x1cb215[_0x5925('0xa')];this[_0x5925('0xb')]=_0x1cb215[_0x5925('0xb')];this['countnoanswerretry']=_0x1cb215[_0x5925('0xc')];this[_0x5925('0xd')]=_0x1cb215['countbusyretry']+_0x1cb215[_0x5925('0xb')]+_0x1cb215[_0x5925('0xc')]+_0x1cb215[_0x5925('0xe')]+_0x1cb215[_0x5925('0xf')]+_0x1cb215[_0x5925('0x10')]+_0x1cb215[_0x5925('0x11')]+_0x1cb215['countagentrejectretry'];this[_0x5925('0xe')]=_0x1cb215[_0x5925('0xe')];this[_0x5925('0xf')]=_0x1cb215['countdropretry'];this[_0x5925('0x10')]=_0x1cb215[_0x5925('0x10')];this['countmachineretry']=_0x1cb215[_0x5925('0x11')];this['countagentrejectretry']=_0x1cb215[_0x5925('0x12')];this[_0x5925('0x13')]=_0x3ee30c['uniqueid'];this['calleridname']=_0x1cb215[_0x5925('0x14')];this[_0x5925('0x15')]=_0x1cb215[_0x5925('0x16')];this[_0x5925('0x17')]=_0x1cb215[_0x5925('0x17')];this[_0x5925('0x18')]=_0x1cb215[_0x5925('0x18')];this[_0x5925('0x19')]=moment()['format'](_0x5925('0x1a'));this[_0x5925('0x1b')]=getSeconds(_0x1cb215[_0x5925('0x18')],_0x1cb215['starttime']);this[_0x5925('0x1c')]=0x0;this[_0x5925('0x1d')]=getSeconds(this['endtime'],_0x1cb215['responsetime']);this[_0x5925('0x8')]=_0x1cb215['queue'];this[_0x5925('0x1e')]='IVR';this['reason']=_0x3ee30c[_0x5925('0x1f')];this[_0x5925('0x20')]=_0x1cb215['callback'];this['callbackuniqueid']=_0x1cb215[_0x5925('0x21')];this['callbackat']=_0x1cb215[_0x5925('0x22')];this[_0x5925('0x23')]=_0x1cb215[_0x5925('0x23')];this['ContactId']=_0x1cb215['ContactId'];this[_0x5925('0x24')]=_0x1cb215[_0x5925('0x24')];this[_0x5925('0x25')]=_0x1cb215['UserId'];this[_0x5925('0x26')]=_0x1cb215[_0x5925('0x26')];this[_0x5925('0x27')]=_0x1cb215[_0x5925('0x27')];}module[_0x5925('0x28')]=Hangup;
\ No newline at end of file
diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js
index 6b00ceb..f3bef20 100644
--- a/server/services/ami/dialer/history.js
+++ b/server/services/ami/dialer/history.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0eec=['uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff'];(function(_0x3259eb,_0x297dad){var _0x100d07=function(_0x56bce1){while(--_0x56bce1){_0x3259eb['push'](_0x3259eb['shift']());}};_0x100d07(++_0x297dad);}(_0x0eec,0xac));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xc0ee('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x30bcf3,_0x1eb788){var _0x460e72=moment(_0x30bcf3)[_0xc0ee('0x1')](0x0);var _0xf8033b=moment(_0x1eb788)[_0xc0ee('0x1')](0x0);return _0x460e72[_0xc0ee('0x2')](_0xf8033b,'seconds');}function History(_0x10ab80){this['uniqueid']=_0x10ab80[_0xc0ee('0x3')];this[_0xc0ee('0x4')]=_0x10ab80[_0xc0ee('0x4')]||undefined;this[_0xc0ee('0x5')]=_0x10ab80[_0xc0ee('0x5')];this[_0xc0ee('0x6')]=_0x10ab80[_0xc0ee('0x5')]==='outbound'?_0xc0ee('0x7'):_0x10ab80[_0xc0ee('0x5')];this[_0xc0ee('0x8')]=_0x10ab80[_0xc0ee('0x8')];this[_0xc0ee('0x9')]=_0x10ab80[_0xc0ee('0x9')];this[_0xc0ee('0xa')]=_0x10ab80['countnoanswerretry'];this[_0xc0ee('0xb')]=_0x10ab80[_0xc0ee('0x8')]+_0x10ab80[_0xc0ee('0x9')]+_0x10ab80[_0xc0ee('0xa')]+_0x10ab80[_0xc0ee('0xc')]+_0x10ab80[_0xc0ee('0xd')]+_0x10ab80[_0xc0ee('0xe')]+_0x10ab80[_0xc0ee('0xf')]+_0x10ab80[_0xc0ee('0x10')];this['countnosuchnumberretry']=_0x10ab80['countnosuchnumberretry'];this[_0xc0ee('0xd')]=_0x10ab80[_0xc0ee('0xd')];this[_0xc0ee('0xe')]=_0x10ab80['countabandonedretry'];this[_0xc0ee('0xf')]=_0x10ab80[_0xc0ee('0xf')];this[_0xc0ee('0x10')]=_0x10ab80['countagentrejectretry'];this['queue']=_0x10ab80[_0xc0ee('0x7')];this['calleridname']=_0x10ab80[_0xc0ee('0x11')];this[_0xc0ee('0x12')]=_0x10ab80[_0xc0ee('0x13')];this['starttime']=_0x10ab80['starttime'];this[_0xc0ee('0x14')]=_0x10ab80[_0xc0ee('0x14')];this[_0xc0ee('0x15')]=_0x10ab80['responsetime'];this[_0xc0ee('0x16')]=getSeconds(_0x10ab80[_0xc0ee('0x14')],_0x10ab80['starttime']);this['holdtime']=0x0;this[_0xc0ee('0x17')]=0x0;this[_0xc0ee('0x18')]=_0x10ab80['callback'];this[_0xc0ee('0x19')]=_0x10ab80[_0xc0ee('0x19')];this[_0xc0ee('0x1a')]=_0x10ab80['callbackat'];this['recallme']=_0x10ab80['recallme'];this[_0xc0ee('0x1b')]=_0x10ab80[_0xc0ee('0x1b')];this['ListId']=_0x10ab80[_0xc0ee('0x1c')];this[_0xc0ee('0x1d')]=_0x10ab80[_0xc0ee('0x1d')];this[_0xc0ee('0x1e')]=_0x10ab80[_0xc0ee('0x1e')];this[_0xc0ee('0x1f')]=_0x10ab80[_0xc0ee('0x1f')];this[_0xc0ee('0x20')]=_0x10ab80[_0xc0ee('0x20')]||'';this[_0xc0ee('0x21')]=_0x10ab80[_0xc0ee('0x21')]||'';}module[_0xc0ee('0x22')]=History;
\ No newline at end of file
+var _0x4814=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','calleridname','name','calleridnum','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid'];(function(_0xff693a,_0x50bf9f){var _0x484af0=function(_0x4e2d19){while(--_0x4e2d19){_0xff693a['push'](_0xff693a['shift']());}};_0x484af0(++_0x50bf9f);}(_0x4814,0xde));var _0x4481=function(_0x529587,_0x7b9e47){_0x529587=_0x529587-0x0;var _0x4ea039=_0x4814[_0x529587];return _0x4ea039;};'use strict';var util=require(_0x4481('0x0'));var _=require(_0x4481('0x1'));var moment=require(_0x4481('0x2'));function getSeconds(_0x53e749,_0x41d646){var _0xa76fbe=moment(_0x53e749)[_0x4481('0x3')](0x0);var _0x244e9e=moment(_0x41d646)['milliseconds'](0x0);return _0xa76fbe['diff'](_0x244e9e,_0x4481('0x4'));}function History(_0x216dec){this['uniqueid']=_0x216dec[_0x4481('0x5')];this[_0x4481('0x6')]=_0x216dec[_0x4481('0x6')]||undefined;this[_0x4481('0x7')]=_0x216dec[_0x4481('0x7')];this[_0x4481('0x8')]=_0x216dec[_0x4481('0x7')]==='outbound'?_0x4481('0x9'):_0x216dec[_0x4481('0x7')];this['countbusyretry']=_0x216dec[_0x4481('0xa')];this[_0x4481('0xb')]=_0x216dec['countcongestionretry'];this[_0x4481('0xc')]=_0x216dec[_0x4481('0xc')];this[_0x4481('0xd')]=_0x216dec[_0x4481('0xa')]+_0x216dec[_0x4481('0xb')]+_0x216dec[_0x4481('0xc')]+_0x216dec[_0x4481('0xe')]+_0x216dec[_0x4481('0xf')]+_0x216dec['countabandonedretry']+_0x216dec['countmachineretry']+_0x216dec[_0x4481('0x10')];this[_0x4481('0xe')]=_0x216dec[_0x4481('0xe')];this[_0x4481('0xf')]=_0x216dec[_0x4481('0xf')];this['countabandonedretry']=_0x216dec[_0x4481('0x11')];this['countmachineretry']=_0x216dec[_0x4481('0x12')];this['countagentrejectretry']=_0x216dec[_0x4481('0x10')];this[_0x4481('0x9')]=_0x216dec[_0x4481('0x9')];this[_0x4481('0x13')]=_0x216dec[_0x4481('0x14')];this[_0x4481('0x15')]=_0x216dec['number'];this[_0x4481('0x16')]=_0x216dec['starttime'];this[_0x4481('0x17')]=_0x216dec[_0x4481('0x17')];this['endtime']=_0x216dec[_0x4481('0x17')];this[_0x4481('0x18')]=getSeconds(_0x216dec[_0x4481('0x17')],_0x216dec[_0x4481('0x16')]);this['holdtime']=0x0;this[_0x4481('0x19')]=0x0;this['callback']=_0x216dec[_0x4481('0x1a')];this[_0x4481('0x1b')]=_0x216dec[_0x4481('0x1b')];this[_0x4481('0x1c')]=_0x216dec['callbackat'];this['recallme']=_0x216dec[_0x4481('0x1d')];this['ContactId']=_0x216dec[_0x4481('0x1e')];this['ListId']=_0x216dec[_0x4481('0x1f')];this[_0x4481('0x20')]=_0x216dec[_0x4481('0x20')];this[_0x4481('0x21')]=_0x216dec[_0x4481('0x21')];this[_0x4481('0x22')]=_0x216dec['CampaignId'];this['originatecalleridnum']=_0x216dec[_0x4481('0x23')]||'';this[_0x4481('0x24')]=_0x216dec[_0x4481('0x24')]||'';}module[_0x4481('0x25')]=History;
\ No newline at end of file
diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js
index e31b793..082d4e9 100644
--- a/server/services/ami/dialer/index.js
+++ b/server/services/ami/dialer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf80=['[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','content','true','indexOf','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','emit','custom:agentnosuchnumber','buildObj','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','stateGlobal','outboundAbandonedCallsDay','custom:agentreject','dialAgentRejectMaxRetry','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','log','Contact\x20updated','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','BLACKLIST','[Originate][historyBlacklist]','temp','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','Contact.phone','[handlePredictive][limitChannel]','tryOriginatePredictive','reachable','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','bluebird','uuid','moment','md5','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','milliseconds','seconds','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','waiting','dialActive','dialMethod','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangBusyFactor','startPredictive','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','hasOwnProperty','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','prototype','loopClearZombieChannels','[uniqueid]','clearZombieChannels','[actions]','enqueue','isNil','Action','status','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','merge','pick','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','unmonitored','uniqueid','variable','exten','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','dialGlobalMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','CampaignId','[rescheduleContact][Machine]','countcongestionretry','countnoanswerretry','countagentrejectretry','dialMachineMaxRetry','createStateFinal','add','ivrAnswerCallsDay','AnswerAGI','AGI','[syncHangupIvr][createHistory]','dialQueueProject','cause-txt','Unknow','[syncHangupIvr]','syncAgentComplete','reason','agent','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','dialQueueProject2','countdropretry','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','Abandoned','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridnum'];(function(_0x1b3f8b,_0x15783c){var _0x22b1d5=function(_0x359d99){while(--_0x359d99){_0x1b3f8b['push'](_0x1b3f8b['shift']());}};_0x22b1d5(++_0x15783c);}(_0xcf80,0xf1));var _0x0cf8=function(_0x28d5df,_0x3f2cac){_0x28d5df=_0x28d5df-0x0;var _0x1d84fc=_0xcf80[_0x28d5df];return _0x1d84fc;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x0cf8('0x0'));var uuid=require(_0x0cf8('0x1'));var moment=require(_0x0cf8('0x2'));var rr=require('rr');var md5=require(_0x0cf8('0x3'));var Redis=require(_0x0cf8('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x0cf8('0x5'))(_0x0cf8('0x6'));var loggerBooked=require(_0x0cf8('0x5'))(_0x0cf8('0x7'));var loggerPredictive=require(_0x0cf8('0x5'))(_0x0cf8('0x8'));var loggerPredictiveCalls=require(_0x0cf8('0x5'))(_0x0cf8('0x9'));var loggerSyncQueueSummary=require(_0x0cf8('0x5'))(_0x0cf8('0xa'));var ami=require(_0x0cf8('0xb'));config[_0x0cf8('0xc')]=_[_0x0cf8('0xd')](config[_0x0cf8('0xc')],{'host':_0x0cf8('0xe'),'port':0x18eb});var io=require(_0x0cf8('0xf'))(new Redis(config[_0x0cf8('0xc')]));var cmHopper=require(_0x0cf8('0x10'));var cmHopperFinal=require(_0x0cf8('0x11'));var cmHopperHistory=require(_0x0cf8('0x12'));var cmHopperBlack=require(_0x0cf8('0x13'));var voiceQueueRt=require(_0x0cf8('0x14'));var Action=require(_0x0cf8('0x15'));var History=require(_0x0cf8('0x16'));var Final=require(_0x0cf8('0x17'));var AgentComplete=require(_0x0cf8('0x18'));var QueueCallerAbandon=require(_0x0cf8('0x19'));var Hangup=require(_0x0cf8('0x1a'));var ipAgi=process[_0x0cf8('0x1b')][_0x0cf8('0x1c')]||_0x0cf8('0x1d');var strategy={'rrmemory':_0x0cf8('0x1e'),'roundrobin':_0x0cf8('0x1f')};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x53fb67){this[_0x0cf8('0x20')]=this['tail']?this['tail'][_0x0cf8('0x21')](_0x53fb67):_0x53fb67();};function Dialer(_0x43a8c9,_0x43826d){this[_0x0cf8('0x22')]=new Sequence();this[_0x0cf8('0x23')]=_0x43826d;this[_0x0cf8('0x24')]=_0x43a8c9[_0x0cf8('0x24')];this[_0x0cf8('0x25')]=_0x43a8c9['campaigns'];this[_0x0cf8('0x26')]=_0x43a8c9[_0x0cf8('0x26')];this[_0x0cf8('0x27')]=_0x43a8c9[_0x0cf8('0x27')];this['maxNumberOriginate']=config[_0x0cf8('0x28')]||0x2;this[_0x0cf8('0x29')]={};this[_0x0cf8('0x2a')]={};this[_0x0cf8('0x2b')]={};this[_0x0cf8('0x2c')]={};this[_0x0cf8('0x2d')]={};this['startPredictive']={};this[_0x0cf8('0x2e')]={};this[_0x0cf8('0x2f')]={};this[_0x0cf8('0x30')]={};this[_0x0cf8('0x31')]={};ami['on'](_0x0cf8('0x32'),this[_0x0cf8('0x33')][_0x0cf8('0x34')](this));ami['on'](_0x0cf8('0x35'),this[_0x0cf8('0x36')]['bind'](this));ami['on'](_0x0cf8('0x37'),this[_0x0cf8('0x38')]['bind'](this));ami['on'](_0x0cf8('0x39'),this['syncAgentComplete']['bind'](this));ami['on'](_0x0cf8('0x3a'),this[_0x0cf8('0xa')][_0x0cf8('0x34')](this));ami['on'](_0x0cf8('0x3b'),this[_0x0cf8('0x3c')][_0x0cf8('0x34')](this));ami['on'](_0x0cf8('0x3d'),this[_0x0cf8('0x3e')][_0x0cf8('0x34')](this));ami['on']('varset',this[_0x0cf8('0x3f')][_0x0cf8('0x34')](this));ami['on']('queuemember',this[_0x0cf8('0x40')][_0x0cf8('0x34')](this));ami['on'](_0x0cf8('0x41'),this[_0x0cf8('0x42')][_0x0cf8('0x34')](this));this[_0x0cf8('0x43')]();this['loopClearZombieChannels']();}function isNotNull(_0xb6678f){return _0xb6678f!==null&&!_[_0x0cf8('0x44')](_0xb6678f);}function checkIsLoggedIn(_0x4f0120,_0x5b153c){return function(){if(_0x5b153c<=0x0){_0x4f0120['message']='AGENTS_NOT_LOGGED';throw _0x4f0120[_0x0cf8('0x45')]+_0x0cf8('0x46');}};}function isActive(_0x460ecb){return _0x460ecb;}function checkIsActive(_0x241102,_0x5371e6){return function(){if(!isActive(_0x5371e6)){_0x241102['message']=_0x0cf8('0x47');throw _0x241102[_0x0cf8('0x45')]+_0x0cf8('0x48');}};}function checkInterval(_0x668eb8){return function(){if(!isNotNull(_0x668eb8[_0x0cf8('0x49')])){_0x668eb8[_0x0cf8('0x4a')]=_0x0cf8('0x4b');throw _0x668eb8[_0x0cf8('0x45')]+_0x0cf8('0x4c');}if(!isNotNull(_0x668eb8[_0x0cf8('0x49')][_0x0cf8('0x4d')])){_0x668eb8[_0x0cf8('0x4a')]='INTERVAL_IS_NULL';throw _0x668eb8[_0x0cf8('0x45')]+_0x0cf8('0x4c');}if(!isNotNull(_[_0x0cf8('0x4e')](_0x668eb8[_0x0cf8('0x49')][_0x0cf8('0x4d')]))){_0x668eb8['message']=_0x0cf8('0x4b');throw _0x668eb8[_0x0cf8('0x45')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x3a0ca5,_0x5121a0,_0x2d931f){return{'action':_0x3a0ca5,'response':_0x5121a0,'message':_0x2d931f,'stack':_0x2d931f};}function myreject(_0x16f2a9){return function(_0x2760db){return _0x16f2a9(msgResponse(_0x0cf8('0x4f'),'Error',JSON['stringify'](_0x2760db)));};}function getSeconds(_0x2420d7,_0x2d0a39){var _0xfa445a=moment(_0x2420d7)[_0x0cf8('0x50')](0x0);var _0x5a95a3=moment(_0x2d0a39)[_0x0cf8('0x50')](0x0);return _0xfa445a['diff'](_0x5a95a3,_0x0cf8('0x51'));}function emit(_0x57677d,_0xc69ae5,_0x600072){io['to'](_0x57677d)['emit'](_0xc69ae5,_0x600072);}function emitVoiceQueueSummary(_0x21ea41){if(_0x21ea41[_0x0cf8('0x52')]===_0x0cf8('0x53')){var _0x4a18d9={'id':_0x21ea41['id'],'name':_0x21ea41[_0x0cf8('0x45')],'strategy':_0x21ea41[_0x0cf8('0x54')],'answered':_0x21ea41['answered'],'available':_0x21ea41[_0x0cf8('0x55')],'loggedIn':_0x21ea41[_0x0cf8('0x56')],'pTalking':_0x21ea41[_0x0cf8('0x57')],'sumBillable':_0x21ea41[_0x0cf8('0x58')],'sumDuration':_0x21ea41[_0x0cf8('0x59')],'sumHoldTime':_0x21ea41['sumHoldTime']||0x0,'talking':_0x21ea41[_0x0cf8('0x5a')],'total':_0x21ea41['total'],'type':_0x21ea41[_0x0cf8('0x52')],'unmanaged':_0x21ea41[_0x0cf8('0x5b')],'abandoned':_0x21ea41['abandoned'],'waiting':_0x21ea41[_0x0cf8('0x5c')],'loggedInDb':_0x21ea41['loggedInDb'],'dialActive':_0x21ea41[_0x0cf8('0x5d')],'dialMethod':_0x21ea41[_0x0cf8('0x5e')],'dialOriginateCallerIdName':_0x21ea41['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x21ea41['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x21ea41[_0x0cf8('0x5f')],'dialPrefix':_0x21ea41['dialPrefix'],'outboundAnswerAgiCallsDay':_0x21ea41[_0x0cf8('0x60')],'outboundAnswerCallsDay':_0x21ea41[_0x0cf8('0x61')],'outboundBlacklistCallsDay':_0x21ea41[_0x0cf8('0x62')],'outboundBusyCallsDay':_0x21ea41[_0x0cf8('0x63')],'outboundCongestionCallsDay':_0x21ea41[_0x0cf8('0x64')],'outboundDropCallsDayACS':_0x21ea41[_0x0cf8('0x65')],'outboundDropCallsDayCallersExit':_0x21ea41[_0x0cf8('0x66')],'outboundDropCallsDayTimeout':_0x21ea41[_0x0cf8('0x67')],'outboundNoAnswerCallsDay':_0x21ea41[_0x0cf8('0x68')],'outboundNoSuchCallsDay':_0x21ea41[_0x0cf8('0x69')],'outboundOriginateFailureCallsDay':_0x21ea41['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x21ea41['outboundReCallsDay'],'outboundRejectCallsDay':_0x21ea41[_0x0cf8('0x6a')],'outboundUnknownCallsDay':_0x21ea41[_0x0cf8('0x6b')],'predictiveIntervalAnsweredCalls':_0x21ea41[_0x0cf8('0x6c')],'predictiveIntervalAvgHoldtime':_0x21ea41[_0x0cf8('0x6d')],'predictiveIntervalAvgTalktime':_0x21ea41[_0x0cf8('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x21ea41[_0x0cf8('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x21ea41[_0x0cf8('0x70')],'predictiveIntervalErlangCalls':_0x21ea41[_0x0cf8('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x21ea41['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x21ea41[_0x0cf8('0x72')],'predictiveIntervalMultiplicativeFactor':_0x21ea41[_0x0cf8('0x73')],'predictiveIntervalPauses':_0x21ea41[_0x0cf8('0x74')],'predictiveIntervalAvailable':_0x21ea41[_0x0cf8('0x75')],'predictiveIntervalTotalCalls':_0x21ea41[_0x0cf8('0x76')],'message':_0x21ea41[_0x0cf8('0x4a')],'originated':_0x21ea41['originated'],'erlangCalls':_0x21ea41[_0x0cf8('0x77')],'erlangCallToSecond':_0x21ea41['erlangCallToSecond'],'erlangAbandonmentRate':_0x21ea41['erlangAbandonmentRate'],'erlangBusyFactor':_0x21ea41[_0x0cf8('0x78')],'startPredictive':_0x21ea41[_0x0cf8('0x79')],'startProgressive':_0x21ea41[_0x0cf8('0x2e')]};if(_0x21ea41['Trunk']){_0x4a18d9[_0x0cf8('0x7a')]={'id':_0x21ea41[_0x0cf8('0x7a')]['id'],'name':_0x21ea41['Trunk'][_0x0cf8('0x45')],'active':_0x21ea41[_0x0cf8('0x7a')][_0x0cf8('0x7b')],'callerid':_0x21ea41[_0x0cf8('0x7a')][_0x0cf8('0x7c')]};}if(_0x21ea41[_0x0cf8('0x49')]){_0x4a18d9[_0x0cf8('0x49')]={'id':_0x21ea41['Interval']['id'],'name':_0x21ea41[_0x0cf8('0x49')][_0x0cf8('0x45')]};}var _0x585d72=md5(JSON[_0x0cf8('0x7d')](_0x4a18d9));if(_0x21ea41[_0x0cf8('0x3')]!==_0x585d72){_0x21ea41[_0x0cf8('0x3')]=_0x585d72;emit(util[_0x0cf8('0x7e')](_0x0cf8('0x7f'),_0x4a18d9[_0x0cf8('0x45')]),_0x0cf8('0x80'),_0x4a18d9);}}}function emitCampaignSummary(_0x146684){if(_0x146684[_0x0cf8('0x52')]==='ivr'){emit(util[_0x0cf8('0x7e')]('campaign:ivr:%s',_0x146684[_0x0cf8('0x45')]),_0x0cf8('0x81'),_0x146684);}}function checkGetDataPredictive(_0x3984fb){if(isNotNull(_0x3984fb)){if(!_[_0x0cf8('0x4e')](_0x3984fb)){loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x83'));loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x84'),_0x3984fb['predictiveIntervalTotalCalls']);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x85'),_0x3984fb[_0x0cf8('0x6c')]);loggerPredictive[_0x0cf8('0x82')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3984fb['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3984fb[_0x0cf8('0x6f')]);loggerPredictive['info'](_0x0cf8('0x86'),_0x3984fb[_0x0cf8('0x6d')]);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x87'),_0x3984fb[_0x0cf8('0x6e')]);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x88'));if(_0x3984fb['predictiveIntervalTotalCalls']>0x0){if(!_[_0x0cf8('0x44')](_0x3984fb[_0x0cf8('0x6e')])&&_0x3984fb['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x89'));}if(!_[_0x0cf8('0x44')](_0x3984fb['predictiveIntervalAvgHoldtime'])&&_0x3984fb[_0x0cf8('0x6d')]>0x0){return!![];}else{loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x8a'));}}else{loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x8b'));}}else{loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x8c'));}}else{loggerPredictive['info'](_0x0cf8('0x8c'));}return![];}function mergeDataErlangB(_0x6795e8){return function(_0x33d1c4){loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x8d'));loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x8e'),_0x33d1c4['erlangCalls']);loggerPredictive['info'](_0x0cf8('0x8f'),_0x33d1c4[_0x0cf8('0x90')]);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x91'),_0x33d1c4[_0x0cf8('0x92')]);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x93'),_0x33d1c4[_0x0cf8('0x78')]);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x91'),_0x33d1c4['erlangAbandonmentRate']);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x88'));_['merge'](_0x6795e8,_0x33d1c4);};}function getDiff(_0x2d47f5){var _0x4a8cd0=moment()[_0x0cf8('0x50')](0x0);var _0x1d4bdd=moment(_0x2d47f5)['milliseconds'](0x0);return _0x4a8cd0['diff'](_0x1d4bdd,_0x0cf8('0x51'));}function ifInterval(_0x51cdf4,_0x56089d){if(_[_0x0cf8('0x44')](_0x56089d)){return![];}if(getDiff(_0x56089d)<_0x51cdf4*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xd1b3a8){if(isNotNull(_0xd1b3a8)){if(!_[_0x0cf8('0x44')](_0xd1b3a8[_0x0cf8('0x2e')])){_0xd1b3a8[_0x0cf8('0x2e')]=undefined;loggerPredictive['info'](_0xd1b3a8['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x0cf8('0x44')](_0xd1b3a8[_0x0cf8('0x79')])){_0xd1b3a8[_0x0cf8('0x79')]=undefined;loggerPredictive[_0x0cf8('0x82')](_0xd1b3a8[_0x0cf8('0x45')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x0cf8('0x44')](_0xd1b3a8[_0x0cf8('0x94')])){clearInterval(_0xd1b3a8[_0x0cf8('0x94')]);_0xd1b3a8['handlePredictive']=undefined;loggerPredictive[_0x0cf8('0x82')](_0xd1b3a8[_0x0cf8('0x45')],_0x0cf8('0x95'));}}}function erlangb(_0x476957,_0xf713f5){if(_0xf713f5===0x0){return 0x0;}var _0x2c7735=0x1;for(var _0x49d8fc=0x1;_0x49d8fc<=_0xf713f5;_0x49d8fc+=0x1){_0x2c7735=0x1+_0x2c7735*_0x49d8fc/_0x476957;}return 0x1/_0x2c7735;}function isVoiceQueueOutbound(_0x153b55){return _0x153b55===_0x0cf8('0x53');}function isNotPreview(_0x2c6bc1){return _0x2c6bc1!==_0x0cf8('0x23');}function isCampaignIvr(_0x1bb41b){return _0x1bb41b===_0x0cf8('0x96');}function getCallerId(_0x1d59a2,_0x194e93,_0x402ff2){if(!_[_0x0cf8('0x44')](_0x402ff2)&&'string'===typeof _0x402ff2&&!_[_0x0cf8('0x4e')](_0x402ff2)){if(!_['isUndefined'](_0x194e93)&&_0x0cf8('0x97')===typeof _0x194e93&&!_[_0x0cf8('0x4e')](_0x194e93)){return util[_0x0cf8('0x7e')]('\x22%s\x22\x20<%s>',_0x194e93,_0x402ff2);}return util[_0x0cf8('0x7e')](_0x0cf8('0x98'),_0x402ff2,_0x402ff2);}if(!_[_0x0cf8('0x44')](_0x1d59a2)&&_0x0cf8('0x97')===typeof _0x1d59a2&&!_[_0x0cf8('0x4e')](_0x1d59a2)){return _0x1d59a2;}return _0x0cf8('0x99');}function loggerCatchQueueSummary(_0x829c25,_0x221b9d){return function(_0x29d726){freeVariablesPredictive(_0x221b9d);emitVoiceQueueSummary(_0x221b9d);emitCampaignSummary(_0x221b9d);loggerSyncQueueSummary['error'](_0x829c25,util['inspect'](_0x29d726,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x293abf,_0x49cf76){return function(_0x2b96ee){loggerPredictive[_0x0cf8('0x9a')](_0x49cf76[_0x0cf8('0x45')],_0x293abf);loggerPredictive[_0x0cf8('0x9a')](_0x2b96ee[_0x0cf8('0x9b')]);freeVariablesPredictive(_0x49cf76);};}function loggerCatch(_0x1265de){return function(_0xced358){logger[_0x0cf8('0x9a')](_0x1265de,util[_0x0cf8('0x9c')](_0xced358,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4ce796){return _0x4ce796&&!_[_0x0cf8('0x44')](_0x4ce796)&&_0x4ce796[_0x0cf8('0x9d')]>0x0;}function decremetOriginate(_0x338ab5){if(!_[_0x0cf8('0x44')](_0x338ab5)&&_0x338ab5!==null){if(_0x338ab5[_0x0cf8('0x9e')](_0x0cf8('0x9f'))){if(_0x338ab5[_0x0cf8('0x9f')]>0x0){_0x338ab5[_0x0cf8('0x9f')]-=0x1;}else{logger[_0x0cf8('0x9a')](_0x0cf8('0xa0'));}}}else{logger[_0x0cf8('0x9a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5774aa,_0x31ca1f,_0x34b29d){if(_0x31ca1f>_0x34b29d){for(var _0x460ee4=0x0;_0x460ee4<_0x31ca1f-_0x34b29d;_0x460ee4+=0x1){decremetOriginate(_0x5774aa);}}}function loggerGetContactDialer(_0x5c54ab,_0x3056f7,_0x14883e){return function(_0x264d19){checkContactLowerLimitOriginate(_0x3056f7,_0x14883e,0x0);logger['error'](_0x5c54ab,util[_0x0cf8('0x9c')](_0x264d19,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3b5a64){return function(_0x26cd70){if(isNotNull(_0x26cd70)&&isNotNull(_0x26cd70[0x0])){if(_0x26cd70[0x0][_0x0cf8('0xa1')]>0x0){_0x3b5a64[_0x0cf8('0x4a')]=_0x0cf8('0xa2');logger[_0x0cf8('0x82')](_0x0cf8('0xa3')+_0x3b5a64[_0x0cf8('0x45')],_0x26cd70[0x0][_0x0cf8('0xa1')],_0x0cf8('0xa4'));}else{_0x3b5a64[_0x0cf8('0x4a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x0cf8('0x82')](_0x0cf8('0xa5')+_0x3b5a64[_0x0cf8('0x45')]);}}};}function notSendMessagesQueue(_0x5c371b){if(_0x5c371b[_0x0cf8('0xa6')]){freeVariablesPredictive(_0x5c371b);if(_0x5c371b[_0x0cf8('0x9f')]===0x0&&_0x5c371b[_0x0cf8('0x5a')]===0x0&&_0x5c371b[_0x0cf8('0x5c')]===0x0&&(_0x5c371b[_0x0cf8('0x57')]||0x0)===0x0){_0x5c371b[_0x0cf8('0xa6')]=![];_0x5c371b[_0x0cf8('0x55')]=0x0;_0x5c371b[_0x0cf8('0x4a')]=_0x0cf8('0x47');loggerSyncQueueSummary[_0x0cf8('0x9a')](_0x0cf8('0xa7'),_0x5c371b[_0x0cf8('0x45')],_0x0cf8('0xa8'));}else{_0x5c371b[_0x0cf8('0x4a')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0x0cf8('0xa7'),_0x5c371b[_0x0cf8('0x45')],_0x0cf8('0xa9'));}emitVoiceQueueSummary(_0x5c371b);}}function notSendMessagesCampaign(_0x1db1fe){if(_0x1db1fe[_0x0cf8('0xa6')]){if(_0x1db1fe[_0x0cf8('0x9f')]===0x0){_0x1db1fe[_0x0cf8('0xa6')]=![];_0x1db1fe[_0x0cf8('0x4a')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x0cf8('0x9a')](_0x0cf8('0xaa'),_0x1db1fe[_0x0cf8('0x45')],_0x0cf8('0xa8'));}else{_0x1db1fe['message']=_0x0cf8('0xab');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1db1fe[_0x0cf8('0x45')],_0x0cf8('0xa9'));}emitCampaignSummary(_0x1db1fe);}}function createObjHistory(_0x40ec08,_0x3bb1b4,_0x18de4b,_0xd713e,_0x25c395){_0x40ec08[_0x0cf8('0x4a')]=_0x18de4b;var _0x17e9ec=new Action(_0x40ec08,_0x3bb1b4);var _0x3e0a44=new History(_0x17e9ec);_0x3e0a44[_0x0cf8('0xac')]=_0xd713e;_0x3e0a44[_0x0cf8('0xad')]=_0x25c395;_0x3e0a44[_0x0cf8('0xae')]=_0x17e9ec[_0x0cf8('0xaf')];return _0x3e0a44;}Dialer[_0x0cf8('0xb0')][_0x0cf8('0xb1')]=function(){var _0x5e9cdd=this;setInterval(function(){_0x5e9cdd['clearZombieChannels'](_0x5e9cdd['uniqueId'],_0x0cf8('0xb2'));_0x5e9cdd[_0x0cf8('0xb3')](_0x5e9cdd[_0x0cf8('0x2a')],_0x0cf8('0xb4'));},0x32c8);};Dialer['prototype'][_0x0cf8('0xb3')]=function(_0x16bd7b,_0x35c380){var _0x111a7e=this;for(var _0x13aa5a in _0x16bd7b){if(_0x16bd7b[_0x0cf8('0x9e')](_0x13aa5a)){this['sequence'][_0x0cf8('0xb5')](function(){if(!_[_0x0cf8('0xb6')](_0x16bd7b[_0x13aa5a])){return ami[_0x0cf8('0xb7')]({'action':_0x0cf8('0xb8'),'channel':_0x16bd7b[_0x13aa5a]['channel']})[_0x0cf8('0xb9')](function(_0x207b89){if(_0x207b89[_0x0cf8('0x4a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x16bd7b[_0x13aa5a]&&_0x16bd7b[_0x13aa5a][_0x0cf8('0x52')]!==_0x0cf8('0x96')){_0x111a7e[_0x0cf8('0xba')](_0x111a7e['voiceQueues'][_0x16bd7b[_0x13aa5a][_0x0cf8('0xbb')]]);logger[_0x0cf8('0x9a')](_0x0cf8('0xbc'),_0x35c380,_0x13aa5a,_0x16bd7b[_0x13aa5a][_0x0cf8('0xbb')]);delete _0x16bd7b[_0x13aa5a];}if(_0x16bd7b[_0x13aa5a]&&_0x16bd7b[_0x13aa5a][_0x0cf8('0x52')]===_0x0cf8('0x96')){_0x111a7e['updateOriginated'](_0x111a7e[_0x0cf8('0x25')][_0x16bd7b[_0x13aa5a][_0x0cf8('0xbb')]]);logger['error'](_0x0cf8('0xbd'),_0x35c380,_0x13aa5a,_0x16bd7b[_0x13aa5a][_0x0cf8('0xbb')]);delete _0x16bd7b[_0x13aa5a];}},0x2328);}});}});}}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xbe')]=function(_0xb04933){return BPromise[_0x0cf8('0xbf')]()['then'](cmHopper[_0x0cf8('0xbe')](_0xb04933))[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xc0')));};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xc1')]=function(_0x5c6aa5){return BPromise[_0x0cf8('0xbf')]()[_0x0cf8('0xc2')](cmHopperBlack[_0x0cf8('0xc1')](_0x5c6aa5))[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xc3')));};Dialer['prototype'][_0x0cf8('0xc4')]=function(_0x2b318b){return BPromise['resolve']()['then'](cmHopperBlack[_0x0cf8('0xc4')](_0x2b318b))[_0x0cf8('0xb9')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x0cf8('0xc5')]=function(_0x501d06){return BPromise[_0x0cf8('0xbf')]()[_0x0cf8('0xc2')](cmHopperHistory[_0x0cf8('0xc6')](_0x501d06))[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xc7')));};Dialer['prototype']['rescheduleContact']=function(_0x4aa873){return BPromise[_0x0cf8('0xbf')]()[_0x0cf8('0xc2')](cmHopper[_0x0cf8('0xc8')](_0x4aa873))[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xc9')));};Dialer['prototype']['unlockContact']=function(_0x3b0ec6,_0x1320dd,_0x5ef235){return BPromise[_0x0cf8('0xbf')]()[_0x0cf8('0xc2')](cmHopper[_0x0cf8('0xca')](_0x3b0ec6,_0x1320dd,_0x5ef235))[_0x0cf8('0xb9')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x0cf8('0xb0')]['getContactDialer']=function(_0x1bbbe2,_0x4743be,_0x281e36,_0xc61b41){return BPromise[_0x0cf8('0xbf')]()[_0x0cf8('0xc2')](cmHopper[_0x0cf8('0xcb')](_0x1bbbe2,_0x4743be,_0x281e36,_0xc61b41))[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xcc')));};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xcd')]=function(_0x1a0dd4,_0x34ac4a,_0xe4452b){return BPromise[_0x0cf8('0xbf')]()[_0x0cf8('0xc2')](cmHopper[_0x0cf8('0xcd')](_0x1a0dd4,_0x34ac4a,_0xe4452b))[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xcc')));};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xce')]=function(_0x329774){return BPromise[_0x0cf8('0xbf')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x329774))['catch'](loggerCatch(_0x0cf8('0xcf')));};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xd0')]=function(_0x33ac3a){return BPromise[_0x0cf8('0xbf')]()[_0x0cf8('0xc2')](cmHopper[_0x0cf8('0xd0')](_0x33ac3a))['catch'](loggerCatch(_0x0cf8('0xd1')));};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xd2')]=function(_0x1b923){return BPromise[_0x0cf8('0xbf')]()[_0x0cf8('0xc2')](cmHopperHistory[_0x0cf8('0xd2')](_0x1b923))[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xd3')));};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xba')]=function(_0x177732){if(!_['isUndefined'](_0x177732)&&_0x177732!==null){if(_0x177732['hasOwnProperty']('originated')){if(_0x177732['originated']>0x0){_0x177732[_0x0cf8('0x9f')]-=0x1;}else{logger[_0x0cf8('0x9a')](_0x0cf8('0xd4'));}}}else{logger['error'](_0x0cf8('0xd5'));}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xd6')]=function(_0x4ca852,_0x33606e){var _0x599162=this;return function(_0x36c9f7){_0x599162[_0x0cf8('0xba')](_0x33606e);logger['error'](_0x4ca852,util[_0x0cf8('0x9c')](_0x36c9f7,{'showHidden':![],'depth':null}));};};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xd7')]=function(_0x2ad936,_0x222439,_0x1efc60){var _0x62ecc2={'state':0x19,'statedesc':'notFound'};this[_0x0cf8('0xba')](_0x222439);this[_0x0cf8('0xd8')](_[_0x0cf8('0xd9')](_0x62ecc2,_[_0x0cf8('0xda')](_0x1efc60,[_0x0cf8('0xdb'),'ListId',_0x0cf8('0xdc'),_0x0cf8('0xdd'),'CampaignId'])),_0x0cf8('0xde'),_0x0cf8('0xdf'));logger['error'](_0x2ad936);};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xe0')]=function(_0xe2a345){return _0xe2a345==='Success';};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xe1')]=function(_0x1f4a49){return!_[_0x0cf8('0x44')](_0x1f4a49)&&_0x1f4a49&&!_[_0x0cf8('0x44')](_0x1f4a49[_0x0cf8('0x45')])&&!_[_0x0cf8('0x44')](_0x1f4a49['active'])&&_0x1f4a49[_0x0cf8('0x7b')]&&(this[_0x0cf8('0x27')][util['format']('SIP/%s',_0x1f4a49[_0x0cf8('0x45')])]['status']==='reachable'||this['trunks'][util[_0x0cf8('0x7e')]('SIP/%s',_0x1f4a49[_0x0cf8('0x45')])][_0x0cf8('0xb8')]===_0x0cf8('0xe2'));};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xd8')]=function(_0x1bf9db,_0x488b14,_0x8ba81a){this[_0x0cf8('0xd2')](_0x1bf9db)[_0x0cf8('0xb9')](loggerCatch(_0x488b14));this[_0x0cf8('0xd0')](_0x1bf9db)['catch'](loggerCatch(_0x8ba81a));};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x3f')]=function(_0x1ea52b){var _0x24c821=this[_0x0cf8('0x2c')][_0x1ea52b[_0x0cf8('0xe3')]];var _0x5bfd95;if(!_[_0x0cf8('0xb6')](_0x1ea52b)&&!_[_0x0cf8('0xb6')](_0x1ea52b[_0x0cf8('0xe4')])&&!_[_0x0cf8('0xb6')](_0x1ea52b[_0x0cf8('0xe4')]['amdstatus'])&&_0x1ea52b[_0x0cf8('0xe5')]==='xcally-motion-dialer'&&_0x24c821){if(_0x24c821['type']!==_0x0cf8('0x96')&&this[_0x0cf8('0x24')][_0x24c821[_0x0cf8('0xbb')]][_0x0cf8('0xe6')]&&_0x1ea52b[_0x0cf8('0xe7')]===_0x0cf8('0xe8')){delete this['uniqueId'][_0x1ea52b[_0x0cf8('0xe3')]];this[_0x0cf8('0xba')](this[_0x0cf8('0x24')][_0x24c821[_0x0cf8('0xbb')]]);this[_0x0cf8('0x24')][_0x24c821['queue']][_0x0cf8('0x61')]+=0x1;this[_0x0cf8('0x24')][_0x24c821[_0x0cf8('0xbb')]][_0x0cf8('0x60')]+=0x1;_0x5bfd95=new Hangup(_0x24c821,_0x1ea52b);_0x5bfd95[_0x0cf8('0xac')]=0x12;_0x5bfd95[_0x0cf8('0xad')]=_0x0cf8('0xe9');_0x5bfd95[_0x0cf8('0xea')]=_0x0cf8('0xeb');this[_0x0cf8('0xd8')](_0x5bfd95,_0x0cf8('0xec'),_0x0cf8('0xed'));}if(_0x24c821[_0x0cf8('0x52')]!==_0x0cf8('0x96')&&this[_0x0cf8('0x24')][_0x24c821[_0x0cf8('0xbb')]][_0x0cf8('0xe6')]&&_0x1ea52b['value']===_0x0cf8('0xee')){var _0x38e604=this;return new BPromise(function(_0x476c3b,_0x2c353e){delete _0x38e604[_0x0cf8('0x2c')][_0x1ea52b['uniqueid']];_0x38e604['updateOriginated'](_0x38e604[_0x0cf8('0x24')][_0x24c821[_0x0cf8('0xbb')]]);_0x38e604['voiceQueues'][_0x24c821[_0x0cf8('0xbb')]][_0x0cf8('0x61')]+=0x1;_0x38e604['voiceQueues'][_0x24c821[_0x0cf8('0xbb')]][_0x0cf8('0x60')]+=0x1;var _0x5eae32=_0x38e604[_0x0cf8('0x24')][_0x24c821[_0x0cf8('0xbb')]];var _0x26d2fc=new Hangup(_0x24c821,_0x1ea52b);_0x26d2fc['state']=0x13;_0x26d2fc[_0x0cf8('0xad')]=_0x0cf8('0xef');_0x26d2fc[_0x0cf8('0xea')]=_0x0cf8('0xeb');_0x26d2fc[_0x0cf8('0xf0')]+=0x1;_0x26d2fc[_0x0cf8('0xf1')]+=0x1;_0x26d2fc[_0x0cf8('0xf2')]=!![];_0x38e604[_0x0cf8('0xd2')](_0x26d2fc)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xf3')));if(_0x26d2fc[_0x0cf8('0xf4')]+_0x26d2fc['countcongestionretry']+_0x26d2fc['countnoanswerretry']+_0x26d2fc[_0x0cf8('0xf5')]+_0x26d2fc['countdropretry']+_0x26d2fc['countabandonedretry']+_0x26d2fc[_0x0cf8('0xf0')]+_0x26d2fc['countagentrejectretry']>=_0x5eae32[_0x0cf8('0xf6')]){_0x38e604['stateGlobal'](_0x26d2fc,_0x476c3b,_0x2c353e,'reason19\x20machine....');}else{if(_0x26d2fc[_0x0cf8('0xf0')]>=_0x5eae32['dialMachineMaxRetry']){_0x38e604['createStateFinal'](_0x26d2fc,_0x476c3b,_0x2c353e,_0x0cf8('0xf7'));}else{_0x38e604['rescheduleContact']({'active':![],'countmachineretry':_0x26d2fc[_0x0cf8('0xf0')],'scheduledat':moment()['add'](_0x5eae32[_0x0cf8('0xf8')],_0x0cf8('0xf9'))['format'](_0x0cf8('0xfa')),'ContactId':_0x26d2fc['ContactId'],'ListId':_0x26d2fc[_0x0cf8('0xfb')],'VoiceQueueId':_0x26d2fc['VoiceQueueId']||undefined,'CampaignId':_0x26d2fc[_0x0cf8('0xfc')]||undefined})['catch'](loggerCatch(_0x0cf8('0xfd')));_0x476c3b({'reschedule':0x1});}}});}if(_0x24c821[_0x0cf8('0x52')]===_0x0cf8('0x96')&&this['campaigns'][_0x24c821[_0x0cf8('0xbb')]][_0x0cf8('0xe6')]&&_0x1ea52b[_0x0cf8('0xe7')]==='HANGUP'){delete this[_0x0cf8('0x2c')][_0x1ea52b[_0x0cf8('0xe3')]];this[_0x0cf8('0xba')](this[_0x0cf8('0x25')][_0x24c821[_0x0cf8('0xbb')]]);_0x5bfd95=new Hangup(_0x24c821,_0x1ea52b);_0x5bfd95[_0x0cf8('0xac')]=0x12;_0x5bfd95['statedesc']='HangupInAMD';_0x5bfd95[_0x0cf8('0xea')]=_0x0cf8('0xeb');this[_0x0cf8('0xd8')](_0x5bfd95,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x24c821[_0x0cf8('0x52')]===_0x0cf8('0x96')&&this[_0x0cf8('0x25')][_0x24c821[_0x0cf8('0xbb')]]['dialAMDActive']&&_0x1ea52b['value']==='MACHINE'){var _0x38e604=this;return new BPromise(function(_0x42fe21,_0x587171){delete _0x38e604[_0x0cf8('0x2c')][_0x1ea52b['uniqueid']];_0x38e604['updateOriginated'](_0x38e604[_0x0cf8('0x25')][_0x24c821[_0x0cf8('0xbb')]]);_0x38e604[_0x0cf8('0x25')][_0x24c821[_0x0cf8('0xbb')]][_0x0cf8('0x61')]+=0x1;_0x38e604[_0x0cf8('0x25')][_0x24c821[_0x0cf8('0xbb')]][_0x0cf8('0x60')]+=0x1;var _0x5642c5=_0x38e604['campaigns'][_0x24c821[_0x0cf8('0xbb')]];var _0x309aca=new Hangup(_0x24c821,_0x1ea52b);_0x309aca[_0x0cf8('0xac')]=0x13;_0x309aca[_0x0cf8('0xad')]=_0x0cf8('0xef');_0x309aca[_0x0cf8('0xea')]=_0x0cf8('0xeb');_0x309aca['countmachineretry']+=0x1;_0x309aca[_0x0cf8('0xf1')]+=0x1;_0x309aca['amd']=!![];_0x38e604['createHistory'](_0x309aca)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xf3')));if(_0x309aca[_0x0cf8('0xf4')]+_0x309aca[_0x0cf8('0xfe')]+_0x309aca[_0x0cf8('0xff')]+_0x309aca[_0x0cf8('0xf5')]+_0x309aca['countdropretry']+_0x309aca['countabandonedretry']+_0x309aca[_0x0cf8('0xf0')]+_0x309aca[_0x0cf8('0x100')]>=_0x5642c5['dialGlobalMaxRetry']){_0x38e604['stateGlobal'](_0x309aca,_0x42fe21,_0x587171,'reason19\x20machine....');}else{if(_0x309aca[_0x0cf8('0xf0')]>=_0x5642c5[_0x0cf8('0x101')]){_0x38e604[_0x0cf8('0x102')](_0x309aca,_0x42fe21,_0x587171,_0x0cf8('0xf7'));}else{_0x38e604[_0x0cf8('0xc8')]({'active':![],'countmachineretry':_0x309aca['countmachineretry'],'scheduledat':moment()[_0x0cf8('0x103')](_0x5642c5['dialMachineRetryFrequency'],_0x0cf8('0xf9'))[_0x0cf8('0x7e')](_0x0cf8('0xfa')),'ContactId':_0x309aca[_0x0cf8('0xdb')],'ListId':_0x309aca[_0x0cf8('0xfb')],'VoiceQueueId':_0x309aca[_0x0cf8('0xdd')]||undefined,'CampaignId':_0x309aca['CampaignId']||undefined})[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xfd')));_0x42fe21({'reschedule':0x1});}}});}}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x3c')]=function(_0x5ea128){var _0x3bed2a=this['uniqueId'][_0x5ea128['uniqueid']];var _0x51007c=this;var _0x17ea0a;if(_0x3bed2a&&_0x3bed2a[_0x0cf8('0x52')]==='ivr'){delete this[_0x0cf8('0x2c')][_0x5ea128[_0x0cf8('0xe3')]];this[_0x0cf8('0xba')](this['campaigns'][_0x3bed2a['queue']]);this['campaigns'][_0x3bed2a[_0x0cf8('0xbb')]][_0x0cf8('0x104')]+=0x1;_0x17ea0a=new Hangup(_0x3bed2a,_0x5ea128);this['createHistory'](_0x17ea0a)[_0x0cf8('0xb9')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x0cf8('0xd0')](_0x17ea0a)[_0x0cf8('0xb9')](loggerCatch('[syncHangupIvr]'));}if(_0x3bed2a&&_0x3bed2a[_0x0cf8('0x52')]!==_0x0cf8('0x96')&&isNotNull(this[_0x0cf8('0x24')][_0x3bed2a['queue']]['dialQueueProject'])){delete this[_0x0cf8('0x2c')][_0x5ea128[_0x0cf8('0xe3')]];this[_0x0cf8('0xba')](this[_0x0cf8('0x24')][_0x3bed2a[_0x0cf8('0xbb')]]);this[_0x0cf8('0x24')][_0x3bed2a[_0x0cf8('0xbb')]][_0x0cf8('0x61')]+=0x1;this[_0x0cf8('0x24')][_0x3bed2a[_0x0cf8('0xbb')]][_0x0cf8('0x60')]+=0x1;_0x17ea0a=new Hangup(_0x3bed2a,_0x5ea128);_0x17ea0a['state']=0x10;_0x17ea0a['statedesc']=_0x0cf8('0x105');_0x17ea0a['membername']=_0x0cf8('0x106');this[_0x0cf8('0xd2')](_0x17ea0a)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x107')));this['moveContactManagedDialer'](_0x17ea0a)[_0x0cf8('0xb9')](loggerCatch('[syncHangupIvr]'));}if(_0x3bed2a&&_0x3bed2a[_0x0cf8('0x52')]!==_0x0cf8('0x96')&&!isNotNull(this[_0x0cf8('0x24')][_0x3bed2a[_0x0cf8('0xbb')]][_0x0cf8('0x108')])){delete this['uniqueId'][_0x5ea128[_0x0cf8('0xe3')]];this[_0x0cf8('0xba')](this['voiceQueues'][_0x3bed2a[_0x0cf8('0xbb')]]);this[_0x0cf8('0x24')][_0x3bed2a[_0x0cf8('0xbb')]][_0x0cf8('0x6b')]+=0x1;_0x17ea0a=new Hangup(_0x3bed2a,_0x5ea128);_0x17ea0a[_0x0cf8('0xac')]=0xc;_0x17ea0a[_0x0cf8('0xad')]=_0x5ea128[_0x0cf8('0x109')];_0x17ea0a[_0x0cf8('0xea')]=_0x0cf8('0x10a');this[_0x0cf8('0xd2')](_0x17ea0a)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x107')));this[_0x0cf8('0xd0')](_0x17ea0a)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x10b')));}};Dialer['prototype'][_0x0cf8('0x10c')]=function(_0x154b12){var _0x513036=this[_0x0cf8('0x2c')][_0x154b12['uniqueid']];var _0x2cb1b7=this;if(this['voiceQueues'][_0x154b12['queue']]){if(_0x513036&&_0x513036[_0x0cf8('0x52')]!=='ivr'){delete this['uniqueId'][_0x154b12[_0x0cf8('0xe3')]];this[_0x0cf8('0x24')][_0x154b12[_0x0cf8('0xbb')]]['outboundAnswerCallsDay']+=0x1;var _0x3334b5=new AgentComplete(_0x513036,_0x154b12);if(_0x154b12[_0x0cf8('0x10d')]===_0x0cf8('0x10e')){_0x3334b5['agiafterat']=this['voiceQueues'][_0x154b12[_0x0cf8('0xbb')]]['dialQueueProject2']&&this[_0x0cf8('0x24')][_0x154b12[_0x0cf8('0xbb')]][_0x0cf8('0x10f')]?moment()['format'](_0x0cf8('0xfa')):undefined;}this['createHistory'](_0x3334b5)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x110')));this[_0x0cf8('0xd0')](_0x3334b5)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x33')]=function(_0x24cbe5){if(this['voiceQueues'][_0x24cbe5[_0x0cf8('0xbb')]]){if(this[_0x0cf8('0x2c')][_0x24cbe5[_0x0cf8('0xe3')]]&&this[_0x0cf8('0x2c')][_0x24cbe5[_0x0cf8('0xe3')]][_0x0cf8('0x52')]!==_0x0cf8('0x96')){this[_0x0cf8('0xba')](this['voiceQueues'][_0x24cbe5[_0x0cf8('0xbb')]]);this['uniqueId'][_0x24cbe5[_0x0cf8('0xe3')]][_0x0cf8('0x111')]=moment()[_0x0cf8('0x7e')](_0x0cf8('0xfa'));}}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x112')]=function(_0x57698e){this['createHistory'](_0x57698e)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x0cf8('0xd0')](_0x57698e)[_0x0cf8('0xb9')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x36')]=function(_0x16db7e){var _0x20b27f=this['uniqueId'][_0x16db7e[_0x0cf8('0xe3')]];var _0x3c877d=this;if(this['voiceQueues'][_0x16db7e[_0x0cf8('0xbb')]]){if(_0x20b27f&&_0x20b27f[_0x0cf8('0x52')]!=='ivr'){delete this[_0x0cf8('0x2c')][_0x16db7e[_0x0cf8('0xe3')]];this['updateOriginated'](this[_0x0cf8('0x24')][_0x16db7e[_0x0cf8('0xbb')]]);_0x20b27f[_0x0cf8('0x113')]=moment()['format'](_0x0cf8('0xfa'));var _0x3c3fe8=new QueueCallerAbandon(_0x20b27f,_0x16db7e);if(getSeconds(_0x20b27f['droptime'],_0x20b27f[_0x0cf8('0x114')])>=_0x20b27f[_0x0cf8('0x115')]){this[_0x0cf8('0x24')][_0x16db7e[_0x0cf8('0xbb')]][_0x0cf8('0x70')]+=0x1;this['voiceQueues'][_0x16db7e['queue']][_0x0cf8('0x67')]+=0x1;this[_0x0cf8('0x24')][_0x16db7e[_0x0cf8('0xbb')]][_0x0cf8('0x116')]+=0x1;_0x3c3fe8[_0x0cf8('0xac')]=0xa;_0x3c3fe8[_0x0cf8('0xad')]=_0x0cf8('0x117');_0x3c3fe8[_0x0cf8('0x118')]=_0x0cf8('0x119');_0x3c3fe8[_0x0cf8('0x11a')]=this[_0x0cf8('0x24')][_0x16db7e['queue']][_0x0cf8('0x11b')]?moment()[_0x0cf8('0x7e')](_0x0cf8('0xfa')):undefined;_0x3c3fe8[_0x0cf8('0x11c')]+=0x1;_0x3c3fe8[_0x0cf8('0xf1')]+=0x1;if(_0x3c3fe8[_0x0cf8('0x11c')]>=this[_0x0cf8('0x24')][_0x16db7e[_0x0cf8('0xbb')]][_0x0cf8('0x11d')]){this[_0x0cf8('0x112')](_0x3c3fe8);}else{this[_0x0cf8('0xc8')]({'active':![],'countdropretry':_0x3c3fe8['countdropretry'],'scheduledat':moment()['add'](this[_0x0cf8('0x24')][_0x16db7e['queue']][_0x0cf8('0x11e')],'minutes')['format'](_0x0cf8('0xfa')),'ContactId':_0x20b27f[_0x0cf8('0xdb')],'ListId':_0x20b27f[_0x0cf8('0xfb')],'VoiceQueueId':_0x20b27f['VoiceQueueId']||undefined,'CampaignId':_0x20b27f[_0x0cf8('0xfc')]||undefined})[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x11f')));var _0x1f083f=new History(_0x3c3fe8);_0x1f083f[_0x0cf8('0xac')]=0xa;_0x1f083f[_0x0cf8('0xad')]='Drop';_0x1f083f[_0x0cf8('0xaf')]=moment()[_0x0cf8('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f083f[_0x0cf8('0xae')]=_0x1f083f[_0x0cf8('0xaf')];_0x1f083f[_0x0cf8('0x120')]=_0x3c3fe8['calleridname'];_0x1f083f['calleridnum']=_0x3c3fe8['calleridnum'];this[_0x0cf8('0xd2')](_0x1f083f)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x121')));}}else{this['voiceQueues'][_0x16db7e[_0x0cf8('0xbb')]][_0x0cf8('0x6f')]+=0x1;this[_0x0cf8('0x24')][_0x16db7e[_0x0cf8('0xbb')]][_0x0cf8('0x66')]+=0x1;_0x3c3fe8[_0x0cf8('0xac')]=0xb;_0x3c3fe8['statedesc']=_0x0cf8('0x122');_0x3c3fe8[_0x0cf8('0x118')]='CALLEREXIT';_0x3c3fe8['countabandonedretry']+=0x1;_0x3c3fe8[_0x0cf8('0xf1')]+=0x1;if(_0x3c3fe8[_0x0cf8('0x123')]>=this[_0x0cf8('0x24')][_0x16db7e[_0x0cf8('0xbb')]][_0x0cf8('0x124')]){this['queueCallerAbandonCreateState'](_0x3c3fe8);}else{this[_0x0cf8('0xc8')]({'active':![],'countabandonedretry':_0x3c3fe8[_0x0cf8('0x123')],'scheduledat':moment()[_0x0cf8('0x103')](this[_0x0cf8('0x24')][_0x16db7e['queue']][_0x0cf8('0x125')],'minutes')[_0x0cf8('0x7e')](_0x0cf8('0xfa')),'ContactId':_0x20b27f[_0x0cf8('0xdb')],'ListId':_0x20b27f[_0x0cf8('0xfb')],'VoiceQueueId':_0x20b27f[_0x0cf8('0xdd')]||undefined,'CampaignId':_0x20b27f[_0x0cf8('0xfc')]||undefined})[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x126')));var _0x1f083f=new History(_0x3c3fe8);_0x1f083f[_0x0cf8('0xac')]=0xb;_0x1f083f[_0x0cf8('0xad')]='Abandoned';_0x1f083f[_0x0cf8('0xaf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1f083f['endtime']=_0x1f083f[_0x0cf8('0xaf')];_0x1f083f[_0x0cf8('0x120')]=_0x3c3fe8[_0x0cf8('0x120')];_0x1f083f[_0x0cf8('0x127')]=_0x3c3fe8[_0x0cf8('0x127')];this['createHistory'](_0x1f083f)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x128')));}}}}};Dialer[_0x0cf8('0xb0')]['syncNewExten']=function(_0x10539d){if(this['actions'][_0x10539d[_0x0cf8('0xe3')]]){this[_0x0cf8('0x2a')][_0x10539d['uniqueid']][_0x0cf8('0x129')]=_0x10539d[_0x0cf8('0x129')];}if(this['uniqueId'][_0x10539d['uniqueid']]){this[_0x0cf8('0x2c')][_0x10539d['uniqueid']][_0x0cf8('0x129')]=_0x10539d[_0x0cf8('0x129')];}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x40')]=function(_0x5c785e){if(strategy[this[_0x0cf8('0x24')][this['actions'][_0x5c785e[_0x0cf8('0x12a')]]['queue']][_0x0cf8('0x54')]]===_0x0cf8('0x1f')){if(this[_0x0cf8('0x2a')][_0x5c785e[_0x0cf8('0x12a')]]&&_[_0x0cf8('0xb6')](this['actions'][_0x5c785e[_0x0cf8('0x12a')]][_0x0cf8('0x12b')])&&_0x5c785e[_0x0cf8('0xb8')]==='1'&&_0x5c785e[_0x0cf8('0x12c')]==='0'){if(this[_0x0cf8('0x26')][_0x5c785e[_0x0cf8('0x12d')]]){if(!this['agents'][_0x5c785e['stateinterface']][_0x0cf8('0x12b')]){this[_0x0cf8('0x26')][_0x5c785e[_0x0cf8('0x12d')]][_0x0cf8('0x12b')]=!![];this['actions'][_0x5c785e['actionid']]['locked']=!![];this[_0x0cf8('0x2a')][_0x5c785e[_0x0cf8('0x12a')]][_0x0cf8('0x12d')]=_0x5c785e[_0x0cf8('0x12d')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x5c785e[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]][_0x0cf8('0x54')]]||'rrmemory')==='rrmemory'){if(this[_0x0cf8('0x2a')][_0x5c785e['actionid']]){if(this[_0x0cf8('0x26')][_0x5c785e[_0x0cf8('0x12d')]]){this['actions'][_0x5c785e[_0x0cf8('0x12a')]]['stateinterface']=_0x5c785e['stateinterface'];if(_[_0x0cf8('0xb6')](this[_0x0cf8('0x30')][this[_0x0cf8('0x2a')][_0x5c785e[_0x0cf8('0x12a')]]['queue']])){this[_0x0cf8('0x30')][this['actions'][_0x5c785e[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]]=[];}this[_0x0cf8('0x30')][this[_0x0cf8('0x2a')][_0x5c785e['actionid']][_0x0cf8('0xbb')]][_0x0cf8('0x12e')](_[_0x0cf8('0xd9')](_[_0x0cf8('0xda')](this['actions'][_0x5c785e['actionid']],[_0x0cf8('0x12f'),_0x0cf8('0x12d')]),{'status':_0x5c785e['status'],'paused':_0x5c785e[_0x0cf8('0x12c')]}));}}}};function unlockQueueStatus(_0x314a00,_0x1f29d8){setTimeout(function(){if(_[_0x0cf8('0x44')](_0x314a00[_0x0cf8('0x130')])){loggerBooked[_0x0cf8('0x9a')]('[unlockQueueStatus][undefined]',_0x1f29d8);}_0x314a00['queueStatusComplete']=!![];loggerBooked[_0x0cf8('0x82')](_0x0cf8('0x131'),_0x1f29d8,JSON[_0x0cf8('0x7d')](_[_0x0cf8('0xda')](_0x314a00,[_0x0cf8('0x45'),_0x0cf8('0x130')])));},0x1f3);}Dialer[_0x0cf8('0xb0')][_0x0cf8('0x42')]=function(_0x281a5a){var _0x1e1d83=this;var _0x19930c=_0x1e1d83[_0x0cf8('0x24')][_0x1e1d83[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]];if(strategy[this['voiceQueues'][this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]][_0x0cf8('0x54')]]===_0x0cf8('0x1f')){if(this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]]&&this['actions'][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0x12d')]){this[_0x0cf8('0x23')][_0x0cf8('0x132')](this['actions'][_0x281a5a[_0x0cf8('0x12a')]]['idHopper'],this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0x12d')])[_0x0cf8('0xb9')](function(_0x3f3c29){logger[_0x0cf8('0x9a')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x0cf8('0x9c')](_0x3f3c29,{'showHidden':![],'depth':null}));})[_0x0cf8('0x21')](function(){_0x1e1d83['updateOriginated'](_0x1e1d83[_0x0cf8('0x24')][_0x1e1d83['actions'][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]]);_0x1e1d83[_0x0cf8('0x26')][_0x1e1d83[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0x12d')]][_0x0cf8('0x12b')]=![];delete _0x1e1d83[_0x0cf8('0x2a')][_0x281a5a['actionid']];unlockQueueStatus(_0x19930c);});}else{this['updateOriginated'](this[_0x0cf8('0x24')][this['actions'][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]]);this[_0x0cf8('0xc8')]({'active':![],'ContactId':this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]]['ContactId'],'ListId':this['actions'][_0x281a5a['actionid']][_0x0cf8('0xfb')],'VoiceQueueId':this['actions'][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xdd')]||undefined,'CampaignId':this[_0x0cf8('0x2a')][_0x281a5a['actionid']]['CampaignId']||undefined})[_0x0cf8('0xb9')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x281a5a[_0x0cf8('0x12a')]];unlockQueueStatus(_0x19930c);}}else if((strategy[this['voiceQueues'][this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]][_0x0cf8('0x54')]]||_0x0cf8('0x1e'))===_0x0cf8('0x1e')){var _0x212d4c;if(this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]]&&!_[_0x0cf8('0x4e')](this['queueBooked'][this[_0x0cf8('0x2a')][_0x281a5a['actionid']][_0x0cf8('0xbb')]])){if(this['queueBookedRR'][_0x1e1d83['actions'][_0x281a5a['actionid']][_0x0cf8('0xbb')]]){this['queueBookedRR'][_0x1e1d83[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]]=this[_0x0cf8('0x31')][this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]]?this[_0x0cf8('0x31')][this[_0x0cf8('0x2a')][_0x281a5a['actionid']][_0x0cf8('0xbb')]]:this[_0x0cf8('0x30')][this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]]['queue']]?this[_0x0cf8('0x30')][this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]][_0x0cf8('0x133')]||0x0:0x0;}this[_0x0cf8('0x30')][this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]][_0x0cf8('0xbb')]][_0x0cf8('0x133')]=this['queueBookedRR'][this[_0x0cf8('0x2a')][_0x281a5a[_0x0cf8('0x12a')]]['queue']];for(var _0x3d95a2=0x0;_0x3d95a2=0x0?!![]:![];})[_0x0cf8('0xb9')](myreject(_0x23abf9)));}}else{_0x1855e5[_0x0cf8('0x12e')](ami[_0x0cf8('0xb7')]({'action':_0x0cf8('0x14a'),'command':util[_0x0cf8('0x7e')](_0x0cf8('0x14b'),_0x15cb85,!_[_0x0cf8('0x44')](config[_0x0cf8('0x147')][_0x3e2524])?_0x3e2524:'')})['then'](function(_0x173058){return _0x173058[_0x0cf8('0x14c')][_0x0cf8('0x14e')](_0x0cf8('0x14d'))>=0x0?!![]:![];})[_0x0cf8('0xb9')](myreject(_0x23abf9)));}BPromise['all'](_0x1855e5)[_0x0cf8('0xc2')](function(_0x2bb08d){var _0x2ad001=_[_0x0cf8('0x14f')](_0x2bb08d);if(_0x2ad001){return _0x387cb3(_0x2ad001);}else{_0xdc3bb2[_0x0cf8('0x4a')]=_0x4b5529?_0x0cf8('0x150'):_0x0cf8('0x151');return _0x23abf9(msgResponse(_0x0cf8('0x152'),_0x0cf8('0x144'),_0x0cf8('0x153')+_0x4b5529+'\x20'+_0x275158+'\x20Interval\x20is\x20overtime:\x20'+util[_0x0cf8('0x9c')](_0x15cb85,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x3e2524));}})[_0x0cf8('0xb9')](function(_0x296636){return _0x23abf9(msgResponse('ifTime',_0x0cf8('0x144'),JSON['stringify'](_0x296636)));});});};Dialer[_0x0cf8('0xb0')]['checkDialMethod']=function(_0x4fbb27){var _0x17c20c=this;return function(){switch(_0x4fbb27[_0x0cf8('0x5e')]){case _0x0cf8('0x154'):freeVariablesPredictive(_0x4fbb27);_0x17c20c[_0x0cf8('0x155')](_0x4fbb27,0x1);break;case _0x0cf8('0x156'):freeVariablesPredictive(_0x4fbb27);_0x17c20c[_0x0cf8('0x155')](_0x4fbb27,_0x4fbb27[_0x0cf8('0x157')]);break;case _0x0cf8('0x8'):_0x17c20c[_0x0cf8('0x8')](_0x4fbb27);break;case'booked':freeVariablesPredictive(_0x4fbb27);_0x17c20c[_0x0cf8('0x155')](_0x4fbb27,0x1);break;default:freeVariablesPredictive(_0x4fbb27);logger[_0x0cf8('0x9a')](_0x0cf8('0x158'),_0x4fbb27['name'],_0x0cf8('0x159'));}};};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x15a')]=function(_0x3d29f2){var _0x3b886c=this;return function(){_0x3b886c['handleIvr'](_0x3d29f2);};};Dialer[_0x0cf8('0xb0')][_0x0cf8('0xa')]=function(_0x6c514e){var _0x26150c=this;if(isNotPreview(_0x6c514e['dialMethod'])){if(isVoiceQueueOutbound(_0x6c514e[_0x0cf8('0x52')])&&isActive(_0x6c514e[_0x0cf8('0x5d')])){_0x6c514e[_0x0cf8('0xa6')]=!![];BPromise[_0x0cf8('0xbf')]()[_0x0cf8('0xc2')](checkIsLoggedIn(_0x6c514e,_0x6c514e[_0x0cf8('0x56')]))[_0x0cf8('0xc2')](checkIsActive(_0x6c514e,_0x6c514e[_0x0cf8('0x5d')]))[_0x0cf8('0xc2')](checkInterval(_0x6c514e))[_0x0cf8('0xc2')](_0x26150c[_0x0cf8('0x13d')](_0x6c514e))[_0x0cf8('0xc2')](_0x26150c[_0x0cf8('0x141')](_0x6c514e[_0x0cf8('0x15b')],_0x6c514e[_0x0cf8('0x15c')],_0x6c514e[_0x0cf8('0x45')],_0x6c514e))[_0x0cf8('0xc2')](_0x26150c[_0x0cf8('0x143')](_0x6c514e[_0x0cf8('0x49')],_0x6c514e[_0x0cf8('0x15c')],_0x6c514e[_0x0cf8('0x45')],_0x6c514e))['then'](_0x26150c[_0x0cf8('0x15d')](_0x6c514e))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x6c514e));}else{notSendMessagesQueue(_0x6c514e);}}else{freeVariablesPredictive(_0x6c514e);}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x15e')]=function(){var _0x231994=this;var _0x429803;for(var _0x1c7b3b in this[_0x0cf8('0x25')]){if(this[_0x0cf8('0x25')][_0x0cf8('0x9e')](_0x1c7b3b)){_0x429803=this['campaigns'][_0x1c7b3b];if(isCampaignIvr(_0x429803[_0x0cf8('0x52')])&&isActive(_0x429803[_0x0cf8('0x7b')])){_0x429803[_0x0cf8('0xa6')]=!![];BPromise[_0x0cf8('0xbf')]()['then'](checkIsActive(_0x429803,_0x429803[_0x0cf8('0x7b')]))[_0x0cf8('0xc2')](checkInterval(_0x429803))[_0x0cf8('0xc2')](_0x231994[_0x0cf8('0x13d')](_0x429803))[_0x0cf8('0xc2')](_0x231994[_0x0cf8('0x141')](_0x429803[_0x0cf8('0x15b')],_0x429803[_0x0cf8('0x15c')],_0x429803['name'],_0x429803))[_0x0cf8('0xc2')](_0x231994[_0x0cf8('0x143')](_0x429803[_0x0cf8('0x49')],_0x429803[_0x0cf8('0x15c')],_0x429803['name'],_0x429803))[_0x0cf8('0xc2')](_0x231994[_0x0cf8('0x15a')](_0x429803))[_0x0cf8('0xb9')](loggerCatchQueueSummary(_0x0cf8('0x15f'),_0x429803));}else{notSendMessagesCampaign(_0x429803);}}}};function getCallerIdRandom(_0x536505,_0x355e20){var _0x34ef36,_0x10cea9,_0x2c955a;if(_0x355e20<=0x0){_0x355e20=0x1;}_0x34ef36=new RegExp(_0x0cf8('0x160')+_0x355e20+'}$');_0x10cea9=Math[_0x0cf8('0x161')](0xa,_0x355e20-0x1);_0x2c955a=Math[_0x0cf8('0x161')](0xa,_0x355e20)-0x1;return util['format']('%s',_['replace'](_0x536505,_0x34ef36,_[_0x0cf8('0x162')](_0x10cea9,_0x2c955a)));}function extractCalleridName(_0x9c8d04){var _0x40890f=_0x9c8d04[_0x0cf8('0x163')](/"(.*?)"/);return _0x40890f?_0x40890f[0x1]:_0x9c8d04;}function extractCalleridNumber(_0x4be96a){var _0xa51741=_0x4be96a['match'](/<(.*?)>/);return _0xa51741?_0xa51741[0x1]:_0x4be96a;}Dialer[_0x0cf8('0xb0')][_0x0cf8('0x164')]=function(_0xa1c9cf,_0x2fb40e){var _0x1ae2f3=this;var _0x2595bd=uuid['v4']();this[_0x0cf8('0x2a')][_0x2595bd]=new Action(_0xa1c9cf,_0x2fb40e,_0x2595bd);return new BPromise(function(_0x3126b5,_0x22dec5){if(_['isUndefined'](_0xa1c9cf)&&_0x0cf8('0x165')!==typeof _0xa1c9cf){return _0x22dec5(msgResponse(_0x0cf8('0x166'),_0x0cf8('0x144'),_0x0cf8('0x167')));}if(_[_0x0cf8('0x44')](_0x2fb40e[_0x0cf8('0x168')][_0x0cf8('0x169')])||_0x2fb40e[_0x0cf8('0x168')][_0x0cf8('0x169')]===null){return _0x22dec5(msgResponse(_0x0cf8('0x166'),_0x0cf8('0x144'),'contact\x20is\x20undefine'));}var _0x21deaa={'XMD-CALLERID':_0x1ae2f3[_0x0cf8('0x2a')][_0x2595bd]['getCaller'](),'XMD-AGI':_0xa1c9cf[_0x0cf8('0x108')]?util[_0x0cf8('0x7e')](_0x0cf8('0x16a'),ipAgi,_0xa1c9cf[_0x0cf8('0x108')]):_0x0cf8('0x16b'),'XMD-AGIAFTER':_0xa1c9cf[_0x0cf8('0x11b')]?util['format'](_0x0cf8('0x16a'),ipAgi,_0xa1c9cf['dialQueueProject2']):_0x0cf8('0x16b'),'XMD-QUEUE':_0xa1c9cf[_0x0cf8('0x52')]===_0x0cf8('0x53')?util[_0x0cf8('0x7e')](_0x0cf8('0x16c'),_0xa1c9cf[_0x0cf8('0x45')],_0xa1c9cf[_0x0cf8('0x16d')]||'',_0xa1c9cf[_0x0cf8('0x10f')]?'c':'',_0xa1c9cf[_0x0cf8('0x115')]||0x3):_0x0cf8('0x16b'),'XMD-CONTACTID':_0x2fb40e[_0x0cf8('0xdb')],'XMD-CDRTYPE':_0x0cf8('0x6'),'CALLERID(all)':_0x1ae2f3[_0x0cf8('0x2a')][_0x2595bd][_0x0cf8('0x16e')](),'XMD-AMD':_0xa1c9cf[_0x0cf8('0xe6')]?_0x0cf8('0x16f'):_0x0cf8('0x16b'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0xa1c9cf['dialAMDActive']){_0x21deaa[_0x0cf8('0x170')]=_0xa1c9cf[_0x0cf8('0x171')]||0x9c4;_0x21deaa[_0x0cf8('0x172')]=_0xa1c9cf[_0x0cf8('0x173')]||0x5dc;_0x21deaa[_0x0cf8('0x174')]=_0xa1c9cf['dialAMDAfterGreetingSilence']||0x320;_0x21deaa['XMD-AMDTOTALANALYSISTIME']=_0xa1c9cf['dialAMDTotalAnalysisTime']||0x1388;_0x21deaa[_0x0cf8('0x175')]=_0xa1c9cf[_0x0cf8('0x176')]||0x64;_0x21deaa[_0x0cf8('0x177')]=_0xa1c9cf[_0x0cf8('0x178')]||0x32;_0x21deaa['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0xa1c9cf['dialAMDMaximumNumberOfWords']||0x3;_0x21deaa[_0x0cf8('0x179')]=_0xa1c9cf[_0x0cf8('0x17a')]||0x100;_0x21deaa[_0x0cf8('0x17b')]=_0xa1c9cf[_0x0cf8('0x17c')]||0x1388;}if(_0xa1c9cf[_0x0cf8('0x52')]===_0x0cf8('0x53')){_0x21deaa[_0x0cf8('0x17d')]=_0x2fb40e[_0x0cf8('0xdd')];}else{_0x21deaa[_0x0cf8('0x17e')]=_0x2fb40e[_0x0cf8('0xfc')];}for(var _0x144efd in _0x2fb40e['Contact']){if(_0x2fb40e[_0x0cf8('0x168')][_0x0cf8('0x9e')](_0x144efd)){if(isNotNull(_0x2fb40e[_0x0cf8('0x168')][_0x144efd])&&_0x144efd!=='id'&&_0x144efd!==_0x0cf8('0x17f')&&_0x144efd!==_0x0cf8('0x180')&&_0x144efd!=='updatedAt'){_0x21deaa[util[_0x0cf8('0x7e')](_0x0cf8('0x181'),_0x0cf8('0x182'),_[_0x0cf8('0x183')](_0x144efd))]=_0x2fb40e[_0x0cf8('0x168')][_0x144efd];}}}var _0x2030fe=_0x1ae2f3[_0x0cf8('0xe1')](_0xa1c9cf['Trunk'])?getCallerId(_0xa1c9cf[_0x0cf8('0x7a')][_0x0cf8('0x7c')],_0xa1c9cf['dialOriginateCallerIdName'],_0xa1c9cf[_0x0cf8('0x184')]>0x0?getCallerIdRandom(_0xa1c9cf['dialOriginateCallerIdNumber'],_0xa1c9cf[_0x0cf8('0x184')]):_0xa1c9cf['dialOriginateCallerIdNumber']):getCallerId(_[_0x0cf8('0xb6')](_0xa1c9cf[_0x0cf8('0x13e')])?_0xa1c9cf[_0x0cf8('0x7a')][_0x0cf8('0x7c')]:_0xa1c9cf['TrunkBackup'][_0x0cf8('0x7c')],_0xa1c9cf['dialOriginateCallerIdName'],_0xa1c9cf['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0xa1c9cf[_0x0cf8('0x185')],_0xa1c9cf[_0x0cf8('0x184')]):_0xa1c9cf[_0x0cf8('0x185')]);if(_0x2030fe){_0x21deaa['XMD-ORIGINATECALLERIDNAME']=_0x1ae2f3['actions'][_0x2595bd][_0x0cf8('0x186')]=extractCalleridName(_0x2030fe);_0x21deaa[_0x0cf8('0x187')]=_0x1ae2f3['actions'][_0x2595bd][_0x0cf8('0x188')]=extractCalleridNumber(_0x2030fe);}return ami[_0x0cf8('0xb7')]({'actionid':_0x2595bd,'action':'originate','channel':_0x1ae2f3[_0x0cf8('0xe1')](_0xa1c9cf['Trunk'])?util[_0x0cf8('0x7e')](_0x0cf8('0x189'),_0xa1c9cf['Trunk'][_0x0cf8('0x45')],isNotNull(_0xa1c9cf['dialPrefix'])?_0xa1c9cf[_0x0cf8('0x18a')][_0x0cf8('0x18b')]()||'':'',_0xa1c9cf[_0x0cf8('0x18c')]>0x0?_0x2fb40e[_0x0cf8('0x168')][_0x0cf8('0x169')]['substring'](_0xa1c9cf[_0x0cf8('0x18c')]):_0x2fb40e['Contact'][_0x0cf8('0x169')]):util[_0x0cf8('0x7e')]('SIP/%s/%s%s',_[_0x0cf8('0xb6')](_0xa1c9cf[_0x0cf8('0x13e')])?_0xa1c9cf['Trunk'][_0x0cf8('0x45')]:_0xa1c9cf['TrunkBackup']['name'],isNotNull(_0xa1c9cf[_0x0cf8('0x18a')])?_0xa1c9cf[_0x0cf8('0x18a')][_0x0cf8('0x18b')]()||'':'',_0xa1c9cf[_0x0cf8('0x18c')]>0x0?_0x2fb40e[_0x0cf8('0x168')][_0x0cf8('0x169')][_0x0cf8('0x18d')](_0xa1c9cf[_0x0cf8('0x18c')]):_0x2fb40e[_0x0cf8('0x168')][_0x0cf8('0x169')]),'callerid':_0x2030fe,'Exten':'xcally-motion-dialer','Context':_0x0cf8('0x18e'),'Priority':'1','variable':_0x21deaa,'timeout':(_0xa1c9cf[_0x0cf8('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2595bd})['then'](function(_0x37b2be){return _0x3126b5(_0x37b2be);})[_0x0cf8('0xb9')](function(_0x41beac){_0xa1c9cf['outboundOriginateFailureCallsDay']+=0x1;var _0x11fd9e=new History(_0x1ae2f3['actions'][_0x2595bd]);logger[_0x0cf8('0x9a')](util[_0x0cf8('0x7e')](_0x0cf8('0x18f'),JSON[_0x0cf8('0x7d')](_0x41beac)));_0x11fd9e['state']=0xe;_0x11fd9e[_0x0cf8('0xad')]=_0x0cf8('0x190');_0x11fd9e[_0x0cf8('0xaf')]=moment()[_0x0cf8('0x7e')](_0x0cf8('0xfa'));_0x11fd9e['endtime']=_0x11fd9e[_0x0cf8('0xaf')];_0x1ae2f3[_0x0cf8('0xd2')](_0x11fd9e)['catch'](loggerCatch(_0x0cf8('0x191')));_0x1ae2f3['moveContactManagedDialer'](_0x11fd9e)['catch'](loggerCatch(_0x0cf8('0x191')))[_0x0cf8('0x21')](function(){delete _0x1ae2f3[_0x0cf8('0x2a')][_0x2595bd];return _0x22dec5(msgResponse(_0x0cf8('0x166'),_0x0cf8('0x192'),_0x0cf8('0x193')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x2fb6be){var _0x2366bc=this[_0x0cf8('0x2a')][_0x2fb6be[_0x0cf8('0x12a')]];var _0x1e0db5=this;if(_0x2366bc){delete this[_0x0cf8('0x2a')][_0x2fb6be[_0x0cf8('0x12a')]];_0x2366bc[_0x0cf8('0x114')]=moment()[_0x0cf8('0x7e')](_0x0cf8('0xfa'));var _0x41f842=_0x2366bc[_0x0cf8('0x52')]==='ivr'?this[_0x0cf8('0x25')][_0x2366bc[_0x0cf8('0xbb')]]:this[_0x0cf8('0x24')][_0x2366bc[_0x0cf8('0x194')]()];if(!this[_0x0cf8('0xe0')](_0x2fb6be[_0x0cf8('0x195')])){this[_0x0cf8('0xba')](_0x41f842);return this[_0x0cf8('0x196')](_0x2366bc,_0x41f842,_0x2fb6be)[_0x0cf8('0xc2')](function(_0x3a791c){})[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x197')));}else{this['uniqueId'][_0x2fb6be['uniqueid']]=_0x2366bc;}}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x198')]=function(_0x3270c6,_0x390f57,_0x1c13b6){var _0x6ec0aa=new History(_0x390f57);if(_0x6ec0aa[_0x0cf8('0xf4')]+_0x6ec0aa[_0x0cf8('0xfe')]+_0x6ec0aa[_0x0cf8('0xff')]+_0x6ec0aa[_0x0cf8('0xf5')]+_0x6ec0aa['countdropretry']+_0x6ec0aa['countabandonedretry']+_0x6ec0aa[_0x0cf8('0xf0')]+_0x6ec0aa[_0x0cf8('0x100')]>=_0x1c13b6[_0x0cf8('0xf6')]-0x1){return!![];}switch(_0x3270c6){case 0x3:if(_0x6ec0aa['countnoanswerretry']>=_0x1c13b6[_0x0cf8('0x199')]-0x1){return!![];}else{this[_0x0cf8('0xc8')]({'active':![],'countnoanswerretry':_0x6ec0aa[_0x0cf8('0xff')]+=0x1,'scheduledat':moment()['add'](_0x1c13b6[_0x0cf8('0x19a')],_0x0cf8('0xf9'))[_0x0cf8('0x7e')](_0x0cf8('0xfa')),'ContactId':_0x6ec0aa[_0x0cf8('0xdb')],'ListId':_0x6ec0aa[_0x0cf8('0xfb')],'VoiceQueueId':_0x6ec0aa[_0x0cf8('0xdd')]||undefined,'CampaignId':_0x6ec0aa['CampaignId']||undefined})['catch'](loggerCatch(_0x0cf8('0x19b')));}break;case 0x5:if(_0x6ec0aa['countbusyretry']>=_0x1c13b6[_0x0cf8('0x19c')]-0x1){return!![];}else{this[_0x0cf8('0xc8')]({'active':![],'countbusyretry':_0x6ec0aa['countbusyretry']+=0x1,'scheduledat':moment()[_0x0cf8('0x103')](_0x1c13b6[_0x0cf8('0x19d')],_0x0cf8('0xf9'))[_0x0cf8('0x7e')](_0x0cf8('0xfa')),'ContactId':_0x6ec0aa[_0x0cf8('0xdb')],'ListId':_0x6ec0aa['ListId'],'VoiceQueueId':_0x6ec0aa['VoiceQueueId']||undefined,'CampaignId':_0x6ec0aa[_0x0cf8('0xfc')]||undefined})['catch'](loggerCatch(_0x0cf8('0x19e')));}break;case 0x8:if(_0x6ec0aa[_0x0cf8('0xfe')]>=_0x1c13b6['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0x0cf8('0xc8')]({'active':![],'countcongestionretry':_0x6ec0aa['countcongestionretry']+=0x1,'scheduledat':moment()[_0x0cf8('0x103')](_0x1c13b6[_0x0cf8('0x19f')],'minutes')[_0x0cf8('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x6ec0aa['ContactId'],'ListId':_0x6ec0aa[_0x0cf8('0xfb')],'VoiceQueueId':_0x6ec0aa[_0x0cf8('0xdd')]||undefined,'CampaignId':_0x6ec0aa[_0x0cf8('0xfc')]||undefined})['catch'](loggerCatch(_0x0cf8('0x1a0')));}break;case 0x0:if(_0x6ec0aa[_0x0cf8('0xf5')]>=_0x1c13b6['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x6ec0aa[_0x0cf8('0xf5')]+=0x1,'scheduledat':moment()[_0x0cf8('0x103')](_0x1c13b6[_0x0cf8('0x1a1')],_0x0cf8('0xf9'))[_0x0cf8('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x6ec0aa[_0x0cf8('0xdb')],'ListId':_0x6ec0aa[_0x0cf8('0xfb')],'VoiceQueueId':_0x6ec0aa[_0x0cf8('0xdd')]||undefined,'CampaignId':_0x6ec0aa[_0x0cf8('0xfc')]||undefined})[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x1a2')));}break;case 0xa:if(_0x6ec0aa[_0x0cf8('0x11c')]>=_0x1c13b6[_0x0cf8('0x11d')]-0x1){return!![];}else{this[_0x0cf8('0xc8')]({'active':![],'countdropretry':_0x6ec0aa[_0x0cf8('0x11c')]+=0x1,'scheduledat':moment()[_0x0cf8('0x103')](_0x1c13b6['dialDropRetryFrequency'],_0x0cf8('0xf9'))[_0x0cf8('0x7e')](_0x0cf8('0xfa')),'ContactId':_0x6ec0aa[_0x0cf8('0xdb')],'ListId':_0x6ec0aa[_0x0cf8('0xfb')],'VoiceQueueId':_0x6ec0aa['VoiceQueueId']||undefined,'CampaignId':_0x6ec0aa[_0x0cf8('0xfc')]||undefined})[_0x0cf8('0xb9')](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x6ec0aa['countabandonedretry']>=_0x1c13b6[_0x0cf8('0x124')]-0x1){return!![];}else{this[_0x0cf8('0xc8')]({'active':![],'countabandonedretry':_0x6ec0aa[_0x0cf8('0x123')]+=0x1,'scheduledat':moment()[_0x0cf8('0x103')](_0x1c13b6[_0x0cf8('0x125')],_0x0cf8('0xf9'))[_0x0cf8('0x7e')](_0x0cf8('0xfa')),'ContactId':_0x6ec0aa[_0x0cf8('0xdb')],'ListId':_0x6ec0aa[_0x0cf8('0xfb')],'VoiceQueueId':_0x6ec0aa[_0x0cf8('0xdd')]||undefined,'CampaignId':_0x6ec0aa[_0x0cf8('0xfc')]||undefined})['catch'](loggerCatch(_0x0cf8('0x126')));}break;case 0x13:if(_0x6ec0aa[_0x0cf8('0xf0')]>=_0x1c13b6[_0x0cf8('0x101')]-0x1){return!![];}else{this[_0x0cf8('0xc8')]({'active':![],'countmachineretry':_0x6ec0aa['countmachineretry']+=0x1,'scheduledat':moment()[_0x0cf8('0x103')](_0x1c13b6[_0x0cf8('0xf8')],_0x0cf8('0xf9'))[_0x0cf8('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x6ec0aa['ContactId'],'ListId':_0x6ec0aa[_0x0cf8('0xfb')],'VoiceQueueId':_0x6ec0aa[_0x0cf8('0xdd')]||undefined,'CampaignId':_0x6ec0aa[_0x0cf8('0xfc')]||undefined})[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xfd')));}break;case 0x14:if(_0x6ec0aa[_0x0cf8('0x100')]>=_0x1c13b6['dialAgentRejectMaxRetry']-0x1){return!![];}else{this[_0x0cf8('0xc8')]({'active':![],'countagentrejectretry':_0x6ec0aa[_0x0cf8('0x100')]+=0x1,'scheduledat':moment()['add'](_0x1c13b6[_0x0cf8('0x1a3')],_0x0cf8('0xf9'))['format'](_0x0cf8('0xfa')),'ContactId':_0x6ec0aa[_0x0cf8('0xdb')],'ListId':_0x6ec0aa[_0x0cf8('0xfb')],'VoiceQueueId':_0x6ec0aa['VoiceQueueId']||undefined,'CampaignId':_0x6ec0aa[_0x0cf8('0xfc')]||undefined})[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x1a4')));}break;default:return!![];}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x196')]=function(_0x177c47,_0xd145d,_0x175a4b){var _0x5570c1=this;var _0x59c6f6=new History(_0x177c47);return new BPromise(function(_0x5f539f,_0x5dd2c6){if(_[_0x0cf8('0x44')](_0xd145d)&&'object'!==typeof _0xd145d){return _0x5dd2c6(msgResponse(_0x0cf8('0x1a5'),'Failure',_0x0cf8('0x1a6')));}if(_['isUndefined'](_0x175a4b)&&_0x0cf8('0x165')!==typeof _0x175a4b){return _0x5dd2c6(msgResponse(_0x0cf8('0x1a5'),_0x0cf8('0x144'),_0x0cf8('0x1a7')));}switch(_0x175a4b[_0x0cf8('0x10d')]){case'0':_0xd145d[_0x0cf8('0x69')]+=0x1;_0x59c6f6[_0x0cf8('0xac')]=0x0;_0x59c6f6[_0x0cf8('0xad')]='NoSuchNumber';_0x59c6f6[_0x0cf8('0xf5')]+=0x1;_0x59c6f6[_0x0cf8('0xf1')]+=0x1;ami[_0x0cf8('0x1a8')](_0x0cf8('0x1a9'),ut[_0x0cf8('0x1aa')](_0x177c47,_0x0cf8('0x1ab')));_0x5570c1['createHistory'](_0x59c6f6)[_0x0cf8('0xb9')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5570c1[_0x0cf8('0x198')](0x0,_0x177c47,_0xd145d)){if(_0x59c6f6['countnosuchnumberretry']>=_0xd145d[_0x0cf8('0x1ac')]){_0x5570c1[_0x0cf8('0x102')](_0x59c6f6,_0x5f539f,_0x5dd2c6,'reason\x200\x20no\x20such\x20number....');}else{_0x5570c1['stateGlobal'](_0x59c6f6,_0x5f539f,_0x5dd2c6,_0x0cf8('0x1ad'));}}break;case'3':_0xd145d[_0x0cf8('0x68')]+=0x1;_0x59c6f6[_0x0cf8('0xac')]=0x3;_0x59c6f6['statedesc']=_0x0cf8('0x1ae');_0x59c6f6[_0x0cf8('0xff')]+=0x1;_0x59c6f6['countglobal']+=0x1;ami[_0x0cf8('0x1a8')](_0x0cf8('0x1af'),ut['buildObj'](_0x177c47,'noanswer'));_0x5570c1[_0x0cf8('0xd2')](_0x59c6f6)['catch'](loggerCatch(_0x0cf8('0x1b0')));if(_0x5570c1[_0x0cf8('0x198')](0x3,_0x177c47,_0xd145d)){if(_0x59c6f6[_0x0cf8('0xff')]>=_0xd145d[_0x0cf8('0x199')]){_0x5570c1['createStateFinal'](_0x59c6f6,_0x5f539f,_0x5dd2c6,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5570c1['stateGlobal'](_0x59c6f6,_0x5f539f,_0x5dd2c6,_0x0cf8('0x1b1'));}}break;case'5':_0xd145d['outboundBusyCallsDay']+=0x1;_0x59c6f6['state']=0x5;_0x59c6f6[_0x0cf8('0xad')]=_0x0cf8('0x1b2');_0x59c6f6[_0x0cf8('0xf4')]+=0x1;_0x59c6f6[_0x0cf8('0xf1')]+=0x1;ami['emit']('custom:agentbusy',ut[_0x0cf8('0x1aa')](_0x177c47,'busy'));_0x5570c1[_0x0cf8('0xd2')](_0x59c6f6)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x1b3')));if(_0x5570c1['checkRetriveMax'](0x5,_0x177c47,_0xd145d)){if(_0x59c6f6['countbusyretry']>=_0xd145d[_0x0cf8('0x19c')]){_0x5570c1[_0x0cf8('0x102')](_0x59c6f6,_0x5f539f,_0x5dd2c6,'reason\x205\x20busy');}else{_0x5570c1['stateGlobal'](_0x59c6f6,_0x5f539f,_0x5dd2c6,'reason\x205\x20busy');}}break;case'8':_0xd145d[_0x0cf8('0x64')]+=0x1;_0x59c6f6[_0x0cf8('0xac')]=0x8;_0x59c6f6[_0x0cf8('0xad')]='Congestion';_0x59c6f6['countcongestionretry']+=0x1;_0x59c6f6[_0x0cf8('0xf1')]+=0x1;ami['emit'](_0x0cf8('0x1b4'),ut[_0x0cf8('0x1aa')](_0x177c47,_0x0cf8('0x1b5')));_0x5570c1['createHistory'](_0x59c6f6)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x1b6')));if(_0x5570c1['checkRetriveMax'](0x8,_0x177c47,_0xd145d)){if(_0x59c6f6[_0x0cf8('0xfe')]>=_0xd145d[_0x0cf8('0x1b7')]){_0x5570c1['createStateFinal'](_0x59c6f6,_0x5f539f,_0x5dd2c6,_0x0cf8('0x1b8'));}else{_0x5570c1[_0x0cf8('0x1b9')](_0x59c6f6,_0x5f539f,_0x5dd2c6,_0x0cf8('0x1b8'));}}break;case'11':_0xd145d[_0x0cf8('0x1ba')]+=0x1;_0x59c6f6[_0x0cf8('0xac')]=0xb;_0x59c6f6[_0x0cf8('0xad')]='Abandoned';_0x59c6f6[_0x0cf8('0x123')]+=0x1;_0x59c6f6[_0x0cf8('0xf1')]+=0x1;_0x5570c1[_0x0cf8('0xd2')](_0x59c6f6)[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x128')));if(_0x5570c1[_0x0cf8('0x198')](0xb,_0x177c47,_0xd145d)){if(_0x59c6f6[_0x0cf8('0x123')]>=_0xd145d[_0x0cf8('0x124')]){_0x5570c1[_0x0cf8('0x102')](_0x59c6f6,_0x5f539f,_0x5dd2c6,'reason\x2011\x20abandoned');}else{_0x5570c1[_0x0cf8('0x1b9')](_0x59c6f6,_0x5f539f,_0x5dd2c6,'reason\x2011\x20abandoned');}}break;case'20':_0xd145d['outboundRejectCallsDay']+=0x1;_0x59c6f6[_0x0cf8('0xac')]=0x14;_0x59c6f6['statedesc']='AgentReject';_0x59c6f6['countagentrejectretry']+=0x1;_0x59c6f6[_0x0cf8('0xf1')]+=0x1;ami[_0x0cf8('0x1a8')](_0x0cf8('0x1bb'),ut[_0x0cf8('0x1aa')](_0x177c47,'agentreject'));_0x5570c1[_0x0cf8('0xd2')](_0x59c6f6)[_0x0cf8('0xb9')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x5570c1[_0x0cf8('0x198')](0x14,_0x177c47,_0xd145d)){if(_0x59c6f6[_0x0cf8('0x100')]>=_0xd145d[_0x0cf8('0x1bc')]){_0x5570c1[_0x0cf8('0x102')](_0x59c6f6,_0x5f539f,_0x5dd2c6,'reason\x2020\x20agentreject');}else{_0x5570c1[_0x0cf8('0x1b9')](_0x59c6f6,_0x5f539f,_0x5dd2c6,'reason\x2020\x20agentreject');}}break;default:_0xd145d[_0x0cf8('0x6b')]+=0x1;_0x59c6f6[_0x0cf8('0xac')]=0xc;_0x59c6f6[_0x0cf8('0xad')]=_0x175a4b[_0x0cf8('0x10d')];_0x5570c1['createHistory'](_0x59c6f6)['catch'](loggerCatch(_0x0cf8('0x1bd')));if(_0x5570c1[_0x0cf8('0x198')](_0x175a4b[_0x0cf8('0x10d')],_0x177c47,_0xd145d)){if(_0x59c6f6['countbusyretry']+_0x59c6f6[_0x0cf8('0xfe')]+_0x59c6f6[_0x0cf8('0xff')]+_0x59c6f6[_0x0cf8('0xf5')]+_0x59c6f6[_0x0cf8('0x11c')]+_0x59c6f6[_0x0cf8('0x123')]+_0x59c6f6[_0x0cf8('0xf0')]+_0x59c6f6[_0x0cf8('0x100')]>=_0xd145d[_0x0cf8('0xf6')]){_0x5570c1[_0x0cf8('0x1b9')](_0x59c6f6,_0x5f539f,_0x5dd2c6,_0x175a4b[_0x0cf8('0x10d')]);}else{_0x5570c1[_0x0cf8('0x102')](_0x59c6f6,_0x5f539f,_0x5dd2c6,_0x175a4b['reason']);}}}});};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x1b9')]=function(_0x33e424,_0xc1893d,_0x581346,_0x11ac4c){var _0xc9e114=new Final(_0x33e424);_0xc9e114['state']=0xf;_0xc9e114[_0x0cf8('0xad')]=_0x0cf8('0x1be');this[_0x0cf8('0x102')](_0xc9e114,_0xc1893d,_0x581346,_0x11ac4c);};Dialer['prototype'][_0x0cf8('0x102')]=function(_0x794f33,_0x1bbb81,_0x4ca27a,_0x607cb9){this[_0x0cf8('0xd0')](_0x794f33)[_0x0cf8('0xc2')](function(_0x5e7237){return _0x1bbb81(msgResponse(_0x0cf8('0x1a5'),_0x0cf8('0x1bf'),_0x607cb9));})[_0x0cf8('0xb9')](function(_0x219057){return _0x4ca27a(msgResponse(_0x0cf8('0x1c0'),_0x0cf8('0x144'),_0x0cf8('0x1c1')));});};Dialer['prototype'][_0x0cf8('0x8')]=function(_0x11978e){var _0x19dada=this;var _0x2dcbe3=_0x11978e[_0x0cf8('0x1c2')]/0x64;var _0x7c0ed2=_0x11978e[_0x0cf8('0x67')]/(_0x11978e[_0x0cf8('0x67')]+_0x11978e[_0x0cf8('0x61')]);var _0x136251=Math[_0x0cf8('0x1c3')](_0x11978e['predictiveIntervalAvailable']*(_0x11978e['predictiveIntervalMaxThreshold']/0x64));var _0x3f6d7a=Math['round'](_0x11978e[_0x0cf8('0x75')]*(_0x11978e[_0x0cf8('0x1c4')]/0x64));var _0xe87d3a=_0x11978e['available']+_0x11978e[_0x0cf8('0x5a')];var _0x1f9596=Math[_0x0cf8('0x1c5')](_0x11978e['erlangCalls']*_0x11978e[_0x0cf8('0x92')]*_0x11978e[_0x0cf8('0x72')]*_0x11978e[_0x0cf8('0x73')]);if(_[_0x0cf8('0x44')](_0x11978e[_0x0cf8('0x2e')])){if(!_[_0x0cf8('0x44')](_0x11978e['startPredictive'])){_0x11978e[_0x0cf8('0x79')]=undefined;loggerPredictive[_0x0cf8('0x9a')](_0x0cf8('0x1c6'),_0x0cf8('0x1c7'));}if(!_[_0x0cf8('0x44')](_0x11978e[_0x0cf8('0x94')])){loggerPredictive[_0x0cf8('0x9a')]('[startMethodPredictive][StartProgressive]',_0x0cf8('0x1c8'));clearInterval(_0x11978e[_0x0cf8('0x94')]);_0x11978e[_0x0cf8('0x94')]=undefined;}_0x11978e['startProgressive']=moment()[_0x0cf8('0x7e')](_0x0cf8('0xfa'));loggerPredictive['info'](_0x11978e[_0x0cf8('0x45')],'collection\x20data\x20in\x20progressive\x20at',_0x11978e['startProgressive']);this[_0x0cf8('0x155')](_0x11978e,0x1);}else if(ifInterval(_0x11978e[_0x0cf8('0x1c9')],_0x11978e[_0x0cf8('0x2e')])){this[_0x0cf8('0x155')](_0x11978e,0x1);loggerPredictiveCalls['info'](_0x0cf8('0x1ca'),_0x11978e[_0x0cf8('0x2e')],_0x11978e[_0x0cf8('0x45')]);_0x11978e[_0x0cf8('0x77')]=0x0;_0x11978e[_0x0cf8('0x116')]=0x0;}else if(_0x2dcbe3<_0x7c0ed2&&_0x11978e[_0x0cf8('0x1cb')]==='dropRate'){freeVariablesPredictive(_0x11978e);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x1cc'),_0x0cf8('0x1cd'),_0x7c0ed2,_0x0cf8('0x2e'),_0x11978e[_0x0cf8('0x45')]);}else if(_0x1f9596<_0x11978e[_0x0cf8('0x116')]&&_0x11978e[_0x0cf8('0x1cb')]==='dropRate'){freeVariablesPredictive(_0x11978e);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x1ce'),_0x0cf8('0x1cf'),_0x1f9596,_0x0cf8('0x1d0'),_0x11978e['predictiveIntervalErlangCallsDroppedCalls'],_0x0cf8('0x2e'),_0x11978e['name']);}else if(!ifInterval(_0x11978e[_0x0cf8('0x1c9')],_0x11978e[_0x0cf8('0x2e')])&&_['isUndefined'](_0x11978e[_0x0cf8('0x79')])&&!_[_0x0cf8('0x44')](_0x11978e['startProgressive'])){_0x11978e['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0cf8('0x82')](_0x11978e['name'],'started\x20in\x20predictive\x20at',_0x11978e['startPredictive']);this[_0x0cf8('0xc5')](_0x11978e[_0x0cf8('0x1c9')])[_0x0cf8('0xc2')](this[_0x0cf8('0x1d1')](_0x11978e))[_0x0cf8('0xc2')](mergeDataErlangB(_0x11978e))[_0x0cf8('0xc2')](this[_0x0cf8('0x1d2')](_0x11978e))[_0x0cf8('0xb9')](loggerCatchPredictive(_0x0cf8('0x1d3'),_0x11978e));}else if(!ifInterval(_0x11978e[_0x0cf8('0x1c9')],_0x11978e[_0x0cf8('0x79')])){_0x11978e[_0x0cf8('0x116')]=0x0;_0x11978e[_0x0cf8('0x79')]=moment()['format'](_0x0cf8('0xfa'));loggerPredictive[_0x0cf8('0x82')](_0x11978e[_0x0cf8('0x45')],_0x0cf8('0x1d4'),_0x11978e[_0x0cf8('0x79')]);clearInterval(_0x11978e[_0x0cf8('0x94')]);_0x11978e[_0x0cf8('0x94')]=undefined;this[_0x0cf8('0xc5')](_0x11978e[_0x0cf8('0x1c9')])[_0x0cf8('0xc2')](this[_0x0cf8('0x1d1')](_0x11978e))[_0x0cf8('0xc2')](mergeDataErlangB(_0x11978e))[_0x0cf8('0xc2')](this[_0x0cf8('0x1d2')](_0x11978e))[_0x0cf8('0xb9')](loggerCatchPredictive(_0x0cf8('0x1d5'),_0x11978e));}else if(_0x11978e['predictiveIntervalAvailable']&&_0xe87d3a<_0x11978e['predictiveIntervalAvailable']-_0x3f6d7a){freeVariablesPredictive(_0x11978e);loggerPredictive[_0x0cf8('0x82')](_0x11978e[_0x0cf8('0x45')],_0x0cf8('0x1d6'),_0xe87d3a,')\x20are\x20less\x20than\x20threshold\x20(',_0x11978e['predictiveIntervalAvailable'],'-',_0x3f6d7a,'=',_0x11978e[_0x0cf8('0x75')]-_0x3f6d7a,')');}else if(_0x11978e['predictiveIntervalAvailable']&&_0xe87d3a>_0x11978e[_0x0cf8('0x75')]+_0x136251){freeVariablesPredictive(_0x11978e);loggerPredictive[_0x0cf8('0x82')](_0x11978e[_0x0cf8('0x45')],_0x0cf8('0x1d6'),_0xe87d3a,_0x0cf8('0x1d7'),_0x11978e[_0x0cf8('0x75')],'+',_0x136251,'=',_0x11978e[_0x0cf8('0x75')]+_0x136251,')');}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x1d1')]=function(_0x27984a){var _0x59093b=this;return function(_0x18c97b){return new BPromise(function(_0x34a4f3,_0x3533a3){_[_0x0cf8('0xd9')](_0x27984a,_0x18c97b[0x0]);if(checkGetDataPredictive(_0x18c97b[0x0])){var _0x30130f=_0x27984a[_0x0cf8('0x75')]=_0x27984a[_0x0cf8('0x5a')]+_0x27984a['available'];var _0x83710=_0x27984a['dialPredictiveInterval']*0x3c;var _0x348c06=_0x18c97b[0x0][_0x0cf8('0x6e')]+_0x18c97b[0x0][_0x0cf8('0x6d')];var _0xac9f21=(_0x18c97b[0x0][_0x0cf8('0x6c')]+_0x18c97b[0x0][_0x0cf8('0x70')]+_0x18c97b[0x0][_0x0cf8('0x6f')])/_0x18c97b[0x0]['predictiveIntervalTotalCalls'];_0x27984a[_0x0cf8('0x72')]=_0xac9f21>0x0?_0xac9f21:0x1;switch(_0x27984a[_0x0cf8('0x1cb')]){case _0x0cf8('0x1d8'):var _0x43a32a=_0x27984a[_0x0cf8('0x1c2')]/0x64;return _0x59093b[_0x0cf8('0x1d9')](_0x30130f,_0x83710,_0x348c06,_0xac9f21,_0x43a32a)['then'](function(_0x57784c){return _0x34a4f3(_0x57784c);});case _0x0cf8('0x1da'):var _0x4bfb1f=_0x27984a['dialPredictiveOptimizationPercentage']/0x64;return _0x59093b[_0x0cf8('0x1db')](_0x30130f,_0x83710,_0x348c06,_0xac9f21,_0x4bfb1f)[_0x0cf8('0xc2')](function(_0x3522f9){return _0x34a4f3(_0x3522f9);});default:return _0x3533a3(msgResponse(_0x0cf8('0x1dc'),_0x0cf8('0x144'),_0x0cf8('0x1dd')));}}else{return _0x3533a3(msgResponse(_0x0cf8('0x1dc'),'Failure',_0x0cf8('0x1de')));}});};};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x1df')]=function(_0x5aed50){var _0x1522cf=this;return function(_0x191a7f){return new BPromise(function(_0xe4a992,_0x2ddf65){_[_0x0cf8('0xd9')](_0x5aed50,_0x191a7f[0x0]);if(checkGetDataPredictive(_0x191a7f[0x0])){loggerPredictive['info'](JSON[_0x0cf8('0x7d')](_0x191a7f[0x0]));if(_0x5aed50['dialPredictiveOptimization']==='dropRate'){return _0x1522cf['getVoiceQueueRtPauses'](_0x5aed50['id'])[_0x0cf8('0xc2')](function(_0xb894be){var _0x4b3fd7=_0x5aed50[_0x0cf8('0x56')]-_0xb894be[0x0][_0x0cf8('0x1e0')];var _0x32c944=_0x5aed50[_0x0cf8('0x1c9')]*0x3c;var _0x2ef2e2=_0x191a7f[0x0]['predictiveIntervalAvgTalktime']+_0x191a7f[0x0]['predictiveIntervalAvgHoldtime'];var _0xd4bbca=(_0x191a7f[0x0][_0x0cf8('0x6c')]+_0x191a7f[0x0][_0x0cf8('0x70')]+_0x191a7f[0x0][_0x0cf8('0x6f')])/_0x191a7f[0x0]['predictiveIntervalTotalCalls'];var _0x4633fa=_0x5aed50[_0x0cf8('0x1c2')]/0x64;_0x5aed50[_0x0cf8('0x74')]=_0xb894be[0x0][_0x0cf8('0x1e0')]||0x0;_0x5aed50[_0x0cf8('0x72')]=_0xd4bbca>0x0?_0xd4bbca:0x1;return _0x1522cf['abandonmentRate'](_0x4b3fd7,_0x32c944,_0x2ef2e2,_0xd4bbca,_0x4633fa);})[_0x0cf8('0xc2')](function(_0x1b50c9){return _0xe4a992(_0x1b50c9);})[_0x0cf8('0xb9')](function(_0x4d5e47){return _0x2ddf65(msgResponse('[CatchErlangB]',_0x0cf8('0x144'),JSON[_0x0cf8('0x7d')](_0x4d5e47)));});}if(_0x5aed50[_0x0cf8('0x1cb')]===_0x0cf8('0x1da')){return _0x1522cf[_0x0cf8('0xce')](_0x5aed50['id'])[_0x0cf8('0xc2')](function(_0x51f4ff){var _0x2dd772=_0x5aed50[_0x0cf8('0x56')]-_0x51f4ff[0x0][_0x0cf8('0x1e0')];var _0x388959=_0x5aed50['dialPredictiveInterval']*0x3c;var _0x3f0498=_0x191a7f[0x0][_0x0cf8('0x6e')]+_0x191a7f[0x0][_0x0cf8('0x6d')];var _0x3e541e=(_0x191a7f[0x0][_0x0cf8('0x6c')]+_0x191a7f[0x0][_0x0cf8('0x70')]+_0x191a7f[0x0][_0x0cf8('0x6f')])/_0x191a7f[0x0]['predictiveIntervalTotalCalls'];var _0x2ffe9d=_0x5aed50['dialPredictiveOptimizationPercentage']/0x64;_0x5aed50[_0x0cf8('0x74')]=_0x51f4ff[0x0][_0x0cf8('0x1e0')]||0x0;_0x5aed50['predictiveIntervalHitRate']=_0x3e541e>0x0?_0x3e541e:0x1;return _0x1522cf[_0x0cf8('0x1db')](_0x2dd772,_0x388959,_0x3f0498,_0x3e541e,_0x2ffe9d);})['then'](function(_0xd28ebe){return _0xe4a992(_0xd28ebe);})[_0x0cf8('0xb9')](function(_0x152136){return _0x2ddf65(msgResponse(_0x0cf8('0x1e1'),_0x0cf8('0x144'),JSON[_0x0cf8('0x7d')](_0x152136)));});}}else{return _0x2ddf65(msgResponse(_0x0cf8('0x1dc'),'Failure',_0x0cf8('0x1de')));}});};};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x1d2')]=function(_0x412a2b){var _0x2d305b=this;return function(){var _0x4e5652=0x0;var _0x2098b3=Math['floor'](_0x412a2b['erlangCallToSecond']*0x3e8);if(_0x2098b3>0x0){_0x2098b3=_0x2098b3<0x64?0x64:_0x2098b3;loggerPredictive[_0x0cf8('0x82')](_0x412a2b[_0x0cf8('0x45')],_0x0cf8('0x1e2'),_0x2098b3,_0x0cf8('0x50'));_0x412a2b[_0x0cf8('0x94')]=setInterval(function(){_0x2d305b['handlePredictive'](_0x412a2b);loggerPredictiveCalls[_0x0cf8('0x82')](_0x0cf8('0x1e3'),_0x4e5652+=0x1);},_0x2098b3);}else{loggerPredictive[_0x0cf8('0x82')](_0x412a2b[_0x0cf8('0x45')],_0x0cf8('0x1e4'));}};};Dialer[_0x0cf8('0xb0')]['checkContactBlack']=function(_0x22f635,_0x5c733c){var _0x1db45f=this;return function(_0x18ad7f){if(_[_0x0cf8('0x4e')](_0x18ad7f)){if(_[_0x0cf8('0xb6')](_0x5c733c[_0x0cf8('0xdc')])||!_0x5c733c[_0x0cf8('0x1e5')]){if(_0x22f635[_0x0cf8('0x5e')]===_0x0cf8('0x7')){_0x22f635['queueStatusComplete']=_[_0x0cf8('0x44')](_0x22f635[_0x0cf8('0x130')])?!![]:_0x22f635['queueStatusComplete'];var _0x347353=uuid['v4']();_0x1db45f[_0x0cf8('0x2a')][_0x347353]=new Action(_0x22f635,_0x5c733c,_0x347353);loggerBooked['info'](_0x0cf8('0x1e6'),_0x347353,_0x0cf8('0x1e7'),JSON[_0x0cf8('0x7d')](_0x22f635[_0x0cf8('0x130')]),_0x0cf8('0x1e8'),_0x22f635[_0x0cf8('0x45')]);if(_0x22f635[_0x0cf8('0x130')]){_0x22f635[_0x0cf8('0x130')]=![];_0x1db45f[_0x0cf8('0x30')][_0x1db45f[_0x0cf8('0x2a')][_0x347353]['queue']]=[];ami[_0x0cf8('0xb7')]({'actionid':_0x347353,'action':_0x0cf8('0x1e9'),'queue':_0x22f635[_0x0cf8('0x45')]})[_0x0cf8('0xb9')](function(_0x31f453){_0x1db45f[_0x0cf8('0xba')](_0x22f635);_0x1db45f[_0x0cf8('0xc8')]({'active':![],'ContactId':_0x1db45f[_0x0cf8('0x2a')][_0x347353][_0x0cf8('0xdb')],'ListId':_0x1db45f[_0x0cf8('0x2a')][_0x347353][_0x0cf8('0xfb')],'VoiceQueueId':_0x1db45f[_0x0cf8('0x2a')][_0x347353][_0x0cf8('0xdd')]||undefined,'CampaignId':_0x1db45f[_0x0cf8('0x2a')][_0x347353]['CampaignId']||undefined})[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0x1ea')));delete _0x1db45f[_0x0cf8('0x2a')][_0x347353];});}else{loggerBooked[_0x0cf8('0x82')](_0x0cf8('0x1eb'),JSON[_0x0cf8('0x7d')](_0x22f635[_0x0cf8('0x130')]),'Queue:\x20',_0x22f635[_0x0cf8('0x45')]);_0x1db45f[_0x0cf8('0xba')](_0x22f635);_0x1db45f['rescheduleContact']({'active':![],'ContactId':_0x1db45f[_0x0cf8('0x2a')][_0x347353][_0x0cf8('0xdb')],'ListId':_0x1db45f[_0x0cf8('0x2a')][_0x347353][_0x0cf8('0xfb')],'VoiceQueueId':_0x1db45f['actions'][_0x347353]['VoiceQueueId']||undefined,'CampaignId':_0x1db45f[_0x0cf8('0x2a')][_0x347353][_0x0cf8('0xfc')]||undefined})[_0x0cf8('0xb9')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1db45f[_0x0cf8('0x2a')][_0x347353];}}else{return _0x1db45f['actionOriginate'](_0x22f635,_0x5c733c);}}else{if(getDiff(_0x5c733c[_0x0cf8('0x1ec')])<_0x22f635[_0x0cf8('0x1ed')]*0x3c){if(_0x5c733c[_0x0cf8('0x1ee')]&&!_0x5c733c[_0x0cf8('0x1ee')]['voicePause']){_0x1db45f[_0x0cf8('0x23')][_0x0cf8('0x132')](_0x5c733c['id'])['finally'](function(){_0x1db45f[_0x0cf8('0xba')](_0x22f635);});}else{_0x1db45f[_0x0cf8('0xca')]({'active':![]},_0x5c733c['id'],0x1)['finally'](function(){console[_0x0cf8('0x1ef')](_0x0cf8('0x1f0'));_0x1db45f['updateOriginated'](_0x22f635);});}}else{_0x22f635[_0x0cf8('0x1f1')]+=0x1;_0x1db45f[_0x0cf8('0xba')](_0x22f635);if(_0x22f635[_0x0cf8('0x1f2')]){_0x1db45f[_0x0cf8('0xc8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5c733c['ContactId'],'ListId':_0x5c733c[_0x0cf8('0xfb')],'VoiceQueueId':_0x5c733c[_0x0cf8('0xdd')]||undefined,'CampaignId':_0x5c733c[_0x0cf8('0xfc')]||undefined})['catch'](loggerCatch(_0x0cf8('0x1f3')));_0x1db45f[_0x0cf8('0xd2')](createObjHistory(_0x22f635,_0x5c733c,_0x0cf8('0x1f4'),0x17,_0x0cf8('0x1f5')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x1db45f[_0x0cf8('0xd8')](createObjHistory(_0x22f635,_0x5c733c,_0x0cf8('0x1f6'),0x16,_0x0cf8('0x1f7')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x22f635[_0x0cf8('0x62')]+=0x1;_0x1db45f[_0x0cf8('0xd8')](createObjHistory(_0x22f635,_0x5c733c,_0x0cf8('0x1f8'),0xd,'Blacklist'),_0x0cf8('0x1f9'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x0cf8('0xb0')]['handleIvr']=function(_0x52053d){var _0x138a21=this;var _0x1c1700=[];var _0x3e8892=_0x52053d['limitCalls']-_0x52053d[_0x0cf8('0x9f')]-_0x52053d['temp'];emitCampaignSummary(_0x52053d);if(_0x3e8892>0x0){if(_0x3e8892>this['maxNumberOriginate']){_0x3e8892=this[_0x0cf8('0x28')];}_0x52053d['temp']+=_0x3e8892;this[_0x0cf8('0xcd')](_0x52053d['id'],_0x3e8892,_0x52053d['dialOrderByScheduledAt'])[_0x0cf8('0xc2')](function(_0x161e9f){_0x52053d[_0x0cf8('0x1fa')]-=_0x3e8892;_0x52053d[_0x0cf8('0x1fa')]=_0x52053d[_0x0cf8('0x1fa')]>0x0?_0x52053d[_0x0cf8('0x1fa')]:0x0;if(!checkContactEmpty(_0x161e9f)){_0x52053d['message']=_0x0cf8('0x1fb');logger[_0x0cf8('0x82')](_0x0cf8('0x1fc')+_0x52053d['name']);}else{_0x52053d[_0x0cf8('0x9f')]+=_0x161e9f[_0x0cf8('0x9d')];_0x52053d[_0x0cf8('0x4a')]=_0x0cf8('0x1fd');for(var _0xaffc56=0x0;_0xaffc56<_0x161e9f[_0x0cf8('0x9d')];_0xaffc56+=0x1){_0x52053d[_0x0cf8('0x1fe')]+=0x1;if(_[_0x0cf8('0xb6')](_0x161e9f[_0xaffc56])||_[_0x0cf8('0xb6')](_0x161e9f[_0xaffc56][_0x0cf8('0x168')])||_[_0x0cf8('0xb6')](_0x161e9f[_0xaffc56][_0x0cf8('0x168')][_0x0cf8('0x169')])){_0x138a21['emptyContact'](_0x0cf8('0x1ff'),_0x52053d,_0x161e9f[_0xaffc56]);}else{_0x138a21[_0x0cf8('0xc4')](_['pick'](_0x161e9f[_0xaffc56],[_0x0cf8('0xfc'),'Contact.phone']))['then'](_0x138a21[_0x0cf8('0x200')](_0x52053d,_0x161e9f[_0xaffc56]))[_0x0cf8('0xb9')](_0x138a21[_0x0cf8('0xd6')](_0x0cf8('0x201'),_0x52053d));}}}})[_0x0cf8('0xb9')](loggerGetContactDialer(_0x0cf8('0x202'),_0x52053d,_0x3e8892));}};Dialer[_0x0cf8('0xb0')]['handlePower']=function(_0xc900c3,_0x13009a){var _0x3dab03=this;var _0x23af73=[];var _0x202cf0=_0x13009a>=0x1?_0x13009a:0x1;var _0x52a482=[];if(_0xc900c3[_0x0cf8('0x5e')]===_0x0cf8('0x7')){_0x202cf0=0x1;}var _0x5eafd3=Math[_0x0cf8('0x1c5')](_0xc900c3[_0x0cf8('0x55')]*_0x202cf0)-_0xc900c3[_0x0cf8('0x9f')]-_0xc900c3[_0x0cf8('0x1fa')];emitVoiceQueueSummary(_0xc900c3);if(_0xc900c3[_0x0cf8('0x203')]>0x0){var _0x5b2ca5=_0xc900c3[_0x0cf8('0x203')]-_0xc900c3[_0x0cf8('0x9f')]-_0xc900c3[_0x0cf8('0x5a')]-_0xc900c3['temp']-_0xc900c3[_0x0cf8('0x57')];if(_0x5eafd3>_0x5b2ca5){_0x5eafd3=_0x5b2ca5;}}if(_0x5eafd3>0x0){if(_0xc900c3['dialMethod']===_0x0cf8('0x7')){_0x5eafd3=0x1;}if(_0x5eafd3>this[_0x0cf8('0x28')]){_0x5eafd3=this[_0x0cf8('0x28')];}_0xc900c3['temp']+=_0x5eafd3;for(var _0x160d90 in this[_0x0cf8('0x26')]){if(this[_0x0cf8('0x26')][_0x0cf8('0x9e')](_0x160d90)){if(this[_0x0cf8('0x26')][_0x160d90][_0x0cf8('0xac')]===_0x0cf8('0x204')&&this[_0x0cf8('0x26')][_0x160d90][_0x0cf8('0xb8')]==='reachable'){_0x23af73[_0x0cf8('0x12e')](this['agents'][_0x160d90]['id']);}}}this['getContactDialer'](_0xc900c3['id'],_0x23af73,_0x5eafd3,_0xc900c3[_0x0cf8('0x205')])['then'](function(_0x195e6c){_0xc900c3[_0x0cf8('0x1fa')]-=_0x5eafd3;_0xc900c3[_0x0cf8('0x1fa')]=_0xc900c3['temp']>0x0?_0xc900c3[_0x0cf8('0x1fa')]:0x0;if(!checkContactEmpty(_0x195e6c)){_0x3dab03[_0x0cf8('0xbe')](_0xc900c3)['then'](sendMessageReschedule(_0xc900c3))[_0x0cf8('0xb9')](loggerCatch(_0x0cf8('0xc0')));}else{_0xc900c3[_0x0cf8('0x9f')]+=_0x195e6c[_0x0cf8('0x9d')];_0xc900c3[_0x0cf8('0x4a')]=_0xc900c3[_0x0cf8('0x5e')]===_0x0cf8('0x7')?_0x0cf8('0x16f'):_0x0cf8('0x1fd');for(var _0x33cddd=0x0;_0x33cddd<_0x195e6c[_0x0cf8('0x9d')];_0x33cddd+=0x1){if(_[_0x0cf8('0xb6')](_0x195e6c[_0x33cddd])||_[_0x0cf8('0xb6')](_0x195e6c[_0x33cddd][_0x0cf8('0x168')])||_[_0x0cf8('0xb6')](_0x195e6c[_0x33cddd][_0x0cf8('0x168')][_0x0cf8('0x169')])){_0x3dab03[_0x0cf8('0xd7')](_0x0cf8('0x1ff'),_0xc900c3,_0x195e6c[_0x33cddd]);}else{_0x3dab03[_0x0cf8('0xc1')](_[_0x0cf8('0xda')](_0x195e6c[_0x33cddd],[_0x0cf8('0xdd'),_0x0cf8('0x206')]))[_0x0cf8('0xc2')](_0x3dab03[_0x0cf8('0x200')](_0xc900c3,_0x195e6c[_0x33cddd]))['catch'](_0x3dab03['loggerHandler'](_0x0cf8('0x1ff'),_0xc900c3));}}}})[_0x0cf8('0xb9')](loggerGetContactDialer('[getContactDialer2]',_0xc900c3,_0x5eafd3));}};Dialer[_0x0cf8('0xb0')]['handlePredictive']=function(_0x2df0e2){var _0x2b806b=this;if(_0x2df0e2[_0x0cf8('0x203')]>0x0){var _0x1d966a=_0x2df0e2[_0x0cf8('0x203')]-_0x2df0e2['originated']-_0x2df0e2[_0x0cf8('0x5a')];if(_0x1d966a>0x0){this['tryOriginatePredictive'](_0x2df0e2);}else{loggerPredictiveCalls[_0x0cf8('0x82')](_0x0cf8('0x207'));}}else{this[_0x0cf8('0x208')](_0x2df0e2);}};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x208')]=function(_0x221e93){var _0x4289c3=this;var _0x3e1b36=[];_0x221e93[_0x0cf8('0x9f')]+=0x1;for(var _0x28ad34 in this['agents']){if(this[_0x0cf8('0x26')][_0x0cf8('0x9e')](_0x28ad34)){if(this[_0x0cf8('0x26')][_0x28ad34][_0x0cf8('0xac')]===_0x0cf8('0x204')&&this[_0x0cf8('0x26')][_0x28ad34][_0x0cf8('0xb8')]===_0x0cf8('0x209')){_0x3e1b36['push'](this['agents'][_0x28ad34]['id']);}}}this[_0x0cf8('0xcb')](_0x221e93['id'],_0x3e1b36,0x1,_0x221e93[_0x0cf8('0x205')])[_0x0cf8('0xc2')](function(_0xbc2df){if(!checkContactEmpty(_0xbc2df)){checkContactLowerLimitOriginate(_0x221e93,0x1,0x0);_0x4289c3[_0x0cf8('0xbe')](_0x221e93)['then'](sendMessageReschedule(_0x221e93))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x221e93[_0x0cf8('0x4a')]='RUNNING';if(_[_0x0cf8('0xb6')](_0xbc2df[0x0])||_[_0x0cf8('0xb6')](_0xbc2df[0x0][_0x0cf8('0x168')])||_['isNil'](_0xbc2df[0x0][_0x0cf8('0x168')][_0x0cf8('0x169')])){_0x4289c3[_0x0cf8('0xd7')](_0x0cf8('0x1ff'),_0x221e93,_0xbc2df[0x0]);}else{_0x4289c3[_0x0cf8('0xc1')](_[_0x0cf8('0xda')](_0xbc2df[0x0],[_0x0cf8('0xdd'),_0x0cf8('0x206')]))[_0x0cf8('0xc2')](_0x4289c3[_0x0cf8('0x200')](_0x221e93,_0xbc2df[0x0]))[_0x0cf8('0xb9')](_0x4289c3['loggerHandler']('[actionOriginatePredictive]\x20',_0x221e93));}}})[_0x0cf8('0xb9')](loggerGetContactDialer(_0x0cf8('0x20a'),_0x221e93,0x1));emitVoiceQueueSummary(_0x221e93);};Dialer['prototype'][_0x0cf8('0x1d9')]=function(_0x3b518f,_0x1ef27c,_0x5a01b3,_0x5b1145,_0x57bc05,_0x54f492){loggerPredictive['info'](_0x0cf8('0x20b'));loggerPredictive['info'](_0x0cf8('0x20c'),_0x3b518f);loggerPredictive['info'](_0x0cf8('0x20d'),_0x1ef27c);loggerPredictive[_0x0cf8('0x82')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a01b3);loggerPredictive['info'](_0x0cf8('0x20e'),_0x5b1145);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x20f'),_0x57bc05);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x88'));return new BPromise(function(_0x48a9d3,_0x4a1151){if(_0x3b518f<=0x0||isNaN(_0x3b518f)){return _0x4a1151(msgResponse(_0x0cf8('0x210'),_0x0cf8('0x192'),_0x0cf8('0x211')+_0x3b518f));}if(_0x5a01b3<=0x0||isNaN(_0x5a01b3)){return _0x4a1151(msgResponse(_0x0cf8('0x210'),'Error','Ts\x20=\x20'+_0x5a01b3));}if(_0x5b1145<=0x0||isNaN(_0x5b1145)){return _0x4a1151(msgResponse(_0x0cf8('0x210'),_0x0cf8('0x192'),_0x0cf8('0x212')+_0x5b1145));}if(_0x1ef27c<=0x0||isNaN(_0x1ef27c)){return _0x4a1151(msgResponse(_0x0cf8('0x210'),_0x0cf8('0x192'),_0x0cf8('0x213')+_0x1ef27c));}if(_0x57bc05<=0x0||isNaN(_0x57bc05)){return _0x4a1151(msgResponse(_0x0cf8('0x210'),_0x0cf8('0x192'),'Amax\x20=\x20'+_0x57bc05));}_0x54f492=_0x54f492||0x0;var _0x234e2c=0x1/_0x5a01b3;var _0x59bb5a=0x0;var _0x36224b=0x0;var _0x184b10=0x0;var _0x1a4798=0x0;for(var _0x602c6d=0x0;_0x184b10<_0x57bc05;_0x602c6d+=0x1){_0x36224b=_0x602c6d/_0x1ef27c;_0x59bb5a=(_0x5b1145*_0x36224b+_0x54f492)/_0x234e2c;_0x184b10=erlangb(_0x59bb5a,_0x3b518f);_0x1a4798=_0x59bb5a/_0x3b518f*(0x1-erlangb(_0x59bb5a,_0x3b518f));}return _0x48a9d3({'erlangCalls':_0x602c6d,'erlangCallToSecond':_0x1ef27c/_0x602c6d,'erlangAbandonmentRate':_0x184b10,'erlangBusyFactor':_0x1a4798});});};Dialer[_0x0cf8('0xb0')][_0x0cf8('0x1db')]=function(_0x3e7af2,_0x3c5b41,_0xb2e405,_0x5780a8,_0xd09d87,_0x2a15c8){loggerPredictive[_0x0cf8('0x82')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x0cf8('0x20c'),_0x3e7af2);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x20d'),_0x3c5b41);loggerPredictive[_0x0cf8('0x82')](_0x0cf8('0x214'),_0xb2e405);loggerPredictive['info'](_0x0cf8('0x20e'),_0x5780a8);loggerPredictive['info'](_0x0cf8('0x215'),_0xd09d87);loggerPredictive[_0x0cf8('0x82')]('---------------------------');return new BPromise(function(_0x505191,_0x3071d3){if(_0x3e7af2<=0x0||isNaN(_0x3e7af2)){return _0x3071d3(msgResponse(_0x0cf8('0x216'),_0x0cf8('0x192'),_0x0cf8('0x211')+_0x3e7af2));}if(_0xb2e405<=0x0||isNaN(_0xb2e405)){return _0x3071d3(msgResponse(_0x0cf8('0x216'),_0x0cf8('0x192'),'Ts\x20=\x20'+_0xb2e405));}if(_0x5780a8<=0x0||isNaN(_0x5780a8)){return _0x3071d3(msgResponse('[busyFactor]',_0x0cf8('0x192'),'p\x20=\x20'+_0x5780a8));}if(_0x3c5b41<=0x0||isNaN(_0x3c5b41)){return _0x3071d3(msgResponse(_0x0cf8('0x216'),_0x0cf8('0x192'),_0x0cf8('0x213')+_0x3c5b41));}if(_0xd09d87<=0x0||isNaN(_0xd09d87)){return _0x3071d3(msgResponse(_0x0cf8('0x216'),'Error',_0x0cf8('0x217')+_0xd09d87));}_0x2a15c8=_0x2a15c8||0x0;var _0x3074c0=0x1/_0xb2e405;var _0x210d62=0x0;var _0x5e95f2=0x0;var _0x2bbc42=0x0;var _0xfbd7b5=0x0;for(var _0xa077a8=0x0;_0xfbd7b5<_0xd09d87;_0xa077a8+=0x1){_0x5e95f2=_0xa077a8/_0x3c5b41;_0x210d62=(_0x5780a8*_0x5e95f2+_0x2a15c8)/_0x3074c0;_0x2bbc42=erlangb(_0x210d62,_0x3e7af2);_0xfbd7b5=_0x210d62/_0x3e7af2*(0x1-erlangb(_0x210d62,_0x3e7af2));}return _0x505191({'erlangCalls':_0xa077a8,'erlangCallToSecond':_0x3c5b41/_0xa077a8,'erlangAbandonmentRate':_0x2bbc42,'erlangBusyFactor':_0xfbd7b5});});};module[_0x0cf8('0x218')]=Dialer;
\ No newline at end of file
+var _0x1546=['[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','AMD','amd','[syncAgentComplete][createHistory][0]','countnosuchnumberretry','countmachineretry','stateGlobal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','countglobal','countcongestionretry','countnoanswerretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','paused','agents','stateinterface','locked','strategy','rrmemory','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','push','command','interval','timezones','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','booked','Queue','method\x20not\x20recognized','launchHandleIvr','syncQueueSummary','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','response','checkRetriveMax','countbusyretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','outboundNoSuchCallsDay','buildObj','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','reason','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','[startMethodPredictive][StartProgressive][Loop]','dropRate','Dropped\x20calls\x20day','Drop\x20in\x20this\x20interval','dialPredictiveInterval','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','voicePause','log','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','handleIvr','limitCalls','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','p\x20=\x20','[busyFactor]','Ts\x20=\x20','exports','util','moment','md5','ioredis','../../../config/logger','dialer','predictive','predictiveCalls','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','sequence','preview','trunks','maxNumberOriginate','actions','optionPredictive','startPredictive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncHangup','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','available','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','seconds','startProgressive','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[getContactDialer2][ReScheduled]','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','uniqueId','[uniqueid]','clearZombieChannels','[actions]','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','voiceQueues','queue','[Dialer][checkChannel]','campaigns','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','rescheduleContact','unlockContact','getContactDialer','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','status','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','membername','[syncHangupInAMD][createHistory]'];(function(_0x51ec85,_0x46832c){var _0x59f6e8=function(_0x1deccd){while(--_0x1deccd){_0x51ec85['push'](_0x51ec85['shift']());}};_0x59f6e8(++_0x46832c);}(_0x1546,0x128));var _0x6154=function(_0x4b4322,_0x368826){_0x4b4322=_0x4b4322-0x0;var _0x55a13a=_0x1546[_0x4b4322];return _0x55a13a;};'use strict';var util=require(_0x6154('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x6154('0x1'));var rr=require('rr');var md5=require(_0x6154('0x2'));var Redis=require(_0x6154('0x3'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x6154('0x4'))(_0x6154('0x5'));var loggerBooked=require(_0x6154('0x4'))('booked');var loggerPredictive=require(_0x6154('0x4'))(_0x6154('0x6'));var loggerPredictiveCalls=require(_0x6154('0x4'))(_0x6154('0x7'));var loggerSyncQueueSummary=require(_0x6154('0x4'))('syncQueueSummary');var ami=require(_0x6154('0x8'));config['redis']=_['defaults'](config[_0x6154('0x9')],{'host':_0x6154('0xa'),'port':0x18eb});var io=require(_0x6154('0xb'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x6154('0xc'));var cmHopperHistory=require(_0x6154('0xd'));var cmHopperBlack=require(_0x6154('0xe'));var voiceQueueRt=require(_0x6154('0xf'));var Action=require(_0x6154('0x10'));var History=require('./history');var Final=require(_0x6154('0x11'));var AgentComplete=require(_0x6154('0x12'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x6154('0x13'));var ipAgi=process[_0x6154('0x14')][_0x6154('0x15')]||_0x6154('0x16');var strategy={'rrmemory':'rrmemory','roundrobin':_0x6154('0x17')};var Sequence=function(){};Sequence[_0x6154('0x18')][_0x6154('0x19')]=function(_0x226786){this[_0x6154('0x1a')]=this[_0x6154('0x1a')]?this[_0x6154('0x1a')]['finally'](_0x226786):_0x226786();};function Dialer(_0x23eb55,_0x491bfe){this[_0x6154('0x1b')]=new Sequence();this[_0x6154('0x1c')]=_0x491bfe;this['voiceQueues']=_0x23eb55['voiceQueues'];this['campaigns']=_0x23eb55['campaigns'];this['agents']=_0x23eb55['agents'];this[_0x6154('0x1d')]=_0x23eb55['trunks'];this[_0x6154('0x1e')]=config[_0x6154('0x1e')]||0x2;this['channels']={};this[_0x6154('0x1f')]={};this['contactsId']={};this['uniqueId']={};this[_0x6154('0x20')]={};this[_0x6154('0x21')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x6154('0x22')]={};this[_0x6154('0x23')]={};ami['on'](_0x6154('0x24'),this[_0x6154('0x25')][_0x6154('0x26')](this));ami['on'](_0x6154('0x27'),this['syncQueueCallerAbandon'][_0x6154('0x26')](this));ami['on'](_0x6154('0x28'),this[_0x6154('0x29')][_0x6154('0x26')](this));ami['on']('agentcomplete',this[_0x6154('0x2a')][_0x6154('0x26')](this));ami['on'](_0x6154('0x2b'),this['syncQueueSummary'][_0x6154('0x26')](this));ami['on']('hangup',this[_0x6154('0x2c')][_0x6154('0x26')](this));ami['on']('newexten',this[_0x6154('0x2d')][_0x6154('0x26')](this));ami['on']('varset',this['syncVarSet'][_0x6154('0x26')](this));ami['on'](_0x6154('0x2e'),this[_0x6154('0x2f')][_0x6154('0x26')](this));ami['on'](_0x6154('0x30'),this['syncQueueStatusComplete']['bind'](this));this[_0x6154('0x31')]();this[_0x6154('0x32')]();}function isNotNull(_0x56ded8){return _0x56ded8!==null&&!_[_0x6154('0x33')](_0x56ded8);}function checkIsLoggedIn(_0x294c2c,_0x5f5a85){return function(){if(_0x5f5a85<=0x0){_0x294c2c[_0x6154('0x34')]=_0x6154('0x35');throw _0x294c2c['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x5557c6){return _0x5557c6;}function checkIsActive(_0x7fe632,_0x2237d7){return function(){if(!isActive(_0x2237d7)){_0x7fe632[_0x6154('0x34')]=_0x6154('0x36');throw _0x7fe632[_0x6154('0x37')]+_0x6154('0x38');}};}function checkInterval(_0x5c9118){return function(){if(!isNotNull(_0x5c9118[_0x6154('0x39')])){_0x5c9118[_0x6154('0x34')]=_0x6154('0x3a');throw _0x5c9118[_0x6154('0x37')]+_0x6154('0x3b');}if(!isNotNull(_0x5c9118[_0x6154('0x39')][_0x6154('0x3c')])){_0x5c9118[_0x6154('0x34')]=_0x6154('0x3a');throw _0x5c9118[_0x6154('0x37')]+_0x6154('0x3b');}if(!isNotNull(_[_0x6154('0x3d')](_0x5c9118[_0x6154('0x39')][_0x6154('0x3c')]))){_0x5c9118[_0x6154('0x34')]=_0x6154('0x3a');throw _0x5c9118[_0x6154('0x37')]+_0x6154('0x3b');}};}function msgResponse(_0x1d0b45,_0x49231e,_0x243432){return{'action':_0x1d0b45,'response':_0x49231e,'message':_0x243432,'stack':_0x243432};}function myreject(_0x5717de){return function(_0x138e8a){return _0x5717de(msgResponse(_0x6154('0x3e'),_0x6154('0x3f'),JSON[_0x6154('0x40')](_0x138e8a)));};}function getSeconds(_0xb8f24b,_0x1ba08c){var _0x41fe1e=moment(_0xb8f24b)[_0x6154('0x41')](0x0);var _0x53119e=moment(_0x1ba08c)['milliseconds'](0x0);return _0x41fe1e[_0x6154('0x42')](_0x53119e,'seconds');}function emit(_0x339997,_0x35a0d0,_0x4d8e9b){io['to'](_0x339997)[_0x6154('0x43')](_0x35a0d0,_0x4d8e9b);}function emitVoiceQueueSummary(_0x287b87){if(_0x287b87[_0x6154('0x44')]===_0x6154('0x45')){var _0x412899={'id':_0x287b87['id'],'name':_0x287b87[_0x6154('0x37')],'strategy':_0x287b87['strategy'],'answered':_0x287b87['answered'],'available':_0x287b87[_0x6154('0x46')],'loggedIn':_0x287b87[_0x6154('0x47')],'pTalking':_0x287b87['pTalking'],'sumBillable':_0x287b87[_0x6154('0x48')],'sumDuration':_0x287b87['sumDuration'],'sumHoldTime':_0x287b87[_0x6154('0x49')]||0x0,'talking':_0x287b87[_0x6154('0x4a')],'total':_0x287b87[_0x6154('0x4b')],'type':_0x287b87[_0x6154('0x44')],'unmanaged':_0x287b87[_0x6154('0x4c')],'abandoned':_0x287b87[_0x6154('0x4d')],'waiting':_0x287b87[_0x6154('0x4e')],'loggedInDb':_0x287b87['loggedInDb'],'dialActive':_0x287b87[_0x6154('0x4f')],'dialMethod':_0x287b87['dialMethod'],'dialOriginateCallerIdName':_0x287b87[_0x6154('0x50')],'dialOriginateCallerIdNumber':_0x287b87['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x287b87['dialOriginateTimeout'],'dialPrefix':_0x287b87[_0x6154('0x51')],'outboundAnswerAgiCallsDay':_0x287b87[_0x6154('0x52')],'outboundAnswerCallsDay':_0x287b87[_0x6154('0x53')],'outboundBlacklistCallsDay':_0x287b87[_0x6154('0x54')],'outboundBusyCallsDay':_0x287b87['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x287b87[_0x6154('0x55')],'outboundDropCallsDayACS':_0x287b87[_0x6154('0x56')],'outboundDropCallsDayCallersExit':_0x287b87['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x287b87['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x287b87['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x287b87['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x287b87[_0x6154('0x57')],'outboundReCallsDay':_0x287b87['outboundReCallsDay'],'outboundRejectCallsDay':_0x287b87[_0x6154('0x58')],'outboundUnknownCallsDay':_0x287b87[_0x6154('0x59')],'predictiveIntervalAnsweredCalls':_0x287b87[_0x6154('0x5a')],'predictiveIntervalAvgHoldtime':_0x287b87[_0x6154('0x5b')],'predictiveIntervalAvgTalktime':_0x287b87['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x287b87[_0x6154('0x5c')],'predictiveIntervalDroppedCallsTimeout':_0x287b87[_0x6154('0x5d')],'predictiveIntervalErlangCalls':_0x287b87['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x287b87['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x287b87[_0x6154('0x5e')],'predictiveIntervalMultiplicativeFactor':_0x287b87[_0x6154('0x5f')],'predictiveIntervalPauses':_0x287b87[_0x6154('0x60')],'predictiveIntervalAvailable':_0x287b87[_0x6154('0x61')],'predictiveIntervalTotalCalls':_0x287b87[_0x6154('0x62')],'message':_0x287b87[_0x6154('0x34')],'originated':_0x287b87[_0x6154('0x63')],'erlangCalls':_0x287b87[_0x6154('0x64')],'erlangCallToSecond':_0x287b87[_0x6154('0x65')],'erlangAbandonmentRate':_0x287b87[_0x6154('0x66')],'erlangBusyFactor':_0x287b87['erlangBusyFactor'],'startPredictive':_0x287b87[_0x6154('0x21')],'startProgressive':_0x287b87['startProgressive']};if(_0x287b87[_0x6154('0x67')]){_0x412899[_0x6154('0x67')]={'id':_0x287b87[_0x6154('0x67')]['id'],'name':_0x287b87[_0x6154('0x67')][_0x6154('0x37')],'active':_0x287b87[_0x6154('0x67')][_0x6154('0x68')],'callerid':_0x287b87[_0x6154('0x67')][_0x6154('0x69')]};}if(_0x287b87[_0x6154('0x39')]){_0x412899[_0x6154('0x39')]={'id':_0x287b87[_0x6154('0x39')]['id'],'name':_0x287b87[_0x6154('0x39')][_0x6154('0x37')]};}var _0x9a8143=md5(JSON[_0x6154('0x40')](_0x412899));if(_0x287b87[_0x6154('0x2')]!==_0x9a8143){_0x287b87[_0x6154('0x2')]=_0x9a8143;emit(util[_0x6154('0x6a')](_0x6154('0x6b'),_0x412899[_0x6154('0x37')]),_0x6154('0x6c'),_0x412899);}}}function emitCampaignSummary(_0x337349){if(_0x337349[_0x6154('0x44')]===_0x6154('0x6d')){emit(util[_0x6154('0x6a')](_0x6154('0x6e'),_0x337349[_0x6154('0x37')]),_0x6154('0x6f'),_0x337349);}}function checkGetDataPredictive(_0x34c3a0){if(isNotNull(_0x34c3a0)){if(!_[_0x6154('0x3d')](_0x34c3a0)){loggerPredictive[_0x6154('0x70')](_0x6154('0x71'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34c3a0[_0x6154('0x62')]);loggerPredictive[_0x6154('0x70')](_0x6154('0x72'),_0x34c3a0[_0x6154('0x5a')]);loggerPredictive[_0x6154('0x70')](_0x6154('0x73'),_0x34c3a0[_0x6154('0x5d')]);loggerPredictive[_0x6154('0x70')](_0x6154('0x74'),_0x34c3a0['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0x6154('0x75'),_0x34c3a0['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x6154('0x70')](_0x6154('0x76'),_0x34c3a0[_0x6154('0x77')]);loggerPredictive[_0x6154('0x70')](_0x6154('0x78'));if(_0x34c3a0[_0x6154('0x62')]>0x0){if(!_[_0x6154('0x33')](_0x34c3a0['predictiveIntervalAvgTalktime'])&&_0x34c3a0['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x6154('0x70')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x6154('0x33')](_0x34c3a0[_0x6154('0x5b')])&&_0x34c3a0[_0x6154('0x5b')]>0x0){return!![];}else{loggerPredictive[_0x6154('0x70')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x6154('0x70')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x6154('0x70')]('History\x20information\x20are\x20empty');}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x569c13){return function(_0x22149f){loggerPredictive['info'](_0x6154('0x79'));loggerPredictive['info'](_0x6154('0x7a'),_0x22149f[_0x6154('0x64')]);loggerPredictive[_0x6154('0x70')](_0x6154('0x7b'),_0x22149f[_0x6154('0x65')]);loggerPredictive[_0x6154('0x70')](_0x6154('0x7c'),_0x22149f[_0x6154('0x66')]);loggerPredictive[_0x6154('0x70')](_0x6154('0x7d'),_0x22149f[_0x6154('0x7e')]);loggerPredictive[_0x6154('0x70')](_0x6154('0x7c'),_0x22149f[_0x6154('0x66')]);loggerPredictive['info'](_0x6154('0x78'));_[_0x6154('0x7f')](_0x569c13,_0x22149f);};}function getDiff(_0x92f94c){var _0x48e349=moment()[_0x6154('0x41')](0x0);var _0x15d767=moment(_0x92f94c)['milliseconds'](0x0);return _0x48e349[_0x6154('0x42')](_0x15d767,_0x6154('0x80'));}function ifInterval(_0xc1900a,_0x4e900c){if(_[_0x6154('0x33')](_0x4e900c)){return![];}if(getDiff(_0x4e900c)<_0xc1900a*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x1be1de){if(isNotNull(_0x1be1de)){if(!_[_0x6154('0x33')](_0x1be1de[_0x6154('0x81')])){_0x1be1de[_0x6154('0x81')]=undefined;loggerPredictive['info'](_0x1be1de['name'],_0x6154('0x82'));}if(!_[_0x6154('0x33')](_0x1be1de['startPredictive'])){_0x1be1de[_0x6154('0x21')]=undefined;loggerPredictive[_0x6154('0x70')](_0x1be1de[_0x6154('0x37')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x6154('0x33')](_0x1be1de[_0x6154('0x83')])){clearInterval(_0x1be1de[_0x6154('0x83')]);_0x1be1de[_0x6154('0x83')]=undefined;loggerPredictive[_0x6154('0x70')](_0x1be1de[_0x6154('0x37')],_0x6154('0x84'));}}}function erlangb(_0xa7a42f,_0x2e4361){if(_0x2e4361===0x0){return 0x0;}var _0x5cfd9f=0x1;for(var _0x4cf66e=0x1;_0x4cf66e<=_0x2e4361;_0x4cf66e+=0x1){_0x5cfd9f=0x1+_0x5cfd9f*_0x4cf66e/_0xa7a42f;}return 0x1/_0x5cfd9f;}function isVoiceQueueOutbound(_0x9ddfff){return _0x9ddfff==='outbound';}function isNotPreview(_0x161842){return _0x161842!==_0x6154('0x1c');}function isCampaignIvr(_0x54d320){return _0x54d320==='ivr';}function getCallerId(_0x4ed5e2,_0x1d7aa2,_0x5b4492){if(!_[_0x6154('0x33')](_0x5b4492)&&_0x6154('0x85')===typeof _0x5b4492&&!_[_0x6154('0x3d')](_0x5b4492)){if(!_['isUndefined'](_0x1d7aa2)&&'string'===typeof _0x1d7aa2&&!_['isEmpty'](_0x1d7aa2)){return util[_0x6154('0x6a')]('\x22%s\x22\x20<%s>',_0x1d7aa2,_0x5b4492);}return util[_0x6154('0x6a')](_0x6154('0x86'),_0x5b4492,_0x5b4492);}if(!_['isUndefined'](_0x4ed5e2)&&_0x6154('0x85')===typeof _0x4ed5e2&&!_[_0x6154('0x3d')](_0x4ed5e2)){return _0x4ed5e2;}return _0x6154('0x87');}function loggerCatchQueueSummary(_0x17c506,_0x1d341a){return function(_0x4493e1){freeVariablesPredictive(_0x1d341a);emitVoiceQueueSummary(_0x1d341a);emitCampaignSummary(_0x1d341a);loggerSyncQueueSummary[_0x6154('0x88')](_0x17c506,util[_0x6154('0x89')](_0x4493e1,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4cdf95,_0x3f687b){return function(_0x25d3a5){loggerPredictive[_0x6154('0x88')](_0x3f687b[_0x6154('0x37')],_0x4cdf95);loggerPredictive[_0x6154('0x88')](_0x25d3a5[_0x6154('0x8a')]);freeVariablesPredictive(_0x3f687b);};}function loggerCatch(_0x36f64e){return function(_0x5919bb){logger[_0x6154('0x88')](_0x36f64e,util['inspect'](_0x5919bb,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x110b91){return _0x110b91&&!_['isUndefined'](_0x110b91)&&_0x110b91[_0x6154('0x8b')]>0x0;}function decremetOriginate(_0x5ab9e0){if(!_[_0x6154('0x33')](_0x5ab9e0)&&_0x5ab9e0!==null){if(_0x5ab9e0[_0x6154('0x8c')]('originated')){if(_0x5ab9e0['originated']>0x0){_0x5ab9e0[_0x6154('0x63')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x6154('0x88')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x19f245,_0x2fd4f6,_0x17e530){if(_0x2fd4f6>_0x17e530){for(var _0x279d59=0x0;_0x279d59<_0x2fd4f6-_0x17e530;_0x279d59+=0x1){decremetOriginate(_0x19f245);}}}function loggerGetContactDialer(_0x271209,_0x3324b6,_0x53ac92){return function(_0x2340bf){checkContactLowerLimitOriginate(_0x3324b6,_0x53ac92,0x0);logger[_0x6154('0x88')](_0x271209,util[_0x6154('0x89')](_0x2340bf,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xe6ec05){return function(_0x4997ec){if(isNotNull(_0x4997ec)&&isNotNull(_0x4997ec[0x0])){if(_0x4997ec[0x0]['contactsRescheduled']>0x0){_0xe6ec05['message']='RESCHEDULED_CONTACTS';logger['info'](_0x6154('0x8d')+_0xe6ec05[_0x6154('0x37')],_0x4997ec[0x0]['contactsRescheduled'],'contacts');}else{_0xe6ec05[_0x6154('0x34')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x6154('0x70')](_0x6154('0x8e')+_0xe6ec05[_0x6154('0x37')]);}}};}function notSendMessagesQueue(_0x314f9d){if(_0x314f9d[_0x6154('0x8f')]){freeVariablesPredictive(_0x314f9d);if(_0x314f9d[_0x6154('0x63')]===0x0&&_0x314f9d[_0x6154('0x4a')]===0x0&&_0x314f9d[_0x6154('0x4e')]===0x0&&(_0x314f9d[_0x6154('0x90')]||0x0)===0x0){_0x314f9d[_0x6154('0x8f')]=![];_0x314f9d[_0x6154('0x46')]=0x0;_0x314f9d[_0x6154('0x34')]=_0x6154('0x36');loggerSyncQueueSummary[_0x6154('0x88')](_0x6154('0x91'),_0x314f9d[_0x6154('0x37')],_0x6154('0x92'));}else{_0x314f9d[_0x6154('0x34')]=_0x6154('0x93');loggerSyncQueueSummary[_0x6154('0x88')](_0x6154('0x91'),_0x314f9d[_0x6154('0x37')],_0x6154('0x94'));}emitVoiceQueueSummary(_0x314f9d);}}function notSendMessagesCampaign(_0x423046){if(_0x423046[_0x6154('0x8f')]){if(_0x423046[_0x6154('0x63')]===0x0){_0x423046[_0x6154('0x8f')]=![];_0x423046[_0x6154('0x34')]=_0x6154('0x36');loggerSyncQueueSummary['error'](_0x6154('0x95'),_0x423046[_0x6154('0x37')],_0x6154('0x92'));}else{_0x423046[_0x6154('0x34')]=_0x6154('0x93');loggerSyncQueueSummary[_0x6154('0x88')](_0x6154('0x95'),_0x423046[_0x6154('0x37')],_0x6154('0x94'));}emitCampaignSummary(_0x423046);}}function createObjHistory(_0x3f7b61,_0x4b8a2d,_0x286e12,_0x38f372,_0x376794){_0x3f7b61[_0x6154('0x34')]=_0x286e12;var _0x3c90d6=new Action(_0x3f7b61,_0x4b8a2d);var _0x2d7a25=new History(_0x3c90d6);_0x2d7a25[_0x6154('0x96')]=_0x38f372;_0x2d7a25[_0x6154('0x97')]=_0x376794;_0x2d7a25[_0x6154('0x98')]=_0x3c90d6[_0x6154('0x99')];return _0x2d7a25;}Dialer[_0x6154('0x18')][_0x6154('0x32')]=function(){var _0x5c0740=this;setInterval(function(){_0x5c0740['clearZombieChannels'](_0x5c0740[_0x6154('0x9a')],_0x6154('0x9b'));_0x5c0740[_0x6154('0x9c')](_0x5c0740[_0x6154('0x1f')],_0x6154('0x9d'));},0x32c8);};Dialer[_0x6154('0x18')]['clearZombieChannels']=function(_0x1e353a,_0x4ed233){var _0x53d2e6=this;for(var _0x52d14c in _0x1e353a){if(_0x1e353a[_0x6154('0x8c')](_0x52d14c)){this[_0x6154('0x1b')]['enqueue'](function(){if(!_[_0x6154('0x9e')](_0x1e353a[_0x52d14c])){return ami[_0x6154('0x9f')]({'action':'status','channel':_0x1e353a[_0x52d14c][_0x6154('0xa0')]})[_0x6154('0xa1')](function(_0xaf2577){if(_0xaf2577[_0x6154('0x34')]===_0x6154('0xa2')){setTimeout(function(){if(_0x1e353a[_0x52d14c]&&_0x1e353a[_0x52d14c][_0x6154('0x44')]!==_0x6154('0x6d')){_0x53d2e6[_0x6154('0xa3')](_0x53d2e6[_0x6154('0xa4')][_0x1e353a[_0x52d14c][_0x6154('0xa5')]]);logger[_0x6154('0x88')](_0x6154('0xa6'),_0x4ed233,_0x52d14c,_0x1e353a[_0x52d14c][_0x6154('0xa5')]);delete _0x1e353a[_0x52d14c];}if(_0x1e353a[_0x52d14c]&&_0x1e353a[_0x52d14c]['type']===_0x6154('0x6d')){_0x53d2e6[_0x6154('0xa3')](_0x53d2e6[_0x6154('0xa7')][_0x1e353a[_0x52d14c]['queue']]);logger[_0x6154('0x88')](_0x6154('0xa8'),_0x4ed233,_0x52d14c,_0x1e353a[_0x52d14c][_0x6154('0xa5')]);delete _0x1e353a[_0x52d14c];}},0x2328);}});}});}}};Dialer[_0x6154('0x18')][_0x6154('0xa9')]=function(_0x50aade){return BPromise[_0x6154('0xaa')]()[_0x6154('0xab')](cmHopper[_0x6154('0xa9')](_0x50aade))[_0x6154('0xa1')](loggerCatch(_0x6154('0xac')));};Dialer[_0x6154('0x18')][_0x6154('0xad')]=function(_0xf6728d){return BPromise[_0x6154('0xaa')]()[_0x6154('0xab')](cmHopperBlack[_0x6154('0xad')](_0xf6728d))[_0x6154('0xa1')](loggerCatch(_0x6154('0xae')));};Dialer[_0x6154('0x18')][_0x6154('0xaf')]=function(_0x16bc22){return BPromise[_0x6154('0xaa')]()['then'](cmHopperBlack[_0x6154('0xaf')](_0x16bc22))[_0x6154('0xa1')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x6154('0x18')][_0x6154('0xb0')]=function(_0x59cafb){return BPromise['resolve']()[_0x6154('0xab')](cmHopperHistory['avgHandleTime'](_0x59cafb))[_0x6154('0xa1')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x6154('0x18')][_0x6154('0xb1')]=function(_0x6c583a){return BPromise['resolve']()[_0x6154('0xab')](cmHopper[_0x6154('0xb1')](_0x6c583a))[_0x6154('0xa1')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x6154('0x18')]['unlockContact']=function(_0x6c4a1,_0x1aec28,_0x19802e){return BPromise[_0x6154('0xaa')]()[_0x6154('0xab')](cmHopper[_0x6154('0xb2')](_0x6c4a1,_0x1aec28,_0x19802e))[_0x6154('0xa1')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x6154('0x18')]['getContactDialer']=function(_0x115f99,_0xab9c31,_0x266630,_0x1e9431){return BPromise['resolve']()[_0x6154('0xab')](cmHopper[_0x6154('0xb3')](_0x115f99,_0xab9c31,_0x266630,_0x1e9431))[_0x6154('0xa1')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0x6154('0xb4')]=function(_0x3c562d,_0x5d1ecd,_0x57cb28){return BPromise[_0x6154('0xaa')]()[_0x6154('0xab')](cmHopper[_0x6154('0xb4')](_0x3c562d,_0x5d1ecd,_0x57cb28))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x6154('0x18')][_0x6154('0xb5')]=function(_0x35fe82){return BPromise[_0x6154('0xaa')]()[_0x6154('0xab')](voiceQueueRt[_0x6154('0xb5')](_0x35fe82))[_0x6154('0xa1')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x6154('0xb6')]=function(_0x3a468b){return BPromise['resolve']()[_0x6154('0xab')](cmHopper['moveContactManagedDialer'](_0x3a468b))[_0x6154('0xa1')](loggerCatch(_0x6154('0xb7')));};Dialer[_0x6154('0x18')][_0x6154('0xb8')]=function(_0x548dd0){return BPromise['resolve']()[_0x6154('0xab')](cmHopperHistory[_0x6154('0xb8')](_0x548dd0))[_0x6154('0xa1')](loggerCatch('[createHistory]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x15c810){if(!_[_0x6154('0x33')](_0x15c810)&&_0x15c810!==null){if(_0x15c810[_0x6154('0x8c')]('originated')){if(_0x15c810['originated']>0x0){_0x15c810[_0x6154('0x63')]-=0x1;}else{logger[_0x6154('0x88')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x6154('0x88')](_0x6154('0xb9'));}};Dialer[_0x6154('0x18')][_0x6154('0xba')]=function(_0x344fc9,_0x271e81){var _0xe901c5=this;return function(_0x468b53){_0xe901c5[_0x6154('0xa3')](_0x271e81);logger[_0x6154('0x88')](_0x344fc9,util[_0x6154('0x89')](_0x468b53,{'showHidden':![],'depth':null}));};};Dialer[_0x6154('0x18')]['emptyContact']=function(_0x42fe11,_0x20a94b,_0x559564){var _0x59de8e={'state':0x19,'statedesc':'notFound'};this[_0x6154('0xa3')](_0x20a94b);this[_0x6154('0xbb')](_['merge'](_0x59de8e,_[_0x6154('0xbc')](_0x559564,[_0x6154('0xbd'),_0x6154('0xbe'),_0x6154('0xbf'),_0x6154('0xc0'),_0x6154('0xc1')])),_0x6154('0xc2'),_0x6154('0xc3'));logger[_0x6154('0x88')](_0x42fe11);};Dialer[_0x6154('0x18')][_0x6154('0xc4')]=function(_0x5e7479){return _0x5e7479===_0x6154('0xc5');};Dialer[_0x6154('0x18')][_0x6154('0xc6')]=function(_0x50b5a2){return!_[_0x6154('0x33')](_0x50b5a2)&&_0x50b5a2&&!_[_0x6154('0x33')](_0x50b5a2[_0x6154('0x37')])&&!_['isUndefined'](_0x50b5a2[_0x6154('0x68')])&&_0x50b5a2[_0x6154('0x68')]&&(this['trunks'][util[_0x6154('0x6a')](_0x6154('0xc7'),_0x50b5a2[_0x6154('0x37')])]['status']===_0x6154('0xc8')||this['trunks'][util[_0x6154('0x6a')](_0x6154('0xc7'),_0x50b5a2[_0x6154('0x37')])][_0x6154('0xc9')]===_0x6154('0xca'));};Dialer['prototype'][_0x6154('0xbb')]=function(_0x195d1a,_0x28f2de,_0x582e44){this[_0x6154('0xb8')](_0x195d1a)[_0x6154('0xa1')](loggerCatch(_0x28f2de));this[_0x6154('0xb6')](_0x195d1a)[_0x6154('0xa1')](loggerCatch(_0x582e44));};Dialer[_0x6154('0x18')]['syncVarSet']=function(_0x3344d4){var _0xdea82c=this[_0x6154('0x9a')][_0x3344d4[_0x6154('0xcb')]];var _0x272e92;if(!_[_0x6154('0x9e')](_0x3344d4)&&!_[_0x6154('0x9e')](_0x3344d4[_0x6154('0xcc')])&&!_[_0x6154('0x9e')](_0x3344d4[_0x6154('0xcc')][_0x6154('0xcd')])&&_0x3344d4[_0x6154('0xce')]===_0x6154('0xcf')&&_0xdea82c){if(_0xdea82c[_0x6154('0x44')]!=='ivr'&&this['voiceQueues'][_0xdea82c[_0x6154('0xa5')]]['dialAMDActive']&&_0x3344d4[_0x6154('0xd0')]===_0x6154('0xd1')){delete this['uniqueId'][_0x3344d4['uniqueid']];this[_0x6154('0xa3')](this[_0x6154('0xa4')][_0xdea82c[_0x6154('0xa5')]]);this[_0x6154('0xa4')][_0xdea82c[_0x6154('0xa5')]][_0x6154('0x53')]+=0x1;this[_0x6154('0xa4')][_0xdea82c[_0x6154('0xa5')]][_0x6154('0x52')]+=0x1;_0x272e92=new Hangup(_0xdea82c,_0x3344d4);_0x272e92['state']=0x12;_0x272e92[_0x6154('0x97')]='HangupInAMD';_0x272e92[_0x6154('0xd2')]='AMD';this['saveInDb'](_0x272e92,_0x6154('0xd3'),_0x6154('0xd4'));}if(_0xdea82c[_0x6154('0x44')]!==_0x6154('0x6d')&&this[_0x6154('0xa4')][_0xdea82c[_0x6154('0xa5')]][_0x6154('0xd5')]&&_0x3344d4['value']===_0x6154('0xd6')){var _0x3b4fe4=this;return new BPromise(function(_0x56d931,_0x58e616){delete _0x3b4fe4[_0x6154('0x9a')][_0x3344d4['uniqueid']];_0x3b4fe4[_0x6154('0xa3')](_0x3b4fe4[_0x6154('0xa4')][_0xdea82c[_0x6154('0xa5')]]);_0x3b4fe4['voiceQueues'][_0xdea82c[_0x6154('0xa5')]][_0x6154('0x53')]+=0x1;_0x3b4fe4[_0x6154('0xa4')][_0xdea82c[_0x6154('0xa5')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4fcbc4=_0x3b4fe4[_0x6154('0xa4')][_0xdea82c[_0x6154('0xa5')]];var _0x437a46=new Hangup(_0xdea82c,_0x3344d4);_0x437a46['state']=0x13;_0x437a46[_0x6154('0x97')]=_0x6154('0xd7');_0x437a46[_0x6154('0xd2')]=_0x6154('0xd8');_0x437a46['countmachineretry']+=0x1;_0x437a46['countglobal']+=0x1;_0x437a46[_0x6154('0xd9')]=!![];_0x3b4fe4[_0x6154('0xb8')](_0x437a46)[_0x6154('0xa1')](loggerCatch(_0x6154('0xda')));if(_0x437a46['countbusyretry']+_0x437a46['countcongestionretry']+_0x437a46['countnoanswerretry']+_0x437a46[_0x6154('0xdb')]+_0x437a46['countdropretry']+_0x437a46['countabandonedretry']+_0x437a46[_0x6154('0xdc')]+_0x437a46['countagentrejectretry']>=_0x4fcbc4['dialGlobalMaxRetry']){_0x3b4fe4[_0x6154('0xdd')](_0x437a46,_0x56d931,_0x58e616,'reason19\x20machine....');}else{if(_0x437a46[_0x6154('0xdc')]>=_0x4fcbc4['dialMachineMaxRetry']){_0x3b4fe4['createStateFinal'](_0x437a46,_0x56d931,_0x58e616,'reason\x2019\x20machine....');}else{_0x3b4fe4[_0x6154('0xb1')]({'active':![],'countmachineretry':_0x437a46['countmachineretry'],'scheduledat':moment()[_0x6154('0xde')](_0x4fcbc4[_0x6154('0xdf')],_0x6154('0xe0'))['format'](_0x6154('0xe1')),'ContactId':_0x437a46[_0x6154('0xbd')],'ListId':_0x437a46[_0x6154('0xbe')],'VoiceQueueId':_0x437a46[_0x6154('0xc0')]||undefined,'CampaignId':_0x437a46[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0xe2')));_0x56d931({'reschedule':0x1});}}});}if(_0xdea82c[_0x6154('0x44')]===_0x6154('0x6d')&&this[_0x6154('0xa7')][_0xdea82c['queue']]['dialAMDActive']&&_0x3344d4[_0x6154('0xd0')]===_0x6154('0xd1')){delete this[_0x6154('0x9a')][_0x3344d4['uniqueid']];this[_0x6154('0xa3')](this['campaigns'][_0xdea82c[_0x6154('0xa5')]]);_0x272e92=new Hangup(_0xdea82c,_0x3344d4);_0x272e92[_0x6154('0x96')]=0x12;_0x272e92[_0x6154('0x97')]='HangupInAMD';_0x272e92[_0x6154('0xd2')]='AMD';this[_0x6154('0xbb')](_0x272e92,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0xdea82c[_0x6154('0x44')]===_0x6154('0x6d')&&this[_0x6154('0xa7')][_0xdea82c['queue']][_0x6154('0xd5')]&&_0x3344d4[_0x6154('0xd0')]==='MACHINE'){var _0x3b4fe4=this;return new BPromise(function(_0x36adc1,_0x175703){delete _0x3b4fe4[_0x6154('0x9a')][_0x3344d4['uniqueid']];_0x3b4fe4[_0x6154('0xa3')](_0x3b4fe4['campaigns'][_0xdea82c[_0x6154('0xa5')]]);_0x3b4fe4[_0x6154('0xa7')][_0xdea82c['queue']][_0x6154('0x53')]+=0x1;_0x3b4fe4[_0x6154('0xa7')][_0xdea82c[_0x6154('0xa5')]][_0x6154('0x52')]+=0x1;var _0x2a3c46=_0x3b4fe4['campaigns'][_0xdea82c[_0x6154('0xa5')]];var _0xa5e366=new Hangup(_0xdea82c,_0x3344d4);_0xa5e366['state']=0x13;_0xa5e366[_0x6154('0x97')]=_0x6154('0xd7');_0xa5e366[_0x6154('0xd2')]=_0x6154('0xd8');_0xa5e366[_0x6154('0xdc')]+=0x1;_0xa5e366[_0x6154('0xe3')]+=0x1;_0xa5e366[_0x6154('0xd9')]=!![];_0x3b4fe4['createHistory'](_0xa5e366)['catch'](loggerCatch(_0x6154('0xda')));if(_0xa5e366['countbusyretry']+_0xa5e366[_0x6154('0xe4')]+_0xa5e366[_0x6154('0xe5')]+_0xa5e366[_0x6154('0xdb')]+_0xa5e366['countdropretry']+_0xa5e366[_0x6154('0xe6')]+_0xa5e366[_0x6154('0xdc')]+_0xa5e366[_0x6154('0xe7')]>=_0x2a3c46[_0x6154('0xe8')]){_0x3b4fe4[_0x6154('0xdd')](_0xa5e366,_0x36adc1,_0x175703,_0x6154('0xe9'));}else{if(_0xa5e366['countmachineretry']>=_0x2a3c46['dialMachineMaxRetry']){_0x3b4fe4[_0x6154('0xea')](_0xa5e366,_0x36adc1,_0x175703,_0x6154('0xeb'));}else{_0x3b4fe4[_0x6154('0xb1')]({'active':![],'countmachineretry':_0xa5e366['countmachineretry'],'scheduledat':moment()[_0x6154('0xde')](_0x2a3c46[_0x6154('0xdf')],_0x6154('0xe0'))[_0x6154('0x6a')](_0x6154('0xe1')),'ContactId':_0xa5e366[_0x6154('0xbd')],'ListId':_0xa5e366[_0x6154('0xbe')],'VoiceQueueId':_0xa5e366[_0x6154('0xc0')]||undefined,'CampaignId':_0xa5e366[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0xe2')));_0x36adc1({'reschedule':0x1});}}});}}};Dialer[_0x6154('0x18')][_0x6154('0x2c')]=function(_0x9bef7){var _0x177a17=this[_0x6154('0x9a')][_0x9bef7['uniqueid']];var _0x4035d6=this;var _0x2be9bc;if(_0x177a17&&_0x177a17['type']===_0x6154('0x6d')){delete this[_0x6154('0x9a')][_0x9bef7[_0x6154('0xcb')]];this[_0x6154('0xa3')](this['campaigns'][_0x177a17[_0x6154('0xa5')]]);this[_0x6154('0xa7')][_0x177a17[_0x6154('0xa5')]]['ivrAnswerCallsDay']+=0x1;_0x2be9bc=new Hangup(_0x177a17,_0x9bef7);this[_0x6154('0xb8')](_0x2be9bc)['catch'](loggerCatch(_0x6154('0xec')));this['moveContactManagedDialer'](_0x2be9bc)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x177a17&&_0x177a17['type']!==_0x6154('0x6d')&&isNotNull(this['voiceQueues'][_0x177a17[_0x6154('0xa5')]][_0x6154('0xed')])){delete this[_0x6154('0x9a')][_0x9bef7[_0x6154('0xcb')]];this[_0x6154('0xa3')](this['voiceQueues'][_0x177a17['queue']]);this[_0x6154('0xa4')][_0x177a17[_0x6154('0xa5')]][_0x6154('0x53')]+=0x1;this[_0x6154('0xa4')][_0x177a17[_0x6154('0xa5')]]['outboundAnswerAgiCallsDay']+=0x1;_0x2be9bc=new Hangup(_0x177a17,_0x9bef7);_0x2be9bc[_0x6154('0x96')]=0x10;_0x2be9bc[_0x6154('0x97')]=_0x6154('0xee');_0x2be9bc[_0x6154('0xd2')]=_0x6154('0xef');this['createHistory'](_0x2be9bc)['catch'](loggerCatch(_0x6154('0xec')));this['moveContactManagedDialer'](_0x2be9bc)[_0x6154('0xa1')](loggerCatch(_0x6154('0xf0')));}if(_0x177a17&&_0x177a17[_0x6154('0x44')]!==_0x6154('0x6d')&&!isNotNull(this[_0x6154('0xa4')][_0x177a17[_0x6154('0xa5')]][_0x6154('0xed')])){delete this[_0x6154('0x9a')][_0x9bef7['uniqueid']];this[_0x6154('0xa3')](this[_0x6154('0xa4')][_0x177a17['queue']]);this[_0x6154('0xa4')][_0x177a17[_0x6154('0xa5')]][_0x6154('0x59')]+=0x1;_0x2be9bc=new Hangup(_0x177a17,_0x9bef7);_0x2be9bc[_0x6154('0x96')]=0xc;_0x2be9bc[_0x6154('0x97')]=_0x9bef7[_0x6154('0xf1')];_0x2be9bc[_0x6154('0xd2')]=_0x6154('0xf2');this[_0x6154('0xb8')](_0x2be9bc)[_0x6154('0xa1')](loggerCatch(_0x6154('0xec')));this[_0x6154('0xb6')](_0x2be9bc)[_0x6154('0xa1')](loggerCatch(_0x6154('0xf0')));}};Dialer[_0x6154('0x18')][_0x6154('0x2a')]=function(_0x1df7b3){var _0x58b0b0=this[_0x6154('0x9a')][_0x1df7b3['uniqueid']];var _0x4cd654=this;if(this['voiceQueues'][_0x1df7b3['queue']]){if(_0x58b0b0&&_0x58b0b0[_0x6154('0x44')]!==_0x6154('0x6d')){delete this[_0x6154('0x9a')][_0x1df7b3[_0x6154('0xcb')]];this[_0x6154('0xa4')][_0x1df7b3['queue']][_0x6154('0x53')]+=0x1;var _0x360193=new AgentComplete(_0x58b0b0,_0x1df7b3);if(_0x1df7b3['reason']==='agent'){_0x360193[_0x6154('0xf3')]=this[_0x6154('0xa4')][_0x1df7b3['queue']][_0x6154('0xf4')]&&this[_0x6154('0xa4')][_0x1df7b3[_0x6154('0xa5')]][_0x6154('0xf5')]?moment()['format'](_0x6154('0xe1')):undefined;}this[_0x6154('0xb8')](_0x360193)[_0x6154('0xa1')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x360193)[_0x6154('0xa1')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x6154('0x18')]['syncAgentConnect']=function(_0x420f41){if(this['voiceQueues'][_0x420f41['queue']]){if(this[_0x6154('0x9a')][_0x420f41[_0x6154('0xcb')]]&&this[_0x6154('0x9a')][_0x420f41[_0x6154('0xcb')]][_0x6154('0x44')]!==_0x6154('0x6d')){this[_0x6154('0xa3')](this[_0x6154('0xa4')][_0x420f41[_0x6154('0xa5')]]);this[_0x6154('0x9a')][_0x420f41['uniqueid']][_0x6154('0xf6')]=moment()[_0x6154('0x6a')](_0x6154('0xe1'));}}};Dialer[_0x6154('0x18')][_0x6154('0xf7')]=function(_0x263744){this[_0x6154('0xb8')](_0x263744)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x6154('0xb6')](_0x263744)[_0x6154('0xa1')](loggerCatch(_0x6154('0xf8')));};Dialer['prototype'][_0x6154('0xf9')]=function(_0x5cf100){var _0x2224ac=this[_0x6154('0x9a')][_0x5cf100['uniqueid']];var _0x45e97c=this;if(this['voiceQueues'][_0x5cf100[_0x6154('0xa5')]]){if(_0x2224ac&&_0x2224ac[_0x6154('0x44')]!==_0x6154('0x6d')){delete this['uniqueId'][_0x5cf100[_0x6154('0xcb')]];this[_0x6154('0xa3')](this['voiceQueues'][_0x5cf100[_0x6154('0xa5')]]);_0x2224ac[_0x6154('0xfa')]=moment()['format'](_0x6154('0xe1'));var _0x550dee=new QueueCallerAbandon(_0x2224ac,_0x5cf100);if(getSeconds(_0x2224ac[_0x6154('0xfa')],_0x2224ac[_0x6154('0xfb')])>=_0x2224ac[_0x6154('0xfc')]){this[_0x6154('0xa4')][_0x5cf100[_0x6154('0xa5')]][_0x6154('0x5d')]+=0x1;this[_0x6154('0xa4')][_0x5cf100[_0x6154('0xa5')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x6154('0xa4')][_0x5cf100[_0x6154('0xa5')]][_0x6154('0xfd')]+=0x1;_0x550dee[_0x6154('0x96')]=0xa;_0x550dee[_0x6154('0x97')]=_0x6154('0xfe');_0x550dee[_0x6154('0xff')]=_0x6154('0x100');_0x550dee[_0x6154('0xf3')]=this[_0x6154('0xa4')][_0x5cf100[_0x6154('0xa5')]][_0x6154('0xf4')]?moment()[_0x6154('0x6a')](_0x6154('0xe1')):undefined;_0x550dee[_0x6154('0x101')]+=0x1;_0x550dee[_0x6154('0xe3')]+=0x1;if(_0x550dee[_0x6154('0x101')]>=this[_0x6154('0xa4')][_0x5cf100[_0x6154('0xa5')]]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x550dee);}else{this[_0x6154('0xb1')]({'active':![],'countdropretry':_0x550dee['countdropretry'],'scheduledat':moment()['add'](this[_0x6154('0xa4')][_0x5cf100[_0x6154('0xa5')]][_0x6154('0x102')],_0x6154('0xe0'))['format'](_0x6154('0xe1')),'ContactId':_0x2224ac[_0x6154('0xbd')],'ListId':_0x2224ac[_0x6154('0xbe')],'VoiceQueueId':_0x2224ac[_0x6154('0xc0')]||undefined,'CampaignId':_0x2224ac[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0x103')));var _0x53bfb9=new History(_0x550dee);_0x53bfb9['state']=0xa;_0x53bfb9[_0x6154('0x97')]='Drop';_0x53bfb9[_0x6154('0x99')]=moment()[_0x6154('0x6a')](_0x6154('0xe1'));_0x53bfb9['endtime']=_0x53bfb9[_0x6154('0x99')];_0x53bfb9[_0x6154('0x104')]=_0x550dee[_0x6154('0x104')];_0x53bfb9['calleridnum']=_0x550dee[_0x6154('0x105')];this[_0x6154('0xb8')](_0x53bfb9)['catch'](loggerCatch(_0x6154('0x106')));}}else{this[_0x6154('0xa4')][_0x5cf100['queue']][_0x6154('0x5c')]+=0x1;this['voiceQueues'][_0x5cf100[_0x6154('0xa5')]]['outboundDropCallsDayCallersExit']+=0x1;_0x550dee['state']=0xb;_0x550dee[_0x6154('0x97')]='Abandoned';_0x550dee[_0x6154('0xff')]=_0x6154('0x107');_0x550dee[_0x6154('0xe6')]+=0x1;_0x550dee[_0x6154('0xe3')]+=0x1;if(_0x550dee['countabandonedretry']>=this[_0x6154('0xa4')][_0x5cf100[_0x6154('0xa5')]][_0x6154('0x108')]){this[_0x6154('0xf7')](_0x550dee);}else{this[_0x6154('0xb1')]({'active':![],'countabandonedretry':_0x550dee[_0x6154('0xe6')],'scheduledat':moment()[_0x6154('0xde')](this['voiceQueues'][_0x5cf100[_0x6154('0xa5')]]['dialAbandonedRetryFrequency'],_0x6154('0xe0'))[_0x6154('0x6a')](_0x6154('0xe1')),'ContactId':_0x2224ac[_0x6154('0xbd')],'ListId':_0x2224ac[_0x6154('0xbe')],'VoiceQueueId':_0x2224ac['VoiceQueueId']||undefined,'CampaignId':_0x2224ac[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0x109')));var _0x53bfb9=new History(_0x550dee);_0x53bfb9['state']=0xb;_0x53bfb9['statedesc']=_0x6154('0x10a');_0x53bfb9[_0x6154('0x99')]=moment()[_0x6154('0x6a')](_0x6154('0xe1'));_0x53bfb9['endtime']=_0x53bfb9['starttime'];_0x53bfb9[_0x6154('0x104')]=_0x550dee[_0x6154('0x104')];_0x53bfb9[_0x6154('0x105')]=_0x550dee[_0x6154('0x105')];this[_0x6154('0xb8')](_0x53bfb9)['catch'](loggerCatch(_0x6154('0x10b')));}}}}};Dialer[_0x6154('0x18')][_0x6154('0x2d')]=function(_0x229d01){if(this[_0x6154('0x1f')][_0x229d01['uniqueid']]){this[_0x6154('0x1f')][_0x229d01[_0x6154('0xcb')]][_0x6154('0xa0')]=_0x229d01[_0x6154('0xa0')];}if(this['uniqueId'][_0x229d01[_0x6154('0xcb')]]){this[_0x6154('0x9a')][_0x229d01['uniqueid']][_0x6154('0xa0')]=_0x229d01['channel'];}};Dialer['prototype']['syncQueueMember']=function(_0x5391b8){if(strategy[this['voiceQueues'][this[_0x6154('0x1f')][_0x5391b8[_0x6154('0x10c')]][_0x6154('0xa5')]]['strategy']]==='roundrobin'){if(this[_0x6154('0x1f')][_0x5391b8['actionid']]&&_['isNil'](this[_0x6154('0x1f')][_0x5391b8['actionid']]['locked'])&&_0x5391b8[_0x6154('0xc9')]==='1'&&_0x5391b8[_0x6154('0x10d')]==='0'){if(this[_0x6154('0x10e')][_0x5391b8[_0x6154('0x10f')]]){if(!this[_0x6154('0x10e')][_0x5391b8['stateinterface']][_0x6154('0x110')]){this[_0x6154('0x10e')][_0x5391b8[_0x6154('0x10f')]]['locked']=!![];this[_0x6154('0x1f')][_0x5391b8['actionid']]['locked']=!![];this[_0x6154('0x1f')][_0x5391b8[_0x6154('0x10c')]]['stateinterface']=_0x5391b8[_0x6154('0x10f')];}}}}else if((strategy[this[_0x6154('0xa4')][this[_0x6154('0x1f')][_0x5391b8[_0x6154('0x10c')]][_0x6154('0xa5')]][_0x6154('0x111')]]||_0x6154('0x112'))==='rrmemory'){if(this[_0x6154('0x1f')][_0x5391b8['actionid']]){if(this[_0x6154('0x10e')][_0x5391b8[_0x6154('0x10f')]]){this[_0x6154('0x1f')][_0x5391b8[_0x6154('0x10c')]][_0x6154('0x10f')]=_0x5391b8[_0x6154('0x10f')];if(_[_0x6154('0x9e')](this[_0x6154('0x22')][this[_0x6154('0x1f')][_0x5391b8[_0x6154('0x10c')]][_0x6154('0xa5')]])){this[_0x6154('0x22')][this['actions'][_0x5391b8['actionid']][_0x6154('0xa5')]]=[];}this[_0x6154('0x22')][this[_0x6154('0x1f')][_0x5391b8[_0x6154('0x10c')]]['queue']]['push'](_['merge'](_[_0x6154('0xbc')](this[_0x6154('0x1f')][_0x5391b8['actionid']],[_0x6154('0x113'),'stateinterface']),{'status':_0x5391b8['status'],'paused':_0x5391b8[_0x6154('0x10d')]}));}}}};function unlockQueueStatus(_0x3854a1,_0x3931b1){setTimeout(function(){if(_[_0x6154('0x33')](_0x3854a1[_0x6154('0x114')])){loggerBooked[_0x6154('0x88')](_0x6154('0x115'),_0x3931b1);}_0x3854a1[_0x6154('0x114')]=!![];loggerBooked[_0x6154('0x70')](_0x6154('0x116'),_0x3931b1,JSON[_0x6154('0x40')](_[_0x6154('0xbc')](_0x3854a1,[_0x6154('0x37'),_0x6154('0x114')])));},0x1f3);}Dialer[_0x6154('0x18')][_0x6154('0x117')]=function(_0x59682e){var _0x31cf6a=this;var _0x176898=_0x31cf6a['voiceQueues'][_0x31cf6a['actions'][_0x59682e[_0x6154('0x10c')]]['queue']];if(strategy[this[_0x6154('0xa4')][this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]][_0x6154('0xa5')]]['strategy']]==='roundrobin'){if(this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]]&&this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]][_0x6154('0x10f')]){this[_0x6154('0x1c')][_0x6154('0x118')](this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]]['idHopper'],this[_0x6154('0x1f')][_0x59682e['actionid']][_0x6154('0x10f')])[_0x6154('0xa1')](function(_0x9ce8f9){logger[_0x6154('0x88')](_0x6154('0x119'),util[_0x6154('0x89')](_0x9ce8f9,{'showHidden':![],'depth':null}));})[_0x6154('0x11a')](function(){_0x31cf6a[_0x6154('0xa3')](_0x31cf6a[_0x6154('0xa4')][_0x31cf6a[_0x6154('0x1f')][_0x59682e['actionid']]['queue']]);_0x31cf6a[_0x6154('0x10e')][_0x31cf6a[_0x6154('0x1f')][_0x59682e['actionid']][_0x6154('0x10f')]]['locked']=![];delete _0x31cf6a['actions'][_0x59682e[_0x6154('0x10c')]];unlockQueueStatus(_0x176898);});}else{this[_0x6154('0xa3')](this[_0x6154('0xa4')][this['actions'][_0x59682e['actionid']][_0x6154('0xa5')]]);this[_0x6154('0xb1')]({'active':![],'ContactId':this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]][_0x6154('0xbd')],'ListId':this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]][_0x6154('0xbe')],'VoiceQueueId':this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]][_0x6154('0xc0')]||undefined,'CampaignId':this['actions'][_0x59682e[_0x6154('0x10c')]][_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]];unlockQueueStatus(_0x176898);}}else if((strategy[this[_0x6154('0xa4')][this['actions'][_0x59682e[_0x6154('0x10c')]][_0x6154('0xa5')]][_0x6154('0x111')]]||_0x6154('0x112'))==='rrmemory'){var _0x13e1e4;if(this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]]&&!_[_0x6154('0x3d')](this[_0x6154('0x22')][this['actions'][_0x59682e[_0x6154('0x10c')]][_0x6154('0xa5')]])){if(this['queueBookedRR'][_0x31cf6a['actions'][_0x59682e[_0x6154('0x10c')]]['queue']]){this[_0x6154('0x23')][_0x31cf6a[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]]['queue']]=this[_0x6154('0x23')][this[_0x6154('0x1f')][_0x59682e['actionid']][_0x6154('0xa5')]]?this[_0x6154('0x23')][this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]][_0x6154('0xa5')]]:this['queueBooked'][this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]][_0x6154('0xa5')]]?this[_0x6154('0x22')][this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]]['queue']][_0x6154('0x11b')]||0x0:0x0;}this[_0x6154('0x22')][this[_0x6154('0x1f')][_0x59682e[_0x6154('0x10c')]]['queue']]['_rr']=this[_0x6154('0x23')][this['actions'][_0x59682e[_0x6154('0x10c')]][_0x6154('0xa5')]];for(var _0x4676e8=0x0;_0x4676e8=0x0?!![]:![];})[_0x6154('0xa1')](myreject(_0x5f5c54)));}}else{_0x27c0ba[_0x6154('0x12f')](ami[_0x6154('0x9f')]({'action':_0x6154('0x130'),'command':util[_0x6154('0x6a')]('iftime\x20%s,%s',_0x232df4,!_[_0x6154('0x33')](config[_0x6154('0x132')][_0x4ef4a2])?_0x4ef4a2:'')})[_0x6154('0xab')](function(_0x57fae5){return _0x57fae5[_0x6154('0x133')]['indexOf'](_0x6154('0x135'))>=0x0?!![]:![];})[_0x6154('0xa1')](myreject(_0x5f5c54)));}BPromise[_0x6154('0x136')](_0x27c0ba)['then'](function(_0x582a85){var _0x13958b=_[_0x6154('0x137')](_0x582a85);if(_0x13958b){return _0x1c8c3f(_0x13958b);}else{_0x2b351c[_0x6154('0x34')]=_0x40273d?'GLOBAL_INTERVAL_IS_OVERTIME':_0x6154('0x138');return _0x5f5c54(msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x40273d+'\x20'+_0x429d06+_0x6154('0x139')+util[_0x6154('0x89')](_0x232df4,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4ef4a2));}})['catch'](function(_0x13b423){return _0x5f5c54(msgResponse('ifTime',_0x6154('0x12b'),JSON[_0x6154('0x40')](_0x13b423)));});});};Dialer[_0x6154('0x18')][_0x6154('0x13a')]=function(_0xcfbeb2){var _0x5b3acc=this;return function(){switch(_0xcfbeb2[_0x6154('0x13b')]){case _0x6154('0x13c'):freeVariablesPredictive(_0xcfbeb2);_0x5b3acc['handlePower'](_0xcfbeb2,0x1);break;case _0x6154('0x13d'):freeVariablesPredictive(_0xcfbeb2);_0x5b3acc[_0x6154('0x13e')](_0xcfbeb2,_0xcfbeb2[_0x6154('0x13f')]);break;case _0x6154('0x6'):_0x5b3acc[_0x6154('0x6')](_0xcfbeb2);break;case _0x6154('0x140'):freeVariablesPredictive(_0xcfbeb2);_0x5b3acc[_0x6154('0x13e')](_0xcfbeb2,0x1);break;default:freeVariablesPredictive(_0xcfbeb2);logger['error'](_0x6154('0x141'),_0xcfbeb2[_0x6154('0x37')],_0x6154('0x142'));}};};Dialer[_0x6154('0x18')][_0x6154('0x143')]=function(_0x1690cb){var _0xd363d=this;return function(){_0xd363d['handleIvr'](_0x1690cb);};};Dialer[_0x6154('0x18')][_0x6154('0x144')]=function(_0x191463){var _0x287ccc=this;if(isNotPreview(_0x191463[_0x6154('0x13b')])){if(isVoiceQueueOutbound(_0x191463['type'])&&isActive(_0x191463[_0x6154('0x4f')])){_0x191463[_0x6154('0x8f')]=!![];BPromise[_0x6154('0xaa')]()[_0x6154('0xab')](checkIsLoggedIn(_0x191463,_0x191463[_0x6154('0x47')]))[_0x6154('0xab')](checkIsActive(_0x191463,_0x191463[_0x6154('0x4f')]))[_0x6154('0xab')](checkInterval(_0x191463))[_0x6154('0xab')](_0x287ccc[_0x6154('0x127')](_0x191463))['then'](_0x287ccc['checkIfTime'](_0x191463['dialGlobalInterval'],_0x191463[_0x6154('0x145')],_0x191463['name'],_0x191463))['then'](_0x287ccc['checkIfTimeIntervals'](_0x191463['Interval'],_0x191463[_0x6154('0x145')],_0x191463[_0x6154('0x37')],_0x191463))['then'](_0x287ccc[_0x6154('0x13a')](_0x191463))[_0x6154('0xa1')](loggerCatchQueueSummary(_0x6154('0x146'),_0x191463));}else{notSendMessagesQueue(_0x191463);}}else{freeVariablesPredictive(_0x191463);}};Dialer[_0x6154('0x18')][_0x6154('0x126')]=function(){var _0x43069b=this;var _0x469fdd;for(var _0x1d88be in this[_0x6154('0xa7')]){if(this[_0x6154('0xa7')][_0x6154('0x8c')](_0x1d88be)){_0x469fdd=this[_0x6154('0xa7')][_0x1d88be];if(isCampaignIvr(_0x469fdd[_0x6154('0x44')])&&isActive(_0x469fdd['active'])){_0x469fdd['sendMessageOneNotActive']=!![];BPromise[_0x6154('0xaa')]()[_0x6154('0xab')](checkIsActive(_0x469fdd,_0x469fdd[_0x6154('0x68')]))['then'](checkInterval(_0x469fdd))[_0x6154('0xab')](_0x43069b[_0x6154('0x127')](_0x469fdd))['then'](_0x43069b[_0x6154('0x128')](_0x469fdd[_0x6154('0x147')],_0x469fdd['dialTimezone'],_0x469fdd[_0x6154('0x37')],_0x469fdd))[_0x6154('0xab')](_0x43069b[_0x6154('0x12a')](_0x469fdd[_0x6154('0x39')],_0x469fdd[_0x6154('0x145')],_0x469fdd[_0x6154('0x37')],_0x469fdd))['then'](_0x43069b['launchHandleIvr'](_0x469fdd))[_0x6154('0xa1')](loggerCatchQueueSummary(_0x6154('0x148'),_0x469fdd));}else{notSendMessagesCampaign(_0x469fdd);}}}};function getCallerIdRandom(_0x2541c1,_0x4c3754){var _0x34d8d2,_0x54fd9c,_0x13d44e;if(_0x4c3754<=0x0){_0x4c3754=0x1;}_0x34d8d2=new RegExp(_0x6154('0x149')+_0x4c3754+'}$');_0x54fd9c=Math[_0x6154('0x14a')](0xa,_0x4c3754-0x1);_0x13d44e=Math['pow'](0xa,_0x4c3754)-0x1;return util['format']('%s',_[_0x6154('0x14b')](_0x2541c1,_0x34d8d2,_[_0x6154('0x14c')](_0x54fd9c,_0x13d44e)));}function extractCalleridName(_0x4b3951){var _0x265ada=_0x4b3951['match'](/"(.*?)"/);return _0x265ada?_0x265ada[0x1]:_0x4b3951;}function extractCalleridNumber(_0x2a0a08){var _0x2d2843=_0x2a0a08['match'](/<(.*?)>/);return _0x2d2843?_0x2d2843[0x1]:_0x2a0a08;}Dialer[_0x6154('0x18')][_0x6154('0x14d')]=function(_0x3e7e97,_0xb0b3c2){var _0x78619b=this;var _0x216165=uuid['v4']();this[_0x6154('0x1f')][_0x216165]=new Action(_0x3e7e97,_0xb0b3c2,_0x216165);return new BPromise(function(_0x1228e2,_0x9410f7){if(_[_0x6154('0x33')](_0x3e7e97)&&_0x6154('0x14e')!==typeof _0x3e7e97){return _0x9410f7(msgResponse(_0x6154('0x14f'),_0x6154('0x12b'),_0x6154('0x150')));}if(_[_0x6154('0x33')](_0xb0b3c2[_0x6154('0x151')][_0x6154('0x152')])||_0xb0b3c2[_0x6154('0x151')][_0x6154('0x152')]===null){return _0x9410f7(msgResponse(_0x6154('0x14f'),_0x6154('0x12b'),_0x6154('0x153')));}var _0x475d27={'XMD-CALLERID':_0x78619b['actions'][_0x216165][_0x6154('0x154')](),'XMD-AGI':_0x3e7e97[_0x6154('0xed')]?util[_0x6154('0x6a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3e7e97[_0x6154('0xed')]):_0x6154('0x155'),'XMD-AGIAFTER':_0x3e7e97[_0x6154('0xf4')]?util[_0x6154('0x6a')](_0x6154('0x156'),ipAgi,_0x3e7e97[_0x6154('0xf4')]):_0x6154('0x155'),'XMD-QUEUE':_0x3e7e97[_0x6154('0x44')]===_0x6154('0x45')?util['format']('\x22%s,%s%s,,,%s\x22',_0x3e7e97[_0x6154('0x37')],_0x3e7e97['dialQueueOptions']||'',_0x3e7e97['dialAgiAfterHangupAgent']?'c':'',_0x3e7e97[_0x6154('0xfc')]||0x3):_0x6154('0x155'),'XMD-CONTACTID':_0xb0b3c2[_0x6154('0xbd')],'XMD-CDRTYPE':_0x6154('0x5'),'CALLERID(all)':_0x78619b[_0x6154('0x1f')][_0x216165][_0x6154('0x154')](),'XMD-AMD':_0x3e7e97['dialAMDActive']?'ACTIVE':_0x6154('0x155'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x3e7e97[_0x6154('0xd5')]){_0x475d27[_0x6154('0x157')]=_0x3e7e97[_0x6154('0x158')]||0x9c4;_0x475d27[_0x6154('0x159')]=_0x3e7e97[_0x6154('0x15a')]||0x5dc;_0x475d27[_0x6154('0x15b')]=_0x3e7e97['dialAMDAfterGreetingSilence']||0x320;_0x475d27[_0x6154('0x15c')]=_0x3e7e97[_0x6154('0x15d')]||0x1388;_0x475d27[_0x6154('0x15e')]=_0x3e7e97[_0x6154('0x15f')]||0x64;_0x475d27[_0x6154('0x160')]=_0x3e7e97[_0x6154('0x161')]||0x32;_0x475d27[_0x6154('0x162')]=_0x3e7e97['dialAMDMaximumNumberOfWords']||0x3;_0x475d27[_0x6154('0x163')]=_0x3e7e97[_0x6154('0x164')]||0x100;_0x475d27[_0x6154('0x165')]=_0x3e7e97[_0x6154('0x166')]||0x1388;}if(_0x3e7e97[_0x6154('0x44')]===_0x6154('0x45')){_0x475d27['XMD-VOICEQUEUEID']=_0xb0b3c2[_0x6154('0xc0')];}else{_0x475d27[_0x6154('0x167')]=_0xb0b3c2[_0x6154('0xc1')];}for(var _0x461842 in _0xb0b3c2[_0x6154('0x151')]){if(_0xb0b3c2[_0x6154('0x151')][_0x6154('0x8c')](_0x461842)){if(isNotNull(_0xb0b3c2['Contact'][_0x461842])&&_0x461842!=='id'&&_0x461842!==_0x6154('0x168')&&_0x461842!==_0x6154('0x169')&&_0x461842!==_0x6154('0x16a')){_0x475d27[util['format'](_0x6154('0x16b'),'XMD-',_[_0x6154('0x16c')](_0x461842))]=_0xb0b3c2[_0x6154('0x151')][_0x461842];}}}var _0x231a2d=_0x78619b[_0x6154('0xc6')](_0x3e7e97[_0x6154('0x67')])?getCallerId(_0x3e7e97[_0x6154('0x67')]['callerid'],_0x3e7e97['dialOriginateCallerIdName'],_0x3e7e97[_0x6154('0x16d')]>0x0?getCallerIdRandom(_0x3e7e97[_0x6154('0x16e')],_0x3e7e97[_0x6154('0x16d')]):_0x3e7e97[_0x6154('0x16e')]):getCallerId(_[_0x6154('0x9e')](_0x3e7e97[_0x6154('0x16f')])?_0x3e7e97[_0x6154('0x67')][_0x6154('0x69')]:_0x3e7e97['TrunkBackup']['callerid'],_0x3e7e97['dialOriginateCallerIdName'],_0x3e7e97['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x3e7e97['dialOriginateCallerIdNumber'],_0x3e7e97[_0x6154('0x16d')]):_0x3e7e97[_0x6154('0x16e')]);if(_0x231a2d){_0x475d27[_0x6154('0x170')]=_0x78619b[_0x6154('0x1f')][_0x216165][_0x6154('0x171')]=extractCalleridName(_0x231a2d);_0x475d27[_0x6154('0x172')]=_0x78619b[_0x6154('0x1f')][_0x216165][_0x6154('0x173')]=extractCalleridNumber(_0x231a2d);}return ami['Action']({'actionid':_0x216165,'action':'originate','channel':_0x78619b[_0x6154('0xc6')](_0x3e7e97[_0x6154('0x67')])?util[_0x6154('0x6a')](_0x6154('0x174'),_0x3e7e97[_0x6154('0x67')]['name'],isNotNull(_0x3e7e97['dialPrefix'])?_0x3e7e97[_0x6154('0x51')][_0x6154('0x175')]()||'':'',_0x3e7e97[_0x6154('0x176')]>0x0?_0xb0b3c2[_0x6154('0x151')]['phone']['substring'](_0x3e7e97[_0x6154('0x176')]):_0xb0b3c2[_0x6154('0x151')][_0x6154('0x152')]):util[_0x6154('0x6a')](_0x6154('0x174'),_[_0x6154('0x9e')](_0x3e7e97[_0x6154('0x16f')])?_0x3e7e97[_0x6154('0x67')][_0x6154('0x37')]:_0x3e7e97['TrunkBackup']['name'],isNotNull(_0x3e7e97[_0x6154('0x51')])?_0x3e7e97[_0x6154('0x51')]['trim']()||'':'',_0x3e7e97['dialCutDigit']>0x0?_0xb0b3c2['Contact'][_0x6154('0x152')][_0x6154('0x177')](_0x3e7e97[_0x6154('0x176')]):_0xb0b3c2[_0x6154('0x151')]['phone']),'callerid':_0x231a2d,'Exten':_0x6154('0xcf'),'Context':'from-sip','Priority':'1','variable':_0x475d27,'timeout':(_0x3e7e97[_0x6154('0x178')]||0x1e)*0x3e8,'async':!![],'channelid':_0x216165})[_0x6154('0xab')](function(_0x1dbe88){return _0x1228e2(_0x1dbe88);})[_0x6154('0xa1')](function(_0x4366bf){_0x3e7e97['outboundOriginateFailureCallsDay']+=0x1;var _0x267b93=new History(_0x78619b['actions'][_0x216165]);logger[_0x6154('0x88')](util[_0x6154('0x6a')](_0x6154('0x179'),JSON[_0x6154('0x40')](_0x4366bf)));_0x267b93['state']=0xe;_0x267b93[_0x6154('0x97')]=_0x6154('0x17a');_0x267b93['starttime']=moment()[_0x6154('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');_0x267b93[_0x6154('0x98')]=_0x267b93[_0x6154('0x99')];_0x78619b[_0x6154('0xb8')](_0x267b93)[_0x6154('0xa1')](loggerCatch(_0x6154('0x17b')));_0x78619b[_0x6154('0xb6')](_0x267b93)[_0x6154('0xa1')](loggerCatch(_0x6154('0x17b')))['finally'](function(){delete _0x78619b[_0x6154('0x1f')][_0x216165];return _0x9410f7(msgResponse('originate',_0x6154('0x3f'),_0x6154('0x17c')));});});});};Dialer[_0x6154('0x18')]['syncOriginateResponse']=function(_0x2b7678){var _0x4402fd=this['actions'][_0x2b7678[_0x6154('0x10c')]];var _0x976ad9=this;if(_0x4402fd){delete this[_0x6154('0x1f')][_0x2b7678[_0x6154('0x10c')]];_0x4402fd[_0x6154('0xfb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x308d1f=_0x4402fd['type']===_0x6154('0x6d')?this[_0x6154('0xa7')][_0x4402fd[_0x6154('0xa5')]]:this[_0x6154('0xa4')][_0x4402fd['getQueue']()];if(!this['isSuccess'](_0x2b7678[_0x6154('0x17d')])){this[_0x6154('0xa3')](_0x308d1f);return this['callProgressDetecting'](_0x4402fd,_0x308d1f,_0x2b7678)['then'](function(_0x4cf61f){})[_0x6154('0xa1')](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0x6154('0x9a')][_0x2b7678[_0x6154('0xcb')]]=_0x4402fd;}}};Dialer[_0x6154('0x18')][_0x6154('0x17e')]=function(_0xa93d5c,_0x159392,_0x1168a0){var _0x216326=new History(_0x159392);if(_0x216326[_0x6154('0x17f')]+_0x216326[_0x6154('0xe4')]+_0x216326['countnoanswerretry']+_0x216326[_0x6154('0xdb')]+_0x216326[_0x6154('0x101')]+_0x216326[_0x6154('0xe6')]+_0x216326[_0x6154('0xdc')]+_0x216326[_0x6154('0xe7')]>=_0x1168a0['dialGlobalMaxRetry']-0x1){return!![];}switch(_0xa93d5c){case 0x3:if(_0x216326['countnoanswerretry']>=_0x1168a0[_0x6154('0x180')]-0x1){return!![];}else{this[_0x6154('0xb1')]({'active':![],'countnoanswerretry':_0x216326[_0x6154('0xe5')]+=0x1,'scheduledat':moment()[_0x6154('0xde')](_0x1168a0[_0x6154('0x181')],'minutes')[_0x6154('0x6a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x216326[_0x6154('0xbd')],'ListId':_0x216326[_0x6154('0xbe')],'VoiceQueueId':_0x216326[_0x6154('0xc0')]||undefined,'CampaignId':_0x216326[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0x182')));}break;case 0x5:if(_0x216326[_0x6154('0x17f')]>=_0x1168a0[_0x6154('0x183')]-0x1){return!![];}else{this[_0x6154('0xb1')]({'active':![],'countbusyretry':_0x216326[_0x6154('0x17f')]+=0x1,'scheduledat':moment()[_0x6154('0xde')](_0x1168a0['dialBusyRetryFrequency'],_0x6154('0xe0'))[_0x6154('0x6a')](_0x6154('0xe1')),'ContactId':_0x216326[_0x6154('0xbd')],'ListId':_0x216326['ListId'],'VoiceQueueId':_0x216326['VoiceQueueId']||undefined,'CampaignId':_0x216326['CampaignId']||undefined})['catch'](loggerCatch(_0x6154('0x184')));}break;case 0x8:if(_0x216326[_0x6154('0xe4')]>=_0x1168a0['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0x6154('0xb1')]({'active':![],'countcongestionretry':_0x216326['countcongestionretry']+=0x1,'scheduledat':moment()[_0x6154('0xde')](_0x1168a0[_0x6154('0x185')],_0x6154('0xe0'))[_0x6154('0x6a')](_0x6154('0xe1')),'ContactId':_0x216326[_0x6154('0xbd')],'ListId':_0x216326[_0x6154('0xbe')],'VoiceQueueId':_0x216326[_0x6154('0xc0')]||undefined,'CampaignId':_0x216326[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0x186')));}break;case 0x0:if(_0x216326[_0x6154('0xdb')]>=_0x1168a0[_0x6154('0x187')]-0x1){return!![];}else{this[_0x6154('0xb1')]({'active':![],'countnosuchnumberretry':_0x216326['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x6154('0xde')](_0x1168a0[_0x6154('0x188')],_0x6154('0xe0'))[_0x6154('0x6a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x216326['ContactId'],'ListId':_0x216326['ListId'],'VoiceQueueId':_0x216326['VoiceQueueId']||undefined,'CampaignId':_0x216326[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x216326[_0x6154('0x101')]>=_0x1168a0[_0x6154('0x189')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0x216326[_0x6154('0x101')]+=0x1,'scheduledat':moment()['add'](_0x1168a0[_0x6154('0x102')],_0x6154('0xe0'))[_0x6154('0x6a')](_0x6154('0xe1')),'ContactId':_0x216326[_0x6154('0xbd')],'ListId':_0x216326[_0x6154('0xbe')],'VoiceQueueId':_0x216326[_0x6154('0xc0')]||undefined,'CampaignId':_0x216326[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0x103')));}break;case 0xb:if(_0x216326[_0x6154('0xe6')]>=_0x1168a0['dialAbandonedMaxRetry']-0x1){return!![];}else{this[_0x6154('0xb1')]({'active':![],'countabandonedretry':_0x216326[_0x6154('0xe6')]+=0x1,'scheduledat':moment()[_0x6154('0xde')](_0x1168a0[_0x6154('0x18a')],_0x6154('0xe0'))[_0x6154('0x6a')](_0x6154('0xe1')),'ContactId':_0x216326['ContactId'],'ListId':_0x216326[_0x6154('0xbe')],'VoiceQueueId':_0x216326[_0x6154('0xc0')]||undefined,'CampaignId':_0x216326[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0x109')));}break;case 0x13:if(_0x216326['countmachineretry']>=_0x1168a0[_0x6154('0x18b')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0x216326[_0x6154('0xdc')]+=0x1,'scheduledat':moment()[_0x6154('0xde')](_0x1168a0['dialMachineRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x216326[_0x6154('0xbd')],'ListId':_0x216326[_0x6154('0xbe')],'VoiceQueueId':_0x216326[_0x6154('0xc0')]||undefined,'CampaignId':_0x216326[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch('[rescheduleContact][Machine]'));}break;case 0x14:if(_0x216326['countagentrejectretry']>=_0x1168a0[_0x6154('0x18c')]-0x1){return!![];}else{this[_0x6154('0xb1')]({'active':![],'countagentrejectretry':_0x216326[_0x6154('0xe7')]+=0x1,'scheduledat':moment()[_0x6154('0xde')](_0x1168a0[_0x6154('0x18d')],_0x6154('0xe0'))['format'](_0x6154('0xe1')),'ContactId':_0x216326['ContactId'],'ListId':_0x216326[_0x6154('0xbe')],'VoiceQueueId':_0x216326[_0x6154('0xc0')]||undefined,'CampaignId':_0x216326['CampaignId']||undefined})['catch'](loggerCatch(_0x6154('0x18e')));}break;default:return!![];}};Dialer[_0x6154('0x18')]['callProgressDetecting']=function(_0x14ca31,_0xc0be50,_0x499637){var _0x4a6000=this;var _0x2f12fb=new History(_0x14ca31);return new BPromise(function(_0x4d37d9,_0xa06923){if(_['isUndefined'](_0xc0be50)&&_0x6154('0x14e')!==typeof _0xc0be50){return _0xa06923(msgResponse(_0x6154('0x18f'),_0x6154('0x12b'),'entity\x20is\x20undefine'));}if(_[_0x6154('0x33')](_0x499637)&&_0x6154('0x14e')!==typeof _0x499637){return _0xa06923(msgResponse('[callProgressDetecting]',_0x6154('0x12b'),'evt\x20is\x20undefine'));}switch(_0x499637['reason']){case'0':_0xc0be50[_0x6154('0x190')]+=0x1;_0x2f12fb[_0x6154('0x96')]=0x0;_0x2f12fb['statedesc']='NoSuchNumber';_0x2f12fb['countnosuchnumberretry']+=0x1;_0x2f12fb[_0x6154('0xe3')]+=0x1;ami[_0x6154('0x43')]('custom:agentnosuchnumber',ut[_0x6154('0x191')](_0x14ca31,_0x6154('0x192')));_0x4a6000[_0x6154('0xb8')](_0x2f12fb)[_0x6154('0xa1')](loggerCatch(_0x6154('0xda')));if(_0x4a6000[_0x6154('0x17e')](0x0,_0x14ca31,_0xc0be50)){if(_0x2f12fb[_0x6154('0xdb')]>=_0xc0be50['dialNoSuchNumberMaxRetry']){_0x4a6000[_0x6154('0xea')](_0x2f12fb,_0x4d37d9,_0xa06923,'reason\x200\x20no\x20such\x20number....');}else{_0x4a6000[_0x6154('0xdd')](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x193'));}}break;case'3':_0xc0be50['outboundNoAnswerCallsDay']+=0x1;_0x2f12fb[_0x6154('0x96')]=0x3;_0x2f12fb[_0x6154('0x97')]=_0x6154('0x194');_0x2f12fb['countnoanswerretry']+=0x1;_0x2f12fb['countglobal']+=0x1;ami[_0x6154('0x43')]('custom:agentnoanswer',ut[_0x6154('0x191')](_0x14ca31,'noanswer'));_0x4a6000['createHistory'](_0x2f12fb)[_0x6154('0xa1')](loggerCatch(_0x6154('0x195')));if(_0x4a6000[_0x6154('0x17e')](0x3,_0x14ca31,_0xc0be50)){if(_0x2f12fb[_0x6154('0xe5')]>=_0xc0be50[_0x6154('0x180')]){_0x4a6000[_0x6154('0xea')](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x196'));}else{_0x4a6000['stateGlobal'](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x196'));}}break;case'5':_0xc0be50[_0x6154('0x197')]+=0x1;_0x2f12fb[_0x6154('0x96')]=0x5;_0x2f12fb[_0x6154('0x97')]=_0x6154('0x198');_0x2f12fb[_0x6154('0x17f')]+=0x1;_0x2f12fb[_0x6154('0xe3')]+=0x1;ami['emit'](_0x6154('0x199'),ut[_0x6154('0x191')](_0x14ca31,_0x6154('0x19a')));_0x4a6000[_0x6154('0xb8')](_0x2f12fb)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4a6000[_0x6154('0x17e')](0x5,_0x14ca31,_0xc0be50)){if(_0x2f12fb[_0x6154('0x17f')]>=_0xc0be50[_0x6154('0x183')]){_0x4a6000[_0x6154('0xea')](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x19b'));}else{_0x4a6000['stateGlobal'](_0x2f12fb,_0x4d37d9,_0xa06923,'reason\x205\x20busy');}}break;case'8':_0xc0be50[_0x6154('0x55')]+=0x1;_0x2f12fb[_0x6154('0x96')]=0x8;_0x2f12fb[_0x6154('0x97')]=_0x6154('0x19c');_0x2f12fb['countcongestionretry']+=0x1;_0x2f12fb[_0x6154('0xe3')]+=0x1;ami[_0x6154('0x43')](_0x6154('0x19d'),ut[_0x6154('0x191')](_0x14ca31,'congestion'));_0x4a6000['createHistory'](_0x2f12fb)['catch'](loggerCatch(_0x6154('0x19e')));if(_0x4a6000['checkRetriveMax'](0x8,_0x14ca31,_0xc0be50)){if(_0x2f12fb[_0x6154('0xe4')]>=_0xc0be50[_0x6154('0x19f')]){_0x4a6000[_0x6154('0xea')](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x1a0'));}else{_0x4a6000[_0x6154('0xdd')](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x1a0'));}}break;case'11':_0xc0be50[_0x6154('0x1a1')]+=0x1;_0x2f12fb[_0x6154('0x96')]=0xb;_0x2f12fb['statedesc']='Abandoned';_0x2f12fb[_0x6154('0xe6')]+=0x1;_0x2f12fb[_0x6154('0xe3')]+=0x1;_0x4a6000['createHistory'](_0x2f12fb)[_0x6154('0xa1')](loggerCatch(_0x6154('0x10b')));if(_0x4a6000[_0x6154('0x17e')](0xb,_0x14ca31,_0xc0be50)){if(_0x2f12fb['countabandonedretry']>=_0xc0be50['dialAbandonedMaxRetry']){_0x4a6000['createStateFinal'](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x1a2'));}else{_0x4a6000[_0x6154('0xdd')](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x1a2'));}}break;case'20':_0xc0be50['outboundRejectCallsDay']+=0x1;_0x2f12fb[_0x6154('0x96')]=0x14;_0x2f12fb[_0x6154('0x97')]=_0x6154('0x1a3');_0x2f12fb['countagentrejectretry']+=0x1;_0x2f12fb[_0x6154('0xe3')]+=0x1;ami[_0x6154('0x43')](_0x6154('0x1a4'),ut[_0x6154('0x191')](_0x14ca31,'agentreject'));_0x4a6000['createHistory'](_0x2f12fb)[_0x6154('0xa1')](loggerCatch(_0x6154('0x1a5')));if(_0x4a6000[_0x6154('0x17e')](0x14,_0x14ca31,_0xc0be50)){if(_0x2f12fb['countagentrejectretry']>=_0xc0be50['dialAgentRejectMaxRetry']){_0x4a6000['createStateFinal'](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x1a6'));}else{_0x4a6000[_0x6154('0xdd')](_0x2f12fb,_0x4d37d9,_0xa06923,_0x6154('0x1a6'));}}break;default:_0xc0be50['outboundUnknownCallsDay']+=0x1;_0x2f12fb[_0x6154('0x96')]=0xc;_0x2f12fb[_0x6154('0x97')]=_0x499637['reason'];_0x4a6000[_0x6154('0xb8')](_0x2f12fb)[_0x6154('0xa1')](loggerCatch(_0x6154('0x1a7')));if(_0x4a6000['checkRetriveMax'](_0x499637[_0x6154('0x1a8')],_0x14ca31,_0xc0be50)){if(_0x2f12fb[_0x6154('0x17f')]+_0x2f12fb[_0x6154('0xe4')]+_0x2f12fb['countnoanswerretry']+_0x2f12fb['countnosuchnumberretry']+_0x2f12fb[_0x6154('0x101')]+_0x2f12fb['countabandonedretry']+_0x2f12fb[_0x6154('0xdc')]+_0x2f12fb['countagentrejectretry']>=_0xc0be50[_0x6154('0xe8')]){_0x4a6000['stateGlobal'](_0x2f12fb,_0x4d37d9,_0xa06923,_0x499637['reason']);}else{_0x4a6000[_0x6154('0xea')](_0x2f12fb,_0x4d37d9,_0xa06923,_0x499637[_0x6154('0x1a8')]);}}}});};Dialer[_0x6154('0x18')]['stateGlobal']=function(_0x1bee76,_0x29315a,_0x49ecb0,_0x298b2d){var _0x13c338=new Final(_0x1bee76);_0x13c338[_0x6154('0x96')]=0xf;_0x13c338[_0x6154('0x97')]=_0x6154('0x1a9');this['createStateFinal'](_0x13c338,_0x29315a,_0x49ecb0,_0x298b2d);};Dialer[_0x6154('0x18')][_0x6154('0xea')]=function(_0x4a5fda,_0x317e51,_0x1a841d,_0x4b0743){this[_0x6154('0xb6')](_0x4a5fda)[_0x6154('0xab')](function(_0x4ada30){return _0x317e51(msgResponse(_0x6154('0x18f'),_0x6154('0xc5'),_0x4b0743));})[_0x6154('0xa1')](function(_0x4c7c02){return _0x1a841d(msgResponse(_0x6154('0x1aa'),_0x6154('0x12b'),'contact\x20not\x20moved'));});};Dialer[_0x6154('0x18')][_0x6154('0x6')]=function(_0x476557){var _0x1e25f9=this;var _0xa4d4b3=_0x476557[_0x6154('0x1ab')]/0x64;var _0x2f49a5=_0x476557[_0x6154('0x1ac')]/(_0x476557[_0x6154('0x1ac')]+_0x476557[_0x6154('0x53')]);var _0x2cff63=Math['round'](_0x476557[_0x6154('0x61')]*(_0x476557[_0x6154('0x1ad')]/0x64));var _0xebd043=Math['round'](_0x476557[_0x6154('0x61')]*(_0x476557['predictiveIntervalMinThreshold']/0x64));var _0xc93301=_0x476557['available']+_0x476557[_0x6154('0x4a')];var _0x13f036=Math[_0x6154('0x1ae')](_0x476557[_0x6154('0x64')]*_0x476557[_0x6154('0x66')]*_0x476557[_0x6154('0x5e')]*_0x476557['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x476557[_0x6154('0x81')])){if(!_['isUndefined'](_0x476557[_0x6154('0x21')])){_0x476557[_0x6154('0x21')]=undefined;loggerPredictive['error'](_0x6154('0x1af'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x6154('0x33')](_0x476557['handlePredictive'])){loggerPredictive[_0x6154('0x88')](_0x6154('0x1af'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x476557[_0x6154('0x83')]);_0x476557[_0x6154('0x83')]=undefined;}_0x476557[_0x6154('0x81')]=moment()[_0x6154('0x6a')](_0x6154('0xe1'));loggerPredictive[_0x6154('0x70')](_0x476557['name'],'collection\x20data\x20in\x20progressive\x20at',_0x476557[_0x6154('0x81')]);this[_0x6154('0x13e')](_0x476557,0x1);}else if(ifInterval(_0x476557['dialPredictiveInterval'],_0x476557[_0x6154('0x81')])){this[_0x6154('0x13e')](_0x476557,0x1);loggerPredictiveCalls[_0x6154('0x70')](_0x6154('0x1b0'),_0x476557['startProgressive'],_0x476557[_0x6154('0x37')]);_0x476557[_0x6154('0x64')]=0x0;_0x476557['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xa4d4b3<_0x2f49a5&&_0x476557['dialPredictiveOptimization']===_0x6154('0x1b1')){freeVariablesPredictive(_0x476557);loggerPredictive[_0x6154('0x70')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x6154('0x1b2'),_0x2f49a5,_0x6154('0x81'),_0x476557[_0x6154('0x37')]);}else if(_0x13f036<_0x476557[_0x6154('0xfd')]&&_0x476557['dialPredictiveOptimization']===_0x6154('0x1b1')){freeVariablesPredictive(_0x476557);loggerPredictive[_0x6154('0x70')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x13f036,_0x6154('0x1b3'),_0x476557[_0x6154('0xfd')],_0x6154('0x81'),_0x476557[_0x6154('0x37')]);}else if(!ifInterval(_0x476557['dialPredictiveInterval'],_0x476557['startProgressive'])&&_[_0x6154('0x33')](_0x476557[_0x6154('0x21')])&&!_['isUndefined'](_0x476557[_0x6154('0x81')])){_0x476557[_0x6154('0x21')]=moment()[_0x6154('0x6a')](_0x6154('0xe1'));loggerPredictive['info'](_0x476557[_0x6154('0x37')],'started\x20in\x20predictive\x20at',_0x476557[_0x6154('0x21')]);this[_0x6154('0xb0')](_0x476557[_0x6154('0x1b4')])[_0x6154('0xab')](this['getDataPredictive'](_0x476557))['then'](mergeDataErlangB(_0x476557))['then'](this[_0x6154('0x1b5')](_0x476557))[_0x6154('0xa1')](loggerCatchPredictive(_0x6154('0x1b6'),_0x476557));}else if(!ifInterval(_0x476557[_0x6154('0x1b4')],_0x476557[_0x6154('0x21')])){_0x476557[_0x6154('0xfd')]=0x0;_0x476557['startPredictive']=moment()[_0x6154('0x6a')](_0x6154('0xe1'));loggerPredictive[_0x6154('0x70')](_0x476557['name'],_0x6154('0x1b7'),_0x476557['startPredictive']);clearInterval(_0x476557[_0x6154('0x83')]);_0x476557['handlePredictive']=undefined;this[_0x6154('0xb0')](_0x476557[_0x6154('0x1b4')])[_0x6154('0xab')](this[_0x6154('0x1b8')](_0x476557))['then'](mergeDataErlangB(_0x476557))[_0x6154('0xab')](this[_0x6154('0x1b5')](_0x476557))[_0x6154('0xa1')](loggerCatchPredictive(_0x6154('0x1b9'),_0x476557));}else if(_0x476557[_0x6154('0x61')]&&_0xc93301<_0x476557[_0x6154('0x61')]-_0xebd043){freeVariablesPredictive(_0x476557);loggerPredictive[_0x6154('0x70')](_0x476557[_0x6154('0x37')],_0x6154('0x1ba'),_0xc93301,_0x6154('0x1bb'),_0x476557[_0x6154('0x61')],'-',_0xebd043,'=',_0x476557[_0x6154('0x61')]-_0xebd043,')');}else if(_0x476557[_0x6154('0x61')]&&_0xc93301>_0x476557[_0x6154('0x61')]+_0x2cff63){freeVariablesPredictive(_0x476557);loggerPredictive[_0x6154('0x70')](_0x476557[_0x6154('0x37')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xc93301,_0x6154('0x1bc'),_0x476557[_0x6154('0x61')],'+',_0x2cff63,'=',_0x476557[_0x6154('0x61')]+_0x2cff63,')');}};Dialer[_0x6154('0x18')][_0x6154('0x1b8')]=function(_0x21b714){var _0x3f4abd=this;return function(_0x8ab44d){return new BPromise(function(_0x3968cd,_0x211def){_['merge'](_0x21b714,_0x8ab44d[0x0]);if(checkGetDataPredictive(_0x8ab44d[0x0])){var _0x237787=_0x21b714[_0x6154('0x61')]=_0x21b714[_0x6154('0x4a')]+_0x21b714[_0x6154('0x46')];var _0x13f059=_0x21b714[_0x6154('0x1b4')]*0x3c;var _0x3c95f3=_0x8ab44d[0x0][_0x6154('0x77')]+_0x8ab44d[0x0][_0x6154('0x5b')];var _0x451cf7=(_0x8ab44d[0x0]['predictiveIntervalAnsweredCalls']+_0x8ab44d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x8ab44d[0x0][_0x6154('0x5c')])/_0x8ab44d[0x0][_0x6154('0x62')];_0x21b714[_0x6154('0x5e')]=_0x451cf7>0x0?_0x451cf7:0x1;switch(_0x21b714[_0x6154('0x1bd')]){case _0x6154('0x1b1'):var _0x3a57a7=_0x21b714['dialPredictiveOptimizationPercentage']/0x64;return _0x3f4abd[_0x6154('0x1be')](_0x237787,_0x13f059,_0x3c95f3,_0x451cf7,_0x3a57a7)['then'](function(_0x128ea9){return _0x3968cd(_0x128ea9);});case'agentBusyFactor':var _0x589b69=_0x21b714[_0x6154('0x1ab')]/0x64;return _0x3f4abd[_0x6154('0x1bf')](_0x237787,_0x13f059,_0x3c95f3,_0x451cf7,_0x589b69)[_0x6154('0xab')](function(_0x582707){return _0x3968cd(_0x582707);});default:return _0x211def(msgResponse(_0x6154('0x1c0'),'Failure',_0x6154('0x1c1')));}}else{return _0x211def(msgResponse(_0x6154('0x1c0'),_0x6154('0x12b'),_0x6154('0x1c2')));}});};};Dialer[_0x6154('0x18')][_0x6154('0x1c3')]=function(_0x896620){var _0x31ea81=this;return function(_0x44ab48){return new BPromise(function(_0x32ddf9,_0x1599cd){_[_0x6154('0x7f')](_0x896620,_0x44ab48[0x0]);if(checkGetDataPredictive(_0x44ab48[0x0])){loggerPredictive[_0x6154('0x70')](JSON['stringify'](_0x44ab48[0x0]));if(_0x896620[_0x6154('0x1bd')]===_0x6154('0x1b1')){return _0x31ea81[_0x6154('0xb5')](_0x896620['id'])[_0x6154('0xab')](function(_0x1c9510){var _0xdc3b7e=_0x896620[_0x6154('0x47')]-_0x1c9510[0x0]['outboundQueuePauses'];var _0x2a769b=_0x896620['dialPredictiveInterval']*0x3c;var _0x55c7cb=_0x44ab48[0x0]['predictiveIntervalAvgTalktime']+_0x44ab48[0x0][_0x6154('0x5b')];var _0x113a12=(_0x44ab48[0x0][_0x6154('0x5a')]+_0x44ab48[0x0][_0x6154('0x5d')]+_0x44ab48[0x0][_0x6154('0x5c')])/_0x44ab48[0x0][_0x6154('0x62')];var _0x5bb450=_0x896620[_0x6154('0x1ab')]/0x64;_0x896620[_0x6154('0x60')]=_0x1c9510[0x0][_0x6154('0x1c4')]||0x0;_0x896620['predictiveIntervalHitRate']=_0x113a12>0x0?_0x113a12:0x1;return _0x31ea81[_0x6154('0x1be')](_0xdc3b7e,_0x2a769b,_0x55c7cb,_0x113a12,_0x5bb450);})[_0x6154('0xab')](function(_0x176593){return _0x32ddf9(_0x176593);})[_0x6154('0xa1')](function(_0x1247de){return _0x1599cd(msgResponse(_0x6154('0x1c5'),_0x6154('0x12b'),JSON[_0x6154('0x40')](_0x1247de)));});}if(_0x896620[_0x6154('0x1bd')]===_0x6154('0x1c6')){return _0x31ea81[_0x6154('0xb5')](_0x896620['id'])[_0x6154('0xab')](function(_0x44dd22){var _0x231949=_0x896620[_0x6154('0x47')]-_0x44dd22[0x0][_0x6154('0x1c4')];var _0x24c48b=_0x896620[_0x6154('0x1b4')]*0x3c;var _0x28bda7=_0x44ab48[0x0][_0x6154('0x77')]+_0x44ab48[0x0][_0x6154('0x5b')];var _0x2355e9=(_0x44ab48[0x0][_0x6154('0x5a')]+_0x44ab48[0x0][_0x6154('0x5d')]+_0x44ab48[0x0][_0x6154('0x5c')])/_0x44ab48[0x0][_0x6154('0x62')];var _0x4092b8=_0x896620['dialPredictiveOptimizationPercentage']/0x64;_0x896620[_0x6154('0x60')]=_0x44dd22[0x0]['outboundQueuePauses']||0x0;_0x896620[_0x6154('0x5e')]=_0x2355e9>0x0?_0x2355e9:0x1;return _0x31ea81[_0x6154('0x1bf')](_0x231949,_0x24c48b,_0x28bda7,_0x2355e9,_0x4092b8);})[_0x6154('0xab')](function(_0x449ed7){return _0x32ddf9(_0x449ed7);})[_0x6154('0xa1')](function(_0x525dda){return _0x1599cd(msgResponse(_0x6154('0x1c5'),'Failure',JSON[_0x6154('0x40')](_0x525dda)));});}}else{return _0x1599cd(msgResponse(_0x6154('0x1c0'),_0x6154('0x12b'),_0x6154('0x1c2')));}});};};Dialer[_0x6154('0x18')]['startMethodPredictive']=function(_0x5d51e4){var _0x394fb7=this;return function(){var _0x1f24be=0x0;var _0x26a814=Math['floor'](_0x5d51e4['erlangCallToSecond']*0x3e8);if(_0x26a814>0x0){_0x26a814=_0x26a814<0x64?0x64:_0x26a814;loggerPredictive[_0x6154('0x70')](_0x5d51e4[_0x6154('0x37')],_0x6154('0x1c7'),_0x26a814,_0x6154('0x41'));_0x5d51e4[_0x6154('0x83')]=setInterval(function(){_0x394fb7[_0x6154('0x83')](_0x5d51e4);loggerPredictiveCalls['info']('[handlePredictive]',_0x1f24be+=0x1);},_0x26a814);}else{loggerPredictive[_0x6154('0x70')](_0x5d51e4[_0x6154('0x37')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x6154('0x18')][_0x6154('0x1c8')]=function(_0x4b6496,_0x3d3dec){var _0x267825=this;return function(_0x1b052f){if(_[_0x6154('0x3d')](_0x1b052f)){if(_['isNil'](_0x3d3dec['UserId'])||!_0x3d3dec[_0x6154('0x1c9')]){if(_0x4b6496[_0x6154('0x13b')]===_0x6154('0x140')){_0x4b6496['queueStatusComplete']=_[_0x6154('0x33')](_0x4b6496[_0x6154('0x114')])?!![]:_0x4b6496[_0x6154('0x114')];var _0xeab334=uuid['v4']();_0x267825[_0x6154('0x1f')][_0xeab334]=new Action(_0x4b6496,_0x3d3dec,_0xeab334);loggerBooked[_0x6154('0x70')](_0x6154('0x1ca'),_0xeab334,_0x6154('0x1cb'),JSON[_0x6154('0x40')](_0x4b6496['queueStatusComplete']),_0x6154('0x1cc'),_0x4b6496['name']);if(_0x4b6496['queueStatusComplete']){_0x4b6496[_0x6154('0x114')]=![];_0x267825[_0x6154('0x22')][_0x267825['actions'][_0xeab334]['queue']]=[];ami[_0x6154('0x9f')]({'actionid':_0xeab334,'action':'queuestatus','queue':_0x4b6496[_0x6154('0x37')]})[_0x6154('0xa1')](function(_0x3e9433){_0x267825[_0x6154('0xa3')](_0x4b6496);_0x267825[_0x6154('0xb1')]({'active':![],'ContactId':_0x267825['actions'][_0xeab334][_0x6154('0xbd')],'ListId':_0x267825['actions'][_0xeab334]['ListId'],'VoiceQueueId':_0x267825[_0x6154('0x1f')][_0xeab334][_0x6154('0xc0')]||undefined,'CampaignId':_0x267825[_0x6154('0x1f')][_0xeab334]['CampaignId']||undefined})['catch'](loggerCatch(_0x6154('0x1cd')));delete _0x267825[_0x6154('0x1f')][_0xeab334];});}else{loggerBooked['info'](_0x6154('0x1ce'),JSON[_0x6154('0x40')](_0x4b6496['queueStatusComplete']),_0x6154('0x1cc'),_0x4b6496[_0x6154('0x37')]);_0x267825[_0x6154('0xa3')](_0x4b6496);_0x267825[_0x6154('0xb1')]({'active':![],'ContactId':_0x267825[_0x6154('0x1f')][_0xeab334][_0x6154('0xbd')],'ListId':_0x267825[_0x6154('0x1f')][_0xeab334][_0x6154('0xbe')],'VoiceQueueId':_0x267825[_0x6154('0x1f')][_0xeab334][_0x6154('0xc0')]||undefined,'CampaignId':_0x267825['actions'][_0xeab334][_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0x1cd')));delete _0x267825[_0x6154('0x1f')][_0xeab334];}}else{return _0x267825[_0x6154('0x14d')](_0x4b6496,_0x3d3dec);}}else{if(getDiff(_0x3d3dec['scheduledat'])<_0x4b6496[_0x6154('0x1cf')]*0x3c){if(_0x3d3dec[_0x6154('0x1d0')]&&!_0x3d3dec['Agent'][_0x6154('0x1d1')]){_0x267825[_0x6154('0x1c')][_0x6154('0x118')](_0x3d3dec['id'])[_0x6154('0x11a')](function(){_0x267825[_0x6154('0xa3')](_0x4b6496);});}else{_0x267825[_0x6154('0xb2')]({'active':![]},_0x3d3dec['id'],0x1)[_0x6154('0x11a')](function(){console[_0x6154('0x1d2')]('Contact\x20updated');_0x267825['updateOriginated'](_0x4b6496);});}}else{_0x4b6496[_0x6154('0x1d3')]+=0x1;_0x267825[_0x6154('0xa3')](_0x4b6496);if(_0x4b6496[_0x6154('0x1d4')]){_0x267825[_0x6154('0xb1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3d3dec[_0x6154('0xbd')],'ListId':_0x3d3dec[_0x6154('0xbe')],'VoiceQueueId':_0x3d3dec['VoiceQueueId']||undefined,'CampaignId':_0x3d3dec[_0x6154('0xc1')]||undefined})[_0x6154('0xa1')](loggerCatch(_0x6154('0x1d5')));_0x267825[_0x6154('0xb8')](createObjHistory(_0x4b6496,_0x3d3dec,_0x6154('0x1d6'),0x17,_0x6154('0x1d7')))['catch'](loggerCatch(_0x6154('0x1d8')));}else{_0x267825[_0x6154('0xbb')](createObjHistory(_0x4b6496,_0x3d3dec,_0x6154('0x1d9'),0x16,'RecallFailedTimeout'),_0x6154('0x1da'),_0x6154('0x1db'));}}}}else{_0x4b6496['outboundBlacklistCallsDay']+=0x1;_0x267825[_0x6154('0xbb')](createObjHistory(_0x4b6496,_0x3d3dec,'BLACKLIST',0xd,_0x6154('0x1dc')),_0x6154('0x1dd'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer['prototype'][_0x6154('0x1de')]=function(_0x4b4d88){var _0x9d1eac=this;var _0xcb5547=[];var _0x72d953=_0x4b4d88[_0x6154('0x1df')]-_0x4b4d88['originated']-_0x4b4d88[_0x6154('0x1e0')];emitCampaignSummary(_0x4b4d88);if(_0x72d953>0x0){if(_0x72d953>this[_0x6154('0x1e')]){_0x72d953=this['maxNumberOriginate'];}_0x4b4d88[_0x6154('0x1e0')]+=_0x72d953;this[_0x6154('0xb4')](_0x4b4d88['id'],_0x72d953,_0x4b4d88[_0x6154('0x1e1')])[_0x6154('0xab')](function(_0x1b7fb5){_0x4b4d88[_0x6154('0x1e0')]-=_0x72d953;_0x4b4d88[_0x6154('0x1e0')]=_0x4b4d88[_0x6154('0x1e0')]>0x0?_0x4b4d88[_0x6154('0x1e0')]:0x0;if(!checkContactEmpty(_0x1b7fb5)){_0x4b4d88[_0x6154('0x34')]=_0x6154('0x1e2');logger['info'](_0x6154('0x1e3')+_0x4b4d88[_0x6154('0x37')]);}else{_0x4b4d88[_0x6154('0x63')]+=_0x1b7fb5[_0x6154('0x8b')];_0x4b4d88['message']=_0x6154('0x1e4');for(var _0x596302=0x0;_0x596302<_0x1b7fb5[_0x6154('0x8b')];_0x596302+=0x1){_0x4b4d88[_0x6154('0x1e5')]+=0x1;if(_[_0x6154('0x9e')](_0x1b7fb5[_0x596302])||_['isNil'](_0x1b7fb5[_0x596302]['Contact'])||_[_0x6154('0x9e')](_0x1b7fb5[_0x596302][_0x6154('0x151')][_0x6154('0x152')])){_0x9d1eac[_0x6154('0x1e6')](_0x6154('0x1e7'),_0x4b4d88,_0x1b7fb5[_0x596302]);}else{_0x9d1eac['checkIsBlackListIvr'](_[_0x6154('0xbc')](_0x1b7fb5[_0x596302],[_0x6154('0xc1'),_0x6154('0x1e8')]))[_0x6154('0xab')](_0x9d1eac['checkContactBlack'](_0x4b4d88,_0x1b7fb5[_0x596302]))[_0x6154('0xa1')](_0x9d1eac['loggerHandler'](_0x6154('0x1e9'),_0x4b4d88));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x4b4d88,_0x72d953));}};Dialer[_0x6154('0x18')][_0x6154('0x13e')]=function(_0x1ee303,_0x23267a){var _0x2a7744=this;var _0x47fb46=[];var _0x32fb14=_0x23267a>=0x1?_0x23267a:0x1;var _0x29f31c=[];if(_0x1ee303[_0x6154('0x13b')]===_0x6154('0x140')){_0x32fb14=0x1;}var _0x1ac3b7=Math[_0x6154('0x1ae')](_0x1ee303[_0x6154('0x46')]*_0x32fb14)-_0x1ee303[_0x6154('0x63')]-_0x1ee303[_0x6154('0x1e0')];emitVoiceQueueSummary(_0x1ee303);if(_0x1ee303[_0x6154('0x1ea')]>0x0){var _0x5dc723=_0x1ee303[_0x6154('0x1ea')]-_0x1ee303['originated']-_0x1ee303[_0x6154('0x4a')]-_0x1ee303[_0x6154('0x1e0')]-_0x1ee303[_0x6154('0x90')];if(_0x1ac3b7>_0x5dc723){_0x1ac3b7=_0x5dc723;}}if(_0x1ac3b7>0x0){if(_0x1ee303[_0x6154('0x13b')]===_0x6154('0x140')){_0x1ac3b7=0x1;}if(_0x1ac3b7>this[_0x6154('0x1e')]){_0x1ac3b7=this[_0x6154('0x1e')];}_0x1ee303['temp']+=_0x1ac3b7;for(var _0x562813 in this[_0x6154('0x10e')]){if(this[_0x6154('0x10e')][_0x6154('0x8c')](_0x562813)){if(this[_0x6154('0x10e')][_0x562813][_0x6154('0x96')]==='not_inuse'&&this['agents'][_0x562813][_0x6154('0xc9')]===_0x6154('0xc8')){_0x47fb46['push'](this[_0x6154('0x10e')][_0x562813]['id']);}}}this['getContactDialer'](_0x1ee303['id'],_0x47fb46,_0x1ac3b7,_0x1ee303[_0x6154('0x1e1')])[_0x6154('0xab')](function(_0xe8010a){_0x1ee303[_0x6154('0x1e0')]-=_0x1ac3b7;_0x1ee303['temp']=_0x1ee303[_0x6154('0x1e0')]>0x0?_0x1ee303[_0x6154('0x1e0')]:0x0;if(!checkContactEmpty(_0xe8010a)){_0x2a7744[_0x6154('0xa9')](_0x1ee303)[_0x6154('0xab')](sendMessageReschedule(_0x1ee303))[_0x6154('0xa1')](loggerCatch(_0x6154('0xac')));}else{_0x1ee303['originated']+=_0xe8010a[_0x6154('0x8b')];_0x1ee303['message']=_0x1ee303[_0x6154('0x13b')]===_0x6154('0x140')?'ACTIVE':_0x6154('0x1e4');for(var _0x15532a=0x0;_0x15532a<_0xe8010a[_0x6154('0x8b')];_0x15532a+=0x1){if(_[_0x6154('0x9e')](_0xe8010a[_0x15532a])||_['isNil'](_0xe8010a[_0x15532a][_0x6154('0x151')])||_['isNil'](_0xe8010a[_0x15532a][_0x6154('0x151')][_0x6154('0x152')])){_0x2a7744[_0x6154('0x1e6')]('[actionOriginate]\x20',_0x1ee303,_0xe8010a[_0x15532a]);}else{_0x2a7744[_0x6154('0xad')](_[_0x6154('0xbc')](_0xe8010a[_0x15532a],[_0x6154('0xc0'),_0x6154('0x1e8')]))[_0x6154('0xab')](_0x2a7744[_0x6154('0x1c8')](_0x1ee303,_0xe8010a[_0x15532a]))[_0x6154('0xa1')](_0x2a7744[_0x6154('0xba')](_0x6154('0x1e7'),_0x1ee303));}}}})['catch'](loggerGetContactDialer(_0x6154('0x1eb'),_0x1ee303,_0x1ac3b7));}};Dialer[_0x6154('0x18')][_0x6154('0x83')]=function(_0x427444){var _0x2a5375=this;if(_0x427444[_0x6154('0x1ea')]>0x0){var _0xba2f07=_0x427444[_0x6154('0x1ea')]-_0x427444[_0x6154('0x63')]-_0x427444[_0x6154('0x4a')];if(_0xba2f07>0x0){this[_0x6154('0x1ec')](_0x427444);}else{loggerPredictiveCalls[_0x6154('0x70')](_0x6154('0x1ed'));}}else{this['tryOriginatePredictive'](_0x427444);}};Dialer['prototype'][_0x6154('0x1ec')]=function(_0x2b28d4){var _0x4d1704=this;var _0x1949af=[];_0x2b28d4['originated']+=0x1;for(var _0x12fb56 in this[_0x6154('0x10e')]){if(this['agents']['hasOwnProperty'](_0x12fb56)){if(this[_0x6154('0x10e')][_0x12fb56]['state']===_0x6154('0x1ee')&&this['agents'][_0x12fb56][_0x6154('0xc9')]===_0x6154('0xc8')){_0x1949af['push'](this[_0x6154('0x10e')][_0x12fb56]['id']);}}}this[_0x6154('0xb3')](_0x2b28d4['id'],_0x1949af,0x1,_0x2b28d4[_0x6154('0x1e1')])[_0x6154('0xab')](function(_0x3b7b59){if(!checkContactEmpty(_0x3b7b59)){checkContactLowerLimitOriginate(_0x2b28d4,0x1,0x0);_0x4d1704[_0x6154('0xa9')](_0x2b28d4)[_0x6154('0xab')](sendMessageReschedule(_0x2b28d4))[_0x6154('0xa1')](loggerCatch(_0x6154('0xac')));}else{_0x2b28d4[_0x6154('0x34')]=_0x6154('0x1e4');if(_['isNil'](_0x3b7b59[0x0])||_[_0x6154('0x9e')](_0x3b7b59[0x0][_0x6154('0x151')])||_['isNil'](_0x3b7b59[0x0][_0x6154('0x151')][_0x6154('0x152')])){_0x4d1704['emptyContact']('[actionOriginate]\x20',_0x2b28d4,_0x3b7b59[0x0]);}else{_0x4d1704[_0x6154('0xad')](_[_0x6154('0xbc')](_0x3b7b59[0x0],[_0x6154('0xc0'),_0x6154('0x1e8')]))[_0x6154('0xab')](_0x4d1704['checkContactBlack'](_0x2b28d4,_0x3b7b59[0x0]))[_0x6154('0xa1')](_0x4d1704[_0x6154('0xba')](_0x6154('0x1ef'),_0x2b28d4));}}})[_0x6154('0xa1')](loggerGetContactDialer(_0x6154('0x1f0'),_0x2b28d4,0x1));emitVoiceQueueSummary(_0x2b28d4);};Dialer['prototype'][_0x6154('0x1be')]=function(_0x275ccd,_0x42145a,_0x1f8f97,_0x12dc47,_0x5e5430,_0x51c164){loggerPredictive[_0x6154('0x70')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x6154('0x1f1'),_0x275ccd);loggerPredictive[_0x6154('0x70')](_0x6154('0x1f2'),_0x42145a);loggerPredictive[_0x6154('0x70')](_0x6154('0x1f3'),_0x1f8f97);loggerPredictive[_0x6154('0x70')](_0x6154('0x1f4'),_0x12dc47);loggerPredictive[_0x6154('0x70')](_0x6154('0x1f5'),_0x5e5430);loggerPredictive[_0x6154('0x70')](_0x6154('0x78'));return new BPromise(function(_0x1f88cf,_0xbc86a0){if(_0x275ccd<=0x0||isNaN(_0x275ccd)){return _0xbc86a0(msgResponse('[abandonmentRate]',_0x6154('0x3f'),_0x6154('0x1f6')+_0x275ccd));}if(_0x1f8f97<=0x0||isNaN(_0x1f8f97)){return _0xbc86a0(msgResponse(_0x6154('0x1f7'),_0x6154('0x3f'),'Ts\x20=\x20'+_0x1f8f97));}if(_0x12dc47<=0x0||isNaN(_0x12dc47)){return _0xbc86a0(msgResponse(_0x6154('0x1f7'),_0x6154('0x3f'),_0x6154('0x1f8')+_0x12dc47));}if(_0x42145a<=0x0||isNaN(_0x42145a)){return _0xbc86a0(msgResponse('[abandonmentRate]','Error','interval\x20=\x20'+_0x42145a));}if(_0x5e5430<=0x0||isNaN(_0x5e5430)){return _0xbc86a0(msgResponse('[abandonmentRate]',_0x6154('0x3f'),'Amax\x20=\x20'+_0x5e5430));}_0x51c164=_0x51c164||0x0;var _0x2e509b=0x1/_0x1f8f97;var _0x496472=0x0;var _0x31015c=0x0;var _0x3fd3e0=0x0;var _0x344a99=0x0;for(var _0x3717dc=0x0;_0x3fd3e0<_0x5e5430;_0x3717dc+=0x1){_0x31015c=_0x3717dc/_0x42145a;_0x496472=(_0x12dc47*_0x31015c+_0x51c164)/_0x2e509b;_0x3fd3e0=erlangb(_0x496472,_0x275ccd);_0x344a99=_0x496472/_0x275ccd*(0x1-erlangb(_0x496472,_0x275ccd));}return _0x1f88cf({'erlangCalls':_0x3717dc,'erlangCallToSecond':_0x42145a/_0x3717dc,'erlangAbandonmentRate':_0x3fd3e0,'erlangBusyFactor':_0x344a99});});};Dialer['prototype'][_0x6154('0x1bf')]=function(_0x334e8d,_0x4628e0,_0x1be421,_0x2c0f3a,_0x1ec889,_0x142a40){loggerPredictive[_0x6154('0x70')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x6154('0x70')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x334e8d);loggerPredictive[_0x6154('0x70')](_0x6154('0x1f2'),_0x4628e0);loggerPredictive[_0x6154('0x70')](_0x6154('0x1f3'),_0x1be421);loggerPredictive[_0x6154('0x70')](_0x6154('0x1f4'),_0x2c0f3a);loggerPredictive[_0x6154('0x70')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ec889);loggerPredictive[_0x6154('0x70')](_0x6154('0x78'));return new BPromise(function(_0xdbde4e,_0x3b05b3){if(_0x334e8d<=0x0||isNaN(_0x334e8d)){return _0x3b05b3(msgResponse(_0x6154('0x1f9'),_0x6154('0x3f'),_0x6154('0x1f6')+_0x334e8d));}if(_0x1be421<=0x0||isNaN(_0x1be421)){return _0x3b05b3(msgResponse(_0x6154('0x1f9'),_0x6154('0x3f'),_0x6154('0x1fa')+_0x1be421));}if(_0x2c0f3a<=0x0||isNaN(_0x2c0f3a)){return _0x3b05b3(msgResponse(_0x6154('0x1f9'),_0x6154('0x3f'),'p\x20=\x20'+_0x2c0f3a));}if(_0x4628e0<=0x0||isNaN(_0x4628e0)){return _0x3b05b3(msgResponse(_0x6154('0x1f9'),_0x6154('0x3f'),'interval\x20=\x20'+_0x4628e0));}if(_0x1ec889<=0x0||isNaN(_0x1ec889)){return _0x3b05b3(msgResponse(_0x6154('0x1f9'),_0x6154('0x3f'),'Umin\x20=\x20'+_0x1ec889));}_0x142a40=_0x142a40||0x0;var _0x597ed1=0x1/_0x1be421;var _0x548e9c=0x0;var _0x4e578f=0x0;var _0x1753bd=0x0;var _0x4e7047=0x0;for(var _0x280238=0x0;_0x4e7047<_0x1ec889;_0x280238+=0x1){_0x4e578f=_0x280238/_0x4628e0;_0x548e9c=(_0x2c0f3a*_0x4e578f+_0x142a40)/_0x597ed1;_0x1753bd=erlangb(_0x548e9c,_0x334e8d);_0x4e7047=_0x548e9c/_0x334e8d*(0x1-erlangb(_0x548e9c,_0x334e8d));}return _0xdbde4e({'erlangCalls':_0x280238,'erlangCallToSecond':_0x4628e0/_0x280238,'erlangAbandonmentRate':_0x1753bd,'erlangBusyFactor':_0x4e7047});});};module[_0x6154('0x1fb')]=Dialer;
\ No newline at end of file
diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js
index b817a89..24d3941 100644
--- a/server/services/ami/dialer/queueCallerAbandon.js
+++ b/server/services/ami/dialer/queueCallerAbandon.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8a54=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','reason','callback','callbackuniqueid'];(function(_0x46d8a2,_0x255825){var _0x1a3fee=function(_0x2e871f){while(--_0x2e871f){_0x46d8a2['push'](_0x46d8a2['shift']());}};_0x1a3fee(++_0x255825);}(_0x8a54,0x171));var _0x48a5=function(_0x433d7e,_0x31424e){_0x433d7e=_0x433d7e-0x0;var _0x164dbf=_0x8a54[_0x433d7e];return _0x164dbf;};'use strict';var util=require(_0x48a5('0x0'));var _=require(_0x48a5('0x1'));var moment=require(_0x48a5('0x2'));function getSeconds(_0x1212c4,_0x3ca440){var _0x36d8c8=moment(_0x1212c4)[_0x48a5('0x3')](0x0);var _0x48703a=moment(_0x3ca440)[_0x48a5('0x3')](0x0);return _0x36d8c8['diff'](_0x48703a,'seconds');}function QueueCallerAbandon(_0xe4c95e,_0x299092){this[_0x48a5('0x4')]=_0xe4c95e[_0x48a5('0x4')];this['type']=_0xe4c95e[_0x48a5('0x5')];this[_0x48a5('0x6')]=_0xe4c95e[_0x48a5('0x5')]==='outbound'?_0x48a5('0x7'):_0xe4c95e[_0x48a5('0x5')];this[_0x48a5('0x8')]=_0xe4c95e[_0x48a5('0x8')];this[_0x48a5('0x9')]=_0xe4c95e[_0x48a5('0x9')];this[_0x48a5('0xa')]=_0xe4c95e['countnoanswerretry'];this[_0x48a5('0xb')]=_0xe4c95e[_0x48a5('0x8')]+_0xe4c95e['countcongestionretry']+_0xe4c95e[_0x48a5('0xa')]+_0xe4c95e[_0x48a5('0xc')]+_0xe4c95e[_0x48a5('0xd')]+_0xe4c95e['countabandonedretry']+_0xe4c95e[_0x48a5('0xe')]+_0xe4c95e[_0x48a5('0xf')];this[_0x48a5('0xc')]=_0xe4c95e['countnosuchnumberretry'];this['countdropretry']=_0xe4c95e['countdropretry'];this[_0x48a5('0x10')]=_0xe4c95e[_0x48a5('0x10')];this[_0x48a5('0xe')]=_0xe4c95e[_0x48a5('0xe')];this[_0x48a5('0xf')]=_0xe4c95e[_0x48a5('0xf')];this['uniqueid']=_0x299092[_0x48a5('0x11')];this[_0x48a5('0x12')]=_0xe4c95e[_0x48a5('0x13')];this['calleridnum']=_0xe4c95e[_0x48a5('0x14')];this[_0x48a5('0x15')]=_0xe4c95e[_0x48a5('0x15')];this[_0x48a5('0x16')]=_0xe4c95e['responsetime'];this[_0x48a5('0x17')]=_0xe4c95e[_0x48a5('0x17')];this[_0x48a5('0x18')]=this['droptime'];this[_0x48a5('0x19')]=getSeconds(_0xe4c95e['responsetime'],_0xe4c95e[_0x48a5('0x15')]);this[_0x48a5('0x1a')]=getSeconds(this[_0x48a5('0x17')],_0xe4c95e[_0x48a5('0x16')]);this[_0x48a5('0x1b')]=0x0;this[_0x48a5('0x7')]=_0x299092[_0x48a5('0x7')];this['membername']=_0x299092['connectedlinename'];this[_0x48a5('0x1c')]=_0x299092['reason'];this['callback']=_0xe4c95e[_0x48a5('0x1d')];this['callbackuniqueid']=_0xe4c95e[_0x48a5('0x1e')];this[_0x48a5('0x1f')]=_0xe4c95e[_0x48a5('0x1f')];this[_0x48a5('0x20')]=_0xe4c95e['recallme'];this[_0x48a5('0x21')]=_0xe4c95e['ContactId'];this[_0x48a5('0x22')]=_0xe4c95e[_0x48a5('0x22')];this[_0x48a5('0x23')]=_0xe4c95e[_0x48a5('0x23')];this[_0x48a5('0x24')]=_0xe4c95e[_0x48a5('0x24')];this['CampaignId']=_0xe4c95e['CampaignId'];this['originatecalleridnum']=_0xe4c95e[_0x48a5('0x25')]||'';this[_0x48a5('0x26')]=_0xe4c95e[_0x48a5('0x26')]||'';}module[_0x48a5('0x27')]=QueueCallerAbandon;
\ No newline at end of file
+var _0xfae0=['type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','calleridnum','starttime','responsetime','droptime','holdtime','connectedlinename','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0xfae0,0x6c));var _0x0fae=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0xfae0[_0x1c6089];return _0x4d97c1;};'use strict';var util=require(_0x0fae('0x0'));var _=require(_0x0fae('0x1'));var moment=require('moment');function getSeconds(_0x51a5e0,_0x31bcf9){var _0x4a5a67=moment(_0x51a5e0)[_0x0fae('0x2')](0x0);var _0x55f358=moment(_0x31bcf9)[_0x0fae('0x2')](0x0);return _0x4a5a67[_0x0fae('0x3')](_0x55f358,_0x0fae('0x4'));}function QueueCallerAbandon(_0x1c017a,_0x3810d1){this[_0x0fae('0x5')]=_0x1c017a[_0x0fae('0x5')];this[_0x0fae('0x6')]=_0x1c017a[_0x0fae('0x6')];this[_0x0fae('0x7')]=_0x1c017a[_0x0fae('0x6')]==='outbound'?_0x0fae('0x8'):_0x1c017a[_0x0fae('0x6')];this[_0x0fae('0x9')]=_0x1c017a[_0x0fae('0x9')];this[_0x0fae('0xa')]=_0x1c017a[_0x0fae('0xa')];this[_0x0fae('0xb')]=_0x1c017a[_0x0fae('0xb')];this[_0x0fae('0xc')]=_0x1c017a[_0x0fae('0x9')]+_0x1c017a['countcongestionretry']+_0x1c017a[_0x0fae('0xb')]+_0x1c017a[_0x0fae('0xd')]+_0x1c017a[_0x0fae('0xe')]+_0x1c017a[_0x0fae('0xf')]+_0x1c017a['countmachineretry']+_0x1c017a[_0x0fae('0x10')];this['countnosuchnumberretry']=_0x1c017a[_0x0fae('0xd')];this[_0x0fae('0xe')]=_0x1c017a['countdropretry'];this[_0x0fae('0xf')]=_0x1c017a['countabandonedretry'];this[_0x0fae('0x11')]=_0x1c017a[_0x0fae('0x11')];this[_0x0fae('0x10')]=_0x1c017a[_0x0fae('0x10')];this[_0x0fae('0x12')]=_0x3810d1['uniqueid'];this[_0x0fae('0x13')]=_0x1c017a['name'];this[_0x0fae('0x14')]=_0x1c017a['number'];this[_0x0fae('0x15')]=_0x1c017a[_0x0fae('0x15')];this['responsetime']=_0x1c017a[_0x0fae('0x16')];this[_0x0fae('0x17')]=_0x1c017a[_0x0fae('0x17')];this['endtime']=this[_0x0fae('0x17')];this['ringtime']=getSeconds(_0x1c017a['responsetime'],_0x1c017a['starttime']);this[_0x0fae('0x18')]=getSeconds(this[_0x0fae('0x17')],_0x1c017a['responsetime']);this['talktime']=0x0;this[_0x0fae('0x8')]=_0x3810d1[_0x0fae('0x8')];this['membername']=_0x3810d1[_0x0fae('0x19')];this['reason']=_0x3810d1['reason'];this[_0x0fae('0x1a')]=_0x1c017a['callback'];this[_0x0fae('0x1b')]=_0x1c017a['callbackuniqueid'];this[_0x0fae('0x1c')]=_0x1c017a[_0x0fae('0x1c')];this[_0x0fae('0x1d')]=_0x1c017a['recallme'];this[_0x0fae('0x1e')]=_0x1c017a['ContactId'];this[_0x0fae('0x1f')]=_0x1c017a[_0x0fae('0x1f')];this[_0x0fae('0x20')]=_0x1c017a['UserId'];this[_0x0fae('0x21')]=_0x1c017a[_0x0fae('0x21')];this['CampaignId']=_0x1c017a[_0x0fae('0x22')];this[_0x0fae('0x23')]=_0x1c017a[_0x0fae('0x23')]||'';this[_0x0fae('0x24')]=_0x1c017a[_0x0fae('0x24')]||'';}module[_0x0fae('0x25')]=QueueCallerAbandon;
\ No newline at end of file
diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js
index 6f456f0..71c9821 100644
--- a/server/services/ami/fax/action.js
+++ b/server/services/ami/fax/action.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9cba=['channel','format','%s/%s/%s','tech','Trunk','name','fax','headerinfo','path','AttachmentId','exports','util','lodash'];(function(_0x464f2d,_0x23e382){var _0x5dd91a=function(_0x51abed){while(--_0x51abed){_0x464f2d['push'](_0x464f2d['shift']());}};_0x5dd91a(++_0x23e382);}(_0x9cba,0x73));var _0xa9cb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9cba[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0xa9cb('0x0'));var _=require(_0xa9cb('0x1'));var moment=require('moment');function Action(_0xe02c4c,_0x4560fd,_0x61c0de){this['uniqueid']=_0xe02c4c||undefined;this[_0xa9cb('0x2')]=util[_0xa9cb('0x3')](_0xa9cb('0x4'),_0x4560fd[_0xa9cb('0x5')],_0x4560fd[_0xa9cb('0x6')][_0xa9cb('0x7')],_0x61c0de[_0xa9cb('0x8')]);this['localstationid']=_0x4560fd['localstationid'];this[_0xa9cb('0x9')]=_0x4560fd[_0xa9cb('0x9')];this[_0xa9cb('0xa')]=_0x61c0de[_0xa9cb('0xa')];this['AttachmentId']=_0x61c0de[_0xa9cb('0xb')];}module[_0xa9cb('0xc')]=Action;
\ No newline at end of file
+var _0x7ad9=['name','localstationid','headerinfo','path','AttachmentId','util','moment','format','tech','Trunk'];(function(_0x3733a5,_0x1e840e){var _0x456ff8=function(_0x1494db){while(--_0x1494db){_0x3733a5['push'](_0x3733a5['shift']());}};_0x456ff8(++_0x1e840e);}(_0x7ad9,0x159));var _0x97ad=function(_0x3a5c35,_0x452d09){_0x3a5c35=_0x3a5c35-0x0;var _0x332797=_0x7ad9[_0x3a5c35];return _0x332797;};'use strict';var util=require(_0x97ad('0x0'));var _=require('lodash');var moment=require(_0x97ad('0x1'));function Action(_0x4b0259,_0x56eedb,_0x104612){this['uniqueid']=_0x4b0259||undefined;this['channel']=util[_0x97ad('0x2')]('%s/%s/%s',_0x56eedb[_0x97ad('0x3')],_0x56eedb[_0x97ad('0x4')][_0x97ad('0x5')],_0x104612['fax']);this[_0x97ad('0x6')]=_0x56eedb['localstationid'];this[_0x97ad('0x7')]=_0x56eedb[_0x97ad('0x7')];this['path']=_0x104612[_0x97ad('0x8')];this[_0x97ad('0x9')]=_0x104612['AttachmentId'];}module['exports']=Action;
\ No newline at end of file
diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js
index 6494cf0..fa8f917 100644
--- a/server/services/ami/fax/index.js
+++ b/server/services/ami/fax/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2fc4=['lodash','bluebird','moment','path','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','FaxAccountId','Trunk','Trunk\x20Reachable','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Is\x20Valid'];(function(_0x1b8498,_0x891643){var _0x40add6=function(_0xe1d17b){while(--_0xe1d17b){_0x1b8498['push'](_0x1b8498['shift']());}};_0x40add6(++_0x891643);}(_0x2fc4,0x153));var _0x42fc=function(_0x27f424,_0xa6af37){_0x27f424=_0x27f424-0x0;var _0x5ae589=_0x2fc4[_0x27f424];return _0x5ae589;};'use strict';var util=require('util');var _=require(_0x42fc('0x0'));var BPromise=require(_0x42fc('0x1'));var uuid=require('uuid');var moment=require(_0x42fc('0x2'));var path=require(_0x42fc('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x42fc('0x4'))(_0x42fc('0x5'));var ami=require(_0x42fc('0x6'));var rpcDb=require(_0x42fc('0x7'));var Channel=require(_0x42fc('0x8'));var ut=require(_0x42fc('0x9'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x42fc('0xa'));var faxMessage=require(_0x42fc('0xb'));function Fax(_0x11fcf2){this[_0x42fc('0xc')]={};this[_0x42fc('0xd')]=_0x11fcf2[_0x42fc('0xd')];this[_0x42fc('0xe')]=_0x11fcf2[_0x42fc('0xe')];this[_0x42fc('0xf')]={};ami['on'](_0x42fc('0x10'),this[_0x42fc('0x11')][_0x42fc('0x12')](this));ami['on'](_0x42fc('0x13'),this[_0x42fc('0x14')][_0x42fc('0x12')](this));ami['on']('newstate',this[_0x42fc('0x15')]['bind'](this));ami['on']('newexten',this[_0x42fc('0x16')][_0x42fc('0x12')](this));ami['on']('faxstatus',this[_0x42fc('0x17')][_0x42fc('0x12')](this));ami['on'](_0x42fc('0x18'),this[_0x42fc('0x19')]['bind'](this));ami['on']('hangup',this[_0x42fc('0x1a')][_0x42fc('0x12')](this));ami['on']('originateresponse',this[_0x42fc('0x1b')]['bind'](this));}Fax['prototype']['syncNewchannel']=function(_0x14a54b){if(_0x14a54b[_0x42fc('0x1c')]===_0x42fc('0x1d')){for(var _0xf4a563 in this[_0x42fc('0xd')]){if(this[_0x42fc('0xd')][_0x42fc('0x1e')](_0xf4a563)){if(_0x14a54b[_0x42fc('0x1f')]===this[_0x42fc('0xd')][_0xf4a563][_0x42fc('0x20')]){this[_0x42fc('0xc')][_0x14a54b[_0x42fc('0x21')]]={};this['channels'][_0x14a54b[_0x42fc('0x21')]][_0x42fc('0x22')]=_0x14a54b[_0x42fc('0x22')];this['channels'][_0x14a54b[_0x42fc('0x21')]]['id']=this[_0x42fc('0xd')][_0xf4a563]['id'];this['channels'][_0x14a54b[_0x42fc('0x21')]][_0x42fc('0x23')]=this[_0x42fc('0xd')][_0xf4a563]['name'];logger['info'](_0x14a54b[_0x42fc('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0x42fc('0xf')][_0x14a54b['uniqueid']]){this[_0x42fc('0xc')][_0x14a54b['uniqueid']]={};this['channels'][_0x14a54b['uniqueid']][_0x42fc('0x22')]=_0x14a54b[_0x42fc('0x22')];logger[_0x42fc('0x24')](_0x14a54b['uniqueid'],_0x42fc('0x25'));}};Fax[_0x42fc('0x26')][_0x42fc('0x14')]=function(_0x63b70c){if(this['channels'][_0x63b70c['uniqueid']]){for(var _0x27e92d in _0x63b70c[_0x42fc('0x27')]){if(_0x63b70c['variable'][_0x42fc('0x1e')](_0x27e92d)){this[_0x42fc('0xc')][_0x63b70c[_0x42fc('0x21')]][_0x27e92d]=_0x63b70c[_0x42fc('0x28')];}}}};Fax[_0x42fc('0x26')][_0x42fc('0x15')]=function(_0x3ed823){if(this[_0x42fc('0xc')][_0x3ed823[_0x42fc('0x21')]]){this[_0x42fc('0xc')][_0x3ed823[_0x42fc('0x21')]][_0x42fc('0x29')]=_0x3ed823[_0x42fc('0x29')];this[_0x42fc('0xc')][_0x3ed823[_0x42fc('0x21')]][_0x42fc('0x2a')]=_0x3ed823[_0x42fc('0x2a')];}};Fax['prototype'][_0x42fc('0x16')]=function(_0x556e46){if(this['channels'][_0x556e46['uniqueid']]){for(var _0x562ad4 in _0x556e46['variable']){if(_0x556e46[_0x42fc('0x27')]['hasOwnProperty'](_0x562ad4)){this['channels'][_0x556e46[_0x42fc('0x21')]][_0x562ad4]=_0x556e46[_0x42fc('0x28')];}}}};Fax[_0x42fc('0x26')][_0x42fc('0x17')]=function(_0x3177ff){if(this['channels'][_0x3177ff[_0x42fc('0x21')]]){this[_0x42fc('0xc')][_0x3177ff[_0x42fc('0x21')]][_0x42fc('0x2b')]=_0x3177ff['operation'];this[_0x42fc('0xc')][_0x3177ff[_0x42fc('0x21')]]['status']=_0x3177ff[_0x42fc('0x2c')];this[_0x42fc('0xc')][_0x3177ff['uniqueid']][_0x42fc('0x20')]=_0x3177ff['localstationid'];this[_0x42fc('0xc')][_0x3177ff[_0x42fc('0x21')]][_0x42fc('0x2d')]=_0x3177ff[_0x42fc('0x2d')];logger[_0x42fc('0x24')](_0x3177ff[_0x42fc('0x21')],'\x20syncFaxStatus\x20');}};Fax[_0x42fc('0x26')][_0x42fc('0x19')]=function(_0x491097){var _0x561885=this;if(this[_0x42fc('0xc')][_0x491097[_0x42fc('0x21')]]){var _0x4693a4=this[_0x42fc('0xc')][_0x491097[_0x42fc('0x21')]]['id'];this[_0x42fc('0xc')][_0x491097[_0x42fc('0x21')]]['remotestationid']=_0x491097[_0x42fc('0x2e')];this[_0x42fc('0xc')][_0x491097['uniqueid']][_0x42fc('0x2f')]=_0x491097[_0x42fc('0x2f')];this[_0x42fc('0xc')][_0x491097['uniqueid']][_0x42fc('0x20')]=_0x491097[_0x42fc('0x20')];this[_0x42fc('0xc')][_0x491097[_0x42fc('0x21')]][_0x42fc('0x30')]=_0x491097[_0x42fc('0x30')];this['channels'][_0x491097[_0x42fc('0x21')]]['transferrate']=_0x491097['transferrate'];this[_0x42fc('0xc')][_0x491097[_0x42fc('0x21')]]['filename']=_0x491097[_0x42fc('0x2d')];this[_0x42fc('0xc')][_0x491097['uniqueid']][_0x42fc('0x31')]=_0x491097[_0x42fc('0x31')];if(this['channels'][_0x491097[_0x42fc('0x21')]]['pagestransferred']>0x0){tiff2pdf(_0x491097[_0x42fc('0x2d')],'/var/opt/motion2/server/files/attachments/',function(_0x5be991){logger[_0x42fc('0x24')](_0x491097[_0x42fc('0x21')],_0x42fc('0x32'),_0x5be991[_0x42fc('0x33')]);attachment[_0x42fc('0x34')]({'name':path[_0x42fc('0x35')](_0x491097['filename'])[_0x42fc('0x23')],'basename':path[_0x42fc('0x35')](_0x491097[_0x42fc('0x2d')])[_0x42fc('0x23')]+_0x42fc('0x36'),'type':'application/pdf'})[_0x42fc('0x37')](function(_0x4e4a70){faxAccount[_0x42fc('0x38')](_0x4693a4,{'from':_0x491097[_0x42fc('0x31')],'mapKey':_0x42fc('0x5'),'body':path[_0x42fc('0x35')](_0x491097[_0x42fc('0x2d')])[_0x42fc('0x23')]+'.pdf','AttachmentId':_0x4e4a70['id']})['catch'](function(_0xea90bb){logger[_0x42fc('0x39')](_0x491097['uniqueid'],_0x42fc('0x3a'),JSON[_0x42fc('0x3b')](_0xea90bb));});})[_0x42fc('0x3c')](function(_0x4b1ac1){logger[_0x42fc('0x39')](_0x491097[_0x42fc('0x21')],'\x20receiveFax\x20',JSON['stringify'](_0x4b1ac1));});});}logger['info'](_0x491097[_0x42fc('0x21')],_0x42fc('0x3d'));}};Fax['prototype'][_0x42fc('0x1b')]=function(_0x205de3){if(this['actions'][_0x205de3['uniqueid']]){_[_0x42fc('0x3e')](this[_0x42fc('0xc')][_0x205de3['uniqueid']],_['pick'](_0x205de3,[_0x42fc('0x3f'),_0x42fc('0x40')]));}};function updateStatus(_0x2438a3){if(_0x2438a3[_0x42fc('0x41')]){faxMessage[_0x42fc('0x42')](_0x2438a3[_0x42fc('0x41')],{'failMessage':_0x42fc('0x43')})[_0x42fc('0x37')](function(_0x556e8b){ut[_0x42fc('0x44')](_0x42fc('0x45'),_0x556e8b);})[_0x42fc('0x3c')](function(_0x31805c){ut[_0x42fc('0x44')](_0x42fc('0x46'),_0x31805c);});}else{ut[_0x42fc('0x44')](_0x42fc('0x47'));}}Fax[_0x42fc('0x26')][_0x42fc('0x48')]=function(_0x55ba21,_0x11051c,_0x3edf32){var _0x523218=this;var _0x413750={};if(_0x11051c){_0x413750={'read':_0x11051c};}else{_0x413750={'failMessage':_0x3edf32};}if(this[_0x42fc('0xf')][_0x55ba21][_0x42fc('0x41')]){faxMessage[_0x42fc('0x42')](this[_0x42fc('0xf')][_0x55ba21]['AttachmentId'],_0x413750)[_0x42fc('0x37')](function(_0x35d946){ut[_0x42fc('0x44')]('[Fax][Message][Updated]',_0x35d946);})[_0x42fc('0x3c')](function(_0x21980e){ut[_0x42fc('0x44')]('[Fax][Message][NoUpdate1]',_0x21980e);})[_0x42fc('0x49')](function(){delete _0x523218[_0x42fc('0xc')][_0x55ba21];delete _0x523218[_0x42fc('0xf')][_0x55ba21];});}else{ut[_0x42fc('0x44')](_0x42fc('0x4a'));delete this[_0x42fc('0xc')][_0x55ba21];delete this[_0x42fc('0xf')][_0x55ba21];}};Fax['prototype'][_0x42fc('0x1a')]=function(_0x1cc36b){var _0x7ea727=this;if(this[_0x42fc('0xc')][_0x1cc36b[_0x42fc('0x21')]]){if(this['actions'][_0x1cc36b[_0x42fc('0x21')]]){this[_0x42fc('0xc')][_0x1cc36b[_0x42fc('0x21')]]['id']=this['actions'][_0x1cc36b['uniqueid']]['id'];this[_0x42fc('0xc')][_0x1cc36b[_0x42fc('0x21')]][_0x42fc('0x23')]=this[_0x42fc('0xf')][_0x1cc36b[_0x42fc('0x21')]]['name'];}logger[_0x42fc('0x24')](_0x1cc36b[_0x42fc('0x21')],this[_0x42fc('0xf')][_0x1cc36b['uniqueid']]?_0x42fc('0x4b'):'\x20hangup\x20faxRiceive\x20',JSON[_0x42fc('0x3b')](this[_0x42fc('0xc')][_0x1cc36b[_0x42fc('0x21')]]));if(this[_0x42fc('0xf')][_0x1cc36b['uniqueid']]){if(this[_0x42fc('0xc')][_0x1cc36b['uniqueid']][_0x42fc('0x4c')]>0x0&&this[_0x42fc('0xc')][_0x1cc36b['uniqueid']][_0x42fc('0x4d')]===_0x42fc('0x4e')){this[_0x42fc('0x48')](_0x1cc36b[_0x42fc('0x21')],!![]);}else{this[_0x42fc('0x48')](_0x1cc36b['uniqueid'],![],this[_0x42fc('0xc')][_0x1cc36b[_0x42fc('0x21')]]['faxstatusstring']?_0x42fc('0x4f')+this['channels'][_0x1cc36b['uniqueid']][_0x42fc('0x50')]:_0x42fc('0x51'));}}}};Fax[_0x42fc('0x26')][_0x42fc('0x52')]=function(_0x1cf64c){var _0x2240ef=this;return new BPromise(function(_0x39326e,_0x2aaced){_0x2240ef[_0x42fc('0x53')](_0x1cf64c,_0x2240ef['faxAccounts'][_0x1cf64c['FaxAccountId']])['then'](function(_0x69c06d){ut['logger'](_0x42fc('0x54'),_0x69c06d);_0x39326e(ut[_0x42fc('0x33')](_0x42fc('0x55')));})['catch'](function(_0x41a65b){ut[_0x42fc('0x44')](_0x42fc('0x56'),_0x41a65b);updateStatus(_0x1cf64c);_0x2aaced(ut['message'](_0x42fc('0x57')));});});};Fax[_0x42fc('0x26')][_0x42fc('0x58')]=function(_0x4d31ab){var _0x575a63=this;return new BPromise(function(_0xe5fb47,_0x53cdc8){var _0x1d7bcd=_0x575a63['checkTrunk'](_0x575a63[_0x42fc('0xd')][_0x4d31ab[_0x42fc('0x59')]][_0x42fc('0x5a')],_0x4d31ab);if(_0x1d7bcd['isValid']){_0xe5fb47(ut[_0x42fc('0x33')](_0x42fc('0x5b')));}else{_0x53cdc8(ut['message'](_0x1d7bcd[_0x42fc('0x33')]));}});};function originate(_0x1707fb,_0x3e5ad6,_0x33b489){return new BPromise(function(_0x2eb856,_0x815882){if(_0x33b489){var _0x1d6fa1=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x1707fb[_0x42fc('0x3')])[_0x42fc('0x23')],_0x1707fb[_0x42fc('0x3')]);gs[_0x42fc('0x5c')](_0x1d6fa1)[_0x42fc('0x37')](function(){_0x1707fb['path']=util[_0x42fc('0x5d')](_0x42fc('0x5e'),path['parse'](_0x1707fb[_0x42fc('0x3')])[_0x42fc('0x5f')],path['parse'](_0x1707fb[_0x42fc('0x3')])[_0x42fc('0x23')]);_0x3e5ad6[_0x42fc('0x60')]=_0x1707fb[_0x42fc('0x3')];ut['logger'](_0x42fc('0x61'),'');ami[_0x42fc('0x62')](ut[_0x42fc('0x63')](_0x1707fb,_0x3e5ad6))['then'](function(_0x4d5544){_0x2eb856(_0x4d5544);})[_0x42fc('0x3c')](function(_0x36dcb3){_0x815882(_0x36dcb3);});})[_0x42fc('0x3c')](function(_0x4cd441){_0x815882(_0x4cd441);});}else{ami[_0x42fc('0x62')](ut[_0x42fc('0x63')](_0x1707fb,_0x3e5ad6))[_0x42fc('0x37')](function(_0x3e09a5){_0x2eb856(_0x3e09a5);})['catch'](function(_0x5d62c2){_0x815882(_0x5d62c2);});}});}Fax[_0x42fc('0x26')]['execOriginate']=function(_0x3c0db9,_0x92590b){var _0x12f385=this;return new BPromise(function(_0x399baf,_0xa8ff60){var _0x7b43d3=uuid['v4']();var _0x2390e9=ut[_0x42fc('0x64')](_0x3c0db9,_0x92590b);_0x12f385[_0x42fc('0xf')][_0x7b43d3]=new Action(_0x7b43d3,_0x92590b,_0x3c0db9);var _0x19c8a0=_0x12f385[_0x42fc('0xf')][_0x7b43d3];if(path['parse'](_0x3c0db9[_0x42fc('0x3')])['ext']===_0x42fc('0x36')){originate(_0x19c8a0,_0x2390e9,!![])['then'](function(_0xc8e440){_0x399baf(_0xc8e440);})[_0x42fc('0x3c')](function(_0x41b0cf){_0xa8ff60(_0x41b0cf);});}else{originate(_0x19c8a0,_0x2390e9,![])[_0x42fc('0x37')](function(_0x1d55c3){_0x399baf(_0x1d55c3);})[_0x42fc('0x3c')](function(_0x332f7d){_0xa8ff60(_0x332f7d);});}});};Fax['prototype'][_0x42fc('0x65')]=function(_0x3349b7){return!_['isNil'](_0x3349b7)&&!_[_0x42fc('0x66')](_0x3349b7[_0x42fc('0x23')])&&!_[_0x42fc('0x66')](_0x3349b7['active'])&&_0x3349b7[_0x42fc('0x67')]&&!_[_0x42fc('0x66')](this[_0x42fc('0xe')][util['format'](_0x42fc('0x68'),_0x3349b7[_0x42fc('0x23')])])&&!_[_0x42fc('0x66')](this[_0x42fc('0xe')][util[_0x42fc('0x5d')](_0x42fc('0x68'),_0x3349b7[_0x42fc('0x23')])][_0x42fc('0x2c')])&&(this[_0x42fc('0xe')][util[_0x42fc('0x5d')](_0x42fc('0x68'),_0x3349b7['name'])][_0x42fc('0x2c')]==='reachable'||this[_0x42fc('0xe')][util[_0x42fc('0x5d')]('SIP/%s',_0x3349b7[_0x42fc('0x23')])][_0x42fc('0x2c')]===_0x42fc('0x69'));};Fax[_0x42fc('0x26')][_0x42fc('0x6a')]=function(_0x11dd55,_0x2c8a59){if(!this[_0x42fc('0x65')](_0x11dd55)){ut[_0x42fc('0x44')](_0x42fc('0x6b'),_[_0x42fc('0x66')](_0x11dd55)?'':_0x11dd55[_0x42fc('0x23')]+_0x42fc('0x6c'));return{'isValid':![],'message':_0x42fc('0x6d')};}if(_['isNil'](_0x2c8a59['fax'])){ut[_0x42fc('0x44')](_0x42fc('0x6e'),JSON[_0x42fc('0x3b')](_0x2c8a59));return{'isValid':![],'message':_0x42fc('0x6f')};}if(_[_0x42fc('0x66')](_0x2c8a59[_0x42fc('0x3')])){ut[_0x42fc('0x44')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x42fc('0x3b')](_0x2c8a59));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x42fc('0x70')};};module['exports']=Fax;
\ No newline at end of file
+var _0x108b=['varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','hangup','syncHangup','originateresponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','channelstate','channelstatedesc','variable','value','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','then','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','message','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','Trunk','isValid','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel'];(function(_0x1ad82b,_0x4a018e){var _0x5d7621=function(_0x90b6d8){while(--_0x90b6d8){_0x1ad82b['push'](_0x1ad82b['shift']());}};_0x5d7621(++_0x4a018e);}(_0x108b,0x65));var _0xb108=function(_0x490e0a,_0x1eca50){_0x490e0a=_0x490e0a-0x0;var _0x212ff2=_0x108b[_0x490e0a];return _0x212ff2;};'use strict';var util=require(_0xb108('0x0'));var _=require(_0xb108('0x1'));var BPromise=require(_0xb108('0x2'));var uuid=require(_0xb108('0x3'));var moment=require(_0xb108('0x4'));var path=require(_0xb108('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require('../../../config/logger')(_0xb108('0x6'));var ami=require(_0xb108('0x7'));var rpcDb=require(_0xb108('0x8'));var Channel=require('./channel');var ut=require(_0xb108('0x9'));var Action=require(_0xb108('0xa'));var faxAccount=require(_0xb108('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xb108('0xc'));function Fax(_0x4768f0){this[_0xb108('0xd')]={};this[_0xb108('0xe')]=_0x4768f0['faxAccounts'];this[_0xb108('0xf')]=_0x4768f0[_0xb108('0xf')];this[_0xb108('0x10')]={};ami['on'](_0xb108('0x11'),this[_0xb108('0x12')]['bind'](this));ami['on'](_0xb108('0x13'),this[_0xb108('0x14')][_0xb108('0x15')](this));ami['on'](_0xb108('0x16'),this[_0xb108('0x17')][_0xb108('0x15')](this));ami['on'](_0xb108('0x18'),this[_0xb108('0x19')]['bind'](this));ami['on'](_0xb108('0x1a'),this['syncFaxStatus'][_0xb108('0x15')](this));ami['on'](_0xb108('0x1b'),this['syncReceiveFax'][_0xb108('0x15')](this));ami['on'](_0xb108('0x1c'),this[_0xb108('0x1d')]['bind'](this));ami['on'](_0xb108('0x1e'),this['syncOriginateResponse'][_0xb108('0x15')](this));}Fax['prototype']['syncNewchannel']=function(_0x326db9){if(_0x326db9[_0xb108('0x1f')]===_0xb108('0x20')){for(var _0x3460f0 in this[_0xb108('0xe')]){if(this[_0xb108('0xe')][_0xb108('0x21')](_0x3460f0)){if(_0x326db9[_0xb108('0x22')]===this[_0xb108('0xe')][_0x3460f0][_0xb108('0x23')]){this[_0xb108('0xd')][_0x326db9['uniqueid']]={};this['channels'][_0x326db9[_0xb108('0x24')]][_0xb108('0x25')]=_0x326db9[_0xb108('0x25')];this[_0xb108('0xd')][_0x326db9[_0xb108('0x24')]]['id']=this['faxAccounts'][_0x3460f0]['id'];this[_0xb108('0xd')][_0x326db9[_0xb108('0x24')]][_0xb108('0x26')]=this['faxAccounts'][_0x3460f0]['name'];logger[_0xb108('0x27')](_0x326db9[_0xb108('0x24')],_0xb108('0x28'));}}}}if(this[_0xb108('0x10')][_0x326db9['uniqueid']]){this['channels'][_0x326db9['uniqueid']]={};this[_0xb108('0xd')][_0x326db9['uniqueid']][_0xb108('0x25')]=_0x326db9[_0xb108('0x25')];logger[_0xb108('0x27')](_0x326db9['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0xb108('0x29')][_0xb108('0x14')]=function(_0x272ba6){if(this[_0xb108('0xd')][_0x272ba6[_0xb108('0x24')]]){for(var _0x36ddaa in _0x272ba6['variable']){if(_0x272ba6['variable'][_0xb108('0x21')](_0x36ddaa)){this[_0xb108('0xd')][_0x272ba6[_0xb108('0x24')]][_0x36ddaa]=_0x272ba6['value'];}}}};Fax[_0xb108('0x29')][_0xb108('0x17')]=function(_0x5a46cf){if(this[_0xb108('0xd')][_0x5a46cf['uniqueid']]){this[_0xb108('0xd')][_0x5a46cf[_0xb108('0x24')]][_0xb108('0x2a')]=_0x5a46cf[_0xb108('0x2a')];this['channels'][_0x5a46cf[_0xb108('0x24')]][_0xb108('0x2b')]=_0x5a46cf[_0xb108('0x2b')];}};Fax['prototype'][_0xb108('0x19')]=function(_0x413bd3){if(this[_0xb108('0xd')][_0x413bd3['uniqueid']]){for(var _0x2b4c57 in _0x413bd3[_0xb108('0x2c')]){if(_0x413bd3[_0xb108('0x2c')][_0xb108('0x21')](_0x2b4c57)){this['channels'][_0x413bd3[_0xb108('0x24')]][_0x2b4c57]=_0x413bd3[_0xb108('0x2d')];}}}};Fax[_0xb108('0x29')][_0xb108('0x2e')]=function(_0x202eef){if(this[_0xb108('0xd')][_0x202eef[_0xb108('0x24')]]){this[_0xb108('0xd')][_0x202eef[_0xb108('0x24')]][_0xb108('0x2f')]=_0x202eef['operation'];this[_0xb108('0xd')][_0x202eef[_0xb108('0x24')]][_0xb108('0x30')]=_0x202eef[_0xb108('0x30')];this['channels'][_0x202eef[_0xb108('0x24')]][_0xb108('0x23')]=_0x202eef[_0xb108('0x23')];this[_0xb108('0xd')][_0x202eef['uniqueid']]['filename']=_0x202eef[_0xb108('0x31')];logger['info'](_0x202eef['uniqueid'],_0xb108('0x32'));}};Fax['prototype'][_0xb108('0x33')]=function(_0x31218e){var _0x4eee05=this;if(this[_0xb108('0xd')][_0x31218e[_0xb108('0x24')]]){var _0x57f558=this['channels'][_0x31218e[_0xb108('0x24')]]['id'];this['channels'][_0x31218e['uniqueid']][_0xb108('0x34')]=_0x31218e[_0xb108('0x34')];this[_0xb108('0xd')][_0x31218e[_0xb108('0x24')]]['pagestransferred']=_0x31218e[_0xb108('0x35')];this[_0xb108('0xd')][_0x31218e[_0xb108('0x24')]][_0xb108('0x23')]=_0x31218e[_0xb108('0x23')];this[_0xb108('0xd')][_0x31218e[_0xb108('0x24')]][_0xb108('0x36')]=_0x31218e[_0xb108('0x36')];this[_0xb108('0xd')][_0x31218e[_0xb108('0x24')]]['transferrate']=_0x31218e[_0xb108('0x37')];this[_0xb108('0xd')][_0x31218e[_0xb108('0x24')]][_0xb108('0x31')]=_0x31218e[_0xb108('0x31')];this[_0xb108('0xd')][_0x31218e['uniqueid']][_0xb108('0x38')]=_0x31218e[_0xb108('0x38')];if(this['channels'][_0x31218e['uniqueid']][_0xb108('0x35')]>0x0){tiff2pdf(_0x31218e[_0xb108('0x31')],_0xb108('0x39'),function(_0x3f3528){logger[_0xb108('0x27')](_0x31218e['uniqueid'],_0xb108('0x3a'),_0x3f3528['message']);attachment[_0xb108('0x3b')]({'name':path[_0xb108('0x3c')](_0x31218e['filename'])[_0xb108('0x26')],'basename':path[_0xb108('0x3c')](_0x31218e[_0xb108('0x31')])[_0xb108('0x26')]+'.pdf','type':'application/pdf'})[_0xb108('0x3d')](function(_0x36c4b1){faxAccount[_0xb108('0x3e')](_0x57f558,{'from':_0x31218e[_0xb108('0x38')],'mapKey':_0xb108('0x6'),'body':path[_0xb108('0x3c')](_0x31218e[_0xb108('0x31')])['name']+_0xb108('0x3f'),'AttachmentId':_0x36c4b1['id']})[_0xb108('0x40')](function(_0x479d8b){logger[_0xb108('0x41')](_0x31218e['uniqueid'],_0xb108('0x42'),JSON[_0xb108('0x43')](_0x479d8b));});})['catch'](function(_0x45a4f0){logger['error'](_0x31218e['uniqueid'],_0xb108('0x44'),JSON[_0xb108('0x43')](_0x45a4f0));});});}logger[_0xb108('0x27')](_0x31218e[_0xb108('0x24')],_0xb108('0x44'));}};Fax[_0xb108('0x29')]['syncOriginateResponse']=function(_0x19b27c){if(this[_0xb108('0x10')][_0x19b27c['uniqueid']]){_[_0xb108('0x45')](this[_0xb108('0xd')][_0x19b27c[_0xb108('0x24')]],_[_0xb108('0x46')](_0x19b27c,[_0xb108('0x47'),'reason']));}};function updateStatus(_0x534bd4){if(_0x534bd4[_0xb108('0x48')]){faxMessage['update'](_0x534bd4[_0xb108('0x48')],{'failMessage':_0xb108('0x49')})['then'](function(_0x47ffd9){ut[_0xb108('0x4a')]('[Fax][Message][Error][Updated]',_0x47ffd9);})[_0xb108('0x40')](function(_0xa27ee1){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0xa27ee1);});}else{ut[_0xb108('0x4a')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype']['updateStatus']=function(_0xf0c26d,_0x27dd9c,_0x6bbfb7){var _0x4c8618=this;var _0x440952={};if(_0x27dd9c){_0x440952={'read':_0x27dd9c};}else{_0x440952={'failMessage':_0x6bbfb7};}if(this[_0xb108('0x10')][_0xf0c26d]['AttachmentId']){faxMessage[_0xb108('0x4b')](this[_0xb108('0x10')][_0xf0c26d][_0xb108('0x48')],_0x440952)[_0xb108('0x3d')](function(_0x4fdc61){ut[_0xb108('0x4a')](_0xb108('0x4c'),_0x4fdc61);})[_0xb108('0x40')](function(_0x4e2a6d){ut['logger'](_0xb108('0x4d'),_0x4e2a6d);})[_0xb108('0x4e')](function(){delete _0x4c8618[_0xb108('0xd')][_0xf0c26d];delete _0x4c8618[_0xb108('0x10')][_0xf0c26d];});}else{ut[_0xb108('0x4a')](_0xb108('0x4f'));delete this[_0xb108('0xd')][_0xf0c26d];delete this[_0xb108('0x10')][_0xf0c26d];}};Fax[_0xb108('0x29')][_0xb108('0x1d')]=function(_0x1bd0cd){var _0x2efa21=this;if(this[_0xb108('0xd')][_0x1bd0cd['uniqueid']]){if(this[_0xb108('0x10')][_0x1bd0cd[_0xb108('0x24')]]){this[_0xb108('0xd')][_0x1bd0cd[_0xb108('0x24')]]['id']=this[_0xb108('0x10')][_0x1bd0cd[_0xb108('0x24')]]['id'];this[_0xb108('0xd')][_0x1bd0cd[_0xb108('0x24')]]['name']=this[_0xb108('0x10')][_0x1bd0cd[_0xb108('0x24')]][_0xb108('0x26')];}logger['info'](_0x1bd0cd[_0xb108('0x24')],this[_0xb108('0x10')][_0x1bd0cd[_0xb108('0x24')]]?_0xb108('0x50'):_0xb108('0x51'),JSON[_0xb108('0x43')](this[_0xb108('0xd')][_0x1bd0cd['uniqueid']]));if(this[_0xb108('0x10')][_0x1bd0cd[_0xb108('0x24')]]){if(this[_0xb108('0xd')][_0x1bd0cd[_0xb108('0x24')]]['faxpages']>0x0&&this['channels'][_0x1bd0cd['uniqueid']]['faxstatus']===_0xb108('0x52')){this[_0xb108('0x53')](_0x1bd0cd[_0xb108('0x24')],!![]);}else{this[_0xb108('0x53')](_0x1bd0cd[_0xb108('0x24')],![],this['channels'][_0x1bd0cd[_0xb108('0x24')]][_0xb108('0x54')]?_0xb108('0x55')+this['channels'][_0x1bd0cd[_0xb108('0x24')]][_0xb108('0x54')]:_0xb108('0x56'));}}}};Fax[_0xb108('0x29')][_0xb108('0x57')]=function(_0x1eecb9){var _0x3e825e=this;return new BPromise(function(_0x4c92c7,_0x775fba){_0x3e825e[_0xb108('0x58')](_0x1eecb9,_0x3e825e[_0xb108('0xe')][_0x1eecb9[_0xb108('0x59')]])[_0xb108('0x3d')](function(_0x40bbe4){ut[_0xb108('0x4a')]('[Fax][execOriginate][success]',_0x40bbe4);_0x4c92c7(ut[_0xb108('0x5a')](_0xb108('0x5b')));})[_0xb108('0x40')](function(_0x4d0e7f){ut[_0xb108('0x4a')](_0xb108('0x5c'),_0x4d0e7f);updateStatus(_0x1eecb9);_0x775fba(ut[_0xb108('0x5a')]('Fax\x20failed'));});});};Fax[_0xb108('0x29')][_0xb108('0x5d')]=function(_0x3f06c1){var _0x3bfd47=this;return new BPromise(function(_0x41af19,_0x20272b){var _0x531d04=_0x3bfd47['checkTrunk'](_0x3bfd47[_0xb108('0xe')][_0x3f06c1['FaxAccountId']][_0xb108('0x5e')],_0x3f06c1);if(_0x531d04[_0xb108('0x5f')]){_0x41af19(ut[_0xb108('0x5a')]('Trunk\x20Reachable'));}else{_0x20272b(ut['message'](_0x531d04['message']));}});};function originate(_0x28aaf4,_0x7229e,_0x3766ee){return new BPromise(function(_0x21a27e,_0x3ae15b){if(_0x3766ee){var _0x127d50=util['format'](_0xb108('0x60'),path[_0xb108('0x3c')](_0x28aaf4['path'])[_0xb108('0x26')],_0x28aaf4[_0xb108('0x5')]);gs['execute'](_0x127d50)[_0xb108('0x3d')](function(){_0x28aaf4[_0xb108('0x5')]=util['format'](_0xb108('0x61'),path[_0xb108('0x3c')](_0x28aaf4['path'])[_0xb108('0x62')],path['parse'](_0x28aaf4[_0xb108('0x5')])[_0xb108('0x26')]);_0x7229e[_0xb108('0x63')]=_0x28aaf4[_0xb108('0x5')];ut[_0xb108('0x4a')](_0xb108('0x64'),'');ami[_0xb108('0x65')](ut['variablesAction'](_0x28aaf4,_0x7229e))[_0xb108('0x3d')](function(_0x49edd7){_0x21a27e(_0x49edd7);})[_0xb108('0x40')](function(_0x2f422a){_0x3ae15b(_0x2f422a);});})[_0xb108('0x40')](function(_0x164c7b){_0x3ae15b(_0x164c7b);});}else{ami[_0xb108('0x65')](ut[_0xb108('0x66')](_0x28aaf4,_0x7229e))[_0xb108('0x3d')](function(_0x2df2bd){_0x21a27e(_0x2df2bd);})[_0xb108('0x40')](function(_0x450c39){_0x3ae15b(_0x450c39);});}});}Fax[_0xb108('0x29')][_0xb108('0x58')]=function(_0x192548,_0x43d1c1){var _0x5dc82b=this;return new BPromise(function(_0xdd626a,_0x2d3f7e){var _0x565473=uuid['v4']();var _0x38319f=ut[_0xb108('0x67')](_0x192548,_0x43d1c1);_0x5dc82b[_0xb108('0x10')][_0x565473]=new Action(_0x565473,_0x43d1c1,_0x192548);var _0xe2a764=_0x5dc82b[_0xb108('0x10')][_0x565473];if(path[_0xb108('0x3c')](_0x192548[_0xb108('0x5')])[_0xb108('0x68')]===_0xb108('0x3f')){originate(_0xe2a764,_0x38319f,!![])[_0xb108('0x3d')](function(_0x41092c){_0xdd626a(_0x41092c);})[_0xb108('0x40')](function(_0xfa004d){_0x2d3f7e(_0xfa004d);});}else{originate(_0xe2a764,_0x38319f,![])['then'](function(_0x199586){_0xdd626a(_0x199586);})['catch'](function(_0x27677c){_0x2d3f7e(_0x27677c);});}});};Fax['prototype'][_0xb108('0x69')]=function(_0xb39f9b){return!_[_0xb108('0x6a')](_0xb39f9b)&&!_['isNil'](_0xb39f9b['name'])&&!_['isNil'](_0xb39f9b[_0xb108('0x6b')])&&_0xb39f9b[_0xb108('0x6b')]&&!_['isNil'](this[_0xb108('0xf')][util[_0xb108('0x6c')]('SIP/%s',_0xb39f9b[_0xb108('0x26')])])&&!_[_0xb108('0x6a')](this['trunks'][util[_0xb108('0x6c')](_0xb108('0x6d'),_0xb39f9b[_0xb108('0x26')])][_0xb108('0x30')])&&(this[_0xb108('0xf')][util['format'](_0xb108('0x6d'),_0xb39f9b[_0xb108('0x26')])][_0xb108('0x30')]==='reachable'||this[_0xb108('0xf')][util[_0xb108('0x6c')](_0xb108('0x6d'),_0xb39f9b[_0xb108('0x26')])][_0xb108('0x30')]===_0xb108('0x6e'));};Fax[_0xb108('0x29')][_0xb108('0x6f')]=function(_0x5a44a4,_0x4647d7){if(!this[_0xb108('0x69')](_0x5a44a4)){ut[_0xb108('0x4a')](_0xb108('0x70'),_[_0xb108('0x6a')](_0x5a44a4)?'':_0x5a44a4[_0xb108('0x26')]+_0xb108('0x71'));return{'isValid':![],'message':_0xb108('0x72')};}if(_[_0xb108('0x6a')](_0x4647d7[_0xb108('0x6')])){ut['logger'](_0xb108('0x73'),JSON[_0xb108('0x43')](_0x4647d7));return{'isValid':![],'message':_0xb108('0x74')};}if(_[_0xb108('0x6a')](_0x4647d7[_0xb108('0x5')])){ut[_0xb108('0x4a')](_0xb108('0x75'),JSON[_0xb108('0x43')](_0x4647d7));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xb108('0x76')};};module[_0xb108('0x77')]=Fax;
\ No newline at end of file
diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js
index a3b9a54..bbc95be 100644
--- a/server/services/ami/fax/rpcDb.js
+++ b/server/services/ami/fax/rpcDb.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6b9f=['../rpc/faxAccount','error','inspect','notify','resolve','catch','../../../config/logger','preview','lodash'];(function(_0x15fa42,_0x3aff88){var _0x47d7ab=function(_0x29c623){while(--_0x29c623){_0x15fa42['push'](_0x15fa42['shift']());}};_0x47d7ab(++_0x3aff88);}(_0x6b9f,0x9f));var _0xf6b9=function(_0x20d0c5,_0x3a1d1d){_0x20d0c5=_0x20d0c5-0x0;var _0xebfea0=_0x6b9f[_0x20d0c5];return _0xebfea0;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xf6b9('0x0'))(_0xf6b9('0x1'));var _=require(_0xf6b9('0x2'));var faxAccount=require(_0xf6b9('0x3'));function loggerCatch(_0x3ebfb4){return function(_0xf8a959){logger[_0xf6b9('0x4')](_0x3ebfb4,util[_0xf6b9('0x5')](_0xf8a959,{'showHidden':![],'depth':null}));};}exports[_0xf6b9('0x6')]=function(_0x38bbc5,_0x57c49a){return BPromise[_0xf6b9('0x7')]()['then'](faxAccount[_0xf6b9('0x6')](_0x38bbc5,_0x57c49a))[_0xf6b9('0x8')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
+var _0x69eb=['inspect','resolve','then','notify','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x2f11c9,_0x527089){var _0x49b9be=function(_0x45b66c){while(--_0x45b66c){_0x2f11c9['push'](_0x2f11c9['shift']());}};_0x49b9be(++_0x527089);}(_0x69eb,0x10e));var _0xb69e=function(_0x545bc8,_0x509fca){_0x545bc8=_0x545bc8-0x0;var _0x3e5d89=_0x69eb[_0x545bc8];return _0x3e5d89;};'use strict';var util=require('util');var BPromise=require(_0xb69e('0x0'));var logger=require(_0xb69e('0x1'))(_0xb69e('0x2'));var _=require(_0xb69e('0x3'));var faxAccount=require(_0xb69e('0x4'));function loggerCatch(_0x596325){return function(_0x358c58){logger['error'](_0x596325,util[_0xb69e('0x5')](_0x358c58,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x3f150a,_0x4edb5e){return BPromise[_0xb69e('0x6')]()[_0xb69e('0x7')](faxAccount[_0xb69e('0x8')](_0x3f150a,_0x4edb5e))[_0xb69e('0x9')](loggerCatch(_0xb69e('0xa')));};
\ No newline at end of file
diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js
index a5e6fb9..191468c 100644
--- a/server/services/ami/fax/util/gs.js
+++ b/server/services/ami/fax/util/gs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd316=['child_process','exec','Exec\x20gs','\x20Error\x20:','inspect','util','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd316,0x75));var _0x6d31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd316[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6d31('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x6d31('0x1'));var exec=require(_0x6d31('0x2'))[_0x6d31('0x3')];exports['execute']=function(_0x42c56f){return new BPromise(function(_0x47832b,_0x47c340){exec(_0x42c56f,function(_0x12375d,_0x3aaf68,_0xe0d3ea){logger['info'](_0x6d31('0x4'),_0x3aaf68);if(_0x12375d){logger['info'](_0x6d31('0x4'),_0x6d31('0x5'),util[_0x6d31('0x6')](_0x12375d,{'showHidden':![],'depth':null}),_0x3aaf68,_0xe0d3ea);_0x47c340(_0x12375d);}_0x47832b(_0x3aaf68);});});};
\ No newline at end of file
+var _0x0222=['bluebird','exec','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0xb1ca6e,_0x31f318){var _0x3a65f2=function(_0x42a665){while(--_0x42a665){_0xb1ca6e['push'](_0xb1ca6e['shift']());}};_0x3a65f2(++_0x31f318);}(_0x0222,0xba));var _0x2022=function(_0x3cc814,_0x305897){_0x3cc814=_0x3cc814-0x0;var _0x33e106=_0x0222[_0x3cc814];return _0x33e106;};'use strict';var util=require(_0x2022('0x0'));var logger=require(_0x2022('0x1'))(_0x2022('0x2'));var BPromise=require(_0x2022('0x3'));var exec=require('child_process')[_0x2022('0x4')];exports['execute']=function(_0x4254c4){return new BPromise(function(_0xed1f2d,_0xf9269){exec(_0x4254c4,function(_0xdd2198,_0x5a061f,_0x3d8ba7){logger[_0x2022('0x5')](_0x2022('0x6'),_0x5a061f);if(_0xdd2198){logger['info'](_0x2022('0x6'),_0x2022('0x7'),util[_0x2022('0x8')](_0xdd2198,{'showHidden':![],'depth':null}),_0x5a061f,_0x3d8ba7);_0xf9269(_0xdd2198);}_0xed1f2d(_0x5a061f);});});};
\ No newline at end of file
diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js
index 99e4f6f..77a06b3 100644
--- a/server/services/ami/fax/util/util.js
+++ b/server/services/ami/fax/util/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc368=['from-sip','\x22%s\x22\x20<%s>','localstationid','lodash','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc368,0x7b));var _0x8c36=function(_0xb9e95b,_0x522ddc){_0xb9e95b=_0xb9e95b-0x0;var _0x3b3396=_0xc368[_0xb9e95b];return _0x3b3396;};'use strict';var util=require('util');var _=require(_0x8c36('0x0'));var moment=require('moment');var logger=require(_0x8c36('0x1'))(_0x8c36('0x2'));exports[_0x8c36('0x3')]=function(_0x2640c5){return{'message':_0x2640c5};};exports[_0x8c36('0x4')]=function(_0x5d3b27,_0x3e9034){logger[_0x8c36('0x5')](_0x5d3b27,util[_0x8c36('0x6')](_0x3e9034,{'showHidden':![],'depth':null}));};exports[_0x8c36('0x7')]=function(_0x5ebfc1,_0x554022){var _0x8ed437={'XMF-ECM':_0x554022[_0x8c36('0x8')],'XMF-HEADERINFO':_0x554022[_0x8c36('0x9')],'XMF-MINRATE':_0x554022[_0x8c36('0xa')],'XMF-MAXRATE':_0x554022[_0x8c36('0xb')],'XMF-MODEM':util[_0x8c36('0xc')]('\x22%s\x22',_0x554022['modem']),'XMF-GATEWAY':_0x554022['gateway'],'XMF-FAXDETECT':_0x554022[_0x8c36('0xd')],'XMF-T38TIMEOUT':_0x554022[_0x8c36('0xe')],'XMF-LOCALSTATIONID':_0x554022['localstationid'],'XMF-PATH':_0x5ebfc1[_0x8c36('0xf')]};return _0x8ed437;};exports[_0x8c36('0x10')]=function(_0x1d5c61,_0xe7857e){return{'actionid':_0x1d5c61[_0x8c36('0x11')],'action':_0x8c36('0x12'),'channel':_0x1d5c61[_0x8c36('0x13')],'Exten':_0x8c36('0x14'),'Context':_0x8c36('0x15'),'Priority':'1','callerid':util[_0x8c36('0xc')](_0x8c36('0x16'),_0x1d5c61[_0x8c36('0x9')]?_0x1d5c61[_0x8c36('0x9')]:'',_0x1d5c61[_0x8c36('0x17')]),'variable':_0xe7857e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1d5c61['uniqueid']};};
\ No newline at end of file
+var _0x1339=['modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','moment','../../../../config/logger','fax','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22'];(function(_0x39337f,_0x3bd5c0){var _0x19ae2d=function(_0x51e518){while(--_0x51e518){_0x39337f['push'](_0x39337f['shift']());}};_0x19ae2d(++_0x3bd5c0);}(_0x1339,0x1ed));var _0x9133=function(_0x54dedf,_0x534715){_0x54dedf=_0x54dedf-0x0;var _0x507823=_0x1339[_0x54dedf];return _0x507823;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x9133('0x0'));var logger=require(_0x9133('0x1'))(_0x9133('0x2'));exports[_0x9133('0x3')]=function(_0x447096){return{'message':_0x447096};};exports[_0x9133('0x4')]=function(_0x176e80,_0x110c51){logger['info'](_0x176e80,util[_0x9133('0x5')](_0x110c51,{'showHidden':![],'depth':null}));};exports[_0x9133('0x6')]=function(_0x379915,_0x539af6){var _0x2758e2={'XMF-ECM':_0x539af6[_0x9133('0x7')],'XMF-HEADERINFO':_0x539af6[_0x9133('0x8')],'XMF-MINRATE':_0x539af6[_0x9133('0x9')],'XMF-MAXRATE':_0x539af6[_0x9133('0xa')],'XMF-MODEM':util[_0x9133('0xb')](_0x9133('0xc'),_0x539af6[_0x9133('0xd')]),'XMF-GATEWAY':_0x539af6[_0x9133('0xe')],'XMF-FAXDETECT':_0x539af6[_0x9133('0xf')],'XMF-T38TIMEOUT':_0x539af6['t38timeout'],'XMF-LOCALSTATIONID':_0x539af6[_0x9133('0x10')],'XMF-PATH':_0x379915[_0x9133('0x11')]};return _0x2758e2;};exports[_0x9133('0x12')]=function(_0x452481,_0x3b8f89){return{'actionid':_0x452481[_0x9133('0x13')],'action':'originate','channel':_0x452481[_0x9133('0x14')],'Exten':_0x9133('0x15'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x9133('0x16'),_0x452481['headerinfo']?_0x452481[_0x9133('0x8')]:'',_0x452481[_0x9133('0x10')]),'variable':_0x3b8f89,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x452481[_0x9133('0x13')]};};
\ No newline at end of file
diff --git a/server/services/ami/index.js b/server/services/ami/index.js
index 97f0b13..c0932e2 100644
--- a/server/services/ami/index.js
+++ b/server/services/ami/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2cb0=['initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x2cb0,0xdd));var _0x02cb=function(_0x1aec19,_0x330feb){_0x1aec19=_0x1aec19-0x0;var _0x4f2068=_0x2cb0[_0x1aec19];return _0x4f2068;};'use strict';var BPromise=require(_0x02cb('0x0'));var util=require('util');var moment=require(_0x02cb('0x1'));var server=require('./server');var Realtime=require(_0x02cb('0x2'));var Report=require(_0x02cb('0x3'));var Acw=require(_0x02cb('0x4'));var Trigger=require(_0x02cb('0x5'));var Dialer=require(_0x02cb('0x6'));var Preview=require(_0x02cb('0x7'));var Fax=require(_0x02cb('0x8'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x02cb('0x9'));var trigger=require(_0x02cb('0xa'));var template=require('./rpc/template');var cmHopperHistory=require(_0x02cb('0xb'));var campaign=require(_0x02cb('0xc'));var voiceExtension=require(_0x02cb('0xd'));var faxAccount=require(_0x02cb('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x02cb('0xf'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x02cb('0x10'));var desk=require(_0x02cb('0x11'));var zoho=require(_0x02cb('0x12'));var vtiger=require(_0x02cb('0x13'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x02cb('0x14'));var dynamics365=require(_0x02cb('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x02cb('0x16')](_0x02cb('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x02cb('0x16')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x02cb('0x18')]()['then'](user[_0x02cb('0x19')]())[_0x02cb('0x1a')](realtime['initAgents']())[_0x02cb('0x1a')](user[_0x02cb('0x1b')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x1c')]())['then'](trunk[_0x02cb('0x1d')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x1e')]())[_0x02cb('0x1a')](voiceQueue['getVoiceQueues']())[_0x02cb('0x1a')](realtime['initVoiceQueues']())[_0x02cb('0x1a')](trigger[_0x02cb('0x1f')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x20')]())[_0x02cb('0x1a')](template[_0x02cb('0x21')]())['then'](realtime[_0x02cb('0x22')]())['then'](zendesk[_0x02cb('0x23')]())[_0x02cb('0x1a')](realtime['initZendeskAccounts']())[_0x02cb('0x1a')](salesforce[_0x02cb('0x24')]())['then'](realtime[_0x02cb('0x25')]())[_0x02cb('0x1a')](sugarcrm['getSugarcrmAccounts']())[_0x02cb('0x1a')](realtime['initSugarcrmAccounts']())[_0x02cb('0x1a')](freshdesk[_0x02cb('0x26')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x27')]())[_0x02cb('0x1a')](desk[_0x02cb('0x28')]())['then'](realtime['initDeskAccounts']())[_0x02cb('0x1a')](zoho[_0x02cb('0x29')]())['then'](realtime[_0x02cb('0x2a')]())['then'](vtiger[_0x02cb('0x2b')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x2c')]())['then'](freshsales[_0x02cb('0x2d')]())['then'](realtime[_0x02cb('0x2e')]())[_0x02cb('0x1a')](servicenow['getServicenowAccounts']())[_0x02cb('0x1a')](realtime[_0x02cb('0x2f')]())[_0x02cb('0x1a')](dynamics365[_0x02cb('0x30')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x31')]())['then'](campaign[_0x02cb('0x32')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x33')]())[_0x02cb('0x1a')](voiceExtension[_0x02cb('0x34')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x35')]())[_0x02cb('0x1a')](faxAccount[_0x02cb('0x36')]())['then'](realtime[_0x02cb('0x37')]())[_0x02cb('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x02cb('0x38')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x39')]())[_0x02cb('0x1a')](cmHopperHistory[_0x02cb('0x3a')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x3b')]())[_0x02cb('0x1a')](cmHopperHistory[_0x02cb('0x3c')]())['then'](realtime[_0x02cb('0x3d')]())[_0x02cb('0x1a')](voiceCallReport[_0x02cb('0x3e')]())[_0x02cb('0x1a')](realtime[_0x02cb('0x3f')]())[_0x02cb('0x1a')](function(_0x16d303){})[_0x02cb('0x40')](function(_0x5dc038){console[_0x02cb('0x41')](_0x5dc038);});}function main(){return server[_0x02cb('0x42')](realtime,preview,fax)[_0x02cb('0x1a')](function(_0x32e3bf){return initRealtime();})['then'](function(){return initParams();})[_0x02cb('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x02cb('0x40')](function(_0x3d88ce){console[_0x02cb('0x41')](_0x3d88ce);});}main();
\ No newline at end of file
+var _0x8833=['initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','getTelephones','initTelephones','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts'];(function(_0x56889b,_0x44c93d){var _0x31c3a4=function(_0x5ee38d){while(--_0x5ee38d){_0x56889b['push'](_0x56889b['shift']());}};_0x31c3a4(++_0x44c93d);}(_0x8833,0x8a));var _0x3883=function(_0x470c9c,_0x1fc77b){_0x470c9c=_0x470c9c-0x0;var _0x9b646b=_0x8833[_0x470c9c];return _0x9b646b;};'use strict';var BPromise=require(_0x3883('0x0'));var util=require(_0x3883('0x1'));var moment=require(_0x3883('0x2'));var server=require(_0x3883('0x3'));var Realtime=require(_0x3883('0x4'));var Report=require(_0x3883('0x5'));var Acw=require(_0x3883('0x6'));var Trigger=require(_0x3883('0x7'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x3883('0x8'));var user=require(_0x3883('0x9'));var voiceQueue=require(_0x3883('0xa'));var voiceQueueReport=require(_0x3883('0xb'));var voiceCallReport=require(_0x3883('0xc'));var trunk=require(_0x3883('0xd'));var trigger=require('./rpc/trigger');var template=require(_0x3883('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x3883('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x3883('0x10'));var zendesk=require(_0x3883('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x3883('0x12'));var freshdesk=require(_0x3883('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x3883('0x14'));var vtiger=require(_0x3883('0x15'));var freshsales=require(_0x3883('0x16'));var servicenow=require(_0x3883('0x17'));var dynamics365=require(_0x3883('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3883('0x19')](_0x3883('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3883('0x19')](_0x3883('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x3883('0x1b')]()[_0x3883('0x1c')](user[_0x3883('0x1d')]())[_0x3883('0x1c')](realtime['initAgents']())[_0x3883('0x1c')](user[_0x3883('0x1e')]())[_0x3883('0x1c')](realtime[_0x3883('0x1f')]())[_0x3883('0x1c')](trunk['getTrunks']())['then'](realtime['initTrunks']())['then'](voiceQueue['getVoiceQueues']())['then'](realtime[_0x3883('0x20')]())[_0x3883('0x1c')](trigger[_0x3883('0x21')]())[_0x3883('0x1c')](realtime[_0x3883('0x22')]())[_0x3883('0x1c')](template[_0x3883('0x23')]())['then'](realtime[_0x3883('0x24')]())[_0x3883('0x1c')](zendesk[_0x3883('0x25')]())[_0x3883('0x1c')](realtime[_0x3883('0x26')]())[_0x3883('0x1c')](salesforce[_0x3883('0x27')]())[_0x3883('0x1c')](realtime['initSalesforceAccounts']())['then'](sugarcrm['getSugarcrmAccounts']())[_0x3883('0x1c')](realtime[_0x3883('0x28')]())[_0x3883('0x1c')](freshdesk[_0x3883('0x29')]())['then'](realtime['initFreshdeskAccounts']())[_0x3883('0x1c')](desk['getDeskAccounts']())[_0x3883('0x1c')](realtime[_0x3883('0x2a')]())[_0x3883('0x1c')](zoho[_0x3883('0x2b')]())['then'](realtime[_0x3883('0x2c')]())[_0x3883('0x1c')](vtiger['getVtigerAccounts']())[_0x3883('0x1c')](realtime[_0x3883('0x2d')]())[_0x3883('0x1c')](freshsales['getFreshsalesAccounts']())[_0x3883('0x1c')](realtime[_0x3883('0x2e')]())[_0x3883('0x1c')](servicenow['getServicenowAccounts']())[_0x3883('0x1c')](realtime['initServicenowAccounts']())[_0x3883('0x1c')](dynamics365[_0x3883('0x2f')]())[_0x3883('0x1c')](realtime[_0x3883('0x30')]())[_0x3883('0x1c')](campaign[_0x3883('0x31')]())[_0x3883('0x1c')](realtime[_0x3883('0x32')]())[_0x3883('0x1c')](voiceExtension[_0x3883('0x33')]())[_0x3883('0x1c')](realtime[_0x3883('0x34')]())[_0x3883('0x1c')](faxAccount[_0x3883('0x35')]())[_0x3883('0x1c')](realtime[_0x3883('0x36')]())[_0x3883('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x3883('0x1b')]()[_0x3883('0x1c')](voiceQueueReport[_0x3883('0x37')]())['then'](realtime[_0x3883('0x38')]())[_0x3883('0x1c')](cmHopperHistory[_0x3883('0x39')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0x3883('0x1c')](cmHopperHistory['getCampaignHopperHistory']())[_0x3883('0x1c')](realtime['initCampaignHopperHistory']())[_0x3883('0x1c')](voiceCallReport[_0x3883('0x3a')]())['then'](realtime[_0x3883('0x3b')]())[_0x3883('0x1c')](function(_0xb9d6b9){})[_0x3883('0x3c')](function(_0x2ca678){console[_0x3883('0x3d')](_0x2ca678);});}function main(){return server[_0x3883('0x3e')](realtime,preview,fax)[_0x3883('0x1c')](function(_0x541c55){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x3883('0x3f')]();setInterval(initRealtime,0x1388);})[_0x3883('0x3c')](function(_0x5e0d4d){console[_0x3883('0x3d')](_0x5e0d4d);});}main();
\ No newline at end of file
diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js
index f6dcf4f..e34a638 100644
--- a/server/services/ami/model/agent.js
+++ b/server/services/ami/model/agent.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7f0=['local','prototype','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','voiceStatusCallerIdNumber','interface','stringify','user:%s','emit','user:save','exports','lodash','util','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold'];(function(_0x4877bc,_0x24b542){var _0x296c34=function(_0x45e2b0){while(--_0x45e2b0){_0x4877bc['push'](_0x4877bc['shift']());}};_0x296c34(++_0x24b542);}(_0xf7f0,0x16f));var _0x0f7f=function(_0x46cd02,_0x1acf7b){_0x46cd02=_0x46cd02-0x0;var _0x332301=_0xf7f0[_0x46cd02];return _0x332301;};'use strict';var _=require(_0x0f7f('0x0'));var util=require(_0x0f7f('0x1'));var moment=require('moment');var md5=require(_0x0f7f('0x2'));var Redis=require(_0x0f7f('0x3'));var config=require(_0x0f7f('0x4'));config['redis']=_['defaults'](config[_0x0f7f('0x5')],{'host':_0x0f7f('0x6'),'port':0x18eb});var io=require(_0x0f7f('0x7'))(new Redis(config['redis']));function Agent(_0xd0e0ba){this['id']=_0xd0e0ba['id']||0x0;this['name']=_0xd0e0ba[_0x0f7f('0x8')]||'';this[_0x0f7f('0x9')]=_0xd0e0ba[_0x0f7f('0x9')]||'';this[_0x0f7f('0xa')]=_0xd0e0ba[_0x0f7f('0xa')]||'';this[_0x0f7f('0xb')]=_0xd0e0ba[_0x0f7f('0xb')]||'';this[_0x0f7f('0xc')]=_0x0f7f('0xd');this[_0x0f7f('0xe')]=0x0;this[_0x0f7f('0xf')]='unknown';this[_0x0f7f('0x10')]='';this['phone']='';this[_0x0f7f('0x11')]='';this['interface']='';this[_0x0f7f('0x12')]=_0xd0e0ba['online']||![];this[_0x0f7f('0x13')]='unknown';this[_0x0f7f('0x14')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x0f7f('0x15')]='';this[_0x0f7f('0x16')]=![];this[_0x0f7f('0x17')]=![];this[_0x0f7f('0x2')]='';}Agent[_0x0f7f('0x18')]['updateStatusRealtime']=function(_0x55be1a){var _0x18d81b;if(_0x55be1a&&_0x55be1a[_0x0f7f('0xc')]){_0x18d81b=_0x55be1a[_0x0f7f('0xc')][_0x0f7f('0x19')]();switch(_0x18d81b){case _0x0f7f('0x1a'):_0x18d81b=_0x0f7f('0x1b');break;case'inuse':_0x18d81b=_0x0f7f('0x1c');break;}}if(_0x18d81b&&this[_0x0f7f('0x13')]!==_0x18d81b||_0x55be1a[_0x0f7f('0x1d')]){this[_0x0f7f('0x14')]=_[_0x0f7f('0x1e')](moment()[_0x0f7f('0x1f')]('x'));}if(_0x18d81b){this[_0x0f7f('0x13')]=_0x18d81b;}var _0x72e07={'id':this['id'],'name':this[_0x0f7f('0x8')],'email':this[_0x0f7f('0x9')],'accountcode':this[_0x0f7f('0xa')],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0x0f7f('0xe')],'status':this[_0x0f7f('0xf')],'address':this['address'],'online':this[_0x0f7f('0x12')],'voiceStatus':this[_0x0f7f('0x13')],'voiceStatusTime':this[_0x0f7f('0x14')],'voiceStatusCallerIdNumber':this[_0x0f7f('0x20')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x0f7f('0x21')],'onhold':this[_0x0f7f('0x16')]};var _0x42af3b=md5(JSON[_0x0f7f('0x22')](_0x72e07));if(this[_0x0f7f('0x2')]!==_0x42af3b){this[_0x0f7f('0x2')]=_0x42af3b;io['to'](util['format'](_0x0f7f('0x23'),_0x72e07[_0x0f7f('0x8')]))[_0x0f7f('0x24')](_0x0f7f('0x25'),_0x72e07);}};module[_0x0f7f('0x26')]=Agent;
\ No newline at end of file
+var _0xbc70=['lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','unknown','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','toLowerCase','not_inuse','idle','inuse','talking','statePause','voiceStatusTime','toNumber','format','stringify','emit','exports'];(function(_0x176e8b,_0x555a80){var _0x35fd87=function(_0xc213cf){while(--_0xc213cf){_0x176e8b['push'](_0x176e8b['shift']());}};_0x35fd87(++_0x555a80);}(_0xbc70,0x120));var _0x0bc7=function(_0xa6073c,_0x48b4c7){_0xa6073c=_0xa6073c-0x0;var _0x1e44e9=_0xbc70[_0xa6073c];return _0x1e44e9;};'use strict';var _=require(_0x0bc7('0x0'));var util=require(_0x0bc7('0x1'));var moment=require(_0x0bc7('0x2'));var md5=require(_0x0bc7('0x3'));var Redis=require(_0x0bc7('0x4'));var config=require(_0x0bc7('0x5'));config[_0x0bc7('0x6')]=_[_0x0bc7('0x7')](config[_0x0bc7('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0bc7('0x8'))(new Redis(config[_0x0bc7('0x6')]));function Agent(_0x3b95a1){this['id']=_0x3b95a1['id']||0x0;this[_0x0bc7('0x9')]=_0x3b95a1[_0x0bc7('0x9')]||'';this[_0x0bc7('0xa')]=_0x3b95a1[_0x0bc7('0xa')]||'';this[_0x0bc7('0xb')]=_0x3b95a1[_0x0bc7('0xb')]||'';this['fullname']=_0x3b95a1[_0x0bc7('0xc')]||'';this[_0x0bc7('0xd')]=_0x0bc7('0xe');this['stateTime']=0x0;this[_0x0bc7('0xf')]=_0x0bc7('0xe');this[_0x0bc7('0x10')]='';this[_0x0bc7('0x11')]='';this[_0x0bc7('0x12')]='';this[_0x0bc7('0x13')]='';this[_0x0bc7('0x14')]=_0x3b95a1[_0x0bc7('0x14')]||![];this[_0x0bc7('0x15')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x0bc7('0x16')]='';this[_0x0bc7('0x17')]=![];this['local']=![];this[_0x0bc7('0x3')]='';}Agent['prototype']['updateStatusRealtime']=function(_0x55d71e){var _0x5d584e;if(_0x55d71e&&_0x55d71e[_0x0bc7('0xd')]){_0x5d584e=_0x55d71e[_0x0bc7('0xd')][_0x0bc7('0x18')]();switch(_0x5d584e){case _0x0bc7('0x19'):_0x5d584e=_0x0bc7('0x1a');break;case _0x0bc7('0x1b'):_0x5d584e=_0x0bc7('0x1c');break;}}if(_0x5d584e&&this[_0x0bc7('0x15')]!==_0x5d584e||_0x55d71e[_0x0bc7('0x1d')]){this[_0x0bc7('0x1e')]=_[_0x0bc7('0x1f')](moment()[_0x0bc7('0x20')]('x'));}if(_0x5d584e){this[_0x0bc7('0x15')]=_0x5d584e;}var _0x4abe2a={'id':this['id'],'name':this[_0x0bc7('0x9')],'email':this[_0x0bc7('0xa')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this['state'],'stateTime':this['stateTime'],'status':this[_0x0bc7('0xf')],'address':this[_0x0bc7('0x10')],'online':this[_0x0bc7('0x14')],'voiceStatus':this[_0x0bc7('0x15')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x0bc7('0x13')],'onhold':this[_0x0bc7('0x17')]};var _0x4e581d=md5(JSON[_0x0bc7('0x21')](_0x4abe2a));if(this[_0x0bc7('0x3')]!==_0x4e581d){this[_0x0bc7('0x3')]=_0x4e581d;io['to'](util[_0x0bc7('0x20')]('user:%s',_0x4abe2a[_0x0bc7('0x9')]))[_0x0bc7('0x22')]('user:save',_0x4abe2a);}};module[_0x0bc7('0x23')]=Agent;
\ No newline at end of file
diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js
index 26e8fe5..7cf8de7 100644
--- a/server/services/ami/model/campaign.js
+++ b/server/services/ami/model/campaign.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b38=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x9b38,0x72));var _0x89b3=function(_0x45a12e,_0x198eb9){_0x45a12e=_0x45a12e-0x0;var _0x22cacc=_0x9b38[_0x45a12e];return _0x22cacc;};'use strict';function Campaign(_0x5276a7){this['id']=_0x5276a7['id']||0x0;this[_0x89b3('0x0')]=_0x5276a7[_0x89b3('0x0')]||'';this[_0x89b3('0x1')]=_0x5276a7[_0x89b3('0x1')]||_0x89b3('0x2');this[_0x89b3('0x3')]=0x0;this[_0x89b3('0x4')]=0x0;this[_0x89b3('0x5')]=0x0;this[_0x89b3('0x6')]=0x0;this[_0x89b3('0x7')]='';this[_0x89b3('0x8')]=!![];this[_0x89b3('0x9')]=_0x5276a7['active'];this[_0x89b3('0xa')]=_0x5276a7[_0x89b3('0xa')];this[_0x89b3('0xb')]=_0x5276a7[_0x89b3('0xb')]||null;this[_0x89b3('0xc')]=_0x5276a7[_0x89b3('0xc')]?_0x5276a7['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x5276a7['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x5276a7[_0x89b3('0xd')];this[_0x89b3('0xe')]=_0x5276a7[_0x89b3('0xe')]||0x1e;this[_0x89b3('0xf')]=_0x5276a7[_0x89b3('0xf')];this[_0x89b3('0x10')]=_0x5276a7[_0x89b3('0x10')];this['dialBusyMaxRetry']=_0x5276a7[_0x89b3('0x11')];this[_0x89b3('0x12')]=_0x5276a7[_0x89b3('0x12')];this['dialNoAnswerMaxRetry']=_0x5276a7['dialNoAnswerMaxRetry'];this[_0x89b3('0x13')]=_0x5276a7[_0x89b3('0x13')];this['dialGlobalMaxRetry']=_0x5276a7['dialGlobalMaxRetry'];this[_0x89b3('0x14')]=_0x5276a7[_0x89b3('0x14')]||0x3;this[_0x89b3('0x15')]=_0x5276a7[_0x89b3('0x15')]||0x96;this[_0x89b3('0x16')]=_0x5276a7[_0x89b3('0x16')]||0x3;this['dialDropRetryFrequency']=_0x5276a7[_0x89b3('0x17')]||0x96;this[_0x89b3('0x18')]=_0x5276a7[_0x89b3('0x18')]||0x3;this[_0x89b3('0x19')]=_0x5276a7[_0x89b3('0x19')]||0x96;this['dialMachineMaxRetry']=_0x5276a7['dialMachineMaxRetry']||0x3;this[_0x89b3('0x1a')]=_0x5276a7['dialMachineRetryFrequency']||0x96;this[_0x89b3('0x1b')]=_0x5276a7[_0x89b3('0x1b')]||0x3;this[_0x89b3('0x1c')]=_0x5276a7[_0x89b3('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x5276a7[_0x89b3('0x1d')]||_0x89b3('0x1e');this['dialPrefix']=_0x5276a7[_0x89b3('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x5276a7['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x89b3('0x20')]=_0x5276a7[_0x89b3('0x20')]||undefined;this[_0x89b3('0x21')]=_0x5276a7[_0x89b3('0x21')]?_0x5276a7[_0x89b3('0x21')]:undefined;this[_0x89b3('0x22')]=_0x5276a7[_0x89b3('0x22')]?_0x5276a7[_0x89b3('0x22')]:undefined;this[_0x89b3('0x23')]=_0x5276a7[_0x89b3('0x23')]?_0x5276a7[_0x89b3('0x23')]:undefined;this[_0x89b3('0x24')]=_0x5276a7[_0x89b3('0x24')]?_0x5276a7[_0x89b3('0x24')]:undefined;this['dialQueueProject']=_0x5276a7[_0x89b3('0x24')]?_0x5276a7[_0x89b3('0x24')][_0x89b3('0x0')]:undefined;this['dialAMDActive']=_0x5276a7['dialAMDActive']||![];this[_0x89b3('0x25')]=_0x5276a7[_0x89b3('0x25')];this[_0x89b3('0x26')]=_0x5276a7[_0x89b3('0x26')];this[_0x89b3('0x27')]=_0x5276a7['dialAMDAfterGreetingSilence'];this[_0x89b3('0x28')]=_0x5276a7['dialAMDTotalAnalysisTime'];this[_0x89b3('0x29')]=_0x5276a7['dialAMDMinWordLength'];this[_0x89b3('0x2a')]=_0x5276a7[_0x89b3('0x2a')];this[_0x89b3('0x2b')]=_0x5276a7[_0x89b3('0x2b')];this[_0x89b3('0x2c')]=_0x5276a7[_0x89b3('0x2c')];this[_0x89b3('0x2d')]=_0x5276a7[_0x89b3('0x2d')];}module['exports']=Campaign;
\ No newline at end of file
+var _0x195e=['active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x195e,0xfb));var _0xe195=function(_0x4ac559,_0x742a3a){_0x4ac559=_0x4ac559-0x0;var _0x5b47fa=_0x195e[_0x4ac559];return _0x5b47fa;};'use strict';function Campaign(_0x6e99f6){this['id']=_0x6e99f6['id']||0x0;this[_0xe195('0x0')]=_0x6e99f6[_0xe195('0x0')]||'';this[_0xe195('0x1')]=_0x6e99f6[_0xe195('0x1')]||_0xe195('0x2');this[_0xe195('0x3')]=0x0;this[_0xe195('0x4')]=0x0;this[_0xe195('0x5')]=0x0;this[_0xe195('0x6')]=0x0;this[_0xe195('0x7')]='';this[_0xe195('0x8')]=!![];this[_0xe195('0x9')]=_0x6e99f6['active'];this[_0xe195('0xa')]=_0x6e99f6[_0xe195('0xa')];this[_0xe195('0xb')]=_0x6e99f6[_0xe195('0xb')]||null;this[_0xe195('0xc')]=_0x6e99f6['dialGlobalInterval']?_0x6e99f6['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x6e99f6[_0xe195('0xd')];this[_0xe195('0xe')]=_0x6e99f6[_0xe195('0xe')];this[_0xe195('0xf')]=_0x6e99f6['dialOriginateTimeout']||0x1e;this[_0xe195('0x10')]=_0x6e99f6[_0xe195('0x10')];this[_0xe195('0x11')]=_0x6e99f6['dialCongestionRetryFrequency'];this[_0xe195('0x12')]=_0x6e99f6[_0xe195('0x12')];this['dialBusyRetryFrequency']=_0x6e99f6[_0xe195('0x13')];this[_0xe195('0x14')]=_0x6e99f6[_0xe195('0x14')];this[_0xe195('0x15')]=_0x6e99f6['dialNoAnswerRetryFrequency'];this[_0xe195('0x16')]=_0x6e99f6[_0xe195('0x16')];this['dialNoSuchNumberMaxRetry']=_0x6e99f6['dialNoSuchNumberMaxRetry']||0x3;this[_0xe195('0x17')]=_0x6e99f6['dialNoSuchNumberRetryFrequency']||0x96;this[_0xe195('0x18')]=_0x6e99f6['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x6e99f6[_0xe195('0x19')]||0x96;this[_0xe195('0x1a')]=_0x6e99f6[_0xe195('0x1a')]||0x3;this[_0xe195('0x1b')]=_0x6e99f6[_0xe195('0x1b')]||0x96;this[_0xe195('0x1c')]=_0x6e99f6[_0xe195('0x1c')]||0x3;this[_0xe195('0x1d')]=_0x6e99f6[_0xe195('0x1d')]||0x96;this[_0xe195('0x1e')]=_0x6e99f6['dialAgentRejectMaxRetry']||0x3;this[_0xe195('0x1f')]=_0x6e99f6[_0xe195('0x1f')]||0x96;this[_0xe195('0x20')]=_0x6e99f6[_0xe195('0x20')]||_0xe195('0x21');this[_0xe195('0x22')]=_0x6e99f6['dialPrefix']||undefined;this[_0xe195('0x23')]=_0x6e99f6[_0xe195('0x23')]||undefined;this[_0xe195('0x24')]=_0x6e99f6[_0xe195('0x24')]||undefined;this['TrunkBackup']=_0x6e99f6['TrunkBackup']?_0x6e99f6['TrunkBackup']:undefined;this[_0xe195('0x25')]=_0x6e99f6[_0xe195('0x25')]?_0x6e99f6[_0xe195('0x25')]:undefined;this[_0xe195('0x26')]=_0x6e99f6[_0xe195('0x26')]?_0x6e99f6[_0xe195('0x26')]:undefined;this[_0xe195('0x27')]=_0x6e99f6[_0xe195('0x27')]?_0x6e99f6[_0xe195('0x27')]:undefined;this[_0xe195('0x28')]=_0x6e99f6[_0xe195('0x27')]?_0x6e99f6[_0xe195('0x27')][_0xe195('0x0')]:undefined;this['dialAMDActive']=_0x6e99f6[_0xe195('0x29')]||![];this[_0xe195('0x2a')]=_0x6e99f6[_0xe195('0x2a')];this[_0xe195('0x2b')]=_0x6e99f6[_0xe195('0x2b')];this[_0xe195('0x2c')]=_0x6e99f6[_0xe195('0x2c')];this[_0xe195('0x2d')]=_0x6e99f6[_0xe195('0x2d')];this[_0xe195('0x2e')]=_0x6e99f6['dialAMDMinWordLength'];this[_0xe195('0x2f')]=_0x6e99f6[_0xe195('0x2f')];this[_0xe195('0x30')]=_0x6e99f6[_0xe195('0x30')];this[_0xe195('0x31')]=_0x6e99f6['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x6e99f6[_0xe195('0x32')];}module[_0xe195('0x33')]=Campaign;
\ No newline at end of file
diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js
index c535272..de4a4b6 100644
--- a/server/services/ami/model/channel.js
+++ b/server/services/ami/model/channel.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x676c=['starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','endtime','unmanaged','lastapplication','billableseconds','holdtime','disposition','monitor','monitorFilename','transfercalleridnum','transferconnectedlinenum','mohtime','exports'];(function(_0x278455,_0x1bdb5e){var _0x445ecc=function(_0x2b8676){while(--_0x2b8676){_0x278455['push'](_0x278455['shift']());}};_0x445ecc(++_0x1bdb5e);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';function Channel(){this[_0xc676('0x0')]=null;this[_0xc676('0x1')]='';this[_0xc676('0x2')]='';this['calleridnum']=0x0;this[_0xc676('0x3')]='';this[_0xc676('0x4')]=undefined;this[_0xc676('0x5')]=undefined;this[_0xc676('0x6')]=0x0;this[_0xc676('0x7')]='';this[_0xc676('0x8')]=0x0;this['linkedid']=0x0;this[_0xc676('0x9')]=0x0;this[_0xc676('0xa')]=![];this[_0xc676('0xb')]=null;this[_0xc676('0xc')]=null;this[_0xc676('0xd')]=![];this['abandoned']=![];this[_0xc676('0xe')]='';this['lastdata']='';this['duration']=0x0;this[_0xc676('0xf')]=0x0;this[_0xc676('0x10')]=0x0;this['type']=null;this['tag']=null;this[_0xc676('0x11')]=null;this[_0xc676('0x12')]=![];this[_0xc676('0x13')]=null;this['queue']=null;this['monitors']=[];this[_0xc676('0x14')]=undefined;this[_0xc676('0x15')]=undefined;this[_0xc676('0x16')]=0x0;}module[_0xc676('0x17')]=Channel;
\ No newline at end of file
+var _0x66d8=['duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','answered','endtime','unmanaged','abandoned','lastapplication'];(function(_0xf077cb,_0x11cfa6){var _0x5549d9=function(_0x131d90){while(--_0x131d90){_0xf077cb['push'](_0xf077cb['shift']());}};_0x5549d9(++_0x11cfa6);}(_0x66d8,0x1c1));var _0x866d=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x66d8[_0x4eafed];return _0x159c85;};'use strict';function Channel(){this[_0x866d('0x0')]=null;this[_0x866d('0x1')]='';this[_0x866d('0x2')]='';this[_0x866d('0x3')]=0x0;this[_0x866d('0x4')]='';this[_0x866d('0x5')]=undefined;this[_0x866d('0x6')]=undefined;this['accountcode']=0x0;this[_0x866d('0x7')]='';this[_0x866d('0x8')]=0x0;this[_0x866d('0x9')]=0x0;this['exten']=0x0;this[_0x866d('0xa')]=![];this['answertime']=null;this[_0x866d('0xb')]=null;this[_0x866d('0xc')]=![];this[_0x866d('0xd')]=![];this[_0x866d('0xe')]='';this['lastdata']='';this[_0x866d('0xf')]=0x0;this[_0x866d('0x10')]=0x0;this[_0x866d('0x11')]=0x0;this[_0x866d('0x12')]=null;this[_0x866d('0x13')]=null;this[_0x866d('0x14')]=null;this[_0x866d('0x15')]=![];this[_0x866d('0x16')]=null;this[_0x866d('0x17')]=null;this[_0x866d('0x18')]=[];this[_0x866d('0x19')]=undefined;this[_0x866d('0x1a')]=undefined;this[_0x866d('0x1b')]=0x0;}module[_0x866d('0x1c')]=Channel;
\ No newline at end of file
diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js
index 7293595..3c1a3eb 100644
--- a/server/services/ami/model/deskAccount.js
+++ b/server/services/ami/model/deskAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf611=['type','serverUrl','Configurations','name','username','authType','password','consumerSecret','token','tokenSecret'];(function(_0x4f80c7,_0x3b5459){var _0x445f50=function(_0x5f390b){while(--_0x5f390b){_0x4f80c7['push'](_0x4f80c7['shift']());}};_0x445f50(++_0x3b5459);}(_0xf611,0x7b));var _0x1f61=function(_0x3815b2,_0xdeaa84){_0x3815b2=_0x3815b2-0x0;var _0x2ebd79=_0xf611[_0x3815b2];return _0x2ebd79;};'use strict';function DeskAccount(_0x400b57){this['id']=_0x400b57['id']||0x0;this[_0x1f61('0x0')]=_0x400b57[_0x1f61('0x0')]||'';this[_0x1f61('0x1')]=_0x400b57['username']||'';this['remoteUri']=_0x400b57['remoteUri']||'';this[_0x1f61('0x2')]=_0x400b57['authType']||'';this[_0x1f61('0x3')]=_0x400b57[_0x1f61('0x3')]||'';this['consumerKey']=_0x400b57['consumerKey']||'';this[_0x1f61('0x4')]=_0x400b57[_0x1f61('0x4')]||'';this[_0x1f61('0x5')]=_0x400b57[_0x1f61('0x5')]||'';this['tokenSecret']=_0x400b57[_0x1f61('0x6')]||'';this[_0x1f61('0x7')]=_0x400b57[_0x1f61('0x7')]||'';this['serverUrl']=_0x400b57[_0x1f61('0x8')]||'';this[_0x1f61('0x9')]=_0x400b57['Configurations']||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x5c1f=['consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','authType','consumerKey'];(function(_0x4369b2,_0x92d442){var _0x41013e=function(_0x169709){while(--_0x169709){_0x4369b2['push'](_0x4369b2['shift']());}};_0x41013e(++_0x92d442);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0x5c1f[_0x80d733];return _0x435868;};'use strict';function DeskAccount(_0x132bf7){this['id']=_0x132bf7['id']||0x0;this['name']=_0x132bf7[_0xf5c1('0x0')]||'';this[_0xf5c1('0x1')]=_0x132bf7['username']||'';this[_0xf5c1('0x2')]=_0x132bf7[_0xf5c1('0x2')]||'';this[_0xf5c1('0x3')]=_0x132bf7['authType']||'';this['password']=_0x132bf7['password']||'';this[_0xf5c1('0x4')]=_0x132bf7[_0xf5c1('0x4')]||'';this['consumerSecret']=_0x132bf7[_0xf5c1('0x5')]||'';this[_0xf5c1('0x6')]=_0x132bf7[_0xf5c1('0x6')]||'';this[_0xf5c1('0x7')]=_0x132bf7['tokenSecret']||'';this['type']=_0x132bf7['type']||'';this['serverUrl']=_0x132bf7[_0xf5c1('0x8')]||'';this[_0xf5c1('0x9')]=_0x132bf7[_0xf5c1('0x9')]||{};}module[_0xf5c1('0xa')]=DeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js
index bea6227..38d3cdb 100644
--- a/server/services/ami/model/dynamics365Account.js
+++ b/server/services/ami/model/dynamics365Account.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb18=['exports','name','username','password','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x41940a,_0x5ea0cd){var _0x20fc79=function(_0x556490){while(--_0x556490){_0x41940a['push'](_0x41940a['shift']());}};_0x20fc79(++_0x5ea0cd);}(_0xcb18,0x1a8));var _0x8cb1=function(_0x1b8f43,_0x399691){_0x1b8f43=_0x1b8f43-0x0;var _0x4231ba=_0xcb18[_0x1b8f43];return _0x4231ba;};'use strict';function Dynamics365Account(_0x591353){this['id']=_0x591353['id']||0x0;this[_0x8cb1('0x0')]=_0x591353[_0x8cb1('0x0')]||'';this[_0x8cb1('0x1')]=_0x591353[_0x8cb1('0x1')]||'';this[_0x8cb1('0x2')]=_0x591353[_0x8cb1('0x2')]||'';this['remoteUri']=_0x591353['remoteUri']||'';this[_0x8cb1('0x3')]=_0x591353[_0x8cb1('0x3')]||'';this['clientId']=_0x591353[_0x8cb1('0x4')]||'';this[_0x8cb1('0x5')]=_0x591353[_0x8cb1('0x5')]||{};this[_0x8cb1('0x6')]=_0x591353[_0x8cb1('0x6')]||'';this[_0x8cb1('0x7')]=_0x591353[_0x8cb1('0x7')]||{};}module[_0x8cb1('0x8')]=Dynamics365Account;
\ No newline at end of file
+var _0xcdd0=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x2dde0b,_0x83fcb3){var _0x1d453e=function(_0x615b50){while(--_0x615b50){_0x2dde0b['push'](_0x2dde0b['shift']());}};_0x1d453e(++_0x83fcb3);}(_0xcdd0,0x1af));var _0x0cdd=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xcdd0[_0x54d4fe];return _0x1ab5bb;};'use strict';function Dynamics365Account(_0x2e1567){this['id']=_0x2e1567['id']||0x0;this[_0x0cdd('0x0')]=_0x2e1567['name']||'';this[_0x0cdd('0x1')]=_0x2e1567[_0x0cdd('0x1')]||'';this[_0x0cdd('0x2')]=_0x2e1567[_0x0cdd('0x2')]||'';this[_0x0cdd('0x3')]=_0x2e1567[_0x0cdd('0x3')]||'';this[_0x0cdd('0x4')]=_0x2e1567[_0x0cdd('0x4')]||'';this[_0x0cdd('0x5')]=_0x2e1567[_0x0cdd('0x5')]||'';this[_0x0cdd('0x6')]=_0x2e1567[_0x0cdd('0x6')]||{};this[_0x0cdd('0x7')]=_0x2e1567[_0x0cdd('0x7')]||'';this[_0x0cdd('0x8')]=_0x2e1567[_0x0cdd('0x8')]||{};}module[_0x0cdd('0x9')]=Dynamics365Account;
\ No newline at end of file
diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js
index 15d26c9..6b2f25a 100644
--- a/server/services/ami/model/faxAccount.js
+++ b/server/services/ami/model/faxAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6931=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x6931,0x1a9));var _0x1693=function(_0x58ed88,_0x583f3b){_0x58ed88=_0x58ed88-0x0;var _0x3c9f7b=_0x6931[_0x58ed88];return _0x3c9f7b;};'use strict';function FaxAccount(_0x4f91fe){this['id']=_0x4f91fe['id']||0x0;this[_0x1693('0x0')]=_0x4f91fe[_0x1693('0x0')]||'';this[_0x1693('0x1')]=_0x4f91fe[_0x1693('0x1')];this[_0x1693('0x2')]=_0x4f91fe[_0x1693('0x2')];this[_0x1693('0x3')]=_0x4f91fe['headerinfo'];this[_0x1693('0x4')]=_0x4f91fe[_0x1693('0x4')];this[_0x1693('0x5')]=_0x4f91fe[_0x1693('0x5')]||0x960;this[_0x1693('0x6')]=_0x4f91fe['maxrate']||0x3840;this[_0x1693('0x7')]=_0x4f91fe[_0x1693('0x7')]||_0x1693('0x8');this['gateway']=_0x4f91fe[_0x1693('0x9')]||'no';this[_0x1693('0xa')]=_0x4f91fe[_0x1693('0xa')]||'no';this[_0x1693('0xb')]=_0x4f91fe[_0x1693('0xb')]||0x1388;this[_0x1693('0xc')]=_0x4f91fe[_0x1693('0xc')]||_0x1693('0xd');this[_0x1693('0xe')]=_0x4f91fe[_0x1693('0xe')]?_0x4f91fe[_0x1693('0xe')]:undefined;this['ListId']=_0x4f91fe[_0x1693('0xf')];this[_0x1693('0x10')]=_0x4f91fe[_0x1693('0x10')];}module[_0x1693('0x11')]=FaxAccount;
\ No newline at end of file
+var _0xd12b=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xd12b,0x17e));var _0xbd12=function(_0x458dd7,_0xe5602b){_0x458dd7=_0x458dd7-0x0;var _0x2a12f3=_0xd12b[_0x458dd7];return _0x2a12f3;};'use strict';function FaxAccount(_0x1580b){this['id']=_0x1580b['id']||0x0;this[_0xbd12('0x0')]=_0x1580b[_0xbd12('0x0')]||'';this[_0xbd12('0x1')]=_0x1580b[_0xbd12('0x1')];this[_0xbd12('0x2')]=_0x1580b[_0xbd12('0x2')];this['headerinfo']=_0x1580b[_0xbd12('0x3')];this[_0xbd12('0x4')]=_0x1580b[_0xbd12('0x4')];this[_0xbd12('0x5')]=_0x1580b[_0xbd12('0x5')]||0x960;this[_0xbd12('0x6')]=_0x1580b[_0xbd12('0x6')]||0x3840;this[_0xbd12('0x7')]=_0x1580b[_0xbd12('0x7')]||'v17,v27,v29';this[_0xbd12('0x8')]=_0x1580b['gateway']||'no';this[_0xbd12('0x9')]=_0x1580b[_0xbd12('0x9')]||'no';this[_0xbd12('0xa')]=_0x1580b[_0xbd12('0xa')]||0x1388;this[_0xbd12('0xb')]=_0x1580b[_0xbd12('0xb')]||_0xbd12('0xc');this['Trunk']=_0x1580b[_0xbd12('0xd')]?_0x1580b['Trunk']:undefined;this[_0xbd12('0xe')]=_0x1580b[_0xbd12('0xe')];this[_0xbd12('0xf')]=_0x1580b['key'];}module[_0xbd12('0x10')]=FaxAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js
index a61b4aa..f33b2ef 100644
--- a/server/services/ami/model/freshdeskAccount.js
+++ b/server/services/ami/model/freshdeskAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9bf6=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0x9bf6,0x1af));var _0x69bf=function(_0x3d84fa,_0x14283c){_0x3d84fa=_0x3d84fa-0x0;var _0x1e13a4=_0x9bf6[_0x3d84fa];return _0x1e13a4;};'use strict';function FreshdeskAccount(_0x5318cd){this['id']=_0x5318cd['id']||0x0;this[_0x69bf('0x0')]=_0x5318cd[_0x69bf('0x0')]||'';this['username']=_0x5318cd[_0x69bf('0x1')]||'';this[_0x69bf('0x2')]=_0x5318cd[_0x69bf('0x3')]||'';this[_0x69bf('0x4')]=_0x5318cd[_0x69bf('0x4')]||'';this['serverUrl']=_0x5318cd[_0x69bf('0x5')]||'';this[_0x69bf('0x6')]=_0x5318cd['Configurations']||{};}module[_0x69bf('0x7')]=FreshdeskAccount;
\ No newline at end of file
+var _0xf301=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x5d1851,_0x47fa29){var _0x5b00fc=function(_0x46cf73){while(--_0x46cf73){_0x5d1851['push'](_0x5d1851['shift']());}};_0x5b00fc(++_0x47fa29);}(_0xf301,0x176));var _0x1f30=function(_0xc589e4,_0x582337){_0xc589e4=_0xc589e4-0x0;var _0x40f0f1=_0xf301[_0xc589e4];return _0x40f0f1;};'use strict';function FreshdeskAccount(_0x34251d){this['id']=_0x34251d['id']||0x0;this[_0x1f30('0x0')]=_0x34251d[_0x1f30('0x0')]||'';this[_0x1f30('0x1')]=_0x34251d[_0x1f30('0x1')]||'';this[_0x1f30('0x2')]=_0x34251d[_0x1f30('0x3')]||'';this['remoteUri']=_0x34251d[_0x1f30('0x4')]||'';this[_0x1f30('0x5')]=_0x34251d[_0x1f30('0x5')]||'';this[_0x1f30('0x6')]=_0x34251d[_0x1f30('0x6')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js
index 4d03bc7..9cf8920 100644
--- a/server/services/ami/model/freshsalesAccount.js
+++ b/server/services/ami/model/freshsalesAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d84=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0x6d84,0x19d));var _0x46d8=function(_0x59cbf9,_0x583558){_0x59cbf9=_0x59cbf9-0x0;var _0x58414e=_0x6d84[_0x59cbf9];return _0x58414e;};'use strict';function FreshsalesAccount(_0x22132f){this['id']=_0x22132f['id']||0x0;this[_0x46d8('0x0')]=_0x22132f['name']||'';this[_0x46d8('0x1')]=_0x22132f[_0x46d8('0x1')]||'';this[_0x46d8('0x2')]=_0x22132f['token']||'';this[_0x46d8('0x3')]=_0x22132f[_0x46d8('0x3')]||'';this[_0x46d8('0x4')]=_0x22132f[_0x46d8('0x4')]||'';this[_0x46d8('0x5')]=_0x22132f['Configurations']||{};}module[_0x46d8('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0xfe46=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x5683c4,_0x452c08){var _0x339da9=function(_0x3188cb){while(--_0x3188cb){_0x5683c4['push'](_0x5683c4['shift']());}};_0x339da9(++_0x452c08);}(_0xfe46,0x1a4));var _0x6fe4=function(_0x45865b,_0x21e2ef){_0x45865b=_0x45865b-0x0;var _0x2a8c30=_0xfe46[_0x45865b];return _0x2a8c30;};'use strict';function FreshsalesAccount(_0x342548){this['id']=_0x342548['id']||0x0;this[_0x6fe4('0x0')]=_0x342548[_0x6fe4('0x0')]||'';this[_0x6fe4('0x1')]=_0x342548[_0x6fe4('0x1')]||'';this[_0x6fe4('0x2')]=_0x342548[_0x6fe4('0x3')]||'';this[_0x6fe4('0x4')]=_0x342548[_0x6fe4('0x4')]||'';this[_0x6fe4('0x5')]=_0x342548[_0x6fe4('0x5')]||'';this[_0x6fe4('0x6')]=_0x342548['Configurations']||{};}module[_0x6fe4('0x7')]=FreshsalesAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js
index ec91adf..dc5fa64 100644
--- a/server/services/ami/model/queueReport.js
+++ b/server/services/ami/model/queueReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd4bb=['originalposition','channel','connectedlinenum','connectedlinename','accountcode','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd4bb,0x144));var _0xbd4b=function(_0x16f582,_0x4dfba1){_0x16f582=_0x16f582-0x0;var _0x7cd448=_0xd4bb[_0x16f582];return _0x7cd448;};'use strict';function QueueReport(){this[_0xbd4b('0x0')]=_0xbd4b('0x1');this[_0xbd4b('0x2')]='';this[_0xbd4b('0x3')]='';this['calleridname']='';this[_0xbd4b('0x4')]='';this[_0xbd4b('0x5')]=null;this[_0xbd4b('0x6')]=null;this[_0xbd4b('0x7')]=0x1;this[_0xbd4b('0x8')]=0x1;this['queuecallerabandon']=![];this[_0xbd4b('0x9')]=null;this[_0xbd4b('0xa')]=![];this[_0xbd4b('0xb')]=null;this[_0xbd4b('0xc')]=![];this[_0xbd4b('0xd')]=null;this[_0xbd4b('0xe')]=0x1;this[_0xbd4b('0xf')]='';this[_0xbd4b('0x10')]='';this[_0xbd4b('0x11')]='';this[_0xbd4b('0x12')]='';this['context']='';this['exten']='';this[_0xbd4b('0x13')]='';this[_0xbd4b('0x14')]=0x0;this[_0xbd4b('0x15')]=![];this[_0xbd4b('0x16')]='';this[_0xbd4b('0x17')]=0x0;this[_0xbd4b('0x18')]={};}module[_0xbd4b('0x19')]=QueueReport;
\ No newline at end of file
+var _0x505d=['holdtime','lastAssignedTo','variables','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','exten'];(function(_0x9234eb,_0x114d75){var _0x214240=function(_0x293ceb){while(--_0x293ceb){_0x9234eb['push'](_0x9234eb['shift']());}};_0x214240(++_0x114d75);}(_0x505d,0x93));var _0xd505=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x505d[_0x1e381c];return _0x9b5ea9;};'use strict';function QueueReport(){this['type']='inbound';this[_0xd505('0x0')]='';this[_0xd505('0x1')]='';this[_0xd505('0x2')]='';this[_0xd505('0x3')]='';this[_0xd505('0x4')]=null;this['queuecallerleaveAt']=null;this[_0xd505('0x5')]=0x1;this[_0xd505('0x6')]=0x1;this[_0xd505('0x7')]=![];this[_0xd505('0x8')]=null;this['queuecallercomplete']=![];this[_0xd505('0x9')]=null;this['queuecallerexit']=![];this[_0xd505('0xa')]=null;this[_0xd505('0xb')]=0x1;this['channel']='';this[_0xd505('0xc')]='';this[_0xd505('0xd')]='';this['accountcode']='';this['context']='';this[_0xd505('0xe')]='';this['priority']='';this[_0xd505('0xf')]=0x0;this['assigned']=![];this[_0xd505('0x10')]='';this['mohtime']=0x0;this[_0xd505('0x11')]={};}module['exports']=QueueReport;
\ No newline at end of file
diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js
index 122b9d3..3cf8fbb 100644
--- a/server/services/ami/model/salesforceAccount.js
+++ b/server/services/ami/model/salesforceAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2d51=['password','clientId','clientSecret','securityToken','type','serverUrl','exports','name','username','remoteUri'];(function(_0x1f7e17,_0x47c3f1){var _0x4bea60=function(_0x140dbc){while(--_0x140dbc){_0x1f7e17['push'](_0x1f7e17['shift']());}};_0x4bea60(++_0x47c3f1);}(_0x2d51,0x101));var _0x12d5=function(_0x2c9f4b,_0x10a676){_0x2c9f4b=_0x2c9f4b-0x0;var _0x81ffc=_0x2d51[_0x2c9f4b];return _0x81ffc;};'use strict';function SalesforceAccount(_0x3377e8){this['id']=_0x3377e8['id']||0x0;this[_0x12d5('0x0')]=_0x3377e8[_0x12d5('0x0')]||'';this[_0x12d5('0x1')]=_0x3377e8[_0x12d5('0x1')]||'';this[_0x12d5('0x2')]=_0x3377e8[_0x12d5('0x2')]||'';this[_0x12d5('0x3')]=_0x3377e8['password']||'';this[_0x12d5('0x4')]=_0x3377e8[_0x12d5('0x4')]||'';this[_0x12d5('0x5')]=_0x3377e8[_0x12d5('0x5')]||'';this[_0x12d5('0x6')]=_0x3377e8[_0x12d5('0x6')]||'';this[_0x12d5('0x7')]=_0x3377e8[_0x12d5('0x7')]||'integrationTab';this[_0x12d5('0x8')]=_0x3377e8[_0x12d5('0x8')]||'';this['Configurations']=_0x3377e8['Configurations']||{};}module[_0x12d5('0x9')]=SalesforceAccount;
\ No newline at end of file
+var _0xab49=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientSecret','securityToken','type'];(function(_0x182101,_0x1f04b2){var _0x5b5b3c=function(_0x17a1f7){while(--_0x17a1f7){_0x182101['push'](_0x182101['shift']());}};_0x5b5b3c(++_0x1f04b2);}(_0xab49,0x122));var _0x9ab4=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0xab49[_0x258fb0];return _0x4d1afe;};'use strict';function SalesforceAccount(_0x299a03){this['id']=_0x299a03['id']||0x0;this[_0x9ab4('0x0')]=_0x299a03['name']||'';this[_0x9ab4('0x1')]=_0x299a03['username']||'';this[_0x9ab4('0x2')]=_0x299a03[_0x9ab4('0x2')]||'';this['password']=_0x299a03[_0x9ab4('0x3')]||'';this['clientId']=_0x299a03['clientId']||'';this[_0x9ab4('0x4')]=_0x299a03[_0x9ab4('0x4')]||'';this[_0x9ab4('0x5')]=_0x299a03[_0x9ab4('0x5')]||'';this[_0x9ab4('0x6')]=_0x299a03[_0x9ab4('0x6')]||_0x9ab4('0x7');this[_0x9ab4('0x8')]=_0x299a03['serverUrl']||'';this[_0x9ab4('0x9')]=_0x299a03[_0x9ab4('0x9')]||{};}module[_0x9ab4('0xa')]=SalesforceAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js
index c0d27fe..cc15db6 100644
--- a/server/services/ami/model/servicenowAccount.js
+++ b/server/services/ami/model/servicenowAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4b7=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0xb4b7,0x119));var _0x7b4b=function(_0x1916ad,_0x365b30){_0x1916ad=_0x1916ad-0x0;var _0xb112ea=_0xb4b7[_0x1916ad];return _0xb112ea;};'use strict';function ServicenowAccount(_0xdc7ca0){this['id']=_0xdc7ca0['id']||0x0;this[_0x7b4b('0x0')]=_0xdc7ca0['name']||'';this[_0x7b4b('0x1')]=_0xdc7ca0[_0x7b4b('0x1')]||'';this[_0x7b4b('0x2')]=_0xdc7ca0[_0x7b4b('0x2')]||'';this[_0x7b4b('0x3')]=_0xdc7ca0[_0x7b4b('0x3')]||'';this[_0x7b4b('0x4')]=_0xdc7ca0[_0x7b4b('0x4')]||'';this[_0x7b4b('0x5')]=_0xdc7ca0[_0x7b4b('0x5')]||{};}module[_0x7b4b('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0xd538=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x2e737d,_0x39edda){var _0x4ab14a=function(_0x1dd4f5){while(--_0x1dd4f5){_0x2e737d['push'](_0x2e737d['shift']());}};_0x4ab14a(++_0x39edda);}(_0xd538,0x78));var _0x8d53=function(_0x2d4065,_0x38dc95){_0x2d4065=_0x2d4065-0x0;var _0xef6016=_0xd538[_0x2d4065];return _0xef6016;};'use strict';function ServicenowAccount(_0x260cf2){this['id']=_0x260cf2['id']||0x0;this[_0x8d53('0x0')]=_0x260cf2[_0x8d53('0x0')]||'';this[_0x8d53('0x1')]=_0x260cf2[_0x8d53('0x1')]||'';this['password']=_0x260cf2[_0x8d53('0x2')]||'';this[_0x8d53('0x3')]=_0x260cf2[_0x8d53('0x3')]||'';this[_0x8d53('0x4')]=_0x260cf2[_0x8d53('0x4')]||'';this[_0x8d53('0x5')]=_0x260cf2[_0x8d53('0x5')]||{};}module[_0x8d53('0x6')]=ServicenowAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js
index 7f4e095..5eba12f 100644
--- a/server/services/ami/model/sugarcrmAccount.js
+++ b/server/services/ami/model/sugarcrmAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b47=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x494315,_0x2d42bd){var _0x49cc18=function(_0x419de9){while(--_0x419de9){_0x494315['push'](_0x494315['shift']());}};_0x49cc18(++_0x2d42bd);}(_0x4b47,0x1ce));var _0x74b4=function(_0x4e341a,_0x9deed3){_0x4e341a=_0x4e341a-0x0;var _0x7fcf4d=_0x4b47[_0x4e341a];return _0x7fcf4d;};'use strict';function SugarcrmAccount(_0x416576){this['id']=_0x416576['id']||0x0;this[_0x74b4('0x0')]=_0x416576[_0x74b4('0x0')]||'';this[_0x74b4('0x1')]=_0x416576['username']||'';this['password']=_0x416576['password']||'';this[_0x74b4('0x2')]=_0x416576[_0x74b4('0x2')]||'';this[_0x74b4('0x3')]=_0x416576[_0x74b4('0x3')]||'';this[_0x74b4('0x4')]=_0x416576[_0x74b4('0x4')]||{};}module[_0x74b4('0x5')]=SugarcrmAccount;
\ No newline at end of file
+var _0xca27=['password','remoteUri','Configurations','exports','name','username'];(function(_0x5f378c,_0x9806a7){var _0x52e608=function(_0xc5070e){while(--_0xc5070e){_0x5f378c['push'](_0x5f378c['shift']());}};_0x52e608(++_0x9806a7);}(_0xca27,0x1a8));var _0x7ca2=function(_0x495e62,_0x426a95){_0x495e62=_0x495e62-0x0;var _0x44368b=_0xca27[_0x495e62];return _0x44368b;};'use strict';function SugarcrmAccount(_0x4e2af1){this['id']=_0x4e2af1['id']||0x0;this[_0x7ca2('0x0')]=_0x4e2af1['name']||'';this[_0x7ca2('0x1')]=_0x4e2af1[_0x7ca2('0x1')]||'';this[_0x7ca2('0x2')]=_0x4e2af1[_0x7ca2('0x2')]||'';this['remoteUri']=_0x4e2af1[_0x7ca2('0x3')]||'';this['serverUrl']=_0x4e2af1['serverUrl']||'';this[_0x7ca2('0x4')]=_0x4e2af1[_0x7ca2('0x4')]||{};}module[_0x7ca2('0x5')]=SugarcrmAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js
index 0314c1f..22e7ebe 100644
--- a/server/services/ami/model/telephone.js
+++ b/server/services/ami/model/telephone.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe943=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x3282b0,_0x3626fc){var _0x37e5d9=function(_0xc8d94d){while(--_0xc8d94d){_0x3282b0['push'](_0x3282b0['shift']());}};_0x37e5d9(++_0x3626fc);}(_0xe943,0x68));var _0x3e94=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0xe943[_0x119b3e];return _0x1169ae;};'use strict';function Telephone(_0x16bd10){this['id']=_0x16bd10['id']||0x0;this[_0x3e94('0x0')]=_0x16bd10[_0x3e94('0x0')]||'';this['accountcode']=_0x16bd10[_0x3e94('0x1')]||'';this[_0x3e94('0x2')]=_0x3e94('0x3');this[_0x3e94('0x4')]=0x0;this[_0x3e94('0x5')]=_0x3e94('0x3');this[_0x3e94('0x6')]='';}module[_0x3e94('0x7')]=Telephone;
\ No newline at end of file
+var _0x4ad1=['stateTime','status','address','exports','name','accountcode'];(function(_0x45d24d,_0x8c84ec){var _0x1dad38=function(_0x20be41){while(--_0x20be41){_0x45d24d['push'](_0x45d24d['shift']());}};_0x1dad38(++_0x8c84ec);}(_0x4ad1,0x142));var _0x14ad=function(_0xea5d36,_0x2aa458){_0xea5d36=_0xea5d36-0x0;var _0x690e79=_0x4ad1[_0xea5d36];return _0x690e79;};'use strict';function Telephone(_0x3935c9){this['id']=_0x3935c9['id']||0x0;this['name']=_0x3935c9[_0x14ad('0x0')]||'';this[_0x14ad('0x1')]=_0x3935c9[_0x14ad('0x1')]||'';this['state']='unknown';this[_0x14ad('0x2')]=0x0;this[_0x14ad('0x3')]='unknown';this[_0x14ad('0x4')]='';}module[_0x14ad('0x5')]=Telephone;
\ No newline at end of file
diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js
index 5450d15..c409c22 100644
--- a/server/services/ami/model/template.js
+++ b/server/services/ami/model/template.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x098c=['name','html'];(function(_0x43059f,_0x4b73ee){var _0x46cd3d=function(_0x351d43){while(--_0x351d43){_0x43059f['push'](_0x43059f['shift']());}};_0x46cd3d(++_0x4b73ee);}(_0x098c,0x124));var _0xc098=function(_0x77ab15,_0x5a2f81){_0x77ab15=_0x77ab15-0x0;var _0x4a0b15=_0x098c[_0x77ab15];return _0x4a0b15;};'use strict';function template(_0x11a6e8){this['id']=_0x11a6e8['id']||0x0;this[_0xc098('0x0')]=_0x11a6e8['name']||'';this[_0xc098('0x1')]=_0x11a6e8[_0xc098('0x1')]||'';}module['exports']=template;
\ No newline at end of file
+var _0x410d=['name','html'];(function(_0x2dab76,_0x595821){var _0x228378=function(_0x187fb3){while(--_0x187fb3){_0x2dab76['push'](_0x2dab76['shift']());}};_0x228378(++_0x595821);}(_0x410d,0x66));var _0xd410=function(_0x2c3255,_0x4e00ae){_0x2c3255=_0x2c3255-0x0;var _0x282aba=_0x410d[_0x2c3255];return _0x282aba;};'use strict';function template(_0x2cd546){this['id']=_0x2cd546['id']||0x0;this[_0xd410('0x0')]=_0x2cd546[_0xd410('0x0')]||'';this['html']=_0x2cd546[_0xd410('0x1')]||'';}module['exports']=template;
\ No newline at end of file
diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js
index 912e829..c54c759 100644
--- a/server/services/ami/model/trigger.js
+++ b/server/services/ami/model/trigger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ef6=['status','AllConditions','AnyConditions','exports','name','channel','voice'];(function(_0xa993ce,_0x27e56b){var _0x1bfe42=function(_0x32c832){while(--_0x32c832){_0xa993ce['push'](_0xa993ce['shift']());}};_0x1bfe42(++_0x27e56b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1b08a6,_0x50559a){_0x1b08a6=_0x1b08a6-0x0;var _0x500aa6=_0x8ef6[_0x1b08a6];return _0x500aa6;};'use strict';function Trigger(_0x58ecc7){this['id']=_0x58ecc7['id']||0x0;this[_0x68ef('0x0')]=_0x58ecc7[_0x68ef('0x0')]||'';this[_0x68ef('0x1')]=_0x58ecc7[_0x68ef('0x1')]||_0x68ef('0x2');this[_0x68ef('0x3')]=_0x58ecc7['status']||![];this[_0x68ef('0x4')]=_0x58ecc7[_0x68ef('0x4')]||[];this[_0x68ef('0x5')]=_0x58ecc7[_0x68ef('0x5')]||[];this['Actions']=_0x58ecc7['Actions']||[];}module[_0x68ef('0x6')]=Trigger;
\ No newline at end of file
+var _0x7217=['voice','status','AllConditions','AnyConditions','Actions','exports','name','channel'];(function(_0x48da5f,_0x48557b){var _0x33afac=function(_0x423dfb){while(--_0x423dfb){_0x48da5f['push'](_0x48da5f['shift']());}};_0x33afac(++_0x48557b);}(_0x7217,0x19e));var _0x7721=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7217[_0x491a7f];return _0x3d8f44;};'use strict';function Trigger(_0x516f0e){this['id']=_0x516f0e['id']||0x0;this['name']=_0x516f0e[_0x7721('0x0')]||'';this[_0x7721('0x1')]=_0x516f0e[_0x7721('0x1')]||_0x7721('0x2');this[_0x7721('0x3')]=_0x516f0e['status']||![];this['AllConditions']=_0x516f0e[_0x7721('0x4')]||[];this[_0x7721('0x5')]=_0x516f0e[_0x7721('0x5')]||[];this[_0x7721('0x6')]=_0x516f0e[_0x7721('0x6')]||[];}module[_0x7721('0x7')]=Trigger;
\ No newline at end of file
diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js
index 942eca6..20ca86d 100644
--- a/server/services/ami/model/trunk.js
+++ b/server/services/ami/model/trunk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3fc3=['state','unknown','stateTime','registry','indexOf','host','port','refresh','stateRegistry','address','exports','active','name'];(function(_0x1ef897,_0x8978cb){var _0x18679c=function(_0x4f2e7a){while(--_0x4f2e7a){_0x1ef897['push'](_0x1ef897['shift']());}};_0x18679c(++_0x8978cb);}(_0x3fc3,0x150));var _0x33fc=function(_0x5801d7,_0x1824f9){_0x5801d7=_0x5801d7-0x0;var _0x42812f=_0x3fc3[_0x5801d7];return _0x42812f;};'use strict';function Trunk(_0x316ad2){this['id']=_0x316ad2['id']||0x0;this['active']=_0x316ad2[_0x33fc('0x0')]||![];this[_0x33fc('0x1')]=_0x316ad2[_0x33fc('0x1')]||'';this[_0x33fc('0x2')]=_0x33fc('0x3');this[_0x33fc('0x4')]=0x0;this['status']=_0x33fc('0x3');this[_0x33fc('0x5')]=_0x316ad2[_0x33fc('0x5')]&&_0x316ad2[_0x33fc('0x5')][_0x33fc('0x6')](':')?_0x316ad2[_0x33fc('0x5')]['split'](':')[0x0]:'';this[_0x33fc('0x7')]='';this[_0x33fc('0x8')]='';this['domain']='';this['domainport']='';this[_0x33fc('0x9')]='';this[_0x33fc('0xa')]=_0x33fc('0x3');this['registrationtime']='';this[_0x33fc('0xb')]='';}module[_0x33fc('0xc')]=Trunk;
\ No newline at end of file
+var _0xe0af=['status','registry','split','host','domain','domainport','stateRegistry','registrationtime','address','active','name','state','unknown','stateTime'];(function(_0x26d43c,_0x1cbf1){var _0x1075fa=function(_0x149fc8){while(--_0x149fc8){_0x26d43c['push'](_0x26d43c['shift']());}};_0x1075fa(++_0x1cbf1);}(_0xe0af,0x1c9));var _0xfe0a=function(_0x1653b1,_0x35b7d1){_0x1653b1=_0x1653b1-0x0;var _0x3e0b17=_0xe0af[_0x1653b1];return _0x3e0b17;};'use strict';function Trunk(_0x1cf6de){this['id']=_0x1cf6de['id']||0x0;this[_0xfe0a('0x0')]=_0x1cf6de[_0xfe0a('0x0')]||![];this['name']=_0x1cf6de[_0xfe0a('0x1')]||'';this[_0xfe0a('0x2')]=_0xfe0a('0x3');this[_0xfe0a('0x4')]=0x0;this[_0xfe0a('0x5')]=_0xfe0a('0x3');this[_0xfe0a('0x6')]=_0x1cf6de[_0xfe0a('0x6')]&&_0x1cf6de[_0xfe0a('0x6')]['indexOf'](':')?_0x1cf6de['registry'][_0xfe0a('0x7')](':')[0x0]:'';this[_0xfe0a('0x8')]='';this['port']='';this[_0xfe0a('0x9')]='';this[_0xfe0a('0xa')]='';this['refresh']='';this[_0xfe0a('0xb')]=_0xfe0a('0x3');this[_0xfe0a('0xc')]='';this[_0xfe0a('0xd')]='';}module['exports']=Trunk;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js
index be555bb..ffe77da 100644
--- a/server/services/ami/model/voiceExtension.js
+++ b/server/services/ami/model/voiceExtension.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f6c=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x2ffe25,_0x3259eb){var _0x3740ee=function(_0x5a883d){while(--_0x5a883d){_0x2ffe25['push'](_0x2ffe25['shift']());}};_0x3740ee(++_0x3259eb);}(_0x8f6c,0x173));var _0xc8f6=function(_0x2caa3d,_0x23dbbb){_0x2caa3d=_0x2caa3d-0x0;var _0x463c9e=_0x8f6c[_0x2caa3d];return _0x463c9e;};'use strict';function voiceExtension(_0x3f0a44){this['id']=_0x3f0a44['id']||0x0;this[_0xc8f6('0x0')]=_0x3f0a44[_0xc8f6('0x0')]||'';this[_0xc8f6('0x1')]=_0x3f0a44['recordingFormat']||_0xc8f6('0x2');this[_0xc8f6('0x3')]=_0x3f0a44[_0xc8f6('0x3')]||![];}module[_0xc8f6('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x31a6=['recordingFormat','mandatoryDisposition','exports'];(function(_0x14dfc8,_0x2be279){var _0xf2b0e8=function(_0x57b602){while(--_0x57b602){_0x14dfc8['push'](_0x14dfc8['shift']());}};_0xf2b0e8(++_0x2be279);}(_0x31a6,0x165));var _0x631a=function(_0xeddc32,_0x3ea6f9){_0xeddc32=_0xeddc32-0x0;var _0x1df847=_0x31a6[_0xeddc32];return _0x1df847;};'use strict';function voiceExtension(_0x546fb0){this['id']=_0x546fb0['id']||0x0;this['exten']=_0x546fb0['exten']||'';this[_0x631a('0x0')]=_0x546fb0[_0x631a('0x0')]||'none';this[_0x631a('0x1')]=_0x546fb0[_0x631a('0x1')]||![];}module[_0x631a('0x2')]=voiceExtension;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js
index 2cee33d..21b051e 100644
--- a/server/services/ami/model/voiceQueue.js
+++ b/server/services/ami/model/voiceQueue.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf2a=['dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','unavailable','ringing','ringinuse','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp'];(function(_0x40b17a,_0x35d58a){var _0x4440c3=function(_0xe889c5){while(--_0xe889c5){_0x40b17a['push'](_0x40b17a['shift']());}};_0x4440c3(++_0x35d58a);}(_0xcf2a,0xd2));var _0xacf2=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xcf2a[_0x20589d];return _0x422de9;};'use strict';var statusDesc=[_0xacf2('0x0'),'not_inuse',_0xacf2('0x1'),_0xacf2('0x2'),'invalid',_0xacf2('0x3'),_0xacf2('0x4'),_0xacf2('0x5'),'onhold'];var monitorFormat={'wav':_0xacf2('0x6'),'wav49':'wav49','gsm':_0xacf2('0x7')};var strategy={'rrmemory':_0xacf2('0x8'),'roundrobin':_0xacf2('0x9')};function VoiceQueue(_0x53751a){this['id']=_0x53751a['id']||0x0;this[_0xacf2('0xa')]=_0x53751a[_0xacf2('0xa')]||'';this[_0xacf2('0xb')]=_0x53751a[_0xacf2('0xb')]||'';this[_0xacf2('0xc')]=_0x53751a[_0xacf2('0xc')]||_0xacf2('0xd');this[_0xacf2('0xe')]=0x0;this['talking']=0x0;this[_0xacf2('0xf')]=0x0;this[_0xacf2('0x10')]=0x0;this[_0xacf2('0x11')]=0x0;this[_0xacf2('0x12')]=0x0;this[_0xacf2('0x13')]=0x0;this[_0xacf2('0x14')]=0x0;this[_0xacf2('0x15')]=0x0;this[_0xacf2('0x16')]=0x0;this[_0xacf2('0x17')]=0x0;this[_0xacf2('0x18')]=_0x53751a[_0xacf2('0x18')]||![];this[_0xacf2('0x19')]=_0x53751a['acwTimeout']||0xa;this[_0xacf2('0x1a')]=_0x53751a[_0xacf2('0x1a')]||'no';this[_0xacf2('0x1b')]=!![];this['message']='';this[_0xacf2('0x1c')]=0x0;this[_0xacf2('0x1d')]=0x0;this[_0xacf2('0x1e')]=_0x53751a[_0xacf2('0x1e')]||null;this[_0xacf2('0x1f')]=_0x53751a['dialGlobalInterval']?_0x53751a[_0xacf2('0x1f')]:null;this[_0xacf2('0x20')]=_0x53751a[_0xacf2('0x20')];this[_0xacf2('0x21')]=_0x53751a[_0xacf2('0x21')]||_0xacf2('0x22');this['dialLimitChannel']=_0x53751a[_0xacf2('0x23')]||0x0;this[_0xacf2('0x24')]=_0x53751a[_0xacf2('0x24')]||0x0;this['dialPowerLevel']=_0x53751a[_0xacf2('0x25')]||0x1;this['dialPredictiveOptimization']=_0x53751a[_0xacf2('0x26')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x53751a[_0xacf2('0x27')]||0.03;this['dialPredictiveInterval']=_0x53751a['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x53751a['dialOriginateCallerIdName']||_0xacf2('0x28');this[_0xacf2('0x29')]=_0x53751a[_0xacf2('0x29')]||_0xacf2('0x28');this[_0xacf2('0x2a')]=_0x53751a[_0xacf2('0x2a')]||0x1e;this[_0xacf2('0x2b')]=_0x53751a[_0xacf2('0x2b')]||_0xacf2('0x2c');this['dialQueueTimeout']=_0x53751a[_0xacf2('0x2d')]||0x3;this[_0xacf2('0x2e')]=_0x53751a[_0xacf2('0x2e')]||undefined;this[_0xacf2('0x2f')]=_0x53751a[_0xacf2('0x2f')]||0x3;this[_0xacf2('0x30')]=_0x53751a[_0xacf2('0x30')]||0x96;this[_0xacf2('0x31')]=_0x53751a[_0xacf2('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x53751a[_0xacf2('0x32')]||0x96;this[_0xacf2('0x33')]=_0x53751a[_0xacf2('0x33')]||0x3;this[_0xacf2('0x34')]=_0x53751a[_0xacf2('0x34')]||0x96;this[_0xacf2('0x35')]=_0x53751a[_0xacf2('0x35')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x53751a[_0xacf2('0x36')]||0x96;this['dialDropMaxRetry']=_0x53751a['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x53751a[_0xacf2('0x37')]||0x96;this[_0xacf2('0x38')]=_0x53751a[_0xacf2('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x53751a[_0xacf2('0x39')]||0x96;this['dialMachineMaxRetry']=_0x53751a[_0xacf2('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x53751a[_0xacf2('0x3b')]||0x96;this[_0xacf2('0x3c')]=_0x53751a['dialAgentRejectMaxRetry']||0x3;this[_0xacf2('0x3d')]=_0x53751a[_0xacf2('0x3d')]||0x96;this['dialGlobalMaxRetry']=_0x53751a[_0xacf2('0x3e')]||0x4;this[_0xacf2('0x3f')]=_0x53751a['Trunk']?_0x53751a['Trunk']:undefined;this[_0xacf2('0x40')]=_0x53751a[_0xacf2('0x40')]?_0x53751a[_0xacf2('0x40')]:undefined;this[_0xacf2('0x41')]=_0x53751a[_0xacf2('0x41')]||undefined;this['Interval']=_0x53751a['Interval']?_0x53751a[_0xacf2('0x42')]:undefined;this[_0xacf2('0x43')]=_0x53751a[_0xacf2('0x43')]||'DESC';this[_0xacf2('0x44')]=_0x53751a[_0xacf2('0x44')]||undefined;this['dialCutDigit']=_0x53751a[_0xacf2('0x45')]||undefined;this[_0xacf2('0x46')]=strategy[_0x53751a[_0xacf2('0x46')]]||_0xacf2('0x8');this['queueStatusComplete']=!![];this[_0xacf2('0x47')]=_0x53751a[_0xacf2('0x47')]||![];this['dialAMDInitialSilence']=_0x53751a[_0xacf2('0x48')];this['dialAMDGreeting']=_0x53751a[_0xacf2('0x49')];this['dialAMDAfterGreetingSilence']=_0x53751a[_0xacf2('0x4a')];this[_0xacf2('0x4b')]=_0x53751a[_0xacf2('0x4b')];this[_0xacf2('0x4c')]=_0x53751a['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x53751a[_0xacf2('0x4d')];this[_0xacf2('0x4e')]=_0x53751a[_0xacf2('0x4e')];this[_0xacf2('0x4f')]=_0x53751a[_0xacf2('0x4f')];this['dialAMDMaximumWordLength']=_0x53751a[_0xacf2('0x50')];this[_0xacf2('0x51')]=0x0;this['pTalking']=0x0;this[_0xacf2('0x52')]=_0x53751a[_0xacf2('0x52')];this[_0xacf2('0x53')]=0x0;this[_0xacf2('0x54')]=0x0;this[_0xacf2('0x55')]=0x0;this[_0xacf2('0x56')]=0x0;this[_0xacf2('0x57')]=0x0;this[_0xacf2('0x58')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xacf2('0x59')]=0x0;this[_0xacf2('0x5a')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xacf2('0x5b')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0xacf2('0x5c')]=0x0;this['startProgressive']=undefined;this[_0xacf2('0x5d')]=undefined;this[_0xacf2('0x5e')]=undefined;this[_0xacf2('0x5f')]=1.05;this[_0xacf2('0x60')]=0x0;this[_0xacf2('0x61')]=0x0;this[_0xacf2('0x62')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xacf2('0x63')]=0x0;this[_0xacf2('0x64')]=0x0;this[_0xacf2('0x65')]=0x0;this[_0xacf2('0x66')]=0x0;this[_0xacf2('0x67')]=_0x53751a[_0xacf2('0x68')]||0x14;this[_0xacf2('0x69')]=_0x53751a[_0xacf2('0x68')]||0xa;this[_0xacf2('0x6a')]=0x0;this[_0xacf2('0x6b')]=0x0;this[_0xacf2('0x6c')]=0x1;this['erlangCalls']=0x0;this[_0xacf2('0x6d')]=0x0;this[_0xacf2('0x6e')]=0x0;this[_0xacf2('0x6f')]=0x0;this[_0xacf2('0x70')]=_0x53751a[_0xacf2('0x70')]||0x1e;this[_0xacf2('0x71')]=_0x53751a['dialRecallInQueue']||![];this[_0xacf2('0x72')]=_0x53751a[_0xacf2('0x72')]||undefined;this[_0xacf2('0x73')]=_0x53751a[_0xacf2('0x73')]||![];this[_0xacf2('0x74')]=_0x53751a[_0xacf2('0x74')]||![];this[_0xacf2('0xb')]=monitorFormat[_0x53751a['monitor_format']]?monitorFormat[_0x53751a[_0xacf2('0xb')]]:undefined;this[_0xacf2('0x75')]=_0x53751a[_0xacf2('0x75')]||![];this[_0xacf2('0x76')]=_0x53751a[_0xacf2('0x76')]?_0x53751a['mandatoryDispositionPause']:undefined;}module[_0xacf2('0x77')]=VoiceQueue;
\ No newline at end of file
+var _0x6ddd=['temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','name','monitor_format','type','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x6ddd,0x1ae));var _0xd6dd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6ddd[_0x502c7d];return _0x30b7ed;};'use strict';var statusDesc=[_0xd6dd('0x0'),'not_inuse',_0xd6dd('0x1'),_0xd6dd('0x2'),_0xd6dd('0x3'),'unavailable',_0xd6dd('0x4'),_0xd6dd('0x5'),_0xd6dd('0x6')];var monitorFormat={'wav':_0xd6dd('0x7'),'wav49':_0xd6dd('0x8'),'gsm':_0xd6dd('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x57f621){this['id']=_0x57f621['id']||0x0;this['name']=_0x57f621[_0xd6dd('0xa')]||'';this['monitor_format']=_0x57f621[_0xd6dd('0xb')]||'';this[_0xd6dd('0xc')]=_0x57f621['type']||'inbound';this['waiting']=0x0;this[_0xd6dd('0xd')]=0x0;this['total']=0x0;this[_0xd6dd('0xe')]=0x0;this[_0xd6dd('0xf')]=0x0;this[_0xd6dd('0x10')]=0x0;this[_0xd6dd('0x11')]=0x0;this[_0xd6dd('0x12')]=0x0;this['abandoned']=0x0;this[_0xd6dd('0x13')]=0x0;this['available']=0x0;this[_0xd6dd('0x14')]=_0x57f621['acw']||![];this[_0xd6dd('0x15')]=_0x57f621['acwTimeout']||0xa;this[_0xd6dd('0x16')]=_0x57f621['autopause']||'no';this[_0xd6dd('0x17')]=!![];this[_0xd6dd('0x18')]='';this[_0xd6dd('0x19')]=0x0;this[_0xd6dd('0x1a')]=0x0;this[_0xd6dd('0x1b')]=_0x57f621[_0xd6dd('0x1b')]||null;this['dialGlobalInterval']=_0x57f621[_0xd6dd('0x1c')]?_0x57f621[_0xd6dd('0x1c')]:null;this[_0xd6dd('0x1d')]=_0x57f621[_0xd6dd('0x1d')];this['dialMethod']=_0x57f621['dialMethod']||_0xd6dd('0x1e');this[_0xd6dd('0x1f')]=_0x57f621['dialLimitChannel']||0x0;this[_0xd6dd('0x20')]=_0x57f621[_0xd6dd('0x20')]||0x0;this[_0xd6dd('0x21')]=_0x57f621[_0xd6dd('0x21')]||0x1;this[_0xd6dd('0x22')]=_0x57f621[_0xd6dd('0x22')]||_0xd6dd('0x23');this[_0xd6dd('0x24')]=_0x57f621[_0xd6dd('0x24')]||0.03;this['dialPredictiveInterval']=_0x57f621['dialPredictiveInterval']||0x258;this[_0xd6dd('0x25')]=_0x57f621[_0xd6dd('0x25')]||_0xd6dd('0x26');this[_0xd6dd('0x27')]=_0x57f621[_0xd6dd('0x27')]||_0xd6dd('0x26');this[_0xd6dd('0x28')]=_0x57f621['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x57f621[_0xd6dd('0x29')]||'tTxX';this['dialQueueTimeout']=_0x57f621[_0xd6dd('0x2a')]||0x3;this['dialQueueProject']=_0x57f621[_0xd6dd('0x2b')]||undefined;this[_0xd6dd('0x2c')]=_0x57f621[_0xd6dd('0x2c')]||0x3;this[_0xd6dd('0x2d')]=_0x57f621['dialCongestionRetryFrequency']||0x96;this[_0xd6dd('0x2e')]=_0x57f621[_0xd6dd('0x2e')]||0x3;this[_0xd6dd('0x2f')]=_0x57f621[_0xd6dd('0x2f')]||0x96;this[_0xd6dd('0x30')]=_0x57f621['dialNoAnswerMaxRetry']||0x3;this[_0xd6dd('0x31')]=_0x57f621[_0xd6dd('0x31')]||0x96;this[_0xd6dd('0x32')]=_0x57f621[_0xd6dd('0x32')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x57f621[_0xd6dd('0x33')]||0x96;this[_0xd6dd('0x34')]=_0x57f621[_0xd6dd('0x34')]||0x3;this['dialDropRetryFrequency']=_0x57f621['dialDropRetryFrequency']||0x96;this[_0xd6dd('0x35')]=_0x57f621[_0xd6dd('0x35')]||0x3;this['dialAbandonedRetryFrequency']=_0x57f621[_0xd6dd('0x36')]||0x96;this[_0xd6dd('0x37')]=_0x57f621[_0xd6dd('0x37')]||0x3;this[_0xd6dd('0x38')]=_0x57f621[_0xd6dd('0x38')]||0x96;this[_0xd6dd('0x39')]=_0x57f621['dialAgentRejectMaxRetry']||0x3;this[_0xd6dd('0x3a')]=_0x57f621[_0xd6dd('0x3a')]||0x96;this['dialGlobalMaxRetry']=_0x57f621[_0xd6dd('0x3b')]||0x4;this[_0xd6dd('0x3c')]=_0x57f621[_0xd6dd('0x3c')]?_0x57f621[_0xd6dd('0x3c')]:undefined;this[_0xd6dd('0x3d')]=_0x57f621[_0xd6dd('0x3d')]?_0x57f621[_0xd6dd('0x3d')]:undefined;this[_0xd6dd('0x3e')]=_0x57f621[_0xd6dd('0x3e')]||undefined;this['Interval']=_0x57f621[_0xd6dd('0x3f')]?_0x57f621[_0xd6dd('0x3f')]:undefined;this[_0xd6dd('0x40')]=_0x57f621[_0xd6dd('0x40')]||'DESC';this[_0xd6dd('0x41')]=_0x57f621[_0xd6dd('0x41')]||undefined;this[_0xd6dd('0x42')]=_0x57f621[_0xd6dd('0x42')]||undefined;this[_0xd6dd('0x43')]=strategy[_0x57f621['strategy']]||_0xd6dd('0x44');this['queueStatusComplete']=!![];this[_0xd6dd('0x45')]=_0x57f621[_0xd6dd('0x45')]||![];this['dialAMDInitialSilence']=_0x57f621[_0xd6dd('0x46')];this[_0xd6dd('0x47')]=_0x57f621[_0xd6dd('0x47')];this[_0xd6dd('0x48')]=_0x57f621[_0xd6dd('0x48')];this[_0xd6dd('0x49')]=_0x57f621[_0xd6dd('0x49')];this['dialAMDMinWordLength']=_0x57f621[_0xd6dd('0x4a')];this[_0xd6dd('0x4b')]=_0x57f621[_0xd6dd('0x4b')];this[_0xd6dd('0x4c')]=_0x57f621['dialAMDMaximumNumberOfWords'];this[_0xd6dd('0x4d')]=_0x57f621[_0xd6dd('0x4d')];this['dialAMDMaximumWordLength']=_0x57f621[_0xd6dd('0x4e')];this[_0xd6dd('0x4f')]=0x0;this[_0xd6dd('0x50')]=0x0;this[_0xd6dd('0x51')]=_0x57f621[_0xd6dd('0x51')];this[_0xd6dd('0x52')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xd6dd('0x53')]=0x0;this[_0xd6dd('0x54')]=0x0;this[_0xd6dd('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xd6dd('0x56')]=0x0;this[_0xd6dd('0x57')]=0x0;this[_0xd6dd('0x58')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xd6dd('0x59')]=0x0;this[_0xd6dd('0x5a')]=0x0;this[_0xd6dd('0x5b')]=0x0;this[_0xd6dd('0x5c')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0xd6dd('0x5d')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xd6dd('0x5e')]=0x0;this[_0xd6dd('0x5f')]=0x0;this[_0xd6dd('0x60')]=0x0;this[_0xd6dd('0x61')]=0x0;this[_0xd6dd('0x62')]=0x0;this[_0xd6dd('0x63')]=0x0;this[_0xd6dd('0x64')]=_0x57f621['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xd6dd('0x65')]=_0x57f621[_0xd6dd('0x66')]||0xa;this[_0xd6dd('0x67')]=0x0;this[_0xd6dd('0x68')]=0x0;this[_0xd6dd('0x69')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0xd6dd('0x6a')]=0x0;this[_0xd6dd('0x6b')]=0x0;this[_0xd6dd('0x6c')]=_0x57f621['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x57f621['dialRecallInQueue']||![];this['dialQueueProject2']=_0x57f621[_0xd6dd('0x6d')]||undefined;this[_0xd6dd('0x6e')]=_0x57f621[_0xd6dd('0x6e')]||![];this['dialAgiAfterHangupAgent']=_0x57f621['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x57f621['monitor_format']]?monitorFormat[_0x57f621[_0xd6dd('0xb')]]:undefined;this[_0xd6dd('0x6f')]=_0x57f621['mandatoryDisposition']||![];this[_0xd6dd('0x70')]=_0x57f621['mandatoryDispositionPause']?_0x57f621[_0xd6dd('0x70')]:undefined;}module[_0xd6dd('0x71')]=VoiceQueue;
\ No newline at end of file
diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js
index 7467b38..2b6f1c1 100644
--- a/server/services/ami/model/vtigerAccount.js
+++ b/server/services/ami/model/vtigerAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa1a8=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0x5ad10e,_0x217c2f){var _0x3fa52e=function(_0x4e7a55){while(--_0x4e7a55){_0x5ad10e['push'](_0x5ad10e['shift']());}};_0x3fa52e(++_0x217c2f);}(_0xa1a8,0x199));var _0x8a1a=function(_0x4c80ca,_0xfb5ee1){_0x4c80ca=_0x4c80ca-0x0;var _0x5441bc=_0xa1a8[_0x4c80ca];return _0x5441bc;};'use strict';function VtigerAccount(_0x15aa74){this['id']=_0x15aa74['id']||0x0;this['name']=_0x15aa74[_0x8a1a('0x0')]||'';this[_0x8a1a('0x1')]=_0x15aa74[_0x8a1a('0x1')]||'';this[_0x8a1a('0x2')]=_0x15aa74[_0x8a1a('0x2')]||'';this[_0x8a1a('0x3')]=_0x15aa74[_0x8a1a('0x3')]||'';this[_0x8a1a('0x4')]=_0x15aa74[_0x8a1a('0x4')]||'';this[_0x8a1a('0x5')]=_0x15aa74[_0x8a1a('0x5')]||{};}module['exports']=VtigerAccount;
\ No newline at end of file
+var _0x1730=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0x1730,0xfe));var _0x0173=function(_0x8cbeec,_0x5cb87b){_0x8cbeec=_0x8cbeec-0x0;var _0x42c3dc=_0x1730[_0x8cbeec];return _0x42c3dc;};'use strict';function VtigerAccount(_0x17d352){this['id']=_0x17d352['id']||0x0;this[_0x0173('0x0')]=_0x17d352[_0x0173('0x0')]||'';this['username']=_0x17d352[_0x0173('0x1')]||'';this[_0x0173('0x2')]=_0x17d352[_0x0173('0x2')]||'';this[_0x0173('0x3')]=_0x17d352[_0x0173('0x3')]||'';this[_0x0173('0x4')]=_0x17d352[_0x0173('0x4')]||'';this[_0x0173('0x5')]=_0x17d352[_0x0173('0x5')]||{};}module[_0x0173('0x6')]=VtigerAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js
index 69e8017..9eb13c4 100644
--- a/server/services/ami/model/zendeskAccount.js
+++ b/server/services/ami/model/zendeskAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadb5,0xad));var _0x5adb=function(_0x53afb7,_0x42db68){_0x53afb7=_0x53afb7-0x0;var _0xd6780c=_0xadb5[_0x53afb7];return _0xd6780c;};'use strict';function ZendeskAccount(_0x1f969c){this['id']=_0x1f969c['id']||0x0;this[_0x5adb('0x0')]=_0x1f969c['name']||'';this[_0x5adb('0x1')]=_0x1f969c[_0x5adb('0x1')]||'';this[_0x5adb('0x2')]=_0x1f969c['password']||'';this[_0x5adb('0x3')]=_0x1f969c[_0x5adb('0x3')]||'';this[_0x5adb('0x4')]=_0x1f969c['remoteUri']||'';this[_0x5adb('0x5')]=_0x1f969c[_0x5adb('0x5')]||'';this[_0x5adb('0x6')]=_0x1f969c[_0x5adb('0x6')]||_0x5adb('0x7');this[_0x5adb('0x8')]=_0x1f969c[_0x5adb('0x8')]||'';this[_0x5adb('0x9')]=_0x1f969c[_0x5adb('0x9')]||{};}module[_0x5adb('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0x5f2f=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x4f54a3,_0x50dd15){var _0x512f8d=function(_0x4b1b9f){while(--_0x4b1b9f){_0x4f54a3['push'](_0x4f54a3['shift']());}};_0x512f8d(++_0x50dd15);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7f542,_0x1e9f00){_0x7f542=_0x7f542-0x0;var _0x50c8e5=_0x5f2f[_0x7f542];return _0x50c8e5;};'use strict';function ZendeskAccount(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||'';this[_0xf5f2('0x2')]=_0x7c86d8[_0xf5f2('0x2')]||'';this[_0xf5f2('0x3')]=_0x7c86d8['token']||'';this['remoteUri']=_0x7c86d8[_0xf5f2('0x4')]||'';this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||'';this[_0xf5f2('0x6')]=_0x7c86d8[_0xf5f2('0x6')]||_0xf5f2('0x7');this['serverUrl']=_0x7c86d8[_0xf5f2('0x8')]||'';this[_0xf5f2('0x9')]=_0x7c86d8[_0xf5f2('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js
index 8550e47..aeabb34 100644
--- a/server/services/ami/model/zohoAccount.js
+++ b/server/services/ami/model/zohoAccount.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1516=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone'];(function(_0x42ec0b,_0x88176a){var _0x26577e=function(_0x4bc74a){while(--_0x4bc74a){_0x42ec0b['push'](_0x42ec0b['shift']());}};_0x26577e(++_0x88176a);}(_0x1516,0xb0));var _0x6151=function(_0x4daa32,_0x504c0b){_0x4daa32=_0x4daa32-0x0;var _0x3b7fc1=_0x1516[_0x4daa32];return _0x3b7fc1;};'use strict';function ZohoAccount(_0x508329){this['id']=_0x508329['id']||0x0;this[_0x6151('0x0')]=_0x508329[_0x6151('0x0')]||'';this['description']=_0x508329[_0x6151('0x1')]||'';this[_0x6151('0x2')]=_0x508329[_0x6151('0x2')]||'';this[_0x6151('0x3')]=_0x508329[_0x6151('0x3')]||'';this['clientId']=_0x508329[_0x6151('0x4')]||'';this['clientSecret']=_0x508329[_0x6151('0x5')]||'';this[_0x6151('0x6')]=_0x508329[_0x6151('0x6')]||'';this[_0x6151('0x7')]=_0x508329[_0x6151('0x7')]||'';this[_0x6151('0x8')]=_0x508329[_0x6151('0x8')]||'';this[_0x6151('0x9')]=_0x508329[_0x6151('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0x15f9=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x15f9,0xf7));var _0x915f=function(_0xb40411,_0x1f598c){_0xb40411=_0xb40411-0x0;var _0x44b648=_0x15f9[_0xb40411];return _0x44b648;};'use strict';function ZohoAccount(_0x4272c8){this['id']=_0x4272c8['id']||0x0;this[_0x915f('0x0')]=_0x4272c8[_0x915f('0x0')]||'';this[_0x915f('0x1')]=_0x4272c8[_0x915f('0x1')]||'';this[_0x915f('0x2')]=_0x4272c8[_0x915f('0x2')]||'';this[_0x915f('0x3')]=_0x4272c8[_0x915f('0x3')]||'';this['clientId']=_0x4272c8[_0x915f('0x4')]||'';this[_0x915f('0x5')]=_0x4272c8[_0x915f('0x5')]||'';this[_0x915f('0x6')]=_0x4272c8['serverUrl']||'';this[_0x915f('0x7')]=_0x4272c8[_0x915f('0x7')]||'';this[_0x915f('0x8')]=_0x4272c8[_0x915f('0x8')]||'';this['Configurations']=_0x4272c8[_0x915f('0x9')]||{};}module[_0x915f('0xa')]=ZohoAccount;
\ No newline at end of file
diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js
index cb9296c..b1306fe 100644
--- a/server/services/ami/preview/action.js
+++ b/server/services/ami/preview/action.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf4a=['exports','util','moment','isNil','string','uniqueid','queue','name','type','membername','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number'];(function(_0x2e397f,_0xcd3891){var _0x574023=function(_0x2d0d12){while(--_0x2d0d12){_0x2e397f['push'](_0x2e397f['shift']());}};_0x574023(++_0xcd3891);}(_0xdf4a,0x1b9));var _0xadf4=function(_0x2e958b,_0x350ebd){_0x2e958b=_0x2e958b-0x0;var _0x3d724a=_0xdf4a[_0x2e958b];return _0x3d724a;};'use strict';var util=require(_0xadf4('0x0'));var _=require('lodash');var moment=require(_0xadf4('0x1'));function checkNameSurname(_0x2194df,_0x2d843,_0x29896f){var _0x2a1d6d='';if(!_[_0xadf4('0x2')](_0x2d843)&&_0xadf4('0x3')===typeof _0x2d843){_0x2a1d6d+=_0x2d843;}if(!_['isNil'](_0x29896f)&&_0xadf4('0x3')===typeof _0x29896f){_0x2a1d6d+='\x20'+_0x29896f;}if(_0x2a1d6d!==''){return _0x2a1d6d;}return _0x2194df;}function Action(_0x1aaf42,_0xd93f3a,_0x128180,_0x2b8a98,_0x5d9b58){this[_0xadf4('0x4')]=_0x128180||undefined;this['idContact']=_0x1aaf42['id'];this[_0xadf4('0x5')]=_0xd93f3a[_0xadf4('0x6')];this[_0xadf4('0x7')]=_0xd93f3a['type'];this['campaigntype']=_0xadf4('0x5');this['dialAnswer']=![];this[_0xadf4('0x8')]=_['isNil'](_0x1aaf42[_0xadf4('0x9')])?undefined:_0x1aaf42[_0xadf4('0x9')]['name'];this['channelAgent']=this['membername']?util[_0xadf4('0xa')](_0xadf4('0xb'),this[_0xadf4('0x8')]):_0x2b8a98||undefined;this[_0xadf4('0xc')]=checkNameSurname(_0x1aaf42[_0xadf4('0xd')][_0xadf4('0xe')],_0x1aaf42[_0xadf4('0xd')][_0xadf4('0xf')],_0x1aaf42[_0xadf4('0xd')]['lastName']);this[_0xadf4('0x10')]=_0x1aaf42[_0xadf4('0x10')]||![];this[_0xadf4('0x11')]=_0x1aaf42[_0xadf4('0xd')][_0xadf4('0xe')];this['scheduledat']=_0x1aaf42['scheduledat'];this[_0xadf4('0x12')]=_0x1aaf42[_0xadf4('0x12')]||0x0;this[_0xadf4('0x13')]=_0x1aaf42[_0xadf4('0x13')]||0x0;this[_0xadf4('0x14')]=_0x1aaf42['countnoanswerretry']||0x0;this['countglobal']=(_0x1aaf42[_0xadf4('0x12')]||0x0)+(_0x1aaf42[_0xadf4('0x13')]||0x0)+(_0x1aaf42['countnoanswerretry']||0x0)+(_0x1aaf42['countnosuchnumberretry']||0x0)+(_0x1aaf42['countdropretry']||0x0)+(_0x1aaf42[_0xadf4('0x15')]||0x0)+(_0x1aaf42[_0xadf4('0x16')]||0x0)+(_0x1aaf42[_0xadf4('0x17')]||0x0);this[_0xadf4('0x18')]=_0x1aaf42[_0xadf4('0x18')]||0x0;this[_0xadf4('0x19')]=_0x1aaf42['countdropretry']||0x0;this[_0xadf4('0x15')]=_0x1aaf42[_0xadf4('0x15')]||0x0;this['countmachineretry']=_0x1aaf42[_0xadf4('0x16')]||0x0;this[_0xadf4('0x17')]=_0x1aaf42[_0xadf4('0x17')]||0x0;this[_0xadf4('0x1a')]=_0x1aaf42[_0xadf4('0x1a')];this[_0xadf4('0x1b')]=_0x1aaf42[_0xadf4('0x1b')];this[_0xadf4('0x1c')]=_0x1aaf42[_0xadf4('0x1c')];this[_0xadf4('0x1d')]=_0x1aaf42[_0xadf4('0x1d')];this[_0xadf4('0x1e')]=_0x1aaf42[_0xadf4('0x1e')];this[_0xadf4('0x1f')]=_0x1aaf42[_0xadf4('0x1f')];this[_0xadf4('0x20')]=_[_0xadf4('0x2')](_0x1aaf42[_0xadf4('0x9')])?_0x1aaf42[_0xadf4('0x20')]:_0x1aaf42[_0xadf4('0x9')]['id'];this['VoiceQueueId']=_0x1aaf42[_0xadf4('0x21')];this[_0xadf4('0x22')]='';this[_0xadf4('0x23')]='';}Action[_0xadf4('0x24')]['getCaller']=function(){return util[_0xadf4('0xa')](_0xadf4('0x25'),this[_0xadf4('0xc')],this[_0xadf4('0x26')]);};module[_0xadf4('0x27')]=Action;
\ No newline at end of file
+var _0x51ef=['VoiceQueueId','originatecalleridname','prototype','getCaller','number','util','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x1e4ac6,_0x41133f){var _0x107bd6=function(_0x4482b6){while(--_0x4482b6){_0x1e4ac6['push'](_0x1e4ac6['shift']());}};_0x107bd6(++_0x41133f);}(_0x51ef,0x188));var _0xf51e=function(_0x25ca86,_0x440921){_0x25ca86=_0x25ca86-0x0;var _0x1a022e=_0x51ef[_0x25ca86];return _0x1a022e;};'use strict';var util=require(_0xf51e('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0xf22c2e,_0x2b1386,_0x5b7a08){var _0x4a5541='';if(!_[_0xf51e('0x1')](_0x2b1386)&&_0xf51e('0x2')===typeof _0x2b1386){_0x4a5541+=_0x2b1386;}if(!_[_0xf51e('0x1')](_0x5b7a08)&&_0xf51e('0x2')===typeof _0x5b7a08){_0x4a5541+='\x20'+_0x5b7a08;}if(_0x4a5541!==''){return _0x4a5541;}return _0xf22c2e;}function Action(_0x5be366,_0x5c3f8,_0x2f2db1,_0x683871,_0x4e5fda){this[_0xf51e('0x3')]=_0x2f2db1||undefined;this[_0xf51e('0x4')]=_0x5be366['id'];this[_0xf51e('0x5')]=_0x5c3f8[_0xf51e('0x6')];this[_0xf51e('0x7')]=_0x5c3f8[_0xf51e('0x7')];this[_0xf51e('0x8')]='queue';this[_0xf51e('0x9')]=![];this[_0xf51e('0xa')]=_[_0xf51e('0x1')](_0x5be366[_0xf51e('0xb')])?undefined:_0x5be366[_0xf51e('0xb')]['name'];this[_0xf51e('0xc')]=this[_0xf51e('0xa')]?util[_0xf51e('0xd')](_0xf51e('0xe'),this[_0xf51e('0xa')]):_0x683871||undefined;this[_0xf51e('0xf')]=checkNameSurname(_0x5be366[_0xf51e('0x10')]['phone'],_0x5be366['Contact'][_0xf51e('0x11')],_0x5be366['Contact']['lastName']);this[_0xf51e('0x12')]=_0x5be366[_0xf51e('0x12')]||![];this[_0xf51e('0x13')]=_0x5be366[_0xf51e('0x10')][_0xf51e('0x14')];this[_0xf51e('0x15')]=_0x5be366['scheduledat'];this[_0xf51e('0x16')]=_0x5be366[_0xf51e('0x16')]||0x0;this[_0xf51e('0x17')]=_0x5be366[_0xf51e('0x17')]||0x0;this['countnoanswerretry']=_0x5be366['countnoanswerretry']||0x0;this[_0xf51e('0x18')]=(_0x5be366[_0xf51e('0x16')]||0x0)+(_0x5be366[_0xf51e('0x17')]||0x0)+(_0x5be366[_0xf51e('0x19')]||0x0)+(_0x5be366[_0xf51e('0x1a')]||0x0)+(_0x5be366[_0xf51e('0x1b')]||0x0)+(_0x5be366[_0xf51e('0x1c')]||0x0)+(_0x5be366[_0xf51e('0x1d')]||0x0)+(_0x5be366['countagentrejectretry']||0x0);this[_0xf51e('0x1a')]=_0x5be366[_0xf51e('0x1a')]||0x0;this[_0xf51e('0x1b')]=_0x5be366[_0xf51e('0x1b')]||0x0;this[_0xf51e('0x1c')]=_0x5be366[_0xf51e('0x1c')]||0x0;this[_0xf51e('0x1d')]=_0x5be366[_0xf51e('0x1d')]||0x0;this[_0xf51e('0x1e')]=_0x5be366['countagentrejectretry']||0x0;this[_0xf51e('0x1f')]=_0x5be366[_0xf51e('0x1f')];this[_0xf51e('0x20')]=_0x5be366['callbackuniqueid'];this[_0xf51e('0x21')]=_0x5be366['callbackat'];this[_0xf51e('0x22')]=_0x5be366[_0xf51e('0x22')];this[_0xf51e('0x23')]=_0x5be366[_0xf51e('0x23')];this[_0xf51e('0x24')]=_0x5be366[_0xf51e('0x24')];this[_0xf51e('0x25')]=_[_0xf51e('0x1')](_0x5be366['Agent'])?_0x5be366[_0xf51e('0x25')]:_0x5be366[_0xf51e('0xb')]['id'];this[_0xf51e('0x26')]=_0x5be366[_0xf51e('0x26')];this['originatecalleridnum']='';this[_0xf51e('0x27')]='';}Action[_0xf51e('0x28')][_0xf51e('0x29')]=function(){return util[_0xf51e('0xd')]('\x22%s\x22\x20<%s>',this[_0xf51e('0xf')],this[_0xf51e('0x2a')]);};module['exports']=Action;
\ No newline at end of file
diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js
index 663cc65..10d11f1 100644
--- a/server/services/ami/preview/index.js
+++ b/server/services/ami/preview/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfe71=['Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','isActive','[Preview][validateContact][Campaign\x20Active]','Is\x20Valid','trim','substring','SIP/%s/%s%s','dialCutDigit','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originateFailure][logOriginateFailure]','syncNewExten','actionid','clone','isFailure','response','unlockContact','rejected','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncDialEnd','destlinkedid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','info','stringify','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','syncCampaigns','hasOwnProperty','clearZombieChannels','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','ListId','Action','channel','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[action]','getContactRecallMe','agentReadyId','agents','then','length','scheduledat','Agent','voicePause','run','[RecallMe]','disableContact','starttime','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','catch','logger2','[getContactRecallMe]','setMessage','IsNotLoggedIn','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','countcongestionretry','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','logger','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]'];(function(_0x19c23a,_0x4f27fe){var _0xa4734=function(_0x3b0bed){while(--_0x3b0bed){_0x19c23a['push'](_0x19c23a['shift']());}};_0xa4734(++_0x4f27fe);}(_0xfe71,0x185));var _0x1fe7=function(_0x42d5b3,_0x318f43){_0x42d5b3=_0x42d5b3-0x0;var _0x16cc10=_0xfe71[_0x42d5b3];return _0x16cc10;};'use strict';var util=require(_0x1fe7('0x0'));var _=require(_0x1fe7('0x1'));var BPromise=require(_0x1fe7('0x2'));var uuid=require(_0x1fe7('0x3'));var moment=require(_0x1fe7('0x4'));var md5=require(_0x1fe7('0x5'));var Redis=require('ioredis');var config=require(_0x1fe7('0x6'));var logger=require(_0x1fe7('0x7'))(_0x1fe7('0x8'));var loggerAction=require(_0x1fe7('0x7'))(_0x1fe7('0x9'));var ami=require(_0x1fe7('0xa'));var rpcDb=require(_0x1fe7('0xb'));var Action=require(_0x1fe7('0xc'));var ut=require(_0x1fe7('0xd'));config[_0x1fe7('0xe')]=_[_0x1fe7('0xf')](config[_0x1fe7('0xe')],{'host':_0x1fe7('0x10'),'port':0x18eb});var io=require(_0x1fe7('0x11'))(new Redis(config[_0x1fe7('0xe')]));var Sequence=function(){};Sequence[_0x1fe7('0x12')][_0x1fe7('0x13')]=function(_0x44bbfd){this[_0x1fe7('0x14')]=this[_0x1fe7('0x14')]?this[_0x1fe7('0x14')][_0x1fe7('0x15')](_0x44bbfd):_0x44bbfd();};function Preview(_0x133889){this[_0x1fe7('0x16')]=new Sequence();this[_0x1fe7('0x17')]=_0x133889[_0x1fe7('0x18')];this[_0x1fe7('0x19')]=_0x133889['trunks'];this[_0x1fe7('0x1a')]={};this['agents']=_0x133889['agents'];this[_0x1fe7('0x1b')]=0x0;ami['on']('originateresponse',this[_0x1fe7('0x1c')][_0x1fe7('0x1d')](this));ami['on'](_0x1fe7('0x1e'),this[_0x1fe7('0x1f')][_0x1fe7('0x1d')](this));ami['on'](_0x1fe7('0x20'),this['syncHangupRequest'][_0x1fe7('0x1d')](this));ami['on'](_0x1fe7('0x21'),this['syncDialEnd'][_0x1fe7('0x1d')](this));ami['on'](_0x1fe7('0x22'),this['syncNewExten'][_0x1fe7('0x1d')](this));ami['on'](_0x1fe7('0x23'),this[_0x1fe7('0x24')][_0x1fe7('0x1d')](this));ami['on'](_0x1fe7('0x25'),this[_0x1fe7('0x26')][_0x1fe7('0x1d')](this));ami['on'](_0x1fe7('0x27'),this[_0x1fe7('0x28')][_0x1fe7('0x1d')](this));this[_0x1fe7('0x29')](this['campaignsPreview']);}function emit(_0x3c62bd,_0x324b50,_0x1a9278){io['to'](_0x3c62bd)[_0x1fe7('0x2a')](_0x324b50,_0x1a9278);}function emitCampaignPreview(_0x3d66cc){if(_0x3d66cc[_0x1fe7('0x2b')]===_0x1fe7('0x2c')){var _0x4da347={'id':_0x3d66cc['id'],'name':_0x3d66cc['name'],'strategy':_0x3d66cc['strategy'],'answered':_0x3d66cc['answered'],'available':_0x3d66cc[_0x1fe7('0x2d')],'loggedIn':_0x3d66cc[_0x1fe7('0x2e')],'pTalking':_0x3d66cc[_0x1fe7('0x2f')],'sumBillable':_0x3d66cc[_0x1fe7('0x30')],'sumDuration':_0x3d66cc[_0x1fe7('0x31')],'sumHoldTime':_0x3d66cc['sumHoldTime']||0x0,'talking':_0x3d66cc[_0x1fe7('0x32')],'total':_0x3d66cc[_0x1fe7('0x33')],'type':_0x3d66cc[_0x1fe7('0x2b')],'unmanaged':_0x3d66cc['unmanaged'],'abandoned':_0x3d66cc[_0x1fe7('0x34')],'waiting':_0x3d66cc[_0x1fe7('0x35')],'loggedInDb':_0x3d66cc[_0x1fe7('0x36')],'dialActive':_0x3d66cc[_0x1fe7('0x37')],'dialMethod':_0x3d66cc[_0x1fe7('0x38')],'dialOriginateCallerIdName':_0x3d66cc['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3d66cc['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3d66cc[_0x1fe7('0x39')],'dialPrefix':_0x3d66cc[_0x1fe7('0x3a')],'outboundAnswerAgiCallsDay':_0x3d66cc[_0x1fe7('0x3b')],'outboundAnswerCallsDay':_0x3d66cc[_0x1fe7('0x3c')],'outboundBlacklistCallsDay':_0x3d66cc['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3d66cc['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3d66cc[_0x1fe7('0x3d')],'outboundDropCallsDayACS':_0x3d66cc[_0x1fe7('0x3e')],'outboundDropCallsDayCallersExit':_0x3d66cc[_0x1fe7('0x3f')],'outboundDropCallsDayTimeout':_0x3d66cc[_0x1fe7('0x40')],'outboundNoAnswerCallsDay':_0x3d66cc[_0x1fe7('0x41')],'outboundNoSuchCallsDay':_0x3d66cc['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3d66cc[_0x1fe7('0x42')],'outboundReCallsDay':_0x3d66cc['outboundReCallsDay'],'outboundRejectCallsDay':_0x3d66cc['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3d66cc[_0x1fe7('0x43')],'outboundAbandonedCallsDay':_0x3d66cc[_0x1fe7('0x44')],'predictiveIntervalAnsweredCalls':_0x3d66cc['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3d66cc[_0x1fe7('0x45')],'predictiveIntervalAvgTalktime':_0x3d66cc[_0x1fe7('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x3d66cc[_0x1fe7('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x3d66cc[_0x1fe7('0x48')],'predictiveIntervalErlangCalls':_0x3d66cc['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3d66cc[_0x1fe7('0x49')],'predictiveIntervalHitRate':_0x3d66cc['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x3d66cc[_0x1fe7('0x4a')],'predictiveIntervalPauses':_0x3d66cc[_0x1fe7('0x4b')],'predictiveIntervalAvailable':_0x3d66cc[_0x1fe7('0x4c')],'predictiveIntervalTotalCalls':_0x3d66cc[_0x1fe7('0x4d')],'message':_0x3d66cc['message'],'originated':_0x3d66cc[_0x1fe7('0x4e')],'erlangCalls':_0x3d66cc[_0x1fe7('0x4f')],'erlangCallToSecond':_0x3d66cc[_0x1fe7('0x50')],'erlangAbandonmentRate':_0x3d66cc['erlangAbandonmentRate'],'erlangBusyFactor':_0x3d66cc['erlangBusyFactor'],'startPredictive':_0x3d66cc[_0x1fe7('0x51')],'startProgressive':_0x3d66cc[_0x1fe7('0x52')]};if(_0x3d66cc[_0x1fe7('0x53')]){_0x4da347[_0x1fe7('0x53')]={'id':_0x3d66cc[_0x1fe7('0x53')]['id'],'name':_0x3d66cc[_0x1fe7('0x53')][_0x1fe7('0x54')],'active':_0x3d66cc[_0x1fe7('0x53')][_0x1fe7('0x55')],'callerid':_0x3d66cc['Trunk'][_0x1fe7('0x56')]};}if(_0x3d66cc[_0x1fe7('0x57')]){_0x4da347[_0x1fe7('0x57')]={'id':_0x3d66cc['Interval']['id'],'name':_0x3d66cc[_0x1fe7('0x57')][_0x1fe7('0x54')]};}var _0xdcf6ae=md5(JSON['stringify'](_0x4da347));if(_0x3d66cc['md5']!==_0xdcf6ae){_0x3d66cc[_0x1fe7('0x5')]=_0xdcf6ae;emit(util[_0x1fe7('0x58')](_0x1fe7('0x59'),_0x4da347['name']),_0x1fe7('0x5a'),_0x4da347);}}}function emitVoiceQueueChannelRemove(_0x38cd46){logger[_0x1fe7('0x5b')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x1fe7('0x5c')](_0x38cd46));emit(util[_0x1fe7('0x58')](_0x1fe7('0x59'),_0x38cd46[_0x1fe7('0x54')]),_0x1fe7('0x5d'),_0x38cd46);}function notSendMessagesQueue(_0x3bccd1){if(_0x3bccd1[_0x1fe7('0x5e')]){if(_0x3bccd1[_0x1fe7('0x4e')]===0x0&&_0x3bccd1[_0x1fe7('0x2f')]===0x0){_0x3bccd1['sendMessageOneNotActive']=![];_0x3bccd1[_0x1fe7('0x2d')]=0x0;_0x3bccd1[_0x1fe7('0x5f')]=0x0;_0x3bccd1[_0x1fe7('0x60')]=_0x1fe7('0x61');ut['logger'](_0x1fe7('0x62'),_0x3bccd1[_0x1fe7('0x54')]+_0x1fe7('0x63'));}else{_0x3bccd1[_0x1fe7('0x60')]='IS_DISACTIVED';ut['logger'](_0x1fe7('0x62'),_0x3bccd1[_0x1fe7('0x54')]+_0x1fe7('0x64'));}emitCampaignPreview(_0x3bccd1);}}Preview[_0x1fe7('0x12')][_0x1fe7('0x29')]=function(){var _0x1600a2=this;setInterval(function(){_0x1600a2[_0x1fe7('0x65')]();},0x7cf);};Preview[_0x1fe7('0x12')]['syncCampaigns']=function(){var _0xc017b8=this[_0x1fe7('0x17')];this[_0x1fe7('0x1b')]+=0x1;for(var _0x23680e in _0xc017b8){if(_0xc017b8[_0x1fe7('0x66')](_0x23680e)&&(_0xc017b8[_0x23680e]['dialMethod']===_0x1fe7('0x8')||_0xc017b8[_0x23680e][_0x1fe7('0x38')]==='booked')&&_0xc017b8[_0x23680e][_0x1fe7('0x2b')]===_0x1fe7('0x2c')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0x1fe7('0x67')]();}}if(_0xc017b8[_0x1fe7('0x66')](_0x23680e)&&_0xc017b8[_0x23680e][_0x1fe7('0x38')]===_0x1fe7('0x8')&&_0xc017b8[_0x23680e][_0x1fe7('0x2b')]==='outbound'){if(_0xc017b8[_0x23680e][_0x1fe7('0x37')]){this['setMessage'](_0xc017b8[_0x23680e]);this[_0x1fe7('0x68')](_0xc017b8[_0x23680e]);}else{notSendMessagesQueue(_0xc017b8[_0x23680e]);}}}};Preview['prototype'][_0x1fe7('0x69')]=function(_0x54af20){var _0xcf4270=this;this['sequence']['enqueue'](function(){if(!_[_0x1fe7('0x6a')](_0xcf4270[_0x1fe7('0x1a')][_0x54af20])){loggerAction[_0x1fe7('0x5b')](_0x1fe7('0x6b'),_0x54af20,_0x1fe7('0x6c'),_0xcf4270[_0x1fe7('0x1a')][_0x54af20]['queue'],_0x1fe7('0x6d'),JSON['stringify'](_0xcf4270[_0x1fe7('0x17')][_0xcf4270[_0x1fe7('0x1a')][_0x54af20][_0x1fe7('0x6e')]]['originated']),_0x1fe7('0x6f'),JSON[_0x1fe7('0x5c')](_0xcf4270[_0x1fe7('0x17')][_0xcf4270[_0x1fe7('0x1a')][_0x54af20][_0x1fe7('0x6e')]]['pTalking']),JSON[_0x1fe7('0x5c')](_0xcf4270['actions'][_0x54af20][_0x1fe7('0x70')]),JSON[_0x1fe7('0x5c')](_[_0x1fe7('0x71')](_0xcf4270[_0x1fe7('0x1a')][_0x54af20],[_0x1fe7('0x72'),'UserId','VoiceQueueId',_0x1fe7('0x73')])));return ami[_0x1fe7('0x74')]({'action':'status','channel':_0xcf4270[_0x1fe7('0x1a')][_0x54af20][_0x1fe7('0x75')]})['catch'](function(_0x4db784){if(_0x4db784['message']===_0x1fe7('0x76')){setTimeout(function(){if(_0xcf4270[_0x1fe7('0x1a')][_0x54af20]){ut[_0x1fe7('0x77')](_0xcf4270[_0x1fe7('0x17')][_0xcf4270[_0x1fe7('0x1a')][_0x54af20][_0x1fe7('0x6e')]],'[clearZombieChannel]');if(_0xcf4270[_0x1fe7('0x1a')][_0x54af20][_0x1fe7('0x70')]===!![]){ut[_0x1fe7('0x78')](_0xcf4270[_0x1fe7('0x17')][_0xcf4270['actions'][_0x54af20][_0x1fe7('0x6e')]],_0x1fe7('0x79'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x54af20,_0xcf4270[_0x1fe7('0x1a')][_0x54af20][_0x1fe7('0x6e')]);}ut[_0x1fe7('0x7a')]('[Dialer][checkChannel][Preview]'+_0x54af20,_0xcf4270['actions'][_0x54af20][_0x1fe7('0x6e')]);delete _0xcf4270[_0x1fe7('0x1a')][_0x54af20];}},0x2328);}});}});};Preview[_0x1fe7('0x12')][_0x1fe7('0x67')]=function(){var _0x3c5e82=this;loggerAction[_0x1fe7('0x5b')](_0x1fe7('0x7b'),_['size'](this[_0x1fe7('0x1a')]));for(var _0x5355eb in this[_0x1fe7('0x1a')]){if(_0x3c5e82[_0x1fe7('0x1a')][_0x1fe7('0x66')](_0x5355eb)){_0x3c5e82[_0x1fe7('0x69')](_0x5355eb);}}};Preview[_0x1fe7('0x12')][_0x1fe7('0x68')]=function(_0x546f89){var _0x8010e9=this;rpcDb[_0x1fe7('0x7c')](_0x546f89['id'],ut[_0x1fe7('0x7d')](this[_0x1fe7('0x7e')]))[_0x1fe7('0x7f')](function(_0x136234){if(!_[_0x1fe7('0x6a')](_0x136234)){for(var _0x1a3f81=0x0;_0x1a3f81<_0x136234[_0x1fe7('0x80')];_0x1a3f81+=0x1){if(ut['getDiff'](_0x136234[_0x1a3f81][_0x1fe7('0x81')])<_0x546f89['dialRecallMeTimeout']*0x3c){if(_0x136234[_0x1a3f81][_0x1fe7('0x82')]&&!_0x136234[_0x1a3f81][_0x1fe7('0x82')][_0x1fe7('0x83')]){_0x8010e9[_0x1fe7('0x84')](_0x136234[_0x1a3f81]['id'])[_0x1fe7('0x7f')](ut['logger2'](_0x1fe7('0x85')))['catch'](ut['logger2'](_0x1fe7('0x85')));}else{rpcDb[_0x1fe7('0x86')](_0x136234[_0x1a3f81]['id']);}}else{var _0x342f03=new Action(_0x136234[_0x1a3f81],_0x546f89);_0x342f03[_0x1fe7('0x87')]=moment()[_0x1fe7('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x546f89[_0x1fe7('0x88')]+=0x1;ut[_0x1fe7('0x89')](_0x342f03,0x17,_0x1fe7('0x8a'));if(_0x546f89[_0x1fe7('0x8b')]){rpcDb['rescheduleContactInQueue'](ut[_0x1fe7('0x8c')](_0x136234[_0x1a3f81]));rpcDb[_0x1fe7('0x8d')](_0x342f03,_0x1fe7('0x8e'));}else{ut[_0x1fe7('0x89')](_0x342f03,0x16,_0x1fe7('0x8f'));rpcDb['createCustomerHistory'](_0x342f03,_0x1fe7('0x90'));rpcDb[_0x1fe7('0x91')](_0x342f03,_0x1fe7('0x90'));}}}}})[_0x1fe7('0x92')](ut[_0x1fe7('0x93')](_0x1fe7('0x94')));};Preview[_0x1fe7('0x12')][_0x1fe7('0x95')]=function(_0x4d8d1c){_0x4d8d1c[_0x1fe7('0x5e')]=!![];if(ut[_0x1fe7('0x96')](_0x4d8d1c[_0x1fe7('0x2e')])){_0x4d8d1c[_0x1fe7('0x60')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x4d8d1c[_0x1fe7('0x37')])){_0x4d8d1c['message']=_0x1fe7('0x61');}else if(!this[_0x1fe7('0x97')](_0x4d8d1c[_0x1fe7('0x53')])){if(!this[_0x1fe7('0x97')](_0x4d8d1c[_0x1fe7('0x98')])){_0x4d8d1c[_0x1fe7('0x60')]=_0x1fe7('0x99');}else{_0x4d8d1c[_0x1fe7('0x60')]=_0x1fe7('0x9a');}}else{_0x4d8d1c[_0x1fe7('0x60')]=_0x1fe7('0x9a');}emitCampaignPreview(_0x4d8d1c);};Preview[_0x1fe7('0x12')][_0x1fe7('0x9b')]=function(_0x30fb2a,_0xb954e6,_0x1f39d6){var _0x2542d5=this;var _0x24984a=this[_0x1fe7('0x1a')][_0xb954e6];var _0x2e86da=this['campaignsPreview'][_0x24984a[_0x1fe7('0x6e')]];var _0x2257ae;if(_0x2e86da){switch(_0x1f39d6){case'1':_0x2e86da[_0x1fe7('0x9c')]+=0x1;_0x24984a[_0x1fe7('0x9d')]+=0x1;_0x24984a['countglobal']=ut['totalGlobal'](_0x24984a);ut[_0x1fe7('0x89')](_0x24984a,0x0,_0x1fe7('0x9e'));ami[_0x1fe7('0x2a')](_0x1fe7('0x9f'),ut['buildObj'](_0x24984a,_0x1fe7('0xa0')));rpcDb[_0x1fe7('0x8d')](_0x24984a,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x1fe7('0xa1')](_0x24984a)>=_0x2e86da[_0x1fe7('0xa2')]){_0x2257ae=ut[_0x1fe7('0xa3')](_0x24984a,0xf,_0x1fe7('0xa4'));rpcDb[_0x1fe7('0x91')](_0x2257ae,_0x1fe7('0xa5'));}else{if(_0x24984a['countnosuchnumberretry']>=_0x2e86da[_0x1fe7('0xa6')]){rpcDb['createCustomerFinal'](_0x24984a,_0x1fe7('0xa5'));}else{rpcDb[_0x1fe7('0xa7')](ut[_0x1fe7('0xa8')](_0x24984a,_0x1fe7('0x9d'),_0x2e86da[_0x1fe7('0xa9')]),_0x24984a[_0x1fe7('0xaa')],_0x24984a['activeContact']);}}delete this[_0x1fe7('0x1a')][_0x30fb2a[_0x1fe7('0xab')]];break;case _0x1fe7('0xac'):var _0xd0d56e=moment()[_0x1fe7('0x58')](_0x1fe7('0xad'));_0x24984a[_0x1fe7('0xae')]=_0xd0d56e;_0x24984a['answertime']=_0xd0d56e;_0x24984a[_0x1fe7('0x70')]=!![];_0x2e86da[_0x1fe7('0x2f')]+=0x1;logger[_0x1fe7('0x5b')]('[syncHangup][talking][increment]',_0x24984a[_0x1fe7('0xaf')],_0x1fe7('0xb0'),_0x2e86da[_0x1fe7('0x54')],_0x1fe7('0x6f'),_0x2e86da[_0x1fe7('0x2f')]);ami[_0x1fe7('0x2a')](_0x1fe7('0xb1'),ut[_0x1fe7('0xb2')](_0x24984a,_0x1fe7('0xb3')));if(_0x2e86da[_0x1fe7('0xb4')]){ami[_0x1fe7('0x2a')](_0x1fe7('0xb5'),ut[_0x1fe7('0xb6')](_0x24984a));}break;case'16':ami[_0x1fe7('0x2a')]('custom:agentcomplete',ut[_0x1fe7('0xb2')](_0x24984a,_0x1fe7('0xb7')));emitVoiceQueueChannelRemove(ut[_0x1fe7('0xb2')](_0x24984a,_0x1fe7('0xb7')));_0x2e86da[_0x1fe7('0x3c')]+=0x1;_0x2e86da['total']+=0x1;_0x2e86da[_0x1fe7('0xb8')]+=0x1;ut[_0x1fe7('0x78')](_0x2e86da,_0x1fe7('0xb9'));_0x24984a[_0x1fe7('0xba')]=ut[_0x1fe7('0xa1')](_0x24984a);ut[_0x1fe7('0x89')](_0x24984a,0x4,_0x1fe7('0xbb'));rpcDb['createCustomerHistory'](_0x24984a,_0x1fe7('0xbc'));rpcDb[_0x1fe7('0x91')](_0x24984a,_0x1fe7('0xbd'));rpcDb[_0x1fe7('0xbe')](_0x24984a);_0x2e86da[_0x1fe7('0x31')]+=_0x24984a[_0x1fe7('0xbf')];_0x2e86da['sumBillable']+=_0x24984a[_0x1fe7('0xbf')];logger[_0x1fe7('0x5b')](_0x1fe7('0xc0'),_0x24984a[_0x1fe7('0xaf')],'\x20Queue',_0x2e86da[_0x1fe7('0x54')],_0x1fe7('0x6f'),_0x2e86da['pTalking']);delete this['actions'][_0x30fb2a[_0x1fe7('0xab')]];break;case _0x1fe7('0xc1'):_0x2e86da[_0x1fe7('0xc2')]+=0x1;_0x24984a[_0x1fe7('0xc3')]+=0x1;_0x24984a[_0x1fe7('0xba')]=ut[_0x1fe7('0xa1')](_0x24984a);ut[_0x1fe7('0x89')](_0x24984a,0x5,_0x1fe7('0xc4'));ami[_0x1fe7('0x2a')](_0x1fe7('0xc5'),ut[_0x1fe7('0xb2')](_0x24984a,_0x1fe7('0xc6')));rpcDb[_0x1fe7('0x8d')](_0x24984a,_0x1fe7('0xc7'));if(ut['totalGlobal'](_0x24984a)>=_0x2e86da[_0x1fe7('0xa2')]){_0x2257ae=ut[_0x1fe7('0xa3')](_0x24984a,0xf,_0x1fe7('0xa4'));rpcDb['createCustomerFinal'](_0x2257ae,_0x1fe7('0xc8'));}else{if(_0x24984a[_0x1fe7('0xc3')]>=_0x2e86da[_0x1fe7('0xc9')]){rpcDb[_0x1fe7('0x91')](_0x24984a,_0x1fe7('0xc7'));}else{rpcDb[_0x1fe7('0xa7')](ut[_0x1fe7('0xa8')](_0x24984a,_0x1fe7('0xc3'),_0x2e86da['dialBusyRetryFrequency']),_0x24984a[_0x1fe7('0xaa')],_0x24984a[_0x1fe7('0xca')]);}}break;case _0x1fe7('0xcb'):_0x2e86da[_0x1fe7('0x41')]+=0x1;_0x24984a[_0x1fe7('0xcc')]+=0x1;_0x24984a['countglobal']=ut[_0x1fe7('0xa1')](_0x24984a);ut[_0x1fe7('0x89')](_0x24984a,0x3,_0x1fe7('0xcd'));ami[_0x1fe7('0x2a')](_0x1fe7('0xce'),ut[_0x1fe7('0xb2')](_0x24984a,_0x1fe7('0xcf')));rpcDb['createCustomerHistory'](_0x24984a,_0x1fe7('0xd0'));if(ut[_0x1fe7('0xa1')](_0x24984a)>=_0x2e86da['dialGlobalMaxRetry']){_0x2257ae=ut[_0x1fe7('0xa3')](_0x24984a,0xf,_0x1fe7('0xa4'));rpcDb['createCustomerFinal'](_0x2257ae,_0x1fe7('0xd1'));}else{if(_0x24984a[_0x1fe7('0xcc')]>=_0x2e86da['dialNoAnswerMaxRetry']){rpcDb[_0x1fe7('0x91')](_0x24984a,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x1fe7('0xa7')](ut[_0x1fe7('0xa8')](_0x24984a,_0x1fe7('0xcc'),_0x2e86da['dialNoAnswerRetryFrequency']),_0x24984a[_0x1fe7('0xaa')],_0x24984a['activeContact']);}}break;case _0x1fe7('0xd2'):_0x2e86da[_0x1fe7('0x3d')]+=0x1;_0x24984a[_0x1fe7('0xd3')]+=0x1;_0x24984a['countglobal']=ut[_0x1fe7('0xa1')](_0x24984a);ut[_0x1fe7('0x89')](_0x24984a,0x8,'Congestion');ami[_0x1fe7('0x2a')]('custom:agentcongestion',ut[_0x1fe7('0xb2')](_0x24984a,_0x1fe7('0xd4')));rpcDb[_0x1fe7('0x8d')](_0x24984a,_0x1fe7('0xd5'));if(ut[_0x1fe7('0xa1')](_0x24984a)>=_0x2e86da[_0x1fe7('0xa2')]){_0x2257ae=ut[_0x1fe7('0xa3')](_0x24984a,0xf,_0x1fe7('0xa4'));rpcDb[_0x1fe7('0x91')](_0x2257ae,_0x1fe7('0xd6'));}else{if(_0x24984a['countcongestionretry']>=_0x2e86da['dialCongestionMaxRetry']){rpcDb[_0x1fe7('0x91')](_0x24984a,_0x1fe7('0xd5'));}else{rpcDb[_0x1fe7('0xa7')](ut[_0x1fe7('0xa8')](_0x24984a,_0x1fe7('0xd3'),_0x2e86da[_0x1fe7('0xd7')]),_0x24984a[_0x1fe7('0xaa')],_0x24984a[_0x1fe7('0xca')]);}}break;case'CANCEL':_0x2e86da[_0x1fe7('0xd8')]+=0x1;_0x24984a[_0x1fe7('0xd9')]+=0x1;_0x24984a['countglobal']=ut[_0x1fe7('0xa1')](_0x24984a);ut[_0x1fe7('0x89')](_0x24984a,0x14,_0x1fe7('0xda'));ami['emit'](_0x1fe7('0xdb'),ut[_0x1fe7('0xb2')](_0x24984a,_0x1fe7('0xdc')));rpcDb[_0x1fe7('0x8d')](_0x24984a,_0x1fe7('0xdd'));if(ut[_0x1fe7('0xa1')](_0x24984a)>=_0x2e86da['dialGlobalMaxRetry']){_0x2257ae=ut[_0x1fe7('0xa3')](_0x24984a,0x14,_0x1fe7('0xda'));rpcDb[_0x1fe7('0x91')](_0x2257ae,_0x1fe7('0xde'));}else{if(_0x24984a[_0x1fe7('0xd9')]>=_0x2e86da[_0x1fe7('0xdf')]){rpcDb[_0x1fe7('0x91')](_0x24984a,_0x1fe7('0xde'));}else{rpcDb[_0x1fe7('0xa7')](ut['scheduledAt'](_0x24984a,'countagentrejectretry',_0x2e86da[_0x1fe7('0xe0')]),_0x24984a[_0x1fe7('0xaa')],_0x24984a[_0x1fe7('0xca')]);}}break;case _0x1fe7('0xe1'):_0x2e86da['outboundAbandonedCallsDay']+=0x1;_0x24984a[_0x1fe7('0xe2')]+=0x1;_0x24984a['countglobal']=ut['totalGlobal'](_0x24984a);ut[_0x1fe7('0x89')](_0x24984a,0xb,_0x1fe7('0xe3'));rpcDb[_0x1fe7('0x8d')](_0x24984a,_0x1fe7('0xe4'));if(ut[_0x1fe7('0xa1')](_0x24984a)>=_0x2e86da['dialGlobalMaxRetry']){_0x2257ae=ut[_0x1fe7('0xa3')](_0x24984a,0xf,_0x1fe7('0xa4'));rpcDb[_0x1fe7('0x91')](_0x2257ae,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x24984a['countabandonedetry']>=_0x2e86da[_0x1fe7('0xe5')]){rpcDb[_0x1fe7('0x91')](_0x24984a,_0x1fe7('0xe4'));}else{rpcDb[_0x1fe7('0xa7')](ut[_0x1fe7('0xa8')](_0x24984a,'countabandonedretry',_0x2e86da['dialAbandonedRetryFrequency']),_0x24984a[_0x1fe7('0xaa')],_0x24984a[_0x1fe7('0xca')]);}}break;default:if(_0x24984a['dialAnswer']){ut[_0x1fe7('0x78')](_0x2e86da,_0x1fe7('0xe6'));ut[_0x1fe7('0x7a')](_0x1fe7('0xe7')+_0x2e86da[_0x1fe7('0x54')],_0x30fb2a);}_0x2e86da['outboundUnknownCallsDay']+=0x1;_0x24984a[_0x1fe7('0xba')]=ut[_0x1fe7('0xa1')](_0x24984a);ut[_0x1fe7('0x89')](_0x24984a,0xc,_0x30fb2a['cause-txt']||_0x30fb2a[_0x1fe7('0xe8')]);rpcDb[_0x1fe7('0x8d')](_0x24984a,_0x1fe7('0xe9'));if(ut[_0x1fe7('0xa1')](_0x24984a)>=_0x2e86da['dialGlobalMaxRetry']){_0x2257ae=ut[_0x1fe7('0xa3')](_0x24984a,0xf,_0x1fe7('0xa4'));rpcDb[_0x1fe7('0x91')](_0x2257ae,_0x1fe7('0xea'));}else{rpcDb[_0x1fe7('0x91')](_0x24984a,_0x1fe7('0xea'));}delete this[_0x1fe7('0x1a')][_0x30fb2a[_0x1fe7('0xab')]];}if(!(_0x24984a[_0x1fe7('0x70')]&&_0x1f39d6==='16')){ut['updateOriginated'](_0x2e86da,'[callProgressDetectingCustomer]');logger[_0x1fe7('0x5b')](_0x1fe7('0xeb'),_0x24984a[_0x1fe7('0xaf')],_0x1fe7('0xb0'),_0x2e86da['name'],_0x1fe7('0x6d'),_0x2e86da[_0x1fe7('0x4e')]);}if(_0x1f39d6!==_0x1fe7('0xac')){delete this[_0x1fe7('0x1a')][_0x30fb2a[_0x1fe7('0xab')]];delete this[_0x1fe7('0x1a')][_0x30fb2a['destlinkedid']];}}};Preview[_0x1fe7('0x12')][_0x1fe7('0xec')]=function(_0x2338a1,_0x4b27fd,_0x4364bb){if(_[_0x1fe7('0xed')](_0x4b27fd)&&_0x1fe7('0xee')!==typeof _0x4b27fd){return;}if(_[_0x1fe7('0xed')](_0x4364bb)&&'object'!==typeof _0x4364bb){return;}switch(_0x4364bb[_0x1fe7('0xef')]){case'0':ut[_0x1fe7('0xf0')](_0x2338a1,0x0,_0x1fe7('0x9e'));rpcDb[_0x1fe7('0xf1')](_0x2338a1,_0x1fe7('0xf2'));break;case'3':ut[_0x1fe7('0xf0')](_0x2338a1,0x3,'NoAnswer');rpcDb[_0x1fe7('0xf1')](_0x2338a1,_0x1fe7('0xf3'));break;case'5':ut[_0x1fe7('0xf0')](_0x2338a1,0x5,_0x1fe7('0xc4'));rpcDb[_0x1fe7('0xf1')](_0x2338a1,_0x1fe7('0xf4'));break;case'8':ut[_0x1fe7('0xf0')](_0x2338a1,0x8,_0x1fe7('0xf5'));rpcDb[_0x1fe7('0xf1')](_0x2338a1,_0x1fe7('0xf6'));break;case'22':ut[_0x1fe7('0xf0')](_0x2338a1,0x16,_0x1fe7('0xf7'));rpcDb[_0x1fe7('0xf1')](_0x2338a1,_0x1fe7('0xf8'));break;default:ut[_0x1fe7('0xf0')](_0x2338a1,0xc,_0x4364bb[_0x1fe7('0xef')]);rpcDb[_0x1fe7('0xf1')](_0x2338a1,_0x1fe7('0xf6'));}ut[_0x1fe7('0x77')](_0x4b27fd,_0x1fe7('0xf9'));logger[_0x1fe7('0x5b')]('[originated][decrement][callProgressDetectingAgent]',_0x2338a1[_0x1fe7('0xaf')],'\x20Queue',_0x4b27fd[_0x1fe7('0x54')],_0x1fe7('0x6d'),_0x4b27fd[_0x1fe7('0x4e')]);delete this[_0x1fe7('0x1a')][_0x2338a1[_0x1fe7('0xaf')]];};Preview['prototype'][_0x1fe7('0xfa')]=function(_0x1e7ddf,_0x2cd3a3,_0x539908,_0x1ed2e9,_0x46a17e){var _0x2edb60=this;return new BPromise(function(_0x103cf5,_0x22a533){if(_[_0x1fe7('0x6a')](_0x2cd3a3)||_['isNil'](_0x2cd3a3[_0x1fe7('0xfb')])||_['isNil'](_0x2cd3a3[_0x1fe7('0xfb')][_0x1fe7('0xfc')])||_['isNil'](_0x2cd3a3[_0x1fe7('0xfd')])){_0x22a533(ut[_0x1fe7('0x60')](_0x1fe7('0xfe'),_0x1ed2e9,_0x46a17e));return;}var _0x5c2509=uuid['v4']();var _0x2f0a3c=_0x2edb60['campaignsPreview'][_0x2cd3a3[_0x1fe7('0x6c')][_0x1fe7('0x54')]];var _0x181e94=_0x539908?_0x2edb60['agents'][_0x539908]['id']:undefined;_0x2edb60[_0x1fe7('0x1a')][_0x5c2509]=new Action(_0x2cd3a3,_0x2f0a3c,_0x5c2509,_0x539908,_0x181e94);var _0x2d2486=_0x2edb60[_0x1fe7('0x1a')][_0x5c2509];_0x2d2486[_0x1fe7('0xaa')]=_0x1ed2e9;_0x2d2486[_0x1fe7('0xca')]=_0x46a17e;_0x2d2486[_0x1fe7('0xff')]=_0x539908;if(_['isEmpty'](_0x1e7ddf)){_0x2edb60[_0x1fe7('0x100')](_0x2d2486,_0x2f0a3c,_0x2cd3a3,_0x539908)[_0x1fe7('0x7f')](function(_0x1e0686){logger['info']('[Preview][execCall][success]',_0x1fe7('0x101')+_0x2d2486[_0x1fe7('0x6e')]+_0x1fe7('0x102')+_0x2d2486[_0x1fe7('0x103')],JSON[_0x1fe7('0x5c')](_0x1e0686));ami[_0x1fe7('0x2a')](_0x1fe7('0x104'),ut[_0x1fe7('0xb2')](_0x2d2486,'called'));_0x103cf5(ut[_0x1fe7('0x60')](_0x1fe7('0x105')));})['catch'](function(_0x3d6f61){ut[_0x1fe7('0x106')](_0x1fe7('0x107'),_0x3d6f61);_0x22a533(ut[_0x1fe7('0x60')](_0x1fe7('0x108'),_0x1ed2e9,_0x46a17e));});}else{_0x2f0a3c['outboundBlacklistCallsDay']+=0x1;ut[_0x1fe7('0x109')](_0x2d2486);rpcDb[_0x1fe7('0x10a')](_0x2d2486,_0x1fe7('0x10b'));delete _0x2edb60[_0x1fe7('0x1a')][_0x5c2509];_0x22a533(ut[_0x1fe7('0x60')](_0x1fe7('0x10c'),_0x1ed2e9,_0x46a17e));}});};Preview['prototype'][_0x1fe7('0x97')]=function(_0x13a9e5){return!_['isNil'](_0x13a9e5)&&!_['isNil'](_0x13a9e5[_0x1fe7('0x54')])&&!_[_0x1fe7('0x6a')](_0x13a9e5[_0x1fe7('0x55')])&&_0x13a9e5[_0x1fe7('0x55')]&&!_[_0x1fe7('0x6a')](this[_0x1fe7('0x19')][util[_0x1fe7('0x58')]('SIP/%s',_0x13a9e5[_0x1fe7('0x54')])])&&!_['isNil'](this[_0x1fe7('0x19')][util[_0x1fe7('0x58')](_0x1fe7('0x10d'),_0x13a9e5['name'])][_0x1fe7('0x10e')])&&(this[_0x1fe7('0x19')][util[_0x1fe7('0x58')](_0x1fe7('0x10d'),_0x13a9e5[_0x1fe7('0x54')])][_0x1fe7('0x10e')]==='reachable'||this[_0x1fe7('0x19')][util['format'](_0x1fe7('0x10d'),_0x13a9e5[_0x1fe7('0x54')])]['status']===_0x1fe7('0x10f'));};Preview['prototype']['run']=function(_0x2d28ee,_0x558ac4){var _0x3fe32e=this;return new BPromise(function(_0x235b87,_0x55ca81){_0x3fe32e[_0x1fe7('0x110')](_0x2d28ee,_0x558ac4)[_0x1fe7('0x7f')](function(_0x3bcb8a){_0x235b87(_[_0x1fe7('0x71')](_0x3bcb8a,[_0x1fe7('0x60')]));})['catch'](function(_0x336d52){if(_0x336d52[_0x1fe7('0x111')]){rpcDb['unlockContact'](_0x2d28ee);}if(_0x336d52['active']){rpcDb[_0x1fe7('0x86')](_0x2d28ee);}_0x55ca81(_[_0x1fe7('0x71')](_0x336d52,[_0x1fe7('0x60')]));});});};Preview[_0x1fe7('0x12')][_0x1fe7('0x110')]=function(_0x22dcbc,_0x268292){var _0x295111=this;return new BPromise(function(_0x378431,_0x4d6902){var _0x5f475e,_0xe0bfde;rpcDb[_0x1fe7('0x112')](_0x22dcbc)[_0x1fe7('0x7f')](function(_0x2f9242){if(!_['isNil'](_0x2f9242[0x0])){_0xe0bfde=_0x2f9242[0x0][_0x1fe7('0x113')]?![]:!![];_0x5f475e=_0x2f9242[0x0]['recallme']?!![]:![];_0x5f475e=_0x268292?!![]:_0x5f475e;}var _0x2206d7=_0x295111[_0x1fe7('0x114')](_0x2f9242);if(_0x2206d7[_0x1fe7('0x115')]){rpcDb[_0x1fe7('0x116')](_['pick'](_0x2f9242[0x0],[_0x1fe7('0xfd'),'Contact.phone']))[_0x1fe7('0x7f')](function(_0x31637c){_0x295111['checkInBlack'](_0x31637c,_0x2f9242[0x0],_0x268292,_0xe0bfde,_0x5f475e)[_0x1fe7('0x7f')](function(_0x27bf4d){_0x378431(_0x27bf4d);})['catch'](function(_0x120e35){_0x4d6902(_0x120e35);});})['catch'](function(_0x3f5de4){ut['logger'](_0x1fe7('0x117'),_0x3f5de4);_0x4d6902(ut[_0x1fe7('0x60')](_0x1fe7('0x118'),_0xe0bfde,_0x5f475e));});}else{_0x4d6902(ut['message'](_0x2206d7[_0x1fe7('0x60')],_0xe0bfde,_0x5f475e));}})[_0x1fe7('0x92')](function(_0x2720ea){ut[_0x1fe7('0x106')](_0x1fe7('0x119'),_0x2720ea);_0x4d6902(ut[_0x1fe7('0x60')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x1fe7('0x12')]['validateContact']=function(_0x114e29){if(_[_0x1fe7('0x6a')](_0x114e29)||_[_0x1fe7('0x11a')](_0x114e29)||!_[_0x1fe7('0x6a')](_0x114e29[0x0]['Agent'])&&_[_0x1fe7('0x6a')](_0x114e29[0x0][_0x1fe7('0x82')][_0x1fe7('0x54')])){ut[_0x1fe7('0x106')]('[Preview][validateContact][Empty\x20Contact]',_0x114e29);return{'isValid':![],'message':_0x1fe7('0x11b')};}var _0x1c2223=this['campaignsPreview'][_0x114e29[0x0][_0x1fe7('0x6c')][_0x1fe7('0x54')]];_0x1c2223['message']=_0x1fe7('0x9a');if(_[_0x1fe7('0x6a')](_0x1c2223)){ut[_0x1fe7('0x106')](_0x1fe7('0x11c'),_0x1c2223);return{'isValid':![],'message':_0x1fe7('0x11d')};}if(!this[_0x1fe7('0x97')](_0x1c2223['Trunk'])){ut[_0x1fe7('0x106')](_0x1fe7('0x11e'),'campaign\x20Name:\x20'+_0x1c2223[_0x1fe7('0x54')]+_0x1fe7('0x11f'));if(!this[_0x1fe7('0x97')](_0x1c2223[_0x1fe7('0x98')])){ut[_0x1fe7('0x106')](_0x1fe7('0x11e'),_0x1c2223['name']+_0x1fe7('0x120'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x1fe7('0x121')](_0x1c2223[_0x1fe7('0x37')])){ut[_0x1fe7('0x106')](_0x1fe7('0x122'),_0x1c2223['name']+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1c2223[_0x1fe7('0x54')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x1fe7('0x123')};};Preview['prototype'][_0x1fe7('0x100')]=function(_0x34e35a,_0x1902d3,_0x8d791f,_0x540dec){var _0x1bb3b7=this;return new BPromise(function(_0xab5623,_0x2c1324){var _0x333450=_0x34e35a[_0x1fe7('0xaf')];var _0x4e56f4=_0x1bb3b7[_0x1fe7('0x97')](_0x1902d3[_0x1fe7('0x53')])?util[_0x1fe7('0x58')]('SIP/%s/%s%s',_0x1902d3[_0x1fe7('0x53')][_0x1fe7('0x54')],_[_0x1fe7('0x6a')](_0x1902d3[_0x1fe7('0x3a')])?'':_0x1902d3[_0x1fe7('0x3a')][_0x1fe7('0x124')]()||'',_0x1902d3['dialCutDigit']>0x0?_0x8d791f[_0x1fe7('0xfb')]['phone'][_0x1fe7('0x125')](_0x1902d3['dialCutDigit']):_0x8d791f[_0x1fe7('0xfb')][_0x1fe7('0xfc')]):util[_0x1fe7('0x58')](_0x1fe7('0x126'),_[_0x1fe7('0x6a')](_0x1902d3[_0x1fe7('0x98')])?_0x1902d3[_0x1fe7('0x53')][_0x1fe7('0x54')]:_0x1902d3[_0x1fe7('0x98')]['name'],_[_0x1fe7('0x6a')](_0x1902d3[_0x1fe7('0x3a')])?'':_0x1902d3[_0x1fe7('0x3a')]['trim']()||'',_0x1902d3[_0x1fe7('0x127')]>0x0?_0x8d791f[_0x1fe7('0xfb')][_0x1fe7('0xfc')]['substring'](_0x1902d3[_0x1fe7('0x127')]):_0x8d791f[_0x1fe7('0xfb')][_0x1fe7('0xfc')]);var _0x4d7f42=_0x1bb3b7[_0x1fe7('0x97')](_0x1902d3[_0x1fe7('0x53')])?ut[_0x1fe7('0x128')](_0x1902d3['Trunk'][_0x1fe7('0x56')],_0x1902d3[_0x1fe7('0x129')],_0x1902d3[_0x1fe7('0x12a')]>0x0?ut['getCallerIdRandom'](_0x1902d3[_0x1fe7('0x12b')],_0x1902d3['dialRandomLastDigitCallerIdNumber']):_0x1902d3['dialOriginateCallerIdNumber']):ut[_0x1fe7('0x128')](_[_0x1fe7('0x6a')](_0x1902d3['TrunkBackup'])?_0x1902d3[_0x1fe7('0x53')][_0x1fe7('0x56')]:_0x1902d3[_0x1fe7('0x98')][_0x1fe7('0x56')],_0x1902d3['dialOriginateCallerIdName'],_0x1902d3['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x1fe7('0x12c')](_0x1902d3['dialOriginateCallerIdNumber'],_0x1902d3[_0x1fe7('0x12a')]):_0x1902d3['dialOriginateCallerIdNumber']);if(_0x4d7f42){_0x34e35a['originatecalleridname']=ut[_0x1fe7('0x12d')](_0x4d7f42);_0x34e35a[_0x1fe7('0x12e')]=ut[_0x1fe7('0x12f')](_0x4d7f42);}var _0xa9228c=ut[_0x1fe7('0x130')](_0x1902d3,_0x8d791f,_0x4e56f4,_0x4d7f42,_0x333450,_0x34e35a);_[_0x1fe7('0x131')](_0x34e35a,ut[_0x1fe7('0x132')](_0xa9228c));_0x34e35a['starttime']=moment()[_0x1fe7('0x58')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x1fe7('0x74')](ut[_0x1fe7('0x133')](_0x34e35a,_0x1902d3,_0xa9228c,_0x34e35a['activeContact'],_0x540dec))[_0x1fe7('0x7f')](function(_0x49d1ca){_0x1902d3[_0x1fe7('0x4e')]+=0x1;logger[_0x1fe7('0x5b')]('[originated][increment]',_0x333450,_0x1fe7('0xb0'),_0x1902d3[_0x1fe7('0x54')],'originated:\x20',_0x1902d3[_0x1fe7('0x4e')]);_0xab5623(_0x49d1ca);})['catch'](function(_0x56b0ab){ut[_0x1fe7('0xf0')](_0x34e35a,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x34e35a,_0x1fe7('0x134'));_0x2c1324(_0x56b0ab);});});};Preview[_0x1fe7('0x12')][_0x1fe7('0x135')]=function(_0xa8cb37){if(this[_0x1fe7('0x1a')][_0xa8cb37[_0x1fe7('0xab')]]){this[_0x1fe7('0x1a')][_0xa8cb37['linkedid']]['channel']=_0xa8cb37[_0x1fe7('0x75')];}};Preview['prototype']['syncOriginateResponse']=function(_0x4a8f48){var _0x1603d1=this;var _0x6c8441=this[_0x1fe7('0x1a')][_0x4a8f48[_0x1fe7('0x136')]];if(_0x6c8441){if(_0x6c8441[_0x1fe7('0xff')]&&this[_0x1fe7('0x7e')][_0x6c8441[_0x1fe7('0xff')]]){ut['logLookAgent'](_0x6c8441,this[_0x1fe7('0x7e')][_0x6c8441['lookAgent']][_0x1fe7('0x54')],this[_0x1fe7('0x7e')][_0x6c8441[_0x1fe7('0xff')]]['id']);}var _0x26aa15=_[_0x1fe7('0x137')](_0x6c8441);_0x26aa15[_0x1fe7('0xae')]=moment()['format'](_0x1fe7('0xad'));var _0x539490=_0x1603d1[_0x1fe7('0x17')][_0x6c8441[_0x1fe7('0x6e')]];if(ut[_0x1fe7('0x138')](_0x4a8f48[_0x1fe7('0x139')])){if(_0x6c8441[_0x1fe7('0xaa')]){rpcDb[_0x1fe7('0x13a')](_0x6c8441['idContact']);}if(_0x6c8441[_0x1fe7('0xca')]){rpcDb[_0x1fe7('0x86')](_0x6c8441[_0x1fe7('0x103')]);}ami[_0x1fe7('0x2a')]('custom:agentringnoanswer',ut[_0x1fe7('0xb2')](_0x6c8441,_0x1fe7('0x13b')));this[_0x1fe7('0xec')](_0x26aa15,_0x539490,_0x4a8f48);}else{_0x6c8441[_0x1fe7('0x87')]=moment()[_0x1fe7('0x58')](_0x1fe7('0xad'));ut[_0x1fe7('0xf0')](_0x26aa15,0x4,_0x1fe7('0xbb'));rpcDb[_0x1fe7('0xf1')](_0x26aa15,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x1fe7('0x12')][_0x1fe7('0x1f')]=function(_0x248a25){var _0x2253f1=this;var _0x3347e4=this[_0x1fe7('0x1a')][_0x248a25[_0x1fe7('0xab')]];var _0x1a9796;if(_0x3347e4){_0x1a9796=this['campaignsPreview'][_0x3347e4['queue']];logger[_0x1fe7('0x5b')](_0x1fe7('0x13c'),_0x248a25[_0x1fe7('0xab')],_0x1fe7('0xb0'),_0x1a9796[_0x1fe7('0x54')],_0x1fe7('0x6f'),_0x1a9796[_0x1fe7('0x2f')]);}if(this['actions'][_0x248a25[_0x1fe7('0xab')]]&&_0x248a25[_0x1fe7('0xab')]!==_0x248a25[_0x1fe7('0xaf')]){if(_0x248a25[_0x1fe7('0x13d')]==='16'&&this[_0x1fe7('0x1a')][_0x248a25['linkedid']]['dialAnswer']){this[_0x1fe7('0x9b')](_0x248a25,_0x248a25[_0x1fe7('0xab')],_0x248a25[_0x1fe7('0x13d')]);}else if(this[_0x1fe7('0x1a')][_0x248a25[_0x1fe7('0xab')]][_0x1fe7('0x70')]){logger[_0x1fe7('0x5b')]('[syncHangup][talking][cause]',_0x248a25[_0x1fe7('0xab')],_0x248a25['cause'],'\x20Queue',_0x1a9796[_0x1fe7('0x54')],'pTalking:\x20',_0x1a9796['pTalking']);this[_0x1fe7('0x9b')](_0x248a25,_0x248a25[_0x1fe7('0xab')],_0x248a25['cause']);}}else if(_0x3347e4&&_['isNil'](_0x3347e4[_0x1fe7('0x13e')])&&_0x1a9796[_0x1fe7('0x13f')]&&_0x248a25[_0x1fe7('0xab')]===_0x248a25['uniqueid']&&_[_0x1fe7('0x6a')](_0x248a25[_0x1fe7('0xef')])&&_0x248a25[_0x1fe7('0x13d')]==='16'&&_0x248a25['channelstate']==='6'&&_['isUndefined'](_0x3347e4['transfer'])){if(_0x3347e4[_0x1fe7('0xaa')]){rpcDb[_0x1fe7('0x13a')](_0x3347e4[_0x1fe7('0x103')]);}if(_0x3347e4[_0x1fe7('0xca')]){rpcDb[_0x1fe7('0x86')](_0x3347e4[_0x1fe7('0x103')]);}_0x248a25[_0x1fe7('0xef')]='22';this[_0x1fe7('0xec')](_0x3347e4,_0x1a9796,_0x248a25);}else if(_0x3347e4&&_0x3347e4[_0x1fe7('0x140')]){if(_0x248a25[_0x1fe7('0x13d')]==='16'&&this['actions'][_0x248a25[_0x1fe7('0xab')]]['dialAnswer']){logger[_0x1fe7('0x5b')](_0x1fe7('0x141'),_0x248a25[_0x1fe7('0xab')],_0x248a25[_0x1fe7('0x13d')],_0x1fe7('0xb0'),_0x1a9796[_0x1fe7('0x54')],_0x1fe7('0x6f'),_0x1a9796[_0x1fe7('0x2f')]);this[_0x1fe7('0x9b')](_0x248a25,_0x248a25['linkedid'],_0x248a25[_0x1fe7('0x13d')]);}else if(this[_0x1fe7('0x1a')][_0x248a25['linkedid']][_0x1fe7('0x70')]){logger['info'](_0x1fe7('0x142'),_0x248a25[_0x1fe7('0xab')],_0x248a25[_0x1fe7('0x13d')],'\x20Queue',_0x1a9796[_0x1fe7('0x54')],_0x1fe7('0x6f'),_0x1a9796['pTalking']);this[_0x1fe7('0x9b')](_0x248a25,_0x248a25[_0x1fe7('0xab')],_0x248a25[_0x1fe7('0x13d')]);}}};Preview['prototype'][_0x1fe7('0x143')]=function(_0x2f9023){if(this[_0x1fe7('0x1a')][_0x2f9023['destlinkedid']]&&_0x2f9023[_0x1fe7('0x144')]!==_0x2f9023['destuniqueid']){this['callProgressDetectingCustomer'](_0x2f9023,_0x2f9023['destlinkedid'],_0x2f9023['dialstatus']);}};Preview['prototype'][_0x1fe7('0x145')]=function(_0x2921b5){if(this[_0x1fe7('0x1a')][_0x2921b5['linkedid']]&&_0x2921b5[_0x1fe7('0xab')]!==_0x2921b5['uniqueid']&&!this['actions'][_0x2921b5[_0x1fe7('0xab')]][_0x1fe7('0x70')]){if(_0x2921b5[_0x1fe7('0x13d')]==='1'){this['callProgressDetectingCustomer'](_0x2921b5,_0x2921b5[_0x1fe7('0xab')],_0x2921b5[_0x1fe7('0x13d')]);}}};Preview[_0x1fe7('0x12')][_0x1fe7('0x146')]=function(_0x3e56f2,_0x5d3e6a,_0x184765){if(this['actions'][_0x3e56f2]){if(_[_0x1fe7('0x6a')](this[_0x1fe7('0x1a')][_0x3e56f2][_0x1fe7('0x147')])){this[_0x1fe7('0x1a')][_0x3e56f2][_0x1fe7('0x147')]={};}this[_0x1fe7('0x1a')][_0x3e56f2][_0x1fe7('0x147')][_0x5d3e6a]=_0x184765;}};Preview[_0x1fe7('0x12')][_0x1fe7('0x24')]=function(_0x29f0be){try{if(!_['isNil'](_0x29f0be)){if(ut[_0x1fe7('0x148')](_[_0x1fe7('0x149')](_0x29f0be[_0x1fe7('0x14a')])[0x0])){this[_0x1fe7('0x146')](_0x29f0be[_0x1fe7('0xaf')],_['keys'](_0x29f0be[_0x1fe7('0x14a')])[0x0],_0x29f0be[_0x1fe7('0x14b')]);}}}catch(_0x5c3e5e){logger[_0x1fe7('0x14c')](_0x1fe7('0x14d'),util[_0x1fe7('0x14e')](_0x5c3e5e,{'showHidden':![],'depth':null}));}};Preview[_0x1fe7('0x12')]['syncAttendedTransfer']=function(_0x55ce42){if(_0x55ce42){if(this[_0x1fe7('0x1a')][_0x55ce42[_0x1fe7('0x14f')]]){this[_0x1fe7('0x1a')][_0x55ce42[_0x1fe7('0x14f')]]['transfer']=!![];}}};Preview[_0x1fe7('0x12')][_0x1fe7('0x28')]=function(_0x106058){if(_0x106058){if(this['actions'][_0x106058[_0x1fe7('0x150')]]){this[_0x1fe7('0x1a')][_0x106058[_0x1fe7('0x150')]]['transfer']=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0x9ff1=['countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialGlobalMaxRetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','logAgent','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','run','unlock','unlockContact','pick','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialCutDigit','substring','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','starttime','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','channelstate','destuniqueid','addVariable','variables','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','campaignsPreview','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','Interval','stringify','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','clockClearZombieChannels','hasOwnProperty','booked','type','clearZombieChannels','dialActive','setMessage','recallMe','enqueue','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED'];(function(_0x3315d8,_0xb1e6e1){var _0x50df0a=function(_0x4f14c4){while(--_0x4f14c4){_0x3315d8['push'](_0x3315d8['shift']());}};_0x50df0a(++_0xb1e6e1);}(_0x9ff1,0x1bb));var _0x19ff=function(_0x3193c8,_0x556edb){_0x3193c8=_0x3193c8-0x0;var _0x37dc84=_0x9ff1[_0x3193c8];return _0x37dc84;};'use strict';var util=require(_0x19ff('0x0'));var _=require(_0x19ff('0x1'));var BPromise=require(_0x19ff('0x2'));var uuid=require(_0x19ff('0x3'));var moment=require(_0x19ff('0x4'));var md5=require(_0x19ff('0x5'));var Redis=require(_0x19ff('0x6'));var config=require('../../../config/environment');var logger=require(_0x19ff('0x7'))(_0x19ff('0x8'));var loggerAction=require(_0x19ff('0x7'))(_0x19ff('0x9'));var ami=require(_0x19ff('0xa'));var rpcDb=require(_0x19ff('0xb'));var Action=require('./action');var ut=require('./util/util');config[_0x19ff('0xc')]=_['defaults'](config['redis'],{'host':_0x19ff('0xd'),'port':0x18eb});var io=require(_0x19ff('0xe'))(new Redis(config[_0x19ff('0xc')]));var Sequence=function(){};Sequence[_0x19ff('0xf')]['enqueue']=function(_0xba744){this[_0x19ff('0x10')]=this['tail']?this[_0x19ff('0x10')][_0x19ff('0x11')](_0xba744):_0xba744();};function Preview(_0x2f7a03){this[_0x19ff('0x12')]=new Sequence();this['campaignsPreview']=_0x2f7a03['voiceQueues'];this[_0x19ff('0x13')]=_0x2f7a03[_0x19ff('0x13')];this[_0x19ff('0x14')]={};this[_0x19ff('0x15')]=_0x2f7a03[_0x19ff('0x15')];this['clockClearZombieChannels']=0x0;ami['on'](_0x19ff('0x16'),this[_0x19ff('0x17')][_0x19ff('0x18')](this));ami['on'](_0x19ff('0x19'),this[_0x19ff('0x1a')]['bind'](this));ami['on'](_0x19ff('0x1b'),this[_0x19ff('0x1c')][_0x19ff('0x18')](this));ami['on']('dialend',this[_0x19ff('0x1d')]['bind'](this));ami['on'](_0x19ff('0x1e'),this['syncNewExten'][_0x19ff('0x18')](this));ami['on'](_0x19ff('0x1f'),this[_0x19ff('0x20')][_0x19ff('0x18')](this));ami['on'](_0x19ff('0x21'),this[_0x19ff('0x22')]['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x19ff('0x18')](this));this['loopCampaigns'](this[_0x19ff('0x23')]);}function emit(_0x3e8f5c,_0x4c669a,_0x513e6d){io['to'](_0x3e8f5c)[_0x19ff('0x24')](_0x4c669a,_0x513e6d);}function emitCampaignPreview(_0x34f1f2){if(_0x34f1f2['type']===_0x19ff('0x25')){var _0x4f3319={'id':_0x34f1f2['id'],'name':_0x34f1f2[_0x19ff('0x26')],'strategy':_0x34f1f2[_0x19ff('0x27')],'answered':_0x34f1f2[_0x19ff('0x28')],'available':_0x34f1f2[_0x19ff('0x29')],'loggedIn':_0x34f1f2[_0x19ff('0x2a')],'pTalking':_0x34f1f2[_0x19ff('0x2b')],'sumBillable':_0x34f1f2[_0x19ff('0x2c')],'sumDuration':_0x34f1f2[_0x19ff('0x2d')],'sumHoldTime':_0x34f1f2[_0x19ff('0x2e')]||0x0,'talking':_0x34f1f2[_0x19ff('0x2f')],'total':_0x34f1f2[_0x19ff('0x30')],'type':_0x34f1f2['type'],'unmanaged':_0x34f1f2[_0x19ff('0x31')],'abandoned':_0x34f1f2['abandoned'],'waiting':_0x34f1f2['waiting'],'loggedInDb':_0x34f1f2[_0x19ff('0x32')],'dialActive':_0x34f1f2['dialActive'],'dialMethod':_0x34f1f2[_0x19ff('0x33')],'dialOriginateCallerIdName':_0x34f1f2[_0x19ff('0x34')],'dialOriginateCallerIdNumber':_0x34f1f2['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x34f1f2[_0x19ff('0x35')],'dialPrefix':_0x34f1f2[_0x19ff('0x36')],'outboundAnswerAgiCallsDay':_0x34f1f2[_0x19ff('0x37')],'outboundAnswerCallsDay':_0x34f1f2[_0x19ff('0x38')],'outboundBlacklistCallsDay':_0x34f1f2[_0x19ff('0x39')],'outboundBusyCallsDay':_0x34f1f2[_0x19ff('0x3a')],'outboundCongestionCallsDay':_0x34f1f2[_0x19ff('0x3b')],'outboundDropCallsDayACS':_0x34f1f2[_0x19ff('0x3c')],'outboundDropCallsDayCallersExit':_0x34f1f2[_0x19ff('0x3d')],'outboundDropCallsDayTimeout':_0x34f1f2[_0x19ff('0x3e')],'outboundNoAnswerCallsDay':_0x34f1f2[_0x19ff('0x3f')],'outboundNoSuchCallsDay':_0x34f1f2[_0x19ff('0x40')],'outboundOriginateFailureCallsDay':_0x34f1f2[_0x19ff('0x41')],'outboundReCallsDay':_0x34f1f2[_0x19ff('0x42')],'outboundRejectCallsDay':_0x34f1f2['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x34f1f2[_0x19ff('0x43')],'outboundAbandonedCallsDay':_0x34f1f2[_0x19ff('0x44')],'predictiveIntervalAnsweredCalls':_0x34f1f2[_0x19ff('0x45')],'predictiveIntervalAvgHoldtime':_0x34f1f2[_0x19ff('0x46')],'predictiveIntervalAvgTalktime':_0x34f1f2[_0x19ff('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x34f1f2['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x34f1f2[_0x19ff('0x48')],'predictiveIntervalErlangCalls':_0x34f1f2['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x34f1f2[_0x19ff('0x49')],'predictiveIntervalHitRate':_0x34f1f2[_0x19ff('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x34f1f2[_0x19ff('0x4b')],'predictiveIntervalPauses':_0x34f1f2[_0x19ff('0x4c')],'predictiveIntervalAvailable':_0x34f1f2['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x34f1f2[_0x19ff('0x4d')],'message':_0x34f1f2[_0x19ff('0x4e')],'originated':_0x34f1f2[_0x19ff('0x4f')],'erlangCalls':_0x34f1f2[_0x19ff('0x50')],'erlangCallToSecond':_0x34f1f2[_0x19ff('0x51')],'erlangAbandonmentRate':_0x34f1f2[_0x19ff('0x52')],'erlangBusyFactor':_0x34f1f2[_0x19ff('0x53')],'startPredictive':_0x34f1f2[_0x19ff('0x54')],'startProgressive':_0x34f1f2['startProgressive']};if(_0x34f1f2[_0x19ff('0x55')]){_0x4f3319[_0x19ff('0x55')]={'id':_0x34f1f2[_0x19ff('0x55')]['id'],'name':_0x34f1f2[_0x19ff('0x55')]['name'],'active':_0x34f1f2[_0x19ff('0x55')]['active'],'callerid':_0x34f1f2[_0x19ff('0x55')][_0x19ff('0x56')]};}if(_0x34f1f2[_0x19ff('0x57')]){_0x4f3319[_0x19ff('0x57')]={'id':_0x34f1f2[_0x19ff('0x57')]['id'],'name':_0x34f1f2[_0x19ff('0x57')][_0x19ff('0x26')]};}var _0x526bb0=md5(JSON[_0x19ff('0x58')](_0x4f3319));if(_0x34f1f2[_0x19ff('0x5')]!==_0x526bb0){_0x34f1f2[_0x19ff('0x5')]=_0x526bb0;emit(util['format']('voice:queue:%s',_0x4f3319[_0x19ff('0x26')]),'voice_queue:save',_0x4f3319);}}}function emitVoiceQueueChannelRemove(_0x2319e6){logger[_0x19ff('0x59')](_0x19ff('0x5a'),JSON[_0x19ff('0x58')](_0x2319e6));emit(util[_0x19ff('0x5b')](_0x19ff('0x5c'),_0x2319e6[_0x19ff('0x26')]),'voice_queue_channel:remove',_0x2319e6);}function notSendMessagesQueue(_0x13b970){if(_0x13b970[_0x19ff('0x5d')]){if(_0x13b970['originated']===0x0&&_0x13b970[_0x19ff('0x2b')]===0x0){_0x13b970[_0x19ff('0x5d')]=![];_0x13b970[_0x19ff('0x29')]=0x0;_0x13b970[_0x19ff('0x5e')]=0x0;_0x13b970[_0x19ff('0x4e')]=_0x19ff('0x5f');ut[_0x19ff('0x60')](_0x19ff('0x61'),_0x13b970[_0x19ff('0x26')]+_0x19ff('0x62'));}else{_0x13b970[_0x19ff('0x4e')]=_0x19ff('0x63');ut[_0x19ff('0x60')](_0x19ff('0x61'),_0x13b970[_0x19ff('0x26')]+_0x19ff('0x64'));}emitCampaignPreview(_0x13b970);}}Preview[_0x19ff('0xf')][_0x19ff('0x65')]=function(){var _0x26cf98=this;setInterval(function(){_0x26cf98[_0x19ff('0x66')]();},0x7cf);};Preview[_0x19ff('0xf')][_0x19ff('0x66')]=function(){var _0x323b34=this[_0x19ff('0x23')];this[_0x19ff('0x67')]+=0x1;for(var _0x371179 in _0x323b34){if(_0x323b34[_0x19ff('0x68')](_0x371179)&&(_0x323b34[_0x371179][_0x19ff('0x33')]===_0x19ff('0x8')||_0x323b34[_0x371179][_0x19ff('0x33')]===_0x19ff('0x69'))&&_0x323b34[_0x371179][_0x19ff('0x6a')]==='outbound'){if(this[_0x19ff('0x67')]>0x7){this[_0x19ff('0x67')]=0x0;this[_0x19ff('0x6b')]();}}if(_0x323b34['hasOwnProperty'](_0x371179)&&_0x323b34[_0x371179][_0x19ff('0x33')]===_0x19ff('0x8')&&_0x323b34[_0x371179][_0x19ff('0x6a')]===_0x19ff('0x25')){if(_0x323b34[_0x371179][_0x19ff('0x6c')]){this[_0x19ff('0x6d')](_0x323b34[_0x371179]);this[_0x19ff('0x6e')](_0x323b34[_0x371179]);}else{notSendMessagesQueue(_0x323b34[_0x371179]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x93b771){var _0x2d0662=this;this[_0x19ff('0x12')][_0x19ff('0x6f')](function(){if(!_[_0x19ff('0x70')](_0x2d0662[_0x19ff('0x14')][_0x93b771])){loggerAction[_0x19ff('0x59')]('[clearZombieChannels][talking]',_0x93b771,_0x19ff('0x71'),_0x2d0662[_0x19ff('0x14')][_0x93b771][_0x19ff('0x72')],_0x19ff('0x73'),JSON['stringify'](_0x2d0662[_0x19ff('0x23')][_0x2d0662[_0x19ff('0x14')][_0x93b771][_0x19ff('0x72')]][_0x19ff('0x4f')]),_0x19ff('0x74'),JSON['stringify'](_0x2d0662['campaignsPreview'][_0x2d0662[_0x19ff('0x14')][_0x93b771][_0x19ff('0x72')]]['pTalking']),JSON[_0x19ff('0x58')](_0x2d0662[_0x19ff('0x14')][_0x93b771][_0x19ff('0x75')]),JSON[_0x19ff('0x58')](_['pick'](_0x2d0662[_0x19ff('0x14')][_0x93b771],[_0x19ff('0x76'),_0x19ff('0x77'),_0x19ff('0x78'),_0x19ff('0x79')])));return ami['Action']({'action':_0x19ff('0x7a'),'channel':_0x2d0662['actions'][_0x93b771][_0x19ff('0x7b')]})[_0x19ff('0x7c')](function(_0x2f524a){if(_0x2f524a[_0x19ff('0x4e')]===_0x19ff('0x7d')){setTimeout(function(){if(_0x2d0662['actions'][_0x93b771]){ut[_0x19ff('0x7e')](_0x2d0662[_0x19ff('0x23')][_0x2d0662['actions'][_0x93b771][_0x19ff('0x72')]],_0x19ff('0x7f'));if(_0x2d0662[_0x19ff('0x14')][_0x93b771]['dialAnswer']===!![]){ut[_0x19ff('0x80')](_0x2d0662[_0x19ff('0x23')][_0x2d0662[_0x19ff('0x14')][_0x93b771]['queue']],_0x19ff('0x7f'));ut[_0x19ff('0x81')](_0x19ff('0x82')+_0x93b771,_0x2d0662[_0x19ff('0x14')][_0x93b771][_0x19ff('0x72')]);}ut[_0x19ff('0x81')]('[Dialer][checkChannel][Preview]'+_0x93b771,_0x2d0662[_0x19ff('0x14')][_0x93b771][_0x19ff('0x72')]);delete _0x2d0662['actions'][_0x93b771];}},0x2328);}});}});};Preview['prototype'][_0x19ff('0x6b')]=function(){var _0x333a73=this;loggerAction['info']('[action]',_[_0x19ff('0x83')](this[_0x19ff('0x14')]));for(var _0x43bccc in this[_0x19ff('0x14')]){if(_0x333a73['actions'][_0x19ff('0x68')](_0x43bccc)){_0x333a73[_0x19ff('0x84')](_0x43bccc);}}};Preview[_0x19ff('0xf')][_0x19ff('0x6e')]=function(_0x4af908){var _0x141600=this;rpcDb[_0x19ff('0x85')](_0x4af908['id'],ut[_0x19ff('0x86')](this[_0x19ff('0x15')]))[_0x19ff('0x87')](function(_0x44ec2f){if(!_['isNil'](_0x44ec2f)){for(var _0x8ed643=0x0;_0x8ed643<_0x44ec2f[_0x19ff('0x88')];_0x8ed643+=0x1){if(ut[_0x19ff('0x89')](_0x44ec2f[_0x8ed643]['scheduledat'])<_0x4af908[_0x19ff('0x8a')]*0x3c){if(_0x44ec2f[_0x8ed643][_0x19ff('0x8b')]&&!_0x44ec2f[_0x8ed643]['Agent'][_0x19ff('0x8c')]){_0x141600['run'](_0x44ec2f[_0x8ed643]['id'])[_0x19ff('0x87')](ut[_0x19ff('0x8d')](_0x19ff('0x8e')))['catch'](ut[_0x19ff('0x8d')]('[RecallMe]'));}else{rpcDb[_0x19ff('0x8f')](_0x44ec2f[_0x8ed643]['id']);}}else{var _0x52fc5c=new Action(_0x44ec2f[_0x8ed643],_0x4af908);_0x52fc5c['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4af908[_0x19ff('0x42')]+=0x1;ut[_0x19ff('0x90')](_0x52fc5c,0x17,_0x19ff('0x91'));if(_0x4af908['dialRecallInQueue']){rpcDb[_0x19ff('0x92')](ut[_0x19ff('0x93')](_0x44ec2f[_0x8ed643]));rpcDb[_0x19ff('0x94')](_0x52fc5c,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x19ff('0x90')](_0x52fc5c,0x16,_0x19ff('0x95'));rpcDb['createCustomerHistory'](_0x52fc5c,_0x19ff('0x96'));rpcDb['createCustomerFinal'](_0x52fc5c,_0x19ff('0x96'));}}}}})[_0x19ff('0x7c')](ut[_0x19ff('0x8d')](_0x19ff('0x97')));};Preview[_0x19ff('0xf')][_0x19ff('0x6d')]=function(_0x117d4b){_0x117d4b[_0x19ff('0x5d')]=!![];if(ut[_0x19ff('0x98')](_0x117d4b[_0x19ff('0x2a')])){_0x117d4b['message']=_0x19ff('0x99');}else if(!ut['isActive'](_0x117d4b['dialActive'])){_0x117d4b[_0x19ff('0x4e')]=_0x19ff('0x5f');}else if(!this[_0x19ff('0x9a')](_0x117d4b[_0x19ff('0x55')])){if(!this[_0x19ff('0x9a')](_0x117d4b[_0x19ff('0x9b')])){_0x117d4b[_0x19ff('0x4e')]=_0x19ff('0x9c');}else{_0x117d4b[_0x19ff('0x4e')]=_0x19ff('0x9d');}}else{_0x117d4b[_0x19ff('0x4e')]=_0x19ff('0x9d');}emitCampaignPreview(_0x117d4b);};Preview[_0x19ff('0xf')]['callProgressDetectingCustomer']=function(_0x4831ee,_0x292fa0,_0x54bd70){var _0x1e95d9=this;var _0x88c37b=this[_0x19ff('0x14')][_0x292fa0];var _0x52921b=this[_0x19ff('0x23')][_0x88c37b[_0x19ff('0x72')]];var _0x2535bb;if(_0x52921b){switch(_0x54bd70){case'1':_0x52921b[_0x19ff('0x40')]+=0x1;_0x88c37b[_0x19ff('0x9e')]+=0x1;_0x88c37b[_0x19ff('0x9f')]=ut[_0x19ff('0xa0')](_0x88c37b);ut['logCustomer'](_0x88c37b,0x0,'NoSuchNumber');ami[_0x19ff('0x24')](_0x19ff('0xa1'),ut[_0x19ff('0xa2')](_0x88c37b,_0x19ff('0xa3')));rpcDb[_0x19ff('0x94')](_0x88c37b,_0x19ff('0xa4'));if(ut[_0x19ff('0xa0')](_0x88c37b)>=_0x52921b['dialGlobalMaxRetry']){_0x2535bb=ut[_0x19ff('0xa5')](_0x88c37b,0xf,_0x19ff('0xa6'));rpcDb[_0x19ff('0xa7')](_0x2535bb,_0x19ff('0xa8'));}else{if(_0x88c37b[_0x19ff('0x9e')]>=_0x52921b[_0x19ff('0xa9')]){rpcDb[_0x19ff('0xa7')](_0x88c37b,_0x19ff('0xa8'));}else{rpcDb['rescheduleContact'](ut[_0x19ff('0xaa')](_0x88c37b,_0x19ff('0x9e'),_0x52921b[_0x19ff('0xab')]),_0x88c37b[_0x19ff('0xac')],_0x88c37b[_0x19ff('0xad')]);}}delete this[_0x19ff('0x14')][_0x4831ee[_0x19ff('0xae')]];break;case _0x19ff('0xaf'):var _0x1ce311=moment()[_0x19ff('0x5b')](_0x19ff('0xb0'));_0x88c37b['responsetime']=_0x1ce311;_0x88c37b[_0x19ff('0xb1')]=_0x1ce311;_0x88c37b[_0x19ff('0x75')]=!![];_0x52921b[_0x19ff('0x2b')]+=0x1;logger[_0x19ff('0x59')](_0x19ff('0xb2'),_0x88c37b[_0x19ff('0xb3')],'\x20Queue',_0x52921b['name'],_0x19ff('0x74'),_0x52921b[_0x19ff('0x2b')]);ami['emit'](_0x19ff('0xb4'),ut[_0x19ff('0xa2')](_0x88c37b,'connect'));if(_0x52921b[_0x19ff('0xb5')]){ami[_0x19ff('0x24')](_0x19ff('0xb6'),ut[_0x19ff('0xb7')](_0x88c37b));}break;case'16':ami[_0x19ff('0x24')](_0x19ff('0xb8'),ut[_0x19ff('0xa2')](_0x88c37b,'complete'));emitVoiceQueueChannelRemove(ut[_0x19ff('0xa2')](_0x88c37b,'complete'));_0x52921b[_0x19ff('0x38')]+=0x1;_0x52921b[_0x19ff('0x30')]+=0x1;_0x52921b[_0x19ff('0x28')]+=0x1;ut['decrementTalkink'](_0x52921b,'[16]');_0x88c37b[_0x19ff('0x9f')]=ut['totalGlobal'](_0x88c37b);ut[_0x19ff('0x90')](_0x88c37b,0x4,_0x19ff('0xb9'));rpcDb[_0x19ff('0x94')](_0x88c37b,_0x19ff('0xba'));rpcDb[_0x19ff('0xa7')](_0x88c37b,_0x19ff('0xbb'));rpcDb[_0x19ff('0xbc')](_0x88c37b);_0x52921b[_0x19ff('0x2d')]+=_0x88c37b[_0x19ff('0xbd')];_0x52921b['sumBillable']+=_0x88c37b['talktime'];logger['info'](_0x19ff('0xbe'),_0x88c37b[_0x19ff('0xb3')],_0x19ff('0xbf'),_0x52921b[_0x19ff('0x26')],'pTalking:\x20',_0x52921b[_0x19ff('0x2b')]);delete this[_0x19ff('0x14')][_0x4831ee[_0x19ff('0xae')]];break;case _0x19ff('0xc0'):_0x52921b[_0x19ff('0x3a')]+=0x1;_0x88c37b[_0x19ff('0xc1')]+=0x1;_0x88c37b[_0x19ff('0x9f')]=ut['totalGlobal'](_0x88c37b);ut['logCustomer'](_0x88c37b,0x5,_0x19ff('0xc2'));ami[_0x19ff('0x24')]('custom:agentbusy',ut[_0x19ff('0xa2')](_0x88c37b,'busy'));rpcDb[_0x19ff('0x94')](_0x88c37b,_0x19ff('0xc3'));if(ut[_0x19ff('0xa0')](_0x88c37b)>=_0x52921b['dialGlobalMaxRetry']){_0x2535bb=ut['cloneAction'](_0x88c37b,0xf,_0x19ff('0xa6'));rpcDb[_0x19ff('0xa7')](_0x2535bb,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x88c37b['countbusyretry']>=_0x52921b[_0x19ff('0xc4')]){rpcDb[_0x19ff('0xa7')](_0x88c37b,_0x19ff('0xc3'));}else{rpcDb[_0x19ff('0xc5')](ut[_0x19ff('0xaa')](_0x88c37b,_0x19ff('0xc1'),_0x52921b[_0x19ff('0xc6')]),_0x88c37b['unlockAgent'],_0x88c37b[_0x19ff('0xad')]);}}break;case _0x19ff('0xc7'):_0x52921b[_0x19ff('0x3f')]+=0x1;_0x88c37b[_0x19ff('0xc8')]+=0x1;_0x88c37b['countglobal']=ut[_0x19ff('0xa0')](_0x88c37b);ut['logCustomer'](_0x88c37b,0x3,_0x19ff('0xc9'));ami[_0x19ff('0x24')](_0x19ff('0xca'),ut[_0x19ff('0xa2')](_0x88c37b,'noanswer'));rpcDb[_0x19ff('0x94')](_0x88c37b,_0x19ff('0xcb'));if(ut[_0x19ff('0xa0')](_0x88c37b)>=_0x52921b['dialGlobalMaxRetry']){_0x2535bb=ut[_0x19ff('0xa5')](_0x88c37b,0xf,_0x19ff('0xa6'));rpcDb[_0x19ff('0xa7')](_0x2535bb,_0x19ff('0xcc'));}else{if(_0x88c37b[_0x19ff('0xc8')]>=_0x52921b[_0x19ff('0xcd')]){rpcDb[_0x19ff('0xa7')](_0x88c37b,_0x19ff('0xcb'));}else{rpcDb[_0x19ff('0xc5')](ut[_0x19ff('0xaa')](_0x88c37b,_0x19ff('0xc8'),_0x52921b[_0x19ff('0xce')]),_0x88c37b['unlockAgent'],_0x88c37b['activeContact']);}}break;case'CONGESTION':_0x52921b[_0x19ff('0x3b')]+=0x1;_0x88c37b[_0x19ff('0xcf')]+=0x1;_0x88c37b['countglobal']=ut[_0x19ff('0xa0')](_0x88c37b);ut[_0x19ff('0x90')](_0x88c37b,0x8,_0x19ff('0xd0'));ami[_0x19ff('0x24')](_0x19ff('0xd1'),ut[_0x19ff('0xa2')](_0x88c37b,'congestion'));rpcDb[_0x19ff('0x94')](_0x88c37b,_0x19ff('0xd2'));if(ut[_0x19ff('0xa0')](_0x88c37b)>=_0x52921b['dialGlobalMaxRetry']){_0x2535bb=ut[_0x19ff('0xa5')](_0x88c37b,0xf,_0x19ff('0xa6'));rpcDb[_0x19ff('0xa7')](_0x2535bb,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x88c37b[_0x19ff('0xcf')]>=_0x52921b[_0x19ff('0xd3')]){rpcDb[_0x19ff('0xa7')](_0x88c37b,_0x19ff('0xd2'));}else{rpcDb[_0x19ff('0xc5')](ut[_0x19ff('0xaa')](_0x88c37b,_0x19ff('0xcf'),_0x52921b[_0x19ff('0xc6')]),_0x88c37b[_0x19ff('0xac')],_0x88c37b[_0x19ff('0xad')]);}}break;case'CANCEL':_0x52921b[_0x19ff('0xd4')]+=0x1;_0x88c37b[_0x19ff('0xd5')]+=0x1;_0x88c37b[_0x19ff('0x9f')]=ut['totalGlobal'](_0x88c37b);ut[_0x19ff('0x90')](_0x88c37b,0x14,_0x19ff('0xd6'));ami[_0x19ff('0x24')](_0x19ff('0xd7'),ut[_0x19ff('0xa2')](_0x88c37b,_0x19ff('0xd8')));rpcDb[_0x19ff('0x94')](_0x88c37b,_0x19ff('0xd9'));if(ut[_0x19ff('0xa0')](_0x88c37b)>=_0x52921b['dialGlobalMaxRetry']){_0x2535bb=ut[_0x19ff('0xa5')](_0x88c37b,0x14,_0x19ff('0xd6'));rpcDb[_0x19ff('0xa7')](_0x2535bb,_0x19ff('0xda'));}else{if(_0x88c37b[_0x19ff('0xd5')]>=_0x52921b['dialAgentRejectMaxRetry']){rpcDb[_0x19ff('0xa7')](_0x88c37b,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x19ff('0xc5')](ut['scheduledAt'](_0x88c37b,_0x19ff('0xd5'),_0x52921b[_0x19ff('0xdb')]),_0x88c37b[_0x19ff('0xac')],_0x88c37b['activeContact']);}}break;case _0x19ff('0xdc'):_0x52921b['outboundAbandonedCallsDay']+=0x1;_0x88c37b[_0x19ff('0xdd')]+=0x1;_0x88c37b[_0x19ff('0x9f')]=ut[_0x19ff('0xa0')](_0x88c37b);ut[_0x19ff('0x90')](_0x88c37b,0xb,'Abandoned');rpcDb[_0x19ff('0x94')](_0x88c37b,_0x19ff('0xde'));if(ut['totalGlobal'](_0x88c37b)>=_0x52921b[_0x19ff('0xdf')]){_0x2535bb=ut[_0x19ff('0xa5')](_0x88c37b,0xf,_0x19ff('0xa6'));rpcDb['createCustomerFinal'](_0x2535bb,_0x19ff('0xde'));}else{if(_0x88c37b['countabandonedetry']>=_0x52921b[_0x19ff('0xe0')]){rpcDb[_0x19ff('0xa7')](_0x88c37b,_0x19ff('0xde'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x88c37b,_0x19ff('0xdd'),_0x52921b[_0x19ff('0xe1')]),_0x88c37b[_0x19ff('0xac')],_0x88c37b[_0x19ff('0xad')]);}}break;default:if(_0x88c37b[_0x19ff('0x75')]){ut[_0x19ff('0x80')](_0x52921b,_0x19ff('0xe2'));ut[_0x19ff('0x81')](_0x19ff('0xe3')+_0x52921b['name'],_0x4831ee);}_0x52921b[_0x19ff('0x43')]+=0x1;_0x88c37b[_0x19ff('0x9f')]=ut['totalGlobal'](_0x88c37b);ut[_0x19ff('0x90')](_0x88c37b,0xc,_0x4831ee['cause-txt']||_0x4831ee[_0x19ff('0xe4')]);rpcDb['createCustomerHistory'](_0x88c37b,_0x19ff('0xe5'));if(ut[_0x19ff('0xa0')](_0x88c37b)>=_0x52921b[_0x19ff('0xdf')]){_0x2535bb=ut[_0x19ff('0xa5')](_0x88c37b,0xf,_0x19ff('0xa6'));rpcDb['createCustomerFinal'](_0x2535bb,_0x19ff('0xe6'));}else{rpcDb[_0x19ff('0xa7')](_0x88c37b,_0x19ff('0xe6'));}delete this[_0x19ff('0x14')][_0x4831ee[_0x19ff('0xae')]];}if(!(_0x88c37b[_0x19ff('0x75')]&&_0x54bd70==='16')){ut[_0x19ff('0x7e')](_0x52921b,'[callProgressDetectingCustomer]');logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x88c37b[_0x19ff('0xb3')],_0x19ff('0xbf'),_0x52921b['name'],_0x19ff('0x73'),_0x52921b[_0x19ff('0x4f')]);}if(_0x54bd70!==_0x19ff('0xaf')){delete this['actions'][_0x4831ee[_0x19ff('0xae')]];delete this['actions'][_0x4831ee[_0x19ff('0xe7')]];}}};Preview[_0x19ff('0xf')][_0x19ff('0xe8')]=function(_0x2adb42,_0x483e3c,_0x195040){if(_[_0x19ff('0xe9')](_0x483e3c)&&_0x19ff('0xea')!==typeof _0x483e3c){return;}if(_[_0x19ff('0xe9')](_0x195040)&&'object'!==typeof _0x195040){return;}switch(_0x195040[_0x19ff('0xeb')]){case'0':ut['logAgent'](_0x2adb42,0x0,_0x19ff('0xec'));rpcDb[_0x19ff('0xed')](_0x2adb42,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x2adb42,0x3,_0x19ff('0xc9'));rpcDb['createAgentHistory'](_0x2adb42,_0x19ff('0xee'));break;case'5':ut['logAgent'](_0x2adb42,0x5,_0x19ff('0xc2'));rpcDb[_0x19ff('0xed')](_0x2adb42,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x2adb42,0x8,'Congestion');rpcDb[_0x19ff('0xed')](_0x2adb42,_0x19ff('0xef'));break;case'22':ut[_0x19ff('0xf0')](_0x2adb42,0x16,'AnswerAGI');rpcDb[_0x19ff('0xed')](_0x2adb42,_0x19ff('0xf1'));break;default:ut['logAgent'](_0x2adb42,0xc,_0x195040['reason']);rpcDb[_0x19ff('0xed')](_0x2adb42,_0x19ff('0xef'));}ut[_0x19ff('0x7e')](_0x483e3c,_0x19ff('0xf2'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x2adb42[_0x19ff('0xb3')],_0x19ff('0xbf'),_0x483e3c['name'],_0x19ff('0x73'),_0x483e3c[_0x19ff('0x4f')]);delete this[_0x19ff('0x14')][_0x2adb42[_0x19ff('0xb3')]];};Preview[_0x19ff('0xf')][_0x19ff('0xf3')]=function(_0x36c99d,_0x5e96b0,_0x155b62,_0x4f4149,_0x5ccb75){var _0x5d8786=this;return new BPromise(function(_0x5f9ba4,_0x23eebb){if(_[_0x19ff('0x70')](_0x5e96b0)||_['isNil'](_0x5e96b0['Contact'])||_['isNil'](_0x5e96b0[_0x19ff('0xf4')][_0x19ff('0xf5')])||_[_0x19ff('0x70')](_0x5e96b0[_0x19ff('0x78')])){_0x23eebb(ut[_0x19ff('0x4e')](_0x19ff('0xf6'),_0x4f4149,_0x5ccb75));return;}var _0x3e1441=uuid['v4']();var _0x1fdf66=_0x5d8786[_0x19ff('0x23')][_0x5e96b0[_0x19ff('0x71')][_0x19ff('0x26')]];var _0x1e5acb=_0x155b62?_0x5d8786[_0x19ff('0x15')][_0x155b62]['id']:undefined;_0x5d8786[_0x19ff('0x14')][_0x3e1441]=new Action(_0x5e96b0,_0x1fdf66,_0x3e1441,_0x155b62,_0x1e5acb);var _0x4b0017=_0x5d8786[_0x19ff('0x14')][_0x3e1441];_0x4b0017[_0x19ff('0xac')]=_0x4f4149;_0x4b0017[_0x19ff('0xad')]=_0x5ccb75;_0x4b0017[_0x19ff('0xf7')]=_0x155b62;if(_[_0x19ff('0xf8')](_0x36c99d)){_0x5d8786['execCall'](_0x4b0017,_0x1fdf66,_0x5e96b0,_0x155b62)[_0x19ff('0x87')](function(_0x3d02ab){logger[_0x19ff('0x59')]('[Preview][execCall][success]','Queue:\x20'+_0x4b0017[_0x19ff('0x72')]+_0x19ff('0xf9')+_0x4b0017[_0x19ff('0xfa')],JSON[_0x19ff('0x58')](_0x3d02ab));ami[_0x19ff('0x24')](_0x19ff('0xfb'),ut['buildObj'](_0x4b0017,'called'));_0x5f9ba4(ut[_0x19ff('0x4e')](_0x19ff('0xfc')));})[_0x19ff('0x7c')](function(_0x5112af){ut[_0x19ff('0x60')](_0x19ff('0xfd'),_0x5112af);_0x23eebb(ut[_0x19ff('0x4e')]('Call\x20failed',_0x4f4149,_0x5ccb75));});}else{_0x1fdf66['outboundBlacklistCallsDay']+=0x1;ut[_0x19ff('0xfe')](_0x4b0017);rpcDb[_0x19ff('0xff')](_0x4b0017,_0x19ff('0x100'));delete _0x5d8786[_0x19ff('0x14')][_0x3e1441];_0x23eebb(ut[_0x19ff('0x4e')](_0x19ff('0x101'),_0x4f4149,_0x5ccb75));}});};Preview['prototype'][_0x19ff('0x9a')]=function(_0x407967){return!_['isNil'](_0x407967)&&!_['isNil'](_0x407967[_0x19ff('0x26')])&&!_['isNil'](_0x407967[_0x19ff('0x102')])&&_0x407967[_0x19ff('0x102')]&&!_[_0x19ff('0x70')](this['trunks'][util['format'](_0x19ff('0x103'),_0x407967[_0x19ff('0x26')])])&&!_[_0x19ff('0x70')](this[_0x19ff('0x13')][util[_0x19ff('0x5b')](_0x19ff('0x103'),_0x407967['name'])][_0x19ff('0x7a')])&&(this[_0x19ff('0x13')][util[_0x19ff('0x5b')](_0x19ff('0x103'),_0x407967[_0x19ff('0x26')])][_0x19ff('0x7a')]===_0x19ff('0x104')||this[_0x19ff('0x13')][util[_0x19ff('0x5b')](_0x19ff('0x103'),_0x407967[_0x19ff('0x26')])][_0x19ff('0x7a')]===_0x19ff('0x105'));};Preview[_0x19ff('0xf')][_0x19ff('0x106')]=function(_0x53ac65,_0x2b081d){var _0x17d6cd=this;return new BPromise(function(_0x166c2a,_0x1e202d){_0x17d6cd['execRun'](_0x53ac65,_0x2b081d)[_0x19ff('0x87')](function(_0x393471){_0x166c2a(_['pick'](_0x393471,[_0x19ff('0x4e')]));})[_0x19ff('0x7c')](function(_0x2c2d1b){if(_0x2c2d1b[_0x19ff('0x107')]){rpcDb[_0x19ff('0x108')](_0x53ac65);}if(_0x2c2d1b[_0x19ff('0x102')]){rpcDb[_0x19ff('0x8f')](_0x53ac65);}_0x1e202d(_[_0x19ff('0x109')](_0x2c2d1b,[_0x19ff('0x4e')]));});});};Preview[_0x19ff('0xf')]['execRun']=function(_0x7073d4,_0xfef54e){var _0x117010=this;return new BPromise(function(_0xf01c6b,_0x9e0e44){var _0x4ffcc0,_0x590a74;rpcDb['getContactPreview'](_0x7073d4)[_0x19ff('0x87')](function(_0x31b3da){if(!_[_0x19ff('0x70')](_0x31b3da[0x0])){_0x590a74=_0x31b3da[0x0][_0x19ff('0x10a')]?![]:!![];_0x4ffcc0=_0x31b3da[0x0][_0x19ff('0x10a')]?!![]:![];_0x4ffcc0=_0xfef54e?!![]:_0x4ffcc0;}var _0xc51496=_0x117010['validateContact'](_0x31b3da);if(_0xc51496[_0x19ff('0x10b')]){rpcDb[_0x19ff('0x10c')](_[_0x19ff('0x109')](_0x31b3da[0x0],['VoiceQueueId',_0x19ff('0x10d')]))[_0x19ff('0x87')](function(_0x50c5eb){_0x117010[_0x19ff('0xf3')](_0x50c5eb,_0x31b3da[0x0],_0xfef54e,_0x590a74,_0x4ffcc0)[_0x19ff('0x87')](function(_0xc5edee){_0xf01c6b(_0xc5edee);})[_0x19ff('0x7c')](function(_0x4f4f90){_0x9e0e44(_0x4f4f90);});})[_0x19ff('0x7c')](function(_0x48cba2){ut[_0x19ff('0x60')](_0x19ff('0x10e'),_0x48cba2);_0x9e0e44(ut[_0x19ff('0x4e')]('Call\x20unsuccessful',_0x590a74,_0x4ffcc0));});}else{_0x9e0e44(ut[_0x19ff('0x4e')](_0xc51496[_0x19ff('0x4e')],_0x590a74,_0x4ffcc0));}})[_0x19ff('0x7c')](function(_0x404d57){ut[_0x19ff('0x60')](_0x19ff('0x10f'),_0x404d57);_0x9e0e44(ut[_0x19ff('0x4e')](_0x19ff('0x110'),![],!![]));});});};Preview[_0x19ff('0xf')][_0x19ff('0x111')]=function(_0x170a9d){if(_[_0x19ff('0x70')](_0x170a9d)||_[_0x19ff('0xf8')](_0x170a9d)||!_[_0x19ff('0x70')](_0x170a9d[0x0][_0x19ff('0x8b')])&&_[_0x19ff('0x70')](_0x170a9d[0x0][_0x19ff('0x8b')][_0x19ff('0x26')])){ut[_0x19ff('0x60')](_0x19ff('0x112'),_0x170a9d);return{'isValid':![],'message':_0x19ff('0x113')};}var _0x2c02d5=this['campaignsPreview'][_0x170a9d[0x0]['Queue'][_0x19ff('0x26')]];_0x2c02d5[_0x19ff('0x4e')]=_0x19ff('0x9d');if(_['isNil'](_0x2c02d5)){ut[_0x19ff('0x60')](_0x19ff('0x114'),_0x2c02d5);return{'isValid':![],'message':_0x19ff('0x115')};}if(!this[_0x19ff('0x9a')](_0x2c02d5[_0x19ff('0x55')])){ut[_0x19ff('0x60')](_0x19ff('0x116'),_0x19ff('0x117')+_0x2c02d5[_0x19ff('0x26')]+_0x19ff('0x118'));if(!this[_0x19ff('0x9a')](_0x2c02d5[_0x19ff('0x9b')])){ut[_0x19ff('0x60')](_0x19ff('0x116'),_0x2c02d5['name']+_0x19ff('0x119'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x19ff('0x11a')](_0x2c02d5['dialActive'])){ut[_0x19ff('0x60')](_0x19ff('0x11b'),_0x2c02d5['name']+_0x19ff('0x11c'));return{'isValid':![],'message':_0x19ff('0x117')+_0x2c02d5[_0x19ff('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x19ff('0x11d')};};Preview[_0x19ff('0xf')][_0x19ff('0x11e')]=function(_0x2a4b56,_0x5c4f9a,_0x5c1549,_0x4ef1ab){var _0x5e4a1e=this;return new BPromise(function(_0x1b56f2,_0x1142f1){var _0x253735=_0x2a4b56[_0x19ff('0xb3')];var _0x3e4304=_0x5e4a1e[_0x19ff('0x9a')](_0x5c4f9a[_0x19ff('0x55')])?util[_0x19ff('0x5b')](_0x19ff('0x11f'),_0x5c4f9a[_0x19ff('0x55')][_0x19ff('0x26')],_['isNil'](_0x5c4f9a['dialPrefix'])?'':_0x5c4f9a['dialPrefix']['trim']()||'',_0x5c4f9a[_0x19ff('0x120')]>0x0?_0x5c1549['Contact'][_0x19ff('0xf5')][_0x19ff('0x121')](_0x5c4f9a[_0x19ff('0x120')]):_0x5c1549[_0x19ff('0xf4')][_0x19ff('0xf5')]):util[_0x19ff('0x5b')](_0x19ff('0x11f'),_[_0x19ff('0x70')](_0x5c4f9a[_0x19ff('0x9b')])?_0x5c4f9a[_0x19ff('0x55')][_0x19ff('0x26')]:_0x5c4f9a[_0x19ff('0x9b')][_0x19ff('0x26')],_['isNil'](_0x5c4f9a[_0x19ff('0x36')])?'':_0x5c4f9a[_0x19ff('0x36')][_0x19ff('0x122')]()||'',_0x5c4f9a[_0x19ff('0x120')]>0x0?_0x5c1549[_0x19ff('0xf4')][_0x19ff('0xf5')]['substring'](_0x5c4f9a[_0x19ff('0x120')]):_0x5c1549[_0x19ff('0xf4')][_0x19ff('0xf5')]);var _0x13feba=_0x5e4a1e[_0x19ff('0x9a')](_0x5c4f9a[_0x19ff('0x55')])?ut[_0x19ff('0x123')](_0x5c4f9a['Trunk'][_0x19ff('0x56')],_0x5c4f9a['dialOriginateCallerIdName'],_0x5c4f9a[_0x19ff('0x124')]>0x0?ut[_0x19ff('0x125')](_0x5c4f9a[_0x19ff('0x126')],_0x5c4f9a[_0x19ff('0x124')]):_0x5c4f9a[_0x19ff('0x126')]):ut['getCallerId'](_[_0x19ff('0x70')](_0x5c4f9a[_0x19ff('0x9b')])?_0x5c4f9a[_0x19ff('0x55')][_0x19ff('0x56')]:_0x5c4f9a['TrunkBackup']['callerid'],_0x5c4f9a[_0x19ff('0x34')],_0x5c4f9a[_0x19ff('0x124')]>0x0?ut[_0x19ff('0x125')](_0x5c4f9a['dialOriginateCallerIdNumber'],_0x5c4f9a[_0x19ff('0x124')]):_0x5c4f9a[_0x19ff('0x126')]);if(_0x13feba){_0x2a4b56[_0x19ff('0x127')]=ut[_0x19ff('0x128')](_0x13feba);_0x2a4b56[_0x19ff('0x129')]=ut['extractCalleridNumber'](_0x13feba);}var _0x5f2e0b=ut[_0x19ff('0x12a')](_0x5c4f9a,_0x5c1549,_0x3e4304,_0x13feba,_0x253735,_0x2a4b56);_[_0x19ff('0x12b')](_0x2a4b56,ut[_0x19ff('0x12c')](_0x5f2e0b));_0x2a4b56[_0x19ff('0x12d')]=moment()[_0x19ff('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x19ff('0x12e')](ut[_0x19ff('0x12f')](_0x2a4b56,_0x5c4f9a,_0x5f2e0b,_0x2a4b56[_0x19ff('0xad')],_0x4ef1ab))[_0x19ff('0x87')](function(_0x4fc3a8){_0x5c4f9a['originated']+=0x1;logger['info'](_0x19ff('0x130'),_0x253735,_0x19ff('0xbf'),_0x5c4f9a[_0x19ff('0x26')],_0x19ff('0x73'),_0x5c4f9a['originated']);_0x1b56f2(_0x4fc3a8);})[_0x19ff('0x7c')](function(_0x530458){ut[_0x19ff('0xf0')](_0x2a4b56,0xe,_0x19ff('0x131'));rpcDb[_0x19ff('0xed')](_0x2a4b56,_0x19ff('0x132'));_0x1142f1(_0x530458);});});};Preview[_0x19ff('0xf')][_0x19ff('0x133')]=function(_0x3b27f3){if(this[_0x19ff('0x14')][_0x3b27f3[_0x19ff('0xae')]]){this['actions'][_0x3b27f3[_0x19ff('0xae')]]['channel']=_0x3b27f3[_0x19ff('0x7b')];}};Preview[_0x19ff('0xf')][_0x19ff('0x17')]=function(_0x3aee11){var _0x22f3e5=this;var _0x3ebff8=this[_0x19ff('0x14')][_0x3aee11[_0x19ff('0x134')]];if(_0x3ebff8){if(_0x3ebff8[_0x19ff('0xf7')]&&this[_0x19ff('0x15')][_0x3ebff8[_0x19ff('0xf7')]]){ut[_0x19ff('0x135')](_0x3ebff8,this['agents'][_0x3ebff8['lookAgent']][_0x19ff('0x26')],this[_0x19ff('0x15')][_0x3ebff8[_0x19ff('0xf7')]]['id']);}var _0x315d69=_[_0x19ff('0x136')](_0x3ebff8);_0x315d69[_0x19ff('0x137')]=moment()[_0x19ff('0x5b')](_0x19ff('0xb0'));var _0x16883c=_0x22f3e5['campaignsPreview'][_0x3ebff8['queue']];if(ut[_0x19ff('0x138')](_0x3aee11[_0x19ff('0x139')])){if(_0x3ebff8[_0x19ff('0xac')]){rpcDb['unlockContact'](_0x3ebff8[_0x19ff('0xfa')]);}if(_0x3ebff8[_0x19ff('0xad')]){rpcDb[_0x19ff('0x8f')](_0x3ebff8[_0x19ff('0xfa')]);}ami[_0x19ff('0x24')](_0x19ff('0x13a'),ut[_0x19ff('0xa2')](_0x3ebff8,'rejected'));this['callProgressDetectingAgent'](_0x315d69,_0x16883c,_0x3aee11);}else{_0x3ebff8['starttime']=moment()['format'](_0x19ff('0xb0'));ut[_0x19ff('0xf0')](_0x315d69,0x4,_0x19ff('0xb9'));rpcDb[_0x19ff('0xed')](_0x315d69,_0x19ff('0x13b'));}}};Preview[_0x19ff('0xf')][_0x19ff('0x1a')]=function(_0x4bb867){var _0x2d3eec=this;var _0x286a6b=this[_0x19ff('0x14')][_0x4bb867[_0x19ff('0xae')]];var _0x9e9b14;if(_0x286a6b){_0x9e9b14=this['campaignsPreview'][_0x286a6b[_0x19ff('0x72')]];logger[_0x19ff('0x59')](_0x19ff('0x13c'),_0x4bb867['linkedid'],'\x20Queue',_0x9e9b14[_0x19ff('0x26')],_0x19ff('0x74'),_0x9e9b14[_0x19ff('0x2b')]);}if(this['actions'][_0x4bb867[_0x19ff('0xae')]]&&_0x4bb867[_0x19ff('0xae')]!==_0x4bb867[_0x19ff('0xb3')]){if(_0x4bb867[_0x19ff('0x13d')]==='16'&&this[_0x19ff('0x14')][_0x4bb867[_0x19ff('0xae')]][_0x19ff('0x75')]){this[_0x19ff('0x13e')](_0x4bb867,_0x4bb867['linkedid'],_0x4bb867[_0x19ff('0x13d')]);}else if(this['actions'][_0x4bb867['linkedid']][_0x19ff('0x75')]){logger['info']('[syncHangup][talking][cause]',_0x4bb867['linkedid'],_0x4bb867[_0x19ff('0x13d')],_0x19ff('0xbf'),_0x9e9b14['name'],_0x19ff('0x74'),_0x9e9b14[_0x19ff('0x2b')]);this[_0x19ff('0x13e')](_0x4bb867,_0x4bb867['linkedid'],_0x4bb867[_0x19ff('0x13d')]);}}else if(_0x286a6b&&_[_0x19ff('0x70')](_0x286a6b['statedesc'])&&_0x9e9b14['dialQueueProject']&&_0x4bb867['linkedid']===_0x4bb867[_0x19ff('0xb3')]&&_['isNil'](_0x4bb867[_0x19ff('0xeb')])&&_0x4bb867[_0x19ff('0x13d')]==='16'&&_0x4bb867[_0x19ff('0x13f')]==='6'&&_[_0x19ff('0xe9')](_0x286a6b['transfer'])){if(_0x286a6b['unlockAgent']){rpcDb['unlockContact'](_0x286a6b[_0x19ff('0xfa')]);}if(_0x286a6b[_0x19ff('0xad')]){rpcDb['disableContact'](_0x286a6b['idContact']);}_0x4bb867[_0x19ff('0xeb')]='22';this[_0x19ff('0xe8')](_0x286a6b,_0x9e9b14,_0x4bb867);}else if(_0x286a6b&&_0x286a6b['transfer']){if(_0x4bb867[_0x19ff('0x13d')]==='16'&&this[_0x19ff('0x14')][_0x4bb867[_0x19ff('0xae')]]['dialAnswer']){logger['info']('[syncHangup][talking][transfer]',_0x4bb867['linkedid'],_0x4bb867[_0x19ff('0x13d')],_0x19ff('0xbf'),_0x9e9b14[_0x19ff('0x26')],_0x19ff('0x74'),_0x9e9b14[_0x19ff('0x2b')]);this[_0x19ff('0x13e')](_0x4bb867,_0x4bb867[_0x19ff('0xae')],_0x4bb867[_0x19ff('0x13d')]);}else if(this[_0x19ff('0x14')][_0x4bb867[_0x19ff('0xae')]][_0x19ff('0x75')]){logger[_0x19ff('0x59')]('[syncHangup][talking][cause]',_0x4bb867[_0x19ff('0xae')],_0x4bb867[_0x19ff('0x13d')],_0x19ff('0xbf'),_0x9e9b14[_0x19ff('0x26')],_0x19ff('0x74'),_0x9e9b14[_0x19ff('0x2b')]);this[_0x19ff('0x13e')](_0x4bb867,_0x4bb867['linkedid'],_0x4bb867[_0x19ff('0x13d')]);}}};Preview[_0x19ff('0xf')][_0x19ff('0x1d')]=function(_0x433cd6){if(this[_0x19ff('0x14')][_0x433cd6[_0x19ff('0xe7')]]&&_0x433cd6[_0x19ff('0xe7')]!==_0x433cd6[_0x19ff('0x140')]){this[_0x19ff('0x13e')](_0x433cd6,_0x433cd6['destlinkedid'],_0x433cd6['dialstatus']);}};Preview[_0x19ff('0xf')][_0x19ff('0x1c')]=function(_0x1d4bb5){if(this['actions'][_0x1d4bb5['linkedid']]&&_0x1d4bb5['linkedid']!==_0x1d4bb5[_0x19ff('0xb3')]&&!this[_0x19ff('0x14')][_0x1d4bb5[_0x19ff('0xae')]]['dialAnswer']){if(_0x1d4bb5[_0x19ff('0x13d')]==='1'){this[_0x19ff('0x13e')](_0x1d4bb5,_0x1d4bb5['linkedid'],_0x1d4bb5[_0x19ff('0x13d')]);}}};Preview['prototype'][_0x19ff('0x141')]=function(_0x1fb012,_0x4f90fd,_0x4801ca){if(this['actions'][_0x1fb012]){if(_[_0x19ff('0x70')](this[_0x19ff('0x14')][_0x1fb012][_0x19ff('0x142')])){this[_0x19ff('0x14')][_0x1fb012]['variables']={};}this[_0x19ff('0x14')][_0x1fb012]['variables'][_0x4f90fd]=_0x4801ca;}};Preview['prototype'][_0x19ff('0x20')]=function(_0x46f44f){try{if(!_[_0x19ff('0x70')](_0x46f44f)){if(ut['filterKey'](_[_0x19ff('0x143')](_0x46f44f['variable'])[0x0])){this[_0x19ff('0x141')](_0x46f44f[_0x19ff('0xb3')],_[_0x19ff('0x143')](_0x46f44f['variable'])[0x0],_0x46f44f[_0x19ff('0x144')]);}}}catch(_0x371872){logger[_0x19ff('0x145')](_0x19ff('0x146'),util[_0x19ff('0x147')](_0x371872,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x300876){if(_0x300876){if(this[_0x19ff('0x14')][_0x300876[_0x19ff('0x148')]]){this[_0x19ff('0x14')][_0x300876[_0x19ff('0x148')]][_0x19ff('0x149')]=!![];}}};Preview[_0x19ff('0xf')]['syncBlindTransfer']=function(_0xe98f7c){if(_0xe98f7c){if(this['actions'][_0xe98f7c['transfererlinkedid']]){this[_0x19ff('0x14')][_0xe98f7c[_0x19ff('0x14a')]][_0x19ff('0x149')]=!![];}}};module[_0x19ff('0x14b')]=Preview;
\ No newline at end of file
diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js
index e85613f..99a7311 100644
--- a/server/services/ami/preview/rpcDb.js
+++ b/server/services/ami/preview/rpcDb.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56e7=['xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','[moveContactManagedDialer]\x20','checkIsBlackList','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x56e7,0x7b));var _0x756e=function(_0x465ef6,_0x8adf2a){_0x465ef6=_0x465ef6-0x0;var _0x5cf599=_0x56e7[_0x465ef6];return _0x5cf599;};'use strict';var util=require('util');var BPromise=require(_0x756e('0x0'));var logger=require(_0x756e('0x1'))('preview');var _=require(_0x756e('0x2'));var cmHopper=require(_0x756e('0x3'));var cmHopperFinal=require(_0x756e('0x4'));var cmHopperHistory=require(_0x756e('0x5'));var cmHopperBlack=require(_0x756e('0x6'));var voiceQueueRt=require(_0x756e('0x7'));var agentReportPreview=require(_0x756e('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x3b3b8f){return function(_0x404189){logger[_0x756e('0x9')](_0x3b3b8f,util[_0x756e('0xa')](_0x404189,{'showHidden':![],'depth':null}));};}function create(_0x5c8589){return BPromise[_0x756e('0xb')]()['then'](cmHopperHistory[_0x756e('0xc')](_0x5c8589))[_0x756e('0xd')](loggerCatch(_0x756e('0xe')));}function createAgent(_0x4738dc){return BPromise['resolve']()['then'](agentReportPreview[_0x756e('0xc')](_0x4738dc))[_0x756e('0xd')](loggerCatch(_0x756e('0xe')));}function moveContact(_0x4c4d7c){return BPromise[_0x756e('0xb')]()[_0x756e('0xf')](cmHopper['moveContactManagedDialer'](_0x4c4d7c,!![]))['catch'](loggerCatch(_0x756e('0x10')));}exports['checkIsBlackList']=function(_0x459237){return BPromise[_0x756e('0xb')]()[_0x756e('0xf')](cmHopperBlack[_0x756e('0x11')](_0x459237))[_0x756e('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x36de2a){return BPromise[_0x756e('0xb')]()[_0x756e('0xf')](cmHopper['getContactPreview'](_0x36de2a))['catch'](loggerCatch(_0x756e('0x12')));};exports[_0x756e('0xc')]=function(_0x1cf73d,_0x296b14){create(_0x1cf73d)[_0x756e('0xd')](loggerCatch(_0x296b14));moveContact(_0x1cf73d)[_0x756e('0xd')](loggerCatch(_0x296b14));};exports[_0x756e('0x13')]=function(_0x1a8614,_0xb17214){createAgent(_0x1a8614)['catch'](loggerCatch(_0xb17214));};exports[_0x756e('0x14')]=function(_0x47c3c4,_0x4d7581){create(_0x47c3c4)[_0x756e('0xd')](loggerCatch(_0x4d7581));};exports[_0x756e('0x15')]=function(_0x30bc11,_0xe26ae){moveContact(_0x30bc11)[_0x756e('0xd')](loggerCatch(_0xe26ae));};exports[_0x756e('0x16')]=function(_0xb00195,_0x27e1eb,_0x88787d){if(_0x27e1eb){_0xb00195[_0x756e('0x17')]=null;}if(_0x88787d){_0xb00195[_0x756e('0x18')]=![];}return BPromise[_0x756e('0xb')]()[_0x756e('0xf')](cmHopper[_0x756e('0x16')](_0xb00195))[_0x756e('0xd')](loggerCatch(_0x756e('0x19')));};exports['countReScheduled']=function(_0x335523){return BPromise['resolve']()[_0x756e('0xf')](cmHopper[_0x756e('0x1a')](_0x335523))[_0x756e('0xd')](loggerCatch(_0x756e('0x1b')));};exports['unlockContact']=function(_0x3ef5ef){return BPromise[_0x756e('0xb')]()[_0x756e('0xf')](cmHopper['unlockContact']({'UserId':null},_0x3ef5ef,0x1))[_0x756e('0xd')](loggerCatch(_0x756e('0x1c')));};exports[_0x756e('0x1d')]=function(_0x555912){return BPromise[_0x756e('0xb')]()[_0x756e('0xf')](cmHopper['unlockContact']({'active':![]},_0x555912,0x1))[_0x756e('0xd')](loggerCatch(_0x756e('0x1e')));};exports[_0x756e('0x1f')]=function(_0x5a1cf0){var _0x3c332e={};_0x3c332e[_0x756e('0x20')]=_0x5a1cf0['type'];_0x3c332e[_0x756e('0x21')]=_0x5a1cf0[_0x756e('0x21')];_0x3c332e['calleridnum']=_0x5a1cf0[_0x756e('0x22')];_0x3c332e[_0x756e('0x23')]=_0x5a1cf0[_0x756e('0x23')];_0x3c332e[_0x756e('0x24')]=_0x5a1cf0[_0x756e('0x24')];_0x3c332e['queuecallerjoinAt']=_0x5a1cf0[_0x756e('0x25')];_0x3c332e['queuecallerleaveAt']=_0x5a1cf0['answertime'];_0x3c332e[_0x756e('0x26')]=0x1;_0x3c332e['queuecallercompleteAt']=_0x5a1cf0[_0x756e('0x27')];_0x3c332e[_0x756e('0x28')]=_0x5a1cf0[_0x756e('0x29')];_0x3c332e[_0x756e('0x2a')]=_0x756e('0x2b');_0x3c332e[_0x756e('0x2c')]=_0x756e('0x2d');_0x3c332e[_0x756e('0x2e')]=0x0;_0x3c332e[_0x756e('0x2f')]=0x1;_0x3c332e[_0x756e('0x30')]=_0x5a1cf0[_0x756e('0x29')];_0x3c332e[_0x756e('0x31')]='COMPLETED';return BPromise['resolve']()[_0x756e('0xf')](voiceQueueReport[_0x756e('0x32')](_0x3c332e))[_0x756e('0xd')](loggerCatch(_0x756e('0x33')));};exports[_0x756e('0x34')]=function(_0x31a507,_0x1e977a){return BPromise['resolve']()['then'](cmHopper['getContactRecallMe'](_0x31a507,_0x1e977a))[_0x756e('0xd')](loggerCatch(_0x756e('0x35')));};exports[_0x756e('0x36')]=function(_0x4fadda){return BPromise[_0x756e('0xb')]()[_0x756e('0xf')](cmHopper['rescheduleContact'](_0x4fadda,!![],!![]))[_0x756e('0xd')](loggerCatch(_0x756e('0x37')));};
\ No newline at end of file
+var _0x6b8f=['queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','preview','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20','resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname'];(function(_0xfea0d,_0x113dc1){var _0x6adde8=function(_0x1550b8){while(--_0x1550b8){_0xfea0d['push'](_0xfea0d['shift']());}};_0x6adde8(++_0x113dc1);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x2a6198,_0xd202e8){_0x2a6198=_0x2a6198-0x0;var _0x430a1a=_0x6b8f[_0x2a6198];return _0x430a1a;};'use strict';var util=require('util');var BPromise=require(_0xf6b8('0x0'));var logger=require('../../../config/logger')(_0xf6b8('0x1'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xf6b8('0x2'));var cmHopperHistory=require(_0xf6b8('0x3'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xf6b8('0x4'));var agentReportPreview=require(_0xf6b8('0x5'));var voiceQueueReport=require(_0xf6b8('0x6'));function loggerCatch(_0x549eac){return function(_0x2d035e){logger[_0xf6b8('0x7')](_0x549eac,util[_0xf6b8('0x8')](_0x2d035e,{'showHidden':![],'depth':null}));};}function create(_0x3c3430){return BPromise['resolve']()['then'](cmHopperHistory[_0xf6b8('0x9')](_0x3c3430))['catch'](loggerCatch(_0xf6b8('0xa')));}function createAgent(_0x7ac5fd){return BPromise[_0xf6b8('0xb')]()[_0xf6b8('0xc')](agentReportPreview[_0xf6b8('0x9')](_0x7ac5fd))[_0xf6b8('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x481679){return BPromise['resolve']()[_0xf6b8('0xc')](cmHopper[_0xf6b8('0xe')](_0x481679,!![]))[_0xf6b8('0xd')](loggerCatch(_0xf6b8('0xf')));}exports['checkIsBlackList']=function(_0x4e5235){return BPromise[_0xf6b8('0xb')]()[_0xf6b8('0xc')](cmHopperBlack['checkIsBlackList'](_0x4e5235))[_0xf6b8('0xd')](loggerCatch(_0xf6b8('0x10')));};exports[_0xf6b8('0x11')]=function(_0x59bfed){return BPromise[_0xf6b8('0xb')]()['then'](cmHopper[_0xf6b8('0x11')](_0x59bfed))[_0xf6b8('0xd')](loggerCatch(_0xf6b8('0x12')));};exports[_0xf6b8('0x9')]=function(_0x12f9a8,_0x567b58){create(_0x12f9a8)['catch'](loggerCatch(_0x567b58));moveContact(_0x12f9a8)[_0xf6b8('0xd')](loggerCatch(_0x567b58));};exports['createAgentHistory']=function(_0x3cf63c,_0x206a84){createAgent(_0x3cf63c)['catch'](loggerCatch(_0x206a84));};exports['createCustomerHistory']=function(_0x1d0ee9,_0x2e2b29){create(_0x1d0ee9)[_0xf6b8('0xd')](loggerCatch(_0x2e2b29));};exports[_0xf6b8('0x13')]=function(_0x4df5f4,_0x59f9df){moveContact(_0x4df5f4)['catch'](loggerCatch(_0x59f9df));};exports[_0xf6b8('0x14')]=function(_0x2a8195,_0x99d51,_0x56b48a){if(_0x99d51){_0x2a8195[_0xf6b8('0x15')]=null;}if(_0x56b48a){_0x2a8195[_0xf6b8('0x16')]=![];}return BPromise[_0xf6b8('0xb')]()[_0xf6b8('0xc')](cmHopper['rescheduleContact'](_0x2a8195))[_0xf6b8('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xf6b8('0x17')]=function(_0x2b5bd3){return BPromise[_0xf6b8('0xb')]()[_0xf6b8('0xc')](cmHopper[_0xf6b8('0x17')](_0x2b5bd3))[_0xf6b8('0xd')](loggerCatch('[countReScheduled]\x20'));};exports[_0xf6b8('0x18')]=function(_0x1ebfea){return BPromise['resolve']()[_0xf6b8('0xc')](cmHopper[_0xf6b8('0x18')]({'UserId':null},_0x1ebfea,0x1))[_0xf6b8('0xd')](loggerCatch(_0xf6b8('0x19')));};exports[_0xf6b8('0x1a')]=function(_0x573ad8){return BPromise['resolve']()[_0xf6b8('0xc')](cmHopper[_0xf6b8('0x18')]({'active':![]},_0x573ad8,0x1))['catch'](loggerCatch(_0xf6b8('0x1b')));};exports[_0xf6b8('0x1c')]=function(_0x888319){var _0x5a7f55={};_0x5a7f55[_0xf6b8('0x1d')]=_0x888319[_0xf6b8('0x1d')];_0x5a7f55['uniqueid']=_0x888319[_0xf6b8('0x1e')];_0x5a7f55[_0xf6b8('0x1f')]=_0x888319[_0xf6b8('0x1f')];_0x5a7f55[_0xf6b8('0x20')]=_0x888319['calleridname'];_0x5a7f55[_0xf6b8('0x21')]=_0x888319[_0xf6b8('0x21')];_0x5a7f55[_0xf6b8('0x22')]=_0x888319['answertime'];_0x5a7f55[_0xf6b8('0x23')]=_0x888319[_0xf6b8('0x24')];_0x5a7f55[_0xf6b8('0x25')]=0x1;_0x5a7f55['queuecallercompleteAt']=_0x888319[_0xf6b8('0x26')];_0x5a7f55[_0xf6b8('0x27')]=_0x888319[_0xf6b8('0x28')];_0x5a7f55[_0xf6b8('0x29')]='from-sip';_0x5a7f55[_0xf6b8('0x2a')]=_0xf6b8('0x2b');_0x5a7f55[_0xf6b8('0x2c')]=0x0;_0x5a7f55['assigned']=0x1;_0x5a7f55['lastAssignedTo']=_0x888319[_0xf6b8('0x28')];_0x5a7f55[_0xf6b8('0x2d')]=_0xf6b8('0x2e');return BPromise[_0xf6b8('0xb')]()[_0xf6b8('0xc')](voiceQueueReport[_0xf6b8('0x2f')](_0x5a7f55))[_0xf6b8('0xd')](loggerCatch(_0xf6b8('0x30')));};exports[_0xf6b8('0x31')]=function(_0x3b9493,_0x3a45e4){return BPromise[_0xf6b8('0xb')]()[_0xf6b8('0xc')](cmHopper[_0xf6b8('0x31')](_0x3b9493,_0x3a45e4))[_0xf6b8('0xd')](loggerCatch(_0xf6b8('0x32')));};exports[_0xf6b8('0x33')]=function(_0x132f2b){return BPromise['resolve']()['then'](cmHopper[_0xf6b8('0x14')](_0x132f2b,!![],!![]))[_0xf6b8('0xd')](loggerCatch(_0xf6b8('0x34')));};
\ No newline at end of file
diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js
index 50d0666..2e261c3 100644
--- a/server/services/ami/preview/util/util.js
+++ b/server/services/ami/preview/util/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8212=['type','campaigntype','dialAnswer','active','countnoanswerretry','countglobal','callback','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','diff','seconds','error','inspect','logger','info','message','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','logLookAgent','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','lastevent','queue','interface','buildAcw','not_inuse','reachable','push','getDiff','milliseconds','createBody','filterKey','idContact'];(function(_0x15cc63,_0x4e6b33){var _0x2687b2=function(_0x3e5d55){while(--_0x3e5d55){_0x15cc63['push'](_0x15cc63['shift']());}};_0x2687b2(++_0x4e6b33);}(_0x8212,0xb3));var _0x2821=function(_0x2036fa,_0x168ee5){_0x2036fa=_0x2036fa-0x0;var _0x1dd8d6=_0x8212[_0x2036fa];return _0x1dd8d6;};'use strict';var util=require(_0x2821('0x0'));var _=require(_0x2821('0x1'));var moment=require('moment');var logger=require(_0x2821('0x2'))(_0x2821('0x3'));var ipAgi=process[_0x2821('0x4')][_0x2821('0x5')]||_0x2821('0x6');function getSeconds(_0x1b2d87,_0xbc7b3c){var _0x4151aa=moment(_0x1b2d87)['milliseconds'](0x0);var _0x2f22bd=moment(_0xbc7b3c)['milliseconds'](0x0);return _0x4151aa[_0x2821('0x7')](_0x2f22bd,_0x2821('0x8'));}exports['loggerCatch']=function(_0x3644aa){return function(_0x201069){logger[_0x2821('0x9')](_0x3644aa,util[_0x2821('0xa')](_0x201069,{'showHidden':![],'depth':null}));};};exports[_0x2821('0xb')]=function(_0x17d352,_0x258b64){logger[_0x2821('0xc')](_0x17d352,util[_0x2821('0xa')](_0x258b64,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x11a5fe,_0x2023ec){logger[_0x2821('0x9')](_0x11a5fe,util['inspect'](_0x2023ec,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x532ad6){return function(_0x4c81c1){logger[_0x2821('0xc')](_0x532ad6,util[_0x2821('0xa')](_0x4c81c1,{'showHidden':![],'depth':null}));};};exports[_0x2821('0xd')]=function(_0x223234,_0x353943,_0x2fbc96){return{'message':_0x223234,'unlock':_0x353943,'active':_0x2fbc96};};exports['getCallerId']=function(_0x3ba091,_0x5030fc,_0x5a92f0){if(!_[_0x2821('0xe')](_0x5a92f0)&&_0x2821('0xf')===typeof _0x5a92f0&&!_[_0x2821('0x10')](_0x5a92f0)){if(!_[_0x2821('0xe')](_0x5030fc)&&'string'===typeof _0x5030fc&&!_[_0x2821('0x10')](_0x5030fc)){return util['format'](_0x2821('0x11'),_0x5030fc,_0x5a92f0);}return util[_0x2821('0x12')](_0x2821('0x11'),_0x5a92f0,_0x5a92f0);}if(!_[_0x2821('0xe')](_0x3ba091)&&_0x2821('0xf')===typeof _0x3ba091&&!_[_0x2821('0x10')](_0x3ba091)){return _0x3ba091;}return _0x2821('0x13');};exports[_0x2821('0x14')]=function(_0x48b0e8){if(_[_0x2821('0x15')](_0x48b0e8)){return![];}return _0x48b0e8;};exports['addVariables']=function(_0x399784,_0xb7b9a0,_0x1d690e,_0x8ba96e,_0x38d898,_0x2fa9a8){var _0x1c0907={'XMD-QUEUE':_0xb7b9a0[_0x2821('0x16')]?_0xb7b9a0[_0x2821('0x16')][_0x2821('0x17')]:'','XMD-CALLERID':_0x8ba96e,'XMD-CALLERID-PREVIEW':_0x2fa9a8?util[_0x2821('0x12')]('\x22%s\x22\x20<%s>',_0x2fa9a8['calleridname'],_0x2fa9a8[_0x2821('0x18')]):_0x8ba96e,'XMD-DIALID':_0x38d898,'XMD-CONTACTID':_0xb7b9a0[_0x2821('0x19')],'XMD-CDRTYPE':_0x2821('0x1a'),'CALLERID(all)':_0x8ba96e,'XMD-VOICEQUEUEID':_0xb7b9a0[_0x2821('0x1b')],'XMD-DIALCHANNEL':_0x1d690e,'XMD-DIALTIMEOUT':_0x399784[_0x2821('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x2821('0x12')](_0x2821('0x1d'),_0x399784[_0x2821('0x1e')]?'g':'',_[_0x2821('0x10')](_0x399784[_0x2821('0x1f')])?'':_0x2821('0x20')),'XMD-DIALURL':_0x399784[_0x2821('0x21')]||'','XMD-AGI':_0x399784[_0x2821('0x22')]?util[_0x2821('0x12')](_0x2821('0x23'),ipAgi,_0x399784[_0x2821('0x22')]):_0x2821('0x24'),'XMD-AGIAFTER':_0x399784[_0x2821('0x1e')]?util[_0x2821('0x12')](_0x2821('0x23'),ipAgi,_0x399784['dialQueueProject2']):_0x2821('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x2fa9a8?_0x2fa9a8['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x2fa9a8?_0x2fa9a8[_0x2821('0x25')]:'','XMD-DESTINATION':_0x2821('0x26')};if(!_[_0x2821('0x10')](_0x399784[_0x2821('0x1f')])){_0x1c0907[util['format']('%s',_0x2821('0x27'))]=_0x399784[_0x2821('0x1f')];_0x1c0907[util['format']('%s',_0x2821('0x28'))]=_0x38d898;}if(_0xb7b9a0&&_0xb7b9a0[_0x2821('0x29')]){for(var _0x3d2d07 in _0xb7b9a0['Contact']){if(_0xb7b9a0[_0x2821('0x29')][_0x2821('0x2a')](_0x3d2d07)){if(!_[_0x2821('0x15')](_0xb7b9a0[_0x2821('0x29')][_0x3d2d07])&&_0x3d2d07!=='id'&&_0x3d2d07!==_0x2821('0x2b')&&_0x3d2d07!==_0x2821('0x2c')&&_0x3d2d07!==_0x2821('0x2d')){_0x1c0907[util['format'](_0x2821('0x2e'),_0x2821('0x2f'),_[_0x2821('0x30')](_0x3d2d07))]=_0xb7b9a0[_0x2821('0x29')][_0x3d2d07];}}}}return _0x1c0907;};exports[_0x2821('0x31')]=function(_0x31d9e3){var _0x1cb61a={};for(var _0x2c3846 in _0x31d9e3){if(_0x31d9e3[_0x2821('0x2a')](_0x2c3846)){_0x1cb61a[util[_0x2821('0x12')]('%s',_[_0x2821('0x32')](_0x2c3846))]=_0x31d9e3[_0x2c3846];}}return{'variables':_0x1cb61a};};exports['updateOriginated']=function(_0x1880f6,_0x132893){if(!_[_0x2821('0x15')](_0x1880f6)){if(_0x1880f6[_0x2821('0x2a')]('originated')){if(_0x1880f6[_0x2821('0x33')]>0x0){_0x1880f6[_0x2821('0x33')]-=0x1;}else{logger[_0x2821('0x9')](_0x2821('0x34'),_0x132893);}}}else{logger[_0x2821('0x9')](_0x2821('0x35'),_0x132893);}};exports[_0x2821('0x36')]=function(_0x2e0eaf){var _0x2f30d6=moment()[_0x2821('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e0eaf[_0x2821('0x37')]=0xd;_0x2e0eaf[_0x2821('0x38')]=_0x2821('0x39');_0x2e0eaf[_0x2821('0x3a')]=_0x2f30d6;_0x2e0eaf[_0x2821('0x3b')]=_0x2f30d6;_0x2e0eaf['endtime']=_0x2f30d6;};exports[_0x2821('0x3c')]=function(_0x58f3ce,_0x4f7a17,_0x3b4b88){var _0x421b76=moment()[_0x2821('0x12')](_0x2821('0x3d'));_0x58f3ce[_0x2821('0x37')]=_0x4f7a17;_0x58f3ce[_0x2821('0x38')]=_0x3b4b88;_0x58f3ce[_0x2821('0x3b')]=_0x421b76;_0x58f3ce['ringtime']=getSeconds(_0x58f3ce['responsetime'],_0x58f3ce[_0x2821('0x3a')]);};exports[_0x2821('0x3e')]=function(_0x45b76a,_0x2737a7,_0x277af7){_0x45b76a['membername']=_0x2737a7;_0x45b76a['UserId']=_0x277af7;};exports[_0x2821('0x3f')]=function(_0x26d389,_0x234f59,_0xde4a38){var _0x3deef7=moment()[_0x2821('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x26d389[_0x2821('0x37')]=_0x234f59;_0x26d389[_0x2821('0x38')]=_0xde4a38;_0x26d389['responsetime']=_0x26d389[_0x2821('0x3b')]?_0x26d389[_0x2821('0x3b')]:_0x3deef7;_0x26d389[_0x2821('0x40')]=_0x26d389[_0x2821('0x40')]?_0x26d389[_0x2821('0x40')]:_0x3deef7;_0x26d389['ringtime']=getSeconds(_0x26d389[_0x2821('0x3b')]||0x0,_0x26d389[_0x2821('0x3a')]||0x0);_0x26d389[_0x2821('0x41')]=_0x26d389[_0x2821('0x42')]?getSeconds(_0x26d389['endtime'],_0x26d389['answertime']):0x0;};exports[_0x2821('0x43')]=function(_0x37bdbd){return _0x37bdbd===_0x2821('0x44');};exports[_0x2821('0x45')]=function(_0x18fd69,_0x2bae3b,_0x107706,_0x5dc6cd,_0x5e0715){var _0x278d2b=_0x5dc6cd?'RECALL':_0x18fd69[_0x2821('0x46')];_0x278d2b=_0x5e0715?_0x2821('0x47'):_0x278d2b;return{'actionid':_0x18fd69[_0x2821('0x48')],'action':_0x2821('0x49'),'channel':_0x18fd69[_0x2821('0x4a')],'callerid':util[_0x2821('0x12')](_0x2821('0x11'),_0x278d2b,_0x18fd69['calleridnum']),'Exten':_0x2821('0x26'),'Context':_0x2821('0x4b'),'Priority':'1','variable':_0x107706,'timeout':(_0x2bae3b[_0x2821('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x18fd69[_0x2821('0x48')]};};exports[_0x2821('0x4d')]=function(_0x29386e){return _0x29386e[_0x2821('0x4e')]+_0x29386e[_0x2821('0x4f')]+_0x29386e['countnoanswerretry']+_0x29386e[_0x2821('0x50')]+_0x29386e[_0x2821('0x51')];};exports[_0x2821('0x52')]=function(_0x3f370d){var _0x487d18=_[_0x2821('0x53')](_0x3f370d);_0x487d18[_0x2821('0x37')]=0xf;_0x487d18[_0x2821('0x38')]='Global';return _0x487d18;};exports['scheduledAt']=function(_0x5162b3,_0x9721,_0x16283e){var _0x459794={};_0x459794[_0x9721]=_0x5162b3[_0x9721];_0x459794['active']=![];_0x459794[_0x2821('0x54')]=moment()[_0x2821('0x55')](_0x16283e,_0x2821('0x56'))[_0x2821('0x12')](_0x2821('0x3d'));_0x459794[_0x2821('0x19')]=_0x5162b3['ContactId'];_0x459794['ListId']=_0x5162b3[_0x2821('0x57')];_0x459794[_0x2821('0x1b')]=_0x5162b3['VoiceQueueId']||undefined;return _0x459794;};exports[_0x2821('0x58')]=function(_0x4421c5,_0x684af3){if(!_[_0x2821('0x15')](_0x4421c5)){if(_0x4421c5[_0x2821('0x59')]>0x0){_0x4421c5[_0x2821('0x59')]-=0x1;}else{logger[_0x2821('0x9')](_0x684af3,_0x2821('0x5a'));}}else{logger[_0x2821('0x9')](_0x684af3,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x5436f6){if(_0x5436f6<=0x0){return!![];}return![];};exports['buildObj']=function(_0x4d5eaa,_0x50ab8e){_0x4d5eaa[_0x2821('0x5b')]=_0x50ab8e;_0x4d5eaa[_0x2821('0x17')]=_0x4d5eaa[_0x2821('0x5c')];_0x4d5eaa[_0x2821('0x5d')]=_0x4d5eaa[_0x2821('0x4a')];return _0x4d5eaa;};exports[_0x2821('0x5e')]=function(_0x436574){var _0x5d276c={};_0x5d276c[_0x2821('0x5c')]=_0x436574[_0x2821('0x5c')];_0x5d276c['interface']=_0x436574[_0x2821('0x4a')];_0x5d276c[_0x2821('0x48')]=_0x436574[_0x2821('0x48')];return _0x5d276c;};exports['agentReadyId']=function(_0x5f4d83){var _0x21928c=[];for(var _0xc969df in _0x5f4d83){if(_0x5f4d83[_0x2821('0x2a')](_0xc969df)){if(!_[_0x2821('0x15')](_0x5f4d83[_0xc969df])&&_0x5f4d83[_0xc969df][_0x2821('0x37')]===_0x2821('0x5f')&&_0x5f4d83[_0xc969df]['status']===_0x2821('0x60')){_0x21928c[_0x2821('0x61')](_0x5f4d83[_0xc969df]['id']);}}}return _0x21928c;};exports[_0x2821('0x62')]=function(_0x16a67b){var _0x31d5f6=moment()[_0x2821('0x63')](0x0);var _0x3ba3b4=moment(_0x16a67b)[_0x2821('0x63')](0x0);return _0x31d5f6[_0x2821('0x7')](_0x3ba3b4,_0x2821('0x8'));};exports[_0x2821('0x64')]=function(_0x4e6042){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4e6042[_0x2821('0x19')],'ListId':_0x4e6042[_0x2821('0x57')],'VoiceQueueId':_0x4e6042[_0x2821('0x1b')]||undefined,'CampaignId':_0x4e6042['CampaignId']||undefined};};exports[_0x2821('0x65')]=function(_0x512c68){if(_0x512c68===_0x2821('0x48')||_0x512c68===_0x2821('0x66')||_0x512c68===_0x2821('0x5c')||_0x512c68===_0x2821('0x67')||_0x512c68===_0x2821('0x68')||_0x512c68===_0x2821('0x69')||_0x512c68==='membername'||_0x512c68===_0x2821('0x4a')||_0x512c68===_0x2821('0x46')||_0x512c68===_0x2821('0x6a')||_0x512c68===_0x2821('0x18')||_0x512c68===_0x2821('0x54')||_0x512c68===_0x2821('0x4e')||_0x512c68==='countcongestionretry'||_0x512c68===_0x2821('0x6b')||_0x512c68===_0x2821('0x6c')||_0x512c68===_0x2821('0x6d')||_0x512c68==='callbackuniqueid'||_0x512c68===_0x2821('0x6e')||_0x512c68===_0x2821('0x6f')||_0x512c68===_0x2821('0x19')||_0x512c68===_0x2821('0x57')||_0x512c68===_0x2821('0x70')||_0x512c68===_0x2821('0x1b')||_0x512c68===_0x2821('0x71')||_0x512c68===_0x2821('0x72')||_0x512c68==='xmd-queue'||_0x512c68===_0x2821('0x73')||_0x512c68===_0x2821('0x74')||_0x512c68===_0x2821('0x75')||_0x512c68===_0x2821('0x76')||_0x512c68===_0x2821('0x77')||_0x512c68===_0x2821('0x78')||_0x512c68==='xmd-dialchannel'||_0x512c68==='xmd-contactid'||_0x512c68===_0x2821('0x79')||_0x512c68===_0x2821('0x7a')||_0x512c68===_0x2821('0x7b')||_0x512c68===_0x2821('0x7c')||_0x512c68==='rtpaudioqos'||_0x512c68===_0x2821('0x7d')||_0x512c68===_0x2821('0x7e')||_0x512c68===_0x2821('0x7f')||_0x512c68==='rtpaudioqosloss'||_0x512c68==='rtpaudioqoslossbridged'||_0x512c68===_0x2821('0x80')||_0x512c68===_0x2821('0x81')||_0x512c68==='rtpaudioqos'||_0x512c68===_0x2821('0x7d')||_0x512c68===_0x2821('0x7e')||_0x512c68===_0x2821('0x7f')||_0x512c68===_0x2821('0x82')||_0x512c68==='rtpaudioqoslossbridged'||_0x512c68===_0x2821('0x80')||_0x512c68===_0x2821('0x81')||_0x512c68===_0x2821('0x83')||_0x512c68===_0x2821('0x84')||_0x512c68==='state'||_0x512c68==='statedesc'){return![];}return!![];};exports[_0x2821('0x85')]=function(_0x4b3558,_0x254578){var _0x4e414d,_0x156839,_0x484f8b;if(_0x254578<=0x0){_0x254578=0x1;}_0x4e414d=new RegExp(_0x2821('0x86')+_0x254578+'}$');_0x156839=Math[_0x2821('0x87')](0xa,_0x254578-0x1);_0x484f8b=Math[_0x2821('0x87')](0xa,_0x254578)-0x1;return util[_0x2821('0x12')]('%s',_[_0x2821('0x88')](_0x4b3558,_0x4e414d,_[_0x2821('0x89')](_0x156839,_0x484f8b)));};exports[_0x2821('0x8a')]=function(_0x488eca){var _0x364e0b=_0x488eca[_0x2821('0x8b')](/"(.*?)"/);return _0x364e0b?_0x364e0b[0x1]:_0x488eca;};exports[_0x2821('0x8c')]=function(_0x34f5f8){var _0xa55967=_0x34f5f8['match'](/<(.*?)>/);return _0xa55967?_0xa55967[0x1]:_0x34f5f8;};
\ No newline at end of file
+var _0x9e6d=['xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','loggerError','logger2','info','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','Queue','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','updatedAt','%s%s','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','starttime','membername','logCustomer','ringtime','talktime','answertime','isFailure','Failure','RECALL','BOOKED','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','name','queue','interface','buildAcw','uniqueid','agentReadyId','not_inuse','status','push','getDiff','createBody','filterKey','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0xf2887f,_0x22941f){_0xf2887f=_0xf2887f-0x0;var _0x38c413=_0x9e6d[_0xf2887f];return _0x38c413;};'use strict';var util=require(_0xd9e6('0x0'));var _=require('lodash');var moment=require(_0xd9e6('0x1'));var logger=require(_0xd9e6('0x2'))(_0xd9e6('0x3'));var ipAgi=process['env'][_0xd9e6('0x4')]||_0xd9e6('0x5');function getSeconds(_0x2f1c0,_0x3b2951){var _0x5e363d=moment(_0x2f1c0)[_0xd9e6('0x6')](0x0);var _0x167f8f=moment(_0x3b2951)['milliseconds'](0x0);return _0x5e363d['diff'](_0x167f8f,_0xd9e6('0x7'));}exports[_0xd9e6('0x8')]=function(_0x1103ba){return function(_0x5b296b){logger[_0xd9e6('0x9')](_0x1103ba,util[_0xd9e6('0xa')](_0x5b296b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x6430c2,_0x1290ce){logger['info'](_0x6430c2,util['inspect'](_0x1290ce,{'showHidden':![],'depth':null}));};exports[_0xd9e6('0xb')]=function(_0x32e9e6,_0x26d583){logger[_0xd9e6('0x9')](_0x32e9e6,util[_0xd9e6('0xa')](_0x26d583,{'showHidden':![],'depth':null}));};exports[_0xd9e6('0xc')]=function(_0x2c71c4){return function(_0x350b53){logger[_0xd9e6('0xd')](_0x2c71c4,util['inspect'](_0x350b53,{'showHidden':![],'depth':null}));};};exports[_0xd9e6('0xe')]=function(_0xe7615,_0x593da1,_0x51e0b2){return{'message':_0xe7615,'unlock':_0x593da1,'active':_0x51e0b2};};exports[_0xd9e6('0xf')]=function(_0x5a9940,_0x3c69bb,_0x1b3e86){if(!_[_0xd9e6('0x10')](_0x1b3e86)&&_0xd9e6('0x11')===typeof _0x1b3e86&&!_[_0xd9e6('0x12')](_0x1b3e86)){if(!_['isUndefined'](_0x3c69bb)&&'string'===typeof _0x3c69bb&&!_[_0xd9e6('0x12')](_0x3c69bb)){return util['format'](_0xd9e6('0x13'),_0x3c69bb,_0x1b3e86);}return util[_0xd9e6('0x14')](_0xd9e6('0x13'),_0x1b3e86,_0x1b3e86);}if(!_[_0xd9e6('0x10')](_0x5a9940)&&_0xd9e6('0x11')===typeof _0x5a9940&&!_[_0xd9e6('0x12')](_0x5a9940)){return _0x5a9940;}return _0xd9e6('0x15');};exports[_0xd9e6('0x16')]=function(_0x2a1bf5){if(_[_0xd9e6('0x17')](_0x2a1bf5)){return![];}return _0x2a1bf5;};exports['addVariables']=function(_0x4eb9b0,_0x44ae12,_0x1063b4,_0x19dfd7,_0x4a6e39,_0x356a3f){var _0x106026={'XMD-QUEUE':_0x44ae12[_0xd9e6('0x18')]?_0x44ae12[_0xd9e6('0x18')]['name']:'','XMD-CALLERID':_0x19dfd7,'XMD-CALLERID-PREVIEW':_0x356a3f?util['format'](_0xd9e6('0x13'),_0x356a3f[_0xd9e6('0x19')],_0x356a3f[_0xd9e6('0x1a')]):_0x19dfd7,'XMD-DIALID':_0x4a6e39,'XMD-CONTACTID':_0x44ae12['ContactId'],'XMD-CDRTYPE':_0xd9e6('0x1b'),'CALLERID(all)':_0x19dfd7,'XMD-VOICEQUEUEID':_0x44ae12[_0xd9e6('0x1c')],'XMD-DIALCHANNEL':_0x1063b4,'XMD-DIALTIMEOUT':_0x4eb9b0[_0xd9e6('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xd9e6('0x14')](_0xd9e6('0x1e'),_0x4eb9b0[_0xd9e6('0x1f')]?'g':'',_[_0xd9e6('0x12')](_0x4eb9b0['monitor_format'])?'':_0xd9e6('0x20')),'XMD-DIALURL':_0x4eb9b0[_0xd9e6('0x21')]||'','XMD-AGI':_0x4eb9b0[_0xd9e6('0x22')]?util[_0xd9e6('0x14')](_0xd9e6('0x23'),ipAgi,_0x4eb9b0[_0xd9e6('0x22')]):'NONE','XMD-AGIAFTER':_0x4eb9b0[_0xd9e6('0x1f')]?util[_0xd9e6('0x14')](_0xd9e6('0x23'),ipAgi,_0x4eb9b0[_0xd9e6('0x1f')]):_0xd9e6('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x356a3f?_0x356a3f[_0xd9e6('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x356a3f?_0x356a3f[_0xd9e6('0x26')]:'','XMD-DESTINATION':_0xd9e6('0x27')};if(!_[_0xd9e6('0x12')](_0x4eb9b0[_0xd9e6('0x28')])){_0x106026[util[_0xd9e6('0x14')]('%s',_0xd9e6('0x29'))]=_0x4eb9b0[_0xd9e6('0x28')];_0x106026[util[_0xd9e6('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x4a6e39;}if(_0x44ae12&&_0x44ae12[_0xd9e6('0x2a')]){for(var _0x138473 in _0x44ae12[_0xd9e6('0x2a')]){if(_0x44ae12[_0xd9e6('0x2a')][_0xd9e6('0x2b')](_0x138473)){if(!_[_0xd9e6('0x17')](_0x44ae12[_0xd9e6('0x2a')][_0x138473])&&_0x138473!=='id'&&_0x138473!==_0xd9e6('0x2c')&&_0x138473!=='createdAt'&&_0x138473!==_0xd9e6('0x2d')){_0x106026[util[_0xd9e6('0x14')](_0xd9e6('0x2e'),'XMD-',_[_0xd9e6('0x2f')](_0x138473))]=_0x44ae12['Contact'][_0x138473];}}}}return _0x106026;};exports[_0xd9e6('0x30')]=function(_0x33ac4e){var _0x543b45={};for(var _0x547d0e in _0x33ac4e){if(_0x33ac4e[_0xd9e6('0x2b')](_0x547d0e)){_0x543b45[util[_0xd9e6('0x14')]('%s',_['toLower'](_0x547d0e))]=_0x33ac4e[_0x547d0e];}}return{'variables':_0x543b45};};exports[_0xd9e6('0x31')]=function(_0x5a5470,_0x3b9dc4){if(!_[_0xd9e6('0x17')](_0x5a5470)){if(_0x5a5470[_0xd9e6('0x2b')](_0xd9e6('0x32'))){if(_0x5a5470[_0xd9e6('0x32')]>0x0){_0x5a5470[_0xd9e6('0x32')]-=0x1;}else{logger[_0xd9e6('0x9')](_0xd9e6('0x33'),_0x3b9dc4);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x3b9dc4);}};exports[_0xd9e6('0x34')]=function(_0x1f5790){var _0x2b0bc6=moment()[_0xd9e6('0x14')](_0xd9e6('0x35'));_0x1f5790[_0xd9e6('0x36')]=0xd;_0x1f5790[_0xd9e6('0x37')]=_0xd9e6('0x38');_0x1f5790['starttime']=_0x2b0bc6;_0x1f5790[_0xd9e6('0x39')]=_0x2b0bc6;_0x1f5790[_0xd9e6('0x3a')]=_0x2b0bc6;};exports[_0xd9e6('0x3b')]=function(_0x59b4fd,_0x46871f,_0x29b73b){var _0x10293e=moment()[_0xd9e6('0x14')](_0xd9e6('0x35'));_0x59b4fd[_0xd9e6('0x36')]=_0x46871f;_0x59b4fd[_0xd9e6('0x37')]=_0x29b73b;_0x59b4fd['responsetime']=_0x10293e;_0x59b4fd['ringtime']=getSeconds(_0x59b4fd['responsetime'],_0x59b4fd[_0xd9e6('0x3c')]);};exports['logLookAgent']=function(_0x56b0a5,_0x452b7b,_0x39cc97){_0x56b0a5[_0xd9e6('0x3d')]=_0x452b7b;_0x56b0a5['UserId']=_0x39cc97;};exports[_0xd9e6('0x3e')]=function(_0x9d22ea,_0x296ac2,_0x53fce4){var _0x27bce0=moment()[_0xd9e6('0x14')](_0xd9e6('0x35'));_0x9d22ea[_0xd9e6('0x36')]=_0x296ac2;_0x9d22ea[_0xd9e6('0x37')]=_0x53fce4;_0x9d22ea['responsetime']=_0x9d22ea[_0xd9e6('0x39')]?_0x9d22ea['responsetime']:_0x27bce0;_0x9d22ea['endtime']=_0x9d22ea['endtime']?_0x9d22ea[_0xd9e6('0x3a')]:_0x27bce0;_0x9d22ea[_0xd9e6('0x3f')]=getSeconds(_0x9d22ea['responsetime']||0x0,_0x9d22ea[_0xd9e6('0x3c')]||0x0);_0x9d22ea[_0xd9e6('0x40')]=_0x9d22ea[_0xd9e6('0x41')]?getSeconds(_0x9d22ea[_0xd9e6('0x3a')],_0x9d22ea[_0xd9e6('0x41')]):0x0;};exports[_0xd9e6('0x42')]=function(_0x3935a6){return _0x3935a6===_0xd9e6('0x43');};exports['variablesAction']=function(_0xb17c20,_0x3d70fe,_0x473ce2,_0xba11d3,_0xdb10d4){var _0x1f58d0=_0xba11d3?_0xd9e6('0x44'):_0xb17c20[_0xd9e6('0x19')];_0x1f58d0=_0xdb10d4?_0xd9e6('0x45'):_0x1f58d0;return{'actionid':_0xb17c20['uniqueid'],'action':_0xd9e6('0x46'),'channel':_0xb17c20[_0xd9e6('0x47')],'callerid':util[_0xd9e6('0x14')](_0xd9e6('0x13'),_0x1f58d0,_0xb17c20[_0xd9e6('0x1a')]),'Exten':_0xd9e6('0x27'),'Context':_0xd9e6('0x48'),'Priority':'1','variable':_0x473ce2,'timeout':(_0x3d70fe[_0xd9e6('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0xb17c20['uniqueid']};};exports[_0xd9e6('0x4a')]=function(_0x43ac5d){return _0x43ac5d[_0xd9e6('0x4b')]+_0x43ac5d[_0xd9e6('0x4c')]+_0x43ac5d[_0xd9e6('0x4d')]+_0x43ac5d[_0xd9e6('0x4e')]+_0x43ac5d[_0xd9e6('0x4f')];};exports[_0xd9e6('0x50')]=function(_0x1b9973){var _0x5e4fa2=_[_0xd9e6('0x51')](_0x1b9973);_0x5e4fa2[_0xd9e6('0x36')]=0xf;_0x5e4fa2[_0xd9e6('0x37')]='Global';return _0x5e4fa2;};exports[_0xd9e6('0x52')]=function(_0x324fe8,_0x14719a,_0x22aebe){var _0x1517a8={};_0x1517a8[_0x14719a]=_0x324fe8[_0x14719a];_0x1517a8[_0xd9e6('0x53')]=![];_0x1517a8[_0xd9e6('0x54')]=moment()[_0xd9e6('0x55')](_0x22aebe,_0xd9e6('0x56'))[_0xd9e6('0x14')](_0xd9e6('0x35'));_0x1517a8['ContactId']=_0x324fe8['ContactId'];_0x1517a8[_0xd9e6('0x57')]=_0x324fe8[_0xd9e6('0x57')];_0x1517a8[_0xd9e6('0x1c')]=_0x324fe8[_0xd9e6('0x1c')]||undefined;return _0x1517a8;};exports[_0xd9e6('0x58')]=function(_0xc234e2,_0x4830c0){if(!_[_0xd9e6('0x17')](_0xc234e2)){if(_0xc234e2['pTalking']>0x0){_0xc234e2[_0xd9e6('0x59')]-=0x1;}else{logger[_0xd9e6('0x9')](_0x4830c0,_0xd9e6('0x5a'));}}else{logger[_0xd9e6('0x9')](_0x4830c0,_0xd9e6('0x5b'));}};exports['IsNotLoggedIn']=function(_0x4e2c69){if(_0x4e2c69<=0x0){return!![];}return![];};exports[_0xd9e6('0x5c')]=function(_0x47731a,_0x5cfcdb){_0x47731a[_0xd9e6('0x5d')]=_0x5cfcdb;_0x47731a[_0xd9e6('0x5e')]=_0x47731a[_0xd9e6('0x5f')];_0x47731a[_0xd9e6('0x60')]=_0x47731a['channelAgent'];return _0x47731a;};exports[_0xd9e6('0x61')]=function(_0x5f16d5){var _0x1e08f8={};_0x1e08f8[_0xd9e6('0x5f')]=_0x5f16d5[_0xd9e6('0x5f')];_0x1e08f8[_0xd9e6('0x60')]=_0x5f16d5[_0xd9e6('0x47')];_0x1e08f8[_0xd9e6('0x62')]=_0x5f16d5[_0xd9e6('0x62')];return _0x1e08f8;};exports[_0xd9e6('0x63')]=function(_0x1bec2d){var _0x3adddf=[];for(var _0x3fd167 in _0x1bec2d){if(_0x1bec2d[_0xd9e6('0x2b')](_0x3fd167)){if(!_[_0xd9e6('0x17')](_0x1bec2d[_0x3fd167])&&_0x1bec2d[_0x3fd167]['state']===_0xd9e6('0x64')&&_0x1bec2d[_0x3fd167][_0xd9e6('0x65')]==='reachable'){_0x3adddf[_0xd9e6('0x66')](_0x1bec2d[_0x3fd167]['id']);}}}return _0x3adddf;};exports[_0xd9e6('0x67')]=function(_0x3b4687){var _0x4d7cfa=moment()[_0xd9e6('0x6')](0x0);var _0x5d2472=moment(_0x3b4687)[_0xd9e6('0x6')](0x0);return _0x4d7cfa['diff'](_0x5d2472,_0xd9e6('0x7'));};exports[_0xd9e6('0x68')]=function(_0x37c25d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x37c25d['ContactId'],'ListId':_0x37c25d['ListId'],'VoiceQueueId':_0x37c25d['VoiceQueueId']||undefined,'CampaignId':_0x37c25d['CampaignId']||undefined};};exports[_0xd9e6('0x69')]=function(_0x30f3d3){if(_0x30f3d3==='uniqueid'||_0x30f3d3==='idContact'||_0x30f3d3===_0xd9e6('0x5f')||_0x30f3d3===_0xd9e6('0x6a')||_0x30f3d3===_0xd9e6('0x6b')||_0x30f3d3===_0xd9e6('0x6c')||_0x30f3d3===_0xd9e6('0x3d')||_0x30f3d3==='channelAgent'||_0x30f3d3===_0xd9e6('0x19')||_0x30f3d3===_0xd9e6('0x53')||_0x30f3d3===_0xd9e6('0x1a')||_0x30f3d3===_0xd9e6('0x54')||_0x30f3d3===_0xd9e6('0x4b')||_0x30f3d3==='countcongestionretry'||_0x30f3d3==='countnoanswerretry'||_0x30f3d3===_0xd9e6('0x6d')||_0x30f3d3===_0xd9e6('0x6e')||_0x30f3d3===_0xd9e6('0x6f')||_0x30f3d3===_0xd9e6('0x70')||_0x30f3d3===_0xd9e6('0x71')||_0x30f3d3===_0xd9e6('0x72')||_0x30f3d3===_0xd9e6('0x57')||_0x30f3d3===_0xd9e6('0x73')||_0x30f3d3===_0xd9e6('0x1c')||_0x30f3d3===_0xd9e6('0x74')||_0x30f3d3===_0xd9e6('0x75')||_0x30f3d3===_0xd9e6('0x76')||_0x30f3d3==='xmd-phone'||_0x30f3d3===_0xd9e6('0x77')||_0x30f3d3===_0xd9e6('0x78')||_0x30f3d3===_0xd9e6('0x79')||_0x30f3d3===_0xd9e6('0x7a')||_0x30f3d3===_0xd9e6('0x7b')||_0x30f3d3===_0xd9e6('0x7c')||_0x30f3d3===_0xd9e6('0x7d')||_0x30f3d3===_0xd9e6('0x7e')||_0x30f3d3===_0xd9e6('0x7f')||_0x30f3d3===_0xd9e6('0x80')||_0x30f3d3===_0xd9e6('0x81')||_0x30f3d3===_0xd9e6('0x82')||_0x30f3d3===_0xd9e6('0x83')||_0x30f3d3===_0xd9e6('0x84')||_0x30f3d3===_0xd9e6('0x85')||_0x30f3d3===_0xd9e6('0x86')||_0x30f3d3===_0xd9e6('0x87')||_0x30f3d3===_0xd9e6('0x88')||_0x30f3d3==='rtpaudioqosrttbridged'||_0x30f3d3===_0xd9e6('0x82')||_0x30f3d3===_0xd9e6('0x83')||_0x30f3d3===_0xd9e6('0x84')||_0x30f3d3===_0xd9e6('0x85')||_0x30f3d3==='rtpaudioqosloss'||_0x30f3d3===_0xd9e6('0x87')||_0x30f3d3===_0xd9e6('0x88')||_0x30f3d3===_0xd9e6('0x89')||_0x30f3d3===_0xd9e6('0x8a')||_0x30f3d3==='bridgepvtcallid'||_0x30f3d3===_0xd9e6('0x36')||_0x30f3d3===_0xd9e6('0x37')){return![];}return!![];};exports[_0xd9e6('0x8b')]=function(_0x3e769d,_0x384c9b){var _0x5438e1,_0x2294e2,_0x36285e;if(_0x384c9b<=0x0){_0x384c9b=0x1;}_0x5438e1=new RegExp(_0xd9e6('0x8c')+_0x384c9b+'}$');_0x2294e2=Math[_0xd9e6('0x8d')](0xa,_0x384c9b-0x1);_0x36285e=Math[_0xd9e6('0x8d')](0xa,_0x384c9b)-0x1;return util[_0xd9e6('0x14')]('%s',_[_0xd9e6('0x8e')](_0x3e769d,_0x5438e1,_[_0xd9e6('0x8f')](_0x2294e2,_0x36285e)));};exports[_0xd9e6('0x90')]=function(_0x5bd2be){var _0x11382c=_0x5bd2be[_0xd9e6('0x91')](/"(.*?)"/);return _0x11382c?_0x11382c[0x1]:_0x5bd2be;};exports[_0xd9e6('0x92')]=function(_0x35f167){var _0x16f573=_0x35f167[_0xd9e6('0x91')](/<(.*?)>/);return _0x16f573?_0x16f573[0x1]:_0x35f167;};
\ No newline at end of file
diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js
index 2e43682..59b4f0a 100644
--- a/server/services/ami/properties.js
+++ b/server/services/ami/properties.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x3dd90a,_0x5a7602){var _0x2a815c=function(_0x3e916d){while(--_0x3e916d){_0x3dd90a['push'](_0x3dd90a['shift']());}};_0x2a815c(++_0x5a7602);}(_0x7a54,0x106));var _0x47a5=function(_0x16030a,_0x39d49b){_0x16030a=_0x16030a-0x0;var _0x3af392=_0x7a54[_0x16030a];return _0x3af392;};'use strict';exports[_0x47a5('0x0')]={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x47a5('0x2'),'required':![]},'paused':{'type':_0x47a5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]}};exports[_0x47a5('0x4')]={'interface':{'type':_0x47a5('0x1'),'required':!![]},'paused':{'type':_0x47a5('0x3')},'reason':{'type':'string','required':![]}};exports[_0x47a5('0x5')]={'module':{'type':'string','required':![]}};exports[_0x47a5('0x6')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x47a5('0x7')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x2677f7,_0x629d71){var _0x219c85=function(_0x5081d9){while(--_0x5081d9){_0x2677f7['push'](_0x2677f7['shift']());}};_0x219c85(++_0x629d71);}(_0xb10b,0x12a));var _0xbb10=function(_0x28c608,_0x432ee1){_0x28c608=_0x28c608-0x0;var _0x3ace3e=_0xb10b[_0x28c608];return _0x3ace3e;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}};
\ No newline at end of file
diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js
index c27f152..8f482cd 100644
--- a/server/services/ami/realtime/index.js
+++ b/server/services/ami/realtime/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe36a=['format','name','isNil','interface','SIP/%s','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','total','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','initTelephones','length','isUndefined','initTriggers','initTemplates','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerabandon','sumHoldTime','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','initVoiceCallReports','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','hasOwnProperty','mapKeys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe36a,0xa4));var _0xae36=function(_0x3e4bd5,_0x1191df){_0x3e4bd5=_0x3e4bd5-0x0;var _0x261d71=_0xe36a[_0x3e4bd5];return _0x261d71;};'use strict';var BPromise=require(_0xae36('0x0'));var util=require(_0xae36('0x1'));var _=require('lodash');var moment=require(_0xae36('0x2'));var Agent=require(_0xae36('0x3'));var Telephone=require(_0xae36('0x4'));var Trunk=require(_0xae36('0x5'));var VoiceQueue=require(_0xae36('0x6'));var Trigger=require(_0xae36('0x7'));var Template=require('../model/template');var Campaign=require(_0xae36('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xae36('0x9'));var FreshdeskAccount=require(_0xae36('0xa'));var SugarcrmAccount=require(_0xae36('0xb'));var ZohoAccount=require(_0xae36('0xc'));var DeskAccount=require(_0xae36('0xd'));var VtigerAccount=require(_0xae36('0xe'));var ServicenowAccount=require(_0xae36('0xf'));var Dynamics365Account=require(_0xae36('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xae36('0x11'));var Realtime=function(){this[_0xae36('0x12')]={};this[_0xae36('0x13')]={};this[_0xae36('0x14')]={};this[_0xae36('0x15')]={};this[_0xae36('0x16')]={};this[_0xae36('0x17')]={};this[_0xae36('0x18')]={};this[_0xae36('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xae36('0x1a')]={};this[_0xae36('0x1b')]={};this['queueChannels']={};this['outboundChannels']={};this[_0xae36('0x1c')]={};this['zendeskAccounts']={};this[_0xae36('0x1d')]={};this[_0xae36('0x1e')]={};this[_0xae36('0x1f')]={};this[_0xae36('0x20')]={};this[_0xae36('0x21')]={};this[_0xae36('0x22')]={};this[_0xae36('0x23')]={};this[_0xae36('0x24')]={};this[_0xae36('0x25')]={};this['faxAccounts']={};};function freeIsNotKey(_0x33c524,_0xca1242,_0x2c8f6c){var _0x26db23=_['mapKeys'](_0x33c524,function(_0x3a944a,_0x3f14cd){return _0x3a944a[_0x2c8f6c];});for(var _0x586b40 in _0xca1242){if(_0xca1242[_0xae36('0x26')](_0x586b40)){if(!_0x26db23[_0x586b40]){delete _0xca1242[_0x586b40];}}}}function freeIsNotKeySip(_0x392867,_0x511b64){var _0x2eeac0=_[_0xae36('0x27')](_0x392867,function(_0x42d245,_0x13cbb1){return util[_0xae36('0x28')]('SIP/%s',_0x42d245[_0xae36('0x29')]);});for(var _0x521d09 in _0x511b64){if(_0x511b64[_0xae36('0x26')](_0x521d09)){if(!_0x2eeac0[_0x521d09]){delete _0x511b64[_0x521d09];}}}}function freeIsNotKeyAgent(_0x5e996c,_0x1779f6){var _0x49c445=_['mapKeys'](_0x5e996c,function(_0xdc872b,_0x117dff){var _0x224b96=_[_0xae36('0x2a')](_0xdc872b[_0xae36('0x2b')])?util['format'](_0xae36('0x2c'),_0xdc872b[_0xae36('0x29')]):_0xdc872b[_0xae36('0x2b')];return _0x224b96;});for(var _0x29cf0f in _0x1779f6){if(_0x1779f6[_0xae36('0x26')](_0x29cf0f)){if(!_0x49c445[_0x29cf0f]){delete _0x1779f6[_0x29cf0f];}}}}function clearVoiceCallReports(_0x3992f2){_0x3992f2['total']=0x0;_0x3992f2[_0xae36('0x2d')]=0x0;_0x3992f2['sumHoldTime']=0x0;_0x3992f2[_0xae36('0x2e')]=0x0;_0x3992f2[_0xae36('0x2f')]=0x0;}function clearCampaigns(_0x3676a7){if(!_[_0xae36('0x30')](_0x3676a7)){for(var _0x491f53 in _0x3676a7){if(_0x3676a7[_0xae36('0x26')](_0x491f53)){_0x3676a7[_0x491f53][_0xae36('0x31')]=0x0;_0x3676a7[_0x491f53]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x468093){if(!_[_0xae36('0x30')](_0x468093)){for(var _0x47a9f1 in _0x468093){if(_0x468093[_0xae36('0x26')](_0x47a9f1)){_0x468093[_0x47a9f1][_0xae36('0x32')]=0x0;_0x468093[_0x47a9f1]['answered']=0x0;_0x468093[_0x47a9f1][_0xae36('0x33')]=0x0;_0x468093[_0x47a9f1][_0xae36('0x34')]=0x0;_0x468093[_0x47a9f1]['sumHoldTime']=0x0;_0x468093[_0x47a9f1]['sumDuration']=0x0;_0x468093[_0x47a9f1][_0xae36('0x2f')]=0x0;_0x468093[_0x47a9f1]['outboundAnswerAgiCallsDay']=0x0;_0x468093[_0x47a9f1][_0xae36('0x35')]=0x0;_0x468093[_0x47a9f1]['outboundBusyCallsDay']=0x0;_0x468093[_0x47a9f1]['outboundCongestionCallsDay']=0x0;_0x468093[_0x47a9f1][_0xae36('0x36')]=0x0;_0x468093[_0x47a9f1]['outboundUnknownCallsDay']=0x0;_0x468093[_0x47a9f1][_0xae36('0x37')]=0x0;_0x468093[_0x47a9f1][_0xae36('0x38')]=0x0;_0x468093[_0x47a9f1][_0xae36('0x39')]=0x0;_0x468093[_0x47a9f1][_0xae36('0x3a')]=0x0;_0x468093[_0x47a9f1]['outboundRejectCallsDay']=0x0;_0x468093[_0x47a9f1][_0xae36('0x3b')]=0x0;_0x468093[_0x47a9f1][_0xae36('0x3c')]=0x0;_0x468093[_0x47a9f1][_0xae36('0x3d')]=0x0;_0x468093[_0x47a9f1]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0xae36('0x3e')]=function(_0x22d5ea,_0xa1ac){for(var _0x27d237 in _0xa1ac){if(_0x22d5ea['hasOwnProperty'](_0x27d237)){_0x22d5ea[_0x27d237]=_0xa1ac[_0x27d237];}}};Realtime[_0xae36('0x3f')]['initAgents']=function(){var _0x25cc79=this;return function(_0x2e9947){if(_0x2e9947){freeIsNotKeyAgent(_0x2e9947,_0x25cc79['agents']);for(var _0x5f5dbd=0x0,_0x173bcc={},_0x4edb1d={};_0x5f5dbd<_0x2e9947['length'];_0x5f5dbd+=0x1){_0x173bcc=_0x2e9947[_0x5f5dbd];var _0x18ac20=_['isNil'](_0x173bcc['interface'])?util['format'](_0xae36('0x2c'),_0x173bcc[_0xae36('0x29')]):_0x173bcc[_0xae36('0x2b')];if(_['isUndefined'](_0x25cc79[_0xae36('0x12')][_0x18ac20])){_0x25cc79[_0xae36('0x12')][_0x18ac20]=new Agent(_0x173bcc);}else{_0x25cc79[_0xae36('0x3e')](_0x25cc79[_0xae36('0x12')][_0x18ac20],_0x173bcc);}}}return _0x25cc79[_0xae36('0x12')];};};Realtime[_0xae36('0x3f')][_0xae36('0x40')]=function(){var _0x16cb30=this;return function(_0x3b734f){if(_0x3b734f){freeIsNotKeySip(_0x3b734f,_0x16cb30[_0xae36('0x13')]);for(var _0x13b0b2=0x0,_0x245a2e={},_0x17ae59={};_0x13b0b2<_0x3b734f[_0xae36('0x41')];_0x13b0b2+=0x1){_0x245a2e=_0x3b734f[_0x13b0b2];if(_[_0xae36('0x42')](_0x16cb30[_0xae36('0x13')][util[_0xae36('0x28')](_0xae36('0x2c'),_0x245a2e[_0xae36('0x29')])])){_0x16cb30['telephones'][util[_0xae36('0x28')](_0xae36('0x2c'),_0x245a2e[_0xae36('0x29')])]=new Telephone(_0x245a2e);}else{_0x16cb30['mergeFromDatabase'](_0x16cb30[_0xae36('0x13')][util[_0xae36('0x28')](_0xae36('0x2c'),_0x245a2e[_0xae36('0x29')])],_0x245a2e);}}}return _0x16cb30[_0xae36('0x13')];};};Realtime[_0xae36('0x3f')]['initTrunks']=function(){var _0x371274=this;return function(_0x2f6f1c){if(_0x2f6f1c){freeIsNotKeySip(_0x2f6f1c,_0x371274[_0xae36('0x14')]);for(var _0x10c47d=0x0,_0x351f0c={},_0x4f0563={};_0x10c47d<_0x2f6f1c[_0xae36('0x41')];_0x10c47d+=0x1){_0x351f0c=_0x2f6f1c[_0x10c47d];if(_[_0xae36('0x42')](_0x371274[_0xae36('0x14')][util[_0xae36('0x28')](_0xae36('0x2c'),_0x351f0c[_0xae36('0x29')])])){_0x371274['trunks'][util[_0xae36('0x28')](_0xae36('0x2c'),_0x351f0c[_0xae36('0x29')])]=new Trunk(_0x351f0c);}else{_0x371274[_0xae36('0x3e')](_0x371274[_0xae36('0x14')][util[_0xae36('0x28')](_0xae36('0x2c'),_0x351f0c[_0xae36('0x29')])],_0x351f0c);}}}return _0x371274['trunks'];};};Realtime[_0xae36('0x3f')]['initVoiceQueues']=function(){var _0x688791=this;return function(_0x1ddd04){if(_0x1ddd04){freeIsNotKey(_0x1ddd04,_0x688791[_0xae36('0x15')],'name');for(var _0x2327b6=0x0,_0x1f3f19={},_0x2658bf={};_0x2327b6<_0x1ddd04['length'];_0x2327b6+=0x1){_0x1f3f19=_0x1ddd04[_0x2327b6];if(_[_0xae36('0x42')](_0x688791[_0xae36('0x15')][_0x1f3f19[_0xae36('0x29')]])){_0x688791[_0xae36('0x15')][_0x1f3f19['name']]=new VoiceQueue(_0x1f3f19);}else{_0x688791[_0xae36('0x3e')](_0x688791[_0xae36('0x15')][_0x1f3f19[_0xae36('0x29')]],_0x1f3f19);}}}return _0x688791['voiceQueues'];};};Realtime[_0xae36('0x3f')][_0xae36('0x43')]=function(){var _0x4a8dc6=this;return function(_0x356a5b){if(_0x356a5b){freeIsNotKey(_0x356a5b,_0x4a8dc6['triggers'],'id');for(var _0x1dd544=0x0,_0x22a14e={},_0x2a634d={};_0x1dd544<_0x356a5b[_0xae36('0x41')];_0x1dd544+=0x1){_0x22a14e=_0x356a5b[_0x1dd544];if(_['isUndefined'](_0x4a8dc6[_0xae36('0x16')][_0x22a14e['id']])){_0x4a8dc6[_0xae36('0x16')][_0x22a14e['id']]=new Trigger(_0x22a14e);}else{_0x4a8dc6['mergeFromDatabase'](_0x4a8dc6['triggers'][_0x22a14e['id']],_0x22a14e);}}}return _0x4a8dc6[_0xae36('0x16')];};};Realtime['prototype'][_0xae36('0x44')]=function(){var _0x8a4d0a=this;return function(_0xd5bd97){if(_0xd5bd97){freeIsNotKey(_0xd5bd97,_0x8a4d0a[_0xae36('0x18')],'id');for(var _0xefe1e3=0x0,_0xf8136b={},_0x1df0b9={};_0xefe1e3<_0xd5bd97[_0xae36('0x41')];_0xefe1e3+=0x1){_0xf8136b=_0xd5bd97[_0xefe1e3];if(_[_0xae36('0x42')](_0x8a4d0a[_0xae36('0x18')][_0xf8136b['id']])){_0x8a4d0a[_0xae36('0x18')][_0xf8136b['id']]=new Template(_0xf8136b);}else{_0x8a4d0a[_0xae36('0x3e')](_0x8a4d0a[_0xae36('0x18')][_0xf8136b['id']],_0xf8136b);}}}return _0x8a4d0a[_0xae36('0x18')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x4ca33e=this;return function(_0x54dbe6){if(_0x54dbe6){freeIsNotKey(_0x54dbe6,_0x4ca33e[_0xae36('0x45')],'id');for(var _0x34d394=0x0,_0x3f2345={},_0x139b23={};_0x34d394<_0x54dbe6['length'];_0x34d394+=0x1){_0x3f2345=_0x54dbe6[_0x34d394];if(_['isUndefined'](_0x4ca33e[_0xae36('0x45')][_0x3f2345['id']])){_0x4ca33e[_0xae36('0x45')][_0x3f2345['id']]=new ZendeskAccount(_0x3f2345);}else{_0x4ca33e['mergeFromDatabase'](_0x4ca33e['zendeskAccounts'][_0x3f2345['id']],_0x3f2345);}}}return _0x4ca33e[_0xae36('0x45')];};};Realtime[_0xae36('0x3f')]['initSalesforceAccounts']=function(){var _0x1a7983=this;return function(_0x5c4c93){if(_0x5c4c93){freeIsNotKey(_0x5c4c93,_0x1a7983[_0xae36('0x1d')],'id');for(var _0xf0c5fb=0x0,_0x3868aa={},_0x27478a={};_0xf0c5fb<_0x5c4c93[_0xae36('0x41')];_0xf0c5fb+=0x1){_0x3868aa=_0x5c4c93[_0xf0c5fb];if(_['isUndefined'](_0x1a7983[_0xae36('0x1d')][_0x3868aa['id']])){_0x1a7983['salesforceAccounts'][_0x3868aa['id']]=new SalesforceAccount(_0x3868aa);}else{_0x1a7983[_0xae36('0x3e')](_0x1a7983['salesforceAccounts'][_0x3868aa['id']],_0x3868aa);}}}return _0x1a7983[_0xae36('0x1d')];};};Realtime[_0xae36('0x3f')][_0xae36('0x46')]=function(){var _0x368be6=this;return function(_0x5c2a2c){if(_0x5c2a2c){freeIsNotKey(_0x5c2a2c,_0x368be6[_0xae36('0x1f')],'id');for(var _0x490959=0x0,_0x58918c={},_0x5d5b8f={};_0x490959<_0x5c2a2c['length'];_0x490959+=0x1){_0x58918c=_0x5c2a2c[_0x490959];if(_['isUndefined'](_0x368be6[_0xae36('0x1f')][_0x58918c['id']])){_0x368be6[_0xae36('0x1f')][_0x58918c['id']]=new FreshdeskAccount(_0x58918c);}else{_0x368be6['mergeFromDatabase'](_0x368be6[_0xae36('0x1f')][_0x58918c['id']],_0x58918c);}}}return _0x368be6[_0xae36('0x1f')];};};Realtime['prototype'][_0xae36('0x47')]=function(){var _0x1ce59d=this;return function(_0x472612){if(_0x472612){freeIsNotKey(_0x472612,_0x1ce59d[_0xae36('0x20')],'id');for(var _0x9a6913=0x0,_0x523897={},_0x351d4f={};_0x9a6913<_0x472612['length'];_0x9a6913+=0x1){_0x523897=_0x472612[_0x9a6913];if(_[_0xae36('0x42')](_0x1ce59d[_0xae36('0x20')][_0x523897['id']])){_0x1ce59d[_0xae36('0x20')][_0x523897['id']]=new ZohoAccount(_0x523897);}else{_0x1ce59d[_0xae36('0x3e')](_0x1ce59d[_0xae36('0x20')][_0x523897['id']],_0x523897);}}}return _0x1ce59d[_0xae36('0x20')];};};Realtime[_0xae36('0x3f')]['initDeskAccounts']=function(){var _0x3441db=this;return function(_0x46edb3){if(_0x46edb3){freeIsNotKey(_0x46edb3,_0x3441db[_0xae36('0x21')],'id');for(var _0x3b63a9=0x0,_0x599edd={},_0x2cb806={};_0x3b63a9<_0x46edb3[_0xae36('0x41')];_0x3b63a9+=0x1){_0x599edd=_0x46edb3[_0x3b63a9];if(_[_0xae36('0x42')](_0x3441db['deskAccounts'][_0x599edd['id']])){_0x3441db[_0xae36('0x21')][_0x599edd['id']]=new DeskAccount(_0x599edd);}else{_0x3441db[_0xae36('0x3e')](_0x3441db['deskAccounts'][_0x599edd['id']],_0x599edd);}}}return _0x3441db[_0xae36('0x21')];};};Realtime['prototype'][_0xae36('0x48')]=function(){var _0x4f27fd=this;return function(_0xa9ba17){if(_0xa9ba17){freeIsNotKey(_0xa9ba17,_0x4f27fd[_0xae36('0x1e')],'id');for(var _0x31f01f=0x0,_0x2cb15e={},_0x13ae75={};_0x31f01f<_0xa9ba17[_0xae36('0x41')];_0x31f01f+=0x1){_0x2cb15e=_0xa9ba17[_0x31f01f];if(_[_0xae36('0x42')](_0x4f27fd[_0xae36('0x1e')][_0x2cb15e['id']])){_0x4f27fd[_0xae36('0x1e')][_0x2cb15e['id']]=new SugarcrmAccount(_0x2cb15e);}else{_0x4f27fd[_0xae36('0x3e')](_0x4f27fd[_0xae36('0x1e')][_0x2cb15e['id']],_0x2cb15e);}}}return _0x4f27fd['sugarcrmAccounts'];};};Realtime[_0xae36('0x3f')]['initVtigerAccounts']=function(){var _0x419888=this;return function(_0x2c3b22){if(_0x2c3b22){freeIsNotKey(_0x2c3b22,_0x419888[_0xae36('0x22')],'id');for(var _0x30d74c=0x0,_0x277554={},_0x2c6338={};_0x30d74c<_0x2c3b22['length'];_0x30d74c+=0x1){_0x277554=_0x2c3b22[_0x30d74c];if(_[_0xae36('0x42')](_0x419888[_0xae36('0x22')][_0x277554['id']])){_0x419888['vtigerAccounts'][_0x277554['id']]=new VtigerAccount(_0x277554);}else{_0x419888['mergeFromDatabase'](_0x419888[_0xae36('0x22')][_0x277554['id']],_0x277554);}}}return _0x419888[_0xae36('0x22')];};};Realtime[_0xae36('0x3f')][_0xae36('0x49')]=function(){var _0x28e33e=this;return function(_0x2edfcd){if(_0x2edfcd){freeIsNotKey(_0x2edfcd,_0x28e33e[_0xae36('0x23')],'id');for(var _0x2f9cef=0x0,_0x2143c6={},_0x48eebe={};_0x2f9cef<_0x2edfcd[_0xae36('0x41')];_0x2f9cef+=0x1){_0x2143c6=_0x2edfcd[_0x2f9cef];if(_[_0xae36('0x42')](_0x28e33e[_0xae36('0x23')][_0x2143c6['id']])){_0x28e33e[_0xae36('0x23')][_0x2143c6['id']]=new ServicenowAccount(_0x2143c6);}else{_0x28e33e['mergeFromDatabase'](_0x28e33e['servicenowAccounts'][_0x2143c6['id']],_0x2143c6);}}}return _0x28e33e[_0xae36('0x23')];};};Realtime[_0xae36('0x3f')][_0xae36('0x4a')]=function(){var _0x16c59a=this;return function(_0x3f18ed){if(_0x3f18ed){freeIsNotKey(_0x3f18ed,_0x16c59a['dynamics365Accounts'],'id');for(var _0x1d7005=0x0,_0x50e6a0={},_0x20c248={};_0x1d7005<_0x3f18ed[_0xae36('0x41')];_0x1d7005+=0x1){_0x50e6a0=_0x3f18ed[_0x1d7005];if(_[_0xae36('0x42')](_0x16c59a[_0xae36('0x24')][_0x50e6a0['id']])){_0x16c59a[_0xae36('0x24')][_0x50e6a0['id']]=new Dynamics365Account(_0x50e6a0);}else{_0x16c59a['mergeFromDatabase'](_0x16c59a[_0xae36('0x24')][_0x50e6a0['id']],_0x50e6a0);}}}return _0x16c59a[_0xae36('0x24')];};};Realtime[_0xae36('0x3f')][_0xae36('0x4b')]=function(){var _0x28e5f5=this;return function(_0xccffe8){if(_0xccffe8){freeIsNotKey(_0xccffe8,_0x28e5f5[_0xae36('0x25')],'id');for(var _0xd378e4=0x0,_0x5bef8b={},_0x4dbb2c={};_0xd378e4<_0xccffe8['length'];_0xd378e4+=0x1){_0x5bef8b=_0xccffe8[_0xd378e4];if(_['isUndefined'](_0x28e5f5[_0xae36('0x25')][_0x5bef8b['id']])){_0x28e5f5[_0xae36('0x25')][_0x5bef8b['id']]=new FreshsalesAccount(_0x5bef8b);}else{_0x28e5f5[_0xae36('0x3e')](_0x28e5f5[_0xae36('0x25')][_0x5bef8b['id']],_0x5bef8b);}}}return _0x28e5f5['freshsalesAccounts'];};};Realtime[_0xae36('0x3f')][_0xae36('0x4c')]=function(){var _0x34e7bf=this;return function(_0x542d2c){for(var _0x5cb91b=0x0;_0x5cb91b<_0x542d2c['length'];_0x5cb91b+=0x1){_[_0xae36('0x4d')](_0x34e7bf['voiceQueues'][_0x542d2c[_0x5cb91b][_0xae36('0x29')]],_0x542d2c[_0x5cb91b]);}return _0x34e7bf[_0xae36('0x15')];};};Realtime[_0xae36('0x3f')][_0xae36('0x4e')]=function(){var _0x4c20ab=this;return function(_0x4b7091){clearVoiceQueues(_0x4c20ab[_0xae36('0x15')]);if(_0x4b7091){_0x4b7091=_[_0xae36('0x4f')](_0x4b7091,_0xae36('0x50'));for(var _0x45237f in _0x4b7091){if(_0x4b7091['hasOwnProperty'](_0x45237f)){var _0x336d7c={};for(var _0x4a1e67=0x0;_0x4a1e67<_0x4b7091[_0x45237f][_0xae36('0x41')];_0x4a1e67+=0x1){var _0x5506e2=_0x4b7091[_0x45237f][_0x4a1e67]['queue'];if(_0x4c20ab['voiceQueues'][_0x5506e2]){if(_0x4b7091[_0x45237f][_0x4a1e67][_0xae36('0x51')]){_0x4c20ab[_0xae36('0x15')][_0x5506e2][_0xae36('0x33')]+=0x1;}if(_0x4b7091[_0x45237f][_0x4a1e67][_0xae36('0x52')]){_0x4c20ab[_0xae36('0x15')][_0x5506e2][_0xae36('0x34')]+=0x1;}_0x4c20ab['voiceQueues'][_0x5506e2][_0xae36('0x53')]+=moment(_0x4b7091[_0x45237f][_0x4a1e67]['queuecallerleaveAt'])[_0xae36('0x54')](moment(_0x4b7091[_0x45237f][_0x4a1e67][_0xae36('0x55')]),_0xae36('0x56'))||0x0;if(_0x4a1e67===_0x4b7091[_0x45237f][_0xae36('0x41')]-0x1){_0x4c20ab[_0xae36('0x15')][_0x5506e2][_0xae36('0x2e')]+=moment(_0x4b7091[_0x45237f][_0x4a1e67][_0xae36('0x57')]||_0x4b7091[_0x45237f][_0x4a1e67][_0xae36('0x58')]||_0x4b7091[_0x45237f][_0x4a1e67][_0xae36('0x59')])['diff'](moment(_0x4b7091[_0x45237f][_0x4a1e67]['queuecallerjoinAt']),_0xae36('0x56'))||0x0;_0x4c20ab[_0xae36('0x15')][_0x5506e2]['total']+=0x1;if(_0x4b7091[_0x45237f][_0x4a1e67]['queuecallercomplete']){_0x4c20ab[_0xae36('0x15')][_0x5506e2][_0xae36('0x2d')]+=0x1;_0x4c20ab['voiceQueues'][_0x5506e2]['sumBillable']+=moment(_0x4b7091[_0x45237f][_0x4a1e67][_0xae36('0x57')])[_0xae36('0x54')](moment(_0x4b7091[_0x45237f][_0x4a1e67]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x4c20ab[_0xae36('0x15')][_0x5506e2][_0xae36('0x2e')]+=_0x4c20ab[_0xae36('0x15')][_0x5506e2][_0xae36('0x53')]||0x0;}}}}}}return _0x4c20ab[_0xae36('0x15')];};};Realtime[_0xae36('0x3f')][_0xae36('0x5a')]=function(){var _0x57e976=this;return function(_0x1c233e){clearVoiceCallReports(_0x57e976[_0xae36('0x19')]);if(_0x1c233e){for(var _0x1db25c=0x0;_0x1db25c<_0x1c233e[_0xae36('0x41')];_0x1db25c+=0x1){_0x57e976[_0xae36('0x19')][_0xae36('0x32')]+=0x1;_0x57e976[_0xae36('0x19')][_0xae36('0x2e')]+=_0x1c233e[_0x1db25c]['duration'];if(_0x1c233e[_0x1db25c]['disposition']===_0xae36('0x5b')){_0x57e976[_0xae36('0x19')][_0xae36('0x2d')]+=0x1;_0x57e976[_0xae36('0x19')][_0xae36('0x53')]+=_0x1c233e[_0x1db25c][_0xae36('0x5c')]-_0x1c233e[_0x1db25c][_0xae36('0x5d')]||0x0;_0x57e976['outbound'][_0xae36('0x2f')]+=_0x1c233e[_0x1db25c][_0xae36('0x5d')];}}}return _0x57e976[_0xae36('0x19')];};};Realtime['prototype'][_0xae36('0x5e')]=function(){var _0x4dd63c=this;return function(_0x4e8743){if(_0x4e8743){freeIsNotKey(_0x4e8743,_0x4dd63c[_0xae36('0x17')],_0xae36('0x29'));for(var _0x46a3fd=0x0,_0x5c1d4d={};_0x46a3fd<_0x4e8743[_0xae36('0x41')];_0x46a3fd+=0x1){_0x5c1d4d=_0x4e8743[_0x46a3fd];if(_[_0xae36('0x42')](_0x4dd63c[_0xae36('0x17')][_0x5c1d4d['name']])){_0x4dd63c[_0xae36('0x17')][_0x5c1d4d[_0xae36('0x29')]]=new Campaign(_0x5c1d4d);}else{_0x4dd63c[_0xae36('0x3e')](_0x4dd63c[_0xae36('0x17')][_0x5c1d4d['name']],_0x5c1d4d);_0x4dd63c['campaigns'][_0x5c1d4d[_0xae36('0x29')]][_0xae36('0x5f')]=_0x5c1d4d[_0xae36('0x60')]?_0x5c1d4d[_0xae36('0x60')]['name']:undefined;}}}return _0x4dd63c[_0xae36('0x17')];};};Realtime[_0xae36('0x3f')][_0xae36('0x61')]=function(){var _0x5a637c=this;return function(_0x35d383){if(_0x35d383){freeIsNotKey(_0x35d383,_0x5a637c[_0xae36('0x1a')],'id');for(var _0x2388f8=0x0,_0x5cfff5={};_0x2388f8<_0x35d383[_0xae36('0x41')];_0x2388f8+=0x1){_0x5cfff5=_0x35d383[_0x2388f8];if(_[_0xae36('0x42')](_0x5a637c[_0xae36('0x1a')][_0x5cfff5['id']])){_0x5a637c[_0xae36('0x1a')][_0x5cfff5['id']]=new VoiceExtension(_0x5cfff5);}else{_0x5a637c['mergeFromDatabase'](_0x5a637c[_0xae36('0x1a')][_0x5cfff5['id']],_0x5cfff5);}}}return _0x5a637c[_0xae36('0x1a')];};};Realtime['prototype'][_0xae36('0x62')]=function(){var _0x3e8009=this;return function(_0x280bb4){clearCampaigns(_0x3e8009['campaigns']);for(var _0x1008d1=0x0;_0x1008d1<_0x280bb4[_0xae36('0x41')];_0x1008d1+=0x1){_[_0xae36('0x4d')](_0x3e8009[_0xae36('0x17')][_0x280bb4[_0x1008d1]['name']],_0x280bb4[_0x1008d1]);}return _0x3e8009[_0xae36('0x17')];};};Realtime[_0xae36('0x3f')][_0xae36('0x63')]=function(){var _0x70fbbe=this;return function(_0x4c326f){if(_0x4c326f){freeIsNotKey(_0x4c326f,_0x70fbbe[_0xae36('0x64')],'id');for(var _0x53ae8d=0x0,_0x1df9f6={},_0x32769a={};_0x53ae8d<_0x4c326f[_0xae36('0x41')];_0x53ae8d+=0x1){_0x1df9f6=_0x4c326f[_0x53ae8d];if(_[_0xae36('0x42')](_0x70fbbe[_0xae36('0x64')][_0x1df9f6['id']])){_0x70fbbe['faxAccounts'][_0x1df9f6['id']]=new FaxAccount(_0x1df9f6);}else{_0x70fbbe[_0xae36('0x3e')](_0x70fbbe[_0xae36('0x64')][_0x1df9f6['id']],_0x1df9f6);}}}return _0x70fbbe[_0xae36('0x64')];};};module[_0xae36('0x65')]=Realtime;
\ No newline at end of file
+var _0xbe2d=['timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','prototype','mergeFromDatabase','initAgents','agents','length','isUndefined','initTrunks','trunks','initVoiceQueues','initTriggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','sugarcrmAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/campaign','../model/voiceExtension','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels'];(function(_0x3659e0,_0x364f9a){var _0x21d0ab=function(_0x2efd4f){while(--_0x2efd4f){_0x3659e0['push'](_0x3659e0['shift']());}};_0x21d0ab(++_0x364f9a);}(_0xbe2d,0x17b));var _0xdbe2=function(_0x4be9c6,_0x492092){_0x4be9c6=_0x4be9c6-0x0;var _0x3269c3=_0xbe2d[_0x4be9c6];return _0x3269c3;};'use strict';var BPromise=require(_0xdbe2('0x0'));var util=require('util');var _=require(_0xdbe2('0x1'));var moment=require(_0xdbe2('0x2'));var Agent=require(_0xdbe2('0x3'));var Telephone=require(_0xdbe2('0x4'));var Trunk=require(_0xdbe2('0x5'));var VoiceQueue=require(_0xdbe2('0x6'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0xdbe2('0x7'));var VoiceExtension=require(_0xdbe2('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xdbe2('0x9'));var DeskAccount=require(_0xdbe2('0xa'));var VtigerAccount=require(_0xdbe2('0xb'));var ServicenowAccount=require(_0xdbe2('0xc'));var Dynamics365Account=require(_0xdbe2('0xd'));var FreshsalesAccount=require(_0xdbe2('0xe'));var FaxAccount=require(_0xdbe2('0xf'));var Realtime=function(){this['agents']={};this[_0xdbe2('0x10')]={};this['trunks']={};this[_0xdbe2('0x11')]={};this[_0xdbe2('0x12')]={};this[_0xdbe2('0x13')]={};this[_0xdbe2('0x14')]={};this[_0xdbe2('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xdbe2('0x16')]={};this[_0xdbe2('0x17')]={};this[_0xdbe2('0x18')]={};this[_0xdbe2('0x19')]={};this[_0xdbe2('0x1a')]={};this[_0xdbe2('0x1b')]={};this['sugarcrmAccounts']={};this[_0xdbe2('0x1c')]={};this[_0xdbe2('0x1d')]={};this[_0xdbe2('0x1e')]={};this[_0xdbe2('0x1f')]={};this[_0xdbe2('0x20')]={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this[_0xdbe2('0x21')]={};};function freeIsNotKey(_0x51ddf6,_0x2db8a2,_0x22ffb1){var _0x9b72ce=_[_0xdbe2('0x22')](_0x51ddf6,function(_0x504c51,_0x3de1d6){return _0x504c51[_0x22ffb1];});for(var _0xfa8af in _0x2db8a2){if(_0x2db8a2[_0xdbe2('0x23')](_0xfa8af)){if(!_0x9b72ce[_0xfa8af]){delete _0x2db8a2[_0xfa8af];}}}}function freeIsNotKeySip(_0x5e4b34,_0x5776a7){var _0x32a40b=_[_0xdbe2('0x22')](_0x5e4b34,function(_0xb7547,_0x4633aa){return util[_0xdbe2('0x24')](_0xdbe2('0x25'),_0xb7547[_0xdbe2('0x26')]);});for(var _0x3128a9 in _0x5776a7){if(_0x5776a7[_0xdbe2('0x23')](_0x3128a9)){if(!_0x32a40b[_0x3128a9]){delete _0x5776a7[_0x3128a9];}}}}function freeIsNotKeyAgent(_0x7a5a51,_0x203d57){var _0x90ebce=_[_0xdbe2('0x22')](_0x7a5a51,function(_0x1a186e,_0x2c389e){var _0x3fdb5e=_[_0xdbe2('0x27')](_0x1a186e[_0xdbe2('0x28')])?util[_0xdbe2('0x24')]('SIP/%s',_0x1a186e[_0xdbe2('0x26')]):_0x1a186e[_0xdbe2('0x28')];return _0x3fdb5e;});for(var _0x4a25e9 in _0x203d57){if(_0x203d57['hasOwnProperty'](_0x4a25e9)){if(!_0x90ebce[_0x4a25e9]){delete _0x203d57[_0x4a25e9];}}}}function clearVoiceCallReports(_0x27396d){_0x27396d[_0xdbe2('0x29')]=0x0;_0x27396d[_0xdbe2('0x2a')]=0x0;_0x27396d[_0xdbe2('0x2b')]=0x0;_0x27396d[_0xdbe2('0x2c')]=0x0;_0x27396d[_0xdbe2('0x2d')]=0x0;}function clearCampaigns(_0x25e8ba){if(!_[_0xdbe2('0x2e')](_0x25e8ba)){for(var _0x54398c in _0x25e8ba){if(_0x25e8ba[_0xdbe2('0x23')](_0x54398c)){_0x25e8ba[_0x54398c][_0xdbe2('0x2f')]=0x0;_0x25e8ba[_0x54398c][_0xdbe2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x1680f0){if(!_[_0xdbe2('0x2e')](_0x1680f0)){for(var _0x18909f in _0x1680f0){if(_0x1680f0[_0xdbe2('0x23')](_0x18909f)){_0x1680f0[_0x18909f][_0xdbe2('0x29')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x2a')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x31')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x32')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x2b')]=0x0;_0x1680f0[_0x18909f]['sumDuration']=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x2d')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x33')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x34')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x35')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x36')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x37')]=0x0;_0x1680f0[_0x18909f]['outboundUnknownCallsDay']=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x38')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x39')]=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x3a')]=0x0;_0x1680f0[_0x18909f]['outboundOriginateFailureCallsDay']=0x0;_0x1680f0[_0x18909f]['outboundRejectCallsDay']=0x0;_0x1680f0[_0x18909f]['outboundReCallsDay']=0x0;_0x1680f0[_0x18909f][_0xdbe2('0x33')]=0x0;_0x1680f0[_0x18909f]['outboundAnswerCallsDay']=0x0;_0x1680f0[_0x18909f]['queueStatusComplete']=!![];}}}}Realtime[_0xdbe2('0x3b')][_0xdbe2('0x3c')]=function(_0x303dbd,_0x440c9e){for(var _0x1585e2 in _0x440c9e){if(_0x303dbd[_0xdbe2('0x23')](_0x1585e2)){_0x303dbd[_0x1585e2]=_0x440c9e[_0x1585e2];}}};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x3d')]=function(){var _0x4864ae=this;return function(_0x3c4944){if(_0x3c4944){freeIsNotKeyAgent(_0x3c4944,_0x4864ae[_0xdbe2('0x3e')]);for(var _0x1b16c1=0x0,_0x2d51af={},_0x32aefd={};_0x1b16c1<_0x3c4944[_0xdbe2('0x3f')];_0x1b16c1+=0x1){_0x2d51af=_0x3c4944[_0x1b16c1];var _0x24f0f4=_['isNil'](_0x2d51af['interface'])?util[_0xdbe2('0x24')]('SIP/%s',_0x2d51af['name']):_0x2d51af['interface'];if(_[_0xdbe2('0x40')](_0x4864ae[_0xdbe2('0x3e')][_0x24f0f4])){_0x4864ae[_0xdbe2('0x3e')][_0x24f0f4]=new Agent(_0x2d51af);}else{_0x4864ae[_0xdbe2('0x3c')](_0x4864ae[_0xdbe2('0x3e')][_0x24f0f4],_0x2d51af);}}}return _0x4864ae[_0xdbe2('0x3e')];};};Realtime[_0xdbe2('0x3b')]['initTelephones']=function(){var _0x409c68=this;return function(_0x2f3fcc){if(_0x2f3fcc){freeIsNotKeySip(_0x2f3fcc,_0x409c68[_0xdbe2('0x10')]);for(var _0x245cc6=0x0,_0x2e05cb={},_0x533ce8={};_0x245cc6<_0x2f3fcc[_0xdbe2('0x3f')];_0x245cc6+=0x1){_0x2e05cb=_0x2f3fcc[_0x245cc6];if(_[_0xdbe2('0x40')](_0x409c68[_0xdbe2('0x10')][util['format']('SIP/%s',_0x2e05cb['name'])])){_0x409c68[_0xdbe2('0x10')][util['format'](_0xdbe2('0x25'),_0x2e05cb['name'])]=new Telephone(_0x2e05cb);}else{_0x409c68[_0xdbe2('0x3c')](_0x409c68[_0xdbe2('0x10')][util['format'](_0xdbe2('0x25'),_0x2e05cb[_0xdbe2('0x26')])],_0x2e05cb);}}}return _0x409c68[_0xdbe2('0x10')];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x41')]=function(){var _0x34840e=this;return function(_0x279a9a){if(_0x279a9a){freeIsNotKeySip(_0x279a9a,_0x34840e[_0xdbe2('0x42')]);for(var _0x28e3ac=0x0,_0x30f96c={},_0x578014={};_0x28e3ac<_0x279a9a[_0xdbe2('0x3f')];_0x28e3ac+=0x1){_0x30f96c=_0x279a9a[_0x28e3ac];if(_[_0xdbe2('0x40')](_0x34840e['trunks'][util[_0xdbe2('0x24')](_0xdbe2('0x25'),_0x30f96c[_0xdbe2('0x26')])])){_0x34840e[_0xdbe2('0x42')][util[_0xdbe2('0x24')]('SIP/%s',_0x30f96c[_0xdbe2('0x26')])]=new Trunk(_0x30f96c);}else{_0x34840e['mergeFromDatabase'](_0x34840e[_0xdbe2('0x42')][util[_0xdbe2('0x24')](_0xdbe2('0x25'),_0x30f96c[_0xdbe2('0x26')])],_0x30f96c);}}}return _0x34840e[_0xdbe2('0x42')];};};Realtime['prototype'][_0xdbe2('0x43')]=function(){var _0x1ba7b5=this;return function(_0x46ca2){if(_0x46ca2){freeIsNotKey(_0x46ca2,_0x1ba7b5[_0xdbe2('0x11')],_0xdbe2('0x26'));for(var _0x4040a5=0x0,_0x1f44b4={},_0x411c92={};_0x4040a5<_0x46ca2[_0xdbe2('0x3f')];_0x4040a5+=0x1){_0x1f44b4=_0x46ca2[_0x4040a5];if(_[_0xdbe2('0x40')](_0x1ba7b5[_0xdbe2('0x11')][_0x1f44b4[_0xdbe2('0x26')]])){_0x1ba7b5[_0xdbe2('0x11')][_0x1f44b4[_0xdbe2('0x26')]]=new VoiceQueue(_0x1f44b4);}else{_0x1ba7b5[_0xdbe2('0x3c')](_0x1ba7b5['voiceQueues'][_0x1f44b4[_0xdbe2('0x26')]],_0x1f44b4);}}}return _0x1ba7b5['voiceQueues'];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x44')]=function(){var _0xad0e7b=this;return function(_0x8ec75c){if(_0x8ec75c){freeIsNotKey(_0x8ec75c,_0xad0e7b['triggers'],'id');for(var _0x24afbd=0x0,_0x37474b={},_0x322164={};_0x24afbd<_0x8ec75c[_0xdbe2('0x3f')];_0x24afbd+=0x1){_0x37474b=_0x8ec75c[_0x24afbd];if(_[_0xdbe2('0x40')](_0xad0e7b[_0xdbe2('0x12')][_0x37474b['id']])){_0xad0e7b[_0xdbe2('0x12')][_0x37474b['id']]=new Trigger(_0x37474b);}else{_0xad0e7b[_0xdbe2('0x3c')](_0xad0e7b['triggers'][_0x37474b['id']],_0x37474b);}}}return _0xad0e7b[_0xdbe2('0x12')];};};Realtime[_0xdbe2('0x3b')]['initTemplates']=function(){var _0x49edcc=this;return function(_0x4fc625){if(_0x4fc625){freeIsNotKey(_0x4fc625,_0x49edcc[_0xdbe2('0x14')],'id');for(var _0x45fb1f=0x0,_0x5f0042={},_0x1cd2bd={};_0x45fb1f<_0x4fc625[_0xdbe2('0x3f')];_0x45fb1f+=0x1){_0x5f0042=_0x4fc625[_0x45fb1f];if(_[_0xdbe2('0x40')](_0x49edcc[_0xdbe2('0x14')][_0x5f0042['id']])){_0x49edcc['templates'][_0x5f0042['id']]=new Template(_0x5f0042);}else{_0x49edcc[_0xdbe2('0x3c')](_0x49edcc['templates'][_0x5f0042['id']],_0x5f0042);}}}return _0x49edcc[_0xdbe2('0x14')];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x45')]=function(){var _0x421679=this;return function(_0x561182){if(_0x561182){freeIsNotKey(_0x561182,_0x421679[_0xdbe2('0x1a')],'id');for(var _0x187d12=0x0,_0x25a358={},_0x2a784f={};_0x187d12<_0x561182['length'];_0x187d12+=0x1){_0x25a358=_0x561182[_0x187d12];if(_[_0xdbe2('0x40')](_0x421679[_0xdbe2('0x1a')][_0x25a358['id']])){_0x421679['zendeskAccounts'][_0x25a358['id']]=new ZendeskAccount(_0x25a358);}else{_0x421679[_0xdbe2('0x3c')](_0x421679[_0xdbe2('0x1a')][_0x25a358['id']],_0x25a358);}}}return _0x421679[_0xdbe2('0x1a')];};};Realtime['prototype'][_0xdbe2('0x46')]=function(){var _0x2e3cd2=this;return function(_0x10ac75){if(_0x10ac75){freeIsNotKey(_0x10ac75,_0x2e3cd2['salesforceAccounts'],'id');for(var _0x1515d3=0x0,_0x1c9957={},_0x4e914e={};_0x1515d3<_0x10ac75[_0xdbe2('0x3f')];_0x1515d3+=0x1){_0x1c9957=_0x10ac75[_0x1515d3];if(_[_0xdbe2('0x40')](_0x2e3cd2[_0xdbe2('0x1b')][_0x1c9957['id']])){_0x2e3cd2['salesforceAccounts'][_0x1c9957['id']]=new SalesforceAccount(_0x1c9957);}else{_0x2e3cd2[_0xdbe2('0x3c')](_0x2e3cd2['salesforceAccounts'][_0x1c9957['id']],_0x1c9957);}}}return _0x2e3cd2[_0xdbe2('0x1b')];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x47')]=function(){var _0xf8b17d=this;return function(_0x243dd2){if(_0x243dd2){freeIsNotKey(_0x243dd2,_0xf8b17d[_0xdbe2('0x1c')],'id');for(var _0x29bde7=0x0,_0x4529ba={},_0x407b5c={};_0x29bde7<_0x243dd2[_0xdbe2('0x3f')];_0x29bde7+=0x1){_0x4529ba=_0x243dd2[_0x29bde7];if(_['isUndefined'](_0xf8b17d[_0xdbe2('0x1c')][_0x4529ba['id']])){_0xf8b17d[_0xdbe2('0x1c')][_0x4529ba['id']]=new FreshdeskAccount(_0x4529ba);}else{_0xf8b17d[_0xdbe2('0x3c')](_0xf8b17d[_0xdbe2('0x1c')][_0x4529ba['id']],_0x4529ba);}}}return _0xf8b17d[_0xdbe2('0x1c')];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x48')]=function(){var _0x116aa6=this;return function(_0x21b60d){if(_0x21b60d){freeIsNotKey(_0x21b60d,_0x116aa6[_0xdbe2('0x1d')],'id');for(var _0x49c518=0x0,_0x458d52={},_0x5e11e9={};_0x49c518<_0x21b60d['length'];_0x49c518+=0x1){_0x458d52=_0x21b60d[_0x49c518];if(_[_0xdbe2('0x40')](_0x116aa6[_0xdbe2('0x1d')][_0x458d52['id']])){_0x116aa6[_0xdbe2('0x1d')][_0x458d52['id']]=new ZohoAccount(_0x458d52);}else{_0x116aa6[_0xdbe2('0x3c')](_0x116aa6[_0xdbe2('0x1d')][_0x458d52['id']],_0x458d52);}}}return _0x116aa6[_0xdbe2('0x1d')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x1a8f26=this;return function(_0x4d4d5f){if(_0x4d4d5f){freeIsNotKey(_0x4d4d5f,_0x1a8f26[_0xdbe2('0x1e')],'id');for(var _0xdbc647=0x0,_0x5c7b22={},_0x136d03={};_0xdbc647<_0x4d4d5f[_0xdbe2('0x3f')];_0xdbc647+=0x1){_0x5c7b22=_0x4d4d5f[_0xdbc647];if(_['isUndefined'](_0x1a8f26[_0xdbe2('0x1e')][_0x5c7b22['id']])){_0x1a8f26[_0xdbe2('0x1e')][_0x5c7b22['id']]=new DeskAccount(_0x5c7b22);}else{_0x1a8f26['mergeFromDatabase'](_0x1a8f26[_0xdbe2('0x1e')][_0x5c7b22['id']],_0x5c7b22);}}}return _0x1a8f26[_0xdbe2('0x1e')];};};Realtime[_0xdbe2('0x3b')]['initSugarcrmAccounts']=function(){var _0x5ed69a=this;return function(_0x2ffe6d){if(_0x2ffe6d){freeIsNotKey(_0x2ffe6d,_0x5ed69a[_0xdbe2('0x49')],'id');for(var _0x3f283c=0x0,_0x1d4d0a={},_0x57b0f2={};_0x3f283c<_0x2ffe6d[_0xdbe2('0x3f')];_0x3f283c+=0x1){_0x1d4d0a=_0x2ffe6d[_0x3f283c];if(_[_0xdbe2('0x40')](_0x5ed69a[_0xdbe2('0x49')][_0x1d4d0a['id']])){_0x5ed69a[_0xdbe2('0x49')][_0x1d4d0a['id']]=new SugarcrmAccount(_0x1d4d0a);}else{_0x5ed69a['mergeFromDatabase'](_0x5ed69a[_0xdbe2('0x49')][_0x1d4d0a['id']],_0x1d4d0a);}}}return _0x5ed69a[_0xdbe2('0x49')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x4f88ba=this;return function(_0x297d54){if(_0x297d54){freeIsNotKey(_0x297d54,_0x4f88ba[_0xdbe2('0x1f')],'id');for(var _0x3aaa86=0x0,_0x58d00a={},_0x2e7032={};_0x3aaa86<_0x297d54[_0xdbe2('0x3f')];_0x3aaa86+=0x1){_0x58d00a=_0x297d54[_0x3aaa86];if(_[_0xdbe2('0x40')](_0x4f88ba[_0xdbe2('0x1f')][_0x58d00a['id']])){_0x4f88ba[_0xdbe2('0x1f')][_0x58d00a['id']]=new VtigerAccount(_0x58d00a);}else{_0x4f88ba[_0xdbe2('0x3c')](_0x4f88ba['vtigerAccounts'][_0x58d00a['id']],_0x58d00a);}}}return _0x4f88ba[_0xdbe2('0x1f')];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x4a')]=function(){var _0x43afe6=this;return function(_0x48fd32){if(_0x48fd32){freeIsNotKey(_0x48fd32,_0x43afe6[_0xdbe2('0x20')],'id');for(var _0x3be9b2=0x0,_0x74760a={},_0x61fae2={};_0x3be9b2<_0x48fd32[_0xdbe2('0x3f')];_0x3be9b2+=0x1){_0x74760a=_0x48fd32[_0x3be9b2];if(_[_0xdbe2('0x40')](_0x43afe6[_0xdbe2('0x20')][_0x74760a['id']])){_0x43afe6['servicenowAccounts'][_0x74760a['id']]=new ServicenowAccount(_0x74760a);}else{_0x43afe6[_0xdbe2('0x3c')](_0x43afe6[_0xdbe2('0x20')][_0x74760a['id']],_0x74760a);}}}return _0x43afe6['servicenowAccounts'];};};Realtime[_0xdbe2('0x3b')]['initDynamics365Accounts']=function(){var _0x2037fc=this;return function(_0x29f267){if(_0x29f267){freeIsNotKey(_0x29f267,_0x2037fc[_0xdbe2('0x4b')],'id');for(var _0x30f50b=0x0,_0x4aee67={},_0x6cf2ac={};_0x30f50b<_0x29f267[_0xdbe2('0x3f')];_0x30f50b+=0x1){_0x4aee67=_0x29f267[_0x30f50b];if(_[_0xdbe2('0x40')](_0x2037fc[_0xdbe2('0x4b')][_0x4aee67['id']])){_0x2037fc[_0xdbe2('0x4b')][_0x4aee67['id']]=new Dynamics365Account(_0x4aee67);}else{_0x2037fc[_0xdbe2('0x3c')](_0x2037fc[_0xdbe2('0x4b')][_0x4aee67['id']],_0x4aee67);}}}return _0x2037fc[_0xdbe2('0x4b')];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x4c')]=function(){var _0x2e66cc=this;return function(_0xed2dc5){if(_0xed2dc5){freeIsNotKey(_0xed2dc5,_0x2e66cc[_0xdbe2('0x4d')],'id');for(var _0x29332e=0x0,_0x4e2991={},_0x5c0bd5={};_0x29332e<_0xed2dc5[_0xdbe2('0x3f')];_0x29332e+=0x1){_0x4e2991=_0xed2dc5[_0x29332e];if(_[_0xdbe2('0x40')](_0x2e66cc[_0xdbe2('0x4d')][_0x4e2991['id']])){_0x2e66cc['freshsalesAccounts'][_0x4e2991['id']]=new FreshsalesAccount(_0x4e2991);}else{_0x2e66cc['mergeFromDatabase'](_0x2e66cc['freshsalesAccounts'][_0x4e2991['id']],_0x4e2991);}}}return _0x2e66cc['freshsalesAccounts'];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x4e')]=function(){var _0x3facad=this;return function(_0x4d8d32){for(var _0x6b5db6=0x0;_0x6b5db6<_0x4d8d32[_0xdbe2('0x3f')];_0x6b5db6+=0x1){_[_0xdbe2('0x4f')](_0x3facad[_0xdbe2('0x11')][_0x4d8d32[_0x6b5db6][_0xdbe2('0x26')]],_0x4d8d32[_0x6b5db6]);}return _0x3facad[_0xdbe2('0x11')];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x50')]=function(){var _0x59b9e5=this;return function(_0x1ac6f2){clearVoiceQueues(_0x59b9e5[_0xdbe2('0x11')]);if(_0x1ac6f2){_0x1ac6f2=_[_0xdbe2('0x51')](_0x1ac6f2,'uniqueid');for(var _0x262774 in _0x1ac6f2){if(_0x1ac6f2[_0xdbe2('0x23')](_0x262774)){var _0x387ebb={};for(var _0x4f60e8=0x0;_0x4f60e8<_0x1ac6f2[_0x262774][_0xdbe2('0x3f')];_0x4f60e8+=0x1){var _0x4f7a2c=_0x1ac6f2[_0x262774][_0x4f60e8][_0xdbe2('0x52')];if(_0x59b9e5[_0xdbe2('0x11')][_0x4f7a2c]){if(_0x1ac6f2[_0x262774][_0x4f60e8][_0xdbe2('0x53')]){_0x59b9e5[_0xdbe2('0x11')][_0x4f7a2c][_0xdbe2('0x31')]+=0x1;}if(_0x1ac6f2[_0x262774][_0x4f60e8]['queuecallerabandon']){_0x59b9e5[_0xdbe2('0x11')][_0x4f7a2c][_0xdbe2('0x32')]+=0x1;}_0x59b9e5[_0xdbe2('0x11')][_0x4f7a2c][_0xdbe2('0x2b')]+=moment(_0x1ac6f2[_0x262774][_0x4f60e8]['queuecallerleaveAt'])[_0xdbe2('0x54')](moment(_0x1ac6f2[_0x262774][_0x4f60e8]['queuecallerjoinAt']),_0xdbe2('0x55'))||0x0;if(_0x4f60e8===_0x1ac6f2[_0x262774][_0xdbe2('0x3f')]-0x1){_0x59b9e5[_0xdbe2('0x11')][_0x4f7a2c][_0xdbe2('0x2c')]+=moment(_0x1ac6f2[_0x262774][_0x4f60e8]['queuecallercompleteAt']||_0x1ac6f2[_0x262774][_0x4f60e8][_0xdbe2('0x56')]||_0x1ac6f2[_0x262774][_0x4f60e8][_0xdbe2('0x57')])['diff'](moment(_0x1ac6f2[_0x262774][_0x4f60e8]['queuecallerjoinAt']),_0xdbe2('0x55'))||0x0;_0x59b9e5[_0xdbe2('0x11')][_0x4f7a2c][_0xdbe2('0x29')]+=0x1;if(_0x1ac6f2[_0x262774][_0x4f60e8][_0xdbe2('0x58')]){_0x59b9e5['voiceQueues'][_0x4f7a2c][_0xdbe2('0x2a')]+=0x1;_0x59b9e5['voiceQueues'][_0x4f7a2c][_0xdbe2('0x2d')]+=moment(_0x1ac6f2[_0x262774][_0x4f60e8][_0xdbe2('0x59')])[_0xdbe2('0x54')](moment(_0x1ac6f2[_0x262774][_0x4f60e8]['queuecallerleaveAt']),_0xdbe2('0x55'))||0x0;}}else{_0x59b9e5[_0xdbe2('0x11')][_0x4f7a2c]['sumDuration']+=_0x59b9e5[_0xdbe2('0x11')][_0x4f7a2c]['sumHoldTime']||0x0;}}}}}}return _0x59b9e5[_0xdbe2('0x11')];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x5a')]=function(){var _0x3e21be=this;return function(_0x445b1d){clearVoiceCallReports(_0x3e21be[_0xdbe2('0x15')]);if(_0x445b1d){for(var _0x1fe5e2=0x0;_0x1fe5e2<_0x445b1d['length'];_0x1fe5e2+=0x1){_0x3e21be[_0xdbe2('0x15')]['total']+=0x1;_0x3e21be[_0xdbe2('0x15')][_0xdbe2('0x2c')]+=_0x445b1d[_0x1fe5e2]['duration'];if(_0x445b1d[_0x1fe5e2]['disposition']===_0xdbe2('0x5b')){_0x3e21be[_0xdbe2('0x15')][_0xdbe2('0x2a')]+=0x1;_0x3e21be[_0xdbe2('0x15')]['sumHoldTime']+=_0x445b1d[_0x1fe5e2][_0xdbe2('0x5c')]-_0x445b1d[_0x1fe5e2][_0xdbe2('0x5d')]||0x0;_0x3e21be[_0xdbe2('0x15')]['sumBillable']+=_0x445b1d[_0x1fe5e2][_0xdbe2('0x5d')];}}}return _0x3e21be[_0xdbe2('0x15')];};};Realtime['prototype'][_0xdbe2('0x5e')]=function(){var _0x37665b=this;return function(_0x325627){if(_0x325627){freeIsNotKey(_0x325627,_0x37665b[_0xdbe2('0x13')],_0xdbe2('0x26'));for(var _0x36e326=0x0,_0x958d56={};_0x36e326<_0x325627[_0xdbe2('0x3f')];_0x36e326+=0x1){_0x958d56=_0x325627[_0x36e326];if(_[_0xdbe2('0x40')](_0x37665b[_0xdbe2('0x13')][_0x958d56[_0xdbe2('0x26')]])){_0x37665b[_0xdbe2('0x13')][_0x958d56[_0xdbe2('0x26')]]=new Campaign(_0x958d56);}else{_0x37665b[_0xdbe2('0x3c')](_0x37665b[_0xdbe2('0x13')][_0x958d56[_0xdbe2('0x26')]],_0x958d56);_0x37665b[_0xdbe2('0x13')][_0x958d56[_0xdbe2('0x26')]][_0xdbe2('0x5f')]=_0x958d56[_0xdbe2('0x60')]?_0x958d56[_0xdbe2('0x60')][_0xdbe2('0x26')]:undefined;}}}return _0x37665b['campaigns'];};};Realtime[_0xdbe2('0x3b')][_0xdbe2('0x61')]=function(){var _0xde06c9=this;return function(_0x1e27ac){if(_0x1e27ac){freeIsNotKey(_0x1e27ac,_0xde06c9[_0xdbe2('0x62')],'id');for(var _0x15b422=0x0,_0x3186dd={};_0x15b422<_0x1e27ac[_0xdbe2('0x3f')];_0x15b422+=0x1){_0x3186dd=_0x1e27ac[_0x15b422];if(_[_0xdbe2('0x40')](_0xde06c9[_0xdbe2('0x62')][_0x3186dd['id']])){_0xde06c9[_0xdbe2('0x62')][_0x3186dd['id']]=new VoiceExtension(_0x3186dd);}else{_0xde06c9[_0xdbe2('0x3c')](_0xde06c9[_0xdbe2('0x62')][_0x3186dd['id']],_0x3186dd);}}}return _0xde06c9[_0xdbe2('0x62')];};};Realtime[_0xdbe2('0x3b')]['initCampaignHopperHistory']=function(){var _0x5ac1e5=this;return function(_0x59ba56){clearCampaigns(_0x5ac1e5[_0xdbe2('0x13')]);for(var _0x4764ea=0x0;_0x4764ea<_0x59ba56[_0xdbe2('0x3f')];_0x4764ea+=0x1){_[_0xdbe2('0x4f')](_0x5ac1e5['campaigns'][_0x59ba56[_0x4764ea][_0xdbe2('0x26')]],_0x59ba56[_0x4764ea]);}return _0x5ac1e5[_0xdbe2('0x13')];};};Realtime['prototype'][_0xdbe2('0x63')]=function(){var _0x163ab2=this;return function(_0x34aee9){if(_0x34aee9){freeIsNotKey(_0x34aee9,_0x163ab2[_0xdbe2('0x21')],'id');for(var _0x2f9c5f=0x0,_0x21e21e={},_0x5b0203={};_0x2f9c5f<_0x34aee9[_0xdbe2('0x3f')];_0x2f9c5f+=0x1){_0x21e21e=_0x34aee9[_0x2f9c5f];if(_['isUndefined'](_0x163ab2[_0xdbe2('0x21')][_0x21e21e['id']])){_0x163ab2[_0xdbe2('0x21')][_0x21e21e['id']]=new FaxAccount(_0x21e21e);}else{_0x163ab2[_0xdbe2('0x3c')](_0x163ab2[_0xdbe2('0x21')][_0x21e21e['id']],_0x21e21e);}}}return _0x163ab2[_0xdbe2('0x21')];};};module[_0xdbe2('0x64')]=Realtime;
\ No newline at end of file
diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js
index 98e7afc..4f91fba 100644
--- a/server/services/ami/report/index.js
+++ b/server/services/ami/report/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa79=['exten','type','dialer','queue','lastdata','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','calleridname','monitor','monitors','monitorFilename','filename','createdAt','membername','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','voiceQueueReport','create','match','destination'];(function(_0x52ba49,_0x928968){var _0x1a5618=function(_0x4e2db1){while(--_0x4e2db1){_0x52ba49['push'](_0x52ba49['shift']());}};_0x1a5618(++_0x928968);}(_0xfa79,0x175));var _0x9fa7=function(_0x20a9bc,_0x91481c){_0x20a9bc=_0x20a9bc-0x0;var _0x4897aa=_0xfa79[_0x20a9bc];return _0x4897aa;};'use strict';var BPromise=require(_0x9fa7('0x0'));var _=require(_0x9fa7('0x1'));var moment=require(_0x9fa7('0x2'));var util=require(_0x9fa7('0x3'));var config=require(_0x9fa7('0x4'));var logger=require(_0x9fa7('0x5'))(_0x9fa7('0x6'));var ami=require(_0x9fa7('0x7'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x9fa7('0x8'));var RpcMemberReport=require(_0x9fa7('0x9'));var RpcVoiceQueueReport=require(_0x9fa7('0xa'));var RpcVoiceRecording=require(_0x9fa7('0xb'));var RpcVoiceTransferReport=require(_0x9fa7('0xc'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x9fa7('0xd'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x9fa7('0xe'));var UserReport=require(_0x9fa7('0xf'));function Report(_0x8a44a3){this[_0x9fa7('0x10')]=_0x8a44a3;this[_0x9fa7('0x11')]=_0x8a44a3[_0x9fa7('0x11')];this[_0x9fa7('0x12')]=_0x8a44a3[_0x9fa7('0x12')];}Report[_0x9fa7('0x13')][_0x9fa7('0x14')]=function(_0x1029e7){var _0x14c369=new VoiceQueueReport(this[_0x9fa7('0x10')]);var _0x189b52=new VoiceAgentReport(this[_0x9fa7('0x10')]);var _0x29db2c=new VoiceDialReport(this['realtime']);var _0x726267=new VoiceCallReport(this[_0x9fa7('0x10')]);var _0x40fbcf=new UserReport(this[_0x9fa7('0x10')]);if(config[_0x9fa7('0x15')]&&config[_0x9fa7('0x15')][_0x9fa7('0x16')]){ami['on'](_0x9fa7('0x17'),this['voiceQueueReport']['bind'](this));ami['on'](_0x9fa7('0x18'),this[_0x9fa7('0x19')][_0x9fa7('0x1a')](this));ami['on']('custom:voiceAgentReport',this[_0x9fa7('0x1b')]['bind'](this));ami['on'](_0x9fa7('0x1c'),this['voiceDialReport']['bind'](this));ami['on']('blindtransfer',this[_0x9fa7('0x1d')][_0x9fa7('0x1a')](this));ami['on'](_0x9fa7('0x1e'),this[_0x9fa7('0x1f')][_0x9fa7('0x1a')](this));}};Report[_0x9fa7('0x13')][_0x9fa7('0x20')]=function(_0x208f07){var _0x526f55=undefined;_0x526f55=_[_0x9fa7('0x21')](this[_0x9fa7('0x11')],function(_0x330f02){return _0x330f02[_0x9fa7('0x22')]==_0x208f07||_0x330f02[_0x9fa7('0x23')]==_0x208f07;});if(_[_0x9fa7('0x24')](_0x526f55)){var _0x208db9=_[_0x9fa7('0x21')](this[_0x9fa7('0x12')],function(_0x20a4be){return _0x20a4be[_0x9fa7('0x22')]==_0x208f07||_0x20a4be[_0x9fa7('0x23')]==_0x208f07;});if(_0x208db9){_0x526f55=_[_0x9fa7('0x21')](this['agents'],function(_0x40b4a5){return _0x40b4a5[_0x9fa7('0x25')]==util[_0x9fa7('0x26')](_0x9fa7('0x27'),_0x208db9[_0x9fa7('0x23')]);});}}return _0x526f55;};Report[_0x9fa7('0x13')]['voiceQueueReport']=function(_0x45723e){for(var _0x36ff84=0x0;_0x36ff84<_0x45723e[_0x9fa7('0x28')];_0x36ff84+=0x1){var _0xd2af2=this['findAgent'](_0x45723e[_0x36ff84][_0x9fa7('0x29')]);if(_0xd2af2){_0x45723e[_0x36ff84][_0x9fa7('0x22')]=_0xd2af2[_0x9fa7('0x22')];_0x45723e[_0x36ff84][_0x9fa7('0x2a')]=!![];_0x45723e[_0x36ff84][_0x9fa7('0x2b')]=_0xd2af2['name'];_0x45723e[_0x36ff84]['interface']=_[_0x9fa7('0x24')](_0xd2af2[_0x9fa7('0x25')])?util[_0x9fa7('0x26')](_0x9fa7('0x27'),_0xd2af2[_0x9fa7('0x23')]):_0xd2af2[_0x9fa7('0x25')];if(_0x45723e[_0x36ff84]['queuecallercomplete']){_0x45723e[_0x36ff84][_0x9fa7('0x2c')]=moment()[_0x9fa7('0x26')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x45723e[_0x36ff84][_0x9fa7('0x2d')]){_0x45723e[_0x36ff84][_0x9fa7('0x2e')]=moment()[_0x9fa7('0x26')](_0x9fa7('0x2f'));}RpcMemberReport[_0x9fa7('0x30')](_0x45723e[_0x36ff84]);}RpcVoiceQueueReport[_0x9fa7('0x31')](_0x45723e[_0x36ff84]);}};function extractCalleridNumber(_0x253063){var _0x3f867c=_0x253063[_0x9fa7('0x32')](/<(.*?)>/);return _0x3f867c?_0x3f867c[0x1]:_0x253063;}Report[_0x9fa7('0x13')][_0x9fa7('0x19')]=function(_0x1f9434){_0x1f9434[_0x9fa7('0x33')]=_0x1f9434[_0x9fa7('0x33')]||_0x1f9434[_0x9fa7('0x34')];if(_0x1f9434[_0x9fa7('0x35')]==_0x9fa7('0x36')){_0x1f9434['lastapplication']=_0x9fa7('0x37');_0x1f9434[_0x9fa7('0x38')]=_0x1f9434[_0x9fa7('0x37')];if(_0x1f9434['context']=='from-voip-provider'){_0x1f9434[_0x9fa7('0x22')]='';_0x1f9434['destination']=extractCalleridNumber(_0x1f9434['callerid']);}else if(_0x1f9434[_0x9fa7('0x39')]==_0x9fa7('0x3a')){if(_0x1f9434[_0x9fa7('0x33')]==_0x9fa7('0x3b')){_0x1f9434[_0x9fa7('0x33')]=extractCalleridNumber(_0x1f9434[_0x9fa7('0x3c')]);_0x1f9434[_0x9fa7('0x3d')]=_0x1f9434[_0x9fa7('0x3e')];_0x1f9434[_0x9fa7('0x3f')]=[_0x1f9434[_0x9fa7('0x40')],_0x1f9434[_0x9fa7('0x40')]=_0x1f9434['destinationchannel']][0x0];_0x1f9434[_0x9fa7('0x41')]=_0x1f9434[_0x9fa7('0x3c')];}else{_0x1f9434[_0x9fa7('0x33')]=_0x1f9434[_0x9fa7('0x3d')];_0x1f9434[_0x9fa7('0x3d')]=_0x1f9434[_0x9fa7('0x3e')];if(_0x1f9434[_0x9fa7('0x42')]==_0x9fa7('0x43')){_0x1f9434[_0x9fa7('0x22')]=_0x1f9434[_0x9fa7('0x29')];}else{_0x1f9434['accountcode']='';}}}}else{_0x1f9434[_0x9fa7('0x41')]=util[_0x9fa7('0x26')]('\x22%s\x22\x20<%s>',_0x1f9434[_0x9fa7('0x44')],_0x1f9434[_0x9fa7('0x3d')]);}RpcVoiceCallReport['create'](_0x1f9434);if(_0x1f9434[_0x9fa7('0x45')]){for(var _0x14284f=0x0;_0x14284f<_0x1f9434[_0x9fa7('0x46')]['length'];_0x14284f+=0x1){_0x1f9434[_0x9fa7('0x47')]=_0x1f9434[_0x9fa7('0x46')][_0x14284f][_0x9fa7('0x48')];_0x1f9434['createdAt']=_0x1f9434['monitors'][_0x14284f][_0x9fa7('0x49')];if(_0x1f9434[_0x9fa7('0x34')]==_0x9fa7('0x3b')){_0x1f9434[_0x9fa7('0x3d')]=_0x1f9434[_0x9fa7('0x29')];_0x1f9434[_0x9fa7('0x44')]=_0x1f9434['connectedlinename'];_0x1f9434['connectedlinenum']=_0x1f9434[_0x9fa7('0x22')];_0x1f9434['connectedlinename']=_0x1f9434[_0x9fa7('0x4a')];_0x1f9434[_0x9fa7('0x34')]=_0x1f9434[_0x9fa7('0x3e')];}else if(_0x1f9434[_0x9fa7('0x34')]=='xcally-motion-dialer'){_0x1f9434['calleridnum']=_0x1f9434[_0x9fa7('0x33')];_0x1f9434[_0x9fa7('0x34')]=_0x1f9434[_0x9fa7('0x3e')];}RpcVoiceRecording[_0x9fa7('0x31')](_0x1f9434);}}};Report[_0x9fa7('0x13')][_0x9fa7('0x1b')]=function(_0x24a14b){if(_[_0x9fa7('0x4b')](_0x24a14b)){_0x24a14b[_0x9fa7('0x4c')](function(_0x533277){RpcVoiceAgentReport[_0x9fa7('0x31')](_0x533277);});}else{RpcVoiceAgentReport[_0x9fa7('0x31')](_0x24a14b);}};Report[_0x9fa7('0x13')][_0x9fa7('0x4d')]=function(_0x352cc1){RpcVoiceDialReport[_0x9fa7('0x31')](_0x352cc1);var _0x441b1a=undefined;var _0x8257f4=_0x352cc1[_0x9fa7('0x40')];if(_[_0x9fa7('0x4e')](_0x8257f4,_0x9fa7('0x4f'))){var _0x3faba4=_0x8257f4[_0x9fa7('0x50')](_0x8257f4[_0x9fa7('0x51')]('/')+0x1,_0x8257f4['indexOf']('@'));_0x441b1a=_[_0x9fa7('0x21')](this['agents'],function(_0x41701d){return _0x41701d[_0x9fa7('0x52')]==_0x3faba4||_0x41701d[_0x9fa7('0x53')]==_0x3faba4||_0x41701d[_0x9fa7('0x22')]==_0x3faba4;});}else{var _0x3faba4=_0x8257f4[_0x9fa7('0x50')](_0x8257f4[_0x9fa7('0x51')]('/')+0x1,_0x8257f4['lastIndexOf']('-'));_0x441b1a=this[_0x9fa7('0x20')](_0x3faba4);}if(_0x441b1a){_0x352cc1['interface']=_[_0x9fa7('0x24')](_0x441b1a['interface'])?util[_0x9fa7('0x26')](_0x9fa7('0x27'),_0x441b1a[_0x9fa7('0x23')]):_0x441b1a[_0x9fa7('0x25')];_0x352cc1['membername']=_0x441b1a[_0x9fa7('0x23')];_0x352cc1[_0x9fa7('0x22')]=_0x441b1a[_0x9fa7('0x22')];RpcMemberReport[_0x9fa7('0x4d')](_0x352cc1);}};Report[_0x9fa7('0x13')][_0x9fa7('0x1d')]=function(_0x5d15b2){RpcVoiceTransferReport['blindTransfer'](_0x5d15b2);};Report[_0x9fa7('0x13')][_0x9fa7('0x1f')]=function(_0x170768){RpcVoiceTransferReport['attendedTransfer'](_0x170768);};module[_0x9fa7('0x54')]=Report;
\ No newline at end of file
+var _0x356d=['name','isNil','find','accountcode','format','SIP/%s','findAgent','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','dialer','lastapplication','queue','context','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','disposition','ANSWERED','calleridname','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','isArray','forEach','startsWith','Local','substring','indexOf','lastIndexOf','membername','exports','bluebird','lodash','moment','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer'];(function(_0x1afa92,_0x37cea7){var _0x2b665e=function(_0x24dee6){while(--_0x24dee6){_0x1afa92['push'](_0x1afa92['shift']());}};_0x2b665e(++_0x37cea7);}(_0x356d,0x80));var _0xd356=function(_0x4b64a4,_0x1bdc50){_0x4b64a4=_0x4b64a4-0x0;var _0xd19b0e=_0x356d[_0x4b64a4];return _0xd19b0e;};'use strict';var BPromise=require(_0xd356('0x0'));var _=require(_0xd356('0x1'));var moment=require(_0xd356('0x2'));var util=require(_0xd356('0x3'));var config=require('../../../config/environment');var logger=require(_0xd356('0x4'))(_0xd356('0x5'));var ami=require(_0xd356('0x6'));var RpcVoiceAgentReport=require(_0xd356('0x7'));var RpcVoiceCallReport=require(_0xd356('0x8'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xd356('0x9'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xd356('0xa'));var RpcVoiceTransferReport=require(_0xd356('0xb'));var VoiceQueueReport=require(_0xd356('0xc'));var VoiceCallReport=require(_0xd356('0xd'));var VoiceAgentReport=require(_0xd356('0xe'));var VoiceDialReport=require(_0xd356('0xf'));var UserReport=require('./userReport');function Report(_0x48a421){this['realtime']=_0x48a421;this[_0xd356('0x10')]=_0x48a421['agents'];this['telephones']=_0x48a421[_0xd356('0x11')];}Report[_0xd356('0x12')][_0xd356('0x13')]=function(_0x4d8405){var _0x595289=new VoiceQueueReport(this[_0xd356('0x14')]);var _0x4bb801=new VoiceAgentReport(this[_0xd356('0x14')]);var _0x4bb0fb=new VoiceDialReport(this['realtime']);var _0x22116e=new VoiceCallReport(this[_0xd356('0x14')]);var _0x20a43b=new UserReport(this['realtime']);if(config[_0xd356('0x15')]&&config[_0xd356('0x15')][_0xd356('0x16')]){ami['on'](_0xd356('0x17'),this[_0xd356('0x18')]['bind'](this));ami['on'](_0xd356('0x19'),this[_0xd356('0x1a')][_0xd356('0x1b')](this));ami['on'](_0xd356('0x1c'),this[_0xd356('0x1d')][_0xd356('0x1b')](this));ami['on'](_0xd356('0x1e'),this[_0xd356('0x1f')]['bind'](this));ami['on'](_0xd356('0x20'),this[_0xd356('0x21')][_0xd356('0x1b')](this));ami['on'](_0xd356('0x22'),this[_0xd356('0x23')]['bind'](this));}};Report[_0xd356('0x12')]['findAgent']=function(_0x1d3637){var _0x2641f8=undefined;_0x2641f8=_['find'](this['agents'],function(_0x44b4a7){return _0x44b4a7['accountcode']==_0x1d3637||_0x44b4a7[_0xd356('0x24')]==_0x1d3637;});if(_[_0xd356('0x25')](_0x2641f8)){var _0x5bf57c=_[_0xd356('0x26')](this[_0xd356('0x11')],function(_0x25cb5e){return _0x25cb5e[_0xd356('0x27')]==_0x1d3637||_0x25cb5e[_0xd356('0x24')]==_0x1d3637;});if(_0x5bf57c){_0x2641f8=_[_0xd356('0x26')](this['agents'],function(_0x2e0edc){return _0x2e0edc['interface']==util[_0xd356('0x28')](_0xd356('0x29'),_0x5bf57c[_0xd356('0x24')]);});}}return _0x2641f8;};Report['prototype']['voiceQueueReport']=function(_0x305aa2){for(var _0x106d37=0x0;_0x106d37<_0x305aa2['length'];_0x106d37+=0x1){var _0x51b52f=this[_0xd356('0x2a')](_0x305aa2[_0x106d37][_0xd356('0x2b')]);if(_0x51b52f){_0x305aa2[_0x106d37][_0xd356('0x27')]=_0x51b52f[_0xd356('0x27')];_0x305aa2[_0x106d37][_0xd356('0x2c')]=!![];_0x305aa2[_0x106d37][_0xd356('0x2d')]=_0x51b52f[_0xd356('0x24')];_0x305aa2[_0x106d37]['interface']=_['isNil'](_0x51b52f[_0xd356('0x2e')])?util[_0xd356('0x28')](_0xd356('0x29'),_0x51b52f[_0xd356('0x24')]):_0x51b52f['interface'];if(_0x305aa2[_0x106d37][_0xd356('0x2f')]){_0x305aa2[_0x106d37][_0xd356('0x30')]=moment()[_0xd356('0x28')](_0xd356('0x31'));}if(_0x305aa2[_0x106d37]['queuecallerexit']){_0x305aa2[_0x106d37]['queuecallerexitAt']=moment()[_0xd356('0x28')](_0xd356('0x31'));}RpcMemberReport['voiceQueueReport'](_0x305aa2[_0x106d37]);}RpcVoiceQueueReport[_0xd356('0x32')](_0x305aa2[_0x106d37]);}};function extractCalleridNumber(_0x9716a7){var _0x2b2c8f=_0x9716a7[_0xd356('0x33')](/<(.*?)>/);return _0x2b2c8f?_0x2b2c8f[0x1]:_0x9716a7;}Report['prototype'][_0xd356('0x1a')]=function(_0x45f64e){_0x45f64e[_0xd356('0x34')]=_0x45f64e[_0xd356('0x34')]||_0x45f64e[_0xd356('0x35')];if(_0x45f64e['type']==_0xd356('0x36')){_0x45f64e[_0xd356('0x37')]=_0xd356('0x38');_0x45f64e['lastdata']=_0x45f64e[_0xd356('0x38')];if(_0x45f64e[_0xd356('0x39')]=='from-voip-provider'){_0x45f64e[_0xd356('0x27')]='';_0x45f64e[_0xd356('0x34')]=extractCalleridNumber(_0x45f64e[_0xd356('0x3a')]);}else if(_0x45f64e['context']==_0xd356('0x3b')){if(_0x45f64e[_0xd356('0x34')]==_0xd356('0x3c')){_0x45f64e['destination']=extractCalleridNumber(_0x45f64e[_0xd356('0x3d')]);_0x45f64e[_0xd356('0x3e')]=_0x45f64e[_0xd356('0x3f')];_0x45f64e['destinationchannel']=[_0x45f64e['channel'],_0x45f64e['channel']=_0x45f64e['destinationchannel']][0x0];_0x45f64e[_0xd356('0x3a')]=_0x45f64e['calleridpreview'];}else{_0x45f64e[_0xd356('0x34')]=_0x45f64e[_0xd356('0x3e')];_0x45f64e['calleridnum']=_0x45f64e[_0xd356('0x3f')];if(_0x45f64e[_0xd356('0x40')]==_0xd356('0x41')){_0x45f64e[_0xd356('0x27')]=_0x45f64e['connectedlinenum'];}else{_0x45f64e[_0xd356('0x27')]='';}}}}else{_0x45f64e[_0xd356('0x3a')]=util[_0xd356('0x28')]('\x22%s\x22\x20<%s>',_0x45f64e[_0xd356('0x42')],_0x45f64e[_0xd356('0x3e')]);}RpcVoiceCallReport[_0xd356('0x32')](_0x45f64e);if(_0x45f64e[_0xd356('0x43')]){for(var _0x3d7c71=0x0;_0x3d7c71<_0x45f64e[_0xd356('0x44')]['length'];_0x3d7c71+=0x1){_0x45f64e[_0xd356('0x45')]=_0x45f64e[_0xd356('0x44')][_0x3d7c71][_0xd356('0x46')];_0x45f64e['createdAt']=_0x45f64e[_0xd356('0x44')][_0x3d7c71][_0xd356('0x47')];if(_0x45f64e['exten']==_0xd356('0x3c')){_0x45f64e[_0xd356('0x3e')]=_0x45f64e[_0xd356('0x2b')];_0x45f64e[_0xd356('0x42')]=_0x45f64e[_0xd356('0x48')];_0x45f64e['connectedlinenum']=_0x45f64e[_0xd356('0x27')];_0x45f64e[_0xd356('0x48')]=_0x45f64e['membername'];_0x45f64e[_0xd356('0x35')]=_0x45f64e['originatecalleridnum'];}else if(_0x45f64e[_0xd356('0x35')]=='xcally-motion-dialer'){_0x45f64e[_0xd356('0x3e')]=_0x45f64e[_0xd356('0x34')];_0x45f64e['exten']=_0x45f64e[_0xd356('0x3f')];}RpcVoiceRecording[_0xd356('0x32')](_0x45f64e);}}};Report[_0xd356('0x12')][_0xd356('0x1d')]=function(_0x2cf5d9){if(_[_0xd356('0x49')](_0x2cf5d9)){_0x2cf5d9[_0xd356('0x4a')](function(_0x35830c){RpcVoiceAgentReport[_0xd356('0x32')](_0x35830c);});}else{RpcVoiceAgentReport[_0xd356('0x32')](_0x2cf5d9);}};Report[_0xd356('0x12')]['voiceDialReport']=function(_0x363b94){RpcVoiceDialReport['create'](_0x363b94);var _0x13fc21=undefined;var _0x166f8f=_0x363b94['channel'];if(_[_0xd356('0x4b')](_0x166f8f,_0xd356('0x4c'))){var _0x6ccaaf=_0x166f8f[_0xd356('0x4d')](_0x166f8f[_0xd356('0x4e')]('/')+0x1,_0x166f8f['indexOf']('@'));_0x13fc21=_['find'](this[_0xd356('0x10')],function(_0x4fb768){return _0x4fb768['mobile']==_0x6ccaaf||_0x4fb768['phone']==_0x6ccaaf||_0x4fb768['accountcode']==_0x6ccaaf;});}else{var _0x6ccaaf=_0x166f8f[_0xd356('0x4d')](_0x166f8f[_0xd356('0x4e')]('/')+0x1,_0x166f8f[_0xd356('0x4f')]('-'));_0x13fc21=this[_0xd356('0x2a')](_0x6ccaaf);}if(_0x13fc21){_0x363b94['interface']=_[_0xd356('0x25')](_0x13fc21['interface'])?util[_0xd356('0x28')](_0xd356('0x29'),_0x13fc21[_0xd356('0x24')]):_0x13fc21[_0xd356('0x2e')];_0x363b94[_0xd356('0x50')]=_0x13fc21[_0xd356('0x24')];_0x363b94['accountcode']=_0x13fc21[_0xd356('0x27')];RpcMemberReport[_0xd356('0x1f')](_0x363b94);}};Report[_0xd356('0x12')][_0xd356('0x21')]=function(_0x35606f){RpcVoiceTransferReport[_0xd356('0x21')](_0x35606f);};Report[_0xd356('0x12')]['attendedTransfer']=function(_0xcefa56){RpcVoiceTransferReport[_0xd356('0x23')](_0xcefa56);};module[_0xd356('0x51')]=Report;
\ No newline at end of file
diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js
index 8c40fdc..4428506 100644
--- a/server/services/ami/report/userReport.js
+++ b/server/services/ami/report/userReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbd3=['[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ioredis','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','actionSipPeerStatus','[loopSyncRealTimeShow]','prototype','loopSyncRealTimeShow','actionDeviceStateList','isNotNull','isUndefined','emit','find','stateRegistry','merge','omit','event','username','state','format','trunk:save','error','[syncRegistry][UserReport]','inspect','device','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','name','telephone:save','startsWith','Local','indexOf','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','address','status','telephone:%s','trunk:%s'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xcbd3,0x10a));var _0x3cbd=function(_0xa7b963,_0x508a6c){_0xa7b963=_0xa7b963-0x0;var _0x3f43e5=_0xcbd3[_0xa7b963];return _0x3f43e5;};'use strict';var _=require(_0x3cbd('0x0'));var moment=require(_0x3cbd('0x1'));var BPromise=require(_0x3cbd('0x2'));var util=require(_0x3cbd('0x3'));var Redis=require(_0x3cbd('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x3cbd('0x5'));var ami=require('../ami');config[_0x3cbd('0x6')]=_[_0x3cbd('0x7')](config[_0x3cbd('0x6')],{'host':_0x3cbd('0x8'),'port':0x18eb});var io=require(_0x3cbd('0x9'))(new Redis(config[_0x3cbd('0x6')]));function UserReport(_0x83668c){this[_0x3cbd('0xa')]=_0x83668c['trunks'];this[_0x3cbd('0xb')]=_0x83668c[_0x3cbd('0xb')];this[_0x3cbd('0xc')]=_0x83668c[_0x3cbd('0xc')];ami['on'](_0x3cbd('0xd'),this[_0x3cbd('0xe')][_0x3cbd('0xf')](this));ami['on'](_0x3cbd('0x10'),this['syncRegistry'][_0x3cbd('0xf')](this));ami['on'](_0x3cbd('0x11'),this[_0x3cbd('0x12')][_0x3cbd('0xf')](this));ami['on'](_0x3cbd('0x13'),this[_0x3cbd('0x14')][_0x3cbd('0xf')](this));this['loopSyncRealTimeShow']();return BPromise[_0x3cbd('0x15')]()[_0x3cbd('0x16')](ami[_0x3cbd('0x17')]())[_0x3cbd('0x16')](ami['actionDeviceStateList']())[_0x3cbd('0x16')](ami[_0x3cbd('0x18')]())['catch'](loggerCatch(_0x3cbd('0x19')));}function loggerCatch(_0x39cb02){return function(_0x51f3bf){logger['error'](_0x39cb02,util['inspect'](_0x51f3bf,{'showHidden':![],'depth':null}));};}UserReport[_0x3cbd('0x1a')][_0x3cbd('0x1b')]=function(){setInterval(function(){BPromise[_0x3cbd('0x15')]()[_0x3cbd('0x16')](ami[_0x3cbd('0x17')]())[_0x3cbd('0x16')](ami[_0x3cbd('0x1c')]())['then'](ami[_0x3cbd('0x18')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0x3cbd('0x1a')][_0x3cbd('0x1d')]=function(_0x2dafca){return _0x2dafca!==null&&!_[_0x3cbd('0x1e')](_0x2dafca);};UserReport[_0x3cbd('0x1a')][_0x3cbd('0x1f')]=function(_0x2ecedb,_0x28b157,_0x4926ab){io['to'](_0x2ecedb)[_0x3cbd('0x1f')](_0x28b157,_0x4926ab);};UserReport[_0x3cbd('0x1a')]['syncRegistry']=function(_0x313bde){try{if(this[_0x3cbd('0x1d')](_0x313bde)){var _0x4707ed=_[_0x3cbd('0x20')](this[_0x3cbd('0xa')],{'registry':_0x313bde['username']});if(_0x4707ed){_0x313bde[_0x3cbd('0x21')]=_0x313bde['state'];_[_0x3cbd('0x22')](_0x4707ed,_[_0x3cbd('0x23')](_0x313bde,[_0x3cbd('0x24'),'actionid',_0x3cbd('0x25'),_0x3cbd('0x26')]));this[_0x3cbd('0x1f')](util[_0x3cbd('0x27')]('trunk:%s',_0x4707ed['name']),_0x3cbd('0x28'),_0x4707ed);}}}catch(_0x23ea52){logger[_0x3cbd('0x29')](_0x3cbd('0x2a'),util[_0x3cbd('0x2b')](_0x23ea52,{'showHidden':![],'depth':null}));}};UserReport[_0x3cbd('0x1a')][_0x3cbd('0x12')]=function(_0x4a058c){try{if(this['isNotNull'](_0x4a058c)){if(this[_0x3cbd('0xb')][_0x4a058c[_0x3cbd('0x2c')]]){if(!this[_0x3cbd('0xb')][_0x4a058c[_0x3cbd('0x2c')]][_0x3cbd('0x2d')]||_0x4a058c[_0x3cbd('0x26')][_0x3cbd('0x2e')]()=='inuse'){this[_0x3cbd('0xb')][_0x4a058c[_0x3cbd('0x2c')]]['local']=![];if(this[_0x3cbd('0xb')][_0x4a058c[_0x3cbd('0x2c')]][_0x3cbd('0x26')]!==_0x4a058c[_0x3cbd('0x26')]['toLowerCase']()){this[_0x3cbd('0xb')][_0x4a058c['device']][_0x3cbd('0x2f')]=_[_0x3cbd('0x30')](moment()[_0x3cbd('0x27')]('x'));}this[_0x3cbd('0xb')][_0x4a058c['device']][_0x3cbd('0x26')]=_0x4a058c[_0x3cbd('0x26')][_0x3cbd('0x2e')]();this[_0x3cbd('0xb')][_0x4a058c['device']][_0x3cbd('0x31')](_0x4a058c);}}else if(this[_0x3cbd('0xc')][_0x4a058c[_0x3cbd('0x2c')]]){if(this[_0x3cbd('0xc')][_0x4a058c[_0x3cbd('0x2c')]]['state']!==_0x4a058c['state'][_0x3cbd('0x2e')]()){this['telephones'][_0x4a058c[_0x3cbd('0x2c')]][_0x3cbd('0x2f')]=_[_0x3cbd('0x30')](moment()[_0x3cbd('0x27')]('x'));}this['telephones'][_0x4a058c[_0x3cbd('0x2c')]][_0x3cbd('0x26')]=_0x4a058c['state'][_0x3cbd('0x2e')]();this[_0x3cbd('0x1f')](util[_0x3cbd('0x27')]('telephone:%s',this['telephones'][_0x4a058c[_0x3cbd('0x2c')]][_0x3cbd('0x32')]),_0x3cbd('0x33'),this[_0x3cbd('0xc')][_0x4a058c[_0x3cbd('0x2c')]]);}else if(this['trunks'][_0x4a058c[_0x3cbd('0x2c')]]){if(this[_0x3cbd('0xa')][_0x4a058c[_0x3cbd('0x2c')]][_0x3cbd('0x26')]!==_0x4a058c['state'][_0x3cbd('0x2e')]()){this['trunks'][_0x4a058c[_0x3cbd('0x2c')]]['stateTime']=_['toNumber'](moment()[_0x3cbd('0x27')]('x'));}this[_0x3cbd('0xa')][_0x4a058c[_0x3cbd('0x2c')]][_0x3cbd('0x26')]=_0x4a058c[_0x3cbd('0x26')][_0x3cbd('0x2e')]();this[_0x3cbd('0x1f')](util[_0x3cbd('0x27')]('trunk:%s',this[_0x3cbd('0xa')][_0x4a058c[_0x3cbd('0x2c')]]['name']),_0x3cbd('0x28'),this[_0x3cbd('0xa')][_0x4a058c[_0x3cbd('0x2c')]]);}else if(_[_0x3cbd('0x34')](_0x4a058c[_0x3cbd('0x2c')],'Queue')){}else if(_[_0x3cbd('0x34')](_0x4a058c[_0x3cbd('0x2c')],_0x3cbd('0x35'))){var _0x32dc4e=_0x4a058c[_0x3cbd('0x2c')];var _0xbfae55=_0x32dc4e['substring'](_0x32dc4e[_0x3cbd('0x36')]('/')+0x1,_0x32dc4e[_0x3cbd('0x36')]('@'));var _0xb4c7c3=_[_0x3cbd('0x20')](this[_0x3cbd('0xb')],function(_0xdb7fd9){return _0xdb7fd9['mobile']==_0xbfae55||_0xdb7fd9[_0x3cbd('0x37')]==_0xbfae55||_0xdb7fd9[_0x3cbd('0x38')]==_0xbfae55;});if(_0xb4c7c3){if(_0xb4c7c3[_0x3cbd('0x26')]!==_0x4a058c[_0x3cbd('0x26')]['toLowerCase']()){_0xb4c7c3['stateTime']=_[_0x3cbd('0x30')](moment()[_0x3cbd('0x27')]('x'));}_0xb4c7c3[_0x3cbd('0x26')]=_0x4a058c[_0x3cbd('0x26')]['toLowerCase']();_0xb4c7c3[_0x3cbd('0x2d')]=!![];_0xb4c7c3['updateStatusRealtime'](_0x4a058c);}}else{}}}catch(_0x5a918e){logger[_0x3cbd('0x29')](_0x3cbd('0x39'),util[_0x3cbd('0x2b')](_0x5a918e,{'showHidden':![],'depth':null}));}};UserReport[_0x3cbd('0x1a')]['syncPeerStatus']=function(_0x22678f){try{if(this[_0x3cbd('0x1d')](_0x22678f)&&this[_0x3cbd('0x1d')](_0x22678f[_0x3cbd('0x13')])){if(this[_0x3cbd('0xb')][_0x22678f[_0x3cbd('0x3a')]]){if(!this['agents'][_0x22678f[_0x3cbd('0x3a')]][_0x3cbd('0x2d')]||_0x22678f['peerstatus'][_0x3cbd('0x2e')]()==_0x3cbd('0x3b')){this[_0x3cbd('0xb')][_0x22678f['peer']]['local']=![];this[_0x3cbd('0xb')][_0x22678f[_0x3cbd('0x3a')]]['status']=_0x22678f['peerstatus'][_0x3cbd('0x2e')]();this[_0x3cbd('0xb')][_0x22678f['peer']][_0x3cbd('0x3c')]=_0x22678f[_0x3cbd('0x3c')];this['agents'][_0x22678f[_0x3cbd('0x3a')]]['updateStatusRealtime'](_0x22678f);}}else if(this[_0x3cbd('0xc')][_0x22678f[_0x3cbd('0x3a')]]){this[_0x3cbd('0xc')][_0x22678f[_0x3cbd('0x3a')]][_0x3cbd('0x3d')]=_0x22678f[_0x3cbd('0x13')][_0x3cbd('0x2e')]();this[_0x3cbd('0xc')][_0x22678f[_0x3cbd('0x3a')]][_0x3cbd('0x3c')]=_0x22678f['address'];this[_0x3cbd('0x1f')](util['format'](_0x3cbd('0x3e'),this[_0x3cbd('0xc')][_0x22678f['peer']][_0x3cbd('0x32')]),_0x3cbd('0x33'),this[_0x3cbd('0xc')][_0x22678f['peer']]);}else if(this[_0x3cbd('0xa')][_0x22678f[_0x3cbd('0x3a')]]){this[_0x3cbd('0xa')][_0x22678f[_0x3cbd('0x3a')]][_0x3cbd('0x3d')]=_0x22678f[_0x3cbd('0x13')][_0x3cbd('0x2e')]();this[_0x3cbd('0xa')][_0x22678f[_0x3cbd('0x3a')]][_0x3cbd('0x3c')]=_0x22678f[_0x3cbd('0x3c')];this[_0x3cbd('0x1f')](util[_0x3cbd('0x27')](_0x3cbd('0x3f'),this[_0x3cbd('0xa')][_0x22678f[_0x3cbd('0x3a')]][_0x3cbd('0x32')]),_0x3cbd('0x28'),this['trunks'][_0x22678f[_0x3cbd('0x3a')]]);}else{}}}catch(_0x839de2){logger['error'](_0x3cbd('0x40'),util['inspect'](_0x839de2,{'showHidden':![],'depth':null}));}};module[_0x3cbd('0x41')]=UserReport;
\ No newline at end of file
+var _0xd30e=['actionDeviceStateList','catch','[loopSyncRealTimeShow]','inspect','prototype','actionSipPeerStatus','isNotNull','isUndefined','emit','state','omit','event','username','format','trunk:%s','name','trunk:save','error','syncDeviceState','device','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','telephone:%s','startsWith','Local','substring','indexOf','mobile','phone','accountcode','local','peer','registered','address','status','telephone:save','[syncPeerStatus][UserReport]','lodash','bluebird','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry'];(function(_0x252ecb,_0x2bd375){var _0x3a8780=function(_0x27dab4){while(--_0x27dab4){_0x252ecb['push'](_0x252ecb['shift']());}};_0x3a8780(++_0x2bd375);}(_0xd30e,0xa8));var _0xed30=function(_0x39e1c1,_0x18c729){_0x39e1c1=_0x39e1c1-0x0;var _0x493637=_0xd30e[_0x39e1c1];return _0x493637;};'use strict';var _=require(_0xed30('0x0'));var moment=require('moment');var BPromise=require(_0xed30('0x1'));var util=require(_0xed30('0x2'));var Redis=require('ioredis');var config=require(_0xed30('0x3'));var logger=require(_0xed30('0x4'))(_0xed30('0x5'));var ami=require(_0xed30('0x6'));config[_0xed30('0x7')]=_[_0xed30('0x8')](config[_0xed30('0x7')],{'host':_0xed30('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x589efa){this[_0xed30('0xa')]=_0x589efa['trunks'];this[_0xed30('0xb')]=_0x589efa[_0xed30('0xb')];this[_0xed30('0xc')]=_0x589efa[_0xed30('0xc')];ami['on'](_0xed30('0xd'),this['syncRegistry'][_0xed30('0xe')](this));ami['on'](_0xed30('0xf'),this[_0xed30('0x10')][_0xed30('0xe')](this));ami['on'](_0xed30('0x11'),this['syncDeviceState'][_0xed30('0xe')](this));ami['on'](_0xed30('0x12'),this[_0xed30('0x13')]['bind'](this));this[_0xed30('0x14')]();return BPromise[_0xed30('0x15')]()[_0xed30('0x16')](ami[_0xed30('0x17')]())['then'](ami[_0xed30('0x18')]())[_0xed30('0x16')](ami['actionSipPeerStatus']())[_0xed30('0x19')](loggerCatch(_0xed30('0x1a')));}function loggerCatch(_0x222a2b){return function(_0x2a90e1){logger['error'](_0x222a2b,util[_0xed30('0x1b')](_0x2a90e1,{'showHidden':![],'depth':null}));};}UserReport[_0xed30('0x1c')][_0xed30('0x14')]=function(){setInterval(function(){BPromise[_0xed30('0x15')]()[_0xed30('0x16')](ami[_0xed30('0x17')]())[_0xed30('0x16')](ami['actionDeviceStateList']())[_0xed30('0x16')](ami[_0xed30('0x1d')]())[_0xed30('0x19')](loggerCatch(_0xed30('0x1a')));},0x32c8);};UserReport[_0xed30('0x1c')][_0xed30('0x1e')]=function(_0x4d7b4f){return _0x4d7b4f!==null&&!_[_0xed30('0x1f')](_0x4d7b4f);};UserReport[_0xed30('0x1c')]['emit']=function(_0x3e9bcb,_0x1d5d65,_0x4bc584){io['to'](_0x3e9bcb)[_0xed30('0x20')](_0x1d5d65,_0x4bc584);};UserReport[_0xed30('0x1c')][_0xed30('0x10')]=function(_0x33fd78){try{if(this['isNotNull'](_0x33fd78)){var _0x2bb20f=_['find'](this[_0xed30('0xa')],{'registry':_0x33fd78['username']});if(_0x2bb20f){_0x33fd78['stateRegistry']=_0x33fd78[_0xed30('0x21')];_['merge'](_0x2bb20f,_[_0xed30('0x22')](_0x33fd78,[_0xed30('0x23'),'actionid',_0xed30('0x24'),'state']));this[_0xed30('0x20')](util[_0xed30('0x25')](_0xed30('0x26'),_0x2bb20f[_0xed30('0x27')]),_0xed30('0x28'),_0x2bb20f);}}}catch(_0x445023){logger[_0xed30('0x29')]('[syncRegistry][UserReport]',util[_0xed30('0x1b')](_0x445023,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xed30('0x2a')]=function(_0x351a39){try{if(this[_0xed30('0x1e')](_0x351a39)){if(this['agents'][_0x351a39[_0xed30('0x2b')]]){if(!this['agents'][_0x351a39[_0xed30('0x2b')]]['local']||_0x351a39[_0xed30('0x21')]['toLowerCase']()==_0xed30('0x2c')){this[_0xed30('0xb')][_0x351a39[_0xed30('0x2b')]]['local']=![];if(this[_0xed30('0xb')][_0x351a39['device']]['state']!==_0x351a39[_0xed30('0x21')][_0xed30('0x2d')]()){this[_0xed30('0xb')][_0x351a39[_0xed30('0x2b')]][_0xed30('0x2e')]=_[_0xed30('0x2f')](moment()[_0xed30('0x25')]('x'));}this['agents'][_0x351a39[_0xed30('0x2b')]][_0xed30('0x21')]=_0x351a39[_0xed30('0x21')][_0xed30('0x2d')]();this['agents'][_0x351a39['device']][_0xed30('0x30')](_0x351a39);}}else if(this['telephones'][_0x351a39['device']]){if(this['telephones'][_0x351a39[_0xed30('0x2b')]][_0xed30('0x21')]!==_0x351a39[_0xed30('0x21')][_0xed30('0x2d')]()){this[_0xed30('0xc')][_0x351a39[_0xed30('0x2b')]][_0xed30('0x2e')]=_[_0xed30('0x2f')](moment()[_0xed30('0x25')]('x'));}this[_0xed30('0xc')][_0x351a39[_0xed30('0x2b')]][_0xed30('0x21')]=_0x351a39['state'][_0xed30('0x2d')]();this['emit'](util[_0xed30('0x25')](_0xed30('0x31'),this[_0xed30('0xc')][_0x351a39[_0xed30('0x2b')]][_0xed30('0x27')]),'telephone:save',this[_0xed30('0xc')][_0x351a39[_0xed30('0x2b')]]);}else if(this['trunks'][_0x351a39['device']]){if(this[_0xed30('0xa')][_0x351a39[_0xed30('0x2b')]][_0xed30('0x21')]!==_0x351a39[_0xed30('0x21')][_0xed30('0x2d')]()){this[_0xed30('0xa')][_0x351a39['device']][_0xed30('0x2e')]=_[_0xed30('0x2f')](moment()[_0xed30('0x25')]('x'));}this[_0xed30('0xa')][_0x351a39[_0xed30('0x2b')]]['state']=_0x351a39[_0xed30('0x21')][_0xed30('0x2d')]();this[_0xed30('0x20')](util[_0xed30('0x25')](_0xed30('0x26'),this[_0xed30('0xa')][_0x351a39[_0xed30('0x2b')]][_0xed30('0x27')]),_0xed30('0x28'),this[_0xed30('0xa')][_0x351a39[_0xed30('0x2b')]]);}else if(_[_0xed30('0x32')](_0x351a39[_0xed30('0x2b')],'Queue')){}else if(_[_0xed30('0x32')](_0x351a39[_0xed30('0x2b')],_0xed30('0x33'))){var _0x5cf67f=_0x351a39[_0xed30('0x2b')];var _0x42b160=_0x5cf67f[_0xed30('0x34')](_0x5cf67f[_0xed30('0x35')]('/')+0x1,_0x5cf67f['indexOf']('@'));var _0x5c64f0=_['find'](this[_0xed30('0xb')],function(_0x20252b){return _0x20252b[_0xed30('0x36')]==_0x42b160||_0x20252b[_0xed30('0x37')]==_0x42b160||_0x20252b[_0xed30('0x38')]==_0x42b160;});if(_0x5c64f0){if(_0x5c64f0[_0xed30('0x21')]!==_0x351a39[_0xed30('0x21')][_0xed30('0x2d')]()){_0x5c64f0[_0xed30('0x2e')]=_[_0xed30('0x2f')](moment()['format']('x'));}_0x5c64f0[_0xed30('0x21')]=_0x351a39[_0xed30('0x21')][_0xed30('0x2d')]();_0x5c64f0[_0xed30('0x39')]=!![];_0x5c64f0[_0xed30('0x30')](_0x351a39);}}else{}}}catch(_0x4520f2){logger[_0xed30('0x29')]('[syncDeviceState][UserReport]',util[_0xed30('0x1b')](_0x4520f2,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xed30('0x13')]=function(_0x2e60ac){try{if(this[_0xed30('0x1e')](_0x2e60ac)&&this['isNotNull'](_0x2e60ac['peerstatus'])){if(this[_0xed30('0xb')][_0x2e60ac[_0xed30('0x3a')]]){if(!this[_0xed30('0xb')][_0x2e60ac[_0xed30('0x3a')]][_0xed30('0x39')]||_0x2e60ac[_0xed30('0x12')][_0xed30('0x2d')]()==_0xed30('0x3b')){this[_0xed30('0xb')][_0x2e60ac[_0xed30('0x3a')]]['local']=![];this[_0xed30('0xb')][_0x2e60ac[_0xed30('0x3a')]]['status']=_0x2e60ac[_0xed30('0x12')][_0xed30('0x2d')]();this[_0xed30('0xb')][_0x2e60ac[_0xed30('0x3a')]][_0xed30('0x3c')]=_0x2e60ac[_0xed30('0x3c')];this[_0xed30('0xb')][_0x2e60ac[_0xed30('0x3a')]][_0xed30('0x30')](_0x2e60ac);}}else if(this['telephones'][_0x2e60ac[_0xed30('0x3a')]]){this[_0xed30('0xc')][_0x2e60ac[_0xed30('0x3a')]][_0xed30('0x3d')]=_0x2e60ac[_0xed30('0x12')][_0xed30('0x2d')]();this[_0xed30('0xc')][_0x2e60ac[_0xed30('0x3a')]]['address']=_0x2e60ac['address'];this['emit'](util[_0xed30('0x25')](_0xed30('0x31'),this[_0xed30('0xc')][_0x2e60ac[_0xed30('0x3a')]][_0xed30('0x27')]),_0xed30('0x3e'),this[_0xed30('0xc')][_0x2e60ac['peer']]);}else if(this[_0xed30('0xa')][_0x2e60ac[_0xed30('0x3a')]]){this[_0xed30('0xa')][_0x2e60ac[_0xed30('0x3a')]][_0xed30('0x3d')]=_0x2e60ac[_0xed30('0x12')][_0xed30('0x2d')]();this['trunks'][_0x2e60ac[_0xed30('0x3a')]][_0xed30('0x3c')]=_0x2e60ac[_0xed30('0x3c')];this[_0xed30('0x20')](util[_0xed30('0x25')](_0xed30('0x26'),this[_0xed30('0xa')][_0x2e60ac[_0xed30('0x3a')]][_0xed30('0x27')]),_0xed30('0x28'),this[_0xed30('0xa')][_0x2e60ac['peer']]);}else{}}}catch(_0x38416e){logger['error'](_0xed30('0x3f'),util[_0xed30('0x1b')](_0x38416e,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js
index d23725f..947c38e 100644
--- a/server/services/ami/report/voiceAgentReport.js
+++ b/server/services/ami/report/voiceAgentReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2fea=['../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','omit','event','privilege','custom:agentcalled','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','user:%s','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','syncAgentComplete','agentcompleteAt','complete','talktime','agent','acwtime','acwTimeout','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','variable','value','hasOwnProperty','[syncVarSet][VoiceAgentReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','transfer','values','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','ioredis','../../../config/environment'];(function(_0x424d23,_0x5d500a){var _0x5b815f=function(_0x15b666){while(--_0x15b666){_0x424d23['push'](_0x424d23['shift']());}};_0x5b815f(++_0x5d500a);}(_0x2fea,0xf9));var _0xa2fe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2fea[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa2fe('0x0'));var moment=require(_0xa2fe('0x1'));var util=require(_0xa2fe('0x2'));var Redis=require(_0xa2fe('0x3'));var config=require(_0xa2fe('0x4'));var logger=require(_0xa2fe('0x5'))(_0xa2fe('0x6'));var ami=require(_0xa2fe('0x7'));config[_0xa2fe('0x8')]=_[_0xa2fe('0x9')](config['redis'],{'host':_0xa2fe('0xa'),'port':0x18eb});var io=require(_0xa2fe('0xb'))(new Redis(config['redis']));function VoiceAgentReport(_0x5f2599){this[_0xa2fe('0xc')]={};this[_0xa2fe('0xd')]=_0x5f2599[_0xa2fe('0xd')];this[_0xa2fe('0xe')]=_0x5f2599[_0xa2fe('0xe')];this[_0xa2fe('0xf')]={};ami['on'](_0xa2fe('0x10'),this[_0xa2fe('0x11')]['bind'](this));ami['on'](_0xa2fe('0x12'),this[_0xa2fe('0x13')][_0xa2fe('0x14')](this));ami['on'](_0xa2fe('0x15'),this[_0xa2fe('0x16')][_0xa2fe('0x14')](this));ami['on'](_0xa2fe('0x17'),this['syncQueueCallerAbandon'][_0xa2fe('0x14')](this));ami['on'](_0xa2fe('0x18'),this['syncAgentComplete']['bind'](this));ami['on'](_0xa2fe('0x19'),this[_0xa2fe('0x1a')][_0xa2fe('0x14')](this));ami['on'](_0xa2fe('0x1b'),this[_0xa2fe('0x1c')][_0xa2fe('0x14')](this));ami['on']('musiconholdstart',this[_0xa2fe('0x1d')]['bind'](this));ami['on']('musiconholdstop',this[_0xa2fe('0x1e')]['bind'](this));ami['on'](_0xa2fe('0x1f'),this[_0xa2fe('0x20')]['bind'](this));ami['on']('blindtransfer',this[_0xa2fe('0x21')]['bind'](this));}VoiceAgentReport['prototype'][_0xa2fe('0x22')]=function(_0x5a40bd,_0x243b80,_0x325d42){io['to'](_0x5a40bd)['emit'](_0x243b80,_0x325d42);};VoiceAgentReport[_0xa2fe('0x23')]['isNotNull']=function(_0x5a5841){return _0x5a5841!==null&&!_['isUndefined'](_0x5a5841);};VoiceAgentReport['prototype'][_0xa2fe('0x11')]=function(_0x5b96b5){try{if(this[_0xa2fe('0x24')](_0x5b96b5)){if(_[_0xa2fe('0x25')](this[_0xa2fe('0xc')][_0x5b96b5[_0xa2fe('0x26')]])){this[_0xa2fe('0xc')][_0x5b96b5[_0xa2fe('0x26')]]={};}if(_[_0xa2fe('0x25')](this[_0xa2fe('0xc')][_0x5b96b5[_0xa2fe('0x26')]][_0x5b96b5[_0xa2fe('0x27')]])){this[_0xa2fe('0xc')][_0x5b96b5[_0xa2fe('0x26')]][_0x5b96b5[_0xa2fe('0x27')]]={'agentcalledAt':moment()[_0xa2fe('0x28')](_0xa2fe('0x29')),'lastevent':_0xa2fe('0x2a'),'variables':this['variables'][_0x5b96b5['uniqueid']],'type':this[_0xa2fe('0xd')][_0x5b96b5[_0xa2fe('0x2b')]]?this[_0xa2fe('0xd')][_0x5b96b5[_0xa2fe('0x2b')]][_0xa2fe('0x2c')]||_0xa2fe('0x2d'):_0xa2fe('0x2d')};}_['merge'](this[_0xa2fe('0xc')][_0x5b96b5[_0xa2fe('0x26')]][_0x5b96b5[_0xa2fe('0x27')]],_[_0xa2fe('0x2e')](_0x5b96b5,[_0xa2fe('0x2f'),_0xa2fe('0x30')]));ami[_0xa2fe('0x22')](_0xa2fe('0x31'),this[_0xa2fe('0xc')][_0x5b96b5[_0xa2fe('0x26')]][_0x5b96b5['destuniqueid']]);this[_0xa2fe('0x22')](util[_0xa2fe('0x28')]('user:%s',_0x5b96b5[_0xa2fe('0x32')]),_0xa2fe('0x33'),this[_0xa2fe('0xc')][_0x5b96b5[_0xa2fe('0x26')]][_0x5b96b5[_0xa2fe('0x27')]]);}}catch(_0x1f5ce2){logger[_0xa2fe('0x34')](_0xa2fe('0x35'),util[_0xa2fe('0x36')](_0x1f5ce2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa2fe('0x23')][_0xa2fe('0x13')]=function(_0xe8b520){try{if(this[_0xa2fe('0x24')](_0xe8b520)){if(this[_0xa2fe('0xc')][_0xe8b520[_0xa2fe('0x26')]]){for(var _0x1dbc10 in this[_0xa2fe('0xc')][_0xe8b520['uniqueid']]){if(this[_0xa2fe('0xc')][_0xe8b520[_0xa2fe('0x26')]]['hasOwnProperty'](_0x1dbc10)){if(_0xe8b520[_0xa2fe('0x27')]===_0x1dbc10){this['channels'][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x37')]=moment()[_0xa2fe('0x28')](_0xa2fe('0x29'));this[_0xa2fe('0xc')][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x38')]=_0xa2fe('0x39');this[_0xa2fe('0xc')][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x3a')]=_0xe8b520['holdtime'];this[_0xa2fe('0xc')][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x3b')]=_0xe8b520[_0xa2fe('0x3b')];this[_0xa2fe('0xc')][_0xe8b520['uniqueid']][_0x1dbc10][_0xa2fe('0x3c')]=_0xe8b520[_0xa2fe('0x3c')];this['channels'][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x3d')]=_0xe8b520[_0xa2fe('0x3d')];this['channels'][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x3e')]=_0xe8b520[_0xa2fe('0x3e')];_[_0xa2fe('0x3f')](this[_0xa2fe('0xe')][_0xe8b520[_0xa2fe('0x40')]],_[_0xa2fe('0x41')](_0xe8b520,[_0xa2fe('0x2b'),'destconnectedlinenum']));this[_0xa2fe('0x22')](util['format'](_0xa2fe('0x42'),_0xe8b520['membername']),_0xa2fe('0x43'),this['channels'][_0xe8b520[_0xa2fe('0x26')]][_0xe8b520[_0xa2fe('0x27')]]);ami[_0xa2fe('0x22')](_0xa2fe('0x44'),this[_0xa2fe('0xc')][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10]);}else if(!this['channels'][_0xe8b520['uniqueid']][_0x1dbc10][_0xa2fe('0x15')]&&!this[_0xa2fe('0xc')][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x18')]){this['channels'][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x15')]=!![];this[_0xa2fe('0xc')][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x45')]=moment()[_0xa2fe('0x28')](_0xa2fe('0x29'));this['channels'][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x46')]=_0xa2fe('0x47');this[_0xa2fe('0xc')][_0xe8b520['uniqueid']][_0x1dbc10]['lastevent']='answered_elsewhere';this['channels'][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x48')]=_0xe8b520[_0xa2fe('0x27')];this[_0xa2fe('0xc')][_0xe8b520[_0xa2fe('0x26')]][_0x1dbc10][_0xa2fe('0x49')]=_0xe8b520['membername'];ami[_0xa2fe('0x22')](_0xa2fe('0x4a'),this[_0xa2fe('0xc')][_0xe8b520['uniqueid']][_0x1dbc10]);}}}}}}catch(_0x3143a5){logger[_0xa2fe('0x34')](_0xa2fe('0x4b'),util[_0xa2fe('0x36')](_0x3143a5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa2fe('0x23')][_0xa2fe('0x16')]=function(_0x1dcb79){try{if(this['isNotNull'](_0x1dcb79)){if(this[_0xa2fe('0xc')][_0x1dcb79[_0xa2fe('0x26')]]&&this['channels'][_0x1dcb79['uniqueid']][_0x1dcb79[_0xa2fe('0x27')]]){this[_0xa2fe('0xc')][_0x1dcb79[_0xa2fe('0x26')]][_0x1dcb79[_0xa2fe('0x27')]]['agentringnoanswer']=!![];this[_0xa2fe('0xc')][_0x1dcb79[_0xa2fe('0x26')]][_0x1dcb79[_0xa2fe('0x27')]][_0xa2fe('0x45')]=moment()[_0xa2fe('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa2fe('0xc')][_0x1dcb79[_0xa2fe('0x26')]][_0x1dcb79['destuniqueid']][_0xa2fe('0x46')]=_0xa2fe('0x4c');this[_0xa2fe('0xc')][_0x1dcb79[_0xa2fe('0x26')]][_0x1dcb79[_0xa2fe('0x27')]][_0xa2fe('0x38')]=_0xa2fe('0x4c');ami[_0xa2fe('0x22')](_0xa2fe('0x4d'),this[_0xa2fe('0xc')][_0x1dcb79[_0xa2fe('0x26')]][_0x1dcb79['destuniqueid']]);}}}catch(_0x18002c){logger['error'](_0xa2fe('0x4e'),util[_0xa2fe('0x36')](_0x18002c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa2fe('0x23')][_0xa2fe('0x4f')]=function(_0x38175c){try{if(this['isNotNull'](_0x38175c)){if(this[_0xa2fe('0xc')][_0x38175c[_0xa2fe('0x26')]]){for(var _0x56f4b7 in this[_0xa2fe('0xc')][_0x38175c[_0xa2fe('0x26')]]){if(this['channels'][_0x38175c[_0xa2fe('0x26')]]['hasOwnProperty'](_0x56f4b7)&&!this[_0xa2fe('0xc')][_0x38175c[_0xa2fe('0x26')]][_0x56f4b7][_0xa2fe('0x15')]&&!this[_0xa2fe('0xc')][_0x38175c[_0xa2fe('0x26')]][_0x56f4b7][_0xa2fe('0x18')]){this[_0xa2fe('0xc')][_0x38175c[_0xa2fe('0x26')]][_0x56f4b7][_0xa2fe('0x15')]=!![];this[_0xa2fe('0xc')][_0x38175c[_0xa2fe('0x26')]][_0x56f4b7][_0xa2fe('0x45')]=moment()[_0xa2fe('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa2fe('0xc')][_0x38175c[_0xa2fe('0x26')]][_0x56f4b7][_0xa2fe('0x46')]='abandoned';this[_0xa2fe('0xc')][_0x38175c[_0xa2fe('0x26')]][_0x56f4b7][_0xa2fe('0x38')]=_0xa2fe('0x50');ami[_0xa2fe('0x22')](_0xa2fe('0x51'),this[_0xa2fe('0xc')][_0x38175c[_0xa2fe('0x26')]][_0x56f4b7]);}}}}}catch(_0x205e3e){logger[_0xa2fe('0x34')](_0xa2fe('0x52'),util[_0xa2fe('0x36')](_0x205e3e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa2fe('0x23')][_0xa2fe('0x53')]=function(_0x1fbc30){try{if(this[_0xa2fe('0x24')](_0x1fbc30)){if(this[_0xa2fe('0xc')][_0x1fbc30['uniqueid']]){for(var _0x427667 in this[_0xa2fe('0xc')][_0x1fbc30[_0xa2fe('0x26')]]){if(this[_0xa2fe('0xc')][_0x1fbc30['uniqueid']]['hasOwnProperty'](_0x427667)){if(this['channels'][_0x1fbc30['uniqueid']][_0x427667][_0xa2fe('0x37')]&&!this[_0xa2fe('0xc')][_0x1fbc30[_0xa2fe('0x26')]][_0x427667]['agentcomplete']){this[_0xa2fe('0xc')][_0x1fbc30[_0xa2fe('0x26')]][_0x427667][_0xa2fe('0x18')]=!![];this['channels'][_0x1fbc30[_0xa2fe('0x26')]][_0x427667][_0xa2fe('0x54')]=moment()[_0xa2fe('0x28')](_0xa2fe('0x29'));this[_0xa2fe('0xc')][_0x1fbc30[_0xa2fe('0x26')]][_0x427667][_0xa2fe('0x38')]=_0xa2fe('0x55');this[_0xa2fe('0xc')][_0x1fbc30['uniqueid']][_0x427667]['talktime']=_0x1fbc30[_0xa2fe('0x56')];this[_0xa2fe('0xc')][_0x1fbc30[_0xa2fe('0x26')]][_0x427667]['reason']=_0x1fbc30[_0xa2fe('0x46')]=='transfer'?_0xa2fe('0x57'):_0x1fbc30[_0xa2fe('0x46')];if(this['voiceQueues'][_0x1fbc30['queue']]&&this[_0xa2fe('0xd')][_0x1fbc30['queue']]['acw']){this[_0xa2fe('0xc')][_0x1fbc30[_0xa2fe('0x26')]][_0x427667]['agentacw']=!![];this['channels'][_0x1fbc30[_0xa2fe('0x26')]][_0x427667][_0xa2fe('0x58')]=this['voiceQueues'][_0x1fbc30[_0xa2fe('0x2b')]][_0xa2fe('0x59')];}this[_0xa2fe('0xe')][_0x1fbc30['interface']]=_[_0xa2fe('0x2e')](this[_0xa2fe('0xe')][_0x1fbc30['interface']],['queue','destconnectedlinenum']);this['emit'](util['format']('user:%s',_0x1fbc30[_0xa2fe('0x32')]),'user:agentcomplete',this[_0xa2fe('0xc')][_0x1fbc30[_0xa2fe('0x26')]][_0x427667]);ami['emit'](_0xa2fe('0x5a'),this['channels'][_0x1fbc30[_0xa2fe('0x26')]][_0x427667]);}}}}}}catch(_0x23cee3){logger['error'](_0xa2fe('0x5b'),util['inspect'](_0x23cee3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa2fe('0x23')][_0xa2fe('0x1a')]=function(_0x3ca5eb){try{if(this[_0xa2fe('0x24')](_0x3ca5eb)){this[_0xa2fe('0x5c')](_0x3ca5eb['uniqueid'],_['keys'](_0x3ca5eb[_0xa2fe('0x5d')])[0x0],_0x3ca5eb[_0xa2fe('0x5e')]);if(this[_0xa2fe('0xc')][_0x3ca5eb[_0xa2fe('0x26')]]){for(var _0x2eb1a9 in this[_0xa2fe('0xc')][_0x3ca5eb[_0xa2fe('0x26')]]){if(this[_0xa2fe('0xc')][_0x3ca5eb[_0xa2fe('0x26')]][_0xa2fe('0x5f')](_0x2eb1a9)){if(_[_0xa2fe('0x25')](this[_0xa2fe('0xc')][_0x3ca5eb[_0xa2fe('0x26')]][_0x2eb1a9]['variables'])){this[_0xa2fe('0xc')][_0x3ca5eb[_0xa2fe('0x26')]][_0x2eb1a9]['variables']={};}this['channels'][_0x3ca5eb[_0xa2fe('0x26')]][_0x2eb1a9][_0xa2fe('0xf')]=this[_0xa2fe('0xf')][_0x3ca5eb['uniqueid']];}}}}}catch(_0x13e8e8){logger[_0xa2fe('0x34')](_0xa2fe('0x60'),util['inspect'](_0x13e8e8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa2fe('0x23')][_0xa2fe('0x5c')]=function(_0x2b296d,_0x388420,_0x1850a8){var _0x39e70f=['rtpaudioqos',_0xa2fe('0x61'),_0xa2fe('0x62'),_0xa2fe('0x63'),_0xa2fe('0x64'),_0xa2fe('0x65'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0xa2fe('0x66'),_0xa2fe('0x67'),_0xa2fe('0x68'),_0xa2fe('0x69'),_0xa2fe('0x6a'),_0xa2fe('0x6b'),_0xa2fe('0x6c'),_0xa2fe('0x6d'),'membername',_0xa2fe('0x6e'),_0xa2fe('0x6f')];if(!_['isNil'](_0x388420)&&!_['includes'](_0x39e70f,_0x388420)){if(_[_0xa2fe('0x25')](this[_0xa2fe('0xf')][_0x2b296d])){this[_0xa2fe('0xf')][_0x2b296d]={};}this[_0xa2fe('0xf')][_0x2b296d][_0x388420]=_0x1850a8;}};VoiceAgentReport['prototype'][_0xa2fe('0x1c')]=function(_0x1f6ca9){try{if(this[_0xa2fe('0x24')](_0x1f6ca9)){if(this[_0xa2fe('0xc')][_0x1f6ca9[_0xa2fe('0x26')]]){for(var _0x36f38b in this['channels'][_0x1f6ca9[_0xa2fe('0x26')]]){if(this[_0xa2fe('0xc')][_0x1f6ca9['uniqueid']]['hasOwnProperty'](_0x36f38b)){if(this[_0xa2fe('0xc')][_0x1f6ca9[_0xa2fe('0x26')]][_0x36f38b][_0xa2fe('0x46')]==_0xa2fe('0x70')&&this[_0xa2fe('0xc')][_0x1f6ca9[_0xa2fe('0x26')]][_0x36f38b][_0xa2fe('0x18')]){this[_0xa2fe('0xc')][_0x1f6ca9['uniqueid']][_0x36f38b][_0xa2fe('0x54')]=moment()[_0xa2fe('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0xa2fe('0x22')]('custom:voiceAgentReport',_[_0xa2fe('0x71')](this[_0xa2fe('0xc')][_0x1f6ca9['uniqueid']]));delete this[_0xa2fe('0xc')][_0x1f6ca9[_0xa2fe('0x26')]];}if(this['variables'][_0x1f6ca9[_0xa2fe('0x26')]]){delete this[_0xa2fe('0xf')][_0x1f6ca9[_0xa2fe('0x26')]];}}}catch(_0x37512d){logger[_0xa2fe('0x34')]('[syncHangup][VoiceAgentReport]',util[_0xa2fe('0x36')](_0x37512d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa2fe('0x23')][_0xa2fe('0x20')]=function(_0x88b65e){try{if(this[_0xa2fe('0x24')](_0x88b65e)){if(this['channels'][_0x88b65e[_0xa2fe('0x72')]]){for(var _0x48427d in this[_0xa2fe('0xc')][_0x88b65e[_0xa2fe('0x72')]]){if(this['channels'][_0x88b65e[_0xa2fe('0x72')]][_0xa2fe('0x5f')](_0x48427d)){if(_0x88b65e[_0xa2fe('0x73')]===_0x48427d){var _0x479ffa=moment();this[_0xa2fe('0xc')][_0x88b65e[_0xa2fe('0x72')]][_0x48427d][_0xa2fe('0x18')]=!![];this[_0xa2fe('0xc')][_0x88b65e[_0xa2fe('0x72')]][_0x48427d][_0xa2fe('0x54')]=moment()[_0xa2fe('0x28')](_0xa2fe('0x29'));this[_0xa2fe('0xc')][_0x88b65e[_0xa2fe('0x72')]][_0x48427d][_0xa2fe('0x46')]=_0xa2fe('0x70');this[_0xa2fe('0xc')][_0x88b65e[_0xa2fe('0x72')]][_0x48427d][_0xa2fe('0x38')]='complete';this[_0xa2fe('0xc')][_0x88b65e[_0xa2fe('0x72')]][_0x48427d]['talktime']=_0x479ffa[_0xa2fe('0x74')](this['channels'][_0x88b65e['transfereeuniqueid']][_0x48427d]['agentconnectAt'],_0xa2fe('0x75'));}}}}if(this[_0xa2fe('0xc')][_0x88b65e['secondtransfereruniqueid']]){var _0xfb9698=this[_0xa2fe('0xc')][_0x88b65e[_0xa2fe('0x76')]];this['channels'][_0x88b65e[_0xa2fe('0x76')]]=this[_0xa2fe('0xc')][_0x88b65e['transfereeuniqueid']];this['channels'][_0x88b65e['transfereeuniqueid']]=_0xfb9698;}}}catch(_0x134188){logger[_0xa2fe('0x34')]('[syncAttendedTransfer][VoiceAgentReport]',util['inspect'](_0x134188,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa2fe('0x23')]['syncBlindTransfer']=function(_0x2be7a1){try{if(this[_0xa2fe('0x24')](_0x2be7a1)){if(this[_0xa2fe('0xc')][_0x2be7a1[_0xa2fe('0x72')]]){for(var _0x2bd83f in this['channels'][_0x2be7a1[_0xa2fe('0x72')]]){if(this['channels'][_0x2be7a1['transfereeuniqueid']][_0xa2fe('0x5f')](_0x2bd83f)){if(_0x2be7a1['transfereruniqueid']===_0x2bd83f){var _0x5c22d9=moment();this[_0xa2fe('0xc')][_0x2be7a1[_0xa2fe('0x72')]][_0x2bd83f][_0xa2fe('0x18')]=!![];this['channels'][_0x2be7a1['transfereeuniqueid']][_0x2bd83f]['agentcompleteAt']=_0x5c22d9;this[_0xa2fe('0xc')][_0x2be7a1[_0xa2fe('0x72')]][_0x2bd83f][_0xa2fe('0x46')]=_0xa2fe('0x70');this[_0xa2fe('0xc')][_0x2be7a1[_0xa2fe('0x72')]][_0x2bd83f][_0xa2fe('0x38')]='complete';this[_0xa2fe('0xc')][_0x2be7a1[_0xa2fe('0x72')]][_0x2bd83f]['talktime']=_0x5c22d9[_0xa2fe('0x74')](this['channels'][_0x2be7a1['transfereeuniqueid']][_0x2bd83f][_0xa2fe('0x37')],'seconds');}}}}}}catch(_0x241c7d){logger['error'](_0xa2fe('0x77'),util['inspect'](_0x241c7d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa2fe('0x1d')]=function(_0x15b49f){var _0x1031be='';try{if(this[_0xa2fe('0x24')](_0x15b49f)){if(_0x15b49f[_0xa2fe('0x78')]){_0x1031be=_0x15b49f[_0xa2fe('0x78')][_0xa2fe('0x79')](0x0,_0x15b49f[_0xa2fe('0x78')][_0xa2fe('0x7a')]('-'));if(this['agents'][_0x1031be]){this[_0xa2fe('0xe')][_0x1031be][_0xa2fe('0x7b')]=!![];}}}}catch(_0x3b6e2c){logger[_0xa2fe('0x34')](_0xa2fe('0x7c'),util['inspect'](_0x3b6e2c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa2fe('0x1e')]=function(_0x4a569e){var _0x1013e5='';try{if(this['isNotNull'](_0x4a569e)){if(_0x4a569e[_0xa2fe('0x78')]){_0x1013e5=_0x4a569e[_0xa2fe('0x78')][_0xa2fe('0x79')](0x0,_0x4a569e['channel'][_0xa2fe('0x7a')]('-'));if(this[_0xa2fe('0xe')][_0x1013e5]){this[_0xa2fe('0xe')][_0x1013e5][_0xa2fe('0x7b')]=![];}}}}catch(_0x49a3f4){logger['error'](_0xa2fe('0x7d'),util['inspect'](_0x49a3f4,{'showHidden':![],'depth':null}));}};module[_0xa2fe('0x7e')]=VoiceAgentReport;
\ No newline at end of file
+var _0x098a=['memberinterface','memberpenalty','isNil','includes','agentcompleteAt','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','syncMusicOnHoldStop','substring','lastIndexOf','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','ioredis','../../../config/environment','ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','isUndefined','isNotNull','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','emit','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','agentconnectAt','format','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','custom:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','reason','rejected','custom:agentringnoanswer','hasOwnProperty','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','complete','talktime','transfer','agent','agentacw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x098a,0x113));var _0xa098=function(_0x2b3821,_0x58db6c){_0x2b3821=_0x2b3821-0x0;var _0x24d7e3=_0x098a[_0x2b3821];return _0x24d7e3;};'use strict';var _=require(_0xa098('0x0'));var moment=require(_0xa098('0x1'));var util=require('util');var Redis=require(_0xa098('0x2'));var config=require(_0xa098('0x3'));var logger=require('../../../config/logger')(_0xa098('0x4'));var ami=require('../ami');config[_0xa098('0x5')]=_[_0xa098('0x6')](config[_0xa098('0x5')],{'host':_0xa098('0x7'),'port':0x18eb});var io=require(_0xa098('0x8'))(new Redis(config[_0xa098('0x5')]));function VoiceAgentReport(_0x264c57){this[_0xa098('0x9')]={};this[_0xa098('0xa')]=_0x264c57['voiceQueues'];this['agents']=_0x264c57[_0xa098('0xb')];this[_0xa098('0xc')]={};ami['on'](_0xa098('0xd'),this[_0xa098('0xe')][_0xa098('0xf')](this));ami['on'](_0xa098('0x10'),this[_0xa098('0x11')]['bind'](this));ami['on'](_0xa098('0x12'),this[_0xa098('0x13')][_0xa098('0xf')](this));ami['on'](_0xa098('0x14'),this[_0xa098('0x15')][_0xa098('0xf')](this));ami['on'](_0xa098('0x16'),this[_0xa098('0x17')][_0xa098('0xf')](this));ami['on'](_0xa098('0x18'),this[_0xa098('0x19')][_0xa098('0xf')](this));ami['on'](_0xa098('0x1a'),this[_0xa098('0x1b')]['bind'](this));ami['on'](_0xa098('0x1c'),this[_0xa098('0x1d')]['bind'](this));ami['on'](_0xa098('0x1e'),this['syncMusicOnHoldStop'][_0xa098('0xf')](this));ami['on'](_0xa098('0x1f'),this[_0xa098('0x20')]['bind'](this));ami['on']('blindtransfer',this[_0xa098('0x21')][_0xa098('0xf')](this));}VoiceAgentReport[_0xa098('0x22')]['emit']=function(_0x4511d6,_0x3b9d04,_0x246d56){io['to'](_0x4511d6)['emit'](_0x3b9d04,_0x246d56);};VoiceAgentReport[_0xa098('0x22')]['isNotNull']=function(_0x4539fc){return _0x4539fc!==null&&!_[_0xa098('0x23')](_0x4539fc);};VoiceAgentReport[_0xa098('0x22')][_0xa098('0xe')]=function(_0x2e5b2f){try{if(this[_0xa098('0x24')](_0x2e5b2f)){if(_['isUndefined'](this[_0xa098('0x9')][_0x2e5b2f[_0xa098('0x25')]])){this['channels'][_0x2e5b2f[_0xa098('0x25')]]={};}if(_[_0xa098('0x23')](this[_0xa098('0x9')][_0x2e5b2f['uniqueid']][_0x2e5b2f[_0xa098('0x26')]])){this['channels'][_0x2e5b2f[_0xa098('0x25')]][_0x2e5b2f['destuniqueid']]={'agentcalledAt':moment()['format'](_0xa098('0x27')),'lastevent':_0xa098('0x28'),'variables':this['variables'][_0x2e5b2f[_0xa098('0x25')]],'type':this[_0xa098('0xa')][_0x2e5b2f[_0xa098('0x29')]]?this['voiceQueues'][_0x2e5b2f['queue']][_0xa098('0x2a')]||'inbound':_0xa098('0x2b')};}_[_0xa098('0x2c')](this[_0xa098('0x9')][_0x2e5b2f[_0xa098('0x25')]][_0x2e5b2f[_0xa098('0x26')]],_[_0xa098('0x2d')](_0x2e5b2f,['event','privilege']));ami[_0xa098('0x2e')](_0xa098('0x2f'),this['channels'][_0x2e5b2f[_0xa098('0x25')]][_0x2e5b2f[_0xa098('0x26')]]);this[_0xa098('0x2e')](util['format'](_0xa098('0x30'),_0x2e5b2f[_0xa098('0x31')]),_0xa098('0x32'),this[_0xa098('0x9')][_0x2e5b2f[_0xa098('0x25')]][_0x2e5b2f[_0xa098('0x26')]]);}}catch(_0x2f5d74){logger[_0xa098('0x33')](_0xa098('0x34'),util[_0xa098('0x35')](_0x2f5d74,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa098('0x22')]['syncAgentConnect']=function(_0x1a7f0b){try{if(this[_0xa098('0x24')](_0x1a7f0b)){if(this['channels'][_0x1a7f0b[_0xa098('0x25')]]){for(var _0x346d33 in this[_0xa098('0x9')][_0x1a7f0b['uniqueid']]){if(this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]]['hasOwnProperty'](_0x346d33)){if(_0x1a7f0b['destuniqueid']===_0x346d33){this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x346d33][_0xa098('0x36')]=moment()[_0xa098('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa098('0x9')][_0x1a7f0b['uniqueid']][_0x346d33][_0xa098('0x38')]=_0xa098('0x39');this[_0xa098('0x9')][_0x1a7f0b['uniqueid']][_0x346d33][_0xa098('0x3a')]=_0x1a7f0b[_0xa098('0x3a')];this[_0xa098('0x9')][_0x1a7f0b['uniqueid']][_0x346d33][_0xa098('0x3b')]=_0x1a7f0b[_0xa098('0x3b')];this[_0xa098('0x9')][_0x1a7f0b['uniqueid']][_0x346d33][_0xa098('0x3c')]=_0x1a7f0b[_0xa098('0x3c')];this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x346d33][_0xa098('0x3d')]=_0x1a7f0b['destchannelstate'];this[_0xa098('0x9')][_0x1a7f0b['uniqueid']][_0x346d33][_0xa098('0x3e')]=_0x1a7f0b[_0xa098('0x3e')];_[_0xa098('0x2c')](this['agents'][_0x1a7f0b[_0xa098('0x3f')]],_[_0xa098('0x40')](_0x1a7f0b,['queue',_0xa098('0x41')]));this['emit'](util[_0xa098('0x37')](_0xa098('0x30'),_0x1a7f0b['membername']),'user:agentconnect',this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x1a7f0b[_0xa098('0x26')]]);ami[_0xa098('0x2e')](_0xa098('0x42'),this[_0xa098('0x9')][_0x1a7f0b['uniqueid']][_0x346d33]);}else if(!this[_0xa098('0x9')][_0x1a7f0b['uniqueid']][_0x346d33][_0xa098('0x12')]&&!this['channels'][_0x1a7f0b['uniqueid']][_0x346d33][_0xa098('0x16')]){this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x346d33][_0xa098('0x12')]=!![];this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x346d33][_0xa098('0x43')]=moment()[_0xa098('0x37')](_0xa098('0x27'));this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x346d33]['reason']=_0xa098('0x44');this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x346d33][_0xa098('0x38')]='answered_elsewhere';this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x346d33][_0xa098('0x45')]=_0x1a7f0b['destuniqueid'];this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x346d33][_0xa098('0x46')]=_0x1a7f0b['membername'];ami[_0xa098('0x2e')]('custom:agentansweredelsewhere',this[_0xa098('0x9')][_0x1a7f0b[_0xa098('0x25')]][_0x346d33]);}}}}}}catch(_0x1e778f){logger[_0xa098('0x33')]('[syncAgentConnect][VoiceAgentReport]',util[_0xa098('0x35')](_0x1e778f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa098('0x22')][_0xa098('0x13')]=function(_0x3c2905){try{if(this[_0xa098('0x24')](_0x3c2905)){if(this['channels'][_0x3c2905[_0xa098('0x25')]]&&this[_0xa098('0x9')][_0x3c2905[_0xa098('0x25')]][_0x3c2905['destuniqueid']]){this['channels'][_0x3c2905[_0xa098('0x25')]][_0x3c2905[_0xa098('0x26')]]['agentringnoanswer']=!![];this[_0xa098('0x9')][_0x3c2905[_0xa098('0x25')]][_0x3c2905[_0xa098('0x26')]]['agentringnoanswerAt']=moment()[_0xa098('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa098('0x9')][_0x3c2905['uniqueid']][_0x3c2905[_0xa098('0x26')]][_0xa098('0x47')]='rejected';this[_0xa098('0x9')][_0x3c2905['uniqueid']][_0x3c2905[_0xa098('0x26')]][_0xa098('0x38')]=_0xa098('0x48');ami['emit'](_0xa098('0x49'),this[_0xa098('0x9')][_0x3c2905[_0xa098('0x25')]][_0x3c2905[_0xa098('0x26')]]);}}}catch(_0xec593a){logger[_0xa098('0x33')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0xa098('0x35')](_0xec593a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa098('0x15')]=function(_0x15d33f){try{if(this[_0xa098('0x24')](_0x15d33f)){if(this[_0xa098('0x9')][_0x15d33f[_0xa098('0x25')]]){for(var _0x1ad613 in this[_0xa098('0x9')][_0x15d33f['uniqueid']]){if(this['channels'][_0x15d33f[_0xa098('0x25')]][_0xa098('0x4a')](_0x1ad613)&&!this['channels'][_0x15d33f['uniqueid']][_0x1ad613][_0xa098('0x12')]&&!this[_0xa098('0x9')][_0x15d33f[_0xa098('0x25')]][_0x1ad613]['agentcomplete']){this[_0xa098('0x9')][_0x15d33f[_0xa098('0x25')]][_0x1ad613]['agentringnoanswer']=!![];this[_0xa098('0x9')][_0x15d33f['uniqueid']][_0x1ad613][_0xa098('0x43')]=moment()[_0xa098('0x37')](_0xa098('0x27'));this['channels'][_0x15d33f[_0xa098('0x25')]][_0x1ad613][_0xa098('0x47')]='abandoned';this[_0xa098('0x9')][_0x15d33f[_0xa098('0x25')]][_0x1ad613][_0xa098('0x38')]='abandoned';ami[_0xa098('0x2e')](_0xa098('0x4b'),this[_0xa098('0x9')][_0x15d33f[_0xa098('0x25')]][_0x1ad613]);}}}}}catch(_0x5b5372){logger[_0xa098('0x33')](_0xa098('0x4c'),util[_0xa098('0x35')](_0x5b5372,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa098('0x22')]['syncAgentComplete']=function(_0x573884){try{if(this['isNotNull'](_0x573884)){if(this[_0xa098('0x9')][_0x573884[_0xa098('0x25')]]){for(var _0x2d6bbe in this[_0xa098('0x9')][_0x573884[_0xa098('0x25')]]){if(this['channels'][_0x573884['uniqueid']][_0xa098('0x4a')](_0x2d6bbe)){if(this[_0xa098('0x9')][_0x573884[_0xa098('0x25')]][_0x2d6bbe][_0xa098('0x36')]&&!this[_0xa098('0x9')][_0x573884['uniqueid']][_0x2d6bbe]['agentcomplete']){this[_0xa098('0x9')][_0x573884['uniqueid']][_0x2d6bbe][_0xa098('0x16')]=!![];this[_0xa098('0x9')][_0x573884[_0xa098('0x25')]][_0x2d6bbe]['agentcompleteAt']=moment()[_0xa098('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa098('0x9')][_0x573884['uniqueid']][_0x2d6bbe][_0xa098('0x38')]=_0xa098('0x4d');this[_0xa098('0x9')][_0x573884[_0xa098('0x25')]][_0x2d6bbe][_0xa098('0x4e')]=_0x573884[_0xa098('0x4e')];this['channels'][_0x573884['uniqueid']][_0x2d6bbe][_0xa098('0x47')]=_0x573884[_0xa098('0x47')]==_0xa098('0x4f')?_0xa098('0x50'):_0x573884[_0xa098('0x47')];if(this[_0xa098('0xa')][_0x573884[_0xa098('0x29')]]&&this[_0xa098('0xa')][_0x573884[_0xa098('0x29')]]['acw']){this[_0xa098('0x9')][_0x573884[_0xa098('0x25')]][_0x2d6bbe][_0xa098('0x51')]=!![];this[_0xa098('0x9')][_0x573884[_0xa098('0x25')]][_0x2d6bbe][_0xa098('0x52')]=this[_0xa098('0xa')][_0x573884[_0xa098('0x29')]][_0xa098('0x53')];}this[_0xa098('0xb')][_0x573884[_0xa098('0x3f')]]=_[_0xa098('0x2d')](this[_0xa098('0xb')][_0x573884[_0xa098('0x3f')]],[_0xa098('0x29'),_0xa098('0x41')]);this[_0xa098('0x2e')](util['format']('user:%s',_0x573884[_0xa098('0x31')]),_0xa098('0x54'),this['channels'][_0x573884[_0xa098('0x25')]][_0x2d6bbe]);ami[_0xa098('0x2e')](_0xa098('0x55'),this[_0xa098('0x9')][_0x573884[_0xa098('0x25')]][_0x2d6bbe]);}}}}}}catch(_0x3eabcd){logger['error'](_0xa098('0x56'),util[_0xa098('0x35')](_0x3eabcd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa098('0x19')]=function(_0xcb022f){try{if(this[_0xa098('0x24')](_0xcb022f)){this[_0xa098('0x57')](_0xcb022f['uniqueid'],_[_0xa098('0x58')](_0xcb022f[_0xa098('0x59')])[0x0],_0xcb022f[_0xa098('0x5a')]);if(this['channels'][_0xcb022f[_0xa098('0x25')]]){for(var _0x616c42 in this['channels'][_0xcb022f[_0xa098('0x25')]]){if(this['channels'][_0xcb022f[_0xa098('0x25')]]['hasOwnProperty'](_0x616c42)){if(_[_0xa098('0x23')](this[_0xa098('0x9')][_0xcb022f[_0xa098('0x25')]][_0x616c42]['variables'])){this['channels'][_0xcb022f['uniqueid']][_0x616c42]['variables']={};}this[_0xa098('0x9')][_0xcb022f[_0xa098('0x25')]][_0x616c42][_0xa098('0xc')]=this[_0xa098('0xc')][_0xcb022f[_0xa098('0x25')]];}}}}}catch(_0x27793c){logger['error'](_0xa098('0x5b'),util[_0xa098('0x35')](_0x27793c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa098('0x22')][_0xa098('0x57')]=function(_0x2388a6,_0x3c4dd4,_0xa038a6){var _0x4da87e=[_0xa098('0x5c'),_0xa098('0x5d'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xa098('0x5e'),_0xa098('0x5f'),_0xa098('0x60'),_0xa098('0x61'),_0xa098('0x62'),_0xa098('0x63'),_0xa098('0x64'),_0xa098('0x65'),_0xa098('0x66'),'memberdynamic',_0xa098('0x67'),'memberlastcall',_0xa098('0x31'),_0xa098('0x68'),'memberrealtime'];if(!_[_0xa098('0x69')](_0x3c4dd4)&&!_[_0xa098('0x6a')](_0x4da87e,_0x3c4dd4)){if(_[_0xa098('0x23')](this[_0xa098('0xc')][_0x2388a6])){this['variables'][_0x2388a6]={};}this['variables'][_0x2388a6][_0x3c4dd4]=_0xa038a6;}};VoiceAgentReport[_0xa098('0x22')][_0xa098('0x1b')]=function(_0x4edc18){try{if(this[_0xa098('0x24')](_0x4edc18)){if(this['channels'][_0x4edc18[_0xa098('0x25')]]){for(var _0x14ec67 in this['channels'][_0x4edc18[_0xa098('0x25')]]){if(this[_0xa098('0x9')][_0x4edc18['uniqueid']]['hasOwnProperty'](_0x14ec67)){if(this[_0xa098('0x9')][_0x4edc18[_0xa098('0x25')]][_0x14ec67][_0xa098('0x47')]==_0xa098('0x4f')&&this['channels'][_0x4edc18['uniqueid']][_0x14ec67][_0xa098('0x16')]){this['channels'][_0x4edc18[_0xa098('0x25')]][_0x14ec67][_0xa098('0x6b')]=moment()[_0xa098('0x37')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0xa098('0x2e')](_0xa098('0x6c'),_[_0xa098('0x6d')](this[_0xa098('0x9')][_0x4edc18[_0xa098('0x25')]]));delete this['channels'][_0x4edc18[_0xa098('0x25')]];}if(this[_0xa098('0xc')][_0x4edc18['uniqueid']]){delete this[_0xa098('0xc')][_0x4edc18[_0xa098('0x25')]];}}}catch(_0xd24fa7){logger[_0xa098('0x33')](_0xa098('0x6e'),util[_0xa098('0x35')](_0xd24fa7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa098('0x22')][_0xa098('0x20')]=function(_0x1bfa46){try{if(this[_0xa098('0x24')](_0x1bfa46)){if(this[_0xa098('0x9')][_0x1bfa46[_0xa098('0x6f')]]){for(var _0x217cb7 in this[_0xa098('0x9')][_0x1bfa46['transfereeuniqueid']]){if(this[_0xa098('0x9')][_0x1bfa46[_0xa098('0x6f')]][_0xa098('0x4a')](_0x217cb7)){if(_0x1bfa46[_0xa098('0x70')]===_0x217cb7){var _0x5a631a=moment();this['channels'][_0x1bfa46[_0xa098('0x6f')]][_0x217cb7]['agentcomplete']=!![];this[_0xa098('0x9')][_0x1bfa46['transfereeuniqueid']][_0x217cb7][_0xa098('0x6b')]=moment()['format'](_0xa098('0x27'));this[_0xa098('0x9')][_0x1bfa46[_0xa098('0x6f')]][_0x217cb7][_0xa098('0x47')]=_0xa098('0x4f');this[_0xa098('0x9')][_0x1bfa46['transfereeuniqueid']][_0x217cb7][_0xa098('0x38')]=_0xa098('0x4d');this[_0xa098('0x9')][_0x1bfa46[_0xa098('0x6f')]][_0x217cb7]['talktime']=_0x5a631a[_0xa098('0x71')](this[_0xa098('0x9')][_0x1bfa46[_0xa098('0x6f')]][_0x217cb7][_0xa098('0x36')],'seconds');}}}}if(this[_0xa098('0x9')][_0x1bfa46[_0xa098('0x72')]]){var _0x36d074=this[_0xa098('0x9')][_0x1bfa46['secondtransfereruniqueid']];this[_0xa098('0x9')][_0x1bfa46[_0xa098('0x72')]]=this[_0xa098('0x9')][_0x1bfa46[_0xa098('0x6f')]];this[_0xa098('0x9')][_0x1bfa46[_0xa098('0x6f')]]=_0x36d074;}}}catch(_0x4bffe2){logger['error'](_0xa098('0x73'),util[_0xa098('0x35')](_0x4bffe2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa098('0x22')]['syncBlindTransfer']=function(_0x32bdec){try{if(this[_0xa098('0x24')](_0x32bdec)){if(this['channels'][_0x32bdec[_0xa098('0x6f')]]){for(var _0x2ed81a in this[_0xa098('0x9')][_0x32bdec[_0xa098('0x6f')]]){if(this['channels'][_0x32bdec[_0xa098('0x6f')]][_0xa098('0x4a')](_0x2ed81a)){if(_0x32bdec[_0xa098('0x74')]===_0x2ed81a){var _0x5ab27c=moment();this[_0xa098('0x9')][_0x32bdec[_0xa098('0x6f')]][_0x2ed81a][_0xa098('0x16')]=!![];this[_0xa098('0x9')][_0x32bdec[_0xa098('0x6f')]][_0x2ed81a][_0xa098('0x6b')]=_0x5ab27c;this[_0xa098('0x9')][_0x32bdec[_0xa098('0x6f')]][_0x2ed81a][_0xa098('0x47')]=_0xa098('0x4f');this['channels'][_0x32bdec[_0xa098('0x6f')]][_0x2ed81a]['lastevent']=_0xa098('0x4d');this[_0xa098('0x9')][_0x32bdec[_0xa098('0x6f')]][_0x2ed81a][_0xa098('0x4e')]=_0x5ab27c['diff'](this[_0xa098('0x9')][_0x32bdec[_0xa098('0x6f')]][_0x2ed81a][_0xa098('0x36')],'seconds');}}}}}}catch(_0x2f76d5){logger['error'](_0xa098('0x75'),util['inspect'](_0x2f76d5,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa098('0x1d')]=function(_0x25fbdf){var _0x59c879='';try{if(this['isNotNull'](_0x25fbdf)){if(_0x25fbdf[_0xa098('0x76')]){_0x59c879=_0x25fbdf[_0xa098('0x76')]['substring'](0x0,_0x25fbdf[_0xa098('0x76')]['lastIndexOf']('-'));if(this[_0xa098('0xb')][_0x59c879]){this['agents'][_0x59c879][_0xa098('0x77')]=!![];}}}}catch(_0x3fe78e){logger[_0xa098('0x33')](_0xa098('0x78'),util[_0xa098('0x35')](_0x3fe78e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa098('0x79')]=function(_0x2399af){var _0x21c9ce='';try{if(this[_0xa098('0x24')](_0x2399af)){if(_0x2399af[_0xa098('0x76')]){_0x21c9ce=_0x2399af['channel'][_0xa098('0x7a')](0x0,_0x2399af[_0xa098('0x76')][_0xa098('0x7b')]('-'));if(this[_0xa098('0xb')][_0x21c9ce]){this[_0xa098('0xb')][_0x21c9ce][_0xa098('0x77')]=![];}}}}catch(_0x66a7fa){logger['error'](_0xa098('0x7c'),util[_0xa098('0x35')](_0x66a7fa,{'showHidden':![],'depth':null}));}};module[_0xa098('0x7d')]=VoiceAgentReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js
index 869a891..7840db6 100644
--- a/server/services/ami/report/voiceCallReport.js
+++ b/server/services/ami/report/voiceCallReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c01=['sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','context','omit','user:agentcomplete','custom:voiceCallReport','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','isNil','mohtime','exports','bluebird','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','not_inuse','inuse','busy','invalid','ringing','ringinuse','set','queue','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','newexten','syncNewExten','syncNewChannel','bind','newstate','syncNewState','varset','hangup','syncHangup','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','resolve','then','log','prototype','isUndefined','emit','isNotNull','uniqueid','linkedid','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','channelstate','from-sip','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','application','toLowerCase','duration','subtract','seconds','includes','lastapplication','lastdata','applicationdata','startsWith','cdr(','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','starttime','calleridnum','xcally-motion-preview','connectedlinename','calleridname','destinationchannel','disposition','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors','rec','syncVarSet','mixmonitor_filename','value','variable','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid'];(function(_0x2c5a3f,_0x5becbf){var _0x47cce4=function(_0x348fef){while(--_0x348fef){_0x2c5a3f['push'](_0x2c5a3f['shift']());}};_0x47cce4(++_0x5becbf);}(_0x4c01,0x13c));var _0x14c0=function(_0x1d8bca,_0x495841){_0x1d8bca=_0x1d8bca-0x0;var _0xce7d2e=_0x4c01[_0x1d8bca];return _0xce7d2e;};'use strict';var BPromise=require(_0x14c0('0x0'));var _=require('lodash');var moment=require(_0x14c0('0x1'));var util=require(_0x14c0('0x2'));var path=require(_0x14c0('0x3'));var Redis=require(_0x14c0('0x4'));var config=require(_0x14c0('0x5'));var logger=require(_0x14c0('0x6'))(_0x14c0('0x7'));var ami=require(_0x14c0('0x8'));var Channel=require('../model/channel');var statusDesc=['unknown',_0x14c0('0x9'),_0x14c0('0xa'),_0x14c0('0xb'),_0x14c0('0xc'),'unavailable',_0x14c0('0xd'),_0x14c0('0xe'),'onhold'];var applications=[_0x14c0('0xf'),_0x14c0('0x10'),'agi',_0x14c0('0x11'),_0x14c0('0x12'),_0x14c0('0x13')];var dispositions=[_0x14c0('0x14'),_0x14c0('0x15'),'FAILED',_0x14c0('0x14'),_0x14c0('0x14'),_0x14c0('0x14'),'ANSWERED',_0x14c0('0x16'),_0x14c0('0x15'),_0x14c0('0x15'),'FAILED'];var actions={};config[_0x14c0('0x17')]=_['defaults'](config[_0x14c0('0x17')],{'host':_0x14c0('0x18'),'port':0x18eb});var io=require(_0x14c0('0x19'))(new Redis(config[_0x14c0('0x17')]));function VoiceCallReport(_0x4e8e50){this[_0x14c0('0x1a')]=_0x4e8e50[_0x14c0('0x1a')];this[_0x14c0('0x1b')]=_0x4e8e50['agents'];ami['on'](_0x14c0('0x1c'),this['syncNewExten']['bind'](this));ami['on'](_0x14c0('0x1d'),this[_0x14c0('0x1e')]['bind'](this));ami['on']('newchannel',this[_0x14c0('0x1f')][_0x14c0('0x20')](this));ami['on'](_0x14c0('0x21'),this[_0x14c0('0x22')][_0x14c0('0x20')](this));ami['on'](_0x14c0('0x23'),this['syncVarSet'][_0x14c0('0x20')](this));ami['on'](_0x14c0('0x24'),this[_0x14c0('0x25')][_0x14c0('0x20')](this));ami['on']('newcallerid',this[_0x14c0('0x26')][_0x14c0('0x20')](this));ami['on']('attendedtransfer',this[_0x14c0('0x27')][_0x14c0('0x20')](this));ami['on'](_0x14c0('0x28'),this[_0x14c0('0x29')][_0x14c0('0x20')](this));ami['on'](_0x14c0('0x2a'),this[_0x14c0('0x2b')]['bind'](this));ami['on'](_0x14c0('0x2c'),this['syncMusicOnHoldStop'][_0x14c0('0x20')](this));return BPromise[_0x14c0('0x2d')]()[_0x14c0('0x2e')](ami['actionCoreShowChannels']())['catch'](function(_0x18f502){console[_0x14c0('0x2f')](_0x18f502);});}VoiceCallReport[_0x14c0('0x30')]['isNotNull']=function(_0x5a4abe){return _0x5a4abe!==null&&!_[_0x14c0('0x31')](_0x5a4abe);};VoiceCallReport['prototype']['emit']=function(_0x843209,_0x1f838f,_0x228d9c){io['to'](_0x843209)[_0x14c0('0x32')](_0x1f838f,_0x228d9c);};VoiceCallReport['prototype'][_0x14c0('0x26')]=function(_0x59e016){try{if(this[_0x14c0('0x33')](_0x59e016)){if(_0x59e016[_0x14c0('0x34')]===_0x59e016[_0x14c0('0x35')]){if(!_[_0x14c0('0x31')](this[_0x14c0('0x1a')][_0x59e016['uniqueid']])){_[_0x14c0('0x36')](this[_0x14c0('0x1a')][_0x59e016[_0x14c0('0x34')]],_[_0x14c0('0x37')](_0x59e016,_[_0x14c0('0x38')](this[_0x14c0('0x1a')][_0x59e016[_0x14c0('0x34')]])));}}}}catch(_0x2f4156){logger[_0x14c0('0x39')](_0x14c0('0x3a'),util[_0x14c0('0x3b')](_0x2f4156,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14c0('0x30')]['syncNewChannel']=function(_0x28e462){try{if(this['isNotNull'](_0x28e462)){if(_0x28e462[_0x14c0('0x34')]===_0x28e462[_0x14c0('0x35')]&&_0x28e462[_0x14c0('0x3c')]!=_0x14c0('0x3d')){if(_[_0x14c0('0x31')](this[_0x14c0('0x1a')][_0x28e462[_0x14c0('0x34')]])){this[_0x14c0('0x1a')][_0x28e462[_0x14c0('0x34')]]=new Channel();this[_0x14c0('0x1a')][_0x28e462[_0x14c0('0x34')]]['starttime']=moment()[_0x14c0('0x3e')](_0x14c0('0x3f'));this[_0x14c0('0x1a')][_0x28e462[_0x14c0('0x34')]]['disposition']=dispositions[_['toNumber'](_0x28e462[_0x14c0('0x40')])];_['merge'](this['channels'][_0x28e462['uniqueid']],_[_0x14c0('0x37')](_0x28e462,_[_0x14c0('0x38')](this[_0x14c0('0x1a')][_0x28e462['uniqueid']])));if(_0x28e462['context']===_0x14c0('0x41')){if(this[_0x14c0('0x1b')][_0x28e462[_0x14c0('0x3c')]['split']('-')[0x0]]){this['agents'][_0x28e462[_0x14c0('0x3c')][_0x14c0('0x42')]('-')[0x0]][_0x14c0('0x43')]=_0x28e462[_0x14c0('0x44')];this[_0x14c0('0x32')](util[_0x14c0('0x3e')](_0x14c0('0x45'),this[_0x14c0('0x1b')][_0x28e462[_0x14c0('0x3c')][_0x14c0('0x42')]('-')[0x0]][_0x14c0('0x46')]),_0x14c0('0x47'),{'destaccountcode':this[_0x14c0('0x1b')][_0x28e462[_0x14c0('0x3c')][_0x14c0('0x42')]('-')[0x0]][_0x14c0('0x48')],'destconnectedlinenum':_0x28e462[_0x14c0('0x44')]});}}}}}}catch(_0x523311){logger['error']('[syncNewChannel][VoiceCallReport]',util[_0x14c0('0x3b')](_0x523311,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x31edab){try{if(this[_0x14c0('0x33')](_0x31edab)){if(_0x31edab[_0x14c0('0x34')]===_0x31edab[_0x14c0('0x35')]&&_0x31edab[_0x14c0('0x44')]!='h'&&_0x31edab[_0x14c0('0x3c')]!=_0x14c0('0x3d')){_0x31edab[_0x14c0('0x49')]=_0x31edab[_0x14c0('0x49')][_0x14c0('0x4a')]();_0x31edab['applicationdata']=(_0x31edab['appdata']||_0x31edab['applicationdata'])[_0x14c0('0x4a')]();if(_[_0x14c0('0x31')](this[_0x14c0('0x1a')][_0x31edab[_0x14c0('0x34')]])){this[_0x14c0('0x1a')][_0x31edab[_0x14c0('0x34')]]=new Channel();this['channels'][_0x31edab['uniqueid']]['starttime']=_0x31edab[_0x14c0('0x4b')]?moment()[_0x14c0('0x4c')](moment[_0x14c0('0x4b')](_0x31edab[_0x14c0('0x4b')])[_0x14c0('0x4d')](),'seconds')[_0x14c0('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x14c0('0x3e')](_0x14c0('0x3f'));this['channels'][_0x31edab[_0x14c0('0x34')]]['disposition']=_0x14c0('0x14');}_[_0x14c0('0x36')](this[_0x14c0('0x1a')][_0x31edab['uniqueid']],_['pick'](_0x31edab,_[_0x14c0('0x38')](this[_0x14c0('0x1a')][_0x31edab[_0x14c0('0x34')]])));if(_[_0x14c0('0x4e')](applications,_0x31edab[_0x14c0('0x49')])){this['channels'][_0x31edab[_0x14c0('0x34')]][_0x14c0('0x4f')]=_0x31edab[_0x14c0('0x49')];this[_0x14c0('0x1a')][_0x31edab[_0x14c0('0x34')]][_0x14c0('0x50')]=_0x31edab[_0x14c0('0x51')];if(_0x31edab[_0x14c0('0x49')]===_0x14c0('0xf')&&_[_0x14c0('0x52')](_0x31edab['applicationdata'],_0x14c0('0x53'))){var _0x5330f2=_0x31edab[_0x14c0('0x51')][_0x14c0('0x42')]('=');var _0x2bce64=_0x5330f2[0x0]['match'](/cdr\((.*)\)/);if(_0x2bce64){this[_0x14c0('0x1a')][_0x31edab['uniqueid']][_0x2bce64[0x1]]=_0x5330f2[0x1];}}else if(_0x31edab[_0x14c0('0x49')]===_0x14c0('0x10')){this[_0x14c0('0x1a')][_0x31edab[_0x14c0('0x34')]][_0x14c0('0x10')]=_0x31edab[_0x14c0('0x51')][_0x14c0('0x42')](',')[0x0];}}}}}catch(_0xe8768d){logger['error'](_0x14c0('0x54'),util['inspect'](_0xe8768d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14c0('0x30')][_0x14c0('0x22')]=function(_0xd99bf6){try{if(this[_0x14c0('0x33')](_0xd99bf6)){if(_0xd99bf6[_0x14c0('0x34')]!==_0xd99bf6[_0x14c0('0x35')]){if(this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]]){if(_0xd99bf6[_0x14c0('0x40')]==='6'){if(!this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x55')]){var _0x42de82=moment();this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x55')]=!![];this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x56')]=_0x42de82[_0x14c0('0x3e')](_0x14c0('0x3f'));if(this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]]['starttime']){this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x57')]=_0x42de82[_0x14c0('0x58')](this['channels'][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x59')],_0x14c0('0x4d'));}}this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x35')]=_0xd99bf6['uniqueid'];if(_0xd99bf6[_0x14c0('0x5a')]!==_0x14c0('0x5b')){this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]]['connectedlinenum']=_0xd99bf6['calleridnum'];}this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x5c')]=_0xd99bf6[_0x14c0('0x5d')];this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x5e')]=_0xd99bf6[_0x14c0('0x3c')];this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x5f')]=dispositions[_['toNumber'](_0xd99bf6[_0x14c0('0x40')])];if(this[_0x14c0('0x1b')][_0xd99bf6[_0x14c0('0x3c')][_0x14c0('0x42')]('-')[0x0]]){this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x60')]=this['agents'][_0xd99bf6['channel'][_0x14c0('0x42')]('-')[0x0]]['id'];this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x35')]][_0x14c0('0x61')]=this[_0x14c0('0x1b')][_0xd99bf6[_0x14c0('0x3c')][_0x14c0('0x42')]('-')[0x0]][_0x14c0('0x46')];}}}}else{if(this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x34')]]){if(_0xd99bf6['channelstate']==='6'){if(this['agents'][_0xd99bf6[_0x14c0('0x3c')][_0x14c0('0x42')]('-')[0x0]]){this[_0x14c0('0x1a')][_0xd99bf6[_0x14c0('0x34')]][_0x14c0('0x60')]=this['agents'][_0xd99bf6['channel'][_0x14c0('0x42')]('-')[0x0]]['id'];this[_0x14c0('0x1a')][_0xd99bf6['uniqueid']][_0x14c0('0x61')]=this[_0x14c0('0x1b')][_0xd99bf6[_0x14c0('0x3c')][_0x14c0('0x42')]('-')[0x0]][_0x14c0('0x46')];}}}}}}catch(_0xf990af){logger[_0x14c0('0x39')](_0x14c0('0x62'),util[_0x14c0('0x3b')](_0xf990af,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14c0('0x30')][_0x14c0('0x63')]=function(_0x5c83c,_0x115392){if(this['channels'][_0x5c83c]){this[_0x14c0('0x1a')][_0x5c83c][_0x14c0('0x64')]=!![];if(_[_0x14c0('0x65')](_0x115392,'.wav49')){_0x115392=_0x115392[_0x14c0('0x66')](_0x14c0('0x67'),_0x14c0('0x68'));}this[_0x14c0('0x1a')][_0x5c83c][_0x14c0('0x69')]=_0x115392;var _0x150c6b=_[_0x14c0('0x6a')](this[_0x14c0('0x1a')][_0x5c83c]['monitors'],{'filename':_0x115392});if(_['isNil'](_0x150c6b)){this[_0x14c0('0x1a')][_0x5c83c][_0x14c0('0x6b')]['push']({'filename':_0x115392,'createdAt':moment()[_0x14c0('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x14c0('0x6c')});}}};VoiceCallReport[_0x14c0('0x30')][_0x14c0('0x6d')]=function(_0x55ebef){try{if(this[_0x14c0('0x33')](_0x55ebef)){if(this[_0x14c0('0x1a')][_0x55ebef[_0x14c0('0x34')]]&&_0x55ebef[_0x14c0('0x3c')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x55ebef['variable'])){if(this[_0x14c0('0x33')](_0x55ebef['variable'][_0x14c0('0x6e')])){this[_0x14c0('0x63')](_0x55ebef[_0x14c0('0x34')],_0x55ebef[_0x14c0('0x6f')]);}else if(this['isNotNull'](_0x55ebef[_0x14c0('0x70')]['xmd-phone'])){this[_0x14c0('0x1a')][_0x55ebef[_0x14c0('0x34')]][_0x14c0('0x5a')]=_0x55ebef[_0x14c0('0x6f')];}else if(this[_0x14c0('0x33')](_0x55ebef[_0x14c0('0x70')]['xmd-callerid'])){this[_0x14c0('0x1a')][_0x55ebef[_0x14c0('0x34')]][_0x14c0('0x71')]=_0x55ebef[_0x14c0('0x6f')];}else if(this[_0x14c0('0x33')](_0x55ebef['variable'][_0x14c0('0x72')])){this[_0x14c0('0x1a')][_0x55ebef[_0x14c0('0x34')]][_0x14c0('0x73')]=_0x55ebef[_0x14c0('0x6f')];}else if(this['isNotNull'](_0x55ebef['variable'][_0x14c0('0x74')])){this[_0x14c0('0x1a')][_0x55ebef[_0x14c0('0x34')]][_0x14c0('0x10')]=_0x55ebef[_0x14c0('0x6f')][_0x14c0('0x42')](',')[0x0];}else if(this[_0x14c0('0x33')](_0x55ebef[_0x14c0('0x70')][_0x14c0('0x75')])){this['channels'][_0x55ebef[_0x14c0('0x34')]][_0x14c0('0x76')]=_0x55ebef[_0x14c0('0x6f')];}else if(this[_0x14c0('0x33')](_0x55ebef[_0x14c0('0x70')]['xmd-destination'])){this[_0x14c0('0x1a')][_0x55ebef[_0x14c0('0x34')]][_0x14c0('0x77')]=_0x55ebef[_0x14c0('0x6f')];}else if(this[_0x14c0('0x33')](_0x55ebef[_0x14c0('0x70')][_0x14c0('0x78')])){this[_0x14c0('0x1a')][_0x55ebef[_0x14c0('0x34')]][_0x14c0('0x79')]=_0x55ebef['value'];}else if(this[_0x14c0('0x33')](_0x55ebef[_0x14c0('0x70')][_0x14c0('0x7a')])){this[_0x14c0('0x1a')][_0x55ebef[_0x14c0('0x34')]]['queue']=_0x55ebef['value'];}else if(this[_0x14c0('0x33')](_0x55ebef[_0x14c0('0x70')][_0x14c0('0x7b')])){this['channels'][_0x55ebef[_0x14c0('0x34')]][_0x14c0('0x7c')]=_0x55ebef[_0x14c0('0x6f')];}}}else if(this[_0x14c0('0x33')](_0x55ebef['variable'][_0x14c0('0x6e')])){if(_0x55ebef[_0x14c0('0x6f')]){var _0xe3fabb=path['parse'](_0x55ebef['value'])[_0x14c0('0x46')];this['syncMixMonitorFilename'](_0xe3fabb,_0x55ebef[_0x14c0('0x6f')]);}}else if(this['channels'][_0x55ebef[_0x14c0('0x35')]]){if(this[_0x14c0('0x33')](_0x55ebef[_0x14c0('0x70')])){if(this['isNotNull'](_0x55ebef[_0x14c0('0x70')][_0x14c0('0x7b')])){this[_0x14c0('0x1a')][_0x55ebef[_0x14c0('0x35')]][_0x14c0('0x7d')]=_0x55ebef[_0x14c0('0x6f')];}}}}}catch(_0x28114a){logger[_0x14c0('0x39')](_0x14c0('0x7e'),util[_0x14c0('0x3b')](_0x28114a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x14c0('0x25')]=function(_0x1edbcb){try{if(this[_0x14c0('0x33')](_0x1edbcb)){if(this['channels'][_0x1edbcb[_0x14c0('0x34')]]){var _0x3a9b02=moment();this[_0x14c0('0x1a')][_0x1edbcb[_0x14c0('0x34')]][_0x14c0('0x7f')]=_0x3a9b02[_0x14c0('0x3e')](_0x14c0('0x3f'));this[_0x14c0('0x1a')][_0x1edbcb[_0x14c0('0x34')]][_0x14c0('0x4b')]=_0x3a9b02[_0x14c0('0x58')](this['channels'][_0x1edbcb[_0x14c0('0x34')]][_0x14c0('0x59')],_0x14c0('0x4d'));if(this[_0x14c0('0x1a')][_0x1edbcb[_0x14c0('0x34')]][_0x14c0('0x55')]){this[_0x14c0('0x1a')][_0x1edbcb[_0x14c0('0x34')]][_0x14c0('0x80')]=_0x3a9b02[_0x14c0('0x58')](this[_0x14c0('0x1a')][_0x1edbcb[_0x14c0('0x34')]][_0x14c0('0x56')],_0x14c0('0x4d'));this[_0x14c0('0x1a')][_0x1edbcb[_0x14c0('0x34')]][_0x14c0('0x57')]=this[_0x14c0('0x1a')][_0x1edbcb[_0x14c0('0x34')]]['duration']-this[_0x14c0('0x1a')][_0x1edbcb['uniqueid']][_0x14c0('0x80')];}if(_0x1edbcb[_0x14c0('0x81')]==='from-sip'){if(this[_0x14c0('0x1b')][_0x1edbcb[_0x14c0('0x3c')]['split']('-')[0x0]]){this[_0x14c0('0x1b')][_0x1edbcb[_0x14c0('0x3c')][_0x14c0('0x42')]('-')[0x0]]=_[_0x14c0('0x82')](this['agents'][_0x1edbcb['channel'][_0x14c0('0x42')]('-')[0x0]],[_0x14c0('0x43')]);this[_0x14c0('0x32')](util['format'](_0x14c0('0x45'),this['agents'][_0x1edbcb['channel'][_0x14c0('0x42')]('-')[0x0]]['name']),_0x14c0('0x83'),{'destaccountcode':this['agents'][_0x1edbcb['channel'][_0x14c0('0x42')]('-')[0x0]]['accountcode']});}}ami['emit'](_0x14c0('0x84'),this['channels'][_0x1edbcb[_0x14c0('0x34')]]);delete this[_0x14c0('0x1a')][_0x1edbcb[_0x14c0('0x34')]];}}}catch(_0x21b860){logger[_0x14c0('0x39')]('[syncHangup][VoiceCallReport]',util[_0x14c0('0x3b')](_0x21b860,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14c0('0x30')][_0x14c0('0x27')]=function(_0x11a528){try{if(this['isNotNull'](_0x11a528)){if(this['channels'][_0x11a528[_0x14c0('0x85')]]){this[_0x14c0('0x1a')][_0x11a528['transfereeuniqueid']][_0x14c0('0x86')]=_0x11a528[_0x14c0('0x87')];this[_0x14c0('0x1a')][_0x11a528[_0x14c0('0x85')]][_0x14c0('0x88')]=_0x11a528[_0x14c0('0x89')];if(this[_0x14c0('0x1a')][_0x11a528[_0x14c0('0x8a')]]){var _0x33f8eb=this[_0x14c0('0x1a')][_0x11a528[_0x14c0('0x8a')]];this[_0x14c0('0x1a')][_0x11a528[_0x14c0('0x8a')]]=this[_0x14c0('0x1a')][_0x11a528['transfereeuniqueid']];this['channels'][_0x11a528[_0x14c0('0x85')]]=_0x33f8eb;}}else if(this[_0x14c0('0x1a')][_0x11a528['transfertargetuniqueid']]){this[_0x14c0('0x1a')][_0x11a528[_0x14c0('0x8b')]][_0x14c0('0x86')]=_0x11a528[_0x14c0('0x87')];this['channels'][_0x11a528[_0x14c0('0x8b')]]['transferconnectedlinenum']=_0x11a528['transfertargetcalleridnum'];if(this['channels'][_0x11a528[_0x14c0('0x8c')]]){var _0x33f8eb=this[_0x14c0('0x1a')][_0x11a528[_0x14c0('0x8c')]];this['channels'][_0x11a528[_0x14c0('0x8c')]]=this[_0x14c0('0x1a')][_0x11a528[_0x14c0('0x8b')]];this['channels'][_0x11a528[_0x14c0('0x8b')]]=_0x33f8eb;}}}}catch(_0x34390d){logger[_0x14c0('0x39')]('[syncAttendedTransfer][VoiceCallReport]',util['inspect'](_0x34390d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14c0('0x30')][_0x14c0('0x29')]=function(_0x598d71){try{if(this['isNotNull'](_0x598d71)){if(this[_0x14c0('0x1a')][_0x598d71[_0x14c0('0x85')]]){this[_0x14c0('0x1a')][_0x598d71[_0x14c0('0x85')]]['transfercalleridnum']=_0x598d71['transfereecalleridnum'];this[_0x14c0('0x1a')][_0x598d71[_0x14c0('0x85')]][_0x14c0('0x88')]=_0x598d71['extension'];this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x598d71['transfereeuniqueid'],'context':_0x598d71['context'],'channel':_0x598d71['transfererchannel']});}}}catch(_0xc5d6e){logger[_0x14c0('0x39')]('[syncBlindTransfer][VoiceCallReport]',util[_0x14c0('0x3b')](_0xc5d6e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x14c0('0x30')][_0x14c0('0x2b')]=function(_0x4ba0f9){try{if(this[_0x14c0('0x33')](_0x4ba0f9)){if(this['channels'][_0x4ba0f9[_0x14c0('0x34')]]){if(!_['isNil'](this[_0x14c0('0x1a')][_0x4ba0f9[_0x14c0('0x34')]][_0x14c0('0x56')])){this['channels'][_0x4ba0f9['uniqueid']][_0x14c0('0x8d')]=moment()[_0x14c0('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x368ff8){logger[_0x14c0('0x39')](_0x14c0('0x8e'),util[_0x14c0('0x3b')](_0x368ff8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x14c0('0x8f')]=function(_0x24edd4){try{if(this[_0x14c0('0x33')](_0x24edd4)){if(this['channels'][_0x24edd4[_0x14c0('0x34')]]){if(!_[_0x14c0('0x90')](this[_0x14c0('0x1a')][_0x24edd4[_0x14c0('0x34')]][_0x14c0('0x8d')])){this[_0x14c0('0x1a')][_0x24edd4[_0x14c0('0x34')]][_0x14c0('0x91')]+=moment()['milliseconds'](0x0)['diff'](this[_0x14c0('0x1a')][_0x24edd4[_0x14c0('0x34')]]['mohstarttime'],'seconds');delete this['channels'][_0x24edd4[_0x14c0('0x34')]][_0x14c0('0x8d')];}}}}catch(_0x5e5ba7){logger['error']('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x5e5ba7,{'showHidden':![],'depth':null}));}};module[_0x14c0('0x92')]=VoiceCallReport;
\ No newline at end of file
+var _0x1c22=['syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','attendedtransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','resolve','then','actionCoreShowChannels','catch','prototype','isNotNull','isUndefined','emit','syncNewCallerId','uniqueid','linkedid','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','duration','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','queue','[syncNewExten][VoiceCallReport]','answered','diff','xcally-motion-preview','connectedlinenum','calleridnum','connectedlinename','calleridname','destinationchannel','UserId','membername','syncMixMonitorFilename','monitor','endsWith','replace','.wav49','monitorFilename','find','monitors','push','mixmonitor_filename','value','variable','xmd-callerid','type','xmd-queue','originatecalleridnum','xmd-callerid-preview','calleridpreview','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','billableseconds','answertime','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','util','path','ioredis','ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','socket.io-emitter','channels','agents','syncNewExten','bind','newexten','newchannel'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0x1c22,0x197));var _0x21c2=function(_0x147027,_0x14d5b8){_0x147027=_0x147027-0x0;var _0x55dc27=_0x1c22[_0x147027];return _0x55dc27;};'use strict';var BPromise=require('bluebird');var _=require(_0x21c2('0x0'));var moment=require('moment');var util=require(_0x21c2('0x1'));var path=require(_0x21c2('0x2'));var Redis=require(_0x21c2('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x21c2('0x4'));var ami=require('../ami');var Channel=require(_0x21c2('0x5'));var statusDesc=[_0x21c2('0x6'),_0x21c2('0x7'),_0x21c2('0x8'),_0x21c2('0x9'),_0x21c2('0xa'),_0x21c2('0xb'),_0x21c2('0xc'),_0x21c2('0xd'),_0x21c2('0xe')];var applications=[_0x21c2('0xf'),'queue',_0x21c2('0x10'),_0x21c2('0x11'),_0x21c2('0x12'),_0x21c2('0x13')];var dispositions=[_0x21c2('0x14'),_0x21c2('0x15'),'FAILED','NO\x20ANSWER',_0x21c2('0x14'),_0x21c2('0x14'),_0x21c2('0x16'),'BUSY',_0x21c2('0x15'),_0x21c2('0x15'),_0x21c2('0x15')];var actions={};config[_0x21c2('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x21c2('0x18'))(new Redis(config[_0x21c2('0x17')]));function VoiceCallReport(_0x338311){this[_0x21c2('0x19')]=_0x338311[_0x21c2('0x19')];this['agents']=_0x338311[_0x21c2('0x1a')];ami['on']('coreshowchannel',this[_0x21c2('0x1b')][_0x21c2('0x1c')](this));ami['on'](_0x21c2('0x1d'),this[_0x21c2('0x1b')][_0x21c2('0x1c')](this));ami['on'](_0x21c2('0x1e'),this[_0x21c2('0x1f')][_0x21c2('0x1c')](this));ami['on'](_0x21c2('0x20'),this[_0x21c2('0x21')]['bind'](this));ami['on'](_0x21c2('0x22'),this[_0x21c2('0x23')][_0x21c2('0x1c')](this));ami['on']('hangup',this[_0x21c2('0x24')][_0x21c2('0x1c')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x21c2('0x1c')](this));ami['on'](_0x21c2('0x25'),this['syncAttendedTransfer'][_0x21c2('0x1c')](this));ami['on'](_0x21c2('0x26'),this['syncBlindTransfer'][_0x21c2('0x1c')](this));ami['on'](_0x21c2('0x27'),this[_0x21c2('0x28')][_0x21c2('0x1c')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop']['bind'](this));return BPromise[_0x21c2('0x29')]()[_0x21c2('0x2a')](ami[_0x21c2('0x2b')]())[_0x21c2('0x2c')](function(_0x2319eb){console['log'](_0x2319eb);});}VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x2e')]=function(_0x4d7365){return _0x4d7365!==null&&!_[_0x21c2('0x2f')](_0x4d7365);};VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x30')]=function(_0x4f1f31,_0x4ae470,_0x3468e3){io['to'](_0x4f1f31)[_0x21c2('0x30')](_0x4ae470,_0x3468e3);};VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x31')]=function(_0xdaa501){try{if(this['isNotNull'](_0xdaa501)){if(_0xdaa501[_0x21c2('0x32')]===_0xdaa501[_0x21c2('0x33')]){if(!_[_0x21c2('0x2f')](this[_0x21c2('0x19')][_0xdaa501[_0x21c2('0x32')]])){_[_0x21c2('0x34')](this[_0x21c2('0x19')][_0xdaa501[_0x21c2('0x32')]],_[_0x21c2('0x35')](_0xdaa501,_[_0x21c2('0x36')](this['channels'][_0xdaa501[_0x21c2('0x32')]])));}}}}catch(_0x289a42){logger[_0x21c2('0x37')](_0x21c2('0x38'),util[_0x21c2('0x39')](_0x289a42,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x21c2('0x1f')]=function(_0x724c50){try{if(this[_0x21c2('0x2e')](_0x724c50)){if(_0x724c50['uniqueid']===_0x724c50[_0x21c2('0x33')]&&_0x724c50[_0x21c2('0x3a')]!=_0x21c2('0x3b')){if(_['isUndefined'](this[_0x21c2('0x19')][_0x724c50[_0x21c2('0x32')]])){this['channels'][_0x724c50[_0x21c2('0x32')]]=new Channel();this['channels'][_0x724c50[_0x21c2('0x32')]][_0x21c2('0x3c')]=moment()[_0x21c2('0x3d')](_0x21c2('0x3e'));this['channels'][_0x724c50['uniqueid']][_0x21c2('0x3f')]=dispositions[_[_0x21c2('0x40')](_0x724c50[_0x21c2('0x41')])];_[_0x21c2('0x34')](this[_0x21c2('0x19')][_0x724c50[_0x21c2('0x32')]],_[_0x21c2('0x35')](_0x724c50,_['keys'](this[_0x21c2('0x19')][_0x724c50[_0x21c2('0x32')]])));if(_0x724c50[_0x21c2('0x42')]===_0x21c2('0x43')){if(this[_0x21c2('0x1a')][_0x724c50[_0x21c2('0x3a')][_0x21c2('0x44')]('-')[0x0]]){this['agents'][_0x724c50[_0x21c2('0x3a')][_0x21c2('0x44')]('-')[0x0]][_0x21c2('0x45')]=_0x724c50[_0x21c2('0x46')];this[_0x21c2('0x30')](util[_0x21c2('0x3d')](_0x21c2('0x47'),this[_0x21c2('0x1a')][_0x724c50[_0x21c2('0x3a')]['split']('-')[0x0]][_0x21c2('0x48')]),_0x21c2('0x49'),{'destaccountcode':this[_0x21c2('0x1a')][_0x724c50['channel'][_0x21c2('0x44')]('-')[0x0]][_0x21c2('0x4a')],'destconnectedlinenum':_0x724c50[_0x21c2('0x46')]});}}}}}}catch(_0x403116){logger[_0x21c2('0x37')](_0x21c2('0x4b'),util[_0x21c2('0x39')](_0x403116,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x1b')]=function(_0x88ccbf){try{if(this[_0x21c2('0x2e')](_0x88ccbf)){if(_0x88ccbf[_0x21c2('0x32')]===_0x88ccbf['linkedid']&&_0x88ccbf[_0x21c2('0x46')]!='h'&&_0x88ccbf['channel']!='OutgoingSpoolFailed'){_0x88ccbf[_0x21c2('0x4c')]=_0x88ccbf[_0x21c2('0x4c')][_0x21c2('0x4d')]();_0x88ccbf['applicationdata']=(_0x88ccbf['appdata']||_0x88ccbf[_0x21c2('0x4e')])[_0x21c2('0x4d')]();if(_[_0x21c2('0x2f')](this[_0x21c2('0x19')][_0x88ccbf[_0x21c2('0x32')]])){this[_0x21c2('0x19')][_0x88ccbf[_0x21c2('0x32')]]=new Channel();this[_0x21c2('0x19')][_0x88ccbf['uniqueid']][_0x21c2('0x3c')]=_0x88ccbf[_0x21c2('0x4f')]?moment()['subtract'](moment[_0x21c2('0x4f')](_0x88ccbf[_0x21c2('0x4f')])[_0x21c2('0x50')](),_0x21c2('0x50'))[_0x21c2('0x3d')](_0x21c2('0x3e')):moment()['format'](_0x21c2('0x3e'));this[_0x21c2('0x19')][_0x88ccbf[_0x21c2('0x32')]][_0x21c2('0x3f')]=_0x21c2('0x14');}_[_0x21c2('0x34')](this[_0x21c2('0x19')][_0x88ccbf[_0x21c2('0x32')]],_['pick'](_0x88ccbf,_[_0x21c2('0x36')](this[_0x21c2('0x19')][_0x88ccbf[_0x21c2('0x32')]])));if(_[_0x21c2('0x51')](applications,_0x88ccbf[_0x21c2('0x4c')])){this[_0x21c2('0x19')][_0x88ccbf[_0x21c2('0x32')]][_0x21c2('0x52')]=_0x88ccbf[_0x21c2('0x4c')];this[_0x21c2('0x19')][_0x88ccbf[_0x21c2('0x32')]][_0x21c2('0x53')]=_0x88ccbf['applicationdata'];if(_0x88ccbf[_0x21c2('0x4c')]===_0x21c2('0xf')&&_[_0x21c2('0x54')](_0x88ccbf['applicationdata'],_0x21c2('0x55'))){var _0x32122a=_0x88ccbf[_0x21c2('0x4e')][_0x21c2('0x44')]('=');var _0x1ddde6=_0x32122a[0x0][_0x21c2('0x56')](/cdr\((.*)\)/);if(_0x1ddde6){this['channels'][_0x88ccbf[_0x21c2('0x32')]][_0x1ddde6[0x1]]=_0x32122a[0x1];}}else if(_0x88ccbf[_0x21c2('0x4c')]==='queue'){this[_0x21c2('0x19')][_0x88ccbf[_0x21c2('0x32')]][_0x21c2('0x57')]=_0x88ccbf[_0x21c2('0x4e')][_0x21c2('0x44')](',')[0x0];}}}}}catch(_0x489089){logger[_0x21c2('0x37')](_0x21c2('0x58'),util[_0x21c2('0x39')](_0x489089,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x21')]=function(_0xab344c){try{if(this[_0x21c2('0x2e')](_0xab344c)){if(_0xab344c[_0x21c2('0x32')]!==_0xab344c[_0x21c2('0x33')]){if(this[_0x21c2('0x19')][_0xab344c[_0x21c2('0x33')]]){if(_0xab344c['channelstate']==='6'){if(!this[_0x21c2('0x19')][_0xab344c[_0x21c2('0x33')]][_0x21c2('0x59')]){var _0x540fb8=moment();this[_0x21c2('0x19')][_0xab344c['linkedid']]['answered']=!![];this[_0x21c2('0x19')][_0xab344c[_0x21c2('0x33')]]['answertime']=_0x540fb8[_0x21c2('0x3d')](_0x21c2('0x3e'));if(this[_0x21c2('0x19')][_0xab344c['linkedid']][_0x21c2('0x3c')]){this['channels'][_0xab344c[_0x21c2('0x33')]]['holdtime']=_0x540fb8[_0x21c2('0x5a')](this['channels'][_0xab344c[_0x21c2('0x33')]][_0x21c2('0x3c')],'seconds');}}this[_0x21c2('0x19')][_0xab344c[_0x21c2('0x33')]]['linkedid']=_0xab344c['uniqueid'];if(_0xab344c['calleridnum']!==_0x21c2('0x5b')){this['channels'][_0xab344c[_0x21c2('0x33')]][_0x21c2('0x5c')]=_0xab344c[_0x21c2('0x5d')];}this[_0x21c2('0x19')][_0xab344c[_0x21c2('0x33')]][_0x21c2('0x5e')]=_0xab344c[_0x21c2('0x5f')];this[_0x21c2('0x19')][_0xab344c[_0x21c2('0x33')]][_0x21c2('0x60')]=_0xab344c[_0x21c2('0x3a')];this['channels'][_0xab344c[_0x21c2('0x33')]][_0x21c2('0x3f')]=dispositions[_['toNumber'](_0xab344c['channelstate'])];if(this['agents'][_0xab344c[_0x21c2('0x3a')]['split']('-')[0x0]]){this[_0x21c2('0x19')][_0xab344c['linkedid']][_0x21c2('0x61')]=this['agents'][_0xab344c[_0x21c2('0x3a')][_0x21c2('0x44')]('-')[0x0]]['id'];this[_0x21c2('0x19')][_0xab344c[_0x21c2('0x33')]][_0x21c2('0x62')]=this['agents'][_0xab344c[_0x21c2('0x3a')][_0x21c2('0x44')]('-')[0x0]][_0x21c2('0x48')];}}}}else{if(this[_0x21c2('0x19')][_0xab344c['uniqueid']]){if(_0xab344c[_0x21c2('0x41')]==='6'){if(this['agents'][_0xab344c[_0x21c2('0x3a')][_0x21c2('0x44')]('-')[0x0]]){this['channels'][_0xab344c['uniqueid']][_0x21c2('0x61')]=this['agents'][_0xab344c[_0x21c2('0x3a')]['split']('-')[0x0]]['id'];this[_0x21c2('0x19')][_0xab344c[_0x21c2('0x32')]][_0x21c2('0x62')]=this[_0x21c2('0x1a')][_0xab344c[_0x21c2('0x3a')][_0x21c2('0x44')]('-')[0x0]][_0x21c2('0x48')];}}}}}}catch(_0x1f19e8){logger[_0x21c2('0x37')]('[syncNewState][VoiceCallReport]',util[_0x21c2('0x39')](_0x1f19e8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x63')]=function(_0xe52b04,_0x25851f){if(this[_0x21c2('0x19')][_0xe52b04]){this[_0x21c2('0x19')][_0xe52b04][_0x21c2('0x64')]=!![];if(_[_0x21c2('0x65')](_0x25851f,'.wav49')){_0x25851f=_0x25851f[_0x21c2('0x66')](_0x21c2('0x67'),'.WAV');}this['channels'][_0xe52b04][_0x21c2('0x68')]=_0x25851f;var _0x3a4d48=_[_0x21c2('0x69')](this[_0x21c2('0x19')][_0xe52b04][_0x21c2('0x6a')],{'filename':_0x25851f});if(_['isNil'](_0x3a4d48)){this['channels'][_0xe52b04][_0x21c2('0x6a')][_0x21c2('0x6b')]({'filename':_0x25851f,'createdAt':moment()[_0x21c2('0x3d')](_0x21c2('0x3e')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport['prototype'][_0x21c2('0x23')]=function(_0x53c20d){try{if(this[_0x21c2('0x2e')](_0x53c20d)){if(this[_0x21c2('0x19')][_0x53c20d[_0x21c2('0x32')]]&&_0x53c20d['channel']!=_0x21c2('0x3b')){if(this['isNotNull'](_0x53c20d['variable'])){if(this[_0x21c2('0x2e')](_0x53c20d['variable'][_0x21c2('0x6c')])){this[_0x21c2('0x63')](_0x53c20d[_0x21c2('0x32')],_0x53c20d[_0x21c2('0x6d')]);}else if(this['isNotNull'](_0x53c20d[_0x21c2('0x6e')]['xmd-phone'])){this['channels'][_0x53c20d[_0x21c2('0x32')]][_0x21c2('0x5d')]=_0x53c20d[_0x21c2('0x6d')];}else if(this['isNotNull'](_0x53c20d['variable'][_0x21c2('0x6f')])){this[_0x21c2('0x19')][_0x53c20d['uniqueid']]['callerid']=_0x53c20d[_0x21c2('0x6d')];}else if(this[_0x21c2('0x2e')](_0x53c20d[_0x21c2('0x6e')]['xmd-cdrtype'])){this[_0x21c2('0x19')][_0x53c20d['uniqueid']][_0x21c2('0x70')]=_0x53c20d['value'];}else if(this['isNotNull'](_0x53c20d[_0x21c2('0x6e')][_0x21c2('0x71')])){this['channels'][_0x53c20d[_0x21c2('0x32')]][_0x21c2('0x57')]=_0x53c20d[_0x21c2('0x6d')][_0x21c2('0x44')](',')[0x0];}else if(this[_0x21c2('0x2e')](_0x53c20d[_0x21c2('0x6e')]['xmd-originatecalleridnum'])){this[_0x21c2('0x19')][_0x53c20d[_0x21c2('0x32')]][_0x21c2('0x72')]=_0x53c20d[_0x21c2('0x6d')];}else if(this[_0x21c2('0x2e')](_0x53c20d[_0x21c2('0x6e')]['xmd-destination'])){this[_0x21c2('0x19')][_0x53c20d[_0x21c2('0x32')]]['destination']=_0x53c20d[_0x21c2('0x6d')];}else if(this[_0x21c2('0x2e')](_0x53c20d['variable'][_0x21c2('0x73')])){this[_0x21c2('0x19')][_0x53c20d[_0x21c2('0x32')]][_0x21c2('0x74')]=_0x53c20d[_0x21c2('0x6d')];}else if(this[_0x21c2('0x2e')](_0x53c20d['variable']['xmcs-queue'])){this['channels'][_0x53c20d[_0x21c2('0x32')]][_0x21c2('0x57')]=_0x53c20d[_0x21c2('0x6d')];}else if(this[_0x21c2('0x2e')](_0x53c20d['variable'][_0x21c2('0x75')])){this[_0x21c2('0x19')][_0x53c20d[_0x21c2('0x32')]][_0x21c2('0x76')]=_0x53c20d['value'];}}}else if(this['isNotNull'](_0x53c20d['variable'][_0x21c2('0x6c')])){if(_0x53c20d[_0x21c2('0x6d')]){var _0x3bd538=path[_0x21c2('0x77')](_0x53c20d[_0x21c2('0x6d')])[_0x21c2('0x48')];this['syncMixMonitorFilename'](_0x3bd538,_0x53c20d[_0x21c2('0x6d')]);}}else if(this[_0x21c2('0x19')][_0x53c20d[_0x21c2('0x33')]]){if(this['isNotNull'](_0x53c20d[_0x21c2('0x6e')])){if(this[_0x21c2('0x2e')](_0x53c20d['variable'][_0x21c2('0x75')])){this[_0x21c2('0x19')][_0x53c20d[_0x21c2('0x33')]][_0x21c2('0x78')]=_0x53c20d['value'];}}}}}catch(_0x57450a){logger[_0x21c2('0x37')]('[syncVarSet][VoiceCallReport]',util['inspect'](_0x57450a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x24')]=function(_0x31d614){try{if(this[_0x21c2('0x2e')](_0x31d614)){if(this[_0x21c2('0x19')][_0x31d614['uniqueid']]){var _0x51d3ff=moment();this[_0x21c2('0x19')][_0x31d614[_0x21c2('0x32')]]['endtime']=_0x51d3ff[_0x21c2('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x21c2('0x19')][_0x31d614[_0x21c2('0x32')]]['duration']=_0x51d3ff[_0x21c2('0x5a')](this[_0x21c2('0x19')][_0x31d614['uniqueid']][_0x21c2('0x3c')],_0x21c2('0x50'));if(this[_0x21c2('0x19')][_0x31d614[_0x21c2('0x32')]][_0x21c2('0x59')]){this[_0x21c2('0x19')][_0x31d614['uniqueid']][_0x21c2('0x79')]=_0x51d3ff[_0x21c2('0x5a')](this[_0x21c2('0x19')][_0x31d614['uniqueid']][_0x21c2('0x7a')],'seconds');this['channels'][_0x31d614[_0x21c2('0x32')]]['holdtime']=this[_0x21c2('0x19')][_0x31d614[_0x21c2('0x32')]]['duration']-this['channels'][_0x31d614[_0x21c2('0x32')]]['billableseconds'];}if(_0x31d614['context']===_0x21c2('0x43')){if(this[_0x21c2('0x1a')][_0x31d614[_0x21c2('0x3a')][_0x21c2('0x44')]('-')[0x0]]){this[_0x21c2('0x1a')][_0x31d614[_0x21c2('0x3a')][_0x21c2('0x44')]('-')[0x0]]=_['omit'](this['agents'][_0x31d614[_0x21c2('0x3a')]['split']('-')[0x0]],[_0x21c2('0x45')]);this[_0x21c2('0x30')](util[_0x21c2('0x3d')](_0x21c2('0x47'),this[_0x21c2('0x1a')][_0x31d614[_0x21c2('0x3a')][_0x21c2('0x44')]('-')[0x0]]['name']),'user:agentcomplete',{'destaccountcode':this[_0x21c2('0x1a')][_0x31d614[_0x21c2('0x3a')]['split']('-')[0x0]][_0x21c2('0x4a')]});}}ami[_0x21c2('0x30')](_0x21c2('0x7b'),this[_0x21c2('0x19')][_0x31d614['uniqueid']]);delete this[_0x21c2('0x19')][_0x31d614[_0x21c2('0x32')]];}}}catch(_0x368417){logger[_0x21c2('0x37')](_0x21c2('0x7c'),util[_0x21c2('0x39')](_0x368417,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x7d')]=function(_0x1d0feb){try{if(this[_0x21c2('0x2e')](_0x1d0feb)){if(this[_0x21c2('0x19')][_0x1d0feb[_0x21c2('0x7e')]]){this[_0x21c2('0x19')][_0x1d0feb[_0x21c2('0x7e')]][_0x21c2('0x7f')]=_0x1d0feb[_0x21c2('0x80')];this['channels'][_0x1d0feb['transfereeuniqueid']][_0x21c2('0x81')]=_0x1d0feb[_0x21c2('0x82')];if(this[_0x21c2('0x19')][_0x1d0feb[_0x21c2('0x83')]]){var _0x5e7d71=this[_0x21c2('0x19')][_0x1d0feb[_0x21c2('0x83')]];this['channels'][_0x1d0feb[_0x21c2('0x83')]]=this[_0x21c2('0x19')][_0x1d0feb[_0x21c2('0x7e')]];this['channels'][_0x1d0feb[_0x21c2('0x7e')]]=_0x5e7d71;}}else if(this[_0x21c2('0x19')][_0x1d0feb[_0x21c2('0x84')]]){this[_0x21c2('0x19')][_0x1d0feb[_0x21c2('0x84')]][_0x21c2('0x7f')]=_0x1d0feb[_0x21c2('0x80')];this['channels'][_0x1d0feb[_0x21c2('0x84')]]['transferconnectedlinenum']=_0x1d0feb[_0x21c2('0x82')];if(this[_0x21c2('0x19')][_0x1d0feb['origtransfereruniqueid']]){var _0x5e7d71=this['channels'][_0x1d0feb[_0x21c2('0x85')]];this[_0x21c2('0x19')][_0x1d0feb[_0x21c2('0x85')]]=this[_0x21c2('0x19')][_0x1d0feb[_0x21c2('0x84')]];this[_0x21c2('0x19')][_0x1d0feb['transfertargetuniqueid']]=_0x5e7d71;}}}}catch(_0x4f7610){logger[_0x21c2('0x37')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x21c2('0x39')](_0x4f7610,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x86')]=function(_0x893102){try{if(this[_0x21c2('0x2e')](_0x893102)){if(this[_0x21c2('0x19')][_0x893102[_0x21c2('0x7e')]]){this[_0x21c2('0x19')][_0x893102[_0x21c2('0x7e')]][_0x21c2('0x7f')]=_0x893102['transfereecalleridnum'];this[_0x21c2('0x19')][_0x893102[_0x21c2('0x7e')]][_0x21c2('0x81')]=_0x893102[_0x21c2('0x87')];this[_0x21c2('0x24')]({'event':_0x21c2('0x88'),'uniqueid':_0x893102[_0x21c2('0x7e')],'context':_0x893102['context'],'channel':_0x893102[_0x21c2('0x89')]});}}}catch(_0x4a5089){logger[_0x21c2('0x37')](_0x21c2('0x8a'),util[_0x21c2('0x39')](_0x4a5089,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c2('0x2d')]['syncMusicOnHoldStart']=function(_0x59ba00){try{if(this[_0x21c2('0x2e')](_0x59ba00)){if(this[_0x21c2('0x19')][_0x59ba00['uniqueid']]){if(!_[_0x21c2('0x8b')](this[_0x21c2('0x19')][_0x59ba00[_0x21c2('0x32')]][_0x21c2('0x7a')])){this[_0x21c2('0x19')][_0x59ba00[_0x21c2('0x32')]][_0x21c2('0x8c')]=moment()['format'](_0x21c2('0x3e'));}}}}catch(_0x16109b){logger[_0x21c2('0x37')](_0x21c2('0x8d'),util[_0x21c2('0x39')](_0x16109b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21c2('0x2d')][_0x21c2('0x8e')]=function(_0x391847){try{if(this[_0x21c2('0x2e')](_0x391847)){if(this[_0x21c2('0x19')][_0x391847[_0x21c2('0x32')]]){if(!_[_0x21c2('0x8b')](this[_0x21c2('0x19')][_0x391847[_0x21c2('0x32')]][_0x21c2('0x8c')])){this[_0x21c2('0x19')][_0x391847[_0x21c2('0x32')]][_0x21c2('0x8f')]+=moment()['milliseconds'](0x0)[_0x21c2('0x5a')](this[_0x21c2('0x19')][_0x391847['uniqueid']]['mohstarttime'],_0x21c2('0x50'));delete this[_0x21c2('0x19')][_0x391847[_0x21c2('0x32')]][_0x21c2('0x8c')];}}}}catch(_0x5ec1ba){logger[_0x21c2('0x37')](_0x21c2('0x90'),util[_0x21c2('0x39')](_0x5ec1ba,{'showHidden':![],'depth':null}));}};module[_0x21c2('0x91')]=VoiceCallReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js
index adac3c1..547ce95 100644
--- a/server/services/ami/report/voiceDialReport.js
+++ b/server/services/ami/report/voiceDialReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf749=['merge','format','called','channel','substring','lastIndexOf','omit','privilege','voice_outbound_channel:save','emit','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','voice:outbound','[syncDialEnd][VoiceDialReport]','inspect','syncVarSet','addVariable','variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','memberlastcall','memberrealtime','isNil','includes','diff','starttime','seconds','complete','answered','holdtime','billableseconds','endtime','sumHoldTime','duration','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','isUndefined','prototype','isNotNull','uniqueid'];(function(_0x45e632,_0x5714ec){var _0x2b7ac1=function(_0x183774){while(--_0x183774){_0x45e632['push'](_0x45e632['shift']());}};_0x2b7ac1(++_0x5714ec);}(_0xf749,0xd8));var _0x9f74=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf749[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var moment=require(_0x9f74('0x0'));var util=require(_0x9f74('0x1'));var Redis=require(_0x9f74('0x2'));var config=require(_0x9f74('0x3'));var logger=require(_0x9f74('0x4'))(_0x9f74('0x5'));var ami=require(_0x9f74('0x6'));config['redis']=_[_0x9f74('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x5a5dc6){this[_0x9f74('0x8')]=_0x5a5dc6[_0x9f74('0x9')];this[_0x9f74('0xa')]=_0x5a5dc6[_0x9f74('0xa')];this[_0x9f74('0xb')]={};ami['on'](_0x9f74('0xc'),this[_0x9f74('0xd')][_0x9f74('0xe')](this));ami['on'](_0x9f74('0xf'),this[_0x9f74('0x10')][_0x9f74('0xe')](this));ami['on'](_0x9f74('0x11'),this['syncVarSet'][_0x9f74('0xe')](this));ami['on'](_0x9f74('0x12'),this[_0x9f74('0x13')][_0x9f74('0xe')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x1b0b89){return _0x1b0b89!==null&&!_[_0x9f74('0x14')](_0x1b0b89);};VoiceDialReport[_0x9f74('0x15')]['emit']=function(_0x454a1f,_0x2c5744,_0x5e1f13){io['to'](_0x454a1f)['emit'](_0x2c5744,_0x5e1f13);};VoiceDialReport[_0x9f74('0x15')][_0x9f74('0xd')]=function(_0x375d4a){try{if(this[_0x9f74('0x16')](_0x375d4a)){if(this['channels'][_0x375d4a[_0x9f74('0x17')]]){_[_0x9f74('0x18')](this['channels'][_0x375d4a['uniqueid']],{'starttime':moment()[_0x9f74('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x9f74('0x1a'),'interface':_0x375d4a[_0x9f74('0x1b')][_0x9f74('0x1c')](0x0,_0x375d4a['channel'][_0x9f74('0x1d')]('-')),'membername':_0x375d4a['channel'][_0x9f74('0x1c')](_0x375d4a[_0x9f74('0x1b')][_0x9f74('0x1d')]('/')+0x1,_0x375d4a[_0x9f74('0x1b')]['lastIndexOf']('-'))},_[_0x9f74('0x1e')](_0x375d4a,['event',_0x9f74('0x1f')]));this['emit']('voice:outbound',_0x9f74('0x20'),this[_0x9f74('0x8')][_0x375d4a[_0x9f74('0x17')]]);ami[_0x9f74('0x21')](_0x9f74('0x22'),this[_0x9f74('0x8')][_0x375d4a[_0x9f74('0x17')]]);}}}catch(_0x21796d){logger[_0x9f74('0x23')]('[syncDialBegin][VoiceDialReport]',util['inspect'](_0x21796d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9f74('0x15')]['syncDialEnd']=function(_0x3ea101){try{if(this['isNotNull'](_0x3ea101)){if(this[_0x9f74('0x8')][_0x3ea101[_0x9f74('0x17')]]){this[_0x9f74('0x8')][_0x3ea101[_0x9f74('0x17')]][_0x9f74('0x24')]=_0x3ea101[_0x9f74('0x24')];if(_0x3ea101[_0x9f74('0x24')]===_0x9f74('0x25')){this[_0x9f74('0x8')][_0x3ea101[_0x9f74('0x17')]][_0x9f74('0x26')]=_0x3ea101[_0x9f74('0x26')];this['channels'][_0x3ea101[_0x9f74('0x17')]][_0x9f74('0x27')]=_0x3ea101[_0x9f74('0x27')];this[_0x9f74('0x8')][_0x3ea101[_0x9f74('0x17')]][_0x9f74('0x28')]=moment()[_0x9f74('0x19')](_0x9f74('0x29'));this[_0x9f74('0x8')][_0x3ea101[_0x9f74('0x17')]][_0x9f74('0x2a')]=_0x9f74('0x2b');ami['emit']('custom:dialconnect',this[_0x9f74('0x8')][_0x3ea101[_0x9f74('0x17')]]);}this[_0x9f74('0x21')](_0x9f74('0x2c'),_0x9f74('0x20'),this[_0x9f74('0x8')][_0x3ea101['uniqueid']]);}}}catch(_0x2ea806){logger[_0x9f74('0x23')](_0x9f74('0x2d'),util[_0x9f74('0x2e')](_0x2ea806,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9f74('0x15')][_0x9f74('0x2f')]=function(_0x52b344){try{if(this[_0x9f74('0x16')](_0x52b344)){this[_0x9f74('0x30')](_0x52b344['uniqueid'],_['keys'](_0x52b344[_0x9f74('0x31')])[0x0],_0x52b344[_0x9f74('0x32')]);if(this[_0x9f74('0x16')](_0x52b344['variable'])&&this['isNotNull'](_0x52b344[_0x9f74('0x31')]['outboundrouteid'])){if(_[_0x9f74('0x14')](this['channels'][_0x52b344['uniqueid']])){this[_0x9f74('0x8')][_0x52b344[_0x9f74('0x17')]]={'routeId':_0x52b344['value'],'variables':this[_0x9f74('0xb')][_0x52b344[_0x9f74('0x17')]]};this[_0x9f74('0x21')]('voice:outbound',_0x9f74('0x20'),this[_0x9f74('0x8')][_0x52b344[_0x9f74('0x17')]]);}}}}catch(_0x3b579f){logger[_0x9f74('0x23')]('[syncVarSet][VoiceDialReport]',util[_0x9f74('0x2e')](_0x3b579f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9f74('0x15')]['addVariable']=function(_0x23df51,_0xa05cc9,_0x404cdc){var _0x4180d8=[_0x9f74('0x33'),_0x9f74('0x34'),_0x9f74('0x35'),_0x9f74('0x36'),'rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt',_0x9f74('0x37'),'sipcallid',_0x9f74('0x38'),_0x9f74('0x39'),'bridgepvtcallid','membercalls','memberdynamic','memberinterface',_0x9f74('0x3a'),'membername','memberpenalty',_0x9f74('0x3b')];if(!_[_0x9f74('0x3c')](_0xa05cc9)&&!_[_0x9f74('0x3d')](_0x4180d8,_0xa05cc9)){if(_[_0x9f74('0x14')](this['variables'][_0x23df51])){this[_0x9f74('0xb')][_0x23df51]={};}this[_0x9f74('0xb')][_0x23df51][_0xa05cc9]=_0x404cdc;}};VoiceDialReport[_0x9f74('0x15')][_0x9f74('0x13')]=function(_0x295dc9){try{if(this['isNotNull'](_0x295dc9)){if(this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]]){this[_0x9f74('0x8')][_0x295dc9['uniqueid']]['endtime']=moment()[_0x9f74('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9f74('0x8')][_0x295dc9['uniqueid']]['duration']=moment(this['channels'][_0x295dc9[_0x9f74('0x17')]]['endtime'])[_0x9f74('0x3e')](this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]][_0x9f74('0x3f')],_0x9f74('0x40'));this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]][_0x9f74('0x2a')]=_0x9f74('0x41');this[_0x9f74('0xa')]['total']+=0x1;if(this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]][_0x9f74('0x28')]){this[_0x9f74('0xa')][_0x9f74('0x42')]+=0x1;this['channels'][_0x295dc9['uniqueid']][_0x9f74('0x43')]=moment(this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]][_0x9f74('0x28')])[_0x9f74('0x3e')](this['channels'][_0x295dc9['uniqueid']][_0x9f74('0x3f')],_0x9f74('0x40'));this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]][_0x9f74('0x44')]=moment(this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]][_0x9f74('0x45')])[_0x9f74('0x3e')](this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]][_0x9f74('0x28')],'seconds');this['outbound'][_0x9f74('0x46')]+=this[_0x9f74('0x8')][_0x295dc9['uniqueid']]['holdtime']||0x0;this[_0x9f74('0xa')]['sumBillable']+=this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]][_0x9f74('0x44')];}this[_0x9f74('0xa')]['sumDuration']+=this['channels'][_0x295dc9[_0x9f74('0x17')]][_0x9f74('0x47')];ami['emit'](_0x9f74('0x48'),this[_0x9f74('0x8')][_0x295dc9['uniqueid']]);ami[_0x9f74('0x21')](_0x9f74('0x49'),this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]]);this[_0x9f74('0x21')](_0x9f74('0x2c'),_0x9f74('0x4a'),this[_0x9f74('0xa')]);logger[_0x9f74('0x4b')](_0x9f74('0x4c'),JSON[_0x9f74('0x4d')](this[_0x9f74('0x8')][_0x295dc9[_0x9f74('0x17')]]));this['emit']('voice:outbound',_0x9f74('0x4e'),this[_0x9f74('0x8')][_0x295dc9['uniqueid']]);delete this[_0x9f74('0x8')][_0x295dc9['uniqueid']];}if(this[_0x9f74('0xb')][_0x295dc9[_0x9f74('0x17')]]){delete this[_0x9f74('0xb')][_0x295dc9[_0x9f74('0x17')]];}}}catch(_0x43d05b){logger[_0x9f74('0x23')]('[syncHangup][VoiceDialReport]',util['inspect'](_0x43d05b,{'showHidden':![],'depth':null}));}};module[_0x9f74('0x4f')]=VoiceDialReport;
\ No newline at end of file
+var _0xb2ff=['lastIndexOf','omit','privilege','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','voice:outbound','addVariable','keys','variable','value','error','rtpaudioqos','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','includes','endtime','duration','diff','starttime','seconds','lastevent','complete','total','sumHoldTime','holdtime','sumBillable','billableseconds','sumDuration','custom:voiceDialReport','custom:dialend','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','moment','ioredis','../ami','defaults','redis','localhost','socket.io-emitter','channels','outbound','variables','dialbegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','syncDialBegin','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring'];(function(_0x190681,_0x590f58){var _0x4f2ada=function(_0x4556db){while(--_0x4556db){_0x190681['push'](_0x190681['shift']());}};_0x4f2ada(++_0x590f58);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2ff[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xfb2f('0x0'));var moment=require(_0xfb2f('0x1'));var util=require('util');var Redis=require(_0xfb2f('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0xfb2f('0x3'));config['redis']=_[_0xfb2f('0x4')](config[_0xfb2f('0x5')],{'host':_0xfb2f('0x6'),'port':0x18eb});var io=require(_0xfb2f('0x7'))(new Redis(config['redis']));function VoiceDialReport(_0x4a0fd7){this[_0xfb2f('0x8')]=_0x4a0fd7['outboundChannels'];this[_0xfb2f('0x9')]=_0x4a0fd7[_0xfb2f('0x9')];this[_0xfb2f('0xa')]={};ami['on'](_0xfb2f('0xb'),this['syncDialBegin'][_0xfb2f('0xc')](this));ami['on']('dialend',this[_0xfb2f('0xd')]['bind'](this));ami['on'](_0xfb2f('0xe'),this[_0xfb2f('0xf')][_0xfb2f('0xc')](this));ami['on'](_0xfb2f('0x10'),this[_0xfb2f('0x11')]['bind'](this));}VoiceDialReport[_0xfb2f('0x12')][_0xfb2f('0x13')]=function(_0x2b5de4){return _0x2b5de4!==null&&!_[_0xfb2f('0x14')](_0x2b5de4);};VoiceDialReport[_0xfb2f('0x12')][_0xfb2f('0x15')]=function(_0x36562f,_0x1fb289,_0x5f3893){io['to'](_0x36562f)[_0xfb2f('0x15')](_0x1fb289,_0x5f3893);};VoiceDialReport[_0xfb2f('0x12')][_0xfb2f('0x16')]=function(_0xbfd8c2){try{if(this[_0xfb2f('0x13')](_0xbfd8c2)){if(this['channels'][_0xbfd8c2[_0xfb2f('0x17')]]){_[_0xfb2f('0x18')](this[_0xfb2f('0x8')][_0xbfd8c2[_0xfb2f('0x17')]],{'starttime':moment()[_0xfb2f('0x19')](_0xfb2f('0x1a')),'lastevent':'called','interface':_0xbfd8c2[_0xfb2f('0x1b')][_0xfb2f('0x1c')](0x0,_0xbfd8c2['channel'][_0xfb2f('0x1d')]('-')),'membername':_0xbfd8c2[_0xfb2f('0x1b')][_0xfb2f('0x1c')](_0xbfd8c2[_0xfb2f('0x1b')][_0xfb2f('0x1d')]('/')+0x1,_0xbfd8c2['channel']['lastIndexOf']('-'))},_[_0xfb2f('0x1e')](_0xbfd8c2,['event',_0xfb2f('0x1f')]));this['emit']('voice:outbound',_0xfb2f('0x20'),this[_0xfb2f('0x8')][_0xbfd8c2['uniqueid']]);ami[_0xfb2f('0x15')](_0xfb2f('0x21'),this[_0xfb2f('0x8')][_0xbfd8c2[_0xfb2f('0x17')]]);}}}catch(_0x16717d){logger['error'](_0xfb2f('0x22'),util[_0xfb2f('0x23')](_0x16717d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xfb2f('0xd')]=function(_0x4f458a){try{if(this[_0xfb2f('0x13')](_0x4f458a)){if(this[_0xfb2f('0x8')][_0x4f458a[_0xfb2f('0x17')]]){this[_0xfb2f('0x8')][_0x4f458a[_0xfb2f('0x17')]]['dialstatus']=_0x4f458a[_0xfb2f('0x24')];if(_0x4f458a[_0xfb2f('0x24')]===_0xfb2f('0x25')){this[_0xfb2f('0x8')][_0x4f458a[_0xfb2f('0x17')]][_0xfb2f('0x26')]=_0x4f458a['connectedlinenum'];this[_0xfb2f('0x8')][_0x4f458a[_0xfb2f('0x17')]][_0xfb2f('0x27')]=_0x4f458a[_0xfb2f('0x27')];this['channels'][_0x4f458a['uniqueid']][_0xfb2f('0x28')]=moment()[_0xfb2f('0x19')](_0xfb2f('0x1a'));this['channels'][_0x4f458a[_0xfb2f('0x17')]]['lastevent']='connect';ami[_0xfb2f('0x15')]('custom:dialconnect',this[_0xfb2f('0x8')][_0x4f458a[_0xfb2f('0x17')]]);}this[_0xfb2f('0x15')](_0xfb2f('0x29'),_0xfb2f('0x20'),this['channels'][_0x4f458a[_0xfb2f('0x17')]]);}}}catch(_0x351880){logger['error']('[syncDialEnd][VoiceDialReport]',util['inspect'](_0x351880,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfb2f('0x12')][_0xfb2f('0xf')]=function(_0xe3a407){try{if(this[_0xfb2f('0x13')](_0xe3a407)){this[_0xfb2f('0x2a')](_0xe3a407[_0xfb2f('0x17')],_[_0xfb2f('0x2b')](_0xe3a407[_0xfb2f('0x2c')])[0x0],_0xe3a407[_0xfb2f('0x2d')]);if(this[_0xfb2f('0x13')](_0xe3a407[_0xfb2f('0x2c')])&&this[_0xfb2f('0x13')](_0xe3a407[_0xfb2f('0x2c')]['outboundrouteid'])){if(_[_0xfb2f('0x14')](this[_0xfb2f('0x8')][_0xe3a407[_0xfb2f('0x17')]])){this[_0xfb2f('0x8')][_0xe3a407['uniqueid']]={'routeId':_0xe3a407[_0xfb2f('0x2d')],'variables':this[_0xfb2f('0xa')][_0xe3a407[_0xfb2f('0x17')]]};this[_0xfb2f('0x15')](_0xfb2f('0x29'),'voice_outbound_channel:save',this[_0xfb2f('0x8')][_0xe3a407[_0xfb2f('0x17')]]);}}}}catch(_0xf038eb){logger[_0xfb2f('0x2e')]('[syncVarSet][VoiceDialReport]',util[_0xfb2f('0x23')](_0xf038eb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfb2f('0x12')][_0xfb2f('0x2a')]=function(_0x38a72e,_0x53422d,_0x3283d9){var _0x3033c7=[_0xfb2f('0x2f'),'rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0xfb2f('0x30'),_0xfb2f('0x31'),_0xfb2f('0x32'),'sipuri',_0xfb2f('0x33'),_0xfb2f('0x34'),_0xfb2f('0x35'),_0xfb2f('0x36'),_0xfb2f('0x37'),_0xfb2f('0x38'),_0xfb2f('0x39'),_0xfb2f('0x3a'),_0xfb2f('0x3b')];if(!_['isNil'](_0x53422d)&&!_[_0xfb2f('0x3c')](_0x3033c7,_0x53422d)){if(_['isUndefined'](this['variables'][_0x38a72e])){this['variables'][_0x38a72e]={};}this[_0xfb2f('0xa')][_0x38a72e][_0x53422d]=_0x3283d9;}};VoiceDialReport[_0xfb2f('0x12')][_0xfb2f('0x11')]=function(_0x1af1d4){try{if(this[_0xfb2f('0x13')](_0x1af1d4)){if(this[_0xfb2f('0x8')][_0x1af1d4['uniqueid']]){this[_0xfb2f('0x8')][_0x1af1d4['uniqueid']][_0xfb2f('0x3d')]=moment()[_0xfb2f('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xfb2f('0x8')][_0x1af1d4['uniqueid']][_0xfb2f('0x3e')]=moment(this[_0xfb2f('0x8')][_0x1af1d4[_0xfb2f('0x17')]]['endtime'])[_0xfb2f('0x3f')](this[_0xfb2f('0x8')][_0x1af1d4[_0xfb2f('0x17')]][_0xfb2f('0x40')],_0xfb2f('0x41'));this[_0xfb2f('0x8')][_0x1af1d4[_0xfb2f('0x17')]][_0xfb2f('0x42')]=_0xfb2f('0x43');this[_0xfb2f('0x9')][_0xfb2f('0x44')]+=0x1;if(this[_0xfb2f('0x8')][_0x1af1d4[_0xfb2f('0x17')]][_0xfb2f('0x28')]){this[_0xfb2f('0x9')]['answered']+=0x1;this[_0xfb2f('0x8')][_0x1af1d4[_0xfb2f('0x17')]]['holdtime']=moment(this[_0xfb2f('0x8')][_0x1af1d4['uniqueid']][_0xfb2f('0x28')])[_0xfb2f('0x3f')](this[_0xfb2f('0x8')][_0x1af1d4[_0xfb2f('0x17')]][_0xfb2f('0x40')],_0xfb2f('0x41'));this['channels'][_0x1af1d4[_0xfb2f('0x17')]]['billableseconds']=moment(this['channels'][_0x1af1d4[_0xfb2f('0x17')]]['endtime'])['diff'](this[_0xfb2f('0x8')][_0x1af1d4[_0xfb2f('0x17')]][_0xfb2f('0x28')],_0xfb2f('0x41'));this['outbound'][_0xfb2f('0x45')]+=this[_0xfb2f('0x8')][_0x1af1d4[_0xfb2f('0x17')]][_0xfb2f('0x46')]||0x0;this[_0xfb2f('0x9')][_0xfb2f('0x47')]+=this[_0xfb2f('0x8')][_0x1af1d4[_0xfb2f('0x17')]][_0xfb2f('0x48')];}this[_0xfb2f('0x9')][_0xfb2f('0x49')]+=this[_0xfb2f('0x8')][_0x1af1d4['uniqueid']]['duration'];ami['emit'](_0xfb2f('0x4a'),this['channels'][_0x1af1d4['uniqueid']]);ami[_0xfb2f('0x15')](_0xfb2f('0x4b'),this[_0xfb2f('0x8')][_0x1af1d4['uniqueid']]);this[_0xfb2f('0x15')](_0xfb2f('0x29'),'voice_outbound:save',this['outbound']);logger['info'](_0xfb2f('0x4c'),JSON[_0xfb2f('0x4d')](this['channels'][_0x1af1d4['uniqueid']]));this[_0xfb2f('0x15')]('voice:outbound',_0xfb2f('0x4e'),this['channels'][_0x1af1d4[_0xfb2f('0x17')]]);delete this['channels'][_0x1af1d4[_0xfb2f('0x17')]];}if(this['variables'][_0x1af1d4[_0xfb2f('0x17')]]){delete this[_0xfb2f('0xa')][_0x1af1d4[_0xfb2f('0x17')]];}}}catch(_0x54855d){logger[_0xfb2f('0x2e')](_0xfb2f('0x4f'),util['inspect'](_0x54855d,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js
index cac496a..4648397 100644
--- a/server/services/ami/report/voiceQueueReport.js
+++ b/server/services/ami/report/voiceQueueReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7453=['memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','length','unmanaged','abandoned','diff','milliseconds','custom:queuecallerunmanaged','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','transfertargetuniqueid','transferexten','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','syncMusicOnHoldStart','mohstarttime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncFullyBooted','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','isUndefined','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','clearZombieChannels','isNil','Action','status','channel','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','Trunk','active','Interval','voice_queue:save','loopQueueShow','catch','[queues]','loopQueueSummary','flagQueueSummary','[queuesummary]','syncQueueSummary','isNotNull','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','push','[syncQueueCallerJoin][VoiceQueueReport]','syncQueueCallerAbandon','last','queuecallercomplete','queuecallercompleteAt','holdtime','queuecallerabandonAt','queuecallerexitreason','ABANDONED','emitVoiceQueueChannelRemove','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','[syncAgentConnect][VoiceQueueReport]','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','toUpperCase','keys','value','variable','CONTINUE','timeout','custom:timeout','queuecallerleaveAt','EXITWITHKEY','addVariable','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface'];(function(_0x58aecd,_0xc6d26b){var _0x5b20b9=function(_0x26edac){while(--_0x26edac){_0x58aecd['push'](_0x58aecd['shift']());}};_0x5b20b9(++_0xc6d26b);}(_0x7453,0x1b6));var _0x3745=function(_0x2f173c,_0x23f778){_0x2f173c=_0x2f173c-0x0;var _0x41b6ba=_0x7453[_0x2f173c];return _0x41b6ba;};'use strict';var _=require(_0x3745('0x0'));var moment=require(_0x3745('0x1'));var BPromise=require(_0x3745('0x2'));var util=require(_0x3745('0x3'));var md5=require(_0x3745('0x4'));var Redis=require(_0x3745('0x5'));var config=require(_0x3745('0x6'));var logger=require(_0x3745('0x7'))(_0x3745('0x8'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config['redis']=_[_0x3745('0x9')](config[_0x3745('0xa')],{'host':_0x3745('0xb'),'port':0x18eb});var io=require(_0x3745('0xc'))(new Redis(config[_0x3745('0xa')]));var Sequence=function(){};Sequence[_0x3745('0xd')][_0x3745('0xe')]=function(_0x607d23){this[_0x3745('0xf')]=this[_0x3745('0xf')]?this[_0x3745('0xf')][_0x3745('0x10')](_0x607d23):_0x607d23();};function VoiceQueueReport(_0x1d885c){this[_0x3745('0x11')]=new Sequence();this[_0x3745('0x12')]={};this[_0x3745('0x13')]=_0x1d885c[_0x3745('0x13')];this[_0x3745('0x14')]=_0x1d885c[_0x3745('0x15')];this[_0x3745('0x16')]=_0x1d885c[_0x3745('0x16')];this['flagQueueSummary']=!![];this[_0x3745('0x17')]=_0x1d885c[_0x3745('0x17')];this[_0x3745('0x18')]={};ami['on'](_0x3745('0x19'),this['syncQueueSummary'][_0x3745('0x1a')](this));ami['on'](_0x3745('0x1b'),this[_0x3745('0x1c')][_0x3745('0x1a')](this));ami['on']('queuecallerjoin',this[_0x3745('0x1d')][_0x3745('0x1a')](this));ami['on'](_0x3745('0x1e'),this['syncQueueCallerAbandon'][_0x3745('0x1a')](this));ami['on'](_0x3745('0x1f'),this['syncQueueCallerLeave'][_0x3745('0x1a')](this));ami['on'](_0x3745('0x20'),this[_0x3745('0x21')][_0x3745('0x1a')](this));ami['on']('agentconnect',this[_0x3745('0x22')][_0x3745('0x1a')](this));ami['on'](_0x3745('0x23'),this[_0x3745('0x24')]['bind'](this));ami['on'](_0x3745('0x25'),this['syncHangup'][_0x3745('0x1a')](this));ami['on']('fullybooted',this[_0x3745('0x26')][_0x3745('0x1a')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x3745('0x1a')](this));ami['on'](_0x3745('0x27'),this[_0x3745('0x28')]['bind'](this));ami['on'](_0x3745('0x29'),this[_0x3745('0x2a')][_0x3745('0x1a')](this));ami['on']('blindtransfer',this[_0x3745('0x2b')][_0x3745('0x1a')](this));this['loopQueueSummary']();this['loopQueueShow']();}function isNotNull(_0x144170){return _0x144170!==null&&!_[_0x3745('0x2c')](_0x144170);}function clearChannels(_0x355acf){if(!_[_0x3745('0x2d')](_0x355acf)){for(var _0x38b54e in _0x355acf){if(_0x355acf[_0x3745('0x2e')](_0x38b54e)){delete _0x355acf[_0x38b54e];}}}}function clearCampaigns(_0x5e3476){if(!_['isEmpty'](_0x5e3476)){for(var _0x1df346 in _0x5e3476){if(_0x5e3476[_0x3745('0x2e')](_0x1df346)){_0x5e3476[_0x1df346][_0x3745('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x5f0015){if(!_[_0x3745('0x2d')](_0x5f0015)){for(var _0xeacd4a in _0x5f0015){if(_0x5f0015[_0x3745('0x2e')](_0xeacd4a)){_0x5f0015[_0xeacd4a][_0x3745('0x2f')]=0x0;_0x5f0015[_0xeacd4a][_0x3745('0x30')]=0x0;_0x5f0015[_0xeacd4a][_0x3745('0x31')]=0x0;_0x5f0015[_0xeacd4a][_0x3745('0x32')]=0x0;_0x5f0015[_0xeacd4a]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x5b46de){if(!_[_0x3745('0x2d')](_0x5b46de)){for(var _0x1733ec in _0x5b46de){if(_0x5b46de['hasOwnProperty'](_0x1733ec)){_0x5b46de[_0x1733ec][_0x3745('0x33')]=!![];}}}}VoiceQueueReport[_0x3745('0xd')][_0x3745('0x34')]=function(){var _0x4ec8ba=this;for(var _0x1ac8af in this[_0x3745('0x14')]){if(this[_0x3745('0x14')][_0x3745('0x2e')](_0x1ac8af)&&!this[_0x3745('0x14')][_0x1ac8af]['switch']){this[_0x3745('0x11')]['enqueue'](function(){if(!_[_0x3745('0x35')](_0x4ec8ba[_0x3745('0x14')][_0x1ac8af])){return ami[_0x3745('0x36')]({'action':_0x3745('0x37'),'channel':_0x4ec8ba[_0x3745('0x14')][_0x1ac8af][_0x3745('0x38')]})['catch'](function(_0x220525){if(_0x220525[_0x3745('0x39')]===_0x3745('0x3a')){setTimeout(function(){if(_0x4ec8ba[_0x3745('0x14')][_0x1ac8af]){delete _0x4ec8ba[_0x3745('0x14')][_0x1ac8af];logger[_0x3745('0x3b')](_0x3745('0x3c'),_0x1ac8af);}if(_0x4ec8ba[_0x3745('0x12')][_0x1ac8af]){delete _0x4ec8ba[_0x3745('0x12')][_0x1ac8af];logger['error'](_0x3745('0x3d'),_0x1ac8af);}if(_0x4ec8ba[_0x3745('0x18')][_0x1ac8af]){delete _0x4ec8ba[_0x3745('0x18')][_0x1ac8af];logger[_0x3745('0x3b')](_0x3745('0x3e'),_0x1ac8af);}},0x1f40);}});}});}}};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x26')]=function(){logger[_0x3745('0x3b')](_0x3745('0x3f'));clearChannels(this['channels']);this[_0x3745('0x40')](this[_0x3745('0x12')]);clearAgentBooked(this[_0x3745('0x13')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x3745('0x17')]);};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x40')]=function(_0x34a4df){var _0xf1fee7=this;if(!_[_0x3745('0x2d')](_0x34a4df)){for(var _0x243347 in _0x34a4df){if(_0x34a4df['hasOwnProperty'](_0x243347)){_0xf1fee7['emitVoiceQueueChannelRemove'](_0x34a4df[_0x243347]);delete _0x34a4df[_0x243347];}}}};function loggerCatch(_0x13fd79){return function(_0x1a31bf){logger['error'](_0x13fd79,util[_0x3745('0x41')](_0x1a31bf,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x3745('0xd')][_0x3745('0x42')]=function(_0x3e8a0d,_0x1f3d75,_0x1dfb35){io['to'](_0x3e8a0d)[_0x3745('0x42')](_0x1f3d75,_0x1dfb35);};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x43')]=function(_0x4c115c){this['emit'](util[_0x3745('0x44')](_0x3745('0x45'),_0x4c115c[_0x3745('0x46')]),'voice_queue_channel:save',_0x4c115c);};VoiceQueueReport[_0x3745('0xd')]['emitVoiceQueueChannelRemove']=function(_0x421dbc){logger['info'](_0x3745('0x47'),JSON[_0x3745('0x48')](_0x421dbc));this[_0x3745('0x42')](util[_0x3745('0x44')]('voice:queue:%s',_0x421dbc['name']),_0x3745('0x49'),_0x421dbc);};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x4a')]=function(_0x1555de){if(_0x1555de['type']===_0x3745('0x4b')){var _0x350356={'id':_0x1555de['id'],'name':_0x1555de[_0x3745('0x46')],'strategy':_0x1555de[_0x3745('0x4c')],'answered':_0x1555de[_0x3745('0x4d')],'available':_0x1555de[_0x3745('0x4e')],'loggedIn':_0x1555de[_0x3745('0x4f')],'pTalking':_0x1555de['pTalking'],'sumBillable':_0x1555de[_0x3745('0x50')],'sumDuration':_0x1555de[_0x3745('0x51')],'sumHoldTime':_0x1555de[_0x3745('0x52')]||0x0,'talking':_0x1555de[_0x3745('0x30')],'total':_0x1555de[_0x3745('0x53')],'type':_0x1555de[_0x3745('0x54')],'unmanaged':_0x1555de['unmanaged'],'abandoned':_0x1555de['abandoned'],'waiting':_0x1555de['waiting']};if(_0x1555de['Trunk']){_0x350356[_0x3745('0x55')]={'id':_0x1555de[_0x3745('0x55')]['id'],'name':_0x1555de[_0x3745('0x55')]['name'],'active':_0x1555de['Trunk'][_0x3745('0x56')],'callerid':_0x1555de[_0x3745('0x55')]['callerid']};}if(_0x1555de[_0x3745('0x57')]){_0x350356[_0x3745('0x57')]={'id':_0x1555de[_0x3745('0x57')]['id'],'name':_0x1555de[_0x3745('0x57')][_0x3745('0x46')]};}var _0x2e5db9=md5(JSON[_0x3745('0x48')](_0x350356));if(_0x1555de[_0x3745('0x4')]!==_0x2e5db9){_0x1555de[_0x3745('0x4')]=_0x2e5db9;this[_0x3745('0x42')](util['format']('voice:queue:%s',_0x350356[_0x3745('0x46')]),_0x3745('0x58'),_0x350356);}}};VoiceQueueReport['prototype']['isNotNull']=function(_0x4be3c6){return _0x4be3c6!==null&&!_[_0x3745('0x2c')](_0x4be3c6);};VoiceQueueReport['prototype'][_0x3745('0x59')]=function(){var _0x3f20f0=this;setInterval(function(){_0x3f20f0[_0x3745('0x34')]();ami[_0x3745('0x36')]({'action':'queues'})[_0x3745('0x5a')](loggerCatch(_0x3745('0x5b')));},0x2710);};VoiceQueueReport['prototype'][_0x3745('0x5c')]=function(){var _0x8de189=this;setInterval(function(){if(_0x8de189[_0x3745('0x5d')]){return ami[_0x3745('0x36')]({'action':'queuesummary'})['then'](function(_0x4a8dfc){_0x8de189[_0x3745('0x5d')]=![];})['catch'](loggerCatch(_0x3745('0x5e')));}},0x3e8);};VoiceQueueReport['prototype'][_0x3745('0x5f')]=function(_0x45f62b){try{if(this['isNotNull'](_0x45f62b)&&this[_0x3745('0x60')](_0x45f62b[_0x3745('0x61')])){if(this['voiceQueues'][_0x45f62b[_0x3745('0x61')]]){var _0x23124b=_[_0x3745('0x62')](this[_0x3745('0x14')],_0x3745('0x61'))[_0x45f62b[_0x3745('0x61')]]||0x0;var _0x6bf3b8=_0x23124b-_0x45f62b[_0x3745('0x63')];if(this[_0x3745('0x16')][_0x45f62b['queue']][_0x3745('0x32')]!==_[_0x3745('0x64')](_0x45f62b[_0x3745('0x63')])||this[_0x3745('0x16')][_0x45f62b['queue']][_0x3745('0x4f')]!==_[_0x3745('0x64')](_0x45f62b[_0x3745('0x65')])||this[_0x3745('0x16')][_0x45f62b[_0x3745('0x61')]][_0x3745('0x4e')]!==_[_0x3745('0x64')](_0x45f62b[_0x3745('0x4e')])||this[_0x3745('0x16')][_0x45f62b[_0x3745('0x61')]][_0x3745('0x30')]!==_0x6bf3b8){this[_0x3745('0x16')][_0x45f62b[_0x3745('0x61')]][_0x3745('0x32')]=_[_0x3745('0x64')](_0x45f62b[_0x3745('0x63')]);this['voiceQueues'][_0x45f62b[_0x3745('0x61')]]['loggedIn']=_[_0x3745('0x64')](_0x45f62b[_0x3745('0x65')]);this[_0x3745('0x16')][_0x45f62b[_0x3745('0x61')]][_0x3745('0x4e')]=_[_0x3745('0x64')](_0x45f62b[_0x3745('0x4e')]);this[_0x3745('0x16')][_0x45f62b[_0x3745('0x61')]][_0x3745('0x30')]=_0x6bf3b8>0x0?_0x6bf3b8:0x0;this[_0x3745('0x16')][_0x45f62b[_0x3745('0x61')]]['talking']=this[_0x3745('0x16')][_0x45f62b[_0x3745('0x61')]][_0x3745('0x30')]>_[_0x3745('0x64')](_0x45f62b['loggedin'])?_[_0x3745('0x64')](_0x45f62b[_0x3745('0x65')]):this['voiceQueues'][_0x45f62b[_0x3745('0x61')]][_0x3745('0x30')];this[_0x3745('0x4a')](this['voiceQueues'][_0x45f62b[_0x3745('0x61')]]);}ami[_0x3745('0x42')](_0x3745('0x66'),this[_0x3745('0x16')][_0x45f62b[_0x3745('0x61')]]);}}}catch(_0x302af6){logger[_0x3745('0x3b')](_0x3745('0x67'),util[_0x3745('0x41')](_0x302af6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x1c')]=function(_0xa4e412){this[_0x3745('0x5d')]=!![];};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x68')]=function(_0x214c88){};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x2d7cf9){try{if(this[_0x3745('0x60')](_0x2d7cf9)){if(_['isUndefined'](this[_0x3745('0x12')][_0x2d7cf9[_0x3745('0x69')]])){this[_0x3745('0x12')][_0x2d7cf9[_0x3745('0x69')]]=[];this[_0x3745('0x14')][_0x2d7cf9[_0x3745('0x69')]]={};}var _0x309ac1=new QueueReport();_0x309ac1[_0x3745('0x46')]=_0x2d7cf9[_0x3745('0x61')];_0x309ac1[_0x3745('0x54')]=this[_0x3745('0x16')][_0x309ac1[_0x3745('0x46')]]&&this[_0x3745('0x16')][_0x309ac1[_0x3745('0x46')]][_0x3745('0x54')]?this[_0x3745('0x16')][_0x309ac1[_0x3745('0x46')]]['type']||'inbound':_0x3745('0x4b');_0x309ac1[_0x3745('0x61')]=_0x2d7cf9['queue'];_0x309ac1[_0x3745('0x6a')]=moment()['format'](_0x3745('0x6b'));_0x309ac1[_0x3745('0x6c')]=_0x2d7cf9[_0x3745('0x6c')];_0x309ac1[_0x3745('0x6d')]=_0x2d7cf9[_0x3745('0x6d')];_[_0x3745('0x6e')](_0x309ac1,_[_0x3745('0x6f')](_0x2d7cf9,_['keys'](_0x309ac1)));this['queueReports'][_0x2d7cf9[_0x3745('0x69')]][_0x3745('0x70')](_0x309ac1);this[_0x3745('0x14')][_0x2d7cf9[_0x3745('0x69')]]=_0x309ac1;this[_0x3745('0x43')](_0x309ac1);}}catch(_0x24a99a){logger[_0x3745('0x3b')](_0x3745('0x71'),util[_0x3745('0x41')](_0x24a99a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x72')]=function(_0x360b00){try{if(this[_0x3745('0x60')](_0x360b00)){if(this[_0x3745('0x12')][_0x360b00[_0x3745('0x69')]]){var _0x3ae96d=_[_0x3745('0x73')](this[_0x3745('0x12')][_0x360b00[_0x3745('0x69')]]);_0x3ae96d[_0x3745('0x74')]=![];_0x3ae96d[_0x3745('0x75')]=null;_0x3ae96d[_0x3745('0x76')]=_0x360b00[_0x3745('0x76')];_0x3ae96d['originalposition']=_0x360b00['originalposition'];_0x3ae96d[_0x3745('0x1e')]=!![];_0x3ae96d[_0x3745('0x77')]=moment()['format'](_0x3745('0x6b'));_0x3ae96d[_0x3745('0x78')]=_0x3745('0x79');_0x3ae96d['lastAssignedTo']=null;this[_0x3745('0x14')][_0x360b00[_0x3745('0x69')]]=_0x3ae96d;this[_0x3745('0x7a')](_0x3ae96d);}}}catch(_0x16defa){logger[_0x3745('0x3b')](_0x3745('0x7b'),util[_0x3745('0x41')](_0x16defa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x7c')]=function(_0x4921c2){try{if(this[_0x3745('0x60')](_0x4921c2)){if(this[_0x3745('0x12')][_0x4921c2[_0x3745('0x69')]]){var _0x16e61e=_[_0x3745('0x73')](this['queueReports'][_0x4921c2[_0x3745('0x69')]]);_0x16e61e['queuecallerleaveAt']=moment()[_0x3745('0x44')](_0x3745('0x6b'));_0x16e61e[_0x3745('0x7d')]=_0x4921c2[_0x3745('0x7d')];_0x16e61e[_0x3745('0x7e')]=_0x4921c2[_0x3745('0x7e')];this['channels'][_0x4921c2[_0x3745('0x69')]]=_0x16e61e;this[_0x3745('0x43')](_0x16e61e);}}}catch(_0x437dd7){logger[_0x3745('0x3b')](_0x3745('0x7f'),util['inspect'](_0x437dd7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x22')]=function(_0x18b101){try{if(this[_0x3745('0x60')](_0x18b101)){if(this[_0x3745('0x12')][_0x18b101[_0x3745('0x69')]]){var _0x3a7b52=_[_0x3745('0x73')](this[_0x3745('0x12')][_0x18b101[_0x3745('0x69')]]);_0x3a7b52[_0x3745('0x74')]=!![];_0x3a7b52[_0x3745('0x78')]='COMPLETEDBYAGENT';}}}catch(_0x2dbd70){logger[_0x3745('0x3b')](_0x3745('0x80'),util['inspect'](_0x2dbd70,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3745('0x21')]=function(_0x23f7f6){try{if(this[_0x3745('0x60')](_0x23f7f6)){if(this[_0x3745('0x12')][_0x23f7f6['uniqueid']]){var _0x3c1dec=_[_0x3745('0x73')](this[_0x3745('0x12')][_0x23f7f6[_0x3745('0x69')]]);_0x3c1dec[_0x3745('0x1e')]=![];_0x3c1dec['queuecallerabandonAt']=null;_0x3c1dec[_0x3745('0x81')]=!![];_0x3c1dec[_0x3745('0x82')]=_0x23f7f6[_0x3745('0x83')];_0x3c1dec[_0x3745('0x76')]=_0x23f7f6[_0x3745('0x76')];_0x3c1dec[_0x3745('0x74')]=!![];_0x3c1dec[_0x3745('0x84')]=![];_0x3c1dec[_0x3745('0x85')]=null;if(!_0x3c1dec[_0x3745('0x86')]){if(_0x23f7f6[_0x3745('0x87')]=='transfer'){_0x3c1dec[_0x3745('0x78')]=_0x3745('0x88');}else{if(_[_0x3745('0x89')](_0x23f7f6[_0x3745('0x38')]['toLowerCase'](),'local/')){if(this[_0x3745('0x12')][_0x23f7f6[_0x3745('0x8a')]]){var _0x32ce26=_['last'](this[_0x3745('0x12')][_0x23f7f6['linkedid']]);_0x32ce26[_0x3745('0x74')]=![];_0x32ce26['queuecallerexit']=!![];_0x32ce26['queuecallerexitAt']=moment(_0x3c1dec['queuecallerjoinAt'])[_0x3745('0x8b')](_0x23f7f6[_0x3745('0x76')],_0x3745('0x8c'))[_0x3745('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x32ce26[_0x3745('0x78')]=_0x3745('0x8d');_0x32ce26[_0x3745('0x86')]=!![];_0x32ce26[_0x3745('0x8e')]=_0x3745('0x8f');_0x32ce26['transferexten']=_0x23f7f6[_0x3745('0x90')];_0x32ce26[_0x3745('0x91')]=_0x23f7f6[_0x3745('0x69')];var _0x4017ac=this[_0x3745('0x12')][_0x23f7f6['linkedid']];this[_0x3745('0x12')][_0x23f7f6[_0x3745('0x8a')]]=this['queueReports'][_0x23f7f6[_0x3745('0x69')]];this[_0x3745('0x12')][_0x23f7f6['uniqueid']]=_0x4017ac;}}else{_0x3c1dec[_0x3745('0x78')]='COMPLETEDBY'+_0x23f7f6['reason'][_0x3745('0x92')]();}}}this[_0x3745('0x14')][_0x23f7f6[_0x3745('0x69')]]=_0x3c1dec;this[_0x3745('0x7a')](_0x3c1dec);}}}catch(_0x57d3ed){logger[_0x3745('0x3b')]('[syncAgentComplete][VoiceQueueReport]',util[_0x3745('0x41')](_0x57d3ed,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x24')]=function(_0x4d8c9e){try{if(this['isNotNull'](_0x4d8c9e)){this['addVariable'](_0x4d8c9e[_0x3745('0x69')],_[_0x3745('0x93')](_0x4d8c9e['variable'])[0x0],_0x4d8c9e[_0x3745('0x94')]);if(this[_0x3745('0x12')][_0x4d8c9e[_0x3745('0x69')]]){var _0x42d9ba=_[_0x3745('0x73')](this['queueReports'][_0x4d8c9e['uniqueid']]);if(_0x42d9ba){if(this[_0x3745('0x60')](_0x4d8c9e[_0x3745('0x95')])&&this[_0x3745('0x60')](_0x4d8c9e[_0x3745('0x95')]['queuestatus'])){switch(_0x4d8c9e[_0x3745('0x94')]){case _0x3745('0x96'):_0x42d9ba['queuecallerexit']=![];_0x42d9ba['queuecallerexitAt']=null;break;case'TIMEOUT':_0x42d9ba['lastevent']=_0x3745('0x97');ami[_0x3745('0x42')](_0x3745('0x98'),_0x42d9ba);break;default:_0x42d9ba['queuecallerexit']=!![];_0x42d9ba[_0x3745('0x85')]=moment()[_0x3745('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x42d9ba[_0x3745('0x99')]=moment()[_0x3745('0x44')](_0x3745('0x6b'));}_0x42d9ba['queuecallerabandon']=![];_0x42d9ba[_0x3745('0x77')]=null;_0x42d9ba[_0x3745('0x78')]=_0x4d8c9e[_0x3745('0x94')];this[_0x3745('0x14')][_0x4d8c9e['uniqueid']]=_0x42d9ba;this[_0x3745('0x7a')](_0x42d9ba);}else if(this[_0x3745('0x60')](_0x4d8c9e[_0x3745('0x95')])&&this['isNotNull'](_0x4d8c9e['variable']['queueposition'])){if(!_0x42d9ba['queuecallerabandon']){_0x42d9ba[_0x3745('0x84')]=!![];_0x42d9ba[_0x3745('0x85')]=moment()[_0x3745('0x44')](_0x3745('0x6b'));_0x42d9ba[_0x3745('0x78')]=_0x3745('0x9a');_0x42d9ba[_0x3745('0x99')]=moment()[_0x3745('0x44')](_0x3745('0x6b'));this[_0x3745('0x14')][_0x4d8c9e[_0x3745('0x69')]]=_0x42d9ba;}}_0x42d9ba[_0x3745('0x18')]=this[_0x3745('0x18')][_0x4d8c9e[_0x3745('0x69')]];}}}}catch(_0x16ac29){logger[_0x3745('0x3b')]('[syncVarSet][VoiceQueueReport]',util[_0x3745('0x41')](_0x16ac29,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3745('0xd')][_0x3745('0x9b')]=function(_0x5e4308,_0x209f09,_0x1d1958){var _0xfcffaa=[_0x3745('0x9c'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x3745('0x9d'),_0x3745('0x9e'),_0x3745('0x9f'),_0x3745('0xa0'),_0x3745('0xa1'),_0x3745('0xa2'),'sipuri',_0x3745('0xa3'),_0x3745('0xa4'),_0x3745('0xa5'),_0x3745('0xa6'),_0x3745('0xa7'),_0x3745('0xa8'),_0x3745('0x83'),_0x3745('0xa9'),_0x3745('0xaa')];if(!_[_0x3745('0x35')](_0x209f09)&&!_[_0x3745('0xab')](_0xfcffaa,_0x209f09)){if(_['isUndefined'](this[_0x3745('0x18')][_0x5e4308])){this['variables'][_0x5e4308]={};}this[_0x3745('0x18')][_0x5e4308][_0x209f09]=_0x1d1958;}};VoiceQueueReport[_0x3745('0xd')][_0x3745('0xac')]=function(_0x1ceda5){try{if(this[_0x3745('0x60')](_0x1ceda5)){if(this['queueReports'][_0x1ceda5[_0x3745('0x69')]]){for(var _0x184dfc=0x0,_0x329ceb={};_0x184dfc0x0?_0x28d957:0x0;this['voiceQueues'][_0x3cb27b[_0x04a8('0x61')]][_0x04a8('0x31')]=this['voiceQueues'][_0x3cb27b[_0x04a8('0x61')]][_0x04a8('0x31')]>_[_0x04a8('0x62')](_0x3cb27b[_0x04a8('0x64')])?_[_0x04a8('0x62')](_0x3cb27b['loggedin']):this[_0x04a8('0x11')][_0x3cb27b['queue']][_0x04a8('0x31')];this['emitVoiceQueueSummary'](this[_0x04a8('0x11')][_0x3cb27b['queue']]);}ami['emit'](_0x04a8('0x65'),this[_0x04a8('0x11')][_0x3cb27b['queue']]);}}}catch(_0x53baf6){logger[_0x04a8('0x3f')](_0x04a8('0x66'),util[_0x04a8('0x42')](_0x53baf6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x04a8('0x67')]=function(_0xcba69c){this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x04a8('0x68')]=function(_0x3b53a4){};VoiceQueueReport[_0x04a8('0x35')][_0x04a8('0x19')]=function(_0x158db3){try{if(this[_0x04a8('0x60')](_0x158db3)){if(_[_0x04a8('0x2d')](this[_0x04a8('0xd')][_0x158db3[_0x04a8('0x69')]])){this[_0x04a8('0xd')][_0x158db3['uniqueid']]=[];this[_0x04a8('0xf')][_0x158db3[_0x04a8('0x69')]]={};}var _0x2b9293=new QueueReport();_0x2b9293[_0x04a8('0x4e')]=_0x158db3['queue'];_0x2b9293[_0x04a8('0x4c')]=this[_0x04a8('0x11')][_0x2b9293[_0x04a8('0x4e')]]&&this['voiceQueues'][_0x2b9293[_0x04a8('0x4e')]]['type']?this['voiceQueues'][_0x2b9293[_0x04a8('0x4e')]]['type']||_0x04a8('0x4d'):_0x04a8('0x4d');_0x2b9293[_0x04a8('0x61')]=_0x158db3[_0x04a8('0x61')];_0x2b9293[_0x04a8('0x6a')]=moment()[_0x04a8('0x45')](_0x04a8('0x6b'));_0x2b9293[_0x04a8('0x6c')]=_0x158db3[_0x04a8('0x6c')];_0x2b9293[_0x04a8('0x6d')]=_0x158db3[_0x04a8('0x6d')];_['merge'](_0x2b9293,_[_0x04a8('0x6e')](_0x158db3,_[_0x04a8('0x6f')](_0x2b9293)));this['queueReports'][_0x158db3[_0x04a8('0x69')]]['push'](_0x2b9293);this['channels'][_0x158db3[_0x04a8('0x69')]]=_0x2b9293;this['emitVoiceQueueChannelSave'](_0x2b9293);}}catch(_0x3722fd){logger[_0x04a8('0x3f')](_0x04a8('0x70'),util[_0x04a8('0x42')](_0x3722fd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x04a8('0x35')][_0x04a8('0x1b')]=function(_0x2a0fbc){try{if(this[_0x04a8('0x60')](_0x2a0fbc)){if(this['queueReports'][_0x2a0fbc[_0x04a8('0x69')]]){var _0xb539fc=_[_0x04a8('0x71')](this[_0x04a8('0xd')][_0x2a0fbc[_0x04a8('0x69')]]);_0xb539fc[_0x04a8('0x72')]=![];_0xb539fc[_0x04a8('0x73')]=null;_0xb539fc[_0x04a8('0x74')]=_0x2a0fbc[_0x04a8('0x74')];_0xb539fc[_0x04a8('0x75')]=_0x2a0fbc['originalposition'];_0xb539fc[_0x04a8('0x1a')]=!![];_0xb539fc['queuecallerabandonAt']=moment()['format'](_0x04a8('0x6b'));_0xb539fc[_0x04a8('0x76')]=_0x04a8('0x77');_0xb539fc['lastAssignedTo']=null;this[_0x04a8('0xf')][_0x2a0fbc[_0x04a8('0x69')]]=_0xb539fc;this[_0x04a8('0x41')](_0xb539fc);}}}catch(_0x157759){logger[_0x04a8('0x3f')](_0x04a8('0x78'),util[_0x04a8('0x42')](_0x157759,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x04a8('0x35')]['syncQueueCallerLeave']=function(_0x16706a){try{if(this[_0x04a8('0x60')](_0x16706a)){if(this[_0x04a8('0xd')][_0x16706a[_0x04a8('0x69')]]){var _0x29d0dd=_[_0x04a8('0x71')](this[_0x04a8('0xd')][_0x16706a[_0x04a8('0x69')]]);_0x29d0dd[_0x04a8('0x79')]=moment()[_0x04a8('0x45')](_0x04a8('0x6b'));_0x29d0dd[_0x04a8('0x7a')]=_0x16706a['connectedlinenum'];_0x29d0dd['connectedlinename']=_0x16706a[_0x04a8('0x7b')];this[_0x04a8('0xf')][_0x16706a['uniqueid']]=_0x29d0dd;this[_0x04a8('0x44')](_0x29d0dd);}}}catch(_0xaa5e8e){logger[_0x04a8('0x3f')](_0x04a8('0x7c'),util[_0x04a8('0x42')](_0xaa5e8e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x04a8('0x20')]=function(_0x2cf345){try{if(this[_0x04a8('0x60')](_0x2cf345)){if(this[_0x04a8('0xd')][_0x2cf345['uniqueid']]){var _0x4764bc=_[_0x04a8('0x71')](this['queueReports'][_0x2cf345[_0x04a8('0x69')]]);_0x4764bc[_0x04a8('0x72')]=!![];_0x4764bc[_0x04a8('0x76')]='COMPLETEDBYAGENT';}}}catch(_0x2de7a7){logger['error'](_0x04a8('0x7d'),util['inspect'](_0x2de7a7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x21f1f9){try{if(this[_0x04a8('0x60')](_0x21f1f9)){if(this[_0x04a8('0xd')][_0x21f1f9[_0x04a8('0x69')]]){var _0x392cac=_[_0x04a8('0x71')](this[_0x04a8('0xd')][_0x21f1f9['uniqueid']]);_0x392cac[_0x04a8('0x1a')]=![];_0x392cac[_0x04a8('0x7e')]=null;_0x392cac[_0x04a8('0x7f')]=!![];_0x392cac[_0x04a8('0x80')]=_0x21f1f9[_0x04a8('0x81')];_0x392cac[_0x04a8('0x74')]=_0x21f1f9[_0x04a8('0x74')];_0x392cac[_0x04a8('0x72')]=!![];_0x392cac[_0x04a8('0x82')]=![];_0x392cac[_0x04a8('0x83')]=null;if(!_0x392cac[_0x04a8('0x84')]){if(_0x21f1f9['reason']=='transfer'){_0x392cac[_0x04a8('0x76')]=_0x04a8('0x85');}else{if(_[_0x04a8('0x86')](_0x21f1f9[_0x04a8('0x39')][_0x04a8('0x87')](),_0x04a8('0x88'))){if(this[_0x04a8('0xd')][_0x21f1f9[_0x04a8('0x89')]]){var _0x2240f1=_[_0x04a8('0x71')](this['queueReports'][_0x21f1f9[_0x04a8('0x89')]]);_0x2240f1['queuecallercomplete']=![];_0x2240f1[_0x04a8('0x82')]=!![];_0x2240f1[_0x04a8('0x83')]=moment(_0x392cac[_0x04a8('0x6a')])[_0x04a8('0x8a')](_0x21f1f9[_0x04a8('0x74')],_0x04a8('0x8b'))[_0x04a8('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x2240f1[_0x04a8('0x76')]='FORWARDTRANSFER';_0x2240f1[_0x04a8('0x84')]=!![];_0x2240f1[_0x04a8('0x8c')]=_0x04a8('0x8d');_0x2240f1[_0x04a8('0x8e')]=_0x21f1f9[_0x04a8('0x8f')];_0x2240f1[_0x04a8('0x90')]=_0x21f1f9[_0x04a8('0x69')];var _0x4c28ae=this[_0x04a8('0xd')][_0x21f1f9['linkedid']];this[_0x04a8('0xd')][_0x21f1f9[_0x04a8('0x89')]]=this[_0x04a8('0xd')][_0x21f1f9[_0x04a8('0x69')]];this['queueReports'][_0x21f1f9[_0x04a8('0x69')]]=_0x4c28ae;}}else{_0x392cac['queuecallerexitreason']=_0x04a8('0x91')+_0x21f1f9['reason'][_0x04a8('0x92')]();}}}this[_0x04a8('0xf')][_0x21f1f9[_0x04a8('0x69')]]=_0x392cac;this['emitVoiceQueueChannelRemove'](_0x392cac);}}}catch(_0x113d36){logger['error'](_0x04a8('0x93'),util[_0x04a8('0x42')](_0x113d36,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x04a8('0x94')]=function(_0x5c4a1a){try{if(this[_0x04a8('0x60')](_0x5c4a1a)){this['addVariable'](_0x5c4a1a['uniqueid'],_[_0x04a8('0x6f')](_0x5c4a1a[_0x04a8('0x95')])[0x0],_0x5c4a1a[_0x04a8('0x96')]);if(this['queueReports'][_0x5c4a1a[_0x04a8('0x69')]]){var _0x3232b8=_['last'](this[_0x04a8('0xd')][_0x5c4a1a[_0x04a8('0x69')]]);if(_0x3232b8){if(this[_0x04a8('0x60')](_0x5c4a1a[_0x04a8('0x95')])&&this[_0x04a8('0x60')](_0x5c4a1a[_0x04a8('0x95')]['queuestatus'])){switch(_0x5c4a1a[_0x04a8('0x96')]){case'CONTINUE':_0x3232b8[_0x04a8('0x82')]=![];_0x3232b8[_0x04a8('0x83')]=null;break;case _0x04a8('0x97'):_0x3232b8[_0x04a8('0x98')]=_0x04a8('0x99');ami[_0x04a8('0x43')](_0x04a8('0x9a'),_0x3232b8);break;default:_0x3232b8[_0x04a8('0x82')]=!![];_0x3232b8[_0x04a8('0x83')]=moment()[_0x04a8('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x3232b8[_0x04a8('0x79')]=moment()['format'](_0x04a8('0x6b'));}_0x3232b8[_0x04a8('0x1a')]=![];_0x3232b8[_0x04a8('0x7e')]=null;_0x3232b8['queuecallerexitreason']=_0x5c4a1a[_0x04a8('0x96')];this[_0x04a8('0xf')][_0x5c4a1a[_0x04a8('0x69')]]=_0x3232b8;this['emitVoiceQueueChannelRemove'](_0x3232b8);}else if(this[_0x04a8('0x60')](_0x5c4a1a[_0x04a8('0x95')])&&this[_0x04a8('0x60')](_0x5c4a1a[_0x04a8('0x95')][_0x04a8('0x9b')])){if(!_0x3232b8[_0x04a8('0x1a')]){_0x3232b8[_0x04a8('0x82')]=!![];_0x3232b8[_0x04a8('0x83')]=moment()[_0x04a8('0x45')](_0x04a8('0x6b'));_0x3232b8[_0x04a8('0x76')]=_0x04a8('0x9c');_0x3232b8['queuecallerleaveAt']=moment()[_0x04a8('0x45')](_0x04a8('0x6b'));this['channels'][_0x5c4a1a[_0x04a8('0x69')]]=_0x3232b8;}}_0x3232b8[_0x04a8('0x14')]=this['variables'][_0x5c4a1a[_0x04a8('0x69')]];}}}}catch(_0x39b156){logger[_0x04a8('0x3f')](_0x04a8('0x9d'),util[_0x04a8('0x42')](_0x39b156,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x04a8('0x35')][_0x04a8('0x9e')]=function(_0x10562a,_0x25c8d9,_0x161c5f){var _0x1c03a9=['rtpaudioqos',_0x04a8('0x9f'),_0x04a8('0xa0'),_0x04a8('0xa1'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x04a8('0xa2'),_0x04a8('0xa3'),'sipcallid','sipuri','bridgepeer',_0x04a8('0xa4'),_0x04a8('0xa5'),_0x04a8('0xa6'),_0x04a8('0xa7'),_0x04a8('0xa8'),'membername','memberpenalty','memberrealtime'];if(!_[_0x04a8('0x37')](_0x25c8d9)&&!_['includes'](_0x1c03a9,_0x25c8d9)){if(_[_0x04a8('0x2d')](this[_0x04a8('0x14')][_0x10562a])){this['variables'][_0x10562a]={};}this[_0x04a8('0x14')][_0x10562a][_0x25c8d9]=_0x161c5f;}};VoiceQueueReport[_0x04a8('0x35')][_0x04a8('0x23')]=function(_0xb71e26){try{if(this[_0x04a8('0x60')](_0xb71e26)){if(this[_0x04a8('0xd')][_0xb71e26[_0x04a8('0x69')]]){for(var _0x4d2c35=0x0,_0x90b223={};_0x4d2c35=0x0?moment(_0x44f162[_0x0b11('0x1a')])[_0x0b11('0xd')](_0x44f162[_0x0b11('0x19')],'seconds'):null,'data1':_0x0b11('0x1b'),'data2':_0x44f162[_0x0b11('0x14')],'data3':_0x44f162[_0x0b11('0x11')],'data4':_0x44f162[_0x0b11('0x1c')]||null,'role':_0x0b11('0x13'),'internal':_0x44f162[_0x0b11('0x14')]?_[_0x0b11('0x15')](_0x44f162[_0x0b11('0x14')]):undefined,'uniqueid':_0x44f162[_0x0b11('0x16')]},'log':_0x0b11('0x6')});};
\ No newline at end of file
+var _0x6b48=['endtime','starttime','outbound','accountcode','dialstring','agent','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','toNumber','uniqueid','membername'];(function(_0x4def54,_0x36de1d){var _0x137bee=function(_0x1dd6f4){while(--_0x1dd6f4){_0x4def54['push'](_0x4def54['shift']());}};_0x137bee(++_0x36de1d);}(_0x6b48,0xe6));var _0x86b4=function(_0x217ce7,_0x592574){_0x217ce7=_0x217ce7-0x0;var _0x4d3f53=_0x6b48[_0x217ce7];return _0x4d3f53;};'use strict';var moment=require('moment');var _=require(_0x86b4('0x0'));var util=require('util');var client=require(_0x86b4('0x1'));exports[_0x86b4('0x2')]=function(_0x12182b){var _0x249a82=_0x12182b[_0x86b4('0x3')]||_0x12182b[_0x86b4('0x4')];return client[_0x86b4('0x5')](_0x86b4('0x6'),{'body':{'channel':_0x86b4('0x7'),'membername':_0x12182b[_0x86b4('0x8')],'interface':_[_0x86b4('0x9')](_0x12182b[_0x86b4('0xa')])?util['format'](_0x86b4('0xb'),_0x12182b[_0x86b4('0x8')]):_0x12182b['interface'],'type':_0x86b4('0xc'),'enterAt':_0x12182b[_0x86b4('0xd')],'exitAt':_0x249a82,'duration':moment(_0x249a82)[_0x86b4('0xe')](_0x12182b[_0x86b4('0xd')],_0x86b4('0xf')),'data1':_0x86b4('0x10'),'data2':_0x12182b[_0x86b4('0x11')],'data3':_0x12182b[_0x86b4('0x12')],'data4':null,'data5':_0x12182b['queue'],'role':'agent','internal':_0x12182b['accountcode']?_[_0x86b4('0x13')](_0x12182b['accountcode']):undefined,'uniqueid':_0x12182b[_0x86b4('0x14')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x550715){return client[_0x86b4('0x5')]('CreateMemberReport',{'body':{'channel':_0x86b4('0x7'),'membername':_0x550715[_0x86b4('0x15')],'interface':_0x550715[_0x86b4('0xa')],'type':_0x86b4('0xc'),'enterAt':_0x550715['starttime'],'exitAt':_0x550715[_0x86b4('0x16')],'duration':moment(_0x550715['endtime'])[_0x86b4('0xe')](_0x550715[_0x86b4('0x17')],_0x86b4('0xf'))>=0x0?moment(_0x550715['endtime'])[_0x86b4('0xe')](_0x550715[_0x86b4('0x17')],_0x86b4('0xf')):null,'data1':_0x86b4('0x18'),'data2':_0x550715[_0x86b4('0x19')],'data3':_0x550715[_0x86b4('0x12')],'data4':_0x550715[_0x86b4('0x1a')]||null,'role':_0x86b4('0x1b'),'internal':_0x550715[_0x86b4('0x19')]?_[_0x86b4('0x13')](_0x550715[_0x86b4('0x19')]):undefined,'uniqueid':_0x550715[_0x86b4('0x14')]},'log':_0x86b4('0x6')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js
index f2a1556..afb7559 100644
--- a/server/services/ami/rpc/template.js
+++ b/server/services/ami/rpc/template.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xad8a=['html','GetTemplate','../client','getTemplates','Request','name'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xad8a,0xb0));var _0xaad8=function(_0x55a496,_0x12a0a3){_0x55a496=_0x55a496-0x0;var _0x57fb12=_0xad8a[_0x55a496];return _0x57fb12;};'use strict';var client=require(_0xaad8('0x0'));exports[_0xaad8('0x1')]=function(_0x6efdc8){return function(_0xa8be63){return client[_0xaad8('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xaad8('0x3'),_0xaad8('0x4')]},'log':_0xaad8('0x5')});};};
\ No newline at end of file
+var _0xd523=['getTemplates','GetTemplate','name','html','../client'];(function(_0x4c7d15,_0x340137){var _0x5bf5e9=function(_0x547b8d){while(--_0x547b8d){_0x4c7d15['push'](_0x4c7d15['shift']());}};_0x5bf5e9(++_0x340137);}(_0xd523,0x153));var _0x3d52=function(_0xffef10,_0x3b6ddf){_0xffef10=_0xffef10-0x0;var _0x321b85=_0xd523[_0xffef10];return _0x321b85;};'use strict';var client=require(_0x3d52('0x0'));exports[_0x3d52('0x1')]=function(_0x3d35b0){return function(_0x3fcfcb){return client['Request'](_0x3d52('0x2'),{'options':{'raw':!![],'attributes':['id',_0x3d52('0x3'),_0x3d52('0x4')]},'log':'GetTemplate'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js
index 3c18e02..e618c9b 100644
--- a/server/services/ami/rpc/trigger.js
+++ b/server/services/ami/rpc/trigger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb74b=['getTriggers','Request','GetTrigger','name','field','operator','value','Condition','Action','Actions','action','data1','data2','data5','data6','data7','../client'];(function(_0x9c9660,_0x523234){var _0x35913e=function(_0x520f64){while(--_0x520f64){_0x9c9660['push'](_0x9c9660['shift']());}};_0x35913e(++_0x523234);}(_0xb74b,0x142));var _0xbb74=function(_0x4a7b2b,_0x3366e1){_0x4a7b2b=_0x4a7b2b-0x0;var _0x35e381=_0xb74b[_0x4a7b2b];return _0x35e381;};'use strict';var client=require(_0xbb74('0x0'));exports[_0xbb74('0x1')]=function(_0x96999a){return function(_0x399ca2){return client[_0xbb74('0x2')](_0xbb74('0x3'),{'options':{'raw':![],'attributes':['id',_0xbb74('0x4'),'channel','status'],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xbb74('0x5'),_0xbb74('0x6'),_0xbb74('0x7')]},{'model':_0xbb74('0x8'),'as':'AnyConditions','attributes':['id','field','operator',_0xbb74('0x7')]},{'model':_0xbb74('0x9'),'as':_0xbb74('0xa'),'attributes':['id',_0xbb74('0xb'),_0xbb74('0xc'),_0xbb74('0xd'),'data3','data4',_0xbb74('0xe'),_0xbb74('0xf'),_0xbb74('0x10')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0x36a8=['AllConditions','field','operator','value','Action','Actions','data1','data2','data3','data4','data6','../client','GetTrigger','name','channel','Condition'];(function(_0x4bbcc1,_0x594e19){var _0x34435b=function(_0x124582){while(--_0x124582){_0x4bbcc1['push'](_0x4bbcc1['shift']());}};_0x34435b(++_0x594e19);}(_0x36a8,0xab));var _0x836a=function(_0x2ceb31,_0x40ecf1){_0x2ceb31=_0x2ceb31-0x0;var _0x168859=_0x36a8[_0x2ceb31];return _0x168859;};'use strict';var client=require(_0x836a('0x0'));exports['getTriggers']=function(_0x2a5bd9){return function(_0x30422b){return client['Request'](_0x836a('0x1'),{'options':{'raw':![],'attributes':['id',_0x836a('0x2'),_0x836a('0x3'),'status'],'include':[{'model':_0x836a('0x4'),'as':_0x836a('0x5'),'attributes':['id',_0x836a('0x6'),_0x836a('0x7'),_0x836a('0x8')]},{'model':'Condition','as':'AnyConditions','attributes':['id','field',_0x836a('0x7'),_0x836a('0x8')]},{'model':_0x836a('0x9'),'as':_0x836a('0xa'),'attributes':['id','action',_0x836a('0xb'),_0x836a('0xc'),_0x836a('0xd'),_0x836a('0xe'),'data5',_0x836a('0xf'),'data7']}]},'log':_0x836a('0x1')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js
index a96835a..64fc0a1 100644
--- a/server/services/ami/rpc/trunk.js
+++ b/server/services/ami/rpc/trunk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7664=['name','registry','getTrunks','GetTrunk'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x7664,0xb6));var _0x4766=function(_0x3d3015,_0x5d4ae3){_0x3d3015=_0x3d3015-0x0;var _0x44b59f=_0x7664[_0x3d3015];return _0x44b59f;};'use strict';var client=require('../client');exports[_0x4766('0x0')]=function(_0x2ae3a3){return function(_0x5c4b14){return client['Request'](_0x4766('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4766('0x2'),_0x4766('0x3')]},'log':_0x4766('0x1')});};};
\ No newline at end of file
+var _0xf209=['Request','GetTrunk','name','registry'];(function(_0x30fc63,_0x456284){var _0x43d2ce=function(_0x1800a8){while(--_0x1800a8){_0x30fc63['push'](_0x30fc63['shift']());}};_0x43d2ce(++_0x456284);}(_0xf209,0x68));var _0x9f20=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0xf209[_0x1d04b5];return _0x161342;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x50b6ab){return function(_0x1405e0){return client[_0x9f20('0x0')](_0x9f20('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9f20('0x2'),_0x9f20('0x3')]},'log':_0x9f20('0x1')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js
index 7c8b172..058ef16 100644
--- a/server/services/ami/rpc/user.js
+++ b/server/services/ami/rpc/user.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b7f=['lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','saveUnpause','getAgent','voicePause','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType'];(function(_0x237b3b,_0x591f4b){var _0x48a55d=function(_0x2b5afa){while(--_0x2b5afa){_0x237b3b['push'](_0x237b3b['shift']());}};_0x48a55d(++_0x591f4b);}(_0x9b7f,0x121));var _0xf9b7=function(_0x3e6108,_0x2b73c0){_0x3e6108=_0x3e6108-0x0;var _0x2bb0bb=_0x9b7f[_0x3e6108];return _0x2bb0bb;};'use strict';var client=require(_0xf9b7('0x0'));exports[_0xf9b7('0x1')]=function(){return function(){return client[_0xf9b7('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0xf9b7('0x3')},'attributes':['id',_0xf9b7('0x4'),_0xf9b7('0x5'),_0xf9b7('0x6'),_0xf9b7('0x7'),_0xf9b7('0x8'),_0xf9b7('0x9'),_0xf9b7('0xa'),_0xf9b7('0xb'),'voicePause','phone','mobile',_0xf9b7('0xc')]},'log':'getAgents'});};};exports[_0xf9b7('0xd')]=function(){return function(){return client[_0xf9b7('0x2')](_0xf9b7('0xe'),{'options':{'raw':!![],'where':{'role':_0xf9b7('0xf')},'attributes':['id','name',_0xf9b7('0x6'),'internal']},'log':'getTelephones'});};};exports[_0xf9b7('0x10')]=function(_0x45aa1b,_0x593e45,_0x2cb1da){return client[_0xf9b7('0x2')]('PauseUser',{'body':{'type':_0x593e45,'uniqueid':_0x2cb1da},'options':{'where':{'id':_0x45aa1b['id']}},'log':_0xf9b7('0x10')});};exports[_0xf9b7('0x11')]=function(_0x5ce795){return client['Request']('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5ce795['id']}},'log':_0xf9b7('0x10')});};exports[_0xf9b7('0x12')]=function(_0x2ac03d){return client[_0xf9b7('0x2')]('ShowUser',{'options':{'raw':![],'where':{'role':_0xf9b7('0x3'),'id':_0x2ac03d},'attributes':['id','name',_0xf9b7('0x5'),_0xf9b7('0x6'),_0xf9b7('0x7'),_0xf9b7('0x8'),_0xf9b7('0x9'),_0xf9b7('0xa'),'lastPauseAt',_0xf9b7('0x13'),_0xf9b7('0xc')]},'log':_0xf9b7('0x12')});};
\ No newline at end of file
+var _0x6245=['online','pauseType','lastPauseAt','phone','interface','getTelephones','telephone','internal','PauseUser','savePause','UnpauseUser','ShowUser','email','lastLoginAt','voicePause','../client','getAgents','Request','GetUser','agent','name','accountcode','fullname'];(function(_0x5308fc,_0x55d19b){var _0x43aa48=function(_0x3011ea){while(--_0x3011ea){_0x5308fc['push'](_0x5308fc['shift']());}};_0x43aa48(++_0x55d19b);}(_0x6245,0x1db));var _0x5624=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0x6245[_0x83af7f];return _0x32d85c;};'use strict';var client=require(_0x5624('0x0'));exports[_0x5624('0x1')]=function(){return function(){return client[_0x5624('0x2')](_0x5624('0x3'),{'options':{'raw':![],'where':{'role':_0x5624('0x4')},'attributes':['id',_0x5624('0x5'),'email',_0x5624('0x6'),_0x5624('0x7'),_0x5624('0x8'),'lastLoginAt',_0x5624('0x9'),_0x5624('0xa'),'voicePause',_0x5624('0xb'),'mobile',_0x5624('0xc')]},'log':_0x5624('0x1')});};};exports[_0x5624('0xd')]=function(){return function(){return client['Request'](_0x5624('0x3'),{'options':{'raw':!![],'where':{'role':_0x5624('0xe')},'attributes':['id','name',_0x5624('0x6'),_0x5624('0xf')]},'log':_0x5624('0xd')});};};exports['savePause']=function(_0x4efe9e,_0x123d13,_0xbc0aa4){return client[_0x5624('0x2')](_0x5624('0x10'),{'body':{'type':_0x123d13,'uniqueid':_0xbc0aa4},'options':{'where':{'id':_0x4efe9e['id']}},'log':_0x5624('0x11')});};exports['saveUnpause']=function(_0x51e417){return client['Request'](_0x5624('0x12'),{'body':{},'options':{'where':{'id':_0x51e417['id']}},'log':_0x5624('0x11')});};exports['getAgent']=function(_0x27f7a7){return client[_0x5624('0x2')](_0x5624('0x13'),{'options':{'raw':![],'where':{'role':_0x5624('0x4'),'id':_0x27f7a7},'attributes':['id','name',_0x5624('0x14'),_0x5624('0x6'),_0x5624('0x7'),_0x5624('0x8'),_0x5624('0x15'),_0x5624('0x9'),'lastPauseAt',_0x5624('0x16'),_0x5624('0xc')]},'log':'getAgent'});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js
index 0272660..eb3ecd8 100644
--- a/server/services/ami/rpc/voiceAgentReport.js
+++ b/server/services/ami/rpc/voiceAgentReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5aec=['create','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x153f52,_0x15100e){var _0x7d14eb=function(_0x279676){while(--_0x279676){_0x153f52['push'](_0x153f52['shift']());}};_0x7d14eb(++_0x15100e);}(_0x5aec,0xe8));var _0xc5ae=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x5aec[_0x45d55e];return _0x29812a;};'use strict';var client=require('../client');exports[_0xc5ae('0x0')]=function(_0xfdfa4b){return client['Request'](_0xc5ae('0x1'),{'body':_0xfdfa4b,'log':'CreateVoiceAgentReport'});};exports[_0xc5ae('0x2')]=function(_0x91a4de,_0xfc3ef7,_0x3a2134){return client['Request'](_0xc5ae('0x3'),{'body':_0x91a4de,'options':{'where':{'uniqueid':_0xfc3ef7,'interface':_0x3a2134,'agentcomplete':!![]}},'log':_0xc5ae('0x3')});};
\ No newline at end of file
+var _0xeaab=['Request','CreateVoiceAgentReport','create'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0xeaab,0x83));var _0xbeaa=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xeaab[_0x432682];return _0x463d05;};'use strict';var client=require('../client');exports[_0xbeaa('0x0')]=function(_0x2f5641){return client[_0xbeaa('0x1')](_0xbeaa('0x2'),{'body':_0x2f5641,'log':_0xbeaa('0x2')});};exports['update']=function(_0x3dd5f5,_0x266fae,_0x47e5d1){return client['Request']('UpdateVoiceAgentReport',{'body':_0x3dd5f5,'options':{'where':{'uniqueid':_0x266fae,'interface':_0x47e5d1,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js
index 10c8048..841714d 100644
--- a/server/services/ami/rpc/voiceCallReport.js
+++ b/server/services/ami/rpc/voiceCallReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaebe=['DOCUMENTATION','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context'];(function(_0x2037d3,_0x1d4141){var _0x504c96=function(_0xf0fc28){while(--_0xf0fc28){_0x2037d3['push'](_0x2037d3['shift']());}};_0x504c96(++_0x1d4141);}(_0xaebe,0xa2));var _0xeaeb=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xaebe[_0x160c73];return _0xd9302;};'use strict';var moment=require(_0xeaeb('0x0'));var util=require(_0xeaeb('0x1'));var _=require('lodash');var client=require(_0xeaeb('0x2'));exports[_0xeaeb('0x3')]=function(_0x5c77a5){return client[_0xeaeb('0x4')](_0xeaeb('0x5'),{'body':_[_0xeaeb('0x6')](_0x5c77a5,{'source':_0x5c77a5[_0xeaeb('0x7')],'destinationcontext':_0x5c77a5[_0xeaeb('0x8')],'callerid':_0x5c77a5['callerid'],'amaflags':_0xeaeb('0x9')}),'log':_0xeaeb('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0xeaeb('0xa'),{'options':{'where':{'type':[_0xeaeb('0xb')],'createdAt':{'$between':[moment()['startOf'](_0xeaeb('0xc'))[_0xeaeb('0xd')](_0xeaeb('0xe')),moment()[_0xeaeb('0xf')](_0xeaeb('0xc'))[_0xeaeb('0xd')](_0xeaeb('0xe'))]}},'attributes':[_0xeaeb('0x10'),_0xeaeb('0x11'),'duration','billableseconds']},'log':_0xeaeb('0x12')});};};
\ No newline at end of file
+var _0x53dc=['endOf','day','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xd3cec8,_0x5a35c5){var _0x4bc05e=function(_0x575890){while(--_0x575890){_0xd3cec8['push'](_0xd3cec8['shift']());}};_0x4bc05e(++_0x5a35c5);}(_0x53dc,0x151));var _0xc53d=function(_0x490222,_0x415152){_0x490222=_0x490222-0x0;var _0x5d9b77=_0x53dc[_0x490222];return _0x5d9b77;};'use strict';var moment=require(_0xc53d('0x0'));var util=require(_0xc53d('0x1'));var _=require(_0xc53d('0x2'));var client=require(_0xc53d('0x3'));exports[_0xc53d('0x4')]=function(_0x173731){return client[_0xc53d('0x5')](_0xc53d('0x6'),{'body':_['merge'](_0x173731,{'source':_0x173731[_0xc53d('0x7')],'destinationcontext':_0x173731[_0xc53d('0x8')],'callerid':_0x173731[_0xc53d('0x9')],'amaflags':_0xc53d('0xa')}),'log':_0xc53d('0x6')});};exports[_0xc53d('0xb')]=function(){return function(){return client[_0xc53d('0x5')](_0xc53d('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xc53d('0xd')]('day')['format'](_0xc53d('0xe')),moment()[_0xc53d('0xf')](_0xc53d('0x10'))['format'](_0xc53d('0xe'))]}},'attributes':[_0xc53d('0x11'),_0xc53d('0x12'),_0xc53d('0x13'),_0xc53d('0x14')]},'log':_0xc53d('0x15')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js
index 1c3fc44..a0bc5d4 100644
--- a/server/services/ami/rpc/voiceDialReport.js
+++ b/server/services/ami/rpc/voiceDialReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd16d=['../client'];(function(_0x29a9f2,_0x2b0179){var _0x345df2=function(_0x4d7f8f){while(--_0x4d7f8f){_0x29a9f2['push'](_0x29a9f2['shift']());}};_0x345df2(++_0x2b0179);}(_0xd16d,0xb7));var _0xdd16=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd16d[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0xdd16('0x0'));exports['create']=function(_0x154f63){return client['Request']('CreateVoiceDialReport',{'body':_0x154f63,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
+var _0x172b=['create','Request'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0x172b,0x164));var _0xb172=function(_0x5e6493,_0x4082ea){_0x5e6493=_0x5e6493-0x0;var _0x58aafa=_0x172b[_0x5e6493];return _0x58aafa;};'use strict';var client=require('../client');exports[_0xb172('0x0')]=function(_0x4c60a7){return client[_0xb172('0x1')]('CreateVoiceDialReport',{'body':_0x4c60a7,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js
index 672e2b0..067d0f6 100644
--- a/server/services/ami/rpc/voiceExtension.js
+++ b/server/services/ami/rpc/voiceExtension.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x659e=['Request','GetVoiceExtension','recordingFormat','../client'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x659e,0x117));var _0xe659=function(_0x12cc15,_0x3d147e){_0x12cc15=_0x12cc15-0x0;var _0xcc627d=_0x659e[_0x12cc15];return _0xcc627d;};'use strict';var client=require(_0xe659('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xe659('0x1')](_0xe659('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0xe659('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
+var _0x1678=['getVoiceExtensions','Request','GetVoiceExtension','exten','../client'];(function(_0x3336b6,_0x127d4f){var _0x520cba=function(_0x568e7a){while(--_0x568e7a){_0x3336b6['push'](_0x3336b6['shift']());}};_0x520cba(++_0x127d4f);}(_0x1678,0x17b));var _0x8167=function(_0x1e6a8b,_0x56acee){_0x1e6a8b=_0x1e6a8b-0x0;var _0x232018=_0x1678[_0x1e6a8b];return _0x232018;};'use strict';var client=require(_0x8167('0x0'));exports[_0x8167('0x1')]=function(){return function(){return client[_0x8167('0x2')](_0x8167('0x3'),{'options':{'raw':!![],'attributes':['id',_0x8167('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js
index 7775034..d287fca 100644
--- a/server/services/ami/rpc/voiceQueue.js
+++ b/server/services/ami/rpc/voiceQueue.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa84f=['getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','callerid','Pause','mandatoryDispositionPause','Trunk','TrunkBackup','Interval','Intervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa84f,0xdd));var _0xfa84=function(_0xe406bc,_0x45e9af){_0xe406bc=_0xe406bc-0x0;var _0x56cbd4=_0xa84f[_0xe406bc];return _0x56cbd4;};'use strict';var client=require(_0xfa84('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xfa84('0x1')](_0xfa84('0x2'),{'options':{'raw':![],'attributes':['id',_0xfa84('0x3'),_0xfa84('0x4'),_0xfa84('0x5'),_0xfa84('0x6'),_0xfa84('0x7'),_0xfa84('0x8'),_0xfa84('0x9'),_0xfa84('0xa'),_0xfa84('0xb'),'dialLimitQueue','dialPowerLevel','dialPredictiveOptimization',_0xfa84('0xc'),_0xfa84('0xd'),_0xfa84('0xe'),_0xfa84('0xf'),'dialOriginateTimeout',_0xfa84('0x10'),_0xfa84('0x11'),'dialQueueProject',_0xfa84('0x12'),'dialCongestionRetryFrequency',_0xfa84('0x13'),'dialBusyRetryFrequency',_0xfa84('0x14'),_0xfa84('0x15'),_0xfa84('0x16'),_0xfa84('0x17'),'dialGlobalInterval',_0xfa84('0x18'),_0xfa84('0x19'),'dialAMDActive',_0xfa84('0x1a'),_0xfa84('0x1b'),_0xfa84('0x1c'),_0xfa84('0x1d'),_0xfa84('0x1e'),_0xfa84('0x1f'),_0xfa84('0x20'),'dialAMDSilenceThreshold',_0xfa84('0x21'),'timeout',_0xfa84('0x22'),_0xfa84('0x23'),'dialOrderByScheduledAt',_0xfa84('0x24'),_0xfa84('0x25'),'dialQueueProject2',_0xfa84('0x7'),_0xfa84('0x26'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xfa84('0x27'),_0xfa84('0x28'),'dialDropMaxRetry',_0xfa84('0x29'),_0xfa84('0x2a'),_0xfa84('0x2b'),'dialMachineMaxRetry',_0xfa84('0x2c'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition',_0xfa84('0x2d'),_0xfa84('0x2e')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id','name',_0xfa84('0x2f'),'active']},{'model':_0xfa84('0x30'),'as':_0xfa84('0x31'),'attributes':['id',_0xfa84('0x3')]},{'model':_0xfa84('0x32'),'as':_0xfa84('0x33'),'attributes':['id',_0xfa84('0x3'),'callerid','active']},{'model':'Interval','as':_0xfa84('0x34'),'attributes':['id',_0xfa84('0x3')],'include':[{'model':'Interval','as':_0xfa84('0x35'),'attributes':['id',_0xfa84('0x3'),'interval']}]}]},'log':_0xfa84('0x36')});};};
\ No newline at end of file
+var _0x82a9=['dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','getVoiceQueues','acw','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName'];(function(_0xe6b356,_0x499dc3){var _0x3e103d=function(_0x4693e7){while(--_0x4693e7){_0xe6b356['push'](_0xe6b356['shift']());}};_0x3e103d(++_0x499dc3);}(_0x82a9,0x11d));var _0x982a=function(_0x2cb6c3,_0x544218){_0x2cb6c3=_0x2cb6c3-0x0;var _0x1a6d60=_0x82a9[_0x2cb6c3];return _0x1a6d60;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name',_0x982a('0x0'),'acwTimeout',_0x982a('0x1'),_0x982a('0x2'),_0x982a('0x3'),'dialActive',_0x982a('0x4'),_0x982a('0x5'),'dialLimitQueue','dialPowerLevel',_0x982a('0x6'),_0x982a('0x7'),'dialPredictiveInterval',_0x982a('0x8'),'dialOriginateCallerIdNumber',_0x982a('0x9'),'dialQueueOptions',_0x982a('0xa'),_0x982a('0xb'),_0x982a('0xc'),_0x982a('0xd'),'dialBusyMaxRetry',_0x982a('0xe'),_0x982a('0xf'),_0x982a('0x10'),_0x982a('0x11'),_0x982a('0x12'),'dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive',_0x982a('0x13'),_0x982a('0x14'),_0x982a('0x15'),'dialAMDTotalAnalysisTime',_0x982a('0x16'),_0x982a('0x17'),_0x982a('0x18'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x982a('0x19'),'dialRecallMeTimeout',_0x982a('0x1a'),_0x982a('0x1b'),_0x982a('0x1c'),_0x982a('0x1d'),_0x982a('0x1e'),_0x982a('0x2'),_0x982a('0x1f'),'dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry',_0x982a('0x20'),'dialDropMaxRetry','dialDropRetryFrequency',_0x982a('0x21'),_0x982a('0x22'),'dialMachineMaxRetry',_0x982a('0x23'),'dialAgentRejectMaxRetry',_0x982a('0x24'),_0x982a('0x25'),_0x982a('0x26'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x982a('0x27'),'as':'Trunk','attributes':['id',_0x982a('0x28'),'callerid',_0x982a('0x29')]},{'model':_0x982a('0x2a'),'as':_0x982a('0x2b'),'attributes':['id',_0x982a('0x28')]},{'model':_0x982a('0x27'),'as':_0x982a('0x2c'),'attributes':['id',_0x982a('0x28'),_0x982a('0x2d'),_0x982a('0x29')]},{'model':_0x982a('0x2e'),'as':_0x982a('0x2e'),'attributes':['id','name'],'include':[{'model':_0x982a('0x2e'),'as':_0x982a('0x2f'),'attributes':['id',_0x982a('0x28'),'interval']}]}]},'log':_0x982a('0x30')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js
index 78d5d02..31eda43 100644
--- a/server/services/ami/rpc/voiceQueueReport.js
+++ b/server/services/ami/rpc/voiceQueueReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0cce=['queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','uniqueid','queue','queuecallerjoinAt'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0x0cce,0xf6));var _0xe0cc=function(_0x4a5760,_0x134c15){_0x4a5760=_0x4a5760-0x0;var _0x2994b=_0x0cce[_0x4a5760];return _0x2994b;};'use strict';var moment=require(_0xe0cc('0x0'));var _=require(_0xe0cc('0x1'));var client=require(_0xe0cc('0x2'));exports[_0xe0cc('0x3')]=function(_0x4b6ded){return client[_0xe0cc('0x4')](_0xe0cc('0x5'),{'body':_0x4b6ded,'log':_0xe0cc('0x5')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0xe0cc('0x4')](_0xe0cc('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0xe0cc('0x7')](_0xe0cc('0x8')),moment()[_0xe0cc('0x9')](_0xe0cc('0xa'))[_0xe0cc('0x7')](_0xe0cc('0x8'))]}},'attributes':[_0xe0cc('0xb'),_0xe0cc('0xc'),_0xe0cc('0xd'),_0xe0cc('0xe'),_0xe0cc('0xf'),_0xe0cc('0x10'),'queuecallerexit',_0xe0cc('0x11'),'queuecallerabandon',_0xe0cc('0x12')]},'log':_0xe0cc('0x13')});};};
\ No newline at end of file
+var _0x60df=['lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','moment'];(function(_0x38bf1e,_0x225fbd){var _0x3b7d85=function(_0x5a87bc){while(--_0x5a87bc){_0x38bf1e['push'](_0x38bf1e['shift']());}};_0x3b7d85(++_0x225fbd);}(_0x60df,0x117));var _0xf60d=function(_0x467dbb,_0x25ccd2){_0x467dbb=_0x467dbb-0x0;var _0x340dd1=_0x60df[_0x467dbb];return _0x340dd1;};'use strict';var moment=require(_0xf60d('0x0'));var _=require(_0xf60d('0x1'));var client=require(_0xf60d('0x2'));exports[_0xf60d('0x3')]=function(_0x3a131f){return client[_0xf60d('0x4')](_0xf60d('0x5'),{'body':_0x3a131f,'log':_0xf60d('0x5')});};exports[_0xf60d('0x6')]=function(){return function(){return client[_0xf60d('0x4')](_0xf60d('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xf60d('0x8'))[_0xf60d('0x9')](_0xf60d('0xa')),moment()[_0xf60d('0xb')](_0xf60d('0x8'))['format'](_0xf60d('0xa'))]}},'attributes':[_0xf60d('0xc'),_0xf60d('0xd'),_0xf60d('0xe'),_0xf60d('0xf'),'queuecallercomplete',_0xf60d('0x10'),'queuecallerexit',_0xf60d('0x11'),_0xf60d('0x12'),'queuecallerabandonAt']},'log':_0xf60d('0x13')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js
index 342e174..8f7bbc3 100644
--- a/server/services/ami/rpc/voiceQueueRt.js
+++ b/server/services/ami/rpc/voiceQueueRt.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb61b=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x4e8f0c,_0x1a6ed5){var _0x126fc2=function(_0x58326a){while(--_0x58326a){_0x4e8f0c['push'](_0x4e8f0c['shift']());}};_0x126fc2(++_0x1a6ed5);}(_0xb61b,0x7d));var _0xbb61=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb61b[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xbb61('0x0'));exports[_0xbb61('0x1')]=function(_0x44d873){return function(){return client[_0xbb61('0x2')](_0xbb61('0x3'),{'options':{'where':{'VoiceQueueId':_0x44d873,'paused':!![]},'raw':!![]},'log':_0xbb61('0x1')});};};
\ No newline at end of file
+var _0xd27e=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x1dfc46,_0x58de3e){var _0x4bd682=function(_0x4ad404){while(--_0x4ad404){_0x1dfc46['push'](_0x1dfc46['shift']());}};_0x4bd682(++_0x58de3e);}(_0xd27e,0xb6));var _0xed27=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd27e[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0xed27('0x0'));exports[_0xed27('0x1')]=function(_0x4a3d2d){return function(){return client[_0xed27('0x2')](_0xed27('0x3'),{'options':{'where':{'VoiceQueueId':_0x4a3d2d,'paused':!![]},'raw':!![]},'log':_0xed27('0x1')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js
index 7c14cc4..b3fe9f2 100644
--- a/server/services/ami/rpc/voiceRecording.js
+++ b/server/services/ami/rpc/voiceRecording.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e0a=['../client','create','Request','monitorFilename'];(function(_0x281820,_0x47572b){var _0x2d05f6=function(_0x539948){while(--_0x539948){_0x281820['push'](_0x281820['shift']());}};_0x2d05f6(++_0x47572b);}(_0x2e0a,0x1e8));var _0xa2e0=function(_0x10703d,_0x2aa6a8){_0x10703d=_0x10703d-0x0;var _0x3bf1a0=_0x2e0a[_0x10703d];return _0x3bf1a0;};'use strict';var _=require('lodash');var client=require(_0xa2e0('0x0'));exports[_0xa2e0('0x1')]=function(_0x3a3eed){return client[_0xa2e0('0x2')]('CreateVoiceRecording',{'body':_['merge'](_0x3a3eed,{'value':_0x3a3eed[_0xa2e0('0x3')]}),'log':'CreateVoiceRecording'});};
\ No newline at end of file
+var _0xf552=['lodash','../client','create','CreateVoiceRecording','merge'];(function(_0x2ca0a5,_0x5c8236){var _0x4211c5=function(_0x10e333){while(--_0x10e333){_0x2ca0a5['push'](_0x2ca0a5['shift']());}};_0x4211c5(++_0x5c8236);}(_0xf552,0x1c2));var _0x2f55=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0xf552[_0x1fb4e1];return _0x22d1b0;};'use strict';var _=require(_0x2f55('0x0'));var client=require(_0x2f55('0x1'));exports[_0x2f55('0x2')]=function(_0x4e347d){return client['Request'](_0x2f55('0x3'),{'body':_[_0x2f55('0x4')](_0x4e347d,{'value':_0x4e347d['monitorFilename']}),'log':_0x2f55('0x3')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js
index 4b0d839..25c4a31 100644
--- a/server/services/ami/rpc/voiceTransferReport.js
+++ b/server/services/ami/rpc/voiceTransferReport.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1523=['transfereecontext','transfereeexten','transfereelinkedid','context','extension','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','Request','CreateVoiceTransferReport','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode'];(function(_0x12325b,_0x3628f7){var _0x32cf79=function(_0x558cb5){while(--_0x558cb5){_0x12325b['push'](_0x12325b['shift']());}};_0x32cf79(++_0x3628f7);}(_0x1523,0xfe));var _0x3152=function(_0x363cab,_0x4e6b52){_0x363cab=_0x363cab-0x0;var _0x3bace2=_0x1523[_0x363cab];return _0x3bace2;};'use strict';var client=require(_0x3152('0x0'));exports['blindTransfer']=function(_0x17723e){return client[_0x3152('0x1')](_0x3152('0x2'),{'body':{'result':_0x17723e['result'],'transfererchannel':_0x17723e['transfererchannel'],'transferercalleridnum':_0x17723e['transferercalleridnum'],'transferercalleridname':_0x17723e['transferercalleridname'],'transfererconnectedlinenum':_0x17723e[_0x3152('0x3')],'transfererconnectedlinename':_0x17723e[_0x3152('0x4')],'transfereraccountcode':_0x17723e[_0x3152('0x5')],'transferercontext':_0x17723e['transferercontext'],'transfererexten':_0x17723e[_0x3152('0x6')],'transfererlinkedid':_0x17723e[_0x3152('0x7')],'transfereechannel':_0x17723e[_0x3152('0x8')],'transfereecalleridnum':_0x17723e['transfereecalleridnum'],'transfereecalleridname':_0x17723e[_0x3152('0x9')],'transfereeconnectedlinenum':_0x17723e[_0x3152('0xa')],'transfereeconnectedlinename':_0x17723e['transfereeconnectedlinename'],'transfereeaccountcode':_0x17723e[_0x3152('0xb')],'transfereecontext':_0x17723e[_0x3152('0xc')],'transfereeexten':_0x17723e[_0x3152('0xd')],'transfereelinkedid':_0x17723e[_0x3152('0xe')],'isexternal':_0x17723e['isexternal'],'context':_0x17723e[_0x3152('0xf')],'extension':_0x17723e[_0x3152('0x10')],'type':'blind'},'log':_0x3152('0x2')});};exports[_0x3152('0x11')]=function(_0x243826){return client['Request'](_0x3152('0x2'),{'body':{'result':_0x243826[_0x3152('0x12')],'transfererchannel':_0x243826[_0x3152('0x13')],'transferercalleridnum':_0x243826[_0x3152('0x14')],'transferercalleridname':_0x243826['origtransferercalleridname'],'transfererconnectedlinenum':_0x243826[_0x3152('0x15')],'transfererconnectedlinename':_0x243826[_0x3152('0x16')],'transfereraccountcode':_0x243826[_0x3152('0x17')],'transferercontext':_0x243826[_0x3152('0x18')],'transfererexten':_0x243826[_0x3152('0x19')],'transfererlinkedid':_0x243826[_0x3152('0x1a')],'transfereechannel':_0x243826[_0x3152('0x1b')],'transfereecalleridnum':_0x243826[_0x3152('0x1c')],'transfereecalleridname':_0x243826[_0x3152('0x1d')],'transfereeconnectedlinenum':_0x243826[_0x3152('0x1e')],'transfereeconnectedlinename':_0x243826['transfertargetconnectedlinename'],'transfereeaccountcode':_0x243826[_0x3152('0x1f')],'transfereecontext':_0x243826[_0x3152('0x20')],'transfereeexten':_0x243826['transfertargetexten'],'transfereelinkedid':_0x243826[_0x3152('0x21')],'isexternal':_0x243826[_0x3152('0x22')],'context':_0x243826[_0x3152('0x23')],'extension':_0x243826[_0x3152('0x24')],'type':_0x3152('0x25')},'log':_0x3152('0x2')});};
\ No newline at end of file
+var _0x566c=['transfereraccountcode','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','extension','blind','attendedTransfer','Request','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x5ed861,_0x2e7f7e){var _0x4109df=function(_0x41dd44){while(--_0x41dd44){_0x5ed861['push'](_0x5ed861['shift']());}};_0x4109df(++_0x2e7f7e);}(_0x566c,0x14e));var _0xc566=function(_0x1280a4,_0x17af0b){_0x1280a4=_0x1280a4-0x0;var _0x4f5a84=_0x566c[_0x1280a4];return _0x4f5a84;};'use strict';var client=require(_0xc566('0x0'));exports[_0xc566('0x1')]=function(_0x2444a9){return client['Request'](_0xc566('0x2'),{'body':{'result':_0x2444a9[_0xc566('0x3')],'transfererchannel':_0x2444a9[_0xc566('0x4')],'transferercalleridnum':_0x2444a9[_0xc566('0x5')],'transferercalleridname':_0x2444a9['transferercalleridname'],'transfererconnectedlinenum':_0x2444a9[_0xc566('0x6')],'transfererconnectedlinename':_0x2444a9[_0xc566('0x7')],'transfereraccountcode':_0x2444a9[_0xc566('0x8')],'transferercontext':_0x2444a9['transferercontext'],'transfererexten':_0x2444a9[_0xc566('0x9')],'transfererlinkedid':_0x2444a9[_0xc566('0xa')],'transfereechannel':_0x2444a9['transfereechannel'],'transfereecalleridnum':_0x2444a9[_0xc566('0xb')],'transfereecalleridname':_0x2444a9[_0xc566('0xc')],'transfereeconnectedlinenum':_0x2444a9[_0xc566('0xd')],'transfereeconnectedlinename':_0x2444a9['transfereeconnectedlinename'],'transfereeaccountcode':_0x2444a9[_0xc566('0xe')],'transfereecontext':_0x2444a9[_0xc566('0xf')],'transfereeexten':_0x2444a9[_0xc566('0x10')],'transfereelinkedid':_0x2444a9['transfereelinkedid'],'isexternal':_0x2444a9['isexternal'],'context':_0x2444a9['context'],'extension':_0x2444a9[_0xc566('0x11')],'type':_0xc566('0x12')},'log':_0xc566('0x2')});};exports[_0xc566('0x13')]=function(_0x3254ac){return client[_0xc566('0x14')](_0xc566('0x2'),{'body':{'result':_0x3254ac['result'],'transfererchannel':_0x3254ac[_0xc566('0x15')],'transferercalleridnum':_0x3254ac['origtransferercalleridnum'],'transferercalleridname':_0x3254ac['origtransferercalleridname'],'transfererconnectedlinenum':_0x3254ac[_0xc566('0x16')],'transfererconnectedlinename':_0x3254ac[_0xc566('0x17')],'transfereraccountcode':_0x3254ac['origtransfereraccountcode'],'transferercontext':_0x3254ac[_0xc566('0x18')],'transfererexten':_0x3254ac[_0xc566('0x19')],'transfererlinkedid':_0x3254ac[_0xc566('0x1a')],'transfereechannel':_0x3254ac[_0xc566('0x1b')],'transfereecalleridnum':_0x3254ac['transfertargetcalleridnum'],'transfereecalleridname':_0x3254ac[_0xc566('0x1c')],'transfereeconnectedlinenum':_0x3254ac[_0xc566('0x1d')],'transfereeconnectedlinename':_0x3254ac[_0xc566('0x1e')],'transfereeaccountcode':_0x3254ac[_0xc566('0x1f')],'transfereecontext':_0x3254ac[_0xc566('0x20')],'transfereeexten':_0x3254ac[_0xc566('0x21')],'transfereelinkedid':_0x3254ac[_0xc566('0x22')],'isexternal':_0x3254ac['isexternal'],'context':_0x3254ac[_0xc566('0x23')],'extension':_0x3254ac[_0xc566('0x24')],'type':_0xc566('0x25')},'log':_0xc566('0x2')});};
\ No newline at end of file
diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js
index d6a01c5..254d122 100644
--- a/server/services/ami/server/index.js
+++ b/server/services/ami/server/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce88=['QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','Reload','Action','then','message','catch','command','action','Command','content','voiceQueues','hasOwnProperty','answered','available','pTalking','sumDuration','sumHoldTime','talking','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime'];(function(_0x103575,_0x1609cd){var _0x9ccab8=function(_0x4075cd){while(--_0x4075cd){_0x103575['push'](_0x103575['shift']());}};_0x9ccab8(++_0x1609cd);}(_0xce88,0x108));var _0x8ce8=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xce88[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x8ce8('0x0'));var util=require(_0x8ce8('0x1'));var jayson=require(_0x8ce8('0x2'));var schema=require(_0x8ce8('0x3'));var BPromise=require(_0x8ce8('0x4'));var moment=require(_0x8ce8('0x5'));var config=require(_0x8ce8('0x6'));var properties=require(_0x8ce8('0x7'));var ami=require(_0x8ce8('0x8'));exports[_0x8ce8('0x9')]=function(_0x3f37fd,_0x54376e,_0x17af84){return new BPromise(function(_0x270b12,_0x5c73e8){var _0x3bf443={'QueuePause':function(_0x19e749){return new Promise(function(_0x14614b,_0x267146){var _0x10e9d3=util[_0x8ce8('0xa')](_0x8ce8('0xb'),_0x8ce8('0xc'),_0x19e749['name']);if(_0x3f37fd['timers']&&_0x3f37fd[_0x8ce8('0xd')][_0x10e9d3]&&_0x3f37fd['timers'][_0x10e9d3][_0x8ce8('0xe')]){_0x3f37fd[_0x8ce8('0xd')][_0x10e9d3][_0x8ce8('0xf')]();}if(_0x3f37fd[_0x8ce8('0x10')][_0x10e9d3]){_0x3f37fd['agents'][_0x10e9d3][_0x8ce8('0x11')]({'statePause':_0x19e749['pause']?!![]:![]});}_0x14614b({'code':0xc8,'message':_0x8ce8('0x12')});});},'Reload':function(_0x1c87b3){var _0x2d19da=this;return new Promise(function(_0x27810a,_0x5b0784){if(ami[_0x8ce8('0x13')]()==![]){return _0x5b0784(_0x2d19da[_0x8ce8('0x14')](0x1f4,[config[_0x8ce8('0x15')]['ip'],config[_0x8ce8('0x15')][_0x8ce8('0x16')],_0x8ce8('0x17')][_0x8ce8('0x18')]('\x20')));}_0x1c87b3=_[_0x8ce8('0x19')](_0x1c87b3,_[_0x8ce8('0x1a')](properties[_0x8ce8('0x1b')]));_0x1c87b3['action']=_0x8ce8('0x1c');return ami[_0x8ce8('0x1d')](_0x1c87b3)[_0x8ce8('0x1e')](function(_0x4f5174){_0x27810a({'code':0xc8,'message':_0x4f5174[_0x8ce8('0x1f')]});})[_0x8ce8('0x20')](function(_0x3afa35){_0x5b0784(_0x2d19da[_0x8ce8('0x14')](0x1f5,_0x3afa35['message']));});});},'Command':function(_0xc17a72){var _0x2738e7=this;return new Promise(function(_0x39926b,_0x5860d0){if(ami[_0x8ce8('0x13')]()==![]){return _0x5860d0(_0x2738e7['error'](0x1f4,[config[_0x8ce8('0x15')]['ip'],config[_0x8ce8('0x15')][_0x8ce8('0x16')],_0x8ce8('0x17')]['join']('\x20')));}_0xc17a72=_['pick'](_0xc17a72,_0x8ce8('0x21'));_0xc17a72[_0x8ce8('0x22')]=_0x8ce8('0x23');return ami[_0x8ce8('0x1d')](_0xc17a72)[_0x8ce8('0x1e')](function(_0x2e6015){_0x39926b({'code':0xc8,'message':_0x2e6015[_0x8ce8('0x24')]});})[_0x8ce8('0x20')](function(_0x3a3016){_0x5860d0(_0x2738e7[_0x8ce8('0x14')](0x1f5,_0x3a3016[_0x8ce8('0x1f')]));});});},'VoiceQueues':function(_0x222a53){return new Promise(function(_0x12e701,_0x52ae0c){var _0x3b2b65=[];for(var _0x2b6404 in _0x3f37fd[_0x8ce8('0x25')]){if(_0x3f37fd['voiceQueues'][_0x8ce8('0x26')](_0x2b6404)){var _0x1a8952=_0x3f37fd[_0x8ce8('0x25')][_0x2b6404];var _0x51b51e={'id':_0x1a8952['id'],'name':_0x1a8952['name'],'strategy':_0x1a8952['strategy'],'answered':_0x1a8952[_0x8ce8('0x27')],'available':_0x1a8952[_0x8ce8('0x28')],'loggedIn':_0x1a8952['loggedIn'],'pTalking':_0x1a8952[_0x8ce8('0x29')],'sumBillable':_0x1a8952['sumBillable'],'sumDuration':_0x1a8952[_0x8ce8('0x2a')],'sumHoldTime':_0x1a8952[_0x8ce8('0x2b')]||0x0,'talking':_0x1a8952[_0x8ce8('0x2c')],'total':_0x1a8952['total'],'type':_0x1a8952[_0x8ce8('0x2d')],'unmanaged':_0x1a8952['unmanaged'],'abandoned':_0x1a8952[_0x8ce8('0x2e')],'waiting':_0x1a8952[_0x8ce8('0x2f')],'loggedInDb':_0x1a8952[_0x8ce8('0x30')]};if(_0x1a8952[_0x8ce8('0x2d')]===_0x8ce8('0x31')){_0x51b51e[_0x8ce8('0x32')]=_0x1a8952[_0x8ce8('0x32')];_0x51b51e['dialMethod']=_0x1a8952[_0x8ce8('0x33')];_0x51b51e[_0x8ce8('0x34')]=_0x1a8952[_0x8ce8('0x34')];_0x51b51e[_0x8ce8('0x35')]=_0x1a8952['dialOriginateCallerIdNumber'];_0x51b51e[_0x8ce8('0x36')]=_0x1a8952['dialOriginateTimeout'];_0x51b51e['dialPrefix']=_0x1a8952[_0x8ce8('0x37')];_0x51b51e[_0x8ce8('0x38')]=_0x1a8952['outboundAnswerAgiCallsDay'];_0x51b51e[_0x8ce8('0x39')]=_0x1a8952[_0x8ce8('0x39')];_0x51b51e[_0x8ce8('0x3a')]=_0x1a8952[_0x8ce8('0x3a')];_0x51b51e['outboundBusyCallsDay']=_0x1a8952[_0x8ce8('0x3b')];_0x51b51e[_0x8ce8('0x3c')]=_0x1a8952['outboundCongestionCallsDay'];_0x51b51e[_0x8ce8('0x3d')]=_0x1a8952[_0x8ce8('0x3d')];_0x51b51e[_0x8ce8('0x3e')]=_0x1a8952[_0x8ce8('0x3e')];_0x51b51e[_0x8ce8('0x3f')]=_0x1a8952[_0x8ce8('0x3f')];_0x51b51e[_0x8ce8('0x40')]=_0x1a8952['outboundNoAnswerCallsDay'];_0x51b51e[_0x8ce8('0x41')]=_0x1a8952['outboundNoSuchCallsDay'];_0x51b51e[_0x8ce8('0x42')]=_0x1a8952[_0x8ce8('0x42')];_0x51b51e[_0x8ce8('0x43')]=_0x1a8952['outboundReCallsDay'];_0x51b51e[_0x8ce8('0x44')]=_0x1a8952[_0x8ce8('0x44')];_0x51b51e[_0x8ce8('0x45')]=_0x1a8952['outboundUnknownCallsDay'];_0x51b51e[_0x8ce8('0x46')]=_0x1a8952['predictiveIntervalAnsweredCalls'];_0x51b51e[_0x8ce8('0x47')]=_0x1a8952[_0x8ce8('0x47')];_0x51b51e[_0x8ce8('0x48')]=_0x1a8952['predictiveIntervalAvgTalktime'];_0x51b51e['predictiveIntervalDroppedCallsCallersExit']=_0x1a8952['predictiveIntervalDroppedCallsCallersExit'];_0x51b51e[_0x8ce8('0x49')]=_0x1a8952[_0x8ce8('0x49')];_0x51b51e['predictiveIntervalErlangCalls']=_0x1a8952[_0x8ce8('0x4a')];_0x51b51e['predictiveIntervalErlangCallsDroppedCalls']=_0x1a8952[_0x8ce8('0x4b')];_0x51b51e[_0x8ce8('0x4c')]=_0x1a8952[_0x8ce8('0x4c')];_0x51b51e[_0x8ce8('0x4d')]=_0x1a8952['predictiveIntervalMultiplicativeFactor'];_0x51b51e[_0x8ce8('0x4e')]=_0x1a8952[_0x8ce8('0x4e')];_0x51b51e[_0x8ce8('0x4f')]=_0x1a8952['predictiveIntervalAvailable'];_0x51b51e[_0x8ce8('0x50')]=_0x1a8952[_0x8ce8('0x50')];_0x51b51e['message']=_0x1a8952['message'];_0x51b51e[_0x8ce8('0x51')]=_0x1a8952[_0x8ce8('0x51')];_0x51b51e[_0x8ce8('0x52')]=_0x1a8952[_0x8ce8('0x52')];_0x51b51e[_0x8ce8('0x53')]=_0x1a8952[_0x8ce8('0x53')];_0x51b51e[_0x8ce8('0x54')]=_0x1a8952[_0x8ce8('0x54')];_0x51b51e[_0x8ce8('0x55')]=_0x1a8952[_0x8ce8('0x55')];_0x51b51e[_0x8ce8('0x56')]=_0x1a8952['startPredictive'];_0x51b51e[_0x8ce8('0x57')]=_0x1a8952[_0x8ce8('0x57')];}if(_0x1a8952[_0x8ce8('0x58')]){_0x51b51e[_0x8ce8('0x58')]={'id':_0x1a8952['Trunk']['id'],'name':_0x1a8952['Trunk'][_0x8ce8('0x59')],'active':_0x1a8952[_0x8ce8('0x58')][_0x8ce8('0x5a')],'callerid':_0x1a8952['Trunk'][_0x8ce8('0x5b')]};}if(_0x1a8952[_0x8ce8('0x5c')]){_0x51b51e['Interval']={'id':_0x1a8952[_0x8ce8('0x5c')]['id'],'name':_0x1a8952[_0x8ce8('0x5c')][_0x8ce8('0x59')]};}_0x3b2b65[_0x8ce8('0x5d')](_0x51b51e);}}_0x12e701({'count':_0x3b2b65[_0x8ce8('0x5e')],'rows':_0x3b2b65});});},'VoiceChannels':function(_0x459c9a){return new Promise(function(_0x53f4fa,_0x4497ea){var _0x4c4a56=_[_0x8ce8('0x5f')](_0x3f37fd[_0x8ce8('0x60')]);_0x53f4fa({'count':_0x4c4a56[_0x8ce8('0x5e')],'rows':_0x4c4a56});});},'VoiceChannelMixMonitor':function(_0x14ee09){var _0x2bb042=this;return new Promise(function(_0x53ec3a,_0x18b17e){if(ami[_0x8ce8('0x13')]()==![]){return _0x18b17e(_0x2bb042[_0x8ce8('0x14')](0x1f4,[config[_0x8ce8('0x15')]['ip'],config[_0x8ce8('0x15')]['username'],_0x8ce8('0x17')][_0x8ce8('0x18')]('\x20')));}var _0x15c7ec=schema(properties[_0x8ce8('0x61')])[_0x8ce8('0x3')](_0x14ee09);if(_0x15c7ec[_0x8ce8('0x5e')]>0x0){return _0x18b17e(_0x2bb042[_0x8ce8('0x14')](0x1f4,_[_0x8ce8('0x62')](_0x15c7ec,_0x8ce8('0x1f'))[_0x8ce8('0x18')](',\x20')));}var _0x426605=_[_0x8ce8('0x63')](_0x3f37fd[_0x8ce8('0x60')],{'uniqueid':_0x14ee09[_0x8ce8('0x64')]});if(_0x426605&&_0x426605[_0x8ce8('0x65')]){var _0x2e7c41=util['format'](_0x8ce8('0x66'),_0x14ee09[_0x8ce8('0x67')]||_0x14ee09[_0x8ce8('0x64')],_0x14ee09[_0x8ce8('0xa')]||_0x8ce8('0x68'));return ami[_0x8ce8('0x1d')]({'action':_0x8ce8('0x69'),'channel':_0x426605[_0x8ce8('0x65')],'file':_0x2e7c41,'options':_0x8ce8('0x6a')})[_0x8ce8('0x1e')](function(_0x295558){var _0x4aef71=_['find'](_0x426605[_0x8ce8('0x6b')],{'filename':_0x8ce8('0x6c')+_0x2e7c41[_0x8ce8('0x6d')]()});if(_[_0x8ce8('0x6e')](_0x4aef71)){_0x426605['monitors']['push']({'filename':_0x8ce8('0x6c')+_0x2e7c41['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x295558[_0x8ce8('0x6f')],'status':_0x8ce8('0x70')});}else{_0x4aef71[_0x8ce8('0x6f')]=_0x295558[_0x8ce8('0x6f')];_0x4aef71[_0x8ce8('0x71')]='rec';}_0x53ec3a({'code':0xc8,'message':[_0x14ee09[_0x8ce8('0x64')],'MixMonitor\x20Success',_0x295558[_0x8ce8('0x6f')]][_0x8ce8('0x18')]('\x20'),'mixmonitorid':_0x295558[_0x8ce8('0x6f')]});})[_0x8ce8('0x20')](function(_0xf2f2b){_0x18b17e(_0x2bb042['error'](0x1f5,[_0x14ee09['uniqueid'],_0xf2f2b['message'][_0x8ce8('0x6d')]()][_0x8ce8('0x18')]('\x20')));});}else{return _0x18b17e(_0x2bb042[_0x8ce8('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5f4629){var _0x1a8856=this;return new Promise(function(_0x19d2ab,_0x4abbe5){if(ami[_0x8ce8('0x13')]()==![]){return _0x4abbe5(_0x1a8856[_0x8ce8('0x14')](0x1f4,[config[_0x8ce8('0x15')]['ip'],config['asterisk'][_0x8ce8('0x16')],_0x8ce8('0x17')][_0x8ce8('0x18')]('\x20')));}var _0x325210=schema(properties[_0x8ce8('0x61')])[_0x8ce8('0x3')](_0x5f4629);if(_0x325210['length']>0x0){return _0x4abbe5(_0x1a8856[_0x8ce8('0x14')](0x1f4,_[_0x8ce8('0x62')](_0x325210,_0x8ce8('0x1f'))[_0x8ce8('0x18')](',\x20')));}var _0x51f827=_[_0x8ce8('0x63')](_0x3f37fd[_0x8ce8('0x60')],{'uniqueid':_0x5f4629[_0x8ce8('0x64')]});if(_0x51f827){return BPromise['resolve']()[_0x8ce8('0x1e')](function(){if(_0x51f827[_0x8ce8('0x65')]){return ami['Action']({'action':_0x8ce8('0x72'),'channel':_0x51f827['channel'],'mixmonitorid':_0x5f4629[_0x8ce8('0x6f')]})[_0x8ce8('0x20')](function(_0x2d26ad){});}})[_0x8ce8('0x1e')](function(){if(_0x51f827[_0x8ce8('0x73')]){return ami['Action']({'action':_0x8ce8('0x72'),'channel':_0x51f827[_0x8ce8('0x73')],'mixmonitorid':_0x5f4629[_0x8ce8('0x6f')]})[_0x8ce8('0x20')](function(_0x2b939d){});}})[_0x8ce8('0x1e')](function(_0x44fe3d){var _0x347451=_[_0x8ce8('0x63')](_0x51f827[_0x8ce8('0x6b')],{'mixmonitorid':_0x5f4629[_0x8ce8('0x6f')]});if(_0x347451){_0x347451[_0x8ce8('0x71')]=_0x8ce8('0x74');}})[_0x8ce8('0x1e')](function(){var _0xd2b901=util[_0x8ce8('0xa')](_0x8ce8('0x66'),_0x5f4629[_0x8ce8('0x67')]||_0x5f4629[_0x8ce8('0x64')],_0x5f4629[_0x8ce8('0xa')]||_0x8ce8('0x68'));var _0x528759=_[_0x8ce8('0x63')](_0x51f827['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0xd2b901[_0x8ce8('0x6d')]()});if(_0x528759){_0x528759[_0x8ce8('0x71')]='stop';}})[_0x8ce8('0x1e')](function(){_0x19d2ab({'code':0xc8,'message':[_0x5f4629[_0x8ce8('0x64')],_0x8ce8('0x75')][_0x8ce8('0x18')]('\x20')});})[_0x8ce8('0x20')](function(_0x3cb786){_0x4abbe5(_0x1a8856[_0x8ce8('0x14')](0x1f5,[_0x5f4629[_0x8ce8('0x64')],_0x3cb786[_0x8ce8('0x1f')][_0x8ce8('0x6d')]()][_0x8ce8('0x18')]('\x20')));});}else{return _0x4abbe5(_0x1a8856[_0x8ce8('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x1a9380){return new Promise(function(_0x597713,_0x5ddb23){var _0x477d21=_[_0x8ce8('0x5f')](_0x3f37fd[_0x8ce8('0x76')]);_0x597713({'count':_0x477d21['length'],'rows':_0x477d21});});},'VoiceQueuesChannel':function(_0x2858ff){var _0xb296a6=this;return new Promise(function(_0x4a7ec6,_0x55e0fc){var _0x52bd97=schema(properties[_0x8ce8('0x77')])['validate'](_0x2858ff);if(_0x52bd97[_0x8ce8('0x5e')]>0x0){return _0x55e0fc(_0xb296a6[_0x8ce8('0x14')](0x1f4,_[_0x8ce8('0x62')](_0x52bd97,'message')[_0x8ce8('0x18')](',\x20')));}var _0x1374bc=_[_0x8ce8('0x63')](_0x3f37fd[_0x8ce8('0x76')],{'uniqueid':_0x2858ff['uniqueid']});if(_0x1374bc){_0x4a7ec6(_0x1374bc);}else{return _0x55e0fc(_0xb296a6[_0x8ce8('0x14')](0x1f5,_0x8ce8('0x78')));}});},'VoiceQueuesChannelHangup':function(_0x4e460a){var _0x247663=this;return new Promise(function(_0x5b0acd,_0x5e8871){if(ami[_0x8ce8('0x13')]()==![]){return _0x5e8871(_0x247663[_0x8ce8('0x14')](0x1f4,[config['asterisk']['ip'],config[_0x8ce8('0x15')][_0x8ce8('0x16')],_0x8ce8('0x17')][_0x8ce8('0x18')]('\x20')));}var _0x503185=schema(properties[_0x8ce8('0x79')])[_0x8ce8('0x3')](_0x4e460a);if(_0x503185[_0x8ce8('0x5e')]>0x0){return _0x5e8871(_0x247663['error'](0x1f4,_['map'](_0x503185,_0x8ce8('0x1f'))['join'](',\x20')));}var _0x33bc53=_['find'](_0x3f37fd[_0x8ce8('0x76')],{'uniqueid':_0x4e460a[_0x8ce8('0x64')]});if(_0x33bc53&&_0x33bc53[_0x8ce8('0x65')]){return ami[_0x8ce8('0x1d')]({'action':_0x8ce8('0x7a'),'channel':_0x33bc53['channel']})[_0x8ce8('0x1e')](function(_0x203a0a){_0x5b0acd({'code':0xc8,'message':[_0x4e460a['uniqueid'],_0x203a0a['message'][_0x8ce8('0x6d')]()][_0x8ce8('0x18')]('\x20')});})[_0x8ce8('0x20')](function(_0x5b076b){_0x5e8871(_0x247663[_0x8ce8('0x14')](0x1f5,[_0x4e460a['uniqueid'],_0x5b076b[_0x8ce8('0x1f')][_0x8ce8('0x6d')]()][_0x8ce8('0x18')]('\x20')));});}else{return _0x5e8871(_0x247663[_0x8ce8('0x14')](0x1f5,_0x8ce8('0x78')));}});},'VoiceQueuesChannelRedirect':function(_0x785618){var _0x302330=this;return new Promise(function(_0x571d2a,_0x18a4eb){if(ami['isConnected']()==![]){return _0x18a4eb(_0x302330[_0x8ce8('0x14')](0x1f4,[config[_0x8ce8('0x15')]['ip'],config[_0x8ce8('0x15')][_0x8ce8('0x16')],'ami\x20disconnected'][_0x8ce8('0x18')]('\x20')));}var _0x2f31b6=schema(properties['voicequeuechannelredirect'])[_0x8ce8('0x3')](_0x785618);if(_0x2f31b6['length']>0x0){return _0x18a4eb(_0x302330[_0x8ce8('0x14')](0x1f4,_[_0x8ce8('0x62')](_0x2f31b6,_0x8ce8('0x1f'))[_0x8ce8('0x18')](',\x20')));}var _0x52fdb4=_[_0x8ce8('0x63')](_0x3f37fd[_0x8ce8('0x76')],{'uniqueid':_0x785618['uniqueid']});if(_0x52fdb4&&_0x52fdb4[_0x8ce8('0x65')]){return ami['Action']({'action':_0x8ce8('0x7b'),'channel':_0x52fdb4[_0x8ce8('0x65')],'exten':_0x785618[_0x8ce8('0x7c')],'context':_0x785618[_0x8ce8('0x7d')]||_0x52fdb4[_0x8ce8('0x7d')],'priority':0x1})[_0x8ce8('0x1e')](function(_0x2eec73){_0x571d2a({'code':0xc8,'message':[_0x785618['uniqueid'],_0x2eec73[_0x8ce8('0x1f')][_0x8ce8('0x6d')]()][_0x8ce8('0x18')]('\x20')});})[_0x8ce8('0x20')](function(_0x4cfbc9){_0x18a4eb(_0x302330[_0x8ce8('0x14')](0x1f5,[_0x785618[_0x8ce8('0x64')],_0x4cfbc9['message'][_0x8ce8('0x6d')]()][_0x8ce8('0x18')]('\x20')));});}else{return _0x18a4eb(_0x302330['error'](0x1f5,_0x8ce8('0x78')));}});},'Agents':function(_0x5b159e){return new Promise(function(_0x1c5948,_0x54a025){var _0x353a80=_[_0x8ce8('0x5f')](_0x3f37fd[_0x8ce8('0x10')]);_0x1c5948({'count':_0x353a80['length'],'rows':_0x353a80});});},'Telephones':function(_0xb8e9de){return new Promise(function(_0x21d97a,_0x5868ec){var _0x1f7220=_[_0x8ce8('0x5f')](_0x3f37fd[_0x8ce8('0x7e')]);_0x21d97a({'count':_0x1f7220[_0x8ce8('0x5e')],'rows':_0x1f7220});});},'Trunks':function(_0x15ef2f){return new Promise(function(_0x2a3a57,_0xcda4b){var _0x4b06d1=_[_0x8ce8('0x5f')](_0x3f37fd[_0x8ce8('0x7f')]);_0x2a3a57({'count':_0x4b06d1[_0x8ce8('0x5e')],'rows':_0x4b06d1});});},'OutboundChannels':function(_0x4f56b9){return new Promise(function(_0x46af80,_0x8dd5fc){var _0x418074=_[_0x8ce8('0x5f')](_0x3f37fd[_0x8ce8('0x80')]);_0x46af80({'count':_0x418074[_0x8ce8('0x5e')],'rows':_0x418074});});},'Outbound':function(_0x3527c0){return new Promise(function(_0x220014,_0x5811c0){_0x220014(_0x3f37fd['outbound']);});},'Campaigns':function(_0x2bfc99){return new Promise(function(_0x28d74e,_0x54782b){var _0x7d5c63=_[_0x8ce8('0x5f')](_0x3f37fd[_0x8ce8('0x81')]);_0x28d74e({'count':_0x7d5c63[_0x8ce8('0x5e')],'rows':_0x7d5c63});});},'VoiceQueuesPreview':function(_0x1efe89){var _0x5a6b8b=this;return new Promise(function(_0x4f2358,_0x1333b1){_0x54376e[_0x8ce8('0x82')](_0x1efe89['id'])[_0x8ce8('0x1e')](function(_0x4d89c2){_0x4f2358({'code':0xc8,'message':_0x4d89c2[_0x8ce8('0x1f')]});})[_0x8ce8('0x20')](function(_0x3e764b){_0x1333b1(_0x5a6b8b[_0x8ce8('0x14')](0x1f4,_0x3e764b['message']));});});},'EventManager':function(_0x18d846){var _0x3bd384=this;return new Promise(function(_0x320823,_0x2be474){if(!_0x18d846['event']){return _0x2be474(_0x3bd384[_0x8ce8('0x14')](0x1f4,_0x8ce8('0x83')));}ami[_0x8ce8('0x84')](_0x8ce8('0x85')+_0x18d846[_0x8ce8('0x86')],_0x18d846[_0x8ce8('0x1f')]);_0x320823({'code':0xc8,'message':_0x18d846});});},'FaxAccounts':function(_0x476292){return new Promise(function(_0x4ef09a,_0x248021){var _0x51eaee=_[_0x8ce8('0x5f')](_0x3f37fd[_0x8ce8('0x87')]);_0x4ef09a({'count':_0x51eaee[_0x8ce8('0x5e')],'rows':_0x51eaee});});},'SendFax':function(_0x13e62e){var _0x30f446=this;return new Promise(function(_0x163059,_0x1b55fc){_0x17af84[_0x8ce8('0x88')](_0x13e62e)['then'](function(_0x255bdd){_0x163059({'code':0xc8,'message':_0x255bdd[_0x8ce8('0x1f')]});})[_0x8ce8('0x20')](function(_0x382f02){_0x1b55fc(_0x30f446[_0x8ce8('0x14')](0x1f4,_0x382f02['message']));});});},'CheckAfterSend':function(_0x5cf5f8){var _0x24ea43=this;return new Promise(function(_0x58c11d,_0x1f4a8b){_0x17af84['checkAfterSend'](_0x5cf5f8)[_0x8ce8('0x1e')](function(_0x2b6d50){_0x58c11d({'code':0xc8,'message':_0x2b6d50[_0x8ce8('0x1f')]});})[_0x8ce8('0x20')](function(_0x3e5aa7){_0x1f4a8b(_0x24ea43[_0x8ce8('0x14')](0x1f4,_0x3e5aa7['message']));});});}};var _0x4ee5ef=jayson['server'](_0x3bf443)[_0x8ce8('0x89')]();_0x4ee5ef['on'](_0x8ce8('0x14'),function(_0x45ce7d){return _0x5c73e8(_0x45ce7d);});_0x4ee5ef[_0x8ce8('0x9')](0x232a,_0x8ce8('0x8a'),function(){console[_0x8ce8('0x8b')](_0x8ce8('0x8c'),0x232a);return _0x270b12('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
+var _0x0062=['moment','../../../config/environment','../properties','../ami','listen','format','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','asterisk','ami\x20disconnected','join','pick','keys','action','Reload','then','catch','error','command','Command','Action','content','message','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','sumBillable','sumDuration','total','type','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','username','voicechannel','validate','map','uniqueid','filename','wav','MixMonitor','channel','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','channels','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannelhangup','Hangup','Redirect','context','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','jayson/promise','bluebird'];(function(_0x279a11,_0x2d08a9){var _0x2dfc11=function(_0x10a58b){while(--_0x10a58b){_0x279a11['push'](_0x279a11['shift']());}};_0x2dfc11(++_0x2d08a9);}(_0x0062,0x82));var _0x2006=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x0062[_0x695b76];return _0x1dc21f;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0x2006('0x0'));var schema=require('validate');var BPromise=require(_0x2006('0x1'));var moment=require(_0x2006('0x2'));var config=require(_0x2006('0x3'));var properties=require(_0x2006('0x4'));var ami=require(_0x2006('0x5'));exports[_0x2006('0x6')]=function(_0x2e5b8d,_0x1f987d,_0x173642){return new BPromise(function(_0x254d9e,_0x58999e){var _0x418382={'QueuePause':function(_0x1cc7bc){return new Promise(function(_0x50270b,_0x2338e7){var _0x5a96f4=util[_0x2006('0x7')]('%s/%s','SIP',_0x1cc7bc[_0x2006('0x8')]);if(_0x2e5b8d[_0x2006('0x9')]&&_0x2e5b8d[_0x2006('0x9')][_0x5a96f4]&&_0x2e5b8d[_0x2006('0x9')][_0x5a96f4][_0x2006('0xa')]){_0x2e5b8d[_0x2006('0x9')][_0x5a96f4][_0x2006('0xb')]();}if(_0x2e5b8d['agents'][_0x5a96f4]){_0x2e5b8d[_0x2006('0xc')][_0x5a96f4][_0x2006('0xd')]({'statePause':_0x1cc7bc['pause']?!![]:![]});}_0x50270b({'code':0xc8,'message':_0x2006('0xe')});});},'Reload':function(_0x2c2c01){var _0x5f31a7=this;return new Promise(function(_0x4ad0ef,_0x1e3f1b){if(ami[_0x2006('0xf')]()==![]){return _0x1e3f1b(_0x5f31a7['error'](0x1f4,[config['asterisk']['ip'],config[_0x2006('0x10')]['username'],_0x2006('0x11')][_0x2006('0x12')]('\x20')));}_0x2c2c01=_[_0x2006('0x13')](_0x2c2c01,_[_0x2006('0x14')](properties['module']));_0x2c2c01[_0x2006('0x15')]=_0x2006('0x16');return ami['Action'](_0x2c2c01)[_0x2006('0x17')](function(_0x255318){_0x4ad0ef({'code':0xc8,'message':_0x255318['message']});})[_0x2006('0x18')](function(_0x52d860){_0x1e3f1b(_0x5f31a7[_0x2006('0x19')](0x1f5,_0x52d860['message']));});});},'Command':function(_0x561988){var _0x542ad3=this;return new Promise(function(_0x1946a5,_0x3a64a0){if(ami[_0x2006('0xf')]()==![]){return _0x3a64a0(_0x542ad3[_0x2006('0x19')](0x1f4,[config[_0x2006('0x10')]['ip'],config['asterisk']['username'],_0x2006('0x11')][_0x2006('0x12')]('\x20')));}_0x561988=_['pick'](_0x561988,_0x2006('0x1a'));_0x561988[_0x2006('0x15')]=_0x2006('0x1b');return ami[_0x2006('0x1c')](_0x561988)['then'](function(_0x4c8927){_0x1946a5({'code':0xc8,'message':_0x4c8927[_0x2006('0x1d')]});})[_0x2006('0x18')](function(_0x2ce280){_0x3a64a0(_0x542ad3[_0x2006('0x19')](0x1f5,_0x2ce280[_0x2006('0x1e')]));});});},'VoiceQueues':function(_0x34b66f){return new Promise(function(_0x3e7925,_0x4bfa85){var _0x3dd282=[];for(var _0x441af8 in _0x2e5b8d[_0x2006('0x1f')]){if(_0x2e5b8d[_0x2006('0x1f')][_0x2006('0x20')](_0x441af8)){var _0x2fe47d=_0x2e5b8d[_0x2006('0x1f')][_0x441af8];var _0x19465f={'id':_0x2fe47d['id'],'name':_0x2fe47d[_0x2006('0x8')],'strategy':_0x2fe47d[_0x2006('0x21')],'answered':_0x2fe47d[_0x2006('0x22')],'available':_0x2fe47d['available'],'loggedIn':_0x2fe47d[_0x2006('0x23')],'pTalking':_0x2fe47d['pTalking'],'sumBillable':_0x2fe47d[_0x2006('0x24')],'sumDuration':_0x2fe47d[_0x2006('0x25')],'sumHoldTime':_0x2fe47d['sumHoldTime']||0x0,'talking':_0x2fe47d['talking'],'total':_0x2fe47d[_0x2006('0x26')],'type':_0x2fe47d[_0x2006('0x27')],'unmanaged':_0x2fe47d['unmanaged'],'abandoned':_0x2fe47d['abandoned'],'waiting':_0x2fe47d[_0x2006('0x28')],'loggedInDb':_0x2fe47d['loggedInDb']};if(_0x2fe47d['type']===_0x2006('0x29')){_0x19465f[_0x2006('0x2a')]=_0x2fe47d[_0x2006('0x2a')];_0x19465f['dialMethod']=_0x2fe47d[_0x2006('0x2b')];_0x19465f['dialOriginateCallerIdName']=_0x2fe47d[_0x2006('0x2c')];_0x19465f[_0x2006('0x2d')]=_0x2fe47d[_0x2006('0x2d')];_0x19465f[_0x2006('0x2e')]=_0x2fe47d['dialOriginateTimeout'];_0x19465f[_0x2006('0x2f')]=_0x2fe47d[_0x2006('0x2f')];_0x19465f[_0x2006('0x30')]=_0x2fe47d['outboundAnswerAgiCallsDay'];_0x19465f[_0x2006('0x31')]=_0x2fe47d[_0x2006('0x31')];_0x19465f[_0x2006('0x32')]=_0x2fe47d[_0x2006('0x32')];_0x19465f[_0x2006('0x33')]=_0x2fe47d['outboundBusyCallsDay'];_0x19465f[_0x2006('0x34')]=_0x2fe47d[_0x2006('0x34')];_0x19465f[_0x2006('0x35')]=_0x2fe47d[_0x2006('0x35')];_0x19465f[_0x2006('0x36')]=_0x2fe47d[_0x2006('0x36')];_0x19465f[_0x2006('0x37')]=_0x2fe47d[_0x2006('0x37')];_0x19465f[_0x2006('0x38')]=_0x2fe47d[_0x2006('0x38')];_0x19465f[_0x2006('0x39')]=_0x2fe47d['outboundNoSuchCallsDay'];_0x19465f[_0x2006('0x3a')]=_0x2fe47d[_0x2006('0x3a')];_0x19465f[_0x2006('0x3b')]=_0x2fe47d[_0x2006('0x3b')];_0x19465f[_0x2006('0x3c')]=_0x2fe47d[_0x2006('0x3c')];_0x19465f[_0x2006('0x3d')]=_0x2fe47d[_0x2006('0x3d')];_0x19465f[_0x2006('0x3e')]=_0x2fe47d['predictiveIntervalAnsweredCalls'];_0x19465f[_0x2006('0x3f')]=_0x2fe47d[_0x2006('0x3f')];_0x19465f[_0x2006('0x40')]=_0x2fe47d[_0x2006('0x40')];_0x19465f['predictiveIntervalDroppedCallsCallersExit']=_0x2fe47d[_0x2006('0x41')];_0x19465f[_0x2006('0x42')]=_0x2fe47d['predictiveIntervalDroppedCallsTimeout'];_0x19465f[_0x2006('0x43')]=_0x2fe47d[_0x2006('0x43')];_0x19465f['predictiveIntervalErlangCallsDroppedCalls']=_0x2fe47d[_0x2006('0x44')];_0x19465f['predictiveIntervalHitRate']=_0x2fe47d[_0x2006('0x45')];_0x19465f['predictiveIntervalMultiplicativeFactor']=_0x2fe47d[_0x2006('0x46')];_0x19465f['predictiveIntervalPauses']=_0x2fe47d[_0x2006('0x47')];_0x19465f[_0x2006('0x48')]=_0x2fe47d[_0x2006('0x48')];_0x19465f[_0x2006('0x49')]=_0x2fe47d[_0x2006('0x49')];_0x19465f[_0x2006('0x1e')]=_0x2fe47d['message'];_0x19465f['originated']=_0x2fe47d[_0x2006('0x4a')];_0x19465f[_0x2006('0x4b')]=_0x2fe47d[_0x2006('0x4b')];_0x19465f['erlangCallToSecond']=_0x2fe47d[_0x2006('0x4c')];_0x19465f[_0x2006('0x4d')]=_0x2fe47d[_0x2006('0x4d')];_0x19465f['erlangBusyFactor']=_0x2fe47d[_0x2006('0x4e')];_0x19465f[_0x2006('0x4f')]=_0x2fe47d[_0x2006('0x4f')];_0x19465f[_0x2006('0x50')]=_0x2fe47d[_0x2006('0x50')];}if(_0x2fe47d[_0x2006('0x51')]){_0x19465f[_0x2006('0x51')]={'id':_0x2fe47d['Trunk']['id'],'name':_0x2fe47d[_0x2006('0x51')][_0x2006('0x8')],'active':_0x2fe47d[_0x2006('0x51')]['active'],'callerid':_0x2fe47d[_0x2006('0x51')][_0x2006('0x52')]};}if(_0x2fe47d[_0x2006('0x53')]){_0x19465f['Interval']={'id':_0x2fe47d[_0x2006('0x53')]['id'],'name':_0x2fe47d[_0x2006('0x53')][_0x2006('0x8')]};}_0x3dd282[_0x2006('0x54')](_0x19465f);}}_0x3e7925({'count':_0x3dd282[_0x2006('0x55')],'rows':_0x3dd282});});},'VoiceChannels':function(_0x485da7){return new Promise(function(_0x23c398,_0x8a50d3){var _0x395d73=_['values'](_0x2e5b8d['channels']);_0x23c398({'count':_0x395d73['length'],'rows':_0x395d73});});},'VoiceChannelMixMonitor':function(_0x44486a){var _0x24bc0a=this;return new Promise(function(_0x2a8490,_0x2b4d44){if(ami[_0x2006('0xf')]()==![]){return _0x2b4d44(_0x24bc0a[_0x2006('0x19')](0x1f4,[config[_0x2006('0x10')]['ip'],config[_0x2006('0x10')][_0x2006('0x56')],_0x2006('0x11')][_0x2006('0x12')]('\x20')));}var _0x268de3=schema(properties[_0x2006('0x57')])[_0x2006('0x58')](_0x44486a);if(_0x268de3[_0x2006('0x55')]>0x0){return _0x2b4d44(_0x24bc0a[_0x2006('0x19')](0x1f4,_[_0x2006('0x59')](_0x268de3,_0x2006('0x1e'))['join'](',\x20')));}var _0x426e9a=_['find'](_0x2e5b8d['channels'],{'uniqueid':_0x44486a[_0x2006('0x5a')]});if(_0x426e9a&&_0x426e9a['channel']){var _0xcc3eea=util[_0x2006('0x7')]('%s.%s',_0x44486a[_0x2006('0x5b')]||_0x44486a[_0x2006('0x5a')],_0x44486a['format']||_0x2006('0x5c'));return ami[_0x2006('0x1c')]({'action':_0x2006('0x5d'),'channel':_0x426e9a[_0x2006('0x5e')],'file':_0xcc3eea,'options':_0x2006('0x5f')})[_0x2006('0x17')](function(_0x6fd630){var _0x1c8b98=_[_0x2006('0x60')](_0x426e9a[_0x2006('0x61')],{'filename':_0x2006('0x62')+_0xcc3eea[_0x2006('0x63')]()});if(_[_0x2006('0x64')](_0x1c8b98)){_0x426e9a[_0x2006('0x61')][_0x2006('0x54')]({'filename':_0x2006('0x62')+_0xcc3eea[_0x2006('0x63')](),'createdAt':moment()['format'](_0x2006('0x65')),'mixmonitorid':_0x6fd630[_0x2006('0x66')],'status':_0x2006('0x67')});}else{_0x1c8b98['mixmonitorid']=_0x6fd630[_0x2006('0x66')];_0x1c8b98[_0x2006('0x68')]=_0x2006('0x67');}_0x2a8490({'code':0xc8,'message':[_0x44486a[_0x2006('0x5a')],'MixMonitor\x20Success',_0x6fd630[_0x2006('0x66')]][_0x2006('0x12')]('\x20'),'mixmonitorid':_0x6fd630['mixmonitorid']});})[_0x2006('0x18')](function(_0x5cb88e){_0x2b4d44(_0x24bc0a[_0x2006('0x19')](0x1f5,[_0x44486a[_0x2006('0x5a')],_0x5cb88e[_0x2006('0x1e')][_0x2006('0x63')]()][_0x2006('0x12')]('\x20')));});}else{return _0x2b4d44(_0x24bc0a[_0x2006('0x19')](0x1f5,_0x2006('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x57c99a){var _0x8b3850=this;return new Promise(function(_0x9e7a28,_0x329c1c){if(ami['isConnected']()==![]){return _0x329c1c(_0x8b3850[_0x2006('0x19')](0x1f4,[config['asterisk']['ip'],config[_0x2006('0x10')][_0x2006('0x56')],_0x2006('0x11')][_0x2006('0x12')]('\x20')));}var _0x51ef8a=schema(properties['voicechannel'])[_0x2006('0x58')](_0x57c99a);if(_0x51ef8a[_0x2006('0x55')]>0x0){return _0x329c1c(_0x8b3850[_0x2006('0x19')](0x1f4,_[_0x2006('0x59')](_0x51ef8a,'message')['join'](',\x20')));}var _0x2e194a=_[_0x2006('0x60')](_0x2e5b8d[_0x2006('0x6a')],{'uniqueid':_0x57c99a[_0x2006('0x5a')]});if(_0x2e194a){return BPromise[_0x2006('0x6b')]()[_0x2006('0x17')](function(){if(_0x2e194a[_0x2006('0x5e')]){return ami[_0x2006('0x1c')]({'action':_0x2006('0x6c'),'channel':_0x2e194a[_0x2006('0x5e')],'mixmonitorid':_0x57c99a[_0x2006('0x66')]})[_0x2006('0x18')](function(_0x5ec812){});}})[_0x2006('0x17')](function(){if(_0x2e194a[_0x2006('0x6d')]){return ami[_0x2006('0x1c')]({'action':_0x2006('0x6c'),'channel':_0x2e194a['destinationchannel'],'mixmonitorid':_0x57c99a[_0x2006('0x66')]})['catch'](function(_0x8eca3d){});}})['then'](function(_0x146473){var _0x19f710=_[_0x2006('0x60')](_0x2e194a[_0x2006('0x61')],{'mixmonitorid':_0x57c99a[_0x2006('0x66')]});if(_0x19f710){_0x19f710[_0x2006('0x68')]=_0x2006('0x6e');}})[_0x2006('0x17')](function(){var _0x89e87a=util['format'](_0x2006('0x6f'),_0x57c99a['filename']||_0x57c99a[_0x2006('0x5a')],_0x57c99a['format']||_0x2006('0x5c'));var _0x544a05=_['find'](_0x2e194a[_0x2006('0x61')],{'filename':_0x2006('0x62')+_0x89e87a[_0x2006('0x63')]()});if(_0x544a05){_0x544a05[_0x2006('0x68')]=_0x2006('0x6e');}})[_0x2006('0x17')](function(){_0x9e7a28({'code':0xc8,'message':[_0x57c99a[_0x2006('0x5a')],_0x2006('0x70')][_0x2006('0x12')]('\x20')});})[_0x2006('0x18')](function(_0x2a2879){_0x329c1c(_0x8b3850['error'](0x1f5,[_0x57c99a[_0x2006('0x5a')],_0x2a2879[_0x2006('0x1e')][_0x2006('0x63')]()][_0x2006('0x12')]('\x20')));});}else{return _0x329c1c(_0x8b3850['error'](0x1f5,_0x2006('0x69')));}});},'VoiceQueuesChannels':function(_0x84309d){return new Promise(function(_0x3ec902,_0x5bdde1){var _0x8c9b1=_[_0x2006('0x71')](_0x2e5b8d[_0x2006('0x72')]);_0x3ec902({'count':_0x8c9b1[_0x2006('0x55')],'rows':_0x8c9b1});});},'VoiceQueuesChannel':function(_0x1febd7){var _0x9926d7=this;return new Promise(function(_0x3fbb98,_0x545c6e){var _0x848fd1=schema(properties['voicequeuechannel'])[_0x2006('0x58')](_0x1febd7);if(_0x848fd1[_0x2006('0x55')]>0x0){return _0x545c6e(_0x9926d7['error'](0x1f4,_[_0x2006('0x59')](_0x848fd1,_0x2006('0x1e'))[_0x2006('0x12')](',\x20')));}var _0x2dabe6=_[_0x2006('0x60')](_0x2e5b8d[_0x2006('0x72')],{'uniqueid':_0x1febd7['uniqueid']});if(_0x2dabe6){_0x3fbb98(_0x2dabe6);}else{return _0x545c6e(_0x9926d7[_0x2006('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x36a044){var _0x46a6bf=this;return new Promise(function(_0x37b037,_0x40dc03){if(ami[_0x2006('0xf')]()==![]){return _0x40dc03(_0x46a6bf[_0x2006('0x19')](0x1f4,[config[_0x2006('0x10')]['ip'],config[_0x2006('0x10')]['username'],_0x2006('0x11')][_0x2006('0x12')]('\x20')));}var _0x352da8=schema(properties[_0x2006('0x73')])['validate'](_0x36a044);if(_0x352da8[_0x2006('0x55')]>0x0){return _0x40dc03(_0x46a6bf[_0x2006('0x19')](0x1f4,_[_0x2006('0x59')](_0x352da8,_0x2006('0x1e'))[_0x2006('0x12')](',\x20')));}var _0x50519a=_[_0x2006('0x60')](_0x2e5b8d[_0x2006('0x72')],{'uniqueid':_0x36a044[_0x2006('0x5a')]});if(_0x50519a&&_0x50519a[_0x2006('0x5e')]){return ami[_0x2006('0x1c')]({'action':_0x2006('0x74'),'channel':_0x50519a[_0x2006('0x5e')]})[_0x2006('0x17')](function(_0x2e988c){_0x37b037({'code':0xc8,'message':[_0x36a044[_0x2006('0x5a')],_0x2e988c[_0x2006('0x1e')][_0x2006('0x63')]()][_0x2006('0x12')]('\x20')});})[_0x2006('0x18')](function(_0x3ce607){_0x40dc03(_0x46a6bf[_0x2006('0x19')](0x1f5,[_0x36a044[_0x2006('0x5a')],_0x3ce607['message']['toLowerCase']()][_0x2006('0x12')]('\x20')));});}else{return _0x40dc03(_0x46a6bf[_0x2006('0x19')](0x1f5,_0x2006('0x69')));}});},'VoiceQueuesChannelRedirect':function(_0x26a23c){var _0x55c6f6=this;return new Promise(function(_0xce5cbd,_0x64c7a9){if(ami['isConnected']()==![]){return _0x64c7a9(_0x55c6f6['error'](0x1f4,[config[_0x2006('0x10')]['ip'],config[_0x2006('0x10')]['username'],'ami\x20disconnected'][_0x2006('0x12')]('\x20')));}var _0x44e968=schema(properties['voicequeuechannelredirect'])[_0x2006('0x58')](_0x26a23c);if(_0x44e968[_0x2006('0x55')]>0x0){return _0x64c7a9(_0x55c6f6[_0x2006('0x19')](0x1f4,_[_0x2006('0x59')](_0x44e968,_0x2006('0x1e'))[_0x2006('0x12')](',\x20')));}var _0x230582=_['find'](_0x2e5b8d['queueChannels'],{'uniqueid':_0x26a23c[_0x2006('0x5a')]});if(_0x230582&&_0x230582[_0x2006('0x5e')]){return ami[_0x2006('0x1c')]({'action':_0x2006('0x75'),'channel':_0x230582[_0x2006('0x5e')],'exten':_0x26a23c['exten'],'context':_0x26a23c[_0x2006('0x76')]||_0x230582[_0x2006('0x76')],'priority':0x1})['then'](function(_0x58d84c){_0xce5cbd({'code':0xc8,'message':[_0x26a23c[_0x2006('0x5a')],_0x58d84c[_0x2006('0x1e')]['toLowerCase']()]['join']('\x20')});})[_0x2006('0x18')](function(_0x300d3d){_0x64c7a9(_0x55c6f6[_0x2006('0x19')](0x1f5,[_0x26a23c[_0x2006('0x5a')],_0x300d3d[_0x2006('0x1e')][_0x2006('0x63')]()][_0x2006('0x12')]('\x20')));});}else{return _0x64c7a9(_0x55c6f6[_0x2006('0x19')](0x1f5,_0x2006('0x69')));}});},'Agents':function(_0x1c20e7){return new Promise(function(_0x402a4c,_0x3af201){var _0x3b3753=_['values'](_0x2e5b8d[_0x2006('0xc')]);_0x402a4c({'count':_0x3b3753[_0x2006('0x55')],'rows':_0x3b3753});});},'Telephones':function(_0x34f7d8){return new Promise(function(_0x5c12be,_0x2b9a28){var _0x8eeacd=_['values'](_0x2e5b8d[_0x2006('0x77')]);_0x5c12be({'count':_0x8eeacd[_0x2006('0x55')],'rows':_0x8eeacd});});},'Trunks':function(_0x10e6f5){return new Promise(function(_0x21e9cd,_0x325572){var _0x292246=_[_0x2006('0x71')](_0x2e5b8d[_0x2006('0x78')]);_0x21e9cd({'count':_0x292246[_0x2006('0x55')],'rows':_0x292246});});},'OutboundChannels':function(_0x395c80){return new Promise(function(_0x36e7e7,_0x253ce8){var _0x40e265=_[_0x2006('0x71')](_0x2e5b8d[_0x2006('0x79')]);_0x36e7e7({'count':_0x40e265[_0x2006('0x55')],'rows':_0x40e265});});},'Outbound':function(_0x4aef30){return new Promise(function(_0x3db811,_0x3416c3){_0x3db811(_0x2e5b8d[_0x2006('0x29')]);});},'Campaigns':function(_0x2e5960){return new Promise(function(_0x14426c,_0x4cdc42){var _0x317186=_[_0x2006('0x71')](_0x2e5b8d[_0x2006('0x7a')]);_0x14426c({'count':_0x317186[_0x2006('0x55')],'rows':_0x317186});});},'VoiceQueuesPreview':function(_0x2fe6ac){var _0x89a37=this;return new Promise(function(_0x244e0b,_0x50f92b){_0x1f987d['run'](_0x2fe6ac['id'])[_0x2006('0x17')](function(_0x4a6e20){_0x244e0b({'code':0xc8,'message':_0x4a6e20['message']});})[_0x2006('0x18')](function(_0xd29b93){_0x50f92b(_0x89a37[_0x2006('0x19')](0x1f4,_0xd29b93[_0x2006('0x1e')]));});});},'EventManager':function(_0x4706bb){var _0x40d7f8=this;return new Promise(function(_0x1eafde,_0x4fa257){if(!_0x4706bb[_0x2006('0x7b')]){return _0x4fa257(_0x40d7f8['error'](0x1f4,_0x2006('0x7c')));}ami['emit'](_0x2006('0x7d')+_0x4706bb[_0x2006('0x7b')],_0x4706bb['message']);_0x1eafde({'code':0xc8,'message':_0x4706bb});});},'FaxAccounts':function(_0x1357cd){return new Promise(function(_0x26a813,_0x3dce0f){var _0x10df46=_[_0x2006('0x71')](_0x2e5b8d['faxAccounts']);_0x26a813({'count':_0x10df46['length'],'rows':_0x10df46});});},'SendFax':function(_0x1979e5){var _0x2df101=this;return new Promise(function(_0x4f0c7b,_0x43bd20){_0x173642[_0x2006('0x7e')](_0x1979e5)[_0x2006('0x17')](function(_0x34be56){_0x4f0c7b({'code':0xc8,'message':_0x34be56[_0x2006('0x1e')]});})['catch'](function(_0x546b4b){_0x43bd20(_0x2df101['error'](0x1f4,_0x546b4b[_0x2006('0x1e')]));});});},'CheckAfterSend':function(_0x58fc34){var _0x5b4ed3=this;return new Promise(function(_0x49f2a6,_0x207478){_0x173642[_0x2006('0x7f')](_0x58fc34)[_0x2006('0x17')](function(_0x204730){_0x49f2a6({'code':0xc8,'message':_0x204730['message']});})['catch'](function(_0xc000e){_0x207478(_0x5b4ed3[_0x2006('0x19')](0x1f4,_0xc000e['message']));});});}};var _0x38c944=jayson['server'](_0x418382)[_0x2006('0x80')]();_0x38c944['on'](_0x2006('0x19'),function(_0x3b0fb0){return _0x58999e(_0x3b0fb0);});_0x38c944['listen'](0x232a,_0x2006('0x81'),function(){console[_0x2006('0x82')](_0x2006('0x83'),0x232a);return _0x254d9e('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js
index 0642c20..c60358b 100644
--- a/server/services/ami/trigger/cmContact/index.js
+++ b/server/services/ami/trigger/cmContact/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb78e=['[%s][%s]\x20Contact\x20created:%s','toLowerCase','merge','catch','error','[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','destcalleridname','destcalleridnum','phone','uniqueid','then','showContact','omit','xmd-contactid2','format','user:%s','name','trigger:%s','action','[%s][%s]\x20Contact\x20not\x20found','resolve'];(function(_0x2c1aa8,_0x3e0609){var _0x4019f5=function(_0x916eac){while(--_0x916eac){_0x2c1aa8['push'](_0x2c1aa8['shift']());}};_0x4019f5(++_0x3e0609);}(_0xb78e,0x1c9));var _0xeb78=function(_0x4535e6,_0x217c84){_0x4535e6=_0x4535e6-0x0;var _0x497054=_0xb78e[_0x4535e6];return _0x497054;};'use strict';var BPromise=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var _=require('lodash');var Redis=require(_0xeb78('0x2'));var config=require(_0xeb78('0x3'));var logger=require(_0xeb78('0x4'))(_0xeb78('0x5'));var cmContactRpc=require(_0xeb78('0x6'));config[_0xeb78('0x7')]=_[_0xeb78('0x8')](config[_0xeb78('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xeb78('0x9'))(new Redis(config[_0xeb78('0x7')]));function emit(_0x1ccc2f,_0x30c884,_0x2b7925,_0x36963f){logger[_0xeb78('0xa')]('[%s][%s]',_0x1ccc2f,'',_0x30c884,_0x2b7925,JSON[_0xeb78('0xb')](_0x36963f));io['to'](_0x30c884)[_0xeb78('0xc')](_0x2b7925,_0x36963f);}exports[_0xeb78('0xd')]=function(_0x46fbad,_0x125e97,_0x402680){_0x402680[_0xeb78('0xe')]=0x0;if(_0x125e97[_0xeb78('0xf')]&&parseInt(_0x125e97[_0xeb78('0xf')],0xa)){var _0x59d8d8={'ListId':parseInt(_0x125e97[_0xeb78('0x10')],0xa),'phone':_0x402680[_0xeb78('0x11')]};if(_[_0xeb78('0x12')](_0x402680[_0xeb78('0x13')])){_0x59d8d8[_0xeb78('0x14')]=_0x402680[_0xeb78('0x15')]&&_0x402680[_0xeb78('0x15')]!==_0xeb78('0x16')?_0x402680[_0xeb78('0x15')]:_0x402680[_0xeb78('0x11')]||_0x402680['uniqueid'];}else{_0x59d8d8[_0xeb78('0x14')]=_0x402680[_0xeb78('0x17')]&&_0x402680['destcalleridname']!==''?_0x402680['destcalleridname']:_0x402680[_0xeb78('0x18')]||_0x402680['uniqueid'];_0x59d8d8[_0xeb78('0x19')]=_0x402680[_0xeb78('0x17')]&&_0x402680['destcalleridname']!==_0xeb78('0x16')?_0x402680['destcalleridname']:_0x402680[_0xeb78('0x18')]||_0x402680[_0xeb78('0x1a')];}BPromise['resolve']()[_0xeb78('0x1b')](cmContactRpc[_0xeb78('0x1c')]({'where':_[_0xeb78('0x1d')](_0x59d8d8,['firstName'])}))[_0xeb78('0x1b')](function(_0x2c43c5){if(_0x2c43c5){logger['info']('[%s][%s]\x20Contact\x20found:%s',_0x402680[_0xeb78('0x1a')],'',_0x2c43c5['id']);if(_0x46fbad){_0x402680[_0xeb78('0x1e')]=_0x2c43c5['id'];emit(_0x402680[_0xeb78('0x1a')],util[_0xeb78('0x1f')](_0xeb78('0x20'),_0x46fbad[_0xeb78('0x21')]),util[_0xeb78('0x1f')](_0xeb78('0x22'),_0x125e97[_0xeb78('0x23')]['toLowerCase']()),_['merge'](_0x402680,{'ListId':parseInt(_0x125e97['data1'],0xa)}));}return;}else{logger['info'](_0xeb78('0x24'),_0x402680['uniqueid'],'');return BPromise[_0xeb78('0x25')]()[_0xeb78('0x1b')](cmContactRpc['createContact'](_0x59d8d8));}})[_0xeb78('0x1b')](function(_0x4ac816){if(_0x4ac816){logger[_0xeb78('0xa')](_0xeb78('0x26'),_0x402680[_0xeb78('0x1a')],'',_0x4ac816['id']);if(_0x46fbad){_0x402680[_0xeb78('0x1e')]=_0x4ac816['id'];emit(_0x402680['uniqueid'],util[_0xeb78('0x1f')]('user:%s',_0x46fbad[_0xeb78('0x21')]),util[_0xeb78('0x1f')](_0xeb78('0x22'),_0x125e97['action'][_0xeb78('0x27')]()),_[_0xeb78('0x28')](_0x402680,{'ListId':parseInt(_0x125e97[_0xeb78('0x10')],0xa)}));}}})[_0xeb78('0x29')](function(_0x3d4a97){logger[_0xeb78('0x2a')](_0xeb78('0x2b'),_0x402680[_0xeb78('0x1a')],'',JSON[_0xeb78('0xb')](_0x3d4a97));});}else{if(_0x46fbad){logger[_0xeb78('0xa')](_0xeb78('0x2c'),_0x402680['uniqueid'],'');emit(_0x402680['uniqueid'],util['format'](_0xeb78('0x20'),_0x46fbad[_0xeb78('0x21')]),util[_0xeb78('0x1f')]('trigger:%s',_0x125e97[_0xeb78('0x23')][_0xeb78('0x27')]()),_[_0xeb78('0x28')]({'ListId':parseInt(_0x125e97[_0xeb78('0x10')],0xa)},_0x402680));}}};
\ No newline at end of file
+var _0x6441=['then','showContact','omit','xmd-contactid2','format','user:%s','name','action','toLowerCase','merge','[%s][%s]\x20Contact\x20not\x20found','createContact','[%s][%s]\x20Contact\x20created:%s','data1','catch','[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','trigger:%s','util','lodash','ioredis','../../../../config/environment','trigger','redis','defaults','socket.io-emitter','info','[%s][%s]','stringify','emit','exec','autoCreate','data2','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x6441,0x96));var _0x1644=function(_0x15d34d,_0x44e4f7){_0x15d34d=_0x15d34d-0x0;var _0x52c8c1=_0x6441[_0x15d34d];return _0x52c8c1;};'use strict';var BPromise=require('bluebird');var util=require(_0x1644('0x0'));var _=require(_0x1644('0x1'));var Redis=require(_0x1644('0x2'));var config=require(_0x1644('0x3'));var logger=require('../../../../config/logger')(_0x1644('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x1644('0x5')]=_[_0x1644('0x6')](config[_0x1644('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1644('0x7'))(new Redis(config[_0x1644('0x5')]));function emit(_0x4c1699,_0x3c702c,_0x41cab0,_0x473394){logger[_0x1644('0x8')](_0x1644('0x9'),_0x4c1699,'',_0x3c702c,_0x41cab0,JSON[_0x1644('0xa')](_0x473394));io['to'](_0x3c702c)[_0x1644('0xb')](_0x41cab0,_0x473394);}exports[_0x1644('0xc')]=function(_0x1dd9ab,_0x2023c3,_0x9610b0){_0x9610b0[_0x1644('0xd')]=0x0;if(_0x2023c3[_0x1644('0xe')]&&parseInt(_0x2023c3[_0x1644('0xe')],0xa)){var _0x5382ee={'ListId':parseInt(_0x2023c3['data1'],0xa),'phone':_0x9610b0[_0x1644('0xf')]};if(_[_0x1644('0x10')](_0x9610b0[_0x1644('0x11')])){_0x5382ee[_0x1644('0x12')]=_0x9610b0[_0x1644('0x13')]&&_0x9610b0[_0x1644('0x13')]!==_0x1644('0x14')?_0x9610b0['calleridname']:_0x9610b0['calleridnum']||_0x9610b0[_0x1644('0x15')];}else{_0x5382ee[_0x1644('0x12')]=_0x9610b0[_0x1644('0x16')]&&_0x9610b0['destcalleridname']!==_0x1644('0x14')?_0x9610b0[_0x1644('0x16')]:_0x9610b0[_0x1644('0x17')]||_0x9610b0[_0x1644('0x15')];_0x5382ee[_0x1644('0x18')]=_0x9610b0[_0x1644('0x16')]&&_0x9610b0[_0x1644('0x16')]!==_0x1644('0x14')?_0x9610b0[_0x1644('0x16')]:_0x9610b0[_0x1644('0x17')]||_0x9610b0['uniqueid'];}BPromise[_0x1644('0x19')]()[_0x1644('0x1a')](cmContactRpc[_0x1644('0x1b')]({'where':_[_0x1644('0x1c')](_0x5382ee,['firstName'])}))['then'](function(_0x243b32){if(_0x243b32){logger[_0x1644('0x8')]('[%s][%s]\x20Contact\x20found:%s',_0x9610b0['uniqueid'],'',_0x243b32['id']);if(_0x1dd9ab){_0x9610b0[_0x1644('0x1d')]=_0x243b32['id'];emit(_0x9610b0['uniqueid'],util[_0x1644('0x1e')](_0x1644('0x1f'),_0x1dd9ab[_0x1644('0x20')]),util[_0x1644('0x1e')]('trigger:%s',_0x2023c3[_0x1644('0x21')][_0x1644('0x22')]()),_[_0x1644('0x23')](_0x9610b0,{'ListId':parseInt(_0x2023c3['data1'],0xa)}));}return;}else{logger[_0x1644('0x8')](_0x1644('0x24'),_0x9610b0['uniqueid'],'');return BPromise[_0x1644('0x19')]()['then'](cmContactRpc[_0x1644('0x25')](_0x5382ee));}})[_0x1644('0x1a')](function(_0x13ffc4){if(_0x13ffc4){logger['info'](_0x1644('0x26'),_0x9610b0[_0x1644('0x15')],'',_0x13ffc4['id']);if(_0x1dd9ab){_0x9610b0['xmd-contactid2']=_0x13ffc4['id'];emit(_0x9610b0[_0x1644('0x15')],util[_0x1644('0x1e')](_0x1644('0x1f'),_0x1dd9ab[_0x1644('0x20')]),util[_0x1644('0x1e')]('trigger:%s',_0x2023c3[_0x1644('0x21')][_0x1644('0x22')]()),_[_0x1644('0x23')](_0x9610b0,{'ListId':parseInt(_0x2023c3[_0x1644('0x27')],0xa)}));}}})[_0x1644('0x28')](function(_0x29c2bf){logger['error'](_0x1644('0x29'),_0x9610b0['uniqueid'],'',JSON[_0x1644('0xa')](_0x29c2bf));});}else{if(_0x1dd9ab){logger['info'](_0x1644('0x2a'),_0x9610b0[_0x1644('0x15')],'');emit(_0x9610b0[_0x1644('0x15')],util['format'](_0x1644('0x1f'),_0x1dd9ab['name']),util[_0x1644('0x1e')](_0x1644('0x2b'),_0x2023c3['action'][_0x1644('0x22')]()),_[_0x1644('0x23')]({'ListId':parseInt(_0x2023c3['data1'],0xa)},_0x9610b0));}}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js
index 1e79a66..55a978f 100644
--- a/server/services/ami/trigger/index.js
+++ b/server/services/ami/trigger/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd786=['trigger:%s','merge','exec','voiceExtensions','script','parse','query','search','AllConditions','every','checkConditions','channel','some','AnyConditions','field','account','chat','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','routeId','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentbusy','custom:agentreject','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','emit','info','stringify','prototype','clone','interface','checkTriggers','hasOwnProperty','status','checkTrigger','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','html','data2','render','template\x20not\x20found','uri','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winApplication','winArguments','data3','user:%s','name','format','trigger:%s:%s','jscripty'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0xd786,0x18a));var _0x6d78=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xd786[_0x5b561d];return _0x431060;};'use strict';var util=require(_0x6d78('0x0'));var _=require(_0x6d78('0x1'));var url=require(_0x6d78('0x2'));var Mustache=require(_0x6d78('0x3'));var Redis=require(_0x6d78('0x4'));var urlforward=require(_0x6d78('0x5'));var integration=require(_0x6d78('0x6'));var cmContact=require(_0x6d78('0x7'));var script=require(_0x6d78('0x8'));var cmContactRpc=require(_0x6d78('0x9'));var config=require(_0x6d78('0xa'));var logger=require(_0x6d78('0xb'))(_0x6d78('0xc'));var ami=require(_0x6d78('0xd'));config[_0x6d78('0xe')]=_[_0x6d78('0xf')](config[_0x6d78('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x6d78('0x10'))(new Redis(config[_0x6d78('0xe')]));var operators={'equals':function(_0xaa47b9,_0x430dd7){return _0xaa47b9==_0x430dd7;},'not_equals':function(_0x45fa30,_0x1219e1){return _0x45fa30!=_0x1219e1;}};var barAndWebActions=[_0x6d78('0x11'),'url',_0x6d78('0x12')];function Trigger(_0x4852c9){this[_0x6d78('0x13')]=_0x4852c9['triggers'];this[_0x6d78('0x14')]=_0x4852c9[_0x6d78('0x14')];this[_0x6d78('0x15')]=_0x4852c9[_0x6d78('0x15')];this[_0x6d78('0x16')]=_0x4852c9[_0x6d78('0x16')];this['voiceExtensions']=_0x4852c9['voiceExtensions'];this[_0x6d78('0x17')]=_0x4852c9[_0x6d78('0x17')];this[_0x6d78('0x18')]=_0x4852c9['freshdeskAccounts'];this[_0x6d78('0x19')]=_0x4852c9[_0x6d78('0x19')];this['sugarcrmAccounts']=_0x4852c9[_0x6d78('0x1a')];this[_0x6d78('0x1b')]=_0x4852c9[_0x6d78('0x1b')];this[_0x6d78('0x1c')]=_0x4852c9[_0x6d78('0x1c')];this[_0x6d78('0x1d')]=_0x4852c9['vtigerAccounts'];this[_0x6d78('0x1e')]=_0x4852c9[_0x6d78('0x1e')];this[_0x6d78('0x1f')]=_0x4852c9[_0x6d78('0x1f')];this[_0x6d78('0x20')]=_0x4852c9['freshsalesAccounts'];this[_0x6d78('0x21')]={'zendesk':this[_0x6d78('0x17')],'salesforce':this[_0x6d78('0x19')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x6d78('0x1b')],'desk':this[_0x6d78('0x1c')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x6d78('0x1f')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on']('custom:agentconnect',this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on'](_0x6d78('0x24'),this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on'](_0x6d78('0x25'),this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on']('custom:agentnosuchnumber',this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on']('custom:agentnoanswer',this[_0x6d78('0x22')]['bind'](this));ami['on'](_0x6d78('0x26'),this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on']('custom:agentcongestion',this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on'](_0x6d78('0x27'),this['syncCustomEvent']['bind'](this));ami['on']('custom:queuecallerabandon',this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on'](_0x6d78('0x28'),this['syncCustomEvent'][_0x6d78('0x23')](this));ami['on'](_0x6d78('0x29'),this[_0x6d78('0x2a')]['bind'](this));ami['on'](_0x6d78('0x2b'),this[_0x6d78('0x2a')]['bind'](this));ami['on'](_0x6d78('0x2c'),this[_0x6d78('0x2a')]['bind'](this));ami['on'](_0x6d78('0x2d'),this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on'](_0x6d78('0x2e'),this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on'](_0x6d78('0x2f'),this['syncCustomEvent'][_0x6d78('0x23')](this));ami['on'](_0x6d78('0x30'),this[_0x6d78('0x22')]['bind'](this));ami['on']('custom:acceptmessage',this[_0x6d78('0x22')][_0x6d78('0x23')](this));ami['on']('custom:rejectmessage',this[_0x6d78('0x22')][_0x6d78('0x23')](this));}Trigger['prototype'][_0x6d78('0x31')]=function(_0x5c785c,_0x28e9a1,_0x46f9c7){logger[_0x6d78('0x32')](_0x5c785c,_0x28e9a1,JSON[_0x6d78('0x33')](_0x46f9c7));io['to'](_0x5c785c)[_0x6d78('0x31')](_0x28e9a1,_0x46f9c7);};Trigger[_0x6d78('0x34')][_0x6d78('0x22')]=function(_0x5a15d3){var _0x21169a=_[_0x6d78('0x35')](_0x5a15d3);this['checkTriggers'](_0x21169a);};Trigger[_0x6d78('0x34')]['syncAgentDial']=function(_0x4a811f){if(this[_0x6d78('0x14')][_0x4a811f[_0x6d78('0x36')]]){this[_0x6d78('0x22')](_0x4a811f);}};Trigger['prototype'][_0x6d78('0x37')]=function(_0x69e0d){var _0x3de976;for(var _0x4fcb94 in this[_0x6d78('0x13')]){if(this[_0x6d78('0x13')][_0x6d78('0x38')](_0x4fcb94)){if(this[_0x6d78('0x13')][_0x4fcb94][_0x6d78('0x39')]){_0x3de976=this[_0x6d78('0x3a')](this[_0x6d78('0x13')][_0x4fcb94],_0x69e0d);if(_0x3de976){_['merge'](_0x69e0d,_0x69e0d[_0x6d78('0x3b')]);for(var _0x14de3b=0x0,_0x98b293,_0x565c4f,_0x17e2bf;_0x14de3b0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});};
\ No newline at end of file
+var _0xa9e0=['Getting\x20agent\x20with\x20email','format','total_entries','find','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','phone','Motion','CTI','Tags','Descriptions','user','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','lodash','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0a9e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));config[_0x0a9e('0x6')]=_[_0x0a9e('0x7')](config[_0x0a9e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0x8'))(new Redis(config[_0x0a9e('0x6')]));function emit(_0x2cc193,_0x5f41ea,_0x503809){io['to'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea,_0x503809);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x39753a,_0xf81284){if(intUtil[_0x0a9e('0xa')](_0xf81284)===!![]){logger[_0x0a9e('0xb')](_0x0a9e('0xc'),_0xf81284);return request({'uri':util[_0x0a9e('0xd')]('%s/users',_0x39753a['remoteUri'])})['then'](function(_0x4cfe67){if(_0x4cfe67[_0x0a9e('0xe')]){return _[_0x0a9e('0xf')](_0x4cfe67[_0x0a9e('0x10')][_0x0a9e('0x11')],{'email':_0xf81284});}})[_0x0a9e('0x12')](function(_0x69aeb7){if(_0x69aeb7){logger['info'](_0x0a9e('0x13'));return _0x69aeb7;}else{logger[_0x0a9e('0xb')](_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x15'),_0x39753a[_0x0a9e('0x16')])});}});}else{logger['info'](_0x0a9e('0x17'));return request({'uri':util['format'](_0x0a9e('0x15'),_0x39753a['remoteUri'])});}}function request(_0x16033c){logger[_0x0a9e('0x18')]('[HTTP]',JSON[_0x0a9e('0x19')](_0x16033c));return rp(_['defaults'](_0x16033c,{'method':_0x0a9e('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x478723){var _0x106033;if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x1c')){_0x106033=util[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x1f')]);}else if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x20')){_0x106033=util[_0x0a9e('0xd')]('%s/token:%s',_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x20')]);}return util['format'](_0x0a9e('0x21'),new Buffer(_0x106033)['toString']('base64'));}function getEndUser(_0x3a02e1,_0x432e56,_0x38e7c4){logger[_0x0a9e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x38e7c4);return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x22'),_0x3a02e1[_0x0a9e('0x16')]),'qs':{'phone':_0x38e7c4}})[_0x0a9e('0x12')](function(_0x370d86){if(_0x370d86[_0x0a9e('0xe')]){logger[_0x0a9e('0xb')]('Enduser\x20found!');return _0x370d86['_embedded'][_0x0a9e('0x11')][0x0];}else{logger[_0x0a9e('0xb')](_0x0a9e('0x23'));return request({'uri':util[_0x0a9e('0xd')]('%s/customers',_0x3a02e1[_0x0a9e('0x16')]),'method':'POST','body':{'first_name':_0x432e56,'title':_0x432e56,'phone_numbers':[{'type':_0x0a9e('0x24'),'value':_0x38e7c4}]}});}});}function getTags(_0x5bfb33,_0x1dc186){var _0x34dc65=[];if(_0x5bfb33&&_0x5bfb33[_0x0a9e('0x25')]>0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js
index 50a6c2d..d6acc4b 100644
--- a/server/services/ami/trigger/integration/dynamics365.js
+++ b/server/services/ami/trigger/integration/dynamics365.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x673a=['getString','Subjects','Descriptions','/contacts(','Fields','phonecalls','queue','/systemusers(','callDirection','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','remoteUri','serverUrl','stripTrailingSlash','format','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','toLowerCase','destcalleridnum','contacts','4.0','headers','substring','lastIndexOf','enduserId','outbound','calleridnum','telephone1',']\x20Enduser\x20created!','forEach','type','nameField','customField','indexOf','content','ticketType','assign'];(function(_0x20cb54,_0x118325){var _0x8f64df=function(_0x200535){while(--_0x200535){_0x20cb54['push'](_0x20cb54['shift']());}};_0x8f64df(++_0x118325);}(_0x673a,0x133));var _0xa673=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0x673a[_0x3d78d7];return _0x4b6784;};'use strict';var _=require('lodash');var BPromise=require(_0xa673('0x0'));var rp=require('request-promise');var util=require(_0xa673('0x1'));var intUtil=require('./util');var md5=require(_0xa673('0x2'));var Redis=require(_0xa673('0x3'));var logger=require(_0xa673('0x4'))(_0xa673('0x5'));var config=require(_0xa673('0x6'));config[_0xa673('0x7')]=_[_0xa673('0x8')](config[_0xa673('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xa673('0x9'))(new Redis(config['redis']));function getAuthToken(_0x225b70,_0xb2b1dc,_0x4e78f9){var _0x22cd12={'method':_0xa673('0xa'),'uri':_0xb2b1dc,'form':{'client_id':_0x225b70[_0xa673('0xb')],'resource':_0x225b70['remoteUri'],'username':_0x225b70[_0xa673('0xc')],'password':_0x225b70[_0xa673('0xd')],'grant_type':_0xa673('0xd'),'client_secret':_0x225b70[_0xa673('0xe')]},'json':!![]};return rp(_0x22cd12)[_0xa673('0xf')](function(_0x39746d){return _0x39746d[_0xa673('0x10')];})[_0xa673('0x11')](function(_0x1b1ad0){logger[_0xa673('0x12')]('['+[_0x4e78f9['toUpperCase']()]+_0xa673('0x13'));return _0x1b1ad0[_0xa673('0x14')];});}function getUser(_0x3e79c8,_0x1642d1,_0x2548ef,_0x51a8e4,_0x26157e,_0x566a13){return new BPromise(function(_0x2e38df,_0x5ef65e){return getAuthToken(_0x1642d1,_0x51a8e4,_0x566a13)['then'](function(_0x5c2529){var _0xba0958={'method':_0xa673('0x15'),'uri':_0x26157e+_0xa673('0x16'),'headers':{'Authorization':_0xa673('0x17')+_0x5c2529,'OData-Version':'4.0'},'json':!![]};return rp(_0xba0958);})[_0xa673('0xf')](function(_0x403f38){var _0x61f8b1=_0x403f38[_0xa673('0x18')];var _0x431982=![];var _0x4ef3a6=null;if(!_[_0xa673('0x19')](_0x2548ef)){if(intUtil[_0xa673('0x1a')](_0x2548ef[_0xa673('0x1b')])){_0x3e79c8[_0xa673('0x1c')]=_0x2548ef[_0xa673('0x1b')];for(_0x4ef3a6=0x0;_0x4ef3a6<_0x61f8b1['length'];_0x4ef3a6++){if(_0x61f8b1[_0x4ef3a6][_0xa673('0x1d')]===_0x2548ef[_0xa673('0x1b')]&&!_0x61f8b1[_0x4ef3a6]['isdisabled']){_0x431982=!![];logger[_0xa673('0x1e')]('['+[_0x566a13['toUpperCase']()]+_0xa673('0x1f')+_0x61f8b1[_0x4ef3a6][_0xa673('0x20')]+'!');_0x3e79c8[_0xa673('0x21')]=_0x61f8b1[_0x4ef3a6][_0xa673('0x20')];}}}}if(!_0x431982){logger['info']('['+[_0x566a13[_0xa673('0x22')]()]+_0xa673('0x23'));_0x3e79c8[_0xa673('0x1c')]=_0x1642d1['username'];for(_0x4ef3a6=0x0;_0x4ef3a6<_0x61f8b1[_0xa673('0x24')];_0x4ef3a6++){if(_0x61f8b1[_0x4ef3a6][_0xa673('0x1d')]===_0x1642d1[_0xa673('0xc')]){_0x3e79c8[_0xa673('0x21')]=_0x61f8b1[_0x4ef3a6][_0xa673('0x20')];}}}_0x2e38df(_0x3e79c8);})[_0xa673('0x11')](function(_0x30fa81){_0x5ef65e(_0x30fa81[_0xa673('0x14')]);});});}function createEndUser(_0x15db61,_0x557662,_0x3da6fd,_0x2fb52e,_0x176efb,_0x208af2){return new BPromise(function(_0x572c4a,_0x402286){return getAuthToken(_0x557662,_0x3da6fd,_0x208af2)['then'](function(_0x4d5005){var _0x3bb7ab=_0x208af2[_0xa673('0x25')]()==='outbound'?_0x176efb[_0xa673('0x26')]:_0x176efb['calleridnum'];var _0x38a12e={'method':_0xa673('0xa'),'uri':_0x2fb52e+_0xa673('0x27'),'body':{'telephone1':_0x3bb7ab,'fullname':_0x3bb7ab,'firstname':_0x3bb7ab,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x15db61[_0xa673('0x21')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4d5005,'OData-Version':_0xa673('0x28')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x38a12e);})[_0xa673('0xf')](function(_0x1d872c){var _0x27ce72=_0x1d872c[_0xa673('0x29')]['odata-entityid'];var _0x15914c=_0x27ce72[_0xa673('0x2a')](_0x27ce72[_0xa673('0x2b')]('(')+0x1,_0x27ce72[_0xa673('0x2b')](')'));_0x15db61[_0xa673('0x2c')]=_0x15914c;_0x572c4a(_0x15db61);})[_0xa673('0x11')](function(_0x12699d){_0x402286(_0x12699d[_0xa673('0x14')]);});});}function getEndUser(_0x3ae30b,_0x30a2e4,_0x3469e9,_0x259dc2,_0x52f6be,_0x53a41b){return new BPromise(function(_0x252b09,_0x434958){return getAuthToken(_0x30a2e4,_0x3469e9,_0x53a41b)[_0xa673('0xf')](function(_0x57bfd7){var _0x4fa3af={'method':'GET','uri':_0x259dc2+'contacts?$select=telephone1','headers':{'Authorization':_0xa673('0x17')+_0x57bfd7,'If-None-Match':null,'OData-Version':_0xa673('0x28')},'json':!![]};return rp(_0x4fa3af);})[_0xa673('0xf')](function(_0x4d5843){var _0xe92345=null;if(_0x4d5843){var _0x39656e=_0x4d5843[_0xa673('0x18')];var _0x5d4597=![];for(_0xe92345=0x0;_0xe92345<_0x39656e[_0xa673('0x24')];_0xe92345++){var _0x1b5dd2=_0x53a41b['toLowerCase']()===_0xa673('0x2d')?_0x52f6be[_0xa673('0x26')]:_0x52f6be[_0xa673('0x2e')];if(_0x39656e[_0xe92345][_0xa673('0x2f')]===_0x1b5dd2){_0x5d4597=!![];_0x3ae30b[_0xa673('0x2c')]=_0x39656e[_0xe92345]['contactid'];}}if(_0x5d4597){_0x252b09(_0x3ae30b);}else{return createEndUser(_0x3ae30b,_0x30a2e4,_0x3469e9,_0x259dc2,_0x52f6be,_0x53a41b)[_0xa673('0xf')](function(_0x584022){logger['info']('['+[_0x53a41b[_0xa673('0x22')]()]+_0xa673('0x30'),_0x584022[_0xa673('0x2c')]);_0x252b09(_0x584022);});}}else{return createEndUser(_0x3ae30b,_0x30a2e4,_0x3469e9,_0x259dc2,_0x52f6be,_0x53a41b)['then'](function(_0x5dca9a){logger['info']('['+[_0x53a41b[_0xa673('0x22')]()]+']\x20Enduser\x20Created!',_0x5dca9a['enduserId']);_0x252b09(_0x5dca9a);});}});});}function getCustomFields(_0x3b54a6,_0x465099,_0x38a5ca){var _0x4b1ed7={};if(_0x3b54a6[_0xa673('0x24')]>0x0){_[_0xa673('0x31')](_0x3b54a6,function(_0x24f295){if(_0x24f295[_0xa673('0x32')]==='string'&&_0x24f295[_0xa673('0x33')]&&!_0x24f295[_0xa673('0x34')]){var _0x9769a5=_0x24f295['idField'][_0xa673('0x25')]();var _0x4672b3=_0x9769a5[_0xa673('0x2a')](0x0,_0x9769a5[_0xa673('0x35')]('_'));var _0x129068=_0x9769a5['substring'](_0x9769a5[_0xa673('0x35')]('_')+0x1);if(_0x4672b3===_0x38a5ca){_0x4b1ed7[_0x129068]=_0x24f295[_0xa673('0x36')];}}});}return _0x4b1ed7;}function getTicket(_0x2fc677,_0x7e9387,_0x5ea9c9,_0x58da8a,_0x574f54,_0x19a808,_0x4769f4){return new BPromise(function(_0x1221b3,_0x38284f){var _0x841b82;return getAuthToken(_0x7e9387,_0x5ea9c9,_0x4769f4)[_0xa673('0xf')](function(_0x39019e){if(_0x19a808[_0xa673('0x37')]==='incident'){_0x841b82={'method':'POST','uri':_0x58da8a+'incidents','body':Object[_0xa673('0x38')]({},{'title':intUtil[_0xa673('0x39')](_0x19a808[_0xa673('0x3a')],_0x574f54,'\x20'),'description':intUtil[_0xa673('0x39')](_0x19a808[_0xa673('0x3b')],_0x574f54,'\x0a'),'customerid_contact@odata.bind':_0xa673('0x3c')+_0x2fc677[_0xa673('0x2c')]+')','ownerid@odata.bind':'/systemusers('+_0x2fc677['userId']+')','caseorigincode':'1'},getCustomFields(_0x19a808[_0xa673('0x3d')],_0x574f54,_0x19a808[_0xa673('0x37')])),'headers':{'Authorization':_0xa673('0x17')+_0x39019e,'OData-Version':_0xa673('0x28')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x19a808['ticketType']==='phonecall'){_0x841b82={'method':_0xa673('0xa'),'uri':_0x58da8a+_0xa673('0x3e'),'body':Object[_0xa673('0x38')]({},{'subject':intUtil[_0xa673('0x39')](_0x19a808['Subjects'],_0x574f54,'\x20'),'phonenumber':String(_0x574f54['calleridnum']),'description':intUtil[_0xa673('0x39')](_0x19a808[_0xa673('0x3b')],_0x574f54,'\x0a'),'regardingobjectid_contact@odata.bind':_0xa673('0x3c')+_0x2fc677['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x2fc677[_0xa673('0x21')]+')','directioncode':_0x2fc677['callDirection']===_0xa673('0x3f')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xa673('0x40')+_0x2fc677['userId']+')','participationtypemask':_0x2fc677[_0xa673('0x41')]===_0xa673('0x3f')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2fc677[_0xa673('0x2c')]+')','participationtypemask':_0x2fc677[_0xa673('0x41')]==='queue'?0x1:0x2}]},getCustomFields(_0x19a808['Fields'],_0x574f54,_0x19a808[_0xa673('0x37')])),'headers':{'Authorization':'Bearer\x20'+_0x39019e,'OData-Version':_0xa673('0x28')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x841b82);})[_0xa673('0xf')](function(_0x401059){var _0x6ee697=_0x401059[_0xa673('0x29')][_0xa673('0x42')];var _0x4ea6eb=_0x6ee697[_0xa673('0x2a')](_0x6ee697[_0xa673('0x2b')]('(')+0x1,_0x6ee697[_0xa673('0x2b')](')'));_0x2fc677[_0xa673('0x43')]=_0x4ea6eb;_0x1221b3(_0x2fc677);})[_0xa673('0x11')](function(_0x5b9136){_0x38284f(_0x5b9136[_0xa673('0x14')]);});});}function emit(_0x2ad389,_0xaf7223,_0x4d8319,_0x345c25){var _0xffc873={'uri':util['format'](_0xa673('0x44'),_0x2ad389,_0x4d8319,_0x345c25)};io['to'](util['format']('user:%s',_0xaf7223))['emit'](_0xa673('0x45'),_0xffc873);}exports['cs']=function(_0x50ea53,_0x3468d7,_0x4fae10,_0x314d1d,_0x3b6948,_0x51ed99,_0x131021,_0x4e2b7c){var _0x438114={};_0x51ed99[_0xa673('0x46')]=intUtil['stripTrailingSlash'](_0x51ed99['remoteUri']);_0x51ed99[_0xa673('0x47')]=intUtil[_0xa673('0x48')](_0x51ed99[_0xa673('0x47')]);_0x438114[_0xa673('0x41')]=_0x4e2b7c===_0xa673('0x3f')||_0x4e2b7c==='unmanaged'?_0xa673('0x3f'):_0xa673('0x2d');var _0x2eb37e=util[_0xa673('0x49')](_0xa673('0x4a'),_0x51ed99[_0xa673('0x46')]);var _0x18e714=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x51ed99[_0xa673('0x4b')]);var _0x25cf08=util[_0xa673('0x49')](_0xa673('0x4c'),_0x51ed99[_0xa673('0x47')],_0x3468d7[_0xa673('0x4d')],md5(_0x3468d7[_0xa673('0x4d')]));if(_0x3b6948&&_0x3b6948['monitor_format']){logger[_0xa673('0x1e')](_0xa673('0x4e'),_0xa673('0x4f'));_0x3468d7[_0xa673('0x50')]=_0x25cf08;}else if(_0x131021&&_0x131021[_0xa673('0x51')]&&_0x131021[_0xa673('0x51')]!=='none'){logger['info'](_0xa673('0x52'),'Recording\x20is\x20enabled!');_0x3468d7[_0xa673('0x50')]=_0x25cf08;}else{_0x3468d7[_0xa673('0x50')]='';}return getUser(_0x438114,_0x51ed99,_0x314d1d,_0x18e714,_0x2eb37e,_0x4e2b7c)[_0xa673('0xf')](function(_0x4cbbea){logger[_0xa673('0x1e')]('['+_0x4e2b7c[_0xa673('0x22')]()+']\x20The\x20User\x20ID\x20is:',_0x4cbbea['userId']);logger[_0xa673('0x1e')]('['+_0x4e2b7c[_0xa673('0x22')]()+']\x20The\x20User\x20email\x20is:',_0x4cbbea[_0xa673('0x1c')]);return getEndUser(_0x4cbbea,_0x51ed99,_0x18e714,_0x2eb37e,_0x3468d7,_0x4e2b7c);})[_0xa673('0xf')](function(_0x1f065){logger[_0xa673('0x1e')]('['+_0x4e2b7c[_0xa673('0x22')]()+_0xa673('0x53'),_0x1f065[_0xa673('0x2c')]);logger[_0xa673('0x1e')]('['+_0x4e2b7c[_0xa673('0x22')]()+_0xa673('0x54'),_0x3468d7[_0xa673('0x2e')]);return getTicket(_0x1f065,_0x51ed99,_0x18e714,_0x2eb37e,_0x3468d7,_0x4fae10,_0x4e2b7c);})[_0xa673('0xf')](function(_0x1d0d0c){logger[_0xa673('0x1e')](util['format']('['+_0x4e2b7c[_0xa673('0x22')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x4fae10['ticketType'],_0x1d0d0c[_0xa673('0x43')]));logger[_0xa673('0x1e')](util['format']('['+_0x4e2b7c[_0xa673('0x22')]()+_0xa673('0x55'),_0x4e2b7c));if(_0x4e2b7c!==_0xa673('0x56')){logger[_0xa673('0x1e')]('['+_0x4e2b7c['toUpperCase']()+']',_0xa673('0x57'));emit(_0x51ed99[_0xa673('0x46')],_0x314d1d[_0xa673('0x58')],_0x4fae10[_0xa673('0x37')],_0x1d0d0c[_0xa673('0x43')]);}})[_0xa673('0x11')](function(_0x478ac4){logger['error']('['+_0x4e2b7c[_0xa673('0x22')]()+_0xa673('0x59'),util[_0xa673('0x5a')](_0x478ac4,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xed3c=['callDirection','queue','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','POST','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','then','GET','value','validateEmail','userEmail','length','internalemailaddress','email','isdisabled','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','message','toLowerCase','outbound','calleridnum','contacts','headers','substring','lastIndexOf','enduserId','contacts?$select=telephone1','Bearer\x20','telephone1',']\x20Enduser\x20Created!','forEach','type','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','/systemusers(','Fields','4.0','phonecalls','Descriptions'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xed3c,0x18f));var _0xced3=function(_0x4e1280,_0x3b8e04){_0x4e1280=_0x4e1280-0x0;var _0x59c5f=_0xed3c[_0x4e1280];return _0x59c5f;};'use strict';var _=require(_0xced3('0x0'));var BPromise=require(_0xced3('0x1'));var rp=require(_0xced3('0x2'));var util=require(_0xced3('0x3'));var intUtil=require(_0xced3('0x4'));var md5=require(_0xced3('0x5'));var Redis=require('ioredis');var logger=require(_0xced3('0x6'))(_0xced3('0x7'));var config=require(_0xced3('0x8'));config['redis']=_[_0xced3('0x9')](config[_0xced3('0xa')],{'host':_0xced3('0xb'),'port':0x18eb});var io=require(_0xced3('0xc'))(new Redis(config[_0xced3('0xa')]));function getAuthToken(_0x5b5f44,_0x5b7f6c,_0x3e40eb){var _0x35405d={'method':_0xced3('0xd'),'uri':_0x5b7f6c,'form':{'client_id':_0x5b5f44['clientId'],'resource':_0x5b5f44['remoteUri'],'username':_0x5b5f44['username'],'password':_0x5b5f44[_0xced3('0xe')],'grant_type':_0xced3('0xe'),'client_secret':_0x5b5f44[_0xced3('0xf')]},'json':!![]};return rp(_0x35405d)['then'](function(_0x24ee71){return _0x24ee71[_0xced3('0x10')];})[_0xced3('0x11')](function(_0x9562eb){logger[_0xced3('0x12')]('['+[_0x3e40eb[_0xced3('0x13')]()]+_0xced3('0x14'));return _0x9562eb['message'];});}function getUser(_0x2b9076,_0x5e1aa5,_0x2392ad,_0x32ae14,_0x160494,_0x5db075){return new BPromise(function(_0x45a0d3,_0x5eec40){return getAuthToken(_0x5e1aa5,_0x32ae14,_0x5db075)[_0xced3('0x15')](function(_0xbf7661){var _0x4f5646={'method':_0xced3('0x16'),'uri':_0x160494+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0xbf7661,'OData-Version':'4.0'},'json':!![]};return rp(_0x4f5646);})[_0xced3('0x15')](function(_0x334eb5){var _0x1b6c98=_0x334eb5[_0xced3('0x17')];var _0x1a19ef=![];var _0x3bcba4=null;if(!_['isNil'](_0x2392ad)){if(intUtil[_0xced3('0x18')](_0x2392ad['email'])){_0x2b9076[_0xced3('0x19')]=_0x2392ad['email'];for(_0x3bcba4=0x0;_0x3bcba4<_0x1b6c98[_0xced3('0x1a')];_0x3bcba4++){if(_0x1b6c98[_0x3bcba4][_0xced3('0x1b')]===_0x2392ad[_0xced3('0x1c')]&&!_0x1b6c98[_0x3bcba4][_0xced3('0x1d')]){_0x1a19ef=!![];logger['info']('['+[_0x5db075[_0xced3('0x13')]()]+']\x20Agent\x20found\x20'+_0x1b6c98[_0x3bcba4][_0xced3('0x1e')]+'!');_0x2b9076[_0xced3('0x1f')]=_0x1b6c98[_0x3bcba4][_0xced3('0x1e')];}}}}if(!_0x1a19ef){logger[_0xced3('0x20')]('['+[_0x5db075['toUpperCase']()]+_0xced3('0x21'));_0x2b9076[_0xced3('0x19')]=_0x5e1aa5[_0xced3('0x22')];for(_0x3bcba4=0x0;_0x3bcba4<_0x1b6c98[_0xced3('0x1a')];_0x3bcba4++){if(_0x1b6c98[_0x3bcba4]['internalemailaddress']===_0x5e1aa5[_0xced3('0x22')]){_0x2b9076[_0xced3('0x1f')]=_0x1b6c98[_0x3bcba4]['systemuserid'];}}}_0x45a0d3(_0x2b9076);})[_0xced3('0x11')](function(_0x4ead2a){_0x5eec40(_0x4ead2a[_0xced3('0x23')]);});});}function createEndUser(_0x10b247,_0x3e085b,_0x55fd43,_0x56ec20,_0x2684b1,_0x297756){return new BPromise(function(_0x49d12c,_0x52fc61){return getAuthToken(_0x3e085b,_0x55fd43,_0x297756)[_0xced3('0x15')](function(_0x5aedd9){var _0x1f1986=_0x297756[_0xced3('0x24')]()===_0xced3('0x25')?_0x2684b1['destcalleridnum']:_0x2684b1[_0xced3('0x26')];var _0x435a3e={'method':_0xced3('0xd'),'uri':_0x56ec20+_0xced3('0x27'),'body':{'telephone1':_0x1f1986,'fullname':_0x1f1986,'firstname':_0x1f1986,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x10b247[_0xced3('0x1f')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x5aedd9,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x435a3e);})[_0xced3('0x15')](function(_0x4bca86){var _0x512229=_0x4bca86[_0xced3('0x28')]['odata-entityid'];var _0x24e736=_0x512229[_0xced3('0x29')](_0x512229[_0xced3('0x2a')]('(')+0x1,_0x512229[_0xced3('0x2a')](')'));_0x10b247[_0xced3('0x2b')]=_0x24e736;_0x49d12c(_0x10b247);})['catch'](function(_0x4c490a){_0x52fc61(_0x4c490a['message']);});});}function getEndUser(_0x189f48,_0x1feb5f,_0x1f3951,_0x2783bf,_0x12de33,_0x56db92){return new BPromise(function(_0x5ce12e,_0x401648){return getAuthToken(_0x1feb5f,_0x1f3951,_0x56db92)[_0xced3('0x15')](function(_0xb26224){var _0x571f0e={'method':_0xced3('0x16'),'uri':_0x2783bf+_0xced3('0x2c'),'headers':{'Authorization':_0xced3('0x2d')+_0xb26224,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x571f0e);})[_0xced3('0x15')](function(_0x3ce6be){var _0x25555f=null;if(_0x3ce6be){var _0x5bb47=_0x3ce6be[_0xced3('0x17')];var _0x123840=![];for(_0x25555f=0x0;_0x25555f<_0x5bb47[_0xced3('0x1a')];_0x25555f++){var _0x286a6f=_0x56db92[_0xced3('0x24')]()==='outbound'?_0x12de33['destcalleridnum']:_0x12de33[_0xced3('0x26')];if(_0x5bb47[_0x25555f][_0xced3('0x2e')]===_0x286a6f){_0x123840=!![];_0x189f48[_0xced3('0x2b')]=_0x5bb47[_0x25555f]['contactid'];}}if(_0x123840){_0x5ce12e(_0x189f48);}else{return createEndUser(_0x189f48,_0x1feb5f,_0x1f3951,_0x2783bf,_0x12de33,_0x56db92)[_0xced3('0x15')](function(_0x387a70){logger['info']('['+[_0x56db92[_0xced3('0x13')]()]+']\x20Enduser\x20created!',_0x387a70[_0xced3('0x2b')]);_0x5ce12e(_0x387a70);});}}else{return createEndUser(_0x189f48,_0x1feb5f,_0x1f3951,_0x2783bf,_0x12de33,_0x56db92)['then'](function(_0x45ef4d){logger[_0xced3('0x20')]('['+[_0x56db92[_0xced3('0x13')]()]+_0xced3('0x2f'),_0x45ef4d[_0xced3('0x2b')]);_0x5ce12e(_0x45ef4d);});}});});}function getCustomFields(_0x556b1d,_0x26036,_0x4d782d){var _0x464f5b={};if(_0x556b1d[_0xced3('0x1a')]>0x0){_[_0xced3('0x30')](_0x556b1d,function(_0x5f549e){if(_0x5f549e[_0xced3('0x31')]==='string'&&_0x5f549e['nameField']&&!_0x5f549e[_0xced3('0x32')]){var _0x3c841c=_0x5f549e[_0xced3('0x33')][_0xced3('0x24')]();var _0x95f3e=_0x3c841c[_0xced3('0x29')](0x0,_0x3c841c[_0xced3('0x34')]('_'));var _0x4d7eb4=_0x3c841c[_0xced3('0x29')](_0x3c841c[_0xced3('0x34')]('_')+0x1);if(_0x95f3e===_0x4d782d){_0x464f5b[_0x4d7eb4]=_0x5f549e[_0xced3('0x35')];}}});}return _0x464f5b;}function getTicket(_0x295ee7,_0x5a36c7,_0x45dbef,_0x3621d7,_0x1935aa,_0x82d0fe,_0x5e0669){return new BPromise(function(_0x2d10eb,_0x8008ef){var _0x542f30;return getAuthToken(_0x5a36c7,_0x45dbef,_0x5e0669)['then'](function(_0x5bc4ac){if(_0x82d0fe[_0xced3('0x36')]===_0xced3('0x37')){_0x542f30={'method':_0xced3('0xd'),'uri':_0x3621d7+_0xced3('0x38'),'body':Object[_0xced3('0x39')]({},{'title':intUtil[_0xced3('0x3a')](_0x82d0fe[_0xced3('0x3b')],_0x1935aa,'\x20'),'description':intUtil[_0xced3('0x3a')](_0x82d0fe['Descriptions'],_0x1935aa,'\x0a'),'customerid_contact@odata.bind':_0xced3('0x3c')+_0x295ee7[_0xced3('0x2b')]+')','ownerid@odata.bind':_0xced3('0x3d')+_0x295ee7[_0xced3('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x82d0fe[_0xced3('0x3e')],_0x1935aa,_0x82d0fe[_0xced3('0x36')])),'headers':{'Authorization':_0xced3('0x2d')+_0x5bc4ac,'OData-Version':_0xced3('0x3f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x82d0fe[_0xced3('0x36')]==='phonecall'){_0x542f30={'method':_0xced3('0xd'),'uri':_0x3621d7+_0xced3('0x40'),'body':Object['assign']({},{'subject':intUtil[_0xced3('0x3a')](_0x82d0fe[_0xced3('0x3b')],_0x1935aa,'\x20'),'phonenumber':String(_0x1935aa[_0xced3('0x26')]),'description':intUtil[_0xced3('0x3a')](_0x82d0fe[_0xced3('0x41')],_0x1935aa,'\x0a'),'regardingobjectid_contact@odata.bind':_0xced3('0x3c')+_0x295ee7['enduserId']+')','ownerid@odata.bind':_0xced3('0x3d')+_0x295ee7[_0xced3('0x1f')]+')','directioncode':_0x295ee7[_0xced3('0x42')]===_0xced3('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xced3('0x3d')+_0x295ee7[_0xced3('0x1f')]+')','participationtypemask':_0x295ee7[_0xced3('0x42')]===_0xced3('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0xced3('0x3c')+_0x295ee7[_0xced3('0x2b')]+')','participationtypemask':_0x295ee7[_0xced3('0x42')]===_0xced3('0x43')?0x1:0x2}]},getCustomFields(_0x82d0fe[_0xced3('0x3e')],_0x1935aa,_0x82d0fe['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x5bc4ac,'OData-Version':_0xced3('0x3f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x542f30);})[_0xced3('0x15')](function(_0x10f5f3){var _0x5e7b4b=_0x10f5f3[_0xced3('0x28')]['odata-entityid'];var _0x592d0a=_0x5e7b4b[_0xced3('0x29')](_0x5e7b4b[_0xced3('0x2a')]('(')+0x1,_0x5e7b4b[_0xced3('0x2a')](')'));_0x295ee7['ticketId']=_0x592d0a;_0x2d10eb(_0x295ee7);})[_0xced3('0x11')](function(_0x475cd6){_0x8008ef(_0x475cd6[_0xced3('0x23')]);});});}function emit(_0x3d53d7,_0x5e1de3,_0xb4f2a0,_0x224684){var _0x478179={'uri':util['format'](_0xced3('0x44'),_0x3d53d7,_0xb4f2a0,_0x224684)};io['to'](util[_0xced3('0x45')]('user:%s',_0x5e1de3))[_0xced3('0x46')](_0xced3('0x47'),_0x478179);}exports['cs']=function(_0x11c83a,_0x390ded,_0x556b94,_0x2b73a2,_0x129bdd,_0x27fed2,_0xccb366,_0x5c9c6c){var _0x295013={};_0x27fed2[_0xced3('0x48')]=intUtil[_0xced3('0x49')](_0x27fed2[_0xced3('0x48')]);_0x27fed2[_0xced3('0x4a')]=intUtil[_0xced3('0x49')](_0x27fed2['serverUrl']);_0x295013[_0xced3('0x42')]=_0x5c9c6c===_0xced3('0x43')||_0x5c9c6c==='unmanaged'?_0xced3('0x43'):_0xced3('0x25');var _0x21923f=util[_0xced3('0x45')](_0xced3('0x4b'),_0x27fed2[_0xced3('0x48')]);var _0x4a97ed=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x27fed2[_0xced3('0x4c')]);var _0x49798a=util[_0xced3('0x45')](_0xced3('0x4d'),_0x27fed2[_0xced3('0x4a')],_0x390ded[_0xced3('0x4e')],md5(_0x390ded[_0xced3('0x4e')]));if(_0x129bdd&&_0x129bdd[_0xced3('0x4f')]){logger[_0xced3('0x20')](_0xced3('0x50'),_0xced3('0x51'));_0x390ded['recordingURL']=_0x49798a;}else if(_0xccb366&&_0xccb366['recordingFormat']&&_0xccb366[_0xced3('0x52')]!=='none'){logger[_0xced3('0x20')](_0xced3('0x53'),_0xced3('0x51'));_0x390ded[_0xced3('0x54')]=_0x49798a;}else{_0x390ded[_0xced3('0x54')]='';}return getUser(_0x295013,_0x27fed2,_0x2b73a2,_0x4a97ed,_0x21923f,_0x5c9c6c)['then'](function(_0x35fd23){logger[_0xced3('0x20')]('['+_0x5c9c6c[_0xced3('0x13')]()+']\x20The\x20User\x20ID\x20is:',_0x35fd23[_0xced3('0x1f')]);logger[_0xced3('0x20')]('['+_0x5c9c6c[_0xced3('0x13')]()+_0xced3('0x55'),_0x35fd23[_0xced3('0x19')]);return getEndUser(_0x35fd23,_0x27fed2,_0x4a97ed,_0x21923f,_0x390ded,_0x5c9c6c);})[_0xced3('0x15')](function(_0xcb60c8){logger[_0xced3('0x20')]('['+_0x5c9c6c[_0xced3('0x13')]()+_0xced3('0x56'),_0xcb60c8[_0xced3('0x2b')]);logger[_0xced3('0x20')]('['+_0x5c9c6c['toUpperCase']()+_0xced3('0x57'),_0x390ded['calleridnum']);return getTicket(_0xcb60c8,_0x27fed2,_0x4a97ed,_0x21923f,_0x390ded,_0x556b94,_0x5c9c6c);})[_0xced3('0x15')](function(_0x137e0d){logger[_0xced3('0x20')](util[_0xced3('0x45')]('['+_0x5c9c6c[_0xced3('0x13')]()+_0xced3('0x58'),_0x556b94[_0xced3('0x36')],_0x137e0d['ticketId']));logger[_0xced3('0x20')](util[_0xced3('0x45')]('['+_0x5c9c6c['toUpperCase']()+_0xced3('0x59'),_0x5c9c6c));if(_0x5c9c6c!==_0xced3('0x5a')){logger[_0xced3('0x20')]('['+_0x5c9c6c[_0xced3('0x13')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x27fed2['remoteUri'],_0x2b73a2[_0xced3('0x5b')],_0x556b94[_0xced3('0x36')],_0x137e0d['ticketId']);}})[_0xced3('0x11')](function(_0x2577f5){logger['error']('['+_0x5c9c6c['toUpperCase']()+_0xced3('0x5c'),util['inspect'](_0x2577f5,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js
index 78d8072..07d3a2b 100644
--- a/server/services/ami/trigger/integration/freshdesk.js
+++ b/server/services/ami/trigger/integration/freshdesk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa438=['error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','localhost','socket.io-emitter','redis','application/json','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString',' ','Tags','name','Fields','custom_fields','value','format','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','type','nameField','toLowerCase','toString','customField','push','idField','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xa438,0x122));var _0x8a43=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa438[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x8a43('0x0'));var util=require(_0x8a43('0x1'));var Redis=require(_0x8a43('0x2'));var intUtil=require(_0x8a43('0x3'));var config=require(_0x8a43('0x4'));var logger=require(_0x8a43('0x5'))(_0x8a43('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x8a43('0x7'),'port':0x18eb});var io=require(_0x8a43('0x8'))(new Redis(config[_0x8a43('0x9')]));var headers={'Content-Type':_0x8a43('0xa'),'Accept':_0x8a43('0xa')};function emit(_0x17d5ee,_0xcca54b,_0x27979c){io['to'](_0x17d5ee)['emit'](_0xcca54b,_0x27979c);}function getTicket(_0x32d09c,_0x5e0430,_0x43d6d2,_0x19442e,_0x4d5142){logger[_0x8a43('0xb')](_0x8a43('0xc'));var _0x245657=_[_0x8a43('0xd')]({'responder_id':_0x5e0430['id'],'requester_id':_0x43d6d2['id'],'name':util['format'](_0x8a43('0xe'),_0x4d5142[_0x8a43('0xf')]),'phone':_0x4d5142[_0x8a43('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x19442e['Subjects'],_0x4d5142,'\x20'),'description':intUtil[_0x8a43('0x11')](_0x19442e['Descriptions'],_0x4d5142,_0x8a43('0x12')),'tags':getTags(_0x19442e[_0x8a43('0x13')],_0x8a43('0x14'))},getCustomFields(_0x19442e[_0x8a43('0x15')],_0x4d5142));_0x245657[_0x8a43('0x16')]=_['mapValues'](_['keyBy'](_0x245657[_0x8a43('0x16')],'id'),_0x8a43('0x17'));return request({'uri':util[_0x8a43('0x18')](_0x8a43('0x19'),_0x32d09c[_0x8a43('0x1a')]),'method':'POST','body':_0x245657})[_0x8a43('0x1b')](function(_0x19a72b){logger[_0x8a43('0xb')](_0x8a43('0x1c'));return _0x19a72b;});}function getUser(_0x2b496a,_0x2547f8){if(intUtil['validateEmail'](_0x2547f8)){return request({'uri':util[_0x8a43('0x18')](_0x8a43('0x1d'),_0x2b496a[_0x8a43('0x1a')]),'qs':{'email':_0x2547f8}})[_0x8a43('0x1b')](function(_0x46795a){if(_0x46795a[_0x8a43('0x1e')]){logger[_0x8a43('0xb')](_0x8a43('0x1f'));return _[_0x8a43('0x20')](_0x46795a,function(_0x21ca03){return _0x21ca03[_0x8a43('0x21')][_0x8a43('0x22')]===_0x2547f8;});}else{logger['info'](_0x8a43('0x23'));return request({'uri':util[_0x8a43('0x18')](_0x8a43('0x24'),_0x2b496a['remoteUri'])})[_0x8a43('0x1b')](function(_0x294dc1){logger[_0x8a43('0xb')](_0x8a43('0x25'));return _0x294dc1;});}});}else{logger[_0x8a43('0xb')](_0x8a43('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x2b496a['remoteUri'])})[_0x8a43('0x1b')](function(_0x143c1){logger['info'](_0x8a43('0x25'));return _0x143c1;});}}function getEndUser(_0x4df610,_0x4ce7d6,_0x1fac16){logger['info'](_0x8a43('0x27'),_0x1fac16);return request({'uri':util[_0x8a43('0x18')]('%s/api/v2/contacts',_0x4df610['remoteUri']),'qs':{'phone':_0x1fac16}})[_0x8a43('0x1b')](function(_0x54ab46){if(_0x54ab46[_0x8a43('0x1e')]){logger[_0x8a43('0xb')]('Enduser\x20found!');return _[_0x8a43('0x20')](_0x54ab46,{'phone':_0x1fac16});}else{logger[_0x8a43('0xb')](_0x8a43('0x28'));return request({'uri':util['format']('%s/api/v2/contacts',_0x4df610[_0x8a43('0x1a')]),'method':_0x8a43('0x29'),'body':{'name':_0x4ce7d6,'phone':_0x1fac16}})[_0x8a43('0x1b')](function(_0x95b7e4){logger[_0x8a43('0xb')](_0x8a43('0x2a'));return _0x95b7e4;});}});}function getAuth(_0x2273ef){return util[_0x8a43('0x18')](_0x8a43('0x2b'),new Buffer(_0x2273ef[_0x8a43('0x2c')]+':X')['toString'](_0x8a43('0x2d')));}function request(_0x448902){logger[_0x8a43('0x2e')](_0x8a43('0x2f'),JSON[_0x8a43('0x30')](_0x448902));return rp(_[_0x8a43('0x31')](_0x448902,{'method':_0x8a43('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x167b45,_0x470068){var _0x18ee44=[];if(_0x167b45&&_0x167b45[_0x8a43('0x1e')]>0x0){_0x18ee44=_[_0x8a43('0x33')](_0x167b45,_0x470068);}return _0x18ee44;}function getCustomFields(_0x32da73,_0x5e6ce3){var _0x101b35=[];var _0x1acd60={'custom_fields':[]};if(_0x32da73[_0x8a43('0x1e')]>0x0){_[_0x8a43('0x34')](_0x32da73,function(_0x310ca2){if(_0x310ca2[_0x8a43('0x35')]==='string'&&_0x310ca2[_0x8a43('0x36')]&&!_0x310ca2['customField']){_0x1acd60[_0x310ca2[_0x8a43('0x36')][_0x8a43('0x37')]()]=_0x310ca2['content'][_0x8a43('0x38')]();}else if(_0x310ca2[_0x8a43('0x35')]==='string'&&_0x310ca2['idField']&&_0x310ca2[_0x8a43('0x39')]){_0x1acd60[_0x8a43('0x16')][_0x8a43('0x3a')]({'id':_0x310ca2[_0x8a43('0x3b')],'value':_0x310ca2[_0x8a43('0x3c')][_0x8a43('0x38')]()});}else if(_0x310ca2[_0x8a43('0x35')]===_0x8a43('0x3d')&&_0x310ca2[_0x8a43('0x3e')]&&_0x310ca2[_0x8a43('0x3b')]&&_0x310ca2[_0x8a43('0x39')]){_0x5e6ce3[_0x310ca2[_0x8a43('0x3e')]]&&_0x1acd60[_0x8a43('0x16')][_0x8a43('0x3a')]({'id':_0x310ca2[_0x8a43('0x3b')],'value':_0x5e6ce3[_0x310ca2[_0x8a43('0x3e')]][_0x8a43('0x38')]()});}else if(_0x310ca2[_0x8a43('0x35')]===_0x8a43('0x3f')&&_0x310ca2[_0x8a43('0x40')]&&_0x310ca2['Variable']['name']&&_0x310ca2[_0x8a43('0x3b')]&&_0x310ca2['customField']){_0x5e6ce3[_0x310ca2[_0x8a43('0x40')]['name'][_0x8a43('0x37')]()]&&_0x1acd60['custom_fields'][_0x8a43('0x3a')]({'id':_0x310ca2[_0x8a43('0x3b')],'value':_0x5e6ce3[_0x310ca2['Variable'][_0x8a43('0x14')][_0x8a43('0x37')]()]['toString']()});}});}return _0x1acd60;}exports[_0x8a43('0x41')]=function(_0x1a1f30,_0x538cb4,_0x12268f,_0x5c68a5,_0x24147e,_0x26a219){var _0xcaaa5f,_0x9bfb77;_0x26a219[_0x8a43('0x1a')]=intUtil[_0x8a43('0x42')](_0x26a219[_0x8a43('0x1a')]);_0x26a219['serverUrl']=intUtil['stripTrailingSlash'](_0x26a219[_0x8a43('0x43')]);if(_0x24147e&&_0x24147e[_0x8a43('0x44')]){logger[_0x8a43('0xb')](_0x8a43('0x45'),_0x8a43('0x46'));_0x538cb4['recordingURL']=util[_0x8a43('0x18')](_0x8a43('0x47'),_0x26a219[_0x8a43('0x43')],_0x538cb4[_0x8a43('0x48')],md5(_0x538cb4[_0x8a43('0x48')]));}else{_0x538cb4[_0x8a43('0x49')]='';}headers[_0x8a43('0x4a')]=getAuth(_0x26a219);return getUser(_0x26a219,_0x5c68a5['email'])[_0x8a43('0x1b')](function(_0xbb71c3){_0xcaaa5f=_0xbb71c3;logger[_0x8a43('0xb')](_0x8a43('0x4b'),_0xcaaa5f['id']);return getEndUser(_0x26a219,_0x538cb4[_0x8a43('0xf')],_0x538cb4['calleridnum']);})[_0x8a43('0x1b')](function(_0x3ab737){_0x9bfb77=_0x3ab737;logger[_0x8a43('0xb')](_0x8a43('0x4c'),_0x9bfb77['id']);return getTicket(_0x26a219,_0xcaaa5f,_0x9bfb77,_0x12268f,_0x538cb4);})[_0x8a43('0x1b')](function(_0x3b6850){if(_0x3b6850&&_0x3b6850['id']){logger[_0x8a43('0xb')]('Ticket\x20created!');logger[_0x8a43('0xb')](_0x8a43('0x4d'),_0x3b6850['id']);logger[_0x8a43('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8a43('0x18')](_0x8a43('0x4e'),_0x5c68a5[_0x8a43('0x14')]),_0x8a43('0x4f'),{'uri':util[_0x8a43('0x18')](_0x8a43('0x50'),_0x26a219[_0x8a43('0x1a')],_0x3b6850['id'])});}})[_0x8a43('0x51')](function(_0x2fa19e){logger[_0x8a43('0x52')](_0x8a43('0x45'),JSON[_0x8a43('0x30')](_0x2fa19e));});};exports[_0x8a43('0x53')]=function(_0x93718f,_0x4b45d3,_0x569f44,_0xd9b92d,_0x3612f4,_0x17779a,_0x3ad30b){var _0x38284c,_0x1a719b;_0x17779a[_0x8a43('0x1a')]=intUtil['stripTrailingSlash'](_0x17779a['remoteUri']);_0x17779a[_0x8a43('0x43')]=intUtil[_0x8a43('0x42')](_0x17779a['serverUrl']);if(_0x3ad30b&&_0x3ad30b[_0x8a43('0x54')]&&_0x3ad30b[_0x8a43('0x54')]!==_0x8a43('0x55')){logger['info'](_0x8a43('0x56'),_0x8a43('0x46'));_0x4b45d3[_0x8a43('0x49')]=util[_0x8a43('0x18')](_0x8a43('0x47'),_0x17779a[_0x8a43('0x43')],_0x4b45d3[_0x8a43('0x48')],md5(_0x4b45d3[_0x8a43('0x48')]));}headers[_0x8a43('0x4a')]=getAuth(_0x17779a);return getUser(_0x17779a,_0xd9b92d[_0x8a43('0x22')])[_0x8a43('0x1b')](function(_0x59c53d){_0x38284c=_0x59c53d;logger[_0x8a43('0xb')]('The\x20User\x20ID\x20is:',_0x38284c['id']);return getEndUser(_0x17779a,_0x4b45d3[_0x8a43('0x57')],_0x4b45d3[_0x8a43('0x58')]);})['then'](function(_0x486525){_0x1a719b=_0x486525;logger[_0x8a43('0xb')](_0x8a43('0x4c'),_0x1a719b['id']);return getTicket(_0x17779a,_0x38284c,_0x1a719b,_0x569f44,_0x4b45d3);})[_0x8a43('0x1b')](function(_0x8528e5){if(_0x8528e5&&_0x8528e5['id']){logger[_0x8a43('0xb')](_0x8a43('0x1c'));logger[_0x8a43('0xb')](_0x8a43('0x4d'),_0x8528e5['id']);logger['info'](_0x8a43('0x56'),_0x8a43('0x59'));emit(util[_0x8a43('0x18')]('user:%s',_0xd9b92d[_0x8a43('0x14')]),_0x8a43('0x4f'),{'uri':util[_0x8a43('0x18')](_0x8a43('0x50'),_0x17779a['remoteUri'],_0x8528e5['id'])});}})[_0x8a43('0x51')](function(_0x3fd2f7){logger['error'](_0x8a43('0x56'),JSON[_0x8a43('0x30')](_0x3fd2f7));});};exports[_0x8a43('0x5a')]=function(_0x4fea2a,_0x1ac605,_0x3cc808,_0x5ab0b0,_0x187162,_0x4dd688){var _0x5395fa,_0x95e6aa;_0x4dd688['remoteUri']=intUtil[_0x8a43('0x42')](_0x4dd688[_0x8a43('0x1a')]);_0x4dd688[_0x8a43('0x43')]=intUtil['stripTrailingSlash'](_0x4dd688[_0x8a43('0x43')]);if(_0x187162&&_0x187162[_0x8a43('0x44')]){logger[_0x8a43('0xb')]('['+_0x1ac605[_0x8a43('0x5b')][_0x8a43('0x5c')]()+']',_0x8a43('0x46'));_0x1ac605[_0x8a43('0x49')]=util[_0x8a43('0x18')](_0x8a43('0x47'),_0x4dd688[_0x8a43('0x43')],_0x1ac605[_0x8a43('0x48')],md5(_0x1ac605[_0x8a43('0x48')]));}else{_0x1ac605[_0x8a43('0x49')]='';}headers[_0x8a43('0x4a')]=getAuth(_0x4dd688);return getUser(_0x4dd688,'')[_0x8a43('0x1b')](function(_0x171fac){_0x5395fa=_0x171fac;logger['info'](_0x8a43('0x4b'),_0x5395fa['id']);return getEndUser(_0x4dd688,_0x1ac605['calleridname'],_0x1ac605[_0x8a43('0x10')]);})[_0x8a43('0x1b')](function(_0x3a7cc3){_0x95e6aa=_0x3a7cc3;logger[_0x8a43('0xb')]('The\x20Enduser\x20ID\x20is:',_0x95e6aa['id']);return getTicket(_0x4dd688,_0x5395fa,_0x95e6aa,_0x3cc808,_0x1ac605);})[_0x8a43('0x1b')](function(_0x46067e){if(_0x46067e){logger['info'](_0x8a43('0x1c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x46067e['id']);}})[_0x8a43('0x51')](function(_0x22cf74){logger[_0x8a43('0x52')]('['+_0x1ac605[_0x8a43('0x5b')][_0x8a43('0x5c')]()+']',JSON['stringify'](_0x22cf74));});};
\ No newline at end of file
+var _0x3746=['info','Ticket\x20created!','validateEmail','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','map','type','nameField','customField','toString','string','idField','push','content','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','none','[OUTBOUND]','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','catch','error','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions',' ','name','Fields','mapValues','keyBy','custom_fields','value','remoteUri','POST','then'];(function(_0x3e61cf,_0x4a4440){var _0xfcc3e9=function(_0x57673d){while(--_0x57673d){_0x3e61cf['push'](_0x3e61cf['shift']());}};_0xfcc3e9(++_0x4a4440);}(_0x3746,0xec));var _0x6374=function(_0xe6474a,_0x236876){_0xe6474a=_0xe6474a-0x0;var _0x104db3=_0x3746[_0xe6474a];return _0x104db3;};'use strict';var _=require(_0x6374('0x0'));var rp=require(_0x6374('0x1'));var md5=require(_0x6374('0x2'));var util=require(_0x6374('0x3'));var Redis=require('ioredis');var intUtil=require(_0x6374('0x4'));var config=require(_0x6374('0x5'));var logger=require(_0x6374('0x6'))(_0x6374('0x7'));config[_0x6374('0x8')]=_[_0x6374('0x9')](config[_0x6374('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6374('0x8')]));var headers={'Content-Type':_0x6374('0xa'),'Accept':'application/json'};function emit(_0x9fe6b,_0x3cb7ce,_0x1d6854){io['to'](_0x9fe6b)[_0x6374('0xb')](_0x3cb7ce,_0x1d6854);}function getTicket(_0x4100b8,_0x1109c5,_0x5b1d46,_0x4f5fa6,_0x7aa2c5){logger['info'](_0x6374('0xc'));var _0x2f5b60=_[_0x6374('0xd')]({'responder_id':_0x1109c5['id'],'requester_id':_0x5b1d46['id'],'name':util[_0x6374('0xe')](_0x6374('0xf'),_0x7aa2c5[_0x6374('0x10')]),'phone':_0x7aa2c5[_0x6374('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6374('0x12')](_0x4f5fa6[_0x6374('0x13')],_0x7aa2c5,'\x20'),'description':intUtil['getString'](_0x4f5fa6[_0x6374('0x14')],_0x7aa2c5,_0x6374('0x15')),'tags':getTags(_0x4f5fa6['Tags'],_0x6374('0x16'))},getCustomFields(_0x4f5fa6[_0x6374('0x17')],_0x7aa2c5));_0x2f5b60['custom_fields']=_[_0x6374('0x18')](_[_0x6374('0x19')](_0x2f5b60[_0x6374('0x1a')],'id'),_0x6374('0x1b'));return request({'uri':util[_0x6374('0xe')]('%s/api/v2/tickets',_0x4100b8[_0x6374('0x1c')]),'method':_0x6374('0x1d'),'body':_0x2f5b60})[_0x6374('0x1e')](function(_0x1a7127){logger[_0x6374('0x1f')](_0x6374('0x20'));return _0x1a7127;});}function getUser(_0x2ce0aa,_0x58a968){if(intUtil[_0x6374('0x21')](_0x58a968)){return request({'uri':util[_0x6374('0xe')]('%s/api/v2/agents',_0x2ce0aa[_0x6374('0x1c')]),'qs':{'email':_0x58a968}})[_0x6374('0x1e')](function(_0x55037f){if(_0x55037f['length']){logger[_0x6374('0x1f')]('Agent\x20found!');return _[_0x6374('0x22')](_0x55037f,function(_0x37b139){return _0x37b139[_0x6374('0x23')][_0x6374('0x24')]===_0x58a968;});}else{logger[_0x6374('0x1f')](_0x6374('0x25'));return request({'uri':util[_0x6374('0xe')]('%s/api/v2/agents/me',_0x2ce0aa[_0x6374('0x1c')])})[_0x6374('0x1e')](function(_0x671ef6){logger['info'](_0x6374('0x26'));return _0x671ef6;});}});}else{logger[_0x6374('0x1f')](_0x6374('0x27'));return request({'uri':util[_0x6374('0xe')]('%s/api/v2/agents/me',_0x2ce0aa[_0x6374('0x1c')])})[_0x6374('0x1e')](function(_0x297ed1){logger[_0x6374('0x1f')](_0x6374('0x26'));return _0x297ed1;});}}function getEndUser(_0x10ef9d,_0x3f77dc,_0x271eed){logger[_0x6374('0x1f')](_0x6374('0x28'),_0x271eed);return request({'uri':util['format'](_0x6374('0x29'),_0x10ef9d['remoteUri']),'qs':{'phone':_0x271eed}})[_0x6374('0x1e')](function(_0x2bc682){if(_0x2bc682[_0x6374('0x2a')]){logger[_0x6374('0x1f')](_0x6374('0x2b'));return _['find'](_0x2bc682,{'phone':_0x271eed});}else{logger[_0x6374('0x1f')](_0x6374('0x2c'));return request({'uri':util[_0x6374('0xe')](_0x6374('0x29'),_0x10ef9d[_0x6374('0x1c')]),'method':'POST','body':{'name':_0x3f77dc,'phone':_0x271eed}})[_0x6374('0x1e')](function(_0x555cc2){logger['info']('Enduser\x20created.');return _0x555cc2;});}});}function getAuth(_0x1a0353){return util['format'](_0x6374('0x2d'),new Buffer(_0x1a0353[_0x6374('0x2e')]+':X')['toString'](_0x6374('0x2f')));}function request(_0x249b4c){logger[_0x6374('0x30')](_0x6374('0x31'),JSON[_0x6374('0x32')](_0x249b4c));return rp(_['defaults'](_0x249b4c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3a298a,_0x277743){var _0x15e340=[];if(_0x3a298a&&_0x3a298a[_0x6374('0x2a')]>0x0){_0x15e340=_[_0x6374('0x33')](_0x3a298a,_0x277743);}return _0x15e340;}function getCustomFields(_0x178822,_0x2c09bf){var _0x7aa31e=[];var _0x27291a={'custom_fields':[]};if(_0x178822[_0x6374('0x2a')]>0x0){_['forEach'](_0x178822,function(_0x19ef10){if(_0x19ef10[_0x6374('0x34')]==='string'&&_0x19ef10[_0x6374('0x35')]&&!_0x19ef10[_0x6374('0x36')]){_0x27291a[_0x19ef10[_0x6374('0x35')]['toLowerCase']()]=_0x19ef10['content'][_0x6374('0x37')]();}else if(_0x19ef10[_0x6374('0x34')]===_0x6374('0x38')&&_0x19ef10[_0x6374('0x39')]&&_0x19ef10[_0x6374('0x36')]){_0x27291a[_0x6374('0x1a')][_0x6374('0x3a')]({'id':_0x19ef10[_0x6374('0x39')],'value':_0x19ef10[_0x6374('0x3b')]['toString']()});}else if(_0x19ef10[_0x6374('0x34')]==='variable'&&_0x19ef10['variableName']&&_0x19ef10[_0x6374('0x39')]&&_0x19ef10['customField']){_0x2c09bf[_0x19ef10['variableName']]&&_0x27291a[_0x6374('0x1a')]['push']({'id':_0x19ef10[_0x6374('0x39')],'value':_0x2c09bf[_0x19ef10[_0x6374('0x3c')]]['toString']()});}else if(_0x19ef10[_0x6374('0x34')]===_0x6374('0x3d')&&_0x19ef10[_0x6374('0x3e')]&&_0x19ef10[_0x6374('0x3e')][_0x6374('0x16')]&&_0x19ef10[_0x6374('0x39')]&&_0x19ef10[_0x6374('0x36')]){_0x2c09bf[_0x19ef10[_0x6374('0x3e')][_0x6374('0x16')]['toLowerCase']()]&&_0x27291a[_0x6374('0x1a')][_0x6374('0x3a')]({'id':_0x19ef10[_0x6374('0x39')],'value':_0x2c09bf[_0x19ef10[_0x6374('0x3e')][_0x6374('0x16')][_0x6374('0x3f')]()]['toString']()});}});}return _0x27291a;}exports[_0x6374('0x40')]=function(_0x51c186,_0x1babe4,_0x328a7c,_0x250bdb,_0x3bec31,_0x1fec03){var _0x10acd9,_0x1d8b58;_0x1fec03['remoteUri']=intUtil[_0x6374('0x41')](_0x1fec03[_0x6374('0x1c')]);_0x1fec03[_0x6374('0x42')]=intUtil['stripTrailingSlash'](_0x1fec03[_0x6374('0x42')]);if(_0x3bec31&&_0x3bec31[_0x6374('0x43')]){logger[_0x6374('0x1f')](_0x6374('0x44'),_0x6374('0x45'));_0x1babe4['recordingURL']=util[_0x6374('0xe')](_0x6374('0x46'),_0x1fec03['serverUrl'],_0x1babe4[_0x6374('0x47')],md5(_0x1babe4[_0x6374('0x47')]));}else{_0x1babe4[_0x6374('0x48')]='';}headers[_0x6374('0x49')]=getAuth(_0x1fec03);return getUser(_0x1fec03,_0x250bdb[_0x6374('0x24')])['then'](function(_0x5d7cb5){_0x10acd9=_0x5d7cb5;logger[_0x6374('0x1f')](_0x6374('0x4a'),_0x10acd9['id']);return getEndUser(_0x1fec03,_0x1babe4[_0x6374('0x10')],_0x1babe4[_0x6374('0x11')]);})[_0x6374('0x1e')](function(_0x2834f5){_0x1d8b58=_0x2834f5;logger[_0x6374('0x1f')](_0x6374('0x4b'),_0x1d8b58['id']);return getTicket(_0x1fec03,_0x10acd9,_0x1d8b58,_0x328a7c,_0x1babe4);})[_0x6374('0x1e')](function(_0x2f49cd){if(_0x2f49cd&&_0x2f49cd['id']){logger[_0x6374('0x1f')](_0x6374('0x20'));logger[_0x6374('0x1f')](_0x6374('0x4c'),_0x2f49cd['id']);logger[_0x6374('0x1f')](_0x6374('0x44'),_0x6374('0x4d'));emit(util[_0x6374('0xe')](_0x6374('0x4e'),_0x250bdb[_0x6374('0x16')]),'trigger:browser:url',{'uri':util[_0x6374('0xe')]('%s/helpdesk/tickets/%d',_0x1fec03[_0x6374('0x1c')],_0x2f49cd['id'])});}})['catch'](function(_0x408ccb){logger['error'](_0x6374('0x44'),JSON[_0x6374('0x32')](_0x408ccb));});};exports[_0x6374('0x4f')]=function(_0x1e54c3,_0x9155b5,_0x11258b,_0x57f5f1,_0x48612d,_0x47399b,_0x506bc4){var _0x727bee,_0x3b9353;_0x47399b['remoteUri']=intUtil['stripTrailingSlash'](_0x47399b['remoteUri']);_0x47399b[_0x6374('0x42')]=intUtil[_0x6374('0x41')](_0x47399b[_0x6374('0x42')]);if(_0x506bc4&&_0x506bc4['recordingFormat']&&_0x506bc4['recordingFormat']!==_0x6374('0x50')){logger['info'](_0x6374('0x51'),_0x6374('0x45'));_0x9155b5[_0x6374('0x48')]=util[_0x6374('0xe')](_0x6374('0x46'),_0x47399b[_0x6374('0x42')],_0x9155b5[_0x6374('0x47')],md5(_0x9155b5[_0x6374('0x47')]));}headers[_0x6374('0x49')]=getAuth(_0x47399b);return getUser(_0x47399b,_0x57f5f1['email'])[_0x6374('0x1e')](function(_0xe4ca81){_0x727bee=_0xe4ca81;logger['info'](_0x6374('0x4a'),_0x727bee['id']);return getEndUser(_0x47399b,_0x9155b5[_0x6374('0x52')],_0x9155b5[_0x6374('0x53')]);})[_0x6374('0x1e')](function(_0x307317){_0x3b9353=_0x307317;logger[_0x6374('0x1f')](_0x6374('0x4b'),_0x3b9353['id']);return getTicket(_0x47399b,_0x727bee,_0x3b9353,_0x11258b,_0x9155b5);})[_0x6374('0x1e')](function(_0x565be0){if(_0x565be0&&_0x565be0['id']){logger[_0x6374('0x1f')](_0x6374('0x20'));logger[_0x6374('0x1f')](_0x6374('0x4c'),_0x565be0['id']);logger['info'](_0x6374('0x51'),_0x6374('0x4d'));emit(util[_0x6374('0xe')](_0x6374('0x4e'),_0x57f5f1[_0x6374('0x16')]),'trigger:browser:url',{'uri':util[_0x6374('0xe')](_0x6374('0x54'),_0x47399b[_0x6374('0x1c')],_0x565be0['id'])});}})[_0x6374('0x55')](function(_0x3895a9){logger[_0x6374('0x56')]('[OUTBOUND]',JSON['stringify'](_0x3895a9));});};exports['unmanaged']=function(_0xafdff8,_0x30b105,_0x282564,_0x96c718,_0x4fe7db,_0x2a35f2){var _0x2fdb3c,_0x1cfe3e;_0x2a35f2[_0x6374('0x1c')]=intUtil[_0x6374('0x41')](_0x2a35f2['remoteUri']);_0x2a35f2['serverUrl']=intUtil[_0x6374('0x41')](_0x2a35f2[_0x6374('0x42')]);if(_0x4fe7db&&_0x4fe7db['monitor_format']){logger['info']('['+_0x30b105[_0x6374('0x57')][_0x6374('0x58')]()+']',_0x6374('0x45'));_0x30b105[_0x6374('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a35f2['serverUrl'],_0x30b105[_0x6374('0x47')],md5(_0x30b105[_0x6374('0x47')]));}else{_0x30b105[_0x6374('0x48')]='';}headers[_0x6374('0x49')]=getAuth(_0x2a35f2);return getUser(_0x2a35f2,'')['then'](function(_0x44039b){_0x2fdb3c=_0x44039b;logger[_0x6374('0x1f')](_0x6374('0x4a'),_0x2fdb3c['id']);return getEndUser(_0x2a35f2,_0x30b105[_0x6374('0x10')],_0x30b105['calleridnum']);})[_0x6374('0x1e')](function(_0x5b8fca){_0x1cfe3e=_0x5b8fca;logger[_0x6374('0x1f')](_0x6374('0x4b'),_0x1cfe3e['id']);return getTicket(_0x2a35f2,_0x2fdb3c,_0x1cfe3e,_0x282564,_0x30b105);})[_0x6374('0x1e')](function(_0x353d2c){if(_0x353d2c){logger[_0x6374('0x1f')](_0x6374('0x20'));logger[_0x6374('0x1f')](_0x6374('0x4c'),_0x353d2c['id']);}})['catch'](function(_0x474729){logger[_0x6374('0x56')]('['+_0x30b105[_0x6374('0x57')][_0x6374('0x58')]()+']',JSON['stringify'](_0x474729));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js
index 1eda89d..db14b8d 100644
--- a/server/services/ami/trigger/integration/freshsales.js
+++ b/server/services/ami/trigger/integration/freshsales.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2607=['catch','Creating\x20new\x20task','POST','/api/tasks','Subjects','getString','Descriptions','Contact','format','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','../../../../config/environment','freshsales','redis','defaults','localhost','GET','info','Getting\x20admin\x20information','users','email','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','headers','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','adminEmail','/api/contacts/filters','Getting\x20contacts\x20filter','forEach','name','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contacts','find','work_number','mobile_number','contactNumber','endUserId','Contact\x20found:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact'];(function(_0x431860,_0x23fa12){var _0x24b5f3=function(_0x5b7080){while(--_0x5b7080){_0x431860['push'](_0x431860['shift']());}};_0x24b5f3(++_0x23fa12);}(_0x2607,0x19b));var _0x7260=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x2607[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x7260('0x0'));var rp=require(_0x7260('0x1'));var md5=require('md5');var util=require(_0x7260('0x2'));var moment=require(_0x7260('0x3'));var Promise=require(_0x7260('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x7260('0x5'));var logger=require('../../../../config/logger')(_0x7260('0x6'));config[_0x7260('0x7')]=_[_0x7260('0x8')](config[_0x7260('0x7')],{'host':_0x7260('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x11abdc,_0x410627,_0x523e64,_0x409b9a){return new Promise(function(_0x4ac6e4,_0x4dd0ef){var _0x2a6e36=![];var _0x4e4454={'method':_0x7260('0xa'),'uri':_0x409b9a+'/api/selector/owners','json':!![]};_0x4e4454['headers']=_0x523e64;logger[_0x7260('0xb')](_0x7260('0xc'));return rp(_0x4e4454)['then'](function(_0xc883bd){if(_0xc883bd){var _0x4dd244=_0xc883bd[_0x7260('0xd')];var _0x5c8a35=null;for(_0x5c8a35=0x0;_0x5c8a35<_0x4dd244['length'];_0x5c8a35++){if(_0x4dd244[_0x5c8a35][_0x7260('0xe')]===_0x11abdc['adminEmail']){_0x11abdc['adminId']=_0x4dd244[_0x5c8a35]['id'];_0x2a6e36=!![];}}if(_0x2a6e36){logger[_0x7260('0xb')]('Admin\x20found:',_0x11abdc[_0x7260('0xf')]);_0x4ac6e4(_0x11abdc);}else{_0x4dd0ef({'statusCode':0x194,'message':_0x7260('0x10')});}}else{_0x4dd0ef({'statusCode':0x194,'message':_0x7260('0x10')});}})['catch'](function(_0x4172a8){logger[_0x7260('0x11')]('['+[_0x410627[_0x7260('0x12')]()]+']',_0x4172a8[_0x7260('0x13')]);_0x4dd0ef(_0x4172a8);});});}function getUser(_0x2767c,_0x2e13c0,_0x534a89){return function(_0x33b6c4){return new Promise(function(_0x125aed,_0xa6285e){var _0x89908a={'method':'GET','uri':_0x534a89+'/api/selector/owners','json':!![]};_0x89908a[_0x7260('0x14')]=_0x2e13c0;logger[_0x7260('0xb')](_0x7260('0x15'));return rp(_0x89908a)[_0x7260('0x16')](function(_0x1e0cd4){if(_0x1e0cd4){var _0x2f8e68=_0x1e0cd4[_0x7260('0xd')];var _0x4e5e9c=![];var _0x13a87c=null;if(_0x33b6c4[_0x7260('0x17')]!==null){logger['info'](_0x7260('0x18'),_0x33b6c4[_0x7260('0x17')]);_0x33b6c4[_0x7260('0x19')]=_0x33b6c4[_0x7260('0x17')];for(_0x13a87c=0x0;_0x13a87c<_0x2f8e68[_0x7260('0x1a')];_0x13a87c++){if(_0x2f8e68[_0x13a87c]['email']===_0x33b6c4[_0x7260('0x17')]){_0x4e5e9c=!![];_0x33b6c4[_0x7260('0x1b')]=_0x2f8e68[_0x13a87c]['id'];logger[_0x7260('0xb')](_0x7260('0x1c'),_0x33b6c4['userId']);}}}if(!_0x4e5e9c){logger[_0x7260('0xb')](_0x7260('0x1d'));_0x33b6c4[_0x7260('0x19')]=_0x33b6c4[_0x7260('0x1e')];_0x33b6c4[_0x7260('0x1b')]=_0x33b6c4[_0x7260('0xf')];_0x4e5e9c=!![];}if(_0x4e5e9c){_0x125aed(_0x33b6c4);}else{_0xa6285e({'statusCode':0x194,'message':_0x7260('0x10')});}}else{_0xa6285e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x5cf717){logger['error']('['+[_0x2767c[_0x7260('0x12')]()]+']',_0x5cf717[_0x7260('0x13')]);_0xa6285e(_0x5cf717);});});};}function getEndUser(_0x16d89a,_0x2fa901,_0x2340b9){return function(_0x40b762){return new Promise(function(_0x124b81,_0x1759cb){var _0x287a00=0x0;var _0xb0d21c={'method':'GET','uri':_0x2340b9+_0x7260('0x1f'),'json':!![]};_0xb0d21c[_0x7260('0x14')]=_0x2fa901;logger[_0x7260('0xb')](_0x7260('0x20'));return rp(_0xb0d21c)['then'](function(_0x23f9a7){_0x23f9a7['filters'][_0x7260('0x21')](function(_0x590134){if(_0x590134[_0x7260('0x22')]==='All\x20Contacts'){_0x287a00=_0x590134['id'];}});})['then'](function(){logger[_0x7260('0xb')](_0x7260('0x23'));var _0x3b50f3={'method':'GET','uri':_0x2340b9+_0x7260('0x24')+_0x287a00,'json':!![]};_0x3b50f3[_0x7260('0x14')]=_0x2fa901;return rp(_0x3b50f3);})['then'](function(_0x161469){logger[_0x7260('0xb')](_0x7260('0x25'),_0x40b762['contactNumber']);if(_0x161469[_0x7260('0x26')][_0x7260('0x1a')]>0x0){var _0x4125f1=_[_0x7260('0x27')](_0x161469[_0x7260('0x26')],function(_0x5944a5){if(_0x5944a5[_0x7260('0x28')]===_0x40b762['contactNumber']||_0x5944a5[_0x7260('0x29')]===_0x40b762[_0x7260('0x2a')]){return _0x5944a5;}});if(_0x4125f1){_0x40b762[_0x7260('0x2b')]=_0x4125f1['id'];logger['info'](_0x7260('0x2c'),_0x40b762['endUserId']);_0x124b81(_0x40b762);}else{return createEndUser(_0x40b762,_0x16d89a,_0x2fa901,_0x2340b9)[_0x7260('0x16')](function(_0x459d3c){logger['info'](_0x7260('0x2d'),_0x40b762[_0x7260('0x2b')]);_0x124b81(_0x459d3c);});}}else{return createEndUser(_0x40b762,_0x16d89a,_0x2fa901,_0x2340b9)[_0x7260('0x16')](function(_0x4d6ce9){logger[_0x7260('0xb')](_0x7260('0x2d'),_0x40b762['endUserId']);_0x124b81(_0x4d6ce9);});}})['catch'](function(_0x589240){throw new Error(_0x589240['message']);});});};}function createEndUser(_0x205b2e,_0x20f7c4,_0x1d3276,_0x3ff66e){return new Promise(function(_0x12408d,_0x43fc8f){var _0x5d2c38=moment();var _0xe13505={'method':'POST','uri':_0x3ff66e+_0x7260('0x2e'),'body':{'contact':{'last_name':_0x205b2e[_0x7260('0x2a')],'work_number':_0x205b2e[_0x7260('0x2a')],'mobile_number':_0x205b2e['contactNumber'],'owner_id':_0x205b2e['userId'],'created_at':_0x5d2c38['format'](_0x7260('0x2f'))}},'json':!![]};_0xe13505[_0x7260('0x14')]=_0x1d3276;logger[_0x7260('0xb')](_0x7260('0x30'));return rp(_0xe13505)[_0x7260('0x16')](function(_0x12697e){_0x205b2e[_0x7260('0x2b')]=_0x12697e['contact']['id'];_0x12408d(_0x205b2e);})[_0x7260('0x31')](function(_0x1150e5){logger[_0x7260('0x11')]('['+[_0x20f7c4[_0x7260('0x12')]()]+']',_0x1150e5[_0x7260('0x13')]);_0x43fc8f(_0x1150e5['message']);});});}function getTicket(_0x4ab655,_0x4f0459,_0x492682,_0xadf678,_0x2aa347){return function(_0x314c8f){logger[_0x7260('0xb')](_0x7260('0x32'));return new Promise(function(_0x12aec3,_0x5b3d76){var _0x297baa=moment();var _0x1d9567={'method':_0x7260('0x33'),'uri':_0x492682+_0x7260('0x34'),'body':{'title':intUtil['getString'](_0xadf678[_0x7260('0x35')],_0x2aa347,'\x20'),'description':intUtil[_0x7260('0x36')](_0xadf678[_0x7260('0x37')],_0x2aa347,'\x0a'),'owner_id':_0x314c8f['userId'],'creater_id':_0x314c8f[_0x7260('0xf')],'targetable_id':_0x314c8f[_0x7260('0x2b')],'targetable_type':_0x7260('0x38'),'created_at':_0x297baa[_0x7260('0x39')](_0x7260('0x2f')),'due_date':_0x297baa[_0x7260('0x3a')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x1d9567['headers']=_0x4f0459;return rp(_0x1d9567)[_0x7260('0x16')](function(_0xc7d8e5){_0x314c8f[_0x7260('0x3b')]=_0xc7d8e5[_0x7260('0x3c')]['id'];logger['info'](_0x7260('0x3d'),_0x314c8f[_0x7260('0x3b')]);_0x12aec3(_0x314c8f);})[_0x7260('0x31')](function(_0x17bd58){logger[_0x7260('0x11')]('['+[_0x4ab655[_0x7260('0x12')]()]+']',_0x17bd58[_0x7260('0x13')]);_0x5b3d76(_0x17bd58[_0x7260('0x13')]);});});};}function emit(_0x552e3e,_0x195163,_0x1cb678){var _0x409237={'uri':_0x552e3e+_0x7260('0x3e')+_0x1cb678};io['to'](util[_0x7260('0x39')](_0x7260('0x3f'),_0x195163))[_0x7260('0x40')](_0x7260('0x41'),_0x409237);}exports['cs']=function(_0x2e4920,_0x2f8e2e,_0xcf19a2,_0x357ff3,_0x26f873,_0x43ff2e,_0x1cfba9,_0x16e45f){var _0x80dbf={};var _0x40ed4c={'Authorization':_0x7260('0x42')+_0x43ff2e[_0x7260('0x43')]};_0x43ff2e['remoteUri']=intUtil[_0x7260('0x44')](_0x43ff2e[_0x7260('0x45')]);_0x43ff2e[_0x7260('0x46')]=intUtil[_0x7260('0x44')](_0x43ff2e['serverUrl']);var _0x1376e3=_0x43ff2e['remoteUri'];_0x80dbf[_0x7260('0x1e')]=_0x43ff2e[_0x7260('0x47')];_0x80dbf[_0x7260('0x2a')]=_0x16e45f[_0x7260('0x48')]()==='outbound'?_0x2f8e2e[_0x7260('0x49')]:_0x2f8e2e[_0x7260('0x4a')];_0x80dbf[_0x7260('0x4b')]=_0x16e45f===_0x7260('0x4c')||_0x16e45f===_0x7260('0x4d')?'queue':_0x7260('0x4e');if(_0x357ff3){_0x80dbf[_0x7260('0x17')]=_0x357ff3[_0x7260('0xe')];}var _0x3f502a=util[_0x7260('0x39')](_0x7260('0x4f'),_0x43ff2e['serverUrl'],_0x2f8e2e[_0x7260('0x50')],md5(_0x2f8e2e['uniqueid']));if(_0x26f873&&_0x26f873[_0x7260('0x51')]){logger[_0x7260('0xb')](_0x7260('0x52'),'Recording\x20is\x20enabled!');_0x2f8e2e[_0x7260('0x53')]=_0x3f502a;}else if(_0x1cfba9&&_0x1cfba9[_0x7260('0x54')]&&_0x1cfba9['recordingFormat']!==_0x7260('0x55')){logger[_0x7260('0xb')](_0x7260('0x56'),_0x7260('0x57'));_0x2f8e2e[_0x7260('0x53')]=_0x3f502a;}else{_0x2f8e2e[_0x7260('0x53')]='';}return getAdminId(_0x80dbf,_0x16e45f,_0x40ed4c,_0x1376e3)[_0x7260('0x16')](getUser(_0x16e45f,_0x40ed4c,_0x1376e3))[_0x7260('0x16')](getEndUser(_0x16e45f,_0x40ed4c,_0x1376e3))['then'](getTicket(_0x16e45f,_0x40ed4c,_0x1376e3,_0xcf19a2,_0x2f8e2e))[_0x7260('0x16')](function(_0x773862){logger[_0x7260('0xb')](util[_0x7260('0x39')](_0x7260('0x58'),_0x773862['ticketId']));if(_0x16e45f!==_0x7260('0x4d')){logger['info']('['+[_0x16e45f[_0x7260('0x12')]()]+']',_0x7260('0x59'));emit(_0x1376e3,_0x357ff3[_0x7260('0x22')],_0x773862[_0x7260('0x2b')]);}})['catch'](function(_0xf2933b){logger[_0x7260('0x11')]('['+[_0x16e45f[_0x7260('0x12')]()]+_0x7260('0x5a'),util[_0x7260('0x5b')](_0xf2933b,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xe0c9=['Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','headers','info','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','error','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','Getting\x20contact\x20list','contactNumber','contacts','work_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','destcalleridnum','queue','outbound','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','unmanaged',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners'];(function(_0x3d3531,_0x1e4748){var _0x299781=function(_0x3b90e8){while(--_0x3b90e8){_0x3d3531['push'](_0x3d3531['shift']());}};_0x299781(++_0x1e4748);}(_0xe0c9,0x1e9));var _0x9e0c=function(_0x5fd8e4,_0x2b0358){_0x5fd8e4=_0x5fd8e4-0x0;var _0x22ac06=_0xe0c9[_0x5fd8e4];return _0x22ac06;};'use strict';var _=require('lodash');var rp=require(_0x9e0c('0x0'));var md5=require('md5');var util=require(_0x9e0c('0x1'));var moment=require(_0x9e0c('0x2'));var Promise=require(_0x9e0c('0x3'));var Redis=require(_0x9e0c('0x4'));var intUtil=require(_0x9e0c('0x5'));var config=require(_0x9e0c('0x6'));var logger=require(_0x9e0c('0x7'))(_0x9e0c('0x8'));config[_0x9e0c('0x9')]=_[_0x9e0c('0xa')](config['redis'],{'host':_0x9e0c('0xb'),'port':0x18eb});var io=require(_0x9e0c('0xc'))(new Redis(config[_0x9e0c('0x9')]));function getAdminId(_0x94df07,_0x1db3b5,_0x385864,_0x4f249a){return new Promise(function(_0x2c928a,_0x536cc7){var _0x44a438=![];var _0x3261f0={'method':_0x9e0c('0xd'),'uri':_0x4f249a+_0x9e0c('0xe'),'json':!![]};_0x3261f0['headers']=_0x385864;logger['info'](_0x9e0c('0xf'));return rp(_0x3261f0)[_0x9e0c('0x10')](function(_0x2af916){if(_0x2af916){var _0x577b57=_0x2af916[_0x9e0c('0x11')];var _0x5b1156=null;for(_0x5b1156=0x0;_0x5b1156<_0x577b57[_0x9e0c('0x12')];_0x5b1156++){if(_0x577b57[_0x5b1156][_0x9e0c('0x13')]===_0x94df07[_0x9e0c('0x14')]){_0x94df07['adminId']=_0x577b57[_0x5b1156]['id'];_0x44a438=!![];}}if(_0x44a438){logger['info']('Admin\x20found:',_0x94df07[_0x9e0c('0x15')]);_0x2c928a(_0x94df07);}else{_0x536cc7({'statusCode':0x194,'message':_0x9e0c('0x16')});}}else{_0x536cc7({'statusCode':0x194,'message':_0x9e0c('0x16')});}})[_0x9e0c('0x17')](function(_0x46eb78){logger['error']('['+[_0x1db3b5[_0x9e0c('0x18')]()]+']',_0x46eb78[_0x9e0c('0x19')]);_0x536cc7(_0x46eb78);});});}function getUser(_0x5a4025,_0x3f5ac6,_0x40b0fb){return function(_0x3f3b2){return new Promise(function(_0x50d5ed,_0x296f75){var _0x3870d0={'method':_0x9e0c('0xd'),'uri':_0x40b0fb+'/api/selector/owners','json':!![]};_0x3870d0[_0x9e0c('0x1a')]=_0x3f5ac6;logger[_0x9e0c('0x1b')](_0x9e0c('0x1c'));return rp(_0x3870d0)['then'](function(_0x474cf2){if(_0x474cf2){var _0x4f1935=_0x474cf2[_0x9e0c('0x11')];var _0x2cb1e8=![];var _0x97dc92=null;if(_0x3f3b2[_0x9e0c('0x1d')]!==null){logger[_0x9e0c('0x1b')](_0x9e0c('0x1e'),_0x3f3b2[_0x9e0c('0x1d')]);_0x3f3b2[_0x9e0c('0x1f')]=_0x3f3b2[_0x9e0c('0x1d')];for(_0x97dc92=0x0;_0x97dc92<_0x4f1935[_0x9e0c('0x12')];_0x97dc92++){if(_0x4f1935[_0x97dc92][_0x9e0c('0x13')]===_0x3f3b2[_0x9e0c('0x1d')]){_0x2cb1e8=!![];_0x3f3b2[_0x9e0c('0x20')]=_0x4f1935[_0x97dc92]['id'];logger['info'](_0x9e0c('0x21'),_0x3f3b2[_0x9e0c('0x20')]);}}}if(!_0x2cb1e8){logger['info'](_0x9e0c('0x22'));_0x3f3b2['userEmail']=_0x3f3b2['adminEmail'];_0x3f3b2[_0x9e0c('0x20')]=_0x3f3b2[_0x9e0c('0x15')];_0x2cb1e8=!![];}if(_0x2cb1e8){_0x50d5ed(_0x3f3b2);}else{_0x296f75({'statusCode':0x194,'message':_0x9e0c('0x16')});}}else{_0x296f75({'statusCode':0x194,'message':_0x9e0c('0x16')});}})[_0x9e0c('0x17')](function(_0x1bde4d){logger[_0x9e0c('0x23')]('['+[_0x5a4025['toUpperCase']()]+']',_0x1bde4d['message']);_0x296f75(_0x1bde4d);});});};}function getEndUser(_0xe507c4,_0x39ba30,_0x5d41be){return function(_0x245f18){return new Promise(function(_0x25d577,_0x40ec17){var _0x2a5324=0x0;var _0x554d79={'method':_0x9e0c('0xd'),'uri':_0x5d41be+_0x9e0c('0x24'),'json':!![]};_0x554d79[_0x9e0c('0x1a')]=_0x39ba30;logger['info'](_0x9e0c('0x25'));return rp(_0x554d79)[_0x9e0c('0x10')](function(_0x52a90e){_0x52a90e[_0x9e0c('0x26')][_0x9e0c('0x27')](function(_0x592fa8){if(_0x592fa8['name']==='All\x20Contacts'){_0x2a5324=_0x592fa8['id'];}});})[_0x9e0c('0x10')](function(){logger[_0x9e0c('0x1b')](_0x9e0c('0x28'));var _0x2c27c8={'method':_0x9e0c('0xd'),'uri':_0x5d41be+'/api/contacts/view/'+_0x2a5324,'json':!![]};_0x2c27c8[_0x9e0c('0x1a')]=_0x39ba30;return rp(_0x2c27c8);})[_0x9e0c('0x10')](function(_0x2b7162){logger[_0x9e0c('0x1b')]('Searching\x20contact\x20with\x20phone',_0x245f18[_0x9e0c('0x29')]);if(_0x2b7162[_0x9e0c('0x2a')][_0x9e0c('0x12')]>0x0){var _0x599b4e=_['find'](_0x2b7162['contacts'],function(_0x4bafee){if(_0x4bafee[_0x9e0c('0x2b')]===_0x245f18[_0x9e0c('0x29')]||_0x4bafee['mobile_number']===_0x245f18[_0x9e0c('0x29')]){return _0x4bafee;}});if(_0x599b4e){_0x245f18[_0x9e0c('0x2c')]=_0x599b4e['id'];logger[_0x9e0c('0x1b')](_0x9e0c('0x2d'),_0x245f18[_0x9e0c('0x2c')]);_0x25d577(_0x245f18);}else{return createEndUser(_0x245f18,_0xe507c4,_0x39ba30,_0x5d41be)['then'](function(_0x57e1fe){logger['info']('Contact\x20created:',_0x245f18[_0x9e0c('0x2c')]);_0x25d577(_0x57e1fe);});}}else{return createEndUser(_0x245f18,_0xe507c4,_0x39ba30,_0x5d41be)[_0x9e0c('0x10')](function(_0x44f2b6){logger[_0x9e0c('0x1b')](_0x9e0c('0x2e'),_0x245f18['endUserId']);_0x25d577(_0x44f2b6);});}})[_0x9e0c('0x17')](function(_0xad3fbb){throw new Error(_0xad3fbb[_0x9e0c('0x19')]);});});};}function createEndUser(_0x39e22c,_0x1b01c3,_0x5f09c6,_0x20ecca){return new Promise(function(_0x57aa48,_0xee7893){var _0x4d974d=moment();var _0x42988e={'method':_0x9e0c('0x2f'),'uri':_0x20ecca+_0x9e0c('0x30'),'body':{'contact':{'last_name':_0x39e22c['contactNumber'],'work_number':_0x39e22c[_0x9e0c('0x29')],'mobile_number':_0x39e22c[_0x9e0c('0x29')],'owner_id':_0x39e22c[_0x9e0c('0x20')],'created_at':_0x4d974d['format'](_0x9e0c('0x31'))}},'json':!![]};_0x42988e[_0x9e0c('0x1a')]=_0x5f09c6;logger[_0x9e0c('0x1b')](_0x9e0c('0x32'));return rp(_0x42988e)[_0x9e0c('0x10')](function(_0x2f3e12){_0x39e22c[_0x9e0c('0x2c')]=_0x2f3e12['contact']['id'];_0x57aa48(_0x39e22c);})[_0x9e0c('0x17')](function(_0x114a0e){logger['error']('['+[_0x1b01c3[_0x9e0c('0x18')]()]+']',_0x114a0e['message']);_0xee7893(_0x114a0e['message']);});});}function getTicket(_0x1347ad,_0x180bd6,_0x2ca156,_0x4f4cbb,_0x15c7f5){return function(_0x33509e){logger[_0x9e0c('0x1b')](_0x9e0c('0x33'));return new Promise(function(_0x2ce336,_0x1802c4){var _0x581dc6=moment();var _0x2062f6={'method':_0x9e0c('0x2f'),'uri':_0x2ca156+_0x9e0c('0x34'),'body':{'title':intUtil[_0x9e0c('0x35')](_0x4f4cbb[_0x9e0c('0x36')],_0x15c7f5,'\x20'),'description':intUtil[_0x9e0c('0x35')](_0x4f4cbb[_0x9e0c('0x37')],_0x15c7f5,'\x0a'),'owner_id':_0x33509e[_0x9e0c('0x20')],'creater_id':_0x33509e['adminId'],'targetable_id':_0x33509e['endUserId'],'targetable_type':_0x9e0c('0x38'),'created_at':_0x581dc6['format'](_0x9e0c('0x31')),'due_date':_0x581dc6['add'](0x1e,'m')['format'](_0x9e0c('0x31'))},'json':!![]};_0x2062f6[_0x9e0c('0x1a')]=_0x180bd6;return rp(_0x2062f6)[_0x9e0c('0x10')](function(_0x4061e8){_0x33509e[_0x9e0c('0x39')]=_0x4061e8['task']['id'];logger['info'](_0x9e0c('0x3a'),_0x33509e[_0x9e0c('0x39')]);_0x2ce336(_0x33509e);})[_0x9e0c('0x17')](function(_0x4177ec){logger[_0x9e0c('0x23')]('['+[_0x1347ad[_0x9e0c('0x18')]()]+']',_0x4177ec['message']);_0x1802c4(_0x4177ec[_0x9e0c('0x19')]);});});};}function emit(_0x5eeb0f,_0x239356,_0x4c3cbc){var _0x530f7c={'uri':_0x5eeb0f+_0x9e0c('0x3b')+_0x4c3cbc};io['to'](util['format'](_0x9e0c('0x3c'),_0x239356))[_0x9e0c('0x3d')](_0x9e0c('0x3e'),_0x530f7c);}exports['cs']=function(_0x4dea23,_0x3e2a2f,_0x3b772f,_0x4b3dd5,_0x2efe43,_0x4deac2,_0x2a0269,_0x162003){var _0x128aa6={};var _0x127510={'Authorization':_0x9e0c('0x3f')+_0x4deac2[_0x9e0c('0x40')]};_0x4deac2['remoteUri']=intUtil['stripTrailingSlash'](_0x4deac2[_0x9e0c('0x41')]);_0x4deac2['serverUrl']=intUtil[_0x9e0c('0x42')](_0x4deac2[_0x9e0c('0x43')]);var _0x14a54d=_0x4deac2[_0x9e0c('0x41')];_0x128aa6[_0x9e0c('0x14')]=_0x4deac2['username'];_0x128aa6[_0x9e0c('0x29')]=_0x162003[_0x9e0c('0x44')]()==='outbound'?_0x3e2a2f[_0x9e0c('0x45')]:_0x3e2a2f['calleridnum'];_0x128aa6['callDirection']=_0x162003===_0x9e0c('0x46')||_0x162003==='unmanaged'?_0x9e0c('0x46'):_0x9e0c('0x47');if(_0x4b3dd5){_0x128aa6[_0x9e0c('0x1d')]=_0x4b3dd5[_0x9e0c('0x13')];}var _0x1eba13=util[_0x9e0c('0x48')](_0x9e0c('0x49'),_0x4deac2['serverUrl'],_0x3e2a2f[_0x9e0c('0x4a')],md5(_0x3e2a2f[_0x9e0c('0x4a')]));if(_0x2efe43&&_0x2efe43[_0x9e0c('0x4b')]){logger[_0x9e0c('0x1b')](_0x9e0c('0x4c'),_0x9e0c('0x4d'));_0x3e2a2f[_0x9e0c('0x4e')]=_0x1eba13;}else if(_0x2a0269&&_0x2a0269[_0x9e0c('0x4f')]&&_0x2a0269['recordingFormat']!==_0x9e0c('0x50')){logger[_0x9e0c('0x1b')]('[OUTBOUND]',_0x9e0c('0x4d'));_0x3e2a2f['recordingURL']=_0x1eba13;}else{_0x3e2a2f[_0x9e0c('0x4e')]='';}return getAdminId(_0x128aa6,_0x162003,_0x127510,_0x14a54d)[_0x9e0c('0x10')](getUser(_0x162003,_0x127510,_0x14a54d))[_0x9e0c('0x10')](getEndUser(_0x162003,_0x127510,_0x14a54d))['then'](getTicket(_0x162003,_0x127510,_0x14a54d,_0x3b772f,_0x3e2a2f))[_0x9e0c('0x10')](function(_0x2d9971){logger['info'](util[_0x9e0c('0x48')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2d9971[_0x9e0c('0x39')]));if(_0x162003!==_0x9e0c('0x51')){logger[_0x9e0c('0x1b')]('['+[_0x162003[_0x9e0c('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x14a54d,_0x4b3dd5['name'],_0x2d9971['endUserId']);}})[_0x9e0c('0x17')](function(_0x52afa5){logger[_0x9e0c('0x23')]('['+[_0x162003[_0x9e0c('0x18')]()]+_0x9e0c('0x52'),util[_0x9e0c('0x53')](_0x52afa5,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js
index d3caf2f..4fd7d94 100644
--- a/server/services/ami/trigger/integration/index.js
+++ b/server/services/ami/trigger/integration/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xed3c=['%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./dynamics365','./freshsales','zendesk','salesforce','desk','servicenow','exec','includes','toLowerCase','data1','Configurations','data3','queue','outbound','log','unmanaged','sugarcrm','zoho','vtiger','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','format'];(function(_0x56ab8f,_0x27db7b){var _0x267d57=function(_0x5dad03){while(--_0x5dad03){_0x56ab8f['push'](_0x56ab8f['shift']());}};_0x267d57(++_0x27db7b);}(_0xed3c,0x1a6));var _0xced3=function(_0x146b09,_0x345cd3){_0x146b09=_0x146b09-0x0;var _0x4e9e36=_0xed3c[_0x146b09];return _0x4e9e36;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var zendesk=require(_0xced3('0x2'));var salesforce=require(_0xced3('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xced3('0x4'));var zoho=require(_0xced3('0x5'));var desk=require(_0xced3('0x6'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0xced3('0x7'));var freshsales=require(_0xced3('0x8'));var integrations=[_0xced3('0x9'),_0xced3('0xa'),'sugarcrm','freshdesk','zoho',_0xced3('0xb'),'vtiger','dynamics365','freshsales',_0xced3('0xc')];exports[_0xced3('0xd')]=function(_0x3e5a04,_0x12612f,_0x1cb639,_0x5934b2,_0x36ea7f,_0x32a95d){if(_0x1cb639){if(_[_0xced3('0xe')](integrations,_0x3e5a04['data1'][_0xced3('0xf')]())){try{var _0x19b8c2=null;var _0x42d879='';var _0x3b2ac4=_0x1cb639[_0x3e5a04[_0xced3('0x10')][_0xced3('0xf')]()];if(_0x3b2ac4){var _0x1869d5=_0x3b2ac4[_0x3e5a04['data2']];if(_0x1869d5){var _0x65bb58=_['find'](_0x1869d5[_0xced3('0x11')],{'id':parseInt(_0x3e5a04[_0xced3('0x12')],0xa)});if(_0x65bb58){if(_0x5934b2){if(_0x36ea7f&&_0x12612f[_0xced3('0x13')]){_0x42d879=_0xced3('0x13');}else if(_0x12612f['routeId']){_0x42d879=_0xced3('0x14');}else{console[_0xced3('0x15')]('EVENT\x20UNKNOWN',_0x12612f);}}else{_0x42d879=_0xced3('0x16');}switch(_0x3e5a04[_0xced3('0x10')][_0xced3('0xf')]()){case _0xced3('0x9'):zendesk[_0x42d879](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d);break;case'salesforce':salesforce[_0x42d879](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d);break;case _0xced3('0x17'):sugarcrm[_0x42d879](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d);break;case'freshdesk':freshdesk[_0x42d879](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d);break;case _0xced3('0x18'):zoho[_0x42d879](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d);break;case _0xced3('0xb'):desk[_0x42d879](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d);break;case _0xced3('0x19'):vtiger[_0x42d879](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d);break;case _0xced3('0x1a'):freshsales['cs'](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d,_0x42d879);break;case _0xced3('0xc'):servicenow['cs'](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d,_0x42d879);break;case _0xced3('0x1b'):dynamics365['cs'](_0x3e5a04,_0x12612f,_0x65bb58,_0x5934b2,_0x36ea7f,_0x1869d5,_0x32a95d,_0x42d879);break;default:console[_0xced3('0x15')](_0xced3('0x1c'));}}else{_0x19b8c2=require(_0xced3('0x1d'))(_0x3e5a04[_0xced3('0x10')][_0xced3('0xf')]());_0x19b8c2['error']('[EXEC]',util['format'](_0xced3('0x1e'),_0x3e5a04[_0xced3('0x10')][_0xced3('0xf')](),_0x3e5a04['data3']));}}else{_0x19b8c2=require(_0xced3('0x1d'))(_0x3e5a04[_0xced3('0x10')]['toLowerCase']());_0x19b8c2['error'](_0xced3('0x1f'),util[_0xced3('0x20')](_0xced3('0x21'),_0x3e5a04[_0xced3('0x10')]['toLowerCase'](),_0x3e5a04[_0xced3('0x22')]));}}else{}}catch(_0x23f92b){console['error'](_0x23f92b);}}}};
\ No newline at end of file
+var _0xb7e7=['data1','toLowerCase','data2','Configurations','data3','queue','routeId','EVENT\x20UNKNOWN','unmanaged','zendesk','zoho','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','lodash','./zendesk','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb7e7[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var zendesk=require(_0x7b7e('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x7b7e('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x7b7e('0x3'));var desk=require('./desk');var vtiger=require(_0x7b7e('0x4'));var servicenow=require(_0x7b7e('0x5'));var dynamics365=require(_0x7b7e('0x6'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x7b7e('0x7'),_0x7b7e('0x8'),_0x7b7e('0x9'),'zoho',_0x7b7e('0xa'),_0x7b7e('0xb'),_0x7b7e('0xc'),_0x7b7e('0xd'),_0x7b7e('0xe')];exports[_0x7b7e('0xf')]=function(_0x242e70,_0x52de3b,_0x299519,_0x1eef0a,_0x10a666,_0x29b622){if(_0x299519){if(_[_0x7b7e('0x10')](integrations,_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')]())){try{var _0x55620b=null;var _0xaadda='';var _0x54d8ce=_0x299519[_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')]()];if(_0x54d8ce){var _0x50d7d2=_0x54d8ce[_0x242e70[_0x7b7e('0x13')]];if(_0x50d7d2){var _0x5976ac=_['find'](_0x50d7d2[_0x7b7e('0x14')],{'id':parseInt(_0x242e70[_0x7b7e('0x15')],0xa)});if(_0x5976ac){if(_0x1eef0a){if(_0x10a666&&_0x52de3b[_0x7b7e('0x16')]){_0xaadda=_0x7b7e('0x16');}else if(_0x52de3b[_0x7b7e('0x17')]){_0xaadda='outbound';}else{console['log'](_0x7b7e('0x18'),_0x52de3b);}}else{_0xaadda=_0x7b7e('0x19');}switch(_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')]()){case _0x7b7e('0x1a'):zendesk[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0x7'):salesforce[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0x8'):sugarcrm[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0x9'):freshdesk[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0x1b'):zoho[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0xa'):desk[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0xb'):vtiger[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0xd'):freshsales['cs'](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622,_0xaadda);break;case _0x7b7e('0xe'):servicenow['cs'](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622,_0xaadda);break;case _0x7b7e('0xc'):dynamics365['cs'](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622,_0xaadda);break;default:console[_0x7b7e('0x1c')](_0x7b7e('0x1d'));}}else{_0x55620b=require(_0x7b7e('0x1e'))(_0x242e70['data1'][_0x7b7e('0x12')]());_0x55620b[_0x7b7e('0x1f')](_0x7b7e('0x20'),util['format'](_0x7b7e('0x21'),_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')](),_0x242e70[_0x7b7e('0x15')]));}}else{_0x55620b=require(_0x7b7e('0x1e'))(_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')]());_0x55620b[_0x7b7e('0x1f')]('[EXEC]',util['format']('%s\x20account\x20#%s\x20not\x20found',_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')](),_0x242e70[_0x7b7e('0x13')]));}}else{}}catch(_0x483c6f){console['error'](_0x483c6f);}}}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js
index a93c06c..cfb54d6 100644
--- a/server/services/ami/trigger/integration/salesforce.js
+++ b/server/services/ami/trigger/integration/salesforce.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x590f=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','instanceUrl','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','calleridnum','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','ticketType','assign','utc','Subjects','Descriptions','WhoId','getString','ContactId','sobject','create','isNil','validateEmail','User','execute','length','find','Email','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','display_name','identity','Task','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Lead','Contact','Case','Phone','Enduser\x20with\x20phone\x20%s\x20found.','format','Caller\x20-\x20%s','moduleCreate','contact','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','upperFirst','type','string','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','login','username','Connection\x20established.','queue','stripTrailingSlash'];(function(_0x97f6dd,_0x417a98){var _0x12c5c1=function(_0x47af5a){while(--_0x47af5a){_0x97f6dd['push'](_0x97f6dd['shift']());}};_0x12c5c1(++_0x417a98);}(_0x590f,0x97));var _0xf590=function(_0x3b7ae2,_0x3a82bd){_0x3b7ae2=_0x3b7ae2-0x0;var _0x4067c1=_0x590f[_0x3b7ae2];return _0x4067c1;};'use strict';var _=require(_0xf590('0x0'));var rp=require(_0xf590('0x1'));var moment=require(_0xf590('0x2'));var BPromise=require(_0xf590('0x3'));var md5=require('md5');var jsforce=require(_0xf590('0x4'));var util=require(_0xf590('0x5'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xf590('0x6'));var logger=require(_0xf590('0x7'))('salesforce');config[_0xf590('0x8')]=_['defaults'](config['redis'],{'host':_0xf590('0x9'),'port':0x18eb});var io=require(_0xf590('0xa'))(new Redis(config['redis']));function emit(_0x373ef7,_0x35892d,_0x4280de){io['to'](_0x373ef7)['emit'](_0x35892d,_0x4280de);}function getTicket(_0x2c2e77,_0x3163c1,_0x1c9fb2,_0x3f36cc,_0x4ea3b4,_0xdc03ac,_0x2a76a7,_0x2b9382){var _0xa2e02c={};if(_0x3f36cc[_0xf590('0xb')]==='Task'){_0xa2e02c=Object[_0xf590('0xc')]({},{'OwnerId':_0x3163c1['id'],'ActivityDate':moment[_0xf590('0xd')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x3f36cc[_0xf590('0xe')],_0x4ea3b4,'\x20'),'Description':intUtil['getString'](_0x3f36cc[_0xf590('0xf')],_0x4ea3b4,'\x0a')},getCustomFields(_0xdc03ac,_0x4ea3b4));if(_0x1c9fb2){_0xa2e02c[_0xf590('0x10')]=_0x1c9fb2['id'];}}else if(_0x3f36cc['ticketType']==='Case'){_0xa2e02c=Object[_0xf590('0xc')]({},{'OwnerId':_0x3163c1['id'],'Subject':intUtil[_0xf590('0x11')](_0x3f36cc[_0xf590('0xe')],_0x4ea3b4,'\x20'),'Description':intUtil[_0xf590('0x11')](_0x3f36cc[_0xf590('0xf')],_0x4ea3b4,'\x0a')},getCustomFields(_0xdc03ac,_0x4ea3b4));if(_0x1c9fb2){_0xa2e02c[_0xf590('0x12')]=_0x1c9fb2['id'];}}return _0x2a76a7[_0xf590('0x13')](_0x3f36cc[_0xf590('0xb')])[_0xf590('0x14')](_0xa2e02c);}function getUser(_0x3ad704,_0xf47e6c,_0x909c89){if(!_[_0xf590('0x15')](_0xf47e6c)&&intUtil[_0xf590('0x16')](_0xf47e6c)){var _0x164c03={'Email':_0xf47e6c};var _0x553a33={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x909c89[_0xf590('0x13')](_0xf590('0x17'))['find'](_0x164c03,_0x553a33)[_0xf590('0x18')]()['then'](function(_0x230504){if(_0x230504[_0xf590('0x19')]){var _0x208528=_[_0xf590('0x1a')](_0x230504,function(_0x2e9b7d){return _0x2e9b7d[_0xf590('0x1b')]===_0xf47e6c;});if(_0x208528){logger['info']('Agent\x20%s\x20found.',_0xf47e6c);return BPromise[_0xf590('0x1c')]({'id':_0x208528['Id'],'name':_0x208528[_0xf590('0x1d')]});}}else{logger[_0xf590('0x1e')](_0xf590('0x1f'),_0xf47e6c);return _0x909c89['identity']()[_0xf590('0x20')](function(_0x28b0b0){return BPromise[_0xf590('0x1c')]({'id':_0x28b0b0[_0xf590('0x21')],'name':_0x28b0b0[_0xf590('0x22')]});});}});}else{logger[_0xf590('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xf47e6c);return _0x909c89[_0xf590('0x23')]()[_0xf590('0x20')](function(_0x6648eb){return BPromise[_0xf590('0x1c')]({'id':_0x6648eb[_0xf590('0x21')],'name':_0x6648eb['display_name']});});}}function getEndUser(_0x242a03,_0x43ce27,_0x5cef8b,_0x41a09b,_0x2033f2){var _0x28b853={'Phone':_0x41a09b};var _0x3c0e27={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf590('0x1c')]()[_0xf590('0x20')](function(){if(_0x43ce27[_0xf590('0xb')]===_0xf590('0x24')){logger[_0xf590('0x1e')](_0xf590('0x25'),_0x41a09b,_0x43ce27['moduleSearch']);switch(_0x43ce27[_0xf590('0x26')]){case _0xf590('0x27'):return _0x2033f2[_0xf590('0x13')]('Contact')[_0xf590('0x1a')](_0x28b853,_0x3c0e27)[_0xf590('0x18')]()[_0xf590('0x20')](function(_0x553e02){if(_0x553e02&&_0x553e02[_0xf590('0x19')]){return _0x553e02;}else{return _0x2033f2['sobject'](_0xf590('0x28'))[_0xf590('0x1a')](_0x28b853,_0x3c0e27);}});case'contact':return _0x2033f2[_0xf590('0x13')](_0xf590('0x29'))[_0xf590('0x1a')](_0x28b853,_0x3c0e27)[_0xf590('0x18')]();case'lead':return _0x2033f2[_0xf590('0x13')](_0xf590('0x28'))[_0xf590('0x1a')](_0x28b853,_0x3c0e27);default:return null;}}else if(_0x43ce27[_0xf590('0xb')]===_0xf590('0x2a')){logger[_0xf590('0x1e')](_0xf590('0x25'),_0x41a09b,'contact');return _0x2033f2['sobject'](_0xf590('0x29'))[_0xf590('0x1a')](_0x28b853,_0x3c0e27)[_0xf590('0x18')]();}})['then'](function(_0x1484a6){if(_0x1484a6&&_0x1484a6[_0xf590('0x19')]){var _0x511dc1=_[_0xf590('0x1a')](_0x1484a6,function(_0x28e5d3){return _0x28e5d3[_0xf590('0x2b')]===_0x41a09b;});if(_0x511dc1){return BPromise[_0xf590('0x1c')]({'id':_0x511dc1['Id'],'name':_0x511dc1[_0xf590('0x1d')],'phone':_0x511dc1['Phone']});}}})['then'](function(_0x3dd643){if(_0x3dd643){logger['info'](_0xf590('0x2c'),_0x41a09b);return BPromise[_0xf590('0x1c')](_0x3dd643);}else{logger[_0xf590('0x1e')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x41a09b);var _0x556f98={'LastName':_0x5cef8b!==''?_0x5cef8b:util[_0xf590('0x2d')](_0xf590('0x2e'),_0x41a09b),'Phone':_0x41a09b};if(_0x43ce27[_0xf590('0x2f')]){if(_0x43ce27[_0xf590('0x2f')]===_0xf590('0x30')){logger[_0xf590('0x1e')](_0xf590('0x31'),_0x41a09b,_0x43ce27['moduleCreate']);}else if(_0x43ce27['moduleCreate']===_0xf590('0x32')&&_0x43ce27[_0xf590('0xb')]==='Task'){logger[_0xf590('0x1e')](_0xf590('0x31'),_0x41a09b,_0x43ce27[_0xf590('0x2f')]);_0x556f98[_0xf590('0x33')]='No\x20Company';}else{return null;}}return _0x2033f2[_0xf590('0x13')](_[_0xf590('0x34')](_0x43ce27[_0xf590('0x2f')]))['create'](_0x556f98);}});}function getCustomFields(_0x1a2d46,_0x151d96){var _0x2b0c91={};if(_0x1a2d46[_0xf590('0x19')]>0x0){_['forEach'](_0x1a2d46,function(_0x21e49b){if(_0x21e49b[_0xf590('0x35')]===_0xf590('0x36')&&_0x21e49b[_0xf590('0x37')]){_0x2b0c91[_0x21e49b[_0xf590('0x37')]]=_0x21e49b[_0xf590('0x38')]['toString']();}else if(_0x21e49b[_0xf590('0x35')]===_0xf590('0x39')&&_0x21e49b['variableName']&&_0x21e49b[_0xf590('0x37')]){_0x151d96[_0x21e49b[_0xf590('0x3a')]]&&(_0x2b0c91[_0x21e49b['idField']]=_0x151d96[_0x21e49b[_0xf590('0x3a')]][_0xf590('0x3b')]());}else if(_0x21e49b[_0xf590('0x35')]===_0xf590('0x3c')&&_0x21e49b[_0xf590('0x3d')]&&_0x21e49b[_0xf590('0x3d')][_0xf590('0x3e')]&&_0x21e49b['idField']){_0x151d96[_0x21e49b['Variable'][_0xf590('0x3e')][_0xf590('0x3f')]()]&&(_0x2b0c91[_0x21e49b[_0xf590('0x37')]]=_0x151d96[_0x21e49b[_0xf590('0x3d')][_0xf590('0x3e')]['toLowerCase']()][_0xf590('0x3b')]());}});}return _0x2b0c91;}function getConnection(_0x4a535d){var _0xfb7d74=_0x4a535d[_0xf590('0x40')][_0xf590('0x41')](_0x4a535d[_0xf590('0x42')]);var _0x3437c0=new jsforce[(_0xf590('0x43'))]({'oauth2':{'loginUrl':_0x4a535d[_0xf590('0x44')]||_0xf590('0x45'),'clientId':_0x4a535d['clientId'],'clientSecret':_0x4a535d['clientSecret']}});return _0x3437c0[_0xf590('0x46')](_0x4a535d[_0xf590('0x47')],_0xfb7d74)[_0xf590('0x20')](function(){logger[_0xf590('0x1e')](_0xf590('0x48'));return _0x3437c0;});}exports[_0xf590('0x49')]=function(_0x1d4e75,_0x3cc8f2,_0xe6a54b,_0x228515,_0x194eab,_0x7a3958){var _0x41fcb0,_0x203214,_0x5d712d,_0x3fec36;_0x7a3958['serverUrl']=intUtil[_0xf590('0x4a')](_0x7a3958['serverUrl']);_0x7a3958['remoteUri']=intUtil[_0xf590('0x4a')](_0x7a3958[_0xf590('0x44')]);if(_0x194eab&&_0x194eab[_0xf590('0x4b')]){logger[_0xf590('0x1e')](_0xf590('0x4c'),_0xf590('0x4d'));_0x3cc8f2[_0xf590('0x4e')]=util[_0xf590('0x2d')](_0xf590('0x4f'),_0x7a3958[_0xf590('0x50')],_0x3cc8f2[_0xf590('0x51')],md5(_0x3cc8f2[_0xf590('0x51')]));}else{_0x3cc8f2[_0xf590('0x4e')]='';}return getConnection(_0x7a3958)['then'](function(_0x20b353){_0x3fec36=_0x20b353;return getUser(_0x7a3958,_0x228515[_0xf590('0x52')],_0x3fec36);})[_0xf590('0x20')](function(_0x3d6522){_0x41fcb0=_0x3d6522;return getEndUser(_0x7a3958,_0xe6a54b,_0x3cc8f2[_0xf590('0x53')],_0x3cc8f2['calleridnum'],_0x3fec36);})[_0xf590('0x20')](function(_0x2ca9d9){_0x203214=_0x2ca9d9;return getTicket(_0x7a3958,_0x41fcb0,_0x203214,_0xe6a54b,_0x3cc8f2,_0xe6a54b['Fields'],_0x3fec36,_0xf590('0x49'));})[_0xf590('0x20')](function(_0x33b9ae){_0x5d712d=_0x33b9ae;logger[_0xf590('0x1e')](_0xf590('0x54'),_0x5d712d['id']);logger['info'](_0xf590('0x55'),_0x5d712d['id'],_0x228515[_0xf590('0x3e')],_0x7a3958[_0xf590('0x35')]);switch(_0x7a3958['type']){case _0xf590('0x56'):emit(util[_0xf590('0x2d')]('user:%s',_0x228515['name']),_0xf590('0x57'),{'recordId':_0x5d712d['id']});break;case _0xf590('0x58'):emit(util['format'](_0xf590('0x59'),_0x228515[_0xf590('0x3e')]),'trigger:browser:url',{'uri':util[_0xf590('0x2d')](_0xf590('0x5a'),_0x3fec36['instanceUrl'],_0x5d712d['id'])});break;default:logger[_0xf590('0x5b')](_0xf590('0x5c'));}})[_0xf590('0x5d')](function(_0x26f806){logger['error'](_0xf590('0x4c'),JSON[_0xf590('0x5e')](_0x26f806));});};exports[_0xf590('0x5f')]=function(_0x401120,_0x16d5a0,_0xec6ab0,_0x27be3f,_0x490f2a,_0x4ce4bf,_0x2730f4){var _0x498ff5,_0x5ae8d9,_0x5ab6b1,_0x3e1b35;_0x4ce4bf[_0xf590('0x50')]=intUtil[_0xf590('0x4a')](_0x4ce4bf[_0xf590('0x50')]);_0x4ce4bf['remoteUri']=intUtil[_0xf590('0x4a')](_0x4ce4bf[_0xf590('0x44')]);if(_0x2730f4&&_0x2730f4[_0xf590('0x60')]&&_0x2730f4['recordingFormat']!==_0xf590('0x61')){logger['info']('[OUTBOUND]',_0xf590('0x4d'));_0x16d5a0[_0xf590('0x4e')]=util['format'](_0xf590('0x4f'),_0x4ce4bf[_0xf590('0x50')],_0x16d5a0[_0xf590('0x51')],md5(_0x16d5a0['uniqueid']));}return getConnection(_0x4ce4bf)['then'](function(_0xf00e5a){_0x3e1b35=_0xf00e5a;return getUser(_0x4ce4bf,_0x27be3f[_0xf590('0x52')],_0x3e1b35);})[_0xf590('0x20')](function(_0x430a62){_0x498ff5=_0x430a62;return getEndUser(_0x4ce4bf,_0xec6ab0,_0x16d5a0[_0xf590('0x62')],_0x16d5a0[_0xf590('0x63')],_0x3e1b35);})['then'](function(_0x2ec1c6){_0x5ae8d9=_0x2ec1c6;return getTicket(_0x4ce4bf,_0x498ff5,_0x5ae8d9,_0xec6ab0,_0x16d5a0,_0xec6ab0[_0xf590('0x64')],_0x3e1b35,_0xf590('0x5f'));})[_0xf590('0x20')](function(_0x4bdc56){_0x5ab6b1=_0x4bdc56;logger[_0xf590('0x1e')](_0xf590('0x65'),_0x5ab6b1['id']);logger[_0xf590('0x1e')](_0xf590('0x66'),_0x5ab6b1['id'],_0x27be3f[_0xf590('0x3e')],_0x4ce4bf[_0xf590('0x35')]);switch(_0x4ce4bf[_0xf590('0x35')]){case _0xf590('0x56'):emit(util[_0xf590('0x2d')]('user:%s',_0x27be3f[_0xf590('0x3e')]),_0xf590('0x57'),{'recordId':_0x5ab6b1['id']});break;case _0xf590('0x58'):emit(util[_0xf590('0x2d')]('user:%s',_0x27be3f[_0xf590('0x3e')]),_0xf590('0x67'),{'uri':util[_0xf590('0x2d')](_0xf590('0x5a'),_0x3e1b35[_0xf590('0x68')],_0x5ab6b1['id'])});break;default:logger['error'](_0xf590('0x69'),_0xf590('0x6a'));}})[_0xf590('0x5d')](function(_0x4215f7){logger['error'](_0xf590('0x69'),JSON['stringify'](_0x4215f7));});};exports[_0xf590('0x6b')]=function(_0x2ba0be,_0x1e048e,_0x9e388b,_0x365bab,_0x465014,_0x2c2086){var _0xd996b0,_0x3a904d,_0x201a91,_0x115dc2;_0x2c2086[_0xf590('0x50')]=intUtil[_0xf590('0x4a')](_0x2c2086[_0xf590('0x50')]);_0x2c2086[_0xf590('0x44')]=intUtil['stripTrailingSlash'](_0x2c2086['remoteUri']);if(_0x465014&&_0x465014[_0xf590('0x4b')]){logger['info']('['+_0x1e048e[_0xf590('0x6c')]['toUpperCase']()+']',_0xf590('0x4d'));_0x1e048e[_0xf590('0x4e')]=util[_0xf590('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c2086[_0xf590('0x50')],_0x1e048e[_0xf590('0x51')],md5(_0x1e048e[_0xf590('0x51')]));}else{_0x1e048e[_0xf590('0x4e')]='';}return getConnection(_0x2c2086)['then'](function(_0x4cde2c){_0x115dc2=_0x4cde2c;if(!_[_0xf590('0x15')](_0x365bab)){return getUser(_0x2c2086,_0x365bab['name'],_0x115dc2);}else{return getUser(_0x2c2086,null,_0x115dc2);}})[_0xf590('0x20')](function(_0x1a10e4){_0xd996b0=_0x1a10e4;return getEndUser(_0x2c2086,_0x9e388b,_0x1e048e['calleridname'],_0x1e048e[_0xf590('0x6d')],_0x115dc2);})[_0xf590('0x20')](function(_0xc524f2){_0x3a904d=_0xc524f2;return getTicket(_0x2c2086,_0xd996b0,_0x3a904d,_0x9e388b,_0x1e048e,_0x9e388b['Fields'],_0x115dc2);})[_0xf590('0x20')](function(_0x4a609e){_0x201a91=_0x4a609e;logger[_0xf590('0x1e')]('['+_0x1e048e['lastevent'][_0xf590('0x6e')]()+_0xf590('0x6f'),_0x201a91['id']);logger[_0xf590('0x1e')]('['+_0x1e048e[_0xf590('0x6c')][_0xf590('0x6e')]()+_0xf590('0x70'),_0x2c2086['type']);})['catch'](function(_0x54c7e4){logger[_0xf590('0x5b')]('['+_0x1e048e[_0xf590('0x6c')]['toUpperCase']()+']',JSON[_0xf590('0x5e')](_0x54c7e4));});};
\ No newline at end of file
+var _0xf76f=['newTab','user:%s','trigger:browser:url','%s/%s/e','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','assign','utc','getString','Subjects','Descriptions','WhoId','sobject','isNil','validateEmail','User','execute','length','find','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','display_name','Task','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','lead','Case','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display'];(function(_0x55f898,_0x542314){var _0x36e2f3=function(_0x1f7272){while(--_0x1f7272){_0x55f898['push'](_0x55f898['shift']());}};_0x36e2f3(++_0x542314);}(_0xf76f,0x80));var _0xff76=function(_0x58d1e3,_0x55f6c0){_0x58d1e3=_0x58d1e3-0x0;var _0x5a6d44=_0xf76f[_0x58d1e3];return _0x5a6d44;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xff76('0x0'));var BPromise=require(_0xff76('0x1'));var md5=require(_0xff76('0x2'));var jsforce=require(_0xff76('0x3'));var util=require(_0xff76('0x4'));var Redis=require(_0xff76('0x5'));var intUtil=require(_0xff76('0x6'));var config=require('../../../../config/environment');var logger=require(_0xff76('0x7'))(_0xff76('0x8'));config[_0xff76('0x9')]=_[_0xff76('0xa')](config[_0xff76('0x9')],{'host':_0xff76('0xb'),'port':0x18eb});var io=require(_0xff76('0xc'))(new Redis(config['redis']));function emit(_0x2b2747,_0x115cf9,_0x23e618){io['to'](_0x2b2747)[_0xff76('0xd')](_0x115cf9,_0x23e618);}function getTicket(_0x599c67,_0x277ca3,_0x100a1c,_0x38493f,_0x5512b1,_0x2c8e3a,_0x3286ee,_0x4dfdd2){var _0x51ab72={};if(_0x38493f[_0xff76('0xe')]==='Task'){_0x51ab72=Object[_0xff76('0xf')]({},{'OwnerId':_0x277ca3['id'],'ActivityDate':moment[_0xff76('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xff76('0x11')](_0x38493f[_0xff76('0x12')],_0x5512b1,'\x20'),'Description':intUtil[_0xff76('0x11')](_0x38493f[_0xff76('0x13')],_0x5512b1,'\x0a')},getCustomFields(_0x2c8e3a,_0x5512b1));if(_0x100a1c){_0x51ab72[_0xff76('0x14')]=_0x100a1c['id'];}}else if(_0x38493f[_0xff76('0xe')]==='Case'){_0x51ab72=Object[_0xff76('0xf')]({},{'OwnerId':_0x277ca3['id'],'Subject':intUtil[_0xff76('0x11')](_0x38493f[_0xff76('0x12')],_0x5512b1,'\x20'),'Description':intUtil[_0xff76('0x11')](_0x38493f[_0xff76('0x13')],_0x5512b1,'\x0a')},getCustomFields(_0x2c8e3a,_0x5512b1));if(_0x100a1c){_0x51ab72['ContactId']=_0x100a1c['id'];}}return _0x3286ee[_0xff76('0x15')](_0x38493f[_0xff76('0xe')])['create'](_0x51ab72);}function getUser(_0x181768,_0x410106,_0x37e856){if(!_[_0xff76('0x16')](_0x410106)&&intUtil[_0xff76('0x17')](_0x410106)){var _0x20f987={'Email':_0x410106};var _0x58e57e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x37e856[_0xff76('0x15')](_0xff76('0x18'))['find'](_0x20f987,_0x58e57e)[_0xff76('0x19')]()['then'](function(_0x31e2be){if(_0x31e2be[_0xff76('0x1a')]){var _0x1afcc9=_[_0xff76('0x1b')](_0x31e2be,function(_0x214d00){return _0x214d00['Email']===_0x410106;});if(_0x1afcc9){logger[_0xff76('0x1c')]('Agent\x20%s\x20found.',_0x410106);return BPromise[_0xff76('0x1d')]({'id':_0x1afcc9['Id'],'name':_0x1afcc9[_0xff76('0x1e')]});}}else{logger[_0xff76('0x1c')](_0xff76('0x1f'),_0x410106);return _0x37e856[_0xff76('0x20')]()[_0xff76('0x21')](function(_0x51a52a){return BPromise[_0xff76('0x1d')]({'id':_0x51a52a['user_id'],'name':_0x51a52a[_0xff76('0x22')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x410106);return _0x37e856['identity']()[_0xff76('0x21')](function(_0x2315b9){return BPromise[_0xff76('0x1d')]({'id':_0x2315b9['user_id'],'name':_0x2315b9['display_name']});});}}function getEndUser(_0xddd7c3,_0xa082a,_0x36c86a,_0x41bc2e,_0x4423a5){var _0x15d42f={'Phone':_0x41bc2e};var _0x45ac42={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xff76('0x1d')]()['then'](function(){if(_0xa082a[_0xff76('0xe')]===_0xff76('0x23')){logger['info'](_0xff76('0x24'),_0x41bc2e,_0xa082a[_0xff76('0x25')]);switch(_0xa082a[_0xff76('0x25')]){case'contact_lead':return _0x4423a5[_0xff76('0x15')](_0xff76('0x26'))['find'](_0x15d42f,_0x45ac42)['execute']()[_0xff76('0x21')](function(_0x10c526){if(_0x10c526&&_0x10c526[_0xff76('0x1a')]){return _0x10c526;}else{return _0x4423a5[_0xff76('0x15')](_0xff76('0x27'))[_0xff76('0x1b')](_0x15d42f,_0x45ac42);}});case _0xff76('0x28'):return _0x4423a5['sobject'](_0xff76('0x26'))['find'](_0x15d42f,_0x45ac42)[_0xff76('0x19')]();case _0xff76('0x29'):return _0x4423a5[_0xff76('0x15')]('Lead')['find'](_0x15d42f,_0x45ac42);default:return null;}}else if(_0xa082a[_0xff76('0xe')]===_0xff76('0x2a')){logger[_0xff76('0x1c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x41bc2e,_0xff76('0x28'));return _0x4423a5[_0xff76('0x15')](_0xff76('0x26'))[_0xff76('0x1b')](_0x15d42f,_0x45ac42)['execute']();}})['then'](function(_0x54b803){if(_0x54b803&&_0x54b803['length']){var _0x471827=_[_0xff76('0x1b')](_0x54b803,function(_0x162cf9){return _0x162cf9['Phone']===_0x41bc2e;});if(_0x471827){return BPromise[_0xff76('0x1d')]({'id':_0x471827['Id'],'name':_0x471827[_0xff76('0x1e')],'phone':_0x471827[_0xff76('0x2b')]});}}})['then'](function(_0x12adb3){if(_0x12adb3){logger[_0xff76('0x1c')](_0xff76('0x2c'),_0x41bc2e);return BPromise[_0xff76('0x1d')](_0x12adb3);}else{logger['info'](_0xff76('0x2d'),_0x41bc2e);var _0x48d67c={'LastName':_0x36c86a!==_0xff76('0x2e')?_0x36c86a:util[_0xff76('0x2f')](_0xff76('0x30'),_0x41bc2e),'Phone':_0x41bc2e};if(_0xa082a[_0xff76('0x31')]){if(_0xa082a[_0xff76('0x31')]===_0xff76('0x28')){logger[_0xff76('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x41bc2e,_0xa082a[_0xff76('0x31')]);}else if(_0xa082a[_0xff76('0x31')]===_0xff76('0x29')&&_0xa082a[_0xff76('0xe')]==='Task'){logger[_0xff76('0x1c')](_0xff76('0x32'),_0x41bc2e,_0xa082a[_0xff76('0x31')]);_0x48d67c['Company']=_0xff76('0x33');}else{return null;}}return _0x4423a5[_0xff76('0x15')](_['upperFirst'](_0xa082a[_0xff76('0x31')]))['create'](_0x48d67c);}});}function getCustomFields(_0x3c928a,_0x75fe56){var _0x30be82={};if(_0x3c928a[_0xff76('0x1a')]>0x0){_['forEach'](_0x3c928a,function(_0x1f38e6){if(_0x1f38e6['type']==='string'&&_0x1f38e6[_0xff76('0x34')]){_0x30be82[_0x1f38e6['idField']]=_0x1f38e6[_0xff76('0x35')][_0xff76('0x36')]();}else if(_0x1f38e6[_0xff76('0x37')]===_0xff76('0x38')&&_0x1f38e6['variableName']&&_0x1f38e6['idField']){_0x75fe56[_0x1f38e6[_0xff76('0x39')]]&&(_0x30be82[_0x1f38e6['idField']]=_0x75fe56[_0x1f38e6[_0xff76('0x39')]][_0xff76('0x36')]());}else if(_0x1f38e6[_0xff76('0x37')]===_0xff76('0x3a')&&_0x1f38e6[_0xff76('0x3b')]&&_0x1f38e6['Variable'][_0xff76('0x3c')]&&_0x1f38e6['idField']){_0x75fe56[_0x1f38e6[_0xff76('0x3b')][_0xff76('0x3c')][_0xff76('0x3d')]()]&&(_0x30be82[_0x1f38e6[_0xff76('0x34')]]=_0x75fe56[_0x1f38e6[_0xff76('0x3b')]['name'][_0xff76('0x3d')]()][_0xff76('0x36')]());}});}return _0x30be82;}function getConnection(_0x5c1c99){var _0x3a6d94=_0x5c1c99[_0xff76('0x3e')][_0xff76('0x3f')](_0x5c1c99[_0xff76('0x40')]);var _0x47980b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x5c1c99[_0xff76('0x41')]||'https://login.salesforce.com','clientId':_0x5c1c99[_0xff76('0x42')],'clientSecret':_0x5c1c99[_0xff76('0x43')]}});return _0x47980b[_0xff76('0x44')](_0x5c1c99[_0xff76('0x45')],_0x3a6d94)[_0xff76('0x21')](function(){logger['info'](_0xff76('0x46'));return _0x47980b;});}exports[_0xff76('0x47')]=function(_0x2da687,_0xf65901,_0x194674,_0x282613,_0x54ad85,_0x3852de){var _0x26fc74,_0x231c6d,_0x3990cc,_0x529d9b;_0x3852de[_0xff76('0x48')]=intUtil[_0xff76('0x49')](_0x3852de[_0xff76('0x48')]);_0x3852de[_0xff76('0x41')]=intUtil[_0xff76('0x49')](_0x3852de['remoteUri']);if(_0x54ad85&&_0x54ad85['monitor_format']){logger[_0xff76('0x1c')](_0xff76('0x4a'),_0xff76('0x4b'));_0xf65901[_0xff76('0x4c')]=util[_0xff76('0x2f')](_0xff76('0x4d'),_0x3852de['serverUrl'],_0xf65901[_0xff76('0x4e')],md5(_0xf65901[_0xff76('0x4e')]));}else{_0xf65901[_0xff76('0x4c')]='';}return getConnection(_0x3852de)[_0xff76('0x21')](function(_0x458dbc){_0x529d9b=_0x458dbc;return getUser(_0x3852de,_0x282613['email'],_0x529d9b);})['then'](function(_0x490853){_0x26fc74=_0x490853;return getEndUser(_0x3852de,_0x194674,_0xf65901[_0xff76('0x4f')],_0xf65901[_0xff76('0x50')],_0x529d9b);})['then'](function(_0x27260a){_0x231c6d=_0x27260a;return getTicket(_0x3852de,_0x26fc74,_0x231c6d,_0x194674,_0xf65901,_0x194674[_0xff76('0x51')],_0x529d9b,'queue');})['then'](function(_0x4162ff){_0x3990cc=_0x4162ff;logger[_0xff76('0x1c')](_0xff76('0x52'),_0x3990cc['id']);logger[_0xff76('0x1c')](_0xff76('0x53'),_0x3990cc['id'],_0x282613[_0xff76('0x3c')],_0x3852de[_0xff76('0x37')]);switch(_0x3852de['type']){case _0xff76('0x54'):emit(util[_0xff76('0x2f')]('user:%s',_0x282613['name']),_0xff76('0x55'),{'recordId':_0x3990cc['id']});break;case _0xff76('0x56'):emit(util['format'](_0xff76('0x57'),_0x282613['name']),_0xff76('0x58'),{'uri':util[_0xff76('0x2f')](_0xff76('0x59'),_0x529d9b['instanceUrl'],_0x3990cc['id'])});break;default:logger['error'](_0xff76('0x5a'));}})[_0xff76('0x5b')](function(_0x44d950){logger[_0xff76('0x5c')](_0xff76('0x4a'),JSON[_0xff76('0x5d')](_0x44d950));});};exports[_0xff76('0x5e')]=function(_0x152ae3,_0x4157a8,_0x16f541,_0x2cf6c7,_0x4429e9,_0x1cbd8a,_0x543514){var _0xb8a75a,_0x2355bb,_0x4fc585,_0x223b96;_0x1cbd8a[_0xff76('0x48')]=intUtil['stripTrailingSlash'](_0x1cbd8a[_0xff76('0x48')]);_0x1cbd8a[_0xff76('0x41')]=intUtil[_0xff76('0x49')](_0x1cbd8a[_0xff76('0x41')]);if(_0x543514&&_0x543514['recordingFormat']&&_0x543514[_0xff76('0x5f')]!==_0xff76('0x60')){logger[_0xff76('0x1c')](_0xff76('0x61'),_0xff76('0x4b'));_0x4157a8[_0xff76('0x4c')]=util[_0xff76('0x2f')](_0xff76('0x4d'),_0x1cbd8a['serverUrl'],_0x4157a8[_0xff76('0x4e')],md5(_0x4157a8['uniqueid']));}return getConnection(_0x1cbd8a)[_0xff76('0x21')](function(_0x4c590b){_0x223b96=_0x4c590b;return getUser(_0x1cbd8a,_0x2cf6c7[_0xff76('0x62')],_0x223b96);})['then'](function(_0x20dfef){_0xb8a75a=_0x20dfef;return getEndUser(_0x1cbd8a,_0x16f541,_0x4157a8[_0xff76('0x63')],_0x4157a8['destcalleridnum'],_0x223b96);})[_0xff76('0x21')](function(_0x30d52e){_0x2355bb=_0x30d52e;return getTicket(_0x1cbd8a,_0xb8a75a,_0x2355bb,_0x16f541,_0x4157a8,_0x16f541[_0xff76('0x51')],_0x223b96,_0xff76('0x5e'));})[_0xff76('0x21')](function(_0x386cf1){_0x4fc585=_0x386cf1;logger[_0xff76('0x1c')](_0xff76('0x64'),_0x4fc585['id']);logger['info'](_0xff76('0x65'),_0x4fc585['id'],_0x2cf6c7[_0xff76('0x3c')],_0x1cbd8a[_0xff76('0x37')]);switch(_0x1cbd8a[_0xff76('0x37')]){case _0xff76('0x54'):emit(util['format'](_0xff76('0x57'),_0x2cf6c7[_0xff76('0x3c')]),_0xff76('0x55'),{'recordId':_0x4fc585['id']});break;case _0xff76('0x56'):emit(util[_0xff76('0x2f')](_0xff76('0x57'),_0x2cf6c7[_0xff76('0x3c')]),'trigger:browser:url',{'uri':util[_0xff76('0x2f')](_0xff76('0x59'),_0x223b96['instanceUrl'],_0x4fc585['id'])});break;default:logger[_0xff76('0x5c')](_0xff76('0x61'),_0xff76('0x66'));}})['catch'](function(_0x420077){logger[_0xff76('0x5c')](_0xff76('0x61'),JSON[_0xff76('0x5d')](_0x420077));});};exports['unmanaged']=function(_0x2d6b63,_0x1d379c,_0x4f6a4,_0x461498,_0x53488a,_0x16610f){var _0x5efc38,_0x26b121,_0x551d7d,_0x30186f;_0x16610f[_0xff76('0x48')]=intUtil[_0xff76('0x49')](_0x16610f[_0xff76('0x48')]);_0x16610f['remoteUri']=intUtil[_0xff76('0x49')](_0x16610f[_0xff76('0x41')]);if(_0x53488a&&_0x53488a[_0xff76('0x67')]){logger[_0xff76('0x1c')]('['+_0x1d379c[_0xff76('0x68')][_0xff76('0x69')]()+']',_0xff76('0x4b'));_0x1d379c[_0xff76('0x4c')]=util[_0xff76('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x16610f[_0xff76('0x48')],_0x1d379c[_0xff76('0x4e')],md5(_0x1d379c[_0xff76('0x4e')]));}else{_0x1d379c[_0xff76('0x4c')]='';}return getConnection(_0x16610f)[_0xff76('0x21')](function(_0x1df5a9){_0x30186f=_0x1df5a9;if(!_['isNil'](_0x461498)){return getUser(_0x16610f,_0x461498[_0xff76('0x3c')],_0x30186f);}else{return getUser(_0x16610f,null,_0x30186f);}})[_0xff76('0x21')](function(_0x254277){_0x5efc38=_0x254277;return getEndUser(_0x16610f,_0x4f6a4,_0x1d379c[_0xff76('0x4f')],_0x1d379c[_0xff76('0x50')],_0x30186f);})[_0xff76('0x21')](function(_0x3e2795){_0x26b121=_0x3e2795;return getTicket(_0x16610f,_0x5efc38,_0x26b121,_0x4f6a4,_0x1d379c,_0x4f6a4[_0xff76('0x51')],_0x30186f);})[_0xff76('0x21')](function(_0x5ec777){_0x551d7d=_0x5ec777;logger['info']('['+_0x1d379c[_0xff76('0x68')][_0xff76('0x69')]()+']\x20Ticket\x20%s\x20created.',_0x551d7d['id']);logger[_0xff76('0x1c')]('['+_0x1d379c[_0xff76('0x68')][_0xff76('0x69')]()+_0xff76('0x6a'),_0x16610f[_0xff76('0x37')]);})[_0xff76('0x5b')](function(_0x221fff){logger[_0xff76('0x5c')]('['+_0x1d379c[_0xff76('0x68')][_0xff76('0x69')]()+']',JSON[_0xff76('0x5d')](_0x221fff));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js
index 1dedf27..87a202f 100644
--- a/server/services/ami/trigger/integration/servicenow.js
+++ b/server/services/ami/trigger/integration/servicenow.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['recordingURL','The\x20ticket\x20ID\x20is:\x20%s','format','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','GET','],\x20getUser\x20rp\x20obj','then','length','active','true','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','userId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','string','nameField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','customField','name',']\x20getTicket\x20input\x20crm','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','Incident\x20-\x20',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','user:%s','emit','username','password','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','userEmail','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none'];(function(_0x3fd770,_0x316b8d){var _0x2f66cf=function(_0x2432ee){while(--_0x2432ee){_0x3fd770['push'](_0x3fd770['shift']());}};_0x2f66cf(++_0x316b8d);}(_0x1261,0x144));var _0x1126=function(_0x3adafa,_0x1ff5ea){_0x3adafa=_0x3adafa-0x0;var _0x229947=_0x1261[_0x3adafa];return _0x229947;};'use strict';var _=require('lodash');var Promise=require(_0x1126('0x0'));var rp=require(_0x1126('0x1'));var util=require(_0x1126('0x2'));var md5=require(_0x1126('0x3'));var Redis=require(_0x1126('0x4'));var intUtil=require(_0x1126('0x5'));var config=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));config[_0x1126('0x9')]=_['defaults'](config['redis'],{'host':_0x1126('0xa'),'port':0x18eb});var io=require(_0x1126('0xb'))(new Redis(config['redis']));function getAdminUser(_0x17e5f0,_0x28772d,_0x245be9,_0x3abb0b,_0x2d9033,_0x59cfa1){return new Promise(function(_0x3f09ac,_0x18dbe6){var _0x167ef1={'method':'GET','uri':_0x3abb0b+_0x1126('0xc')+'&'+_0x2d9033+'&'+_0x59cfa1,'auth':_0x28772d,'json':!![]};return rp(_0x167ef1)['then'](function(_0x52ef15){if(_0x52ef15[_0x1126('0xd')]['length']>0x0){_0x245be9[_0x1126('0xe')]=_0x52ef15[_0x1126('0xd')][0x0][_0x1126('0xf')];}logger[_0x1126('0x10')]('['+[_0x17e5f0[_0x1126('0x11')]()]+_0x1126('0x12'),_0x245be9);_0x3f09ac(_0x245be9);})[_0x1126('0x13')](function(_0x2048ad){logger[_0x1126('0x14')]('['+[_0x17e5f0['toUpperCase']()]+']',_0x2048ad['message']);_0x18dbe6(_0x2048ad[_0x1126('0x15')]);});});}function getUser(_0x154e20,_0x279455,_0x4be0c6,_0x45149c,_0x4794a7){return function(_0x35fe9f){logger[_0x1126('0x10')]('['+[_0x154e20[_0x1126('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x35fe9f);return new Promise(function(_0x245cd7,_0x1695f6){if(intUtil['validateEmail'](_0x35fe9f['userEmail'])){var _0x22ae0b={'method':_0x1126('0x16'),'uri':_0x4be0c6+'sys_user?sysparm_query=email%3D'+_0x35fe9f['userEmail']+'&'+_0x45149c+'&'+_0x4794a7,'auth':_0x279455,'json':!![]};logger[_0x1126('0x10')]('['+[_0x154e20['toUpperCase']()]+_0x1126('0x17'),_0x22ae0b);return rp(_0x22ae0b)[_0x1126('0x18')](function(_0x2f70ac){logger['info']('['+[_0x154e20[_0x1126('0x11')]()]+'],\x20getUser\x20entity',_0x2f70ac);if(_0x2f70ac['result'][_0x1126('0x19')]>0x0&&String(_0x2f70ac[_0x1126('0xd')][0x0][_0x1126('0x1a')])===_0x1126('0x1b')){_0x35fe9f['userId']=_0x2f70ac[_0x1126('0xd')][0x0][_0x1126('0xf')];}else{_0x35fe9f['userId']=_0x35fe9f[_0x1126('0xe')];_0x35fe9f['userEmail']=_0x35fe9f['adminEmail'];}logger['info']('['+[_0x154e20[_0x1126('0x11')]()]+_0x1126('0x1c'),_0x35fe9f);_0x245cd7(_0x35fe9f);})[_0x1126('0x13')](function(_0x34bcf1){logger[_0x1126('0x14')]('['+[_0x154e20[_0x1126('0x11')]()]+']',_0x34bcf1[_0x1126('0x15')]);_0x1695f6(_0x34bcf1[_0x1126('0x15')]);});}else{logger['info']('['+[_0x154e20[_0x1126('0x11')]()]+_0x1126('0x1d'));_0x35fe9f[_0x1126('0x1e')]=_0x35fe9f['adminId'];_0x35fe9f['userEmail']=_0x35fe9f[_0x1126('0x1f')];_0x245cd7(_0x35fe9f);}});};}function createEndUser(_0x39bf0e,_0x55e195,_0x2fb797,_0x23d2bc,_0x4a334a){logger[_0x1126('0x10')]('['+[_0x39bf0e['toUpperCase']()]+_0x1126('0x20'),_0x2fb797);return new Promise(function(_0x4bd50b,_0x771bb8){var _0x583ce6={'method':_0x1126('0x21'),'uri':_0x23d2bc+'sys_user?'+_0x4a334a,'body':{'user_name':_0x2fb797['endUserNumber'],'roles':'user','first_name':_0x2fb797[_0x1126('0x22')],'active':_0x1126('0x1b'),'date_format':_0x1126('0x23'),'phone':_0x2fb797['endUserNumber']},'auth':_0x55e195,'json':!![]};return rp(_0x583ce6)[_0x1126('0x18')](function(_0x226afb){logger['info']('['+[_0x39bf0e[_0x1126('0x11')]()]+_0x1126('0x24'),_0x226afb[_0x1126('0xd')]);_0x2fb797[_0x1126('0x25')]=_0x226afb['result']['sys_id'];_0x4bd50b(_0x2fb797);})[_0x1126('0x13')](function(_0x19e6e4){logger[_0x1126('0x14')]('['+[_0x39bf0e[_0x1126('0x11')]()]+']',_0x19e6e4['message']);_0x771bb8(_0x19e6e4[_0x1126('0x15')]);});});}function getEndUser(_0x6f4312,_0x313ebe,_0x22436c,_0x3b0f79,_0x5df232){return function(_0x2a0dfe){logger[_0x1126('0x10')]('['+[_0x6f4312[_0x1126('0x11')]()]+_0x1126('0x26'),_0x2a0dfe);return new Promise(function(_0x5c019d,_0x4ca51c){var _0x22827a={'method':_0x1126('0x16'),'uri':_0x22436c+'sys_user?sysparm_query=phone%3D'+_0x2a0dfe[_0x1126('0x22')]+'&'+_0x3b0f79+'&'+_0x5df232,'auth':_0x313ebe,'json':!![]};return rp(_0x22827a)[_0x1126('0x18')](function(_0x11b0f6){if(_0x11b0f6['result']['length']>0x0){_0x2a0dfe[_0x1126('0x25')]=_0x11b0f6[_0x1126('0xd')][0x0][_0x1126('0xf')];logger[_0x1126('0x10')]('['+[_0x6f4312['toUpperCase']()]+_0x1126('0x27'),_0x2a0dfe);_0x5c019d(_0x2a0dfe);}else{return createEndUser(_0x6f4312,_0x313ebe,_0x2a0dfe,_0x22436c,_0x3b0f79)['then'](function(_0x8abfe3){logger[_0x1126('0x10')]('['+[_0x6f4312[_0x1126('0x11')]()]+_0x1126('0x28'),_0x8abfe3);_0x5c019d(_0x8abfe3);});}})[_0x1126('0x13')](function(_0x5746f6){logger[_0x1126('0x14')]('['+[_0x6f4312[_0x1126('0x11')]()]+']',_0x5746f6[_0x1126('0x15')]);_0x4ca51c(_0x5746f6[_0x1126('0x15')]);});});};}function getCustomFields(_0x3469a2,_0x3442b8){var _0x3052f9={};if(_0x3469a2['length']>0x0){_[_0x1126('0x29')](_0x3469a2,function(_0x154c28){if(_0x154c28[_0x1126('0x2a')]===_0x1126('0x2b')&&_0x154c28[_0x1126('0x2c')]&&!_0x154c28['customField']){_0x3052f9[_0x154c28['idField'][_0x1126('0x2d')]()]=_0x154c28[_0x1126('0x2e')][_0x1126('0x2f')]();}else if(_0x154c28[_0x1126('0x2a')]===_0x1126('0x2b')&&_0x154c28[_0x1126('0x30')]&&_0x154c28['customField']){_0x3052f9[_0x154c28['idField']['toLowerCase']()]=_0x154c28[_0x1126('0x2e')]['toString']();}else if(_0x154c28[_0x1126('0x2a')]===_0x1126('0x31')&&_0x154c28[_0x1126('0x32')]&&_0x154c28[_0x1126('0x30')]&&_0x154c28['customField']){_0x3052f9[_0x154c28['idField'][_0x1126('0x2d')]()]=_0x3442b8[_0x154c28[_0x1126('0x32')]][_0x1126('0x2f')]();}else if(_0x154c28['type']===_0x1126('0x33')&&_0x154c28['Variable']&&_0x154c28[_0x1126('0x34')]['name']&&_0x154c28[_0x1126('0x30')]&&_0x154c28[_0x1126('0x35')]){_0x3052f9[_0x154c28[_0x1126('0x30')]['toLowerCase']()]=_0x3442b8[_0x154c28[_0x1126('0x34')][_0x1126('0x36')][_0x1126('0x2d')]()]['toString']();}});}return _0x3052f9;}function getTicket(_0x58ff3a,_0x4dd7f5,_0x6e78cf,_0x520b62,_0x1e197e,_0x507568){return function(_0x2f45b9){logger[_0x1126('0x10')]('['+[_0x58ff3a[_0x1126('0x11')]()]+_0x1126('0x37'),_0x2f45b9);return new Promise(function(_0xede3d8,_0x56732f){var _0x198173=_0x58ff3a[_0x1126('0x2d')]()==='outbound'?_0x2f45b9[_0x1126('0x1e')]:_0x2f45b9[_0x1126('0x25')];var _0x575f79={'method':_0x1126('0x21'),'uri':_0x6e78cf+_0x1126('0x38')+'?'+_0x507568,'body':Object['assign']({},{'active':_0x1126('0x1b'),'caller_id':_0x198173,'assigned_to':_0x2f45b9[_0x1126('0x1e')],'short_description':intUtil[_0x1126('0x39')](_0x520b62['Subjects'],_0x1e197e,'\x20'),'description':intUtil[_0x1126('0x39')](_0x520b62[_0x1126('0x3a')],_0x1e197e,'\x0a')},getCustomFields(_0x520b62[_0x1126('0x3b')],_0x1e197e)),'auth':_0x4dd7f5,'json':!![]};return rp(_0x575f79)[_0x1126('0x18')](function(_0x224456){logger[_0x1126('0x10')]('['+[_0x58ff3a[_0x1126('0x11')]()]+_0x1126('0x3c'),_0x224456['result']);_0x2f45b9[_0x1126('0x3d')]=_0x224456['result'][_0x1126('0xf')];_0x2f45b9[_0x1126('0x3e')]=_0x224456['result']['number'];logger[_0x1126('0x10')]('['+[_0x58ff3a[_0x1126('0x11')]()]+_0x1126('0x3f'),_0x2f45b9);_0xede3d8(_0x2f45b9);})['catch'](function(_0x3cb44c){logger[_0x1126('0x14')]('['+[_0x58ff3a[_0x1126('0x11')]()]+']',_0x3cb44c[_0x1126('0x15')]);_0x56732f(_0x3cb44c['message']);});});};}function createRemoteTag(_0x30d1b3,_0x46551f,_0x5c36b9,_0x4bcc08){return new Promise(function(_0x4abb4d,_0x526b07){var _0x386c10={'method':_0x1126('0x21'),'uri':_0x5c36b9+'label'+'?'+_0x4bcc08,'body':{'short_description':_0x30d1b3,'global':!![],'active':!![],'name':_0x30d1b3},'auth':_0x46551f,'json':!![]};return rp(_0x386c10)[_0x1126('0x18')](function(_0x1c7a2b){var _0x38093e=_0x1c7a2b[_0x1126('0xd')][_0x1126('0xf')];_0x4abb4d(_0x38093e);});});}function getRemoteTag(_0x4e4d49,_0x41cbb6,_0x267592,_0x5d6414,_0x322016){return new Promise(function(_0x476aca,_0xcc9499){var _0x36b61={'method':_0x1126('0x16'),'uri':_0x267592+'label'+_0x1126('0x40')+_0x4e4d49+'&'+_0x5d6414,'auth':_0x41cbb6,'json':!![]};return rp(_0x36b61)['then'](function(_0x868b2c){if(_0x868b2c[_0x1126('0xd')][_0x1126('0x19')]>0x0){var _0x590bc2=_0x868b2c[_0x1126('0xd')][0x0][_0x1126('0xf')];_0x476aca(_0x590bc2);}else{return createRemoteTag(_0x4e4d49,_0x41cbb6,_0x267592,_0x5d6414)['then'](function(_0x30812d){_0x476aca(_0x30812d);});}});});}function assignTagToIncident(_0x25038f,_0x9bad53,_0x5a5340,_0x2fe6dc,_0x3377db){return new Promise(function(_0x22ab18,_0x308ee4){var _0x128c94={'method':_0x1126('0x21'),'uri':_0x5a5340+_0x1126('0x41')+'?'+_0x3377db,'body':{'label':_0x25038f,'table':_0x1126('0x38'),'id_type':'Incident','table_key':_0x2fe6dc[_0x1126('0x3d')],'title':_0x1126('0x42')+_0x2fe6dc[_0x1126('0x3e')],'id_display':_0x2fe6dc[_0x1126('0x3e')]},'auth':_0x9bad53,'json':!![]};return rp(_0x128c94)[_0x1126('0x18')](function(_0x4f5772){_0x22ab18();})[_0x1126('0x13')](function(){_0x22ab18();});});}function manageTags(_0x315386,_0x5e0ea1,_0x3767e4,_0x5246aa,_0x272274,_0x10ff91,_0x478806){return new Promise(function(_0x3062d6,_0x21d4ef){var _0x375b76=[];_0x5e0ea1['forEach'](function(_0x13394f){_0x375b76['push'](getRemoteTag(_0x13394f,_0x3767e4,_0x5246aa,_0x10ff91,_0x478806));});return Promise['all'](_0x375b76)[_0x1126('0x18')](function(_0x40185f){if(_0x40185f[_0x1126('0x19')]){logger[_0x1126('0x10')]('['+[_0x315386[_0x1126('0x11')]()]+_0x1126('0x43'),_0x40185f);var _0x1a0e26=[];_0x40185f['forEach'](function(_0x191307){_0x1a0e26[_0x1126('0x44')](assignTagToIncident(_0x191307,_0x3767e4,_0x5246aa,_0x272274,_0x10ff91));});return Promise[_0x1126('0x45')](_0x1a0e26)[_0x1126('0x18')](function(){_0x3062d6();})[_0x1126('0x13')](function(){_0x3062d6();});}else{_0x3062d6();}});});}function getTags(_0x3cd788,_0x5a0804,_0x5b17d6,_0x16a343,_0x3921c2,_0x4bf2b3){return function(_0x5ee130){return new Promise(function(_0x5e9260,_0x51a28d){var _0x964a2=[];var _0x37b1ab=_0x16a343[_0x1126('0x46')];if(_0x37b1ab&&_0x37b1ab['length']>0x0){_0x964a2=_[_0x1126('0x47')](_0x37b1ab,_0x1126('0x36'));}if(_0x964a2[_0x1126('0x19')]>0x0){return manageTags(_0x3cd788,_0x964a2,_0x5a0804,_0x5b17d6,_0x5ee130,_0x3921c2,_0x4bf2b3)[_0x1126('0x18')](function(){_0x5e9260(_0x5ee130);});}else{_0x5e9260(_0x5ee130);}});};}function emit(_0x22d403,_0x3f007b,_0x131056){var _0x49a0a3=_0x1126('0x48')+_0x1126('0x49')+_0x1126('0x4a')+_0x1126('0x4b');var _0x288b9b={'uri':_0x22d403+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x131056+_0x49a0a3};io['to'](util['format'](_0x1126('0x4c'),_0x3f007b))[_0x1126('0x4d')]('trigger:browser:url',_0x288b9b);}exports['cs']=function(_0x3bf25d,_0x1fb2f0,_0x366675,_0x6a41c0,_0x2828d4,_0x30d240,_0x41ce78,_0x247f12){var _0xd20fbe={};var _0x3d5e15={'user':_0x30d240[_0x1126('0x4e')],'pass':_0x30d240[_0x1126('0x4f')]};var _0x3dad39='sysparm_limit=1';var _0x111f49=_0x1126('0x50');_0x30d240[_0x1126('0x51')]=intUtil['stripTrailingSlash'](_0x30d240['remoteUri']);_0x30d240[_0x1126('0x52')]=intUtil[_0x1126('0x53')](_0x30d240[_0x1126('0x52')]);var _0x3bfeb8=util['format']('%s/api/now/table/',_0x30d240['remoteUri']);_0xd20fbe[_0x1126('0x54')]=!_[_0x1126('0x55')](_0x6a41c0)?_0x6a41c0[_0x1126('0x56')]:null;_0xd20fbe[_0x1126('0x1f')]=_0x30d240['email'];_0xd20fbe[_0x1126('0x22')]=_0x247f12['toLowerCase']()===_0x1126('0x57')?_0x1fb2f0[_0x1126('0x58')]:_0x1fb2f0[_0x1126('0x59')];_0xd20fbe[_0x1126('0x5a')]=_0x247f12===_0x1126('0x5b')||_0x247f12===_0x1126('0x5c')?_0x1126('0x5b'):'outbound';var _0xfd2d9=util['format'](_0x1126('0x5d'),_0x30d240[_0x1126('0x52')],_0x1fb2f0['uniqueid'],md5(_0x1fb2f0[_0x1126('0x5e')]));if(_0x2828d4&&_0x2828d4[_0x1126('0x5f')]){logger['info'](_0x1126('0x60'),_0x1126('0x61'));_0x1fb2f0['recordingURL']=_0xfd2d9;}else if(_0x41ce78&&_0x41ce78['recordingFormat']&&_0x41ce78[_0x1126('0x62')]!==_0x1126('0x63')){logger[_0x1126('0x10')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1fb2f0['recordingURL']=_0xfd2d9;}else{_0x1fb2f0[_0x1126('0x64')]='';}return getAdminUser(_0x247f12,_0x3d5e15,_0xd20fbe,_0x3bfeb8,_0x111f49,_0x3dad39)['then'](getUser(_0x247f12,_0x3d5e15,_0x3bfeb8,_0x111f49,_0x3dad39))['then'](getEndUser(_0x247f12,_0x3d5e15,_0x3bfeb8,_0x111f49,_0x3dad39))[_0x1126('0x18')](getTicket(_0x247f12,_0x3d5e15,_0x3bfeb8,_0x366675,_0x1fb2f0,_0x111f49))['then'](function(_0x1f320e){logger[_0x1126('0x10')](util['format'](_0x1126('0x65'),_0x1f320e[_0x1126('0x3d')]));logger[_0x1126('0x10')](util[_0x1126('0x66')](_0x1126('0x67'),_0x247f12));if(_0x247f12!=='unmanaged'){logger[_0x1126('0x10')]('['+[_0x247f12[_0x1126('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x30d240[_0x1126('0x51')],_0x6a41c0[_0x1126('0x36')],_0x1f320e[_0x1126('0x3d')]);}})[_0x1126('0x13')](function(_0x2598a7){logger[_0x1126('0x14')]('['+[_0x247f12[_0x1126('0x11')]()]+_0x1126('0x68'),util[_0x1126('0x69')](_0x2598a7,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x326f=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','then','result','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','message','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','length','userId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','type','nameField','customField','idField','toLowerCase','toString','string','content','variable','variableName','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident\x20-\x20','forEach','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','email','destcalleridnum','callDirection','queue','unmanaged'];(function(_0x33fe50,_0x1464c8){var _0x20b544=function(_0x9becc5){while(--_0x9becc5){_0x33fe50['push'](_0x33fe50['shift']());}};_0x20b544(++_0x1464c8);}(_0x326f,0xd1));var _0xf326=function(_0x3334f2,_0x45fa91){_0x3334f2=_0x3334f2-0x0;var _0x2e5151=_0x326f[_0x3334f2];return _0x2e5151;};'use strict';var _=require(_0xf326('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0xf326('0x1'));var md5=require(_0xf326('0x2'));var Redis=require(_0xf326('0x3'));var intUtil=require(_0xf326('0x4'));var config=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));config[_0xf326('0x8')]=_[_0xf326('0x9')](config[_0xf326('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf326('0xa'))(new Redis(config[_0xf326('0x8')]));function getAdminUser(_0x165f95,_0x1e7b8a,_0x515bfa,_0x4c206c,_0x592975,_0x3bacf2){return new Promise(function(_0x1fc80e,_0x163416){var _0x2686e1={'method':_0xf326('0xb'),'uri':_0x4c206c+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x592975+'&'+_0x3bacf2,'auth':_0x1e7b8a,'json':!![]};return rp(_0x2686e1)[_0xf326('0xc')](function(_0x53cbcd){if(_0x53cbcd[_0xf326('0xd')]['length']>0x0){_0x515bfa[_0xf326('0xe')]=_0x53cbcd['result'][0x0][_0xf326('0xf')];}logger[_0xf326('0x10')]('['+[_0x165f95['toUpperCase']()]+_0xf326('0x11'),_0x515bfa);_0x1fc80e(_0x515bfa);})[_0xf326('0x12')](function(_0x3504eb){logger[_0xf326('0x13')]('['+[_0x165f95['toUpperCase']()]+']',_0x3504eb[_0xf326('0x14')]);_0x163416(_0x3504eb['message']);});});}function getUser(_0x54bd1a,_0xdf21d9,_0x11f6d2,_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){logger[_0xf326('0x10')]('['+[_0x54bd1a[_0xf326('0x15')]()]+_0xf326('0x16'),_0x292f4b);return new Promise(function(_0x5a682a,_0x3ad7da){if(intUtil[_0xf326('0x17')](_0x292f4b[_0xf326('0x18')])){var _0x31ffb9={'method':_0xf326('0xb'),'uri':_0x11f6d2+_0xf326('0x19')+_0x292f4b['userEmail']+'&'+_0x1f2e5a+'&'+_0xa63d1a,'auth':_0xdf21d9,'json':!![]};logger['info']('['+[_0x54bd1a['toUpperCase']()]+_0xf326('0x1a'),_0x31ffb9);return rp(_0x31ffb9)[_0xf326('0xc')](function(_0x484cbe){logger['info']('['+[_0x54bd1a[_0xf326('0x15')]()]+'],\x20getUser\x20entity',_0x484cbe);if(_0x484cbe['result'][_0xf326('0x1b')]>0x0&&String(_0x484cbe[_0xf326('0xd')][0x0]['active'])==='true'){_0x292f4b[_0xf326('0x1c')]=_0x484cbe[_0xf326('0xd')][0x0]['sys_id'];}else{_0x292f4b[_0xf326('0x1c')]=_0x292f4b[_0xf326('0xe')];_0x292f4b[_0xf326('0x18')]=_0x292f4b[_0xf326('0x1d')];}logger[_0xf326('0x10')]('['+[_0x54bd1a[_0xf326('0x15')]()]+'],\x20getUser\x20crm',_0x292f4b);_0x5a682a(_0x292f4b);})['catch'](function(_0x4f31f6){logger[_0xf326('0x13')]('['+[_0x54bd1a[_0xf326('0x15')]()]+']',_0x4f31f6[_0xf326('0x14')]);_0x3ad7da(_0x4f31f6[_0xf326('0x14')]);});}else{logger[_0xf326('0x10')]('['+[_0x54bd1a[_0xf326('0x15')]()]+']\x20using\x20admin\x20profile');_0x292f4b[_0xf326('0x1c')]=_0x292f4b[_0xf326('0xe')];_0x292f4b[_0xf326('0x18')]=_0x292f4b['adminEmail'];_0x5a682a(_0x292f4b);}});};}function createEndUser(_0x1617d2,_0x55ad0f,_0x4a9abf,_0x6a8e89,_0x1ae23a){logger[_0xf326('0x10')]('['+[_0x1617d2['toUpperCase']()]+_0xf326('0x1e'),_0x4a9abf);return new Promise(function(_0x292500,_0x55790d){var _0x225776={'method':_0xf326('0x1f'),'uri':_0x6a8e89+_0xf326('0x20')+_0x1ae23a,'body':{'user_name':_0x4a9abf[_0xf326('0x21')],'roles':_0xf326('0x22'),'first_name':_0x4a9abf[_0xf326('0x21')],'active':_0xf326('0x23'),'date_format':_0xf326('0x24'),'phone':_0x4a9abf[_0xf326('0x21')]},'auth':_0x55ad0f,'json':!![]};return rp(_0x225776)[_0xf326('0xc')](function(_0x4b52f2){logger[_0xf326('0x10')]('['+[_0x1617d2[_0xf326('0x15')]()]+_0xf326('0x25'),_0x4b52f2['result']);_0x4a9abf[_0xf326('0x26')]=_0x4b52f2[_0xf326('0xd')][_0xf326('0xf')];_0x292500(_0x4a9abf);})['catch'](function(_0x5b101d){logger[_0xf326('0x13')]('['+[_0x1617d2[_0xf326('0x15')]()]+']',_0x5b101d[_0xf326('0x14')]);_0x55790d(_0x5b101d[_0xf326('0x14')]);});});}function getEndUser(_0x30694f,_0x2e8a64,_0x62585a,_0x2d5f20,_0x580374){return function(_0x461e93){logger[_0xf326('0x10')]('['+[_0x30694f['toUpperCase']()]+_0xf326('0x27'),_0x461e93);return new Promise(function(_0x4e5d7c,_0xce1cbb){var _0x481b64={'method':'GET','uri':_0x62585a+_0xf326('0x28')+_0x461e93['endUserNumber']+'&'+_0x2d5f20+'&'+_0x580374,'auth':_0x2e8a64,'json':!![]};return rp(_0x481b64)[_0xf326('0xc')](function(_0x57aa27){if(_0x57aa27[_0xf326('0xd')][_0xf326('0x1b')]>0x0){_0x461e93[_0xf326('0x26')]=_0x57aa27['result'][0x0][_0xf326('0xf')];logger[_0xf326('0x10')]('['+[_0x30694f['toUpperCase']()]+_0xf326('0x29'),_0x461e93);_0x4e5d7c(_0x461e93);}else{return createEndUser(_0x30694f,_0x2e8a64,_0x461e93,_0x62585a,_0x2d5f20)[_0xf326('0xc')](function(_0x40fa7a){logger[_0xf326('0x10')]('['+[_0x30694f['toUpperCase']()]+_0xf326('0x2a'),_0x40fa7a);_0x4e5d7c(_0x40fa7a);});}})[_0xf326('0x12')](function(_0x1e69b1){logger[_0xf326('0x13')]('['+[_0x30694f[_0xf326('0x15')]()]+']',_0x1e69b1['message']);_0xce1cbb(_0x1e69b1[_0xf326('0x14')]);});});};}function getCustomFields(_0x1b7bf6,_0x5cfb97){var _0x4dd361={};if(_0x1b7bf6[_0xf326('0x1b')]>0x0){_['forEach'](_0x1b7bf6,function(_0x55dfa8){if(_0x55dfa8[_0xf326('0x2b')]==='string'&&_0x55dfa8[_0xf326('0x2c')]&&!_0x55dfa8[_0xf326('0x2d')]){_0x4dd361[_0x55dfa8[_0xf326('0x2e')][_0xf326('0x2f')]()]=_0x55dfa8['content'][_0xf326('0x30')]();}else if(_0x55dfa8[_0xf326('0x2b')]===_0xf326('0x31')&&_0x55dfa8[_0xf326('0x2e')]&&_0x55dfa8[_0xf326('0x2d')]){_0x4dd361[_0x55dfa8[_0xf326('0x2e')][_0xf326('0x2f')]()]=_0x55dfa8[_0xf326('0x32')][_0xf326('0x30')]();}else if(_0x55dfa8[_0xf326('0x2b')]===_0xf326('0x33')&&_0x55dfa8[_0xf326('0x34')]&&_0x55dfa8['idField']&&_0x55dfa8[_0xf326('0x2d')]){_0x4dd361[_0x55dfa8[_0xf326('0x2e')][_0xf326('0x2f')]()]=_0x5cfb97[_0x55dfa8[_0xf326('0x34')]][_0xf326('0x30')]();}else if(_0x55dfa8[_0xf326('0x2b')]==='customVariable'&&_0x55dfa8[_0xf326('0x35')]&&_0x55dfa8[_0xf326('0x35')]['name']&&_0x55dfa8[_0xf326('0x2e')]&&_0x55dfa8[_0xf326('0x2d')]){_0x4dd361[_0x55dfa8[_0xf326('0x2e')][_0xf326('0x2f')]()]=_0x5cfb97[_0x55dfa8[_0xf326('0x35')]['name']['toLowerCase']()][_0xf326('0x30')]();}});}return _0x4dd361;}function getTicket(_0x44e101,_0x5ed62e,_0x4bd865,_0x8e318d,_0x269e89,_0x21c98e){return function(_0x5b3705){logger[_0xf326('0x10')]('['+[_0x44e101[_0xf326('0x15')]()]+_0xf326('0x36'),_0x5b3705);return new Promise(function(_0xc43507,_0xc99be){var _0x2d9bba=_0x44e101[_0xf326('0x2f')]()===_0xf326('0x37')?_0x5b3705[_0xf326('0x1c')]:_0x5b3705[_0xf326('0x26')];var _0x1c76c8={'method':_0xf326('0x1f'),'uri':_0x4bd865+_0xf326('0x38')+'?'+_0x21c98e,'body':Object[_0xf326('0x39')]({},{'active':_0xf326('0x23'),'caller_id':_0x2d9bba,'assigned_to':_0x5b3705['userId'],'short_description':intUtil[_0xf326('0x3a')](_0x8e318d[_0xf326('0x3b')],_0x269e89,'\x20'),'description':intUtil[_0xf326('0x3a')](_0x8e318d[_0xf326('0x3c')],_0x269e89,'\x0a')},getCustomFields(_0x8e318d['Fields'],_0x269e89)),'auth':_0x5ed62e,'json':!![]};return rp(_0x1c76c8)[_0xf326('0xc')](function(_0x2f5511){logger[_0xf326('0x10')]('['+[_0x44e101[_0xf326('0x15')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x2f5511[_0xf326('0xd')]);_0x5b3705[_0xf326('0x3d')]=_0x2f5511[_0xf326('0xd')][_0xf326('0xf')];_0x5b3705[_0xf326('0x3e')]=_0x2f5511['result']['number'];logger[_0xf326('0x10')]('['+[_0x44e101[_0xf326('0x15')]()]+_0xf326('0x3f'),_0x5b3705);_0xc43507(_0x5b3705);})['catch'](function(_0x102fba){logger[_0xf326('0x13')]('['+[_0x44e101[_0xf326('0x15')]()]+']',_0x102fba['message']);_0xc99be(_0x102fba['message']);});});};}function createRemoteTag(_0x36ef89,_0x5b4832,_0x1cf58f,_0x554277){return new Promise(function(_0x458e5f,_0x7ee57){var _0x28c959={'method':_0xf326('0x1f'),'uri':_0x1cf58f+_0xf326('0x40')+'?'+_0x554277,'body':{'short_description':_0x36ef89,'global':!![],'active':!![],'name':_0x36ef89},'auth':_0x5b4832,'json':!![]};return rp(_0x28c959)[_0xf326('0xc')](function(_0x7f7ece){var _0x495a16=_0x7f7ece[_0xf326('0xd')][_0xf326('0xf')];_0x458e5f(_0x495a16);});});}function getRemoteTag(_0x424d24,_0x4b0d8e,_0x208ba4,_0x3a832f,_0x3b8635){return new Promise(function(_0x16c578,_0x1159e){var _0x58fcf0={'method':_0xf326('0xb'),'uri':_0x208ba4+_0xf326('0x40')+_0xf326('0x41')+_0x424d24+'&'+_0x3a832f,'auth':_0x4b0d8e,'json':!![]};return rp(_0x58fcf0)[_0xf326('0xc')](function(_0x50690e){if(_0x50690e[_0xf326('0xd')][_0xf326('0x1b')]>0x0){var _0x227850=_0x50690e[_0xf326('0xd')][0x0]['sys_id'];_0x16c578(_0x227850);}else{return createRemoteTag(_0x424d24,_0x4b0d8e,_0x208ba4,_0x3a832f)['then'](function(_0x18b46e){_0x16c578(_0x18b46e);});}});});}function assignTagToIncident(_0x44d2ed,_0x55ca96,_0x3cf6fa,_0x29de71,_0x316609){return new Promise(function(_0x1258d1,_0x5765b0){var _0xb1c18c={'method':'POST','uri':_0x3cf6fa+'label_entry'+'?'+_0x316609,'body':{'label':_0x44d2ed,'table':_0xf326('0x38'),'id_type':'Incident','table_key':_0x29de71[_0xf326('0x3d')],'title':_0xf326('0x42')+_0x29de71[_0xf326('0x3e')],'id_display':_0x29de71['ticketNumber']},'auth':_0x55ca96,'json':!![]};return rp(_0xb1c18c)['then'](function(_0x1fd9c9){_0x1258d1();})[_0xf326('0x12')](function(){_0x1258d1();});});}function manageTags(_0x33b259,_0x5d0177,_0x2759d7,_0x487020,_0xe4a00d,_0x40929c,_0x131184){return new Promise(function(_0x217897,_0xbd3a01){var _0x18dbfc=[];_0x5d0177[_0xf326('0x43')](function(_0x3aeb20){_0x18dbfc[_0xf326('0x44')](getRemoteTag(_0x3aeb20,_0x2759d7,_0x487020,_0x40929c,_0x131184));});return Promise[_0xf326('0x45')](_0x18dbfc)[_0xf326('0xc')](function(_0x1e56fb){if(_0x1e56fb[_0xf326('0x1b')]){logger['info']('['+[_0x33b259[_0xf326('0x15')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1e56fb);var _0x6ac6=[];_0x1e56fb[_0xf326('0x43')](function(_0x5e858d){_0x6ac6[_0xf326('0x44')](assignTagToIncident(_0x5e858d,_0x2759d7,_0x487020,_0xe4a00d,_0x40929c));});return Promise['all'](_0x6ac6)[_0xf326('0xc')](function(){_0x217897();})[_0xf326('0x12')](function(){_0x217897();});}else{_0x217897();}});});}function getTags(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x51ff5e,_0x4ec099,_0x1209ca){return function(_0x32fe3a){return new Promise(function(_0x15a538,_0x21b3cc){var _0x1fc586=[];var _0x579d2c=_0x51ff5e[_0xf326('0x46')];if(_0x579d2c&&_0x579d2c[_0xf326('0x1b')]>0x0){_0x1fc586=_['map'](_0x579d2c,'name');}if(_0x1fc586['length']>0x0){return manageTags(_0x28f3cb,_0x1fc586,_0x2d45c9,_0x31b6dd,_0x32fe3a,_0x4ec099,_0x1209ca)[_0xf326('0xc')](function(){_0x15a538(_0x32fe3a);});}else{_0x15a538(_0x32fe3a);}});};}function emit(_0x7edf5,_0x4150fa,_0x235525){var _0x240ce5=_0xf326('0x47')+_0xf326('0x48')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xf326('0x49');var _0x588d26={'uri':_0x7edf5+_0xf326('0x4a')+_0x235525+_0x240ce5};io['to'](util[_0xf326('0x4b')]('user:%s',_0x4150fa))[_0xf326('0x4c')]('trigger:browser:url',_0x588d26);}exports['cs']=function(_0x499b59,_0x2dd9e4,_0x540fa0,_0x78ba34,_0x3411a4,_0x461059,_0x2ea5a2,_0x17cd36){var _0x541491={};var _0x4a053c={'user':_0x461059['username'],'pass':_0x461059[_0xf326('0x4d')]};var _0x307441=_0xf326('0x4e');var _0x180616=_0xf326('0x4f');_0x461059['remoteUri']=intUtil[_0xf326('0x50')](_0x461059[_0xf326('0x51')]);_0x461059[_0xf326('0x52')]=intUtil['stripTrailingSlash'](_0x461059['serverUrl']);var _0x830c9f=util[_0xf326('0x4b')]('%s/api/now/table/',_0x461059['remoteUri']);_0x541491[_0xf326('0x18')]=!_['isNil'](_0x78ba34)?_0x78ba34[_0xf326('0x53')]:null;_0x541491['adminEmail']=_0x461059['email'];_0x541491['endUserNumber']=_0x17cd36[_0xf326('0x2f')]()===_0xf326('0x37')?_0x2dd9e4[_0xf326('0x54')]:_0x2dd9e4['calleridnum'];_0x541491[_0xf326('0x55')]=_0x17cd36===_0xf326('0x56')||_0x17cd36===_0xf326('0x57')?_0xf326('0x56'):_0xf326('0x37');var _0x39e73d=util[_0xf326('0x4b')](_0xf326('0x58'),_0x461059[_0xf326('0x52')],_0x2dd9e4['uniqueid'],md5(_0x2dd9e4[_0xf326('0x59')]));if(_0x3411a4&&_0x3411a4['monitor_format']){logger[_0xf326('0x10')](_0xf326('0x5a'),_0xf326('0x5b'));_0x2dd9e4['recordingURL']=_0x39e73d;}else if(_0x2ea5a2&&_0x2ea5a2[_0xf326('0x5c')]&&_0x2ea5a2[_0xf326('0x5c')]!==_0xf326('0x5d')){logger['info'](_0xf326('0x5e'),_0xf326('0x5b'));_0x2dd9e4[_0xf326('0x5f')]=_0x39e73d;}else{_0x2dd9e4[_0xf326('0x5f')]='';}return getAdminUser(_0x17cd36,_0x4a053c,_0x541491,_0x830c9f,_0x180616,_0x307441)['then'](getUser(_0x17cd36,_0x4a053c,_0x830c9f,_0x180616,_0x307441))[_0xf326('0xc')](getEndUser(_0x17cd36,_0x4a053c,_0x830c9f,_0x180616,_0x307441))['then'](getTicket(_0x17cd36,_0x4a053c,_0x830c9f,_0x540fa0,_0x2dd9e4,_0x180616))['then'](function(_0x32d9c5){logger[_0xf326('0x10')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x32d9c5['ticketId']));logger[_0xf326('0x10')](util['format'](_0xf326('0x60'),_0x17cd36));if(_0x17cd36!==_0xf326('0x57')){logger[_0xf326('0x10')]('['+[_0x17cd36[_0xf326('0x15')]()]+']',_0xf326('0x61'));emit(_0x461059[_0xf326('0x51')],_0x78ba34['name'],_0x32d9c5[_0xf326('0x3d')]);}})[_0xf326('0x12')](function(_0x5f1724){logger['error']('['+[_0x17cd36[_0xf326('0x15')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xf326('0x62')](_0x5f1724,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js
index e7743c8..373b76a 100644
--- a/server/services/ami/trigger/integration/sugarcrm.js
+++ b/server/services/ami/trigger/integration/sugarcrm.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa817=['users','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','merge','map','type','string','nameField','customField','content','custom_fields','variable','customVariable','Variable','toLowerCase','login','username','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','uniqueid','recordingURL','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','Fields','Outbound','Ticket\x20created!','charAt','catch','unmanaged','lastevent','calleridname'];(function(_0x4aadbc,_0x4afc4d){var _0x372f33=function(_0xc50454){while(--_0xc50454){_0x4aadbc['push'](_0x4aadbc['shift']());}};_0x372f33(++_0x4afc4d);}(_0xa817,0x7b));var _0x7a81=function(_0x2748f9,_0x42a1bf){_0x2748f9=_0x2748f9-0x0;var _0x423e3a=_0xa817[_0x2748f9];return _0x423e3a;};'use strict';var _=require(_0x7a81('0x0'));var rp=require(_0x7a81('0x1'));var BPromise=require(_0x7a81('0x2'));var md5=require(_0x7a81('0x3'));var util=require(_0x7a81('0x4'));var Redis=require(_0x7a81('0x5'));var intUtil=require(_0x7a81('0x6'));var config=require(_0x7a81('0x7'));var logger=require(_0x7a81('0x8'))('sugarcrm');config[_0x7a81('0x9')]=_[_0x7a81('0xa')](config['redis'],{'host':_0x7a81('0xb'),'port':0x18eb});var io=require(_0x7a81('0xc'))(new Redis(config[_0x7a81('0x9')]));var def={'method':_0x7a81('0xd'),'json':!![]};function emit(_0x1869fb,_0x18f6f6,_0x59d701){io['to'](_0x1869fb)[_0x7a81('0xe')](_0x18f6f6,_0x59d701);}function getTicket(_0x5b3b66,_0x5ae346,_0x2b8dc7,_0x493b02,_0x41d90b,_0x37fee1,_0xcf4b61,_0x2116c5){logger[_0x7a81('0xf')](_0x7a81('0x10'));var _0x2bea43=new Date();var _0x4c632e=[{'name':_0x7a81('0x11'),'value':intUtil[_0x7a81('0x12')](_0x493b02[_0x7a81('0x13')],_0x41d90b,'\x20')},{'name':'assigned_user_id','value':_0x5ae346['id']},{'name':_0x7a81('0x14'),'value':_0x5ae346['id']},{'name':_0x7a81('0x15'),'value':intUtil[_0x7a81('0x12')](_0x493b02[_0x7a81('0x16')],_0x41d90b,'\x0a')},{'name':_0x7a81('0x17'),'value':_0x2bea43[_0x7a81('0x18')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x7a81('0x19'),'value':'0'},{'name':_0x7a81('0x1a'),'value':'15'},{'name':'parent_id','value':_0x2b8dc7['id']},{'name':_0x7a81('0x1b'),'value':_0x7a81('0x1c')},{'name':_0x7a81('0x1d'),'value':_0x2b8dc7[_0x7a81('0x11')]},{'name':_0x7a81('0x1e'),'value':_0x2116c5}];if(_0x37fee1[_0x7a81('0x1f')]){_[_0x7a81('0x20')](_0x37fee1,function(_0x3d9a4f){if(_0x41d90b[_0x3d9a4f[_0x7a81('0x21')]]){_0x4c632e[_0x7a81('0x22')]({'name':_0x3d9a4f[_0x7a81('0x23')],'value':_0x41d90b[_0x3d9a4f[_0x7a81('0x21')]]});}});}return request({'form':{'method':_0x7a81('0x24'),'input_type':'JSON','response_type':_0x7a81('0x25'),'rest_data':JSON[_0x7a81('0x26')]({'session':_0xcf4b61['id'],'module_name':_0x7a81('0x27'),'name_value_list':_0x4c632e})}});}function getAuth(_0x3087c0){return util[_0x7a81('0x28')](_0x7a81('0x29'),new Buffer(_0x3087c0[_0x7a81('0x2a')]+':X')[_0x7a81('0x2b')](_0x7a81('0x2c')));}function getServerInfo(_0x596a8c){return request({'form':{'method':_0x7a81('0x2d'),'input_type':_0x7a81('0x25'),'response_type':_0x7a81('0x25'),'rest_data':JSON[_0x7a81('0x26')]({'session':_0x596a8c['id']})}});}function getUser(_0x26556b,_0x15a1cd,_0x249ae1){if(!_[_0x7a81('0x2e')](_0x15a1cd)){logger['info'](_0x7a81('0x2f'),_0x15a1cd);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x7a81('0x25'),'rest_data':JSON[_0x7a81('0x26')]({'session':_0x249ae1['id'],'module_name':_0x7a81('0x30'),'query':util['format'](_0x7a81('0x31'),_0x15a1cd),'order_by':'','offset':'0','select_fields':['id',_0x7a81('0x11'),_0x7a81('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7a81('0x33')](function(_0x16ea00){if(_0x16ea00['entry_list'][_0x7a81('0x1f')]){var _0x33ac1f=_[_0x7a81('0x34')](_0x16ea00[_0x7a81('0x35')],function(_0x29655a){return _0x29655a[_0x7a81('0x36')][_0x7a81('0x32')]['value']===_0x15a1cd;});if(_0x33ac1f){logger[_0x7a81('0xf')]('Agent\x20found!');return BPromise[_0x7a81('0x37')]({'id':_0x33ac1f[_0x7a81('0x36')]['id'][_0x7a81('0x38')],'name':_0x33ac1f['name_value_list'][_0x7a81('0x11')]['value']});}}logger['info'](_0x7a81('0x39'));return BPromise[_0x7a81('0x37')]({'id':_0x249ae1[_0x7a81('0x36')][_0x7a81('0x3a')][_0x7a81('0x38')],'name':_0x249ae1['name_value_list'][_0x7a81('0x32')][_0x7a81('0x38')]});});}else{logger[_0x7a81('0xf')](_0x7a81('0x3b'));return BPromise[_0x7a81('0x37')]({'id':_0x249ae1[_0x7a81('0x36')][_0x7a81('0x3a')]['value'],'name':_0x249ae1[_0x7a81('0x36')][_0x7a81('0x32')][_0x7a81('0x38')]});}}function getEndUser(_0x5d7658,_0x3161fe,_0x414d1d,_0x3f91b0){logger[_0x7a81('0xf')]('Searching\x20enduser\x20with\x20phone',_0x414d1d);return request({'form':{'method':_0x7a81('0x3c'),'input_type':_0x7a81('0x25'),'response_type':_0x7a81('0x25'),'rest_data':JSON[_0x7a81('0x26')]({'session':_0x3f91b0['id'],'module_name':_0x7a81('0x1c'),'query':util['format'](_0x7a81('0x3d'),_0x414d1d),'order_by':'','offset':'0','select_fields':['id',_0x7a81('0x11'),_0x7a81('0x3e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7a81('0x33')](function(_0x23a747){if(_0x23a747[_0x7a81('0x35')][_0x7a81('0x1f')]){var _0x595b6a=_['find'](_0x23a747[_0x7a81('0x35')],function(_0x1b1ebd){return _0x1b1ebd['name_value_list'][_0x7a81('0x3e')][_0x7a81('0x38')]===_0x414d1d;});if(_0x595b6a){logger[_0x7a81('0xf')]('Enduser\x20found!');return BPromise[_0x7a81('0x37')]({'id':_0x595b6a[_0x7a81('0x36')]['id']['value'],'name':_0x595b6a[_0x7a81('0x36')][_0x7a81('0x11')][_0x7a81('0x38')],'phone':_0x595b6a['name_value_list'][_0x7a81('0x3e')][_0x7a81('0x38')]});}}else{logger['info'](_0x7a81('0x3f'));return request({'form':{'method':_0x7a81('0x24'),'input_type':_0x7a81('0x25'),'response_type':_0x7a81('0x25'),'rest_data':JSON[_0x7a81('0x26')]({'session':_0x3f91b0['id'],'module_name':_0x7a81('0x1c'),'name_value_list':[{'name':_0x7a81('0x40'),'value':_0x3161fe!==''?_0x3161fe:util['format'](_0x7a81('0x41'),_0x414d1d)},{'name':_0x7a81('0x3e'),'value':_0x414d1d}]})}})[_0x7a81('0x33')](function(_0x5092fc){logger[_0x7a81('0xf')](_0x7a81('0x42'));return BPromise[_0x7a81('0x37')]({'id':_0x5092fc['id'],'name':_0x5092fc[_0x7a81('0x35')][_0x7a81('0x40')]['value'],'phone':_0x5092fc[_0x7a81('0x35')][_0x7a81('0x3e')]['value']});});}});}function request(_0x611df){logger['debug']('[HTTP]',JSON[_0x7a81('0x26')](_0x611df));return rp(_[_0x7a81('0x43')](def,_0x611df));}function getTags(_0x36f97e,_0x3c186e){var _0x472f6b=[];if(_0x36f97e&&_0x36f97e[_0x7a81('0x1f')]>0x0){_0x472f6b=_[_0x7a81('0x44')](_0x36f97e,_0x3c186e);}return _0x472f6b;}function getCustomFields(_0x3ec075,_0x3ec3a7){var _0x1146e3=[];var _0x3cf0b6={'custom_fields':[]};if(_0x3ec075[_0x7a81('0x1f')]>0x0){_[_0x7a81('0x20')](_0x3ec075,function(_0x4878bd){if(_0x4878bd[_0x7a81('0x45')]===_0x7a81('0x46')&&_0x4878bd[_0x7a81('0x47')]&&!_0x4878bd[_0x7a81('0x48')]){_0x3cf0b6[_0x4878bd[_0x7a81('0x47')]['toLowerCase']()]=_0x4878bd[_0x7a81('0x49')][_0x7a81('0x2b')]();}else if(_0x4878bd[_0x7a81('0x45')]==='string'&&_0x4878bd[_0x7a81('0x23')]&&_0x4878bd[_0x7a81('0x48')]){_0x3cf0b6[_0x7a81('0x4a')][_0x7a81('0x22')]({'id':_0x4878bd[_0x7a81('0x23')],'value':_0x4878bd[_0x7a81('0x49')][_0x7a81('0x2b')]()});}else if(_0x4878bd['type']===_0x7a81('0x4b')&&_0x4878bd[_0x7a81('0x21')]&&_0x4878bd[_0x7a81('0x23')]&&_0x4878bd[_0x7a81('0x48')]){_0x3ec3a7[_0x4878bd[_0x7a81('0x21')]]&&_0x3cf0b6[_0x7a81('0x4a')]['push']({'id':_0x4878bd['idField'],'value':_0x3ec3a7[_0x4878bd[_0x7a81('0x21')]][_0x7a81('0x2b')]()});}else if(_0x4878bd[_0x7a81('0x45')]===_0x7a81('0x4c')&&_0x4878bd['Variable']&&_0x4878bd[_0x7a81('0x4d')][_0x7a81('0x11')]&&_0x4878bd[_0x7a81('0x23')]&&_0x4878bd[_0x7a81('0x48')]){_0x3ec3a7[_0x4878bd[_0x7a81('0x4d')]['name']['toLowerCase']()]&&_0x3cf0b6[_0x7a81('0x4a')][_0x7a81('0x22')]({'id':_0x4878bd[_0x7a81('0x23')],'value':_0x3ec3a7[_0x4878bd['Variable'][_0x7a81('0x11')][_0x7a81('0x4e')]()][_0x7a81('0x2b')]()});}});}return _0x3cf0b6;}function getConnection(_0x1d4f8d){return request({'method':'POST','form':{'method':_0x7a81('0x4f'),'input_type':_0x7a81('0x25'),'response_type':'JSON','rest_data':JSON[_0x7a81('0x26')]({'user_auth':{'user_name':_0x1d4f8d[_0x7a81('0x50')],'password':_0x1d4f8d['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x7a81('0x33')](function(_0x4ed2c4){var _0x4aa184=_0x4ed2c4;if(_0x4aa184['id']){def[_0x7a81('0x51')]=_0x4aa184['id'];return BPromise[_0x7a81('0x37')](_0x4aa184);}else{throw new Error(util[_0x7a81('0x28')](_0x7a81('0x52'),_0x1d4f8d['id']));}});}function setRelationship(_0x3f4e75,_0x5ef130,_0x49eaa1,_0x46d597){return request({'form':{'method':_0x7a81('0x53'),'input_type':'JSON','response_type':_0x7a81('0x25'),'rest_data':JSON['stringify']({'session':_0x3f4e75['id'],'module_name':_0x7a81('0x27'),'module_id':_0x49eaa1['id'],'link_field_name':_0x46d597,'related_ids':[_0x5ef130['id']]})}});}exports[_0x7a81('0x54')]=function(_0xd2b77e,_0x55356f,_0x2eca87,_0x87c409,_0x2e5e34,_0x17defa){var _0x329285,_0x4f53a3,_0x743a0b,_0x1080ac;_0x17defa['remoteUri']=intUtil[_0x7a81('0x55')](_0x17defa[_0x7a81('0x56')]);_0x17defa[_0x7a81('0x57')]=intUtil[_0x7a81('0x55')](_0x17defa[_0x7a81('0x57')]);def[_0x7a81('0x58')]=util[_0x7a81('0x28')](_0x7a81('0x59'),_0x17defa['remoteUri']);if(_0x2e5e34&&_0x2e5e34[_0x7a81('0x5a')]){logger[_0x7a81('0xf')](_0x7a81('0x5b'),'Recording\x20is\x20enabled!');_0x55356f['recordingURL']=util[_0x7a81('0x28')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17defa[_0x7a81('0x57')],_0x55356f['uniqueid'],md5(_0x55356f[_0x7a81('0x5c')]));}else{_0x55356f[_0x7a81('0x5d')]='';}return getConnection(_0x17defa)['then'](function(_0x41e913){_0x1080ac=_0x41e913;return getUser(_0x17defa,_0x87c409['name'],_0x1080ac);})[_0x7a81('0x33')](function(_0x2a5acd){_0x329285=_0x2a5acd;logger['info']('The\x20User\x20ID\x20is:',_0x329285['id']);return getEndUser(_0x17defa,_0x55356f['calleridname'],_0x55356f['calleridnum'],_0x1080ac);})['then'](function(_0x13dd50){_0x4f53a3=_0x13dd50;logger[_0x7a81('0xf')](_0x7a81('0x5e'),_0x4f53a3['id']);return getTicket(_0x17defa,_0x329285,_0x4f53a3,_0x2eca87,_0x55356f,_0x2eca87['Fields'],_0x1080ac,_0x7a81('0x5f'));})[_0x7a81('0x33')](function(_0x597e13){_0x743a0b=_0x597e13;logger[_0x7a81('0xf')]('Ticket\x20created!');logger['info'](_0x7a81('0x60'),_0x743a0b['id']);return setRelationship(_0x1080ac,_0x329285,_0x743a0b,'users');})[_0x7a81('0x33')](function(){return setRelationship(_0x1080ac,_0x4f53a3,_0x743a0b,_0x7a81('0x61'));})[_0x7a81('0x33')](function(){return getServerInfo(_0x1080ac);})[_0x7a81('0x33')](function(_0x32a918){var _0x5b9f4a=parseInt(_0x32a918[_0x7a81('0x62')]['charAt'](0x0));var _0x416851=util[_0x7a81('0x28')](_0x7a81('0x63'),_0x17defa[_0x7a81('0x56')],_0x743a0b['id']);if(_0x5b9f4a>0x6){_0x416851=util[_0x7a81('0x28')](_0x7a81('0x64'),_0x17defa[_0x7a81('0x56')],_0x743a0b['id']);}logger[_0x7a81('0xf')](_0x7a81('0x5b'),_0x7a81('0x65'));emit(util['format'](_0x7a81('0x66'),_0x87c409[_0x7a81('0x11')]),_0x7a81('0x67'),{'uri':_0x416851});})['catch'](function(_0x4470c6){logger[_0x7a81('0x68')](_0x7a81('0x5b'),JSON[_0x7a81('0x26')](_0x4470c6));});};exports['outbound']=function(_0x441738,_0x24c5c0,_0x3a6b0f,_0x3115e2,_0x4ce0cb,_0x4dc124,_0x56fea2){var _0x228f7e,_0xcce3b0,_0x26d00b,_0x6b5f4e;_0x4dc124[_0x7a81('0x56')]=intUtil['stripTrailingSlash'](_0x4dc124[_0x7a81('0x56')]);_0x4dc124[_0x7a81('0x57')]=intUtil['stripTrailingSlash'](_0x4dc124['serverUrl']);def[_0x7a81('0x58')]=util[_0x7a81('0x28')](_0x7a81('0x59'),_0x4dc124[_0x7a81('0x56')]);if(_0x56fea2&&_0x56fea2[_0x7a81('0x69')]&&_0x56fea2[_0x7a81('0x69')]!==_0x7a81('0x6a')){logger['info'](_0x7a81('0x6b'),_0x7a81('0x6c'));_0x24c5c0[_0x7a81('0x5d')]=util[_0x7a81('0x28')](_0x7a81('0x6d'),_0x4dc124[_0x7a81('0x57')],_0x24c5c0['uniqueid'],md5(_0x24c5c0[_0x7a81('0x5c')]));}return getConnection(_0x4dc124)['then'](function(_0x415554){_0x6b5f4e=_0x415554;return getUser(_0x4dc124,_0x3115e2[_0x7a81('0x11')],_0x6b5f4e);})[_0x7a81('0x33')](function(_0x3db2b1){_0x228f7e=_0x3db2b1;logger[_0x7a81('0xf')](_0x7a81('0x6e'),_0x228f7e['id']);return getEndUser(_0x4dc124,_0x24c5c0['destcalleridname'],_0x24c5c0['destcalleridnum'],_0x6b5f4e);})[_0x7a81('0x33')](function(_0x4c9bc6){_0xcce3b0=_0x4c9bc6;logger[_0x7a81('0xf')](_0x7a81('0x5e'),_0xcce3b0['id']);return getTicket(_0x4dc124,_0x228f7e,_0xcce3b0,_0x3a6b0f,_0x24c5c0,_0x3a6b0f[_0x7a81('0x6f')],_0x6b5f4e,_0x7a81('0x70'));})[_0x7a81('0x33')](function(_0x20a5c8){_0x26d00b=_0x20a5c8;logger[_0x7a81('0xf')](_0x7a81('0x71'));logger[_0x7a81('0xf')](_0x7a81('0x60'),_0x26d00b['id']);return setRelationship(_0x6b5f4e,_0x228f7e,_0x26d00b,'users');})['then'](function(){return setRelationship(_0x6b5f4e,_0xcce3b0,_0x26d00b,'contacts');})[_0x7a81('0x33')](function(){return getServerInfo(_0x6b5f4e);})[_0x7a81('0x33')](function(_0x2417b4){var _0x347b71=parseInt(_0x2417b4['version'][_0x7a81('0x72')](0x0));var _0x21963a=util[_0x7a81('0x28')](_0x7a81('0x63'),_0x4dc124[_0x7a81('0x56')],_0x26d00b['id']);if(_0x347b71>0x6){_0x21963a=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4dc124[_0x7a81('0x56')],_0x26d00b['id']);}logger[_0x7a81('0xf')](_0x7a81('0x6b'),_0x7a81('0x65'));emit(util[_0x7a81('0x28')](_0x7a81('0x66'),_0x3115e2[_0x7a81('0x11')]),'trigger:browser:url',{'uri':_0x21963a});})[_0x7a81('0x73')](function(_0x5e25a4){logger[_0x7a81('0x68')](_0x7a81('0x6b'),JSON[_0x7a81('0x26')](_0x5e25a4));});};exports[_0x7a81('0x74')]=function(_0x250990,_0x509972,_0x33a9ea,_0x16c859,_0x10156e,_0x5522a7){var _0x4ae56c,_0x374911,_0x1f651c,_0x504e1c;_0x5522a7[_0x7a81('0x56')]=intUtil[_0x7a81('0x55')](_0x5522a7[_0x7a81('0x56')]);_0x5522a7['serverUrl']=intUtil[_0x7a81('0x55')](_0x5522a7[_0x7a81('0x57')]);def[_0x7a81('0x58')]=util[_0x7a81('0x28')](_0x7a81('0x59'),_0x5522a7[_0x7a81('0x56')]);if(_0x10156e&&_0x10156e[_0x7a81('0x5a')]){logger[_0x7a81('0xf')]('['+_0x509972[_0x7a81('0x75')]['toUpperCase']()+']',_0x7a81('0x6c'));_0x509972[_0x7a81('0x5d')]=util[_0x7a81('0x28')](_0x7a81('0x6d'),_0x5522a7[_0x7a81('0x57')],_0x509972[_0x7a81('0x5c')],md5(_0x509972[_0x7a81('0x5c')]));}else{_0x509972[_0x7a81('0x5d')]='';}return getConnection(_0x5522a7)[_0x7a81('0x33')](function(_0x55d2bc){_0x504e1c=_0x55d2bc;if(!_[_0x7a81('0x2e')](_0x16c859)){return getUser(_0x5522a7,_0x16c859[_0x7a81('0x11')],_0x504e1c);}else{return getUser(_0x5522a7,null,_0x504e1c);}})['then'](function(_0x54cfd1){_0x4ae56c=_0x54cfd1;logger[_0x7a81('0xf')](_0x7a81('0x6e'),_0x4ae56c['id']);return getEndUser(_0x5522a7,_0x509972[_0x7a81('0x76')],_0x509972['calleridnum'],_0x504e1c);})[_0x7a81('0x33')](function(_0x32fb04){_0x374911=_0x32fb04;logger['info'](_0x7a81('0x5e'),_0x374911['id']);return getTicket(_0x5522a7,_0x4ae56c,_0x374911,_0x33a9ea,_0x509972,_0x33a9ea[_0x7a81('0x6f')],_0x504e1c,'Inbound');})['then'](function(_0x546112){_0x1f651c=_0x546112;logger[_0x7a81('0xf')](_0x7a81('0x71'));logger[_0x7a81('0xf')](_0x7a81('0x60'),_0x1f651c['id']);return setRelationship(_0x504e1c,_0x4ae56c,_0x1f651c,_0x7a81('0x77'));})[_0x7a81('0x33')](function(){return setRelationship(_0x504e1c,_0x374911,_0x1f651c,_0x7a81('0x61'));})[_0x7a81('0x33')](function(){return getServerInfo(_0x504e1c);})[_0x7a81('0x73')](function(_0x382835){logger['error']('['+_0x509972['lastevent'][_0x7a81('0x78')]()+']',JSON[_0x7a81('0x26')](_0x382835));});};
\ No newline at end of file
+var _0xc21c=['Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','Contacts','name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','format','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','customField','nameField','toLowerCase','content','type','string','custom_fields','variable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','recordingFormat','none','destcalleridname','destcalleridnum','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','user:%s','unmanaged','uri','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0xc21c,0x166));var _0xcc21=function(_0x164964,_0x321d9f){_0x164964=_0x164964-0x0;var _0x46c6ad=_0xc21c[_0x164964];return _0x46c6ad;};'use strict';var _=require(_0xcc21('0x0'));var rp=require(_0xcc21('0x1'));var BPromise=require('bluebird');var md5=require(_0xcc21('0x2'));var util=require(_0xcc21('0x3'));var Redis=require(_0xcc21('0x4'));var intUtil=require(_0xcc21('0x5'));var config=require('../../../../config/environment');var logger=require(_0xcc21('0x6'))(_0xcc21('0x7'));config[_0xcc21('0x8')]=_[_0xcc21('0x9')](config[_0xcc21('0x8')],{'host':_0xcc21('0xa'),'port':0x18eb});var io=require(_0xcc21('0xb'))(new Redis(config['redis']));var def={'method':_0xcc21('0xc'),'json':!![]};function emit(_0xff4686,_0x4cb3ea,_0x38db3f){io['to'](_0xff4686)['emit'](_0x4cb3ea,_0x38db3f);}function getTicket(_0x144387,_0x5cade6,_0x412a15,_0x4ecf6a,_0x446165,_0x21c42f,_0x502845,_0x5108b6){logger[_0xcc21('0xd')](_0xcc21('0xe'));var _0x4c103f=new Date();var _0x314564=[{'name':'name','value':intUtil[_0xcc21('0xf')](_0x4ecf6a[_0xcc21('0x10')],_0x446165,'\x20')},{'name':_0xcc21('0x11'),'value':_0x5cade6['id']},{'name':'created_by','value':_0x5cade6['id']},{'name':_0xcc21('0x12'),'value':intUtil['getString'](_0x4ecf6a[_0xcc21('0x13')],_0x446165,'\x0a')},{'name':_0xcc21('0x14'),'value':_0x4c103f[_0xcc21('0x15')]()[_0xcc21('0x16')](0x0,0x13)[_0xcc21('0x17')]('T','\x20')},{'name':_0xcc21('0x18'),'value':'0'},{'name':_0xcc21('0x19'),'value':'15'},{'name':'parent_id','value':_0x412a15['id']},{'name':'parent_type','value':_0xcc21('0x1a')},{'name':'parent_name','value':_0x412a15[_0xcc21('0x1b')]},{'name':_0xcc21('0x1c'),'value':_0x5108b6}];if(_0x21c42f[_0xcc21('0x1d')]){_[_0xcc21('0x1e')](_0x21c42f,function(_0x79ea56){if(_0x446165[_0x79ea56['variableName']]){_0x314564[_0xcc21('0x1f')]({'name':_0x79ea56[_0xcc21('0x20')],'value':_0x446165[_0x79ea56[_0xcc21('0x21')]]});}});}return request({'form':{'method':_0xcc21('0x22'),'input_type':'JSON','response_type':_0xcc21('0x23'),'rest_data':JSON[_0xcc21('0x24')]({'session':_0x502845['id'],'module_name':_0xcc21('0x25'),'name_value_list':_0x314564})}});}function getAuth(_0x36cf4e){return util[_0xcc21('0x26')]('Basic\x20%s',new Buffer(_0x36cf4e[_0xcc21('0x27')]+':X')[_0xcc21('0x28')]('base64'));}function getServerInfo(_0x5d8ce3){return request({'form':{'method':_0xcc21('0x29'),'input_type':'JSON','response_type':_0xcc21('0x23'),'rest_data':JSON[_0xcc21('0x24')]({'session':_0x5d8ce3['id']})}});}function getUser(_0x38ec30,_0x44e857,_0x438d6c){if(!_[_0xcc21('0x2a')](_0x44e857)){logger['info'](_0xcc21('0x2b'),_0x44e857);return request({'form':{'method':'get_entry_list','input_type':_0xcc21('0x23'),'response_type':_0xcc21('0x23'),'rest_data':JSON[_0xcc21('0x24')]({'session':_0x438d6c['id'],'module_name':_0xcc21('0x2c'),'query':util['format'](_0xcc21('0x2d'),_0x44e857),'order_by':'','offset':'0','select_fields':['id','name',_0xcc21('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xcc21('0x2f')](function(_0x2d525b){if(_0x2d525b[_0xcc21('0x30')][_0xcc21('0x1d')]){var _0x1f2539=_[_0xcc21('0x31')](_0x2d525b[_0xcc21('0x30')],function(_0x1a8fef){return _0x1a8fef[_0xcc21('0x32')]['user_name'][_0xcc21('0x33')]===_0x44e857;});if(_0x1f2539){logger['info'](_0xcc21('0x34'));return BPromise[_0xcc21('0x35')]({'id':_0x1f2539[_0xcc21('0x32')]['id']['value'],'name':_0x1f2539[_0xcc21('0x32')]['name'][_0xcc21('0x33')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x438d6c['name_value_list'][_0xcc21('0x36')]['value'],'name':_0x438d6c[_0xcc21('0x32')]['user_name'][_0xcc21('0x33')]});});}else{logger[_0xcc21('0xd')](_0xcc21('0x37'));return BPromise['resolve']({'id':_0x438d6c[_0xcc21('0x32')][_0xcc21('0x36')][_0xcc21('0x33')],'name':_0x438d6c[_0xcc21('0x32')]['user_name']['value']});}}function getEndUser(_0x453fe4,_0x4a0a86,_0x439d27,_0x3d3846){logger[_0xcc21('0xd')]('Searching\x20enduser\x20with\x20phone',_0x439d27);return request({'form':{'method':_0xcc21('0x38'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xcc21('0x24')]({'session':_0x3d3846['id'],'module_name':_0xcc21('0x1a'),'query':util['format'](_0xcc21('0x39'),_0x439d27),'order_by':'','offset':'0','select_fields':['id',_0xcc21('0x1b'),_0xcc21('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xcc21('0x2f')](function(_0x233c66){if(_0x233c66[_0xcc21('0x30')]['length']){var _0x26d0d7=_[_0xcc21('0x31')](_0x233c66[_0xcc21('0x30')],function(_0x393fb6){return _0x393fb6[_0xcc21('0x32')]['phone_home'][_0xcc21('0x33')]===_0x439d27;});if(_0x26d0d7){logger[_0xcc21('0xd')](_0xcc21('0x3b'));return BPromise['resolve']({'id':_0x26d0d7[_0xcc21('0x32')]['id'][_0xcc21('0x33')],'name':_0x26d0d7[_0xcc21('0x32')][_0xcc21('0x1b')]['value'],'phone':_0x26d0d7['name_value_list'][_0xcc21('0x3a')][_0xcc21('0x33')]});}}else{logger['info'](_0xcc21('0x3c'));return request({'form':{'method':_0xcc21('0x22'),'input_type':_0xcc21('0x23'),'response_type':_0xcc21('0x23'),'rest_data':JSON[_0xcc21('0x24')]({'session':_0x3d3846['id'],'module_name':_0xcc21('0x1a'),'name_value_list':[{'name':_0xcc21('0x3d'),'value':_0x4a0a86!==_0xcc21('0x3e')?_0x4a0a86:util['format'](_0xcc21('0x3f'),_0x439d27)},{'name':_0xcc21('0x3a'),'value':_0x439d27}]})}})[_0xcc21('0x2f')](function(_0x4ddbd6){logger['info']('Enduser\x20created.');return BPromise[_0xcc21('0x35')]({'id':_0x4ddbd6['id'],'name':_0x4ddbd6[_0xcc21('0x30')][_0xcc21('0x3d')][_0xcc21('0x33')],'phone':_0x4ddbd6[_0xcc21('0x30')]['phone_home'][_0xcc21('0x33')]});});}});}function request(_0x2a733a){logger[_0xcc21('0x40')](_0xcc21('0x41'),JSON[_0xcc21('0x24')](_0x2a733a));return rp(_[_0xcc21('0x42')](def,_0x2a733a));}function getTags(_0x197c0e,_0x27bd37){var _0x3c5b15=[];if(_0x197c0e&&_0x197c0e[_0xcc21('0x1d')]>0x0){_0x3c5b15=_[_0xcc21('0x43')](_0x197c0e,_0x27bd37);}return _0x3c5b15;}function getCustomFields(_0x1b3a0b,_0x5c07c8){var _0x568069=[];var _0x48addd={'custom_fields':[]};if(_0x1b3a0b[_0xcc21('0x1d')]>0x0){_[_0xcc21('0x1e')](_0x1b3a0b,function(_0x27e27d){if(_0x27e27d['type']==='string'&&_0x27e27d['nameField']&&!_0x27e27d[_0xcc21('0x44')]){_0x48addd[_0x27e27d[_0xcc21('0x45')][_0xcc21('0x46')]()]=_0x27e27d[_0xcc21('0x47')][_0xcc21('0x28')]();}else if(_0x27e27d[_0xcc21('0x48')]===_0xcc21('0x49')&&_0x27e27d['idField']&&_0x27e27d['customField']){_0x48addd[_0xcc21('0x4a')][_0xcc21('0x1f')]({'id':_0x27e27d[_0xcc21('0x20')],'value':_0x27e27d['content'][_0xcc21('0x28')]()});}else if(_0x27e27d[_0xcc21('0x48')]===_0xcc21('0x4b')&&_0x27e27d[_0xcc21('0x21')]&&_0x27e27d['idField']&&_0x27e27d[_0xcc21('0x44')]){_0x5c07c8[_0x27e27d[_0xcc21('0x21')]]&&_0x48addd[_0xcc21('0x4a')][_0xcc21('0x1f')]({'id':_0x27e27d[_0xcc21('0x20')],'value':_0x5c07c8[_0x27e27d[_0xcc21('0x21')]][_0xcc21('0x28')]()});}else if(_0x27e27d[_0xcc21('0x48')]==='customVariable'&&_0x27e27d['Variable']&&_0x27e27d['Variable']['name']&&_0x27e27d['idField']&&_0x27e27d[_0xcc21('0x44')]){_0x5c07c8[_0x27e27d[_0xcc21('0x4c')]['name'][_0xcc21('0x46')]()]&&_0x48addd[_0xcc21('0x4a')][_0xcc21('0x1f')]({'id':_0x27e27d[_0xcc21('0x20')],'value':_0x5c07c8[_0x27e27d[_0xcc21('0x4c')][_0xcc21('0x1b')][_0xcc21('0x46')]()]['toString']()});}});}return _0x48addd;}function getConnection(_0x27b8d7){return request({'method':'POST','form':{'method':'login','input_type':_0xcc21('0x23'),'response_type':_0xcc21('0x23'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x27b8d7[_0xcc21('0x4d')],'password':_0x27b8d7[_0xcc21('0x4e')],'encryption':_0xcc21('0x4f')},'application':_0xcc21('0x50')})}})[_0xcc21('0x2f')](function(_0x11a166){var _0x5d452e=_0x11a166;if(_0x5d452e['id']){def[_0xcc21('0x51')]=_0x5d452e['id'];return BPromise[_0xcc21('0x35')](_0x5d452e);}else{throw new Error(util[_0xcc21('0x26')](_0xcc21('0x52'),_0x27b8d7['id']));}});}function setRelationship(_0x1898be,_0x18bccb,_0xef2574,_0xff16b9){return request({'form':{'method':_0xcc21('0x53'),'input_type':'JSON','response_type':_0xcc21('0x23'),'rest_data':JSON[_0xcc21('0x24')]({'session':_0x1898be['id'],'module_name':'Calls','module_id':_0xef2574['id'],'link_field_name':_0xff16b9,'related_ids':[_0x18bccb['id']]})}});}exports[_0xcc21('0x54')]=function(_0x842793,_0xd3f261,_0x18c754,_0x589ed7,_0x475be0,_0x5b0af5){var _0x4bc50b,_0x4425ce,_0x20dd83,_0x2dd7e1;_0x5b0af5[_0xcc21('0x55')]=intUtil[_0xcc21('0x56')](_0x5b0af5[_0xcc21('0x55')]);_0x5b0af5[_0xcc21('0x57')]=intUtil['stripTrailingSlash'](_0x5b0af5[_0xcc21('0x57')]);def['uri']=util[_0xcc21('0x26')](_0xcc21('0x58'),_0x5b0af5[_0xcc21('0x55')]);if(_0x475be0&&_0x475be0[_0xcc21('0x59')]){logger['info'](_0xcc21('0x5a'),_0xcc21('0x5b'));_0xd3f261[_0xcc21('0x5c')]=util['format'](_0xcc21('0x5d'),_0x5b0af5[_0xcc21('0x57')],_0xd3f261['uniqueid'],md5(_0xd3f261[_0xcc21('0x5e')]));}else{_0xd3f261['recordingURL']='';}return getConnection(_0x5b0af5)['then'](function(_0x1a8b8e){_0x2dd7e1=_0x1a8b8e;return getUser(_0x5b0af5,_0x589ed7[_0xcc21('0x1b')],_0x2dd7e1);})[_0xcc21('0x2f')](function(_0x532565){_0x4bc50b=_0x532565;logger['info'](_0xcc21('0x5f'),_0x4bc50b['id']);return getEndUser(_0x5b0af5,_0xd3f261[_0xcc21('0x60')],_0xd3f261[_0xcc21('0x61')],_0x2dd7e1);})[_0xcc21('0x2f')](function(_0x5c644e){_0x4425ce=_0x5c644e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4425ce['id']);return getTicket(_0x5b0af5,_0x4bc50b,_0x4425ce,_0x18c754,_0xd3f261,_0x18c754[_0xcc21('0x62')],_0x2dd7e1,_0xcc21('0x63'));})[_0xcc21('0x2f')](function(_0x30f691){_0x20dd83=_0x30f691;logger[_0xcc21('0xd')](_0xcc21('0x64'));logger[_0xcc21('0xd')](_0xcc21('0x65'),_0x20dd83['id']);return setRelationship(_0x2dd7e1,_0x4bc50b,_0x20dd83,_0xcc21('0x66'));})[_0xcc21('0x2f')](function(){return setRelationship(_0x2dd7e1,_0x4425ce,_0x20dd83,_0xcc21('0x67'));})[_0xcc21('0x2f')](function(){return getServerInfo(_0x2dd7e1);})[_0xcc21('0x2f')](function(_0x230b4c){var _0x2a3dc6=parseInt(_0x230b4c[_0xcc21('0x68')][_0xcc21('0x69')](0x0));var _0x18230a=util[_0xcc21('0x26')](_0xcc21('0x6a'),_0x5b0af5[_0xcc21('0x55')],_0x20dd83['id']);if(_0x2a3dc6>0x6){_0x18230a=util[_0xcc21('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5b0af5[_0xcc21('0x55')],_0x20dd83['id']);}logger[_0xcc21('0xd')]('[QUEUE]',_0xcc21('0x6b'));emit(util['format']('user:%s',_0x589ed7[_0xcc21('0x1b')]),_0xcc21('0x6c'),{'uri':_0x18230a});})[_0xcc21('0x6d')](function(_0x307b13){logger[_0xcc21('0x6e')](_0xcc21('0x5a'),JSON[_0xcc21('0x24')](_0x307b13));});};exports[_0xcc21('0x6f')]=function(_0xe93b25,_0x52f511,_0x32ba81,_0x5817dd,_0x1d2243,_0x3836d3,_0x2eb19c){var _0x1f1d40,_0x1f85a2,_0x5b4ae9,_0x149ec1;_0x3836d3[_0xcc21('0x55')]=intUtil[_0xcc21('0x56')](_0x3836d3[_0xcc21('0x55')]);_0x3836d3[_0xcc21('0x57')]=intUtil[_0xcc21('0x56')](_0x3836d3[_0xcc21('0x57')]);def['uri']=util[_0xcc21('0x26')]('%s/service/v4_1/rest.php',_0x3836d3[_0xcc21('0x55')]);if(_0x2eb19c&&_0x2eb19c[_0xcc21('0x70')]&&_0x2eb19c['recordingFormat']!==_0xcc21('0x71')){logger[_0xcc21('0xd')]('[OUTBOUND]',_0xcc21('0x5b'));_0x52f511[_0xcc21('0x5c')]=util[_0xcc21('0x26')](_0xcc21('0x5d'),_0x3836d3['serverUrl'],_0x52f511[_0xcc21('0x5e')],md5(_0x52f511['uniqueid']));}return getConnection(_0x3836d3)[_0xcc21('0x2f')](function(_0x48e2d8){_0x149ec1=_0x48e2d8;return getUser(_0x3836d3,_0x5817dd[_0xcc21('0x1b')],_0x149ec1);})[_0xcc21('0x2f')](function(_0x3f7cf7){_0x1f1d40=_0x3f7cf7;logger[_0xcc21('0xd')](_0xcc21('0x5f'),_0x1f1d40['id']);return getEndUser(_0x3836d3,_0x52f511[_0xcc21('0x72')],_0x52f511[_0xcc21('0x73')],_0x149ec1);})['then'](function(_0x17cc9d){_0x1f85a2=_0x17cc9d;logger[_0xcc21('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1f85a2['id']);return getTicket(_0x3836d3,_0x1f1d40,_0x1f85a2,_0x32ba81,_0x52f511,_0x32ba81[_0xcc21('0x62')],_0x149ec1,'Outbound');})[_0xcc21('0x2f')](function(_0x4b3453){_0x5b4ae9=_0x4b3453;logger[_0xcc21('0xd')](_0xcc21('0x64'));logger[_0xcc21('0xd')](_0xcc21('0x65'),_0x5b4ae9['id']);return setRelationship(_0x149ec1,_0x1f1d40,_0x5b4ae9,_0xcc21('0x66'));})[_0xcc21('0x2f')](function(){return setRelationship(_0x149ec1,_0x1f85a2,_0x5b4ae9,_0xcc21('0x67'));})['then'](function(){return getServerInfo(_0x149ec1);})[_0xcc21('0x2f')](function(_0x209168){var _0x57c810=parseInt(_0x209168[_0xcc21('0x68')]['charAt'](0x0));var _0x4b35d6=util[_0xcc21('0x26')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3836d3[_0xcc21('0x55')],_0x5b4ae9['id']);if(_0x57c810>0x6){_0x4b35d6=util[_0xcc21('0x26')](_0xcc21('0x74'),_0x3836d3[_0xcc21('0x55')],_0x5b4ae9['id']);}logger[_0xcc21('0xd')](_0xcc21('0x75'),_0xcc21('0x6b'));emit(util[_0xcc21('0x26')](_0xcc21('0x76'),_0x5817dd[_0xcc21('0x1b')]),'trigger:browser:url',{'uri':_0x4b35d6});})[_0xcc21('0x6d')](function(_0x32b1f6){logger[_0xcc21('0x6e')]('[OUTBOUND]',JSON[_0xcc21('0x24')](_0x32b1f6));});};exports[_0xcc21('0x77')]=function(_0x5ad131,_0x4ba7a3,_0x3ef415,_0x1338a3,_0x291418,_0x5668ee){var _0x4932dd,_0x468de1,_0x2ed8a0,_0x206630;_0x5668ee[_0xcc21('0x55')]=intUtil[_0xcc21('0x56')](_0x5668ee[_0xcc21('0x55')]);_0x5668ee[_0xcc21('0x57')]=intUtil[_0xcc21('0x56')](_0x5668ee['serverUrl']);def[_0xcc21('0x78')]=util[_0xcc21('0x26')](_0xcc21('0x58'),_0x5668ee[_0xcc21('0x55')]);if(_0x291418&&_0x291418[_0xcc21('0x59')]){logger[_0xcc21('0xd')]('['+_0x4ba7a3[_0xcc21('0x79')][_0xcc21('0x7a')]()+']',_0xcc21('0x5b'));_0x4ba7a3['recordingURL']=util[_0xcc21('0x26')](_0xcc21('0x5d'),_0x5668ee[_0xcc21('0x57')],_0x4ba7a3[_0xcc21('0x5e')],md5(_0x4ba7a3[_0xcc21('0x5e')]));}else{_0x4ba7a3[_0xcc21('0x5c')]='';}return getConnection(_0x5668ee)[_0xcc21('0x2f')](function(_0x5c42c2){_0x206630=_0x5c42c2;if(!_[_0xcc21('0x2a')](_0x1338a3)){return getUser(_0x5668ee,_0x1338a3[_0xcc21('0x1b')],_0x206630);}else{return getUser(_0x5668ee,null,_0x206630);}})[_0xcc21('0x2f')](function(_0x47e080){_0x4932dd=_0x47e080;logger[_0xcc21('0xd')](_0xcc21('0x5f'),_0x4932dd['id']);return getEndUser(_0x5668ee,_0x4ba7a3[_0xcc21('0x60')],_0x4ba7a3[_0xcc21('0x61')],_0x206630);})['then'](function(_0x4c9162){_0x468de1=_0x4c9162;logger[_0xcc21('0xd')](_0xcc21('0x7b'),_0x468de1['id']);return getTicket(_0x5668ee,_0x4932dd,_0x468de1,_0x3ef415,_0x4ba7a3,_0x3ef415[_0xcc21('0x62')],_0x206630,_0xcc21('0x63'));})[_0xcc21('0x2f')](function(_0x15eb16){_0x2ed8a0=_0x15eb16;logger[_0xcc21('0xd')](_0xcc21('0x64'));logger[_0xcc21('0xd')](_0xcc21('0x65'),_0x2ed8a0['id']);return setRelationship(_0x206630,_0x4932dd,_0x2ed8a0,_0xcc21('0x66'));})['then'](function(){return setRelationship(_0x206630,_0x468de1,_0x2ed8a0,_0xcc21('0x67'));})[_0xcc21('0x2f')](function(){return getServerInfo(_0x206630);})[_0xcc21('0x6d')](function(_0x10657a){logger[_0xcc21('0x6e')]('['+_0x4ba7a3[_0xcc21('0x79')]['toUpperCase']()+']',JSON[_0xcc21('0x24')](_0x10657a));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js
index f335470..cec077b 100644
--- a/server/services/ami/trigger/integration/util.js
+++ b/server/services/ami/trigger/integration/util.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf9d=['Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','join','slice','substring','validateEmail','test','util','length','type','string','push','variable','variableName','toString','customVariable'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xcf9d,0x1af));var _0xdcf9=function(_0x1fec65,_0x22dc2f){_0x1fec65=_0x1fec65-0x0;var _0x2aa11d=_0xcf9d[_0x1fec65];return _0x2aa11d;};'use strict';var _=require('lodash');var util=require(_0xdcf9('0x0'));exports['getString']=function(_0x1b7ef9,_0x1eac19,_0x2d7d0b){var _0x546945=[];if(_0x1b7ef9[_0xdcf9('0x1')]>0x0){var _0x5119dc=_['sortBy'](_0x1b7ef9,['id']);for(var _0x4c079c=0x0;_0x4c079c<_0x5119dc['length'];_0x4c079c++){var _0xf404bd=_0x5119dc[_0x4c079c];if(_0xf404bd[_0xdcf9('0x2')]===_0xdcf9('0x3')){_0x546945[_0xdcf9('0x4')](_0xf404bd['content']);}else if(_0xf404bd[_0xdcf9('0x2')]===_0xdcf9('0x5')&&_0xf404bd[_0xdcf9('0x6')]){_0x1eac19[_0xf404bd[_0xdcf9('0x6')]]&&_0x546945[_0xdcf9('0x4')](_0x1eac19[_0xf404bd[_0xdcf9('0x6')]][_0xdcf9('0x7')]());}else if(_0xf404bd[_0xdcf9('0x2')]===_0xdcf9('0x8')&&_0xf404bd[_0xdcf9('0x9')]&&_0xf404bd[_0xdcf9('0x9')]['name']){_0x1eac19[_0xf404bd[_0xdcf9('0x9')][_0xdcf9('0xa')]['toLowerCase']()]&&_0x546945['push'](_0x1eac19[_0xf404bd[_0xdcf9('0x9')][_0xdcf9('0xa')][_0xdcf9('0xb')]()][_0xdcf9('0x7')]());}else if(_0xf404bd['type']===_0xdcf9('0xc')){if(_0xf404bd[_0xdcf9('0xd')]===_0xdcf9('0x3')&&_0xf404bd[_0xdcf9('0xe')]){_0x546945[_0xdcf9('0x4')](util[_0xdcf9('0xf')]('%s:\x20%s',_0xf404bd[_0xdcf9('0xe')],_0xf404bd['keyContent']));}else if(_0xf404bd[_0xdcf9('0xd')]===_0xdcf9('0x5')&&_0xf404bd[_0xdcf9('0x6')]&&_0xf404bd[_0xdcf9('0xe')]){_0x1eac19[_0xf404bd['variableName']]&&_0x546945[_0xdcf9('0x4')](util[_0xdcf9('0xf')](_0xdcf9('0x10'),_0xf404bd['key'],_0x1eac19[_0xf404bd[_0xdcf9('0x6')]]));}else if(_0xf404bd['keyType']===_0xdcf9('0x8')&&_0xf404bd['Variable']&&_0xf404bd[_0xdcf9('0x9')][_0xdcf9('0xa')]&&_0xf404bd[_0xdcf9('0xe')]){_0x1eac19[_0xf404bd[_0xdcf9('0x9')][_0xdcf9('0xa')][_0xdcf9('0xb')]()]&&_0x546945[_0xdcf9('0x4')](util['format'](_0xdcf9('0x10'),_0xf404bd[_0xdcf9('0xe')],_0x1eac19[_0xf404bd[_0xdcf9('0x9')][_0xdcf9('0xa')][_0xdcf9('0xb')]()]));}}}}return _0x546945[_0xdcf9('0x11')](_0x2d7d0b);};exports['stripTrailingSlash']=function(_0x5eb494){var _0x3cabfe=_0x5eb494[_0xdcf9('0x12')](-0x1);if(_0x3cabfe==='/'){_0x5eb494=_0x5eb494[_0xdcf9('0x13')](0x0,_0x5eb494['lastIndexOf'](_0x3cabfe));}return _0x5eb494;};exports[_0xdcf9('0x14')]=function(_0x2c4397){if(!_['isNil'](_0x2c4397)&&_0x2c4397!==''){var _0x21668d=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x21668d[_0xdcf9('0x15')](String(_0x2c4397)['toLowerCase']());}else{return![];}};
\ No newline at end of file
+var _0xa801=['isNil','getString','length','sortBy','type','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType','format','%s:\x20%s','key','keyContent','join','stripTrailingSlash','lastIndexOf','validateEmail'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xa801,0xa2));var _0x1a80=function(_0x1f43ec,_0x13625f){_0x1f43ec=_0x1f43ec-0x0;var _0x2792df=_0xa801[_0x1f43ec];return _0x2792df;};'use strict';var _=require('lodash');var util=require('util');exports[_0x1a80('0x0')]=function(_0x589dfe,_0x4f85aa,_0x4b4caa){var _0x38622d=[];if(_0x589dfe[_0x1a80('0x1')]>0x0){var _0x103bcd=_[_0x1a80('0x2')](_0x589dfe,['id']);for(var _0x2cfcbe=0x0;_0x2cfcbe<_0x103bcd[_0x1a80('0x1')];_0x2cfcbe++){var _0x3287d8=_0x103bcd[_0x2cfcbe];if(_0x3287d8[_0x1a80('0x3')]==='string'){_0x38622d[_0x1a80('0x4')](_0x3287d8[_0x1a80('0x5')]);}else if(_0x3287d8[_0x1a80('0x3')]===_0x1a80('0x6')&&_0x3287d8[_0x1a80('0x7')]){_0x4f85aa[_0x3287d8[_0x1a80('0x7')]]&&_0x38622d[_0x1a80('0x4')](_0x4f85aa[_0x3287d8[_0x1a80('0x7')]][_0x1a80('0x8')]());}else if(_0x3287d8[_0x1a80('0x3')]===_0x1a80('0x9')&&_0x3287d8['Variable']&&_0x3287d8[_0x1a80('0xa')][_0x1a80('0xb')]){_0x4f85aa[_0x3287d8[_0x1a80('0xa')][_0x1a80('0xb')][_0x1a80('0xc')]()]&&_0x38622d[_0x1a80('0x4')](_0x4f85aa[_0x3287d8[_0x1a80('0xa')]['name'][_0x1a80('0xc')]()][_0x1a80('0x8')]());}else if(_0x3287d8[_0x1a80('0x3')]==='keyValue'){if(_0x3287d8[_0x1a80('0xd')]==='string'&&_0x3287d8['key']){_0x38622d[_0x1a80('0x4')](util[_0x1a80('0xe')](_0x1a80('0xf'),_0x3287d8[_0x1a80('0x10')],_0x3287d8[_0x1a80('0x11')]));}else if(_0x3287d8[_0x1a80('0xd')]===_0x1a80('0x6')&&_0x3287d8[_0x1a80('0x7')]&&_0x3287d8[_0x1a80('0x10')]){_0x4f85aa[_0x3287d8['variableName']]&&_0x38622d[_0x1a80('0x4')](util['format'](_0x1a80('0xf'),_0x3287d8[_0x1a80('0x10')],_0x4f85aa[_0x3287d8[_0x1a80('0x7')]]));}else if(_0x3287d8[_0x1a80('0xd')]===_0x1a80('0x9')&&_0x3287d8[_0x1a80('0xa')]&&_0x3287d8[_0x1a80('0xa')][_0x1a80('0xb')]&&_0x3287d8[_0x1a80('0x10')]){_0x4f85aa[_0x3287d8[_0x1a80('0xa')][_0x1a80('0xb')][_0x1a80('0xc')]()]&&_0x38622d['push'](util['format'](_0x1a80('0xf'),_0x3287d8[_0x1a80('0x10')],_0x4f85aa[_0x3287d8[_0x1a80('0xa')]['name'][_0x1a80('0xc')]()]));}}}}return _0x38622d[_0x1a80('0x12')](_0x4b4caa);};exports[_0x1a80('0x13')]=function(_0x2406aa){var _0x5a0354=_0x2406aa['slice'](-0x1);if(_0x5a0354==='/'){_0x2406aa=_0x2406aa['substring'](0x0,_0x2406aa[_0x1a80('0x14')](_0x5a0354));}return _0x2406aa;};exports[_0x1a80('0x15')]=function(_0x3a382e){if(!_[_0x1a80('0x16')](_0x3a382e)&&_0x3a382e!==''){var _0x264045=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x264045['test'](String(_0x3a382e)[_0x1a80('0xc')]());}else{return![];}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js
index ac0ad1a..2b350be 100644
--- a/server/services/ami/trigger/integration/vtiger.js
+++ b/server/services/ami/trigger/integration/vtiger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6124=['The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','email','The\x20User\x20ID\x20is:','destcalleridnum','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','defaults','redis','localhost','socket.io-emitter','emit','forEach','type','string','idField','content','variableName','toString','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Subjects','%s/webservice.php','create','HelpDesk','stringify','then','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','createTicket','validateEmail','GET','remoteUri','query','username','sessionName','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','[vTiger],\x20%s,\x20%s,\x20%s','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','length','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','phone','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','calleridname'];(function(_0x10657d,_0x4d47c5){var _0x1a9577=function(_0x427f2c){while(--_0x427f2c){_0x10657d['push'](_0x10657d['shift']());}};_0x1a9577(++_0x4d47c5);}(_0x6124,0x7a));var _0x4612=function(_0x40cbc2,_0x398002){_0x40cbc2=_0x40cbc2-0x0;var _0x1fbe22=_0x6124[_0x40cbc2];return _0x1fbe22;};'use strict';var _=require(_0x4612('0x0'));var rp=require(_0x4612('0x1'));var BPromise=require(_0x4612('0x2'));var md5=require(_0x4612('0x3'));var util=require(_0x4612('0x4'));var Redis=require(_0x4612('0x5'));var intUtil=require(_0x4612('0x6'));var config=require(_0x4612('0x7'));var logger=require(_0x4612('0x8'))(_0x4612('0x9'));config['redis']=_[_0x4612('0xa')](config[_0x4612('0xb')],{'host':_0x4612('0xc'),'port':0x18eb});var io=require(_0x4612('0xd'))(new Redis(config['redis']));function emit(_0x4f6a76,_0x1e213f,_0x5ba7f2){io['to'](_0x4f6a76)[_0x4612('0xe')](_0x1e213f,_0x5ba7f2);}function getCustomFields(_0x435155,_0x178489){var _0x4ff446={};if(_0x435155['length']>0x0){_[_0x4612('0xf')](_0x435155,function(_0xca0374){if(_0xca0374[_0x4612('0x10')]===_0x4612('0x11')&&_0xca0374[_0x4612('0x12')]){_0x4ff446[_0xca0374[_0x4612('0x12')]]=_0xca0374[_0x4612('0x13')]['toString']();}else if(_0xca0374[_0x4612('0x10')]==='variable'&&_0xca0374[_0x4612('0x14')]&&_0xca0374[_0x4612('0x12')]&&_0x178489[_0xca0374[_0x4612('0x14')]]){_0x4ff446[_0xca0374[_0x4612('0x12')]]=_0x178489[_0xca0374[_0x4612('0x14')]][_0x4612('0x15')]();}else if(_0xca0374[_0x4612('0x10')]==='customVariable'&&_0xca0374[_0x4612('0x16')]&&_0xca0374[_0x4612('0x16')]['name']&&_0xca0374[_0x4612('0x12')]&&_0x178489[_0xca0374[_0x4612('0x16')][_0x4612('0x17')][_0x4612('0x18')]()]){_0x4ff446[_0xca0374[_0x4612('0x12')]]=_0x178489[_0xca0374[_0x4612('0x16')][_0x4612('0x17')][_0x4612('0x18')]()][_0x4612('0x15')]();}});}return _0x4ff446;}function createTicket(_0xf7ddab,_0x353368,_0x5d0683,_0x451bf7,_0x491348,_0x46c066,_0x31b0c3){logger[_0x4612('0x19')](_0x4612('0x1a'));var _0x52e310=_[_0x4612('0x1b')]({'parent_id':'','assigned_user_id':_0x353368['id'],'ticketpriorities':_0x4612('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x451bf7[_0x4612('0x1d')],_0x491348,'\x20'),'description':intUtil['getString'](_0x451bf7['Descriptions'],_0x491348,'\x0a'),'contact_id':_0x5d0683['id']},getCustomFields(_0x46c066,_0x491348));var _0x34a8d9={'method':'POST','uri':util['format'](_0x4612('0x1e'),_0xf7ddab['remoteUri']),'form':{'operation':_0x4612('0x1f'),'username':_0xf7ddab['username'],'sessionName':_0x31b0c3['sessionName'],'elementType':_0x4612('0x20'),'element':JSON[_0x4612('0x21')](_0x52e310)},'json':!![]};return request(_0x34a8d9)[_0x4612('0x22')](function(_0x5cb9ef){if(_0x5cb9ef[_0x4612('0x23')]){return BPromise[_0x4612('0x24')]({'id':_0x5cb9ef[_0x4612('0x25')]['id']});}else{throw new Error(util[_0x4612('0x26')](_0x4612('0x27'),JSON[_0x4612('0x21')](_0x5cb9ef['error'])));}})[_0x4612('0x28')](function(_0x3af661){var _0x1ba2ae=_0x3af661[_0x4612('0x29')]||0x1f4;logger[_0x4612('0x2a')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x4612('0x2b'),_0x1ba2ae,JSON[_0x4612('0x21')](_0x3af661));});}function getUser(_0x5de33a,_0x96b411,_0x1fb9fb){if(intUtil[_0x4612('0x2c')](_0x96b411)){logger[_0x4612('0x19')]('Getting\x20agent\x20with\x20email',_0x96b411);return request({'method':_0x4612('0x2d'),'uri':util['format']('%s/webservice.php',_0x5de33a[_0x4612('0x2e')]),'qs':{'operation':_0x4612('0x2f'),'username':_0x5de33a[_0x4612('0x30')],'sessionName':_0x1fb9fb[_0x4612('0x31')],'query':util[_0x4612('0x26')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x96b411)},'json':!![]})['then'](function(_0x5e5d71){if(_0x5e5d71['success']&&_0x5e5d71[_0x4612('0x25')]['length']){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x5e5d71[_0x4612('0x25')][0x0]['id'],'email':_0x5e5d71['result'][0x0][_0x4612('0x32')],'name':_0x5e5d71['result'][0x0][_0x4612('0x33')]+'\x20'+_0x5e5d71[_0x4612('0x25')][_0x4612('0x34')]});}else{logger[_0x4612('0x19')](_0x4612('0x35'));return BPromise['resolve']({'id':_0x1fb9fb[_0x4612('0x36')],'email':_0x5de33a[_0x4612('0x30')],'name':_0x4612('0x37')});}})['catch'](function(_0x4e8249){var _0x340fbe=_0x4e8249['statusCode']||0x1f4;logger[_0x4612('0x2a')](_0x4612('0x38'),'getUser',_0x340fbe,JSON[_0x4612('0x21')](_0x4e8249));});}else{logger['info'](_0x4612('0x35'));return BPromise[_0x4612('0x24')]({'id':_0x1fb9fb[_0x4612('0x36')],'email':_0x5de33a[_0x4612('0x30')],'name':_0x4612('0x37')})['catch'](function(_0x599fd5){var _0x19eecd=_0x599fd5['statusCode']||0x1f4;logger[_0x4612('0x2a')](_0x4612('0x38'),_0x4612('0x39'),_0x19eecd,JSON[_0x4612('0x21')](_0x599fd5));});}}function getEndUser(_0x46ee02,_0x44b16c,_0x35056f,_0x460515){logger['info'](_0x4612('0x3a'),_0x35056f);return request({'method':_0x4612('0x2d'),'uri':util[_0x4612('0x26')](_0x4612('0x1e'),_0x46ee02[_0x4612('0x2e')]),'qs':{'operation':'query','username':_0x46ee02[_0x4612('0x30')],'sessionName':_0x460515[_0x4612('0x31')],'query':util[_0x4612('0x26')](_0x4612('0x3b'),_0x35056f,_0x35056f,_0x35056f,_0x35056f,_0x35056f)},'json':!![]})[_0x4612('0x22')](function(_0x49441c){if(_0x49441c[_0x4612('0x23')]&&_0x49441c[_0x4612('0x25')][_0x4612('0x3c')]){logger[_0x4612('0x19')](_0x4612('0x3d'));return BPromise[_0x4612('0x24')]({'id':_0x49441c[_0x4612('0x25')][0x0]['id'],'name':_0x49441c[_0x4612('0x25')][0x0][_0x4612('0x3e')]+'\x20'+_0x49441c['result'][0x0][_0x4612('0x3f')],'phone':_0x35056f});}else{logger['info'](_0x4612('0x40'));return request({'method':_0x4612('0x41'),'uri':util[_0x4612('0x26')](_0x4612('0x1e'),_0x46ee02[_0x4612('0x2e')]),'form':{'operation':_0x4612('0x1f'),'sessionName':_0x460515[_0x4612('0x31')],'elementType':'Contacts','element':JSON[_0x4612('0x21')]({'lastname':_0x44b16c,'phone':_0x35056f,'assigned_user_id':'\x20'})},'json':!![]})[_0x4612('0x22')](function(_0x303b2a){logger[_0x4612('0x19')](_0x4612('0x42'));return BPromise[_0x4612('0x24')]({'id':_0x303b2a[_0x4612('0x25')]['id'],'name':_0x303b2a[_0x4612('0x25')]['lastname'],'phone':_0x303b2a['result'][_0x4612('0x43')]});})[_0x4612('0x28')](function(_0x2ba4d9){var _0x382ee9=_0x2ba4d9[_0x4612('0x29')]||0x1f4;logger['error'](_0x4612('0x38'),'getEndUser',_0x382ee9,JSON[_0x4612('0x21')](_0x2ba4d9));});}});}function getConnection(_0x4d29e6){var _0x2112a1=_0x4d29e6[_0x4612('0x30')];var _0x953773=_0x4d29e6[_0x4612('0x44')];return request({'method':_0x4612('0x2d'),'uri':util[_0x4612('0x26')](_0x4612('0x1e'),_0x4d29e6[_0x4612('0x2e')]),'qs':{'operation':'getchallenge','username':_0x2112a1},'json':!![]})[_0x4612('0x22')](function(_0x345656){if(_0x345656[_0x4612('0x23')]){return request({'method':'POST','uri':util['format'](_0x4612('0x1e'),_0x4d29e6[_0x4612('0x2e')]),'form':{'operation':_0x4612('0x45'),'username':_0x2112a1,'accessKey':md5(_0x345656['result']['token']+_0x953773)},'json':!![]});}})[_0x4612('0x22')](function(_0x26df1b){if(_0x26df1b[_0x4612('0x23')]){return BPromise[_0x4612('0x24')](_0x26df1b[_0x4612('0x25')]);}else{throw new Error(util[_0x4612('0x26')](_0x4612('0x46'),_0x4d29e6['id']));}})[_0x4612('0x28')](function(_0x3e2562){var _0x1ea2f8=_0x3e2562[_0x4612('0x29')]||0x1f4;logger[_0x4612('0x2a')](_0x4612('0x38'),_0x4612('0x47'),_0x1ea2f8,JSON[_0x4612('0x21')](_0x3e2562));});}function request(_0x351657){logger[_0x4612('0x19')](_0x4612('0x48'),JSON['stringify'](_0x351657));return rp(_0x351657);}exports[_0x4612('0x49')]=function(_0x4c588e,_0xbc2885,_0x584497,_0x13488a,_0x10eacf,_0x3c68d4){var _0x235270,_0x3326c2,_0x3dd76b,_0x156c0e;_0x3c68d4[_0x4612('0x2e')]=intUtil['stripTrailingSlash'](_0x3c68d4['remoteUri']);if(_0x10eacf&&_0x10eacf[_0x4612('0x4a')]){logger[_0x4612('0x19')](_0x4612('0x4b'),_0x4612('0x4c'));_0xbc2885[_0x4612('0x4d')]=util['format'](_0x4612('0x4e'),_0x3c68d4[_0x4612('0x4f')],_0xbc2885[_0x4612('0x50')],md5(_0xbc2885['uniqueid']));}else{_0xbc2885[_0x4612('0x4d')]='';}return getConnection(_0x3c68d4)[_0x4612('0x22')](function(_0x28bf28){_0x156c0e=_0x28bf28;return getUser(_0x3c68d4,_0x13488a['email'],_0x156c0e);})[_0x4612('0x22')](function(_0xf570b8){_0x235270=_0xf570b8;logger['info']('The\x20User\x20ID\x20is:',_0x235270['id']);return getEndUser(_0x3c68d4,_0xbc2885[_0x4612('0x51')],_0xbc2885['calleridnum'],_0x156c0e);})[_0x4612('0x22')](function(_0x21a4c3){_0x3326c2=_0x21a4c3;logger[_0x4612('0x19')](_0x4612('0x52'),_0x3326c2['id']);return createTicket(_0x3c68d4,_0x235270,_0x3326c2,_0x584497,_0xbc2885,_0x584497[_0x4612('0x53')],_0x156c0e);})[_0x4612('0x22')](function(_0xc532ca){_0x3dd76b=_0xc532ca;logger[_0x4612('0x19')](_0x4612('0x54'));logger[_0x4612('0x19')](_0x4612('0x55'),_0x3dd76b['id']);var _0x3b019f=util[_0x4612('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3c68d4[_0x4612('0x2e')],_[_0x4612('0x56')](_0x3dd76b['id'],'x')[0x1]);logger[_0x4612('0x19')](_0x4612('0x4b'),_0x4612('0x57'));emit(util['format'](_0x4612('0x58'),_0x13488a['name']),_0x4612('0x59'),{'uri':_0x3b019f});})[_0x4612('0x28')](function(_0x427832){logger['error'](_0x4612('0x4b'),JSON[_0x4612('0x21')](_0x427832));});};exports[_0x4612('0x5a')]=function(_0x1d878e,_0x15bd3e,_0x1a176f,_0x2785c9,_0x167cfa,_0x44b46e,_0x13dedc){var _0x52b6e1,_0x2cd8c7,_0xdfb4e5,_0x526ea6;_0x44b46e[_0x4612('0x2e')]=intUtil['stripTrailingSlash'](_0x44b46e['remoteUri']);_0x44b46e[_0x4612('0x4f')]=intUtil[_0x4612('0x5b')](_0x44b46e[_0x4612('0x4f')]);if(_0x13dedc&&_0x13dedc[_0x4612('0x5c')]&&_0x13dedc[_0x4612('0x5c')]!==_0x4612('0x5d')){logger['info'](_0x4612('0x5e'),'Recording\x20is\x20enabled!');_0x15bd3e['recordingURL']=util[_0x4612('0x26')](_0x4612('0x4e'),_0x44b46e[_0x4612('0x4f')],_0x15bd3e[_0x4612('0x50')],md5(_0x15bd3e[_0x4612('0x50')]));}return getConnection(_0x44b46e)[_0x4612('0x22')](function(_0x4c45ad){_0x526ea6=_0x4c45ad;return getUser(_0x44b46e,_0x2785c9[_0x4612('0x5f')],_0x526ea6);})['then'](function(_0x5666fb){_0x52b6e1=_0x5666fb;logger[_0x4612('0x19')](_0x4612('0x60'),_0x52b6e1['id']);return getEndUser(_0x44b46e,_0x15bd3e['destcalleridname'],_0x15bd3e[_0x4612('0x61')],_0x526ea6);})[_0x4612('0x22')](function(_0x59ff17){_0x2cd8c7=_0x59ff17;logger['info'](_0x4612('0x52'),_0x2cd8c7['id']);return createTicket(_0x44b46e,_0x52b6e1,_0x2cd8c7,_0x1a176f,_0x15bd3e,_0x1a176f[_0x4612('0x53')],_0x526ea6);})['then'](function(_0xabc84f){_0xdfb4e5=_0xabc84f;logger['info'](_0x4612('0x54'));logger[_0x4612('0x19')](_0x4612('0x55'),_0xdfb4e5['id']);var _0x42ce4c=util[_0x4612('0x26')](_0x4612('0x62'),_0x44b46e[_0x4612('0x2e')],_[_0x4612('0x56')](_0xdfb4e5['id'],'x')[0x1]);logger[_0x4612('0x19')](_0x4612('0x5e'),_0x4612('0x57'));emit(util[_0x4612('0x26')]('user:%s',_0x2785c9['name']),'trigger:browser:url',{'uri':_0x42ce4c});})['catch'](function(_0x2c4332){logger[_0x4612('0x2a')](_0x4612('0x5e'),JSON[_0x4612('0x21')](_0x2c4332));});};exports[_0x4612('0x63')]=function(_0x214e77,_0x1bbf0d,_0x2780de,_0x41dbe2,_0x1e084e,_0x2e59df){var _0x32c4de,_0x512d63,_0x348637,_0xf802f3;_0x2e59df[_0x4612('0x2e')]=intUtil['stripTrailingSlash'](_0x2e59df[_0x4612('0x2e')]);_0x2e59df[_0x4612('0x4f')]=intUtil[_0x4612('0x5b')](_0x2e59df[_0x4612('0x4f')]);if(_0x1e084e&&_0x1e084e[_0x4612('0x4a')]){logger[_0x4612('0x19')]('['+_0x1bbf0d[_0x4612('0x64')][_0x4612('0x65')]()+']',_0x4612('0x4c'));_0x1bbf0d[_0x4612('0x4d')]=util[_0x4612('0x26')](_0x4612('0x4e'),_0x2e59df[_0x4612('0x4f')],_0x1bbf0d[_0x4612('0x50')],md5(_0x1bbf0d[_0x4612('0x50')]));}else{_0x1bbf0d[_0x4612('0x4d')]='';}return getConnection(_0x2e59df)[_0x4612('0x22')](function(_0x23f5f0){_0xf802f3=_0x23f5f0;return getUser(_0x2e59df,'',_0xf802f3);})['then'](function(_0x37ba3f){_0x32c4de=_0x37ba3f;logger[_0x4612('0x19')](_0x4612('0x60'),_0x32c4de['id']);return getEndUser(_0x2e59df,_0x1bbf0d[_0x4612('0x51')],_0x1bbf0d['calleridnum'],_0xf802f3);})[_0x4612('0x22')](function(_0x6458f3){_0x512d63=_0x6458f3;logger[_0x4612('0x19')](_0x4612('0x52'),_0x512d63['id']);return createTicket(_0x2e59df,_0x32c4de,_0x512d63,_0x2780de,_0x1bbf0d,_0x2780de['Fields'],_0xf802f3);})['then'](function(_0x5c4d52){_0x348637=_0x5c4d52;logger['info'](_0x4612('0x54'));logger[_0x4612('0x19')]('The\x20Ticket\x20ID\x20is:',_0x348637['id']);})[_0x4612('0x28')](function(_0x551193){logger['error']('['+_0x1bbf0d['lastevent'][_0x4612('0x65')]()+']',JSON[_0x4612('0x21')](_0x551193));});};
\ No newline at end of file
+var _0x7103=['trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','unmanaged','monitor_format','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','emit','length','forEach','type','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Open','getString','Subjects','POST','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','format','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','Agent\x20found!','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','Searching\x20end\x20user\x20with\x20phone','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','phone','catch','accessKey','getchallenge','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7103,0x76));var _0x3710=function(_0x26c14d,_0x12ee06){_0x26c14d=_0x26c14d-0x0;var _0x492244=_0x7103[_0x26c14d];return _0x492244;};'use strict';var _=require(_0x3710('0x0'));var rp=require(_0x3710('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x3710('0x2'));var Redis=require(_0x3710('0x3'));var intUtil=require('./util');var config=require(_0x3710('0x4'));var logger=require(_0x3710('0x5'))(_0x3710('0x6'));config[_0x3710('0x7')]=_['defaults'](config[_0x3710('0x7')],{'host':_0x3710('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3710('0x7')]));function emit(_0x361fb0,_0x2dc458,_0x23a07d){io['to'](_0x361fb0)[_0x3710('0x9')](_0x2dc458,_0x23a07d);}function getCustomFields(_0x28629d,_0x1a8f14){var _0x13b7dc={};if(_0x28629d[_0x3710('0xa')]>0x0){_[_0x3710('0xb')](_0x28629d,function(_0x54b882){if(_0x54b882[_0x3710('0xc')]===_0x3710('0xd')&&_0x54b882['idField']){_0x13b7dc[_0x54b882[_0x3710('0xe')]]=_0x54b882[_0x3710('0xf')][_0x3710('0x10')]();}else if(_0x54b882[_0x3710('0xc')]===_0x3710('0x11')&&_0x54b882[_0x3710('0x12')]&&_0x54b882[_0x3710('0xe')]&&_0x1a8f14[_0x54b882[_0x3710('0x12')]]){_0x13b7dc[_0x54b882['idField']]=_0x1a8f14[_0x54b882[_0x3710('0x12')]]['toString']();}else if(_0x54b882[_0x3710('0xc')]==='customVariable'&&_0x54b882[_0x3710('0x13')]&&_0x54b882[_0x3710('0x13')][_0x3710('0x14')]&&_0x54b882[_0x3710('0xe')]&&_0x1a8f14[_0x54b882['Variable'][_0x3710('0x14')][_0x3710('0x15')]()]){_0x13b7dc[_0x54b882[_0x3710('0xe')]]=_0x1a8f14[_0x54b882[_0x3710('0x13')][_0x3710('0x14')][_0x3710('0x15')]()]['toString']();}});}return _0x13b7dc;}function createTicket(_0x519e33,_0x1bccdd,_0x4305bd,_0x5bb18e,_0x2b83c3,_0x512f33,_0x2f60cf){logger[_0x3710('0x16')](_0x3710('0x17'));var _0x3a1bd4=_[_0x3710('0x18')]({'parent_id':'','assigned_user_id':_0x1bccdd['id'],'ticketpriorities':'Normal','ticketstatus':_0x3710('0x19'),'ticket_title':intUtil[_0x3710('0x1a')](_0x5bb18e[_0x3710('0x1b')],_0x2b83c3,'\x20'),'description':intUtil[_0x3710('0x1a')](_0x5bb18e['Descriptions'],_0x2b83c3,'\x0a'),'contact_id':_0x4305bd['id']},getCustomFields(_0x512f33,_0x2b83c3));var _0x5641db={'method':_0x3710('0x1c'),'uri':util['format'](_0x3710('0x1d'),_0x519e33[_0x3710('0x1e')]),'form':{'operation':_0x3710('0x1f'),'username':_0x519e33[_0x3710('0x20')],'sessionName':_0x2f60cf[_0x3710('0x21')],'elementType':_0x3710('0x22'),'element':JSON[_0x3710('0x23')](_0x3a1bd4)},'json':!![]};return request(_0x5641db)['then'](function(_0x2ffbd8){if(_0x2ffbd8[_0x3710('0x24')]){return BPromise[_0x3710('0x25')]({'id':_0x2ffbd8[_0x3710('0x26')]['id']});}else{throw new Error(util['format'](_0x3710('0x27'),JSON[_0x3710('0x23')](_0x2ffbd8[_0x3710('0x28')])));}})['catch'](function(_0x22c2dd){var _0x199c98=_0x22c2dd[_0x3710('0x29')]||0x1f4;logger[_0x3710('0x28')](_0x3710('0x2a'),_0x3710('0x2b'),_0x199c98,JSON['stringify'](_0x22c2dd));});}function getUser(_0x2da939,_0x4b2b57,_0x1b36fe){if(intUtil[_0x3710('0x2c')](_0x4b2b57)){logger['info'](_0x3710('0x2d'),_0x4b2b57);return request({'method':_0x3710('0x2e'),'uri':util[_0x3710('0x2f')](_0x3710('0x1d'),_0x2da939[_0x3710('0x1e')]),'qs':{'operation':'query','username':_0x2da939[_0x3710('0x20')],'sessionName':_0x1b36fe[_0x3710('0x21')],'query':util[_0x3710('0x2f')](_0x3710('0x30'),_0x4b2b57)},'json':!![]})[_0x3710('0x31')](function(_0x2f5055){if(_0x2f5055[_0x3710('0x24')]&&_0x2f5055[_0x3710('0x26')]['length']){logger['info'](_0x3710('0x32'));return BPromise[_0x3710('0x25')]({'id':_0x2f5055[_0x3710('0x26')][0x0]['id'],'email':_0x2f5055['result'][0x0][_0x3710('0x33')],'name':_0x2f5055['result'][0x0][_0x3710('0x34')]+'\x20'+_0x2f5055[_0x3710('0x26')]['last_name']});}else{logger[_0x3710('0x16')](_0x3710('0x35'));return BPromise[_0x3710('0x25')]({'id':_0x1b36fe[_0x3710('0x36')],'email':_0x2da939['username'],'name':_0x3710('0x37')});}})['catch'](function(_0x24272b){var _0x43b853=_0x24272b[_0x3710('0x29')]||0x1f4;logger[_0x3710('0x28')](_0x3710('0x2a'),_0x3710('0x38'),_0x43b853,JSON[_0x3710('0x23')](_0x24272b));});}else{logger[_0x3710('0x16')](_0x3710('0x35'));return BPromise[_0x3710('0x25')]({'id':_0x1b36fe[_0x3710('0x36')],'email':_0x2da939[_0x3710('0x20')],'name':'admin'})['catch'](function(_0x36757f){var _0x433524=_0x36757f[_0x3710('0x29')]||0x1f4;logger['error'](_0x3710('0x2a'),_0x3710('0x38'),_0x433524,JSON[_0x3710('0x23')](_0x36757f));});}}function getEndUser(_0x21d325,_0x1dc211,_0x1e739a,_0x50c55e){logger['info'](_0x3710('0x39'),_0x1e739a);return request({'method':_0x3710('0x2e'),'uri':util[_0x3710('0x2f')](_0x3710('0x1d'),_0x21d325['remoteUri']),'qs':{'operation':_0x3710('0x3a'),'username':_0x21d325[_0x3710('0x20')],'sessionName':_0x50c55e['sessionName'],'query':util['format'](_0x3710('0x3b'),_0x1e739a,_0x1e739a,_0x1e739a,_0x1e739a,_0x1e739a)},'json':!![]})[_0x3710('0x31')](function(_0x201685){if(_0x201685[_0x3710('0x24')]&&_0x201685[_0x3710('0x26')][_0x3710('0xa')]){logger[_0x3710('0x16')](_0x3710('0x3c'));return BPromise['resolve']({'id':_0x201685[_0x3710('0x26')][0x0]['id'],'name':_0x201685[_0x3710('0x26')][0x0][_0x3710('0x3d')]+'\x20'+_0x201685['result'][0x0][_0x3710('0x3e')],'phone':_0x1e739a});}else{logger['info'](_0x3710('0x3f'));return request({'method':_0x3710('0x1c'),'uri':util['format'](_0x3710('0x1d'),_0x21d325['remoteUri']),'form':{'operation':_0x3710('0x1f'),'sessionName':_0x50c55e[_0x3710('0x21')],'elementType':'Contacts','element':JSON[_0x3710('0x23')]({'lastname':_0x1dc211,'phone':_0x1e739a,'assigned_user_id':'\x20'})},'json':!![]})[_0x3710('0x31')](function(_0x5d7bf9){logger[_0x3710('0x16')](_0x3710('0x40'));return BPromise[_0x3710('0x25')]({'id':_0x5d7bf9[_0x3710('0x26')]['id'],'name':_0x5d7bf9[_0x3710('0x26')][_0x3710('0x3e')],'phone':_0x5d7bf9['result'][_0x3710('0x41')]});})[_0x3710('0x42')](function(_0xf3f800){var _0x4a7491=_0xf3f800[_0x3710('0x29')]||0x1f4;logger['error'](_0x3710('0x2a'),'getEndUser',_0x4a7491,JSON[_0x3710('0x23')](_0xf3f800));});}});}function getConnection(_0x509ec7){var _0x1d1143=_0x509ec7[_0x3710('0x20')];var _0x32084c=_0x509ec7[_0x3710('0x43')];return request({'method':'GET','uri':util[_0x3710('0x2f')](_0x3710('0x1d'),_0x509ec7[_0x3710('0x1e')]),'qs':{'operation':_0x3710('0x44'),'username':_0x1d1143},'json':!![]})['then'](function(_0x240bea){if(_0x240bea[_0x3710('0x24')]){return request({'method':'POST','uri':util[_0x3710('0x2f')](_0x3710('0x1d'),_0x509ec7[_0x3710('0x1e')]),'form':{'operation':_0x3710('0x45'),'username':_0x1d1143,'accessKey':md5(_0x240bea['result']['token']+_0x32084c)},'json':!![]});}})[_0x3710('0x31')](function(_0xb5a8b2){if(_0xb5a8b2[_0x3710('0x24')]){return BPromise[_0x3710('0x25')](_0xb5a8b2[_0x3710('0x26')]);}else{throw new Error(util['format'](_0x3710('0x46'),_0x509ec7['id']));}})[_0x3710('0x42')](function(_0xae7170){var _0x2aef43=_0xae7170['statusCode']||0x1f4;logger['error'](_0x3710('0x2a'),_0x3710('0x47'),_0x2aef43,JSON[_0x3710('0x23')](_0xae7170));});}function request(_0x37a582){logger[_0x3710('0x16')](_0x3710('0x48'),JSON['stringify'](_0x37a582));return rp(_0x37a582);}exports[_0x3710('0x49')]=function(_0x5d16d9,_0x537706,_0xf5e2c,_0x168d73,_0x4b9c74,_0x169806){var _0xc83791,_0x10a93e,_0x5dba37,_0x11d04d;_0x169806[_0x3710('0x1e')]=intUtil[_0x3710('0x4a')](_0x169806['remoteUri']);if(_0x4b9c74&&_0x4b9c74['monitor_format']){logger[_0x3710('0x16')](_0x3710('0x4b'),'Recording\x20is\x20enabled!');_0x537706[_0x3710('0x4c')]=util[_0x3710('0x2f')](_0x3710('0x4d'),_0x169806[_0x3710('0x4e')],_0x537706[_0x3710('0x4f')],md5(_0x537706['uniqueid']));}else{_0x537706[_0x3710('0x4c')]='';}return getConnection(_0x169806)['then'](function(_0x5cecda){_0x11d04d=_0x5cecda;return getUser(_0x169806,_0x168d73[_0x3710('0x50')],_0x11d04d);})[_0x3710('0x31')](function(_0x29b3b3){_0xc83791=_0x29b3b3;logger[_0x3710('0x16')]('The\x20User\x20ID\x20is:',_0xc83791['id']);return getEndUser(_0x169806,_0x537706[_0x3710('0x51')],_0x537706[_0x3710('0x52')],_0x11d04d);})[_0x3710('0x31')](function(_0x3a8e00){_0x10a93e=_0x3a8e00;logger[_0x3710('0x16')]('The\x20Enduser\x20ID\x20is:',_0x10a93e['id']);return createTicket(_0x169806,_0xc83791,_0x10a93e,_0xf5e2c,_0x537706,_0xf5e2c['Fields'],_0x11d04d);})['then'](function(_0x33f1c4){_0x5dba37=_0x33f1c4;logger[_0x3710('0x16')]('Ticket\x20created!');logger['info'](_0x3710('0x53'),_0x5dba37['id']);var _0x365e6f=util[_0x3710('0x2f')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x169806[_0x3710('0x1e')],_['split'](_0x5dba37['id'],'x')[0x1]);logger[_0x3710('0x16')](_0x3710('0x4b'),_0x3710('0x54'));emit(util[_0x3710('0x2f')](_0x3710('0x55'),_0x168d73[_0x3710('0x14')]),_0x3710('0x56'),{'uri':_0x365e6f});})[_0x3710('0x42')](function(_0x529da4){logger['error'](_0x3710('0x4b'),JSON[_0x3710('0x23')](_0x529da4));});};exports[_0x3710('0x57')]=function(_0x12b0b2,_0x1b9344,_0x41ccff,_0x284932,_0x4c2299,_0x3e5a3f,_0x3596d7){var _0x35ebad,_0x142c5e,_0x36473f,_0x12694a;_0x3e5a3f[_0x3710('0x1e')]=intUtil[_0x3710('0x4a')](_0x3e5a3f['remoteUri']);_0x3e5a3f[_0x3710('0x4e')]=intUtil['stripTrailingSlash'](_0x3e5a3f['serverUrl']);if(_0x3596d7&&_0x3596d7[_0x3710('0x58')]&&_0x3596d7[_0x3710('0x58')]!==_0x3710('0x59')){logger[_0x3710('0x16')](_0x3710('0x5a'),'Recording\x20is\x20enabled!');_0x1b9344[_0x3710('0x4c')]=util['format'](_0x3710('0x4d'),_0x3e5a3f['serverUrl'],_0x1b9344[_0x3710('0x4f')],md5(_0x1b9344[_0x3710('0x4f')]));}return getConnection(_0x3e5a3f)[_0x3710('0x31')](function(_0x10fc68){_0x12694a=_0x10fc68;return getUser(_0x3e5a3f,_0x284932['email'],_0x12694a);})[_0x3710('0x31')](function(_0x2bfdad){_0x35ebad=_0x2bfdad;logger[_0x3710('0x16')](_0x3710('0x5b'),_0x35ebad['id']);return getEndUser(_0x3e5a3f,_0x1b9344['destcalleridname'],_0x1b9344[_0x3710('0x5c')],_0x12694a);})[_0x3710('0x31')](function(_0x2c8522){_0x142c5e=_0x2c8522;logger[_0x3710('0x16')]('The\x20Enduser\x20ID\x20is:',_0x142c5e['id']);return createTicket(_0x3e5a3f,_0x35ebad,_0x142c5e,_0x41ccff,_0x1b9344,_0x41ccff[_0x3710('0x5d')],_0x12694a);})[_0x3710('0x31')](function(_0x15b1bd){_0x36473f=_0x15b1bd;logger[_0x3710('0x16')](_0x3710('0x5e'));logger[_0x3710('0x16')](_0x3710('0x53'),_0x36473f['id']);var _0x25dc5f=util[_0x3710('0x2f')](_0x3710('0x5f'),_0x3e5a3f['remoteUri'],_[_0x3710('0x60')](_0x36473f['id'],'x')[0x1]);logger[_0x3710('0x16')](_0x3710('0x5a'),_0x3710('0x54'));emit(util[_0x3710('0x2f')](_0x3710('0x55'),_0x284932[_0x3710('0x14')]),_0x3710('0x56'),{'uri':_0x25dc5f});})[_0x3710('0x42')](function(_0x38ef5b){logger['error'](_0x3710('0x5a'),JSON[_0x3710('0x23')](_0x38ef5b));});};exports[_0x3710('0x61')]=function(_0x3c9c62,_0x5a51c7,_0xb39ed6,_0x2f6679,_0x234565,_0x506564){var _0x45f177,_0x5b5e2d,_0xadf883,_0x2a7c9c;_0x506564[_0x3710('0x1e')]=intUtil[_0x3710('0x4a')](_0x506564[_0x3710('0x1e')]);_0x506564[_0x3710('0x4e')]=intUtil['stripTrailingSlash'](_0x506564[_0x3710('0x4e')]);if(_0x234565&&_0x234565[_0x3710('0x62')]){logger[_0x3710('0x16')]('['+_0x5a51c7[_0x3710('0x63')][_0x3710('0x64')]()+']','Recording\x20is\x20enabled!');_0x5a51c7[_0x3710('0x4c')]=util[_0x3710('0x2f')](_0x3710('0x4d'),_0x506564[_0x3710('0x4e')],_0x5a51c7[_0x3710('0x4f')],md5(_0x5a51c7[_0x3710('0x4f')]));}else{_0x5a51c7['recordingURL']='';}return getConnection(_0x506564)[_0x3710('0x31')](function(_0x3154af){_0x2a7c9c=_0x3154af;return getUser(_0x506564,'',_0x2a7c9c);})[_0x3710('0x31')](function(_0xa241e3){_0x45f177=_0xa241e3;logger[_0x3710('0x16')](_0x3710('0x5b'),_0x45f177['id']);return getEndUser(_0x506564,_0x5a51c7[_0x3710('0x51')],_0x5a51c7['calleridnum'],_0x2a7c9c);})[_0x3710('0x31')](function(_0x4f3974){_0x5b5e2d=_0x4f3974;logger[_0x3710('0x16')](_0x3710('0x65'),_0x5b5e2d['id']);return createTicket(_0x506564,_0x45f177,_0x5b5e2d,_0xb39ed6,_0x5a51c7,_0xb39ed6[_0x3710('0x5d')],_0x2a7c9c);})[_0x3710('0x31')](function(_0x10d193){_0xadf883=_0x10d193;logger['info'](_0x3710('0x5e'));logger[_0x3710('0x16')](_0x3710('0x53'),_0xadf883['id']);})['catch'](function(_0x1f5257){logger[_0x3710('0x28')]('['+_0x5a51c7[_0x3710('0x63')][_0x3710('0x64')]()+']',JSON[_0x3710('0x23')](_0x1f5257));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js
index 42f83fe..17c4bd4 100644
--- a/server/services/ami/trigger/integration/zendesk.js
+++ b/server/services/ami/trigger/integration/zendesk.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x39cb=['[QUEUE]','Displaying\x20ticket\x20to\x20agent...','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','integrationTab','newTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','map','forEach','type','string','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:'];(function(_0x6133cf,_0x2c8596){var _0x3e5cb5=function(_0xbc7db1){while(--_0xbc7db1){_0x6133cf['push'](_0x6133cf['shift']());}};_0x3e5cb5(++_0x2c8596);}(_0x39cb,0x1bd));var _0xb39c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x39cb[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var rp=require(_0xb39c('0x0'));var md5=require(_0xb39c('0x1'));var util=require('util');var Redis=require(_0xb39c('0x2'));var intUtil=require(_0xb39c('0x3'));var config=require('../../../../config/environment');var logger=require(_0xb39c('0x4'))(_0xb39c('0x5'));config[_0xb39c('0x6')]=_[_0xb39c('0x7')](config[_0xb39c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb39c('0x8'))(new Redis(config[_0xb39c('0x6')]));function emit(_0x40112f,_0x3f2fbe,_0x47d6d7){io['to'](_0x40112f)['emit'](_0x3f2fbe,_0x47d6d7);}var headers={'Content-Type':_0xb39c('0x9'),'Accept':_0xb39c('0x9')};function getTicket(_0x3ffb94,_0x42c6dc,_0x5402b2,_0x4a6f36,_0x5a0dba){logger[_0xb39c('0xa')](_0xb39c('0xb'));return request({'uri':util[_0xb39c('0xc')](_0xb39c('0xd'),_0x3ffb94[_0xb39c('0xe')]),'method':_0xb39c('0xf'),'body':{'ticket':_[_0xb39c('0x10')]({'requester_id':_0x5402b2['id'],'submitter_id':_0x42c6dc?_0x42c6dc['id']:undefined,'assignee_id':_0x42c6dc?_0x42c6dc['id']:undefined,'tags':getTags(_0x4a6f36[_0xb39c('0x11')],'name'),'subject':intUtil[_0xb39c('0x12')](_0x4a6f36[_0xb39c('0x13')],_0x5a0dba,'\x20'),'description':intUtil[_0xb39c('0x12')](_0x4a6f36['Descriptions'],_0x5a0dba,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb39c('0x12')](_0x4a6f36[_0xb39c('0x14')],_0x5a0dba,'\x0a')}},getCustomFields(_0x4a6f36[_0xb39c('0x15')],_0x5a0dba))}})[_0xb39c('0x16')](function(_0x469fa9){logger[_0xb39c('0xa')](_0xb39c('0x17'));return _0x469fa9['ticket'];});}function getUser(_0x316c9b,_0x3223f6){if(intUtil[_0xb39c('0x18')](_0x3223f6)){logger[_0xb39c('0xa')](_0xb39c('0x19'),_0x3223f6);return request({'uri':util[_0xb39c('0xc')](_0xb39c('0x1a'),_0x316c9b[_0xb39c('0xe')]),'qs':{'query':util[_0xb39c('0xc')](_0xb39c('0x1b'),_0x3223f6)}})['then'](function(_0x1d2f49){if(_0x1d2f49[_0xb39c('0x1c')]){logger[_0xb39c('0xa')](_0xb39c('0x1d'));return _['find'](_0x1d2f49[_0xb39c('0x1e')],{'email':_0x3223f6,'role':_0xb39c('0x1f')});}else{logger['info'](_0xb39c('0x20'));return request({'uri':util[_0xb39c('0xc')](_0xb39c('0x21'),_0x316c9b['remoteUri'])})['then'](function(_0x2789fd){logger[_0xb39c('0xa')](_0xb39c('0x22'));return _0x2789fd['user'];});}});}else{logger[_0xb39c('0xa')](_0xb39c('0x20'));return request({'uri':util[_0xb39c('0xc')](_0xb39c('0x21'),_0x316c9b[_0xb39c('0xe')])})['then'](function(_0x3036f5){logger[_0xb39c('0xa')]('Admin\x20account\x20selected.');return _0x3036f5[_0xb39c('0x23')];});}}function getEndUser(_0x4492a4,_0x39116b,_0x12be70){logger[_0xb39c('0xa')]('Searching\x20enduser\x20with\x20phone',_0x12be70);return request({'uri':util[_0xb39c('0xc')](_0xb39c('0x1a'),_0x4492a4[_0xb39c('0xe')]),'qs':{'query':util['format'](_0xb39c('0x24'),_0x12be70)}})[_0xb39c('0x16')](function(_0x52eb5e){var _0x3d08e1;if(_0x52eb5e[_0xb39c('0x1e')][_0xb39c('0x25')]){_0x52eb5e['results']=_[_0xb39c('0x26')](_0x52eb5e[_0xb39c('0x1e')],{'suspended':![],'role':'end-user'});if(_0x52eb5e[_0xb39c('0x1e')]['length']){_0x3d08e1=_[_0xb39c('0x27')](_0x52eb5e[_0xb39c('0x1e')]);}}if(_0x3d08e1){logger[_0xb39c('0xa')](_0xb39c('0x28'));return _0x3d08e1;}else{logger[_0xb39c('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xb39c('0xc')]('%s/users.json',_0x4492a4[_0xb39c('0xe')]),'method':'POST','body':{'user':{'role':_0xb39c('0x29'),'name':util[_0xb39c('0xc')](_0xb39c('0x2a'),_0x39116b||_0x12be70),'phone':_0x12be70}}})[_0xb39c('0x16')](function(_0x4fc7be){logger['info'](_0xb39c('0x2b'));return _0x4fc7be[_0xb39c('0x23')];});}});}function getAuth(_0x4a9184){var _0x1d7f2a;if(_0x4a9184[_0xb39c('0x2c')]===_0xb39c('0x2d')){_0x1d7f2a=util[_0xb39c('0xc')](_0xb39c('0x2e'),_0x4a9184[_0xb39c('0x2f')],_0x4a9184[_0xb39c('0x2d')]);}else if(_0x4a9184[_0xb39c('0x2c')]===_0xb39c('0x30')){_0x1d7f2a=util[_0xb39c('0xc')](_0xb39c('0x31'),_0x4a9184[_0xb39c('0x2f')],_0x4a9184[_0xb39c('0x30')]);}return util[_0xb39c('0xc')](_0xb39c('0x32'),new Buffer(_0x1d7f2a)[_0xb39c('0x33')](_0xb39c('0x34')));}function request(_0x22eda9){logger[_0xb39c('0x35')]('[HTTP]',JSON[_0xb39c('0x36')](_0x22eda9));return rp(_[_0xb39c('0x7')](_0x22eda9,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x56e80a,_0x55e9d9){var _0x22d673=[];if(_0x56e80a&&_0x56e80a[_0xb39c('0x25')]>0x0){_0x22d673=_[_0xb39c('0x37')](_0x56e80a,_0x55e9d9);}return _0x22d673;}function getCustomFields(_0x5522ce,_0x3071dd){var _0x141e70=[];var _0x44afba={'custom_fields':[]};if(_0x5522ce[_0xb39c('0x25')]>0x0){_[_0xb39c('0x38')](_0x5522ce,function(_0x4b51ac){if(_0x4b51ac[_0xb39c('0x39')]===_0xb39c('0x3a')&&_0x4b51ac['nameField']&&!_0x4b51ac[_0xb39c('0x3b')]){_0x44afba[_0x4b51ac['nameField'][_0xb39c('0x3c')]()]=_0x4b51ac[_0xb39c('0x3d')][_0xb39c('0x33')]();}else if(_0x4b51ac['type']===_0xb39c('0x3a')&&_0x4b51ac[_0xb39c('0x3e')]&&_0x4b51ac[_0xb39c('0x3b')]){_0x44afba[_0xb39c('0x3f')][_0xb39c('0x40')]({'id':_0x4b51ac[_0xb39c('0x3e')],'value':_0x4b51ac[_0xb39c('0x3d')][_0xb39c('0x33')]()});}else if(_0x4b51ac[_0xb39c('0x39')]===_0xb39c('0x41')&&_0x4b51ac[_0xb39c('0x42')]&&_0x4b51ac[_0xb39c('0x3e')]&&_0x4b51ac['customField']){_0x3071dd[_0x4b51ac[_0xb39c('0x42')]]&&_0x44afba[_0xb39c('0x3f')][_0xb39c('0x40')]({'id':_0x4b51ac[_0xb39c('0x3e')],'value':_0x3071dd[_0x4b51ac[_0xb39c('0x42')]][_0xb39c('0x33')]()});}else if(_0x4b51ac[_0xb39c('0x39')]===_0xb39c('0x43')&&_0x4b51ac[_0xb39c('0x44')]&&_0x4b51ac['Variable']['name']&&_0x4b51ac[_0xb39c('0x3e')]&&_0x4b51ac[_0xb39c('0x3b')]){_0x3071dd[_0x4b51ac['Variable']['name'][_0xb39c('0x3c')]()]&&_0x44afba['custom_fields'][_0xb39c('0x40')]({'id':_0x4b51ac[_0xb39c('0x3e')],'value':_0x3071dd[_0x4b51ac[_0xb39c('0x44')][_0xb39c('0x45')][_0xb39c('0x3c')]()]['toString']()});}});}return _0x44afba;}exports[_0xb39c('0x46')]=function(_0x1d729a,_0x4d2a47,_0x494e6d,_0x2f2fce,_0x53408c,_0x5470f1){var _0x20a5c4,_0x2ff5ac;_0x5470f1[_0xb39c('0xe')]=intUtil[_0xb39c('0x47')](_0x5470f1[_0xb39c('0xe')]);_0x5470f1[_0xb39c('0x48')]=intUtil[_0xb39c('0x47')](_0x5470f1[_0xb39c('0x48')]);if(_0x53408c&&_0x53408c[_0xb39c('0x49')]){logger[_0xb39c('0xa')]('[QUEUE]',_0xb39c('0x4a'));_0x4d2a47[_0xb39c('0x4b')]=util[_0xb39c('0xc')](_0xb39c('0x4c'),_0x5470f1[_0xb39c('0x48')],_0x4d2a47[_0xb39c('0x4d')],md5(_0x4d2a47[_0xb39c('0x4d')]));}else{_0x4d2a47[_0xb39c('0x4b')]='';}headers[_0xb39c('0x4e')]=getAuth(_0x5470f1);return getUser(_0x5470f1,_0x2f2fce[_0xb39c('0x4f')])[_0xb39c('0x16')](function(_0x2df60d){_0x20a5c4=_0x2df60d;logger[_0xb39c('0xa')](_0xb39c('0x50'),_0x20a5c4['id']);return getEndUser(_0x5470f1,_0x4d2a47[_0xb39c('0x51')],_0x4d2a47[_0xb39c('0x52')]);})['then'](function(_0x283acf){_0x2ff5ac=_0x283acf;logger[_0xb39c('0xa')](_0xb39c('0x53'),_0x2ff5ac['id']);return getTicket(_0x5470f1,_0x20a5c4,_0x2ff5ac,_0x494e6d,_0x4d2a47);})[_0xb39c('0x16')](function(_0xa50077){if(_0xa50077){logger[_0xb39c('0xa')](_0xb39c('0x54'),_0xa50077['id']);switch(_0x5470f1[_0xb39c('0x39')]){case'integrationTab':logger['info'](_0xb39c('0x55'),_0xb39c('0x56'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5470f1[_0xb39c('0xe')],_0x20a5c4['id'],_0xa50077['id']),'method':_0xb39c('0xf')});case'newTab':logger[_0xb39c('0xa')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb39c('0xc')]('user:%s',_0x2f2fce[_0xb39c('0x45')]),_0xb39c('0x57'),{'uri':util[_0xb39c('0xc')](_0xb39c('0x58'),_0x5470f1[_0xb39c('0xe')],_0xa50077['id'])});break;default:logger[_0xb39c('0x59')]('[QUEUE]',_0xb39c('0x5a'));}}})[_0xb39c('0x5b')](function(_0x1c6d75){logger[_0xb39c('0x59')](_0xb39c('0x5c'),util['inspect'](_0x1c6d75,{'showHidden':!![],'depth':null}));});};exports[_0xb39c('0x5d')]=function(_0x4ab58e,_0x1caea1,_0x2f537f,_0x131cb2,_0x9e4e89,_0x41305a,_0x24a2d6){var _0x3fd1ec,_0x31bedc;_0x41305a[_0xb39c('0xe')]=intUtil[_0xb39c('0x47')](_0x41305a[_0xb39c('0xe')]);_0x41305a[_0xb39c('0x48')]=intUtil[_0xb39c('0x47')](_0x41305a[_0xb39c('0x48')]);if(_0x24a2d6&&_0x24a2d6[_0xb39c('0x5e')]&&_0x24a2d6[_0xb39c('0x5e')]!==_0xb39c('0x5f')){logger[_0xb39c('0xa')](_0xb39c('0x60'),'Recording\x20is\x20enabled!');_0x1caea1['recordingURL']=util[_0xb39c('0xc')](_0xb39c('0x4c'),_0x41305a['serverUrl'],_0x1caea1[_0xb39c('0x4d')],md5(_0x1caea1[_0xb39c('0x4d')]));}headers['Authorization']=getAuth(_0x41305a);return getUser(_0x41305a,_0x131cb2[_0xb39c('0x4f')])[_0xb39c('0x16')](function(_0x129d1f){_0x3fd1ec=_0x129d1f;logger[_0xb39c('0xa')](_0xb39c('0x50'),_0x3fd1ec['id']);return getEndUser(_0x41305a,_0x1caea1[_0xb39c('0x61')],_0x1caea1['destcalleridnum']);})[_0xb39c('0x16')](function(_0x384f4f){_0x31bedc=_0x384f4f;logger[_0xb39c('0xa')](_0xb39c('0x53'),_0x31bedc['id']);return getTicket(_0x41305a,_0x3fd1ec,_0x31bedc,_0x2f537f,_0x1caea1);})[_0xb39c('0x16')](function(_0x1d0fbf){if(_0x1d0fbf){logger[_0xb39c('0xa')]('The\x20Ticket\x20ID\x20is:',_0x1d0fbf['id']);switch(_0x41305a[_0xb39c('0x39')]){case _0xb39c('0x62'):logger[_0xb39c('0xa')](_0xb39c('0x60'),_0xb39c('0x56'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x41305a[_0xb39c('0xe')],_0x3fd1ec['id'],_0x1d0fbf['id']),'method':_0xb39c('0xf')});case _0xb39c('0x63'):logger['info'](_0xb39c('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb39c('0xc')]('user:%s',_0x131cb2[_0xb39c('0x45')]),_0xb39c('0x57'),{'uri':util[_0xb39c('0xc')]('%s/agent/tickets/%s',_0x41305a[_0xb39c('0xe')],_0x1d0fbf['id'])});break;default:logger[_0xb39c('0x59')](_0xb39c('0x60'),_0xb39c('0x5a'));}}})[_0xb39c('0x5b')](function(_0x31f8be){logger[_0xb39c('0x59')](_0xb39c('0x64'),util[_0xb39c('0x65')](_0x31f8be,{'showHidden':!![],'depth':null}));});};exports[_0xb39c('0x66')]=function(_0x34127d,_0x227152,_0x3fb267,_0x4522cf,_0x1b2138,_0x31b9c1){var _0x451b48,_0x58fbe0;_0x31b9c1[_0xb39c('0xe')]=intUtil[_0xb39c('0x47')](_0x31b9c1[_0xb39c('0xe')]);_0x31b9c1['serverUrl']=intUtil[_0xb39c('0x47')](_0x31b9c1['serverUrl']);if(_0x1b2138&&_0x1b2138['monitor_format']){logger[_0xb39c('0xa')]('['+_0x227152[_0xb39c('0x67')][_0xb39c('0x68')]()+']',_0xb39c('0x4a'));_0x227152[_0xb39c('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x31b9c1[_0xb39c('0x48')],_0x227152[_0xb39c('0x4d')],md5(_0x227152['uniqueid']));}else{_0x227152[_0xb39c('0x4b')]='';}headers[_0xb39c('0x4e')]=getAuth(_0x31b9c1);return getUser(_0x31b9c1)[_0xb39c('0x16')](function(_0x32acb6){_0x451b48=_0x32acb6;logger[_0xb39c('0xa')](_0xb39c('0x50'),_0x451b48['id']);return getEndUser(_0x31b9c1,_0x227152[_0xb39c('0x51')],_0x227152[_0xb39c('0x52')]);})[_0xb39c('0x16')](function(_0x2f7fc1){_0x58fbe0=_0x2f7fc1;logger[_0xb39c('0xa')](_0xb39c('0x53'),_0x58fbe0['id']);return getTicket(_0x31b9c1,_0x451b48,_0x58fbe0,_0x3fb267,_0x227152);})[_0xb39c('0x16')](function(_0x12f02d){if(_0x12f02d){logger[_0xb39c('0xa')]('The\x20Ticket\x20ID\x20is:',_0x12f02d['id']);}})[_0xb39c('0x5b')](function(_0x5c901f){logger[_0xb39c('0x59')]('['+_0x227152[_0xb39c('0x67')]['toUpperCase']()+']'+_0xb39c('0x69'),util[_0xb39c('0x65')](_0x5c901f,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x823c=['./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','results','agent','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','nameField','customField','toLowerCase','content','type','string','idField','variableName','custom_fields','push','customVariable','Variable','queue','serverUrl','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','stripTrailingSlash','recordingFormat','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','newTab','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','toUpperCase','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis'];(function(_0x4176e3,_0x3ebb36){var _0x4525fb=function(_0x351e10){while(--_0x351e10){_0x4176e3['push'](_0x4176e3['shift']());}};_0x4525fb(++_0x3ebb36);}(_0x823c,0x143));var _0xc823=function(_0x367498,_0x55f797){_0x367498=_0x367498-0x0;var _0x27e31d=_0x823c[_0x367498];return _0x27e31d;};'use strict';var _=require(_0xc823('0x0'));var rp=require('request-promise');var md5=require(_0xc823('0x1'));var util=require(_0xc823('0x2'));var Redis=require(_0xc823('0x3'));var intUtil=require(_0xc823('0x4'));var config=require(_0xc823('0x5'));var logger=require(_0xc823('0x6'))('zendesk');config[_0xc823('0x7')]=_[_0xc823('0x8')](config[_0xc823('0x7')],{'host':_0xc823('0x9'),'port':0x18eb});var io=require(_0xc823('0xa'))(new Redis(config['redis']));function emit(_0xba407e,_0x472007,_0x5daab9){io['to'](_0xba407e)['emit'](_0x472007,_0x5daab9);}var headers={'Content-Type':_0xc823('0xb'),'Accept':_0xc823('0xb')};function getTicket(_0x53d48d,_0x43bbd8,_0x2716a0,_0x5c214c,_0x4dbd5b){logger[_0xc823('0xc')](_0xc823('0xd'));return request({'uri':util[_0xc823('0xe')](_0xc823('0xf'),_0x53d48d[_0xc823('0x10')]),'method':'POST','body':{'ticket':_[_0xc823('0x11')]({'requester_id':_0x2716a0['id'],'submitter_id':_0x43bbd8?_0x43bbd8['id']:undefined,'assignee_id':_0x43bbd8?_0x43bbd8['id']:undefined,'tags':getTags(_0x5c214c[_0xc823('0x12')],_0xc823('0x13')),'subject':intUtil[_0xc823('0x14')](_0x5c214c[_0xc823('0x15')],_0x4dbd5b,'\x20'),'description':intUtil[_0xc823('0x14')](_0x5c214c['Descriptions'],_0x4dbd5b,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc823('0x14')](_0x5c214c[_0xc823('0x16')],_0x4dbd5b,'\x0a')}},getCustomFields(_0x5c214c[_0xc823('0x17')],_0x4dbd5b))}})[_0xc823('0x18')](function(_0x55b31d){logger['info']('Ticket\x20created!');return _0x55b31d['ticket'];});}function getUser(_0x565aeb,_0x5d3521){if(intUtil[_0xc823('0x19')](_0x5d3521)){logger[_0xc823('0xc')](_0xc823('0x1a'),_0x5d3521);return request({'uri':util[_0xc823('0xe')](_0xc823('0x1b'),_0x565aeb[_0xc823('0x10')]),'qs':{'query':util[_0xc823('0xe')]('type:user\x20role:agent\x20email:%s',_0x5d3521)}})[_0xc823('0x18')](function(_0x4a713a){if(_0x4a713a[_0xc823('0x1c')]){logger[_0xc823('0xc')](_0xc823('0x1d'));return _['find'](_0x4a713a[_0xc823('0x1e')],{'email':_0x5d3521,'role':_0xc823('0x1f')});}else{logger[_0xc823('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc823('0xe')](_0xc823('0x20'),_0x565aeb[_0xc823('0x10')])})[_0xc823('0x18')](function(_0x574c76){logger[_0xc823('0xc')]('Admin\x20account\x20selected.');return _0x574c76[_0xc823('0x21')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc823('0xe')](_0xc823('0x20'),_0x565aeb['remoteUri'])})[_0xc823('0x18')](function(_0x2fb616){logger[_0xc823('0xc')](_0xc823('0x22'));return _0x2fb616[_0xc823('0x21')];});}}function getEndUser(_0x8d6161,_0x19594e,_0xb501ac){logger[_0xc823('0xc')](_0xc823('0x23'),_0xb501ac);return request({'uri':util['format'](_0xc823('0x1b'),_0x8d6161['remoteUri']),'qs':{'query':util['format'](_0xc823('0x24'),_0xb501ac)}})[_0xc823('0x18')](function(_0x1c79dd){var _0x2d60ee;if(_0x1c79dd[_0xc823('0x1e')][_0xc823('0x25')]){_0x1c79dd[_0xc823('0x1e')]=_[_0xc823('0x26')](_0x1c79dd[_0xc823('0x1e')],{'suspended':![],'role':_0xc823('0x27')});if(_0x1c79dd[_0xc823('0x1e')][_0xc823('0x25')]){_0x2d60ee=_[_0xc823('0x28')](_0x1c79dd[_0xc823('0x1e')]);}}if(_0x2d60ee){logger[_0xc823('0xc')]('Enduser\x20found!');return _0x2d60ee;}else{logger[_0xc823('0xc')](_0xc823('0x29'));return request({'uri':util[_0xc823('0xe')](_0xc823('0x2a'),_0x8d6161[_0xc823('0x10')]),'method':'POST','body':{'user':{'role':'end-user','name':util['format'](_0xc823('0x2b'),_0x19594e||_0xb501ac),'phone':_0xb501ac}}})[_0xc823('0x18')](function(_0x20b4e7){logger[_0xc823('0xc')]('Enduser\x20created.');return _0x20b4e7[_0xc823('0x21')];});}});}function getAuth(_0x3f428f){var _0x36cf71;if(_0x3f428f[_0xc823('0x2c')]===_0xc823('0x2d')){_0x36cf71=util[_0xc823('0xe')](_0xc823('0x2e'),_0x3f428f[_0xc823('0x2f')],_0x3f428f[_0xc823('0x2d')]);}else if(_0x3f428f[_0xc823('0x2c')]===_0xc823('0x30')){_0x36cf71=util[_0xc823('0xe')](_0xc823('0x31'),_0x3f428f['username'],_0x3f428f[_0xc823('0x30')]);}return util[_0xc823('0xe')](_0xc823('0x32'),new Buffer(_0x36cf71)[_0xc823('0x33')](_0xc823('0x34')));}function request(_0xbdd15e){logger['debug'](_0xc823('0x35'),JSON[_0xc823('0x36')](_0xbdd15e));return rp(_['defaults'](_0xbdd15e,{'method':_0xc823('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x5f215f,_0x114045){var _0x970ceb=[];if(_0x5f215f&&_0x5f215f['length']>0x0){_0x970ceb=_[_0xc823('0x38')](_0x5f215f,_0x114045);}return _0x970ceb;}function getCustomFields(_0x27bb6c,_0x37aaf4){var _0x22eae8=[];var _0x3a2977={'custom_fields':[]};if(_0x27bb6c[_0xc823('0x25')]>0x0){_[_0xc823('0x39')](_0x27bb6c,function(_0x51b2b3){if(_0x51b2b3['type']==='string'&&_0x51b2b3[_0xc823('0x3a')]&&!_0x51b2b3[_0xc823('0x3b')]){_0x3a2977[_0x51b2b3[_0xc823('0x3a')][_0xc823('0x3c')]()]=_0x51b2b3[_0xc823('0x3d')]['toString']();}else if(_0x51b2b3[_0xc823('0x3e')]===_0xc823('0x3f')&&_0x51b2b3[_0xc823('0x40')]&&_0x51b2b3[_0xc823('0x3b')]){_0x3a2977['custom_fields']['push']({'id':_0x51b2b3['idField'],'value':_0x51b2b3[_0xc823('0x3d')][_0xc823('0x33')]()});}else if(_0x51b2b3[_0xc823('0x3e')]==='variable'&&_0x51b2b3[_0xc823('0x41')]&&_0x51b2b3['idField']&&_0x51b2b3[_0xc823('0x3b')]){_0x37aaf4[_0x51b2b3[_0xc823('0x41')]]&&_0x3a2977[_0xc823('0x42')][_0xc823('0x43')]({'id':_0x51b2b3[_0xc823('0x40')],'value':_0x37aaf4[_0x51b2b3[_0xc823('0x41')]][_0xc823('0x33')]()});}else if(_0x51b2b3['type']===_0xc823('0x44')&&_0x51b2b3['Variable']&&_0x51b2b3[_0xc823('0x45')][_0xc823('0x13')]&&_0x51b2b3[_0xc823('0x40')]&&_0x51b2b3[_0xc823('0x3b')]){_0x37aaf4[_0x51b2b3[_0xc823('0x45')][_0xc823('0x13')][_0xc823('0x3c')]()]&&_0x3a2977[_0xc823('0x42')]['push']({'id':_0x51b2b3[_0xc823('0x40')],'value':_0x37aaf4[_0x51b2b3[_0xc823('0x45')]['name'][_0xc823('0x3c')]()][_0xc823('0x33')]()});}});}return _0x3a2977;}exports[_0xc823('0x46')]=function(_0x455cd0,_0x2d6206,_0x336eea,_0x180f2e,_0x12a665,_0xf1f0e9){var _0x51a0d3,_0x153ca1;_0xf1f0e9[_0xc823('0x10')]=intUtil['stripTrailingSlash'](_0xf1f0e9[_0xc823('0x10')]);_0xf1f0e9[_0xc823('0x47')]=intUtil['stripTrailingSlash'](_0xf1f0e9[_0xc823('0x47')]);if(_0x12a665&&_0x12a665['monitor_format']){logger[_0xc823('0xc')](_0xc823('0x48'),'Recording\x20is\x20enabled!');_0x2d6206['recordingURL']=util[_0xc823('0xe')](_0xc823('0x49'),_0xf1f0e9[_0xc823('0x47')],_0x2d6206[_0xc823('0x4a')],md5(_0x2d6206[_0xc823('0x4a')]));}else{_0x2d6206[_0xc823('0x4b')]='';}headers[_0xc823('0x4c')]=getAuth(_0xf1f0e9);return getUser(_0xf1f0e9,_0x180f2e[_0xc823('0x4d')])['then'](function(_0x2051e7){_0x51a0d3=_0x2051e7;logger[_0xc823('0xc')]('The\x20User\x20ID\x20is:',_0x51a0d3['id']);return getEndUser(_0xf1f0e9,_0x2d6206['calleridname'],_0x2d6206[_0xc823('0x4e')]);})['then'](function(_0x491928){_0x153ca1=_0x491928;logger['info']('The\x20Enduser\x20ID\x20is:',_0x153ca1['id']);return getTicket(_0xf1f0e9,_0x51a0d3,_0x153ca1,_0x336eea,_0x2d6206);})['then'](function(_0x511d71){if(_0x511d71){logger[_0xc823('0xc')]('The\x20Ticket\x20ID\x20is:',_0x511d71['id']);switch(_0xf1f0e9['type']){case _0xc823('0x4f'):logger['info'](_0xc823('0x48'),_0xc823('0x50'));return request({'uri':util['format'](_0xc823('0x51'),_0xf1f0e9[_0xc823('0x10')],_0x51a0d3['id'],_0x511d71['id']),'method':_0xc823('0x52')});case'newTab':logger['info'](_0xc823('0x48'),_0xc823('0x53'));emit(util['format'](_0xc823('0x54'),_0x180f2e[_0xc823('0x13')]),_0xc823('0x55'),{'uri':util['format'](_0xc823('0x56'),_0xf1f0e9[_0xc823('0x10')],_0x511d71['id'])});break;default:logger[_0xc823('0x57')](_0xc823('0x48'),_0xc823('0x58'));}}})[_0xc823('0x59')](function(_0xe53fb5){logger['error'](_0xc823('0x5a'),util[_0xc823('0x5b')](_0xe53fb5,{'showHidden':!![],'depth':null}));});};exports[_0xc823('0x5c')]=function(_0x31170b,_0x491cd9,_0x31ba31,_0x37d7b4,_0x5e7527,_0x219c6d,_0x2fd2df){var _0x1fe516,_0x991669;_0x219c6d[_0xc823('0x10')]=intUtil[_0xc823('0x5d')](_0x219c6d['remoteUri']);_0x219c6d[_0xc823('0x47')]=intUtil['stripTrailingSlash'](_0x219c6d['serverUrl']);if(_0x2fd2df&&_0x2fd2df['recordingFormat']&&_0x2fd2df[_0xc823('0x5e')]!=='none'){logger[_0xc823('0xc')]('[OUTBOUND]',_0xc823('0x5f'));_0x491cd9[_0xc823('0x4b')]=util['format'](_0xc823('0x49'),_0x219c6d['serverUrl'],_0x491cd9['uniqueid'],md5(_0x491cd9[_0xc823('0x4a')]));}headers['Authorization']=getAuth(_0x219c6d);return getUser(_0x219c6d,_0x37d7b4[_0xc823('0x4d')])['then'](function(_0x403c0e){_0x1fe516=_0x403c0e;logger[_0xc823('0xc')]('The\x20User\x20ID\x20is:',_0x1fe516['id']);return getEndUser(_0x219c6d,_0x491cd9[_0xc823('0x60')],_0x491cd9[_0xc823('0x61')]);})[_0xc823('0x18')](function(_0x218b3c){_0x991669=_0x218b3c;logger['info']('The\x20Enduser\x20ID\x20is:',_0x991669['id']);return getTicket(_0x219c6d,_0x1fe516,_0x991669,_0x31ba31,_0x491cd9);})[_0xc823('0x18')](function(_0x4cb43e){if(_0x4cb43e){logger[_0xc823('0xc')](_0xc823('0x62'),_0x4cb43e['id']);switch(_0x219c6d[_0xc823('0x3e')]){case _0xc823('0x4f'):logger[_0xc823('0xc')]('[OUTBOUND]',_0xc823('0x50'));return request({'uri':util['format'](_0xc823('0x51'),_0x219c6d[_0xc823('0x10')],_0x1fe516['id'],_0x4cb43e['id']),'method':'POST'});case _0xc823('0x63'):logger['info'](_0xc823('0x64'),_0xc823('0x53'));emit(util[_0xc823('0xe')](_0xc823('0x54'),_0x37d7b4['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x219c6d['remoteUri'],_0x4cb43e['id'])});break;default:logger[_0xc823('0x57')](_0xc823('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x2cbd33){logger[_0xc823('0x57')](_0xc823('0x65'),util[_0xc823('0x5b')](_0x2cbd33,{'showHidden':!![],'depth':null}));});};exports[_0xc823('0x66')]=function(_0x3f0385,_0x2b0bdf,_0x5106d6,_0x32b4b9,_0x371707,_0x3589f6){var _0x4ac00f,_0x544860;_0x3589f6['remoteUri']=intUtil[_0xc823('0x5d')](_0x3589f6[_0xc823('0x10')]);_0x3589f6['serverUrl']=intUtil[_0xc823('0x5d')](_0x3589f6[_0xc823('0x47')]);if(_0x371707&&_0x371707[_0xc823('0x67')]){logger[_0xc823('0xc')]('['+_0x2b0bdf['lastevent'][_0xc823('0x68')]()+']',_0xc823('0x5f'));_0x2b0bdf[_0xc823('0x4b')]=util['format'](_0xc823('0x49'),_0x3589f6[_0xc823('0x47')],_0x2b0bdf['uniqueid'],md5(_0x2b0bdf[_0xc823('0x4a')]));}else{_0x2b0bdf[_0xc823('0x4b')]='';}headers['Authorization']=getAuth(_0x3589f6);return getUser(_0x3589f6)['then'](function(_0x4cd52c){_0x4ac00f=_0x4cd52c;logger[_0xc823('0xc')](_0xc823('0x69'),_0x4ac00f['id']);return getEndUser(_0x3589f6,_0x2b0bdf['calleridname'],_0x2b0bdf[_0xc823('0x4e')]);})[_0xc823('0x18')](function(_0x318f96){_0x544860=_0x318f96;logger[_0xc823('0xc')](_0xc823('0x6a'),_0x544860['id']);return getTicket(_0x3589f6,_0x4ac00f,_0x544860,_0x5106d6,_0x2b0bdf);})[_0xc823('0x18')](function(_0x5e1e27){if(_0x5e1e27){logger[_0xc823('0xc')]('The\x20Ticket\x20ID\x20is:',_0x5e1e27['id']);}})['catch'](function(_0x2d9efb){logger['error']('['+_0x2b0bdf[_0xc823('0x6b')][_0xc823('0x68')]()+']'+_0xc823('0x6c'),util[_0xc823('0x5b')](_0x2d9efb,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js
index 01f5a09..1de1820 100644
--- a/server/services/ami/trigger/integration/zoho.js
+++ b/server/services/ami/trigger/integration/zoho.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x84e5=['seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','https://www.zohoapis.','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','unmanaged','lastevent','toUpperCase','request-promise','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','debug','stringify','forEach','type','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x84e5,0x111));var _0x584e=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x84e5[_0x2eb5bc];return _0x51c7b1;};'use strict';var _=require('lodash');var rp=require(_0x584e('0x0'));var md5=require('md5');var util=require(_0x584e('0x1'));var intUtil=require(_0x584e('0x2'));var moment=require(_0x584e('0x3'));var Redis=require(_0x584e('0x4'));var BPromise=require('bluebird');var config=require(_0x584e('0x5'));var logger=require(_0x584e('0x6'))(_0x584e('0x7'));config[_0x584e('0x8')]=_[_0x584e('0x9')](config[_0x584e('0x8')],{'host':_0x584e('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x584e('0x8')]));function emit(_0x4db377,_0x7653b8,_0xf37c79){io['to'](_0x4db377)['emit'](_0x7653b8,_0xf37c79);}function request(_0x5a3795){logger[_0x584e('0xb')]('[HTTP]',JSON[_0x584e('0xc')](_0x5a3795));return rp(_0x5a3795);}function getCustomFields(_0x4fd6fe,_0x3ce180){var _0x1fa193={};if(_0x4fd6fe['length']>0x0){_[_0x584e('0xd')](_0x4fd6fe,function(_0x268c26){if(_0x268c26[_0x584e('0xe')]===_0x584e('0xf')&&_0x268c26[_0x584e('0x10')]){_0x1fa193[_0x268c26[_0x584e('0x10')]]=_0x268c26[_0x584e('0x11')][_0x584e('0x12')]();}else if(_0x268c26['type']===_0x584e('0x13')&&_0x268c26['variableName']&&_0x268c26[_0x584e('0x10')]&&_0x3ce180[_0x268c26[_0x584e('0x14')]]){_0x1fa193[_0x268c26[_0x584e('0x10')]]=_0x3ce180[_0x268c26['variableName']][_0x584e('0x12')]();}else if(_0x268c26['type']==='customVariable'&&_0x268c26[_0x584e('0x15')]&&_0x268c26['Variable'][_0x584e('0x16')]&&_0x268c26[_0x584e('0x10')]&&_0x3ce180[_0x268c26[_0x584e('0x15')][_0x584e('0x16')][_0x584e('0x17')]()]){_0x1fa193[_0x268c26[_0x584e('0x10')]]=_0x3ce180[_0x268c26[_0x584e('0x15')]['name']['toLowerCase']()]['toString']();}});}return _0x1fa193;}function getName(_0x153dc2){if(_0x153dc2['indexOf']('\x20')>0x0){var _0x207313=_0x153dc2[_0x584e('0x18')](/ (.+)/);if(_0x207313[0x1]){return _0x207313;}}return[_0x153dc2,_0x153dc2];}var accountsTokens={};function getAccessToken(_0x4db9de){return new Promise(function(_0x3f10ad,_0x57df72){if(!_[_0x584e('0x19')](accountsTokens[_0x4db9de['id']])&&!_[_0x584e('0x19')](accountsTokens[_0x4db9de['id']][_0x584e('0x1a')])){if(moment()[_0x584e('0x1b')](accountsTokens[_0x4db9de['id']][_0x584e('0x1c')])){_0x3f10ad(accountsTokens[_0x4db9de['id']][_0x584e('0x1a')]);}}var _0x5a8cc1;switch(_0x4db9de[_0x584e('0x1d')]){case'US':_0x5a8cc1=_0x584e('0x1e');break;case'AU':_0x5a8cc1=_0x584e('0x1f');break;case'EU':_0x5a8cc1=_0x584e('0x20');break;case'IN':_0x5a8cc1=_0x584e('0x21');break;case'CN':_0x5a8cc1=_0x584e('0x22');break;default:_0x5a8cc1=_0x584e('0x20');break;}var _0x35794f={'method':_0x584e('0x23'),'uri':_0x5a8cc1+_0x584e('0x24'),'qs':{'refresh_token':_0x4db9de[_0x584e('0x25')],'client_id':_0x4db9de[_0x584e('0x26')],'client_secret':_0x4db9de[_0x584e('0x27')],'grant_type':_0x584e('0x28')},'json':!![]};return rp(_0x35794f)['then'](function(_0x15ce87){accountsTokens[_0x4db9de['id']]={'access_token':_0x15ce87[_0x584e('0x1a')],'expires_in':moment()['add'](_0x15ce87['expires_in'],_0x584e('0x29'))};_0x3f10ad(_0x15ce87[_0x584e('0x1a')]);})[_0x584e('0x2a')](function(_0x492258){logger[_0x584e('0x2b')](_0x584e('0x2c'),_0x492258[_0x584e('0x2d')]);_0x57df72(_0x492258);});});}function getUser(_0x1f3105,_0x5e0578,_0x1a5bc,_0x75b8d0){logger['info'](_0x584e('0x2e'));return request({'method':_0x584e('0x2f'),'uri':util[_0x584e('0x30')](_0x584e('0x31'),_0x5e0578),'qs':{'type':_0x584e('0x32')},'headers':{'Authorization':_0x584e('0x33')+_0x1f3105},'json':!![]})[_0x584e('0x34')](function(_0x48de53){if(_0x48de53[_0x584e('0x35')]){var _0x19753a=-0x1;if(_[_0x584e('0x36')](_0x48de53['users'])){if(!_['isNil'](_0x75b8d0)){_0x19753a=_[_0x584e('0x37')](_0x48de53[_0x584e('0x35')],function(_0x183078){return _0x183078[_0x584e('0x38')]===_0x75b8d0;});}if(_0x19753a>=0x0){logger[_0x584e('0x39')](_0x584e('0x3a'));}else{logger[_0x584e('0x39')](_0x584e('0x3b'));_0x19753a=_['findIndex'](_0x48de53[_0x584e('0x35')],function(_0x2ed086){return _0x2ed086[_0x584e('0x3c')][_0x584e('0x16')]===_0x584e('0x3d');});}return _0x48de53['users'][_0x19753a];}else{if(_0x48de53[_0x584e('0x3e')][_0x584e('0x3c')][_0x584e('0x16')]===_0x584e('0x3d')){logger[_0x584e('0x39')]('Using\x20the\x20admin\x20account!');user=_0x48de53[_0x584e('0x3e')];return user;}else{logger['error'](_0x584e('0x3f'),JSON[_0x584e('0xc')](_0x48de53));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x48de53));}}}else{logger[_0x584e('0x2b')](_0x584e('0x3f'),JSON[_0x584e('0xc')](_0x48de53));throw new Error(_0x584e('0x40')+JSON[_0x584e('0xc')](_0x48de53));}})[_0x584e('0x2a')](function(_0x4285e7){console['error'](_0x4285e7);});}function getZohoUser(_0x22cf93,_0x17467b){return new BPromise(function(_0x490db5,_0x365b3d){request(_0x22cf93)['then'](function(_0x479004){var _0xaf1589=null;if(_0x479004){_0xaf1589=_0x479004[_0x584e('0x41')][0x0];_0xaf1589[_0x584e('0x42')]=_0x17467b;}_0x490db5(_0xaf1589);})[_0x584e('0x2a')](function(_0x4fe50b){_0x365b3d(_0x4fe50b);});});}function createEndUser(_0x362549,_0x5a05b2,_0x593334,_0x3a5f0c,_0x4f079c,_0x1de30d){var _0x593334=getName(_0x593334);return request({'method':_0x584e('0x23'),'uri':'https://www.zohoapis.'+_0x5a05b2+_0x584e('0x43')+_[_0x584e('0x44')](_0x1de30d[_0x584e('0x45')])+'s','body':{'data':[{'Last_Name':_0x593334[0x1],'First_Name':_0x593334[0x0],'Phone':_0x3a5f0c,'Owner':{'name':!_[_0x584e('0x19')](_0x4f079c[_0x584e('0x46')][_0x584e('0x16')])?_0x4f079c[_0x584e('0x46')][_0x584e('0x16')]:!_[_0x584e('0x19')](_0x4f079c['first_name'])?_0x4f079c[_0x584e('0x47')]+'\x20'+_0x4f079c[_0x584e('0x48')]:_0x4f079c[_0x584e('0x48')],'id':_0x4f079c['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x362549},'json':!![]})[_0x584e('0x34')](function(_0x5c87e6){if(_0x5c87e6&&_0x5c87e6[_0x584e('0x41')][0x0][_0x584e('0x49')]===_0x584e('0x4a')){var _0x51f6c6=_0x5c87e6['data'][0x0][_0x584e('0x4b')];_0x51f6c6[_0x584e('0x42')]=_[_0x584e('0x44')](_0x1de30d[_0x584e('0x45')])+'s';return _0x51f6c6;}logger[_0x584e('0x2b')](_0x584e('0x3f'),JSON[_0x584e('0xc')](data));throw new Error(_0x584e('0x4c')+JSON[_0x584e('0xc')](data));})[_0x584e('0x2a')](function(_0x33cca2){console[_0x584e('0x4d')](_0x584e('0x4e'),_0x33cca2);});}function getEndUser(_0x2742d4,_0x1cf41d,_0x597f3b,_0x2b5dfc,_0x1384e3,_0x29b7db,_0x4606ad){var _0x4763ef={'method':_0x584e('0x2f'),'uri':'','headers':{'Authorization':_0x584e('0x33')+_0x2742d4},'json':!![]};switch(_0x4606ad['moduleSearch']){case _0x584e('0x4f'):_0x4763ef['uri']='https://www.zohoapis.'+_0x1cf41d+_0x584e('0x50')+_0x1384e3+'))';return getZohoUser(_0x4763ef,_0x584e('0x51'))['then'](function(_0x2ca287){if(_0x2ca287)return _0x2ca287;_0x4763ef[_0x584e('0x52')]='https://www.zohoapis.'+_0x1cf41d+_0x584e('0x53')+_0x1384e3+'))';return getZohoUser(_0x4763ef,'Leads')[_0x584e('0x34')](function(_0x311f00){if(_0x311f00)return _0x311f00;if(_0x4606ad['moduleCreate']!=_0x584e('0x54')){return createEndUser(_0x2742d4,_0x1cf41d,_0x2b5dfc,_0x1384e3,_0x29b7db,_0x4606ad);}else{return{};}});});break;case _0x584e('0x55'):_0x4763ef['uri']=_0x584e('0x56')+_0x1cf41d+_0x584e('0x50')+_0x1384e3+'))';return getZohoUser(_0x4763ef,_0x584e('0x51'))[_0x584e('0x34')](function(_0x3017ed){if(_0x3017ed)return _0x3017ed;if(_0x4606ad['moduleCreate']!=_0x584e('0x54')){return createEndUser(_0x2742d4,_0x1cf41d,_0x2b5dfc,_0x1384e3,_0x29b7db,_0x4606ad);}else{return{};}});break;case _0x584e('0x57'):_0x4763ef[_0x584e('0x52')]='https://www.zohoapis.'+_0x1cf41d+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1384e3+'))';return getZohoUser(_0x4763ef,_0x584e('0x58'))['then'](function(_0x2c5a2e){if(_0x2c5a2e)return _0x2c5a2e;if(_0x4606ad[_0x584e('0x45')]!='nothing'){return createEndUser(_0x2742d4,_0x1cf41d,_0x2b5dfc,_0x1384e3,_0x29b7db,_0x4606ad);}else{return{};}});break;}}function getCall(_0x141ff7,_0x25da46,_0x248196,_0x278b12,_0x894fff,_0x5dcaf4,_0x4243ec,_0x32c0ef){logger[_0x584e('0x39')](_0x584e('0x59'));var _0x2dcca0={};_0x2dcca0[_0x584e('0x5a')]={'name':!_[_0x584e('0x19')](_0x278b12[_0x584e('0x46')][_0x584e('0x16')])&&!_[_0x584e('0x19')](_0x278b12[_0x584e('0x3c')]['name'])&&_0x278b12[_0x584e('0x3c')][_0x584e('0x16')]===_0x584e('0x5b')?_0x278b12[_0x584e('0x46')]['name']:!_['isNil'](_0x278b12['first_name'])?_0x278b12[_0x584e('0x47')]+'\x20'+_0x278b12[_0x584e('0x48')]:_0x278b12[_0x584e('0x48')],'id':_0x278b12['id']};_0x2dcca0[_0x584e('0x5c')]=intUtil[_0x584e('0x5d')](_0x5dcaf4['Subjects'],_0x4243ec,'\x20');_0x2dcca0[_0x584e('0x5e')]=intUtil[_0x584e('0x5d')](_0x5dcaf4['Descriptions'],_0x4243ec,'\x0a');if(_0x894fff[_0x584e('0x42')]===_0x584e('0x51')){_0x2dcca0[_0x584e('0x5f')]={'name':!_[_0x584e('0x19')](_0x894fff['Full_Name'])?_0x894fff[_0x584e('0x60')]:!_['isNil'](_0x894fff['First_Name'])?_0x894fff[_0x584e('0x61')]+'\x20'+_0x894fff[_0x584e('0x62')]:_0x894fff['Last_Name'],'id':_0x894fff['id']};}if(_0x894fff[_0x584e('0x42')]==='Leads'){_0x2dcca0['What_Id']={'name':!_[_0x584e('0x19')](_0x894fff[_0x584e('0x60')])?_0x894fff[_0x584e('0x60')]:!_[_0x584e('0x19')](_0x894fff[_0x584e('0x61')])?_0x894fff[_0x584e('0x61')]+'\x20'+_0x894fff[_0x584e('0x62')]:_0x894fff['Last_Name'],'id':_0x894fff['id']};_0x2dcca0[_0x584e('0x63')]=_['startCase'](_0x894fff[_0x584e('0x42')]);}if(_0x4243ec[_0x584e('0x64')]){_0x2dcca0[_0x584e('0x65')]=moment['utc'](parseInt(_0x4243ec[_0x584e('0x64')])*0x3e8)[_0x584e('0x30')](_0x584e('0x66'));}else if(_0x4243ec[_0x584e('0x67')]&&_0x4243ec[_0x584e('0x68')]){_0x2dcca0['Call_Duration']=moment[_0x584e('0x69')](moment(_0x4243ec[_0x584e('0x68')],_0x584e('0x6a'))[_0x584e('0x6b')](moment(_0x4243ec[_0x584e('0x6c')],_0x584e('0x6a'))))[_0x584e('0x30')](_0x584e('0x66'));}switch(_0x4243ec['lastevent']){case _0x584e('0x6d'):_0x2dcca0[_0x584e('0x6e')]=_0x584e('0x6f');break;case _0x584e('0x70'):case _0x584e('0x71'):_0x2dcca0[_0x584e('0x6e')]=_0x584e('0x72');break;case _0x584e('0x73'):_0x2dcca0['Call_Result']=_0x584e('0x74');break;case'abandoned':_0x2dcca0[_0x584e('0x6e')]=_0x584e('0x75');break;case _0x584e('0x76'):_0x2dcca0[_0x584e('0x6e')]=_0x584e('0x77');default:}_0x2dcca0[_0x584e('0x78')]=(_0x32c0ef===_0x584e('0x79')?moment(_0x4243ec[_0x584e('0x6c')])[_0x584e('0x30')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x4243ec[_0x584e('0x7a')])[_0x584e('0x30')](_0x584e('0x6a')))||moment()[_0x584e('0x30')](_0x584e('0x6a'));_0x2dcca0[_0x584e('0x7b')]=_0x32c0ef||_0x584e('0x7c');_0x2dcca0=_[_0x584e('0x7d')](_0x2dcca0,getCustomFields(_0x5dcaf4[_0x584e('0x7e')],_0x4243ec));return request({'method':_0x584e('0x23'),'uri':_0x584e('0x56')+_0x25da46+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x141ff7},'body':{'data':[_0x2dcca0]},'json':!![]})[_0x584e('0x34')](function(_0x55cb47){if(_0x55cb47&&_0x55cb47[_0x584e('0x41')][0x0][_0x584e('0x49')]==='SUCCESS'){logger[_0x584e('0x39')](_0x584e('0x7f'));return{'id':_0x55cb47['data'][0x0]['details']['id']};}})['catch'](function(_0x5e0963){logger[_0x584e('0x39')](_0x584e('0x80'),_0x5e0963[_0x584e('0x2d')]);console[_0x584e('0x4d')](_0x584e('0x80'),_0x5e0963);});}exports[_0x584e('0x81')]=function(_0x32e25c,_0x5317b0,_0x505cfd,_0x5cbd2b,_0x567d18,_0x1050d9){var _0x2453cb,_0xad3c76,_0x4c0a10;_0x1050d9[_0x584e('0x82')]=intUtil[_0x584e('0x83')](_0x1050d9[_0x584e('0x82')]);_0x1050d9['serverUrl']=intUtil[_0x584e('0x83')](_0x1050d9[_0x584e('0x84')]);if(_0x567d18&&_0x567d18[_0x584e('0x85')]){logger[_0x584e('0x39')](_0x584e('0x86'),_0x584e('0x87'));_0x5317b0[_0x584e('0x88')]=_0x1050d9['serverUrl']+_0x584e('0x89')+_0x5317b0[_0x584e('0x8a')]+_0x584e('0x8b')+md5(_0x5317b0[_0x584e('0x8a')]);}else{_0x5317b0['recordingURL']='';}var _0x3ac371=_0x1050d9[_0x584e('0x82')]===_0x584e('0x8c')?'eu':_0x584e('0x8d');return getAccessToken(_0x1050d9)['then'](function(_0x46ec60){_0x4c0a10=_0x46ec60;return getUser(_0x4c0a10,_0x3ac371,_0x1050d9,_0x5cbd2b[_0x584e('0x38')]);})['then'](function(_0x39831f){_0x2453cb=_0x39831f;logger['info']('The\x20User\x20ID\x20is:',_0x2453cb['id']);return getEndUser(_0x4c0a10,_0x3ac371,_0x1050d9,_0x5317b0[_0x584e('0x8e')],_0x5317b0[_0x584e('0x8f')],_0x2453cb,_0x505cfd);})[_0x584e('0x34')](function(_0x167c6f){_0xad3c76=_0x167c6f;return getCall(_0x4c0a10,_0x3ac371,_0x1050d9,_0x2453cb,_0xad3c76,_0x505cfd,_0x5317b0,_0x584e('0x7c'));})[_0x584e('0x34')](function(_0x520da6){if(_0x520da6){logger[_0x584e('0x39')]('The\x20Call\x20ID\x20is:',_0x520da6['id']);logger[_0x584e('0x39')]('[QUEUE]',_0x584e('0x90'));emit(util[_0x584e('0x30')]('user:%s',_0x5cbd2b[_0x584e('0x16')]),_0x584e('0x91'),{'uri':_0x584e('0x92')+_0x1050d9['host']+_0x584e('0x93')+_0x520da6['id']});}})[_0x584e('0x2a')](function(_0x3d2009){logger['error'](_0x584e('0x86'),JSON[_0x584e('0xc')](_0x3d2009));});};exports['outbound']=function(_0x2bac61,_0x3e8089,_0x42ba9e,_0x3b7c6d,_0x306084,_0x3d205b,_0x5c7d43){var _0x209c23,_0x179144,_0x69ec22;_0x3d205b['host']=intUtil[_0x584e('0x83')](_0x3d205b['host']);_0x3d205b['serverUrl']=intUtil[_0x584e('0x83')](_0x3d205b[_0x584e('0x84')]);if(_0x5c7d43&&_0x5c7d43[_0x584e('0x94')]&&_0x5c7d43[_0x584e('0x94')]!=='none'){logger[_0x584e('0x39')](_0x584e('0x95'),_0x584e('0x87'));_0x3e8089[_0x584e('0x88')]=_0x3d205b[_0x584e('0x84')]+_0x584e('0x89')+_0x3e8089[_0x584e('0x8a')]+_0x584e('0x8b')+md5(_0x3e8089['uniqueid']);}var _0x44ab1d=_0x3d205b[_0x584e('0x82')]==='zoho.eu'?'eu':_0x584e('0x8d');return getAccessToken(_0x3d205b)[_0x584e('0x34')](function(_0x423743){_0x69ec22=_0x423743;return getUser(_0x69ec22,_0x44ab1d,_0x3d205b,_0x3b7c6d['email']);})['then'](function(_0x12ac60){_0x209c23=_0x12ac60;logger[_0x584e('0x39')](_0x584e('0x96'),_0x209c23['id']);return getEndUser(_0x69ec22,_0x44ab1d,_0x3d205b,_0x3e8089[_0x584e('0x97')],_0x3e8089[_0x584e('0x98')],_0x209c23,_0x42ba9e);})[_0x584e('0x34')](function(_0x4185f4){_0x179144=_0x4185f4;return getCall(_0x69ec22,_0x44ab1d,_0x3d205b,_0x209c23,_0x179144,_0x42ba9e,_0x3e8089,'Outbound');})['then'](function(_0x577308){if(_0x577308){logger[_0x584e('0x39')](_0x584e('0x99'),_0x577308['id']);logger[_0x584e('0x39')](_0x584e('0x95'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x3b7c6d['name']),_0x584e('0x91'),{'uri':'https://crm.'+_0x3d205b[_0x584e('0x82')]+'/crm/EntityInfo.do?module=Calls&id='+_0x577308['id']});}})[_0x584e('0x2a')](function(_0x5aa801){logger[_0x584e('0x2b')]('[OUTBOUND]',JSON['stringify'](_0x5aa801));});};exports[_0x584e('0x9a')]=function(_0x4df6cb,_0xb221c1,_0x4d74b0,_0x22e5a2,_0x4c8437,_0x5b197e){var _0x25d03e,_0x323824,_0x1cfd52;_0x5b197e[_0x584e('0x82')]=intUtil[_0x584e('0x83')](_0x5b197e[_0x584e('0x82')]);_0x5b197e[_0x584e('0x84')]=intUtil[_0x584e('0x83')](_0x5b197e['serverUrl']);if(_0x4c8437&&_0x4c8437[_0x584e('0x85')]){logger[_0x584e('0x39')]('['+_0xb221c1[_0x584e('0x9b')][_0x584e('0x9c')]()+']','Recording\x20is\x20enabled!');_0xb221c1[_0x584e('0x88')]=_0x5b197e[_0x584e('0x84')]+'/api/voice/recordings/'+_0xb221c1[_0x584e('0x8a')]+_0x584e('0x8b')+md5(_0xb221c1[_0x584e('0x8a')]);}else{_0xb221c1[_0x584e('0x88')]='';}var _0xda130c=_0x5b197e[_0x584e('0x82')]==='zoho.eu'?'eu':_0x584e('0x8d');return getAccessToken(_0x5b197e)['then'](function(_0x4c638d){_0x1cfd52=_0x4c638d;return getUser(_0x1cfd52,_0xda130c,_0x5b197e);})[_0x584e('0x34')](function(_0x53a35b){_0x25d03e=_0x53a35b;logger['info'](_0x584e('0x96'),_0x25d03e['id']);return getEndUser(_0x1cfd52,_0xda130c,_0x5b197e,_0xb221c1[_0x584e('0x8e')],_0xb221c1[_0x584e('0x8f')],_0x25d03e,_0x4d74b0);})[_0x584e('0x34')](function(_0x203214){_0x323824=_0x203214;return getCall(_0x1cfd52,_0xda130c,_0x5b197e,_0x25d03e,_0x323824,_0x4d74b0,_0xb221c1,_0x584e('0x7c'));})['then'](function(_0xa91116){if(_0xa91116){logger['info'](_0x584e('0x99'),_0xa91116['id']);}})[_0x584e('0x2a')](function(_0x3a70a0){logger[_0x584e('0x2b')]('['+_0xb221c1[_0x584e('0x9b')][_0x584e('0x9c')]()+']',JSON['stringify'](_0x3a70a0));});};
\ No newline at end of file
+var _0x5360=['err','host','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase','calleridnum','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','debug','length','forEach','type','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','split','isNil','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','users','isArrayLikeObject','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','/crm/v2/','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Leads','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Descriptions','Who_Id','First_Name','Last_Name','What_Id','Full_Name','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','complete','connect','Answered','Rejected','Abandoned','Timeout','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!'];(function(_0x598b4e,_0x1a7a84){var _0x5a7a95=function(_0x418a5d){while(--_0x418a5d){_0x598b4e['push'](_0x598b4e['shift']());}};_0x5a7a95(++_0x1a7a84);}(_0x5360,0x157));var _0x0536=function(_0x15fdef,_0x4768c8){_0x15fdef=_0x15fdef-0x0;var _0x4a1406=_0x5360[_0x15fdef];return _0x4a1406;};'use strict';var _=require(_0x0536('0x0'));var rp=require(_0x0536('0x1'));var md5=require(_0x0536('0x2'));var util=require(_0x0536('0x3'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x0536('0x4'));var BPromise=require('bluebird');var config=require(_0x0536('0x5'));var logger=require(_0x0536('0x6'))('zoho');config['redis']=_['defaults'](config[_0x0536('0x7')],{'host':_0x0536('0x8'),'port':0x18eb});var io=require(_0x0536('0x9'))(new Redis(config[_0x0536('0x7')]));function emit(_0x4974ad,_0x180b94,_0x203f0b){io['to'](_0x4974ad)[_0x0536('0xa')](_0x180b94,_0x203f0b);}function request(_0x5b78e2){logger[_0x0536('0xb')]('[HTTP]',JSON['stringify'](_0x5b78e2));return rp(_0x5b78e2);}function getCustomFields(_0x5548ba,_0x532ab9){var _0x2e0a00={};if(_0x5548ba[_0x0536('0xc')]>0x0){_[_0x0536('0xd')](_0x5548ba,function(_0x1481e9){if(_0x1481e9[_0x0536('0xe')]===_0x0536('0xf')&&_0x1481e9[_0x0536('0x10')]){_0x2e0a00[_0x1481e9[_0x0536('0x10')]]=_0x1481e9[_0x0536('0x11')][_0x0536('0x12')]();}else if(_0x1481e9[_0x0536('0xe')]===_0x0536('0x13')&&_0x1481e9[_0x0536('0x14')]&&_0x1481e9['idField']&&_0x532ab9[_0x1481e9[_0x0536('0x14')]]){_0x2e0a00[_0x1481e9[_0x0536('0x10')]]=_0x532ab9[_0x1481e9[_0x0536('0x14')]][_0x0536('0x12')]();}else if(_0x1481e9[_0x0536('0xe')]==='customVariable'&&_0x1481e9[_0x0536('0x15')]&&_0x1481e9[_0x0536('0x15')][_0x0536('0x16')]&&_0x1481e9[_0x0536('0x10')]&&_0x532ab9[_0x1481e9['Variable']['name'][_0x0536('0x17')]()]){_0x2e0a00[_0x1481e9[_0x0536('0x10')]]=_0x532ab9[_0x1481e9[_0x0536('0x15')]['name']['toLowerCase']()][_0x0536('0x12')]();}});}return _0x2e0a00;}function getName(_0x1eb48d){if(_0x1eb48d['indexOf']('\x20')>0x0){var _0x643c08=_0x1eb48d[_0x0536('0x18')](/ (.+)/);if(_0x643c08[0x1]){return _0x643c08;}}return[_0x1eb48d,_0x1eb48d];}var accountsTokens={};function getAccessToken(_0x23a389){return new Promise(function(_0x43730f,_0x3e1d66){if(!_['isNil'](accountsTokens[_0x23a389['id']])&&!_[_0x0536('0x19')](accountsTokens[_0x23a389['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x23a389['id']][_0x0536('0x1a')])){_0x43730f(accountsTokens[_0x23a389['id']][_0x0536('0x1b')]);}}var _0x21c094;switch(_0x23a389[_0x0536('0x1c')]){case'US':_0x21c094=_0x0536('0x1d');break;case'AU':_0x21c094=_0x0536('0x1e');break;case'EU':_0x21c094=_0x0536('0x1f');break;case'IN':_0x21c094='https://accounts.zoho.in';break;case'CN':_0x21c094=_0x0536('0x20');break;default:_0x21c094=_0x0536('0x1f');break;}var _0x5a52b0={'method':_0x0536('0x21'),'uri':_0x21c094+_0x0536('0x22'),'qs':{'refresh_token':_0x23a389[_0x0536('0x23')],'client_id':_0x23a389['clientId'],'client_secret':_0x23a389[_0x0536('0x24')],'grant_type':_0x0536('0x25')},'json':!![]};return rp(_0x5a52b0)[_0x0536('0x26')](function(_0x597693){accountsTokens[_0x23a389['id']]={'access_token':_0x597693[_0x0536('0x1b')],'expires_in':moment()[_0x0536('0x27')](_0x597693[_0x0536('0x1a')],_0x0536('0x28'))};_0x43730f(_0x597693[_0x0536('0x1b')]);})[_0x0536('0x29')](function(_0x81b08c){logger[_0x0536('0x2a')](_0x0536('0x2b'),_0x81b08c[_0x0536('0x2c')]);_0x3e1d66(_0x81b08c);});});}function getUser(_0x5f4b92,_0x2ab6dd,_0x36d4d7,_0x4d8c31){logger[_0x0536('0x2d')](_0x0536('0x2e'));return request({'method':_0x0536('0x2f'),'uri':util[_0x0536('0x30')]('https://www.zohoapis.%s/crm/v2/users',_0x2ab6dd),'qs':{'type':_0x0536('0x31')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5f4b92},'json':!![]})['then'](function(_0x2d8700){if(_0x2d8700[_0x0536('0x32')]){var _0x1efa98=-0x1;if(_[_0x0536('0x33')](_0x2d8700[_0x0536('0x32')])){if(!_[_0x0536('0x19')](_0x4d8c31)){_0x1efa98=_['findIndex'](_0x2d8700[_0x0536('0x32')],function(_0x180b3f){return _0x180b3f['email']===_0x4d8c31;});}if(_0x1efa98>=0x0){logger[_0x0536('0x2d')]('Agent\x20found!');}else{logger[_0x0536('0x2d')](_0x0536('0x34'));_0x1efa98=_[_0x0536('0x35')](_0x2d8700[_0x0536('0x32')],function(_0x37cfe4){return _0x37cfe4[_0x0536('0x36')]['name']===_0x0536('0x37');});}return _0x2d8700['users'][_0x1efa98];}else{if(_0x2d8700['user'][_0x0536('0x36')][_0x0536('0x16')]===_0x0536('0x37')){logger['info'](_0x0536('0x34'));user=_0x2d8700[_0x0536('0x38')];return user;}else{logger[_0x0536('0x2a')](_0x0536('0x39'),JSON[_0x0536('0x3a')](_0x2d8700));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x0536('0x3a')](_0x2d8700));}}}else{logger[_0x0536('0x2a')](_0x0536('0x39'),JSON[_0x0536('0x3a')](_0x2d8700));throw new Error(_0x0536('0x3b')+JSON['stringify'](_0x2d8700));}})[_0x0536('0x29')](function(_0x594d94){console[_0x0536('0x2a')](_0x594d94);});}function getZohoUser(_0x413ee8,_0xdda12c){return new BPromise(function(_0x5ebcfa,_0x2eef75){request(_0x413ee8)[_0x0536('0x26')](function(_0x1782cc){var _0x2e2aee=null;if(_0x1782cc){_0x2e2aee=_0x1782cc['data'][0x0];_0x2e2aee[_0x0536('0x3c')]=_0xdda12c;}_0x5ebcfa(_0x2e2aee);})[_0x0536('0x29')](function(_0x5896a6){_0x2eef75(_0x5896a6);});});}function createEndUser(_0x4487ea,_0x4b96bf,_0x4b4f46,_0x1876aa,_0x17fad0,_0x29c9df){var _0x4b4f46=getName(_0x4b4f46);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x4b96bf+_0x0536('0x3d')+_[_0x0536('0x3e')](_0x29c9df['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4b4f46[0x1],'First_Name':_0x4b4f46[0x0],'Phone':_0x1876aa,'Owner':{'name':!_[_0x0536('0x19')](_0x17fad0[_0x0536('0x3f')][_0x0536('0x16')])?_0x17fad0[_0x0536('0x3f')]['name']:!_[_0x0536('0x19')](_0x17fad0[_0x0536('0x40')])?_0x17fad0[_0x0536('0x40')]+'\x20'+_0x17fad0[_0x0536('0x41')]:_0x17fad0[_0x0536('0x41')],'id':_0x17fad0['id']}}]},'headers':{'Authorization':_0x0536('0x42')+_0x4487ea},'json':!![]})[_0x0536('0x26')](function(_0x2560c0){if(_0x2560c0&&_0x2560c0['data'][0x0][_0x0536('0x43')]===_0x0536('0x44')){var _0x10a589=_0x2560c0['data'][0x0][_0x0536('0x45')];_0x10a589[_0x0536('0x3c')]=_[_0x0536('0x3e')](_0x29c9df[_0x0536('0x46')])+'s';return _0x10a589;}logger[_0x0536('0x2a')]('The\x20failing\x20result\x20is',JSON[_0x0536('0x3a')](data));throw new Error(_0x0536('0x47')+JSON['stringify'](data));})[_0x0536('0x29')](function(_0x166604){console[_0x0536('0x48')](_0x0536('0x49'),_0x166604);});}function getEndUser(_0xc81430,_0x192af3,_0x22661f,_0x575e00,_0x59a486,_0x1d379e,_0xb57c75){var _0x3be777={'method':_0x0536('0x2f'),'uri':'','headers':{'Authorization':_0x0536('0x42')+_0xc81430},'json':!![]};switch(_0xb57c75[_0x0536('0x4a')]){case _0x0536('0x4b'):_0x3be777[_0x0536('0x4c')]='https://www.zohoapis.'+_0x192af3+_0x0536('0x4d')+_0x59a486+'))';return getZohoUser(_0x3be777,_0x0536('0x4e'))['then'](function(_0x1c455d){if(_0x1c455d)return _0x1c455d;_0x3be777['uri']=_0x0536('0x4f')+_0x192af3+_0x0536('0x50')+_0x59a486+'))';return getZohoUser(_0x3be777,'Leads')['then'](function(_0x20b2b7){if(_0x20b2b7)return _0x20b2b7;if(_0xb57c75[_0x0536('0x46')]!=_0x0536('0x51')){return createEndUser(_0xc81430,_0x192af3,_0x575e00,_0x59a486,_0x1d379e,_0xb57c75);}else{return{};}});});break;case _0x0536('0x52'):_0x3be777[_0x0536('0x4c')]=_0x0536('0x4f')+_0x192af3+_0x0536('0x4d')+_0x59a486+'))';return getZohoUser(_0x3be777,_0x0536('0x4e'))[_0x0536('0x26')](function(_0x36db31){if(_0x36db31)return _0x36db31;if(_0xb57c75[_0x0536('0x46')]!=_0x0536('0x51')){return createEndUser(_0xc81430,_0x192af3,_0x575e00,_0x59a486,_0x1d379e,_0xb57c75);}else{return{};}});break;case _0x0536('0x53'):_0x3be777['uri']=_0x0536('0x4f')+_0x192af3+_0x0536('0x50')+_0x59a486+'))';return getZohoUser(_0x3be777,_0x0536('0x54'))['then'](function(_0x2dac7b){if(_0x2dac7b)return _0x2dac7b;if(_0xb57c75[_0x0536('0x46')]!=_0x0536('0x51')){return createEndUser(_0xc81430,_0x192af3,_0x575e00,_0x59a486,_0x1d379e,_0xb57c75);}else{return{};}});break;}}function getCall(_0x4401d8,_0x2f3652,_0x4e0292,_0xf5d61c,_0x36807b,_0x46cbf5,_0x2d9423,_0x3eaedd){logger[_0x0536('0x2d')](_0x0536('0x55'));var _0x572b25={};_0x572b25[_0x0536('0x56')]={'name':!_[_0x0536('0x19')](_0xf5d61c['role']['name'])&&!_[_0x0536('0x19')](_0xf5d61c[_0x0536('0x36')][_0x0536('0x16')])&&_0xf5d61c[_0x0536('0x36')][_0x0536('0x16')]==='administrator'?_0xf5d61c[_0x0536('0x3f')]['name']:!_[_0x0536('0x19')](_0xf5d61c[_0x0536('0x40')])?_0xf5d61c[_0x0536('0x40')]+'\x20'+_0xf5d61c[_0x0536('0x41')]:_0xf5d61c[_0x0536('0x41')],'id':_0xf5d61c['id']};_0x572b25[_0x0536('0x57')]=intUtil[_0x0536('0x58')](_0x46cbf5[_0x0536('0x59')],_0x2d9423,'\x20');_0x572b25[_0x0536('0x5a')]=intUtil[_0x0536('0x58')](_0x46cbf5[_0x0536('0x5b')],_0x2d9423,'\x0a');if(_0x36807b[_0x0536('0x3c')]===_0x0536('0x4e')){_0x572b25[_0x0536('0x5c')]={'name':!_['isNil'](_0x36807b['Full_Name'])?_0x36807b['Full_Name']:!_['isNil'](_0x36807b[_0x0536('0x5d')])?_0x36807b['First_Name']+'\x20'+_0x36807b['Last_Name']:_0x36807b[_0x0536('0x5e')],'id':_0x36807b['id']};}if(_0x36807b[_0x0536('0x3c')]===_0x0536('0x54')){_0x572b25[_0x0536('0x5f')]={'name':!_['isNil'](_0x36807b[_0x0536('0x60')])?_0x36807b[_0x0536('0x60')]:!_[_0x0536('0x19')](_0x36807b[_0x0536('0x5d')])?_0x36807b['First_Name']+'\x20'+_0x36807b[_0x0536('0x5e')]:_0x36807b['Last_Name'],'id':_0x36807b['id']};_0x572b25['$se_module']=_[_0x0536('0x3e')](_0x36807b[_0x0536('0x3c')]);}if(_0x2d9423[_0x0536('0x61')]){_0x572b25[_0x0536('0x62')]=moment[_0x0536('0x63')](parseInt(_0x2d9423[_0x0536('0x61')])*0x3e8)[_0x0536('0x30')](_0x0536('0x64'));}else if(_0x2d9423[_0x0536('0x65')]&&_0x2d9423['endtime']){_0x572b25[_0x0536('0x62')]=moment[_0x0536('0x63')](moment(_0x2d9423[_0x0536('0x66')],_0x0536('0x67'))[_0x0536('0x68')](moment(_0x2d9423[_0x0536('0x69')],_0x0536('0x67'))))[_0x0536('0x30')](_0x0536('0x64'));}switch(_0x2d9423['lastevent']){case _0x0536('0x6a'):_0x572b25[_0x0536('0x6b')]=_0x0536('0x6c');break;case _0x0536('0x6d'):case _0x0536('0x6e'):_0x572b25[_0x0536('0x6b')]=_0x0536('0x6f');break;case'rejected':_0x572b25[_0x0536('0x6b')]=_0x0536('0x70');break;case'abandoned':_0x572b25[_0x0536('0x6b')]=_0x0536('0x71');break;case'timeout':_0x572b25[_0x0536('0x6b')]=_0x0536('0x72');default:}_0x572b25['Call_Start_Time']=(_0x3eaedd==='outbound'?moment(_0x2d9423[_0x0536('0x69')])[_0x0536('0x30')](_0x0536('0x67')):moment(_0x2d9423[_0x0536('0x73')])['format'](_0x0536('0x67')))||moment()[_0x0536('0x30')]('YYYY-MM-DDTHH:mm:ss');_0x572b25[_0x0536('0x74')]=_0x3eaedd||_0x0536('0x75');_0x572b25=_[_0x0536('0x76')](_0x572b25,getCustomFields(_0x46cbf5[_0x0536('0x77')],_0x2d9423));return request({'method':_0x0536('0x21'),'uri':_0x0536('0x4f')+_0x2f3652+_0x0536('0x78'),'headers':{'Authorization':_0x0536('0x42')+_0x4401d8},'body':{'data':[_0x572b25]},'json':!![]})[_0x0536('0x26')](function(_0x4c6f38){if(_0x4c6f38&&_0x4c6f38['data'][0x0][_0x0536('0x43')]==='SUCCESS'){logger[_0x0536('0x2d')](_0x0536('0x79'));return{'id':_0x4c6f38['data'][0x0]['details']['id']};}})[_0x0536('0x29')](function(_0xb904b6){logger['info'](_0x0536('0x7a'),_0xb904b6[_0x0536('0x2c')]);console[_0x0536('0x48')](_0x0536('0x7a'),_0xb904b6);});}exports['queue']=function(_0x3b3283,_0x3c7f64,_0x124bcc,_0x4c0796,_0x31ee78,_0x183619){var _0xb03ebc,_0x4ed051,_0x214f4a;_0x183619[_0x0536('0x7b')]=intUtil[_0x0536('0x7c')](_0x183619[_0x0536('0x7b')]);_0x183619['serverUrl']=intUtil['stripTrailingSlash'](_0x183619['serverUrl']);if(_0x31ee78&&_0x31ee78[_0x0536('0x7d')]){logger['info']('[QUEUE]',_0x0536('0x7e'));_0x3c7f64[_0x0536('0x7f')]=_0x183619['serverUrl']+_0x0536('0x80')+_0x3c7f64[_0x0536('0x81')]+_0x0536('0x82')+md5(_0x3c7f64[_0x0536('0x81')]);}else{_0x3c7f64['recordingURL']='';}var _0xf5b305=_0x183619[_0x0536('0x7b')]===_0x0536('0x83')?'eu':_0x0536('0x84');return getAccessToken(_0x183619)[_0x0536('0x26')](function(_0x5d4c9c){_0x214f4a=_0x5d4c9c;return getUser(_0x214f4a,_0xf5b305,_0x183619,_0x4c0796[_0x0536('0x85')]);})[_0x0536('0x26')](function(_0x33caae){_0xb03ebc=_0x33caae;logger[_0x0536('0x2d')](_0x0536('0x86'),_0xb03ebc['id']);return getEndUser(_0x214f4a,_0xf5b305,_0x183619,_0x3c7f64[_0x0536('0x87')],_0x3c7f64['calleridnum'],_0xb03ebc,_0x124bcc);})[_0x0536('0x26')](function(_0x1ce621){_0x4ed051=_0x1ce621;return getCall(_0x214f4a,_0xf5b305,_0x183619,_0xb03ebc,_0x4ed051,_0x124bcc,_0x3c7f64,_0x0536('0x75'));})['then'](function(_0x4bf38c){if(_0x4bf38c){logger[_0x0536('0x2d')](_0x0536('0x88'),_0x4bf38c['id']);logger[_0x0536('0x2d')](_0x0536('0x89'),_0x0536('0x8a'));emit(util[_0x0536('0x30')](_0x0536('0x8b'),_0x4c0796[_0x0536('0x16')]),_0x0536('0x8c'),{'uri':_0x0536('0x8d')+_0x183619[_0x0536('0x7b')]+_0x0536('0x8e')+_0x4bf38c['id']});}})[_0x0536('0x29')](function(_0x14c532){logger['error'](_0x0536('0x89'),JSON[_0x0536('0x3a')](_0x14c532));});};exports[_0x0536('0x8f')]=function(_0xadc090,_0x23f9ab,_0x4ce84b,_0xbaba41,_0x59854a,_0x3a7fbf,_0x215811){var _0xe638c8,_0x2f9dc9,_0x436023;_0x3a7fbf[_0x0536('0x7b')]=intUtil[_0x0536('0x7c')](_0x3a7fbf[_0x0536('0x7b')]);_0x3a7fbf[_0x0536('0x90')]=intUtil[_0x0536('0x7c')](_0x3a7fbf['serverUrl']);if(_0x215811&&_0x215811[_0x0536('0x91')]&&_0x215811['recordingFormat']!==_0x0536('0x92')){logger[_0x0536('0x2d')](_0x0536('0x93'),_0x0536('0x7e'));_0x23f9ab[_0x0536('0x7f')]=_0x3a7fbf[_0x0536('0x90')]+_0x0536('0x80')+_0x23f9ab[_0x0536('0x81')]+_0x0536('0x82')+md5(_0x23f9ab['uniqueid']);}var _0x922198=_0x3a7fbf[_0x0536('0x7b')]===_0x0536('0x83')?'eu':'com';return getAccessToken(_0x3a7fbf)[_0x0536('0x26')](function(_0xfa74){_0x436023=_0xfa74;return getUser(_0x436023,_0x922198,_0x3a7fbf,_0xbaba41[_0x0536('0x85')]);})[_0x0536('0x26')](function(_0x4799af){_0xe638c8=_0x4799af;logger[_0x0536('0x2d')]('The\x20User\x20ID\x20is:',_0xe638c8['id']);return getEndUser(_0x436023,_0x922198,_0x3a7fbf,_0x23f9ab[_0x0536('0x94')],_0x23f9ab[_0x0536('0x95')],_0xe638c8,_0x4ce84b);})['then'](function(_0xcf7892){_0x2f9dc9=_0xcf7892;return getCall(_0x436023,_0x922198,_0x3a7fbf,_0xe638c8,_0x2f9dc9,_0x4ce84b,_0x23f9ab,_0x0536('0x96'));})[_0x0536('0x26')](function(_0x4d708f){if(_0x4d708f){logger[_0x0536('0x2d')](_0x0536('0x88'),_0x4d708f['id']);logger[_0x0536('0x2d')](_0x0536('0x93'),_0x0536('0x8a'));emit(util[_0x0536('0x30')]('user:%s',_0xbaba41[_0x0536('0x16')]),_0x0536('0x8c'),{'uri':_0x0536('0x8d')+_0x3a7fbf[_0x0536('0x7b')]+_0x0536('0x8e')+_0x4d708f['id']});}})[_0x0536('0x29')](function(_0xe1c650){logger['error']('[OUTBOUND]',JSON[_0x0536('0x3a')](_0xe1c650));});};exports[_0x0536('0x97')]=function(_0x2680c1,_0x5a70d6,_0x55cc61,_0x1693f2,_0x1004c2,_0x490d5d){var _0x54b102,_0x3b57ac,_0x24e44a;_0x490d5d['host']=intUtil[_0x0536('0x7c')](_0x490d5d['host']);_0x490d5d['serverUrl']=intUtil[_0x0536('0x7c')](_0x490d5d[_0x0536('0x90')]);if(_0x1004c2&&_0x1004c2[_0x0536('0x7d')]){logger[_0x0536('0x2d')]('['+_0x5a70d6[_0x0536('0x98')][_0x0536('0x99')]()+']',_0x0536('0x7e'));_0x5a70d6[_0x0536('0x7f')]=_0x490d5d[_0x0536('0x90')]+_0x0536('0x80')+_0x5a70d6['uniqueid']+_0x0536('0x82')+md5(_0x5a70d6[_0x0536('0x81')]);}else{_0x5a70d6[_0x0536('0x7f')]='';}var _0x150e2d=_0x490d5d[_0x0536('0x7b')]==='zoho.eu'?'eu':_0x0536('0x84');return getAccessToken(_0x490d5d)[_0x0536('0x26')](function(_0x551c6f){_0x24e44a=_0x551c6f;return getUser(_0x24e44a,_0x150e2d,_0x490d5d);})[_0x0536('0x26')](function(_0x4d1301){_0x54b102=_0x4d1301;logger[_0x0536('0x2d')]('The\x20User\x20ID\x20is:',_0x54b102['id']);return getEndUser(_0x24e44a,_0x150e2d,_0x490d5d,_0x5a70d6[_0x0536('0x87')],_0x5a70d6[_0x0536('0x9a')],_0x54b102,_0x55cc61);})[_0x0536('0x26')](function(_0x9f58f1){_0x3b57ac=_0x9f58f1;return getCall(_0x24e44a,_0x150e2d,_0x490d5d,_0x54b102,_0x3b57ac,_0x55cc61,_0x5a70d6,'Inbound');})['then'](function(_0x379cde){if(_0x379cde){logger[_0x0536('0x2d')](_0x0536('0x88'),_0x379cde['id']);}})['catch'](function(_0x20c413){logger[_0x0536('0x2a')]('['+_0x5a70d6[_0x0536('0x98')][_0x0536('0x99')]()+']',JSON[_0x0536('0x3a')](_0x20c413));});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js
index 1b964d6..2ab4fb2 100644
--- a/server/services/ami/trigger/script/index.js
+++ b/server/services/ami/trigger/script/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x1438f0,_0xa837e0){var _0x4133b3=function(_0x365e02){while(--_0x365e02){_0x1438f0['push'](_0x1438f0['shift']());}};_0x4133b3(++_0xa837e0);}(_0x7a54,0x106));var _0x47a5=function(_0x10273a,_0x1e700f){_0x10273a=_0x10273a-0x0;var _0x59b653=_0x7a54[_0x10273a];return _0x59b653;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
+var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x1a25c6,_0x4497b7){var _0x129ab3=function(_0x2b72dc){while(--_0x2b72dc){_0x1a25c6['push'](_0x1a25c6['shift']());}};_0x129ab3(++_0x4497b7);}(_0x7a54,0x106));var _0x47a5=function(_0x5d877b,_0x4f27c2){_0x5d877b=_0x5d877b-0x0;var _0x55c318=_0x7a54[_0x5d877b];return _0x55c318;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js
index 66c1ddc..883e8c2 100644
--- a/server/services/ami/trigger/urlforward/index.js
+++ b/server/services/ami/trigger/urlforward/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x5ac918,_0x40234e){var _0x217317=function(_0x337f11){while(--_0x337f11){_0x5ac918['push'](_0x5ac918['shift']());}};_0x217317(++_0x40234e);}(_0xb10b,0x12a));var _0xbb10=function(_0x16f39a,_0x233f55){_0x16f39a=_0x16f39a-0x0;var _0xd6a5da=_0xb10b[_0x16f39a];return _0xd6a5da;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});};
\ No newline at end of file
+var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x5b75de,_0x14b914){var _0x48f6dd=function(_0xcb8ab8){while(--_0xcb8ab8){_0x5b75de['push'](_0x5b75de['shift']());}};_0x48f6dd(++_0x14b914);}(_0x7a54,0x106));var _0x47a5=function(_0x3d147b,_0x250e72){_0x3d147b=_0x3d147b-0x0;var _0x26e5a4=_0x7a54[_0x3d147b];return _0x26e5a4;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});};
\ No newline at end of file
diff --git a/server/services/email/client.js b/server/services/email/client.js
index 89673bc..21f687b 100644
--- a/server/services/email/client.js
+++ b/server/services/email/client.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2c7=['debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then'];(function(_0x4bfcc4,_0x460dc9){var _0x85ce92=function(_0x51045d){while(--_0x51045d){_0x4bfcc4['push'](_0x4bfcc4['shift']());}};_0x85ce92(++_0x460dc9);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x15f3c0,_0x165a64){_0x15f3c0=_0x15f3c0-0x0;var _0x1adfe0=_0xf2c7[_0x15f3c0];return _0x1adfe0;};'use strict';var jayson=require(_0x7f2c('0x0'));var BPromise=require(_0x7f2c('0x1'));var logger=require(_0x7f2c('0x2'))(_0x7f2c('0x3'));var client=jayson['client'][_0x7f2c('0x4')]({'port':0x2329});client[_0x7f2c('0x5')]=function(_0x4f526a,_0x4f340c){return new BPromise(function(_0xebab07,_0x4cb6ff){return client[_0x7f2c('0x6')](_0x4f526a,_0x4f340c)[_0x7f2c('0x7')](function(_0x4e348c){logger[_0x7f2c('0x8')](_0x7f2c('0x9'),_0x7f2c('0x3'),_0x4f526a,_0x4f340c,_0x4e348c);if(_0x4e348c['error']){logger[_0x7f2c('0xa')](_0x7f2c('0x9'),_0x7f2c('0x3'),_0x4f526a,_0x4e348c[_0x7f2c('0xa')][_0x7f2c('0xb')],_0x4f340c);return _0x4cb6ff(_0x4e348c[_0x7f2c('0xa')]['message']);}else{return _0xebab07(_0x4e348c[_0x7f2c('0xc')]);}})[_0x7f2c('0xd')](function(_0x3edb66){logger[_0x7f2c('0xa')](_0x7f2c('0x9'),_0x7f2c('0x3'),_0x4f526a,_0x3edb66,_0x4f340c);return _0x4cb6ff(_0x3edb66);});});};module[_0x7f2c('0xe')]=client;
\ No newline at end of file
+var _0x5577=['debug','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing','http','Request','then'];(function(_0x32ce61,_0x2ba733){var _0x28eded=function(_0x34db11){while(--_0x34db11){_0x32ce61['push'](_0x32ce61['shift']());}};_0x28eded(++_0x2ba733);}(_0x5577,0x1b4));var _0x7557=function(_0x214062,_0x26c92c){_0x214062=_0x214062-0x0;var _0x5f3740=_0x5577[_0x214062];return _0x5f3740;};'use strict';var jayson=require(_0x7557('0x0'));var BPromise=require('bluebird');var logger=require(_0x7557('0x1'))(_0x7557('0x2'));var client=jayson['client'][_0x7557('0x3')]({'port':0x2329});client[_0x7557('0x4')]=function(_0x25c0da,_0x3c4697){return new BPromise(function(_0x1274d5,_0x2d3c40){return client['request'](_0x25c0da,_0x3c4697)[_0x7557('0x5')](function(_0x41a4a5){logger[_0x7557('0x6')](_0x7557('0x7'),_0x7557('0x2'),_0x25c0da,_0x3c4697,_0x41a4a5);if(_0x41a4a5[_0x7557('0x8')]){logger[_0x7557('0x8')](_0x7557('0x7'),_0x7557('0x2'),_0x25c0da,_0x41a4a5[_0x7557('0x8')][_0x7557('0x9')],_0x3c4697);return _0x2d3c40(_0x41a4a5[_0x7557('0x8')][_0x7557('0x9')]);}else{return _0x1274d5(_0x41a4a5[_0x7557('0xa')]);}})[_0x7557('0xb')](function(_0x5b6d12){logger['error'](_0x7557('0x7'),_0x7557('0x2'),_0x25c0da,_0x5b6d12,_0x3c4697);return _0x2d3c40(_0x5b6d12);});});};module[_0x7557('0xc')]=client;
\ No newline at end of file
diff --git a/server/services/email/index.js b/server/services/email/index.js
index 628e702..9fd6ce5 100644
--- a/server/services/email/index.js
+++ b/server/services/email/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbd0=['initMailAccounts','refresh','mailAccounts','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts'];(function(_0x546895,_0xb414da){var _0x3b5a09=function(_0x1da01c){while(--_0x1da01c){_0x546895['push'](_0x546895['shift']());}};_0x3b5a09(++_0xb414da);}(_0xdbd0,0x88));var _0x0dbd=function(_0x438740,_0x21ba83){_0x438740=_0x438740-0x0;var _0x40ae8a=_0xdbd0[_0x438740];return _0x40ae8a;};'use strict';var BPromise=require(_0x0dbd('0x0'));var server=require(_0x0dbd('0x1'));var Realtime=require(_0x0dbd('0x2'));var EmailChannel=require(_0x0dbd('0x3'));var mailAccount=require(_0x0dbd('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise[_0x0dbd('0x5')]()[_0x0dbd('0x6')](mailAccount[_0x0dbd('0x7')]())['then'](realtime[_0x0dbd('0x8')]())[_0x0dbd('0x6')](function(){email[_0x0dbd('0x9')](realtime[_0x0dbd('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(_0xcb72c2){return initRealtime();})[_0x0dbd('0x6')](function(_0x1a957e){return db[_0x0dbd('0xb')][_0x0dbd('0xc')]({'attributes':['id',_0x0dbd('0xd')],'raw':!![]});})['then'](function(_0x55f318){return setInterval(initRealtime,_0x55f318[_0x0dbd('0xd')]*0x3e8);})[_0x0dbd('0xe')](function(_0x86fd0){console[_0x0dbd('0xf')](_0x86fd0);});}main();
\ No newline at end of file
+var _0x6bac=['./rpc/mailAccount','../../mysqldb','then','initMailAccounts','refresh','mailAccounts','listen','findOne','log','bluebird','./realtime','./lib/email'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6bac,0xa5));var _0xc6ba=function(_0x3ba99a,_0x4262d2){_0x3ba99a=_0x3ba99a-0x0;var _0x4181a6=_0x6bac[_0x3ba99a];return _0x4181a6;};'use strict';var BPromise=require(_0xc6ba('0x0'));var server=require('./server');var Realtime=require(_0xc6ba('0x1'));var EmailChannel=require(_0xc6ba('0x2'));var mailAccount=require(_0xc6ba('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xc6ba('0x4'))['db'];function initRealtime(){return BPromise['resolve']()['then'](mailAccount['getMailAccounts']())[_0xc6ba('0x5')](realtime[_0xc6ba('0x6')]())['then'](function(){email[_0xc6ba('0x7')](realtime[_0xc6ba('0x8')]);return realtime;});}function main(){return server[_0xc6ba('0x9')](realtime,email)[_0xc6ba('0x5')](function(_0x12d6e9){return initRealtime();})[_0xc6ba('0x5')](function(_0x5b98f9){return db['Setting'][_0xc6ba('0xa')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})['then'](function(_0x4b62bd){return setInterval(initRealtime,_0x4b62bd['loginMailFrequency']*0x3e8);})['catch'](function(_0x45d797){console[_0xc6ba('0xb')](_0x45d797);});}main();
\ No newline at end of file
diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js
index 9b4c299..a01ce3c 100644
--- a/server/services/email/lib/email.js
+++ b/server/services/email/lib/email.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x54bb=['Imap','messageStatus','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','email','box','bind','handleImapEmail','end','error','handleImapError','disabled','handleImapBox','connected','name','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','Mail\x20accepted\x20from\x20routing','handleImapEnd','status','sendMail','send','verifySmtp','Smtp','lastSync','verify','then','verified','catch','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','key','active'];(function(_0x1868a9,_0xd5877d){var _0x2a8e8b=function(_0x2dad35){while(--_0x2dad35){_0x1868a9['push'](_0x1868a9['shift']());}};_0x2a8e8b(++_0xd5877d);}(_0x54bb,0x17b));var _0xb54b=function(_0x31ab90,_0x145a96){_0x31ab90=_0x31ab90-0x0;var _0x2d6123=_0x54bb[_0x31ab90];return _0x2d6123;};'use strict';var _=require(_0xb54b('0x0'));var moment=require(_0xb54b('0x1'));var BPromise=require(_0xb54b('0x2'));var md5=require(_0xb54b('0x3'));var Redis=require(_0xb54b('0x4'));var config=require(_0xb54b('0x5'));var logger=require('../../../config/logger')('email');config[_0xb54b('0x6')]=_[_0xb54b('0x7')](config[_0xb54b('0x6')],{'host':_0xb54b('0x8'),'port':0x18eb});var io=require(_0xb54b('0x9'))(new Redis(config[_0xb54b('0x6')]));var EmailImap=require(_0xb54b('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xb54b('0xb'));var md5Accounts={};function EmailChannel(_0xaff2e){logger[_0xb54b('0xc')](_0xb54b('0xd'));this[_0xb54b('0xe')]=_0xaff2e[_0xb54b('0xe')];this['imapAccounts']={};this[_0xb54b('0xf')]=new EmailSmtp();}EmailChannel[_0xb54b('0x10')][_0xb54b('0x11')]=function(_0x4466a4){var _0x41d1d8=this['mailAccounts'][_0x4466a4];var _0x4ed94f={'id':_0x41d1d8['id'],'name':_0x41d1d8['name'],'key':_0x41d1d8[_0xb54b('0x12')],'active':_0x41d1d8[_0xb54b('0x13')],'Imap':{'status':_0x41d1d8[_0xb54b('0x14')]['status'],'messageStatus':_0x41d1d8[_0xb54b('0x14')][_0xb54b('0x15')],'total':_0x41d1d8['Imap']['total']}};if(_[_0xb54b('0x16')](md5Accounts[_0x4466a4])){md5Accounts[_0x4466a4]={};}var _0x295683=md5(JSON[_0xb54b('0x17')](_0x4ed94f));if(md5Accounts[_0x4466a4]['md5']!==_0x295683){md5Accounts[_0x4466a4][_0xb54b('0x3')]=_0x295683;io[_0xb54b('0x11')](_0xb54b('0x18'),_0x4ed94f);}};EmailChannel[_0xb54b('0x10')][_0xb54b('0x19')]=function(_0x18785c){for(var _0x5c5c14 in _0x18785c){if(_0x18785c[_0xb54b('0x1a')](_0x5c5c14)){if(_0x18785c[_0x5c5c14][_0xb54b('0x14')]&&_0x18785c[_0x5c5c14][_0xb54b('0x13')]){var _0x3469f2=_0x18785c[_0x5c5c14][_0xb54b('0x14')];if(!this[_0xb54b('0x1b')]['hasOwnProperty'](_0x3469f2['id'])){this[_0xb54b('0x1b')][_0x3469f2['id']]=new EmailImap(_0x3469f2,_0x18785c[_0x5c5c14][_0xb54b('0x1c')]);this[_0xb54b('0x1b')][_0x3469f2['id']]['on'](_0xb54b('0x1d'),this['handleImapBox'][_0xb54b('0x1e')](this,_0x5c5c14));this['imapAccounts'][_0x3469f2['id']]['on'](_0xb54b('0x1c'),this[_0xb54b('0x1f')][_0xb54b('0x1e')](this,_0x5c5c14));this[_0xb54b('0x1b')][_0x3469f2['id']]['on'](_0xb54b('0x20'),this['handleImapEnd'][_0xb54b('0x1e')](this,_0x5c5c14));this['imapAccounts'][_0x3469f2['id']]['on'](_0xb54b('0x21'),this[_0xb54b('0x22')][_0xb54b('0x1e')](this,_0x5c5c14));}}else{if(_['isNil'](this[_0xb54b('0xe')][_0x5c5c14][_0xb54b('0x14')])){this[_0xb54b('0xe')][_0x5c5c14][_0xb54b('0x14')]={};}this[_0xb54b('0xe')][_0x5c5c14]['Imap']['status']=_0xb54b('0x23');this[_0xb54b('0xe')][_0x5c5c14][_0xb54b('0x14')][_0xb54b('0x15')]='';this[_0xb54b('0x11')](_0x5c5c14);}}}};EmailChannel[_0xb54b('0x10')][_0xb54b('0x24')]=function(_0x47484c,_0x3c9310){if(this[_0xb54b('0xe')][_0x47484c]){this[_0xb54b('0xe')][_0x47484c][_0xb54b('0x14')]['status']=_0xb54b('0x25');this[_0xb54b('0xe')][_0x47484c][_0xb54b('0x14')][_0xb54b('0x15')]=_0x3c9310[_0xb54b('0x26')];if(_0x3c9310[_0xb54b('0x27')]){this[_0xb54b('0xe')][_0x47484c][_0xb54b('0x14')]['total']=_0x3c9310[_0xb54b('0x27')][_0xb54b('0x28')];}return this[_0xb54b('0x11')](_0x47484c);}};EmailChannel[_0xb54b('0x10')][_0xb54b('0x1f')]=function(_0x4519ba,_0x47ca7b){logger[_0xb54b('0xc')](_0xb54b('0x29'),_0x47ca7b['firstName'],_0x47ca7b['lastName'],_0x47ca7b[_0xb54b('0x2a')],_0x4519ba);if(this['mailAccounts'][_0x4519ba]){return mailAccount[_0xb54b('0x2b')](_0x4519ba,_0x47ca7b)['then'](function(_0x5cc056){if(_0x5cc056){logger[_0xb54b('0xc')](_0xb54b('0x2c'));}})['catch'](function(_0x3bc90c){logger[_0xb54b('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xb54b('0x17')](_0x3bc90c));});}};EmailChannel[_0xb54b('0x10')][_0xb54b('0x2d')]=function(_0xf89899){if(this[_0xb54b('0xe')][_0xf89899]&&this[_0xb54b('0xe')][_0xf89899][_0xb54b('0x14')]){if(this[_0xb54b('0x1b')][this[_0xb54b('0xe')][_0xf89899][_0xb54b('0x14')]['id']]){delete this[_0xb54b('0x1b')][this[_0xb54b('0xe')][_0xf89899]['Imap']['id']];}this[_0xb54b('0xe')][_0xf89899]['Imap']['lastSync']=moment();this['emit'](_0xf89899);}};EmailChannel['prototype']['handleImapError']=function(_0x13ffa9,_0xce5812){if(this[_0xb54b('0xe')][_0x13ffa9]){this[_0xb54b('0xe')][_0x13ffa9][_0xb54b('0x14')][_0xb54b('0x2e')]=_0xb54b('0x21');this[_0xb54b('0xe')][_0x13ffa9][_0xb54b('0x14')][_0xb54b('0x15')]=_0xce5812;return this[_0xb54b('0x11')](_0x13ffa9);}};EmailChannel[_0xb54b('0x10')][_0xb54b('0x2f')]=function(_0x29cb30,_0x56dac3){return this['smtp'][_0xb54b('0x30')](_0x29cb30,_0x56dac3);};EmailChannel[_0xb54b('0x10')][_0xb54b('0x31')]=function(_0x480bef){var _0x40cfcf=this;if(this['mailAccounts'][_0x480bef['id']]){if(_[_0xb54b('0x16')](this[_0xb54b('0xe')][_0x480bef['id']]['Smtp'])){this[_0xb54b('0xe')][_0x480bef['id']][_0xb54b('0x32')]={};}this['mailAccounts'][_0x480bef['id']][_0xb54b('0x32')][_0xb54b('0x33')]=moment();return new BPromise(function(_0x2b8af3,_0x463ce7){return _0x40cfcf[_0xb54b('0xf')][_0xb54b('0x34')](_0x480bef)[_0xb54b('0x35')](function(_0x332bc5){_0x40cfcf[_0xb54b('0xe')][_0x480bef['id']][_0xb54b('0x32')][_0xb54b('0x2e')]=_0xb54b('0x36');_0x40cfcf[_0xb54b('0xe')][_0x480bef['id']]['Smtp'][_0xb54b('0x15')]='';_0x40cfcf[_0xb54b('0x11')](_0x480bef['id']);_0x2b8af3(_0x332bc5);})[_0xb54b('0x37')](function(_0x456537){_0x40cfcf['mailAccounts'][_0x480bef['id']][_0xb54b('0x32')]['status']=_0xb54b('0x21');_0x40cfcf[_0xb54b('0xe')][_0x480bef['id']][_0xb54b('0x32')][_0xb54b('0x15')]=_0x456537;_0x40cfcf[_0xb54b('0x11')](_0x480bef['id']);_0x463ce7(_0x456537);});});}return this[_0xb54b('0xf')][_0xb54b('0x34')](_0x480bef);};module[_0xb54b('0x38')]=EmailChannel;
\ No newline at end of file
+var _0xdc56=['exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','active','Imap','messageStatus','refresh','hasOwnProperty','box','bind','handleImapEmail','error','isNil','disabled','handleImapBox','connected','name','messages','total','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','handleImapError','status','sendMail','smtp','send','verifySmtp','Smtp','verified','verify'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdc56,0xa6));var _0x6dc5=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xdc56[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0x6dc5('0x0'));var moment=require(_0x6dc5('0x1'));var BPromise=require(_0x6dc5('0x2'));var md5=require(_0x6dc5('0x3'));var Redis=require(_0x6dc5('0x4'));var config=require(_0x6dc5('0x5'));var logger=require('../../../config/logger')(_0x6dc5('0x6'));config[_0x6dc5('0x7')]=_['defaults'](config['redis'],{'host':_0x6dc5('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x6dc5('0x9'));var EmailSmtp=require(_0x6dc5('0xa'));var mailAccount=require(_0x6dc5('0xb'));var md5Accounts={};function EmailChannel(_0x2b29f8){logger[_0x6dc5('0xc')](_0x6dc5('0xd'));this['mailAccounts']=_0x2b29f8[_0x6dc5('0xe')];this[_0x6dc5('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x6dc5('0x10')][_0x6dc5('0x11')]=function(_0x2ff997){var _0x1d6395=this[_0x6dc5('0xe')][_0x2ff997];var _0x2e624d={'id':_0x1d6395['id'],'name':_0x1d6395['name'],'key':_0x1d6395['key'],'active':_0x1d6395[_0x6dc5('0x12')],'Imap':{'status':_0x1d6395['Imap']['status'],'messageStatus':_0x1d6395[_0x6dc5('0x13')][_0x6dc5('0x14')],'total':_0x1d6395[_0x6dc5('0x13')]['total']}};if(_['isNil'](md5Accounts[_0x2ff997])){md5Accounts[_0x2ff997]={};}var _0x1b6c36=md5(JSON['stringify'](_0x2e624d));if(md5Accounts[_0x2ff997]['md5']!==_0x1b6c36){md5Accounts[_0x2ff997][_0x6dc5('0x3')]=_0x1b6c36;io['emit']('mailAccount:update',_0x2e624d);}};EmailChannel[_0x6dc5('0x10')][_0x6dc5('0x15')]=function(_0x217931){for(var _0x1216c8 in _0x217931){if(_0x217931[_0x6dc5('0x16')](_0x1216c8)){if(_0x217931[_0x1216c8][_0x6dc5('0x13')]&&_0x217931[_0x1216c8][_0x6dc5('0x12')]){var _0x3b6588=_0x217931[_0x1216c8][_0x6dc5('0x13')];if(!this[_0x6dc5('0xf')]['hasOwnProperty'](_0x3b6588['id'])){this[_0x6dc5('0xf')][_0x3b6588['id']]=new EmailImap(_0x3b6588,_0x217931[_0x1216c8][_0x6dc5('0x6')]);this[_0x6dc5('0xf')][_0x3b6588['id']]['on'](_0x6dc5('0x17'),this['handleImapBox'][_0x6dc5('0x18')](this,_0x1216c8));this[_0x6dc5('0xf')][_0x3b6588['id']]['on']('email',this[_0x6dc5('0x19')][_0x6dc5('0x18')](this,_0x1216c8));this[_0x6dc5('0xf')][_0x3b6588['id']]['on']('end',this['handleImapEnd'][_0x6dc5('0x18')](this,_0x1216c8));this[_0x6dc5('0xf')][_0x3b6588['id']]['on'](_0x6dc5('0x1a'),this['handleImapError'][_0x6dc5('0x18')](this,_0x1216c8));}}else{if(_[_0x6dc5('0x1b')](this[_0x6dc5('0xe')][_0x1216c8][_0x6dc5('0x13')])){this['mailAccounts'][_0x1216c8][_0x6dc5('0x13')]={};}this['mailAccounts'][_0x1216c8][_0x6dc5('0x13')]['status']=_0x6dc5('0x1c');this[_0x6dc5('0xe')][_0x1216c8][_0x6dc5('0x13')][_0x6dc5('0x14')]='';this['emit'](_0x1216c8);}}}};EmailChannel[_0x6dc5('0x10')][_0x6dc5('0x1d')]=function(_0x5d09b2,_0xd9da88){if(this[_0x6dc5('0xe')][_0x5d09b2]){this[_0x6dc5('0xe')][_0x5d09b2][_0x6dc5('0x13')]['status']=_0x6dc5('0x1e');this[_0x6dc5('0xe')][_0x5d09b2][_0x6dc5('0x13')][_0x6dc5('0x14')]=_0xd9da88[_0x6dc5('0x1f')];if(_0xd9da88[_0x6dc5('0x20')]){this[_0x6dc5('0xe')][_0x5d09b2]['Imap'][_0x6dc5('0x21')]=_0xd9da88['messages'][_0x6dc5('0x21')];}return this['emit'](_0x5d09b2);}};EmailChannel['prototype'][_0x6dc5('0x19')]=function(_0x371a16,_0x1d09bb){logger[_0x6dc5('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x1d09bb[_0x6dc5('0x22')],_0x1d09bb[_0x6dc5('0x23')],_0x1d09bb[_0x6dc5('0x24')],_0x371a16);if(this['mailAccounts'][_0x371a16]){return mailAccount[_0x6dc5('0x25')](_0x371a16,_0x1d09bb)[_0x6dc5('0x26')](function(_0x4a4d97){if(_0x4a4d97){logger[_0x6dc5('0xc')](_0x6dc5('0x27'));}})[_0x6dc5('0x28')](function(_0x5da95f){logger[_0x6dc5('0x1a')](_0x6dc5('0x29'),JSON[_0x6dc5('0x2a')](_0x5da95f));});}};EmailChannel[_0x6dc5('0x10')][_0x6dc5('0x2b')]=function(_0x2da1d1){if(this[_0x6dc5('0xe')][_0x2da1d1]&&this[_0x6dc5('0xe')][_0x2da1d1][_0x6dc5('0x13')]){if(this[_0x6dc5('0xf')][this[_0x6dc5('0xe')][_0x2da1d1][_0x6dc5('0x13')]['id']]){delete this['imapAccounts'][this[_0x6dc5('0xe')][_0x2da1d1]['Imap']['id']];}this[_0x6dc5('0xe')][_0x2da1d1][_0x6dc5('0x13')][_0x6dc5('0x2c')]=moment();this[_0x6dc5('0x11')](_0x2da1d1);}};EmailChannel[_0x6dc5('0x10')][_0x6dc5('0x2d')]=function(_0xcc4153,_0x524211){if(this[_0x6dc5('0xe')][_0xcc4153]){this['mailAccounts'][_0xcc4153][_0x6dc5('0x13')][_0x6dc5('0x2e')]='error';this[_0x6dc5('0xe')][_0xcc4153]['Imap']['messageStatus']=_0x524211;return this[_0x6dc5('0x11')](_0xcc4153);}};EmailChannel[_0x6dc5('0x10')][_0x6dc5('0x2f')]=function(_0x138fe7,_0x758d8){return this[_0x6dc5('0x30')][_0x6dc5('0x31')](_0x138fe7,_0x758d8);};EmailChannel[_0x6dc5('0x10')][_0x6dc5('0x32')]=function(_0xf5fc4d){var _0x43a0fc=this;if(this[_0x6dc5('0xe')][_0xf5fc4d['id']]){if(_[_0x6dc5('0x1b')](this['mailAccounts'][_0xf5fc4d['id']][_0x6dc5('0x33')])){this[_0x6dc5('0xe')][_0xf5fc4d['id']][_0x6dc5('0x33')]={};}this[_0x6dc5('0xe')][_0xf5fc4d['id']][_0x6dc5('0x33')][_0x6dc5('0x2c')]=moment();return new BPromise(function(_0x275bfb,_0x5b666b){return _0x43a0fc[_0x6dc5('0x30')]['verify'](_0xf5fc4d)[_0x6dc5('0x26')](function(_0x5769bc){_0x43a0fc[_0x6dc5('0xe')][_0xf5fc4d['id']][_0x6dc5('0x33')][_0x6dc5('0x2e')]=_0x6dc5('0x34');_0x43a0fc[_0x6dc5('0xe')][_0xf5fc4d['id']]['Smtp'][_0x6dc5('0x14')]='';_0x43a0fc[_0x6dc5('0x11')](_0xf5fc4d['id']);_0x275bfb(_0x5769bc);})[_0x6dc5('0x28')](function(_0x358399){_0x43a0fc['mailAccounts'][_0xf5fc4d['id']]['Smtp']['status']=_0x6dc5('0x1a');_0x43a0fc[_0x6dc5('0xe')][_0xf5fc4d['id']][_0x6dc5('0x33')]['messageStatus']=_0x358399;_0x43a0fc[_0x6dc5('0x11')](_0xf5fc4d['id']);_0x5b666b(_0x358399);});});}return this[_0x6dc5('0x30')][_0x6dc5('0x35')](_0xf5fc4d);};module[_0x6dc5('0x36')]=EmailChannel;
\ No newline at end of file
diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js
index df365fe..ab0c429 100644
--- a/server/services/email/lib/imap.js
+++ b/server/services/email/lib/imap.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2780=['getAccount','imap','once','ready','handleReady','bind','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','authentication','user','password','host','port','tls','getHost','service','email','anonymous@xcally.com','openBox','handleOpenBox','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','error','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','emit','stringify','textCode','exports','util','randomstring','mailparser','iconv','Iconv','./utils','account'];(function(_0x5a2201,_0x494e47){var _0x15b753=function(_0x2ab144){while(--_0x2ab144){_0x5a2201['push'](_0x5a2201['shift']());}};_0x15b753(++_0x494e47);}(_0x2780,0x1a1));var _0x0278=function(_0x372760,_0x5d0664){_0x372760=_0x372760-0x0;var _0x35212a=_0x2780[_0x372760];return _0x35212a;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x0278('0x0'));var Imap=require('imap');var _=require('lodash');var rs=require(_0x0278('0x1'));var simpleParser=require(_0x0278('0x2'))['simpleParser'];var Iconv=require(_0x0278('0x3'))[_0x0278('0x4')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0x0278('0x5'));var logger=require('../../../config/logger')('email');function EmailImap(_0x24d036,_0x1332b7){this['mailbox']='INBOX';this[_0x0278('0x6')]=this[_0x0278('0x7')](_0x24d036,_0x1332b7);this[_0x0278('0x8')]=new Imap(this[_0x0278('0x6')]);this[_0x0278('0x8')][_0x0278('0x9')](_0x0278('0xa'),this[_0x0278('0xb')][_0x0278('0xc')](this));this['imap'][_0x0278('0x9')](_0x0278('0xd'),this[_0x0278('0xe')][_0x0278('0xc')](this));this[_0x0278('0x8')]['on']('error',this[_0x0278('0xf')][_0x0278('0xc')](this));this['imap'][_0x0278('0x10')]();}util[_0x0278('0x11')](EmailImap,EventEmitter);EmailImap[_0x0278('0x12')][_0x0278('0x7')]=function(_0x4756f4,_0x5733ff){var _0x2f050e={'connTimeout':_0x4756f4[_0x0278('0x13')]?_0x4756f4[_0x0278('0x13')]*0x3e8:0x2710,'authTimeout':_0x4756f4[_0x0278('0x14')]?_0x4756f4[_0x0278('0x14')]*0x3e8:0x1388};if(_['isNil'](_0x4756f4['service'])){if(_0x4756f4[_0x0278('0x15')]){_0x2f050e[_0x0278('0x16')]=_0x4756f4[_0x0278('0x16')];_0x2f050e[_0x0278('0x17')]=_0x4756f4['password'];}_0x2f050e['host']=_0x4756f4[_0x0278('0x18')];_0x2f050e[_0x0278('0x19')]=_0x4756f4[_0x0278('0x19')]||0x3e1;if(_0x4756f4[_0x0278('0x1a')]){_0x2f050e['tls']=!![];}else{_0x2f050e[_0x0278('0x1a')]=![];_0x2f050e['autotls']='required';}}else{_0x2f050e[_0x0278('0x16')]=_0x4756f4[_0x0278('0x16')];_0x2f050e[_0x0278('0x17')]=_0x4756f4[_0x0278('0x17')];_0x2f050e[_0x0278('0x18')]=utils[_0x0278('0x1b')](_0x4756f4[_0x0278('0x1c')]);_0x2f050e[_0x0278('0x19')]=0x3e1;_0x2f050e['tls']=!![];}_0x2f050e[_0x0278('0x1d')]=_0x5733ff||_0x4756f4[_0x0278('0x16')]||_0x0278('0x1e');return _0x2f050e;};EmailImap[_0x0278('0x12')][_0x0278('0xb')]=function(){this['imap'][_0x0278('0x1f')](this['mailbox'],![],this[_0x0278('0x20')]['bind'](this));};EmailImap[_0x0278('0x12')][_0x0278('0x20')]=function(_0xa8cc32,_0x2f0bf0){if(_0xa8cc32){this[_0x0278('0xf')](_0xa8cc32,!![]);}else{this['emit']('box',_0x2f0bf0);this[_0x0278('0x21')]();}};EmailImap['prototype'][_0x0278('0x22')]=function(_0x598200){if(_0x598200){this[_0x0278('0xf')](_0x598200,!![]);}else{this[_0x0278('0x8')][_0x0278('0xd')]();}};EmailImap[_0x0278('0x12')][_0x0278('0x21')]=function(){this[_0x0278('0x8')][_0x0278('0x23')]([_0x0278('0x24')],this[_0x0278('0x25')][_0x0278('0xc')](this));};EmailImap[_0x0278('0x12')][_0x0278('0x25')]=function(_0x5cfc1d,_0x6f344a){if(_0x5cfc1d){this['handleError'](_0x5cfc1d,!![]);}else{if(_0x6f344a[_0x0278('0x26')]){try{var _0x4e6148=this['imap'][_0x0278('0x27')](_0x6f344a,{'bodies':'','markSeen':!![]});_0x4e6148['on']('message',this['handleFetchMessage'][_0x0278('0xc')](this));_0x4e6148[_0x0278('0x9')](_0x0278('0x28'),this[_0x0278('0x29')]['bind'](this));_0x4e6148['once'](_0x0278('0xd'),this[_0x0278('0x2a')][_0x0278('0xc')](this));}catch(_0x2eb415){logger[_0x0278('0x28')](_0x2eb415);}}else{this[_0x0278('0x8')][_0x0278('0x2b')](!![],this[_0x0278('0x22')][_0x0278('0xc')](this));}}};EmailImap['prototype'][_0x0278('0x2c')]=function(_0x4e4daf,_0x38d3d7){_0x4e4daf['on']('body',this['handleMessageBody'][_0x0278('0xc')](this));_0x4e4daf['once'](_0x0278('0x2d'),this[_0x0278('0x2e')]['bind'](this));_0x4e4daf[_0x0278('0x9')](_0x0278('0xd'),this['handleMessageEnd'][_0x0278('0xc')](this));};EmailImap[_0x0278('0x12')]['handleMessageBody']=function(_0x158ff6,_0x3301d9){simpleParser(_0x158ff6,{'Iconv':Iconv},this[_0x0278('0x2f')][_0x0278('0xc')](this));};EmailImap['prototype'][_0x0278('0x2e')]=function(_0x47dc5c){};EmailImap['prototype'][_0x0278('0x30')]=function(){};EmailImap['prototype'][_0x0278('0x2f')]=function(_0x5b7f68,_0x1a17c4){if(_0x5b7f68){logger[_0x0278('0x28')](_0x5b7f68);}else{var _0x4467d2=this;utils['parser'](this[_0x0278('0x6')],_0x1a17c4,function(_0x5cd209){_0x4467d2[_0x0278('0x31')]('email',_0x5cd209);});}};EmailImap[_0x0278('0x12')][_0x0278('0x2a')]=function(){this[_0x0278('0x8')][_0x0278('0x2b')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype']['handleFetchError']=function(_0x125743){this[_0x0278('0xf')](_0x125743);this[_0x0278('0x8')][_0x0278('0x2b')](!![],this[_0x0278('0x22')][_0x0278('0xc')](this));};EmailImap[_0x0278('0x12')]['handleEnd']=function(){this[_0x0278('0x31')](_0x0278('0xd'));};EmailImap['prototype'][_0x0278('0xf')]=function(_0x54197a,_0x32d5fc){logger['error']('handleError',this[_0x0278('0x6')][_0x0278('0x1d')],JSON[_0x0278('0x32')](_0x54197a));var _0x4aa73a='';if(_0x54197a){if(_0x54197a[_0x0278('0x33')]){_0x4aa73a=_0x54197a[_0x0278('0x33')];}else{for(var _0x4bd9ae in _0x54197a){if(_0x54197a['hasOwnProperty'](_0x4bd9ae)){_0x4aa73a+=_['upperFirst'](_0x4bd9ae)+':\x20'+_0x54197a[_0x4bd9ae]+'\x0a';}}}}if(_0x32d5fc){this['imap'][_0x0278('0xd')]();}else{this['emit']('error',_0x4aa73a);this[_0x0278('0x31')](_0x0278('0xd'));}};module[_0x0278('0x34')]=EmailImap;
\ No newline at end of file
+var _0x1eec=['INBOX','account','getAccount','imap','once','ready','bind','end','error','handleError','prototype','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','handleReady','openBox','handleOpenBox','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleEnd','stringify','textCode','hasOwnProperty','exports','util','lodash','mailparser','simpleParser','iconv','events','EventEmitter','email','mailbox'];(function(_0x46aad3,_0x5c363f){var _0x20e425=function(_0x3980d2){while(--_0x3980d2){_0x46aad3['push'](_0x46aad3['shift']());}};_0x20e425(++_0x5c363f);}(_0x1eec,0x1bf));var _0xc1ee=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x1eec[_0x1928c9];return _0x51b5fb;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xc1ee('0x0'));var Imap=require('imap');var _=require(_0xc1ee('0x1'));var rs=require('randomstring');var simpleParser=require(_0xc1ee('0x2'))[_0xc1ee('0x3')];var Iconv=require(_0xc1ee('0x4'))['Iconv'];var EventEmitter=require(_0xc1ee('0x5'))[_0xc1ee('0x6')];var utils=require('./utils');var logger=require('../../../config/logger')(_0xc1ee('0x7'));function EmailImap(_0x16f56d,_0x3619c8){this[_0xc1ee('0x8')]=_0xc1ee('0x9');this[_0xc1ee('0xa')]=this[_0xc1ee('0xb')](_0x16f56d,_0x3619c8);this[_0xc1ee('0xc')]=new Imap(this['account']);this[_0xc1ee('0xc')][_0xc1ee('0xd')](_0xc1ee('0xe'),this['handleReady'][_0xc1ee('0xf')](this));this['imap']['once'](_0xc1ee('0x10'),this['handleEnd']['bind'](this));this['imap']['on'](_0xc1ee('0x11'),this[_0xc1ee('0x12')][_0xc1ee('0xf')](this));this[_0xc1ee('0xc')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xc1ee('0x13')]['getAccount']=function(_0x5b61c9,_0x8b2218){var _0x162fd3={'connTimeout':_0x5b61c9['connTimeout']?_0x5b61c9['connTimeout']*0x3e8:0x2710,'authTimeout':_0x5b61c9[_0xc1ee('0x14')]?_0x5b61c9['authTimeout']*0x3e8:0x1388};if(_[_0xc1ee('0x15')](_0x5b61c9[_0xc1ee('0x16')])){if(_0x5b61c9[_0xc1ee('0x17')]){_0x162fd3[_0xc1ee('0x18')]=_0x5b61c9[_0xc1ee('0x18')];_0x162fd3['password']=_0x5b61c9[_0xc1ee('0x19')];}_0x162fd3[_0xc1ee('0x1a')]=_0x5b61c9[_0xc1ee('0x1a')];_0x162fd3[_0xc1ee('0x1b')]=_0x5b61c9[_0xc1ee('0x1b')]||0x3e1;if(_0x5b61c9[_0xc1ee('0x1c')]){_0x162fd3[_0xc1ee('0x1c')]=!![];}else{_0x162fd3['tls']=![];_0x162fd3[_0xc1ee('0x1d')]='required';}}else{_0x162fd3['user']=_0x5b61c9['user'];_0x162fd3[_0xc1ee('0x19')]=_0x5b61c9[_0xc1ee('0x19')];_0x162fd3['host']=utils[_0xc1ee('0x1e')](_0x5b61c9[_0xc1ee('0x16')]);_0x162fd3[_0xc1ee('0x1b')]=0x3e1;_0x162fd3[_0xc1ee('0x1c')]=!![];}_0x162fd3[_0xc1ee('0x7')]=_0x8b2218||_0x5b61c9[_0xc1ee('0x18')]||_0xc1ee('0x1f');return _0x162fd3;};EmailImap[_0xc1ee('0x13')][_0xc1ee('0x20')]=function(){this[_0xc1ee('0xc')][_0xc1ee('0x21')](this['mailbox'],![],this[_0xc1ee('0x22')][_0xc1ee('0xf')](this));};EmailImap[_0xc1ee('0x13')][_0xc1ee('0x22')]=function(_0x2aa903,_0x3d7fcd){if(_0x2aa903){this[_0xc1ee('0x12')](_0x2aa903,!![]);}else{this['emit']('box',_0x3d7fcd);this[_0xc1ee('0x23')]();}};EmailImap[_0xc1ee('0x13')][_0xc1ee('0x24')]=function(_0x3fdd5f){if(_0x3fdd5f){this[_0xc1ee('0x12')](_0x3fdd5f,!![]);}else{this[_0xc1ee('0xc')][_0xc1ee('0x10')]();}};EmailImap[_0xc1ee('0x13')]['readUnseen']=function(){this[_0xc1ee('0xc')]['search']([_0xc1ee('0x25')],this[_0xc1ee('0x26')][_0xc1ee('0xf')](this));};EmailImap[_0xc1ee('0x13')]['handleReadUnseen']=function(_0x4a6570,_0x2d512d){if(_0x4a6570){this[_0xc1ee('0x12')](_0x4a6570,!![]);}else{if(_0x2d512d[_0xc1ee('0x27')]){try{var _0x4e5e76=this[_0xc1ee('0xc')]['fetch'](_0x2d512d,{'bodies':'','markSeen':!![]});_0x4e5e76['on'](_0xc1ee('0x28'),this['handleFetchMessage']['bind'](this));_0x4e5e76[_0xc1ee('0xd')](_0xc1ee('0x11'),this[_0xc1ee('0x29')][_0xc1ee('0xf')](this));_0x4e5e76['once'](_0xc1ee('0x10'),this[_0xc1ee('0x2a')]['bind'](this));}catch(_0x34a3ff){logger[_0xc1ee('0x11')](_0x34a3ff);}}else{this[_0xc1ee('0xc')][_0xc1ee('0x2b')](!![],this[_0xc1ee('0x24')]['bind'](this));}}};EmailImap[_0xc1ee('0x13')][_0xc1ee('0x2c')]=function(_0x15d28b,_0x42db86){_0x15d28b['on'](_0xc1ee('0x2d'),this[_0xc1ee('0x2e')][_0xc1ee('0xf')](this));_0x15d28b['once']('attributes',this[_0xc1ee('0x2f')][_0xc1ee('0xf')](this));_0x15d28b[_0xc1ee('0xd')](_0xc1ee('0x10'),this[_0xc1ee('0x30')][_0xc1ee('0xf')](this));};EmailImap[_0xc1ee('0x13')][_0xc1ee('0x2e')]=function(_0x56eba0,_0x6ca2e0){simpleParser(_0x56eba0,{'Iconv':Iconv},this[_0xc1ee('0x31')]['bind'](this));};EmailImap['prototype'][_0xc1ee('0x2f')]=function(_0x2581a0){};EmailImap[_0xc1ee('0x13')][_0xc1ee('0x30')]=function(){};EmailImap[_0xc1ee('0x13')]['handleSimpleParser']=function(_0x35a6eb,_0x37f376){if(_0x35a6eb){logger[_0xc1ee('0x11')](_0x35a6eb);}else{var _0x181edf=this;utils[_0xc1ee('0x32')](this['account'],_0x37f376,function(_0x573588){_0x181edf[_0xc1ee('0x33')](_0xc1ee('0x7'),_0x573588);});}};EmailImap[_0xc1ee('0x13')]['handleFetchEnd']=function(){this[_0xc1ee('0xc')][_0xc1ee('0x2b')](!![],this[_0xc1ee('0x24')][_0xc1ee('0xf')](this));};EmailImap[_0xc1ee('0x13')][_0xc1ee('0x29')]=function(_0x3d5499){this[_0xc1ee('0x12')](_0x3d5499);this[_0xc1ee('0xc')]['closeBox'](!![],this[_0xc1ee('0x24')][_0xc1ee('0xf')](this));};EmailImap['prototype'][_0xc1ee('0x34')]=function(){this[_0xc1ee('0x33')](_0xc1ee('0x10'));};EmailImap[_0xc1ee('0x13')][_0xc1ee('0x12')]=function(_0x42e262,_0x40d55f){logger[_0xc1ee('0x11')](_0xc1ee('0x12'),this[_0xc1ee('0xa')][_0xc1ee('0x7')],JSON[_0xc1ee('0x35')](_0x42e262));var _0x42c5c6='';if(_0x42e262){if(_0x42e262[_0xc1ee('0x36')]){_0x42c5c6=_0x42e262['textCode'];}else{for(var _0x2635ed in _0x42e262){if(_0x42e262[_0xc1ee('0x37')](_0x2635ed)){_0x42c5c6+=_['upperFirst'](_0x2635ed)+':\x20'+_0x42e262[_0x2635ed]+'\x0a';}}}}if(_0x40d55f){this[_0xc1ee('0xc')][_0xc1ee('0x10')]();}else{this[_0xc1ee('0x33')]('error',_0x42c5c6);this['emit'](_0xc1ee('0x10'));}};module[_0xc1ee('0x38')]=EmailImap;
\ No newline at end of file
diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js
index e3d55dd..d5d6f1e 100644
--- a/server/services/email/lib/smtp.js
+++ b/server/services/email/lib/smtp.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55a7=['verify','exports','nodemailer','prototype','send','createTransport','use','compile','toString'];(function(_0x2b55cb,_0x1fa6a9){var _0x494fa9=function(_0x21d315){while(--_0x21d315){_0x2b55cb['push'](_0x2b55cb['shift']());}};_0x494fa9(++_0x1fa6a9);}(_0x55a7,0x119));var _0x755a=function(_0x1e1a22,_0x28c6f0){_0x1e1a22=_0x1e1a22-0x0;var _0x505a5a=_0x55a7[_0x1e1a22];return _0x505a5a;};'use strict';var nodemailer=require(_0x755a('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x755a('0x1')][_0x755a('0x2')]=function(_0xfc467e,_0xba0941){return new BPromise(function(_0x462621,_0xed9816){var _0x27b22f=nodemailer[_0x755a('0x3')](_0xfc467e);_0x27b22f[_0x755a('0x4')](_0x755a('0x5'),inlineBase64());_0x27b22f['sendMail'](_0xba0941,function(_0x401b06,_0x31adc8){if(_0x401b06){_0xed9816(_0x401b06[_0x755a('0x6')]());}else{_0x462621(_0x31adc8);}});});};EmailSmtp[_0x755a('0x1')][_0x755a('0x7')]=function(_0x36c82a){return new BPromise(function(_0x353abc,_0x4a1757){var _0x4e46f6=nodemailer[_0x755a('0x3')](_0x36c82a);_0x4e46f6[_0x755a('0x7')](function(_0x2b622e,_0x24206c){if(_0x2b622e){_0x4a1757(_0x2b622e[_0x755a('0x6')]());}else{if(_0x24206c){_0x353abc(_0x24206c);}else{_0x4a1757('Not\x20verifired');}}});});};module[_0x755a('0x8')]=EmailSmtp;
\ No newline at end of file
+var _0x4f88=['send','createTransport','use','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','prototype'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x4f88,0x1de));var _0x84f8=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x4f88[_0x1ca890];return _0x3f8e01;};'use strict';var nodemailer=require(_0x84f8('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x84f8('0x1')][_0x84f8('0x2')]=function(_0x230429,_0x38006){return new BPromise(function(_0x3ab782,_0x24bfc8){var _0x751fee=nodemailer[_0x84f8('0x3')](_0x230429);_0x751fee[_0x84f8('0x4')]('compile',inlineBase64());_0x751fee[_0x84f8('0x5')](_0x38006,function(_0x486c31,_0x51336e){if(_0x486c31){_0x24bfc8(_0x486c31[_0x84f8('0x6')]());}else{_0x3ab782(_0x51336e);}});});};EmailSmtp[_0x84f8('0x1')][_0x84f8('0x7')]=function(_0x2a67c9){return new BPromise(function(_0x27edcd,_0x20bd2b){var _0x280459=nodemailer[_0x84f8('0x3')](_0x2a67c9);_0x280459[_0x84f8('0x7')](function(_0x3cf5c4,_0x231564){if(_0x3cf5c4){_0x20bd2b(_0x3cf5c4['toString']());}else{if(_0x231564){_0x27edcd(_0x231564);}else{_0x20bd2b(_0x84f8('0x8'));}}});});};module[_0x84f8('0x9')]=EmailSmtp;
\ No newline at end of file
diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js
index c55fa22..57d611c 100644
--- a/server/services/email/lib/utils.js
+++ b/server/services/email/lib/utils.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c3b=['Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','join','Anonymous','isEmpty','html','test','replace','body','Empty\x20message '];(function(_0x414373,_0x4fa4b0){var _0xda69fd=function(_0x58a4d7){while(--_0x58a4d7){_0x414373['push'](_0x414373['shift']());}};_0xda69fd(++_0x4fa4b0);}(_0x7c3b,0x1a4));var _0xb7c3=function(_0x29a8b3,_0x1f22b9){_0x29a8b3=_0x29a8b3-0x0;var _0x4e5fc9=_0x7c3b[_0x29a8b3];return _0x4e5fc9;};'use strict';var _=require(_0xb7c3('0x0'));var moment=require(_0xb7c3('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0xb7c3('0x2'));var tnef=require(_0xb7c3('0x3'));var logger=require(_0xb7c3('0x4'))(_0xb7c3('0x5'));var config=require(_0xb7c3('0x6'));function getAddress(_0x1fa258){var _0x257f92=_[_0xb7c3('0x7')](_0x1fa258[_0xb7c3('0x8')]);return _0x257f92&&_0x257f92[_0xb7c3('0x9')]?_0x257f92['address']:_0xb7c3('0xa')+random[_0xb7c3('0xb')](0x6)+_0xb7c3('0xc');}function getFirstName(_0x5c389d){var _0x12ba59=_[_0xb7c3('0x7')](_0x5c389d[_0xb7c3('0x8')]);if(_0x12ba59&&_0x12ba59[_0xb7c3('0xd')]){var _0x16dddd=_0x12ba59[_0xb7c3('0xd')][_0xb7c3('0xe')](/\s+/);return _0x16dddd[_0xb7c3('0xf')]?_0x16dddd[_0xb7c3('0x10')](0x0,-0x1)[_0xb7c3('0x11')]('\x20'):_0x12ba59[_0xb7c3('0xd')];}return _0xb7c3('0x12');}function getLastName(_0x55a8fa){var _0x4e7bb9=_[_0xb7c3('0x7')](_0x55a8fa[_0xb7c3('0x8')]);if(_0x4e7bb9&&_0x4e7bb9[_0xb7c3('0xd')]){var _0x28b24a=_0x4e7bb9[_0xb7c3('0xd')]['split'](/\s+/);return _0x28b24a[_0xb7c3('0xf')]>0x1?_0x28b24a['pop']():'';}return'';}function getMails(_0x296c36,_0x3880f0){var _0x5ddae3='';for(var _0x3b8305=0x0;_0x3b8305<_0x3880f0[_0xb7c3('0x8')][_0xb7c3('0xf')];_0x3b8305+=0x1){if(_0x3880f0[_0xb7c3('0x8')][_0x3b8305][_0xb7c3('0x9')]!==_0x296c36){if(!_[_0xb7c3('0x13')](_0x5ddae3)){_0x5ddae3+=',';}_0x5ddae3+=_0x3880f0[_0xb7c3('0x8')][_0x3b8305]['name']||_0x3880f0[_0xb7c3('0x8')][_0x3b8305][_0xb7c3('0x9')]||'';_0x5ddae3+='\x20<';_0x5ddae3+=_0x3880f0[_0xb7c3('0x8')][_0x3b8305][_0xb7c3('0x9')]?_0x3880f0[_0xb7c3('0x8')][_0x3b8305]['address']:_0xb7c3('0xa')+random[_0xb7c3('0xb')](0x6)+'@xcally.com';_0x5ddae3+='>';}}return _0x5ddae3;}function parseEmail(_0xb1c5e7,_0x5044c5,_0xe3ce4){if(_0x5044c5[_0xb7c3('0x14')]){var _0x2e5260=/